diff --git a/README.md b/README.md index 89eec6f..7a43b76 100644 --- a/README.md +++ b/README.md @@ -22,5 +22,9 @@ yarn build yarn lint ``` +## Updating RAMP versions +The marketing site now contains instances of both RAMP2 and RAMP4. Both versions use a global variable called ```RAMP``` and will cause a conflict. +When updating ramp.js to the latest version, you will need to update the variable name to ```RAMP4``` at the top of the script. + ### Customize configuration -See [Configuration Reference](https://cli.vuejs.org/config/). +See [Configuration Reference](https://cli.vuejs.org/config/). \ No newline at end of file diff --git a/public/js/ramp.js b/public/js/ramp.js index 61c031d..166b5be 100644 --- a/public/js/ramp.js +++ b/public/js/ramp.js @@ -1,9 +1,9 @@ -var RAMP4=function(U0){"use strict";var S1=(t=>(t.BLOB="blob",t.DATE="date",t.DOUBLE="double",t.GEOMETRY="geometry",t.GLOBAL_ID="global-id",t.GUID="guid",t.INTEGER="integer",t.LONG="long",t.OID="oid",t.RASTER="raster",t.SINGLE="single",t.SMALL_INTEGER="small-integer",t.STRING="string",t.XML="xml",t))(S1||{}),vC=(t=>(t.CIRCLE="circle",t.CROSS="cross",t.DIAMOND="diamond",t.ICON="icon",t.PATH="path",t.SQUARE="square",t.TRIANGLE="triangle",t.X="x",t))(vC||{}),Gv=(t=>(t.DASH="dash",t.DASHDOT="dash-dot",t.DASHDOTDOT="short-dash-dot-dot",t.DOT="dot",t.LONGDASH="long-dash",t.LONGDASHDOT="long-dash-dot",t.LONGDASHDOTDOT="long-dash-dot-dot",t.NONE="none",t.NULL="none",t.SHORTDASH="short-dash",t.SHORTDASHDOT="short-dash-dot",t.SHORTDASHDOTDOT="short-dash-dot-dot",t.SHORTDOT="short-dot",t.SOLID="solid",t))(Gv||{}),YBe=(t=>(t.BEVEL="bevel",t.MITER="miter",t.ROUND="round",t))(YBe||{}),XBe=(t=>(t.ROUND="round",t.BUTT="butt",t.SQUARE="square",t))(XBe||{}),KBe=(t=>(t.BDIAG="backward-diagonal",t.CROSS="cross",t.DIAG_CROSS="diagonal-cross",t.FDIAG="forward-diagonal",t.HORIZONTAL="horizontal",t.NONE="none",t.NULL="none",t.SOLID="solid",t.VERTICAL="vertical",t))(KBe||{}),Rl=(t=>(t.POINT="Point",t.MULTIPOINT="MultiPoint",t.LINESTRING="LineString",t.MULTILINESTRING="MultiLineString",t.POLYGON="Polygon",t.MULTIPOLYGON="MultiPolygon",t.LINEARRING="LinearRing",t.EXTENT="Extent",t.NONE="None",t.UNKNOWN="Unknown",t))(Rl||{}),wre=(t=>(t.Simple="simple",t.Unique="uniqueValue",t.ClassBreaks="classBreaks",t.Unknown="unknown",t))(wre||{}),_n=(t=>(t.FEATURE="esri-feature",t.MAPIMAGE="esri-map-image",t.TILE="esri-tile",t.IMAGERY="esri-imagery",t.GRAPHIC="esri-graphic",t.WMS="ogc-wms",t.WFS="ogc-wfs",t.GEOJSON="file-geojson",t.CSV="file-csv",t.SHAPEFILE="file-shape",t.OSM="osm-tile",t.UNKNOWN="unknown",t.SUBLAYER="sublayer",t))(_n||{}),Hx=(t=>(t.FEATURE="feature",t.GRAPHIC="graphic",t.IMAGERY="imagery",t.MAPIMAGE="map-image",t.OSM="osm-tile",t.TILE="tile",t.UNKNOWN="unknown",t.WMS="wms",t))(Hx||{}),C1=(t=>(t.ESRI_FEATURE="esriFeature",t.ESRI_RASTER="esriRaster",t.ESRI_TILE="esriTile",t.OSM_TILE="osmTile",t.OGC_RASTER="ogcRaster",t.UNKNOWN="unknown",t))(C1||{}),Cp=(t=>(t.POINT="Point",t.MULTIPOINT="MultiPoint",t.LINESTRING="LineString",t.MULTILINESTRING="MultiLineString",t.POLYGON="Polygon",t.MULTIPOLYGON="MultiPolygon",t))(Cp||{}),vm=(t=>(t.GEOMETRIC="geometric",t.SYMBOLIC="symbolic",t.HYBRID="hybrid",t.NONE="none",t))(vm||{}),T1=(t=>(t.NEW="new",t.INITIATING="initiating",t.INITIATED="initiated",t.TERMINATING="terminating",t.TERMINATED="terminated",t))(T1||{}),j0=(t=>(t.NEW="new",t.LOADING="loading",t.LOADED="loaded",t.ERROR="error",t))(j0||{}),Ub=(t=>(t.NOT_LOADED="not-loaded",t.REFRESH="refresh",t.UP_TO_DATE="up-to-date",t))(Ub||{}),XI=(t=>(t.ESRI="esri",t.TEXT="text",t.IMAGE="image",t.HTML="html",t.XML="xml",t.JSON="json",t.UNKNOWN="unknown",t))(XI||{}),$g=(t=>(t.SYMBOL="symbol",t.GRID="grid",t.EXTENT="extent",t.INITIAL="initial",t.API="api",t.PERMANENT="permanent",t))($g||{}),jl=(t=>(t.BoundaryZoom="boundaryZoom",t.Datatable="datatable",t.Identify="identify",t.Metadata="metadata",t.Opacity="opacity",t.Refresh="refresh",t.Reload="reload",t.Remove="remove",t.Settings="settings",t.Symbology="symbology",t.Visibility="visibility",t))(jl||{});class Wx{attributes;geometry;style;id;constructor(e,i,r){this.geometry=e,i?this.id=i:this.id=vN.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 E(t,e,i,r){var n,s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(s<3?n(o):s>3?n(e,i,o):n(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o}function lkt(t){return t&&t.release&&typeof t.release=="function"}function ukt(t){return t&&t.acquire&&typeof t.acquire=="function"}let _C=class R9e{constructor(e,i,r,n=1,s=0){if(this._ctor=e,this._acquireFunction=i,this._releaseFunction=r,this.allocationSize=n,this._pool=new Array(s),this._initialSize=s,this._ctor)for(let o=0;o=this._pool.length)){for(let i=e;iye(e))}function qx(t,...e){let i=t;for(let r=0;r{e+=i.length}),e}add(e,i){if(Sre(e)){const r=this._getOrCreateGroup(i);for(const n of e)this._isHandle(n)&&r.push(n)}else this._isHandle(e)&&this._getOrCreateGroup(i).push(e);return this}forEach(e,i){if(typeof e=="function")this._groups.forEach(r=>r.forEach(e));else{const r=this._getGroup(e);r&&i&&r.forEach(i)}}has(e){return this._groups.has(this._ensureGroupKey(e))}remove(e){if(typeof e!="string"&&Sre(e)){for(const i of e)this.remove(i);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}_getOrCreateGroup(e){if(this.has(e))return this._getGroup(e);const i=[];return this._groups.set(this._ensureGroupKey(e),i),i}_getGroup(e){return this._groups.get(this._ensureGroupKey(e))}_ensureGroupKey(e){return e||"_default_"}_removeAllFromGroup(e){e.forEach(i=>i.remove())}};const ZBe=Symbol("Accessor-beforeDestroy");function D8(t){return KI(()=>t.forEach(e=>ye(e)&&e.remove()))}function KI(t){return{remove:()=>{t&&(t(),t=void 0)}}}let bC=class A8{constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*A8._m}getInt(){return this._seed=(A8._a*this._seed+A8._c)%A8._m,this._seed}getFloat(){return this.getInt()/(A8._m-1)}getIntRange(e,i){return Math.round(this.getFloatRange(e,i))}getFloatRange(e,i){const r=i-e;return e+this.getInt()/A8._m*r}};bC._m=2147483647,bC._a=48271,bC._c=0;function fkt(t,e){return e?t.filter((i,r,n)=>n.findIndex(e.bind(null,i))===r):t.filter((i,r,n)=>n.indexOf(i)===r)}function _H(t,e,i){if(lt(t)&<(e))return!0;if(lt(t)||lt(e)||t.length!==e.length)return!1;if(i){for(let r=0;r!t.some(o=>i(o,s))),n=t.filter(s=>!e.some(o=>i(o,s)))):(r=e.filter(s=>!t.includes(s)),n=t.filter(s=>!e.includes(s))),{added:r,removed:n}}function eGe(t){return t&&typeof t.length=="number"}const gkt=!!Array.prototype.fill;function ykt(t,e){if(gkt)return new Array(t).fill(e);const i=new Array(t);for(let r=0;r{const s=g_e(n);return n!=null&&s==null&&(i=!1),s});return i?r:null}if(aGe(t))return t.clone();if(!uGe(t)){const i=new(Object.getPrototypeOf(t)).constructor;for(const r of Object.getOwnPropertyNames(t)){const n=t[r],s=g_e(n);if(n!=null&&s==null)return null;i[r]=s}return i}return null}function aGe(t){return typeof t.clone=="function"}function lGe(t){return typeof t.map=="function"&&typeof t.forEach=="function"}function uGe(t){return typeof t.notifyChange=="function"&&typeof t.watch=="function"}function cGe(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function hGe(t){if(bkt(t)||sL(t)||rGe(t)||nGe(t)||m_e(t)||sGe(t)||oGe(t)||wkt(t)||xkt(t))return t.slice();if(t instanceof Date)return new Date(t.getTime());if(t instanceof ArrayBuffer)return t.slice(0,t.byteLength);if(t instanceof Map){const e=new Map;for(const[i,r]of t)e.set(i,hi(r));return e}if(t instanceof Set){const e=new Set;for(const i of t)e.add(hi(i));return e}return null}function y_e(t,e){return t===e||typeof t=="number"&&isNaN(t)&&typeof e=="number"&&isNaN(e)||typeof(t||{}).getTime=="function"&&typeof(e||{}).getTime=="function"&&t.getTime()===e.getTime()||!1}function Skt(t,e){return t===e||(t==null||typeof t=="string"?t===e:typeof t=="number"?t===e||typeof e=="number"&&isNaN(t)&&isNaN(e):t instanceof Date?e instanceof Date&&t.getTime()===e.getTime():Array.isArray(t)?Array.isArray(e)&&_H(t,e):t instanceof Set?e instanceof Set&&Tkt(t,e):t instanceof Map?e instanceof Map&&Ekt(t,e):!!cGe(t)&&cGe(e)&&Ckt(t,e))}function Ckt(t,e){if(t===null||e===null)return!1;const i=Object.keys(t);if(e===null||Object.keys(e).length!==i.length)return!1;for(const r of i)if(t[r]!==e[r]||!Object.prototype.hasOwnProperty.call(e,r))return!1;return!0}function Tkt(t,e){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function Ekt(t,e){if(t.size!==e.size)return!1;for(const[i,r]of t){const n=e.get(i);if(n!==r||n===void 0&&!e.has(i))return!1}return!0}function Tp(t){return t?t.__accessor__?t.__accessor__:t.propertyInvalidated?t:null:null}function Ikt(t,e){return t!=null&&t.metadatas&&t.metadatas[e]!=null}function Ere(t,e,i){return i?Ire(t,e,{policy:i,path:""}):Ire(t,e,null)}function Ire(t,e,i){return e?Object.keys(e).reduce((r,n)=>{let s=null,o="merge";if(i&&(s=i.path?`${i.path}.${n}`:n,o=i.policy(s)),o==="replace"||o==="replace-arrays"&&Array.isArray(r[n]))return r[n]=e[n],r;if(r[n]===void 0)return r[n]=hi(e[n]),r;let a=r[n],l=e[n];if(a===l)return r;if(Array.isArray(l)||Array.isArray(r))a=a?Array.isArray(a)?r[n]=a.concat():r[n]=[a]:r[n]=[],l&&(Array.isArray(l)||(l=[l]),l.forEach(c=>{a.includes(c)||a.push(c)}));else if(l&&typeof l=="object")if(i){const c=i.path;i.path=s,r[n]=Ire(a,l,i),i.path=c}else r[n]=Ire(a,l,null);else r.hasOwnProperty(n)&&!e.hasOwnProperty(n)||(r[n]=l);return r},t||{}):t}function dGe(t){return Array.isArray(t)?t:t.split(".")}function pGe(t){return t.includes(",")?t.split(",").map(e=>e.trim()):[t.trim()]}function Akt(t){if(Array.isArray(t)){const e=[];for(const i of t)e.push(...pGe(i));return e}return pGe(t)}function fGe(t,e,i,r){const n=Akt(e);if(n.length!==1){const s=n.map(o=>r(t,o,i));return D8(s)}return r(t,n[0],i)}function mGe(t){let e=!1;return()=>{e||(e=!0,t())}}function gGe(t,e){const i=t[t.length-1]==="?"?t.slice(0,-1):t;if(e.getItemAt!=null||Array.isArray(e)){const n=parseInt(i,10);if(!isNaN(n))return Array.isArray(e)?e[n]:e.getItemAt(n)}const r=Tp(e);return Ikt(r,i)?r.get(i):e[i]}function yGe(t,e,i){if(t==null)return t;const r=gGe(e[i],t);return!r&&i((r||$3[t]===void 0)&&($3[t]=e),i&&Gi(t)),Gi.cache=$3,Gi.add("esri-deprecation-warnings",!0),(()=>{Gi.add("host-webworker",globalThis.WorkerGlobalScope!==void 0&&self instanceof globalThis.WorkerGlobalScope);const t=typeof window<"u"&&typeof location<"u"&&typeof document<"u"&&window.location===location&&window.document===document;if(Gi.add("host-browser",t),Gi.add("host-node",typeof globalThis.process=="object"&&globalThis.process.versions?.node&&globalThis.process.versions.v8),Gi.add("dom",t),Gi("host-browser")){const e=navigator,i=e.userAgent,r=e.appVersion,n=parseFloat(r);if(Gi.add("wp",parseFloat(i.split("Windows Phone")[1])||void 0),Gi.add("msapp",parseFloat(i.split("MSAppHost/")[1])||void 0),Gi.add("khtml",r.includes("Konqueror")?n:void 0),Gi.add("edge",parseFloat(i.split("Edge/")[1])||void 0),Gi.add("opr",parseFloat(i.split("OPR/")[1])||void 0),Gi.add("webkit",!Gi("wp")&&!Gi("edge")&&parseFloat(i.split("WebKit/")[1])||void 0),Gi.add("chrome",!Gi("edge")&&!Gi("opr")&&parseFloat(i.split("Chrome/")[1])||void 0),Gi.add("android",!Gi("wp")&&parseFloat(i.split("Android ")[1])||void 0),Gi.add("safari",!r.includes("Safari")||Gi("wp")||Gi("chrome")||Gi("android")||Gi("edge")||Gi("opr")?void 0:parseFloat(r.split("Version/")[1])),Gi.add("mac",r.includes("Macintosh")),!Gi("wp")&&i.match(/(iPhone|iPod|iPad)/)){const s=RegExp.$1.replace(/P/,"p"),o=i.match(/OS ([\d_]+)/)?RegExp.$1:"1",a=parseFloat(o.replace(/_/,".").replace(/_/g,""));Gi.add(s,a),Gi.add("ios",a)}Gi("webkit")||(!i.includes("Gecko")||Gi("wp")||Gi("khtml")||Gi("edge")||Gi.add("mozilla",n),Gi("mozilla")&&Gi.add("ff",parseFloat(i.split("Firefox/")[1]||i.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const t=navigator.userAgent,e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(t),i=/iPhone/i.test(t);e&&Gi.add("esri-mobile",e),i&&Gi.add("esri-iPhone",i),Gi.add("esri-geolocation",!!navigator.geolocation)}Gi.add("esri-wasm","WebAssembly"in globalThis),Gi.add("esri-shared-array-buffer",()=>{const t="SharedArrayBuffer"in globalThis,e=globalThis.crossOriginIsolated===!1;return t&&!e}),Gi.add("wasm-simd",()=>{const t=[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(t))}),Gi.add("esri-atomics","Atomics"in globalThis),Gi.add("esri-workers","Worker"in globalThis),Gi.add("web-feat:cache","caches"in globalThis),Gi.add("esri-workers-arraybuffer-transfer",!Gi("safari")||Number(Gi("safari"))>=12),Gi.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),Gi.add("featurelayer-simplify-payload-size-factors",[1,1,4]),Gi.add("featurelayer-snapshot-enabled",!0),Gi.add("featurelayer-snapshot-point-min-threshold",8e4),Gi.add("featurelayer-snapshot-point-max-threshold",4e5),Gi.add("featurelayer-snapshot-point-coverage",.1),Gi.add("featurelayer-advanced-symbols",!1),Gi.add("featurelayer-pbf",!0),Gi.add("featurelayer-pbf-statistics",!1),Gi.add("feature-layers-workers",!0),Gi.add("feature-polyline-generalization-factor",1),Gi.add("mapview-transitions-duration",200),Gi.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),Gi.add("mapserver-pbf-version-support",10.81),Gi.add("mapservice-popup-identify-max-tolerance",20),Gi.add("heatmap-allow-raster-fallback",!0),Gi.add("heatmap-force-raster",!1),Gi("host-webworker")||Gi("host-browser")&&(Gi.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),Gi.add("esri-image-decode",()=>{if("decode"in new Image){const t=new Image;return t.src='data:image/svg+xml;charset=UTF-8,',void t.decode().then(()=>{Gi.add("esri-image-decode",!0,!0,!0)}).catch(()=>{Gi.add("esri-image-decode",!1,!0,!0)})}return!1}),Gi.add("esri-url-encodes-apostrophe",()=>{const t=window.document.createElement("a");return t.href="?'",t.href.includes("?%27")}))})();function _Ge(t,e,i=!1){return wGe(t,e,i)}function Xx(t,e){if(e!=null)return e[t]||bGe(t.split("."),!1,e)}function Ep(t,e,i){const r=t.split("."),n=r.pop(),s=bGe(r,!0,i);s&&n&&(s[n]=e)}function bGe(t,e,i){let r=i;for(const n of t){if(r==null)return;if(!(n in r)){if(!e)return;r[n]={}}r=r[n]}return r}function wGe(t,e,i){return e?Object.keys(e).reduce((r,n)=>{let s=r[n],o=e[n];return s===o?r:s===void 0?(r[n]=hi(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]),i?o.forEach(a=>{s.includes(a)||s.push(a)}):r[n]=o.concat())):o&&typeof o=="object"?r[n]=wGe(s,o,i):r.hasOwnProperty(n)&&!e.hasOwnProperty(n)||(r[n]=o),r)},t||{}):t}const na={analysisTheme:{accentColor:[255,128,0],textColor:"white"},apiKey:void 0,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:!1,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&&(_Ge(na,globalThis.esriConfig,!0),delete na.has),!na.assetsPath){{const t="4.26.5";na.assetsPath=`https://js.arcgis.com/${t.slice(0,-2)}/@arcgis/core/assets`}na.defaultAssetsPath=na.assetsPath}const Mkt=/\{([^\}]+)\}/g;function xGe(t){return t??""}function Kx(t,e){return t.replace(Mkt,typeof e=="object"?(i,r)=>xGe(Xx(r,e)):(i,r)=>xGe(e(r)))}function v_e(t,e){return t.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,i=>e&&e.includes(i)?i:`\\${i}`)}function Gc(t){let e=0;for(let i=0;ie._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const i=V0._loggers;return V0._loggers=e,i},set throttlingDisabled(e){V0._throttlingDisabled=e}}}static getLogger(e){let i=V0._loggers[e];return i||(i=new V0({module:e})),i}_log(e,i,...r){if(this._matchLevel(e)){if(i!=="always"&&!V0._throttlingDisabled){const n=this._argsToKey(r),s=this._loggedMessages[e].get(n);if(i==="once"&&s!=null||i==="oncePerTick"&&s&&s>=V0._tickCounter)return;this._loggedMessages[e].set(n,V0._tickCounter),V0._scheduleTickCounterIncrement()}for(const n of na.log.interceptors)if(n(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,i){let r=this;for(;ye(r);){const n=r[e];if(ye(n))return n;r=r.parent}return i}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,i,...r){console[e](`[${i}]`,...r)}_matchLevel(e){const i=na.log.level?na.log.level:"warn";return SGe[this._parentWithMember("level",i)]<=SGe[e]}_argsToKey(...e){return Gc(JSON.stringify(e,(r,n)=>typeof n!="object"||Array.isArray(n)?n:"[Object]"))}static _scheduleTickCounterIncrement(){V0._tickCounterScheduled||(V0._tickCounterScheduled=!0,Promise.resolve().then(()=>{V0._tickCounter++,V0._tickCounterScheduled=!1}))}};Ei._loggers={},Ei._tickCounter=0,Ei._tickCounterScheduled=!1,Ei._throttlingDisabled=!1;var JI;(function(t){t[t.INITIALIZING=0]="INITIALIZING",t[t.CONSTRUCTING=1]="CONSTRUCTING",t[t.CONSTRUCTED=2]="CONSTRUCTED"})(JI||(JI={}));let Fkt=class{constructor(e,i){this._observers=e,this._observer=i}remove(){f_e(this._observers,this._observer)}},CGe=class{constructor(){this._observers=null,this.destroyed=!1}observe(e){if(this.destroyed||e.destroyed)return Lkt;this._observers==null&&(this._observers=[]);const i=this._observers;let r=!1,n=!1;const s=i.length;for(let o=0;o0){if(!(n+r{}};var Fn;(function(t){t[t.DEFAULTS=0]="DEFAULTS",t[t.COMPUTED=1]="COMPUTED",t[t.SERVICE=2]="SERVICE",t[t.PORTAL_ITEM=3]="PORTAL_ITEM",t[t.WEB_SCENE=4]="WEB_SCENE",t[t.WEB_MAP=5]="WEB_MAP",t[t.USER=6]="USER"})(Fn||(Fn={}));const __e=Fn.USER+1;function Gg(t){switch(t){case"defaults":return Fn.DEFAULTS;case"service":return Fn.SERVICE;case"portal-item":return Fn.PORTAL_ITEM;case"web-scene":return Fn.WEB_SCENE;case"web-map":return Fn.WEB_MAP;case"user":return Fn.USER;default:return null}}function SH(t){switch(t){case Fn.DEFAULTS:return"defaults";case Fn.SERVICE:return"service";case Fn.PORTAL_ITEM:return"portal-item";case Fn.WEB_SCENE:return"web-scene";case Fn.WEB_MAP:return"web-map";case Fn.USER:return"user"}return void 0}function kkt(t){return SH(t)}var yc;(function(t){t[t.Dirty=1]="Dirty",t[t.Overriden=2]="Overriden",t[t.Computing=4]="Computing",t[t.NonNullable=8]="NonNullable",t[t.HasDefaultValue=16]="HasDefaultValue",t[t.DepTrackingInitialized=32]="DepTrackingInitialized",t[t.AutoTracked=64]="AutoTracked",t[t.ExplicitlyTracking=128]="ExplicitlyTracking"})(yc||(yc={}));const Pre={onObservableAccessed:()=>{},onTrackingEnd:()=>{}},CH=[];let TH=Pre;function Ia(t){TH.onObservableAccessed(t)}let Ore=!1,Rre=!1;function ZI(t,e,i){if(Ore)return b_e(t,e,i);TGe(t);const r=e.call(i);return EGe(),r}function Nkt(t,e){return ZI(Pre,t,e)}function b_e(t,e,i){const r=Ore;Ore=!0,TGe(t);let n=null;try{n=e.call(i)}catch(s){Rre&&Ei.getLogger("esri.core.accessorSupport.tracking").error(s)}return EGe(),Ore=r,n}function TGe(t){TH=t,CH.push(t)}function EGe(){const t=CH.length;if(t>1){const e=CH.pop();TH=CH[t-2],e.onTrackingEnd()}else if(t===1){const e=CH.pop();TH=Pre,e.onTrackingEnd()}else TH=Pre}function IGe(t,e){const i=e.observerObject;if(i.flags&yc.DepTrackingInitialized)return;const r=Rre;Rre=!1,i.flags&yc.AutoTracked?b_e(e,e.metadata.get,t):AGe(t,e),Rre=r}const $kt=[];function AGe(t,e){const i=e.observerObject;i.flags&yc.ExplicitlyTracking||(i.flags|=yc.ExplicitlyTracking,b_e(e,()=>{const r=e.metadata.dependsOn||$kt;for(const n of r)if(typeof n!="string"||n.includes(".")){const s=dGe(n);for(let o=0,a=t;o0)for(const i of e)i.onInvalidated()}onCommitted(){const e=this._observers;if(e&&e.length>0){const i=e.slice();for(const r of i)r.onCommitted()}}destroy(){this.flags&yc.Dirty&&this.onCommitted(),super.destroy()}};const RGe=new FinalizationRegistry(t=>{t.destroy()});let Gkt=class hLt{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const i=new hLt;return this._values.forEach((r,n)=>{e&&e.has(n)||i.set(n,hi(r))}),i}get(e){return this._values.get(e)}originOf(){return Fn.USER}keys(){return[...this._values.keys()]}set(e,i){this._values.set(e,i)}delete(e){this._values.delete(e)}has(e){return this._values.has(e)}forEach(e){this._values.forEach(e)}};function Mre(t,e,i){return t!==void 0}function MGe(t,e,i,r){return t!==void 0&&(!(i==null&&t.observerObject.flags&yc.NonNullable)||(r.lifecycle,JI.INITIALIZING,!1))}function Vkt(t){return t&&typeof t.destroy=="function"}Ei.getLogger("esri.core.accessorSupport.Properties");let Ukt=class{constructor(e){this.host=e,this.properties=new Map,this.ctorArgs=null,this.destroyed=!1,this.lifecycle=JI.INITIALIZING,this.store=new Gkt,this._origin=Fn.USER;const i=this.host.constructor.__accessorMetadata__;for(const r in i){const n=new OGe(this,r,i[r]);this.properties.set(r,n)}this.metadatas=i}initialize(){this.lifecycle=JI.CONSTRUCTING}constructed(){this.lifecycle=JI.CONSTRUCTED}destroy(){this.destroyed=!0;for(const[e,i]of this.properties){if(i.metadata.autoDestroy){const r=this.internalGet(e);r&&Vkt(r)&&(r.destroy(),~i.observerObject.flags&yc.NonNullable&&this._internalSet(i,null))}i.destroy()}}get initialized(){return this.lifecycle!==JI.INITIALIZING}get(e){const i=this.properties.get(e);if(i.metadata.get)return i.getComputed();Ia(i.observerObject);const r=this.store;return r.has(e)?r.get(e):i.metadata.value}originOf(e){const i=this.store.originOf(e);if(i===void 0){const r=this.properties.get(e);if(r!==void 0&&r.observerObject.flags&yc.HasDefaultValue)return"defaults"}return SH(i)}has(e){return!!this.properties.has(e)&&this.store.has(e)}keys(){return[...this.properties.keys()]}internalGet(e){const i=this.properties.get(e);if(Mre(i))return this.store.has(e)?this.store.get(e):i.metadata.value}internalSet(e,i){const r=this.properties.get(e);Mre(r)&&this._internalSet(r,i)}getDependsInfo(e,i,r){const n=this.properties.get(i);if(!Mre(n))return"";const s=new Set,o=ZI({onObservableAccessed:l=>s.add(l),onTrackingEnd:()=>{}},()=>n.metadata.get?.call(e));let a=`${r}${e.declaredClass.split(".").pop()}.${i}: ${o} -`;if(s.size===0)return a;r+=" ";for(const l of s){if(!(l instanceof OGe))continue;const c=l.properties.host,d=l.propertyName,p=Tp(c);a+=p?p.getDependsInfo(c,d,r):`${r}${d}: undefined -`}return a}setAtOrigin(e,i,r){const n=this.properties.get(e);if(Mre(n))return this._setAtOrigin(n,i,r)}isOverridden(e){const i=this.properties.get(e);return i!==void 0&&!!(i.observerObject.flags&yc.Overriden)}clearOverride(e){const i=this.properties.get(e),r=i?.observerObject;r&&r.flags&yc.Overriden&&(r.flags&=~yc.Overriden,i.notifyChange())}override(e,i){const r=this.properties.get(e);if(!MGe(r,e,i,this))return;const n=r.metadata.cast;if(n){const s=this._cast(n,i),{valid:o,value:a}=s;if(w_e.release(s),!o)return;i=a}r.observerObject.flags|=yc.Overriden,this._internalSet(r,i)}set(e,i){const r=this.properties.get(e);if(!MGe(r,e,i,this))return;const n=r.metadata.cast;if(n){const o=this._cast(n,i),{valid:a,value:l}=o;if(w_e.release(o),!a)return;i=l}const s=r.metadata.set;s?s.call(this.host,i):this._internalSet(r,i)}setDefaultOrigin(e){this._origin=Gg(e)}getDefaultOrigin(){return SH(this._origin)}notifyChange(e){const i=this.properties.get(e);i!==void 0&&i.notifyChange()}invalidate(e){const i=this.properties.get(e);i!==void 0&&i.invalidate()}commit(e){const i=this.properties.get(e);i!==void 0&&i.commit()}_internalSet(e,i){const r=this.lifecycle!==JI.INITIALIZING?this._origin:Fn.DEFAULTS;this._setAtOrigin(e,i,r)}_setAtOrigin(e,i,r){const n=this.store,s=e.propertyName;n.has(s,r)&&y_e(i,n.get(s))&&~e.observerObject.flags&yc.Overriden&&r===n.originOf(s)||(e.invalidate(),n.set(s,i,r),e.commit(),IGe(this.host,e))}_cast(e,i){const r=w_e.acquire();return r.valid=!0,r.value=i,e&&(r.value=e.call(this.host,i,r)),r}},jkt=class{constructor(){this.value=null,this.valid=!0}acquire(){this.valid=!0}release(){this.value=null}};const w_e=new _C(jkt);function zkt(t,e){return t.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,(i,r)=>{if(r==="")return"$";const n=Xx(r,e),s=n??"";if(s===void 0)throw new Error(`could not find key "${r}" in template`);return s.toString()})}let DGe=class dLt{constructor(e,i,r){this.name=e,this.details=r,this instanceof dLt&&(this.message=(i&&zkt(i,r))??"")}toString(){return"["+this.name+"]: "+this.message}},st=class qve extends DGe{constructor(e,i,r){if(super(e,i,r),!(this instanceof qve))return new qve(e,i,r)}toJSON(){if(this.details!=null)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,(e,i)=>{if(i&&typeof i=="object"&&typeof i.toJSON=="function")return i;try{return hi(i)}catch{return"[object]"}}))}}catch(e){throw Ei.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new qve(e.name,e.message,e.details)}};st.prototype.type="error";function Dre(t,e,i){if(t&&e)if(typeof e=="object")for(const r of Object.getOwnPropertyNames(e))Dre(t,r,e[r]);else{if(e.includes(".")){const n=e.split("."),s=n.splice(n.length-1,1)[0];return void Dre(Are(t,n),s,i)}const r=t.__accessor__;r!=null&&Hkt(e,r),t[e]=i}}function Hkt(t,e){if(Gi("esri-unknown-property-errors")&&!Wkt(t,e))throw new st("set:unknown-property",qkt(t,e))}function Wkt(t,e){return e.metadatas[t]!=null}function qkt(t,e){return"setting unknown property '"+t+"' on instance of "+e.host.declaredClass}let FGe=class extends _C{constructor(){super(...arguments),this._set=new Set}destroy(){super.destroy(),this._set=vH(this._set)}acquire(...e){const i=super.acquire(...e);return this._set.delete(i),i}release(e){e&&!this._set.has(e)&&(super.release(e),this._set.add(e))}_dispose(e){this._set.delete(e),super._dispose(e)}};const Fre=[];function L8(t){Fre.push(t),Fre.length===1&&queueMicrotask(()=>{const e=Fre.slice();Fre.length=0;for(const i of e)i()})}let EH=class{constructor(e,i=30){this.name=e,this._counter=0,this._samples=new Array(i)}record(e){ye(e)&&(this._samples[++this._counter%this._samples.length]=e)}get median(){return this._samples.slice().sort((e,i)=>e-i)[Math.floor(this._samples.length/2)]}get average(){return this._samples.reduce((e,i)=>e+i,0)/this._samples.length}get last(){return this._samples[this._counter%this._samples.length]}};var x_e;(function(t){const e=(s,o,a,l)=>{let c=o,d=o;const p=a>>>1,y=s[c-1];for(;d<=p;){d=c<<1,dso?1:0;function r(s,o,a,l){o===void 0&&(o=0),a===void 0&&(a=s.length),l===void 0&&(l=i);for(let d=a>>>1;d>o;d--)e(s,d,a,l);const c=o+1;for(let d=a-1;d>o;d--){const p=s[o];s[o]=s[d],s[d]=p,e(s,c,d,l)}}function*n(s,o,a,l){o===void 0&&(o=0),a===void 0&&(a=s.length),l===void 0&&(l=i);for(let d=a>>>1;d>o;d--)e(s,d,a,l),yield;const c=o+1;for(let d=a-1;d>o;d--){const p=s[o];s[o]=s[d],s[d]=p,e(s,c,d,l),yield}}t.sort=r,t.iterableSort=n})(x_e||(x_e={}));const LGe=x_e,Ykt=1.5,Xkt=1.1;let _m=class{constructor(e){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new Cre,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=()=>kGe(this)))}toArray(){return this.data.slice(0,this.length)}filter(e){const i=new Array;for(let r=0;r=this._length))return this.data[e]}includes(e,i){const r=this.data.indexOf(e,i);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,i=e.length,r){this.length=_kt(this.data,e,this.length,i,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,i){if(e>=this.length||i>=this.length||e===i)return;const r=this.data[e];this.data[e]=this.data[i],this.data[i]=r}sort(e){LGe.sort(this.data,0,this.length,e)}iterableSort(e){return LGe.iterableSort(this.data,0,this.length,e)}some(e,i){for(let r=0;rYkt*t.length&&(t.data.length=Math.floor(t.length*Xkt))}function Kkt(t){return{setTimeout:(e,i)=>{const r=t.setTimeout(e,i);return{remove:()=>t.clearTimeout(r)}}}}const IH=Kkt(globalThis),NGe=new Set;function Jkt(t,e,i=!1){i&&NGe.has(e)||(i&&NGe.add(e),t.warn(`🛑 DEPRECATED - ${e}`))}function S_e(t,e,i={}){if(Gi("esri-deprecation-warnings")){const{moduleName:r}=i;$Ge(t,`Property: ${(r?r+"::":"")+e}`,i)}}function $Ge(t,e,i={}){if(Gi("esri-deprecation-warnings")){const{replacement:r,version:n,see:s,warnOnce:o}=i;let a=e;r&&(a+=` +var RAMP4=function(H0){"use strict";var W0=(t=>(t.BLOB="blob",t.DATE="date",t.DOUBLE="double",t.GEOMETRY="geometry",t.GLOBAL_ID="global-id",t.GUID="guid",t.INTEGER="integer",t.LONG="long",t.OID="oid",t.RASTER="raster",t.SINGLE="single",t.SMALL_INTEGER="small-integer",t.STRING="string",t.XML="xml",t))(W0||{}),gC=(t=>(t.CIRCLE="circle",t.CROSS="cross",t.DIAMOND="diamond",t.ICON="icon",t.PATH="path",t.SQUARE="square",t.TRIANGLE="triangle",t.X="x",t))(gC||{}),Gv=(t=>(t.DASH="dash",t.DASHDOT="dash-dot",t.DASHDOTDOT="short-dash-dot-dot",t.DOT="dot",t.LONGDASH="long-dash",t.LONGDASHDOT="long-dash-dot",t.LONGDASHDOTDOT="long-dash-dot-dot",t.NONE="none",t.NULL="none",t.SHORTDASH="short-dash",t.SHORTDASHDOT="short-dash-dot",t.SHORTDASHDOTDOT="short-dash-dot-dot",t.SHORTDOT="short-dot",t.SOLID="solid",t))(Gv||{}),ZBe=(t=>(t.BEVEL="bevel",t.MITER="miter",t.ROUND="round",t))(ZBe||{}),QBe=(t=>(t.ROUND="round",t.BUTT="butt",t.SQUARE="square",t))(QBe||{}),eVe=(t=>(t.BDIAG="backward-diagonal",t.CROSS="cross",t.DIAG_CROSS="diagonal-cross",t.FDIAG="forward-diagonal",t.HORIZONTAL="horizontal",t.NONE="none",t.NULL="none",t.SOLID="solid",t.VERTICAL="vertical",t))(eVe||{}),pl=(t=>(t.POINT="Point",t.MULTIPOINT="MultiPoint",t.LINESTRING="LineString",t.MULTILINESTRING="MultiLineString",t.POLYGON="Polygon",t.MULTIPOLYGON="MultiPolygon",t.LINEARRING="LinearRing",t.EXTENT="Extent",t.NONE="None",t.UNKNOWN="Unknown",t))(pl||{}),vre=(t=>(t.Simple="simple",t.Unique="uniqueValue",t.ClassBreaks="classBreaks",t.Unknown="unknown",t))(vre||{}),_n=(t=>(t.FEATURE="esri-feature",t.MAPIMAGE="esri-map-image",t.TILE="esri-tile",t.IMAGERY="esri-imagery",t.GRAPHIC="esri-graphic",t.WMS="ogc-wms",t.WFS="ogc-wfs",t.GEOJSON="file-geojson",t.CSV="file-csv",t.SHAPEFILE="file-shape",t.OSM="osm-tile",t.DATACSV="data-csv",t.DATAJSON="data-json",t.DATATABLE="data-esri-table",t.UNKNOWN="unknown",t.SUBLAYER="sublayer",t))(_n||{}),Hb=(t=>(t.FEATURE="feature",t.GRAPHIC="graphic",t.IMAGERY="imagery",t.MAPIMAGE="map-image",t.NOLAYER="no-layer",t.OSM="osm-tile",t.TILE="tile",t.UNKNOWN="unknown",t.WMS="wms",t))(Hb||{}),By=(t=>(t.ESRI_FEATURE="esriFeature",t.ESRI_RASTER="esriRaster",t.ESRI_TILE="esriTile",t.OSM_TILE="osmTile",t.OGC_RASTER="ogcRaster",t.UNKNOWN="unknown",t))(By||{}),Op=(t=>(t.POINT="Point",t.MULTIPOINT="MultiPoint",t.LINESTRING="LineString",t.MULTILINESTRING="MultiLineString",t.POLYGON="Polygon",t.MULTIPOLYGON="MultiPolygon",t))(Op||{}),Tm=(t=>(t.GEOMETRIC="geometric",t.SYMBOLIC="symbolic",t.HYBRID="hybrid",t.NONE="none",t))(Tm||{}),Uv=(t=>(t.NEW="new",t.INITIATING="initiating",t.INITIATED="initiated",t.TERMINATING="terminating",t.TERMINATED="terminated",t))(Uv||{}),Rp=(t=>(t.NEW="new",t.LOADING="loading",t.LOADED="loaded",t.ERROR="error",t))(Rp||{}),zv=(t=>(t.NOT_LOADED="not-loaded",t.NOT_VISUAL="not-visual",t.REFRESH="refresh",t.UP_TO_DATE="up-to-date",t))(zv||{}),N3=(t=>(t.ESRI="esri",t.TEXT="text",t.IMAGE="image",t.HTML="html",t.XML="xml",t.JSON="json",t.UNKNOWN="unknown",t))(N3||{}),Nf=(t=>(t.SYMBOL="symbol",t.GRID="grid",t.EXTENT="extent",t.INITIAL="initial",t.API="api",t.PERMANENT="permanent",t))(Nf||{}),ha=(t=>(t.BoundaryZoom="boundaryZoom",t.Datatable="datatable",t.Identify="identify",t.Metadata="metadata",t.Opacity="opacity",t.Refresh="refresh",t.Reload="reload",t.Remove="remove",t.Settings="settings",t.Symbology="symbology",t.Visibility="visibility",t))(ha||{});class I1{attributes;geometry;style;id;constructor(e,i,r){this.geometry=e,i?this.id=i:this.id=bk.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 E(t,e,i,r){var n,s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(o=(s<3?n(o):s>3?n(e,i,o):n(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o}function MNt(t){return t&&t.release&&typeof t.release=="function"}function DNt(t){return t&&t.acquire&&typeof t.acquire=="function"}let yC=class L9e{constructor(e,i,r,n=1,s=0){if(this._ctor=e,this._acquireFunction=i,this._releaseFunction=r,this.allocationSize=n,this._pool=new Array(s),this._initialSize=s,this._ctor)for(let o=0;o=this._pool.length)){for(let i=e;ive(e))}function Wx(t,...e){let i=t;for(let r=0;r{e+=i.length}),e}add(e,i){if(bre(e)){const r=this._getOrCreateGroup(i);for(const n of e)this._isHandle(n)&&r.push(n)}else this._isHandle(e)&&this._getOrCreateGroup(i).push(e);return this}forEach(e,i){if(typeof e=="function")this._groups.forEach(r=>r.forEach(e));else{const r=this._getGroup(e);r&&i&&r.forEach(i)}}has(e){return this._groups.has(this._ensureGroupKey(e))}remove(e){if(typeof e!="string"&&bre(e)){for(const i of e)this.remove(i);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}_getOrCreateGroup(e){if(this.has(e))return this._getGroup(e);const i=[];return this._groups.set(this._ensureGroupKey(e),i),i}_getGroup(e){return this._groups.get(this._ensureGroupKey(e))}_ensureGroupKey(e){return e||"_default_"}_removeAllFromGroup(e){e.forEach(i=>i.remove())}};const iVe=Symbol("Accessor-beforeDestroy");function R8(t){return XI(()=>t.forEach(e=>ve(e)&&e.remove()))}function XI(t){return{remove:()=>{t&&(t(),t=void 0)}}}let vC=class E8{constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*E8._m}getInt(){return this._seed=(E8._a*this._seed+E8._c)%E8._m,this._seed}getFloat(){return this.getInt()/(E8._m-1)}getIntRange(e,i){return Math.round(this.getFloatRange(e,i))}getFloatRange(e,i){const r=i-e;return e+this.getInt()/E8._m*r}};vC._m=2147483647,vC._a=48271,vC._c=0;function $Nt(t,e){return e?t.filter((i,r,n)=>n.findIndex(e.bind(null,i))===r):t.filter((i,r,n)=>n.indexOf(i)===r)}function _H(t,e,i){if(lt(t)&<(e))return!0;if(lt(t)||lt(e)||t.length!==e.length)return!1;if(i){for(let r=0;r!t.some(o=>i(o,s))),n=t.filter(s=>!e.some(o=>i(o,s)))):(r=e.filter(s=>!t.includes(s)),n=t.filter(s=>!e.includes(s))),{added:r,removed:n}}function nVe(t){return t&&typeof t.length=="number"}const VNt=!!Array.prototype.fill;function jNt(t,e){if(VNt)return new Array(t).fill(e);const i=new Array(t);for(let r=0;r{const s=b_e(n);return n!=null&&s==null&&(i=!1),s});return i?r:null}if(hVe(t))return t.clone();if(!pVe(t)){const i=new(Object.getPrototypeOf(t)).constructor;for(const r of Object.getOwnPropertyNames(t)){const n=t[r],s=b_e(n);if(n!=null&&s==null)return null;i[r]=s}return i}return null}function hVe(t){return typeof t.clone=="function"}function dVe(t){return typeof t.map=="function"&&typeof t.forEach=="function"}function pVe(t){return typeof t.notifyChange=="function"&&typeof t.watch=="function"}function fVe(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function mVe(t){if(zNt(t)||lL(t)||aVe(t)||lVe(t)||__e(t)||uVe(t)||cVe(t)||HNt(t)||WNt(t))return t.slice();if(t instanceof Date)return new Date(t.getTime());if(t instanceof ArrayBuffer)return t.slice(0,t.byteLength);if(t instanceof Map){const e=new Map;for(const[i,r]of t)e.set(i,gi(r));return e}if(t instanceof Set){const e=new Set;for(const i of t)e.add(gi(i));return e}return null}function w_e(t,e){return t===e||typeof t=="number"&&isNaN(t)&&typeof e=="number"&&isNaN(e)||typeof(t||{}).getTime=="function"&&typeof(e||{}).getTime=="function"&&t.getTime()===e.getTime()||!1}function qNt(t,e){return t===e||(t==null||typeof t=="string"?t===e:typeof t=="number"?t===e||typeof e=="number"&&isNaN(t)&&isNaN(e):t instanceof Date?e instanceof Date&&t.getTime()===e.getTime():Array.isArray(t)?Array.isArray(e)&&_H(t,e):t instanceof Set?e instanceof Set&&XNt(t,e):t instanceof Map?e instanceof Map&&KNt(t,e):!!fVe(t)&&fVe(e)&&YNt(t,e))}function YNt(t,e){if(t===null||e===null)return!1;const i=Object.keys(t);if(e===null||Object.keys(e).length!==i.length)return!1;for(const r of i)if(t[r]!==e[r]||!Object.prototype.hasOwnProperty.call(e,r))return!1;return!0}function XNt(t,e){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function KNt(t,e){if(t.size!==e.size)return!1;for(const[i,r]of t){const n=e.get(i);if(n!==r||n===void 0&&!e.has(i))return!1}return!0}function Mp(t){return t?t.__accessor__?t.__accessor__:t.propertyInvalidated?t:null:null}function JNt(t,e){return t!=null&&t.metadatas&&t.metadatas[e]!=null}function Sre(t,e,i){return i?Cre(t,e,{policy:i,path:""}):Cre(t,e,null)}function Cre(t,e,i){return e?Object.keys(e).reduce((r,n)=>{let s=null,o="merge";if(i&&(s=i.path?`${i.path}.${n}`:n,o=i.policy(s)),o==="replace"||o==="replace-arrays"&&Array.isArray(r[n]))return r[n]=e[n],r;if(r[n]===void 0)return r[n]=gi(e[n]),r;let a=r[n],l=e[n];if(a===l)return r;if(Array.isArray(l)||Array.isArray(r))a=a?Array.isArray(a)?r[n]=a.concat():r[n]=[a]:r[n]=[],l&&(Array.isArray(l)||(l=[l]),l.forEach(c=>{a.includes(c)||a.push(c)}));else if(l&&typeof l=="object")if(i){const c=i.path;i.path=s,r[n]=Cre(a,l,i),i.path=c}else r[n]=Cre(a,l,null);else r.hasOwnProperty(n)&&!e.hasOwnProperty(n)||(r[n]=l);return r},t||{}):t}function gVe(t){return Array.isArray(t)?t:t.split(".")}function yVe(t){return t.includes(",")?t.split(",").map(e=>e.trim()):[t.trim()]}function ZNt(t){if(Array.isArray(t)){const e=[];for(const i of t)e.push(...yVe(i));return e}return yVe(t)}function vVe(t,e,i,r){const n=ZNt(e);if(n.length!==1){const s=n.map(o=>r(t,o,i));return R8(s)}return r(t,n[0],i)}function _Ve(t){let e=!1;return()=>{e||(e=!0,t())}}function bVe(t,e){const i=t[t.length-1]==="?"?t.slice(0,-1):t;if(e.getItemAt!=null||Array.isArray(e)){const n=parseInt(i,10);if(!isNaN(n))return Array.isArray(e)?e[n]:e.getItemAt(n)}const r=Mp(e);return JNt(r,i)?r.get(i):e[i]}function wVe(t,e,i){if(t==null)return t;const r=bVe(e[i],t);return!r&&i((r||$3[t]===void 0)&&($3[t]=e),i&&Hi(t)),Hi.cache=$3,Hi.add("esri-deprecation-warnings",!0),(()=>{Hi.add("host-webworker",globalThis.WorkerGlobalScope!==void 0&&self instanceof globalThis.WorkerGlobalScope);const t=typeof window<"u"&&typeof location<"u"&&typeof document<"u"&&window.location===location&&window.document===document;if(Hi.add("host-browser",t),Hi.add("host-node",typeof globalThis.process=="object"&&globalThis.process.versions?.node&&globalThis.process.versions.v8),Hi.add("dom",t),Hi("host-browser")){const e=navigator,i=e.userAgent,r=e.appVersion,n=parseFloat(r);if(Hi.add("wp",parseFloat(i.split("Windows Phone")[1])||void 0),Hi.add("msapp",parseFloat(i.split("MSAppHost/")[1])||void 0),Hi.add("khtml",r.includes("Konqueror")?n:void 0),Hi.add("edge",parseFloat(i.split("Edge/")[1])||void 0),Hi.add("opr",parseFloat(i.split("OPR/")[1])||void 0),Hi.add("webkit",!Hi("wp")&&!Hi("edge")&&parseFloat(i.split("WebKit/")[1])||void 0),Hi.add("chrome",!Hi("edge")&&!Hi("opr")&&parseFloat(i.split("Chrome/")[1])||void 0),Hi.add("android",!Hi("wp")&&parseFloat(i.split("Android ")[1])||void 0),Hi.add("safari",!r.includes("Safari")||Hi("wp")||Hi("chrome")||Hi("android")||Hi("edge")||Hi("opr")?void 0:parseFloat(r.split("Version/")[1])),Hi.add("mac",r.includes("Macintosh")),!Hi("wp")&&i.match(/(iPhone|iPod|iPad)/)){const s=RegExp.$1.replace(/P/,"p"),o=i.match(/OS ([\d_]+)/)?RegExp.$1:"1",a=parseFloat(o.replace(/_/,".").replace(/_/g,""));Hi.add(s,a),Hi.add("ios",a)}Hi("webkit")||(!i.includes("Gecko")||Hi("wp")||Hi("khtml")||Hi("edge")||Hi.add("mozilla",n),Hi("mozilla")&&Hi.add("ff",parseFloat(i.split("Firefox/")[1]||i.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const t=navigator.userAgent,e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(t),i=/iPhone/i.test(t);e&&Hi.add("esri-mobile",e),i&&Hi.add("esri-iPhone",i),Hi.add("esri-geolocation",!!navigator.geolocation)}Hi.add("esri-wasm","WebAssembly"in globalThis),Hi.add("esri-shared-array-buffer",()=>{const t="SharedArrayBuffer"in globalThis,e=globalThis.crossOriginIsolated===!1;return t&&!e}),Hi.add("wasm-simd",()=>{const t=[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(t))}),Hi.add("esri-atomics","Atomics"in globalThis),Hi.add("esri-workers","Worker"in globalThis),Hi.add("web-feat:cache","caches"in globalThis),Hi.add("esri-workers-arraybuffer-transfer",!Hi("safari")||Number(Hi("safari"))>=12),Hi.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),Hi.add("featurelayer-simplify-payload-size-factors",[1,1,4]),Hi.add("featurelayer-snapshot-enabled",!0),Hi.add("featurelayer-snapshot-point-min-threshold",8e4),Hi.add("featurelayer-snapshot-point-max-threshold",4e5),Hi.add("featurelayer-snapshot-point-coverage",.1),Hi.add("featurelayer-advanced-symbols",!1),Hi.add("featurelayer-pbf",!0),Hi.add("featurelayer-pbf-statistics",!1),Hi.add("feature-layers-workers",!0),Hi.add("feature-polyline-generalization-factor",1),Hi.add("mapview-transitions-duration",200),Hi.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),Hi.add("mapserver-pbf-version-support",10.81),Hi.add("mapservice-popup-identify-max-tolerance",20),Hi.add("heatmap-allow-raster-fallback",!0),Hi.add("heatmap-force-raster",!1),Hi("host-webworker")||Hi("host-browser")&&(Hi.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),Hi.add("esri-image-decode",()=>{if("decode"in new Image){const t=new Image;return t.src='data:image/svg+xml;charset=UTF-8,',void t.decode().then(()=>{Hi.add("esri-image-decode",!0,!0,!0)}).catch(()=>{Hi.add("esri-image-decode",!1,!0,!0)})}return!1}),Hi.add("esri-url-encodes-apostrophe",()=>{const t=window.document.createElement("a");return t.href="?'",t.href.includes("?%27")}))})();function SVe(t,e,i=!1){return TVe(t,e,i)}function Yx(t,e){if(e!=null)return e[t]||CVe(t.split("."),!1,e)}function Dp(t,e,i){const r=t.split("."),n=r.pop(),s=CVe(r,!0,i);s&&n&&(s[n]=e)}function CVe(t,e,i){let r=i;for(const n of t){if(r==null)return;if(!(n in r)){if(!e)return;r[n]={}}r=r[n]}return r}function TVe(t,e,i){return e?Object.keys(e).reduce((r,n)=>{let s=r[n],o=e[n];return s===o?r:s===void 0?(r[n]=gi(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]),i?o.forEach(a=>{s.includes(a)||s.push(a)}):r[n]=o.concat())):o&&typeof o=="object"?r[n]=TVe(s,o,i):r.hasOwnProperty(n)&&!e.hasOwnProperty(n)||(r[n]=o),r)},t||{}):t}const pa={analysisTheme:{accentColor:[255,128,0],textColor:"white"},apiKey:void 0,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:!1,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&&(SVe(pa,globalThis.esriConfig,!0),delete pa.has),!pa.assetsPath){{const t="4.26.5";pa.assetsPath=`https://js.arcgis.com/${t.slice(0,-2)}/@arcgis/core/assets`}pa.defaultAssetsPath=pa.assetsPath}const ikt=/\{([^\}]+)\}/g;function EVe(t){return t??""}function Xx(t,e){return t.replace(ikt,typeof e=="object"?(i,r)=>EVe(Yx(r,e)):(i,r)=>EVe(e(r)))}function x_e(t,e){return t.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,i=>e&&e.includes(i)?i:`\\${i}`)}function zc(t){let e=0;for(let i=0;ie._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const i=z0._loggers;return z0._loggers=e,i},set throttlingDisabled(e){z0._throttlingDisabled=e}}}static getLogger(e){let i=z0._loggers[e];return i||(i=new z0({module:e})),i}_log(e,i,...r){if(this._matchLevel(e)){if(i!=="always"&&!z0._throttlingDisabled){const n=this._argsToKey(r),s=this._loggedMessages[e].get(n);if(i==="once"&&s!=null||i==="oncePerTick"&&s&&s>=z0._tickCounter)return;this._loggedMessages[e].set(n,z0._tickCounter),z0._scheduleTickCounterIncrement()}for(const n of pa.log.interceptors)if(n(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,i){let r=this;for(;ve(r);){const n=r[e];if(ve(n))return n;r=r.parent}return i}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,i,...r){console[e](`[${i}]`,...r)}_matchLevel(e){const i=pa.log.level?pa.log.level:"warn";return IVe[this._parentWithMember("level",i)]<=IVe[e]}_argsToKey(...e){return zc(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}))}};Oi._loggers={},Oi._tickCounter=0,Oi._tickCounterScheduled=!1,Oi._throttlingDisabled=!1;var KI;(function(t){t[t.INITIALIZING=0]="INITIALIZING",t[t.CONSTRUCTING=1]="CONSTRUCTING",t[t.CONSTRUCTED=2]="CONSTRUCTED"})(KI||(KI={}));let nkt=class{constructor(e,i){this._observers=e,this._observer=i}remove(){v_e(this._observers,this._observer)}},AVe=class{constructor(){this._observers=null,this.destroyed=!1}observe(e){if(this.destroyed||e.destroyed)return skt;this._observers==null&&(this._observers=[]);const i=this._observers;let r=!1,n=!1;const s=i.length;for(let o=0;o0){if(!(n+r{}};var Yn;(function(t){t[t.DEFAULTS=0]="DEFAULTS",t[t.COMPUTED=1]="COMPUTED",t[t.SERVICE=2]="SERVICE",t[t.PORTAL_ITEM=3]="PORTAL_ITEM",t[t.WEB_SCENE=4]="WEB_SCENE",t[t.WEB_MAP=5]="WEB_MAP",t[t.USER=6]="USER"})(Yn||(Yn={}));const S_e=Yn.USER+1;function Ug(t){switch(t){case"defaults":return Yn.DEFAULTS;case"service":return Yn.SERVICE;case"portal-item":return Yn.PORTAL_ITEM;case"web-scene":return Yn.WEB_SCENE;case"web-map":return Yn.WEB_MAP;case"user":return Yn.USER;default:return null}}function SH(t){switch(t){case Yn.DEFAULTS:return"defaults";case Yn.SERVICE:return"service";case Yn.PORTAL_ITEM:return"portal-item";case Yn.WEB_SCENE:return"web-scene";case Yn.WEB_MAP:return"web-map";case Yn.USER:return"user"}return void 0}function okt(t){return SH(t)}var xc;(function(t){t[t.Dirty=1]="Dirty",t[t.Overriden=2]="Overriden",t[t.Computing=4]="Computing",t[t.NonNullable=8]="NonNullable",t[t.HasDefaultValue=16]="HasDefaultValue",t[t.DepTrackingInitialized=32]="DepTrackingInitialized",t[t.AutoTracked=64]="AutoTracked",t[t.ExplicitlyTracking=128]="ExplicitlyTracking"})(xc||(xc={}));const Ere={onObservableAccessed:()=>{},onTrackingEnd:()=>{}},CH=[];let TH=Ere;function Na(t){TH.onObservableAccessed(t)}let Ire=!1,Are=!1;function JI(t,e,i){if(Ire)return C_e(t,e,i);PVe(t);const r=e.call(i);return OVe(),r}function akt(t,e){return JI(Ere,t,e)}function C_e(t,e,i){const r=Ire;Ire=!0,PVe(t);let n=null;try{n=e.call(i)}catch(s){Are&&Oi.getLogger("esri.core.accessorSupport.tracking").error(s)}return OVe(),Ire=r,n}function PVe(t){TH=t,CH.push(t)}function OVe(){const t=CH.length;if(t>1){const e=CH.pop();TH=CH[t-2],e.onTrackingEnd()}else if(t===1){const e=CH.pop();TH=Ere,e.onTrackingEnd()}else TH=Ere}function RVe(t,e){const i=e.observerObject;if(i.flags&xc.DepTrackingInitialized)return;const r=Are;Are=!1,i.flags&xc.AutoTracked?C_e(e,e.metadata.get,t):MVe(t,e),Are=r}const lkt=[];function MVe(t,e){const i=e.observerObject;i.flags&xc.ExplicitlyTracking||(i.flags|=xc.ExplicitlyTracking,C_e(e,()=>{const r=e.metadata.dependsOn||lkt;for(const n of r)if(typeof n!="string"||n.includes(".")){const s=gVe(n);for(let o=0,a=t;o0)for(const i of e)i.onInvalidated()}onCommitted(){const e=this._observers;if(e&&e.length>0){const i=e.slice();for(const r of i)r.onCommitted()}}destroy(){this.flags&xc.Dirty&&this.onCommitted(),super.destroy()}};const LVe=new FinalizationRegistry(t=>{t.destroy()});let ckt=class LLt{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const i=new LLt;return this._values.forEach((r,n)=>{e&&e.has(n)||i.set(n,gi(r))}),i}get(e){return this._values.get(e)}originOf(){return Yn.USER}keys(){return[...this._values.keys()]}set(e,i){this._values.set(e,i)}delete(e){this._values.delete(e)}has(e){return this._values.has(e)}forEach(e){this._values.forEach(e)}};function Pre(t,e,i){return t!==void 0}function NVe(t,e,i,r){return t!==void 0&&(!(i==null&&t.observerObject.flags&xc.NonNullable)||(r.lifecycle,KI.INITIALIZING,!1))}function hkt(t){return t&&typeof t.destroy=="function"}Oi.getLogger("esri.core.accessorSupport.Properties");let dkt=class{constructor(e){this.host=e,this.properties=new Map,this.ctorArgs=null,this.destroyed=!1,this.lifecycle=KI.INITIALIZING,this.store=new ckt,this._origin=Yn.USER;const i=this.host.constructor.__accessorMetadata__;for(const r in i){const n=new FVe(this,r,i[r]);this.properties.set(r,n)}this.metadatas=i}initialize(){this.lifecycle=KI.CONSTRUCTING}constructed(){this.lifecycle=KI.CONSTRUCTED}destroy(){this.destroyed=!0;for(const[e,i]of this.properties){if(i.metadata.autoDestroy){const r=this.internalGet(e);r&&hkt(r)&&(r.destroy(),~i.observerObject.flags&xc.NonNullable&&this._internalSet(i,null))}i.destroy()}}get initialized(){return this.lifecycle!==KI.INITIALIZING}get(e){const i=this.properties.get(e);if(i.metadata.get)return i.getComputed();Na(i.observerObject);const r=this.store;return r.has(e)?r.get(e):i.metadata.value}originOf(e){const i=this.store.originOf(e);if(i===void 0){const r=this.properties.get(e);if(r!==void 0&&r.observerObject.flags&xc.HasDefaultValue)return"defaults"}return SH(i)}has(e){return!!this.properties.has(e)&&this.store.has(e)}keys(){return[...this.properties.keys()]}internalGet(e){const i=this.properties.get(e);if(Pre(i))return this.store.has(e)?this.store.get(e):i.metadata.value}internalSet(e,i){const r=this.properties.get(e);Pre(r)&&this._internalSet(r,i)}getDependsInfo(e,i,r){const n=this.properties.get(i);if(!Pre(n))return"";const s=new Set,o=JI({onObservableAccessed:l=>s.add(l),onTrackingEnd:()=>{}},()=>n.metadata.get?.call(e));let a=`${r}${e.declaredClass.split(".").pop()}.${i}: ${o} +`;if(s.size===0)return a;r+=" ";for(const l of s){if(!(l instanceof FVe))continue;const c=l.properties.host,h=l.propertyName,p=Mp(c);a+=p?p.getDependsInfo(c,h,r):`${r}${h}: undefined +`}return a}setAtOrigin(e,i,r){const n=this.properties.get(e);if(Pre(n))return this._setAtOrigin(n,i,r)}isOverridden(e){const i=this.properties.get(e);return i!==void 0&&!!(i.observerObject.flags&xc.Overriden)}clearOverride(e){const i=this.properties.get(e),r=i?.observerObject;r&&r.flags&xc.Overriden&&(r.flags&=~xc.Overriden,i.notifyChange())}override(e,i){const r=this.properties.get(e);if(!NVe(r,e,i,this))return;const n=r.metadata.cast;if(n){const s=this._cast(n,i),{valid:o,value:a}=s;if(T_e.release(s),!o)return;i=a}r.observerObject.flags|=xc.Overriden,this._internalSet(r,i)}set(e,i){const r=this.properties.get(e);if(!NVe(r,e,i,this))return;const n=r.metadata.cast;if(n){const o=this._cast(n,i),{valid:a,value:l}=o;if(T_e.release(o),!a)return;i=l}const s=r.metadata.set;s?s.call(this.host,i):this._internalSet(r,i)}setDefaultOrigin(e){this._origin=Ug(e)}getDefaultOrigin(){return SH(this._origin)}notifyChange(e){const i=this.properties.get(e);i!==void 0&&i.notifyChange()}invalidate(e){const i=this.properties.get(e);i!==void 0&&i.invalidate()}commit(e){const i=this.properties.get(e);i!==void 0&&i.commit()}_internalSet(e,i){const r=this.lifecycle!==KI.INITIALIZING?this._origin:Yn.DEFAULTS;this._setAtOrigin(e,i,r)}_setAtOrigin(e,i,r){const n=this.store,s=e.propertyName;n.has(s,r)&&w_e(i,n.get(s))&&~e.observerObject.flags&xc.Overriden&&r===n.originOf(s)||(e.invalidate(),n.set(s,i,r),e.commit(),RVe(this.host,e))}_cast(e,i){const r=T_e.acquire();return r.valid=!0,r.value=i,e&&(r.value=e.call(this.host,i,r)),r}},pkt=class{constructor(){this.value=null,this.valid=!0}acquire(){this.valid=!0}release(){this.value=null}};const T_e=new yC(pkt);function fkt(t,e){return t.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,(i,r)=>{if(r==="")return"$";const n=Yx(r,e),s=n??"";if(s===void 0)throw new Error(`could not find key "${r}" in template`);return s.toString()})}let kVe=class NLt{constructor(e,i,r){this.name=e,this.details=r,this instanceof NLt&&(this.message=(i&&fkt(i,r))??"")}toString(){return"["+this.name+"]: "+this.message}},st=class Jve extends kVe{constructor(e,i,r){if(super(e,i,r),!(this instanceof Jve))return new Jve(e,i,r)}toJSON(){if(this.details!=null)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,(e,i)=>{if(i&&typeof i=="object"&&typeof i.toJSON=="function")return i;try{return gi(i)}catch{return"[object]"}}))}}catch(e){throw Oi.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new Jve(e.name,e.message,e.details)}};st.prototype.type="error";function Ore(t,e,i){if(t&&e)if(typeof e=="object")for(const r of Object.getOwnPropertyNames(e))Ore(t,r,e[r]);else{if(e.includes(".")){const n=e.split("."),s=n.splice(n.length-1,1)[0];return void Ore(Tre(t,n),s,i)}const r=t.__accessor__;r!=null&&mkt(e,r),t[e]=i}}function mkt(t,e){if(Hi("esri-unknown-property-errors")&&!gkt(t,e))throw new st("set:unknown-property",ykt(t,e))}function gkt(t,e){return e.metadatas[t]!=null}function ykt(t,e){return"setting unknown property '"+t+"' on instance of "+e.host.declaredClass}let $Ve=class extends yC{constructor(){super(...arguments),this._set=new Set}destroy(){super.destroy(),this._set=vH(this._set)}acquire(...e){const i=super.acquire(...e);return this._set.delete(i),i}release(e){e&&!this._set.has(e)&&(super.release(e),this._set.add(e))}_dispose(e){this._set.delete(e),super._dispose(e)}};const Rre=[];function D8(t){Rre.push(t),Rre.length===1&&queueMicrotask(()=>{const e=Rre.slice();Rre.length=0;for(const i of e)i()})}let EH=class{constructor(e,i=30){this.name=e,this._counter=0,this._samples=new Array(i)}record(e){ve(e)&&(this._samples[++this._counter%this._samples.length]=e)}get median(){return this._samples.slice().sort((e,i)=>e-i)[Math.floor(this._samples.length/2)]}get average(){return this._samples.reduce((e,i)=>e+i,0)/this._samples.length}get last(){return this._samples[this._counter%this._samples.length]}};var E_e;(function(t){const e=(s,o,a,l)=>{let c=o,h=o;const p=a>>>1,y=s[c-1];for(;h<=p;){h=c<<1,hso?1:0;function r(s,o,a,l){o===void 0&&(o=0),a===void 0&&(a=s.length),l===void 0&&(l=i);for(let h=a>>>1;h>o;h--)e(s,h,a,l);const c=o+1;for(let h=a-1;h>o;h--){const p=s[o];s[o]=s[h],s[h]=p,e(s,c,h,l)}}function*n(s,o,a,l){o===void 0&&(o=0),a===void 0&&(a=s.length),l===void 0&&(l=i);for(let h=a>>>1;h>o;h--)e(s,h,a,l),yield;const c=o+1;for(let h=a-1;h>o;h--){const p=s[o];s[o]=s[h],s[h]=p,e(s,c,h,l),yield}}t.sort=r,t.iterableSort=n})(E_e||(E_e={}));const BVe=E_e,vkt=1.5,_kt=1.1;let Em=class{constructor(e){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new wre,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=()=>VVe(this)))}toArray(){return this.data.slice(0,this.length)}filter(e){const i=new Array;for(let r=0;r=this._length))return this.data[e]}includes(e,i){const r=this.data.indexOf(e,i);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,i=e.length,r){this.length=UNt(this.data,e,this.length,i,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,i){if(e>=this.length||i>=this.length||e===i)return;const r=this.data[e];this.data[e]=this.data[i],this.data[i]=r}sort(e){BVe.sort(this.data,0,this.length,e)}iterableSort(e){return BVe.iterableSort(this.data,0,this.length,e)}some(e,i){for(let r=0;rvkt*t.length&&(t.data.length=Math.floor(t.length*_kt))}function bkt(t){return{setTimeout:(e,i)=>{const r=t.setTimeout(e,i);return{remove:()=>t.clearTimeout(r)}}}}const IH=bkt(globalThis),jVe=new Set;function wkt(t,e,i=!1){i&&jVe.has(e)||(i&&jVe.add(e),t.warn(`🛑 DEPRECATED - ${e}`))}function I_e(t,e,i={}){if(Hi("esri-deprecation-warnings")){const{moduleName:r}=i;GVe(t,`Property: ${(r?r+"::":"")+e}`,i)}}function GVe(t,e,i={}){if(Hi("esri-deprecation-warnings")){const{replacement:r,version:n,see:s,warnOnce:o}=i;let a=e;r&&(a+=` 🛠️ Replacement: ${r}`),n&&(a+=` ⚙️ Version: ${n}`),s&&(a+=` - 🔗 See ${s} for more details.`),Jkt(t,a,o)}}function Lre(t){return t&&(typeof t.on=="function"||typeof t.addEventListener=="function")}function QI(t,e,i){if(!Lre(t))throw new TypeError("target is not a Evented or EventTarget object");if("on"in t)return t.on(e,i);if(Array.isArray(e)){const r=e.slice();for(const n of r)t.addEventListener(n,i);return{remove(){for(const n of r)t.removeEventListener(n,i)}}}return t.addEventListener(e,i),{remove(){t.removeEventListener(e,i)}}}function BGe(t,e,i){if(!Lre(t))throw new TypeError("target is not a Evented or EventTarget object");if("once"in t)return t.once(e,i);const r=QI(t,e,n=>{r.remove(),i.call(t,n)});return{remove(){r.remove()}}}const Zkt={Win:"Meta",Scroll:"ScrollLock",Spacebar:" ",Down:"ArrowDown",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Del:"Delete",Apps:"ContextMenu",Esc:"Escape",Multiply:"*",Add:"+",Subtract:"-",Decimal:".",Divide:"/"};function aL({key:t}){return Zkt[t]||t}function vc(t="Aborted"){return new st("AbortError",t)}function sn(t,e="Aborted"){if(bm(t))throw vc(e)}function kre(t){return ye(t)?"aborted"in t?t:t.signal:t}function bm(t){const e=kre(t);return ye(e)&&e.aborted}function Ga(t){if(ss(t))throw t}function wC(t){if(!ss(t))throw t}function ep(t,e){const i=kre(t);if(!lt(i)){if(!i.aborted)return BGe(i,"abort",()=>e());e()}}function k8(t,e){const i=kre(t);if(!lt(i))return sn(i),BGe(i,"abort",()=>e(vc()))}function Vg(t,e){const i=kre(e);return lt(i)?t:new Promise((r,n)=>{let s=ep(e,()=>n(vc()));const o=()=>s=Bc(s);t.then(o,o),t.then(r,n)})}function ss(t){return t?.name==="AbortError"}async function cf(t){try{return await t}catch(e){if(!ss(e))throw e;return}}function Jx(){let t=null;const e=new Promise((i,r)=>{t={promise:void 0,resolve:i,reject:r}});return t.promise=e,t}async function bu(t){if(!t)return;if(typeof t.forEach!="function"){const i=Object.keys(t),r=i.map(o=>t[o]),n=await bu(r),s={};return i.map((o,a)=>s[o]=n[a]),s}const e=t;return new Promise(i=>{const r=[];let n=e.length;n===0&&i(r),e.forEach(s=>{const o={promise:s||Promise.resolve(s)};r.push(o),o.promise.then(a=>{o.value=a}).catch(a=>{o.error=a}).then(()=>{--n,n===0&&i(r)})})})}async function AH(t){return(await bu(t)).filter(e=>!!e.value).map(e=>e.value)}function B3(t,e,i){const r=new AbortController;return ep(i,()=>r.abort()),new Promise((n,s)=>{let o=setTimeout(()=>{o=0,n(e)},t);ep(r,()=>{o&&(clearTimeout(o),s(vc()))})})}function Ip(t){return t&&typeof t.then=="function"}function C_e(t){return Ip(t)?t:Promise.resolve(t)}function $y(t,e=-1){let i,r,n,s,o=null;const a=(...l)=>{if(i){r=l,s&&s.reject(vc()),s=Jx();const y=s.promise;if(o){const v=o;o=null,v.abort()}return y}if(n=s||Jx(),s=null,e>0){const y=new AbortController;i=C_e(t(...l,y.signal));const v=i;B3(e).then(()=>{i===v&&(s?y.abort():o=y)})}else i=1,i=C_e(t(...l));const c=()=>{const y=r;r=n=i=o=null,y!=null&&a(...y)},d=i,p=n;return d.then(c,c),d.then(p.resolve,p.reject),p.promise};return a}function Mf(){let t,e;const i=new Promise((n,s)=>{t=n,e=s}),r=n=>{t(n)};return r.resolve=n=>t(n),r.reject=n=>e(n),r.timeout=(n,s)=>IH.setTimeout(()=>r.reject(s),n),r.promise=i,r}async function Nre(t){await Promise.resolve(),sn(t)}function YMr(t){return t}let Qkt=class{constructor(e){this.phases=e,this.paused=!1,this.ticks=-1,this.removed=!1}},eNt=class{constructor(e){this.callback=e,this.isActive=!0}remove(){this.isActive=!1}},T_e=0;const PH={time:0,deltaTime:0,elapsedFrameTime:0,frameDuration:0},E_e=["prepare","preRender","render","postRender","update","finish"],I_e=[],lL=new _m;let tNt=class{constructor(e){this._task=e}remove(){this._task.removed=!0}pause(){this._task.paused=!0}resume(){this._task.paused=!1}};const $re={frameTasks:lL,willDispatch:!1,clearFrameTasks:iNt,dispatch:UGe,executeFrameTasks:rNt};function G3(t){const e=new eNt(t);return I_e.push(e),$re.willDispatch||($re.willDispatch=!0,L8(UGe)),e}function uL(t){const e=new Qkt(t);return lL.push(e),Bre==null&&(T_e=performance.now(),Bre=requestAnimationFrame(GGe)),new tNt(e)}let Bre=null;function iNt(t=!1){lL.forAll(e=>{e.removed=!0}),t&&VGe()}function GGe(){const t=performance.now();Bre=null,Bre=lL.length>0?requestAnimationFrame(GGe):null,$re.executeFrameTasks(t)}function rNt(t){const e=t-T_e;T_e=t;const i=1e3/60,r=Math.max(0,e-i);PH.time=t,PH.frameDuration=i-r;for(let n=0;n{a.paused||a.removed||(n===0&&a.ticks++,a.phases[o]&&(PH.elapsedFrameTime=performance.now()-t,PH.deltaTime=a.ticks===0?0:e,a.phases[o]?.call(a,PH)))}),sNt[n].record(performance.now()-s)}VGe(),oNt.record(performance.now()-t)}const Gre=new _m;function VGe(){lL.forAll(t=>{t.removed&&Gre.push(t)}),lL.removeUnorderedMany(Gre.data,Gre.length),Gre.clear()}function UGe(){for(;I_e.length;){const t=I_e.shift();t.isActive&&t.callback()}$re.willDispatch=!1}function nNt(t=1,e){const i=Mf(),r=()=>{bm(e)?i.reject(vc()):t===0?i():(--t,L8(()=>r()))};return r(),i.promise}const sNt=E_e.map(t=>new EH(t)),oNt=new EH("total");function aNt(t,e){for(const i of t.entries())if(e(i[0]))return!0;return!1}let lNt=0;function V3(){return++lNt}let Vre=class{constructor(e){this._notify=e,this._accessed=[],this._handles=[],this._observerObject=new uNt(this._notify),jGe.register(this,this._observerObject)}destroy(){this._accessed.length=0,this._observerObject?.destroy(),this.clear(),jGe.unregister(this)}onObservableAccessed(e){const i=this._accessed;i.includes(e)||i.push(e)}onTrackingEnd(){const e=this._handles,i=this._accessed,r=this._observerObject;for(let n=0;n0?e-1:0}destroy(){this.destroyed=!0,this._notify=cNt}};const jGe=new FinalizationRegistry(t=>{t.destroy()});function cNt(){}let N8=!1;const Ure=[];function zGe(t,e){let i=new Vre(s),r=null,n=!1;function s(){if(!i||n)return;if(N8)return void qGe(s);const a=r;i.clear(),N8=!0,n=!0,r=ZI(i,t),n=!1,N8=!1,e(r,a),YGe()}function o(){i&&(i.destroy(),i=null,r=null)}return n=!0,r=ZI(i,t),n=!1,{remove:o}}function HGe(t,e){let i=new Vre(n),r=null;function n(){e(r,o)}function s(){i&&(i.destroy(),i=null),r=null}function o(){return i?(i.clear(),r=ZI(i,t),r):null}return o(),{remove:s}}function WGe(t){let e=new Vre(r),i=!1;function r(){e&&!i&&(N8?qGe(r):(e.clear(),N8=!0,i=!0,ZI(e,t),i=!1,N8=!1,YGe()))}function n(){e&&(e.destroy(),e=null)}return i=!0,ZI(e,t),i=!1,{remove:n}}function qGe(t){Ure.includes(t)||Ure.unshift(t)}function YGe(){for(;Ure.length;)Ure.pop()()}var OH;(function(t){t[t.Untracked=0]="Untracked",t[t.Tracked=1]="Tracked"})(OH||(OH={}));let RH=class{constructor(){this.uid=V3(),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,i,r,n,s){return this.pool.acquire(OH.Untracked,e,i,r,n,s,y_e)}static acquireTracked(e,i,r,n){return this.pool.acquire(OH.Tracked,e,i,r,null,null,n)}notify(e,i){this.type===OH.Untracked?this.callback.call(this.target,e,i,this.path,this.target):this.callback.call(null,e,i)}acquire(e,i,r,n,s,o,a){this.uid=V3(),this.removed=!1,this.type=e,this.oldValue=i,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=V3(),this.removed=!0}};RH.pool=new FGe(RH);const jre=new Bg,eA=new Set;let zre;function Hre(t){eA.delete(t),eA.add(t),zre||(zre=G3(pNt))}function hNt(t){if(t.removed)return;const e=t.oldValue,i=t.getValue();t.equals(e,i)||(t.oldValue=i,t.notify(i,e))}function dNt(t){for(const e of eA.values())e.target===t&&(e.removed=!0)}function pNt(){let t=10;for(;zre&&t--;){zre=null;const e=fNt(),i=jre.acquire();for(const r of e){const n=r.uid;hNt(r),n===r.uid&&r.removed&&i.push(r)}for(const r of eA)r.removed&&(i.push(r),eA.delete(r));for(const r of i)RH.pool.release(r);jre.release(i),jre.release(e),A_e.forEach(r=>r())}}function fNt(){const t=jre.acquire();t.length=eA.size;let e=0;for(const i of eA)t[e]=i,++e;return eA.clear(),t}const A_e=new Set;function mNt(t){return A_e.add(t),{remove(){A_e.delete(t)}}}function gNt(t,e,i){let r=fGe(t,e,i,(n,s,o)=>{let a,l,c=HGe(()=>bH(n,s),(d,p)=>{n.__accessor__.destroyed||a&&a.uid!==l?r.remove():(a||(a=RH.acquireUntracked(d,o,p,n,s),l=a.uid),Hre(a))});return{remove:mGe(()=>{c.remove(),a&&(a.uid!==l||a.removed||(a.removed=!0,Hre(a)),a=null),r=c=null})}});return r}function yNt(t,e,i){const r=fGe(t,e,i,(n,s,o)=>{let a=!1;return zGe(()=>bH(n,s),(l,c)=>{n.__accessor__.destroyed?r.remove():a||(a=!0,y_e(c,l)||o.call(n,l,c,s,n),a=!1)})});return r}function vNt(t,e,i,r=!1){return!t.__accessor__||t.__accessor__.destroyed?{remove(){}}:r?yNt(t,e,i):gNt(t,e,i)}function _Nt(t,e,i){let r,n,s=HGe(t,(o,a)=>{r&&r.uid!==n?s.remove():(r||(r=RH.acquireTracked(o,e,a,i),n=r.uid),Hre(r))});return{remove:mGe(()=>{s.remove(),r&&(r.uid!==n||r.removed||(r.removed=!0,Hre(r)),r=null),s=null})}}function bNt(t,e,i){let r=!1;return zGe(t,(n,s)=>{r||(r=!0,i(s,n)||e(n,s),r=!1)})}function wNt(t,e,i=!1,r=Skt){return i?bNt(t,e,r):_Nt(t,e,r)}function XGe(t){return aNt(eA,e=>e.oldValue===t)}function Wre(t,e){for(const[i,r]of t)if(e(r,i))return!0;return!1}function xC(t,e,i){const r=t.get(e);if(r!==void 0)return r;const n=i();return t.set(e,n),n}const $8=Ei.getLogger("esri.core.accessorSupport.ensureTypes");function xNt(t){return t==null?t:new Date(t)}function SNt(t){return t==null?t:!!t}function MH(t){return t==null?t:t.toString()}function Ld(t){return t==null?t:(t=parseFloat(t),isNaN(t)?0:t)}function qre(t){return t==null?t:Math.round(parseFloat(t))}function KGe(t){return t&&t.constructor&&t.constructor.__accessorMetadata__!==void 0}function Yre(t,e){return e!=null&&t&&!(e instanceof t)}function JGe(t){return t&&"isCollection"in t}function ZGe(t){return t&&t.Type?typeof t.Type=="function"?t.Type:t.Type.base:null}function CNt(t,e){if(!e||!e.constructor||!JGe(e.constructor))return P_e(t,e)?e:new t(e);const i=ZGe(t.prototype.itemType),r=ZGe(e.constructor.prototype.itemType);return i?r?i===r?e:i.prototype.isPrototypeOf(r.prototype)?new t(e):(P_e(t,e),e):new t(e):e}function P_e(t,e){return!!KGe(e)&&($8.error("Accessor#set","Assigning an instance of '"+(e.declaredClass||"unknown")+"' which is not a subclass of '"+Xre(t)+"'"),!0)}function kd(t,e){return e==null?e:JGe(t)?CNt(t,e):Yre(t,e)?P_e(t,e)?e:new t(e):e}function Xre(t){return t&&t.prototype&&t.prototype.declaredClass||"unknown"}const TNt=new WeakMap;function ENt(t){switch(t){case Number:return Ld;case xs:return qre;case Boolean:return SNt;case String:return MH;case Date:return xNt;default:return xC(TNt,t,()=>kd.bind(null,t))}}function ud(t,e){const i=ENt(t);return arguments.length===1?i:i(e)}function DH(t,e,i){return arguments.length===1?DH.bind(null,t):e&&(Array.isArray(e)?e.map(r=>t(r,i)):[t(e,i)])}function INt(t,e){return arguments.length===1?DH(ud.bind(null,t)):DH(ud.bind(null,t),e)}function QGe(t,e,i){return e!==0&&Array.isArray(i)?i.map(r=>QGe(t,e-1,r)):t(i)}function Kre(t,e,i){if(arguments.length===2)return Kre.bind(null,t,e);if(!i)return i;let r=e,n=i=QGe(t,e,i);for(;r>0&&Array.isArray(n);)r--,n=n[0];if(n!==void 0)for(let s=0;s{const i=typeof e;return!(i==="string"||i==="number"||i==="function"&&t.length>1)})}function O_e(t,e){if(arguments.length===2)return O_e(t).call(null,e);const i=new Set,r=t.filter(a=>typeof a!="function"),n=t.filter(a=>typeof a=="function");for(const a of t)typeof a!="string"&&typeof a!="number"||i.add(a);let s=null,o=null;return(a,l)=>{if(a==null)return a;const c=typeof a,d=c==="string"||c==="number";return d&&(i.has(a)||n.some(p=>c==="string"&&p===String||c==="number"&&p===Number))||c==="object"&&n.some(p=>!Yre(a,p))?a:(d&&r.length?(s||(s=r.map(p=>typeof p=="string"?`'${p}'`:`${p}`).join(", ")),$8.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(p=>Xre(p)).join(", ")),$8.error("Accessor#set",`'${a}' is not a valid value for this property, value must be one of ${o}`)):$8.error("Accessor#set",`'${a}' is not a valid value for this property`),l&&(l.valid=!1),null)}}function SC(t,e){if(arguments.length===2)return SC(t).call(null,e);const i={},r=[],n=[];for(const l in t.typeMap){const c=t.typeMap[l];i[l]=ud(c),r.push(Xre(c)),n.push(l)}const s=()=>`'${r.join("', '")}'`,o=()=>`'${n.join("', '")}'`,a=typeof t.key=="string"?l=>l[t.key]:t.key;return l=>{if(t.base&&!Yre(t.base,l)||l==null)return l;const c=a(l)||t.defaultKeyValue,d=i[c];if(!d)return $8.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(!Yre(t.typeMap[c],l))return l;if(typeof t.key=="string"&&!KGe(l)){const p={};for(const y in l)y!==t.key&&(p[y]=l[y]);return d(p)}return d(l)}}let xs=class{};const FH={native:t=>({type:"native",value:t}),array:t=>({type:"array",value:t}),oneOf:t=>({type:"one-of",values:t})};function PNt(t){if(!t||!("type"in t))return!1;switch(t.type){case"native":case"array":case"one-of":return!0}return!1}function tVe(t){switch(t.type){case"native":return ud(t.value);case"array":return DH(tVe(t.value));case"one-of":return ONt(t);default:return null}}function ONt(t){let e=null;return(i,r)=>M_e(i,t)?i:(e==null&&(e=R_e(t)),$8.error("Accessor#set",`Invalid property value, value needs to be of type ${e}`),r&&(r.valid=!1),null)}function R_e(t){switch(t.type){case"native":switch(t.value){case Number:return"number";case String:return"string";case Boolean:return"boolean";case xs:return"integer";case Date:return"date";default:return Xre(t.value)}case"array":return`array of ${R_e(t.value)}`;case"one-of":{const e=t.values.map(i=>R_e(i));return`one of ${e.slice(0,e.length-1)} or ${e[e.length-1]}`}}return"unknown"}function M_e(t,e){if(t==null)return!0;switch(e.type){case"native":switch(e.value){case Number:case xs:return typeof t=="number";case Boolean:return typeof t=="boolean";case String:return typeof t=="string"}return t instanceof e.value;case"array":return!!Array.isArray(t)&&!t.some(i=>!M_e(i,e.value));case"one-of":return e.values.some(i=>M_e(t,i))}}function k(t={}){return(e,i)=>{if(e===Function.prototype)throw new Error(`Inappropriate use of @property() on a static field: ${e.name}.${i}. Accessor does not support static properties.`);const r=Object.getOwnPropertyDescriptor(e,i),n=xH(e,i);r&&(r.get||r.set?(n.get=r.get||n.get,n.set=r.set||n.set):"value"in r&&("value"in t&&Ei.getLogger("esri.core.accessorSupport.decorators.property").warn(`@property() will redefine the value of "${i}" on "${e.constructor.name}" already defined in the metadata`,t),n.value=t.value=r.value)),t.readOnly!=null&&(n.readOnly=t.readOnly);const s=t.aliasOf;if(s){const l=typeof s=="string"?s:s.source,c=typeof s=="string"?null:s.overridable===!0;let d;n.dependsOn=[l],n.get=function(){let p=Are(this,l);if(typeof p=="function"){d||(d=l.split(".").slice(0,-1).join("."));const y=Are(this,d);y&&(p=p.bind(y))}return p},n.readOnly||(n.set=c?function(p){this._override(i,p)}:function(p){Dre(this,l,p)})}const o=t.type,a=t.types;n.cast||(o?n.cast=RNt(o):a&&(Array.isArray(a)?n.cast=DH(SC(a[0])):n.cast=SC(a))),Pkt(n,t),t.range&&(n.cast=iVe(n.cast,t.range))}}function D_e(t,e,i){const r=xH(t,i);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 RNt(t){let e=0,i=t;if(PNt(t))return tVe(t);for(;Array.isArray(i)&&i.length===1&&typeof i[0]!="string"&&typeof i[0]!="number";)i=i[0],e++;const r=i;if(eVe(r))return e===0?O_e(r):Kre(O_e(r),e);if(e===1)return INt(r);if(e>1)return ANt(r,e);const n=t;return n.from?n.from:ud(n)}function iVe(t,e){return i=>{let r=+t(i);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 MNt(t){if(t.json&&t.json.origins){const e=t.json.origins,i={"web-document":["web-scene","web-map"]};for(const r in i)if(e[r]){const n=e[r];i[r].forEach(s=>{e[s]=n}),delete e[r]}}}let wm=class M9e extends DGe{constructor(e,i,r){if(super(e,i,r),!(this instanceof M9e))return new M9e(e,i,r)}};wm.prototype.type="warning";function rVe(t){return!!t&&t.prototype&&t.prototype.declaredClass&&t.prototype.declaredClass.indexOf("esri.core.Collection")===0}const F_e=Ei.getLogger("esri.core.accessorSupport.extensions.serializableProperty.reader");function nVe(t,e,i){t&&(!i&&!e.read||e.read?.reader||e.read?.enabled===!1||LNt(t)&&Ep("read.reader",CC(t),e))}function CC(t){const e=t.ndimArray??0;if(e>1)return FNt(t);if(e===1)return oVe(t);if("type"in t&&aVe(t.type)){const i=t.type.prototype?.itemType?.Type,r=oVe(typeof i=="function"?{type:i}:{types:i});return(n,s,o)=>{const a=r(n,s,o);return a&&new t.type(a)}}return L_e(t)}function L_e(t){return"type"in t?DNt(t.type):kNt(t.types)}function DNt(t){return t.prototype.read?(e,i,r)=>{if(e==null)return e;const n=typeof e;if(n!=="object")return void F_e.error(`Expected JSON value of type 'object' to deserialize type '${t.prototype.declaredClass}', but got '${n}'`);const s=new t;return s.read(e,r),s}:t.fromJSON}function sVe(t,e,i,r){return r!==0&&Array.isArray(e)?e.map(n=>sVe(t,n,i,r-1)):t(e,void 0,i)}function FNt(t){const e=L_e(t),i=sVe.bind(null,e),r=t.ndimArray??0;return(n,s,o)=>{if(n==null)return n;n=i(n,o,r);let a=r,l=n;for(;a>0&&Array.isArray(l);)a--,l=l[0];if(l!==void 0)for(let c=0;c{if(i==null)return i;if(Array.isArray(i)){const o=[];for(const a of i){const l=e(a,void 0,n);l!==void 0&&o.push(l)}return o}const s=e(i,void 0,n);return s!==void 0?[s]:void 0}}function aVe(t){if(!rVe(t))return!1;const e=t.prototype.itemType;return!(!e||!e.Type)&&(typeof e.Type=="function"?k_e(e.Type):lVe(e.Type))}function LNt(t){return"types"in t?lVe(t.types):k_e(t.type)}function k_e(t){return!Array.isArray(t)&&!!t&&t.prototype&&("read"in t.prototype||"fromJSON"in t||aVe(t))}function lVe(t){for(const e in t.typeMap)if(!k_e(t.typeMap[e]))return!1;return!0}function kNt(t){let e=null;const i=t.errorContext??"type";return(r,n,s)=>{if(r==null)return r;const o=typeof r;if(o!=="object")return void F_e.error(`Expected JSON value of type 'object' to deserialize, but got '${o}'`);e||(e=NNt(t));const a=t.key;if(typeof a!="string")return;const l=r[a],c=l?e[l]:t.defaultKeyValue?t.typeMap[t.defaultKeyValue]:void 0;if(!c){const p=`Type '${l||"unknown"}' is not supported`;return s&&s.messages&&r&&s.messages.push(new wm(`${i}:unsupported`,p,{definition:r,context:s})),void F_e.error(p)}const d=new c;return d.read(r,s),d}}function NNt(t){const e={};for(const i in t.typeMap){const r=t.typeMap[i],n=wH(r.prototype);if(typeof t.key=="function")continue;const s=n[t.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||!o.writer){e[i]=r;continue}const a=o.target,l=typeof a=="string"?a:t.key,c={};o.writer(i,c,l),c[l]&&(e[c[l]]=r)}return e}function $Nt(t){if(t.json||(t.json={}),cVe(t.json),hVe(t.json),uVe(t.json),t.json.origins)for(const e in t.json.origins)cVe(t.json.origins[e]),hVe(t.json.origins[e]),uVe(t.json.origins[e]);return!0}function uVe(t){t.name&&(t.read&&typeof t.read=="object"?t.read.source===void 0&&(t.read.source=t.name):t.read={source:t.name},t.write&&typeof t.write=="object"?t.write.target===void 0&&(t.write.target=t.name):t.write={target:t.name})}function cVe(t){typeof t.read=="boolean"?t.read={enabled:t.read}:typeof t.read=="function"?t.read={enabled:!0,reader:t.read}:t.read&&typeof t.read=="object"&&t.read.enabled===void 0&&(t.read.enabled=!0)}function hVe(t){typeof t.write=="boolean"?t.write={enabled:t.write}:typeof t.write=="function"?t.write={enabled:!0,writer:t.write}:t.write&&typeof t.write=="object"&&t.write.enabled===void 0&&(t.write.enabled=!0)}function dVe(t,e){if(!e.write||e.write.writer||e.write.enabled===!1&&!e.write.overridePolicy)return;const i=t?.ndimArray??0;t&&(i===1||"type"in t&&rVe(t.type))?e.write.writer=VNt:i>1?e.write.writer=UNt(i):e.types?Array.isArray(e.types)?e.write.writer=GNt(e.types[0]):e.write.writer=BNt(e.types):e.write.writer=LH}function BNt(t){return(e,i,r,n)=>e?pVe(e,t,n)?LH(e,i,r,n):void 0:LH(e,i,r,n)}function pVe(t,e,i){for(const r in e.typeMap)if(t instanceof e.typeMap[r])return!0;if(i?.messages){const r=e.errorContext??"type",n=`Values of type '${(typeof e.key!="function"?t[e.key]:t.declaredClass)??"Unknown"}' cannot be written`;i&&i.messages&&t&&i.messages.push(new st(`${r}:unsupported`,n,{definition:t,context:i})),Ei.getLogger("esri.core.accessorSupport.extensions.serializableProperty.writer").error(n)}return!1}function GNt(t){return(e,i,r,n)=>!e||!Array.isArray(e)?LH(e,i,r,n):LH(e.filter(s=>pVe(s,t,n)),i,r,n)}function LH(t,e,i,r){Ep(i,Jre(t,r),e)}function Jre(t,e){return t&&typeof t.write=="function"?t.write({},e):t&&typeof t.toJSON=="function"?t.toJSON():typeof t=="number"?Zre(t):t}function Zre(t){return t===-1/0?-Number.MAX_VALUE:t===1/0?Number.MAX_VALUE:isNaN(t)?null:t}function VNt(t,e,i,r){let n;t===null?n=null:t&&typeof t.map=="function"?(n=t.map(s=>Jre(s,r)),typeof n.toArray=="function"&&(n=n.toArray())):n=[Jre(t,r)],Ep(i,n,e)}function fVe(t,e,i){return i!==0&&Array.isArray(t)?t.map(r=>fVe(r,e,i-1)):Jre(t,e)}function UNt(t){return(e,i,r,n)=>{let s;if(e===null)s=null;else{s=fVe(e,n,t);let o=t,a=s;for(;o>0&&Array.isArray(a);)o--,a=a[0];if(a!==void 0)for(let l=0;l{e.prototype.declaredClass=t,YNt(e);const i=[],r=[];let n=e.prototype;for(;n;)n.hasOwnProperty("initialize")&&!G_e.has(n.initialize)&&(G_e.add(n.initialize),i.push(n.initialize)),n.hasOwnProperty("destroy")&&!V_e.has(n.destroy)&&(V_e.add(n.destroy),r.push(n.destroy)),n=Object.getPrototypeOf(n);G_e.clear(),V_e.clear();class s extends e{constructor(...a){if(super(...a),this.constructor===s&&typeof this.postscript=="function"){if(i.length&&Object.defineProperty(this,"initialize",{enumerable:!1,configurable:!0,value(){for(let l=i.length-1;l>=0;l--)i[l].call(this)}}),r.length){let l=!1;const c=this[ZBe];Object.defineProperty(this,"destroy",{enumerable:!1,configurable:!0,value(){if(!l){l=!0,c.call(this);for(let d=0;d0&&this.normalizeCtorArgs&&(this.__accessor__.ctorArgs=this.normalizeCtorArgs.apply(this,e))}postscript(e){const i=this.__accessor__,r=i.ctorArgs||e;i.initialize(),r&&(this.set(r),i.ctorArgs=null),i.constructed(),this.initialize(),this[U_e]=!0}initialize(){}[ZBe](){this[cL]=ra(this[cL])}destroy(){this.destroyed||(dNt(this),this.__accessor__.destroy())}get constructed(){return this.__accessor__&&this.__accessor__.initialized||!1}get initialized(){return this[U_e]}get destroyed(){return this.__accessor__&&this.__accessor__.destroyed||!1}commitProperty(e){this.get(e)}get(e){return Are(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,i){return Dre(this,e,i),this}watch(e,i,r){return vNt(this,e,i,r)}own(e){this.addHandles(e)}addHandles(e,i){let r=this[cL];lt(r)&&(r=this[cL]=new uf),r.add(e,i)}removeHandles(e){const i=this[cL];lt(i)||i.remove(e)}hasHandles(e){const i=this[cL];return!!ye(i)&&i.has(e)}_override(e,i){i===void 0?this.__accessor__.clearOverride(e):this.__accessor__.override(e,i)}_clearOverride(e){return this.__accessor__.clearOverride(e)}_overrideIfSome(e,i){i==null?this.__accessor__.clearOverride(e):this.__accessor__.override(e,i)}_isOverridden(e){return this.__accessor__.isOverridden(e)}notifyChange(e){this.__accessor__.notifyChange(e)}_get(e){return this.__accessor__.internalGet(e)}_set(e,i){return this.__accessor__.internalSet(e,i),this}};yVe=cL,vVe=U_e;let Qre=class fLt{constructor(){this._emitter=new fLt.EventEmitter(this)}emit(e,i){return this._emitter.emit(e,i)}on(e,i){return this._emitter.on(e,i)}once(e,i){return this._emitter.once(e,i)}hasEventListener(e){return this._emitter.hasEventListener(e)}};(function(t){class e{constructor(n=null){this._target=n,this._listenersMap=null}clear(){this._listenersMap&&this._listenersMap.clear(),this._listenersMap=null}emit(n,s){const o=this._listenersMap&&this._listenersMap.get(n);if(!o)return!1;const a=this._target||this;return[...o].forEach(l=>{l.call(a,s)}),o.length>0}on(n,s){if(Array.isArray(n)){const a=n.map(l=>this.on(l,s));return D8(a)}if(n.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap||(this._listenersMap=new Map);const o=this._listenersMap.get(n)||[];return o.push(s),this._listenersMap.set(n,o),{remove:()=>{const a=this._listenersMap&&this._listenersMap.get(n)||[],l=a.indexOf(s);l>=0&&a.splice(l,1)}}}once(n,s){const o=this.on(n,a=>{o.remove(),s.call(null,a)});return o}hasEventListener(n){const s=this._listenersMap&&this._listenersMap.get(n);return s!=null&&s.length>0}}t.EventEmitter=e,t.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=E([ht("esri.core.Evented")],n),n};let i=class extends fn{constructor(){super(...arguments),this._emitter=new Qre.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)}};i=E([ht("esri.core.Evented")],i),t.EventedAccessor=i})(Qre||(Qre={}));const cd=Qre;var sc;(function(t){t[t.ADD=1]="ADD",t[t.REMOVE=2]="REMOVE",t[t.MOVE=4]="MOVE"})(sc||(sc={}));function j_e(t){return(e,i)=>{e[i]=t}}let z_e=class extends CGe{notify(){const e=this._observers;if(e&&e.length>0){const i=e.slice();for(const r of i)r.onInvalidated(),r.onCommitted()}}};var tA;let KNt=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}};const jb=new _C(KNt,void 0,t=>{t.item=null,t.target=null,t.defaultPrevented=!1,t.cancellable=!1}),JNt=()=>{};function H_e(t){return t?t instanceof hL?t.toArray():t.length?Array.prototype.slice.apply(t):[]:[]}function W_e(t){if(t&&t.length)return t[0]}function ZNt(t,e,i,r){const n=Math.min(t.length-i,e.length-r);let s=0;for(;s{t.push(n),_Ve(t,i.call(r,n,s,o),i,r)})}const U3=new Set,j3=new Set,z3=new Set,q_e=new Map;let QNt=0,hL=tA=class extends cd.EventedAccessor{static isCollection(t){return t!=null&&t instanceof tA}constructor(t){super(t),this._chgListeners=[],this._notifications=null,this._timer=null,this._observable=new z_e,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:QNt++})}normalizeCtorArgs(t){return t?Array.isArray(t)||t instanceof tA?{items:t}:t:{}}destroy(){this.removeAll()}*[Symbol.iterator](){yield*this.items}get items(){return Ia(this._observable),this._items}set items(t){this._emitBeforeChanges(sc.ADD)||(this._splice(0,this.length,H_e(t)),this._emitAfterChanges(sc.ADD))}hasEventListener(t){return t==="change"?this._chgListeners.length>0:this._emitter.hasEventListener(t)}on(t,e){if(t==="change"){const i=this._chgListeners,r={removed:!1,callback:e};return i.push(r),this._notifications&&this._notifications.push({listeners:i.slice(),items:this._items.slice(),changes:[]}),{remove(){this.remove=JNt,r.removed=!0,i.splice(i.indexOf(r),1)}}}return this._emitter.on(t,e)}once(t,e){const i=this.on(t,e);return{remove(){i.remove()}}}add(t,e){if(Ia(this._observable),this._emitBeforeChanges(sc.ADD))return this;const i=this.getNextIndex(e??null);return this._splice(i,0,[t]),this._emitAfterChanges(sc.ADD),this}addMany(t,e=this._items.length){if(Ia(this._observable),!t||!t.length)return this;if(this._emitBeforeChanges(sc.ADD))return this;const i=this.getNextIndex(e);return this._splice(i,0,H_e(t)),this._emitAfterChanges(sc.ADD),this}at(t){if(Ia(this._observable),(t=Math.trunc(t)||0)<0&&(t+=this.length),!(t<0||t>=this.length))return this._items[t]}removeAll(){if(Ia(this._observable),!this.length||this._emitBeforeChanges(sc.REMOVE))return[];const t=this._splice(0,this.length)||[];return this._emitAfterChanges(sc.REMOVE),t}clone(){return Ia(this._observable),this._createNewInstance({items:this._items.map(hi)})}concat(...t){Ia(this._observable);const e=t.map(H_e);return this._createNewInstance({items:this._items.concat(...e)})}drain(t,e){if(Ia(this._observable),!this.length||this._emitBeforeChanges(sc.REMOVE))return;const i=this._splice(0,this.length),r=i.length;for(let n=0;ne&&(t=e),t}includes(t,e=0){return Ia(this._observable),this._items.includes(t,e)}indexOf(t,e=0){return Ia(this._observable),this._items.indexOf(t,e)}join(t=","){return Ia(this._observable),this._items.join(t)}lastIndexOf(t,e=this.length-1){return Ia(this._observable),this._items.lastIndexOf(t,e)}map(t,e){Ia(this._observable);const i=this._items.map(t,e);return new tA({items:i})}reorder(t,e=this.length-1){Ia(this._observable);const i=this.indexOf(t);if(i!==-1){if(e<0?e=0:e>=this.length&&(e=this.length-1),i!==e){if(this._emitBeforeChanges(sc.MOVE))return t;this._splice(i,1),this._splice(e,0,[t]),this._emitAfterChanges(sc.MOVE)}return t}}pop(){if(Ia(this._observable),!this.length||this._emitBeforeChanges(sc.REMOVE))return;const t=W_e(this._splice(this.length-1,1));return this._emitAfterChanges(sc.REMOVE),t}push(...t){return Ia(this._observable),this._emitBeforeChanges(sc.ADD)||(this._splice(this.length,0,t),this._emitAfterChanges(sc.ADD)),this.length}reduce(t,e){Ia(this._observable);const i=this._items;return arguments.length===2?i.reduce(t,e):i.reduce(t)}reduceRight(t,e){Ia(this._observable);const i=this._items;return arguments.length===2?i.reduceRight(t,e):i.reduceRight(t)}remove(t){return Ia(this._observable),this.removeAt(this.indexOf(t))}removeAt(t){if(Ia(this._observable),t<0||t>=this.length||this._emitBeforeChanges(sc.REMOVE))return;const e=W_e(this._splice(t,1));return this._emitAfterChanges(sc.REMOVE),e}removeMany(t){if(Ia(this._observable),!t||!t.length||this._emitBeforeChanges(sc.REMOVE))return[];const e=t instanceof tA?t.toArray():t,i=this._items,r=[],n=e.length;for(let s=0;s-1){const l=1+ZNt(e,i,s+1,a+1),c=this._splice(a,l);c&&c.length>0&&r.push.apply(r,c),s+=l-1}}return this._emitAfterChanges(sc.REMOVE),r}reverse(){if(Ia(this._observable),this._emitBeforeChanges(sc.MOVE))return this;const t=this._splice(0,this.length);return t&&(t.reverse(),this._splice(0,0,t)),this._emitAfterChanges(sc.MOVE),this}shift(){if(Ia(this._observable),!this.length||this._emitBeforeChanges(sc.REMOVE))return;const t=W_e(this._splice(0,1));return this._emitAfterChanges(sc.REMOVE),t}slice(t=0,e=this.length){return Ia(this._observable),this._createNewInstance({items:this._items.slice(t,e)})}some(t,e){return Ia(this._observable),this._items.some(t,e)}sort(t){if(Ia(this._observable),!this.length||this._emitBeforeChanges(sc.MOVE))return this;const e=this._splice(0,this.length);return arguments.length?e.sort(t):e.sort(),this._splice(0,0,e),this._emitAfterChanges(sc.MOVE),this}splice(t,e,...i){Ia(this._observable);const r=(e?sc.REMOVE:0)|(i.length?sc.ADD:0);if(this._emitBeforeChanges(r))return[];const n=this._splice(t,e,i)||[];return this._emitAfterChanges(r),n}toArray(){return Ia(this._observable),this._items.slice()}toJSON(){return Ia(this._observable),this.toArray()}toLocaleString(){return Ia(this._observable),this._items.toLocaleString()}toString(){return Ia(this._observable),this._items.toString()}unshift(...t){return Ia(this._observable),!t.length||this._emitBeforeChanges(sc.ADD)||(this._splice(0,0,t),this._emitAfterChanges(sc.ADD)),this.length}_createNewInstance(t){return new this.constructor(t)}_splice(t,e,i){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._timer=G3(()=>this._dispatchChange())),e){if(o=r.splice(t,e),this.hasEventListener("before-remove")){const a=jb.acquire();a.target=this,a.cancellable=!0;for(let l=0,c=o.length;l{r.push(l)});const n=Bg.acquire();j3.forEach(l=>{n.push(l)});const s=this._items,o=e.items,a=Bg.acquire();if(z3.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},c=e.listeners.length;for(let d=0;d{if(!t)return tA;if(q_e.has(t))return q_e.get(t);let e=null;if(typeof t=="function")e=t.prototype.declaredClass;else if(t.base)e=t.base.prototype.declaredClass;else for(const r in t.typeMap){const n=t.typeMap[r].prototype.declaredClass;e?e+=` | ${n}`:e=n}let i=class extends tA{};return E([j_e({Type:t,ensureType:typeof t=="function"?ud(t):SC(t)})],i.prototype,"itemType",void 0),i=E([ht(`esri.core.Collection<${e}>`)],i),q_e.set(t,i),i},E([k()],hL.prototype,"length",void 0),E([k()],hL.prototype,"items",null),hL=tA=E([ht("esri.core.Collection")],hL);const fr=hL;function rg(t,e,i=fr){return e||(e=new i),e===t||(e.removeAll(),e6t(t)?e.addMany(t):t&&e.add(t)),e}function B8(t){return t}function e6t(t){return t&&(Array.isArray(t)||"items"in t&&Array.isArray(t.items))}let t6t=class mLt{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const i=new mLt;return this._values.forEach((r,n)=>{e&&e.has(n)||i.set(n,hi(r.value),r.origin)}),i}get(e,i){i=this._normalizeOrigin(i);const r=this._values.get(e);return i==null||r?.origin===i?r?.value:void 0}originOf(e){return this._values.get(e)?.origin??Fn.USER}keys(e){e=this._normalizeOrigin(e);const i=[...this._values.keys()];return e==null?i:i.filter(r=>this._values.get(r)?.origin===e)}set(e,i,r){if((r=this._normalizeOrigin(r))===Fn.DEFAULTS){const n=this._values.get(e);if(n&&n.origin!=null&&n.origin>r)return}this._values.set(e,new i6t(i,r))}delete(e,i){(i=this._normalizeOrigin(i))!=null&&this._values.get(e)?.origin!==i||this._values.delete(e)}has(e,i){return(i=this._normalizeOrigin(i))!=null?this._values.get(e)?.origin===i:this._values.has(e)}forEach(e){this._values.forEach(({value:i},r)=>e(i,r))}_normalizeOrigin(e){if(e!=null)return e===Fn.DEFAULTS?e:Fn.USER}},i6t=class{constructor(e,i){this.value=e,this.origin=i}};function bVe(t,e,i){e.keys().forEach(n=>{i.set(n,e.get(n),Fn.DEFAULTS)});const r=t.metadatas;Object.keys(r).forEach(n=>{t.internalGet(n)&&i.set(n,t.internalGet(n),Fn.DEFAULTS)})}function r6t(t,e,i){if(!t||!t.read||t.read.enabled===!1||!t.read.source)return!1;const r=t.read.source;if(typeof r=="string"){if(r===e||r.includes(".")&&r.indexOf(e)===0&&vGe(r,i))return!0}else for(const n of r)if(n===e||n.includes(".")&&n.indexOf(e)===0&&vGe(n,i))return!0;return!1}function n6t(t){return t&&(!t.read||t.read.enabled!==!1&&!t.read.source)}function s6t(t,e,i,r,n){let s=N_e(e[i],n);n6t(s)&&(t[i]=!0);for(const o of Object.getOwnPropertyNames(e))s=N_e(e[o],n),r6t(s,i,r)&&(t[o]=!0)}function o6t(t,e,i,r){const n=i.metadatas,s=$_e(n[e],"any",r),o=s&&s.default;if(o===void 0)return;const a=typeof o=="function"?o.call(t,e,r):o;a!==void 0&&i.set(e,a)}const wVe={origin:"service"};function xVe(t,e,i=wVe){if(!e||typeof e!="object")return;const r=Tp(t),n=r.metadatas,s={};for(const o of Object.getOwnPropertyNames(e))s6t(s,n,o,e,i);r.setDefaultOrigin(i.origin);for(const o of Object.getOwnPropertyNames(s)){const a=N_e(n[o],i).read,l=a&&a.source;let c;c=l&&typeof l=="string"?bH(e,l):e[o],a&&a.reader&&(c=a.reader.call(t,c,e,i)),c!==void 0&&r.set(o,c)}if(!i||!i.ignoreDefaults){r.setDefaultOrigin("defaults");for(const o of Object.getOwnPropertyNames(n))s[o]||o6t(t,o,r,i)}r.setDefaultOrigin("user")}function a6t(t,e,i,r=wVe){const n={...r,messages:[]};i(n),n.messages?.forEach(s=>{s.type!=="warning"||t.loaded?r&&r.messages&&r.messages.push(s):t.loadWarnings.push(s)})}function l6t(t,e,i,r,n){const s={};return e.write?.writer?.call(t,r,s,i,n),s}function SVe(t,e,i,r,n,s){if(!r||!r.write)return!1;const o=t.get(i);if(!n&&r.write.overridePolicy){const a=r.write.overridePolicy.call(t,o,i,s);a!==void 0&&(n=a)}if(n||(n=r.write),!n||n.enabled===!1)return!1;if((o===null&&!n.allowNull&&!n.writerEnsuresNonNull||o===void 0)&&n.isRequired){const a=new st("web-document-write:property-required",`Missing value for required property '${i}' on '${t.declaredClass}'`,{propertyName:i,target:t});return a&&s&&s.messages?s.messages.push(a):a&&!s&&Ei.getLogger("esri.core.accessorSupport.write").error(a.name,a.message),!1}return!(o===void 0||o===null&&!n.allowNull&&!n.writerEnsuresNonNull||(!e.store.multipleOriginsSupported||e.store.originOf(i)===Fn.DEFAULTS)&&u6t(t,i,s,r,o)||!n.ignoreOrigin&&s&&s.origin&&e.store.multipleOriginsSupported&&e.store.originOf(i)0&&(e=Ere(e,l),i?.resources?.pendingOperations?.length&&i.resources.pendingOperations.push(Promise.all(i.resources.pendingOperations).then(()=>Ere(e,l,()=>"replace-arrays"))),i&&i.writtenProperties&&i.writtenProperties.push({target:t,propName:s,oldOrigin:kkt(r.store.originOf(s)),newOrigin:i.origin}))}return e}const z0=t=>{let e=class extends t{constructor(...i){super(...i);const r=Tp(this),n=r.store,s=new t6t;r.store=s,bVe(r,n,s)}read(i,r){xVe(this,i,r)}write(i={},r){return TVe(this,i,r)}toJSON(i){return this.write({},i)}static fromJSON(i,r){return c6t.call(this,i,r)}};return e=E([ht("esri.core.JSONSupport")],e),e.prototype.toJSON.isDefaultToJSON=!0,e};function c6t(t,e){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");const i=new this;return i.read(t,e),i}let Ni=class extends z0(fn){};Ni=E([ht("esri.core.JSONSupport")],Ni);var H3;(function(t){t[t.PENDING=0]="PENDING",t[t.RESOLVED=1]="RESOLVED",t[t.REJECTED=2]="REJECTED"})(H3||(H3={}));let h6t=class{constructor(e){this.instance=e,this._resolver=Jx(),this._status=H3.PENDING,this._resolvingPromises=[],this._resolver.promise.then(()=>{this._status=H3.RESOLVED,this._cleanUp()},()=>{this._status=H3.REJECTED,this._cleanUp()})}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return this._status===H3.RESOLVED}isRejected(){return this._status===H3.REJECTED}isFulfilled(){return this._status!==H3.PENDING}abort(){this._resolver.reject(vc())}when(e,i){return this._resolver.promise.then(e,i)}_cleanUp(){this._allPromise=this._resolvingPromises=this._allPromise=null}_tryResolve(){if(this.isFulfilled())return;const e=Jx(),i=[...this._resolvingPromises,e.promise],r=this._allPromise=Promise.all(i);r.then(()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve(this.instance)},n=>{this.isFulfilled()||this._allPromise!==r||ss(n)||this._resolver.reject(n)}),e.resolve()}};const Zx=t=>{let e=class extends t{constructor(...i){super(...i),this._promiseProps=new h6t(this),this.addResolvingPromise(Promise.resolve())}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(i,r){return new Promise((n,s)=>{this._promiseProps.when(n,s)}).then(i,r)}catch(i){return this.when(null,i)}addResolvingPromise(i){i&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in i?i.when():i)}};return e=E([ht("esri.core.Promise")],e),e};let kH=class extends Zx(fn){};kH=E([ht("esri.core.Promise")],kH);const d6t="not-loaded",p6t="loading",f6t="failed",EVe="loaded",IVe=t=>{let e=class extends t{constructor(...i){super(...i),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 c=k8(s,l);this.destroyed&&l(new st("load:instance-destroyed",`Instance of '${this.declaredClass||this.constructor.name}' is already destroyed`,{instance:this})),this._promiseProps.when(a,l).finally(()=>{c&&c.remove()})});if(this.loadStatus===d6t){this._set("loadStatus",p6t);const a=this._loadController=new AbortController;n({signal:a.signal}),ep(a.signal,()=>{this._promiseProps.abort()})}return r(),o}})),this.when(()=>{this._set("loadStatus",EVe),this._loadController=null},r=>{this._set("loadStatus",f6t),this._set("loadError",r),this._loadController=null})}get loaded(){return this.loadStatus===EVe}get loadWarnings(){return this._get("loadWarnings")}load(){return null}cancelLoad(){return this.isFulfilled()||(this._set("loadError",new st("load:cancelled","Cancelled")),this._loadController?.abort()),this}};return E([k({readOnly:!0})],e.prototype,"loaded",null),E([k({readOnly:!0})],e.prototype,"loadError",void 0),E([k({clonable:!1})],e.prototype,"loadStatus",void 0),E([k({type:[wm],readOnly:!0})],e.prototype,"loadWarnings",null),e=E([ht("esri.core.Loadable")],e),e};let NH=class extends IVe(kH){};NH=E([ht("esri.core.Loadable")],NH),function(t){function e(i){return!(!i||!i.load)}t.LoadableMixin=IVe,t.isLoadable=e}(NH||(NH={}));const hd=NH;function m6t(t,e,i){return bu(t.map((r,n)=>e.apply(i,[r,n])))}async function g6t(t,e,i){return(await bu(t.map((r,n)=>e.apply(i,[r,n])))).map(r=>r.value)}function Y_e(t){return{ok:!0,value:t}}function X_e(t){return{ok:!1,error:t}}function y6t(t){return ye(t)&&t.ok===!0?t.value:null}function v6t(t){return ye(t)&&t.ok===!1?t.error:null}async function TC(t){if(lt(t))return{ok:!1,error:new Error("no promise provided")};try{return Y_e(await t)}catch(e){return X_e(e)}}async function AVe(t){try{return Y_e(await t)}catch(e){return Ga(e),X_e(e)}}function EC(t,e){return new W3(t,e)}let W3=class extends fn{get value(){return y6t(this._result)}get error(){return v6t(this._result)}get finished(){return ye(this._result)}constructor(e,i){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=rL(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=Y_e(n),this._cleanup()},n=>{this._result=X_e(n),this._cleanup()}),this._abortHandle=ep(i,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=Bc(this._abortHandle),this._abortController=null}};E([k()],W3.prototype,"value",null),E([k()],W3.prototype,"error",null),E([k()],W3.prototype,"finished",null),E([k()],W3.prototype,"promise",void 0),E([k()],W3.prototype,"_result",void 0),W3=E([ht("esri.core.asyncUtils.ReactiveTask")],W3);async function dL(t,e){return await t.load(),PVe(t,e)}async function PVe(t,e){const i=[],r=(...s)=>{for(const o of s)lt(o)||(Array.isArray(o)?r(...o):fr.isCollection(o)?o.forEach(a=>r(a)):hd.isLoadable(o)&&i.push(o))};e(r);let n=null;if(await g6t(i,async s=>{const o=await TC(_6t(s)?s.loadAll():s.load());o.ok!==!1||n||(n=o)}),n)throw n.error;return t}function _6t(t){return"loadAll"in t&&typeof t.loadAll=="function"}const b6t=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,w6t={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 K_e(t){const e=t?.match(b6t);if(!e)return null;const[,i,r,n]=e;if(!i)return null;let s=null,o=null,a=null;const{devext:l,qaext:c,www:d}=w6t;if(r)if(s=i,n)switch(n.toLowerCase()){case"devext":({customBaseUrl:o,portalHostname:a}=l);break;case"qa":({customBaseUrl:o,portalHostname:a}=c);break;default:return null}else({customBaseUrl:o,portalHostname:a}=d);else switch(i.toLowerCase()){case"devext":({customBaseUrl:o,portalHostname:a}=l);break;case"qaext":({customBaseUrl:o,portalHostname:a}=c);break;case"www":({customBaseUrl:o,portalHostname:a}=d);break;default:return null}return{customBaseUrl:o,isPortal:!1,portalHostname:a,urlKey:s}}function OVe(t){return/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(t)}const x6t=Ei.getLogger("esri.core.urlUtils"),G8=na.request,RVe="esri/config: esriConfig.request.proxyUrl is not set.",MVe=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,DVe=/^\s*http:/i,S6t=/^\s*https:/i,C6t=/^\s*file:/i,T6t=/:\d+$/,E6t=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,I6t=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),A6t=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");let Ug=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 i=this.uri.match(I6t);this.scheme=i[2]||(i[1]?"":null),this.authority=i[4]||(i[3]?"":null),this.path=i[5],this.query=i[7]||(i[6]?"":null),this.fragment=i[9]||(i[8]?"":null),this.authority!=null&&(i=this.authority.match(A6t),this.user=i[3]||null,this.password=i[4]||null,this.host=i[6]||i[7],this.port=i[9]||null)}toString(){return this.uri}};const ene={};let By=new Ug(na.applicationUrl),J_e=P6t();const Z_e=()=>By,FVe=()=>J_e;function P6t(){const t=By.path,e=t.substring(0,t.lastIndexOf(t.split("/")[t.split("/").length-1]));return`${`${By.scheme}://${By.host}${By.port!=null?`:${By.port}`:""}`}${e}`}function sa(t){if(!t)return null;const e={path:null,query:null},i=new Ug(t),r=t.indexOf("?");return i.query===null?e.path=t:(e.path=t.substring(0,r),e.query=q3(i.query)),i.fragment&&(e.hash=i.fragment,i.query===null&&(e.path=e.path.substring(0,e.path.length-(i.fragment.length+1)))),e}function q3(t){const e=t.split("&"),i={};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=i[s];typeof a=="string"&&(a=i[s]=[a]),Array.isArray(a)?a.push(o):i[s]=o}return i}function LVe(t){return t&&typeof t=="object"&&"toJSON"in t&&typeof t.toJSON=="function"}function Uv(t,e){return t?e&&typeof e=="function"?Object.keys(t).map(i=>encodeURIComponent(i)+"="+encodeURIComponent(e(i,t[i]))).join("&"):Object.keys(t).map(i=>{const r=t[i];if(r==null)return"";const n=encodeURIComponent(i)+"=",s=e&&e[i];return s?n+encodeURIComponent(s(r)):Array.isArray(r)?r.map(o=>LVe(o)?n+encodeURIComponent(JSON.stringify(o)):n+encodeURIComponent(o)).join("&"):LVe(r)?n+encodeURIComponent(JSON.stringify(r)):n+encodeURIComponent(r)}).filter(i=>i).join("&"):""}function O6t(t=!1){let e,i=G8.proxyUrl;if(typeof t=="string"){e=GVe(t);const r=BH(t);r&&(i=r.proxyUrl)}else e=!!t;if(!i)throw x6t.warn(RVe),new st("urlutils:proxy-not-set",RVe);return e&&s1e()&&(i=GH(i)),sa(i)}function kVe(t){const e=BH(t);let i,r;if(e){const n=Q_e(e.proxyUrl);i=n.path,r=n.query?q3(n.query):null}if(i){const n=sa(t);t=i+"?"+n.path;const s=Uv({...r,...n.query});s&&(t=`${t}?${s}`)}return t}const $H={path:"",query:""};function Q_e(t){const e=t.indexOf("?");return e!==-1?($H.path=t.slice(0,e),$H.query=t.slice(e+1)):($H.path=t,$H.query=null),$H}function NVe(t){return t=(t=rne(t=j6t(t=Q_e(t).path),!0)).toLowerCase()}function R6t(t){const e={proxyUrl:t.proxyUrl,urlPrefix:NVe(t.urlPrefix)},i=G8.proxyRules,r=e.urlPrefix;let n=i.length;for(let s=0;s0?t.substring(0,e):t.replace(/\/+$/,"")}function $Ve(t){const e=r=>r==null||r instanceof RegExp&&r.test(t)||typeof r=="string"&&t.startsWith(r),i=G8.interceptors;if(i){for(const r of i)if(Array.isArray(r.urls)){if(r.urls.some(e))return r}else if(e(r.urls))return r}return null}function Gy(t,e,i=!1){if(!t||!e)return!1;const r=a1e(t),n=a1e(e);return!(!i&&r.scheme!==n.scheme)&&r.host!=null&&n.host!=null&&r.host.toLowerCase()===n.host.toLowerCase()&&r.port===n.port}function t1e(t){if(typeof t=="string"){if(!jg(t))return!0;t=a1e(t)}if(Gy(t,By))return!0;const e=G8.trustedServers||[];for(let i=0;i(v=p.indexOf(y,v))===-1?p.length:v;let l=a(n,"/",n.indexOf("//")+2),c=-1;for(;n.slice(0,l+1)===s.slice(0,l)+"/"&&(c=l+1,l!==n.length);)l=a(n,"/",l+1);if(c===-1||o&&c0)for(let p=0;ps?n.concat(s.split("/")):n,[]);for(let n=0;n0&&i[i.length-1]!==".."?i.pop():(!s&&n===r.length-1||s&&(s!=="."||i.length===0))&&i.push(s)}return i.join("/")}function zb(t,e=!1){if(t==null||IC(t)||E1(t))return null;let i=t.indexOf("://");if(i===-1&&I1(t))i=2;else{if(i===-1)return null;i+=3}const r=t.indexOf("/",i);return r!==-1&&(t=t.slice(0,r)),e&&(t=rne(t,!0)),t}function jg(t){return I1(t)||n1e(t)}function IC(t){return t!=null&&t.slice(0,5)==="blob:"}function E1(t){return t!=null&&t.slice(0,5)==="data:"}function i1e(t){const e=Y3(t);if(!e||!e.isBase64)return null;const i=atob(e.data),r=new Uint8Array(i.length);for(let n=0;n1&&t[0]==="/"&&t[1]==="/"&&(t=t.slice(2)),t)}function U6t(t){const e=t.indexOf("//"),i=t.indexOf("/",e+2);return i===-1?t:t.slice(0,i)}function VH(t){let e=0;if(jg(t)){const r=t.indexOf("//");r!==-1&&(e=r+2)}const i=t.lastIndexOf("/");return ir===n||r.endsWith(`.${n}`))||s1e()&&!BH(t))&&(t=GH(t)),t}function o1e(t,e,i){if(!(e&&i&&t&&jg(t)))return t;const r=t.indexOf("//"),n=t.indexOf("/",r+2),s=t.indexOf(":",r+2),o=Math.min(n<0?t.length:n,s<0?t.length:s);return t.slice(r+2,o).toLowerCase()!==e.toLowerCase()?t:`${t.slice(0,r+2)}${i}${t.slice(o)}`}function a1e(t){return typeof t=="string"?new Ug(Vy(t)):(t.scheme||(t.scheme=By.scheme),t)}function q6t(t){return Y6t.test(t)}function VVe(t,e){const i=sa(t),r=Object.keys(i.query||{});return r.length>0&&e&&e.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${r.join(", ")}.`),i.path}function UVe(t,e,i){const r=sa(t),n=r.query||{};return n[e]=String(i),`${r.path}?${Uv(n)}`}function jy(t,e){const i=sa(t),r=i.query||{};for(const s in e)r[s]=e[s];const n=Uv(r);return n?`${i.path}?${n}`:i.path}function l1e(t){if(lt(t))return null;const e=t.match(zVe);return e?e[2]:null}function jVe(t){if(lt(t))return null;const e=t.match(zVe);return e?{path:e[1],extension:e[2]}:{path:t,extension:null}}const zVe=/([^.]*)\.([^\/]*)$/,Y6t=/(^data:image\/svg|\.svg$)/i;function mr(t,e,i){let r,n;return e===void 0?(n=t,r=[void 0]):typeof e!="string"?(n=t,r=[void 0],i=e):(n=e,r=Array.isArray(t)?t:[t]),(s,o)=>{const a=s.constructor.prototype;for(const l of r){const c=D_e(s,l,n);c.write&&typeof c.write=="object"||(c.write={}),i&&(c.write.target=i),c.write.writer=a[o]}}}let Bs=class{constructor(e,i={ignoreUnknown:!1,useNumericKeys:!1}){this._jsonToAPI=e,this._options=i,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&&Ep(s,o,n)},this.write.isJSONMapWriter=!0}toJSON(e){if(e==null)return null;if(this._apiToJSON.hasOwnProperty(e)){const i=this._apiToJSON[e];return this._options.useNumericKeys?+i:i}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 i={};for(const r in e)i[e[r]]=r;return i}_getKeysSorted(e){const i=[];for(const r in e)i.push(r);return i.sort(),i}};function jo(){return function(t,e){return new Bs(t,{ignoreUnknown:!0,...e})}}let u1e=class{constructor(e,i,r,n){this.semiMajorAxis=e,this.flattening=i,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 wu=new u1e(6378137,1/298.257223563,3e5,.006694379990137799),iA=new u1e(3396190,1/169.8944472236118,23e4),X3=new u1e(1737400,0,0);var Hb;(function(t){t[t.CGCS2000=4490]="CGCS2000",t[t.GCSMARS2000=104971]="GCSMARS2000",t[t.GCSMARS2000_SPHERE=104905]="GCSMARS2000_SPHERE",t[t.GCSMOON2000=104903]="GCSMOON2000"})(Hb||(Hb={}));let de;const ri={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,5167:0,5168: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,9943:0,9945:0,9947:0,9967:0,9972:0,9977: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};for(de=2e3;de<=2045;de++)ri[de]=0;for(de=2056;de<=2065;de++)ri[de]=0;for(de=2067;de<=2135;de++)ri[de]=0;for(de=2137;de<=2154;de++)ri[de]=0;for(de=2161;de<=2170;de++)ri[de]=0;for(de=2172;de<=2193;de++)ri[de]=0;for(de=2195;de<=2198;de++)ri[de]=0;for(de=2200;de<=2203;de++)ri[de]=0;for(de=2205;de<=2217;de++)ri[de]=0;for(de=2222;de<=2224;de++)ri[de]=1;for(de=2225;de<=2250;de++)ri[de]=2;for(de=2251;de<=2253;de++)ri[de]=1;for(de=2257;de<=2264;de++)ri[de]=2;for(de=2274;de<=2279;de++)ri[de]=2;for(de=2280;de<=2282;de++)ri[de]=1;for(de=2283;de<=2289;de++)ri[de]=2;for(de=2290;de<=2292;de++)ri[de]=0;for(de=2308;de<=2313;de++)ri[de]=0;for(de=2315;de<=2491;de++)ri[de]=0;for(de=2494;de<=2866;de++)ri[de]=0;for(de=2867;de<=2869;de++)ri[de]=1;for(de=2870;de<=2888;de++)ri[de]=2;for(de=2891;de<=2895;de++)ri[de]=2;for(de=2896;de<=2898;de++)ri[de]=1;for(de=2902;de<=2908;de++)ri[de]=2;for(de=2915;de<=2920;de++)ri[de]=2;for(de=2921;de<=2923;de++)ri[de]=1;for(de=2924;de<=2930;de++)ri[de]=2;for(de=2931;de<=2962;de++)ri[de]=0;for(de=2964;de<=2968;de++)ri[de]=2;for(de=2969;de<=2973;de++)ri[de]=0;for(de=2975;de<=2991;de++)ri[de]=0;for(de=2995;de<=3051;de++)ri[de]=0;for(de=3054;de<=3079;de++)ri[de]=0;for(de=3081;de<=3088;de++)ri[de]=0;for(de=3092;de<=3101;de++)ri[de]=0;for(de=3106;de<=3138;de++)ri[de]=0;for(de=3146;de<=3151;de++)ri[de]=0;for(de=3153;de<=3166;de++)ri[de]=0;for(de=3168;de<=3172;de++)ri[de]=0;for(de=3174;de<=3203;de++)ri[de]=0;for(de=3294;de<=3358;de++)ri[de]=0;for(de=3367;de<=3403;de++)ri[de]=0;for(de=3408;de<=3416;de++)ri[de]=0;for(de=3417;de<=3438;de++)ri[de]=2;for(de=3441;de<=3446;de++)ri[de]=2;for(de=3447;de<=3450;de++)ri[de]=0;for(de=3451;de<=3459;de++)ri[de]=2;for(de=3460;de<=3478;de++)ri[de]=0;for(de=3554;de<=3559;de++)ri[de]=0;for(de=3560;de<=3570;de++)ri[de]=2;for(de=3571;de<=3581;de++)ri[de]=0;for(de=3594;de<=3597;de++)ri[de]=0;for(de=3601;de<=3604;de++)ri[de]=0;for(de=3637;de<=3639;de++)ri[de]=0;for(de=3665;de<=3667;de++)ri[de]=0;for(de=3693;de<=3695;de++)ri[de]=0;for(de=3701;de<=3727;de++)ri[de]=0;for(de=3728;de<=3739;de++)ri[de]=2;for(de=3740;de<=3751;de++)ri[de]=0;for(de=3753;de<=3760;de++)ri[de]=2;for(de=3761;de<=3773;de++)ri[de]=0;for(de=3775;de<=3777;de++)ri[de]=0;for(de=3779;de<=3781;de++)ri[de]=0;for(de=3783;de<=3785;de++)ri[de]=0;for(de=3788;de<=3791;de++)ri[de]=0;for(de=3797;de<=3802;de++)ri[de]=0;for(de=3814;de<=3816;de++)ri[de]=0;for(de=3825;de<=3829;de++)ri[de]=0;for(de=3832;de<=3841;de++)ri[de]=0;for(de=3844;de<=3852;de++)ri[de]=0;for(de=3873;de<=3885;de++)ri[de]=0;for(de=3890;de<=3893;de++)ri[de]=0;for(de=3907;de<=3912;de++)ri[de]=0;for(de=3942;de<=3950;de++)ri[de]=0;for(de=3968;de<=3970;de++)ri[de]=0;for(de=3973;de<=3976;de++)ri[de]=0;for(de=3986;de<=3989;de++)ri[de]=0;for(de=3994;de<=3997;de++)ri[de]=0;for(de=4048;de<=4051;de++)ri[de]=0;for(de=4056;de<=4063;de++)ri[de]=0;for(de=4093;de<=4096;de++)ri[de]=0;for(de=4390;de<=4398;de++)ri[de]=0;for(de=4399;de<=4413;de++)ri[de]=2;for(de=4418;de<=4433;de++)ri[de]=2;for(de=4455;de<=4457;de++)ri[de]=2;for(de=4484;de<=4489;de++)ri[de]=0;for(de=4491;de<=4554;de++)ri[de]=0;for(de=4568;de<=4589;de++)ri[de]=0;for(de=4652;de<=4656;de++)ri[de]=0;for(de=4766;de<=4800;de++)ri[de]=0;for(de=5014;de<=5016;de++)ri[de]=0;for(de=5069;de<=5072;de++)ri[de]=0;for(de=5105;de<=5130;de++)ri[de]=0;for(de=5173;de<=5188;de++)ri[de]=0;for(de=5253;de<=5259;de++)ri[de]=0;for(de=5269;de<=5275;de++)ri[de]=0;for(de=5292;de<=5311;de++)ri[de]=0;for(de=5329;de<=5331;de++)ri[de]=0;for(de=5343;de<=5349;de++)ri[de]=0;for(de=5355;de<=5357;de++)ri[de]=0;for(de=5387;de<=5389;de++)ri[de]=0;for(de=5459;de<=5463;de++)ri[de]=0;for(de=5479;de<=5482;de++)ri[de]=0;for(de=5518;de<=5520;de++)ri[de]=0;for(de=5530;de<=5539;de++)ri[de]=0;for(de=5550;de<=5552;de++)ri[de]=0;for(de=5562;de<=5583;de++)ri[de]=0;for(de=5623;de<=5625;de++)ri[de]=2;for(de=5631;de<=5639;de++)ri[de]=0;for(de=5649;de<=5653;de++)ri[de]=0;for(de=5663;de<=5680;de++)ri[de]=0;for(de=5682;de<=5685;de++)ri[de]=0;for(de=5875;de<=5877;de++)ri[de]=0;for(de=5896;de<=5899;de++)ri[de]=0;for(de=5921;de<=5940;de++)ri[de]=0;for(de=6050;de<=6125;de++)ri[de]=0;for(de=6244;de<=6275;de++)ri[de]=0;for(de=6328;de<=6348;de++)ri[de]=0;for(de=6350;de<=6356;de++)ri[de]=0;for(de=6366;de<=6372;de++)ri[de]=0;for(de=6381;de<=6387;de++)ri[de]=0;for(de=6393;de<=6404;de++)ri[de]=0;for(de=6480;de<=6483;de++)ri[de]=0;for(de=6511;de<=6514;de++)ri[de]=0;for(de=6579;de<=6581;de++)ri[de]=0;for(de=6619;de<=6624;de++)ri[de]=0;for(de=6625;de<=6627;de++)ri[de]=2;for(de=6628;de<=6632;de++)ri[de]=0;for(de=6634;de<=6637;de++)ri[de]=0;for(de=6669;de<=6692;de++)ri[de]=0;for(de=6707;de<=6709;de++)ri[de]=0;for(de=6720;de<=6723;de++)ri[de]=0;for(de=6732;de<=6738;de++)ri[de]=0;for(de=6931;de<=6933;de++)ri[de]=0;for(de=6956;de<=6959;de++)ri[de]=0;for(de=7005;de<=7007;de++)ri[de]=0;for(de=7057;de<=7070;de++)ri[de]=2;for(de=7074;de<=7082;de++)ri[de]=0;for(de=7109;de<=7118;de++)ri[de]=0;for(de=7119;de<=7127;de++)ri[de]=1;for(de=7374;de<=7376;de++)ri[de]=0;for(de=7528;de<=7586;de++)ri[de]=0;for(de=7587;de<=7645;de++)ri[de]=2;for(de=7692;de<=7696;de++)ri[de]=0;for(de=7755;de<=7787;de++)ri[de]=0;for(de=7791;de<=7795;de++)ri[de]=0;for(de=7799;de<=7801;de++)ri[de]=0;for(de=7803;de<=7805;de++)ri[de]=0;for(de=7825;de<=7831;de++)ri[de]=0;for(de=7845;de<=7859;de++)ri[de]=0;for(de=8013;de<=8032;de++)ri[de]=0;for(de=8065;de<=8068;de++)ri[de]=1;for(de=8518;de<=8529;de++)ri[de]=2;for(de=8533;de<=8536;de++)ri[de]=2;for(de=8538;de<=8540;de++)ri[de]=2;for(de=8677;de<=8679;de++)ri[de]=0;for(de=8836;de<=8840;de++)ri[de]=0;for(de=8857;de<=8859;de++)ri[de]=0;for(de=8908;de<=8910;de++)ri[de]=0;for(de=9154;de<=9159;de++)ri[de]=0;for(de=9205;de<=9218;de++)ri[de]=0;for(de=9271;de<=9273;de++)ri[de]=0;for(de=9295;de<=9297;de++)ri[de]=0;for(de=9356;de<=9360;de++)ri[de]=0;for(de=9404;de<=9407;de++)ri[de]=0;for(de=9476;de<=9482;de++)ri[de]=0;for(de=9487;de<=9494;de++)ri[de]=0;for(de=9697;de<=9699;de++)ri[de]=0;for(de=9821;de<=9865;de++)ri[de]=0;for(de=20002;de<=20032;de++)ri[de]=0;for(de=20047;de<=20049;de++)ri[de]=0;for(de=20062;de<=20092;de++)ri[de]=0;for(de=20135;de<=20138;de++)ri[de]=0;for(de=20248;de<=20258;de++)ri[de]=0;for(de=20348;de<=20358;de++)ri[de]=0;for(de=20436;de<=20440;de++)ri[de]=0;for(de=20822;de<=20824;de++)ri[de]=0;for(de=20904;de<=20932;de++)ri[de]=0;for(de=20934;de<=20936;de++)ri[de]=0;for(de=21004;de<=21032;de++)ri[de]=0;for(de=21035;de<=21037;de++)ri[de]=0;for(de=21095;de<=21097;de++)ri[de]=0;for(de=21148;de<=21150;de++)ri[de]=0;for(de=21207;de<=21264;de++)ri[de]=0;for(de=21307;de<=21364;de++)ri[de]=0;for(de=21413;de<=21423;de++)ri[de]=0;for(de=21453;de<=21463;de++)ri[de]=0;for(de=21473;de<=21483;de++)ri[de]=0;for(de=21780;de<=21782;de++)ri[de]=0;for(de=21891;de<=21894;de++)ri[de]=0;for(de=21896;de<=21899;de++)ri[de]=0;for(de=22171;de<=22177;de++)ri[de]=0;for(de=22181;de<=22187;de++)ri[de]=0;for(de=22191;de<=22197;de++)ri[de]=0;for(de=22207;de<=22222;de++)ri[de]=0;for(de=22234;de<=22236;de++)ri[de]=0;for(de=22243;de<=22250;de++)ri[de]=0;for(de=22262;de<=22265;de++)ri[de]=0;for(de=22307;de<=22322;de++)ri[de]=0;for(de=22348;de<=22357;de++)ri[de]=0;for(de=22407;de<=22422;de++)ri[de]=0;for(de=22462;de<=22465;de++)ri[de]=0;for(de=22521;de<=22525;de++)ri[de]=0;for(de=22607;de<=22622;de++)ri[de]=0;for(de=22641;de<=22646;de++)ri[de]=0;for(de=22648;de<=22657;de++)ri[de]=0;for(de=22707;de<=22722;de++)ri[de]=0;for(de=22762;de<=22765;de++)ri[de]=0;for(de=22991;de<=22994;de++)ri[de]=0;for(de=23028;de<=23038;de++)ri[de]=0;for(de=23830;de<=23853;de++)ri[de]=0;for(de=23866;de<=23872;de++)ri[de]=0;for(de=23877;de<=23884;de++)ri[de]=0;for(de=23886;de<=23894;de++)ri[de]=0;for(de=23946;de<=23948;de++)ri[de]=0;for(de=24311;de<=24313;de++)ri[de]=0;for(de=24342;de<=24347;de++)ri[de]=0;for(de=24370;de<=24374;de++)ri[de]=10;for(de=24375;de<=24381;de++)ri[de]=0;for(de=24718;de<=24721;de++)ri[de]=0;for(de=24817;de<=24821;de++)ri[de]=0;for(de=24877;de<=24882;de++)ri[de]=0;for(de=24891;de<=24893;de++)ri[de]=0;for(de=25391;de<=25395;de++)ri[de]=0;for(de=25828;de<=25838;de++)ri[de]=0;for(de=26191;de<=26195;de++)ri[de]=0;for(de=26391;de<=26393;de++)ri[de]=0;for(de=26701;de<=26722;de++)ri[de]=0;for(de=26729;de<=26799;de++)ri[de]=2;for(de=26801;de<=26803;de++)ri[de]=2;for(de=26811;de<=26813;de++)ri[de]=2;for(de=26847;de<=26870;de++)ri[de]=2;for(de=26891;de<=26899;de++)ri[de]=0;for(de=26901;de<=26923;de++)ri[de]=0;for(de=26929;de<=26946;de++)ri[de]=0;for(de=26948;de<=26998;de++)ri[de]=0;for(de=27037;de<=27040;de++)ri[de]=0;for(de=27205;de<=27232;de++)ri[de]=0;for(de=27258;de<=27260;de++)ri[de]=0;for(de=27391;de<=27398;de++)ri[de]=0;for(de=27561;de<=27564;de++)ri[de]=0;for(de=27571;de<=27574;de++)ri[de]=0;for(de=27581;de<=27584;de++)ri[de]=0;for(de=27591;de<=27594;de++)ri[de]=0;for(de=28191;de<=28193;de++)ri[de]=0;for(de=28348;de<=28358;de++)ri[de]=0;for(de=28402;de<=28432;de++)ri[de]=0;for(de=28462;de<=28492;de++)ri[de]=0;for(de=29118;de<=29122;de++)ri[de]=0;for(de=29168;de<=29172;de++)ri[de]=0;for(de=29177;de<=29185;de++)ri[de]=0;for(de=29187;de<=29195;de++)ri[de]=0;for(de=29900;de<=29903;de++)ri[de]=0;for(de=30161;de<=30179;de++)ri[de]=0;for(de=30491;de<=30494;de++)ri[de]=0;for(de=30729;de<=30732;de++)ri[de]=0;for(de=31251;de<=31259;de++)ri[de]=0;for(de=31265;de<=31268;de++)ri[de]=0;for(de=31275;de<=31279;de++)ri[de]=0;for(de=31281;de<=31297;de++)ri[de]=0;for(de=31461;de<=31469;de++)ri[de]=0;for(de=31491;de<=31495;de++)ri[de]=0;for(de=31917;de<=31922;de++)ri[de]=0;for(de=31965;de<=32e3;de++)ri[de]=0;for(de=32001;de<=32003;de++)ri[de]=2;for(de=32005;de<=32031;de++)ri[de]=2;for(de=32033;de<=32060;de++)ri[de]=2;for(de=32064;de<=32067;de++)ri[de]=2;for(de=32074;de<=32077;de++)ri[de]=2;for(de=32081;de<=32086;de++)ri[de]=0;for(de=32107;de<=32130;de++)ri[de]=0;for(de=32133;de<=32159;de++)ri[de]=0;for(de=32164;de<=32167;de++)ri[de]=2;for(de=32180;de<=32199;de++)ri[de]=0;for(de=32201;de<=32260;de++)ri[de]=0;for(de=32301;de<=32360;de++)ri[de]=0;for(de=32601;de<=32662;de++)ri[de]=0;for(de=32664;de<=32667;de++)ri[de]=2;for(de=32701;de<=32761;de++)ri[de]=0;for(de=53001;de<=53004;de++)ri[de]=0;for(de=53008;de<=53019;de++)ri[de]=0;for(de=53021;de<=53032;de++)ri[de]=0;for(de=53034;de<=53037;de++)ri[de]=0;for(de=53042;de<=53046;de++)ri[de]=0;for(de=53074;de<=53080;de++)ri[de]=0;for(de=54001;de<=54004;de++)ri[de]=0;for(de=54008;de<=54019;de++)ri[de]=0;for(de=54021;de<=54032;de++)ri[de]=0;for(de=54034;de<=54037;de++)ri[de]=0;for(de=54042;de<=54046;de++)ri[de]=0;for(de=54048;de<=54053;de++)ri[de]=0;for(de=54074;de<=54080;de++)ri[de]=0;for(de=54098;de<=54101;de++)ri[de]=0;for(de=102001;de<=102040;de++)ri[de]=0;for(de=102042;de<=102063;de++)ri[de]=0;for(de=102065;de<=102067;de++)ri[de]=0;for(de=102070;de<=102117;de++)ri[de]=0;for(de=102122;de<=102216;de++)ri[de]=0;for(de=102221;de<=102377;de++)ri[de]=0;for(de=102382;de<=102388;de++)ri[de]=0;for(de=102389;de<=102398;de++)ri[de]=2;for(de=102399;de<=102444;de++)ri[de]=0;for(de=102445;de<=102447;de++)ri[de]=2;for(de=102448;de<=102458;de++)ri[de]=0;for(de=102459;de<=102468;de++)ri[de]=2;for(de=102469;de<=102499;de++)ri[de]=0;for(de=102500;de<=102519;de++)ri[de]=1;for(de=102520;de<=102524;de++)ri[de]=0;for(de=102525;de<=102529;de++)ri[de]=2;for(de=102530;de<=102588;de++)ri[de]=0;for(de=102590;de<=102598;de++)ri[de]=0;for(de=102601;de<=102603;de++)ri[de]=0;for(de=102605;de<=102628;de++)ri[de]=0;for(de=102629;de<=102646;de++)ri[de]=2;for(de=102648;de<=102700;de++)ri[de]=2;for(de=102701;de<=102703;de++)ri[de]=0;for(de=102707;de<=102730;de++)ri[de]=2;for(de=102733;de<=102758;de++)ri[de]=2;for(de=102767;de<=102900;de++)ri[de]=0;for(de=102901;de<=102933;de++)ri[de]=2;for(de=102934;de<=102950;de++)ri[de]=13;for(de=102951;de<=102955;de++)ri[de]=0;for(de=102961;de<=102963;de++)ri[de]=0;for(de=102965;de<=102969;de++)ri[de]=0;for(de=102971;de<=102973;de++)ri[de]=0;for(de=102975;de<=102989;de++)ri[de]=0;for(de=102990;de<=102992;de++)ri[de]=1;for(de=102997;de<=103002;de++)ri[de]=0;for(de=103003;de<=103008;de++)ri[de]=2;for(de=103009;de<=103011;de++)ri[de]=0;for(de=103012;de<=103014;de++)ri[de]=2;for(de=103019;de<=103021;de++)ri[de]=0;for(de=103022;de<=103024;de++)ri[de]=2;for(de=103029;de<=103031;de++)ri[de]=0;for(de=103032;de<=103034;de++)ri[de]=2;for(de=103065;de<=103068;de++)ri[de]=0;for(de=103074;de<=103076;de++)ri[de]=0;for(de=103077;de<=103079;de++)ri[de]=1;for(de=103080;de<=103082;de++)ri[de]=0;for(de=103083;de<=103085;de++)ri[de]=2;for(de=103090;de<=103093;de++)ri[de]=0;for(de=103097;de<=103099;de++)ri[de]=0;for(de=103100;de<=103102;de++)ri[de]=2;for(de=103107;de<=103109;de++)ri[de]=0;for(de=103110;de<=103112;de++)ri[de]=2;for(de=103113;de<=103116;de++)ri[de]=0;for(de=103117;de<=103120;de++)ri[de]=2;for(de=103153;de<=103157;de++)ri[de]=0;for(de=103158;de<=103162;de++)ri[de]=2;for(de=103163;de<=103165;de++)ri[de]=0;for(de=103166;de<=103168;de++)ri[de]=1;for(de=103169;de<=103171;de++)ri[de]=2;for(de=103186;de<=103188;de++)ri[de]=0;for(de=103189;de<=103191;de++)ri[de]=2;for(de=103192;de<=103195;de++)ri[de]=0;for(de=103196;de<=103199;de++)ri[de]=2;for(de=103200;de<=103224;de++)ri[de]=0;for(de=103225;de<=103227;de++)ri[de]=1;for(de=103232;de<=103237;de++)ri[de]=0;for(de=103238;de<=103243;de++)ri[de]=2;for(de=103244;de<=103246;de++)ri[de]=0;for(de=103247;de<=103249;de++)ri[de]=2;for(de=103254;de<=103256;de++)ri[de]=0;for(de=103257;de<=103259;de++)ri[de]=2;for(de=103264;de<=103266;de++)ri[de]=0;for(de=103267;de<=103269;de++)ri[de]=2;for(de=103300;de<=103375;de++)ri[de]=0;for(de=103381;de<=103383;de++)ri[de]=0;for(de=103384;de<=103386;de++)ri[de]=1;for(de=103387;de<=103389;de++)ri[de]=0;for(de=103390;de<=103392;de++)ri[de]=2;for(de=103397;de<=103399;de++)ri[de]=0;for(de=103400;de<=103471;de++)ri[de]=2;for(de=103476;de<=103478;de++)ri[de]=0;for(de=103479;de<=103481;de++)ri[de]=2;for(de=103486;de<=103488;de++)ri[de]=0;for(de=103489;de<=103491;de++)ri[de]=2;for(de=103492;de<=103495;de++)ri[de]=0;for(de=103496;de<=103499;de++)ri[de]=2;for(de=103528;de<=103543;de++)ri[de]=0;for(de=103544;de<=103548;de++)ri[de]=2;for(de=103549;de<=103551;de++)ri[de]=0;for(de=103552;de<=103554;de++)ri[de]=1;for(de=103555;de<=103557;de++)ri[de]=2;for(de=103558;de<=103560;de++)ri[de]=0;for(de=103571;de<=103573;de++)ri[de]=0;for(de=103574;de<=103576;de++)ri[de]=2;for(de=103577;de<=103580;de++)ri[de]=0;for(de=103581;de<=103583;de++)ri[de]=2;for(de=103595;de<=103694;de++)ri[de]=0;for(de=103696;de<=103699;de++)ri[de]=0;for(de=103700;de<=103793;de++)ri[de]=2;for(de=103794;de<=103890;de++)ri[de]=0;for(de=103891;de<=103896;de++)ri[de]=2;for(de=103900;de<=103971;de++)ri[de]=2;for(de=103972;de<=103977;de++)ri[de]=0;for(de=112e3;de<=112101;de++)ri[de]=0;const X6t={102113:!0,102100:!0,3857:!0,3785:!0},K6t={4326:!0,3785:!0,3857:!0,102113:!0,102100:!0,104905:!0,104971:!0},HVe='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]]',sne=[-20037508342788905e-9,20037508342788905e-9],one=[-20037508342787e-6,20037508342787e-6],WVe={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:sne,origin:one,dx:1e-5},102100:{wkTemplate:HVe,valid:sne,origin:one,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:sne,origin:one,dx:1e-5},3857:{wkTemplate:HVe,valid:sne,origin:one,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 Ca(t,e){return t===e||!lt(t)&&!lt(e)&&(t.wkid!=null||e.wkid!=null?t.wkid===e.wkid||Wb(t)&&Wb(e)||e.latestWkid!=null&&t.wkid===e.latestWkid||t.latestWkid!=null&&e.wkid===t.latestWkid:!(!t.wkt||!e.wkt)&&t.wkt.toUpperCase()===e.wkt.toUpperCase())}function pd(t){return gh(t)&&t.wkid&&WVe[t.wkid]||null}function ane(t){return!!gh(t)&&(t.wkid?ri[t.wkid]==null:!!t.wkt&&!!/^\s*GEOGCS/i.test(t.wkt))}function J6t(t){return!(fL(t)||mL(t))}function V8(t){return gh(t)&&t.wkid===4326}function Z6t(t){return gh(t)&&t.wkid===Hb.CGCS2000}function Wb(t){return gh(t)&&t.wkid!=null&&X6t[t.wkid]===!0}function Q6t(t){return gh(t)&&t.wkid===32662}function c1e(t){return t===Hb.GCSMARS2000||t===Hb.GCSMARS2000_SPHERE}function fL(t){return gh(t)&&t.wkid!=null&&c1e(t.wkid)}function h1e(t){return t===Hb.GCSMOON2000}function mL(t){return gh(t)&&t.wkid!=null&&h1e(t.wkid)}function qVe(t){return gh(t)&&t.wkid!=null&&K6t[t.wkid]===!0}function gh(t){return ye(t)&&(t.wkid!=null&&t.wkid>=2e3||t.wkt!=null)}const Df={wkid:4326,wkt:Kx(WVe[4326].wkTemplate,{Central_Meridian:"0.0"})},e$t={wkid:102100,latestWkid:3857},t$t={wkid:32662};function d1e(t){return{wkt:`GEOCCS["Spherical geocentric", + 🔗 See ${s} for more details.`),wkt(t,a,o)}}function Mre(t){return t&&(typeof t.on=="function"||typeof t.addEventListener=="function")}function ZI(t,e,i){if(!Mre(t))throw new TypeError("target is not a Evented or EventTarget object");if("on"in t)return t.on(e,i);if(Array.isArray(e)){const r=e.slice();for(const n of r)t.addEventListener(n,i);return{remove(){for(const n of r)t.removeEventListener(n,i)}}}return t.addEventListener(e,i),{remove(){t.removeEventListener(e,i)}}}function UVe(t,e,i){if(!Mre(t))throw new TypeError("target is not a Evented or EventTarget object");if("once"in t)return t.once(e,i);const r=ZI(t,e,n=>{r.remove(),i.call(t,n)});return{remove(){r.remove()}}}const xkt={Win:"Meta",Scroll:"ScrollLock",Spacebar:" ",Down:"ArrowDown",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Del:"Delete",Apps:"ContextMenu",Esc:"Escape",Multiply:"*",Add:"+",Subtract:"-",Decimal:".",Divide:"/"};function cL({key:t}){return xkt[t]||t}function Sc(t="Aborted"){return new st("AbortError",t)}function yn(t,e="Aborted"){if(Im(t))throw Sc(e)}function Dre(t){return ve(t)?"aborted"in t?t:t.signal:t}function Im(t){const e=Dre(t);return ve(e)&&e.aborted}function Ya(t){if(ys(t))throw t}function _C(t){if(!ys(t))throw t}function ap(t,e){const i=Dre(t);if(!lt(i)){if(!i.aborted)return UVe(i,"abort",()=>e());e()}}function F8(t,e){const i=Dre(t);if(!lt(i))return yn(i),UVe(i,"abort",()=>e(Sc()))}function zg(t,e){const i=Dre(e);return lt(i)?t:new Promise((r,n)=>{let s=ap(e,()=>n(Sc()));const o=()=>s=Uc(s);t.then(o,o),t.then(r,n)})}function ys(t){return t?.name==="AbortError"}async function pf(t){try{return await t}catch(e){if(!ys(e))throw e;return}}function Kx(){let t=null;const e=new Promise((i,r)=>{t={promise:void 0,resolve:i,reject:r}});return t.promise=e,t}async function Ru(t){if(!t)return;if(typeof t.forEach!="function"){const i=Object.keys(t),r=i.map(o=>t[o]),n=await Ru(r),s={};return i.map((o,a)=>s[o]=n[a]),s}const e=t;return new Promise(i=>{const r=[];let n=e.length;n===0&&i(r),e.forEach(s=>{const o={promise:s||Promise.resolve(s)};r.push(o),o.promise.then(a=>{o.value=a}).catch(a=>{o.error=a}).then(()=>{--n,n===0&&i(r)})})})}async function AH(t){return(await Ru(t)).filter(e=>!!e.value).map(e=>e.value)}function B3(t,e,i){const r=new AbortController;return ap(i,()=>r.abort()),new Promise((n,s)=>{let o=setTimeout(()=>{o=0,n(e)},t);ap(r,()=>{o&&(clearTimeout(o),s(Sc()))})})}function Fp(t){return t&&typeof t.then=="function"}function A_e(t){return Fp(t)?t:Promise.resolve(t)}function q0(t,e=-1){let i,r,n,s,o=null;const a=(...l)=>{if(i){r=l,s&&s.reject(Sc()),s=Kx();const y=s.promise;if(o){const v=o;o=null,v.abort()}return y}if(n=s||Kx(),s=null,e>0){const y=new AbortController;i=A_e(t(...l,y.signal));const v=i;B3(e).then(()=>{i===v&&(s?y.abort():o=y)})}else i=1,i=A_e(t(...l));const c=()=>{const y=r;r=n=i=o=null,y!=null&&a(...y)},h=i,p=n;return h.then(c,c),h.then(p.resolve,p.reject),p.promise};return a}function kf(){let t,e;const i=new Promise((n,s)=>{t=n,e=s}),r=n=>{t(n)};return r.resolve=n=>t(n),r.reject=n=>e(n),r.timeout=(n,s)=>IH.setTimeout(()=>r.reject(s),n),r.promise=i,r}async function Fre(t){await Promise.resolve(),yn(t)}function VDr(t){return t}let Skt=class{constructor(e){this.phases=e,this.paused=!1,this.ticks=-1,this.removed=!1}},Ckt=class{constructor(e){this.callback=e,this.isActive=!0}remove(){this.isActive=!1}},P_e=0;const PH={time:0,deltaTime:0,elapsedFrameTime:0,frameDuration:0},O_e=["prepare","preRender","render","postRender","update","finish"],R_e=[],hL=new Em;let Tkt=class{constructor(e){this._task=e}remove(){this._task.removed=!0}pause(){this._task.paused=!0}resume(){this._task.paused=!1}};const Lre={frameTasks:hL,willDispatch:!1,clearFrameTasks:Ekt,dispatch:WVe,executeFrameTasks:Ikt};function V3(t){const e=new Ckt(t);return R_e.push(e),Lre.willDispatch||(Lre.willDispatch=!0,D8(WVe)),e}function dL(t){const e=new Skt(t);return hL.push(e),Nre==null&&(P_e=performance.now(),Nre=requestAnimationFrame(zVe)),new Tkt(e)}let Nre=null;function Ekt(t=!1){hL.forAll(e=>{e.removed=!0}),t&&HVe()}function zVe(){const t=performance.now();Nre=null,Nre=hL.length>0?requestAnimationFrame(zVe):null,Lre.executeFrameTasks(t)}function Ikt(t){const e=t-P_e;P_e=t;const i=1e3/60,r=Math.max(0,e-i);PH.time=t,PH.frameDuration=i-r;for(let n=0;n{a.paused||a.removed||(n===0&&a.ticks++,a.phases[o]&&(PH.elapsedFrameTime=performance.now()-t,PH.deltaTime=a.ticks===0?0:e,a.phases[o]?.call(a,PH)))}),Pkt[n].record(performance.now()-s)}HVe(),Okt.record(performance.now()-t)}const kre=new Em;function HVe(){hL.forAll(t=>{t.removed&&kre.push(t)}),hL.removeUnorderedMany(kre.data,kre.length),kre.clear()}function WVe(){for(;R_e.length;){const t=R_e.shift();t.isActive&&t.callback()}Lre.willDispatch=!1}function Akt(t=1,e){const i=kf(),r=()=>{Im(e)?i.reject(Sc()):t===0?i():(--t,D8(()=>r()))};return r(),i.promise}const Pkt=O_e.map(t=>new EH(t)),Okt=new EH("total");function Rkt(t,e){for(const i of t.entries())if(e(i[0]))return!0;return!1}let Mkt=0;function j3(){return++Mkt}let $re=class{constructor(e){this._notify=e,this._accessed=[],this._handles=[],this._observerObject=new Dkt(this._notify),qVe.register(this,this._observerObject)}destroy(){this._accessed.length=0,this._observerObject?.destroy(),this.clear(),qVe.unregister(this)}onObservableAccessed(e){const i=this._accessed;i.includes(e)||i.push(e)}onTrackingEnd(){const e=this._handles,i=this._accessed,r=this._observerObject;for(let n=0;n0?e-1:0}destroy(){this.destroyed=!0,this._notify=Fkt}};const qVe=new FinalizationRegistry(t=>{t.destroy()});function Fkt(){}let L8=!1;const Bre=[];function YVe(t,e){let i=new $re(s),r=null,n=!1;function s(){if(!i||n)return;if(L8)return void JVe(s);const a=r;i.clear(),L8=!0,n=!0,r=JI(i,t),n=!1,L8=!1,e(r,a),ZVe()}function o(){i&&(i.destroy(),i=null,r=null)}return n=!0,r=JI(i,t),n=!1,{remove:o}}function XVe(t,e){let i=new $re(n),r=null;function n(){e(r,o)}function s(){i&&(i.destroy(),i=null),r=null}function o(){return i?(i.clear(),r=JI(i,t),r):null}return o(),{remove:s}}function KVe(t){let e=new $re(r),i=!1;function r(){e&&!i&&(L8?JVe(r):(e.clear(),L8=!0,i=!0,JI(e,t),i=!1,L8=!1,ZVe()))}function n(){e&&(e.destroy(),e=null)}return i=!0,JI(e,t),i=!1,{remove:n}}function JVe(t){Bre.includes(t)||Bre.unshift(t)}function ZVe(){for(;Bre.length;)Bre.pop()()}var OH;(function(t){t[t.Untracked=0]="Untracked",t[t.Tracked=1]="Tracked"})(OH||(OH={}));let RH=class{constructor(){this.uid=j3(),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,i,r,n,s){return this.pool.acquire(OH.Untracked,e,i,r,n,s,w_e)}static acquireTracked(e,i,r,n){return this.pool.acquire(OH.Tracked,e,i,r,null,null,n)}notify(e,i){this.type===OH.Untracked?this.callback.call(this.target,e,i,this.path,this.target):this.callback.call(null,e,i)}acquire(e,i,r,n,s,o,a){this.uid=j3(),this.removed=!1,this.type=e,this.oldValue=i,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=j3(),this.removed=!0}};RH.pool=new $Ve(RH);const Vre=new Gg,QI=new Set;let jre;function Gre(t){QI.delete(t),QI.add(t),jre||(jre=V3(kkt))}function Lkt(t){if(t.removed)return;const e=t.oldValue,i=t.getValue();t.equals(e,i)||(t.oldValue=i,t.notify(i,e))}function Nkt(t){for(const e of QI.values())e.target===t&&(e.removed=!0)}function kkt(){let t=10;for(;jre&&t--;){jre=null;const e=$kt(),i=Vre.acquire();for(const r of e){const n=r.uid;Lkt(r),n===r.uid&&r.removed&&i.push(r)}for(const r of QI)r.removed&&(i.push(r),QI.delete(r));for(const r of i)RH.pool.release(r);Vre.release(i),Vre.release(e),M_e.forEach(r=>r())}}function $kt(){const t=Vre.acquire();t.length=QI.size;let e=0;for(const i of QI)t[e]=i,++e;return QI.clear(),t}const M_e=new Set;function Bkt(t){return M_e.add(t),{remove(){M_e.delete(t)}}}function Vkt(t,e,i){let r=vVe(t,e,i,(n,s,o)=>{let a,l,c=XVe(()=>bH(n,s),(h,p)=>{n.__accessor__.destroyed||a&&a.uid!==l?r.remove():(a||(a=RH.acquireUntracked(h,o,p,n,s),l=a.uid),Gre(a))});return{remove:_Ve(()=>{c.remove(),a&&(a.uid!==l||a.removed||(a.removed=!0,Gre(a)),a=null),r=c=null})}});return r}function jkt(t,e,i){const r=vVe(t,e,i,(n,s,o)=>{let a=!1;return YVe(()=>bH(n,s),(l,c)=>{n.__accessor__.destroyed?r.remove():a||(a=!0,w_e(c,l)||o.call(n,l,c,s,n),a=!1)})});return r}function Gkt(t,e,i,r=!1){return!t.__accessor__||t.__accessor__.destroyed?{remove(){}}:r?jkt(t,e,i):Vkt(t,e,i)}function Ukt(t,e,i){let r,n,s=XVe(t,(o,a)=>{r&&r.uid!==n?s.remove():(r||(r=RH.acquireTracked(o,e,a,i),n=r.uid),Gre(r))});return{remove:_Ve(()=>{s.remove(),r&&(r.uid!==n||r.removed||(r.removed=!0,Gre(r)),r=null),s=null})}}function zkt(t,e,i){let r=!1;return YVe(t,(n,s)=>{r||(r=!0,i(s,n)||e(n,s),r=!1)})}function Hkt(t,e,i=!1,r=qNt){return i?zkt(t,e,r):Ukt(t,e,r)}function QVe(t){return Rkt(QI,e=>e.oldValue===t)}function Ure(t,e){for(const[i,r]of t)if(e(r,i))return!0;return!1}function bC(t,e,i){const r=t.get(e);if(r!==void 0)return r;const n=i();return t.set(e,n),n}const N8=Oi.getLogger("esri.core.accessorSupport.ensureTypes");function Wkt(t){return t==null?t:new Date(t)}function qkt(t){return t==null?t:!!t}function MH(t){return t==null?t:t.toString()}function jd(t){return t==null?t:(t=parseFloat(t),isNaN(t)?0:t)}function zre(t){return t==null?t:Math.round(parseFloat(t))}function eje(t){return t&&t.constructor&&t.constructor.__accessorMetadata__!==void 0}function Hre(t,e){return e!=null&&t&&!(e instanceof t)}function tje(t){return t&&"isCollection"in t}function ije(t){return t&&t.Type?typeof t.Type=="function"?t.Type:t.Type.base:null}function Ykt(t,e){if(!e||!e.constructor||!tje(e.constructor))return D_e(t,e)?e:new t(e);const i=ije(t.prototype.itemType),r=ije(e.constructor.prototype.itemType);return i?r?i===r?e:i.prototype.isPrototypeOf(r.prototype)?new t(e):(D_e(t,e),e):new t(e):e}function D_e(t,e){return!!eje(e)&&(N8.error("Accessor#set","Assigning an instance of '"+(e.declaredClass||"unknown")+"' which is not a subclass of '"+Wre(t)+"'"),!0)}function Gd(t,e){return e==null?e:tje(t)?Ykt(t,e):Hre(t,e)?D_e(t,e)?e:new t(e):e}function Wre(t){return t&&t.prototype&&t.prototype.declaredClass||"unknown"}const Xkt=new WeakMap;function Kkt(t){switch(t){case Number:return jd;case Ls:return zre;case Boolean:return qkt;case String:return MH;case Date:return Wkt;default:return bC(Xkt,t,()=>Gd.bind(null,t))}}function fd(t,e){const i=Kkt(t);return arguments.length===1?i:i(e)}function DH(t,e,i){return arguments.length===1?DH.bind(null,t):e&&(Array.isArray(e)?e.map(r=>t(r,i)):[t(e,i)])}function Jkt(t,e){return arguments.length===1?DH(fd.bind(null,t)):DH(fd.bind(null,t),e)}function rje(t,e,i){return e!==0&&Array.isArray(i)?i.map(r=>rje(t,e-1,r)):t(i)}function qre(t,e,i){if(arguments.length===2)return qre.bind(null,t,e);if(!i)return i;let r=e,n=i=rje(t,e,i);for(;r>0&&Array.isArray(n);)r--,n=n[0];if(n!==void 0)for(let s=0;s{const i=typeof e;return!(i==="string"||i==="number"||i==="function"&&t.length>1)})}function F_e(t,e){if(arguments.length===2)return F_e(t).call(null,e);const i=new Set,r=t.filter(a=>typeof a!="function"),n=t.filter(a=>typeof a=="function");for(const a of t)typeof a!="string"&&typeof a!="number"||i.add(a);let s=null,o=null;return(a,l)=>{if(a==null)return a;const c=typeof a,h=c==="string"||c==="number";return h&&(i.has(a)||n.some(p=>c==="string"&&p===String||c==="number"&&p===Number))||c==="object"&&n.some(p=>!Hre(a,p))?a:(h&&r.length?(s||(s=r.map(p=>typeof p=="string"?`'${p}'`:`${p}`).join(", ")),N8.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(p=>Wre(p)).join(", ")),N8.error("Accessor#set",`'${a}' is not a valid value for this property, value must be one of ${o}`)):N8.error("Accessor#set",`'${a}' is not a valid value for this property`),l&&(l.valid=!1),null)}}function wC(t,e){if(arguments.length===2)return wC(t).call(null,e);const i={},r=[],n=[];for(const l in t.typeMap){const c=t.typeMap[l];i[l]=fd(c),r.push(Wre(c)),n.push(l)}const s=()=>`'${r.join("', '")}'`,o=()=>`'${n.join("', '")}'`,a=typeof t.key=="string"?l=>l[t.key]:t.key;return l=>{if(t.base&&!Hre(t.base,l)||l==null)return l;const c=a(l)||t.defaultKeyValue,h=i[c];if(!h)return N8.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(!Hre(t.typeMap[c],l))return l;if(typeof t.key=="string"&&!eje(l)){const p={};for(const y in l)y!==t.key&&(p[y]=l[y]);return h(p)}return h(l)}}let Ls=class{};const FH={native:t=>({type:"native",value:t}),array:t=>({type:"array",value:t}),oneOf:t=>({type:"one-of",values:t})};function Qkt(t){if(!t||!("type"in t))return!1;switch(t.type){case"native":case"array":case"one-of":return!0}return!1}function sje(t){switch(t.type){case"native":return fd(t.value);case"array":return DH(sje(t.value));case"one-of":return e6t(t);default:return null}}function e6t(t){let e=null;return(i,r)=>N_e(i,t)?i:(e==null&&(e=L_e(t)),N8.error("Accessor#set",`Invalid property value, value needs to be of type ${e}`),r&&(r.valid=!1),null)}function L_e(t){switch(t.type){case"native":switch(t.value){case Number:return"number";case String:return"string";case Boolean:return"boolean";case Ls:return"integer";case Date:return"date";default:return Wre(t.value)}case"array":return`array of ${L_e(t.value)}`;case"one-of":{const e=t.values.map(i=>L_e(i));return`one of ${e.slice(0,e.length-1)} or ${e[e.length-1]}`}}return"unknown"}function N_e(t,e){if(t==null)return!0;switch(e.type){case"native":switch(e.value){case Number:case Ls:return typeof t=="number";case Boolean:return typeof t=="boolean";case String:return typeof t=="string"}return t instanceof e.value;case"array":return!!Array.isArray(t)&&!t.some(i=>!N_e(i,e.value));case"one-of":return e.values.some(i=>N_e(t,i))}}function N(t={}){return(e,i)=>{if(e===Function.prototype)throw new Error(`Inappropriate use of @property() on a static field: ${e.name}.${i}. Accessor does not support static properties.`);const r=Object.getOwnPropertyDescriptor(e,i),n=xH(e,i);r&&(r.get||r.set?(n.get=r.get||n.get,n.set=r.set||n.set):"value"in r&&("value"in t&&Oi.getLogger("esri.core.accessorSupport.decorators.property").warn(`@property() will redefine the value of "${i}" on "${e.constructor.name}" already defined in the metadata`,t),n.value=t.value=r.value)),t.readOnly!=null&&(n.readOnly=t.readOnly);const s=t.aliasOf;if(s){const l=typeof s=="string"?s:s.source,c=typeof s=="string"?null:s.overridable===!0;let h;n.dependsOn=[l],n.get=function(){let p=Tre(this,l);if(typeof p=="function"){h||(h=l.split(".").slice(0,-1).join("."));const y=Tre(this,h);y&&(p=p.bind(y))}return p},n.readOnly||(n.set=c?function(p){this._override(i,p)}:function(p){Ore(this,l,p)})}const o=t.type,a=t.types;n.cast||(o?n.cast=t6t(o):a&&(Array.isArray(a)?n.cast=DH(wC(a[0])):n.cast=wC(a))),QNt(n,t),t.range&&(n.cast=oje(n.cast,t.range))}}function k_e(t,e,i){const r=xH(t,i);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 t6t(t){let e=0,i=t;if(Qkt(t))return sje(t);for(;Array.isArray(i)&&i.length===1&&typeof i[0]!="string"&&typeof i[0]!="number";)i=i[0],e++;const r=i;if(nje(r))return e===0?F_e(r):qre(F_e(r),e);if(e===1)return Jkt(r);if(e>1)return Zkt(r,e);const n=t;return n.from?n.from:fd(n)}function oje(t,e){return i=>{let r=+t(i);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 i6t(t){if(t.json&&t.json.origins){const e=t.json.origins,i={"web-document":["web-scene","web-map"]};for(const r in i)if(e[r]){const n=e[r];i[r].forEach(s=>{e[s]=n}),delete e[r]}}}let Am=class N9e extends kVe{constructor(e,i,r){if(super(e,i,r),!(this instanceof N9e))return new N9e(e,i,r)}};Am.prototype.type="warning";function aje(t){return!!t&&t.prototype&&t.prototype.declaredClass&&t.prototype.declaredClass.indexOf("esri.core.Collection")===0}const $_e=Oi.getLogger("esri.core.accessorSupport.extensions.serializableProperty.reader");function lje(t,e,i){t&&(!i&&!e.read||e.read?.reader||e.read?.enabled===!1||s6t(t)&&Dp("read.reader",xC(t),e))}function xC(t){const e=t.ndimArray??0;if(e>1)return n6t(t);if(e===1)return cje(t);if("type"in t&&hje(t.type)){const i=t.type.prototype?.itemType?.Type,r=cje(typeof i=="function"?{type:i}:{types:i});return(n,s,o)=>{const a=r(n,s,o);return a&&new t.type(a)}}return B_e(t)}function B_e(t){return"type"in t?r6t(t.type):o6t(t.types)}function r6t(t){return t.prototype.read?(e,i,r)=>{if(e==null)return e;const n=typeof e;if(n!=="object")return void $_e.error(`Expected JSON value of type 'object' to deserialize type '${t.prototype.declaredClass}', but got '${n}'`);const s=new t;return s.read(e,r),s}:t.fromJSON}function uje(t,e,i,r){return r!==0&&Array.isArray(e)?e.map(n=>uje(t,n,i,r-1)):t(e,void 0,i)}function n6t(t){const e=B_e(t),i=uje.bind(null,e),r=t.ndimArray??0;return(n,s,o)=>{if(n==null)return n;n=i(n,o,r);let a=r,l=n;for(;a>0&&Array.isArray(l);)a--,l=l[0];if(l!==void 0)for(let c=0;c{if(i==null)return i;if(Array.isArray(i)){const o=[];for(const a of i){const l=e(a,void 0,n);l!==void 0&&o.push(l)}return o}const s=e(i,void 0,n);return s!==void 0?[s]:void 0}}function hje(t){if(!aje(t))return!1;const e=t.prototype.itemType;return!(!e||!e.Type)&&(typeof e.Type=="function"?V_e(e.Type):dje(e.Type))}function s6t(t){return"types"in t?dje(t.types):V_e(t.type)}function V_e(t){return!Array.isArray(t)&&!!t&&t.prototype&&("read"in t.prototype||"fromJSON"in t||hje(t))}function dje(t){for(const e in t.typeMap)if(!V_e(t.typeMap[e]))return!1;return!0}function o6t(t){let e=null;const i=t.errorContext??"type";return(r,n,s)=>{if(r==null)return r;const o=typeof r;if(o!=="object")return void $_e.error(`Expected JSON value of type 'object' to deserialize, but got '${o}'`);e||(e=a6t(t));const a=t.key;if(typeof a!="string")return;const l=r[a],c=l?e[l]:t.defaultKeyValue?t.typeMap[t.defaultKeyValue]:void 0;if(!c){const p=`Type '${l||"unknown"}' is not supported`;return s&&s.messages&&r&&s.messages.push(new Am(`${i}:unsupported`,p,{definition:r,context:s})),void $_e.error(p)}const h=new c;return h.read(r,s),h}}function a6t(t){const e={};for(const i in t.typeMap){const r=t.typeMap[i],n=wH(r.prototype);if(typeof t.key=="function")continue;const s=n[t.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||!o.writer){e[i]=r;continue}const a=o.target,l=typeof a=="string"?a:t.key,c={};o.writer(i,c,l),c[l]&&(e[c[l]]=r)}return e}function l6t(t){if(t.json||(t.json={}),fje(t.json),mje(t.json),pje(t.json),t.json.origins)for(const e in t.json.origins)fje(t.json.origins[e]),mje(t.json.origins[e]),pje(t.json.origins[e]);return!0}function pje(t){t.name&&(t.read&&typeof t.read=="object"?t.read.source===void 0&&(t.read.source=t.name):t.read={source:t.name},t.write&&typeof t.write=="object"?t.write.target===void 0&&(t.write.target=t.name):t.write={target:t.name})}function fje(t){typeof t.read=="boolean"?t.read={enabled:t.read}:typeof t.read=="function"?t.read={enabled:!0,reader:t.read}:t.read&&typeof t.read=="object"&&t.read.enabled===void 0&&(t.read.enabled=!0)}function mje(t){typeof t.write=="boolean"?t.write={enabled:t.write}:typeof t.write=="function"?t.write={enabled:!0,writer:t.write}:t.write&&typeof t.write=="object"&&t.write.enabled===void 0&&(t.write.enabled=!0)}function gje(t,e){if(!e.write||e.write.writer||e.write.enabled===!1&&!e.write.overridePolicy)return;const i=t?.ndimArray??0;t&&(i===1||"type"in t&&aje(t.type))?e.write.writer=h6t:i>1?e.write.writer=d6t(i):e.types?Array.isArray(e.types)?e.write.writer=c6t(e.types[0]):e.write.writer=u6t(e.types):e.write.writer=LH}function u6t(t){return(e,i,r,n)=>e?yje(e,t,n)?LH(e,i,r,n):void 0:LH(e,i,r,n)}function yje(t,e,i){for(const r in e.typeMap)if(t instanceof e.typeMap[r])return!0;if(i?.messages){const r=e.errorContext??"type",n=`Values of type '${(typeof e.key!="function"?t[e.key]:t.declaredClass)??"Unknown"}' cannot be written`;i&&i.messages&&t&&i.messages.push(new st(`${r}:unsupported`,n,{definition:t,context:i})),Oi.getLogger("esri.core.accessorSupport.extensions.serializableProperty.writer").error(n)}return!1}function c6t(t){return(e,i,r,n)=>!e||!Array.isArray(e)?LH(e,i,r,n):LH(e.filter(s=>yje(s,t,n)),i,r,n)}function LH(t,e,i,r){Dp(i,Yre(t,r),e)}function Yre(t,e){return t&&typeof t.write=="function"?t.write({},e):t&&typeof t.toJSON=="function"?t.toJSON():typeof t=="number"?Xre(t):t}function Xre(t){return t===-1/0?-Number.MAX_VALUE:t===1/0?Number.MAX_VALUE:isNaN(t)?null:t}function h6t(t,e,i,r){let n;t===null?n=null:t&&typeof t.map=="function"?(n=t.map(s=>Yre(s,r)),typeof n.toArray=="function"&&(n=n.toArray())):n=[Yre(t,r)],Dp(i,n,e)}function vje(t,e,i){return i!==0&&Array.isArray(t)?t.map(r=>vje(r,e,i-1)):Yre(t,e)}function d6t(t){return(e,i,r,n)=>{let s;if(e===null)s=null;else{s=vje(e,n,t);let o=t,a=s;for(;o>0&&Array.isArray(a);)o--,a=a[0];if(a!==void 0)for(let l=0;l{e.prototype.declaredClass=t,v6t(e);const i=[],r=[];let n=e.prototype;for(;n;)n.hasOwnProperty("initialize")&&!z_e.has(n.initialize)&&(z_e.add(n.initialize),i.push(n.initialize)),n.hasOwnProperty("destroy")&&!H_e.has(n.destroy)&&(H_e.add(n.destroy),r.push(n.destroy)),n=Object.getPrototypeOf(n);z_e.clear(),H_e.clear();class s extends e{constructor(...a){if(super(...a),this.constructor===s&&typeof this.postscript=="function"){if(i.length&&Object.defineProperty(this,"initialize",{enumerable:!1,configurable:!0,value(){for(let l=i.length-1;l>=0;l--)i[l].call(this)}}),r.length){let l=!1;const c=this[iVe];Object.defineProperty(this,"destroy",{enumerable:!1,configurable:!0,value(){if(!l){l=!0,c.call(this);for(let h=0;h0&&this.normalizeCtorArgs&&(this.__accessor__.ctorArgs=this.normalizeCtorArgs.apply(this,e))}postscript(e){const i=this.__accessor__,r=i.ctorArgs||e;i.initialize(),r&&(this.set(r),i.ctorArgs=null),i.constructed(),this.initialize(),this[W_e]=!0}initialize(){}[iVe](){this[pL]=da(this[pL])}destroy(){this.destroyed||(Nkt(this),this.__accessor__.destroy())}get constructed(){return this.__accessor__&&this.__accessor__.initialized||!1}get initialized(){return this[W_e]}get destroyed(){return this.__accessor__&&this.__accessor__.destroyed||!1}commitProperty(e){this.get(e)}get(e){return Tre(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,i){return Ore(this,e,i),this}watch(e,i,r){return Gkt(this,e,i,r)}own(e){this.addHandles(e)}addHandles(e,i){let r=this[pL];lt(r)&&(r=this[pL]=new df),r.add(e,i)}removeHandles(e){const i=this[pL];lt(i)||i.remove(e)}hasHandles(e){const i=this[pL];return!!ve(i)&&i.has(e)}_override(e,i){i===void 0?this.__accessor__.clearOverride(e):this.__accessor__.override(e,i)}_clearOverride(e){return this.__accessor__.clearOverride(e)}_overrideIfSome(e,i){i==null?this.__accessor__.clearOverride(e):this.__accessor__.override(e,i)}_isOverridden(e){return this.__accessor__.isOverridden(e)}notifyChange(e){this.__accessor__.notifyChange(e)}_get(e){return this.__accessor__.internalGet(e)}_set(e,i){return this.__accessor__.internalSet(e,i),this}};wje=pL,xje=W_e;let Kre=class $Lt{constructor(){this._emitter=new $Lt.EventEmitter(this)}emit(e,i){return this._emitter.emit(e,i)}on(e,i){return this._emitter.on(e,i)}once(e,i){return this._emitter.once(e,i)}hasEventListener(e){return this._emitter.hasEventListener(e)}};(function(t){class e{constructor(n=null){this._target=n,this._listenersMap=null}clear(){this._listenersMap&&this._listenersMap.clear(),this._listenersMap=null}emit(n,s){const o=this._listenersMap&&this._listenersMap.get(n);if(!o)return!1;const a=this._target||this;return[...o].forEach(l=>{l.call(a,s)}),o.length>0}on(n,s){if(Array.isArray(n)){const a=n.map(l=>this.on(l,s));return R8(a)}if(n.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap||(this._listenersMap=new Map);const o=this._listenersMap.get(n)||[];return o.push(s),this._listenersMap.set(n,o),{remove:()=>{const a=this._listenersMap&&this._listenersMap.get(n)||[],l=a.indexOf(s);l>=0&&a.splice(l,1)}}}once(n,s){const o=this.on(n,a=>{o.remove(),s.call(null,a)});return o}hasEventListener(n){const s=this._listenersMap&&this._listenersMap.get(n);return s!=null&&s.length>0}}t.EventEmitter=e,t.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=E([dt("esri.core.Evented")],n),n};let i=class extends Tn{constructor(){super(...arguments),this._emitter=new Kre.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)}};i=E([dt("esri.core.Evented")],i),t.EventedAccessor=i})(Kre||(Kre={}));const md=Kre;var pc;(function(t){t[t.ADD=1]="ADD",t[t.REMOVE=2]="REMOVE",t[t.MOVE=4]="MOVE"})(pc||(pc={}));function q_e(t){return(e,i)=>{e[i]=t}}let Y_e=class extends AVe{notify(){const e=this._observers;if(e&&e.length>0){const i=e.slice();for(const r of i)r.onInvalidated(),r.onCommitted()}}};var eA;let b6t=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}};const Wb=new yC(b6t,void 0,t=>{t.item=null,t.target=null,t.defaultPrevented=!1,t.cancellable=!1}),w6t=()=>{};function X_e(t){return t?t instanceof fL?t.toArray():t.length?Array.prototype.slice.apply(t):[]:[]}function K_e(t){if(t&&t.length)return t[0]}function x6t(t,e,i,r){const n=Math.min(t.length-i,e.length-r);let s=0;for(;s{t.push(n),Sje(t,i.call(r,n,s,o),i,r)})}const G3=new Set,U3=new Set,z3=new Set,J_e=new Map;let S6t=0,fL=eA=class extends md.EventedAccessor{static isCollection(t){return t!=null&&t instanceof eA}constructor(t){super(t),this._chgListeners=[],this._notifications=null,this._timer=null,this._observable=new Y_e,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:S6t++})}normalizeCtorArgs(t){return t?Array.isArray(t)||t instanceof eA?{items:t}:t:{}}destroy(){this.removeAll()}*[Symbol.iterator](){yield*this.items}get items(){return Na(this._observable),this._items}set items(t){this._emitBeforeChanges(pc.ADD)||(this._splice(0,this.length,X_e(t)),this._emitAfterChanges(pc.ADD))}hasEventListener(t){return t==="change"?this._chgListeners.length>0:this._emitter.hasEventListener(t)}on(t,e){if(t==="change"){const i=this._chgListeners,r={removed:!1,callback:e};return i.push(r),this._notifications&&this._notifications.push({listeners:i.slice(),items:this._items.slice(),changes:[]}),{remove(){this.remove=w6t,r.removed=!0,i.splice(i.indexOf(r),1)}}}return this._emitter.on(t,e)}once(t,e){const i=this.on(t,e);return{remove(){i.remove()}}}add(t,e){if(Na(this._observable),this._emitBeforeChanges(pc.ADD))return this;const i=this.getNextIndex(e??null);return this._splice(i,0,[t]),this._emitAfterChanges(pc.ADD),this}addMany(t,e=this._items.length){if(Na(this._observable),!t||!t.length)return this;if(this._emitBeforeChanges(pc.ADD))return this;const i=this.getNextIndex(e);return this._splice(i,0,X_e(t)),this._emitAfterChanges(pc.ADD),this}at(t){if(Na(this._observable),(t=Math.trunc(t)||0)<0&&(t+=this.length),!(t<0||t>=this.length))return this._items[t]}removeAll(){if(Na(this._observable),!this.length||this._emitBeforeChanges(pc.REMOVE))return[];const t=this._splice(0,this.length)||[];return this._emitAfterChanges(pc.REMOVE),t}clone(){return Na(this._observable),this._createNewInstance({items:this._items.map(gi)})}concat(...t){Na(this._observable);const e=t.map(X_e);return this._createNewInstance({items:this._items.concat(...e)})}drain(t,e){if(Na(this._observable),!this.length||this._emitBeforeChanges(pc.REMOVE))return;const i=this._splice(0,this.length),r=i.length;for(let n=0;ne&&(t=e),t}includes(t,e=0){return Na(this._observable),this._items.includes(t,e)}indexOf(t,e=0){return Na(this._observable),this._items.indexOf(t,e)}join(t=","){return Na(this._observable),this._items.join(t)}lastIndexOf(t,e=this.length-1){return Na(this._observable),this._items.lastIndexOf(t,e)}map(t,e){Na(this._observable);const i=this._items.map(t,e);return new eA({items:i})}reorder(t,e=this.length-1){Na(this._observable);const i=this.indexOf(t);if(i!==-1){if(e<0?e=0:e>=this.length&&(e=this.length-1),i!==e){if(this._emitBeforeChanges(pc.MOVE))return t;this._splice(i,1),this._splice(e,0,[t]),this._emitAfterChanges(pc.MOVE)}return t}}pop(){if(Na(this._observable),!this.length||this._emitBeforeChanges(pc.REMOVE))return;const t=K_e(this._splice(this.length-1,1));return this._emitAfterChanges(pc.REMOVE),t}push(...t){return Na(this._observable),this._emitBeforeChanges(pc.ADD)||(this._splice(this.length,0,t),this._emitAfterChanges(pc.ADD)),this.length}reduce(t,e){Na(this._observable);const i=this._items;return arguments.length===2?i.reduce(t,e):i.reduce(t)}reduceRight(t,e){Na(this._observable);const i=this._items;return arguments.length===2?i.reduceRight(t,e):i.reduceRight(t)}remove(t){return Na(this._observable),this.removeAt(this.indexOf(t))}removeAt(t){if(Na(this._observable),t<0||t>=this.length||this._emitBeforeChanges(pc.REMOVE))return;const e=K_e(this._splice(t,1));return this._emitAfterChanges(pc.REMOVE),e}removeMany(t){if(Na(this._observable),!t||!t.length||this._emitBeforeChanges(pc.REMOVE))return[];const e=t instanceof eA?t.toArray():t,i=this._items,r=[],n=e.length;for(let s=0;s-1){const l=1+x6t(e,i,s+1,a+1),c=this._splice(a,l);c&&c.length>0&&r.push.apply(r,c),s+=l-1}}return this._emitAfterChanges(pc.REMOVE),r}reverse(){if(Na(this._observable),this._emitBeforeChanges(pc.MOVE))return this;const t=this._splice(0,this.length);return t&&(t.reverse(),this._splice(0,0,t)),this._emitAfterChanges(pc.MOVE),this}shift(){if(Na(this._observable),!this.length||this._emitBeforeChanges(pc.REMOVE))return;const t=K_e(this._splice(0,1));return this._emitAfterChanges(pc.REMOVE),t}slice(t=0,e=this.length){return Na(this._observable),this._createNewInstance({items:this._items.slice(t,e)})}some(t,e){return Na(this._observable),this._items.some(t,e)}sort(t){if(Na(this._observable),!this.length||this._emitBeforeChanges(pc.MOVE))return this;const e=this._splice(0,this.length);return arguments.length?e.sort(t):e.sort(),this._splice(0,0,e),this._emitAfterChanges(pc.MOVE),this}splice(t,e,...i){Na(this._observable);const r=(e?pc.REMOVE:0)|(i.length?pc.ADD:0);if(this._emitBeforeChanges(r))return[];const n=this._splice(t,e,i)||[];return this._emitAfterChanges(r),n}toArray(){return Na(this._observable),this._items.slice()}toJSON(){return Na(this._observable),this.toArray()}toLocaleString(){return Na(this._observable),this._items.toLocaleString()}toString(){return Na(this._observable),this._items.toString()}unshift(...t){return Na(this._observable),!t.length||this._emitBeforeChanges(pc.ADD)||(this._splice(0,0,t),this._emitAfterChanges(pc.ADD)),this.length}_createNewInstance(t){return new this.constructor(t)}_splice(t,e,i){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._timer=V3(()=>this._dispatchChange())),e){if(o=r.splice(t,e),this.hasEventListener("before-remove")){const a=Wb.acquire();a.target=this,a.cancellable=!0;for(let l=0,c=o.length;l{r.push(l)});const n=Gg.acquire();U3.forEach(l=>{n.push(l)});const s=this._items,o=e.items,a=Gg.acquire();if(z3.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},c=e.listeners.length;for(let h=0;h{if(!t)return eA;if(J_e.has(t))return J_e.get(t);let e=null;if(typeof t=="function")e=t.prototype.declaredClass;else if(t.base)e=t.base.prototype.declaredClass;else for(const r in t.typeMap){const n=t.typeMap[r].prototype.declaredClass;e?e+=` | ${n}`:e=n}let i=class extends eA{};return E([q_e({Type:t,ensureType:typeof t=="function"?fd(t):wC(t)})],i.prototype,"itemType",void 0),i=E([dt(`esri.core.Collection<${e}>`)],i),J_e.set(t,i),i},E([N()],fL.prototype,"length",void 0),E([N()],fL.prototype,"items",null),fL=eA=E([dt("esri.core.Collection")],fL);const Sr=fL;function og(t,e,i=Sr){return e||(e=new i),e===t||(e.removeAll(),C6t(t)?e.addMany(t):t&&e.add(t)),e}function k8(t){return t}function C6t(t){return t&&(Array.isArray(t)||"items"in t&&Array.isArray(t.items))}let T6t=class BLt{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const i=new BLt;return this._values.forEach((r,n)=>{e&&e.has(n)||i.set(n,gi(r.value),r.origin)}),i}get(e,i){i=this._normalizeOrigin(i);const r=this._values.get(e);return i==null||r?.origin===i?r?.value:void 0}originOf(e){return this._values.get(e)?.origin??Yn.USER}keys(e){e=this._normalizeOrigin(e);const i=[...this._values.keys()];return e==null?i:i.filter(r=>this._values.get(r)?.origin===e)}set(e,i,r){if((r=this._normalizeOrigin(r))===Yn.DEFAULTS){const n=this._values.get(e);if(n&&n.origin!=null&&n.origin>r)return}this._values.set(e,new E6t(i,r))}delete(e,i){(i=this._normalizeOrigin(i))!=null&&this._values.get(e)?.origin!==i||this._values.delete(e)}has(e,i){return(i=this._normalizeOrigin(i))!=null?this._values.get(e)?.origin===i:this._values.has(e)}forEach(e){this._values.forEach(({value:i},r)=>e(i,r))}_normalizeOrigin(e){if(e!=null)return e===Yn.DEFAULTS?e:Yn.USER}},E6t=class{constructor(e,i){this.value=e,this.origin=i}};function Cje(t,e,i){e.keys().forEach(n=>{i.set(n,e.get(n),Yn.DEFAULTS)});const r=t.metadatas;Object.keys(r).forEach(n=>{t.internalGet(n)&&i.set(n,t.internalGet(n),Yn.DEFAULTS)})}function I6t(t,e,i){if(!t||!t.read||t.read.enabled===!1||!t.read.source)return!1;const r=t.read.source;if(typeof r=="string"){if(r===e||r.includes(".")&&r.indexOf(e)===0&&xVe(r,i))return!0}else for(const n of r)if(n===e||n.includes(".")&&n.indexOf(e)===0&&xVe(n,i))return!0;return!1}function A6t(t){return t&&(!t.read||t.read.enabled!==!1&&!t.read.source)}function P6t(t,e,i,r,n){let s=j_e(e[i],n);A6t(s)&&(t[i]=!0);for(const o of Object.getOwnPropertyNames(e))s=j_e(e[o],n),I6t(s,i,r)&&(t[o]=!0)}function O6t(t,e,i,r){const n=i.metadatas,s=G_e(n[e],"any",r),o=s&&s.default;if(o===void 0)return;const a=typeof o=="function"?o.call(t,e,r):o;a!==void 0&&i.set(e,a)}const Tje={origin:"service"};function Eje(t,e,i=Tje){if(!e||typeof e!="object")return;const r=Mp(t),n=r.metadatas,s={};for(const o of Object.getOwnPropertyNames(e))P6t(s,n,o,e,i);r.setDefaultOrigin(i.origin);for(const o of Object.getOwnPropertyNames(s)){const a=j_e(n[o],i).read,l=a&&a.source;let c;c=l&&typeof l=="string"?bH(e,l):e[o],a&&a.reader&&(c=a.reader.call(t,c,e,i)),c!==void 0&&r.set(o,c)}if(!i||!i.ignoreDefaults){r.setDefaultOrigin("defaults");for(const o of Object.getOwnPropertyNames(n))s[o]||O6t(t,o,r,i)}r.setDefaultOrigin("user")}function R6t(t,e,i,r=Tje){const n={...r,messages:[]};i(n),n.messages?.forEach(s=>{s.type!=="warning"||t.loaded?r&&r.messages&&r.messages.push(s):t.loadWarnings.push(s)})}function M6t(t,e,i,r,n){const s={};return e.write?.writer?.call(t,r,s,i,n),s}function Ije(t,e,i,r,n,s){if(!r||!r.write)return!1;const o=t.get(i);if(!n&&r.write.overridePolicy){const a=r.write.overridePolicy.call(t,o,i,s);a!==void 0&&(n=a)}if(n||(n=r.write),!n||n.enabled===!1)return!1;if((o===null&&!n.allowNull&&!n.writerEnsuresNonNull||o===void 0)&&n.isRequired){const a=new st("web-document-write:property-required",`Missing value for required property '${i}' on '${t.declaredClass}'`,{propertyName:i,target:t});return a&&s&&s.messages?s.messages.push(a):a&&!s&&Oi.getLogger("esri.core.accessorSupport.write").error(a.name,a.message),!1}return!(o===void 0||o===null&&!n.allowNull&&!n.writerEnsuresNonNull||(!e.store.multipleOriginsSupported||e.store.originOf(i)===Yn.DEFAULTS)&&D6t(t,i,s,r,o)||!n.ignoreOrigin&&s&&s.origin&&e.store.multipleOriginsSupported&&e.store.originOf(i)0&&(e=Sre(e,l),i?.resources?.pendingOperations?.length&&i.resources.pendingOperations.push(Promise.all(i.resources.pendingOperations).then(()=>Sre(e,l,()=>"replace-arrays"))),i&&i.writtenProperties&&i.writtenProperties.push({target:t,propName:s,oldOrigin:okt(r.store.originOf(s)),newOrigin:i.origin}))}return e}const Y0=t=>{let e=class extends t{constructor(...i){super(...i);const r=Mp(this),n=r.store,s=new T6t;r.store=s,Cje(r,n,s)}read(i,r){Eje(this,i,r)}write(i={},r){return Pje(this,i,r)}toJSON(i){return this.write({},i)}static fromJSON(i,r){return F6t.call(this,i,r)}};return e=E([dt("esri.core.JSONSupport")],e),e.prototype.toJSON.isDefaultToJSON=!0,e};function F6t(t,e){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");const i=new this;return i.read(t,e),i}let Ui=class extends Y0(Tn){};Ui=E([dt("esri.core.JSONSupport")],Ui);var H3;(function(t){t[t.PENDING=0]="PENDING",t[t.RESOLVED=1]="RESOLVED",t[t.REJECTED=2]="REJECTED"})(H3||(H3={}));let L6t=class{constructor(e){this.instance=e,this._resolver=Kx(),this._status=H3.PENDING,this._resolvingPromises=[],this._resolver.promise.then(()=>{this._status=H3.RESOLVED,this._cleanUp()},()=>{this._status=H3.REJECTED,this._cleanUp()})}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return this._status===H3.RESOLVED}isRejected(){return this._status===H3.REJECTED}isFulfilled(){return this._status!==H3.PENDING}abort(){this._resolver.reject(Sc())}when(e,i){return this._resolver.promise.then(e,i)}_cleanUp(){this._allPromise=this._resolvingPromises=this._allPromise=null}_tryResolve(){if(this.isFulfilled())return;const e=Kx(),i=[...this._resolvingPromises,e.promise],r=this._allPromise=Promise.all(i);r.then(()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve(this.instance)},n=>{this.isFulfilled()||this._allPromise!==r||ys(n)||this._resolver.reject(n)}),e.resolve()}};const Jx=t=>{let e=class extends t{constructor(...i){super(...i),this._promiseProps=new L6t(this),this.addResolvingPromise(Promise.resolve())}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(i,r){return new Promise((n,s)=>{this._promiseProps.when(n,s)}).then(i,r)}catch(i){return this.when(null,i)}addResolvingPromise(i){i&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in i?i.when():i)}};return e=E([dt("esri.core.Promise")],e),e};let NH=class extends Jx(Tn){};NH=E([dt("esri.core.Promise")],NH);const N6t="not-loaded",k6t="loading",$6t="failed",Oje="loaded",Rje=t=>{let e=class extends t{constructor(...i){super(...i),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 c=F8(s,l);this.destroyed&&l(new st("load:instance-destroyed",`Instance of '${this.declaredClass||this.constructor.name}' is already destroyed`,{instance:this})),this._promiseProps.when(a,l).finally(()=>{c&&c.remove()})});if(this.loadStatus===N6t){this._set("loadStatus",k6t);const a=this._loadController=new AbortController;n({signal:a.signal}),ap(a.signal,()=>{this._promiseProps.abort()})}return r(),o}})),this.when(()=>{this._set("loadStatus",Oje),this._loadController=null},r=>{this._set("loadStatus",$6t),this._set("loadError",r),this._loadController=null})}get loaded(){return this.loadStatus===Oje}get loadWarnings(){return this._get("loadWarnings")}load(){return null}cancelLoad(){return this.isFulfilled()||(this._set("loadError",new st("load:cancelled","Cancelled")),this._loadController?.abort()),this}};return E([N({readOnly:!0})],e.prototype,"loaded",null),E([N({readOnly:!0})],e.prototype,"loadError",void 0),E([N({clonable:!1})],e.prototype,"loadStatus",void 0),E([N({type:[Am],readOnly:!0})],e.prototype,"loadWarnings",null),e=E([dt("esri.core.Loadable")],e),e};let kH=class extends Rje(NH){};kH=E([dt("esri.core.Loadable")],kH),function(t){function e(i){return!(!i||!i.load)}t.LoadableMixin=Rje,t.isLoadable=e}(kH||(kH={}));const gd=kH;function B6t(t,e,i){return Ru(t.map((r,n)=>e.apply(i,[r,n])))}async function V6t(t,e,i){return(await Ru(t.map((r,n)=>e.apply(i,[r,n])))).map(r=>r.value)}function Z_e(t){return{ok:!0,value:t}}function Q_e(t){return{ok:!1,error:t}}function j6t(t){return ve(t)&&t.ok===!0?t.value:null}function G6t(t){return ve(t)&&t.ok===!1?t.error:null}async function SC(t){if(lt(t))return{ok:!1,error:new Error("no promise provided")};try{return Z_e(await t)}catch(e){return Q_e(e)}}async function Mje(t){try{return Z_e(await t)}catch(e){return Ya(e),Q_e(e)}}function CC(t,e){return new W3(t,e)}let W3=class extends Tn{get value(){return j6t(this._result)}get error(){return G6t(this._result)}get finished(){return ve(this._result)}constructor(e,i){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=oL(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=Z_e(n),this._cleanup()},n=>{this._result=Q_e(n),this._cleanup()}),this._abortHandle=ap(i,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=Uc(this._abortHandle),this._abortController=null}};E([N()],W3.prototype,"value",null),E([N()],W3.prototype,"error",null),E([N()],W3.prototype,"finished",null),E([N()],W3.prototype,"promise",void 0),E([N()],W3.prototype,"_result",void 0),W3=E([dt("esri.core.asyncUtils.ReactiveTask")],W3);async function mL(t,e){return await t.load(),Dje(t,e)}async function Dje(t,e){const i=[],r=(...s)=>{for(const o of s)lt(o)||(Array.isArray(o)?r(...o):Sr.isCollection(o)?o.forEach(a=>r(a)):gd.isLoadable(o)&&i.push(o))};e(r);let n=null;if(await V6t(i,async s=>{const o=await SC(U6t(s)?s.loadAll():s.load());o.ok!==!1||n||(n=o)}),n)throw n.error;return t}function U6t(t){return"loadAll"in t&&typeof t.loadAll=="function"}const z6t=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,H6t={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 e1e(t){const e=t?.match(z6t);if(!e)return null;const[,i,r,n]=e;if(!i)return null;let s=null,o=null,a=null;const{devext:l,qaext:c,www:h}=H6t;if(r)if(s=i,n)switch(n.toLowerCase()){case"devext":({customBaseUrl:o,portalHostname:a}=l);break;case"qa":({customBaseUrl:o,portalHostname:a}=c);break;default:return null}else({customBaseUrl:o,portalHostname:a}=h);else switch(i.toLowerCase()){case"devext":({customBaseUrl:o,portalHostname:a}=l);break;case"qaext":({customBaseUrl:o,portalHostname:a}=c);break;case"www":({customBaseUrl:o,portalHostname:a}=h);break;default:return null}return{customBaseUrl:o,isPortal:!1,portalHostname:a,urlKey:s}}function Fje(t){return/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(t)}const W6t=Oi.getLogger("esri.core.urlUtils"),$8=pa.request,Lje="esri/config: esriConfig.request.proxyUrl is not set.",Nje=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,kje=/^\s*http:/i,q6t=/^\s*https:/i,Y6t=/^\s*file:/i,X6t=/:\d+$/,K6t=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,J6t=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),Z6t=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");let Hg=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 i=this.uri.match(J6t);this.scheme=i[2]||(i[1]?"":null),this.authority=i[4]||(i[3]?"":null),this.path=i[5],this.query=i[7]||(i[6]?"":null),this.fragment=i[9]||(i[8]?"":null),this.authority!=null&&(i=this.authority.match(Z6t),this.user=i[3]||null,this.password=i[4]||null,this.host=i[6]||i[7],this.port=i[9]||null)}toString(){return this.uri}};const Jre={};let Vy=new Hg(pa.applicationUrl),t1e=Q6t();const i1e=()=>Vy,$je=()=>t1e;function Q6t(){const t=Vy.path,e=t.substring(0,t.lastIndexOf(t.split("/")[t.split("/").length-1]));return`${`${Vy.scheme}://${Vy.host}${Vy.port!=null?`:${Vy.port}`:""}`}${e}`}function fa(t){if(!t)return null;const e={path:null,query:null},i=new Hg(t),r=t.indexOf("?");return i.query===null?e.path=t:(e.path=t.substring(0,r),e.query=q3(i.query)),i.fragment&&(e.hash=i.fragment,i.query===null&&(e.path=e.path.substring(0,e.path.length-(i.fragment.length+1)))),e}function q3(t){const e=t.split("&"),i={};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=i[s];typeof a=="string"&&(a=i[s]=[a]),Array.isArray(a)?a.push(o):i[s]=o}return i}function Bje(t){return t&&typeof t=="object"&&"toJSON"in t&&typeof t.toJSON=="function"}function Wv(t,e){return t?e&&typeof e=="function"?Object.keys(t).map(i=>encodeURIComponent(i)+"="+encodeURIComponent(e(i,t[i]))).join("&"):Object.keys(t).map(i=>{const r=t[i];if(r==null)return"";const n=encodeURIComponent(i)+"=",s=e&&e[i];return s?n+encodeURIComponent(s(r)):Array.isArray(r)?r.map(o=>Bje(o)?n+encodeURIComponent(JSON.stringify(o)):n+encodeURIComponent(o)).join("&"):Bje(r)?n+encodeURIComponent(JSON.stringify(r)):n+encodeURIComponent(r)}).filter(i=>i).join("&"):""}function e$t(t=!1){let e,i=$8.proxyUrl;if(typeof t=="string"){e=zje(t);const r=BH(t);r&&(i=r.proxyUrl)}else e=!!t;if(!i)throw W6t.warn(Lje),new st("urlutils:proxy-not-set",Lje);return e&&u1e()&&(i=VH(i)),fa(i)}function Vje(t){const e=BH(t);let i,r;if(e){const n=r1e(e.proxyUrl);i=n.path,r=n.query?q3(n.query):null}if(i){const n=fa(t);t=i+"?"+n.path;const s=Wv({...r,...n.query});s&&(t=`${t}?${s}`)}return t}const $H={path:"",query:""};function r1e(t){const e=t.indexOf("?");return e!==-1?($H.path=t.slice(0,e),$H.query=t.slice(e+1)):($H.path=t,$H.query=null),$H}function jje(t){return t=(t=ene(t=p$t(t=r1e(t).path),!0)).toLowerCase()}function t$t(t){const e={proxyUrl:t.proxyUrl,urlPrefix:jje(t.urlPrefix)},i=$8.proxyRules,r=e.urlPrefix;let n=i.length;for(let s=0;s0?t.substring(0,e):t.replace(/\/+$/,"")}function Gje(t){const e=r=>r==null||r instanceof RegExp&&r.test(t)||typeof r=="string"&&t.startsWith(r),i=$8.interceptors;if(i){for(const r of i)if(Array.isArray(r.urls)){if(r.urls.some(e))return r}else if(e(r.urls))return r}return null}function jy(t,e,i=!1){if(!t||!e)return!1;const r=h1e(t),n=h1e(e);return!(!i&&r.scheme!==n.scheme)&&r.host!=null&&n.host!=null&&r.host.toLowerCase()===n.host.toLowerCase()&&r.port===n.port}function s1e(t){if(typeof t=="string"){if(!Wg(t))return!0;t=h1e(t)}if(jy(t,Vy))return!0;const e=$8.trustedServers||[];for(let i=0;i(v=p.indexOf(y,v))===-1?p.length:v;let l=a(n,"/",n.indexOf("//")+2),c=-1;for(;n.slice(0,l+1)===s.slice(0,l)+"/"&&(c=l+1,l!==n.length);)l=a(n,"/",l+1);if(c===-1||o&&c0)for(let p=0;ps?n.concat(s.split("/")):n,[]);for(let n=0;n0&&i[i.length-1]!==".."?i.pop():(!s&&n===r.length-1||s&&(s!=="."||i.length===0))&&i.push(s)}return i.join("/")}function qb(t,e=!1){if(t==null||TC(t)||A1(t))return null;let i=t.indexOf("://");if(i===-1&&P1(t))i=2;else{if(i===-1)return null;i+=3}const r=t.indexOf("/",i);return r!==-1&&(t=t.slice(0,r)),e&&(t=ene(t,!0)),t}function Wg(t){return P1(t)||l1e(t)}function TC(t){return t!=null&&t.slice(0,5)==="blob:"}function A1(t){return t!=null&&t.slice(0,5)==="data:"}function o1e(t){const e=Y3(t);if(!e||!e.isBase64)return null;const i=atob(e.data),r=new Uint8Array(i.length);for(let n=0;n1&&t[0]==="/"&&t[1]==="/"&&(t=t.slice(2)),t)}function d$t(t){const e=t.indexOf("//"),i=t.indexOf("/",e+2);return i===-1?t:t.slice(0,i)}function jH(t){let e=0;if(Wg(t)){const r=t.indexOf("//");r!==-1&&(e=r+2)}const i=t.lastIndexOf("/");return ir===n||r.endsWith(`.${n}`))||u1e()&&!BH(t))&&(t=VH(t)),t}function c1e(t,e,i){if(!(e&&i&&t&&Wg(t)))return t;const r=t.indexOf("//"),n=t.indexOf("/",r+2),s=t.indexOf(":",r+2),o=Math.min(n<0?t.length:n,s<0?t.length:s);return t.slice(r+2,o).toLowerCase()!==e.toLowerCase()?t:`${t.slice(0,r+2)}${i}${t.slice(o)}`}function h1e(t){return typeof t=="string"?new Hg(Gy(t)):(t.scheme||(t.scheme=Vy.scheme),t)}function y$t(t){return v$t.test(t)}function Hje(t,e){const i=fa(t),r=Object.keys(i.query||{});return r.length>0&&e&&e.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${r.join(", ")}.`),i.path}function Wje(t,e,i){const r=fa(t),n=r.query||{};return n[e]=String(i),`${r.path}?${Wv(n)}`}function zy(t,e){const i=fa(t),r=i.query||{};for(const s in e)r[s]=e[s];const n=Wv(r);return n?`${i.path}?${n}`:i.path}function d1e(t){if(lt(t))return null;const e=t.match(Yje);return e?e[2]:null}function qje(t){if(lt(t))return null;const e=t.match(Yje);return e?{path:e[1],extension:e[2]}:{path:t,extension:null}}const Yje=/([^.]*)\.([^\/]*)$/,v$t=/(^data:image\/svg|\.svg$)/i;function Cr(t,e,i){let r,n;return e===void 0?(n=t,r=[void 0]):typeof e!="string"?(n=t,r=[void 0],i=e):(n=e,r=Array.isArray(t)?t:[t]),(s,o)=>{const a=s.constructor.prototype;for(const l of r){const c=k_e(s,l,n);c.write&&typeof c.write=="object"||(c.write={}),i&&(c.write.target=i),c.write.writer=a[o]}}}let Ks=class{constructor(e,i={ignoreUnknown:!1,useNumericKeys:!1}){this._jsonToAPI=e,this._options=i,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&&Dp(s,o,n)},this.write.isJSONMapWriter=!0}toJSON(e){if(e==null)return null;if(this._apiToJSON.hasOwnProperty(e)){const i=this._apiToJSON[e];return this._options.useNumericKeys?+i:i}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 i={};for(const r in e)i[e[r]]=r;return i}_getKeysSorted(e){const i=[];for(const r in e)i.push(r);return i.sort(),i}};function ta(){return function(t,e){return new Ks(t,{ignoreUnknown:!0,...e})}}let p1e=class{constructor(e,i,r,n){this.semiMajorAxis=e,this.flattening=i,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 Mu=new p1e(6378137,1/298.257223563,3e5,.006694379990137799),tA=new p1e(3396190,1/169.8944472236118,23e4),X3=new p1e(1737400,0,0);var Yb;(function(t){t[t.CGCS2000=4490]="CGCS2000",t[t.GCSMARS2000=104971]="GCSMARS2000",t[t.GCSMARS2000_SPHERE=104905]="GCSMARS2000_SPHERE",t[t.GCSMOON2000=104903]="GCSMOON2000"})(Yb||(Yb={}));let fe;const ai={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,5167:0,5168: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,9943:0,9945:0,9947:0,9967:0,9972:0,9977: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};for(fe=2e3;fe<=2045;fe++)ai[fe]=0;for(fe=2056;fe<=2065;fe++)ai[fe]=0;for(fe=2067;fe<=2135;fe++)ai[fe]=0;for(fe=2137;fe<=2154;fe++)ai[fe]=0;for(fe=2161;fe<=2170;fe++)ai[fe]=0;for(fe=2172;fe<=2193;fe++)ai[fe]=0;for(fe=2195;fe<=2198;fe++)ai[fe]=0;for(fe=2200;fe<=2203;fe++)ai[fe]=0;for(fe=2205;fe<=2217;fe++)ai[fe]=0;for(fe=2222;fe<=2224;fe++)ai[fe]=1;for(fe=2225;fe<=2250;fe++)ai[fe]=2;for(fe=2251;fe<=2253;fe++)ai[fe]=1;for(fe=2257;fe<=2264;fe++)ai[fe]=2;for(fe=2274;fe<=2279;fe++)ai[fe]=2;for(fe=2280;fe<=2282;fe++)ai[fe]=1;for(fe=2283;fe<=2289;fe++)ai[fe]=2;for(fe=2290;fe<=2292;fe++)ai[fe]=0;for(fe=2308;fe<=2313;fe++)ai[fe]=0;for(fe=2315;fe<=2491;fe++)ai[fe]=0;for(fe=2494;fe<=2866;fe++)ai[fe]=0;for(fe=2867;fe<=2869;fe++)ai[fe]=1;for(fe=2870;fe<=2888;fe++)ai[fe]=2;for(fe=2891;fe<=2895;fe++)ai[fe]=2;for(fe=2896;fe<=2898;fe++)ai[fe]=1;for(fe=2902;fe<=2908;fe++)ai[fe]=2;for(fe=2915;fe<=2920;fe++)ai[fe]=2;for(fe=2921;fe<=2923;fe++)ai[fe]=1;for(fe=2924;fe<=2930;fe++)ai[fe]=2;for(fe=2931;fe<=2962;fe++)ai[fe]=0;for(fe=2964;fe<=2968;fe++)ai[fe]=2;for(fe=2969;fe<=2973;fe++)ai[fe]=0;for(fe=2975;fe<=2991;fe++)ai[fe]=0;for(fe=2995;fe<=3051;fe++)ai[fe]=0;for(fe=3054;fe<=3079;fe++)ai[fe]=0;for(fe=3081;fe<=3088;fe++)ai[fe]=0;for(fe=3092;fe<=3101;fe++)ai[fe]=0;for(fe=3106;fe<=3138;fe++)ai[fe]=0;for(fe=3146;fe<=3151;fe++)ai[fe]=0;for(fe=3153;fe<=3166;fe++)ai[fe]=0;for(fe=3168;fe<=3172;fe++)ai[fe]=0;for(fe=3174;fe<=3203;fe++)ai[fe]=0;for(fe=3294;fe<=3358;fe++)ai[fe]=0;for(fe=3367;fe<=3403;fe++)ai[fe]=0;for(fe=3408;fe<=3416;fe++)ai[fe]=0;for(fe=3417;fe<=3438;fe++)ai[fe]=2;for(fe=3441;fe<=3446;fe++)ai[fe]=2;for(fe=3447;fe<=3450;fe++)ai[fe]=0;for(fe=3451;fe<=3459;fe++)ai[fe]=2;for(fe=3460;fe<=3478;fe++)ai[fe]=0;for(fe=3554;fe<=3559;fe++)ai[fe]=0;for(fe=3560;fe<=3570;fe++)ai[fe]=2;for(fe=3571;fe<=3581;fe++)ai[fe]=0;for(fe=3594;fe<=3597;fe++)ai[fe]=0;for(fe=3601;fe<=3604;fe++)ai[fe]=0;for(fe=3637;fe<=3639;fe++)ai[fe]=0;for(fe=3665;fe<=3667;fe++)ai[fe]=0;for(fe=3693;fe<=3695;fe++)ai[fe]=0;for(fe=3701;fe<=3727;fe++)ai[fe]=0;for(fe=3728;fe<=3739;fe++)ai[fe]=2;for(fe=3740;fe<=3751;fe++)ai[fe]=0;for(fe=3753;fe<=3760;fe++)ai[fe]=2;for(fe=3761;fe<=3773;fe++)ai[fe]=0;for(fe=3775;fe<=3777;fe++)ai[fe]=0;for(fe=3779;fe<=3781;fe++)ai[fe]=0;for(fe=3783;fe<=3785;fe++)ai[fe]=0;for(fe=3788;fe<=3791;fe++)ai[fe]=0;for(fe=3797;fe<=3802;fe++)ai[fe]=0;for(fe=3814;fe<=3816;fe++)ai[fe]=0;for(fe=3825;fe<=3829;fe++)ai[fe]=0;for(fe=3832;fe<=3841;fe++)ai[fe]=0;for(fe=3844;fe<=3852;fe++)ai[fe]=0;for(fe=3873;fe<=3885;fe++)ai[fe]=0;for(fe=3890;fe<=3893;fe++)ai[fe]=0;for(fe=3907;fe<=3912;fe++)ai[fe]=0;for(fe=3942;fe<=3950;fe++)ai[fe]=0;for(fe=3968;fe<=3970;fe++)ai[fe]=0;for(fe=3973;fe<=3976;fe++)ai[fe]=0;for(fe=3986;fe<=3989;fe++)ai[fe]=0;for(fe=3994;fe<=3997;fe++)ai[fe]=0;for(fe=4048;fe<=4051;fe++)ai[fe]=0;for(fe=4056;fe<=4063;fe++)ai[fe]=0;for(fe=4093;fe<=4096;fe++)ai[fe]=0;for(fe=4390;fe<=4398;fe++)ai[fe]=0;for(fe=4399;fe<=4413;fe++)ai[fe]=2;for(fe=4418;fe<=4433;fe++)ai[fe]=2;for(fe=4455;fe<=4457;fe++)ai[fe]=2;for(fe=4484;fe<=4489;fe++)ai[fe]=0;for(fe=4491;fe<=4554;fe++)ai[fe]=0;for(fe=4568;fe<=4589;fe++)ai[fe]=0;for(fe=4652;fe<=4656;fe++)ai[fe]=0;for(fe=4766;fe<=4800;fe++)ai[fe]=0;for(fe=5014;fe<=5016;fe++)ai[fe]=0;for(fe=5069;fe<=5072;fe++)ai[fe]=0;for(fe=5105;fe<=5130;fe++)ai[fe]=0;for(fe=5173;fe<=5188;fe++)ai[fe]=0;for(fe=5253;fe<=5259;fe++)ai[fe]=0;for(fe=5269;fe<=5275;fe++)ai[fe]=0;for(fe=5292;fe<=5311;fe++)ai[fe]=0;for(fe=5329;fe<=5331;fe++)ai[fe]=0;for(fe=5343;fe<=5349;fe++)ai[fe]=0;for(fe=5355;fe<=5357;fe++)ai[fe]=0;for(fe=5387;fe<=5389;fe++)ai[fe]=0;for(fe=5459;fe<=5463;fe++)ai[fe]=0;for(fe=5479;fe<=5482;fe++)ai[fe]=0;for(fe=5518;fe<=5520;fe++)ai[fe]=0;for(fe=5530;fe<=5539;fe++)ai[fe]=0;for(fe=5550;fe<=5552;fe++)ai[fe]=0;for(fe=5562;fe<=5583;fe++)ai[fe]=0;for(fe=5623;fe<=5625;fe++)ai[fe]=2;for(fe=5631;fe<=5639;fe++)ai[fe]=0;for(fe=5649;fe<=5653;fe++)ai[fe]=0;for(fe=5663;fe<=5680;fe++)ai[fe]=0;for(fe=5682;fe<=5685;fe++)ai[fe]=0;for(fe=5875;fe<=5877;fe++)ai[fe]=0;for(fe=5896;fe<=5899;fe++)ai[fe]=0;for(fe=5921;fe<=5940;fe++)ai[fe]=0;for(fe=6050;fe<=6125;fe++)ai[fe]=0;for(fe=6244;fe<=6275;fe++)ai[fe]=0;for(fe=6328;fe<=6348;fe++)ai[fe]=0;for(fe=6350;fe<=6356;fe++)ai[fe]=0;for(fe=6366;fe<=6372;fe++)ai[fe]=0;for(fe=6381;fe<=6387;fe++)ai[fe]=0;for(fe=6393;fe<=6404;fe++)ai[fe]=0;for(fe=6480;fe<=6483;fe++)ai[fe]=0;for(fe=6511;fe<=6514;fe++)ai[fe]=0;for(fe=6579;fe<=6581;fe++)ai[fe]=0;for(fe=6619;fe<=6624;fe++)ai[fe]=0;for(fe=6625;fe<=6627;fe++)ai[fe]=2;for(fe=6628;fe<=6632;fe++)ai[fe]=0;for(fe=6634;fe<=6637;fe++)ai[fe]=0;for(fe=6669;fe<=6692;fe++)ai[fe]=0;for(fe=6707;fe<=6709;fe++)ai[fe]=0;for(fe=6720;fe<=6723;fe++)ai[fe]=0;for(fe=6732;fe<=6738;fe++)ai[fe]=0;for(fe=6931;fe<=6933;fe++)ai[fe]=0;for(fe=6956;fe<=6959;fe++)ai[fe]=0;for(fe=7005;fe<=7007;fe++)ai[fe]=0;for(fe=7057;fe<=7070;fe++)ai[fe]=2;for(fe=7074;fe<=7082;fe++)ai[fe]=0;for(fe=7109;fe<=7118;fe++)ai[fe]=0;for(fe=7119;fe<=7127;fe++)ai[fe]=1;for(fe=7374;fe<=7376;fe++)ai[fe]=0;for(fe=7528;fe<=7586;fe++)ai[fe]=0;for(fe=7587;fe<=7645;fe++)ai[fe]=2;for(fe=7692;fe<=7696;fe++)ai[fe]=0;for(fe=7755;fe<=7787;fe++)ai[fe]=0;for(fe=7791;fe<=7795;fe++)ai[fe]=0;for(fe=7799;fe<=7801;fe++)ai[fe]=0;for(fe=7803;fe<=7805;fe++)ai[fe]=0;for(fe=7825;fe<=7831;fe++)ai[fe]=0;for(fe=7845;fe<=7859;fe++)ai[fe]=0;for(fe=8013;fe<=8032;fe++)ai[fe]=0;for(fe=8065;fe<=8068;fe++)ai[fe]=1;for(fe=8518;fe<=8529;fe++)ai[fe]=2;for(fe=8533;fe<=8536;fe++)ai[fe]=2;for(fe=8538;fe<=8540;fe++)ai[fe]=2;for(fe=8677;fe<=8679;fe++)ai[fe]=0;for(fe=8836;fe<=8840;fe++)ai[fe]=0;for(fe=8857;fe<=8859;fe++)ai[fe]=0;for(fe=8908;fe<=8910;fe++)ai[fe]=0;for(fe=9154;fe<=9159;fe++)ai[fe]=0;for(fe=9205;fe<=9218;fe++)ai[fe]=0;for(fe=9271;fe<=9273;fe++)ai[fe]=0;for(fe=9295;fe<=9297;fe++)ai[fe]=0;for(fe=9356;fe<=9360;fe++)ai[fe]=0;for(fe=9404;fe<=9407;fe++)ai[fe]=0;for(fe=9476;fe<=9482;fe++)ai[fe]=0;for(fe=9487;fe<=9494;fe++)ai[fe]=0;for(fe=9697;fe<=9699;fe++)ai[fe]=0;for(fe=9821;fe<=9865;fe++)ai[fe]=0;for(fe=20002;fe<=20032;fe++)ai[fe]=0;for(fe=20047;fe<=20049;fe++)ai[fe]=0;for(fe=20062;fe<=20092;fe++)ai[fe]=0;for(fe=20135;fe<=20138;fe++)ai[fe]=0;for(fe=20248;fe<=20258;fe++)ai[fe]=0;for(fe=20348;fe<=20358;fe++)ai[fe]=0;for(fe=20436;fe<=20440;fe++)ai[fe]=0;for(fe=20822;fe<=20824;fe++)ai[fe]=0;for(fe=20904;fe<=20932;fe++)ai[fe]=0;for(fe=20934;fe<=20936;fe++)ai[fe]=0;for(fe=21004;fe<=21032;fe++)ai[fe]=0;for(fe=21035;fe<=21037;fe++)ai[fe]=0;for(fe=21095;fe<=21097;fe++)ai[fe]=0;for(fe=21148;fe<=21150;fe++)ai[fe]=0;for(fe=21207;fe<=21264;fe++)ai[fe]=0;for(fe=21307;fe<=21364;fe++)ai[fe]=0;for(fe=21413;fe<=21423;fe++)ai[fe]=0;for(fe=21453;fe<=21463;fe++)ai[fe]=0;for(fe=21473;fe<=21483;fe++)ai[fe]=0;for(fe=21780;fe<=21782;fe++)ai[fe]=0;for(fe=21891;fe<=21894;fe++)ai[fe]=0;for(fe=21896;fe<=21899;fe++)ai[fe]=0;for(fe=22171;fe<=22177;fe++)ai[fe]=0;for(fe=22181;fe<=22187;fe++)ai[fe]=0;for(fe=22191;fe<=22197;fe++)ai[fe]=0;for(fe=22207;fe<=22222;fe++)ai[fe]=0;for(fe=22234;fe<=22236;fe++)ai[fe]=0;for(fe=22243;fe<=22250;fe++)ai[fe]=0;for(fe=22262;fe<=22265;fe++)ai[fe]=0;for(fe=22307;fe<=22322;fe++)ai[fe]=0;for(fe=22348;fe<=22357;fe++)ai[fe]=0;for(fe=22407;fe<=22422;fe++)ai[fe]=0;for(fe=22462;fe<=22465;fe++)ai[fe]=0;for(fe=22521;fe<=22525;fe++)ai[fe]=0;for(fe=22607;fe<=22622;fe++)ai[fe]=0;for(fe=22641;fe<=22646;fe++)ai[fe]=0;for(fe=22648;fe<=22657;fe++)ai[fe]=0;for(fe=22707;fe<=22722;fe++)ai[fe]=0;for(fe=22762;fe<=22765;fe++)ai[fe]=0;for(fe=22991;fe<=22994;fe++)ai[fe]=0;for(fe=23028;fe<=23038;fe++)ai[fe]=0;for(fe=23830;fe<=23853;fe++)ai[fe]=0;for(fe=23866;fe<=23872;fe++)ai[fe]=0;for(fe=23877;fe<=23884;fe++)ai[fe]=0;for(fe=23886;fe<=23894;fe++)ai[fe]=0;for(fe=23946;fe<=23948;fe++)ai[fe]=0;for(fe=24311;fe<=24313;fe++)ai[fe]=0;for(fe=24342;fe<=24347;fe++)ai[fe]=0;for(fe=24370;fe<=24374;fe++)ai[fe]=10;for(fe=24375;fe<=24381;fe++)ai[fe]=0;for(fe=24718;fe<=24721;fe++)ai[fe]=0;for(fe=24817;fe<=24821;fe++)ai[fe]=0;for(fe=24877;fe<=24882;fe++)ai[fe]=0;for(fe=24891;fe<=24893;fe++)ai[fe]=0;for(fe=25391;fe<=25395;fe++)ai[fe]=0;for(fe=25828;fe<=25838;fe++)ai[fe]=0;for(fe=26191;fe<=26195;fe++)ai[fe]=0;for(fe=26391;fe<=26393;fe++)ai[fe]=0;for(fe=26701;fe<=26722;fe++)ai[fe]=0;for(fe=26729;fe<=26799;fe++)ai[fe]=2;for(fe=26801;fe<=26803;fe++)ai[fe]=2;for(fe=26811;fe<=26813;fe++)ai[fe]=2;for(fe=26847;fe<=26870;fe++)ai[fe]=2;for(fe=26891;fe<=26899;fe++)ai[fe]=0;for(fe=26901;fe<=26923;fe++)ai[fe]=0;for(fe=26929;fe<=26946;fe++)ai[fe]=0;for(fe=26948;fe<=26998;fe++)ai[fe]=0;for(fe=27037;fe<=27040;fe++)ai[fe]=0;for(fe=27205;fe<=27232;fe++)ai[fe]=0;for(fe=27258;fe<=27260;fe++)ai[fe]=0;for(fe=27391;fe<=27398;fe++)ai[fe]=0;for(fe=27561;fe<=27564;fe++)ai[fe]=0;for(fe=27571;fe<=27574;fe++)ai[fe]=0;for(fe=27581;fe<=27584;fe++)ai[fe]=0;for(fe=27591;fe<=27594;fe++)ai[fe]=0;for(fe=28191;fe<=28193;fe++)ai[fe]=0;for(fe=28348;fe<=28358;fe++)ai[fe]=0;for(fe=28402;fe<=28432;fe++)ai[fe]=0;for(fe=28462;fe<=28492;fe++)ai[fe]=0;for(fe=29118;fe<=29122;fe++)ai[fe]=0;for(fe=29168;fe<=29172;fe++)ai[fe]=0;for(fe=29177;fe<=29185;fe++)ai[fe]=0;for(fe=29187;fe<=29195;fe++)ai[fe]=0;for(fe=29900;fe<=29903;fe++)ai[fe]=0;for(fe=30161;fe<=30179;fe++)ai[fe]=0;for(fe=30491;fe<=30494;fe++)ai[fe]=0;for(fe=30729;fe<=30732;fe++)ai[fe]=0;for(fe=31251;fe<=31259;fe++)ai[fe]=0;for(fe=31265;fe<=31268;fe++)ai[fe]=0;for(fe=31275;fe<=31279;fe++)ai[fe]=0;for(fe=31281;fe<=31297;fe++)ai[fe]=0;for(fe=31461;fe<=31469;fe++)ai[fe]=0;for(fe=31491;fe<=31495;fe++)ai[fe]=0;for(fe=31917;fe<=31922;fe++)ai[fe]=0;for(fe=31965;fe<=32e3;fe++)ai[fe]=0;for(fe=32001;fe<=32003;fe++)ai[fe]=2;for(fe=32005;fe<=32031;fe++)ai[fe]=2;for(fe=32033;fe<=32060;fe++)ai[fe]=2;for(fe=32064;fe<=32067;fe++)ai[fe]=2;for(fe=32074;fe<=32077;fe++)ai[fe]=2;for(fe=32081;fe<=32086;fe++)ai[fe]=0;for(fe=32107;fe<=32130;fe++)ai[fe]=0;for(fe=32133;fe<=32159;fe++)ai[fe]=0;for(fe=32164;fe<=32167;fe++)ai[fe]=2;for(fe=32180;fe<=32199;fe++)ai[fe]=0;for(fe=32201;fe<=32260;fe++)ai[fe]=0;for(fe=32301;fe<=32360;fe++)ai[fe]=0;for(fe=32601;fe<=32662;fe++)ai[fe]=0;for(fe=32664;fe<=32667;fe++)ai[fe]=2;for(fe=32701;fe<=32761;fe++)ai[fe]=0;for(fe=53001;fe<=53004;fe++)ai[fe]=0;for(fe=53008;fe<=53019;fe++)ai[fe]=0;for(fe=53021;fe<=53032;fe++)ai[fe]=0;for(fe=53034;fe<=53037;fe++)ai[fe]=0;for(fe=53042;fe<=53046;fe++)ai[fe]=0;for(fe=53074;fe<=53080;fe++)ai[fe]=0;for(fe=54001;fe<=54004;fe++)ai[fe]=0;for(fe=54008;fe<=54019;fe++)ai[fe]=0;for(fe=54021;fe<=54032;fe++)ai[fe]=0;for(fe=54034;fe<=54037;fe++)ai[fe]=0;for(fe=54042;fe<=54046;fe++)ai[fe]=0;for(fe=54048;fe<=54053;fe++)ai[fe]=0;for(fe=54074;fe<=54080;fe++)ai[fe]=0;for(fe=54098;fe<=54101;fe++)ai[fe]=0;for(fe=102001;fe<=102040;fe++)ai[fe]=0;for(fe=102042;fe<=102063;fe++)ai[fe]=0;for(fe=102065;fe<=102067;fe++)ai[fe]=0;for(fe=102070;fe<=102117;fe++)ai[fe]=0;for(fe=102122;fe<=102216;fe++)ai[fe]=0;for(fe=102221;fe<=102377;fe++)ai[fe]=0;for(fe=102382;fe<=102388;fe++)ai[fe]=0;for(fe=102389;fe<=102398;fe++)ai[fe]=2;for(fe=102399;fe<=102444;fe++)ai[fe]=0;for(fe=102445;fe<=102447;fe++)ai[fe]=2;for(fe=102448;fe<=102458;fe++)ai[fe]=0;for(fe=102459;fe<=102468;fe++)ai[fe]=2;for(fe=102469;fe<=102499;fe++)ai[fe]=0;for(fe=102500;fe<=102519;fe++)ai[fe]=1;for(fe=102520;fe<=102524;fe++)ai[fe]=0;for(fe=102525;fe<=102529;fe++)ai[fe]=2;for(fe=102530;fe<=102588;fe++)ai[fe]=0;for(fe=102590;fe<=102598;fe++)ai[fe]=0;for(fe=102601;fe<=102603;fe++)ai[fe]=0;for(fe=102605;fe<=102628;fe++)ai[fe]=0;for(fe=102629;fe<=102646;fe++)ai[fe]=2;for(fe=102648;fe<=102700;fe++)ai[fe]=2;for(fe=102701;fe<=102703;fe++)ai[fe]=0;for(fe=102707;fe<=102730;fe++)ai[fe]=2;for(fe=102733;fe<=102758;fe++)ai[fe]=2;for(fe=102767;fe<=102900;fe++)ai[fe]=0;for(fe=102901;fe<=102933;fe++)ai[fe]=2;for(fe=102934;fe<=102950;fe++)ai[fe]=13;for(fe=102951;fe<=102955;fe++)ai[fe]=0;for(fe=102961;fe<=102963;fe++)ai[fe]=0;for(fe=102965;fe<=102969;fe++)ai[fe]=0;for(fe=102971;fe<=102973;fe++)ai[fe]=0;for(fe=102975;fe<=102989;fe++)ai[fe]=0;for(fe=102990;fe<=102992;fe++)ai[fe]=1;for(fe=102997;fe<=103002;fe++)ai[fe]=0;for(fe=103003;fe<=103008;fe++)ai[fe]=2;for(fe=103009;fe<=103011;fe++)ai[fe]=0;for(fe=103012;fe<=103014;fe++)ai[fe]=2;for(fe=103019;fe<=103021;fe++)ai[fe]=0;for(fe=103022;fe<=103024;fe++)ai[fe]=2;for(fe=103029;fe<=103031;fe++)ai[fe]=0;for(fe=103032;fe<=103034;fe++)ai[fe]=2;for(fe=103065;fe<=103068;fe++)ai[fe]=0;for(fe=103074;fe<=103076;fe++)ai[fe]=0;for(fe=103077;fe<=103079;fe++)ai[fe]=1;for(fe=103080;fe<=103082;fe++)ai[fe]=0;for(fe=103083;fe<=103085;fe++)ai[fe]=2;for(fe=103090;fe<=103093;fe++)ai[fe]=0;for(fe=103097;fe<=103099;fe++)ai[fe]=0;for(fe=103100;fe<=103102;fe++)ai[fe]=2;for(fe=103107;fe<=103109;fe++)ai[fe]=0;for(fe=103110;fe<=103112;fe++)ai[fe]=2;for(fe=103113;fe<=103116;fe++)ai[fe]=0;for(fe=103117;fe<=103120;fe++)ai[fe]=2;for(fe=103153;fe<=103157;fe++)ai[fe]=0;for(fe=103158;fe<=103162;fe++)ai[fe]=2;for(fe=103163;fe<=103165;fe++)ai[fe]=0;for(fe=103166;fe<=103168;fe++)ai[fe]=1;for(fe=103169;fe<=103171;fe++)ai[fe]=2;for(fe=103186;fe<=103188;fe++)ai[fe]=0;for(fe=103189;fe<=103191;fe++)ai[fe]=2;for(fe=103192;fe<=103195;fe++)ai[fe]=0;for(fe=103196;fe<=103199;fe++)ai[fe]=2;for(fe=103200;fe<=103224;fe++)ai[fe]=0;for(fe=103225;fe<=103227;fe++)ai[fe]=1;for(fe=103232;fe<=103237;fe++)ai[fe]=0;for(fe=103238;fe<=103243;fe++)ai[fe]=2;for(fe=103244;fe<=103246;fe++)ai[fe]=0;for(fe=103247;fe<=103249;fe++)ai[fe]=2;for(fe=103254;fe<=103256;fe++)ai[fe]=0;for(fe=103257;fe<=103259;fe++)ai[fe]=2;for(fe=103264;fe<=103266;fe++)ai[fe]=0;for(fe=103267;fe<=103269;fe++)ai[fe]=2;for(fe=103300;fe<=103375;fe++)ai[fe]=0;for(fe=103381;fe<=103383;fe++)ai[fe]=0;for(fe=103384;fe<=103386;fe++)ai[fe]=1;for(fe=103387;fe<=103389;fe++)ai[fe]=0;for(fe=103390;fe<=103392;fe++)ai[fe]=2;for(fe=103397;fe<=103399;fe++)ai[fe]=0;for(fe=103400;fe<=103471;fe++)ai[fe]=2;for(fe=103476;fe<=103478;fe++)ai[fe]=0;for(fe=103479;fe<=103481;fe++)ai[fe]=2;for(fe=103486;fe<=103488;fe++)ai[fe]=0;for(fe=103489;fe<=103491;fe++)ai[fe]=2;for(fe=103492;fe<=103495;fe++)ai[fe]=0;for(fe=103496;fe<=103499;fe++)ai[fe]=2;for(fe=103528;fe<=103543;fe++)ai[fe]=0;for(fe=103544;fe<=103548;fe++)ai[fe]=2;for(fe=103549;fe<=103551;fe++)ai[fe]=0;for(fe=103552;fe<=103554;fe++)ai[fe]=1;for(fe=103555;fe<=103557;fe++)ai[fe]=2;for(fe=103558;fe<=103560;fe++)ai[fe]=0;for(fe=103571;fe<=103573;fe++)ai[fe]=0;for(fe=103574;fe<=103576;fe++)ai[fe]=2;for(fe=103577;fe<=103580;fe++)ai[fe]=0;for(fe=103581;fe<=103583;fe++)ai[fe]=2;for(fe=103595;fe<=103694;fe++)ai[fe]=0;for(fe=103696;fe<=103699;fe++)ai[fe]=0;for(fe=103700;fe<=103793;fe++)ai[fe]=2;for(fe=103794;fe<=103890;fe++)ai[fe]=0;for(fe=103891;fe<=103896;fe++)ai[fe]=2;for(fe=103900;fe<=103971;fe++)ai[fe]=2;for(fe=103972;fe<=103977;fe++)ai[fe]=0;for(fe=112e3;fe<=112101;fe++)ai[fe]=0;const _$t={102113:!0,102100:!0,3857:!0,3785:!0},b$t={4326:!0,3785:!0,3857:!0,102113:!0,102100:!0,104905:!0,104971:!0},Xje='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]]',ine=[-20037508342788905e-9,20037508342788905e-9],rne=[-20037508342787e-6,20037508342787e-6],Kje={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:ine,origin:rne,dx:1e-5},102100:{wkTemplate:Xje,valid:ine,origin:rne,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:ine,origin:rne,dx:1e-5},3857:{wkTemplate:Xje,valid:ine,origin:rne,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 Da(t,e){return t===e||!lt(t)&&!lt(e)&&(t.wkid!=null||e.wkid!=null?t.wkid===e.wkid||Xb(t)&&Xb(e)||e.latestWkid!=null&&t.wkid===e.latestWkid||t.latestWkid!=null&&e.wkid===t.latestWkid:!(!t.wkt||!e.wkt)&&t.wkt.toUpperCase()===e.wkt.toUpperCase())}function vd(t){return bh(t)&&t.wkid&&Kje[t.wkid]||null}function nne(t){return!!bh(t)&&(t.wkid?ai[t.wkid]==null:!!t.wkt&&!!/^\s*GEOGCS/i.test(t.wkt))}function w$t(t){return!(yL(t)||vL(t))}function B8(t){return bh(t)&&t.wkid===4326}function x$t(t){return bh(t)&&t.wkid===Yb.CGCS2000}function Xb(t){return bh(t)&&t.wkid!=null&&_$t[t.wkid]===!0}function S$t(t){return bh(t)&&t.wkid===32662}function f1e(t){return t===Yb.GCSMARS2000||t===Yb.GCSMARS2000_SPHERE}function yL(t){return bh(t)&&t.wkid!=null&&f1e(t.wkid)}function m1e(t){return t===Yb.GCSMOON2000}function vL(t){return bh(t)&&t.wkid!=null&&m1e(t.wkid)}function Jje(t){return bh(t)&&t.wkid!=null&&b$t[t.wkid]===!0}function bh(t){return ve(t)&&(t.wkid!=null&&t.wkid>=2e3||t.wkt!=null)}const $f={wkid:4326,wkt:Xx(Kje[4326].wkTemplate,{Central_Meridian:"0.0"})},C$t={wkid:102100,latestWkid:3857},T$t={wkid:32662};function g1e(t){return{wkt:`GEOCCS["Spherical geocentric", DATUM["Not specified", SPHEROID["Sphere",${t.radius},0]], PRIMEM["Greenwich",0.0, @@ -12,9 +12,9 @@ var RAMP4=function(U0){"use strict";var S1=(t=>(t.BLOB="blob",t.DATE="date",t.DO AXIS["Geocentric X",OTHER], AXIS["Geocentric Y",EAST], AXIS["Geocentric Z",NORTH] - ]`}}const YVe=d1e(wu),p1e=d1e(iA),f1e=d1e(X3),XVe={wkt:`GEOCCS["WGS 84", + ]`}}const Zje=g1e(Mu),y1e=g1e(tA),v1e=g1e(X3),Qje={wkt:`GEOCCS["WGS 84", DATUM["WGS_1984", - SPHEROID["WGS 84",${wu.radius},298.257223563, + SPHEROID["WGS 84",${Mu.radius},298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0, @@ -25,16 +25,16 @@ var RAMP4=function(U0){"use strict";var S1=(t=>(t.BLOB="blob",t.DATE="date",t.DO AXIS["Geocentric Y",OTHER], AXIS["Geocentric Z",NORTH], AUTHORITY["EPSG","4978"] -]`};function i$t(t){return ye(t)&&(fL(t)||Ca(t,p1e))?iA:ye(t)&&(mL(t)||Ca(t,f1e))?X3:wu}function r$t(t){return c1e(t)?iA:h1e(t)?X3:wu}const KVe=39.37,n$t=wu.radius*Math.PI/200,JVe=/UNIT\[([^\]]+)\]\]$/i,gL=ri,ZVe=/UNIT\[([^\]]+)\]/i,s$t=new Set([4261,4305,4807,4810,4811,4812,4816,4819,4821,4901,4902,37225,104139,104140]),o$t=jo()({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"}),AC=t=>t*t,K3=t=>t*t*t,UH={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:AC(.001)},"square-centimeters":{inBaseUnits:AC(.01)},"square-decimeters":{inBaseUnits:AC(.1)},"square-meters":{inBaseUnits:1},"square-kilometers":{inBaseUnits:AC(1e3)},"square-inches":{inBaseUnits:AC(.0254)},"square-feet":{inBaseUnits:AC(.3048)},"square-yards":{inBaseUnits:AC(.9144)},"square-miles":{inBaseUnits:AC(1609.344)},"square-us-feet":{inBaseUnits:AC(1200/3937)},acres:{inBaseUnits:.0015625*AC(1609.344)},ares:{inBaseUnits:100},hectares:{inBaseUnits:1e4}}},volume:{baseUnit:"liters",units:{liters:{inBaseUnits:1},"cubic-millimeters":{inBaseUnits:1e3*K3(.001)},"cubic-centimeters":{inBaseUnits:1e3*K3(.01)},"cubic-decimeters":{inBaseUnits:1e3*K3(.1)},"cubic-meters":{inBaseUnits:1e3},"cubic-kilometers":{inBaseUnits:1e3*K3(1e3)},"cubic-inches":{inBaseUnits:1e3*K3(.0254)},"cubic-feet":{inBaseUnits:1e3*K3(.3048)},"cubic-yards":{inBaseUnits:1e3*K3(.9144)},"cubic-miles":{inBaseUnits:1e3*K3(1609.344)}}},angle:{baseUnit:"radians",units:{radians:{inBaseUnits:1},degrees:{inBaseUnits:Math.PI/180}}}},a$t=(()=>{const t={};for(const e in UH)for(const i in UH[e].units)t[i]=e;return t})();function l$t(t,e,i){return t*UH[i].units[e].inBaseUnits}function u$t(t,e,i){return t/UH[i].units[e].inBaseUnits}function m1e(t){const e=a$t[t];if(!e)throw new Error("unknown type");return e}function QVe(t,e=null){return e=e||m1e(t),UH[e].baseUnit===t}function H0(t,e,i){if(e===i)return t;const r=m1e(e);if(r!==m1e(i))throw new Error("incompatible units");const n=QVe(e,r)?t:l$t(t,e,r);return QVe(i,r)?n:u$t(n,i,r)}function c$t(t,e,i){return H0(t,e,"meters")/(i*Math.PI/180)}function eUe(t){return o$t.fromJSON(t.toLowerCase())||null}function J3(t){if(ye(t)&&!J6t(t))return 1;const e=Vc(t);return e>1e5?1:e}function h$t(t){return Vc(t)>=i$t(t).metersPerDegree?"meters":g1e(t)}function Vc(t,e=wu.metersPerDegree){return Fu(d$t(t,!0),e)}function d$t(t,e=!1){const i=ye(t)?t.wkid:null,r=ye(t)?t.wkt:null;let n=null;if(i){if(c1e(i))return iA.metersPerDegree;if(h1e(i))return X3.metersPerDegree;n=gL.values[gL[i]],!n&&e&&s$t.has(i)&&(n=n$t)}else r&&(nUe(r)?n=tUe(JVe.exec(r),n):rUe(r)&&(n=tUe(ZVe.exec(r),n)));return n}function tUe(t,e){return t&&t[1]?iUe(t[1]):e}function iUe(t){return parseFloat(t.split(",")[1])}function g1e(t){const e=ye(t)?t.wkid:null,i=ye(t)?t.wkt:null;let r=null;if(e)r=gL.units[gL[e]];else if(i){const n=nUe(i)?JVe:rUe(i)?ZVe:null;if(n){const s=n.exec(i);s&&s[1]&&(r=f$t(s[1]))}}return ye(r)?eUe(r):null}function rUe(t){return/^GEOCCS/i.test(t)}function nUe(t){return/^PROJCS/i.test(t)}const p$t=1e-7;function f$t(t){const e=/[\\"\\']{1}([^\\"\\']+)/.exec(t);let i=e&&e[1];if(!i||!gL.units.includes(i)){const r=iUe(t);i=null;const n=gL.values;for(let s=0;s_1e),r=t.options,n=r.responseType;r.signal=e?.signal,r.responseType=n==="native"||n==="native-request-init"?"native-request-init":n&&["blob","json","text"].includes(n)&&$Ve(t.url)?.after?n:"array-buffer";const s=await i(t.url,r),o={data:s.data,httpStatus:s.httpStatus,ssl:s.ssl};switch(s.requestOptions?.responseType){case"native-request-init":return delete o.data.signal,o;case"blob":o.data=await o.data.arrayBuffer();break;case"json":o.data=new TextEncoder().encode(JSON.stringify(o.data)).buffer;break;case"text":o.data=new TextEncoder().encode(o.data).buffer}return{result:o,transferList:[o.data]}}};let Ro;function _$t(t){Ro=t}function b$t(t){const e=Ro&&Ro.findCredential(t);return e&&e.token?UVe(t,"token",e.token):t}Gi("host-webworker");const w$t=["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"];function aUe(t){const e=zb(t,!0);return!!e&&e.endsWith(".arcgis.com")&&!w$t.includes(e)&&!t.endsWith("/sharing/rest/generateToken")}function lUe(t,e,i=!1,r){return new Promise((n,s)=>{if(bm(r))return void s(uUe());let o=()=>{c(),s(new Error(`Unable to load ${e}`))},a=()=>{const d=t;c(),n(d)},l=()=>{if(!t)return;const d=t;c(),d.src="",s(uUe())};const c=()=>{Gi("esri-image-decode")||(t.removeEventListener("error",o),t.removeEventListener("load",a)),o=null,a=null,t=null,ye(r)&&r.removeEventListener("abort",l),l=null,i&&URL.revokeObjectURL(e)};ye(r)&&r.addEventListener("abort",l),Gi("esri-image-decode")?t.decode().then(a,o):(t.addEventListener("error",o),t.addEventListener("load",a))})}function uUe(){try{return new DOMException("Aborted","AbortError")}catch{const t=new Error;return t.name="AbortError",t}}function x$t(t){na.request.crossOriginNoCorsDomains||(na.request.crossOriginNoCorsDomains={});const e=na.request.crossOriginNoCorsDomains;for(let i of t)i=i.toLowerCase(),/^https?:\/\//.test(i)?e[zb(i)??""]=0:(e[zb("http://"+i)??""]=0,e[zb("https://"+i)??""]=0)}function S$t(t){const e=na.request.crossOriginNoCorsDomains;if(e){let i=zb(t);if(i)return i=i.toLowerCase(),!Gy(i,Z_e())&&e[i]o.abort());const a={controller:o,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:s,params:n,redoRequest:!1,useIdentity:Qx.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},l=await F$t(a);return s?.after?.(l),l}let une;const Qx=na.request,cUe="FormData"in globalThis,T$t=[499,498,403,401],E$t=["COM_0056","COM_0057","SB_0008"],I$t=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],y1e=()=>null,cne=Symbol();function A$t(t){const e=zb(t);e&&!ir._corsServers.includes(e)&&ir._corsServers.push(e)}function hUe(t){const e=zb(t);return!e||e.endsWith(".arcgis.com")||ir._corsServers.includes(e)||t1e(e)}function e2(t,e,i,r){let n="Error";const s={url:i.url,requestOptions:i.requestOptions,getHeader:y1e,ssl:!1};if(e instanceof st)return e.details?(e.details=hi(e.details),e.details.url=i.url,e.details.requestOptions=i.requestOptions):e.details=s,e;if(e){const o=r&&(c=>r.headers.get(c)),a=r&&r.status,l=e.message;l&&(n=l),o&&(s.getHeader=o),s.httpStatus=(e.httpCode!=null?e.httpCode:e.code)||a||0,s.subCode=e.subcode,s.messageCode=e.messageCode,typeof e.details=="string"?s.messages=[e.details]:s.messages=e.details,s.raw=cne in e?e[cne]:e}return ss(e)?vc():new st(t,n,s)}async function P$t(){Gi("host-webworker")?une||(une=await Promise.resolve().then(()=>uEi)):ir._abortableFetch||(ir._abortableFetch=globalThis.fetch.bind(globalThis))}async function v1e(){Ro||await Promise.resolve().then(()=>NEi)}async function O$t(t){const e=t.params.url,i=t.params.requestOptions,r=t.controller.signal,n=i.body;let s=null,o=null;if(cUe&&"HTMLFormElement"in globalThis&&(n instanceof FormData?s=n:n instanceof HTMLFormElement&&(s=new FormData(n))),typeof n=="string"&&(o=n),t.fetchOptions={cache:i.cacheBust&&!ir._abortableFetch.polyfill?"no-cache":"default",credentials:"same-origin",headers:i.headers||{},method:i.method==="head"?"HEAD":"GET",mode:"cors",priority:Qx.priority,redirect:"follow",signal:r},(s||o)&&(t.fetchOptions.body=s||o),i.authMode==="anonymous"&&(t.useIdentity=!1),t.hasToken=!!(/token=/i.test(e)||i.query?.token||s?.get("token")),!t.hasToken&&na.apiKey&&aUe(e)&&(i.query||(i.query={}),i.query.token=na.apiKey,t.hasToken=!0),t.useIdentity&&!t.hasToken&&!t.credentialToken&&!dUe(e)&&!bm(r)){let a;i.authMode==="immediate"?(await v1e(),a=await Ro.getCredential(e,{signal:r}),t.credential=a):i.authMode==="no-prompt"?(await v1e(),a=await Ro.getCredential(e,{prompt:!1,signal:r}).catch(()=>{}),t.credential=a):Ro&&(a=Ro.findCredential(e)),a&&(t.credentialToken=a.token,t.useSSL=!!a.ssl)}}function dUe(t){return I$t.some(e=>e.test(t))}async function R$t(t){let e=t.params.url;const i=t.params.requestOptions,r=t.fetchOptions??{},n=IC(e)||E1(e),s=i.responseType||"json",o=n?0:i.timeout!=null?i.timeout:Qx.timeout;let a=!1;if(!n){t.useSSL&&(e=GH(e)),i.cacheBust&&r.cache==="default"&&(e=UVe(e,"request.preventCache",Date.now()));let y={...i.query};t.credentialToken&&(y.token=t.credentialToken);let v=Uv(y);Gi("esri-url-encodes-apostrophe")&&(v=v.replace(/'/g,"%27"));const S=e.length+1+v.length;let I;a=i.method==="delete"||i.method==="post"||i.method==="put"||!!i.body||S>Qx.maxUrlLength;const O=i.useProxy||!!BH(e);if(O){const L=O6t(e);I=L.path,!a&&I.length+1+S>Qx.maxUrlLength&&(a=!0),L.query&&(y={...L.query,...y})}if(r.method==="HEAD"&&(a||O)){if(a)throw S>Qx.maxUrlLength?e2("request:invalid-parameters",new Error("URL exceeds maximum length"),t.params):e2("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),t.params);if(O)throw e2("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),t.params)}if(a?(r.method=i.method==="delete"?"DELETE":i.method==="put"?"PUT":"POST",i.body?e=jy(e,y):(r.body=Uv(y),r.headers||(r.headers={}),r.headers["Content-Type"]="application/x-www-form-urlencoded")):e=jy(e,y),O&&(t.useProxy=!0,e=`${I}?${e}`),y.token&&cUe&&r.body instanceof FormData&&!OVe(e)&&r.body.set("token",y.token),i.hasOwnProperty("withCredentials"))t.withCredentials=i.withCredentials;else if(!Gy(e,Z_e())){if(t1e(e))t.withCredentials=!0;else if(Ro){const L=Ro.findServerInfo(e);L&&L.webTierAuth&&(t.withCredentials=!0)}}t.withCredentials&&(r.credentials="include",S$t(e)&&await C$t(a?jy(e,y):e))}let l,c,d=0,p=!1;o>0&&(d=setTimeout(()=>{p=!0,t.controller.abort()},o));try{if(i.responseType==="native-request-init")c=r,c.url=e;else if(i.responseType!=="image"||r.cache!=="default"||r.method!=="GET"||a||D$t(i.headers)||!n&&!t.useProxy&&Qx.proxyUrl&&!hUe(e)){if(l=await ir._abortableFetch(e,r),t.useProxy||A$t(e),i.responseType==="native")c=l;else if(r.method!=="HEAD")if(l.ok){switch(s){case"array-buffer":c=await l.arrayBuffer();break;case"blob":case"image":c=await l.blob();break;default:c=await l.text()}if(d&&(clearTimeout(d),d=0),s==="json"||s==="xml"||s==="document")if(c)switch(s){case"json":c=JSON.parse(c);break;case"xml":c=pUe(c,"application/xml");break;case"document":c=pUe(c,"text/html")}else c=null;if(c){if(s==="array-buffer"||s==="blob"){const y=l.headers.get("Content-Type");if(y&&/application\/json|text\/plain/i.test(y)&&c[s==="blob"?"size":"byteLength"]<=750)try{const v=await new Response(c).json();v.error&&(c=v)}catch{}}s==="image"&&c instanceof Blob&&(c=await fUe(URL.createObjectURL(c),t,!0))}}else c=await l.text()}else c=await fUe(e,t)}catch(y){if(y.name==="AbortError")throw p?new Error("Timeout exceeded"):vc("Request canceled");if(!(!l&&y instanceof TypeError&&Qx.proxyUrl)||i.body||i.method==="delete"||i.method==="head"||i.method==="post"||i.method==="put"||t.useProxy||hUe(e))throw y;t.redoRequest=!0,R6t({proxyUrl:Qx.proxyUrl,urlPrefix:zb(e)??""})}finally{d&&clearTimeout(d)}return[l,c]}async function M$t(t,e){if(t.responseData!=null)return t.responseData;if(t.headers&&(e.requestOptions.headers={...e.requestOptions.headers,...t.headers}),t.query&&(e.requestOptions.query={...e.requestOptions.query,...t.query}),t.before){let i,r;try{r=await t.before(e)}catch(n){i=e2("request:interceptor",n,e)}if((r instanceof Error||r instanceof st)&&(i=e2("request:interceptor",r,e)),i)throw t.error&&t.error(i),i;return r}}function D$t(t){if(t){for(const e of Object.getOwnPropertyNames(t))if(t[e])return!0}return!1}function pUe(t,e){let i;try{i=new DOMParser().parseFromString(t,e)}catch{}if(!i||i.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return i}async function F$t(t){let e,i;await O$t(t);try{do[e,i]=await R$t(t);while(!await L$t(t,e,i))}catch(s){const o=e2("request:server",s,t.params,e);throw o.details.ssl=t.useSSL,t.interceptor&&t.interceptor.error&&t.interceptor.error(o),o}const r=t.params.url;if(i&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(r)){if(!t.hasToken&&!t.credentialToken&&i.user?.username&&!t1e(r)){const s=zb(r,!0);s&&Qx.trustedServers.push(s)}Array.isArray(i.authorizedCrossOriginNoCorsDomains)&&x$t(i.authorizedCrossOriginNoCorsDomains)}const n=t.credential;if(n&&Ro){const s=Ro.findServerInfo(n.server);let o=s&&s.owningSystemUrl;if(o){o=o.replace(/\/?$/,"/sharing");const a=Ro.findCredential(o,n.userId);a&&Ro._getIdenticalSvcIdx(o,a)===-1&&a.resources.unshift(o)}}return{data:i,getHeader:e?s=>e?.headers.get(s):y1e,httpStatus:e?.status??200,requestOptions:t.params.requestOptions,ssl:t.useSSL,url:t.params.url}}async function L$t(t,e,i){if(t.redoRequest)return t.redoRequest=!1,!1;const r=t.params.requestOptions;if(!e||r.responseType==="native"||r.responseType==="native-request-init")return!0;let n,s;if(!e.ok)throw n=new Error(`Unable to load ${e.url} status: ${e.status}`),n[cne]=i,n;i&&(i.error?n=i.error:i.status==="error"&&Array.isArray(i.messages)&&(n={...i},n[cne]=i,n.details=i.messages));let o,a=null;n&&(s=Number(n.code),a=n.hasOwnProperty("subcode")?Number(n.subcode):null,o=n.messageCode,o=o&&o.toUpperCase());const l=r.authMode;if(s===403&&(a===4||n.message&&n.message.toLowerCase().includes("ssl")&&!n.message.toLowerCase().includes("permission"))){if(!t.useSSL)return t.useSSL=!0,!1}else if(!t.hasToken&&t.useIdentity&&(l!=="no-prompt"||s===498)&&s!==void 0&&T$t.includes(s)&&!dUe(t.params.url)&&(s!==403||o&&!E$t.includes(o)&&(a==null||a===2&&t.credentialToken))){await v1e();try{const c=await Ro.getCredential(t.params.url,{error:e2("request:server",n,t.params),prompt:l!=="no-prompt",signal:t.controller.signal,token:t.credentialToken});return t.credential=c,t.credentialToken=c.token,t.useSSL=t.useSSL||c.ssl,!1}catch(c){if(l==="no-prompt")return t.credential=void 0,t.credentialToken=void 0,!1;n=c}}if(n)throw n;return!0}function fUe(t,e,i=!1){const r=e.controller.signal,n=new Image;return e.withCredentials?n.crossOrigin="use-credentials":n.crossOrigin="anonymous",n.alt="",n.fetchPriority=Qx.priority,n.src=t,lUe(n,t,i,r)}ir._abortableFetch=null,ir._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"];const _1e=Object.freeze(Object.defineProperty({__proto__:null,default:ir},Symbol.toStringTag,{value:"Module"}));function Li(t,e,i){let r,n;return e===void 0||Array.isArray(e)?(n=t,i=e,r=[void 0]):(n=e,r=Array.isArray(t)?t:[t]),(s,o)=>{const a=s.constructor.prototype;r.forEach(l=>{const c=D_e(s,l,n);c.read&&typeof c.read=="object"||(c.read={}),c.read.reader=a[o],i&&(c.read.source=(c.read.source||[]).concat(i))})}}let OC=class extends Ni{constructor(...e){super(...e),this.type=null,this.hasM=!1,this.hasZ=!1,this.spatialReference=rr.WGS84}get cache(){return this.commitProperty("spatialReference"),{}}get extent(){return null}readSpatialReference(e,i){if(e instanceof rr)return e;if(e!=null){const r=new rr;return r.read(e,i),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,i){this.cache[e]=i}};E([k()],OC.prototype,"type",void 0),E([k({readOnly:!0})],OC.prototype,"cache",null),E([k({readOnly:!0})],OC.prototype,"extent",null),E([k({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],OC.prototype,"hasM",void 0),E([k({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],OC.prototype,"hasZ",void 0),E([k({type:rr,json:{write:!0},value:rr.WGS84})],OC.prototype,"spatialReference",void 0),E([Li("spatialReference")],OC.prototype,"readSpatialReference",null),OC=E([ht("esri.geometry.Geometry")],OC);const Jr=OC,k$t=Object.prototype.toString;function N$t(t){const e="__accessorMetadata__"in t?ud(t):t;return function(...i){if(i.push(e),typeof i[2]=="number")throw new Error("Using @cast has parameter decorator is not supported since 4.16");return $$t.apply(this,i)}}function $$t(t,e,i,r){xH(t,e).cast=r}function B$t(t){return(e,i)=>{xH(e,t).cast=e[i]}}function Zs(...t){if(t.length!==3||typeof t[1]!="string")return t.length===1&&k$t.call(t[0])==="[object Function]"?N$t(t[0]):t.length===1&&typeof t[0]=="string"?B$t(t[0]):void 0}function G$t(t,e){const i=t.x-e.x,r=t.y-e.y,n=t.hasZ&&e.hasZ?t.z-e.z:0;return Math.sqrt(i*i+r*r+n*n)}const V$t=57.29577951308232,U$t=.017453292519943;function mUe(t){return t*V$t}function gUe(t){return t*U$t}function yUe(t){return t/wu.radius}function b1e(t){return Math.PI/2-2*Math.atan(Math.exp(-t/wu.radius))}function w1e(t){return t.wkid!=null||t.wkt!=null}const x1e=[0,0];function hne(t,e,i,r,n){const s=t,o=n;if(o.spatialReference=i,"x"in s&&"x"in o)[o.x,o.y]=e(s.x,s.y,x1e,r);else if("xmin"in s&&"xmin"in o)[o.xmin,o.ymin]=e(s.xmin,s.ymin,x1e,r),[o.xmax,o.ymax]=e(s.xmax,s.ymax,x1e,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 c;for(let d=0;d2&&c[y].push(p[y][2]),p[y].length>3&&c[y].push(p[y][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 c=0;c2&&l[c].push(a[c][2]),a[c].length>3&&l[c].push(a[c][3]);o.points=l}return n}function U8(t,e){const i=t&&(w1e(t)?t:t.spatialReference),r=e&&(w1e(e)?e:e.spatialReference);return!(t&&"type"in t&&t.type==="mesh"||e&&"type"in e&&e.type==="mesh"||!i||!r)&&(!!Ca(r,i)||Wb(r)&&V8(i)||Wb(i)&&V8(r))}function yL(t,e){if(lt(t))return null;const i=t.spatialReference,r=e&&(w1e(e)?e:e.spatialReference);return U8(i,r)?Ca(i,r)?hi(t):Wb(r)?hne(t,Z3,rr.WebMercator,!1,hi(t)):V8(r)?hne(t,j8,rr.WGS84,!1,hi(t)):null:null}function Z3(t,e,i=[0,0]){e>89.99999?e=89.99999:e<-89.99999&&(e=-89.99999);const r=gUe(e);return i[0]=gUe(t)*wu.radius,i[1]=wu.halfSemiMajorAxis*Math.log((1+Math.sin(r))/(1-Math.sin(r))),i}function j8(t,e,i=[0,0],r=!1){const n=mUe(t/wu.radius);return i[0]=r?n:n-360*Math.floor((n+180)/360),i[1]=mUe(Math.PI/2-2*Math.atan(Math.exp(-e/wu.radius))),i}function Q3(t,e=!1,i=hi(t)){return hne(t,Z3,rr.WebMercator,e,i)}function vL(t,e=!1,i=hi(t)){return hne(t,j8,rr.WGS84,e,i)}var dne;const HH=[0,0];function vUe(t){return t&&(t.declaredClass==="esri.geometry.SpatialReference"||t.wkid!=null)}let W0=dne=class extends Jr{static copy(t,e){e._set("x",t._get("x")),e._set("y",t._get("y")),e._set("z",t._get("z")),e._set("m",t._get("m"));const i=t._get("spatialReference");e._set("spatialReference",Object.isFrozen(i)?i:i.clone())}constructor(...t){super(...t),this.x=0,this.y=0,this.z=void 0,this.m=void 0,this.type="point"}normalizeCtorArgs(t,e,i,r,n){let s;if(Array.isArray(t))s=t,n=e,t=s[0],e=s[1],i=s[2],r=s[3];else if(t&&typeof t=="object"){if(s=t,t=s.x!=null?s.x:s.longitude,e=s.y!=null?s.y:s.latitude,i=s.z,r=s.m,(n=s.spatialReference)&&n.declaredClass!=="esri.geometry.SpatialReference"&&(n=new rr(n)),s.longitude!=null||s.latitude!=null){if(s.longitude==null)Ei.getLogger(this.declaredClass).warn(".longitude=","Latitude was defined without longitude");else if(s.latitude==null)Ei.getLogger(this.declaredClass).warn(".latitude=","Longitude was defined without latitude");else if(!s.declaredClass&&n&&n.isWebMercator){const a=Z3(s.longitude,s.latitude,HH);t=a[0],e=a[1]}}}else vUe(i)?(n=i,i=null):vUe(r)&&(n=r,r=null);const o={x:t,y:e};return o.x==null&&o.y!=null?Ei.getLogger(this.declaredClass).warn(".y=","Y coordinate was defined without an X coordinate"):o.y==null&&o.x!=null&&Ei.getLogger(this.declaredClass).warn(".x=","X coordinate was defined without a Y coordinate"),n!=null&&(o.spatialReference=n),i!=null&&(o.z=i),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(t){t!==(this._get("m")!==void 0)&&(this._set("m",t?0:void 0),this._set("hasM",t))}get hasZ(){return this.z!==void 0}set hasZ(t){t!==(this._get("z")!==void 0)&&(this._set("z",t?0:void 0),this._set("hasZ",t))}get latitude(){const{spatialReference:t,x:e,y:i}=this;if(t){if(t.isWebMercator)return j8(e,i,HH)[1];if(t.isGeographic)return i}return null}set latitude(t){const{spatialReference:e,x:i}=this;t!=null&&e&&(e.isWebMercator?this._set("y",Z3(i,t,HH)[1]):e.isGeographic&&this._set("y",t),this._set("latitude",t))}get longitude(){const{x:t,y:e,spatialReference:i}=this;if(i){if(i.isWebMercator)return j8(t,e,HH)[0];if(i.isGeographic)return t}return null}set longitude(t){const{y:e,spatialReference:i}=this;t!=null&&i&&(i.isWebMercator?this._set("x",Z3(t,e,HH)[0]):i.isGeographic&&this._set("x",t),this._set("longitude",t))}writeX(t,e,i){e[i]=isNaN(t)?"NaN":t}readX(t){return typeof t=="string"?NaN:t}clone(){const t=new dne;return t.x=this.x,t.y=this.y,t.z=this.z,t.m=this.m,t.spatialReference=this.spatialReference,t}copy(t){return dne.copy(t,this),this}equals(t){if(lt(t))return!1;const{x:e,y:i,z:r,m:n,spatialReference:s}=this,{z:o,m:a}=t;let{x:l,y:c,spatialReference:d}=t;if(!s.equals(d))if(s.isWebMercator&&d.isWGS84)[l,c]=Z3(l,c),d=s;else{if(!s.isWGS84||!d.isWebMercator)return!1;[l,c]=j8(l,c),d=s}return e===l&&i===c&&r===o&&n===a&&s.wkid===d.wkid}offset(t,e,i){return this.x+=t,this.y+=e,i!=null&&(this.z=(this.z??0)+i),this}normalize(){if(!this.spatialReference)return this;const t=pd(this.spatialReference);if(!t)return this;let e=this.x;const[i,r]=t.valid,n=2*r;let s;return e>r?(s=Math.ceil(Math.abs(e-r)/n),e-=s*n):eisNaN(t)?t:Ld(t))],W0.prototype,"x",void 0),E([mr("x")],W0.prototype,"writeX",null),E([Li("x")],W0.prototype,"readX",null),E([k({type:Number,json:{write:!0}})],W0.prototype,"y",void 0),E([k({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasZ}}}}})],W0.prototype,"z",void 0),E([k({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasM}}}}})],W0.prototype,"m",void 0),W0=dne=E([ht("esri.geometry.Point")],W0),W0.prototype.toJSON.isDefaultToJSON=!0;const Yi=W0,S1e=[0,0];function WH(t,e){return!!ye(e)&&q0(t,e.x,e.y,e.z)}function j$t(t,e){if(!e.points||e.points.length)return!1;for(const i of e.points)if(!z8(t,i))return!1;return!0}function z$t(t,e){const{xmin:i,ymin:r,zmin:n,xmax:s,ymax:o,zmax:a}=e;return t.hasZ&&e.hasZ?q0(t,i,r,n)&&q0(t,i,o,n)&&q0(t,s,o,n)&&q0(t,s,r,n)&&q0(t,i,r,a)&&q0(t,i,o,a)&&q0(t,s,o,a)&&q0(t,s,r,a):q0(t,i,r)&&q0(t,i,o)&&q0(t,s,o)&&q0(t,s,r)}function z8(t,e){return q0(t,e[0],e[1])}function H$t(t,e){return q0(t,e[0],e[1],e[2])}function q0(t,e,i,r){return e>=t.xmin&&e<=t.xmax&&i>=t.ymin&&i<=t.ymax&&(r==null||!t.hasZ||r>=t.zmin&&r<=t.zmax)}function _Ue(t,e){return S1e[1]=e.y,S1e[0]=e.x,W$t(t,S1e)}function W$t(t,e){return C1e(t.rings,e)}function C1e(t,e){if(!t)return!1;if(q$t(t))return bUe(!1,t,e);let i=!1;for(let r=0,n=t.length;r=n||y=n)&&c+(n-d)/(y-d)*(p-c)=0&&V<=1&&Y>=0&&Y<=1&&(n&&(n[0]=s+V*(a-s),n[1]=o+V*(l-o)),!0)}function CUe(t){switch(t){case"esriGeometryEnvelope":case"extent":return wUe;case"esriGeometryMultipoint":case"multipoint":return X$t;case"esriGeometryPoint":case"point":return Y$t;case"esriGeometryPolygon":case"polygon":return T1e;case"esriGeometryPolyline":case"polyline":return Z$t}}var qb;function e8t(t){return t&&(t.declaredClass==="esri.geometry.SpatialReference"||t.wkid!=null)}function eR(t,e,i){return e==null?i:i==null?e:t(e,i)}let xm=qb=class extends Jr{constructor(...t){super(...t),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(t,e,i,r,n){return e8t(t)?{spatialReference:t,xmin:0,ymin:0,xmax:0,ymax:0}:typeof t=="object"?(t.spatialReference=t.spatialReference==null?rr.WGS84:t.spatialReference,t):{xmin:t,ymin:e,xmax:i,ymax:r,spatialReference:n??rr.WGS84}}static fromBounds(t,e){return new qb({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3],spatialReference:e})}static fromPoint(t){return new qb({xmin:t.x,ymin:t.y,zmin:t.z,xmax:t.x,ymax:t.y,zmax:t.z,spatialReference:t.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 t=new Yi({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(t.z=.5*(this.zmin+this.zmax)),this.hasM&&(t.m=.5*(this.mmin+this.mmax)),t}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(t){const e=this.center;return t.z!=null&&this.hasZ?this.offset(t.x-e.x,t.y-e.y,t.z-e.z):this.offset(t.x-e.x,t.y-e.y)}clone(){const t=new qb;return t.xmin=this.xmin,t.ymin=this.ymin,t.xmax=this.xmax,t.ymax=this.ymax,t.spatialReference=this.spatialReference,this.zmin!=null&&(t.zmin=this.zmin,t.zmax=this.zmax),this.mmin!=null&&(t.mmin=this.mmin,t.mmax=this.mmax),t}contains(t){if(!t)return!1;const e=this.spatialReference,i=t.spatialReference;return e&&i&&!e.equals(i)&&U8(e,i)&&(t=e.isWebMercator?Q3(t):vL(t,!0)),t.type==="point"?WH(this,t):t.type==="extent"&&z$t(this,t)}equals(t){if(this===t)return!0;if(lt(t))return!1;const e=this.spatialReference,i=t.spatialReference;return e&&i&&!e.equals(i)&&U8(e,i)&&(t=e.isWebMercator?Q3(t):vL(t,!0)),this.xmin===t.xmin&&this.ymin===t.ymin&&this.zmin===t.zmin&&this.mmin===t.mmin&&this.xmax===t.xmax&&this.ymax===t.ymax&&this.zmax===t.zmax&&this.mmax===t.mmax}expand(t){const e=.5*(1-t),i=this.width*e,r=this.height*e;if(this.xmin+=i,this.ymin+=r,this.xmax-=i,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(t){if(lt(t))return!1;t.type==="mesh"&&(t=t.extent);const e=this.spatialReference,i=t.spatialReference;return e&&i&&!Ca(e,i)&&U8(e,i)&&(t=e.isWebMercator?Q3(t):vL(t,!0)),CUe(t.type)(this,t)}normalize(){const t=this._normalize(!1,!0);return Array.isArray(t)?t:[t]}offset(t,e,i){return this.xmin+=t,this.ymin+=e,this.xmax+=t,this.ymax+=e,i!=null&&(this.zmin+=i,this.zmax+=i),this}shiftCentralMeridian(){return this._normalize(!0)}union(t){return this===t||(this.xmin=Math.min(this.xmin,t.xmin),this.ymin=Math.min(this.ymin,t.ymin),this.xmax=Math.max(this.xmax,t.xmax),this.ymax=Math.max(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=eR(Math.min,this.zmin,t.zmin),this.zmax=eR(Math.max,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=eR(Math.min,this.mmin,t.mmin),this.mmax=eR(Math.max,this.mmax,t.mmax))),this}intersection(t){return this===t?this:lt(t)||!this.intersects(t)?null:(this.xmin=Math.max(this.xmin,t.xmin),this.ymin=Math.max(this.ymin,t.ymin),this.xmax=Math.min(this.xmax,t.xmax),this.ymax=Math.min(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=eR(Math.max,this.zmin,t.zmin),this.zmax=eR(Math.min,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=eR(Math.max,this.mmin,t.mmin),this.mmax=eR(Math.min,this.mmax,t.mmax)),this)}toJSON(t){return this.write({},t)}_shiftCM(t=pd(this.spatialReference)){if(!t||!this.spatialReference)return this;const e=this.spatialReference,i=this._getCM(t);if(i){const r=e.isWebMercator?vL(i):i;this.xmin-=i.x,this.xmax-=i.x,e.isWebMercator||(r.x=this._normalizeX(r.x,t).x),this.spatialReference=new rr(Kx((e.isWGS84?t.altTemplate:null)??t.wkTemplate,{Central_Meridian:r.x}))}return this}_getCM(t){let e=null;const[i,r]=t.valid,n=this.xmin,s=this.xmax;return n>=i&&n<=r&&s>=i&&s<=r||(e=this.center),e}_normalize(t,e,i){const r=this.spatialReference;if(!r)return this;const n=i??pd(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 t?this._shiftCM(n):this.set({xmin:n.valid[0],xmax:n.valid[1]});if(t)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 c=[[l.xmin,l.ymin],[l.xmin,l.ymax],[l.xmax,l.ymax],[l.xmax,l.ymin],[l.xmin,l.ymin]];if(o){const d=(l.zmax-l.zmin)/2;for(let p=0;p0;if(a>2*y){const N=new qb(lI||L?e.push({extent:new qb(v,n,y,s,o),frameIds:[S]},{extent:new qb(p,n,I,s,o),frameIds:[O]}):e.push({extent:new qb(v,n,I,s,o),frameIds:[S]});this.cache._parts=e}const i=this.hasZ,r=this.hasM;if(i||r){const n={};i&&(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(t-r)/n),t-=s*n,o=s):t{e.call(null,t)}),[...YH].forEach(e=>{e.call(null,t)}))}globalThis.addEventListener?.("languagechange",i8t);var A1e;const r8t=new Bs({avgRating:"avg-rating",numRatings:"num-ratings",numComments:"num-comments",numViews:"num-views"});let Yb=A1e=class extends fn{constructor(t){super(t),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(t){t!=="asc"&&t!=="desc"||this._set("sortOrder",t)}clone(){return new A1e({categories:this.categories?hi(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(t,e){let i=[];this.categories&&(i=this.categories.map(o=>Array.isArray(o)?JSON.stringify(o):o));let r="";if(this.extent){const o=yL(this.extent,rr.WGS84);ye(o)&&(r=`${o.xmin},${o.ymin},${o.xmax},${o.ymax}`)}let n=this.query;!this.disableExtraQuery&&t.extraQuery&&(n="("+n+")"+t.extraQuery);const s={categories:i,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=>r8t.toJSON(o.trim())).join(","),s.sortOrder=this.sortOrder),{query:{...e,...s}}}};E([k()],Yb.prototype,"categories",void 0),E([k()],Yb.prototype,"disableExtraQuery",void 0),E([k({type:vr})],Yb.prototype,"extent",void 0),E([k()],Yb.prototype,"filter",void 0),E([k()],Yb.prototype,"num",void 0),E([k()],Yb.prototype,"query",void 0),E([k()],Yb.prototype,"sortField",void 0),E([k()],Yb.prototype,"sortOrder",null),E([k()],Yb.prototype,"start",void 0),Yb=A1e=E([ht("esri.portal.PortalQueryParams")],Yb);const nA=Yb;let SL=class extends fn{constructor(e){super(e),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};E([k()],SL.prototype,"nextQueryParams",void 0),E([k()],SL.prototype,"queryParams",void 0),E([k()],SL.prototype,"results",void 0),E([k()],SL.prototype,"total",void 0),SL=E([ht("esri.portal.PortalQueryResult")],SL);const n8t=SL;let sA=class extends Ni{constructor(e){super(e),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){const e=this.get("portal.restUrl");return e?`${e}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new st("internal:not-yet-implemented","PortalFolder.toJSON is not yet implemented")}};E([k({type:Date})],sA.prototype,"created",void 0),E([k()],sA.prototype,"id",void 0),E([k()],sA.prototype,"portal",void 0),E([k()],sA.prototype,"title",void 0),E([k({readOnly:!0})],sA.prototype,"url",null),E([k()],sA.prototype,"username",void 0),sA=E([ht("esri.portal.PortalFolder")],sA);const s8t=sA;let Sm=class extends Ni{constructor(e){super(e),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.tags=null,this.title=null}get thumbnailUrl(){const e=this.url,i=this.thumbnail;return e&&i&&this.portal?this.portal?.normalizeUrl(`${e}/info/${i}?f=json`):null}get url(){const e=this.get("portal.restUrl");return e?e+"/community/groups/"+this.id:null}fetchCategorySchema(e){return _u(this.portal).request(this.url+"/categorySchema",e).then(i=>{const r=i.categorySchema||[];return r.some(n=>n.source==="contentCategorySetsGroupQuery.LivingAtlas")?this._fetchCategorySchemaSet("LivingAtlas",e):r})}fetchMembers(e){return _u(this.portal).request(this.url+"/users",e)}getThumbnailUrl(e){let i=this.thumbnailUrl;return i&&e&&(i+=`&w=${e}`),i}toJSON(){throw new st("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}queryItems(e,i){let r=ud(nA,e);const n=_u(this.portal);return parseFloat(n.currentVersion)>5?(r=r||new nA,n.queryPortal(`/content/groups/${this.id}/search`,r,"PortalItem",i)):(r=r?r.clone():new nA,r.query="group:"+this.id+(r.query?" "+r.query:""),n.queryItems(r,i))}_fetchCategorySchemaSet(e,i){const r=_u(this.portal);return r.fetchSelf(r.authMode,!0,i).then(n=>{const s=n.contentCategorySetsGroupQuery;if(s){const o=new nA;return o.disableExtraQuery=!0,o.num=1,o.query=s,r.queryGroups(o,i)}throw new st("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery value not found")}).then(n=>{if(n.total){const s=n.results[0],o=new nA;return o.num=1,o.query=`typekeywords:"${e}"`,s.queryItems(o,i)}throw new st("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery group not found")}).then(n=>n.total?n.results[0].fetchData("json",i).then(s=>{const o=s&&s.categorySchema;return o&&o.length?o:[]}):[])}};E([k()],Sm.prototype,"access",void 0),E([k({type:Date})],Sm.prototype,"created",void 0),E([k()],Sm.prototype,"description",void 0),E([k()],Sm.prototype,"id",void 0),E([k()],Sm.prototype,"isInvitationOnly",void 0),E([k({type:Date})],Sm.prototype,"modified",void 0),E([k()],Sm.prototype,"owner",void 0),E([k()],Sm.prototype,"portal",void 0),E([k()],Sm.prototype,"snippet",void 0),E([k()],Sm.prototype,"sortField",void 0),E([k()],Sm.prototype,"sortOrder",void 0),E([k()],Sm.prototype,"tags",void 0),E([k()],Sm.prototype,"thumbnail",void 0),E([k({readOnly:!0})],Sm.prototype,"thumbnailUrl",null),E([k()],Sm.prototype,"title",void 0),E([k({readOnly:!0})],Sm.prototype,"url",null),Sm=E([ht("esri.portal.PortalGroup")],Sm);const P1e=Sm,o8t=Object.freeze(Object.defineProperty({__proto__:null,default:P1e},Symbol.toStringTag,{value:"Module"}));var O1e;let Bh=O1e=class extends Ni{constructor(...t){super(...t),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 t=this.url,e=this.thumbnail;return t&&e?this.portal.normalizeUrl(`${t}/info/${e}?f=json`):null}get userContentUrl(){const t=this.get("portal.restUrl");return t?`${t}/content/users/${this.username}`:null}get url(){const t=this.get("portal.restUrl");return t?`${t}/community/users/${this.username}`:null}addItem(t){const e=t&&t.item,i=t&&t.data,r=t&&t.folder,n={method:"post"};e&&(n.query=e.createPostQuery(),i!=null&&(typeof i=="string"?n.query.text=i:typeof i=="object"&&(n.query.text=JSON.stringify(i))));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(t){let e=this.userContentUrl;return t.ownerFolder&&(e+="/"+t.ownerFolder),this.portal.request(e+`/items/${t.id}/delete`,{method:"post"}).then(()=>{t.id=null,t.portal=null})}deleteItems(t){const e=this.userContentUrl+"/deleteItems",i=t.map(r=>r.id);if(i.length){const r={method:"post",query:{items:i.join(",")}};return this.portal.request(e,r).then(()=>{t.forEach(n=>{n.id=null,n.portal=null})})}return Promise.resolve(void 0)}fetchFolders(){const t={query:{num:1}};return this.portal.request(this.userContentUrl??"",t).then(e=>{let i;return i=e&&e.folders?e.folders.map(r=>{const n=s8t.fromJSON(r);return n.portal=this.portal,n}):[],i})}fetchGroups(){return this.portal.request(this.url??"").then(t=>{let e;return e=t&&t.groups?t.groups.map(i=>{const r=P1e.fromJSON(i);return r.portal=this.portal,r}):[],e})}fetchItems(t){const e=t??{};let i,r=this.userContentUrl??"";return e.folder&&(r+="/"+e.folder.id),Promise.resolve().then(()=>AUe).then(({default:n})=>{i=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&&n.items?(s=n.items.map(o=>{const a=i.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(t=>t.tags)}getThumbnailUrl(t){let e=this.thumbnailUrl;return e&&t&&(e+=`&w=${t}`),e}queryFavorites(t){return this.favGroupId?(this._favGroup||(this._favGroup=new P1e({id:this.favGroupId,portal:this.portal})),this._favGroup.queryItems(t)):Promise.reject(new st("internal:unknown","Unknown internal error",{internalError:"Unknown favGroupId"}))}toJSON(){throw new st("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");const e=new O1e;return e.sourceJSON=t,e.read(t),e}};E([k()],Bh.prototype,"access",void 0),E([k({type:Date})],Bh.prototype,"created",void 0),E([k()],Bh.prototype,"culture",void 0),E([k()],Bh.prototype,"description",void 0),E([k()],Bh.prototype,"email",void 0),E([k()],Bh.prototype,"favGroupId",void 0),E([k()],Bh.prototype,"fullName",void 0),E([k({type:Date})],Bh.prototype,"modified",void 0),E([k()],Bh.prototype,"orgId",void 0),E([k()],Bh.prototype,"portal",void 0),E([k()],Bh.prototype,"preferredView",void 0),E([k()],Bh.prototype,"privileges",void 0),E([k()],Bh.prototype,"region",void 0),E([k()],Bh.prototype,"role",void 0),E([k()],Bh.prototype,"roleId",void 0),E([k()],Bh.prototype,"sourceJSON",void 0),E([k()],Bh.prototype,"thumbnail",void 0),E([k({readOnly:!0})],Bh.prototype,"thumbnailUrl",null),E([k()],Bh.prototype,"units",void 0),E([k({readOnly:!0})],Bh.prototype,"userContentUrl",null),E([k({readOnly:!0})],Bh.prototype,"url",null),E([k()],Bh.prototype,"username",void 0),E([k()],Bh.prototype,"userType",void 0),Bh=O1e=E([ht("esri.portal.PortalUser")],Bh);const R1e=Bh,a8t=Object.freeze(Object.defineProperty({__proto__:null,default:R1e},Symbol.toStringTag,{value:"Module"}));var A1;let M1e;const IUe={PortalGroup:()=>Promise.resolve().then(()=>o8t),PortalItem:()=>Promise.resolve().then(()=>AUe),PortalUser:()=>Promise.resolve().then(()=>a8t)};let Cn=A1=class extends z0(hd){constructor(t){super(t),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=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.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=na.portalUrl,this.urlKey=null,this.user=null,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(t){return typeof t=="string"?{url:t}:t}destroy(){this._esriIdCredentialCreateHandle=Bc(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(t){if(t)for(const e of t)na.request.trustedServers.includes(e)||na.request.trustedServers.push(e);return t}readDefaultBasemap(t){return this._readBasemap(t)}readDefaultDevBasemap(t){return this._readBasemap(t)}readDefaultVectorBasemap(t){return this._readBasemap(t)}get extraQuery(){const t=!(this.user&&this.user.orgId)||this.canSearchPublic;return this.id&&!t?` AND orgid:${this.id}`:null}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get restUrl(){let t=this.url;if(t){const e=t.indexOf("/sharing");t=e>0?t.substring(0,e):this.url.replace(/\/+$/,""),t+="/sharing/rest"}return t}get thumbnailUrl(){const t=this.restUrl,e=this.thumbnail;return t&&e?this._normalizeSSL(t+"/portals/self/resources/"+e):null}readUrlKey(t){return t&&t.toLowerCase()}readUser(t){let e=null;return t&&(e=R1e.fromJSON(t),e.portal=this),e}load(t){const e=Promise.resolve().then(()=>O8t).then(({default:i})=>{sn(t),M1e=i}).then(()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,t)).then(i=>{if(Ro){const r=Ro;this.credential=r.findCredential(this.restUrl),this.credential||this.authMode!==A1.AUTH_MODE_AUTO||(this._esriIdCredentialCreateHandle=r.on("credential-create",()=>{r.findCredential(this.restUrl)&&this.signIn().catch(()=>{})}))}this.sourceJSON=i,this.read(i)});return this.addResolvingPromise(e),Promise.resolve(this)}async createElevationLayers(){await this.load();const t=this._getHelperService("defaultElevationLayers"),e=(await Promise.resolve().then(()=>Vdt)).default;return t?t.map(i=>new e({id:i.id,url:i.url})):[]}fetchBasemaps(t,e){const i=new nA;return i.query=t||(na.apiKey&&aUe(this.url)?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),i.disableExtraQuery=!0,this.queryGroups(i,e).then(r=>{if(i.num=100,i.query='type:"Web Map" -type:"Web Application"',r.total){const n=r.results[0];return i.sortField=n.sortField||"name",i.sortOrder=n.sortOrder||"desc",n.queryItems(i,e)}return null}).then(r=>{let n;return n=r&&r.total?r.results.filter(s=>s.type==="Web Map").map(s=>new M1e({portalItem:s})):[],n})}fetchCategorySchema(t){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",t).then(e=>e.categorySchema):bm(t)?Promise.reject(vc()):Promise.resolve([])}fetchFeaturedGroups(t){const e=this.featuredGroups,i=new nA;if(i.num=100,i.sortField="title",e&&e.length){const r=[];for(const n of e)r.push(`(title:"${n.title}" AND owner:${n.owner})`);return i.query=r.join(" OR "),this.queryGroups(i,t).then(n=>n.results)}return bm(t)?Promise.reject(vc()):Promise.resolve([])}fetchRegions(t){const e=this.user?.culture||this.culture||Y0();return this.request(this.restUrl+"/portals/regions",{...t,query:{culture:e}})}fetchSettings(t){const e=this.user?.culture||this.culture||Y0();return this.request(this.restUrl+"/portals/self/settings",{...t,query:{culture:e}})}static getDefault(){return A1._default&&!A1._default.destroyed||(A1._default=new A1),A1._default}queryGroups(t,e){return this.queryPortal("/community/groups",t,"PortalGroup",e)}queryItems(t,e){return this.queryPortal("/search",t,"PortalItem",e)}queryUsers(t,e){return t.sortField||(t.sortField="username"),this.queryPortal("/community/users",t,"PortalUser",e)}fetchSelf(t=this.authMode,e=!1,i){const r=this.restUrl+"/portals/self",n={authMode:t,query:{culture:Y0().toLowerCase()},...i};return n.authMode==="auto"&&(n.authMode="no-prompt"),e&&(n.query.default=!0),this.request(r,n)}queryPortal(t,e,i,r){const n=ud(nA,e),s=o=>this.request(this.restUrl+t,{...n.toRequestOptions(this),...r}).then(a=>{const l=n.clone();return l.start=a.nextStart,new n8t({nextQueryParams:l,queryParams:n,total:a.total,results:A1._resultsToTypedArray(o,{portal:this},a,r)})}).then(a=>Promise.all(a.results.map(l=>typeof l.when=="function"?l.when():a)).then(()=>a,l=>(Ga(l),a)));return i&&IUe[i]?IUe[i]().then(({default:o})=>(sn(r),s(o))):s()}signIn(){if(this.authMode===A1.AUTH_MODE_ANONYMOUS)return Promise.reject(new st("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if(this.loadStatus==="failed")return Promise.reject(this.loadError);const t=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(i=>{i&&(this.sourceJSON=i,this.read(i))});return Ro?Ro.getCredential(this.restUrl).then(e=>t(e)):t(this.credential)}normalizeUrl(t){const e=this.credential&&this.credential.token;return this._normalizeSSL(e?t+(t.includes("?")?"&":"?")+"token="+e:t)}requestToTypedArray(t,e,i){return this.request(t,e).then(r=>{const n=A1._resultsToTypedArray(i,{portal:this},r);return Promise.all(n.map(s=>typeof s.when=="function"?s.when():r)).then(()=>n,()=>n)})}request(t,e={}){const i={f:"json",...e.query},{authMode:r=this.authMode===A1.AUTH_MODE_ANONYMOUS?"anonymous":"auto",body:n=null,cacheBust:s=!1,method:o="auto",responseType:a="json",signal:l}=e,c={authMode:r,body:n,cacheBust:s,method:o,query:i,responseType:a,timeout:0,signal:l};return ir(this._normalizeSSL(t),c).then(d=>d.data)}toJSON(){throw new st("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");return new A1({sourceJSON:t})}_getHelperService(t){const e=this.helperServices&&this.helperServices[t];if(!e)throw new st("portal:service-not-found",`The \`helperServices\` do not include an entry named "${t}"`);return e}_normalizeSSL(t){return t.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(t){if(t){const e=M1e.fromJSON(t);return e.portalItem={portal:this},e}return null}static _resultsToTypedArray(t,e,i,r){let n=[];if(i){const s=ye(r)?r.signal:null;n=i.listings||i.notifications||i.userInvitations||i.tags||i.items||i.groups||i.comments||i.provisions||i.results||i.relatedItems||i,(t||e)&&(n=n.map(o=>{const a=Object.assign(t?t.fromJSON(o):o,e);return typeof a.load=="function"&&a.load(s),a}))}else n=[];return n}};Cn.AUTH_MODE_ANONYMOUS="anonymous",Cn.AUTH_MODE_AUTO="auto",Cn.AUTH_MODE_IMMEDIATE="immediate",E([k()],Cn.prototype,"access",void 0),E([k()],Cn.prototype,"allSSL",void 0),E([k()],Cn.prototype,"authMode",void 0),E([k()],Cn.prototype,"authorizedCrossOriginDomains",void 0),E([Li("authorizedCrossOriginDomains")],Cn.prototype,"readAuthorizedCrossOriginDomains",null),E([k()],Cn.prototype,"basemapGalleryGroupQuery",void 0),E([k()],Cn.prototype,"bingKey",void 0),E([k()],Cn.prototype,"canListApps",void 0),E([k()],Cn.prototype,"canListData",void 0),E([k()],Cn.prototype,"canListPreProvisionedItems",void 0),E([k()],Cn.prototype,"canProvisionDirectPurchase",void 0),E([k()],Cn.prototype,"canSearchPublic",void 0),E([k()],Cn.prototype,"canShareBingPublic",void 0),E([k()],Cn.prototype,"canSharePublic",void 0),E([k()],Cn.prototype,"canSignInArcGIS",void 0),E([k()],Cn.prototype,"canSignInIDP",void 0),E([k()],Cn.prototype,"colorSetsGroupQuery",void 0),E([k()],Cn.prototype,"commentsEnabled",void 0),E([k({type:Date})],Cn.prototype,"created",void 0),E([k()],Cn.prototype,"credential",void 0),E([k()],Cn.prototype,"culture",void 0),E([k()],Cn.prototype,"currentVersion",void 0),E([k()],Cn.prototype,"customBaseUrl",void 0),E([k()],Cn.prototype,"defaultBasemap",void 0),E([Li("defaultBasemap")],Cn.prototype,"readDefaultBasemap",null),E([k()],Cn.prototype,"defaultDevBasemap",void 0),E([Li("defaultDevBasemap")],Cn.prototype,"readDefaultDevBasemap",null),E([k({type:vr})],Cn.prototype,"defaultExtent",void 0),E([k()],Cn.prototype,"defaultVectorBasemap",void 0),E([Li("defaultVectorBasemap")],Cn.prototype,"readDefaultVectorBasemap",null),E([k()],Cn.prototype,"description",void 0),E([k()],Cn.prototype,"devBasemapGalleryGroupQuery",void 0),E([k()],Cn.prototype,"eueiEnabled",void 0),E([k({readOnly:!0})],Cn.prototype,"extraQuery",null),E([k()],Cn.prototype,"featuredGroups",void 0),E([k()],Cn.prototype,"featuredItemsGroupQuery",void 0),E([k()],Cn.prototype,"galleryTemplatesGroupQuery",void 0),E([k()],Cn.prototype,"livingAtlasGroupQuery",void 0),E([k()],Cn.prototype,"hasCategorySchema",void 0),E([k()],Cn.prototype,"helpBase",void 0),E([k()],Cn.prototype,"helperServices",void 0),E([k()],Cn.prototype,"helpMap",void 0),E([k()],Cn.prototype,"homePageFeaturedContent",void 0),E([k()],Cn.prototype,"homePageFeaturedContentCount",void 0),E([k()],Cn.prototype,"httpPort",void 0),E([k()],Cn.prototype,"httpsPort",void 0),E([k()],Cn.prototype,"id",void 0),E([k()],Cn.prototype,"ipCntryCode",void 0),E([k({readOnly:!0})],Cn.prototype,"isOrganization",null),E([k()],Cn.prototype,"isPortal",void 0),E([k()],Cn.prototype,"isReadOnly",void 0),E([k({readOnly:!0})],Cn.prototype,"itemPageUrl",null),E([k()],Cn.prototype,"layerTemplatesGroupQuery",void 0),E([k()],Cn.prototype,"maxTokenExpirationMinutes",void 0),E([k({type:Date})],Cn.prototype,"modified",void 0),E([k()],Cn.prototype,"name",void 0),E([k()],Cn.prototype,"portalHostname",void 0),E([k()],Cn.prototype,"portalMode",void 0),E([k()],Cn.prototype,"portalProperties",void 0),E([k()],Cn.prototype,"region",void 0),E([k({readOnly:!0})],Cn.prototype,"restUrl",null),E([k()],Cn.prototype,"rotatorPanels",void 0),E([k()],Cn.prototype,"showHomePageDescription",void 0),E([k()],Cn.prototype,"sourceJSON",void 0),E([k()],Cn.prototype,"staticImagesUrl",void 0),E([k({json:{name:"2DStylesGroupQuery"}})],Cn.prototype,"stylesGroupQuery2d",void 0),E([k({json:{name:"stylesGroupQuery"}})],Cn.prototype,"stylesGroupQuery3d",void 0),E([k()],Cn.prototype,"supportsHostedServices",void 0),E([k()],Cn.prototype,"symbolSetsGroupQuery",void 0),E([k()],Cn.prototype,"templatesGroupQuery",void 0),E([k()],Cn.prototype,"thumbnail",void 0),E([k({readOnly:!0})],Cn.prototype,"thumbnailUrl",null),E([k()],Cn.prototype,"units",void 0),E([k()],Cn.prototype,"url",void 0),E([k()],Cn.prototype,"urlKey",void 0),E([Li("urlKey")],Cn.prototype,"readUrlKey",null),E([k()],Cn.prototype,"user",void 0),E([Li("user")],Cn.prototype,"readUser",null),E([k()],Cn.prototype,"useStandardizedQuery",void 0),E([k()],Cn.prototype,"useVectorBasemaps",void 0),E([k()],Cn.prototype,"vectorBasemapGalleryGroupQuery",void 0),Cn=A1=E([ht("esri.portal.Portal")],Cn);const _c=Cn,l8t=Ei.getLogger("esri.assets");function zl(t){if(!na.assetsPath)throw l8t.errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new st("assets:path-not-set","config.assetsPath is not set");return dd(na.assetsPath,t)}let tR=class extends fn{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e&&e.portalItem&&e.path?{...e,path:this._normalizePath(e.path,e.portalItem)}:e}set path(e){ye(e)&&jg(e)?Ei.getLogger(this.declaredClass).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 itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",i){const r=this.url;if(lt(r))throw new st("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:qx(i,"signal")})}async update(e,i){return(await Promise.resolve().then(()=>zK)).addOrUpdateResource(this,"update",e,i)}hasPath(){return ye(this.path)}_normalizePath(e,i){return lt(e)?e:(e=e.replace(/^\/+/,""),ye(i)&&jg(e)&&(e=ine(e,i.itemUrl)),e?.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}};E([k()],tR.prototype,"portalItem",void 0),E([k({type:String,value:null})],tR.prototype,"path",null),E([Zs("path")],tR.prototype,"_castPath",null),E([k({type:String,readOnly:!0})],tR.prototype,"url",null),E([k({type:String,readOnly:!0})],tR.prototype,"itemRelativeUrl",null),tR=E([ht("esri.portal.PortalItemResource")],tR);const u8t=tR;let XH=class extends fn{constructor(e){super(e),this.created=null,this.rating=null}};E([k()],XH.prototype,"created",void 0),E([k()],XH.prototype,"rating",void 0),XH=E([ht("esri.portal.PortalRating")],XH);const D1e=XH;var CL;const c8t=new Set(["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","GeoJson","CSV","KML","WFS","WMTS","WMS","Feed"]),h8t=new Set(["KML","GeoJson","CSV"]);let Aa=CL=class extends z0(hd){static from(t){return kd(CL,t)}constructor(t){super(t),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 t=this.type,e=this.typeKeywords||[];let i=t;return t==="Feature Service"||t==="Feature Collection"?i=e.includes("Table")?"Table":e.includes("Route Layer")?"Route Layer":e.includes("Markup")?"Markup":"Feature Layer":t==="Image Service"?i=e.includes("Elevation 3D Layer")?"Elevation Layer":e.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":t==="Scene Service"?i="Scene Layer":t==="Video Service"?i="Video Layer":t==="Scene Package"?i="Scene Layer Package":t==="Stream Service"?i="Feature Layer":t==="Geoprocessing Service"&&this.portal&&this.portal.isPortal?i=e.includes("Web Tool")?"Tool":"Geoprocessing Service":t==="Geocoding Service"?i="Locator":t==="Geoenrichment Service"?i="GeoEnrichment Service":t==="Microsoft Powerpoint"?i="Microsoft PowerPoint":t==="GeoJson"?i="GeoJSON":t==="Globe Service"?i="Globe Layer":t==="Vector Tile Service"?i="Tile Layer":t==="netCDF"?i="NetCDF":t==="Map Service"?i=e.includes("Spatiotemporal")||!e.includes("Hosted Service")&&!e.includes("Tiled")||e.includes("Relational")?"Map Image Layer":"Tile Layer":t&&t.toLowerCase().includes("add in")?i=t.replace(/(add in)/gi,"Add-In"):t==="datastore catalog service"?i="Big Data File Share":t==="Compact Tile Package"?i="Tile Package (tpkx)":t==="OGCFeatureServer"?i="OGC Feature Layer":t==="web mapping application"&&e.includes("configurableApp")?i="Instant App":t==="Insights Page"&&(i="Insights Report"),i}readExtent(t){return t&&t.length?new vr(t[0][0],t[0][1],t[1][0],t[1][1]):null}get iconUrl(){const t=this.type&&this.type.toLowerCase()||"",e=this.typeKeywords||[],i="esri/images/portal/",r="16";let n,s=!1,o=!1,a=!1,l=!1,c=!1,d=!1;return t.indexOf("service")>0||t==="feature collection"||t==="kml"||t==="wms"||t==="wmts"||t==="wfs"?(s=e.includes("Hosted Service"),t==="feature service"||t==="feature collection"||t==="kml"||t==="wfs"?(o=e.includes("Table"),a=e.includes("Route Layer"),l=e.includes("Markup"),c=e.includes("Spatiotemporal"),d=e.includes("UtilityNetwork"),n=c&&o?"spatiotemporaltable":o?"table":a?"routelayer":l?"markup":c?"spatiotemporal":s?"featureshosted":d?"utilitynetwork":"features"):n=t==="map service"||t==="wms"||t==="wmts"?s||e.includes("Tiled")||t==="wmts"?"maptiles":"mapimages":t==="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":t==="image service"?e.includes("Elevation 3D Layer")?"elevationlayer":e.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":t==="stream service"?"streamlayer":t==="video service"?"mediaservice":t==="vector tile service"?"vectortile":t==="datastore catalog service"?"datastorecollection":t==="geocoding service"?"geocodeservice":t==="geoprocessing service"?e.includes("Web Tool")&&this.portal&&this.portal.isPortal?"tool":"layers":t==="geodata service"?"geodataservice":"layers"):n=t==="web map"||t==="cityengine web scene"?"maps":t==="web scene"?e.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":t==="web mapping application"&&e.includes("configurableApp")?"instantapps":t==="web mapping application"||t==="mobile application"||t==="application"||t==="operation view"||t==="desktop application"?"apps":t==="map document"||t==="map package"||t==="published map"||t==="scene document"||t==="globe document"||t==="basemap package"||t==="mobile basemap package"||t==="mobile map package"||t==="project package"||t==="project template"||t==="pro map"||t==="layout"||t==="layer"&&e.includes("ArcGIS Pro")||t==="explorer map"&&e.indexOf("Explorer Document")?"mapsgray":t==="service definition"||t==="csv"||t==="shapefile"||t==="cad drawing"||t==="geojson"||t==="360 vr experience"||t==="netcdf"||t==="administrative report"?"datafiles":t==="explorer add in"||t==="desktop add in"||t==="windows viewer add in"||t==="windows viewer configuration"?"appsgray":t==="arcgis pro add in"||t==="arcgis pro configuration"?"addindesktop":t==="rule package"||t==="file geodatabase"||t==="sqlite geodatabase"||t==="csv collection"||t==="kml collection"||t==="windows mobile package"||t==="map template"||t==="desktop application template"||t==="gml"||t==="arcpad package"||t==="code sample"||t==="form"||t==="document link"||t==="earth configuration"||t==="operations dashboard add in"||t==="rules package"||t==="image"||t==="workflow manager package"||t==="explorer map"&&e.includes("Explorer Mapping Application")||e.includes("Document")?"datafilesgray":t==="network analysis service"||t==="geoprocessing service"||t==="geodata service"||t==="geometry service"||t==="geoprocessing package"||t==="locator package"||t==="geoprocessing sample"||t==="workflow manager service"?"toolsgray":t==="layer"||t==="layer package"||t==="explorer layer"?"layersgray":t==="scene package"?"scenepackage":t==="mobile scene package"?"mobilescenepackage":t==="tile package"||t==="compact tile package"?"tilepackage":t==="task file"?"taskfile":t==="report template"?"report-template":t==="statistical data collection"?"statisticaldatacollection":t==="insights workbook"?"workbook":t==="insights model"?"insightsmodel":t==="insights page"?"insightspage":t==="insights theme"?"insightstheme":t==="hub initiative"?"hubinitiative":t==="hubpage"?"hubpage":t==="hub event"?"hubevent":t==="hub site application"?"hubsite":t==="hub project"?"hubproject":t==="relational database connection"?"relationaldatabaseconnection":t==="big data file share"?"datastorecollection":t==="image collection"?"imagecollection":t==="style"?"style":t==="desktop style"?"desktopstyle":t==="dashboard"?"dashboard":t==="raster function template"?"rasterprocessingtemplate":t==="vector tile package"?"vectortilepackage":t==="ortho mapping project"?"orthomappingproject":t==="ortho mapping template"?"orthomappingtemplate":t==="solution"?"solutions":t==="geopackage"?"geopackage":t==="deep learning package"?"deeplearningpackage":t==="real time analytic"?"realtimeanalytics":t==="big data analytic"?"bigdataanalytics":t==="feed"?"feed":t==="excalibur imagery project"?"excaliburimageryproject":t==="notebook"?"notebook":t==="storymap"?"storymap":t==="survey123 add in"?"survey123addin":t==="mission"?"mission":t==="mission report"?"missionreport":t==="quickcapture project"?"quickcaptureproject":t==="pro report"?"proreport":t==="pro report template"?"proreporttemplate":t==="urban model"?"urbanmodel":t==="web experience"?"experiencebuilder":t==="web experience template"?"webexperiencetemplate":t==="experience builder widget"?"experiencebuilderwidget":t==="experience builder widget package"?"experiencebuilderwidgetpackage":t==="workflow"?"workflow":t==="insights script"?"insightsscript":t==="kernel gateway connection"?"kernelgatewayconnection":t==="hub initiative template"?"hubinitiativetemplate":t==="storymap theme"?"storymaptheme":t==="knowledge graph"?"knowledgegraph":t==="native application"?"nativeapp":t==="native application installer"?"nativeappinstaller":t==="link chart"?"linkchart":t==="investigation"?"investigation":t==="ogcfeatureserver"?"features":t==="pro project"?"proproject":t==="insights workbook package"?"insightsworkbookpackage":t==="apache parquet"?"apacheparquet":t==="notebook code snippets"||t==="notebook code snippet library"?"notebookcodesnippets":t==="suitability model"?"suitabilitymodel":t==="esri classifier definition"?"classifierdefinition":t==="esri classification schema"?"classificationschema":t==="insights data engineering workbook"?"dataengineeringworkbook":t==="insights data engineering model"?"dataengineeringmodel":t==="deep learning studio project"?"deeplearningproject":t==="discussion"?"discussion":t==="allsource project"?"allsourceproject":t==="api key"?"apikey":"maps",n?zl(i+n+r+".png"):null}get isLayer(){return this.type!=null&&c8t.has(this.type)}get itemPageUrl(){const t=this.portal?.itemPageUrl;return t&&this.id?`${t}?id=${this.id}`:null}get itemUrl(){const t=this.portal?.restUrl;return t&&this.id?`${t}/content/items/${this.id}`:null}get thumbnailUrl(){const t=this.itemUrl,e=this.thumbnail;return t&&e?this.portal?.normalizeUrl(`${t}/info/${e}?f=json`)??null:null}get userItemUrl(){const t=this.get("portal.restUrl");if(!t)return null;const e=this.owner||this.get("portal.user.username");return e?`${t}/content/users/${this.ownerFolder?`${e}/${this.ownerFolder}`:e}/items/${this.id}`:null}load(t){const e=this.portal??(this.portal=_c.getDefault()),i=e.load(t).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?e.request(this.itemUrl,{signal:ye(t)?t.signal:null,query:{token:this.apiKey}}):{}).then(r=>{this.sourceJSON=r,this.read(r)});return this.addResolvingPromise(i),Promise.resolve(this)}async addRating(t){const e={method:"post",query:{}};return t instanceof D1e&&(t=t.rating),t==null||isNaN(t)||typeof t!="number"||(e.query.rating=t),this.portal?(await this.portal.request(this.itemUrl+"/addRating",e),new D1e({rating:t,created:new Date})):null}clone(){const t={access:this.access,accessInformation:this.accessInformation,applicationProxies:hi(this.applicationProxies),avgRating:this.avgRating,categories:hi(this.categories),created:hi(this.created),culture:this.culture,description:this.description,extent:hi(this.extent),groupCategories:hi(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:hi(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:hi(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:hi(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:hi(this.typeKeywords),url:this.url};this.loaded&&(t.loadStatus="loaded");const e=new CL({sourceJSON:this.sourceJSON}).set(t);return e._set("isOrgItem",this.isOrgItem),e}createPostQuery(){const t=this.toJSON();for(const i of["tags","typeKeywords","categories"])t[i]&&(t[i]=t[i].join(", "));const{extent:e}=t;return e&&(t.extent=JSON.stringify(e)),t}async deleteRating(){await _u(this.portal).request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(t="json",e){return _u(this.portal).request(this.itemUrl+"/data",{responseType:t,...e,query:{token:this.apiKey}})}async fetchRating(t){const e=await _u(this.portal).request(this.itemUrl+"/rating",{query:{token:this.apiKey},...t});return e.rating!=null?(e.created=new Date(e.created),new D1e(e)):null}fetchRelatedItems(t,e){return _u(this.portal).requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...t,token:this.apiKey},...e},CL)}getThumbnailUrl(t){let e=this.thumbnailUrl;return e&&t&&(e+=`&w=${t}`),e}reload(){return _u(this.portal).request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then(t=>(this.sourceJSON=t,this.read(t),this))}update(t){return this.id?this.load().then(()=>_u(this.portal).signIn()).then(()=>{const e=t&&t.data,i={method:"post"};i.query=this.createPostQuery();for(const r in i.query)i.query[r]===null&&(i.query[r]="");return i.query.clearEmptyFields=!0,e!=null&&(typeof e=="string"?i.query.text=e:typeof e=="object"&&(i.query.text=JSON.stringify(e))),this.portal.request(`${this.userItemUrl}/update`,i).then(()=>this.reload())}):Promise.reject(new st("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(t){if(!this.id)throw new st("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:e,itemUrl:i}=this;await _u(e).signIn();const{copyResources:r,folder:n,tags:s,title:o}=t||{},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(`${i}/copy`,a);return new CL({id:l,portal:e})}updateThumbnail(t){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const e=t.thumbnail,i=t.filename,r={method:"post"};if(typeof e=="string")E1(e)?r.query={data:e}:r.query={url:Vy(e)},ye(i)&&(r.query.filename=i);else{const n=new FormData;ye(i)?n.append("file",e,i):n.append("file",e),r.body=n}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,r).then(()=>this.reload())}):Promise.reject(new st("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(t={},e){return(await Promise.resolve().then(()=>zK)).fetchResources(this,t,e)}async addResource(t,e,i){const r=await Promise.resolve().then(()=>zK);return t.portalItem=this,r.addOrUpdateResource(t,"add",e,i)}async removeResource(t,e){const i=await Promise.resolve().then(()=>zK);if(t.portalItem&&t.portalItem.itemUrl!==this.itemUrl)throw new st("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return i.removeResource(this,t,e)}async removeAllResources(t){return(await Promise.resolve().then(()=>zK)).removeAllResources(this,t)}resourceFromPath(t){return new u8t({portalItem:this,path:t})}toJSON(){const t=this.extent,e={accessInformation:this.accessInformation,categories:hi(this.categories),created:this.created&&this.created.getTime(),description:this.description,extent:t&&[[t.xmin,t.ymin],[t.xmax,t.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified&&this.modified.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:hi(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:hi(this.typeKeywords),url:this.url};return Tre(e)}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");return new CL({sourceJSON:t})}_getPostQuery(){const t=this.toJSON();for(const e in t)e==="tags"&&t[e]!==null&&(t[e]=t[e].join(", ")),e==="typeKeywords"&&t[e]!==null&&(t[e]=t[e].join(", ")),e==="extent"&&t[e]&&(t[e]=JSON.stringify(t[e]));return t}};E([k({type:["private","shared","org","public"]})],Aa.prototype,"access",void 0),E([k()],Aa.prototype,"accessInformation",void 0),E([k({type:String})],Aa.prototype,"apiKey",void 0),E([k({json:{read:{source:"appProxies"}}})],Aa.prototype,"applicationProxies",void 0),E([k()],Aa.prototype,"avgRating",void 0),E([k()],Aa.prototype,"categories",void 0),E([k({type:Date})],Aa.prototype,"created",void 0),E([k()],Aa.prototype,"culture",void 0),E([k()],Aa.prototype,"description",void 0),E([k({readOnly:!0})],Aa.prototype,"displayName",null),E([k({type:vr})],Aa.prototype,"extent",void 0),E([Li("extent")],Aa.prototype,"readExtent",null),E([k()],Aa.prototype,"groupCategories",void 0),E([k({readOnly:!0})],Aa.prototype,"iconUrl",null),E([k()],Aa.prototype,"id",void 0),E([k({readOnly:!0})],Aa.prototype,"isLayer",null),E([k({type:Boolean,readOnly:!0})],Aa.prototype,"isOrgItem",void 0),E([k()],Aa.prototype,"itemControl",void 0),E([k({readOnly:!0})],Aa.prototype,"itemPageUrl",null),E([k({readOnly:!0})],Aa.prototype,"itemUrl",null),E([k()],Aa.prototype,"licenseInfo",void 0),E([k({type:Date})],Aa.prototype,"modified",void 0),E([k()],Aa.prototype,"name",void 0),E([k()],Aa.prototype,"numComments",void 0),E([k()],Aa.prototype,"numRatings",void 0),E([k()],Aa.prototype,"numViews",void 0),E([k()],Aa.prototype,"owner",void 0),E([k()],Aa.prototype,"ownerFolder",void 0),E([k({type:_c})],Aa.prototype,"portal",void 0),E([k()],Aa.prototype,"screenshots",void 0),E([k()],Aa.prototype,"size",void 0),E([k()],Aa.prototype,"snippet",void 0),E([k()],Aa.prototype,"sourceJSON",void 0),E([k({type:String})],Aa.prototype,"sourceUrl",void 0),E([k({type:String})],Aa.prototype,"spatialReference",void 0),E([k()],Aa.prototype,"tags",void 0),E([k()],Aa.prototype,"thumbnail",void 0),E([k({readOnly:!0})],Aa.prototype,"thumbnailUrl",null),E([k()],Aa.prototype,"title",void 0),E([k()],Aa.prototype,"type",void 0),E([k()],Aa.prototype,"typeKeywords",void 0),E([k({type:String,json:{read(t,e){if(h8t.has(e.type)){const i=this.portal?.restUrl;t||(t=i&&this.id?`${i}/content/items/${this.id}/data`:null)}return t}}})],Aa.prototype,"url",void 0),E([k({readOnly:!0})],Aa.prototype,"userItemUrl",null),Aa=CL=E([ht("esri.portal.PortalItem")],Aa);const X0=Aa,AUe=Object.freeze(Object.defineProperty({__proto__:null,default:X0},Symbol.toStringTag,{value:"Module"})),PUe=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,d8t={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 OUe(t){return d8t[t]??!1}const KH=[],W8=new Map;function RUe(t){for(const e of W8.keys())DUe(t.pattern,e)&&W8.delete(e)}function p8t(t){return KH.includes(t)||(RUe(t),KH.unshift(t)),{remove(){const e=KH.indexOf(t);e>-1&&(KH.splice(e,1),RUe(t))}}}async function MUe(t){const e=Y0();W8.has(t)||W8.set(t,m8t(t,e));const i=W8.get(t);return i&&await g8t.add(i),i}function f8t(t){if(!PUe.test(t))return null;const e=PUe.exec(t);if(e===null)return null;const[,i,r]=e,n=i+(r?"-"+r.toUpperCase():"");return OUe(n)?n:OUe(i)?i:null}async function m8t(t,e){const i=[];for(const r of KH)if(DUe(r.pattern,t))try{return await r.fetchMessageBundle(t,e)}catch(n){i.push(n)}throw i.length?new st("intl:message-bundle-error",`Errors occurred while loading "${t}"`,{errors:i}):new st("intl:no-message-bundle-loader",`No loader found for message bundle "${t}"`)}function DUe(t,e){return typeof t=="string"?e.startsWith(t):t.test(e)}I1e(()=>{W8.clear()});const g8t=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(t){return this._increase(),t.then(()=>this._decrease(),()=>this._decrease()),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=Jx())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&this._numLoading===0&&(this._dfd.resolve(),this._dfd=null)}};async function y8t(t){if(!t)return;const e=t.includes("-vector")?t.slice(0,t.indexOf("-vector")):t,i=await MUe("esri/t9n/basemaps");return i[t]||i[e]}const F1e={streets:{id:"streets",classic:!0,deprecated:!0,get thumbnailUrl(){return zl("esri/images/basemap/streets.jpg")},baseMapLayers:[{id:"streets-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Street Map",showLegend:!1,visibility:!0,opacity:1}]},satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return zl("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 zl("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 zl("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}]},topo:{id:"topo",classic:!0,deprecated:!0,get thumbnailUrl(){return zl("esri/images/basemap/topo.jpg")},baseMapLayers:[{id:"topo-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Topo Map",showLegend:!1,visibility:!0,opacity:1}]},gray:{id:"gray",classic:!0,deprecated:!0,get thumbnailUrl(){return zl("esri/images/basemap/gray.jpg")},baseMapLayers:[{id:"gray-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Light Gray Base",showLegend:!1,visibility:!0,opacity:1},{id:"gray-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Light Gray Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},"dark-gray":{id:"dark-gray",classic:!0,deprecated:!0,get thumbnailUrl(){return zl("esri/images/basemap/dark-gray.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Dark Gray Base",showLegend:!1,visibility:!0,opacity:1},{id:"dark-gray-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Dark Gray Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return zl("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}]},"national-geographic":{id:"national-geographic",classic:!0,deprecated:!0,get thumbnailUrl(){return zl("esri/images/basemap/national-geographic.jpg")},baseMapLayers:[{id:"national-geographic-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer",title:"NatGeo World Map",showLegend:!1,layerType:"ArcGISTiledMapServiceLayer",visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return zl("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 zl("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}]},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return zl("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}]},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return zl("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}]},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return zl("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}]},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return zl("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 zl("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 zl("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}]},"arcgis-imagery":{get thumbnailUrl(){return zl("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 zl("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 zl("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 zl("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 zl("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 zl("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 zl("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 zl("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 zl("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 zl("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}]}};function FUe(t){const e=t?.type;return e==="imagery-tile"||e==="tile"||e==="open-street-map"||e==="vector-tile"||e==="web-tile"||e==="wmts"}function v8t(t){const e=t?.type;return e==="base-tile"||e==="tile"||e==="elevation"||e==="imagery-tile"||e==="base-elevation"||e==="open-street-map"||e==="wcs"||e==="web-tile"||e==="wmts"||e==="vector-tile"}const JH={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function LUe(t){const e=t?.type;return e==="building-scene"||e==="integrated-mesh"||e==="point-cloud"||e==="scene"}function pne(t){return t?.type==="feature"&&!t.url&&t.source?.type==="memory"}function _8t(t){return t?.type==="feature"&&t.source?.type==="feature-layer"}function b8t(t){if(t.activeLayer){const e=t.activeLayer.tileMatrixSet;if(e)return e;const i=t.activeLayer.tileMatrixSets;if(i)return i}return null}async function kUe(t,e){const i=Ro?.findServerInfo(t);if(i?.currentVersion!=null)return i.owningSystemUrl||null;const r=t.toLowerCase().indexOf("/rest/services");if(r===-1)return null;const n=`${t.substring(0,r)}/rest/info`,s=ye(e)?e.signal:null,{data:o}=await ir(n,{query:{f:"json"},responseType:"json",signal:s});return o?.owningSystemUrl||null}function w8t(t){if(!("capabilities"in t))return!1;switch(t.type){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 TL(t){return w8t(t)?"effectiveCapabilities"in t?t.effectiveCapabilities:t.capabilities:null}function x8t(t){if(!("editingEnabled"in t))return!1;switch(t.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function NUe(t){return!!x8t(t)&&("effectiveEditingEnabled"in t?t.effectiveEditingEnabled:t.editingEnabled)}const S8t=new Set(["bing-maps","imagery","imagery-tile","map-image","open-street-map","tile","unknown","unsupported","vector-tile","web-tile","wms","wmts"]),C8t=new Set(["csv","feature","geo-rss","geojson","group","imagery","imagery-tile","kml","map-image","map-notes","media","ogc-feature","route","subtype-group","tile","unknown","unsupported","vector-tile","web-tile","wfs","wms","wmts"]);function T8t(t){return t.layerContainerType==="basemap"?S8t:t.layerContainerType==="operational-layers"?C8t:null}function E8t(t,e){if(e.restrictedWebMapWriting){const i=T8t(e);return!ye(i)||i.has(t.type)&&!pne(t)}return!0}function I8t(t,e){if(e)if(pne(t)){const i=Xx("featureCollection.layers",e),r=i&&i[0]&&i[0].layerDefinition;r&&L1e(t,r)}else t.type==="stream"?L1e(t,e.layerDefinition=e.layerDefinition||{}):t.type!=="group"&&L1e(t,e)}function L1e(t,e){"maxScale"in t&&(e.maxScale=Zre(t.maxScale)??void 0),"minScale"in t&&(e.minScale=Zre(t.minScale)??void 0)}function A8t(t,e){if(I8t(t,e),e&&("blendMode"in t&&(e.blendMode=t.blendMode,e.blendMode==="normal"&&delete e.blendMode),e.opacity=Zre(t.opacity)??void 0,e.title=t.title||"Layer",e.visibility=t.visible,"legendEnabled"in t&&t.type!=="wmts"))if(pne(t)){const i=e.featureCollection;i&&(i.showLegend=t.legendEnabled)}else e.showLegend=t.legendEnabled}function k1e(t,e,i){if(!("write"in t)||!t.write)return i&&i.messages&&i.messages.push(new st("layer:unsupported",`Layers (${t.title}, ${t.id}) of type '${t.declaredClass}' cannot be persisted`,{layer:t})),null;if(E8t(t,i)){const r={};return t.write(r,i)?r:null}return ye(e)&&A8t(t,e=hi(e)),e}var fne;let P8t=0;const $Ue="esri.Basemap";let Xb=fne=class extends z0(hd){constructor(t){super(t),this.id=null,this.portalItem=null,this.spatialReference=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+P8t++,this.baseLayers=new fr,this.referenceLayers=new fr;const e=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type==="elevation"&&Ei.getLogger(this.declaredClass).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a basemap layer and will therefore be ignored.`)},i=r=>{r.parent=null};this.baseLayers.on("after-add",r=>e(r.item)),this.referenceLayers.on("after-add",r=>e(r.item)),this.baseLayers.on("after-remove",r=>i(r.item)),this.referenceLayers.on("after-remove",r=>i(r.item))}initialize(){this.when().catch(t=>{Ei.getLogger(this.declaredClass).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,t)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const t=this.baseLayers.removeAll();for(const i of t)i.destroy();const e=this.referenceLayers.removeAll();for(const i of e)i.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),this.portalItem?.destroy(),this.portalItem=null}normalizeCtorArgs(t){return t&&"resourceInfo"in t&&(this._set("resourceInfo",t.resourceInfo),delete(t={...t}).resourceInfo),t}set baseLayers(t){this._set("baseLayers",rg(t,this._get("baseLayers")))}_writeBaseLayers(t,e,i){const r=[];t&&(i={...i,layerContainerType:"basemap"},this.baseLayers.forEach(n=>{const s=k1e(n,i.webmap?i.webmap.getLayerJSONFromResourceInfo(n):null,i);ye(s)&&r.push(s)}),this.referenceLayers.forEach(n=>{const s=k1e(n,i.webmap?i.webmap.getLayerJSONFromResourceInfo(n):null,i);ye(s)&&(n.type!=="scene"&&(s.isReference=!0),r.push(s))})),e.baseMapLayers=r}set referenceLayers(t){this._set("referenceLayers",rg(t,this._get("referenceLayers")))}writeTitle(t,e){e.title=t||"Basemap"}load(t){return this.addResolvingPromise(this._loadFromSource(t)),Promise.resolve(this)}loadAll(){return dL(this,t=>{t(this.baseLayers,this.referenceLayers)})}clone(){const t={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.slice(),referenceLayers:this.referenceLayers.slice()};return this.loaded&&(t.loadStatus="loaded"),new fne({resourceInfo:this.resourceInfo}).set(t)}read(t,e){this.resourceInfo||this._set("resourceInfo",{data:t,context:e}),super.read(t,e)}write(t,e){return t=t||{},e&&e.origin||(e={origin:"web-map",...e}),super.write(t,e),!this.loaded&&this.resourceInfo&&this.resourceInfo.data.baseMapLayers&&(t.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(i=>{const r=hi(i);return r.url&&I1(r.url)&&(r.url=`https:${r.url}`),r.templateUrl&&I1(r.templateUrl)&&(r.templateUrl=`https:${r.templateUrl}`),r})),t}async _loadFromSource(t){const{resourceInfo:e,portalItem:i}=this;sn(t);const r=[];if(e){const n=e.context?e.context.url:null;if(r.push(this._loadLayersFromJSON(e.data,n,t)),e.data.id&&!e.data.title){const s=e.data.id;r.push(y8t(s).then(o=>{o&&this.read({title:o},e.context)}))}}else i&&r.push(this._loadFromItem(i,t));await Promise.all(r)}async _loadLayersFromJSON(t,e,i){const r=this.resourceInfo&&this.resourceInfo.context,n=this.portalItem&&this.portalItem.portal||r&&r.portal||null,s=r&&r.origin==="web-scene"?"web-scene":"web-map",{populateOperationalLayers:o}=await Promise.resolve().then(()=>ept),a=[];if(sn(i),t.baseMapLayers&&Array.isArray(t.baseMapLayers)){const l={context:{origin:s,url:e,portal:n,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},c=y=>s==="web-scene"&&y.layerType==="ArcGISSceneServiceLayer"||y.isReference,d=o(this.baseLayers,t.baseMapLayers.filter(y=>!c(y)),l);a.push(d);const p=o(this.referenceLayers,t.baseMapLayers.filter(c),l);a.push(p)}await bu(a)}async _loadFromItem(t,e){const i=await t.load(e),r=await i.fetchData("json",e),n=sa(t.itemUrl??"");return this._set("resourceInfo",{data:r.baseMap??{},context:{origin:t.type==="Web Scene"?"web-scene":"web-map",portal:t.portal||_c.getDefault(),url:n}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:r.spatialReference},this.resourceInfo.context),this.read({title:t.title,thumbnailUrl:t.thumbnailUrl},{origin:"portal-item",portal:t.portal||_c.getDefault(),url:n}),this._loadLayersFromJSON(this.resourceInfo.data,n,e)}static fromId(t){const e=F1e[t];if(e){if(e.deprecated){let i=null;t==="dark-gray"?i="dark-gray-vector":t==="gray"?i="gray-vector":t==="streets"?i="streets-vector":t==="topo"&&(i="topo-vector"),$Ge(Ei.getLogger($Ue),`The ${t} basemap has entered mature support and is no longer being updated.`,{replacement:i,see:"https://arcg.is/1iq8aD",warnOnce:!0})}return fne.fromJSON(e)}return null}};E([k({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(t,e,i,r){this._writeBaseLayers(t,e,r)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:fr}},writer(t,e,i,r){this._writeBaseLayers(t,e,r)}}}}}})],Xb.prototype,"baseLayers",null),E([k({type:String,json:{origins:{"web-scene":{write:!0}}}})],Xb.prototype,"id",void 0),E([k({type:X0})],Xb.prototype,"portalItem",void 0),E([k()],Xb.prototype,"referenceLayers",null),E([k({readOnly:!0})],Xb.prototype,"resourceInfo",void 0),E([k({type:rr})],Xb.prototype,"spatialReference",void 0),E([k()],Xb.prototype,"thumbnailUrl",void 0),E([k({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],Xb.prototype,"title",void 0),E([mr("title")],Xb.prototype,"writeTitle",null),Xb=fne=E([ht($Ue)],Xb);const iR=Xb,O8t=Object.freeze(Object.defineProperty({__proto__:null,default:iR},Symbol.toStringTag,{value:"Module"})),mne={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 BUe(t){return mne[t]||mne[t.toLowerCase()]}function N1e(t){return mne[t]??mne[t.toLowerCase()]}function R8t(t){return[...N1e(t)]}function $1e(t,e,i){i<0&&++i,i>1&&--i;const r=6*i;return r<1?t+(e-t)*r:2*i<1?e:3*i<2?t+(e-t)*(.6666666666666666-i)*6:t}function GUe(t,e,i,r=1){const n=(t%360+360)%360/360,s=i<=.5?i*(e+1):i+e-i*e,o=2*i-s;return[Math.round(255*$1e(o,s,n+.3333333333333333)),Math.round(255*$1e(o,s,n)),Math.round(255*$1e(o,s,n-.3333333333333333)),r]}function M8t(t){const e=t.length>5,i=e?8:4,r=(1<>=i,a[3]=n*l/255),l=o&r,o>>=i,a[2]=n*l,l=o&r,o>>=i,a[1]=n*l,l=o&r,o>>=i,a[0]=n*l,a}function Qr(){return[0,0,0]}function Ff(t){return[t[0],t[1],t[2]]}function Ma(t,e,i){return[t,e,i]}function gne(t){const e=Qr(),i=Math.min(3,t.length);for(let r=0;r0&&(s=1/Math.sqrt(s),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s),t}function Kb(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function t2(t,e,i){const r=e[0],n=e[1],s=e[2],o=i[0],a=i[1],l=i[2];return t[0]=n*l-s*a,t[1]=s*o-r*l,t[2]=r*a-n*o,t}function eW(t,e,i,r){const n=e[0],s=e[1],o=e[2];return t[0]=n+r*(i[0]-n),t[1]=s+r*(i[1]-s),t[2]=o+r*(i[2]-o),t}function X8t(t,e,i,r,n,s){const o=s*s,a=o*(2*s-3)+1,l=o*(s-2)+s,c=o*(s-1),d=o*(3-2*s);return t[0]=e[0]*a+i[0]*l+r[0]*c+n[0]*d,t[1]=e[1]*a+i[1]*l+r[1]*c+n[1]*d,t[2]=e[2]*a+i[2]*l+r[2]*c+n[2]*d,t}function K8t(t,e,i,r,n,s){const o=1-s,a=o*o,l=s*s,c=a*o,d=3*s*a,p=3*l*o,y=l*s;return t[0]=e[0]*c+i[0]*d+r[0]*p+n[0]*y,t[1]=e[1]*c+i[1]*d+r[1]*p+n[1]*y,t[2]=e[2]*c+i[2]*d+r[2]*p+n[2]*y,t}function J8t(t,e){e=e||1;const i=ZH,r=2*i()*Math.PI,n=2*i()-1,s=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*s,t[1]=Math.sin(r)*s,t[2]=n*e,t}function i2(t,e,i){const r=e[0],n=e[1],s=e[2];return t[0]=i[0]*r+i[4]*n+i[8]*s+i[12],t[1]=i[1]*r+i[5]*n+i[9]*s+i[13],t[2]=i[2]*r+i[6]*n+i[10]*s+i[14],t}function RC(t,e,i){const r=e[0],n=e[1],s=e[2];return t[0]=r*i[0]+n*i[3]+s*i[6],t[1]=r*i[1]+n*i[4]+s*i[7],t[2]=r*i[2]+n*i[5]+s*i[8],t}function Y8(t,e,i){const r=i[0],n=i[1],s=i[2],o=i[3],a=e[0],l=e[1],c=e[2];let d=n*c-s*l,p=s*a-r*c,y=r*l-n*a,v=n*y-s*p,S=s*d-r*y,I=r*p-n*d;const O=2*o;return d*=O,p*=O,y*=O,v*=2,S*=2,I*=2,t[0]=a+d+v,t[1]=l+p+S,t[2]=c+y+I,t}function Z8t(t,e,i,r){const n=[],s=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[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),t[0]=s[0]+i[0],t[1]=s[1]+i[1],t[2]=s[2]+i[2],t}function Q8t(t,e,i,r){const n=[],s=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[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),t[0]=s[0]+i[0],t[1]=s[1]+i[1],t[2]=s[2]+i[2],t}function e9t(t,e,i,r){const n=[],s=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[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],t[0]=s[0]+i[0],t[1]=s[1]+i[1],t[2]=s[2]+i[2],t}function t9t(t,e){Hv(_ne,t),Hv(bne,e),zy(_ne,_ne),zy(bne,bne);const i=Kb(_ne,bne);return i>1?0:i<-1?Math.PI:Math.acos(i)}const _ne=Qr(),bne=Qr();function i9t(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function wne(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function r9t(t,e){if(t===e)return!0;const i=t[0],r=t[1],n=t[2],s=e[0],o=e[1],a=e[2],l=jv();return Math.abs(i-s)<=l*Math.max(1,Math.abs(i),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 qUe(t,e,i){const r=i[0]-e[0],n=i[1]-e[1],s=i[2]-e[2];let o=r*r+n*n+s*s;return o>0?(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=s*o,t):(t[0]=0,t[1]=0,t[2]=0,t)}const n9t=bc,s9t=V1e,o9t=QH,YUe=rR,a9t=q8,XUe=zv;Object.freeze(Object.defineProperty({__proto__:null,abs:U8t,add:Uc,angle:t9t,bezier:K8t,ceil:G8t,copy:Hv,cross:t2,direction:qUe,dist:YUe,distance:rR,div:o9t,divide:QH,dot:Kb,equals:r9t,exactEquals:wne,floor:V8t,hermite:X8t,inverse:Y8t,len:XUe,length:zv,lerp:eW,max:H8t,min:z8t,mul:s9t,multiply:V1e,negate:q8t,normalize:zy,random:J8t,rotateX:Z8t,rotateY:Q8t,rotateZ:e9t,round:W8t,scale:Gh,scaleAndAdd:U1e,set:xl,sign:j8t,sqrDist:a9t,sqrLen:vne,squaredDistance:q8,squaredLength:vne,str:i9t,sub:n9t,subtract:bc,transformMat3:RC,transformMat4:i2,transformQuat:Y8},Symbol.toStringTag,{value:"Module"}));function j1e(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Hy(t,e,i,r,n){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t}function KUe(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t}function JUe(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t}function ZUe(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3],t}function QUe(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t[3]=e[3]/i[3],t}function l9t(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function u9t(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function c9t(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t[3]=Math.min(e[3],i[3]),t}function h9t(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t[3]=Math.max(e[3],i[3]),t}function d9t(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function eje(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}function p9t(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t[3]=e[3]+i[3]*r,t}function tje(t,e){const i=e[0]-t[0],r=e[1]-t[1],n=e[2]-t[2],s=e[3]-t[3];return Math.sqrt(i*i+r*r+n*n+s*s)}function ije(t,e){const i=e[0]-t[0],r=e[1]-t[1],n=e[2]-t[2],s=e[3]-t[3];return i*i+r*r+n*n+s*s}function z1e(t){const e=t[0],i=t[1],r=t[2],n=t[3];return Math.sqrt(e*e+i*i+r*r+n*n)}function H1e(t){const e=t[0],i=t[1],r=t[2],n=t[3];return e*e+i*i+r*r+n*n}function f9t(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function m9t(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function rje(t,e){const i=e[0],r=e[1],n=e[2],s=e[3];let o=i*i+r*r+n*n+s*s;return o>0&&(o=1/Math.sqrt(o),t[0]=i*o,t[1]=r*o,t[2]=n*o,t[3]=s*o),t}function nje(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function W1e(t,e,i,r){const n=e[0],s=e[1],o=e[2],a=e[3];return t[0]=n+r*(i[0]-n),t[1]=s+r*(i[1]-s),t[2]=o+r*(i[2]-o),t[3]=a+r*(i[3]-a),t}function g9t(t,e){const i=ZH;let r,n,s,o,a,l;e=e||1;do r=2*i()-1,n=2*i()-1,a=r*r+n*n;while(a>=1);do s=2*i()-1,o=2*i()-1,l=s*s+o*o;while(l>=1);const c=Math.sqrt((1-a)/l);return t[0]=e*r,t[1]=e*n,t[2]=e*s*c,t[3]=e*o*c,t}function y9t(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3];return t[0]=i[0]*r+i[4]*n+i[8]*s+i[12]*o,t[1]=i[1]*r+i[5]*n+i[9]*s+i[13]*o,t[2]=i[2]*r+i[6]*n+i[10]*s+i[14]*o,t[3]=i[3]*r+i[7]*n+i[11]*s+i[15]*o,t}function v9t(t,e,i){const r=e[0],n=e[1],s=e[2],o=i[0],a=i[1],l=i[2],c=i[3],d=c*r+a*s-l*n,p=c*n+l*r-o*s,y=c*s+o*n-a*r,v=-o*r-a*n-l*s;return t[0]=d*c+v*-o+p*-l-y*-a,t[1]=p*c+v*-a+y*-o-d*-l,t[2]=y*c+v*-l+d*-a-p*-o,t[3]=e[3],t}function _9t(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function sje(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function oje(t,e){const i=t[0],r=t[1],n=t[2],s=t[3],o=e[0],a=e[1],l=e[2],c=e[3],d=jv();return Math.abs(i-o)<=d*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(r-a)<=d*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-c)<=d*Math.max(1,Math.abs(s),Math.abs(c))}Object.freeze(Object.defineProperty({__proto__:null,add:KUe,ceil:l9t,copy:j1e,dist:tje,distance:tje,div:QUe,divide:QUe,dot:nje,equals:oje,exactEquals:sje,floor:u9t,inverse:m9t,len:z1e,length:z1e,lerp:W1e,max:h9t,min:c9t,mul:ZUe,multiply:ZUe,negate:f9t,normalize:rje,random:g9t,round:d9t,scale:eje,scaleAndAdd:p9t,set:Hy,sqrDist:ije,sqrLen:H1e,squaredDistance:ije,squaredLength:H1e,str:_9t,sub:JUe,subtract:JUe,transformMat4:y9t,transformQuat:v9t},Symbol.toStringTag,{value:"Module"}));const aje=new Float32Array(1);function q1e(t){--t;for(let e=1;e<32;e<<=1)t|=t>>e;return t+1}function Hl(t,e,i){return Math.min(Math.max(t,e),i)}function MC(t){return(t&t-1)==0}function X8(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}function tW(t,e,i){return t+(e-t)*i}function Jb(t){return t*Math.PI/180}function xne(t){return 180*t/Math.PI}function Y1e(t){return Math.acos(Hl(t,-1,1))}function lje(t){return Math.asin(Hl(t,-1,1))}function K8(t,e,i=1e-6){return t===e?!0:!Number.isFinite(t)||!Number.isFinite(e)?!1:(t>e?t-e:e-t)<=i}const Sne=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function b9t(t){return Sne.setFloat64(0,t),Sne.getBigInt64(0)}function w9t(t){return Sne.setBigInt64(0,t),Sne.getFloat64(0)}const X1e=BigInt("1000000");x9t(1);function x9t(t){const e=b9t(t=Math.abs(t)),i=w9t(e<=X1e?X1e:e-X1e);return Math.abs(t-i)}function S9t(t,e,i=1e-6){if(t===e)return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;const r=Math.abs(t-e),n=Math.abs(t),s=Math.abs(e);if(t===0||e===0||n<1e-12&&s<1e-12){if(r>.01*i)return!1}else if(r/(n+s)>i)return!1;return!0}function K1e(t){return uje(Math.max(-oA,Math.min(t,oA)))}function uje(t){return aje[0]=t,aje[0]}function cje(t,e){const i=zv(t),r=lje(t[2]/i),n=Math.atan2(t[1]/i,t[0]/i);return xl(e,i,r,n),e}function hje(t){const e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[3]*t[3]+t[4]*t[4]+t[5]*t[5],r=t[6]*t[6]+t[7]*t[7]+t[8]*t[8];return!(K8(e,1)&&K8(i,1)&&K8(r,1))}const oA=uje(34028234663852886e22);function Cne(t){return Hl(qre(t),0,255)}function Tne(t,e,i){return t=Number(t),isNaN(t)?i:ti?i:t}let Ene=class Ny{static blendColors(e,i,r,n=new Ny){return n.r=Math.round(e.r+(i.r-e.r)*r),n.g=Math.round(e.g+(i.g-e.g)*r),n.b=Math.round(e.b+(i.b-e.b)*r),n.a=e.a+(i.a-e.a)*r,n._sanitize()}static fromRgb(e,i){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])),Ny.fromArray(a,i)}return Ny.fromArray(n.map(a=>parseFloat(a)),i)}if(s==="hsl"&&n.length===3||s==="hsla"&&n.length===4)return Ny.fromArray(GUe(parseFloat(n[0]),parseFloat(n[1])/100,parseFloat(n[2])/100,parseFloat(n[3])),i)}return null}static fromHex(e,i=new Ny){if(e.length!==4&&e.length!==7||e[0]!=="#")return null;const r=e.length===4?4:8,n=(1<{const a=s&n;s>>=r,i[o]=r===4?17*a:a}),i.a=1,i)}static fromArray(e,i=new Ny){return i._set(Number(e[0]),Number(e[1]),Number(e[2]),Number(e[3])),isNaN(i.a)&&(i.a=1),i._sanitize()}static fromString(e,i){const r=BUe(e)?N1e(e):null;return r&&Ny.fromArray(r,i)||Ny.fromRgb(e,i)||Ny.fromHex(e,i)}static fromJSON(e){return e&&new Ny([e[0],e[1],e[2],e[3]/255])}static toUnitRGB(e){return ye(e)?[e.r/255,e.g/255,e.b/255]:null}static toUnitRGBA(e){return ye(e)?[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"?Ny.fromString(e,this):Array.isArray(e)?Ny.fromArray(e,this):(this._set(e.r??0,e.g??0,e.b??0,e.a??1),e instanceof Ny||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(){const e=this.r.toString(16),i=this.g.toString(16),r=this.b.toString(16);return`#${e.length<2?"0"+e:e}${i.length<2?"0"+i:i}${r.length<2?"0"+r:r}`}toCss(e=!1){const i=this.r+", "+this.g+", "+this.b;return e?`rgba(${i}, ${this.a})`:`rgb(${i})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(e=Ny.AlphaMode.ALWAYS){const i=Cne(this.r),r=Cne(this.g),n=Cne(this.b);return e===Ny.AlphaMode.ALWAYS||this.a!==1?[i,r,n,Cne(255*this.a)]:[i,r,n]}clone(){return new Ny(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(e){return ye(e)&&e.r===this.r&&e.g===this.g&&e.b===this.b&&e.a===this.a}_sanitize(){return this.r=Math.round(Tne(this.r,0,255)),this.g=Math.round(Tne(this.g,0,255)),this.b=Math.round(Tne(this.b,0,255)),this.a=Tne(this.a,0,1),this}_set(e,i,r,n){this.r=e,this.g=i,this.b=r,this.a=n}};Ene.prototype.declaredClass="esri.Color",function(t){var e;(e=t.AlphaMode||(t.AlphaMode={}))[e.ALWAYS=0]="ALWAYS",e[e.UNLESS_OPAQUE=1]="UNLESS_OPAQUE"}(Ene||(Ene={}));const $r=Ene;function J8(t,e,i=!1){let{hasM:r,hasZ:n}=t;Array.isArray(e)?e.length!==4||r||n?e.length===3&&i&&!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)),t.hasZ=n,t.hasM=r}var J1e;function dje(t){return(e,i)=>e==null?i:i==null?e:t(e,i)}function C9t(t){return t&&(t.declaredClass==="esri.geometry.SpatialReference"||t.wkid!=null)}let nR=J1e=class extends Jr{constructor(...t){super(...t),this.points=[],this.type="multipoint"}normalizeCtorArgs(t,e){if(!t&&!e)return{};const i={};Array.isArray(t)?(i.points=t,i.spatialReference=e):C9t(t)?i.spatialReference=t:(t.points&&(i.points=t.points),t.spatialReference&&(i.spatialReference=t.spatialReference),t.hasZ&&(i.hasZ=t.hasZ),t.hasM&&(i.hasM=t.hasM));const r=i.points&&i.points[0];return r&&(i.hasZ===void 0&&i.hasM===void 0?(i.hasZ=r.length>2,i.hasM=!1):i.hasZ===void 0?i.hasZ=r.length>3:i.hasM===void 0&&(i.hasM=r.length>3)),i}get cache(){return this.commitProperty("points"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const t=this.points;if(!t.length)return null;const e=new vr,i=this.hasZ,r=this.hasM,n=i?3:2,s=t[0],o=dje(Math.min),a=dje(Math.max);let l,c,d,p,[y,v]=s,[S,I]=s;for(let O=0,L=t.length;O2){const Y=N[2];l=o(l,Y),d=a(d,Y)}if(r&&N.length>n){const Y=N[n];c=o(c,Y),p=a(p,Y)}}return e.xmin=y,e.ymin=v,e.xmax=S,e.ymax=I,e.spatialReference=this.spatialReference,i?(e.zmin=l,e.zmax=d):(e.zmin=void 0,e.zmax=void 0),r?(e.mmin=c,e.mmax=p):(e.mmin=void 0,e.mmax=void 0),e}writePoints(t,e){e.points=hi(this.points)}addPoint(t){return J8(this,t),Array.isArray(t)?this.points.push(t):this.points.push(t.toArray()),this.notifyChange("points"),this}clone(){const t={points:hi(this.points),spatialReference:this.spatialReference};return this.hasZ&&(t.hasZ=!0),this.hasM&&(t.hasM=!0),new J1e(t)}getPoint(t){if(!this._validateInputs(t))return null;const e=this.points[t],i={x:e[0],y:e[1],spatialReference:this.spatialReference};let r=2;return this.hasZ&&(i.z=e[2],r=3),this.hasM&&(i.m=e[r]),new Yi(i)}removePoint(t){if(!this._validateInputs(t))return null;const e=new Yi(this.points.splice(t,1)[0],this.spatialReference);return this.notifyChange("points"),e}setPoint(t,e){return this._validateInputs(t)?(J8(this,e),Array.isArray(e)||(e=e.toArray()),this.points[t]=e,this.notifyChange("points"),this):this}toJSON(t){return this.write({},t)}_validateInputs(t){return t!=null&&t>=0&&t2&&e.length>2){const n=t[2]-e[2];return Math.sqrt(i*i+r*r+n*n)}return Math.sqrt(i*i+r*r)}function E9t(t,e,i){const r=t[0]+i*(e[0]-t[0]),n=t[1]+i*(e[1]-t[1]);return t.length>2&&e.length>2?[r,n,t[2]+i*(e[2]-t[2])]:[r,n]}function pje(t,e,i,r){const[n,s]=e,[o,a]=i[r],[l,c]=i[r+1],d=l-o,p=c-a,y=d*d+p*p,v=(n-o)*d+(s-a)*p,S=Math.min(1,Math.max(0,v/y));return t[0]=o+d*S,t[1]=a+p*S,t}function I9t(t,e,i){const r=i.rings;let n,s,o=!1,a=1/0;for(let l=0;le!=s[1]>e&&t<(s[0]-n[0])*(e-n[1])/(s[1]-n[1])+n[0]&&(o=!o),a=Math.min(a,A9t(t,e,n,s))}return a===0?0:(o?1:-1)*Math.sqrt(a)}function A9t(t,e,i,r){let n=i[0],s=i[1],o=r[0]-n,a=r[1]-s;if(o!==0||a!==0){const l=((t-n)*o+(e-s)*a)/(o*o+a*a);l>1?(n=r[0],s=r[1]):l>0&&(n+=o*l,s+=a*l)}return o=t-n,a=e-s,o*o+a*a}function P9t(t,e){return E9t(t,e,.5)}function iW(t,e,i){const r=t.length;let n=0,s=0,o=0;for(let a=0;a2&&c.length>2&&i&&(s+=l[0]*c[2]-c[0]*l[2],d=3),l.length>d&&c.length>d&&e&&(o+=l[0]*c[d]-c[0]*l[d])}return n<=0&&s<=0&&o<=0}function O9t(t){const e=t.length;return e>2&&_H(t[0],t[e-1])}function R9t(t){if("rings"in t&&(fje(t),t.rings.length>0&&!iW(t.rings[0],t.hasM??!1,t.hasZ??!1)))for(const e of t.rings)e.reverse()}function fje(t){if("rings"in t)for(const e of t.rings)O9t(e)||e.push(e[0].slice())}function Z1e(t){if(!t||t.length<3)return 0;let e=0;const i=t.length-1;for(let r=0;r{let a=s[2]-o[2];return a===0&&e&&(a=s[4]-o[4]),a}),r.length&&(i[0]=r[0][0],i[1]=r[0][1],e&&(i[2]=r[0][3]),(i[0]n[1]||i[1]n[3]||e&&(i[2]n[5]))&&(i.length=0)),!i.length){const s=t[0]&&t[0].length?D9t(t[0],e):null;if(!s)return null;i[0]=s[0],i[1]=s[1],e&&s.length>2&&(i[2]=s[2])}return i}function mje(t,e,i){let r=0,n=0,s=0,o=0,a=0;const l=t.length?t[0][0]:0,c=t.length?t[0][1]:0,d=t.length&&e?t[0][2]:0;for(let y=0;y2&&S.length>2){const ge=L-d,_e=X-d,Ie=N*_e-te*ge;s+=(ge+_e)*Ie,a+=Ie}Ii[1]&&(i[1]=I),Oi[3]&&(i[3]=O),e&&(Li[5]&&(i[5]=L))}if(o>0&&(o*=-1),a>0&&(a*=-1),!o)return null;o*=.5,a*=.5;const p=[r/(6*o)+l,n/(6*o)+c,o];return e&&(i[4]===i[5]||a===0?(p[3]=(i[4]+i[5])/2,p[4]=0):(p[3]=s/(6*a)+d,p[4]=a)),p}function D9t(t,e){const i=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,c=t.length;l2&&p.length>2&&(i[2]=d[2],r[2]=p[2]);const y=T9t(i,r);if(y){n+=y;const v=P9t(d,p);s+=y*v[0],o+=y*v[1],e&&v.length>2&&(a+=y*v[2])}}}return n>0?e?[s/n,o/n,a/n]:[s/n,o/n]:t.length?t[0]:null}const F9t=1e-6;function L9t(t){if(!t||!t.rings)return null;const{rings:e}=t;let i=0;for(let s=0;s2){const G=O[2];s=sR(s,G),o=oR(o,G)}if(r&&O.length>n){const G=O[n];a=sR(s,G),l=oR(o,G)}}}return i?r?(t[0]=c,t[1]=d,t[2]=s,t[3]=a,t[4]=p,t[5]=y,t[6]=o,t[7]=l,t.length=8,t):(t[0]=c,t[1]=d,t[2]=s,t[3]=p,t[4]=y,t[5]=o,t.length=6,t):r?(t[0]=c,t[1]=d,t[2]=a,t[3]=p,t[4]=y,t[5]=l,t.length=6,t):(t[0]=c,t[1]=d,t[2]=p,t[3]=y,t.length=4,t)}function xje(t,e,i,r,n,s){const o=e.xmin,a=e.xmax,l=e.ymin,c=e.ymax;let d=e.zmin,p=e.zmax,y=e.mmin,v=e.mmax;return n?(d=d||0,p=p||0,s?(y=y||0,v=v||0,t[0]=o,t[1]=l,t[2]=d,t[3]=y,t[4]=a,t[5]=c,t[6]=p,t[7]=v,t):(t[0]=o,t[1]=l,t[2]=d,t[3]=a,t[4]=c,t[5]=p,t)):s?(y=y||0,v=v||0,t[0]=o,t[1]=l,t[2]=y,t[3]=a,t[4]=c,t[5]=v,t):(t[0]=o,t[1]=l,t[2]=a,t[3]=c,t)}function Q8(t,e,i,r,n,s){const o=i?3:2,a=r&&s,l=i&&n;if(!e.length||!e[0].length)return null;let c,d,p,y,[v,S]=e[0],[I,O]=e[0];for(let L=0;L2){const Y=N[2];c=sR(c,Y),d=oR(d,Y)}if(a&&N.length>o){const Y=N[o];p=sR(c,Y),y=oR(d,Y)}}return n?(c=c||0,d=d||0,s?(p=p||0,y=y||0,t[0]=v,t[1]=S,t[2]=c,t[3]=p,t[4]=I,t[5]=O,t[6]=d,t[7]=y,t):(t[0]=v,t[1]=S,t[2]=c,t[3]=I,t[4]=O,t[5]=d,t)):s?(p=p||0,y=y||0,t[0]=v,t[1]=S,t[2]=p,t[3]=I,t[4]=O,t[5]=y,t):(t[0]=v,t[1]=S,t[2]=I,t[3]=O,t)}function $9t(t){return t.xmin!==void 0&&t.ymin!==void 0&&t.xmax!==void 0&&t.ymax!==void 0}function B9t(t){return t.points!==void 0}function G9t(t){return t.x!==void 0&&t.y!==void 0}function V9t(t){return t.paths!==void 0}function U9t(t){return t.rings!==void 0}const ebe=[];function Sje(t,e,i,r){return{xmin:t,ymin:e,xmax:i,ymax:r}}function Cje(t,e,i,r,n,s){return{xmin:t,ymin:e,zmin:i,xmax:r,ymax:n,zmax:s}}function Tje(t,e,i,r,n,s){return{xmin:t,ymin:e,mmin:i,xmax:r,ymax:n,mmax:s}}function Eje(t,e,i,r,n,s,o,a){return{xmin:t,ymin:e,zmin:i,mmin:r,xmax:n,ymax:s,zmax:o,mmax:a}}function tbe(t,e=!1,i=!1){return e?i?Eje(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]):Cje(t[0],t[1],t[2],t[3],t[4],t[5]):i?Tje(t[0],t[1],t[2],t[3],t[4],t[5]):Sje(t[0],t[1],t[2],t[3])}function ibe(t){return t?$9t(t)?t:G9t(t)?z9t(t):U9t(t)?rbe(t):V9t(t)?Ije(t):B9t(t)?j9t(t):null:null}function j9t(t){const{hasZ:e,hasM:i,points:r}=t;return tbe(Q8(ebe,r,e??!1,i??!1),e,i)}function z9t(t){const{x:e,y:i,z:r,m:n}=t,s=n!=null;return r!=null?s?Eje(e,i,r,n,e,i,r,n):Cje(e,i,r,e,i,r):s?Tje(e,i,n,e,i,n):Sje(e,i,e,i)}function rbe(t){const{hasZ:e,hasM:i,rings:r}=t,n=Z8(ebe,r,e??!1,i??!1);return n?tbe(n,e,i):null}function Ije(t){const{hasZ:e,hasM:i,paths:r}=t,n=Z8(ebe,r,e??!1,i??!1);return n?tbe(n,e,i):null}var Pne;function Aje(t){return!Array.isArray(t[0])}let FC=Pne=class extends Jr{static fromExtent(t){const e=t.clone().normalize(),i=t.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 c=0;c2,r=s.length>3):i===void 0?i=r?s.length>3:s.length>2:r===void 0&&(r=i?s.length>3:s.length>2)),{rings:n,spatialReference:e,hasZ:i,hasM:r}}get cache(){return this.commitProperty("rings"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get centroid(){const t=Ine(this);if(!t||isNaN(t[0])||isNaN(t[1])||this.hasZ&&isNaN(t[2]))return null;const e=new Yi;return e.x=t[0],e.y=t[1],e.spatialReference=this.spatialReference,this.hasZ&&(e.z=t[2]),e}get extent(){const{spatialReference:t}=this,e=rbe(this);if(!e)return null;const i=new vr(e);return i.spatialReference=t,i}get isSelfIntersecting(){return Q$t(this.rings)}writeRings(t,e){e.rings=hi(this.rings)}addRing(t){if(!t)return;const e=this.rings,i=e.length;if(Aje(t)){const r=[];for(let n=0,s=t.length;nn===l&&s===c&&(o==null&&d==null||o===d)&&(a==null&&p==null||a===p);for(let n=0;nthis.hasZ?this.hasM?[i.x,i.y,i.z,i.m]:[i.x,i.y,i.z]:[i.x,i.y]):t,iW(e,this.hasM,this.hasZ)}getPoint(t,e){if(!this._validateInputs(t,e))return null;const i=this.rings[t][e],r=this.hasZ,n=this.hasM;return r&&!n?new Yi(i[0],i[1],i[2],void 0,this.spatialReference):n&&!r?new Yi(i[0],i[1],void 0,i[2],this.spatialReference):r&&n?new Yi(i[0],i[1],i[2],i[3],this.spatialReference):new Yi(i[0],i[1],this.spatialReference)}insertPoint(t,e,i){return this._validateInputs(t,e,!0)?(J8(this,i),Array.isArray(i)||(i=i.toArray()),this.rings[t].splice(e,0,i),this.notifyChange("rings"),this):this}removePoint(t,e){if(!this._validateInputs(t,e))return null;const i=new Yi(this.rings[t].splice(e,1)[0],this.spatialReference);return this.notifyChange("rings"),i}removeRing(t){if(!this._validateInputs(t,null))return null;const e=this.rings.splice(t,1)[0],i=this.spatialReference,r=e.map(n=>new Yi(n,i));return this.notifyChange("rings"),r}setPoint(t,e,i){return this._validateInputs(t,e)?(J8(this,i),Array.isArray(i)||(i=i.toArray()),this.rings[t][e]=i,this.notifyChange("rings"),this):this}_validateInputs(t,e,i=!1){if(t==null||t<0||t>=this.rings.length)return!1;if(e!=null){const r=this.rings[t];if(i&&(e<0||e>r.length)||!i&&(e<0||e>=r.length))return!1}return!0}toJSON(t){return this.write({},t)}};E([k({readOnly:!0})],FC.prototype,"cache",null),E([k({readOnly:!0})],FC.prototype,"centroid",null),E([k({readOnly:!0})],FC.prototype,"extent",null),E([k({readOnly:!0})],FC.prototype,"isSelfIntersecting",null),E([k({type:[[[Number]]],json:{write:{isRequired:!0}}})],FC.prototype,"rings",void 0),E([mr("rings")],FC.prototype,"writeRings",null),FC=Pne=E([ht("esri.geometry.Polygon")],FC),FC.prototype.toJSON.isDefaultToJSON=!0;const po=FC;var nbe;function H9t(t){return!Array.isArray(t[0])}let aR=nbe=class extends Jr{constructor(...t){super(...t),this.paths=[],this.type="polyline"}normalizeCtorArgs(t,e){let i,r,n=null,s=null;return t&&!Array.isArray(t)?(n=t.paths?t.paths:null,e||(t.spatialReference?e=t.spatialReference:t.paths||(e=t)),i=t.hasZ,r=t.hasM):n=t,n=n||[],e=e||rr.WGS84,n.length&&n[0]&&n[0][0]!=null&&typeof n[0][0]=="number"&&(n=[n]),s=n[0]&&n[0][0],s&&(i===void 0&&r===void 0?(i=s.length>2,r=!1):i===void 0?i=!r&&s.length>3:r===void 0&&(r=!i&&s.length>3)),{paths:n,spatialReference:e,hasZ:i,hasM:r}}get cache(){return this.commitProperty("paths"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const{spatialReference:t}=this,e=Ije(this);if(!e)return null;const i=new vr(e);return i.spatialReference=t,i}writePaths(t,e){e.paths=hi(this.paths)}addPath(t){if(!t)return;const e=this.paths,i=e.length;if(H9t(t)){const r=[];for(let n=0,s=t.length;nnew Yi(n,i));return this.notifyChange("paths"),r}removePoint(t,e){if(!this._validateInputs(t,e))return null;const i=new Yi(this.paths[t].splice(e,1)[0],this.spatialReference);return this.notifyChange("paths"),i}setPoint(t,e,i){return this._validateInputs(t,e)?(J8(this,i),Array.isArray(i)||(i=i.toArray()),this.paths[t][e]=i,this.notifyChange("paths"),this):this}_validateInputs(t,e,i=!1){if(t==null||t<0||t>=this.paths.length)return!1;if(e!=null){const r=this.paths[t];if(i&&(e<0||e>r.length)||!i&&(e<0||e>=r.length))return!1}return!0}toJSON(t){return this.write({},t)}};E([k({readOnly:!0})],aR.prototype,"cache",null),E([k({readOnly:!0})],aR.prototype,"extent",null),E([k({type:[[[Number]]],json:{write:{isRequired:!0}}})],aR.prototype,"paths",void 0),E([mr("paths")],aR.prototype,"writePaths",null),aR=nbe=E([ht("esri.geometry.Polyline")],aR),aR.prototype.toJSON.isDefaultToJSON=!0;const va=aR;function ac(t){return t.xmin!==void 0&&t.ymin!==void 0&&t.xmax!==void 0&&t.ymax!==void 0}function sg(t){return t.points!==void 0}function Wy(t){return t.x!==void 0&&t.y!==void 0}function Lu(t){return t.paths!==void 0}function Va(t){return t.rings!==void 0}function fl(t){return lt(t)?null:t instanceof Jr?t:Wy(t)?Yi.fromJSON(t):Lu(t)?va.fromJSON(t):Va(t)?po.fromJSON(t):sg(t)?fd.fromJSON(t):ac(t)?vr.fromJSON(t):null}function md(t){return t?Wy(t)?"esriGeometryPoint":Lu(t)?"esriGeometryPolyline":Va(t)?"esriGeometryPolygon":ac(t)?"esriGeometryEnvelope":sg(t)?"esriGeometryMultipoint":null:null}const W9t={esriGeometryPoint:Yi,esriGeometryPolyline:va,esriGeometryPolygon:po,esriGeometryEnvelope:vr,esriGeometryMultipoint:fd};function q9t(t){return t&&W9t[t]||null}const qy=jo()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),One=jo()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),P1={base:Jr,key:"type",typeMap:{extent:vr,multipoint:fd,point:Yi,polyline:va,polygon:po}};SC(P1);const ua=t=>{let e=class extends t{clone(){const i=_u(Tp(this),"unable to clone instance of non-accessor class"),r=i.metadatas,n=i.store,s={},o=new Map;for(const l in r){const c=r[l],d=n?.originOf(l),p=c.clonable;if(c.readOnly||p===!1||d!==Fn.USER&&d!==Fn.DEFAULTS&&d!==Fn.WEB_MAP&&d!==Fn.WEB_SCENE)continue;const y=this[l];let v=null;v=typeof p=="function"?p(y):p==="reference"?y:g_e(y),y!=null&&v==null||(d===Fn.DEFAULTS?o.set(l,v):s[l]=v)}const a=new(Object.getPrototypeOf(this)).constructor(s);if(o.size){const l=Tp(a)?.store;if(l)for(const[c,d]of o)l.set(c,d,Fn.DEFAULTS)}return a}};return e=E([ht("esri.core.Clonable")],e),e};let e9=class extends ua(fn){};e9=E([ht("esri.core.Clonable")],e9);var t9;function Y9t(t,e){switch(t.type){case"range":{const i="range"in t?t.range[0]:t.minValue,r="range"in t?t.range[1]:t.maxValue;if(i!=null&&+er)return t9.VALUE_OUT_OF_RANGE;break}case"coded-value":case"codedValue":if(t.codedValues==null||t.codedValues.every(i=>i==null||i.code!==e))return t9.INVALID_CODED_VALUE}return null}(function(t){t.VALUE_OUT_OF_RANGE="domain-validation-error::value-out-of-range",t.INVALID_CODED_VALUE="domain-validation-error::invalid-coded-value"})(t9||(t9={}));const X9t=Ei.getLogger("esri.support.arcadeOnDemand");let sbe;function Wv(){return sbe||(sbe=(async()=>{const t=await Promise.resolve().then(()=>Dft);return{arcade:t.arcade,arcadeUtils:t,Dictionary:t.Dictionary,Feature:t.arcadeFeature}})()),sbe}const K9t=(t,e,i)=>lR.create(t,e,i,null,["$feature"]),Rne=(t,e,i)=>lR.create(t,e,i,null,["$feature","$view"]),J9t=(t,e,i,r)=>lR.create(t,e,i,r,["$feature","$view"]);let lR=class gLt{constructor(e,i,r,n,s,o,a){this.script=e,this.evaluate=n;const l=Array.isArray(o)?o:o.fields;this.fields=l,this._syntaxTree=r,this._arcade=i,this._arcadeFeature=s,this._spatialReference=a,this._referencesGeometry=i.scriptTouchesGeometry(this._syntaxTree),this._referencesScale=this._arcade.referencesMember(this._syntaxTree,"scale")}static async create(e,i,r,n,s,o){const{arcade:a,Feature:l,Dictionary:c}=await Wv(),d=rr.fromJSON(i);let p;try{p=a.parseScript(e,o)}catch(re){return X9t.error(new st("arcade-bad-expression","Failed to parse arcade script",{script:e,error:re})),null}const y=s.reduce((re,fe)=>({...re,[fe]:null}),{});let v=null;ye(n)&&(v=new c(n),v.immutable=!0,y.$config=null);const S=a.scriptUsesGeometryEngine(p),I=S&&a.enableGeometrySupport(),O=a.scriptUsesFeatureSet(p)&&a.enableFeatureSetSupport(),L=a.scriptIsAsync(p),N=L&&a.enableAsyncSupport(),G={vars:y,spatialReference:d,useAsync:!!N};await Promise.all([I,O,N]);const V=new Set;await a.loadDependentModules(V,p,null,L,S);const Y=new c;Y.immutable=!1,Y.setField("scale",0);const X=a.compileScript(p,G),te=re=>("$view"in re&&re.$view&&(Y.setField("scale",typeof re.$view=="object"?re.$view.scale:void 0),re.$view=Y),v&&(re.$config=v),X({vars:re,spatialReference:d}));return new gLt(e,a,p,te,new l,r,d)}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 Z9t=/^([0-9])/,Q9t=/[^a-z0-9_\u0080-\uffff]/gi,eBt=/_{2,}/g,tBt=/^_/,iBt=/_$/;function i9(t){return t==null?null:t.trim().replace(Q9t,"_").replace(eBt,"_").replace(tBt,"").replace(iBt,"").replace(Z9t,"F$1")||null}const rBt=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],nBt=["field","normalizationField"];function O1(t,e){if(t!=null&&e!=null){for(const i of Array.isArray(t)?t:[t])if(Pje(rBt,i,e),"visualVariables"in i&&i.visualVariables)for(const r of i.visualVariables)Pje(nBt,r,e)}}function Pje(t,e,i){if(t)for(const r of t){const n=Xx(r,e),s=n&&typeof n!="function"&&i.get(n);s&&Ep(r,s.name,e)}}function AL(t,e){if(t!=null&&e?.fields?.length)if("startField"in t){const i=e.get(t.startField),r=e.get(t.endField);t.startField=i?.name??null,t.endField=r?.name??null}else{const i=e.get(t.startTimeField),r=e.get(t.endTimeField);t.startTimeField=i?.name??null,t.endTimeField=r?.name??null}}const obe=new Set;function rW(t,e){return t&&e?(obe.clear(),uR(obe,t,e),Array.from(obe).sort()):[]}function uR(t,e,i){if(i)if(e?.fields?.length)if(i.includes("*"))for(const{name:r}of e.fields)t.add(r);else for(const r of i)Yy(t,e,r);else{if(i.includes("*"))return t.clear(),void t.add("*");for(const r of i)r!=null&&t.add(r)}}function Yy(t,e,i){if(typeof i=="string")if(e){const r=e.get(i);r&&t.add(r.name)}else t.add(i)}function Mne(t,e){return lt(e)||lt(t)?[]:e.includes("*")?(t.fields??[]).map(i=>i.name):e}async function K0(t,e,i){if(!i)return;const{arcadeUtils:r}=await Wv(),n=r.extractFieldNames(i,e?.fields?.map(s=>s.name));for(const s of n)Yy(t,e,s)}async function Oje(t,e,i){if(i&&i!=="1=1"){const r=(await Promise.resolve().then(()=>gde)).WhereClause.create(i,e);if(!r.isStandardized)throw new st("fieldUtils:collectFilterFields","Where clause is not standardized",{where:i});uR(t,e,r.fieldNames)}}function sBt({displayField:t,fields:e}){return t||(e&&e.length?abe(e,"name-or-title")||abe(e,"unique-identifier")||abe(e,"type-or-category")||oBt(e):null)}function oBt(t){for(const e of t){if(!e||!e.name)continue;const i=e.name.toLowerCase();if(i.includes("name")||i.includes("title"))return e.name}return null}function abe(t,e){for(const i of t)if(i&&i.valueType&&i.valueType===e)return i.name;return null}async function aBt(t,e){if(!e)return;const i=e.elevationInfo?.featureExpressionInfo;return i?i.collectRequiredFields(t,e.fieldsIndex):void 0}function lBt(t,e,i){i.onStatisticExpression?K0(t,e,i.onStatisticExpression.expression):t.add(i.onStatisticField)}async function uBt(t,e,i){if(!e||!i||!("fields"in i))return;const r=[],n=i.popupTemplate;r.push(cBt(t,e,n)),i.fields&&r.push(...i.fields.map(async s=>lBt(t,e.fieldsIndex,s))),await Promise.all(r)}async function cBt(t,e,i){const r=[];i?.expressionInfos&&r.push(...i.expressionInfos.map(s=>K0(t,e.fieldsIndex,s.expression)));const n=i?.content;if(Array.isArray(n))for(const s of n)s.type==="expression"&&s.expressionInfo&&r.push(K0(t,e.fieldsIndex,s.expressionInfo.expression));await Promise.all(r)}async function Rje(t,e,i){e&&(e.timeInfo&&ye(i)&&i.timeExtent&&uR(t,e.fieldsIndex,[e.timeInfo.startField,e.timeInfo.endField]),e.floorInfo&&uR(t,e.fieldsIndex,[e.floorInfo.floorField]),ye(i)&&ye(i.where)&&await Oje(t,e.fieldsIndex,i.where))}async function hBt(t,e,i){e&&i&&await Promise.all(i.map(r=>dBt(t,e,r)))}async function dBt(t,e,i){e&&i&&(i.valueExpression?await K0(t,e.fieldsIndex,i.valueExpression):i.field&&Yy(t,e.fieldsIndex,i.field))}function pBt(t){if(!t)return[];const e="editFieldsInfo"in t&&t.editFieldsInfo;return e?rW(t.fieldsIndex,[e&&e.creatorField,e&&e.creationDateField,e&&e.editorField,e&&e.editDateField]):[]}async function Mje(t,e){const{labelingInfo:i,fieldsIndex:r}=e;i&&i.length&&await Promise.all(i.map(n=>fBt(t,r,n)))}async function fBt(t,e,i){if(!i)return;const r=i.getLabelExpression(),n=i.where;if(r.type==="arcade")await K0(t,e,r.expression);else{const s=r.expression.match(/{[^}]*}/g);s&&s.forEach(o=>{Yy(t,e,o.slice(1,-1))})}await Oje(t,e,n)}function Dne(t){const e=t.defaultValue;return e!==void 0&&Lje(t,e)?e:t.nullable?null:void 0}function Dje(t){return typeof t=="number"&&!isNaN(t)&&isFinite(t)}function mBt(t){return t===null||Dje(t)}const lbe="isInteger"in Number?Number.isInteger:t=>typeof t=="number"&&isFinite(t)&&Math.floor(t)===t;function gBt(t){return t===null||lbe(t)}function Fje(t){return t!=null&&typeof t=="string"}function yBt(t){return t===null||Fje(t)}function vBt(){return!0}function Lje(t,e){let i;switch(t.type){case"date":case"integer":case"long":case"small-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":i=t.nullable?gBt:lbe;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":i=t.nullable?mBt:Dje;break;case"string":case"esriFieldTypeString":i=t.nullable?yBt:Fje;break;default:i=vBt}return arguments.length===1?i:i(e)}const _Bt=["integer","small-integer","single","double"],bBt=new Set([..._Bt,"esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSingle","esriFieldTypeDouble"]);function r9(t){return t!=null&&bBt.has(t.type)}function ube(t){return t!=null&&(t.type==="string"||t.type==="esriFieldTypeString")}var Fne,Lne;function wBt(t){return t==null||typeof t=="number"&&isNaN(t)?null:t}function xBt(t,e){return t==null||t.nullable&&e===null?null:r9(t)&&!SBt(t.type,Number(e))?Fne.OUT_OF_RANGE:Lje(t,e)?t.domain?Y9t(t.domain,e):null:Lne.INVALID_TYPE}function SBt(t,e){const i=typeof t=="string"?kje(t):t;if(!i)return!1;const r=i.min,n=i.max;return i.isInteger?lbe(e)&&e>=r&&e<=n:e>=r&&e<=n}function kje(t){switch(t){case"esriFieldTypeSmallInteger":case"small-integer":return CBt;case"esriFieldTypeInteger":case"integer":return TBt;case"esriFieldTypeSingle":case"single":return EBt;case"esriFieldTypeDouble":case"double":return IBt}}(function(t){t.OUT_OF_RANGE="numeric-range-validation-error::out-of-range"})(Fne||(Fne={})),function(t){t.INVALID_TYPE="type-validation-error::invalid-type"}(Lne||(Lne={}));const CBt={min:-32768,max:32767,isInteger:!0},TBt={min:-2147483648,max:2147483647,isInteger:!0},EBt={min:-34e37,max:12e37,isInteger:!1},IBt={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1};function ABt(t,e,i){switch(t){case t9.INVALID_CODED_VALUE:return`Value ${i} is not in the coded domain - field: ${e.name}, domain: ${JSON.stringify(e.domain)}`;case t9.VALUE_OUT_OF_RANGE:return`Value ${i} is out of the range of valid values - field: ${e.name}, domain: ${JSON.stringify(e.domain)}`;case Lne.INVALID_TYPE:return`Value ${i} is not a valid value for the field type - field: ${e.name}, type: ${e.type}, nullable: ${e.nullable}`;case Fne.OUT_OF_RANGE:{const{min:r,max:n}=kje(e.type);return`Value ${i} is out of range for the number type - field: ${e.name}, type: ${e.type}, value range is ${r} to ${n}`}}}function Nje(t,e){return!PBt(t,e,null)}function PBt(t,e,i){if(!e||!e.attributes||!t){if(ye(i))for(const s of t??[])i.add(s);return!0}const r=e.attributes;let n=!1;for(const s of t)if(!(s in r)){if(n=!0,!ye(i))break;i.add(s)}return n}function $je(t){return!!t&&["raster.itempixelvalue","raster.servicepixelvalue"].some(e=>t.toLowerCase().startsWith(e))}let kne=class extends Ni{constructor(e){super(e),this.type=null}};E([k({type:["attachments","custom","fields","media","text","expression","relationship"],readOnly:!0,json:{read:!1,write:!0}})],kne.prototype,"type",void 0),kne=E([ht("esri.popup.content.Content")],kne);const cR=kne;var cbe;let PL=cbe=class extends cR{constructor(t){super(t),this.description=null,this.displayType="auto",this.title=null,this.type="attachments"}clone(){return new cbe({description:this.description,displayType:this.displayType,title:this.title})}};E([k({type:String,json:{write:!0}})],PL.prototype,"description",void 0),E([k({type:["auto","preview","list"],json:{write:!0}})],PL.prototype,"displayType",void 0),E([k({type:String,json:{write:!0}})],PL.prototype,"title",void 0),E([k({type:["attachments"],readOnly:!0,json:{read:!1,write:!0}})],PL.prototype,"type",void 0),PL=cbe=E([ht("esri.popup.content.AttachmentsContent")],PL);const nW=PL;var hbe;let OL=hbe=class extends cR{constructor(t){super(t),this.creator=null,this.destroyer=null,this.outFields=null,this.type="custom"}clone(){return new hbe({creator:this.creator,destroyer:this.destroyer,outFields:Array.isArray(this.outFields)?hi(this.outFields):null})}};E([k()],OL.prototype,"creator",void 0),E([k()],OL.prototype,"destroyer",void 0),E([k()],OL.prototype,"outFields",void 0),E([k({type:["custom"],readOnly:!0})],OL.prototype,"type",void 0),OL=hbe=E([ht("esri.popup.content.CustomContent")],OL);const OBt=OL;var dbe;let n9=dbe=class extends Ni{constructor(t){super(t),this.title=null,this.expression=null,this.returnType="dictionary"}clone(){return new dbe({title:this.title,expression:this.expression})}};E([k({type:String,json:{write:!0}})],n9.prototype,"title",void 0),E([k({type:String,json:{write:!0}})],n9.prototype,"expression",void 0),E([k({type:["dictionary"],readOnly:!0,json:{read:!1,write:!0}})],n9.prototype,"returnType",void 0),n9=dbe=E([ht("esri.popup.ElementExpressionInfo")],n9);const Bje=n9;var pbe;let sW=pbe=class extends cR{constructor(t){super(t),this.expressionInfo=null,this.type="expression"}clone(){return new pbe({expressionInfo:this.expressionInfo?.clone()})}};E([k({type:Bje,json:{write:!0}})],sW.prototype,"expressionInfo",void 0),E([k({type:["expression"],readOnly:!0,json:{read:!1,write:!0}})],sW.prototype,"type",void 0),sW=pbe=E([ht("esri.popup.content.ExpressionContent")],sW);const fbe=sW;function Hr(t,e={}){const i=t instanceof Bs?t:new Bs(t,e),r={type:e?.ignoreUnknown??1?i.apiValues:String,json:{type:i.jsonValues,read:!e?.readOnly&&{reader:i.read},write:{writer:i.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),k(r)}const oW=jo()({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"});oW.toJSON.bind(oW),oW.fromJSON.bind(oW);const LC={year:"numeric",month:"numeric",day:"numeric"},aW={year:"numeric",month:"long",day:"numeric"},lW={year:"numeric",month:"short",day:"numeric"},uW={year:"numeric",month:"long",weekday:"long",day:"numeric"},Zb={hour:"numeric",minute:"numeric"},r2={...Zb,second:"numeric"},mbe={"short-date":LC,"short-date-short-time":{...LC,...Zb},"short-date-short-time-24":{...LC,...Zb,hour12:!1},"short-date-long-time":{...LC,...r2},"short-date-long-time-24":{...LC,...r2,hour12:!1},"short-date-le":LC,"short-date-le-short-time":{...LC,...Zb},"short-date-le-short-time-24":{...LC,...Zb,hour12:!1},"short-date-le-long-time":{...LC,...r2},"short-date-le-long-time-24":{...LC,...r2,hour12:!1},"long-month-day-year":aW,"long-month-day-year-short-time":{...aW,...Zb},"long-month-day-year-short-time-24":{...aW,...Zb,hour12:!1},"long-month-day-year-long-time":{...aW,...r2},"long-month-day-year-long-time-24":{...aW,...r2,hour12:!1},"day-short-month-year":lW,"day-short-month-year-short-time":{...lW,...Zb},"day-short-month-year-short-time-24":{...lW,...Zb,hour12:!1},"day-short-month-year-long-time":{...lW,...r2},"day-short-month-year-long-time-24":{...lW,...r2,hour12:!1},"long-date":uW,"long-date-short-time":{...uW,...Zb},"long-date-short-time-24":{...uW,...Zb,hour12:!1},"long-date-long-time":{...uW,...r2},"long-date-long-time-24":{...uW,...r2,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":Zb,"long-time":r2},cW=jo()({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"});cW.apiValues,cW.toJSON.bind(cW),cW.fromJSON.bind(cW);const RBt={ar:"ar-u-nu-latn-ca-gregory"};let gbe=new WeakMap,Gje=mbe["short-date-short-time"];function MBt(t){const e=t||Gje;let i=gbe.get(e);if(!i){const r=Y0(),n=RBt[Y0()]||r;i=new Intl.DateTimeFormat(n,e),gbe.set(e,i)}return i}function Nne(t){return t?mbe[t]:null}function kC(t,e){return MBt(e).format(t)}I1e(()=>{gbe=new WeakMap,Gje=mbe["short-date-short-time"]});const DBt={ar:"ar-u-nu-latn"};let $ne=new WeakMap,Vje={};function FBt(t){const e=t||Vje;if(!$ne.has(e)){const i=Y0(),r=DBt[Y0()]||i;$ne.set(e,new Intl.NumberFormat(r,t))}return $ne.get(e)}function Uje(t={}){const e={};return t.digitSeparator!=null&&(e.useGrouping=t.digitSeparator),t.places!=null&&(e.minimumFractionDigits=e.maximumFractionDigits=t.places),e}function aA(t,e){return t===-0&&(t=0),FBt(e).format(t)}I1e(()=>{$ne=new WeakMap,Vje={}});var ybe;let RL=ybe=class extends Ni{constructor(t){super(t),this.dateFormat=null,this.dateTimeFormatOptions=null,this.digitSeparator=!1,this.places=null}clone(){return new ybe({dateFormat:this.dateFormat,digitSeparator:this.digitSeparator,places:this.places})}format(t){return this.dateFormat?kC(t,{...Nne(this.dateFormat),...this.dateTimeFormatOptions}):aA(t,Uje(this))}formatRasterPixelValue(t){if(t.includes("-"))return t;let e,i;return t.trim().includes(",")?(e=",",i=e+" ",this._formatDelimitedString(t,e,i,this)):t.trim().includes(";")?(e=";",i=e+" ",this._formatDelimitedString(t,e,i,this)):t.trim().includes(" ")?(e=i=" ",this._formatDelimitedString(t,e,i,this)):this.format(Number(t))}_formatDelimitedString(t,e,i,r){return t&&e&&i&&r?t.trim().split(e).map(n=>this.format(Number(n))).join(i):t}};E([Hr(oW)],RL.prototype,"dateFormat",void 0),E([k({type:Object,json:{read:!1}})],RL.prototype,"dateTimeFormatOptions",void 0),E([k({type:Boolean,json:{write:!0}})],RL.prototype,"digitSeparator",void 0),E([k({type:xs,json:{write:!0}})],RL.prototype,"places",void 0),RL=ybe=E([ht("esri.popup.support.FieldInfoFormat")],RL);const s9=RL;var vbe;let n2=vbe=class extends Ni{constructor(t){super(t),this.fieldName=null,this.format=null,this.isEditable=!1,this.label=null,this.stringFieldOption="text-box",this.statisticType=null,this.tooltip=null,this.visible=!0}clone(){return new vbe({fieldName:this.fieldName,format:this.format?hi(this.format):null,isEditable:this.isEditable,label:this.label,stringFieldOption:this.stringFieldOption,statisticType:this.statisticType,tooltip:this.tooltip,visible:this.visible})}};E([k({type:String,json:{write:!0}})],n2.prototype,"fieldName",void 0),E([k({type:s9,json:{write:!0}})],n2.prototype,"format",void 0),E([k({type:Boolean,json:{write:!0,default:!1}})],n2.prototype,"isEditable",void 0),E([k({type:String,json:{write:!0}})],n2.prototype,"label",void 0),E([Hr(new Bs({richtext:"rich-text",textarea:"text-area",textbox:"text-box"}),{default:"text-box"})],n2.prototype,"stringFieldOption",void 0),E([k({type:["count","sum","min","max","avg","stddev","var"],json:{write:!0}})],n2.prototype,"statisticType",void 0),E([k({type:String,json:{write:!0}})],n2.prototype,"tooltip",void 0),E([k({type:Boolean,json:{write:!0}})],n2.prototype,"visible",void 0),n2=vbe=E([ht("esri.popup.FieldInfo")],n2);const hW=n2;var _be;let lA=_be=class extends cR{constructor(t){super(t),this.attributes=null,this.description=null,this.fieldInfos=null,this.title=null,this.type="fields"}writeFieldInfos(t,e){e.fieldInfos=t&&t.map(i=>i.toJSON())}clone(){return new _be(hi({attributes:this.attributes,description:this.description,fieldInfos:this.fieldInfos,title:this.title}))}};E([k({type:Object,json:{write:!0}})],lA.prototype,"attributes",void 0),E([k({type:String,json:{write:!0}})],lA.prototype,"description",void 0),E([k({type:[hW]})],lA.prototype,"fieldInfos",void 0),E([mr("fieldInfos")],lA.prototype,"writeFieldInfos",null),E([k({type:String,json:{write:!0}})],lA.prototype,"title",void 0),E([k({type:["fields"],readOnly:!0,json:{read:!1,write:!0}})],lA.prototype,"type",void 0),lA=_be=E([ht("esri.popup.content.FieldsContent")],lA);const o9=lA;let ML=class extends Ni{constructor(e){super(e),this.altText=null,this.caption="",this.title="",this.type=null}};E([k({type:String,json:{write:!0}})],ML.prototype,"altText",void 0),E([k({type:String,json:{write:!0}})],ML.prototype,"caption",void 0),E([k({type:String,json:{write:!0}})],ML.prototype,"title",void 0),E([k({type:["image","bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],ML.prototype,"type",void 0),ML=E([ht("esri.popup.content.mixins.MediaInfo")],ML);const bbe=ML;var wbe;let a9=wbe=class extends fn{constructor(t){super(t),this.fieldName=null,this.tooltip=null,this.value=null}clone(){return new wbe({fieldName:this.fieldName,tooltip:this.tooltip,value:this.value})}};E([k()],a9.prototype,"fieldName",void 0),E([k()],a9.prototype,"tooltip",void 0),E([k()],a9.prototype,"value",void 0),a9=wbe=E([ht("esri.popup.content.support.ChartMediaInfoValueSeries")],a9);const jje=a9;var xbe;let DL=xbe=class extends Ni{constructor(t){super(t),this.fields=[],this.normalizeField=null,this.series=[],this.tooltipField=null}clone(){return new xbe({fields:hi(this.fields),normalizeField:this.normalizeField,tooltipField:this.tooltipField})}};E([k({type:[String],json:{write:!0}})],DL.prototype,"fields",void 0),E([k({type:String,json:{write:!0}})],DL.prototype,"normalizeField",void 0),E([k({type:[jje],json:{read:!1}})],DL.prototype,"series",void 0),E([k({type:String,json:{write:!0}})],DL.prototype,"tooltipField",void 0),DL=xbe=E([ht("esri.popup.content.support.ChartMediaInfoValue")],DL);const LBt=DL;let dW=class extends bbe{constructor(e){super(e),this.type=null,this.value=null}};E([k({type:["bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],dW.prototype,"type",void 0),E([k({type:LBt,json:{write:!0}})],dW.prototype,"value",void 0),dW=E([ht("esri.popup.content.mixins.ChartMediaInfo")],dW);const Bne=dW,Gne=jo()({barchart:"bar-chart",columnchart:"column-chart",linechart:"line-chart",piechart:"pie-chart"});var Sbe;let Vne=Sbe=class extends Bne{constructor(t){super(t),this.type="bar-chart"}clone(){return new Sbe({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};E([k({type:["bar-chart"],readOnly:!0,json:{type:["barchart"],read:!1,write:Gne.write}})],Vne.prototype,"type",void 0),Vne=Sbe=E([ht("esri.popup.content.BarChartMediaInfo")],Vne);const zje=Vne;var Cbe;let Une=Cbe=class extends Bne{constructor(t){super(t),this.type="column-chart"}clone(){return new Cbe({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};E([k({type:["column-chart"],readOnly:!0,json:{type:["columnchart"],read:!1,write:Gne.write}})],Une.prototype,"type",void 0),Une=Cbe=E([ht("esri.popup.content.ColumnChartMediaInfo")],Une);const Hje=Une;var Tbe;let pW=Tbe=class extends Ni{constructor(t){super(t),this.linkURL=null,this.sourceURL=null}clone(){return new Tbe({linkURL:this.linkURL,sourceURL:this.sourceURL})}};E([k({type:String,json:{write:!0}})],pW.prototype,"linkURL",void 0),E([k({type:String,json:{write:!0}})],pW.prototype,"sourceURL",void 0),pW=Tbe=E([ht("esri.popup.content.support.ImageMediaInfoValue")],pW);const kBt=pW;var Ebe;let l9=Ebe=class extends bbe{constructor(t){super(t),this.refreshInterval=null,this.type="image",this.value=null}clone(){return new Ebe({altText:this.altText,title:this.title,caption:this.caption,refreshInterval:this.refreshInterval,value:this.value?this.value.clone():null})}};E([k({type:Number,json:{write:!0}})],l9.prototype,"refreshInterval",void 0),E([k({type:["image"],readOnly:!0,json:{read:!1,write:!0}})],l9.prototype,"type",void 0),E([k({type:kBt,json:{write:!0}})],l9.prototype,"value",void 0),l9=Ebe=E([ht("esri.popup.content.ImageMediaInfo")],l9);const Wje=l9;var Ibe;let jne=Ibe=class extends Bne{constructor(t){super(t),this.type="line-chart"}clone(){return new Ibe({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};E([k({type:["line-chart"],readOnly:!0,json:{type:["linechart"],read:!1,write:Gne.write}})],jne.prototype,"type",void 0),jne=Ibe=E([ht("esri.popup.content.LineChartMediaInfo")],jne);const qje=jne;var Abe;let zne=Abe=class extends Bne{constructor(t){super(t),this.type="pie-chart"}clone(){return new Abe({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};E([k({type:["pie-chart"],readOnly:!0,json:{type:["piechart"],read:!1,write:Gne.write}})],zne.prototype,"type",void 0),zne=Abe=E([ht("esri.popup.content.PieChartMediaInfo")],zne);const Yje=zne,Xje={base:bbe,key:"type",defaultKeyValue:"image",typeMap:{"bar-chart":zje,"column-chart":Hje,"line-chart":qje,"pie-chart":Yje,image:Wje}};var Pbe;let s2=Pbe=class extends cR{constructor(t){super(t),this.activeMediaInfoIndex=null,this.attributes=null,this.description=null,this.mediaInfos=null,this.title=null,this.type="media"}readMediaInfos(t){return t&&t.map(e=>e.type==="image"?Wje.fromJSON(e):e.type==="barchart"?zje.fromJSON(e):e.type==="columnchart"?Hje.fromJSON(e):e.type==="linechart"?qje.fromJSON(e):e.type==="piechart"?Yje.fromJSON(e):void 0).filter(Boolean)}writeMediaInfos(t,e){e.mediaInfos=t&&t.map(i=>i.toJSON())}clone(){return new Pbe(hi({activeMediaInfoIndex:this.activeMediaInfoIndex,attributes:this.attributes,description:this.description,mediaInfos:this.mediaInfos,title:this.title}))}};E([k()],s2.prototype,"activeMediaInfoIndex",void 0),E([k({type:Object,json:{write:!0}})],s2.prototype,"attributes",void 0),E([k({type:String,json:{write:!0}})],s2.prototype,"description",void 0),E([k({types:[Xje]})],s2.prototype,"mediaInfos",void 0),E([Li("mediaInfos")],s2.prototype,"readMediaInfos",null),E([mr("mediaInfos")],s2.prototype,"writeMediaInfos",null),E([k({type:String,json:{write:!0}})],s2.prototype,"title",void 0),E([k({type:["media"],readOnly:!0,json:{read:!1,write:!0}})],s2.prototype,"type",void 0),s2=Pbe=E([ht("esri.popup.content.MediaContent")],s2);const fW=s2;var Obe;let mW=Obe=class extends Ni{constructor(t){super(t),this.field=null,this.order=null}clone(){return new Obe({field:this.field,order:this.order})}};E([k({type:String,json:{write:!0}})],mW.prototype,"field",void 0),E([k({type:["asc","desc"],json:{write:!0}})],mW.prototype,"order",void 0),mW=Obe=E([ht("esri.popup.support.RelatedRecordsInfoFieldOrder")],mW);const Rbe=mW;let NC=class extends ua(cR){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"}};E([k({type:String,json:{write:!0}})],NC.prototype,"description",void 0),E([k({type:Number,json:{type:xs,write:!0}})],NC.prototype,"displayCount",void 0),E([k({type:["list"],json:{write:!0}})],NC.prototype,"displayType",void 0),E([k({type:[Rbe],json:{write:!0}})],NC.prototype,"orderByFields",void 0),E([k({type:Number,json:{type:xs,write:!0}})],NC.prototype,"relationshipId",void 0),E([k({type:String,json:{write:!0}})],NC.prototype,"title",void 0),E([k({type:["relationship"],readOnly:!0,json:{read:!1,write:!0}})],NC.prototype,"type",void 0),NC=E([ht("esri.popup.content.RelationshipContent")],NC);const Hne=NC;var Mbe;let gW=Mbe=class extends cR{constructor(t){super(t),this.text=null,this.type="text"}clone(){return new Mbe({text:this.text})}};E([k({type:String,json:{write:!0}})],gW.prototype,"text",void 0),E([k({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],gW.prototype,"type",void 0),gW=Mbe=E([ht("esri.popup.content.TextContent")],gW);const u9=gW,NBt={base:null,key:"type",typeMap:{attachment:nW,media:fW,text:u9,expression:fbe,field:o9,relationship:Hne}};var Dbe;let FL=Dbe=class extends Ni{constructor(t){super(t),this.name=null,this.title=null,this.expression=null,this.returnType=null}clone(){return new Dbe({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};E([k({type:String,json:{write:!0}})],FL.prototype,"name",void 0),E([k({type:String,json:{write:!0}})],FL.prototype,"title",void 0),E([k({type:String,json:{write:!0}})],FL.prototype,"expression",void 0),E([k({type:["string","number"],json:{write:!0}})],FL.prototype,"returnType",void 0),FL=Dbe=E([ht("esri.popup.ExpressionInfo")],FL);const Wne=FL;var Fbe;let yW=Fbe=class extends Ni{constructor(t){super(t),this.returnTopmostRaster=null,this.showNoDataRecords=null}clone(){return new Fbe({showNoDataRecords:this.showNoDataRecords,returnTopmostRaster:this.returnTopmostRaster})}};E([k({type:Boolean,json:{write:!0}})],yW.prototype,"returnTopmostRaster",void 0),E([k({type:Boolean,json:{write:!0}})],yW.prototype,"showNoDataRecords",void 0),yW=Fbe=E([ht("esri.popup.LayerOptions")],yW);const $Bt=yW;var Lbe;let vW=Lbe=class extends Ni{constructor(t){super(t),this.showRelatedRecords=null,this.orderByFields=null}clone(){return new Lbe({showRelatedRecords:this.showRelatedRecords,orderByFields:this.orderByFields?hi(this.orderByFields):null})}};E([k({type:Boolean,json:{write:!0}})],vW.prototype,"showRelatedRecords",void 0),E([k({type:[Rbe],json:{write:!0}})],vW.prototype,"orderByFields",void 0),vW=Lbe=E([ht("esri.popup.RelatedRecordsInfo")],vW);const BBt=vW;let Kje=0;const R1=t=>{let e=class extends t{constructor(...i){super(...i),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+Kje++})}};return e=E([ht("esri.core.Identifiable")],e),e},qne=t=>{let e=class extends t{constructor(...i){super(...i),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Kje++})}};return e=E([ht("esri.core.NumericIdentifiable")],e),e};let Jje=class extends R1(class{}){};Jje=E([ht("esri.core.Identifiable")],Jje);var kbe;let o2=kbe=class extends R1(fn){constructor(t){super(t),this.active=!1,this.className=null,this.disabled=!1,this.id=null,this.indicator=!1,this.title=null,this.type=null,this.visible=!0}clone(){return new kbe({active:this.active,className:this.className,disabled:this.disabled,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible})}};E([k()],o2.prototype,"active",void 0),E([k()],o2.prototype,"className",void 0),E([k()],o2.prototype,"disabled",void 0),E([k()],o2.prototype,"id",void 0),E([k()],o2.prototype,"indicator",void 0),E([k()],o2.prototype,"title",void 0),E([k()],o2.prototype,"type",void 0),E([k()],o2.prototype,"visible",void 0),o2=kbe=E([ht("esri.support.actions.ActionBase")],o2);const Yne=o2;var Nbe;let Xne=Nbe=class extends Yne{constructor(t){super(t),this.image=null,this.type="button"}clone(){return new Nbe({active:this.active,className:this.className,disabled:this.disabled,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image})}};E([k()],Xne.prototype,"image",void 0),Xne=Nbe=E([ht("esri.support.Action.ActionButton")],Xne);const c9=Xne;var $be;let _W=$be=class extends Yne{constructor(t){super(t),this.image=null,this.type="toggle",this.value=!1}clone(){return new $be({active:this.active,className:this.className,disabled:this.disabled,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image,value:this.value})}};E([k()],_W.prototype,"image",void 0),E([k()],_W.prototype,"value",void 0),_W=$be=E([ht("esri.support.Action.ActionToggle")],_W);const Zje=_W,GBt="esri.PopupTemplate",VBt=Ei.getLogger(GBt),bW="relationships/",Qje="expression/",UBt=fr.ofType({key:"type",defaultKeyValue:"button",base:Yne,typeMap:{button:c9,toggle:Zje}}),jBt={base:cR,key:"type",typeMap:{media:fW,custom:OBt,text:u9,attachments:nW,fields:o9,expression:fbe,relationship:Hne}},zBt=["attachments","fields","media","text","expression","relationship"];let Cm=class extends ua(Ni){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(i=>SC(jBt,i)):typeof e=="string"||typeof e=="function"||e instanceof HTMLElement||Ip(e)?e:(VBt.error("content error","unsupported content value",{value:e}),null)}readContent(e,i){const{popupElements:r}=i;return Array.isArray(r)&&r.length>0?this._readPopupInfoElements(i.description,i.mediaInfos,r):this._readPopupInfo(i)}writeContent(e,i,r,n){typeof e!="string"?Array.isArray(e)&&(i.popupElements=e.filter(s=>zBt.includes(s.type)).map(s=>s&&s.toJSON(n)),i.popupElements.forEach(s=>{s.type==="attachments"?this._writeAttachmentContent(i):s.type==="media"?this._writeMediaContent(s,i):s.type==="text"?this._writeTextContent(s,i):s.type==="relationship"&&this._writeRelationshipContent(s,i)})):i.description=e}writeFieldInfos(e,i,r,n){const{content:s}=this,o=Array.isArray(s)?s:null;if(e){const a=o?o.filter(c=>c.type==="fields"):[],l=a.length&&a.every(c=>c.fieldInfos?.length);i.fieldInfos=e.filter(Boolean).map(c=>{const d=c.toJSON(n);return l&&(d.visible=!1),d})}if(o)for(const a of o)a.type==="fields"&&this._writeFieldsContent(a,i)}writeLayerOptions(e,i,r,n){i[r]=!e||e.showNoDataRecords===null&&e.returnTopmostRaster===null?null:e.toJSON(n)}writeTitle(e,i){i.title=e||""}async collectRequiredFields(e,i){const r=this.expressionInfos||[];await this._collectExpressionInfoFields(e,i,[...r,...this._getContentExpressionInfos(this.content,r)]),uR(e,i,[...this.outFields||[],...this._getActionsFields(this.actions),...this._getTitleFields(this.title),...this._getContentFields(this.content)])}async getRequiredFields(e){const i=new Set;return await this.collectRequiredFields(i,e),[...i].sort()}_writeFieldsContent(e,i){if(!Array.isArray(e.fieldInfos)||!e.fieldInfos.length)return;const r=hi(e.fieldInfos);Array.isArray(i.fieldInfos)?r.forEach(n=>{const s=i.fieldInfos.find(o=>o.fieldName.toLowerCase()===n.fieldName.toLowerCase());s?s.visible=!0:i.fieldInfos.push(n)}):i.fieldInfos=r}_writeAttachmentContent(e){e.showAttachments||(e.showAttachments=!0)}_writeRelationshipContent(e,i){const r=e.orderByFields?.map(s=>this._toFieldOrderJSON(s,e.relationshipId))||[],n=[...i.relatedRecordsInfo?.orderByFields||[],...r];i.relatedRecordsInfo={showRelatedRecords:!0,...n?.length&&{orderByFields:n}}}_writeTextContent(e,i){!i.description&&e.text&&(i.description=e.text)}_writeMediaContent(e,i){if(!Array.isArray(e.mediaInfos)||!e.mediaInfos.length)return;const r=hi(e.mediaInfos);Array.isArray(i.mediaInfos)?i.mediaInfos=[...i.mediaInfos,...r]:i.mediaInfos=r}_readPopupInfoElements(e,i,r){const n={description:!1,mediaInfos:!1};return r.map(s=>s.type==="media"?(s.mediaInfos||!i||n.mediaInfos||(s.mediaInfos=i,n.mediaInfos=!0),fW.fromJSON(s)):s.type==="text"?(s.text||!e||n.description||(s.text=e,n.description=!0),u9.fromJSON(s)):s.type==="attachments"?nW.fromJSON(s):s.type==="fields"?o9.fromJSON(s):s.type==="expression"?fbe.fromJSON(s):s.type==="relationship"?Hne.fromJSON(s):void 0).filter(Boolean)}_toRelationshipContent(e){const{field:i,order:r}=e;if(!i?.startsWith(bW))return null;const n=i.replace(bW,"").split("/");if(n.length!==2)return null;const s=parseInt(n[0],10),o=n[1];return typeof s=="number"&&o?Hne.fromJSON({relationshipId:s,orderByFields:[{field:o,order:r}]}):null}_toFieldOrderJSON(e,i){const{order:r,field:n}=e;return{field:`${bW}${i}/${n}`,order:r}}_readPopupInfo({description:e,mediaInfos:i,showAttachments:r,relatedRecordsInfo:n={showRelatedRecords:!1}}){const s=[];e?s.push(new u9({text:e})):s.push(new o9),Array.isArray(i)&&i.length&&s.push(fW.fromJSON({mediaInfos:i})),r&&s.push(nW.fromJSON({displayType:"auto"}));const{showRelatedRecords:o,orderByFields:a}=n;return o&&a?.length&&a.forEach(l=>{const c=this._toRelationshipContent(l);c&&s.push(c)}),s.length?s:e}_getContentElementFields(e){const i=e?.type;if(i==="attachments")return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description)];if(i==="custom")return e.outFields||[];if(i==="fields")return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description),...this._getFieldInfoFields(e.fieldInfos??this.fieldInfos)];if(i==="media"){const r=e.mediaInfos||[];return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description),...r.reduce((n,s)=>[...n,...this._getMediaInfoFields(s)],[])]}return i==="text"?this._extractFieldNames(e.text):[]}_getMediaInfoFields(e){const{caption:i,title:r,value:n}=e,s=n||{},{fields:o,normalizeField:a,tooltipField:l,sourceURL:c,linkURL:d}=s,p=[...this._extractFieldNames(r),...this._extractFieldNames(i),...this._extractFieldNames(c),...this._extractFieldNames(d),...o??[]];return a&&p.push(a),l&&p.push(l),p}_getContentExpressionInfos(e,i){return Array.isArray(e)?e.reduce((r,n)=>[...r,...n.type==="expression"&&n.expressionInfo?[n.expressionInfo]:[]],i):[]}_getContentFields(e){return typeof e=="string"?this._extractFieldNames(e):Array.isArray(e)?e.reduce((i,r)=>[...i,...this._getContentElementFields(r)],[]):[]}async _collectExpressionInfoFields(e,i,r){r&&await Promise.all(r.map(n=>K0(e,i,n.expression)))}_getFieldInfoFields(e){return e?e.filter(i=>i.visible===void 0||!!i.visible).map(i=>i.fieldName).filter(i=>!i.startsWith(bW)&&!i.startsWith(Qje)):[]}_getActionsFields(e){return e?e.toArray().reduce((i,r)=>[...i,...this._getActionFields(r)],[]):[]}_getActionFields(e){const{className:i,title:r,type:n}=e,s=n==="button"||n==="toggle"?e.image:"";return[...this._extractFieldNames(r),...this._extractFieldNames(i),...this._extractFieldNames(s)]}_getTitleFields(e){return typeof e=="string"?this._extractFieldNames(e):[]}_extractFieldNames(e){if(!e||typeof e!="string")return[];const i=/{[^}]*}/g,r=e.match(i);if(!r)return[];const n=/\{(\w+):.+\}/,s=r.filter(o=>!(o.indexOf(`{${bW}`)===0||o.indexOf(`{${Qje}`)===0)).map(o=>o.replace(n,"{$1}"));return s?s.map(o=>o.slice(1,-1)):[]}};E([k({type:UBt})],Cm.prototype,"actions",void 0),E([k()],Cm.prototype,"content",void 0),E([Zs("content")],Cm.prototype,"castContent",null),E([Li("content",["description","fieldInfos","popupElements","mediaInfos","showAttachments","relatedRecordsInfo"])],Cm.prototype,"readContent",null),E([mr("content",{popupElements:{type:fr.ofType(NBt)},showAttachments:{type:Boolean},mediaInfos:{type:fr.ofType(Xje)},description:{type:String},relatedRecordsInfo:{type:BBt}})],Cm.prototype,"writeContent",null),E([k({type:[Wne],json:{write:!0}})],Cm.prototype,"expressionInfos",void 0),E([k({type:[hW]})],Cm.prototype,"fieldInfos",void 0),E([mr("fieldInfos")],Cm.prototype,"writeFieldInfos",null),E([k({type:$Bt})],Cm.prototype,"layerOptions",void 0),E([mr("layerOptions")],Cm.prototype,"writeLayerOptions",null),E([k({type:Boolean,json:{read:{source:"showLastEditInfo"},write:{target:"showLastEditInfo"},default:!0}})],Cm.prototype,"lastEditInfoEnabled",void 0),E([k()],Cm.prototype,"outFields",void 0),E([k()],Cm.prototype,"overwriteActions",void 0),E([k()],Cm.prototype,"returnGeometry",void 0),E([k({json:{type:String}})],Cm.prototype,"title",void 0),E([mr("title")],Cm.prototype,"writeTitle",null),Cm=E([ht("esri.PopupTemplate")],Cm);const yh=Cm,e7e=new Bs({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 HBt=0,h9=class extends Ni{constructor(e){super(e),this.id="sym"+HBt++,this.type=null,this.color=new $r([0,0,0,1])}readColor(e){return e&&e[0]!=null?[e[0],e[1],e[2],e[3]/255]:e}async collectRequiredFields(e,i){}hash(){return JSON.stringify(this.toJSON())}clone(){}};E([k({type:e7e.apiValues,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:e7e.write}}})],h9.prototype,"type",void 0),E([k({type:$r,json:{write:{allowNull:!0}}})],h9.prototype,"color",void 0),E([Li("color")],h9.prototype,"readColor",null),h9=E([ht("esri.symbols.Symbol")],h9);const zg=h9;var Bbe;let hR=Bbe=class extends zg{constructor(t){super(t),this.data=null,this.type="cim"}readData(t,e){return e}writeData(t,e){if(t)for(const i in t)e[i]=t[i]}async collectRequiredFields(t,e){if(this.data?.type==="CIMSymbolReference"){const i=this.data.primitiveOverrides;if(i){const r=i.map(n=>{const s=n.valueExpressionInfo;return K0(t,e,s.expression)});await Promise.all(r)}}}clone(){return new Bbe({data:hi(this.data)})}hash(){return Gc(JSON.stringify(this.data)).toString()}};E([k({json:{write:!1}})],hR.prototype,"color",void 0),E([k({json:{write:!0}})],hR.prototype,"data",void 0),E([Li("data",["symbol"])],hR.prototype,"readData",null),E([mr("data",{})],hR.prototype,"writeData",null),E([Hr({CIMSymbolReference:"cim"},{readOnly:!0})],hR.prototype,"type",void 0),hR=Bbe=E([ht("esri.symbols.CIMSymbol")],hR);const wW=hR;let d9=class extends Ni{constructor(e){super(e),this.enabled=!0,this.type=null}writeEnabled(e,i,r){e||(i[r]=e)}};E([k({type:Boolean,json:{read:{source:"enable"},write:{target:"enable"}}})],d9.prototype,"enabled",void 0),E([mr("enabled")],d9.prototype,"writeEnabled",null),E([k({type:["icon","object","line","path","fill","water","extrude","text"],readOnly:!0})],d9.prototype,"type",void 0),d9=E([ht("esri.symbols.Symbol3DLayer")],d9);const $C=d9,WBt=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i,qBt="screenUtils.toPt: input not recognized!",t7e=96;function on(t){return t?t/72*t7e:0}function Xy(t){return t?72*t/t7e:0}function Da(t){if(typeof t=="string"){const e=t.match(WBt);if(e){const i=Number(e[1]),r=e[3]&&e[3].toLowerCase(),n=t.charAt(0)==="-",s=r==="px"?Xy(i):i;return n?-s:s}return console.warn(qBt),null}return t}function Vh(t=0,e=0){return{x:t,y:e}}function YBt(t=0,e=0){return[t,e]}function Kne(t){const e=qre(100*(1-t));return Math.max(0,Math.min(e,100))}function p9(t){const e=1-t/100;return Math.max(0,Math.min(e,1))}function XBt(t,e){const i=e.transparency!=null?p9(e.transparency):1,r=e.color;return r&&Array.isArray(r)?new $r([r[0]||0,r[1]||0,r[2]||0,i]):null}function KBt(t,e){e.color=t.toJSON().slice(0,3);const i=Kne(t.a);i!==0&&(e.transparency=i)}const dR={type:$r,json:{type:[xs],default:null,read:{source:["color","transparency"],reader:XBt},write:{target:{color:{type:[xs]},transparency:{type:xs}},writer:KBt}}},BC={type:Number,cast:Da,json:{write:!0}};let LL=class extends Ni{constructor(e){super(e),this.color=new $r([0,0,0,1]),this.extensionLength=0,this.size=Xy(1)}clone(){}cloneProperties(){return{color:hi(this.color),size:this.size,extensionLength:this.extensionLength}}};E([k({type:["solid","sketch"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],LL.prototype,"type",void 0),E([k(dR)],LL.prototype,"color",void 0),E([k({...BC,json:{write:{overridePolicy:t=>({enabled:!!t})}}})],LL.prototype,"extensionLength",void 0),E([k(BC)],LL.prototype,"size",void 0),LL=E([ht("esri.symbols.edges.Edges3D")],LL);const Gbe=LL;var Vbe;let Jne=Vbe=class extends Gbe{constructor(t){super(t),this.type="sketch"}clone(){return new Vbe(this.cloneProperties())}};E([Hr({sketch:"sketch"},{readOnly:!0})],Jne.prototype,"type",void 0),Jne=Vbe=E([ht("esri.symbols.edges.SketchEdges3D")],Jne);const JBt=Jne;var Ube;let Zne=Ube=class extends Gbe{constructor(t){super(t),this.type="solid"}clone(){return new Ube(this.cloneProperties())}};E([Hr({solid:"solid"},{readOnly:!0})],Zne.prototype,"type",void 0),Zne=Ube=E([ht("esri.symbols.support.SolidEdges3D")],Zne);const jbe={types:{key:"type",base:Gbe,typeMap:{solid:Zne,sketch:JBt}},json:{write:!0}};var zbe;let M1=zbe=class extends Ni{constructor(t){super(t),this.color=null}clone(){const t={color:ye(this.color)?this.color.clone():null};return new zbe(t)}};E([k(dR)],M1.prototype,"color",void 0),M1=zbe=E([ht("esri.symbols.support.Symbol3DMaterial")],M1);var Hbe;let pR=Hbe=class extends $C{constructor(t){super(t),this.type="extrude",this.size=1,this.material=null,this.castShadows=!0,this.edges=null}clone(){return new Hbe({edges:this.edges&&this.edges.clone(),enabled:this.enabled,material:ye(this.material)?this.material.clone():null,castShadows:this.castShadows,size:this.size})}};E([Hr({Extrude:"extrude"},{readOnly:!0})],pR.prototype,"type",void 0),E([k({type:Number,json:{write:{enabled:!0,isRequired:!0}},nonNullable:!0})],pR.prototype,"size",void 0),E([k({type:M1,json:{write:!0}})],pR.prototype,"material",void 0),E([k({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],pR.prototype,"castShadows",void 0),E([k(jbe)],pR.prototype,"edges",void 0),pR=Hbe=E([ht("esri.symbols.ExtrudeSymbol3DLayer")],pR);const i7e=pR;let xW=class extends zg{constructor(e){super(e),this.type="simple-line",this.width=.75}hash(){return`${this.type}.${this.width}`}};E([Hr({esriSLS:"simple-line"},{readOnly:!0})],xW.prototype,"type",void 0),E([k({type:Number,cast:Da,json:{write:!0}})],xW.prototype,"width",void 0),xW=E([ht("esri.symbols.LineSymbol")],xW);const ZBt=xW,QBt=["begin","end","begin-end"],r7e=["arrow","circle","square","diamond","cross","x"];var Wbe;let GC=Wbe=class extends Ni{constructor(t){super(t),this.placement="begin-end",this.type="line-marker",this.style="arrow"}writeStyle(t,e,i,r){e[i]=r?.origin==="web-map"?"arrow":t}set color(t){this._set("color",t)}readColor(t){return t&&t[0]!=null?[t[0],t[1],t[2],t[3]/255]:t}writeColor(t,e,i,r){r?.origin==="web-map"||(e[i]=t)}clone(){return new Wbe({color:hi(this.color),placement:this.placement,style:this.style})}hash(){return`${this.placement}.${this.color?.hash()}.${this.style}`}};E([k({type:["begin","end","begin-end"],json:{write:!0}})],GC.prototype,"placement",void 0),E([Hr({"line-marker":"line-marker"},{readOnly:!0}),k({json:{origins:{"web-map":{write:!1}}}})],GC.prototype,"type",void 0),E([k({type:r7e})],GC.prototype,"style",void 0),E([mr("style")],GC.prototype,"writeStyle",null),E([k({type:$r,value:null,json:{write:{allowNull:!0}}})],GC.prototype,"color",null),E([Li("color")],GC.prototype,"readColor",null),E([mr("color")],GC.prototype,"writeColor",null),GC=Wbe=E([ht("esri.symbols.LineSymbolMarker")],GC);const eGt=GC;var qbe;const Ybe=new Bs({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 uA=qbe=class extends ZBt{constructor(...t){super(...t),this.type="simple-line",this.style="solid",this.cap="round",this.join="round",this.marker=null,this.miterLimit=2}normalizeCtorArgs(t,e,i,r,n,s){if(t&&typeof t!="string")return t;const o={};return t!=null&&(o.style=t),e!=null&&(o.color=e),i!=null&&(o.width=Da(i)),r!=null&&(o.cap=r),n!=null&&(o.join=n),s!=null&&(o.miterLimit=Da(s)),o}clone(){return new qbe({color:hi(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()}`}};E([Hr({esriSLS:"simple-line"},{readOnly:!0})],uA.prototype,"type",void 0),E([k({type:Ybe.apiValues,json:{read:Ybe.read,write:Ybe.write}})],uA.prototype,"style",void 0),E([k({type:["butt","round","square"],json:{write:{overridePolicy:(t,e,i)=>({enabled:t!=="round"&&(i==null||i.origin==null)})}}})],uA.prototype,"cap",void 0),E([k({type:["miter","round","bevel"],json:{write:{overridePolicy:(t,e,i)=>({enabled:t!=="round"&&(i==null||i.origin==null)})}}})],uA.prototype,"join",void 0),E([k({types:{key:"type",base:null,defaultKeyValue:"line-marker",typeMap:{"line-marker":eGt}},json:{write:!0,origins:{"web-scene":{write:!1}}}})],uA.prototype,"marker",void 0),E([k({type:Number,json:{read:!1,write:!1}})],uA.prototype,"miterLimit",void 0),uA=qbe=E([ht("esri.symbols.SimpleLineSymbol")],uA);const Tm=uA;let SW=class extends zg{constructor(e){super(e),this.outline=null,this.type=null}hash(){return`${this.type}.${this.outline&&this.outline.hash()}`}};E([k({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":Tm}},json:{default:null,write:!0}})],SW.prototype,"outline",void 0),E([k({type:["simple-fill","picture-fill"],readOnly:!0})],SW.prototype,"type",void 0),SW=E([ht("esri.symbols.FillSymbol")],SW);const n7e=SW;let Qne=class extends Ni{constructor(e){super(e)}clone(){}};E([k({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],Qne.prototype,"type",void 0),Qne=E([ht("esri.symbols.patterns.LinePattern3D")],Qne);const s7e=Qne,tGt=["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 Xbe;const iGt=jo()({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 CW=Xbe=class extends s7e{constructor(t){super(t),this.type="style",this.style="solid"}clone(){const t={style:this.style};return new Xbe(t)}};E([k({type:["style"]})],CW.prototype,"type",void 0),E([Hr(iGt),k({type:tGt})],CW.prototype,"style",void 0),CW=Xbe=E([ht("esri.symbols.patterns.LineStylePattern3D")],CW);const Kbe=CW;let ese=class extends Ni{constructor(e){super(e)}clone(){}};E([k({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],ese.prototype,"type",void 0),ese=E([ht("esri.symbols.patterns.Pattern3D")],ese);const o7e=ese,rGt=["backward-diagonal","cross","diagonal-cross","forward-diagonal","horizontal","none","solid","vertical"];var Jbe;let TW=Jbe=class extends o7e{constructor(t){super(t),this.type="style",this.style="solid"}clone(){const t={style:this.style};return new Jbe(t)}};E([k({type:["style"]})],TW.prototype,"type",void 0),E([k({type:rGt,json:{read:!0,write:!0}})],TW.prototype,"style",void 0),TW=Jbe=E([ht("esri.symbols.patterns.StylePattern3D")],TW);const a7e=TW,nGt={types:{key:"type",base:o7e,typeMap:{style:a7e}},json:{write:!0}},l7e={types:{key:"type",base:s7e,typeMap:{style:Kbe}},json:{write:!0}},EW=new $r("white");new $r("black");const sGt=new $r([255,255,255,0]);function oGt(t){return t.r===0&&t.g===0&&t.b===0}var Zbe;let IW=Zbe=class extends M1{constructor(t){super(t),this.colorMixMode=null}clone(){const t={color:ye(this.color)?this.color.clone():null,colorMixMode:this.colorMixMode};return new Zbe(t)}};E([Hr({multiply:"multiply",replace:"replace",tint:"tint"})],IW.prototype,"colorMixMode",void 0),IW=Zbe=E([ht("esri.symbols.support.Symbol3DFillMaterial")],IW);function oDr(t){return t}function _o(t=uGt){return[t[0],t[1],t[2],t[3]]}function aGt(t){return[t[0],t[1],t[2],t[3]]}function u7e(t,e){return t!==e&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]),t}function tse(t,e,i,r,n=_o()){return n[0]=t,n[1]=e,n[2]=i,n[3]=r,n}function fR(t,e=_o()){return e[0]=t.xmin,e[1]=t.ymin,e[2]=t.xmax,e[3]=t.ymax,e}function kL(t,e){return new vr({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3],spatialReference:e})}function ise(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function Qbe(t,e,i){if(lt(e))u7e(i,t);else if("length"in e)iwe(e)?(i[0]=Math.min(t[0],e[0]),i[1]=Math.min(t[1],e[1]),i[2]=Math.max(t[2],e[2]),i[3]=Math.max(t[3],e[3])):e.length!==2&&e.length!==3||(i[0]=Math.min(t[0],e[0]),i[1]=Math.min(t[1],e[1]),i[2]=Math.max(t[2],e[0]),i[3]=Math.max(t[3],e[1]));else switch(e.type){case"extent":i[0]=Math.min(t[0],e.xmin),i[1]=Math.min(t[1],e.ymin),i[2]=Math.max(t[2],e.xmax),i[3]=Math.max(t[3],e.ymax);break;case"point":i[0]=Math.min(t[0],e.x),i[1]=Math.min(t[1],e.y),i[2]=Math.max(t[2],e.x),i[3]=Math.max(t[3],e.y)}}function c7e(t){return lt(t)||t[0]>=t[2]?0:t[2]-t[0]}function h7e(t){return t[1]>=t[3]?0:t[3]-t[1]}function d7e(t){return c7e(t)*h7e(t)}function lGt(t,e){return p7e(t,e[0],e[1])}function p7e(t,e,i){return e>=t[0]&&i>=t[1]&&e<=t[2]&&i<=t[3]}function rse(t,e,i){return e[0]>=t[0]-i&&e[1]>=t[1]-i&&e[0]<=t[2]+i&&e[1]<=t[3]+i}function nse(t,e){return Math.max(e[0],t[0])<=Math.min(e[2],t[2])&&Math.max(e[1],t[1])<=Math.min(e[3],t[3])}function ewe(t,e){return e[0]>=t[0]&&e[2]<=t[2]&&e[1]>=t[1]&&e[3]<=t[3]}function twe(t){return t?u7e(t,sse):_o(sse)}function iwe(t){return t!=null&&t.length===4}function f7e(t,e){return iwe(t)&&iwe(e)?t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]:t===e}const sse=[1/0,1/0,-1/0,-1/0],uGt=[0,0,0,0];function aDr(t){return t}function Qb(t=_Gt){return[t[0],t[1],t[2],t[3],t[4],t[5]]}function ose(t,e,i,r,n,s,o=Qb()){return o[0]=t,o[1]=e,o[2]=i,o[3]=r,o[4]=n,o[5]=s,o}function cGt(t,e){const i=isFinite(t[2])||isFinite(t[5]);return new vr(i?{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],zmin:t[2],zmax:t[5],spatialReference:e}:{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],spatialReference:e})}function AW(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.min(t[2],e[2]),t[3]=Math.max(t[3],e[3]),t[4]=Math.max(t[4],e[4]),t[5]=Math.max(t[5],e[5])}function PW(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.min(t[2],e[2]),t[3]=Math.max(t[3],e[0]),t[4]=Math.max(t[4],e[1]),t[5]=Math.max(t[5],e[2])}function hGt(t){return t[0]>=t[3]?0:t[3]-t[0]}function dGt(t){return t[1]>=t[4]?0:t[4]-t[1]}function pGt(t){return t[2]>=t[5]?0:t[5]-t[2]}function fGt(t,e=[0,0,0]){return e[0]=hGt(t),e[1]=dGt(t),e[2]=pGt(t),e}function mGt(t,e,i=t){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i!==t&&(i[3]=t[3],i[4]=t[4],i[5]=t[5]),i}function gGt(t,e,i=t){return i[3]=e[0],i[4]=e[1],i[5]=e[2],i!==t&&(i[0]=t[0],i[1]=t[1],i[2]=t[2]),t}function m7e(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function g7e(t){return t?m7e(t,f9):Qb(f9)}function yGt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=Number.NEGATIVE_INFINITY,t[3]=e[2],t[4]=e[3],t[5]=Number.POSITIVE_INFINITY,t}function y7e(t,e,i,r,n){return t[0]=e,t[1]=i,t[2]=Number.NEGATIVE_INFINITY,t[3]=r,t[4]=n,t[5]=Number.POSITIVE_INFINITY,t}function rwe(t){return t.length===6}function vGt(t,e,i){if(lt(t)||lt(e))return t===e;if(!rwe(t)||!rwe(e))return!1;if(i){for(let r=0;r{const e=Ld(t);return e===0?1:Hl(e,.1,4)},nonNullable:!0},PGt=["left","right","center"],OGt=["baseline","top","middle","bottom"],b7e={type:PGt,nonNullable:!0},w7e={type:OGt,nonNullable:!0};var owe;let hA=owe=class extends Ni{constructor(t){super(t),this.decoration="none",this.family="sans-serif",this.size=9,this.style="normal",this.weight="normal"}castSize(t){return Da(t)}clone(){return new owe({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}`}};E([k({type:EGt,json:{default:"none",write:!0}})],hA.prototype,"decoration",void 0),E([k({type:String,json:{write:!0}})],hA.prototype,"family",void 0),E([k({type:Number,json:{write:{overridePolicy:(t,e,i)=>({enabled:!i||!i.textSymbol3D})}}})],hA.prototype,"size",void 0),E([Zs("size")],hA.prototype,"castSize",null),E([k({type:IGt,json:{default:"normal",write:!0}})],hA.prototype,"style",void 0),E([k({type:AGt,json:{default:"normal",write:!0}})],hA.prototype,"weight",void 0),hA=owe=E([ht("esri.symbols.Font")],hA);const lse=hA;function ew(t,e){const i=e&&e.url&&e.url.path;if(t&&i&&(t=Vy(t,i,{preserveProtocolRelative:!0}),e.portalItem&&e.readResourcePaths)){const r=ine(t,e.portalItem.itemUrl);r!=null&&RGt.test(r)&&e.readResourcePaths.push(e.portalItem.resourceFromPath(r).path)}return uwe(t,e&&e.portal)}function a2(t,e,i=$L.YES){if(t==null)return t;!jg(t)&&e&&e.blockedRelativeUrls&&e.blockedRelativeUrls.push(t);let r=Vy(t);if(e){const n=e.verifyItemRelativeUrls&&e.verifyItemRelativeUrls.rootPath||e.url&&e.url.path;if(n){const s=uwe(n,e.portal),o=uwe(r,e.portal);r=ine(o,s,s),r!=null&&r!==o&&r!==t&&e.verifyItemRelativeUrls&&e.verifyItemRelativeUrls.writtenUrls.push(r)}}return r=lwe(r,e?.portal),jg(r)&&(r=Uy(r)),e?.resources&&e?.portalItem&&!jg(r)&&!E1(r)&&i===$L.YES&&e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(r),compress:!1}),r}function m9(t,e,i){return ew(t,i)}function dA(t,e,i,r){const n=a2(t,r);n!==void 0&&(e[i]=n)}const x7e=/\/items\/([^\/]+)\/resources\/(.*)/,RGt=/^\.\/resources\//;function awe(t){return(t?.match(x7e)??null)?.[1]??null}function S7e(t){const e=t?.match(x7e)??null;if(e==null)return null;const i=e[2],r=i.lastIndexOf("/");if(r===-1){const{path:o,extension:a}=jVe(i);return{prefix:null,filename:o,extension:a}}const{path:n,extension:s}=jVe(i.slice(r+1));return{prefix:i.slice(0,r),filename:n,extension:s}}function lwe(t,e){return e&&!e.isPortal&&e.urlKey&&e.customBaseUrl?o1e(t,`${e.urlKey}.${e.customBaseUrl}`,e.portalHostname):t}function uwe(t,e){if(!e||e.isPortal||!e.urlKey||!e.customBaseUrl)return t;const i=`${e.urlKey}.${e.customBaseUrl}`,r=Z_e();return Gy(r,`${r.scheme}://${i}`)?o1e(t,e.portalHostname,i):o1e(t,i,e.portalHostname)}var $L;(function(t){t[t.YES=0]="YES",t[t.NO=1]="NO"})($L||($L={}));const MGt=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return $L},ensureMainOnlineDomain:lwe,fromJSON:ew,itemIdFromResourceUrl:awe,prefixAndFilenameFromResourceUrl:S7e,read:m9,toJSON:a2,write:dA},Symbol.toStringTag,{value:"Module"}));var cwe;const DGt=jo()({circle:"circle",square:"square",cross:"cross",x:"x",kite:"kite",triangle:"triangle"});let BL=cwe=class extends Ni{constructor(t){super(t)}readHref(t,e,i){return t?ew(t,i):e.dataURI}writeHref(t,e,i,r){t&&(E1(t)?e.dataURI=t:(e.href=a2(t,r),jg(e.href)&&(e.href=Uy(e.href))))}clone(){return new cwe({href:this.href,primitive:this.primitive})}};E([k({type:String,json:{write:!0,read:{source:["href","dataURI"]}}})],BL.prototype,"href",void 0),E([Li("href")],BL.prototype,"readHref",null),E([mr("href",{href:{type:String},dataURI:{type:String}})],BL.prototype,"writeHref",null),E([Hr(DGt)],BL.prototype,"primitive",void 0),BL=cwe=E([ht("esri.symbols.support.IconSymbol3DLayerResource")],BL);var hwe;let g9=hwe=class extends fn{constructor(){super(...arguments),this.x=0,this.y=0}clone(){return new hwe({x:this.x,y:this.y})}};E([k({type:Number})],g9.prototype,"x",void 0),E([k({type:Number})],g9.prototype,"y",void 0),g9=hwe=E([ht("esri.symbols.support.Symbol3DAnchorPosition2D")],g9);var dwe;let RW=dwe=class extends Ni{constructor(t){super(t),this.color=new $r([0,0,0,1]),this.size=Xy(1)}clone(){const t={color:ye(this.color)?this.color.clone():null,size:this.size};return new dwe(t)}};E([k(dR)],RW.prototype,"color",void 0),E([k(BC)],RW.prototype,"size",void 0),RW=dwe=E([ht("esri.symbols.support.Symbol3DIconOutline")],RW);var y9;const C7e="esri.symbols.IconSymbol3DLayer";let VC=y9=class extends $C{constructor(t){super(t),this.material=null,this.resource=null,this.type="icon",this.size=12,this.anchor="center",this.anchorPosition=null,this.outline=null}clone(){return new y9({anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),enabled:this.enabled,material:ye(this.material)?this.material.clone():null,outline:ye(this.outline)?this.outline.clone():null,resource:this.resource&&this.resource.clone(),size:this.size})}static fromSimpleMarkerSymbol(t){const e=t.color||EW,i=T7e(t),r=t.outline&&t.outline.width>0?{size:t.outline.width,color:(t.outline.color||EW).clone()}:null;return new y9({size:t.size,resource:{primitive:LGt(t.style)},material:{color:e},outline:r,anchor:i?"relative":void 0,anchorPosition:i})}static fromPictureMarkerSymbol(t){const e=!t.color||oGt(t.color)?EW:t.color,i=T7e(t);return new y9({size:t.width<=t.height?t.height:t.width,resource:{href:t.url},material:{color:e.clone()},anchor:i?"relative":void 0,anchorPosition:i})}static fromCIMSymbol(t){return new y9({resource:{href:BVe({mediaType:"application/json",data:JSON.stringify(t.data)})}})}};function T7e(t){const e="width"in t?t.width:t.size,i="height"in t?t.height:t.size,r=E7e(t.xoffset),n=E7e(t.yoffset);return(r||n)&&e&&i?{x:-r/e,y:n/i}:null}function E7e(t){return isFinite(t)?t:0}E([k({type:M1,json:{write:!0}})],VC.prototype,"material",void 0),E([k({type:BL,json:{write:!0}})],VC.prototype,"resource",void 0),E([Hr({Icon:"icon"},{readOnly:!0})],VC.prototype,"type",void 0),E([k(BC)],VC.prototype,"size",void 0),E([Hr({center:"center",left:"left",right:"right",top:"top",bottom:"bottom",topLeft:"top-left",topRight:"top-right",bottomLeft:"bottom-left",bottomRight:"bottom-right",relative:"relative"}),k({json:{default:"center"}})],VC.prototype,"anchor",void 0),E([k({type:g9,json:{type:[Number],read:{reader:t=>new g9({x:t[0],y:t[1]})},write:{writer:(t,e)=>{e.anchorPosition=[t.x,t.y]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],VC.prototype,"anchorPosition",void 0),E([k({type:RW,json:{write:!0}})],VC.prototype,"outline",void 0),VC=y9=E([ht(C7e)],VC);const FGt={circle:"circle",cross:"cross",diamond:"kite",square:"square",x:"x",triangle:"triangle",path:null};function LGt(t){return FGt[t]||(Ei.getLogger(C7e).warn(`${t} cannot be mapped to Icon symbol. Fallback to "circle"`),"circle")}const GL=VC;let VL=class extends ua(Ni){constructor(e){super(e),this.type="style",this.placement="begin-end",this.style="arrow",this.color=null}equals(e){return ye(e)&&e.placement===this.placement&&e.style===this.style&&(lt(this.color)&<(e.color)||ye(this.color)&&ye(e.color)&&this.color.toJSON()===e.color.toJSON())}};E([k({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],VL.prototype,"type",void 0),E([k({type:QBt,json:{default:"begin-end",write:!0}})],VL.prototype,"placement",void 0),E([k({type:r7e,json:{default:"arrow",write:!0}})],VL.prototype,"style",void 0),E([k({type:$r,json:{type:[xs],default:null,write:!0}})],VL.prototype,"color",void 0),VL=E([ht("esri.symbols.LineStyleMarker3D")],VL);const pwe=VL;var use;let UC=use=class extends $C{constructor(t){super(t),this.material=null,this.type="line",this.join="miter",this.cap="butt",this.size=Xy(1),this.pattern=null,this.marker=null}clone(){const t={enabled:this.enabled,material:ye(this.material)?this.material.clone():null,size:this.size,join:this.join,cap:this.cap,pattern:ye(this.pattern)?this.pattern.clone():null,marker:ye(this.marker)?this.marker.clone():null};return new use(t)}static fromSimpleLineSymbol(t){const e={enabled:!0,size:t.width??Xy(1),cap:t.cap||"butt",join:t.join||"miter",pattern:t.style&&t.style!=="inside-frame"?new Kbe({style:t.style}):null,material:new M1({color:(t.color||EW).clone()}),marker:t.marker?new pwe({placement:t.marker.placement,style:t.marker.style,color:t.marker.color?.clone()??null}):null};return new use(e)}};E([k({type:M1,json:{write:!0}})],UC.prototype,"material",void 0),E([Hr({Line:"line"},{readOnly:!0})],UC.prototype,"type",void 0),E([k({type:v7e,json:{write:!0,default:"miter"}})],UC.prototype,"join",void 0),E([k({type:nwe,json:{write:!0,default:"butt"}})],UC.prototype,"cap",void 0),E([k(BC)],UC.prototype,"size",void 0),E([k(l7e)],UC.prototype,"pattern",void 0),E([k({types:{key:"type",base:pwe,typeMap:{style:pwe}},json:{write:!0}})],UC.prototype,"marker",void 0),UC=use=E([ht("esri.symbols.LineSymbol3DLayer")],UC);const MW=UC;var fwe;const kGt=jo()({sphere:"sphere",cylinder:"cylinder",cube:"cube",cone:"cone",diamond:"diamond",tetrahedron:"tetrahedron",invertedCone:"inverted-cone"});let DW=fwe=class extends Ni{clone(){return new fwe({href:this.href,primitive:this.primitive})}};E([k({type:String,json:{read:m9,write:dA}})],DW.prototype,"href",void 0),E([Hr(kGt)],DW.prototype,"primitive",void 0),DW=fwe=E([ht("esri.symbols.support.ObjectSymbol3DLayerResource")],DW);var mwe;let UL=mwe=class extends fn{constructor(){super(...arguments),this.x=0,this.y=0,this.z=0}clone(){return new mwe({x:this.x,y:this.y,z:this.z})}};E([k({type:Number})],UL.prototype,"x",void 0),E([k({type:Number})],UL.prototype,"y",void 0),E([k({type:Number})],UL.prototype,"z",void 0),UL=mwe=E([ht("esri.symbols.support.Symbol3DAnchorPosition3D")],UL);var gwe;let Ky=gwe=class extends $C{constructor(t){super(t),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 gwe({heading:this.heading,tilt:this.tilt,roll:this.roll,anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),depth:this.depth,enabled:this.enabled,height:this.height,material:ye(this.material)?this.material.clone():null,castShadows:this.castShadows,resource:this.resource&&this.resource.clone(),width:this.width})}get isPrimitive(){return!this.resource||typeof this.resource.href!="string"}};E([k({type:M1,json:{write:!0}})],Ky.prototype,"material",void 0),E([k({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],Ky.prototype,"castShadows",void 0),E([k({type:DW,json:{write:!0}})],Ky.prototype,"resource",void 0),E([Hr({Object:"object"},{readOnly:!0})],Ky.prototype,"type",void 0),E([k({type:Number,json:{write:!0}})],Ky.prototype,"width",void 0),E([k({type:Number,json:{write:!0}})],Ky.prototype,"height",void 0),E([k({type:Number,json:{write:!0}})],Ky.prototype,"depth",void 0),E([Hr({center:"center",top:"top",bottom:"bottom",origin:"origin",relative:"relative"}),k({json:{default:"origin"}})],Ky.prototype,"anchor",void 0),E([k({type:UL,json:{type:[Number],read:{reader:t=>new UL({x:t[0],y:t[1],z:t[2]})},write:{writer:(t,e)=>{e.anchorPosition=[t.x,t.y,t.z]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],Ky.prototype,"anchorPosition",void 0),E([k({type:Number,json:{write:!0}})],Ky.prototype,"heading",void 0),E([k({type:Number,json:{write:!0}})],Ky.prototype,"tilt",void 0),E([k({type:Number,json:{write:!0}})],Ky.prototype,"roll",void 0),E([k({readOnly:!0})],Ky.prototype,"isPrimitive",null),Ky=gwe=E([ht("esri.symbols.ObjectSymbol3DLayer")],Ky);const ywe=Ky;var vwe;let J0=vwe=class extends $C{constructor(t){super(t),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(t,e){return t??(e.height==null&&e.size!=null?e.size:void 0)}readHeight(t,e){return t??(e.width==null&&e.size!=null?e.size:void 0)}clone(){return new vwe({enabled:this.enabled,material:ye(this.material)?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})}};E([k({type:M1,json:{write:!0}})],J0.prototype,"material",void 0),E([k({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],J0.prototype,"castShadows",void 0),E([Hr({Path:"path"},{readOnly:!0})],J0.prototype,"type",void 0),E([k({type:["circle","quad"],json:{write:!0,default:"circle"}})],J0.prototype,"profile",void 0),E([k({type:v7e,json:{write:!0,default:"miter"}})],J0.prototype,"join",void 0),E([k({type:TGt,json:{write:!0,default:"butt"}})],J0.prototype,"cap",void 0),E([k({type:Number,json:{write:{enabled:!0,target:{width:{type:Number},size:{type:Number}}}}})],J0.prototype,"width",void 0),E([Li("width",["width","size","height"])],J0.prototype,"readWidth",null),E([k({type:Number,json:{write:!0}})],J0.prototype,"height",void 0),E([Li("height",["height","size","width"])],J0.prototype,"readHeight",null),E([k({type:["center","bottom","top"],json:{write:!0,default:"center"}})],J0.prototype,"anchor",void 0),E([k({type:["heading","all"],json:{write:!0,default:"all"}})],J0.prototype,"profileRotation",void 0),J0=vwe=E([ht("esri.symbols.PathSymbol3DLayer")],J0);const _we=J0;var bwe;let v9=bwe=class extends Ni{constructor(){super(...arguments),this.color=new $r([0,0,0,1]),this.size=0}clone(){const t={color:hi(this.color),size:this.size};return new bwe(t)}};E([k(dR)],v9.prototype,"color",void 0),E([k(BC)],v9.prototype,"size",void 0),v9=bwe=E([ht("esri.symbols.support.Symbol3DHalo")],v9);let FW=class extends ua(Ni){constructor(e){super(e),this.color=null}};E([k(dR)],FW.prototype,"color",void 0),FW=E([ht("esri.symbols.support.Symbol3DTextBackground")],FW);var cse;let qv=cse=class extends $C{constructor(t){super(t),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(t){ye(t)&&ye(this._userSize)&&(t.size=this._userSize),this._set("font",t)}writeFont(t,e,i,r){const n={...r,textSymbol3D:!0};e.font=t.write({},n),delete e.font.size}get size(){return ye(this._userSize)?this._userSize:ye(this.font)&&this.font.size!=null?this.font.size:9}set size(t){this._userSize=t,ye(this.font)&&(this.font.size=this._userSize),this.notifyChange("size")}clone(){const t=new cse({enabled:this.enabled,font:this.font&&hi(this.font),halo:this.halo&&hi(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:ye(this.material)?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:hi(this.background)});return t._userSize=this._userSize,t}static fromTextSymbol(t){return new cse({font:ye(t.font)?t.font.clone():new lse,halo:NGt(t.haloColor,t.haloSize),horizontalAlignment:t.horizontalAlignment,lineHeight:t.lineHeight,material:t.color?new M1({color:t.color.clone()}):null,text:t.text,verticalAlignment:t.verticalAlignment,background:t.backgroundColor?new FW({color:t.backgroundColor.clone()}):null})}};function NGt(t,e){return t&&e!=null&&e>0?new v9({color:hi(t),size:e}):null}E([k({type:lse,json:{write:!0}})],qv.prototype,"font",null),E([mr("font")],qv.prototype,"writeFont",null),E([k({type:v9,json:{write:!0}})],qv.prototype,"halo",void 0),E([k({...b7e,json:{default:"center",write:!0}})],qv.prototype,"horizontalAlignment",void 0),E([k({..._7e,json:{default:1,write:!0}})],qv.prototype,"lineHeight",void 0),E([k({type:M1,json:{write:!0}})],qv.prototype,"material",void 0),E([k({type:FW,json:{write:!0}})],qv.prototype,"background",void 0),E([k(BC)],qv.prototype,"size",null),E([k({type:String,json:{write:!0}})],qv.prototype,"text",void 0),E([Hr({Text:"text"},{readOnly:!0})],qv.prototype,"type",void 0),E([k({...w7e,json:{default:"baseline",write:!0}})],qv.prototype,"verticalAlignment",void 0),qv=cse=E([ht("esri.symbols.TextSymbol3DLayer")],qv);const _9=qv;var wwe;let mR=wwe=class extends $C{constructor(t){super(t),this.color=xwe.clone(),this.type="water",this.waterbodySize="medium",this.waveDirection=null,this.waveStrength="moderate"}clone(){return new wwe({color:hi(this.color),waterbodySize:this.waterbodySize,waveDirection:this.waveDirection,waveStrength:this.waveStrength})}};E([k({type:$r,nonNullable:!0,json:{type:[xs],write:(t,e,i)=>e[i]=t.toArray($r.AlphaMode.UNLESS_OPAQUE),default:()=>xwe.clone(),defaultEquals:t=>t.toCss(!0)===xwe.toCss(!0)}})],mR.prototype,"color",void 0),E([Hr({Water:"water"},{readOnly:!0})],mR.prototype,"type",void 0),E([k({type:["small","medium","large"],json:{write:!0,default:"medium"}})],mR.prototype,"waterbodySize",void 0),E([k({type:Number,json:{write:!0,default:null}})],mR.prototype,"waveDirection",void 0),E([k({type:["calm","rippled","slight","moderate"],json:{write:!0,default:"moderate"}})],mR.prototype,"waveStrength",void 0),mR=wwe=E([ht("esri.symbols.WaterSymbol3DLayer")],mR);const xwe=new $r([0,119,190]),I7e=mR;var Swe;let jL=Swe=class extends fn{constructor(t){super(t),this.name=null,this.styleUrl=null,this.styleName=null,this.portal=null}clone(){return new Swe({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}};E([k({type:String})],jL.prototype,"name",void 0),E([k({type:String})],jL.prototype,"styleUrl",void 0),E([k({type:String})],jL.prototype,"styleName",void 0),E([k({type:_c})],jL.prototype,"portal",void 0),jL=Swe=E([ht("esri.symbols.support.StyleOrigin")],jL);const LW=jL;var Cwe;let zL=Cwe=class extends fn{constructor(){super(...arguments),this.url=""}clone(){return new Cwe({url:this.url})}};E([k({type:String})],zL.prototype,"url",void 0),zL=Cwe=E([ht("esri.symbols.support.Thumbnail")],zL);const A7e={icon:GL,object:ywe,line:MW,path:_we,fill:OW,extrude:i7e,text:_9,water:I7e},$Gt=fr.ofType({base:$C,key:"type",typeMap:A7e,errorContext:"symbol-layer"});let jC=class extends zg{constructor(e){super(e),this.styleOrigin=null,this.thumbnail=null,this.type=null;const i=this.__accessor__&&this.__accessor__.metadatas&&this.__accessor__.metadatas.symbolLayers,r=i&&i.type||fr;this._set("symbolLayers",new r)}get color(){return null}set color(e){this.constructed&&Ei.getLogger(this.declaredClass).error("Symbol3D does not support colors on the symbol level. Colors may be set on individual symbol layer materials instead.")}set symbolLayers(e){rg(e,this._get("symbolLayers"))}readStyleOrigin(e,i,r){if(e.styleUrl&&e.name){const n=ew(e.styleUrl,r);return new LW({styleUrl:n,name:e.name})}if(e.styleName&&e.name)return new LW({portal:r&&r.portal||_c.getDefault(),styleName:e.styleName,name:e.name});r&&r.messages&&r.messages.push(new wm("symbol3d:incomplete-style-origin","Style origin requires either a 'styleUrl' or 'styleName' and a 'name' property",{context:r,definition:e}))}writeStyleOrigin(e,i,r,n){if(e.styleUrl&&e.name){let s=a2(e.styleUrl,n);jg(s)&&(s=Uy(s)),i.styleOrigin={styleUrl:s,name:e.name}}else e.styleName&&e.name&&(e.portal&&n&&n.portal&&!e1e(e.portal.restUrl,n.portal.restUrl)?n&&n.messages&&n.messages.push(new wm("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})):i.styleOrigin={styleName:e.styleName,name:e.name})}normalizeCtorArgs(e){return e instanceof $C||e&&A7e[e.type]?{symbolLayers:[e]}:Array.isArray(e)?{symbolLayers:e}:e}};E([k({json:{read:!1,write:!1}})],jC.prototype,"color",null),E([k({type:$Gt,nonNullable:!0,json:{write:!0}}),Zs(B8)],jC.prototype,"symbolLayers",null),E([k({type:LW})],jC.prototype,"styleOrigin",void 0),E([Li("styleOrigin")],jC.prototype,"readStyleOrigin",null),E([mr("styleOrigin",{"styleOrigin.styleUrl":{type:String},"styleOrigin.styleName":{type:String},"styleOrigin.name":{type:String}})],jC.prototype,"writeStyleOrigin",null),E([k({type:zL,json:{read:!1}})],jC.prototype,"thumbnail",void 0),E([k({type:["point-3d","line-3d","polygon-3d","mesh-3d","label-3d"],readOnly:!0})],jC.prototype,"type",void 0),jC=E([ht("esri.symbols.Symbol3D")],jC);const b9=jC;let kW=class extends Ni{constructor(e){super(e),this.visible=!0}clone(){}};E([k({type:["line"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],kW.prototype,"type",void 0),E([k({readOnly:!0})],kW.prototype,"visible",void 0),kW=E([ht("esri.symbols.callouts.Callout3D")],kW);const P7e=kW;var Twe;let hse=Twe=class extends Ni{constructor(){super(...arguments),this.color=new $r("white")}clone(){return new Twe({color:hi(this.color)})}};E([k(dR)],hse.prototype,"color",void 0),hse=Twe=E([ht("esri.symbols.callouts.LineCallout3DBorder")],hse);const O7e=hse;Object.freeze(Object.defineProperty({__proto__:null,default:O7e},Symbol.toStringTag,{value:"Module"}));var Ewe;let gR=Ewe=class extends P7e{constructor(t){super(t),this.type="line",this.color=new $r([0,0,0,1]),this.size=Xy(1),this.border=null}get visible(){return this.size>0&&ye(this.color)&&this.color.a>0}clone(){return new Ewe({color:hi(this.color),size:this.size,border:hi(this.border)})}};E([Hr({line:"line"},{readOnly:!0})],gR.prototype,"type",void 0),E([k(dR)],gR.prototype,"color",void 0),E([k(BC)],gR.prototype,"size",void 0),E([k({type:O7e,json:{write:!0}})],gR.prototype,"border",void 0),E([k({readOnly:!0})],gR.prototype,"visible",null),gR=Ewe=E([ht("esri.symbols.callouts.LineCallout3D")],gR);const BGt=gR;function Iwe(t){if(!t)return!1;const e=t.verticalOffset;return!!e&&!(e.screenLength<=0||ye(e.maxWorldLength)&&e.maxWorldLength<=0)}function R7e(t){if(!t||!t.supportsCallout||!t.supportsCallout())return!1;const e=t.callout;return!!e&&!!e.visible&&!!Iwe(t)}const M7e={types:{key:"type",base:P7e,typeMap:{line:BGt}},json:{write:!0}};var Awe;let w9=Awe=class extends Ni{constructor(t){super(t),this.screenLength=0,this.minWorldLength=0,this.maxWorldLength=null}clone(){return new Awe({screenLength:this.screenLength,minWorldLength:this.minWorldLength,maxWorldLength:this.maxWorldLength})}};E([k(BC)],w9.prototype,"screenLength",void 0),E([k({type:Number,nonNullable:!0,json:{write:!0,default:0}})],w9.prototype,"minWorldLength",void 0),E([k({type:Number,json:{write:!0}})],w9.prototype,"maxWorldLength",void 0),w9=Awe=E([ht("esri.symbols.support.Symbol3DVerticalOffset")],w9);const D7e=w9;var dse;const F7e=fr.ofType({base:null,key:"type",typeMap:{text:_9}});let yR=dse=class extends b9{constructor(t){super(t),this.verticalOffset=null,this.callout=null,this.styleOrigin=null,this.symbolLayers=new F7e,this.type="label-3d"}supportsCallout(){return!0}hasVisibleCallout(){return R7e(this)}hasVisibleVerticalOffset(){return Iwe(this)}clone(){return new dse({styleOrigin:hi(this.styleOrigin),symbolLayers:hi(this.symbolLayers),thumbnail:hi(this.thumbnail),callout:hi(this.callout),verticalOffset:hi(this.verticalOffset)})}static fromTextSymbol(t){return new dse({symbolLayers:[_9.fromTextSymbol(t)]})}};E([k({type:D7e,json:{write:!0}})],yR.prototype,"verticalOffset",void 0),E([k(M7e)],yR.prototype,"callout",void 0),E([k({json:{read:!1,write:!1}})],yR.prototype,"styleOrigin",void 0),E([k({type:F7e})],yR.prototype,"symbolLayers",void 0),E([Hr({LabelSymbol3D:"label-3d"},{readOnly:!0})],yR.prototype,"type",void 0),yR=dse=E([ht("esri.symbols.LabelSymbol3D")],yR);const pse=yR;var fse;const L7e=fr.ofType({base:null,key:"type",typeMap:{line:MW,path:_we}}),GGt=fr.ofType({base:null,key:"type",typeMap:{line:MW,path:_we}});let NW=fse=class extends b9{constructor(t){super(t),this.symbolLayers=new L7e,this.type="line-3d"}clone(){return new fse({styleOrigin:hi(this.styleOrigin),symbolLayers:hi(this.symbolLayers),thumbnail:hi(this.thumbnail)})}static fromSimpleLineSymbol(t){return new fse({symbolLayers:[MW.fromSimpleLineSymbol(t)]})}};E([k({type:L7e,json:{type:GGt}})],NW.prototype,"symbolLayers",void 0),E([Hr({LineSymbol3D:"line-3d"},{readOnly:!0})],NW.prototype,"type",void 0),NW=fse=E([ht("esri.symbols.LineSymbol3D")],NW);const mse=NW;let vR=class extends zg{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}`}};E([k({type:Number,json:{read:t=>t&&-1*t,write:(t,e)=>e.angle=t&&-1*t}})],vR.prototype,"angle",void 0),E([k({type:["simple-marker","picture-marker"],readOnly:!0})],vR.prototype,"type",void 0),E([k({type:Number,cast:Da,json:{write:!0}})],vR.prototype,"xoffset",void 0),E([k({type:Number,cast:Da,json:{write:!0}})],vR.prototype,"yoffset",void 0),E([k({type:Number,cast:t=>t==="auto"?t:Da(t),json:{write:!0}})],vR.prototype,"size",void 0),vR=E([ht("esri.symbols.MarkerSymbol")],vR);const k7e=vR;var gse;const N7e=fr.ofType({base:null,key:"type",typeMap:{fill:OW}});let $W=gse=class extends b9{constructor(t){super(t),this.symbolLayers=new N7e,this.type="mesh-3d"}clone(){return new gse({styleOrigin:hi(this.styleOrigin),symbolLayers:hi(this.symbolLayers),thumbnail:hi(this.thumbnail)})}static fromSimpleFillSymbol(t){return new gse({symbolLayers:[OW.fromSimpleFillSymbol(t)]})}};E([k({type:N7e})],$W.prototype,"symbolLayers",void 0),E([Hr({MeshSymbol3D:"mesh-3d"},{readOnly:!0})],$W.prototype,"type",void 0),$W=gse=E([ht("esri.symbols.MeshSymbol3D")],$W);const yse=$W;function VGt(t,e,i){return e.imageData?BVe({mediaType:e.contentType||"image/png",isBase64:!0,data:e.imageData}):$7e(e.url,i)}function $7e(t,e){return jGt(e)&&!jg(t)&&e?.layer?.parsedUrl?dd(e.layer.parsedUrl.path,"images",t):ew(t,e)}function UGt(t,e,i,r){if(E1(t)){const n=Y3(t);if(!n)return;e.contentType=n.mediaType,e.imageData=n.data,i&&i.imageData===e.imageData&&i.url&&dA(i.url,e,"url",r)}else dA(t,e,"url",r)}const B7e={json:{read:{source:["imageData","url"],reader:VGt},write:{writer(t,e,i,r){UGt(t,e,this.source,r)}}}},G7e={readOnly:!0,json:{read:{source:["imageData","url"],reader(t,e,i){const r={};return e.imageData&&(r.imageData=e.imageData),e.contentType&&(r.contentType=e.contentType),e.url&&(r.url=$7e(e.url,i)),r}}}};function jGt(t){return!(t==null||t.origin!=="service"&&t.origin!=="portal-item"||t.layer?.type!=="feature"&&t.layer?.type!=="stream")}var Pwe;let tw=Pwe=class extends n7e{constructor(...t){super(...t),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(t,e,i,r){if(t&&typeof t!="string"&&t.imageData==null)return t;const n={};return t&&(n.url=t),e&&(n.outline=e),i!=null&&(n.width=Da(i)),r!=null&&(n.height=Da(r)),n}clone(){const t=new Pwe({color:hi(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 t._set("source",hi(this.source)),t}hash(){return`${super.hash()}.${this.color?.hash()}.${this.height}.${this.url}.${this.width}.${this.xoffset}.${this.xscale}.${this.yoffset}.${this.yscale}`}};E([Hr({esriPFS:"picture-fill"},{readOnly:!0})],tw.prototype,"type",void 0),E([k(B7e)],tw.prototype,"url",void 0),E([k({type:Number,json:{write:!0}})],tw.prototype,"xscale",void 0),E([k({type:Number,json:{write:!0}})],tw.prototype,"yscale",void 0),E([k({type:Number,cast:Da,json:{write:!0}})],tw.prototype,"width",void 0),E([k({type:Number,cast:Da,json:{write:!0}})],tw.prototype,"height",void 0),E([k({type:Number,cast:Da,json:{write:!0}})],tw.prototype,"xoffset",void 0),E([k({type:Number,cast:Da,json:{write:!0}})],tw.prototype,"yoffset",void 0),E([k(G7e)],tw.prototype,"source",void 0),tw=Pwe=E([ht("esri.symbols.PictureFillSymbol")],tw);const V7e=tw;var Owe;let l2=Owe=class extends k7e{constructor(...t){super(...t),this.color=null,this.type="picture-marker",this.url=null,this.source=null,this.height=12,this.width=12,this.size=null}normalizeCtorArgs(t,e,i){if(t&&typeof t!="string"&&t.imageData==null)return t;const r={};return t&&(r.url=t),e!=null&&(r.width=Da(e)),i!=null&&(r.height=Da(i)),r}readHeight(t,e){return e.size||t}readWidth(t,e){return e.size||t}clone(){const t=new Owe({angle:this.angle,height:this.height,url:this.url,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset});return t._set("source",hi(this.source)),t}hash(){return`${super.hash()}.${this.height}.${this.url}.${this.width}`}};E([k({json:{write:!1}})],l2.prototype,"color",void 0),E([Hr({esriPMS:"picture-marker"},{readOnly:!0})],l2.prototype,"type",void 0),E([k(B7e)],l2.prototype,"url",void 0),E([k(G7e)],l2.prototype,"source",void 0),E([k({type:Number,cast:Da,json:{write:!0}})],l2.prototype,"height",void 0),E([Li("height",["height","size"])],l2.prototype,"readHeight",null),E([k({type:Number,cast:Da,json:{write:!0}})],l2.prototype,"width",void 0),E([k({json:{write:!1}})],l2.prototype,"size",void 0),l2=Owe=E([ht("esri.symbols.PictureMarkerSymbol")],l2);const pA=l2;var HL;const U7e=fr.ofType({base:null,key:"type",typeMap:{icon:GL,object:ywe,text:_9}});let WL=HL=class extends b9{constructor(t){super(t),this.verticalOffset=null,this.callout=null,this.symbolLayers=new U7e,this.type="point-3d"}supportsCallout(){if((this.symbolLayers?this.symbolLayers.length:0)<1)return!1;for(const t of this.symbolLayers.items)switch(t.type){case"icon":case"text":case"object":continue;default:return!1}return!0}hasVisibleCallout(){return R7e(this)}hasVisibleVerticalOffset(){return Iwe(this)}clone(){return new HL({verticalOffset:hi(this.verticalOffset),callout:hi(this.callout),styleOrigin:hi(this.styleOrigin),symbolLayers:hi(this.symbolLayers),thumbnail:hi(this.thumbnail)})}static fromSimpleMarkerSymbol(t){return new HL({symbolLayers:[GL.fromSimpleMarkerSymbol(t)]})}static fromPictureMarkerSymbol(t){return new HL({symbolLayers:[GL.fromPictureMarkerSymbol(t)]})}static fromCIMSymbol(t){if(t.data?.symbol?.type!=="CIMPointSymbol")return null;const i=t.data.symbol;return new HL(i?.callout?{symbolLayers:[GL.fromCIMSymbol(t)],callout:{type:"line",size:.5,color:[0,0,0]},verticalOffset:{screenLength:40}}:{symbolLayers:[GL.fromCIMSymbol(t)]})}static fromTextSymbol(t){return new HL({symbolLayers:[_9.fromTextSymbol(t)]})}};E([k({type:D7e,json:{write:!0}})],WL.prototype,"verticalOffset",void 0),E([k(M7e)],WL.prototype,"callout",void 0),E([k({type:U7e,json:{origins:{"web-scene":{write:!0}}}})],WL.prototype,"symbolLayers",void 0),E([Hr({PointSymbol3D:"point-3d"},{readOnly:!0})],WL.prototype,"type",void 0),WL=HL=E([ht("esri.symbols.PointSymbol3D")],WL);const qL=WL;var BW;const j7e=fr.ofType({base:null,key:"type",typeMap:{extrude:i7e,fill:OW,icon:GL,line:MW,object:ywe,text:_9,water:I7e}});let GW=BW=class extends b9{constructor(t){super(t),this.symbolLayers=new j7e,this.type="polygon-3d"}clone(){return new BW({styleOrigin:hi(this.styleOrigin),symbolLayers:hi(this.symbolLayers),thumbnail:hi(this.thumbnail)})}static fromJSON(t){const e=new BW;if(e.read(t),e.symbolLayers.length===2&&e.symbolLayers.getItemAt(0).type==="fill"&&e.symbolLayers.getItemAt(1).type==="line"){const i=e.symbolLayers.getItemAt(0),r=e.symbolLayers.getItemAt(1);!r.enabled||t.symbolLayers&&t.symbolLayers[1]&&t.symbolLayers[1].enable===!1||(i.outline={size:r.size,color:ye(r.material)?r.material.color:null}),e.symbolLayers.removeAt(1)}return e}static fromSimpleFillSymbol(t){return new BW({symbolLayers:[OW.fromSimpleFillSymbol(t)]})}};E([k({type:j7e,json:{write:!0}})],GW.prototype,"symbolLayers",void 0),E([Hr({PolygonSymbol3D:"polygon-3d"},{readOnly:!0})],GW.prototype,"type",void 0),GW=BW=E([ht("esri.symbols.PolygonSymbol3D")],GW);const VW=GW;var Rwe;const Mwe=new Bs({esriSFSSolid:"solid",esriSFSNull:"none",esriSFSHorizontal:"horizontal",esriSFSVertical:"vertical",esriSFSForwardDiagonal:"forward-diagonal",esriSFSBackwardDiagonal:"backward-diagonal",esriSFSCross:"cross",esriSFSDiagonalCross:"diagonal-cross"});let YL=Rwe=class extends n7e{constructor(...t){super(...t),this.color=new $r([0,0,0,.25]),this.outline=new Tm,this.type="simple-fill",this.style="solid"}normalizeCtorArgs(t,e,i){if(t&&typeof t!="string")return t;const r={};return t&&(r.style=t),e&&(r.outline=e),i&&(r.color=i),r}clone(){return new Rwe({color:hi(this.color),outline:this.outline&&this.outline.clone(),style:this.style})}hash(){return`${super.hash()}${this.style}.${this.color&&this.color.hash()}`}};E([k()],YL.prototype,"color",void 0),E([k()],YL.prototype,"outline",void 0),E([Hr({esriSFS:"simple-fill"},{readOnly:!0})],YL.prototype,"type",void 0),E([k({type:Mwe.apiValues,json:{read:Mwe.read,write:Mwe.write}})],YL.prototype,"style",void 0),YL=Rwe=E([ht("esri.symbols.SimpleFillSymbol")],YL);const iw=YL;var Dwe;const Fwe=new Bs({esriSMSCircle:"circle",esriSMSSquare:"square",esriSMSCross:"cross",esriSMSX:"x",esriSMSDiamond:"diamond",esriSMSTriangle:"triangle",esriSMSPath:"path"});let zC=Dwe=class extends k7e{constructor(...t){super(...t),this.color=new $r([255,255,255,.25]),this.type="simple-marker",this.size=12,this.style="circle",this.outline=new Tm}normalizeCtorArgs(t,e,i,r){if(t&&typeof t!="string")return t;const n={};return t&&(n.style=t),e!=null&&(n.size=Da(e)),i&&(n.outline=i),r&&(n.color=r),n}writeColor(t,e){t&&this.style!=="x"&&this.style!=="cross"&&(e.color=t.toJSON()),t===null&&(e.color=null)}set path(t){this.style="path",this._set("path",t)}clone(){return new Dwe({angle:this.angle,color:hi(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()}`}};E([k()],zC.prototype,"color",void 0),E([mr("color")],zC.prototype,"writeColor",null),E([Hr({esriSMS:"simple-marker"},{readOnly:!0})],zC.prototype,"type",void 0),E([k()],zC.prototype,"size",void 0),E([k({type:Fwe.apiValues,json:{read:Fwe.read,write:Fwe.write}})],zC.prototype,"style",void 0),E([k({type:String,json:{write:!0}})],zC.prototype,"path",null),E([k({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":Tm}},json:{default:null,write:!0}})],zC.prototype,"outline",void 0),zC=Dwe=E([ht("esri.symbols.SimpleMarkerSymbol")],zC);const gd=zC;var Lwe;let yd=Lwe=class extends zg{constructor(...t){super(...t),this.backgroundColor=null,this.borderLineColor=null,this.borderLineSize=null,this.font=new lse,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(t,e,i){if(t&&typeof t!="string")return t;const r={};return t&&(r.text=t),e&&(r.font=e),i&&(r.color=i),r}writeLineWidth(t,e,i,r){r&&typeof r!="string"?r.origin:e[i]=t}castLineWidth(t){return Da(t)}writeLineHeight(t,e,i,r){r&&typeof r!="string"?r.origin:e[i]=t}clone(){return new Lwe({angle:this.angle,backgroundColor:hi(this.backgroundColor),borderLineColor:hi(this.borderLineColor),borderLineSize:this.borderLineSize,color:hi(this.color),font:this.font&&this.font.clone(),haloColor:hi(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&&this.backgroundColor.hash()}.${this.borderLineColor}.${this.borderLineSize}.${this.color?.hash()}.${this.font&&this.font.hash()}.${this.haloColor&&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}`}};E([k({type:$r,json:{write:!0}})],yd.prototype,"backgroundColor",void 0),E([k({type:$r,json:{write:!0}})],yd.prototype,"borderLineColor",void 0),E([k({type:Number,json:{write:!0},cast:Da})],yd.prototype,"borderLineSize",void 0),E([k({type:lse,json:{write:!0}})],yd.prototype,"font",void 0),E([k({...b7e,json:{write:!0}})],yd.prototype,"horizontalAlignment",void 0),E([k({type:Boolean,json:{write:!0}})],yd.prototype,"kerning",void 0),E([k({type:$r,json:{write:!0}})],yd.prototype,"haloColor",void 0),E([k({type:Number,cast:Da,json:{write:!0}})],yd.prototype,"haloSize",void 0),E([k({type:Boolean,json:{write:!0}})],yd.prototype,"rightToLeft",void 0),E([k({type:Boolean,json:{write:!0}})],yd.prototype,"rotated",void 0),E([k({type:String,json:{write:!0}})],yd.prototype,"text",void 0),E([Hr({esriTS:"text"},{readOnly:!0})],yd.prototype,"type",void 0),E([k({...w7e,json:{write:!0}})],yd.prototype,"verticalAlignment",void 0),E([k({type:Number,cast:Da,json:{write:!0}})],yd.prototype,"xoffset",void 0),E([k({type:Number,cast:Da,json:{write:!0}})],yd.prototype,"yoffset",void 0),E([k({type:Number,json:{read:t=>t&&-1*t,write:(t,e)=>e.angle=t&&-1*t}})],yd.prototype,"angle",void 0),E([k({type:Number,json:{write:!0}})],yd.prototype,"width",void 0),E([k({type:Number})],yd.prototype,"lineWidth",void 0),E([mr("lineWidth")],yd.prototype,"writeLineWidth",null),E([Zs("lineWidth")],yd.prototype,"castLineWidth",null),E([k(_7e)],yd.prototype,"lineHeight",void 0),E([mr("lineHeight")],yd.prototype,"writeLineHeight",null),yd=Lwe=E([ht("esri.symbols.TextSymbol")],yd);const XL=yd;var kwe;let u2=kwe=class extends zg{constructor(t){super(t),this.styleName=null,this.portal=null,this.styleUrl=null,this.thumbnail=null,this.name=null,this.type="web-style"}get _fetchCacheKey(){const t=ye(this.portal)?this.portal:_c.getDefault(),e=t.user?t.user.username:null;return`${this.styleName}:${this.styleUrl}:${this.name}:${e}:${t.url}`}read(t,e){this.portal=e?.portal,super.read(t,e)}clone(){return new kwe({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}fetchSymbol(t){return this._fetchSymbol("webRef",t)}fetchCIMSymbol(t){return this._fetchSymbol("cimRef",t)}async _fetchSymbol(t,e){const i=ye(e)?e.cache:null,r=i?this._fetchCacheKey:null;if(ye(i)){const a=r&&i.get(r);if(a)return a.clone()}const n=await zGt();sn(e);const s=n.resolveWebStyleSymbol(this,{portal:this.portal},t,e);s.catch(a=>{Ei.getLogger(this.declaredClass).error("#fetchSymbol()","Failed to create symbol from style",a)});const o=await s;return t==="webRef"&&o.type==="point-3d"||t==="cimRef"&&o.type==="cim"?(ye(i)&&i.set(r,o.clone()),o):null}};function zGt(){return Promise.resolve().then(()=>esi)}E([k({json:{write:!1}})],u2.prototype,"color",void 0),E([k({type:String,json:{write:!0}})],u2.prototype,"styleName",void 0),E([k({type:_c,json:{write:!1}})],u2.prototype,"portal",void 0),E([k({type:String,json:{read:m9,write:dA}})],u2.prototype,"styleUrl",void 0),E([k({type:zL,json:{read:!1}})],u2.prototype,"thumbnail",void 0),E([k({type:String,json:{write:!0}})],u2.prototype,"name",void 0),E([Hr({styleSymbolReference:"web-style"},{readOnly:!0})],u2.prototype,"type",void 0),E([k()],u2.prototype,"_fetchCacheKey",null),u2=kwe=E([ht("esri.symbols.WebStyleSymbol")],u2);const KL=u2;function vse(t){if(!t)return!1;switch(t.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 _R(t){if(!t)return!1;switch(t.type){case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":return!0;default:return!1}}const Uh={base:zg,key:"type",typeMap:{"simple-fill":iw,"picture-fill":V7e,"picture-marker":pA,"simple-line":Tm,"simple-marker":gd,text:XL,"label-3d":pse,"line-3d":mse,"mesh-3d":yse,"point-3d":qL,"polygon-3d":VW,"web-style":KL,cim:wW},errorContext:"symbol"},HGt={base:zg,key:"type",typeMap:{"picture-marker":pA,"simple-marker":gd,text:XL,"web-style":KL,cim:wW},errorContext:"symbol"},WGt=CC({types:Uh}),UW={base:zg,key:"type",typeMap:{"simple-fill":iw,"picture-fill":V7e,"picture-marker":pA,"simple-line":Tm,"simple-marker":gd,text:XL,"line-3d":mse,"mesh-3d":yse,"point-3d":qL,"polygon-3d":VW,"web-style":KL,cim:wW},errorContext:"symbol"},qGt={base:zg,key:"type",typeMap:{text:XL,"label-3d":pse},errorContext:"symbol"},z7e={base:zg,key:"type",typeMap:{"line-3d":mse,"mesh-3d":yse,"point-3d":qL,"polygon-3d":VW,"web-style":KL,cim:wW},errorContext:"symbol"},YGt={base:zg,key:"type",typeMap:{"label-3d":pse},errorContext:"symbol"},H7e=SC(Uh);function XGt(t){if(!t)return null;const e={};for(const i in t){const r=fl(t[i]);r&&(e[i]=r)}return Object.keys(e).length!==0?e:null}function KGt(t){if(!ye(t))return null;const e={};for(const i in t){const r=t[i];r&&(e[i]=r.toJSON())}return Object.keys(e).length!==0?e:null}let Yv=class extends ua(Ni){constructor(...e){super(...e),this.isAggregate=!1,this.layer=null,this.popupTemplate=null,this.sourceLayer=null,Object.defineProperty(this,"uid",{value:V3(),configurable:!0})}normalizeCtorArgs(e,i,r,n){return e&&!e.declaredClass?e:{geometry:e,symbol:i,attributes:r,popupTemplate:n}}set aggregateGeometries(e){const i=this._get("aggregateGeometries");JSON.stringify(i)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const i=this._get("attributes");i!==e&&(this._set("attributes",e),this._notifyLayer("attributes",i,e))}set geometry(e){const i=this._get("geometry");i!==e&&(this._set("geometry",e),this._notifyLayer("geometry",i,e))}set symbol(e){const i=this._get("symbol");i!==e&&(this._set("symbol",e),this._notifyLayer("symbol",i,e))}set visible(e){const i=this._get("visible");i!==e&&(this._set("visible",e),this._notifyLayer("visible",i,e))}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;for(const i of[this.sourceLayer,this.layer])if(i){if("popupTemplate"in i&&i.popupTemplate)return i.popupTemplate;if(e&&"defaultPopupTemplate"in i&&ye(i.defaultPopupTemplate))return i.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,i){if(this.attributes){const r=this.getAttribute(e);this.attributes[e]=i,this._notifyLayer("attributes",r,i,e)}else this.attributes={[e]:i},this._notifyLayer("attributes",void 0,i,e)}getObjectId(){return this.sourceLayer&&"objectIdField"in this.sourceLayer&&this.sourceLayer.objectIdField?this.getAttribute(this.sourceLayer.objectIdField):null}toJSON(){return{aggregateGeometries:KGt(this.aggregateGeometries),geometry:ye(this.geometry)?this.geometry.toJSON():null,symbol:ye(this.symbol)?this.symbol.toJSON():null,attributes:{...this.attributes},popupTemplate:this.popupTemplate&&this.popupTemplate.toJSON()}}notifyGeometryChanged(){this._notifyLayer("geometry",this.geometry,this.geometry)}notifyMeshTransformChanged(){ye(this.geometry)&&this.geometry.type==="mesh"&&this._notifyLayer("transform",this.geometry.transform,this.geometry.transform)}_notifyLayer(e,i,r,n){if(!this.layer||!("graphicChanged"in this.layer))return;const s={graphic:this,property:e,oldValue:i,newValue:r};e==="attributes"&&(s.attributeName=n),this.layer.graphicChanged(s)}};E([k({value:null,json:{read:XGt}})],Yv.prototype,"aggregateGeometries",null),E([k({value:null})],Yv.prototype,"attributes",null),E([k({value:null,types:P1,json:{read:fl}})],Yv.prototype,"geometry",null),E([k({type:Boolean})],Yv.prototype,"isAggregate",void 0),E([k({clonable:"reference"})],Yv.prototype,"layer",void 0),E([k({type:yh})],Yv.prototype,"popupTemplate",void 0),E([k({clonable:"reference"})],Yv.prototype,"sourceLayer",void 0),E([k({value:null,types:Uh})],Yv.prototype,"symbol",null),E([k({type:Boolean,value:!0})],Yv.prototype,"visible",null),Yv=E([ht("esri.Graphic")],Yv),function(t){t.generateUID=V3}(Yv||(Yv={}));const js=Yv;var Nwe;let jW=Nwe=class extends Ni{constructor(t){super(t),this.minValue=0,this.maxValue=0}clone(){return new Nwe({minValue:this.minValue,maxValue:this.maxValue})}};E([k({type:Number,json:{write:!0}})],jW.prototype,"minValue",void 0),E([k({type:Number,json:{write:!0}})],jW.prototype,"maxValue",void 0),jW=Nwe=E([ht("esri.renderer.support.AuthoringInfoClassBreakInfo")],jW);var $we;let bR=$we=class extends Ni{constructor(t){super(t),this.field="",this.normalizationField="",this.label="",this.classBreakInfos=[]}clone(){return new $we({field:this.field,normalizationField:this.normalizationField,label:this.label,classBreakInfos:hi(this.classBreakInfos)})}};E([k({type:String,json:{write:!0}})],bR.prototype,"field",void 0),E([k({type:String,json:{write:!0}})],bR.prototype,"normalizationField",void 0),E([k({type:String,json:{write:!0}})],bR.prototype,"label",void 0),E([k({type:[jW],json:{write:!0}})],bR.prototype,"classBreakInfos",void 0),bR=$we=E([ht("esri.renderers.support.AuthoringInfoFieldInfo")],bR);var Bwe;const _se=new Bs({percentTotal:"percent-of-total",ratio:"ratio",percent:"percent"}),bse=new Bs({sizeInfo:"size",colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation"}),W7e={key:t=>typeof t=="number"?"number":"string",typeMap:{number:Number,string:String},base:null},q7e=["high-to-low","above-and-below","centered-on","extremes"],Y7e=[...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"])],X7e=["seconds","minutes","hours","days","months","years"];let Xv=Bwe=class extends Ni{constructor(t){super(t),this.endTime=null,this.field=null,this.maxSliderValue=null,this.minSliderValue=null,this.startTime=null,this.type=null,this.units=null}castEndTime(t){return typeof t=="string"||typeof t=="number"?t:null}castStartTime(t){return typeof t=="string"||typeof t=="number"?t:null}get style(){return this.type==="color"?this._get("style"):null}set style(t){this._set("style",t)}get theme(){return this.type==="color"||this.type==="size"?this._get("theme")||"high-to-low":null}set theme(t){this._set("theme",t)}clone(){return new Bwe({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})}};E([k({types:W7e,json:{write:!0}})],Xv.prototype,"endTime",void 0),E([Zs("endTime")],Xv.prototype,"castEndTime",null),E([k({type:String,json:{write:!0}})],Xv.prototype,"field",void 0),E([k({type:Number,json:{write:!0}})],Xv.prototype,"maxSliderValue",void 0),E([k({type:Number,json:{write:!0}})],Xv.prototype,"minSliderValue",void 0),E([k({types:W7e,json:{write:!0}})],Xv.prototype,"startTime",void 0),E([Zs("startTime")],Xv.prototype,"castStartTime",null),E([k({type:_se.apiValues,value:null,json:{type:_se.jsonValues,read:_se.read,write:_se.write}})],Xv.prototype,"style",null),E([k({type:Y7e,value:null,json:{type:Y7e,origins:{"web-scene":{type:q7e,write:{writer:(t,e)=>{q7e.includes(t)&&(e.theme=t)}}}},write:!0}})],Xv.prototype,"theme",null),E([k({type:bse.apiValues,json:{type:bse.jsonValues,read:bse.read,write:bse.write}})],Xv.prototype,"type",void 0),E([k({type:X7e,json:{type:X7e,write:!0}})],Xv.prototype,"units",void 0),Xv=Bwe=E([ht("esri.renderers.support.AuthoringInfoVisualVariable")],Xv);const JGt=Xv;let wse=class extends Ni{constructor(e){super(e),this.type=null}};E([k({readOnly:!0,json:{read:!1,write:!0}})],wse.prototype,"type",void 0),wse=E([ht("esri.rest.support.ColorRamp")],wse);const Gwe=wse;var Vwe;let JL=Vwe=class extends Gwe{constructor(t){super(t),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new Vwe({fromColor:hi(this.fromColor),toColor:hi(this.toColor),algorithm:this.algorithm})}};E([Hr({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],JL.prototype,"algorithm",void 0),E([k({type:$r,json:{type:[xs],write:!0}})],JL.prototype,"fromColor",void 0),E([k({type:$r,json:{type:[xs],write:!0}})],JL.prototype,"toColor",void 0),E([k({type:["algorithmic"]})],JL.prototype,"type",void 0),JL=Vwe=E([ht("esri.rest.support.AlgorithmicColorRamp")],JL);const Uwe=JL;var jwe;let zW=jwe=class extends Gwe{constructor(t){super(t),this.colorRamps=null,this.type="multipart"}clone(){return new jwe({colorRamps:hi(this.colorRamps)})}};E([k({type:[Uwe],json:{write:!0}})],zW.prototype,"colorRamps",void 0),E([k({type:["multipart"]})],zW.prototype,"type",void 0),zW=jwe=E([ht("esri.rest.support.MultipartColorRamp")],zW);const xse=zW,Sse={key:"type",base:Gwe,typeMap:{algorithmic:Uwe,multipart:xse}};function Cse(t){return t&&t.type?t.type==="algorithmic"?Uwe.fromJSON(t):t.type==="multipart"?xse.fromJSON(t):null:null}var zwe;const ZL=new Bs({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),Tse=new Bs({pieChart:"pie-chart",classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),K7e=new Bs({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density"}),J7e=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers","decimal-degrees"],ZGt=["high-to-low","above-and-below","above","below","90-10"],QGt=["flow-line","wave-front"],eVt=["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"];let tp=zwe=class extends Ni{constructor(t){super(t),this.colorRamp=null,this.fadeRatio=null,this.isAutoGenerated=!1,this.lengthUnit=null,this.maxSliderValue=null,this.minSliderValue=null,this.visualVariables=null}get classificationMethod(){const t=this._get("classificationMethod"),e=this.type;return e&&e!=="relationship"?e==="class-breaks-size"||e==="class-breaks-color"?t||"manual":null:t}set classificationMethod(t){this._set("classificationMethod",t)}readColorRamp(t){return t?Cse(t):void 0}get fields(){return this.type&&this.type!=="predominance"?null:this._get("fields")}set fields(t){this._set("fields",t)}get field1(){return this.type&&this.type!=="relationship"?null:this._get("field1")}set field1(t){this._set("field1",t)}get field2(){return this.type&&this.type!=="relationship"?null:this._get("field2")}set field2(t){this._set("field2",t)}get flowTheme(){return this.type==="flow"?this._get("flowTheme"):null}set flowTheme(t){this._set("flowTheme",t)}get focus(){return this.type&&this.type!=="relationship"?null:this._get("focus")}set focus(t){this._set("focus",t)}get numClasses(){return this.type&&this.type!=="relationship"?null:this._get("numClasses")}set numClasses(t){this._set("numClasses",t)}get statistics(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("statistics"):null}set statistics(t){this._set("statistics",t)}get standardDeviationInterval(){const t=this.type;return t&&t!=="relationship"&&t!=="class-breaks-size"&&t!=="class-breaks-color"||this.classificationMethod&&this.classificationMethod!=="standard-deviation"?null:this._get("standardDeviationInterval")}set standardDeviationInterval(t){this._set("standardDeviationInterval",t)}get type(){return this._get("type")}set type(t){let e=t;t==="classed-size"?e="class-breaks-size":t==="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(t){this._set("univariateSymbolStyle",t)}get univariateTheme(){return this.type==="univariate-color-size"?this._get("univariateTheme"):null}set univariateTheme(t){this._set("univariateTheme",t)}clone(){return new zwe({classificationMethod:this.classificationMethod,colorRamp:hi(this.colorRamp),fadeRatio:hi(this.fadeRatio),fields:this.fields&&this.fields.slice(0),field1:hi(this.field1),field2:hi(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(t=>t.clone()),univariateSymbolStyle:this.univariateSymbolStyle,univariateTheme:this.univariateTheme,flowTheme:this.flowTheme})}};E([k({type:ZL.apiValues,value:null,json:{type:ZL.jsonValues,read:ZL.read,write:ZL.write,origins:{"web-document":{default:"manual",type:ZL.jsonValues,read:ZL.read,write:ZL.write}}}})],tp.prototype,"classificationMethod",null),E([k({types:Sse,json:{write:!0}})],tp.prototype,"colorRamp",void 0),E([Li("colorRamp")],tp.prototype,"readColorRamp",null),E([k({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],tp.prototype,"fadeRatio",void 0),E([k({type:[String],value:null,json:{write:!0}})],tp.prototype,"fields",null),E([k({type:bR,value:null,json:{write:!0}})],tp.prototype,"field1",null),E([k({type:bR,value:null,json:{write:!0}})],tp.prototype,"field2",null),E([k({type:QGt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],tp.prototype,"flowTheme",null),E([k({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],tp.prototype,"focus",null),E([k({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],tp.prototype,"isAutoGenerated",void 0),E([k({type:Number,value:null,json:{type:xs,write:!0}})],tp.prototype,"numClasses",null),E([k({type:J7e,json:{type:J7e,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],tp.prototype,"lengthUnit",void 0),E([k({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],tp.prototype,"maxSliderValue",void 0),E([k({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],tp.prototype,"minSliderValue",void 0),E([k({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],tp.prototype,"statistics",null),E([k({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],tp.prototype,"standardDeviationInterval",null),E([k({type:Tse.apiValues,value:null,json:{type:Tse.jsonValues,read:Tse.read,write:Tse.write,origins:{"web-scene":{type:K7e.jsonValues,write:{writer:K7e.write,overridePolicy:t=>({enabled:t!=="flow"})}}}}})],tp.prototype,"type",null),E([k({type:[JGt],json:{write:!0}})],tp.prototype,"visualVariables",void 0),E([k({type:eVt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],tp.prototype,"univariateSymbolStyle",null),E([k({type:ZGt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],tp.prototype,"univariateTheme",null),tp=zwe=E([ht("esri.renderers.support.AuthoringInfo")],tp);const HW=tp,Hwe=new Bs({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let WW=class extends Ni{constructor(e){super(e),this.authoringInfo=null,this.type=null}async getRequiredFields(e){if(!this.collectRequiredFields)return[];const i=new Set;return await this.collectRequiredFields(i,e),Array.from(i).sort()}getSymbol(e,i){}async getSymbolAsync(e,i){}getSymbols(){return[]}getAttributeHash(){return JSON.stringify(this)}getMeshHash(){return JSON.stringify(this)}};E([k({type:HW,json:{write:!0}})],WW.prototype,"authoringInfo",void 0),E([k({type:Hwe.apiValues,readOnly:!0,json:{type:Hwe.jsonValues,read:!1,write:{writer:Hwe.write,ignoreOrigin:!0}}})],WW.prototype,"type",void 0),WW=E([ht("esri.renderers.Renderer")],WW);const HC=WW;function tVt(t){return t.match(iVt)?.[1]?.replace(/\\'/g,"'")??null}const iVt=/^hash\(\$feature\['((\\'|[^'])+)'\]\) \* 8\.381e-8$/;var Wwe;let WC=Wwe=class extends Ni{constructor(){super(...arguments),this.title=null}clone(){return new Wwe({title:this.title})}};E([k({type:String,json:{write:!0}})],WC.prototype,"title",void 0),WC=Wwe=E([ht("esri.renderers.support.LegendOptions")],WC);var qwe;let Ese=qwe=class extends WC{constructor(){super(...arguments),this.showLegend=null}clone(){return new qwe({title:this.title,showLegend:this.showLegend})}};E([k({type:Boolean,json:{write:!0}})],Ese.prototype,"showLegend",void 0),Ese=qwe=E([ht("esri.renderers.visualVariables.support.VisualVariableLegendOptions")],Ese);const Z7e=Ese,Ywe=new Bs({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let c2=class extends Ni{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"?(Ei.getLogger(this.declaredClass).error(".field: field must be a string value"),null):MH(e)}get arcadeRequired(){return!!this.valueExpression}clone(){}getAttributeHash(){return`${this.type}-${this.field}-${this.valueExpression}`}};E([k()],c2.prototype,"index",void 0),E([k({type:Ywe.apiValues,readOnly:!0,json:{read:Ywe.read,write:Ywe.write}})],c2.prototype,"type",void 0),E([k({type:String,json:{write:!0}})],c2.prototype,"field",void 0),E([Zs("field")],c2.prototype,"castField",null),E([k({type:String,json:{write:!0}})],c2.prototype,"valueExpression",void 0),E([k({type:String,json:{write:!0}})],c2.prototype,"valueExpressionTitle",void 0),E([k({readOnly:!0})],c2.prototype,"arcadeRequired",null),E([k({type:Z7e,json:{write:!0}})],c2.prototype,"legendOptions",void 0),c2=E([ht("esri.renderers.visualVariables.VisualVariable")],c2);const qW=c2;var Xwe;let QL=Xwe=class extends Ni{constructor(t){super(t),this.color=null,this.label=null,this.value=null}writeValue(t,e,i){e[i]=t??0}clone(){return new Xwe({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};E([k({type:$r,json:{type:[xs],write:!0}})],QL.prototype,"color",void 0),E([k({type:String,json:{write:!0}})],QL.prototype,"label",void 0),E([k({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],QL.prototype,"value",void 0),E([mr("value")],QL.prototype,"writeValue",null),QL=Xwe=E([ht("esri.renderers.visualVariables.support.ColorStop")],QL);const Q7e=QL;var Kwe;let e5=Kwe=class extends qW{constructor(t){super(t),this.type="color",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(t){t&&Array.isArray(t)&&(t=t.filter(e=>!!e)).sort((e,i)=>e.value-i.value),this._set("stops",t)}clone(){return new Kwe({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(t=>t.clone()),legendOptions:this.legendOptions&&this.legendOptions.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(t=>t.value||0)}};E([k({readOnly:!0})],e5.prototype,"cache",null),E([k({type:["color"],json:{type:["colorInfo"]}})],e5.prototype,"type",void 0),E([k({type:String,json:{write:!0}})],e5.prototype,"normalizationField",void 0),E([k({type:[Q7e],json:{write:!0}})],e5.prototype,"stops",null),e5=Kwe=E([ht("esri.renderers.visualVariables.ColorVariable")],e5);const eze=e5;var Jwe;let wR=Jwe=class extends Ni{constructor(t){super(t),this.label=null,this.opacity=null,this.value=null}readOpacity(t,e){return p9(e.transparency)}writeOpacity(t,e,i){e[i]=Kne(t)}clone(){return new Jwe({label:this.label,opacity:this.opacity,value:this.value})}};E([k({type:String,json:{write:!0}})],wR.prototype,"label",void 0),E([k({type:Number,json:{type:xs,write:{target:"transparency"}}})],wR.prototype,"opacity",void 0),E([Li("opacity",["transparency"])],wR.prototype,"readOpacity",null),E([mr("opacity")],wR.prototype,"writeOpacity",null),E([k({type:Number,json:{write:!0}})],wR.prototype,"value",void 0),wR=Jwe=E([ht("esri.renderers.visualVariables.support.OpacityStop")],wR);const rVt=wR;var Zwe;let t5=Zwe=class extends qW{constructor(t){super(t),this.type="opacity",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(t){t&&Array.isArray(t)&&(t=t.filter(e=>!!e)).sort((e,i)=>e.value-i.value),this._set("stops",t)}clone(){return new Zwe({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(t=>t.clone()),legendOptions:this.legendOptions&&this.legendOptions.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(t=>t.value||0)}};E([k({readOnly:!0})],t5.prototype,"cache",null),E([k({type:["opacity"],json:{type:["transparencyInfo"]}})],t5.prototype,"type",void 0),E([k({type:String,json:{write:!0}})],t5.prototype,"normalizationField",void 0),E([k({type:[rVt],json:{write:!0}})],t5.prototype,"stops",null),t5=Zwe=E([ht("esri.renderers.visualVariables.OpacityVariable")],t5);const tze=t5;var Qwe;let fA=Qwe=class extends qW{constructor(t){super(t),this.axis=null,this.type="rotation",this.rotationType="geographic",this.valueExpressionTitle=null}get cache(){return{hasExpression:!!this.valueExpression,compiledFunc:null}}writeValueExpressionTitleWebScene(t,e,i,r){if(r&&r.messages){const n=`visualVariables[${this.index}]`;r.messages.push(new st("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 Qwe({axis:this.axis,rotationType:this.rotationType,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,legendOptions:this.legendOptions&&this.legendOptions.clone()})}};E([k({readOnly:!0})],fA.prototype,"cache",null),E([k({type:["heading","tilt","roll"],json:{origins:{"web-scene":{default:"heading",write:!0}}}})],fA.prototype,"axis",void 0),E([k({type:["rotation"],json:{type:["rotationInfo"]}})],fA.prototype,"type",void 0),E([k({type:["geographic","arithmetic"],json:{write:!0,origins:{"web-document":{write:!0,default:"geographic"}}}})],fA.prototype,"rotationType",void 0),E([k({type:String,json:{write:!0}})],fA.prototype,"valueExpressionTitle",void 0),E([mr("web-scene","valueExpressionTitle")],fA.prototype,"writeValueExpressionTitleWebScene",null),fA=Qwe=E([ht("esri.renderers.visualVariables.RotationVariable")],fA);const Ise=fA;var exe;let x9=exe=class extends Ni{constructor(t){super(t),this.label=null,this.size=null,this.value=null}clone(){return new exe({label:this.label,size:this.size,value:this.value})}};E([k({type:String,json:{write:!0}})],x9.prototype,"label",void 0),E([k({type:Number,cast:Da,json:{write:!0}})],x9.prototype,"size",void 0),E([k({type:Number,json:{write:!0}})],x9.prototype,"value",void 0),x9=exe=E([ht("esri.renderers.visualVariables.support.SizeStop")],x9);const S9=x9;var txe;let Ase=txe=class extends Z7e{constructor(){super(...arguments),this.customValues=null}clone(){return new txe({title:this.title,showLegend:this.showLegend,customValues:this.customValues&&this.customValues.slice(0)})}};E([k({type:[Number],json:{write:!0}})],Ase.prototype,"customValues",void 0),Ase=txe=E([ht("esri.renderers.visualVariables.support.SizeVariableLegendOptions")],Ase);const nVt=Ase;var mA,vh;function qC(t){return t&&t.declaredClass==="esri.renderers.visualVariables.SizeVariable"}function YW(t){return t!=null&&!isNaN(t)&&isFinite(t)}function ize(t){return t.valueExpression?mA.Expression:t.field&&typeof t.field=="string"?mA.Field:mA.Unknown}function sVt(t,e){const i=e||ize(t),r=t.valueUnit||"unknown";return i===mA.Unknown?vh.Constant:t.stops?vh.Stops:t.minSize!=null&&t.maxSize!=null&&t.minDataValue!=null&&t.maxDataValue!=null?vh.ClampedLinear:r==="unknown"?t.minSize!=null&&t.minDataValue!=null?t.minSize&&t.minDataValue?vh.Proportional:vh.Additive:vh.Identity:vh.RealWorldSize}(function(t){t.Unknown="unknown",t.Expression="expression",t.Field="field"})(mA||(mA={})),function(t){t.Unknown="unknown",t.Stops="stops",t.ClampedLinear="clamped-linear",t.Proportional="proportional",t.Additive="additive",t.Constant="constant",t.Identity="identity",t.RealWorldSize="real-world-size"}(vh||(vh={}));function lDr(t){}function oVt(t){return()=>t}const XW={inches:H0(1,"meters","inches"),feet:H0(1,"meters","feet"),"us-feet":H0(1,"meters","us-feet"),yards:H0(1,"meters","yards"),miles:H0(1,"meters","miles"),"nautical-miles":H0(1,"meters","nautical-miles"),millimeters:H0(1,"meters","millimeters"),centimeters:H0(1,"meters","centimeters"),decimeters:H0(1,"meters","decimeters"),meters:H0(1,"meters","meters"),kilometers:H0(1,"meters","kilometers"),"decimal-degrees":1/c$t(1,"meters",wu.radius)},xR=Ei.getLogger("esri.renderers.visualVariables.support.visualVariableUtils"),rze=new js,Pse=Math.PI,nze=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i;function sze(t,e,i){const r="visualVariables"in t&&t.visualVariables?t.visualVariables.find(S=>S.type==="color"):t;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.ColorVariable")return void xR.warn("The visualVariable should be an instance of esri.renderers.visualVariables.ColorVariable");const n=typeof e=="number",s=n?null:e,o=s&&s.attributes;let a=n?e:null;const l=r.field,{ipData:c,hasExpression:d}=r.cache;let p=r.cache.compiledFunc;if(!l&&!d){const S=r.stops;return S&&S[0]&&S[0].color}if(typeof a!="number")if(d){if(lt(i)||lt(i.arcade))return void xR.error("Use of arcade expressions requires an arcade context");const S={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},I=i.arcade.arcadeUtils,O=I.getViewInfo(S),L=I.createExecContext(s,O);if(!p){const N=I.createSyntaxTree(r.valueExpression);p=I.createFunction(N),r.cache.compiledFunc=p}a=I.executeFunction(p,L)}else o&&(a=o[l]);const y=r.normalizationField,v=o!=null&&y!=null?parseFloat(o[y]):void 0;if(a!=null&&(!y||n||!isNaN(v)&&v!==0)){isNaN(v)||n||(a/=v);const S=rxe(a,c);if(S){const I=S[0],O=S[1],L=I===O?r.stops[I].color:$r.blendColors(r.stops[I].color,r.stops[O].color,S[2],ye(i)?i.color:void 0);return new $r(L)}}}function oze(t,e,i){const r="visualVariables"in t&&t.visualVariables?t.visualVariables.find(S=>S.type==="opacity"):t;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.OpacityVariable")return void xR.warn("The visualVariable should be an instance of esri.renderers.visualVariables.OpacityVariable");const n=typeof e=="number",s=n?null:e,o=s&&s.attributes;let a=n?e:null;const l=r.field,{ipData:c,hasExpression:d}=r.cache;let p=r.cache.compiledFunc;if(!l&&!d){const S=r.stops;return S&&S[0]&&S[0].opacity}if(typeof a!="number")if(d){if(lt(i)||lt(i.arcade))return void xR.error("Use of arcade expressions requires an arcade context");const S={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},I=i.arcade.arcadeUtils,O=I.getViewInfo(S),L=I.createExecContext(s,O);if(!p){const N=I.createSyntaxTree(r.valueExpression);p=I.createFunction(N),r.cache.compiledFunc=p}a=I.executeFunction(p,L)}else o&&(a=o[l]);const y=r.normalizationField,v=o!=null&&y!=null?parseFloat(o[y]):void 0;if(a!=null&&(!y||n||!isNaN(v)&&v!==0)){isNaN(v)||n||(a/=v);const S=rxe(a,c);if(S){const I=S[0],O=S[1];if(I===O)return r.stops[I].opacity;{const L=r.stops[I].opacity;return L+(r.stops[O].opacity-L)*S[2]}}}}function ixe(t,e,i){const r="visualVariables"in t&&t.visualVariables?t.visualVariables.find(v=>v.type==="rotation"):t;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.RotationVariable")return void xR.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&&a.attributes,c=r.field,{hasExpression:d}=r.cache;let p=r.cache.compiledFunc,y=0;if(!c&&!d)return y;if(d){if(lt(i)||lt(i.arcade))return void xR.error("Use of arcade expressions requires an arcade context");const v={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},S=i.arcade.arcadeUtils,I=S.getViewInfo(v),O=S.createExecContext(a,I);if(!p){const L=S.createSyntaxTree(r.valueExpression);p=S.createFunction(L),r.cache.compiledFunc=p}y=S.executeFunction(p,O)}else l&&(y=l[c]||0);return y=typeof y!="number"||isNaN(y)?null:s+o*y,y}function aVt(t,e,i){const r=typeof e=="number",n=r?null:e,s=n&&n.attributes;let o=r?e:null;const{isScaleDriven:a}=t.cache;let l=t.cache.compiledFunc;if(a){const d=ye(i)?i.scale:void 0,p=ye(i)?i.view:void 0;o=d==null||p==="3d"?lVt(t):d}else if(!r)switch(t.inputValueType){case mA.Expression:{if(lt(i)||lt(i.arcade))return void xR.error("Use of arcade expressions requires an arcade context");const d={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},p=i.arcade.arcadeUtils,y=p.getViewInfo(d),v=p.createExecContext(n,y);if(!l){const S=p.createSyntaxTree(t.valueExpression);l=p.createFunction(S),t.cache.compiledFunc=l}o=p.executeFunction(l,v);break}case mA.Field:s&&(o=s[t.field]);break;case mA.Unknown:o=null}if(!YW(o))return null;if(r||!t.normalizationField)return o;const c=s?parseFloat(s[t.normalizationField]):null;return YW(c)&&c!==0?o/c:null}function lVt(t){let e=null,i=null;const r=t.stops;return r?(e=r[0].value,i=r[r.length-1].value):(e=t.minDataValue||0,i=t.maxDataValue||0),(e+i)/2}function Ose(t,e,i){const r="visualVariables"in t&&t.visualVariables?t.visualVariables.find(s=>s.type==="size"):t;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.SizeVariable")return void xR.warn("The visualVariable should be an instance of esri.renderers.visualVariables.SizeVariable");const n=lze(aVt(r,e,i),r,e,i,r.cache.ipData);return n==null||isNaN(n)?0:n}function Kv(t,e,i){return t==null?null:qC(t)?Ose(t,e,i):YW(t)?t:null}function aze(t,e,i){return YW(i)&&t>i?i:YW(e)&&t=e.maxDataValue)return o;if(s==null||o==null)return null;if(e.scaleBy==="area"&&a){const l=a==="circle",c=l?Pse*(s/2)**2:s*s,d=c+n*((l?Pse*(o/2)**2:o*o)-c);return l?2*Math.sqrt(d/Pse):Math.sqrt(d)}return s+n*(o-s)}function dVt(t,e,i,r){const n=ye(r)?r.shape:void 0,s=t/e.minDataValue,o=Kv(e.minSize,i,r),a=Kv(e.maxSize,i,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,aze(l,o,a)}function pVt(t,e,i,r,n){const[s,o,a]=rxe(t,n);if(s===o)return Kv(e.stops?.[s].size,i,r);{const l=Kv(e.stops?.[s].size,i,r);return l+(Kv(e.stops?.[o].size,i,r)-l)*a}}function fVt(t,e,i,r){const n=(ye(r)&&r.resolution?r.resolution:1)*XW[e.valueUnit],s=Kv(e.minSize,i,r),o=Kv(e.maxSize,i,r),{valueRepresentation:a}=e;let l=null;return l=a==="area"?2*Math.sqrt(t/Pse)/n:a==="radius"||a==="distance"?2*t/n:t/n,aze(l,s,o)}function uDr(t){return t}function lze(t,e,i,r,n){switch(e.transformationType){case vh.Additive:return uVt(t,e,i,r);case vh.Constant:return cVt(e,i,r);case vh.ClampedLinear:return hVt(t,e,i,r);case vh.Proportional:return dVt(t,e,i,r);case vh.Stops:return pVt(t,e,i,r,n);case vh.RealWorldSize:return fVt(t,e,i,r);case vh.Identity:return t;case vh.Unknown:return null}}function mVt(t,e,i){const{isScaleDriven:r}=t.cache;if(!(r&&i==="3d"||e))return null;const n={scale:e,view:i};let s=Kv(t.minSize,rze,n),o=Kv(t.maxSize,rze,n);if(s!=null||o!=null){if(s>o){const a=o;o=s,s=a}return{minSize:s,maxSize:o}}}function gVt(t,e,i){if(!t.visualVariables)return;const r=[],n=[],s=[],o=[],a=[];for(const l of t.visualVariables)switch(l.type){case"color":n.push(l);break;case"opacity":s.push(l);break;case"rotation":a.push(l);break;case"size":o.push(l)}return n.forEach(l=>{const c=sze(l,e,i);r.push({variable:l,value:c})}),s.forEach(l=>{const c=oze(l,e,i);r.push({variable:l,value:c})}),a.forEach(l=>{const c=ixe(l,e,i);r.push({variable:l,value:c})}),o.forEach(l=>{const c=Ose(l,e,i);r.push({variable:l,value:c})}),r.filter(l=>l.value!=null)}function rxe(t,e){if(!e)return;let i=0,r=e.length-1;return e.some((n,s)=>t!!e)).sort((e,i)=>e.value-i.value):t&&(Ei.getLogger(this.declaredClass).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),t=null),this._set("stops",t)}get transformationType(){return sVt(this,this.inputValueType)}readValueExpression(t,e){return t||e.expression&&"$view.scale"}writeValueExpressionWebScene(t,e,i,r){if(t==="$view.scale"){if(r&&r.messages){const n=this.index,s=typeof n=="string"?n:`visualVariables[${n}]`;r.messages.push(new st("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[i]=t}readValueUnit(t){return t?sxe.read(t):null}clone(){return new nxe({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:qC(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:qC(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:this.stops&&this.stops.map(t=>t.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions&&this.legendOptions.clone()})}flipSizes(){if(this.transformationType===vh.ClampedLinear){const{minSize:t,maxSize:e}=this;return this.minSize=e,this.maxSize=t,this}if(this.transformationType===vh.Stops){const t=this.stops;if(!t)return this;const e=t.map(r=>r.size).reverse(),i=t.length;for(let r=0;rt.value||0)}};E([k({readOnly:!0})],Hu.prototype,"cache",null),E([k({type:Mse.apiValues,json:{type:Mse.jsonValues,origins:{"web-map":{read:!1}},read:Mse.read,write:Mse.write}})],Hu.prototype,"axis",void 0),E([k({type:String,value:null,json:{read:!1}})],Hu.prototype,"expression",null),E([k()],Hu.prototype,"index",null),E([k({type:String,readOnly:!0})],Hu.prototype,"inputValueType",null),E([k({type:nVt,json:{write:!0}})],Hu.prototype,"legendOptions",void 0),E([k({type:Number,value:null,json:{write:!0}})],Hu.prototype,"maxDataValue",null),E([k({type:Number,value:null,json:{write:!0}})],Hu.prototype,"maxSize",null),E([Zs("maxSize")],Hu.prototype,"castMaxSize",null),E([Li("maxSize")],Hu.prototype,"readMaxSize",null),E([k({type:Number,value:null,json:{write:!0}})],Hu.prototype,"minDataValue",null),E([k({type:Number,value:null,json:{write:!0}})],Hu.prototype,"minSize",null),E([Zs("minSize")],Hu.prototype,"castMinSize",null),E([Li("minSize")],Hu.prototype,"readMinSize",null),E([k({type:String,json:{write:!0}})],Hu.prototype,"normalizationField",void 0),E([k({readOnly:!0})],Hu.prototype,"arcadeRequired",null),E([k({type:String})],Hu.prototype,"scaleBy",void 0),E([k({type:[S9],value:null,json:{write:!0}})],Hu.prototype,"stops",null),E([k({type:["outline"],json:{write:!0}})],Hu.prototype,"target",void 0),E([k({type:String,readOnly:!0})],Hu.prototype,"transformationType",null),E([k({type:["size"],json:{type:["sizeInfo"]}})],Hu.prototype,"type",void 0),E([k({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],Hu.prototype,"useSymbolValue",void 0),E([k({type:String,json:{write:!0}})],Hu.prototype,"valueExpression",void 0),E([Li("valueExpression",["valueExpression","expression"])],Hu.prototype,"readValueExpression",null),E([mr("web-scene","valueExpression")],Hu.prototype,"writeValueExpressionWebScene",null),E([k({type:["radius","diameter","area","width","distance"],json:{write:!0}})],Hu.prototype,"valueRepresentation",void 0),E([k({type:sxe.apiValues,json:{write:sxe.write,origins:{"web-map":{read:!1},"web-scene":{write:!0},"portal-item":{write:!0}}}})],Hu.prototype,"valueUnit",void 0),E([Li("valueUnit")],Hu.prototype,"readValueUnit",null),Hu=nxe=E([ht("esri.renderers.visualVariables.SizeVariable")],Hu);const i5=Hu,yVt={color:eze,size:i5,opacity:tze,rotation:Ise},vVt=new Bs({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"}),_Vt=/^\[([^\]]+)\]$/i;let Dse=class extends fn{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(i=>!!i))&&e.length){for(const i of e)switch(i.type){case"color":this.colorVariables.push(i);break;case"opacity":this.opacityVariables.push(i);break;case"rotation":this.rotationVariables.push(i);break;case"size":this.sizeVariables.push(i)}this.sizeVariables.length&&this.sizeVariables.some(i=>!!i.target)&&e.sort((i,r)=>{let n=null;return n=i.target===r.target?0:i.target?1:-1,n});for(let i=0;i{const c=vVt.read(l.type),d=yVt[c];d||(Ei.getLogger(this.declaredClass).warn(`Unknown variable type: ${c}`),r&&r.messages&&r.messages.push(new wm("visual-variable:unsupported",`visualVariable of type '${c}' is not supported`,{definition:l,context:r})));const p=new d;return p.read(l,r),p})}writeVariables(e,i){const r=[];for(const n of e){const s=n.toJSON(i);s&&r.push(s)}return r}_resetVariables(){this.colorVariables=[],this.opacityVariables=[],this.rotationVariables=[],this.sizeVariables=[]}};E([k()],Dse.prototype,"visualVariables",null),Dse=E([ht("esri.renderers.visualVariables.VisualVariableFactory")],Dse);const bVt=Dse,wVt={base:qW,key:"type",typeMap:{opacity:tze,color:eze,rotation:Ise,size:i5}},SR=t=>{let e=class extends t{constructor(){super(...arguments),this._vvFactory=new bVt}set visualVariables(i){this._vvFactory.visualVariables=i,this._set("visualVariables",this._vvFactory.visualVariables)}readVisualVariables(i,r,n){return this._vvFactory.readVariables(i,r,n)}writeVisualVariables(i,r,n,s){r[n]=this._vvFactory.writeVariables(i,s)}get arcadeRequiredForVisualVariables(){if(!this.visualVariables)return!1;for(const i of this.visualVariables)if(i.arcadeRequired)return!0;return!1}hasVisualVariables(i,r){return i?this.getVisualVariablesForType(i,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(i,r){const n=this.visualVariables;return n?n.filter(s=>s.type===i&&(typeof r=="string"?s.target===r:r!==!1||!s.target)):[]}async collectVVRequiredFields(i,r){let n=[];this.visualVariables&&(n=n.concat(this.visualVariables));for(const s of n)s&&(s.field&&Yy(i,r,s.field),s.normalizationField&&Yy(i,r,s.normalizationField),s.valueExpression&&(xVt(s.valueExpression,i,r)||await K0(i,r,s.valueExpression)))}};return E([k({types:[wVt],value:null,json:{write:!0}})],e.prototype,"visualVariables",null),E([Li("visualVariables",["visualVariables","rotationType","rotationExpression"])],e.prototype,"readVisualVariables",null),E([mr("visualVariables")],e.prototype,"writeVisualVariables",null),e=E([ht("esri.renderers.mixins.VisualVariablesMixin")],e),e};function xVt(t,e,i){const r=tVt(t);return!!ye(r)&&(Yy(e,i,r),!0)}const KW={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};function SVt(t,e=KW){if(!t)return{symbol:null};const{retainId:i=KW.retainId,ignoreDrivers:r=KW.ignoreDrivers,hasLabelingContext:n=KW.hasLabelingContext,retainCIM:s=KW.retainCIM}=e;let o=null;if(_R(t)||t instanceof KL)o=t.clone();else if(t.type==="cim"){const a=t.data?.symbol?.type;if(a!=="CIMPointSymbol")return{error:new st("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${a||"unknown"}' is unsupported in 3D`,{symbol:t})};o=s?t.clone():qL.fromCIMSymbol(t)}else if(t instanceof Tm)o=mse.fromSimpleLineSymbol(t);else if(t instanceof gd)o=qL.fromSimpleMarkerSymbol(t);else if(t instanceof pA)o=qL.fromPictureMarkerSymbol(t);else if(t instanceof iw)o=e.geometryType&&e.geometryType==="mesh"?yse.fromSimpleFillSymbol(t):VW.fromSimpleFillSymbol(t);else{if(!(t instanceof XL))return{error:new st("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${t.type||t.declaredClass}' is unsupported in 3D`,{symbol:t})};o=n?pse.fromTextSymbol(t):qL.fromTextSymbol(t)}if(i&&o&&o.type!=="cim"&&(o.id=t.id),r&&_R(o))for(let a=0;at==null||typeof t=="string"||typeof t=="number"?t:`${t}`,json:{type:String,write:{writer:(t,e)=>{e.value=t?.toString()}}}};var oxe;let CR=oxe=class extends Ni{constructor(t){super(t),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}clone(){return new oxe({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const t=JSON.stringify(this.symbol);return`${this.minValue}.${this.maxValue}.${t}`}};E([k({type:String,json:{write:!0}})],CR.prototype,"description",void 0),E([k({type:String,json:{write:!0}})],CR.prototype,"label",void 0),E([k({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],CR.prototype,"minValue",void 0),E([k({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],CR.prototype,"maxValue",void 0),E([k(C9)],CR.prototype,"symbol",void 0),CR=oxe=E([ht("esri.renderers.support.ClassBreakInfo")],CR);const T9=CR;var axe;const gze="log",kse="percent-of-total",Nse="field",$se=new Bs({esriNormalizeByLog:gze,esriNormalizeByPercentOfTotal:kse,esriNormalizeByField:Nse}),CVt=ud(T9);let Lf=axe=class extends SR(HC){constructor(t){super(t),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(t,e,i){if(!Array.isArray(t))return;let r=e.minValue;return t.map(n=>{const s=new T9;return s.read(n,i),s.minValue==null&&(s.minValue=r),s.maxValue==null&&(s.maxValue=s.minValue),r=s.maxValue,s})}writeClassBreakInfos(t,e,i,r){const n=t.map(s=>s.write({},r));this._areClassBreaksConsecutive()&&n.forEach(s=>delete s.classMinValue),e[i]=n}castField(t){return t==null?t:typeof t=="function"?(Ei.getLogger(this.declaredClass).error(".field: field must be a string value"),null):MH(t)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let t=this._get("normalizationType");const e=!!this.normalizationField,i=this.normalizationTotal!=null;return e||i?(t=e&&Nse||i&&kse||null,e&&i&&Ei.getLogger(this.declaredClass).warn("warning: both normalizationField and normalizationTotal are set!")):t!==Nse&&t!==kse||(t=null),t}set normalizationType(t){this._set("normalizationType",t)}addClassBreakInfo(t,e,i){let r=null;r=typeof t=="number"?new T9({minValue:t,maxValue:e,symbol:H7e(i)}):CVt(hi(t)),this.classBreakInfos.push(r),this.classBreakInfos.length===1&&this.notifyChange("minValue")}removeClassBreakInfo(t,e){const i=this.classBreakInfos.length;for(let r=0;r-1?this.classBreakInfos[i].symbol:this.defaultSymbol}async getSymbolAsync(t,e){let i=e;if(this.valueExpression&&(lt(e)||lt(e.arcade))){const n=await Wv(),{arcadeUtils:s}=n;s.hasGeometryOperations(this.valueExpression)&&await s.enableGeometryOperations(),i={...i,arcade:n}}const r=this.getBreakIndex(t,i);return r>-1?this.classBreakInfos[r].symbol:this.defaultSymbol}getSymbols(){const t=[];return this.classBreakInfos.forEach(e=>{e.symbol&&t.push(e.symbol)}),this.defaultSymbol&&t.push(this.defaultSymbol),t}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((t,e)=>t+e.getAttributeHash(),"")}getMeshHash(){const t=JSON.stringify(this.backgroundFillSymbol),e=JSON.stringify(this.defaultSymbol),i=`${this.normalizationField}.${this.normalizationType}.${this.normalizationTotal}`;return`${t}.${e}.${this.classBreakInfos.reduce((r,n)=>r+n.getMeshHash(),"")}.${i}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){return new axe({field:this.field,backgroundFillSymbol:this.backgroundFillSymbol&&this.backgroundFillSymbol.clone(),defaultLabel:this.defaultLabel,defaultSymbol:this.defaultSymbol&&this.defaultSymbol.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:hi(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:hi(this.visualVariables),legendOptions:hi(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}async collectRequiredFields(t,e){const i=[this.collectVVRequiredFields(t,e),this.collectSymbolFields(t,e)];await Promise.all(i)}async collectSymbolFields(t,e){const i=[...this.getSymbols().map(r=>r.collectRequiredFields(t,e)),K0(t,e,this.valueExpression)];Yy(t,e,this.field),Yy(t,e,this.normalizationField),await Promise.all(i)}_getBreakIndexForExpression(t,e){const{viewingMode:i,scale:r,spatialReference:n,arcade:s}=Fu(e,{}),{valueExpression:o}=this;let a=this._compiledValueExpression.valueExpression===o?this._compiledValueExpression.compiledFunction:null;const l=s.arcadeUtils;if(!a){const d=l.createSyntaxTree(o);a=l.createFunction(d),this._compiledValueExpression.compiledFunction=a}this._compiledValueExpression.valueExpression=o;const c=l.executeFunction(a,l.createExecContext(t,l.getViewInfo({viewingMode:i,scale:r,spatialReference:n})));return this._getBreakIndexfromInfos(c)}_getBreakIndexForField(t){const e=this.field,i=t.attributes,r=this.normalizationType;let n=parseFloat(i[e]);if(r){const s=this.normalizationTotal,o=parseFloat(this.normalizationField?i[this.normalizationField]:void 0);if(r===gze)n=Math.log(n)*Math.LOG10E;else if(r!==kse||s==null||isNaN(s)){if(r===Nse&&!isNaN(o)){if(isNaN(n)||isNaN(o))return-1;n/=o}}else n=n/s*100}return this._getBreakIndexfromInfos(n)}_getBreakIndexfromInfos(t){const e=this.isMaxInclusive;if(t!=null&&typeof t=="number"&&!isNaN(t))for(let i=0;iLd(t),json:{write:!0}})],Lf.prototype,"normalizationTotal",void 0),E([k({type:$se.apiValues,value:null,json:{type:$se.jsonValues,read:$se.read,write:$se.write}})],Lf.prototype,"normalizationType",null),E([Hr({classBreaks:"class-breaks"})],Lf.prototype,"type",void 0),E([k({type:String,json:{write:!0}})],Lf.prototype,"valueExpression",void 0),E([k({type:String,json:{write:!0}})],Lf.prototype,"valueExpressionTitle",void 0),Lf=axe=E([ht("esri.renderers.ClassBreaksRenderer")],Lf);const r5=Lf,lxe=-3;var TR;(function(t){t[t.ALL=0]="ALL",t[t.SOME=1]="SOME"})(TR||(TR={}));let TVt=class{constructor(e,i,r){this._namespace=e,this._storage=i,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),this._namespace+=":",r&&(this._storage.registerRemoveFunc(this._namespace,r),this._removeFunc=!0)}destroy(){this._storage.clear(this._namespace),this._removeFunc&&this._storage.deregisterRemoveFunc(this._namespace),this._storage.deregister(this),this._storage=null}get namespace(){return this._namespace.slice(0,-1)}get hitRate(){return this._hit/(this._hit+this._miss)}get size(){return this._storage.size}get maxSize(){return this._storage.maxSize}resetHitRate(){this._hit=this._miss=0}put(e,i,r,n=0){this._storage.put(this._namespace+e,i,r,n)}get(e){const i=this._storage.get(this._namespace+e);return i===void 0?++this._miss:++this._hit,i}pop(e){const i=this._storage.pop(this._namespace+e);return i===void 0?++this._miss:++this._hit,i}updateSize(e,i,r){this._storage.updateSize(this._namespace+e,i,r)}clear(){this._storage.clear(this._namespace)}clearAll(){this._storage.clearAll()}getStats(){return this._storage.getStats()}resetStats(){this._storage.resetStats()}},uxe=class{constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new _m,this._users=new _m}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,i){this._removeFuncs.push([e,i])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace(i=>i[0]!==e)}get size(){return this._size}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,0),this._checkSizeLimit()}put(e,i,r,n){const s=this._db.get(e);if(s&&(this._size-=s.size,this._db.delete(e),s.entry!==i&&this._notifyRemove(e,s.entry,TR.ALL)),r>this._maxSize)return void this._notifyRemove(e,i,TR.ALL);if(i===void 0)return void console.warn("Refusing to cache undefined entry ");if(!r||r<0)return void console.warn("Refusing to cache entry with invalid size "+r);const o=1+Math.max(n,lxe)-lxe;this._db.set(e,{entry:i,size:r,lifetime:o,lives:o}),this._size+=r,this._checkSizeLimit()}updateSize(e,i,r){const n=this._db.get(e);if(n&&n.entry===i){for(this._size-=n.size;r>this._maxSize;){const s=this._notifyRemove(e,i,TR.SOME);if(!(ye(s)&&s>0))return void this._db.delete(e);r=s}n.size=r,this._size+=r,this._checkSizeLimit()}}pop(e){const i=this._db.get(e);if(i)return this._size-=i.size,this._db.delete(e),++this._hit,i.entry;++this._miss}get(e){const i=this._db.get(e);if(i!==void 0)return this._db.delete(e),i.lives=i.lifetime,this._db.set(e,i),++this._hit,i.entry;++this._miss}getStats(){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()},i={},r=new Array;this._db.forEach((o,a)=>{const l=o.lifetime;r[l]=(r[l]||0)+o.size,this._users.forAll(c=>{const d=c.namespace;if(a.startsWith(d)){const p=i[d]||0;i[d]=p+o.size}})});const n={};this._users.forAll(o=>{const a=o.namespace;if(!isNaN(o.hitRate)&&o.hitRate>0){const l=i[a]||0;i[a]=l,n[a]=Math.round(100*o.hitRate)+"%"}else n[a]="0%"});const s=Object.keys(i);s.sort((o,a)=>i[a]-i[o]),s.forEach(o=>e[o]=Math.round(i[o]/2**20)+"MB / "+n[o]);for(let o=r.length-1;o>=0;--o){const a=r[o];a&&(e["Priority "+(o+lxe-1)]=Math.round(a/this.size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll(e=>e.resetHitRate())}clear(e){this._db.forEach((i,r)=>{r.startsWith(e)&&(this._size-=i.size,this._db.delete(r),this._notifyRemove(r,i.entry,TR.ALL))})}clearAll(){this._db.forEach((e,i)=>this._notifyRemove(i,e.entry,TR.ALL)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,i,r){let n;return this._removeFuncs.some(s=>{if(e.startsWith(s[0])){const o=s[1](i,r);return typeof o=="number"&&(n=o),!0}return!1}),n}_checkSizeLimit(){if(!(this._size<=this._maxSize))for(const[e,i]of this._db){if(this._db.delete(e),i.lives<=1){this._size-=i.size;const r=this._notifyRemove(e,i.entry,TR.SOME);ye(r)&&r>0&&(this._size+=r,i.lives=i.lifetime,i.size=r,this._db.set(e,i))}else--i.lives,this._db.set(e,i);if(this._size<=.9*this.maxSize)return}}},E9=class{constructor(e,i){this._storage=new uxe,this._storage.maxSize=e,i&&this._storage.registerRemoveFunc("",i)}put(e,i,r){this._storage.put(e,i,r,1)}pop(e){return this._storage.pop(e)}get(e){return this._storage.get(e)}clear(){this._storage.clearAll()}destroy(){this._storage.destroy()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}};const yze="esri.renderers.support.DictionaryLoader",EVt={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};let cxe=class{constructor(e,i,r){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new E9(100),this._dictionaryPromise=null,this.url=e,this.config=i,this.fieldMap=r}getSymbolFields(){return this._symbolFields}async getSymbolAsync(e,i){let r;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(i));try{r=await this._dictionaryPromise}catch(v){if(ss(v))return this._dictionaryPromise=null,null}const n={};if(this.fieldMap)for(const v of this._symbolFields){const S=this.fieldMap[v];if(S&&e.attributes[S]!=null){const I=""+e.attributes[S];n[v]=I}else n[v]=""}const s=r?.(n,i);if(!s||typeof s!="string")return null;const o=Gc(s).toString(),a=this._symbolCache.get(o);if(a)return a.catch(()=>{this._symbolCache.pop(o)}),a;const l=s.split(";"),c=[],d=[];for(const v of l)if(v)if(v.includes("po:")){const S=v.substr(3).split("|");if(S.length===3){const I=S[0],O=S[1];let L=S[2];if(O==="DashTemplate")L=L.split(" ").map(N=>Number(N));else if(O==="Color"){const N=new $r(L).toRgba();L=[N[0],N[1],N[2],255*N[3]]}else L=Number(L);d.push({primitiveName:I,propertyName:O,value:L})}}else if(v.includes("|")){for(const S of v.split("|"))if(this._itemNames.has(S)){c.push(S);break}}else this._itemNames.has(v)&&c.push(v);const p=!ye(e.geometry)||!e.geometry.hasZ&&e.geometry.type==="point",y=this._cimPartsToCIMSymbol(c,d,p,i);return this._symbolCache.put(o,y,1),y}async fetchResources(e){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void Ei.getLogger(yze).error("no valid URL!");const i=ir(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:ye(e)?e.signal:null}),[{data:r}]=await Promise.all([i,Wv()]);if(!r)throw this._dictionaryPromise=null,new st("esri.renderers.DictionaryRenderer","Bad dictionary data!");const n=r.expression,s=r.authoringInfo;this._refSymbolUrlTemplate=this.url+"/"+r.cimRefTemplateUrl,this._itemNames=new Set(r.itemsNames),this._symbolFields=s.symbol;const o={};if(this.config){const c=this.config;for(const d in c)o[d]=c[d]}if(s.configuration)for(const c of s.configuration)o.hasOwnProperty(c.name)||(o[c.name]=c.value);const a=[];if(ye(e)&&e.fields&&this.fieldMap)for(const c of this._symbolFields){const d=this.fieldMap[c],p=e.fields.filter(y=>y.name===d);p.length>0&&a.push({...p[0],name:c})}const l=J9t(n,ye(e)?e.spatialReference:null,a,o).then(c=>{const d={scale:0};return(p,y)=>{if(lt(c))return null;const v=c.repurposeFeature({geometry:null,attributes:p});return d.scale=ye(y)?y.scale??void 0:void 0,c.evaluate({$feature:v,$view:d})}}).catch(c=>(Ei.getLogger(yze).error("Creating dictinoary expression failed:",c),null));return this._dictionaryPromise=l,l}async _cimPartsToCIMSymbol(e,i,r,n){const s=new Array(e.length);for(let l=0;ls.data);const r=this._refSymbolUrlTemplate.replace(/\{itemName\}/gi,e),n=ir(r,{responseType:"json",query:{f:"json"},...i});this._ongoingRequests.set(e,n);try{return(await n).data}catch(s){throw this._ongoingRequests.delete(e),s}}_combineSymbolParts(e,i,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=EVt),{type:"CIMSymbolReference",symbol:n,primitiveOverrides:i}}};function vze(t,e){if(!t)return;const i=t.symbolLayers;if(!i)return;let r=i.length;for(;r--;){const n=i[r];n&&n.enable!==!1&&n.type==="CIMVectorMarker"&&IVt(n,e)}}function IVt(t,e){const i=t.markerGraphics;if(i)for(const r of i){if(!r)continue;const n=r.symbol;if(n)switch(n.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":vze(n,e);break;case"CIMTextSymbol":n.fieldMap=e}}}const AVt=Object.freeze(Object.defineProperty({__proto__:null,DictionaryLoader:cxe},Symbol.toStringTag,{value:"Module"}));var hxe;let h2=hxe=class extends SR(HC){constructor(t){super(t),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}get _loader(){return new cxe(this.url,this.config,this.fieldMap)}writeData(t,e){t&&(e.scalingExpressionInfo={expression:t,returnType:"number"})}writeVisualVariables(t,e,i,r){r?.origin||super.writeVisualVariables(t,e,i,r)}clone(){return new hxe({config:hi(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:hi(this.fieldMap),url:hi(this.url),visualVariables:hi(this.visualVariables)})}async getSymbolAsync(t,e){return this._loader.getSymbolAsync(t,e)}async collectRequiredFields(t,e){await this.collectVVRequiredFields(t,e),this.scaleExpression&&await K0(t,e,this.scaleExpression);for(const i in this.fieldMap){const r=this.fieldMap[i];e.has(r)&&t.add(r)}}get arcadeRequired(){return!0}getSymbol(){return null}getSymbols(){return[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((t,e)=>t+e.getAttributeHash(),"")}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}getSymbolFields(){return this._loader.getSymbolFields()}};E([k({type:cxe})],h2.prototype,"_loader",null),E([k({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],h2.prototype,"config",void 0),E([k({type:Object,json:{write:!0}})],h2.prototype,"fieldMap",void 0),E([k({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],h2.prototype,"scaleExpression",void 0),E([mr("scaleExpression")],h2.prototype,"writeData",null),E([k({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(t){return{enabled:!!t&&!!this.scaleExpression}}}}})],h2.prototype,"scaleExpressionTitle",void 0),E([k({type:String,json:{write:!0}})],h2.prototype,"url",void 0),E([mr("visualVariables")],h2.prototype,"writeVisualVariables",null),h2=hxe=E([ht("esri.renderers.DictionaryRenderer")],h2);const PVt=h2;var dxe;let gA=dxe=class extends Ni{constructor(t){super(t),this.color=null,this.field=null,this.label=null,this.valueExpression=null,this.valueExpressionTitle=null}castField(t){return t==null?t:typeof t=="function"?(Ei.getLogger(this.declaredClass).error(".field: field must be a string value"),null):MH(t)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){return new dxe({color:this.color&&this.color.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};E([k({type:$r,json:{type:[Number],write:!0}})],gA.prototype,"color",void 0),E([k({type:String,json:{write:!0}})],gA.prototype,"field",void 0),E([Zs("field")],gA.prototype,"castField",null),E([k({type:String,json:{write:!0}})],gA.prototype,"label",void 0),E([k({type:String,json:{write:!0}})],gA.prototype,"valueExpression",void 0),E([k({type:String,json:{write:!0}})],gA.prototype,"valueExpressionTitle",void 0),gA=dxe=E([ht("esri.renderers.support.AttributeColorInfo")],gA);const _ze=gA;var pxe;let Bse=pxe=class extends Ni{constructor(){super(...arguments),this.unit=null}clone(){return new pxe({unit:this.unit})}};E([k({type:String,json:{write:!0}})],Bse.prototype,"unit",void 0),Bse=pxe=E([ht("esri.renderers.support.DotDensityLegendOptions")],Bse);const OVt=Bse;var fxe;let Jv=fxe=class extends SR(HC){constructor(t){super(t),this.attributes=null,this.backgroundColor=new $r([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new Tm,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(t){if(this.referenceScale==null)return this.dotValue;const e=t/this.referenceScale*this.dotValue;return e<1?1:e}getSymbol(){return new iw({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){return this.attributes?.reduce((t,e)=>t+e.getAttributeHash(),"")??""}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new fxe({attributes:hi(this.attributes),backgroundColor:hi(this.backgroundColor),dotBlendingEnabled:hi(this.dotBlendingEnabled),dotShape:hi(this.dotShape),dotSize:hi(this.dotSize),dotValue:hi(this.dotValue),legendOptions:hi(this.legendOptions),outline:hi(this.outline),referenceScale:hi(this.referenceScale),visualVariables:hi(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(t,e){await this.collectVVRequiredFields(t,e);for(const i of this.attributes??[])i.valueExpression&&await K0(t,e,i.valueExpression),i.field&&t.add(i.field)}};E([k({type:[_ze],json:{write:!0}})],Jv.prototype,"attributes",void 0),E([k({type:$r,json:{write:!0}})],Jv.prototype,"backgroundColor",void 0),E([k({type:Boolean,json:{write:!0}})],Jv.prototype,"dotBlendingEnabled",void 0),E([k({type:String,json:{write:!1}})],Jv.prototype,"dotShape",void 0),E([k({type:Number,json:{write:!0}})],Jv.prototype,"dotSize",void 0),E([k({type:OVt,json:{write:!0}})],Jv.prototype,"legendOptions",void 0),E([k({type:Tm,json:{default:null,write:!0}})],Jv.prototype,"outline",void 0),E([k({type:Number,json:{write:!0}})],Jv.prototype,"dotValue",void 0),E([k({type:Number,json:{write:!0}})],Jv.prototype,"referenceScale",void 0),E([k({type:Number,json:{write:!0}})],Jv.prototype,"seed",void 0),E([Hr({dotDensity:"dot-density"})],Jv.prototype,"type",void 0),Jv=fxe=E([ht("esri.renderers.DotDensityRenderer")],Jv);const RVt=Jv;var mxe;let ZW=mxe=class extends Ni{constructor(t){super(t),this.color=null,this.ratio=null}clone(){return new mxe({color:this.color,ratio:this.ratio})}};E([k({type:$r,json:{type:[xs],default:null,write:!0}})],ZW.prototype,"color",void 0),E([k({type:Number,json:{write:!0}})],ZW.prototype,"ratio",void 0),ZW=mxe=E([ht("esri.renderers.support.HeatmapColorStop")],ZW);const QW=ZW;let I9=class extends ua(Ni){constructor(){super(...arguments),this.minLabel=null,this.maxLabel=null,this.title=null}};E([k({type:String,json:{write:!0}})],I9.prototype,"minLabel",void 0),E([k({type:String,json:{write:!0}})],I9.prototype,"maxLabel",void 0),E([k({type:String,json:{write:!0}})],I9.prototype,"title",void 0),I9=E([ht("esri.renderers.support.HeatmapLegendOptions")],I9);function yA(){return[0,0,0,0]}function MVt(t){return[t[0],t[1],t[2],t[3]]}function Z0(t,e,i,r){return[t,e,i,r]}function DVt(t){const e=yA(),i=Math.min(4,t.length);for(let r=0;ra>=0&&a<=1).sort((a,l)=>a.ratio-l.ratio).map(({color:a,ratio:l})=>({color:a,ratio:Math.max(l,.001)})),t.length<1)return i;let r=t[0],n=t[0],s=1;const o=yA();for(let a=0;a<512;a++){const l=(a+.5)/512;for(;l>n.ratio&&s=i+L||O.y<-L||O.y>r+L)continue;const N=+p(S),G=Math.max(0,Math.round(O.x)-a),V=Math.max(0,Math.round(O.y)-a),Y=Math.min(r,Math.round(O.y)+a),X=Math.min(i,Math.round(O.x)+a);for(let te=V;ted&&(d=c)}}}return{matrix:l.buffer,max:d}}function zVt(t,e,i,r,n,s){t.canvas.width=t.canvas.height=e,t.clearRect(0,0,e,e);const o=t.getImageData(0,0,e,e);i&&r&&o.data.set(new Uint8ClampedArray(HVt(e,i,r,n,s))),t.putImageData(o,0,0)}function HVt(t,e,i,r,n){const s=new Uint32Array(t*t),o="buffer"in e?e:new Float64Array(e),a="buffer"in i?new Uint32Array(i.buffer):new Uint32Array(new Uint8Array(i).buffer),l=a.length/(n-r);for(let c=0;c1?0:3/(Math.PI*i**2)*(1-r**2)**2}function WVt(t,e){return typeof t=="function"?t:t?typeof e=="string"?i=>-1*+i[t]:i=>+i[t]+e:()=>1}function qVt(t,e){return t!=null?typeof e=="string"?i=>-1*+i.readAttribute(t):i=>+i.readAttribute(t)+e:i=>1}var yxe;const Pze="esri.renderers.HeatmapRenderer",YVt=Ei.getLogger(Pze);function Oze(t){if(t!=null){const{maxDensity:e,minDensity:i,radius:r}=t;if(e!=null||i!=null||r!=null){const{blurRadius:n,maxPixelIntensity:s,minPixelIntensity:o,...a}=t;return a}}return t}let Em=yxe=class extends HC{constructor(t){super(t),this.authoringInfo=null,this.colorStops=[new QW({ratio:0,color:new $r("rgba(255, 140, 0, 0)")}),new QW({ratio:.75,color:new $r("rgba(255, 140, 0, 1)")}),new QW({ratio:.9,color:new $r("rgba(255, 0, 0, 1)")})],this.field=null,this.fieldOffset=0,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(t){return Oze(t)}get blurRadius(){return VVt(this.radius)}set blurRadius(t){const e=this.maxPixelIntensity,i=this.minPixelIntensity;this._set("radius",GVt(t)),this._warnAboutDeprecatedGaussianBlurProp("blurRadius","radius"),this._set("maxDensity",e*this._pixelIntensityToDensity),this._set("minDensity",i*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(t){this._set("maxDensity",t*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("maxPixelIntensity","maxDensity")}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(t){this._set("minDensity",t*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("minPixelIntensity","minDensity")}get _pixelIntensityToDensity(){return 24/(gxe**2*this.blurRadius**4)}_warnAboutDeprecatedGaussianBlurProp(t,e){this._warnedProps[t]||Tp(this).getDefaultOrigin()==="user"&&(this._warnedProps[t]=!0,G3(()=>{S_e(YVt,t,{replacement:`${String(e)} (suggested value: ${this._get(e)})`,version:"4.24"})}))}read(t,e){t=Oze(t),super.read(t,e)}getSymbol(){return new gd}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}async collectRequiredFields(t,e){const i=this.field,r=this.valueExpression;i&&typeof i=="string"&&await Yy(t,e,i),r&&typeof r=="string"&&await K0(t,e,r)}getAttributeHash(){return null}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new yxe({authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),colorStops:hi(this.colorStops),field:this.field,legendOptions:hi(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};E([k({type:HW,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],Em.prototype,"authoringInfo",void 0),E([k({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],Em.prototype,"blurRadius",null),E([k({type:[QW],json:{write:!0}})],Em.prototype,"colorStops",void 0),E([k({type:String,json:{write:!0}})],Em.prototype,"field",void 0),E([k({type:Number,json:{write:{overridePolicy:(t,e,i)=>({enabled:i==null})},origins:{"web-scene":{write:!1}}}})],Em.prototype,"fieldOffset",void 0),E([k({type:I9,json:{write:!0}})],Em.prototype,"legendOptions",void 0),E([k({type:Number,json:{write:!0}})],Em.prototype,"maxDensity",void 0),E([k({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],Em.prototype,"maxPixelIntensity",null),E([k({type:Number,json:{write:!0}})],Em.prototype,"minDensity",void 0),E([k({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],Em.prototype,"minPixelIntensity",null),E([k({type:Number,cast:Da,json:{write:!0}})],Em.prototype,"radius",void 0),E([k({type:Number,range:{min:0},json:{default:0,write:!0}})],Em.prototype,"referenceScale",void 0),E([Hr({heatmap:"heatmap"})],Em.prototype,"type",void 0),E([k({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],Em.prototype,"valueExpression",void 0),E([k({type:String})],Em.prototype,"valueExpressionTitle",void 0),E([k({readOnly:!0})],Em.prototype,"_pixelIntensityToDensity",null),Em=yxe=E([ht(Pze)],Em);const Rze=Em;let n5=class extends ua(Ni){constructor(){super(...arguments),this.color=new $r([0,0,0,0]),this.label=null,this.threshold=0}};E([k({type:$r,json:{write:!0}})],n5.prototype,"color",void 0),E([k({type:String,json:{write:!0}})],n5.prototype,"label",void 0),E([k({type:Number,range:{min:0,max:1},json:{write:!0}})],n5.prototype,"threshold",void 0),n5=E([ht("esri.renderers.support.OthersCategory")],n5);let Gse=class extends ua(Ni){constructor(){super(...arguments),this.title=null}};E([k({type:String,json:{write:!0}})],Gse.prototype,"title",void 0),Gse=E([ht("esri.renderers.support.PieChartLegendOptions")],Gse);let D1=class extends SR(ua(HC)){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new $r([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new n5,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart"}getSymbol(){return new gd({size:this.size?this.size/2+(this.outline?.width||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(ye)}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,i)=>e+i.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((e,i)=>e+JSON.stringify(i),"")}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i);for(const r of this.attributes)r.valueExpression&&await K0(e,i,r.valueExpression),r.field&&e.add(r.field)}};E([k({type:[_ze],json:{write:!0}})],D1.prototype,"attributes",void 0),E([k({type:iw,json:{default:null,write:!0}})],D1.prototype,"backgroundFillSymbol",void 0),E([k({type:$r,json:{write:!0}})],D1.prototype,"defaultColor",void 0),E([k({type:String,json:{write:!0}})],D1.prototype,"defaultLabel",void 0),E([k({type:Number,range:{min:0,max:1},json:{write:!0}})],D1.prototype,"holePercentage",void 0),E([k({type:n5,json:{write:!0}})],D1.prototype,"othersCategory",void 0),E([k({type:Gse,json:{write:!0}})],D1.prototype,"legendOptions",void 0),E([k({type:Tm,json:{default:null,write:!0}})],D1.prototype,"outline",void 0),E([k({type:Number,cast:Da,json:{write:!0}})],D1.prototype,"size",void 0),E([Hr({pieChart:"pie-chart"})],D1.prototype,"type",void 0),D1=E([ht("esri.renderers.PieChartRenderer")],D1);const XVt=D1;var vxe;let s5=vxe=class extends SR(HC){constructor(t){super(t),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(t,e){await Promise.all([this.collectSymbolFields(t,e),this.collectVVRequiredFields(t,e)])}async collectSymbolFields(t,e){await Promise.all(this.getSymbols().map(i=>i.collectRequiredFields(t,e)))}getSymbol(t,e){return this.symbol}async getSymbolAsync(t,e){return this.symbol}getSymbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((t,e)=>t+e.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((t,e)=>t+JSON.stringify(e),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new vxe({description:this.description,label:this.label,symbol:this.symbol&&this.symbol.clone(),visualVariables:hi(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}};E([k({type:String,json:{write:!0}})],s5.prototype,"description",void 0),E([k({type:String,json:{write:!0}})],s5.prototype,"label",void 0),E([k(C9)],s5.prototype,"symbol",void 0),E([Hr({simple:"simple"})],s5.prototype,"type",void 0),s5=vxe=E([ht("esri.renderers.SimpleRenderer")],s5);const Zv=s5;function Qi(t,e,i={}){return _xe(t,e,i,Mze)}function Hg(t,e,i={}){return _xe(t,e,i,Dze)}function _xe(t,e,i={},r){let n=null;const s=i.once?(o,a)=>{r(o)&&(Bc(n),e(o,a))}:(o,a)=>{r(o)&&e(o,a)};if(n=wNt(t,s,i.sync,i.equals),i.initial){const o=t();s(o,o)}return n}function ku(t,e,i,r={}){let n=null,s=null,o=null;function a(){n&&s&&(s.remove(),r.onListenerRemove?.(n),n=null,s=null)}function l(d){r.once&&r.once&&Bc(o),i(d)}const c=Qi(t,(d,p)=>{a(),Lre(d)&&(n=d,s=QI(d,e,l),r.onListenerAdd?.(d))},{sync:r.sync,initial:!0});return o=KI(()=>{c.remove(),a()}),o}function F1(t,e){return KVt(t,Dze,e)}function KVt(t,e,i){if(bm(i))return Promise.reject(vc());const r=t();if(e?.(r))return Promise.resolve(r);let n=null;function s(){n=Bc(n)}return new Promise((o,a)=>{n=D8([ep(i,()=>{s(),a(vc())}),_xe(t,l=>{s(),o(l)},{sync:!1,once:!0},e??Mze)])})}function Mze(t){return!0}function Dze(t){return!!t}const Nu={sync:!0},Fo={initial:!0},jh={sync:!0,initial:!0},JVt=["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"];function bxe(t){return t instanceof fn}function Fze(t){return t instanceof fr?Object.keys(t.items):bxe(t)?Tp(t).keys():t?Object.keys(t):[]}function Vse(t,e){return t instanceof fr?t.items[e]:t[e]}function ZVt(t,e){return!(!Array.isArray(t)||!Array.isArray(e))&&t.length!==e.length}function eq(t){return t?t.declaredClass:null}function Lze(t,e){const i=t.diff;if(i&&typeof i=="function")return i(t,e);const r=Fze(t),n=Fze(e);if(r.length===0&&n.length===0)return;if(!r.length||!n.length||ZVt(t,e))return{type:"complete",oldValue:t,newValue:e};const s=n.filter(p=>!r.includes(p)),o=r.filter(p=>!n.includes(p)),a=r.filter(p=>n.includes(p)&&Vse(t,p)!==Vse(e,p)).concat(s,o).sort(),l=eq(t);if(l&&JVt.includes(l)&&a.length)return{type:"complete",oldValue:t,newValue:e};let c;const d=bxe(t)&&bxe(e);for(const p of a){const y=Vse(t,p),v=Vse(e,p);let S;if((d||typeof y!="function"&&typeof v!="function")&&y!==v&&(y!=null||v!=null)){if(i&&i[p]&&typeof i[p]=="function")S=i[p](y,v);else if(y instanceof Date&&v instanceof Date){if(y.getTime()===v.getTime())continue;S={type:"complete",oldValue:y,newValue:v}}else S=typeof y=="object"&&typeof v=="object"&&eq(y)===eq(v)?Lze(y,v):{type:"complete",oldValue:y,newValue:v};ye(S)&&(ye(c)?c.diff[p]=S:c={type:"partial",diff:{[p]:S}})}}return c}function vA(t,e){if(lt(t))return!1;const i=e.split(".");let r=t;for(const n of i){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 QVt(t,e){for(const i of e)if(vA(t,i))return!0;return!1}function d2(t,e){if(!(typeof t=="function"||typeof e=="function"||lt(t)&<(e)))return lt(t)||lt(e)||typeof t=="object"&&typeof e=="object"&&eq(t)!==eq(e)?{type:"complete",oldValue:t,newValue:e}:Lze(t,e)}let A9=class extends ua(Ni){constructor(e){super(e),this.value=null,this.value2=null,this.value3=null}};E([k(Lse)],A9.prototype,"value",void 0),E([k(Lse)],A9.prototype,"value2",void 0),E([k(Lse)],A9.prototype,"value3",void 0),A9=E([ht("esri.renderers.support.UniqueValue")],A9);const P9=A9;let ER=class extends ua(Ni){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.values=null}castValues(e){if(e==null)return null;const i=typeof(e=Array.isArray(e)?e:[e])[0];return i==="string"||i==="number"?e.map(r=>new P9({value:r})):i==="object"?e[0]instanceof P9?e:e.map(r=>new P9(r)):null}};E([k({type:String,json:{write:!0}})],ER.prototype,"description",void 0),E([k({type:String,json:{write:!0}})],ER.prototype,"label",void 0),E([k(C9)],ER.prototype,"symbol",void 0),E([k({type:[P9],json:{type:[[String]],read:{reader:t=>t?t.map(e=>new P9({value:e[0],value2:e[1],value3:e[2]})):null},write:{writer:(t,e)=>{const i=[];for(const r of t){const n=[r.value,r.value2,r.value3].filter(ye).map(s=>s.toString());i.push(n)}e.values=i}}}})],ER.prototype,"values",void 0),E([Zs("values")],ER.prototype,"castValues",null),ER=E([ht("esri.renderers.support.UniqueValueClass")],ER);const kze=ER;let tq=class extends ua(Ni){constructor(e){super(e),this.heading=null,this.classes=null}};E([k({type:String,json:{write:!0}})],tq.prototype,"heading",void 0),E([k({type:[kze],json:{write:!0}})],tq.prototype,"classes",void 0),tq=E([ht("esri.renderers.support.UniqueValueGroup")],tq);const wxe=tq;var xxe;let o5=xxe=class extends Ni{constructor(t){super(t),this.description=null,this.label=null,this.symbol=null,this.value=null}clone(){return new xxe({value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const t=JSON.stringify(this.symbol&&this.symbol.toJSON());return`${this.value}.${t}`}};E([k({type:String,json:{write:!0}})],o5.prototype,"description",void 0),E([k({type:String,json:{write:!0}})],o5.prototype,"label",void 0),E([k(C9)],o5.prototype,"symbol",void 0),E([k(Lse)],o5.prototype,"value",void 0),o5=xxe=E([ht("esri.renderers.support.UniqueValueInfo")],o5);const a5=o5,eUt=()=>!!Gi("enable-feature:force-wosr"),tUt=()=>!!Gi("enable-feature:SceneLayer-editing");let Sxe={};async function iUt(t,e){try{return{data:(await iq(t,e)).data,baseUrl:VH(t),styleUrl:t}}catch(i){return Ga(i),null}}function rUt(t,e,i){const r=ye(e.portal)?e.portal:_c.getDefault();let n;const s=`${r.url} - ${r.user&&r.user.username} - ${t}`;return Sxe[s]||(Sxe[s]=nUt(t,r,i).then(o=>(n=o,o.fetchData())).then(o=>({data:o,baseUrl:n.itemUrl??"",styleName:t}))),Sxe[s]}function nUt(t,e,i){return e.load(i).then(()=>{const r=new nA({disableExtraQuery:!0,query:`owner:${$ze} AND type:${Bze} AND typekeywords:"${t}"`});return e.queryItems(r,i)}).then(({results:r})=>{let n=null;const s=t.toLowerCase();if(r&&Array.isArray(r)){for(const o of r)if(o.typeKeywords?.some(l=>l.toLowerCase()===s)&&o.type===Bze&&o.owner===$ze){n=o;break}}if(!n)throw new st("symbolstyleutils:style-not-found",`The style '${t}' could not be found`,{styleName:t});return n.load(i)})}function Cxe(t,e,i){return t&&ye(t.styleUrl)?iUt(t.styleUrl,i):t&&ye(t.styleName)?rUt(t.styleName,e,i):Promise.reject(new st("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function Use(t){return t===null||t.type==="CIMSymbolReference"?t:{type:"CIMSymbolReference",symbol:t}}function Nze(t,e){if(e==="cimRef")return t.cimRef;if(t.formatInfos&&!eUt()){for(const i of t.formatInfos)if(i.type==="gltf")return i.href}return t.webRef}function iq(t,e){const i={responseType:"json",query:{f:"json"},...e};return ir(Uy(t),i)}const $ze="esri_en",Bze="Style",Gze="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json";var rq;const Vze="esri.renderers.UniqueValueRenderer",IR=Ei.getLogger(Vze),Uze="uvInfos-watcher",jze="uvGroups-watcher",sUt=",",oUt=ud(a5);function aUt(t){const{field1:e,field2:i,field3:r,fieldDelimiter:n,uniqueValueInfos:s,valueExpression:o}=t,a=!(!e||!i);return[{classes:(s??[]).map(l=>{const{symbol:c,label:d,value:p,description:y}=l,[v,S,I]=a?p?.toString()?.split(n||"")||[]:[p],O=[];return(e||o)&&O.push(v),i&&O.push(S),r&&O.push(I),{symbol:c,label:d,values:[O],description:y}})}]}let vd=rq=class extends SR(HC){constructor(t){super(t),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,i){if(!e&&!i)return;if(!e||!i)return{type:"complete",oldValue:e,newValue:i};let r=!1;const n={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let s=0;sa.value===i[s].value);o?d2(o,i[s])?(n.changed.push({type:"complete",oldValue:o,newValue:i[s]}),r=!0):n.unchanged.push({oldValue:o,newValue:i[s]}):(n.added.push(i[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(t){this._set("field",t),this._updateFieldDelimiter(),this._updateUniqueValues()}castField(t){return t==null||typeof t=="function"?t:MH(t)}writeField(t,e,i,r){typeof t=="string"?e[i]=t:r&&r.messages?r.messages.push(new st("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):IR.error(".field: cannot write field to JSON since it's not a string value")}set field2(t){this._set("field2",t),this._updateFieldDelimiter(),this._updateUniqueValues()}set field3(t){this._set("field3",t),this._updateUniqueValues()}set valueExpression(t){this._set("valueExpression",t),this._updateUniqueValues()}set defaultSymbol(t){this._isDefaultSymbolDerived=!1,this._set("defaultSymbol",t)}set fieldDelimiter(t){this._set("fieldDelimiter",t),this._updateUniqueValues()}readPortal(t,e,i){return i.portal||_c.getDefault()}readStyleOrigin(t,e,i){if(e.styleName)return Object.freeze({styleName:e.styleName});if(e.styleUrl){const r=ew(e.styleUrl,i);return Object.freeze({styleUrl:r})}}writeStyleOrigin(t,e,i,r){t.styleName?e.styleName=t.styleName:t.styleUrl&&(e.styleUrl=a2(t.styleUrl,r))}set uniqueValueGroups(t){this.styleOrigin?IR.error("#uniqueValueGroups=","Cannot modify unique value groups of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueGroups",t),this._updateInfosFromGroups(),this._isInfosSource=!1,this._watchUniqueValueGroups())}set uniqueValueInfos(t){this.styleOrigin?IR.error("#uniqueValueInfos=","Cannot modify unique value infos of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueInfos",t),this._updateValueInfoMap(),this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos())}addUniqueValueInfo(t,e){if(this.styleOrigin)return void IR.error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let i;i=typeof t=="object"?oUt(t):new a5({value:t,symbol:H7e(e)}),this.uniqueValueInfos?.push(i),this._valueInfoMap[i.value]=i,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(t){if(this.styleOrigin)return void IR.error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const e=this.uniqueValueInfos;if(e){for(let i=0;it+e.getAttributeHash(),"")}getMeshHash(){const t=JSON.stringify(this.backgroundFillSymbol),e=JSON.stringify(this.defaultSymbol),i=this.uniqueValueInfos?.reduce((r,n)=>r+n.getMeshHash(),"");return`${t}.${e}.${i}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const t=new rq({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:hi(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:hi(this.visualVariables),legendOptions:hi(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),backgroundFillSymbol:hi(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(t._isDefaultSymbolDerived=!0),t._set("portal",this.portal);const e=hi(this.uniqueValueInfos),i=hi(this.uniqueValueGroups);return this.styleOrigin&&(t._set("styleOrigin",Object.freeze(hi(this.styleOrigin))),Object.freeze(e),Object.freeze(i)),t._set("uniqueValueInfos",e),t._updateValueInfoMap(),t._set("uniqueValueGroups",i),t._isInfosSource=this._isInfosSource,t._watchUniqueValueInfosAndGroups(),t}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}async collectRequiredFields(t,e){const i=[this.collectVVRequiredFields(t,e),this.collectSymbolFields(t,e)];await Promise.all(i)}async collectSymbolFields(t,e){const i=[...this.getSymbols().map(r=>r.collectRequiredFields(t,e)),K0(t,e,this.valueExpression)];Yy(t,e,this.field),Yy(t,e,this.field2),Yy(t,e,this.field3),await Promise.all(i)}populateFromStyle(){return Cxe(this.styleOrigin,{portal:this.portal}).then(t=>{const e=[];return this._valueInfoMap={},t&&t.data&&Array.isArray(t.data.items)&&t.data.items.forEach(i=>{const r=new KL({styleUrl:t.styleUrl,styleName:t.styleName,portal:this.portal,name:i.name});this.defaultSymbol||i.name!==t.data.defaultItem||(this.defaultSymbol=r,this._isDefaultSymbolDerived=!0);const n=new a5({value:i.name,symbol:r});e.push(n),this._valueInfoMap[i.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",sUt)}_updateUniqueValues(){this._isInfosSource!=null&&(this._isInfosSource?this._updateGroupsFromInfos():this._updateInfosFromGroups())}_updateValueInfoMap(){this._valueInfoMap={};const{uniqueValueInfos:t}=this;if(t)for(const e of t)this._valueInfoMap[e.value+""]=e}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(Uze);const{uniqueValueInfos:t}=this;if(t){const e=[];for(const i of t)e.push(Qi(()=>({symbol:i.symbol,value:i.value,label:i.label,description:i.description}),(r,n)=>{r!==n&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(e,Uze)}}_watchUniqueValueGroups(){this.removeHandles(jze);const{uniqueValueGroups:t}=this;if(t){const e=[];for(const i of t){e.push(Qi(()=>({classes:i.classes}),(r,n)=>{r!==n&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const r of i.classes??[])e.push(Qi(()=>({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,jze)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const t=[],{field:e,field2:i,field3:r,fieldDelimiter:n,uniqueValueGroups:s,valueExpression:o}=this;if(!e&&!o)return this._set("uniqueValueInfos",t),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const a=!(!e||!i);for(const l of s)for(const c of l.classes??[]){const{symbol:d,label:p,values:y,description:v}=c;for(const S of y??[]){const{value:I,value2:O,value3:L}=S,N=[I];i&&N.push(O),r&&N.push(L);const G=a?N.join(n||""):N[0];t.push(new a5({symbol:d,label:p,value:G,description:v}))}}this._set("uniqueValueInfos",t),this._updateValueInfoMap(),this._watchUniqueValueInfos()}_updateGroupsFromInfos(t=!1){if(!this.uniqueValueInfos)return this._set("uniqueValueGroups",null),void this._watchUniqueValueGroups();const{field:e,field2:i,valueExpression:r,fieldDelimiter:n,uniqueValueInfos:s}=this;if(!e&&!r||!s.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const o=!(!e||!i),a=s.map(c=>{const{symbol:d,label:p,value:y,description:v}=c,[S,I,O]=o?y?.toString()?.split(n||"")||[]:[y];return new kze({symbol:d,label:p,description:v,values:[new P9({value:S,value2:I,value3:O})]})}),l=[new wxe({classes:a})];t&&Object.freeze(l),this._set("uniqueValueGroups",l),this._watchUniqueValueGroups()}_getUniqueValueInfo(t,e){return this.valueExpression?this._getUnqiueValueInfoForExpression(t,e):this._getUnqiueValueInfoForFields(t)}_getUnqiueValueInfoForExpression(t,e){const{viewingMode:i,scale:r,spatialReference:n,arcade:s}=Fu(e,{});let o=this._cache.compiledFunc;const a=s.arcadeUtils;if(!o){const c=a.createSyntaxTree(this.valueExpression);o=a.createFunction(c),this._cache.compiledFunc=o}const l=a.executeFunction(o,a.createExecContext(t,a.getViewInfo({viewingMode:i,scale:r,spatialReference:n})));return this._valueInfoMap[l+""]}_getUnqiueValueInfoForFields(t){const e=this.field,i=t.attributes;let r;if(typeof e!="function"&&this.field2){const n=this.field2,s=this.field3,o=[];e&&o.push(i[e]),n&&o.push(i[n]),s&&o.push(i[s]),r=o.join(this.fieldDelimiter||"")}else typeof e=="function"?r=e(t):e&&(r=i[e]);return this._valueInfoMap[r+""]}static fromPortalStyle(t,e){const i=new rq(e&&e.properties);i._set("styleOrigin",Object.freeze({styleName:t})),i._set("portal",e&&e.portal||_c.getDefault());const r=i.populateFromStyle();return r.catch(n=>{IR.error(`#fromPortalStyle('${t}'[, ...])`,"Failed to create unique value renderer from style name",n)}),r}static fromStyleUrl(t,e){const i=new rq(e&&e.properties);i._set("styleOrigin",Object.freeze({styleUrl:t}));const r=i.populateFromStyle();return r.catch(n=>{IR.error(`#fromStyleUrl('${t}'[, ...])`,"Failed to create unique value renderer from style URL",n)}),r}};E([k({readOnly:!0})],vd.prototype,"_cache",null),E([Hr({uniqueValue:"unique-value"})],vd.prototype,"type",void 0),E([k(mze)],vd.prototype,"backgroundFillSymbol",void 0),E([k({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],vd.prototype,"field",null),E([Zs("field")],vd.prototype,"castField",null),E([mr("field")],vd.prototype,"writeField",null),E([k({type:String,value:null,json:{write:!0}})],vd.prototype,"field2",null),E([k({type:String,value:null,json:{write:!0}})],vd.prototype,"field3",null),E([k({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],vd.prototype,"orderByClassesEnabled",void 0),E([k({type:String,value:null,json:{write:!0}})],vd.prototype,"valueExpression",null),E([k({type:String,json:{write:!0}})],vd.prototype,"valueExpressionTitle",void 0),E([k({type:WC,json:{write:!0}})],vd.prototype,"legendOptions",void 0),E([k({type:String,json:{write:!0}})],vd.prototype,"defaultLabel",void 0),E([k(_Ge({...C9},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],vd.prototype,"defaultSymbol",null),E([k({type:String,value:null,json:{write:!0}})],vd.prototype,"fieldDelimiter",null),E([k({type:_c,readOnly:!0})],vd.prototype,"portal",void 0),E([Li("portal",["styleName"])],vd.prototype,"readPortal",null),E([k({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],vd.prototype,"styleOrigin",void 0),E([Li("styleOrigin",["styleName","styleUrl"])],vd.prototype,"readStyleOrigin",null),E([mr("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],vd.prototype,"writeStyleOrigin",null),E([k({type:[wxe],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(t,e,i)=>(e.uniqueValueGroups||aUt(e)).map(r=>wxe.fromJSON(r,i))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],vd.prototype,"uniqueValueGroups",null),E([k({type:[a5],json:{read:!1,write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],vd.prototype,"uniqueValueInfos",null),vd=rq=E([ht(Vze)],vd);const YC=vd,_A={key:"type",base:HC,typeMap:{heatmap:Rze,simple:Zv,"unique-value":YC,"class-breaks":r5,"dot-density":RVt,dictionary:PVt,"pie-chart":XVt},errorContext:"renderer"},AR={key:"type",base:HC,typeMap:{simple:Zv,"unique-value":YC,"class-breaks":r5,heatmap:Rze},errorContext:"renderer"};function PR(t,e){return l5(t,null,e)}const lUt=CC({types:_A});function l5(t,e,i){return t?t&&(t.styleName||t.styleUrl)&&t.type!=="uniqueValue"?(i&&i.messages&&i.messages.push(new wm("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+t.type+"'",{definition:t,context:i})),null):lUt(t,e,i):null}let uUt=class yLt{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(__e),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const i=new yLt,r=this._originStores[Fn.DEFAULTS];r&&r.forEach((n,s)=>{i.set(s,hi(n),Fn.DEFAULTS)});for(let n=Fn.SERVICE;n<__e;n++){const s=this._originStores[n];s&&s.forEach((o,a)=>{e&&e.has(a)||i.set(a,hi(o),n)})}return i}get(e,i){const r=i===void 0?this._values:this._originStores[i];return r?r.get(e):void 0}keys(e){const i=e==null?this._values:this._originStores[e];return i?[...i.keys()]:[]}set(e,i,r=Fn.USER){let n=this._originStores[r];if(n||(n=new Map,this._originStores[r]=n),n.set(e,i),!this._values.has(e)||this._propertyOriginMap.get(e)<=r){const s=this._values.get(e);return this._values.set(e,i),this._propertyOriginMap.set(e,r),s!==i}return!1}delete(e,i=Fn.USER){const r=this._originStores[i];if(!r)return;const n=r.get(e);if(r.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===i){this._values.delete(e);for(let s=i-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,i){const r=i===void 0?this._values:this._originStores[i];return!!r&&r.has(e)}revert(e,i){for(;i>0&&!this.has(e,i);)--i;const r=this._originStores[i],n=r&&r.get(e),s=this._values.get(e);return this._values.set(e,n),this._propertyOriginMap.set(e,i),s!==n}originOf(e){return this._propertyOriginMap.get(e)||Fn.DEFAULTS}forEach(e){this._values.forEach(e)}};const zze=t=>{let e=class extends t{constructor(...i){super(...i);const r=Tp(this),n=r.store,s=new uUt;r.store=s,bVe(r,n,s)}read(i,r){xVe(this,i,r)}getAtOrigin(i,r){const n=Txe(this),s=Gg(r);if(typeof i=="string")return n.get(i,s);const o={};return i.forEach(a=>{o[a]=n.get(a,s)}),o}originOf(i){return SH(this.originIdOf(i))}originIdOf(i){return Txe(this).originOf(i)}revert(i,r){const n=Txe(this),s=Gg(r),o=Tp(this);let a;a=typeof i=="string"?i==="*"?n.keys(s):[i]:i,a.forEach(l=>{o.invalidate(l),n.revert(l,s),o.commit(l)})}};return e=E([ht("esri.core.ReadOnlyMultiOriginJSONSupport")],e),e};function Txe(t){return Tp(t).store}let Hze=class extends zze(fn){};Hze=E([ht("esri.core.ReadOnlyMultiOriginJSONSupport")],Hze);const cUt=t=>{let e=class extends t{constructor(...i){super(...i)}clear(i,r="user"){return Exe(this).delete(i,Gg(r))}write(i={},r){return TVe(this,i=i||{},r),i}setAtOrigin(i,r,n){Tp(this).setAtOrigin(i,r,Gg(n))}removeOrigin(i){const r=Exe(this),n=Gg(i),s=r.keys(n);for(const o of s)r.originOf(o)===n&&r.set(o,r.get(o,n),Fn.USER)}updateOrigin(i,r){const n=Exe(this),s=Gg(r),o=this.get(i);for(let a=s+1;a<__e;++a)n.delete(i,a);n.set(i,o,s)}toJSON(i){return this.write({},i)}};return e=E([ht("esri.core.WriteableMultiOriginJSONSupport")],e),e.prototype.toJSON.isDefaultToJSON=!0,e};function Exe(t){return Tp(t).store}const $u=t=>{let e=class extends cUt(zze(t)){constructor(...i){super(...i)}};return e=E([ht("esri.core.MultiOriginJSONSupport")],e),e};let jse=class extends $u(fn){};jse=E([ht("esri.core.MultiOriginJSONSupport")],jse);async function hUt(t,e){const{WhereClause:i}=await Promise.resolve().then(()=>gde);return i.create(t,e)}function OR(t,e){return ye(t)?ye(e)?`(${t}) AND (${e})`:t:e}var Ixe;let u5=Ixe=class extends Ni{constructor(t){super(t),this.expression=null,this.name=null,this.returnType="boolean",this.title=null}clone(){return new Ixe({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};E([k({type:String,json:{write:!0}})],u5.prototype,"expression",void 0),E([k({type:String,json:{write:!0}})],u5.prototype,"name",void 0),E([k({type:["boolean","date","number","string"],json:{write:!0}})],u5.prototype,"returnType",void 0),E([k({type:String,json:{write:!0}})],u5.prototype,"title",void 0),u5=Ixe=E([ht("esri.form.ExpressionInfo")],u5);const dUt=u5;let c5=class extends Ni{constructor(e){super(e),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};E([k({type:String,json:{write:!0}})],c5.prototype,"description",void 0),E([k({type:String,json:{write:!0}})],c5.prototype,"label",void 0),E([k()],c5.prototype,"type",void 0),E([k({type:String,json:{write:!0}})],c5.prototype,"visibilityExpression",void 0),c5=E([ht("esri.form.elements.Element")],c5);const O9=c5;var Axe;let zse=Axe=class extends Ni{constructor(t){super(t),this.type=null}clone(){return new Axe({type:this.type})}};E([k({type:["attachment","audio","document","image","signature","video"],json:{write:!0}})],zse.prototype,"type",void 0),zse=Axe=E([ht("esri.form.elements.inputs.AttachmentInput")],zse);const pUt=zse;var Pxe;let h5=Pxe=class extends O9{constructor(t){super(t),this.attachmentKeyword=null,this.editable=!0,this.input=null,this.type="attachment"}clone(){return new Pxe({attachmentKeyword:this.attachmentKeyword,description:this.description,editable:this.editable,input:this.input,label:this.label,visibilityExpression:this.visibilityExpression})}};E([k({type:String,json:{write:!0}})],h5.prototype,"attachmentKeyword",void 0),E([k({type:Boolean,json:{write:!0}})],h5.prototype,"editable",void 0),E([k({type:pUt,json:{read:{source:"inputType"},write:{target:"inputType"}}})],h5.prototype,"input",void 0),E([k({type:["attachment"],json:{read:!1,write:!0}})],h5.prototype,"type",void 0),h5=Pxe=E([ht("esri.form.elements.AttachmentElement")],h5);const Wze=h5;let Hse=class extends Ni{constructor(e){super(e),this.type=null}};E([k()],Hse.prototype,"type",void 0),Hse=E([ht("esri.form.elements.inputs.Input")],Hse);const R9=Hse;let nq=class extends R9{constructor(e){super(e),this.maxLength=null,this.minLength=0}};E([k({type:Number,json:{write:!0}})],nq.prototype,"maxLength",void 0),E([k({type:Number,json:{write:!0}})],nq.prototype,"minLength",void 0),nq=E([ht("esri.form.elements.inputs.TextInput")],nq);const Oxe=nq;var Rxe;let Wse=Rxe=class extends Oxe{constructor(t){super(t),this.type="barcode-scanner"}clone(){return new Rxe({maxLength:this.maxLength,minLength:this.minLength})}};E([k({type:["barcode-scanner"],json:{read:!1,write:!0}})],Wse.prototype,"type",void 0),Wse=Rxe=E([ht("esri.form.elements.inputs.BarcodeScannerInput")],Wse);const fUt=Wse;var Mxe;let M9=Mxe=class extends R9{constructor(t){super(t),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="combo-box"}clone(){return new Mxe({showNoValueOption:this.showNoValueOption,noValueOptionLabel:this.noValueOptionLabel})}};E([k({type:String,json:{write:!0}})],M9.prototype,"noValueOptionLabel",void 0),E([k({type:Boolean,json:{write:!0}})],M9.prototype,"showNoValueOption",void 0),E([k({type:["combo-box"],json:{read:!1,write:!0}})],M9.prototype,"type",void 0),M9=Mxe=E([ht("esri.form.elements.inputs.ComboBoxInput")],M9);const mUt=M9;var Dxe;function qze(t){return t!=null?new Date(t):null}function Yze(t){return t?t.getTime():null}let p2=Dxe=class extends R9{constructor(t){super(t),this.includeTime=!1,this.max=null,this.min=null,this.type="datetime-picker"}readMax(t,e){return qze(e.max)}writeMax(t,e){e.max=Yze(t)}readMin(t,e){return qze(e.min)}writeMin(t,e){e.min=Yze(t)}clone(){return new Dxe({includeTime:this.includeTime,max:this.max,min:this.min})}};E([k({type:Boolean,json:{write:!0}})],p2.prototype,"includeTime",void 0),E([k({type:Date,json:{type:Number,write:!0}})],p2.prototype,"max",void 0),E([Li("max")],p2.prototype,"readMax",null),E([mr("max")],p2.prototype,"writeMax",null),E([k({type:Date,json:{type:Number,write:!0}})],p2.prototype,"min",void 0),E([Li("min")],p2.prototype,"readMin",null),E([mr("min")],p2.prototype,"writeMin",null),E([k({type:["datetime-picker"],json:{read:!1,write:!0}})],p2.prototype,"type",void 0),p2=Dxe=E([ht("esri.form.elements.inputs.DateTimePickerInput")],p2);const gUt=p2;var Fxe;let D9=Fxe=class extends R9{constructor(t){super(t),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="radio-buttons"}clone(){return new Fxe({noValueOptionLabel:this.noValueOptionLabel,showNoValueOption:this.showNoValueOption})}};E([k({type:String,json:{write:!0}})],D9.prototype,"noValueOptionLabel",void 0),E([k({type:Boolean,json:{write:!0}})],D9.prototype,"showNoValueOption",void 0),E([k({type:["radio-buttons"],json:{read:!1,write:!0}})],D9.prototype,"type",void 0),D9=Fxe=E([ht("esri.form.elements.inputs.RadioButtonsInput")],D9);const yUt=D9;var Lxe;let F9=Lxe=class extends R9{constructor(t){super(t),this.offValue=null,this.onValue=null,this.type="switch"}clone(){return new Lxe({offValue:this.offValue,onValue:this.onValue})}};E([k({type:[String,Number],json:{write:!0}})],F9.prototype,"offValue",void 0),E([k({type:[String,Number],json:{write:!0}})],F9.prototype,"onValue",void 0),E([k({type:["switch"],json:{read:!1,write:!0}})],F9.prototype,"type",void 0),F9=Lxe=E([ht("esri.form.elements.inputs.SwitchInput")],F9);const vUt=F9;var kxe;let qse=kxe=class extends Oxe{constructor(t){super(t),this.type="text-area"}clone(){return new kxe({maxLength:this.maxLength,minLength:this.minLength})}};E([k({type:["text-area"],json:{read:!1,write:!0}})],qse.prototype,"type",void 0),qse=kxe=E([ht("esri.form.elements.inputs.TextAreaInput")],qse);const _Ut=qse;var Nxe;let Yse=Nxe=class extends Oxe{constructor(t){super(t),this.type="text-box"}clone(){return new Nxe({maxLength:this.maxLength,minLength:this.minLength})}};E([k({type:["text-box"],json:{read:!1,write:!0}})],Yse.prototype,"type",void 0),Yse=Nxe=E([ht("esri.form.elements.inputs.TextBoxInput")],Yse);const bUt={base:R9,key:"type",typeMap:{"barcode-scanner":fUt,"combo-box":mUt,"datetime-picker":gUt,"radio-buttons":yUt,switch:vUt,"text-area":_Ut,"text-box":Yse}};var $xe;let sq=$xe=class extends Ni{constructor(t){super(t),this.name=null,this.code=null}clone(){return new $xe({name:this.name,code:this.code})}};E([k({type:String,json:{write:!0}})],sq.prototype,"name",void 0),E([k({type:[String,Number],json:{write:!0}})],sq.prototype,"code",void 0),sq=$xe=E([ht("esri.layers.support.CodedValue")],sq);const wUt=new Bs({inherited:"inherited",codedValue:"coded-value",range:"range"});let oq=class extends Ni{constructor(e){super(e),this.name=null,this.type=null}};E([k({type:String,json:{write:!0}})],oq.prototype,"name",void 0),E([Hr(wUt)],oq.prototype,"type",void 0),oq=E([ht("esri.layers.support.Domain")],oq);const Xse=oq;var Bxe;let aq=Bxe=class extends Xse{constructor(t){super(t),this.codedValues=null,this.type="coded-value"}getName(t){let e=null;if(this.codedValues){const i=String(t);this.codedValues.some(r=>(String(r.code)===i&&(e=r.name),!!e))}return e}clone(){return new Bxe({codedValues:hi(this.codedValues),name:this.name})}};E([k({type:[sq],json:{write:!0}})],aq.prototype,"codedValues",void 0),E([Hr({codedValue:"coded-value"})],aq.prototype,"type",void 0),aq=Bxe=E([ht("esri.layers.support.CodedValueDomain")],aq);const Xze=aq;var Gxe;let Kse=Gxe=class extends Xse{constructor(t){super(t),this.type="inherited"}clone(){return new Gxe}};E([Hr({inherited:"inherited"})],Kse.prototype,"type",void 0),Kse=Gxe=E([ht("esri.layers.support.InheritedDomain")],Kse);const Kze=Kse;var Vxe;let L9=Vxe=class extends Xse{constructor(t){super(t),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new Vxe({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};E([k({type:Number,json:{type:[Number],read:{source:"range",reader:(t,e)=>e.range&&e.range[1]},write:{enabled:!1,overridePolicy(){return{enabled:this.maxValue!=null&&this.minValue==null}},target:"range",writer(t,e,i){e[i]=[this.minValue||0,t]}}}})],L9.prototype,"maxValue",void 0),E([k({type:Number,json:{type:[Number],read:{source:"range",reader:(t,e)=>e.range&&e.range[0]},write:{target:"range",writer(t,e,i){e[i]=[t,this.maxValue||0]}}}})],L9.prototype,"minValue",void 0),E([Hr({range:"range"})],L9.prototype,"type",void 0),L9=Vxe=E([ht("esri.layers.support.RangeDomain")],L9);const Jze=L9,Zze={key:"type",base:Xse,typeMap:{range:Jze,"coded-value":Xze,inherited:Kze}};function Jse(t){if(!t||!t.type)return null;switch(t.type){case"range":return Jze.fromJSON(t);case"codedValue":return Xze.fromJSON(t);case"inherited":return Kze.fromJSON(t)}return null}var Uxe;const Qze="esri.form.elements.FieldElement",eHe=Ei.getLogger(Qze);let rw=Uxe=class extends O9{constructor(t){super(t),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 S_e(eHe,"editable",{replacement:"editableExpression",version:"4.26",warnOnce:!0}),this._get("editable")??!0}set editable(t){S_e(eHe,"editable",{replacement:"editableExpression",version:"4.26",warnOnce:!0}),this._set("editable",t)}clone(){return new Uxe({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})}};E([k({types:Zze,json:{read:{reader:Jse},write:!0}})],rw.prototype,"domain",void 0),E([k({type:Boolean,json:{write:!0}})],rw.prototype,"editable",null),E([k({type:String,json:{write:!0}})],rw.prototype,"editableExpression",void 0),E([k({type:String,json:{write:!0}})],rw.prototype,"fieldName",void 0),E([k({type:String,json:{write:!0}})],rw.prototype,"hint",void 0),E([k({types:bUt,json:{read:{source:"inputType"},write:{target:"inputType"}}})],rw.prototype,"input",void 0),E([k({type:String,json:{write:!0}})],rw.prototype,"requiredExpression",void 0),E([k({type:String,json:{read:!1,write:!0}})],rw.prototype,"type",void 0),E([k({type:String,json:{write:!0}})],rw.prototype,"valueExpression",void 0),rw=Uxe=E([ht(Qze)],rw);const tHe=rw;var jxe;let bA=jxe=class extends O9{constructor(t){super(t),this.displayCount=null,this.displayType="list",this.editable=!0,this.orderByFields=null,this.relationshipId=null,this.type="relationship"}clone(){return new jxe({description:this.description,displayCount:this.displayCount,displayType:this.displayType,editable:this.editable,label:this.label,orderByFields:hi(this.orderByFields),relationshipId:this.relationshipId,visibilityExpression:this.visibilityExpression})}};E([k({type:Number,json:{write:!0}})],bA.prototype,"displayCount",void 0),E([k({type:["list"],json:{write:!0}})],bA.prototype,"displayType",void 0),E([k({type:Boolean,json:{write:!0}})],bA.prototype,"editable",void 0),E([k({type:[Rbe],json:{write:!0}})],bA.prototype,"orderByFields",void 0),E([k({type:Number,json:{write:!0}})],bA.prototype,"relationshipId",void 0),E([k({type:["relationship"],json:{read:!1,write:!0}})],bA.prototype,"type",void 0),bA=jxe=E([ht("esri.form.elements.RelationshipElement")],bA);const iHe=bA;function rHe(t){return{typesWithGroup:{base:O9,key:"type",typeMap:{attachment:Wze,field:tHe,group:t,relationship:iHe}},typesWithoutGroup:{base:O9,key:"type",typeMap:{attachment:Wze,field:tHe,relationship:iHe}}}}function nHe(t,e,i=!0){if(!t)return null;const r=i?e.typesWithGroup.typeMap:e.typesWithoutGroup.typeMap;return t.filter(n=>r[n.type]).map(n=>r[n.type].fromJSON(n))}function sHe(t,e,i=!0){if(!t)return null;const r=i?e.typesWithGroup.typeMap:e.typesWithoutGroup.typeMap;return t.filter(n=>r[n.type]).map(n=>n.toJSON())}function oHe(t,e,i=!0){return t?t.map(r=>SC(i?e.typesWithGroup:e.typesWithoutGroup,r)):null}var zxe;let XC=zxe=class extends O9{constructor(t){super(t),this.elements=null,this.initialState="expanded",this.type="group"}castElements(t){return oHe(t,Hxe,!1)}readElements(t,e){return nHe(e.formElements,Hxe,!1)}writeElements(t,e){e.formElements=sHe(t,Hxe,!1)}clone(){return new zxe({description:this.description,elements:hi(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};E([k({json:{write:!0}})],XC.prototype,"elements",void 0),E([Zs("elements")],XC.prototype,"castElements",null),E([Li("elements",["formElements"])],XC.prototype,"readElements",null),E([mr("elements")],XC.prototype,"writeElements",null),E([k({type:["collapsed","expanded"],json:{write:!0}})],XC.prototype,"initialState",void 0),E([k({type:String,json:{read:!1,write:!0}})],XC.prototype,"type",void 0),XC=zxe=E([ht("esri.form.elements.GroupElement")],XC);const Hxe=rHe(XC),xUt=XC;var Wxe;const qxe=rHe(xUt);let f2=Wxe=class extends Ni{constructor(t){super(t),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(t){return oHe(t,qxe)}readElements(t,e){return nHe(e.formElements,qxe)}writeElements(t,e){e.formElements=sHe(t,qxe)}clone(){return new Wxe({description:this.description,expressionInfos:hi(this.expressionInfos),elements:hi(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}};E([k({type:String,json:{write:!0}})],f2.prototype,"description",void 0),E([k({json:{write:!0}})],f2.prototype,"elements",void 0),E([Zs("elements")],f2.prototype,"castElements",null),E([Li("elements",["formElements"])],f2.prototype,"readElements",null),E([mr("elements")],f2.prototype,"writeElements",null),E([k({type:[dUt],json:{write:!0}})],f2.prototype,"expressionInfos",void 0),E([k({type:Boolean,json:{default:!1,write:!0}})],f2.prototype,"preserveFieldValuesWhenHidden",void 0),E([k({type:String,json:{write:!0}})],f2.prototype,"title",void 0),f2=Wxe=E([ht("esri.form.FormTemplate")],f2);const aHe=f2;async function SUt(t){const e="portalItem"in t?t:{portalItem:t},i=await Promise.resolve().then(()=>EIi);try{return await i.fromItem(e)}catch(r){const n=e&&e.portalItem,s=n&&n.id||"unset",o=n&&n.portal&&n.portal.url||na.portalUrl;throw Ei.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+o+"', id: '"+s+"')",r),r}}let CUt=0,Im=class extends cd.EventedMixin(R1(hd)){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new vr(-180,-90,180,90,rr.WGS84),this.id=Date.now().toString(16)+"-layer-"+CUt++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=rr.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const i=typeof e=="string"?{url:e}:e;return(await Promise.resolve().then(()=>C3i)).fromUrl(i)}static fromPortalItem(e){return SUt(e)}initialize(){this.when().catch(e=>{ss(e)||Ei.getLogger(this.declaredClass).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){if(this.parent){const e=this,i=this.parent;"layers"in i&&i.layers.includes(e)?i.layers.remove(e):"tables"in i&&i.tables.includes(e)?i.tables.remove(e):"baseLayers"in i&&i.baseLayers.includes(e)?i.baseLayers.remove(e):"baseLayers"in i&&i.referenceLayers.includes(e)&&i.referenceLayers.remove(e)}}get hasAttributionData(){return this.attributionDataUrl!=null}get parsedUrl(){return sa(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await ir(e,{query:{f:"json"},responseType:"json"})).data;throw new st("layer:no-attribution-data","Layer does not have attribution data")}};E([k({type:String})],Im.prototype,"attributionDataUrl",void 0),E([k({type:vr})],Im.prototype,"fullExtent",void 0),E([k({readOnly:!0})],Im.prototype,"hasAttributionData",null),E([k({type:String,clonable:!1})],Im.prototype,"id",void 0),E([k({type:Boolean,nonNullable:!0})],Im.prototype,"legendEnabled",void 0),E([k({type:["show","hide","hide-children"]})],Im.prototype,"listMode",void 0),E([k({type:Number,range:{min:0,max:1},nonNullable:!0})],Im.prototype,"opacity",void 0),E([k({clonable:!1})],Im.prototype,"parent",void 0),E([k({readOnly:!0})],Im.prototype,"parsedUrl",null),E([k({type:Boolean})],Im.prototype,"popupEnabled",void 0),E([k({type:Boolean})],Im.prototype,"attributionVisible",void 0),E([k({type:rr})],Im.prototype,"spatialReference",void 0),E([k({type:String})],Im.prototype,"title",void 0),E([k({readOnly:!0,json:{read:!1}})],Im.prototype,"type",void 0),E([k()],Im.prototype,"url",void 0),E([k({type:Boolean,nonNullable:!0})],Im.prototype,"visible",void 0),Im=E([ht("esri.layers.Layer")],Im);const iu=Im;let RR=class extends fn{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._handles=new uf,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll(),this._handles.destroy()}add(e,i,r={}){return this._installWatch(e,i,r,Qi)}addWhen(e,i,r={}){return this._installWatch(e,i,r,Hg)}addOnCollectionChange(e,i,{initial:r=!1,final:n=!1}={}){const s=++this._handleId;return this._handles.add([ku(e,"after-changes",this._createSyncUpdatingCallback(),Nu),ku(e,"change",i,{onListenerAdd:r?o=>i({added:o.toArray(),removed:[]}):void 0,onListenerRemove:n?o=>i({added:[],removed:o.toArray()}):void 0})],s),{remove:()=>this._handles.remove(s)}}addPromise(e){if(lt(e))return e;const i=++this._handleId;this._handles.add({remove:()=>{this._pendingPromises.delete(e)&&(this._pendingPromises.size!==0||this._handles.has(Zse)||this._set("updating",!1))}},i),this._pendingPromises.add(e),this._set("updating",!0);const r=()=>this._handles.remove(i);return e.then(r,r),e}removeAll(){this._pendingPromises.clear(),this._handles.removeAll(),this._set("updating",!1)}_installWatch(e,i,r={},n){const s=++this._handleId;r.sync||this._installSyncUpdatingWatch(e,s);const o=n(e,i,r);return this._handles.add(o,s),{remove:()=>this._handles.remove(s)}}_installSyncUpdatingWatch(e,i){const r=this._createSyncUpdatingCallback(),n=Qi(e,r,{sync:!0,equals:()=>!1});return this._handles.add(n,i),n}_createSyncUpdatingCallback(){return()=>{this._handles.remove(Zse),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this._handles.add(G3(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this._handles.remove(Zse))}),Zse)}}};E([k({readOnly:!0})],RR.prototype,"updating",void 0),RR=E([ht("esri.core.support.WatchUpdatingTracking")],RR);const Zse=-42,Nd=t=>{let e=class extends t{destroy(){this.destroyed||(this._get("handles")?.destroy(),this._get("updatingHandles")?.destroy())}get handles(){return this._get("handles")||new uf}get updatingHandles(){return this._get("updatingHandles")||new RR}};return E([k({readOnly:!0})],e.prototype,"handles",null),E([k({readOnly:!0})],e.prototype,"updatingHandles",null),e=E([ht("esri.core.HandleOwner")],e),e};let KC=class extends Nd(fn){};KC=E([ht("esri.core.HandleOwner")],KC);let lq=class{constructor(e=i=>i.values().next().value){this._peeker=e,this._items=new Set}get length(){return this._items.size}clear(){this._items.clear()}last(){if(this._items.size===0)return;let e;for(e of this._items);return e}peek(){if(this._items.size!==0)return this._peeker(this._items)}push(e){this.contains(e)||this._items.add(e)}contains(e){return this._items.has(e)}pop(){if(this.length===0)return;const e=this.peek();return this._items.delete(e),e}popLast(){if(this.length===0)return;const e=this.last();return this._items.delete(e),e}remove(e){this._items.delete(e)}filter(e){return this._items.forEach(i=>{e(i)||this._items.delete(i)}),this}};var og;(function(t){t[t.HANDSHAKE=0]="HANDSHAKE",t[t.OPEN=1]="OPEN",t[t.OPENED=2]="OPENED",t[t.RESPONSE=3]="RESPONSE",t[t.INVOKE=4]="INVOKE",t[t.ABORT=5]="ABORT",t[t.CLOSE=6]="CLOSE",t[t.OPEN_PORT=7]="OPEN_PORT",t[t.ON=8]="ON"})(og||(og={}));let TUt=0;function lHe(){return TUt++}function EUt(t){return t&&typeof t=="object"&&("result"in t||"transferList"in t)}function uq(t){return t?typeof t=="string"?JSON.stringify({name:"message",message:t}):t.toJSON?JSON.stringify(t):JSON.stringify({name:t.name,message:t.message,details:t.details||{stack:t.stack}}):null}function Yxe(t,e,i,r){if(e.type===og.OPEN_PORT)return void t.postMessage(e,[e.port]);if(e.type!==og.INVOKE&&e.type!==og.RESPONSE)return void t.postMessage(e);let n;if(EUt(i)?(n=uHe(i.transferList),e.data=i.result):(n=uHe(r),e.data=i),n){if(Gi("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 og.INVOKE:throw o;case og.RESPONSE:return void Yxe(t,{type:og.RESPONSE,jobId:e.jobId,error:uq(o)})}}}t.postMessage(e,n)}else t.postMessage(e)}function cq(t){if(!t)return null;const e=t.data;return e?typeof e=="string"?JSON.parse(e):e:null}function uHe(t){if(!t||!t.length)return null;if(Gi("esri-workers-arraybuffer-transfer"))return t;const e=t.filter(i=>!IUt(i));return e.length?e:null}function IUt(t){return t instanceof ArrayBuffer||t&&t.constructor&&t.constructor.name==="ArrayBuffer"}const AUt={statsWorker:()=>Promise.resolve().then(()=>oRi),geometryEngineWorker:()=>Promise.resolve().then(()=>SRi),CSVSourceWorker:()=>Promise.resolve().then(()=>LMi),EdgeProcessingWorker:()=>Promise.resolve().then(()=>fDi),ElevationSamplerWorker:()=>Promise.resolve().then(()=>lFi),FeatureServiceSnappingSourceWorker:()=>Promise.resolve().then(()=>BFi),GeoJSONSourceWorker:()=>Promise.resolve().then(()=>o4i),LercWorker:()=>Promise.resolve().then(()=>m4i),MemorySourceWorker:()=>Promise.resolve().then(()=>x4i),PBFDecoderWorker:()=>Promise.resolve().then(()=>M4i),Pipeline:()=>Promise.resolve().then(()=>bki),PointCloudWorker:()=>Promise.resolve().then(()=>Zki),RasterWorker:()=>Promise.resolve().then(()=>b$i),SceneLayerSnappingSourceWorker:()=>Promise.resolve().then(()=>J$i),SceneLayerWorker:()=>Promise.resolve().then(()=>a8i),WFSSourceWorker:()=>Promise.resolve().then(()=>k8i),WorkerTileHandler:()=>Promise.resolve().then(()=>jBi)},{CLOSE:cHe,ABORT:hHe,INVOKE:dHe,RESPONSE:hq,OPEN_PORT:pHe,ON:PUt}=og,OUt=2;let RUt=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===og.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 aH{static connect(e){const i=new MessageChannel;let r;r=typeof e=="function"?new e:"default"in e&&typeof e.default=="function"?new e.default:e;const n=new aH(i.port1,{channel:i,client:r},()=>null);return typeof r=="object"&&"remoteClient"in r&&(r.remoteClient=n),aH.clients.set(n,r),i.port2}static loadWorker(e){const i=AUt[e];return i?i():Promise.resolve(null)}constructor(e,i,r){this._port=e,this._getNextJob=r,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new RUt(n=>this._onInvokeMessage(n)),this._client=i.client,this._onMessage=this._onMessage.bind(this),this._channel=i.channel,this._schedule=i.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:cHe}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,i,r){const n=r&&r.signal,s=r&&r.transferList;if(!this._port)return Promise.reject(new st("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:i}));const o=lHe();return new Promise((a,l)=>{if(bm(n))return this._processWork(),void l(vc());const c=ep(n,()=>{const p=this._outJobs.get(o);p&&(this._outJobs.delete(o),this._processWork(),Bc(p.abortHandle),this._post({type:hHe,jobId:o}),l(vc()))}),d={resolve:a,reject:l,abortHandle:c,debugInfo:e};this._outJobs.set(o,d),this._post({type:dHe,jobId:o,methodName:e,abortable:n!=null},i,s)})}on(e,i){const r=new MessageChannel;function n(s){i(s.data)}return this._port.postMessage({type:og.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:og.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)}}}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:pHe,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=OUt)return;const e=this._getNextJob();if(!e)return;const{methodName:i,data:r,invokeOptions:n,deferred:s}=e;this.invoke(i,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=>{Bc(e.abortHandle),e.reject(vc(`Worker closing, aborting job calling '${e.debugInfo}'`))}),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){ye(this._schedule)?this._schedule(()=>this._processMessage(e)):this._processMessage(e)}_processMessage(e){const i=cq(e);if(i)switch(i.type){case hq:this._onResponseMessage(i);break;case dHe:this._invokeQueue.push(i);break;case hHe:this._onAbortMessage(i);break;case cHe:this._onCloseMessage();break;case pHe:this._onOpenPortMessage(i);break;case PUt:this._onOnMessage(i)}}_onAbortMessage(e){const i=this._inJobs,r=e.jobId,n=i.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),i.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&aH.clients.get(this)===e&&e.destroy(),aH.clients.delete(this),e&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:i,jobId:r,data:n,abortable:s}=e,o=s?new AbortController:null,a=this._inJobs;let l,c=this._client,d=c[i];try{if(!d&&i&&i.includes(".")){const p=i.split(".");for(let y=0;y{a.has(r)&&(a.delete(r),this._post({type:hq,jobId:r},p))},p=>{a.has(r)&&(a.delete(r),ss(p)||this._post({type:hq,jobId:r,error:uq(p||{message:`Error encountered at method ${i}`})}))})):this._post({type:hq,jobId:r},l)}_onOpenPortMessage(e){new aH(e.port,{client:this._client},()=>null)}_onOnMessage(e){const{port:i}=e,r=this._client.on(e.eventType,s=>{i.postMessage(s)}),n=QI(e.port,"message",s=>{cq(s)?.type===og.CLOSE&&(n.remove(),r.remove(),i.close())})}_onResponseMessage(e){const{jobId:i,error:r,data:n}=e,s=this._outJobs;if(!s.has(i))return;const o=s.get(i);s.delete(i),this._processWork(),Bc(o.abortHandle),r?o.reject(st.fromJSON(JSON.parse(r))):o.resolve(n)}_post(e,i,r){return Yxe(this._port,e,i,r)}};MR.kernelInfo={revision:oUe,version:zH,buildDate:sUe},MR.clients=new Map;let fHe=class{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new lq}destroy(){this.close()}get closed(){return!this._clients||!this._clients.length}open(e,i){return new Promise((r,n)=>{let s=!0;const o=a=>{sn(i.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(c,i,()=>this._ongoingJobsQueue.pop()??null),o(r),this._clients[a]),()=>(o(n),null)):(this._clients[a]=new MR(l,i,()=>this._ongoingJobsQueue.pop()??null),this._clientPromises[a]=Promise.resolve(this._clients[a]),o(r))}})}broadcast(e,i,r){const n=new Array(this._clientPromises.length);for(let s=0;sa?.invoke(e,i,r))}return n}close(){let e;for(;e=this._ongoingJobsQueue.pop();)e.deferred.reject(vc(`Worker closing, aborting job calling '${e.methodName}'`));for(const i of this._clientPromises)i.then(r=>r?.close());this._clients.length=0,this._clientPromises.length=0}invoke(e,i,r){let n;Array.isArray(r)?(Ei.getLogger("esri.core.workers.Connection").warn("invoke()","The transferList parameter is deprecated, use the options object instead"),n={transferList:r}):n=r;const s=Jx();this._ongoingJobsQueue.push({methodName:e,data:i,invokeOptions:n,deferred:s});for(let o=0;ol?.jobAdded())}return s.promise}on(e,i){return Promise.all(this._clientPromises).then(()=>D8(this._clients.map(r=>r.on(e,i))))}openPorts(){return new Promise(e=>{const i=new Array(this._clientPromises.length);let r=i.length;for(let n=0;n{s&&(i[n]=s.openPort()),--r==0&&e(i)})})}get test(){return{numClients:this._clients.length}}};const mHe=Ei.getLogger("esri.intl.substitute");function m2(t,e,i={}){const{format:r={}}=i;return Kx(t,n=>MUt(n,e,r))}function MUt(t,e,i){let r,n;const s=t.indexOf(":");if(s===-1?r=t.trim():(r=t.slice(0,s).trim(),n=t.slice(s+1).trim()),!r)return"";const o=Xx(r,e);if(o==null)return"";const a=(n?i?.[n]:null)??i?.[r];return a?DUt(o,a):n?FUt(o,n):Xxe(o)}function DUt(t,e){switch(e.type){case"date":return kC(t,e.intlOptions);case"number":return aA(t,e.intlOptions);default:return mHe.warn("missing format descriptor for key {key}"),Xxe(t)}}function FUt(t,e){switch(e.toLowerCase()){case"dateformat":return kC(t);case"numberformat":return aA(t);default:return mHe.warn(`inline format is unsupported since 4.12: ${e}`),/^(dateformat|datestring)/i.test(e)?kC(t):/^numberformat/i.test(e)?aA(t):Xxe(t)}}function Xxe(t){switch(typeof t){case"string":return t;case"number":return aA(t);case"boolean":return""+t;default:return t instanceof Date?kC(t):""}}async function LUt(t,e,i,r){const n=e.exec(i);if(!n)throw new st("esri-intl:invalid-bundle",`Bundle id "${i}" is not compatible with the pattern "${e}"`);const s=n[1]?`${n[1]}/`:"",o=n[2],a=f8t(r),l=`${s}${o}.json`,c=a?`${s}${o}_${a}.json`:l;let d;try{d=await gHe(t(c))}catch(p){if(c===l)throw new st("intl:unknown-bundle",`Bundle "${i}" cannot be loaded`,{error:p});try{d=await gHe(t(l))}catch(y){throw new st("intl:unknown-bundle",`Bundle "${i}" cannot be loaded`,{error:y})}}return d}async function gHe(t){if(ye(yHe.fetchBundleAsset))return yHe.fetchBundleAsset(t);const e=await ir(t,{responseType:"text"});return JSON.parse(e.data)}let kUt=class{constructor({base:e="",pattern:i,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 i=="string"?new RegExp(`^${i}`):i,this.getAssetUrl=n,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,i){return LUt(this.getAssetUrl,this.matcher,e,i)}};function NUt(t){return new kUt(t)}const yHe={};p8t(NUt({pattern:"esri/",location:zl}));const $Ut={};function BUt(t){const e={async:t.async,isDebug:t.isDebug,locale:t.locale,baseUrl:t.baseUrl,has:{...t.has},map:{...t.map},packages:t.packages&&t.packages.concat()||[],paths:{...t.paths}};return t.hasOwnProperty("async")||(e.async=!0),t.hasOwnProperty("isDebug")||(e.isDebug=!1),t.baseUrl||(e.baseUrl=$Ut.baseUrl),e}let GUt=class{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach(i=>{this[i]=(...r)=>e[i](...r)})}},Qse=class{constructor(){this._dispatcher=new GUt,this._workerPostMessage({type:og.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){L8(()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))})}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,i,r){this._dispatcher.addEventListener(e,i,r)}removeEventListener(e,i,r){this._dispatcher.removeEventListener(e,i,r)}_workerPostMessage(e){L8(()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))})}async _workerMessageHandler(e){const i=cq(e);if(i&&i.type===og.OPEN){const{modulePath:r,jobId:n}=i;let s=await MR.loadWorker(r);s||(s=await import(r));const o=MR.connect(s);this._workerPostMessage({type:og.OPENED,jobId:n,data:o})}}};const Kxe=Ei.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:VUt}=og,UUt='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,i)=>{if(t){if(t.aborted)return i(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,version:r}=configuration.kernelInfo,{revision:t,version:n}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS API for JavaScript modules and assets. For more information visit https://bit.ly/3QnsuSo.\\nModules version: ${r}\\nAssets version: ${n}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let n;function t(e){const o=n.connect(e);self.postMessage({type:2,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 3:if(outgoing.has(r)){const i=outgoing.get(r);outgoing.delete(r),o.error?i.reject(JSON.parse(o.error)):i.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 eoe,toe;const vHe="Failed to create Worker. Fallback to execute module in main thread";async function jUt(){if(!Gi("esri-workers")||(Gi("mozilla"),0))return _He(new Qse);if(!eoe&&!toe)try{const e=UUt.split('"{CONFIGURATION}"').join(`'${zUt()}'`);eoe=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){toe=e||{}}let t;if(eoe)try{t=new Worker(eoe,{name:"esri-worker-"+HUt++})}catch{Kxe.warn(vHe,toe),t=new Qse}else Kxe.warn(vHe,toe),t=new Qse;return _He(t)}async function _He(t){return new Promise(e=>{function i(n){const s=cq(n);s&&s.type===VUt&&(t.removeEventListener("message",i),t.removeEventListener("error",r),e(t))}function r(n){n.preventDefault(),t.removeEventListener("message",i),t.removeEventListener("error",r),Kxe.warn("Failed to create Worker. Fallback to execute module in main thread",n),(t=new Qse).addEventListener("message",i),t.addEventListener("error",r)}t.addEventListener("message",i),t.addEventListener("error",r)})}function zUt(){let t;if(na.default!=null){const n={...na};delete n.default,t=JSON.parse(JSON.stringify(n))}else t=JSON.parse(JSON.stringify(na));t.assetsPath=Vy(t.assetsPath),t.defaultAssetsPath=t.defaultAssetsPath?Vy(t.defaultAssetsPath):void 0,t.request.interceptors=[],t.log.interceptors=[],t.locale=Y0(),t.has={"esri-csp-restrictions":Gi("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":Gi("esri-2d-update-debug"),"featurelayer-pbf":Gi("featurelayer-pbf"),"featurelayer-simplify-thresholds":Gi("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":Gi("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":Gi("featurelayer-simplify-mobile-factor"),"esri-atomics":Gi("esri-atomics"),"esri-shared-array-buffer":Gi("esri-shared-array-buffer"),"esri-tiles-debug":Gi("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":Gi("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":Gi("feature-polyline-generalization-factor"),"host-webworker":1,"polylabel-placement-enabled":Gi("polylabel-placement-enabled")},t.workers.loaderUrl&&(t.workers.loaderUrl=Vy(t.workers.loaderUrl)),t.workers.workerPath?t.workers.workerPath=Vy(t.workers.workerPath):t.workers.workerPath=Vy(zl("esri/core/workers/RemoteClient.js")),t.workers.useDynamicImport=!1;const e=na.workers.loaderConfig,i=BUt({baseUrl:e?.baseUrl,locale:Y0(),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:t,loaderConfig:i,kernelInfo:{version:zH,buildDate:sUe,revision:oUe}})}let HUt=0;const{ABORT:bHe,INVOKE:WUt,OPEN:qUt,OPENED:YUt,RESPONSE:dq}=og;let XUt=class vLt{static async create(e){const i=await jUt();return new vLt(i,e)}constructor(e,i){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=i,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",r=>{r.preventDefault(),Ei.getLogger("esri.core.workers.WorkerOwner").error(r)})}terminate(){this.worker.terminate()}async open(e,i={}){const{signal:r}=i,n=lHe();return new Promise((s,o)=>{const a={resolve:s,reject:o,abortHandle:k8(r,()=>{this._outJobs.delete(n),this._post({type:bHe,jobId:n})})};this._outJobs.set(n,a),this._post({type:qUt,jobId:n,modulePath:e})})}_onMessage(e){const i=cq(e);if(i)switch(i.type){case YUt:this._onOpenedMessage(i);break;case dq:this._onResponseMessage(i);break;case bHe:this._onAbortMessage(i);break;case WUt:this._onInvokeMessage(i)}}_onAbortMessage(e){const i=this._inJobs,r=e.jobId,n=i.get(r);n&&(n.controller&&n.controller.abort(),i.delete(r))}_onInvokeMessage(e){const{methodName:i,jobId:r,data:n,abortable:s}=e,o=s?new AbortController:null,a=this._inJobs,l=v$t[i];let c;try{if(typeof l!="function")throw new TypeError(`${i} is not a function`);c=l.call(null,n,{signal:o?o.signal:null})}catch(d){return void this._post({type:dq,jobId:r,error:uq(d)})}Ip(c)?(a.set(r,{controller:o,promise:c}),c.then(d=>{a.has(r)&&(a.delete(r),this._post({type:dq,jobId:r},d))},d=>{a.has(r)&&(a.delete(r),d||(d={message:"Error encountered at method"+i}),ss(d)||this._post({type:dq,jobId:r,error:uq(d||{message:`Error encountered at method ${i}`})}))})):this._post({type:dq,jobId:r},c)}_onOpenedMessage(e){const{jobId:i,data:r}=e,n=this._outJobs.get(i);n&&(this._outJobs.delete(i),Bc(n.abortHandle),n.resolve(r))}_onResponseMessage(e){const{jobId:i,error:r,data:n}=e,s=this._outJobs.get(i);s&&(this._outJobs.delete(i),Bc(s.abortHandle),r?s.reject(st.fromJSON(JSON.parse(r))):s.resolve(n))}_post(e,i,r){return Yxe(this.worker,e,i,r)}},d5=Gi("esri-workers-debug")?1:Gi("esri-mobile")?Math.min(navigator.hardwareConcurrency-1,3):Gi("host-browser")?navigator.hardwareConcurrency-1:0;d5||(d5=Gi("safari")&&Gi("mac")?7:2);let wHe=0;const ioe=[];function KUt(){xHe()}async function roe(t,e){const i=new fHe;return await i.open(t,e),i}async function wA(t,e={}){if(typeof t!="string")throw new st("workers:undefined-module","modulePath is missing");let i=e.strategy||"distributed";if(Gi("host-webworker")&&!Gi("esri-workers")&&(i="local"),i==="local"){let r=await MR.loadWorker(t);r||(r=await import(t)),sn(e.signal);const n=e.client||r;return roe([MR.connect(r)],{...e,client:n})}if(await xHe(),sn(e.signal),i==="dedicated"){const r=wHe++%d5;return roe([await ioe[r].open(t,e)],e)}if(e.maxNumWorkers&&e.maxNumWorkers>0){const r=Math.min(e.maxNumWorkers,d5);if(rr.open(t,e)),e)}let noe=null;async function xHe(){if(noe)return noe;new AbortController;const t=[];for(let e=0;e(ioe[e]=r,r));t.push(i)}return noe=Promise.all(t),noe}function SHe(t,e,i){if(t.hasM==null||t.hasZ)for(const r of e)for(const n of r)n.length>2&&(n[2]*=i)}function CHe(t,e,i){if(!t&&!e||!i)return;const r=J3(i);THe(t,i,r),THe(e,i,r)}function THe(t,e,i){if(t)for(const r of t)JUt(r.geometry,e,i)}function JUt(t,e,i){if(lt(t)||!t.spatialReference||Ca(t.spatialReference,e))return;const r=J3(t.spatialReference)/i;if(r!==1){if("x"in t)t.z!=null&&(t.z*=r);else if("rings"in t)SHe(t,t.rings,r);else if("paths"in t)SHe(t,t.paths,r);else if("points"in t&&(t.hasM==null||t.hasZ))for(const n of t.points)n.length>2&&(n[2]*=r)}}function k9(t,e,i){if(lt(e)||lt(i)||i.vcsWkid||Ca(e,i))return null;const r=J3(e)/J3(i);if(r===1)return null;switch(t){case"point":case"esriGeometryPoint":return n=>ZUt(n,r);case"polyline":case"esriGeometryPolyline":return n=>ejt(n,r);case"polygon":case"esriGeometryPolygon":return n=>QUt(n,r);case"multipoint":case"esriGeometryMultipoint":return n=>tjt(n,r);case"extent":case"esriGeometryExtent":return n=>ijt(n,r);default:return null}}function ZUt(t,e){t&&t.z!=null&&(t.z*=e)}function QUt(t,e){if(t)for(const i of t.rings)for(const r of i)r.length>2&&(r[2]*=e)}function ejt(t,e){if(t)for(const i of t.paths)for(const r of i)r.length>2&&(r[2]*=e)}function tjt(t,e){if(t)for(const i of t.points)i.length>2&&(i[2]*=e)}function ijt(t,e){t&&t.zmin!=null&&t.zmax!=null&&(t.zmin*=e,t.zmax*=e)}function soe(t,e,i){if(!i||!i.features||!i.hasZ)return;const r=k9(i.geometryType,e,t.outSpatialReference);if(!lt(r))for(const n of i.features)r(n.geometry)}const ooe=new Bs({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"});var Jxe;const rjt=new Bs({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 Jy=Jxe=class extends Ni{constructor(t){super(t),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=-1,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(t,{description:e}){let i=null;try{i=e?JSON.parse(e):null}catch{}return i?.value??null}readValueType(t,{description:e}){let i=null;try{i=e?JSON.parse(e):null}catch{}return i?rjt.fromJSON(i.fieldValueType):null}clone(){return new Jxe({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.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})}};E([k({type:String,json:{write:!0}})],Jy.prototype,"alias",void 0),E([k({type:[String,Number],json:{write:{allowNull:!0}}})],Jy.prototype,"defaultValue",void 0),E([k()],Jy.prototype,"description",void 0),E([Li("description")],Jy.prototype,"readDescription",null),E([k({types:Zze,json:{read:{reader:Jse},write:!0}})],Jy.prototype,"domain",void 0),E([k({type:Boolean,json:{write:!0}})],Jy.prototype,"editable",void 0),E([k({type:xs,json:{write:!0}})],Jy.prototype,"length",void 0),E([k({type:String,json:{write:!0}})],Jy.prototype,"name",void 0),E([k({type:Boolean,json:{write:!0}})],Jy.prototype,"nullable",void 0),E([Hr(ooe)],Jy.prototype,"type",void 0),E([k()],Jy.prototype,"valueType",void 0),E([Li("valueType",["description"])],Jy.prototype,"readValueType",null),E([k({type:Boolean,json:{read:!1}})],Jy.prototype,"visible",void 0),Jy=Jxe=E([ht("esri.layers.support.Field")],Jy);const Bo=Jy;var Zxe;const Qxe=new Bs({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let ag=Zxe=class extends Ni{constructor(t){super(t),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(t,e){const i=rr.fromJSON(e.spatialReference),r=[];for(let n=0;n0)for(let i=0;iMath.round((c-r)/e),o=c=>Math.round((n-c)/i),a=this.features,l=this._getQuantizationFunction(this.geometryType,s,o);for(let c=0,d=a.length;cd*s+r,l=d=>n-d*o,c=this._getHydrationFunction(t,a,l);for(const{geometry:d}of e)ye(d)&&c&&c(d);return this.transform=null,this}_quantizePoints(t,e,i){let r,n;const s=[];for(let o=0,a=t.length;o0){const c=e(l[0]),d=i(l[1]);c===r&&d===n||(s.push([c-r,d-n]),r=c,n=d)}else r=e(l[0]),n=i(l[1]),s.push([r,n])}return s.length>0?s:null}_getQuantizationFunction(t,e,i){return t==="point"?r=>(r.x=e(r.x),r.y=i(r.y),r):t==="polyline"||t==="polygon"?r=>{const n=Va(r)?r.rings:r.paths,s=[];for(let o=0,a=n.length;o0?(Va(r)?r.rings=s:r.paths=s,r):null}:t==="multipoint"?r=>{const n=this._quantizePoints(r.points,e,i);return n&&n.length>0?(r.points=n,r):null}:t==="extent"?r=>r:null}_getHydrationFunction(t,e,i){return t==="point"?r=>{r.x=e(r.x),r.y=i(r.y)}:t==="polyline"||t==="polygon"?r=>{const n=Va(r)?r.rings:r.paths;let s,o;for(let a=0,l=n.length;a0?(s+=y[0],o+=y[1]):(s=y[0],o=y[1]),y[0]=e(s),y[1]=i(o)}}}:t==="extent"?r=>{r.xmin=e(r.xmin),r.ymin=i(r.ymin),r.xmax=e(r.xmax),r.ymax=i(r.ymax)}:t==="multipoint"?r=>{const n=r.points;let s,o;for(let a=0,l=n.length;a0?(s+=c[0],o+=c[1]):(s=c[0],o=c[1]),c[0]=e(s),c[1]=i(o)}}:null}};E([k({type:String,json:{write:!0}})],ag.prototype,"displayFieldName",void 0),E([k({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],ag.prototype,"exceededTransferLimit",void 0),E([k({type:[js],json:{write:!0}})],ag.prototype,"features",void 0),E([Li("features")],ag.prototype,"readFeatures",null),E([k({type:[Bo],json:{write:!0}})],ag.prototype,"fields",void 0),E([k({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:Qxe.read}}})],ag.prototype,"geometryType",void 0),E([mr("geometryType")],ag.prototype,"writeGeometryType",null),E([k({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],ag.prototype,"hasM",void 0),E([k({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],ag.prototype,"hasZ",void 0),E([k({types:P1,json:{write:!0}})],ag.prototype,"queryGeometry",void 0),E([Li("queryGeometry")],ag.prototype,"readQueryGeometry",null),E([k({type:rr,json:{write:!0}})],ag.prototype,"spatialReference",void 0),E([mr("spatialReference")],ag.prototype,"writeSpatialReference",null),E([k({json:{write:!0}})],ag.prototype,"transform",void 0),ag=Zxe=E([ht("esri.rest.support.FeatureSet")],ag),ag.prototype.toJSON.isDefaultToJSON=!0;const Wu=ag;let njt=0;const EHe="esri.layers.graphics.sources.MemorySource",e2e=Ei.getLogger(EHe);let xA=class extends hd.LoadableMixin(Zx(Nd(fr))){constructor(e){super(e),this._idToClientGraphic=null,this.type="memory"}load(e){const i=ye(e)?e.signal:null;return this.addResolvingPromise(this._startWorker(i)),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,i={}){await this.load(i);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,i);soe(e,this.layer.spatialReference,r);const n=Wu.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,i={}){if(this._requiresClientGraphicMapping())throw new st("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(i);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,i);return soe(e,this.layer.spatialReference,r),r}queryFeatureCount(e,i={}){return this.load(i).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,i))}queryObjectIds(e,i={}){return this.load(i).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,i))}queryExtent(e,i={}){return this.load(i).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,i)).then(r=>({count:r.count,extent:vr.fromJSON(r.extent)}))}querySnapping(e,i={}){return this.load(i).then(()=>this._connection.invoke("querySnapping",e,i))}async _applyEdits(e){if(!this._connection)throw new st("feature-layer-source:edit-failure","Memory source not loaded");const i=this.layer.objectIdField;let r=null;const n=[],s=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const o=d=>"objectId"in d&&d.objectId!=null?d.objectId:"attributes"in d&&d.attributes[i]!=null?d.attributes[i]:null;if(e.addFeatures&&(r=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const d of e.deleteFeatures){const p=o(d);p!=null&&n.push(p)}const a=e.updateFeatures&&this._idToClientGraphic?new Map:null;if(e.updateFeatures){for(const d of e.updateFeatures)if(s.push(this._serializeFeature(d)),a){const p=o(d);p!=null&&a.set(p,d)}}CHe(r?r.features:null,s,this.layer.spatialReference);const{fullExtent:l,featureEditResults:c}=await this._connection.invoke("applyEdits",{adds:r?r.features:[],updates:s,deletes:n});return this.fullExtent=l,r&&r.finish(c.uidToObjectId),this._updateClientGraphicIds(a,c),this._createEditsResult(c)}async _prepareClientMapping(e,i){if(this._layerOrSourceGeometryType!=="mesh"||lt(e))return;const r=[];for(const{geometry:n}of e)!ye(n)||n.type!=="mesh"||n.hasExtent||n.loaded||r.push(n.load({signal:i}));r.length&&await Promise.all(r)}_updateClientGraphicIds(e,i){if(this._idToClientGraphic){if(e)for(const r of i.updateResults){if(!r.success)continue;const n=e.get(r.objectId);n!=null&&this._addIdToClientGraphic(n)}for(const r of i.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 i=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:i?new st("feature-layer-source:edit-failure",i.description,{code:i.code}):null}}_prepareAddFeatures(e){const i=new Map,r=new Array(e.length);let n=null;for(let o=0;o{e2e.error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),v.preventDefault()}));const d={features:c.features,fields:i&&i.map(v=>v.toJSON()),geometryType:One.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!=="mesh"&&s,hasZ:this._layerOrSourceGeometryType==="mesh"||o,objectIdField:n,spatialReference:l?null:r&&r.toJSON(),timeInfo:a?a.toJSON():null},p=await this._connection.invoke("load",d,{signal:e});for(const v of p.warnings)e2e.warn(v.message,{layer:this.layer,warning:v});p.featureErrors.length&&e2e.warn(`Encountered ${p.featureErrors.length} validation errors while loading features`,p.featureErrors);const y=p.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(c.inferredGeometryType)&&(y.geometryType=One.toJSON(c.inferredGeometryType)),this.sourceJSON=y,this._requiresClientGraphicMapping()&&(this._idToClientGraphic=new Map),c.finish(p.assignedObjectIds)}};E([j_e({Type:js,ensureType:ud(js)})],xA.prototype,"itemType",void 0),E([k()],xA.prototype,"type",void 0),E([k({constructOnly:!0})],xA.prototype,"layer",void 0),E([k({readOnly:!0})],xA.prototype,"_workerGeometryType",null),E([k()],xA.prototype,"sourceJSON",void 0),xA=E([ht(EHe)],xA);function sjt(t){return"portalItem"in t}const g2=t=>{let e=class extends t{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):sjt(this)?this.portalItem?.apiKey:null}set apiKey(i){i!=null?this._override("apiKey",i):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return E([k({type:String})],e.prototype,"apiKey",null),e=E([ht("esri.layers.mixins.APIKeyMixin")],e),e},IHe={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},AHe=Object.values(IHe),PHe=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${AHe.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),ojt=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${AHe.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),ajt=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function OHe(t){return!!PHe.test(t)}function JC(t){if(lt(t))return null;const e=sa(t),i=e.path.match(PHe)||e.path.match(ojt);if(!i)return null;const[,r,n,s,o]=i,a=n.indexOf("/");return{title:aoe(a!==-1?n.slice(a+1):n),serverType:IHe[s.toLowerCase()],sublayer:o!=null&&o!==""?parseInt(o,10):null,url:{path:r}}}function RHe(t){const e=sa(t).path.match(ajt);return e?{serviceUrl:e[1],sublayerId:Number(e[2])}:null}function aoe(t){return(t=t.replace(/\s*[/_]+\s*/g," "))[0].toUpperCase()+t.slice(1)}function t2e(t,e){const i=[];if(t){const r=JC(t);ye(r)&&r.title&&i.push(r.title)}if(e){const r=aoe(e);i.push(r)}if(i.length===2){if(i[0].toLowerCase().includes(i[1].toLowerCase()))return i[0];if(i[1].toLowerCase().includes(i[0].toLowerCase()))return i[1]}return i.join(" - ")}function N9(t){if(!t)return!1;const e=".arcgis.com/",i="//services",r="//tiles",n="//features",s=(t=t.toLowerCase()).includes(e),o=t.includes(i)||t.includes(r)||t.includes(n);return s&&o}function pq(t,e){return t&&pL(VVe(t,e))}function MHe(t){let{url:e}=t;if(!e)return{url:e};e=VVe(e,t.logger);const i=sa(e),r=JC(i.path);let n;if(ye(r))r.sublayer!=null&&t.layer.layerId==null&&(n=r.sublayer),e=r.url.path;else if(t.nonStandardUrlAllowed){const s=RHe(i.path);ye(s)&&(e=s.serviceUrl,n=s.sublayerId)}return{url:pL(e),layerId:n}}function DHe(t,e,i,r,n){dA(e,r,"url",n),r.url&&t.layerId!=null&&(r.url=dd(r.url,i,t.layerId.toString()))}function ljt(t){if(!t)return!1;const e=t.toLowerCase(),i=e.includes("/services/"),r=e.includes("/mapserver/wmsserver"),n=e.includes("/imageserver/wmsserver"),s=e.includes("/wmsserver");return i&&(r||n||s)}const Qv=t=>{let e=class extends t{get title(){if(this._get("title")&&this.originOf("title")!=="defaults")return this._get("title");if(this.url){const i=JC(this.url);if(ye(i)&&i.title)return i.title}return this._get("title")||""}set title(i){this._set("title",i)}set url(i){this._set("url",pq(i,Ei.getLogger(this.declaredClass)))}};return E([k()],e.prototype,"title",null),E([k({type:String})],e.prototype,"url",null),e=E([ht("esri.layers.mixins.ArcGISService")],e),e};function fq(){const t=new Float32Array(16);return t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function ujt(t){const e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function cjt(t,e,i,r,n,s,o,a,l,c,d,p,y,v,S,I){const O=new Float32Array(16);return O[0]=t,O[1]=e,O[2]=i,O[3]=r,O[4]=n,O[5]=s,O[6]=o,O[7]=a,O[8]=l,O[9]=c,O[10]=d,O[11]=p,O[12]=y,O[13]=v,O[14]=S,O[15]=I,O}function hjt(t,e){return new Float32Array(t,e,16)}const djt=fq();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:djt,clone:ujt,create:fq,createView:hjt,fromValues:cjt},Symbol.toStringTag,{value:"Module"}));function pjt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function DR(t,e,i,r,n,s,o,a,l,c,d,p,y,v,S,I,O){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t[4]=s,t[5]=o,t[6]=a,t[7]=l,t[8]=c,t[9]=d,t[10]=p,t[11]=y,t[12]=v,t[13]=S,t[14]=I,t[15]=O,t}function mq(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function SA(t,e){if(t===e){const i=e[1],r=e[2],n=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=s,t[11]=e[14],t[12]=n,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function fjt(t,e){return gq(t,e)||mq(t),t}function gq(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],p=e[9],y=e[10],v=e[11],S=e[12],I=e[13],O=e[14],L=e[15],N=i*a-r*o,G=i*l-n*o,V=i*c-s*o,Y=r*l-n*a,X=r*c-s*a,te=n*c-s*l,re=d*I-p*S,fe=d*O-y*S,ge=d*L-v*S,_e=p*O-y*I,Ie=p*L-v*I,ke=y*L-v*O;let Ne=N*ke-G*Ie+V*_e+Y*ge-X*fe+te*re;return Ne?(Ne=1/Ne,t[0]=(a*ke-l*Ie+c*_e)*Ne,t[1]=(n*Ie-r*ke-s*_e)*Ne,t[2]=(I*te-O*X+L*Y)*Ne,t[3]=(y*X-p*te-v*Y)*Ne,t[4]=(l*ge-o*ke-c*fe)*Ne,t[5]=(i*ke-n*ge+s*fe)*Ne,t[6]=(O*V-S*te-L*G)*Ne,t[7]=(d*te-y*V+v*G)*Ne,t[8]=(o*Ie-a*ge+c*re)*Ne,t[9]=(r*ge-i*Ie-s*re)*Ne,t[10]=(S*X-I*V+L*N)*Ne,t[11]=(p*V-d*X-v*N)*Ne,t[12]=(a*fe-o*_e-l*re)*Ne,t[13]=(i*_e-r*fe+n*re)*Ne,t[14]=(I*G-S*Y-O*N)*Ne,t[15]=(d*Y-p*G+y*N)*Ne,t):null}function mjt(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],p=e[9],y=e[10],v=e[11],S=e[12],I=e[13],O=e[14],L=e[15];return t[0]=a*(y*L-v*O)-p*(l*L-c*O)+I*(l*v-c*y),t[1]=-(r*(y*L-v*O)-p*(n*L-s*O)+I*(n*v-s*y)),t[2]=r*(l*L-c*O)-a*(n*L-s*O)+I*(n*c-s*l),t[3]=-(r*(l*v-c*y)-a*(n*v-s*y)+p*(n*c-s*l)),t[4]=-(o*(y*L-v*O)-d*(l*L-c*O)+S*(l*v-c*y)),t[5]=i*(y*L-v*O)-d*(n*L-s*O)+S*(n*v-s*y),t[6]=-(i*(l*L-c*O)-o*(n*L-s*O)+S*(n*c-s*l)),t[7]=i*(l*v-c*y)-o*(n*v-s*y)+d*(n*c-s*l),t[8]=o*(p*L-v*I)-d*(a*L-c*I)+S*(a*v-c*p),t[9]=-(i*(p*L-v*I)-d*(r*L-s*I)+S*(r*v-s*p)),t[10]=i*(a*L-c*I)-o*(r*L-s*I)+S*(r*c-s*a),t[11]=-(i*(a*v-c*p)-o*(r*v-s*p)+d*(r*c-s*a)),t[12]=-(o*(p*O-y*I)-d*(a*O-l*I)+S*(a*y-l*p)),t[13]=i*(p*O-y*I)-d*(r*O-n*I)+S*(r*y-n*p),t[14]=-(i*(a*O-l*I)-o*(r*O-n*I)+S*(r*l-n*a)),t[15]=i*(a*y-l*p)-o*(r*y-n*p)+d*(r*l-n*a),t}function gjt(t){const e=t[0],i=t[1],r=t[2],n=t[3],s=t[4],o=t[5],a=t[6],l=t[7],c=t[8],d=t[9],p=t[10],y=t[11],v=t[12],S=t[13],I=t[14],O=t[15];return(e*o-i*s)*(p*O-y*I)-(e*a-r*s)*(d*O-y*S)+(e*l-n*s)*(d*I-p*S)+(i*a-r*o)*(c*O-y*v)-(i*l-n*o)*(c*I-p*v)+(r*l-n*a)*(c*S-d*v)}function loe(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],d=e[7],p=e[8],y=e[9],v=e[10],S=e[11],I=e[12],O=e[13],L=e[14],N=e[15];let G=i[0],V=i[1],Y=i[2],X=i[3];return t[0]=G*r+V*a+Y*p+X*I,t[1]=G*n+V*l+Y*y+X*O,t[2]=G*s+V*c+Y*v+X*L,t[3]=G*o+V*d+Y*S+X*N,G=i[4],V=i[5],Y=i[6],X=i[7],t[4]=G*r+V*a+Y*p+X*I,t[5]=G*n+V*l+Y*y+X*O,t[6]=G*s+V*c+Y*v+X*L,t[7]=G*o+V*d+Y*S+X*N,G=i[8],V=i[9],Y=i[10],X=i[11],t[8]=G*r+V*a+Y*p+X*I,t[9]=G*n+V*l+Y*y+X*O,t[10]=G*s+V*c+Y*v+X*L,t[11]=G*o+V*d+Y*S+X*N,G=i[12],V=i[13],Y=i[14],X=i[15],t[12]=G*r+V*a+Y*p+X*I,t[13]=G*n+V*l+Y*y+X*O,t[14]=G*s+V*c+Y*v+X*L,t[15]=G*o+V*d+Y*S+X*N,t}function yq(t,e,i){const r=i[0],n=i[1],s=i[2];if(e===t)t[12]=e[0]*r+e[4]*n+e[8]*s+e[12],t[13]=e[1]*r+e[5]*n+e[9]*s+e[13],t[14]=e[2]*r+e[6]*n+e[10]*s+e[14],t[15]=e[3]*r+e[7]*n+e[11]*s+e[15];else{const o=e[0],a=e[1],l=e[2],c=e[3],d=e[4],p=e[5],y=e[6],v=e[7],S=e[8],I=e[9],O=e[10],L=e[11];t[0]=o,t[1]=a,t[2]=l,t[3]=c,t[4]=d,t[5]=p,t[6]=y,t[7]=v,t[8]=S,t[9]=I,t[10]=O,t[11]=L,t[12]=o*r+d*n+S*s+e[12],t[13]=a*r+p*n+I*s+e[13],t[14]=l*r+y*n+O*s+e[14],t[15]=c*r+v*n+L*s+e[15]}return t}function i2e(t,e,i){const r=i[0],n=i[1],s=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function FHe(t,e,i,r){let n,s,o,a,l,c,d,p,y,v,S,I,O,L,N,G,V,Y,X,te,re,fe,ge,_e,Ie=r[0],ke=r[1],Ne=r[2],J=Math.sqrt(Ie*Ie+ke*ke+Ne*Ne);return J0?(i[0]=2*(a*o+d*r+l*s-c*n)/p,i[1]=2*(l*o+d*n+c*r-a*s)/p,i[2]=2*(c*o+d*s+a*n-l*r)/p):(i[0]=2*(a*o+d*r+l*s-c*n),i[1]=2*(l*o+d*n+c*r-a*s),i[2]=2*(c*o+d*s+a*n-l*r)),NHe(t,e,i),t}const Cjt=Qr();function Tjt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Ejt(t,e){const i=e[0],r=e[1],n=e[2],s=e[4],o=e[5],a=e[6],l=e[8],c=e[9],d=e[10];return t[0]=Math.sqrt(i*i+r*r+n*n),t[1]=Math.sqrt(s*s+o*o+a*a),t[2]=Math.sqrt(l*l+c*c+d*d),t}function Ijt(t,e){const i=e[0]+e[5]+e[10];let r=0;return i>0?(r=2*Math.sqrt(i+1),t[3]=.25*r,t[0]=(e[6]-e[9])/r,t[1]=(e[8]-e[2])/r,t[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]),t[3]=(e[6]-e[9])/r,t[0]=.25*r,t[1]=(e[1]+e[4])/r,t[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/r,t[0]=(e[1]+e[4])/r,t[1]=.25*r,t[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/r,t[0]=(e[8]+e[2])/r,t[1]=(e[6]+e[9])/r,t[2]=.25*r),t}function $He(t,e,i,r){const n=e[0],s=e[1],o=e[2],a=e[3],l=n+n,c=s+s,d=o+o,p=n*l,y=n*c,v=n*d,S=s*c,I=s*d,O=o*d,L=a*l,N=a*c,G=a*d,V=r[0],Y=r[1],X=r[2];return t[0]=(1-(S+O))*V,t[1]=(y+G)*V,t[2]=(v-N)*V,t[3]=0,t[4]=(y-G)*Y,t[5]=(1-(p+O))*Y,t[6]=(I+L)*Y,t[7]=0,t[8]=(v+N)*X,t[9]=(I-L)*X,t[10]=(1-(p+S))*X,t[11]=0,t[12]=i[0],t[13]=i[1],t[14]=i[2],t[15]=1,t}function Ajt(t,e,i,r,n){const s=e[0],o=e[1],a=e[2],l=e[3],c=s+s,d=o+o,p=a+a,y=s*c,v=s*d,S=s*p,I=o*d,O=o*p,L=a*p,N=l*c,G=l*d,V=l*p,Y=r[0],X=r[1],te=r[2],re=n[0],fe=n[1],ge=n[2],_e=(1-(I+L))*Y,Ie=(v+V)*Y,ke=(S-G)*Y,Ne=(v-V)*X,J=(1-(y+L))*X,he=(O+N)*X,xe=(S+G)*te,Pe=(O-N)*te,Oe=(1-(y+I))*te;return t[0]=_e,t[1]=Ie,t[2]=ke,t[3]=0,t[4]=Ne,t[5]=J,t[6]=he,t[7]=0,t[8]=xe,t[9]=Pe,t[10]=Oe,t[11]=0,t[12]=i[0]+re-(_e*re+Ne*fe+xe*ge),t[13]=i[1]+fe-(Ie*re+J*fe+Pe*ge),t[14]=i[2]+ge-(ke*re+he*fe+Oe*ge),t[15]=1,t}function Pjt(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=i+i,a=r+r,l=n+n,c=i*o,d=r*o,p=r*a,y=n*o,v=n*a,S=n*l,I=s*o,O=s*a,L=s*l;return t[0]=1-p-S,t[1]=d+L,t[2]=y-O,t[3]=0,t[4]=d-L,t[5]=1-c-S,t[6]=v+I,t[7]=0,t[8]=y+O,t[9]=v-I,t[10]=1-c-p,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ojt(t,e,i,r,n,s,o){const a=1/(i-e),l=1/(n-r),c=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*l,t[6]=0,t[7]=0,t[8]=(i+e)*a,t[9]=(n+r)*l,t[10]=(o+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*c,t[15]=0,t}function Rjt(t,e,i,r,n){const s=1/Math.tan(e/2);let o;return t[0]=s/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,n!=null&&n!==1/0?(o=1/(r-n),t[10]=(n+r)*o,t[14]=2*n*r*o):(t[10]=-1,t[14]=-2*r),t}function Mjt(t,e,i,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),c=2/(n+s);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-a)*l*.5,t[9]=(n-s)*c*.5,t[10]=r/(i-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*i/(i-r),t[15]=0,t}function Djt(t,e,i,r,n,s,o){const a=1/(e-i),l=1/(r-n),c=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*a,t[13]=(n+r)*l,t[14]=(o+s)*c,t[15]=1,t}function Fjt(t,e,i,r){let n,s,o,a,l,c,d,p,y,v;const S=e[0],I=e[1],O=e[2],L=r[0],N=r[1],G=r[2],V=i[0],Y=i[1],X=i[2],te=jv();return Math.abs(S-V)0&&(v=1/Math.sqrt(v),d*=v,p*=v,y*=v);let S=l*y-c*p,I=c*d-a*y,O=a*p-l*d;return v=S*S+I*I+O*O,v>0&&(v=1/Math.sqrt(v),S*=v,I*=v,O*=v),t[0]=S,t[1]=I,t[2]=O,t[3]=0,t[4]=p*O-y*I,t[5]=y*S-d*O,t[6]=d*I-p*S,t[7]=0,t[8]=d,t[9]=p,t[10]=y,t[11]=0,t[12]=n,t[13]=s,t[14]=o,t[15]=1,t}function kjt(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Njt(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2+t[9]**2+t[10]**2+t[11]**2+t[12]**2+t[13]**2+t[14]**2+t[15]**2)}function $jt(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t[6]=e[6]+i[6],t[7]=e[7]+i[7],t[8]=e[8]+i[8],t[9]=e[9]+i[9],t[10]=e[10]+i[10],t[11]=e[11]+i[11],t[12]=e[12]+i[12],t[13]=e[13]+i[13],t[14]=e[14]+i[14],t[15]=e[15]+i[15],t}function BHe(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t[6]=e[6]-i[6],t[7]=e[7]-i[7],t[8]=e[8]-i[8],t[9]=e[9]-i[9],t[10]=e[10]-i[10],t[11]=e[11]-i[11],t[12]=e[12]-i[12],t[13]=e[13]-i[13],t[14]=e[14]-i[14],t[15]=e[15]-i[15],t}function Bjt(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12]*i,t[13]=e[13]*i,t[14]=e[14]*i,t[15]=e[15]*i,t}function Gjt(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t[3]=e[3]+i[3]*r,t[4]=e[4]+i[4]*r,t[5]=e[5]+i[5]*r,t[6]=e[6]+i[6]*r,t[7]=e[7]+i[7]*r,t[8]=e[8]+i[8]*r,t[9]=e[9]+i[9]*r,t[10]=e[10]+i[10]*r,t[11]=e[11]+i[11]*r,t[12]=e[12]+i[12]*r,t[13]=e[13]+i[13]*r,t[14]=e[14]+i[14]*r,t[15]=e[15]+i[15]*r,t}function GHe(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function VHe(t,e){if(t===e)return!0;const i=t[0],r=t[1],n=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],d=t[8],p=t[9],y=t[10],v=t[11],S=t[12],I=t[13],O=t[14],L=t[15],N=e[0],G=e[1],V=e[2],Y=e[3],X=e[4],te=e[5],re=e[6],fe=e[7],ge=e[8],_e=e[9],Ie=e[10],ke=e[11],Ne=e[12],J=e[13],he=e[14],xe=e[15],Pe=jv();return Math.abs(i-N)<=Pe*Math.max(1,Math.abs(i),Math.abs(N))&&Math.abs(r-G)<=Pe*Math.max(1,Math.abs(r),Math.abs(G))&&Math.abs(n-V)<=Pe*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-Y)<=Pe*Math.max(1,Math.abs(s),Math.abs(Y))&&Math.abs(o-X)<=Pe*Math.max(1,Math.abs(o),Math.abs(X))&&Math.abs(a-te)<=Pe*Math.max(1,Math.abs(a),Math.abs(te))&&Math.abs(l-re)<=Pe*Math.max(1,Math.abs(l),Math.abs(re))&&Math.abs(c-fe)<=Pe*Math.max(1,Math.abs(c),Math.abs(fe))&&Math.abs(d-ge)<=Pe*Math.max(1,Math.abs(d),Math.abs(ge))&&Math.abs(p-_e)<=Pe*Math.max(1,Math.abs(p),Math.abs(_e))&&Math.abs(y-Ie)<=Pe*Math.max(1,Math.abs(y),Math.abs(Ie))&&Math.abs(v-ke)<=Pe*Math.max(1,Math.abs(v),Math.abs(ke))&&Math.abs(S-Ne)<=Pe*Math.max(1,Math.abs(S),Math.abs(Ne))&&Math.abs(I-J)<=Pe*Math.max(1,Math.abs(I),Math.abs(J))&&Math.abs(O-he)<=Pe*Math.max(1,Math.abs(O),Math.abs(he))&&Math.abs(L-xe)<=Pe*Math.max(1,Math.abs(L),Math.abs(xe))}function n2e(t){const e=jv(),i=t[0],r=t[1],n=t[2],s=t[4],o=t[5],a=t[6],l=t[8],c=t[9],d=t[10];return Math.abs(1-(i*i+s*s+l*l))<=e&&Math.abs(1-(r*r+o*o+c*c))<=e&&Math.abs(1-(n*n+a*a+d*d))<=e}function s2e(t){return t[0]===1&&t[1]===0&&t[2]===0&&t[4]===0&&t[5]===1&&t[6]===0&&t[8]===0&&t[9]===0&&t[10]===1}Object.freeze(Object.defineProperty({__proto__:null,add:$jt,adjoint:mjt,copy:pjt,determinant:gjt,equals:VHe,exactEquals:GHe,frob:Njt,fromQuat:Pjt,fromQuat2:Sjt,fromRotation:r2e,fromRotationTranslation:NHe,fromRotationTranslationScale:$He,fromRotationTranslationScaleOrigin:Ajt,fromScaling:bjt,fromTranslation:LHe,fromXRotation:kHe,fromYRotation:wjt,fromZRotation:xjt,frustum:Ojt,getRotation:Ijt,getScaling:Ejt,getTranslation:Tjt,hasIdentityRotation:s2e,identity:mq,invert:gq,invertOrIdentity:fjt,isOrthoNormal:n2e,lookAt:Fjt,mul:loe,multiply:loe,multiplyScalar:Bjt,multiplyScalarAndAdd:Gjt,ortho:Djt,perspective:Rjt,perspectiveFromFieldOfView:Mjt,rotate:FHe,rotateX:yjt,rotateY:vjt,rotateZ:_jt,scale:i2e,set:DR,str:kjt,sub:BHe,subtract:BHe,targetTo:Ljt,translate:yq,transpose:SA},Symbol.toStringTag,{value:"Module"}));const Vjt=(t,e)=>{const i=DR(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1);return SA(i,i)},Ujt=(t,e)=>{const i=DR(t,e,0,0,.5-.5*e,0,e,0,.5-.5*e,0,0,e,.5-.5*e,0,0,0,1);return SA(i,i)},jjt=(t,e)=>{const i=1-e,r=DR(t,.2126+.7874*i,.7152-.7152*i,.0722-.0722*i,0,.2126-.2126*i,.7152+.2848*i,.0722-.0722*i,0,.2126-.2126*i,.7152-.7152*i,.0722+.9278*i,0,0,0,0,1);return SA(r,r)},zjt=(t,e)=>{const i=Math.sin(e*Math.PI/180),r=Math.cos(e*Math.PI/180),n=DR(t,.213+.787*r-.213*i,.715-.715*r-.715*i,.072-.072*r+.928*i,0,.213-.213*r+.143*i,.715+.285*r+.14*i,.072-.072*r-.283*i,0,.213-.213*r-.787*i,.715-.715*r+.715*i,.072+.928*r+.072*i,0,0,0,0,1);return SA(n,n)},Hjt=(t,e)=>{const i=1-2*e,r=DR(t,i,0,0,e,0,i,0,e,0,0,i,e,0,0,0,1);return SA(r,r)},Wjt=(t,e)=>{const i=DR(t,.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 SA(i,i)},qjt=(t,e)=>{const i=1-e,r=DR(t,.393+.607*i,.769-.769*i,.189-.189*i,0,.349-.349*i,.686+.314*i,.168-.168*i,0,.272-.272*i,.534-.534*i,.131+.869*i,0,0,0,0,1);return SA(r,r)};let UHe=class _Lt{constructor(e,i,r){this.strength=e,this.radius=i,this.threshold=r,this.type="bloom"}interpolate(e,i,r){this.strength=e_(e.strength,i.strength,r),this.radius=e_(e.radius,i.radius,r),this.threshold=e_(e.threshold,i.threshold,r)}clone(){return new _Lt(this.strength,this.radius,this.threshold)}toJSON(){return{type:"bloom",radius:vq(this.radius),strength:this.strength,threshold:this.threshold}}},jHe=class bLt{constructor(e){this.radius=e,this.type="blur"}interpolate(e,i,r){this.radius=Math.round(e_(e.radius,i.radius,r))}clone(){return new bLt(this.radius)}toJSON(){return{type:"blur",radius:vq(this.radius)}}},o2e=class wLt{constructor(e,i){this.type=e,this.amount=i,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,i,r){this.amount=e_(e.amount,i.amount,r),this._updateMatrix()}clone(){return new wLt(this.type,this.amount)}toJSON(){return{type:this.type,amount:this.amount}}_updateMatrix(){const e=this._colorMatrix||fq();switch(this.type){case"brightness":this._colorMatrix=Vjt(e,this.amount);break;case"contrast":this._colorMatrix=Ujt(e,this.amount);break;case"grayscale":this._colorMatrix=jjt(e,this.amount);break;case"invert":this._colorMatrix=Hjt(e,this.amount);break;case"saturate":this._colorMatrix=Wjt(e,this.amount);break;case"sepia":this._colorMatrix=qjt(e,this.amount)}}},zHe=class xLt{constructor(e,i,r,n){this.offsetX=e,this.offsetY=i,this.blurRadius=r,this.color=n,this.type="drop-shadow"}interpolate(e,i,r){this.offsetX=e_(e.offsetX,i.offsetX,r),this.offsetY=e_(e.offsetY,i.offsetY,r),this.blurRadius=e_(e.blurRadius,i.blurRadius,r),this.color[0]=Math.round(e_(e.color[0],i.color[0],r)),this.color[1]=Math.round(e_(e.color[1],i.color[1],r)),this.color[2]=Math.round(e_(e.color[2],i.color[2],r)),this.color[3]=e_(e.color[3],i.color[3],r)}clone(){return new xLt(this.offsetX,this.offsetY,this.blurRadius,[...this.color])}toJSON(){const e=[...this.color];return e[3]*=255,{type:"drop-shadow",xoffset:vq(this.offsetX),yoffset:vq(this.offsetY),blurRadius:vq(this.blurRadius),color:e}}},HHe=class SLt{constructor(e){this.angle=e,this.type="hue-rotate"}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(e,i,r){this.angle=e_(e.angle,i.angle,r),this._updateMatrix()}clone(){return new SLt(this.angle)}toJSON(){return{type:"hue-rotate",angle:this.angle}}_updateMatrix(){const e=this._colorMatrix||fq();this._colorMatrix=zjt(e,this.angle)}},WHe=class CLt{constructor(e){this.amount=e,this.type="opacity",this.amount=Math.min(this.amount,1)}interpolate(e,i,r){this.amount=e_(e.amount,i.amount,r)}clone(){return new CLt(this.amount)}toJSON(){return{type:"opacity",amount:this.amount}}};function e_(t,e,i){return t+(e-t)*i}function vq(t){return Math.round(1e3*Xy(t))/1e3}function Yjt(t){switch(t.type){case"grayscale":case"sepia":case"invert":return new o2e(t.type,0);case"saturate":case"brightness":case"contrast":return new o2e(t.type,1);case"opacity":return new WHe(1);case"hue-rotate":return new HHe(0);case"blur":return new jHe(0);case"drop-shadow":return new zHe(0,0,0,[...N1e("transparent")]);case"bloom":return new UHe(0,0,1)}}var a2e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qa(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function qHe(t,e){const i=t.length>e.length?t:e;return(t.length>e.length?e:t).every((r,n)=>r.type===i[n].type)}function YHe(t,e){const i=t.length>e.length?t:e,r=t.length>e.length?e:t;for(let n=r.length;n{if(!Number.isFinite(i.scale)||i.scale<=0)throw new st("effect:invalid-scale","scale must be finite and greater than 0",{stop:i});return{scale:i.scale,effects:JHe(i.value)}});e.sort((i,r)=>r.effects.length-i.effects.length);for(let i=0;ir.scale-i.scale),e}function JHe(t){let e;if(!t)return[];try{e=l2e.parse(t)}catch(i){throw new st("effect:invalid-syntax","Invalid effect syntax",{value:t,error:i})}return e.map(i=>Kjt(i))}function Kjt(t){try{switch(t.name){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":return Jjt(t);case"opacity":return Zjt(t);case"hue-rotate":return Qjt(t);case"blur":return e7t(t);case"drop-shadow":return t7t(t);case"bloom":return i7t(t)}}catch(e){throw e.details.filter=t,e}throw new st("effect:unknown-effect",`Effect '${t.name}' is not supported`,{effect:t})}function Jjt(t){let e=1;return $9(t.parameters,1),t.parameters.length===1&&(e=y2(t.parameters[0])),new o2e(t.name,e)}function Zjt(t){let e=1;return $9(t.parameters,1),t.parameters.length===1&&(e=y2(t.parameters[0])),new WHe(e)}function Qjt(t){let e=0;return $9(t.parameters,1),t.parameters.length===1&&(e=l7t(t.parameters[0])),new HHe(e)}function e7t(t){let e=0;return $9(t.parameters,1),t.parameters.length===1&&(e=d2e(t.parameters[0]),_q(e,t.parameters[0])),new jHe(e)}function t7t(t){const e=[];let i=null;for(const r of t.parameters)if(r.type==="color"){if(e.length&&Object.freeze(e),i)throw new st("effect:type-error","Accepts only one color",{});i=u7t(r)}else{const n=d2e(r);if(Object.isFrozen(e))throw new st("effect:type-error"," parameters not consecutive",{lengths:e});e.push(n),e.length===3&&_q(n,r)}if(e.length<2||e.length>3)throw new st("effect:type-error",`Expected {2,3}, Actual: {${e.length}}`,{lengths:e});return new zHe(e[0],e[1],e[2]||0,i||ZHe("black"))}function i7t(t){let e=1,i=0,r=0;return $9(t.parameters,3),t.parameters[0]&&(e=y2(t.parameters[0])),t.parameters[1]&&(i=d2e(t.parameters[1]),_q(i,t.parameters[1])),t.parameters[2]&&(r=y2(t.parameters[2])),new UHe(e,i,r)}function $9(t,e){if(t.length>e)throw new st("effect:type-error",`Function supports up to ${e} parameters, Actual: ${t.length}`,{parameters:t})}function uoe(t){if(t.type==="color")return"";if(t.unit){if(h2e[t.unit])return"";if(c2e[t.unit])return"";if(t.unit==="%")return""}return""}function _q(t,e){if(t<0)throw new st("effect:type-error",`Negative values are not allowed, Actual: ${t}`,{term:e})}function r7t(t){if(t.type!=="quantity"||t.unit!==null)throw new st("effect:type-error",`Expected , Actual: ${uoe(t)}`,{term:t})}function n7t(t){if(t.type!=="quantity"||t.unit!==null&&t.unit!=="%")throw new st("effect:type-error",`Expected or , Actual: ${uoe(t)}`,{term:t})}KHe=function(){function t(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 i(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,c={start:kr},d=kr,p="none",y=")",v=",",S="(",I="%",O="px",L="cm",N="mm",G="in",V="pt",Y="pc",X="deg",te="rad",re="grad",fe="turn",ge="#",_e=".",Ie="e",ke=/^[ \t\n\r]/,Ne=/^[a-z\-]/,J=/^[0-9a-fA-F]/,he=/^[+\-]/,xe=/^[0-9]/,Pe=ar("none"),Oe=Fi("none",!1),Ae=Fi(")",!1),ze=Fi(",",!1),Ge=ar("whitespace"),Je=Ri([" "," ",` -`,"\r"],!1,!1),et=ar("function"),tt=Fi("(",!1),ft=ar("identifier"),Pt=Ri([["a","z"],"-"],!1,!1),$t=ar("percentage"),St=Fi("%",!1),Tt=ar("length"),Lt=Fi("px",!1),at=Fi("cm",!1),Ee=Fi("mm",!1),Be=Fi("in",!1),mt=Fi("pt",!1),kt=Fi("pc",!1),ct=ar("angle"),le=Fi("deg",!1),it=Fi("rad",!1),pt=Fi("grad",!1),Le=Fi("turn",!1),ce=ar("number"),Ce=ar("color"),Ze=Fi("#",!1),yt=Ri([["0","9"],["a","f"],["A","F"]],!1,!1),Ve=Ri(["+","-"],!1,!1),At=Ri([["0","9"]],!1,!1),ii=Fi(".",!1),gt=Fi("e",!1),Ue=function(){return[]},ni=function(wi,_t){return{type:"function",name:wi,parameters:_t||[]}},A=function(wi,_t){return _t.length>0?Ha(wi,_t,3):[wi]},ve=function(wi){return{type:"quantity",value:wi.value,unit:wi.unit}},W=function(wi){return{type:"color",colorType:wi.type,value:wi.value}},T=function(wi){return wi},b=function(){return bi()},m=function(wi){return{value:wi,unit:"%"}},_=function(wi){return{value:wi,unit:"px"}},C=function(wi){return{value:wi,unit:"cm"}},D=function(wi){return{value:wi,unit:"mm"}},F=function(wi){return{value:wi,unit:"in"}},B=function(wi){return{value:wi,unit:"pt"}},q=function(wi){return{value:wi,unit:"pc"}},Z=function(wi){return{value:wi,unit:"deg"}},oe=function(wi){return{value:wi,unit:"rad"}},ue=function(wi){return{value:wi,unit:"grad"}},be=function(wi){return{value:wi,unit:"turn"}},De=function(wi){return{value:wi,unit:null}},qe=function(){return{type:"hex",value:bi()}},rt=function(wi){return{type:"function",value:wi}},Dt=function(){return{type:"named",value:bi()}},Vt=function(){return parseFloat(bi())},Ke=0,Ot=0,ei=[{line:1,column:1}],Jt=0,Xt=[],ti=0;if("startRule"in s){if(!(s.startRule in c))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');d=c[s.startRule]}function bi(){return n.substring(Ot,Ke)}function Fi(wi,_t){return{type:"literal",text:wi,ignoreCase:_t}}function Ri(wi,_t,Mr){return{type:"class",parts:wi,inverted:_t,ignoreCase:Mr}}function er(){return{type:"end"}}function ar(wi){return{type:"other",description:wi}}function mi(wi){var _t,Mr=ei[wi];if(Mr)return Mr;for(_t=wi-1;!ei[_t];)_t--;for(Mr={line:(Mr=ei[_t]).line,column:Mr.column};_tJt&&(Jt=Ke,Xt=[]),Xt.push(wi))}function xo(wi,_t,Mr){return new e(e.buildMessage(wi,_t),wi,_t,Mr)}function kr(){var wi;return(wi=is())===a&&(wi=Hn()),wi}function is(){var wi,_t;return ti++,wi=Ke,Ur(),n.substr(Ke,4)===p?(_t=p,Ke+=4):(_t=a,ti===0&&Lr(Oe)),_t!==a?(Ur(),Ot=wi,wi=Ue()):(Ke=wi,wi=a),ti--,wi===a&&ti===0&&Lr(Pe),wi}function Hn(){var wi,_t;if(wi=[],(_t=En())!==a)for(;_t!==a;)wi.push(_t),_t=En();else wi=a;return wi}function En(){var wi,_t,Mr,jr;return wi=Ke,Ur(),(_t=Qo())!==a?(Ur(),(Mr=Kn())===a&&(Mr=null),Ur(),n.charCodeAt(Ke)===41?(jr=y,Ke++):(jr=a,ti===0&&Lr(Ae)),jr!==a?(Ur(),Ot=wi,wi=ni(_t,Mr)):(Ke=wi,wi=a)):(Ke=wi,wi=a),wi}function Kn(){var wi,_t,Mr,jr,Nn,Jn,ws,wa;if(wi=Ke,(_t=$i())!==a){for(Mr=[],jr=Ke,Nn=Ur(),n.charCodeAt(Ke)===44?(Jn=v,Ke++):(Jn=a,ti===0&&Lr(ze)),Jn===a&&(Jn=null),ws=Ur(),(wa=$i())!==a?jr=Nn=[Nn,Jn,ws,wa]:(Ke=jr,jr=a);jr!==a;)Mr.push(jr),jr=Ke,Nn=Ur(),n.charCodeAt(Ke)===44?(Jn=v,Ke++):(Jn=a,ti===0&&Lr(ze)),Jn===a&&(Jn=null),ws=Ur(),(wa=$i())!==a?jr=Nn=[Nn,Jn,ws,wa]:(Ke=jr,jr=a);Ot=wi,wi=A(_t,Mr)}else Ke=wi,wi=a;return wi}function $i(){var wi,_t;return wi=Ke,(_t=Xi())===a&&(_t=li())===a&&(_t=H())===a&&(_t=xr()),_t!==a&&(Ot=wi,_t=ve(_t)),(wi=_t)===a&&(wi=Ke,(_t=Ta())!==a&&(Ot=wi,_t=W(_t)),wi=_t),wi}function Ur(){var wi,_t;for(ti++,wi=[],ke.test(n.charAt(Ke))?(_t=n.charAt(Ke),Ke++):(_t=a,ti===0&&Lr(Je));_t!==a;)wi.push(_t),ke.test(n.charAt(Ke))?(_t=n.charAt(Ke),Ke++):(_t=a,ti===0&&Lr(Je));return ti--,_t=a,ti===0&&Lr(Ge),wi}function Qo(){var wi,_t,Mr;return ti++,wi=Ke,(_t=In())!==a?(n.charCodeAt(Ke)===40?(Mr=S,Ke++):(Mr=a,ti===0&&Lr(tt)),Mr!==a?(Ot=wi,wi=T(_t)):(Ke=wi,wi=a)):(Ke=wi,wi=a),ti--,wi===a&&(_t=a,ti===0&&Lr(et)),wi}function In(){var wi,_t,Mr;if(ti++,wi=Ke,_t=[],Ne.test(n.charAt(Ke))?(Mr=n.charAt(Ke),Ke++):(Mr=a,ti===0&&Lr(Pt)),Mr!==a)for(;Mr!==a;)_t.push(Mr),Ne.test(n.charAt(Ke))?(Mr=n.charAt(Ke),Ke++):(Mr=a,ti===0&&Lr(Pt));else _t=a;return _t!==a&&(Ot=wi,_t=b()),ti--,(wi=_t)===a&&(_t=a,ti===0&&Lr(ft)),wi}function Xi(){var wi,_t,Mr;return ti++,wi=Ke,Ur(),(_t=ea())!==a?(n.charCodeAt(Ke)===37?(Mr=I,Ke++):(Mr=a,ti===0&&Lr(St)),Mr!==a?(Ot=wi,wi=m(_t)):(Ke=wi,wi=a)):(Ke=wi,wi=a),ti--,wi===a&&ti===0&&Lr($t),wi}function li(){var wi,_t,Mr;return ti++,wi=Ke,Ur(),(_t=ea())!==a?(n.substr(Ke,2)===O?(Mr=O,Ke+=2):(Mr=a,ti===0&&Lr(Lt)),Mr!==a?(Ot=wi,wi=_(_t)):(Ke=wi,wi=a)):(Ke=wi,wi=a),wi===a&&(wi=Ke,Ur(),(_t=ea())!==a?(n.substr(Ke,2)===L?(Mr=L,Ke+=2):(Mr=a,ti===0&&Lr(at)),Mr!==a?(Ot=wi,wi=C(_t)):(Ke=wi,wi=a)):(Ke=wi,wi=a),wi===a&&(wi=Ke,Ur(),(_t=ea())!==a?(n.substr(Ke,2)===N?(Mr=N,Ke+=2):(Mr=a,ti===0&&Lr(Ee)),Mr!==a?(Ot=wi,wi=D(_t)):(Ke=wi,wi=a)):(Ke=wi,wi=a),wi===a&&(wi=Ke,Ur(),(_t=ea())!==a?(n.substr(Ke,2)===G?(Mr=G,Ke+=2):(Mr=a,ti===0&&Lr(Be)),Mr!==a?(Ot=wi,wi=F(_t)):(Ke=wi,wi=a)):(Ke=wi,wi=a),wi===a&&(wi=Ke,Ur(),(_t=ea())!==a?(n.substr(Ke,2)===V?(Mr=V,Ke+=2):(Mr=a,ti===0&&Lr(mt)),Mr!==a?(Ot=wi,wi=B(_t)):(Ke=wi,wi=a)):(Ke=wi,wi=a),wi===a&&(wi=Ke,Ur(),(_t=ea())!==a?(n.substr(Ke,2)===Y?(Mr=Y,Ke+=2):(Mr=a,ti===0&&Lr(kt)),Mr!==a?(Ot=wi,wi=q(_t)):(Ke=wi,wi=a)):(Ke=wi,wi=a)))))),ti--,wi===a&&ti===0&&Lr(Tt),wi}function H(){var wi,_t,Mr;return ti++,wi=Ke,(_t=ea())!==a?(n.substr(Ke,3)===X?(Mr=X,Ke+=3):(Mr=a,ti===0&&Lr(le)),Mr!==a?(Ot=wi,wi=Z(_t)):(Ke=wi,wi=a)):(Ke=wi,wi=a),wi===a&&(wi=Ke,(_t=ea())!==a?(n.substr(Ke,3)===te?(Mr=te,Ke+=3):(Mr=a,ti===0&&Lr(it)),Mr!==a?(Ot=wi,wi=oe(_t)):(Ke=wi,wi=a)):(Ke=wi,wi=a),wi===a&&(wi=Ke,(_t=ea())!==a?(n.substr(Ke,4)===re?(Mr=re,Ke+=4):(Mr=a,ti===0&&Lr(pt)),Mr!==a?(Ot=wi,wi=ue(_t)):(Ke=wi,wi=a)):(Ke=wi,wi=a),wi===a&&(wi=Ke,(_t=ea())!==a?(n.substr(Ke,4)===fe?(Mr=fe,Ke+=4):(Mr=a,ti===0&&Lr(Le)),Mr!==a?(Ot=wi,wi=be(_t)):(Ke=wi,wi=a)):(Ke=wi,wi=a)))),ti--,wi===a&&(_t=a,ti===0&&Lr(ct)),wi}function xr(){var wi,_t;return ti++,wi=Ke,Ur(),(_t=ea())!==a?(Ot=wi,wi=De(_t)):(Ke=wi,wi=a),ti--,wi===a&&ti===0&&Lr(ce),wi}function Ta(){var wi,_t,Mr,jr;if(ti++,wi=Ke,n.charCodeAt(Ke)===35?(_t=ge,Ke++):(_t=a,ti===0&&Lr(Ze)),_t!==a){if(Mr=[],J.test(n.charAt(Ke))?(jr=n.charAt(Ke),Ke++):(jr=a,ti===0&&Lr(yt)),jr!==a)for(;jr!==a;)Mr.push(jr),J.test(n.charAt(Ke))?(jr=n.charAt(Ke),Ke++):(jr=a,ti===0&&Lr(yt));else Mr=a;Mr!==a?(Ot=wi,wi=qe()):(Ke=wi,wi=a)}else Ke=wi,wi=a;return wi===a&&(wi=Ke,(_t=En())!==a&&(Ot=wi,_t=rt(_t)),(wi=_t)===a&&(wi=Ke,(_t=In())!==a&&(Ot=wi,_t=Dt()),wi=_t)),ti--,wi===a&&(_t=a,ti===0&&Lr(Ce)),wi}function ea(){var wi,_t,Mr,jr,Nn,Jn,ws;for(wi=Ke,he.test(n.charAt(Ke))?(n.charAt(Ke),Ke++):ti===0&&Lr(Ve),_t=Ke,Mr=[],xe.test(n.charAt(Ke))?(jr=n.charAt(Ke),Ke++):(jr=a,ti===0&&Lr(At));jr!==a;)Mr.push(jr),xe.test(n.charAt(Ke))?(jr=n.charAt(Ke),Ke++):(jr=a,ti===0&&Lr(At));if(n.charCodeAt(Ke)===46?(jr=_e,Ke++):(jr=a,ti===0&&Lr(ii)),jr!==a){if(Nn=[],xe.test(n.charAt(Ke))?(Jn=n.charAt(Ke),Ke++):(Jn=a,ti===0&&Lr(At)),Jn!==a)for(;Jn!==a;)Nn.push(Jn),xe.test(n.charAt(Ke))?(Jn=n.charAt(Ke),Ke++):(Jn=a,ti===0&&Lr(At));else Nn=a;Nn!==a?_t=Mr=[Mr,jr,Nn]:(Ke=_t,_t=a)}else Ke=_t,_t=a;if(_t===a)if(_t=[],xe.test(n.charAt(Ke))?(Mr=n.charAt(Ke),Ke++):(Mr=a,ti===0&&Lr(At)),Mr!==a)for(;Mr!==a;)_t.push(Mr),xe.test(n.charAt(Ke))?(Mr=n.charAt(Ke),Ke++):(Mr=a,ti===0&&Lr(At));else _t=a;if(_t!==a){if(Mr=Ke,n.charCodeAt(Ke)===101?(jr=Ie,Ke++):(jr=a,ti===0&&Lr(gt)),jr!==a){if(he.test(n.charAt(Ke))?(Nn=n.charAt(Ke),Ke++):(Nn=a,ti===0&&Lr(Ve)),Nn===a&&(Nn=null),Jn=[],xe.test(n.charAt(Ke))?(ws=n.charAt(Ke),Ke++):(ws=a,ti===0&&Lr(At)),ws!==a)for(;ws!==a;)Jn.push(ws),xe.test(n.charAt(Ke))?(ws=n.charAt(Ke),Ke++):(ws=a,ti===0&&Lr(At));else Jn=a;Jn!==a?Mr=jr=[jr,Nn,Jn]:(Ke=Mr,Mr=a)}else Ke=Mr,Mr=a;Mr===a&&(Mr=null),Ot=wi,wi=Vt()}else Ke=wi,wi=a;return wi}function zt(wi,_t){return wi.map(function(Mr){return Mr[_t]})}function Ha(wi,_t,Mr){return[wi].concat(zt(_t,Mr))}if((o=d())!==a&&Ke===n.length)return o;throw o!==a&&Ket*t,K3=t=>t*t*t,GH={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:EC(.001)},"square-centimeters":{inBaseUnits:EC(.01)},"square-decimeters":{inBaseUnits:EC(.1)},"square-meters":{inBaseUnits:1},"square-kilometers":{inBaseUnits:EC(1e3)},"square-inches":{inBaseUnits:EC(.0254)},"square-feet":{inBaseUnits:EC(.3048)},"square-yards":{inBaseUnits:EC(.9144)},"square-miles":{inBaseUnits:EC(1609.344)},"square-us-feet":{inBaseUnits:EC(1200/3937)},acres:{inBaseUnits:.0015625*EC(1609.344)},ares:{inBaseUnits:100},hectares:{inBaseUnits:1e4}}},volume:{baseUnit:"liters",units:{liters:{inBaseUnits:1},"cubic-millimeters":{inBaseUnits:1e3*K3(.001)},"cubic-centimeters":{inBaseUnits:1e3*K3(.01)},"cubic-decimeters":{inBaseUnits:1e3*K3(.1)},"cubic-meters":{inBaseUnits:1e3},"cubic-kilometers":{inBaseUnits:1e3*K3(1e3)},"cubic-inches":{inBaseUnits:1e3*K3(.0254)},"cubic-feet":{inBaseUnits:1e3*K3(.3048)},"cubic-yards":{inBaseUnits:1e3*K3(.9144)},"cubic-miles":{inBaseUnits:1e3*K3(1609.344)}}},angle:{baseUnit:"radians",units:{radians:{inBaseUnits:1},degrees:{inBaseUnits:Math.PI/180}}}},R$t=(()=>{const t={};for(const e in GH)for(const i in GH[e].units)t[i]=e;return t})();function M$t(t,e,i){return t*GH[i].units[e].inBaseUnits}function D$t(t,e,i){return t/GH[i].units[e].inBaseUnits}function _1e(t){const e=R$t[t];if(!e)throw new Error("unknown type");return e}function rGe(t,e=null){return e=e||_1e(t),GH[e].baseUnit===t}function X0(t,e,i){if(e===i)return t;const r=_1e(e);if(r!==_1e(i))throw new Error("incompatible units");const n=rGe(e,r)?t:M$t(t,e,r);return rGe(i,r)?n:D$t(n,i,r)}function F$t(t,e,i){return X0(t,e,"meters")/(i*Math.PI/180)}function nGe(t){return O$t.fromJSON(t.toLowerCase())||null}function J3(t){if(ve(t)&&!w$t(t))return 1;const e=Hc(t);return e>1e5?1:e}function L$t(t){return Hc(t)>=E$t(t).metersPerDegree?"meters":b1e(t)}function Hc(t,e=Mu.metersPerDegree){return zu(N$t(t,!0),e)}function N$t(t,e=!1){const i=ve(t)?t.wkid:null,r=ve(t)?t.wkt:null;let n=null;if(i){if(f1e(i))return tA.metersPerDegree;if(m1e(i))return X3.metersPerDegree;n=_L.values[_L[i]],!n&&e&&P$t.has(i)&&(n=A$t)}else r&&(lGe(r)?n=sGe(tGe.exec(r),n):aGe(r)&&(n=sGe(iGe.exec(r),n)));return n}function sGe(t,e){return t&&t[1]?oGe(t[1]):e}function oGe(t){return parseFloat(t.split(",")[1])}function b1e(t){const e=ve(t)?t.wkid:null,i=ve(t)?t.wkt:null;let r=null;if(e)r=_L.units[_L[e]];else if(i){const n=lGe(i)?tGe:aGe(i)?iGe:null;if(n){const s=n.exec(i);s&&s[1]&&(r=$$t(s[1]))}}return ve(r)?nGe(r):null}function aGe(t){return/^GEOCCS/i.test(t)}function lGe(t){return/^PROJCS/i.test(t)}const k$t=1e-7;function $$t(t){const e=/[\\"\\']{1}([^\\"\\']+)/.exec(t);let i=e&&e[1];if(!i||!_L.units.includes(i)){const r=oGe(t);i=null;const n=_L.values;for(let s=0;sS1e),r=t.options,n=r.responseType;r.signal=e?.signal,r.responseType=n==="native"||n==="native-request-init"?"native-request-init":n&&["blob","json","text"].includes(n)&&Gje(t.url)?.after?n:"array-buffer";const s=await i(t.url,r),o={data:s.data,httpStatus:s.httpStatus,ssl:s.ssl};switch(s.requestOptions?.responseType){case"native-request-init":return delete o.data.signal,o;case"blob":o.data=await o.data.arrayBuffer();break;case"json":o.data=new TextEncoder().encode(JSON.stringify(o.data)).buffer;break;case"text":o.data=new TextEncoder().encode(o.data).buffer}return{result:o,transferList:[o.data]}}};let Ho;function U$t(t){Ho=t}function z$t(t){const e=Ho&&Ho.findCredential(t);return e&&e.token?Wje(t,"token",e.token):t}Hi("host-webworker");const H$t=["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"];function hGe(t){const e=qb(t,!0);return!!e&&e.endsWith(".arcgis.com")&&!H$t.includes(e)&&!t.endsWith("/sharing/rest/generateToken")}function dGe(t,e,i=!1,r){return new Promise((n,s)=>{if(Im(r))return void s(pGe());let o=()=>{c(),s(new Error(`Unable to load ${e}`))},a=()=>{const h=t;c(),n(h)},l=()=>{if(!t)return;const h=t;c(),h.src="",s(pGe())};const c=()=>{Hi("esri-image-decode")||(t.removeEventListener("error",o),t.removeEventListener("load",a)),o=null,a=null,t=null,ve(r)&&r.removeEventListener("abort",l),l=null,i&&URL.revokeObjectURL(e)};ve(r)&&r.addEventListener("abort",l),Hi("esri-image-decode")?t.decode().then(a,o):(t.addEventListener("error",o),t.addEventListener("load",a))})}function pGe(){try{return new DOMException("Aborted","AbortError")}catch{const t=new Error;return t.name="AbortError",t}}function W$t(t){pa.request.crossOriginNoCorsDomains||(pa.request.crossOriginNoCorsDomains={});const e=pa.request.crossOriginNoCorsDomains;for(let i of t)i=i.toLowerCase(),/^https?:\/\//.test(i)?e[qb(i)??""]=0:(e[qb("http://"+i)??""]=0,e[qb("https://"+i)??""]=0)}function q$t(t){const e=pa.request.crossOriginNoCorsDomains;if(e){let i=qb(t);if(i)return i=i.toLowerCase(),!jy(i,i1e())&&e[i]o.abort());const a={controller:o,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:s,params:n,redoRequest:!1,useIdentity:Zx.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},l=await n8t(a);return s?.after?.(l),l}let one;const Zx=pa.request,fGe="FormData"in globalThis,X$t=[499,498,403,401],K$t=["COM_0056","COM_0057","SB_0008"],J$t=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],w1e=()=>null,ane=Symbol();function Z$t(t){const e=qb(t);e&&!ur._corsServers.includes(e)&&ur._corsServers.push(e)}function mGe(t){const e=qb(t);return!e||e.endsWith(".arcgis.com")||ur._corsServers.includes(e)||s1e(e)}function Qx(t,e,i,r){let n="Error";const s={url:i.url,requestOptions:i.requestOptions,getHeader:w1e,ssl:!1};if(e instanceof st)return e.details?(e.details=gi(e.details),e.details.url=i.url,e.details.requestOptions=i.requestOptions):e.details=s,e;if(e){const o=r&&(c=>r.headers.get(c)),a=r&&r.status,l=e.message;l&&(n=l),o&&(s.getHeader=o),s.httpStatus=(e.httpCode!=null?e.httpCode:e.code)||a||0,s.subCode=e.subcode,s.messageCode=e.messageCode,typeof e.details=="string"?s.messages=[e.details]:s.messages=e.details,s.raw=ane in e?e[ane]:e}return ys(e)?Sc():new st(t,n,s)}async function Q$t(){Hi("host-webworker")?one||(one=await Promise.resolve().then(()=>mIi)):ur._abortableFetch||(ur._abortableFetch=globalThis.fetch.bind(globalThis))}async function x1e(){Ho||await Promise.resolve().then(()=>UIi)}async function e8t(t){const e=t.params.url,i=t.params.requestOptions,r=t.controller.signal,n=i.body;let s=null,o=null;if(fGe&&"HTMLFormElement"in globalThis&&(n instanceof FormData?s=n:n instanceof HTMLFormElement&&(s=new FormData(n))),typeof n=="string"&&(o=n),t.fetchOptions={cache:i.cacheBust&&!ur._abortableFetch.polyfill?"no-cache":"default",credentials:"same-origin",headers:i.headers||{},method:i.method==="head"?"HEAD":"GET",mode:"cors",priority:Zx.priority,redirect:"follow",signal:r},(s||o)&&(t.fetchOptions.body=s||o),i.authMode==="anonymous"&&(t.useIdentity=!1),t.hasToken=!!(/token=/i.test(e)||i.query?.token||s?.get("token")),!t.hasToken&&pa.apiKey&&hGe(e)&&(i.query||(i.query={}),i.query.token=pa.apiKey,t.hasToken=!0),t.useIdentity&&!t.hasToken&&!t.credentialToken&&!gGe(e)&&!Im(r)){let a;i.authMode==="immediate"?(await x1e(),a=await Ho.getCredential(e,{signal:r}),t.credential=a):i.authMode==="no-prompt"?(await x1e(),a=await Ho.getCredential(e,{prompt:!1,signal:r}).catch(()=>{}),t.credential=a):Ho&&(a=Ho.findCredential(e)),a&&(t.credentialToken=a.token,t.useSSL=!!a.ssl)}}function gGe(t){return J$t.some(e=>e.test(t))}async function t8t(t){let e=t.params.url;const i=t.params.requestOptions,r=t.fetchOptions??{},n=TC(e)||A1(e),s=i.responseType||"json",o=n?0:i.timeout!=null?i.timeout:Zx.timeout;let a=!1;if(!n){t.useSSL&&(e=VH(e)),i.cacheBust&&r.cache==="default"&&(e=Wje(e,"request.preventCache",Date.now()));let y={...i.query};t.credentialToken&&(y.token=t.credentialToken);let v=Wv(y);Hi("esri-url-encodes-apostrophe")&&(v=v.replace(/'/g,"%27"));const x=e.length+1+v.length;let I;a=i.method==="delete"||i.method==="post"||i.method==="put"||!!i.body||x>Zx.maxUrlLength;const P=i.useProxy||!!BH(e);if(P){const F=e$t(e);I=F.path,!a&&I.length+1+x>Zx.maxUrlLength&&(a=!0),F.query&&(y={...F.query,...y})}if(r.method==="HEAD"&&(a||P)){if(a)throw x>Zx.maxUrlLength?Qx("request:invalid-parameters",new Error("URL exceeds maximum length"),t.params):Qx("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),t.params);if(P)throw Qx("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),t.params)}if(a?(r.method=i.method==="delete"?"DELETE":i.method==="put"?"PUT":"POST",i.body?e=zy(e,y):(r.body=Wv(y),r.headers||(r.headers={}),r.headers["Content-Type"]="application/x-www-form-urlencoded")):e=zy(e,y),P&&(t.useProxy=!0,e=`${I}?${e}`),y.token&&fGe&&r.body instanceof FormData&&!Fje(e)&&r.body.set("token",y.token),i.hasOwnProperty("withCredentials"))t.withCredentials=i.withCredentials;else if(!jy(e,i1e())){if(s1e(e))t.withCredentials=!0;else if(Ho){const F=Ho.findServerInfo(e);F&&F.webTierAuth&&(t.withCredentials=!0)}}t.withCredentials&&(r.credentials="include",q$t(e)&&await Y$t(a?zy(e,y):e))}let l,c,h=0,p=!1;o>0&&(h=setTimeout(()=>{p=!0,t.controller.abort()},o));try{if(i.responseType==="native-request-init")c=r,c.url=e;else if(i.responseType!=="image"||r.cache!=="default"||r.method!=="GET"||a||r8t(i.headers)||!n&&!t.useProxy&&Zx.proxyUrl&&!mGe(e)){if(l=await ur._abortableFetch(e,r),t.useProxy||Z$t(e),i.responseType==="native")c=l;else if(r.method!=="HEAD")if(l.ok){switch(s){case"array-buffer":c=await l.arrayBuffer();break;case"blob":case"image":c=await l.blob();break;default:c=await l.text()}if(h&&(clearTimeout(h),h=0),s==="json"||s==="xml"||s==="document")if(c)switch(s){case"json":c=JSON.parse(c);break;case"xml":c=yGe(c,"application/xml");break;case"document":c=yGe(c,"text/html")}else c=null;if(c){if(s==="array-buffer"||s==="blob"){const y=l.headers.get("Content-Type");if(y&&/application\/json|text\/plain/i.test(y)&&c[s==="blob"?"size":"byteLength"]<=750)try{const v=await new Response(c).json();v.error&&(c=v)}catch{}}s==="image"&&c instanceof Blob&&(c=await vGe(URL.createObjectURL(c),t,!0))}}else c=await l.text()}else c=await vGe(e,t)}catch(y){if(y.name==="AbortError")throw p?new Error("Timeout exceeded"):Sc("Request canceled");if(!(!l&&y instanceof TypeError&&Zx.proxyUrl)||i.body||i.method==="delete"||i.method==="head"||i.method==="post"||i.method==="put"||t.useProxy||mGe(e))throw y;t.redoRequest=!0,t$t({proxyUrl:Zx.proxyUrl,urlPrefix:qb(e)??""})}finally{h&&clearTimeout(h)}return[l,c]}async function i8t(t,e){if(t.responseData!=null)return t.responseData;if(t.headers&&(e.requestOptions.headers={...e.requestOptions.headers,...t.headers}),t.query&&(e.requestOptions.query={...e.requestOptions.query,...t.query}),t.before){let i,r;try{r=await t.before(e)}catch(n){i=Qx("request:interceptor",n,e)}if((r instanceof Error||r instanceof st)&&(i=Qx("request:interceptor",r,e)),i)throw t.error&&t.error(i),i;return r}}function r8t(t){if(t){for(const e of Object.getOwnPropertyNames(t))if(t[e])return!0}return!1}function yGe(t,e){let i;try{i=new DOMParser().parseFromString(t,e)}catch{}if(!i||i.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return i}async function n8t(t){let e,i;await e8t(t);try{do[e,i]=await t8t(t);while(!await s8t(t,e,i))}catch(s){const o=Qx("request:server",s,t.params,e);throw o.details.ssl=t.useSSL,t.interceptor&&t.interceptor.error&&t.interceptor.error(o),o}const r=t.params.url;if(i&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(r)){if(!t.hasToken&&!t.credentialToken&&i.user?.username&&!s1e(r)){const s=qb(r,!0);s&&Zx.trustedServers.push(s)}Array.isArray(i.authorizedCrossOriginNoCorsDomains)&&W$t(i.authorizedCrossOriginNoCorsDomains)}const n=t.credential;if(n&&Ho){const s=Ho.findServerInfo(n.server);let o=s&&s.owningSystemUrl;if(o){o=o.replace(/\/?$/,"/sharing");const a=Ho.findCredential(o,n.userId);a&&Ho._getIdenticalSvcIdx(o,a)===-1&&a.resources.unshift(o)}}return{data:i,getHeader:e?s=>e?.headers.get(s):w1e,httpStatus:e?.status??200,requestOptions:t.params.requestOptions,ssl:t.useSSL,url:t.params.url}}async function s8t(t,e,i){if(t.redoRequest)return t.redoRequest=!1,!1;const r=t.params.requestOptions;if(!e||r.responseType==="native"||r.responseType==="native-request-init")return!0;let n,s;if(!e.ok)throw n=new Error(`Unable to load ${e.url} status: ${e.status}`),n[ane]=i,n;i&&(i.error?n=i.error:i.status==="error"&&Array.isArray(i.messages)&&(n={...i},n[ane]=i,n.details=i.messages));let o,a=null;n&&(s=Number(n.code),a=n.hasOwnProperty("subcode")?Number(n.subcode):null,o=n.messageCode,o=o&&o.toUpperCase());const l=r.authMode;if(s===403&&(a===4||n.message&&n.message.toLowerCase().includes("ssl")&&!n.message.toLowerCase().includes("permission"))){if(!t.useSSL)return t.useSSL=!0,!1}else if(!t.hasToken&&t.useIdentity&&(l!=="no-prompt"||s===498)&&s!==void 0&&X$t.includes(s)&&!gGe(t.params.url)&&(s!==403||o&&!K$t.includes(o)&&(a==null||a===2&&t.credentialToken))){await x1e();try{const c=await Ho.getCredential(t.params.url,{error:Qx("request:server",n,t.params),prompt:l!=="no-prompt",signal:t.controller.signal,token:t.credentialToken});return t.credential=c,t.credentialToken=c.token,t.useSSL=t.useSSL||c.ssl,!1}catch(c){if(l==="no-prompt")return t.credential=void 0,t.credentialToken=void 0,!1;n=c}}if(n)throw n;return!0}function vGe(t,e,i=!1){const r=e.controller.signal,n=new Image;return e.withCredentials?n.crossOrigin="use-credentials":n.crossOrigin="anonymous",n.alt="",n.fetchPriority=Zx.priority,n.src=t,dGe(n,t,i,r)}ur._abortableFetch=null,ur._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"];const S1e=Object.freeze(Object.defineProperty({__proto__:null,default:ur},Symbol.toStringTag,{value:"Module"}));function Vi(t,e,i){let r,n;return e===void 0||Array.isArray(e)?(n=t,i=e,r=[void 0]):(n=e,r=Array.isArray(t)?t:[t]),(s,o)=>{const a=s.constructor.prototype;r.forEach(l=>{const c=k_e(s,l,n);c.read&&typeof c.read=="object"||(c.read={}),c.read.reader=a[o],i&&(c.read.source=(c.read.source||[]).concat(i))})}}let AC=class extends Ui{constructor(...e){super(...e),this.type=null,this.hasM=!1,this.hasZ=!1,this.spatialReference=hr.WGS84}get cache(){return this.commitProperty("spatialReference"),{}}get extent(){return null}readSpatialReference(e,i){if(e instanceof hr)return e;if(e!=null){const r=new hr;return r.read(e,i),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,i){this.cache[e]=i}};E([N()],AC.prototype,"type",void 0),E([N({readOnly:!0})],AC.prototype,"cache",null),E([N({readOnly:!0})],AC.prototype,"extent",null),E([N({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],AC.prototype,"hasM",void 0),E([N({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],AC.prototype,"hasZ",void 0),E([N({type:hr,json:{write:!0},value:hr.WGS84})],AC.prototype,"spatialReference",void 0),E([Vi("spatialReference")],AC.prototype,"readSpatialReference",null),AC=E([dt("esri.geometry.Geometry")],AC);const un=AC,o8t=Object.prototype.toString;function a8t(t){const e="__accessorMetadata__"in t?fd(t):t;return function(...i){if(i.push(e),typeof i[2]=="number")throw new Error("Using @cast has parameter decorator is not supported since 4.16");return l8t.apply(this,i)}}function l8t(t,e,i,r){xH(t,e).cast=r}function u8t(t){return(e,i)=>{xH(e,t).cast=e[i]}}function ho(...t){if(t.length!==3||typeof t[1]!="string")return t.length===1&&o8t.call(t[0])==="[object Function]"?a8t(t[0]):t.length===1&&typeof t[0]=="string"?u8t(t[0]):void 0}function c8t(t,e){const i=t.x-e.x,r=t.y-e.y,n=t.hasZ&&e.hasZ?t.z-e.z:0;return Math.sqrt(i*i+r*r+n*n)}const h8t=57.29577951308232,d8t=.017453292519943;function _Ge(t){return t*h8t}function bGe(t){return t*d8t}function wGe(t){return t/Mu.radius}function C1e(t){return Math.PI/2-2*Math.atan(Math.exp(-t/Mu.radius))}function T1e(t){return t.wkid!=null||t.wkt!=null}const E1e=[0,0];function lne(t,e,i,r,n){const s=t,o=n;if(o.spatialReference=i,"x"in s&&"x"in o)[o.x,o.y]=e(s.x,s.y,E1e,r);else if("xmin"in s&&"xmin"in o)[o.xmin,o.ymin]=e(s.xmin,s.ymin,E1e,r),[o.xmax,o.ymax]=e(s.xmax,s.ymax,E1e,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 c;for(let h=0;h2&&c[y].push(p[y][2]),p[y].length>3&&c[y].push(p[y][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 c=0;c2&&l[c].push(a[c][2]),a[c].length>3&&l[c].push(a[c][3]);o.points=l}return n}function V8(t,e){const i=t&&(T1e(t)?t:t.spatialReference),r=e&&(T1e(e)?e:e.spatialReference);return!(t&&"type"in t&&t.type==="mesh"||e&&"type"in e&&e.type==="mesh"||!i||!r)&&(!!Da(r,i)||Xb(r)&&B8(i)||Xb(i)&&B8(r))}function bL(t,e){if(lt(t))return null;const i=t.spatialReference,r=e&&(T1e(e)?e:e.spatialReference);return V8(i,r)?Da(i,r)?gi(t):Xb(r)?lne(t,Z3,hr.WebMercator,!1,gi(t)):B8(r)?lne(t,j8,hr.WGS84,!1,gi(t)):null:null}function Z3(t,e,i=[0,0]){e>89.99999?e=89.99999:e<-89.99999&&(e=-89.99999);const r=bGe(e);return i[0]=bGe(t)*Mu.radius,i[1]=Mu.halfSemiMajorAxis*Math.log((1+Math.sin(r))/(1-Math.sin(r))),i}function j8(t,e,i=[0,0],r=!1){const n=_Ge(t/Mu.radius);return i[0]=r?n:n-360*Math.floor((n+180)/360),i[1]=_Ge(Math.PI/2-2*Math.atan(Math.exp(-e/Mu.radius))),i}function Q3(t,e=!1,i=gi(t)){return lne(t,Z3,hr.WebMercator,e,i)}function wL(t,e=!1,i=gi(t)){return lne(t,j8,hr.WGS84,e,i)}var une;const HH=[0,0];function xGe(t){return t&&(t.declaredClass==="esri.geometry.SpatialReference"||t.wkid!=null)}let K0=une=class extends un{static copy(t,e){e._set("x",t._get("x")),e._set("y",t._get("y")),e._set("z",t._get("z")),e._set("m",t._get("m"));const i=t._get("spatialReference");e._set("spatialReference",Object.isFrozen(i)?i:i.clone())}constructor(...t){super(...t),this.x=0,this.y=0,this.z=void 0,this.m=void 0,this.type="point"}normalizeCtorArgs(t,e,i,r,n){let s;if(Array.isArray(t))s=t,n=e,t=s[0],e=s[1],i=s[2],r=s[3];else if(t&&typeof t=="object"){if(s=t,t=s.x!=null?s.x:s.longitude,e=s.y!=null?s.y:s.latitude,i=s.z,r=s.m,(n=s.spatialReference)&&n.declaredClass!=="esri.geometry.SpatialReference"&&(n=new hr(n)),s.longitude!=null||s.latitude!=null){if(s.longitude==null)Oi.getLogger(this.declaredClass).warn(".longitude=","Latitude was defined without longitude");else if(s.latitude==null)Oi.getLogger(this.declaredClass).warn(".latitude=","Longitude was defined without latitude");else if(!s.declaredClass&&n&&n.isWebMercator){const a=Z3(s.longitude,s.latitude,HH);t=a[0],e=a[1]}}}else xGe(i)?(n=i,i=null):xGe(r)&&(n=r,r=null);const o={x:t,y:e};return o.x==null&&o.y!=null?Oi.getLogger(this.declaredClass).warn(".y=","Y coordinate was defined without an X coordinate"):o.y==null&&o.x!=null&&Oi.getLogger(this.declaredClass).warn(".x=","X coordinate was defined without a Y coordinate"),n!=null&&(o.spatialReference=n),i!=null&&(o.z=i),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(t){t!==(this._get("m")!==void 0)&&(this._set("m",t?0:void 0),this._set("hasM",t))}get hasZ(){return this.z!==void 0}set hasZ(t){t!==(this._get("z")!==void 0)&&(this._set("z",t?0:void 0),this._set("hasZ",t))}get latitude(){const{spatialReference:t,x:e,y:i}=this;if(t){if(t.isWebMercator)return j8(e,i,HH)[1];if(t.isGeographic)return i}return null}set latitude(t){const{spatialReference:e,x:i}=this;t!=null&&e&&(e.isWebMercator?this._set("y",Z3(i,t,HH)[1]):e.isGeographic&&this._set("y",t),this._set("latitude",t))}get longitude(){const{x:t,y:e,spatialReference:i}=this;if(i){if(i.isWebMercator)return j8(t,e,HH)[0];if(i.isGeographic)return t}return null}set longitude(t){const{y:e,spatialReference:i}=this;t!=null&&i&&(i.isWebMercator?this._set("x",Z3(t,e,HH)[0]):i.isGeographic&&this._set("x",t),this._set("longitude",t))}writeX(t,e,i){e[i]=isNaN(t)?"NaN":t}readX(t){return typeof t=="string"?NaN:t}clone(){const t=new une;return t.x=this.x,t.y=this.y,t.z=this.z,t.m=this.m,t.spatialReference=this.spatialReference,t}copy(t){return une.copy(t,this),this}equals(t){if(lt(t))return!1;const{x:e,y:i,z:r,m:n,spatialReference:s}=this,{z:o,m:a}=t;let{x:l,y:c,spatialReference:h}=t;if(!s.equals(h))if(s.isWebMercator&&h.isWGS84)[l,c]=Z3(l,c),h=s;else{if(!s.isWGS84||!h.isWebMercator)return!1;[l,c]=j8(l,c),h=s}return e===l&&i===c&&r===o&&n===a&&s.wkid===h.wkid}offset(t,e,i){return this.x+=t,this.y+=e,i!=null&&(this.z=(this.z??0)+i),this}normalize(){if(!this.spatialReference)return this;const t=vd(this.spatialReference);if(!t)return this;let e=this.x;const[i,r]=t.valid,n=2*r;let s;return e>r?(s=Math.ceil(Math.abs(e-r)/n),e-=s*n):eisNaN(t)?t:jd(t))],K0.prototype,"x",void 0),E([Cr("x")],K0.prototype,"writeX",null),E([Vi("x")],K0.prototype,"readX",null),E([N({type:Number,json:{write:!0}})],K0.prototype,"y",void 0),E([N({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasZ}}}}})],K0.prototype,"z",void 0),E([N({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasM}}}}})],K0.prototype,"m",void 0),K0=une=E([dt("esri.geometry.Point")],K0),K0.prototype.toJSON.isDefaultToJSON=!0;const er=K0,I1e=[0,0];function WH(t,e){return!!ve(e)&&J0(t,e.x,e.y,e.z)}function p8t(t,e){if(!e.points||e.points.length)return!1;for(const i of e.points)if(!G8(t,i))return!1;return!0}function f8t(t,e){const{xmin:i,ymin:r,zmin:n,xmax:s,ymax:o,zmax:a}=e;return t.hasZ&&e.hasZ?J0(t,i,r,n)&&J0(t,i,o,n)&&J0(t,s,o,n)&&J0(t,s,r,n)&&J0(t,i,r,a)&&J0(t,i,o,a)&&J0(t,s,o,a)&&J0(t,s,r,a):J0(t,i,r)&&J0(t,i,o)&&J0(t,s,o)&&J0(t,s,r)}function G8(t,e){return J0(t,e[0],e[1])}function m8t(t,e){return J0(t,e[0],e[1],e[2])}function J0(t,e,i,r){return e>=t.xmin&&e<=t.xmax&&i>=t.ymin&&i<=t.ymax&&(r==null||!t.hasZ||r>=t.zmin&&r<=t.zmax)}function SGe(t,e){return I1e[1]=e.y,I1e[0]=e.x,g8t(t,I1e)}function g8t(t,e){return A1e(t.rings,e)}function A1e(t,e){if(!t)return!1;if(y8t(t))return CGe(!1,t,e);let i=!1;for(let r=0,n=t.length;r=n||y=n)&&c+(n-h)/(y-h)*(p-c)=0&&V<=1&&Y>=0&&Y<=1&&(n&&(n[0]=s+V*(a-s),n[1]=o+V*(l-o)),!0)}function AGe(t){switch(t){case"esriGeometryEnvelope":case"extent":return TGe;case"esriGeometryMultipoint":case"multipoint":return _8t;case"esriGeometryPoint":case"point":return v8t;case"esriGeometryPolygon":case"polygon":return P1e;case"esriGeometryPolyline":case"polyline":return x8t}}var Kb;function C8t(t){return t&&(t.declaredClass==="esri.geometry.SpatialReference"||t.wkid!=null)}function eR(t,e,i){return e==null?i:i==null?e:t(e,i)}let Pm=Kb=class extends un{constructor(...t){super(...t),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(t,e,i,r,n){return C8t(t)?{spatialReference:t,xmin:0,ymin:0,xmax:0,ymax:0}:typeof t=="object"?(t.spatialReference=t.spatialReference==null?hr.WGS84:t.spatialReference,t):{xmin:t,ymin:e,xmax:i,ymax:r,spatialReference:n??hr.WGS84}}static fromBounds(t,e){return new Kb({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3],spatialReference:e})}static fromPoint(t){return new Kb({xmin:t.x,ymin:t.y,zmin:t.z,xmax:t.x,ymax:t.y,zmax:t.z,spatialReference:t.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 t=new er({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(t.z=.5*(this.zmin+this.zmax)),this.hasM&&(t.m=.5*(this.mmin+this.mmax)),t}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(t){const e=this.center;return t.z!=null&&this.hasZ?this.offset(t.x-e.x,t.y-e.y,t.z-e.z):this.offset(t.x-e.x,t.y-e.y)}clone(){const t=new Kb;return t.xmin=this.xmin,t.ymin=this.ymin,t.xmax=this.xmax,t.ymax=this.ymax,t.spatialReference=this.spatialReference,this.zmin!=null&&(t.zmin=this.zmin,t.zmax=this.zmax),this.mmin!=null&&(t.mmin=this.mmin,t.mmax=this.mmax),t}contains(t){if(!t)return!1;const e=this.spatialReference,i=t.spatialReference;return e&&i&&!e.equals(i)&&V8(e,i)&&(t=e.isWebMercator?Q3(t):wL(t,!0)),t.type==="point"?WH(this,t):t.type==="extent"&&f8t(this,t)}equals(t){if(this===t)return!0;if(lt(t))return!1;const e=this.spatialReference,i=t.spatialReference;return e&&i&&!e.equals(i)&&V8(e,i)&&(t=e.isWebMercator?Q3(t):wL(t,!0)),this.xmin===t.xmin&&this.ymin===t.ymin&&this.zmin===t.zmin&&this.mmin===t.mmin&&this.xmax===t.xmax&&this.ymax===t.ymax&&this.zmax===t.zmax&&this.mmax===t.mmax}expand(t){const e=.5*(1-t),i=this.width*e,r=this.height*e;if(this.xmin+=i,this.ymin+=r,this.xmax-=i,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(t){if(lt(t))return!1;t.type==="mesh"&&(t=t.extent);const e=this.spatialReference,i=t.spatialReference;return e&&i&&!Da(e,i)&&V8(e,i)&&(t=e.isWebMercator?Q3(t):wL(t,!0)),AGe(t.type)(this,t)}normalize(){const t=this._normalize(!1,!0);return Array.isArray(t)?t:[t]}offset(t,e,i){return this.xmin+=t,this.ymin+=e,this.xmax+=t,this.ymax+=e,i!=null&&(this.zmin+=i,this.zmax+=i),this}shiftCentralMeridian(){return this._normalize(!0)}union(t){return this===t||(this.xmin=Math.min(this.xmin,t.xmin),this.ymin=Math.min(this.ymin,t.ymin),this.xmax=Math.max(this.xmax,t.xmax),this.ymax=Math.max(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=eR(Math.min,this.zmin,t.zmin),this.zmax=eR(Math.max,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=eR(Math.min,this.mmin,t.mmin),this.mmax=eR(Math.max,this.mmax,t.mmax))),this}intersection(t){return this===t?this:lt(t)||!this.intersects(t)?null:(this.xmin=Math.max(this.xmin,t.xmin),this.ymin=Math.max(this.ymin,t.ymin),this.xmax=Math.min(this.xmax,t.xmax),this.ymax=Math.min(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=eR(Math.max,this.zmin,t.zmin),this.zmax=eR(Math.min,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=eR(Math.max,this.mmin,t.mmin),this.mmax=eR(Math.min,this.mmax,t.mmax)),this)}toJSON(t){return this.write({},t)}_shiftCM(t=vd(this.spatialReference)){if(!t||!this.spatialReference)return this;const e=this.spatialReference,i=this._getCM(t);if(i){const r=e.isWebMercator?wL(i):i;this.xmin-=i.x,this.xmax-=i.x,e.isWebMercator||(r.x=this._normalizeX(r.x,t).x),this.spatialReference=new hr(Xx((e.isWGS84?t.altTemplate:null)??t.wkTemplate,{Central_Meridian:r.x}))}return this}_getCM(t){let e=null;const[i,r]=t.valid,n=this.xmin,s=this.xmax;return n>=i&&n<=r&&s>=i&&s<=r||(e=this.center),e}_normalize(t,e,i){const r=this.spatialReference;if(!r)return this;const n=i??vd(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 t?this._shiftCM(n):this.set({xmin:n.valid[0],xmax:n.valid[1]});if(t)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 c=[[l.xmin,l.ymin],[l.xmin,l.ymax],[l.xmax,l.ymax],[l.xmax,l.ymin],[l.xmin,l.ymin]];if(o){const h=(l.zmax-l.zmin)/2;for(let p=0;p0;if(a>2*y){const k=new Kb(lI||F?e.push({extent:new Kb(v,n,y,s,o),frameIds:[x]},{extent:new Kb(p,n,I,s,o),frameIds:[P]}):e.push({extent:new Kb(v,n,I,s,o),frameIds:[x]});this.cache._parts=e}const i=this.hasZ,r=this.hasM;if(i||r){const n={};i&&(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(t-r)/n),t-=s*n,o=s):t{e.call(null,t)}),[...YH].forEach(e=>{e.call(null,t)}))}globalThis.addEventListener?.("languagechange",E8t);var M1e;const I8t=new Ks({avgRating:"avg-rating",numRatings:"num-ratings",numComments:"num-comments",numViews:"num-views"});let Jb=M1e=class extends Tn{constructor(t){super(t),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(t){t!=="asc"&&t!=="desc"||this._set("sortOrder",t)}clone(){return new M1e({categories:this.categories?gi(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(t,e){let i=[];this.categories&&(i=this.categories.map(o=>Array.isArray(o)?JSON.stringify(o):o));let r="";if(this.extent){const o=bL(this.extent,hr.WGS84);ve(o)&&(r=`${o.xmin},${o.ymin},${o.xmax},${o.ymax}`)}let n=this.query;!this.disableExtraQuery&&t.extraQuery&&(n="("+n+")"+t.extraQuery);const s={categories:i,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=>I8t.toJSON(o.trim())).join(","),s.sortOrder=this.sortOrder),{query:{...e,...s}}}};E([N()],Jb.prototype,"categories",void 0),E([N()],Jb.prototype,"disableExtraQuery",void 0),E([N({type:Ar})],Jb.prototype,"extent",void 0),E([N()],Jb.prototype,"filter",void 0),E([N()],Jb.prototype,"num",void 0),E([N()],Jb.prototype,"query",void 0),E([N()],Jb.prototype,"sortField",void 0),E([N()],Jb.prototype,"sortOrder",null),E([N()],Jb.prototype,"start",void 0),Jb=M1e=E([dt("esri.portal.PortalQueryParams")],Jb);const rA=Jb;let EL=class extends Tn{constructor(e){super(e),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};E([N()],EL.prototype,"nextQueryParams",void 0),E([N()],EL.prototype,"queryParams",void 0),E([N()],EL.prototype,"results",void 0),E([N()],EL.prototype,"total",void 0),EL=E([dt("esri.portal.PortalQueryResult")],EL);const A8t=EL;let nA=class extends Ui{constructor(e){super(e),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){const e=this.get("portal.restUrl");return e?`${e}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new st("internal:not-yet-implemented","PortalFolder.toJSON is not yet implemented")}};E([N({type:Date})],nA.prototype,"created",void 0),E([N()],nA.prototype,"id",void 0),E([N()],nA.prototype,"portal",void 0),E([N()],nA.prototype,"title",void 0),E([N({readOnly:!0})],nA.prototype,"url",null),E([N()],nA.prototype,"username",void 0),nA=E([dt("esri.portal.PortalFolder")],nA);const P8t=nA;let Om=class extends Ui{constructor(e){super(e),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.tags=null,this.title=null}get thumbnailUrl(){const e=this.url,i=this.thumbnail;return e&&i&&this.portal?this.portal?.normalizeUrl(`${e}/info/${i}?f=json`):null}get url(){const e=this.get("portal.restUrl");return e?e+"/community/groups/"+this.id:null}fetchCategorySchema(e){return Ou(this.portal).request(this.url+"/categorySchema",e).then(i=>{const r=i.categorySchema||[];return r.some(n=>n.source==="contentCategorySetsGroupQuery.LivingAtlas")?this._fetchCategorySchemaSet("LivingAtlas",e):r})}fetchMembers(e){return Ou(this.portal).request(this.url+"/users",e)}getThumbnailUrl(e){let i=this.thumbnailUrl;return i&&e&&(i+=`&w=${e}`),i}toJSON(){throw new st("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}queryItems(e,i){let r=fd(rA,e);const n=Ou(this.portal);return parseFloat(n.currentVersion)>5?(r=r||new rA,n.queryPortal(`/content/groups/${this.id}/search`,r,"PortalItem",i)):(r=r?r.clone():new rA,r.query="group:"+this.id+(r.query?" "+r.query:""),n.queryItems(r,i))}_fetchCategorySchemaSet(e,i){const r=Ou(this.portal);return r.fetchSelf(r.authMode,!0,i).then(n=>{const s=n.contentCategorySetsGroupQuery;if(s){const o=new rA;return o.disableExtraQuery=!0,o.num=1,o.query=s,r.queryGroups(o,i)}throw new st("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery value not found")}).then(n=>{if(n.total){const s=n.results[0],o=new rA;return o.num=1,o.query=`typekeywords:"${e}"`,s.queryItems(o,i)}throw new st("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery group not found")}).then(n=>n.total?n.results[0].fetchData("json",i).then(s=>{const o=s&&s.categorySchema;return o&&o.length?o:[]}):[])}};E([N()],Om.prototype,"access",void 0),E([N({type:Date})],Om.prototype,"created",void 0),E([N()],Om.prototype,"description",void 0),E([N()],Om.prototype,"id",void 0),E([N()],Om.prototype,"isInvitationOnly",void 0),E([N({type:Date})],Om.prototype,"modified",void 0),E([N()],Om.prototype,"owner",void 0),E([N()],Om.prototype,"portal",void 0),E([N()],Om.prototype,"snippet",void 0),E([N()],Om.prototype,"sortField",void 0),E([N()],Om.prototype,"sortOrder",void 0),E([N()],Om.prototype,"tags",void 0),E([N()],Om.prototype,"thumbnail",void 0),E([N({readOnly:!0})],Om.prototype,"thumbnailUrl",null),E([N()],Om.prototype,"title",void 0),E([N({readOnly:!0})],Om.prototype,"url",null),Om=E([dt("esri.portal.PortalGroup")],Om);const D1e=Om,O8t=Object.freeze(Object.defineProperty({__proto__:null,default:D1e},Symbol.toStringTag,{value:"Module"}));var F1e;let Gh=F1e=class extends Ui{constructor(...t){super(...t),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 t=this.url,e=this.thumbnail;return t&&e?this.portal.normalizeUrl(`${t}/info/${e}?f=json`):null}get userContentUrl(){const t=this.get("portal.restUrl");return t?`${t}/content/users/${this.username}`:null}get url(){const t=this.get("portal.restUrl");return t?`${t}/community/users/${this.username}`:null}addItem(t){const e=t&&t.item,i=t&&t.data,r=t&&t.folder,n={method:"post"};e&&(n.query=e.createPostQuery(),i!=null&&(typeof i=="string"?n.query.text=i:typeof i=="object"&&(n.query.text=JSON.stringify(i))));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(t){let e=this.userContentUrl;return t.ownerFolder&&(e+="/"+t.ownerFolder),this.portal.request(e+`/items/${t.id}/delete`,{method:"post"}).then(()=>{t.id=null,t.portal=null})}deleteItems(t){const e=this.userContentUrl+"/deleteItems",i=t.map(r=>r.id);if(i.length){const r={method:"post",query:{items:i.join(",")}};return this.portal.request(e,r).then(()=>{t.forEach(n=>{n.id=null,n.portal=null})})}return Promise.resolve(void 0)}fetchFolders(){const t={query:{num:1}};return this.portal.request(this.userContentUrl??"",t).then(e=>{let i;return i=e&&e.folders?e.folders.map(r=>{const n=P8t.fromJSON(r);return n.portal=this.portal,n}):[],i})}fetchGroups(){return this.portal.request(this.url??"").then(t=>{let e;return e=t&&t.groups?t.groups.map(i=>{const r=D1e.fromJSON(i);return r.portal=this.portal,r}):[],e})}fetchItems(t){const e=t??{};let i,r=this.userContentUrl??"";return e.folder&&(r+="/"+e.folder.id),Promise.resolve().then(()=>MGe).then(({default:n})=>{i=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&&n.items?(s=n.items.map(o=>{const a=i.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(t=>t.tags)}getThumbnailUrl(t){let e=this.thumbnailUrl;return e&&t&&(e+=`&w=${t}`),e}queryFavorites(t){return this.favGroupId?(this._favGroup||(this._favGroup=new D1e({id:this.favGroupId,portal:this.portal})),this._favGroup.queryItems(t)):Promise.reject(new st("internal:unknown","Unknown internal error",{internalError:"Unknown favGroupId"}))}toJSON(){throw new st("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");const e=new F1e;return e.sourceJSON=t,e.read(t),e}};E([N()],Gh.prototype,"access",void 0),E([N({type:Date})],Gh.prototype,"created",void 0),E([N()],Gh.prototype,"culture",void 0),E([N()],Gh.prototype,"description",void 0),E([N()],Gh.prototype,"email",void 0),E([N()],Gh.prototype,"favGroupId",void 0),E([N()],Gh.prototype,"fullName",void 0),E([N({type:Date})],Gh.prototype,"modified",void 0),E([N()],Gh.prototype,"orgId",void 0),E([N()],Gh.prototype,"portal",void 0),E([N()],Gh.prototype,"preferredView",void 0),E([N()],Gh.prototype,"privileges",void 0),E([N()],Gh.prototype,"region",void 0),E([N()],Gh.prototype,"role",void 0),E([N()],Gh.prototype,"roleId",void 0),E([N()],Gh.prototype,"sourceJSON",void 0),E([N()],Gh.prototype,"thumbnail",void 0),E([N({readOnly:!0})],Gh.prototype,"thumbnailUrl",null),E([N()],Gh.prototype,"units",void 0),E([N({readOnly:!0})],Gh.prototype,"userContentUrl",null),E([N({readOnly:!0})],Gh.prototype,"url",null),E([N()],Gh.prototype,"username",void 0),E([N()],Gh.prototype,"userType",void 0),Gh=F1e=E([dt("esri.portal.PortalUser")],Gh);const L1e=Gh,R8t=Object.freeze(Object.defineProperty({__proto__:null,default:L1e},Symbol.toStringTag,{value:"Module"}));var O1;let N1e;const RGe={PortalGroup:()=>Promise.resolve().then(()=>O8t),PortalItem:()=>Promise.resolve().then(()=>MGe),PortalUser:()=>Promise.resolve().then(()=>R8t)};let $n=O1=class extends Y0(gd){constructor(t){super(t),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=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.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=pa.portalUrl,this.urlKey=null,this.user=null,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(t){return typeof t=="string"?{url:t}:t}destroy(){this._esriIdCredentialCreateHandle=Uc(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(t){if(t)for(const e of t)pa.request.trustedServers.includes(e)||pa.request.trustedServers.push(e);return t}readDefaultBasemap(t){return this._readBasemap(t)}readDefaultDevBasemap(t){return this._readBasemap(t)}readDefaultVectorBasemap(t){return this._readBasemap(t)}get extraQuery(){const t=!(this.user&&this.user.orgId)||this.canSearchPublic;return this.id&&!t?` AND orgid:${this.id}`:null}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get restUrl(){let t=this.url;if(t){const e=t.indexOf("/sharing");t=e>0?t.substring(0,e):this.url.replace(/\/+$/,""),t+="/sharing/rest"}return t}get thumbnailUrl(){const t=this.restUrl,e=this.thumbnail;return t&&e?this._normalizeSSL(t+"/portals/self/resources/"+e):null}readUrlKey(t){return t&&t.toLowerCase()}readUser(t){let e=null;return t&&(e=L1e.fromJSON(t),e.portal=this),e}load(t){const e=Promise.resolve().then(()=>Q8t).then(({default:i})=>{yn(t),N1e=i}).then(()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,t)).then(i=>{if(Ho){const r=Ho;this.credential=r.findCredential(this.restUrl),this.credential||this.authMode!==O1.AUTH_MODE_AUTO||(this._esriIdCredentialCreateHandle=r.on("credential-create",()=>{r.findCredential(this.restUrl)&&this.signIn().catch(()=>{})}))}this.sourceJSON=i,this.read(i)});return this.addResolvingPromise(e),Promise.resolve(this)}async createElevationLayers(){await this.load();const t=this._getHelperService("defaultElevationLayers"),e=(await Promise.resolve().then(()=>Ept)).default;return t?t.map(i=>new e({id:i.id,url:i.url})):[]}fetchBasemaps(t,e){const i=new rA;return i.query=t||(pa.apiKey&&hGe(this.url)?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),i.disableExtraQuery=!0,this.queryGroups(i,e).then(r=>{if(i.num=100,i.query='type:"Web Map" -type:"Web Application"',r.total){const n=r.results[0];return i.sortField=n.sortField||"name",i.sortOrder=n.sortOrder||"desc",n.queryItems(i,e)}return null}).then(r=>{let n;return n=r&&r.total?r.results.filter(s=>s.type==="Web Map").map(s=>new N1e({portalItem:s})):[],n})}fetchCategorySchema(t){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",t).then(e=>e.categorySchema):Im(t)?Promise.reject(Sc()):Promise.resolve([])}fetchFeaturedGroups(t){const e=this.featuredGroups,i=new rA;if(i.num=100,i.sortField="title",e&&e.length){const r=[];for(const n of e)r.push(`(title:"${n.title}" AND owner:${n.owner})`);return i.query=r.join(" OR "),this.queryGroups(i,t).then(n=>n.results)}return Im(t)?Promise.reject(Sc()):Promise.resolve([])}fetchRegions(t){const e=this.user?.culture||this.culture||Z0();return this.request(this.restUrl+"/portals/regions",{...t,query:{culture:e}})}fetchSettings(t){const e=this.user?.culture||this.culture||Z0();return this.request(this.restUrl+"/portals/self/settings",{...t,query:{culture:e}})}static getDefault(){return O1._default&&!O1._default.destroyed||(O1._default=new O1),O1._default}queryGroups(t,e){return this.queryPortal("/community/groups",t,"PortalGroup",e)}queryItems(t,e){return this.queryPortal("/search",t,"PortalItem",e)}queryUsers(t,e){return t.sortField||(t.sortField="username"),this.queryPortal("/community/users",t,"PortalUser",e)}fetchSelf(t=this.authMode,e=!1,i){const r=this.restUrl+"/portals/self",n={authMode:t,query:{culture:Z0().toLowerCase()},...i};return n.authMode==="auto"&&(n.authMode="no-prompt"),e&&(n.query.default=!0),this.request(r,n)}queryPortal(t,e,i,r){const n=fd(rA,e),s=o=>this.request(this.restUrl+t,{...n.toRequestOptions(this),...r}).then(a=>{const l=n.clone();return l.start=a.nextStart,new A8t({nextQueryParams:l,queryParams:n,total:a.total,results:O1._resultsToTypedArray(o,{portal:this},a,r)})}).then(a=>Promise.all(a.results.map(l=>typeof l.when=="function"?l.when():a)).then(()=>a,l=>(Ya(l),a)));return i&&RGe[i]?RGe[i]().then(({default:o})=>(yn(r),s(o))):s()}signIn(){if(this.authMode===O1.AUTH_MODE_ANONYMOUS)return Promise.reject(new st("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if(this.loadStatus==="failed")return Promise.reject(this.loadError);const t=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(i=>{i&&(this.sourceJSON=i,this.read(i))});return Ho?Ho.getCredential(this.restUrl).then(e=>t(e)):t(this.credential)}normalizeUrl(t){const e=this.credential&&this.credential.token;return this._normalizeSSL(e?t+(t.includes("?")?"&":"?")+"token="+e:t)}requestToTypedArray(t,e,i){return this.request(t,e).then(r=>{const n=O1._resultsToTypedArray(i,{portal:this},r);return Promise.all(n.map(s=>typeof s.when=="function"?s.when():r)).then(()=>n,()=>n)})}request(t,e={}){const i={f:"json",...e.query},{authMode:r=this.authMode===O1.AUTH_MODE_ANONYMOUS?"anonymous":"auto",body:n=null,cacheBust:s=!1,method:o="auto",responseType:a="json",signal:l}=e,c={authMode:r,body:n,cacheBust:s,method:o,query:i,responseType:a,timeout:0,signal:l};return ur(this._normalizeSSL(t),c).then(h=>h.data)}toJSON(){throw new st("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");return new O1({sourceJSON:t})}_getHelperService(t){const e=this.helperServices&&this.helperServices[t];if(!e)throw new st("portal:service-not-found",`The \`helperServices\` do not include an entry named "${t}"`);return e}_normalizeSSL(t){return t.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(t){if(t){const e=N1e.fromJSON(t);return e.portalItem={portal:this},e}return null}static _resultsToTypedArray(t,e,i,r){let n=[];if(i){const s=ve(r)?r.signal:null;n=i.listings||i.notifications||i.userInvitations||i.tags||i.items||i.groups||i.comments||i.provisions||i.results||i.relatedItems||i,(t||e)&&(n=n.map(o=>{const a=Object.assign(t?t.fromJSON(o):o,e);return typeof a.load=="function"&&a.load(s),a}))}else n=[];return n}};$n.AUTH_MODE_ANONYMOUS="anonymous",$n.AUTH_MODE_AUTO="auto",$n.AUTH_MODE_IMMEDIATE="immediate",E([N()],$n.prototype,"access",void 0),E([N()],$n.prototype,"allSSL",void 0),E([N()],$n.prototype,"authMode",void 0),E([N()],$n.prototype,"authorizedCrossOriginDomains",void 0),E([Vi("authorizedCrossOriginDomains")],$n.prototype,"readAuthorizedCrossOriginDomains",null),E([N()],$n.prototype,"basemapGalleryGroupQuery",void 0),E([N()],$n.prototype,"bingKey",void 0),E([N()],$n.prototype,"canListApps",void 0),E([N()],$n.prototype,"canListData",void 0),E([N()],$n.prototype,"canListPreProvisionedItems",void 0),E([N()],$n.prototype,"canProvisionDirectPurchase",void 0),E([N()],$n.prototype,"canSearchPublic",void 0),E([N()],$n.prototype,"canShareBingPublic",void 0),E([N()],$n.prototype,"canSharePublic",void 0),E([N()],$n.prototype,"canSignInArcGIS",void 0),E([N()],$n.prototype,"canSignInIDP",void 0),E([N()],$n.prototype,"colorSetsGroupQuery",void 0),E([N()],$n.prototype,"commentsEnabled",void 0),E([N({type:Date})],$n.prototype,"created",void 0),E([N()],$n.prototype,"credential",void 0),E([N()],$n.prototype,"culture",void 0),E([N()],$n.prototype,"currentVersion",void 0),E([N()],$n.prototype,"customBaseUrl",void 0),E([N()],$n.prototype,"defaultBasemap",void 0),E([Vi("defaultBasemap")],$n.prototype,"readDefaultBasemap",null),E([N()],$n.prototype,"defaultDevBasemap",void 0),E([Vi("defaultDevBasemap")],$n.prototype,"readDefaultDevBasemap",null),E([N({type:Ar})],$n.prototype,"defaultExtent",void 0),E([N()],$n.prototype,"defaultVectorBasemap",void 0),E([Vi("defaultVectorBasemap")],$n.prototype,"readDefaultVectorBasemap",null),E([N()],$n.prototype,"description",void 0),E([N()],$n.prototype,"devBasemapGalleryGroupQuery",void 0),E([N()],$n.prototype,"eueiEnabled",void 0),E([N({readOnly:!0})],$n.prototype,"extraQuery",null),E([N()],$n.prototype,"featuredGroups",void 0),E([N()],$n.prototype,"featuredItemsGroupQuery",void 0),E([N()],$n.prototype,"galleryTemplatesGroupQuery",void 0),E([N()],$n.prototype,"livingAtlasGroupQuery",void 0),E([N()],$n.prototype,"hasCategorySchema",void 0),E([N()],$n.prototype,"helpBase",void 0),E([N()],$n.prototype,"helperServices",void 0),E([N()],$n.prototype,"helpMap",void 0),E([N()],$n.prototype,"homePageFeaturedContent",void 0),E([N()],$n.prototype,"homePageFeaturedContentCount",void 0),E([N()],$n.prototype,"httpPort",void 0),E([N()],$n.prototype,"httpsPort",void 0),E([N()],$n.prototype,"id",void 0),E([N()],$n.prototype,"ipCntryCode",void 0),E([N({readOnly:!0})],$n.prototype,"isOrganization",null),E([N()],$n.prototype,"isPortal",void 0),E([N()],$n.prototype,"isReadOnly",void 0),E([N({readOnly:!0})],$n.prototype,"itemPageUrl",null),E([N()],$n.prototype,"layerTemplatesGroupQuery",void 0),E([N()],$n.prototype,"maxTokenExpirationMinutes",void 0),E([N({type:Date})],$n.prototype,"modified",void 0),E([N()],$n.prototype,"name",void 0),E([N()],$n.prototype,"portalHostname",void 0),E([N()],$n.prototype,"portalMode",void 0),E([N()],$n.prototype,"portalProperties",void 0),E([N()],$n.prototype,"region",void 0),E([N({readOnly:!0})],$n.prototype,"restUrl",null),E([N()],$n.prototype,"rotatorPanels",void 0),E([N()],$n.prototype,"showHomePageDescription",void 0),E([N()],$n.prototype,"sourceJSON",void 0),E([N()],$n.prototype,"staticImagesUrl",void 0),E([N({json:{name:"2DStylesGroupQuery"}})],$n.prototype,"stylesGroupQuery2d",void 0),E([N({json:{name:"stylesGroupQuery"}})],$n.prototype,"stylesGroupQuery3d",void 0),E([N()],$n.prototype,"supportsHostedServices",void 0),E([N()],$n.prototype,"symbolSetsGroupQuery",void 0),E([N()],$n.prototype,"templatesGroupQuery",void 0),E([N()],$n.prototype,"thumbnail",void 0),E([N({readOnly:!0})],$n.prototype,"thumbnailUrl",null),E([N()],$n.prototype,"units",void 0),E([N()],$n.prototype,"url",void 0),E([N()],$n.prototype,"urlKey",void 0),E([Vi("urlKey")],$n.prototype,"readUrlKey",null),E([N()],$n.prototype,"user",void 0),E([Vi("user")],$n.prototype,"readUser",null),E([N()],$n.prototype,"useStandardizedQuery",void 0),E([N()],$n.prototype,"useVectorBasemaps",void 0),E([N()],$n.prototype,"vectorBasemapGalleryGroupQuery",void 0),$n=O1=E([dt("esri.portal.Portal")],$n);const Cc=$n,M8t=Oi.getLogger("esri.assets");function Ql(t){if(!pa.assetsPath)throw M8t.errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new st("assets:path-not-set","config.assetsPath is not set");return yd(pa.assetsPath,t)}let tR=class extends Tn{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e&&e.portalItem&&e.path?{...e,path:this._normalizePath(e.path,e.portalItem)}:e}set path(e){ve(e)&&Wg(e)?Oi.getLogger(this.declaredClass).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 itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",i){const r=this.url;if(lt(r))throw new st("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:Wx(i,"signal")})}async update(e,i){return(await Promise.resolve().then(()=>XK)).addOrUpdateResource(this,"update",e,i)}hasPath(){return ve(this.path)}_normalizePath(e,i){return lt(e)?e:(e=e.replace(/^\/+/,""),ve(i)&&Wg(e)&&(e=Qre(e,i.itemUrl)),e?.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}};E([N()],tR.prototype,"portalItem",void 0),E([N({type:String,value:null})],tR.prototype,"path",null),E([ho("path")],tR.prototype,"_castPath",null),E([N({type:String,readOnly:!0})],tR.prototype,"url",null),E([N({type:String,readOnly:!0})],tR.prototype,"itemRelativeUrl",null),tR=E([dt("esri.portal.PortalItemResource")],tR);const D8t=tR;let XH=class extends Tn{constructor(e){super(e),this.created=null,this.rating=null}};E([N()],XH.prototype,"created",void 0),E([N()],XH.prototype,"rating",void 0),XH=E([dt("esri.portal.PortalRating")],XH);const k1e=XH;var IL;const F8t=new Set(["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","GeoJson","CSV","KML","WFS","WMTS","WMS","Feed"]),L8t=new Set(["KML","GeoJson","CSV"]);let ka=IL=class extends Y0(gd){static from(t){return Gd(IL,t)}constructor(t){super(t),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 t=this.type,e=this.typeKeywords||[];let i=t;return t==="Feature Service"||t==="Feature Collection"?i=e.includes("Table")?"Table":e.includes("Route Layer")?"Route Layer":e.includes("Markup")?"Markup":"Feature Layer":t==="Image Service"?i=e.includes("Elevation 3D Layer")?"Elevation Layer":e.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":t==="Scene Service"?i="Scene Layer":t==="Video Service"?i="Video Layer":t==="Scene Package"?i="Scene Layer Package":t==="Stream Service"?i="Feature Layer":t==="Geoprocessing Service"&&this.portal&&this.portal.isPortal?i=e.includes("Web Tool")?"Tool":"Geoprocessing Service":t==="Geocoding Service"?i="Locator":t==="Geoenrichment Service"?i="GeoEnrichment Service":t==="Microsoft Powerpoint"?i="Microsoft PowerPoint":t==="GeoJson"?i="GeoJSON":t==="Globe Service"?i="Globe Layer":t==="Vector Tile Service"?i="Tile Layer":t==="netCDF"?i="NetCDF":t==="Map Service"?i=e.includes("Spatiotemporal")||!e.includes("Hosted Service")&&!e.includes("Tiled")||e.includes("Relational")?"Map Image Layer":"Tile Layer":t&&t.toLowerCase().includes("add in")?i=t.replace(/(add in)/gi,"Add-In"):t==="datastore catalog service"?i="Big Data File Share":t==="Compact Tile Package"?i="Tile Package (tpkx)":t==="OGCFeatureServer"?i="OGC Feature Layer":t==="web mapping application"&&e.includes("configurableApp")?i="Instant App":t==="Insights Page"&&(i="Insights Report"),i}readExtent(t){return t&&t.length?new Ar(t[0][0],t[0][1],t[1][0],t[1][1]):null}get iconUrl(){const t=this.type&&this.type.toLowerCase()||"",e=this.typeKeywords||[],i="esri/images/portal/",r="16";let n,s=!1,o=!1,a=!1,l=!1,c=!1,h=!1;return t.indexOf("service")>0||t==="feature collection"||t==="kml"||t==="wms"||t==="wmts"||t==="wfs"?(s=e.includes("Hosted Service"),t==="feature service"||t==="feature collection"||t==="kml"||t==="wfs"?(o=e.includes("Table"),a=e.includes("Route Layer"),l=e.includes("Markup"),c=e.includes("Spatiotemporal"),h=e.includes("UtilityNetwork"),n=c&&o?"spatiotemporaltable":o?"table":a?"routelayer":l?"markup":c?"spatiotemporal":s?"featureshosted":h?"utilitynetwork":"features"):n=t==="map service"||t==="wms"||t==="wmts"?s||e.includes("Tiled")||t==="wmts"?"maptiles":"mapimages":t==="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":t==="image service"?e.includes("Elevation 3D Layer")?"elevationlayer":e.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":t==="stream service"?"streamlayer":t==="video service"?"mediaservice":t==="vector tile service"?"vectortile":t==="datastore catalog service"?"datastorecollection":t==="geocoding service"?"geocodeservice":t==="geoprocessing service"?e.includes("Web Tool")&&this.portal&&this.portal.isPortal?"tool":"layers":t==="geodata service"?"geodataservice":"layers"):n=t==="web map"||t==="cityengine web scene"?"maps":t==="web scene"?e.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":t==="web mapping application"&&e.includes("configurableApp")?"instantapps":t==="web mapping application"||t==="mobile application"||t==="application"||t==="operation view"||t==="desktop application"?"apps":t==="map document"||t==="map package"||t==="published map"||t==="scene document"||t==="globe document"||t==="basemap package"||t==="mobile basemap package"||t==="mobile map package"||t==="project package"||t==="project template"||t==="pro map"||t==="layout"||t==="layer"&&e.includes("ArcGIS Pro")||t==="explorer map"&&e.indexOf("Explorer Document")?"mapsgray":t==="service definition"||t==="csv"||t==="shapefile"||t==="cad drawing"||t==="geojson"||t==="360 vr experience"||t==="netcdf"||t==="administrative report"?"datafiles":t==="explorer add in"||t==="desktop add in"||t==="windows viewer add in"||t==="windows viewer configuration"?"appsgray":t==="arcgis pro add in"||t==="arcgis pro configuration"?"addindesktop":t==="rule package"||t==="file geodatabase"||t==="sqlite geodatabase"||t==="csv collection"||t==="kml collection"||t==="windows mobile package"||t==="map template"||t==="desktop application template"||t==="gml"||t==="arcpad package"||t==="code sample"||t==="form"||t==="document link"||t==="earth configuration"||t==="operations dashboard add in"||t==="rules package"||t==="image"||t==="workflow manager package"||t==="explorer map"&&e.includes("Explorer Mapping Application")||e.includes("Document")?"datafilesgray":t==="network analysis service"||t==="geoprocessing service"||t==="geodata service"||t==="geometry service"||t==="geoprocessing package"||t==="locator package"||t==="geoprocessing sample"||t==="workflow manager service"?"toolsgray":t==="layer"||t==="layer package"||t==="explorer layer"?"layersgray":t==="scene package"?"scenepackage":t==="mobile scene package"?"mobilescenepackage":t==="tile package"||t==="compact tile package"?"tilepackage":t==="task file"?"taskfile":t==="report template"?"report-template":t==="statistical data collection"?"statisticaldatacollection":t==="insights workbook"?"workbook":t==="insights model"?"insightsmodel":t==="insights page"?"insightspage":t==="insights theme"?"insightstheme":t==="hub initiative"?"hubinitiative":t==="hubpage"?"hubpage":t==="hub event"?"hubevent":t==="hub site application"?"hubsite":t==="hub project"?"hubproject":t==="relational database connection"?"relationaldatabaseconnection":t==="big data file share"?"datastorecollection":t==="image collection"?"imagecollection":t==="style"?"style":t==="desktop style"?"desktopstyle":t==="dashboard"?"dashboard":t==="raster function template"?"rasterprocessingtemplate":t==="vector tile package"?"vectortilepackage":t==="ortho mapping project"?"orthomappingproject":t==="ortho mapping template"?"orthomappingtemplate":t==="solution"?"solutions":t==="geopackage"?"geopackage":t==="deep learning package"?"deeplearningpackage":t==="real time analytic"?"realtimeanalytics":t==="big data analytic"?"bigdataanalytics":t==="feed"?"feed":t==="excalibur imagery project"?"excaliburimageryproject":t==="notebook"?"notebook":t==="storymap"?"storymap":t==="survey123 add in"?"survey123addin":t==="mission"?"mission":t==="mission report"?"missionreport":t==="quickcapture project"?"quickcaptureproject":t==="pro report"?"proreport":t==="pro report template"?"proreporttemplate":t==="urban model"?"urbanmodel":t==="web experience"?"experiencebuilder":t==="web experience template"?"webexperiencetemplate":t==="experience builder widget"?"experiencebuilderwidget":t==="experience builder widget package"?"experiencebuilderwidgetpackage":t==="workflow"?"workflow":t==="insights script"?"insightsscript":t==="kernel gateway connection"?"kernelgatewayconnection":t==="hub initiative template"?"hubinitiativetemplate":t==="storymap theme"?"storymaptheme":t==="knowledge graph"?"knowledgegraph":t==="native application"?"nativeapp":t==="native application installer"?"nativeappinstaller":t==="link chart"?"linkchart":t==="investigation"?"investigation":t==="ogcfeatureserver"?"features":t==="pro project"?"proproject":t==="insights workbook package"?"insightsworkbookpackage":t==="apache parquet"?"apacheparquet":t==="notebook code snippets"||t==="notebook code snippet library"?"notebookcodesnippets":t==="suitability model"?"suitabilitymodel":t==="esri classifier definition"?"classifierdefinition":t==="esri classification schema"?"classificationschema":t==="insights data engineering workbook"?"dataengineeringworkbook":t==="insights data engineering model"?"dataengineeringmodel":t==="deep learning studio project"?"deeplearningproject":t==="discussion"?"discussion":t==="allsource project"?"allsourceproject":t==="api key"?"apikey":"maps",n?Ql(i+n+r+".png"):null}get isLayer(){return this.type!=null&&F8t.has(this.type)}get itemPageUrl(){const t=this.portal?.itemPageUrl;return t&&this.id?`${t}?id=${this.id}`:null}get itemUrl(){const t=this.portal?.restUrl;return t&&this.id?`${t}/content/items/${this.id}`:null}get thumbnailUrl(){const t=this.itemUrl,e=this.thumbnail;return t&&e?this.portal?.normalizeUrl(`${t}/info/${e}?f=json`)??null:null}get userItemUrl(){const t=this.get("portal.restUrl");if(!t)return null;const e=this.owner||this.get("portal.user.username");return e?`${t}/content/users/${this.ownerFolder?`${e}/${this.ownerFolder}`:e}/items/${this.id}`:null}load(t){const e=this.portal??(this.portal=Cc.getDefault()),i=e.load(t).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?e.request(this.itemUrl,{signal:ve(t)?t.signal:null,query:{token:this.apiKey}}):{}).then(r=>{this.sourceJSON=r,this.read(r)});return this.addResolvingPromise(i),Promise.resolve(this)}async addRating(t){const e={method:"post",query:{}};return t instanceof k1e&&(t=t.rating),t==null||isNaN(t)||typeof t!="number"||(e.query.rating=t),this.portal?(await this.portal.request(this.itemUrl+"/addRating",e),new k1e({rating:t,created:new Date})):null}clone(){const t={access:this.access,accessInformation:this.accessInformation,applicationProxies:gi(this.applicationProxies),avgRating:this.avgRating,categories:gi(this.categories),created:gi(this.created),culture:this.culture,description:this.description,extent:gi(this.extent),groupCategories:gi(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:gi(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:gi(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:gi(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:gi(this.typeKeywords),url:this.url};this.loaded&&(t.loadStatus="loaded");const e=new IL({sourceJSON:this.sourceJSON}).set(t);return e._set("isOrgItem",this.isOrgItem),e}createPostQuery(){const t=this.toJSON();for(const i of["tags","typeKeywords","categories"])t[i]&&(t[i]=t[i].join(", "));const{extent:e}=t;return e&&(t.extent=JSON.stringify(e)),t}async deleteRating(){await Ou(this.portal).request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(t="json",e){return Ou(this.portal).request(this.itemUrl+"/data",{responseType:t,...e,query:{token:this.apiKey}})}async fetchRating(t){const e=await Ou(this.portal).request(this.itemUrl+"/rating",{query:{token:this.apiKey},...t});return e.rating!=null?(e.created=new Date(e.created),new k1e(e)):null}fetchRelatedItems(t,e){return Ou(this.portal).requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...t,token:this.apiKey},...e},IL)}getThumbnailUrl(t){let e=this.thumbnailUrl;return e&&t&&(e+=`&w=${t}`),e}reload(){return Ou(this.portal).request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then(t=>(this.sourceJSON=t,this.read(t),this))}update(t){return this.id?this.load().then(()=>Ou(this.portal).signIn()).then(()=>{const e=t&&t.data,i={method:"post"};i.query=this.createPostQuery();for(const r in i.query)i.query[r]===null&&(i.query[r]="");return i.query.clearEmptyFields=!0,e!=null&&(typeof e=="string"?i.query.text=e:typeof e=="object"&&(i.query.text=JSON.stringify(e))),this.portal.request(`${this.userItemUrl}/update`,i).then(()=>this.reload())}):Promise.reject(new st("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(t){if(!this.id)throw new st("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:e,itemUrl:i}=this;await Ou(e).signIn();const{copyResources:r,folder:n,tags:s,title:o}=t||{},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(`${i}/copy`,a);return new IL({id:l,portal:e})}updateThumbnail(t){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const e=t.thumbnail,i=t.filename,r={method:"post"};if(typeof e=="string")A1(e)?r.query={data:e}:r.query={url:Gy(e)},ve(i)&&(r.query.filename=i);else{const n=new FormData;ve(i)?n.append("file",e,i):n.append("file",e),r.body=n}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,r).then(()=>this.reload())}):Promise.reject(new st("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(t={},e){return(await Promise.resolve().then(()=>XK)).fetchResources(this,t,e)}async addResource(t,e,i){const r=await Promise.resolve().then(()=>XK);return t.portalItem=this,r.addOrUpdateResource(t,"add",e,i)}async removeResource(t,e){const i=await Promise.resolve().then(()=>XK);if(t.portalItem&&t.portalItem.itemUrl!==this.itemUrl)throw new st("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return i.removeResource(this,t,e)}async removeAllResources(t){return(await Promise.resolve().then(()=>XK)).removeAllResources(this,t)}resourceFromPath(t){return new D8t({portalItem:this,path:t})}toJSON(){const t=this.extent,e={accessInformation:this.accessInformation,categories:gi(this.categories),created:this.created&&this.created.getTime(),description:this.description,extent:t&&[[t.xmin,t.ymin],[t.xmax,t.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified&&this.modified.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:gi(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:gi(this.typeKeywords),url:this.url};return xre(e)}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");return new IL({sourceJSON:t})}_getPostQuery(){const t=this.toJSON();for(const e in t)e==="tags"&&t[e]!==null&&(t[e]=t[e].join(", ")),e==="typeKeywords"&&t[e]!==null&&(t[e]=t[e].join(", ")),e==="extent"&&t[e]&&(t[e]=JSON.stringify(t[e]));return t}};E([N({type:["private","shared","org","public"]})],ka.prototype,"access",void 0),E([N()],ka.prototype,"accessInformation",void 0),E([N({type:String})],ka.prototype,"apiKey",void 0),E([N({json:{read:{source:"appProxies"}}})],ka.prototype,"applicationProxies",void 0),E([N()],ka.prototype,"avgRating",void 0),E([N()],ka.prototype,"categories",void 0),E([N({type:Date})],ka.prototype,"created",void 0),E([N()],ka.prototype,"culture",void 0),E([N()],ka.prototype,"description",void 0),E([N({readOnly:!0})],ka.prototype,"displayName",null),E([N({type:Ar})],ka.prototype,"extent",void 0),E([Vi("extent")],ka.prototype,"readExtent",null),E([N()],ka.prototype,"groupCategories",void 0),E([N({readOnly:!0})],ka.prototype,"iconUrl",null),E([N()],ka.prototype,"id",void 0),E([N({readOnly:!0})],ka.prototype,"isLayer",null),E([N({type:Boolean,readOnly:!0})],ka.prototype,"isOrgItem",void 0),E([N()],ka.prototype,"itemControl",void 0),E([N({readOnly:!0})],ka.prototype,"itemPageUrl",null),E([N({readOnly:!0})],ka.prototype,"itemUrl",null),E([N()],ka.prototype,"licenseInfo",void 0),E([N({type:Date})],ka.prototype,"modified",void 0),E([N()],ka.prototype,"name",void 0),E([N()],ka.prototype,"numComments",void 0),E([N()],ka.prototype,"numRatings",void 0),E([N()],ka.prototype,"numViews",void 0),E([N()],ka.prototype,"owner",void 0),E([N()],ka.prototype,"ownerFolder",void 0),E([N({type:Cc})],ka.prototype,"portal",void 0),E([N()],ka.prototype,"screenshots",void 0),E([N()],ka.prototype,"size",void 0),E([N()],ka.prototype,"snippet",void 0),E([N()],ka.prototype,"sourceJSON",void 0),E([N({type:String})],ka.prototype,"sourceUrl",void 0),E([N({type:String})],ka.prototype,"spatialReference",void 0),E([N()],ka.prototype,"tags",void 0),E([N()],ka.prototype,"thumbnail",void 0),E([N({readOnly:!0})],ka.prototype,"thumbnailUrl",null),E([N()],ka.prototype,"title",void 0),E([N()],ka.prototype,"type",void 0),E([N()],ka.prototype,"typeKeywords",void 0),E([N({type:String,json:{read(t,e){if(L8t.has(e.type)){const i=this.portal?.restUrl;t||(t=i&&this.id?`${i}/content/items/${this.id}/data`:null)}return t}}})],ka.prototype,"url",void 0),E([N({readOnly:!0})],ka.prototype,"userItemUrl",null),ka=IL=E([dt("esri.portal.PortalItem")],ka);const Q0=ka,MGe=Object.freeze(Object.defineProperty({__proto__:null,default:Q0},Symbol.toStringTag,{value:"Module"})),DGe=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,N8t={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 FGe(t){return N8t[t]??!1}const KH=[],z8=new Map;function LGe(t){for(const e of z8.keys())kGe(t.pattern,e)&&z8.delete(e)}function k8t(t){return KH.includes(t)||(LGe(t),KH.unshift(t)),{remove(){const e=KH.indexOf(t);e>-1&&(KH.splice(e,1),LGe(t))}}}async function NGe(t){const e=Z0();z8.has(t)||z8.set(t,B8t(t,e));const i=z8.get(t);return i&&await V8t.add(i),i}function $8t(t){if(!DGe.test(t))return null;const e=DGe.exec(t);if(e===null)return null;const[,i,r]=e,n=i+(r?"-"+r.toUpperCase():"");return FGe(n)?n:FGe(i)?i:null}async function B8t(t,e){const i=[];for(const r of KH)if(kGe(r.pattern,t))try{return await r.fetchMessageBundle(t,e)}catch(n){i.push(n)}throw i.length?new st("intl:message-bundle-error",`Errors occurred while loading "${t}"`,{errors:i}):new st("intl:no-message-bundle-loader",`No loader found for message bundle "${t}"`)}function kGe(t,e){return typeof t=="string"?e.startsWith(t):t.test(e)}R1e(()=>{z8.clear()});const V8t=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(t){return this._increase(),t.then(()=>this._decrease(),()=>this._decrease()),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=Kx())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&this._numLoading===0&&(this._dfd.resolve(),this._dfd=null)}};async function j8t(t){if(!t)return;const e=t.includes("-vector")?t.slice(0,t.indexOf("-vector")):t,i=await NGe("esri/t9n/basemaps");return i[t]||i[e]}const $1e={streets:{id:"streets",classic:!0,deprecated:!0,get thumbnailUrl(){return Ql("esri/images/basemap/streets.jpg")},baseMapLayers:[{id:"streets-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Street Map",showLegend:!1,visibility:!0,opacity:1}]},satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return Ql("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 Ql("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 Ql("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}]},topo:{id:"topo",classic:!0,deprecated:!0,get thumbnailUrl(){return Ql("esri/images/basemap/topo.jpg")},baseMapLayers:[{id:"topo-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Topo Map",showLegend:!1,visibility:!0,opacity:1}]},gray:{id:"gray",classic:!0,deprecated:!0,get thumbnailUrl(){return Ql("esri/images/basemap/gray.jpg")},baseMapLayers:[{id:"gray-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Light Gray Base",showLegend:!1,visibility:!0,opacity:1},{id:"gray-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Light Gray Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},"dark-gray":{id:"dark-gray",classic:!0,deprecated:!0,get thumbnailUrl(){return Ql("esri/images/basemap/dark-gray.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Dark Gray Base",showLegend:!1,visibility:!0,opacity:1},{id:"dark-gray-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Dark Gray Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return Ql("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}]},"national-geographic":{id:"national-geographic",classic:!0,deprecated:!0,get thumbnailUrl(){return Ql("esri/images/basemap/national-geographic.jpg")},baseMapLayers:[{id:"national-geographic-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer",title:"NatGeo World Map",showLegend:!1,layerType:"ArcGISTiledMapServiceLayer",visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return Ql("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 Ql("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}]},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return Ql("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}]},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return Ql("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}]},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return Ql("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}]},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return Ql("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 Ql("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 Ql("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}]},"arcgis-imagery":{get thumbnailUrl(){return Ql("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 Ql("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 Ql("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 Ql("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 Ql("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 Ql("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 Ql("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 Ql("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 Ql("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 Ql("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}]}};function $Ge(t){const e=t?.type;return e==="imagery-tile"||e==="tile"||e==="open-street-map"||e==="vector-tile"||e==="web-tile"||e==="wmts"}function G8t(t){const e=t?.type;return e==="base-tile"||e==="tile"||e==="elevation"||e==="imagery-tile"||e==="base-elevation"||e==="open-street-map"||e==="wcs"||e==="web-tile"||e==="wmts"||e==="vector-tile"}const JH={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function BGe(t){const e=t?.type;return e==="building-scene"||e==="integrated-mesh"||e==="point-cloud"||e==="scene"}function cne(t){return t?.type==="feature"&&!t.url&&t.source?.type==="memory"}function U8t(t){if(t.activeLayer){const e=t.activeLayer.tileMatrixSet;if(e)return e;const i=t.activeLayer.tileMatrixSets;if(i)return i}return null}async function VGe(t,e){const i=Ho?.findServerInfo(t);if(i?.currentVersion!=null)return i.owningSystemUrl||null;const r=t.toLowerCase().indexOf("/rest/services");if(r===-1)return null;const n=`${t.substring(0,r)}/rest/info`,s=ve(e)?e.signal:null,{data:o}=await ur(n,{query:{f:"json"},responseType:"json",signal:s});return o?.owningSystemUrl||null}function z8t(t){if(!("capabilities"in t))return!1;switch(t.type){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 AL(t){return z8t(t)?"effectiveCapabilities"in t?t.effectiveCapabilities:t.capabilities:null}function H8t(t){if(!("editingEnabled"in t))return!1;switch(t.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function jGe(t){return!!H8t(t)&&("effectiveEditingEnabled"in t?t.effectiveEditingEnabled:t.editingEnabled)}const W8t=new Set(["bing-maps","imagery","imagery-tile","map-image","open-street-map","tile","unknown","unsupported","vector-tile","web-tile","wms","wmts"]),q8t=new Set(["csv","feature","geo-rss","geojson","group","imagery","imagery-tile","kml","map-image","map-notes","media","ogc-feature","route","subtype-group","tile","unknown","unsupported","vector-tile","web-tile","wfs","wms","wmts"]);function Y8t(t){return t.layerContainerType==="basemap"?W8t:t.layerContainerType==="operational-layers"?q8t:null}function X8t(t,e){if(e.restrictedWebMapWriting){const i=Y8t(e);return!ve(i)||i.has(t.type)&&!cne(t)}return!0}function K8t(t,e){if(e)if(cne(t)){const i=Yx("featureCollection.layers",e),r=i&&i[0]&&i[0].layerDefinition;r&&B1e(t,r)}else t.type==="stream"?B1e(t,e.layerDefinition=e.layerDefinition||{}):t.type!=="group"&&B1e(t,e)}function B1e(t,e){"maxScale"in t&&(e.maxScale=Xre(t.maxScale)??void 0),"minScale"in t&&(e.minScale=Xre(t.minScale)??void 0)}function J8t(t,e){if(K8t(t,e),e&&("blendMode"in t&&(e.blendMode=t.blendMode,e.blendMode==="normal"&&delete e.blendMode),e.opacity=Xre(t.opacity)??void 0,e.title=t.title||"Layer",e.visibility=t.visible,"legendEnabled"in t&&t.type!=="wmts"))if(cne(t)){const i=e.featureCollection;i&&(i.showLegend=t.legendEnabled)}else e.showLegend=t.legendEnabled}function V1e(t,e,i){if(!("write"in t)||!t.write)return i&&i.messages&&i.messages.push(new st("layer:unsupported",`Layers (${t.title}, ${t.id}) of type '${t.declaredClass}' cannot be persisted`,{layer:t})),null;if(X8t(t,i)){const r={};return t.write(r,i)?r:null}return ve(e)&&J8t(t,e=gi(e)),e}var hne;let Z8t=0;const GGe="esri.Basemap";let Zb=hne=class extends Y0(gd){constructor(t){super(t),this.id=null,this.portalItem=null,this.spatialReference=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+Z8t++,this.baseLayers=new Sr,this.referenceLayers=new Sr;const e=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type==="elevation"&&Oi.getLogger(this.declaredClass).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a basemap layer and will therefore be ignored.`)},i=r=>{r.parent=null};this.baseLayers.on("after-add",r=>e(r.item)),this.referenceLayers.on("after-add",r=>e(r.item)),this.baseLayers.on("after-remove",r=>i(r.item)),this.referenceLayers.on("after-remove",r=>i(r.item))}initialize(){this.when().catch(t=>{Oi.getLogger(this.declaredClass).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,t)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const t=this.baseLayers.removeAll();for(const i of t)i.destroy();const e=this.referenceLayers.removeAll();for(const i of e)i.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),this.portalItem?.destroy(),this.portalItem=null}normalizeCtorArgs(t){return t&&"resourceInfo"in t&&(this._set("resourceInfo",t.resourceInfo),delete(t={...t}).resourceInfo),t}set baseLayers(t){this._set("baseLayers",og(t,this._get("baseLayers")))}_writeBaseLayers(t,e,i){const r=[];t&&(i={...i,layerContainerType:"basemap"},this.baseLayers.forEach(n=>{const s=V1e(n,i.webmap?i.webmap.getLayerJSONFromResourceInfo(n):null,i);ve(s)&&r.push(s)}),this.referenceLayers.forEach(n=>{const s=V1e(n,i.webmap?i.webmap.getLayerJSONFromResourceInfo(n):null,i);ve(s)&&(n.type!=="scene"&&(s.isReference=!0),r.push(s))})),e.baseMapLayers=r}set referenceLayers(t){this._set("referenceLayers",og(t,this._get("referenceLayers")))}writeTitle(t,e){e.title=t||"Basemap"}load(t){return this.addResolvingPromise(this._loadFromSource(t)),Promise.resolve(this)}loadAll(){return mL(this,t=>{t(this.baseLayers,this.referenceLayers)})}clone(){const t={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.slice(),referenceLayers:this.referenceLayers.slice()};return this.loaded&&(t.loadStatus="loaded"),new hne({resourceInfo:this.resourceInfo}).set(t)}read(t,e){this.resourceInfo||this._set("resourceInfo",{data:t,context:e}),super.read(t,e)}write(t,e){return t=t||{},e&&e.origin||(e={origin:"web-map",...e}),super.write(t,e),!this.loaded&&this.resourceInfo&&this.resourceInfo.data.baseMapLayers&&(t.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(i=>{const r=gi(i);return r.url&&P1(r.url)&&(r.url=`https:${r.url}`),r.templateUrl&&P1(r.templateUrl)&&(r.templateUrl=`https:${r.templateUrl}`),r})),t}async _loadFromSource(t){const{resourceInfo:e,portalItem:i}=this;yn(t);const r=[];if(e){const n=e.context?e.context.url:null;if(r.push(this._loadLayersFromJSON(e.data,n,t)),e.data.id&&!e.data.title){const s=e.data.id;r.push(j8t(s).then(o=>{o&&this.read({title:o},e.context)}))}}else i&&r.push(this._loadFromItem(i,t));await Promise.all(r)}async _loadLayersFromJSON(t,e,i){const r=this.resourceInfo&&this.resourceInfo.context,n=this.portalItem&&this.portalItem.portal||r&&r.portal||null,s=r&&r.origin==="web-scene"?"web-scene":"web-map",{populateOperationalLayers:o}=await Promise.resolve().then(()=>Vpt),a=[];if(yn(i),t.baseMapLayers&&Array.isArray(t.baseMapLayers)){const l={context:{origin:s,url:e,portal:n,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},c=y=>s==="web-scene"&&y.layerType==="ArcGISSceneServiceLayer"||y.isReference,h=o(this.baseLayers,t.baseMapLayers.filter(y=>!c(y)),l);a.push(h);const p=o(this.referenceLayers,t.baseMapLayers.filter(c),l);a.push(p)}await Ru(a)}async _loadFromItem(t,e){const i=await t.load(e),r=await i.fetchData("json",e),n=fa(t.itemUrl??"");return this._set("resourceInfo",{data:r.baseMap??{},context:{origin:t.type==="Web Scene"?"web-scene":"web-map",portal:t.portal||Cc.getDefault(),url:n}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:r.spatialReference},this.resourceInfo.context),this.read({title:t.title,thumbnailUrl:t.thumbnailUrl},{origin:"portal-item",portal:t.portal||Cc.getDefault(),url:n}),this._loadLayersFromJSON(this.resourceInfo.data,n,e)}static fromId(t){const e=$1e[t];if(e){if(e.deprecated){let i=null;t==="dark-gray"?i="dark-gray-vector":t==="gray"?i="gray-vector":t==="streets"?i="streets-vector":t==="topo"&&(i="topo-vector"),GVe(Oi.getLogger(GGe),`The ${t} basemap has entered mature support and is no longer being updated.`,{replacement:i,see:"https://arcg.is/1iq8aD",warnOnce:!0})}return hne.fromJSON(e)}return null}};E([N({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(t,e,i,r){this._writeBaseLayers(t,e,r)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:Sr}},writer(t,e,i,r){this._writeBaseLayers(t,e,r)}}}}}})],Zb.prototype,"baseLayers",null),E([N({type:String,json:{origins:{"web-scene":{write:!0}}}})],Zb.prototype,"id",void 0),E([N({type:Q0})],Zb.prototype,"portalItem",void 0),E([N()],Zb.prototype,"referenceLayers",null),E([N({readOnly:!0})],Zb.prototype,"resourceInfo",void 0),E([N({type:hr})],Zb.prototype,"spatialReference",void 0),E([N()],Zb.prototype,"thumbnailUrl",void 0),E([N({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],Zb.prototype,"title",void 0),E([Cr("title")],Zb.prototype,"writeTitle",null),Zb=hne=E([dt(GGe)],Zb);const iR=Zb,Q8t=Object.freeze(Object.defineProperty({__proto__:null,default:iR},Symbol.toStringTag,{value:"Module"})),dne={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 UGe(t){return dne[t]||dne[t.toLowerCase()]}function j1e(t){return dne[t]??dne[t.toLowerCase()]}function e9t(t){return[...j1e(t)]}function G1e(t,e,i){i<0&&++i,i>1&&--i;const r=6*i;return r<1?t+(e-t)*r:2*i<1?e:3*i<2?t+(e-t)*(.6666666666666666-i)*6:t}function zGe(t,e,i,r=1){const n=(t%360+360)%360/360,s=i<=.5?i*(e+1):i+e-i*e,o=2*i-s;return[Math.round(255*G1e(o,s,n+.3333333333333333)),Math.round(255*G1e(o,s,n)),Math.round(255*G1e(o,s,n-.3333333333333333)),r]}function t9t(t){const e=t.length>5,i=e?8:4,r=(1<>=i,a[3]=n*l/255),l=o&r,o>>=i,a[2]=n*l,l=o&r,o>>=i,a[1]=n*l,l=o&r,o>>=i,a[0]=n*l,a}function hn(){return[0,0,0]}function Bf(t){return[t[0],t[1],t[2]]}function ja(t,e,i){return[t,e,i]}function pne(t){const e=hn(),i=Math.min(3,t.length);for(let r=0;r0&&(s=1/Math.sqrt(s),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s),t}function Qb(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function e2(t,e,i){const r=e[0],n=e[1],s=e[2],o=i[0],a=i[1],l=i[2];return t[0]=n*l-s*a,t[1]=s*o-r*l,t[2]=r*a-n*o,t}function eW(t,e,i,r){const n=e[0],s=e[1],o=e[2];return t[0]=n+r*(i[0]-n),t[1]=s+r*(i[1]-s),t[2]=o+r*(i[2]-o),t}function v9t(t,e,i,r,n,s){const o=s*s,a=o*(2*s-3)+1,l=o*(s-2)+s,c=o*(s-1),h=o*(3-2*s);return t[0]=e[0]*a+i[0]*l+r[0]*c+n[0]*h,t[1]=e[1]*a+i[1]*l+r[1]*c+n[1]*h,t[2]=e[2]*a+i[2]*l+r[2]*c+n[2]*h,t}function _9t(t,e,i,r,n,s){const o=1-s,a=o*o,l=s*s,c=a*o,h=3*s*a,p=3*l*o,y=l*s;return t[0]=e[0]*c+i[0]*h+r[0]*p+n[0]*y,t[1]=e[1]*c+i[1]*h+r[1]*p+n[1]*y,t[2]=e[2]*c+i[2]*h+r[2]*p+n[2]*y,t}function b9t(t,e){e=e||1;const i=ZH,r=2*i()*Math.PI,n=2*i()-1,s=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*s,t[1]=Math.sin(r)*s,t[2]=n*e,t}function t2(t,e,i){const r=e[0],n=e[1],s=e[2];return t[0]=i[0]*r+i[4]*n+i[8]*s+i[12],t[1]=i[1]*r+i[5]*n+i[9]*s+i[13],t[2]=i[2]*r+i[6]*n+i[10]*s+i[14],t}function PC(t,e,i){const r=e[0],n=e[1],s=e[2];return t[0]=r*i[0]+n*i[3]+s*i[6],t[1]=r*i[1]+n*i[4]+s*i[7],t[2]=r*i[2]+n*i[5]+s*i[8],t}function W8(t,e,i){const r=i[0],n=i[1],s=i[2],o=i[3],a=e[0],l=e[1],c=e[2];let h=n*c-s*l,p=s*a-r*c,y=r*l-n*a,v=n*y-s*p,x=s*h-r*y,I=r*p-n*h;const P=2*o;return h*=P,p*=P,y*=P,v*=2,x*=2,I*=2,t[0]=a+h+v,t[1]=l+p+x,t[2]=c+y+I,t}function w9t(t,e,i,r){const n=[],s=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[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),t[0]=s[0]+i[0],t[1]=s[1]+i[1],t[2]=s[2]+i[2],t}function x9t(t,e,i,r){const n=[],s=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[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),t[0]=s[0]+i[0],t[1]=s[1]+i[1],t[2]=s[2]+i[2],t}function S9t(t,e,i,r){const n=[],s=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[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],t[0]=s[0]+i[0],t[1]=s[1]+i[1],t[2]=s[2]+i[2],t}function C9t(t,e){Xv(gne,t),Xv(yne,e),Hy(gne,gne),Hy(yne,yne);const i=Qb(gne,yne);return i>1?0:i<-1?Math.PI:Math.acos(i)}const gne=hn(),yne=hn();function T9t(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function vne(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function E9t(t,e){if(t===e)return!0;const i=t[0],r=t[1],n=t[2],s=e[0],o=e[1],a=e[2],l=qv();return Math.abs(i-s)<=l*Math.max(1,Math.abs(i),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 JGe(t,e,i){const r=i[0]-e[0],n=i[1]-e[1],s=i[2]-e[2];let o=r*r+n*n+s*s;return o>0?(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=s*o,t):(t[0]=0,t[1]=0,t[2]=0,t)}const I9t=Tc,A9t=H1e,P9t=QH,ZGe=rR,O9t=H8,QGe=Yv;Object.freeze(Object.defineProperty({__proto__:null,abs:h9t,add:Wc,angle:C9t,bezier:_9t,ceil:u9t,copy:Xv,cross:e2,direction:JGe,dist:ZGe,distance:rR,div:P9t,divide:QH,dot:Qb,equals:E9t,exactEquals:vne,floor:c9t,hermite:v9t,inverse:y9t,len:QGe,length:Yv,lerp:eW,max:f9t,min:p9t,mul:A9t,multiply:H1e,negate:g9t,normalize:Hy,random:b9t,rotateX:w9t,rotateY:x9t,rotateZ:S9t,round:m9t,scale:Uh,scaleAndAdd:W1e,set:Rl,sign:d9t,sqrDist:O9t,sqrLen:mne,squaredDistance:H8,squaredLength:mne,str:T9t,sub:I9t,subtract:Tc,transformMat3:PC,transformMat4:t2,transformQuat:W8},Symbol.toStringTag,{value:"Module"}));function q1e(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Wy(t,e,i,r,n){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t}function eUe(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t}function tUe(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t}function iUe(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3],t}function rUe(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t[3]=e[3]/i[3],t}function R9t(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function M9t(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function D9t(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t[3]=Math.min(e[3],i[3]),t}function F9t(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t[3]=Math.max(e[3],i[3]),t}function L9t(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function nUe(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}function N9t(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t[3]=e[3]+i[3]*r,t}function sUe(t,e){const i=e[0]-t[0],r=e[1]-t[1],n=e[2]-t[2],s=e[3]-t[3];return Math.sqrt(i*i+r*r+n*n+s*s)}function oUe(t,e){const i=e[0]-t[0],r=e[1]-t[1],n=e[2]-t[2],s=e[3]-t[3];return i*i+r*r+n*n+s*s}function Y1e(t){const e=t[0],i=t[1],r=t[2],n=t[3];return Math.sqrt(e*e+i*i+r*r+n*n)}function X1e(t){const e=t[0],i=t[1],r=t[2],n=t[3];return e*e+i*i+r*r+n*n}function k9t(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function $9t(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function aUe(t,e){const i=e[0],r=e[1],n=e[2],s=e[3];let o=i*i+r*r+n*n+s*s;return o>0&&(o=1/Math.sqrt(o),t[0]=i*o,t[1]=r*o,t[2]=n*o,t[3]=s*o),t}function lUe(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function K1e(t,e,i,r){const n=e[0],s=e[1],o=e[2],a=e[3];return t[0]=n+r*(i[0]-n),t[1]=s+r*(i[1]-s),t[2]=o+r*(i[2]-o),t[3]=a+r*(i[3]-a),t}function B9t(t,e){const i=ZH;let r,n,s,o,a,l;e=e||1;do r=2*i()-1,n=2*i()-1,a=r*r+n*n;while(a>=1);do s=2*i()-1,o=2*i()-1,l=s*s+o*o;while(l>=1);const c=Math.sqrt((1-a)/l);return t[0]=e*r,t[1]=e*n,t[2]=e*s*c,t[3]=e*o*c,t}function V9t(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3];return t[0]=i[0]*r+i[4]*n+i[8]*s+i[12]*o,t[1]=i[1]*r+i[5]*n+i[9]*s+i[13]*o,t[2]=i[2]*r+i[6]*n+i[10]*s+i[14]*o,t[3]=i[3]*r+i[7]*n+i[11]*s+i[15]*o,t}function j9t(t,e,i){const r=e[0],n=e[1],s=e[2],o=i[0],a=i[1],l=i[2],c=i[3],h=c*r+a*s-l*n,p=c*n+l*r-o*s,y=c*s+o*n-a*r,v=-o*r-a*n-l*s;return t[0]=h*c+v*-o+p*-l-y*-a,t[1]=p*c+v*-a+y*-o-h*-l,t[2]=y*c+v*-l+h*-a-p*-o,t[3]=e[3],t}function G9t(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function uUe(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function cUe(t,e){const i=t[0],r=t[1],n=t[2],s=t[3],o=e[0],a=e[1],l=e[2],c=e[3],h=qv();return Math.abs(i-o)<=h*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(r-a)<=h*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-l)<=h*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-c)<=h*Math.max(1,Math.abs(s),Math.abs(c))}Object.freeze(Object.defineProperty({__proto__:null,add:eUe,ceil:R9t,copy:q1e,dist:sUe,distance:sUe,div:rUe,divide:rUe,dot:lUe,equals:cUe,exactEquals:uUe,floor:M9t,inverse:$9t,len:Y1e,length:Y1e,lerp:K1e,max:F9t,min:D9t,mul:iUe,multiply:iUe,negate:k9t,normalize:aUe,random:B9t,round:L9t,scale:nUe,scaleAndAdd:N9t,set:Wy,sqrDist:oUe,sqrLen:X1e,squaredDistance:oUe,squaredLength:X1e,str:G9t,sub:tUe,subtract:tUe,transformMat4:V9t,transformQuat:j9t},Symbol.toStringTag,{value:"Module"}));const hUe=new Float32Array(1);function J1e(t){--t;for(let e=1;e<32;e<<=1)t|=t>>e;return t+1}function eu(t,e,i){return Math.min(Math.max(t,e),i)}function OC(t){return(t&t-1)==0}function q8(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}function tW(t,e,i){return t+(e-t)*i}function ew(t){return t*Math.PI/180}function _ne(t){return 180*t/Math.PI}function Z1e(t){return Math.acos(eu(t,-1,1))}function dUe(t){return Math.asin(eu(t,-1,1))}function Y8(t,e,i=1e-6){return t===e?!0:!Number.isFinite(t)||!Number.isFinite(e)?!1:(t>e?t-e:e-t)<=i}const bne=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function U9t(t){return bne.setFloat64(0,t),bne.getBigInt64(0)}function z9t(t){return bne.setBigInt64(0,t),bne.getFloat64(0)}const Q1e=BigInt("1000000");H9t(1);function H9t(t){const e=U9t(t=Math.abs(t)),i=z9t(e<=Q1e?Q1e:e-Q1e);return Math.abs(t-i)}function W9t(t,e,i=1e-6){if(t===e)return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;const r=Math.abs(t-e),n=Math.abs(t),s=Math.abs(e);if(t===0||e===0||n<1e-12&&s<1e-12){if(r>.01*i)return!1}else if(r/(n+s)>i)return!1;return!0}function ebe(t){return pUe(Math.max(-sA,Math.min(t,sA)))}function pUe(t){return hUe[0]=t,hUe[0]}function fUe(t,e){const i=Yv(t),r=dUe(t[2]/i),n=Math.atan2(t[1]/i,t[0]/i);return Rl(e,i,r,n),e}function mUe(t){const e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[3]*t[3]+t[4]*t[4]+t[5]*t[5],r=t[6]*t[6]+t[7]*t[7]+t[8]*t[8];return!(Y8(e,1)&&Y8(i,1)&&Y8(r,1))}const sA=pUe(34028234663852886e22);function wne(t){return eu(zre(t),0,255)}function xne(t,e,i){return t=Number(t),isNaN(t)?i:ti?i:t}let Sne=class $y{static blendColors(e,i,r,n=new $y){return n.r=Math.round(e.r+(i.r-e.r)*r),n.g=Math.round(e.g+(i.g-e.g)*r),n.b=Math.round(e.b+(i.b-e.b)*r),n.a=e.a+(i.a-e.a)*r,n._sanitize()}static fromRgb(e,i){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])),$y.fromArray(a,i)}return $y.fromArray(n.map(a=>parseFloat(a)),i)}if(s==="hsl"&&n.length===3||s==="hsla"&&n.length===4)return $y.fromArray(zGe(parseFloat(n[0]),parseFloat(n[1])/100,parseFloat(n[2])/100,parseFloat(n[3])),i)}return null}static fromHex(e,i=new $y){if(e.length!==4&&e.length!==7||e[0]!=="#")return null;const r=e.length===4?4:8,n=(1<{const a=s&n;s>>=r,i[o]=r===4?17*a:a}),i.a=1,i)}static fromArray(e,i=new $y){return i._set(Number(e[0]),Number(e[1]),Number(e[2]),Number(e[3])),isNaN(i.a)&&(i.a=1),i._sanitize()}static fromString(e,i){const r=UGe(e)?j1e(e):null;return r&&$y.fromArray(r,i)||$y.fromRgb(e,i)||$y.fromHex(e,i)}static fromJSON(e){return e&&new $y([e[0],e[1],e[2],e[3]/255])}static toUnitRGB(e){return ve(e)?[e.r/255,e.g/255,e.b/255]:null}static toUnitRGBA(e){return ve(e)?[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"?$y.fromString(e,this):Array.isArray(e)?$y.fromArray(e,this):(this._set(e.r??0,e.g??0,e.b??0,e.a??1),e instanceof $y||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(){const e=this.r.toString(16),i=this.g.toString(16),r=this.b.toString(16);return`#${e.length<2?"0"+e:e}${i.length<2?"0"+i:i}${r.length<2?"0"+r:r}`}toCss(e=!1){const i=this.r+", "+this.g+", "+this.b;return e?`rgba(${i}, ${this.a})`:`rgb(${i})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(e=$y.AlphaMode.ALWAYS){const i=wne(this.r),r=wne(this.g),n=wne(this.b);return e===$y.AlphaMode.ALWAYS||this.a!==1?[i,r,n,wne(255*this.a)]:[i,r,n]}clone(){return new $y(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(e){return ve(e)&&e.r===this.r&&e.g===this.g&&e.b===this.b&&e.a===this.a}_sanitize(){return this.r=Math.round(xne(this.r,0,255)),this.g=Math.round(xne(this.g,0,255)),this.b=Math.round(xne(this.b,0,255)),this.a=xne(this.a,0,1),this}_set(e,i,r,n){this.r=e,this.g=i,this.b=r,this.a=n}};Sne.prototype.declaredClass="esri.Color",function(t){var e;(e=t.AlphaMode||(t.AlphaMode={}))[e.ALWAYS=0]="ALWAYS",e[e.UNLESS_OPAQUE=1]="UNLESS_OPAQUE"}(Sne||(Sne={}));const en=Sne;function X8(t,e,i=!1){let{hasM:r,hasZ:n}=t;Array.isArray(e)?e.length!==4||r||n?e.length===3&&i&&!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)),t.hasZ=n,t.hasM=r}var tbe;function gUe(t){return(e,i)=>e==null?i:i==null?e:t(e,i)}function q9t(t){return t&&(t.declaredClass==="esri.geometry.SpatialReference"||t.wkid!=null)}let nR=tbe=class extends un{constructor(...t){super(...t),this.points=[],this.type="multipoint"}normalizeCtorArgs(t,e){if(!t&&!e)return{};const i={};Array.isArray(t)?(i.points=t,i.spatialReference=e):q9t(t)?i.spatialReference=t:(t.points&&(i.points=t.points),t.spatialReference&&(i.spatialReference=t.spatialReference),t.hasZ&&(i.hasZ=t.hasZ),t.hasM&&(i.hasM=t.hasM));const r=i.points&&i.points[0];return r&&(i.hasZ===void 0&&i.hasM===void 0?(i.hasZ=r.length>2,i.hasM=!1):i.hasZ===void 0?i.hasZ=r.length>3:i.hasM===void 0&&(i.hasM=r.length>3)),i}get cache(){return this.commitProperty("points"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const t=this.points;if(!t.length)return null;const e=new Ar,i=this.hasZ,r=this.hasM,n=i?3:2,s=t[0],o=gUe(Math.min),a=gUe(Math.max);let l,c,h,p,[y,v]=s,[x,I]=s;for(let P=0,F=t.length;P2){const Y=k[2];l=o(l,Y),h=a(h,Y)}if(r&&k.length>n){const Y=k[n];c=o(c,Y),p=a(p,Y)}}return e.xmin=y,e.ymin=v,e.xmax=x,e.ymax=I,e.spatialReference=this.spatialReference,i?(e.zmin=l,e.zmax=h):(e.zmin=void 0,e.zmax=void 0),r?(e.mmin=c,e.mmax=p):(e.mmin=void 0,e.mmax=void 0),e}writePoints(t,e){e.points=gi(this.points)}addPoint(t){return X8(this,t),Array.isArray(t)?this.points.push(t):this.points.push(t.toArray()),this.notifyChange("points"),this}clone(){const t={points:gi(this.points),spatialReference:this.spatialReference};return this.hasZ&&(t.hasZ=!0),this.hasM&&(t.hasM=!0),new tbe(t)}getPoint(t){if(!this._validateInputs(t))return null;const e=this.points[t],i={x:e[0],y:e[1],spatialReference:this.spatialReference};let r=2;return this.hasZ&&(i.z=e[2],r=3),this.hasM&&(i.m=e[r]),new er(i)}removePoint(t){if(!this._validateInputs(t))return null;const e=new er(this.points.splice(t,1)[0],this.spatialReference);return this.notifyChange("points"),e}setPoint(t,e){return this._validateInputs(t)?(X8(this,e),Array.isArray(e)||(e=e.toArray()),this.points[t]=e,this.notifyChange("points"),this):this}toJSON(t){return this.write({},t)}_validateInputs(t){return t!=null&&t>=0&&t2&&e.length>2){const n=t[2]-e[2];return Math.sqrt(i*i+r*r+n*n)}return Math.sqrt(i*i+r*r)}function X9t(t,e,i){const r=t[0]+i*(e[0]-t[0]),n=t[1]+i*(e[1]-t[1]);return t.length>2&&e.length>2?[r,n,t[2]+i*(e[2]-t[2])]:[r,n]}function yUe(t,e,i,r){const[n,s]=e,[o,a]=i[r],[l,c]=i[r+1],h=l-o,p=c-a,y=h*h+p*p,v=(n-o)*h+(s-a)*p,x=Math.min(1,Math.max(0,v/y));return t[0]=o+h*x,t[1]=a+p*x,t}function K9t(t,e,i){const r=i.rings;let n,s,o=!1,a=1/0;for(let l=0;le!=s[1]>e&&t<(s[0]-n[0])*(e-n[1])/(s[1]-n[1])+n[0]&&(o=!o),a=Math.min(a,J9t(t,e,n,s))}return a===0?0:(o?1:-1)*Math.sqrt(a)}function J9t(t,e,i,r){let n=i[0],s=i[1],o=r[0]-n,a=r[1]-s;if(o!==0||a!==0){const l=((t-n)*o+(e-s)*a)/(o*o+a*a);l>1?(n=r[0],s=r[1]):l>0&&(n+=o*l,s+=a*l)}return o=t-n,a=e-s,o*o+a*a}function Z9t(t,e){return X9t(t,e,.5)}function iW(t,e,i){const r=t.length;let n=0,s=0,o=0;for(let a=0;a2&&c.length>2&&i&&(s+=l[0]*c[2]-c[0]*l[2],h=3),l.length>h&&c.length>h&&e&&(o+=l[0]*c[h]-c[0]*l[h])}return n<=0&&s<=0&&o<=0}function Q9t(t){const e=t.length;return e>2&&_H(t[0],t[e-1])}function eBt(t){if("rings"in t&&(vUe(t),t.rings.length>0&&!iW(t.rings[0],t.hasM??!1,t.hasZ??!1)))for(const e of t.rings)e.reverse()}function vUe(t){if("rings"in t)for(const e of t.rings)Q9t(e)||e.push(e[0].slice())}function ibe(t){if(!t||t.length<3)return 0;let e=0;const i=t.length-1;for(let r=0;r{let a=s[2]-o[2];return a===0&&e&&(a=s[4]-o[4]),a}),r.length&&(i[0]=r[0][0],i[1]=r[0][1],e&&(i[2]=r[0][3]),(i[0]n[1]||i[1]n[3]||e&&(i[2]n[5]))&&(i.length=0)),!i.length){const s=t[0]&&t[0].length?iBt(t[0],e):null;if(!s)return null;i[0]=s[0],i[1]=s[1],e&&s.length>2&&(i[2]=s[2])}return i}function _Ue(t,e,i){let r=0,n=0,s=0,o=0,a=0;const l=t.length?t[0][0]:0,c=t.length?t[0][1]:0,h=t.length&&e?t[0][2]:0;for(let y=0;y2&&x.length>2){const he=F-h,_e=X-h,xe=k*_e-Z*he;s+=(he+_e)*xe,a+=xe}Ii[1]&&(i[1]=I),Pi[3]&&(i[3]=P),e&&(Fi[5]&&(i[5]=F))}if(o>0&&(o*=-1),a>0&&(a*=-1),!o)return null;o*=.5,a*=.5;const p=[r/(6*o)+l,n/(6*o)+c,o];return e&&(i[4]===i[5]||a===0?(p[3]=(i[4]+i[5])/2,p[4]=0):(p[3]=s/(6*a)+h,p[4]=a)),p}function iBt(t,e){const i=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,c=t.length;l2&&p.length>2&&(i[2]=h[2],r[2]=p[2]);const y=Y9t(i,r);if(y){n+=y;const v=Z9t(h,p);s+=y*v[0],o+=y*v[1],e&&v.length>2&&(a+=y*v[2])}}}return n>0?e?[s/n,o/n,a/n]:[s/n,o/n]:t.length?t[0]:null}const rBt=1e-6;function nBt(t){if(!t||!t.rings)return null;const{rings:e}=t;let i=0;for(let s=0;s2){const j=P[2];s=sR(s,j),o=oR(o,j)}if(r&&P.length>n){const j=P[n];a=sR(s,j),l=oR(o,j)}}}return i?r?(t[0]=c,t[1]=h,t[2]=s,t[3]=a,t[4]=p,t[5]=y,t[6]=o,t[7]=l,t.length=8,t):(t[0]=c,t[1]=h,t[2]=s,t[3]=p,t[4]=y,t[5]=o,t.length=6,t):r?(t[0]=c,t[1]=h,t[2]=a,t[3]=p,t[4]=y,t[5]=l,t.length=6,t):(t[0]=c,t[1]=h,t[2]=p,t[3]=y,t.length=4,t)}function EUe(t,e,i,r,n,s){const o=e.xmin,a=e.xmax,l=e.ymin,c=e.ymax;let h=e.zmin,p=e.zmax,y=e.mmin,v=e.mmax;return n?(h=h||0,p=p||0,s?(y=y||0,v=v||0,t[0]=o,t[1]=l,t[2]=h,t[3]=y,t[4]=a,t[5]=c,t[6]=p,t[7]=v,t):(t[0]=o,t[1]=l,t[2]=h,t[3]=a,t[4]=c,t[5]=p,t)):s?(y=y||0,v=v||0,t[0]=o,t[1]=l,t[2]=y,t[3]=a,t[4]=c,t[5]=v,t):(t[0]=o,t[1]=l,t[2]=a,t[3]=c,t)}function J8(t,e,i,r,n,s){const o=i?3:2,a=r&&s,l=i&&n;if(!e.length||!e[0].length)return null;let c,h,p,y,[v,x]=e[0],[I,P]=e[0];for(let F=0;F2){const Y=k[2];c=sR(c,Y),h=oR(h,Y)}if(a&&k.length>o){const Y=k[o];p=sR(c,Y),y=oR(h,Y)}}return n?(c=c||0,h=h||0,s?(p=p||0,y=y||0,t[0]=v,t[1]=x,t[2]=c,t[3]=p,t[4]=I,t[5]=P,t[6]=h,t[7]=y,t):(t[0]=v,t[1]=x,t[2]=c,t[3]=I,t[4]=P,t[5]=h,t)):s?(p=p||0,y=y||0,t[0]=v,t[1]=x,t[2]=p,t[3]=I,t[4]=P,t[5]=y,t):(t[0]=v,t[1]=x,t[2]=I,t[3]=P,t)}function aBt(t){return t.xmin!==void 0&&t.ymin!==void 0&&t.xmax!==void 0&&t.ymax!==void 0}function lBt(t){return t.points!==void 0}function uBt(t){return t.x!==void 0&&t.y!==void 0}function cBt(t){return t.paths!==void 0}function hBt(t){return t.rings!==void 0}const nbe=[];function IUe(t,e,i,r){return{xmin:t,ymin:e,xmax:i,ymax:r}}function AUe(t,e,i,r,n,s){return{xmin:t,ymin:e,zmin:i,xmax:r,ymax:n,zmax:s}}function PUe(t,e,i,r,n,s){return{xmin:t,ymin:e,mmin:i,xmax:r,ymax:n,mmax:s}}function OUe(t,e,i,r,n,s,o,a){return{xmin:t,ymin:e,zmin:i,mmin:r,xmax:n,ymax:s,zmax:o,mmax:a}}function sbe(t,e=!1,i=!1){return e?i?OUe(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]):AUe(t[0],t[1],t[2],t[3],t[4],t[5]):i?PUe(t[0],t[1],t[2],t[3],t[4],t[5]):IUe(t[0],t[1],t[2],t[3])}function obe(t){return t?aBt(t)?t:uBt(t)?pBt(t):hBt(t)?abe(t):cBt(t)?RUe(t):lBt(t)?dBt(t):null:null}function dBt(t){const{hasZ:e,hasM:i,points:r}=t;return sbe(J8(nbe,r,e??!1,i??!1),e,i)}function pBt(t){const{x:e,y:i,z:r,m:n}=t,s=n!=null;return r!=null?s?OUe(e,i,r,n,e,i,r,n):AUe(e,i,r,e,i,r):s?PUe(e,i,n,e,i,n):IUe(e,i,e,i)}function abe(t){const{hasZ:e,hasM:i,rings:r}=t,n=K8(nbe,r,e??!1,i??!1);return n?sbe(n,e,i):null}function RUe(t){const{hasZ:e,hasM:i,paths:r}=t,n=K8(nbe,r,e??!1,i??!1);return n?sbe(n,e,i):null}var Ene;function MUe(t){return!Array.isArray(t[0])}let MC=Ene=class extends un{static fromExtent(t){const e=t.clone().normalize(),i=t.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 c=0;c2,r=s.length>3):i===void 0?i=r?s.length>3:s.length>2:r===void 0&&(r=i?s.length>3:s.length>2)),{rings:n,spatialReference:e,hasZ:i,hasM:r}}get cache(){return this.commitProperty("rings"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get centroid(){const t=Cne(this);if(!t||isNaN(t[0])||isNaN(t[1])||this.hasZ&&isNaN(t[2]))return null;const e=new er;return e.x=t[0],e.y=t[1],e.spatialReference=this.spatialReference,this.hasZ&&(e.z=t[2]),e}get extent(){const{spatialReference:t}=this,e=abe(this);if(!e)return null;const i=new Ar(e);return i.spatialReference=t,i}get isSelfIntersecting(){return S8t(this.rings)}writeRings(t,e){e.rings=gi(this.rings)}addRing(t){if(!t)return;const e=this.rings,i=e.length;if(MUe(t)){const r=[];for(let n=0,s=t.length;nn===l&&s===c&&(o==null&&h==null||o===h)&&(a==null&&p==null||a===p);for(let n=0;nthis.hasZ?this.hasM?[i.x,i.y,i.z,i.m]:[i.x,i.y,i.z]:[i.x,i.y]):t,iW(e,this.hasM,this.hasZ)}getPoint(t,e){if(!this._validateInputs(t,e))return null;const i=this.rings[t][e],r=this.hasZ,n=this.hasM;return r&&!n?new er(i[0],i[1],i[2],void 0,this.spatialReference):n&&!r?new er(i[0],i[1],void 0,i[2],this.spatialReference):r&&n?new er(i[0],i[1],i[2],i[3],this.spatialReference):new er(i[0],i[1],this.spatialReference)}insertPoint(t,e,i){return this._validateInputs(t,e,!0)?(X8(this,i),Array.isArray(i)||(i=i.toArray()),this.rings[t].splice(e,0,i),this.notifyChange("rings"),this):this}removePoint(t,e){if(!this._validateInputs(t,e))return null;const i=new er(this.rings[t].splice(e,1)[0],this.spatialReference);return this.notifyChange("rings"),i}removeRing(t){if(!this._validateInputs(t,null))return null;const e=this.rings.splice(t,1)[0],i=this.spatialReference,r=e.map(n=>new er(n,i));return this.notifyChange("rings"),r}setPoint(t,e,i){return this._validateInputs(t,e)?(X8(this,i),Array.isArray(i)||(i=i.toArray()),this.rings[t][e]=i,this.notifyChange("rings"),this):this}_validateInputs(t,e,i=!1){if(t==null||t<0||t>=this.rings.length)return!1;if(e!=null){const r=this.rings[t];if(i&&(e<0||e>r.length)||!i&&(e<0||e>=r.length))return!1}return!0}toJSON(t){return this.write({},t)}};E([N({readOnly:!0})],MC.prototype,"cache",null),E([N({readOnly:!0})],MC.prototype,"centroid",null),E([N({readOnly:!0})],MC.prototype,"extent",null),E([N({readOnly:!0})],MC.prototype,"isSelfIntersecting",null),E([N({type:[[[Number]]],json:{write:{isRequired:!0}}})],MC.prototype,"rings",void 0),E([Cr("rings")],MC.prototype,"writeRings",null),MC=Ene=E([dt("esri.geometry.Polygon")],MC),MC.prototype.toJSON.isDefaultToJSON=!0;const To=MC;var lbe;function fBt(t){return!Array.isArray(t[0])}let aR=lbe=class extends un{constructor(...t){super(...t),this.paths=[],this.type="polyline"}normalizeCtorArgs(t,e){let i,r,n=null,s=null;return t&&!Array.isArray(t)?(n=t.paths?t.paths:null,e||(t.spatialReference?e=t.spatialReference:t.paths||(e=t)),i=t.hasZ,r=t.hasM):n=t,n=n||[],e=e||hr.WGS84,n.length&&n[0]&&n[0][0]!=null&&typeof n[0][0]=="number"&&(n=[n]),s=n[0]&&n[0][0],s&&(i===void 0&&r===void 0?(i=s.length>2,r=!1):i===void 0?i=!r&&s.length>3:r===void 0&&(r=!i&&s.length>3)),{paths:n,spatialReference:e,hasZ:i,hasM:r}}get cache(){return this.commitProperty("paths"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const{spatialReference:t}=this,e=RUe(this);if(!e)return null;const i=new Ar(e);return i.spatialReference=t,i}writePaths(t,e){e.paths=gi(this.paths)}addPath(t){if(!t)return;const e=this.paths,i=e.length;if(fBt(t)){const r=[];for(let n=0,s=t.length;nnew er(n,i));return this.notifyChange("paths"),r}removePoint(t,e){if(!this._validateInputs(t,e))return null;const i=new er(this.paths[t].splice(e,1)[0],this.spatialReference);return this.notifyChange("paths"),i}setPoint(t,e,i){return this._validateInputs(t,e)?(X8(this,i),Array.isArray(i)||(i=i.toArray()),this.paths[t][e]=i,this.notifyChange("paths"),this):this}_validateInputs(t,e,i=!1){if(t==null||t<0||t>=this.paths.length)return!1;if(e!=null){const r=this.paths[t];if(i&&(e<0||e>r.length)||!i&&(e<0||e>=r.length))return!1}return!0}toJSON(t){return this.write({},t)}};E([N({readOnly:!0})],aR.prototype,"cache",null),E([N({readOnly:!0})],aR.prototype,"extent",null),E([N({type:[[[Number]]],json:{write:{isRequired:!0}}})],aR.prototype,"paths",void 0),E([Cr("paths")],aR.prototype,"writePaths",null),aR=lbe=E([dt("esri.geometry.Polyline")],aR),aR.prototype.toJSON.isDefaultToJSON=!0;const Oa=aR;function mc(t){return t.xmin!==void 0&&t.ymin!==void 0&&t.xmax!==void 0&&t.ymax!==void 0}function lg(t){return t.points!==void 0}function qy(t){return t.x!==void 0&&t.y!==void 0}function Hu(t){return t.paths!==void 0}function Xa(t){return t.rings!==void 0}function Sl(t){return lt(t)?null:t instanceof un?t:qy(t)?er.fromJSON(t):Hu(t)?Oa.fromJSON(t):Xa(t)?To.fromJSON(t):lg(t)?_d.fromJSON(t):mc(t)?Ar.fromJSON(t):null}function bd(t){return t?qy(t)?"esriGeometryPoint":Hu(t)?"esriGeometryPolyline":Xa(t)?"esriGeometryPolygon":mc(t)?"esriGeometryEnvelope":lg(t)?"esriGeometryMultipoint":null:null}const mBt={esriGeometryPoint:er,esriGeometryPolyline:Oa,esriGeometryPolygon:To,esriGeometryEnvelope:Ar,esriGeometryMultipoint:_d};function gBt(t){return t&&mBt[t]||null}const Yy=ta()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),Ine=ta()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),R1={base:un,key:"type",typeMap:{extent:Ar,multipoint:_d,point:er,polyline:Oa,polygon:To}};wC(R1);const _a=t=>{let e=class extends t{clone(){const i=Ou(Mp(this),"unable to clone instance of non-accessor class"),r=i.metadatas,n=i.store,s={},o=new Map;for(const l in r){const c=r[l],h=n?.originOf(l),p=c.clonable;if(c.readOnly||p===!1||h!==Yn.USER&&h!==Yn.DEFAULTS&&h!==Yn.WEB_MAP&&h!==Yn.WEB_SCENE)continue;const y=this[l];let v=null;v=typeof p=="function"?p(y):p==="reference"?y:b_e(y),y!=null&&v==null||(h===Yn.DEFAULTS?o.set(l,v):s[l]=v)}const a=new(Object.getPrototypeOf(this)).constructor(s);if(o.size){const l=Mp(a)?.store;if(l)for(const[c,h]of o)l.set(c,h,Yn.DEFAULTS)}return a}};return e=E([dt("esri.core.Clonable")],e),e};let Z8=class extends _a(Tn){};Z8=E([dt("esri.core.Clonable")],Z8);var Q8;function yBt(t,e){switch(t.type){case"range":{const i="range"in t?t.range[0]:t.minValue,r="range"in t?t.range[1]:t.maxValue;if(i!=null&&+er)return Q8.VALUE_OUT_OF_RANGE;break}case"coded-value":case"codedValue":if(t.codedValues==null||t.codedValues.every(i=>i==null||i.code!==e))return Q8.INVALID_CODED_VALUE}return null}(function(t){t.VALUE_OUT_OF_RANGE="domain-validation-error::value-out-of-range",t.INVALID_CODED_VALUE="domain-validation-error::invalid-coded-value"})(Q8||(Q8={}));const vBt=Oi.getLogger("esri.support.arcadeOnDemand");let ube;function Kv(){return ube||(ube=(async()=>{const t=await Promise.resolve().then(()=>_mt);return{arcade:t.arcade,arcadeUtils:t,Dictionary:t.Dictionary,Feature:t.arcadeFeature}})()),ube}const _Bt=(t,e,i)=>lR.create(t,e,i,null,["$feature"]),Ane=(t,e,i)=>lR.create(t,e,i,null,["$feature","$view"]),bBt=(t,e,i,r)=>lR.create(t,e,i,r,["$feature","$view"]);let lR=class VLt{constructor(e,i,r,n,s,o,a){this.script=e,this.evaluate=n;const l=Array.isArray(o)?o:o.fields;this.fields=l,this._syntaxTree=r,this._arcade=i,this._arcadeFeature=s,this._spatialReference=a,this._referencesGeometry=i.scriptTouchesGeometry(this._syntaxTree),this._referencesScale=this._arcade.referencesMember(this._syntaxTree,"scale")}static async create(e,i,r,n,s,o){const{arcade:a,Feature:l,Dictionary:c}=await Kv(),h=hr.fromJSON(i);let p;try{p=a.parseScript(e,o)}catch(ie){return vBt.error(new st("arcade-bad-expression","Failed to parse arcade script",{script:e,error:ie})),null}const y=s.reduce((ie,ce)=>({...ie,[ce]:null}),{});let v=null;ve(n)&&(v=new c(n),v.immutable=!0,y.$config=null);const x=a.scriptUsesGeometryEngine(p),I=x&&a.enableGeometrySupport(),P=a.scriptUsesFeatureSet(p)&&a.enableFeatureSetSupport(),F=a.scriptIsAsync(p),k=F&&a.enableAsyncSupport(),j={vars:y,spatialReference:h,useAsync:!!k};await Promise.all([I,P,k]);const V=new Set;await a.loadDependentModules(V,p,null,F,x);const Y=new c;Y.immutable=!1,Y.setField("scale",0);const X=a.compileScript(p,j),Z=ie=>("$view"in ie&&ie.$view&&(Y.setField("scale",typeof ie.$view=="object"?ie.$view.scale:void 0),ie.$view=Y),v&&(ie.$config=v),X({vars:ie,spatialReference:h}));return new VLt(e,a,p,Z,new l,r,h)}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 wBt=/^([0-9])/,xBt=/[^a-z0-9_\u0080-\uffff]/gi,SBt=/_{2,}/g,CBt=/^_/,TBt=/_$/;function e9(t){return t==null?null:t.trim().replace(xBt,"_").replace(SBt,"_").replace(CBt,"").replace(TBt,"").replace(wBt,"F$1")||null}const EBt=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],IBt=["field","normalizationField"];function M1(t,e){if(t!=null&&e!=null){for(const i of Array.isArray(t)?t:[t])if(DUe(EBt,i,e),"visualVariables"in i&&i.visualVariables)for(const r of i.visualVariables)DUe(IBt,r,e)}}function DUe(t,e,i){if(t)for(const r of t){const n=Yx(r,e),s=n&&typeof n!="function"&&i.get(n);s&&Dp(r,s.name,e)}}function RL(t,e){if(t!=null&&e?.fields?.length)if("startField"in t){const i=e.get(t.startField),r=e.get(t.endField);t.startField=i?.name??null,t.endField=r?.name??null}else{const i=e.get(t.startTimeField),r=e.get(t.endTimeField);t.startTimeField=i?.name??null,t.endTimeField=r?.name??null}}const cbe=new Set;function rW(t,e){return t&&e?(cbe.clear(),uR(cbe,t,e),Array.from(cbe).sort()):[]}function uR(t,e,i){if(i)if(e?.fields?.length)if(i.includes("*"))for(const{name:r}of e.fields)t.add(r);else for(const r of i)Xy(t,e,r);else{if(i.includes("*"))return t.clear(),void t.add("*");for(const r of i)r!=null&&t.add(r)}}function Xy(t,e,i){if(typeof i=="string")if(e){const r=e.get(i);r&&t.add(r.name)}else t.add(i)}function Pne(t,e){return lt(e)||lt(t)?[]:e.includes("*")?(t.fields??[]).map(i=>i.name):e}async function ev(t,e,i){if(!i)return;const{arcadeUtils:r}=await Kv(),n=r.extractFieldNames(i,e?.fields?.map(s=>s.name));for(const s of n)Xy(t,e,s)}async function FUe(t,e,i){if(i&&i!=="1=1"){const r=(await Promise.resolve().then(()=>jde)).WhereClause.create(i,e);if(!r.isStandardized)throw new st("fieldUtils:collectFilterFields","Where clause is not standardized",{where:i});uR(t,e,r.fieldNames)}}function ABt({displayField:t,fields:e}){return t||(e&&e.length?hbe(e,"name-or-title")||hbe(e,"unique-identifier")||hbe(e,"type-or-category")||PBt(e):null)}function PBt(t){for(const e of t){if(!e||!e.name)continue;const i=e.name.toLowerCase();if(i.includes("name")||i.includes("title"))return e.name}return null}function hbe(t,e){for(const i of t)if(i&&i.valueType&&i.valueType===e)return i.name;return null}async function OBt(t,e){if(!e)return;const i=e.elevationInfo?.featureExpressionInfo;return i?i.collectRequiredFields(t,e.fieldsIndex):void 0}function RBt(t,e,i){i.onStatisticExpression?ev(t,e,i.onStatisticExpression.expression):t.add(i.onStatisticField)}async function MBt(t,e,i){if(!e||!i||!("fields"in i))return;const r=[],n=i.popupTemplate;r.push(DBt(t,e,n)),i.fields&&r.push(...i.fields.map(async s=>RBt(t,e.fieldsIndex,s))),await Promise.all(r)}async function DBt(t,e,i){const r=[];i?.expressionInfos&&r.push(...i.expressionInfos.map(s=>ev(t,e.fieldsIndex,s.expression)));const n=i?.content;if(Array.isArray(n))for(const s of n)s.type==="expression"&&s.expressionInfo&&r.push(ev(t,e.fieldsIndex,s.expressionInfo.expression));await Promise.all(r)}async function LUe(t,e,i){e&&(e.timeInfo&&ve(i)&&i.timeExtent&&uR(t,e.fieldsIndex,[e.timeInfo.startField,e.timeInfo.endField]),e.floorInfo&&uR(t,e.fieldsIndex,[e.floorInfo.floorField]),ve(i)&&ve(i.where)&&await FUe(t,e.fieldsIndex,i.where))}async function FBt(t,e,i){e&&i&&await Promise.all(i.map(r=>LBt(t,e,r)))}async function LBt(t,e,i){e&&i&&(i.valueExpression?await ev(t,e.fieldsIndex,i.valueExpression):i.field&&Xy(t,e.fieldsIndex,i.field))}function NBt(t){if(!t)return[];const e="editFieldsInfo"in t&&t.editFieldsInfo;return e?rW(t.fieldsIndex,[e&&e.creatorField,e&&e.creationDateField,e&&e.editorField,e&&e.editDateField]):[]}async function NUe(t,e){const{labelingInfo:i,fieldsIndex:r}=e;i&&i.length&&await Promise.all(i.map(n=>kBt(t,r,n)))}async function kBt(t,e,i){if(!i)return;const r=i.getLabelExpression(),n=i.where;if(r.type==="arcade")await ev(t,e,r.expression);else{const s=r.expression.match(/{[^}]*}/g);s&&s.forEach(o=>{Xy(t,e,o.slice(1,-1))})}await FUe(t,e,n)}function One(t){const e=t.defaultValue;return e!==void 0&&BUe(t,e)?e:t.nullable?null:void 0}function kUe(t){return typeof t=="number"&&!isNaN(t)&&isFinite(t)}function $Bt(t){return t===null||kUe(t)}const dbe="isInteger"in Number?Number.isInteger:t=>typeof t=="number"&&isFinite(t)&&Math.floor(t)===t;function BBt(t){return t===null||dbe(t)}function $Ue(t){return t!=null&&typeof t=="string"}function VBt(t){return t===null||$Ue(t)}function jBt(){return!0}function BUe(t,e){let i;switch(t.type){case"date":case"integer":case"long":case"small-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":i=t.nullable?BBt:dbe;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":i=t.nullable?$Bt:kUe;break;case"string":case"esriFieldTypeString":i=t.nullable?VBt:$Ue;break;default:i=jBt}return arguments.length===1?i:i(e)}const GBt=["integer","small-integer","single","double"],UBt=new Set([...GBt,"esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSingle","esriFieldTypeDouble"]);function t9(t){return t!=null&&UBt.has(t.type)}function pbe(t){return t!=null&&(t.type==="string"||t.type==="esriFieldTypeString")}var Rne,Mne;function zBt(t){return t==null||typeof t=="number"&&isNaN(t)?null:t}function HBt(t,e){return t==null||t.nullable&&e===null?null:t9(t)&&!WBt(t.type,Number(e))?Rne.OUT_OF_RANGE:BUe(t,e)?t.domain?yBt(t.domain,e):null:Mne.INVALID_TYPE}function WBt(t,e){const i=typeof t=="string"?VUe(t):t;if(!i)return!1;const r=i.min,n=i.max;return i.isInteger?dbe(e)&&e>=r&&e<=n:e>=r&&e<=n}function VUe(t){switch(t){case"esriFieldTypeSmallInteger":case"small-integer":return qBt;case"esriFieldTypeInteger":case"integer":return YBt;case"esriFieldTypeSingle":case"single":return XBt;case"esriFieldTypeDouble":case"double":return KBt}}(function(t){t.OUT_OF_RANGE="numeric-range-validation-error::out-of-range"})(Rne||(Rne={})),function(t){t.INVALID_TYPE="type-validation-error::invalid-type"}(Mne||(Mne={}));const qBt={min:-32768,max:32767,isInteger:!0},YBt={min:-2147483648,max:2147483647,isInteger:!0},XBt={min:-34e37,max:12e37,isInteger:!1},KBt={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1};function JBt(t,e,i){switch(t){case Q8.INVALID_CODED_VALUE:return`Value ${i} is not in the coded domain - field: ${e.name}, domain: ${JSON.stringify(e.domain)}`;case Q8.VALUE_OUT_OF_RANGE:return`Value ${i} is out of the range of valid values - field: ${e.name}, domain: ${JSON.stringify(e.domain)}`;case Mne.INVALID_TYPE:return`Value ${i} is not a valid value for the field type - field: ${e.name}, type: ${e.type}, nullable: ${e.nullable}`;case Rne.OUT_OF_RANGE:{const{min:r,max:n}=VUe(e.type);return`Value ${i} is out of range for the number type - field: ${e.name}, type: ${e.type}, value range is ${r} to ${n}`}}}function jUe(t,e){return!ZBt(t,e,null)}function ZBt(t,e,i){if(!e||!e.attributes||!t){if(ve(i))for(const s of t??[])i.add(s);return!0}const r=e.attributes;let n=!1;for(const s of t)if(!(s in r)){if(n=!0,!ve(i))break;i.add(s)}return n}function GUe(t){return!!t&&["raster.itempixelvalue","raster.servicepixelvalue"].some(e=>t.toLowerCase().startsWith(e))}let Dne=class extends Ui{constructor(e){super(e),this.type=null}};E([N({type:["attachments","custom","fields","media","text","expression","relationship"],readOnly:!0,json:{read:!1,write:!0}})],Dne.prototype,"type",void 0),Dne=E([dt("esri.popup.content.Content")],Dne);const cR=Dne;var fbe;let ML=fbe=class extends cR{constructor(t){super(t),this.description=null,this.displayType="auto",this.title=null,this.type="attachments"}clone(){return new fbe({description:this.description,displayType:this.displayType,title:this.title})}};E([N({type:String,json:{write:!0}})],ML.prototype,"description",void 0),E([N({type:["auto","preview","list"],json:{write:!0}})],ML.prototype,"displayType",void 0),E([N({type:String,json:{write:!0}})],ML.prototype,"title",void 0),E([N({type:["attachments"],readOnly:!0,json:{read:!1,write:!0}})],ML.prototype,"type",void 0),ML=fbe=E([dt("esri.popup.content.AttachmentsContent")],ML);const nW=ML;var mbe;let DL=mbe=class extends cR{constructor(t){super(t),this.creator=null,this.destroyer=null,this.outFields=null,this.type="custom"}clone(){return new mbe({creator:this.creator,destroyer:this.destroyer,outFields:Array.isArray(this.outFields)?gi(this.outFields):null})}};E([N()],DL.prototype,"creator",void 0),E([N()],DL.prototype,"destroyer",void 0),E([N()],DL.prototype,"outFields",void 0),E([N({type:["custom"],readOnly:!0})],DL.prototype,"type",void 0),DL=mbe=E([dt("esri.popup.content.CustomContent")],DL);const QBt=DL;var gbe;let i9=gbe=class extends Ui{constructor(t){super(t),this.title=null,this.expression=null,this.returnType="dictionary"}clone(){return new gbe({title:this.title,expression:this.expression})}};E([N({type:String,json:{write:!0}})],i9.prototype,"title",void 0),E([N({type:String,json:{write:!0}})],i9.prototype,"expression",void 0),E([N({type:["dictionary"],readOnly:!0,json:{read:!1,write:!0}})],i9.prototype,"returnType",void 0),i9=gbe=E([dt("esri.popup.ElementExpressionInfo")],i9);const UUe=i9;var ybe;let sW=ybe=class extends cR{constructor(t){super(t),this.expressionInfo=null,this.type="expression"}clone(){return new ybe({expressionInfo:this.expressionInfo?.clone()})}};E([N({type:UUe,json:{write:!0}})],sW.prototype,"expressionInfo",void 0),E([N({type:["expression"],readOnly:!0,json:{read:!1,write:!0}})],sW.prototype,"type",void 0),sW=ybe=E([dt("esri.popup.content.ExpressionContent")],sW);const vbe=sW;function rn(t,e={}){const i=t instanceof Ks?t:new Ks(t,e),r={type:e?.ignoreUnknown??1?i.apiValues:String,json:{type:i.jsonValues,read:!e?.readOnly&&{reader:i.read},write:{writer:i.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),N(r)}const oW=ta()({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"});oW.toJSON.bind(oW),oW.fromJSON.bind(oW);const DC={year:"numeric",month:"numeric",day:"numeric"},aW={year:"numeric",month:"long",day:"numeric"},lW={year:"numeric",month:"short",day:"numeric"},uW={year:"numeric",month:"long",weekday:"long",day:"numeric"},tw={hour:"numeric",minute:"numeric"},i2={...tw,second:"numeric"},_be={"short-date":DC,"short-date-short-time":{...DC,...tw},"short-date-short-time-24":{...DC,...tw,hour12:!1},"short-date-long-time":{...DC,...i2},"short-date-long-time-24":{...DC,...i2,hour12:!1},"short-date-le":DC,"short-date-le-short-time":{...DC,...tw},"short-date-le-short-time-24":{...DC,...tw,hour12:!1},"short-date-le-long-time":{...DC,...i2},"short-date-le-long-time-24":{...DC,...i2,hour12:!1},"long-month-day-year":aW,"long-month-day-year-short-time":{...aW,...tw},"long-month-day-year-short-time-24":{...aW,...tw,hour12:!1},"long-month-day-year-long-time":{...aW,...i2},"long-month-day-year-long-time-24":{...aW,...i2,hour12:!1},"day-short-month-year":lW,"day-short-month-year-short-time":{...lW,...tw},"day-short-month-year-short-time-24":{...lW,...tw,hour12:!1},"day-short-month-year-long-time":{...lW,...i2},"day-short-month-year-long-time-24":{...lW,...i2,hour12:!1},"long-date":uW,"long-date-short-time":{...uW,...tw},"long-date-short-time-24":{...uW,...tw,hour12:!1},"long-date-long-time":{...uW,...i2},"long-date-long-time-24":{...uW,...i2,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":tw,"long-time":i2},cW=ta()({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"});cW.apiValues,cW.toJSON.bind(cW),cW.fromJSON.bind(cW);const eVt={ar:"ar-u-nu-latn-ca-gregory"};let bbe=new WeakMap,zUe=_be["short-date-short-time"];function tVt(t){const e=t||zUe;let i=bbe.get(e);if(!i){const r=Z0(),n=eVt[Z0()]||r;i=new Intl.DateTimeFormat(n,e),bbe.set(e,i)}return i}function Fne(t){return t?_be[t]:null}function FC(t,e){return tVt(e).format(t)}R1e(()=>{bbe=new WeakMap,zUe=_be["short-date-short-time"]});const iVt={ar:"ar-u-nu-latn"};let Lne=new WeakMap,HUe={};function rVt(t){const e=t||HUe;if(!Lne.has(e)){const i=Z0(),r=iVt[Z0()]||i;Lne.set(e,new Intl.NumberFormat(r,t))}return Lne.get(e)}function WUe(t={}){const e={};return t.digitSeparator!=null&&(e.useGrouping=t.digitSeparator),t.places!=null&&(e.minimumFractionDigits=e.maximumFractionDigits=t.places),e}function oA(t,e){return t===-0&&(t=0),rVt(e).format(t)}R1e(()=>{Lne=new WeakMap,HUe={}});var wbe;let FL=wbe=class extends Ui{constructor(t){super(t),this.dateFormat=null,this.dateTimeFormatOptions=null,this.digitSeparator=!1,this.places=null}clone(){return new wbe({dateFormat:this.dateFormat,digitSeparator:this.digitSeparator,places:this.places})}format(t){return this.dateFormat?FC(t,{...Fne(this.dateFormat),...this.dateTimeFormatOptions}):oA(t,WUe(this))}formatRasterPixelValue(t){if(t.includes("-"))return t;let e,i;return t.trim().includes(",")?(e=",",i=e+" ",this._formatDelimitedString(t,e,i,this)):t.trim().includes(";")?(e=";",i=e+" ",this._formatDelimitedString(t,e,i,this)):t.trim().includes(" ")?(e=i=" ",this._formatDelimitedString(t,e,i,this)):this.format(Number(t))}_formatDelimitedString(t,e,i,r){return t&&e&&i&&r?t.trim().split(e).map(n=>this.format(Number(n))).join(i):t}};E([rn(oW)],FL.prototype,"dateFormat",void 0),E([N({type:Object,json:{read:!1}})],FL.prototype,"dateTimeFormatOptions",void 0),E([N({type:Boolean,json:{write:!0}})],FL.prototype,"digitSeparator",void 0),E([N({type:Ls,json:{write:!0}})],FL.prototype,"places",void 0),FL=wbe=E([dt("esri.popup.support.FieldInfoFormat")],FL);const r9=FL;var xbe;let r2=xbe=class extends Ui{constructor(t){super(t),this.fieldName=null,this.format=null,this.isEditable=!1,this.label=null,this.stringFieldOption="text-box",this.statisticType=null,this.tooltip=null,this.visible=!0}clone(){return new xbe({fieldName:this.fieldName,format:this.format?gi(this.format):null,isEditable:this.isEditable,label:this.label,stringFieldOption:this.stringFieldOption,statisticType:this.statisticType,tooltip:this.tooltip,visible:this.visible})}};E([N({type:String,json:{write:!0}})],r2.prototype,"fieldName",void 0),E([N({type:r9,json:{write:!0}})],r2.prototype,"format",void 0),E([N({type:Boolean,json:{write:!0,default:!1}})],r2.prototype,"isEditable",void 0),E([N({type:String,json:{write:!0}})],r2.prototype,"label",void 0),E([rn(new Ks({richtext:"rich-text",textarea:"text-area",textbox:"text-box"}),{default:"text-box"})],r2.prototype,"stringFieldOption",void 0),E([N({type:["count","sum","min","max","avg","stddev","var"],json:{write:!0}})],r2.prototype,"statisticType",void 0),E([N({type:String,json:{write:!0}})],r2.prototype,"tooltip",void 0),E([N({type:Boolean,json:{write:!0}})],r2.prototype,"visible",void 0),r2=xbe=E([dt("esri.popup.FieldInfo")],r2);const hW=r2;var Sbe;let aA=Sbe=class extends cR{constructor(t){super(t),this.attributes=null,this.description=null,this.fieldInfos=null,this.title=null,this.type="fields"}writeFieldInfos(t,e){e.fieldInfos=t&&t.map(i=>i.toJSON())}clone(){return new Sbe(gi({attributes:this.attributes,description:this.description,fieldInfos:this.fieldInfos,title:this.title}))}};E([N({type:Object,json:{write:!0}})],aA.prototype,"attributes",void 0),E([N({type:String,json:{write:!0}})],aA.prototype,"description",void 0),E([N({type:[hW]})],aA.prototype,"fieldInfos",void 0),E([Cr("fieldInfos")],aA.prototype,"writeFieldInfos",null),E([N({type:String,json:{write:!0}})],aA.prototype,"title",void 0),E([N({type:["fields"],readOnly:!0,json:{read:!1,write:!0}})],aA.prototype,"type",void 0),aA=Sbe=E([dt("esri.popup.content.FieldsContent")],aA);const n9=aA;let LL=class extends Ui{constructor(e){super(e),this.altText=null,this.caption="",this.title="",this.type=null}};E([N({type:String,json:{write:!0}})],LL.prototype,"altText",void 0),E([N({type:String,json:{write:!0}})],LL.prototype,"caption",void 0),E([N({type:String,json:{write:!0}})],LL.prototype,"title",void 0),E([N({type:["image","bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],LL.prototype,"type",void 0),LL=E([dt("esri.popup.content.mixins.MediaInfo")],LL);const Cbe=LL;var Tbe;let s9=Tbe=class extends Tn{constructor(t){super(t),this.fieldName=null,this.tooltip=null,this.value=null}clone(){return new Tbe({fieldName:this.fieldName,tooltip:this.tooltip,value:this.value})}};E([N()],s9.prototype,"fieldName",void 0),E([N()],s9.prototype,"tooltip",void 0),E([N()],s9.prototype,"value",void 0),s9=Tbe=E([dt("esri.popup.content.support.ChartMediaInfoValueSeries")],s9);const qUe=s9;var Ebe;let NL=Ebe=class extends Ui{constructor(t){super(t),this.fields=[],this.normalizeField=null,this.series=[],this.tooltipField=null}clone(){return new Ebe({fields:gi(this.fields),normalizeField:this.normalizeField,tooltipField:this.tooltipField})}};E([N({type:[String],json:{write:!0}})],NL.prototype,"fields",void 0),E([N({type:String,json:{write:!0}})],NL.prototype,"normalizeField",void 0),E([N({type:[qUe],json:{read:!1}})],NL.prototype,"series",void 0),E([N({type:String,json:{write:!0}})],NL.prototype,"tooltipField",void 0),NL=Ebe=E([dt("esri.popup.content.support.ChartMediaInfoValue")],NL);const nVt=NL;let dW=class extends Cbe{constructor(e){super(e),this.type=null,this.value=null}};E([N({type:["bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],dW.prototype,"type",void 0),E([N({type:nVt,json:{write:!0}})],dW.prototype,"value",void 0),dW=E([dt("esri.popup.content.mixins.ChartMediaInfo")],dW);const Nne=dW,kne=ta()({barchart:"bar-chart",columnchart:"column-chart",linechart:"line-chart",piechart:"pie-chart"});var Ibe;let $ne=Ibe=class extends Nne{constructor(t){super(t),this.type="bar-chart"}clone(){return new Ibe({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};E([N({type:["bar-chart"],readOnly:!0,json:{type:["barchart"],read:!1,write:kne.write}})],$ne.prototype,"type",void 0),$ne=Ibe=E([dt("esri.popup.content.BarChartMediaInfo")],$ne);const YUe=$ne;var Abe;let Bne=Abe=class extends Nne{constructor(t){super(t),this.type="column-chart"}clone(){return new Abe({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};E([N({type:["column-chart"],readOnly:!0,json:{type:["columnchart"],read:!1,write:kne.write}})],Bne.prototype,"type",void 0),Bne=Abe=E([dt("esri.popup.content.ColumnChartMediaInfo")],Bne);const XUe=Bne;var Pbe;let pW=Pbe=class extends Ui{constructor(t){super(t),this.linkURL=null,this.sourceURL=null}clone(){return new Pbe({linkURL:this.linkURL,sourceURL:this.sourceURL})}};E([N({type:String,json:{write:!0}})],pW.prototype,"linkURL",void 0),E([N({type:String,json:{write:!0}})],pW.prototype,"sourceURL",void 0),pW=Pbe=E([dt("esri.popup.content.support.ImageMediaInfoValue")],pW);const sVt=pW;var Obe;let o9=Obe=class extends Cbe{constructor(t){super(t),this.refreshInterval=null,this.type="image",this.value=null}clone(){return new Obe({altText:this.altText,title:this.title,caption:this.caption,refreshInterval:this.refreshInterval,value:this.value?this.value.clone():null})}};E([N({type:Number,json:{write:!0}})],o9.prototype,"refreshInterval",void 0),E([N({type:["image"],readOnly:!0,json:{read:!1,write:!0}})],o9.prototype,"type",void 0),E([N({type:sVt,json:{write:!0}})],o9.prototype,"value",void 0),o9=Obe=E([dt("esri.popup.content.ImageMediaInfo")],o9);const KUe=o9;var Rbe;let Vne=Rbe=class extends Nne{constructor(t){super(t),this.type="line-chart"}clone(){return new Rbe({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};E([N({type:["line-chart"],readOnly:!0,json:{type:["linechart"],read:!1,write:kne.write}})],Vne.prototype,"type",void 0),Vne=Rbe=E([dt("esri.popup.content.LineChartMediaInfo")],Vne);const JUe=Vne;var Mbe;let jne=Mbe=class extends Nne{constructor(t){super(t),this.type="pie-chart"}clone(){return new Mbe({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};E([N({type:["pie-chart"],readOnly:!0,json:{type:["piechart"],read:!1,write:kne.write}})],jne.prototype,"type",void 0),jne=Mbe=E([dt("esri.popup.content.PieChartMediaInfo")],jne);const ZUe=jne,QUe={base:Cbe,key:"type",defaultKeyValue:"image",typeMap:{"bar-chart":YUe,"column-chart":XUe,"line-chart":JUe,"pie-chart":ZUe,image:KUe}};var Dbe;let n2=Dbe=class extends cR{constructor(t){super(t),this.activeMediaInfoIndex=null,this.attributes=null,this.description=null,this.mediaInfos=null,this.title=null,this.type="media"}readMediaInfos(t){return t&&t.map(e=>e.type==="image"?KUe.fromJSON(e):e.type==="barchart"?YUe.fromJSON(e):e.type==="columnchart"?XUe.fromJSON(e):e.type==="linechart"?JUe.fromJSON(e):e.type==="piechart"?ZUe.fromJSON(e):void 0).filter(Boolean)}writeMediaInfos(t,e){e.mediaInfos=t&&t.map(i=>i.toJSON())}clone(){return new Dbe(gi({activeMediaInfoIndex:this.activeMediaInfoIndex,attributes:this.attributes,description:this.description,mediaInfos:this.mediaInfos,title:this.title}))}};E([N()],n2.prototype,"activeMediaInfoIndex",void 0),E([N({type:Object,json:{write:!0}})],n2.prototype,"attributes",void 0),E([N({type:String,json:{write:!0}})],n2.prototype,"description",void 0),E([N({types:[QUe]})],n2.prototype,"mediaInfos",void 0),E([Vi("mediaInfos")],n2.prototype,"readMediaInfos",null),E([Cr("mediaInfos")],n2.prototype,"writeMediaInfos",null),E([N({type:String,json:{write:!0}})],n2.prototype,"title",void 0),E([N({type:["media"],readOnly:!0,json:{read:!1,write:!0}})],n2.prototype,"type",void 0),n2=Dbe=E([dt("esri.popup.content.MediaContent")],n2);const fW=n2;var Fbe;let mW=Fbe=class extends Ui{constructor(t){super(t),this.field=null,this.order=null}clone(){return new Fbe({field:this.field,order:this.order})}};E([N({type:String,json:{write:!0}})],mW.prototype,"field",void 0),E([N({type:["asc","desc"],json:{write:!0}})],mW.prototype,"order",void 0),mW=Fbe=E([dt("esri.popup.support.RelatedRecordsInfoFieldOrder")],mW);const Lbe=mW;let LC=class extends _a(cR){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"}};E([N({type:String,json:{write:!0}})],LC.prototype,"description",void 0),E([N({type:Number,json:{type:Ls,write:!0}})],LC.prototype,"displayCount",void 0),E([N({type:["list"],json:{write:!0}})],LC.prototype,"displayType",void 0),E([N({type:[Lbe],json:{write:!0}})],LC.prototype,"orderByFields",void 0),E([N({type:Number,json:{type:Ls,write:!0}})],LC.prototype,"relationshipId",void 0),E([N({type:String,json:{write:!0}})],LC.prototype,"title",void 0),E([N({type:["relationship"],readOnly:!0,json:{read:!1,write:!0}})],LC.prototype,"type",void 0),LC=E([dt("esri.popup.content.RelationshipContent")],LC);const Gne=LC;var Nbe;let gW=Nbe=class extends cR{constructor(t){super(t),this.text=null,this.type="text"}clone(){return new Nbe({text:this.text})}};E([N({type:String,json:{write:!0}})],gW.prototype,"text",void 0),E([N({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],gW.prototype,"type",void 0),gW=Nbe=E([dt("esri.popup.content.TextContent")],gW);const a9=gW,oVt={base:null,key:"type",typeMap:{attachment:nW,media:fW,text:a9,expression:vbe,field:n9,relationship:Gne}};var kbe;let kL=kbe=class extends Ui{constructor(t){super(t),this.name=null,this.title=null,this.expression=null,this.returnType=null}clone(){return new kbe({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};E([N({type:String,json:{write:!0}})],kL.prototype,"name",void 0),E([N({type:String,json:{write:!0}})],kL.prototype,"title",void 0),E([N({type:String,json:{write:!0}})],kL.prototype,"expression",void 0),E([N({type:["string","number"],json:{write:!0}})],kL.prototype,"returnType",void 0),kL=kbe=E([dt("esri.popup.ExpressionInfo")],kL);const Une=kL;var $be;let yW=$be=class extends Ui{constructor(t){super(t),this.returnTopmostRaster=null,this.showNoDataRecords=null}clone(){return new $be({showNoDataRecords:this.showNoDataRecords,returnTopmostRaster:this.returnTopmostRaster})}};E([N({type:Boolean,json:{write:!0}})],yW.prototype,"returnTopmostRaster",void 0),E([N({type:Boolean,json:{write:!0}})],yW.prototype,"showNoDataRecords",void 0),yW=$be=E([dt("esri.popup.LayerOptions")],yW);const aVt=yW;var Bbe;let vW=Bbe=class extends Ui{constructor(t){super(t),this.showRelatedRecords=null,this.orderByFields=null}clone(){return new Bbe({showRelatedRecords:this.showRelatedRecords,orderByFields:this.orderByFields?gi(this.orderByFields):null})}};E([N({type:Boolean,json:{write:!0}})],vW.prototype,"showRelatedRecords",void 0),E([N({type:[Lbe],json:{write:!0}})],vW.prototype,"orderByFields",void 0),vW=Bbe=E([dt("esri.popup.RelatedRecordsInfo")],vW);const lVt=vW;let e7e=0;const D1=t=>{let e=class extends t{constructor(...i){super(...i),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+e7e++})}};return e=E([dt("esri.core.Identifiable")],e),e},zne=t=>{let e=class extends t{constructor(...i){super(...i),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:e7e++})}};return e=E([dt("esri.core.NumericIdentifiable")],e),e};let t7e=class extends D1(class{}){};t7e=E([dt("esri.core.Identifiable")],t7e);var Vbe;let s2=Vbe=class extends D1(Tn){constructor(t){super(t),this.active=!1,this.className=null,this.disabled=!1,this.id=null,this.indicator=!1,this.title=null,this.type=null,this.visible=!0}clone(){return new Vbe({active:this.active,className:this.className,disabled:this.disabled,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible})}};E([N()],s2.prototype,"active",void 0),E([N()],s2.prototype,"className",void 0),E([N()],s2.prototype,"disabled",void 0),E([N()],s2.prototype,"id",void 0),E([N()],s2.prototype,"indicator",void 0),E([N()],s2.prototype,"title",void 0),E([N()],s2.prototype,"type",void 0),E([N()],s2.prototype,"visible",void 0),s2=Vbe=E([dt("esri.support.actions.ActionBase")],s2);const Hne=s2;var jbe;let Wne=jbe=class extends Hne{constructor(t){super(t),this.image=null,this.type="button"}clone(){return new jbe({active:this.active,className:this.className,disabled:this.disabled,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image})}};E([N()],Wne.prototype,"image",void 0),Wne=jbe=E([dt("esri.support.Action.ActionButton")],Wne);const l9=Wne;var Gbe;let _W=Gbe=class extends Hne{constructor(t){super(t),this.image=null,this.type="toggle",this.value=!1}clone(){return new Gbe({active:this.active,className:this.className,disabled:this.disabled,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image,value:this.value})}};E([N()],_W.prototype,"image",void 0),E([N()],_W.prototype,"value",void 0),_W=Gbe=E([dt("esri.support.Action.ActionToggle")],_W);const i7e=_W,uVt="esri.PopupTemplate",cVt=Oi.getLogger(uVt),bW="relationships/",r7e="expression/",hVt=Sr.ofType({key:"type",defaultKeyValue:"button",base:Hne,typeMap:{button:l9,toggle:i7e}}),dVt={base:cR,key:"type",typeMap:{media:fW,custom:QBt,text:a9,attachments:nW,fields:n9,expression:vbe,relationship:Gne}},pVt=["attachments","fields","media","text","expression","relationship"];let Rm=class extends _a(Ui){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(i=>wC(dVt,i)):typeof e=="string"||typeof e=="function"||e instanceof HTMLElement||Fp(e)?e:(cVt.error("content error","unsupported content value",{value:e}),null)}readContent(e,i){const{popupElements:r}=i;return Array.isArray(r)&&r.length>0?this._readPopupInfoElements(i.description,i.mediaInfos,r):this._readPopupInfo(i)}writeContent(e,i,r,n){typeof e!="string"?Array.isArray(e)&&(i.popupElements=e.filter(s=>pVt.includes(s.type)).map(s=>s&&s.toJSON(n)),i.popupElements.forEach(s=>{s.type==="attachments"?this._writeAttachmentContent(i):s.type==="media"?this._writeMediaContent(s,i):s.type==="text"?this._writeTextContent(s,i):s.type==="relationship"&&this._writeRelationshipContent(s,i)})):i.description=e}writeFieldInfos(e,i,r,n){const{content:s}=this,o=Array.isArray(s)?s:null;if(e){const a=o?o.filter(c=>c.type==="fields"):[],l=a.length&&a.every(c=>c.fieldInfos?.length);i.fieldInfos=e.filter(Boolean).map(c=>{const h=c.toJSON(n);return l&&(h.visible=!1),h})}if(o)for(const a of o)a.type==="fields"&&this._writeFieldsContent(a,i)}writeLayerOptions(e,i,r,n){i[r]=!e||e.showNoDataRecords===null&&e.returnTopmostRaster===null?null:e.toJSON(n)}writeTitle(e,i){i.title=e||""}async collectRequiredFields(e,i){const r=this.expressionInfos||[];await this._collectExpressionInfoFields(e,i,[...r,...this._getContentExpressionInfos(this.content,r)]),uR(e,i,[...this.outFields||[],...this._getActionsFields(this.actions),...this._getTitleFields(this.title),...this._getContentFields(this.content)])}async getRequiredFields(e){const i=new Set;return await this.collectRequiredFields(i,e),[...i].sort()}_writeFieldsContent(e,i){if(!Array.isArray(e.fieldInfos)||!e.fieldInfos.length)return;const r=gi(e.fieldInfos);Array.isArray(i.fieldInfos)?r.forEach(n=>{const s=i.fieldInfos.find(o=>o.fieldName.toLowerCase()===n.fieldName.toLowerCase());s?s.visible=!0:i.fieldInfos.push(n)}):i.fieldInfos=r}_writeAttachmentContent(e){e.showAttachments||(e.showAttachments=!0)}_writeRelationshipContent(e,i){const r=e.orderByFields?.map(s=>this._toFieldOrderJSON(s,e.relationshipId))||[],n=[...i.relatedRecordsInfo?.orderByFields||[],...r];i.relatedRecordsInfo={showRelatedRecords:!0,...n?.length&&{orderByFields:n}}}_writeTextContent(e,i){!i.description&&e.text&&(i.description=e.text)}_writeMediaContent(e,i){if(!Array.isArray(e.mediaInfos)||!e.mediaInfos.length)return;const r=gi(e.mediaInfos);Array.isArray(i.mediaInfos)?i.mediaInfos=[...i.mediaInfos,...r]:i.mediaInfos=r}_readPopupInfoElements(e,i,r){const n={description:!1,mediaInfos:!1};return r.map(s=>s.type==="media"?(s.mediaInfos||!i||n.mediaInfos||(s.mediaInfos=i,n.mediaInfos=!0),fW.fromJSON(s)):s.type==="text"?(s.text||!e||n.description||(s.text=e,n.description=!0),a9.fromJSON(s)):s.type==="attachments"?nW.fromJSON(s):s.type==="fields"?n9.fromJSON(s):s.type==="expression"?vbe.fromJSON(s):s.type==="relationship"?Gne.fromJSON(s):void 0).filter(Boolean)}_toRelationshipContent(e){const{field:i,order:r}=e;if(!i?.startsWith(bW))return null;const n=i.replace(bW,"").split("/");if(n.length!==2)return null;const s=parseInt(n[0],10),o=n[1];return typeof s=="number"&&o?Gne.fromJSON({relationshipId:s,orderByFields:[{field:o,order:r}]}):null}_toFieldOrderJSON(e,i){const{order:r,field:n}=e;return{field:`${bW}${i}/${n}`,order:r}}_readPopupInfo({description:e,mediaInfos:i,showAttachments:r,relatedRecordsInfo:n={showRelatedRecords:!1}}){const s=[];e?s.push(new a9({text:e})):s.push(new n9),Array.isArray(i)&&i.length&&s.push(fW.fromJSON({mediaInfos:i})),r&&s.push(nW.fromJSON({displayType:"auto"}));const{showRelatedRecords:o,orderByFields:a}=n;return o&&a?.length&&a.forEach(l=>{const c=this._toRelationshipContent(l);c&&s.push(c)}),s.length?s:e}_getContentElementFields(e){const i=e?.type;if(i==="attachments")return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description)];if(i==="custom")return e.outFields||[];if(i==="fields")return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description),...this._getFieldInfoFields(e.fieldInfos??this.fieldInfos)];if(i==="media"){const r=e.mediaInfos||[];return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description),...r.reduce((n,s)=>[...n,...this._getMediaInfoFields(s)],[])]}return i==="text"?this._extractFieldNames(e.text):[]}_getMediaInfoFields(e){const{caption:i,title:r,value:n}=e,s=n||{},{fields:o,normalizeField:a,tooltipField:l,sourceURL:c,linkURL:h}=s,p=[...this._extractFieldNames(r),...this._extractFieldNames(i),...this._extractFieldNames(c),...this._extractFieldNames(h),...o??[]];return a&&p.push(a),l&&p.push(l),p}_getContentExpressionInfos(e,i){return Array.isArray(e)?e.reduce((r,n)=>[...r,...n.type==="expression"&&n.expressionInfo?[n.expressionInfo]:[]],i):[]}_getContentFields(e){return typeof e=="string"?this._extractFieldNames(e):Array.isArray(e)?e.reduce((i,r)=>[...i,...this._getContentElementFields(r)],[]):[]}async _collectExpressionInfoFields(e,i,r){r&&await Promise.all(r.map(n=>ev(e,i,n.expression)))}_getFieldInfoFields(e){return e?e.filter(i=>i.visible===void 0||!!i.visible).map(i=>i.fieldName).filter(i=>!i.startsWith(bW)&&!i.startsWith(r7e)):[]}_getActionsFields(e){return e?e.toArray().reduce((i,r)=>[...i,...this._getActionFields(r)],[]):[]}_getActionFields(e){const{className:i,title:r,type:n}=e,s=n==="button"||n==="toggle"?e.image:"";return[...this._extractFieldNames(r),...this._extractFieldNames(i),...this._extractFieldNames(s)]}_getTitleFields(e){return typeof e=="string"?this._extractFieldNames(e):[]}_extractFieldNames(e){if(!e||typeof e!="string")return[];const i=/{[^}]*}/g,r=e.match(i);if(!r)return[];const n=/\{(\w+):.+\}/,s=r.filter(o=>!(o.indexOf(`{${bW}`)===0||o.indexOf(`{${r7e}`)===0)).map(o=>o.replace(n,"{$1}"));return s?s.map(o=>o.slice(1,-1)):[]}};E([N({type:hVt})],Rm.prototype,"actions",void 0),E([N()],Rm.prototype,"content",void 0),E([ho("content")],Rm.prototype,"castContent",null),E([Vi("content",["description","fieldInfos","popupElements","mediaInfos","showAttachments","relatedRecordsInfo"])],Rm.prototype,"readContent",null),E([Cr("content",{popupElements:{type:Sr.ofType(oVt)},showAttachments:{type:Boolean},mediaInfos:{type:Sr.ofType(QUe)},description:{type:String},relatedRecordsInfo:{type:lVt}})],Rm.prototype,"writeContent",null),E([N({type:[Une],json:{write:!0}})],Rm.prototype,"expressionInfos",void 0),E([N({type:[hW]})],Rm.prototype,"fieldInfos",void 0),E([Cr("fieldInfos")],Rm.prototype,"writeFieldInfos",null),E([N({type:aVt})],Rm.prototype,"layerOptions",void 0),E([Cr("layerOptions")],Rm.prototype,"writeLayerOptions",null),E([N({type:Boolean,json:{read:{source:"showLastEditInfo"},write:{target:"showLastEditInfo"},default:!0}})],Rm.prototype,"lastEditInfoEnabled",void 0),E([N()],Rm.prototype,"outFields",void 0),E([N()],Rm.prototype,"overwriteActions",void 0),E([N()],Rm.prototype,"returnGeometry",void 0),E([N({json:{type:String}})],Rm.prototype,"title",void 0),E([Cr("title")],Rm.prototype,"writeTitle",null),Rm=E([dt("esri.PopupTemplate")],Rm);const wh=Rm,n7e=new Ks({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 fVt=0,u9=class extends Ui{constructor(e){super(e),this.id="sym"+fVt++,this.type=null,this.color=new en([0,0,0,1])}readColor(e){return e&&e[0]!=null?[e[0],e[1],e[2],e[3]/255]:e}async collectRequiredFields(e,i){}hash(){return JSON.stringify(this.toJSON())}clone(){}};E([N({type:n7e.apiValues,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:n7e.write}}})],u9.prototype,"type",void 0),E([N({type:en,json:{write:{allowNull:!0}}})],u9.prototype,"color",void 0),E([Vi("color")],u9.prototype,"readColor",null),u9=E([dt("esri.symbols.Symbol")],u9);const qg=u9;var Ube;let hR=Ube=class extends qg{constructor(t){super(t),this.data=null,this.type="cim"}readData(t,e){return e}writeData(t,e){if(t)for(const i in t)e[i]=t[i]}async collectRequiredFields(t,e){if(this.data?.type==="CIMSymbolReference"){const i=this.data.primitiveOverrides;if(i){const r=i.map(n=>{const s=n.valueExpressionInfo;return ev(t,e,s.expression)});await Promise.all(r)}}}clone(){return new Ube({data:gi(this.data)})}hash(){return zc(JSON.stringify(this.data)).toString()}};E([N({json:{write:!1}})],hR.prototype,"color",void 0),E([N({json:{write:!0}})],hR.prototype,"data",void 0),E([Vi("data",["symbol"])],hR.prototype,"readData",null),E([Cr("data",{})],hR.prototype,"writeData",null),E([rn({CIMSymbolReference:"cim"},{readOnly:!0})],hR.prototype,"type",void 0),hR=Ube=E([dt("esri.symbols.CIMSymbol")],hR);const wW=hR;let c9=class extends Ui{constructor(e){super(e),this.enabled=!0,this.type=null}writeEnabled(e,i,r){e||(i[r]=e)}};E([N({type:Boolean,json:{read:{source:"enable"},write:{target:"enable"}}})],c9.prototype,"enabled",void 0),E([Cr("enabled")],c9.prototype,"writeEnabled",null),E([N({type:["icon","object","line","path","fill","water","extrude","text"],readOnly:!0})],c9.prototype,"type",void 0),c9=E([dt("esri.symbols.Symbol3DLayer")],c9);const NC=c9,mVt=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i,gVt="screenUtils.toPt: input not recognized!",s7e=96;function vn(t){return t?t/72*s7e:0}function Ky(t){return t?72*t/s7e:0}function Ga(t){if(typeof t=="string"){const e=t.match(mVt);if(e){const i=Number(e[1]),r=e[3]&&e[3].toLowerCase(),n=t.charAt(0)==="-",s=r==="px"?Ky(i):i;return n?-s:s}return console.warn(gVt),null}return t}function zh(t=0,e=0){return{x:t,y:e}}function yVt(t=0,e=0){return[t,e]}function qne(t){const e=zre(100*(1-t));return Math.max(0,Math.min(e,100))}function h9(t){const e=1-t/100;return Math.max(0,Math.min(e,1))}function vVt(t,e){const i=e.transparency!=null?h9(e.transparency):1,r=e.color;return r&&Array.isArray(r)?new en([r[0]||0,r[1]||0,r[2]||0,i]):null}function _Vt(t,e){e.color=t.toJSON().slice(0,3);const i=qne(t.a);i!==0&&(e.transparency=i)}const dR={type:en,json:{type:[Ls],default:null,read:{source:["color","transparency"],reader:vVt},write:{target:{color:{type:[Ls]},transparency:{type:Ls}},writer:_Vt}}},kC={type:Number,cast:Ga,json:{write:!0}};let $L=class extends Ui{constructor(e){super(e),this.color=new en([0,0,0,1]),this.extensionLength=0,this.size=Ky(1)}clone(){}cloneProperties(){return{color:gi(this.color),size:this.size,extensionLength:this.extensionLength}}};E([N({type:["solid","sketch"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],$L.prototype,"type",void 0),E([N(dR)],$L.prototype,"color",void 0),E([N({...kC,json:{write:{overridePolicy:t=>({enabled:!!t})}}})],$L.prototype,"extensionLength",void 0),E([N(kC)],$L.prototype,"size",void 0),$L=E([dt("esri.symbols.edges.Edges3D")],$L);const zbe=$L;var Hbe;let Yne=Hbe=class extends zbe{constructor(t){super(t),this.type="sketch"}clone(){return new Hbe(this.cloneProperties())}};E([rn({sketch:"sketch"},{readOnly:!0})],Yne.prototype,"type",void 0),Yne=Hbe=E([dt("esri.symbols.edges.SketchEdges3D")],Yne);const bVt=Yne;var Wbe;let Xne=Wbe=class extends zbe{constructor(t){super(t),this.type="solid"}clone(){return new Wbe(this.cloneProperties())}};E([rn({solid:"solid"},{readOnly:!0})],Xne.prototype,"type",void 0),Xne=Wbe=E([dt("esri.symbols.support.SolidEdges3D")],Xne);const qbe={types:{key:"type",base:zbe,typeMap:{solid:Xne,sketch:bVt}},json:{write:!0}};var Ybe;let F1=Ybe=class extends Ui{constructor(t){super(t),this.color=null}clone(){const t={color:ve(this.color)?this.color.clone():null};return new Ybe(t)}};E([N(dR)],F1.prototype,"color",void 0),F1=Ybe=E([dt("esri.symbols.support.Symbol3DMaterial")],F1);var Xbe;let pR=Xbe=class extends NC{constructor(t){super(t),this.type="extrude",this.size=1,this.material=null,this.castShadows=!0,this.edges=null}clone(){return new Xbe({edges:this.edges&&this.edges.clone(),enabled:this.enabled,material:ve(this.material)?this.material.clone():null,castShadows:this.castShadows,size:this.size})}};E([rn({Extrude:"extrude"},{readOnly:!0})],pR.prototype,"type",void 0),E([N({type:Number,json:{write:{enabled:!0,isRequired:!0}},nonNullable:!0})],pR.prototype,"size",void 0),E([N({type:F1,json:{write:!0}})],pR.prototype,"material",void 0),E([N({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],pR.prototype,"castShadows",void 0),E([N(qbe)],pR.prototype,"edges",void 0),pR=Xbe=E([dt("esri.symbols.ExtrudeSymbol3DLayer")],pR);const o7e=pR;let xW=class extends qg{constructor(e){super(e),this.type="simple-line",this.width=.75}hash(){return`${this.type}.${this.width}`}};E([rn({esriSLS:"simple-line"},{readOnly:!0})],xW.prototype,"type",void 0),E([N({type:Number,cast:Ga,json:{write:!0}})],xW.prototype,"width",void 0),xW=E([dt("esri.symbols.LineSymbol")],xW);const wVt=xW,xVt=["begin","end","begin-end"],a7e=["arrow","circle","square","diamond","cross","x"];var Kbe;let $C=Kbe=class extends Ui{constructor(t){super(t),this.placement="begin-end",this.type="line-marker",this.style="arrow"}writeStyle(t,e,i,r){e[i]=r?.origin==="web-map"?"arrow":t}set color(t){this._set("color",t)}readColor(t){return t&&t[0]!=null?[t[0],t[1],t[2],t[3]/255]:t}writeColor(t,e,i,r){r?.origin==="web-map"||(e[i]=t)}clone(){return new Kbe({color:gi(this.color),placement:this.placement,style:this.style})}hash(){return`${this.placement}.${this.color?.hash()}.${this.style}`}};E([N({type:["begin","end","begin-end"],json:{write:!0}})],$C.prototype,"placement",void 0),E([rn({"line-marker":"line-marker"},{readOnly:!0}),N({json:{origins:{"web-map":{write:!1}}}})],$C.prototype,"type",void 0),E([N({type:a7e})],$C.prototype,"style",void 0),E([Cr("style")],$C.prototype,"writeStyle",null),E([N({type:en,value:null,json:{write:{allowNull:!0}}})],$C.prototype,"color",null),E([Vi("color")],$C.prototype,"readColor",null),E([Cr("color")],$C.prototype,"writeColor",null),$C=Kbe=E([dt("esri.symbols.LineSymbolMarker")],$C);const SVt=$C;var Jbe;const Zbe=new Ks({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 lA=Jbe=class extends wVt{constructor(...t){super(...t),this.type="simple-line",this.style="solid",this.cap="round",this.join="round",this.marker=null,this.miterLimit=2}normalizeCtorArgs(t,e,i,r,n,s){if(t&&typeof t!="string")return t;const o={};return t!=null&&(o.style=t),e!=null&&(o.color=e),i!=null&&(o.width=Ga(i)),r!=null&&(o.cap=r),n!=null&&(o.join=n),s!=null&&(o.miterLimit=Ga(s)),o}clone(){return new Jbe({color:gi(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()}`}};E([rn({esriSLS:"simple-line"},{readOnly:!0})],lA.prototype,"type",void 0),E([N({type:Zbe.apiValues,json:{read:Zbe.read,write:Zbe.write}})],lA.prototype,"style",void 0),E([N({type:["butt","round","square"],json:{write:{overridePolicy:(t,e,i)=>({enabled:t!=="round"&&(i==null||i.origin==null)})}}})],lA.prototype,"cap",void 0),E([N({type:["miter","round","bevel"],json:{write:{overridePolicy:(t,e,i)=>({enabled:t!=="round"&&(i==null||i.origin==null)})}}})],lA.prototype,"join",void 0),E([N({types:{key:"type",base:null,defaultKeyValue:"line-marker",typeMap:{"line-marker":SVt}},json:{write:!0,origins:{"web-scene":{write:!1}}}})],lA.prototype,"marker",void 0),E([N({type:Number,json:{read:!1,write:!1}})],lA.prototype,"miterLimit",void 0),lA=Jbe=E([dt("esri.symbols.SimpleLineSymbol")],lA);const Mm=lA;let SW=class extends qg{constructor(e){super(e),this.outline=null,this.type=null}hash(){return`${this.type}.${this.outline&&this.outline.hash()}`}};E([N({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":Mm}},json:{default:null,write:!0}})],SW.prototype,"outline",void 0),E([N({type:["simple-fill","picture-fill"],readOnly:!0})],SW.prototype,"type",void 0),SW=E([dt("esri.symbols.FillSymbol")],SW);const l7e=SW;let Kne=class extends Ui{constructor(e){super(e)}clone(){}};E([N({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],Kne.prototype,"type",void 0),Kne=E([dt("esri.symbols.patterns.LinePattern3D")],Kne);const u7e=Kne,CVt=["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 Qbe;const TVt=ta()({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 CW=Qbe=class extends u7e{constructor(t){super(t),this.type="style",this.style="solid"}clone(){const t={style:this.style};return new Qbe(t)}};E([N({type:["style"]})],CW.prototype,"type",void 0),E([rn(TVt),N({type:CVt})],CW.prototype,"style",void 0),CW=Qbe=E([dt("esri.symbols.patterns.LineStylePattern3D")],CW);const ewe=CW;let Jne=class extends Ui{constructor(e){super(e)}clone(){}};E([N({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],Jne.prototype,"type",void 0),Jne=E([dt("esri.symbols.patterns.Pattern3D")],Jne);const c7e=Jne,EVt=["backward-diagonal","cross","diagonal-cross","forward-diagonal","horizontal","none","solid","vertical"];var twe;let TW=twe=class extends c7e{constructor(t){super(t),this.type="style",this.style="solid"}clone(){const t={style:this.style};return new twe(t)}};E([N({type:["style"]})],TW.prototype,"type",void 0),E([N({type:EVt,json:{read:!0,write:!0}})],TW.prototype,"style",void 0),TW=twe=E([dt("esri.symbols.patterns.StylePattern3D")],TW);const h7e=TW,IVt={types:{key:"type",base:c7e,typeMap:{style:h7e}},json:{write:!0}},d7e={types:{key:"type",base:u7e,typeMap:{style:ewe}},json:{write:!0}},EW=new en("white");new en("black");const AVt=new en([255,255,255,0]);function PVt(t){return t.r===0&&t.g===0&&t.b===0}var iwe;let IW=iwe=class extends F1{constructor(t){super(t),this.colorMixMode=null}clone(){const t={color:ve(this.color)?this.color.clone():null,colorMixMode:this.colorMixMode};return new iwe(t)}};E([rn({multiply:"multiply",replace:"replace",tint:"tint"})],IW.prototype,"colorMixMode",void 0),IW=iwe=E([dt("esri.symbols.support.Symbol3DFillMaterial")],IW);function ZDr(t){return t}function Mo(t=MVt){return[t[0],t[1],t[2],t[3]]}function OVt(t){return[t[0],t[1],t[2],t[3]]}function p7e(t,e){return t!==e&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]),t}function Zne(t,e,i,r,n=Mo()){return n[0]=t,n[1]=e,n[2]=i,n[3]=r,n}function fR(t,e=Mo()){return e[0]=t.xmin,e[1]=t.ymin,e[2]=t.xmax,e[3]=t.ymax,e}function BL(t,e){return new Ar({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3],spatialReference:e})}function Qne(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function rwe(t,e,i){if(lt(e))p7e(i,t);else if("length"in e)owe(e)?(i[0]=Math.min(t[0],e[0]),i[1]=Math.min(t[1],e[1]),i[2]=Math.max(t[2],e[2]),i[3]=Math.max(t[3],e[3])):e.length!==2&&e.length!==3||(i[0]=Math.min(t[0],e[0]),i[1]=Math.min(t[1],e[1]),i[2]=Math.max(t[2],e[0]),i[3]=Math.max(t[3],e[1]));else switch(e.type){case"extent":i[0]=Math.min(t[0],e.xmin),i[1]=Math.min(t[1],e.ymin),i[2]=Math.max(t[2],e.xmax),i[3]=Math.max(t[3],e.ymax);break;case"point":i[0]=Math.min(t[0],e.x),i[1]=Math.min(t[1],e.y),i[2]=Math.max(t[2],e.x),i[3]=Math.max(t[3],e.y)}}function f7e(t){return lt(t)||t[0]>=t[2]?0:t[2]-t[0]}function m7e(t){return t[1]>=t[3]?0:t[3]-t[1]}function g7e(t){return f7e(t)*m7e(t)}function RVt(t,e){return y7e(t,e[0],e[1])}function y7e(t,e,i){return e>=t[0]&&i>=t[1]&&e<=t[2]&&i<=t[3]}function ese(t,e,i){return e[0]>=t[0]-i&&e[1]>=t[1]-i&&e[0]<=t[2]+i&&e[1]<=t[3]+i}function tse(t,e){return Math.max(e[0],t[0])<=Math.min(e[2],t[2])&&Math.max(e[1],t[1])<=Math.min(e[3],t[3])}function nwe(t,e){return e[0]>=t[0]&&e[2]<=t[2]&&e[1]>=t[1]&&e[3]<=t[3]}function swe(t){return t?p7e(t,ise):Mo(ise)}function owe(t){return t!=null&&t.length===4}function v7e(t,e){return owe(t)&&owe(e)?t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]:t===e}const ise=[1/0,1/0,-1/0,-1/0],MVt=[0,0,0,0];function QDr(t){return t}function iw(t=GVt){return[t[0],t[1],t[2],t[3],t[4],t[5]]}function rse(t,e,i,r,n,s,o=iw()){return o[0]=t,o[1]=e,o[2]=i,o[3]=r,o[4]=n,o[5]=s,o}function DVt(t,e){const i=isFinite(t[2])||isFinite(t[5]);return new Ar(i?{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],zmin:t[2],zmax:t[5],spatialReference:e}:{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],spatialReference:e})}function AW(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.min(t[2],e[2]),t[3]=Math.max(t[3],e[3]),t[4]=Math.max(t[4],e[4]),t[5]=Math.max(t[5],e[5])}function PW(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.min(t[2],e[2]),t[3]=Math.max(t[3],e[0]),t[4]=Math.max(t[4],e[1]),t[5]=Math.max(t[5],e[2])}function FVt(t){return t[0]>=t[3]?0:t[3]-t[0]}function LVt(t){return t[1]>=t[4]?0:t[4]-t[1]}function NVt(t){return t[2]>=t[5]?0:t[5]-t[2]}function kVt(t,e=[0,0,0]){return e[0]=FVt(t),e[1]=LVt(t),e[2]=NVt(t),e}function $Vt(t,e,i=t){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i!==t&&(i[3]=t[3],i[4]=t[4],i[5]=t[5]),i}function BVt(t,e,i=t){return i[3]=e[0],i[4]=e[1],i[5]=e[2],i!==t&&(i[0]=t[0],i[1]=t[1],i[2]=t[2]),t}function _7e(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function b7e(t){return t?_7e(t,d9):iw(d9)}function VVt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=Number.NEGATIVE_INFINITY,t[3]=e[2],t[4]=e[3],t[5]=Number.POSITIVE_INFINITY,t}function w7e(t,e,i,r,n){return t[0]=e,t[1]=i,t[2]=Number.NEGATIVE_INFINITY,t[3]=r,t[4]=n,t[5]=Number.POSITIVE_INFINITY,t}function awe(t){return t.length===6}function jVt(t,e,i){if(lt(t)||lt(e))return t===e;if(!awe(t)||!awe(e))return!1;if(i){for(let r=0;r{const e=jd(t);return e===0?1:eu(e,.1,4)},nonNullable:!0},ZVt=["left","right","center"],QVt=["baseline","top","middle","bottom"],C7e={type:ZVt,nonNullable:!0},T7e={type:QVt,nonNullable:!0};var cwe;let cA=cwe=class extends Ui{constructor(t){super(t),this.decoration="none",this.family="sans-serif",this.size=9,this.style="normal",this.weight="normal"}castSize(t){return Ga(t)}clone(){return new cwe({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}`}};E([N({type:XVt,json:{default:"none",write:!0}})],cA.prototype,"decoration",void 0),E([N({type:String,json:{write:!0}})],cA.prototype,"family",void 0),E([N({type:Number,json:{write:{overridePolicy:(t,e,i)=>({enabled:!i||!i.textSymbol3D})}}})],cA.prototype,"size",void 0),E([ho("size")],cA.prototype,"castSize",null),E([N({type:KVt,json:{default:"normal",write:!0}})],cA.prototype,"style",void 0),E([N({type:JVt,json:{default:"normal",write:!0}})],cA.prototype,"weight",void 0),cA=cwe=E([dt("esri.symbols.Font")],cA);const sse=cA;function rw(t,e){const i=e&&e.url&&e.url.path;if(t&&i&&(t=Gy(t,i,{preserveProtocolRelative:!0}),e.portalItem&&e.readResourcePaths)){const r=Qre(t,e.portalItem.itemUrl);r!=null&&ejt.test(r)&&e.readResourcePaths.push(e.portalItem.resourceFromPath(r).path)}return pwe(t,e&&e.portal)}function o2(t,e,i=jL.YES){if(t==null)return t;!Wg(t)&&e&&e.blockedRelativeUrls&&e.blockedRelativeUrls.push(t);let r=Gy(t);if(e){const n=e.verifyItemRelativeUrls&&e.verifyItemRelativeUrls.rootPath||e.url&&e.url.path;if(n){const s=pwe(n,e.portal),o=pwe(r,e.portal);r=Qre(o,s,s),r!=null&&r!==o&&r!==t&&e.verifyItemRelativeUrls&&e.verifyItemRelativeUrls.writtenUrls.push(r)}}return r=dwe(r,e?.portal),Wg(r)&&(r=Uy(r)),e?.resources&&e?.portalItem&&!Wg(r)&&!A1(r)&&i===jL.YES&&e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(r),compress:!1}),r}function p9(t,e,i){return rw(t,i)}function hA(t,e,i,r){const n=o2(t,r);n!==void 0&&(e[i]=n)}const E7e=/\/items\/([^\/]+)\/resources\/(.*)/,ejt=/^\.\/resources\//;function hwe(t){return(t?.match(E7e)??null)?.[1]??null}function I7e(t){const e=t?.match(E7e)??null;if(e==null)return null;const i=e[2],r=i.lastIndexOf("/");if(r===-1){const{path:o,extension:a}=qje(i);return{prefix:null,filename:o,extension:a}}const{path:n,extension:s}=qje(i.slice(r+1));return{prefix:i.slice(0,r),filename:n,extension:s}}function dwe(t,e){return e&&!e.isPortal&&e.urlKey&&e.customBaseUrl?c1e(t,`${e.urlKey}.${e.customBaseUrl}`,e.portalHostname):t}function pwe(t,e){if(!e||e.isPortal||!e.urlKey||!e.customBaseUrl)return t;const i=`${e.urlKey}.${e.customBaseUrl}`,r=i1e();return jy(r,`${r.scheme}://${i}`)?c1e(t,e.portalHostname,i):c1e(t,i,e.portalHostname)}var jL;(function(t){t[t.YES=0]="YES",t[t.NO=1]="NO"})(jL||(jL={}));const tjt=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return jL},ensureMainOnlineDomain:dwe,fromJSON:rw,itemIdFromResourceUrl:hwe,prefixAndFilenameFromResourceUrl:I7e,read:p9,toJSON:o2,write:hA},Symbol.toStringTag,{value:"Module"}));var fwe;const ijt=ta()({circle:"circle",square:"square",cross:"cross",x:"x",kite:"kite",triangle:"triangle"});let GL=fwe=class extends Ui{constructor(t){super(t)}readHref(t,e,i){return t?rw(t,i):e.dataURI}writeHref(t,e,i,r){t&&(A1(t)?e.dataURI=t:(e.href=o2(t,r),Wg(e.href)&&(e.href=Uy(e.href))))}clone(){return new fwe({href:this.href,primitive:this.primitive})}};E([N({type:String,json:{write:!0,read:{source:["href","dataURI"]}}})],GL.prototype,"href",void 0),E([Vi("href")],GL.prototype,"readHref",null),E([Cr("href",{href:{type:String},dataURI:{type:String}})],GL.prototype,"writeHref",null),E([rn(ijt)],GL.prototype,"primitive",void 0),GL=fwe=E([dt("esri.symbols.support.IconSymbol3DLayerResource")],GL);var mwe;let f9=mwe=class extends Tn{constructor(){super(...arguments),this.x=0,this.y=0}clone(){return new mwe({x:this.x,y:this.y})}};E([N({type:Number})],f9.prototype,"x",void 0),E([N({type:Number})],f9.prototype,"y",void 0),f9=mwe=E([dt("esri.symbols.support.Symbol3DAnchorPosition2D")],f9);var gwe;let RW=gwe=class extends Ui{constructor(t){super(t),this.color=new en([0,0,0,1]),this.size=Ky(1)}clone(){const t={color:ve(this.color)?this.color.clone():null,size:this.size};return new gwe(t)}};E([N(dR)],RW.prototype,"color",void 0),E([N(kC)],RW.prototype,"size",void 0),RW=gwe=E([dt("esri.symbols.support.Symbol3DIconOutline")],RW);var m9;const A7e="esri.symbols.IconSymbol3DLayer";let BC=m9=class extends NC{constructor(t){super(t),this.material=null,this.resource=null,this.type="icon",this.size=12,this.anchor="center",this.anchorPosition=null,this.outline=null}clone(){return new m9({anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),enabled:this.enabled,material:ve(this.material)?this.material.clone():null,outline:ve(this.outline)?this.outline.clone():null,resource:this.resource&&this.resource.clone(),size:this.size})}static fromSimpleMarkerSymbol(t){const e=t.color||EW,i=P7e(t),r=t.outline&&t.outline.width>0?{size:t.outline.width,color:(t.outline.color||EW).clone()}:null;return new m9({size:t.size,resource:{primitive:njt(t.style)},material:{color:e},outline:r,anchor:i?"relative":void 0,anchorPosition:i})}static fromPictureMarkerSymbol(t){const e=!t.color||PVt(t.color)?EW:t.color,i=P7e(t);return new m9({size:t.width<=t.height?t.height:t.width,resource:{href:t.url},material:{color:e.clone()},anchor:i?"relative":void 0,anchorPosition:i})}static fromCIMSymbol(t){return new m9({resource:{href:Uje({mediaType:"application/json",data:JSON.stringify(t.data)})}})}};function P7e(t){const e="width"in t?t.width:t.size,i="height"in t?t.height:t.size,r=O7e(t.xoffset),n=O7e(t.yoffset);return(r||n)&&e&&i?{x:-r/e,y:n/i}:null}function O7e(t){return isFinite(t)?t:0}E([N({type:F1,json:{write:!0}})],BC.prototype,"material",void 0),E([N({type:GL,json:{write:!0}})],BC.prototype,"resource",void 0),E([rn({Icon:"icon"},{readOnly:!0})],BC.prototype,"type",void 0),E([N(kC)],BC.prototype,"size",void 0),E([rn({center:"center",left:"left",right:"right",top:"top",bottom:"bottom",topLeft:"top-left",topRight:"top-right",bottomLeft:"bottom-left",bottomRight:"bottom-right",relative:"relative"}),N({json:{default:"center"}})],BC.prototype,"anchor",void 0),E([N({type:f9,json:{type:[Number],read:{reader:t=>new f9({x:t[0],y:t[1]})},write:{writer:(t,e)=>{e.anchorPosition=[t.x,t.y]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],BC.prototype,"anchorPosition",void 0),E([N({type:RW,json:{write:!0}})],BC.prototype,"outline",void 0),BC=m9=E([dt(A7e)],BC);const rjt={circle:"circle",cross:"cross",diamond:"kite",square:"square",x:"x",triangle:"triangle",path:null};function njt(t){return rjt[t]||(Oi.getLogger(A7e).warn(`${t} cannot be mapped to Icon symbol. Fallback to "circle"`),"circle")}const UL=BC;let zL=class extends _a(Ui){constructor(e){super(e),this.type="style",this.placement="begin-end",this.style="arrow",this.color=null}equals(e){return ve(e)&&e.placement===this.placement&&e.style===this.style&&(lt(this.color)&<(e.color)||ve(this.color)&&ve(e.color)&&this.color.toJSON()===e.color.toJSON())}};E([N({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],zL.prototype,"type",void 0),E([N({type:xVt,json:{default:"begin-end",write:!0}})],zL.prototype,"placement",void 0),E([N({type:a7e,json:{default:"arrow",write:!0}})],zL.prototype,"style",void 0),E([N({type:en,json:{type:[Ls],default:null,write:!0}})],zL.prototype,"color",void 0),zL=E([dt("esri.symbols.LineStyleMarker3D")],zL);const ywe=zL;var ose;let VC=ose=class extends NC{constructor(t){super(t),this.material=null,this.type="line",this.join="miter",this.cap="butt",this.size=Ky(1),this.pattern=null,this.marker=null}clone(){const t={enabled:this.enabled,material:ve(this.material)?this.material.clone():null,size:this.size,join:this.join,cap:this.cap,pattern:ve(this.pattern)?this.pattern.clone():null,marker:ve(this.marker)?this.marker.clone():null};return new ose(t)}static fromSimpleLineSymbol(t){const e={enabled:!0,size:t.width??Ky(1),cap:t.cap||"butt",join:t.join||"miter",pattern:t.style&&t.style!=="inside-frame"?new ewe({style:t.style}):null,material:new F1({color:(t.color||EW).clone()}),marker:t.marker?new ywe({placement:t.marker.placement,style:t.marker.style,color:t.marker.color?.clone()??null}):null};return new ose(e)}};E([N({type:F1,json:{write:!0}})],VC.prototype,"material",void 0),E([rn({Line:"line"},{readOnly:!0})],VC.prototype,"type",void 0),E([N({type:x7e,json:{write:!0,default:"miter"}})],VC.prototype,"join",void 0),E([N({type:lwe,json:{write:!0,default:"butt"}})],VC.prototype,"cap",void 0),E([N(kC)],VC.prototype,"size",void 0),E([N(d7e)],VC.prototype,"pattern",void 0),E([N({types:{key:"type",base:ywe,typeMap:{style:ywe}},json:{write:!0}})],VC.prototype,"marker",void 0),VC=ose=E([dt("esri.symbols.LineSymbol3DLayer")],VC);const MW=VC;var vwe;const sjt=ta()({sphere:"sphere",cylinder:"cylinder",cube:"cube",cone:"cone",diamond:"diamond",tetrahedron:"tetrahedron",invertedCone:"inverted-cone"});let DW=vwe=class extends Ui{clone(){return new vwe({href:this.href,primitive:this.primitive})}};E([N({type:String,json:{read:p9,write:hA}})],DW.prototype,"href",void 0),E([rn(sjt)],DW.prototype,"primitive",void 0),DW=vwe=E([dt("esri.symbols.support.ObjectSymbol3DLayerResource")],DW);var _we;let HL=_we=class extends Tn{constructor(){super(...arguments),this.x=0,this.y=0,this.z=0}clone(){return new _we({x:this.x,y:this.y,z:this.z})}};E([N({type:Number})],HL.prototype,"x",void 0),E([N({type:Number})],HL.prototype,"y",void 0),E([N({type:Number})],HL.prototype,"z",void 0),HL=_we=E([dt("esri.symbols.support.Symbol3DAnchorPosition3D")],HL);var bwe;let Jy=bwe=class extends NC{constructor(t){super(t),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 bwe({heading:this.heading,tilt:this.tilt,roll:this.roll,anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),depth:this.depth,enabled:this.enabled,height:this.height,material:ve(this.material)?this.material.clone():null,castShadows:this.castShadows,resource:this.resource&&this.resource.clone(),width:this.width})}get isPrimitive(){return!this.resource||typeof this.resource.href!="string"}};E([N({type:F1,json:{write:!0}})],Jy.prototype,"material",void 0),E([N({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],Jy.prototype,"castShadows",void 0),E([N({type:DW,json:{write:!0}})],Jy.prototype,"resource",void 0),E([rn({Object:"object"},{readOnly:!0})],Jy.prototype,"type",void 0),E([N({type:Number,json:{write:!0}})],Jy.prototype,"width",void 0),E([N({type:Number,json:{write:!0}})],Jy.prototype,"height",void 0),E([N({type:Number,json:{write:!0}})],Jy.prototype,"depth",void 0),E([rn({center:"center",top:"top",bottom:"bottom",origin:"origin",relative:"relative"}),N({json:{default:"origin"}})],Jy.prototype,"anchor",void 0),E([N({type:HL,json:{type:[Number],read:{reader:t=>new HL({x:t[0],y:t[1],z:t[2]})},write:{writer:(t,e)=>{e.anchorPosition=[t.x,t.y,t.z]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],Jy.prototype,"anchorPosition",void 0),E([N({type:Number,json:{write:!0}})],Jy.prototype,"heading",void 0),E([N({type:Number,json:{write:!0}})],Jy.prototype,"tilt",void 0),E([N({type:Number,json:{write:!0}})],Jy.prototype,"roll",void 0),E([N({readOnly:!0})],Jy.prototype,"isPrimitive",null),Jy=bwe=E([dt("esri.symbols.ObjectSymbol3DLayer")],Jy);const wwe=Jy;var xwe;let tv=xwe=class extends NC{constructor(t){super(t),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(t,e){return t??(e.height==null&&e.size!=null?e.size:void 0)}readHeight(t,e){return t??(e.width==null&&e.size!=null?e.size:void 0)}clone(){return new xwe({enabled:this.enabled,material:ve(this.material)?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})}};E([N({type:F1,json:{write:!0}})],tv.prototype,"material",void 0),E([N({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],tv.prototype,"castShadows",void 0),E([rn({Path:"path"},{readOnly:!0})],tv.prototype,"type",void 0),E([N({type:["circle","quad"],json:{write:!0,default:"circle"}})],tv.prototype,"profile",void 0),E([N({type:x7e,json:{write:!0,default:"miter"}})],tv.prototype,"join",void 0),E([N({type:YVt,json:{write:!0,default:"butt"}})],tv.prototype,"cap",void 0),E([N({type:Number,json:{write:{enabled:!0,target:{width:{type:Number},size:{type:Number}}}}})],tv.prototype,"width",void 0),E([Vi("width",["width","size","height"])],tv.prototype,"readWidth",null),E([N({type:Number,json:{write:!0}})],tv.prototype,"height",void 0),E([Vi("height",["height","size","width"])],tv.prototype,"readHeight",null),E([N({type:["center","bottom","top"],json:{write:!0,default:"center"}})],tv.prototype,"anchor",void 0),E([N({type:["heading","all"],json:{write:!0,default:"all"}})],tv.prototype,"profileRotation",void 0),tv=xwe=E([dt("esri.symbols.PathSymbol3DLayer")],tv);const Swe=tv;var Cwe;let g9=Cwe=class extends Ui{constructor(){super(...arguments),this.color=new en([0,0,0,1]),this.size=0}clone(){const t={color:gi(this.color),size:this.size};return new Cwe(t)}};E([N(dR)],g9.prototype,"color",void 0),E([N(kC)],g9.prototype,"size",void 0),g9=Cwe=E([dt("esri.symbols.support.Symbol3DHalo")],g9);let FW=class extends _a(Ui){constructor(e){super(e),this.color=null}};E([N(dR)],FW.prototype,"color",void 0),FW=E([dt("esri.symbols.support.Symbol3DTextBackground")],FW);var ase;let Jv=ase=class extends NC{constructor(t){super(t),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(t){ve(t)&&ve(this._userSize)&&(t.size=this._userSize),this._set("font",t)}writeFont(t,e,i,r){const n={...r,textSymbol3D:!0};e.font=t.write({},n),delete e.font.size}get size(){return ve(this._userSize)?this._userSize:ve(this.font)&&this.font.size!=null?this.font.size:9}set size(t){this._userSize=t,ve(this.font)&&(this.font.size=this._userSize),this.notifyChange("size")}clone(){const t=new ase({enabled:this.enabled,font:this.font&&gi(this.font),halo:this.halo&&gi(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:ve(this.material)?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:gi(this.background)});return t._userSize=this._userSize,t}static fromTextSymbol(t){return new ase({font:ve(t.font)?t.font.clone():new sse,halo:ojt(t.haloColor,t.haloSize),horizontalAlignment:t.horizontalAlignment,lineHeight:t.lineHeight,material:t.color?new F1({color:t.color.clone()}):null,text:t.text,verticalAlignment:t.verticalAlignment,background:t.backgroundColor?new FW({color:t.backgroundColor.clone()}):null})}};function ojt(t,e){return t&&e!=null&&e>0?new g9({color:gi(t),size:e}):null}E([N({type:sse,json:{write:!0}})],Jv.prototype,"font",null),E([Cr("font")],Jv.prototype,"writeFont",null),E([N({type:g9,json:{write:!0}})],Jv.prototype,"halo",void 0),E([N({...C7e,json:{default:"center",write:!0}})],Jv.prototype,"horizontalAlignment",void 0),E([N({...S7e,json:{default:1,write:!0}})],Jv.prototype,"lineHeight",void 0),E([N({type:F1,json:{write:!0}})],Jv.prototype,"material",void 0),E([N({type:FW,json:{write:!0}})],Jv.prototype,"background",void 0),E([N(kC)],Jv.prototype,"size",null),E([N({type:String,json:{write:!0}})],Jv.prototype,"text",void 0),E([rn({Text:"text"},{readOnly:!0})],Jv.prototype,"type",void 0),E([N({...T7e,json:{default:"baseline",write:!0}})],Jv.prototype,"verticalAlignment",void 0),Jv=ase=E([dt("esri.symbols.TextSymbol3DLayer")],Jv);const y9=Jv;var Twe;let mR=Twe=class extends NC{constructor(t){super(t),this.color=Ewe.clone(),this.type="water",this.waterbodySize="medium",this.waveDirection=null,this.waveStrength="moderate"}clone(){return new Twe({color:gi(this.color),waterbodySize:this.waterbodySize,waveDirection:this.waveDirection,waveStrength:this.waveStrength})}};E([N({type:en,nonNullable:!0,json:{type:[Ls],write:(t,e,i)=>e[i]=t.toArray(en.AlphaMode.UNLESS_OPAQUE),default:()=>Ewe.clone(),defaultEquals:t=>t.toCss(!0)===Ewe.toCss(!0)}})],mR.prototype,"color",void 0),E([rn({Water:"water"},{readOnly:!0})],mR.prototype,"type",void 0),E([N({type:["small","medium","large"],json:{write:!0,default:"medium"}})],mR.prototype,"waterbodySize",void 0),E([N({type:Number,json:{write:!0,default:null}})],mR.prototype,"waveDirection",void 0),E([N({type:["calm","rippled","slight","moderate"],json:{write:!0,default:"moderate"}})],mR.prototype,"waveStrength",void 0),mR=Twe=E([dt("esri.symbols.WaterSymbol3DLayer")],mR);const Ewe=new en([0,119,190]),R7e=mR;var Iwe;let WL=Iwe=class extends Tn{constructor(t){super(t),this.name=null,this.styleUrl=null,this.styleName=null,this.portal=null}clone(){return new Iwe({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}};E([N({type:String})],WL.prototype,"name",void 0),E([N({type:String})],WL.prototype,"styleUrl",void 0),E([N({type:String})],WL.prototype,"styleName",void 0),E([N({type:Cc})],WL.prototype,"portal",void 0),WL=Iwe=E([dt("esri.symbols.support.StyleOrigin")],WL);const LW=WL;var Awe;let qL=Awe=class extends Tn{constructor(){super(...arguments),this.url=""}clone(){return new Awe({url:this.url})}};E([N({type:String})],qL.prototype,"url",void 0),qL=Awe=E([dt("esri.symbols.support.Thumbnail")],qL);const M7e={icon:UL,object:wwe,line:MW,path:Swe,fill:OW,extrude:o7e,text:y9,water:R7e},ajt=Sr.ofType({base:NC,key:"type",typeMap:M7e,errorContext:"symbol-layer"});let jC=class extends qg{constructor(e){super(e),this.styleOrigin=null,this.thumbnail=null,this.type=null;const i=this.__accessor__&&this.__accessor__.metadatas&&this.__accessor__.metadatas.symbolLayers,r=i&&i.type||Sr;this._set("symbolLayers",new r)}get color(){return null}set color(e){this.constructed&&Oi.getLogger(this.declaredClass).error("Symbol3D does not support colors on the symbol level. Colors may be set on individual symbol layer materials instead.")}set symbolLayers(e){og(e,this._get("symbolLayers"))}readStyleOrigin(e,i,r){if(e.styleUrl&&e.name){const n=rw(e.styleUrl,r);return new LW({styleUrl:n,name:e.name})}if(e.styleName&&e.name)return new LW({portal:r&&r.portal||Cc.getDefault(),styleName:e.styleName,name:e.name});r&&r.messages&&r.messages.push(new Am("symbol3d:incomplete-style-origin","Style origin requires either a 'styleUrl' or 'styleName' and a 'name' property",{context:r,definition:e}))}writeStyleOrigin(e,i,r,n){if(e.styleUrl&&e.name){let s=o2(e.styleUrl,n);Wg(s)&&(s=Uy(s)),i.styleOrigin={styleUrl:s,name:e.name}}else e.styleName&&e.name&&(e.portal&&n&&n.portal&&!n1e(e.portal.restUrl,n.portal.restUrl)?n&&n.messages&&n.messages.push(new Am("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})):i.styleOrigin={styleName:e.styleName,name:e.name})}normalizeCtorArgs(e){return e instanceof NC||e&&M7e[e.type]?{symbolLayers:[e]}:Array.isArray(e)?{symbolLayers:e}:e}};E([N({json:{read:!1,write:!1}})],jC.prototype,"color",null),E([N({type:ajt,nonNullable:!0,json:{write:!0}}),ho(k8)],jC.prototype,"symbolLayers",null),E([N({type:LW})],jC.prototype,"styleOrigin",void 0),E([Vi("styleOrigin")],jC.prototype,"readStyleOrigin",null),E([Cr("styleOrigin",{"styleOrigin.styleUrl":{type:String},"styleOrigin.styleName":{type:String},"styleOrigin.name":{type:String}})],jC.prototype,"writeStyleOrigin",null),E([N({type:qL,json:{read:!1}})],jC.prototype,"thumbnail",void 0),E([N({type:["point-3d","line-3d","polygon-3d","mesh-3d","label-3d"],readOnly:!0})],jC.prototype,"type",void 0),jC=E([dt("esri.symbols.Symbol3D")],jC);const v9=jC;let NW=class extends Ui{constructor(e){super(e),this.visible=!0}clone(){}};E([N({type:["line"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],NW.prototype,"type",void 0),E([N({readOnly:!0})],NW.prototype,"visible",void 0),NW=E([dt("esri.symbols.callouts.Callout3D")],NW);const D7e=NW;var Pwe;let lse=Pwe=class extends Ui{constructor(){super(...arguments),this.color=new en("white")}clone(){return new Pwe({color:gi(this.color)})}};E([N(dR)],lse.prototype,"color",void 0),lse=Pwe=E([dt("esri.symbols.callouts.LineCallout3DBorder")],lse);const F7e=lse;Object.freeze(Object.defineProperty({__proto__:null,default:F7e},Symbol.toStringTag,{value:"Module"}));var Owe;let gR=Owe=class extends D7e{constructor(t){super(t),this.type="line",this.color=new en([0,0,0,1]),this.size=Ky(1),this.border=null}get visible(){return this.size>0&&ve(this.color)&&this.color.a>0}clone(){return new Owe({color:gi(this.color),size:this.size,border:gi(this.border)})}};E([rn({line:"line"},{readOnly:!0})],gR.prototype,"type",void 0),E([N(dR)],gR.prototype,"color",void 0),E([N(kC)],gR.prototype,"size",void 0),E([N({type:F7e,json:{write:!0}})],gR.prototype,"border",void 0),E([N({readOnly:!0})],gR.prototype,"visible",null),gR=Owe=E([dt("esri.symbols.callouts.LineCallout3D")],gR);const ljt=gR;function Rwe(t){if(!t)return!1;const e=t.verticalOffset;return!!e&&!(e.screenLength<=0||ve(e.maxWorldLength)&&e.maxWorldLength<=0)}function L7e(t){if(!t||!t.supportsCallout||!t.supportsCallout())return!1;const e=t.callout;return!!e&&!!e.visible&&!!Rwe(t)}const N7e={types:{key:"type",base:D7e,typeMap:{line:ljt}},json:{write:!0}};var Mwe;let _9=Mwe=class extends Ui{constructor(t){super(t),this.screenLength=0,this.minWorldLength=0,this.maxWorldLength=null}clone(){return new Mwe({screenLength:this.screenLength,minWorldLength:this.minWorldLength,maxWorldLength:this.maxWorldLength})}};E([N(kC)],_9.prototype,"screenLength",void 0),E([N({type:Number,nonNullable:!0,json:{write:!0,default:0}})],_9.prototype,"minWorldLength",void 0),E([N({type:Number,json:{write:!0}})],_9.prototype,"maxWorldLength",void 0),_9=Mwe=E([dt("esri.symbols.support.Symbol3DVerticalOffset")],_9);const k7e=_9;var use;const $7e=Sr.ofType({base:null,key:"type",typeMap:{text:y9}});let yR=use=class extends v9{constructor(t){super(t),this.verticalOffset=null,this.callout=null,this.styleOrigin=null,this.symbolLayers=new $7e,this.type="label-3d"}supportsCallout(){return!0}hasVisibleCallout(){return L7e(this)}hasVisibleVerticalOffset(){return Rwe(this)}clone(){return new use({styleOrigin:gi(this.styleOrigin),symbolLayers:gi(this.symbolLayers),thumbnail:gi(this.thumbnail),callout:gi(this.callout),verticalOffset:gi(this.verticalOffset)})}static fromTextSymbol(t){return new use({symbolLayers:[y9.fromTextSymbol(t)]})}};E([N({type:k7e,json:{write:!0}})],yR.prototype,"verticalOffset",void 0),E([N(N7e)],yR.prototype,"callout",void 0),E([N({json:{read:!1,write:!1}})],yR.prototype,"styleOrigin",void 0),E([N({type:$7e})],yR.prototype,"symbolLayers",void 0),E([rn({LabelSymbol3D:"label-3d"},{readOnly:!0})],yR.prototype,"type",void 0),yR=use=E([dt("esri.symbols.LabelSymbol3D")],yR);const cse=yR;var hse;const B7e=Sr.ofType({base:null,key:"type",typeMap:{line:MW,path:Swe}}),ujt=Sr.ofType({base:null,key:"type",typeMap:{line:MW,path:Swe}});let kW=hse=class extends v9{constructor(t){super(t),this.symbolLayers=new B7e,this.type="line-3d"}clone(){return new hse({styleOrigin:gi(this.styleOrigin),symbolLayers:gi(this.symbolLayers),thumbnail:gi(this.thumbnail)})}static fromSimpleLineSymbol(t){return new hse({symbolLayers:[MW.fromSimpleLineSymbol(t)]})}};E([N({type:B7e,json:{type:ujt}})],kW.prototype,"symbolLayers",void 0),E([rn({LineSymbol3D:"line-3d"},{readOnly:!0})],kW.prototype,"type",void 0),kW=hse=E([dt("esri.symbols.LineSymbol3D")],kW);const dse=kW;let vR=class extends qg{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}`}};E([N({type:Number,json:{read:t=>t&&-1*t,write:(t,e)=>e.angle=t&&-1*t}})],vR.prototype,"angle",void 0),E([N({type:["simple-marker","picture-marker"],readOnly:!0})],vR.prototype,"type",void 0),E([N({type:Number,cast:Ga,json:{write:!0}})],vR.prototype,"xoffset",void 0),E([N({type:Number,cast:Ga,json:{write:!0}})],vR.prototype,"yoffset",void 0),E([N({type:Number,cast:t=>t==="auto"?t:Ga(t),json:{write:!0}})],vR.prototype,"size",void 0),vR=E([dt("esri.symbols.MarkerSymbol")],vR);const V7e=vR;var pse;const j7e=Sr.ofType({base:null,key:"type",typeMap:{fill:OW}});let $W=pse=class extends v9{constructor(t){super(t),this.symbolLayers=new j7e,this.type="mesh-3d"}clone(){return new pse({styleOrigin:gi(this.styleOrigin),symbolLayers:gi(this.symbolLayers),thumbnail:gi(this.thumbnail)})}static fromSimpleFillSymbol(t){return new pse({symbolLayers:[OW.fromSimpleFillSymbol(t)]})}};E([N({type:j7e})],$W.prototype,"symbolLayers",void 0),E([rn({MeshSymbol3D:"mesh-3d"},{readOnly:!0})],$W.prototype,"type",void 0),$W=pse=E([dt("esri.symbols.MeshSymbol3D")],$W);const fse=$W;function cjt(t,e,i){return e.imageData?Uje({mediaType:e.contentType||"image/png",isBase64:!0,data:e.imageData}):G7e(e.url,i)}function G7e(t,e){return djt(e)&&!Wg(t)&&e?.layer?.parsedUrl?yd(e.layer.parsedUrl.path,"images",t):rw(t,e)}function hjt(t,e,i,r){if(A1(t)){const n=Y3(t);if(!n)return;e.contentType=n.mediaType,e.imageData=n.data,i&&i.imageData===e.imageData&&i.url&&hA(i.url,e,"url",r)}else hA(t,e,"url",r)}const U7e={json:{read:{source:["imageData","url"],reader:cjt},write:{writer(t,e,i,r){hjt(t,e,this.source,r)}}}},z7e={readOnly:!0,json:{read:{source:["imageData","url"],reader(t,e,i){const r={};return e.imageData&&(r.imageData=e.imageData),e.contentType&&(r.contentType=e.contentType),e.url&&(r.url=G7e(e.url,i)),r}}}};function djt(t){return!(t==null||t.origin!=="service"&&t.origin!=="portal-item"||t.layer?.type!=="feature"&&t.layer?.type!=="stream")}var Dwe;let nw=Dwe=class extends l7e{constructor(...t){super(...t),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(t,e,i,r){if(t&&typeof t!="string"&&t.imageData==null)return t;const n={};return t&&(n.url=t),e&&(n.outline=e),i!=null&&(n.width=Ga(i)),r!=null&&(n.height=Ga(r)),n}clone(){const t=new Dwe({color:gi(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 t._set("source",gi(this.source)),t}hash(){return`${super.hash()}.${this.color?.hash()}.${this.height}.${this.url}.${this.width}.${this.xoffset}.${this.xscale}.${this.yoffset}.${this.yscale}`}};E([rn({esriPFS:"picture-fill"},{readOnly:!0})],nw.prototype,"type",void 0),E([N(U7e)],nw.prototype,"url",void 0),E([N({type:Number,json:{write:!0}})],nw.prototype,"xscale",void 0),E([N({type:Number,json:{write:!0}})],nw.prototype,"yscale",void 0),E([N({type:Number,cast:Ga,json:{write:!0}})],nw.prototype,"width",void 0),E([N({type:Number,cast:Ga,json:{write:!0}})],nw.prototype,"height",void 0),E([N({type:Number,cast:Ga,json:{write:!0}})],nw.prototype,"xoffset",void 0),E([N({type:Number,cast:Ga,json:{write:!0}})],nw.prototype,"yoffset",void 0),E([N(z7e)],nw.prototype,"source",void 0),nw=Dwe=E([dt("esri.symbols.PictureFillSymbol")],nw);const H7e=nw;var Fwe;let a2=Fwe=class extends V7e{constructor(...t){super(...t),this.color=null,this.type="picture-marker",this.url=null,this.source=null,this.height=12,this.width=12,this.size=null}normalizeCtorArgs(t,e,i){if(t&&typeof t!="string"&&t.imageData==null)return t;const r={};return t&&(r.url=t),e!=null&&(r.width=Ga(e)),i!=null&&(r.height=Ga(i)),r}readHeight(t,e){return e.size||t}readWidth(t,e){return e.size||t}clone(){const t=new Fwe({angle:this.angle,height:this.height,url:this.url,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset});return t._set("source",gi(this.source)),t}hash(){return`${super.hash()}.${this.height}.${this.url}.${this.width}`}};E([N({json:{write:!1}})],a2.prototype,"color",void 0),E([rn({esriPMS:"picture-marker"},{readOnly:!0})],a2.prototype,"type",void 0),E([N(U7e)],a2.prototype,"url",void 0),E([N(z7e)],a2.prototype,"source",void 0),E([N({type:Number,cast:Ga,json:{write:!0}})],a2.prototype,"height",void 0),E([Vi("height",["height","size"])],a2.prototype,"readHeight",null),E([N({type:Number,cast:Ga,json:{write:!0}})],a2.prototype,"width",void 0),E([N({json:{write:!1}})],a2.prototype,"size",void 0),a2=Fwe=E([dt("esri.symbols.PictureMarkerSymbol")],a2);const dA=a2;var YL;const W7e=Sr.ofType({base:null,key:"type",typeMap:{icon:UL,object:wwe,text:y9}});let XL=YL=class extends v9{constructor(t){super(t),this.verticalOffset=null,this.callout=null,this.symbolLayers=new W7e,this.type="point-3d"}supportsCallout(){if((this.symbolLayers?this.symbolLayers.length:0)<1)return!1;for(const t of this.symbolLayers.items)switch(t.type){case"icon":case"text":case"object":continue;default:return!1}return!0}hasVisibleCallout(){return L7e(this)}hasVisibleVerticalOffset(){return Rwe(this)}clone(){return new YL({verticalOffset:gi(this.verticalOffset),callout:gi(this.callout),styleOrigin:gi(this.styleOrigin),symbolLayers:gi(this.symbolLayers),thumbnail:gi(this.thumbnail)})}static fromSimpleMarkerSymbol(t){return new YL({symbolLayers:[UL.fromSimpleMarkerSymbol(t)]})}static fromPictureMarkerSymbol(t){return new YL({symbolLayers:[UL.fromPictureMarkerSymbol(t)]})}static fromCIMSymbol(t){if(t.data?.symbol?.type!=="CIMPointSymbol")return null;const i=t.data.symbol;return new YL(i?.callout?{symbolLayers:[UL.fromCIMSymbol(t)],callout:{type:"line",size:.5,color:[0,0,0]},verticalOffset:{screenLength:40}}:{symbolLayers:[UL.fromCIMSymbol(t)]})}static fromTextSymbol(t){return new YL({symbolLayers:[y9.fromTextSymbol(t)]})}};E([N({type:k7e,json:{write:!0}})],XL.prototype,"verticalOffset",void 0),E([N(N7e)],XL.prototype,"callout",void 0),E([N({type:W7e,json:{origins:{"web-scene":{write:!0}}}})],XL.prototype,"symbolLayers",void 0),E([rn({PointSymbol3D:"point-3d"},{readOnly:!0})],XL.prototype,"type",void 0),XL=YL=E([dt("esri.symbols.PointSymbol3D")],XL);const KL=XL;var BW;const q7e=Sr.ofType({base:null,key:"type",typeMap:{extrude:o7e,fill:OW,icon:UL,line:MW,object:wwe,text:y9,water:R7e}});let VW=BW=class extends v9{constructor(t){super(t),this.symbolLayers=new q7e,this.type="polygon-3d"}clone(){return new BW({styleOrigin:gi(this.styleOrigin),symbolLayers:gi(this.symbolLayers),thumbnail:gi(this.thumbnail)})}static fromJSON(t){const e=new BW;if(e.read(t),e.symbolLayers.length===2&&e.symbolLayers.getItemAt(0).type==="fill"&&e.symbolLayers.getItemAt(1).type==="line"){const i=e.symbolLayers.getItemAt(0),r=e.symbolLayers.getItemAt(1);!r.enabled||t.symbolLayers&&t.symbolLayers[1]&&t.symbolLayers[1].enable===!1||(i.outline={size:r.size,color:ve(r.material)?r.material.color:null}),e.symbolLayers.removeAt(1)}return e}static fromSimpleFillSymbol(t){return new BW({symbolLayers:[OW.fromSimpleFillSymbol(t)]})}};E([N({type:q7e,json:{write:!0}})],VW.prototype,"symbolLayers",void 0),E([rn({PolygonSymbol3D:"polygon-3d"},{readOnly:!0})],VW.prototype,"type",void 0),VW=BW=E([dt("esri.symbols.PolygonSymbol3D")],VW);const jW=VW;var Lwe;const Nwe=new Ks({esriSFSSolid:"solid",esriSFSNull:"none",esriSFSHorizontal:"horizontal",esriSFSVertical:"vertical",esriSFSForwardDiagonal:"forward-diagonal",esriSFSBackwardDiagonal:"backward-diagonal",esriSFSCross:"cross",esriSFSDiagonalCross:"diagonal-cross"});let JL=Lwe=class extends l7e{constructor(...t){super(...t),this.color=new en([0,0,0,.25]),this.outline=new Mm,this.type="simple-fill",this.style="solid"}normalizeCtorArgs(t,e,i){if(t&&typeof t!="string")return t;const r={};return t&&(r.style=t),e&&(r.outline=e),i&&(r.color=i),r}clone(){return new Lwe({color:gi(this.color),outline:this.outline&&this.outline.clone(),style:this.style})}hash(){return`${super.hash()}${this.style}.${this.color&&this.color.hash()}`}};E([N()],JL.prototype,"color",void 0),E([N()],JL.prototype,"outline",void 0),E([rn({esriSFS:"simple-fill"},{readOnly:!0})],JL.prototype,"type",void 0),E([N({type:Nwe.apiValues,json:{read:Nwe.read,write:Nwe.write}})],JL.prototype,"style",void 0),JL=Lwe=E([dt("esri.symbols.SimpleFillSymbol")],JL);const sw=JL;var kwe;const $we=new Ks({esriSMSCircle:"circle",esriSMSSquare:"square",esriSMSCross:"cross",esriSMSX:"x",esriSMSDiamond:"diamond",esriSMSTriangle:"triangle",esriSMSPath:"path"});let GC=kwe=class extends V7e{constructor(...t){super(...t),this.color=new en([255,255,255,.25]),this.type="simple-marker",this.size=12,this.style="circle",this.outline=new Mm}normalizeCtorArgs(t,e,i,r){if(t&&typeof t!="string")return t;const n={};return t&&(n.style=t),e!=null&&(n.size=Ga(e)),i&&(n.outline=i),r&&(n.color=r),n}writeColor(t,e){t&&this.style!=="x"&&this.style!=="cross"&&(e.color=t.toJSON()),t===null&&(e.color=null)}set path(t){this.style="path",this._set("path",t)}clone(){return new kwe({angle:this.angle,color:gi(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()}`}};E([N()],GC.prototype,"color",void 0),E([Cr("color")],GC.prototype,"writeColor",null),E([rn({esriSMS:"simple-marker"},{readOnly:!0})],GC.prototype,"type",void 0),E([N()],GC.prototype,"size",void 0),E([N({type:$we.apiValues,json:{read:$we.read,write:$we.write}})],GC.prototype,"style",void 0),E([N({type:String,json:{write:!0}})],GC.prototype,"path",null),E([N({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":Mm}},json:{default:null,write:!0}})],GC.prototype,"outline",void 0),GC=kwe=E([dt("esri.symbols.SimpleMarkerSymbol")],GC);const wd=GC;var Bwe;let xd=Bwe=class extends qg{constructor(...t){super(...t),this.backgroundColor=null,this.borderLineColor=null,this.borderLineSize=null,this.font=new sse,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(t,e,i){if(t&&typeof t!="string")return t;const r={};return t&&(r.text=t),e&&(r.font=e),i&&(r.color=i),r}writeLineWidth(t,e,i,r){r&&typeof r!="string"?r.origin:e[i]=t}castLineWidth(t){return Ga(t)}writeLineHeight(t,e,i,r){r&&typeof r!="string"?r.origin:e[i]=t}clone(){return new Bwe({angle:this.angle,backgroundColor:gi(this.backgroundColor),borderLineColor:gi(this.borderLineColor),borderLineSize:this.borderLineSize,color:gi(this.color),font:this.font&&this.font.clone(),haloColor:gi(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&&this.backgroundColor.hash()}.${this.borderLineColor}.${this.borderLineSize}.${this.color?.hash()}.${this.font&&this.font.hash()}.${this.haloColor&&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}`}};E([N({type:en,json:{write:!0}})],xd.prototype,"backgroundColor",void 0),E([N({type:en,json:{write:!0}})],xd.prototype,"borderLineColor",void 0),E([N({type:Number,json:{write:!0},cast:Ga})],xd.prototype,"borderLineSize",void 0),E([N({type:sse,json:{write:!0}})],xd.prototype,"font",void 0),E([N({...C7e,json:{write:!0}})],xd.prototype,"horizontalAlignment",void 0),E([N({type:Boolean,json:{write:!0}})],xd.prototype,"kerning",void 0),E([N({type:en,json:{write:!0}})],xd.prototype,"haloColor",void 0),E([N({type:Number,cast:Ga,json:{write:!0}})],xd.prototype,"haloSize",void 0),E([N({type:Boolean,json:{write:!0}})],xd.prototype,"rightToLeft",void 0),E([N({type:Boolean,json:{write:!0}})],xd.prototype,"rotated",void 0),E([N({type:String,json:{write:!0}})],xd.prototype,"text",void 0),E([rn({esriTS:"text"},{readOnly:!0})],xd.prototype,"type",void 0),E([N({...T7e,json:{write:!0}})],xd.prototype,"verticalAlignment",void 0),E([N({type:Number,cast:Ga,json:{write:!0}})],xd.prototype,"xoffset",void 0),E([N({type:Number,cast:Ga,json:{write:!0}})],xd.prototype,"yoffset",void 0),E([N({type:Number,json:{read:t=>t&&-1*t,write:(t,e)=>e.angle=t&&-1*t}})],xd.prototype,"angle",void 0),E([N({type:Number,json:{write:!0}})],xd.prototype,"width",void 0),E([N({type:Number})],xd.prototype,"lineWidth",void 0),E([Cr("lineWidth")],xd.prototype,"writeLineWidth",null),E([ho("lineWidth")],xd.prototype,"castLineWidth",null),E([N(S7e)],xd.prototype,"lineHeight",void 0),E([Cr("lineHeight")],xd.prototype,"writeLineHeight",null),xd=Bwe=E([dt("esri.symbols.TextSymbol")],xd);const ZL=xd;var Vwe;let l2=Vwe=class extends qg{constructor(t){super(t),this.styleName=null,this.portal=null,this.styleUrl=null,this.thumbnail=null,this.name=null,this.type="web-style"}get _fetchCacheKey(){const t=ve(this.portal)?this.portal:Cc.getDefault(),e=t.user?t.user.username:null;return`${this.styleName}:${this.styleUrl}:${this.name}:${e}:${t.url}`}read(t,e){this.portal=e?.portal,super.read(t,e)}clone(){return new Vwe({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}fetchSymbol(t){return this._fetchSymbol("webRef",t)}fetchCIMSymbol(t){return this._fetchSymbol("cimRef",t)}async _fetchSymbol(t,e){const i=ve(e)?e.cache:null,r=i?this._fetchCacheKey:null;if(ve(i)){const a=r&&i.get(r);if(a)return a.clone()}const n=await pjt();yn(e);const s=n.resolveWebStyleSymbol(this,{portal:this.portal},t,e);s.catch(a=>{Oi.getLogger(this.declaredClass).error("#fetchSymbol()","Failed to create symbol from style",a)});const o=await s;return t==="webRef"&&o.type==="point-3d"||t==="cimRef"&&o.type==="cim"?(ve(i)&&i.set(r,o.clone()),o):null}};function pjt(){return Promise.resolve().then(()=>Ssi)}E([N({json:{write:!1}})],l2.prototype,"color",void 0),E([N({type:String,json:{write:!0}})],l2.prototype,"styleName",void 0),E([N({type:Cc,json:{write:!1}})],l2.prototype,"portal",void 0),E([N({type:String,json:{read:p9,write:hA}})],l2.prototype,"styleUrl",void 0),E([N({type:qL,json:{read:!1}})],l2.prototype,"thumbnail",void 0),E([N({type:String,json:{write:!0}})],l2.prototype,"name",void 0),E([rn({styleSymbolReference:"web-style"},{readOnly:!0})],l2.prototype,"type",void 0),E([N()],l2.prototype,"_fetchCacheKey",null),l2=Vwe=E([dt("esri.symbols.WebStyleSymbol")],l2);const QL=l2;function mse(t){if(!t)return!1;switch(t.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 _R(t){if(!t)return!1;switch(t.type){case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":return!0;default:return!1}}const Hh={base:qg,key:"type",typeMap:{"simple-fill":sw,"picture-fill":H7e,"picture-marker":dA,"simple-line":Mm,"simple-marker":wd,text:ZL,"label-3d":cse,"line-3d":dse,"mesh-3d":fse,"point-3d":KL,"polygon-3d":jW,"web-style":QL,cim:wW},errorContext:"symbol"},fjt={base:qg,key:"type",typeMap:{"picture-marker":dA,"simple-marker":wd,text:ZL,"web-style":QL,cim:wW},errorContext:"symbol"},mjt=xC({types:Hh}),GW={base:qg,key:"type",typeMap:{"simple-fill":sw,"picture-fill":H7e,"picture-marker":dA,"simple-line":Mm,"simple-marker":wd,text:ZL,"line-3d":dse,"mesh-3d":fse,"point-3d":KL,"polygon-3d":jW,"web-style":QL,cim:wW},errorContext:"symbol"},gjt={base:qg,key:"type",typeMap:{text:ZL,"label-3d":cse},errorContext:"symbol"},Y7e={base:qg,key:"type",typeMap:{"line-3d":dse,"mesh-3d":fse,"point-3d":KL,"polygon-3d":jW,"web-style":QL,cim:wW},errorContext:"symbol"},yjt={base:qg,key:"type",typeMap:{"label-3d":cse},errorContext:"symbol"},X7e=wC(Hh);function vjt(t){if(!t)return null;const e={};for(const i in t){const r=Sl(t[i]);r&&(e[i]=r)}return Object.keys(e).length!==0?e:null}function _jt(t){if(!ve(t))return null;const e={};for(const i in t){const r=t[i];r&&(e[i]=r.toJSON())}return Object.keys(e).length!==0?e:null}let Zv=class extends _a(Ui){constructor(...e){super(...e),this.isAggregate=!1,this.layer=null,this.popupTemplate=null,this.sourceLayer=null,Object.defineProperty(this,"uid",{value:j3(),configurable:!0})}normalizeCtorArgs(e,i,r,n){return e&&!e.declaredClass?e:{geometry:e,symbol:i,attributes:r,popupTemplate:n}}set aggregateGeometries(e){const i=this._get("aggregateGeometries");JSON.stringify(i)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const i=this._get("attributes");i!==e&&(this._set("attributes",e),this._notifyLayer("attributes",i,e))}set geometry(e){const i=this._get("geometry");i!==e&&(this._set("geometry",e),this._notifyLayer("geometry",i,e))}set symbol(e){const i=this._get("symbol");i!==e&&(this._set("symbol",e),this._notifyLayer("symbol",i,e))}set visible(e){const i=this._get("visible");i!==e&&(this._set("visible",e),this._notifyLayer("visible",i,e))}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;for(const i of[this.sourceLayer,this.layer])if(i){if("popupTemplate"in i&&i.popupTemplate)return i.popupTemplate;if(e&&"defaultPopupTemplate"in i&&ve(i.defaultPopupTemplate))return i.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,i){if(this.attributes){const r=this.getAttribute(e);this.attributes[e]=i,this._notifyLayer("attributes",r,i,e)}else this.attributes={[e]:i},this._notifyLayer("attributes",void 0,i,e)}getObjectId(){return this.sourceLayer&&"objectIdField"in this.sourceLayer&&this.sourceLayer.objectIdField?this.getAttribute(this.sourceLayer.objectIdField):null}toJSON(){return{aggregateGeometries:_jt(this.aggregateGeometries),geometry:ve(this.geometry)?this.geometry.toJSON():null,symbol:ve(this.symbol)?this.symbol.toJSON():null,attributes:{...this.attributes},popupTemplate:this.popupTemplate&&this.popupTemplate.toJSON()}}notifyGeometryChanged(){this._notifyLayer("geometry",this.geometry,this.geometry)}notifyMeshTransformChanged(){ve(this.geometry)&&this.geometry.type==="mesh"&&this._notifyLayer("transform",this.geometry.transform,this.geometry.transform)}_notifyLayer(e,i,r,n){if(!this.layer||!("graphicChanged"in this.layer))return;const s={graphic:this,property:e,oldValue:i,newValue:r};e==="attributes"&&(s.attributeName=n),this.layer.graphicChanged(s)}};E([N({value:null,json:{read:vjt}})],Zv.prototype,"aggregateGeometries",null),E([N({value:null})],Zv.prototype,"attributes",null),E([N({value:null,types:R1,json:{read:Sl}})],Zv.prototype,"geometry",null),E([N({type:Boolean})],Zv.prototype,"isAggregate",void 0),E([N({clonable:"reference"})],Zv.prototype,"layer",void 0),E([N({type:wh})],Zv.prototype,"popupTemplate",void 0),E([N({clonable:"reference"})],Zv.prototype,"sourceLayer",void 0),E([N({value:null,types:Hh})],Zv.prototype,"symbol",null),E([N({type:Boolean,value:!0})],Zv.prototype,"visible",null),Zv=E([dt("esri.Graphic")],Zv),function(t){t.generateUID=j3}(Zv||(Zv={}));const io=Zv;var jwe;let UW=jwe=class extends Ui{constructor(t){super(t),this.minValue=0,this.maxValue=0}clone(){return new jwe({minValue:this.minValue,maxValue:this.maxValue})}};E([N({type:Number,json:{write:!0}})],UW.prototype,"minValue",void 0),E([N({type:Number,json:{write:!0}})],UW.prototype,"maxValue",void 0),UW=jwe=E([dt("esri.renderer.support.AuthoringInfoClassBreakInfo")],UW);var Gwe;let bR=Gwe=class extends Ui{constructor(t){super(t),this.field="",this.normalizationField="",this.label="",this.classBreakInfos=[]}clone(){return new Gwe({field:this.field,normalizationField:this.normalizationField,label:this.label,classBreakInfos:gi(this.classBreakInfos)})}};E([N({type:String,json:{write:!0}})],bR.prototype,"field",void 0),E([N({type:String,json:{write:!0}})],bR.prototype,"normalizationField",void 0),E([N({type:String,json:{write:!0}})],bR.prototype,"label",void 0),E([N({type:[UW],json:{write:!0}})],bR.prototype,"classBreakInfos",void 0),bR=Gwe=E([dt("esri.renderers.support.AuthoringInfoFieldInfo")],bR);var Uwe;const gse=new Ks({percentTotal:"percent-of-total",ratio:"ratio",percent:"percent"}),yse=new Ks({sizeInfo:"size",colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation"}),K7e={key:t=>typeof t=="number"?"number":"string",typeMap:{number:Number,string:String},base:null},J7e=["high-to-low","above-and-below","centered-on","extremes"],Z7e=[...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"])],Q7e=["seconds","minutes","hours","days","months","years"];let Qv=Uwe=class extends Ui{constructor(t){super(t),this.endTime=null,this.field=null,this.maxSliderValue=null,this.minSliderValue=null,this.startTime=null,this.type=null,this.units=null}castEndTime(t){return typeof t=="string"||typeof t=="number"?t:null}castStartTime(t){return typeof t=="string"||typeof t=="number"?t:null}get style(){return this.type==="color"?this._get("style"):null}set style(t){this._set("style",t)}get theme(){return this.type==="color"||this.type==="size"?this._get("theme")||"high-to-low":null}set theme(t){this._set("theme",t)}clone(){return new Uwe({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})}};E([N({types:K7e,json:{write:!0}})],Qv.prototype,"endTime",void 0),E([ho("endTime")],Qv.prototype,"castEndTime",null),E([N({type:String,json:{write:!0}})],Qv.prototype,"field",void 0),E([N({type:Number,json:{write:!0}})],Qv.prototype,"maxSliderValue",void 0),E([N({type:Number,json:{write:!0}})],Qv.prototype,"minSliderValue",void 0),E([N({types:K7e,json:{write:!0}})],Qv.prototype,"startTime",void 0),E([ho("startTime")],Qv.prototype,"castStartTime",null),E([N({type:gse.apiValues,value:null,json:{type:gse.jsonValues,read:gse.read,write:gse.write}})],Qv.prototype,"style",null),E([N({type:Z7e,value:null,json:{type:Z7e,origins:{"web-scene":{type:J7e,write:{writer:(t,e)=>{J7e.includes(t)&&(e.theme=t)}}}},write:!0}})],Qv.prototype,"theme",null),E([N({type:yse.apiValues,json:{type:yse.jsonValues,read:yse.read,write:yse.write}})],Qv.prototype,"type",void 0),E([N({type:Q7e,json:{type:Q7e,write:!0}})],Qv.prototype,"units",void 0),Qv=Uwe=E([dt("esri.renderers.support.AuthoringInfoVisualVariable")],Qv);const bjt=Qv;let vse=class extends Ui{constructor(e){super(e),this.type=null}};E([N({readOnly:!0,json:{read:!1,write:!0}})],vse.prototype,"type",void 0),vse=E([dt("esri.rest.support.ColorRamp")],vse);const zwe=vse;var Hwe;let e5=Hwe=class extends zwe{constructor(t){super(t),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new Hwe({fromColor:gi(this.fromColor),toColor:gi(this.toColor),algorithm:this.algorithm})}};E([rn({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],e5.prototype,"algorithm",void 0),E([N({type:en,json:{type:[Ls],write:!0}})],e5.prototype,"fromColor",void 0),E([N({type:en,json:{type:[Ls],write:!0}})],e5.prototype,"toColor",void 0),E([N({type:["algorithmic"]})],e5.prototype,"type",void 0),e5=Hwe=E([dt("esri.rest.support.AlgorithmicColorRamp")],e5);const Wwe=e5;var qwe;let zW=qwe=class extends zwe{constructor(t){super(t),this.colorRamps=null,this.type="multipart"}clone(){return new qwe({colorRamps:gi(this.colorRamps)})}};E([N({type:[Wwe],json:{write:!0}})],zW.prototype,"colorRamps",void 0),E([N({type:["multipart"]})],zW.prototype,"type",void 0),zW=qwe=E([dt("esri.rest.support.MultipartColorRamp")],zW);const _se=zW,bse={key:"type",base:zwe,typeMap:{algorithmic:Wwe,multipart:_se}};function wse(t){return t&&t.type?t.type==="algorithmic"?Wwe.fromJSON(t):t.type==="multipart"?_se.fromJSON(t):null:null}var Ywe;const t5=new Ks({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),xse=new Ks({pieChart:"pie-chart",classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),eze=new Ks({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density"}),tze=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers","decimal-degrees"],wjt=["high-to-low","above-and-below","above","below","90-10"],xjt=["flow-line","wave-front"],Sjt=["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"];let lp=Ywe=class extends Ui{constructor(t){super(t),this.colorRamp=null,this.fadeRatio=null,this.isAutoGenerated=!1,this.lengthUnit=null,this.maxSliderValue=null,this.minSliderValue=null,this.visualVariables=null}get classificationMethod(){const t=this._get("classificationMethod"),e=this.type;return e&&e!=="relationship"?e==="class-breaks-size"||e==="class-breaks-color"?t||"manual":null:t}set classificationMethod(t){this._set("classificationMethod",t)}readColorRamp(t){return t?wse(t):void 0}get fields(){return this.type&&this.type!=="predominance"?null:this._get("fields")}set fields(t){this._set("fields",t)}get field1(){return this.type&&this.type!=="relationship"?null:this._get("field1")}set field1(t){this._set("field1",t)}get field2(){return this.type&&this.type!=="relationship"?null:this._get("field2")}set field2(t){this._set("field2",t)}get flowTheme(){return this.type==="flow"?this._get("flowTheme"):null}set flowTheme(t){this._set("flowTheme",t)}get focus(){return this.type&&this.type!=="relationship"?null:this._get("focus")}set focus(t){this._set("focus",t)}get numClasses(){return this.type&&this.type!=="relationship"?null:this._get("numClasses")}set numClasses(t){this._set("numClasses",t)}get statistics(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("statistics"):null}set statistics(t){this._set("statistics",t)}get standardDeviationInterval(){const t=this.type;return t&&t!=="relationship"&&t!=="class-breaks-size"&&t!=="class-breaks-color"||this.classificationMethod&&this.classificationMethod!=="standard-deviation"?null:this._get("standardDeviationInterval")}set standardDeviationInterval(t){this._set("standardDeviationInterval",t)}get type(){return this._get("type")}set type(t){let e=t;t==="classed-size"?e="class-breaks-size":t==="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(t){this._set("univariateSymbolStyle",t)}get univariateTheme(){return this.type==="univariate-color-size"?this._get("univariateTheme"):null}set univariateTheme(t){this._set("univariateTheme",t)}clone(){return new Ywe({classificationMethod:this.classificationMethod,colorRamp:gi(this.colorRamp),fadeRatio:gi(this.fadeRatio),fields:this.fields&&this.fields.slice(0),field1:gi(this.field1),field2:gi(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(t=>t.clone()),univariateSymbolStyle:this.univariateSymbolStyle,univariateTheme:this.univariateTheme,flowTheme:this.flowTheme})}};E([N({type:t5.apiValues,value:null,json:{type:t5.jsonValues,read:t5.read,write:t5.write,origins:{"web-document":{default:"manual",type:t5.jsonValues,read:t5.read,write:t5.write}}}})],lp.prototype,"classificationMethod",null),E([N({types:bse,json:{write:!0}})],lp.prototype,"colorRamp",void 0),E([Vi("colorRamp")],lp.prototype,"readColorRamp",null),E([N({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],lp.prototype,"fadeRatio",void 0),E([N({type:[String],value:null,json:{write:!0}})],lp.prototype,"fields",null),E([N({type:bR,value:null,json:{write:!0}})],lp.prototype,"field1",null),E([N({type:bR,value:null,json:{write:!0}})],lp.prototype,"field2",null),E([N({type:xjt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],lp.prototype,"flowTheme",null),E([N({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],lp.prototype,"focus",null),E([N({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],lp.prototype,"isAutoGenerated",void 0),E([N({type:Number,value:null,json:{type:Ls,write:!0}})],lp.prototype,"numClasses",null),E([N({type:tze,json:{type:tze,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],lp.prototype,"lengthUnit",void 0),E([N({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],lp.prototype,"maxSliderValue",void 0),E([N({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],lp.prototype,"minSliderValue",void 0),E([N({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],lp.prototype,"statistics",null),E([N({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],lp.prototype,"standardDeviationInterval",null),E([N({type:xse.apiValues,value:null,json:{type:xse.jsonValues,read:xse.read,write:xse.write,origins:{"web-scene":{type:eze.jsonValues,write:{writer:eze.write,overridePolicy:t=>({enabled:t!=="flow"})}}}}})],lp.prototype,"type",null),E([N({type:[bjt],json:{write:!0}})],lp.prototype,"visualVariables",void 0),E([N({type:Sjt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],lp.prototype,"univariateSymbolStyle",null),E([N({type:wjt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],lp.prototype,"univariateTheme",null),lp=Ywe=E([dt("esri.renderers.support.AuthoringInfo")],lp);const HW=lp,Xwe=new Ks({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let WW=class extends Ui{constructor(e){super(e),this.authoringInfo=null,this.type=null}async getRequiredFields(e){if(!this.collectRequiredFields)return[];const i=new Set;return await this.collectRequiredFields(i,e),Array.from(i).sort()}getSymbol(e,i){}async getSymbolAsync(e,i){}getSymbols(){return[]}getAttributeHash(){return JSON.stringify(this)}getMeshHash(){return JSON.stringify(this)}};E([N({type:HW,json:{write:!0}})],WW.prototype,"authoringInfo",void 0),E([N({type:Xwe.apiValues,readOnly:!0,json:{type:Xwe.jsonValues,read:!1,write:{writer:Xwe.write,ignoreOrigin:!0}}})],WW.prototype,"type",void 0),WW=E([dt("esri.renderers.Renderer")],WW);const UC=WW;function Cjt(t){return t.match(Tjt)?.[1]?.replace(/\\'/g,"'")??null}const Tjt=/^hash\(\$feature\['((\\'|[^'])+)'\]\) \* 8\.381e-8$/;var Kwe;let zC=Kwe=class extends Ui{constructor(){super(...arguments),this.title=null}clone(){return new Kwe({title:this.title})}};E([N({type:String,json:{write:!0}})],zC.prototype,"title",void 0),zC=Kwe=E([dt("esri.renderers.support.LegendOptions")],zC);var Jwe;let Sse=Jwe=class extends zC{constructor(){super(...arguments),this.showLegend=null}clone(){return new Jwe({title:this.title,showLegend:this.showLegend})}};E([N({type:Boolean,json:{write:!0}})],Sse.prototype,"showLegend",void 0),Sse=Jwe=E([dt("esri.renderers.visualVariables.support.VisualVariableLegendOptions")],Sse);const ize=Sse,Zwe=new Ks({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let u2=class extends Ui{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"?(Oi.getLogger(this.declaredClass).error(".field: field must be a string value"),null):MH(e)}get arcadeRequired(){return!!this.valueExpression}clone(){}getAttributeHash(){return`${this.type}-${this.field}-${this.valueExpression}`}};E([N()],u2.prototype,"index",void 0),E([N({type:Zwe.apiValues,readOnly:!0,json:{read:Zwe.read,write:Zwe.write}})],u2.prototype,"type",void 0),E([N({type:String,json:{write:!0}})],u2.prototype,"field",void 0),E([ho("field")],u2.prototype,"castField",null),E([N({type:String,json:{write:!0}})],u2.prototype,"valueExpression",void 0),E([N({type:String,json:{write:!0}})],u2.prototype,"valueExpressionTitle",void 0),E([N({readOnly:!0})],u2.prototype,"arcadeRequired",null),E([N({type:ize,json:{write:!0}})],u2.prototype,"legendOptions",void 0),u2=E([dt("esri.renderers.visualVariables.VisualVariable")],u2);const qW=u2;var Qwe;let i5=Qwe=class extends Ui{constructor(t){super(t),this.color=null,this.label=null,this.value=null}writeValue(t,e,i){e[i]=t??0}clone(){return new Qwe({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};E([N({type:en,json:{type:[Ls],write:!0}})],i5.prototype,"color",void 0),E([N({type:String,json:{write:!0}})],i5.prototype,"label",void 0),E([N({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],i5.prototype,"value",void 0),E([Cr("value")],i5.prototype,"writeValue",null),i5=Qwe=E([dt("esri.renderers.visualVariables.support.ColorStop")],i5);const rze=i5;var exe;let r5=exe=class extends qW{constructor(t){super(t),this.type="color",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(t){t&&Array.isArray(t)&&(t=t.filter(e=>!!e)).sort((e,i)=>e.value-i.value),this._set("stops",t)}clone(){return new exe({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(t=>t.clone()),legendOptions:this.legendOptions&&this.legendOptions.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(t=>t.value||0)}};E([N({readOnly:!0})],r5.prototype,"cache",null),E([N({type:["color"],json:{type:["colorInfo"]}})],r5.prototype,"type",void 0),E([N({type:String,json:{write:!0}})],r5.prototype,"normalizationField",void 0),E([N({type:[rze],json:{write:!0}})],r5.prototype,"stops",null),r5=exe=E([dt("esri.renderers.visualVariables.ColorVariable")],r5);const nze=r5;var txe;let wR=txe=class extends Ui{constructor(t){super(t),this.label=null,this.opacity=null,this.value=null}readOpacity(t,e){return h9(e.transparency)}writeOpacity(t,e,i){e[i]=qne(t)}clone(){return new txe({label:this.label,opacity:this.opacity,value:this.value})}};E([N({type:String,json:{write:!0}})],wR.prototype,"label",void 0),E([N({type:Number,json:{type:Ls,write:{target:"transparency"}}})],wR.prototype,"opacity",void 0),E([Vi("opacity",["transparency"])],wR.prototype,"readOpacity",null),E([Cr("opacity")],wR.prototype,"writeOpacity",null),E([N({type:Number,json:{write:!0}})],wR.prototype,"value",void 0),wR=txe=E([dt("esri.renderers.visualVariables.support.OpacityStop")],wR);const Ejt=wR;var ixe;let n5=ixe=class extends qW{constructor(t){super(t),this.type="opacity",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(t){t&&Array.isArray(t)&&(t=t.filter(e=>!!e)).sort((e,i)=>e.value-i.value),this._set("stops",t)}clone(){return new ixe({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(t=>t.clone()),legendOptions:this.legendOptions&&this.legendOptions.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(t=>t.value||0)}};E([N({readOnly:!0})],n5.prototype,"cache",null),E([N({type:["opacity"],json:{type:["transparencyInfo"]}})],n5.prototype,"type",void 0),E([N({type:String,json:{write:!0}})],n5.prototype,"normalizationField",void 0),E([N({type:[Ejt],json:{write:!0}})],n5.prototype,"stops",null),n5=ixe=E([dt("esri.renderers.visualVariables.OpacityVariable")],n5);const sze=n5;var rxe;let pA=rxe=class extends qW{constructor(t){super(t),this.axis=null,this.type="rotation",this.rotationType="geographic",this.valueExpressionTitle=null}get cache(){return{hasExpression:!!this.valueExpression,compiledFunc:null}}writeValueExpressionTitleWebScene(t,e,i,r){if(r&&r.messages){const n=`visualVariables[${this.index}]`;r.messages.push(new st("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 rxe({axis:this.axis,rotationType:this.rotationType,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,legendOptions:this.legendOptions&&this.legendOptions.clone()})}};E([N({readOnly:!0})],pA.prototype,"cache",null),E([N({type:["heading","tilt","roll"],json:{origins:{"web-scene":{default:"heading",write:!0}}}})],pA.prototype,"axis",void 0),E([N({type:["rotation"],json:{type:["rotationInfo"]}})],pA.prototype,"type",void 0),E([N({type:["geographic","arithmetic"],json:{write:!0,origins:{"web-document":{write:!0,default:"geographic"}}}})],pA.prototype,"rotationType",void 0),E([N({type:String,json:{write:!0}})],pA.prototype,"valueExpressionTitle",void 0),E([Cr("web-scene","valueExpressionTitle")],pA.prototype,"writeValueExpressionTitleWebScene",null),pA=rxe=E([dt("esri.renderers.visualVariables.RotationVariable")],pA);const Cse=pA;var nxe;let b9=nxe=class extends Ui{constructor(t){super(t),this.label=null,this.size=null,this.value=null}clone(){return new nxe({label:this.label,size:this.size,value:this.value})}};E([N({type:String,json:{write:!0}})],b9.prototype,"label",void 0),E([N({type:Number,cast:Ga,json:{write:!0}})],b9.prototype,"size",void 0),E([N({type:Number,json:{write:!0}})],b9.prototype,"value",void 0),b9=nxe=E([dt("esri.renderers.visualVariables.support.SizeStop")],b9);const w9=b9;var sxe;let Tse=sxe=class extends ize{constructor(){super(...arguments),this.customValues=null}clone(){return new sxe({title:this.title,showLegend:this.showLegend,customValues:this.customValues&&this.customValues.slice(0)})}};E([N({type:[Number],json:{write:!0}})],Tse.prototype,"customValues",void 0),Tse=sxe=E([dt("esri.renderers.visualVariables.support.SizeVariableLegendOptions")],Tse);const Ijt=Tse;var fA,xh;function HC(t){return t&&t.declaredClass==="esri.renderers.visualVariables.SizeVariable"}function YW(t){return t!=null&&!isNaN(t)&&isFinite(t)}function oze(t){return t.valueExpression?fA.Expression:t.field&&typeof t.field=="string"?fA.Field:fA.Unknown}function Ajt(t,e){const i=e||oze(t),r=t.valueUnit||"unknown";return i===fA.Unknown?xh.Constant:t.stops?xh.Stops:t.minSize!=null&&t.maxSize!=null&&t.minDataValue!=null&&t.maxDataValue!=null?xh.ClampedLinear:r==="unknown"?t.minSize!=null&&t.minDataValue!=null?t.minSize&&t.minDataValue?xh.Proportional:xh.Additive:xh.Identity:xh.RealWorldSize}(function(t){t.Unknown="unknown",t.Expression="expression",t.Field="field"})(fA||(fA={})),function(t){t.Unknown="unknown",t.Stops="stops",t.ClampedLinear="clamped-linear",t.Proportional="proportional",t.Additive="additive",t.Constant="constant",t.Identity="identity",t.RealWorldSize="real-world-size"}(xh||(xh={}));function eFr(t){}function Pjt(t){return()=>t}const XW={inches:X0(1,"meters","inches"),feet:X0(1,"meters","feet"),"us-feet":X0(1,"meters","us-feet"),yards:X0(1,"meters","yards"),miles:X0(1,"meters","miles"),"nautical-miles":X0(1,"meters","nautical-miles"),millimeters:X0(1,"meters","millimeters"),centimeters:X0(1,"meters","centimeters"),decimeters:X0(1,"meters","decimeters"),meters:X0(1,"meters","meters"),kilometers:X0(1,"meters","kilometers"),"decimal-degrees":1/F$t(1,"meters",Mu.radius)},xR=Oi.getLogger("esri.renderers.visualVariables.support.visualVariableUtils"),aze=new io,Ese=Math.PI,lze=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i;function uze(t,e,i){const r="visualVariables"in t&&t.visualVariables?t.visualVariables.find(x=>x.type==="color"):t;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.ColorVariable")return void xR.warn("The visualVariable should be an instance of esri.renderers.visualVariables.ColorVariable");const n=typeof e=="number",s=n?null:e,o=s&&s.attributes;let a=n?e:null;const l=r.field,{ipData:c,hasExpression:h}=r.cache;let p=r.cache.compiledFunc;if(!l&&!h){const x=r.stops;return x&&x[0]&&x[0].color}if(typeof a!="number")if(h){if(lt(i)||lt(i.arcade))return void xR.error("Use of arcade expressions requires an arcade context");const x={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},I=i.arcade.arcadeUtils,P=I.getViewInfo(x),F=I.createExecContext(s,P);if(!p){const k=I.createSyntaxTree(r.valueExpression);p=I.createFunction(k),r.cache.compiledFunc=p}a=I.executeFunction(p,F)}else o&&(a=o[l]);const y=r.normalizationField,v=o!=null&&y!=null?parseFloat(o[y]):void 0;if(a!=null&&(!y||n||!isNaN(v)&&v!==0)){isNaN(v)||n||(a/=v);const x=axe(a,c);if(x){const I=x[0],P=x[1],F=I===P?r.stops[I].color:en.blendColors(r.stops[I].color,r.stops[P].color,x[2],ve(i)?i.color:void 0);return new en(F)}}}function cze(t,e,i){const r="visualVariables"in t&&t.visualVariables?t.visualVariables.find(x=>x.type==="opacity"):t;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.OpacityVariable")return void xR.warn("The visualVariable should be an instance of esri.renderers.visualVariables.OpacityVariable");const n=typeof e=="number",s=n?null:e,o=s&&s.attributes;let a=n?e:null;const l=r.field,{ipData:c,hasExpression:h}=r.cache;let p=r.cache.compiledFunc;if(!l&&!h){const x=r.stops;return x&&x[0]&&x[0].opacity}if(typeof a!="number")if(h){if(lt(i)||lt(i.arcade))return void xR.error("Use of arcade expressions requires an arcade context");const x={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},I=i.arcade.arcadeUtils,P=I.getViewInfo(x),F=I.createExecContext(s,P);if(!p){const k=I.createSyntaxTree(r.valueExpression);p=I.createFunction(k),r.cache.compiledFunc=p}a=I.executeFunction(p,F)}else o&&(a=o[l]);const y=r.normalizationField,v=o!=null&&y!=null?parseFloat(o[y]):void 0;if(a!=null&&(!y||n||!isNaN(v)&&v!==0)){isNaN(v)||n||(a/=v);const x=axe(a,c);if(x){const I=x[0],P=x[1];if(I===P)return r.stops[I].opacity;{const F=r.stops[I].opacity;return F+(r.stops[P].opacity-F)*x[2]}}}}function oxe(t,e,i){const r="visualVariables"in t&&t.visualVariables?t.visualVariables.find(v=>v.type==="rotation"):t;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.RotationVariable")return void xR.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&&a.attributes,c=r.field,{hasExpression:h}=r.cache;let p=r.cache.compiledFunc,y=0;if(!c&&!h)return y;if(h){if(lt(i)||lt(i.arcade))return void xR.error("Use of arcade expressions requires an arcade context");const v={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},x=i.arcade.arcadeUtils,I=x.getViewInfo(v),P=x.createExecContext(a,I);if(!p){const F=x.createSyntaxTree(r.valueExpression);p=x.createFunction(F),r.cache.compiledFunc=p}y=x.executeFunction(p,P)}else l&&(y=l[c]||0);return y=typeof y!="number"||isNaN(y)?null:s+o*y,y}function Ojt(t,e,i){const r=typeof e=="number",n=r?null:e,s=n&&n.attributes;let o=r?e:null;const{isScaleDriven:a}=t.cache;let l=t.cache.compiledFunc;if(a){const h=ve(i)?i.scale:void 0,p=ve(i)?i.view:void 0;o=h==null||p==="3d"?Rjt(t):h}else if(!r)switch(t.inputValueType){case fA.Expression:{if(lt(i)||lt(i.arcade))return void xR.error("Use of arcade expressions requires an arcade context");const h={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},p=i.arcade.arcadeUtils,y=p.getViewInfo(h),v=p.createExecContext(n,y);if(!l){const x=p.createSyntaxTree(t.valueExpression);l=p.createFunction(x),t.cache.compiledFunc=l}o=p.executeFunction(l,v);break}case fA.Field:s&&(o=s[t.field]);break;case fA.Unknown:o=null}if(!YW(o))return null;if(r||!t.normalizationField)return o;const c=s?parseFloat(s[t.normalizationField]):null;return YW(c)&&c!==0?o/c:null}function Rjt(t){let e=null,i=null;const r=t.stops;return r?(e=r[0].value,i=r[r.length-1].value):(e=t.minDataValue||0,i=t.maxDataValue||0),(e+i)/2}function Ise(t,e,i){const r="visualVariables"in t&&t.visualVariables?t.visualVariables.find(s=>s.type==="size"):t;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.SizeVariable")return void xR.warn("The visualVariable should be an instance of esri.renderers.visualVariables.SizeVariable");const n=dze(Ojt(r,e,i),r,e,i,r.cache.ipData);return n==null||isNaN(n)?0:n}function e_(t,e,i){return t==null?null:HC(t)?Ise(t,e,i):YW(t)?t:null}function hze(t,e,i){return YW(i)&&t>i?i:YW(e)&&t=e.maxDataValue)return o;if(s==null||o==null)return null;if(e.scaleBy==="area"&&a){const l=a==="circle",c=l?Ese*(s/2)**2:s*s,h=c+n*((l?Ese*(o/2)**2:o*o)-c);return l?2*Math.sqrt(h/Ese):Math.sqrt(h)}return s+n*(o-s)}function Ljt(t,e,i,r){const n=ve(r)?r.shape:void 0,s=t/e.minDataValue,o=e_(e.minSize,i,r),a=e_(e.maxSize,i,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,hze(l,o,a)}function Njt(t,e,i,r,n){const[s,o,a]=axe(t,n);if(s===o)return e_(e.stops?.[s].size,i,r);{const l=e_(e.stops?.[s].size,i,r);return l+(e_(e.stops?.[o].size,i,r)-l)*a}}function kjt(t,e,i,r){const n=(ve(r)&&r.resolution?r.resolution:1)*XW[e.valueUnit],s=e_(e.minSize,i,r),o=e_(e.maxSize,i,r),{valueRepresentation:a}=e;let l=null;return l=a==="area"?2*Math.sqrt(t/Ese)/n:a==="radius"||a==="distance"?2*t/n:t/n,hze(l,s,o)}function tFr(t){return t}function dze(t,e,i,r,n){switch(e.transformationType){case xh.Additive:return Mjt(t,e,i,r);case xh.Constant:return Djt(e,i,r);case xh.ClampedLinear:return Fjt(t,e,i,r);case xh.Proportional:return Ljt(t,e,i,r);case xh.Stops:return Njt(t,e,i,r,n);case xh.RealWorldSize:return kjt(t,e,i,r);case xh.Identity:return t;case xh.Unknown:return null}}function $jt(t,e,i){const{isScaleDriven:r}=t.cache;if(!(r&&i==="3d"||e))return null;const n={scale:e,view:i};let s=e_(t.minSize,aze,n),o=e_(t.maxSize,aze,n);if(s!=null||o!=null){if(s>o){const a=o;o=s,s=a}return{minSize:s,maxSize:o}}}function Bjt(t,e,i){if(!t.visualVariables)return;const r=[],n=[],s=[],o=[],a=[];for(const l of t.visualVariables)switch(l.type){case"color":n.push(l);break;case"opacity":s.push(l);break;case"rotation":a.push(l);break;case"size":o.push(l)}return n.forEach(l=>{const c=uze(l,e,i);r.push({variable:l,value:c})}),s.forEach(l=>{const c=cze(l,e,i);r.push({variable:l,value:c})}),a.forEach(l=>{const c=oxe(l,e,i);r.push({variable:l,value:c})}),o.forEach(l=>{const c=Ise(l,e,i);r.push({variable:l,value:c})}),r.filter(l=>l.value!=null)}function axe(t,e){if(!e)return;let i=0,r=e.length-1;return e.some((n,s)=>t!!e)).sort((e,i)=>e.value-i.value):t&&(Oi.getLogger(this.declaredClass).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),t=null),this._set("stops",t)}get transformationType(){return Ajt(this,this.inputValueType)}readValueExpression(t,e){return t||e.expression&&"$view.scale"}writeValueExpressionWebScene(t,e,i,r){if(t==="$view.scale"){if(r&&r.messages){const n=this.index,s=typeof n=="string"?n:`visualVariables[${n}]`;r.messages.push(new st("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[i]=t}readValueUnit(t){return t?uxe.read(t):null}clone(){return new lxe({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:HC(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:HC(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:this.stops&&this.stops.map(t=>t.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions&&this.legendOptions.clone()})}flipSizes(){if(this.transformationType===xh.ClampedLinear){const{minSize:t,maxSize:e}=this;return this.minSize=e,this.maxSize=t,this}if(this.transformationType===xh.Stops){const t=this.stops;if(!t)return this;const e=t.map(r=>r.size).reverse(),i=t.length;for(let r=0;rt.value||0)}};E([N({readOnly:!0})],ec.prototype,"cache",null),E([N({type:Pse.apiValues,json:{type:Pse.jsonValues,origins:{"web-map":{read:!1}},read:Pse.read,write:Pse.write}})],ec.prototype,"axis",void 0),E([N({type:String,value:null,json:{read:!1}})],ec.prototype,"expression",null),E([N()],ec.prototype,"index",null),E([N({type:String,readOnly:!0})],ec.prototype,"inputValueType",null),E([N({type:Ijt,json:{write:!0}})],ec.prototype,"legendOptions",void 0),E([N({type:Number,value:null,json:{write:!0}})],ec.prototype,"maxDataValue",null),E([N({type:Number,value:null,json:{write:!0}})],ec.prototype,"maxSize",null),E([ho("maxSize")],ec.prototype,"castMaxSize",null),E([Vi("maxSize")],ec.prototype,"readMaxSize",null),E([N({type:Number,value:null,json:{write:!0}})],ec.prototype,"minDataValue",null),E([N({type:Number,value:null,json:{write:!0}})],ec.prototype,"minSize",null),E([ho("minSize")],ec.prototype,"castMinSize",null),E([Vi("minSize")],ec.prototype,"readMinSize",null),E([N({type:String,json:{write:!0}})],ec.prototype,"normalizationField",void 0),E([N({readOnly:!0})],ec.prototype,"arcadeRequired",null),E([N({type:String})],ec.prototype,"scaleBy",void 0),E([N({type:[w9],value:null,json:{write:!0}})],ec.prototype,"stops",null),E([N({type:["outline"],json:{write:!0}})],ec.prototype,"target",void 0),E([N({type:String,readOnly:!0})],ec.prototype,"transformationType",null),E([N({type:["size"],json:{type:["sizeInfo"]}})],ec.prototype,"type",void 0),E([N({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],ec.prototype,"useSymbolValue",void 0),E([N({type:String,json:{write:!0}})],ec.prototype,"valueExpression",void 0),E([Vi("valueExpression",["valueExpression","expression"])],ec.prototype,"readValueExpression",null),E([Cr("web-scene","valueExpression")],ec.prototype,"writeValueExpressionWebScene",null),E([N({type:["radius","diameter","area","width","distance"],json:{write:!0}})],ec.prototype,"valueRepresentation",void 0),E([N({type:uxe.apiValues,json:{write:uxe.write,origins:{"web-map":{read:!1},"web-scene":{write:!0},"portal-item":{write:!0}}}})],ec.prototype,"valueUnit",void 0),E([Vi("valueUnit")],ec.prototype,"readValueUnit",null),ec=lxe=E([dt("esri.renderers.visualVariables.SizeVariable")],ec);const s5=ec,Vjt={color:nze,size:s5,opacity:sze,rotation:Cse},jjt=new Ks({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"}),Gjt=/^\[([^\]]+)\]$/i;let Ose=class extends Tn{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(i=>!!i))&&e.length){for(const i of e)switch(i.type){case"color":this.colorVariables.push(i);break;case"opacity":this.opacityVariables.push(i);break;case"rotation":this.rotationVariables.push(i);break;case"size":this.sizeVariables.push(i)}this.sizeVariables.length&&this.sizeVariables.some(i=>!!i.target)&&e.sort((i,r)=>{let n=null;return n=i.target===r.target?0:i.target?1:-1,n});for(let i=0;i{const c=jjt.read(l.type),h=Vjt[c];h||(Oi.getLogger(this.declaredClass).warn(`Unknown variable type: ${c}`),r&&r.messages&&r.messages.push(new Am("visual-variable:unsupported",`visualVariable of type '${c}' is not supported`,{definition:l,context:r})));const p=new h;return p.read(l,r),p})}writeVariables(e,i){const r=[];for(const n of e){const s=n.toJSON(i);s&&r.push(s)}return r}_resetVariables(){this.colorVariables=[],this.opacityVariables=[],this.rotationVariables=[],this.sizeVariables=[]}};E([N()],Ose.prototype,"visualVariables",null),Ose=E([dt("esri.renderers.visualVariables.VisualVariableFactory")],Ose);const Ujt=Ose,zjt={base:qW,key:"type",typeMap:{opacity:sze,color:nze,rotation:Cse,size:s5}},SR=t=>{let e=class extends t{constructor(){super(...arguments),this._vvFactory=new Ujt}set visualVariables(i){this._vvFactory.visualVariables=i,this._set("visualVariables",this._vvFactory.visualVariables)}readVisualVariables(i,r,n){return this._vvFactory.readVariables(i,r,n)}writeVisualVariables(i,r,n,s){r[n]=this._vvFactory.writeVariables(i,s)}get arcadeRequiredForVisualVariables(){if(!this.visualVariables)return!1;for(const i of this.visualVariables)if(i.arcadeRequired)return!0;return!1}hasVisualVariables(i,r){return i?this.getVisualVariablesForType(i,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(i,r){const n=this.visualVariables;return n?n.filter(s=>s.type===i&&(typeof r=="string"?s.target===r:r!==!1||!s.target)):[]}async collectVVRequiredFields(i,r){let n=[];this.visualVariables&&(n=n.concat(this.visualVariables));for(const s of n)s&&(s.field&&Xy(i,r,s.field),s.normalizationField&&Xy(i,r,s.normalizationField),s.valueExpression&&(Hjt(s.valueExpression,i,r)||await ev(i,r,s.valueExpression)))}};return E([N({types:[zjt],value:null,json:{write:!0}})],e.prototype,"visualVariables",null),E([Vi("visualVariables",["visualVariables","rotationType","rotationExpression"])],e.prototype,"readVisualVariables",null),E([Cr("visualVariables")],e.prototype,"writeVisualVariables",null),e=E([dt("esri.renderers.mixins.VisualVariablesMixin")],e),e};function Hjt(t,e,i){const r=Cjt(t);return!!ve(r)&&(Xy(e,i,r),!0)}const KW={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};function Wjt(t,e=KW){if(!t)return{symbol:null};const{retainId:i=KW.retainId,ignoreDrivers:r=KW.ignoreDrivers,hasLabelingContext:n=KW.hasLabelingContext,retainCIM:s=KW.retainCIM}=e;let o=null;if(_R(t)||t instanceof QL)o=t.clone();else if(t.type==="cim"){const a=t.data?.symbol?.type;if(a!=="CIMPointSymbol")return{error:new st("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${a||"unknown"}' is unsupported in 3D`,{symbol:t})};o=s?t.clone():KL.fromCIMSymbol(t)}else if(t instanceof Mm)o=dse.fromSimpleLineSymbol(t);else if(t instanceof wd)o=KL.fromSimpleMarkerSymbol(t);else if(t instanceof dA)o=KL.fromPictureMarkerSymbol(t);else if(t instanceof sw)o=e.geometryType&&e.geometryType==="mesh"?fse.fromSimpleFillSymbol(t):jW.fromSimpleFillSymbol(t);else{if(!(t instanceof ZL))return{error:new st("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${t.type||t.declaredClass}' is unsupported in 3D`,{symbol:t})};o=n?cse.fromTextSymbol(t):KL.fromTextSymbol(t)}if(i&&o&&o.type!=="cim"&&(o.id=t.id),r&&_R(o))for(let a=0;at==null||typeof t=="string"||typeof t=="number"?t:`${t}`,json:{type:String,write:{writer:(t,e)=>{e.value=t?.toString()}}}};var cxe;let CR=cxe=class extends Ui{constructor(t){super(t),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}clone(){return new cxe({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const t=JSON.stringify(this.symbol);return`${this.minValue}.${this.maxValue}.${t}`}};E([N({type:String,json:{write:!0}})],CR.prototype,"description",void 0),E([N({type:String,json:{write:!0}})],CR.prototype,"label",void 0),E([N({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],CR.prototype,"minValue",void 0),E([N({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],CR.prototype,"maxValue",void 0),E([N(x9)],CR.prototype,"symbol",void 0),CR=cxe=E([dt("esri.renderers.support.ClassBreakInfo")],CR);const S9=CR;var hxe;const bze="log",Dse="percent-of-total",Fse="field",Lse=new Ks({esriNormalizeByLog:bze,esriNormalizeByPercentOfTotal:Dse,esriNormalizeByField:Fse}),qjt=fd(S9);let Vf=hxe=class extends SR(UC){constructor(t){super(t),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(t,e,i){if(!Array.isArray(t))return;let r=e.minValue;return t.map(n=>{const s=new S9;return s.read(n,i),s.minValue==null&&(s.minValue=r),s.maxValue==null&&(s.maxValue=s.minValue),r=s.maxValue,s})}writeClassBreakInfos(t,e,i,r){const n=t.map(s=>s.write({},r));this._areClassBreaksConsecutive()&&n.forEach(s=>delete s.classMinValue),e[i]=n}castField(t){return t==null?t:typeof t=="function"?(Oi.getLogger(this.declaredClass).error(".field: field must be a string value"),null):MH(t)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let t=this._get("normalizationType");const e=!!this.normalizationField,i=this.normalizationTotal!=null;return e||i?(t=e&&Fse||i&&Dse||null,e&&i&&Oi.getLogger(this.declaredClass).warn("warning: both normalizationField and normalizationTotal are set!")):t!==Fse&&t!==Dse||(t=null),t}set normalizationType(t){this._set("normalizationType",t)}addClassBreakInfo(t,e,i){let r=null;r=typeof t=="number"?new S9({minValue:t,maxValue:e,symbol:X7e(i)}):qjt(gi(t)),this.classBreakInfos.push(r),this.classBreakInfos.length===1&&this.notifyChange("minValue")}removeClassBreakInfo(t,e){const i=this.classBreakInfos.length;for(let r=0;r-1?this.classBreakInfos[i].symbol:this.defaultSymbol}async getSymbolAsync(t,e){let i=e;if(this.valueExpression&&(lt(e)||lt(e.arcade))){const n=await Kv(),{arcadeUtils:s}=n;s.hasGeometryOperations(this.valueExpression)&&await s.enableGeometryOperations(),i={...i,arcade:n}}const r=this.getBreakIndex(t,i);return r>-1?this.classBreakInfos[r].symbol:this.defaultSymbol}getSymbols(){const t=[];return this.classBreakInfos.forEach(e=>{e.symbol&&t.push(e.symbol)}),this.defaultSymbol&&t.push(this.defaultSymbol),t}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((t,e)=>t+e.getAttributeHash(),"")}getMeshHash(){const t=JSON.stringify(this.backgroundFillSymbol),e=JSON.stringify(this.defaultSymbol),i=`${this.normalizationField}.${this.normalizationType}.${this.normalizationTotal}`;return`${t}.${e}.${this.classBreakInfos.reduce((r,n)=>r+n.getMeshHash(),"")}.${i}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){return new hxe({field:this.field,backgroundFillSymbol:this.backgroundFillSymbol&&this.backgroundFillSymbol.clone(),defaultLabel:this.defaultLabel,defaultSymbol:this.defaultSymbol&&this.defaultSymbol.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:gi(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:gi(this.visualVariables),legendOptions:gi(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}async collectRequiredFields(t,e){const i=[this.collectVVRequiredFields(t,e),this.collectSymbolFields(t,e)];await Promise.all(i)}async collectSymbolFields(t,e){const i=[...this.getSymbols().map(r=>r.collectRequiredFields(t,e)),ev(t,e,this.valueExpression)];Xy(t,e,this.field),Xy(t,e,this.normalizationField),await Promise.all(i)}_getBreakIndexForExpression(t,e){const{viewingMode:i,scale:r,spatialReference:n,arcade:s}=zu(e,{}),{valueExpression:o}=this;let a=this._compiledValueExpression.valueExpression===o?this._compiledValueExpression.compiledFunction:null;const l=s.arcadeUtils;if(!a){const h=l.createSyntaxTree(o);a=l.createFunction(h),this._compiledValueExpression.compiledFunction=a}this._compiledValueExpression.valueExpression=o;const c=l.executeFunction(a,l.createExecContext(t,l.getViewInfo({viewingMode:i,scale:r,spatialReference:n})));return this._getBreakIndexfromInfos(c)}_getBreakIndexForField(t){const e=this.field,i=t.attributes,r=this.normalizationType;let n=parseFloat(i[e]);if(r){const s=this.normalizationTotal,o=parseFloat(this.normalizationField?i[this.normalizationField]:void 0);if(r===bze)n=Math.log(n)*Math.LOG10E;else if(r!==Dse||s==null||isNaN(s)){if(r===Fse&&!isNaN(o)){if(isNaN(n)||isNaN(o))return-1;n/=o}}else n=n/s*100}return this._getBreakIndexfromInfos(n)}_getBreakIndexfromInfos(t){const e=this.isMaxInclusive;if(t!=null&&typeof t=="number"&&!isNaN(t))for(let i=0;ijd(t),json:{write:!0}})],Vf.prototype,"normalizationTotal",void 0),E([N({type:Lse.apiValues,value:null,json:{type:Lse.jsonValues,read:Lse.read,write:Lse.write}})],Vf.prototype,"normalizationType",null),E([rn({classBreaks:"class-breaks"})],Vf.prototype,"type",void 0),E([N({type:String,json:{write:!0}})],Vf.prototype,"valueExpression",void 0),E([N({type:String,json:{write:!0}})],Vf.prototype,"valueExpressionTitle",void 0),Vf=hxe=E([dt("esri.renderers.ClassBreaksRenderer")],Vf);const o5=Vf,dxe=-3;var TR;(function(t){t[t.ALL=0]="ALL",t[t.SOME=1]="SOME"})(TR||(TR={}));let Yjt=class{constructor(e,i,r){this._namespace=e,this._storage=i,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),this._namespace+=":",r&&(this._storage.registerRemoveFunc(this._namespace,r),this._removeFunc=!0)}destroy(){this._storage.clear(this._namespace),this._removeFunc&&this._storage.deregisterRemoveFunc(this._namespace),this._storage.deregister(this),this._storage=null}get namespace(){return this._namespace.slice(0,-1)}get hitRate(){return this._hit/(this._hit+this._miss)}get size(){return this._storage.size}get maxSize(){return this._storage.maxSize}resetHitRate(){this._hit=this._miss=0}put(e,i,r,n=0){this._storage.put(this._namespace+e,i,r,n)}get(e){const i=this._storage.get(this._namespace+e);return i===void 0?++this._miss:++this._hit,i}pop(e){const i=this._storage.pop(this._namespace+e);return i===void 0?++this._miss:++this._hit,i}updateSize(e,i,r){this._storage.updateSize(this._namespace+e,i,r)}clear(){this._storage.clear(this._namespace)}clearAll(){this._storage.clearAll()}getStats(){return this._storage.getStats()}resetStats(){this._storage.resetStats()}},pxe=class{constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new Em,this._users=new Em}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,i){this._removeFuncs.push([e,i])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace(i=>i[0]!==e)}get size(){return this._size}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,0),this._checkSizeLimit()}put(e,i,r,n){const s=this._db.get(e);if(s&&(this._size-=s.size,this._db.delete(e),s.entry!==i&&this._notifyRemove(e,s.entry,TR.ALL)),r>this._maxSize)return void this._notifyRemove(e,i,TR.ALL);if(i===void 0)return void console.warn("Refusing to cache undefined entry ");if(!r||r<0)return void console.warn("Refusing to cache entry with invalid size "+r);const o=1+Math.max(n,dxe)-dxe;this._db.set(e,{entry:i,size:r,lifetime:o,lives:o}),this._size+=r,this._checkSizeLimit()}updateSize(e,i,r){const n=this._db.get(e);if(n&&n.entry===i){for(this._size-=n.size;r>this._maxSize;){const s=this._notifyRemove(e,i,TR.SOME);if(!(ve(s)&&s>0))return void this._db.delete(e);r=s}n.size=r,this._size+=r,this._checkSizeLimit()}}pop(e){const i=this._db.get(e);if(i)return this._size-=i.size,this._db.delete(e),++this._hit,i.entry;++this._miss}get(e){const i=this._db.get(e);if(i!==void 0)return this._db.delete(e),i.lives=i.lifetime,this._db.set(e,i),++this._hit,i.entry;++this._miss}getStats(){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()},i={},r=new Array;this._db.forEach((o,a)=>{const l=o.lifetime;r[l]=(r[l]||0)+o.size,this._users.forAll(c=>{const h=c.namespace;if(a.startsWith(h)){const p=i[h]||0;i[h]=p+o.size}})});const n={};this._users.forAll(o=>{const a=o.namespace;if(!isNaN(o.hitRate)&&o.hitRate>0){const l=i[a]||0;i[a]=l,n[a]=Math.round(100*o.hitRate)+"%"}else n[a]="0%"});const s=Object.keys(i);s.sort((o,a)=>i[a]-i[o]),s.forEach(o=>e[o]=Math.round(i[o]/2**20)+"MB / "+n[o]);for(let o=r.length-1;o>=0;--o){const a=r[o];a&&(e["Priority "+(o+dxe-1)]=Math.round(a/this.size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll(e=>e.resetHitRate())}clear(e){this._db.forEach((i,r)=>{r.startsWith(e)&&(this._size-=i.size,this._db.delete(r),this._notifyRemove(r,i.entry,TR.ALL))})}clearAll(){this._db.forEach((e,i)=>this._notifyRemove(i,e.entry,TR.ALL)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,i,r){let n;return this._removeFuncs.some(s=>{if(e.startsWith(s[0])){const o=s[1](i,r);return typeof o=="number"&&(n=o),!0}return!1}),n}_checkSizeLimit(){if(!(this._size<=this._maxSize))for(const[e,i]of this._db){if(this._db.delete(e),i.lives<=1){this._size-=i.size;const r=this._notifyRemove(e,i.entry,TR.SOME);ve(r)&&r>0&&(this._size+=r,i.lives=i.lifetime,i.size=r,this._db.set(e,i))}else--i.lives,this._db.set(e,i);if(this._size<=.9*this.maxSize)return}}},C9=class{constructor(e,i){this._storage=new pxe,this._storage.maxSize=e,i&&this._storage.registerRemoveFunc("",i)}put(e,i,r){this._storage.put(e,i,r,1)}pop(e){return this._storage.pop(e)}get(e){return this._storage.get(e)}clear(){this._storage.clearAll()}destroy(){this._storage.destroy()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}};const wze="esri.renderers.support.DictionaryLoader",Xjt={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};let fxe=class{constructor(e,i,r){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new C9(100),this._dictionaryPromise=null,this.url=e,this.config=i,this.fieldMap=r}getSymbolFields(){return this._symbolFields}async getSymbolAsync(e,i){let r;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(i));try{r=await this._dictionaryPromise}catch(v){if(ys(v))return this._dictionaryPromise=null,null}const n={};if(this.fieldMap)for(const v of this._symbolFields){const x=this.fieldMap[v];if(x&&e.attributes[x]!=null){const I=""+e.attributes[x];n[v]=I}else n[v]=""}const s=r?.(n,i);if(!s||typeof s!="string")return null;const o=zc(s).toString(),a=this._symbolCache.get(o);if(a)return a.catch(()=>{this._symbolCache.pop(o)}),a;const l=s.split(";"),c=[],h=[];for(const v of l)if(v)if(v.includes("po:")){const x=v.substr(3).split("|");if(x.length===3){const I=x[0],P=x[1];let F=x[2];if(P==="DashTemplate")F=F.split(" ").map(k=>Number(k));else if(P==="Color"){const k=new en(F).toRgba();F=[k[0],k[1],k[2],255*k[3]]}else F=Number(F);h.push({primitiveName:I,propertyName:P,value:F})}}else if(v.includes("|")){for(const x of v.split("|"))if(this._itemNames.has(x)){c.push(x);break}}else this._itemNames.has(v)&&c.push(v);const p=!ve(e.geometry)||!e.geometry.hasZ&&e.geometry.type==="point",y=this._cimPartsToCIMSymbol(c,h,p,i);return this._symbolCache.put(o,y,1),y}async fetchResources(e){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void Oi.getLogger(wze).error("no valid URL!");const i=ur(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:ve(e)?e.signal:null}),[{data:r}]=await Promise.all([i,Kv()]);if(!r)throw this._dictionaryPromise=null,new st("esri.renderers.DictionaryRenderer","Bad dictionary data!");const n=r.expression,s=r.authoringInfo;this._refSymbolUrlTemplate=this.url+"/"+r.cimRefTemplateUrl,this._itemNames=new Set(r.itemsNames),this._symbolFields=s.symbol;const o={};if(this.config){const c=this.config;for(const h in c)o[h]=c[h]}if(s.configuration)for(const c of s.configuration)o.hasOwnProperty(c.name)||(o[c.name]=c.value);const a=[];if(ve(e)&&e.fields&&this.fieldMap)for(const c of this._symbolFields){const h=this.fieldMap[c],p=e.fields.filter(y=>y.name===h);p.length>0&&a.push({...p[0],name:c})}const l=bBt(n,ve(e)?e.spatialReference:null,a,o).then(c=>{const h={scale:0};return(p,y)=>{if(lt(c))return null;const v=c.repurposeFeature({geometry:null,attributes:p});return h.scale=ve(y)?y.scale??void 0:void 0,c.evaluate({$feature:v,$view:h})}}).catch(c=>(Oi.getLogger(wze).error("Creating dictinoary expression failed:",c),null));return this._dictionaryPromise=l,l}async _cimPartsToCIMSymbol(e,i,r,n){const s=new Array(e.length);for(let l=0;ls.data);const r=this._refSymbolUrlTemplate.replace(/\{itemName\}/gi,e),n=ur(r,{responseType:"json",query:{f:"json"},...i});this._ongoingRequests.set(e,n);try{return(await n).data}catch(s){throw this._ongoingRequests.delete(e),s}}_combineSymbolParts(e,i,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=Xjt),{type:"CIMSymbolReference",symbol:n,primitiveOverrides:i}}};function xze(t,e){if(!t)return;const i=t.symbolLayers;if(!i)return;let r=i.length;for(;r--;){const n=i[r];n&&n.enable!==!1&&n.type==="CIMVectorMarker"&&Kjt(n,e)}}function Kjt(t,e){const i=t.markerGraphics;if(i)for(const r of i){if(!r)continue;const n=r.symbol;if(n)switch(n.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":xze(n,e);break;case"CIMTextSymbol":n.fieldMap=e}}}const Jjt=Object.freeze(Object.defineProperty({__proto__:null,DictionaryLoader:fxe},Symbol.toStringTag,{value:"Module"}));var mxe;let c2=mxe=class extends SR(UC){constructor(t){super(t),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}get _loader(){return new fxe(this.url,this.config,this.fieldMap)}writeData(t,e){t&&(e.scalingExpressionInfo={expression:t,returnType:"number"})}writeVisualVariables(t,e,i,r){r?.origin||super.writeVisualVariables(t,e,i,r)}clone(){return new mxe({config:gi(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:gi(this.fieldMap),url:gi(this.url),visualVariables:gi(this.visualVariables)})}async getSymbolAsync(t,e){return this._loader.getSymbolAsync(t,e)}async collectRequiredFields(t,e){await this.collectVVRequiredFields(t,e),this.scaleExpression&&await ev(t,e,this.scaleExpression);for(const i in this.fieldMap){const r=this.fieldMap[i];e.has(r)&&t.add(r)}}get arcadeRequired(){return!0}getSymbol(){return null}getSymbols(){return[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((t,e)=>t+e.getAttributeHash(),"")}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}getSymbolFields(){return this._loader.getSymbolFields()}};E([N({type:fxe})],c2.prototype,"_loader",null),E([N({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],c2.prototype,"config",void 0),E([N({type:Object,json:{write:!0}})],c2.prototype,"fieldMap",void 0),E([N({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],c2.prototype,"scaleExpression",void 0),E([Cr("scaleExpression")],c2.prototype,"writeData",null),E([N({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(t){return{enabled:!!t&&!!this.scaleExpression}}}}})],c2.prototype,"scaleExpressionTitle",void 0),E([N({type:String,json:{write:!0}})],c2.prototype,"url",void 0),E([Cr("visualVariables")],c2.prototype,"writeVisualVariables",null),c2=mxe=E([dt("esri.renderers.DictionaryRenderer")],c2);const Zjt=c2;var gxe;let mA=gxe=class extends Ui{constructor(t){super(t),this.color=null,this.field=null,this.label=null,this.valueExpression=null,this.valueExpressionTitle=null}castField(t){return t==null?t:typeof t=="function"?(Oi.getLogger(this.declaredClass).error(".field: field must be a string value"),null):MH(t)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){return new gxe({color:this.color&&this.color.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};E([N({type:en,json:{type:[Number],write:!0}})],mA.prototype,"color",void 0),E([N({type:String,json:{write:!0}})],mA.prototype,"field",void 0),E([ho("field")],mA.prototype,"castField",null),E([N({type:String,json:{write:!0}})],mA.prototype,"label",void 0),E([N({type:String,json:{write:!0}})],mA.prototype,"valueExpression",void 0),E([N({type:String,json:{write:!0}})],mA.prototype,"valueExpressionTitle",void 0),mA=gxe=E([dt("esri.renderers.support.AttributeColorInfo")],mA);const Sze=mA;var yxe;let Nse=yxe=class extends Ui{constructor(){super(...arguments),this.unit=null}clone(){return new yxe({unit:this.unit})}};E([N({type:String,json:{write:!0}})],Nse.prototype,"unit",void 0),Nse=yxe=E([dt("esri.renderers.support.DotDensityLegendOptions")],Nse);const Qjt=Nse;var vxe;let t_=vxe=class extends SR(UC){constructor(t){super(t),this.attributes=null,this.backgroundColor=new en([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new Mm,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(t){if(this.referenceScale==null)return this.dotValue;const e=t/this.referenceScale*this.dotValue;return e<1?1:e}getSymbol(){return new sw({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){return this.attributes?.reduce((t,e)=>t+e.getAttributeHash(),"")??""}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new vxe({attributes:gi(this.attributes),backgroundColor:gi(this.backgroundColor),dotBlendingEnabled:gi(this.dotBlendingEnabled),dotShape:gi(this.dotShape),dotSize:gi(this.dotSize),dotValue:gi(this.dotValue),legendOptions:gi(this.legendOptions),outline:gi(this.outline),referenceScale:gi(this.referenceScale),visualVariables:gi(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(t,e){await this.collectVVRequiredFields(t,e);for(const i of this.attributes??[])i.valueExpression&&await ev(t,e,i.valueExpression),i.field&&t.add(i.field)}};E([N({type:[Sze],json:{write:!0}})],t_.prototype,"attributes",void 0),E([N({type:en,json:{write:!0}})],t_.prototype,"backgroundColor",void 0),E([N({type:Boolean,json:{write:!0}})],t_.prototype,"dotBlendingEnabled",void 0),E([N({type:String,json:{write:!1}})],t_.prototype,"dotShape",void 0),E([N({type:Number,json:{write:!0}})],t_.prototype,"dotSize",void 0),E([N({type:Qjt,json:{write:!0}})],t_.prototype,"legendOptions",void 0),E([N({type:Mm,json:{default:null,write:!0}})],t_.prototype,"outline",void 0),E([N({type:Number,json:{write:!0}})],t_.prototype,"dotValue",void 0),E([N({type:Number,json:{write:!0}})],t_.prototype,"referenceScale",void 0),E([N({type:Number,json:{write:!0}})],t_.prototype,"seed",void 0),E([rn({dotDensity:"dot-density"})],t_.prototype,"type",void 0),t_=vxe=E([dt("esri.renderers.DotDensityRenderer")],t_);const eGt=t_;var _xe;let ZW=_xe=class extends Ui{constructor(t){super(t),this.color=null,this.ratio=null}clone(){return new _xe({color:this.color,ratio:this.ratio})}};E([N({type:en,json:{type:[Ls],default:null,write:!0}})],ZW.prototype,"color",void 0),E([N({type:Number,json:{write:!0}})],ZW.prototype,"ratio",void 0),ZW=_xe=E([dt("esri.renderers.support.HeatmapColorStop")],ZW);const QW=ZW;let T9=class extends _a(Ui){constructor(){super(...arguments),this.minLabel=null,this.maxLabel=null,this.title=null}};E([N({type:String,json:{write:!0}})],T9.prototype,"minLabel",void 0),E([N({type:String,json:{write:!0}})],T9.prototype,"maxLabel",void 0),E([N({type:String,json:{write:!0}})],T9.prototype,"title",void 0),T9=E([dt("esri.renderers.support.HeatmapLegendOptions")],T9);function gA(){return[0,0,0,0]}function tGt(t){return[t[0],t[1],t[2],t[3]]}function iv(t,e,i,r){return[t,e,i,r]}function iGt(t){const e=gA(),i=Math.min(4,t.length);for(let r=0;ra>=0&&a<=1).sort((a,l)=>a.ratio-l.ratio).map(({color:a,ratio:l})=>({color:a,ratio:Math.max(l,.001)})),t.length<1)return i;let r=t[0],n=t[0],s=1;const o=gA();for(let a=0;a<512;a++){const l=(a+.5)/512;for(;l>n.ratio&&s=i+F||P.y<-F||P.y>r+F)continue;const k=+p(x),j=Math.max(0,Math.round(P.x)-a),V=Math.max(0,Math.round(P.y)-a),Y=Math.min(r,Math.round(P.y)+a),X=Math.min(i,Math.round(P.x)+a);for(let Z=V;Zh&&(h=c)}}}return{matrix:l.buffer,max:h}}function pGt(t,e,i,r,n,s){t.canvas.width=t.canvas.height=e,t.clearRect(0,0,e,e);const o=t.getImageData(0,0,e,e);i&&r&&o.data.set(new Uint8ClampedArray(fGt(e,i,r,n,s))),t.putImageData(o,0,0)}function fGt(t,e,i,r,n){const s=new Uint32Array(t*t),o="buffer"in e?e:new Float64Array(e),a="buffer"in i?new Uint32Array(i.buffer):new Uint32Array(new Uint8Array(i).buffer),l=a.length/(n-r);for(let c=0;c1?0:3/(Math.PI*i**2)*(1-r**2)**2}function mGt(t,e){return typeof t=="function"?t:t?typeof e=="string"?i=>-1*+i[t]:i=>+i[t]+e:()=>1}function gGt(t,e){return t!=null?typeof e=="string"?i=>-1*+i.readAttribute(t):i=>+i.readAttribute(t)+e:i=>1}var wxe;const Dze="esri.renderers.HeatmapRenderer",yGt=Oi.getLogger(Dze);function Fze(t){if(t!=null){const{maxDensity:e,minDensity:i,radius:r}=t;if(e!=null||i!=null||r!=null){const{blurRadius:n,maxPixelIntensity:s,minPixelIntensity:o,...a}=t;return a}}return t}let Dm=wxe=class extends UC{constructor(t){super(t),this.authoringInfo=null,this.colorStops=[new QW({ratio:0,color:new en("rgba(255, 140, 0, 0)")}),new QW({ratio:.75,color:new en("rgba(255, 140, 0, 1)")}),new QW({ratio:.9,color:new en("rgba(255, 0, 0, 1)")})],this.field=null,this.fieldOffset=0,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(t){return Fze(t)}get blurRadius(){return cGt(this.radius)}set blurRadius(t){const e=this.maxPixelIntensity,i=this.minPixelIntensity;this._set("radius",uGt(t)),this._warnAboutDeprecatedGaussianBlurProp("blurRadius","radius"),this._set("maxDensity",e*this._pixelIntensityToDensity),this._set("minDensity",i*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(t){this._set("maxDensity",t*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("maxPixelIntensity","maxDensity")}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(t){this._set("minDensity",t*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("minPixelIntensity","minDensity")}get _pixelIntensityToDensity(){return 24/(bxe**2*this.blurRadius**4)}_warnAboutDeprecatedGaussianBlurProp(t,e){this._warnedProps[t]||Mp(this).getDefaultOrigin()==="user"&&(this._warnedProps[t]=!0,V3(()=>{I_e(yGt,t,{replacement:`${String(e)} (suggested value: ${this._get(e)})`,version:"4.24"})}))}read(t,e){t=Fze(t),super.read(t,e)}getSymbol(){return new wd}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}async collectRequiredFields(t,e){const i=this.field,r=this.valueExpression;i&&typeof i=="string"&&await Xy(t,e,i),r&&typeof r=="string"&&await ev(t,e,r)}getAttributeHash(){return null}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new wxe({authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),colorStops:gi(this.colorStops),field:this.field,legendOptions:gi(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};E([N({type:HW,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],Dm.prototype,"authoringInfo",void 0),E([N({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],Dm.prototype,"blurRadius",null),E([N({type:[QW],json:{write:!0}})],Dm.prototype,"colorStops",void 0),E([N({type:String,json:{write:!0}})],Dm.prototype,"field",void 0),E([N({type:Number,json:{write:{overridePolicy:(t,e,i)=>({enabled:i==null})},origins:{"web-scene":{write:!1}}}})],Dm.prototype,"fieldOffset",void 0),E([N({type:T9,json:{write:!0}})],Dm.prototype,"legendOptions",void 0),E([N({type:Number,json:{write:!0}})],Dm.prototype,"maxDensity",void 0),E([N({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],Dm.prototype,"maxPixelIntensity",null),E([N({type:Number,json:{write:!0}})],Dm.prototype,"minDensity",void 0),E([N({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],Dm.prototype,"minPixelIntensity",null),E([N({type:Number,cast:Ga,json:{write:!0}})],Dm.prototype,"radius",void 0),E([N({type:Number,range:{min:0},json:{default:0,write:!0}})],Dm.prototype,"referenceScale",void 0),E([rn({heatmap:"heatmap"})],Dm.prototype,"type",void 0),E([N({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],Dm.prototype,"valueExpression",void 0),E([N({type:String})],Dm.prototype,"valueExpressionTitle",void 0),E([N({readOnly:!0})],Dm.prototype,"_pixelIntensityToDensity",null),Dm=wxe=E([dt(Dze)],Dm);const Lze=Dm;let a5=class extends _a(Ui){constructor(){super(...arguments),this.color=new en([0,0,0,0]),this.label=null,this.threshold=0}};E([N({type:en,json:{write:!0}})],a5.prototype,"color",void 0),E([N({type:String,json:{write:!0}})],a5.prototype,"label",void 0),E([N({type:Number,range:{min:0,max:1},json:{write:!0}})],a5.prototype,"threshold",void 0),a5=E([dt("esri.renderers.support.OthersCategory")],a5);let kse=class extends _a(Ui){constructor(){super(...arguments),this.title=null}};E([N({type:String,json:{write:!0}})],kse.prototype,"title",void 0),kse=E([dt("esri.renderers.support.PieChartLegendOptions")],kse);let L1=class extends SR(_a(UC)){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new en([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new a5,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart"}getSymbol(){return new wd({size:this.size?this.size/2+(this.outline?.width||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(ve)}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,i)=>e+i.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((e,i)=>e+JSON.stringify(i),"")}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i);for(const r of this.attributes)r.valueExpression&&await ev(e,i,r.valueExpression),r.field&&e.add(r.field)}};E([N({type:[Sze],json:{write:!0}})],L1.prototype,"attributes",void 0),E([N({type:sw,json:{default:null,write:!0}})],L1.prototype,"backgroundFillSymbol",void 0),E([N({type:en,json:{write:!0}})],L1.prototype,"defaultColor",void 0),E([N({type:String,json:{write:!0}})],L1.prototype,"defaultLabel",void 0),E([N({type:Number,range:{min:0,max:1},json:{write:!0}})],L1.prototype,"holePercentage",void 0),E([N({type:a5,json:{write:!0}})],L1.prototype,"othersCategory",void 0),E([N({type:kse,json:{write:!0}})],L1.prototype,"legendOptions",void 0),E([N({type:Mm,json:{default:null,write:!0}})],L1.prototype,"outline",void 0),E([N({type:Number,cast:Ga,json:{write:!0}})],L1.prototype,"size",void 0),E([rn({pieChart:"pie-chart"})],L1.prototype,"type",void 0),L1=E([dt("esri.renderers.PieChartRenderer")],L1);const vGt=L1;var xxe;let l5=xxe=class extends SR(UC){constructor(t){super(t),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(t,e){await Promise.all([this.collectSymbolFields(t,e),this.collectVVRequiredFields(t,e)])}async collectSymbolFields(t,e){await Promise.all(this.getSymbols().map(i=>i.collectRequiredFields(t,e)))}getSymbol(t,e){return this.symbol}async getSymbolAsync(t,e){return this.symbol}getSymbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((t,e)=>t+e.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((t,e)=>t+JSON.stringify(e),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new xxe({description:this.description,label:this.label,symbol:this.symbol&&this.symbol.clone(),visualVariables:gi(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}};E([N({type:String,json:{write:!0}})],l5.prototype,"description",void 0),E([N({type:String,json:{write:!0}})],l5.prototype,"label",void 0),E([N(x9)],l5.prototype,"symbol",void 0),E([rn({simple:"simple"})],l5.prototype,"type",void 0),l5=xxe=E([dt("esri.renderers.SimpleRenderer")],l5);const i_=l5;function sr(t,e,i={}){return Sxe(t,e,i,Nze)}function Yg(t,e,i={}){return Sxe(t,e,i,kze)}function Sxe(t,e,i={},r){let n=null;const s=i.once?(o,a)=>{r(o)&&(Uc(n),e(o,a))}:(o,a)=>{r(o)&&e(o,a)};if(n=Hkt(t,s,i.sync,i.equals),i.initial){const o=t();s(o,o)}return n}function Wu(t,e,i,r={}){let n=null,s=null,o=null;function a(){n&&s&&(s.remove(),r.onListenerRemove?.(n),n=null,s=null)}function l(h){r.once&&r.once&&Uc(o),i(h)}const c=sr(t,(h,p)=>{a(),Mre(h)&&(n=h,s=ZI(h,e,l),r.onListenerAdd?.(h))},{sync:r.sync,initial:!0});return o=XI(()=>{c.remove(),a()}),o}function N1(t,e){return _Gt(t,kze,e)}function _Gt(t,e,i){if(Im(i))return Promise.reject(Sc());const r=t();if(e?.(r))return Promise.resolve(r);let n=null;function s(){n=Uc(n)}return new Promise((o,a)=>{n=R8([ap(i,()=>{s(),a(Sc())}),Sxe(t,l=>{s(),o(l)},{sync:!1,once:!0},e??Nze)])})}function Nze(t){return!0}function kze(t){return!!t}const qu={sync:!0},Yo={initial:!0},Wh={sync:!0,initial:!0},bGt=["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"];function Cxe(t){return t instanceof Tn}function $ze(t){return t instanceof Sr?Object.keys(t.items):Cxe(t)?Mp(t).keys():t?Object.keys(t):[]}function $se(t,e){return t instanceof Sr?t.items[e]:t[e]}function wGt(t,e){return!(!Array.isArray(t)||!Array.isArray(e))&&t.length!==e.length}function eq(t){return t?t.declaredClass:null}function Bze(t,e){const i=t.diff;if(i&&typeof i=="function")return i(t,e);const r=$ze(t),n=$ze(e);if(r.length===0&&n.length===0)return;if(!r.length||!n.length||wGt(t,e))return{type:"complete",oldValue:t,newValue:e};const s=n.filter(p=>!r.includes(p)),o=r.filter(p=>!n.includes(p)),a=r.filter(p=>n.includes(p)&&$se(t,p)!==$se(e,p)).concat(s,o).sort(),l=eq(t);if(l&&bGt.includes(l)&&a.length)return{type:"complete",oldValue:t,newValue:e};let c;const h=Cxe(t)&&Cxe(e);for(const p of a){const y=$se(t,p),v=$se(e,p);let x;if((h||typeof y!="function"&&typeof v!="function")&&y!==v&&(y!=null||v!=null)){if(i&&i[p]&&typeof i[p]=="function")x=i[p](y,v);else if(y instanceof Date&&v instanceof Date){if(y.getTime()===v.getTime())continue;x={type:"complete",oldValue:y,newValue:v}}else x=typeof y=="object"&&typeof v=="object"&&eq(y)===eq(v)?Bze(y,v):{type:"complete",oldValue:y,newValue:v};ve(x)&&(ve(c)?c.diff[p]=x:c={type:"partial",diff:{[p]:x}})}}return c}function yA(t,e){if(lt(t))return!1;const i=e.split(".");let r=t;for(const n of i){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 xGt(t,e){for(const i of e)if(yA(t,i))return!0;return!1}function h2(t,e){if(!(typeof t=="function"||typeof e=="function"||lt(t)&<(e)))return lt(t)||lt(e)||typeof t=="object"&&typeof e=="object"&&eq(t)!==eq(e)?{type:"complete",oldValue:t,newValue:e}:Bze(t,e)}let E9=class extends _a(Ui){constructor(e){super(e),this.value=null,this.value2=null,this.value3=null}};E([N(Mse)],E9.prototype,"value",void 0),E([N(Mse)],E9.prototype,"value2",void 0),E([N(Mse)],E9.prototype,"value3",void 0),E9=E([dt("esri.renderers.support.UniqueValue")],E9);const I9=E9;let ER=class extends _a(Ui){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.values=null}castValues(e){if(e==null)return null;const i=typeof(e=Array.isArray(e)?e:[e])[0];return i==="string"||i==="number"?e.map(r=>new I9({value:r})):i==="object"?e[0]instanceof I9?e:e.map(r=>new I9(r)):null}};E([N({type:String,json:{write:!0}})],ER.prototype,"description",void 0),E([N({type:String,json:{write:!0}})],ER.prototype,"label",void 0),E([N(x9)],ER.prototype,"symbol",void 0),E([N({type:[I9],json:{type:[[String]],read:{reader:t=>t?t.map(e=>new I9({value:e[0],value2:e[1],value3:e[2]})):null},write:{writer:(t,e)=>{const i=[];for(const r of t){const n=[r.value,r.value2,r.value3].filter(ve).map(s=>s.toString());i.push(n)}e.values=i}}}})],ER.prototype,"values",void 0),E([ho("values")],ER.prototype,"castValues",null),ER=E([dt("esri.renderers.support.UniqueValueClass")],ER);const Vze=ER;let tq=class extends _a(Ui){constructor(e){super(e),this.heading=null,this.classes=null}};E([N({type:String,json:{write:!0}})],tq.prototype,"heading",void 0),E([N({type:[Vze],json:{write:!0}})],tq.prototype,"classes",void 0),tq=E([dt("esri.renderers.support.UniqueValueGroup")],tq);const Txe=tq;var Exe;let u5=Exe=class extends Ui{constructor(t){super(t),this.description=null,this.label=null,this.symbol=null,this.value=null}clone(){return new Exe({value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const t=JSON.stringify(this.symbol&&this.symbol.toJSON());return`${this.value}.${t}`}};E([N({type:String,json:{write:!0}})],u5.prototype,"description",void 0),E([N({type:String,json:{write:!0}})],u5.prototype,"label",void 0),E([N(x9)],u5.prototype,"symbol",void 0),E([N(Mse)],u5.prototype,"value",void 0),u5=Exe=E([dt("esri.renderers.support.UniqueValueInfo")],u5);const c5=u5,SGt=()=>!!Hi("enable-feature:force-wosr"),CGt=()=>!!Hi("enable-feature:SceneLayer-editing");let Ixe={};async function TGt(t,e){try{return{data:(await iq(t,e)).data,baseUrl:jH(t),styleUrl:t}}catch(i){return Ya(i),null}}function EGt(t,e,i){const r=ve(e.portal)?e.portal:Cc.getDefault();let n;const s=`${r.url} - ${r.user&&r.user.username} - ${t}`;return Ixe[s]||(Ixe[s]=IGt(t,r,i).then(o=>(n=o,o.fetchData())).then(o=>({data:o,baseUrl:n.itemUrl??"",styleName:t}))),Ixe[s]}function IGt(t,e,i){return e.load(i).then(()=>{const r=new rA({disableExtraQuery:!0,query:`owner:${Gze} AND type:${Uze} AND typekeywords:"${t}"`});return e.queryItems(r,i)}).then(({results:r})=>{let n=null;const s=t.toLowerCase();if(r&&Array.isArray(r)){for(const o of r)if(o.typeKeywords?.some(l=>l.toLowerCase()===s)&&o.type===Uze&&o.owner===Gze){n=o;break}}if(!n)throw new st("symbolstyleutils:style-not-found",`The style '${t}' could not be found`,{styleName:t});return n.load(i)})}function Axe(t,e,i){return t&&ve(t.styleUrl)?TGt(t.styleUrl,i):t&&ve(t.styleName)?EGt(t.styleName,e,i):Promise.reject(new st("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function Bse(t){return t===null||t.type==="CIMSymbolReference"?t:{type:"CIMSymbolReference",symbol:t}}function jze(t,e){if(e==="cimRef")return t.cimRef;if(t.formatInfos&&!SGt()){for(const i of t.formatInfos)if(i.type==="gltf")return i.href}return t.webRef}function iq(t,e){const i={responseType:"json",query:{f:"json"},...e};return ur(Uy(t),i)}const Gze="esri_en",Uze="Style",zze="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json";var rq;const Hze="esri.renderers.UniqueValueRenderer",IR=Oi.getLogger(Hze),Wze="uvInfos-watcher",qze="uvGroups-watcher",AGt=",",PGt=fd(c5);function OGt(t){const{field1:e,field2:i,field3:r,fieldDelimiter:n,uniqueValueInfos:s,valueExpression:o}=t,a=!(!e||!i);return[{classes:(s??[]).map(l=>{const{symbol:c,label:h,value:p,description:y}=l,[v,x,I]=a?p?.toString()?.split(n||"")||[]:[p],P=[];return(e||o)&&P.push(v),i&&P.push(x),r&&P.push(I),{symbol:c,label:h,values:[P],description:y}})}]}let Sd=rq=class extends SR(UC){constructor(t){super(t),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,i){if(!e&&!i)return;if(!e||!i)return{type:"complete",oldValue:e,newValue:i};let r=!1;const n={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let s=0;sa.value===i[s].value);o?h2(o,i[s])?(n.changed.push({type:"complete",oldValue:o,newValue:i[s]}),r=!0):n.unchanged.push({oldValue:o,newValue:i[s]}):(n.added.push(i[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(t){this._set("field",t),this._updateFieldDelimiter(),this._updateUniqueValues()}castField(t){return t==null||typeof t=="function"?t:MH(t)}writeField(t,e,i,r){typeof t=="string"?e[i]=t:r&&r.messages?r.messages.push(new st("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):IR.error(".field: cannot write field to JSON since it's not a string value")}set field2(t){this._set("field2",t),this._updateFieldDelimiter(),this._updateUniqueValues()}set field3(t){this._set("field3",t),this._updateUniqueValues()}set valueExpression(t){this._set("valueExpression",t),this._updateUniqueValues()}set defaultSymbol(t){this._isDefaultSymbolDerived=!1,this._set("defaultSymbol",t)}set fieldDelimiter(t){this._set("fieldDelimiter",t),this._updateUniqueValues()}readPortal(t,e,i){return i.portal||Cc.getDefault()}readStyleOrigin(t,e,i){if(e.styleName)return Object.freeze({styleName:e.styleName});if(e.styleUrl){const r=rw(e.styleUrl,i);return Object.freeze({styleUrl:r})}}writeStyleOrigin(t,e,i,r){t.styleName?e.styleName=t.styleName:t.styleUrl&&(e.styleUrl=o2(t.styleUrl,r))}set uniqueValueGroups(t){this.styleOrigin?IR.error("#uniqueValueGroups=","Cannot modify unique value groups of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueGroups",t),this._updateInfosFromGroups(),this._isInfosSource=!1,this._watchUniqueValueGroups())}set uniqueValueInfos(t){this.styleOrigin?IR.error("#uniqueValueInfos=","Cannot modify unique value infos of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueInfos",t),this._updateValueInfoMap(),this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos())}addUniqueValueInfo(t,e){if(this.styleOrigin)return void IR.error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let i;i=typeof t=="object"?PGt(t):new c5({value:t,symbol:X7e(e)}),this.uniqueValueInfos?.push(i),this._valueInfoMap[i.value]=i,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(t){if(this.styleOrigin)return void IR.error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const e=this.uniqueValueInfos;if(e){for(let i=0;it+e.getAttributeHash(),"")}getMeshHash(){const t=JSON.stringify(this.backgroundFillSymbol),e=JSON.stringify(this.defaultSymbol),i=this.uniqueValueInfos?.reduce((r,n)=>r+n.getMeshHash(),"");return`${t}.${e}.${i}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const t=new rq({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:gi(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:gi(this.visualVariables),legendOptions:gi(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),backgroundFillSymbol:gi(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(t._isDefaultSymbolDerived=!0),t._set("portal",this.portal);const e=gi(this.uniqueValueInfos),i=gi(this.uniqueValueGroups);return this.styleOrigin&&(t._set("styleOrigin",Object.freeze(gi(this.styleOrigin))),Object.freeze(e),Object.freeze(i)),t._set("uniqueValueInfos",e),t._updateValueInfoMap(),t._set("uniqueValueGroups",i),t._isInfosSource=this._isInfosSource,t._watchUniqueValueInfosAndGroups(),t}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}async collectRequiredFields(t,e){const i=[this.collectVVRequiredFields(t,e),this.collectSymbolFields(t,e)];await Promise.all(i)}async collectSymbolFields(t,e){const i=[...this.getSymbols().map(r=>r.collectRequiredFields(t,e)),ev(t,e,this.valueExpression)];Xy(t,e,this.field),Xy(t,e,this.field2),Xy(t,e,this.field3),await Promise.all(i)}populateFromStyle(){return Axe(this.styleOrigin,{portal:this.portal}).then(t=>{const e=[];return this._valueInfoMap={},t&&t.data&&Array.isArray(t.data.items)&&t.data.items.forEach(i=>{const r=new QL({styleUrl:t.styleUrl,styleName:t.styleName,portal:this.portal,name:i.name});this.defaultSymbol||i.name!==t.data.defaultItem||(this.defaultSymbol=r,this._isDefaultSymbolDerived=!0);const n=new c5({value:i.name,symbol:r});e.push(n),this._valueInfoMap[i.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",AGt)}_updateUniqueValues(){this._isInfosSource!=null&&(this._isInfosSource?this._updateGroupsFromInfos():this._updateInfosFromGroups())}_updateValueInfoMap(){this._valueInfoMap={};const{uniqueValueInfos:t}=this;if(t)for(const e of t)this._valueInfoMap[e.value+""]=e}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(Wze);const{uniqueValueInfos:t}=this;if(t){const e=[];for(const i of t)e.push(sr(()=>({symbol:i.symbol,value:i.value,label:i.label,description:i.description}),(r,n)=>{r!==n&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(e,Wze)}}_watchUniqueValueGroups(){this.removeHandles(qze);const{uniqueValueGroups:t}=this;if(t){const e=[];for(const i of t){e.push(sr(()=>({classes:i.classes}),(r,n)=>{r!==n&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const r of i.classes??[])e.push(sr(()=>({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,qze)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const t=[],{field:e,field2:i,field3:r,fieldDelimiter:n,uniqueValueGroups:s,valueExpression:o}=this;if(!e&&!o)return this._set("uniqueValueInfos",t),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const a=!(!e||!i);for(const l of s)for(const c of l.classes??[]){const{symbol:h,label:p,values:y,description:v}=c;for(const x of y??[]){const{value:I,value2:P,value3:F}=x,k=[I];i&&k.push(P),r&&k.push(F);const j=a?k.join(n||""):k[0];t.push(new c5({symbol:h,label:p,value:j,description:v}))}}this._set("uniqueValueInfos",t),this._updateValueInfoMap(),this._watchUniqueValueInfos()}_updateGroupsFromInfos(t=!1){if(!this.uniqueValueInfos)return this._set("uniqueValueGroups",null),void this._watchUniqueValueGroups();const{field:e,field2:i,valueExpression:r,fieldDelimiter:n,uniqueValueInfos:s}=this;if(!e&&!r||!s.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const o=!(!e||!i),a=s.map(c=>{const{symbol:h,label:p,value:y,description:v}=c,[x,I,P]=o?y?.toString()?.split(n||"")||[]:[y];return new Vze({symbol:h,label:p,description:v,values:[new I9({value:x,value2:I,value3:P})]})}),l=[new Txe({classes:a})];t&&Object.freeze(l),this._set("uniqueValueGroups",l),this._watchUniqueValueGroups()}_getUniqueValueInfo(t,e){return this.valueExpression?this._getUnqiueValueInfoForExpression(t,e):this._getUnqiueValueInfoForFields(t)}_getUnqiueValueInfoForExpression(t,e){const{viewingMode:i,scale:r,spatialReference:n,arcade:s}=zu(e,{});let o=this._cache.compiledFunc;const a=s.arcadeUtils;if(!o){const c=a.createSyntaxTree(this.valueExpression);o=a.createFunction(c),this._cache.compiledFunc=o}const l=a.executeFunction(o,a.createExecContext(t,a.getViewInfo({viewingMode:i,scale:r,spatialReference:n})));return this._valueInfoMap[l+""]}_getUnqiueValueInfoForFields(t){const e=this.field,i=t.attributes;let r;if(typeof e!="function"&&this.field2){const n=this.field2,s=this.field3,o=[];e&&o.push(i[e]),n&&o.push(i[n]),s&&o.push(i[s]),r=o.join(this.fieldDelimiter||"")}else typeof e=="function"?r=e(t):e&&(r=i[e]);return this._valueInfoMap[r+""]}static fromPortalStyle(t,e){const i=new rq(e&&e.properties);i._set("styleOrigin",Object.freeze({styleName:t})),i._set("portal",e&&e.portal||Cc.getDefault());const r=i.populateFromStyle();return r.catch(n=>{IR.error(`#fromPortalStyle('${t}'[, ...])`,"Failed to create unique value renderer from style name",n)}),r}static fromStyleUrl(t,e){const i=new rq(e&&e.properties);i._set("styleOrigin",Object.freeze({styleUrl:t}));const r=i.populateFromStyle();return r.catch(n=>{IR.error(`#fromStyleUrl('${t}'[, ...])`,"Failed to create unique value renderer from style URL",n)}),r}};E([N({readOnly:!0})],Sd.prototype,"_cache",null),E([rn({uniqueValue:"unique-value"})],Sd.prototype,"type",void 0),E([N(_ze)],Sd.prototype,"backgroundFillSymbol",void 0),E([N({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],Sd.prototype,"field",null),E([ho("field")],Sd.prototype,"castField",null),E([Cr("field")],Sd.prototype,"writeField",null),E([N({type:String,value:null,json:{write:!0}})],Sd.prototype,"field2",null),E([N({type:String,value:null,json:{write:!0}})],Sd.prototype,"field3",null),E([N({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],Sd.prototype,"orderByClassesEnabled",void 0),E([N({type:String,value:null,json:{write:!0}})],Sd.prototype,"valueExpression",null),E([N({type:String,json:{write:!0}})],Sd.prototype,"valueExpressionTitle",void 0),E([N({type:zC,json:{write:!0}})],Sd.prototype,"legendOptions",void 0),E([N({type:String,json:{write:!0}})],Sd.prototype,"defaultLabel",void 0),E([N(SVe({...x9},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],Sd.prototype,"defaultSymbol",null),E([N({type:String,value:null,json:{write:!0}})],Sd.prototype,"fieldDelimiter",null),E([N({type:Cc,readOnly:!0})],Sd.prototype,"portal",void 0),E([Vi("portal",["styleName"])],Sd.prototype,"readPortal",null),E([N({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],Sd.prototype,"styleOrigin",void 0),E([Vi("styleOrigin",["styleName","styleUrl"])],Sd.prototype,"readStyleOrigin",null),E([Cr("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],Sd.prototype,"writeStyleOrigin",null),E([N({type:[Txe],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(t,e,i)=>(e.uniqueValueGroups||OGt(e)).map(r=>Txe.fromJSON(r,i))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],Sd.prototype,"uniqueValueGroups",null),E([N({type:[c5],json:{read:!1,write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],Sd.prototype,"uniqueValueInfos",null),Sd=rq=E([dt(Hze)],Sd);const WC=Sd,vA={key:"type",base:UC,typeMap:{heatmap:Lze,simple:i_,"unique-value":WC,"class-breaks":o5,"dot-density":eGt,dictionary:Zjt,"pie-chart":vGt},errorContext:"renderer"},AR={key:"type",base:UC,typeMap:{simple:i_,"unique-value":WC,"class-breaks":o5,heatmap:Lze},errorContext:"renderer"};function PR(t,e){return h5(t,null,e)}const RGt=xC({types:vA});function h5(t,e,i){return t?t&&(t.styleName||t.styleUrl)&&t.type!=="uniqueValue"?(i&&i.messages&&i.messages.push(new Am("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+t.type+"'",{definition:t,context:i})),null):RGt(t,e,i):null}let MGt=class jLt{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(S_e),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const i=new jLt,r=this._originStores[Yn.DEFAULTS];r&&r.forEach((n,s)=>{i.set(s,gi(n),Yn.DEFAULTS)});for(let n=Yn.SERVICE;n{e&&e.has(a)||i.set(a,gi(o),n)})}return i}get(e,i){const r=i===void 0?this._values:this._originStores[i];return r?r.get(e):void 0}keys(e){const i=e==null?this._values:this._originStores[e];return i?[...i.keys()]:[]}set(e,i,r=Yn.USER){let n=this._originStores[r];if(n||(n=new Map,this._originStores[r]=n),n.set(e,i),!this._values.has(e)||this._propertyOriginMap.get(e)<=r){const s=this._values.get(e);return this._values.set(e,i),this._propertyOriginMap.set(e,r),s!==i}return!1}delete(e,i=Yn.USER){const r=this._originStores[i];if(!r)return;const n=r.get(e);if(r.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===i){this._values.delete(e);for(let s=i-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,i){const r=i===void 0?this._values:this._originStores[i];return!!r&&r.has(e)}revert(e,i){for(;i>0&&!this.has(e,i);)--i;const r=this._originStores[i],n=r&&r.get(e),s=this._values.get(e);return this._values.set(e,n),this._propertyOriginMap.set(e,i),s!==n}originOf(e){return this._propertyOriginMap.get(e)||Yn.DEFAULTS}forEach(e){this._values.forEach(e)}};const Yze=t=>{let e=class extends t{constructor(...i){super(...i);const r=Mp(this),n=r.store,s=new MGt;r.store=s,Cje(r,n,s)}read(i,r){Eje(this,i,r)}getAtOrigin(i,r){const n=Pxe(this),s=Ug(r);if(typeof i=="string")return n.get(i,s);const o={};return i.forEach(a=>{o[a]=n.get(a,s)}),o}originOf(i){return SH(this.originIdOf(i))}originIdOf(i){return Pxe(this).originOf(i)}revert(i,r){const n=Pxe(this),s=Ug(r),o=Mp(this);let a;a=typeof i=="string"?i==="*"?n.keys(s):[i]:i,a.forEach(l=>{o.invalidate(l),n.revert(l,s),o.commit(l)})}};return e=E([dt("esri.core.ReadOnlyMultiOriginJSONSupport")],e),e};function Pxe(t){return Mp(t).store}let Xze=class extends Yze(Tn){};Xze=E([dt("esri.core.ReadOnlyMultiOriginJSONSupport")],Xze);const DGt=t=>{let e=class extends t{constructor(...i){super(...i)}clear(i,r="user"){return Oxe(this).delete(i,Ug(r))}write(i={},r){return Pje(this,i=i||{},r),i}setAtOrigin(i,r,n){Mp(this).setAtOrigin(i,r,Ug(n))}removeOrigin(i){const r=Oxe(this),n=Ug(i),s=r.keys(n);for(const o of s)r.originOf(o)===n&&r.set(o,r.get(o,n),Yn.USER)}updateOrigin(i,r){const n=Oxe(this),s=Ug(r),o=this.get(i);for(let a=s+1;a{let e=class extends DGt(Yze(t)){constructor(...i){super(...i)}};return e=E([dt("esri.core.MultiOriginJSONSupport")],e),e};let Vse=class extends Yu(Tn){};Vse=E([dt("esri.core.MultiOriginJSONSupport")],Vse);async function FGt(t,e){const{WhereClause:i}=await Promise.resolve().then(()=>jde);return i.create(t,e)}function OR(t,e){return ve(t)?ve(e)?`(${t}) AND (${e})`:t:e}var Rxe;let d5=Rxe=class extends Ui{constructor(t){super(t),this.expression=null,this.name=null,this.returnType="boolean",this.title=null}clone(){return new Rxe({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};E([N({type:String,json:{write:!0}})],d5.prototype,"expression",void 0),E([N({type:String,json:{write:!0}})],d5.prototype,"name",void 0),E([N({type:["boolean","date","number","string"],json:{write:!0}})],d5.prototype,"returnType",void 0),E([N({type:String,json:{write:!0}})],d5.prototype,"title",void 0),d5=Rxe=E([dt("esri.form.ExpressionInfo")],d5);const LGt=d5;let p5=class extends Ui{constructor(e){super(e),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};E([N({type:String,json:{write:!0}})],p5.prototype,"description",void 0),E([N({type:String,json:{write:!0}})],p5.prototype,"label",void 0),E([N()],p5.prototype,"type",void 0),E([N({type:String,json:{write:!0}})],p5.prototype,"visibilityExpression",void 0),p5=E([dt("esri.form.elements.Element")],p5);const A9=p5;var Mxe;let jse=Mxe=class extends Ui{constructor(t){super(t),this.type=null}clone(){return new Mxe({type:this.type})}};E([N({type:["attachment","audio","document","image","signature","video"],json:{write:!0}})],jse.prototype,"type",void 0),jse=Mxe=E([dt("esri.form.elements.inputs.AttachmentInput")],jse);const NGt=jse;var Dxe;let f5=Dxe=class extends A9{constructor(t){super(t),this.attachmentKeyword=null,this.editable=!0,this.input=null,this.type="attachment"}clone(){return new Dxe({attachmentKeyword:this.attachmentKeyword,description:this.description,editable:this.editable,input:this.input,label:this.label,visibilityExpression:this.visibilityExpression})}};E([N({type:String,json:{write:!0}})],f5.prototype,"attachmentKeyword",void 0),E([N({type:Boolean,json:{write:!0}})],f5.prototype,"editable",void 0),E([N({type:NGt,json:{read:{source:"inputType"},write:{target:"inputType"}}})],f5.prototype,"input",void 0),E([N({type:["attachment"],json:{read:!1,write:!0}})],f5.prototype,"type",void 0),f5=Dxe=E([dt("esri.form.elements.AttachmentElement")],f5);const Kze=f5;let Gse=class extends Ui{constructor(e){super(e),this.type=null}};E([N()],Gse.prototype,"type",void 0),Gse=E([dt("esri.form.elements.inputs.Input")],Gse);const P9=Gse;let nq=class extends P9{constructor(e){super(e),this.maxLength=null,this.minLength=0}};E([N({type:Number,json:{write:!0}})],nq.prototype,"maxLength",void 0),E([N({type:Number,json:{write:!0}})],nq.prototype,"minLength",void 0),nq=E([dt("esri.form.elements.inputs.TextInput")],nq);const Fxe=nq;var Lxe;let Use=Lxe=class extends Fxe{constructor(t){super(t),this.type="barcode-scanner"}clone(){return new Lxe({maxLength:this.maxLength,minLength:this.minLength})}};E([N({type:["barcode-scanner"],json:{read:!1,write:!0}})],Use.prototype,"type",void 0),Use=Lxe=E([dt("esri.form.elements.inputs.BarcodeScannerInput")],Use);const kGt=Use;var Nxe;let O9=Nxe=class extends P9{constructor(t){super(t),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="combo-box"}clone(){return new Nxe({showNoValueOption:this.showNoValueOption,noValueOptionLabel:this.noValueOptionLabel})}};E([N({type:String,json:{write:!0}})],O9.prototype,"noValueOptionLabel",void 0),E([N({type:Boolean,json:{write:!0}})],O9.prototype,"showNoValueOption",void 0),E([N({type:["combo-box"],json:{read:!1,write:!0}})],O9.prototype,"type",void 0),O9=Nxe=E([dt("esri.form.elements.inputs.ComboBoxInput")],O9);const $Gt=O9;var kxe;function Jze(t){return t!=null?new Date(t):null}function Zze(t){return t?t.getTime():null}let d2=kxe=class extends P9{constructor(t){super(t),this.includeTime=!1,this.max=null,this.min=null,this.type="datetime-picker"}readMax(t,e){return Jze(e.max)}writeMax(t,e){e.max=Zze(t)}readMin(t,e){return Jze(e.min)}writeMin(t,e){e.min=Zze(t)}clone(){return new kxe({includeTime:this.includeTime,max:this.max,min:this.min})}};E([N({type:Boolean,json:{write:!0}})],d2.prototype,"includeTime",void 0),E([N({type:Date,json:{type:Number,write:!0}})],d2.prototype,"max",void 0),E([Vi("max")],d2.prototype,"readMax",null),E([Cr("max")],d2.prototype,"writeMax",null),E([N({type:Date,json:{type:Number,write:!0}})],d2.prototype,"min",void 0),E([Vi("min")],d2.prototype,"readMin",null),E([Cr("min")],d2.prototype,"writeMin",null),E([N({type:["datetime-picker"],json:{read:!1,write:!0}})],d2.prototype,"type",void 0),d2=kxe=E([dt("esri.form.elements.inputs.DateTimePickerInput")],d2);const BGt=d2;var $xe;let R9=$xe=class extends P9{constructor(t){super(t),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="radio-buttons"}clone(){return new $xe({noValueOptionLabel:this.noValueOptionLabel,showNoValueOption:this.showNoValueOption})}};E([N({type:String,json:{write:!0}})],R9.prototype,"noValueOptionLabel",void 0),E([N({type:Boolean,json:{write:!0}})],R9.prototype,"showNoValueOption",void 0),E([N({type:["radio-buttons"],json:{read:!1,write:!0}})],R9.prototype,"type",void 0),R9=$xe=E([dt("esri.form.elements.inputs.RadioButtonsInput")],R9);const VGt=R9;var Bxe;let M9=Bxe=class extends P9{constructor(t){super(t),this.offValue=null,this.onValue=null,this.type="switch"}clone(){return new Bxe({offValue:this.offValue,onValue:this.onValue})}};E([N({type:[String,Number],json:{write:!0}})],M9.prototype,"offValue",void 0),E([N({type:[String,Number],json:{write:!0}})],M9.prototype,"onValue",void 0),E([N({type:["switch"],json:{read:!1,write:!0}})],M9.prototype,"type",void 0),M9=Bxe=E([dt("esri.form.elements.inputs.SwitchInput")],M9);const jGt=M9;var Vxe;let zse=Vxe=class extends Fxe{constructor(t){super(t),this.type="text-area"}clone(){return new Vxe({maxLength:this.maxLength,minLength:this.minLength})}};E([N({type:["text-area"],json:{read:!1,write:!0}})],zse.prototype,"type",void 0),zse=Vxe=E([dt("esri.form.elements.inputs.TextAreaInput")],zse);const GGt=zse;var jxe;let Hse=jxe=class extends Fxe{constructor(t){super(t),this.type="text-box"}clone(){return new jxe({maxLength:this.maxLength,minLength:this.minLength})}};E([N({type:["text-box"],json:{read:!1,write:!0}})],Hse.prototype,"type",void 0),Hse=jxe=E([dt("esri.form.elements.inputs.TextBoxInput")],Hse);const UGt={base:P9,key:"type",typeMap:{"barcode-scanner":kGt,"combo-box":$Gt,"datetime-picker":BGt,"radio-buttons":VGt,switch:jGt,"text-area":GGt,"text-box":Hse}};var Gxe;let sq=Gxe=class extends Ui{constructor(t){super(t),this.name=null,this.code=null}clone(){return new Gxe({name:this.name,code:this.code})}};E([N({type:String,json:{write:!0}})],sq.prototype,"name",void 0),E([N({type:[String,Number],json:{write:!0}})],sq.prototype,"code",void 0),sq=Gxe=E([dt("esri.layers.support.CodedValue")],sq);const zGt=new Ks({inherited:"inherited",codedValue:"coded-value",range:"range"});let oq=class extends Ui{constructor(e){super(e),this.name=null,this.type=null}};E([N({type:String,json:{write:!0}})],oq.prototype,"name",void 0),E([rn(zGt)],oq.prototype,"type",void 0),oq=E([dt("esri.layers.support.Domain")],oq);const Wse=oq;var Uxe;let aq=Uxe=class extends Wse{constructor(t){super(t),this.codedValues=null,this.type="coded-value"}getName(t){let e=null;if(this.codedValues){const i=String(t);this.codedValues.some(r=>(String(r.code)===i&&(e=r.name),!!e))}return e}clone(){return new Uxe({codedValues:gi(this.codedValues),name:this.name})}};E([N({type:[sq],json:{write:!0}})],aq.prototype,"codedValues",void 0),E([rn({codedValue:"coded-value"})],aq.prototype,"type",void 0),aq=Uxe=E([dt("esri.layers.support.CodedValueDomain")],aq);const Qze=aq;var zxe;let qse=zxe=class extends Wse{constructor(t){super(t),this.type="inherited"}clone(){return new zxe}};E([rn({inherited:"inherited"})],qse.prototype,"type",void 0),qse=zxe=E([dt("esri.layers.support.InheritedDomain")],qse);const eHe=qse;var Hxe;let D9=Hxe=class extends Wse{constructor(t){super(t),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new Hxe({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};E([N({type:Number,json:{type:[Number],read:{source:"range",reader:(t,e)=>e.range&&e.range[1]},write:{enabled:!1,overridePolicy(){return{enabled:this.maxValue!=null&&this.minValue==null}},target:"range",writer(t,e,i){e[i]=[this.minValue||0,t]}}}})],D9.prototype,"maxValue",void 0),E([N({type:Number,json:{type:[Number],read:{source:"range",reader:(t,e)=>e.range&&e.range[0]},write:{target:"range",writer(t,e,i){e[i]=[t,this.maxValue||0]}}}})],D9.prototype,"minValue",void 0),E([rn({range:"range"})],D9.prototype,"type",void 0),D9=Hxe=E([dt("esri.layers.support.RangeDomain")],D9);const tHe=D9,iHe={key:"type",base:Wse,typeMap:{range:tHe,"coded-value":Qze,inherited:eHe}};function Yse(t){if(!t||!t.type)return null;switch(t.type){case"range":return tHe.fromJSON(t);case"codedValue":return Qze.fromJSON(t);case"inherited":return eHe.fromJSON(t)}return null}var Wxe;const rHe="esri.form.elements.FieldElement",nHe=Oi.getLogger(rHe);let ow=Wxe=class extends A9{constructor(t){super(t),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 I_e(nHe,"editable",{replacement:"editableExpression",version:"4.26",warnOnce:!0}),this._get("editable")??!0}set editable(t){I_e(nHe,"editable",{replacement:"editableExpression",version:"4.26",warnOnce:!0}),this._set("editable",t)}clone(){return new Wxe({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})}};E([N({types:iHe,json:{read:{reader:Yse},write:!0}})],ow.prototype,"domain",void 0),E([N({type:Boolean,json:{write:!0}})],ow.prototype,"editable",null),E([N({type:String,json:{write:!0}})],ow.prototype,"editableExpression",void 0),E([N({type:String,json:{write:!0}})],ow.prototype,"fieldName",void 0),E([N({type:String,json:{write:!0}})],ow.prototype,"hint",void 0),E([N({types:UGt,json:{read:{source:"inputType"},write:{target:"inputType"}}})],ow.prototype,"input",void 0),E([N({type:String,json:{write:!0}})],ow.prototype,"requiredExpression",void 0),E([N({type:String,json:{read:!1,write:!0}})],ow.prototype,"type",void 0),E([N({type:String,json:{write:!0}})],ow.prototype,"valueExpression",void 0),ow=Wxe=E([dt(rHe)],ow);const sHe=ow;var qxe;let _A=qxe=class extends A9{constructor(t){super(t),this.displayCount=null,this.displayType="list",this.editable=!0,this.orderByFields=null,this.relationshipId=null,this.type="relationship"}clone(){return new qxe({description:this.description,displayCount:this.displayCount,displayType:this.displayType,editable:this.editable,label:this.label,orderByFields:gi(this.orderByFields),relationshipId:this.relationshipId,visibilityExpression:this.visibilityExpression})}};E([N({type:Number,json:{write:!0}})],_A.prototype,"displayCount",void 0),E([N({type:["list"],json:{write:!0}})],_A.prototype,"displayType",void 0),E([N({type:Boolean,json:{write:!0}})],_A.prototype,"editable",void 0),E([N({type:[Lbe],json:{write:!0}})],_A.prototype,"orderByFields",void 0),E([N({type:Number,json:{write:!0}})],_A.prototype,"relationshipId",void 0),E([N({type:["relationship"],json:{read:!1,write:!0}})],_A.prototype,"type",void 0),_A=qxe=E([dt("esri.form.elements.RelationshipElement")],_A);const oHe=_A;function aHe(t){return{typesWithGroup:{base:A9,key:"type",typeMap:{attachment:Kze,field:sHe,group:t,relationship:oHe}},typesWithoutGroup:{base:A9,key:"type",typeMap:{attachment:Kze,field:sHe,relationship:oHe}}}}function lHe(t,e,i=!0){if(!t)return null;const r=i?e.typesWithGroup.typeMap:e.typesWithoutGroup.typeMap;return t.filter(n=>r[n.type]).map(n=>r[n.type].fromJSON(n))}function uHe(t,e,i=!0){if(!t)return null;const r=i?e.typesWithGroup.typeMap:e.typesWithoutGroup.typeMap;return t.filter(n=>r[n.type]).map(n=>n.toJSON())}function cHe(t,e,i=!0){return t?t.map(r=>wC(i?e.typesWithGroup:e.typesWithoutGroup,r)):null}var Yxe;let qC=Yxe=class extends A9{constructor(t){super(t),this.elements=null,this.initialState="expanded",this.type="group"}castElements(t){return cHe(t,Xxe,!1)}readElements(t,e){return lHe(e.formElements,Xxe,!1)}writeElements(t,e){e.formElements=uHe(t,Xxe,!1)}clone(){return new Yxe({description:this.description,elements:gi(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};E([N({json:{write:!0}})],qC.prototype,"elements",void 0),E([ho("elements")],qC.prototype,"castElements",null),E([Vi("elements",["formElements"])],qC.prototype,"readElements",null),E([Cr("elements")],qC.prototype,"writeElements",null),E([N({type:["collapsed","expanded"],json:{write:!0}})],qC.prototype,"initialState",void 0),E([N({type:String,json:{read:!1,write:!0}})],qC.prototype,"type",void 0),qC=Yxe=E([dt("esri.form.elements.GroupElement")],qC);const Xxe=aHe(qC),HGt=qC;var Kxe;const Jxe=aHe(HGt);let p2=Kxe=class extends Ui{constructor(t){super(t),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(t){return cHe(t,Jxe)}readElements(t,e){return lHe(e.formElements,Jxe)}writeElements(t,e){e.formElements=uHe(t,Jxe)}clone(){return new Kxe({description:this.description,expressionInfos:gi(this.expressionInfos),elements:gi(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}};E([N({type:String,json:{write:!0}})],p2.prototype,"description",void 0),E([N({json:{write:!0}})],p2.prototype,"elements",void 0),E([ho("elements")],p2.prototype,"castElements",null),E([Vi("elements",["formElements"])],p2.prototype,"readElements",null),E([Cr("elements")],p2.prototype,"writeElements",null),E([N({type:[LGt],json:{write:!0}})],p2.prototype,"expressionInfos",void 0),E([N({type:Boolean,json:{default:!1,write:!0}})],p2.prototype,"preserveFieldValuesWhenHidden",void 0),E([N({type:String,json:{write:!0}})],p2.prototype,"title",void 0),p2=Kxe=E([dt("esri.form.FormTemplate")],p2);const hHe=p2;async function WGt(t){const e="portalItem"in t?t:{portalItem:t},i=await Promise.resolve().then(()=>MAi);try{return await i.fromItem(e)}catch(r){const n=e&&e.portalItem,s=n&&n.id||"unset",o=n&&n.portal&&n.portal.url||pa.portalUrl;throw Oi.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+o+"', id: '"+s+"')",r),r}}let qGt=0,Fm=class extends md.EventedMixin(D1(gd)){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new Ar(-180,-90,180,90,hr.WGS84),this.id=Date.now().toString(16)+"-layer-"+qGt++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=hr.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const i=typeof e=="string"?{url:e}:e;return(await Promise.resolve().then(()=>ORi)).fromUrl(i)}static fromPortalItem(e){return WGt(e)}initialize(){this.when().catch(e=>{ys(e)||Oi.getLogger(this.declaredClass).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){if(this.parent){const e=this,i=this.parent;"layers"in i&&i.layers.includes(e)?i.layers.remove(e):"tables"in i&&i.tables.includes(e)?i.tables.remove(e):"baseLayers"in i&&i.baseLayers.includes(e)?i.baseLayers.remove(e):"baseLayers"in i&&i.referenceLayers.includes(e)&&i.referenceLayers.remove(e)}}get hasAttributionData(){return this.attributionDataUrl!=null}get parsedUrl(){return fa(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await ur(e,{query:{f:"json"},responseType:"json"})).data;throw new st("layer:no-attribution-data","Layer does not have attribution data")}};E([N({type:String})],Fm.prototype,"attributionDataUrl",void 0),E([N({type:Ar})],Fm.prototype,"fullExtent",void 0),E([N({readOnly:!0})],Fm.prototype,"hasAttributionData",null),E([N({type:String,clonable:!1})],Fm.prototype,"id",void 0),E([N({type:Boolean,nonNullable:!0})],Fm.prototype,"legendEnabled",void 0),E([N({type:["show","hide","hide-children"]})],Fm.prototype,"listMode",void 0),E([N({type:Number,range:{min:0,max:1},nonNullable:!0})],Fm.prototype,"opacity",void 0),E([N({clonable:!1})],Fm.prototype,"parent",void 0),E([N({readOnly:!0})],Fm.prototype,"parsedUrl",null),E([N({type:Boolean})],Fm.prototype,"popupEnabled",void 0),E([N({type:Boolean})],Fm.prototype,"attributionVisible",void 0),E([N({type:hr})],Fm.prototype,"spatialReference",void 0),E([N({type:String})],Fm.prototype,"title",void 0),E([N({readOnly:!0,json:{read:!1}})],Fm.prototype,"type",void 0),E([N()],Fm.prototype,"url",void 0),E([N({type:Boolean,nonNullable:!0})],Fm.prototype,"visible",void 0),Fm=E([dt("esri.layers.Layer")],Fm);const du=Fm;let RR=class extends Tn{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._handles=new df,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll(),this._handles.destroy()}add(e,i,r={}){return this._installWatch(e,i,r,sr)}addWhen(e,i,r={}){return this._installWatch(e,i,r,Yg)}addOnCollectionChange(e,i,{initial:r=!1,final:n=!1}={}){const s=++this._handleId;return this._handles.add([Wu(e,"after-changes",this._createSyncUpdatingCallback(),qu),Wu(e,"change",i,{onListenerAdd:r?o=>i({added:o.toArray(),removed:[]}):void 0,onListenerRemove:n?o=>i({added:[],removed:o.toArray()}):void 0})],s),{remove:()=>this._handles.remove(s)}}addPromise(e){if(lt(e))return e;const i=++this._handleId;this._handles.add({remove:()=>{this._pendingPromises.delete(e)&&(this._pendingPromises.size!==0||this._handles.has(Xse)||this._set("updating",!1))}},i),this._pendingPromises.add(e),this._set("updating",!0);const r=()=>this._handles.remove(i);return e.then(r,r),e}removeAll(){this._pendingPromises.clear(),this._handles.removeAll(),this._set("updating",!1)}_installWatch(e,i,r={},n){const s=++this._handleId;r.sync||this._installSyncUpdatingWatch(e,s);const o=n(e,i,r);return this._handles.add(o,s),{remove:()=>this._handles.remove(s)}}_installSyncUpdatingWatch(e,i){const r=this._createSyncUpdatingCallback(),n=sr(e,r,{sync:!0,equals:()=>!1});return this._handles.add(n,i),n}_createSyncUpdatingCallback(){return()=>{this._handles.remove(Xse),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this._handles.add(V3(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this._handles.remove(Xse))}),Xse)}}};E([N({readOnly:!0})],RR.prototype,"updating",void 0),RR=E([dt("esri.core.support.WatchUpdatingTracking")],RR);const Xse=-42,Ud=t=>{let e=class extends t{destroy(){this.destroyed||(this._get("handles")?.destroy(),this._get("updatingHandles")?.destroy())}get handles(){return this._get("handles")||new df}get updatingHandles(){return this._get("updatingHandles")||new RR}};return E([N({readOnly:!0})],e.prototype,"handles",null),E([N({readOnly:!0})],e.prototype,"updatingHandles",null),e=E([dt("esri.core.HandleOwner")],e),e};let YC=class extends Ud(Tn){};YC=E([dt("esri.core.HandleOwner")],YC);let lq=class{constructor(e=i=>i.values().next().value){this._peeker=e,this._items=new Set}get length(){return this._items.size}clear(){this._items.clear()}last(){if(this._items.size===0)return;let e;for(e of this._items);return e}peek(){if(this._items.size!==0)return this._peeker(this._items)}push(e){this.contains(e)||this._items.add(e)}contains(e){return this._items.has(e)}pop(){if(this.length===0)return;const e=this.peek();return this._items.delete(e),e}popLast(){if(this.length===0)return;const e=this.last();return this._items.delete(e),e}remove(e){this._items.delete(e)}filter(e){return this._items.forEach(i=>{e(i)||this._items.delete(i)}),this}};var ug;(function(t){t[t.HANDSHAKE=0]="HANDSHAKE",t[t.OPEN=1]="OPEN",t[t.OPENED=2]="OPENED",t[t.RESPONSE=3]="RESPONSE",t[t.INVOKE=4]="INVOKE",t[t.ABORT=5]="ABORT",t[t.CLOSE=6]="CLOSE",t[t.OPEN_PORT=7]="OPEN_PORT",t[t.ON=8]="ON"})(ug||(ug={}));let YGt=0;function dHe(){return YGt++}function XGt(t){return t&&typeof t=="object"&&("result"in t||"transferList"in t)}function uq(t){return t?typeof t=="string"?JSON.stringify({name:"message",message:t}):t.toJSON?JSON.stringify(t):JSON.stringify({name:t.name,message:t.message,details:t.details||{stack:t.stack}}):null}function Zxe(t,e,i,r){if(e.type===ug.OPEN_PORT)return void t.postMessage(e,[e.port]);if(e.type!==ug.INVOKE&&e.type!==ug.RESPONSE)return void t.postMessage(e);let n;if(XGt(i)?(n=pHe(i.transferList),e.data=i.result):(n=pHe(r),e.data=i),n){if(Hi("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 ug.INVOKE:throw o;case ug.RESPONSE:return void Zxe(t,{type:ug.RESPONSE,jobId:e.jobId,error:uq(o)})}}}t.postMessage(e,n)}else t.postMessage(e)}function cq(t){if(!t)return null;const e=t.data;return e?typeof e=="string"?JSON.parse(e):e:null}function pHe(t){if(!t||!t.length)return null;if(Hi("esri-workers-arraybuffer-transfer"))return t;const e=t.filter(i=>!KGt(i));return e.length?e:null}function KGt(t){return t instanceof ArrayBuffer||t&&t.constructor&&t.constructor.name==="ArrayBuffer"}const JGt={statsWorker:()=>Promise.resolve().then(()=>dMi),geometryEngineWorker:()=>Promise.resolve().then(()=>PMi),CSVSourceWorker:()=>Promise.resolve().then(()=>jDi),EdgeProcessingWorker:()=>Promise.resolve().then(()=>bFi),ElevationSamplerWorker:()=>Promise.resolve().then(()=>f4i),FeatureServiceSnappingSourceWorker:()=>Promise.resolve().then(()=>H4i),GeoJSONSourceWorker:()=>Promise.resolve().then(()=>dLi),LercWorker:()=>Promise.resolve().then(()=>wLi),MemorySourceWorker:()=>Promise.resolve().then(()=>ALi),PBFDecoderWorker:()=>Promise.resolve().then(()=>$Li),Pipeline:()=>Promise.resolve().then(()=>Eki),PointCloudWorker:()=>Promise.resolve().then(()=>n6i),RasterWorker:()=>Promise.resolve().then(()=>E8i),SceneLayerSnappingSourceWorker:()=>Promise.resolve().then(()=>r9i),SceneLayerWorker:()=>Promise.resolve().then(()=>p9i),WFSSourceWorker:()=>Promise.resolve().then(()=>G9i),WorkerTileHandler:()=>Promise.resolve().then(()=>XVi)},{CLOSE:fHe,ABORT:mHe,INVOKE:gHe,RESPONSE:hq,OPEN_PORT:yHe,ON:ZGt}=ug,QGt=2;let eUt=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===ug.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 aH{static connect(e){const i=new MessageChannel;let r;r=typeof e=="function"?new e:"default"in e&&typeof e.default=="function"?new e.default:e;const n=new aH(i.port1,{channel:i,client:r},()=>null);return typeof r=="object"&&"remoteClient"in r&&(r.remoteClient=n),aH.clients.set(n,r),i.port2}static loadWorker(e){const i=JGt[e];return i?i():Promise.resolve(null)}constructor(e,i,r){this._port=e,this._getNextJob=r,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new eUt(n=>this._onInvokeMessage(n)),this._client=i.client,this._onMessage=this._onMessage.bind(this),this._channel=i.channel,this._schedule=i.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:fHe}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,i,r){const n=r&&r.signal,s=r&&r.transferList;if(!this._port)return Promise.reject(new st("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:i}));const o=dHe();return new Promise((a,l)=>{if(Im(n))return this._processWork(),void l(Sc());const c=ap(n,()=>{const p=this._outJobs.get(o);p&&(this._outJobs.delete(o),this._processWork(),Uc(p.abortHandle),this._post({type:mHe,jobId:o}),l(Sc()))}),h={resolve:a,reject:l,abortHandle:c,debugInfo:e};this._outJobs.set(o,h),this._post({type:gHe,jobId:o,methodName:e,abortable:n!=null},i,s)})}on(e,i){const r=new MessageChannel;function n(s){i(s.data)}return this._port.postMessage({type:ug.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:ug.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)}}}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:yHe,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=QGt)return;const e=this._getNextJob();if(!e)return;const{methodName:i,data:r,invokeOptions:n,deferred:s}=e;this.invoke(i,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=>{Uc(e.abortHandle),e.reject(Sc(`Worker closing, aborting job calling '${e.debugInfo}'`))}),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){ve(this._schedule)?this._schedule(()=>this._processMessage(e)):this._processMessage(e)}_processMessage(e){const i=cq(e);if(i)switch(i.type){case hq:this._onResponseMessage(i);break;case gHe:this._invokeQueue.push(i);break;case mHe:this._onAbortMessage(i);break;case fHe:this._onCloseMessage();break;case yHe:this._onOpenPortMessage(i);break;case ZGt:this._onOnMessage(i)}}_onAbortMessage(e){const i=this._inJobs,r=e.jobId,n=i.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),i.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&aH.clients.get(this)===e&&e.destroy(),aH.clients.delete(this),e&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:i,jobId:r,data:n,abortable:s}=e,o=s?new AbortController:null,a=this._inJobs;let l,c=this._client,h=c[i];try{if(!h&&i&&i.includes(".")){const p=i.split(".");for(let y=0;y{a.has(r)&&(a.delete(r),this._post({type:hq,jobId:r},p))},p=>{a.has(r)&&(a.delete(r),ys(p)||this._post({type:hq,jobId:r,error:uq(p||{message:`Error encountered at method ${i}`})}))})):this._post({type:hq,jobId:r},l)}_onOpenPortMessage(e){new aH(e.port,{client:this._client},()=>null)}_onOnMessage(e){const{port:i}=e,r=this._client.on(e.eventType,s=>{i.postMessage(s)}),n=ZI(e.port,"message",s=>{cq(s)?.type===ug.CLOSE&&(n.remove(),r.remove(),i.close())})}_onResponseMessage(e){const{jobId:i,error:r,data:n}=e,s=this._outJobs;if(!s.has(i))return;const o=s.get(i);s.delete(i),this._processWork(),Uc(o.abortHandle),r?o.reject(st.fromJSON(JSON.parse(r))):o.resolve(n)}_post(e,i,r){return Zxe(this._port,e,i,r)}};MR.kernelInfo={revision:cGe,version:zH,buildDate:uGe},MR.clients=new Map;let vHe=class{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new lq}destroy(){this.close()}get closed(){return!this._clients||!this._clients.length}open(e,i){return new Promise((r,n)=>{let s=!0;const o=a=>{yn(i.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(c,i,()=>this._ongoingJobsQueue.pop()??null),o(r),this._clients[a]),()=>(o(n),null)):(this._clients[a]=new MR(l,i,()=>this._ongoingJobsQueue.pop()??null),this._clientPromises[a]=Promise.resolve(this._clients[a]),o(r))}})}broadcast(e,i,r){const n=new Array(this._clientPromises.length);for(let s=0;sa?.invoke(e,i,r))}return n}close(){let e;for(;e=this._ongoingJobsQueue.pop();)e.deferred.reject(Sc(`Worker closing, aborting job calling '${e.methodName}'`));for(const i of this._clientPromises)i.then(r=>r?.close());this._clients.length=0,this._clientPromises.length=0}invoke(e,i,r){let n;Array.isArray(r)?(Oi.getLogger("esri.core.workers.Connection").warn("invoke()","The transferList parameter is deprecated, use the options object instead"),n={transferList:r}):n=r;const s=Kx();this._ongoingJobsQueue.push({methodName:e,data:i,invokeOptions:n,deferred:s});for(let o=0;ol?.jobAdded())}return s.promise}on(e,i){return Promise.all(this._clientPromises).then(()=>R8(this._clients.map(r=>r.on(e,i))))}openPorts(){return new Promise(e=>{const i=new Array(this._clientPromises.length);let r=i.length;for(let n=0;n{s&&(i[n]=s.openPort()),--r==0&&e(i)})})}get test(){return{numClients:this._clients.length}}};const _He=Oi.getLogger("esri.intl.substitute");function f2(t,e,i={}){const{format:r={}}=i;return Xx(t,n=>tUt(n,e,r))}function tUt(t,e,i){let r,n;const s=t.indexOf(":");if(s===-1?r=t.trim():(r=t.slice(0,s).trim(),n=t.slice(s+1).trim()),!r)return"";const o=Yx(r,e);if(o==null)return"";const a=(n?i?.[n]:null)??i?.[r];return a?iUt(o,a):n?rUt(o,n):Qxe(o)}function iUt(t,e){switch(e.type){case"date":return FC(t,e.intlOptions);case"number":return oA(t,e.intlOptions);default:return _He.warn("missing format descriptor for key {key}"),Qxe(t)}}function rUt(t,e){switch(e.toLowerCase()){case"dateformat":return FC(t);case"numberformat":return oA(t);default:return _He.warn(`inline format is unsupported since 4.12: ${e}`),/^(dateformat|datestring)/i.test(e)?FC(t):/^numberformat/i.test(e)?oA(t):Qxe(t)}}function Qxe(t){switch(typeof t){case"string":return t;case"number":return oA(t);case"boolean":return""+t;default:return t instanceof Date?FC(t):""}}async function nUt(t,e,i,r){const n=e.exec(i);if(!n)throw new st("esri-intl:invalid-bundle",`Bundle id "${i}" is not compatible with the pattern "${e}"`);const s=n[1]?`${n[1]}/`:"",o=n[2],a=$8t(r),l=`${s}${o}.json`,c=a?`${s}${o}_${a}.json`:l;let h;try{h=await bHe(t(c))}catch(p){if(c===l)throw new st("intl:unknown-bundle",`Bundle "${i}" cannot be loaded`,{error:p});try{h=await bHe(t(l))}catch(y){throw new st("intl:unknown-bundle",`Bundle "${i}" cannot be loaded`,{error:y})}}return h}async function bHe(t){if(ve(wHe.fetchBundleAsset))return wHe.fetchBundleAsset(t);const e=await ur(t,{responseType:"text"});return JSON.parse(e.data)}let sUt=class{constructor({base:e="",pattern:i,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 i=="string"?new RegExp(`^${i}`):i,this.getAssetUrl=n,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,i){return nUt(this.getAssetUrl,this.matcher,e,i)}};function oUt(t){return new sUt(t)}const wHe={};k8t(oUt({pattern:"esri/",location:Ql}));const aUt={};function lUt(t){const e={async:t.async,isDebug:t.isDebug,locale:t.locale,baseUrl:t.baseUrl,has:{...t.has},map:{...t.map},packages:t.packages&&t.packages.concat()||[],paths:{...t.paths}};return t.hasOwnProperty("async")||(e.async=!0),t.hasOwnProperty("isDebug")||(e.isDebug=!1),t.baseUrl||(e.baseUrl=aUt.baseUrl),e}let uUt=class{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach(i=>{this[i]=(...r)=>e[i](...r)})}},Kse=class{constructor(){this._dispatcher=new uUt,this._workerPostMessage({type:ug.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){D8(()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))})}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,i,r){this._dispatcher.addEventListener(e,i,r)}removeEventListener(e,i,r){this._dispatcher.removeEventListener(e,i,r)}_workerPostMessage(e){D8(()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))})}async _workerMessageHandler(e){const i=cq(e);if(i&&i.type===ug.OPEN){const{modulePath:r,jobId:n}=i;let s=await MR.loadWorker(r);s||(s=await import(r));const o=MR.connect(s);this._workerPostMessage({type:ug.OPENED,jobId:n,data:o})}}};const e2e=Oi.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:cUt}=ug,hUt='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,i)=>{if(t){if(t.aborted)return i(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,version:r}=configuration.kernelInfo,{revision:t,version:n}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS API for JavaScript modules and assets. For more information visit https://bit.ly/3QnsuSo.\\nModules version: ${r}\\nAssets version: ${n}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let n;function t(e){const o=n.connect(e);self.postMessage({type:2,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 3:if(outgoing.has(r)){const i=outgoing.get(r);outgoing.delete(r),o.error?i.reject(JSON.parse(o.error)):i.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 Jse,Zse;const xHe="Failed to create Worker. Fallback to execute module in main thread";async function dUt(){if(!Hi("esri-workers")||(Hi("mozilla"),0))return SHe(new Kse);if(!Jse&&!Zse)try{const e=hUt.split('"{CONFIGURATION}"').join(`'${pUt()}'`);Jse=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){Zse=e||{}}let t;if(Jse)try{t=new Worker(Jse,{name:"esri-worker-"+fUt++})}catch{e2e.warn(xHe,Zse),t=new Kse}else e2e.warn(xHe,Zse),t=new Kse;return SHe(t)}async function SHe(t){return new Promise(e=>{function i(n){const s=cq(n);s&&s.type===cUt&&(t.removeEventListener("message",i),t.removeEventListener("error",r),e(t))}function r(n){n.preventDefault(),t.removeEventListener("message",i),t.removeEventListener("error",r),e2e.warn("Failed to create Worker. Fallback to execute module in main thread",n),(t=new Kse).addEventListener("message",i),t.addEventListener("error",r)}t.addEventListener("message",i),t.addEventListener("error",r)})}function pUt(){let t;if(pa.default!=null){const n={...pa};delete n.default,t=JSON.parse(JSON.stringify(n))}else t=JSON.parse(JSON.stringify(pa));t.assetsPath=Gy(t.assetsPath),t.defaultAssetsPath=t.defaultAssetsPath?Gy(t.defaultAssetsPath):void 0,t.request.interceptors=[],t.log.interceptors=[],t.locale=Z0(),t.has={"esri-csp-restrictions":Hi("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":Hi("esri-2d-update-debug"),"featurelayer-pbf":Hi("featurelayer-pbf"),"featurelayer-simplify-thresholds":Hi("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":Hi("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":Hi("featurelayer-simplify-mobile-factor"),"esri-atomics":Hi("esri-atomics"),"esri-shared-array-buffer":Hi("esri-shared-array-buffer"),"esri-tiles-debug":Hi("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":Hi("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":Hi("feature-polyline-generalization-factor"),"host-webworker":1,"polylabel-placement-enabled":Hi("polylabel-placement-enabled")},t.workers.loaderUrl&&(t.workers.loaderUrl=Gy(t.workers.loaderUrl)),t.workers.workerPath?t.workers.workerPath=Gy(t.workers.workerPath):t.workers.workerPath=Gy(Ql("esri/core/workers/RemoteClient.js")),t.workers.useDynamicImport=!1;const e=pa.workers.loaderConfig,i=lUt({baseUrl:e?.baseUrl,locale:Z0(),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:t,loaderConfig:i,kernelInfo:{version:zH,buildDate:uGe,revision:cGe}})}let fUt=0;const{ABORT:CHe,INVOKE:mUt,OPEN:gUt,OPENED:yUt,RESPONSE:dq}=ug;let vUt=class GLt{static async create(e){const i=await dUt();return new GLt(i,e)}constructor(e,i){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=i,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",r=>{r.preventDefault(),Oi.getLogger("esri.core.workers.WorkerOwner").error(r)})}terminate(){this.worker.terminate()}async open(e,i={}){const{signal:r}=i,n=dHe();return new Promise((s,o)=>{const a={resolve:s,reject:o,abortHandle:F8(r,()=>{this._outJobs.delete(n),this._post({type:CHe,jobId:n})})};this._outJobs.set(n,a),this._post({type:gUt,jobId:n,modulePath:e})})}_onMessage(e){const i=cq(e);if(i)switch(i.type){case yUt:this._onOpenedMessage(i);break;case dq:this._onResponseMessage(i);break;case CHe:this._onAbortMessage(i);break;case mUt:this._onInvokeMessage(i)}}_onAbortMessage(e){const i=this._inJobs,r=e.jobId,n=i.get(r);n&&(n.controller&&n.controller.abort(),i.delete(r))}_onInvokeMessage(e){const{methodName:i,jobId:r,data:n,abortable:s}=e,o=s?new AbortController:null,a=this._inJobs,l=G$t[i];let c;try{if(typeof l!="function")throw new TypeError(`${i} is not a function`);c=l.call(null,n,{signal:o?o.signal:null})}catch(h){return void this._post({type:dq,jobId:r,error:uq(h)})}Fp(c)?(a.set(r,{controller:o,promise:c}),c.then(h=>{a.has(r)&&(a.delete(r),this._post({type:dq,jobId:r},h))},h=>{a.has(r)&&(a.delete(r),h||(h={message:"Error encountered at method"+i}),ys(h)||this._post({type:dq,jobId:r,error:uq(h||{message:`Error encountered at method ${i}`})}))})):this._post({type:dq,jobId:r},c)}_onOpenedMessage(e){const{jobId:i,data:r}=e,n=this._outJobs.get(i);n&&(this._outJobs.delete(i),Uc(n.abortHandle),n.resolve(r))}_onResponseMessage(e){const{jobId:i,error:r,data:n}=e,s=this._outJobs.get(i);s&&(this._outJobs.delete(i),Uc(s.abortHandle),r?s.reject(st.fromJSON(JSON.parse(r))):s.resolve(n))}_post(e,i,r){return Zxe(this.worker,e,i,r)}},m5=Hi("esri-workers-debug")?1:Hi("esri-mobile")?Math.min(navigator.hardwareConcurrency-1,3):Hi("host-browser")?navigator.hardwareConcurrency-1:0;m5||(m5=Hi("safari")&&Hi("mac")?7:2);let THe=0;const Qse=[];function _Ut(){EHe()}async function eoe(t,e){const i=new vHe;return await i.open(t,e),i}async function bA(t,e={}){if(typeof t!="string")throw new st("workers:undefined-module","modulePath is missing");let i=e.strategy||"distributed";if(Hi("host-webworker")&&!Hi("esri-workers")&&(i="local"),i==="local"){let r=await MR.loadWorker(t);r||(r=await import(t)),yn(e.signal);const n=e.client||r;return eoe([MR.connect(r)],{...e,client:n})}if(await EHe(),yn(e.signal),i==="dedicated"){const r=THe++%m5;return eoe([await Qse[r].open(t,e)],e)}if(e.maxNumWorkers&&e.maxNumWorkers>0){const r=Math.min(e.maxNumWorkers,m5);if(rr.open(t,e)),e)}let toe=null;async function EHe(){if(toe)return toe;new AbortController;const t=[];for(let e=0;e(Qse[e]=r,r));t.push(i)}return toe=Promise.all(t),toe}function IHe(t,e,i){if(t.hasM==null||t.hasZ)for(const r of e)for(const n of r)n.length>2&&(n[2]*=i)}function AHe(t,e,i){if(!t&&!e||!i)return;const r=J3(i);PHe(t,i,r),PHe(e,i,r)}function PHe(t,e,i){if(t)for(const r of t)bUt(r.geometry,e,i)}function bUt(t,e,i){if(lt(t)||!t.spatialReference||Da(t.spatialReference,e))return;const r=J3(t.spatialReference)/i;if(r!==1){if("x"in t)t.z!=null&&(t.z*=r);else if("rings"in t)IHe(t,t.rings,r);else if("paths"in t)IHe(t,t.paths,r);else if("points"in t&&(t.hasM==null||t.hasZ))for(const n of t.points)n.length>2&&(n[2]*=r)}}function F9(t,e,i){if(lt(e)||lt(i)||i.vcsWkid||Da(e,i))return null;const r=J3(e)/J3(i);if(r===1)return null;switch(t){case"point":case"esriGeometryPoint":return n=>wUt(n,r);case"polyline":case"esriGeometryPolyline":return n=>SUt(n,r);case"polygon":case"esriGeometryPolygon":return n=>xUt(n,r);case"multipoint":case"esriGeometryMultipoint":return n=>CUt(n,r);case"extent":case"esriGeometryExtent":return n=>TUt(n,r);default:return null}}function wUt(t,e){t&&t.z!=null&&(t.z*=e)}function xUt(t,e){if(t)for(const i of t.rings)for(const r of i)r.length>2&&(r[2]*=e)}function SUt(t,e){if(t)for(const i of t.paths)for(const r of i)r.length>2&&(r[2]*=e)}function CUt(t,e){if(t)for(const i of t.points)i.length>2&&(i[2]*=e)}function TUt(t,e){t&&t.zmin!=null&&t.zmax!=null&&(t.zmin*=e,t.zmax*=e)}function ioe(t,e,i){if(!i||!i.features||!i.hasZ)return;const r=F9(i.geometryType,e,t.outSpatialReference);if(!lt(r))for(const n of i.features)r(n.geometry)}const roe=new Ks({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"});var t2e;const EUt=new Ks({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 Zy=t2e=class extends Ui{constructor(t){super(t),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=-1,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(t,{description:e}){let i=null;try{i=e?JSON.parse(e):null}catch{}return i?.value??null}readValueType(t,{description:e}){let i=null;try{i=e?JSON.parse(e):null}catch{}return i?EUt.fromJSON(i.fieldValueType):null}clone(){return new t2e({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.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})}};E([N({type:String,json:{write:!0}})],Zy.prototype,"alias",void 0),E([N({type:[String,Number],json:{write:{allowNull:!0}}})],Zy.prototype,"defaultValue",void 0),E([N()],Zy.prototype,"description",void 0),E([Vi("description")],Zy.prototype,"readDescription",null),E([N({types:iHe,json:{read:{reader:Yse},write:!0}})],Zy.prototype,"domain",void 0),E([N({type:Boolean,json:{write:!0}})],Zy.prototype,"editable",void 0),E([N({type:Ls,json:{write:!0}})],Zy.prototype,"length",void 0),E([N({type:String,json:{write:!0}})],Zy.prototype,"name",void 0),E([N({type:Boolean,json:{write:!0}})],Zy.prototype,"nullable",void 0),E([rn(roe)],Zy.prototype,"type",void 0),E([N()],Zy.prototype,"valueType",void 0),E([Vi("valueType",["description"])],Zy.prototype,"readValueType",null),E([N({type:Boolean,json:{read:!1}})],Zy.prototype,"visible",void 0),Zy=t2e=E([dt("esri.layers.support.Field")],Zy);const Jo=Zy;var i2e;const r2e=new Ks({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let cg=i2e=class extends Ui{constructor(t){super(t),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(t,e){const i=hr.fromJSON(e.spatialReference),r=[];for(let n=0;n0)for(let i=0;iMath.round((c-r)/e),o=c=>Math.round((n-c)/i),a=this.features,l=this._getQuantizationFunction(this.geometryType,s,o);for(let c=0,h=a.length;ch*s+r,l=h=>n-h*o,c=this._getHydrationFunction(t,a,l);for(const{geometry:h}of e)ve(h)&&c&&c(h);return this.transform=null,this}_quantizePoints(t,e,i){let r,n;const s=[];for(let o=0,a=t.length;o0){const c=e(l[0]),h=i(l[1]);c===r&&h===n||(s.push([c-r,h-n]),r=c,n=h)}else r=e(l[0]),n=i(l[1]),s.push([r,n])}return s.length>0?s:null}_getQuantizationFunction(t,e,i){return t==="point"?r=>(r.x=e(r.x),r.y=i(r.y),r):t==="polyline"||t==="polygon"?r=>{const n=Xa(r)?r.rings:r.paths,s=[];for(let o=0,a=n.length;o0?(Xa(r)?r.rings=s:r.paths=s,r):null}:t==="multipoint"?r=>{const n=this._quantizePoints(r.points,e,i);return n&&n.length>0?(r.points=n,r):null}:t==="extent"?r=>r:null}_getHydrationFunction(t,e,i){return t==="point"?r=>{r.x=e(r.x),r.y=i(r.y)}:t==="polyline"||t==="polygon"?r=>{const n=Xa(r)?r.rings:r.paths;let s,o;for(let a=0,l=n.length;a0?(s+=y[0],o+=y[1]):(s=y[0],o=y[1]),y[0]=e(s),y[1]=i(o)}}}:t==="extent"?r=>{r.xmin=e(r.xmin),r.ymin=i(r.ymin),r.xmax=e(r.xmax),r.ymax=i(r.ymax)}:t==="multipoint"?r=>{const n=r.points;let s,o;for(let a=0,l=n.length;a0?(s+=c[0],o+=c[1]):(s=c[0],o=c[1]),c[0]=e(s),c[1]=i(o)}}:null}};E([N({type:String,json:{write:!0}})],cg.prototype,"displayFieldName",void 0),E([N({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],cg.prototype,"exceededTransferLimit",void 0),E([N({type:[io],json:{write:!0}})],cg.prototype,"features",void 0),E([Vi("features")],cg.prototype,"readFeatures",null),E([N({type:[Jo],json:{write:!0}})],cg.prototype,"fields",void 0),E([N({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:r2e.read}}})],cg.prototype,"geometryType",void 0),E([Cr("geometryType")],cg.prototype,"writeGeometryType",null),E([N({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],cg.prototype,"hasM",void 0),E([N({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],cg.prototype,"hasZ",void 0),E([N({types:R1,json:{write:!0}})],cg.prototype,"queryGeometry",void 0),E([Vi("queryGeometry")],cg.prototype,"readQueryGeometry",null),E([N({type:hr,json:{write:!0}})],cg.prototype,"spatialReference",void 0),E([Cr("spatialReference")],cg.prototype,"writeSpatialReference",null),E([N({json:{write:!0}})],cg.prototype,"transform",void 0),cg=i2e=E([dt("esri.rest.support.FeatureSet")],cg),cg.prototype.toJSON.isDefaultToJSON=!0;const tc=cg;let IUt=0;const OHe="esri.layers.graphics.sources.MemorySource",n2e=Oi.getLogger(OHe);let wA=class extends gd.LoadableMixin(Jx(Ud(Sr))){constructor(e){super(e),this._idToClientGraphic=null,this.type="memory"}load(e){const i=ve(e)?e.signal:null;return this.addResolvingPromise(this._startWorker(i)),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,i={}){await this.load(i);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,i);ioe(e,this.layer.spatialReference,r);const n=tc.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,i={}){if(this._requiresClientGraphicMapping())throw new st("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(i);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,i);return ioe(e,this.layer.spatialReference,r),r}queryFeatureCount(e,i={}){return this.load(i).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,i))}queryObjectIds(e,i={}){return this.load(i).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,i))}queryExtent(e,i={}){return this.load(i).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,i)).then(r=>({count:r.count,extent:Ar.fromJSON(r.extent)}))}querySnapping(e,i={}){return this.load(i).then(()=>this._connection.invoke("querySnapping",e,i))}async _applyEdits(e){if(!this._connection)throw new st("feature-layer-source:edit-failure","Memory source not loaded");const i=this.layer.objectIdField;let r=null;const n=[],s=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const o=h=>"objectId"in h&&h.objectId!=null?h.objectId:"attributes"in h&&h.attributes[i]!=null?h.attributes[i]:null;if(e.addFeatures&&(r=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const h of e.deleteFeatures){const p=o(h);p!=null&&n.push(p)}const a=e.updateFeatures&&this._idToClientGraphic?new Map:null;if(e.updateFeatures){for(const h of e.updateFeatures)if(s.push(this._serializeFeature(h)),a){const p=o(h);p!=null&&a.set(p,h)}}AHe(r?r.features:null,s,this.layer.spatialReference);const{fullExtent:l,featureEditResults:c}=await this._connection.invoke("applyEdits",{adds:r?r.features:[],updates:s,deletes:n});return this.fullExtent=l,r&&r.finish(c.uidToObjectId),this._updateClientGraphicIds(a,c),this._createEditsResult(c)}async _prepareClientMapping(e,i){if(this._layerOrSourceGeometryType!=="mesh"||lt(e))return;const r=[];for(const{geometry:n}of e)!ve(n)||n.type!=="mesh"||n.hasExtent||n.loaded||r.push(n.load({signal:i}));r.length&&await Promise.all(r)}_updateClientGraphicIds(e,i){if(this._idToClientGraphic){if(e)for(const r of i.updateResults){if(!r.success)continue;const n=e.get(r.objectId);n!=null&&this._addIdToClientGraphic(n)}for(const r of i.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 i=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:i?new st("feature-layer-source:edit-failure",i.description,{code:i.code}):null}}_prepareAddFeatures(e){const i=new Map,r=new Array(e.length);let n=null;for(let o=0;o{n2e.error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),v.preventDefault()}));const h={features:c.features,fields:i&&i.map(v=>v.toJSON()),geometryType:Ine.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!=="mesh"&&s,hasZ:this._layerOrSourceGeometryType==="mesh"||o,objectIdField:n,spatialReference:l?null:r&&r.toJSON(),timeInfo:a?a.toJSON():null},p=await this._connection.invoke("load",h,{signal:e});for(const v of p.warnings)n2e.warn(v.message,{layer:this.layer,warning:v});p.featureErrors.length&&n2e.warn(`Encountered ${p.featureErrors.length} validation errors while loading features`,p.featureErrors);const y=p.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(c.inferredGeometryType)&&(y.geometryType=Ine.toJSON(c.inferredGeometryType)),this.sourceJSON=y,this._requiresClientGraphicMapping()&&(this._idToClientGraphic=new Map),c.finish(p.assignedObjectIds)}};E([q_e({Type:io,ensureType:fd(io)})],wA.prototype,"itemType",void 0),E([N()],wA.prototype,"type",void 0),E([N({constructOnly:!0})],wA.prototype,"layer",void 0),E([N({readOnly:!0})],wA.prototype,"_workerGeometryType",null),E([N()],wA.prototype,"sourceJSON",void 0),wA=E([dt(OHe)],wA);function AUt(t){return"portalItem"in t}const m2=t=>{let e=class extends t{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):AUt(this)?this.portalItem?.apiKey:null}set apiKey(i){i!=null?this._override("apiKey",i):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return E([N({type:String})],e.prototype,"apiKey",null),e=E([dt("esri.layers.mixins.APIKeyMixin")],e),e},RHe={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},MHe=Object.values(RHe),DHe=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${MHe.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),PUt=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${MHe.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),OUt=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function FHe(t){return!!DHe.test(t)}function XC(t){if(lt(t))return null;const e=fa(t),i=e.path.match(DHe)||e.path.match(PUt);if(!i)return null;const[,r,n,s,o]=i,a=n.indexOf("/");return{title:noe(a!==-1?n.slice(a+1):n),serverType:RHe[s.toLowerCase()],sublayer:o!=null&&o!==""?parseInt(o,10):null,url:{path:r}}}function LHe(t){const e=fa(t).path.match(OUt);return e?{serviceUrl:e[1],sublayerId:Number(e[2])}:null}function noe(t){return(t=t.replace(/\s*[/_]+\s*/g," "))[0].toUpperCase()+t.slice(1)}function s2e(t,e){const i=[];if(t){const r=XC(t);ve(r)&&r.title&&i.push(r.title)}if(e){const r=noe(e);i.push(r)}if(i.length===2){if(i[0].toLowerCase().includes(i[1].toLowerCase()))return i[0];if(i[1].toLowerCase().includes(i[0].toLowerCase()))return i[1]}return i.join(" - ")}function L9(t){if(!t)return!1;const e=".arcgis.com/",i="//services",r="//tiles",n="//features",s=(t=t.toLowerCase()).includes(e),o=t.includes(i)||t.includes(r)||t.includes(n);return s&&o}function pq(t,e){return t&&gL(Hje(t,e))}function NHe(t){let{url:e}=t;if(!e)return{url:e};e=Hje(e,t.logger);const i=fa(e),r=XC(i.path);let n;if(ve(r))r.sublayer!=null&&t.layer.layerId==null&&(n=r.sublayer),e=r.url.path;else if(t.nonStandardUrlAllowed){const s=LHe(i.path);ve(s)&&(e=s.serviceUrl,n=s.sublayerId)}return{url:gL(e),layerId:n}}function kHe(t,e,i,r,n){hA(e,r,"url",n),r.url&&t.layerId!=null&&(r.url=yd(r.url,i,t.layerId.toString()))}function RUt(t){if(!t)return!1;const e=t.toLowerCase(),i=e.includes("/services/"),r=e.includes("/mapserver/wmsserver"),n=e.includes("/imageserver/wmsserver"),s=e.includes("/wmsserver");return i&&(r||n||s)}const r_=t=>{let e=class extends t{get title(){if(this._get("title")&&this.originOf("title")!=="defaults")return this._get("title");if(this.url){const i=XC(this.url);if(ve(i)&&i.title)return i.title}return this._get("title")||""}set title(i){this._set("title",i)}set url(i){this._set("url",pq(i,Oi.getLogger(this.declaredClass)))}};return E([N()],e.prototype,"title",null),E([N({type:String})],e.prototype,"url",null),e=E([dt("esri.layers.mixins.ArcGISService")],e),e};function fq(){const t=new Float32Array(16);return t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function MUt(t){const e=new Float32Array(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function DUt(t,e,i,r,n,s,o,a,l,c,h,p,y,v,x,I){const P=new Float32Array(16);return P[0]=t,P[1]=e,P[2]=i,P[3]=r,P[4]=n,P[5]=s,P[6]=o,P[7]=a,P[8]=l,P[9]=c,P[10]=h,P[11]=p,P[12]=y,P[13]=v,P[14]=x,P[15]=I,P}function FUt(t,e){return new Float32Array(t,e,16)}const LUt=fq();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:LUt,clone:MUt,create:fq,createView:FUt,fromValues:DUt},Symbol.toStringTag,{value:"Module"}));function NUt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function DR(t,e,i,r,n,s,o,a,l,c,h,p,y,v,x,I,P){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t[4]=s,t[5]=o,t[6]=a,t[7]=l,t[8]=c,t[9]=h,t[10]=p,t[11]=y,t[12]=v,t[13]=x,t[14]=I,t[15]=P,t}function mq(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function xA(t,e){if(t===e){const i=e[1],r=e[2],n=e[3],s=e[6],o=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=s,t[11]=e[14],t[12]=n,t[13]=o,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function kUt(t,e){return gq(t,e)||mq(t),t}function gq(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8],p=e[9],y=e[10],v=e[11],x=e[12],I=e[13],P=e[14],F=e[15],k=i*a-r*o,j=i*l-n*o,V=i*c-s*o,Y=r*l-n*a,X=r*c-s*a,Z=n*c-s*l,ie=h*I-p*x,ce=h*P-y*x,he=h*F-v*x,_e=p*P-y*I,xe=p*F-v*I,Pe=y*F-v*P;let ke=k*Pe-j*xe+V*_e+Y*he-X*ce+Z*ie;return ke?(ke=1/ke,t[0]=(a*Pe-l*xe+c*_e)*ke,t[1]=(n*xe-r*Pe-s*_e)*ke,t[2]=(I*Z-P*X+F*Y)*ke,t[3]=(y*X-p*Z-v*Y)*ke,t[4]=(l*he-o*Pe-c*ce)*ke,t[5]=(i*Pe-n*he+s*ce)*ke,t[6]=(P*V-x*Z-F*j)*ke,t[7]=(h*Z-y*V+v*j)*ke,t[8]=(o*xe-a*he+c*ie)*ke,t[9]=(r*he-i*xe-s*ie)*ke,t[10]=(x*X-I*V+F*k)*ke,t[11]=(p*V-h*X-v*k)*ke,t[12]=(a*ce-o*_e-l*ie)*ke,t[13]=(i*_e-r*ce+n*ie)*ke,t[14]=(I*j-x*Y-P*k)*ke,t[15]=(h*Y-p*j+y*k)*ke,t):null}function $Ut(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8],p=e[9],y=e[10],v=e[11],x=e[12],I=e[13],P=e[14],F=e[15];return t[0]=a*(y*F-v*P)-p*(l*F-c*P)+I*(l*v-c*y),t[1]=-(r*(y*F-v*P)-p*(n*F-s*P)+I*(n*v-s*y)),t[2]=r*(l*F-c*P)-a*(n*F-s*P)+I*(n*c-s*l),t[3]=-(r*(l*v-c*y)-a*(n*v-s*y)+p*(n*c-s*l)),t[4]=-(o*(y*F-v*P)-h*(l*F-c*P)+x*(l*v-c*y)),t[5]=i*(y*F-v*P)-h*(n*F-s*P)+x*(n*v-s*y),t[6]=-(i*(l*F-c*P)-o*(n*F-s*P)+x*(n*c-s*l)),t[7]=i*(l*v-c*y)-o*(n*v-s*y)+h*(n*c-s*l),t[8]=o*(p*F-v*I)-h*(a*F-c*I)+x*(a*v-c*p),t[9]=-(i*(p*F-v*I)-h*(r*F-s*I)+x*(r*v-s*p)),t[10]=i*(a*F-c*I)-o*(r*F-s*I)+x*(r*c-s*a),t[11]=-(i*(a*v-c*p)-o*(r*v-s*p)+h*(r*c-s*a)),t[12]=-(o*(p*P-y*I)-h*(a*P-l*I)+x*(a*y-l*p)),t[13]=i*(p*P-y*I)-h*(r*P-n*I)+x*(r*y-n*p),t[14]=-(i*(a*P-l*I)-o*(r*P-n*I)+x*(r*l-n*a)),t[15]=i*(a*y-l*p)-o*(r*y-n*p)+h*(r*l-n*a),t}function BUt(t){const e=t[0],i=t[1],r=t[2],n=t[3],s=t[4],o=t[5],a=t[6],l=t[7],c=t[8],h=t[9],p=t[10],y=t[11],v=t[12],x=t[13],I=t[14],P=t[15];return(e*o-i*s)*(p*P-y*I)-(e*a-r*s)*(h*P-y*x)+(e*l-n*s)*(h*I-p*x)+(i*a-r*o)*(c*P-y*v)-(i*l-n*o)*(c*I-p*v)+(r*l-n*a)*(c*x-h*v)}function soe(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],h=e[7],p=e[8],y=e[9],v=e[10],x=e[11],I=e[12],P=e[13],F=e[14],k=e[15];let j=i[0],V=i[1],Y=i[2],X=i[3];return t[0]=j*r+V*a+Y*p+X*I,t[1]=j*n+V*l+Y*y+X*P,t[2]=j*s+V*c+Y*v+X*F,t[3]=j*o+V*h+Y*x+X*k,j=i[4],V=i[5],Y=i[6],X=i[7],t[4]=j*r+V*a+Y*p+X*I,t[5]=j*n+V*l+Y*y+X*P,t[6]=j*s+V*c+Y*v+X*F,t[7]=j*o+V*h+Y*x+X*k,j=i[8],V=i[9],Y=i[10],X=i[11],t[8]=j*r+V*a+Y*p+X*I,t[9]=j*n+V*l+Y*y+X*P,t[10]=j*s+V*c+Y*v+X*F,t[11]=j*o+V*h+Y*x+X*k,j=i[12],V=i[13],Y=i[14],X=i[15],t[12]=j*r+V*a+Y*p+X*I,t[13]=j*n+V*l+Y*y+X*P,t[14]=j*s+V*c+Y*v+X*F,t[15]=j*o+V*h+Y*x+X*k,t}function yq(t,e,i){const r=i[0],n=i[1],s=i[2];if(e===t)t[12]=e[0]*r+e[4]*n+e[8]*s+e[12],t[13]=e[1]*r+e[5]*n+e[9]*s+e[13],t[14]=e[2]*r+e[6]*n+e[10]*s+e[14],t[15]=e[3]*r+e[7]*n+e[11]*s+e[15];else{const o=e[0],a=e[1],l=e[2],c=e[3],h=e[4],p=e[5],y=e[6],v=e[7],x=e[8],I=e[9],P=e[10],F=e[11];t[0]=o,t[1]=a,t[2]=l,t[3]=c,t[4]=h,t[5]=p,t[6]=y,t[7]=v,t[8]=x,t[9]=I,t[10]=P,t[11]=F,t[12]=o*r+h*n+x*s+e[12],t[13]=a*r+p*n+I*s+e[13],t[14]=l*r+y*n+P*s+e[14],t[15]=c*r+v*n+F*s+e[15]}return t}function o2e(t,e,i){const r=i[0],n=i[1],s=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function $He(t,e,i,r){let n,s,o,a,l,c,h,p,y,v,x,I,P,F,k,j,V,Y,X,Z,ie,ce,he,_e,xe=r[0],Pe=r[1],ke=r[2],J=Math.sqrt(xe*xe+Pe*Pe+ke*ke);return J0?(i[0]=2*(a*o+h*r+l*s-c*n)/p,i[1]=2*(l*o+h*n+c*r-a*s)/p,i[2]=2*(c*o+h*s+a*n-l*r)/p):(i[0]=2*(a*o+h*r+l*s-c*n),i[1]=2*(l*o+h*n+c*r-a*s),i[2]=2*(c*o+h*s+a*n-l*r)),jHe(t,e,i),t}const qUt=hn();function YUt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function XUt(t,e){const i=e[0],r=e[1],n=e[2],s=e[4],o=e[5],a=e[6],l=e[8],c=e[9],h=e[10];return t[0]=Math.sqrt(i*i+r*r+n*n),t[1]=Math.sqrt(s*s+o*o+a*a),t[2]=Math.sqrt(l*l+c*c+h*h),t}function KUt(t,e){const i=e[0]+e[5]+e[10];let r=0;return i>0?(r=2*Math.sqrt(i+1),t[3]=.25*r,t[0]=(e[6]-e[9])/r,t[1]=(e[8]-e[2])/r,t[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]),t[3]=(e[6]-e[9])/r,t[0]=.25*r,t[1]=(e[1]+e[4])/r,t[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/r,t[0]=(e[1]+e[4])/r,t[1]=.25*r,t[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/r,t[0]=(e[8]+e[2])/r,t[1]=(e[6]+e[9])/r,t[2]=.25*r),t}function GHe(t,e,i,r){const n=e[0],s=e[1],o=e[2],a=e[3],l=n+n,c=s+s,h=o+o,p=n*l,y=n*c,v=n*h,x=s*c,I=s*h,P=o*h,F=a*l,k=a*c,j=a*h,V=r[0],Y=r[1],X=r[2];return t[0]=(1-(x+P))*V,t[1]=(y+j)*V,t[2]=(v-k)*V,t[3]=0,t[4]=(y-j)*Y,t[5]=(1-(p+P))*Y,t[6]=(I+F)*Y,t[7]=0,t[8]=(v+k)*X,t[9]=(I-F)*X,t[10]=(1-(p+x))*X,t[11]=0,t[12]=i[0],t[13]=i[1],t[14]=i[2],t[15]=1,t}function JUt(t,e,i,r,n){const s=e[0],o=e[1],a=e[2],l=e[3],c=s+s,h=o+o,p=a+a,y=s*c,v=s*h,x=s*p,I=o*h,P=o*p,F=a*p,k=l*c,j=l*h,V=l*p,Y=r[0],X=r[1],Z=r[2],ie=n[0],ce=n[1],he=n[2],_e=(1-(I+F))*Y,xe=(v+V)*Y,Pe=(x-j)*Y,ke=(v-V)*X,J=(1-(y+F))*X,de=(P+k)*X,Se=(x+j)*Z,Ie=(P-k)*Z,Re=(1-(y+I))*Z;return t[0]=_e,t[1]=xe,t[2]=Pe,t[3]=0,t[4]=ke,t[5]=J,t[6]=de,t[7]=0,t[8]=Se,t[9]=Ie,t[10]=Re,t[11]=0,t[12]=i[0]+ie-(_e*ie+ke*ce+Se*he),t[13]=i[1]+ce-(xe*ie+J*ce+Ie*he),t[14]=i[2]+he-(Pe*ie+de*ce+Re*he),t[15]=1,t}function ZUt(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=i+i,a=r+r,l=n+n,c=i*o,h=r*o,p=r*a,y=n*o,v=n*a,x=n*l,I=s*o,P=s*a,F=s*l;return t[0]=1-p-x,t[1]=h+F,t[2]=y-P,t[3]=0,t[4]=h-F,t[5]=1-c-x,t[6]=v+I,t[7]=0,t[8]=y+P,t[9]=v-I,t[10]=1-c-p,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function QUt(t,e,i,r,n,s,o){const a=1/(i-e),l=1/(n-r),c=1/(s-o);return t[0]=2*s*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*l,t[6]=0,t[7]=0,t[8]=(i+e)*a,t[9]=(n+r)*l,t[10]=(o+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*c,t[15]=0,t}function e7t(t,e,i,r,n){const s=1/Math.tan(e/2);let o;return t[0]=s/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,n!=null&&n!==1/0?(o=1/(r-n),t[10]=(n+r)*o,t[14]=2*n*r*o):(t[10]=-1,t[14]=-2*r),t}function t7t(t,e,i,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),c=2/(n+s);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-a)*l*.5,t[9]=(n-s)*c*.5,t[10]=r/(i-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*i/(i-r),t[15]=0,t}function i7t(t,e,i,r,n,s,o){const a=1/(e-i),l=1/(r-n),c=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*a,t[13]=(n+r)*l,t[14]=(o+s)*c,t[15]=1,t}function r7t(t,e,i,r){let n,s,o,a,l,c,h,p,y,v;const x=e[0],I=e[1],P=e[2],F=r[0],k=r[1],j=r[2],V=i[0],Y=i[1],X=i[2],Z=qv();return Math.abs(x-V)0&&(v=1/Math.sqrt(v),h*=v,p*=v,y*=v);let x=l*y-c*p,I=c*h-a*y,P=a*p-l*h;return v=x*x+I*I+P*P,v>0&&(v=1/Math.sqrt(v),x*=v,I*=v,P*=v),t[0]=x,t[1]=I,t[2]=P,t[3]=0,t[4]=p*P-y*I,t[5]=y*x-h*P,t[6]=h*I-p*x,t[7]=0,t[8]=h,t[9]=p,t[10]=y,t[11]=0,t[12]=n,t[13]=s,t[14]=o,t[15]=1,t}function s7t(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function o7t(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2+t[9]**2+t[10]**2+t[11]**2+t[12]**2+t[13]**2+t[14]**2+t[15]**2)}function a7t(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t[6]=e[6]+i[6],t[7]=e[7]+i[7],t[8]=e[8]+i[8],t[9]=e[9]+i[9],t[10]=e[10]+i[10],t[11]=e[11]+i[11],t[12]=e[12]+i[12],t[13]=e[13]+i[13],t[14]=e[14]+i[14],t[15]=e[15]+i[15],t}function UHe(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t[6]=e[6]-i[6],t[7]=e[7]-i[7],t[8]=e[8]-i[8],t[9]=e[9]-i[9],t[10]=e[10]-i[10],t[11]=e[11]-i[11],t[12]=e[12]-i[12],t[13]=e[13]-i[13],t[14]=e[14]-i[14],t[15]=e[15]-i[15],t}function l7t(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12]*i,t[13]=e[13]*i,t[14]=e[14]*i,t[15]=e[15]*i,t}function u7t(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t[3]=e[3]+i[3]*r,t[4]=e[4]+i[4]*r,t[5]=e[5]+i[5]*r,t[6]=e[6]+i[6]*r,t[7]=e[7]+i[7]*r,t[8]=e[8]+i[8]*r,t[9]=e[9]+i[9]*r,t[10]=e[10]+i[10]*r,t[11]=e[11]+i[11]*r,t[12]=e[12]+i[12]*r,t[13]=e[13]+i[13]*r,t[14]=e[14]+i[14]*r,t[15]=e[15]+i[15]*r,t}function zHe(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function HHe(t,e){if(t===e)return!0;const i=t[0],r=t[1],n=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8],p=t[9],y=t[10],v=t[11],x=t[12],I=t[13],P=t[14],F=t[15],k=e[0],j=e[1],V=e[2],Y=e[3],X=e[4],Z=e[5],ie=e[6],ce=e[7],he=e[8],_e=e[9],xe=e[10],Pe=e[11],ke=e[12],J=e[13],de=e[14],Se=e[15],Ie=qv();return Math.abs(i-k)<=Ie*Math.max(1,Math.abs(i),Math.abs(k))&&Math.abs(r-j)<=Ie*Math.max(1,Math.abs(r),Math.abs(j))&&Math.abs(n-V)<=Ie*Math.max(1,Math.abs(n),Math.abs(V))&&Math.abs(s-Y)<=Ie*Math.max(1,Math.abs(s),Math.abs(Y))&&Math.abs(o-X)<=Ie*Math.max(1,Math.abs(o),Math.abs(X))&&Math.abs(a-Z)<=Ie*Math.max(1,Math.abs(a),Math.abs(Z))&&Math.abs(l-ie)<=Ie*Math.max(1,Math.abs(l),Math.abs(ie))&&Math.abs(c-ce)<=Ie*Math.max(1,Math.abs(c),Math.abs(ce))&&Math.abs(h-he)<=Ie*Math.max(1,Math.abs(h),Math.abs(he))&&Math.abs(p-_e)<=Ie*Math.max(1,Math.abs(p),Math.abs(_e))&&Math.abs(y-xe)<=Ie*Math.max(1,Math.abs(y),Math.abs(xe))&&Math.abs(v-Pe)<=Ie*Math.max(1,Math.abs(v),Math.abs(Pe))&&Math.abs(x-ke)<=Ie*Math.max(1,Math.abs(x),Math.abs(ke))&&Math.abs(I-J)<=Ie*Math.max(1,Math.abs(I),Math.abs(J))&&Math.abs(P-de)<=Ie*Math.max(1,Math.abs(P),Math.abs(de))&&Math.abs(F-Se)<=Ie*Math.max(1,Math.abs(F),Math.abs(Se))}function l2e(t){const e=qv(),i=t[0],r=t[1],n=t[2],s=t[4],o=t[5],a=t[6],l=t[8],c=t[9],h=t[10];return Math.abs(1-(i*i+s*s+l*l))<=e&&Math.abs(1-(r*r+o*o+c*c))<=e&&Math.abs(1-(n*n+a*a+h*h))<=e}function u2e(t){return t[0]===1&&t[1]===0&&t[2]===0&&t[4]===0&&t[5]===1&&t[6]===0&&t[8]===0&&t[9]===0&&t[10]===1}Object.freeze(Object.defineProperty({__proto__:null,add:a7t,adjoint:$Ut,copy:NUt,determinant:BUt,equals:HHe,exactEquals:zHe,frob:o7t,fromQuat:ZUt,fromQuat2:WUt,fromRotation:a2e,fromRotationTranslation:jHe,fromRotationTranslationScale:GHe,fromRotationTranslationScaleOrigin:JUt,fromScaling:UUt,fromTranslation:BHe,fromXRotation:VHe,fromYRotation:zUt,fromZRotation:HUt,frustum:QUt,getRotation:KUt,getScaling:XUt,getTranslation:YUt,hasIdentityRotation:u2e,identity:mq,invert:gq,invertOrIdentity:kUt,isOrthoNormal:l2e,lookAt:r7t,mul:soe,multiply:soe,multiplyScalar:l7t,multiplyScalarAndAdd:u7t,ortho:i7t,perspective:e7t,perspectiveFromFieldOfView:t7t,rotate:$He,rotateX:VUt,rotateY:jUt,rotateZ:GUt,scale:o2e,set:DR,str:s7t,sub:UHe,subtract:UHe,targetTo:n7t,translate:yq,transpose:xA},Symbol.toStringTag,{value:"Module"}));const c7t=(t,e)=>{const i=DR(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1);return xA(i,i)},h7t=(t,e)=>{const i=DR(t,e,0,0,.5-.5*e,0,e,0,.5-.5*e,0,0,e,.5-.5*e,0,0,0,1);return xA(i,i)},d7t=(t,e)=>{const i=1-e,r=DR(t,.2126+.7874*i,.7152-.7152*i,.0722-.0722*i,0,.2126-.2126*i,.7152+.2848*i,.0722-.0722*i,0,.2126-.2126*i,.7152-.7152*i,.0722+.9278*i,0,0,0,0,1);return xA(r,r)},p7t=(t,e)=>{const i=Math.sin(e*Math.PI/180),r=Math.cos(e*Math.PI/180),n=DR(t,.213+.787*r-.213*i,.715-.715*r-.715*i,.072-.072*r+.928*i,0,.213-.213*r+.143*i,.715+.285*r+.14*i,.072-.072*r-.283*i,0,.213-.213*r-.787*i,.715-.715*r+.715*i,.072+.928*r+.072*i,0,0,0,0,1);return xA(n,n)},f7t=(t,e)=>{const i=1-2*e,r=DR(t,i,0,0,e,0,i,0,e,0,0,i,e,0,0,0,1);return xA(r,r)},m7t=(t,e)=>{const i=DR(t,.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 xA(i,i)},g7t=(t,e)=>{const i=1-e,r=DR(t,.393+.607*i,.769-.769*i,.189-.189*i,0,.349-.349*i,.686+.314*i,.168-.168*i,0,.272-.272*i,.534-.534*i,.131+.869*i,0,0,0,0,1);return xA(r,r)};let WHe=class ULt{constructor(e,i,r){this.strength=e,this.radius=i,this.threshold=r,this.type="bloom"}interpolate(e,i,r){this.strength=n_(e.strength,i.strength,r),this.radius=n_(e.radius,i.radius,r),this.threshold=n_(e.threshold,i.threshold,r)}clone(){return new ULt(this.strength,this.radius,this.threshold)}toJSON(){return{type:"bloom",radius:vq(this.radius),strength:this.strength,threshold:this.threshold}}},qHe=class zLt{constructor(e){this.radius=e,this.type="blur"}interpolate(e,i,r){this.radius=Math.round(n_(e.radius,i.radius,r))}clone(){return new zLt(this.radius)}toJSON(){return{type:"blur",radius:vq(this.radius)}}},c2e=class HLt{constructor(e,i){this.type=e,this.amount=i,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,i,r){this.amount=n_(e.amount,i.amount,r),this._updateMatrix()}clone(){return new HLt(this.type,this.amount)}toJSON(){return{type:this.type,amount:this.amount}}_updateMatrix(){const e=this._colorMatrix||fq();switch(this.type){case"brightness":this._colorMatrix=c7t(e,this.amount);break;case"contrast":this._colorMatrix=h7t(e,this.amount);break;case"grayscale":this._colorMatrix=d7t(e,this.amount);break;case"invert":this._colorMatrix=f7t(e,this.amount);break;case"saturate":this._colorMatrix=m7t(e,this.amount);break;case"sepia":this._colorMatrix=g7t(e,this.amount)}}},YHe=class WLt{constructor(e,i,r,n){this.offsetX=e,this.offsetY=i,this.blurRadius=r,this.color=n,this.type="drop-shadow"}interpolate(e,i,r){this.offsetX=n_(e.offsetX,i.offsetX,r),this.offsetY=n_(e.offsetY,i.offsetY,r),this.blurRadius=n_(e.blurRadius,i.blurRadius,r),this.color[0]=Math.round(n_(e.color[0],i.color[0],r)),this.color[1]=Math.round(n_(e.color[1],i.color[1],r)),this.color[2]=Math.round(n_(e.color[2],i.color[2],r)),this.color[3]=n_(e.color[3],i.color[3],r)}clone(){return new WLt(this.offsetX,this.offsetY,this.blurRadius,[...this.color])}toJSON(){const e=[...this.color];return e[3]*=255,{type:"drop-shadow",xoffset:vq(this.offsetX),yoffset:vq(this.offsetY),blurRadius:vq(this.blurRadius),color:e}}},XHe=class qLt{constructor(e){this.angle=e,this.type="hue-rotate"}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(e,i,r){this.angle=n_(e.angle,i.angle,r),this._updateMatrix()}clone(){return new qLt(this.angle)}toJSON(){return{type:"hue-rotate",angle:this.angle}}_updateMatrix(){const e=this._colorMatrix||fq();this._colorMatrix=p7t(e,this.angle)}},KHe=class YLt{constructor(e){this.amount=e,this.type="opacity",this.amount=Math.min(this.amount,1)}interpolate(e,i,r){this.amount=n_(e.amount,i.amount,r)}clone(){return new YLt(this.amount)}toJSON(){return{type:"opacity",amount:this.amount}}};function n_(t,e,i){return t+(e-t)*i}function vq(t){return Math.round(1e3*Ky(t))/1e3}function y7t(t){switch(t.type){case"grayscale":case"sepia":case"invert":return new c2e(t.type,0);case"saturate":case"brightness":case"contrast":return new c2e(t.type,1);case"opacity":return new KHe(1);case"hue-rotate":return new XHe(0);case"blur":return new qHe(0);case"drop-shadow":return new YHe(0,0,0,[...j1e("transparent")]);case"bloom":return new WHe(0,0,1)}}var h2e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function JHe(t,e){const i=t.length>e.length?t:e;return(t.length>e.length?e:t).every((r,n)=>r.type===i[n].type)}function ZHe(t,e){const i=t.length>e.length?t:e,r=t.length>e.length?e:t;for(let n=r.length;n{if(!Number.isFinite(i.scale)||i.scale<=0)throw new st("effect:invalid-scale","scale must be finite and greater than 0",{stop:i});return{scale:i.scale,effects:tWe(i.value)}});e.sort((i,r)=>r.effects.length-i.effects.length);for(let i=0;ir.scale-i.scale),e}function tWe(t){let e;if(!t)return[];try{e=d2e.parse(t)}catch(i){throw new st("effect:invalid-syntax","Invalid effect syntax",{value:t,error:i})}return e.map(i=>_7t(i))}function _7t(t){try{switch(t.name){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":return b7t(t);case"opacity":return w7t(t);case"hue-rotate":return x7t(t);case"blur":return S7t(t);case"drop-shadow":return C7t(t);case"bloom":return T7t(t)}}catch(e){throw e.details.filter=t,e}throw new st("effect:unknown-effect",`Effect '${t.name}' is not supported`,{effect:t})}function b7t(t){let e=1;return N9(t.parameters,1),t.parameters.length===1&&(e=g2(t.parameters[0])),new c2e(t.name,e)}function w7t(t){let e=1;return N9(t.parameters,1),t.parameters.length===1&&(e=g2(t.parameters[0])),new KHe(e)}function x7t(t){let e=0;return N9(t.parameters,1),t.parameters.length===1&&(e=R7t(t.parameters[0])),new XHe(e)}function S7t(t){let e=0;return N9(t.parameters,1),t.parameters.length===1&&(e=g2e(t.parameters[0]),_q(e,t.parameters[0])),new qHe(e)}function C7t(t){const e=[];let i=null;for(const r of t.parameters)if(r.type==="color"){if(e.length&&Object.freeze(e),i)throw new st("effect:type-error","Accepts only one color",{});i=M7t(r)}else{const n=g2e(r);if(Object.isFrozen(e))throw new st("effect:type-error"," parameters not consecutive",{lengths:e});e.push(n),e.length===3&&_q(n,r)}if(e.length<2||e.length>3)throw new st("effect:type-error",`Expected {2,3}, Actual: {${e.length}}`,{lengths:e});return new YHe(e[0],e[1],e[2]||0,i||iWe("black"))}function T7t(t){let e=1,i=0,r=0;return N9(t.parameters,3),t.parameters[0]&&(e=g2(t.parameters[0])),t.parameters[1]&&(i=g2e(t.parameters[1]),_q(i,t.parameters[1])),t.parameters[2]&&(r=g2(t.parameters[2])),new WHe(e,i,r)}function N9(t,e){if(t.length>e)throw new st("effect:type-error",`Function supports up to ${e} parameters, Actual: ${t.length}`,{parameters:t})}function ooe(t){if(t.type==="color")return"";if(t.unit){if(m2e[t.unit])return"";if(f2e[t.unit])return"";if(t.unit==="%")return""}return""}function _q(t,e){if(t<0)throw new st("effect:type-error",`Negative values are not allowed, Actual: ${t}`,{term:e})}function E7t(t){if(t.type!=="quantity"||t.unit!==null)throw new st("effect:type-error",`Expected , Actual: ${ooe(t)}`,{term:t})}function I7t(t){if(t.type!=="quantity"||t.unit!==null&&t.unit!=="%")throw new st("effect:type-error",`Expected or , Actual: ${ooe(t)}`,{term:t})}eWe=function(){function t(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 i(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,c={start:Ur},h=Ur,p="none",y=")",v=",",x="(",I="%",P="px",F="cm",k="mm",j="in",V="pt",Y="pc",X="deg",Z="rad",ie="grad",ce="turn",he="#",_e=".",xe="e",Pe=/^[ \t\n\r]/,ke=/^[a-z\-]/,J=/^[0-9a-fA-F]/,de=/^[+\-]/,Se=/^[0-9]/,Ie=cr("none"),Re=ki("none",!1),Oe=ki(")",!1),Ge=ki(",",!1),Be=cr("whitespace"),qe=Ni([" "," ",` +`,"\r"],!1,!1),et=cr("function"),Ze=ki("(",!1),mt=cr("identifier"),Pt=Ni([["a","z"],"-"],!1,!1),$t=cr("percentage"),Ct=ki("%",!1),Et=cr("length"),Ft=ki("px",!1),ot=ki("cm",!1),Te=ki("mm",!1),je=ki("in",!1),pt=ki("pt",!1),kt=ki("pc",!1),ct=cr("angle"),ae=ki("deg",!1),ht=ki("rad",!1),wt=ki("grad",!1),Ne=ki("turn",!1),pe=cr("number"),Ae=cr("color"),tt=ki("#",!1),gt=Ni([["0","9"],["a","f"],["A","F"]],!1,!1),ze=Ni(["+","-"],!1,!1),Ot=Ni([["0","9"]],!1,!1),jt=ki(".",!1),nt=ki("e",!1),$e=function(){return[]},Xt=function(Ti,_t){return{type:"function",name:Ti,parameters:_t||[]}},A=function(Ti,_t){return _t.length>0?Ta(Ti,_t,3):[Ti]},ye=function(Ti){return{type:"quantity",value:Ti.value,unit:Ti.unit}},H=function(Ti){return{type:"color",colorType:Ti.type,value:Ti.value}},T=function(Ti){return Ti},b=function(){return Ci()},m=function(Ti){return{value:Ti,unit:"%"}},_=function(Ti){return{value:Ti,unit:"px"}},C=function(Ti){return{value:Ti,unit:"cm"}},D=function(Ti){return{value:Ti,unit:"mm"}},L=function(Ti){return{value:Ti,unit:"in"}},B=function(Ti){return{value:Ti,unit:"pt"}},q=function(Ti){return{value:Ti,unit:"pc"}},Q=function(Ti){return{value:Ti,unit:"deg"}},oe=function(Ti){return{value:Ti,unit:"rad"}},le=function(Ti){return{value:Ti,unit:"grad"}},be=function(Ti){return{value:Ti,unit:"turn"}},Me=function(Ti){return{value:Ti,unit:null}},Ye=function(){return{type:"hex",value:Ci()}},it=function(Ti){return{type:"function",value:Ti}},Lt=function(){return{type:"named",value:Ci()}},Ut=function(){return parseFloat(Ci())},Je=0,Rt=0,ri=[{line:1,column:1}],ti=0,Zt=[],ii=0;if("startRule"in s){if(!(s.startRule in c))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');h=c[s.startRule]}function Ci(){return n.substring(Rt,Je)}function ki(Ti,_t){return{type:"literal",text:Ti,ignoreCase:_t}}function Ni(Ti,_t,Br){return{type:"class",parts:Ti,inverted:_t,ignoreCase:Br}}function tr(){return{type:"end"}}function cr(Ti){return{type:"other",description:Ti}}function wi(Ti){var _t,Br=ri[Ti];if(Br)return Br;for(_t=Ti-1;!ri[_t];)_t--;for(Br={line:(Br=ri[_t]).line,column:Br.column};_tti&&(ti=Je,Zt=[]),Zt.push(Ti))}function eo(Ti,_t,Br){return new e(e.buildMessage(Ti,_t),Ti,_t,Br)}function Ur(){var Ti;return(Ti=os())===a&&(Ti=Wn()),Ti}function os(){var Ti,_t;return ii++,Ti=Je,Xr(),n.substr(Je,4)===p?(_t=p,Je+=4):(_t=a,ii===0&&qr(Re)),_t!==a?(Xr(),Rt=Ti,Ti=$e()):(Je=Ti,Ti=a),ii--,Ti===a&&ii===0&&qr(Ie),Ti}function Wn(){var Ti,_t;if(Ti=[],(_t=Mn())!==a)for(;_t!==a;)Ti.push(_t),_t=Mn();else Ti=a;return Ti}function Mn(){var Ti,_t,Br,Kr;return Ti=Je,Xr(),(_t=wo())!==a?(Xr(),(Br=es())===a&&(Br=null),Xr(),n.charCodeAt(Je)===41?(Kr=y,Je++):(Kr=a,ii===0&&qr(Oe)),Kr!==a?(Xr(),Rt=Ti,Ti=Xt(_t,Br)):(Je=Ti,Ti=a)):(Je=Ti,Ti=a),Ti}function es(){var Ti,_t,Br,Kr,jn,Kn,Cs,ea;if(Ti=Je,(_t=ji())!==a){for(Br=[],Kr=Je,jn=Xr(),n.charCodeAt(Je)===44?(Kn=v,Je++):(Kn=a,ii===0&&qr(Ge)),Kn===a&&(Kn=null),Cs=Xr(),(ea=ji())!==a?Kr=jn=[jn,Kn,Cs,ea]:(Je=Kr,Kr=a);Kr!==a;)Br.push(Kr),Kr=Je,jn=Xr(),n.charCodeAt(Je)===44?(Kn=v,Je++):(Kn=a,ii===0&&qr(Ge)),Kn===a&&(Kn=null),Cs=Xr(),(ea=ji())!==a?Kr=jn=[jn,Kn,Cs,ea]:(Je=Kr,Kr=a);Rt=Ti,Ti=A(_t,Br)}else Je=Ti,Ti=a;return Ti}function ji(){var Ti,_t;return Ti=Je,(_t=Zi())===a&&(_t=ui())===a&&(_t=W())===a&&(_t=Mr()),_t!==a&&(Rt=Ti,_t=ye(_t)),(Ti=_t)===a&&(Ti=Je,(_t=Qo())!==a&&(Rt=Ti,_t=H(_t)),Ti=_t),Ti}function Xr(){var Ti,_t;for(ii++,Ti=[],Pe.test(n.charAt(Je))?(_t=n.charAt(Je),Je++):(_t=a,ii===0&&qr(qe));_t!==a;)Ti.push(_t),Pe.test(n.charAt(Je))?(_t=n.charAt(Je),Je++):(_t=a,ii===0&&qr(qe));return ii--,_t=a,ii===0&&qr(Be),Ti}function wo(){var Ti,_t,Br;return ii++,Ti=Je,(_t=An())!==a?(n.charCodeAt(Je)===40?(Br=x,Je++):(Br=a,ii===0&&qr(Ze)),Br!==a?(Rt=Ti,Ti=T(_t)):(Je=Ti,Ti=a)):(Je=Ti,Ti=a),ii--,Ti===a&&(_t=a,ii===0&&qr(et)),Ti}function An(){var Ti,_t,Br;if(ii++,Ti=Je,_t=[],ke.test(n.charAt(Je))?(Br=n.charAt(Je),Je++):(Br=a,ii===0&&qr(Pt)),Br!==a)for(;Br!==a;)_t.push(Br),ke.test(n.charAt(Je))?(Br=n.charAt(Je),Je++):(Br=a,ii===0&&qr(Pt));else _t=a;return _t!==a&&(Rt=Ti,_t=b()),ii--,(Ti=_t)===a&&(_t=a,ii===0&&qr(mt)),Ti}function Zi(){var Ti,_t,Br;return ii++,Ti=Je,Xr(),(_t=Go())!==a?(n.charCodeAt(Je)===37?(Br=I,Je++):(Br=a,ii===0&&qr(Ct)),Br!==a?(Rt=Ti,Ti=m(_t)):(Je=Ti,Ti=a)):(Je=Ti,Ti=a),ii--,Ti===a&&ii===0&&qr($t),Ti}function ui(){var Ti,_t,Br;return ii++,Ti=Je,Xr(),(_t=Go())!==a?(n.substr(Je,2)===P?(Br=P,Je+=2):(Br=a,ii===0&&qr(Ft)),Br!==a?(Rt=Ti,Ti=_(_t)):(Je=Ti,Ti=a)):(Je=Ti,Ti=a),Ti===a&&(Ti=Je,Xr(),(_t=Go())!==a?(n.substr(Je,2)===F?(Br=F,Je+=2):(Br=a,ii===0&&qr(ot)),Br!==a?(Rt=Ti,Ti=C(_t)):(Je=Ti,Ti=a)):(Je=Ti,Ti=a),Ti===a&&(Ti=Je,Xr(),(_t=Go())!==a?(n.substr(Je,2)===k?(Br=k,Je+=2):(Br=a,ii===0&&qr(Te)),Br!==a?(Rt=Ti,Ti=D(_t)):(Je=Ti,Ti=a)):(Je=Ti,Ti=a),Ti===a&&(Ti=Je,Xr(),(_t=Go())!==a?(n.substr(Je,2)===j?(Br=j,Je+=2):(Br=a,ii===0&&qr(je)),Br!==a?(Rt=Ti,Ti=L(_t)):(Je=Ti,Ti=a)):(Je=Ti,Ti=a),Ti===a&&(Ti=Je,Xr(),(_t=Go())!==a?(n.substr(Je,2)===V?(Br=V,Je+=2):(Br=a,ii===0&&qr(pt)),Br!==a?(Rt=Ti,Ti=B(_t)):(Je=Ti,Ti=a)):(Je=Ti,Ti=a),Ti===a&&(Ti=Je,Xr(),(_t=Go())!==a?(n.substr(Je,2)===Y?(Br=Y,Je+=2):(Br=a,ii===0&&qr(kt)),Br!==a?(Rt=Ti,Ti=q(_t)):(Je=Ti,Ti=a)):(Je=Ti,Ti=a)))))),ii--,Ti===a&&ii===0&&qr(Et),Ti}function W(){var Ti,_t,Br;return ii++,Ti=Je,(_t=Go())!==a?(n.substr(Je,3)===X?(Br=X,Je+=3):(Br=a,ii===0&&qr(ae)),Br!==a?(Rt=Ti,Ti=Q(_t)):(Je=Ti,Ti=a)):(Je=Ti,Ti=a),Ti===a&&(Ti=Je,(_t=Go())!==a?(n.substr(Je,3)===Z?(Br=Z,Je+=3):(Br=a,ii===0&&qr(ht)),Br!==a?(Rt=Ti,Ti=oe(_t)):(Je=Ti,Ti=a)):(Je=Ti,Ti=a),Ti===a&&(Ti=Je,(_t=Go())!==a?(n.substr(Je,4)===ie?(Br=ie,Je+=4):(Br=a,ii===0&&qr(wt)),Br!==a?(Rt=Ti,Ti=le(_t)):(Je=Ti,Ti=a)):(Je=Ti,Ti=a),Ti===a&&(Ti=Je,(_t=Go())!==a?(n.substr(Je,4)===ce?(Br=ce,Je+=4):(Br=a,ii===0&&qr(Ne)),Br!==a?(Rt=Ti,Ti=be(_t)):(Je=Ti,Ti=a)):(Je=Ti,Ti=a)))),ii--,Ti===a&&(_t=a,ii===0&&qr(ct)),Ti}function Mr(){var Ti,_t;return ii++,Ti=Je,Xr(),(_t=Go())!==a?(Rt=Ti,Ti=Me(_t)):(Je=Ti,Ti=a),ii--,Ti===a&&ii===0&&qr(pe),Ti}function Qo(){var Ti,_t,Br,Kr;if(ii++,Ti=Je,n.charCodeAt(Je)===35?(_t=he,Je++):(_t=a,ii===0&&qr(tt)),_t!==a){if(Br=[],J.test(n.charAt(Je))?(Kr=n.charAt(Je),Je++):(Kr=a,ii===0&&qr(gt)),Kr!==a)for(;Kr!==a;)Br.push(Kr),J.test(n.charAt(Je))?(Kr=n.charAt(Je),Je++):(Kr=a,ii===0&&qr(gt));else Br=a;Br!==a?(Rt=Ti,Ti=Ye()):(Je=Ti,Ti=a)}else Je=Ti,Ti=a;return Ti===a&&(Ti=Je,(_t=Mn())!==a&&(Rt=Ti,_t=it(_t)),(Ti=_t)===a&&(Ti=Je,(_t=An())!==a&&(Rt=Ti,_t=Lt()),Ti=_t)),ii--,Ti===a&&(_t=a,ii===0&&qr(Ae)),Ti}function Go(){var Ti,_t,Br,Kr,jn,Kn,Cs;for(Ti=Je,de.test(n.charAt(Je))?(n.charAt(Je),Je++):ii===0&&qr(ze),_t=Je,Br=[],Se.test(n.charAt(Je))?(Kr=n.charAt(Je),Je++):(Kr=a,ii===0&&qr(Ot));Kr!==a;)Br.push(Kr),Se.test(n.charAt(Je))?(Kr=n.charAt(Je),Je++):(Kr=a,ii===0&&qr(Ot));if(n.charCodeAt(Je)===46?(Kr=_e,Je++):(Kr=a,ii===0&&qr(jt)),Kr!==a){if(jn=[],Se.test(n.charAt(Je))?(Kn=n.charAt(Je),Je++):(Kn=a,ii===0&&qr(Ot)),Kn!==a)for(;Kn!==a;)jn.push(Kn),Se.test(n.charAt(Je))?(Kn=n.charAt(Je),Je++):(Kn=a,ii===0&&qr(Ot));else jn=a;jn!==a?_t=Br=[Br,Kr,jn]:(Je=_t,_t=a)}else Je=_t,_t=a;if(_t===a)if(_t=[],Se.test(n.charAt(Je))?(Br=n.charAt(Je),Je++):(Br=a,ii===0&&qr(Ot)),Br!==a)for(;Br!==a;)_t.push(Br),Se.test(n.charAt(Je))?(Br=n.charAt(Je),Je++):(Br=a,ii===0&&qr(Ot));else _t=a;if(_t!==a){if(Br=Je,n.charCodeAt(Je)===101?(Kr=xe,Je++):(Kr=a,ii===0&&qr(nt)),Kr!==a){if(de.test(n.charAt(Je))?(jn=n.charAt(Je),Je++):(jn=a,ii===0&&qr(ze)),jn===a&&(jn=null),Kn=[],Se.test(n.charAt(Je))?(Cs=n.charAt(Je),Je++):(Cs=a,ii===0&&qr(Ot)),Cs!==a)for(;Cs!==a;)Kn.push(Cs),Se.test(n.charAt(Je))?(Cs=n.charAt(Je),Je++):(Cs=a,ii===0&&qr(Ot));else Kn=a;Kn!==a?Br=Kr=[Kr,jn,Kn]:(Je=Br,Br=a)}else Je=Br,Br=a;Br===a&&(Br=null),Rt=Ti,Ti=Ut()}else Je=Ti,Ti=a;return Ti}function Wt(Ti,_t){return Ti.map(function(Br){return Br[_t]})}function Ta(Ti,_t,Br){return[Ti].concat(Wt(_t,Br))}if((o=h())!==a&&Je===n.length)return o;throw o!==a&&Je `+c+` `+p+` | `+l.line+" | "+y+` `+p+" | "+i("",l.column-1," ")+i("",v,"^")}else s+=` - at `+c}return s},e.buildMessage=function(n,s){var o={literal:function(v){return'"'+l(v.text)+'"'},class:function(v){var S=v.parts.map(function(I){return Array.isArray(I)?c(I[0])+"-"+c(I[1]):c(I)});return"["+(v.inverted?"^":"")+S.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(v){return v.description}};function a(v){return v.charCodeAt(0).toString(16).toUpperCase()}function l(v){return v.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(S){return"\\x0"+a(S)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(S){return"\\x"+a(S)})}function c(v){return v.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(S){return"\\x0"+a(S)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(S){return"\\x"+a(S)})}function d(v){return o[v.type](v)}function p(v){var S,I,O=v.map(d);if(O.sort(),O.length>0){for(S=1,I=1;S, Actual: ${uoe(t)}`,{term:t})}const h2e={px:1,cm:96/2.54,mm:96/2.54/10,in:96,pc:16,pt:96/72};function o7t(t){if(t.type!=="quantity"||!(t.value===0&&t.unit===null||t.unit&&h2e[t.unit]!=null))throw new st("effect:type-error",`Expected , Actual: ${uoe(t)}`,{term:t})}function y2(t){n7t(t);const e=t.value;return _q(e,t),t.unit==="%"?.01*e:e}function a7t(t){return r7t(t),_q(t.value,t),t.value}function l7t(t){return s7t(t),t.value*c2e[t.unit]||0}function d2e(t){return o7t(t),t.value*h2e[t.unit]||0}function u7t(t){switch(t.colorType){case"hex":return M8t(t.value);case"named":return ZHe(t.value);case"function":return d7t(t.value)}}function ZHe(t){if(!BUe(t))throw new st("effect:unknown-color",`color '${t}' isn't valid`,{namedColor:t});return R8t(t)}const c7t=/^rgba?/i,h7t=/^hsla?/i;function d7t(t){if($9(t.parameters,4),c7t.test(t.name))return[y2(t.parameters[0]),y2(t.parameters[1]),y2(t.parameters[2]),t.parameters[3]?y2(t.parameters[3]):1];if(h7t.test(t.name))return GUe(a7t(t.parameters[0]),y2(t.parameters[1]),y2(t.parameters[2]),t.parameters[3]?y2(t.parameters[3]):1);throw new st("effect:syntax-error",`Invalid color function '${t.name}'`,{colorFunction:t})}function p2e(t,e,i){try{return f7t(t)}catch(r){i?.messages?.push(r)}return null}function f2e(t,e,i,r){try{const n=p7t(t);Ep(i,n,e)}catch(n){r.messages&&r.messages.push(n)}}function p7t(t){const e=u2e(t);return e?Xjt(e)?e.map(i=>i.toJSON()):e.map(({scale:i,effects:r})=>({scale:i,value:r.map(n=>n.toJSON())})):null}function f7t(t){if(!t||t.length===0)return null;if(m7t(t)){const e=[];for(const i of t)e.push({scale:i.scale,value:QHe(i.value)});return e}return QHe(t)}function m7t(t){const e=t[0];return!!e&&"scale"in e}function QHe(t){if(!t||!t.length)return"";const e=[];for(const i of t){let r=[];switch(i.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":r=[CA(i,"amount")];break;case"blur":r=[CA(i,"radius","pt")];break;case"hue-rotate":r=[CA(i,"angle","deg")];break;case"drop-shadow":r=[CA(i,"xoffset","pt"),CA(i,"yoffset","pt"),CA(i,"blurRadius","pt"),g7t(i,"color")];break;case"bloom":r=[CA(i,"strength"),CA(i,"radius","pt"),CA(i,"threshold")]}const n=`${i.type}(${r.filter(Boolean).join(" ")})`;u2e(n),e.push(n)}return e.join(" ")}function CA(t,e,i){if(t[e]==null)throw new st("effect:missing-parameter",`Missing parameter '${e}' in ${t.type} effect`,{effect:t});return i?t[e]+i:""+t[e]}function g7t(t,e){if(t[e]==null)throw new st("effect:missing-parameter",`Missing parameter '${e}' in ${t.type} effect`,{effect:t});const i=t[e];return`rgba(${i[0]||0}, ${i[1]||0}, ${i[2]||0}, ${i[3]/255||0})`}const eWe={read:{reader:p2e},write:{allowNull:!0,writer:f2e}},ip=t=>{let e=class extends t{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return E([k({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),E([k({json:{read:!1,write:!1,origins:{"web-map":eWe,"portal-item":eWe}}})],e.prototype,"effect",void 0),e=E([ht("esri.layers.mixins.BlendLayer")],e),e},v2=t=>{let e=class extends t{constructor(){super(...arguments),this.customParameters=null}};return E([k({type:Object,json:{write:{overridePolicy:i=>({enabled:!!(i&&Object.keys(i).length>0)})}}})],e.prototype,"customParameters",void 0),e=E([ht("esri.layers.mixins.CustomParametersMixin")],e),e},tWe=new cd.EventEmitter,iWe="esri.layers.mixins.EditBusLayer",rWe=Symbol(iWe);function y7t(t){return t!=null&&typeof t=="object"&&rWe in t}const m2e=t=>{var e;let i=class extends t{constructor(...r){super(...r),this[e]=!0,this.when().then(()=>{this.own([tWe.on("edits",n=>{const s="layer"in n?n.layer:null,o="layer"in n?n.layer?.url:n.serviceUrl,a="layer"in n?n.layer?.layerId:n.layerId,l=n.event;if(s===this||o!==this.url)return;if(a!=null&&this.layerId!=null&&a===this.layerId)return void this.emit("edits",hi(l));const c=l.editedFeatures?.find(({layerId:d})=>d===this.layerId);if(c){const{adds:d,updates:p,deletes:y}=c.editedFeatures,v={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:d?d.map(({attributes:S})=>({objectId:this.objectIdField&&S[this.objectIdField],globalId:this.globalIdField&&S[this.globalIdField]})):[],deletedFeatures:y?y.map(({attributes:S})=>({objectId:this.objectIdField&&S[this.objectIdField],globalId:this.globalIdField&&S[this.globalIdField]})):[],updatedFeatures:p?p.map(({current:{attributes:S}})=>({objectId:this.objectIdField&&S[this.objectIdField],globalId:this.globalIdField&&S[this.globalIdField]})):[],editedFeatures:hi(l.editedFeatures),exceededTransferLimit:!1};this.emit("edits",v)}})])},()=>{})}};return e=rWe,i=E([ht(iWe)],i),i},nWe={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},v7t={milliseconds:{getter:"getMilliseconds",setter:"setMilliseconds",multiplier:1},seconds:{getter:"getSeconds",setter:"setSeconds",multiplier:1},minutes:{getter:"getMinutes",setter:"setMinutes",multiplier:1},hours:{getter:"getHours",setter:"setHours",multiplier:1},days:{getter:"getDate",setter:"setDate",multiplier:1},weeks:{getter:"getDate",setter:"setDate",multiplier:7},months:{getter:"getMonth",setter:"setMonth",multiplier:1},years:{getter:"getFullYear",setter:"setFullYear",multiplier:1},decades:{getter:"getFullYear",setter:"setFullYear",multiplier:10},centuries:{getter:"getFullYear",setter:"setFullYear",multiplier:100}};function _7t(t,e){const i=new Date(t,e+1,1);return i.setDate(0),i.getDate()}function p5(t,e,i){const r=new Date(t.getTime());if(e&&i){const n=v7t[i],{getter:s,setter:o,multiplier:a}=n;if(i==="months"){const l=_7t(r.getFullYear(),r.getMonth()+e);r.getDate()>l&&r.setDate(l)}r[o](r[s]()+e*a)}return r}function sWe(t,e){switch(e){case"milliseconds":return new Date(t.getTime());case"seconds":return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());case"minutes":return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes());case"hours":return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours());case"days":return new Date(t.getFullYear(),t.getMonth(),t.getDate());case"weeks":return new Date(t.getFullYear(),t.getMonth(),t.getDate()-t.getDay());case"months":return new Date(t.getFullYear(),t.getMonth(),1);case"years":return new Date(t.getFullYear(),0,1);case"decades":return new Date(t.getFullYear()-t.getFullYear()%10,0,1);case"centuries":return new Date(t.getFullYear()-t.getFullYear()%100,0,1);default:return new Date}}function b7t(t,e,i){return t===0?0:t*nWe[e]/nWe[i]}var _2;let L1=_2=class extends Ni{static get allTime(){return oWe}static get empty(){return w7t}constructor(t){super(t),this.end=null,this.start=null}readEnd(t,e){return e.end!=null?new Date(e.end):null}writeEnd(t,e){e.end=t?t.getTime():null}get isAllTime(){return this.equals(_2.allTime)}get isEmpty(){return this.equals(_2.empty)}readStart(t,e){return e.start!=null?new Date(e.start):null}writeStart(t,e){e.start=t?t.getTime():null}clone(){return new _2({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=ye(this.start)?this.start.getTime():this.start,i=ye(this.end)?this.end.getTime():this.end,r=ye(t.start)?t.start.getTime():t.start,n=ye(t.end)?t.end.getTime():t.end;return e===r&&i===n}expandTo(t){if(this.isEmpty||this.isAllTime)return this.clone();const e=ya(this.start,r=>sWe(r,t)),i=ya(this.end,r=>{const n=sWe(r,t);return r.getTime()===n.getTime()?n:p5(n,1,t)});return new _2({start:e,end:i})}intersection(t){if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return _2.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=Vv(this.start,-1/0,a=>a.getTime()),i=Vv(this.end,1/0,a=>a.getTime()),r=Vv(t.start,-1/0,a=>a.getTime()),n=Vv(t.end,1/0,a=>a.getTime());let s,o;if(r>=e&&r<=i?s=r:e>=r&&e<=n&&(s=e),i>=r&&i<=n?o=i:n>=e&&n<=i&&(o=n),s!=null&&o!=null&&!isNaN(s)&&!isNaN(o)){const a=new _2;return a.start=s===-1/0?null:new Date(s),a.end=o===1/0?null:new Date(o),a}return _2.empty}offset(t,e){if(this.isEmpty||this.isAllTime)return this.clone();const i=new _2,{start:r,end:n}=this;return ye(r)&&(i.start=p5(r,t,e)),ye(n)&&(i.end=p5(n,t,e)),i}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return oWe.clone();const e=ye(this.start)&&ye(t.start)?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,i=ye(this.end)&&ye(t.end)?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new _2({start:e,end:i})}};E([k({type:Date,json:{write:{allowNull:!0}}})],L1.prototype,"end",void 0),E([Li("end")],L1.prototype,"readEnd",null),E([mr("end")],L1.prototype,"writeEnd",null),E([k({readOnly:!0,json:{read:!1}})],L1.prototype,"isAllTime",null),E([k({readOnly:!0,json:{read:!1}})],L1.prototype,"isEmpty",null),E([k({type:Date,json:{write:{allowNull:!0}}})],L1.prototype,"start",void 0),E([Li("start")],L1.prototype,"readStart",null),E([mr("start")],L1.prototype,"writeStart",null),L1=_2=E([ht("esri.TimeExtent")],L1);const oWe=new L1,w7t=new L1({start:void 0,end:void 0}),Wg=L1;var g2e;let TA=g2e=class extends Ni{constructor(t){super(t),this.type="map-layer"}clone(){const{mapLayerId:t,gdbVersion:e}=this;return new g2e({mapLayerId:t,gdbVersion:e})}};E([Hr({mapLayer:"map-layer"})],TA.prototype,"type",void 0),E([k({type:xs,json:{write:!0}})],TA.prototype,"mapLayerId",void 0),E([k({type:String,json:{write:!0}})],TA.prototype,"gdbVersion",void 0),TA=g2e=E([ht("esri.layers.support.source.MapLayerSource")],TA);var y2e;let EA=y2e=class extends Ni{constructor(t){super(t),this.type="query-table"}clone(){const{workspaceId:t,query:e,oidFields:i,spatialReference:r,geometryType:n}=this,s={workspaceId:t,query:e,oidFields:i,spatialReference:r?.clone()??void 0,geometryType:n};return new y2e(s)}};E([Hr({queryTable:"query-table"})],EA.prototype,"type",void 0),E([k({type:String,json:{write:!0}})],EA.prototype,"workspaceId",void 0),E([k({type:String,json:{write:!0}})],EA.prototype,"query",void 0),E([k({type:String,json:{write:!0}})],EA.prototype,"oidFields",void 0),E([k({type:rr,json:{write:!0}})],EA.prototype,"spatialReference",void 0),E([Hr(qy)],EA.prototype,"geometryType",void 0),EA=y2e=E([ht("esri.layers.support.source.QueryTableDataSource")],EA);var v2e;let B9=v2e=class extends Ni{constructor(t){super(t),this.type="raster"}clone(){const{workspaceId:t,dataSourceName:e}=this;return new v2e({workspaceId:t,dataSourceName:e})}};E([Hr({raster:"raster"})],B9.prototype,"type",void 0),E([k({type:String,json:{write:!0}})],B9.prototype,"dataSourceName",void 0),E([k({type:String,json:{write:!0}})],B9.prototype,"workspaceId",void 0),B9=v2e=E([ht("esri.layers.support.source.RasterDataSource")],B9);var _2e;let f5=_2e=class extends Ni{constructor(t){super(t),this.type="table"}clone(){const{workspaceId:t,gdbVersion:e,dataSourceName:i}=this;return new _2e({workspaceId:t,gdbVersion:e,dataSourceName:i})}};E([Hr({table:"table"})],f5.prototype,"type",void 0),E([k({type:String,json:{write:!0}})],f5.prototype,"workspaceId",void 0),E([k({type:String,json:{write:!0}})],f5.prototype,"gdbVersion",void 0),E([k({type:String,json:{write:!0}})],f5.prototype,"dataSourceName",void 0),f5=_2e=E([ht("esri.layers.support.source.TableDataSource")],f5);var b2e,w2e;const x7t=jo()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let k1=b2e=class extends Ni{constructor(t){super(t),this.type="join-table"}readLeftTableSource(t,e,i){return aWe()(t,e,i)}castLeftTableSource(t){return SC(C2e(),t)}readRightTableSource(t,e,i){return aWe()(t,e,i)}castRightTableSource(t){return SC(C2e(),t)}clone(){const{leftTableKey:t,rightTableKey:e,leftTableSource:i,rightTableSource:r,joinType:n}=this,s={leftTableKey:t,rightTableKey:e,leftTableSource:i?.clone()??void 0,rightTableSource:r?.clone()??void 0,joinType:n};return new b2e(s)}};E([Hr({joinTable:"join-table"})],k1.prototype,"type",void 0),E([k({type:String,json:{write:!0}})],k1.prototype,"leftTableKey",void 0),E([k({type:String,json:{write:!0}})],k1.prototype,"rightTableKey",void 0),E([k({json:{write:!0}})],k1.prototype,"leftTableSource",void 0),E([Li("leftTableSource")],k1.prototype,"readLeftTableSource",null),E([Zs("leftTableSource")],k1.prototype,"castLeftTableSource",null),E([k({json:{write:!0}})],k1.prototype,"rightTableSource",void 0),E([Li("rightTableSource")],k1.prototype,"readRightTableSource",null),E([Zs("rightTableSource")],k1.prototype,"castRightTableSource",null),E([Hr(x7t)],k1.prototype,"joinType",void 0),k1=b2e=E([ht("esri.layers.support.source.JoinTableDataSource")],k1);let x2e=null;function aWe(){return x2e||(x2e=CC({types:C2e()})),x2e}let S2e=null;function C2e(){return S2e||(S2e={key:"type",base:null,typeMap:{"data-layer":Q0,"map-layer":TA}}),S2e}const S7t={key:"type",base:null,typeMap:{"join-table":k1,"query-table":EA,raster:B9,table:f5}};let Q0=w2e=class extends Ni{constructor(t){super(t),this.type="data-layer"}clone(){const{fields:t,dataSource:e}=this;return new w2e({fields:t,dataSource:e})}};E([Hr({dataLayer:"data-layer"})],Q0.prototype,"type",void 0),E([k({type:[Bo],json:{write:!0}})],Q0.prototype,"fields",void 0),E([k({types:S7t,json:{write:!0}})],Q0.prototype,"dataSource",void 0),Q0=w2e=E([ht("esri.layers.support.source.DataLayerSource")],Q0),Q0.from=ud(Q0);let m5=class extends ua(Ni){constructor(e){super(e),this.onFields=null,this.operator=null,this.searchTerm=null,this.searchType=null}};E([k({type:[String],json:{write:{enabled:!0,overridePolicy(){return{enabled:ye(this.onFields)&&this.onFields.length>0}}}}})],m5.prototype,"onFields",void 0),E([k({type:String,json:{write:!0}})],m5.prototype,"operator",void 0),E([k({type:String,json:{write:!0}})],m5.prototype,"searchTerm",void 0),E([k({type:String,json:{write:!0}})],m5.prototype,"searchType",void 0),m5=E([ht("esri.rest.support.FullTextSearch")],m5);const C7t=m5;var T2e;const lWe=new Bs({upperLeft:"upper-left",lowerLeft:"lower-left"});let g5=T2e=class extends Ni{constructor(t){super(t),this.extent=null,this.mode="view",this.originPosition="upper-left",this.tolerance=1}clone(){return new T2e(hi({extent:this.extent,mode:this.mode,originPosition:this.originPosition,tolerance:this.tolerance}))}};E([k({type:vr,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],g5.prototype,"extent",void 0),E([k({type:["view","edit"],json:{write:!0}})],g5.prototype,"mode",void 0),E([k({type:String,json:{read:lWe.read,write:lWe.write}})],g5.prototype,"originPosition",void 0),E([k({type:Number,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],g5.prototype,"tolerance",void 0),g5=T2e=E([ht("esri.rest.support.QuantizationParameters")],g5);const uWe=g5;var E2e;const cWe=new Bs({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 b2=E2e=class extends Ni{constructor(t){super(t),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(t,e){this.statisticType!=="percentile-continuous"&&this.statisticType!=="percentile-discrete"||(e.statisticParameters=hi(t))}clone(){return new E2e({maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount,onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,statisticType:this.statisticType,statisticParameters:hi(this.statisticParameters)})}};E([k({type:Number,json:{write:!0}})],b2.prototype,"maxPointCount",void 0),E([k({type:Number,json:{write:!0}})],b2.prototype,"maxRecordCount",void 0),E([k({type:Number,json:{write:!0}})],b2.prototype,"maxVertexCount",void 0),E([k({type:String,json:{write:!0}})],b2.prototype,"onStatisticField",void 0),E([k({type:String,json:{write:!0}})],b2.prototype,"outStatisticFieldName",void 0),E([k({type:String,json:{read:{source:"statisticType",reader:cWe.read},write:{target:"statisticType",writer:cWe.write}}})],b2.prototype,"statisticType",void 0),E([k({type:Object})],b2.prototype,"statisticParameters",void 0),E([mr("statisticParameters")],b2.prototype,"writeStatisticParameters",null),b2=E2e=E([ht("esri.rest.support.StatisticDefinition")],b2);const coe=b2;var G9;const T7t=new Bs({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),E7t=new Bs({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let Eo=G9=class extends Ni{static from(t){return kd(G9,t)}constructor(t){super(t),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(t){return typeof t=="number"||typeof t=="object"?t:null}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}writeParameterValues(t,e){if(t){const i={};for(const r in t){const n=t[r];Array.isArray(n)?i[r]=n.map(s=>s instanceof Date?s.getTime():s):n instanceof Date?i[r]=n.getTime():i[r]=n}e.parameterValues=i}}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,e.where="1=1"}writeWhere(t,e){e.where=t||"1=1"}clone(){return new G9(hi({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:ye(this.historicMoment)?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}))}};Eo.MAX_MAX_RECORD_COUNT_FACTOR=5,E([k({json:{write:!0}})],Eo.prototype,"aggregateIds",void 0),E([k({type:Boolean,json:{write:!0}})],Eo.prototype,"cacheHint",void 0),E([k({type:Boolean,json:{default:!1,write:!0}})],Eo.prototype,"compactGeometryEnabled",void 0),E([k({json:{write:!0}})],Eo.prototype,"datumTransformation",void 0),E([Zs("datumTransformation")],Eo.prototype,"castDatumTransformation",null),E([k({type:Boolean,json:{default:!1,write:!0}})],Eo.prototype,"defaultSpatialReferenceEnabled",void 0),E([k({type:Number,json:{write:{overridePolicy:t=>({enabled:t>0})}}})],Eo.prototype,"distance",void 0),E([k({type:Q0,json:{write:!0}})],Eo.prototype,"dynamicDataSource",void 0),E([k({type:String,json:{write:!0}})],Eo.prototype,"formatOf3DObjects",void 0),E([k({type:[C7t],json:{write:{enabled:!0,overridePolicy(){return{enabled:ye(this.fullText)&&this.fullText.length>0}}}}})],Eo.prototype,"fullText",void 0),E([k({type:String,json:{write:!0}})],Eo.prototype,"gdbVersion",void 0),E([k({types:P1,json:{read:fl,write:!0}})],Eo.prototype,"geometry",void 0),E([k({type:Number,json:{write:!0}})],Eo.prototype,"geometryPrecision",void 0),E([k({type:[String],json:{write:!0}})],Eo.prototype,"groupByFieldsForStatistics",void 0),E([k({type:String,json:{write:!0}})],Eo.prototype,"having",void 0),E([k({type:Date})],Eo.prototype,"historicMoment",void 0),E([mr("historicMoment")],Eo.prototype,"writeHistoricMoment",null),E([k({type:Number,json:{write:!0}})],Eo.prototype,"maxAllowableOffset",void 0),E([k({type:Number,cast:t=>t<1?1:t>G9.MAX_MAX_RECORD_COUNT_FACTOR?G9.MAX_MAX_RECORD_COUNT_FACTOR:t,json:{write:{overridePolicy:t=>({enabled:t>1})}}})],Eo.prototype,"maxRecordCountFactor",void 0),E([k({type:["xyFootprint"],json:{write:!0}})],Eo.prototype,"multipatchOption",void 0),E([k({type:Number,json:{read:{source:"resultRecordCount"}}})],Eo.prototype,"num",void 0),E([k({json:{write:!0}})],Eo.prototype,"objectIds",void 0),E([k({type:[String],json:{write:!0}})],Eo.prototype,"orderByFields",void 0),E([k({type:[String],json:{write:!0}})],Eo.prototype,"outFields",void 0),E([k({type:rr,json:{name:"outSR",write:!0}})],Eo.prototype,"outSpatialReference",void 0),E([k({type:[coe],json:{write:{enabled:!0,overridePolicy(){return{enabled:ye(this.outStatistics)&&this.outStatistics.length>0}}}}})],Eo.prototype,"outStatistics",void 0),E([k({json:{write:!0}})],Eo.prototype,"parameterValues",void 0),E([mr("parameterValues")],Eo.prototype,"writeParameterValues",null),E([k({type:Yi,json:{write:!0}})],Eo.prototype,"pixelSize",void 0),E([k({type:uWe,json:{write:!0}})],Eo.prototype,"quantizationParameters",void 0),E([k({type:[Object],json:{write:!0}})],Eo.prototype,"rangeValues",void 0),E([k({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:this.spatialRelationship==="relation"}}}}})],Eo.prototype,"relationParameter",void 0),E([k({type:String,json:{write:!0}})],Eo.prototype,"resultType",void 0),E([k({type:Boolean,json:{default:!1,write:!0}})],Eo.prototype,"returnCentroid",void 0),E([k({type:Boolean,json:{default:!1,write:!0}})],Eo.prototype,"returnDistinctValues",void 0),E([k({type:Boolean,json:{default:!0,write:!0}})],Eo.prototype,"returnExceededLimitFeatures",void 0),E([k({type:Boolean,json:{write:!0}})],Eo.prototype,"returnGeometry",void 0),E([k({type:Boolean,json:{default:!1,write:!0}})],Eo.prototype,"returnQueryGeometry",void 0),E([k({type:Boolean,json:{default:!1,write:!0}})],Eo.prototype,"returnM",void 0),E([k({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],Eo.prototype,"returnZ",void 0),E([k({type:rr,json:{write:!0}})],Eo.prototype,"sourceSpatialReference",void 0),E([Hr(T7t,{ignoreUnknown:!1,name:"spatialRel"})],Eo.prototype,"spatialRelationship",void 0),E([k({type:Number,json:{read:{source:"resultOffset"}}})],Eo.prototype,"start",void 0),E([mr("start"),mr("num")],Eo.prototype,"writeStart",null),E([k({type:String,json:{write:!0}})],Eo.prototype,"sqlFormat",void 0),E([k({type:String,json:{write:!0}})],Eo.prototype,"text",void 0),E([k({type:Wg,json:{write:!0}})],Eo.prototype,"timeExtent",void 0),E([k({type:Boolean,json:{default:!1,write:!0}})],Eo.prototype,"timeReferenceUnknownClient",void 0),E([Hr(E7t,{ignoreUnknown:!1}),k({json:{write:{overridePolicy(t){return{enabled:!!t&&this.distance!=null&&this.distance>0}}}}})],Eo.prototype,"units",void 0),E([k({type:String,json:{write:{overridePolicy(t){return{enabled:t!=null||this.start!=null&&this.start>0}}}}})],Eo.prototype,"where",void 0),E([mr("where")],Eo.prototype,"writeWhere",null),Eo=G9=E([ht("esri.rest.support.Query")],Eo);const Ss=Eo;var I2e;const A2e=new Bs({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),P2e=new Bs({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let ZC=I2e=class extends Ni{constructor(t){super(t),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(t={}){const{where:e,geometry:i,spatialRelationship:r,timeExtent:n,objectIds:s,units:o,distance:a}=this;return new Ss({geometry:hi(i),objectIds:hi(s),spatialRelationship:r,timeExtent:hi(n),where:e,units:o,distance:a,...t})}clone(){const{where:t,geometry:e,spatialRelationship:i,timeExtent:r,objectIds:n,units:s,distance:o}=this;return new I2e({geometry:hi(e),objectIds:hi(n),spatialRelationship:i,timeExtent:hi(r),where:t,units:s,distance:o})}};E([k({type:String,json:{write:!0}})],ZC.prototype,"where",void 0),E([k({types:P1,json:{write:!0}})],ZC.prototype,"geometry",void 0),E([k({type:A2e.apiValues,json:{name:"spatialRel",read:{reader:A2e.read},write:{allowNull:!1,writer:A2e.write,overridePolicy(){return{enabled:ye(this.geometry)}}}}})],ZC.prototype,"spatialRelationship",void 0),E([k({type:Number,json:{write:{overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],ZC.prototype,"distance",void 0),E([k({type:[Number],json:{write:!0}})],ZC.prototype,"objectIds",void 0),E([k({type:P2e.apiValues,json:{read:P2e.read,write:{writer:P2e.write,overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],ZC.prototype,"units",void 0),E([k({type:Wg,json:{write:!0}})],ZC.prototype,"timeExtent",void 0),ZC=I2e=E([ht("esri.layers.support.FeatureFilter")],ZC);const bq=ZC;var O2e;const hWe={read:{reader:p2e},write:{writer:f2e,overridePolicy(){return{allowNull:this.excludedEffect!=null,isRequired:this.excludedEffect==null}}}},dWe={read:{reader:p2e},write:{writer:f2e,overridePolicy(){return{allowNull:this.includedEffect!=null,isRequired:this.includedEffect==null}}}},pWe={name:"showExcludedLabels",default:!0};let y5=O2e=class extends Ni{constructor(t){super(t),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(t,e){const i=super.write(t,e);if(e?.origin){if(i.filter){const r=Object.keys(i.filter);if(r.length>1||r[0]!=="where")return e.messages?.push(new st("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 i)return e.messages?.push(new st("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:e.layer,effect:this})),null}return i}clone(){return new O2e({filter:ye(this.filter)?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};E([k({type:bq,json:{write:{allowNull:!0,writer(t,e,i,r){const n=t?.write({},r);n&&Object.keys(n).length!==0?Ep(i,n,e):Ep(i,null,e)}}}})],y5.prototype,"filter",void 0),E([k({json:{write:!0,origins:{"web-map":hWe,"portal-item":hWe}}})],y5.prototype,"includedEffect",void 0),E([k({json:{write:!0,origins:{"web-map":dWe,"portal-item":dWe}}})],y5.prototype,"excludedEffect",void 0),E([k({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":pWe,"portal-item":pWe}}})],y5.prototype,"excludedLabelsVisible",void 0),y5=O2e=E([ht("esri.layers.support.FeatureEffect")],y5);const fWe=y5,mWe={write:{allowNull:!0}},wq=t=>{let e=class extends t{constructor(){super(...arguments),this.featureEffect=null}};return E([k({type:fWe,json:{origins:{"web-map":mWe,"portal-item":mWe}}})],e.prototype,"featureEffect",void 0),e=E([ht("esri.layers.mixins.FeatureEffectLayer")],e),e};var xq;const hoe=jo()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),gWe=hoe.jsonValues.slice();iGe(gWe,"orthometric");const Sq=jo()({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 w2=xq=class extends Ni{constructor(t){super(t),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(t,e,i){return hoe.write(t,e,i)}readHeightModel(t,e,i){return hoe.read(t)||(i&&i.messages&&i.messages.push(I7t(t,{context:i})),null)}readHeightUnit(t,e,i){return Sq.read(t)||(i&&i.messages&&i.messages.push(yWe(t,{context:i})),null)}readHeightUnitService(t,e,i){return eUe(t)||Sq.read(t)||(i&&i.messages&&i.messages.push(yWe(t,{context:i})),null)}readVertCRS(t,e){return e.vertCRS||e.ellipsoid||e.geoid}clone(){return new xq({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(t){return!!t&&(this===t||this.heightModel===t.heightModel&&this.heightUnit===t.heightUnit&&this.vertCRS===t.vertCRS)}static deriveUnitFromSR(t,e){const i=h$t(e);return new xq({heightModel:t.heightModel,heightUnit:i,vertCRS:t.vertCRS})}write(t,e){return e={origin:"web-scene",...e},super.write(t,e)}static fromJSON(t){if(!t)return null;const e=new xq;return e.read(t,{origin:"web-scene"}),e}};function yWe(t,e){return new wm("height-unit:unsupported",`Height unit of value '${t}' is not supported`,e)}function I7t(t,e){return new wm("height-model:unsupported",`Height model of value '${t}' is not supported`,e)}E([k({type:hoe.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:gWe,default:"ellipsoidal"}}}})],w2.prototype,"heightModel",void 0),E([mr("web-scene","heightModel")],w2.prototype,"writeHeightModel",null),E([Li(["web-scene","service"],"heightModel")],w2.prototype,"readHeightModel",null),E([k({type:Sq.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:Sq.jsonValues,write:Sq.write}}}})],w2.prototype,"heightUnit",void 0),E([Li("web-scene","heightUnit")],w2.prototype,"readHeightUnit",null),E([Li("service","heightUnit")],w2.prototype,"readHeightUnitService",null),E([k({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],w2.prototype,"vertCRS",void 0),E([Li("service","vertCRS",["vertCRS","ellipsoid","geoid"])],w2.prototype,"readVertCRS",null),w2=xq=E([ht("esri.geometry.HeightModelInfo")],w2);const V9=w2;function A7t(t){if(!t)return t;const{start:e,end:i}=t;return new Wg({start:ye(e)?p5(e,-e.getTimezoneOffset(),"minutes"):e,end:ye(i)?p5(i,-i.getTimezoneOffset(),"minutes"):i})}function P7t(t){if(!t)return t;const{start:e,end:i}=t;return new Wg({start:ye(e)?p5(e,e.getTimezoneOffset(),"minutes"):e,end:ye(i)?p5(i,i.getTimezoneOffset(),"minutes"):i})}var R2e;let Cq=R2e=class extends Ni{constructor(t){super(t)}async collectRequiredFields(t,e){return K0(t,e,this.expression)}clone(){return new R2e({expression:this.expression,title:this.title})}equals(t){return this.expression===t.expression&&this.title===t.title}};E([k({type:String,json:{write:!0}})],Cq.prototype,"expression",void 0),E([k({type:String,json:{write:!0}})],Cq.prototype,"title",void 0),Cq=R2e=E([ht("esri.layers.support.FeatureExpressionInfo")],Cq);const vWe=Cq;function O7t(t){return 1/(XW[t]||1)}function R7t(){const t=Object.keys(XW);return t.sort(),t}const M7t=R7t();var M2e;const doe=jo()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),_We=new Bs({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let IA=M2e=class extends Ni{constructor(t){super(t),this.offset=null}readFeatureExpressionInfo(t,e){return t??(e.featureExpression&&e.featureExpression.value===0?{expression:"0"}:void 0)}writeFeatureExpressionInfo(t,e,i,r){e[i]=t.write({},r),t.expression==="0"&&(e.featureExpression={value:0})}get mode(){const{offset:t,featureExpressionInfo:e}=this;return this._isOverridden("mode")?this._get("mode"):ye(t)||e?"relative-to-ground":"on-the-ground"}set mode(t){this._override("mode",t)}set unit(t){this._set("unit",t)}write(t,e){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(t,e):null}clone(){return new M2e({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(t){return this.mode===t.mode&&this.offset===t.offset&&this.unit===t.unit&&yH(this.featureExpressionInfo,t.featureExpressionInfo)}};E([k({type:vWe,json:{write:!0}})],IA.prototype,"featureExpressionInfo",void 0),E([Li("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],IA.prototype,"readFeatureExpressionInfo",null),E([mr("featureExpressionInfo",{featureExpressionInfo:{type:vWe},"featureExpression.value":{type:[0]}})],IA.prototype,"writeFeatureExpressionInfo",null),E([k({type:doe.apiValues,nonNullable:!0,json:{type:doe.jsonValues,read:doe.read,write:{writer:doe.write,isRequired:!0}}})],IA.prototype,"mode",null),E([k({type:Number,json:{write:!0}})],IA.prototype,"offset",void 0),E([k({type:M7t,json:{type:String,read:_We.read,write:_We.write}})],IA.prototype,"unit",null),IA=M2e=E([ht("esri.layers.support.ElevationInfo")],IA);const v5=IA,U9={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:!0}},t_={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(t,e)=>!e.disablePopup},write:{enabled:!0,writer(t,e,i){e[i]=!t}}}},AA={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:!0}},Zy={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:dA}}},N1={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:!0}},FR={value:null,type:v5,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:!0}};function D2e(t){return{type:t,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const bWe={write:!0,read:!0},Tq={type:Number,json:{origins:{"web-document":bWe,"portal-item":{write:!0}}}},wWe={...Tq,json:{...Tq.json,origins:{"web-document":{...bWe,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(t,e,i)=>i&&i.origin!=="service"||!e.drawingInfo||e.drawingInfo.transparency===void 0?e.layerDefinition&&e.layerDefinition.drawingInfo&&e.layerDefinition.drawingInfo.transparency!==void 0?p9(e.layerDefinition.drawingInfo.transparency):void 0:p9(e.drawingInfo.transparency)}}},j9={type:Wg,readOnly:!0,get(){if(!this.layer?.timeInfo)return null;const{datesInUnknownTimezone:t,timeOffset:e,useViewTime:i}=this.layer,r=this.view?.timeExtent;let n=this.layer.timeExtent;t&&(n=P7t(n));let s=i?r&&n?r.intersection(n):r||n:n;if(!s||s.isEmpty||s.isAllTime)return s;e&&(s=s.offset(-e.value,e.unit)),t&&(s=A7t(s));const o=this._get("timeExtent");return s.equals(o)?o:s}},D7t={type:vr,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(t,e)=>{const i=vr.fromJSON(t);return e.spatialReference!=null&&typeof e.spatialReference=="object"&&(i.spatialReference=rr.fromJSON(e.spatialReference)),i}}}},read:!1}},z9={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},F2e={type:Number,json:{origins:{service:{write:{enabled:!1}}},read:{source:"layerDefinition.minScale"},write:{target:"layerDefinition.minScale"}}},L2e={type:Number,json:{origins:{service:{write:{enabled:!1}}},read:{source:"layerDefinition.maxScale"},write:{target:"layerDefinition.maxScale"}}},xWe={json:{write:{ignoreOrigin:!0},origins:{"web-map":{read:!1,write:!1}}}},SWe=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/Chihuahua"],["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 _5 extends Error{}class F7t extends _5{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class L7t extends _5{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class k7t extends _5{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Eq extends _5{}class CWe extends _5{constructor(e){super(`Invalid unit ${e}`)}}class nw extends _5{}class LR extends _5{constructor(){super("Zone is an abstract class")}}const rs="numeric",x2="short",$1="long",poe={year:rs,month:rs,day:rs},TWe={year:rs,month:x2,day:rs},N7t={year:rs,month:x2,day:rs,weekday:x2},EWe={year:rs,month:$1,day:rs},IWe={year:rs,month:$1,day:rs,weekday:$1},AWe={hour:rs,minute:rs},PWe={hour:rs,minute:rs,second:rs},OWe={hour:rs,minute:rs,second:rs,timeZoneName:x2},RWe={hour:rs,minute:rs,second:rs,timeZoneName:$1},MWe={hour:rs,minute:rs,hourCycle:"h23"},DWe={hour:rs,minute:rs,second:rs,hourCycle:"h23"},FWe={hour:rs,minute:rs,second:rs,hourCycle:"h23",timeZoneName:x2},LWe={hour:rs,minute:rs,second:rs,hourCycle:"h23",timeZoneName:$1},kWe={year:rs,month:rs,day:rs,hour:rs,minute:rs},NWe={year:rs,month:rs,day:rs,hour:rs,minute:rs,second:rs},$We={year:rs,month:x2,day:rs,hour:rs,minute:rs},BWe={year:rs,month:x2,day:rs,hour:rs,minute:rs,second:rs},$7t={year:rs,month:x2,day:rs,weekday:x2,hour:rs,minute:rs},GWe={year:rs,month:$1,day:rs,hour:rs,minute:rs,timeZoneName:x2},VWe={year:rs,month:$1,day:rs,hour:rs,minute:rs,second:rs,timeZoneName:x2},UWe={year:rs,month:$1,day:rs,weekday:$1,hour:rs,minute:rs,timeZoneName:$1},jWe={year:rs,month:$1,day:rs,weekday:$1,hour:rs,minute:rs,second:rs,timeZoneName:$1};class H9{get type(){throw new LR}get name(){throw new LR}get ianaName(){return this.name}get isUniversal(){throw new LR}offsetName(e,i){throw new LR}formatOffset(e,i){throw new LR}offset(e){throw new LR}equals(e){throw new LR}get isValid(){throw new LR}}let k2e=null;class foe extends H9{static get instance(){return k2e===null&&(k2e=new foe),k2e}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:i,locale:r}){return eqe(e,i,r)}formatOffset(e,i){return Oq(this.offset(e),i)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let moe={};function B7t(t){return moe[t]||(moe[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),moe[t]}const G7t={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function V7t(t,e){const i=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(i),[,n,s,o,a,l,c,d]=r;return[o,n,s,a,l,c,d]}function U7t(t,e){const i=t.formatToParts(e),r=[];for(let n=0;n=0?S:1e3+S,(y-v)/6e4}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let zWe={};function j7t(t,e={}){const i=JSON.stringify([t,e]);let r=zWe[i];return r||(r=new Intl.ListFormat(t,e),zWe[i]=r),r}let N2e={};function $2e(t,e={}){const i=JSON.stringify([t,e]);let r=N2e[i];return r||(r=new Intl.DateTimeFormat(t,e),N2e[i]=r),r}let B2e={};function z7t(t,e={}){const i=JSON.stringify([t,e]);let r=B2e[i];return r||(r=new Intl.NumberFormat(t,e),B2e[i]=r),r}let G2e={};function H7t(t,e={}){const{base:i,...r}=e,n=JSON.stringify([t,r]);let s=G2e[n];return s||(s=new Intl.RelativeTimeFormat(t,e),G2e[n]=s),s}let Iq=null;function W7t(){return Iq||(Iq=new Intl.DateTimeFormat().resolvedOptions().locale,Iq)}function q7t(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const i=t.indexOf("-u-");if(i===-1)return[t];{let r,n;try{r=$2e(t).resolvedOptions(),n=t}catch{const l=t.substring(0,i);r=$2e(l).resolvedOptions(),n=l}const{numberingSystem:s,calendar:o}=r;return[n,s,o]}}function Y7t(t,e,i){return(i||e)&&(t.includes("-u-")||(t+="-u"),i&&(t+=`-ca-${i}`),e&&(t+=`-nu-${e}`)),t}function X7t(t){const e=[];for(let i=1;i<=12;i++){const r=zs.utc(2016,i,1);e.push(t(r))}return e}function K7t(t){const e=[];for(let i=1;i<=7;i++){const r=zs.utc(2016,11,13+i);e.push(t(r))}return e}function yoe(t,e,i,r,n){const s=t.listingMode(i);return s==="error"?null:s==="en"?r(e):n(e)}function J7t(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class Z7t{constructor(e,i,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:n,floor:s,...o}=r;if(!i||Object.keys(o).length>0){const a={useGrouping:!1,...r};r.padTo>0&&(a.minimumIntegerDigits=r.padTo),this.inf=z7t(e,a)}}format(e){if(this.inf){const i=this.floor?Math.floor(e):e;return this.inf.format(i)}else{const i=this.floor?Math.floor(e):j2e(e,3);return Nf(i,this.padTo)}}}class Q7t{constructor(e,i,r){this.opts=r;let n;if(e.zone.isUniversal){const o=-1*(e.offset/60),a=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&S2.create(a).valid?(n=a,this.dt=e):(n="UTC",r.timeZoneName?this.dt=e:this.dt=e.offset===0?e:zs.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,n=e.zone.name);const s={...this.opts};s.timeZone=s.timeZone||n,this.dtf=$2e(i,s)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class ezt{constructor(e,i,r){this.opts={style:"long",...r},!i&&ZWe()&&(this.rtf=H7t(e,r))}format(e,i){return this.rtf?this.rtf.format(e,i):yzt(i,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,i){return this.rtf?this.rtf.formatToParts(e,i):[]}}class _d{static fromOpts(e){return _d.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,i,r,n=!1){const s=e||kf.defaultLocale,o=s||(n?"en-US":W7t()),a=i||kf.defaultNumberingSystem,l=r||kf.defaultOutputCalendar;return new _d(o,a,l,s)}static resetCache(){Iq=null,N2e={},B2e={},G2e={}}static fromObject({locale:e,numberingSystem:i,outputCalendar:r}={}){return _d.create(e,i,r)}constructor(e,i,r,n){const[s,o,a]=q7t(e);this.locale=s,this.numberingSystem=i||o||null,this.outputCalendar=r||a||null,this.intl=Y7t(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=J7t(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),i=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&i?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:_d.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,i=!1,r=!0){return yoe(this,e,r,rqe,()=>{const n=i?{month:e,day:"numeric"}:{month:e},s=i?"format":"standalone";return this.monthsCache[s][e]||(this.monthsCache[s][e]=X7t(o=>this.extract(o,n,"month"))),this.monthsCache[s][e]})}weekdays(e,i=!1,r=!0){return yoe(this,e,r,oqe,()=>{const n=i?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=i?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=K7t(o=>this.extract(o,n,"weekday"))),this.weekdaysCache[s][e]})}meridiems(e=!0){return yoe(this,void 0,e,()=>aqe,()=>{if(!this.meridiemCache){const i={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[zs.utc(2016,11,13,9),zs.utc(2016,11,13,19)].map(r=>this.extract(r,i,"dayperiod"))}return this.meridiemCache})}eras(e,i=!0){return yoe(this,e,i,lqe,()=>{const r={era:e};return this.eraCache[e]||(this.eraCache[e]=[zs.utc(-40,1,1),zs.utc(2017,1,1)].map(n=>this.extract(n,r,"era"))),this.eraCache[e]})}extract(e,i,r){const n=this.dtFormatter(e,i),s=n.formatToParts(),o=s.find(a=>a.type.toLowerCase()===r);return o?o.value:null}numberFormatter(e={}){return new Z7t(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,i={}){return new Q7t(e,this.intl,i)}relFormatter(e={}){return new ezt(this.intl,this.isEnglish(),e)}listFormatter(e={}){return j7t(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let V2e=null;class qg extends H9{static get utcInstance(){return V2e===null&&(V2e=new qg(0)),V2e}static instance(e){return e===0?qg.utcInstance:new qg(e)}static parseSpecifier(e){if(e){const i=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(i)return new qg(woe(i[1],i[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Oq(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Oq(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,i){return Oq(this.fixed,i)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class tzt extends H9{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 kR(t,e){if(Bu(t)||t===null)return e;if(t instanceof H9)return t;if(izt(t)){const i=t.toLowerCase();return i==="default"?e:i==="local"||i==="system"?foe.instance:i==="utc"||i==="gmt"?qg.utcInstance:qg.parseSpecifier(i)||S2.create(t)}else return b5(t)?qg.instance(t):typeof t=="object"&&t.offset&&typeof t.offset=="number"?t:new tzt(t)}let HWe=()=>Date.now(),WWe="system",qWe=null,YWe=null,XWe=null,KWe=60,JWe;class kf{static get now(){return HWe}static set now(e){HWe=e}static set defaultZone(e){WWe=e}static get defaultZone(){return kR(WWe,foe.instance)}static get defaultLocale(){return qWe}static set defaultLocale(e){qWe=e}static get defaultNumberingSystem(){return YWe}static set defaultNumberingSystem(e){YWe=e}static get defaultOutputCalendar(){return XWe}static set defaultOutputCalendar(e){XWe=e}static get twoDigitCutoffYear(){return KWe}static set twoDigitCutoffYear(e){KWe=e%100}static get throwOnInvalid(){return JWe}static set throwOnInvalid(e){JWe=e}static resetCaches(){_d.resetCache(),S2.resetCache()}}function Bu(t){return typeof t>"u"}function b5(t){return typeof t=="number"}function voe(t){return typeof t=="number"&&t%1===0}function izt(t){return typeof t=="string"}function rzt(t){return Object.prototype.toString.call(t)==="[object Date]"}function ZWe(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function nzt(t){return Array.isArray(t)?t:[t]}function QWe(t,e,i){if(t.length!==0)return t.reduce((r,n)=>{const s=[e(n),n];return r&&i(r[0],s[0])===r[0]?r:s},null)[1]}function szt(t,e){return e.reduce((i,r)=>(i[r]=t[r],i),{})}function W9(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function PA(t,e,i){return voe(t)&&t>=e&&t<=i}function ozt(t,e){return t-e*Math.floor(t/e)}function Nf(t,e=2){const i=t<0;let r;return i?r="-"+(""+-t).padStart(e,"0"):r=(""+t).padStart(e,"0"),r}function NR(t){if(!(Bu(t)||t===null||t===""))return parseInt(t,10)}function w5(t){if(!(Bu(t)||t===null||t===""))return parseFloat(t)}function U2e(t){if(!(Bu(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function j2e(t,e,i=!1){const r=10**e;return(i?Math.trunc:Math.round)(t*r)/r}function Aq(t){return t%4===0&&(t%100!==0||t%400===0)}function Pq(t){return Aq(t)?366:365}function _oe(t,e){const i=ozt(e-1,12)+1,r=t+(e-i)/12;return i===2?Aq(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][i-1]}function z2e(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function boe(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,i=t-1,r=(i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400))%7;return e===4||r===3?53:52}function H2e(t){return t>99?t:t>kf.twoDigitCutoffYear?1900+t:2e3+t}function eqe(t,e,i,r=null){const n=new Date(t),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(i,o).formatToParts(n).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function woe(t,e){let i=parseInt(t,10);Number.isNaN(i)&&(i=0);const r=parseInt(e,10)||0,n=i<0||Object.is(i,-0)?-r:r;return i*60+n}function tqe(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new nw(`Invalid unit value ${t}`);return e}function xoe(t,e){const i={};for(const r in t)if(W9(t,r)){const n=t[r];if(n==null)continue;i[e(r)]=tqe(n)}return i}function Oq(t,e){const i=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),n=t>=0?"+":"-";switch(e){case"short":return`${n}${Nf(i,2)}:${Nf(r,2)}`;case"narrow":return`${n}${i}${r>0?`:${r}`:""}`;case"techie":return`${n}${Nf(i,2)}${Nf(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Soe(t){return szt(t,["hour","minute","second","millisecond"])}const azt=["January","February","March","April","May","June","July","August","September","October","November","December"],iqe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],lzt=["J","F","M","A","M","J","J","A","S","O","N","D"];function rqe(t){switch(t){case"narrow":return[...lzt];case"short":return[...iqe];case"long":return[...azt];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 nqe=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],sqe=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],uzt=["M","T","W","T","F","S","S"];function oqe(t){switch(t){case"narrow":return[...uzt];case"short":return[...sqe];case"long":return[...nqe];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const aqe=["AM","PM"],czt=["Before Christ","Anno Domini"],hzt=["BC","AD"],dzt=["B","A"];function lqe(t){switch(t){case"narrow":return[...dzt];case"short":return[...hzt];case"long":return[...czt];default:return null}}function pzt(t){return aqe[t.hour<12?0:1]}function fzt(t,e){return oqe(e)[t.weekday-1]}function mzt(t,e){return rqe(e)[t.month-1]}function gzt(t,e){return lqe(e)[t.year<0?0:1]}function yzt(t,e,i="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(t)===-1;if(i==="auto"&&s){const p=t==="days";switch(e){case 1:return p?"tomorrow":`next ${n[t][0]}`;case-1:return p?"yesterday":`last ${n[t][0]}`;case 0:return p?"today":`this ${n[t][0]}`}}const o=Object.is(e,-0)||e<0,a=Math.abs(e),l=a===1,c=n[t],d=r?l?c[1]:c[2]||c[1]:l?n[t][0]:t;return o?`${a} ${d} ago`:`in ${a} ${d}`}function uqe(t,e){let i="";for(const r of t)r.literal?i+=r.val:i+=e(r.val);return i}const vzt={D:poe,DD:TWe,DDD:EWe,DDDD:IWe,t:AWe,tt:PWe,ttt:OWe,tttt:RWe,T:MWe,TT:DWe,TTT:FWe,TTTT:LWe,f:kWe,ff:$We,fff:GWe,ffff:UWe,F:NWe,FF:BWe,FFF:VWe,FFFF:jWe};class Qy{static create(e,i={}){return new Qy(e,i)}static parseFormat(e){let i=null,r="",n=!1;const s=[];for(let o=0;o0&&s.push({literal:n,val:r}),i=null,r="",n=!n):n||a===i?r+=a:(r.length>0&&s.push({literal:!1,val:r}),r=a,i=a)}return r.length>0&&s.push({literal:n,val:r}),s}static macroTokenToFormatOpts(e){return vzt[e]}constructor(e,i){this.opts=i,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,i){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...i}).format()}formatDateTime(e,i={}){return this.loc.dtFormatter(e,{...this.opts,...i}).format()}formatDateTimeParts(e,i={}){return this.loc.dtFormatter(e,{...this.opts,...i}).formatToParts()}formatInterval(e,i={}){return this.loc.dtFormatter(e.start,{...this.opts,...i}).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,i={}){return this.loc.dtFormatter(e,{...this.opts,...i}).resolvedOptions()}num(e,i=0){if(this.opts.forceSimple)return Nf(e,i);const r={...this.opts};return i>0&&(r.padTo=i),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,i){const r=this.loc.listingMode()==="en",n=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(v,S)=>this.loc.extract(e,v,S),o=v=>e.isOffsetFixed&&e.offset===0&&v.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,v.format):"",a=()=>r?pzt(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(v,S)=>r?mzt(e,v):s(S?{month:v}:{month:v,day:"numeric"},"month"),c=(v,S)=>r?fzt(e,v):s(S?{weekday:v}:{weekday:v,month:"long",day:"numeric"},"weekday"),d=v=>{const S=Qy.macroTokenToFormatOpts(v);return S?this.formatWithSystemDefault(e,S):v},p=v=>r?gzt(e,v):s({era:v},"era"),y=v=>{switch(v){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 c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("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 p("short");case"GG":return p("long");case"GGGGG":return p("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"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 d(v)}};return uqe(Qy.parseFormat(i),y)}formatDurationFromString(e,i){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=>c=>{const d=r(c);return d?this.num(l.get(d),c.length):c},s=Qy.parseFormat(i),o=s.reduce((l,{literal:c,val:d})=>c?l:l.concat(d),[]),a=e.shiftTo(...o.map(r).filter(l=>l));return uqe(s,n(a))}}class C2{constructor(e,i){this.reason=e,this.explanation=i}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const cqe=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function q9(...t){const e=t.reduce((i,r)=>i+r.source,"");return RegExp(`^${e}$`)}function Y9(...t){return e=>t.reduce(([i,r,n],s)=>{const[o,a,l]=s(e,n);return[{...i,...o},a||r,l]},[{},null,1]).slice(0,2)}function X9(t,...e){if(t==null)return[null,null];for(const[i,r]of e){const n=i.exec(t);if(n)return r(n)}return[null,null]}function hqe(...t){return(e,i)=>{const r={};let n;for(n=0;nv!==void 0&&(S||v&&d)?-v:v;return[{years:y(w5(i)),months:y(w5(r)),weeks:y(w5(n)),days:y(w5(s)),hours:y(w5(o)),minutes:y(w5(a)),seconds:y(w5(l),l==="-0"),milliseconds:y(U2e(c),p)}]}const Rzt={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 Y2e(t,e,i,r,n,s,o){const a={year:e.length===2?H2e(NR(e)):NR(e),month:iqe.indexOf(i)+1,day:NR(r),hour:NR(n),minute:NR(s)};return o&&(a.second=NR(o)),t&&(a.weekday=t.length>3?nqe.indexOf(t)+1:sqe.indexOf(t)+1),a}const Mzt=/^(?:(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 Dzt(t){const[,e,i,r,n,s,o,a,l,c,d,p]=t,y=Y2e(e,n,r,i,s,o,a);let v;return l?v=Rzt[l]:c?v=0:v=woe(d,p),[y,new qg(v)]}function Fzt(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Lzt=/^(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$/,kzt=/^(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$/,Nzt=/^(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 mqe(t){const[,e,i,r,n,s,o,a]=t;return[Y2e(e,n,r,i,s,o,a),qg.utcInstance]}function $zt(t){const[,e,i,r,n,s,o,a]=t;return[Y2e(e,a,i,r,n,s,o),qg.utcInstance]}const Bzt=q9(bzt,q2e),Gzt=q9(wzt,q2e),Vzt=q9(xzt,q2e),Uzt=q9(pqe),gqe=Y9(Izt,J9,Rq,Mq),jzt=Y9(Szt,J9,Rq,Mq),zzt=Y9(Czt,J9,Rq,Mq),Hzt=Y9(J9,Rq,Mq);function Wzt(t){return X9(t,[Bzt,gqe],[Gzt,jzt],[Vzt,zzt],[Uzt,Hzt])}function qzt(t){return X9(Fzt(t),[Mzt,Dzt])}function Yzt(t){return X9(t,[Lzt,mqe],[kzt,mqe],[Nzt,$zt])}function Xzt(t){return X9(t,[Pzt,Ozt])}const Kzt=Y9(J9);function Jzt(t){return X9(t,[Azt,Kzt])}const Zzt=q9(Tzt,Ezt),Qzt=q9(fqe),eHt=Y9(J9,Rq,Mq);function tHt(t){return X9(t,[Zzt,gqe],[Qzt,eHt])}const iHt="Invalid Duration",yqe={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}},rHt={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},...yqe},sw=146097/400,Z9=146097/4800,nHt={years:{quarters:4,months:12,weeks:sw/7,days:sw,hours:sw*24,minutes:sw*24*60,seconds:sw*24*60*60,milliseconds:sw*24*60*60*1e3},quarters:{months:3,weeks:sw/28,days:sw/4,hours:sw*24/4,minutes:sw*24*60/4,seconds:sw*24*60*60/4,milliseconds:sw*24*60*60*1e3/4},months:{weeks:Z9/7,days:Z9,hours:Z9*24,minutes:Z9*24*60,seconds:Z9*24*60*60,milliseconds:Z9*24*60*60*1e3},...yqe},x5=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],sHt=x5.slice(0).reverse();function $R(t,e,i=!1){const r={values:i?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new qu(r)}function oHt(t){return t<0?Math.floor(t):Math.ceil(t)}function vqe(t,e,i,r,n){const s=t[n][i],o=e[i]/s,a=Math.sign(o)===Math.sign(r[n]),l=!a&&r[n]!==0&&Math.abs(o)<=1?oHt(o):Math.trunc(o);r[n]+=l,e[i]-=l*s}function aHt(t,e){sHt.reduce((i,r)=>Bu(e[r])?i:(i&&vqe(t,e,i,e,r),r),null)}function lHt(t){const e={};for(const[i,r]of Object.entries(t))r!==0&&(e[i]=r);return e}class qu{constructor(e){const i=e.conversionAccuracy==="longterm"||!1;let r=i?nHt:rHt;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||_d.create(),this.conversionAccuracy=i?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,i){return qu.fromObject({milliseconds:e},i)}static fromObject(e,i={}){if(e==null||typeof e!="object")throw new nw(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new qu({values:xoe(e,qu.normalizeUnit),loc:_d.fromObject(i),conversionAccuracy:i.conversionAccuracy,matrix:i.matrix})}static fromDurationLike(e){if(b5(e))return qu.fromMillis(e);if(qu.isDuration(e))return e;if(typeof e=="object")return qu.fromObject(e);throw new nw(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,i){const[r]=Xzt(e);return r?qu.fromObject(r,i):qu.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,i){const[r]=Jzt(e);return r?qu.fromObject(r,i):qu.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,i=null){if(!e)throw new nw("need to specify a reason the Duration is invalid");const r=e instanceof C2?e:new C2(e,i);if(kf.throwOnInvalid)throw new k7t(r);return new qu({invalid:r})}static normalizeUnit(e){const i={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(!i)throw new CWe(e);return i}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,i={}){const r={...i,floor:i.round!==!1&&i.floor!==!1};return this.isValid?Qy.create(this.loc,r).formatDurationFromString(this,e):iHt}toHuman(e={}){const i=x5.map(r=>{const n=this.values[r];return Bu(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(i)}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+=j2e(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const i=this.toMillis();if(i<0||i>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const r=this.shiftTo("hours","minutes","seconds","milliseconds");let n=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(n+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||r.milliseconds!==0)&&(n+=".SSS"));let s=r.toFormat(n);return e.includePrefix&&(s="T"+s),s}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const i=qu.fromDurationLike(e),r={};for(const n of x5)(W9(i.values,n)||W9(this.values,n))&&(r[n]=i.get(n)+this.get(n));return $R(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const i=qu.fromDurationLike(e);return this.plus(i.negate())}mapUnits(e){if(!this.isValid)return this;const i={};for(const r of Object.keys(this.values))i[r]=tqe(e(this.values[r],r));return $R(this,{values:i},!0)}get(e){return this[qu.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const i={...this.values,...xoe(e,qu.normalizeUnit)};return $R(this,{values:i})}reconfigure({locale:e,numberingSystem:i,conversionAccuracy:r,matrix:n}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:i}),matrix:n,conversionAccuracy:r};return $R(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return aHt(this.matrix,e),$R(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=lHt(this.normalize().shiftToAll().toObject());return $R(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>qu.normalizeUnit(o));const i={},r={},n=this.toObject();let s;for(const o of x5)if(e.indexOf(o)>=0){s=o;let a=0;for(const c in r)a+=this.matrix[c][o]*r[c],r[c]=0;b5(n[o])&&(a+=n[o]);const l=Math.trunc(a);i[o]=l,r[o]=(a*1e3-l*1e3)/1e3;for(const c in n)x5.indexOf(c)>x5.indexOf(o)&&vqe(this.matrix,n,c,i,o)}else b5(n[o])&&(r[o]=n[o]);for(const o in r)r[o]!==0&&(i[s]+=o===s?r[o]:r[o]/this.matrix[s][o]);return $R(this,{values:i},!0).normalize()}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 i of Object.keys(this.values))e[i]=this.values[i]===0?0:-this.values[i];return $R(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 i(r,n){return r===void 0||r===0?n===void 0||n===0:r===n}for(const r of x5)if(!i(this.values[r],e.values[r]))return!1;return!0}}const Q9="Invalid Interval";function uHt(t,e){return!t||!t.isValid?Ap.invalid("missing or invalid start"):!e||!e.isValid?Ap.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:i}={}){return this.isValid?Ap.fromDateTimes(e||this.s,i||this.e):this}splitAt(...e){if(!this.isValid)return[];const i=e.map(Lq).filter(o=>this.contains(o)).sort(),r=[];let{s:n}=this,s=0;for(;n+this.e?this.e:o;r.push(Ap.fromDateTimes(n,a)),n=a,s+=1}return r}splitBy(e){const i=qu.fromDurationLike(e);if(!this.isValid||!i.isValid||i.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(Ap.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 i=this.s>e.s?this.s:e.s,r=this.e=r?null:Ap.fromDateTimes(i,r)}union(e){if(!this.isValid)return this;const i=this.se.e?this.e:e.e;return Ap.fromDateTimes(i,r)}static merge(e){const[i,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&&i.push(r),i}static xor(e){let i=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,c)=>l.time-c.time);for(const l of a)r+=l.type==="s"?1:-1,r===1?i=l.time:(i&&+i!=+l.time&&n.push(Ap.fromDateTimes(i,l.time)),i=null);return Ap.merge(n)}difference(...e){return Ap.xor([this].concat(e)).map(i=>this.intersection(i)).filter(i=>i&&!i.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Q9}toLocaleString(e=poe,i={}){return this.isValid?Qy.create(this.s.loc.clone(i),e).formatInterval(this):Q9}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Q9}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Q9}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Q9}toFormat(e,{separator:i=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${i}${this.e.toFormat(e)}`:Q9}toDuration(e,i){return this.isValid?this.e.diff(this.s,e,i):qu.invalid(this.invalidReason)}mapEndpoints(e){return Ap.fromDateTimes(e(this.s),e(this.e))}}class Coe{static hasDST(e=kf.defaultZone){const i=zs.now().setZone(e).set({month:12});return!e.isUniversal&&i.offset!==i.set({month:6}).offset}static isValidIANAZone(e){return S2.isValidZone(e)}static normalizeZone(e){return kR(e,kf.defaultZone)}static months(e="long",{locale:i=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||_d.create(i,r,s)).months(e)}static monthsFormat(e="long",{locale:i=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||_d.create(i,r,s)).months(e,!0)}static weekdays(e="long",{locale:i=null,numberingSystem:r=null,locObj:n=null}={}){return(n||_d.create(i,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:i=null,numberingSystem:r=null,locObj:n=null}={}){return(n||_d.create(i,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return _d.create(e).meridiems()}static eras(e="short",{locale:i=null}={}){return _d.create(i,null,"gregory").eras(e)}static features(){return{relative:ZWe()}}}function _qe(t,e){const i=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=i(e)-i(t);return Math.floor(qu.fromMillis(r).as("days"))}function cHt(t,e,i){const r=[["years",(l,c)=>c.year-l.year],["quarters",(l,c)=>c.quarter-l.quarter+(c.year-l.year)*4],["months",(l,c)=>c.month-l.month+(c.year-l.year)*12],["weeks",(l,c)=>{const d=_qe(l,c);return(d-d%7)/7}],["days",_qe]],n={},s=t;let o,a;for(const[l,c]of r)i.indexOf(l)>=0&&(o=l,n[l]=c(t,e),a=s.plus(n),a>e?(n[l]--,t=s.plus(n)):t=a);return[t,n,a,o]}function hHt(t,e,i,r){let[n,s,o,a]=cHt(t,e,i);const l=e-n,c=i.filter(p=>["hours","minutes","seconds","milliseconds"].indexOf(p)>=0);c.length===0&&(o0?qu.fromMillis(l,r).shiftTo(...c).plus(d):d}const X2e={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},bqe={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]},dHt=X2e.hanidec.replace(/[\[|\]]/g,"").split("");function pHt(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let i=0;i=s&&r<=o&&(e+=r-s)}}return parseInt(e,10)}else return e}function T2({numberingSystem:t},e=""){return new RegExp(`${X2e[t||"latn"]}${e}`)}const fHt="missing Intl.DateTimeFormat.formatToParts support";function wc(t,e=i=>i){return{regex:t,deser:([i])=>e(pHt(i))}}const wqe=`[ ${String.fromCharCode(160)}]`,xqe=new RegExp(wqe,"g");function mHt(t){return t.replace(/\./g,"\\.?").replace(xqe,wqe)}function Sqe(t){return t.replace(/\./g,"").replace(xqe," ").toLowerCase()}function E2(t,e){return t===null?null:{regex:RegExp(t.map(mHt).join("|")),deser:([i])=>t.findIndex(r=>Sqe(i)===Sqe(r))+e}}function Cqe(t,e){return{regex:t,deser:([,i,r])=>woe(i,r),groups:e}}function K2e(t){return{regex:t,deser:([e])=>e}}function gHt(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function yHt(t,e){const i=T2(e),r=T2(e,"{2}"),n=T2(e,"{3}"),s=T2(e,"{4}"),o=T2(e,"{6}"),a=T2(e,"{1,2}"),l=T2(e,"{1,3}"),c=T2(e,"{1,6}"),d=T2(e,"{1,9}"),p=T2(e,"{2,4}"),y=T2(e,"{4,6}"),v=O=>({regex:RegExp(gHt(O.val)),deser:([L])=>L,literal:!0}),I=(O=>{if(t.literal)return v(O);switch(O.val){case"G":return E2(e.eras("short",!1),0);case"GG":return E2(e.eras("long",!1),0);case"y":return wc(c);case"yy":return wc(p,H2e);case"yyyy":return wc(s);case"yyyyy":return wc(y);case"yyyyyy":return wc(o);case"M":return wc(a);case"MM":return wc(r);case"MMM":return E2(e.months("short",!0,!1),1);case"MMMM":return E2(e.months("long",!0,!1),1);case"L":return wc(a);case"LL":return wc(r);case"LLL":return E2(e.months("short",!1,!1),1);case"LLLL":return E2(e.months("long",!1,!1),1);case"d":return wc(a);case"dd":return wc(r);case"o":return wc(l);case"ooo":return wc(n);case"HH":return wc(r);case"H":return wc(a);case"hh":return wc(r);case"h":return wc(a);case"mm":return wc(r);case"m":return wc(a);case"q":return wc(a);case"qq":return wc(r);case"s":return wc(a);case"ss":return wc(r);case"S":return wc(l);case"SSS":return wc(n);case"u":return K2e(d);case"uu":return K2e(a);case"uuu":return wc(i);case"a":return E2(e.meridiems(),0);case"kkkk":return wc(s);case"kk":return wc(p,H2e);case"W":return wc(a);case"WW":return wc(r);case"E":case"c":return wc(i);case"EEE":return E2(e.weekdays("short",!1,!1),1);case"EEEE":return E2(e.weekdays("long",!1,!1),1);case"ccc":return E2(e.weekdays("short",!0,!1),1);case"cccc":return E2(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Cqe(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return Cqe(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return K2e(/[a-z_+-/]{1,256}?/i);default:return v(O)}})(t)||{invalidReason:fHt};return I.token=t,I}const vHt={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",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function _Ht(t,e){const{type:i,value:r}=t;if(i==="literal")return{literal:!0,val:r};const n=e[i];let s=vHt[i];if(typeof s=="object"&&(s=s[n]),s)return{literal:!1,val:s}}function bHt(t){return[`^${t.map(i=>i.regex).reduce((i,r)=>`${i}(${r.source})`,"")}$`,t]}function wHt(t,e,i){const r=t.match(e);if(r){const n={};let s=1;for(const o in i)if(W9(i,o)){const a=i[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 xHt(t){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 i=null,r;return Bu(t.z)||(i=S2.create(t.z)),Bu(t.Z)||(i||(i=new qg(t.Z)),r=t.Z),Bu(t.q)||(t.M=(t.q-1)*3+1),Bu(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),Bu(t.u)||(t.S=U2e(t.u)),[Object.keys(t).reduce((s,o)=>{const a=e(o);return a&&(s[a]=t[o]),s},{}),i,r]}let J2e=null;function SHt(){return J2e||(J2e=zs.fromMillis(1555555555555)),J2e}function CHt(t,e){if(t.literal)return t;const i=Qy.macroTokenToFormatOpts(t.val),r=Iqe(i,e);return r==null||r.includes(void 0)?t:r}function Tqe(t,e){return Array.prototype.concat(...t.map(i=>CHt(i,e)))}function Eqe(t,e,i){const r=Tqe(Qy.parseFormat(i),t),n=r.map(o=>yHt(o,t)),s=n.find(o=>o.invalidReason);if(s)return{input:e,tokens:r,invalidReason:s.invalidReason};{const[o,a]=bHt(n),l=RegExp(o,"i"),[c,d]=wHt(e,l,a),[p,y,v]=d?xHt(d):[null,null,void 0];if(W9(d,"a")&&W9(d,"H"))throw new Eq("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:r,regex:l,rawMatches:c,matches:d,result:p,zone:y,specificOffset:v}}}function THt(t,e,i){const{result:r,zone:n,specificOffset:s,invalidReason:o}=Eqe(t,e,i);return[r,n,s,o]}function Iqe(t,e){return t?Qy.create(e,t).formatDateTimeParts(SHt()).map(n=>_Ht(n,t)):null}const Aqe=[0,31,59,90,120,151,181,212,243,273,304,334],Pqe=[0,31,60,91,121,152,182,213,244,274,305,335];function ow(t,e){return new C2("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Oqe(t,e,i){const r=new Date(Date.UTC(t,e-1,i));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const n=r.getUTCDay();return n===0?7:n}function Rqe(t,e,i){return i+(Aq(t)?Pqe:Aqe)[e-1]}function Mqe(t,e){const i=Aq(t)?Pqe:Aqe,r=i.findIndex(s=>sboe(e)?(a=e+1,o=1):a=e,{weekYear:a,weekNumber:o,weekday:s,...Soe(t)}}function Dqe(t){const{weekYear:e,weekNumber:i,weekday:r}=t,n=Oqe(e,1,4),s=Pq(e);let o=i*7+r-n-3,a;o<1?(a=e-1,o+=Pq(a)):o>s?(a=e+1,o-=Pq(e)):a=e;const{month:l,day:c}=Mqe(a,o);return{year:a,month:l,day:c,...Soe(t)}}function Q2e(t){const{year:e,month:i,day:r}=t,n=Rqe(e,i,r);return{year:e,ordinal:n,...Soe(t)}}function Fqe(t){const{year:e,ordinal:i}=t,{month:r,day:n}=Mqe(e,i);return{year:e,month:r,day:n,...Soe(t)}}function EHt(t){const e=voe(t.weekYear),i=PA(t.weekNumber,1,boe(t.weekYear)),r=PA(t.weekday,1,7);return e?i?r?!1:ow("weekday",t.weekday):ow("week",t.week):ow("weekYear",t.weekYear)}function IHt(t){const e=voe(t.year),i=PA(t.ordinal,1,Pq(t.year));return e?i?!1:ow("ordinal",t.ordinal):ow("year",t.year)}function Lqe(t){const e=voe(t.year),i=PA(t.month,1,12),r=PA(t.day,1,_oe(t.year,t.month));return e?i?r?!1:ow("day",t.day):ow("month",t.month):ow("year",t.year)}function kqe(t){const{hour:e,minute:i,second:r,millisecond:n}=t,s=PA(e,0,23)||e===24&&i===0&&r===0&&n===0,o=PA(i,0,59),a=PA(r,0,59),l=PA(n,0,999);return s?o?a?l?!1:ow("millisecond",n):ow("second",r):ow("minute",i):ow("hour",e)}const eSe="Invalid DateTime",Nqe=864e13;function Toe(t){return new C2("unsupported zone",`the zone "${t.name}" is not supported`)}function tSe(t){return t.weekData===null&&(t.weekData=Z2e(t.c)),t.weekData}function Dq(t,e){const i={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new zs({...i,...e,old:i})}function $qe(t,e,i){let r=t-e*60*1e3;const n=i.offset(r);if(e===n)return[r,e];r-=(n-e)*60*1e3;const s=i.offset(r);return n===s?[r,n]:[t-Math.min(n,s)*60*1e3,Math.max(n,s)]}function Bqe(t,e){t+=e*60*1e3;const i=new Date(t);return{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.getUTCMilliseconds()}}function Eoe(t,e,i){return $qe(z2e(t),e,i)}function Gqe(t,e){const i=t.o,r=t.c.year+Math.trunc(e.years),n=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...t.c,year:r,month:n,day:Math.min(t.c.day,_oe(r,n))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=qu.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=z2e(s);let[l,c]=$qe(a,i,t.zone);return o!==0&&(l+=o,c=t.zone.offset(l)),{ts:l,o:c}}function Fq(t,e,i,r,n,s){const{setZone:o,zone:a}=i;if(t&&Object.keys(t).length!==0){const l=e||a,c=zs.fromObject(t,{...i,zone:l,specificOffset:s});return o?c:c.setZone(a)}else return zs.invalid(new C2("unparsable",`the input "${n}" can't be parsed as ${r}`))}function Ioe(t,e,i=!0){return t.isValid?Qy.create(_d.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(t,e):null}function iSe(t,e){const i=t.c.year>9999||t.c.year<0;let r="";return i&&t.c.year>=0&&(r+="+"),r+=Nf(t.c.year,i?6:4),e?(r+="-",r+=Nf(t.c.month),r+="-",r+=Nf(t.c.day)):(r+=Nf(t.c.month),r+=Nf(t.c.day)),r}function Vqe(t,e,i,r,n,s){let o=Nf(t.c.hour);return e?(o+=":",o+=Nf(t.c.minute),(t.c.second!==0||!i)&&(o+=":")):o+=Nf(t.c.minute),(t.c.second!==0||!i)&&(o+=Nf(t.c.second),(t.c.millisecond!==0||!r)&&(o+=".",o+=Nf(t.c.millisecond,3))),n&&(t.isOffsetFixed&&t.offset===0&&!s?o+="Z":t.o<0?(o+="-",o+=Nf(Math.trunc(-t.o/60)),o+=":",o+=Nf(Math.trunc(-t.o%60))):(o+="+",o+=Nf(Math.trunc(t.o/60)),o+=":",o+=Nf(Math.trunc(t.o%60)))),s&&(o+="["+t.zone.ianaName+"]"),o}const Uqe={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},AHt={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},PHt={ordinal:1,hour:0,minute:0,second:0,millisecond:0},jqe=["year","month","day","hour","minute","second","millisecond"],OHt=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],RHt=["year","ordinal","hour","minute","second","millisecond"];function zqe(t){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"}[t.toLowerCase()];if(!e)throw new CWe(t);return e}function Hqe(t,e){const i=kR(e.zone,kf.defaultZone),r=_d.fromObject(e),n=kf.now();let s,o;if(Bu(t.year))s=n;else{for(const c of jqe)Bu(t[c])&&(t[c]=Uqe[c]);const a=Lqe(t)||kqe(t);if(a)return zs.invalid(a);const l=i.offset(n);[s,o]=Eoe(t,l,i)}return new zs({ts:s,zone:i,loc:r,o})}function Wqe(t,e,i){const r=Bu(i.round)?!0:i.round,n=(o,a)=>(o=j2e(o,r||i.calendary?0:2,!0),e.loc.clone(i).relFormatter(i).format(o,a)),s=o=>i.calendary?e.hasSame(t,o)?0:e.startOf(o).diff(t.startOf(o),o).get(o):e.diff(t,o).get(o);if(i.unit)return n(s(i.unit),i.unit);for(const o of i.units){const a=s(o);if(Math.abs(a)>=1)return n(a,o)}return n(t>e?-0:0,i.units[i.units.length-1])}function qqe(t){let e={},i;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],i=Array.from(t).slice(0,t.length-1)):i=Array.from(t),[e,i]}class zs{constructor(e){const i=e.zone||kf.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new C2("invalid input"):null)||(i.isValid?null:Toe(i));this.ts=Bu(e.ts)?kf.now():e.ts;let n=null,s=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(i))[n,s]=[e.old.c,e.old.o];else{const a=i.offset(this.ts);n=Bqe(this.ts,a),r=Number.isNaN(n.year)?new C2("invalid input"):null,n=r?null:n,s=r?null:a}this._zone=i,this.loc=e.loc||_d.create(),this.invalid=r,this.weekData=null,this.c=n,this.o=s,this.isLuxonDateTime=!0}static now(){return new zs({})}static local(){const[e,i]=qqe(arguments),[r,n,s,o,a,l,c]=i;return Hqe({year:r,month:n,day:s,hour:o,minute:a,second:l,millisecond:c},e)}static utc(){const[e,i]=qqe(arguments),[r,n,s,o,a,l,c]=i;return e.zone=qg.utcInstance,Hqe({year:r,month:n,day:s,hour:o,minute:a,second:l,millisecond:c},e)}static fromJSDate(e,i={}){const r=rzt(e)?e.valueOf():NaN;if(Number.isNaN(r))return zs.invalid("invalid input");const n=kR(i.zone,kf.defaultZone);return n.isValid?new zs({ts:r,zone:n,loc:_d.fromObject(i)}):zs.invalid(Toe(n))}static fromMillis(e,i={}){if(b5(e))return e<-Nqe||e>Nqe?zs.invalid("Timestamp out of range"):new zs({ts:e,zone:kR(i.zone,kf.defaultZone),loc:_d.fromObject(i)});throw new nw(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,i={}){if(b5(e))return new zs({ts:e*1e3,zone:kR(i.zone,kf.defaultZone),loc:_d.fromObject(i)});throw new nw("fromSeconds requires a numerical input")}static fromObject(e,i={}){e=e||{};const r=kR(i.zone,kf.defaultZone);if(!r.isValid)return zs.invalid(Toe(r));const n=kf.now(),s=Bu(i.specificOffset)?r.offset(n):i.specificOffset,o=xoe(e,zqe),a=!Bu(o.ordinal),l=!Bu(o.year),c=!Bu(o.month)||!Bu(o.day),d=l||c,p=o.weekYear||o.weekNumber,y=_d.fromObject(i);if((d||a)&&p)throw new Eq("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new Eq("Can't mix ordinal dates with month/day");const v=p||o.weekday&&!d;let S,I,O=Bqe(n,s);v?(S=OHt,I=AHt,O=Z2e(O)):a?(S=RHt,I=PHt,O=Q2e(O)):(S=jqe,I=Uqe);let L=!1;for(const re of S){const fe=o[re];Bu(fe)?L?o[re]=I[re]:o[re]=O[re]:L=!0}const N=v?EHt(o):a?IHt(o):Lqe(o),G=N||kqe(o);if(G)return zs.invalid(G);const V=v?Dqe(o):a?Fqe(o):o,[Y,X]=Eoe(V,s,r),te=new zs({ts:Y,zone:r,o:X,loc:y});return o.weekday&&d&&e.weekday!==te.weekday?zs.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${te.toISO()}`):te}static fromISO(e,i={}){const[r,n]=Wzt(e);return Fq(r,n,i,"ISO 8601",e)}static fromRFC2822(e,i={}){const[r,n]=qzt(e);return Fq(r,n,i,"RFC 2822",e)}static fromHTTP(e,i={}){const[r,n]=Yzt(e);return Fq(r,n,i,"HTTP",i)}static fromFormat(e,i,r={}){if(Bu(e)||Bu(i))throw new nw("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:s=null}=r,o=_d.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0}),[a,l,c,d]=THt(o,e,i);return d?zs.invalid(d):Fq(a,l,r,`format ${i}`,e,c)}static fromString(e,i,r={}){return zs.fromFormat(e,i,r)}static fromSQL(e,i={}){const[r,n]=tHt(e);return Fq(r,n,i,"SQL",e)}static invalid(e,i=null){if(!e)throw new nw("need to specify a reason the DateTime is invalid");const r=e instanceof C2?e:new C2(e,i);if(kf.throwOnInvalid)throw new F7t(r);return new zs({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,i={}){const r=Iqe(e,_d.fromObject(i));return r?r.map(n=>n?n.val:null).join(""):null}static expandFormat(e,i={}){return Tqe(Qy.parseFormat(e),_d.fromObject(i)).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?tSe(this).weekYear:NaN}get weekNumber(){return this.isValid?tSe(this).weekNumber:NaN}get weekday(){return this.isValid?tSe(this).weekday:NaN}get ordinal(){return this.isValid?Q2e(this.c).ordinal:NaN}get monthShort(){return this.isValid?Coe.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Coe.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Coe.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Coe.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}get isInLeapYear(){return Aq(this.year)}get daysInMonth(){return _oe(this.year,this.month)}get daysInYear(){return this.isValid?Pq(this.year):NaN}get weeksInWeekYear(){return this.isValid?boe(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:i,numberingSystem:r,calendar:n}=Qy.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:i,numberingSystem:r,outputCalendar:n}}toUTC(e=0,i={}){return this.setZone(qg.instance(e),i)}toLocal(){return this.setZone(kf.defaultZone)}setZone(e,{keepLocalTime:i=!1,keepCalendarTime:r=!1}={}){if(e=kR(e,kf.defaultZone),e.equals(this.zone))return this;if(e.isValid){let n=this.ts;if(i||r){const s=e.offset(this.ts),o=this.toObject();[n]=Eoe(o,s,e)}return Dq(this,{ts:n,zone:e})}else return zs.invalid(Toe(e))}reconfigure({locale:e,numberingSystem:i,outputCalendar:r}={}){const n=this.loc.clone({locale:e,numberingSystem:i,outputCalendar:r});return Dq(this,{loc:n})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const i=xoe(e,zqe),r=!Bu(i.weekYear)||!Bu(i.weekNumber)||!Bu(i.weekday),n=!Bu(i.ordinal),s=!Bu(i.year),o=!Bu(i.month)||!Bu(i.day),a=s||o,l=i.weekYear||i.weekNumber;if((a||n)&&l)throw new Eq("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&n)throw new Eq("Can't mix ordinal dates with month/day");let c;r?c=Dqe({...Z2e(this.c),...i}):Bu(i.ordinal)?(c={...this.toObject(),...i},Bu(i.day)&&(c.day=Math.min(_oe(c.year,c.month),c.day))):c=Fqe({...Q2e(this.c),...i});const[d,p]=Eoe(c,this.o,this.zone);return Dq(this,{ts:d,o:p})}plus(e){if(!this.isValid)return this;const i=qu.fromDurationLike(e);return Dq(this,Gqe(this,i))}minus(e){if(!this.isValid)return this;const i=qu.fromDurationLike(e).negate();return Dq(this,Gqe(this,i))}startOf(e){if(!this.isValid)return this;const i={},r=qu.normalizeUnit(e);switch(r){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(r==="weeks"&&(i.weekday=1),r==="quarters"){const n=Math.ceil(this.month/3);i.month=(n-1)*3+1}return this.set(i)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,i={}){return this.isValid?Qy.create(this.loc.redefaultToEN(i)).formatDateTimeFromString(this,e):eSe}toLocaleString(e=poe,i={}){return this.isValid?Qy.create(this.loc.clone(i),e).formatDateTime(this):eSe}toLocaleParts(e={}){return this.isValid?Qy.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:i=!1,suppressMilliseconds:r=!1,includeOffset:n=!0,extendedZone:s=!1}={}){if(!this.isValid)return null;const o=e==="extended";let a=iSe(this,o);return a+="T",a+=Vqe(this,o,i,r,n,s),a}toISODate({format:e="extended"}={}){return this.isValid?iSe(this,e==="extended"):null}toISOWeekDate(){return Ioe(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:i=!1,includeOffset:r=!0,includePrefix:n=!1,extendedZone:s=!1,format:o="extended"}={}){return this.isValid?(n?"T":"")+Vqe(this,o==="extended",i,e,r,s):null}toRFC2822(){return Ioe(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Ioe(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?iSe(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:i=!1,includeOffsetSpace:r=!0}={}){let n="HH:mm:ss.SSS";return(i||e)&&(r&&(n+=" "),i?n+="z":e&&(n+="ZZ")),Ioe(this,n,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():eSe}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const i={...this.c};return e.includeConfig&&(i.outputCalendar=this.outputCalendar,i.numberingSystem=this.loc.numberingSystem,i.locale=this.loc.locale),i}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,i="milliseconds",r={}){if(!this.isValid||!e.isValid)return qu.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...r},s=nzt(i).map(qu.normalizeUnit),o=e.valueOf()>this.valueOf(),a=o?this:e,l=o?e:this,c=hHt(a,l,s,n);return o?c.negate():c}diffNow(e="milliseconds",i={}){return this.diff(zs.now(),e,i)}until(e){return this.isValid?Ap.fromDateTimes(this,e):this}hasSame(e,i){if(!this.isValid)return!1;const r=e.valueOf(),n=this.setZone(e.zone,{keepLocalTime:!0});return n.startOf(i)<=r&&r<=n.endOf(i)}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 i=e.base||zs.fromObject({},{zone:this.zone}),r=e.padding?thisi.valueOf(),Math.min)}static max(...e){if(!e.every(zs.isDateTime))throw new nw("max requires all arguments be DateTimes");return QWe(e,i=>i.valueOf(),Math.max)}static fromFormatExplain(e,i,r={}){const{locale:n=null,numberingSystem:s=null}=r,o=_d.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0});return Eqe(o,e,i)}static fromStringExplain(e,i,r={}){return zs.fromFormatExplain(e,i,r)}static get DATE_SHORT(){return poe}static get DATE_MED(){return TWe}static get DATE_MED_WITH_WEEKDAY(){return N7t}static get DATE_FULL(){return EWe}static get DATE_HUGE(){return IWe}static get TIME_SIMPLE(){return AWe}static get TIME_WITH_SECONDS(){return PWe}static get TIME_WITH_SHORT_OFFSET(){return OWe}static get TIME_WITH_LONG_OFFSET(){return RWe}static get TIME_24_SIMPLE(){return MWe}static get TIME_24_WITH_SECONDS(){return DWe}static get TIME_24_WITH_SHORT_OFFSET(){return FWe}static get TIME_24_WITH_LONG_OFFSET(){return LWe}static get DATETIME_SHORT(){return kWe}static get DATETIME_SHORT_WITH_SECONDS(){return NWe}static get DATETIME_MED(){return $We}static get DATETIME_MED_WITH_SECONDS(){return BWe}static get DATETIME_MED_WITH_WEEKDAY(){return $7t}static get DATETIME_FULL(){return GWe}static get DATETIME_FULL_WITH_SECONDS(){return VWe}static get DATETIME_HUGE(){return UWe}static get DATETIME_HUGE_WITH_SECONDS(){return jWe}}function Lq(t){if(zs.isDateTime(t))return t;if(t&&t.valueOf&&b5(t.valueOf()))return zs.fromJSDate(t);if(t&&typeof t=="object")return zs.fromObject(t);throw new nw(`Unknown datetime argument: ${t}, of type ${typeof t}`)}function Yqe(t,e="system"){if(!t||!SWe.has(t.timeZone))return e;const i=SWe.get(t.timeZone);return DHt(t.timeZone)||t.respectsDaylightSaving?i:MHt(i)}function MHt(t){const e=zs.local().setZone(t),i=Math.min(e.set({month:1,day:1}).offset,e.set({month:5}).offset);return i===0?"Etc/UTC":`Etc/GMT${qg.instance(-i).formatOffset(0,"narrow")}`}function DHt(t){return t.startsWith("UTC")}let BR=class extends ua(Ni){constructor(e){super(e),this.legacy=null,this.timeZone="system"}readLegacy(e,i){const{timeZone:r,respectsDaylightSaving:n}=i;return{timeZone:r,respectsDaylightSaving:n}}readTimeZone(e,i){return"timeZoneIANA"in i?i.timeZoneIANA:Yqe(i)}writeTimeZone(e,i){i.timeZoneIANA=e}equals(e){return!(lt(e)||lt(this.timeZone)||lt(e.timeZone))&&this.timeZone===e.timeZone}};E([k()],BR.prototype,"legacy",void 0),E([Li("legacy",["timeZone"])],BR.prototype,"readLegacy",null),E([k({type:String,nonNullable:!0})],BR.prototype,"timeZone",void 0),E([Li("timeZone",["timeZone","timeZoneIANA","respectsDaylightSaving"])],BR.prototype,"readTimeZone",null),E([mr("timeZone")],BR.prototype,"writeTimeZone",null),BR=E([ht("esri.time.TimeReference")],BR);const GR=BR;let OA=class extends ua(Ni){constructor(e){super(e),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.dateFieldsTimeReference=null}};E([k()],OA.prototype,"creatorField",void 0),E([k()],OA.prototype,"creationDateField",void 0),E([k()],OA.prototype,"editorField",void 0),E([k()],OA.prototype,"editDateField",void 0),E([k()],OA.prototype,"realm",void 0),E([k({type:GR})],OA.prototype,"dateFieldsTimeReference",void 0),OA=E([ht("esri.layers.support.EditFieldsInfo")],OA);const FHt=OA;let QC=class extends ua(Ni){constructor(e){super(e)}};E([k({constructOnly:!0,json:{write:!0}})],QC.prototype,"name",void 0),E([k({constructOnly:!0,json:{write:!0}})],QC.prototype,"fields",void 0),E([k({constructOnly:!0,json:{write:!0}})],QC.prototype,"isAscending",void 0),E([k({constructOnly:!0,json:{write:!0}})],QC.prototype,"indexType",void 0),E([k({constructOnly:!0,json:{write:!0}})],QC.prototype,"isUnique",void 0),E([k({constructOnly:!0,json:{write:!0}})],QC.prototype,"description",void 0),QC=E([ht("esri.layers.support.FeatureIndex")],QC);var rSe;let lg=rSe=class extends Ni{constructor(t){super(t),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(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10}clone(){return new rSe(hi({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}))}};E([k({type:[String],json:{write:!0}})],lg.prototype,"attachmentTypes",void 0),E([k({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],lg.prototype,"attachmentsWhere",void 0),E([k({type:Boolean,json:{write:!0}})],lg.prototype,"cacheHint",void 0),E([k({type:[String],json:{write:!0}})],lg.prototype,"keywords",void 0),E([k({type:[Number],json:{write:!0}})],lg.prototype,"globalIds",void 0),E([k({json:{write:!0}})],lg.prototype,"name",void 0),E([k({type:Number,json:{read:{source:"resultRecordCount"}}})],lg.prototype,"num",void 0),E([k({type:[Number],json:{write:!0}})],lg.prototype,"objectIds",void 0),E([k({type:Boolean,json:{default:!1,write:!0}})],lg.prototype,"returnMetadata",void 0),E([k({type:[Number],json:{write:!0}})],lg.prototype,"size",void 0),E([k({type:Number,json:{read:{source:"resultOffset"}}})],lg.prototype,"start",void 0),E([mr("start"),mr("num")],lg.prototype,"writeStart",null),E([k({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],lg.prototype,"where",void 0),lg=rSe=E([ht("esri.rest.support.AttachmentQuery")],lg),lg.from=ud(lg);const Aoe=lg;var nSe;let $d=nSe=class extends Ni{constructor(t){super(t),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(t,e){e.historicMoment=t&&t.getTime()}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,this.start>0&&this.where==null&&(e.definitionExpression="1=1")}clone(){return new nSe(hi({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}))}};E([k({type:Boolean,json:{write:!0}})],$d.prototype,"cacheHint",void 0),E([k({type:Q0,json:{write:!0}})],$d.prototype,"dynamicDataSource",void 0),E([k({type:String,json:{write:!0}})],$d.prototype,"gdbVersion",void 0),E([k({type:Number,json:{write:!0}})],$d.prototype,"geometryPrecision",void 0),E([k({type:Date})],$d.prototype,"historicMoment",void 0),E([mr("historicMoment")],$d.prototype,"_writeHistoricMoment",null),E([k({type:Number,json:{write:!0}})],$d.prototype,"maxAllowableOffset",void 0),E([k({type:[Number],json:{write:!0}})],$d.prototype,"objectIds",void 0),E([k({type:[String],json:{write:!0}})],$d.prototype,"orderByFields",void 0),E([k({type:[String],json:{write:!0}})],$d.prototype,"outFields",void 0),E([k({type:rr,json:{read:{source:"outSR"},write:{target:"outSR"}}})],$d.prototype,"outSpatialReference",void 0),E([k({json:{write:!0}})],$d.prototype,"relationshipId",void 0),E([k({type:Number,json:{read:{source:"resultOffset"}}})],$d.prototype,"start",void 0),E([mr("start"),mr("num")],$d.prototype,"writeStart",null),E([k({type:Number,json:{read:{source:"resultRecordCount"}}})],$d.prototype,"num",void 0),E([k({json:{write:!0}})],$d.prototype,"returnGeometry",void 0),E([k({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],$d.prototype,"returnM",void 0),E([k({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],$d.prototype,"returnZ",void 0),E([k({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],$d.prototype,"where",void 0),$d=nSe=E([ht("esri.rest.support.RelationshipQuery")],$d),$d.from=ud($d);const eT=$d,Xqe=Object.freeze(Object.defineProperty({__proto__:null,default:eT},Symbol.toStringTag,{value:"Module"})),sSe=new Bs({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function Kqe(t,e,i,r){const n=await VR(t);if(await oSe(t,e,r),!n.addAttachment)throw new st(r,"Layer source does not support addAttachment capability");return n.addAttachment(e,i)}function oSe(t,e,i){const{attributes:r}=e,{objectIdField:n}=t;return t.get("capabilities.data.supportsAttachment")?e?r?n&&r[n]?Promise.resolve():Promise.reject(new st(i,`feature is missing the identifying attribute ${n}`)):Promise.reject(new st(i,"'attributes' are required on a feature to query attachments")):Promise.reject(new st(i,"A feature is required to add/delete/update attachments")):Promise.reject(new st(i,"this layer doesn't support attachments"))}async function Jqe(t,e,i,r,n){const s=await VR(t);if(await oSe(t,e,n),!s.updateAttachment)throw new st(n,"Layer source does not support updateAttachment capability");return s.updateAttachment(e,i,r)}async function Zqe(t,e,i){const r=await Promise.resolve().then(()=>B4e),n=await t.load();return r.applyEdits(n,n.source,e,i)}async function Qqe(t,e,i,r){const n=await VR(t);if(await oSe(t,e,r),!n.deleteAttachments)throw new st(r,"Layer source does not support deleteAttachments capability");return n.deleteAttachments(e,i)}async function eYe(t,e,i){const r=(await t.load({signal:e?.signal})).source;if(!r.fetchRecomputedExtents)throw new st(i,"Layer source does not support fetchUpdates capability");return r.fetchRecomputedExtents(e)}async function tYe(t,e,i,r){e=Aoe.from(e),await t.load();const n=t.source,s=t.capabilities;if(!s?.data?.supportsAttachment)throw new st(r,"this layer doesn't support attachments");const{attachmentTypes:o,objectIds:a,globalIds:l,num:c,size:d,start:p,where:y}=e;if(!s?.operations?.supportsQueryAttachments&&(o?.length>0||l?.length>0||d?.length>0||c||p||y))throw new st(r,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(a?.length||l?.length||y))throw new st(r,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);if(!n.queryAttachments)throw new st(r,"Layer source does not support queryAttachments capability",e);return n.queryAttachments(e)}async function iYe(t,e,i,r){const n=await VR(t);if(!n.queryObjectIds)throw new st(r,"Layer source does not support queryObjectIds capability");return n.queryObjectIds(Ss.from(e)??t.createQuery(),i)}async function rYe(t,e,i,r){const n=await VR(t);if(!n.queryFeatureCount)throw new st(r,"Layer source does not support queryFeatureCount capability");return n.queryFeatureCount(Ss.from(e)??t.createQuery(),i)}async function nYe(t,e,i,r){const n=await VR(t);if(!n.queryExtent)throw new st(r,"Layer source does not support queryExtent capability");return n.queryExtent(Ss.from(e)??t.createQuery(),i)}async function sYe(t,e,i,r){const n=await VR(t);if(!n.queryRelatedFeatures)throw new st(r,"Layer source does not support queryRelatedFeatures capability");return n.queryRelatedFeatures(eT.from(e),i)}async function oYe(t,e,i,r){const n=await VR(t);if(!n.queryRelatedFeaturesCount)throw new st(r,"Layer source does not support queryRelatedFeaturesCount capability");return n.queryRelatedFeaturesCount(eT.from(e),i)}async function aYe(t){const e=t.source;if(e?.refresh)try{const{dataChanged:i,updates:r}=await e.refresh();if(ye(r)&&(t.sourceJSON={...t.sourceJSON,...r},t.read(r,{origin:"service",url:t.parsedUrl})),i)return!0}catch{}if(t.definitionExpression)try{return(await hUt(t.definitionExpression,t.fieldsIndex)).hasDateFunctions}catch{}return!1}function aSe(t){const e=new Ss,i=t.get("capabilities.data"),r=t.get("capabilities.query");e.historicMoment=t.historicMoment,e.gdbVersion=t.gdbVersion,e.returnGeometry=!0,r&&(e.compactGeometryEnabled=r.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=r.supportsDefaultSpatialReference),i&&(i.supportsZ&&t.returnZ!=null&&(e.returnZ=t.returnZ),i.supportsM&&t.returnM!=null&&(e.returnM=t.returnM)),e.outFields=["*"];const{timeOffset:n,timeExtent:s}=t;return e.timeExtent=n!=null&&s!=null?s.offset(-n.value,n.unit):s||null,e.multipatchOption=t.geometryType==="multipatch"?"xyFootprint":null,e}function lYe(t){const{globalIdField:e,fields:i}=t;if(e)return e;if(i){for(const r of i)if(r.type==="esriFieldTypeGlobalID")return r.name}}function uYe(t){const{objectIdField:e,fields:i}=t;if(e)return e;if(i){for(const r of i)if(r.type==="esriFieldTypeOID")return r.name}}function LHt(t){return t.currentVersion?t.currentVersion:t.hasOwnProperty("capabilities")||t.hasOwnProperty("drawingInfo")||t.hasOwnProperty("hasAttachments")||t.hasOwnProperty("htmlPopupType")||t.hasOwnProperty("relationships")||t.hasOwnProperty("timeInfo")||t.hasOwnProperty("typeIdField")||t.hasOwnProperty("types")?10:9.3}async function VR(t){return(await t.load()).source}async function kHt(t,e){if(!Ro||Ro.findCredential(t))return;let i;try{const r=await kUe(t,e);r&&(i=await Ro.checkSignInStatus(`${r}/sharing`))}catch{}if(i)try{const r=ye(e)?e.signal:null;await Ro.getCredential(t,{signal:r})}catch{}}async function cYe(t,e){const i=t.parsedUrl?.path;if(!i)return;const r=t.editFieldsInfo;(t.userHasUpdateItemPrivileges||t.userHasFullEditingPrivileges&&t.capabilities.operations.supportsEditing||r?.creatorField||r?.editorField)&&await kHt(i,e)}function hYe(t){return!t.sourceJSON?.isMultiServicesView&&(t.userHasUpdateItemPrivileges||t.editingEnabled)}let eB=class extends ua(Ni){constructor(e){super(e),this.shapeAreaField=null,this.shapeLengthField=null,this.units=null}};E([k({type:String,json:{read:{source:"shapeAreaFieldName"}}})],eB.prototype,"shapeAreaField",void 0),E([k({type:String,json:{read:{source:"shapeLengthFieldName"}}})],eB.prototype,"shapeLengthField",void 0),E([k({type:String,json:{read:t=>jH.read(t)||rA.read(t)}})],eB.prototype,"units",void 0),eB=E([ht("esri.layers.support.GeometryFieldsInfo")],eB);const NHt=eB;var lSe;let tB=lSe=class extends Ni{constructor(t){super(t),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new fr}clone(){return new lSe({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};E([k({type:String,json:{write:!0}})],tB.prototype,"floorField",void 0),E([k({json:{read:!1,write:!1}})],tB.prototype,"viewAllMode",void 0),E([k({json:{read:!1,write:!1}})],tB.prototype,"viewAllLevelIds",void 0),tB=lSe=E([ht("esri.layers.support.LayerFloorInfo")],tB);const uSe=tB,dYe=new Bs({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),pYe=new Bs({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let aw=class extends ua(Ni){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}};E([k({json:{read:dYe.read,write:dYe.write}})],aw.prototype,"cardinality",void 0),E([k({json:{read:!0,write:!0}})],aw.prototype,"composite",void 0),E([k({json:{read:!0,write:!0}})],aw.prototype,"id",void 0),E([k({json:{read:!0,write:!0}})],aw.prototype,"keyField",void 0),E([k({json:{read:!0,write:!0}})],aw.prototype,"keyFieldInRelationshipTable",void 0),E([k({json:{read:!0,write:!0}})],aw.prototype,"name",void 0),E([k({json:{read:!0,write:!0}})],aw.prototype,"relatedTableId",void 0),E([k({json:{read:!0,write:!0}})],aw.prototype,"relationshipTableId",void 0),E([k({json:{read:pYe.read,write:pYe.write}})],aw.prototype,"role",void 0),aw=E([ht("esri.layers.support.Relationship")],aw);const $Ht=aw,BHt={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function zo(t,e,i){return!!(t&&t.hasOwnProperty(e)?t[e]:i)}function Poe(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}function GHt(t){const e=t?.supportedSpatialAggregationStatistics?.map(i=>i.toLowerCase());return{envelope:!!e?.includes("envelopeaggregate"),centroid:!!e?.includes("centroidaggregate"),convexHull:!!e?.includes("convexhullaggregate")}}function kq(t,e){return!!t?.supportedOperationsWithCacheHint?.map(r=>r.toLowerCase())?.includes(e.toLowerCase())}function cSe(t,e){return{analytics:VHt(t),attachment:UHt(t),data:jHt(t),metadata:zHt(t),operations:HHt(t.capabilities,t,e),query:WHt(t,e),queryRelated:qHt(t),queryTopFeatures:YHt(t),editing:XHt(t)}}function VHt(t){return{supportsCacheHint:kq(t.advancedQueryCapabilities,"queryAnalytics")}}function UHt(t){const e=t.attachmentProperties,i={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:kq(t.advancedQueryCapabilities,"queryAttachments"),supportsResize:zo(t,"supportsAttachmentsResizing",!1)};return e&&Array.isArray(e)&&e.forEach(r=>{const n=BHt[r.name];n&&(i[n]=!!r.isEnabled)}),i}function jHt(t){return{isVersioned:zo(t,"isDataVersioned",!1),supportsAttachment:zo(t,"hasAttachments",!1),supportsM:zo(t,"hasM",!1),supportsZ:zo(t,"hasZ",!1)}}function zHt(t){return{supportsAdvancedFieldProperties:zo(t,"supportsFieldDescriptionProperty",!1)}}function HHt(t,e,i){const r=t?t.toLowerCase().split(",").map(y=>y.trim()):[],n=i?JC(i):null,s=r.includes(ye(n)&&n.serverType==="MapServer"?"data":"query"),o=r.includes("editing")&&!e.datesInUnknownTimezone;let a=o&&r.includes("create"),l=o&&r.includes("delete"),c=o&&r.includes("update");const d=r.includes("changetracking"),p=e.advancedQueryCapabilities;return o&&!(a||l||c)&&(a=l=c=!0),{supportsCalculate:zo(e,"supportsCalculate",!1),supportsTruncate:zo(e,"supportsTruncate",!1),supportsValidateSql:zo(e,"supportsValidateSql",!1),supportsAdd:a,supportsDelete:l,supportsEditing:o,supportsChangeTracking:d,supportsQuery:s,supportsQueryAnalytics:zo(p,"supportsQueryAnalytic",!1),supportsQueryAttachments:zo(p,"supportsQueryAttachments",!1),supportsQueryTopFeatures:zo(p,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:zo(e,"supportsAttachmentsResizing",!1),supportsSync:r.includes("sync"),supportsUpdate:c,supportsExceedsLimitStatistics:zo(e,"supportsExceedsLimitStatistics",!1)}}function WHt(t,e){const i=t.advancedQueryCapabilities,r=t.ownershipBasedAccessControlForFeatures,n=t.archivingInfo,s=t.currentVersion,o=e?.includes("MapServer"),a=!o||s>=Gi("mapserver-pbf-version-support"),l=N9(e),c=new Set((t.supportedQueryFormats??"").split(",").map(d=>d.toLowerCase().trim()));return{supportsStatistics:zo(i,"supportsStatistics",t.supportsStatistics),supportsPercentileStatistics:zo(i,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:zo(i,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:GHt(i),supportsCentroid:zo(i,"supportsReturningGeometryCentroid",!1),supportsDistance:zo(i,"supportsQueryWithDistance",!1),supportsDistinct:zo(i,"supportsDistinct",t.supportsAdvancedQueries),supportsExtent:zo(i,"supportsReturningQueryExtent",!1),supportsGeometryProperties:zo(i,"supportsReturningGeometryProperties",!1),supportsHavingClause:zo(i,"supportsHavingClause",!1),supportsOrderBy:zo(i,"supportsOrderBy",t.supportsAdvancedQueries),supportsPagination:zo(i,"supportsPagination",!1),supportsQuantization:zo(t,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:zo(t,"supportsQuantizationEditMode",!1),supportsQueryGeometry:zo(t,"supportsReturningQueryGeometry",!1),supportsResultType:zo(i,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:zo(i,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:zo(i,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:zo(t,"useStandardizedQueries",!1),supportsTopFeaturesQuery:zo(i,"supportsTopFeaturesQuery",!1),supportsQueryByOthers:zo(r,"allowOthersToQuery",!0),supportsHistoricMoment:zo(n,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:a&&c.has("pbf"),supportsDisjointSpatialRelationship:zo(i,"supportsDisjointSpatialRel",!1),supportsCacheHint:zo(i,"supportsQueryWithCacheHint",!1)||kq(i,"query"),supportsDefaultSpatialReference:zo(i,"supportsDefaultSR",!1),supportsCompactGeometry:l,supportsFullTextSearch:zo(i,"supportsFullTextSearch",!1),maxRecordCountFactor:Poe(t,"maxRecordCountFactor",void 0),maxRecordCount:Poe(t,"maxRecordCount",void 0),standardMaxRecordCount:Poe(t,"standardMaxRecordCount",void 0),tileMaxRecordCount:Poe(t,"tileMaxRecordCount",void 0)}}function qHt(t){const e=t.advancedQueryCapabilities,i=zo(e,"supportsAdvancedQueryRelated",!1);return{supportsPagination:zo(e,"supportsQueryRelatedPagination",!1),supportsCount:i,supportsOrderBy:i,supportsCacheHint:kq(e,"queryRelated")}}function YHt(t){return{supportsCacheHint:kq(t.advancedQueryCapabilities,"queryTopFilter")}}function XHt(t){const e=t.ownershipBasedAccessControlForFeatures;return{supportsGeometryUpdate:zo(t,"allowGeometryUpdates",!0),supportsGlobalId:zo(t,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:zo(t,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:zo(t,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:zo(t,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:zo(t,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:zo(e,"allowAnonymousToDelete",!0),supportsDeleteByOthers:zo(e,"allowOthersToDelete",!0),supportsUpdateByAnonymous:zo(e,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:zo(e,"allowOthersToUpdate",!0)}}const fYe=t=>{let e=class extends t{constructor(){super(...arguments),this.capabilities=null,this.copyright=null,this.dateFieldsTimeReference=null,this.datesInUnknownTimezone=!1,this.displayField=null,this.definitionExpression=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.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.isTable=!1,this.layerId=void 0,this.minScale=0,this.maxScale=0,this.globalIdField=null,this.objectIdField=null,this.preferredTimeReference=null,this.relationships=null,this.sourceJSON=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.spatialReference=rr.WGS84,this.subtypeField=null,this.trackIdField=null,this.indexes=new(fr.ofType(QC)),this.version=void 0}readCapabilitiesFromService(i,r){return cSe(r,this.url)}get effectiveCapabilities(){const i=this.capabilities;if(!i)return null;const r=hi(i),{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)}readEditingInfo(i,r){const{editingInfo:n}=r;return n?{lastEditDate:n.lastEditDate!=null?new Date(n.lastEditDate):null}:null}readIsTableFromService(i,r){return r.type==="Table"}readMinScale(i,r){return r.effectiveMinScale||i||0}readMaxScale(i,r){return r.effectiveMaxScale||i||0}readGlobalIdFieldFromService(i,r){return lYe(r)}readObjectIdFieldFromService(i,r){return uYe(r)}readServiceDefinitionExpression(i,r){return r.definitionQuery||r.definitionExpression}set url(i){const r=MHe({layer:this,url:i,nonStandardUrlAllowed:!0,logger:Ei.getLogger(this.declaredClass)});this._set("url",r.url),r.layerId!=null&&this._set("layerId",r.layerId)}writeUrl(i,r,n,s){DHe(this,i,null,r,s)}readVersion(i,r){return LHt(r)}};return E([k({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),E([Li("service","capabilities")],e.prototype,"readCapabilitiesFromService",null),E([k({readOnly:!0})],e.prototype,"effectiveCapabilities",null),E([k({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],e.prototype,"copyright",void 0),E([k({type:GR})],e.prototype,"dateFieldsTimeReference",void 0),E([k({type:Boolean})],e.prototype,"datesInUnknownTimezone",void 0),E([k({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],e.prototype,"displayField",void 0),E([k({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],e.prototype,"definitionExpression",void 0),E([k({readOnly:!0,type:FHt})],e.prototype,"editFieldsInfo",void 0),E([k({readOnly:!0})],e.prototype,"editingInfo",void 0),E([Li("editingInfo")],e.prototype,"readEditingInfo",null),E([k((()=>{const i=hi(FR),r=i.json.origins;return r["web-map"]={read:!1,write:!1},r["portal-item"]={read:!1,write:!1},i})())],e.prototype,"elevationInfo",void 0),E([k({type:uSe,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],e.prototype,"floorInfo",void 0),E([k({type:vr,json:{origins:{service:{read:{source:"extent"}}}}})],e.prototype,"fullExtent",void 0),E([k()],e.prototype,"gdbVersion",void 0),E([k({readOnly:!0,type:NHt,json:{read:{source:"geometryProperties"}}})],e.prototype,"geometryFieldsInfo",void 0),E([k({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:sSe.read}}}})],e.prototype,"geometryType",void 0),E([k({type:Boolean,json:{origins:{service:{read:!0}}}})],e.prototype,"hasM",void 0),E([k({type:Boolean,json:{origins:{service:{read:!0}}}})],e.prototype,"hasZ",void 0),E([k({readOnly:!0,type:V9})],e.prototype,"heightModelInfo",void 0),E([k({type:Date})],e.prototype,"historicMoment",void 0),E([k({readOnly:!0})],e.prototype,"isTable",void 0),E([Li("service","isTable",["type"])],e.prototype,"readIsTableFromService",null),E([k({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],e.prototype,"layerId",void 0),E([k(F2e)],e.prototype,"minScale",void 0),E([Li("service","minScale",["minScale","effectiveMinScale"])],e.prototype,"readMinScale",null),E([k(L2e)],e.prototype,"maxScale",void 0),E([Li("service","maxScale",["maxScale","effectiveMaxScale"])],e.prototype,"readMaxScale",null),E([k({type:String})],e.prototype,"globalIdField",void 0),E([Li("service","globalIdField",["globalIdField","fields"])],e.prototype,"readGlobalIdFieldFromService",null),E([k({type:String})],e.prototype,"objectIdField",void 0),E([Li("service","objectIdField",["objectIdField","fields"])],e.prototype,"readObjectIdFieldFromService",null),E([k({type:GR})],e.prototype,"preferredTimeReference",void 0),E([k({type:[$Ht],readOnly:!0})],e.prototype,"relationships",void 0),E([k()],e.prototype,"sourceJSON",void 0),E([k({type:Boolean})],e.prototype,"returnM",void 0),E([k({type:Boolean})],e.prototype,"returnZ",void 0),E([k({readOnly:!0})],e.prototype,"serviceDefinitionExpression",void 0),E([Li("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],e.prototype,"readServiceDefinitionExpression",null),E([k({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],e.prototype,"serviceItemId",void 0),E([k({type:rr,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],e.prototype,"spatialReference",void 0),E([k({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],e.prototype,"subtypeField",void 0),E([k({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],e.prototype,"trackIdField",void 0),E([k({readOnly:!0,json:{write:!1}})],e.prototype,"serverGens",void 0),E([k({type:fr.ofType(QC),readOnly:!0})],e.prototype,"indexes",void 0),E([k(Zy)],e.prototype,"url",null),E([mr("url")],e.prototype,"writeUrl",null),E([k({json:{origins:{service:{read:!0}},read:!1}})],e.prototype,"version",void 0),E([Li("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],e.prototype,"readVersion",null),e=E([ht("esri.layers.mixins.FeatureLayerBase")],e),e};let iB=class extends ua(Ni){constructor(e){super(e),this.expression=null,this.title=null,this.returnType=null}};E([k({type:String,json:{write:!0}})],iB.prototype,"expression",void 0),E([k({type:String,json:{write:!0}})],iB.prototype,"title",void 0),E([k({type:String,json:{write:!0}})],iB.prototype,"returnType",void 0),iB=E([ht("esri.layers.support.ExpressionInfo")],iB);const hSe=iB;var dSe;let RA=dSe=class extends Ni{constructor(t){super(t),this.isAutoGenerated=!1,this.name=null,this.alias=null,this.onStatisticField=null,this.onStatisticExpression=null,this.statisticType=null}clone(){return new dSe({name:this.name,alias:this.alias,isAutoGenerated:this.isAutoGenerated,onStatisticExpression:hi(this.onStatisticExpression),onStatisticField:this.onStatisticField,statisticType:this.statisticType})}};E([k({type:Boolean,json:{write:!0}})],RA.prototype,"isAutoGenerated",void 0),E([k({type:String,json:{write:!0}})],RA.prototype,"name",void 0),E([k({type:String,json:{write:!0}})],RA.prototype,"alias",void 0),E([k({type:String,json:{write:!0}})],RA.prototype,"onStatisticField",void 0),E([k({type:hSe,json:{write:!0}})],RA.prototype,"onStatisticExpression",void 0),E([k({type:String,json:{write:!0}})],RA.prototype,"statisticType",void 0),RA=dSe=E([ht("esri.layers.support.AggregateField")],RA);const S5=RA;let MA=class extends Ni{constructor(){super(...arguments),this.type=null}};E([k({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],MA.prototype,"type",void 0),MA=E([ht("esri.layers.support.FeatureReduction")],MA);const pSe="__begin__",fSe="__end__",KHt=new RegExp(pSe,"ig"),JHt=new RegExp(fSe,"ig"),mYe=new RegExp("^"+pSe,"i"),gYe=new RegExp(fSe+"$","i"),Ooe='"',ZHt=Ooe+" + ",QHt=" + "+Ooe;function eWt(t){return t.replace(new RegExp("\\[","g"),"{").replace(new RegExp("\\]","g"),"}")}function tWt(t){return t.replace(new RegExp("\\{","g"),"[").replace(new RegExp("\\}","g"),"]")}function Roe(t){const e={expression:"",type:"none"};return t.labelExpressionInfo?t.labelExpressionInfo.value?(e.expression=t.labelExpressionInfo.value,e.type="conventional"):t.labelExpressionInfo.expression&&(e.expression=t.labelExpressionInfo.expression,e.type="arcade"):t.labelExpression!=null&&(e.expression=eWt(t.labelExpression),e.type="conventional"),e}function iWt(t){const e=Roe(t);if(!e)return null;switch(e.type){case"conventional":return mSe(e.expression);case"arcade":return e.expression}return null}function rWt(t){const e=Roe(t);if(!e)return null;switch(e.type){case"conventional":return sWt(e.expression);case"arcade":return gSe(e.expression)}return null}function mSe(t){let e;return t?(e=Kx(t,i=>pSe+'$feature["'+i+'"]'+fSe),e=mYe.test(e)?e.replace(mYe,""):Ooe+e,e=gYe.test(e)?e.replace(gYe,""):e+Ooe,e=e.replace(KHt,ZHt).replace(JHt,QHt)):e='""',e}const nWt=/^\s*\{([^}]+)\}\s*$/i;function sWt(t){const e=t?.match(nWt);return e&&e[1].trim()||null}const oWt=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*$/i,aWt=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,lWt=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])([\w\s]+)(\1)\s*\));?\s*$/i;function gSe(t){if(!t)return null;let e=oWt.exec(t)||aWt.exec(t);return e?e[1]||e[3]:(e=lWt.exec(t),e?e[2]:null)}var ySe;let UR=ySe=class extends Ni{constructor(){super(...arguments),this.expression=null,this.title=null,this.value=null}readExpression(t,e){return e.value?mSe(e.value):t}writeExpression(t,e,i){this.value!=null&&(t=mSe(this.value)),t!=null&&(e[i]=t)}clone(){return new ySe({expression:this.expression,title:this.title,value:this.value})}};E([k({type:String,json:{write:{writerEnsuresNonNull:!0}}})],UR.prototype,"expression",void 0),E([Li("expression",["expression","value"])],UR.prototype,"readExpression",null),E([mr("expression")],UR.prototype,"writeExpression",null),E([k({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],UR.prototype,"title",void 0),E([k({json:{read:!1,write:!1}})],UR.prototype,"value",void 0),UR=ySe=E([ht("esri.layers.support.LabelExpressionInfo")],UR);const yYe=UR,vYe=[252,146,31,255],_Ye={type:"esriSMS",style:"esriSMSCircle",size:6,color:vYe,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},bYe={type:"esriSLS",style:"esriSLSSolid",width:.75,color:vYe},wYe={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},uWt={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},vSe={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},_Se={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},bSe={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null},cWt=gd.fromJSON(_Ye),hWt=Tm.fromJSON(bYe),dWt=iw.fromJSON(wYe),pWt=XL.fromJSON(uWt),fWt=gd.fromJSON(vSe),mWt=Tm.fromJSON(_Se),gWt=iw.fromJSON(bSe);var wSe;const Moe=new Bs({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 Doe(t,e,i){return{enabled:!LUe(i?.layer)}}function xYe(t){return!t||t.origin!=="service"&&t.layer?.type!=="map-image"}function yWt(t){return t?.type==="map-image"}function SYe(t){return!!yWt(t)&&!!t.capabilities?.exportMap?.supportsArcadeExpressionForLabeling}function vWt(t){return xYe(t)||SYe(t?.layer)}let Pp=wSe=class extends Ni{static evaluateWhere(t,e){const i=(r,n,s)=>{switch(n){case"=":return r==s;case"<>":return r!=s;case">":return r>s;case">=":return r>=s;case"<":return rvWt(i)?{allowNull:!0}:{enabled:!1}}}})],Pp.prototype,"labelExpressionInfo",void 0),E([mr("labelExpressionInfo")],Pp.prototype,"writeLabelExpressionInfo",null),E([k({type:Moe.apiValues,json:{type:Moe.jsonValues,read:Moe.read,write:Moe.write}})],Pp.prototype,"labelPlacement",void 0),E([k({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],Pp.prototype,"labelPosition",void 0),E([k({type:Number})],Pp.prototype,"maxScale",void 0),E([mr("maxScale")],Pp.prototype,"writeMaxScale",null),E([k({type:Number})],Pp.prototype,"minScale",void 0),E([mr("minScale")],Pp.prototype,"writeMinScale",null),E([k({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:Doe}}}}})],Pp.prototype,"repeatLabel",void 0),E([k({type:Number,cast:Da,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:Doe}}}}})],Pp.prototype,"repeatLabelDistance",void 0),E([k({types:qGt,json:{origins:{"web-scene":{types:YGt,write:dze,default:null}},write:dze,default:null}})],Pp.prototype,"symbol",void 0),E([k({type:Boolean,json:{write:!0}})],Pp.prototype,"useCodedValues",void 0),E([k({type:String,json:{write:!0}})],Pp.prototype,"where",void 0),Pp=wSe=E([ht("esri.layers.support.LabelClass")],Pp);const I2=Pp;var xSe;const SSe=CC({types:UW}),_Wt="esri.layers.support.FeatureReductionBinning";let ev=xSe=class extends MA{constructor(t){super(t),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(t,e,i){const r=t.filter(n=>n.statisticType!=="avg_angle").map(n=>n.toJSON());Ep(i,r,e)}readRenderer(t,e,i){const r=e.drawingInfo?.renderer;return r?l5(r,e,i)??void 0:e.defaultSymbol?e.types&&e.types.length?new YC({defaultSymbol:SSe(e.defaultSymbol,e,i),field:e.typeIdField,uniqueValueInfos:e.types.map(n=>({id:n.id,symbol:SSe(n.symbol,n,i)}))}):new Zv({symbol:SSe(e.defaultSymbol,e,i)}):null}clone(){return new xSe({fields:hi(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:hi(this.labelingInfo),labelsVisible:this.labelsVisible,maxScale:this.maxScale,popupEnabled:this.popupEnabled,popupTemplate:hi(this.popupTemplate),renderer:hi(this.renderer)})}};E([Hr({binning:"binning"})],ev.prototype,"type",void 0),E([Hr({geohash:"geohash"})],ev.prototype,"binType",void 0),E([k({type:Number,range:{min:1,max:9},json:{write:!0}})],ev.prototype,"fixedBinLevel",void 0),E([k({type:[I2],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],ev.prototype,"labelingInfo",void 0),E([k(AA)],ev.prototype,"labelsVisible",void 0),E([k({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],ev.prototype,"maxScale",void 0),E([k(t_)],ev.prototype,"popupEnabled",void 0),E([k({type:yh,json:{name:"popupInfo",write:!0}})],ev.prototype,"popupTemplate",void 0),E([k({type:[S5],json:{write:!0}})],ev.prototype,"fields",void 0),E([mr("fields")],ev.prototype,"writeFields",null),E([k({types:_A,json:{write:{target:"drawingInfo.renderer"}}})],ev.prototype,"renderer",void 0),E([Li("renderer",["drawingInfo.renderer"])],ev.prototype,"readRenderer",null),ev=xSe=E([ht(_Wt)],ev);const CYe=ev;var CSe;const TSe=CC({types:UW}),bWt="esri.layers.support.FeatureReductionCluster";function TYe(t){return t.type==="simple"&&!t.visualVariables?.length}let $f=CSe=class extends Ni{constructor(t){super(t),this.type="cluster",this.clusterRadius=Da("80px"),this.clusterMinSize=Da("12px"),this.clusterMaxSize=Da("50px"),this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=null}readRenderer(t,e,i){const r=e.drawingInfo?.renderer;return r?.authoringInfo?.isAutoGenerated?null:r?TYe(r)?null:l5(r,e,i)??void 0:e.defaultSymbol?e.types&&e.types.length?new YC({defaultSymbol:TSe(e.defaultSymbol,e,i),field:e.typeIdField,uniqueValueInfos:e.types.map(n=>({id:n.id,symbol:TSe(n.symbol,n,i)}))}):new Zv({symbol:TSe(e.defaultSymbol,e,i)}):null}readSymbol(t,e,i){const r=e.drawingInfo?.renderer;return r?.authoringInfo?.isAutoGenerated?null:r&&TYe(r)?l5(r,e,i)?.symbol:null}writeSymbol(t,e,i,r){const n=this.renderer?.authoringInfo?.isAutoGenerated;if(!this.renderer||n){const s=new Zv({symbol:t});e.drawingInfo={renderer:s.write({},r)}}}writeFields(t,e,i){const r=t.filter(n=>n.statisticType!=="avg_angle").map(n=>n.toJSON());Ep(i,r,e)}readFields(t,e,i){return t.filter(r=>!r.isAutoGenerated).map(r=>S5.fromJSON(r))}clone(){return new CSe({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:hi(this.labelingInfo),labelsVisible:this.labelsVisible,fields:hi(this.fields),maxScale:this.maxScale,renderer:hi(this.renderer),symbol:hi(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:hi(this.popupTemplate)})}};E([k({type:["cluster"],readOnly:!0,json:{write:!0}})],$f.prototype,"type",void 0),E([k({type:Number,cast:t=>t==="auto"?t:Da(t),json:{write:!0}})],$f.prototype,"clusterRadius",void 0),E([k({type:Number,cast:Da,json:{write:!0}})],$f.prototype,"clusterMinSize",void 0),E([k({type:Number,cast:Da,json:{write:!0}})],$f.prototype,"clusterMaxSize",void 0),E([k({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],$f.prototype,"maxScale",void 0),E([k(t_)],$f.prototype,"popupEnabled",void 0),E([k({type:yh,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],$f.prototype,"popupTemplate",void 0),E([k({types:_A,json:{write:{target:"drawingInfo.renderer"}}})],$f.prototype,"renderer",void 0),E([Li("renderer",["drawingInfo.renderer"])],$f.prototype,"readRenderer",null),E([k({types:HGt})],$f.prototype,"symbol",void 0),E([Li("symbol",["drawingInfo.renderer"])],$f.prototype,"readSymbol",null),E([mr("symbol")],$f.prototype,"writeSymbol",null),E([k({type:[I2],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],$f.prototype,"labelingInfo",void 0),E([k(AA)],$f.prototype,"labelsVisible",void 0),E([k({type:[S5],json:{write:!0}})],$f.prototype,"fields",void 0),E([mr("fields")],$f.prototype,"writeFields",null),E([Li("fields")],$f.prototype,"readFields",null),$f=CSe=E([ht(bWt)],$f);const EYe=$f;var ESe;let Foe=ESe=class extends MA{constructor(t){super(t),this.type="selection"}clone(){return new ESe}};E([k({type:["selection"]})],Foe.prototype,"type",void 0),Foe=ESe=E([ht("esri.layers.support.FeatureReductionSelection")],Foe);const ISe=Foe,IYe={key:"type",base:MA,typeMap:{cluster:EYe,binning:CYe}},wWt={types:{key:"type",base:MA,typeMap:{selection:ISe,cluster:EYe,binning:CYe}},json:{name:"layerDefinition.featureReduction",write:{allowNull:!0},origins:{"web-map":{types:IYe},"portal-item":{types:IYe},"web-scene":{types:{key:"type",base:MA,typeMap:{selection:ISe}}}}}},jR={Base64:0,Hex:1,String:2,Raw:3},rB=8,AYe=(1<>16)+(e>>16)+(i>>16)<<16|65535&i}function xWt(t){const e=[];for(let i=0,r=t.length*rB;i>5]|=(t.charCodeAt(i/rB)&AYe)<>5]>>>i%32&AYe));return e.join("")}function CWt(t){const e="0123456789abcdef",i=[];for(let r=0,n=4*t.length;r>2]>>r%4*8+4&15)+e.charAt(t[r>>2]>>r%4*8&15));return i.join("")}function TWt(t){const e="=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=[];for(let n=0,s=4*t.length;n>2]>>n%4*8&255)<<16|(t[n+1>>2]>>(n+1)%4*8&255)<<8|t[n+2>>2]>>(n+2)%4*8&255;for(let a=0;a<4;a++)8*n+6*a>32*t.length?r.push(e):r.push(i.charAt(o>>6*(3-a)&63))}return r.join("")}function EWt(t,e){return t<>>32-e}function Loe(t,e,i,r,n,s){return zR(EWt(zR(zR(e,t),zR(r,s)),n),i)}function e0(t,e,i,r,n,s,o){return Loe(e&i|~e&r,t,e,n,s,o)}function t0(t,e,i,r,n,s,o){return Loe(e&r|i&~r,t,e,n,s,o)}function i0(t,e,i,r,n,s,o){return Loe(e^i^r,t,e,n,s,o)}function r0(t,e,i,r,n,s,o){return Loe(i^(e|~r),t,e,n,s,o)}function IWt(t,e){t[e>>5]|=128<>>9<<4)]=e;let i=1732584193,r=-271733879,n=-1732584194,s=271733878;for(let o=0;ot.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions&&this.legendOptions.clone(),levels:hi(this.levels)})}};E([k()],Nq.prototype,"levels",void 0),E([mr("levels")],Nq.prototype,"writeLevels",null),Nq=ASe=E([ht("esri.views.2d.engine.LevelDependentSizeVariable")],Nq);const AWt=Ei.getLogger("esri.views.2d.layers.support.clusterUtils");Gi.add("esri-cluster-arcade-enabled",!0);const PWt=Gi("esri-cluster-arcade-enabled"),PSe=(t,e,i,r,n)=>{const s=e.clone();if(!OYe(s))return s;if(s.authoringInfo||(s.authoringInfo=new HW),s.authoringInfo.isAutoGenerated=!0,"visualVariables"in s){const o=(s.visualVariables||[]).filter(l=>l.valueExpression!=="$view.scale"),a=OSe(o);o.forEach(l=>{l.type==="rotation"?l.field?l.field=C5(t,l.field,"avg_angle","number"):l.valueExpression&&(l.field=$q(t,l.valueExpression,"avg_angle","number"),l.valueExpression=null):l.normalizationField?(l.field=C5(t,l.field,"avg_norm","number",l.normalizationField),l.normalizationField=null):l.field?l.field=C5(t,l.field,"avg","number"):l.valueExpression&&(l.field=$q(t,l.valueExpression,"avg","number"),l.valueExpression=null)}),lt(a)&&!OWt(o)&&n&&(o.push(RSe(i,r)),s.dynamicClusterSize=!0),s.visualVariables=o}switch(s.type){case"simple":break;case"pie-chart":for(const o of s.attributes)o.field?o.field=C5(t,o.field,"sum","number"):o.valueExpression&&(o.field=$q(t,o.valueExpression,"sum","number"),o.valueExpression=null);break;case"unique-value":s.field?s.field=C5(t,s.field,"mode","string"):s.valueExpression&&(s.field=$q(t,s.valueExpression,"mode","string"),s.valueExpression=null);break;case"class-breaks":s.normalizationField?(s.field=C5(t,s.field,"avg_norm","number",s.normalizationField),s.normalizationField=null):s.field?s.field=C5(t,s.field,"avg","number"):s.valueExpression&&(s.field=$q(t,s.valueExpression,"avg","number"),s.valueExpression=null)}return s},OSe=t=>{for(const e of t)if(e.type==="size")return e;return null};function PYe(t,e,i){const r=t.clone();let n=!1;if("visualVariables"in r){const s=(r.visualVariables||[]).filter(a=>a.valueExpression!=="$view.scale"),o=OSe(s);lt(o)&&(r.visualVariables||(r.visualVariables=[]),r.visualVariables.push(RSe(e,i)),r.dynamicClusterSize=!0,n=!0)}return{renderer:r,didInject:n}}const OWt=t=>{for(const e of t)if(e.field==="cluster_count")return!0;return!1},RSe=(t,e)=>{const i=[new S9({value:0,size:0}),new S9({value:1})];if(lt(e))return new i5({field:"cluster_count",stops:[...i,new S9({value:2,size:0})]});const r=Object.keys(e).reduce((n,s)=>({...n,[s]:[...i,new S9({value:Math.max(2,e[s].minValue),size:t.clusterMinSize}),new S9({value:Math.max(3,e[s].maxValue),size:t.clusterMaxSize})]}),{});return new Nq({field:"cluster_count",levels:r})},OYe=t=>{const e=i=>AWt.error(new st("Unsupported-renderer",i,{renderer:t}));switch(t.type){case"unique-value":if(t.field2||t.field3)return e("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1;break;case"class-breaks":if(t.normalizationField){const i=t.normalizationType;if(i!=="field")return e(`FeatureReductionCluster does not support a normalizationType of ${i}`),!1}break;case"simple":case"pie-chart":break;default:return e(`FeatureReductionCluster does not support renderers of type ${t.type}`),!1}if(!PWt){if("valueExpression"in t&&t.valueExpression)return e("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"),!1;if(("visualVariables"in t&&t.visualVariables||[]).some(i=>!(!("valueExpression"in i)||!i.valueExpression)))return e("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function RWt(t,e,i){switch(t){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=i,n="field",s=e.toLowerCase()+",norm:"+n+","+r.toLowerCase();return"cluster_avg_"+koe(s)}}}function $q(t,e,i,r){const n=koe(e),s=i==="mode"?`cluster_type_${n}`:i==="sum"?`cluster_sum_${n}`:`cluster_avg_${n}`;return t.some(o=>o.name===s)||t.push(new S5({name:s,isAutoGenerated:!0,onStatisticExpression:new hSe({expression:e,returnType:r}),statisticType:i})),s}function C5(t,e,i,r,n){if(e==="cluster_count"||t.some(o=>o.name===e))return e;const s=RWt(i,e,n);return t.some(o=>o.name===s)||(i==="avg_norm"?t.push(new S5({name:s,isAutoGenerated:!0,onStatisticExpression:new hSe({expression:`$feature.${e} / $feature.${n}`,returnType:r}),statisticType:"avg"})):t.push(new S5({name:s,isAutoGenerated:!0,onStatisticField:e,statisticType:i}))),s}const Bq=t=>{let e=class extends t{constructor(...i){super(...i),this.own(this.watch("renderer",()=>{if(this.featureReduction){const r=this._normalizeFeatureReduction(this.featureReduction);this._set("featureReduction",r)}},!0))}set featureReduction(i){const r=this._normalizeFeatureReduction(i);this._set("featureReduction",r)}set renderer(i){}_normalizeFeatureReduction(i){if(i?.type!=="cluster")return i;const r=i.clone(),n=[new S5({name:"cluster_count",isAutoGenerated:!0,statisticType:"count"})],s=(r.fields??[]).filter(a=>!a.isAutoGenerated);if(i.renderer&&!i.renderer.authoringInfo?.isAutoGenerated)return r.fields=[...n,...s],r;if(i.symbol)return r.fields=[...n,...s],r.renderer=null,r;if(!this.renderer)return i;const o=PSe(n,this.renderer,i,null,!1);return r.fields=[...n,...s],r.renderer=o,r}};return E([k(wWt)],e.prototype,"featureReduction",null),e=E([ht("esri.layers.mixins.FeatureReductionLayer")],e),e},MWt={"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},"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-map/operational-layers":{ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CSV:!0,GeoRSS:!0,GeoJSON:!0,GroupLayer:!0,KML:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},"web-map/basemap":{ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0,BingMapsAerial:!0,BingMapsRoad:!0,BingMapsHybrid:!0},"web-map/tables":{ArcGISFeatureLayer:!0},"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISSceneServiceLayer:!0,PointCloudLayer:!0,BuildingSceneLayer:!0,IntegratedMeshLayer:!0,OrientedImageryLayer:!0}},jc=t=>{let e=class extends t{constructor(){super(...arguments),this.title=null}writeListMode(i,r,n,s){(s&&s.layerContainerType==="ground"||i&&CVe(this,n,{},s))&&(r[n]=i)}writeOperationalLayerType(i,r,n,s){!i||s&&s.layerContainerType==="tables"||(r.layerType=i)}writeTitle(i,r){r.title=i??"Layer"}read(i,r){r&&(r.layer=this),a6t(this,i,n=>super.read(i,n),r)}write(i,r){if(r?.origin){const o=`${r.origin}/${r.layerContainerType||"operational-layers"}`,a=MWt[o];let l=a&&a[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 st("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(i,{...r,layer:this}),s=!!r&&!!r.messages&&!!r.messages.filter(o=>o instanceof st&&o.name==="web-document-write:property-required").length;return IC(n?.url)?(r?.messages?.push(new st("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 E([k({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],e.prototype,"id",void 0),E([k(xWe)],e.prototype,"listMode",void 0),E([mr("listMode")],e.prototype,"writeListMode",null),E([k({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1}}}})],e.prototype,"operationalLayerType",void 0),E([mr("operationalLayerType")],e.prototype,"writeOperationalLayerType",null),E([k(Tq)],e.prototype,"opacity",void 0),E([k({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),E([mr("title"),mr(["web-scene"],"title")],e.prototype,"writeTitle",null),E([k({type:Boolean,json:{name:"visibility"}})],e.prototype,"visible",void 0),e=E([ht("esri.layers.mixins.OperationalLayer")],e),e};var MSe;const DSe=new Bs({asc:"ascending",desc:"descending"});let nB=MSe=class extends Ni{constructor(t){super(t),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new MSe({field:this.field,valueExpression:this.valueExpression,order:this.order})}};E([k({type:String,json:{write:!0}})],nB.prototype,"field",void 0),E([k({type:String,json:{write:!0}})],nB.prototype,"valueExpression",void 0),E([k({type:DSe.apiValues,json:{read:DSe.read,write:DSe.write}})],nB.prototype,"order",void 0),nB=MSe=E([ht("esri.layers.support.OrderByInfo")],nB);const RYe=nB;function DWt(t,e,i){if(!t)return null;const r=t.find(s=>!!s.field);if(!r)return null;const n=new RYe;return n.read(r,i),[n]}function FWt(t,e,i,r){const n=t.find(s=>!!s.field);n&&Ep(i,[n.toJSON()],e)}const Noe=t=>{let e=class extends t{constructor(){super(...arguments),this.orderBy=null}};return E([k({type:[RYe],json:{origins:{"web-scene":{write:!1,read:!1}},read:{source:"layerDefinition.orderBy",reader:DWt},write:{target:"layerDefinition.orderBy",writer:FWt}}})],e.prototype,"orderBy",void 0),e=E([ht("esri.layers.mixins.OrderedLayer")],e),e};let FSe,or=null;function MYe(){return!!or}function LWt(){return!!Gi("esri-wasm")}function DYe(){return FSe||(FSe=Promise.resolve().then(()=>tGi).then(t=>t.p).then(({default:t})=>t({locateFile:e=>zl(`esri/geometry/support/${e}`)})).then(t=>{LYe(t)}),FSe)}var Gq,xu,B1;(function(t){function e(s,o,a){or.ensureCache.prepare();const l=T5(a),c=a===l,d=or.ensureFloat64(l),p=or._pe_geog_to_proj(or.getPointer(s),o,d);return p&&HR(a,o,d,c),p}function i(s,o,a,l){switch(l){case xu.PE_TRANSFORM_P_TO_G:return r(s,o,a);case xu.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){or.ensureCache.prepare();const c=T5(a),d=a===c,p=or.ensureFloat64(c),y=or._pe_proj_to_geog_center(or.getPointer(s),o,p,l);return y&&HR(a,o,p,d),y}t.geogToProj=e,t.projGeog=i,t.projToGeog=r,t.projToGeogCenter=n})(Gq||(Gq={})),function(t){function e(){t.PE_BUFFER_MAX=or.PeDefs.prototype.PE_BUFFER_MAX,t.PE_NAME_MAX=or.PeDefs.prototype.PE_NAME_MAX,t.PE_MGRS_MAX=or.PeDefs.prototype.PE_MGRS_MAX,t.PE_USNG_MAX=or.PeDefs.prototype.PE_USNG_MAX,t.PE_DD_MAX=or.PeDefs.prototype.PE_DD_MAX,t.PE_DDM_MAX=or.PeDefs.prototype.PE_DDM_MAX,t.PE_DMS_MAX=or.PeDefs.prototype.PE_DMS_MAX,t.PE_UTM_MAX=or.PeDefs.prototype.PE_UTM_MAX,t.PE_PARM_MAX=or.PeDefs.prototype.PE_PARM_MAX,t.PE_TYPE_NONE=or.PeDefs.prototype.PE_TYPE_NONE,t.PE_TYPE_GEOGCS=or.PeDefs.prototype.PE_TYPE_GEOGCS,t.PE_TYPE_PROJCS=or.PeDefs.prototype.PE_TYPE_PROJCS,t.PE_TYPE_GEOGTRAN=or.PeDefs.prototype.PE_TYPE_GEOGTRAN,t.PE_TYPE_COORDSYS=or.PeDefs.prototype.PE_TYPE_COORDSYS,t.PE_TYPE_UNIT=or.PeDefs.prototype.PE_TYPE_UNIT,t.PE_TYPE_LINUNIT=or.PeDefs.prototype.PE_TYPE_LINUNIT,t.PE_STR_OPTS_NONE=or.PeDefs.prototype.PE_STR_OPTS_NONE,t.PE_STR_AUTH_NONE=or.PeDefs.prototype.PE_STR_AUTH_NONE,t.PE_STR_AUTH_TOP=or.PeDefs.prototype.PE_STR_AUTH_TOP,t.PE_STR_NAME_CANON=or.PeDefs.prototype.PE_STR_NAME_CANON,t.PE_PARM_X0=or.PeDefs.prototype.PE_PARM_X0,t.PE_PARM_ND=or.PeDefs.prototype.PE_PARM_ND,t.PE_TRANSFORM_1_TO_2=or.PeDefs.prototype.PE_TRANSFORM_1_TO_2,t.PE_TRANSFORM_2_TO_1=or.PeDefs.prototype.PE_TRANSFORM_2_TO_1,t.PE_TRANSFORM_P_TO_G=or.PeDefs.prototype.PE_TRANSFORM_P_TO_G,t.PE_TRANSFORM_G_TO_P=or.PeDefs.prototype.PE_TRANSFORM_G_TO_P,t.PE_HORIZON_RECT=or.PeDefs.prototype.PE_HORIZON_RECT,t.PE_HORIZON_POLY=or.PeDefs.prototype.PE_HORIZON_POLY,t.PE_HORIZON_LINE=or.PeDefs.prototype.PE_HORIZON_LINE,t.PE_HORIZON_DELTA=or.PeDefs.prototype.PE_HORIZON_DELTA}t.init=e}(xu||(xu={})),function(t){const e={},i={},r=v=>{if(v){const S=v.getType();switch(S){case xu.PE_TYPE_GEOGCS:v=or.castObject(v,or.PeGeogcs);break;case xu.PE_TYPE_PROJCS:v=or.castObject(v,or.PeProjcs);break;case xu.PE_TYPE_GEOGTRAN:v=or.castObject(v,or.PeGeogtran);break;default:S&xu.PE_TYPE_UNIT&&(v=or.castObject(v,or.PeUnit))}}return v};function n(){or.PeFactory.prototype.initialize(null)}function s(v){return o(xu.PE_TYPE_COORDSYS,v)}function o(v,S){let I=null,O=e[v];if(O||(O={},e[v]=O),O.hasOwnProperty(String(S)))I=O[S];else{const L=or.PeFactory.prototype.factoryByType(v,S);or.compare(L,or.NULL)||(I=L,O[S]=I)}return I=r(I),I}function a(v,S){let I=null,O=i[v];if(O||(O={},i[v]=O),O.hasOwnProperty(S))I=O[S];else{const L=or.PeFactory.prototype.fromString(v,S);or.compare(L,or.NULL)||(I=L,O[S]=I)}return I=r(I),I}function l(v){return o(xu.PE_TYPE_GEOGCS,v)}function c(v){return o(xu.PE_TYPE_GEOGTRAN,v)}function d(v){return or.PeFactory.prototype.getCode(v)}function p(v){return o(xu.PE_TYPE_PROJCS,v)}function y(v){return o(xu.PE_TYPE_UNIT,v)}t.initialize=n,t.coordsys=s,t.factoryByType=o,t.fromString=a,t.geogcs=l,t.geogtran=c,t.getCode=d,t.projcs=p,t.unit=y}(B1||(B1={}));let FYe=null;var $oe,LSe,Boe,kSe,Goe,NSe,Voe,Vq,$Se;function LYe(t){function e(s,o,a){s[o]=a(s[o])}or=t,xu.init(),$oe.init(),Goe.init(),Voe.init(),Vq.init(),FYe=class extends or.PeGCSExtent{destroy(){or.destroy(this)}};const i=[or.PeDatum,or.PeGeogcs,or.PeGeogtran,or.PeObject,or.PeParameter,or.PePrimem,or.PeProjcs,or.PeSpheroid,or.PeUnit];for(const s of i)e(s.prototype,"getName",o=>function(){return o.call(this,new Array(xu.PE_NAME_MAX))});for(const s of[or.PeGeogtran,or.PeProjcs])e(s.prototype,"getParameters",o=>function(){const a=new Array(xu.PE_PARM_MAX);let l=o.call(this);for(let c=0;cfunction(){const o=this.getSize();if(!o)return null;const a=[];return HR(a,o,s.call(this)),a}),e(or.PeGTlistExtendedEntry.prototype,"getEntries",s=>{const o=or._pe_getPeGTlistExtendedGTsSize();return function(){let a=null;const l=s.call(this);if(!or.compare(l,or.NULL)){a=[l];const c=this.getSteps();if(c>1){const d=or.getPointer(l);for(let p=1;pfunction(){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(!or.compare(l,or.NULL)){a=[l];const c=l.getNump();if(c>1){const d=or.getPointer(l);for(let p=1;p{e.push(i[0],i[1])})):e=t,e}function HR(t,e,i,r=!1){if(r)for(let n=0;n<2*e;n++)t[n]=or.getValue(i+n*Float64Array.BYTES_PER_ELEMENT,"double");else{const n=t.length===0;for(let s=0;s1)){const v=or.getPointer(y);for(let S=1;S{DA(n);const s=n.getGeogtran();DA(s),s.getParameters().forEach(DA),[s.getGeogcs1(),s.getGeogcs2()].forEach(o=>{DA(o);const a=o.getDatum();DA(a),DA(a.getSpheroid()),DA(o.getPrimem()),DA(o.getUnit())})});or.PeGTlistExtendedEntry.prototype.Delete(i[0])}}t.destroy=e}(LSe||(LSe={})),function(t){function e(i,r,n,s,o){or.ensureCache.prepare();const a=T5(n),l=n===a,c=or.ensureFloat64(a);let d=0;s&&(d=or.ensureFloat64(s));const p=or._pe_geog_to_geog(or.getPointer(i),r,c,d,o);return p&&HR(n,r,c,l),p}t.geogToGeog=e}(Boe||(Boe={})),function(t){const e=(c,d,p,y,v,S)=>{let I,O;switch(or.ensureCache.prepare(),c){case"dd":I=or._pe_geog_to_dd,O=xu.PE_DD_MAX;break;case"ddm":I=or._pe_geog_to_ddm,O=xu.PE_DDM_MAX;break;case"dms":I=or._pe_geog_to_dms,O=xu.PE_DMS_MAX}let L=0;d&&(L=or.getPointer(d));const N=T5(y),G=or.ensureFloat64(N),V=Uoe(p,O),Y=I(L,p,G,v,or.ensureInt32(V));if(Y)for(let X=0;X{let S;switch(or.ensureCache.prepare(),c){case"dd":S=or._pe_dd_to_geog;break;case"ddm":S=or._pe_ddm_to_geog;break;case"dms":S=or._pe_dms_to_geog}let I=0;d&&(I=or.getPointer(d));const O=y.map(V=>or.ensureString(V)),L=or.ensureInt32(O),N=or.ensureFloat64(new Array(2*p)),G=S(I,p,L,N);return G&&HR(v,p,N),G};function r(c,d,p,y,v){return e("dms",c,d,p,y,v)}function n(c,d,p,y){return i("dms",c,d,p,y)}function s(c,d,p,y,v){return e("ddm",c,d,p,y,v)}function o(c,d,p,y){return i("ddm",c,d,p,y)}function a(c,d,p,y,v){return e("dd",c,d,p,y,v)}function l(c,d,p,y){return i("dd",c,d,p,y)}t.geogToDms=r,t.dmsToGeog=n,t.geogToDdm=s,t.ddmToGeog=o,t.geogToDd=a,t.ddToGeog=l}(kSe||(kSe={})),function(t){function e(){t.PE_MGRS_STYLE_NEW=or.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW,t.PE_MGRS_STYLE_OLD=or.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD,t.PE_MGRS_STYLE_AUTO=or.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO,t.PE_MGRS_180_ZONE_1_PLUS=or.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS,t.PE_MGRS_ADD_SPACES=or.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES}function i(n,s,o,a,l,c,d){or.ensureCache.prepare();let p=0;n&&(p=or.getPointer(n));const y=T5(o),v=or.ensureFloat64(y),S=Uoe(s,xu.PE_MGRS_MAX),I=or.ensureInt32(S),O=or._pe_geog_to_mgrs_extended(p,s,v,a,l,c,I);if(O)for(let L=0;Lor.ensureString(S)),p=or.ensureInt32(d),y=or.ensureFloat64(new Array(2*s)),v=or._pe_mgrs_to_geog_extended(c,s,p,a,y);return v&&HR(l,s,y),v}t.init=e,t.geogToMgrsExtended=i,t.mgrsToGeogExtended=r}(Goe||(Goe={})),function(t){function e(r,n,s,o,a,l,c){or.ensureCache.prepare();let d=0;r&&(d=or.getPointer(r));const p=T5(s),y=or.ensureFloat64(p),v=Uoe(n,xu.PE_MGRS_MAX),S=or.ensureInt32(v),I=or._pe_geog_to_usng(d,n,y,o,a,l,S);if(I)for(let O=0;Oor.ensureString(y)),c=or.ensureInt32(l),d=or.ensureFloat64(new Array(2*n)),p=or._pe_usng_to_geog(a,n,c,d);return p&&HR(o,n,d),p}t.geogToUsng=e,t.usngToGeog=i}(NSe||(NSe={})),function(t){function e(){t.PE_UTM_OPTS_NONE=or.PeNotationUtm.prototype.PE_UTM_OPTS_NONE,t.PE_UTM_OPTS_ADD_SPACES=or.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES,t.PE_UTM_OPTS_NS=or.PeNotationUtm.prototype.PE_UTM_OPTS_NS}function i(n,s,o,a,l){or.ensureCache.prepare();let c=0;n&&(c=or.getPointer(n));const d=T5(o),p=or.ensureFloat64(d),y=Uoe(s,xu.PE_UTM_MAX),v=or.ensureInt32(y),S=or._pe_geog_to_utm(c,s,p,a,v);if(S)for(let I=0;Ior.ensureString(S)),p=or.ensureInt32(d),y=or.ensureFloat64(new Array(2*s)),v=or._pe_utm_to_geog(c,s,p,a,y);return v&&HR(l,s,y),v}t.init=e,t.geogToUtm=i,t.utmToGeog=r}(Voe||(Voe={})),function(t){const e=new Map;function i(){t.PE_PCSINFO_OPTION_NONE=or.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE,t.PE_PCSINFO_OPTION_DOMAIN=or.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN,t.PE_POLE_OUTSIDE_BOUNDARY=or.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY,t.PE_POLE_POINT=or.PePCSInfo.prototype.PE_POLE_POINT}function r(n,s=t.PE_PCSINFO_OPTION_DOMAIN){let o=null,a=null;return e.has(n)&&(a=e.get(n),a[s]&&(o=a[s])),o||(o=or.PePCSInfo.prototype.generate(n,s),a||(a=[],e.set(n,a)),a[s]=o),o}t.init=i,t.generate=r}(Vq||(Vq={})),function(t){function e(){return or.PeVersion.prototype.version_string()}t.versionString=e}($Se||($Se={}));const kWt=Object.freeze(Object.defineProperty({__proto__:null,get PeCSTransformations(){return Gq},get PeDefs(){return xu},get PeFactory(){return B1},get PeGCSExtent(){return FYe},get PeGTTransformations(){return Boe},get PeGTlistExtended(){return $oe},get PeGTlistExtendedEntry(){return LSe},get PeNotationDms(){return kSe},get PeNotationMgrs(){return Goe},get PeNotationUsng(){return NSe},get PeNotationUtm(){return Voe},get PePCSInfo(){return Vq},get PeVersion(){return $Se},_init:LYe,get _pe(){return or},isLoaded:MYe,isSupported:LWt,load:DYe},Symbol.toStringTag,{value:"Module"})),E5=Math.PI/180,NWt=/SPHEROID\[([^\]]+)]/i,WR=wu.radius,A2=wu.eccentricitySquared,$Wt={a1:WR*A2,a2:WR*A2*WR*A2,a3:WR*A2*A2/2,a4:WR*A2*WR*A2*2.5,a5:WR*A2+WR*A2*A2/2,a6:1-A2},BWt={4267:{a:63782064e-1,f:1/294.9786982},4269:{a:6378137,f:1/298.257222101},4326:{a:wu.radius,f:wu.flattening},104900:{a:2439700,f:0},104901:{a:6051e3,f:0},104902:{a:6051800,f:0},104903:{a:X3.radius,f:X3.flattening},104904:{a:3393400,f:1/192.0430107526882},104905:{a:iA.radius,f:iA.flattening},104906:{a:6200,f:0},104907:{a:11100,f:0},104908:{a:71492e3,f:.06487439154031222},104909:{a:8200,f:0},104910:{a:83500,f:0},104911:{a:1e4,f:0},104912:{a:2409300,f:0},104913:{a:15e3,f:0},104914:{a:4e4,f:0},104915:{a:1562090,f:0},104916:{a:2632345,f:0},104917:{a:85e3,f:0},104918:{a:1821460,f:0},104919:{a:5e3,f:0},104920:{a:12e3,f:0},104921:{a:3e4,f:3},104922:{a:18e3,f:0},104923:{a:14e3,f:0},104924:{a:49300,f:0},104925:{a:60268e3,f:1/10.2079945799458},104926:{a:16e3,f:0},104927:{a:9500,f:0},104928:{a:56e4,f:0},104929:{a:249400,f:0},104930:{a:59500,f:0},104931:{a:16e3,f:0},104932:{a:133e3,f:0},104933:{a:718e3,f:0},104934:{a:888e3,f:0},104935:{a:1986300,f:0},104936:{a:1e4,f:0},104937:{a:41900,f:0},104938:{a:11e4,f:0},104939:{a:50100,f:0},104940:{a:764e3,f:0},104941:{a:11e3,f:0},104942:{a:529800,f:0},104943:{a:2575e3,f:0},104944:{a:25559e3,f:1/43.61604095563141},104945:{a:578900,f:0},104946:{a:33e3,f:0},104947:{a:21e3,f:0},104948:{a:13e3,f:0},104949:{a:31e3,f:0},104950:{a:27e3,f:0},104951:{a:42e3,f:0},104952:{a:235800,f:0},104953:{a:761400,f:0},104954:{a:15e3,f:0},104955:{a:54e3,f:0},104956:{a:77e3,f:0},104957:{a:27e3,f:0},104958:{a:788900,f:0},104959:{a:584700,f:0},104960:{a:24764e3,f:.01708124697141011},104961:{a:74e3,f:0},104962:{a:79e3,f:0},104963:{a:104e3,f:.14423076923076922},104964:{a:29e3,f:0},104965:{a:17e4,f:0},104966:{a:208e3,f:0},104967:{a:4e4,f:0},104968:{a:1352600,f:0},104969:{a:1195e3,f:0},104970:{a:593e3,f:0},104971:{a:iA.radius,f:0},104972:{a:47e4,f:0},104973:{a:255e3,f:0},104974:{a:2439400,f:0}};let joe=0,BSe=class D9e{static fromGE(e){const i=new D9e;return i._wkt=e.wkt,i._wkid=e.wkid,i._isInverse=e.isInverse,i}constructor(e){this.uid=joe++,e?(this._wkt=e.wkt!=null?e.wkt:null,this._wkid=e.wkid!=null?e.wkid:-1,this._isInverse=e.isInverse!=null&&e.isInverse===!0):(this._wkt=null,this._wkid=-1,this._isInverse=!1)}get wkt(){return this._wkt}set wkt(e){this._wkt=e,this.uid=joe++}get wkid(){return this._wkid}set wkid(e){this._wkid=e,this.uid=joe++}get isInverse(){return this._isInverse}set isInverse(e){this._isInverse=e,this.uid=joe++}getInverse(){const e=new D9e;return e._wkt=this.wkt,e._wkid=this._wkid,e._isInverse=!this.isInverse,e}},zoe=class Kie{static cacheKey(e,i){return[e.wkid!==void 0&&e.wkid!==null?e.wkid.toString():"-1",e.wkt!==void 0&&e.wkt!==null?e.wkt.toString():"",i.wkid!==void 0&&i.wkid!==null?i.wkid.toString():"-1",i.wkt!==void 0&&i.wkt!==null?i.wkt.toString():""].join(",")}static fromGE(e){const i=new Kie;let r="";for(const n of e.steps){const s=BSe.fromGE(n);i.steps.push(s),r+=s.uid.toString()+","}return i._cachedProjection={},i._gtlistentry=null,i._chain=r,i}constructor(e){if(this.steps=[],this._cachedProjection={},this._chain="",this._gtlistentry=null,e&&e.steps)for(const i of e.steps)i instanceof BSe?this.steps.push(i):this.steps.push(new BSe({wkid:i.wkid,wkt:i.wkt,isInverse:i.isInverse}))}getInverse(){const e=new Kie;e.steps=[];for(let i=this.steps.length-1;i>=0;i--){const r=this.steps[i];e.steps.push(r.getInverse())}return e}getGTListEntry(){let e="";for(const i of this.steps)e+=i.uid.toString()+",";return e!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=e),this._gtlistentry}assignCachedGe(e,i,r){this._cachedProjection[Kie.cacheKey(e,i)]=r}getCachedGeTransformation(e,i){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[Kie.cacheKey(e,i)];return n===void 0?null:n}},qR=null,Uq=null,GSe=null,VSe={};const kYe=new z_e;function lw(){return!!qR&&MYe()}function P2(t){return lt(GSe)&&(GSe=Promise.all([DYe(),Promise.resolve().then(()=>uRi).then(e=>e.g),Promise.resolve().then(()=>lGi)])),GSe.then(([,e,{hydratedAdapter:i}])=>{sn(t),Uq=i,qR=e.default,qR._enableProjection(kWt),kYe.notify()})}function rp(t,e,i=null,r=null){return Array.isArray(t)?t.length===0?[]:jq(Uq,t,t[0].spatialReference,e,i,r):jq(Uq,[t],t.spatialReference,e,i,r)[0]}function jq(t,e,i,r,n=null,s=null){if(lt(i)||lt(r))return e;if(i_(i,r,n))return e.map(o=>VWt(o,i,r));if(lt(n)){const o=zoe.cacheKey(i,r);VSe[o]!==void 0?n=VSe[o]:(n=USe(i,r,void 0),lt(n)&&(n=new zoe),VSe[o]=n)}if(lt(qR)||lt(t))throw new jSe;return ye(s)?qR._project(t,e,i,r,n,s):qR._project(t,e,i,r,n)}function FA(t,e){const i=NYe([t],e);return ye(i.pending)?{pending:i.pending,geometry:null}:ye(i.geometries)?{pending:null,geometry:i.geometries[0]}:{pending:null,geometry:null}}function NYe(t,e){if(!lw()){for(const i of t)if(ye(i)&&!Ca(i.spatialReference,e)&&gh(i.spatialReference)&&gh(e)&&!i_(i.spatialReference,e))return Ia(kYe),{pending:P2(),geometries:null}}return{pending:null,geometries:t.map(i=>lt(i)?null:Ca(i.spatialReference,e)?i:gh(i.spatialReference)&&gh(e)?GWt(i,e):null)}}function USe(t,e,i=null){if(lt(t)||lt(e))return null;if(lt(qR)||lt(Uq))throw new jSe;const r=qR._getTransformation(Uq,t,e,i,i?.spatialReference);return r!==null?zoe.fromGE(r):null}class jSe extends st{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}var Vi;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.SPHERICAL_ECEF=1]="SPHERICAL_ECEF",t[t.WGS84=2]="WGS84",t[t.WEB_MERCATOR=3]="WEB_MERCATOR",t[t.WGS84_ECEF=4]="WGS84_ECEF",t[t.CGCS2000=5]="CGCS2000",t[t.WGS84_COMPARABLE_LON_LAT=6]="WGS84_COMPARABLE_LON_LAT",t[t.SPHERICAL_MARS_PCPF=7]="SPHERICAL_MARS_PCPF",t[t.GCSMARS2000=8]="GCSMARS2000",t[t.SPHERICAL_MOON_PCPF=9]="SPHERICAL_MOON_PCPF",t[t.GCSMOON2000=10]="GCSMOON2000",t[t.LON_LAT=11]="LON_LAT",t[t.PLATE_CARREE=12]="PLATE_CARREE"})(Vi||(Vi={}));function GWt(t,e){try{const i=rp(t,e);if(i==null)return null;"xmin"in t&&"xmin"in i&&(i.zmin=t.zmin,i.zmax=t.zmax);const r=k9(i.type,t.spatialReference,e);return ye(r)&&r(i),i}catch(i){if(!(i instanceof jSe))throw i;return null}}function i_(t,e,i){return!i&&(!!Ca(t,e)||gh(t)&&gh(e)&&!!KYe(t,e,ZYe))}async function YR(t,e,i,r){if(lw())return Nre(r);if(Array.isArray(t)){for(const{source:n,dest:s,geographicTransformation:o}of t)if(!i_(n,s,o))return P2(r)}else if(!i_(t,e,i))return P2(r);return Nre(r)}function VWt(t,e,i){return t?"x"in t?UWt(t,e,new Yi,i,0):"xmin"in t?HWt(t,e,new vr,i,0):"rings"in t?BYe(t,e,new po,i,0):"paths"in t?zWt(t,e,new va,i,0):"points"in t?jWt(t,e,new fd,i,0):null:null}function UWt(t,e,i,r,n){Bf[0]=t.x,Bf[1]=t.y;const s=t.z;return Bf[2]=s!==void 0?s:n,LA(Bf,e,0,Bf,r,0,1)?(i.x=Bf[0],i.y=Bf[1],i.spatialReference=r,s===void 0?(i.z=void 0,i.hasZ=!1):(i.z=Bf[2],i.hasZ=!0),t.m===void 0?(i.m=void 0,i.hasM=!1):(i.m=t.m,i.hasM=!0),i):null}function jWt(t,e,i,r,n){const{points:s,hasZ:o,hasM:a}=t,l=[],c=s.length,d=[];for(const p of s)d.push(p[0],p[1],o?p[2]:n);if(!LA(d,e,0,d,r,0,c))return null;for(let p=0;p.3?(I=l/y*(1+S*(n.a1+Y+v*X)/y),ge=Math.asin(I),L=I*I,O=Math.sqrt(1-L)):(O=d/y*(1-v*(n.a5-Y-S*X)/y),ge=Math.acos(O),L=1-O*O,I=Math.sqrt(L)),N=1-wu.eccentricitySquared*L,G=wu.radius/Math.sqrt(N),V=n.a6*G,Y=d-G*O,X=l-V*I,re=O*Y+I*X,te=O*X-I*Y,fe=te/(V/N+re),ge+=fe,Ie=re+te*fe/2,a<0&&(ge=-ge),i[r++]=lB*_e,i[r++]=lB*ge,i[r]=Ie}function sqt(t,e,i,r){M5(t,e,i,r),P5(i,r,i,r)}function oqt(t,e,i,r){M5(t,e,i,r),Hq(i,r,i,r)}const aB={[Vi.WGS84]:{[Vi.CGCS2000]:null,[Vi.GCSMARS2000]:null,[Vi.GCSMOON2000]:null,[Vi.LON_LAT]:zc,[Vi.WGS84_COMPARABLE_LON_LAT]:zc,[Vi.SPHERICAL_ECEF]:P5,[Vi.SPHERICAL_MARS_PCPF]:null,[Vi.SPHERICAL_MOON_PCPF]:null,[Vi.UNKNOWN]:null,[Vi.WEB_MERCATOR]:Hq,[Vi.PLATE_CARREE]:I5,[Vi.WGS84]:zc,[Vi.WGS84_ECEF]:R5},[Vi.CGCS2000]:{[Vi.CGCS2000]:zc,[Vi.GCSMARS2000]:null,[Vi.GCSMOON2000]:null,[Vi.LON_LAT]:zc,[Vi.WGS84_COMPARABLE_LON_LAT]:zc,[Vi.SPHERICAL_ECEF]:P5,[Vi.SPHERICAL_MARS_PCPF]:null,[Vi.SPHERICAL_MOON_PCPF]:null,[Vi.UNKNOWN]:null,[Vi.WEB_MERCATOR]:null,[Vi.PLATE_CARREE]:I5,[Vi.WGS84]:null,[Vi.WGS84_ECEF]:R5},[Vi.GCSMARS2000]:{[Vi.CGCS2000]:null,[Vi.GCSMARS2000]:zc,[Vi.GCSMOON2000]:null,[Vi.LON_LAT]:zc,[Vi.WGS84_COMPARABLE_LON_LAT]:null,[Vi.SPHERICAL_ECEF]:null,[Vi.SPHERICAL_MARS_PCPF]:qYe,[Vi.SPHERICAL_MOON_PCPF]:null,[Vi.UNKNOWN]:null,[Vi.WEB_MERCATOR]:null,[Vi.PLATE_CARREE]:null,[Vi.WGS84]:null,[Vi.WGS84_ECEF]:null},[Vi.GCSMOON2000]:{[Vi.CGCS2000]:null,[Vi.GCSMARS2000]:null,[Vi.GCSMOON2000]:zc,[Vi.LON_LAT]:zc,[Vi.WGS84_COMPARABLE_LON_LAT]:null,[Vi.SPHERICAL_ECEF]:null,[Vi.SPHERICAL_MARS_PCPF]:null,[Vi.SPHERICAL_MOON_PCPF]:WYe,[Vi.UNKNOWN]:null,[Vi.WEB_MERCATOR]:null,[Vi.PLATE_CARREE]:null,[Vi.WGS84]:null,[Vi.WGS84_ECEF]:null},[Vi.WEB_MERCATOR]:{[Vi.CGCS2000]:null,[Vi.GCSMARS2000]:null,[Vi.GCSMOON2000]:null,[Vi.LON_LAT]:oB,[Vi.WGS84_COMPARABLE_LON_LAT]:oB,[Vi.SPHERICAL_ECEF]:qWt,[Vi.SPHERICAL_MARS_PCPF]:null,[Vi.SPHERICAL_MOON_PCPF]:null,[Vi.UNKNOWN]:null,[Vi.WEB_MERCATOR]:zc,[Vi.PLATE_CARREE]:KWt,[Vi.WGS84]:oB,[Vi.WGS84_ECEF]:YWt},[Vi.WGS84_ECEF]:{[Vi.CGCS2000]:M5,[Vi.GCSMARS2000]:null,[Vi.GCSMOON2000]:null,[Vi.LON_LAT]:M5,[Vi.WGS84_COMPARABLE_LON_LAT]:M5,[Vi.SPHERICAL_ECEF]:sqt,[Vi.SPHERICAL_MARS_PCPF]:null,[Vi.SPHERICAL_MOON_PCPF]:null,[Vi.UNKNOWN]:null,[Vi.WEB_MERCATOR]:oqt,[Vi.PLATE_CARREE]:JWt,[Vi.WGS84]:M5,[Vi.WGS84_ECEF]:zc},[Vi.SPHERICAL_ECEF]:{[Vi.CGCS2000]:O5,[Vi.GCSMARS2000]:null,[Vi.GCSMOON2000]:null,[Vi.LON_LAT]:O5,[Vi.WGS84_COMPARABLE_LON_LAT]:O5,[Vi.SPHERICAL_ECEF]:zc,[Vi.SPHERICAL_MARS_PCPF]:null,[Vi.SPHERICAL_MOON_PCPF]:null,[Vi.UNKNOWN]:null,[Vi.WEB_MERCATOR]:iqt,[Vi.PLATE_CARREE]:ZWt,[Vi.WGS84]:O5,[Vi.WGS84_ECEF]:rqt},[Vi.SPHERICAL_MARS_PCPF]:{[Vi.CGCS2000]:null,[Vi.GCSMARS2000]:XYe,[Vi.GCSMOON2000]:null,[Vi.LON_LAT]:XYe,[Vi.WGS84_COMPARABLE_LON_LAT]:null,[Vi.SPHERICAL_ECEF]:null,[Vi.SPHERICAL_MARS_PCPF]:zc,[Vi.SPHERICAL_MOON_PCPF]:null,[Vi.UNKNOWN]:null,[Vi.WEB_MERCATOR]:null,[Vi.PLATE_CARREE]:null,[Vi.WGS84]:null,[Vi.WGS84_ECEF]:null},[Vi.SPHERICAL_MOON_PCPF]:{[Vi.CGCS2000]:null,[Vi.GCSMARS2000]:null,[Vi.GCSMOON2000]:YYe,[Vi.LON_LAT]:YYe,[Vi.WGS84_COMPARABLE_LON_LAT]:null,[Vi.SPHERICAL_ECEF]:null,[Vi.SPHERICAL_MARS_PCPF]:null,[Vi.SPHERICAL_MOON_PCPF]:zc,[Vi.UNKNOWN]:null,[Vi.WEB_MERCATOR]:null,[Vi.PLATE_CARREE]:null,[Vi.WGS84]:null,[Vi.WGS84_ECEF]:null},[Vi.UNKNOWN]:{[Vi.CGCS2000]:null,[Vi.GCSMARS2000]:null,[Vi.GCSMOON2000]:null,[Vi.LON_LAT]:null,[Vi.WGS84_COMPARABLE_LON_LAT]:null,[Vi.SPHERICAL_ECEF]:null,[Vi.SPHERICAL_MARS_PCPF]:null,[Vi.SPHERICAL_MOON_PCPF]:null,[Vi.UNKNOWN]:zc,[Vi.WEB_MERCATOR]:null,[Vi.PLATE_CARREE]:null,[Vi.WGS84]:null,[Vi.WGS84_ECEF]:null},[Vi.LON_LAT]:{[Vi.CGCS2000]:zc,[Vi.GCSMARS2000]:zc,[Vi.GCSMOON2000]:zc,[Vi.LON_LAT]:zc,[Vi.WGS84_COMPARABLE_LON_LAT]:zc,[Vi.SPHERICAL_ECEF]:P5,[Vi.SPHERICAL_MARS_PCPF]:qYe,[Vi.SPHERICAL_MOON_PCPF]:WYe,[Vi.UNKNOWN]:null,[Vi.WEB_MERCATOR]:Hq,[Vi.PLATE_CARREE]:I5,[Vi.WGS84]:zc,[Vi.WGS84_ECEF]:R5},[Vi.WGS84_COMPARABLE_LON_LAT]:{[Vi.CGCS2000]:null,[Vi.GCSMARS2000]:null,[Vi.GCSMOON2000]:null,[Vi.LON_LAT]:zc,[Vi.WGS84_COMPARABLE_LON_LAT]:zc,[Vi.SPHERICAL_ECEF]:P5,[Vi.SPHERICAL_MARS_PCPF]:null,[Vi.SPHERICAL_MOON_PCPF]:null,[Vi.UNKNOWN]:null,[Vi.WEB_MERCATOR]:null,[Vi.PLATE_CARREE]:I5,[Vi.WGS84]:zc,[Vi.WGS84_ECEF]:R5},[Vi.PLATE_CARREE]:{[Vi.CGCS2000]:A5,[Vi.GCSMARS2000]:null,[Vi.GCSMOON2000]:null,[Vi.LON_LAT]:A5,[Vi.WGS84_COMPARABLE_LON_LAT]:A5,[Vi.SPHERICAL_ECEF]:QWt,[Vi.SPHERICAL_MARS_PCPF]:null,[Vi.SPHERICAL_MOON_PCPF]:null,[Vi.UNKNOWN]:null,[Vi.WEB_MERCATOR]:eqt,[Vi.PLATE_CARREE]:zc,[Vi.WGS84]:A5,[Vi.WGS84_ECEF]:tqt}};function KYe(t,e,i=qSe()){return lt(t)||lt(e)?null:aqt(t,e,i).projector}function aqt(t,e,i){if(lt(t)||lt(e)||i.source.spatialReference===t&&i.dest.spatialReference===e)return i;const r=zq(t,i.source),n=zq(e,i.dest);return r===Vi.UNKNOWN&&n===Vi.UNKNOWN?Ca(t,e)?i.projector=zc:i.projector=null:i.projector=aB[r][n],i}function qSe(){return{source:{spatialReference:null,spatialReferenceId:Vi.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:Vi.UNKNOWN,metersPerUnit:1},projector:zc}}const JYe={spatialReference:null,spatialReferenceId:Vi.UNKNOWN},lqt={spatialReference:null,spatialReferenceId:Vi.UNKNOWN},ZYe=qSe();qSe();const tT=Jb(1),lB=xne(1),Hoe=Qr(),KR=Qr(),JR=Qr(),Bf=Qr();async function uqt(t){const e=t.spatialReference;if(e.isWGS84)return t.clone();if(e.isWebMercator)return vL(t);const i=rr.WGS84;return await YR(e,i),rp(t,i)}function YSe(t,e){if(!uB(t,e)){const i=t.typeKeywords;i?i.push(e):t.typeKeywords=[e]}}function uB(t,e){return!!t.typeKeywords?.includes(e)}function QYe(t,e){const i=t.typeKeywords;if(i){const r=i.indexOf(e);r>-1&&i.splice(r,1)}}async function cqt(t){const e=t.clone().normalize();let i;if(e.length>1)for(const r of e)i?r.width>i.width&&(i=r):i=r;else i=e[0];return uqt(i)}const cB={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table"};function eXe(t){const{portal:e,isOrgItem:i,itemControl:r}=t,n=e.user?.privileges;let s=!n||n.includes("features:user:edit"),o=!!i&&!!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 _h=t=>{let e=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=ra(this.portalItem)}set portalItem(i){i!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",i))}readPortalItem(i,r,n){if(r.itemId)return new X0({id:r.itemId,portal:n&&n.portal})}writePortalItem(i,r){i&&i.id&&(r.itemId=i.id)}async loadFromPortal(i,r){if(this.portalItem&&this.portalItem.id)try{const n=await Promise.resolve().then(()=>oIi);return sn(r),await n.load({instance:this,supportedTypes:i.supportedTypes,validateItem:i.validateItem,supportsData:i.supportsData,layerModuleTypeMap:i.layerModuleTypeMap},r)}catch(n){throw ss(n)||Ei.getLogger(this.declaredClass).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id}) - ${n}`),n}}async finishLoadEditablePortalLayer(i){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(i).catch(r=>(Ga(r),!0)))}async _setUserPrivileges(i,r){if(!na.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(r);if(this.url)try{const{features:{edit:n,fullEdit:s},content:{updateItem:o}}=await this._fetchUserPrivileges(i,r);this._set("userHasEditingPrivileges",n),this._set("userHasFullEditingPrivileges",s),this._set("userHasUpdateItemPrivileges",o)}catch(n){Ga(n)}}async _fetchUserPrivileges(i,r){let n=this.portalItem;if(!i||!n||!n.loaded||n.sourceUrl)return this._fetchFallbackUserPrivileges(r);const s=i===n.id;if(s&&n.portal.user)return eXe(n);let o,a;if(s)o=n.portal.url;else try{o=await kUe(this.url,r)}catch(p){Ga(p)}if(!o||!M6t(o,n.portal.url))return this._fetchFallbackUserPrivileges(r);try{const p=ye(r)?r.signal:null;a=await Ro?.getCredential(`${o}/sharing`,{prompt:!1,signal:p})}catch(p){Ga(p)}const l=!0,c=!1,d=!1;if(!a)return{features:{edit:l,fullEdit:c},content:{updateItem:d}};try{if(s?await n.reload():(n=new X0({id:i,portal:{url:o}}),await n.load(r)),n.portal.user)return eXe(n)}catch(p){Ga(p)}return{features:{edit:l,fullEdit:c},content:{updateItem:d}}}async _fetchFallbackUserPrivileges(i){let r=!0;try{r=await this._fetchUserHasEditingPrivileges(i)}catch(n){Ga(n)}return{features:{edit:r,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(i){const r=this.url?Ro?.findCredential(this.url):null;if(!r)return!0;const n=Woe.credential===r?Woe.user:await this._fetchEditingUser(i);return Woe.credential=r,Woe.user=n,lt(n)||n.privileges==null||n.privileges.includes("features:user:edit")}async _fetchEditingUser(i){const r=this.portalItem?.portal?.user;if(r)return r;const n=Ro.findServerInfo(this.url??"");if(!n?.owningSystemUrl)return null;const s=`${n.owningSystemUrl}/sharing/rest`,o=_c.getDefault();if(o&&o.loaded&&Uy(o.restUrl)===Uy(s))return o.user;const a=`${s}/community/self`,l=ye(i)?i.signal:null,c=await TC(ir(a,{authMode:"no-prompt",query:{f:"json"},signal:l}));return c.ok?R1e.fromJSON(c.value.data):null}read(i,r){r&&(r.layer=this),super.read(i,r)}write(i,r){const n=r&&r.portal,s=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||_c.getDefault());return n&&s&&!e1e(s.restUrl,n.restUrl)?(r.messages&&r.messages.push(new st("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(i,{...r,layer:this})}};return E([k({type:X0})],e.prototype,"portalItem",null),E([Li("web-document","portalItem",["itemId"])],e.prototype,"readPortalItem",null),E([mr("web-document","portalItem",{itemId:{type:String}})],e.prototype,"writePortalItem",null),E([k({clonable:!1})],e.prototype,"resourceReferences",void 0),E([k({type:Boolean,readOnly:!0})],e.prototype,"userHasEditingPrivileges",void 0),E([k({type:Boolean,readOnly:!0})],e.prototype,"userHasFullEditingPrivileges",void 0),E([k({type:Boolean,readOnly:!0})],e.prototype,"userHasUpdateItemPrivileges",void 0),e=E([ht("esri.layers.mixins.PortalLayer")],e),e},Woe={credential:null,user:null};let Wq=class extends fn{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};E([k()],Wq.prototype,"updating",void 0),E([k()],Wq.prototype,"status",void 0),Wq=E([ht("esri.layers.support.PublishingInfo")],Wq);const hqt=Wq,tXe="esri.layers.mixins.PublishableLayer",dqt=Symbol(tXe),pqt=t=>{var e;let i=class extends t{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 hqt;return this._checkPublishingStatus(n),n}_checkPublishingStatus(r){let o=0;const a=async c=>{let d;r.updating=!0;try{d=await this.fetchPublishingStatus()}catch{d="unavailable"}d!=="published"&&d!=="unavailable"||(r.status==="publishing"&&this.refresh(),l.remove()),r.status=d,r.updating=!1,l.removed||(o=setTimeout(a,c,c+125))},l={removed:!1,remove(){this.removed=!0,clearTimeout(o)}};this.when().catch(()=>l.remove()),a(250),this.own(l)}};return e=dqt,E([k({readOnly:!0,clonable:!1})],i.prototype,"publishingInfo",null),i=E([ht(tXe)],i),i},qq=new fr,Yq=new WeakMap;function fqt(t){iXe(t)&&qq.push(t)}function mqt(t){iXe(t)&&qq.includes(t)&&qq.remove(t)}function iXe(t){return t!=null&&typeof t=="object"&&"refreshInterval"in t&&"refresh"in t}function rXe(t,e){return Number.isFinite(t)&&Number.isFinite(e)?e<=0?t:rXe(e,t%e):0}let XSe=0,qoe=0;function gqt(){const t=Date.now();for(const e of qq)e.refreshInterval&&t-(Yq.get(e)??0)+5>=6e4*e.refreshInterval&&(Yq.set(e,t),e.refresh(t))}WGe(()=>{const t=Date.now();let e=0;for(const i of qq)e=rXe(Math.round(6e4*i.refreshInterval),e),i.refreshInterval?Yq.get(i)||Yq.set(i,t):Yq.delete(i);if(e!==qoe){if(qoe=e,clearInterval(XSe),qoe===0)return void(XSe=0);XSe=setInterval(gqt,qoe)}});const n0=t=>{let e=class extends t{constructor(...i){super(...i),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=$y(()=>this.hasDataChanged()),this.when().then(()=>{fqt(this)},()=>{})}destroy(){mqt(this)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(i=Date.now()){cf(this._debounceHasDataChanged()).then(r=>{r&&this._set("refreshTimestamp",i),this.emit("refresh",{dataChanged:r})},r=>{Ei.getLogger(this.declaredClass).error(r),this.emit("refresh",{dataChanged:!1,error:r})})}async hasDataChanged(){return!0}};return E([k({type:Number,cast:i=>i>=.1?i:i<=0?0:.1,json:{write:!0}})],e.prototype,"refreshInterval",void 0),E([k({readOnly:!0})],e.prototype,"refreshTimestamp",void 0),E([k()],e.prototype,"refreshParameters",null),e=E([ht("esri.layers.mixins.RefreshableLayer")],e),e},bh=t=>{let e=class extends t{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const i={minScale:this.minScale,maxScale:this.maxScale},r=this.parent;r&&"effectiveScaleRange"in r&&yqt(i,r.effectiveScaleRange);const n=this._get("effectiveScaleRange");return n&&n.minScale===i.minScale&&n.maxScale===i.maxScale?n:i}};return E([k({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"minScale",void 0),E([k({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"maxScale",void 0),E([k({readOnly:!0})],e.prototype,"effectiveScaleRange",null),e=E([ht("esri.layers.mixins.ScaleRangeLayer")],e),e};function yqt(t,e){return t.minScale=t.minScale>0?e.minScale>0?Math.min(t.minScale,e.minScale):t.minScale:e.minScale,t.maxScale=t.maxScale>0?e.maxScale>0?Math.max(t.maxScale,e.maxScale):t.maxScale:e.maxScale,t}const nXe=jo()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0});let Xq=class extends ua(Ni){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return b7t(this.value,this.unit,"milliseconds")}};E([Hr(nXe,{nonNullable:!0})],Xq.prototype,"unit",void 0),E([k({type:Number,json:{write:!0},nonNullable:!0})],Xq.prototype,"value",void 0),Xq=E([ht("esri.TimeInterval")],Xq);const Yoe=Xq;function sXe(t,e){return Yoe.fromJSON({value:t,unit:e})}let s0=class extends ua(Ni){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeReference=null,this.trackIdField=null,this.useTime=!0}readFullTimeExtent(e,i){if(!i.timeExtent||!Array.isArray(i.timeExtent)||i.timeExtent.length!==2)return null;const r=new Date(i.timeExtent[0]),n=new Date(i.timeExtent[1]);return new Wg({start:r,end:n})}writeFullTimeExtent(e,i){e&&ye(e.start)&&ye(e.end)?i.timeExtent=[e.start.getTime(),e.end.getTime()]:i.timeExtent=null}readInterval(e,i){return i.timeInterval&&i.timeIntervalUnits?sXe(i.timeInterval,i.timeIntervalUnits):i.defaultTimeInterval&&i.defaultTimeIntervalUnits?sXe(i.defaultTimeInterval,i.defaultTimeIntervalUnits):null}writeInterval(e,i){i.timeInterval=e?.toJSON().value??null,i.timeIntervalUnits=e?.toJSON().unit??null}};E([k({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],s0.prototype,"cumulative",void 0),E([k({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],s0.prototype,"endField",void 0),E([k({type:Wg,json:{write:{enabled:!0,allowNull:!0}}})],s0.prototype,"fullTimeExtent",void 0),E([Li("fullTimeExtent",["timeExtent"])],s0.prototype,"readFullTimeExtent",null),E([mr("fullTimeExtent")],s0.prototype,"writeFullTimeExtent",null),E([k({type:Boolean,json:{write:!0}})],s0.prototype,"hasLiveData",void 0),E([k({type:Yoe,json:{write:{enabled:!0,allowNull:!0}}})],s0.prototype,"interval",void 0),E([Li("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],s0.prototype,"readInterval",null),E([mr("interval")],s0.prototype,"writeInterval",null),E([k({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],s0.prototype,"startField",void 0),E([k({type:GR,json:{write:{enabled:!0,allowNull:!0}}})],s0.prototype,"timeReference",void 0),E([k({type:String,json:{write:{enabled:!0,allowNull:!0}}})],s0.prototype,"trackIdField",void 0),E([k({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],s0.prototype,"useTime",void 0),s0=E([ht("esri.layers.support.TimeInfo")],s0);const KSe=s0,iT=t=>{let e=class extends t{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(i,r){const n=r.timeInfo.exportOptions;if(!n)return null;const s=n.timeOffset,o=nXe.fromJSON(n.timeOffsetUnits);return s&&o?new Yoe({value:s,unit:o}):null}set timeInfo(i){AL(i,this.fieldsIndex),this._set("timeInfo",i)}};return E([k({type:Wg,json:{write:!1}})],e.prototype,"timeExtent",void 0),E([k({type:Yoe})],e.prototype,"timeOffset",void 0),E([Li("service","timeOffset",["timeInfo.exportOptions"])],e.prototype,"readOffset",null),E([k({value:null,type:KSe,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],e.prototype,"timeInfo",null),E([k({type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation"},origins:{"web-scene":{read:!1,write:!1}}}})],e.prototype,"useViewTime",void 0),e=E([ht("esri.layers.mixins.TemporalLayer")],e),e},oXe=new Bs({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 ZR=class extends ua(Ni){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};E([k({json:{write:!0}})],ZR.prototype,"name",void 0),E([k({json:{write:!0}})],ZR.prototype,"description",void 0),E([k({json:{read:oXe.read,write:oXe.write}})],ZR.prototype,"drawingTool",void 0),E([k({json:{write:!0}})],ZR.prototype,"prototype",void 0),E([k({json:{write:!0}})],ZR.prototype,"thumbnail",void 0),ZR=E([ht("esri.layers.support.FeatureTemplate")],ZR);const hB=ZR;let kA=class extends ua(Ni){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const i={};for(const r of Object.keys(e))i[r]=Jse(e[r]);return i}writeDomains(e,i){const r={};for(const n of Object.keys(e))e[n]&&(r[n]=e[n]?.toJSON());i.domains=r}};E([k({json:{write:!0}})],kA.prototype,"id",void 0),E([k({json:{write:!0}})],kA.prototype,"name",void 0),E([k({json:{write:!0}})],kA.prototype,"domains",void 0),E([Li("domains")],kA.prototype,"readDomains",null),E([mr("domains")],kA.prototype,"writeDomains",null),E([k({type:[hB],json:{write:!0}})],kA.prototype,"templates",void 0),kA=E([ht("esri.layers.support.FeatureType")],kA);const dB=kA;function vqt(t){return t.type==="date"||t.type==="esriFieldTypeDate"}function aXe(t){return t.type==="oid"||t.type==="esriFieldTypeOID"}function lXe(t){return t.type==="global-id"||t.type==="esriFieldTypeGlobalID"}let Am=class{constructor(e=[]){if(this.fields=[],this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this.dateFields=[],this.numericFields=[],this._requiredFields=null,!e)return;this.fields=e;const i=[];for(const r of e){const n=r?.name,s=cXe(r?.name);if(n&&s){const o=uXe(n);this._fieldsMap.set(n,r),this._fieldsMap.set(o,r),this._normalizedFieldsMap.set(s,r),i.push(o),vqt(r)?(this.dateFields.push(r),this._dateFieldsSet.add(r)):r9(r)&&(this._numericFieldsSet.add(r),this.numericFields.push(r)),aXe(r)||lXe(r)||(r.editable=r.editable==null||!!r.editable,r.nullable=r.nullable==null||!!r.nullable)}}i.sort(),this.uid=i.join(",")}destroy(){this._fieldsMap.clear()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)aXe(e)||lXe(e)||e.nullable||Dne(e)!==void 0||this._requiredFields.push(e)}return this._requiredFields}has(e){return this.get(e)!=null}get(e){if(!e)return;let i=this._fieldsMap.get(e);return i||(i=this._fieldsMap.get(uXe(e))??this._normalizedFieldsMap.get(cXe(e)),i&&this._fieldsMap.set(e,i),i)}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){const i=this.get(e);if(i)return i.name??void 0}};function uXe(t){return t.trim().toLowerCase()}function cXe(t){return i9(t)?.toLowerCase()??""}function rT(){return{fields:{type:[Bo],value:null},fieldsIndex:{readOnly:!0,get(){return new Am(this.fields||[])}},outFields:{type:[String],json:{read:!1},set:function(t){this._userOutFields=t,this.notifyChange("outFields")},get:function(){const t=this._userOutFields;if(!t||!t.length)return null;if(t.includes("*"))return["*"];if(!this.fields)return t;for(const e of t)this.fieldsIndex?.has(e)||Ei.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${e} found in outFields`,{layer:this,outFields:t});return rW(this.fieldsIndex,t)}}}}const JSe=Ei.getLogger("esri.layers.support.labelingInfo"),_qt=/\[([^\[\]]+)\]/gi;function NA(t,e,i){return t?t.map(r=>{const n=new I2;if(n.read(r,i),n.labelExpression){const s=e.fields||e.layerDefinition&&e.layerDefinition.fields||this.fields;n.labelExpression=n.labelExpression.replace(_qt,(o,a)=>`[${bqt(a,s)}]`)}return n}):null}function bqt(t,e){if(!e)return t;const i=t.toLowerCase();for(let r=0;rxqt(r,e))?[]:i}function xqt(t,e){const i=t.labelPlacement,r=wqt[e];if(!t.symbol)return JSe.warn("No ILabelClass symbol specified."),!0;if(!r)return JSe.error(new st("labeling:unsupported-geometry-type",`Unable to create labels for layer, geometry type '${e}' is not supported`)),!0;if(!r.includes(i)){const n=r[0];i&&JSe.warn(`Found invalid label placement type ${i} for ${e}. Defaulting to ${n}`),t.labelPlacement=n}return!1}const O2=[];function Xoe(t,e){if(N9(t.url??""))return!0;const{wkid:i}=e;for(const r of O2){if((t.version??0)>=r[0])return!0;if(typeof r[1]=="function"&&(r[1]=r[1]()),r[1].has(i))return!1}return!0}O2.push([10.91,()=>{const t=new Set([9709,9716,9741,9761,9766]);for(let e=9712;e<=9713;e++)t.add(e);for(let e=9748;e<=9749;e++)t.add(e);for(let e=20904;e<=20932;e++)t.add(e);for(let e=21004;e<=21032;e++)t.add(e);for(let e=21207;e<=21264;e++)t.add(e);for(let e=21307;e<=21364;e++)t.add(e);for(let e=102759;e<=102760;e++)t.add(e);for(let e=102901;e<=102955;e++)t.add(e);return t}]),O2.push([10.9,()=>{const t=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++)t.add(e);for(let e=9404;e<=9407;e++)t.add(e);for(let e=9476;e<=9482;e++)t.add(e);for(let e=9487;e<=9494;e++)t.add(e);for(let e=9697;e<=9699;e++)t.add(e);return t}]),O2.push([10.81,()=>{const t=new Set([9265,9333,103598,103699]);for(let e=9248;e<=9254;e++)t.add(e);for(let e=9271;e<=9273;e++)t.add(e);for(let e=9284;e<=9285;e++)t.add(e);for(let e=21453;e<=21463;e++)t.add(e);return t}]),O2.push([10.8,()=>{const t=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++)t.add(e);for(let e=8455;e<=8456;e++)t.add(e);for(let e=8518;e<=8529;e++)t.add(e);for(let e=8533;e<=8536;e++)t.add(e);for(let e=8538;e<=8540;e++)t.add(e);for(let e=8677;e<=8679;e++)t.add(e);for(let e=8902;e<=8903;e++)t.add(e);for(let e=8907;e<=8910;e++)t.add(e);for(let e=8949;e<=8951;e++)t.add(e);for(let e=8972;e<=8987;e++)t.add(e);for(let e=9039;e<=9040;e++)t.add(e);for(let e=9068;e<=9069;e++)t.add(e);for(let e=9140;e<=9141;e++)t.add(e);for(let e=9148;e<=9150;e++)t.add(e);for(let e=9153;e<=9159;e++)t.add(e);for(let e=9205;e<=9218;e++)t.add(e);for(let e=9221;e<=9222;e++)t.add(e);for(let e=54098;e<=54101;e++)t.add(e);return t}]),O2.push([10.71,()=>{const t=new Set([6316]);for(let e=8351;e<=8353;e++)t.add(e);for(let e=9294;e<=9297;e++)t.add(e);for(let e=22619;e<=22621;e++)t.add(e);for(let e=103586;e<=103594;e++)t.add(e);return t}]),O2.push([10.7,()=>{const t=new Set([8387,8391,8427,8545,8682,8685,8818,31370,104022,104024,104975]);for(let e=8065;e<=8068;e++)t.add(e);for(let e=8082;e<=8083;e++)t.add(e);for(let e=8379;e<=8385;e++)t.add(e);for(let e=8836;e<=8840;e++)t.add(e);for(let e=8857;e<=8860;e++)t.add(e);for(let e=53035;e<=53037;e++)t.add(e);for(let e=54090;e<=54091;e++)t.add(e);for(let e=102498;e<=102499;e++)t.add(e);return t}]),O2.push([10.61,()=>new Set([102497])]),O2.push([10.6,()=>{const t=new Set([7803,7805,7887,8086,8232,8237,8240,8246,8249,8252,8255,9019,9391]);for(let e=7755;e<=7787;e++)t.add(e);for(let e=7791;e<=7795;e++)t.add(e);for(let e=7799;e<=7801;e++)t.add(e);for(let e=7825;e<=7831;e++)t.add(e);for(let e=7877;e<=7878;e++)t.add(e);for(let e=7882;e<=7883;e++)t.add(e);for(let e=7991;e<=7992;e++)t.add(e);for(let e=8042;e<=8043;e++)t.add(e);for(let e=8058;e<=8059;e++)t.add(e);for(let e=8311;e<=8348;e++)t.add(e);for(let e=9060;e<=9067;e++)t.add(e);for(let e=102562;e<=102568;e++)t.add(e);for(let e=102799;e<=102900;e++)t.add(e);return t}]),O2.push([10.51,()=>{const t=new Set([7683,7881,7886,7899,8888,9e3]);for(let e=8013;e<=8032;e++)t.add(e);for(let e=9053;e<=9057;e++)t.add(e);for(let e=104017;e<=104018;e++)t.add(e);for(let e=104971;e<=104974;e++)t.add(e);return t}]),O2.push([10.5,()=>{const t=new Set([6962,7035,7037,7039,7041,7084,7086,7133,7798,102399]);for(let e=4087;e<=4088;e++)t.add(e);for(let e=5896;e<=5899;e++)t.add(e);for(let e=7005;e<=7007;e++)t.add(e);for(let e=7057;e<=7070;e++)t.add(e);for(let e=7073;e<=7082;e++)t.add(e);for(let e=7109;e<=7128;e++)t.add(e);for(let e=7844;e<=7859;e++)t.add(e);return t}]);async function Kq(t,e,i){const r=t&&t.getAtOrigin&&t.getAtOrigin("renderer",e.origin);if(r&&r.type==="unique-value"&&r.styleOrigin){const n=await TC(r.populateFromStyle());if(sn(i),n.ok===!1){const s=n.error;e&&e.messages&&e.messages.push(new wm("renderer:style-reference",`Failed to create unique value renderer from style reference: ${s.message}`,{error:s,context:e})),t.clear("renderer",e?.origin)}}}var QSe;let pB=QSe=class extends Ni{constructor(t){super(t),this.groupByFields=void 0,this.topCount=void 0,this.orderByFields=void 0}clone(){return new QSe({groupByFields:this.groupByFields,topCount:this.topCount,orderByFields:this.orderByFields})}};E([k({type:[String],json:{write:!0}})],pB.prototype,"groupByFields",void 0),E([k({type:Number,json:{write:!0}})],pB.prototype,"topCount",void 0),E([k({type:[String],json:{write:!0}})],pB.prototype,"orderByFields",void 0),pB=QSe=E([ht("esri.rest.support.TopFilter")],pB);const Sqt=pB;var eCe;const hXe=new Bs({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),dXe=new Bs({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let zh=eCe=class extends Ni{constructor(t){super(t),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(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10}clone(){return new eCe(hi({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}))}};E([k({type:Boolean,json:{write:!0}})],zh.prototype,"cacheHint",void 0),E([k({type:Number,json:{write:{overridePolicy:t=>({enabled:t>0})}}})],zh.prototype,"distance",void 0),E([k({types:P1,json:{read:fl,write:!0}})],zh.prototype,"geometry",void 0),E([k({type:Number,json:{write:!0}})],zh.prototype,"geometryPrecision",void 0),E([k({type:Number,json:{write:!0}})],zh.prototype,"maxAllowableOffset",void 0),E([k({type:Number,json:{read:{source:"resultRecordCount"}}})],zh.prototype,"num",void 0),E([k({json:{write:!0}})],zh.prototype,"objectIds",void 0),E([k({type:[String],json:{write:!0}})],zh.prototype,"orderByFields",void 0),E([k({type:[String],json:{write:!0}})],zh.prototype,"outFields",void 0),E([k({type:rr,json:{read:{source:"outSR"},write:{target:"outSR"}}})],zh.prototype,"outSpatialReference",void 0),E([k({type:String,json:{write:!0}})],zh.prototype,"resultType",void 0),E([k({json:{write:!0}})],zh.prototype,"returnGeometry",void 0),E([k({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],zh.prototype,"returnM",void 0),E([k({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],zh.prototype,"returnZ",void 0),E([k({type:Number,json:{read:{source:"resultOffset"}}})],zh.prototype,"start",void 0),E([mr("start"),mr("num")],zh.prototype,"writeStart",null),E([k({type:String,json:{read:{source:"spatialRel",reader:hXe.read},write:{target:"spatialRel",writer:hXe.write}}})],zh.prototype,"spatialRelationship",void 0),E([k({type:Wg,json:{write:!0}})],zh.prototype,"timeExtent",void 0),E([k({type:Sqt,json:{write:!0}})],zh.prototype,"topFilter",void 0),E([k({type:String,json:{read:dXe.read,write:{writer:dXe.write,overridePolicy(t){return{enabled:ye(t)&&ye(this.distance)&&this.distance>0}}}}})],zh.prototype,"units",void 0),E([k({type:String,json:{write:!0}})],zh.prototype,"where",void 0),zh=eCe=E([ht("esri.rest.support.TopFeaturesQuery")],zh),zh.from=ud(zh);const QR=zh,Cqt=["oid","global-id"],Tqt=["oid","global-id","guid"];function G1({displayField:t,editFieldsInfo:e,fields:i,objectIdField:r,title:n},s){if(!i)return null;const o=Rqt({editFieldsInfo:e,fields:i,objectIdField:r},s);if(!o.length)return null;const a=Fqt({titleBase:n,fields:i,displayField:t}),l=Dqt();return new yh({title:a,content:l,fieldInfos:o})}const Eqt=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/shape/i,/perimeter/i,/objectid/i,/_i$/i],Iqt=(t,{editFieldsInfo:e,objectIdField:i,visibleFieldNames:r})=>r?r.has(t.name):!pXe(t.name,e)&&(!i||t.name!==i)&&!Cqt.includes(t.type)&&!Eqt.some(n=>n.test(t.name));function Aqt(t,e){const i=t;return e&&(t=t.filter(r=>!e.includes(r.type))),t===i&&(t=t.slice()),t.sort(Pqt),t}function Pqt(t,e){return t.type==="oid"?-1:e.type==="oid"?1:fXe(t)?-1:fXe(e)?1:(t.alias||t.name).toLocaleLowerCase().localeCompare((e.alias||e.name).toLocaleLowerCase())}function pXe(t,e){if(!t||!e)return!1;const{creationDateField:i,creatorField:r,editDateField:n,editorField:s}=e;return[i&&i.toLowerCase(),r&&r.toLowerCase(),n&&n.toLowerCase(),s&&s.toLowerCase()].includes(t.toLowerCase())}function Oqt(t,e){return t.editable&&!Tqt.includes(t.type)&&!pXe(t.name,e)}function Rqt({editFieldsInfo:t,fields:e,objectIdField:i},r){return Aqt(e??[],r?.ignoreFieldTypes||Lqt).map(n=>new hW({fieldName:n.name,isEditable:Oqt(n,t),label:n.alias,format:Mqt(n),visible:Iqt(n,{editFieldsInfo:t,objectIdField:i,visibleFieldNames:r?.visibleFieldNames})}))}function Mqt(t){switch(t.type){case"small-integer":case"integer":case"single":return new s9({digitSeparator:!0,places:0});case"double":return new s9({digitSeparator:!0,places:2});case"date":return new s9({dateFormat:"long-month-day-year"});default:return t.type==="string"&&$je(t.name)?new s9({digitSeparator:!0,places:0}):null}}function Dqt(){return[new o9,new nW]}function Fqt(t){const e=sBt(t),{titleBase:i}=t;return e?`${i}: {${e.trim()}}`:i??""}function fXe(t){return(t.name&&t.name.toLowerCase())==="name"?!0:(t.alias&&t.alias.toLowerCase())==="name"}const Lqt=["geometry","blob","raster","guid","xml"],tv="FeatureLayer",mXe="esri.layers.FeatureLayer",kqt=Ei.getLogger(mXe);function Koe(t,e){return new st("layer:unsupported",`Layer (${t.title}, ${t.id}) of type '${t.declaredClass}' ${e}`,{layer:t})}function gXe(t){return t&&t instanceof fr}const tCe=rT();function iCe(t,e,i){const r=!!i?.writeLayerSchema;return{enabled:r,ignoreOrigin:r}}let As=class extends fYe(Bq(wq(pqt(m2e(ip(Noe(iT(bh(n0(Qv(jc(_h($u(v2(g2(ua(iu))))))))))))))))){constructor(...e){super(...e),this._handles=new uf,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.screenSizePerspectiveEnabled=!0,this.spatialReference=rr.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}destroy(){this.source?.destroy(),this._handles=ra(this._handles)}normalizeCtorArgs(e,i){return typeof e=="string"?{url:e,...i}:e}load(e){const i=ye(e)?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(i).then(n=>this.initLayerProperties(n))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection"]},e).catch(Ga).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){const n=await this._fetchFirstLayerId(i);n!=null&&(this.layerId=n)}if(!this.url&&!this._hasMemorySource())throw new st("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(i))}).then(()=>this._setUserPrivileges(this.serviceItemId,e)).then(()=>cYe(this,e));return this.addResolvingPromise(r),Promise.resolve(this)}readCapabilities(e,i){return i=i.layerDefinition||i,cSe(i,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,i){return this._readEditingEnabled(i,!1)}readEditingEnabledFromWebMap(e,i,r){return this._readEditingEnabled(i,!0,r)}writeEditingEnabled(e,i){this._writeEditingEnabled(e,i,!1)}writeEditingEnabledToWebMap(e,i,r,n){this._writeEditingEnabled(e,i,!0,n)}get effectiveEditingEnabled(){return hYe(this)}readIsTable(e,i){return(i=i?.layerDefinition??i).type==="Table"||!i.geometryType}writeIsTable(e,i,r,n){n?.writeLayerSchema&&Ep(r,e?"Table":"Feature Layer",i)}readGlobalIdField(e,i){return lYe(i.layerDefinition||i)}readObjectIdField(e,i){return uYe(i.layerDefinition||i)}get parsedUrl(){const e=sa(this.url);return e!=null&&(this.dynamicDataSource!=null?e.path=dd(e.path,"dynamicLayer"):this.layerId!=null&&(e.path=dd(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){O1(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,i,r){const n=(i=i.layerDefinition||i).drawingInfo?.renderer;if(n){const s=l5(n,i,r)??void 0;return s||kqt.error("Failed to create renderer",{rendererDefinition:i.drawingInfo.renderer,layer:this,context:r}),s}if(i.defaultSymbol)return i.types&&i.types.length?new YC({defaultSymbol:rCe(i.defaultSymbol,i,r),field:i.typeIdField,uniqueValueInfos:i.types.map(s=>({id:s.id,symbol:rCe(s.symbol,s,r)}))}):new Zv({symbol:rCe(i.defaultSymbol,i,r)})}set source(e){const i=this._get("source");i!==e&&(gXe(i)&&this._resetMemorySource(i),gXe(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof fr?new xA({layer:this,items:e}):e:null}readSource(e,i){const r=Wu.fromJSON(i.featureSet);return new xA({layer:this,items:r?.features??[]})}readTemplates(e,i){const r=i.editFieldsInfo,n=r&&r.creatorField,s=r&&r.editorField;return e=e&&e.map(o=>hB.fromJSON(o)),this._fixTemplates(e,n),this._fixTemplates(e,s),e}readTitle(e,i){const r=i.layerDefinition?.name??i.name,n=i.title||i.layerDefinition&&i.layerDefinition.title;if(r){const s=this.portalItem&&this.portalItem.title;if(this.sublayerTitleMode==="item-title")return this.url?t2e(this.url,r):r;let o=r;if(!o&&this.url){const a=JC(this.url);ye(a)&&(o=a.title)}return o?(this.sublayerTitleMode==="item-title-and-service-name"&&s&&s!==o&&(o=s+" - "+o),aoe(o)):void 0}if(this.sublayerTitleMode==="item-title"&&n)return n}readTitleFromWebMap(e,i){return i.title||i.layerDefinition&&i.layerDefinition.name}readTypeIdField(e,i){let r=(i=i.layerDefinition||i).typeIdField;if(r&&i.fields){r=r.toLowerCase();const n=i.fields.find(s=>s.name.toLowerCase()===r);n&&(r=n.name)}return r}readTypes(e,i){e=(i=i.layerDefinition||i).types;const r=i.editFieldsInfo,n=r&&r.creatorField,s=r&&r.editorField;return e&&e.map(o=>(o=dB.fromJSON(o),this._fixTemplates(o.templates,n),this._fixTemplates(o.templates,s),o))}readVisible(e,i){return i.layerDefinition&&i.layerDefinition.defaultVisibility!=null?!!i.layerDefinition.defaultVisibility:i.visibility!=null?!!i.visibility:void 0}async addAttachment(e,i){return Kqe(this,e,i,tv)}async updateAttachment(e,i,r){return Jqe(this,e,i,r,tv)}async applyEdits(e,i){return Zqe(this,e,i)}on(e,i){return super.on(e,i)}createPopupTemplate(e){return G1(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:i}=await Vg(Promise.resolve().then(()=>gbt),e);return new i({layer:this}).load({signal:e})}createQuery(){const e=aSe(this);e.dynamicDataSource=this.dynamicDataSource;const i=ye(this.subtypeCode)?`${this.subtypeField} = ${this.subtypeCode}`:null,r=OR(this.definitionExpression,i);return e.where=r||"1=1",e}async deleteAttachments(e,i){return Qqe(this,e,i,tv)}async fetchRecomputedExtents(e){return eYe(this,e,tv)}getFeatureType(e){const{typeIdField:i,types:r}=this;if(!i||!e)return null;const n=e.attributes?e.attributes[i]: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,i){const r=i&&i.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,i){return tYe(this,e,i,tv)}async queryFeatures(e,i){const r=await this.load(),n=await r.source.queryFeatures(Ss.from(e)??r.createQuery(),i);if(n?.features)for(const s of n.features)s.layer=s.sourceLayer=r;return n}async queryObjectIds(e,i){return iYe(this,e,i,tv)}async queryFeatureCount(e,i){return rYe(this,e,i,tv)}async queryExtent(e,i){return nYe(this,e,i,tv)}async queryRelatedFeatures(e,i){return sYe(this,e,i,tv)}async queryRelatedFeaturesCount(e,i){return oYe(this,e,i,tv)}async queryTopFeatures(e,i){const{source:r,capabilities:n}=await this.load();if(!r.queryTopFeatures||!n?.query?.supportsTopFeaturesQuery)throw new st(tv,"Layer source does not support queryTopFeatures capability");const s=await r.queryTopFeatures(QR.from(e),i);if(s?.features)for(const o of s.features)o.layer=o.sourceLayer=this;return s}async queryTopObjectIds(e,i){const{source:r,capabilities:n}=await this.load();if(!r.queryTopObjectIds||!n?.query.supportsTopFeaturesQuery)throw new st(tv,"Layer source does not support queryTopObjectIds capability");return r.queryTopObjectIds(QR.from(e),i)}async queryTopFeaturesExtent(e,i){const{source:r,capabilities:n}=await this.load();if(!r.queryTopExtents||!n?.query?.supportsTopFeaturesQuery)throw new st(tv,"Layer source does not support queryTopExtents capability");return r.queryTopExtents(QR.from(e),i)}async queryTopFeatureCount(e,i){const{source:r,capabilities:n}=await this.load();if(!r.queryTopCount||!n?.query?.supportsTopFeaturesQuery)throw new st(tv,"Layer source does not support queryFeatureCount capability");return r.queryTopCount(QR.from(e),i)}read(e,i){const r=e.featureCollection;if(r){const n=r.layers;n&&n.length===1&&(super.read(n[0],i),r.showLegend!=null&&super.read({showLegend:r.showLegend},i))}super.read(e,i),i&&i.origin==="service"&&(this.revert(["objectIdField","fields","timeInfo"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,i){i={...i,origin:i?.origin??void 0,writeLayerSchema:i?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:n,messages:s}=i;if(this.dynamicDataSource)return s?.push(Koe(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-scene"||r==="web-map"&&n!=="tables")return s?.push(Koe(this,"using a table source cannot be written to web scenes and web maps")),null;if(this._hasMemorySource())return s?.push(Koe(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&r==="web-map"&&n==="tables")return s?.push(Koe(this,"using a non-table source cannot be written to tables in web maps")),null;return super.write(e,i)}clone(){if(this._hasMemorySource())throw new st(tv,`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"||Xoe(this,e))}async save(e){return(await Promise.resolve().then(()=>Tbt)).save(this,e)}async saveAs(e,i){return(await Promise.resolve().then(()=>Tbt)).saveAs(this,e,i)}_readEditingEnabled(e,i,r){let n=e.layerDefinition?.capabilities;return n?this._hasEditingCapability(n):(n=e.capabilities,i&&r?.origin==="web-map"&&!this._hasMemorySource()&&n?this._hasEditingCapability(n):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(i=>i.trim()).includes("editing")}_writeEditingEnabled(e,i,r,n){if(!e){const s=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";Ep("layerDefinition.capabilities",s,i),r&&!n?.writeLayerSchema&&(i.capabilities=s)}}_getLayerDomain(e){const i=this.fieldsIndex.get(e);return i?i.domain:null}_fetchFirstLayerId(e){return ir(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(i=>{const r=i.data;if(r)return Array.isArray(r.layers)&&r.layers.length>0?r.layers[0].id:Array.isArray(r.tables)&&r.tables.length>0?r.tables[0].id:void 0})}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(),O1(this.renderer,this.fieldsIndex),AL(this.timeInfo,this.fieldsIndex),Kq(this,{origin:"service"})}async hasDataChanged(){return aYe(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(i=>i.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,i){e&&e.forEach(r=>{const n=r.prototype&&r.prototype.attributes;n&&i&&delete n[i]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new st("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 st("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(i=>{i.layer=this,i.sourceLayer=this}),this._handles.add([e.on("after-add",i=>{i.item.layer=this,i.item.sourceLayer=this}),e.on("after-remove",i=>{i.item.layer=null,i.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(i=>{i.layer=null,i.sourceLayer=null}),this._handles.remove("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}};E([Li("service","capabilities")],As.prototype,"readCapabilities",null),E([k({json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],As.prototype,"charts",void 0),E([k({readOnly:!0})],As.prototype,"createQueryVersion",null),E([k({json:{read:{source:"layerDefinition.copyrightText"}}})],As.prototype,"copyright",void 0),E([k({json:{read:{source:"layerDefinition.displayField"}}})],As.prototype,"displayField",void 0),E([k({types:Uh,readOnly:!0})],As.prototype,"defaultSymbol",void 0),E([k({type:Q0})],As.prototype,"dynamicDataSource",void 0),E([k({type:Boolean})],As.prototype,"editingEnabled",null),E([Li(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],As.prototype,"readEditingEnabled",null),E([Li("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],As.prototype,"readEditingEnabledFromWebMap",null),E([mr(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],As.prototype,"writeEditingEnabled",null),E([mr("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],As.prototype,"writeEditingEnabledToWebMap",null),E([k({readOnly:!0})],As.prototype,"effectiveEditingEnabled",null),E([k({...tCe.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:iCe}}}}})],As.prototype,"fields",void 0),E([k(tCe.fieldsIndex)],As.prototype,"fieldsIndex",void 0),E([k({type:aHe,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],As.prototype,"formTemplate",void 0),E([k({json:{read:{source:"layerDefinition.extent"}}})],As.prototype,"fullExtent",void 0),E([k({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:iCe,writer(t,e,i){const r=t?sSe.toJSON(t):null;r&&Ep(i,r,e)}}}},read:{source:"layerDefinition.geometryType",reader:sSe.read}}})],As.prototype,"geometryType",void 0),E([k({json:{read:{source:"layerDefinition.hasM"}}})],As.prototype,"hasM",void 0),E([k({json:{read:{source:"layerDefinition.hasZ"}}})],As.prototype,"hasZ",void 0),E([k(z9)],As.prototype,"id",void 0),E([k({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],As.prototype,"infoFor3D",void 0),E([k({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],As.prototype,"isTable",void 0),E([Li("service","isTable",["type","geometryType"]),Li("isTable",["layerDefinition.type","layerDefinition.geometryType"])],As.prototype,"readIsTable",null),E([mr("web-map","isTable")],As.prototype,"writeIsTable",null),E([k(AA)],As.prototype,"labelsVisible",void 0),E([k({type:[I2],json:{origins:{service:{read:{source:"drawingInfo.labelingInfo",reader:NA},write:{target:"drawingInfo.labelingInfo",enabled:!1}}},read:{source:"layerDefinition.drawingInfo.labelingInfo",reader:NA},write:{target:"layerDefinition.drawingInfo.labelingInfo"}}})],As.prototype,"labelingInfo",void 0),E([k((()=>{const t=hi(wWe);return t.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,i,r){Ep(r,Kne(e),i)}}},t})())],As.prototype,"opacity",void 0),E([k(N1)],As.prototype,"legendEnabled",void 0),E([k({type:["show","hide"],json:(()=>{const t=hi(xWe.json);return t.origins["portal-item"]={read:!1,write:!1},t})()})],As.prototype,"listMode",void 0),E([Li("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],As.prototype,"readGlobalIdField",null),E([k({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:iCe}}}}})],As.prototype,"objectIdField",void 0),E([Li("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],As.prototype,"readObjectIdField",null),E([k({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],As.prototype,"operationalLayerType",void 0),E([k(tCe.outFields)],As.prototype,"outFields",void 0),E([k({readOnly:!0})],As.prototype,"parsedUrl",null),E([k({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],As.prototype,"path",void 0),E([k(t_)],As.prototype,"popupEnabled",void 0),E([k({type:yh,json:{name:"popupInfo",write:!0}})],As.prototype,"popupTemplate",void 0),E([k({readOnly:!0})],As.prototype,"defaultPopupTemplate",null),E([k({types:_A,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:AR,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:(t,e,i)=>({ignoreOrigin:i?.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(t,e,i)=>({ignoreOrigin:i?.writeLayerSchema})}}})],As.prototype,"renderer",null),E([Li("service","renderer",["drawingInfo.renderer","defaultSymbol"]),Li("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],As.prototype,"readRenderer",null),E([k((()=>{const t=hi(U9);return t.json.origins["portal-item"]={read:!1,write:!1},t})())],As.prototype,"screenSizePerspectiveEnabled",void 0),E([k({clonable:!1})],As.prototype,"source",null),E([Zs("source")],As.prototype,"castSource",null),E([Li("portal-item","source",["featureSet"]),Li("web-map","source",["featureSet"])],As.prototype,"readSource",null),E([k({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],As.prototype,"spatialReference",void 0),E([k({type:Number})],As.prototype,"subtypeCode",void 0),E([k({type:[hB]})],As.prototype,"templates",void 0),E([Li("templates",["editFieldsInfo","creatorField","editorField","templates"])],As.prototype,"readTemplates",null),E([k({type:KSe})],As.prototype,"timeInfo",void 0),E([k()],As.prototype,"title",void 0),E([Li("service","title",["name"]),Li("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],As.prototype,"readTitle",null),E([Li("web-map","title",["layerDefinition.name","title"])],As.prototype,"readTitleFromWebMap",null),E([k({type:String})],As.prototype,"sublayerTitleMode",void 0),E([k({json:{read:!1}})],As.prototype,"type",void 0),E([k({type:String})],As.prototype,"typeIdField",void 0),E([Li("service","typeIdField"),Li("typeIdField",["layerDefinition.typeIdField"])],As.prototype,"readTypeIdField",null),E([k({type:[dB]})],As.prototype,"types",void 0),E([Li("service","types",["types"]),Li("types",["layerDefinition.types"])],As.prototype,"readTypes",null),E([k({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],As.prototype,"visible",void 0),E([Li("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],As.prototype,"readVisible",null),As=E([ht(mXe)],As);const rCe=CC({types:UW}),Hc=As,nCe=Object.freeze(Object.defineProperty({__proto__:null,default:Hc},Symbol.toStringTag,{value:"Module"}));let Jq=class extends Nd(fr){constructor(e){super(e),this.handles.add([this.on("before-add",i=>{lt(i.item)&&i.preventDefault()}),this.on("after-add",i=>this._own(i.item)),this.on("after-remove",i=>this._release(i.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(fr.ofType(this.itemType.Type))(e):new fr(e)}};function sCe(t,e){return{type:t,cast:B8,set(i){const r=rg(i,this._get(e),t);r.owner=this,this._set(e,r)}}}E([k()],Jq.prototype,"owner",null),Jq=E([ht("esri.core.support.OwningCollection")],Jq);let V1=class extends Jq{_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)}};E([j_e({Type:js,ensureType:ud(js)})],V1.prototype,"itemType",void 0),V1=E([ht("esri.support.GraphicsCollection")],V1);let $A=class extends ip(bh(iu)){constructor(e){super(e),this.elevationInfo=null,this.graphics=new V1,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,i){return super.on(e,i)}graphicChanged(e){this.emit("graphic-update",e)}};E([k({type:v5})],$A.prototype,"elevationInfo",void 0),E([k(sCe(V1,"graphics"))],$A.prototype,"graphics",void 0),E([k({type:["show","hide"]})],$A.prototype,"listMode",void 0),E([k()],$A.prototype,"screenSizePerspectiveEnabled",void 0),E([k({readOnly:!0})],$A.prototype,"type",void 0),E([k({constructOnly:!0})],$A.prototype,"internal",void 0),$A=E([ht("esri.layers.GraphicsLayer")],$A);const yXe=$A;var oCe;const Joe=new Bs({flow_from:"flow-from",flow_to:"flow-to"});let o0=oCe=class extends SR(Ni){constructor(t){super(t),this.density=.8,this.color=new $r([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:t,maxPathLength:e,trailWidth:i,flowSpeed:r,trailLength:n,smoothing:s,flowRepresentation:o,trailCap:a,background:l}=this,c=this.color.clone(),d=(this.visualVariables||[]).map(v=>v.clone()),p=this.authoringInfo?.clone(),y=this.legendOptions?.clone();return new oCe({density:t,color:c,maxPathLength:e,trailWidth:i,flowSpeed:r,trailLength:n,trailCap:a,background:l,smoothing:s,flowRepresentation:o,visualVariables:d,authoringInfo:p,legendOptions:y})}getSymbol(t,e){}async getSymbolAsync(t,e){}getSymbols(){return[]}};E([k({type:Number,json:{write:!0}})],o0.prototype,"density",void 0),E([k({type:$r,json:{write:{allowNull:!0}}})],o0.prototype,"color",void 0),E([k({type:Number,cast:Da,json:{write:!0}})],o0.prototype,"maxPathLength",void 0),E([k({type:Number,cast:Da,json:{write:!0}})],o0.prototype,"trailWidth",void 0),E([k({type:Number,json:{write:!0}})],o0.prototype,"flowSpeed",void 0),E([k({type:Number,json:{write:!0}})],o0.prototype,"trailLength",void 0),E([k({type:Number,cast:Da,json:{write:!1}})],o0.prototype,"smoothing",void 0),E([k({type:Joe.apiValues,json:{type:Joe.jsonValues,read:{reader:Joe.read},write:{writer:Joe.write}}})],o0.prototype,"flowRepresentation",void 0),E([Hr({flowRenderer:"flow"})],o0.prototype,"type",void 0),E([k({type:HW,json:{write:!0}})],o0.prototype,"authoringInfo",void 0),E([k({type:WC,json:{write:!0}})],o0.prototype,"legendOptions",void 0),E([k({type:String,json:{write:!0}})],o0.prototype,"trailCap",void 0),E([k({type:String,json:{write:!0}})],o0.prototype,"background",void 0),o0=oCe=E([ht("esri.renderers.FlowRenderer")],o0);const vXe=o0;let fB=class extends Ni{constructor(){super(...arguments),this.value=null,this.label=null,this.color=null}};E([k({type:Number,json:{write:!0}})],fB.prototype,"value",void 0),E([k({type:String,json:{write:!0}})],fB.prototype,"label",void 0),E([k({type:$r,json:{type:[xs],write:!0}})],fB.prototype,"color",void 0),fB=E([ht("esri.renderers.support.ColormapInfo")],fB);const _Xe=fB;function Nqt(t){return"r"in t&&"g"in t&&"b"in t}function bXe(t){return"h"in t&&"s"in t&&"v"in t}function wXe(t){return"l"in t&&"a"in t&&"b"in t}function xXe(t){return"l"in t&&"c"in t&&"h"in t}function $qt(t){return"x"in t&&"y"in t&&"z"in t}const Bqt=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],Gqt=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function SXe(t,e){const i=[];let r,n;if(t[0].length!==e.length)throw new Error("dimensions do not match");const s=t.length,o=t[0].length;let a=0;for(r=0;rr<=.04045?r/12.92:((r+.055)/1.055)**2.4),i=SXe(Bqt,e);return{x:100*i[0],y:100*i[1],z:100*i[2]}}function aCe(t){const e=SXe(Gqt,[t.x/100,t.y/100,t.z/100]).map(i=>{const r=i<=.0031308?12.92*i:1.055*i**.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 TXe(t){const e=[t.x/95.047,t.y/100,t.z/108.883].map(i=>i>.008856451679035631?i**.3333333333333333:7.787037037037035*i+.13793103448275862);return{l:116*e[1]-16,a:500*(e[0]-e[1]),b:200*(e[1]-e[2])}}function EXe(t){const e=t.l,i=[(e+16)/116+t.a/500,(e+16)/116,(e+16)/116-t.b/200].map(r=>r>6/29?r**3:3*(6/29)**2*(r-4/29));return{x:95.047*i[0],y:100*i[1],z:108.883*i[2]}}function Vqt(t){const e=t.l,i=t.a,r=t.b,n=Math.sqrt(i*i+r*r);let s=Math.atan2(r,i);return s=s>0?s:s+2*Math.PI,{l:e,c:n,h:s}}function Uqt(t){const e=t.l,i=t.c,r=t.h;return{l:e,a:i*Math.cos(r),b:i*Math.sin(r)}}function jqt(t){return TXe(CXe(t))}function zqt(t){return aCe(EXe(t))}function Hqt(t){return Vqt(TXe(CXe(t)))}function Wqt(t){return aCe(EXe(Uqt(t)))}function qqt(t){const e=t.r,i=t.g,r=t.b,n=Math.max(e,i,r),s=n-Math.min(e,i,r);let o=n,a=s===0?0:n===e?(i-r)/s%6:n===i?(r-e)/s+2:(e-i)/s+4,l=s===0?0:s/o;return a<0&&(a+=6),a*=60,l*=100,o*=.39215686274509803,{h:a,s:l,v:o}}function Yqt(t){const e=(t.h+360)%360/60,i=t.s/100,r=t.v/100*255,n=r*i,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 eM(t){return Nqt(t)?t:xXe(t)?Wqt(t):wXe(t)?zqt(t):$qt(t)?aCe(t):bXe(t)?Yqt(t):t}function Zoe(t){return bXe(t)?t:qqt(eM(t))}function Qoe(t){return wXe(t)?t:jqt(eM(t))}function eae(t){return xXe(t)?t:Hqt(eM(t))}const Xqt=["random","ndvi","ndvi2","ndvi3","elevation","gray","hillshade"],lCe=[{id:"aspect_predefined",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:"blackToWhite_predefined",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blueBright_predefined",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blueLightToDark_predefined",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blueGreenBright_predefined",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blueGreenLightToDark_predefined",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brownLightToDark_predefined",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brownToBlueGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brownToBlueGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficientBias_predefined",fromColor:[214,214,255],toColor:[0,57,148]},{id:"coldToHotDiverging_predefined",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"conditionNumber_predefined",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyanToPurple_predefined",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyanLightToBlueDark_predefined",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance_predefined",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1_predefined",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_predefined",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_predefined",fromColor:[255,235,214],toColor:[196,10,10]},{id:"grayLightToDark_predefined",fromColor:[219,219,219],toColor:[69,69,69]},{id:"greenBright_predefined",fromColor:[204,255,204],toColor:[14,204,14]},{id:"greenLightToDark_predefined",fromColor:[220,245,233],toColor:[34,102,51]},{id:"greenToBlue_predefined",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orangeBright_predefined",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orangeLightToDark_predefined",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partialSpectrum_predefined",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:"partialSpectrum1Diverging_predefined",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:"partialSpectrum2Diverging_predefined",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:"pinkToYellowGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pinkToYellowGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation_predefined",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_predefined",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purpleBright_predefined",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purpleToGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purpleToGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purpleBlueBright_predefined",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purpleBlueLightToDark_predefined",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purpleRedBright_predefined",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purpleRedLightToDark_predefined",fromColor:[250,215,246],toColor:[143,17,57]},{id:"redBright_predefined",fromColor:[255,204,204],toColor:[219,0,0]},{id:"redLightToDark_predefined",fromColor:[255,224,224],toColor:[143,10,10]},{id:"redToBlueDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"redToBlueDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"redToGreen_predefined",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"redToGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"redToGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope_predefined",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrumFullBright_predefined",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:"spectrumFullDark_predefined",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:"spectrumFullLight_predefined",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_predefined",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_predefined",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:"whiteToBlack_predefined",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellowToDarkRed_predefined",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellowToGreenToDarkBlue_predefined",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:"yellowToRed_predefined",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellowGreenBright_predefined",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellowGreenLightToDark_predefined",fromColor:[215,240,175],toColor:[96,107,45]}],IXe={aspect_predefined:"Aspect",blackToWhite_predefined:"Black to White",blueBright_predefined:"Blue Bright",blueLightToDark_predefined:"Blue Light to Dark",blueGreenBright_predefined:"Blue-Green Bright",blueGreenLightToDark_predefined:"Blue-Green Light to Dark",brownLightToDark_predefined:"Brown Light to Dark",brownToBlueGreenDivergingBright_predefined:"Brown to Blue Green Diverging, Bright",brownToBlueGreenDivergingDark_predefined:"Brown to Blue Green Diverging, Dark",coefficientBias_predefined:"Coefficient Bias",coldToHotDiverging_predefined:"Cold to Hot Diverging",conditionNumber_predefined:"Condition Number",cyanToPurple_predefined:"Cyan to Purple",cyanLightToBlueDark_predefined:"Cyan-Light to Blue-Dark",distance_predefined:"Distance",elevation1_predefined:"Elevation #1",elevation2_predefined:"Elevation #2",errors_predefined:"Errors",grayLightToDark_predefined:"Gray Light to Dark",greenBright_predefined:"Green Bright",greenLightToDark_predefined:"Green Light to Dark",greenToBlue_predefined:"Green to Blue",orangeBright_predefined:"Orange Bright",orangeLightToDark_predefined:"Orange Light to Dark",partialSpectrum_predefined:"Partial Spectrum",partialSpectrum1Diverging_predefined:"Partial Spectrum 1 Diverging",partialSpectrum2Diverging_predefined:"Partial Spectrum 2 Diverging",pinkToYellowGreenDivergingBright_predefined:"Pink to YellowGreen Diverging, Bright",pinkToYellowGreenDivergingDark_predefined:"Pink to YellowGreen Diverging, Dark",precipitation_predefined:"Precipitation",prediction_predefined:"Prediction",purpleBright_predefined:"Purple Bright",purpleToGreenDivergingBright_predefined:"Purple to Green Diverging, Bright",purpleToGreenDivergingDark_predefined:"Purple to Green Diverging, Dark",purpleBlueBright_predefined:"Purple-Blue Bright",purpleBlueLightToDark_predefined:"Purple-Blue Light to Dark",purpleRedBright_predefined:"Purple-Red Bright",purpleRedLightToDark_predefined:"Purple-Red Light to Dark",redBright_predefined:"Red Bright",redLightToDark_predefined:"Red Light to Dark",redToBlueDivergingBright_predefined:"Red to Blue Diverging, Bright",redToBlueDivergingDark_predefined:"Red to Blue Diverging, Dark",redToGreen_predefined:"Red to Green",redToGreenDivergingBright_predefined:"Red to Green Diverging, Bright",redToGreenDivergingDark_predefined:"Red to Green Diverging, Dark",slope_predefined:"Slope",spectrumFullBright_predefined:"Spectrum-Full Bright",spectrumFullDark_predefined:"Spectrum-Full Dark",spectrumFullLight_predefined:"Spectrum-Full Light",surface_predefined:"Surface",temperature_predefined:"Temperature",whiteToBlack_predefined:"White to Black",yellowToDarkRed_predefined:"Yellow to Dark Red",yellowToGreenToDarkBlue_predefined:"Yellow to Green to Dark Blue",yellowToRed_predefined:"Yellow to Red",yellowGreenBright_predefined:"Yellow-Green Bright",yellowGreenLightToDark_predefined:"Yellow-Green Light to Dark"},mB=new Bs({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","urple 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 tae(t,e){if(!t||!e||t.length!==e.length)return!1;for(let i=0;ie[i]+2||t[i]{if(tae(t.fromColor.toRgb(),n.fromColor)&&tae(t.toColor.toRgb(),n.toColor))return r=n.id,!0}):t.type==="multipart"&&i.some(n=>{const s=t.colorRamps,o=n.colorRamps;if(s&&o&&s.length===o.length&&!o.some((a,l)=>{if(!tae(s[l].fromColor.toRgb(),new $r(a.fromColor).toRgb())||!tae(s[l].toColor.toRgb(),new $r(a.toColor).toRgb()))return!0})){if(r)return!0;r=n.id}}),r}function AXe(t){const e=Kqt(t);return e?IXe[e]:null}function Jqt(t){const e=mB.toJSON(t),i=Object.entries(IXe).find(n=>n[1]===e)?.[0],r=lCe.find(n=>n.id===i);return r?r.colorRamps?{type:"multipart",colorRamps:r.colorRamps.map(n=>({type:"algorithmic",algorithm:"esriCIELabAlgorithm",fromColor:n.fromColor,toColor:n.toColor}))}:{type:"algorithmic",algorithm:"esriCIELabAlgorithm",fromColor:r.fromColor,toColor:r.toColor}:null}function PXe(t){const e=(t=t||{}).numColors||256,i=t.distanceOffset||0,r=t.isCustomInterval!=null?t.isCustomInterval:t.distanceInterval!==null&&t.distanceInterval!==1/(e-1),n=t.distanceInterval||1/(e-1);return{...t,numColors:e,distanceOffset:i,interpolateAlpha:!!t.interpolateAlpha,distanceInterval:n,isCustomInterval:r,weights:t.weights}}function Zqt(t,e,i){const{numColors:r,distanceOffset:n,distanceInterval:s,isCustomInterval:o}=i,a=t.s===0,l=e.s===0;let c=t.h,d=e.h;a&&!l?c=d:l&&!a&&(e={...e,h:c},d=c);let p,y=Math.abs(d-c);const v=360;yd?y*s:-y*s);const S=(e.s-t.s)*s,I=(e.v-t.v)*s;let{s:O,v:L}=t,N=c;if(n){const V=n/s;N=(N+V*p+v)%v,O+=V*S,L+=V*I}const G=[];for(let V=0;Vv+S);n=n.map(v=>v/y)}else{n=[];for(let y=0;y{n.unshift(s),r||n.pop()}),i}function RXe(t){const e=AXe(t);if(t){if(t.type==="algorithmic")return{...MXe(t),Name:e};if(t.colorRamps){const i=t.colorRamps.map(MXe);return{type:"MultiPartColorRamp",NumColorRamps:i.length,ArrayOfColorRamp:i,Name:e}}}}function MXe(t){if(t)return{Algorithm:t.toJSON()?.Algorithm||"esriHSVAlgorithm",type:"AlgorithmicColorRamp",FromColor:DXe(t.fromColor),ToColor:DXe(t.toColor)}}function DXe(t){const e=Zoe(t);return{type:"HsvColor",Hue:e.h,Saturation:e.s,Value:e.v,AlphaValue:255}}function iYt(t){const e=t.reverse().map(i=>{const r=i.toString(16);return r.length<2?"0"+r:r});return 4294967295&Number.parseInt(e.join(""),16)}var Zq;let Qq=Zq=class extends Ni{constructor(t){super(t),this.colormapInfos=null,this.type="raster-colormap"}static createFromColormap(t,e){if(!t)return null;const i=t[0].length===5,r=[...t].sort(n=>n[0][0]-n[1][0]).map(n=>_Xe.fromJSON({value:n[0],color:i?n.slice(1,5):n.slice(1,4).concat([255]),label:e?e[n[0]]??"":n[0]}));return new Zq({colormapInfos:r})}static createFromColorramp(t){const e=BA(t);return Zq.createFromColormap(e)}clone(){return new Zq({colormapInfos:this.colormapInfos.map(t=>t.toJSON())})}extractColormap(){return this.colormapInfos.map(({value:t,color:e})=>[t,e.r,e.g,e.b,e.a>1?e.a:255*e.a&255]).sort((t,e)=>t[0]-e[0])}};E([k({type:[_Xe],json:{write:!0}})],Qq.prototype,"colormapInfos",void 0),E([Hr({rasterColormap:"raster-colormap"})],Qq.prototype,"type",void 0),Qq=Zq=E([ht("esri.renderers.RasterColormapRenderer")],Qq);const cCe=Qq;var hCe;let U1=hCe=class extends Ni{constructor(t){super(t),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(t){return Cse(t)}clone(){return new hCe({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,colorRamp:hi(this.colorRamp)})}};E([k({type:Number,json:{write:!0}})],U1.prototype,"altitude",void 0),E([k({type:Number,json:{write:!0}})],U1.prototype,"azimuth",void 0),E([k({types:Sse,json:{write:!0}})],U1.prototype,"colorRamp",void 0),E([Li("colorRamp")],U1.prototype,"readColorRamp",null),E([k({type:["traditional","multi-directional"],json:{write:!0}})],U1.prototype,"hillshadeType",void 0),E([k({type:Number,json:{write:!0}})],U1.prototype,"pixelSizePower",void 0),E([k({type:Number,json:{write:!0}})],U1.prototype,"pixelSizeFactor",void 0),E([k({type:["none","adjusted"],json:{write:!0}})],U1.prototype,"scalingType",void 0),E([Hr({rasterShadedRelief:"raster-shaded-relief"})],U1.prototype,"type",void 0),E([k({type:Number,json:{write:!0}})],U1.prototype,"zFactor",void 0),U1=hCe=E([ht("esri.renderers.RasterShadedReliefRenderer")],U1);const FXe=U1,eY=new Bs({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"}),LXe={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"};var dCe;let hf=dCe=class extends Ni{constructor(t){super(t),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(t){if(t)return Cse(t)}writeStatistics(t,e,i){t?.length&&(Array.isArray(t[0])||(t=t.map(r=>[r.min,r.max,r.avg,r.stddev])),e[i]=t)}readStretchType(t,e){let i=e.stretchType;return typeof i=="number"&&(i=LXe[i]),eY.read(i)}clone(){return new dCe({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:hi(this.statistics),gamma:hi(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:hi(this.colorRamp),histograms:hi(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};E([k({types:Sse,json:{write:!0}})],hf.prototype,"colorRamp",void 0),E([Li("colorRamp")],hf.prototype,"readColorRamp",null),E([k({type:Boolean,json:{write:!0}})],hf.prototype,"computeGamma",void 0),E([k({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],hf.prototype,"dynamicRangeAdjustment",void 0),E([k({type:[Number],json:{write:!0}})],hf.prototype,"gamma",void 0),E([k({type:Number,json:{write:!0}})],hf.prototype,"maxPercent",void 0),E([k({type:Number,json:{write:!0}})],hf.prototype,"minPercent",void 0),E([k({type:Number,json:{write:!0}})],hf.prototype,"numberOfStandardDeviations",void 0),E([k({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],hf.prototype,"outputMax",void 0),E([k({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],hf.prototype,"outputMin",void 0),E([k({type:Number,json:{write:!0}})],hf.prototype,"sigmoidStrengthLevel",void 0),E([k({json:{type:[[Number]],write:!0}})],hf.prototype,"statistics",void 0),E([k()],hf.prototype,"histograms",void 0),E([mr("statistics")],hf.prototype,"writeStatistics",null),E([k({type:Boolean,json:{write:!0}})],hf.prototype,"useGamma",void 0),E([k({type:eY.apiValues,json:{type:eY.jsonValues,write:eY.write}})],hf.prototype,"stretchType",void 0),E([Li("stretchType",["stretchType"])],hf.prototype,"readStretchType",null),E([Hr({rasterStretch:"raster-stretch"})],hf.prototype,"type",void 0),hf=dCe=E([ht("esri.renderers.RasterStretchRenderer")],hf);const pCe=hf,gB={102100:{maxX:20037508342788905e-9,minX:-20037508342788905e-9,plus180Line:new va({paths:[[[20037508342788905e-9,-20037508342788905e-9],[20037508342788905e-9,20037508342788905e-9]]],spatialReference:rr.WebMercator}),minus180Line:new va({paths:[[[-20037508342788905e-9,-20037508342788905e-9],[-20037508342788905e-9,20037508342788905e-9]]],spatialReference:rr.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new va({paths:[[[180,-180],[180,180]]],spatialReference:rr.WGS84}),minus180Line:new va({paths:[[[-180,-180],[-180,180]]],spatialReference:rr.WGS84})}};function uw(t,e){return Math.ceil((t-e)/(2*e))}function fCe(t,e){const i=tY(t);for(const r of i)for(const n of r)n[0]+=e;return t}function tY(t){return Va(t)?t.rings:t.paths}function r_(t,e){return e?{...e,query:{...t??{},...e.query}}:{query:t}}function sh(t){return typeof t=="string"?sa(t):hi(t)}function nT(t,e,i){const r={};for(const n in t){if(n==="declaredClass")continue;const s=t[n];if(s!=null&&typeof s!="function")if(Array.isArray(s)){r[n]=[];for(let o=0;o{const p=fl(d);return p.spatialReference=s,p})}}function nYt(t){return{geometryType:md(t[0]),geometries:t.map(e=>e.toJSON())}}function kXe(t,e,i){const r=q9t(e);return t.map(n=>{const s=r.fromJSON(n);return s.spatialReference=i,s})}async function sYt(t,e,i){const r=typeof t=="string"?sa(t):t,n=e[0].spatialReference,s=md(e[0]),o={...i,query:{...r.query,f:"json",sr:n.wkid?n.wkid:JSON.stringify(n),geometries:JSON.stringify(nYt(e))}},{data:a}=await ir(r.path+"/simplify",o);return kXe(a.geometries,s,n)}const NXe=Ei.getLogger("esri.geometry.support.normalizeUtils");function oYt(t){return t.type==="polygon"}function aYt(t){return t[0].type==="polygon"}function lYt(t){return t[0].type==="polyline"}function $Xe(t,e){if(!(t instanceof va||t instanceof po)){const n="straightLineDensify: the input geometry is neither polyline nor polygon";throw NXe.error(n),new st(n)}const i=tY(t),r=[];for(const n of i){const s=[];r.push(s),s.push([n[0][0],n[0][1]]);for(let o=0;o1){for(let N=1;N<=S-1;N++){const G=N*e,V=v*G+a,Y=y*G+l;s.push([V,Y])}const I=(p+Math.floor(S-1)*e)/2,O=v*I+a,L=y*I+l;s.push([O,L])}s.push([c,d])}}return oYt(t)?new po({rings:r,spatialReference:t.spatialReference}):new va({paths:r,spatialReference:t.spatialReference})}function BXe(t,e,i){if(e){const r=$Xe(t,1e6);t=vL(r,!0)}return i&&(t=fCe(t,i)),t}function GXe(t,e,i){if(Array.isArray(t)){const r=t[0];if(r>e){const n=uw(r,e);t[0]=r+n*(-2*e)}else if(re){const n=uw(r,e);t=t.clone().offset(n*(-2*e),0)}else if(r{if(c[0]<180)return!0;{let d=0;for(let y=0;yd?v:d}d=Number(d.toFixed(9));const p=-360*uw(d,180);for(let y=0;yGXe(X,a,l)),S.push(Y)}else if(V.type==="extent"){const Y=V.clone()._normalize(!1,!1,s);S.push(Y.rings?new po(Y):Y)}else if(V.extent){const Y=V.extent,X=uw(Y.xmin,l)*(2*a);let te=X===0?V.clone():fCe(V.clone(),X);Y.offset(X,0),Y.intersects(d)&&Y.xmax!==a?(y=Y.xmax>y?Y.xmax:y,te=BXe(te,o),v.push(te),S.push("cut")):Y.intersects(p)&&Y.xmin!==l?(y=Y.xmax*(2*a)>y?Y.xmax*(2*a):y,te=BXe(te,o,360),v.push(te),S.push("cut")):S.push(te)}else S.push(V.clone());else S.push(V);let I=uw(y,a),O=-90;const L=I,N=new va;for(;I>0;){const V=360*I-180;N.addPath([[V,O],[V,-1*O]]),O*=-1,I--}if(v.length>0&&L>0){const V=uYt(v,await rYt(r,v,N,i)),Y=[],X=[];for(let fe=0;fe1&&_e.rings.length>=Ie.rings.length?(Y.push(_e),X.push("simplify")):X.push(o?Q3(_e):_e)}}if(!Y.length)return X;const te=await sYt(r,Y,i),re=[];for(let fe=0;fen)for(;t>n;)t-=s}return t}let VXe=class{constructor(e=null,i=null,r=null){this.minValue=e,this.maxValue=i,this.noDataValue=r}};const cYt=9999999e31,hYt=2e-7,dYt={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]};function sT(t){return dYt[t]??[-34028234663852886e22,34028234663852886e22]}function iae(t,e,i){if(t.depthCount&&t.depthCount>1)return;const{pixels:r,statistics:n,pixelType:s}=t,o=r[0].length,a=t.bandMasks??[],l=t.mask??new Uint8Array(o).fill(255),c=s==="f32"||s==="f64",d=sT(s);let p=!1;for(let y=0;yv+Number.EPSILON||I=cYt?hYt*Math.abs(v):s==="f32"?11920928955078125e-23:Number.EPSILON);for(let V=0;Vthis._calculateBandStatistics(i,this.mask));const t=this.mask;let e=0;if(ye(t))for(let i=0;ii?i:ao>=e.length),s=r===t.length&&!t.some((o,a)=>o!==a);return n||s?this:new D5({pixelType:this.pixelType,width:this.width,height:this.height,mask:this.mask,validPixelCount:this.validPixelCount,maskIsAlpha:this.maskIsAlpha,pixels:t.map(o=>e[o]),statistics:i&&t.map(o=>i[o])})}clone(){const t=new D5({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;ye(this.mask)&&(this.mask instanceof Uint8Array?t.mask=new Uint8Array(this.mask):t.mask=this.mask.slice(0));const i=D5.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.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 c=new Uint32Array(t),d=this.width*this.height;if(s.length===d)if(ye(e)&&e.length===d)if(i)for(l=0;l0){for(const I of r)if(I.minValue!=null&&(o=Math.min(o,I.minValue)),I.maxValue!=null&&I.minValue!=null){const O=I.maxValue-I.minValue;a=Math.max(a,O)}s=255/a}else{let I=255;n==="s8"?(o=-128,I=127):n==="u16"?I=65535:n==="s16"?(o=-32768,I=32767):n==="u32"?I=4294967295:n==="s32"?(o=-2147483648,I=2147483647):n==="f32"?(o=-34e38,I=34e38):n==="f64"&&(o=-Number.MAX_VALUE,I=Number.MAX_VALUE),s=255/(I-o)}const l=new Uint32Array(t),c=this.width*this.height;let d,p,y,v,S;if(d=p=y=e[0],d.length!==c)return Ei.getLogger(this.declaredClass).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(p=e[1],e.length>=3&&(y=e[2]),ye(i)&&i.length===c)for(v=0;v=3?(n=e[1],s=e[2]):e.length===2&&(n=e[1]);const a=this.width*this.height;if(r.length!==a)return Ei.getLogger(this.declaredClass).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let l=0;if(ye(i)&&i.length===a)for(o=0;or?o:r);else for(s=0;sr?o:r;return new VXe(i,r)}};E([k({json:{write:!0}})],a0.prototype,"width",void 0),E([k({json:{write:!0}})],a0.prototype,"height",void 0),E([k({json:{write:!0}})],a0.prototype,"pixelType",void 0),E([Zs("pixelType")],a0.prototype,"castPixelType",null),E([k({json:{write:!0}})],a0.prototype,"validPixelCount",void 0),E([k({json:{write:!0}})],a0.prototype,"mask",void 0),E([k({json:{write:!0}})],a0.prototype,"maskIsAlpha",void 0),E([k({json:{write:!0}})],a0.prototype,"pixels",void 0),E([k()],a0.prototype,"premultiplyAlpha",void 0),E([k({json:{write:!0}})],a0.prototype,"statistics",void 0),E([k({json:{write:!0}})],a0.prototype,"depthCount",void 0),E([k({json:{write:!0}})],a0.prototype,"noDataValues",void 0),E([k({json:{write:!0}})],a0.prototype,"bandMasks",void 0),a0=D5=E([ht("esri.layers.support.PixelBlock")],a0);const en=a0;var rae,nae;(function(t){t[t.matchAny=0]="matchAny",t[t.matchAll=1]="matchAll"})(rae||(rae={})),function(t){t[t.bestMatch=0]="bestMatch",t[t.fail=1]="fail"}(nae||(nae={}));const tM=6;function wh(t){return ye(t)&&t.declaredClass==="esri.layers.support.PixelBlock"&&t.pixels&&t.pixels.length>0}function sae(t,e){if(!e?.length||!wh(t))return t;const i=t.pixels.length;return e&&e.some(r=>r>=i)||i===1&&e.length===1&&e[0]===0?t:i!==e.length||e.some((r,n)=>r!==n)?new en({pixelType:t.pixelType,width:t.width,height:t.height,mask:t.mask,validPixelCount:t.validPixelCount,maskIsAlpha:t.maskIsAlpha,pixels:e.map(r=>t.pixels[r]),statistics:t.statistics&&e.map(r=>t.statistics[r])}):t}function pYt(t){if(!t?.length||t.some(d=>!wh(d)))return null;if(t.length===1)return ye(t[0])?t[0].clone():null;const e=t,{width:i,height:r,pixelType:n}=e[0];if(e.some(d=>d.width!==i||d.height!==r))return null;const s=e.map(({mask:d})=>d).filter(d=>d!=null);let o=null;s.length&&(o=new Uint8Array(i*r),o.set(s[0]),s.length>1&&zXe(s.slice(1),o));const a=[];e.forEach(({pixels:d})=>a.push(...d));const l=e.map(({statistics:d})=>d).filter(d=>d?.length),c=[];return l.forEach(d=>c.push(...d)),new en({pixelType:n,width:i,height:r,mask:o,pixels:a,statistics:c.length?c:null})}function iY(t){if(!t)return;const e=t.colormap;if(!e||e.length===0)return;const i=e.sort((p,y)=>p[0]-y[0]);let r=0;i[0][0]<0&&(r=i[0][0]);const n=Math.max(256,i[i.length-1][0]-r+1),s=new Uint8Array(4*n),o=[];let a,l=0,c=0;const d=i[0].length===5;if(n>65536)return i.forEach(p=>{o[p[0]-r]=d?p.slice(1):p.slice(1).concat([255])}),{indexed2DColormap:o,offset:r,alphaSpecified:d};if(t.fillUnspecified)for(a=i[c],l=a[0]-r;lL?n[d]=0:(y[d]=o[O],v[d]=o[O+1],S[d]=o[O+2],n[d]=o[O+3]));else{for(n=new Uint8Array(s),d=0;dL?n[d]=0:(y[d]=o[O],v[d]=o[O+1],S[d]=o[O+2],n[d]=o[O+3]);i.mask=n}}else if(a)if(ye(n))for(d=0;ds));const a=[],l=e.outputPixelType||"u8";for(let d=0;d1;){if(c===d.value){I=!0;break}c>d.value?p=S:y=S,S=Math.floor((p+y)/2),d=e[Math.floor(S)]}I||(c===e[p].value?(d=e[p],I=!0):c===e[y].value?(d=e[y],I=!0):ce[p].value&&(cG-S);I[0]=n[0],I[I.length-1]=n[n.length-1]+(c?1e-6:0);const O=n.length/2,[L,N]=sT(o);for(let G=0;G=0;re--)if(X===I[2*re]||X>I[2*re]&&XN?N:X=a[te]&&X<=a[te+1]){p[Y]=0,v[Y]=0;break}}}return new en({width:i,height:r,pixelType:o,pixels:[p],mask:v})}function UXe(t,e,i,r){const n=i!=null&&i.length>=2?new Set(i):null,s=i?.length===1?i[0]:null,o=!!e?.length;for(let a=0;a=e[d]&&l<=e[d+1]){c=!0;break}c||(r[a]=0)}r[a]&&(l===s||n?.has(l))&&(r[a]=0)}}function jXe(t,e){const i=t[0].length;for(let r=0;rO-1e-6);I[0]=i[0],o&&(I[I.length-1]=i[i.length-1]);for(let O=0;Ov?v:r[O]S.pixelBlock);if(!i||lt(i.pixelBlock))return null;const r=(i.extent.xmax-i.extent.xmin)/i.pixelBlock.width,n=(i.extent.ymax-i.extent.ymin)/i.pixelBlock.height,s=.01*Math.min(r,n),o=t.sort((S,I)=>Math.abs(S.extent.ymax-I.extent.ymax)>s?I.extent.ymax-S.extent.ymax:Math.abs(S.extent.xmin-I.extent.xmin)>s?S.extent.xmin-I.extent.xmin:0),a=Math.min.apply(null,o.map(S=>S.extent.xmin)),l=Math.min.apply(null,o.map(S=>S.extent.ymin)),c=Math.max.apply(null,o.map(S=>S.extent.xmax)),d=Math.max.apply(null,o.map(S=>S.extent.ymax)),p={x:Math.round((e.xmin-a)/r),y:Math.round((d-e.ymax)/n)},y={width:Math.round((c-a)/r),height:Math.round((d-l)/n)},v={width:Math.round((e.xmax-e.xmin)/r),height:Math.round((e.ymax-e.ymin)/n)};return Math.round(y.width/i.pixelBlock.width)*Math.round(y.height/i.pixelBlock.height)!==o.length||p.x<0||p.y<0||y.widthS.pixelBlock),y,{clipOffset:p,clipSize:v})}}function vCe(t,e,i,r,n,s){const{width:o,height:a}=i.block,{x:l,y:c}=i.offset,{width:d,height:p}=i.mosaic,y=_Yt(o,a,r,n,l,c,d,p);let v=0,S=0;if(s){const I=s.hasGCSSShiftTransform?360:s.halfWorldWidth??0,O=o*s.resolutionX,L=s.startX+r*O;LI?S=s.rightPadding:L>=I&&(v=s.leftMargin-s.rightPadding,S=0)}if(y.xmax-=S,typeof e!="number")for(let I=y.ymin;Iwh(te));if(lt(a))return null;const l=n?n.width:e.width,c=n?n.height:e.height,d=a.width,p=a.height,y=e.width/d,v=e.height/p,S={offset:r||{x:0,y:0},mosaic:n||e,block:{width:d,height:p}},I=a.pixelType,O=en.getPixelArrayConstructor(I),L=a.pixels.length,N=[];let G,V;for(let te=0;telt(te)||ye(te.mask)&&te.mask.length>0)){Y=new Uint8Array(l*c);for(let te=0;teye(v));if(lt(r))return null;const n=t.some(v=>!ye(v)||!!v.mask),{width:s,height:o}=e,a=n?new Uint8Array(s*o):null,{blockWidths:l}=i,c=[],d=r.getPlaneCount(),p=en.getPixelArrayConstructor(r.pixelType);if(n)for(let v=0,S=0;vr||l>n||s===0&&o===0&&a===r&&l===n)return t;t.mask||(t.mask=new Uint8Array(r*n));const c=t.mask;for(let d=0;d=l||y=a?0:1}return t.updateStatistics(),t}function SYt(t){if(!wh(t))return null;const e=t.clone(),{width:i,height:r,pixels:n}=t,s=n[0],o=e.pixels[0],a=t.mask;for(let l=2;le&&(i=s.value,e=r),s=n.next();return i}function aae(t,e,i){if(i===0)return;const r=t.get(e);r===1?t.delete(e):t.set(e,r-1)}function nY(t,e,i){i!==0&&t.set(e,t.has(e)?t.get(e)+1:1)}function CYt(t,e,i){let{x:r,y:n}=e;const{width:s,height:o}=i;if(r===0&&n===0&&o===t.height&&s===t.width)return t;const{width:a,height:l}=t,c=Math.max(0,n),d=Math.max(0,r),p=Math.min(r+s,a),y=Math.min(n+o,l);if(p<0||y<0||!wh(t))return null;r=Math.max(0,-r),n=Math.max(0,-n);const{pixels:v}=t,S=s*o,I=v.length,O=[];for(let V=0;V{const Ie=fe instanceof Float32Array||fe instanceof Float64Array?0:.5;for(let ke=0;ke0){const[ft,Pt]=Yg(N,te,e,l),[$t,St]=Yg(O,L,e,l);Ie.push(ft),Ie.push(Pt),Ie.push(et),Ie.push(tt),Ie.push($t),Ie.push(St)}else{const[ft,Pt]=Yg(N,G,e,l),[$t,St]=Yg(V,Y,e,l),[Tt,Lt]=Yg(re,fe,e,l);ke.push(et),ke.push(tt),ke.push(Tt),ke.push(Lt),ke.push($t),ke.push(St),ke.push(ft),ke.push(Pt)}te+=s,L+=s,G+=s,Y+=s,fe+=s}const[Ne,J]=Yg(c+I,d+o,e,l),he=(r/2+p)*S,[xe,Pe]=Yg(c+he,d+o,e,l),[Oe,Ae]=Yg(c+I,d-a,e,l),[ze,Ge]=Yg(c+he,d-a,e,l);return{pennants:Ie,barbs:ke,shaft:[Ne,J,xe,Pe,Oe,Ae,ze,Ge]}}function Yg(t,e,i,r=1){const n=Math.sqrt(t*t+e*e)/r,s=(2*Math.PI+Math.atan2(e,t))%(2*Math.PI);return[n,(2*Math.PI+s-i)%(2*Math.PI)]}const cae=[0,1,3,6,10,16,21,27,33,40,47,55,63],OYt=[0,.5,1,1.5,2],RYt=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function L5(t,e,i,r){const n=lae(r||"knots",i);let s;for(s=1;sY>0).length:y*v,N=new Float32Array(L*l),G=new Uint32Array(c*L),V=e.invertDirection?QXe(0,0,0,!1):AYt;for(let Y=0;Y=bCe){const L=(a[I]+360)%360/180*Math.PI,{pennants:N,barbs:G,shaft:V}=wCe[Math.min(Math.floor(O/5),29)];if(N.length+G.length===0)continue;let Y=c.length/l;const X=(S+.5)/r,te=(v+.5)/n;for(let re=0;re=(ge-re)*(_e-fe)*(1-n)){L[te]=1;const[Ie,ke]=uae([I[te]/X,O[te]/X]);I[te]=Ie,O[te]=ke}else L[te]=0,I[te]=0,O[te]=0}const G=new en({width:y,height:v,pixels:[I,O],mask:L});return G.updateStatistics(),G}let hae=class{constructor(e,i){this._storage=new uxe,this._storage.maxSize=e,i&&this._storage.registerRemoveFunc("",i)}put(e,i){this._storage.put(e,i,1,1)}pop(e){return this._storage.pop(e)}get(e){return this._storage.get(e)}clear(){this._storage.clearAll()}destroy(){this._storage.destroy()}};function kYt(t){return typeof t=="function"}function vB(t,e,i,r){return kYt(t)?t(e,i,r):t}const NYt=` /-, -`;function tKe(t){let e=t.length;for(;e--;)if(!NYt.includes(t.charAt(e)))return!1;return!0}function iKe(t,e){const i=[];let r=0,n=-1;do if(n=t.indexOf("[",r),n>=r){if(n>r){const s=t.substr(r,n-r);i.push([s,null,tKe(s)])}if(r=n+1,n=t.indexOf("]",r),n>=r){if(n>r){const s=e[t.substr(r,n-r)];s&&i.push([null,s,!1])}r=n+1}}while(n!==-1);if(rrKe(n,r,i)}function nKe(t,e){switch(typeof t!="string"&&(t=String(t)),e){case"LowerCase":return t.toLowerCase();case"Allcaps":return t.toUpperCase();default:return t}}function BYt(t,e,i,r,n,s,o=!0){const a=e/n,l=i/s,c=Math.ceil(a/2),d=Math.ceil(l/2);for(let p=0;p=-1&&Ie<=1&&(S=2*Ie*Ie*Ie-3*Ie*Ie+1,S>0&&(_e=4*(ge+X*e),V+=S*t[_e+3],O+=S,t[_e+3]<255&&(S=S*t[_e+3]/250),L+=S*t[_e],N+=S*t[_e+1],G+=S*t[_e+2],I+=S))}}r[v]=L/I,r[v+1]=N/I,r[v+2]=G/I,r[v+3]=V/O}}function z1(t){return t?{r:t[0],g:t[1],b:t[2],a:t[3]/255}:{r:0,g:0,b:0,a:0}}function GYt(t){return t!=null&&(t.type==="CIMMarkerPlacementAlongLineRandomSize"||t.type==="CIMMarkerPlacementAlongLineSameSize"||t.type==="CIMMarkerPlacementAlongLineVariableSize"||t.type==="CIMMarkerPlacementAtExtremities"||t.type==="CIMMarkerPlacementAtMeasuredUnits"||t.type==="CIMMarkerPlacementAtRatioPositions"||t.type==="CIMMarkerPlacementOnLine"||t.type==="CIMMarkerPlacementOnVertices")}const bo=(t,e=0)=>t==null||isNaN(t)?e:t,dae=t=>t.tintColor?z1(t.tintColor):{r:255,g:255,b:255,a:1},VYt=t=>{if(!t)return!1;for(const e of t)switch(e.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectOffset":case"CIMGeometricEffectDonut":return!0}return!1};function UYt(){return Promise.resolve().then(()=>lZ)}function jYt(t){if(!t)return"normal";switch(t.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function zYt(t){if(!t)return"normal";switch(t.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function sKe(t){let e="",i="";if(t){const r=t.toLowerCase();r.includes("italic")?e="italic":r.includes("oblique")&&(e="oblique"),r.includes("bold")?i="bold":r.includes("light")&&(i="lighter")}return{style:e,weight:i}}function oKe(t){return t.underline?"underline":t.strikethrough?"line-through":"none"}function k5(t){if(!t)return null;switch(t.type){case"CIMPolygonSymbol":if(t.symbolLayers)for(const e of t.symbolLayers){const i=k5(e);if(i!=null)return i}break;case"CIMTextSymbol":return k5(t.symbol);case"CIMSolidFill":return t.color}}function N5(t){if(t)switch(t.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const e=t.symbolLayers;if(e)for(const i of e){const r=N5(i);if(r!=null)return r}break}case"CIMTextSymbol":return N5(t.symbol);case"CIMSolidStroke":case"CIMSolidFill":return t.color}}function sY(t){if(t)switch(t.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(t.symbolLayers)for(const e of t.symbolLayers){const i=sY(e);if(i!==void 0)return i}break;case"CIMTextSymbol":return sY(t.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return t.width}}function aKe(t){switch(t){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function lKe(t){switch(t){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function HYt(t){return(t?Object.keys(t):[]).map(e=>({name:e,alias:e,type:typeof t[e]=="string"?"esriFieldTypeString":"esriFieldTypeDouble"}))}const _B=t=>t.includes("data:image/svg+xml");new hae(1e3),new $r([128,128,128]);const WYt=new $r("white");function bB(t,e){if(!t)return null;let i=null;return _R(t)?i=qYt(t):vse(t)&&(i=t.color?new $r(t.color):null),i?oY(i,e):null}function qYt(t){const e=t.symbolLayers;if(!e)return null;let i=null;return e.forEach(r=>{r.type==="object"&&r.resource?.href!=null||(i=r.type==="water"?r.color:ye(r.material)?r.material.color:null)}),i?new $r(i):null}function oY(t,e){if(e==null||t==null)return t;const i=t.toRgba();return i[3]=i[3]*e,new $r(i)}function YYt(t,e,i){const r=t.symbolLayers;if(!r)return;const n=s=>{const o=ye(s)?s:null;return oY(e=e??o??(i!=null?WYt:null),i)};r.forEach(s=>{if(s.type!=="object"||s.resource?.href==null||e)if(s.type==="water")s.color=n(s.color);else{const o=ye(s.material)?s.material.color:null,a=n(o);lt(s.material)?s.material=new M1({color:a}):s.material.color=a,i!=null&&"outline"in s&&ye(s.outline)&&ye(s.outline.color)&&(s.outline.color=oY(s.outline.color,i))}})}function XYt(t,e,i){(e=e??t.color)&&(t.color=oY(e,i)),i!=null&&"outline"in t&&t.outline&&t.outline.color&&(t.outline.color=oY(t.outline.color,i))}function SCe(t,e,i){t&&(e||i!=null)&&(e&&(e=new $r(e)),_R(t)?YYt(t,e,i):vse(t)&&XYt(t,e,i))}async function KYt(t,e){const i=t.symbolLayers;i&&await m6t(i,async r=>JYt(r,e))}async function JYt(t,e){switch(t.type){case"extrude":QYt(t,e);break;case"icon":case"line":case"text":ZYt(t,e);break;case"path":tXt(t,e);break;case"object":await eXt(t,e)}}function ZYt(t,e){const i=uKe(e);ye(i)&&(t.size=i)}function uKe(t){for(const e of t)if(typeof e=="number")return e;return null}function QYt(t,e){t.size=typeof e[2]=="number"?e[2]:0}async function eXt(t,e){const{resourceSize:i,symbolSize:r}=await iXt(t),n=cKe(e,i,r);t.width=aY(e[0],r[0],i[0],n),t.depth=aY(e[1],r[1],i[1],n),t.height=aY(e[2],r[2],i[2],n)}function tXt(t,e){const i=cKe(e,yne,[t.width,void 0,t.height]);t.width=aY(e[0],t.width,1,i),t.height=aY(e[2],t.height,1,i)}function cKe(t,e,i){for(let r=0;r<3;r++){const n=t[r];switch(n){case"symbol-value":{const s=i[r];return s!=null?s/e[r]:1}case"proportional":break;default:if(n&&e[r])return n/e[r]}}return 1}async function iXt(t){const e=await Promise.resolve().then(()=>LGi),i=await e.computeObjectLayerResourceSize(t,10),{width:r,height:n,depth:s}=t,o=[r,s,n];let a=1;for(let l=0;l<3;l++){const c=o[l];if(c!=null){a=c/i[l];break}}for(let l=0;l<3;l++)o[l]==null&&(o[l]=i[l]*a);return{resourceSize:i,symbolSize:o}}function aY(t,e,i,r){switch(t){case"proportional":return i*r;case"symbol-value":return e??i;default:return t}}function rXt(t,e){const i=uKe(e);if(!lt(i))switch(t.type){case"simple-marker":t.size=i;break;case"picture-marker":{const r=t.width/t.height;r>1?(t.width=i,t.height=i*r):(t.width=i*r,t.height=i);break}case"simple-line":t.width=i;break;case"text":t.font.size=i}}async function hKe(t,e){if(t&&e)return _R(t)?KYt(t,e):void(vse(t)&&rXt(t,e))}function dKe(t,e,i){if(t&&e!=null)if(_R(t)){const r=t.symbolLayers;r&&r.forEach(n=>{if(n&&n.type==="object")switch(i){case"tilt":n.tilt=e;break;case"roll":n.roll=e;break;default:n.heading=e}})}else vse(t)&&(t.type!=="simple-marker"&&t.type!=="picture-marker"&&t.type!=="text"||(t.angle=e))}async function nXt(t,e){return await t.fetchSymbol(e)||t.fetchCIMSymbol(e)}var CCe;const pKe=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),pae=new Bs({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"}),fae=new Bs({flow_from:"flow-from",flow_to:"flow-to"});let l0=CCe=class extends SR(Ni){constructor(t){super(t),this.attributeField="Magnitude",this.flowRepresentation="flow-from",this.rotationType="arithmetic",this.style="single-arrow",this.symbolTileSize=50,this.type="vector-field"}readInputUnit(t,e){return pKe.has(t)?j1.fromJSON(t):null}readOutputUnit(t,e){return pKe.has(t)?j1.fromJSON(t):null}get styleRenderer(){const t=this.style,e=this.attributeField,i=this._createStyleRenderer(t);return i.field=e,i}get sizeVariables(){const t=[];if(this.visualVariables)for(const e of this.visualVariables)e.type==="size"&&t.push(e);if(t.length===0){const e=new i5({field:"Magnitude",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize});this.visualVariables?this.visualVariables.push(e):this._set("visualVariables",[e]),t.push(e)}return t}get rotationVariables(){const t=[];if(this.visualVariables)for(const e of this.visualVariables)e.type==="rotation"&&t.push(e);if(t.length===0){const e=new Ise({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(e):this._set("visualVariables",[e]),t.push(e)}return t}clone(){return new CCe({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:hi(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(t,e=!1,i=[]){const r=new Array,n=lae(this.inputUnit,this.outputUnit),s=this.rotationVariables[0]?.rotationType||this.rotationType,o=e?yB(t.pixelBlock,"vector-uv",s,n):EYt(t.pixelBlock,"vector-magdir",n);if(lt(o))return r;const a=t.extent,l=ye(o.mask)&&o.mask.length>0;let c=0;const d=(a.xmax-a.xmin)/o.width,p=(a.ymax-a.ymin)/o.height;for(let y=0;yO.intersects(S));if((!l||o.mask[c])&&!I){const O={Magnitude:o.pixels[0][c],Direction:o.pixels[1][c]},L=new js({geometry:{type:"point",x:S.x,y:S.y,spatialReference:a.spatialReference},attributes:O});L.symbol=this._getVisualVariablesAppliedSymbol(L),r.push(L)}}return r}getSymbol(t,e){}async getSymbolAsync(t,e){}getSymbols(){return[]}getClassBreakInfos(){return this.styleRenderer?.classBreakInfos}getDefaultSymbol(){return this.styleRenderer?.defaultSymbol}_getDefaultSymbol(t){return new gd({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new Tm({width:0}),size:20,color:t||new $r([0,92,230])})}_getVisualVariablesAppliedSymbol(t){if(!t)return;const e=this.styleRenderer?.getSymbol(t)?.clone(),i=this.sizeVariables,r=this.rotationVariables;if(i&&i.length&&this.sizeVariables.forEach(n=>hKe(e,uze([n],t))),r&&r.length){const n=this.flowRepresentation==="flow-to"==(this.style==="ocean-current-kn"||this.style==="ocean-current-m")?0:180;t.attributes.Direction=t.attributes.Direction+n,this.rotationVariables.forEach(s=>dKe(e,ixe(s,t),s.axis))}return e}_createStyleRenderer(t){let e={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(t){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 r5(e)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const t=[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 $r([214,47,39])),classBreakInfos:this._getClassBreaks(t,e)}}_createBeaufortMeterRenderer(){const t=[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 $r([214,47,39])),classBreakInfos:this._getClassBreaks(t,e)}}_createBeaufortFeetRenderer(){const t=this._getDefaultSymbol(new $r([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 i=[[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:t,classBreakInfos:this._getClassBreaks(e,i)}}_createBeaufortMilesRenderer(){const t=this._getDefaultSymbol(new $r([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 i=[[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:t,classBreakInfos:this._getClassBreaks(e,i)}}_createBeaufortKilometersRenderer(){const t=this._getDefaultSymbol(new $r([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 i=[[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:t,classBreakInfos:this._getClassBreaks(e,i)}}_createCurrentMeterRenderer(){const t=[0,.5,1,1.5,2],e=[[78,26,153],[179,27,26],[202,128,26],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new $r([177,177,177])),classBreakInfos:this._getClassBreaks(t,e)}}_createCurrentKnotsRenderer(){const t=[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 $r([177,177,177])),classBreakInfos:this._getClassBreaks(t,e)}}_createClassifiedArrowRenderer(){const t=this._getDefaultSymbol(new $r([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 i=[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]];return{defaultSymbol:t,classBreakInfos:this._getClassBreaks(e,i)}}_createSimpleScalarRenderer(){return{defaultSymbol:pA.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 t=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="}],i=pA.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=t.map((n,s)=>{let o;if(s!==t.length-1)if(s===0)o={minValue:n,maxValue:t[s+1],symbol:i};else{const a=pA.fromJSON({type:"esriPMS",imageData:e[s].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});o={minValue:n,maxValue:t[s+1],symbol:a}}return new T9(o)});return{defaultSymbol:i,classBreakInfos:r}}_getClassBreaks(t,e){return e.map((i,r)=>new T9({minValue:t[r],maxValue:t[r+1],symbol:this._getDefaultSymbol(new $r(i))}))}};E([k({type:String,json:{write:!0}})],l0.prototype,"attributeField",void 0),E([k({type:fae.apiValues,json:{type:fae.jsonValues,read:{reader:fae.read},write:{writer:fae.write}}})],l0.prototype,"flowRepresentation",void 0),E([k({type:["geographic","arithmetic"],json:{write:!0}})],l0.prototype,"rotationType",void 0),E([k({type:pae.apiValues,json:{type:pae.jsonValues,read:{reader:pae.read},write:{writer:pae.write}}})],l0.prototype,"style",void 0),E([k({json:{write:!0}})],l0.prototype,"symbolTileSize",void 0),E([k({type:j1.apiValues,json:{type:j1.jsonValues,write:{writer:j1.write}}})],l0.prototype,"inputUnit",void 0),E([Li("inputUnit")],l0.prototype,"readInputUnit",null),E([k({type:j1.apiValues,json:{type:j1.jsonValues,read:{reader:j1.read},write:{writer:j1.write}}})],l0.prototype,"outputUnit",void 0),E([Li("outputUnit")],l0.prototype,"readOutputUnit",null),E([Hr({vectorField:"vector-field"})],l0.prototype,"type",void 0),E([k({type:r5})],l0.prototype,"styleRenderer",null),E([k({type:i5})],l0.prototype,"sizeVariables",null),E([k({type:Ise})],l0.prototype,"rotationVariables",null),l0=CCe=E([ht("esri.renderers.VectorFieldRenderer")],l0);const TCe=l0,lY={key:"type",base:null,typeMap:{"unique-value":YC,"class-breaks":r5,"raster-colormap":cCe,"raster-stretch":pCe,"vector-field":TCe,"raster-shaded-relief":FXe,flow:vXe}},mae={...lY,typeMap:{...lY.typeMap}};delete mae.typeMap["vector-field"],delete mae.typeMap.flow;const sXt={uniqueValue:YC,classBreaks:r5,rasterStretch:pCe,rasterColormap:cCe,vectorField:TCe,rasterShadedRelief:FXe,flowRenderer:vXe};function oXt(t){return t&&sXt[t.type]||null}function fKe(t,e){if(!t)return null;if(t.type==="classBreaks"&&t.classificationMethod){const r=t.authoringInfo||{classificationMethod:""};r.classificationMethod=t.classificationMethod,t.authoringInfo=r}t.type==="vectorField"&&t.visualVariables&&!Array.isArray(t.visualVariables)&&(t.visualVariables=[t.visualVariables]);const i=oXt(t);if(i){const r=new i;return r.read(t,e),r}return e&&e.messages&&t&&e.messages.push(new wm("renderer:unsupported","Renderers of type '"+(t.type||"unknown")+"' are not supported",{definition:t,context:e})),null}var ECe;let $5=ECe=class extends Ni{constructor(t){super(t),this.variableName=null,this.dimensionName=null,this.values=[],this.isSlice=!1}clone(){return new ECe({variableName:this.variableName,dimensionName:this.dimensionName,values:hi(this.values),isSlice:this.isSlice})}};E([k({type:String,json:{write:!0}})],$5.prototype,"variableName",void 0),E([k({type:String,json:{write:!0}})],$5.prototype,"dimensionName",void 0),E([k({type:FH.array(FH.oneOf([FH.native(Number),FH.array(FH.native(Number))])),json:{write:!0}})],$5.prototype,"values",void 0),E([k({type:Boolean,json:{write:!0}})],$5.prototype,"isSlice",void 0),$5=ECe=E([ht("esri.layers.support.DimensionalDefinition")],$5);const iM=$5;var ICe;const gae=new Set(["raster","raster2","dem","fillraster"]),yae=new Set(["rasters"]),mKe=t=>t&&t.rasterFunction?n_.fromJSON(t):t,ACe=t=>t&&t instanceof n_?t.toJSON():t,PCe=t=>t?.functionName&&!t.declaredClass,gKe=t=>PCe(t)?new n_(t):t,aXt=t=>{if(t==null)return null;t=hi(t);const e={};for(const i of Object.keys(t))gae.has(i.toLowerCase())?e[i]=mKe(t[i]):yae.has(i.toLowerCase())&&Array.isArray(t[i])?e[i]=t[i].map(mKe):e[i]=t[i];return e};let n_=ICe=class extends Ni{constructor(t){super(t),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.rasterFunctionDefinition=null}set functionArguments(t){if(t){const e=Object.keys(t);if(e.some(i=>gae.has(i.toLowerCase())&&PCe(t[i]))||e.some(i=>yae.has(i.toLowerCase())&&Array.isArray(t[i])&&t[i].some(r=>PCe(r)))){t=hi(t);for(const i of e)gae.has(i.toLowerCase())?t[i]=gKe(t[i]):yae.has(i.toLowerCase())&&Array.isArray(t[i])&&(t[i]=t[i].map(r=>gKe(r)))}}this._set("functionArguments",t)}readFunctionArguments(t){return aXt(t)}writeFunctionArguments(t,e,i){const r={};for(const n of Object.keys(t))gae.has(n.toLowerCase())?r[n]=ACe(t[n]):yae.has(n.toLowerCase())&&Array.isArray(t[n])?r[n]=t[n].map(ACe):r[n]=ACe(t[n]);e[i]=r}readFunctionName(t,e){const i=e.rasterFunctionInfos;return e.name||(i&&i.length&&i[0].name!=="None"?i[0].name:e.rasterFunctionDefinition?e.rasterFunctionDefinition.name:e.rasterFunction)}clone(){return new ICe({functionName:this.functionName,functionArguments:hi(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:hi(this.rasterFunctionDefinition)})}};E([k({json:{type:Object,name:"rasterFunctionArguments"}})],n_.prototype,"functionArguments",null),E([Li("functionArguments")],n_.prototype,"readFunctionArguments",null),E([mr("functionArguments")],n_.prototype,"writeFunctionArguments",null),E([k({json:{type:String,write:{target:"rasterFunction"}}})],n_.prototype,"functionName",void 0),E([Li("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],n_.prototype,"readFunctionName",null),E([Hr({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}),k({json:{default:"unknown"}})],n_.prototype,"outputPixelType",void 0),E([k({type:String,json:{read:!0,write:!0}})],n_.prototype,"variableName",void 0),E([k({type:Object,json:{name:"rasterFunctionDefinition"}})],n_.prototype,"rasterFunctionDefinition",void 0),n_=ICe=E([ht("esri.layers.support.RasterFunction")],n_);const ru=n_,lXt={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:""}},uXt=new Set(["u1","u2","u4","u8","s8","u16","s16"]),cXt={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)"},hXt=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function yKe(t){return hXt.has(t.type)}function OCe(t,e){if(!t||!e)return hi(t||e);const i=hi(t);if(i.rasterFunctionDefinition&&e.rasterFunctionDefinition){const r=e.rasterFunctionDefinition;(r.thumbnail||r.thumbnailEx)&&(r.thumbnail=r.thumbnailEx=void 0),vKe(i.rasterFunctionDefinition.arguments,e)}else e.functionName?.toLowerCase()!=="none"&&(_Ke(i.functionArguments).Raster=e);return i}function vKe(t,e){for(const i in t)i.toLowerCase()==="raster"&&(t[i].type==="RasterFunctionVariable"?(t[i]=e.rasterFunctionDefinition,t[i].type="RasterFunctionTemplate"):t[i].type==="RasterFunctionTemplate"&&vKe(t[i].arguments,e))}function oT(t){const e=hi(lXt[t.functionName+"Function"]),i=t.functionArguments;for(const r in i)r.toLowerCase()==="raster"?(e.arguments[r]=oT(i[r]),e.arguments[r].type="RasterFunctionTemplate"):r.toLowerCase()==="colormap"?(e.arguments[r].value=bXt(i[r]),e.arguments.ColorSchemeType.value=0):e.arguments[r].value=i[r];return e}function dXt(t,e){switch(e=e||{},t.type){case"raster-stretch":return mXt(t,e);case"class-breaks":return gXt(t,e);case"unique-value":return yXt(t,e);case"raster-colormap":return vXt(t,e);case"vector-field":return pXt(t,e);case"raster-shaded-relief":return fXt(t,e);case"flow":throw new Error("Unsupported rendering rule.")}}function _Ke(t){const e=t?.Raster;return e&&e.declaredClass==="esri.layers.support.RasterFunction"?_Ke(e.functionArguments):t}const uY={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function pXt(t,e){const i=new ru;i.functionName="VectorFieldRenderer";const{dataType:r,bandProperties:n}=e,s=r==="vector-uv";let o,a;n&&n.length===2&&(o=n.map(y=>y.BandName.toLowerCase()).indexOf("magnitude"),a=n.map(y=>y.BandName.toLowerCase()).indexOf("direction")),o!==-1&&o!==null||(o=0,a=1);const l=t.rotationType==="arithmetic"?1:2,c=t.flowRepresentation==="flow-from"?0:1,d=t.visualVariables?t.visualVariables.find(y=>y.field==="Magnitude"):new i5,p={magnitudeBandID:o,directionBandID:a,isUVComponents:s,referenceSystem:l,massFlowAngleRepresentation:c,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:cXt[t.style.toLowerCase().replace("-","_")],minimumMagnitude:d.minDataValue,maximumMagnitude:d.maxDataValue,minimumSymbolSize:d.minSize,maximumSymbolSize:d.maxSize};return i.functionArguments=p,e.convertToRFT?new ru({rasterFunctionDefinition:oT(i)}):i}function fXt(t,e){const i=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 ru;const r=new ru;r.functionName="Hillshade";const n=t.hillshadeType==="traditional"?0:1,s=t.scalingType==="none"?1:3,o={HillshadeType:n,SlopeType:s,ZFactor:t.zFactor};return n===0&&(o.Azimuth=t.azimuth,o.Altitude=t.altitude),s===3&&(o.PSPower=t.pixelSizePower,o.PSZFactor=t.pixelSizeFactor),r.functionArguments=o,r.variableName="Raster",t.colorRamp&&(r.functionName="ShadedRelief",i?o.ColorRamp=RXe(t.colorRamp):o.Colormap=BA(t.colorRamp)),i?new ru({rasterFunctionDefinition:oT(r)}):r}function mXt(t,e){const i=e.convertToRFT,r=new ru;r.functionName="Stretch";const n=uY[eY.toJSON(t.stretchType)],s="u8",o={StretchType:n,Statistics:_Xt(t.statistics??[]),DRA:t.dynamicRangeAdjustment,UseGamma:t.useGamma,Gamma:t.gamma,ComputeGamma:t.computeGamma};if(t.outputMin!=null&&(o.Min=t.outputMin),t.outputMax!=null&&(o.Max=t.outputMax),n===uY.standardDeviation?(o.NumberOfStandardDeviations=t.numberOfStandardDeviations,r.outputPixelType=s):n===uY.percentClip?(o.MinPercent=t.minPercent,o.MaxPercent=t.maxPercent,r.outputPixelType=s):n===uY.minMax?r.outputPixelType=s:n===uY.sigmoid&&(o.SigmoidStrengthLevel=t.sigmoidStrengthLevel),r.functionArguments=o,r.variableName="Raster",t.colorRamp){const a=t.colorRamp,l=new ru;if(i)l.functionArguments={ColorRamp:RXe(a)};else{const c=AXe(a);if(c)l.functionArguments={colorRamp:c};else if(!e.convertColorRampToColormap||a.type!=="algorithmic"&&a.type!=="multipart"){const d=t.colorRamp.toJSON();d.type==="algorithmic"?d.algorithm=d.algorithm||"esriCIELabAlgorithm":d.type==="multipart"&&d.colorRamps?.length&&d.colorRamps.forEach(p=>p.algorithm=p.algorithm||"esriCIELabAlgorithm"),l.functionArguments={colorRamp:d}}else l.functionArguments={Colormap:BA(a)}}return l.variableName="Raster",l.functionName="Colormap",l.functionArguments.Raster=r,i?new ru({rasterFunctionDefinition:oT(l)}):l}return i?new ru({rasterFunctionDefinition:oT(r)}):r}function gXt(t,e){const i=[],r=[],n=[],s=[],{pixelType:a,rasterAttributeTable:l}=e,c=lt(l)?null:l.features,d=bKe(l);if(d&&c&&Array.isArray(c)&&t.classBreakInfos){t.classBreakInfos.forEach((O,L)=>{const N=O.symbol?.color;let G;N?.a&&O.minValue!=null&&O.maxValue!=null&&c.forEach(V=>{O.minValue!=null&&O.maxValue!=null&&(G=V.attributes[t.field],(G>=O.minValue&&G=O.minValue)&&s.push([V.attributes[d],N.r,N.g,N.b]))})});const S=a?vae(s,a):s,I=new ru;return I.functionName="Colormap",I.functionArguments={},I.functionArguments.Colormap=S,I.variableName="Raster",e.convertToRFT?new ru({rasterFunctionDefinition:oT(I)}):I}t.classBreakInfos.forEach((S,I)=>{if(S.minValue==null||S.maxValue==null)return;const O=S.symbol&&S.symbol.color;O?.a?(I===0?i.push(S.minValue,S.maxValue+1e-6):i.push(S.minValue+1e-6,S.maxValue+1e-6),r.push(I),s.push([I,O.r,O.g,O.b])):n.push(S.minValue,S.maxValue)});const p=a?vae(s,a):s,y=new ru;y.functionName="Remap",y.functionArguments={InputRanges:i,OutputValues:r,NoDataRanges:n},y.variableName="Raster";const v=new ru;return v.functionName="Colormap",v.functionArguments={Colormap:p,Raster:y},e.convertToRFT?new ru({rasterFunctionDefinition:oT(v)}):v}function vae(t,e){const i=uXt.has(e)?sT(e):null;return i&&t.push([Math.floor(i[0]-1),0,0,0],[Math.ceil(i[1]+1),0,0,0]),t}function bKe(t){if(lt(t))return;const{fields:e}=t,i=e&&e.find(r=>r&&r.name&&r.name.toLowerCase()==="value");return i&&i.name}function yXt(t,e){const i=[],{pixelType:r,rasterAttributeTable:n}=e,s=lt(n)?null:n.features,o=bKe(n),a=t.defaultSymbol?.color?.toRgb(),l=t.uniqueValueInfos;if(l)if(s){if(o){const p=new Map;l.forEach(v=>{const S=v.value,I=v.symbol?.color;S!=null&&I&&I.a&&p.set(String(S),I.toRgb())});const y=t.field;s.forEach(({attributes:v})=>{const S=String(v[y]),I=v[o],O=p.get(S);O?i.push([I,...O]):a&&i.push([I,...a])})}}else for(let p=0;p0?vae(i,r):i,d=new ru;return d.functionName="Colormap",d.functionArguments={},d.functionArguments.Colormap=c,d.variableName="Raster",e.convertToRFT?new ru({rasterFunctionDefinition:oT(d)}):d}function vXt(t,e){const i=t.extractColormap();if(!i||i.length===0)return null;const{pixelType:r}=e,n=r?vae(i,r):i,s=new ru;return s.functionName="Colormap",s.functionArguments={},s.functionArguments.Colormap=n,e.convertToRFT?new ru({rasterFunctionDefinition:oT(s)}):s}function _Xt(t){const e=[];return t?.forEach(i=>{const r=i;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 bXt(t){const e=[],i=[];return t.forEach(r=>{e.push(r[0]),i.push(iYt([...r.slice(1),255]))}),{type:"RasterColormap",values:e,colors:i}}var RCe;const cY=jo()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),MCe=jo()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function wXt(t){let e;switch(t?t.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 MCe.fromJSON(e)}let Pm=RCe=class extends Ni{constructor(t){super(t),this.ascending=!0,this.itemRenderingRule=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(t,e){return e.ascending!=null?e.ascending:e.sortAscending==null||e.sortAscending}readMethod(t,e){return wXt(e.mosaicMethod||e.defaultMosaicMethod)}writeMultidimensionalDefinition(t,e,i){t!=null&&(t=t.filter(({variableName:r,dimensionName:n})=>r&&r!=="*"||n)).length&&(e[i]=t.map(r=>r.toJSON()))}readOperation(t,e){const i=e.mosaicOperation,r=e.mosaicOperator&&e.mosaicOperator.toLowerCase(),n=i||(r?cY.toJSON(r):null);return cY.fromJSON(n)||"first"}castSortValue(t){return t==null||typeof t=="string"||typeof t=="number"?t:`${t}`}clone(){return new RCe({ascending:this.ascending,itemRenderingRule:hi(this.itemRenderingRule),lockRasterIds:hi(this.lockRasterIds),method:this.method,multidimensionalDefinition:hi(this.multidimensionalDefinition),objectIds:hi(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:hi(this.viewpoint),where:this.where})}};E([k({type:Boolean,json:{write:!0}})],Pm.prototype,"ascending",void 0),E([Li("ascending",["ascending","sortAscending"])],Pm.prototype,"readAscending",null),E([k({type:ru,json:{write:!0}})],Pm.prototype,"itemRenderingRule",void 0),E([k({type:[xs],json:{write:{overridePolicy(){return{enabled:this.method==="lock-raster"}}}}})],Pm.prototype,"lockRasterIds",void 0),E([k({type:String,json:{type:MCe.jsonValues,write:{target:"mosaicMethod",writer:MCe.write}}})],Pm.prototype,"method",void 0),E([Li("method",["mosaicMethod","defaultMosaicMethod"])],Pm.prototype,"readMethod",null),E([k({type:[iM],json:{write:!0}})],Pm.prototype,"multidimensionalDefinition",void 0),E([mr("multidimensionalDefinition")],Pm.prototype,"writeMultidimensionalDefinition",null),E([k({type:[xs],json:{name:"fids",write:!0}})],Pm.prototype,"objectIds",void 0),E([k({json:{type:cY.jsonValues,read:{reader:cY.read},write:{target:"mosaicOperation",writer:cY.write}}})],Pm.prototype,"operation",void 0),E([Li("operation",["mosaicOperation","mosaicOperator"])],Pm.prototype,"readOperation",null),E([k({type:String,json:{write:{overridePolicy(){return{enabled:this.method==="attribute"}}}}})],Pm.prototype,"sortField",void 0),E([k({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:this.method==="attribute",allowNull:!0}}}}})],Pm.prototype,"sortValue",void 0),E([Zs("sortValue")],Pm.prototype,"castSortValue",null),E([k({type:Yi,json:{write:!0}})],Pm.prototype,"viewpoint",void 0),E([k({type:String,json:{write:!0}})],Pm.prototype,"where",void 0),Pm=RCe=E([ht("esri.layers.support.MosaicRule")],Pm);const H1=Pm,GA=jo()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),hY=jo()({esriNoDataMatchAny:"any",esriNoDataMatchAll:"all"});let Op=class extends Ni{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,i,r){this.layer.version<10.3||(i[r]=e)}get bandIds(){return this.layer.bandIds}get compressionQuality(){return this.layer.compressionQuality}writeCompressionQuality(e,i,r){this.format&&this.format.toLowerCase().includes("jpg")&&e!=null&&(i[r]=e)}get compressionTolerance(){return this.layer.compressionTolerance}writeCompressionTolerance(e,i,r){this.format==="lerc"&&e!=null&&(i[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,i,r){this.format==="lerc"&&this.layer.version>=10.5&&(i[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("renderingRule"),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 i=e.mosaicRule;const r=e.definitionExpression;return i?r&&r!==i.where&&(i=i.clone(),i.where=r):r&&(i=new H1({where:r})),i}get renderingRule(){const e=this.layer;let i=e.renderingRule;const r=e.pixelFilter,n=!e.format||e.format.includes("jpg")||e.format.includes("png");i=this._addResampleRasterFunction(i);const s=e.multidimensionalSubset?.areaOfInterest;return s&&(i=this._addClipFunction(i,s)),n&&!r&&e.renderer?.type!=="vector-field"&&(i=this.combineRendererWithRenderingRule(i)),i}combineRendererWithRenderingRule(e){const i=this.layer,{rasterInfo:r,renderer:n}=i;return e=e||i.renderingRule,!n||!yKe(n)?e:OCe(dXt(n,{rasterAttributeTable:r.attributeTable,pixelType:r.pixelType,dataType:r.dataType,bandProperties:r.keyProperties?.BandProperties,convertColorRampToColormap:i.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 i=this.layer.serviceDataType==="esriImageServiceDataTypeVector-UV"?7:10,r=this.layer.serviceRasterInfo.pixelSize;let n=new ru({functionName:"Resample",functionArguments:{ResamplingType:i,InputCellSize:r}});return n=e?.rasterFunctionDefinition?new ru({rasterFunctionDefinition:oT(n)}):n,OCe(n,e)}_addClipFunction(e,i){const r=new ru({functionName:"Clip",functionArguments:{ClippingGeometry:i.toJSON(),ClippingType:1}});return OCe(r,e)}};E([k()],Op.prototype,"layer",void 0),E([k({json:{write:!0}})],Op.prototype,"adjustAspectRatio",null),E([mr("adjustAspectRatio")],Op.prototype,"writeAdjustAspectRatio",null),E([k({json:{write:!0}})],Op.prototype,"bandIds",null),E([k({json:{write:!0}})],Op.prototype,"compression",void 0),E([k({json:{write:!0}})],Op.prototype,"compressionQuality",null),E([mr("compressionQuality")],Op.prototype,"writeCompressionQuality",null),E([k({json:{write:!0}})],Op.prototype,"compressionTolerance",null),E([mr("compressionTolerance")],Op.prototype,"writeCompressionTolerance",null),E([k({json:{write:!0}})],Op.prototype,"format",null),E([k({type:String,json:{read:{reader:GA.read},write:{writer:GA.write}}})],Op.prototype,"interpolation",null),E([k({json:{write:!0}})],Op.prototype,"noData",null),E([k({type:String,json:{read:{reader:hY.read},write:{writer:hY.write}}})],Op.prototype,"noDataInterpretation",null),E([k({json:{write:!0}})],Op.prototype,"pixelType",void 0),E([k({json:{write:!0}})],Op.prototype,"lercVersion",void 0),E([mr("lercVersion")],Op.prototype,"writeLercVersion",null),E([k({type:Number})],Op.prototype,"version",null),E([k({json:{write:!0}})],Op.prototype,"mosaicRule",null),E([k({json:{write:!0}})],Op.prototype,"renderingRule",null),Op=E([ht("esri.layers.mixins.ExportImageServiceParameters")],Op);async function rM(t,e){try{return await createImageBitmap(t)}catch(i){throw new st("request:server",`Unable to load ${e}`,{url:e,error:i})}}var DCe;const xXt={base:Jr,key:"type",typeMap:{extent:vr,polygon:po}};let B5=DCe=class extends Ni{constructor(t){super(t),this.areaOfInterest=null,this.subsetDefinitions=null}get dimensions(){const{subsetDefinitions:t}=this;if(t==null||t.length===0)return[];const e=new Map;t.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 i=[];for(const r of e)i.push({name:r[0],extent:r[1]});return i}get variables(){const{subsetDefinitions:t}=this;if(t==null||t.length===0)return[];const e=new Set;return t.forEach(i=>{i.variableName&&e.add(i.variableName)}),[...e]}clone(){const t=this.subsetDefinitions?.map(i=>i.clone()),e=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new DCe({areaOfInterest:e,subsetDefinitions:t})}};E([k({types:xXt,json:{read:fl,write:!0}})],B5.prototype,"areaOfInterest",void 0),E([k({readOnly:!0})],B5.prototype,"dimensions",null),E([k({readOnly:!0})],B5.prototype,"variables",null),E([k({type:[iM],json:{write:!0}})],B5.prototype,"subsetDefinitions",void 0),B5=DCe=E([ht("esri.layers.support.MultidimensionalSubset")],B5);const wKe=B5;var FCe;let Xg=FCe=class extends Ni{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 FCe({blockWidth:this.blockWidth,blockHeight:this.blockHeight,compression:this.compression,origin:hi(this.origin),firstPyramidLevel:this.firstPyramidLevel,maximumPyramidLevel:this.maximumPyramidLevel,pyramidResolutions:hi(this.pyramidResolutions),pyramidScalingFactor:this.pyramidScalingFactor,pyramidBlockWidth:this.pyramidBlockWidth,pyramidBlockHeight:this.pyramidBlockHeight,isVirtualTileInfo:this.isVirtualTileInfo,tileInfo:hi(this.tileInfo),transposeInfo:hi(this.transposeInfo),blockBoundary:hi(this.blockBoundary)})}};E([k({type:Number,json:{write:!0}})],Xg.prototype,"blockWidth",void 0),E([k({type:Number,json:{write:!0}})],Xg.prototype,"blockHeight",void 0),E([k({type:String,json:{write:!0}})],Xg.prototype,"compression",void 0),E([k({type:Yi,json:{write:!0}})],Xg.prototype,"origin",void 0),E([k({type:Number,json:{write:!0}})],Xg.prototype,"firstPyramidLevel",void 0),E([k({type:Number,json:{write:!0}})],Xg.prototype,"maximumPyramidLevel",void 0),E([k({json:{write:!0}})],Xg.prototype,"pyramidResolutions",void 0),E([k({type:Number,json:{write:!0}})],Xg.prototype,"pyramidScalingFactor",void 0),E([k({type:Number,json:{write:!0}})],Xg.prototype,"pyramidBlockWidth",void 0),E([k({type:Number,json:{write:!0}})],Xg.prototype,"pyramidBlockHeight",void 0),E([k({type:Boolean,json:{write:!0}})],Xg.prototype,"isVirtualTileInfo",void 0),E([k({json:{write:!0}})],Xg.prototype,"tileInfo",void 0),E([k()],Xg.prototype,"transposeInfo",void 0),E([k()],Xg.prototype,"blockBoundary",void 0),Xg=FCe=E([ht("esri.layers.support.RasterStorageInfo")],Xg);const G5=Xg;var LCe;let bd=LCe=class extends Ni{constructor(t){super(t),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 dataType(){const t=this.keyProperties?.DataType?.toLowerCase()??"generic";return t==="stdtime"?"standard-time":t}get nativeExtent(){return this._get("nativeExtent")||this.extent}set nativeExtent(t){t&&this._set("nativeExtent",t)}get nativePixelSize(){if(lt(this.transform)||!this.transform.affectsPixelSize)return this.pixelSize;const t=this.nativeExtent;return{x:t.width/this.width,y:t.height/this.height}}get hasMultidimensionalTranspose(){return!!this.storageInfo?.transposeInfo}clone(){return new LCe({attributeTable:hi(this.attributeTable),bandCount:this.bandCount,colormap:hi(this.colormap),extent:hi(this.extent),nativePixelSize:hi(this.nativePixelSize),format:this.format,height:this.height,width:this.width,histograms:hi(this.histograms),keyProperties:hi(this.keyProperties),multidimensionalInfo:hi(this.multidimensionalInfo),noDataValue:this.noDataValue,pixelSize:hi(this.pixelSize),pixelType:this.pixelType,isPseudoSpatialReference:this.isPseudoSpatialReference,spatialReference:hi(this.spatialReference),statistics:hi(this.statistics),storageInfo:hi(this.storageInfo),transform:hi(this.transform)})}};E([k({json:{write:!0}})],bd.prototype,"attributeTable",void 0),E([k({json:{write:!0}})],bd.prototype,"bandCount",void 0),E([k({json:{write:!0}})],bd.prototype,"colormap",void 0),E([k({type:String,readOnly:!0})],bd.prototype,"dataType",null),E([k({type:vr,json:{write:!0}})],bd.prototype,"extent",void 0),E([k({type:vr,json:{write:!0}})],bd.prototype,"nativeExtent",null),E([k({json:{write:!0}})],bd.prototype,"nativePixelSize",null),E([k({json:{write:!0}})],bd.prototype,"format",void 0),E([k({json:{write:!0}})],bd.prototype,"height",void 0),E([k({json:{write:!0}})],bd.prototype,"width",void 0),E([k({json:{write:!0}})],bd.prototype,"hasMultidimensionalTranspose",null),E([k({json:{write:!0}})],bd.prototype,"histograms",void 0),E([k({json:{write:!0}})],bd.prototype,"keyProperties",void 0),E([k({json:{write:!0}})],bd.prototype,"multidimensionalInfo",void 0),E([k({json:{write:!0}})],bd.prototype,"noDataValue",void 0),E([k({json:{write:!0}})],bd.prototype,"pixelSize",void 0),E([k({json:{write:!0}})],bd.prototype,"pixelType",void 0),E([k()],bd.prototype,"isPseudoSpatialReference",void 0),E([k({type:rr,json:{write:!0}})],bd.prototype,"spatialReference",void 0),E([k({json:{write:!0}})],bd.prototype,"statistics",void 0),E([k({type:G5,json:{write:!0}})],bd.prototype,"storageInfo",void 0),E([k({json:{write:!0}})],bd.prototype,"transform",void 0),bd=LCe=E([ht("esri.layers.support.RasterInfo")],bd);const R2=bd;let xKe=class{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const e=await wA("RasterWorker");this._destroyed?e.close():this._workerThread=e}destroy(){this._destroyed=!0,this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(e,i){if(!this._workerThread)throw new st("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:e.pixelBlock.toJSON(),type:e.dataType},i);return r?new en(r):null}async decode(e,i){if(!this._workerThread)throw new st("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("decode",e,i);return r?new en(r):null}async symbolize(e,i){if(!this._workerThread)throw new st("raster-jobhandler:no-connection","no available worker connection");const r={extent:e.extent&&e.extent.toJSON(),pixelBlock:ye(e.pixelBlock)&&e.pixelBlock.toJSON(),simpleStretchParams:e.simpleStretchParams,bandIds:e.bandIds},n=await this._workerThread.invoke("symbolize",r,i);return n?new en(n):null}async updateSymbolizer(e,i){if(!this._workerThread)throw new st("raster-jobhandler:no-connection","no available worker connection");const r=e?.rendererJSON?.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:e.toJSON(),histograms:r},i))}async updateRasterFunction(e,i){if(!this._workerThread)throw new st("raster-jobhandler:no-connection","no available worker connection");await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:e.toJSON()},i))}async process(e,i){if(!this._workerThread)throw new st("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("process",{extent:e.extent?.toJSON(),primaryPixelBlocks:e.primaryPixelBlocks.map(n=>ye(n)?n.toJSON():null),primaryRasterIds:e.primaryRasterIds},i);return r?new en(r):null}async stretch(e,i){if(!this._workerThread)throw new st("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,i);return n?new en(n):null}async split(e,i){if(!this._workerThread)throw new st("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},n=await this._workerThread.invoke("split",r,i);return n&&n.forEach((s,o)=>{n.set(o,s?en.fromJSON(s):null)}),n}async estimateStatisticsHistograms(e,i){if(!this._workerThread)throw new st("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,i)}async mosaicAndTransform(e,i){if(!this._workerThread)throw new st("raster-jobhandler:no-connection","no available worker connection");if(!e?.srcPixelBlocks?.length)return{pixelBlock:null};const r={...e,srcPixelBlocks:e.srcPixelBlocks.map(s=>ye(s)?s.toJSON():null)},n=await this._workerThread.invoke("mosaicAndTransform",r,i);return{pixelBlock:n.pixelBlock?new en(n.pixelBlock):null,localNorthDirections:n.localNorthDirections}}async createFlowMesh(e,i){if(!this._workerThread)throw new st("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},{...i,transferList:[r.buffer,r.maskBuffer]});return{vertexData:new Float32Array(o.vertexBuffer),indexData:new Uint32Array(o.indexBuffer)}}getProjectionOffsetGrid(e,i){if(!this._workerThread)throw new st("raster-jobhandler:no-connection","no available worker connection");const r=ye(e.datumTransformation)?e.datumTransformation.steps.map(o=>({wkid:o.wkid,wkt:o.wkt,isInverse:o.isInverse})):null,n=ye(e.rasterTransform)?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,i)}};function SKe(t,e,i){const r=e.shift();if(i.length===0){const s=[];i.push({sliceId:-1,multidimensionalDefinition:s})}const n=i.length;for(let s=0;s{i.push({sliceId:-1,multidimensionalDefinition:[...o,{variableName:t,dimensionName:r.name,values:[a]}]})})}e.length&&SKe(t,e,i)}function SXt(t,e){const i=[];let r=0;return(e?t.variables.filter(n=>n.name.toLowerCase()===e.toLowerCase()):[...t.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);SKe(n.name,o,s),s.forEach(a=>{i.push({...a,sliceId:r++})})}),i}function CXt(t,e,i){let r=t;if(e&&(e=[...e].sort((n,s)=>n.dimensionName{s.length&&(r=r.filter(a=>{const l=a.multidimensionalDefinition.find(d=>d.dimensionName===n);if(l==null)return!1;const c=l.values[0];return typeof c=="number"?typeof s[0]=="number"?s.includes(c):s.some(d=>d[0]<=c&&d[1]>=c):typeof s[0]=="number"?s.some(d=>c[0]<=d&&c[1]>=d):o?s.some(d=>d[0]===c[0]&&d[0]===c[1]):s.some(d=>d[0]>=c[0]&&d[0]<=c[1]||d[1]>=c[0]&&d[1]<=c[1]||d[0]c[1])}))}),r.length&&i&&ye(i.start)&&ye(i.end)){const n=i.start.getTime(),s=i.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 CKe(t,e){return Array.isArray(t)?e[0]===e[1]?t[0]===e[0]||t[1]===e[0]:t[0]>=e[0]&&t[0]<=e[1]&&t[1]>=e[0]&&t[1]<=e[1]:t>=e[0]&&t<=e[1]}function TXt(t,e){return t[0]<=e[0]&&t[1]>=e[0]||t[0]<=e[1]&&t[1]>=e[1]||t[0]>=e[0]&&t[1]<=e[1]}function TKe(t){return t.length===1?[t[0],t[0]]:[t[0],t[t.length-1]]}function EKe(t,e,i){if(!e?.subsetDefinitions?.length)return t;let r;if(i){const{variables:o}=e;if(o.length&&!o.includes(i))return null;const a=e.subsetDefinitions.find(l=>l.dimensionName===t.name&&l.variableName===i);if(!a?.values?.length)return t;r=TKe(a.values)}else r=e.dimensions.find(({name:o})=>o===t.name)?.extent;const n=r;if(!n||!n?.length)return t;const s=t.values.filter(o=>CKe(o,n));return{...t,extent:[...n],values:s}}function dY(t,e,i){if(!e?.subsetDefinitions?.length)return!1;const{variables:r}=e;if(r.length&&t.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=TKe(o.values);if(!s.isSlice&&s.values.length===2&&!Array.isArray(s.values[0])&&s.values[0]!==s.values[1]&&i){if(!TXt(s.values,a))return!0}else if(s.values.some(l=>!CKe(l,a)))return!0}}return!1}function kCe(t,e){if(lt(t))return{isOutside:!1};const{geometry:i,timeExtent:r,multidimensionalDefinition:n}=e;let s=null;if(ye(r)&&(s=EXt(t,r),lt(s)))return{isOutside:!0};const{areaOfInterest:o}=t;if(o&&i){const a=i.type==="point"?i:i.type==="extent"?i.center:i.type==="polygon"?i.centroid:null;if(a&&!o.contains(a))return{isOutside:!0}}return ye(n)&&n.length&&dY(n,t,!0)?{isOutside:!0}:{isOutside:!1,intersection:{geometry:i,timeExtent:s,multidimensionalDefinition:n}}}function EXt(t,e){const i=t.dimensions.find(({name:o})=>o==="StdTime");if(i==null||lt(e.start)&<(e.end))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&&i?.extent.length&&(s[0]=Math.max(s[0],i.extent[0]),s[1]=Math.min(s[1],i.extent[1]??i.extent[0]),s[1]s.variables.includes(d))),l?c.find(({name:d})=>d===l)??c[0]:c[0]}function $Ce(t,e={}){const i=NCe(t,e);if(!i)return null;const r=[],{dimensions:n,name:s}=i;if(n.length===0)return[new iM({variableName:s,dimensionName:"",values:[],isSlice:!0})];for(let o=0;o{if(e.values==null)return!0;const i=e.values.length;return i===0||i>1||!e.isSlice&&Array.isArray(e.values[0])})}function AKe(t,e){if(lt(e)||lt(t))return null;let i=e.variables.map(r=>({...r}));return t?.variables?.length&&(i=i.filter(({name:r})=>t.variables.includes(r)),i.forEach(r=>{r.dimensions=r.dimensions.map(n=>EKe(n,t,r.name)).filter(ye)})),i}function IXt(t,e){const{values:i}=e;if(i?.length)return Array.isArray(i[0])!==Array.isArray(t)?-1:Array.isArray(i[0])?i.findIndex(a=>a[0]===t[0]&&a[1]===t[1]):i.indexOf(t);const{extent:r}=e;if(Array.isArray(t)||tr[1])return-1;const n=e.interval||1;if(e.unit!=="ISO8601")return Math.round((t-r[0])/n);const s=r[0];let o=-1;switch(e.intervalUnit?.toLowerCase()||"seconds"){case"seconds":o=Math.round((t-s)/1e3/n);break;case"minutes":o=Math.round((t-s)/6e4/n);break;case"hours":o=Math.round((t-s)/36e5/n);break;case"days":o=Math.round((t-s)/864e5/n);break;case"months":{const a=new Date(t).getUTCFullYear()-new Date(s).getUTCFullYear(),l=new Date(s).getUTCMonth(),c=new Date(t).getUTCMonth();o=a===0?c-l:c+11-l+12*(a-1)}break;case"years":o=Math.round((new Date(t).getUTCFullYear()-new Date(s).getUTCFullYear())/n);break;case"decades":o=Math.round((new Date(t).getUTCFullYear()-new Date(s).getUTCFullYear())/10/n)}return o}function PKe(t){let e=t.values?.length;if(e)return e;const{extent:i,unit:r}=t,n=t.interval||1,s=i?i[1]-i[0]:0;if(r!=="ISO8601")return Math.round(s/n);switch(t.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(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear(),a=new Date(i[1][0]).getUTCMonth(),l=new Date(i[1][1]).getUTCMonth();e=o===0?l-a+1:l+11-a+12*(o-1)+1}break;case"years":e=Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/n);break;case"decades":e=Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/10/n);break;default:e=0}return e}function AXt(t,e){let i=0;const r=t[0].variableName,n=[...e.variables].sort((s,o)=>s.name>o.name?1:-1);for(let s=0;sd.name>p.name?-1:1);if(o.name!==r){i+=a.map(d=>PKe(d)).reduce((d,p)=>d*p);continue}const l=a.map(d=>PKe(d)),c=a.length;for(let d=0;dv.dimensionName===a[d].name);if(p==null)return null;const y=IXt(p.values[0],a[d]);if(y===-1)return null;l.shift(),i+=d===c-1?y:y*l.reduce((v,S)=>v*S)}break}return i}var BCe,OKe,RKe,V5={},PXt={get exports(){return V5},set exports(t){V5=t}};OKe=PXt,BCe=function(){function t(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return t.prototype={ensureBuffer:function(e){var i=this.buffer,r=i?i.byteLength:0;if(en&&(r=n)}else{for(;!this.eof;)this.readBlock();r=this.bufferLength}return this.pos=r,this.buffer.subarray(i,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,i,r){for(var n=e+i;this.bufferLength<=n&&!this.eof;)this.readBlock();return new Stream(this.buffer,e,i,r)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=0}},t}(),(RKe=function(){if(!self||!self.Uint32Array)return null;var t=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]),i=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,c=a[l++],d=a[l++];c!=-1&&d!=-1||s("Invalid header in flate stream"),(15&c)!=8&&s("Unknown compression method in flate stream"),((c<<8)+d)%31!=0&&s("Bad FCHECK in flate stream"),32&d&&s("FDICT bit set in flate stream"),this.bytes=a,this.bytesPos=l,this.codeSize=0,this.codeBuf=0,BCe.call(this)}return o.prototype=Object.create(BCe.prototype),o.prototype.getBits=function(a){for(var l,c=this.codeSize,d=this.codeBuf,p=this.bytes,y=this.bytesPos;c>a,this.codeSize=c-=a,this.bytesPos=y,l},o.prototype.getCode=function(a){for(var l=a[0],c=a[1],d=this.codeSize,p=this.codeBuf,y=this.bytes,v=this.bytesPos;d>16,L=65535&I;return(d==0||d>O,this.codeSize=d-O,this.bytesPos=v,L},o.prototype.generateHuffmanTable=function(a){for(var l=a.length,c=0,d=0;dc&&(c=a[d]);for(var p=1<>=1;for(d=L;d0;)ze[I++]=et}var l=this.getBits(3);if(1&l&&(this.eof=!0),(l>>=1)!=0){var c,d;if(l==1)c=r,d=n;else if(l==2){for(var p=this.getBits(5)+257,y=this.getBits(5)+1,v=this.getBits(4)+4,S=Array(t.length),I=0;I=Y&&(Y=(xe=this.ensureBuffer(X+1)).length),xe[X++]=te;else{if(te==256)return void(this.bufferLength=X);var re=(te=e[te-=257])>>16;re>0&&(re=this.getBits(re)),L=(65535&te)+re,te=this.getCode(d),(re=(te=i[te])>>16)>0&&(re=this.getBits(re));var fe=(65535&te)+re;X+L>=Y&&(Y=(xe=this.ensureBuffer(X+L)).length);for(var ge=0;ge{let d=null;o==="jpg"&&a&&(d=TLt._getMask(e,{width:n,height:s}));const p=new Blob([new Uint8Array(e)],{type:"image/"+o=="jpg"?"jpeg":o}),y=URL.createObjectURL(p),v=new Image;let S;v.src=y,v.onload=()=>{if(URL.revokeObjectURL(y),bm(r))return void c(vc());n=v.width,s=v.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(v,0,0);const I=this._ctx.getImageData(0,0,n,s);let O;if(S=I.data,i.renderOnCanvas){if(d)for(O=0;O{URL.revokeObjectURL(y),c("cannot load image")}})}static _getMask(e,i){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;p--)r[c++]=l[d]>>p&1}}catch{}return r}};var MKe,DKe,FKe,_ae={},RXt={get exports(){return _ae},set exports(t){_ae=t}};MKe=RXt,DKe=function(){var t=function(){function e(i){this.message="JPEG error: "+i}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]),i=4017,r=799,n=3406,s=2276,o=1567,a=3784,l=5793,c=2896;function d(){this.decodeTransform=null,this.colorTransform=-1}function p(L,N){for(var G,V,Y=0,X=[],te=16;te>0&&!L[te-1];)te--;X.push({children:[],index:0});var re,fe=X[0];for(G=0;G0;)fe=X.pop();for(fe.index++,X.push(fe);X.length<=G;)X.push(re={children:[],index:0}),fe.children[fe.index]=re.children,fe=re;Y++}G+10)return Ne--,ke>>Ne&1;if((ke=L[N++])===255){var Ce=L[N++];if(Ce)throw new t("unexpected marker "+(ke<<8|Ce).toString(16))}return Ne=7,ke>>>7}function he(Ce){for(var Ze=Ce;;){if(typeof(Ze=Ze[J()])=="number")return Ze;if(typeof Ze!="object")throw new t("invalid huffman sequence")}}function xe(Ce){for(var Ze=0;Ce>0;)Ze=Ze<<1|J(),Ce--;return Ze}function Pe(Ce){if(Ce===1)return J()===1?1:-1;var Ze=xe(Ce);return Ze>=1<>4;if(gt!==0){var ni=e[At+=Ue];Ce.blockData[Ze+ni]=Pe(gt),At++}else{if(Ue<15)break;At+=16}}}function Ae(Ce,Ze){var yt=he(Ce.huffmanTableDC),Ve=yt===0?0:Pe(yt)<0)Ge--;else for(var yt=X,Ve=te;yt<=Ve;){var At=he(Ce.huffmanTableAC),ii=15&At,gt=At>>4;if(ii!==0){var Ue=e[yt+=gt];Ce.blockData[Ze+Ue]=Pe(ii)*(1<>4,(yt=15&Ve)==0)gt<15?(Ge=xe(gt)+(1<=65488&&ce<=65495))break;N+=2}return(kt=O(L,N))&&kt.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+kt.invalid),N=kt.offset),N-Ie}function S(L,N,G){var V,Y,X,te,re,fe,ge,_e,Ie,ke,Ne,J,he,xe,Pe,Oe,Ae,ze=L.quantizationTable,Ge=L.blockData;if(!ze)throw new t("missing required Quantization Table.");for(var Je=0;Je<64;Je+=8)Ie=Ge[N+Je],ke=Ge[N+Je+1],Ne=Ge[N+Je+2],J=Ge[N+Je+3],he=Ge[N+Je+4],xe=Ge[N+Je+5],Pe=Ge[N+Je+6],Oe=Ge[N+Je+7],Ie*=ze[Je],ke|Ne|J|he|xe|Pe|Oe?(ke*=ze[Je+1],Ne*=ze[Je+2],J*=ze[Je+3],he*=ze[Je+4],xe*=ze[Je+5],Pe*=ze[Je+6],Oe*=ze[Je+7],Y=(V=(V=l*Ie+128>>8)+(Y=l*he+128>>8)+1>>1)-Y,Ae=(X=Ne)*a+(te=Pe)*o+128>>8,X=X*o-te*a+128>>8,ge=(re=(re=c*(ke-Oe)+128>>8)+(ge=xe<<4)+1>>1)-ge,fe=(_e=(_e=c*(ke+Oe)+128>>8)+(fe=J<<4)+1>>1)-fe,te=(V=V+(te=Ae)+1>>1)-te,X=(Y=Y+X+1>>1)-X,Ae=re*s+_e*n+2048>>12,re=re*n-_e*s+2048>>12,_e=Ae,Ae=fe*r+ge*i+2048>>12,fe=fe*i-ge*r+2048>>12,ge=Ae,G[Je]=V+_e,G[Je+7]=V-_e,G[Je+1]=Y+ge,G[Je+6]=Y-ge,G[Je+2]=X+fe,G[Je+5]=X-fe,G[Je+3]=te+re,G[Je+4]=te-re):(Ae=l*Ie+512>>10,G[Je]=Ae,G[Je+1]=Ae,G[Je+2]=Ae,G[Je+3]=Ae,G[Je+4]=Ae,G[Je+5]=Ae,G[Je+6]=Ae,G[Je+7]=Ae);for(var et=0;et<8;++et)Ie=G[et],(ke=G[et+8])|(Ne=G[et+16])|(J=G[et+24])|(he=G[et+32])|(xe=G[et+40])|(Pe=G[et+48])|(Oe=G[et+56])?(Y=(V=4112+((V=l*Ie+2048>>12)+(Y=l*he+2048>>12)+1>>1))-Y,Ae=(X=Ne)*a+(te=Pe)*o+2048>>12,X=X*o-te*a+2048>>12,te=Ae,ge=(re=(re=c*(ke-Oe)+2048>>12)+(ge=xe)+1>>1)-ge,fe=(_e=(_e=c*(ke+Oe)+2048>>12)+(fe=J)+1>>1)-fe,Ae=re*s+_e*n+2048>>12,re=re*n-_e*s+2048>>12,_e=Ae,Ae=fe*r+ge*i+2048>>12,fe=fe*i-ge*r+2048>>12,Ie=(Ie=(V=V+te+1>>1)+_e)<16?0:Ie>=4080?255:Ie>>4,ke=(ke=(Y=Y+X+1>>1)+(ge=Ae))<16?0:ke>=4080?255:ke>>4,Ne=(Ne=(X=Y-X)+fe)<16?0:Ne>=4080?255:Ne>>4,J=(J=(te=V-te)+re)<16?0:J>=4080?255:J>>4,he=(he=te-re)<16?0:he>=4080?255:he>>4,xe=(xe=X-fe)<16?0:xe>=4080?255:xe>>4,Pe=(Pe=Y-ge)<16?0:Pe>=4080?255:Pe>>4,Oe=(Oe=V-_e)<16?0:Oe>=4080?255:Oe>>4,Ge[N+et]=Ie,Ge[N+et+8]=ke,Ge[N+et+16]=Ne,Ge[N+et+24]=J,Ge[N+et+32]=he,Ge[N+et+40]=xe,Ge[N+et+48]=Pe,Ge[N+et+56]=Oe):(Ae=(Ae=l*Ie+8192>>14)<-2040?0:Ae>=2024?255:Ae+2056>>4,Ge[N+et]=Ae,Ge[N+et+8]=Ae,Ge[N+et+16]=Ae,Ge[N+et+24]=Ae,Ge[N+et+32]=Ae,Ge[N+et+40]=Ae,Ge[N+et+48]=Ae,Ge[N+et+56]=Ae)}function I(L,N){for(var G=N.blocksPerLine,V=N.blocksPerColumn,Y=new Int16Array(64),X=0;X=Y)return null;var te=V(N);if(te>=65472&&te<=65534)return{invalid:null,marker:te,offset:N};for(var re=V(X);!(re>=65472&&re<=65534);){if(++X>=Y)return null;re=V(X)}return{invalid:te.toString(16),marker:re,offset:X}}return d.prototype={parse:function(L){function N(){var Ce=L[te]<<8|L[te+1];return te+=2,Ce}function G(){var Ce=N(),Ze=te+Ce-2,yt=O(L,Ze,te);yt&&yt.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+yt.invalid),Ze=yt.offset);var Ve=L.subarray(te,Ze);return te+=Ve.length,Ve}function V(Ce){for(var Ze=Math.ceil(Ce.samplesPerLine/8/Ce.maxH),yt=Math.ceil(Ce.scanLines/8/Ce.maxV),Ve=0;Ve>4){if(Oe>>4!=1)throw new t("DQT - invalid table spec");for(J=0;J<64;J++)Ae[e[J]]=N()}else for(J=0;J<64;J++)Ae[e[J]]=L[te++];ge[15&Oe]=Ae}break;case 65472:case 65473:case 65474:if(Y)throw new t("Only single frame JPEGs supported");N(),(Y={}).extended=ke===65473,Y.progressive=ke===65474,Y.precision=L[te++],Y.scanLines=N(),Y.samplesPerLine=N(),Y.components=[],Y.componentIds={};var ze,Ge=L[te++],Je=0,et=0;for(Ne=0;Ne>4,ft=15&L[te+1];Je>4?_e:Ie)[15&St]=p(Tt,at)}break;case 65501:N(),X=N();break;case 65498:N();var Ee,Be=L[te++],mt=[];for(Ne=0;Ne>4],Ee.huffmanTableAC=_e[15&ct],mt.push(Ee)}var le=L[te++],it=L[te++],pt=L[te++],Le=v(L,te,Y,mt,X,le,it,pt>>4,15&pt);te+=Le;break;case 65535:L[te]!==255&&te--;break;default:if(L[te-3]===255&&L[te-2]>=192&&L[te-2]<=254){te-=3;break}throw new t("unknown marker "+ke.toString(16))}ke=N()}for(this.width=Y.samplesPerLine,this.height=Y.scanLines,this.jfif=re,this.eof=te,this.adobe=fe,this.components=[],Ne=0;Ne>8)+Ge[_e+1];return Oe},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this.colorTransform!==0:this.colorTransform===1},_convertYccToRgb:function(L){for(var N,G,V,Y=0,X=L.length;Y4)throw new t("Unsupported color mode");var V=this._getLinearizedBlockData(L,N);if(this.numComponents===1&&G){for(var Y=V.length,X=new Uint8ClampedArray(3*Y),te=0,re=0;re=0;I--)y[L++]=O[v]>>I&1}catch{}if(a===1&&c.length===s*o){const O=new Uint8Array(c.buffer);p=[O,O,O]}else{for(p=[],v=0;v<3;v++)p.push(new Uint8Array(d));for(I=0,S=0;S$Gi).then(t=>t.l).then(({default:t})=>t({locateFile:e=>zl(`esri/layers/support/rasterFormats/${e}`)})).then(t=>{FXt(t)}),GCe)}const bae={getBlobInfo:null,decode:null};function DXt(t){return 16+(t>>3<<3)}function nM(t,e,i){i.set(t.slice(e,e+i.length))}function FXt(t){const{_malloc:e,_free:i,_lerc_getBlobInfo:r,_lerc_getDataRanges:n,_lerc_decode_4D:s,asm:o}=t;let a;const l=Object.values(o).find(d=>d&&"buffer"in d&&d.buffer===t.HEAPU8.buffer),c=d=>{const p=d.map(I=>DXt(I)),y=p.reduce((I,O)=>I+O),v=e(y);a=new Uint8Array(l.buffer);let S=p[0];p[0]=v;for(let I=1;I{const v=new Uint8Array(48),S=new Uint8Array(8*3),[I,O,L]=c([d.length,v.length,S.length]);a.set(d,I),a.set(v,O),a.set(S,L);let N=r(I,d.length,O,L,12,3);if(N)throw i(I),new Error(`lerc-getBlobInfo: error code is ${N}`);a=new Uint8Array(l.buffer),nM(a,O,v),nM(a,L,S);const G=new Uint32Array(v.buffer),V=new Float64Array(S.buffer),[Y,X,,te,re,fe,ge,_e,Ie,ke,Ne]=G,J={version:Y,depthCount:ke,width:te,height:re,validPixelCount:ge,bandCount:fe,blobSize:_e,maskCount:Ie,dataType:X,minValue:V[0],maxValue:V[1],maxZerror:V[2],statistics:[],bandCountWithNoData:Ne};if(Ne)return J;if(ke===1&&fe===1)return i(I),J.statistics.push({minValue:V[0],maxValue:V[1]}),J;const he=ke*fe*8,xe=new Uint8Array(he),Pe=new Uint8Array(he);let Oe=I,Ae=0,ze=0,Ge=!1;if(a.byteLength1){const Pt=Je.slice(ft*ke,(ft+1)*ke),$t=et.slice(ft*ke,(ft+1)*ke),St=Math.min.apply(null,Pt),Tt=Math.max.apply(null,$t);tt.push({minValue:St,maxValue:Tt,depthStats:{minValues:Pt,maxValues:$t}})}else tt.push({minValue:Je[ft],maxValue:et[ft]});return i(Oe),Ge||i(Ae),J},bae.decode=(d,p)=>{const{maskCount:y,depthCount:v,bandCount:S,width:I,height:O,dataType:L,bandCountWithNoData:N}=p,G=LKe[L],V=I*O,Y=new Uint8Array(V*S),X=V*v*S*G.size,te=new Uint8Array(X),re=new Uint8Array(S),fe=new Uint8Array(8*S),[ge,_e,Ie,ke,Ne]=c([d.length,Y.length,te.length,re.length,fe.length]);a.set(d,ge),a.set(Y,_e),a.set(te,Ie),a.set(re,ke),a.set(fe,Ne);const J=s(ge,d.length,y,_e,v,I,O,S,L,Ie,ke,Ne);if(J)throw i(ge),new Error(`lerc-decode: error code is ${J}`);a=new Uint8Array(l.buffer),nM(a,Ie,te),nM(a,_e,Y);let he=null;if(N){nM(a,ke,re),nM(a,Ne,fe),he=[];const xe=new Float64Array(fe.buffer);for(let Pe=0;Pe1){Y.set(N[0]);for(let ge=1;ge=X;if(v>0&&te)for(let ge=0;ge1?N:null,{pixelType:fe}=I;return{width:l,height:c,bandCount:d,pixelType:fe,depthCount:p,statistics:S,pixels:L,mask:Y,bandMasks:re,noDataValues:a}}function kXt(t,e,i,r=!0){if(e%4!=0||i%4!=0){const n=new ArrayBuffer(4*Math.ceil(i/4)),s=new Uint8Array(n),o=new Uint8Array(t,e,i);if(r)for(let a=0;a=s)a-=s,y=p>>>32-s,p<<=s;else{y=p>>>32-a,p=n[d++];const L=s-a;a=32-L,y=(y<>>a),p<<=L}if(y===257)break;if(y===256){s=9,o=$Ke(),l=o.length,c=[];continue}const O=o[y];if(O==null){if(y>o.length)throw new Error("data integrity issue: code does not exist on code page");c.push(c[0]),o[l++]=c.slice(),BKe(I,c)}else BKe(I,O),c.push(O[0]),c.length>1&&(o[l++]=c.slice()),c=O.slice();if(wB.has(l)&&s++,a===0&&(p=n[d++],a=32),d>v||d===v&&a<=S)break}return new Uint8Array(I)}wB.add(511),wB.add(1023),wB.add(2047),wB.add(4095),wB.add(8191);const GKe=(t,e)=>{const i=e.width*e.height,r=e.pixelType;return Math.floor(t.byteLength/(i*VKe(r)))},VKe=t=>{let e=1;switch(t){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},NXt=(t,e)=>{if(8*t.byteLength=0;a--)r[n++]=s>>a&1;for(a=7;n>a&1,a--;return r};let $Xt=class{static decode(e,i){const r=i.pixelType,n=[],s=i.width*i.height,o=GKe(e,i),{bandIds:a,format:l}=i,c=a&&a.length||GKe(e,i),d=e.byteLength-e.byteLength%(s*VKe(r)),p=new r(e,0,s*o);let y,v,S,I,O=null;if(l==="bip")for(y=0;y>4,n<8?n=1:n===15?(n=4,s=(7&s)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++]):n===14?(n=3,s=(15&s)<<12|(63&t[i++])<<6|63&t[i++]):(n=2,s=(31&s)<<6|63&t[i++]),(s!==0||e)&&(r+=String.fromCharCode(s));return r}const jCe=(()=>{const t=[];return t[254]="NEWSUBFILETYPE",t[255]="SUBFILETYPE",t[256]="IMAGEWIDTH",t[257]="IMAGELENGTH",t[258]="BITSPERSAMPLE",t[259]="COMPRESSION",t[262]="PHOTOMETRICINTERPRETATION",t[263]="THRESHHOLDING",t[264]="CELLWIDTH",t[265]="CELLLENGTH",t[266]="FILLORDER",t[269]="DOCUMENTNAME",t[270]="IMAGEDESCRIPTION",t[271]="MAKE",t[272]="MODEL",t[273]="STRIPOFFSETS",t[274]="ORIENTATION",t[277]="SAMPLESPERPIXEL",t[278]="ROWSPERSTRIP",t[279]="STRIPBYTECOUNTS",t[280]="MINSAMPLEVALUE",t[281]="MAXSAMPLEVALUE",t[282]="XRESOLUTION",t[283]="YRESOLUTION",t[284]="PLANARCONFIGURATION",t[285]="PAGENAME",t[286]="XPOSITION",t[287]="YPOSITION",t[288]="FREEOFFSETS",t[289]="FREEBYTECOUNTS",t[290]="GRAYRESPONSEUNIT",t[291]="GRAYRESPONSECURVE",t[292]="T4OPTIONS",t[293]="T6OPTIONS",t[296]="RESOLUTIONUNIT",t[297]="PAGENUMBER",t[300]="COLORRESPONSEUNIT",t[301]="TRANSFERFUNCTION",t[305]="SOFTWARE",t[306]="DATETIME",t[315]="ARTIST",t[316]="HOSTCOMPUTER",t[317]="PREDICTOR",t[318]="WHITEPOINT",t[319]="PRIMARYCHROMATICITIES",t[320]="COLORMAP",t[321]="HALFTONEHINTS",t[322]="TILEWIDTH",t[323]="TILELENGTH",t[324]="TILEOFFSETS",t[325]="TILEBYTECOUNTS",t[326]="BADFAXLINES",t[327]="CLEANFAXDATA",t[328]="CONSECUTIVEBADFAXLINES",t[330]="SUBIFD",t[332]="INKSET",t[333]="INKNAMES",t[334]="NUMBEROFINKS",t[336]="DOTRANGE",t[337]="TARGETPRINTER",t[338]="EXTRASAMPLES",t[339]="SAMPLEFORMAT",t[340]="SMINSAMPLEVALUE",t[341]="SMAXSAMPLEVALUE",t[342]="TRANSFERRANGE",t[347]="JPEGTABLES",t[512]="JPEGPROC",t[513]="JPEGIFOFFSET",t[514]="JPEGIFBYTECOUNT",t[515]="JPEGRESTARTINTERVAL",t[517]="JPEGLOSSLESSPREDICTORS",t[518]="JPEGPOINTTRANSFORM",t[519]="JPEGQTABLES",t[520]="JPEGDCTABLES",t[521]="JPEGACTABLES",t[529]="YCBCRCOEFFICIENTS",t[530]="YCBCRSUBSAMPLING",t[531]="YCBCRPOSITIONING",t[532]="REFERENCEBLACKWHITE",t[700]="XMP",t[33550]="GEOPIXELSCALE",t[33922]="GEOTIEPOINTS",t[33432]="COPYRIGHT",t[42112]="GDAL_METADATA",t[42113]="GDAL_NODATA",t[50844]="RPCCOEFFICIENT",t[34264]="GEOTRANSMATRIX",t[34735]="GEOKEYDIRECTORY",t[34736]="GEODOUBLEPARAMS",t[34737]="GEOASCIIPARAMS",t[34665]="EXIFIFD",t[34853]="GPSIFD",t[40965]="INTEROPERABILITYIFD",t})(),BXt=(()=>{const t=jCe.slice();return t[36864]="ExifVersion",t[40960]="FlashpixVersion",t[40961]="ColorSpace",t[42240]="Gamma",t[37121]="ComponentsConfiguration",t[37122]="CompressedBitsPerPixel",t[40962]="PixelXDimension",t[40963]="PixelYDimension",t[37500]="MakerNote",t[37510]="UserComment",t[40964]="RelatedSoundFile",t[36867]="DateTimeOriginal",t[36868]="DateTimeDigitized",t[36880]="OffsetTime",t[36881]="OffsetTimeOriginal",t[36882]="OffsetTimeDigitized",t[37520]="SubSecTime",t[37521]="SubSecTimeOriginal",t[37522]="SubSecTimeDigitized",t[37888]="Temperature",t[37889]="Humidity",t[37890]="Pressure",t[37891]="WaterDepth",t[37892]="Acceleration",t[37893]="CameraElevationAngle",t[42016]="ImageUniqueID",t[42032]="CameraOwnerName",t[42033]="BodySerialNumber",t[42034]="LensSpecification",t[42035]="LensMake",t[42036]="LensModel",t[42037]="LensSerialNumber",t[33434]="ExposureTime",t[33437]="FNumber",t[34850]="ExposureProgram",t[34852]="SpectralSensitivity",t[34855]="PhotographicSensitivity",t[34856]="OECF",t[34864]="SensitivityType",t[34865]="StandardOutputSensitivity",t[34866]="RecommendedExposureIndex",t[34867]="ISOSpeed",t[34868]="ISOSpeedLatitudeyyy",t[34869]="ISOSpeedLatitudezzz",t[37377]="ShutterSpeedValue",t[37378]="ApertureValue",t[37379]="BrightnessValue",t[37380]="ExposureBiasValue",t[37381]="MaxApertureValue",t[37382]="SubjectDistance",t[37383]="MeteringMode",t[37384]="LightSource",t[37385]="Flash",t[37386]="FocalLength",t[37396]="SubjectArea",t[41483]="FlashEnergy",t[41484]="SpatialFrequencyResponse",t[41486]="FocalPlaneXResolution",t[41487]="FocalPlaneYResolution",t[41488]="FocalPlaneResolutionUnit",t[41492]="SubjectLocation",t[41493]="ExposureIndex",t[41495]="SensingMethod",t[41728]="FileSource",t[41729]="SceneType",t[41730]="CFAPattern",t[41985]="CustomRendered",t[41986]="ExposureMode",t[41987]="WhiteBalance",t[41988]="DigitalZoomRatio",t[41989]="FocalLengthIn35mmFilm",t[41990]="SceneCaptureType",t[41991]="GainControl",t[41992]="Contrast",t[41993]="Saturation",t[41994]="Sharpness",t[41995]="DeviceSettingDescription",t[41996]="SubjectDistanceRange",t})(),GXt=["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"],VXt=(()=>{const t=[];return t[1024]="GTModelTypeGeoKey",t[1025]="GTRasterTypeGeoKey",t[1026]="GTCitationGeoKey",t[2048]="GeographicTypeGeoKey",t[2049]="GeogCitationGeoKey",t[2050]="GeogGeodeticDatumGeoKey",t[2051]="GeogPrimeMeridianGeoKey",t[2052]="GeogLinearUnitsGeoKey",t[2053]="GeogLinearUnitSizeGeoKey",t[2054]="GeogAngularUnitsGeoKey",t[2055]="GeogAngularUnitSizeGeoKey",t[2056]="GeogEllipsoidGeoKey",t[2057]="GeogSemiMajorAxisGeoKey",t[2058]="GeogSemiMinorAxisGeoKey",t[2059]="GeogInvFlatteningGeoKey",t[2061]="GeogPrimeMeridianLongGeoKey",t[2060]="GeogAzimuthUnitsGeoKey",t[3072]="ProjectedCSTypeGeoKey",t[3073]="PCSCitationGeoKey",t[3074]="ProjectionGeoKey",t[3075]="ProjCoordTransGeoKey",t[3076]="ProjLinearUnitsGeoKey",t[3077]="ProjLinearUnitSizeGeoKey",t[3078]="ProjStdParallel1GeoKey",t[3079]="ProjStdParallel2GeoKey",t[3080]="ProjNatOriginLongGeoKey",t[3081]="ProjNatOriginLatGeoKey",t[3082]="ProjFalseEastingGeoKey",t[3083]="ProjFalseNorthingGeoKey",t[3084]="ProjFalseOriginLongGeoKey",t[3085]="ProjFalseOriginLatGeoKey",t[3086]="ProjFalseOriginEastingGeoKey",t[3087]="ProjFalseOriginNorthingGeoKey",t[3088]="ProjCenterLongGeoKey",t[3090]="ProjCenterEastingGeoKey",t[3091]="ProjCenterNorthingGeoKey",t[3092]="ProjScaleAtNatOriginGeoKey",t[3093]="ProjScaleAtCenterGeoKey",t[3094]="ProjAzimuthAngleGeoKey",t[3095]="ProjStraightVertPoleLongGeoKey",t[4096]="VerticalCSTypeGeoKey",t[4097]="VerticalCitationGeoKey",t[4098]="VerticalDatumGeoKey",t[4099]="VerticalUnitsGeoKey",t})(),UXt=(t,e)=>{let i=(e||jCe)[t];return i===void 0&&(i="unknown"+String(t)),i},zCe=new Map;zCe.set("EXIFIFD",BXt),zCe.set("GPSIFD",GXt);const aT={TIFF_TAGS:jCe,ifdTags:zCe,GEO_KEYS:VXt,getTagName:UXt},wae=(()=>{const t=new ArrayBuffer(4),e=new Uint8Array(t);return new Uint32Array(t)[0]=1,e[0]===1})(),UKe=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],xB=4294967296,jXt=new Set([1,5,6,7,8,34712,34887]);function HCe(t,e){let i="unknown";return t===3?i=e===64?"f64":"f32":t===1?e===1?i="u1":e===2?i="u2":e===4?i="u4":e<=8?i="u8":e<=16?i="u16":e<=32&&(i="u32"):t===2&&(e<=8?i="s8":e<=16?i="s16":e<=32&&(i="s32")),i}function xae(t){let e=null;switch(t?t.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 zXt(t,e){return{x:e[0]*t.x+e[1]*t.y+e[2],y:e[3]*t.x+e[4]*t.y+e[5]}}function jKe(t,e){return t.get(e)?.values}function U5(t,e){return t.get(e)?.values}function zKe(t,e){return t.get(e)?.values?.[0]}function Ya(t,e){return t.get(e)?.values?.[0]}function WCe(t,e,i,r=0,n=aT.TIFF_TAGS,s=4){const o=s===8,a=o?QCe(new DataView(t,i,8),0,e):new DataView(t,i,2).getUint16(0,e),l=4+2*s,c=o?8:2,d=c+a*l;if(i+d>t.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:d};const p=i+d+4<=t.byteLength?Tae(new DataView(t,i+d,s===8?8:4),0,e,s===8):null,y=i+c,v=new Map;let S,I,O,L,N,G=0,V=0;for(let Y=0;YNKe(t,{inputOffset:e}).pixels[0];function qCe(t,e){if(e!==1&&e!==2&&e!==4)return t;const i=new Uint8Array(t),r=8/e,n=new Uint8Array(t.byteLength*r);let s=0;const o=2**e-1;for(let a=0;a>>8-e&o}return n.buffer}function YCe(t,e,i){const r=new _ae;r.parse(t),r.colorTransform=i===6?-1:0;const n=r.getData(r.width,r.height,e!==1);return new Uint8Array(n.buffer)}function XCe(t){const e=new V5(t).getBytes(),i=new ArrayBuffer(e.length),r=new Uint8Array(i);return r.set(e),r}async function KCe(t,e,i,r,n){const s=wae===e,o=Ya(i,"BITSPERSAMPLE"),a=Ya(i,"SAMPLESPERPIXEL"),l=Ya(i,"PHOTOMETRICINTERPRETATION"),c=HCe(Ya(i,"SAMPLEFORMAT")??1,o),d=Ya(i,"COMPRESSION")??1,p=xae(c);let y,v,S;if(d===34887)return await kKe(),HXt(t,r);if(d===1)y=t.slice(r,r+n),v=new Uint8Array(y);else if(d===8||d===32946)v=new Uint8Array(t,r,n),v=XCe(v),y=v.buffer;else if(d===6)v=new Uint8Array(t,r,n),v=YCe(v,a,l),y=v.buffer;else if(d===7){const I=i.get("JPEGTABLES").values,O=I.length-2;v=new Uint8Array(O+n-2);for(let N=0;N1){const J=Math.round(r.length/p);for(L=0;L{const r=wae===e.littleEndian,n=U5(i,"STRIPOFFSETS");if(n===void 0)return null;const{width:s,height:o,pixelType:a}=Sae([i]),l=Ya(i,"SAMPLESPERPIXEL")||e.planes,c=Ya(i,"PHOTOMETRICINTERPRETATION"),d=s*o,p=Ya(i,"BITSPERSAMPLE"),y=xae(a),v=new y(d*l),S=U5(i,"STRIPBYTECOUNTS"),I=Ya(i,"ROWSPERSTRIP"),O=Ya(i,"COMPRESSION")??1;let L,N,G,V,Y,X,te,re,fe,ge=I;if(p%8==0)for(L=0;Lo?o-L*I:I,a==="u8"||a==="s8"||r)O===8||O===32946?(te=new Uint8Array(t,n[L],S[L]),te=XCe(te),X=te.buffer):O===6?(te=new Uint8Array(t,n[L],S[L]),te=YCe(te,l,c),X=te.buffer):O===5?(te=VCe(t,n[L],S[L],e.littleEndian),X=te.buffer):(S[L]!==ge*s*l*p/8&&console.log("strip byte counts is different than expected"),X=t.slice(n[L],n[L]+S[L])),X=qCe(X,p),V=new y(X);else{switch(O===6||O===8||O===32946?(te=new Uint8Array(t,n[L],S[L]),re=XCe(te),X=re.buffer):(S[L]!==ge*s*l*p/8&&console.log("strip byte counts is different than expected"),X=new ArrayBuffer(S[L]),te=new Uint8Array(t,n[L],S[L]),re=new Uint8Array(X)),a){case"u16":case"s16":for(G=0;G{if(!(t&&t.length>0&&e&&i))return null;let r,n,s;const o=t[0].length,a=t.length,l=new Uint8Array(o);for(let c=0;cs?0:1;else for(let d=0;ds?0:1);return l},XXt=t=>{if(!t)return null;const e=t.match(//gi);if(!e||e.length===0)return null;const i=new Map;let r,n,s,o,a;for(let L=0;L")),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?i.has(n)?i.get(n)[a]=s:i.set(n,[s]):i.set(n,s)),a=null;const l=i.get("STATISTICS_MINIMUM"),c=i.get("STATISTICS_MAXIMUM"),d=i.get("STATISTICS_MEAN"),p=i.get("STATISTICS_STDDEV");let y=null;if(l&&c){y=[];for(let L=0;LO&&y>(n?t.byteLength:t?t.byteLength-l+r:0))return i.offlineOffsetSize=[l,y],i.values=null,!1;if(v<=O){if(!e)if(O<=32)l>>>=32-v;else{const N=L?.length?L[0]:l>>>0,G=L?.length?L[1]:Math.round((l-N)/xB);v<=32?(l=N>>>32-v,L[0]=l):(l=N*2**(32-v)+(G>>>32-v),L[0]=N,L[1]=G>>>32-v)}if(a===1&&p===O)c=[l];else if(O===64){const N=L?.length?L[0]:l>>>0,G=L?.length?L[1]:Math.round((l-N)/xB);let V=N,Y=32;for(I=1;I<=a;I++){const X=32-p*I%32;if(Y>>32-Y,re=G<<32-Y>>>32-Y;V=G,c.push(te+re*2**(p-Y)),Y-=32-(p-Y)}else c.push(V<>>32-p),Y-=p;Y===0&&(Y=32,V=G)}}else for(I=1;I<=a;I++){const N=32-p*I;c.push(l<>>32-p)}}else{l-=r,n&&(l=0);for(let N=l;NparseFloat(Oe)),y.some(Oe=>isNaN(Oe))&&(y=null));const v=Ya(e,"COMPRESSION")??1;let S;switch(v){case 1:S="NONE";break;case 2:case 3:case 4:case 32771:S="CCITT";break;case 5:S="LZW";break;case 6:case 7:S="JPEG";break;case 32773:S="PACKBITS";break;case 8:case 32946:S="DEFLATE";break;case 34712:S="JPEG2000";break;case 34887:S="LERC";break;default:S=String(v)}let I=!0,O="";jXt.has(v)||(I=!1,O+="unsupported tag compression "+v),l>3&&(I=!1,O+="unsupported tag sampleFormat "+l),o!==1&&o!==2&&o!==4&&o%8!=0&&(I=!1,O+="unsupported tag bitsPerSample "+o);const L=zKe(e,"GEOASCIIPARAMS");let N;if(L){const Oe=L.split("|").find(ze=>ze.includes("ESRI PE String = ")),Ae=Oe?Oe.replace("ESRI PE String = ",""):"";N=Ae.startsWith("COMPD_CS")||Ae.startsWith("PROJCS")||Ae.startsWith("GEOGCS")?{wkid:null,wkt:Ae}:null}const G=U5(e,"GEOTIEPOINTS"),V=U5(e,"GEOPIXELSCALE"),Y=U5(e,"GEOTRANSMATRIX"),X=e.has("GEOKEYDIRECTORY")?e.get("GEOKEYDIRECTORY").data:null;let te,re,fe=!1,ge=!1;if(X){fe=Ya(X,"GTRasterTypeGeoKey")===2;const Oe=Ya(X,"GTModelTypeGeoKey");if(Oe===2){const Ae=Ya(X,"GeographicTypeGeoKey");Ae>=1024&&Ae<=32766&&(N={wkid:Ae}),N||Ae!==32767||(ge=!0,N={wkid:4326})}else if(Oe===1){const Ae=Ya(X,"ProjectedCSTypeGeoKey");Ae>=1024&&Ae<=32766&&(N={wkid:Ae})}}if(V&&G&&G.length>=6?(te=[V[0],0,G[3]-G[0]*V[0],0,-Math.abs(V[1]),G[4]-G[1]*V[1]],fe&&(te[2]-=.5*te[0]+.5*te[1],te[5]-=.5*te[3]+.5*te[4])):Y&&Y.length===16&&(te=fe?[Y[0],Y[1],Y[3]-.5*Y[0],Y[4],Y[5],Y[7]-.5*Y[5]]:[Y[0],Y[1],Y[3],Y[4],Y[5],Y[7]]),te){const Oe=[{x:0,y:s},{x:0,y:0},{x:n,y:s},{x:n,y:0}];let Ae,ze=Number.POSITIVE_INFINITY,Ge=Number.POSITIVE_INFINITY,Je=Number.NEGATIVE_INFINITY,et=Number.NEGATIVE_INFINITY;for(let tt=0;ttze?ze:Ae.x,Je=Ae.xGe?Ge:Ae.y,et=Ae.y400||Math.max(Math.abs(re.xmin),Math.abs(re.xmax))>361)&&(N=null,re.spatialReference=null);const _e=JCe(t);let Ie,ke,Ne,J,he;if(_e.length>0){Ne=Math.round(Math.log(n/Ya(_e[0],"IMAGEWIDTH"))/Math.LN2);const Oe=_e[_e.length-1];J=Math.round(Math.log(n/Ya(Oe,"IMAGEWIDTH"))/Math.LN2),Ie=Ya(Oe,"TILEWIDTH"),ke=Ya(Oe,"TILELENGTH")}Ie=J!=null&&J>0?Ie||i:null,ke=J!=null&&J>0?ke||r:null,i&&(he=[{maxCol:Math.ceil(n/i)-1,maxRow:Math.ceil(s/r)-1,minRow:0,minCol:0}],_e.forEach(Oe=>{he.push({maxCol:Math.ceil(Ya(Oe,"IMAGEWIDTH")/Ya(Oe,"TILEWIDTH"))-1,maxRow:Math.ceil(Ya(Oe,"IMAGELENGTH")/Ya(Oe,"TILELENGTH"))-1,minRow:0,minCol:0})}));const xe=zKe(t[0],"GDAL_METADATA"),Pe=XXt(xe);return O+=" "+YKe({width:n,height:s,tileWidth:i,tileHeight:r,planes:a,ifds:t}),{width:n,height:s,tileWidth:i,tileHeight:r,planes:a,isBSQ:d,pixelType:c,compression:S,noData:y,hasMaskBand:ZCe(t).length===_e.length+1,isSupported:I,message:O,extent:re,isPseudoGeographic:ge,affine:V?null:te,firstPyramidLevel:Ne,maximumPyramidLevel:J,pyramidBlockWidth:Ie,pyramidBlockHeight:ke,tileBoundary:he,metadata:Pe}}function Cae(t,e){const i=jKe(t,"PLANARCONFIGURATION");return i?i[0]===2:!!e&&e.isBSQ}function JCe(t){return t.filter(e=>Ya(e,"NEWSUBFILETYPE")===1)}function ZCe(t){return t.filter(e=>{const i=(4&(Ya(e,"NEWSUBFILETYPE")??0))==4,r=Ya(e,"PHOTOMETRICINTERPRETATION")===4;return i&&r})}function KXt(t){const{littleEndian:e,isBigTiff:i,firstIFDPos:r}=WKe(t);let n=r;const s=[];do{const o=qKe(t,e,n,0,aT.TIFF_TAGS,i?8:4);if(!o.success)break;s.push(o.ifd),n=o.nextIFD}while(n>0);return{...Sae(s),littleEndian:e,isBigTiff:i,ifds:s,pyramidIFDs:JCe(s),maskIFDs:ZCe(s)}}function QCe(t,e,i){const r=t.getUint32(e,i),n=t.getUint32(e+4,i);return i?n*xB+r:r*xB+n}function JXt(t,e,i){let r=i?t.getInt32(e,i):t.getUint32(e,i),n=i?t.getUint32(e+4,i):t.getInt32(e+4,i);const s=(i?r:n)>=0?1:-1;return i?r*=s:n*=s,s*(i?n*xB+r:r*xB+n)}function Tae(t,e,i,r){return r?QCe(t,e,i):t.getUint32(e,i)}function WKe(t){const e=new DataView(t,0,16),i=e.getUint16(0,!1);let r=null;if(i===18761)r=!0;else{if(i!==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:Tae(e,s,r,o)}}function qKe(t,e,i,r=0,n=aT.TIFF_TAGS,s=4){const o=WCe(t,e,i,r,n,s);let a;const l=o.ifd;if(l){if(aT.ifdTags.forEach((c,d)=>{l.has(d)&&(a=l.get(d),a.data=WCe(t,e,a.valueOffset-r,r,c).ifd)}),l.has("GEOKEYDIRECTORY")){a=l.get("GEOKEYDIRECTORY");const c=a.values;if(c&&c.length>4){const d=c[0]+"."+c[1]+"."+c[2];a.data=WCe(t,e,a.valueOffset+6-r,r,aT.GEO_KEYS,2).ifd,a.data&&a.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[d]})}}if(l.has("XMP")){a=l.get("XMP");const c=a.values;typeof c[0]=="number"&&a.type===7&&(a.values=[UCe(new Uint8Array(c))])}}return o}function YKe(t){const{width:e,height:i,tileHeight:r,tileWidth:n}=t,s=t.planes,o=n?n*r:e*i,a=Ya(t.ifds[0],"BITSPERSAMPLE");let l="";return o*s>1073741824/(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}async function ZXt(t,e){const{headerInfo:i,ifd:r,offsets:n,sizes:s}=e,o=[];for(let fe=0;fefe.min):null,te=Y?Y.map(fe=>fe.max):null,re={pixelType:c,width:y,height:v,pixels:L,noDataValue:V};return V!=null?iae(re,V):X&&te&&e.applyMinMaxConstraint&&(re.mask=YXt(L,X,te)),re}async function QXt(t,e={}){const i=e.pyramidLevel||0,r=e.headerInfo||KXt(t),{ifds:n,noData:s}=r;if(n.length===0)throw new Error("no valid image file directory");const o=YKe(r);if(o)throw o;let a=null;const l=i===-1?n[n.length-1]:n[i],c=s??e.noDataValue;return a=r.tileWidth?await WXt(t,r,l):await qXt(t,r,l),a&&(c!=null&&iae(a,c),a)}var eKt=function(t){var e,i,r,n,s,o;function a(l){var c,d,p,y,v,S,I,O,L,N,G,V,Y;for(this.data=l,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},v=null;;){switch(c=this.readUInt32(),O=function(){var X,te;for(te=[],X=0;X<4;++X)te.push(String.fromCharCode(this.data[this.pos++]));return te}.call(this).join(""),O){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(c);break;case"fcTL":v&&this.animation.frames.push(v),this.pos+=4,v={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},y=this.readUInt16(),p=this.readUInt16()||100,v.delay=1e3*y/p,v.disposeOp=this.data[this.pos++],v.blendOp=this.data[this.pos++],v.data=[];break;case"IDAT":case"fdAT":for(O==="fdAT"&&(this.pos+=4,c-=4),l=v?.data||this.imgData,G=0;0<=c?Gc;0<=c?++G:--G)l.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(c),(L=255-this.transparency.indexed.length)>0)for(V=0;0<=L?VL;0<=L?++V:--V)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(c)[0];break;case 2:this.transparency.rgb=this.read(c)}break;case"tEXt":S=(N=this.read(c)).indexOf(0),I=String.fromCharCode.apply(String,N.slice(0,S)),this.text[I]=String.fromCharCode.apply(String,N.slice(S+1));break;case"IEND":return v&&this.animation.frames.push(v),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=(Y=this.colorType)===4||Y===6,d=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*d,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+=c}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return a.load=function(l,c,d){var p;return typeof c=="function"&&(d=c),(p=new XMLHttpRequest).open("GET",l,!0),p.responseType="arraybuffer",p.onload=function(){var y;return y=new a(new Uint8Array(p.response||p.mozResponseArrayBuffer)),typeof c?.getContext=="function"&&y.render(c),typeof d=="function"?d(y):void 0},p.send(null)},i=1,r=2,e=0,a.prototype.read=function(l){var c,d;for(d=[],c=0;0<=l?cl;0<=l?++c:--c)d.push(this.data[this.pos++]);return d},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 c,d,p,y,v,S,I,O,L,N,G,V,Y,X,te,re,fe,ge,_e,Ie,ke,Ne,J;if(l==null&&(l=this.imgData),l.length===0)return new Uint8Array(0);for(l=(l=new V5(l)).getBytes(),re=(V=this.pixelBitlength/8)*this.width,Y=new Uint8Array(re*this.height),S=l.length,te=0,X=0,d=0;X1&&d/yaKt(i,r,t);break;case"tiff":e=rKt;break;case"deflate":e=sKt;break;case"lzw":e=oKt;break;case"error":e=()=>{throw new st("rasterCodec:decode","input data contains error")};break;default:e=()=>{throw new st("rasterCodec:decode","unsupported raster format")}}return e}function dKt(t){let e=null,i=null;switch(t?t.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":i=255,e=Uint8Array;break;case"u16":i=i||65535,e=Uint16Array;break;case"u32":i=i||4294967295,e=Uint32Array;break;case"s8":i=i||-128,e=Int8Array;break;case"s16":i=i||-32768,e=Int16Array;break;case"s32":i=i||-2147483648,e=Int32Array;break;default:e=Float32Array}return{pixelTypeCtor:e,noDataValue:i}}function pKt(t,e=1){if(!t)return;const{pixels:i,width:r,height:n,mask:s}=t;if(!i||i.length===0)return;const o=i.length,a=r-1,l=n-1,c=[];let d,p,y,v,S,I,O=null;const L=en.getPixelArrayConstructor(t.pixelType);if(e===0){for(d=0;dd-p);const l=a[0],c=a[a.length-1];if(i==="equal-interval")if(a.length>=s){const d=(c-l)/s;let p=l;for(let y=1;y{o.push({minValue:d,maxValue:d,label:s_(d,d,r)})});else if(i==="natural-breaks"){const d=vKt(a),p=t.valueFrequency||d.valueFrequency,y=_Kt(d.uniqueValues,p,s);let v=l;for(let S=1;SS){const I=SB(d.uniqueValues[y[S]],6);o.push({minValue:v,maxValue:I,label:s_(v,I,r)}),v=I}o.push({minValue:v,maxValue:c,label:s_(v,c,r)})}else if(i==="quantile")if(a.length>=s&&l!==c){let d=l,p=Math.ceil(a.length/s),y=0;for(let v=1;va.length&&(S=a.length-1),S<0&&(S=0),o.push({minValue:d,maxValue:a[S],label:s_(d,a[S],r)}),d=a[S],y+=p,p=Math.ceil((a.length-y)/(s-v))}o.push({minValue:d,maxValue:c,label:s_(d,c,r)})}else{let d=-1;for(let p=0;p=1;O--){const L=SB(d-(O-.5)*y,6);o.push({minValue:S,maxValue:L,label:s_(S,L,r)}),S=L,v++}let I=SB(d+.5*y,6);o.push({minValue:S,maxValue:I,label:s_(S,I,r)}),S=I,v++;for(let O=1;O<=s;O++)I=v===2*s?c:SB(d+(O+.5)*y,6),o.push({minValue:S,maxValue:I,label:s_(S,I,r)}),S=I,v++}}else if(i==="defined-interval"){if(!n)return o;const d=a[0],p=a[a.length-1],y=Math.ceil((p-d)/n);let v=d;for(let S=1;Sr&&(i=r);for(let o=0;o0&&S!==t[v+1]&&Math.abs(d-l[v])>Math.abs(d-l[v-1]))t[v]=S;else if(vMath.abs(d-l[v+1])){t[v+1]=S-1;break}p=a,a=0,s=[],o=[];for(let v=0;vp){for(let v=0;v0;y--)for(;i[y]!==i[y-1]+1;){i[y]=i[y]-1;const v=CB(y-1,i,r,n);l=v.sbMean,o=v.sbSdcm;const S=CB(y,i,r,n);if(c=S.sbMean,a=S.sbSdcm,!(o+a=1?1:s>=.5?.5:.25,s}function xKt(t){let e=0;for(let i=0;in===i?.toLowerCase());return e==="Map"?r??"bilinear":t.dataType==="standard-time"?r??"nearest":t.dataType==="thematic"||t.attributeTable||t.colormap?r==="nearest"||r==="majority"?r:"nearest":r??"bilinear"}function AKt(t,e){t=tTe(t,e?.variableName);const{bandCount:i}=t;let{bandIds:r,stretchType:n}=e||{};r?.some(p=>p>=i)&&(r=null);let s=t.statistics,o=t.histograms;i>1?(r=r?.length?r:iTe(t),s=s==null?null:r?.map(p=>s[p]),o=o==null?null:r?.map(p=>o[p])):r=[0],n==null&&(n=OKt(t));let a=!1;switch(n){case"none":a=!1;break;case"percent-clip":a=!o?.length;break;default:a=!s?.length}const{dataType:l}=t,c=r?.length===1&&iJe.has(l)?TKt:null,d=new pCe({stretchType:n,dynamicRangeAdjustment:a,colorRamp:c,outputMin:0,outputMax:255,gamma:r?.length===1?[1]:[1,1,1],useGamma:!1});return n==="percent-clip"?d.maxPercent=d.minPercent=CKt:n==="standard-deviation"&&(d.numberOfStandardDeviations=2),a||!ye(t.multidimensionalInfo)&&!e?.includeStatisticsInStretch||(n==="percent-clip"?d.histograms=o:n!=="min-max"&&n!=="standard-deviation"||(d.statistics=s)),d}function tTe(t,e){if(!e)return t;let i=t.statistics,r=t.histograms;const{multidimensionalInfo:n}=t;if(e&&ye(n)){const s=n.variables.find(o=>o.name===e);if(s){const{statistics:o,histograms:a}=s;o?.length&&(i=o),a?.length&&(r=a)}}return R2.fromJSON({...t.toJSON(),statistics:i,histograms:r})}function iTe(t){const e=t.bandCount;if(e===1)return null;if(e===2)return[0];const i=t.keyProperties&&t.keyProperties.BandProperties;let r;if(i&&i.length===e){const{red:n,green:s,blue:o,nir:a}=PKt(i);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 PKt(t){const e={};for(let i=0;i=410&&s<=480&&o>=480&&o<=540?e.blue=i:e.green==null&&s>=490&&s<=560&&o>=560&&o<=610?e.green=i:e.red==null&&s>=595&&s<=670&&o>=660&&o<=730?e.red=i:e.nir==null&&s>=700&&s<=860&&o>=800&&o<=950&&(e.nir=i)}}return e}function OKt(t){let e="percent-clip";const{pixelType:i,dataType:r,histograms:n,statistics:s,multidimensionalInfo:o}=t,a=iJe.has(r)||r==="generic"&&ye(o);return i!=="u8"||r!=="processed"&&ye(n)&&ye(s)?i==="u8"||r==="elevation"||a?e="min-max":ye(n)?e="percent-clip":ye(s)&&(e="min-max"):e="none",e}function RKt(t,e,i,r){if(!nJe(t,e))return null;const{attributeTable:n,statistics:s}=t,o=rJe(n,e),a=pY(n,"red"),l=pY(n,"green"),c=pY(n,"blue"),d=new HW,p=[],y=new Set,v=!!(a&&l&&c);if(ye(n))n.features.forEach(S=>{const I=S.attributes[o.name];if(!y.has(S.attributes[o.name])&&I!=null){y.add(I);const O=v&&(a.type==="single"||a.type==="double")&&(l.type==="single"||l.type==="double")&&(c.type==="single"||c.type==="double")&&!n.features.some(N=>N.attributes[a.name]>1||N.attributes[l.name]>1||N.attributes[c.name]>1),L=O?255:1;p.push(new a5({value:S.attributes[o.name],label:S.attributes[o.name]+"",symbol:{type:"simple-fill",style:"solid",outline:null,color:new $r(v?[S.attributes[a.name]*L,S.attributes[l.name]*L,S.attributes[c.name]*L,1]:[0,0,0,0])}}))}});else if(s?.[0])for(let S=s[0].min;S<=s[0].max;S++)p.push(new a5({value:S,label:S.toString(),symbol:{type:"simple-fill",style:"solid",outline:null,color:new $r([0,0,0,0])}}));if(p.sort((S,I)=>S.value&&typeof S.value.valueOf()=="string"?0:S.value>I.value?1:-1),!v){const S=BA(tJe,{numColors:p.length});p.forEach((I,O)=>I.symbol.color=new $r(S[O].slice(1,4))),d.colorRamp=tJe}if(i||r){const S=i||BA(r,{numColors:p.length}).map(I=>I.slice(1));p.forEach((I,O)=>I.symbol.color=new $r(S[O])),d.colorRamp=r}return new YC({field:o.name,uniqueValueInfos:p,authoringInfo:d})}function rJe(t,e,i){let r;return ye(t)?(r=e?t.fields.find(n=>e.toLowerCase()===n.name.toLowerCase()):MKt(t.fields),r||(i||(r=t.fields.find(n=>n.type==="string")),r||(r=pY(t,"value")))):r=new Bo({name:"value"}),r}function MKt(t){let e;for(let i=0;ii.name.toLowerCase()===e)}function nJe(t,e){const{attributeTable:i,bandCount:r}=t;return lt(i)&&kKt(t)?!0:!(lt(i)||r>1||e&&i.fields.find(n=>n.name.toLowerCase()===e.toLowerCase())==null)}function sJe(t){const{bandCount:e,colormap:i}=t;return ye(i)&&i.length>0&&e===1}function DKt(t){if(!sJe(t))return null;let e;const{attributeTable:i,colormap:r}=t;if(ye(i)){const n=pY(i,"value"),s=rJe(i,null,!0);s.type==="string"&&(e={},i.features.forEach(o=>{const a=o.attributes;e[a[n.name]]=s?a[s.name]:a[n.name]}))}return cCe.createFromColormap(r,e)}function FKt(t){const{bandCount:e,dataType:i,pixelType:r}=t;return i==="elevation"||i==="generic"&&e===1&&(r==="s16"||r==="s32"||r==="f32"||r==="f64")}function LKt(t,e=!1){const{attributeTable:i,bandCount:r}=t;return r===1&&(!e||ye(i)||ye(t.histograms))}function kKt(t){return["u8","s8"].includes(t.pixelType)&&t.statistics?.[0]?.min!=null&&t.statistics[0]?.max!=null&&t.bandCount===1}function rTe(t){const{dataType:e}=t;return e==="vector-uv"||e==="vector-magdir"}function NKt(t){const{dataType:e}=t;return e==="vector-uv"||e==="vector-magdir"}const $Kt=new Map([["m/s","meter-per-second"],["km/h","kilometer-per-hour"],["knots","knots"],["ft/s","feet-per-second"],["mph","mile-per-hour"]]);function BKt(t){if(!rTe(t))return null;let e;if(ye(t.statistics)&&t.statistics.length&&(t.dataType==="vector-magdir"||t.dataType==="vector-uv")){const{minMagnitude:n,maxMagnitude:s}=GKt(t.dataType,t.statistics);e=[{type:"size",field:"Magnitude",minSize:10,maxSize:40,minDataValue:n,maxDataValue:s}]}const i=ye(t.multidimensionalInfo)?$Kt.get(t.multidimensionalInfo.variables[0].unit):null,r=new TCe({visualVariables:e,inputUnit:i,rotationType:"geographic"});return r.visualVariables=[...r.sizeVariables,...r.rotationVariables],r}function oJe(t){return{color:t.symbolLayers[0].material?.color,type:"esriSFS",style:"esriSFSSolid"}}function nTe(t){if(t.type==="uniqueValue"){const e=t.uniqueValueInfos;return e?.[0].symbol?.symbolLayers?.length&&(t.uniqueValueInfos=e?.map(r=>({value:r.value,label:r.label,symbol:r.symbol?oJe(r.symbol):null}))),t}if(t.type==="classBreaks"){const e=t.classBreakInfos;return e[0].symbol?.symbolLayers?.length&&(t.classBreakInfos=e.map(i=>({classMinValue:i.classMinValue,classMaxValue:i.classMaxValue,label:i.label,symbol:i.symbol?oJe(i.symbol):null}))),t}return t}function GKt(t,e){let i,r;if(t==="vector-magdir")i=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;i=0,r=Math.max(Math.abs(n),Math.abs(o),Math.abs(s),Math.abs(a))}return{minMagnitude:i,maxMagnitude:r}}const sTe=1,VKt=[.299,.587,.114];function aJe(t,e=256){e=Math.min(e,256);const{size:i,counts:r}=t,n=new Uint8Array(i),s=r.reduce((d,p)=>d+p/e,0);let o=0,a=0,l=0,c=s;for(let d=0;d=l){const Y=uTe(l,r);for(c=0;c1&&(G-=(1/I)**(O*Y[c])),Ne[c]){const X=G*I*O**(1/r[c])+o;V[d]=s==="floor"?Math.floor(X):s==="round"?Math.round(X):X}else N>=i[c]?V[d]=a:V[d]=o;else V[d]=o;L[c]=V}}else for(c=0;c=i[c])V[d]=a;else{const Y=(N-e[c])*v[c]+o;V[d]=s==="floor"?Math.floor(Y):s==="round"?Math.round(Y):Y}L[c]=V}if(t.contrastOffset!=null){const Y=UKt(t.contrastOffset,t.brightnessOffset);for(c=0;c0&&i<100?a=(200*o-100*n+2*n*r)/(2*(100-i))+s:i<=0&&i>-100?a=(200*o-100*n+2*n*r)*(100+i)/2e4+s:i===100?(a=200*o-100*n+(n+1)*(100-i)+2*n*r,a=a>0?n:0):i===-100&&(a=s),l[o]=a>n?n:a<0?0:a;return l}function jKt(t,e,i){const r=[];for(let n=0;n=255)return sTe;let e=0;t!==150&&(e=t<=150?45*Math.cos(.01047*t):17*Math.sin(.021*t));const i=255,r=t+e,n=Math.log(t/i),s=Math.log(r/i);if(s===0)return sTe;const o=n/s;return isNaN(o)?sTe:Math.min(9.9,Math.max(.01,o))}function aTe(t){if(lt(t)||!t.pixels?.length)return null;const{pixels:e,mask:i,pixelType:r}=t,n=t.width*t.height,s=e.length;let o,a,l,c,d;const p=[],y=[];let v,S,I,O,L,N,G,V,Y,X;const te=256;for(c=0;c[ge.minValue,ge.maxValue,0,0]);else{const ge=aTe(i);o=ye(ge)?ge.statistics:null,a=ye(ge)?ge.histograms:null}else o=t.statistics?.length>0?t.statistics:s.statistics,a=t.histograms||s.histograms;l!=="percentClip"&&l!=="histogramEqualization"||a?.length||(l="minMax");const c=o?.length||a?.length||s.bandCount,d=[],p=[];let y,v,S,I,O,L,N,G,V;o&&!Array.isArray(o[0])&&(o=o.map(ge=>[ge.min,ge.max,ge.avg,ge.stddev]));const[Y,X]=sT(s.pixelType);if(!o?.length){for(o=[],G=0;Go[G][1]&&(p[G]=o[G][1]);break;case"histogramEqualization":for(ig(a),G=0;G=20&&(I[0]=I[1]=I[2]=I[I.length-1]=I[I.length-2]=0),S=0,v=(y.max-y.min)/y.size,N=y.min===-.5&&v===1?.5:0,V=0;VL){d[G]=y.min+v*(V+N);break}for(L=(1-(t.maxPercent||0)/100)*S,p[G]=y.max+N,V=y.size-2;V>=0;V--)if(O[V]aJe(ge)))):(re=t.max||255,te=t.min||0),HKt({minCutOff:d,maxCutOff:p,outMax:re,outMin:te,histogramLut:fe},r)}function HKt(t,e){if(e==null||e.length===0)return t;const i=Math.max.apply(null,e),{minCutOff:r,maxCutOff:n,outMin:s,outMax:o,histogramLut:a}=t;return r.length===e.length||r.length<=i?t:{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 uTe(t,e){const i=new Float32Array(t);for(let r=0;r1?e[r]>2?i[r]=6.5+(e[r]-2)**2.5:i[r]=6.5+100*(2-e[r])**4:i[r]=1;return i}function Iae(t,e){if(lt(t)||!t.pixels?.length)return t;const{mask:i,width:r,height:n,pixels:s}=t,{minCutOff:o,maxCutOff:a,gamma:l}=e,c=e.outMin||0,d=e.outMax||255,p=r*n,y=e.outputPixelType||"u8",v=t.pixels.map(()=>en.createEmptyBand(y,p)),S=v.length;let I,O,L,N,G;const V=d-c,Y=[],X=[];for(I=0;I=S,fe=!!e.isRenderer;if(re){const _e=uTe(S,l);for(O=0;O1&&(N-=(1/V)**(G*_e[I])),Lo[I]){const Ie=N*V*G**(1/l[I])+c;v[I][O]=fe?Math.floor(Ie):te?Math.round(Ie):Ie}else L>=a[I]?v[I][O]=d:v[I][O]=c;else v[I][O]=c}else for(O=0;Oo[I]){const _e=(L-o[I])*Y[I]+c;v[I][O]=fe?Math.floor(_e):te?Math.round(_e):_e}else L>=a[I]?v[I][O]=d:v[I][O]=c;const ge=new en({width:r,height:n,mask:i,pixels:v,pixelType:y});return ge.updateStatistics(),ge}function lJe(t){let{altitude:e,azimuth:i}=t;const{hillshadeType:r,pixelSizePower:n=1,pixelSizeFactor:s=1,scalingType:o,isGCS:a,resolution:l}=t,c=r==="multi-directional"?2*t.zFactor:t.zFactor,{x:d,y:p}=l;let y=c/(8*d),v=c/(8*p);if(a&&c>.001&&(y/=111e3,v/=111e3),o==="adjusted")if(a){const Ie=111e3*d,ke=111e3*p;y=(c+Ie**n*s)/(8*Ie),v=(c+ke**n*s)/(8*ke)}else y=(c+d**n*s)/(8*d),v=(c+p**n*s)/(8*p);let S=(90-e)*Math.PI/180,I=Math.cos(S),O=(360-i+90)*Math.PI/180,L=Math.sin(S)*Math.cos(O),N=Math.sin(S)*Math.sin(O);const G=[315,270,225,360,180,0],V=[60,60,60,60,60,90],Y=new Float32Array([3,5,3,2,1,4]),X=Y.reduce((Ie,ke)=>Ie+ke),te=Y.map(Ie=>Ie/X),re=r==="multi-directional"?G.length:1,fe=new Float32Array(6),ge=new Float32Array(6),_e=new Float32Array(6);if(r==="multi-directional")for(let Ie=0;IeS?S:O],G=o[I],V=G*N,Y=V*(1-Math.abs(L%2-1)),X=G-V;switch(Math.floor(L)){case 0:p[I]=V+X,y[I]=Y+X,v[I]=X;break;case 1:p[I]=Y+X,y[I]=V+X,v[I]=X;break;case 2:p[I]=X,y[I]=V+X,v[I]=Y+X;break;case 3:p[I]=X,y[I]=Y+X,v[I]=V+X;break;case 4:p[I]=Y+X,y[I]=X,v[I]=V+X;break;case 5:case 6:p[I]=V+X,y[I]=X,v[I]=Y+X}}t.pixels=[p,y,v],t.updateStatistics()}function YKt(t,e){if(!wh(t))return t;const i=e.zFactor,r=e.pixelSizePower??1,n=e.pixelSizeFactor??1,s=e.slopeType,o=e.isGCS,{width:a,height:l,mask:c}=t,d=t.pixels[0],p=new Uint8Array(a*l);let y=1;if(ye(c)){for(let ke=0;ke360&&(_e%=360)),a[X+te]=_e}}for(let Y=0;Y1||e&&i.fields.find(n=>n.name.toLowerCase()===e.toLowerCase())==null)}function JKt(t){const{bandCount:e,dataType:i,pixelType:r}=t;return i==="elevation"||i==="generic"&&e===1&&(r==="s16"||r==="f32"||r==="f64")}function ZKt(t){const{bandCount:e,colormap:i}=t;return ye(i)&&i.length>0&&e===1}let j5=class extends Ni{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let i;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":i=this._updateUVRenderer(e);break;case"rasterColormap":i=this._updateColormapRenderer(e);break;case"rasterStretch":i=this._updateStretchRenderer(e);break;case"classBreaks":i=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":i=this._updateShadedReliefRenderer(e);break;case"vectorField":i=this._updateVectorFieldRenderer();break;case"flowRenderer":i=this._updateFlowRenderer()}return i}symbolize(e){let i=e&&e.pixelBlock;if(!uJe(i))return i;if(e.simpleStretchParams&&this.rendererJSON.type==="rasterStretch")return this.simpleStretch(i,e.simpleStretchParams);try{let r;switch(i.pixels.length>3&&(i=sae(i,[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(i);break;case"classBreaks":r=this._symbolizeClassBreaks(i);break;case"rasterStretch":r=this._symbolizeStretch(i,e.bandIds);break;case"rasterShadedRelief":{const n=e.extent,s=n.spatialReference.isGeographic,o={x:(n.xmax-n.xmin)/i.width,y:(n.ymax-n.ymin)/i.height};r=this._symbolizeShadedRelief(i,{isGCS:s,resolution:o});break}}return r}catch(r){return Ei.getLogger(this.declaredClass).error("symbolize",r.message),i}}simpleStretch(e,i){if(!uJe(e))return e;try{return e.pixels.length>3&&(e=sae(e,[0,1,2])),Iae(e,{...i,isRenderer:!0})}catch(r){return Ei.getLogger(this.declaredClass).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:i,isGCS:r,resolution:n,bandIds:s}=e,{rendererJSON:o}=this;return o.type==="rasterStretch"?this._generateStretchWebGLParams(i,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 i=this.rendererJSON.colorRamp;return e?JSON.stringify(i)!==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:gCe(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:i}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?e:i?gCe(e,this.lookup.colormapLut):fYt(e,this.lookup.remapLut??[])}_symbolizeStretch(e,i){const{rasterInfo:r}=this,{pixelType:n,bandCount:s}=r,o=this.rendererJSON,a=["u8","u16","s8","s16"].includes(n);let l,c;const{dra:d}=o,{gamma:p}=this.lookup;if(o.stretchType==="histogramEqualization"){const y=d?null:this.lookup?.histogramLut,v=sM(o,{rasterInfo:r,pixelBlock:e,bandIds:i,returnHistogramLut:!y}),S=Iae(e,{...v,gamma:p,isRenderer:!0});c=oae(S,{lut:d?v.histogramLut:y,offset:0})}else if(a){if(d){const y=sM(o,{rasterInfo:r,pixelBlock:e,bandIds:i});l=oTe({pixelType:n,...y,gamma:p,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&&i?.length===e?.pixels.length&&l?.lut.length===s&&(l={lut:i.map(y=>l.lut[y]),offset:l.offset}),c=oae(e,l)}else{const y=sM(o,{rasterInfo:r,pixelBlock:e,bandIds:i});c=Iae(e,{...y,gamma:p,isRenderer:!0})}if(o.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;c=gCe(c,this.lookup?.colormapLut)}return c}_symbolizeShadedRelief(e,i){const r=this.rendererJSON,n={...r,...i},s=WKt(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 qKt(s,e,o,a),s}_isVectorFieldData(){const{bandCount:e,dataType:i}=this.rasterInfo;return e===2&&(i==="vector-magdir"||i==="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:i,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=i===1&&["u8","s8"].includes(n);if(!KKt(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(ye(r)){const d=r.fields.find(p=>p.name.toLowerCase()==="value");if(!d)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(p=>{const y=e.uniqueValueInfos?.find(S=>String(S.value)===String(p.attributes[s])),v=y?.symbol?.color;v?l.push([p.attributes[d.name]].concat(v)):o&&l.push([p.attributes[d.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(d=>{const p=d?.symbol?.color;p?l.push([parseInt(""+d.value,10)].concat(p)):o&&l.push([parseInt(""+d.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 c=iY({colormap:l});return this.lookup={rendererJSON:e,colormapLut:c},this.canRenderInWebGL=!0,{success:!0}}_updateColormapRenderer(e){if(!ZKt(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const i=e.colormapInfos.map(n=>[n.value].concat(n.color)).sort((n,s)=>n[0]-s[0]);if(!i||i.length===0)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=iY({colormap:i});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=!0,{success:!0}}_updateShadedReliefRenderer(e){if(!JKt(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 i=BA(e.colorRamp,{interpolateAlpha:!0}),r=iY({colormap:i}),n=[],s=r.indexedColormap;for(let o=0;oa.name.toLowerCase()==="value"):null,s=ye(i)?i.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:i}=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((y,v)=>y.classMaxValue-v.classMaxValue),l=a[a.length-1];let c=e.minValue;if(!r){const y=[];for(let v=0;vV>N);G&&d.push([L].concat(G.symbol.color))}}else{c=Math.floor(e.minValue);for(let y=0;y0&&e[0].min!=null&&e[0].max!=null}_updateStretchRenderer(e){let{stretchType:i,dra:r}=e;if(!(i==="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||(i="minMax");const{computeGamma:s,useGamma:o,colorRamp:a}=e;let{gamma:l}=e;if(o&&s&&!l?.length){const p=e.statistics?.length?e.statistics:this.rasterInfo.statistics;l=jKt(this.rasterInfo.pixelType,p)}const c=this.rasterInfo.pixelType,d=!r&&["u8","u16","s8","s16"].includes(c);if(i==="histogramEqualization"){const p=n.map(y=>aJe(y));this.lookup={rendererJSON:e,histogramLut:p}}else if(d){const p=sM(e,{rasterInfo:this.rasterInfo}),y=oTe({pixelType:c,...p,gamma:o?l:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:y}}if(a){const p=BA(a,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=iY({colormap:p}),this.lookup.rendererJSON=e}return this.lookup.gamma=o&&l?.length?l:null,this.canRenderInWebGL=!0,{success:!0}}_generateStretchWebGLParams(e,i,r){let n=null,s=null;const o=this.lookup&&this.lookup.colormapLut;i.colorRamp&&o&&(n=o.indexedColormap,s=o.offset),i.stretchType==="histogramEqualization"&&(i={...i,stretchType:"minMax"});const{gamma:a}=this.lookup,l=!!(i.useGamma&&a&&a.some(V=>V!==1)),{minCutOff:c,maxCutOff:d,outMin:p,outMax:y}=sM(i,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let v=0;ye(e)&&(v=e.getPlaneCount(),v===2&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:S}=this.rasterInfo,I=Math.min(3,r?.length||v||S,S),O=new Float32Array(I),L=n||l?1:255;let N;for(N=0;N1?a[N]>2?G[N]=6.5+(a[N]-2)**2.5:G[N]=6.5+100*(2-a[N])**4:G[N]=1;return{bandCount:I,outMin:p/L,outMax:y/L,minCutOff:c,maxCutOff:d,factor:O,useGamma:l,gamma:l?a:[1,1,1],gammaCorrection:l?G:[1,1,1],colormap:n,colormapOffset:s,stretchType:i.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,i=!1,r={x:0,y:0}){let n=null,s=null;const o=this.lookup&&this.lookup.colormapLut;e.colorRamp&&o&&(n=o.indexedColormap,s=o.offset);const a={...e,isGCS:i,resolution:r},l=lJe(a),c=this.rasterInfo.statistics?.[0];return{...l,minValue:c?.min??0,maxValue:c?.max??8e3,hillshadeType:e.hillshadeType==="traditional"?0:1,type:"hillshade",colormap:n,colormapOffset:s}}_generateVectorFieldWebGLParams(e){const{style:i,inputUnit:r,outputUnit:n,visualVariables:s,symbolTileSize:o,flowRepresentation:a}=e;let l;const c=this.rasterInfo.statistics?.[0].min??0,d=this.rasterInfo.statistics?.[0].max??50,p=s?.find(N=>N.type==="sizeInfo")??{type:"sizeInfo",field:"Magnitude",maxDataValue:d,maxSize:.8*o,minDataValue:c,minSize:.2*o},y=p.minDataValue??c,v=p.maxDataValue??d,S=ye(p.maxSize)&&ye(p.minSize)?[p.minSize/o,p.maxSize/o]:[.2,.8];if(i==="wind_speed"){const N=(S[0]+S[1])/2;S[0]=S[1]=N}const I=ye(y)&&ye(v)?[y,v]:null;if(i==="classified_arrow")if(ye(y)&&ye(v)&&ye(p)){l=[];const N=(p.maxDataValue-p.minDataValue)/5;for(let G=0;G<6;G++)l.push(p.minDataValue+N*G)}else l=[0,1e-6,3.5,7,10.5,14];const O=a==="flow_to"==(i==="ocean_current_kn"||i==="ocean_current_m")?0:Math.PI,L=s?.find(N=>N.type==="rotationInfo");return{breakValues:l,dataRange:I,inputUnit:r,outputUnit:n,symbolTileSize:o,symbolPercentRange:S,style:i||"single_arrow",rotation:O,rotationType:this.rasterInfo.storageInfo?.tileInfo&&this.rasterInfo.dataType==="vector-uv"?"geographic":L?.rotationType||e.rotationType,type:"vectorField"}}};function uJe(t){return wh(t)&&t.validPixelCount!==0}E([k({json:{write:!0}})],j5.prototype,"rendererJSON",void 0),E([k({type:R2,json:{write:!0}})],j5.prototype,"rasterInfo",void 0),E([k({json:{write:!0}})],j5.prototype,"lookup",void 0),E([k()],j5.prototype,"canRenderInWebGL",void 0),j5=E([ht("esri.renderers.support.RasterSymbolizer")],j5);const cTe=j5;let TB=class extends Ni{constructor(e){super(e),this.north=null,this.up=null,this.spatialReference=null}};E([k({type:Number,json:{write:!0}})],TB.prototype,"north",void 0),E([k({type:Number,json:{write:!0}})],TB.prototype,"up",void 0),E([k({type:rr,json:{write:!0}})],TB.prototype,"spatialReference",void 0),TB=E([ht("esri.rest.support.ImageAngleResult")],TB);const QKt=TB;let oM=class extends Ni{constructor(){super(...arguments),this.value=null,this.displayValue=null,this.uncertainty=null}};E([k({type:Number,json:{read:!0,write:!0}})],oM.prototype,"value",void 0),E([k({type:String,json:{read:!0,write:!0}})],oM.prototype,"displayValue",void 0),E([k({type:Number,json:{read:!0,write:!0}})],oM.prototype,"uncertainty",void 0),oM=E([ht("esri.rest.support.ImageMeasureResultValue")],oM);let EB=class extends oM{constructor(){super(...arguments),this.unit=null}};E([k({type:String,json:{read:rA.read,write:rA.write}})],EB.prototype,"unit",void 0),EB=E([ht("esri.rest.support.ImageMeasureResultLengthValue")],EB);let Aae=class extends oM{constructor(){super(...arguments),this.unit=null}};E([k({type:String,json:{read:jH.read,write:jH.write}})],Aae.prototype,"unit",void 0),Aae=E([ht("esri.rest.support.ImageMeasureResultAreaValue")],Aae);let fY=class extends oM{constructor(){super(...arguments),this.unit=null}};E([k({type:String,json:{read:lne.read,write:lne.write}})],fY.prototype,"unit",void 0),fY=E([ht("esri.rest.support.ImageMeasureResultAngleValue")],fY);let aM=class extends Ni{constructor(){super(...arguments),this.name=null,this.sensorName=null}};E([k({type:String,json:{read:!0,write:!0}})],aM.prototype,"name",void 0),E([k({type:String,json:{read:!0,write:!0}})],aM.prototype,"sensorName",void 0),aM=E([ht("esri.rest.support.BaseImageMeasureResult")],aM);let mY=class extends aM{constructor(){super(...arguments),this.area=null,this.perimeter=null}};E([k({type:Aae,json:{read:!0,write:!0}})],mY.prototype,"area",void 0),E([k({type:EB,json:{read:!0,write:!0}})],mY.prototype,"perimeter",void 0),mY=E([ht("esri.rest.support.ImageAreaResult")],mY);const eJt=mY;let IB=class extends aM{constructor(){super(...arguments),this.distance=null,this.azimuthAngle=null,this.elevationAngle=null}};E([k({type:EB,json:{read:!0,write:!0}})],IB.prototype,"distance",void 0),E([k({type:fY,json:{read:!0,write:!0}})],IB.prototype,"azimuthAngle",void 0),E([k({type:fY,json:{read:!0,write:!0}})],IB.prototype,"elevationAngle",void 0),IB=E([ht("esri.rest.support.ImageDistanceResult")],IB);const tJt=IB;let Pae=class extends aM{constructor(){super(...arguments),this.height=null}};E([k({type:EB,json:{read:!0,write:!0}})],Pae.prototype,"height",void 0),Pae=E([ht("esri.rest.support.ImageHeightResult")],Pae);const iJt=Pae;let D2=class extends Ni{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}};E([k({json:{write:!0}})],D2.prototype,"catalogItemVisibilities",void 0),E([k({type:Wu,json:{write:!0}})],D2.prototype,"catalogItems",void 0),E([k({type:Yi,json:{write:!0}})],D2.prototype,"location",void 0),E([k({json:{write:!0}})],D2.prototype,"name",void 0),E([k({json:{write:!0}})],D2.prototype,"objectId",void 0),E([k({json:{write:!0}})],D2.prototype,"processedValues",void 0),E([k({json:{write:!0}})],D2.prototype,"properties",void 0),E([k({json:{write:!0}})],D2.prototype,"value",void 0),D2=E([ht("esri.rest.support.ImageIdentifyResult")],D2);const rJt=D2;let Oae=class extends Ni{constructor(){super(...arguments),this.geometries=null}};E([k({json:{write:!0}})],Oae.prototype,"geometries",void 0),Oae=E([ht("esri.rest.support.ImagePixelLocationResult")],Oae);const nJt=Oae;let Rae=class extends aM{constructor(){super(...arguments),this.point=null}};E([k({type:Yi,json:{name:"point.value",read:!0,write:!0}})],Rae.prototype,"point",void 0),Rae=E([ht("esri.rest.support.ImagePointResult")],Rae);const sJt=Rae;let VA=class extends Ni{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};E([k({json:{write:!0}})],VA.prototype,"attributes",void 0),E([k({type:Yi,json:{write:!0}})],VA.prototype,"location",void 0),E([k({json:{write:!0}})],VA.prototype,"locationId",void 0),E([k({json:{write:!0}})],VA.prototype,"rasterId",void 0),E([k({json:{write:!0}})],VA.prototype,"resolution",void 0),E([k({json:{write:!0}})],VA.prototype,"pixelValue",void 0),VA=E([ht("esri.rest.support.ImageSample")],VA);const oJt=VA;let Mae=class extends Ni{constructor(){super(...arguments),this.samples=null}};E([k({type:[oJt],json:{write:!0}})],Mae.prototype,"samples",void 0),Mae=E([ht("esri.rest.support.ImageSampleResult")],Mae);const aJt=Mae;function cJe(t){const e=t?.time;if(e&&(e.start!=null||e.end!=null)){const i=[];e.start!=null&&i.push(e.start),e.end==null||i.includes(e.end)||i.push(e.end),t.time=i.join(",")}}async function hJe(t,e,i){const r=sh(t),n=e.geometry?[e.geometry]:[],s=await iv(n),o=e.toJSON();cJe(o);const a=s&&s[0];ye(a)&&(o.geometry=a.toJSON());const l=nT({...r.query,f:"json",...o});return r_(l,i)}async function lJt(t,e,i){const r=e.toJSON();ye(r.angleName)&&(r.angleName=r.angleName.join(",")),ye(e.point)&&e.point.spatialReference?.imageCoordinateSystem&&(r.point.spatialReference=Fae(e.point.spatialReference)),ye(e.spatialReference)&&e.spatialReference.imageCoordinateSystem&&(r.spatialReference=fJe(e.spatialReference));const n=sh(t),s=nT({...n.query,f:"json",...r}),o=r_(s,i),{data:a}=await ir(`${n.path}/computeAngles`,o);return a.spatialReference=a.spatialReference?a.spatialReference.geodataXform!=null?new rr({wkid:0,imageCoordinateSystem:a.spatialReference}):rr.fromJSON(a.spatialReference):null,a.north==="NaN"&&(a.north=null),a.up==="NaN"&&(a.up=null),new QKt(a)}async function uJt(t,e,i){const r=e.toJSON(),{geometries:n}=e;if(n)for(let c=0;c{a.avg=a.mean,a.stddev=a.standardDeviation}),{statistics:o,histograms:s.histograms}}async function hJt(t,e,i){const r=await hJe(t,e,i),n=sh(t),{data:s}=await ir(`${n.path}/computeHistograms`,r);return{histograms:s.histograms}}async function dJt(t,e,i){const r=e.toJSON();cJe(r),r.outFields?.length&&(r.outFields=r.outFields.join(","));const n=(await iv(e.geometry))?.[0];ye(n)&&(r.geometry=n.toJSON());const s=sh(t),o=nT({...s.query,f:"json",...r}),a=r_(o,i),{data:l}=await ir(`${s.path}/getSamples`,a),c=l?.samples?.map(d=>{const p=d.value==="NaN"||d.value===""?null:d.value.split(" ").map(y=>Number(y));return{...d,pixelValue:p}});return aJt.fromJSON({samples:c})}async function dJe(t,e,i){const r=sh(t),n=e.geometry?[e.geometry]:[];return iv(n).then(s=>{const o=e.toJSON(),a=s&&s[0];ye(a)&&(o.geometry=JSON.stringify(a.toJSON()));const l=nT({...r.query,f:"json",...o}),c=r_(l,i);return ir(r.path+"/identify",c)}).then(s=>rJt.fromJSON(s.data))}async function pJt(t,e,i){const r=await Dae(t,e,[e.fromGeometry,e.toGeometry],i);return iJt.fromJSON(r)}async function fJt(t,e,i){const r=await Dae(t,e,[e.geometry],i);return eJt.fromJSON(r)}async function mJt(t,e,i){const r=await Dae(t,e,[e.geometry],i);return sJt.fromJSON(r)}async function gJt(t,e,i){const r=await Dae(t,e,[e.fromGeometry,e.toGeometry],i);return tJt.fromJSON(r)}async function Dae(t,e,i,r){const n=sh(t),s=await iv(i),o=e.toJSON();ye(s[0])&&(o.fromGeometry=JSON.stringify(pJe(s[0]))),ye(s[1])&&(o.toGeometry=JSON.stringify(pJe(s[1])));const a=nT({...n.query,f:"json",...o}),l=r_(a,r),{data:c}=await ir(n.path+"/measure",l);return c}function pJe(t){const e=t.toJSON();return t.spatialReference?.imageCoordinateSystem&&(e.spatialReference=Fae(t.spatialReference)),e}function Fae(t){const{imageCoordinateSystem:e}=t;if(e){const{id:i,referenceServiceName:r}=e;return i!=null?r?{icsid:i,icsns:r}:{icsid:i}:{ics:e}}return t.toJSON()}function fJe(t,e){const i=Fae(t),{icsid:r,icsns:n,wkid:s}=i;return r!=null?n==null||e?.toLowerCase().includes("/"+n.toLowerCase()+"/")?`0:${r}`:JSON.stringify(i):s?s.toString():JSON.stringify(i)}function gY(t){const e={};for(const i in t){if(i==="declaredClass")continue;const r=t[i];if(r!=null&&typeof r!="function")if(Array.isArray(r)){e[i]=[];for(let n=0;n>3,this._dataType=7&i,!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;return e=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128?e:(e=(e|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128?e:void 0))))}getUInt64(){return this._decodeVarint()}getSInt32(){const e=this.getUInt32();if(e!==void 0)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,i=this._pos,r=e.getUint32(i,!0)+e.getUint32(i+4,!0)*mJe;return this._skip(8),r}getSFixed64(){const e=this._dataView,i=this._pos,r=e.getUint32(i,!0)+e.getInt32(i+4,!0)*mJe;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(),i=this._pos,r=this._toString(this._data,i,i+e);return this._skip(e),r}getBytes(){const e=this._getLength(),i=this._pos,r=this._toBytes(this._data,i,i+e);return this._skip(e),r}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(e,i,r,n){const s=this.getMessage(),o=e(s,i,r,n);return s.release(),o}processMessage(e){const i=this.getMessage(),r=e(i);return i.release(),r}getMessage(){const e=this._getLength(),i=Yve.pool.acquire();return i._init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),i}release(){Yve.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case lM.varint:this._decodeVarint();break;case lM.fixed64:this._skip(8);break;case lM.delimited:this._skip(this._getLength());break;case lM.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 i=this._pos,r=0,n=0;if(this._end-i>=10)do{if(n=e[i++],r|=127&n,(128&n)==0||(n=e[i++],r|=(127&n)<<7,(128&n)==0)||(n=e[i++],r|=(127&n)<<14,(128&n)==0)||(n=e[i++],r|=(127&n)<<21,(128&n)==0)||(n=e[i++],r+=268435456*(127&n),(128&n)==0)||(n=e[i++],r+=34359738368*(127&n),(128&n)==0)||(n=e[i++],r+=4398046511104*(127&n),(128&n)==0)||(n=e[i++],r+=562949953421312*(127&n),(128&n)==0)||(n=e[i++],r+=72057594037927940*(127&n),(128&n)==0)||(n=e[i++],r+=9223372036854776e3*(127&n),(128&n)==0))break;throw new Error("Varint too long!")}while(0);else{let s=1;for(;i!==this._end&&(n=e[i],(128&n)!=0);)++i,r+=(127&n)*s,s*=128;if(i===this._end)throw new Error("Varint overrun!");++i,r+=n*s}return this._pos=i,r}_decodeSVarint(){const e=this._data;let i=this._pos,r=0,n=0;const s=1&e[i];if(this._end-i>=10)do{if(n=e[i++],r|=127&n,(128&n)==0||(n=e[i++],r|=(127&n)<<7,(128&n)==0)||(n=e[i++],r|=(127&n)<<14,(128&n)==0)||(n=e[i++],r|=(127&n)<<21,(128&n)==0)||(n=e[i++],r+=268435456*(127&n),(128&n)==0)||(n=e[i++],r+=34359738368*(127&n),(128&n)==0)||(n=e[i++],r+=4398046511104*(127&n),(128&n)==0)||(n=e[i++],r+=562949953421312*(127&n),(128&n)==0)||(n=e[i++],r+=72057594037927940*(127&n),(128&n)==0)||(n=e[i++],r+=9223372036854776e3*(127&n),(128&n)==0))break;throw new Error("Varint too long!")}while(0);else{let o=1;for(;i!==this._end&&(n=e[i],(128&n)!=0);)++i,r+=(127&n)*o,o*=128;if(i===this._end)throw new Error("Varint overrun!");++i,r+=n*o}return this._pos=i,s?-(r+1)/2:r/2}_getLength(){if(this._dataType!==lM.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(e,i,r){if((r=Math.min(this._end,r))-i>vJt){const o=e.subarray(i,r);return yJt.decode(o)}let n="",s="";for(let o=i;o{t._data=null,t._dataView=null});let Sl=class Xve{constructor(e=[],i=[],r=!1){this.lengths=e??[],this.coords=i??[],this.hasIndeterminateRingOrder=r}static fromRect(e){const[i,r,n,s]=e,o=n-i,a=s-r;return new Xve([5],[i,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,i)=>e+i)}forEachVertex(e){let i=0;this.lengths.length||e(this.coords[0],this.coords[1]);for(let r=0;ri+r,0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,i){e.coords[this._coordinatePtr++]=i}addCoordinatePoint(e,i){e.coords.push(i)}addLength(e,i){e.lengths.push(i)}addQueryGeometry(e,i){e.queryGeometry=i.queryGeometry,e.queryGeometryType=i.queryGeometryType}createPointGeometry(){return new Sl}};const vJe=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML"],_Je=["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"],bJe=["upperLeft","lowerLeft"];function dTe(t){return t>=vJe.length?null:vJe[t]}function bJt(t){return t>=_Je.length?null:_Je[t]}function wJe(t){return t>=bJe.length?null:bJe[t]}function xJe(t,e){return e>=t.geometryTypes.length?null:t.geometryTypes[e]}function wJt(t,e,i){const n=t.asUnsafe(),s=e.createPointGeometry(i);for(;n.next();)switch(n.tag()){case 3:{const o=n.getUInt32(),a=n.pos()+o;let l=0;for(;n.pos(){const n=r.data;if(n.hasOwnProperty("extent"))return r;if(n.features)throw new Error(TJe);if(n.hasOwnProperty("count"))throw new Error(TJe);return r})}function yY(t,e,i,r={},n={}){const s=typeof t=="string"?sa(t):t,o=e.geometry?[e.geometry]:[];return r.responseType=i==="pbf"?"array-buffer":"json",iv(o,null,r).then(a=>{const l=a&&a[0];ye(l)&&((e=e.clone()).geometry=l);const c=gY({...s.query,f:i,...n,...kJt(e,n)});return ir(dd(s.path,"query"),{...r,query:{...c,...r.query}})})}async function PB(t,e,i){const r=await PJe(t,e,i);return Wu.fromJSON(r)}async function PJe(t,e,i){const r=sh(t),n={...i},s=Ss.from(e),{data:o}=await AB(r,s,s.sourceSpatialReference,n);return o}function Kg(t,e){return t?e?4:3:e?3:2}const OB=Ei.getLogger("esri.layers.graphics.featureConversionUtils"),OJe={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0},$Jt=(t,e,i,r,n,s)=>{t[i]=n,t[i+1]=s},RJe=(t,e,i,r,n,s)=>{t[i]=n,t[i+1]=s,t[i+2]=e[r+2]},BJt=(t,e,i,r,n,s)=>{t[i]=n,t[i+1]=s,t[i+2]=e[r+3]},GJt=(t,e,i,r,n,s)=>{t[i]=n,t[i+1]=s,t[i+2]=e[r+2],t[i+3]=e[r+3]};function fTe(t,e,i,r){if(t){if(i)return e&&r?GJt:RJe;if(e&&r)return BJt}else if(e&&r)return RJe;return $Jt}function vY({scale:t,translate:e},i){return Math.round((i-e[0])/t[0])}function _Y({scale:t,translate:e},i){return Math.round((e[1]-i)/t[1])}function mTe({scale:t,translate:e},i,r){return i*t[r]+e[r]}function gTe(t,e,i){return t?e?i?_Te(t):yTe(t):i?vTe(t):Lae(t):null}function Lae(t){const e=t.coords;return{x:e[0],y:e[1]}}function MJe(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t}function yTe(t){const e=t.coords;return{x:e[0],y:e[1],z:e[2]}}function VJt(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.z,t}function vTe(t){const e=t.coords;return{x:e[0],y:e[1],m:e[2]}}function UJt(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.m,t}function _Te(t){const e=t.coords;return{x:e[0],y:e[1],z:e[2],m:e[3]}}function jJt(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.z,t.coords[3]=e.m,t}function zJt(t,e,i,r){let n=Lae;i&&r?n=_Te:i?n=yTe:r&&(n=vTe);for(const s of e){const{geometry:o,attributes:a}=s,l=ye(o)?n(o):null;t.push({attributes:a,geometry:l})}return t}function bTe(t,e){return t&&e?jJt:t?VJt:e?UJt:MJe}function DJe(t,e,i,r,n){const s=bTe(i,r);for(const{geometry:o,attributes:a}of e){const l=ye(o)?s(new Sl,o):null;t.push(new o_(l,a,null,n?a[n]:void 0))}return t}function HJt(t,e,i=bTe(e.z!=null,e.m!=null)){return i(t,e)}function WJt(t,e,i,r){for(const{geometry:n,attributes:s}of e)t.push({attributes:s,geometry:ye(n)?wTe(n,i,r):null});return t}function wTe(t,e,i){if(lt(t))return null;const r=Kg(e,i),n=[];for(let s=0;s=l&&(t.lengths.push(X),V=G)}return F2(t.coords,V),t.coords.length?t:null}function UJe(t,e,i,r,n,s,o=i,a=r){if(jA(t),!e||!e.coords.length)return null;const l=OJe[n],{coords:c,lengths:d}=e,p=Kg(i,r),y=Kg(i&&o,r&&a),v=fTe(i,r,o,a);if(!d.length)return v(t.coords,c,0,0,c[0],c[1]),jA(t,p,0),t;let S=0;const I=s*s;for(const O of d){if(O=l?t.lengths.push(V):F2(t.coords,L*y),S+=O*p}return t.coords.length?t:null}function ZJt(t,e,i,r){const n=t[e],s=t[e+1],o=t[i],a=t[i+1],l=t[r],c=t[r+1];let d=o,p=a,y=l-d,v=c-p;if(y!==0||v!==0){const S=((n-d)*y+(s-p)*v)/(y*y+v*v);S>1?(d=l,p=c):S>0&&(d+=y*S,p+=v*S)}return y=n-d,v=s-p,y*y+v*v}function ITe(t,e,i,r,n,s,o){let a,l=r,c=0;for(let d=s+i;dl&&(c=d,l=a);l>r&&(c-s>i&&ITe(t,e,i,r,n,s,c),n(t,e,t.length,c,e[c],e[c+1]),o-c>i&&ITe(t,e,i,r,n,c,o))}function Nae(t,e,i,r){if(lt(e)||!e.coords||!e.coords.length)return null;const n=Kg(i,r);let s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;if(e&&e.coords){const c=e.coords;for(let d=0;ds.name===i);return n?nZt({tagName:r,tags:n.tags}):null}function nZt(t){const{tagName:e,tags:i}=t;if(!i||!e)return null;const r=i.find(n=>n.name===e);return r&&r.value||null}var PTe;const sZt={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 a_=PTe=class extends Ni{constructor(t){super(t),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:t}=this,e=rZt({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:t});return sZt[e]||null}clone(){return new PTe({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})}};E([k({type:String})],a_.prototype,"contentType",void 0),E([k()],a_.prototype,"exifInfo",void 0),E([k({readOnly:!0})],a_.prototype,"orientationInfo",null),E([k({type:xs})],a_.prototype,"id",void 0),E([k({type:String})],a_.prototype,"globalId",void 0),E([k({type:String})],a_.prototype,"keywords",void 0),E([k({type:String})],a_.prototype,"name",void 0),E([k({json:{read:!1}})],a_.prototype,"parentGlobalId",void 0),E([k({json:{read:!1}})],a_.prototype,"parentObjectId",void 0),E([k({type:xs})],a_.prototype,"size",void 0),E([k({json:{read:!1}})],a_.prototype,"url",void 0),a_=PTe=E([ht("esri.layers.support.AttachmentInfo")],a_);const jJe=a_;async function OTe(t,e,i){const r=sh(t);return IJe(r,Ss.from(e),{...i}).then(n=>n.data.count)}async function $ae(t,e,i){const r=sh(t);return NJt(r,Ss.from(e),{...i}).then(n=>n.data.objectIds)}async function zJe(t,e,i){const r=sh(t),{renderingRule:n,sourceJSON:s}=e||{},o=n?JSON.stringify(n.rasterFunctionDefinition||n):null,a=nT({...r.query,renderingRule:o,f:"json"}),l=r_(a,i);t=r.path;const c=s||await ir(t,l).then(ke=>ke.data),d=c.hasRasterAttributeTable?ir(`${t}/rasterAttributeTable`,l):null,p=c.hasColormap?ir(`${t}/colormap`,l):null,y=c.hasHistograms?ir(`${t}/histograms`,l):null,v=c.currentVersion>=10.3?ir(`${t}/keyProperties`,l):null,S=c.hasMultidimensions?ir(`${t}/multidimensionalInfo`,l):null,I=await Promise.allSettled([d,p,y,v,S]);let O=null;if(c.minValues&&c.minValues.length===c.bandCount){O=[];for(let ke=0;ke{ke.statistics?.length&&ke.statistics.forEach(Ne=>{Ne.avg=Ne.mean,Ne.stddev=Ne.standardDeviation})});const{defaultVariable:ge,serviceDataType:_e}=c;ge&&ge!==re.DefaultVariable&&(re.DefaultVariable=ge),_e&&_e.includes("esriImageServiceDataTypeVector")&&!_e.includes(re.DataType)&&(re.DataType=_e.replace("esriImageServiceDataType",""));let Ie=c.noDataValue;return c.noDataValues?.length&&c.noDataValues.some(ke=>ke!==Ie)&&(Ie=c.noDataValues),new R2({width:N,height:G,bandCount:c.bandCount,extent:vr.fromJSON(c.extent),spatialReference:V,pixelSize:new Yi({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:V}),pixelType:c.pixelType.toLowerCase(),statistics:O,attributeTable:Y,colormap:X,histograms:te,keyProperties:re,noDataValue:Ie,multidimensionalInfo:fe})}function HJe(t,e,i){return zJe(t,{sourceJSON:e},i)}function oZt(t,e,i){return zJe(t,{renderingRule:e},i)}async function aZt(t,e,i){const r=sh(t),n=nT({...r?.query,f:"json"}),s=r_(n,i),o=`${r?.path}/${e}/info`,a=ir(`${o}`,s),l=ir(`${o}/keyProperties`,s),c=await Promise.allSettled([a,l]),d=c[0].status==="fulfilled"?c[0].value.data:null,p=c[1].status==="fulfilled"?c[1].value.data:null;let y=null;d.statistics?.length&&(y=d.statistics.map(V=>({min:V[0],max:V[1],avg:V[2],stddev:V[3]})));const v=vr.fromJSON(d.extent),S=Math.ceil(v.width/d.pixelSizeX-.1),I=Math.ceil(v.height/d.pixelSizeY-.1),O=v.spatialReference,L=new Yi({x:d.pixelSizeX,y:d.pixelSizeY,spatialReference:O}),N=d.histograms?.length?d.histograms:null,G=new G5({origin:d.origin,blockWidth:d.blockWidth,blockHeight:d.blockHeight,firstPyramidLevel:d.firstPyramidLevel,maximumPyramidLevel:d.maxPyramidLevel});return new R2({width:S,height:I,bandCount:d.bandCount,extent:v,spatialReference:O,pixelSize:L,pixelType:d.pixelType.toLowerCase(),statistics:y,histograms:N,keyProperties:p,storageInfo:G})}var RTe;let W5=RTe=class extends Ni{constructor(t){super(t),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new RTe(hi({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};E([k({type:[String],json:{name:"angleName",write:!0}})],W5.prototype,"angleNames",void 0),E([k({type:Yi,json:{write:!0}})],W5.prototype,"point",void 0),E([k({type:rr,json:{write:!0}})],W5.prototype,"spatialReference",void 0),E([k({type:xs,json:{write:!0}})],W5.prototype,"rasterId",void 0),W5=RTe=E([ht("esri.rest.support.ImageAngleParameters")],W5);const lZt=W5,hw=new Bs({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 dw=class extends Ni{constructor(){super(...arguments),this.type=null,this.measureOperation=null,this.mosaicRule=null,this.renderingRule=null,this.pixelSize=null,this.raster=void 0}};E([k()],dw.prototype,"type",void 0),E([k({type:hw.apiValues,json:{read:hw.read,write:hw.write}})],dw.prototype,"measureOperation",void 0),E([k({type:H1,json:{write:!0}})],dw.prototype,"mosaicRule",void 0),E([k({type:ru,json:{write:!0}})],dw.prototype,"renderingRule",void 0),E([k({type:Yi,json:{write:!0}})],dw.prototype,"pixelSize",void 0),E([k({json:{write:!0}})],dw.prototype,"raster",void 0),dw=E([ht("esri.rest.support.BaseImageMeasureParameters")],dw);var MTe;let zA=MTe=class extends dw{constructor(){super(...arguments),this.type="area-perimeter",this.geometry=null,this.is3D=!1,this.linearUnit="meters",this.areaUnit="square-meters"}writeGeometry(t,e,i){t!=null&&(e.geometryType=md(t),e[i]=t.toJSON())}get measureOperation(){return this.is3D?"area-and-perimeter-3D":"area-and-perimeter"}clone(){return new MTe(hi({geometry:this.geometry,is3D:this.is3D,linearUnit:this.linearUnit,areaUnit:this.areaUnit,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster}))}};E([k({types:P1,json:{name:"fromGeometry",read:!0,write:!0}})],zA.prototype,"geometry",void 0),E([mr("geometry")],zA.prototype,"writeGeometry",null),E([k({type:hw.apiValues,json:{write:hw.write}})],zA.prototype,"measureOperation",null),E([k({json:{read:!0}})],zA.prototype,"is3D",void 0),E([k({type:String,json:{read:rA.read,write:rA.write}})],zA.prototype,"linearUnit",void 0),E([k({type:String,json:{read:jH.read,write:jH.write}})],zA.prototype,"areaUnit",void 0),zA=MTe=E([ht("esri.rest.support.ImageAreaParameters")],zA);const uZt=zA;var DTe;let lT=DTe=class extends dw{constructor(){super(...arguments),this.type="distance-angle",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit="meters",this.angularUnit="degrees"}writeFromGeometry(t,e,i){t!=null&&(e.geometryType=md(t),e[i]=t.toJSON())}get measureOperation(){return this.is3D?"distance-and-angle-3D":"distance-and-angle"}clone(){return new DTe(hi({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster}))}};E([k({type:Yi,json:{read:!0,write:!0}})],lT.prototype,"fromGeometry",void 0),E([mr("fromGeometry")],lT.prototype,"writeFromGeometry",null),E([k({type:Yi,json:{read:!0,write:!0}})],lT.prototype,"toGeometry",void 0),E([k({type:hw.apiValues,json:{write:hw.write}})],lT.prototype,"measureOperation",null),E([k({json:{read:!0}})],lT.prototype,"is3D",void 0),E([k({type:String,json:{read:rA.read,write:rA.write}})],lT.prototype,"linearUnit",void 0),E([k({type:String,json:{read:lne.read,write:lne.write}})],lT.prototype,"angularUnit",void 0),lT=DTe=E([ht("esri.rest.support.ImageDistanceParameters")],lT);const cZt=lT;var FTe;let HA=FTe=class extends dw{constructor(){super(...arguments),this.type="height",this.fromGeometry=null,this.toGeometry=null,this.operationType="base-and-top",this.linearUnit="meters"}writeFromGeometry(t,e,i){t!=null&&(e.geometryType=md(t),e[i]=t.toJSON())}get measureOperation(){return this.operationType}clone(){return new FTe(hi({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster}))}};E([k({type:Yi,json:{read:!0}})],HA.prototype,"fromGeometry",void 0),E([mr("fromGeometry")],HA.prototype,"writeFromGeometry",null),E([k({type:Yi,json:{read:!0,write:!0}})],HA.prototype,"toGeometry",void 0),E([k({type:hw.apiValues,json:{write:hw.write}})],HA.prototype,"measureOperation",null),E([k({json:{read:!0}})],HA.prototype,"operationType",void 0),E([k({type:String,json:{read:rA.read,write:rA.write}})],HA.prototype,"linearUnit",void 0),HA=FTe=E([ht("esri.rest.support.ImageHeightParameters")],HA);const hZt=HA;var LTe;let uT=LTe=class extends Ni{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.renderingRule=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(t,e,i){t!=null&&(e.geometryType=md(t),e[i]=t.toJSON())}clone(){return new LTe(hi({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};E([k({types:P1,json:{read:fl}})],uT.prototype,"geometry",void 0),E([mr("geometry")],uT.prototype,"writeGeometry",null),E([k({type:H1,json:{write:!0}})],uT.prototype,"mosaicRule",void 0),E([k({type:ru,json:{write:!0}})],uT.prototype,"renderingRule",void 0),E([k({type:Yi,json:{write:!0}})],uT.prototype,"pixelSize",void 0),E([k({json:{write:!0}})],uT.prototype,"raster",void 0),E([k({type:Wg,json:{read:{source:"time"},write:{target:"time"}}})],uT.prototype,"timeExtent",void 0),uT=LTe=E([ht("esri.rest.support.ImageHistogramParameters")],uT);const WJe=uT;var kTe;let Rp=kTe=class extends Ni{constructor(){super(...arguments),this.geometry=null,this.renderingRules=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(t,e,i){t!=null&&(e.geometryType=md(t),e[i]=JSON.stringify(t.toJSON()))}set mosaicRule(t){let e=t;e&&e.mosaicMethod&&(e=H1.fromJSON({...e.toJSON(),mosaicMethod:e.mosaicMethod,mosaicOperation:e.mosaicOperation})),this._set("mosaicRule",e)}writeMosaicRule(t,e,i){t!=null&&(e[i]=JSON.stringify(t.toJSON()))}set renderingRule(t){let e=t;e&&e.rasterFunction&&(e=ru.fromJSON({...e.toJSON(),rasterFunction:e.rasterFunction,rasterFunctionArguments:e.rasterFunctionArguments})),this._set("renderingRule",e)}writeRenderingRule(t,e,i){t!=null&&(e[i]=JSON.stringify(t.toJSON())),t.rasterFunctionDefinition&&(e[i]=JSON.stringify(t.rasterFunctionDefinition))}writeRenderingRules(t,e,i){t!=null&&(e[i]=JSON.stringify(t.map(r=>r.rasterFunctionDefinition||r.toJSON())))}writePixelSize(t,e,i){t!=null&&(e[i]=JSON.stringify(t))}writeTimeExtent(t,e,i){if(t!=null){const r=ye(t.start)?t.start.getTime():null,n=ye(t.end)?t.end.getTime():null;e[i]=r!=null?n!=null?`${r},${n}`:`${r}`:null}}clone(){return new kTe(hi({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,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}))}};E([k({json:{write:!0}})],Rp.prototype,"geometry",void 0),E([mr("geometry")],Rp.prototype,"writeGeometry",null),E([k({type:H1,json:{write:!0}})],Rp.prototype,"mosaicRule",null),E([mr("mosaicRule")],Rp.prototype,"writeMosaicRule",null),E([k({type:ru,json:{write:!0}})],Rp.prototype,"renderingRule",null),E([mr("renderingRule")],Rp.prototype,"writeRenderingRule",null),E([k({type:[ru],json:{write:!0}})],Rp.prototype,"renderingRules",void 0),E([mr("renderingRules")],Rp.prototype,"writeRenderingRules",null),E([k({type:Yi,json:{write:!0}})],Rp.prototype,"pixelSize",void 0),E([mr("pixelSize")],Rp.prototype,"writePixelSize",null),E([k({type:Boolean,json:{write:!0}})],Rp.prototype,"returnGeometry",void 0),E([k({type:Boolean,json:{write:!0}})],Rp.prototype,"returnCatalogItems",void 0),E([k({type:Boolean,json:{write:!0}})],Rp.prototype,"returnPixelValues",void 0),E([k({type:Number,json:{write:!0}})],Rp.prototype,"maxItemCount",void 0),E([k({type:Wg,json:{write:{target:"time"}}})],Rp.prototype,"timeExtent",void 0),E([mr("timeExtent")],Rp.prototype,"writeTimeExtent",null),E([k({json:{write:!0}})],Rp.prototype,"raster",void 0),E([k({json:{write:!0}})],Rp.prototype,"viewId",void 0),E([k({type:Boolean,json:{write:!0}})],Rp.prototype,"processAsMultidimensional",void 0),Rp=kTe=E([ht("esri.rest.support.ImageIdentifyParameters")],Rp);const qJe=Rp;var NTe;let FB=NTe=class extends Ni{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(t,e,i){e.geometries={geometryType:"esriGeometryPoint",geometries:t.map(r=>r.toJSON())}}clone(){return new NTe({geometries:this.geometries?.map(t=>t.clone())??[],rasterId:this.rasterId})}};E([k({type:[Yi],json:{write:!0}})],FB.prototype,"geometries",void 0),E([mr("geometries")],FB.prototype,"writeGeometry",null),E([k({type:xs,json:{write:!0}})],FB.prototype,"rasterId",void 0),FB=NTe=E([ht("esri.rest.support.ImagePixelLocationParameters")],FB);const dZt=FB;var $Te;let q5=$Te=class extends dw{constructor(){super(...arguments),this.type="point",this.geometry=null,this.is3D=!1}writeGeometry(t,e,i){t!=null&&(e.geometryType=md(t),e[i]=t.toJSON())}get measureOperation(){const{is3D:t,geometry:e}=this;return e.type==="point"?t?"point-3D":"point":t?"centroid-3D":"centroid"}clone(){return new $Te(hi({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster}))}};E([k({types:P1,json:{name:"fromGeometry",read:fl}})],q5.prototype,"geometry",void 0),E([mr("geometry")],q5.prototype,"writeGeometry",null),E([k({type:hw.apiValues,json:{read:hw.read,write:hw.write}})],q5.prototype,"measureOperation",null),E([k({json:{read:!0}})],q5.prototype,"is3D",void 0),q5=$Te=E([ht("esri.rest.support.ImagePointParameters")],q5);const pZt=q5;var BTe;let u0=BTe=class extends Ni{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(t,e,i){t!=null&&(e.geometryType=md(t),e[i]=t.toJSON())}set locations(t){if(t?.length){const e=new fd({spatialReference:t[0].spatialReference});e.points=t.map(i=>[i.x,i.y]),this._set("locations",t),this.geometry=e}}clone(){return new BTe(hi({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}))}};E([k({types:P1,json:{read:fl}})],u0.prototype,"geometry",void 0),E([mr("geometry")],u0.prototype,"writeGeometry",null),E([k()],u0.prototype,"locations",null),E([k({type:String,json:{type:GA.jsonValues,read:GA.read,write:GA.write}})],u0.prototype,"interpolation",void 0),E([k({type:H1,json:{write:!0}})],u0.prototype,"mosaicRule",void 0),E([k({type:[String],json:{write:!0}})],u0.prototype,"outFields",void 0),E([k({type:Yi,json:{write:!0}})],u0.prototype,"pixelSize",void 0),E([k({type:String,json:{write:!0}})],u0.prototype,"raster",void 0),E([k({type:Boolean,json:{write:!0}})],u0.prototype,"returnFirstValueOnly",void 0),E([k({type:Number,json:{write:!0}})],u0.prototype,"sampleDistance",void 0),E([k({type:Number,json:{write:!0}})],u0.prototype,"sampleCount",void 0),E([k({type:Number,json:{write:!0}})],u0.prototype,"sliceId",void 0),E([k({type:Wg,json:{read:{source:"time"},write:{target:"time"}}})],u0.prototype,"timeExtent",void 0),u0=BTe=E([ht("esri.rest.support.ImageSampleParameters")],u0);const fZt=u0,L2=Ei.getLogger("esri.views.2d.engine.flow.dataUtils"),mZt=10;async function GTe(t,e,i,r){const n=performance.now(),s=gZt(e,i),o=performance.now(),a=vZt(e,s,i.width,i.height),l=performance.now(),c=bZt(a,!0),d=performance.now(),p=t==="Streamlines"?wZt(c,mZt):xZt(c),y=performance.now();return Gi("esri-2d-profiler")&&(L2.info("I.1","_createFlowFieldFromData (ms)",Math.round(o-n)),L2.info("I.2","_getStreamlines (ms)",Math.round(l-o)),L2.info("I.3","createAnimatedLinesData (ms)",Math.round(d-l)),L2.info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(y-d)),L2.info("I.5","createFlowMesh (ms)",Math.round(y-n)),L2.info("I.6","Mesh size (bytes)",p.vertexData.buffer.byteLength+p.indexData.buffer.byteLength)),await Promise.resolve(),sn(r),p}function gZt(t,e){const i=_Zt(e.data,e.width,e.height,t.smoothing);return t.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,c=s,d=o,p=s{const s=Math.round(r),o=Math.round(n);return s<0||s>=e.width||o<0||o>=e.height?[0,0]:[i[2*(o*e.width+s)+0],i[2*(o*e.width+s)+1]]}}function yZt(t,e,i,r,n,s,o,a,l){const c=[];let d=i,p=r,y=0,[v,S]=e(d,p);v*=t.velocityScale,S*=t.velocityScale;const I=Math.sqrt(v*v+S*S);let O,L;c.push({x:d,y:p,t:y,speed:I});for(let N=0;Nt.maxTurnAngle)return c;if(t.collisions){const re=Math.round(d*l),fe=Math.round(p*l);if(re<0||re>o-1||fe<0||fe>a-1)return c;const ge=s[fe*o+re];if(ge!==-1&&ge!==n)return c;s[fe*o+re]=n}c.push({x:d,y:p,t:y,speed:Y}),O=X,L=te}return c}function vZt(t,e,i,r){const n=[],s=new bC,o=1/Math.max(t.lineCollisionWidth,1),a=Math.round(i*o),l=Math.round(r*o),c=new Int32Array(a*l);for(let p=0;pp.sort-y.sort);for(const{x:p,y}of d)if(s.getFloat()=e)continue;const S=s[v+n];p+=S*t[2*(c*e+(d+v))+0],y+=S*t[2*(c*e+(d+v))+1]}a[2*(c*e+d)+0]=p,a[2*(c*e+d)+1]=y}const l=new Float32Array(t.length);for(let c=0;c=i)continue;const S=s[v+n];p+=S*a[2*((d+v)*e+c)+0],y+=S*a[2*((d+v)*e+c)+1]}l[2*(d*e+c)+0]=p,l[2*(d*e+c)+1]=y}return l}function bZt(t,e){const i=new bC,r=t.reduce((l,c)=>l+c.length,0),n=new Float32Array(4*r),s=new Array(t.length);let o=0,a=0;for(const l of t){const c=o;for(const d of l)n[4*o+0]=d.x,n[4*o+1]=d.y,n[4*o+2]=d.t,n[4*o+3]=d.speed,o++;s[a++]={startVertex:c,numberOfVertices:l.length,totalTime:l[l.length-1].t,timeSeed:e?i.getFloat():0}}return{lineVertices:n,lineDescriptors:s}}function wZt(t,e){const{lineVertices:r,lineDescriptors:n}=t;let s=0,o=0;for(const v of n)s+=2*v.numberOfVertices,o+=6*(v.numberOfVertices-1);const a=new Float32Array(s*9),l=new Uint32Array(o);let c=0,d=0;function p(){l[d++]=c-2,l[d++]=c,l[d++]=c-1,l[d++]=c,l[d++]=c+1,l[d++]=c-1}function y(v,S,I,O,L,N,G,V){const Y=c*9;let X=0;a[Y+X++]=v,a[Y+X++]=S,a[Y+X++]=1,a[Y+X++]=I,a[Y+X++]=N,a[Y+X++]=G,a[Y+X++]=O/2,a[Y+X++]=L/2,a[Y+X++]=V,c++,a[Y+X++]=v,a[Y+X++]=S,a[Y+X++]=-1,a[Y+X++]=I,a[Y+X++]=N,a[Y+X++]=G,a[Y+X++]=-O/2,a[Y+X++]=-L/2,a[Y+X++]=V,c++}for(const v of n){const{totalTime:S,timeSeed:I}=v;let O=null,L=null,N=null,G=null,V=null,Y=null;for(let X=0;X0){_e=te-O,Ie=re-L;const J=Math.sqrt(_e*_e+Ie*Ie);if(_e/=J,Ie/=J,X>1){let he=_e+V,xe=Ie+Y;const Pe=Math.sqrt(he*he+xe*xe);he/=Pe,xe/=Pe;const Oe=Math.min(1/(he*_e+xe*Ie),e);he*=Oe,xe*=Oe,ke=-xe,Ne=he}else ke=-Ie,Ne=_e;ke!==null&&Ne!==null&&(y(O,L,N,ke,Ne,S,I,ge),p())}O=te,L=re,N=fe,V=_e,Y=Ie,G=ge}y(O,L,N,-Y,V,S,I,G)}return{vertexData:a,indexData:l}}function xZt(t){const{lineVertices:n,lineDescriptors:s}=t;let o=0,a=0;for(const J of s){const he=J.numberOfVertices-1;o+=4*he*2,a+=6*he*2}const l=new Float32Array(o*16),c=new Uint32Array(a);let d,p,y,v,S,I,O,L,N,G,V,Y,X,te,re=0,fe=0;function ge(){c[fe++]=re-8,c[fe++]=re-7,c[fe++]=re-6,c[fe++]=re-7,c[fe++]=re-5,c[fe++]=re-6,c[fe++]=re-4,c[fe++]=re-3,c[fe++]=re-2,c[fe++]=re-3,c[fe++]=re-1,c[fe++]=re-2}function _e(J,he,xe,Pe,Oe,Ae,ze,Ge,Je,et,tt,ft,Pt,$t){const St=re*16;let Tt=0;for(const Lt of[1,2])for(const at of[1,2,3,4])l[St+Tt++]=J,l[St+Tt++]=he,l[St+Tt++]=xe,l[St+Tt++]=Pe,l[St+Tt++]=ze,l[St+Tt++]=Ge,l[St+Tt++]=Je,l[St+Tt++]=et,l[St+Tt++]=Lt,l[St+Tt++]=at,l[St+Tt++]=Pt,l[St+Tt++]=$t,l[St+Tt++]=Oe/2,l[St+Tt++]=Ae/2,l[St+Tt++]=tt/2,l[St+Tt++]=ft/2,re++}function Ie(J,he){let xe=N+V,Pe=G+Y;const Oe=Math.sqrt(xe*xe+Pe*Pe);xe/=Oe,Pe/=Oe;const Ae=N*xe+G*Pe;xe/=Ae,Pe/=Ae;let ze=V+X,Ge=Y+te;const Je=Math.sqrt(ze*ze+Ge*Ge);ze/=Je,Ge/=Je;const et=V*ze+Y*Ge;ze/=et,Ge/=et,_e(d,p,y,v,-Pe,xe,S,I,O,L,-Ge,ze,J,he),ge()}function ke(J,he,xe,Pe,Oe,Ae){if(N=V,G=Y,V=X,Y=te,N==null&&G==null&&(N=V,G=Y),S!=null&&I!=null){X=J-S,te=he-I;const ze=Math.sqrt(X*X+te*te);X/=ze,te/=ze}N!=null&&G!=null&&Ie(Oe,Ae),d=S,p=I,y=O,v=L,S=J,I=he,O=xe,L=Pe}function Ne(J,he){N=V,G=Y,V=X,Y=te,N==null&&G==null&&(N=V,G=Y),N!=null&&G!=null&&Ie(J,he)}for(const J of s){d=null,p=null,y=null,v=null,S=null,I=null,O=null,L=null,N=null,G=null,V=null,Y=null,X=null,te=null;const{totalTime:he,timeSeed:xe}=J;for(let Pe=0;Pe=i||(N.data[2*(Y*i+G+X)+0]=V.data[2*(Y*V.width+X)+0],N.data[2*(Y*i+G+X)+1]=V.data[2*(Y*V.width+X)+1],N.mask[Y*i+G+X]=V.mask[Y*V.width+X]);G+=V.width}return Gi("esri-2d-profiler")&&L2.info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-o)),N}async function KJe(t,e,i,r,n,s){const o={requestProjectedLocalDirections:!0,signal:s};if(ye(n)&&(o.timeExtent=n),t.type==="imagery"){await t.load({signal:s});const c=t.rasterInfo.dataType,d=await t.fetchImage(e,i,r,o);return!d||lt(d.pixelData)||lt(d.pixelData.pixelBlock)?{data:new Float32Array(i*r*2),mask:new Uint8Array(i*r),width:i,height:r}:YJe(c,d.pixelData.pixelBlock)}await t.load({signal:s});const a=t.rasterInfo.dataType,l=await t.fetchPixels(e,i,r,o);return!l||lt(l.pixelBlock)?{data:new Float32Array(i*r*2),mask:new Uint8Array(i*r),width:i,height:r}:YJe(a,l.pixelBlock)}const VTe=jo()({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"}),SZt=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),CZt=iVe(Ld,{min:0,max:255});function TZt(t){if(!t)return null;const e=JSON.stringify(t).match(/"rasterFunction":"(.*?")/gi)?.map(i=>i.replace('"rasterFunction":"',"").replace('"',""));return e?e.join("/"):null}const EZt=t=>{let e=class extends t{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 Op({layer:this}))}readServiceSupportsMosaicRule(r,n){return this._isMosaicRuleSupported(n)}get _rasterFunctionNamesIndex(){const r=new Map;return!this.rasterFunctionInfos||ye(this.rasterFunctionInfos)&&this.rasterFunctionInfos.length<1||ye(this.rasterFunctionInfos)&&this.rasterFunctionInfos.forEach(n=>{r.set(n.name.toLowerCase().replace(/ /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?H1.fromJSON(n):null}get fieldsIndex(){return this.fields?new Am(this.fields):null}set format(r){r&&SZt.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&&n.mosaicMethod&&(n=H1.fromJSON({...n.toJSON(),mosaicMethod:n.mosaicMethod,mosaicOperation:n.mosaicOperation})),this._set("mosaicRule",n)}readMosaicRule(r,n){const s=r||n.mosaicRule;return s?H1.fromJSON(s):this._isMosaicRuleSupported(n)?H1.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 H1({where:a})),this._isValidCustomizedMosaicRule(o)&&(n[s]=o.toJSON())}writeNoData(r,n,s){r!=null&&typeof r=="number"&&(n[s]=CZt(r))}readObjectIdField(r,n){if(!r){const s=n.fields.filter(o=>o.type==="esriFieldTypeOID"||o.type==="oid");r=s&&s[0]&&s[0].name}return r}get parsedUrl(){return sa(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=fKe(o,s);return a==null?null:(a.type==="vector-field"&&n.symbolTileSize&&!o.symbolTileSize&&(a.symbolTileSize=n.symbolTileSize),yKe(a)||Ei.getLogger(this.declaredClass).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||"Raster.",n=new Bo({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),s=new Bo({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),o=new Bo({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let a=this.fields?hi(this.fields):[];a.push(s),this.capabilities?.operations.supportsQuery&&this.fields&&this.fields.length>0&&a.push(n),this.version>=10.4&&ye(this.rasterFunctionInfos)&&this.rasterFunctionInfos.some(c=>c.name.toLowerCase()==="none")&&a.push(o),ye(this.rasterFunctionInfos)&&this.rasterFunctionInfos.filter(c=>c.name.toLowerCase()!=="none").forEach(c=>{a.push(new Bo({name:"Raster.ServicePixelValue."+c.name,alias:c.name,domain:null,editable:!1,length:50,type:"string"}))}),this._isVectorDataSet()&&(a.push(new Bo({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),a.push(new Bo({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:l}=this.rasterInfo??{};if(ye(l)){const c=l.fields.filter(d=>d.type!=="esriFieldTypeOID"&&d.name.toLowerCase()!=="value").map(d=>{const p=hi(d);return p.name=r+d.name,p});a=a.concat(c)}return a}set renderingRule(r){let n=r;n&&n.rasterFunction&&(n=ru.fromJSON({...n.toJSON(),rasterFunction:n.rasterFunction,rasterFunctionArguments:n.rasterFunctionArguments})),this._set("renderingRule",n)}readRenderingRule(r,n){const s=n.rasterFunctionInfos;return n.renderingRule||s&&s.length&&s[0].name!=="None"?this._isRFTJson(n.renderingRule)?ru.fromJSON({rasterFunctionDefinition:n.renderingRule}):ru.fromJSON(n.renderingRule||{rasterFunctionInfos:n.rasterFunctionInfos}):null}writeRenderingRule(r,n,s){const o=r.toJSON();o.rasterFunctionDefinition?n[s]=o.rasterFunctionDefinition:n[s]=o}readSpatialReference(r,n){const s=r||n.extent.spatialReference;return s?rr.fromJSON(s):null}readPixelType(r){return VTe.fromJSON(r)||r}writePixelType(r,n,s){(lt(this.serviceRasterInfo)||this.pixelType!==this.serviceRasterInfo.pixelType)&&(n[s]=VTe.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:c}=this;if(!this._isPicture()&&o&&a&&!l){const d=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(o.toJSON()),p=this._rasterJobHandler.instance;if(p){d&&(a.bind(),await p.updateSymbolizer(a,n),this._cachedRendererJson=o.toJSON());const y=await p.symbolize({bandIds:c,...r},n);s={extent:r.extent,pixelBlock:y}}else s={extent:r.extent,pixelBlock:a.symbolize({bandIds:c,...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 st("imagery-layer:compute-angles","this operation is not supported on the input image service");return r=kd(lZt,r).clone(),lJt(this.url,r,this._getRequestOptions(n))}async computePixelSpaceLocations(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsComputePixelLocation)throw new st("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return r=kd(dZt,r).clone(),uJt(this.url,r,this._getRequestOptions(n))}async computeHistograms(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsComputeHistograms)throw new st("imagery-layer:compute-histograms","this operation is not supported on the input image service");return r=kd(WJe,r).clone(),this._applyMosaicAndRenderingRules(r),hJt(this.url,r,this._getRequestOptions(n))}async computeStatisticsHistograms(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsComputeStatisticsHistograms)throw new st("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return r=kd(WJe,r).clone(),this._applyMosaicAndRenderingRules(r),cJt(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 st("imagery-layer:measure-height","this operation is not supported on the input image service");return r=kd(hZt,r).clone(),this._applyMosaicAndRenderingRules(r),pJt(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 st("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return r=kd(uZt,r).clone(),this._applyMosaicAndRenderingRules(r),fJt(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 st("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return r=kd(cZt,r).clone(),this._applyMosaicAndRenderingRules(r),gJt(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 st("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return r=kd(pZt,r).clone(),this._applyMosaicAndRenderingRules(r),mJt(this.url,r,this._getRequestOptions(n))}getField(r){const{fieldsIndex:n}=this;return ye(n)?n.get(r):void 0}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 st("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 p=await this.generateRasterInfo(this.renderingRule,{signal:o.signal});p&&(this.rasterInfo=p)}const a=this.getExportImageServiceParameters(r,n,s,o.timeExtent);if(a==null){if(o.requestAsImageElement&&this._canRequestImageElement(this.format)){const L=document.createElement("canvas");return L.width=n,L.height=s,o.returnImageBitmap?{imageBitmap:await rM(L,`${i(this.parsedUrl)}/exportImage`)}:{imageOrCanvasElement:L}}const{bandIds:p,rasterInfo:y}=this,v=(p?.length||y.bandCount)??0,S=n*s,I=y.pixelType,O=[];for(let L=0;L=10.3?r?.renderingRule:null})}).then(n=>n.data)}fetchRasterAttributeTable(r){return this.version<10.1?Promise.reject(new st("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):ir(i(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?r?.renderingRule:null})}).then(n=>Wu.fromJSON(n.data))}getCatalogItemRasterInfo(r,n){const s={...n,query:this._getQueryParams()};return aZt(i(this.parsedUrl),r,s)}async getCatalogItemICSInfo(r,n){const{data:s}=await ir(i(this.parsedUrl)+"/"+r+"/info/ics",{query:this._getQueryParams(),...n}),o=s&&s.ics;if(!o)return;let a=null;try{a=(await ir(i(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?ir(i(this.parsedUrl)+"/"+r+"/info/icstopixel",{query:this._getQueryParams(),...n}).then(he=>he.data).catch(()=>({})):{},c=a.spatialReference,d={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[a]}),inSR:c.wkid||JSON.stringify(c),outSR:"0:"+r},p=ir(i(this.parsedUrl)+"/project",{query:this._getQueryParams(d),...n}).then(he=>he.data).catch(()=>({})),y=5,v=(a.xmin+a.xmax)/2,S=(a.ymax-a.ymin)/(y+1),I=a.ymin+S,O=[];for(let he=0;hehe.data).catch(()=>({})),G=await Promise.all([l,p,N]);let V=G[0].ipxf;if(V==null){const he=o.geodataXform?.xf_0;he?.name?.toLowerCase()==="topup"&&he?.coefficients?.length===6&&(V={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:he.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const Y=vr.fromJSON(G[1]&&G[1].geometries&&G[1].geometries[0]);Y&&(Y.spatialReference=new rr({wkid:0,imageCoordinateSystem:o}));const X=G[2].geometries?G[2].geometries.filter(he=>he!=null&&he.x!=null&&he.y!=null&&he.x!=="NaN"&&he.y!=="NaN"):[],te=X.length;if(te<3)return{ics:o,icsToPixelTransform:V,icsExtent:Y,northDirection:null};let re=0,fe=0,ge=0,_e=0;for(let he=0;heX[0].x,J=X[y-1].y>X[0].y;return Ie===1/0?ke=J?90:270:Ie===0?ke=Ne?0:180:Ie>0?ke=Ne?180*Math.atan(Ie)/Math.PI:180*Math.atan(Ie)/Math.PI+180:Ie<0&&(ke=J?180+180*Math.atan(Ie)/Math.PI:360+180*Math.atan(Ie)/Math.PI),{ics:o,icsToPixelTransform:V,icsExtent:Y,northDirection:ke}}async generateRasterInfo(r,n){if(r=kd(ru,r),this.serviceRasterInfo&&(!r||r.functionName?.toLowerCase()==="none"||this._isVectorFieldResampleFunction(r)))return this.serviceRasterInfo;const s=TZt(r);if(!s)return null;if(this._functionRasterInfos[s])return this._functionRasterInfos[s];const o=this._generateRasterInfo(r,n);this._functionRasterInfos[s]=o;try{return await o}catch{return this._functionRasterInfos[s]=null,null}}getExportImageServiceParameters(r,n,s,o){r=r.clone().shiftCentralMeridian();const a=fJe(r.spatialReference,i(this.parsedUrl));this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const l=this.exportImageServiceParameters.toJSON(),{bandIds:c,noData:d}=l;let{renderingRule:p}=l;const y=this.renderingRule?.rasterFunctionDefinition,v=!this.renderer||this.renderer.type==="raster-stretch";if(c?.length&&this._hasRenderingRule(this.renderingRule)&&!y&&v){const O={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:c}};if(p.rasterFunction==="Stretch")O.rasterFunctionArguments.Raster=p.rasterFunctionArguments.Raster,p.rasterFunctionArguments.Raster=O;else if(p.rasterFunction==="Colormap"){const L=p.rasterFunctionArguments.Raster;L?.rasterFunction==="Stretch"?(O.rasterFunctionArguments.Raster=L.rasterFunctionArguments.Raster,L.rasterFunctionArguments.Raster=O):(O.rasterFunctionArguments.Raster=L,p.rasterFunctionArguments.Raster=O)}else O.rasterFunctionArguments.Raster=p,p=O;l.bandIds=void 0}else l.bandIds=c?.join(",");d instanceof Array&&d.length>0&&(l.noData=d.join(","));const S=this._processMultidimensionalIntersection(null,o,this.exportImageServiceParameters.mosaicRule);if(S.isOutSide)return null;l.mosaicRule=ye(S.mosaicRule)?JSON.stringify(S.mosaicRule):null,o=S.timeExtent,l.renderingRule=this._getRenderingRuleString(ru.fromJSON(p));const I={};if(ye(o)){const{start:O,end:L}=o.toJSON();O&&L&&O===L?I.time=""+O:O==null&&L==null||(I.time=`${O??"null"},${L??"null"}`)}return{bbox:r.xmin+","+r.ymin+","+r.xmax+","+r.ymax,bboxSR:a,imageSR:a,size:n+","+s,...l,...I}}async getSamples(r,n){if(!(await this._fetchCapabilities(n?.signal))?.operations.supportsGetSamples)throw new st("imagery-layer:get-samples","getSamples operation is not supported on the input image service");r=kd(fZt,r).clone();const{raster:s}=this;return s&&r.raster==null&&(r.raster=s),dJt(this.url,r,this._getRequestOptions(n))}async identify(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsIdentify)throw new st("imagery-layer:identify","identify operation is not supported on the input image service");r=kd(qJe,r).clone();const s=this._processMultidimensionalIntersection(r.geometry,r.timeExtent,r.mosaicRule||this.mosaicRule);if(s.isOutSide)throw new st("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,renderingRule:a}=this;return a&&r.renderingRule==null&&(r.renderingRule=a),o&&r.raster==null&&(r.raster=o),dJe(this.url,r,this._getRequestOptions(n))}createQuery(){const r=new Ss;return r.outFields=["*"],r.returnGeometry=!0,r.where=this.definitionExpression||"1=1",r}async queryRasters(r,n){return{query:r,requestOptions:n}=await this._prepareForQuery(r,n),PB(this.url,r,n)}async queryObjectIds(r,n){return{query:r,requestOptions:n}=await this._prepareForQuery(r,n),$ae(this.url,r,n)}async queryRasterCount(r,n){return{query:r,requestOptions:n}=await this._prepareForQuery(r,n),OTe(this.url,r,n)}async queryVisibleRasters(r,n){if(!r)throw new st("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 c=!1,d=null,p=null;const y="raster.servicepixelvalue",v=this._rasterFunctionNamesIndex;if(ye(r.outFields)&&(c=r.outFields.some(V=>!V.toLowerCase().includes(y)),this.version>=10.4)){const V=r.outFields.filter(X=>X.toLowerCase().includes(y)&&X.length>y.length).map(X=>{const te=X.slice(y.length+1);return[this._updateRenderingRulesFunctionName(te,v),te]});d=V.map(X=>new ru({functionName:X[0]})),p=V.map(X=>X[1]);const{renderingRule:Y}=this;d.length===0?Y?.functionName?(d.push(Y),p.push(Y.functionName)):d=null:Y?.functionName&&!d.some(X=>X.functionName===Y.functionName)&&(d.push(Y),p.push(Y.functionName))}const S=lt(r.outSpatialReference)||r.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:I}=this;let O=r.timeExtent||this.timeExtent;if(I){const{isOutside:V,intersection:Y}=kCe(I,{geometry:r.geometry,timeExtent:r.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(V)throw new st("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");Y&&ye(Y.timeExtent)&&(O=Y.timeExtent)}const L=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,O),N=this._getQueryParams({geometry:r.geometry,timeExtent:O,mosaicRule:L,renderingRule:this.version<10.4?this.renderingRule:null,renderingRules:d,pixelSize:s,returnCatalogItems:c,returnGeometry:S,raster:this.raster,maxItemCount:a?1:null});delete N.f;const G=new qJe(N);try{await this.generateRasterInfo(this.renderingRule);const V=await dJe(this.url,G,{signal:n?.signal,query:{...this.customParameters}}),Y=r.outFields,X=V.value!=null&&V.value.toLowerCase().includes("nodata");if(!(c&&!S&&V?.catalogItems?.features.length&&(l||!X)))return this._processVisibleRastersResponse(V,{returnDomainValues:o,templateRRFunctionNames:p,showNoDataRecords:l,templateFields:Y});const te=this.objectIdField||"ObjectId",re=V.catalogItems?.features??[],fe=re.map(Ie=>Ie.attributes?.[te]),ge=new Ss({objectIds:fe,returnGeometry:!0,outSpatialReference:r.outSpatialReference,outFields:[te]}),_e=await this.queryRasters(ge);return _e?.features?.length&&_e.features.forEach(Ie=>{re.forEach(ke=>{ke.attributes[te]===Ie.attributes[te]&&(ke.geometry=new po(Ie.geometry),ye(r.outSpatialReference)&&(ke.geometry.spatialReference=r.outSpatialReference))})}),this._processVisibleRastersResponse(V,{returnDomainValues:o,templateRRFunctionNames:p,showNoDataRecords:l,templateFields:Y})}catch{throw new st("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(r,n){const s=ir(i(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:r}),signal:n}).then(l=>l.data?.statistics),o=ir(i(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):GTe(r.meshType,r.simulationSettings,r.flowData,ye(n.signal)?n.signal:new AbortController().signal)}getMultidimensionalSubsetVariables(r){const n=r??this.serviceRasterInfo.multidimensionalInfo;return AKe(this.multidimensionalSubset,n)}async _fetchService(r){await this._fetchServiceInfo(r),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const n=this.sourceJSON,s=ye(this.serviceRasterInfo)?Promise.resolve(this.serviceRasterInfo):HJe(i(this.parsedUrl),n,{signal:r,query:this._getQueryParams()}).then(l=>(this._set("serviceRasterInfo",l),this._set("multidimensionalInfo",l.multidimensionalInfo),l)),o=this._hasRenderingRule(this.renderingRule)?this.generateRasterInfo(this.renderingRule,{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),Ei.getLogger(this.declaredClass).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([Qi(()=>this.renderingRule,d=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this.generateRasterInfo(d).then(p=>{p&&(this.rasterInfo=p)})})]);const{serviceRasterInfo:c}=this;ye(c.multidimensionalInfo)&&this._updateMultidimensionalDefinition(c)})}_combineMosaicRuleWithTimeExtent(r,n){const s=this.timeInfo,{multidimensionalInfo:o}=this.serviceRasterInfo;if(lt(r)||lt(o)||lt(n)||lt(s?.startField))return r;const{startField:a}=s,l=o.variables.some(I=>I.dimensions.some(O=>O.name===a))?a:"StdTime";if(r=r.clone(),this.sourceType==="mosaic-dataset")return r.multidimensionalDefinition=r.multidimensionalDefinition?.filter(I=>I.dimensionName!==l),this._cleanupMultidimensionalDefinition(r);r.multidimensionalDefinition=r.multidimensionalDefinition||[];const c=r.multidimensionalDefinition.filter(I=>I.dimensionName===l),d=ye(n.start)?n.start.getTime():null,p=ye(n.end)?n.end.getTime():null,y=d==null||p==null||d===p,v=y?[d||p]:[[d,p]],S=this.version>=10.8;if(c.length)c.forEach(I=>{I.dimensionName===l&&(S?(I.dimensionName=null,I.isSlice=!1,I.values=[]):(I.isSlice=y,I.values=v))});else if(!S){const I=r.multidimensionalDefinition.filter(O=>O.variableName!=null&&O.dimensionName==null);I.length?I.forEach(O=>{O.dimensionName=l,O.isSlice=y,O.values=v}):r.multidimensionalDefinition.push(new iM({variableName:"",dimensionName:l,isSlice:y,values:v}))}return this._cleanupMultidimensionalDefinition(r)}_cleanupMultidimensionalDefinition(r){return lt(r)?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 st("imagery-layer:query-rasters","query operation is not supported on the input image service");return r=ye(r)?kd(Ss,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 xKe;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,renderingRule:s}=this;return r.type==="unique-value"&&this._hasRenderingRule(s)&&n?.bandCount===1&&["u8","s8"].includes(n.pixelType)||n!=null&&r!=null&&EKt(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 ir(i(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 st("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(lt(r))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=iTe(s);!a||s.bandCount===3&&a[0]===0&&a[1]===1&&a[2]===2||(this.bandIds=a)}r||(r=eTe(s,{bandIds:this.bandIds,variableName:this.renderingRule?null:this.mosaicRule?.multidimensionalDefinition?.[0].variableName}));const o=nTe(r.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=s):this.symbolizer=new cTe({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:ye(r.pixelBlock)?r.pixelBlock.clone():null}}_getQueryParams(r){r&&ye(r.renderingRule)&&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}):Eae(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 ir(i(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 I=`${i(this.parsedUrl)}/exportImage`,{data:O}=await ir(I,{responseType:o?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...r.imageServiceParameters}),signal:a});return O instanceof Blob?{imageBitmap:await rM(O,I),params:n}:{imageOrCanvasElement:O,params:n}}const l=this._initJobHandler(),c=ir(i(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...r.imageServiceParameters}),signal:a}),d=(await Promise.all([c,l]))[0].data,p=n.format||"jpgpng";let y=p;if(y!=="bsq"&&y!=="bip"&&(y=JKe(d)),!y)throw new st("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(d)));const v={signal:a};return{pixelData:{pixelBlock:await(p==="gif"||p==="bmp"||p.includes("png")&&(y==="png"||y==="jpg")?Eae(d,{useCanvas:!0,...n},v):this._decodePixelBlock(d,{width:n.width,height:n.height,planes:null,pixelType:null,noDataValue:null,format:p},v)),extent:n.extent},params:n}}_generateRasterInfo(r,n){const s={...n,query:this._getQueryParams()};return oZt(i(this.parsedUrl),r,s)}_isValidCustomizedMosaicRule(r){return r&&JSON.stringify(r.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(r){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let n=$Ce(r,{multidimensionalSubset:this.multidimensionalSubset});if(ye(n)&&n.length>0){this.mosaicRule=this.mosaicRule||new H1;const s=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.renderingRule&&this.renderingRule.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:c}=n,d=r.processedValues;let p=r.catalogItems&&r.catalogItems.features,y=r.properties&&r.properties.Values&&r.properties.Values.map(G=>G.replace(/ /gi,", "))||[];const v=this.objectIdField||"ObjectId",S=typeof s=="string"&&s.toLowerCase().includes("nodata"),I=[];if(s&&!p&&!S){const G={};G[v]=0,y=[s],p=[new js(this.fullExtent,null,G)]}if(!p)return[];let O,L,N;this._updateResponseFieldNames(p,c),S&&!a&&(p=[]);for(let G=0;G0&&o&&o.length>0&&o.includes(this.renderingRule.functionName)?d[o.indexOf(this.renderingRule.functionName)]:s,L.toLowerCase()==="nodata"&&!a)continue;const V="Raster.ItemPixelValue",Y="Raster.ServicePixelValue";O.attributes[V]=L,O.attributes[Y]=N,this._updateFeatureWithMagDirValues(O,L);const X=this.fields&&this.fields.length>0;let te=this.renderingRule&&ye(this.serviceRasterInfo.attributeTable)?X?L:s:N;this.renderingRule||(te=X?L:s),this._updateFeatureWithRasterAttributeTableValues(O,te)}if(O.sourceLayer=O.layer=this,l&&this._updateFeatureWithDomainValues(O),o&&d&&o.length===d.length)for(let V=0;Vp.name).filter(p=>p.toLowerCase()==="value"),c=l&&l[0];if(!c)return;const d=o.filter(p=>p.attributes[c]===(n!=null?parseInt(n,10):null));d&&d[0]&&a.forEach(p=>{const y=this._rasterAttributeTableFieldPrefix+p.name;r.attributes[y]=d[0].attributes[p.name]})}_updateFeatureWithMagDirValues(r,n){if(!this._isVectorDataSet())return;const s=n.split(/,\s*/).map(d=>parseFloat(d)),o=s.map(d=>[d]),a=s.map(d=>({minValue:d,maxValue:d,noDataValue:null})),l=new en({height:1,width:1,pixelType:"f32",pixels:o,statistics:a});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:l,extent:new vr(0,0,0,0,this.spatialReference)});const c=this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"?[l.pixels[0][0],l.pixels[1][0]]:uae([l.pixels[0][0],l.pixels[1][0]]);r.attributes["Raster.Magnitude"]=c[0],r.attributes["Raster.Direction"]=c[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;lt(s)||r.forEach(o=>{if(o&&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}_hasRenderingRule(r){return r!=null&&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().replace(/ /gi,"_");return n.has(s)?n.get(s):r}_isRFTJson(r){return r&&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,renderingRule:o}=this;o&&r.renderingRule==null&&(r.renderingRule=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"),c=r.serviceDataType==="esriImageServiceDataTypeElevation",d=!!(r.spatialReference||r.extent&&r.extent.spatialReference),p=n.includes("edit"),y=n.includes("mensuration")&&d,v=r.mensurationCapabilities==null?[]:r.mensurationCapabilities.toLowerCase().split(",").map(I=>I.trim()),S=y&&v.includes("basic");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:l,supportsExportImage:l,supportsIdentify:l,supportsMeasure:y,supportsDownload:n.includes("download"),supportsQuery:n.includes("catalog")&&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&&c,supportsComputePixelLocation:s>=10.7&&n.includes("catalog"),supportsComputeAngles:s>=10.91,supportsAdd:p,supportsDelete:p,supportsEditing:p,supportsUpdate:p,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryTopFeatures:!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,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:S,supportsAreaAndPerimeter:S,supportsPointOrCentroid:S,supportsHeightFromBaseAndTop:y&&v.includes("base-top height"),supportsHeightFromBaseAndTopShadow:y&&v.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:y&&v.includes("top-top shadow height"),supports3D:y&&v.includes("3d")}}}};function i(r){return r?.path??""}return E([k()],e.prototype,"_functionRasterInfos",void 0),E([k()],e.prototype,"_rasterJobHandler",void 0),E([k()],e.prototype,"_cachedRendererJson",void 0),E([k({readOnly:!0})],e.prototype,"_serviceSupportsMosaicRule",void 0),E([Li("_serviceSupportsMosaicRule",["currentVersion","fields"])],e.prototype,"readServiceSupportsMosaicRule",null),E([k()],e.prototype,"_rasterAttributeTableFieldPrefix",void 0),E([k({readOnly:!0})],e.prototype,"_rasterFunctionNamesIndex",null),E([k()],e.prototype,"adjustAspectRatio",void 0),E([k({type:[xs],json:{write:!0}})],e.prototype,"bandIds",void 0),E([Li("bandIds")],e.prototype,"readBandIds",null),E([k({readOnly:!0,json:{read:!1}})],e.prototype,"capabilities",void 0),E([Li("service","capabilities",["capabilities","currentVersion","serviceDataType"])],e.prototype,"readCapabilities",null),E([k({type:Number})],e.prototype,"compressionQuality",void 0),E([mr("compressionQuality")],e.prototype,"writeCompressionQuality",null),E([k({type:Number})],e.prototype,"compressionTolerance",void 0),E([mr("compressionTolerance")],e.prototype,"writeCompressionTolerance",null),E([k({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),E([k({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],e.prototype,"defaultMosaicRule",void 0),E([Li("defaultMosaicRule",["defaultMosaicMethod"])],e.prototype,"readDefaultMosaicRule",null),E([k({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],e.prototype,"definitionExpression",void 0),E([k({readOnly:!0,constructOnly:!0})],e.prototype,"exportImageServiceParameters",void 0),E([k()],e.prototype,"rasterInfo",void 0),E([k({readOnly:!0,type:[Bo]})],e.prototype,"fields",void 0),E([k({readOnly:!0})],e.prototype,"fieldsIndex",null),E([k({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],e.prototype,"format",null),E([Li("service","format",["serviceDataType"])],e.prototype,"readFormat",null),E([k({type:vr})],e.prototype,"fullExtent",void 0),E([k({readOnly:!0})],e.prototype,"hasMultidimensions",void 0),E([k({json:{read:{source:"maxImageHeight"}}})],e.prototype,"imageMaxHeight",void 0),E([k({json:{read:{source:"maxImageWidth"}}})],e.prototype,"imageMaxWidth",void 0),E([k({type:String,json:{type:GA.jsonValues,read:GA.read,write:GA.write}})],e.prototype,"interpolation",void 0),E([k()],e.prototype,"minScale",void 0),E([Li("service","minScale")],e.prototype,"readMinScale",null),E([k()],e.prototype,"maxScale",void 0),E([Li("service","maxScale")],e.prototype,"readMaxScale",null),E([k({type:H1})],e.prototype,"mosaicRule",null),E([Li("mosaicRule",["mosaicRule","defaultMosaicMethod"])],e.prototype,"readMosaicRule",null),E([mr("mosaicRule")],e.prototype,"writeMosaicRule",null),E([k()],e.prototype,"multidimensionalInfo",void 0),E([k({type:wKe,json:{write:!0}})],e.prototype,"multidimensionalSubset",void 0),E([k({json:{type:xs}})],e.prototype,"noData",void 0),E([mr("noData")],e.prototype,"writeNoData",null),E([k({type:String,json:{type:hY.jsonValues,read:hY.read,write:hY.write}})],e.prototype,"noDataInterpretation",void 0),E([k({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],e.prototype,"objectIdField",void 0),E([Li("objectIdField")],e.prototype,"readObjectIdField",null),E([k({})],e.prototype,"geometryType",void 0),E([k({})],e.prototype,"typeIdField",void 0),E([k({})],e.prototype,"types",void 0),E([k({readOnly:!0})],e.prototype,"parsedUrl",null),E([k({type:Function})],e.prototype,"pixelFilter",void 0),E([k()],e.prototype,"raster",void 0),E([k({readOnly:!0})],e.prototype,"sourceType",void 0),E([Li("sourceType",["serviceSourceType","fields"])],e.prototype,"readSourceType",null),E([k()],e.prototype,"viewId",void 0),E([k({types:lY,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:mae,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:r=>({enabled:r&&r.type!=="vector-field"&&r.type!=="flow"})}}}}})],e.prototype,"renderer",null),E([Li("renderer")],e.prototype,"readRenderer",null),E([mr("renderer")],e.prototype,"writeRenderer",null),E([k()],e.prototype,"symbolizer",void 0),E([k(Tq)],e.prototype,"opacity",void 0),E([k({readOnly:!0})],e.prototype,"rasterFields",null),E([k({constructOnly:!0})],e.prototype,"rasterFunctionInfos",void 0),E([k({type:ru})],e.prototype,"renderingRule",null),E([Li("renderingRule",["renderingRule","rasterFunctionInfos"])],e.prototype,"readRenderingRule",null),E([mr("renderingRule")],e.prototype,"writeRenderingRule",null),E([k()],e.prototype,"serviceDataType",void 0),E([k({readOnly:!0,type:rr})],e.prototype,"spatialReference",void 0),E([Li("spatialReference",["spatialReference","extent"])],e.prototype,"readSpatialReference",null),E([k({json:{type:VTe.jsonValues}})],e.prototype,"pixelType",void 0),E([Li("pixelType")],e.prototype,"readPixelType",null),E([mr("pixelType")],e.prototype,"writePixelType",null),E([k({constructOnly:!0,type:R2})],e.prototype,"serviceRasterInfo",void 0),E([k()],e.prototype,"sourceJSON",void 0),E([k(Zy)],e.prototype,"url",void 0),E([k({readOnly:!0})],e.prototype,"version",void 0),E([Li("version",["currentVersion","fields","timeInfo"])],e.prototype,"readVersion",null),e=E([ht("esri.layers.mixins.ArcGISImageService")],e),e};let pw=class extends ip(iT(bh(jc(_h(EZt(n0(v2(Qv($u(iu)))))))))){constructor(...e){super(...e),this.legendEnabled=!0,this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery"}normalizeCtorArgs(e,i){return typeof e=="string"?{url:e,...i}:e}load(e){const i=ye(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(Ga).then(()=>this._fetchService(i))),Promise.resolve(this)}writeOperationalLayerType(e,i,r){const n=this.renderer?.type==="vector-field";i[r]=n?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const i=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 l of i){const c=l.name.toLowerCase();a.has(c)||c.includes("raster.servicepixelvalue.")||n.add(l.name)}return o&&n.add("raster.magnitude").add("raster.direction"),G1({fields:i,title:r},{...e,visibleFieldNames:n})}queryFeatures(e,i){return this.queryRasters(e,i).then(r=>{if(r?.features)for(const n of r.features)n.layer=n.sourceLayer=this;return r})}queryFeatureCount(e,i){return this.queryRasterCount(e,i)}redraw(){this.emit("redraw")}serviceSupportsSpatialReference(e){return Xoe(this,e)}};E([k(N1)],pw.prototype,"legendEnabled",void 0),E([k({type:["show","hide"]})],pw.prototype,"listMode",void 0),E([k({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],pw.prototype,"isReference",void 0),E([k({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],pw.prototype,"operationalLayerType",void 0),E([mr("web-map","operationalLayerType")],pw.prototype,"writeOperationalLayerType",null),E([k(t_)],pw.prototype,"popupEnabled",void 0),E([k({type:yh,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],pw.prototype,"popupTemplate",void 0),E([k({readOnly:!0})],pw.prototype,"defaultPopupTemplate",null),E([k({readOnly:!0,json:{read:!1}})],pw.prototype,"type",void 0),pw=E([ht("esri.layers.ImageryLayer")],pw);const IZt=Object.freeze(Object.defineProperty({__proto__:null,default:pw},Symbol.toStringTag,{value:"Module"})),JJe=96;function Bae(t,e){const i=e||t.extent,r=t.width,n=Vc(i&&i.spatialReference);return i&&r?i.width/r*n*KVe*JJe:0}function AZt(t,e){return t/(Vc(e)*KVe*JJe)}let Y5=class{constructor(e,i,r=""){this.major=e,this.minor=i,this._context=r}lessThan(e,i){return this.major{let e=class extends t{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesPromise=null,this._allLayersAndTablesMap=null}readCapabilities(i,r){const n=r.capabilities&&r.capabilities.split(",").map(N=>N.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"),c=!!r.exportTilesAllowed,d=n.includes("tilemap"),p=n.includes("data"),y=s!=="tile"&&(!r.tileInfo||o),v=s!=="tile"&&(!r.tileInfo||o),S=s!=="tile",I=r.cimVersion&&Y5.parse(r.cimVersion),O=I?.since(1,4)??!1,L=I?.since(2,0)??!1;return{operations:{supportsExportMap:l,supportsExportTiles:c,supportsIdentify:a,supportsQuery:p,supportsTileMap:d},exportMap:l?{supportsArcadeExpressionForLabeling:O,supportsSublayersChanges:S,supportsDynamicLayers:o,supportsSublayerVisibility:y,supportsSublayerDefinitionExpression:v,supportsCIMSymbols:L}:null,exportTiles:c?{maxExportTilesCount:+r.maxExportTilesCount}:null}}readVersion(i,r){let n=r.currentVersion;return n||(n=r.hasOwnProperty("capabilities")||r.hasOwnProperty("tables")?10:r.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),n}async fetchSublayerInfo(i,r){try{return await this.fetchAllLayersAndTables(r),this._allLayersAndTablesMap?.get(i)}catch{return}}async fetchAllLayersAndTables(i){await this.load(i),this._allLayersAndTablesPromise||(this._allLayersAndTablesPromise=ir(sa(this.url).path+"/layers",{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(n=>{this._allLayersAndTablesMap=new Map;for(const s of n.data.layers)this._allLayersAndTablesMap.set(s.id,s);return{result:n.data}},n=>({error:n})));const r=await this._allLayersAndTablesPromise;if(sn(i),"result"in r)return r.result;throw r.error}};return E([k({readOnly:!0})],e.prototype,"capabilities",void 0),E([Li("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],e.prototype,"readCapabilities",null),E([k({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),E([k({type:vr})],e.prototype,"fullExtent",void 0),E([k(z9)],e.prototype,"id",void 0),E([k({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],e.prototype,"legendEnabled",void 0),E([k(t_)],e.prototype,"popupEnabled",void 0),E([k({type:rr})],e.prototype,"spatialReference",void 0),E([k({readOnly:!0})],e.prototype,"version",void 0),E([Li("version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],e.prototype,"readVersion",null),e=E([ht("esri.layers.mixins.ArcGISMapService")],e),e};let LB=class extends fr{constructor(e){super(e),this.getCollections=null}initialize(){this.own(WGe(()=>this._refresh()))}destroy(){this.getCollections=null}_refresh(){const e=ye(this.getCollections)?this.getCollections():null;if(lt(e))return void this.removeAll();let i=0;for(const r of e)ye(r)&&(i=this._processCollection(i,r));this.splice(i,this.length)}_createNewInstance(e){return new fr(e)}_processCollection(e,i){if(!i)return e;const r=this.itemFilterFunction?this.itemFilterFunction:n=>!!n;for(const n of i)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}};E([k()],LB.prototype,"getCollections",void 0),E([k()],LB.prototype,"getChildrenFunction",void 0),E([k()],LB.prototype,"itemFilterFunction",void 0),LB=E([ht("esri.core.CollectionFlattener")],LB);const k2=LB;async function PZt(t,e,i){const r=sh(t);return AJe(r,Ss.from(e),{...i}).then(n=>({count:n.data.count,extent:vr.fromJSON(n.data.extent)}))}function OZt(t,e){return e}function UTe(t,e,i,r){switch(i){case 0:return wY(t,e+r,0);case 1:return t.originPosition==="lowerLeft"?wY(t,e+r,1):DZt(t,e+r,1)}}function QJe(t,e,i,r){return i===2?wY(t,e,2):UTe(t,e,i,r)}function RZt(t,e,i,r){return i===2?wY(t,e,3):UTe(t,e,i,r)}function MZt(t,e,i,r){return i===3?wY(t,e,3):QJe(t,e,i,r)}function wY({translate:t,scale:e},i,r){return t[r]+i*e[r]}function DZt({translate:t,scale:e},i,r){return t[r]-i*e[r]}let FZt=class{constructor(e){this._options=e,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=OZt,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const i=k9(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(!lt(i))for(const r of e.features)i(r.geometry)}createSpatialReference(){return{}}addField(e,i){const r=e.fields;ig(r),r.push(i);const n=r.map(s=>s.name);this._attributesConstructor=function(){for(const s of n)this[s]=null}}addFeature(e,i){e.features.push(i)}prepareFeatures(e){switch(this._transform=e.transform,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"esriGeometryPoint":this.addCoordinate=(i,r,n)=>this.addCoordinatePoint(i,r,n),this.createGeometry=i=>this.createPointGeometry(i);break;case"esriGeometryPolygon":this.addCoordinate=(i,r,n)=>this._addCoordinatePolygon(i,r,n),this.createGeometry=i=>this._createPolygonGeometry(i);break;case"esriGeometryPolyline":this.addCoordinate=(i,r,n)=>this._addCoordinatePolyline(i,r,n),this.createGeometry=i=>this._createPolylineGeometry(i);break;case"esriGeometryMultipoint":this.addCoordinate=(i,r,n)=>this._addCoordinateMultipoint(i,r,n),this.createGeometry=i=>this._createMultipointGeometry(i)}}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,i,r){this._lengths.length===0&&(this._toAddInCurrentPath=i),this._lengths.push(i)}addQueryGeometry(e,i){const{queryGeometry:r,queryGeometryType:n}=i,s=DB(r.clone(),r,!1,!1,this._transform),o=cw(s,n,!1,!1);e.queryGeometryType=n,e.queryGeometry={...o}}createPointGeometry(e){const i={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(i.z=0),e.hasM&&(i.m=0),i}addCoordinatePoint(e,i,r){const n=_u(this._transform,"transform");switch(i=this._applyTransform(n,i,r,0),r){case 0:e.x=i;break;case 1:e.y=i;break;case 2:"z"in e?e.z=i:e.m=i;break;case 3:e.m=i}}_transformPathLikeValue(e,i){let r=0;i<=1&&(r=this._previousCoordinate[i],this._previousCoordinate[i]+=e);const n=_u(this._transform,"transform");return this._applyTransform(n,e,i,r)}_addCoordinatePolyline(e,i,r){this._dehydratedAddPointsCoordinate(e.paths,i,r)}_addCoordinatePolygon(e,i,r){this._dehydratedAddPointsCoordinate(e.rings,i,r)}_addCoordinateMultipoint(e,i,r){r===0&&e.points.push([]);const n=this._transformPathLikeValue(i,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,i,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(i,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:i,hasM:r}=e;return i&&r?MZt:i?QJe:r?RZt:UTe}};async function LZt(t,e,i){const r=sh(t),n={...i},s=Ss.from(e),o=!s.quantizationParameters,{data:a}=await pTe(r,s,new FZt({sourceSpatialReference:s.sourceSpatialReference,applyTransform:o}),n);return a}let fw=class extends fn{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 sa(this.url)}async execute(e,i){const r=await this.executeJSON(e,i);return this.featureSetFromJSON(e,r,i)}async executeJSON(e,i){const r=this._normalizeQuery(e),n=e.outStatistics?.[0]!=null,s=Gi("featurelayer-pbf-statistics"),o=!n||s;let a;if(this.pbfSupported&&o)try{a=await LZt(this.url,r,i)}catch(l){if(l.name!=="query:parsing-pbf")throw l;this.pbfSupported=!1}return this.pbfSupported&&o||(a=await PJe(this.url,r,i)),this._normalizeFields(a.fields),a}async featureSetFromJSON(e,i,r){if(!this._queryIs3DObjectFormat(e)||lt(this.infoFor3D)||!i.assetMaps||!i.features||!i.features.length)return Wu.fromJSON(i);const{meshFeatureSetFromJSON:n}=await Vg(Promise.resolve().then(()=>FVi),r);return n(e,this.infoFor3D,i)}executeForCount(e,i){return OTe(this.url,this._normalizeQuery(e),i)}executeForExtent(e,i){return PZt(this.url,this._normalizeQuery(e),i)}executeForIds(e,i){return $ae(this.url,this._normalizeQuery(e),i)}async executeRelationshipQuery(e,i){const[{default:r},{executeRelationshipQuery:n}]=await Vg(Promise.all([Promise.resolve().then(()=>Xqe),Promise.resolve().then(()=>YZe)]),i);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,i)}async executeRelationshipQueryForCount(e,i){const[{default:r},{executeRelationshipQueryForCount:n}]=await Vg(Promise.all([Promise.resolve().then(()=>Xqe),Promise.resolve().then(()=>YZe)]),i);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,i)}async executeAttachmentQuery(e,i){const{executeAttachmentQuery:r,fetchAttachments:n,processAttachmentQueryResult:s}=await Vg(Promise.resolve().then(()=>IQt),i),o=sh(this.url);return s(o,await(this.queryAttachmentsSupported?r(o,e,i):n(o,e,i)))}async executeTopFeaturesQuery(e,i){const{executeTopFeaturesQuery:r}=await Vg(Promise.resolve().then(()=>BQt),i);return r(this.parsedUrl,e,this.sourceSpatialReference,i)}async executeForTopIds(e,i){const{executeForTopIds:r}=await Vg(Promise.resolve().then(()=>VQt),i);return r(this.parsedUrl,e,i)}async executeForTopExtents(e,i){const{executeForTopExtents:r}=await Vg(Promise.resolve().then(()=>jQt),i);return r(this.parsedUrl,e,i)}async executeForTopCount(e,i){const{executeForTopCount:r}=await Vg(Promise.resolve().then(()=>HQt),i);return r(this.parsedUrl,e,i)}_normalizeQuery(e){let i=Ss.from(e);if(i.sourceSpatialReference=i.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(i=i===e?i.clone():i,i.gdbVersion=e.gdbVersion||this.gdbVersion,i.dynamicDataSource=e.dynamicDataSource?Q0.from(e.dynamicDataSource):this.dynamicDataSource),ye(this.infoFor3D)&&this._queryIs3DObjectFormat(e)){i=i===e?i.clone():i,i.formatOf3DObjects=null;for(const r of this.infoFor3D.queryFormats){if(r==="3D_glb"){i.formatOf3DObjects=r;break}r!=="3D_gltf"||i.formatOf3DObjects||(i.formatOf3DObjects=r)}if(!i.formatOf3DObjects)throw new st("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(lt(i.outFields)||!i.outFields.includes("*")){i=i===e?i.clone():i,lt(i.outFields)&&(i.outFields=[]);const{originX:r,originY:n,originZ:s,translationX:o,translationY:a,translationZ:l,scaleX:c,scaleY:d,scaleZ:p,rotationX:y,rotationY:v,rotationZ:S,rotationDeg:I}=this.infoFor3D.transformFieldRoles;i.outFields.push(r,n,s,o,a,l,c,d,p,y,v,S,I)}}return i}_normalizeFields(e){if(ye(this.fieldsIndex)&&ye(e))for(const i of e){const r=this.fieldsIndex.get(i.name);r&&Object.assign(i,r.toJSON())}}_queryIs3DObjectFormat(e){return ye(this.infoFor3D)&&e.returnGeometry===!0&&e.multipatchOption!=="xyFootprint"&&!e.outStatistics}};E([k({type:Q0})],fw.prototype,"dynamicDataSource",void 0),E([k()],fw.prototype,"fieldsIndex",void 0),E([k()],fw.prototype,"gdbVersion",void 0),E([k()],fw.prototype,"infoFor3D",void 0),E([k({readOnly:!0})],fw.prototype,"parsedUrl",null),E([k()],fw.prototype,"pbfSupported",void 0),E([k()],fw.prototype,"queryAttachmentsSupported",void 0),E([k()],fw.prototype,"sourceSpatialReference",void 0),E([k({type:String})],fw.prototype,"url",void 0),fw=E([ht("esri.tasks.QueryTask")],fw);const eZe=fw;var Gae;function jTe(t){return t!=null&&t.type==="esriSMS"}function zTe(t,e,i){const r=this.originIdOf(e)>=Gg(i.origin);return{ignoreOrigin:!0,allowNull:r,enabled:!!i&&i.layer?.type==="map-image"&&(i.writeSublayerStructure||r)}}function tZe(t,e,i){return{enabled:!!i&&i.layer?.type==="tile"&&this._isOverridden(e)}}function mw(t,e,i){return{ignoreOrigin:!0,enabled:i&&i.writeSublayerStructure||!1}}function Vae(t,e,i){return{ignoreOrigin:!0,enabled:!!i&&(i.writeSublayerStructure||this.originIdOf(e)>=Gg(i.origin))}}let kZt=0;const X5=new Set;X5.add("layer"),X5.add("parent"),X5.add("loaded"),X5.add("loadStatus"),X5.add("loadError"),X5.add("loadWarnings");let oa=Gae=class extends Nd($u(R1(hd))){constructor(t){super(t),this.capabilities=void 0,this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.legendEnabled=!0,this.objectIdField=null,this.popupEnabled=!0,this.popupTemplate=null,this.sourceJSON=null,this.title=null,this.typeIdField=null,this.types=null,this._lastParsedUrl=null}async load(t){return this.addResolvingPromise((async()=>{const{layer:e,source:i,url:r}=this;if(!e&&!r)throw new st("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});let n=null;if(!e||this.originIdOf("url")>Fn.SERVICE||i?.type==="data-layer")n=(await ir(r,{responseType:"json",query:{f:"json"},...t})).data;else{let s=this.id;i?.type==="map-layer"&&(s=i.mapLayerId),n=await e.fetchSublayerInfo(s,t)}n&&(this.sourceJSON=n,this.read({layerDefinition:n},{origin:"service"}))})()),this}readCapabilities(t,e){e=e.layerDefinition||e;const{operations:{supportsQuery:i,supportsQueryAttachments:r},query:{supportsFormatPBF:n},data:{supportsAttachment:s}}=cSe(e,this.url);return{exportMap:{supportsModification:!!e.canModifyLayer},operations:{supportsQuery:i,supportsQueryAttachments:r},data:{supportsAttachment:s},query:{supportsFormatPBF:n}}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(t){this._setAndNotifyLayer("definitionExpression",t)}get fieldsIndex(){return new Am(this.fields||[])}set floorInfo(t){this._setAndNotifyLayer("floorInfo",t)}readGlobalIdFieldFromService(t,e){if((e=e.layerDefinition||e).globalIdField)return e.globalIdField;if(e.fields){for(const i of e.fields)if(i.type==="esriFieldTypeGlobalID")return i.name}}get id(){return this._get("id")??kZt++}set id(t){this._get("id")!==t&&(this.layer?.capabilities?.exportMap?.supportsDynamicLayers!==!1?this._set("id",t):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}set labelingInfo(t){this._setAndNotifyLayer("labelingInfo",t)}writeLabelingInfo(t,e,i,r){t&&t.length&&(e.layerDefinition={drawingInfo:{labelingInfo:t.map(n=>n.write({},r))}})}set labelsVisible(t){this._setAndNotifyLayer("labelsVisible",t)}set layer(t){this._set("layer",t),this.sublayers&&this.sublayers.forEach(e=>e.layer=t)}set listMode(t){this._set("listMode",t)}set minScale(t){this._setAndNotifyLayer("minScale",t)}readMinScale(t,e){return e.minScale||e.layerDefinition&&e.layerDefinition.minScale||0}set maxScale(t){this._setAndNotifyLayer("maxScale",t)}readMaxScale(t,e){return e.maxScale||e.layerDefinition&&e.layerDefinition.maxScale||0}get effectiveScaleRange(){const{minScale:t,maxScale:e}=this;return{minScale:t,maxScale:e}}readObjectIdFieldFromService(t,e){if((e=e.layerDefinition||e).objectIdField)return e.objectIdField;if(e.fields){for(const i of e.fields)if(i.type==="esriFieldTypeOID")return i.name}}set opacity(t){this._setAndNotifyLayer("opacity",t)}readOpacity(t,e){const i=e.layerDefinition;return 1-.01*((i?.transparency!=null?i.transparency:i?.drawingInfo?.transparency)??0)}writeOpacity(t,e,i,r){e.layerDefinition={drawingInfo:{transparency:100-100*t}}}writeParent(t,e){this.parent&&this.parent!==this.layer?e.parentLayerId=qre(this.parent.id):e.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{spatialReference:t}=this.layer,e="gdbVersion"in this.layer?this.layer.gdbVersion:void 0,{capabilities:i,fieldsIndex:r}=this,n=Gi("featurelayer-pbf")&&i?.query.supportsFormatPBF,s=i?.operations?.supportsQueryAttachments??!1;return new eZe({url:this.url,pbfSupported:n,fieldsIndex:r,gdbVersion:e,sourceSpatialReference:t,queryAttachmentsSupported:s})}set renderer(t){if(t){for(const e of t.getSymbols())if(_R(e)){Ei.getLogger(this.declaredClass).warn("Sublayer renderer should use 2D symbols");break}}this._setAndNotifyLayer("renderer",t)}get source(){return this._get("source")||new TA({mapLayerId:this.id})}set source(t){this._setAndNotifyLayer("source",t)}set sublayers(t){this._handleSublayersChange(t,this._get("sublayers")),this._set("sublayers",t)}castSublayers(t){return ud(fr.ofType(Gae),t)}writeSublayers(t,e,i){this.sublayers?.length&&(e[i]=this.sublayers.map(r=>r.id).toArray().reverse())}readTypeIdField(t,e){let i=(e=e.layerDefinition||e).typeIdField;if(i&&e.fields){i=i.toLowerCase();const r=e.fields.find(n=>n.name.toLowerCase()===i);r&&(i=r.name)}return i}get url(){const t=this.layer?.parsedUrl??this._lastParsedUrl,e=this.source;if(!t)return null;if(this._lastParsedUrl=t,e?.type==="map-layer")return`${t.path}/${e.mapLayerId}`;const i={layer:JSON.stringify({source:this.source})};return`${t.path}/dynamicLayer?${Uv(i)}`}set url(t){this._overrideIfSome("url",t)}set visible(t){this._setAndNotifyLayer("visible",t)}writeVisible(t,e,i,r){e[i]=this.getAtOrigin("defaultVisibility","service")||t}clone(){const{store:t}=Tp(this),e=new Gae;return Tp(e).store=t.clone(X5),this.commitProperty("url"),e._lastParsedUrl=this._lastParsedUrl,e}createPopupTemplate(t){return G1(this,t)}createQuery(){return new Ss({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const{layer:t}=this,e=t?.parsedUrl,i=new(await Promise.resolve().then(()=>nCe)).default({url:e?.path});return e&&this.source&&(this.source.type==="map-layer"?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source),t?.refreshInterval!=null&&(i.refreshInterval=t.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=hi(this.floorInfo)),this.originIdOf("labelingInfo")>Fn.SERVICE&&(i.labelingInfo=hi(this.labelingInfo)),this.originIdOf("labelsVisible")>Fn.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>Fn.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>Fn.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>Fn.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>Fn.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>Fn.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>Fn.DEFAULTS&&(i.popupTemplate=hi(this.popupTemplate)),this.originIdOf("renderer")>Fn.SERVICE&&(i.renderer=hi(this.renderer)),this.source?.type==="data-layer"&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>Fn.DEFAULTS&&(i.title=this.title),t?.type==="map-image"&&t.originIdOf("customParameters")>Fn.DEFAULTS&&(i.customParameters=t.customParameters),t?.type==="tile"&&t.originIdOf("customParameters")>Fn.DEFAULTS&&(i.customParameters=t.customParameters),i}getField(t){return this.fieldsIndex.get(t)}getFeatureType(t){const{typeIdField:e,types:i}=this;if(!e||!t)return null;const r=t.attributes?t.attributes[e]:void 0;if(r==null)return null;let n=null;return i?.some(s=>{const{id:o}=s;return o!=null&&(o.toString()===r.toString()&&(n=s),!!n)}),n}getFieldDomain(t,e){const i=e&&e.feature,r=this.getFeatureType(i);if(r){const n=r.domains&&r.domains[t];if(n&&n.type!=="inherited")return n}return this._getLayerDomain(t)}async queryAttachments(t,e){await this.load(),t=Aoe.from(t);const i=this.capabilities;if(!i?.data?.supportsAttachment)throw new st("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:r,objectIds:n,globalIds:s,num:o,size:a,start:l,where:c}=t;if(!i?.operations?.supportsQueryAttachments&&(r?.length>0||s?.length>0||a?.length>0||o||l||c))throw new st("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",t);if(!(n?.length||s?.length||c))throw new st("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",t);return this.queryTask.executeAttachmentQuery(t,e)}async queryFeatures(t=this.createQuery(),e){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new st("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new st("queryFeatures:not-supported","this layer has no url.");const i=await this.queryTask.execute(t,{...e,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(i?.features)for(const r of i.features)r.sourceLayer=this;return i}toExportImageJSON(t){const e={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},i=OR(t,this.definitionExpression);ye(i)&&(e.definitionExpression=i);const r=["renderer","labelingInfo","opacity","labelsVisible"].reduce((s,o)=>(s[o]=this.originIdOf(o),s),{});if(Object.keys(r).some(s=>r[s]>Fn.SERVICE)){const s=e.drawingInfo={};if(r.renderer>Fn.SERVICE&&(s.renderer=this.renderer?this.renderer.toJSON():null),r.labelsVisible>Fn.SERVICE&&(s.showLabels=this.labelsVisible),this.labelsVisible&&r.labelingInfo>Fn.SERVICE){!this.loaded&&this.labelingInfo.some(a=>!a.labelPlacement)&&Ei.getLogger(this.declaredClass).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;ye(this.geometryType)&&(o=ZSe(this.labelingInfo,qy.toJSON(this.geometryType))),s.labelingInfo=o.filter(a=>a.labelPlacement).map(a=>a.toJSON({origin:"service",layer:this.layer})),s.showLabels=!0}r.opacity>Fn.SERVICE&&(s.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(s.renderer)}return e}_assignDefaultSymbolColors(t){this._forEachSimpleMarkerSymbols(t,e=>{e.color||e.style!=="esriSMSX"&&e.style!=="esriSMSCross"||(e.outline&&e.outline.color?e.color=e.outline.color:e.color=[0,0,0,0])})}_forEachSimpleMarkerSymbols(t,e){if(t){const i=("uniqueValueInfos"in t?t.uniqueValueInfos:"classBreakInfos"in t?t.classBreakInfos:null)??[];for(const r of i)jTe(r.symbol)&&e(r.symbol);"symbol"in t&&jTe(t.symbol)&&e(t.symbol),"defaultSymbol"in t&&jTe(t.defaultSymbol)&&e(t.defaultSymbol)}}_setAndNotifyLayer(t,e){const i=this.layer,r=this._get(t);let n,s;switch(t){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=Tp(this).getDefaultOrigin();if(o!=="service"){if(n&&this.layer?.capabilities?.exportMap?.[n]===!1)return void this._logLockedError(t,`capability not available 'layer.capabilities.exportMap.${n}'`);if(s&&this.capabilities?.exportMap[s]===!1)return void this._logLockedError(t,`capability not available 'capabilities.exportMap.${s}'`)}t!=="source"||this.loadStatus==="not-loaded"?(this._set(t,e),o!=="service"&&r!==e&&i&&i.emit&&i.emit("sublayer-update",{propertyName:t,target:this})):this._logLockedError(t,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(t,e){e&&(e.forEach(i=>{i.parent=null,i.layer=null}),this.handles.removeAll()),t&&(t.forEach(i=>{i.parent=this,i.layer=this.layer}),this.handles.add([t.on("after-add",({item:i})=>{i.parent=this,i.layer=this.layer}),t.on("after-remove",({item:i})=>{i.parent=null,i.layer=null}),t.on("before-changes",i=>{const r=this.layer?.capabilities?.exportMap?.supportsSublayersChanges;r==null||r||(Ei.getLogger(this.declaredClass).error(new st("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),i.preventDefault())})]))}_logLockedError(t,e){const{layer:i,declaredClass:r}=this;Ei.getLogger(r).error(new st("sublayer:locked",`Property '${String(t)}' can't be changed on Sublayer from the layer '${i?.id}'`,{reason:e,sublayer:this,layer:i}))}_getLayerDomain(t){const e=this.fieldsIndex.get(t);return e?e.domain:null}};oa.test={isMapImageLayerOverridePolicy:t=>t===mw||t===zTe,isTileImageLayerOverridePolicy:t=>t===tZe},E([k({readOnly:!0})],oa.prototype,"capabilities",void 0),E([Li("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],oa.prototype,"readCapabilities",null),E([k()],oa.prototype,"defaultPopupTemplate",null),E([k({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:zTe}}})],oa.prototype,"definitionExpression",null),E([k({type:[Bo],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],oa.prototype,"fields",void 0),E([k({readOnly:!0})],oa.prototype,"fieldsIndex",null),E([k({type:uSe,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:zTe},origins:{"web-scene":{read:!1,write:!1}}}})],oa.prototype,"floorInfo",null),E([k({type:vr,json:{read:{source:"layerDefinition.extent"}}})],oa.prototype,"fullExtent",void 0),E([k({type:qy.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:qy.read}}}}})],oa.prototype,"geometryType",void 0),E([k({type:String})],oa.prototype,"globalIdField",void 0),E([Li("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],oa.prototype,"readGlobalIdFieldFromService",null),E([k({type:xs,json:{write:{ignoreOrigin:!0}}})],oa.prototype,"id",null),E([k({value:null,type:[I2],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:mw}}})],oa.prototype,"labelingInfo",null),E([mr("labelingInfo")],oa.prototype,"writeLabelingInfo",null),E([k({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:mw}}})],oa.prototype,"labelsVisible",null),E([k({value:null})],oa.prototype,"layer",null),E([k({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:Vae}}})],oa.prototype,"legendEnabled",void 0),E([k({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],oa.prototype,"listMode",null),E([k({type:Number,value:0,json:{write:{overridePolicy:mw}}})],oa.prototype,"minScale",null),E([Li("minScale",["minScale","layerDefinition.minScale"])],oa.prototype,"readMinScale",null),E([k({type:Number,value:0,json:{write:{overridePolicy:mw}}})],oa.prototype,"maxScale",null),E([Li("maxScale",["maxScale","layerDefinition.maxScale"])],oa.prototype,"readMaxScale",null),E([k({readOnly:!0})],oa.prototype,"effectiveScaleRange",null),E([k({type:String})],oa.prototype,"objectIdField",void 0),E([Li("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],oa.prototype,"readObjectIdFieldFromService",null),E([k({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:mw}}})],oa.prototype,"opacity",null),E([Li("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],oa.prototype,"readOpacity",null),E([mr("opacity")],oa.prototype,"writeOpacity",null),E([k({json:{type:xs,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:mw}}})],oa.prototype,"parent",void 0),E([mr("parent")],oa.prototype,"writeParent",null),E([k({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(t,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy:Vae,writer(t,e,i){e[i]=!t}}}})],oa.prototype,"popupEnabled",void 0),E([k({type:yh,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:Vae}}})],oa.prototype,"popupTemplate",void 0),E([k({readOnly:!0})],oa.prototype,"queryTask",null),E([k({types:_A,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:mw},origins:{"web-scene":{types:AR,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:mw}}}}})],oa.prototype,"renderer",null),E([k({types:{key:"type",base:null,typeMap:{"data-layer":Q0,"map-layer":TA}},cast(t){if(t){if("mapLayerId"in t)return kd(TA,t);if("dataSource"in t)return kd(Q0,t)}return t},json:{name:"layerDefinition.source",write:{overridePolicy:mw}}})],oa.prototype,"source",null),E([k()],oa.prototype,"sourceJSON",void 0),E([k({value:null,json:{type:[xs],write:{target:"subLayerIds",allowNull:!0,overridePolicy:mw}}})],oa.prototype,"sublayers",null),E([Zs("sublayers")],oa.prototype,"castSublayers",null),E([mr("sublayers")],oa.prototype,"writeSublayers",null),E([k({type:String,json:{name:"name",write:{overridePolicy:Vae}}})],oa.prototype,"title",void 0),E([k({type:String})],oa.prototype,"typeIdField",void 0),E([Li("typeIdField",["layerDefinition.typeIdField"])],oa.prototype,"readTypeIdField",null),E([k({type:[dB],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],oa.prototype,"types",void 0),E([k({type:String,json:{read:{source:"layerUrl"},write:{target:"layerUrl",overridePolicy:tZe}}})],oa.prototype,"url",null),E([k({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:mw}}})],oa.prototype,"visible",null),E([mr("visible")],oa.prototype,"writeVisible",null),oa=Gae=E([ht("esri.layers.support.Sublayer")],oa);const xY=oa;function iZe(t,e,i){return e.flatten(({sublayers:n})=>n).length!==t.length?!0:!!t.some(n=>n.originIdOf("minScale")>i||n.originIdOf("maxScale")>i||n.originIdOf("renderer")>i||n.originIdOf("labelingInfo")>i||n.originIdOf("opacity")>i||n.originIdOf("labelsVisible")>i||n.originIdOf("source")>i)||!nZe(t,e)}function rZe(t,e,i){return!!t.some(r=>{const n=r.source;return!(!n||n.type==="map-layer"&&n.mapLayerId===r.id&&(lt(n.gdbVersion)||n.gdbVersion===i))||r.originIdOf("renderer")>Fn.SERVICE||r.originIdOf("labelingInfo")>Fn.SERVICE||r.originIdOf("opacity")>Fn.SERVICE||r.originIdOf("labelsVisible")>Fn.SERVICE})||!nZe(t,e)}function nZe(t,e){if(!t||!t.length||lt(e))return!0;const i=e.slice().reverse().flatten(({sublayers:s})=>s&&s.toArray().reverse()).map(s=>s.id).toArray();if(t.length>i.length)return!1;let r=0;const n=i.length;for(const{id:s}of t){for(;r=n)return!1}return!0}function NZt(t){return!!t&&t.some(e=>e.minScale!=null||e.layerDefinition&&e.layerDefinition.minScale!=null)}const $Zt=Ei.getLogger("esri.layers.TileLayer");function BZt(t,e){const i=[],r={};return t&&t.forEach(n=>{const s=new xY;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 i.unshift(s)}),i}const HTe=fr.ofType(xY);function sZe(t,e){t&&t.forEach(i=>{e(i),i.sublayers&&i.sublayers.length&&sZe(i.sublayers,e)})}const oZe=t=>{let e=class extends t{constructor(...i){super(...i),this.allSublayers=new k2({getCollections:()=>[this.sublayers],getChildrenFunction:r=>r.sublayers}),this.sublayersSourceJSON={[Fn.SERVICE]:{},[Fn.PORTAL_ITEM]:{},[Fn.WEB_SCENE]:{},[Fn.WEB_MAP]:{}},this.addHandles(Qi(()=>this.sublayers,(r,n)=>this._handleSublayersChange(r,n),Nu))}readSublayers(i,r){if(!r||!i)return;const{sublayersSourceJSON:n}=this,s=Gg(r.origin);if(sFn.SERVICE))return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:o,origin:a}=this.createSublayersForOrigin("web-document"),l=Tp(this);l.setDefaultOrigin(a),this._set("sublayers",new HTe(o)),l.setDefaultOrigin("user")}findSublayerById(i){return this.allSublayers.find(r=>r.id===i)}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(i){const r=Gg(i==="web-document"?"web-map":i);let n=Fn.SERVICE,s=this.sublayersSourceJSON[Fn.SERVICE].layers,o=this.sublayersSourceJSON[Fn.SERVICE].context,a=null;const l=[Fn.PORTAL_ITEM,Fn.WEB_SCENE,Fn.WEB_MAP].filter(S=>S<=r);for(const S of l){const I=this.sublayersSourceJSON[S];NZt(I.layers)&&(n=S,s=I.layers,o=I.context,I.visibleLayers&&(a={visibleLayers:I.visibleLayers,context:I.context}))}const c=[Fn.PORTAL_ITEM,Fn.WEB_SCENE,Fn.WEB_MAP].filter(S=>S>n&&S<=r);let d=null;for(const S of c){const{layers:I,visibleLayers:O,context:L}=this.sublayersSourceJSON[S];I&&(d={layers:I,context:L}),O&&(a={visibleLayers:O,context:L})}const p=BZt(s,o),y=new Map,v=new Set;if(d)for(const S of d.layers)y.set(S.id,S);if(a?.visibleLayers)for(const S of a.visibleLayers)v.add(S);return sZe(p,S=>{d&&S.read(y.get(S.id),d.context),a&&S.read({defaultVisibility:v.has(S.id)},a.context)}),{origin:SH(n),sublayers:new HTe({items:p})}}read(i,r){super.read(i,r),this.readSublayers(i,r)}_handleSublayersChange(i,r){r&&(r.forEach(n=>{n.parent=null,n.layer=null}),this.handles.remove("sublayers-owner")),i&&(i.forEach(n=>{n.parent=this,n.layer=this}),this.handles.add([i.on("after-add",({item:n})=>{n.parent=this,n.layer=this}),i.on("after-remove",({item:n})=>{n.parent=null,n.layer=null})],"sublayers-owner"),this.type==="tile"&&this.handles.add(i.on("before-changes",n=>{$Zt.error(new st("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),n.preventDefault()}),"sublayers-owner"))}};return E([k({readOnly:!0})],e.prototype,"allSublayers",void 0),E([k({readOnly:!0,type:fr.ofType(xY)})],e.prototype,"serviceSublayers",void 0),E([k({value:null,type:HTe,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],e.prototype,"sublayers",void 0),E([k({readOnly:!0})],e.prototype,"sublayersSourceJSON",void 0),e=E([ht("esri.layers.mixins.SublayersOwner")],e),e};function aZe(t){const e=t.layer;return"floorInfo"in e&&e.floorInfo?.floorField&&"floors"in t.view?lZe(t.view.floors,e.floorInfo.floorField):null}function SY(t,e){return"floorInfo"in e&&e.floorInfo?.floorField?lZe(t,e.floorInfo.floorField):null}function lZe(t,e){if(!t?.length)return null;const i=t.filter(r=>r!=="").map(r=>`'${r}'`);return i.push("''"),`${e} IN (${i.join(",")}) OR ${e} IS NULL`}const GZt={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let l_=class extends Nd(fn){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(i=>{const r=SY(this.floors,i);return i.toExportImageJSON(r)});return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&rZe(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.handles.remove("layer"),e&&this.handles.add([e.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("sublayer-update",i=>this.notifyChange(GZt[i.propertyName]))],"layer"))}get layers(){const e=this.visibleSublayers;return e?e.length?"show:"+e.map(i=>i.id).join(","):"show:-1":null}get layerDefs(){const e=!!this.floors?.length,i=this.visibleSublayers.filter(r=>r.definitionExpression!=null||e&&r.floorInfo!=null);return i.length?JSON.stringify(i.reduce((r,n)=>{const s=SY(this.floors,n),o=OR(s,n.definitionExpression);return ye(o)&&(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 i=this.layer.sublayers,r=s=>{const o=this.scale,a=o===0,l=s.minScale===0||o<=s.minScale,c=s.maxScale===0||o>=s.maxScale;s.visible&&(a||l&&c)&&(s.sublayers?s.sublayers.forEach(r):e.unshift(s))};i&&i.forEach(r);const n=this._get("visibleSublayers");return!n||n.length!==e.length||n.some((s,o)=>e[o]!==s)?e:n}toJSON(){const e=this.layer;let i={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?i.dynamicLayers=this.dynamicLayers:i={...i,layers:this.layers,layerDefs:this.layerDefs},i}};E([k({readOnly:!0})],l_.prototype,"dynamicLayers",null),E([k()],l_.prototype,"floors",void 0),E([k({readOnly:!0})],l_.prototype,"hasDynamicLayers",null),E([k()],l_.prototype,"layer",null),E([k({readOnly:!0})],l_.prototype,"layers",null),E([k({readOnly:!0})],l_.prototype,"layerDefs",null),E([k({type:Number})],l_.prototype,"scale",void 0),E([k(j9)],l_.prototype,"timeExtent",void 0),E([k({readOnly:!0})],l_.prototype,"version",null),E([k({readOnly:!0})],l_.prototype,"visibleSublayers",null),l_=E([ht("esri.layers.mixins.ExportImageParameters")],l_);let np=class extends ip(iT(bh(oZe(ZJe(Qv(jc(_h($u(n0(g2(v2(Nd(iu))))))))))))){constructor(...e){super(...e),this.dateFieldsTimeReference=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.preferredTimeReference=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null}normalizeCtorArgs(e,i){return typeof e=="string"?{url:e,...i}:e}load(e){const i=ye(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(Ga).then(()=>this._fetchService(i))),Promise.resolve(this)}readImageFormat(e,i){const r=i.supportedImageFormatTypes;return r&&r.includes("PNG32")?"png32":"png24"}writeSublayers(e,i,r,n){if(!this.loaded||!e)return;const s=e.slice().reverse().flatten(({sublayers:d})=>d&&d.toArray().reverse()).toArray();let o=!1;if(this.capabilities&&this.capabilities.operations.supportsExportMap&&this.capabilities.exportMap?.supportsDynamicLayers){const d=Gg(n.origin);if(d===Fn.PORTAL_ITEM){const p=this.createSublayersForOrigin("service").sublayers;o=iZe(s,p,Fn.SERVICE)}else if(d>Fn.PORTAL_ITEM){const p=this.createSublayersForOrigin("portal-item");o=iZe(s,p.sublayers,Gg(p.origin))}}const a=[],l={writeSublayerStructure:o,...n};let c=o;s.forEach(d=>{const p=d.write({},l);a.push(p),c=c||d.originOf("visible")==="user"}),a.some(d=>Object.keys(d).length>1)&&(i.layers=a),c&&(i.visibleLayers=s.filter(d=>d.visible).map(d=>d.id))}createExportImageParameters(e,i,r,n){const s=n&&n.pixelRatio||1;e&&this.version>=10&&(e=e.clone().shiftCentralMeridian());const o=new l_({layer:this,floors:n?.floors,scale:Bae({extent:e,width:i})*s}),a=o.toJSON();o.destroy();const l=!n||!n.rotation||this.version<10.3?{}:{rotation:-n.rotation},c=e&&e.spatialReference,d=c.wkid||JSON.stringify(c.toJSON());a.dpi*=s;const p={};if(n?.timeExtent){const{start:y,end:v}=n.timeExtent.toJSON();p.time=y&&v&&y===v?""+y:`${y??"null"},${v??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(p.time="null,null");return{bbox:e&&e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:d,imageSR:d,size:i+","+r,...a,...l,...p}}async fetchImage(e,i,r,n){const{data:s}=await this._fetchImage("image",e,i,r,n);return s}async fetchImageBitmap(e,i,r,n){const{data:s,url:o}=await this._fetchImage("blob",e,i,r,n);return rM(s,o)}async fetchRecomputedExtents(e={}){const i={...e,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:r}=await ir(this.url,i),{extent:n,fullExtent:s,timeExtent:o}=r,a=n||s;return{fullExtent:a&&vr.fromJSON(a),timeExtent:o&&Wg.fromJSON({start:o[0],end:o[1]})}}loadAll(){return dL(this,e=>{e(this.allSublayers)})}serviceSupportsSpatialReference(e){return Xoe(this,e)}async _fetchImage(e,i,r,n,s){const o={responseType:e,signal:s?.signal??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(i,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 st("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 ir(a,o);return{data:l,url:a}}catch(l){throw ss(l)?l:new st("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:i,ssl:r}=await ir(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=i,this.read(i,{origin:"service",url:this.parsedUrl})}};E([k({type:GR})],np.prototype,"dateFieldsTimeReference",void 0),E([k({type:Boolean})],np.prototype,"datesInUnknownTimezone",void 0),E([k()],np.prototype,"dpi",void 0),E([k()],np.prototype,"gdbVersion",void 0),E([k()],np.prototype,"imageFormat",void 0),E([Li("imageFormat",["supportedImageFormatTypes"])],np.prototype,"readImageFormat",null),E([k({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],np.prototype,"imageMaxHeight",void 0),E([k({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],np.prototype,"imageMaxWidth",void 0),E([k()],np.prototype,"imageTransparency",void 0),E([k({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],np.prototype,"isReference",void 0),E([k({json:{read:!1,write:!1}})],np.prototype,"labelsVisible",void 0),E([k({type:["ArcGISMapServiceLayer"]})],np.prototype,"operationalLayerType",void 0),E([k({json:{read:!1,write:!1}})],np.prototype,"popupEnabled",void 0),E([k({type:GR})],np.prototype,"preferredTimeReference",void 0),E([k()],np.prototype,"sourceJSON",void 0),E([k({json:{write:{ignoreOrigin:!0}}})],np.prototype,"sublayers",void 0),E([mr("sublayers",{layers:{type:[xY]},visibleLayers:{type:[xs]}})],np.prototype,"writeSublayers",null),E([k({type:["show","hide","hide-children"]})],np.prototype,"listMode",void 0),E([k({json:{read:!1},readOnly:!0,value:"map-image"})],np.prototype,"type",void 0),E([k(Zy)],np.prototype,"url",void 0),np=E([ht("esri.layers.MapImageLayer")],np);const WTe=np,VZt=Object.freeze(Object.defineProperty({__proto__:null,default:WTe},Symbol.toStringTag,{value:"Module"}));var qTe;let cT=qTe=class extends Ni{constructor(t){super(t),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new qTe({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};E([k({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],cT.prototype,"cols",void 0),E([k({type:xs,json:{write:!0}})],cT.prototype,"level",void 0),E([k({type:String,json:{write:!0}})],cT.prototype,"levelValue",void 0),E([k({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],cT.prototype,"origin",void 0),E([k({type:Number,json:{write:!0}})],cT.prototype,"resolution",void 0),E([k({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],cT.prototype,"rows",void 0),E([k({type:Number,json:{write:!0}})],cT.prototype,"scale",void 0),cT=qTe=E([ht("esri.layers.support.LOD")],cT);const jn=cT;let kB=class{constructor(e,i,r,n,s){this.id=e,this.level=i,this.row=r,this.col=n,this.extent=s}};var hM;const uZe=new Bs({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 Om=hM=class extends Ni{static create(t={}){const{resolutionFactor:e=1,scales:i,size:r=256,spatialReference:n=rr.WebMercator,numLODs:s=24}=t;if(!gh(n)){const p=[];if(i)for(let y=0;y=0;v--)p.unshift(new jn({level:v,scale:y,resolution:y})),y*=2}return new hM({dpi:96,lods:p,origin:new Yi(0,0,n),size:[r,r],spatialReference:n})}const o=pd(n),a=t.origin?new Yi({x:t.origin.x,y:t.origin.y,spatialReference:n}):new Yi(o?{x:o.origin[0],y:o.origin[1],spatialReference:n}:{x:0,y:0,spatialReference:n}),l=96,c=1/(Vc(n)*39.37*l),d=[];if(i)for(let p=0;p{r.push(s.scale),e=s.scale>e?s.scale:e,i=s.scale=e.length-1)return e[e.length-1];const i=Math.floor(t),r=i+1;return e[i]/(e[i]/e[r])**(t-i)}scaleToZoom(t){const e=this.scales,i=e.length-1;let r=0;for(;rt&&s=e?this.zoomToScale(Math.ceil(i)):this.zoomToScale(Math.floor(i))}tileAt(t,e,i,r){const n=this.lodAt(t);if(!n)return null;let s,o;if(typeof e=="number")s=e,o=i;else if(Ca(e.spatialReference,this.spatialReference))s=e.x,o=e.y,r=i;else{const c=yL(e,this.spatialReference);if(lt(c))return null;s=c.x,o=c.y,r=i}const a=n.resolution*this.size[0],l=n.resolution*this.size[1];return r||(r=new kB(null,0,0,0,_o())),r.level=t,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(t,e=hM.ExtrapolateOptions.NONE){let i=this.lodAt(t.level);if(!i&&e===hM.ExtrapolateOptions.POWER_OF_TWO){const o=this.lods[this.lods.length-1];o.levelArray.isArray(t)?t:typeof t=="number"?[t,t]:[256,256]})],Om.prototype,"size",void 0),E([Li("size",["rows","cols"])],Om.prototype,"readSize",null),E([mr("size",{cols:{type:xs},rows:{type:xs}})],Om.prototype,"writeSize",null),E([k({type:rr,json:{write:!0}})],Om.prototype,"spatialReference",void 0),Om=hM=E([ht("esri.layers.support.TileInfo")],Om),function(t){var e;(e=t.ExtrapolateOptions||(t.ExtrapolateOptions={}))[e.NONE=0]="NONE",e[e.POWER_OF_TWO=1]="POWER_OF_TWO"}(Om||(Om={}));const Ml=Om;var YTe;let WA=YTe=class extends Ni{constructor(t){super(t)}clone(){return new YTe({customLayerParameters:hi(this.customLayerParameters),customParameters:hi(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};E([k({json:{type:Object,write:!0}})],WA.prototype,"customLayerParameters",void 0),E([k({json:{type:Object,write:!0}})],WA.prototype,"customParameters",void 0),E([k({type:String,json:{write:!0}})],WA.prototype,"layerIdentifier",void 0),E([k({type:String,json:{write:!0}})],WA.prototype,"tileMatrixSet",void 0),E([k({type:String,json:{write:!0}})],WA.prototype,"url",void 0),WA=YTe=E([ht("esri.layer.support.WMTSLayerInfo")],WA);var XTe;let sp=XTe=class extends ip(n0(bh(jc(_h($u(iu)))))){constructor(...t){super(...t),this.copyright="",this.fullExtent=new vr(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,rr.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=rr.WebMercator,this.subDomains=null,this.tileInfo=new Ml({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new Yi({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:rr.WebMercator}),spatialReference:rr.WebMercator,lods:[new jn({level:0,scale:591657527591555e-6,resolution:156543.033928}),new jn({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new jn({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new jn({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new jn({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new jn({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new jn({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new jn({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new jn({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new jn({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new jn({level:10,scale:577790.554289,resolution:152.874056570411}),new jn({level:11,scale:288895.277144,resolution:76.4370282850732}),new jn({level:12,scale:144447.638572,resolution:38.2185141425366}),new jn({level:13,scale:72223.819286,resolution:19.1092570712683}),new jn({level:14,scale:36111.909643,resolution:9.55462853563415}),new jn({level:15,scale:18055.954822,resolution:4.77731426794937}),new jn({level:16,scale:9027.977411,resolution:2.38865713397468}),new jn({level:17,scale:4513.988705,resolution:1.19432856685505}),new jn({level:18,scale:2256.994353,resolution:.597164283559817}),new jn({level:19,scale:1128.497176,resolution:.298582141647617}),new jn({level:20,scale:564.248588,resolution:.14929107082380833}),new jn({level:21,scale:282.124294,resolution:.07464553541190416}),new jn({level:22,scale:141.062147,resolution:.03732276770595208}),new jn({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(t,e){return typeof t=="string"?{urlTemplate:t,...e}:t}load(t){const e=this.loadFromPortal({supportedTypes:["WMTS"]},t).then(()=>{let i="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const r=new Ug(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&r.authority?.includes("{subDomain}")&&(i="is missing 'subDomains' property")}else i="spatialReference must match tileInfo.spatialReference";else i="is missing the required 'urlTemplate' property value";if(i)throw new st("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${i}`)});return this.addResolvingPromise(e),Promise.resolve(this)}get levelValues(){const t=[];if(!this.tileInfo)return null;for(const e of this.tileInfo.lods)t[e.level]=e.levelValue||e.level;return t}readSpatialReference(t,e){return t||e.fullExtent&&e.fullExtent.spatialReference&&rr.fromJSON(e.fullExtent.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const t=[],{urlTemplate:e,subDomains:i}=this,r=new Ug(e),n=r.scheme?r.scheme+"://":"//",s=n+r.authority+"/",o=r.authority;if(o?.includes("{subDomain}")){if(i&&i.length>0&&o.split(".").length>1)for(const a of i)t.push(n+o.replace(/\{subDomain\}/gi,a)+"/")}else t.push(s);return t.map(a=>(a.charAt(a.length-1)!=="/"&&(a+="/"),a))}get urlPath(){if(!this.urlTemplate)return null;const t=this.urlTemplate,e=new Ug(t),i=(e.scheme?e.scheme+"://":"//")+e.authority+"/";return t.substring(i.length)}readUrlTemplate(t,e){return t||e.templateUrl}writeUrlTemplate(t,e){t&&I1(t)&&(t="https:"+t),t&&(t=t.replace(/\{z\}/gi,"{level}").replace(/\{x\}/gi,"{col}").replace(/\{y\}/gi,"{row}"),t=Uy(t)),e.templateUrl=t}fetchTile(t,e,i,r={}){const{signal:n}=r,s=this.getTileUrl(t,e,i),o={responseType:"image",signal:n,query:{...this.refreshParameters}};return ir(s,o).then(a=>a.data)}async fetchImageBitmapTile(t,e,i,r={}){const{signal:n}=r;if(this.fetchTile!==XTe.prototype.fetchTile){const l=await this.fetchTile(t,e,i,r);try{return createImageBitmap(l)}catch(c){throw new st("request:server",`Unable to load tile ${t}/${e}/${i}`,{error:c,level:t,row:e,col:i})}}const s=this.getTileUrl(t,e,i),o={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:a}=await ir(s,o);return rM(a,s)}getTileUrl(t,e,i){const{levelValues:r,tileServers:n,urlPath:s}=this;if(!r||!n||!s)return"";const o=r[t];return n[e%n.length]+Kx(s,{level:o,z:o,col:i,x:i,row:e,y:e})}};E([k({type:String,value:"",json:{write:!0}})],sp.prototype,"copyright",void 0),E([k({type:vr,json:{write:!0},nonNullable:!0})],sp.prototype,"fullExtent",void 0),E([k({readOnly:!0,json:{read:!1,write:!1}})],sp.prototype,"legendEnabled",void 0),E([k({type:["show","hide"]})],sp.prototype,"listMode",void 0),E([k({json:{read:!0,write:!0}})],sp.prototype,"blendMode",void 0),E([k()],sp.prototype,"levelValues",null),E([k({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],sp.prototype,"isReference",void 0),E([k({type:["WebTiledLayer"],value:"WebTiledLayer"})],sp.prototype,"operationalLayerType",void 0),E([k({readOnly:!0,json:{read:!1,write:!1}})],sp.prototype,"popupEnabled",void 0),E([k({type:rr})],sp.prototype,"spatialReference",void 0),E([Li("spatialReference",["spatialReference","fullExtent.spatialReference"])],sp.prototype,"readSpatialReference",null),E([k({type:[String],json:{write:!0}})],sp.prototype,"subDomains",void 0),E([k({type:Ml,json:{write:!0}})],sp.prototype,"tileInfo",void 0),E([k({readOnly:!0})],sp.prototype,"tileServers",null),E([k({json:{read:!1}})],sp.prototype,"type",void 0),E([k()],sp.prototype,"urlPath",null),E([k({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],sp.prototype,"urlTemplate",void 0),E([Li("urlTemplate",["urlTemplate","templateUrl"])],sp.prototype,"readUrlTemplate",null),E([mr("urlTemplate",{templateUrl:{type:String}})],sp.prototype,"writeUrlTemplate",null),E([k({type:WA,json:{write:!0}})],sp.prototype,"wmtsInfo",void 0),sp=XTe=E([ht("esri.layers.WebTileLayer")],sp);const KTe=sp,UZt=Object.freeze(Object.defineProperty({__proto__:null,default:KTe},Symbol.toStringTag,{value:"Module"}));let rv=class extends KTe{constructor(...e){super(...e),this.portalItem=null,this.isReference=null,this.tileInfo=new Ml({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new Yi({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:rr.WebMercator}),spatialReference:rr.WebMercator,lods:[new jn({level:0,scale:591657527591555e-6,resolution:156543.033928}),new jn({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new jn({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new jn({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new jn({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new jn({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new jn({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new jn({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new jn({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new jn({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new jn({level:10,scale:577790.554289,resolution:152.874056570411}),new jn({level:11,scale:288895.277144,resolution:76.4370282850732}),new jn({level:12,scale:144447.638572,resolution:38.2185141425366}),new jn({level:13,scale:72223.819286,resolution:19.1092570712683}),new jn({level:14,scale:36111.909643,resolution:9.55462853563415}),new jn({level:15,scale:18055.954822,resolution:4.77731426794937}),new jn({level:16,scale:9027.977411,resolution:2.38865713397468}),new jn({level:17,scale:4513.988705,resolution:1.19432856685505}),new jn({level:18,scale:2256.994353,resolution:.597164283559817}),new jn({level:19,scale:1128.497176,resolution:.298582141647617})]}),this.subDomains=["a","b","c"],this.fullExtent=new vr(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,rr.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}};E([k({type:X0,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],rv.prototype,"portalItem",void 0),E([k({type:Boolean,json:{read:!1,write:!1}})],rv.prototype,"isReference",void 0),E([k({type:Number,readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],rv.prototype,"refreshInterval",null),E([k({type:Ml,json:{write:!1}})],rv.prototype,"tileInfo",void 0),E([k({type:["show","hide"]})],rv.prototype,"listMode",void 0),E([k({readOnly:!0,json:{read:!1,write:!1}})],rv.prototype,"subDomains",void 0),E([k({readOnly:!0,json:{read:!1,write:!1},nonNullable:!0})],rv.prototype,"fullExtent",void 0),E([k({readOnly:!0,json:{read:!1,write:!1}})],rv.prototype,"urlTemplate",void 0),E([k({type:["OpenStreetMap"]})],rv.prototype,"operationalLayerType",void 0),E([k({json:{read:!1}})],rv.prototype,"type",void 0),E([k({json:{read:!1,write:!1}})],rv.prototype,"copyright",void 0),E([k({json:{read:!1,write:!1}})],rv.prototype,"wmtsInfo",void 0),rv=E([ht("esri.layers.OpenStreetMapLayer")],rv);const JTe=rv,jZt=Object.freeze(Object.defineProperty({__proto__:null,default:JTe},Symbol.toStringTag,{value:"Module"})),zZt={type:Ml,json:{origins:{service:{read:{source:["tileInfo","minScale","maxScale","minLOD","maxLOD"],reader:ZTe}}}}};function ZTe(t,e,i,r){if(!t)return null;const{minScale:n,maxScale:s,minLOD:o,maxLOD:a}=e;if(o!=null&&a!=null)return r&&r.ignoreMinMaxLOD?Ml.fromJSON(t):Ml.fromJSON({...t,lods:t.lods.filter(({level:l})=>l!=null&&l>=o&&l<=a)});if(n!==0&&s!==0){const l=p=>Math.round(1e4*p)/1e4,c=n?l(n):1/0,d=s?l(s):-1/0;return Ml.fromJSON({...t,lods:t.lods.filter(p=>{const y=l(p.scale);return y<=c&&y>=d})})}return Ml.fromJSON(t)}function cZe(t){return 32+t.length}function hZe(t){return 16}function HZt(t){if(!t)return 0;let e=mZe;for(const i in t)if(t.hasOwnProperty(i)){const r=t[i];switch(typeof r){case"string":e+=cZe(r);break;case"number":e+=hZe();break;case"boolean":e+=4}}return e}function dZe(t){if(!t)return 0;if(Array.isArray(t))return WZt(t);let e=mZe;for(const i in t)t.hasOwnProperty(i)&&(e+=pZe(t[i]));return e}function WZt(t){const e=t.length;if(e===0||typeof t[0]=="number")return 32+8*e;let i=gZe;for(let r=0;r>3,o=this._tileAvailabilityBitSet;return s<0||s>o.length?"unknown":o[s]&1<c.data).catch(c=>{if(c&&c.details&&c.details.httpStatus===422)return{location:{top:n,left:s,width:o,height:a},valid:!0,data:ykt(o*a,0)};throw c}).then(c=>{if(c.location&&(c.location.top!==n||c.location.left!==s||c.location.width!==o||c.location.height!==a))throw new st("tilemap:location-mismatch","Tilemap response for different location than requested",{response:c,definition:{top:n,left:s,width:o,height:a}});return Kve.fromJSON(c)})}static fromJSON(e){Kve._validateJSON(e);const i=new Kve;return i.location=Object.freeze(hi(e.location)),i._updateFromData(e.data),Object.freeze(i)}static _validateJSON(e){if(!e||!e.location)throw new st("tilemap:missing-location","Location missing from tilemap response");if(e.valid===!1)throw new st("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new st("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new st("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new st("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}};function vZe(t){return`${t.level}/${t.row}/${t.col}/${t.width}/${t.height}`}function qZt(t){let e;if(t.service.type==="vector-tile")e=`${t.service.url}/tilemap/${t.level}/${t.row}/${t.col}/${t.width}/${t.height}`;else{const r=t.service.tileServers;e=`${r&&r.length?r[t.row%r.length]:t.service.url}/tilemap/${t.level}/${t.row}/${t.col}/${t.width}/${t.height}`}const i=t.service.query;return i&&(e=`${e}?${i}`),e}var J5;let W1=J5=class extends Nd(fn){constructor(t){super(t),this._pendingTilemapRequests={},this._availableLevels={},this.levels=5,this.cacheByteSize=2*K5.MEGABYTES,this.request=ir,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new E9(this.cacheByteSize),this.addHandles([Qi(()=>{const{layer:t}=this;return[t?.parsedUrl,t?.tileServers,t?.apiKey,t?.customParameters]},()=>this._initializeTilemapDefinition()),Qi(()=>this.layer?.tileInfo?.lods,t=>this._initializeAvailableLevels(t),jh)]),this._initializeTilemapDefinition()}castLevels(t){return t<=2?(Ei.getLogger(this.declaredClass).error("Minimum levels for Tilemap is 3, but got ",t),3):t}get size(){return 1<{ep(o,()=>l(vc()));const c=vZe(n);let d=this._pendingTilemapRequests[c];if(!d){d=yZe.fromDefinition(n,r).then(y=>(this._tilemapCache.put(c,y,y.byteSize),y));const p=()=>delete this._pendingTilemapRequests[c];this._pendingTilemapRequests[c]=d,d.then(p,p)}d.then(a,l)})}getAvailability(t,e,i){if(!this._availableLevels[t])return"unavailable";const r=this._tilemapFromCache(t,e,i,this._tmpTilemapDefinition);return r?r.getAvailability(e,i):"unknown"}fetchAvailability(t,e,i,r){return this._availableLevels[t]?this.fetchTilemap(t,e,i,r).catch(n=>n).then(n=>{if(n instanceof yZe){const s=n.getAvailability(e,i);if(s==="unavailable")throw new st("tile-map:tile-unavailable","Tile is not available",{level:t,row:e,col:i});return s}if(ss(n))throw n;return"unknown"}):Promise.reject(new st("tilemap-cache:level-unavailable",`Level ${t} is unavailable in the service`))}fetchAvailabilityUpsample(t,e,i,r,n){r.level=t,r.row=e,r.col=i;const s=this.layer.tileInfo;s.updateTileInfo(r);const o=this.fetchAvailability(t,e,i,n).catch(a=>{if(ss(a))throw a;if(s.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r);throw a});return this._fetchAvailabilityUpsamplePrefetch(r.id,t,e,i,n,o),o}async _fetchAvailabilityUpsamplePrefetch(t,e,i,r,n,s){if(!this._prefetchingEnabled||t==null)return;const o=`prefetch-${t}`;if(this.handles.has(o))return;const a=new AbortController;s.then(()=>a.abort(),()=>a.abort());let l=!1;const c={remove(){l||(l=!0,a.abort())}};if(this.handles.add(c,o),await nNt(10,a.signal).catch(()=>{}),l||(l=!0,this.handles.remove(o)),bm(a))return;const d=new kB(t,e,i,r),p={...n,signal:a.signal},y=this.layer.tileInfo;for(let v=0;J5._prefetches.length{J5._prefetches.removeUnordered(S)};S.then(I,I)}}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:t,apiKey:e,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:t.path,query:Uv({...t.query,...i,token:e??t.query?.token}),tileServers:this.layer.tileServers,request:this.request,type:this.layer.type},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(t,e,i,r){r.level=t,r.row=e-e%this.size,r.col=i-i%this.size;const n=vZe(r);return this._tilemapCache.get(n)}_initializeAvailableLevels(t){this._availableLevels={},t&&t.forEach(e=>this._availableLevels[e.level]=!0)}get test(){const t=this;return{get prefetchingEnabled(){return t._prefetchingEnabled},set prefetchingEnabled(e){t._prefetchingEnabled=e},hasTilemap:(e,i,r)=>!!t._tilemapFromCache(e,i,r,t._tmpTilemapDefinition)}}};W1._maxPrefetch=4,W1._prefetches=new _m({initialSize:J5._maxPrefetch}),E([k({constructOnly:!0,type:Number})],W1.prototype,"levels",void 0),E([Zs("levels")],W1.prototype,"castLevels",null),E([k({readOnly:!0,type:Number})],W1.prototype,"size",null),E([k({constructOnly:!0,type:Number})],W1.prototype,"cacheByteSize",void 0),E([k({constructOnly:!0})],W1.prototype,"layer",void 0),E([k({constructOnly:!0})],W1.prototype,"request",void 0),W1=J5=E([ht("esri.layers.support.TilemapCache")],W1);const QTe=t=>{let e=class extends t{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}readMinScale(i,r){return r.minLOD!=null&&r.maxLOD!=null?i:0}readMaxScale(i,r){return r.minLOD!=null&&r.maxLOD!=null?i:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(i,r){return r.capabilities&&r.capabilities.includes("Tilemap")?new W1({layer:this}):null}};return E([k({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),E([k()],e.prototype,"minScale",void 0),E([Li("service","minScale")],e.prototype,"readMinScale",null),E([k()],e.prototype,"maxScale",void 0),E([Li("service","maxScale")],e.prototype,"readMaxScale",null),E([k({type:rr})],e.prototype,"spatialReference",void 0),E([k({readOnly:!0})],e.prototype,"supportsBlankTile",null),E([k(zZt)],e.prototype,"tileInfo",void 0),E([k()],e.prototype,"tilemapCache",void 0),E([Li("service","tilemapCache",["capabilities"])],e.prototype,"readTilemapCache",null),E([k()],e.prototype,"version",void 0),e=E([ht("esri.layers.mixins.ArcGISCachedService")],e),e},_Ze=["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 df=class extends ip(oZe(bh(jc(_h(QTe(ZJe(Qv($u(Nd(n0(g2(v2(iu))))))))))))){constructor(...e){super(...e),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(e,i){return typeof e=="string"?{url:e,...i}:e}load(e){const i=ye(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(Ga).then(()=>this._fetchService(i))),Promise.resolve(this)}get attributionDataUrl(){const e=this.parsedUrl?.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,i){return(e=e||i.tileInfo&&i.tileInfo.spatialReference)&&rr.fromJSON(e)}writeSublayers(e,i,r,n){if(!this.loaded||!e)return;const s=e.slice().reverse().flatten(({sublayers:l})=>l&&l.toArray().reverse()).toArray(),o=[],a={writeSublayerStructure:!1,...n};s.forEach(l=>{const c=l.write({},a);o.push(c)}),o.some(l=>Object.keys(l).length>1)&&(i.layers=o)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl?.path)}castTileServers(e){return Array.isArray(e)?e.map(i=>sa(i).path):null}fetchTile(e,i,r,n={}){const{signal:s}=n,o=this.getTileUrl(e,i,r),a={responseType:"image",signal:s,query:{...this.refreshParameters}};return ir(o,a).then(l=>l.data)}async fetchImageBitmapTile(e,i,r,n={}){const{signal:s}=n,o=this.getTileUrl(e,i,r),a={responseType:"blob",signal:s,query:{...this.refreshParameters}},{data:l}=await ir(o,a);return rM(l,o)}getTileUrl(e,i,r){const n=!this.tilemapCache&&this.supportsBlankTile,s=Uv({...this.parsedUrl?.query,blankTile:!n&&null,...this.customParameters,token:this.apiKey}),o=this.tileServers;return`${o&&o.length?o[i%o.length]:this.parsedUrl?.path}/tile/${e}/${i}/${r}${s?"?"+s:""}`}loadAll(){return dL(this,e=>{e(this.allSublayers)})}_fetchService(e){return new Promise((i,r)=>{if(this.sourceJSON){if(this.sourceJSON.bandCount!=null&&this.sourceJSON.pixelSizeX!=null)throw new st("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void i({data:this.sourceJSON})}if(!this.parsedUrl)throw new st("tile-layer:undefined-url","layer's url is not defined");const n=JC(this.parsedUrl.path);if(ye(n)&&n.serverType==="ImageServer")throw new st("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");ir(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(i,r)}).then(i=>{let r=this.url;if(i.ssl&&(r=this.url=r.replace(/^http:/i,"https:")),this.sourceJSON=i.data,this.read(i.data,{origin:"service",url:this.parsedUrl}),this.version===10.1&&!N9(r))return this._fetchServerVersion(r,e).then(n=>{this.read({currentVersion:n})}).catch(()=>{})})}_fetchServerVersion(e,i){if(!OHe(e))return Promise.reject();const r=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return ir(r,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:i}).then(n=>{if(n.data&&n.data.currentVersion)return n.data.currentVersion;throw new st("tile-layer:version-not-available")})}_getMapName(e){const i=e.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/mapserver/i);return i?i[2]:void 0}_getDefaultAttribution(e){if(e==null)return null;let i;e=e.toLowerCase();for(let r=0,n=_Ze.length;r({enabled:!1})}}})],df.prototype,"isReference",void 0),E([k({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],df.prototype,"operationalLayerType",void 0),E([k({type:Boolean})],df.prototype,"resampling",void 0),E([k()],df.prototype,"sourceJSON",void 0),E([k({type:rr})],df.prototype,"spatialReference",void 0),E([Li("spatialReference",["spatialReference","tileInfo"])],df.prototype,"readSpatialReference",null),E([k({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],df.prototype,"path",void 0),E([k({readOnly:!0})],df.prototype,"sublayers",void 0),E([mr("sublayers",{layers:{type:[xY]}})],df.prototype,"writeSublayers",null),E([k({json:{read:!1,write:!1}})],df.prototype,"popupEnabled",void 0),E([k()],df.prototype,"tileServers",null),E([Zs("tileServers")],df.prototype,"castTileServers",null),E([k({readOnly:!0,json:{read:!1}})],df.prototype,"type",void 0),E([k(Zy)],df.prototype,"url",void 0),df=E([ht("esri.layers.TileLayer")],df),df.prototype.fetchTile.__isDefault__=!0;const eEe=df,YZt=Object.freeze(Object.defineProperty({__proto__:null,default:eEe},Symbol.toStringTag,{value:"Module"})),XZt=[[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 NB(t){return t!=null&&XZt.some(([e,i])=>t>=e&&t<=i)}const KZt={visible:"visibleSublayers"};let hT=class extends Nd(fn){constructor(e){super(e),this.scale=0}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.handles.remove("layer"),e&&this.handles.add([e.sublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("wms-sublayer-update",i=>this.notifyChange(KZt[i.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:i}=this,r=e?.sublayers,n=[],s=o=>{const{minScale:a,maxScale:l,sublayers:c,visible:d}=o;d&&(i===0||(a===0||i<=a)&&(l===0||i>=l))&&(c?c.forEach(s):n.push(o))};return r?.forEach(s),n}toJSON(){const{layer:e,layers:i}=this,{imageFormat:r,imageTransparency:n,version:s}=e;return{format:r,request:"GetMap",service:"WMS",styles:"",transparent:n?"TRUE":"FALSE",version:s,layers:i}}};E([k()],hT.prototype,"layer",null),E([k({readOnly:!0})],hT.prototype,"layers",null),E([k({type:Number})],hT.prototype,"scale",void 0),E([k({readOnly:!0})],hT.prototype,"version",null),E([k({readOnly:!0})],hT.prototype,"visibleSublayers",null),hT=E([ht("esri.layers.support.ExportWMSImageParameters")],hT);var Uae;let JZt=0,wd=Uae=class extends R1(jse){constructor(t){super(t),this.dimensions=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.addHandles([ku(()=>this.sublayers,"after-add",({item:e})=>{e.parent=this,e.layer=this.layer},Nu),ku(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=e.parent=null},Nu),Qi(()=>this.sublayers,(e,i)=>{if(i)for(const r of i)r.layer=r.parent=null;if(e)for(const r of e)r.parent=this,r.layer=this.layer},Nu)])}get description(){return this._get("description")}set description(t){this._set("description",t)}get fullExtent(){return this._get("fullExtent")}set fullExtent(t){this._set("fullExtent",t)}readExtent(t,e){return(t=e.extent)?vr.fromJSON(t):null}get id(){return this._get("id")??JZt++}set id(t){this._set("id",t)}readLegendUrl(t,e){return e?.legendUrl??e?.legendURL??null}get effectiveScaleRange(){const{minScale:t,maxScale:e}=this;return{minScale:t,maxScale:e}}get name(){return this._get("name")}set name(t){this._set("name",t)}castSublayers(t){return ud(fr.ofType(Uae),t)}get title(){return this._get("title")}set title(t){this._set("title",t)}get visible(){return this._get("visible")}set visible(t){this._setAndNotifyLayer("visible",t)}clone(){const t=new Uae;return this.hasOwnProperty("description")&&(t.description=this.description),this.hasOwnProperty("fullExtent")&&(t.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(t.fullExtents=this.fullExtents?.map(e=>e.clone())??null),this.hasOwnProperty("legendUrl")&&(t.legendUrl=this.legendUrl),this.hasOwnProperty("legendEnabled")&&(t.legendEnabled=this.legendEnabled),this.hasOwnProperty("layer")&&(t.layer=this.layer),this.hasOwnProperty("name")&&(t.name=this.name),this.hasOwnProperty("parent")&&(t.parent=this.parent),this.hasOwnProperty("queryable")&&(t.queryable=this.queryable),this.hasOwnProperty("sublayers")&&(t.sublayers=this.sublayers&&this.sublayers.map(e=>e.clone())),this.hasOwnProperty("spatialReferences")&&(t.spatialReferences=this.spatialReferences?.map(e=>e)),this.hasOwnProperty("visible")&&(t.visible=this.visible),this.hasOwnProperty("title")&&(t.title=this.title),t}_setAndNotifyLayer(t,e){const i=this.layer;this._get(t)!==e&&(this._set(t,e),i&&i.emit("wms-sublayer-update",{propertyName:t,id:this.id}))}};E([k()],wd.prototype,"description",null),E([k({readOnly:!0})],wd.prototype,"dimensions",void 0),E([k({value:null})],wd.prototype,"fullExtent",null),E([Li("fullExtent",["extent"])],wd.prototype,"readExtent",null),E([k()],wd.prototype,"fullExtents",void 0),E([k({type:Number,json:{write:{enabled:!1,overridePolicy:()=>({ignoreOrigin:!0,enabled:!0})}}})],wd.prototype,"id",null),E([k({type:String,json:{origins:{"web-document":{read:{source:["legendUrl","legendURL"]},write:{target:"legendUrl",ignoreOrigin:!0}}},read:{source:"legendURL"},write:{ignoreOrigin:!0}}})],wd.prototype,"legendUrl",void 0),E([Li(["web-document"],"legendUrl")],wd.prototype,"readLegendUrl",null),E([k({value:!0,type:Boolean,json:{read:{source:"showLegend"},write:{target:"showLegend"},origins:{"web-map":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],wd.prototype,"legendEnabled",void 0),E([k()],wd.prototype,"layer",void 0),E([k()],wd.prototype,"maxScale",void 0),E([k()],wd.prototype,"minScale",void 0),E([k({readOnly:!0})],wd.prototype,"effectiveScaleRange",null),E([k({type:String,value:null,json:{read:{source:"name"},write:{ignoreOrigin:!0}}})],wd.prototype,"name",null),E([k()],wd.prototype,"parent",void 0),E([k({type:Boolean,json:{read:{source:"showPopup"},write:{ignoreOrigin:!0,target:"showPopup"}}})],wd.prototype,"popupEnabled",void 0),E([k({type:Boolean,json:{write:{ignoreOrigin:!0}}})],wd.prototype,"queryable",void 0),E([k()],wd.prototype,"sublayers",void 0),E([Zs("sublayers")],wd.prototype,"castSublayers",null),E([k({type:[Number],json:{read:{source:"spatialReferences"}}})],wd.prototype,"spatialReferences",void 0),E([k({type:String,value:null,json:{write:{ignoreOrigin:!0}}})],wd.prototype,"title",null),E([k({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],wd.prototype,"visible",null),wd=Uae=E([ht("esri.layers.support.WMSSublayer")],wd);const tEe=wd,jae={84:4326,83:4269,27:4267};function ZZt(t){if(!t)return null;const e={idCounter:-1};typeof t=="string"&&(t=new DOMParser().parseFromString(t,"text/xml"));const i=t.documentElement;if(i.nodeName==="ServiceExceptionReport"){const Oe=Array.prototype.slice.call(i.childNodes).map(Ae=>Ae.textContent).join(`\r -`);throw new st("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",Oe)}const r=c0("Capability",i),n=c0("Service",i),s=r&&c0("Request",r);if(!r||!n||!s)return null;const o=c0("Layer",r);if(!o)return null;const a=i.nodeName==="WMS_Capabilities"||i.nodeName==="WMT_MS_Capabilities"?i.getAttribute("version"):"1.3.0",l=dT("Title",n,"")||dT("Name",n,""),c=dT("AccessConstraints",n,""),d=/^none$/i.test(c)?"":c,p=dT("Abstract",n,""),y=parseInt(dT("MaxWidth",n,"5000"),10),v=parseInt(dT("MaxHeight",n,"5000"),10),S=SZe(s,"GetMap"),I=xZe(s,"GetMap"),O=TY(o,a,e);if(!O)return null;let L,N=0;const G=Array.prototype.slice.call(r.childNodes),V=O.sublayers??[],Y=Oe=>{Oe!=null&&V.push(Oe)};G.forEach(Oe=>{Oe.nodeName==="Layer"&&(N===0?L=Oe:(N===1&&O.name&&(O.name="",Y(TY(L,a,e))),Y(TY(Oe,a,e))),N++)});let X=O.sublayers,te=O.extent;const re=O.fullExtents??[];if(X||(X=[]),X.length===0&&X.push(O),!te){const Oe=new vr(X[0].extent);O.extent=Oe.toJSON(),te=O.extent}const fe=O.spatialReferences.length>0?O.spatialReferences:bZe(O),ge=xZe(s,"GetFeatureInfo"),_e=ge?SZe(s,"GetFeatureInfo"):null,Ie=wZe(X),ke=O.minScale||0,Ne=O.maxScale||0,J=O.dimensions??[],he=Ie.reduce((Oe,Ae)=>Oe.concat(Ae.dimensions??[]),[]),xe=J.concat(he).filter(EZe);let Pe=null;if(xe.length){const Oe=xe.map(Ae=>{const{extent:ze}=Ae;return tQt(ze)?ze.map(Ge=>Ge.getTime()):ze?.map(Ge=>[Ge.min.getTime(),Ge.max.getTime()])}).flat(2).filter(ye);Pe={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[Math.min(...Oe),Math.max(...Oe)]}}return{copyright:d,description:p,dimensions:J,extent:te,fullExtents:re,featureInfoFormats:_e,featureInfoUrl:ge,mapUrl:I,maxWidth:y,maxHeight:v,maxScale:Ne,minScale:ke,layers:Ie,spatialReferences:fe,supportedImageFormatTypes:S,timeInfo:Pe,title:l,version:a}}function QZt(t){const e=t.filter(i=>i.popupEnabled&&i.name&&i.queryable);return e.length?e.map(({name:i})=>i).join():null}function bZe(t){if(t.spatialReferences.length>0)return t.spatialReferences;if(t.sublayers)for(const e of t.sublayers){const i=bZe(e);if(i.length>0)return i}return[]}function wZe(t){let e=[];for(const i of t)e.push(i),i.sublayers?.length&&(e=e.concat(wZe(i.sublayers)),delete i.sublayers);return e}function zae(t,e,i){return e.getAttribute(t)??i}function eQt(t,e,i,r){const n=c0(t,i);return n?zae(e,n,r):r}function c0(t,e){for(let i=0;in).filter(ye);const r=[];for(const n of i)if(n.getAttribute("name")===e){const s=Hae("Format",n);for(const{textContent:o}of s)o!=null&&r.push(o)}return r}function CZe(t,e,i){const r=c0(e,t);if(!r)return i;const{textContent:n}=r;if(n==null||n==="")return i;const s=Number(n);return isNaN(s)?i:s}function TY(t,e,i){if(!t)return null;const r={id:i.idCounter++,fullExtents:[],parentLayerId:null,queryable:t.getAttribute("queryable")==="1",spatialReferences:[],sublayers:null},n=c0("LatLonBoundingBox",t),s=c0("EX_GeographicBoundingBox",t);let o=null;n&&(o=CY(n,4326)),s&&(o=new vr(0,0,0,0,new rr({wkid:4326})),o.xmin=parseFloat(dT("westBoundLongitude",s,"0")),o.ymin=parseFloat(dT("southBoundLatitude",s,"0")),o.xmax=parseFloat(dT("eastBoundLongitude",s,"0")),o.ymax=parseFloat(dT("northBoundLatitude",s,"0"))),n||s||(o=new vr(-180,-90,180,90,new rr({wkid:4326}))),r.minScale=CZe(t,"MaxScaleDenominator",0),r.maxScale=CZe(t,"MinScaleDenominator",0);const a=["1.0.0","1.1.0","1.1.1"].includes(e)?"SRS":"CRS";return Array.prototype.slice.call(t.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 c=l.getAttribute(a);if(c&&c.indexOf("EPSG:")===0){const p=parseInt(c.substring(5),10);p===0||isNaN(p)||o||(o=e==="1.3.0"?CY(l,p,NB(p)):CY(l,p))}const d=c&&c.indexOf(":");if(d&&d>-1){let p=parseInt(c.substring(d+1,c.length),10);p===0||isNaN(p)||(p=jae[p]?jae[p]:p);const y=e==="1.3.0"?CY(l,p,NB(p)):CY(l,p);y&&r.fullExtents&&r.fullExtents.push(y)}}else if(l.nodeName===a)(l.textContent?.split(" ")??[]).forEach(c=>{const d=c.includes(":")?parseInt(c.split(":")[1],10):parseInt(c,10);if(d!==0&&!isNaN(d)){const p=jae[d]?jae[d]:d;r.spatialReferences.includes(p)||r.spatialReferences.push(p)}});else if(l.nodeName!=="Style"||r.legendURL){if(l.nodeName==="Layer"){const c=TY(l,e,i);c&&(c.parentLayerId=r.id,r.sublayers||(r.sublayers=[]),r.sublayers.push(c))}}else{const c=c0("LegendURL",l);if(c){const d=c0("OnlineResource",c);d&&(r.legendURL=d.getAttribute("xlink:href"))}}}),r.extent=o?.toJSON(),r.dimensions=Hae("Dimension",t).filter(l=>l.getAttribute("name")&&l.getAttribute("units")&&l.textContent).map(l=>{const c=l.getAttribute("name"),d=l.getAttribute("units"),p=l.textContent,y=l.getAttribute("unitSymbol")??void 0,v=l.getAttribute("default")??void 0,S=zae("default",l,"0")!=="0",I=zae("nearestValue",l,"0")!=="0",O=zae("current",l,"0")!=="0";return EZe({name:c,units:d})?{name:"time",units:"ISO8601",extent:PZe(p),default:PZe(v),multipleValues:S,nearestValue:I,current:O}:iQt({name:c,units:d})?{name:"elevation",units:d,extent:IZe(p),unitSymbol:y,default:IZe(v),multipleValues:S,nearestValue:I}:{name:c,units:d,extent:AZe(p),unitSymbol:y,default:AZe(v),multipleValues:S,nearestValue:I}}),r}function tQt(t){return Array.isArray(t)&&t.length>0&&t[0]instanceof Date}function TZe(t){return t.nodeType===Node.ELEMENT_NODE}function iQt(t){return/^elevation$/i.test(t.name)&&/^(epsg|crs):\d+$/i.test(t.units)}function EZe(t){return/^time$/i.test(t.name)&&/^iso8601$/i.test(t.units)}function rQt(t,e){const i=[],r=sa(t);for(const n in r.query)r.query.hasOwnProperty(n)&&(e.includes(n.toLowerCase())||i.push(n+"="+r.query[n]));return r.path+(i.length?"?"+i.join("&"):"")}function IZe(t){if(!t)return;const e=t.includes("/"),i=t.split(",");return e?i.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(ye):i.map(r=>parseFloat(r))}function AZe(t){if(!t)return;const e=t.includes("/"),i=t.split(",");return e?i.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(ye):i}function PZe(t){if(!t)return;const e=t.includes("/"),i=t.split(",");return e?i.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"?nQt(n[2]):void 0}}).filter(ye):i.map(r=>new Date(r))}function nQt(t){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,i=t.match(e);return i?{years:$B(i[1]),months:$B(i[2]),days:$B(i[3]),hours:$B(i[4]),minutes:$B(i[5]),seconds:$B(i[6])}:null}function $B(t){if(!t)return 0;const e=/(?:\d+(?:.|,)\d+|\d+)/,i=t.match(e);if(!i)return 0;const r=i[0].replace(",",".");return Number(r)}function BB(t){return t.toISOString().replace(/\.[0-9]{3}/,"")}const OZe=new Set([102100,3857,102113,900913]),sQt=new Set([3395,54004]);function oQt(t,e){let i=t.wkid;return lt(e)?i:(i!=null&&e.includes(i)||!t.latestWkid||(i=t.latestWkid),i!=null&&OZe.has(i)?e.find(r=>OZe.has(r))||e.find(r=>sQt.has(r))||102100:i)}const iEe=new Bs({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function RZe(t){return t==="text/html"}function MZe(t){return t==="text/plain"}let Dl=class extends ip(iT(n0(bh(jc(_h($u(iu))))))){constructor(...e){super(...e),this.allSublayers=new k2({getCollections:()=>[this.sublayers],getChildrenFunction:i=>i.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.url=null,this.version=null,this.addHandles([ku(()=>this.sublayers,"after-add",({item:i})=>{i.parent=i.layer=this},Nu),ku(()=>this.sublayers,"after-remove",({item:i})=>{i.layer=i.parent=null},Nu),Qi(()=>this.sublayers,(i,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(i)for(const n of i)n.parent=n.layer=this},Nu)])}normalizeCtorArgs(e,i){return typeof e=="string"?{url:e,...i}:e}load(e){const i=ye(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch(Ga).then(()=>this._fetchService(i))),Promise.resolve(this)}readFullExtentFromItemOrMap(e,i){const r=i.extent;return r?new vr({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]}):null}writeFullExtent(e,i){i.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return lt(this.featureInfoFormats)?null:this.featureInfoFormats.find(RZe)??this.featureInfoFormats.find(MZe)??null}set featureInfoFormat(e){ye(e)?(RZe(e)||MZe(e))&&this._override("featureInfoFormat",e):(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat"))}readImageFormat(e,i){const r=i.supportedImageFormatTypes;return r&&r.includes("image/png")?"image/png":r&&r[0]}readSpatialReferenceFromItemOrDocument(e,i){return new rr(i.spatialReferences[0])}writeSpatialReferences(e,i){const r=this.spatialReference?.wkid;e&&r?(i.spatialReferences=e.filter(n=>n!==r),i.spatialReferences.unshift(r)):i.spatialReferences=e}readSublayersFromItemOrMap(e,i,r){return DZe(i.layers,r,i.visibleLayers)}readSublayers(e,i,r){return DZe(i.layers,r)}writeSublayers(e,i,r,n){i.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},c=a.write({parentLayerId:typeof a.parent?.id=="number"?a.parent.id:-1},l);if(s.has(a.id)&&(c.sublayerIds=s.get(a.id)),!a.sublayers&&a.name){const d=a.write({},l);delete d.id,i.layers.push(d)}}i.visibleLayers=o.filter(({visible:a,sublayers:l})=>a&&!l).map(({name:a})=>a).toArray()}createExportImageParameters(e,i,r,n){const s=n?.pixelRatio??1,o=Bae({extent:e,width:i})*s,a=new hT({layer:this,scale:o}),{xmin:l,ymin:c,xmax:d,ymax:p,spatialReference:y}=e,v=oQt(y,this.spatialReferences),S=this.version==="1.3.0"&&NB(v)?`${c},${l},${p},${d}`:`${l},${c},${d},${p}`,I=a.toJSON();return{bbox:S,[this.version==="1.3.0"?"crs":"srs"]:v==null||isNaN(v)?void 0:"EPSG:"+v,...I}}async fetchImage(e,i,r,n){const s=this.mapUrl,o=this.createExportImageParameters(e,i,r,n);if(!o.layers){const p=document.createElement("canvas");return p.width=i,p.height=r,p}const a=n?.timeExtent?.start,l=n?.timeExtent?.end,c=ye(a)&&ye(l)?a.getTime()===l.getTime()?BB(a):`${BB(a)}/${BB(l)}`:void 0,d={responseType:"image",query:this._mixCustomParameters({width:i,height:r,...o,time:c,...this.refreshParameters}),signal:n?.signal};return ir(s??"",d).then(p=>p.data)}async fetchImageBitmap(e,i,r,n){const s=this.mapUrl??"",o=this.createExportImageParameters(e,i,r,n);if(!o.layers){const y=document.createElement("canvas");return y.width=i,y.height=r,y}const a=n?.timeExtent?.start,l=n?.timeExtent?.end,c=ye(a)&&ye(l)?a.getTime()===l.getTime()?BB(a):`${BB(a)}/${BB(l)}`:void 0,d={responseType:"blob",query:this._mixCustomParameters({width:i,height:r,...o,time:c,...this.refreshParameters}),signal:n?.signal},{data:p}=await ir(s,d);return rM(p,s)}fetchFeatureInfo(e,i,r,n,s){const o=Bae({extent:e,width:i}),a=new hT({layer:this,scale:o}),l=QZt(a.visibleSublayers);if(lt(this.featureInfoUrl)||lt(l))return Promise.resolve([]);if(lt(this.fetchFeatureInfoFunction)&<(this.featureInfoFormat))return Promise.resolve([]);const c=this.version==="1.3.0"?{I:n,J:s}:{x:n,y:s},d={query_layers:l,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:i,height:r,...c},p={...this.createExportImageParameters(e,i,r),...d},y=this._mixCustomParameters(p);return ye(this.fetchFeatureInfoFunction)?this.fetchFeatureInfoFunction(y):this._defaultFetchFeatureInfoFunction(jy(this.featureInfoUrl,y))}findSublayerById(e){return this.allSublayers.find(i=>i.id===e)}findSublayerByName(e){return this.allSublayers.find(i=>i.name===e)}serviceSupportsSpatialReference(e){return ljt(this.url)||this.spatialReferences!=null&&this.spatialReferences.some(i=>{const r=i===900913?rr.WebMercator:new rr({wkid:i});return Ca(r,e)})}_defaultFetchFeatureInfoFunction(e){const i=document.createElement("iframe");i.src=kVe(e),i.style.border="none",i.style.margin="0",i.style.width="100%",i.setAttribute("sandbox","");const r=new yh({title:this.title,content:i}),n=new js({sourceLayer:this,popupTemplate:r});return Promise.resolve([n])}async _fetchService(e){if(!this.resourceInfo){const{path:i,query:r}=this.parsedUrl??{};r?.service&&(r.SERVICE=r.service,delete r.service),r?.request&&(r.REQUEST=r.request,delete r.request);const{data:n}=await ir(i??"",{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...r,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=ZZt(n)}if(this.parsedUrl){const i=new Ug(this.parsedUrl.path),{httpsDomains:r}=na.request;i.scheme!=="https"||i.port&&i.port!=="443"||!i.host||r.includes(i.host)||r.push(i.host)}this.read(this.resourceInfo,{origin:"service"})}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const i={...this.customParameters,...this.customLayerParameters};for(const r in i)e[r.toLowerCase()]=i[r];return e}};function aQt(t,e){return t.some(i=>{for(const r in i)if(CVe(i,r,null,e))return!0;return!1})}function DZe(t,e,i){t=t??[];const r=new Map;t.every(s=>s.id==null)&&(t=hi(t)).forEach((s,o)=>s.id=o);for(const s of t){const o=new tEe;o.read(s,e),i&&!i.includes(o.name)&&(o.visible=!1),r.set(o.id,o)}const n=[];for(const s of t){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 fr),a.sublayers.push(o)}else n.push(o)}return n}E([k({readOnly:!0})],Dl.prototype,"allSublayers",void 0),E([k({json:{type:Object,write:!0}})],Dl.prototype,"customParameters",void 0),E([k({json:{type:Object,write:!0}})],Dl.prototype,"customLayerParameters",void 0),E([k({type:String,json:{write:!0}})],Dl.prototype,"copyright",void 0),E([k()],Dl.prototype,"description",void 0),E([k({readOnly:!0})],Dl.prototype,"dimensions",void 0),E([k({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],Dl.prototype,"fullExtent",void 0),E([Li(["web-document","portal-item"],"fullExtent",["extent"])],Dl.prototype,"readFullExtentFromItemOrMap",null),E([mr(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],Dl.prototype,"writeFullExtent",null),E([k()],Dl.prototype,"fullExtents",void 0),E([k({type:String,json:{write:{ignoreOrigin:!0}}})],Dl.prototype,"featureInfoFormat",null),E([k({type:[String],readOnly:!0})],Dl.prototype,"featureInfoFormats",void 0),E([k({type:String,json:{write:{ignoreOrigin:!0}}})],Dl.prototype,"featureInfoUrl",void 0),E([k()],Dl.prototype,"fetchFeatureInfoFunction",void 0),E([k({type:String,json:{origins:{"web-document":{default:"image/png",type:iEe.jsonValues,read:{reader:iEe.read,source:"format"},write:{writer:iEe.write,target:"format"}}}}})],Dl.prototype,"imageFormat",void 0),E([Li("imageFormat",["supportedImageFormatTypes"])],Dl.prototype,"readImageFormat",null),E([k({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],Dl.prototype,"imageMaxHeight",void 0),E([k({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],Dl.prototype,"imageMaxWidth",void 0),E([k()],Dl.prototype,"imageTransparency",void 0),E([k(N1)],Dl.prototype,"legendEnabled",void 0),E([k({type:["show","hide","hide-children"]})],Dl.prototype,"listMode",void 0),E([k({type:String,json:{write:{ignoreOrigin:!0}}})],Dl.prototype,"mapUrl",void 0),E([k({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Dl.prototype,"isReference",void 0),E([k({type:["WMS"]})],Dl.prototype,"operationalLayerType",void 0),E([k()],Dl.prototype,"resourceInfo",void 0),E([k({type:rr,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],Dl.prototype,"spatialReference",void 0),E([Li(["web-document","portal-item"],"spatialReference",["spatialReferences"])],Dl.prototype,"readSpatialReferenceFromItemOrDocument",null),E([k({type:[xs],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],Dl.prototype,"spatialReferences",void 0),E([mr(["web-document","portal-item"],"spatialReferences")],Dl.prototype,"writeSpatialReferences",null),E([k({type:fr.ofType(tEe),json:{write:{target:"layers",overridePolicy(t,e,i){if(aQt(this.allSublayers,i))return{ignoreOrigin:!0}}}}})],Dl.prototype,"sublayers",void 0),E([Li(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],Dl.prototype,"readSublayersFromItemOrMap",null),E([Li("service","sublayers",["layers"])],Dl.prototype,"readSublayers",null),E([mr("sublayers",{layers:{type:[tEe]},visibleLayers:{type:[String]}})],Dl.prototype,"writeSublayers",null),E([k({json:{read:!1},readOnly:!0,value:"wms"})],Dl.prototype,"type",void 0),E([k(Zy)],Dl.prototype,"url",void 0),E([k({type:String,json:{write:{ignoreOrigin:!0}}})],Dl.prototype,"version",void 0),Dl=E([ht("esri.layers.WMSLayer")],Dl);const FZe=Dl,lQt=Object.freeze(Object.defineProperty({__proto__:null,default:FZe},Symbol.toStringTag,{value:"Module"}));var rEe;let Wae=rEe=class extends Ni{constructor(t){super(t),this.type="none"}clone(){return new rEe({type:this.type})}};E([Hr({none:"none",stayAbove:"stay-above"})],Wae.prototype,"type",void 0),Wae=rEe=E([ht("esri.ground.NavigationConstraint")],Wae);let Hh=class extends fn{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1,this.TERRAIN_USE_LEGACY_SHADING=!1}};E([k()],Hh.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),E([k()],Hh.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),E([k()],Hh.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),E([k()],Hh.prototype,"DECONFLICTOR_SHOW_GRID",void 0),E([k()],Hh.prototype,"LABELS_SHOW_BORDER",void 0),E([k()],Hh.prototype,"TEXT_SHOW_BASELINE",void 0),E([k()],Hh.prototype,"TEXT_SHOW_BORDER",void 0),E([k()],Hh.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),E([k()],Hh.prototype,"OVERLAY_SHOW_CENTER",void 0),E([k()],Hh.prototype,"SHOW_POI",void 0),E([k()],Hh.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),E([k()],Hh.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),E([k()],Hh.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),E([k()],Hh.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),E([k()],Hh.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),E([k()],Hh.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),E([k()],Hh.prototype,"I3S_TREE_SHOW_TILES",void 0),E([k()],Hh.prototype,"I3S_SHOW_MODIFICATIONS",void 0),E([k()],Hh.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),E([k()],Hh.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),E([k()],Hh.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),E([k()],Hh.prototype,"LINE_WIREFRAMES",void 0),E([k()],Hh.prototype,"TERRAIN_USE_LEGACY_SHADING",void 0),Hh=E([ht("esri.views.3d.support.DebugFlags")],Hh);const uQt=new Hh;var nEe;let pT=nEe=class extends z0(hd){constructor(t){super(t),this.opacity=1,this.shading=!uQt.TERRAIN_USE_LEGACY_SHADING,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new fr;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"&&Ei.getLogger(this.declaredClass).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.`)},i=r=>{r.parent=null};this.layers.on("after-add",r=>e(r.item)),this.layers.on("after-remove",r=>i(r.item))}initialize(){this.when().catch(t=>{Ei.getLogger(this.declaredClass).error("#load()","Failed to load ground",t)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const t=this.layers.removeAll();for(const e of t)e.destroy();this.layers.destroy()}normalizeCtorArgs(t){return t&&"resourceInfo"in t&&(this._set("resourceInfo",t.resourceInfo),delete(t={...t}).resourceInfo),t}set layers(t){this._set("layers",rg(t,this._get("layers")))}writeLayers(t,e,i,r){const n=[];t&&(r={...r,layerContainerType:"ground"},t.forEach(s=>{if("write"in s){const o={};oVt(s)().write(o,r)&&n.push(o)}else r&&r.messages&&r.messages.push(new st("layer:unsupported",`Layers (${s.title}, ${s.id}) of type '${s.declaredClass}' cannot be persisted in the ground`,{layer:s}))})),e.layers=n}load(t){return this.addResolvingPromise(this._loadFromSource(t)),Promise.resolve(this)}loadAll(){return dL(this,t=>{t(this.layers)})}async queryElevation(t,e){await this.load({signal:e?.signal});const{ElevationQuery:i}=await Promise.resolve().then(()=>Ofe);sn(e);const r=new i,n=this.layers.filter(LZe).toArray();return r.queryAll(n,t,e)}async createElevationSampler(t,e){await this.load({signal:e?.signal});const{ElevationQuery:i}=await Promise.resolve().then(()=>Ofe);sn(e);const r=new i,n=this.layers.filter(LZe).toArray();return r.createSamplerAll(n,t,e)}clone(){const t={opacity:this.opacity,surfaceColor:hi(this.surfaceColor),navigationConstraint:hi(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(t.loadStatus="loaded"),new nEe({resourceInfo:this.resourceInfo}).set(t)}read(t,e){this.resourceInfo||this._set("resourceInfo",{data:t,context:e}),super.read(t,e)}_loadFromSource(t){const e=this.resourceInfo;return e?this._loadLayersFromJSON(e.data,e.context,t):Promise.resolve()}_loadLayersFromJSON(t,e,i){const r=e&&e.origin||"web-scene",n=e&&e.portal||null,s=e&&e.url||null;return Promise.resolve().then(()=>ept).then(({populateOperationalLayers:o})=>{sn(i);const a=[];if(t.layers&&Array.isArray(t.layers)){const l={context:{origin:r,url:s,portal:n,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};a.push(o(this.layers,t.layers,l))}return bu(a)}).then(()=>{})}};function cQt(t){return t&&"createElevationSampler"in t}function LZe(t){return t.type==="elevation"||cQt(t)}E([k({json:{read:!1}})],pT.prototype,"layers",null),E([mr("layers")],pT.prototype,"writeLayers",null),E([k({readOnly:!0})],pT.prototype,"resourceInfo",void 0),E([k({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:xs,read:{reader:p9,source:"transparency"},write:{writer:(t,e)=>{e.transparency=Kne(t)},target:"transparency"}}})],pT.prototype,"opacity",void 0),E([k({type:Boolean,nonNullable:!0,json:{read:!1}})],pT.prototype,"shading",void 0),E([k({type:$r,json:{type:[xs],write:(t,e)=>{e.surfaceColor=t.toJSON().slice(0,3)}}})],pT.prototype,"surfaceColor",void 0),E([k({type:Wae,json:{write:!0}})],pT.prototype,"navigationConstraint",void 0),pT=nEe=E([ht("esri.Ground")],pT);const qae=pT;function hQt(t){return!(!t?.loaded||!TL(t)?.operations?.supportsEditing||"editingEnabled"in t&&!NUe(t))}const kZe=Ei.getLogger("esri.support.basemapUtils");function dQt(){return{}}function pQt(t){for(const e in t){const i=t[e];i?.destroyed===!1&&i.destroy(),delete t[e]}}function fQt(t,e){let i;if(typeof t=="string"){if(!(t in F1e)){const r=Object.entries(F1e).filter(([n,s])=>na.apiKey&&!s.classic||!na.apiKey&&s.classic&&!s.deprecated).map(([n])=>`"${n}"`).join(", ");return kZe.warn(`Unable to find basemap definition for: ${t}. Try one of these: ${r}`),null}e&&(i=e[t]),i||(i=iR.fromId(t),e&&(e[t]=i))}else i=ud(iR,t);return i?.destroyed&&(kZe.warn("The provided basemap is already destroyed",{basemap:i}),i=null),i}function mQt(t,e){return t===e?!0:bQt(NZe(t),NZe(e),{mustMatchReferences:!0})==="equal"}function gQt(t,e){if(lt(e)||lt(t))return{spatialReference:null,updating:!1};if(e.loadStatus==="not-loaded")return e.load(),{spatialReference:null,updating:!0};if(e.spatialReference)return{spatialReference:e.spatialReference,updating:!1};if(e.baseLayers.length===0)return{spatialReference:null,updating:!1};const i=e.baseLayers.getItemAt(0);switch(i.loadStatus){case"not-loaded":i.load();case"loading":return{spatialReference:null,updating:!0};case"failed":return{spatialReference:null,updating:!1}}const r=(("supportedSpatialReferences"in i?i.supportedSpatialReferences:null)||["tileInfo"in i?i.tileInfo?.spatialReference:i.spatialReference]).filter(Boolean),n=t.spatialReference;return n?{spatialReference:r.find(s=>n.equals(s))??r[0]??null,updating:!1}:{spatialReference:r[0],updating:!1}}function NZe(t){return t?!t.loaded&&t.resourceInfo?vQt(t.resourceInfo.data):{baseLayers:$Ze(t.baseLayers),referenceLayers:$Ze(t.referenceLayers)}:null}function $Ze(t){return(fr.isCollection(t)?t.toArray():t).map(yQt)}function yQt(t){return{type:t.type,url:VZe("urlTemplate"in t&&t.urlTemplate||t.url||"styleUrl"in t&&t.styleUrl||""),minScale:"minScale"in t&&t.minScale!=null?t.minScale:0,maxScale:"maxScale"in t&&t.maxScale!=null?t.maxScale:0,opacity:t.opacity!=null?t.opacity:1,visible:t.visible==null||!!t.visible,sublayers:t.type!=="map-image"&&t.type!=="wms"||!ye(t.sublayers)?void 0:t.sublayers?.map(e=>({id:e.id,visible:e.visible})),activeLayerId:t.type==="wmts"?t.activeLayer?.id:void 0}}function vQt(t){return t?{baseLayers:BZe((t.baseMapLayers??[]).filter(e=>!e.isReference)),referenceLayers:BZe((t.baseMapLayers??[]).filter(e=>e.isReference))}:null}function BZe(t){return t.map(e=>_Qt(e))}function _Qt(t){let e;switch(t.layerType){case"VectorTileLayer":e="vector-tile";break;case"ArcGISTiledMapServiceLayer":e="tile";break;default:e="unknown"}return{type:e,url:VZe(t.templateUrl||t.urlTemplate||t.styleUrl||t.url),minScale:t.minScale!=null?t.minScale:0,maxScale:t.maxScale!=null?t.maxScale:0,opacity:t.opacity!=null?t.opacity:1,visible:t.visibility==null||!!t.visibility,sublayers:void 0,activeLayerId:void 0}}function bQt(t,e,i){return t!=null!=(e!=null)?"not-equal":!t||!e?"equal":GZe(t.baseLayers,e.baseLayers)?GZe(t.referenceLayers,e.referenceLayers)?"equal":i.mustMatchReferences?"not-equal":"base-layers-equal":"not-equal"}function GZe(t,e){if(t.length!==e.length)return!1;for(let i=0;i[t.tables,t.layers],getChildrenFunction:e=>{const i=[];return"tables"in e&&i.push(e.tables),"layers"in e&&i.push(e.layers),i},itemFilterFunction:e=>{const i=e.parent;return!!i&&"tables"in i&&i.tables.includes(e)}})}const jZe={"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 xQt(t){let e=null;if(typeof t=="string")if(t in jZe){const i=jZe[t];e=new qae({resourceInfo:{data:{layers:[i]}}})}else Ei.getLogger("esri.support.groundUtils").warn(`Unable to find ground definition for: ${t}. Try "world-elevation"`);else e=ud(qae,t);return e}function sEe(t,e,i){let r,n;if(t)for(let s=0,o=t.length;s{let e=class extends t{constructor(...i){super(...i),this.layers=new fr;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"||Ei.getLogger(this.declaredClass).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.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 i=this.layers.removeAll();for(const r of i)this.layerRemoved(r),r.destroy();this.layers.destroy()}set layers(i){this._set("layers",rg(i,this._get("layers")))}add(i,r){const n=this.layers;if(r=n.getNextIndex(r),i instanceof iu){const s=i;s.parent===this?this.reorder(s,r):n.add(s,r)}else Ip(i)?i.then(s=>{this.destroyed||this.add(s,r)}):Ei.getLogger(this.declaredClass).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(i,r){const n=this.layers;let s=n.getNextIndex(r);i.slice().forEach(o=>{o.parent!==this?(n.add(o,s),s+=1):this.reorder(o,s)})}findLayerById(i){return sEe(this.layers,"id",i)}findLayerByUid(i){return sEe(this.layers,"uid",i)}remove(i){return this.layers.remove(i)}removeMany(i){return this.layers.removeMany(i)}removeAll(){return this.layers.removeAll()}reorder(i,r){return this.layers.reorder(i,r)}layerAdded(i){}layerRemoved(i){}};return E([k()],e.prototype,"layers",null),e=E([ht("esri.support.LayersMixin")],e),e};function oEe(t,e,i){if(t)for(let r=0,n=t.length;r{let e=class extends t{constructor(...i){super(...i),this.tables=new fr,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"&&Ei.getLogger(this.declaredClass).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 i=this.tables.removeAll();for(const r of i)r.destroy();this.tables.destroy()}set tables(i){this._set("tables",rg(i,this._get("tables")))}findTableById(i){return oEe(this.tables,"id",i)}findTableByUid(i){return oEe(this.tables,"uid",i)}};return E([k()],e.prototype,"tables",null),e=E([ht("esri.support.TablesMixin")],e),e};let fT=class extends HZe(zZe(cd.EventedMixin(fn))){constructor(e){super(e),this.allLayers=new k2({getCollections:()=>[this.basemap?.baseLayers,this.ground?.layers,this.layers,this.basemap?.referenceLayers],getChildrenFunction:i=>"layers"in i?i.layers:null}),this.allTables=UZe(this),this.basemap=null,this.editableLayers=new k2({getCollections:()=>[this.allLayers],itemFilterFunction:hQt}),this.ground=new qae,this._basemapCache=dQt()}destroy(){this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),this.ground?.destroy(),this.basemap?.destroy(),pQt(this._basemapCache),this._basemapCache=null}castBasemap(e){return fQt(e,this._basemapCache)}castGround(e){const i=xQt(e);return lt(i)?this._get("ground"):i}findLayerById(e){return this.allLayers.find(i=>i.id===e)}findTableById(e){return this.allTables.find(i=>i.id===e)}};E([k({readOnly:!0,dependsOn:[]})],fT.prototype,"allLayers",void 0),E([k({readOnly:!0})],fT.prototype,"allTables",void 0),E([k({type:iR})],fT.prototype,"basemap",void 0),E([Zs("basemap")],fT.prototype,"castBasemap",null),E([k({readOnly:!0})],fT.prototype,"editableLayers",void 0),E([k({type:qae,nonNullable:!0})],fT.prototype,"ground",void 0),E([Zs("ground")],fT.prototype,"castGround",null),fT=E([ht("esri.Map")],fT);const WZe=fT;function SQt(t){const e=t.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 CQt(t,e){const i={};for(const r of e){const{parentObjectId:n,parentGlobalId:s,attachmentInfos:o}=r;for(const a of o){const{id:l}=a,c=kVe(b$t(`${t.path}/${n}/attachments/${l}`)),d=jJe.fromJSON(a);d.set({url:c,parentObjectId:n,parentGlobalId:s}),i[n]?i[n].push(d):i[n]=[d]}}return i}function TQt(t,e,i){let r={query:gY({...t.query,f:"json",...SQt(e)})};return i&&(r={...i,...r,query:{...i.query,...r.query}}),ir(t.path+"/queryAttachments",r).then(n=>n.data.attachmentGroups)}async function EQt(t,e,i){const{objectIds:r}=e,n=[];for(const s of r)n.push(ir(t.path+"/"+s+"/attachments",i));return Promise.all(n).then(s=>r.map((o,a)=>({parentObjectId:o,attachmentInfos:s[a].data.attachmentInfos})))}const IQt=Object.freeze(Object.defineProperty({__proto__:null,executeAttachmentQuery:TQt,fetchAttachments:EQt,processAttachmentQueryResult:CQt},Symbol.toStringTag,{value:"Module"}));function AQt(t,e){const i=t.toJSON();return i.objectIds&&(i.objectIds=i.objectIds.join(",")),i.orderByFields&&(i.orderByFields=i.orderByFields.join(",")),i.outFields&&!e?.returnCountOnly?i.outFields.includes("*")?i.outFields="*":i.outFields=i.outFields.join(","):delete i.outFields,i.outSpatialReference&&(i.outSR=i.outSR.wkid||JSON.stringify(i.outSR.toJSON()),delete i.outSpatialReference),i.dynamicDataSource&&(i.layer=JSON.stringify({source:i.dynamicDataSource}),delete i.dynamicDataSource),i}async function PQt(t,e,i){const r=await qZe(t,e,i),n=r.data,s=n.geometryType,o=n.spatialReference,a={};for(const l of n.relatedRecordGroups){const c={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]=c;else for(const d in l)l.hasOwnProperty(d)&&d!=="relatedRecords"&&(a[l[d]]=c)}return{...r,data:a}}async function OQt(t,e,i){const r=await qZe(t,e,i,{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 qZe(t,e,i={},r){const n=gY({...t.query,f:"json",...r,...AQt(e,r)});return ir(t.path+"/queryRelatedRecords",{...i,query:{...i.query,...n}})}async function RQt(t,e,i){e=eT.from(e);const r=sh(t);return PQt(r,e,i).then(n=>{const s=n.data,o={};return Object.keys(s).forEach(a=>o[a]=Wu.fromJSON(s[a])),o})}async function MQt(t,e,i){e=eT.from(e);const r=sh(t);return OQt(r,e,{...i}).then(n=>n.data)}const YZe=Object.freeze(Object.defineProperty({__proto__:null,executeRelationshipQuery:RQt,executeRelationshipQueryForCount:MQt},Symbol.toStringTag,{value:"Module"})),XZe="Layer does not support extent calculation.";function DQt(t,e){const i=t.geometry,r=t.toJSON(),n=r;if(ye(i)&&(n.geometry=JSON.stringify(i),n.geometryType=md(i),n.inSR=i.spatialReference.wkid||JSON.stringify(i.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=r.outSR.wkid||JSON.stringify(r.outSR):i&&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 FQt(t,e,i,r){const n=await Yae(t,e,"json",r);return soe(e,i,n.data),n}async function LQt(t,e,i){return ye(e.timeExtent)&&e.timeExtent.isEmpty?{data:{objectIds:[]}}:Yae(t,e,"json",i,{returnIdsOnly:!0})}async function kQt(t,e,i){return ye(e.timeExtent)&&e.timeExtent.isEmpty?{data:{count:0,extent:null}}:Yae(t,e,"json",i,{returnExtentOnly:!0,returnCountOnly:!0}).then(r=>{const n=r.data;if(n.hasOwnProperty("extent"))return r;if(n.features)throw new Error(XZe);if(n.hasOwnProperty("count"))throw new Error(XZe);return r})}function NQt(t,e,i){return ye(e.timeExtent)&&e.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):Yae(t,e,"json",i,{returnIdsOnly:!0,returnCountOnly:!0})}function Yae(t,e,i,r={},n={}){const s=typeof t=="string"?sa(t):t,o=e.geometry?[e.geometry]:[];return r.responseType=i==="pbf"?"array-buffer":"json",iv(o,null,r).then(a=>{const l=a&&a[0];ye(l)&&((e=e.clone()).geometry=l);const c=gY({...s.query,f:i,...n,...DQt(e,n)});return ir(dd(s.path,"queryTopFeatures"),{...r,query:{...c,...r.query}})})}async function $Qt(t,e,i,r){const n=sh(t),s={...r},{data:o}=await FQt(n,QR.from(e),i,s);return Wu.fromJSON(o)}const BQt=Object.freeze(Object.defineProperty({__proto__:null,executeTopFeaturesQuery:$Qt},Symbol.toStringTag,{value:"Module"}));async function GQt(t,e,i){const r=sh(t);return(await LQt(r,QR.from(e),{...i})).data.objectIds}const VQt=Object.freeze(Object.defineProperty({__proto__:null,executeForTopIds:GQt},Symbol.toStringTag,{value:"Module"}));async function UQt(t,e,i){const r=sh(t),n=await kQt(r,QR.from(e),{...i});return{count:n.data.count,extent:vr.fromJSON(n.data.extent)}}const jQt=Object.freeze(Object.defineProperty({__proto__:null,executeForTopExtents:UQt},Symbol.toStringTag,{value:"Module"}));async function zQt(t,e,i){const r=sh(t);return(await NQt(r,QR.from(e),{...i})).data.count}const HQt=Object.freeze(Object.defineProperty({__proto__:null,executeForTopCount:zQt},Symbol.toStringTag,{value:"Module"}));let aEe=class{constructor(e,i){this.min=e,this.max=i,this.range=i-e}ndiff(e,i=0){return Math.ceil((e-i)/this.range)*this.range+i}_normalize(e,i,r,n=0,s=!1){return(r-=n)i&&(r-=this.ndiff(r-i)),s&&r===i&&(r=e),r+n}normalize(e,i=0,r=!1){return this._normalize(this.min,this.max,e,i,r)}clamp(e,i=0){return Hl(e-i,this.min,this.max)+i}monotonic(e,i,r){return ee&&rgw.normalize(Ld(t)))],qA.prototype,"heading",void 0),E([k({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Zs(t=>Hl(Ld(t),-180,180))],qA.prototype,"tilt",void 0),E([k({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],qA.prototype,"fov",void 0),qA=E([ht("esri.Camera")],qA);const WQt=qA;var uEe;let dM=uEe=class extends Ni{constructor(t){super(t),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(t){return(t%=360)<0&&(t+=360),t}clone(){return new uEe({rotation:this.rotation,scale:this.scale,targetGeometry:ye(this.targetGeometry)?this.targetGeometry.clone():null,camera:ye(this.camera)?this.camera.clone():null})}};function cEe(){return{enabled:!this.camera}}E([k({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:cEe}}}}})],dM.prototype,"rotation",void 0),E([Zs("rotation")],dM.prototype,"castRotation",null),E([k({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:cEe}}}}})],dM.prototype,"scale",void 0),E([k({types:P1,json:{read:fl,write:!0,origins:{"web-scene":{read:fl,write:{overridePolicy:cEe}}}}})],dM.prototype,"targetGeometry",void 0),E([k({type:WQt,json:{write:!0}})],dM.prototype,"camera",void 0),dM=uEe=E([ht("esri.Viewpoint")],dM);const u_=dM,Xae={widthBreakpoint:{getValue(t){const e=t.viewSize[0],i=t.breakpoints,r=this.values;return e<=i.xsmall?r.xsmall:e<=i.small?r.small:e<=i.medium?r.medium:e<=i.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(t){const e=t.viewSize[1],i=t.breakpoints,r=this.values;return e<=i.xsmall?r.xsmall:e<=i.small?r.small:e<=i.medium?r.medium:e<=i.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(t){const e=t.viewSize,i=e[0],r=e[1],n=this.values;return r>=i?n.portrait:n.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},hEe={xsmall:544,small:768,medium:992,large:1200};function qQt(t){const e=t;return e&&e.xsmall{let e=class extends t{constructor(...i){super(...i),this._breakpointsHandles=new uf,this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=hEe}initialize(){this._breakpointsHandles.add(Qi(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),Fo))}destroy(){this.destroyed||(this._removeActiveClassNames(),this._breakpointsHandles=ra(this._breakpointsHandles))}set breakpoints(i){if(i===this._get("breakpoints"))return;const r=qQt(i);if(!r){const n=JSON.stringify(hEe,null,2);console.warn("provided breakpoints are not valid, using defaults:"+n)}i=r?i:hEe,this._set("breakpoints",{...i})}_updateClassNames(){if(!this.container)return;const i=Bg.acquire(),r=Bg.acquire();let n,s=!1;for(n in Xae){const o=this[n],a=Xae[n].getValue({viewSize:this.size,breakpoints:this.breakpoints});o!==a&&(s=!0,this[n]=a,dEe(n,o).forEach(l=>r.push(l)),dEe(n,a).forEach(l=>i.push(l)))}s&&(this._applyClassNameChanges(i,r),Bg.release(i),Bg.release(r))}_applyClassNameChanges(i,r){const n=this.container;n&&(r.forEach(s=>n.classList.remove(s)),i.forEach(s=>n.classList.add(s)))}_removeActiveClassNames(){const i=this.container;if(!i)return;let r;for(r in Xae)dEe(r,this[r]).forEach(n=>i.classList.remove(n))}};return E([k()],e.prototype,"breakpoints",null),E([k()],e.prototype,"orientation",void 0),E([k()],e.prototype,"widthBreakpoint",void 0),E([k()],e.prototype,"heightBreakpoint",void 0),e=E([ht("esri.views.BreakpointsOwner")],e),e};function pEe(t){return typeof t=="string"?document.getElementById(t):t??null}function KZe(t){for(;t.hasChildNodes();)t.removeChild(t.firstChild)}function JZe(t,e){const i=e.parentNode;i&&i.insertBefore(t,e)}function ZZe(t,e){for(;;){const i=t.firstChild;if(!i)break;e.appendChild(i)}}/*! + at `+c}return s},e.buildMessage=function(n,s){var o={literal:function(v){return'"'+l(v.text)+'"'},class:function(v){var x=v.parts.map(function(I){return Array.isArray(I)?c(I[0])+"-"+c(I[1]):c(I)});return"["+(v.inverted?"^":"")+x.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(v){return v.description}};function a(v){return v.charCodeAt(0).toString(16).toUpperCase()}function l(v){return v.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(x){return"\\x0"+a(x)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(x){return"\\x"+a(x)})}function c(v){return v.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(x){return"\\x0"+a(x)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(x){return"\\x"+a(x)})}function h(v){return o[v.type](v)}function p(v){var x,I,P=v.map(h);if(P.sort(),P.length>0){for(x=1,I=1;x, Actual: ${ooe(t)}`,{term:t})}const m2e={px:1,cm:96/2.54,mm:96/2.54/10,in:96,pc:16,pt:96/72};function P7t(t){if(t.type!=="quantity"||!(t.value===0&&t.unit===null||t.unit&&m2e[t.unit]!=null))throw new st("effect:type-error",`Expected , Actual: ${ooe(t)}`,{term:t})}function g2(t){I7t(t);const e=t.value;return _q(e,t),t.unit==="%"?.01*e:e}function O7t(t){return E7t(t),_q(t.value,t),t.value}function R7t(t){return A7t(t),t.value*f2e[t.unit]||0}function g2e(t){return P7t(t),t.value*m2e[t.unit]||0}function M7t(t){switch(t.colorType){case"hex":return t9t(t.value);case"named":return iWe(t.value);case"function":return L7t(t.value)}}function iWe(t){if(!UGe(t))throw new st("effect:unknown-color",`color '${t}' isn't valid`,{namedColor:t});return e9t(t)}const D7t=/^rgba?/i,F7t=/^hsla?/i;function L7t(t){if(N9(t.parameters,4),D7t.test(t.name))return[g2(t.parameters[0]),g2(t.parameters[1]),g2(t.parameters[2]),t.parameters[3]?g2(t.parameters[3]):1];if(F7t.test(t.name))return zGe(O7t(t.parameters[0]),g2(t.parameters[1]),g2(t.parameters[2]),t.parameters[3]?g2(t.parameters[3]):1);throw new st("effect:syntax-error",`Invalid color function '${t.name}'`,{colorFunction:t})}function y2e(t,e,i){try{return k7t(t)}catch(r){i?.messages?.push(r)}return null}function v2e(t,e,i,r){try{const n=N7t(t);Dp(i,n,e)}catch(n){r.messages&&r.messages.push(n)}}function N7t(t){const e=p2e(t);return e?v7t(e)?e.map(i=>i.toJSON()):e.map(({scale:i,effects:r})=>({scale:i,value:r.map(n=>n.toJSON())})):null}function k7t(t){if(!t||t.length===0)return null;if($7t(t)){const e=[];for(const i of t)e.push({scale:i.scale,value:rWe(i.value)});return e}return rWe(t)}function $7t(t){const e=t[0];return!!e&&"scale"in e}function rWe(t){if(!t||!t.length)return"";const e=[];for(const i of t){let r=[];switch(i.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":r=[SA(i,"amount")];break;case"blur":r=[SA(i,"radius","pt")];break;case"hue-rotate":r=[SA(i,"angle","deg")];break;case"drop-shadow":r=[SA(i,"xoffset","pt"),SA(i,"yoffset","pt"),SA(i,"blurRadius","pt"),B7t(i,"color")];break;case"bloom":r=[SA(i,"strength"),SA(i,"radius","pt"),SA(i,"threshold")]}const n=`${i.type}(${r.filter(Boolean).join(" ")})`;p2e(n),e.push(n)}return e.join(" ")}function SA(t,e,i){if(t[e]==null)throw new st("effect:missing-parameter",`Missing parameter '${e}' in ${t.type} effect`,{effect:t});return i?t[e]+i:""+t[e]}function B7t(t,e){if(t[e]==null)throw new st("effect:missing-parameter",`Missing parameter '${e}' in ${t.type} effect`,{effect:t});const i=t[e];return`rgba(${i[0]||0}, ${i[1]||0}, ${i[2]||0}, ${i[3]/255||0})`}const nWe={read:{reader:y2e},write:{allowNull:!0,writer:v2e}},up=t=>{let e=class extends t{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return E([N({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),E([N({json:{read:!1,write:!1,origins:{"web-map":nWe,"portal-item":nWe}}})],e.prototype,"effect",void 0),e=E([dt("esri.layers.mixins.BlendLayer")],e),e},y2=t=>{let e=class extends t{constructor(){super(...arguments),this.customParameters=null}};return E([N({type:Object,json:{write:{overridePolicy:i=>({enabled:!!(i&&Object.keys(i).length>0)})}}})],e.prototype,"customParameters",void 0),e=E([dt("esri.layers.mixins.CustomParametersMixin")],e),e},sWe=new md.EventEmitter,oWe="esri.layers.mixins.EditBusLayer",aWe=Symbol(oWe);function V7t(t){return t!=null&&typeof t=="object"&&aWe in t}const _2e=t=>{var e;let i=class extends t{constructor(...r){super(...r),this[e]=!0,this.when().then(()=>{this.own([sWe.on("edits",n=>{const s="layer"in n?n.layer:null,o="layer"in n?n.layer?.url:n.serviceUrl,a="layer"in n?n.layer?.layerId:n.layerId,l=n.event;if(s===this||o!==this.url)return;if(a!=null&&this.layerId!=null&&a===this.layerId)return void this.emit("edits",gi(l));const c=l.editedFeatures?.find(({layerId:h})=>h===this.layerId);if(c){const{adds:h,updates:p,deletes:y}=c.editedFeatures,v={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:h?h.map(({attributes:x})=>({objectId:this.objectIdField&&x[this.objectIdField],globalId:this.globalIdField&&x[this.globalIdField]})):[],deletedFeatures:y?y.map(({attributes:x})=>({objectId:this.objectIdField&&x[this.objectIdField],globalId:this.globalIdField&&x[this.globalIdField]})):[],updatedFeatures:p?p.map(({current:{attributes:x}})=>({objectId:this.objectIdField&&x[this.objectIdField],globalId:this.globalIdField&&x[this.globalIdField]})):[],editedFeatures:gi(l.editedFeatures),exceededTransferLimit:!1};this.emit("edits",v)}})])},()=>{})}};return e=aWe,i=E([dt(oWe)],i),i},lWe={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},j7t={milliseconds:{getter:"getMilliseconds",setter:"setMilliseconds",multiplier:1},seconds:{getter:"getSeconds",setter:"setSeconds",multiplier:1},minutes:{getter:"getMinutes",setter:"setMinutes",multiplier:1},hours:{getter:"getHours",setter:"setHours",multiplier:1},days:{getter:"getDate",setter:"setDate",multiplier:1},weeks:{getter:"getDate",setter:"setDate",multiplier:7},months:{getter:"getMonth",setter:"setMonth",multiplier:1},years:{getter:"getFullYear",setter:"setFullYear",multiplier:1},decades:{getter:"getFullYear",setter:"setFullYear",multiplier:10},centuries:{getter:"getFullYear",setter:"setFullYear",multiplier:100}};function G7t(t,e){const i=new Date(t,e+1,1);return i.setDate(0),i.getDate()}function g5(t,e,i){const r=new Date(t.getTime());if(e&&i){const n=j7t[i],{getter:s,setter:o,multiplier:a}=n;if(i==="months"){const l=G7t(r.getFullYear(),r.getMonth()+e);r.getDate()>l&&r.setDate(l)}r[o](r[s]()+e*a)}return r}function uWe(t,e){switch(e){case"milliseconds":return new Date(t.getTime());case"seconds":return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds());case"minutes":return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes());case"hours":return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours());case"days":return new Date(t.getFullYear(),t.getMonth(),t.getDate());case"weeks":return new Date(t.getFullYear(),t.getMonth(),t.getDate()-t.getDay());case"months":return new Date(t.getFullYear(),t.getMonth(),1);case"years":return new Date(t.getFullYear(),0,1);case"decades":return new Date(t.getFullYear()-t.getFullYear()%10,0,1);case"centuries":return new Date(t.getFullYear()-t.getFullYear()%100,0,1);default:return new Date}}function U7t(t,e,i){return t===0?0:t*lWe[e]/lWe[i]}var v2;let k1=v2=class extends Ui{static get allTime(){return cWe}static get empty(){return z7t}constructor(t){super(t),this.end=null,this.start=null}readEnd(t,e){return e.end!=null?new Date(e.end):null}writeEnd(t,e){e.end=t?t.getTime():null}get isAllTime(){return this.equals(v2.allTime)}get isEmpty(){return this.equals(v2.empty)}readStart(t,e){return e.start!=null?new Date(e.start):null}writeStart(t,e){e.start=t?t.getTime():null}clone(){return new v2({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=ve(this.start)?this.start.getTime():this.start,i=ve(this.end)?this.end.getTime():this.end,r=ve(t.start)?t.start.getTime():t.start,n=ve(t.end)?t.end.getTime():t.end;return e===r&&i===n}expandTo(t){if(this.isEmpty||this.isAllTime)return this.clone();const e=Pa(this.start,r=>uWe(r,t)),i=Pa(this.end,r=>{const n=uWe(r,t);return r.getTime()===n.getTime()?n:g5(n,1,t)});return new v2({start:e,end:i})}intersection(t){if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return v2.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=Hv(this.start,-1/0,a=>a.getTime()),i=Hv(this.end,1/0,a=>a.getTime()),r=Hv(t.start,-1/0,a=>a.getTime()),n=Hv(t.end,1/0,a=>a.getTime());let s,o;if(r>=e&&r<=i?s=r:e>=r&&e<=n&&(s=e),i>=r&&i<=n?o=i:n>=e&&n<=i&&(o=n),s!=null&&o!=null&&!isNaN(s)&&!isNaN(o)){const a=new v2;return a.start=s===-1/0?null:new Date(s),a.end=o===1/0?null:new Date(o),a}return v2.empty}offset(t,e){if(this.isEmpty||this.isAllTime)return this.clone();const i=new v2,{start:r,end:n}=this;return ve(r)&&(i.start=g5(r,t,e)),ve(n)&&(i.end=g5(n,t,e)),i}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return cWe.clone();const e=ve(this.start)&&ve(t.start)?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,i=ve(this.end)&&ve(t.end)?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new v2({start:e,end:i})}};E([N({type:Date,json:{write:{allowNull:!0}}})],k1.prototype,"end",void 0),E([Vi("end")],k1.prototype,"readEnd",null),E([Cr("end")],k1.prototype,"writeEnd",null),E([N({readOnly:!0,json:{read:!1}})],k1.prototype,"isAllTime",null),E([N({readOnly:!0,json:{read:!1}})],k1.prototype,"isEmpty",null),E([N({type:Date,json:{write:{allowNull:!0}}})],k1.prototype,"start",void 0),E([Vi("start")],k1.prototype,"readStart",null),E([Cr("start")],k1.prototype,"writeStart",null),k1=v2=E([dt("esri.TimeExtent")],k1);const cWe=new k1,z7t=new k1({start:void 0,end:void 0}),Xg=k1;var b2e;let CA=b2e=class extends Ui{constructor(t){super(t),this.type="map-layer"}clone(){const{mapLayerId:t,gdbVersion:e}=this;return new b2e({mapLayerId:t,gdbVersion:e})}};E([rn({mapLayer:"map-layer"})],CA.prototype,"type",void 0),E([N({type:Ls,json:{write:!0}})],CA.prototype,"mapLayerId",void 0),E([N({type:String,json:{write:!0}})],CA.prototype,"gdbVersion",void 0),CA=b2e=E([dt("esri.layers.support.source.MapLayerSource")],CA);var w2e;let TA=w2e=class extends Ui{constructor(t){super(t),this.type="query-table"}clone(){const{workspaceId:t,query:e,oidFields:i,spatialReference:r,geometryType:n}=this,s={workspaceId:t,query:e,oidFields:i,spatialReference:r?.clone()??void 0,geometryType:n};return new w2e(s)}};E([rn({queryTable:"query-table"})],TA.prototype,"type",void 0),E([N({type:String,json:{write:!0}})],TA.prototype,"workspaceId",void 0),E([N({type:String,json:{write:!0}})],TA.prototype,"query",void 0),E([N({type:String,json:{write:!0}})],TA.prototype,"oidFields",void 0),E([N({type:hr,json:{write:!0}})],TA.prototype,"spatialReference",void 0),E([rn(Yy)],TA.prototype,"geometryType",void 0),TA=w2e=E([dt("esri.layers.support.source.QueryTableDataSource")],TA);var x2e;let k9=x2e=class extends Ui{constructor(t){super(t),this.type="raster"}clone(){const{workspaceId:t,dataSourceName:e}=this;return new x2e({workspaceId:t,dataSourceName:e})}};E([rn({raster:"raster"})],k9.prototype,"type",void 0),E([N({type:String,json:{write:!0}})],k9.prototype,"dataSourceName",void 0),E([N({type:String,json:{write:!0}})],k9.prototype,"workspaceId",void 0),k9=x2e=E([dt("esri.layers.support.source.RasterDataSource")],k9);var S2e;let y5=S2e=class extends Ui{constructor(t){super(t),this.type="table"}clone(){const{workspaceId:t,gdbVersion:e,dataSourceName:i}=this;return new S2e({workspaceId:t,gdbVersion:e,dataSourceName:i})}};E([rn({table:"table"})],y5.prototype,"type",void 0),E([N({type:String,json:{write:!0}})],y5.prototype,"workspaceId",void 0),E([N({type:String,json:{write:!0}})],y5.prototype,"gdbVersion",void 0),E([N({type:String,json:{write:!0}})],y5.prototype,"dataSourceName",void 0),y5=S2e=E([dt("esri.layers.support.source.TableDataSource")],y5);var C2e,T2e;const H7t=ta()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let $1=C2e=class extends Ui{constructor(t){super(t),this.type="join-table"}readLeftTableSource(t,e,i){return hWe()(t,e,i)}castLeftTableSource(t){return wC(A2e(),t)}readRightTableSource(t,e,i){return hWe()(t,e,i)}castRightTableSource(t){return wC(A2e(),t)}clone(){const{leftTableKey:t,rightTableKey:e,leftTableSource:i,rightTableSource:r,joinType:n}=this,s={leftTableKey:t,rightTableKey:e,leftTableSource:i?.clone()??void 0,rightTableSource:r?.clone()??void 0,joinType:n};return new C2e(s)}};E([rn({joinTable:"join-table"})],$1.prototype,"type",void 0),E([N({type:String,json:{write:!0}})],$1.prototype,"leftTableKey",void 0),E([N({type:String,json:{write:!0}})],$1.prototype,"rightTableKey",void 0),E([N({json:{write:!0}})],$1.prototype,"leftTableSource",void 0),E([Vi("leftTableSource")],$1.prototype,"readLeftTableSource",null),E([ho("leftTableSource")],$1.prototype,"castLeftTableSource",null),E([N({json:{write:!0}})],$1.prototype,"rightTableSource",void 0),E([Vi("rightTableSource")],$1.prototype,"readRightTableSource",null),E([ho("rightTableSource")],$1.prototype,"castRightTableSource",null),E([rn(H7t)],$1.prototype,"joinType",void 0),$1=C2e=E([dt("esri.layers.support.source.JoinTableDataSource")],$1);let E2e=null;function hWe(){return E2e||(E2e=xC({types:A2e()})),E2e}let I2e=null;function A2e(){return I2e||(I2e={key:"type",base:null,typeMap:{"data-layer":rv,"map-layer":CA}}),I2e}const W7t={key:"type",base:null,typeMap:{"join-table":$1,"query-table":TA,raster:k9,table:y5}};let rv=T2e=class extends Ui{constructor(t){super(t),this.type="data-layer"}clone(){const{fields:t,dataSource:e}=this;return new T2e({fields:t,dataSource:e})}};E([rn({dataLayer:"data-layer"})],rv.prototype,"type",void 0),E([N({type:[Jo],json:{write:!0}})],rv.prototype,"fields",void 0),E([N({types:W7t,json:{write:!0}})],rv.prototype,"dataSource",void 0),rv=T2e=E([dt("esri.layers.support.source.DataLayerSource")],rv),rv.from=fd(rv);let v5=class extends _a(Ui){constructor(e){super(e),this.onFields=null,this.operator=null,this.searchTerm=null,this.searchType=null}};E([N({type:[String],json:{write:{enabled:!0,overridePolicy(){return{enabled:ve(this.onFields)&&this.onFields.length>0}}}}})],v5.prototype,"onFields",void 0),E([N({type:String,json:{write:!0}})],v5.prototype,"operator",void 0),E([N({type:String,json:{write:!0}})],v5.prototype,"searchTerm",void 0),E([N({type:String,json:{write:!0}})],v5.prototype,"searchType",void 0),v5=E([dt("esri.rest.support.FullTextSearch")],v5);const q7t=v5;var P2e;const dWe=new Ks({upperLeft:"upper-left",lowerLeft:"lower-left"});let _5=P2e=class extends Ui{constructor(t){super(t),this.extent=null,this.mode="view",this.originPosition="upper-left",this.tolerance=1}clone(){return new P2e(gi({extent:this.extent,mode:this.mode,originPosition:this.originPosition,tolerance:this.tolerance}))}};E([N({type:Ar,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],_5.prototype,"extent",void 0),E([N({type:["view","edit"],json:{write:!0}})],_5.prototype,"mode",void 0),E([N({type:String,json:{read:dWe.read,write:dWe.write}})],_5.prototype,"originPosition",void 0),E([N({type:Number,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],_5.prototype,"tolerance",void 0),_5=P2e=E([dt("esri.rest.support.QuantizationParameters")],_5);const pWe=_5;var O2e;const fWe=new Ks({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 _2=O2e=class extends Ui{constructor(t){super(t),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(t,e){this.statisticType!=="percentile-continuous"&&this.statisticType!=="percentile-discrete"||(e.statisticParameters=gi(t))}clone(){return new O2e({maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount,onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,statisticType:this.statisticType,statisticParameters:gi(this.statisticParameters)})}};E([N({type:Number,json:{write:!0}})],_2.prototype,"maxPointCount",void 0),E([N({type:Number,json:{write:!0}})],_2.prototype,"maxRecordCount",void 0),E([N({type:Number,json:{write:!0}})],_2.prototype,"maxVertexCount",void 0),E([N({type:String,json:{write:!0}})],_2.prototype,"onStatisticField",void 0),E([N({type:String,json:{write:!0}})],_2.prototype,"outStatisticFieldName",void 0),E([N({type:String,json:{read:{source:"statisticType",reader:fWe.read},write:{target:"statisticType",writer:fWe.write}}})],_2.prototype,"statisticType",void 0),E([N({type:Object})],_2.prototype,"statisticParameters",void 0),E([Cr("statisticParameters")],_2.prototype,"writeStatisticParameters",null),_2=O2e=E([dt("esri.rest.support.StatisticDefinition")],_2);const aoe=_2;var $9;const Y7t=new Ks({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),X7t=new Ks({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let Bo=$9=class extends Ui{static from(t){return Gd($9,t)}constructor(t){super(t),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(t){return typeof t=="number"||typeof t=="object"?t:null}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}writeParameterValues(t,e){if(t){const i={};for(const r in t){const n=t[r];Array.isArray(n)?i[r]=n.map(s=>s instanceof Date?s.getTime():s):n instanceof Date?i[r]=n.getTime():i[r]=n}e.parameterValues=i}}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,e.where="1=1"}writeWhere(t,e){e.where=t||"1=1"}clone(){return new $9(gi({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:ve(this.historicMoment)?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}))}};Bo.MAX_MAX_RECORD_COUNT_FACTOR=5,E([N({json:{write:!0}})],Bo.prototype,"aggregateIds",void 0),E([N({type:Boolean,json:{write:!0}})],Bo.prototype,"cacheHint",void 0),E([N({type:Boolean,json:{default:!1,write:!0}})],Bo.prototype,"compactGeometryEnabled",void 0),E([N({json:{write:!0}})],Bo.prototype,"datumTransformation",void 0),E([ho("datumTransformation")],Bo.prototype,"castDatumTransformation",null),E([N({type:Boolean,json:{default:!1,write:!0}})],Bo.prototype,"defaultSpatialReferenceEnabled",void 0),E([N({type:Number,json:{write:{overridePolicy:t=>({enabled:t>0})}}})],Bo.prototype,"distance",void 0),E([N({type:rv,json:{write:!0}})],Bo.prototype,"dynamicDataSource",void 0),E([N({type:String,json:{write:!0}})],Bo.prototype,"formatOf3DObjects",void 0),E([N({type:[q7t],json:{write:{enabled:!0,overridePolicy(){return{enabled:ve(this.fullText)&&this.fullText.length>0}}}}})],Bo.prototype,"fullText",void 0),E([N({type:String,json:{write:!0}})],Bo.prototype,"gdbVersion",void 0),E([N({types:R1,json:{read:Sl,write:!0}})],Bo.prototype,"geometry",void 0),E([N({type:Number,json:{write:!0}})],Bo.prototype,"geometryPrecision",void 0),E([N({type:[String],json:{write:!0}})],Bo.prototype,"groupByFieldsForStatistics",void 0),E([N({type:String,json:{write:!0}})],Bo.prototype,"having",void 0),E([N({type:Date})],Bo.prototype,"historicMoment",void 0),E([Cr("historicMoment")],Bo.prototype,"writeHistoricMoment",null),E([N({type:Number,json:{write:!0}})],Bo.prototype,"maxAllowableOffset",void 0),E([N({type:Number,cast:t=>t<1?1:t>$9.MAX_MAX_RECORD_COUNT_FACTOR?$9.MAX_MAX_RECORD_COUNT_FACTOR:t,json:{write:{overridePolicy:t=>({enabled:t>1})}}})],Bo.prototype,"maxRecordCountFactor",void 0),E([N({type:["xyFootprint"],json:{write:!0}})],Bo.prototype,"multipatchOption",void 0),E([N({type:Number,json:{read:{source:"resultRecordCount"}}})],Bo.prototype,"num",void 0),E([N({json:{write:!0}})],Bo.prototype,"objectIds",void 0),E([N({type:[String],json:{write:!0}})],Bo.prototype,"orderByFields",void 0),E([N({type:[String],json:{write:!0}})],Bo.prototype,"outFields",void 0),E([N({type:hr,json:{name:"outSR",write:!0}})],Bo.prototype,"outSpatialReference",void 0),E([N({type:[aoe],json:{write:{enabled:!0,overridePolicy(){return{enabled:ve(this.outStatistics)&&this.outStatistics.length>0}}}}})],Bo.prototype,"outStatistics",void 0),E([N({json:{write:!0}})],Bo.prototype,"parameterValues",void 0),E([Cr("parameterValues")],Bo.prototype,"writeParameterValues",null),E([N({type:er,json:{write:!0}})],Bo.prototype,"pixelSize",void 0),E([N({type:pWe,json:{write:!0}})],Bo.prototype,"quantizationParameters",void 0),E([N({type:[Object],json:{write:!0}})],Bo.prototype,"rangeValues",void 0),E([N({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:this.spatialRelationship==="relation"}}}}})],Bo.prototype,"relationParameter",void 0),E([N({type:String,json:{write:!0}})],Bo.prototype,"resultType",void 0),E([N({type:Boolean,json:{default:!1,write:!0}})],Bo.prototype,"returnCentroid",void 0),E([N({type:Boolean,json:{default:!1,write:!0}})],Bo.prototype,"returnDistinctValues",void 0),E([N({type:Boolean,json:{default:!0,write:!0}})],Bo.prototype,"returnExceededLimitFeatures",void 0),E([N({type:Boolean,json:{write:!0}})],Bo.prototype,"returnGeometry",void 0),E([N({type:Boolean,json:{default:!1,write:!0}})],Bo.prototype,"returnQueryGeometry",void 0),E([N({type:Boolean,json:{default:!1,write:!0}})],Bo.prototype,"returnM",void 0),E([N({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],Bo.prototype,"returnZ",void 0),E([N({type:hr,json:{write:!0}})],Bo.prototype,"sourceSpatialReference",void 0),E([rn(Y7t,{ignoreUnknown:!1,name:"spatialRel"})],Bo.prototype,"spatialRelationship",void 0),E([N({type:Number,json:{read:{source:"resultOffset"}}})],Bo.prototype,"start",void 0),E([Cr("start"),Cr("num")],Bo.prototype,"writeStart",null),E([N({type:String,json:{write:!0}})],Bo.prototype,"sqlFormat",void 0),E([N({type:String,json:{write:!0}})],Bo.prototype,"text",void 0),E([N({type:Xg,json:{write:!0}})],Bo.prototype,"timeExtent",void 0),E([N({type:Boolean,json:{default:!1,write:!0}})],Bo.prototype,"timeReferenceUnknownClient",void 0),E([rn(X7t,{ignoreUnknown:!1}),N({json:{write:{overridePolicy(t){return{enabled:!!t&&this.distance!=null&&this.distance>0}}}}})],Bo.prototype,"units",void 0),E([N({type:String,json:{write:{overridePolicy(t){return{enabled:t!=null||this.start!=null&&this.start>0}}}}})],Bo.prototype,"where",void 0),E([Cr("where")],Bo.prototype,"writeWhere",null),Bo=$9=E([dt("esri.rest.support.Query")],Bo);const Ns=Bo;var R2e;const M2e=new Ks({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),D2e=new Ks({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let KC=R2e=class extends Ui{constructor(t){super(t),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(t={}){const{where:e,geometry:i,spatialRelationship:r,timeExtent:n,objectIds:s,units:o,distance:a}=this;return new Ns({geometry:gi(i),objectIds:gi(s),spatialRelationship:r,timeExtent:gi(n),where:e,units:o,distance:a,...t})}clone(){const{where:t,geometry:e,spatialRelationship:i,timeExtent:r,objectIds:n,units:s,distance:o}=this;return new R2e({geometry:gi(e),objectIds:gi(n),spatialRelationship:i,timeExtent:gi(r),where:t,units:s,distance:o})}};E([N({type:String,json:{write:!0}})],KC.prototype,"where",void 0),E([N({types:R1,json:{write:!0}})],KC.prototype,"geometry",void 0),E([N({type:M2e.apiValues,json:{name:"spatialRel",read:{reader:M2e.read},write:{allowNull:!1,writer:M2e.write,overridePolicy(){return{enabled:ve(this.geometry)}}}}})],KC.prototype,"spatialRelationship",void 0),E([N({type:Number,json:{write:{overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],KC.prototype,"distance",void 0),E([N({type:[Number],json:{write:!0}})],KC.prototype,"objectIds",void 0),E([N({type:D2e.apiValues,json:{read:D2e.read,write:{writer:D2e.write,overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],KC.prototype,"units",void 0),E([N({type:Xg,json:{write:!0}})],KC.prototype,"timeExtent",void 0),KC=R2e=E([dt("esri.layers.support.FeatureFilter")],KC);const bq=KC;var F2e;const mWe={read:{reader:y2e},write:{writer:v2e,overridePolicy(){return{allowNull:this.excludedEffect!=null,isRequired:this.excludedEffect==null}}}},gWe={read:{reader:y2e},write:{writer:v2e,overridePolicy(){return{allowNull:this.includedEffect!=null,isRequired:this.includedEffect==null}}}},yWe={name:"showExcludedLabels",default:!0};let b5=F2e=class extends Ui{constructor(t){super(t),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(t,e){const i=super.write(t,e);if(e?.origin){if(i.filter){const r=Object.keys(i.filter);if(r.length>1||r[0]!=="where")return e.messages?.push(new st("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 i)return e.messages?.push(new st("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:e.layer,effect:this})),null}return i}clone(){return new F2e({filter:ve(this.filter)?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};E([N({type:bq,json:{write:{allowNull:!0,writer(t,e,i,r){const n=t?.write({},r);n&&Object.keys(n).length!==0?Dp(i,n,e):Dp(i,null,e)}}}})],b5.prototype,"filter",void 0),E([N({json:{write:!0,origins:{"web-map":mWe,"portal-item":mWe}}})],b5.prototype,"includedEffect",void 0),E([N({json:{write:!0,origins:{"web-map":gWe,"portal-item":gWe}}})],b5.prototype,"excludedEffect",void 0),E([N({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":yWe,"portal-item":yWe}}})],b5.prototype,"excludedLabelsVisible",void 0),b5=F2e=E([dt("esri.layers.support.FeatureEffect")],b5);const vWe=b5,_We={write:{allowNull:!0}},wq=t=>{let e=class extends t{constructor(){super(...arguments),this.featureEffect=null}};return E([N({type:vWe,json:{origins:{"web-map":_We,"portal-item":_We}}})],e.prototype,"featureEffect",void 0),e=E([dt("esri.layers.mixins.FeatureEffectLayer")],e),e};var xq;const loe=ta()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),bWe=loe.jsonValues.slice();oVe(bWe,"orthometric");const Sq=ta()({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 b2=xq=class extends Ui{constructor(t){super(t),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(t,e,i){return loe.write(t,e,i)}readHeightModel(t,e,i){return loe.read(t)||(i&&i.messages&&i.messages.push(K7t(t,{context:i})),null)}readHeightUnit(t,e,i){return Sq.read(t)||(i&&i.messages&&i.messages.push(wWe(t,{context:i})),null)}readHeightUnitService(t,e,i){return nGe(t)||Sq.read(t)||(i&&i.messages&&i.messages.push(wWe(t,{context:i})),null)}readVertCRS(t,e){return e.vertCRS||e.ellipsoid||e.geoid}clone(){return new xq({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(t){return!!t&&(this===t||this.heightModel===t.heightModel&&this.heightUnit===t.heightUnit&&this.vertCRS===t.vertCRS)}static deriveUnitFromSR(t,e){const i=L$t(e);return new xq({heightModel:t.heightModel,heightUnit:i,vertCRS:t.vertCRS})}write(t,e){return e={origin:"web-scene",...e},super.write(t,e)}static fromJSON(t){if(!t)return null;const e=new xq;return e.read(t,{origin:"web-scene"}),e}};function wWe(t,e){return new Am("height-unit:unsupported",`Height unit of value '${t}' is not supported`,e)}function K7t(t,e){return new Am("height-model:unsupported",`Height model of value '${t}' is not supported`,e)}E([N({type:loe.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:bWe,default:"ellipsoidal"}}}})],b2.prototype,"heightModel",void 0),E([Cr("web-scene","heightModel")],b2.prototype,"writeHeightModel",null),E([Vi(["web-scene","service"],"heightModel")],b2.prototype,"readHeightModel",null),E([N({type:Sq.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:Sq.jsonValues,write:Sq.write}}}})],b2.prototype,"heightUnit",void 0),E([Vi("web-scene","heightUnit")],b2.prototype,"readHeightUnit",null),E([Vi("service","heightUnit")],b2.prototype,"readHeightUnitService",null),E([N({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],b2.prototype,"vertCRS",void 0),E([Vi("service","vertCRS",["vertCRS","ellipsoid","geoid"])],b2.prototype,"readVertCRS",null),b2=xq=E([dt("esri.geometry.HeightModelInfo")],b2);const B9=b2;function J7t(t){if(!t)return t;const{start:e,end:i}=t;return new Xg({start:ve(e)?g5(e,-e.getTimezoneOffset(),"minutes"):e,end:ve(i)?g5(i,-i.getTimezoneOffset(),"minutes"):i})}function Z7t(t){if(!t)return t;const{start:e,end:i}=t;return new Xg({start:ve(e)?g5(e,e.getTimezoneOffset(),"minutes"):e,end:ve(i)?g5(i,i.getTimezoneOffset(),"minutes"):i})}var L2e;let Cq=L2e=class extends Ui{constructor(t){super(t)}async collectRequiredFields(t,e){return ev(t,e,this.expression)}clone(){return new L2e({expression:this.expression,title:this.title})}equals(t){return this.expression===t.expression&&this.title===t.title}};E([N({type:String,json:{write:!0}})],Cq.prototype,"expression",void 0),E([N({type:String,json:{write:!0}})],Cq.prototype,"title",void 0),Cq=L2e=E([dt("esri.layers.support.FeatureExpressionInfo")],Cq);const xWe=Cq;function Q7t(t){return 1/(XW[t]||1)}function ezt(){const t=Object.keys(XW);return t.sort(),t}const tzt=ezt();var N2e;const uoe=ta()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),SWe=new Ks({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let EA=N2e=class extends Ui{constructor(t){super(t),this.offset=null}readFeatureExpressionInfo(t,e){return t??(e.featureExpression&&e.featureExpression.value===0?{expression:"0"}:void 0)}writeFeatureExpressionInfo(t,e,i,r){e[i]=t.write({},r),t.expression==="0"&&(e.featureExpression={value:0})}get mode(){const{offset:t,featureExpressionInfo:e}=this;return this._isOverridden("mode")?this._get("mode"):ve(t)||e?"relative-to-ground":"on-the-ground"}set mode(t){this._override("mode",t)}set unit(t){this._set("unit",t)}write(t,e){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(t,e):null}clone(){return new N2e({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(t){return this.mode===t.mode&&this.offset===t.offset&&this.unit===t.unit&&yH(this.featureExpressionInfo,t.featureExpressionInfo)}};E([N({type:xWe,json:{write:!0}})],EA.prototype,"featureExpressionInfo",void 0),E([Vi("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],EA.prototype,"readFeatureExpressionInfo",null),E([Cr("featureExpressionInfo",{featureExpressionInfo:{type:xWe},"featureExpression.value":{type:[0]}})],EA.prototype,"writeFeatureExpressionInfo",null),E([N({type:uoe.apiValues,nonNullable:!0,json:{type:uoe.jsonValues,read:uoe.read,write:{writer:uoe.write,isRequired:!0}}})],EA.prototype,"mode",null),E([N({type:Number,json:{write:!0}})],EA.prototype,"offset",void 0),E([N({type:tzt,json:{type:String,read:SWe.read,write:SWe.write}})],EA.prototype,"unit",null),EA=N2e=E([dt("esri.layers.support.ElevationInfo")],EA);const w5=EA,V9={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:!0}},s_={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(t,e)=>!e.disablePopup},write:{enabled:!0,writer(t,e,i){e[i]=!t}}}},IA={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:!0}},Qy={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:hA}}},B1={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:!0}},FR={value:null,type:w5,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:!0}};function k2e(t){return{type:t,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const CWe={write:!0,read:!0},Tq={type:Number,json:{origins:{"web-document":CWe,"portal-item":{write:!0}}}},TWe={...Tq,json:{...Tq.json,origins:{"web-document":{...CWe,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(t,e,i)=>i&&i.origin!=="service"||!e.drawingInfo||e.drawingInfo.transparency===void 0?e.layerDefinition&&e.layerDefinition.drawingInfo&&e.layerDefinition.drawingInfo.transparency!==void 0?h9(e.layerDefinition.drawingInfo.transparency):void 0:h9(e.drawingInfo.transparency)}}},j9={type:Xg,readOnly:!0,get(){if(!this.layer?.timeInfo)return null;const{datesInUnknownTimezone:t,timeOffset:e,useViewTime:i}=this.layer,r=this.view?.timeExtent;let n=this.layer.timeExtent;t&&(n=Z7t(n));let s=i?r&&n?r.intersection(n):r||n:n;if(!s||s.isEmpty||s.isAllTime)return s;e&&(s=s.offset(-e.value,e.unit)),t&&(s=J7t(s));const o=this._get("timeExtent");return s.equals(o)?o:s}},izt={type:Ar,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(t,e)=>{const i=Ar.fromJSON(t);return e.spatialReference!=null&&typeof e.spatialReference=="object"&&(i.spatialReference=hr.fromJSON(e.spatialReference)),i}}}},read:!1}},G9={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},$2e={type:Number,json:{origins:{service:{write:{enabled:!1}}},read:{source:"layerDefinition.minScale"},write:{target:"layerDefinition.minScale"}}},B2e={type:Number,json:{origins:{service:{write:{enabled:!1}}},read:{source:"layerDefinition.maxScale"},write:{target:"layerDefinition.maxScale"}}},EWe={json:{write:{ignoreOrigin:!0},origins:{"web-map":{read:!1,write:!1}}}},IWe=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/Chihuahua"],["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 x5 extends Error{}class rzt extends x5{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class nzt extends x5{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class szt extends x5{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Eq extends x5{}class AWe extends x5{constructor(e){super(`Invalid unit ${e}`)}}class aw extends x5{}class LR extends x5{constructor(){super("Zone is an abstract class")}}const ps="numeric",w2="short",V1="long",coe={year:ps,month:ps,day:ps},PWe={year:ps,month:w2,day:ps},ozt={year:ps,month:w2,day:ps,weekday:w2},OWe={year:ps,month:V1,day:ps},RWe={year:ps,month:V1,day:ps,weekday:V1},MWe={hour:ps,minute:ps},DWe={hour:ps,minute:ps,second:ps},FWe={hour:ps,minute:ps,second:ps,timeZoneName:w2},LWe={hour:ps,minute:ps,second:ps,timeZoneName:V1},NWe={hour:ps,minute:ps,hourCycle:"h23"},kWe={hour:ps,minute:ps,second:ps,hourCycle:"h23"},$We={hour:ps,minute:ps,second:ps,hourCycle:"h23",timeZoneName:w2},BWe={hour:ps,minute:ps,second:ps,hourCycle:"h23",timeZoneName:V1},VWe={year:ps,month:ps,day:ps,hour:ps,minute:ps},jWe={year:ps,month:ps,day:ps,hour:ps,minute:ps,second:ps},GWe={year:ps,month:w2,day:ps,hour:ps,minute:ps},UWe={year:ps,month:w2,day:ps,hour:ps,minute:ps,second:ps},azt={year:ps,month:w2,day:ps,weekday:w2,hour:ps,minute:ps},zWe={year:ps,month:V1,day:ps,hour:ps,minute:ps,timeZoneName:w2},HWe={year:ps,month:V1,day:ps,hour:ps,minute:ps,second:ps,timeZoneName:w2},WWe={year:ps,month:V1,day:ps,weekday:V1,hour:ps,minute:ps,timeZoneName:V1},qWe={year:ps,month:V1,day:ps,weekday:V1,hour:ps,minute:ps,second:ps,timeZoneName:V1};class U9{get type(){throw new LR}get name(){throw new LR}get ianaName(){return this.name}get isUniversal(){throw new LR}offsetName(e,i){throw new LR}formatOffset(e,i){throw new LR}offset(e){throw new LR}equals(e){throw new LR}get isValid(){throw new LR}}let V2e=null;class hoe extends U9{static get instance(){return V2e===null&&(V2e=new hoe),V2e}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:i,locale:r}){return nqe(e,i,r)}formatOffset(e,i){return Oq(this.offset(e),i)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let doe={};function lzt(t){return doe[t]||(doe[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),doe[t]}const uzt={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function czt(t,e){const i=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(i),[,n,s,o,a,l,c,h]=r;return[o,n,s,a,l,c,h]}function hzt(t,e){const i=t.formatToParts(e),r=[];for(let n=0;n=0?x:1e3+x,(y-v)/6e4}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let YWe={};function dzt(t,e={}){const i=JSON.stringify([t,e]);let r=YWe[i];return r||(r=new Intl.ListFormat(t,e),YWe[i]=r),r}let j2e={};function G2e(t,e={}){const i=JSON.stringify([t,e]);let r=j2e[i];return r||(r=new Intl.DateTimeFormat(t,e),j2e[i]=r),r}let U2e={};function pzt(t,e={}){const i=JSON.stringify([t,e]);let r=U2e[i];return r||(r=new Intl.NumberFormat(t,e),U2e[i]=r),r}let z2e={};function fzt(t,e={}){const{base:i,...r}=e,n=JSON.stringify([t,r]);let s=z2e[n];return s||(s=new Intl.RelativeTimeFormat(t,e),z2e[n]=s),s}let Iq=null;function mzt(){return Iq||(Iq=new Intl.DateTimeFormat().resolvedOptions().locale,Iq)}function gzt(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const i=t.indexOf("-u-");if(i===-1)return[t];{let r,n;try{r=G2e(t).resolvedOptions(),n=t}catch{const l=t.substring(0,i);r=G2e(l).resolvedOptions(),n=l}const{numberingSystem:s,calendar:o}=r;return[n,s,o]}}function yzt(t,e,i){return(i||e)&&(t.includes("-u-")||(t+="-u"),i&&(t+=`-ca-${i}`),e&&(t+=`-nu-${e}`)),t}function vzt(t){const e=[];for(let i=1;i<=12;i++){const r=ro.utc(2016,i,1);e.push(t(r))}return e}function _zt(t){const e=[];for(let i=1;i<=7;i++){const r=ro.utc(2016,11,13+i);e.push(t(r))}return e}function foe(t,e,i,r,n){const s=t.listingMode(i);return s==="error"?null:s==="en"?r(e):n(e)}function bzt(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class wzt{constructor(e,i,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:n,floor:s,...o}=r;if(!i||Object.keys(o).length>0){const a={useGrouping:!1,...r};r.padTo>0&&(a.minimumIntegerDigits=r.padTo),this.inf=pzt(e,a)}}format(e){if(this.inf){const i=this.floor?Math.floor(e):e;return this.inf.format(i)}else{const i=this.floor?Math.floor(e):q2e(e,3);return Gf(i,this.padTo)}}}class xzt{constructor(e,i,r){this.opts=r;let n;if(e.zone.isUniversal){const o=-1*(e.offset/60),a=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&x2.create(a).valid?(n=a,this.dt=e):(n="UTC",r.timeZoneName?this.dt=e:this.dt=e.offset===0?e:ro.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,n=e.zone.name);const s={...this.opts};s.timeZone=s.timeZone||n,this.dtf=G2e(i,s)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class Szt{constructor(e,i,r){this.opts={style:"long",...r},!i&&iqe()&&(this.rtf=fzt(e,r))}format(e,i){return this.rtf?this.rtf.format(e,i):Vzt(i,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,i){return this.rtf?this.rtf.formatToParts(e,i):[]}}class Cd{static fromOpts(e){return Cd.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,i,r,n=!1){const s=e||jf.defaultLocale,o=s||(n?"en-US":mzt()),a=i||jf.defaultNumberingSystem,l=r||jf.defaultOutputCalendar;return new Cd(o,a,l,s)}static resetCache(){Iq=null,j2e={},U2e={},z2e={}}static fromObject({locale:e,numberingSystem:i,outputCalendar:r}={}){return Cd.create(e,i,r)}constructor(e,i,r,n){const[s,o,a]=gzt(e);this.locale=s,this.numberingSystem=i||o||null,this.outputCalendar=r||a||null,this.intl=yzt(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=bzt(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),i=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&i?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Cd.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,i=!1,r=!0){return foe(this,e,r,aqe,()=>{const n=i?{month:e,day:"numeric"}:{month:e},s=i?"format":"standalone";return this.monthsCache[s][e]||(this.monthsCache[s][e]=vzt(o=>this.extract(o,n,"month"))),this.monthsCache[s][e]})}weekdays(e,i=!1,r=!0){return foe(this,e,r,cqe,()=>{const n=i?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=i?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=_zt(o=>this.extract(o,n,"weekday"))),this.weekdaysCache[s][e]})}meridiems(e=!0){return foe(this,void 0,e,()=>hqe,()=>{if(!this.meridiemCache){const i={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[ro.utc(2016,11,13,9),ro.utc(2016,11,13,19)].map(r=>this.extract(r,i,"dayperiod"))}return this.meridiemCache})}eras(e,i=!0){return foe(this,e,i,dqe,()=>{const r={era:e};return this.eraCache[e]||(this.eraCache[e]=[ro.utc(-40,1,1),ro.utc(2017,1,1)].map(n=>this.extract(n,r,"era"))),this.eraCache[e]})}extract(e,i,r){const n=this.dtFormatter(e,i),s=n.formatToParts(),o=s.find(a=>a.type.toLowerCase()===r);return o?o.value:null}numberFormatter(e={}){return new wzt(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,i={}){return new xzt(e,this.intl,i)}relFormatter(e={}){return new Szt(this.intl,this.isEnglish(),e)}listFormatter(e={}){return dzt(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let H2e=null;class Kg extends U9{static get utcInstance(){return H2e===null&&(H2e=new Kg(0)),H2e}static instance(e){return e===0?Kg.utcInstance:new Kg(e)}static parseSpecifier(e){if(e){const i=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(i)return new Kg(voe(i[1],i[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Oq(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Oq(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,i){return Oq(this.fixed,i)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class Czt extends U9{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 NR(t,e){if(Xu(t)||t===null)return e;if(t instanceof U9)return t;if(Tzt(t)){const i=t.toLowerCase();return i==="default"?e:i==="local"||i==="system"?hoe.instance:i==="utc"||i==="gmt"?Kg.utcInstance:Kg.parseSpecifier(i)||x2.create(t)}else return S5(t)?Kg.instance(t):typeof t=="object"&&t.offset&&typeof t.offset=="number"?t:new Czt(t)}let XWe=()=>Date.now(),KWe="system",JWe=null,ZWe=null,QWe=null,eqe=60,tqe;class jf{static get now(){return XWe}static set now(e){XWe=e}static set defaultZone(e){KWe=e}static get defaultZone(){return NR(KWe,hoe.instance)}static get defaultLocale(){return JWe}static set defaultLocale(e){JWe=e}static get defaultNumberingSystem(){return ZWe}static set defaultNumberingSystem(e){ZWe=e}static get defaultOutputCalendar(){return QWe}static set defaultOutputCalendar(e){QWe=e}static get twoDigitCutoffYear(){return eqe}static set twoDigitCutoffYear(e){eqe=e%100}static get throwOnInvalid(){return tqe}static set throwOnInvalid(e){tqe=e}static resetCaches(){Cd.resetCache(),x2.resetCache()}}function Xu(t){return typeof t>"u"}function S5(t){return typeof t=="number"}function moe(t){return typeof t=="number"&&t%1===0}function Tzt(t){return typeof t=="string"}function Ezt(t){return Object.prototype.toString.call(t)==="[object Date]"}function iqe(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Izt(t){return Array.isArray(t)?t:[t]}function rqe(t,e,i){if(t.length!==0)return t.reduce((r,n)=>{const s=[e(n),n];return r&&i(r[0],s[0])===r[0]?r:s},null)[1]}function Azt(t,e){return e.reduce((i,r)=>(i[r]=t[r],i),{})}function z9(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function AA(t,e,i){return moe(t)&&t>=e&&t<=i}function Pzt(t,e){return t-e*Math.floor(t/e)}function Gf(t,e=2){const i=t<0;let r;return i?r="-"+(""+-t).padStart(e,"0"):r=(""+t).padStart(e,"0"),r}function kR(t){if(!(Xu(t)||t===null||t===""))return parseInt(t,10)}function C5(t){if(!(Xu(t)||t===null||t===""))return parseFloat(t)}function W2e(t){if(!(Xu(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function q2e(t,e,i=!1){const r=10**e;return(i?Math.trunc:Math.round)(t*r)/r}function Aq(t){return t%4===0&&(t%100!==0||t%400===0)}function Pq(t){return Aq(t)?366:365}function goe(t,e){const i=Pzt(e-1,12)+1,r=t+(e-i)/12;return i===2?Aq(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][i-1]}function Y2e(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function yoe(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,i=t-1,r=(i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400))%7;return e===4||r===3?53:52}function X2e(t){return t>99?t:t>jf.twoDigitCutoffYear?1900+t:2e3+t}function nqe(t,e,i,r=null){const n=new Date(t),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(i,o).formatToParts(n).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function voe(t,e){let i=parseInt(t,10);Number.isNaN(i)&&(i=0);const r=parseInt(e,10)||0,n=i<0||Object.is(i,-0)?-r:r;return i*60+n}function sqe(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new aw(`Invalid unit value ${t}`);return e}function _oe(t,e){const i={};for(const r in t)if(z9(t,r)){const n=t[r];if(n==null)continue;i[e(r)]=sqe(n)}return i}function Oq(t,e){const i=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),n=t>=0?"+":"-";switch(e){case"short":return`${n}${Gf(i,2)}:${Gf(r,2)}`;case"narrow":return`${n}${i}${r>0?`:${r}`:""}`;case"techie":return`${n}${Gf(i,2)}${Gf(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function boe(t){return Azt(t,["hour","minute","second","millisecond"])}const Ozt=["January","February","March","April","May","June","July","August","September","October","November","December"],oqe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Rzt=["J","F","M","A","M","J","J","A","S","O","N","D"];function aqe(t){switch(t){case"narrow":return[...Rzt];case"short":return[...oqe];case"long":return[...Ozt];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 lqe=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],uqe=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Mzt=["M","T","W","T","F","S","S"];function cqe(t){switch(t){case"narrow":return[...Mzt];case"short":return[...uqe];case"long":return[...lqe];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const hqe=["AM","PM"],Dzt=["Before Christ","Anno Domini"],Fzt=["BC","AD"],Lzt=["B","A"];function dqe(t){switch(t){case"narrow":return[...Lzt];case"short":return[...Fzt];case"long":return[...Dzt];default:return null}}function Nzt(t){return hqe[t.hour<12?0:1]}function kzt(t,e){return cqe(e)[t.weekday-1]}function $zt(t,e){return aqe(e)[t.month-1]}function Bzt(t,e){return dqe(e)[t.year<0?0:1]}function Vzt(t,e,i="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(t)===-1;if(i==="auto"&&s){const p=t==="days";switch(e){case 1:return p?"tomorrow":`next ${n[t][0]}`;case-1:return p?"yesterday":`last ${n[t][0]}`;case 0:return p?"today":`this ${n[t][0]}`}}const o=Object.is(e,-0)||e<0,a=Math.abs(e),l=a===1,c=n[t],h=r?l?c[1]:c[2]||c[1]:l?n[t][0]:t;return o?`${a} ${h} ago`:`in ${a} ${h}`}function pqe(t,e){let i="";for(const r of t)r.literal?i+=r.val:i+=e(r.val);return i}const jzt={D:coe,DD:PWe,DDD:OWe,DDDD:RWe,t:MWe,tt:DWe,ttt:FWe,tttt:LWe,T:NWe,TT:kWe,TTT:$We,TTTT:BWe,f:VWe,ff:GWe,fff:zWe,ffff:WWe,F:jWe,FF:UWe,FFF:HWe,FFFF:qWe};class e0{static create(e,i={}){return new e0(e,i)}static parseFormat(e){let i=null,r="",n=!1;const s=[];for(let o=0;o0&&s.push({literal:n,val:r}),i=null,r="",n=!n):n||a===i?r+=a:(r.length>0&&s.push({literal:!1,val:r}),r=a,i=a)}return r.length>0&&s.push({literal:n,val:r}),s}static macroTokenToFormatOpts(e){return jzt[e]}constructor(e,i){this.opts=i,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,i){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...i}).format()}formatDateTime(e,i={}){return this.loc.dtFormatter(e,{...this.opts,...i}).format()}formatDateTimeParts(e,i={}){return this.loc.dtFormatter(e,{...this.opts,...i}).formatToParts()}formatInterval(e,i={}){return this.loc.dtFormatter(e.start,{...this.opts,...i}).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,i={}){return this.loc.dtFormatter(e,{...this.opts,...i}).resolvedOptions()}num(e,i=0){if(this.opts.forceSimple)return Gf(e,i);const r={...this.opts};return i>0&&(r.padTo=i),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,i){const r=this.loc.listingMode()==="en",n=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(v,x)=>this.loc.extract(e,v,x),o=v=>e.isOffsetFixed&&e.offset===0&&v.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,v.format):"",a=()=>r?Nzt(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(v,x)=>r?$zt(e,v):s(x?{month:v}:{month:v,day:"numeric"},"month"),c=(v,x)=>r?kzt(e,v):s(x?{weekday:v}:{weekday:v,month:"long",day:"numeric"},"weekday"),h=v=>{const x=e0.macroTokenToFormatOpts(v);return x?this.formatWithSystemDefault(e,x):v},p=v=>r?Bzt(e,v):s({era:v},"era"),y=v=>{switch(v){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 c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("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 p("short");case"GG":return p("long");case"GGGGG":return p("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"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 h(v)}};return pqe(e0.parseFormat(i),y)}formatDurationFromString(e,i){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=>c=>{const h=r(c);return h?this.num(l.get(h),c.length):c},s=e0.parseFormat(i),o=s.reduce((l,{literal:c,val:h})=>c?l:l.concat(h),[]),a=e.shiftTo(...o.map(r).filter(l=>l));return pqe(s,n(a))}}class S2{constructor(e,i){this.reason=e,this.explanation=i}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const fqe=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function H9(...t){const e=t.reduce((i,r)=>i+r.source,"");return RegExp(`^${e}$`)}function W9(...t){return e=>t.reduce(([i,r,n],s)=>{const[o,a,l]=s(e,n);return[{...i,...o},a||r,l]},[{},null,1]).slice(0,2)}function q9(t,...e){if(t==null)return[null,null];for(const[i,r]of e){const n=i.exec(t);if(n)return r(n)}return[null,null]}function mqe(...t){return(e,i)=>{const r={};let n;for(n=0;nv!==void 0&&(x||v&&h)?-v:v;return[{years:y(C5(i)),months:y(C5(r)),weeks:y(C5(n)),days:y(C5(s)),hours:y(C5(o)),minutes:y(C5(a)),seconds:y(C5(l),l==="-0"),milliseconds:y(W2e(c),p)}]}const eHt={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 Z2e(t,e,i,r,n,s,o){const a={year:e.length===2?X2e(kR(e)):kR(e),month:oqe.indexOf(i)+1,day:kR(r),hour:kR(n),minute:kR(s)};return o&&(a.second=kR(o)),t&&(a.weekday=t.length>3?lqe.indexOf(t)+1:uqe.indexOf(t)+1),a}const tHt=/^(?:(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 iHt(t){const[,e,i,r,n,s,o,a,l,c,h,p]=t,y=Z2e(e,n,r,i,s,o,a);let v;return l?v=eHt[l]:c?v=0:v=voe(h,p),[y,new Kg(v)]}function rHt(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const nHt=/^(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$/,sHt=/^(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$/,oHt=/^(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 _qe(t){const[,e,i,r,n,s,o,a]=t;return[Z2e(e,n,r,i,s,o,a),Kg.utcInstance]}function aHt(t){const[,e,i,r,n,s,o,a]=t;return[Z2e(e,a,i,r,n,s,o),Kg.utcInstance]}const lHt=H9(Uzt,J2e),uHt=H9(zzt,J2e),cHt=H9(Hzt,J2e),hHt=H9(yqe),bqe=W9(Kzt,X9,Rq,Mq),dHt=W9(Wzt,X9,Rq,Mq),pHt=W9(qzt,X9,Rq,Mq),fHt=W9(X9,Rq,Mq);function mHt(t){return q9(t,[lHt,bqe],[uHt,dHt],[cHt,pHt],[hHt,fHt])}function gHt(t){return q9(rHt(t),[tHt,iHt])}function yHt(t){return q9(t,[nHt,_qe],[sHt,_qe],[oHt,aHt])}function vHt(t){return q9(t,[Zzt,Qzt])}const _Ht=W9(X9);function bHt(t){return q9(t,[Jzt,_Ht])}const wHt=H9(Yzt,Xzt),xHt=H9(vqe),SHt=W9(X9,Rq,Mq);function CHt(t){return q9(t,[wHt,bqe],[xHt,SHt])}const THt="Invalid Duration",wqe={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}},EHt={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},...wqe},lw=146097/400,K9=146097/4800,IHt={years:{quarters:4,months:12,weeks:lw/7,days:lw,hours:lw*24,minutes:lw*24*60,seconds:lw*24*60*60,milliseconds:lw*24*60*60*1e3},quarters:{months:3,weeks:lw/28,days:lw/4,hours:lw*24/4,minutes:lw*24*60/4,seconds:lw*24*60*60/4,milliseconds:lw*24*60*60*1e3/4},months:{weeks:K9/7,days:K9,hours:K9*24,minutes:K9*24*60,seconds:K9*24*60*60,milliseconds:K9*24*60*60*1e3},...wqe},T5=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],AHt=T5.slice(0).reverse();function $R(t,e,i=!1){const r={values:i?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new ic(r)}function PHt(t){return t<0?Math.floor(t):Math.ceil(t)}function xqe(t,e,i,r,n){const s=t[n][i],o=e[i]/s,a=Math.sign(o)===Math.sign(r[n]),l=!a&&r[n]!==0&&Math.abs(o)<=1?PHt(o):Math.trunc(o);r[n]+=l,e[i]-=l*s}function OHt(t,e){AHt.reduce((i,r)=>Xu(e[r])?i:(i&&xqe(t,e,i,e,r),r),null)}function RHt(t){const e={};for(const[i,r]of Object.entries(t))r!==0&&(e[i]=r);return e}class ic{constructor(e){const i=e.conversionAccuracy==="longterm"||!1;let r=i?IHt:EHt;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||Cd.create(),this.conversionAccuracy=i?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,i){return ic.fromObject({milliseconds:e},i)}static fromObject(e,i={}){if(e==null||typeof e!="object")throw new aw(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ic({values:_oe(e,ic.normalizeUnit),loc:Cd.fromObject(i),conversionAccuracy:i.conversionAccuracy,matrix:i.matrix})}static fromDurationLike(e){if(S5(e))return ic.fromMillis(e);if(ic.isDuration(e))return e;if(typeof e=="object")return ic.fromObject(e);throw new aw(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,i){const[r]=vHt(e);return r?ic.fromObject(r,i):ic.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,i){const[r]=bHt(e);return r?ic.fromObject(r,i):ic.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,i=null){if(!e)throw new aw("need to specify a reason the Duration is invalid");const r=e instanceof S2?e:new S2(e,i);if(jf.throwOnInvalid)throw new szt(r);return new ic({invalid:r})}static normalizeUnit(e){const i={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(!i)throw new AWe(e);return i}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,i={}){const r={...i,floor:i.round!==!1&&i.floor!==!1};return this.isValid?e0.create(this.loc,r).formatDurationFromString(this,e):THt}toHuman(e={}){const i=T5.map(r=>{const n=this.values[r];return Xu(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(i)}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+=q2e(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const i=this.toMillis();if(i<0||i>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const r=this.shiftTo("hours","minutes","seconds","milliseconds");let n=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(n+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||r.milliseconds!==0)&&(n+=".SSS"));let s=r.toFormat(n);return e.includePrefix&&(s="T"+s),s}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const i=ic.fromDurationLike(e),r={};for(const n of T5)(z9(i.values,n)||z9(this.values,n))&&(r[n]=i.get(n)+this.get(n));return $R(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const i=ic.fromDurationLike(e);return this.plus(i.negate())}mapUnits(e){if(!this.isValid)return this;const i={};for(const r of Object.keys(this.values))i[r]=sqe(e(this.values[r],r));return $R(this,{values:i},!0)}get(e){return this[ic.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const i={...this.values,..._oe(e,ic.normalizeUnit)};return $R(this,{values:i})}reconfigure({locale:e,numberingSystem:i,conversionAccuracy:r,matrix:n}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:i}),matrix:n,conversionAccuracy:r};return $R(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return OHt(this.matrix,e),$R(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=RHt(this.normalize().shiftToAll().toObject());return $R(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>ic.normalizeUnit(o));const i={},r={},n=this.toObject();let s;for(const o of T5)if(e.indexOf(o)>=0){s=o;let a=0;for(const c in r)a+=this.matrix[c][o]*r[c],r[c]=0;S5(n[o])&&(a+=n[o]);const l=Math.trunc(a);i[o]=l,r[o]=(a*1e3-l*1e3)/1e3;for(const c in n)T5.indexOf(c)>T5.indexOf(o)&&xqe(this.matrix,n,c,i,o)}else S5(n[o])&&(r[o]=n[o]);for(const o in r)r[o]!==0&&(i[s]+=o===s?r[o]:r[o]/this.matrix[s][o]);return $R(this,{values:i},!0).normalize()}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 i of Object.keys(this.values))e[i]=this.values[i]===0?0:-this.values[i];return $R(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 i(r,n){return r===void 0||r===0?n===void 0||n===0:r===n}for(const r of T5)if(!i(this.values[r],e.values[r]))return!1;return!0}}const J9="Invalid Interval";function MHt(t,e){return!t||!t.isValid?Lp.invalid("missing or invalid start"):!e||!e.isValid?Lp.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:i}={}){return this.isValid?Lp.fromDateTimes(e||this.s,i||this.e):this}splitAt(...e){if(!this.isValid)return[];const i=e.map(Lq).filter(o=>this.contains(o)).sort(),r=[];let{s:n}=this,s=0;for(;n+this.e?this.e:o;r.push(Lp.fromDateTimes(n,a)),n=a,s+=1}return r}splitBy(e){const i=ic.fromDurationLike(e);if(!this.isValid||!i.isValid||i.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(Lp.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 i=this.s>e.s?this.s:e.s,r=this.e=r?null:Lp.fromDateTimes(i,r)}union(e){if(!this.isValid)return this;const i=this.se.e?this.e:e.e;return Lp.fromDateTimes(i,r)}static merge(e){const[i,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&&i.push(r),i}static xor(e){let i=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,c)=>l.time-c.time);for(const l of a)r+=l.type==="s"?1:-1,r===1?i=l.time:(i&&+i!=+l.time&&n.push(Lp.fromDateTimes(i,l.time)),i=null);return Lp.merge(n)}difference(...e){return Lp.xor([this].concat(e)).map(i=>this.intersection(i)).filter(i=>i&&!i.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:J9}toLocaleString(e=coe,i={}){return this.isValid?e0.create(this.s.loc.clone(i),e).formatInterval(this):J9}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:J9}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:J9}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:J9}toFormat(e,{separator:i=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${i}${this.e.toFormat(e)}`:J9}toDuration(e,i){return this.isValid?this.e.diff(this.s,e,i):ic.invalid(this.invalidReason)}mapEndpoints(e){return Lp.fromDateTimes(e(this.s),e(this.e))}}class woe{static hasDST(e=jf.defaultZone){const i=ro.now().setZone(e).set({month:12});return!e.isUniversal&&i.offset!==i.set({month:6}).offset}static isValidIANAZone(e){return x2.isValidZone(e)}static normalizeZone(e){return NR(e,jf.defaultZone)}static months(e="long",{locale:i=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||Cd.create(i,r,s)).months(e)}static monthsFormat(e="long",{locale:i=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||Cd.create(i,r,s)).months(e,!0)}static weekdays(e="long",{locale:i=null,numberingSystem:r=null,locObj:n=null}={}){return(n||Cd.create(i,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:i=null,numberingSystem:r=null,locObj:n=null}={}){return(n||Cd.create(i,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Cd.create(e).meridiems()}static eras(e="short",{locale:i=null}={}){return Cd.create(i,null,"gregory").eras(e)}static features(){return{relative:iqe()}}}function Sqe(t,e){const i=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=i(e)-i(t);return Math.floor(ic.fromMillis(r).as("days"))}function DHt(t,e,i){const r=[["years",(l,c)=>c.year-l.year],["quarters",(l,c)=>c.quarter-l.quarter+(c.year-l.year)*4],["months",(l,c)=>c.month-l.month+(c.year-l.year)*12],["weeks",(l,c)=>{const h=Sqe(l,c);return(h-h%7)/7}],["days",Sqe]],n={},s=t;let o,a;for(const[l,c]of r)i.indexOf(l)>=0&&(o=l,n[l]=c(t,e),a=s.plus(n),a>e?(n[l]--,t=s.plus(n)):t=a);return[t,n,a,o]}function FHt(t,e,i,r){let[n,s,o,a]=DHt(t,e,i);const l=e-n,c=i.filter(p=>["hours","minutes","seconds","milliseconds"].indexOf(p)>=0);c.length===0&&(o0?ic.fromMillis(l,r).shiftTo(...c).plus(h):h}const Q2e={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Cqe={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]},LHt=Q2e.hanidec.replace(/[\[|\]]/g,"").split("");function NHt(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let i=0;i=s&&r<=o&&(e+=r-s)}}return parseInt(e,10)}else return e}function C2({numberingSystem:t},e=""){return new RegExp(`${Q2e[t||"latn"]}${e}`)}const kHt="missing Intl.DateTimeFormat.formatToParts support";function Ec(t,e=i=>i){return{regex:t,deser:([i])=>e(NHt(i))}}const Tqe=`[ ${String.fromCharCode(160)}]`,Eqe=new RegExp(Tqe,"g");function $Ht(t){return t.replace(/\./g,"\\.?").replace(Eqe,Tqe)}function Iqe(t){return t.replace(/\./g,"").replace(Eqe," ").toLowerCase()}function T2(t,e){return t===null?null:{regex:RegExp(t.map($Ht).join("|")),deser:([i])=>t.findIndex(r=>Iqe(i)===Iqe(r))+e}}function Aqe(t,e){return{regex:t,deser:([,i,r])=>voe(i,r),groups:e}}function eSe(t){return{regex:t,deser:([e])=>e}}function BHt(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function VHt(t,e){const i=C2(e),r=C2(e,"{2}"),n=C2(e,"{3}"),s=C2(e,"{4}"),o=C2(e,"{6}"),a=C2(e,"{1,2}"),l=C2(e,"{1,3}"),c=C2(e,"{1,6}"),h=C2(e,"{1,9}"),p=C2(e,"{2,4}"),y=C2(e,"{4,6}"),v=P=>({regex:RegExp(BHt(P.val)),deser:([F])=>F,literal:!0}),I=(P=>{if(t.literal)return v(P);switch(P.val){case"G":return T2(e.eras("short",!1),0);case"GG":return T2(e.eras("long",!1),0);case"y":return Ec(c);case"yy":return Ec(p,X2e);case"yyyy":return Ec(s);case"yyyyy":return Ec(y);case"yyyyyy":return Ec(o);case"M":return Ec(a);case"MM":return Ec(r);case"MMM":return T2(e.months("short",!0,!1),1);case"MMMM":return T2(e.months("long",!0,!1),1);case"L":return Ec(a);case"LL":return Ec(r);case"LLL":return T2(e.months("short",!1,!1),1);case"LLLL":return T2(e.months("long",!1,!1),1);case"d":return Ec(a);case"dd":return Ec(r);case"o":return Ec(l);case"ooo":return Ec(n);case"HH":return Ec(r);case"H":return Ec(a);case"hh":return Ec(r);case"h":return Ec(a);case"mm":return Ec(r);case"m":return Ec(a);case"q":return Ec(a);case"qq":return Ec(r);case"s":return Ec(a);case"ss":return Ec(r);case"S":return Ec(l);case"SSS":return Ec(n);case"u":return eSe(h);case"uu":return eSe(a);case"uuu":return Ec(i);case"a":return T2(e.meridiems(),0);case"kkkk":return Ec(s);case"kk":return Ec(p,X2e);case"W":return Ec(a);case"WW":return Ec(r);case"E":case"c":return Ec(i);case"EEE":return T2(e.weekdays("short",!1,!1),1);case"EEEE":return T2(e.weekdays("long",!1,!1),1);case"ccc":return T2(e.weekdays("short",!0,!1),1);case"cccc":return T2(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Aqe(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return Aqe(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return eSe(/[a-z_+-/]{1,256}?/i);default:return v(P)}})(t)||{invalidReason:kHt};return I.token=t,I}const jHt={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",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function GHt(t,e){const{type:i,value:r}=t;if(i==="literal")return{literal:!0,val:r};const n=e[i];let s=jHt[i];if(typeof s=="object"&&(s=s[n]),s)return{literal:!1,val:s}}function UHt(t){return[`^${t.map(i=>i.regex).reduce((i,r)=>`${i}(${r.source})`,"")}$`,t]}function zHt(t,e,i){const r=t.match(e);if(r){const n={};let s=1;for(const o in i)if(z9(i,o)){const a=i[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 HHt(t){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 i=null,r;return Xu(t.z)||(i=x2.create(t.z)),Xu(t.Z)||(i||(i=new Kg(t.Z)),r=t.Z),Xu(t.q)||(t.M=(t.q-1)*3+1),Xu(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),Xu(t.u)||(t.S=W2e(t.u)),[Object.keys(t).reduce((s,o)=>{const a=e(o);return a&&(s[a]=t[o]),s},{}),i,r]}let tSe=null;function WHt(){return tSe||(tSe=ro.fromMillis(1555555555555)),tSe}function qHt(t,e){if(t.literal)return t;const i=e0.macroTokenToFormatOpts(t.val),r=Rqe(i,e);return r==null||r.includes(void 0)?t:r}function Pqe(t,e){return Array.prototype.concat(...t.map(i=>qHt(i,e)))}function Oqe(t,e,i){const r=Pqe(e0.parseFormat(i),t),n=r.map(o=>VHt(o,t)),s=n.find(o=>o.invalidReason);if(s)return{input:e,tokens:r,invalidReason:s.invalidReason};{const[o,a]=UHt(n),l=RegExp(o,"i"),[c,h]=zHt(e,l,a),[p,y,v]=h?HHt(h):[null,null,void 0];if(z9(h,"a")&&z9(h,"H"))throw new Eq("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:r,regex:l,rawMatches:c,matches:h,result:p,zone:y,specificOffset:v}}}function YHt(t,e,i){const{result:r,zone:n,specificOffset:s,invalidReason:o}=Oqe(t,e,i);return[r,n,s,o]}function Rqe(t,e){return t?e0.create(e,t).formatDateTimeParts(WHt()).map(n=>GHt(n,t)):null}const Mqe=[0,31,59,90,120,151,181,212,243,273,304,334],Dqe=[0,31,60,91,121,152,182,213,244,274,305,335];function uw(t,e){return new S2("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Fqe(t,e,i){const r=new Date(Date.UTC(t,e-1,i));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const n=r.getUTCDay();return n===0?7:n}function Lqe(t,e,i){return i+(Aq(t)?Dqe:Mqe)[e-1]}function Nqe(t,e){const i=Aq(t)?Dqe:Mqe,r=i.findIndex(s=>syoe(e)?(a=e+1,o=1):a=e,{weekYear:a,weekNumber:o,weekday:s,...boe(t)}}function kqe(t){const{weekYear:e,weekNumber:i,weekday:r}=t,n=Fqe(e,1,4),s=Pq(e);let o=i*7+r-n-3,a;o<1?(a=e-1,o+=Pq(a)):o>s?(a=e+1,o-=Pq(e)):a=e;const{month:l,day:c}=Nqe(a,o);return{year:a,month:l,day:c,...boe(t)}}function rSe(t){const{year:e,month:i,day:r}=t,n=Lqe(e,i,r);return{year:e,ordinal:n,...boe(t)}}function $qe(t){const{year:e,ordinal:i}=t,{month:r,day:n}=Nqe(e,i);return{year:e,month:r,day:n,...boe(t)}}function XHt(t){const e=moe(t.weekYear),i=AA(t.weekNumber,1,yoe(t.weekYear)),r=AA(t.weekday,1,7);return e?i?r?!1:uw("weekday",t.weekday):uw("week",t.week):uw("weekYear",t.weekYear)}function KHt(t){const e=moe(t.year),i=AA(t.ordinal,1,Pq(t.year));return e?i?!1:uw("ordinal",t.ordinal):uw("year",t.year)}function Bqe(t){const e=moe(t.year),i=AA(t.month,1,12),r=AA(t.day,1,goe(t.year,t.month));return e?i?r?!1:uw("day",t.day):uw("month",t.month):uw("year",t.year)}function Vqe(t){const{hour:e,minute:i,second:r,millisecond:n}=t,s=AA(e,0,23)||e===24&&i===0&&r===0&&n===0,o=AA(i,0,59),a=AA(r,0,59),l=AA(n,0,999);return s?o?a?l?!1:uw("millisecond",n):uw("second",r):uw("minute",i):uw("hour",e)}const nSe="Invalid DateTime",jqe=864e13;function xoe(t){return new S2("unsupported zone",`the zone "${t.name}" is not supported`)}function sSe(t){return t.weekData===null&&(t.weekData=iSe(t.c)),t.weekData}function Dq(t,e){const i={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new ro({...i,...e,old:i})}function Gqe(t,e,i){let r=t-e*60*1e3;const n=i.offset(r);if(e===n)return[r,e];r-=(n-e)*60*1e3;const s=i.offset(r);return n===s?[r,n]:[t-Math.min(n,s)*60*1e3,Math.max(n,s)]}function Uqe(t,e){t+=e*60*1e3;const i=new Date(t);return{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.getUTCMilliseconds()}}function Soe(t,e,i){return Gqe(Y2e(t),e,i)}function zqe(t,e){const i=t.o,r=t.c.year+Math.trunc(e.years),n=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...t.c,year:r,month:n,day:Math.min(t.c.day,goe(r,n))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=ic.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,c]=Gqe(a,i,t.zone);return o!==0&&(l+=o,c=t.zone.offset(l)),{ts:l,o:c}}function Fq(t,e,i,r,n,s){const{setZone:o,zone:a}=i;if(t&&Object.keys(t).length!==0){const l=e||a,c=ro.fromObject(t,{...i,zone:l,specificOffset:s});return o?c:c.setZone(a)}else return ro.invalid(new S2("unparsable",`the input "${n}" can't be parsed as ${r}`))}function Coe(t,e,i=!0){return t.isValid?e0.create(Cd.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(t,e):null}function oSe(t,e){const i=t.c.year>9999||t.c.year<0;let r="";return i&&t.c.year>=0&&(r+="+"),r+=Gf(t.c.year,i?6:4),e?(r+="-",r+=Gf(t.c.month),r+="-",r+=Gf(t.c.day)):(r+=Gf(t.c.month),r+=Gf(t.c.day)),r}function Hqe(t,e,i,r,n,s){let o=Gf(t.c.hour);return e?(o+=":",o+=Gf(t.c.minute),(t.c.second!==0||!i)&&(o+=":")):o+=Gf(t.c.minute),(t.c.second!==0||!i)&&(o+=Gf(t.c.second),(t.c.millisecond!==0||!r)&&(o+=".",o+=Gf(t.c.millisecond,3))),n&&(t.isOffsetFixed&&t.offset===0&&!s?o+="Z":t.o<0?(o+="-",o+=Gf(Math.trunc(-t.o/60)),o+=":",o+=Gf(Math.trunc(-t.o%60))):(o+="+",o+=Gf(Math.trunc(t.o/60)),o+=":",o+=Gf(Math.trunc(t.o%60)))),s&&(o+="["+t.zone.ianaName+"]"),o}const Wqe={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},JHt={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ZHt={ordinal:1,hour:0,minute:0,second:0,millisecond:0},qqe=["year","month","day","hour","minute","second","millisecond"],QHt=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],eWt=["year","ordinal","hour","minute","second","millisecond"];function Yqe(t){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"}[t.toLowerCase()];if(!e)throw new AWe(t);return e}function Xqe(t,e){const i=NR(e.zone,jf.defaultZone),r=Cd.fromObject(e),n=jf.now();let s,o;if(Xu(t.year))s=n;else{for(const c of qqe)Xu(t[c])&&(t[c]=Wqe[c]);const a=Bqe(t)||Vqe(t);if(a)return ro.invalid(a);const l=i.offset(n);[s,o]=Soe(t,l,i)}return new ro({ts:s,zone:i,loc:r,o})}function Kqe(t,e,i){const r=Xu(i.round)?!0:i.round,n=(o,a)=>(o=q2e(o,r||i.calendary?0:2,!0),e.loc.clone(i).relFormatter(i).format(o,a)),s=o=>i.calendary?e.hasSame(t,o)?0:e.startOf(o).diff(t.startOf(o),o).get(o):e.diff(t,o).get(o);if(i.unit)return n(s(i.unit),i.unit);for(const o of i.units){const a=s(o);if(Math.abs(a)>=1)return n(a,o)}return n(t>e?-0:0,i.units[i.units.length-1])}function Jqe(t){let e={},i;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],i=Array.from(t).slice(0,t.length-1)):i=Array.from(t),[e,i]}class ro{constructor(e){const i=e.zone||jf.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new S2("invalid input"):null)||(i.isValid?null:xoe(i));this.ts=Xu(e.ts)?jf.now():e.ts;let n=null,s=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(i))[n,s]=[e.old.c,e.old.o];else{const a=i.offset(this.ts);n=Uqe(this.ts,a),r=Number.isNaN(n.year)?new S2("invalid input"):null,n=r?null:n,s=r?null:a}this._zone=i,this.loc=e.loc||Cd.create(),this.invalid=r,this.weekData=null,this.c=n,this.o=s,this.isLuxonDateTime=!0}static now(){return new ro({})}static local(){const[e,i]=Jqe(arguments),[r,n,s,o,a,l,c]=i;return Xqe({year:r,month:n,day:s,hour:o,minute:a,second:l,millisecond:c},e)}static utc(){const[e,i]=Jqe(arguments),[r,n,s,o,a,l,c]=i;return e.zone=Kg.utcInstance,Xqe({year:r,month:n,day:s,hour:o,minute:a,second:l,millisecond:c},e)}static fromJSDate(e,i={}){const r=Ezt(e)?e.valueOf():NaN;if(Number.isNaN(r))return ro.invalid("invalid input");const n=NR(i.zone,jf.defaultZone);return n.isValid?new ro({ts:r,zone:n,loc:Cd.fromObject(i)}):ro.invalid(xoe(n))}static fromMillis(e,i={}){if(S5(e))return e<-jqe||e>jqe?ro.invalid("Timestamp out of range"):new ro({ts:e,zone:NR(i.zone,jf.defaultZone),loc:Cd.fromObject(i)});throw new aw(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,i={}){if(S5(e))return new ro({ts:e*1e3,zone:NR(i.zone,jf.defaultZone),loc:Cd.fromObject(i)});throw new aw("fromSeconds requires a numerical input")}static fromObject(e,i={}){e=e||{};const r=NR(i.zone,jf.defaultZone);if(!r.isValid)return ro.invalid(xoe(r));const n=jf.now(),s=Xu(i.specificOffset)?r.offset(n):i.specificOffset,o=_oe(e,Yqe),a=!Xu(o.ordinal),l=!Xu(o.year),c=!Xu(o.month)||!Xu(o.day),h=l||c,p=o.weekYear||o.weekNumber,y=Cd.fromObject(i);if((h||a)&&p)throw new Eq("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new Eq("Can't mix ordinal dates with month/day");const v=p||o.weekday&&!h;let x,I,P=Uqe(n,s);v?(x=QHt,I=JHt,P=iSe(P)):a?(x=eWt,I=ZHt,P=rSe(P)):(x=qqe,I=Wqe);let F=!1;for(const ie of x){const ce=o[ie];Xu(ce)?F?o[ie]=I[ie]:o[ie]=P[ie]:F=!0}const k=v?XHt(o):a?KHt(o):Bqe(o),j=k||Vqe(o);if(j)return ro.invalid(j);const V=v?kqe(o):a?$qe(o):o,[Y,X]=Soe(V,s,r),Z=new ro({ts:Y,zone:r,o:X,loc:y});return o.weekday&&h&&e.weekday!==Z.weekday?ro.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${Z.toISO()}`):Z}static fromISO(e,i={}){const[r,n]=mHt(e);return Fq(r,n,i,"ISO 8601",e)}static fromRFC2822(e,i={}){const[r,n]=gHt(e);return Fq(r,n,i,"RFC 2822",e)}static fromHTTP(e,i={}){const[r,n]=yHt(e);return Fq(r,n,i,"HTTP",i)}static fromFormat(e,i,r={}){if(Xu(e)||Xu(i))throw new aw("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:s=null}=r,o=Cd.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0}),[a,l,c,h]=YHt(o,e,i);return h?ro.invalid(h):Fq(a,l,r,`format ${i}`,e,c)}static fromString(e,i,r={}){return ro.fromFormat(e,i,r)}static fromSQL(e,i={}){const[r,n]=CHt(e);return Fq(r,n,i,"SQL",e)}static invalid(e,i=null){if(!e)throw new aw("need to specify a reason the DateTime is invalid");const r=e instanceof S2?e:new S2(e,i);if(jf.throwOnInvalid)throw new rzt(r);return new ro({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,i={}){const r=Rqe(e,Cd.fromObject(i));return r?r.map(n=>n?n.val:null).join(""):null}static expandFormat(e,i={}){return Pqe(e0.parseFormat(e),Cd.fromObject(i)).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?sSe(this).weekYear:NaN}get weekNumber(){return this.isValid?sSe(this).weekNumber:NaN}get weekday(){return this.isValid?sSe(this).weekday:NaN}get ordinal(){return this.isValid?rSe(this.c).ordinal:NaN}get monthShort(){return this.isValid?woe.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?woe.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?woe.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?woe.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}get isInLeapYear(){return Aq(this.year)}get daysInMonth(){return goe(this.year,this.month)}get daysInYear(){return this.isValid?Pq(this.year):NaN}get weeksInWeekYear(){return this.isValid?yoe(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:i,numberingSystem:r,calendar:n}=e0.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:i,numberingSystem:r,outputCalendar:n}}toUTC(e=0,i={}){return this.setZone(Kg.instance(e),i)}toLocal(){return this.setZone(jf.defaultZone)}setZone(e,{keepLocalTime:i=!1,keepCalendarTime:r=!1}={}){if(e=NR(e,jf.defaultZone),e.equals(this.zone))return this;if(e.isValid){let n=this.ts;if(i||r){const s=e.offset(this.ts),o=this.toObject();[n]=Soe(o,s,e)}return Dq(this,{ts:n,zone:e})}else return ro.invalid(xoe(e))}reconfigure({locale:e,numberingSystem:i,outputCalendar:r}={}){const n=this.loc.clone({locale:e,numberingSystem:i,outputCalendar:r});return Dq(this,{loc:n})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const i=_oe(e,Yqe),r=!Xu(i.weekYear)||!Xu(i.weekNumber)||!Xu(i.weekday),n=!Xu(i.ordinal),s=!Xu(i.year),o=!Xu(i.month)||!Xu(i.day),a=s||o,l=i.weekYear||i.weekNumber;if((a||n)&&l)throw new Eq("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&n)throw new Eq("Can't mix ordinal dates with month/day");let c;r?c=kqe({...iSe(this.c),...i}):Xu(i.ordinal)?(c={...this.toObject(),...i},Xu(i.day)&&(c.day=Math.min(goe(c.year,c.month),c.day))):c=$qe({...rSe(this.c),...i});const[h,p]=Soe(c,this.o,this.zone);return Dq(this,{ts:h,o:p})}plus(e){if(!this.isValid)return this;const i=ic.fromDurationLike(e);return Dq(this,zqe(this,i))}minus(e){if(!this.isValid)return this;const i=ic.fromDurationLike(e).negate();return Dq(this,zqe(this,i))}startOf(e){if(!this.isValid)return this;const i={},r=ic.normalizeUnit(e);switch(r){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(r==="weeks"&&(i.weekday=1),r==="quarters"){const n=Math.ceil(this.month/3);i.month=(n-1)*3+1}return this.set(i)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,i={}){return this.isValid?e0.create(this.loc.redefaultToEN(i)).formatDateTimeFromString(this,e):nSe}toLocaleString(e=coe,i={}){return this.isValid?e0.create(this.loc.clone(i),e).formatDateTime(this):nSe}toLocaleParts(e={}){return this.isValid?e0.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:i=!1,suppressMilliseconds:r=!1,includeOffset:n=!0,extendedZone:s=!1}={}){if(!this.isValid)return null;const o=e==="extended";let a=oSe(this,o);return a+="T",a+=Hqe(this,o,i,r,n,s),a}toISODate({format:e="extended"}={}){return this.isValid?oSe(this,e==="extended"):null}toISOWeekDate(){return Coe(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:i=!1,includeOffset:r=!0,includePrefix:n=!1,extendedZone:s=!1,format:o="extended"}={}){return this.isValid?(n?"T":"")+Hqe(this,o==="extended",i,e,r,s):null}toRFC2822(){return Coe(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Coe(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?oSe(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:i=!1,includeOffsetSpace:r=!0}={}){let n="HH:mm:ss.SSS";return(i||e)&&(r&&(n+=" "),i?n+="z":e&&(n+="ZZ")),Coe(this,n,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():nSe}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const i={...this.c};return e.includeConfig&&(i.outputCalendar=this.outputCalendar,i.numberingSystem=this.loc.numberingSystem,i.locale=this.loc.locale),i}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,i="milliseconds",r={}){if(!this.isValid||!e.isValid)return ic.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...r},s=Izt(i).map(ic.normalizeUnit),o=e.valueOf()>this.valueOf(),a=o?this:e,l=o?e:this,c=FHt(a,l,s,n);return o?c.negate():c}diffNow(e="milliseconds",i={}){return this.diff(ro.now(),e,i)}until(e){return this.isValid?Lp.fromDateTimes(this,e):this}hasSame(e,i){if(!this.isValid)return!1;const r=e.valueOf(),n=this.setZone(e.zone,{keepLocalTime:!0});return n.startOf(i)<=r&&r<=n.endOf(i)}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 i=e.base||ro.fromObject({},{zone:this.zone}),r=e.padding?thisi.valueOf(),Math.min)}static max(...e){if(!e.every(ro.isDateTime))throw new aw("max requires all arguments be DateTimes");return rqe(e,i=>i.valueOf(),Math.max)}static fromFormatExplain(e,i,r={}){const{locale:n=null,numberingSystem:s=null}=r,o=Cd.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0});return Oqe(o,e,i)}static fromStringExplain(e,i,r={}){return ro.fromFormatExplain(e,i,r)}static get DATE_SHORT(){return coe}static get DATE_MED(){return PWe}static get DATE_MED_WITH_WEEKDAY(){return ozt}static get DATE_FULL(){return OWe}static get DATE_HUGE(){return RWe}static get TIME_SIMPLE(){return MWe}static get TIME_WITH_SECONDS(){return DWe}static get TIME_WITH_SHORT_OFFSET(){return FWe}static get TIME_WITH_LONG_OFFSET(){return LWe}static get TIME_24_SIMPLE(){return NWe}static get TIME_24_WITH_SECONDS(){return kWe}static get TIME_24_WITH_SHORT_OFFSET(){return $We}static get TIME_24_WITH_LONG_OFFSET(){return BWe}static get DATETIME_SHORT(){return VWe}static get DATETIME_SHORT_WITH_SECONDS(){return jWe}static get DATETIME_MED(){return GWe}static get DATETIME_MED_WITH_SECONDS(){return UWe}static get DATETIME_MED_WITH_WEEKDAY(){return azt}static get DATETIME_FULL(){return zWe}static get DATETIME_FULL_WITH_SECONDS(){return HWe}static get DATETIME_HUGE(){return WWe}static get DATETIME_HUGE_WITH_SECONDS(){return qWe}}function Lq(t){if(ro.isDateTime(t))return t;if(t&&t.valueOf&&S5(t.valueOf()))return ro.fromJSDate(t);if(t&&typeof t=="object")return ro.fromObject(t);throw new aw(`Unknown datetime argument: ${t}, of type ${typeof t}`)}function Zqe(t,e="system"){if(!t||!IWe.has(t.timeZone))return e;const i=IWe.get(t.timeZone);return iWt(t.timeZone)||t.respectsDaylightSaving?i:tWt(i)}function tWt(t){const e=ro.local().setZone(t),i=Math.min(e.set({month:1,day:1}).offset,e.set({month:5}).offset);return i===0?"Etc/UTC":`Etc/GMT${Kg.instance(-i).formatOffset(0,"narrow")}`}function iWt(t){return t.startsWith("UTC")}let BR=class extends _a(Ui){constructor(e){super(e),this.legacy=null,this.timeZone="system"}readLegacy(e,i){const{timeZone:r,respectsDaylightSaving:n}=i;return{timeZone:r,respectsDaylightSaving:n}}readTimeZone(e,i){return"timeZoneIANA"in i?i.timeZoneIANA:Zqe(i)}writeTimeZone(e,i){i.timeZoneIANA=e}equals(e){return!(lt(e)||lt(this.timeZone)||lt(e.timeZone))&&this.timeZone===e.timeZone}};E([N()],BR.prototype,"legacy",void 0),E([Vi("legacy",["timeZone"])],BR.prototype,"readLegacy",null),E([N({type:String,nonNullable:!0})],BR.prototype,"timeZone",void 0),E([Vi("timeZone",["timeZone","timeZoneIANA","respectsDaylightSaving"])],BR.prototype,"readTimeZone",null),E([Cr("timeZone")],BR.prototype,"writeTimeZone",null),BR=E([dt("esri.time.TimeReference")],BR);const VR=BR;let PA=class extends _a(Ui){constructor(e){super(e),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.dateFieldsTimeReference=null}};E([N()],PA.prototype,"creatorField",void 0),E([N()],PA.prototype,"creationDateField",void 0),E([N()],PA.prototype,"editorField",void 0),E([N()],PA.prototype,"editDateField",void 0),E([N()],PA.prototype,"realm",void 0),E([N({type:VR})],PA.prototype,"dateFieldsTimeReference",void 0),PA=E([dt("esri.layers.support.EditFieldsInfo")],PA);const rWt=PA;let JC=class extends _a(Ui){constructor(e){super(e)}};E([N({constructOnly:!0,json:{write:!0}})],JC.prototype,"name",void 0),E([N({constructOnly:!0,json:{write:!0}})],JC.prototype,"fields",void 0),E([N({constructOnly:!0,json:{write:!0}})],JC.prototype,"isAscending",void 0),E([N({constructOnly:!0,json:{write:!0}})],JC.prototype,"indexType",void 0),E([N({constructOnly:!0,json:{write:!0}})],JC.prototype,"isUnique",void 0),E([N({constructOnly:!0,json:{write:!0}})],JC.prototype,"description",void 0),JC=E([dt("esri.layers.support.FeatureIndex")],JC);var aSe;let hg=aSe=class extends Ui{constructor(t){super(t),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(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10}clone(){return new aSe(gi({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}))}};E([N({type:[String],json:{write:!0}})],hg.prototype,"attachmentTypes",void 0),E([N({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],hg.prototype,"attachmentsWhere",void 0),E([N({type:Boolean,json:{write:!0}})],hg.prototype,"cacheHint",void 0),E([N({type:[String],json:{write:!0}})],hg.prototype,"keywords",void 0),E([N({type:[Number],json:{write:!0}})],hg.prototype,"globalIds",void 0),E([N({json:{write:!0}})],hg.prototype,"name",void 0),E([N({type:Number,json:{read:{source:"resultRecordCount"}}})],hg.prototype,"num",void 0),E([N({type:[Number],json:{write:!0}})],hg.prototype,"objectIds",void 0),E([N({type:Boolean,json:{default:!1,write:!0}})],hg.prototype,"returnMetadata",void 0),E([N({type:[Number],json:{write:!0}})],hg.prototype,"size",void 0),E([N({type:Number,json:{read:{source:"resultOffset"}}})],hg.prototype,"start",void 0),E([Cr("start"),Cr("num")],hg.prototype,"writeStart",null),E([N({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],hg.prototype,"where",void 0),hg=aSe=E([dt("esri.rest.support.AttachmentQuery")],hg),hg.from=fd(hg);const Toe=hg;var lSe;let zd=lSe=class extends Ui{constructor(t){super(t),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(t,e){e.historicMoment=t&&t.getTime()}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,this.start>0&&this.where==null&&(e.definitionExpression="1=1")}clone(){return new lSe(gi({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}))}};E([N({type:Boolean,json:{write:!0}})],zd.prototype,"cacheHint",void 0),E([N({type:rv,json:{write:!0}})],zd.prototype,"dynamicDataSource",void 0),E([N({type:String,json:{write:!0}})],zd.prototype,"gdbVersion",void 0),E([N({type:Number,json:{write:!0}})],zd.prototype,"geometryPrecision",void 0),E([N({type:Date})],zd.prototype,"historicMoment",void 0),E([Cr("historicMoment")],zd.prototype,"_writeHistoricMoment",null),E([N({type:Number,json:{write:!0}})],zd.prototype,"maxAllowableOffset",void 0),E([N({type:[Number],json:{write:!0}})],zd.prototype,"objectIds",void 0),E([N({type:[String],json:{write:!0}})],zd.prototype,"orderByFields",void 0),E([N({type:[String],json:{write:!0}})],zd.prototype,"outFields",void 0),E([N({type:hr,json:{read:{source:"outSR"},write:{target:"outSR"}}})],zd.prototype,"outSpatialReference",void 0),E([N({json:{write:!0}})],zd.prototype,"relationshipId",void 0),E([N({type:Number,json:{read:{source:"resultOffset"}}})],zd.prototype,"start",void 0),E([Cr("start"),Cr("num")],zd.prototype,"writeStart",null),E([N({type:Number,json:{read:{source:"resultRecordCount"}}})],zd.prototype,"num",void 0),E([N({json:{write:!0}})],zd.prototype,"returnGeometry",void 0),E([N({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],zd.prototype,"returnM",void 0),E([N({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],zd.prototype,"returnZ",void 0),E([N({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],zd.prototype,"where",void 0),zd=lSe=E([dt("esri.rest.support.RelationshipQuery")],zd),zd.from=fd(zd);const ZC=zd,Qqe=Object.freeze(Object.defineProperty({__proto__:null,default:ZC},Symbol.toStringTag,{value:"Module"})),uSe=new Ks({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function eYe(t,e,i,r){const n=await jR(t);if(await cSe(t,e,r),!n.addAttachment)throw new st(r,"Layer source does not support addAttachment capability");return n.addAttachment(e,i)}function cSe(t,e,i){const{attributes:r}=e,{objectIdField:n}=t;return t.get("capabilities.data.supportsAttachment")?e?r?n&&r[n]?Promise.resolve():Promise.reject(new st(i,`feature is missing the identifying attribute ${n}`)):Promise.reject(new st(i,"'attributes' are required on a feature to query attachments")):Promise.reject(new st(i,"A feature is required to add/delete/update attachments")):Promise.reject(new st(i,"this layer doesn't support attachments"))}async function tYe(t,e,i,r,n){const s=await jR(t);if(await cSe(t,e,n),!s.updateAttachment)throw new st(n,"Layer source does not support updateAttachment capability");return s.updateAttachment(e,i,r)}async function iYe(t,e,i){const r=await Promise.resolve().then(()=>lLe),n=await t.load();return r.applyEdits(n,n.source,e,i)}async function rYe(t,e,i,r){const n=await jR(t);if(await cSe(t,e,r),!n.deleteAttachments)throw new st(r,"Layer source does not support deleteAttachments capability");return n.deleteAttachments(e,i)}async function nYe(t,e,i){const r=(await t.load({signal:e?.signal})).source;if(!r.fetchRecomputedExtents)throw new st(i,"Layer source does not support fetchUpdates capability");return r.fetchRecomputedExtents(e)}async function sYe(t,e,i,r){e=Toe.from(e),await t.load();const n=t.source,s=t.capabilities;if(!s?.data?.supportsAttachment)throw new st(r,"this layer doesn't support attachments");const{attachmentTypes:o,objectIds:a,globalIds:l,num:c,size:h,start:p,where:y}=e;if(!s?.operations?.supportsQueryAttachments&&(o?.length>0||l?.length>0||h?.length>0||c||p||y))throw new st(r,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(a?.length||l?.length||y))throw new st(r,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);if(!n.queryAttachments)throw new st(r,"Layer source does not support queryAttachments capability",e);return n.queryAttachments(e)}async function oYe(t,e,i,r){const n=await jR(t);if(!n.queryObjectIds)throw new st(r,"Layer source does not support queryObjectIds capability");return n.queryObjectIds(Ns.from(e)??t.createQuery(),i)}async function aYe(t,e,i,r){const n=await jR(t);if(!n.queryFeatureCount)throw new st(r,"Layer source does not support queryFeatureCount capability");return n.queryFeatureCount(Ns.from(e)??t.createQuery(),i)}async function lYe(t,e,i,r){const n=await jR(t);if(!n.queryExtent)throw new st(r,"Layer source does not support queryExtent capability");return n.queryExtent(Ns.from(e)??t.createQuery(),i)}async function uYe(t,e,i,r){const n=await jR(t);if(!n.queryRelatedFeatures)throw new st(r,"Layer source does not support queryRelatedFeatures capability");return n.queryRelatedFeatures(ZC.from(e),i)}async function cYe(t,e,i,r){const n=await jR(t);if(!n.queryRelatedFeaturesCount)throw new st(r,"Layer source does not support queryRelatedFeaturesCount capability");return n.queryRelatedFeaturesCount(ZC.from(e),i)}async function hYe(t){const e=t.source;if(e?.refresh)try{const{dataChanged:i,updates:r}=await e.refresh();if(ve(r)&&(t.sourceJSON={...t.sourceJSON,...r},t.read(r,{origin:"service",url:t.parsedUrl})),i)return!0}catch{}if(t.definitionExpression)try{return(await FGt(t.definitionExpression,t.fieldsIndex)).hasDateFunctions}catch{}return!1}function hSe(t){const e=new Ns,i=t.get("capabilities.data"),r=t.get("capabilities.query");e.historicMoment=t.historicMoment,e.gdbVersion=t.gdbVersion,e.returnGeometry=!0,r&&(e.compactGeometryEnabled=r.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=r.supportsDefaultSpatialReference),i&&(i.supportsZ&&t.returnZ!=null&&(e.returnZ=t.returnZ),i.supportsM&&t.returnM!=null&&(e.returnM=t.returnM)),e.outFields=["*"];const{timeOffset:n,timeExtent:s}=t;return e.timeExtent=n!=null&&s!=null?s.offset(-n.value,n.unit):s||null,e.multipatchOption=t.geometryType==="multipatch"?"xyFootprint":null,e}function dYe(t){const{globalIdField:e,fields:i}=t;if(e)return e;if(i){for(const r of i)if(r.type==="esriFieldTypeGlobalID")return r.name}}function pYe(t){const{objectIdField:e,fields:i}=t;if(e)return e;if(i){for(const r of i)if(r.type==="esriFieldTypeOID")return r.name}}function nWt(t){return t.currentVersion?t.currentVersion:t.hasOwnProperty("capabilities")||t.hasOwnProperty("drawingInfo")||t.hasOwnProperty("hasAttachments")||t.hasOwnProperty("htmlPopupType")||t.hasOwnProperty("relationships")||t.hasOwnProperty("timeInfo")||t.hasOwnProperty("typeIdField")||t.hasOwnProperty("types")?10:9.3}async function jR(t){return(await t.load()).source}async function sWt(t,e){if(!Ho||Ho.findCredential(t))return;let i;try{const r=await VGe(t,e);r&&(i=await Ho.checkSignInStatus(`${r}/sharing`))}catch{}if(i)try{const r=ve(e)?e.signal:null;await Ho.getCredential(t,{signal:r})}catch{}}async function fYe(t,e){const i=t.parsedUrl?.path;if(!i)return;const r=t.editFieldsInfo;(t.userHasUpdateItemPrivileges||t.userHasFullEditingPrivileges&&t.capabilities.operations.supportsEditing||r?.creatorField||r?.editorField)&&await sWt(i,e)}function mYe(t){return!t.sourceJSON?.isMultiServicesView&&(t.userHasUpdateItemPrivileges||t.editingEnabled)}let Z9=class extends _a(Ui){constructor(e){super(e),this.shapeAreaField=null,this.shapeLengthField=null,this.units=null}};E([N({type:String,json:{read:{source:"shapeAreaFieldName"}}})],Z9.prototype,"shapeAreaField",void 0),E([N({type:String,json:{read:{source:"shapeLengthFieldName"}}})],Z9.prototype,"shapeLengthField",void 0),E([N({type:String,json:{read:t=>UH.read(t)||iA.read(t)}})],Z9.prototype,"units",void 0),Z9=E([dt("esri.layers.support.GeometryFieldsInfo")],Z9);const oWt=Z9;var dSe;let Q9=dSe=class extends Ui{constructor(t){super(t),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new Sr}clone(){return new dSe({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};E([N({type:String,json:{write:!0}})],Q9.prototype,"floorField",void 0),E([N({json:{read:!1,write:!1}})],Q9.prototype,"viewAllMode",void 0),E([N({json:{read:!1,write:!1}})],Q9.prototype,"viewAllLevelIds",void 0),Q9=dSe=E([dt("esri.layers.support.LayerFloorInfo")],Q9);const pSe=Q9,gYe=new Ks({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),yYe=new Ks({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let cw=class extends _a(Ui){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}};E([N({json:{read:gYe.read,write:gYe.write}})],cw.prototype,"cardinality",void 0),E([N({json:{read:!0,write:!0}})],cw.prototype,"composite",void 0),E([N({json:{read:!0,write:!0}})],cw.prototype,"id",void 0),E([N({json:{read:!0,write:!0}})],cw.prototype,"keyField",void 0),E([N({json:{read:!0,write:!0}})],cw.prototype,"keyFieldInRelationshipTable",void 0),E([N({json:{read:!0,write:!0}})],cw.prototype,"name",void 0),E([N({json:{read:!0,write:!0}})],cw.prototype,"relatedTableId",void 0),E([N({json:{read:!0,write:!0}})],cw.prototype,"relationshipTableId",void 0),E([N({json:{read:yYe.read,write:yYe.write}})],cw.prototype,"role",void 0),cw=E([dt("esri.layers.support.Relationship")],cw);const aWt=cw,lWt={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function ia(t,e,i){return!!(t&&t.hasOwnProperty(e)?t[e]:i)}function Eoe(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}function uWt(t){const e=t?.supportedSpatialAggregationStatistics?.map(i=>i.toLowerCase());return{envelope:!!e?.includes("envelopeaggregate"),centroid:!!e?.includes("centroidaggregate"),convexHull:!!e?.includes("convexhullaggregate")}}function Nq(t,e){return!!t?.supportedOperationsWithCacheHint?.map(r=>r.toLowerCase())?.includes(e.toLowerCase())}function fSe(t,e){return{analytics:cWt(t),attachment:hWt(t),data:dWt(t),metadata:pWt(t),operations:fWt(t.capabilities,t,e),query:mWt(t,e),queryRelated:gWt(t),queryTopFeatures:yWt(t),editing:vWt(t)}}function cWt(t){return{supportsCacheHint:Nq(t.advancedQueryCapabilities,"queryAnalytics")}}function hWt(t){const e=t.attachmentProperties,i={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:Nq(t.advancedQueryCapabilities,"queryAttachments"),supportsResize:ia(t,"supportsAttachmentsResizing",!1)};return e&&Array.isArray(e)&&e.forEach(r=>{const n=lWt[r.name];n&&(i[n]=!!r.isEnabled)}),i}function dWt(t){return{isVersioned:ia(t,"isDataVersioned",!1),supportsAttachment:ia(t,"hasAttachments",!1),supportsM:ia(t,"hasM",!1),supportsZ:ia(t,"hasZ",!1)}}function pWt(t){return{supportsAdvancedFieldProperties:ia(t,"supportsFieldDescriptionProperty",!1)}}function fWt(t,e,i){const r=t?t.toLowerCase().split(",").map(y=>y.trim()):[],n=i?XC(i):null,s=r.includes(ve(n)&&n.serverType==="MapServer"?"data":"query"),o=r.includes("editing")&&!e.datesInUnknownTimezone;let a=o&&r.includes("create"),l=o&&r.includes("delete"),c=o&&r.includes("update");const h=r.includes("changetracking"),p=e.advancedQueryCapabilities;return o&&!(a||l||c)&&(a=l=c=!0),{supportsCalculate:ia(e,"supportsCalculate",!1),supportsTruncate:ia(e,"supportsTruncate",!1),supportsValidateSql:ia(e,"supportsValidateSql",!1),supportsAdd:a,supportsDelete:l,supportsEditing:o,supportsChangeTracking:h,supportsQuery:s,supportsQueryAnalytics:ia(p,"supportsQueryAnalytic",!1),supportsQueryAttachments:ia(p,"supportsQueryAttachments",!1),supportsQueryTopFeatures:ia(p,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:ia(e,"supportsAttachmentsResizing",!1),supportsSync:r.includes("sync"),supportsUpdate:c,supportsExceedsLimitStatistics:ia(e,"supportsExceedsLimitStatistics",!1)}}function mWt(t,e){const i=t.advancedQueryCapabilities,r=t.ownershipBasedAccessControlForFeatures,n=t.archivingInfo,s=t.currentVersion,o=e?.includes("MapServer"),a=!o||s>=Hi("mapserver-pbf-version-support"),l=L9(e),c=new Set((t.supportedQueryFormats??"").split(",").map(h=>h.toLowerCase().trim()));return{supportsStatistics:ia(i,"supportsStatistics",t.supportsStatistics),supportsPercentileStatistics:ia(i,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:ia(i,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:uWt(i),supportsCentroid:ia(i,"supportsReturningGeometryCentroid",!1),supportsDistance:ia(i,"supportsQueryWithDistance",!1),supportsDistinct:ia(i,"supportsDistinct",t.supportsAdvancedQueries),supportsExtent:ia(i,"supportsReturningQueryExtent",!1),supportsGeometryProperties:ia(i,"supportsReturningGeometryProperties",!1),supportsHavingClause:ia(i,"supportsHavingClause",!1),supportsOrderBy:ia(i,"supportsOrderBy",t.supportsAdvancedQueries),supportsPagination:ia(i,"supportsPagination",!1),supportsQuantization:ia(t,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:ia(t,"supportsQuantizationEditMode",!1),supportsQueryGeometry:ia(t,"supportsReturningQueryGeometry",!1),supportsResultType:ia(i,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:ia(i,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:ia(i,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:ia(t,"useStandardizedQueries",!1),supportsTopFeaturesQuery:ia(i,"supportsTopFeaturesQuery",!1),supportsQueryByOthers:ia(r,"allowOthersToQuery",!0),supportsHistoricMoment:ia(n,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:a&&c.has("pbf"),supportsDisjointSpatialRelationship:ia(i,"supportsDisjointSpatialRel",!1),supportsCacheHint:ia(i,"supportsQueryWithCacheHint",!1)||Nq(i,"query"),supportsDefaultSpatialReference:ia(i,"supportsDefaultSR",!1),supportsCompactGeometry:l,supportsFullTextSearch:ia(i,"supportsFullTextSearch",!1),maxRecordCountFactor:Eoe(t,"maxRecordCountFactor",void 0),maxRecordCount:Eoe(t,"maxRecordCount",void 0),standardMaxRecordCount:Eoe(t,"standardMaxRecordCount",void 0),tileMaxRecordCount:Eoe(t,"tileMaxRecordCount",void 0)}}function gWt(t){const e=t.advancedQueryCapabilities,i=ia(e,"supportsAdvancedQueryRelated",!1);return{supportsPagination:ia(e,"supportsQueryRelatedPagination",!1),supportsCount:i,supportsOrderBy:i,supportsCacheHint:Nq(e,"queryRelated")}}function yWt(t){return{supportsCacheHint:Nq(t.advancedQueryCapabilities,"queryTopFilter")}}function vWt(t){const e=t.ownershipBasedAccessControlForFeatures;return{supportsGeometryUpdate:ia(t,"allowGeometryUpdates",!0),supportsGlobalId:ia(t,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:ia(t,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:ia(t,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:ia(t,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:ia(t,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:ia(e,"allowAnonymousToDelete",!0),supportsDeleteByOthers:ia(e,"allowOthersToDelete",!0),supportsUpdateByAnonymous:ia(e,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:ia(e,"allowOthersToUpdate",!0)}}const vYe=t=>{let e=class extends t{constructor(){super(...arguments),this.capabilities=null,this.copyright=null,this.dateFieldsTimeReference=null,this.datesInUnknownTimezone=!1,this.displayField=null,this.definitionExpression=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.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.isTable=!1,this.layerId=void 0,this.minScale=0,this.maxScale=0,this.globalIdField=null,this.objectIdField=null,this.preferredTimeReference=null,this.relationships=null,this.sourceJSON=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.spatialReference=hr.WGS84,this.subtypeField=null,this.trackIdField=null,this.indexes=new(Sr.ofType(JC)),this.version=void 0}readCapabilitiesFromService(i,r){return fSe(r,this.url)}get effectiveCapabilities(){const i=this.capabilities;if(!i)return null;const r=gi(i),{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)}readEditingInfo(i,r){const{editingInfo:n}=r;return n?{lastEditDate:n.lastEditDate!=null?new Date(n.lastEditDate):null}:null}readIsTableFromService(i,r){return r.type==="Table"}readMinScale(i,r){return r.effectiveMinScale||i||0}readMaxScale(i,r){return r.effectiveMaxScale||i||0}readGlobalIdFieldFromService(i,r){return dYe(r)}readObjectIdFieldFromService(i,r){return pYe(r)}readServiceDefinitionExpression(i,r){return r.definitionQuery||r.definitionExpression}set url(i){const r=NHe({layer:this,url:i,nonStandardUrlAllowed:!0,logger:Oi.getLogger(this.declaredClass)});this._set("url",r.url),r.layerId!=null&&this._set("layerId",r.layerId)}writeUrl(i,r,n,s){kHe(this,i,null,r,s)}readVersion(i,r){return nWt(r)}};return E([N({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),E([Vi("service","capabilities")],e.prototype,"readCapabilitiesFromService",null),E([N({readOnly:!0})],e.prototype,"effectiveCapabilities",null),E([N({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],e.prototype,"copyright",void 0),E([N({type:VR})],e.prototype,"dateFieldsTimeReference",void 0),E([N({type:Boolean})],e.prototype,"datesInUnknownTimezone",void 0),E([N({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],e.prototype,"displayField",void 0),E([N({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],e.prototype,"definitionExpression",void 0),E([N({readOnly:!0,type:rWt})],e.prototype,"editFieldsInfo",void 0),E([N({readOnly:!0})],e.prototype,"editingInfo",void 0),E([Vi("editingInfo")],e.prototype,"readEditingInfo",null),E([N((()=>{const i=gi(FR),r=i.json.origins;return r["web-map"]={read:!1,write:!1},r["portal-item"]={read:!1,write:!1},i})())],e.prototype,"elevationInfo",void 0),E([N({type:pSe,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],e.prototype,"floorInfo",void 0),E([N({type:Ar,json:{origins:{service:{read:{source:"extent"}}}}})],e.prototype,"fullExtent",void 0),E([N()],e.prototype,"gdbVersion",void 0),E([N({readOnly:!0,type:oWt,json:{read:{source:"geometryProperties"}}})],e.prototype,"geometryFieldsInfo",void 0),E([N({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:uSe.read}}}})],e.prototype,"geometryType",void 0),E([N({type:Boolean,json:{origins:{service:{read:!0}}}})],e.prototype,"hasM",void 0),E([N({type:Boolean,json:{origins:{service:{read:!0}}}})],e.prototype,"hasZ",void 0),E([N({readOnly:!0,type:B9})],e.prototype,"heightModelInfo",void 0),E([N({type:Date})],e.prototype,"historicMoment",void 0),E([N({readOnly:!0})],e.prototype,"isTable",void 0),E([Vi("service","isTable",["type"])],e.prototype,"readIsTableFromService",null),E([N({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],e.prototype,"layerId",void 0),E([N($2e)],e.prototype,"minScale",void 0),E([Vi("service","minScale",["minScale","effectiveMinScale"])],e.prototype,"readMinScale",null),E([N(B2e)],e.prototype,"maxScale",void 0),E([Vi("service","maxScale",["maxScale","effectiveMaxScale"])],e.prototype,"readMaxScale",null),E([N({type:String})],e.prototype,"globalIdField",void 0),E([Vi("service","globalIdField",["globalIdField","fields"])],e.prototype,"readGlobalIdFieldFromService",null),E([N({type:String})],e.prototype,"objectIdField",void 0),E([Vi("service","objectIdField",["objectIdField","fields"])],e.prototype,"readObjectIdFieldFromService",null),E([N({type:VR})],e.prototype,"preferredTimeReference",void 0),E([N({type:[aWt],readOnly:!0})],e.prototype,"relationships",void 0),E([N()],e.prototype,"sourceJSON",void 0),E([N({type:Boolean})],e.prototype,"returnM",void 0),E([N({type:Boolean})],e.prototype,"returnZ",void 0),E([N({readOnly:!0})],e.prototype,"serviceDefinitionExpression",void 0),E([Vi("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],e.prototype,"readServiceDefinitionExpression",null),E([N({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],e.prototype,"serviceItemId",void 0),E([N({type:hr,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],e.prototype,"spatialReference",void 0),E([N({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],e.prototype,"subtypeField",void 0),E([N({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],e.prototype,"trackIdField",void 0),E([N({readOnly:!0,json:{write:!1}})],e.prototype,"serverGens",void 0),E([N({type:Sr.ofType(JC),readOnly:!0})],e.prototype,"indexes",void 0),E([N(Qy)],e.prototype,"url",null),E([Cr("url")],e.prototype,"writeUrl",null),E([N({json:{origins:{service:{read:!0}},read:!1}})],e.prototype,"version",void 0),E([Vi("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],e.prototype,"readVersion",null),e=E([dt("esri.layers.mixins.FeatureLayerBase")],e),e};let eB=class extends _a(Ui){constructor(e){super(e),this.expression=null,this.title=null,this.returnType=null}};E([N({type:String,json:{write:!0}})],eB.prototype,"expression",void 0),E([N({type:String,json:{write:!0}})],eB.prototype,"title",void 0),E([N({type:String,json:{write:!0}})],eB.prototype,"returnType",void 0),eB=E([dt("esri.layers.support.ExpressionInfo")],eB);const mSe=eB;var gSe;let OA=gSe=class extends Ui{constructor(t){super(t),this.isAutoGenerated=!1,this.name=null,this.alias=null,this.onStatisticField=null,this.onStatisticExpression=null,this.statisticType=null}clone(){return new gSe({name:this.name,alias:this.alias,isAutoGenerated:this.isAutoGenerated,onStatisticExpression:gi(this.onStatisticExpression),onStatisticField:this.onStatisticField,statisticType:this.statisticType})}};E([N({type:Boolean,json:{write:!0}})],OA.prototype,"isAutoGenerated",void 0),E([N({type:String,json:{write:!0}})],OA.prototype,"name",void 0),E([N({type:String,json:{write:!0}})],OA.prototype,"alias",void 0),E([N({type:String,json:{write:!0}})],OA.prototype,"onStatisticField",void 0),E([N({type:mSe,json:{write:!0}})],OA.prototype,"onStatisticExpression",void 0),E([N({type:String,json:{write:!0}})],OA.prototype,"statisticType",void 0),OA=gSe=E([dt("esri.layers.support.AggregateField")],OA);const E5=OA;let RA=class extends Ui{constructor(){super(...arguments),this.type=null}};E([N({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],RA.prototype,"type",void 0),RA=E([dt("esri.layers.support.FeatureReduction")],RA);const ySe="__begin__",vSe="__end__",_Wt=new RegExp(ySe,"ig"),bWt=new RegExp(vSe,"ig"),_Ye=new RegExp("^"+ySe,"i"),bYe=new RegExp(vSe+"$","i"),Ioe='"',wWt=Ioe+" + ",xWt=" + "+Ioe;function SWt(t){return t.replace(new RegExp("\\[","g"),"{").replace(new RegExp("\\]","g"),"}")}function CWt(t){return t.replace(new RegExp("\\{","g"),"[").replace(new RegExp("\\}","g"),"]")}function Aoe(t){const e={expression:"",type:"none"};return t.labelExpressionInfo?t.labelExpressionInfo.value?(e.expression=t.labelExpressionInfo.value,e.type="conventional"):t.labelExpressionInfo.expression&&(e.expression=t.labelExpressionInfo.expression,e.type="arcade"):t.labelExpression!=null&&(e.expression=SWt(t.labelExpression),e.type="conventional"),e}function TWt(t){const e=Aoe(t);if(!e)return null;switch(e.type){case"conventional":return _Se(e.expression);case"arcade":return e.expression}return null}function EWt(t){const e=Aoe(t);if(!e)return null;switch(e.type){case"conventional":return AWt(e.expression);case"arcade":return bSe(e.expression)}return null}function _Se(t){let e;return t?(e=Xx(t,i=>ySe+'$feature["'+i+'"]'+vSe),e=_Ye.test(e)?e.replace(_Ye,""):Ioe+e,e=bYe.test(e)?e.replace(bYe,""):e+Ioe,e=e.replace(_Wt,wWt).replace(bWt,xWt)):e='""',e}const IWt=/^\s*\{([^}]+)\}\s*$/i;function AWt(t){const e=t?.match(IWt);return e&&e[1].trim()||null}const PWt=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*$/i,OWt=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,RWt=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])([\w\s]+)(\1)\s*\));?\s*$/i;function bSe(t){if(!t)return null;let e=PWt.exec(t)||OWt.exec(t);return e?e[1]||e[3]:(e=RWt.exec(t),e?e[2]:null)}var wSe;let GR=wSe=class extends Ui{constructor(){super(...arguments),this.expression=null,this.title=null,this.value=null}readExpression(t,e){return e.value?_Se(e.value):t}writeExpression(t,e,i){this.value!=null&&(t=_Se(this.value)),t!=null&&(e[i]=t)}clone(){return new wSe({expression:this.expression,title:this.title,value:this.value})}};E([N({type:String,json:{write:{writerEnsuresNonNull:!0}}})],GR.prototype,"expression",void 0),E([Vi("expression",["expression","value"])],GR.prototype,"readExpression",null),E([Cr("expression")],GR.prototype,"writeExpression",null),E([N({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],GR.prototype,"title",void 0),E([N({json:{read:!1,write:!1}})],GR.prototype,"value",void 0),GR=wSe=E([dt("esri.layers.support.LabelExpressionInfo")],GR);const wYe=GR,xYe=[252,146,31,255],SYe={type:"esriSMS",style:"esriSMSCircle",size:6,color:xYe,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},CYe={type:"esriSLS",style:"esriSLSSolid",width:.75,color:xYe},TYe={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},MWt={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},xSe={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},SSe={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},CSe={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null},DWt=wd.fromJSON(SYe),FWt=Mm.fromJSON(CYe),LWt=sw.fromJSON(TYe),NWt=ZL.fromJSON(MWt),kWt=wd.fromJSON(xSe),$Wt=Mm.fromJSON(SSe),BWt=sw.fromJSON(CSe);var TSe;const Poe=new Ks({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 Ooe(t,e,i){return{enabled:!BGe(i?.layer)}}function EYe(t){return!t||t.origin!=="service"&&t.layer?.type!=="map-image"}function VWt(t){return t?.type==="map-image"}function IYe(t){return!!VWt(t)&&!!t.capabilities?.exportMap?.supportsArcadeExpressionForLabeling}function jWt(t){return EYe(t)||IYe(t?.layer)}let Np=TSe=class extends Ui{static evaluateWhere(t,e){const i=(r,n,s)=>{switch(n){case"=":return r==s;case"<>":return r!=s;case">":return r>s;case">=":return r>=s;case"<":return rjWt(i)?{allowNull:!0}:{enabled:!1}}}})],Np.prototype,"labelExpressionInfo",void 0),E([Cr("labelExpressionInfo")],Np.prototype,"writeLabelExpressionInfo",null),E([N({type:Poe.apiValues,json:{type:Poe.jsonValues,read:Poe.read,write:Poe.write}})],Np.prototype,"labelPlacement",void 0),E([N({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],Np.prototype,"labelPosition",void 0),E([N({type:Number})],Np.prototype,"maxScale",void 0),E([Cr("maxScale")],Np.prototype,"writeMaxScale",null),E([N({type:Number})],Np.prototype,"minScale",void 0),E([Cr("minScale")],Np.prototype,"writeMinScale",null),E([N({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:Ooe}}}}})],Np.prototype,"repeatLabel",void 0),E([N({type:Number,cast:Ga,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:Ooe}}}}})],Np.prototype,"repeatLabelDistance",void 0),E([N({types:gjt,json:{origins:{"web-scene":{types:yjt,write:gze,default:null}},write:gze,default:null}})],Np.prototype,"symbol",void 0),E([N({type:Boolean,json:{write:!0}})],Np.prototype,"useCodedValues",void 0),E([N({type:String,json:{write:!0}})],Np.prototype,"where",void 0),Np=TSe=E([dt("esri.layers.support.LabelClass")],Np);const E2=Np;var ESe;const ISe=xC({types:GW}),GWt="esri.layers.support.FeatureReductionBinning";let nv=ESe=class extends RA{constructor(t){super(t),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(t,e,i){const r=t.filter(n=>n.statisticType!=="avg_angle").map(n=>n.toJSON());Dp(i,r,e)}readRenderer(t,e,i){const r=e.drawingInfo?.renderer;return r?h5(r,e,i)??void 0:e.defaultSymbol?e.types&&e.types.length?new WC({defaultSymbol:ISe(e.defaultSymbol,e,i),field:e.typeIdField,uniqueValueInfos:e.types.map(n=>({id:n.id,symbol:ISe(n.symbol,n,i)}))}):new i_({symbol:ISe(e.defaultSymbol,e,i)}):null}clone(){return new ESe({fields:gi(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:gi(this.labelingInfo),labelsVisible:this.labelsVisible,maxScale:this.maxScale,popupEnabled:this.popupEnabled,popupTemplate:gi(this.popupTemplate),renderer:gi(this.renderer)})}};E([rn({binning:"binning"})],nv.prototype,"type",void 0),E([rn({geohash:"geohash"})],nv.prototype,"binType",void 0),E([N({type:Number,range:{min:1,max:9},json:{write:!0}})],nv.prototype,"fixedBinLevel",void 0),E([N({type:[E2],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],nv.prototype,"labelingInfo",void 0),E([N(IA)],nv.prototype,"labelsVisible",void 0),E([N({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],nv.prototype,"maxScale",void 0),E([N(s_)],nv.prototype,"popupEnabled",void 0),E([N({type:wh,json:{name:"popupInfo",write:!0}})],nv.prototype,"popupTemplate",void 0),E([N({type:[E5],json:{write:!0}})],nv.prototype,"fields",void 0),E([Cr("fields")],nv.prototype,"writeFields",null),E([N({types:vA,json:{write:{target:"drawingInfo.renderer"}}})],nv.prototype,"renderer",void 0),E([Vi("renderer",["drawingInfo.renderer"])],nv.prototype,"readRenderer",null),nv=ESe=E([dt(GWt)],nv);const AYe=nv;var ASe;const PSe=xC({types:GW}),UWt="esri.layers.support.FeatureReductionCluster";function PYe(t){return t.type==="simple"&&!t.visualVariables?.length}let Uf=ASe=class extends Ui{constructor(t){super(t),this.type="cluster",this.clusterRadius=Ga("80px"),this.clusterMinSize=Ga("12px"),this.clusterMaxSize=Ga("50px"),this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=null}readRenderer(t,e,i){const r=e.drawingInfo?.renderer;return r?.authoringInfo?.isAutoGenerated?null:r?PYe(r)?null:h5(r,e,i)??void 0:e.defaultSymbol?e.types&&e.types.length?new WC({defaultSymbol:PSe(e.defaultSymbol,e,i),field:e.typeIdField,uniqueValueInfos:e.types.map(n=>({id:n.id,symbol:PSe(n.symbol,n,i)}))}):new i_({symbol:PSe(e.defaultSymbol,e,i)}):null}readSymbol(t,e,i){const r=e.drawingInfo?.renderer;return r?.authoringInfo?.isAutoGenerated?null:r&&PYe(r)?h5(r,e,i)?.symbol:null}writeSymbol(t,e,i,r){const n=this.renderer?.authoringInfo?.isAutoGenerated;if(!this.renderer||n){const s=new i_({symbol:t});e.drawingInfo={renderer:s.write({},r)}}}writeFields(t,e,i){const r=t.filter(n=>n.statisticType!=="avg_angle").map(n=>n.toJSON());Dp(i,r,e)}readFields(t,e,i){return t.filter(r=>!r.isAutoGenerated).map(r=>E5.fromJSON(r))}clone(){return new ASe({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:gi(this.labelingInfo),labelsVisible:this.labelsVisible,fields:gi(this.fields),maxScale:this.maxScale,renderer:gi(this.renderer),symbol:gi(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:gi(this.popupTemplate)})}};E([N({type:["cluster"],readOnly:!0,json:{write:!0}})],Uf.prototype,"type",void 0),E([N({type:Number,cast:t=>t==="auto"?t:Ga(t),json:{write:!0}})],Uf.prototype,"clusterRadius",void 0),E([N({type:Number,cast:Ga,json:{write:!0}})],Uf.prototype,"clusterMinSize",void 0),E([N({type:Number,cast:Ga,json:{write:!0}})],Uf.prototype,"clusterMaxSize",void 0),E([N({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],Uf.prototype,"maxScale",void 0),E([N(s_)],Uf.prototype,"popupEnabled",void 0),E([N({type:wh,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],Uf.prototype,"popupTemplate",void 0),E([N({types:vA,json:{write:{target:"drawingInfo.renderer"}}})],Uf.prototype,"renderer",void 0),E([Vi("renderer",["drawingInfo.renderer"])],Uf.prototype,"readRenderer",null),E([N({types:fjt})],Uf.prototype,"symbol",void 0),E([Vi("symbol",["drawingInfo.renderer"])],Uf.prototype,"readSymbol",null),E([Cr("symbol")],Uf.prototype,"writeSymbol",null),E([N({type:[E2],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],Uf.prototype,"labelingInfo",void 0),E([N(IA)],Uf.prototype,"labelsVisible",void 0),E([N({type:[E5],json:{write:!0}})],Uf.prototype,"fields",void 0),E([Cr("fields")],Uf.prototype,"writeFields",null),E([Vi("fields")],Uf.prototype,"readFields",null),Uf=ASe=E([dt(UWt)],Uf);const OYe=Uf;var OSe;let Roe=OSe=class extends RA{constructor(t){super(t),this.type="selection"}clone(){return new OSe}};E([N({type:["selection"]})],Roe.prototype,"type",void 0),Roe=OSe=E([dt("esri.layers.support.FeatureReductionSelection")],Roe);const RSe=Roe,RYe={key:"type",base:RA,typeMap:{cluster:OYe,binning:AYe}},zWt={types:{key:"type",base:RA,typeMap:{selection:RSe,cluster:OYe,binning:AYe}},json:{name:"layerDefinition.featureReduction",write:{allowNull:!0},origins:{"web-map":{types:RYe},"portal-item":{types:RYe},"web-scene":{types:{key:"type",base:RA,typeMap:{selection:RSe}}}}}},UR={Base64:0,Hex:1,String:2,Raw:3},tB=8,MYe=(1<>16)+(e>>16)+(i>>16)<<16|65535&i}function HWt(t){const e=[];for(let i=0,r=t.length*tB;i>5]|=(t.charCodeAt(i/tB)&MYe)<>5]>>>i%32&MYe));return e.join("")}function qWt(t){const e="0123456789abcdef",i=[];for(let r=0,n=4*t.length;r>2]>>r%4*8+4&15)+e.charAt(t[r>>2]>>r%4*8&15));return i.join("")}function YWt(t){const e="=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=[];for(let n=0,s=4*t.length;n>2]>>n%4*8&255)<<16|(t[n+1>>2]>>(n+1)%4*8&255)<<8|t[n+2>>2]>>(n+2)%4*8&255;for(let a=0;a<4;a++)8*n+6*a>32*t.length?r.push(e):r.push(i.charAt(o>>6*(3-a)&63))}return r.join("")}function XWt(t,e){return t<>>32-e}function Moe(t,e,i,r,n,s){return zR(XWt(zR(zR(e,t),zR(r,s)),n),i)}function t0(t,e,i,r,n,s,o){return Moe(e&i|~e&r,t,e,n,s,o)}function i0(t,e,i,r,n,s,o){return Moe(e&r|i&~r,t,e,n,s,o)}function r0(t,e,i,r,n,s,o){return Moe(e^i^r,t,e,n,s,o)}function n0(t,e,i,r,n,s,o){return Moe(i^(e|~r),t,e,n,s,o)}function KWt(t,e){t[e>>5]|=128<>>9<<4)]=e;let i=1732584193,r=-271733879,n=-1732584194,s=271733878;for(let o=0;ot.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions&&this.legendOptions.clone(),levels:gi(this.levels)})}};E([N()],kq.prototype,"levels",void 0),E([Cr("levels")],kq.prototype,"writeLevels",null),kq=MSe=E([dt("esri.views.2d.engine.LevelDependentSizeVariable")],kq);const JWt=Oi.getLogger("esri.views.2d.layers.support.clusterUtils");Hi.add("esri-cluster-arcade-enabled",!0);const ZWt=Hi("esri-cluster-arcade-enabled"),DSe=(t,e,i,r,n)=>{const s=e.clone();if(!FYe(s))return s;if(s.authoringInfo||(s.authoringInfo=new HW),s.authoringInfo.isAutoGenerated=!0,"visualVariables"in s){const o=(s.visualVariables||[]).filter(l=>l.valueExpression!=="$view.scale"),a=FSe(o);o.forEach(l=>{l.type==="rotation"?l.field?l.field=I5(t,l.field,"avg_angle","number"):l.valueExpression&&(l.field=$q(t,l.valueExpression,"avg_angle","number"),l.valueExpression=null):l.normalizationField?(l.field=I5(t,l.field,"avg_norm","number",l.normalizationField),l.normalizationField=null):l.field?l.field=I5(t,l.field,"avg","number"):l.valueExpression&&(l.field=$q(t,l.valueExpression,"avg","number"),l.valueExpression=null)}),lt(a)&&!QWt(o)&&n&&(o.push(LSe(i,r)),s.dynamicClusterSize=!0),s.visualVariables=o}switch(s.type){case"simple":break;case"pie-chart":for(const o of s.attributes)o.field?o.field=I5(t,o.field,"sum","number"):o.valueExpression&&(o.field=$q(t,o.valueExpression,"sum","number"),o.valueExpression=null);break;case"unique-value":s.field?s.field=I5(t,s.field,"mode","string"):s.valueExpression&&(s.field=$q(t,s.valueExpression,"mode","string"),s.valueExpression=null);break;case"class-breaks":s.normalizationField?(s.field=I5(t,s.field,"avg_norm","number",s.normalizationField),s.normalizationField=null):s.field?s.field=I5(t,s.field,"avg","number"):s.valueExpression&&(s.field=$q(t,s.valueExpression,"avg","number"),s.valueExpression=null)}return s},FSe=t=>{for(const e of t)if(e.type==="size")return e;return null};function DYe(t,e,i){const r=t.clone();let n=!1;if("visualVariables"in r){const s=(r.visualVariables||[]).filter(a=>a.valueExpression!=="$view.scale"),o=FSe(s);lt(o)&&(r.visualVariables||(r.visualVariables=[]),r.visualVariables.push(LSe(e,i)),r.dynamicClusterSize=!0,n=!0)}return{renderer:r,didInject:n}}const QWt=t=>{for(const e of t)if(e.field==="cluster_count")return!0;return!1},LSe=(t,e)=>{const i=[new w9({value:0,size:0}),new w9({value:1})];if(lt(e))return new s5({field:"cluster_count",stops:[...i,new w9({value:2,size:0})]});const r=Object.keys(e).reduce((n,s)=>({...n,[s]:[...i,new w9({value:Math.max(2,e[s].minValue),size:t.clusterMinSize}),new w9({value:Math.max(3,e[s].maxValue),size:t.clusterMaxSize})]}),{});return new kq({field:"cluster_count",levels:r})},FYe=t=>{const e=i=>JWt.error(new st("Unsupported-renderer",i,{renderer:t}));switch(t.type){case"unique-value":if(t.field2||t.field3)return e("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1;break;case"class-breaks":if(t.normalizationField){const i=t.normalizationType;if(i!=="field")return e(`FeatureReductionCluster does not support a normalizationType of ${i}`),!1}break;case"simple":case"pie-chart":break;default:return e(`FeatureReductionCluster does not support renderers of type ${t.type}`),!1}if(!ZWt){if("valueExpression"in t&&t.valueExpression)return e("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"),!1;if(("visualVariables"in t&&t.visualVariables||[]).some(i=>!(!("valueExpression"in i)||!i.valueExpression)))return e("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function eqt(t,e,i){switch(t){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=i,n="field",s=e.toLowerCase()+",norm:"+n+","+r.toLowerCase();return"cluster_avg_"+Doe(s)}}}function $q(t,e,i,r){const n=Doe(e),s=i==="mode"?`cluster_type_${n}`:i==="sum"?`cluster_sum_${n}`:`cluster_avg_${n}`;return t.some(o=>o.name===s)||t.push(new E5({name:s,isAutoGenerated:!0,onStatisticExpression:new mSe({expression:e,returnType:r}),statisticType:i})),s}function I5(t,e,i,r,n){if(e==="cluster_count"||t.some(o=>o.name===e))return e;const s=eqt(i,e,n);return t.some(o=>o.name===s)||(i==="avg_norm"?t.push(new E5({name:s,isAutoGenerated:!0,onStatisticExpression:new mSe({expression:`$feature.${e} / $feature.${n}`,returnType:r}),statisticType:"avg"})):t.push(new E5({name:s,isAutoGenerated:!0,onStatisticField:e,statisticType:i}))),s}const Bq=t=>{let e=class extends t{constructor(...i){super(...i),this.own(this.watch("renderer",()=>{if(this.featureReduction){const r=this._normalizeFeatureReduction(this.featureReduction);this._set("featureReduction",r)}},!0))}set featureReduction(i){const r=this._normalizeFeatureReduction(i);this._set("featureReduction",r)}set renderer(i){}_normalizeFeatureReduction(i){if(i?.type!=="cluster")return i;const r=i.clone(),n=[new E5({name:"cluster_count",isAutoGenerated:!0,statisticType:"count"})],s=(r.fields??[]).filter(a=>!a.isAutoGenerated);if(i.renderer&&!i.renderer.authoringInfo?.isAutoGenerated)return r.fields=[...n,...s],r;if(i.symbol)return r.fields=[...n,...s],r.renderer=null,r;if(!this.renderer)return i;const o=DSe(n,this.renderer,i,null,!1);return r.fields=[...n,...s],r.renderer=o,r}};return E([N(zWt)],e.prototype,"featureReduction",null),e=E([dt("esri.layers.mixins.FeatureReductionLayer")],e),e},tqt={"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},"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-map/operational-layers":{ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CSV:!0,GeoRSS:!0,GeoJSON:!0,GroupLayer:!0,KML:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},"web-map/basemap":{ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0,BingMapsAerial:!0,BingMapsRoad:!0,BingMapsHybrid:!0},"web-map/tables":{ArcGISFeatureLayer:!0},"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISSceneServiceLayer:!0,PointCloudLayer:!0,BuildingSceneLayer:!0,IntegratedMeshLayer:!0,OrientedImageryLayer:!0}},qc=t=>{let e=class extends t{constructor(){super(...arguments),this.title=null}writeListMode(i,r,n,s){(s&&s.layerContainerType==="ground"||i&&Aje(this,n,{},s))&&(r[n]=i)}writeOperationalLayerType(i,r,n,s){!i||s&&s.layerContainerType==="tables"||(r.layerType=i)}writeTitle(i,r){r.title=i??"Layer"}read(i,r){r&&(r.layer=this),R6t(this,i,n=>super.read(i,n),r)}write(i,r){if(r?.origin){const o=`${r.origin}/${r.layerContainerType||"operational-layers"}`,a=tqt[o];let l=a&&a[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 st("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(i,{...r,layer:this}),s=!!r&&!!r.messages&&!!r.messages.filter(o=>o instanceof st&&o.name==="web-document-write:property-required").length;return TC(n?.url)?(r?.messages?.push(new st("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 E([N({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],e.prototype,"id",void 0),E([N(EWe)],e.prototype,"listMode",void 0),E([Cr("listMode")],e.prototype,"writeListMode",null),E([N({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1}}}})],e.prototype,"operationalLayerType",void 0),E([Cr("operationalLayerType")],e.prototype,"writeOperationalLayerType",null),E([N(Tq)],e.prototype,"opacity",void 0),E([N({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),E([Cr("title"),Cr(["web-scene"],"title")],e.prototype,"writeTitle",null),E([N({type:Boolean,json:{name:"visibility"}})],e.prototype,"visible",void 0),e=E([dt("esri.layers.mixins.OperationalLayer")],e),e};var NSe;const kSe=new Ks({asc:"ascending",desc:"descending"});let iB=NSe=class extends Ui{constructor(t){super(t),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new NSe({field:this.field,valueExpression:this.valueExpression,order:this.order})}};E([N({type:String,json:{write:!0}})],iB.prototype,"field",void 0),E([N({type:String,json:{write:!0}})],iB.prototype,"valueExpression",void 0),E([N({type:kSe.apiValues,json:{read:kSe.read,write:kSe.write}})],iB.prototype,"order",void 0),iB=NSe=E([dt("esri.layers.support.OrderByInfo")],iB);const LYe=iB;function iqt(t,e,i){if(!t)return null;const r=t.find(s=>!!s.field);if(!r)return null;const n=new LYe;return n.read(r,i),[n]}function rqt(t,e,i,r){const n=t.find(s=>!!s.field);n&&Dp(i,[n.toJSON()],e)}const Foe=t=>{let e=class extends t{constructor(){super(...arguments),this.orderBy=null}};return E([N({type:[LYe],json:{origins:{"web-scene":{write:!1,read:!1}},read:{source:"layerDefinition.orderBy",reader:iqt},write:{target:"layerDefinition.orderBy",writer:rqt}}})],e.prototype,"orderBy",void 0),e=E([dt("esri.layers.mixins.OrderedLayer")],e),e};let $Se,mr=null;function NYe(){return!!mr}function nqt(){return!!Hi("esri-wasm")}function kYe(){return $Se||($Se=Promise.resolve().then(()=>aji).then(t=>t.p).then(({default:t})=>t({locateFile:e=>Ql(`esri/geometry/support/${e}`)})).then(t=>{BYe(t)}),$Se)}var Vq,Du,j1;(function(t){function e(s,o,a){mr.ensureCache.prepare();const l=A5(a),c=a===l,h=mr.ensureFloat64(l),p=mr._pe_geog_to_proj(mr.getPointer(s),o,h);return p&&HR(a,o,h,c),p}function i(s,o,a,l){switch(l){case Du.PE_TRANSFORM_P_TO_G:return r(s,o,a);case Du.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){mr.ensureCache.prepare();const c=A5(a),h=a===c,p=mr.ensureFloat64(c),y=mr._pe_proj_to_geog_center(mr.getPointer(s),o,p,l);return y&&HR(a,o,p,h),y}t.geogToProj=e,t.projGeog=i,t.projToGeog=r,t.projToGeogCenter=n})(Vq||(Vq={})),function(t){function e(){t.PE_BUFFER_MAX=mr.PeDefs.prototype.PE_BUFFER_MAX,t.PE_NAME_MAX=mr.PeDefs.prototype.PE_NAME_MAX,t.PE_MGRS_MAX=mr.PeDefs.prototype.PE_MGRS_MAX,t.PE_USNG_MAX=mr.PeDefs.prototype.PE_USNG_MAX,t.PE_DD_MAX=mr.PeDefs.prototype.PE_DD_MAX,t.PE_DDM_MAX=mr.PeDefs.prototype.PE_DDM_MAX,t.PE_DMS_MAX=mr.PeDefs.prototype.PE_DMS_MAX,t.PE_UTM_MAX=mr.PeDefs.prototype.PE_UTM_MAX,t.PE_PARM_MAX=mr.PeDefs.prototype.PE_PARM_MAX,t.PE_TYPE_NONE=mr.PeDefs.prototype.PE_TYPE_NONE,t.PE_TYPE_GEOGCS=mr.PeDefs.prototype.PE_TYPE_GEOGCS,t.PE_TYPE_PROJCS=mr.PeDefs.prototype.PE_TYPE_PROJCS,t.PE_TYPE_GEOGTRAN=mr.PeDefs.prototype.PE_TYPE_GEOGTRAN,t.PE_TYPE_COORDSYS=mr.PeDefs.prototype.PE_TYPE_COORDSYS,t.PE_TYPE_UNIT=mr.PeDefs.prototype.PE_TYPE_UNIT,t.PE_TYPE_LINUNIT=mr.PeDefs.prototype.PE_TYPE_LINUNIT,t.PE_STR_OPTS_NONE=mr.PeDefs.prototype.PE_STR_OPTS_NONE,t.PE_STR_AUTH_NONE=mr.PeDefs.prototype.PE_STR_AUTH_NONE,t.PE_STR_AUTH_TOP=mr.PeDefs.prototype.PE_STR_AUTH_TOP,t.PE_STR_NAME_CANON=mr.PeDefs.prototype.PE_STR_NAME_CANON,t.PE_PARM_X0=mr.PeDefs.prototype.PE_PARM_X0,t.PE_PARM_ND=mr.PeDefs.prototype.PE_PARM_ND,t.PE_TRANSFORM_1_TO_2=mr.PeDefs.prototype.PE_TRANSFORM_1_TO_2,t.PE_TRANSFORM_2_TO_1=mr.PeDefs.prototype.PE_TRANSFORM_2_TO_1,t.PE_TRANSFORM_P_TO_G=mr.PeDefs.prototype.PE_TRANSFORM_P_TO_G,t.PE_TRANSFORM_G_TO_P=mr.PeDefs.prototype.PE_TRANSFORM_G_TO_P,t.PE_HORIZON_RECT=mr.PeDefs.prototype.PE_HORIZON_RECT,t.PE_HORIZON_POLY=mr.PeDefs.prototype.PE_HORIZON_POLY,t.PE_HORIZON_LINE=mr.PeDefs.prototype.PE_HORIZON_LINE,t.PE_HORIZON_DELTA=mr.PeDefs.prototype.PE_HORIZON_DELTA}t.init=e}(Du||(Du={})),function(t){const e={},i={},r=v=>{if(v){const x=v.getType();switch(x){case Du.PE_TYPE_GEOGCS:v=mr.castObject(v,mr.PeGeogcs);break;case Du.PE_TYPE_PROJCS:v=mr.castObject(v,mr.PeProjcs);break;case Du.PE_TYPE_GEOGTRAN:v=mr.castObject(v,mr.PeGeogtran);break;default:x&Du.PE_TYPE_UNIT&&(v=mr.castObject(v,mr.PeUnit))}}return v};function n(){mr.PeFactory.prototype.initialize(null)}function s(v){return o(Du.PE_TYPE_COORDSYS,v)}function o(v,x){let I=null,P=e[v];if(P||(P={},e[v]=P),P.hasOwnProperty(String(x)))I=P[x];else{const F=mr.PeFactory.prototype.factoryByType(v,x);mr.compare(F,mr.NULL)||(I=F,P[x]=I)}return I=r(I),I}function a(v,x){let I=null,P=i[v];if(P||(P={},i[v]=P),P.hasOwnProperty(x))I=P[x];else{const F=mr.PeFactory.prototype.fromString(v,x);mr.compare(F,mr.NULL)||(I=F,P[x]=I)}return I=r(I),I}function l(v){return o(Du.PE_TYPE_GEOGCS,v)}function c(v){return o(Du.PE_TYPE_GEOGTRAN,v)}function h(v){return mr.PeFactory.prototype.getCode(v)}function p(v){return o(Du.PE_TYPE_PROJCS,v)}function y(v){return o(Du.PE_TYPE_UNIT,v)}t.initialize=n,t.coordsys=s,t.factoryByType=o,t.fromString=a,t.geogcs=l,t.geogtran=c,t.getCode=h,t.projcs=p,t.unit=y}(j1||(j1={}));let $Ye=null;var Loe,BSe,Noe,VSe,koe,jSe,$oe,jq,GSe;function BYe(t){function e(s,o,a){s[o]=a(s[o])}mr=t,Du.init(),Loe.init(),koe.init(),$oe.init(),jq.init(),$Ye=class extends mr.PeGCSExtent{destroy(){mr.destroy(this)}};const i=[mr.PeDatum,mr.PeGeogcs,mr.PeGeogtran,mr.PeObject,mr.PeParameter,mr.PePrimem,mr.PeProjcs,mr.PeSpheroid,mr.PeUnit];for(const s of i)e(s.prototype,"getName",o=>function(){return o.call(this,new Array(Du.PE_NAME_MAX))});for(const s of[mr.PeGeogtran,mr.PeProjcs])e(s.prototype,"getParameters",o=>function(){const a=new Array(Du.PE_PARM_MAX);let l=o.call(this);for(let c=0;cfunction(){const o=this.getSize();if(!o)return null;const a=[];return HR(a,o,s.call(this)),a}),e(mr.PeGTlistExtendedEntry.prototype,"getEntries",s=>{const o=mr._pe_getPeGTlistExtendedGTsSize();return function(){let a=null;const l=s.call(this);if(!mr.compare(l,mr.NULL)){a=[l];const c=this.getSteps();if(c>1){const h=mr.getPointer(l);for(let p=1;pfunction(){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(!mr.compare(l,mr.NULL)){a=[l];const c=l.getNump();if(c>1){const h=mr.getPointer(l);for(let p=1;p{e.push(i[0],i[1])})):e=t,e}function HR(t,e,i,r=!1){if(r)for(let n=0;n<2*e;n++)t[n]=mr.getValue(i+n*Float64Array.BYTES_PER_ELEMENT,"double");else{const n=t.length===0;for(let s=0;s1)){const v=mr.getPointer(y);for(let x=1;x{MA(n);const s=n.getGeogtran();MA(s),s.getParameters().forEach(MA),[s.getGeogcs1(),s.getGeogcs2()].forEach(o=>{MA(o);const a=o.getDatum();MA(a),MA(a.getSpheroid()),MA(o.getPrimem()),MA(o.getUnit())})});mr.PeGTlistExtendedEntry.prototype.Delete(i[0])}}t.destroy=e}(BSe||(BSe={})),function(t){function e(i,r,n,s,o){mr.ensureCache.prepare();const a=A5(n),l=n===a,c=mr.ensureFloat64(a);let h=0;s&&(h=mr.ensureFloat64(s));const p=mr._pe_geog_to_geog(mr.getPointer(i),r,c,h,o);return p&&HR(n,r,c,l),p}t.geogToGeog=e}(Noe||(Noe={})),function(t){const e=(c,h,p,y,v,x)=>{let I,P;switch(mr.ensureCache.prepare(),c){case"dd":I=mr._pe_geog_to_dd,P=Du.PE_DD_MAX;break;case"ddm":I=mr._pe_geog_to_ddm,P=Du.PE_DDM_MAX;break;case"dms":I=mr._pe_geog_to_dms,P=Du.PE_DMS_MAX}let F=0;h&&(F=mr.getPointer(h));const k=A5(y),j=mr.ensureFloat64(k),V=Boe(p,P),Y=I(F,p,j,v,mr.ensureInt32(V));if(Y)for(let X=0;X{let x;switch(mr.ensureCache.prepare(),c){case"dd":x=mr._pe_dd_to_geog;break;case"ddm":x=mr._pe_ddm_to_geog;break;case"dms":x=mr._pe_dms_to_geog}let I=0;h&&(I=mr.getPointer(h));const P=y.map(V=>mr.ensureString(V)),F=mr.ensureInt32(P),k=mr.ensureFloat64(new Array(2*p)),j=x(I,p,F,k);return j&&HR(v,p,k),j};function r(c,h,p,y,v){return e("dms",c,h,p,y,v)}function n(c,h,p,y){return i("dms",c,h,p,y)}function s(c,h,p,y,v){return e("ddm",c,h,p,y,v)}function o(c,h,p,y){return i("ddm",c,h,p,y)}function a(c,h,p,y,v){return e("dd",c,h,p,y,v)}function l(c,h,p,y){return i("dd",c,h,p,y)}t.geogToDms=r,t.dmsToGeog=n,t.geogToDdm=s,t.ddmToGeog=o,t.geogToDd=a,t.ddToGeog=l}(VSe||(VSe={})),function(t){function e(){t.PE_MGRS_STYLE_NEW=mr.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW,t.PE_MGRS_STYLE_OLD=mr.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD,t.PE_MGRS_STYLE_AUTO=mr.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO,t.PE_MGRS_180_ZONE_1_PLUS=mr.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS,t.PE_MGRS_ADD_SPACES=mr.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES}function i(n,s,o,a,l,c,h){mr.ensureCache.prepare();let p=0;n&&(p=mr.getPointer(n));const y=A5(o),v=mr.ensureFloat64(y),x=Boe(s,Du.PE_MGRS_MAX),I=mr.ensureInt32(x),P=mr._pe_geog_to_mgrs_extended(p,s,v,a,l,c,I);if(P)for(let F=0;Fmr.ensureString(x)),p=mr.ensureInt32(h),y=mr.ensureFloat64(new Array(2*s)),v=mr._pe_mgrs_to_geog_extended(c,s,p,a,y);return v&&HR(l,s,y),v}t.init=e,t.geogToMgrsExtended=i,t.mgrsToGeogExtended=r}(koe||(koe={})),function(t){function e(r,n,s,o,a,l,c){mr.ensureCache.prepare();let h=0;r&&(h=mr.getPointer(r));const p=A5(s),y=mr.ensureFloat64(p),v=Boe(n,Du.PE_MGRS_MAX),x=mr.ensureInt32(v),I=mr._pe_geog_to_usng(h,n,y,o,a,l,x);if(I)for(let P=0;Pmr.ensureString(y)),c=mr.ensureInt32(l),h=mr.ensureFloat64(new Array(2*n)),p=mr._pe_usng_to_geog(a,n,c,h);return p&&HR(o,n,h),p}t.geogToUsng=e,t.usngToGeog=i}(jSe||(jSe={})),function(t){function e(){t.PE_UTM_OPTS_NONE=mr.PeNotationUtm.prototype.PE_UTM_OPTS_NONE,t.PE_UTM_OPTS_ADD_SPACES=mr.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES,t.PE_UTM_OPTS_NS=mr.PeNotationUtm.prototype.PE_UTM_OPTS_NS}function i(n,s,o,a,l){mr.ensureCache.prepare();let c=0;n&&(c=mr.getPointer(n));const h=A5(o),p=mr.ensureFloat64(h),y=Boe(s,Du.PE_UTM_MAX),v=mr.ensureInt32(y),x=mr._pe_geog_to_utm(c,s,p,a,v);if(x)for(let I=0;Imr.ensureString(x)),p=mr.ensureInt32(h),y=mr.ensureFloat64(new Array(2*s)),v=mr._pe_utm_to_geog(c,s,p,a,y);return v&&HR(l,s,y),v}t.init=e,t.geogToUtm=i,t.utmToGeog=r}($oe||($oe={})),function(t){const e=new Map;function i(){t.PE_PCSINFO_OPTION_NONE=mr.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE,t.PE_PCSINFO_OPTION_DOMAIN=mr.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN,t.PE_POLE_OUTSIDE_BOUNDARY=mr.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY,t.PE_POLE_POINT=mr.PePCSInfo.prototype.PE_POLE_POINT}function r(n,s=t.PE_PCSINFO_OPTION_DOMAIN){let o=null,a=null;return e.has(n)&&(a=e.get(n),a[s]&&(o=a[s])),o||(o=mr.PePCSInfo.prototype.generate(n,s),a||(a=[],e.set(n,a)),a[s]=o),o}t.init=i,t.generate=r}(jq||(jq={})),function(t){function e(){return mr.PeVersion.prototype.version_string()}t.versionString=e}(GSe||(GSe={}));const sqt=Object.freeze(Object.defineProperty({__proto__:null,get PeCSTransformations(){return Vq},get PeDefs(){return Du},get PeFactory(){return j1},get PeGCSExtent(){return $Ye},get PeGTTransformations(){return Noe},get PeGTlistExtended(){return Loe},get PeGTlistExtendedEntry(){return BSe},get PeNotationDms(){return VSe},get PeNotationMgrs(){return koe},get PeNotationUsng(){return jSe},get PeNotationUtm(){return $oe},get PePCSInfo(){return jq},get PeVersion(){return GSe},_init:BYe,get _pe(){return mr},isLoaded:NYe,isSupported:nqt,load:kYe},Symbol.toStringTag,{value:"Module"})),P5=Math.PI/180,oqt=/SPHEROID\[([^\]]+)]/i,WR=Mu.radius,I2=Mu.eccentricitySquared,aqt={a1:WR*I2,a2:WR*I2*WR*I2,a3:WR*I2*I2/2,a4:WR*I2*WR*I2*2.5,a5:WR*I2+WR*I2*I2/2,a6:1-I2},lqt={4267:{a:63782064e-1,f:1/294.9786982},4269:{a:6378137,f:1/298.257222101},4326:{a:Mu.radius,f:Mu.flattening},104900:{a:2439700,f:0},104901:{a:6051e3,f:0},104902:{a:6051800,f:0},104903:{a:X3.radius,f:X3.flattening},104904:{a:3393400,f:1/192.0430107526882},104905:{a:tA.radius,f:tA.flattening},104906:{a:6200,f:0},104907:{a:11100,f:0},104908:{a:71492e3,f:.06487439154031222},104909:{a:8200,f:0},104910:{a:83500,f:0},104911:{a:1e4,f:0},104912:{a:2409300,f:0},104913:{a:15e3,f:0},104914:{a:4e4,f:0},104915:{a:1562090,f:0},104916:{a:2632345,f:0},104917:{a:85e3,f:0},104918:{a:1821460,f:0},104919:{a:5e3,f:0},104920:{a:12e3,f:0},104921:{a:3e4,f:3},104922:{a:18e3,f:0},104923:{a:14e3,f:0},104924:{a:49300,f:0},104925:{a:60268e3,f:1/10.2079945799458},104926:{a:16e3,f:0},104927:{a:9500,f:0},104928:{a:56e4,f:0},104929:{a:249400,f:0},104930:{a:59500,f:0},104931:{a:16e3,f:0},104932:{a:133e3,f:0},104933:{a:718e3,f:0},104934:{a:888e3,f:0},104935:{a:1986300,f:0},104936:{a:1e4,f:0},104937:{a:41900,f:0},104938:{a:11e4,f:0},104939:{a:50100,f:0},104940:{a:764e3,f:0},104941:{a:11e3,f:0},104942:{a:529800,f:0},104943:{a:2575e3,f:0},104944:{a:25559e3,f:1/43.61604095563141},104945:{a:578900,f:0},104946:{a:33e3,f:0},104947:{a:21e3,f:0},104948:{a:13e3,f:0},104949:{a:31e3,f:0},104950:{a:27e3,f:0},104951:{a:42e3,f:0},104952:{a:235800,f:0},104953:{a:761400,f:0},104954:{a:15e3,f:0},104955:{a:54e3,f:0},104956:{a:77e3,f:0},104957:{a:27e3,f:0},104958:{a:788900,f:0},104959:{a:584700,f:0},104960:{a:24764e3,f:.01708124697141011},104961:{a:74e3,f:0},104962:{a:79e3,f:0},104963:{a:104e3,f:.14423076923076922},104964:{a:29e3,f:0},104965:{a:17e4,f:0},104966:{a:208e3,f:0},104967:{a:4e4,f:0},104968:{a:1352600,f:0},104969:{a:1195e3,f:0},104970:{a:593e3,f:0},104971:{a:tA.radius,f:0},104972:{a:47e4,f:0},104973:{a:255e3,f:0},104974:{a:2439400,f:0}};let Voe=0,USe=class k9e{static fromGE(e){const i=new k9e;return i._wkt=e.wkt,i._wkid=e.wkid,i._isInverse=e.isInverse,i}constructor(e){this.uid=Voe++,e?(this._wkt=e.wkt!=null?e.wkt:null,this._wkid=e.wkid!=null?e.wkid:-1,this._isInverse=e.isInverse!=null&&e.isInverse===!0):(this._wkt=null,this._wkid=-1,this._isInverse=!1)}get wkt(){return this._wkt}set wkt(e){this._wkt=e,this.uid=Voe++}get wkid(){return this._wkid}set wkid(e){this._wkid=e,this.uid=Voe++}get isInverse(){return this._isInverse}set isInverse(e){this._isInverse=e,this.uid=Voe++}getInverse(){const e=new k9e;return e._wkt=this.wkt,e._wkid=this._wkid,e._isInverse=!this.isInverse,e}},joe=class qie{static cacheKey(e,i){return[e.wkid!==void 0&&e.wkid!==null?e.wkid.toString():"-1",e.wkt!==void 0&&e.wkt!==null?e.wkt.toString():"",i.wkid!==void 0&&i.wkid!==null?i.wkid.toString():"-1",i.wkt!==void 0&&i.wkt!==null?i.wkt.toString():""].join(",")}static fromGE(e){const i=new qie;let r="";for(const n of e.steps){const s=USe.fromGE(n);i.steps.push(s),r+=s.uid.toString()+","}return i._cachedProjection={},i._gtlistentry=null,i._chain=r,i}constructor(e){if(this.steps=[],this._cachedProjection={},this._chain="",this._gtlistentry=null,e&&e.steps)for(const i of e.steps)i instanceof USe?this.steps.push(i):this.steps.push(new USe({wkid:i.wkid,wkt:i.wkt,isInverse:i.isInverse}))}getInverse(){const e=new qie;e.steps=[];for(let i=this.steps.length-1;i>=0;i--){const r=this.steps[i];e.steps.push(r.getInverse())}return e}getGTListEntry(){let e="";for(const i of this.steps)e+=i.uid.toString()+",";return e!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=e),this._gtlistentry}assignCachedGe(e,i,r){this._cachedProjection[qie.cacheKey(e,i)]=r}getCachedGeTransformation(e,i){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[qie.cacheKey(e,i)];return n===void 0?null:n}},qR=null,Gq=null,zSe=null,HSe={};const VYe=new Y_e;function hw(){return!!qR&&NYe()}function A2(t){return lt(zSe)&&(zSe=Promise.all([kYe(),Promise.resolve().then(()=>mMi).then(e=>e.g),Promise.resolve().then(()=>fji)])),zSe.then(([,e,{hydratedAdapter:i}])=>{yn(t),Gq=i,qR=e.default,qR._enableProjection(sqt),VYe.notify()})}function cp(t,e,i=null,r=null){return Array.isArray(t)?t.length===0?[]:Uq(Gq,t,t[0].spatialReference,e,i,r):Uq(Gq,[t],t.spatialReference,e,i,r)[0]}function Uq(t,e,i,r,n=null,s=null){if(lt(i)||lt(r))return e;if(o_(i,r,n))return e.map(o=>cqt(o,i,r));if(lt(n)){const o=joe.cacheKey(i,r);HSe[o]!==void 0?n=HSe[o]:(n=WSe(i,r,void 0),lt(n)&&(n=new joe),HSe[o]=n)}if(lt(qR)||lt(t))throw new qSe;return ve(s)?qR._project(t,e,i,r,n,s):qR._project(t,e,i,r,n)}function DA(t,e){const i=jYe([t],e);return ve(i.pending)?{pending:i.pending,geometry:null}:ve(i.geometries)?{pending:null,geometry:i.geometries[0]}:{pending:null,geometry:null}}function jYe(t,e){if(!hw()){for(const i of t)if(ve(i)&&!Da(i.spatialReference,e)&&bh(i.spatialReference)&&bh(e)&&!o_(i.spatialReference,e))return Na(VYe),{pending:A2(),geometries:null}}return{pending:null,geometries:t.map(i=>lt(i)?null:Da(i.spatialReference,e)?i:bh(i.spatialReference)&&bh(e)?uqt(i,e):null)}}function WSe(t,e,i=null){if(lt(t)||lt(e))return null;if(lt(qR)||lt(Gq))throw new qSe;const r=qR._getTransformation(Gq,t,e,i,i?.spatialReference);return r!==null?joe.fromGE(r):null}class qSe extends st{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}var Wi;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.SPHERICAL_ECEF=1]="SPHERICAL_ECEF",t[t.WGS84=2]="WGS84",t[t.WEB_MERCATOR=3]="WEB_MERCATOR",t[t.WGS84_ECEF=4]="WGS84_ECEF",t[t.CGCS2000=5]="CGCS2000",t[t.WGS84_COMPARABLE_LON_LAT=6]="WGS84_COMPARABLE_LON_LAT",t[t.SPHERICAL_MARS_PCPF=7]="SPHERICAL_MARS_PCPF",t[t.GCSMARS2000=8]="GCSMARS2000",t[t.SPHERICAL_MOON_PCPF=9]="SPHERICAL_MOON_PCPF",t[t.GCSMOON2000=10]="GCSMOON2000",t[t.LON_LAT=11]="LON_LAT",t[t.PLATE_CARREE=12]="PLATE_CARREE"})(Wi||(Wi={}));function uqt(t,e){try{const i=cp(t,e);if(i==null)return null;"xmin"in t&&"xmin"in i&&(i.zmin=t.zmin,i.zmax=t.zmax);const r=F9(i.type,t.spatialReference,e);return ve(r)&&r(i),i}catch(i){if(!(i instanceof qSe))throw i;return null}}function o_(t,e,i){return!i&&(!!Da(t,e)||bh(t)&&bh(e)&&!!eXe(t,e,iXe))}async function YR(t,e,i,r){if(hw())return Fre(r);if(Array.isArray(t)){for(const{source:n,dest:s,geographicTransformation:o}of t)if(!o_(n,s,o))return A2(r)}else if(!o_(t,e,i))return A2(r);return Fre(r)}function cqt(t,e,i){return t?"x"in t?hqt(t,e,new er,i,0):"xmin"in t?fqt(t,e,new Ar,i,0):"rings"in t?UYe(t,e,new To,i,0):"paths"in t?pqt(t,e,new Oa,i,0):"points"in t?dqt(t,e,new _d,i,0):null:null}function hqt(t,e,i,r,n){zf[0]=t.x,zf[1]=t.y;const s=t.z;return zf[2]=s!==void 0?s:n,FA(zf,e,0,zf,r,0,1)?(i.x=zf[0],i.y=zf[1],i.spatialReference=r,s===void 0?(i.z=void 0,i.hasZ=!1):(i.z=zf[2],i.hasZ=!0),t.m===void 0?(i.m=void 0,i.hasM=!1):(i.m=t.m,i.hasM=!0),i):null}function dqt(t,e,i,r,n){const{points:s,hasZ:o,hasM:a}=t,l=[],c=s.length,h=[];for(const p of s)h.push(p[0],p[1],o?p[2]:n);if(!FA(h,e,0,h,r,0,c))return null;for(let p=0;p.3?(I=l/y*(1+x*(n.a1+Y+v*X)/y),he=Math.asin(I),F=I*I,P=Math.sqrt(1-F)):(P=h/y*(1-v*(n.a5-Y-x*X)/y),he=Math.acos(P),F=1-P*P,I=Math.sqrt(F)),k=1-Mu.eccentricitySquared*F,j=Mu.radius/Math.sqrt(k),V=n.a6*j,Y=h-j*P,X=l-V*I,ie=P*Y+I*X,Z=P*X-I*Y,ce=Z/(V/k+ie),he+=ce,xe=ie+Z*ce/2,a<0&&(he=-he),i[r++]=oB*_e,i[r++]=oB*he,i[r]=xe}function Aqt(t,e,i,r){L5(t,e,i,r),M5(i,r,i,r)}function Pqt(t,e,i,r){L5(t,e,i,r),Hq(i,r,i,r)}const sB={[Wi.WGS84]:{[Wi.CGCS2000]:null,[Wi.GCSMARS2000]:null,[Wi.GCSMOON2000]:null,[Wi.LON_LAT]:Yc,[Wi.WGS84_COMPARABLE_LON_LAT]:Yc,[Wi.SPHERICAL_ECEF]:M5,[Wi.SPHERICAL_MARS_PCPF]:null,[Wi.SPHERICAL_MOON_PCPF]:null,[Wi.UNKNOWN]:null,[Wi.WEB_MERCATOR]:Hq,[Wi.PLATE_CARREE]:O5,[Wi.WGS84]:Yc,[Wi.WGS84_ECEF]:F5},[Wi.CGCS2000]:{[Wi.CGCS2000]:Yc,[Wi.GCSMARS2000]:null,[Wi.GCSMOON2000]:null,[Wi.LON_LAT]:Yc,[Wi.WGS84_COMPARABLE_LON_LAT]:Yc,[Wi.SPHERICAL_ECEF]:M5,[Wi.SPHERICAL_MARS_PCPF]:null,[Wi.SPHERICAL_MOON_PCPF]:null,[Wi.UNKNOWN]:null,[Wi.WEB_MERCATOR]:null,[Wi.PLATE_CARREE]:O5,[Wi.WGS84]:null,[Wi.WGS84_ECEF]:F5},[Wi.GCSMARS2000]:{[Wi.CGCS2000]:null,[Wi.GCSMARS2000]:Yc,[Wi.GCSMOON2000]:null,[Wi.LON_LAT]:Yc,[Wi.WGS84_COMPARABLE_LON_LAT]:null,[Wi.SPHERICAL_ECEF]:null,[Wi.SPHERICAL_MARS_PCPF]:JYe,[Wi.SPHERICAL_MOON_PCPF]:null,[Wi.UNKNOWN]:null,[Wi.WEB_MERCATOR]:null,[Wi.PLATE_CARREE]:null,[Wi.WGS84]:null,[Wi.WGS84_ECEF]:null},[Wi.GCSMOON2000]:{[Wi.CGCS2000]:null,[Wi.GCSMARS2000]:null,[Wi.GCSMOON2000]:Yc,[Wi.LON_LAT]:Yc,[Wi.WGS84_COMPARABLE_LON_LAT]:null,[Wi.SPHERICAL_ECEF]:null,[Wi.SPHERICAL_MARS_PCPF]:null,[Wi.SPHERICAL_MOON_PCPF]:KYe,[Wi.UNKNOWN]:null,[Wi.WEB_MERCATOR]:null,[Wi.PLATE_CARREE]:null,[Wi.WGS84]:null,[Wi.WGS84_ECEF]:null},[Wi.WEB_MERCATOR]:{[Wi.CGCS2000]:null,[Wi.GCSMARS2000]:null,[Wi.GCSMOON2000]:null,[Wi.LON_LAT]:nB,[Wi.WGS84_COMPARABLE_LON_LAT]:nB,[Wi.SPHERICAL_ECEF]:gqt,[Wi.SPHERICAL_MARS_PCPF]:null,[Wi.SPHERICAL_MOON_PCPF]:null,[Wi.UNKNOWN]:null,[Wi.WEB_MERCATOR]:Yc,[Wi.PLATE_CARREE]:_qt,[Wi.WGS84]:nB,[Wi.WGS84_ECEF]:yqt},[Wi.WGS84_ECEF]:{[Wi.CGCS2000]:L5,[Wi.GCSMARS2000]:null,[Wi.GCSMOON2000]:null,[Wi.LON_LAT]:L5,[Wi.WGS84_COMPARABLE_LON_LAT]:L5,[Wi.SPHERICAL_ECEF]:Aqt,[Wi.SPHERICAL_MARS_PCPF]:null,[Wi.SPHERICAL_MOON_PCPF]:null,[Wi.UNKNOWN]:null,[Wi.WEB_MERCATOR]:Pqt,[Wi.PLATE_CARREE]:bqt,[Wi.WGS84]:L5,[Wi.WGS84_ECEF]:Yc},[Wi.SPHERICAL_ECEF]:{[Wi.CGCS2000]:D5,[Wi.GCSMARS2000]:null,[Wi.GCSMOON2000]:null,[Wi.LON_LAT]:D5,[Wi.WGS84_COMPARABLE_LON_LAT]:D5,[Wi.SPHERICAL_ECEF]:Yc,[Wi.SPHERICAL_MARS_PCPF]:null,[Wi.SPHERICAL_MOON_PCPF]:null,[Wi.UNKNOWN]:null,[Wi.WEB_MERCATOR]:Tqt,[Wi.PLATE_CARREE]:wqt,[Wi.WGS84]:D5,[Wi.WGS84_ECEF]:Eqt},[Wi.SPHERICAL_MARS_PCPF]:{[Wi.CGCS2000]:null,[Wi.GCSMARS2000]:QYe,[Wi.GCSMOON2000]:null,[Wi.LON_LAT]:QYe,[Wi.WGS84_COMPARABLE_LON_LAT]:null,[Wi.SPHERICAL_ECEF]:null,[Wi.SPHERICAL_MARS_PCPF]:Yc,[Wi.SPHERICAL_MOON_PCPF]:null,[Wi.UNKNOWN]:null,[Wi.WEB_MERCATOR]:null,[Wi.PLATE_CARREE]:null,[Wi.WGS84]:null,[Wi.WGS84_ECEF]:null},[Wi.SPHERICAL_MOON_PCPF]:{[Wi.CGCS2000]:null,[Wi.GCSMARS2000]:null,[Wi.GCSMOON2000]:ZYe,[Wi.LON_LAT]:ZYe,[Wi.WGS84_COMPARABLE_LON_LAT]:null,[Wi.SPHERICAL_ECEF]:null,[Wi.SPHERICAL_MARS_PCPF]:null,[Wi.SPHERICAL_MOON_PCPF]:Yc,[Wi.UNKNOWN]:null,[Wi.WEB_MERCATOR]:null,[Wi.PLATE_CARREE]:null,[Wi.WGS84]:null,[Wi.WGS84_ECEF]:null},[Wi.UNKNOWN]:{[Wi.CGCS2000]:null,[Wi.GCSMARS2000]:null,[Wi.GCSMOON2000]:null,[Wi.LON_LAT]:null,[Wi.WGS84_COMPARABLE_LON_LAT]:null,[Wi.SPHERICAL_ECEF]:null,[Wi.SPHERICAL_MARS_PCPF]:null,[Wi.SPHERICAL_MOON_PCPF]:null,[Wi.UNKNOWN]:Yc,[Wi.WEB_MERCATOR]:null,[Wi.PLATE_CARREE]:null,[Wi.WGS84]:null,[Wi.WGS84_ECEF]:null},[Wi.LON_LAT]:{[Wi.CGCS2000]:Yc,[Wi.GCSMARS2000]:Yc,[Wi.GCSMOON2000]:Yc,[Wi.LON_LAT]:Yc,[Wi.WGS84_COMPARABLE_LON_LAT]:Yc,[Wi.SPHERICAL_ECEF]:M5,[Wi.SPHERICAL_MARS_PCPF]:JYe,[Wi.SPHERICAL_MOON_PCPF]:KYe,[Wi.UNKNOWN]:null,[Wi.WEB_MERCATOR]:Hq,[Wi.PLATE_CARREE]:O5,[Wi.WGS84]:Yc,[Wi.WGS84_ECEF]:F5},[Wi.WGS84_COMPARABLE_LON_LAT]:{[Wi.CGCS2000]:null,[Wi.GCSMARS2000]:null,[Wi.GCSMOON2000]:null,[Wi.LON_LAT]:Yc,[Wi.WGS84_COMPARABLE_LON_LAT]:Yc,[Wi.SPHERICAL_ECEF]:M5,[Wi.SPHERICAL_MARS_PCPF]:null,[Wi.SPHERICAL_MOON_PCPF]:null,[Wi.UNKNOWN]:null,[Wi.WEB_MERCATOR]:null,[Wi.PLATE_CARREE]:O5,[Wi.WGS84]:Yc,[Wi.WGS84_ECEF]:F5},[Wi.PLATE_CARREE]:{[Wi.CGCS2000]:R5,[Wi.GCSMARS2000]:null,[Wi.GCSMOON2000]:null,[Wi.LON_LAT]:R5,[Wi.WGS84_COMPARABLE_LON_LAT]:R5,[Wi.SPHERICAL_ECEF]:xqt,[Wi.SPHERICAL_MARS_PCPF]:null,[Wi.SPHERICAL_MOON_PCPF]:null,[Wi.UNKNOWN]:null,[Wi.WEB_MERCATOR]:Sqt,[Wi.PLATE_CARREE]:Yc,[Wi.WGS84]:R5,[Wi.WGS84_ECEF]:Cqt}};function eXe(t,e,i=JSe()){return lt(t)||lt(e)?null:Oqt(t,e,i).projector}function Oqt(t,e,i){if(lt(t)||lt(e)||i.source.spatialReference===t&&i.dest.spatialReference===e)return i;const r=zq(t,i.source),n=zq(e,i.dest);return r===Wi.UNKNOWN&&n===Wi.UNKNOWN?Da(t,e)?i.projector=Yc:i.projector=null:i.projector=sB[r][n],i}function JSe(){return{source:{spatialReference:null,spatialReferenceId:Wi.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:Wi.UNKNOWN,metersPerUnit:1},projector:Yc}}const tXe={spatialReference:null,spatialReferenceId:Wi.UNKNOWN},Rqt={spatialReference:null,spatialReferenceId:Wi.UNKNOWN},iXe=JSe();JSe();const QC=ew(1),oB=_ne(1),Goe=hn(),KR=hn(),JR=hn(),zf=hn();async function Mqt(t){const e=t.spatialReference;if(e.isWGS84)return t.clone();if(e.isWebMercator)return wL(t);const i=hr.WGS84;return await YR(e,i),cp(t,i)}function ZSe(t,e){if(!aB(t,e)){const i=t.typeKeywords;i?i.push(e):t.typeKeywords=[e]}}function aB(t,e){return!!t.typeKeywords?.includes(e)}function rXe(t,e){const i=t.typeKeywords;if(i){const r=i.indexOf(e);r>-1&&i.splice(r,1)}}async function Dqt(t){const e=t.clone().normalize();let i;if(e.length>1)for(const r of e)i?r.width>i.width&&(i=r):i=r;else i=e[0];return Mqt(i)}const lB={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table"};function nXe(t){const{portal:e,isOrgItem:i,itemControl:r}=t,n=e.user?.privileges;let s=!n||n.includes("features:user:edit"),o=!!i&&!!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 Sh=t=>{let e=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=da(this.portalItem)}set portalItem(i){i!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",i))}readPortalItem(i,r,n){if(r.itemId)return new Q0({id:r.itemId,portal:n&&n.portal})}writePortalItem(i,r){i&&i.id&&(r.itemId=i.id)}async loadFromPortal(i,r){if(this.portalItem&&this.portalItem.id)try{const n=await Promise.resolve().then(()=>dAi);return yn(r),await n.load({instance:this,supportedTypes:i.supportedTypes,validateItem:i.validateItem,supportsData:i.supportsData,layerModuleTypeMap:i.layerModuleTypeMap},r)}catch(n){throw ys(n)||Oi.getLogger(this.declaredClass).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id}) + ${n}`),n}}async finishLoadEditablePortalLayer(i){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(i).catch(r=>(Ya(r),!0)))}async _setUserPrivileges(i,r){if(!pa.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(r);if(this.url)try{const{features:{edit:n,fullEdit:s},content:{updateItem:o}}=await this._fetchUserPrivileges(i,r);this._set("userHasEditingPrivileges",n),this._set("userHasFullEditingPrivileges",s),this._set("userHasUpdateItemPrivileges",o)}catch(n){Ya(n)}}async _fetchUserPrivileges(i,r){let n=this.portalItem;if(!i||!n||!n.loaded||n.sourceUrl)return this._fetchFallbackUserPrivileges(r);const s=i===n.id;if(s&&n.portal.user)return nXe(n);let o,a;if(s)o=n.portal.url;else try{o=await VGe(this.url,r)}catch(p){Ya(p)}if(!o||!i$t(o,n.portal.url))return this._fetchFallbackUserPrivileges(r);try{const p=ve(r)?r.signal:null;a=await Ho?.getCredential(`${o}/sharing`,{prompt:!1,signal:p})}catch(p){Ya(p)}const l=!0,c=!1,h=!1;if(!a)return{features:{edit:l,fullEdit:c},content:{updateItem:h}};try{if(s?await n.reload():(n=new Q0({id:i,portal:{url:o}}),await n.load(r)),n.portal.user)return nXe(n)}catch(p){Ya(p)}return{features:{edit:l,fullEdit:c},content:{updateItem:h}}}async _fetchFallbackUserPrivileges(i){let r=!0;try{r=await this._fetchUserHasEditingPrivileges(i)}catch(n){Ya(n)}return{features:{edit:r,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(i){const r=this.url?Ho?.findCredential(this.url):null;if(!r)return!0;const n=Uoe.credential===r?Uoe.user:await this._fetchEditingUser(i);return Uoe.credential=r,Uoe.user=n,lt(n)||n.privileges==null||n.privileges.includes("features:user:edit")}async _fetchEditingUser(i){const r=this.portalItem?.portal?.user;if(r)return r;const n=Ho.findServerInfo(this.url??"");if(!n?.owningSystemUrl)return null;const s=`${n.owningSystemUrl}/sharing/rest`,o=Cc.getDefault();if(o&&o.loaded&&Uy(o.restUrl)===Uy(s))return o.user;const a=`${s}/community/self`,l=ve(i)?i.signal:null,c=await SC(ur(a,{authMode:"no-prompt",query:{f:"json"},signal:l}));return c.ok?L1e.fromJSON(c.value.data):null}read(i,r){r&&(r.layer=this),super.read(i,r)}write(i,r){const n=r&&r.portal,s=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||Cc.getDefault());return n&&s&&!n1e(s.restUrl,n.restUrl)?(r.messages&&r.messages.push(new st("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(i,{...r,layer:this})}};return E([N({type:Q0})],e.prototype,"portalItem",null),E([Vi("web-document","portalItem",["itemId"])],e.prototype,"readPortalItem",null),E([Cr("web-document","portalItem",{itemId:{type:String}})],e.prototype,"writePortalItem",null),E([N({clonable:!1})],e.prototype,"resourceReferences",void 0),E([N({type:Boolean,readOnly:!0})],e.prototype,"userHasEditingPrivileges",void 0),E([N({type:Boolean,readOnly:!0})],e.prototype,"userHasFullEditingPrivileges",void 0),E([N({type:Boolean,readOnly:!0})],e.prototype,"userHasUpdateItemPrivileges",void 0),e=E([dt("esri.layers.mixins.PortalLayer")],e),e},Uoe={credential:null,user:null};let Wq=class extends Tn{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};E([N()],Wq.prototype,"updating",void 0),E([N()],Wq.prototype,"status",void 0),Wq=E([dt("esri.layers.support.PublishingInfo")],Wq);const Fqt=Wq,sXe="esri.layers.mixins.PublishableLayer",Lqt=Symbol(sXe),Nqt=t=>{var e;let i=class extends t{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 Fqt;return this._checkPublishingStatus(n),n}_checkPublishingStatus(r){let o=0;const a=async c=>{let h;r.updating=!0;try{h=await this.fetchPublishingStatus()}catch{h="unavailable"}h!=="published"&&h!=="unavailable"||(r.status==="publishing"&&this.refresh(),l.remove()),r.status=h,r.updating=!1,l.removed||(o=setTimeout(a,c,c+125))},l={removed:!1,remove(){this.removed=!0,clearTimeout(o)}};this.when().catch(()=>l.remove()),a(250),this.own(l)}};return e=Lqt,E([N({readOnly:!0,clonable:!1})],i.prototype,"publishingInfo",null),i=E([dt(sXe)],i),i},qq=new Sr,Yq=new WeakMap;function kqt(t){oXe(t)&&qq.push(t)}function $qt(t){oXe(t)&&qq.includes(t)&&qq.remove(t)}function oXe(t){return t!=null&&typeof t=="object"&&"refreshInterval"in t&&"refresh"in t}function aXe(t,e){return Number.isFinite(t)&&Number.isFinite(e)?e<=0?t:aXe(e,t%e):0}let QSe=0,zoe=0;function Bqt(){const t=Date.now();for(const e of qq)e.refreshInterval&&t-(Yq.get(e)??0)+5>=6e4*e.refreshInterval&&(Yq.set(e,t),e.refresh(t))}KVe(()=>{const t=Date.now();let e=0;for(const i of qq)e=aXe(Math.round(6e4*i.refreshInterval),e),i.refreshInterval?Yq.get(i)||Yq.set(i,t):Yq.delete(i);if(e!==zoe){if(zoe=e,clearInterval(QSe),zoe===0)return void(QSe=0);QSe=setInterval(Bqt,zoe)}});const s0=t=>{let e=class extends t{constructor(...i){super(...i),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=q0(()=>this.hasDataChanged()),this.when().then(()=>{kqt(this)},()=>{})}destroy(){$qt(this)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(i=Date.now()){pf(this._debounceHasDataChanged()).then(r=>{r&&this._set("refreshTimestamp",i),this.emit("refresh",{dataChanged:r})},r=>{Oi.getLogger(this.declaredClass).error(r),this.emit("refresh",{dataChanged:!1,error:r})})}async hasDataChanged(){return!0}};return E([N({type:Number,cast:i=>i>=.1?i:i<=0?0:.1,json:{write:!0}})],e.prototype,"refreshInterval",void 0),E([N({readOnly:!0})],e.prototype,"refreshTimestamp",void 0),E([N()],e.prototype,"refreshParameters",null),e=E([dt("esri.layers.mixins.RefreshableLayer")],e),e},Ch=t=>{let e=class extends t{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const i={minScale:this.minScale,maxScale:this.maxScale},r=this.parent;r&&"effectiveScaleRange"in r&&Vqt(i,r.effectiveScaleRange);const n=this._get("effectiveScaleRange");return n&&n.minScale===i.minScale&&n.maxScale===i.maxScale?n:i}};return E([N({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"minScale",void 0),E([N({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"maxScale",void 0),E([N({readOnly:!0})],e.prototype,"effectiveScaleRange",null),e=E([dt("esri.layers.mixins.ScaleRangeLayer")],e),e};function Vqt(t,e){return t.minScale=t.minScale>0?e.minScale>0?Math.min(t.minScale,e.minScale):t.minScale:e.minScale,t.maxScale=t.maxScale>0?e.maxScale>0?Math.max(t.maxScale,e.maxScale):t.maxScale:e.maxScale,t}const lXe=ta()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0});let Xq=class extends _a(Ui){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return U7t(this.value,this.unit,"milliseconds")}};E([rn(lXe,{nonNullable:!0})],Xq.prototype,"unit",void 0),E([N({type:Number,json:{write:!0},nonNullable:!0})],Xq.prototype,"value",void 0),Xq=E([dt("esri.TimeInterval")],Xq);const Hoe=Xq;function uXe(t,e){return Hoe.fromJSON({value:t,unit:e})}let o0=class extends _a(Ui){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeReference=null,this.trackIdField=null,this.useTime=!0}readFullTimeExtent(e,i){if(!i.timeExtent||!Array.isArray(i.timeExtent)||i.timeExtent.length!==2)return null;const r=new Date(i.timeExtent[0]),n=new Date(i.timeExtent[1]);return new Xg({start:r,end:n})}writeFullTimeExtent(e,i){e&&ve(e.start)&&ve(e.end)?i.timeExtent=[e.start.getTime(),e.end.getTime()]:i.timeExtent=null}readInterval(e,i){return i.timeInterval&&i.timeIntervalUnits?uXe(i.timeInterval,i.timeIntervalUnits):i.defaultTimeInterval&&i.defaultTimeIntervalUnits?uXe(i.defaultTimeInterval,i.defaultTimeIntervalUnits):null}writeInterval(e,i){i.timeInterval=e?.toJSON().value??null,i.timeIntervalUnits=e?.toJSON().unit??null}};E([N({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],o0.prototype,"cumulative",void 0),E([N({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],o0.prototype,"endField",void 0),E([N({type:Xg,json:{write:{enabled:!0,allowNull:!0}}})],o0.prototype,"fullTimeExtent",void 0),E([Vi("fullTimeExtent",["timeExtent"])],o0.prototype,"readFullTimeExtent",null),E([Cr("fullTimeExtent")],o0.prototype,"writeFullTimeExtent",null),E([N({type:Boolean,json:{write:!0}})],o0.prototype,"hasLiveData",void 0),E([N({type:Hoe,json:{write:{enabled:!0,allowNull:!0}}})],o0.prototype,"interval",void 0),E([Vi("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],o0.prototype,"readInterval",null),E([Cr("interval")],o0.prototype,"writeInterval",null),E([N({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],o0.prototype,"startField",void 0),E([N({type:VR,json:{write:{enabled:!0,allowNull:!0}}})],o0.prototype,"timeReference",void 0),E([N({type:String,json:{write:{enabled:!0,allowNull:!0}}})],o0.prototype,"trackIdField",void 0),E([N({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],o0.prototype,"useTime",void 0),o0=E([dt("esri.layers.support.TimeInfo")],o0);const eCe=o0,eT=t=>{let e=class extends t{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(i,r){const n=r.timeInfo.exportOptions;if(!n)return null;const s=n.timeOffset,o=lXe.fromJSON(n.timeOffsetUnits);return s&&o?new Hoe({value:s,unit:o}):null}set timeInfo(i){RL(i,this.fieldsIndex),this._set("timeInfo",i)}};return E([N({type:Xg,json:{write:!1}})],e.prototype,"timeExtent",void 0),E([N({type:Hoe})],e.prototype,"timeOffset",void 0),E([Vi("service","timeOffset",["timeInfo.exportOptions"])],e.prototype,"readOffset",null),E([N({value:null,type:eCe,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],e.prototype,"timeInfo",null),E([N({type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation"},origins:{"web-scene":{read:!1,write:!1}}}})],e.prototype,"useViewTime",void 0),e=E([dt("esri.layers.mixins.TemporalLayer")],e),e},cXe=new Ks({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 ZR=class extends _a(Ui){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};E([N({json:{write:!0}})],ZR.prototype,"name",void 0),E([N({json:{write:!0}})],ZR.prototype,"description",void 0),E([N({json:{read:cXe.read,write:cXe.write}})],ZR.prototype,"drawingTool",void 0),E([N({json:{write:!0}})],ZR.prototype,"prototype",void 0),E([N({json:{write:!0}})],ZR.prototype,"thumbnail",void 0),ZR=E([dt("esri.layers.support.FeatureTemplate")],ZR);const uB=ZR;let LA=class extends _a(Ui){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const i={};for(const r of Object.keys(e))i[r]=Yse(e[r]);return i}writeDomains(e,i){const r={};for(const n of Object.keys(e))e[n]&&(r[n]=e[n]?.toJSON());i.domains=r}};E([N({json:{write:!0}})],LA.prototype,"id",void 0),E([N({json:{write:!0}})],LA.prototype,"name",void 0),E([N({json:{write:!0}})],LA.prototype,"domains",void 0),E([Vi("domains")],LA.prototype,"readDomains",null),E([Cr("domains")],LA.prototype,"writeDomains",null),E([N({type:[uB],json:{write:!0}})],LA.prototype,"templates",void 0),LA=E([dt("esri.layers.support.FeatureType")],LA);const cB=LA;function jqt(t){return t.type==="date"||t.type==="esriFieldTypeDate"}function hXe(t){return t.type==="oid"||t.type==="esriFieldTypeOID"}function dXe(t){return t.type==="global-id"||t.type==="esriFieldTypeGlobalID"}let Lm=class{constructor(e=[]){if(this.fields=[],this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this.dateFields=[],this.numericFields=[],this._requiredFields=null,!e)return;this.fields=e;const i=[];for(const r of e){const n=r?.name,s=fXe(r?.name);if(n&&s){const o=pXe(n);this._fieldsMap.set(n,r),this._fieldsMap.set(o,r),this._normalizedFieldsMap.set(s,r),i.push(o),jqt(r)?(this.dateFields.push(r),this._dateFieldsSet.add(r)):t9(r)&&(this._numericFieldsSet.add(r),this.numericFields.push(r)),hXe(r)||dXe(r)||(r.editable=r.editable==null||!!r.editable,r.nullable=r.nullable==null||!!r.nullable)}}i.sort(),this.uid=i.join(",")}destroy(){this._fieldsMap.clear()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)hXe(e)||dXe(e)||e.nullable||One(e)!==void 0||this._requiredFields.push(e)}return this._requiredFields}has(e){return this.get(e)!=null}get(e){if(!e)return;let i=this._fieldsMap.get(e);return i||(i=this._fieldsMap.get(pXe(e))??this._normalizedFieldsMap.get(fXe(e)),i&&this._fieldsMap.set(e,i),i)}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){const i=this.get(e);if(i)return i.name??void 0}};function pXe(t){return t.trim().toLowerCase()}function fXe(t){return e9(t)?.toLowerCase()??""}function tT(){return{fields:{type:[Jo],value:null},fieldsIndex:{readOnly:!0,get(){return new Lm(this.fields||[])}},outFields:{type:[String],json:{read:!1},set:function(t){this._userOutFields=t,this.notifyChange("outFields")},get:function(){const t=this._userOutFields;if(!t||!t.length)return null;if(t.includes("*"))return["*"];if(!this.fields)return t;for(const e of t)this.fieldsIndex?.has(e)||Oi.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${e} found in outFields`,{layer:this,outFields:t});return rW(this.fieldsIndex,t)}}}}const tCe=Oi.getLogger("esri.layers.support.labelingInfo"),Gqt=/\[([^\[\]]+)\]/gi;function NA(t,e,i){return t?t.map(r=>{const n=new E2;if(n.read(r,i),n.labelExpression){const s=e.fields||e.layerDefinition&&e.layerDefinition.fields||this.fields;n.labelExpression=n.labelExpression.replace(Gqt,(o,a)=>`[${Uqt(a,s)}]`)}return n}):null}function Uqt(t,e){if(!e)return t;const i=t.toLowerCase();for(let r=0;rHqt(r,e))?[]:i}function Hqt(t,e){const i=t.labelPlacement,r=zqt[e];if(!t.symbol)return tCe.warn("No ILabelClass symbol specified."),!0;if(!r)return tCe.error(new st("labeling:unsupported-geometry-type",`Unable to create labels for layer, geometry type '${e}' is not supported`)),!0;if(!r.includes(i)){const n=r[0];i&&tCe.warn(`Found invalid label placement type ${i} for ${e}. Defaulting to ${n}`),t.labelPlacement=n}return!1}const P2=[];function Woe(t,e){if(L9(t.url??""))return!0;const{wkid:i}=e;for(const r of P2){if((t.version??0)>=r[0])return!0;if(typeof r[1]=="function"&&(r[1]=r[1]()),r[1].has(i))return!1}return!0}P2.push([10.91,()=>{const t=new Set([9709,9716,9741,9761,9766]);for(let e=9712;e<=9713;e++)t.add(e);for(let e=9748;e<=9749;e++)t.add(e);for(let e=20904;e<=20932;e++)t.add(e);for(let e=21004;e<=21032;e++)t.add(e);for(let e=21207;e<=21264;e++)t.add(e);for(let e=21307;e<=21364;e++)t.add(e);for(let e=102759;e<=102760;e++)t.add(e);for(let e=102901;e<=102955;e++)t.add(e);return t}]),P2.push([10.9,()=>{const t=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++)t.add(e);for(let e=9404;e<=9407;e++)t.add(e);for(let e=9476;e<=9482;e++)t.add(e);for(let e=9487;e<=9494;e++)t.add(e);for(let e=9697;e<=9699;e++)t.add(e);return t}]),P2.push([10.81,()=>{const t=new Set([9265,9333,103598,103699]);for(let e=9248;e<=9254;e++)t.add(e);for(let e=9271;e<=9273;e++)t.add(e);for(let e=9284;e<=9285;e++)t.add(e);for(let e=21453;e<=21463;e++)t.add(e);return t}]),P2.push([10.8,()=>{const t=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++)t.add(e);for(let e=8455;e<=8456;e++)t.add(e);for(let e=8518;e<=8529;e++)t.add(e);for(let e=8533;e<=8536;e++)t.add(e);for(let e=8538;e<=8540;e++)t.add(e);for(let e=8677;e<=8679;e++)t.add(e);for(let e=8902;e<=8903;e++)t.add(e);for(let e=8907;e<=8910;e++)t.add(e);for(let e=8949;e<=8951;e++)t.add(e);for(let e=8972;e<=8987;e++)t.add(e);for(let e=9039;e<=9040;e++)t.add(e);for(let e=9068;e<=9069;e++)t.add(e);for(let e=9140;e<=9141;e++)t.add(e);for(let e=9148;e<=9150;e++)t.add(e);for(let e=9153;e<=9159;e++)t.add(e);for(let e=9205;e<=9218;e++)t.add(e);for(let e=9221;e<=9222;e++)t.add(e);for(let e=54098;e<=54101;e++)t.add(e);return t}]),P2.push([10.71,()=>{const t=new Set([6316]);for(let e=8351;e<=8353;e++)t.add(e);for(let e=9294;e<=9297;e++)t.add(e);for(let e=22619;e<=22621;e++)t.add(e);for(let e=103586;e<=103594;e++)t.add(e);return t}]),P2.push([10.7,()=>{const t=new Set([8387,8391,8427,8545,8682,8685,8818,31370,104022,104024,104975]);for(let e=8065;e<=8068;e++)t.add(e);for(let e=8082;e<=8083;e++)t.add(e);for(let e=8379;e<=8385;e++)t.add(e);for(let e=8836;e<=8840;e++)t.add(e);for(let e=8857;e<=8860;e++)t.add(e);for(let e=53035;e<=53037;e++)t.add(e);for(let e=54090;e<=54091;e++)t.add(e);for(let e=102498;e<=102499;e++)t.add(e);return t}]),P2.push([10.61,()=>new Set([102497])]),P2.push([10.6,()=>{const t=new Set([7803,7805,7887,8086,8232,8237,8240,8246,8249,8252,8255,9019,9391]);for(let e=7755;e<=7787;e++)t.add(e);for(let e=7791;e<=7795;e++)t.add(e);for(let e=7799;e<=7801;e++)t.add(e);for(let e=7825;e<=7831;e++)t.add(e);for(let e=7877;e<=7878;e++)t.add(e);for(let e=7882;e<=7883;e++)t.add(e);for(let e=7991;e<=7992;e++)t.add(e);for(let e=8042;e<=8043;e++)t.add(e);for(let e=8058;e<=8059;e++)t.add(e);for(let e=8311;e<=8348;e++)t.add(e);for(let e=9060;e<=9067;e++)t.add(e);for(let e=102562;e<=102568;e++)t.add(e);for(let e=102799;e<=102900;e++)t.add(e);return t}]),P2.push([10.51,()=>{const t=new Set([7683,7881,7886,7899,8888,9e3]);for(let e=8013;e<=8032;e++)t.add(e);for(let e=9053;e<=9057;e++)t.add(e);for(let e=104017;e<=104018;e++)t.add(e);for(let e=104971;e<=104974;e++)t.add(e);return t}]),P2.push([10.5,()=>{const t=new Set([6962,7035,7037,7039,7041,7084,7086,7133,7798,102399]);for(let e=4087;e<=4088;e++)t.add(e);for(let e=5896;e<=5899;e++)t.add(e);for(let e=7005;e<=7007;e++)t.add(e);for(let e=7057;e<=7070;e++)t.add(e);for(let e=7073;e<=7082;e++)t.add(e);for(let e=7109;e<=7128;e++)t.add(e);for(let e=7844;e<=7859;e++)t.add(e);return t}]);async function Kq(t,e,i){const r=t&&t.getAtOrigin&&t.getAtOrigin("renderer",e.origin);if(r&&r.type==="unique-value"&&r.styleOrigin){const n=await SC(r.populateFromStyle());if(yn(i),n.ok===!1){const s=n.error;e&&e.messages&&e.messages.push(new Am("renderer:style-reference",`Failed to create unique value renderer from style reference: ${s.message}`,{error:s,context:e})),t.clear("renderer",e?.origin)}}}var rCe;let hB=rCe=class extends Ui{constructor(t){super(t),this.groupByFields=void 0,this.topCount=void 0,this.orderByFields=void 0}clone(){return new rCe({groupByFields:this.groupByFields,topCount:this.topCount,orderByFields:this.orderByFields})}};E([N({type:[String],json:{write:!0}})],hB.prototype,"groupByFields",void 0),E([N({type:Number,json:{write:!0}})],hB.prototype,"topCount",void 0),E([N({type:[String],json:{write:!0}})],hB.prototype,"orderByFields",void 0),hB=rCe=E([dt("esri.rest.support.TopFilter")],hB);const Wqt=hB;var nCe;const mXe=new Ks({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),gXe=new Ks({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let qh=nCe=class extends Ui{constructor(t){super(t),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(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10}clone(){return new nCe(gi({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}))}};E([N({type:Boolean,json:{write:!0}})],qh.prototype,"cacheHint",void 0),E([N({type:Number,json:{write:{overridePolicy:t=>({enabled:t>0})}}})],qh.prototype,"distance",void 0),E([N({types:R1,json:{read:Sl,write:!0}})],qh.prototype,"geometry",void 0),E([N({type:Number,json:{write:!0}})],qh.prototype,"geometryPrecision",void 0),E([N({type:Number,json:{write:!0}})],qh.prototype,"maxAllowableOffset",void 0),E([N({type:Number,json:{read:{source:"resultRecordCount"}}})],qh.prototype,"num",void 0),E([N({json:{write:!0}})],qh.prototype,"objectIds",void 0),E([N({type:[String],json:{write:!0}})],qh.prototype,"orderByFields",void 0),E([N({type:[String],json:{write:!0}})],qh.prototype,"outFields",void 0),E([N({type:hr,json:{read:{source:"outSR"},write:{target:"outSR"}}})],qh.prototype,"outSpatialReference",void 0),E([N({type:String,json:{write:!0}})],qh.prototype,"resultType",void 0),E([N({json:{write:!0}})],qh.prototype,"returnGeometry",void 0),E([N({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],qh.prototype,"returnM",void 0),E([N({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],qh.prototype,"returnZ",void 0),E([N({type:Number,json:{read:{source:"resultOffset"}}})],qh.prototype,"start",void 0),E([Cr("start"),Cr("num")],qh.prototype,"writeStart",null),E([N({type:String,json:{read:{source:"spatialRel",reader:mXe.read},write:{target:"spatialRel",writer:mXe.write}}})],qh.prototype,"spatialRelationship",void 0),E([N({type:Xg,json:{write:!0}})],qh.prototype,"timeExtent",void 0),E([N({type:Wqt,json:{write:!0}})],qh.prototype,"topFilter",void 0),E([N({type:String,json:{read:gXe.read,write:{writer:gXe.write,overridePolicy(t){return{enabled:ve(t)&&ve(this.distance)&&this.distance>0}}}}})],qh.prototype,"units",void 0),E([N({type:String,json:{write:!0}})],qh.prototype,"where",void 0),qh=nCe=E([dt("esri.rest.support.TopFeaturesQuery")],qh),qh.from=fd(qh);const QR=qh,qqt=["oid","global-id"],Yqt=["oid","global-id","guid"];function G1({displayField:t,editFieldsInfo:e,fields:i,objectIdField:r,title:n},s){if(!i)return null;const o=eYt({editFieldsInfo:e,fields:i,objectIdField:r},s);if(!o.length)return null;const a=rYt({titleBase:n,fields:i,displayField:t}),l=iYt();return new wh({title:a,content:l,fieldInfos:o})}const Xqt=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/shape/i,/perimeter/i,/objectid/i,/_i$/i],Kqt=(t,{editFieldsInfo:e,objectIdField:i,visibleFieldNames:r})=>r?r.has(t.name):!yXe(t.name,e)&&(!i||t.name!==i)&&!qqt.includes(t.type)&&!Xqt.some(n=>n.test(t.name));function Jqt(t,e){const i=t;return e&&(t=t.filter(r=>!e.includes(r.type))),t===i&&(t=t.slice()),t.sort(Zqt),t}function Zqt(t,e){return t.type==="oid"?-1:e.type==="oid"?1:vXe(t)?-1:vXe(e)?1:(t.alias||t.name).toLocaleLowerCase().localeCompare((e.alias||e.name).toLocaleLowerCase())}function yXe(t,e){if(!t||!e)return!1;const{creationDateField:i,creatorField:r,editDateField:n,editorField:s}=e;return[i&&i.toLowerCase(),r&&r.toLowerCase(),n&&n.toLowerCase(),s&&s.toLowerCase()].includes(t.toLowerCase())}function Qqt(t,e){return t.editable&&!Yqt.includes(t.type)&&!yXe(t.name,e)}function eYt({editFieldsInfo:t,fields:e,objectIdField:i},r){return Jqt(e??[],r?.ignoreFieldTypes||nYt).map(n=>new hW({fieldName:n.name,isEditable:Qqt(n,t),label:n.alias,format:tYt(n),visible:Kqt(n,{editFieldsInfo:t,objectIdField:i,visibleFieldNames:r?.visibleFieldNames})}))}function tYt(t){switch(t.type){case"small-integer":case"integer":case"single":return new r9({digitSeparator:!0,places:0});case"double":return new r9({digitSeparator:!0,places:2});case"date":return new r9({dateFormat:"long-month-day-year"});default:return t.type==="string"&&GUe(t.name)?new r9({digitSeparator:!0,places:0}):null}}function iYt(){return[new n9,new nW]}function rYt(t){const e=ABt(t),{titleBase:i}=t;return e?`${i}: {${e.trim()}}`:i??""}function vXe(t){return(t.name&&t.name.toLowerCase())==="name"?!0:(t.alias&&t.alias.toLowerCase())==="name"}const nYt=["geometry","blob","raster","guid","xml"],sv="FeatureLayer",_Xe="esri.layers.FeatureLayer",sYt=Oi.getLogger(_Xe);function qoe(t,e){return new st("layer:unsupported",`Layer (${t.title}, ${t.id}) of type '${t.declaredClass}' ${e}`,{layer:t})}function bXe(t){return t&&t instanceof Sr}const sCe=tT();function oCe(t,e,i){const r=!!i?.writeLayerSchema;return{enabled:r,ignoreOrigin:r}}let js=class extends vYe(Bq(wq(Nqt(_2e(up(Foe(eT(Ch(s0(r_(qc(Sh(Yu(y2(m2(_a(du))))))))))))))))){constructor(...e){super(...e),this._handles=new df,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.screenSizePerspectiveEnabled=!0,this.spatialReference=hr.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}destroy(){this.source?.destroy(),this._handles=da(this._handles)}normalizeCtorArgs(e,i){return typeof e=="string"?{url:e,...i}:e}load(e){const i=ve(e)?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(i).then(n=>this.initLayerProperties(n))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection"]},e).catch(Ya).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){const n=await this._fetchFirstLayerId(i);n!=null&&(this.layerId=n)}if(!this.url&&!this._hasMemorySource())throw new st("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(i))}).then(()=>this._setUserPrivileges(this.serviceItemId,e)).then(()=>fYe(this,e));return this.addResolvingPromise(r),Promise.resolve(this)}readCapabilities(e,i){return i=i.layerDefinition||i,fSe(i,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,i){return this._readEditingEnabled(i,!1)}readEditingEnabledFromWebMap(e,i,r){return this._readEditingEnabled(i,!0,r)}writeEditingEnabled(e,i){this._writeEditingEnabled(e,i,!1)}writeEditingEnabledToWebMap(e,i,r,n){this._writeEditingEnabled(e,i,!0,n)}get effectiveEditingEnabled(){return mYe(this)}readIsTable(e,i){return(i=i?.layerDefinition??i).type==="Table"||!i.geometryType}writeIsTable(e,i,r,n){n?.writeLayerSchema&&Dp(r,e?"Table":"Feature Layer",i)}readGlobalIdField(e,i){return dYe(i.layerDefinition||i)}readObjectIdField(e,i){return pYe(i.layerDefinition||i)}get parsedUrl(){const e=fa(this.url);return e!=null&&(this.dynamicDataSource!=null?e.path=yd(e.path,"dynamicLayer"):this.layerId!=null&&(e.path=yd(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){M1(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,i,r){const n=(i=i.layerDefinition||i).drawingInfo?.renderer;if(n){const s=h5(n,i,r)??void 0;return s||sYt.error("Failed to create renderer",{rendererDefinition:i.drawingInfo.renderer,layer:this,context:r}),s}if(i.defaultSymbol)return i.types&&i.types.length?new WC({defaultSymbol:aCe(i.defaultSymbol,i,r),field:i.typeIdField,uniqueValueInfos:i.types.map(s=>({id:s.id,symbol:aCe(s.symbol,s,r)}))}):new i_({symbol:aCe(i.defaultSymbol,i,r)})}set source(e){const i=this._get("source");i!==e&&(bXe(i)&&this._resetMemorySource(i),bXe(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof Sr?new wA({layer:this,items:e}):e:null}readSource(e,i){const r=tc.fromJSON(i.featureSet);return new wA({layer:this,items:r?.features??[]})}readTemplates(e,i){const r=i.editFieldsInfo,n=r&&r.creatorField,s=r&&r.editorField;return e=e&&e.map(o=>uB.fromJSON(o)),this._fixTemplates(e,n),this._fixTemplates(e,s),e}readTitle(e,i){const r=i.layerDefinition?.name??i.name,n=i.title||i.layerDefinition&&i.layerDefinition.title;if(r){const s=this.portalItem&&this.portalItem.title;if(this.sublayerTitleMode==="item-title")return this.url?s2e(this.url,r):r;let o=r;if(!o&&this.url){const a=XC(this.url);ve(a)&&(o=a.title)}return o?(this.sublayerTitleMode==="item-title-and-service-name"&&s&&s!==o&&(o=s+" - "+o),noe(o)):void 0}if(this.sublayerTitleMode==="item-title"&&n)return n}readTitleFromWebMap(e,i){return i.title||i.layerDefinition&&i.layerDefinition.name}readTypeIdField(e,i){let r=(i=i.layerDefinition||i).typeIdField;if(r&&i.fields){r=r.toLowerCase();const n=i.fields.find(s=>s.name.toLowerCase()===r);n&&(r=n.name)}return r}readTypes(e,i){e=(i=i.layerDefinition||i).types;const r=i.editFieldsInfo,n=r&&r.creatorField,s=r&&r.editorField;return e&&e.map(o=>(o=cB.fromJSON(o),this._fixTemplates(o.templates,n),this._fixTemplates(o.templates,s),o))}readVisible(e,i){return i.layerDefinition&&i.layerDefinition.defaultVisibility!=null?!!i.layerDefinition.defaultVisibility:i.visibility!=null?!!i.visibility:void 0}async addAttachment(e,i){return eYe(this,e,i,sv)}async updateAttachment(e,i,r){return tYe(this,e,i,r,sv)}async applyEdits(e,i){return iYe(this,e,i)}on(e,i){return super.on(e,i)}createPopupTemplate(e){return G1(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:i}=await zg(Promise.resolve().then(()=>iwt),e);return new i({layer:this}).load({signal:e})}createQuery(){const e=hSe(this);e.dynamicDataSource=this.dynamicDataSource;const i=ve(this.subtypeCode)?`${this.subtypeField} = ${this.subtypeCode}`:null,r=OR(this.definitionExpression,i);return e.where=r||"1=1",e}async deleteAttachments(e,i){return rYe(this,e,i,sv)}async fetchRecomputedExtents(e){return nYe(this,e,sv)}getFeatureType(e){const{typeIdField:i,types:r}=this;if(!i||!e)return null;const n=e.attributes?e.attributes[i]: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,i){const r=i&&i.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,i){return sYe(this,e,i,sv)}async queryFeatures(e,i){const r=await this.load(),n=await r.source.queryFeatures(Ns.from(e)??r.createQuery(),i);if(n?.features)for(const s of n.features)s.layer=s.sourceLayer=r;return n}async queryObjectIds(e,i){return oYe(this,e,i,sv)}async queryFeatureCount(e,i){return aYe(this,e,i,sv)}async queryExtent(e,i){return lYe(this,e,i,sv)}async queryRelatedFeatures(e,i){return uYe(this,e,i,sv)}async queryRelatedFeaturesCount(e,i){return cYe(this,e,i,sv)}async queryTopFeatures(e,i){const{source:r,capabilities:n}=await this.load();if(!r.queryTopFeatures||!n?.query?.supportsTopFeaturesQuery)throw new st(sv,"Layer source does not support queryTopFeatures capability");const s=await r.queryTopFeatures(QR.from(e),i);if(s?.features)for(const o of s.features)o.layer=o.sourceLayer=this;return s}async queryTopObjectIds(e,i){const{source:r,capabilities:n}=await this.load();if(!r.queryTopObjectIds||!n?.query.supportsTopFeaturesQuery)throw new st(sv,"Layer source does not support queryTopObjectIds capability");return r.queryTopObjectIds(QR.from(e),i)}async queryTopFeaturesExtent(e,i){const{source:r,capabilities:n}=await this.load();if(!r.queryTopExtents||!n?.query?.supportsTopFeaturesQuery)throw new st(sv,"Layer source does not support queryTopExtents capability");return r.queryTopExtents(QR.from(e),i)}async queryTopFeatureCount(e,i){const{source:r,capabilities:n}=await this.load();if(!r.queryTopCount||!n?.query?.supportsTopFeaturesQuery)throw new st(sv,"Layer source does not support queryFeatureCount capability");return r.queryTopCount(QR.from(e),i)}read(e,i){const r=e.featureCollection;if(r){const n=r.layers;n&&n.length===1&&(super.read(n[0],i),r.showLegend!=null&&super.read({showLegend:r.showLegend},i))}super.read(e,i),i&&i.origin==="service"&&(this.revert(["objectIdField","fields","timeInfo"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,i){i={...i,origin:i?.origin??void 0,writeLayerSchema:i?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:n,messages:s}=i;if(this.dynamicDataSource)return s?.push(qoe(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-scene"||r==="web-map"&&n!=="tables")return s?.push(qoe(this,"using a table source cannot be written to web scenes and web maps")),null;if(this._hasMemorySource())return s?.push(qoe(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&r==="web-map"&&n==="tables")return s?.push(qoe(this,"using a non-table source cannot be written to tables in web maps")),null;return super.write(e,i)}clone(){if(this._hasMemorySource())throw new st(sv,`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"||Woe(this,e))}async save(e){return(await Promise.resolve().then(()=>dwt)).save(this,e)}async saveAs(e,i){return(await Promise.resolve().then(()=>dwt)).saveAs(this,e,i)}_readEditingEnabled(e,i,r){let n=e.layerDefinition?.capabilities;return n?this._hasEditingCapability(n):(n=e.capabilities,i&&r?.origin==="web-map"&&!this._hasMemorySource()&&n?this._hasEditingCapability(n):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(i=>i.trim()).includes("editing")}_writeEditingEnabled(e,i,r,n){if(!e){const s=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";Dp("layerDefinition.capabilities",s,i),r&&!n?.writeLayerSchema&&(i.capabilities=s)}}_getLayerDomain(e){const i=this.fieldsIndex.get(e);return i?i.domain:null}_fetchFirstLayerId(e){return ur(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(i=>{const r=i.data;if(r)return Array.isArray(r.layers)&&r.layers.length>0?r.layers[0].id:Array.isArray(r.tables)&&r.tables.length>0?r.tables[0].id:void 0})}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(),M1(this.renderer,this.fieldsIndex),RL(this.timeInfo,this.fieldsIndex),Kq(this,{origin:"service"})}async hasDataChanged(){return hYe(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(i=>i.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,i){e&&e.forEach(r=>{const n=r.prototype&&r.prototype.attributes;n&&i&&delete n[i]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new st("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 st("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(i=>{i.layer=this,i.sourceLayer=this}),this._handles.add([e.on("after-add",i=>{i.item.layer=this,i.item.sourceLayer=this}),e.on("after-remove",i=>{i.item.layer=null,i.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(i=>{i.layer=null,i.sourceLayer=null}),this._handles.remove("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}};E([Vi("service","capabilities")],js.prototype,"readCapabilities",null),E([N({json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],js.prototype,"charts",void 0),E([N({readOnly:!0})],js.prototype,"createQueryVersion",null),E([N({json:{read:{source:"layerDefinition.copyrightText"}}})],js.prototype,"copyright",void 0),E([N({json:{read:{source:"layerDefinition.displayField"}}})],js.prototype,"displayField",void 0),E([N({types:Hh,readOnly:!0})],js.prototype,"defaultSymbol",void 0),E([N({type:rv})],js.prototype,"dynamicDataSource",void 0),E([N({type:Boolean})],js.prototype,"editingEnabled",null),E([Vi(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],js.prototype,"readEditingEnabled",null),E([Vi("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],js.prototype,"readEditingEnabledFromWebMap",null),E([Cr(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],js.prototype,"writeEditingEnabled",null),E([Cr("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],js.prototype,"writeEditingEnabledToWebMap",null),E([N({readOnly:!0})],js.prototype,"effectiveEditingEnabled",null),E([N({...sCe.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:oCe}}}}})],js.prototype,"fields",void 0),E([N(sCe.fieldsIndex)],js.prototype,"fieldsIndex",void 0),E([N({type:hHe,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],js.prototype,"formTemplate",void 0),E([N({json:{read:{source:"layerDefinition.extent"}}})],js.prototype,"fullExtent",void 0),E([N({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:oCe,writer(t,e,i){const r=t?uSe.toJSON(t):null;r&&Dp(i,r,e)}}}},read:{source:"layerDefinition.geometryType",reader:uSe.read}}})],js.prototype,"geometryType",void 0),E([N({json:{read:{source:"layerDefinition.hasM"}}})],js.prototype,"hasM",void 0),E([N({json:{read:{source:"layerDefinition.hasZ"}}})],js.prototype,"hasZ",void 0),E([N(G9)],js.prototype,"id",void 0),E([N({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],js.prototype,"infoFor3D",void 0),E([N({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],js.prototype,"isTable",void 0),E([Vi("service","isTable",["type","geometryType"]),Vi("isTable",["layerDefinition.type","layerDefinition.geometryType"])],js.prototype,"readIsTable",null),E([Cr("web-map","isTable")],js.prototype,"writeIsTable",null),E([N(IA)],js.prototype,"labelsVisible",void 0),E([N({type:[E2],json:{origins:{service:{read:{source:"drawingInfo.labelingInfo",reader:NA},write:{target:"drawingInfo.labelingInfo",enabled:!1}}},read:{source:"layerDefinition.drawingInfo.labelingInfo",reader:NA},write:{target:"layerDefinition.drawingInfo.labelingInfo"}}})],js.prototype,"labelingInfo",void 0),E([N((()=>{const t=gi(TWe);return t.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,i,r){Dp(r,qne(e),i)}}},t})())],js.prototype,"opacity",void 0),E([N(B1)],js.prototype,"legendEnabled",void 0),E([N({type:["show","hide"],json:(()=>{const t=gi(EWe.json);return t.origins["portal-item"]={read:!1,write:!1},t})()})],js.prototype,"listMode",void 0),E([Vi("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],js.prototype,"readGlobalIdField",null),E([N({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:oCe}}}}})],js.prototype,"objectIdField",void 0),E([Vi("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],js.prototype,"readObjectIdField",null),E([N({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],js.prototype,"operationalLayerType",void 0),E([N(sCe.outFields)],js.prototype,"outFields",void 0),E([N({readOnly:!0})],js.prototype,"parsedUrl",null),E([N({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],js.prototype,"path",void 0),E([N(s_)],js.prototype,"popupEnabled",void 0),E([N({type:wh,json:{name:"popupInfo",write:!0}})],js.prototype,"popupTemplate",void 0),E([N({readOnly:!0})],js.prototype,"defaultPopupTemplate",null),E([N({types:vA,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:AR,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:(t,e,i)=>({ignoreOrigin:i?.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(t,e,i)=>({ignoreOrigin:i?.writeLayerSchema})}}})],js.prototype,"renderer",null),E([Vi("service","renderer",["drawingInfo.renderer","defaultSymbol"]),Vi("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],js.prototype,"readRenderer",null),E([N((()=>{const t=gi(V9);return t.json.origins["portal-item"]={read:!1,write:!1},t})())],js.prototype,"screenSizePerspectiveEnabled",void 0),E([N({clonable:!1})],js.prototype,"source",null),E([ho("source")],js.prototype,"castSource",null),E([Vi("portal-item","source",["featureSet"]),Vi("web-map","source",["featureSet"])],js.prototype,"readSource",null),E([N({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],js.prototype,"spatialReference",void 0),E([N({type:Number})],js.prototype,"subtypeCode",void 0),E([N({type:[uB]})],js.prototype,"templates",void 0),E([Vi("templates",["editFieldsInfo","creatorField","editorField","templates"])],js.prototype,"readTemplates",null),E([N({type:eCe})],js.prototype,"timeInfo",void 0),E([N()],js.prototype,"title",void 0),E([Vi("service","title",["name"]),Vi("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],js.prototype,"readTitle",null),E([Vi("web-map","title",["layerDefinition.name","title"])],js.prototype,"readTitleFromWebMap",null),E([N({type:String})],js.prototype,"sublayerTitleMode",void 0),E([N({json:{read:!1}})],js.prototype,"type",void 0),E([N({type:String})],js.prototype,"typeIdField",void 0),E([Vi("service","typeIdField"),Vi("typeIdField",["layerDefinition.typeIdField"])],js.prototype,"readTypeIdField",null),E([N({type:[cB]})],js.prototype,"types",void 0),E([Vi("service","types",["types"]),Vi("types",["layerDefinition.types"])],js.prototype,"readTypes",null),E([N({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],js.prototype,"visible",void 0),E([Vi("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],js.prototype,"readVisible",null),js=E([dt(_Xe)],js);const aCe=xC({types:GW}),Xc=js,lCe=Object.freeze(Object.defineProperty({__proto__:null,default:Xc},Symbol.toStringTag,{value:"Module"}));let Jq=class extends Ud(Sr){constructor(e){super(e),this.handles.add([this.on("before-add",i=>{lt(i.item)&&i.preventDefault()}),this.on("after-add",i=>this._own(i.item)),this.on("after-remove",i=>this._release(i.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(Sr.ofType(this.itemType.Type))(e):new Sr(e)}};function uCe(t,e){return{type:t,cast:k8,set(i){const r=og(i,this._get(e),t);r.owner=this,this._set(e,r)}}}E([N()],Jq.prototype,"owner",null),Jq=E([dt("esri.core.support.OwningCollection")],Jq);let U1=class extends Jq{_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)}};E([q_e({Type:io,ensureType:fd(io)})],U1.prototype,"itemType",void 0),U1=E([dt("esri.support.GraphicsCollection")],U1);let kA=class extends up(Ch(du)){constructor(e){super(e),this.elevationInfo=null,this.graphics=new U1,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,i){return super.on(e,i)}graphicChanged(e){this.emit("graphic-update",e)}};E([N({type:w5})],kA.prototype,"elevationInfo",void 0),E([N(uCe(U1,"graphics"))],kA.prototype,"graphics",void 0),E([N({type:["show","hide"]})],kA.prototype,"listMode",void 0),E([N()],kA.prototype,"screenSizePerspectiveEnabled",void 0),E([N({readOnly:!0})],kA.prototype,"type",void 0),E([N({constructOnly:!0})],kA.prototype,"internal",void 0),kA=E([dt("esri.layers.GraphicsLayer")],kA);const wXe=kA;var cCe;const Yoe=new Ks({flow_from:"flow-from",flow_to:"flow-to"});let a0=cCe=class extends SR(Ui){constructor(t){super(t),this.density=.8,this.color=new en([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:t,maxPathLength:e,trailWidth:i,flowSpeed:r,trailLength:n,smoothing:s,flowRepresentation:o,trailCap:a,background:l}=this,c=this.color.clone(),h=(this.visualVariables||[]).map(v=>v.clone()),p=this.authoringInfo?.clone(),y=this.legendOptions?.clone();return new cCe({density:t,color:c,maxPathLength:e,trailWidth:i,flowSpeed:r,trailLength:n,trailCap:a,background:l,smoothing:s,flowRepresentation:o,visualVariables:h,authoringInfo:p,legendOptions:y})}getSymbol(t,e){}async getSymbolAsync(t,e){}getSymbols(){return[]}};E([N({type:Number,json:{write:!0}})],a0.prototype,"density",void 0),E([N({type:en,json:{write:{allowNull:!0}}})],a0.prototype,"color",void 0),E([N({type:Number,cast:Ga,json:{write:!0}})],a0.prototype,"maxPathLength",void 0),E([N({type:Number,cast:Ga,json:{write:!0}})],a0.prototype,"trailWidth",void 0),E([N({type:Number,json:{write:!0}})],a0.prototype,"flowSpeed",void 0),E([N({type:Number,json:{write:!0}})],a0.prototype,"trailLength",void 0),E([N({type:Number,cast:Ga,json:{write:!1}})],a0.prototype,"smoothing",void 0),E([N({type:Yoe.apiValues,json:{type:Yoe.jsonValues,read:{reader:Yoe.read},write:{writer:Yoe.write}}})],a0.prototype,"flowRepresentation",void 0),E([rn({flowRenderer:"flow"})],a0.prototype,"type",void 0),E([N({type:HW,json:{write:!0}})],a0.prototype,"authoringInfo",void 0),E([N({type:zC,json:{write:!0}})],a0.prototype,"legendOptions",void 0),E([N({type:String,json:{write:!0}})],a0.prototype,"trailCap",void 0),E([N({type:String,json:{write:!0}})],a0.prototype,"background",void 0),a0=cCe=E([dt("esri.renderers.FlowRenderer")],a0);const xXe=a0;let dB=class extends Ui{constructor(){super(...arguments),this.value=null,this.label=null,this.color=null}};E([N({type:Number,json:{write:!0}})],dB.prototype,"value",void 0),E([N({type:String,json:{write:!0}})],dB.prototype,"label",void 0),E([N({type:en,json:{type:[Ls],write:!0}})],dB.prototype,"color",void 0),dB=E([dt("esri.renderers.support.ColormapInfo")],dB);const SXe=dB;function oYt(t){return"r"in t&&"g"in t&&"b"in t}function CXe(t){return"h"in t&&"s"in t&&"v"in t}function TXe(t){return"l"in t&&"a"in t&&"b"in t}function EXe(t){return"l"in t&&"c"in t&&"h"in t}function aYt(t){return"x"in t&&"y"in t&&"z"in t}const lYt=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],uYt=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function IXe(t,e){const i=[];let r,n;if(t[0].length!==e.length)throw new Error("dimensions do not match");const s=t.length,o=t[0].length;let a=0;for(r=0;rr<=.04045?r/12.92:((r+.055)/1.055)**2.4),i=IXe(lYt,e);return{x:100*i[0],y:100*i[1],z:100*i[2]}}function hCe(t){const e=IXe(uYt,[t.x/100,t.y/100,t.z/100]).map(i=>{const r=i<=.0031308?12.92*i:1.055*i**.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 PXe(t){const e=[t.x/95.047,t.y/100,t.z/108.883].map(i=>i>.008856451679035631?i**.3333333333333333:7.787037037037035*i+.13793103448275862);return{l:116*e[1]-16,a:500*(e[0]-e[1]),b:200*(e[1]-e[2])}}function OXe(t){const e=t.l,i=[(e+16)/116+t.a/500,(e+16)/116,(e+16)/116-t.b/200].map(r=>r>6/29?r**3:3*(6/29)**2*(r-4/29));return{x:95.047*i[0],y:100*i[1],z:108.883*i[2]}}function cYt(t){const e=t.l,i=t.a,r=t.b,n=Math.sqrt(i*i+r*r);let s=Math.atan2(r,i);return s=s>0?s:s+2*Math.PI,{l:e,c:n,h:s}}function hYt(t){const e=t.l,i=t.c,r=t.h;return{l:e,a:i*Math.cos(r),b:i*Math.sin(r)}}function dYt(t){return PXe(AXe(t))}function pYt(t){return hCe(OXe(t))}function fYt(t){return cYt(PXe(AXe(t)))}function mYt(t){return hCe(OXe(hYt(t)))}function gYt(t){const e=t.r,i=t.g,r=t.b,n=Math.max(e,i,r),s=n-Math.min(e,i,r);let o=n,a=s===0?0:n===e?(i-r)/s%6:n===i?(r-e)/s+2:(e-i)/s+4,l=s===0?0:s/o;return a<0&&(a+=6),a*=60,l*=100,o*=.39215686274509803,{h:a,s:l,v:o}}function yYt(t){const e=(t.h+360)%360/60,i=t.s/100,r=t.v/100*255,n=r*i,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 eM(t){return oYt(t)?t:EXe(t)?mYt(t):TXe(t)?pYt(t):aYt(t)?hCe(t):CXe(t)?yYt(t):t}function Xoe(t){return CXe(t)?t:gYt(eM(t))}function Koe(t){return TXe(t)?t:dYt(eM(t))}function Joe(t){return EXe(t)?t:fYt(eM(t))}const vYt=["random","ndvi","ndvi2","ndvi3","elevation","gray","hillshade"],dCe=[{id:"aspect_predefined",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:"blackToWhite_predefined",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blueBright_predefined",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blueLightToDark_predefined",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blueGreenBright_predefined",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blueGreenLightToDark_predefined",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brownLightToDark_predefined",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brownToBlueGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brownToBlueGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficientBias_predefined",fromColor:[214,214,255],toColor:[0,57,148]},{id:"coldToHotDiverging_predefined",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"conditionNumber_predefined",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyanToPurple_predefined",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyanLightToBlueDark_predefined",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance_predefined",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1_predefined",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_predefined",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_predefined",fromColor:[255,235,214],toColor:[196,10,10]},{id:"grayLightToDark_predefined",fromColor:[219,219,219],toColor:[69,69,69]},{id:"greenBright_predefined",fromColor:[204,255,204],toColor:[14,204,14]},{id:"greenLightToDark_predefined",fromColor:[220,245,233],toColor:[34,102,51]},{id:"greenToBlue_predefined",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orangeBright_predefined",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orangeLightToDark_predefined",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partialSpectrum_predefined",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:"partialSpectrum1Diverging_predefined",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:"partialSpectrum2Diverging_predefined",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:"pinkToYellowGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pinkToYellowGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation_predefined",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_predefined",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purpleBright_predefined",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purpleToGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purpleToGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purpleBlueBright_predefined",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purpleBlueLightToDark_predefined",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purpleRedBright_predefined",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purpleRedLightToDark_predefined",fromColor:[250,215,246],toColor:[143,17,57]},{id:"redBright_predefined",fromColor:[255,204,204],toColor:[219,0,0]},{id:"redLightToDark_predefined",fromColor:[255,224,224],toColor:[143,10,10]},{id:"redToBlueDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"redToBlueDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"redToGreen_predefined",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"redToGreenDivergingBright_predefined",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"redToGreenDivergingDark_predefined",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope_predefined",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrumFullBright_predefined",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:"spectrumFullDark_predefined",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:"spectrumFullLight_predefined",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_predefined",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_predefined",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:"whiteToBlack_predefined",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellowToDarkRed_predefined",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellowToGreenToDarkBlue_predefined",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:"yellowToRed_predefined",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellowGreenBright_predefined",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellowGreenLightToDark_predefined",fromColor:[215,240,175],toColor:[96,107,45]}],RXe={aspect_predefined:"Aspect",blackToWhite_predefined:"Black to White",blueBright_predefined:"Blue Bright",blueLightToDark_predefined:"Blue Light to Dark",blueGreenBright_predefined:"Blue-Green Bright",blueGreenLightToDark_predefined:"Blue-Green Light to Dark",brownLightToDark_predefined:"Brown Light to Dark",brownToBlueGreenDivergingBright_predefined:"Brown to Blue Green Diverging, Bright",brownToBlueGreenDivergingDark_predefined:"Brown to Blue Green Diverging, Dark",coefficientBias_predefined:"Coefficient Bias",coldToHotDiverging_predefined:"Cold to Hot Diverging",conditionNumber_predefined:"Condition Number",cyanToPurple_predefined:"Cyan to Purple",cyanLightToBlueDark_predefined:"Cyan-Light to Blue-Dark",distance_predefined:"Distance",elevation1_predefined:"Elevation #1",elevation2_predefined:"Elevation #2",errors_predefined:"Errors",grayLightToDark_predefined:"Gray Light to Dark",greenBright_predefined:"Green Bright",greenLightToDark_predefined:"Green Light to Dark",greenToBlue_predefined:"Green to Blue",orangeBright_predefined:"Orange Bright",orangeLightToDark_predefined:"Orange Light to Dark",partialSpectrum_predefined:"Partial Spectrum",partialSpectrum1Diverging_predefined:"Partial Spectrum 1 Diverging",partialSpectrum2Diverging_predefined:"Partial Spectrum 2 Diverging",pinkToYellowGreenDivergingBright_predefined:"Pink to YellowGreen Diverging, Bright",pinkToYellowGreenDivergingDark_predefined:"Pink to YellowGreen Diverging, Dark",precipitation_predefined:"Precipitation",prediction_predefined:"Prediction",purpleBright_predefined:"Purple Bright",purpleToGreenDivergingBright_predefined:"Purple to Green Diverging, Bright",purpleToGreenDivergingDark_predefined:"Purple to Green Diverging, Dark",purpleBlueBright_predefined:"Purple-Blue Bright",purpleBlueLightToDark_predefined:"Purple-Blue Light to Dark",purpleRedBright_predefined:"Purple-Red Bright",purpleRedLightToDark_predefined:"Purple-Red Light to Dark",redBright_predefined:"Red Bright",redLightToDark_predefined:"Red Light to Dark",redToBlueDivergingBright_predefined:"Red to Blue Diverging, Bright",redToBlueDivergingDark_predefined:"Red to Blue Diverging, Dark",redToGreen_predefined:"Red to Green",redToGreenDivergingBright_predefined:"Red to Green Diverging, Bright",redToGreenDivergingDark_predefined:"Red to Green Diverging, Dark",slope_predefined:"Slope",spectrumFullBright_predefined:"Spectrum-Full Bright",spectrumFullDark_predefined:"Spectrum-Full Dark",spectrumFullLight_predefined:"Spectrum-Full Light",surface_predefined:"Surface",temperature_predefined:"Temperature",whiteToBlack_predefined:"White to Black",yellowToDarkRed_predefined:"Yellow to Dark Red",yellowToGreenToDarkBlue_predefined:"Yellow to Green to Dark Blue",yellowToRed_predefined:"Yellow to Red",yellowGreenBright_predefined:"Yellow-Green Bright",yellowGreenLightToDark_predefined:"Yellow-Green Light to Dark"},pB=new Ks({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","urple 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 Zoe(t,e){if(!t||!e||t.length!==e.length)return!1;for(let i=0;ie[i]+2||t[i]{if(Zoe(t.fromColor.toRgb(),n.fromColor)&&Zoe(t.toColor.toRgb(),n.toColor))return r=n.id,!0}):t.type==="multipart"&&i.some(n=>{const s=t.colorRamps,o=n.colorRamps;if(s&&o&&s.length===o.length&&!o.some((a,l)=>{if(!Zoe(s[l].fromColor.toRgb(),new en(a.fromColor).toRgb())||!Zoe(s[l].toColor.toRgb(),new en(a.toColor).toRgb()))return!0})){if(r)return!0;r=n.id}}),r}function MXe(t){const e=_Yt(t);return e?RXe[e]:null}function bYt(t){const e=pB.toJSON(t),i=Object.entries(RXe).find(n=>n[1]===e)?.[0],r=dCe.find(n=>n.id===i);return r?r.colorRamps?{type:"multipart",colorRamps:r.colorRamps.map(n=>({type:"algorithmic",algorithm:"esriCIELabAlgorithm",fromColor:n.fromColor,toColor:n.toColor}))}:{type:"algorithmic",algorithm:"esriCIELabAlgorithm",fromColor:r.fromColor,toColor:r.toColor}:null}function DXe(t){const e=(t=t||{}).numColors||256,i=t.distanceOffset||0,r=t.isCustomInterval!=null?t.isCustomInterval:t.distanceInterval!==null&&t.distanceInterval!==1/(e-1),n=t.distanceInterval||1/(e-1);return{...t,numColors:e,distanceOffset:i,interpolateAlpha:!!t.interpolateAlpha,distanceInterval:n,isCustomInterval:r,weights:t.weights}}function wYt(t,e,i){const{numColors:r,distanceOffset:n,distanceInterval:s,isCustomInterval:o}=i,a=t.s===0,l=e.s===0;let c=t.h,h=e.h;a&&!l?c=h:l&&!a&&(e={...e,h:c},h=c);let p,y=Math.abs(h-c);const v=360;yh?y*s:-y*s);const x=(e.s-t.s)*s,I=(e.v-t.v)*s;let{s:P,v:F}=t,k=c;if(n){const V=n/s;k=(k+V*p+v)%v,P+=V*x,F+=V*I}const j=[];for(let V=0;Vv+x);n=n.map(v=>v/y)}else{n=[];for(let y=0;y{n.unshift(s),r||n.pop()}),i}function LXe(t){const e=MXe(t);if(t){if(t.type==="algorithmic")return{...NXe(t),Name:e};if(t.colorRamps){const i=t.colorRamps.map(NXe);return{type:"MultiPartColorRamp",NumColorRamps:i.length,ArrayOfColorRamp:i,Name:e}}}}function NXe(t){if(t)return{Algorithm:t.toJSON()?.Algorithm||"esriHSVAlgorithm",type:"AlgorithmicColorRamp",FromColor:kXe(t.fromColor),ToColor:kXe(t.toColor)}}function kXe(t){const e=Xoe(t);return{type:"HsvColor",Hue:e.h,Saturation:e.s,Value:e.v,AlphaValue:255}}function TYt(t){const e=t.reverse().map(i=>{const r=i.toString(16);return r.length<2?"0"+r:r});return 4294967295&Number.parseInt(e.join(""),16)}var Zq;let Qq=Zq=class extends Ui{constructor(t){super(t),this.colormapInfos=null,this.type="raster-colormap"}static createFromColormap(t,e){if(!t)return null;const i=t[0].length===5,r=[...t].sort(n=>n[0][0]-n[1][0]).map(n=>SXe.fromJSON({value:n[0],color:i?n.slice(1,5):n.slice(1,4).concat([255]),label:e?e[n[0]]??"":n[0]}));return new Zq({colormapInfos:r})}static createFromColorramp(t){const e=$A(t);return Zq.createFromColormap(e)}clone(){return new Zq({colormapInfos:this.colormapInfos.map(t=>t.toJSON())})}extractColormap(){return this.colormapInfos.map(({value:t,color:e})=>[t,e.r,e.g,e.b,e.a>1?e.a:255*e.a&255]).sort((t,e)=>t[0]-e[0])}};E([N({type:[SXe],json:{write:!0}})],Qq.prototype,"colormapInfos",void 0),E([rn({rasterColormap:"raster-colormap"})],Qq.prototype,"type",void 0),Qq=Zq=E([dt("esri.renderers.RasterColormapRenderer")],Qq);const fCe=Qq;var mCe;let z1=mCe=class extends Ui{constructor(t){super(t),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(t){return wse(t)}clone(){return new mCe({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,colorRamp:gi(this.colorRamp)})}};E([N({type:Number,json:{write:!0}})],z1.prototype,"altitude",void 0),E([N({type:Number,json:{write:!0}})],z1.prototype,"azimuth",void 0),E([N({types:bse,json:{write:!0}})],z1.prototype,"colorRamp",void 0),E([Vi("colorRamp")],z1.prototype,"readColorRamp",null),E([N({type:["traditional","multi-directional"],json:{write:!0}})],z1.prototype,"hillshadeType",void 0),E([N({type:Number,json:{write:!0}})],z1.prototype,"pixelSizePower",void 0),E([N({type:Number,json:{write:!0}})],z1.prototype,"pixelSizeFactor",void 0),E([N({type:["none","adjusted"],json:{write:!0}})],z1.prototype,"scalingType",void 0),E([rn({rasterShadedRelief:"raster-shaded-relief"})],z1.prototype,"type",void 0),E([N({type:Number,json:{write:!0}})],z1.prototype,"zFactor",void 0),z1=mCe=E([dt("esri.renderers.RasterShadedReliefRenderer")],z1);const $Xe=z1,eY=new Ks({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"}),BXe={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"};var gCe;let ff=gCe=class extends Ui{constructor(t){super(t),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(t){if(t)return wse(t)}writeStatistics(t,e,i){t?.length&&(Array.isArray(t[0])||(t=t.map(r=>[r.min,r.max,r.avg,r.stddev])),e[i]=t)}readStretchType(t,e){let i=e.stretchType;return typeof i=="number"&&(i=BXe[i]),eY.read(i)}clone(){return new gCe({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:gi(this.statistics),gamma:gi(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:gi(this.colorRamp),histograms:gi(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};E([N({types:bse,json:{write:!0}})],ff.prototype,"colorRamp",void 0),E([Vi("colorRamp")],ff.prototype,"readColorRamp",null),E([N({type:Boolean,json:{write:!0}})],ff.prototype,"computeGamma",void 0),E([N({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],ff.prototype,"dynamicRangeAdjustment",void 0),E([N({type:[Number],json:{write:!0}})],ff.prototype,"gamma",void 0),E([N({type:Number,json:{write:!0}})],ff.prototype,"maxPercent",void 0),E([N({type:Number,json:{write:!0}})],ff.prototype,"minPercent",void 0),E([N({type:Number,json:{write:!0}})],ff.prototype,"numberOfStandardDeviations",void 0),E([N({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],ff.prototype,"outputMax",void 0),E([N({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],ff.prototype,"outputMin",void 0),E([N({type:Number,json:{write:!0}})],ff.prototype,"sigmoidStrengthLevel",void 0),E([N({json:{type:[[Number]],write:!0}})],ff.prototype,"statistics",void 0),E([N()],ff.prototype,"histograms",void 0),E([Cr("statistics")],ff.prototype,"writeStatistics",null),E([N({type:Boolean,json:{write:!0}})],ff.prototype,"useGamma",void 0),E([N({type:eY.apiValues,json:{type:eY.jsonValues,write:eY.write}})],ff.prototype,"stretchType",void 0),E([Vi("stretchType",["stretchType"])],ff.prototype,"readStretchType",null),E([rn({rasterStretch:"raster-stretch"})],ff.prototype,"type",void 0),ff=gCe=E([dt("esri.renderers.RasterStretchRenderer")],ff);const yCe=ff,fB={102100:{maxX:20037508342788905e-9,minX:-20037508342788905e-9,plus180Line:new Oa({paths:[[[20037508342788905e-9,-20037508342788905e-9],[20037508342788905e-9,20037508342788905e-9]]],spatialReference:hr.WebMercator}),minus180Line:new Oa({paths:[[[-20037508342788905e-9,-20037508342788905e-9],[-20037508342788905e-9,20037508342788905e-9]]],spatialReference:hr.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new Oa({paths:[[[180,-180],[180,180]]],spatialReference:hr.WGS84}),minus180Line:new Oa({paths:[[[-180,-180],[-180,180]]],spatialReference:hr.WGS84})}};function dw(t,e){return Math.ceil((t-e)/(2*e))}function vCe(t,e){const i=tY(t);for(const r of i)for(const n of r)n[0]+=e;return t}function tY(t){return Xa(t)?t.rings:t.paths}function a_(t,e){return e?{...e,query:{...t??{},...e.query}}:{query:t}}function hh(t){return typeof t=="string"?fa(t):gi(t)}function iT(t,e,i){const r={};for(const n in t){if(n==="declaredClass")continue;const s=t[n];if(s!=null&&typeof s!="function")if(Array.isArray(s)){r[n]=[];for(let o=0;o{const p=Sl(h);return p.spatialReference=s,p})}}function IYt(t){return{geometryType:bd(t[0]),geometries:t.map(e=>e.toJSON())}}function VXe(t,e,i){const r=gBt(e);return t.map(n=>{const s=r.fromJSON(n);return s.spatialReference=i,s})}async function AYt(t,e,i){const r=typeof t=="string"?fa(t):t,n=e[0].spatialReference,s=bd(e[0]),o={...i,query:{...r.query,f:"json",sr:n.wkid?n.wkid:JSON.stringify(n),geometries:JSON.stringify(IYt(e))}},{data:a}=await ur(r.path+"/simplify",o);return VXe(a.geometries,s,n)}const jXe=Oi.getLogger("esri.geometry.support.normalizeUtils");function PYt(t){return t.type==="polygon"}function OYt(t){return t[0].type==="polygon"}function RYt(t){return t[0].type==="polyline"}function GXe(t,e){if(!(t instanceof Oa||t instanceof To)){const n="straightLineDensify: the input geometry is neither polyline nor polygon";throw jXe.error(n),new st(n)}const i=tY(t),r=[];for(const n of i){const s=[];r.push(s),s.push([n[0][0],n[0][1]]);for(let o=0;o1){for(let k=1;k<=x-1;k++){const j=k*e,V=v*j+a,Y=y*j+l;s.push([V,Y])}const I=(p+Math.floor(x-1)*e)/2,P=v*I+a,F=y*I+l;s.push([P,F])}s.push([c,h])}}return PYt(t)?new To({rings:r,spatialReference:t.spatialReference}):new Oa({paths:r,spatialReference:t.spatialReference})}function UXe(t,e,i){if(e){const r=GXe(t,1e6);t=wL(r,!0)}return i&&(t=vCe(t,i)),t}function zXe(t,e,i){if(Array.isArray(t)){const r=t[0];if(r>e){const n=dw(r,e);t[0]=r+n*(-2*e)}else if(re){const n=dw(r,e);t=t.clone().offset(n*(-2*e),0)}else if(r{if(c[0]<180)return!0;{let h=0;for(let y=0;yh?v:h}h=Number(h.toFixed(9));const p=-360*dw(h,180);for(let y=0;yzXe(X,a,l)),x.push(Y)}else if(V.type==="extent"){const Y=V.clone()._normalize(!1,!1,s);x.push(Y.rings?new To(Y):Y)}else if(V.extent){const Y=V.extent,X=dw(Y.xmin,l)*(2*a);let Z=X===0?V.clone():vCe(V.clone(),X);Y.offset(X,0),Y.intersects(h)&&Y.xmax!==a?(y=Y.xmax>y?Y.xmax:y,Z=UXe(Z,o),v.push(Z),x.push("cut")):Y.intersects(p)&&Y.xmin!==l?(y=Y.xmax*(2*a)>y?Y.xmax*(2*a):y,Z=UXe(Z,o,360),v.push(Z),x.push("cut")):x.push(Z)}else x.push(V.clone());else x.push(V);let I=dw(y,a),P=-90;const F=I,k=new Oa;for(;I>0;){const V=360*I-180;k.addPath([[V,P],[V,-1*P]]),P*=-1,I--}if(v.length>0&&F>0){const V=MYt(v,await EYt(r,v,k,i)),Y=[],X=[];for(let ce=0;ce1&&_e.rings.length>=xe.rings.length?(Y.push(_e),X.push("simplify")):X.push(o?Q3(_e):_e)}}if(!Y.length)return X;const Z=await AYt(r,Y,i),ie=[];for(let ce=0;cen)for(;t>n;)t-=s}return t}let HXe=class{constructor(e=null,i=null,r=null){this.minValue=e,this.maxValue=i,this.noDataValue=r}};const DYt=9999999e31,FYt=2e-7,LYt={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]};function rT(t){return LYt[t]??[-34028234663852886e22,34028234663852886e22]}function Qoe(t,e,i){if(t.depthCount&&t.depthCount>1)return;const{pixels:r,statistics:n,pixelType:s}=t,o=r[0].length,a=t.bandMasks??[],l=t.mask??new Uint8Array(o).fill(255),c=s==="f32"||s==="f64",h=rT(s);let p=!1;for(let y=0;yv+Number.EPSILON||I=DYt?FYt*Math.abs(v):s==="f32"?11920928955078125e-23:Number.EPSILON);for(let V=0;Vthis._calculateBandStatistics(i,this.mask));const t=this.mask;let e=0;if(ve(t))for(let i=0;ii?i:ao>=e.length),s=r===t.length&&!t.some((o,a)=>o!==a);return n||s?this:new N5({pixelType:this.pixelType,width:this.width,height:this.height,mask:this.mask,validPixelCount:this.validPixelCount,maskIsAlpha:this.maskIsAlpha,pixels:t.map(o=>e[o]),statistics:i&&t.map(o=>i[o])})}clone(){const t=new N5({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;ve(this.mask)&&(this.mask instanceof Uint8Array?t.mask=new Uint8Array(this.mask):t.mask=this.mask.slice(0));const i=N5.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.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 c=new Uint32Array(t),h=this.width*this.height;if(s.length===h)if(ve(e)&&e.length===h)if(i)for(l=0;l0){for(const I of r)if(I.minValue!=null&&(o=Math.min(o,I.minValue)),I.maxValue!=null&&I.minValue!=null){const P=I.maxValue-I.minValue;a=Math.max(a,P)}s=255/a}else{let I=255;n==="s8"?(o=-128,I=127):n==="u16"?I=65535:n==="s16"?(o=-32768,I=32767):n==="u32"?I=4294967295:n==="s32"?(o=-2147483648,I=2147483647):n==="f32"?(o=-34e38,I=34e38):n==="f64"&&(o=-Number.MAX_VALUE,I=Number.MAX_VALUE),s=255/(I-o)}const l=new Uint32Array(t),c=this.width*this.height;let h,p,y,v,x;if(h=p=y=e[0],h.length!==c)return Oi.getLogger(this.declaredClass).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(p=e[1],e.length>=3&&(y=e[2]),ve(i)&&i.length===c)for(v=0;v=3?(n=e[1],s=e[2]):e.length===2&&(n=e[1]);const a=this.width*this.height;if(r.length!==a)return Oi.getLogger(this.declaredClass).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let l=0;if(ve(i)&&i.length===a)for(o=0;or?o:r);else for(s=0;sr?o:r;return new HXe(i,r)}};E([N({json:{write:!0}})],l0.prototype,"width",void 0),E([N({json:{write:!0}})],l0.prototype,"height",void 0),E([N({json:{write:!0}})],l0.prototype,"pixelType",void 0),E([ho("pixelType")],l0.prototype,"castPixelType",null),E([N({json:{write:!0}})],l0.prototype,"validPixelCount",void 0),E([N({json:{write:!0}})],l0.prototype,"mask",void 0),E([N({json:{write:!0}})],l0.prototype,"maskIsAlpha",void 0),E([N({json:{write:!0}})],l0.prototype,"pixels",void 0),E([N()],l0.prototype,"premultiplyAlpha",void 0),E([N({json:{write:!0}})],l0.prototype,"statistics",void 0),E([N({json:{write:!0}})],l0.prototype,"depthCount",void 0),E([N({json:{write:!0}})],l0.prototype,"noDataValues",void 0),E([N({json:{write:!0}})],l0.prototype,"bandMasks",void 0),l0=N5=E([dt("esri.layers.support.PixelBlock")],l0);const dn=l0;var eae,tae;(function(t){t[t.matchAny=0]="matchAny",t[t.matchAll=1]="matchAll"})(eae||(eae={})),function(t){t[t.bestMatch=0]="bestMatch",t[t.fail=1]="fail"}(tae||(tae={}));const tM=6;function Th(t){return ve(t)&&t.declaredClass==="esri.layers.support.PixelBlock"&&t.pixels&&t.pixels.length>0}function iae(t,e){if(!e?.length||!Th(t))return t;const i=t.pixels.length;return e&&e.some(r=>r>=i)||i===1&&e.length===1&&e[0]===0?t:i!==e.length||e.some((r,n)=>r!==n)?new dn({pixelType:t.pixelType,width:t.width,height:t.height,mask:t.mask,validPixelCount:t.validPixelCount,maskIsAlpha:t.maskIsAlpha,pixels:e.map(r=>t.pixels[r]),statistics:t.statistics&&e.map(r=>t.statistics[r])}):t}function NYt(t){if(!t?.length||t.some(h=>!Th(h)))return null;if(t.length===1)return ve(t[0])?t[0].clone():null;const e=t,{width:i,height:r,pixelType:n}=e[0];if(e.some(h=>h.width!==i||h.height!==r))return null;const s=e.map(({mask:h})=>h).filter(h=>h!=null);let o=null;s.length&&(o=new Uint8Array(i*r),o.set(s[0]),s.length>1&&YXe(s.slice(1),o));const a=[];e.forEach(({pixels:h})=>a.push(...h));const l=e.map(({statistics:h})=>h).filter(h=>h?.length),c=[];return l.forEach(h=>c.push(...h)),new dn({pixelType:n,width:i,height:r,mask:o,pixels:a,statistics:c.length?c:null})}function iY(t){if(!t)return;const e=t.colormap;if(!e||e.length===0)return;const i=e.sort((p,y)=>p[0]-y[0]);let r=0;i[0][0]<0&&(r=i[0][0]);const n=Math.max(256,i[i.length-1][0]-r+1),s=new Uint8Array(4*n),o=[];let a,l=0,c=0;const h=i[0].length===5;if(n>65536)return i.forEach(p=>{o[p[0]-r]=h?p.slice(1):p.slice(1).concat([255])}),{indexed2DColormap:o,offset:r,alphaSpecified:h};if(t.fillUnspecified)for(a=i[c],l=a[0]-r;lF?n[h]=0:(y[h]=o[P],v[h]=o[P+1],x[h]=o[P+2],n[h]=o[P+3]));else{for(n=new Uint8Array(s),h=0;hF?n[h]=0:(y[h]=o[P],v[h]=o[P+1],x[h]=o[P+2],n[h]=o[P+3]);i.mask=n}}else if(a)if(ve(n))for(h=0;hs));const a=[],l=e.outputPixelType||"u8";for(let h=0;h1;){if(c===h.value){I=!0;break}c>h.value?p=x:y=x,x=Math.floor((p+y)/2),h=e[Math.floor(x)]}I||(c===e[p].value?(h=e[p],I=!0):c===e[y].value?(h=e[y],I=!0):ce[p].value&&(cj-x);I[0]=n[0],I[I.length-1]=n[n.length-1]+(c?1e-6:0);const P=n.length/2,[F,k]=rT(o);for(let j=0;j=0;ie--)if(X===I[2*ie]||X>I[2*ie]&&Xk?k:X=a[Z]&&X<=a[Z+1]){p[Y]=0,v[Y]=0;break}}}return new dn({width:i,height:r,pixelType:o,pixels:[p],mask:v})}function WXe(t,e,i,r){const n=i!=null&&i.length>=2?new Set(i):null,s=i?.length===1?i[0]:null,o=!!e?.length;for(let a=0;a=e[h]&&l<=e[h+1]){c=!0;break}c||(r[a]=0)}r[a]&&(l===s||n?.has(l))&&(r[a]=0)}}function qXe(t,e){const i=t[0].length;for(let r=0;rP-1e-6);I[0]=i[0],o&&(I[I.length-1]=i[i.length-1]);for(let P=0;Pv?v:r[P]x.pixelBlock);if(!i||lt(i.pixelBlock))return null;const r=(i.extent.xmax-i.extent.xmin)/i.pixelBlock.width,n=(i.extent.ymax-i.extent.ymin)/i.pixelBlock.height,s=.01*Math.min(r,n),o=t.sort((x,I)=>Math.abs(x.extent.ymax-I.extent.ymax)>s?I.extent.ymax-x.extent.ymax:Math.abs(x.extent.xmin-I.extent.xmin)>s?x.extent.xmin-I.extent.xmin:0),a=Math.min.apply(null,o.map(x=>x.extent.xmin)),l=Math.min.apply(null,o.map(x=>x.extent.ymin)),c=Math.max.apply(null,o.map(x=>x.extent.xmax)),h=Math.max.apply(null,o.map(x=>x.extent.ymax)),p={x:Math.round((e.xmin-a)/r),y:Math.round((h-e.ymax)/n)},y={width:Math.round((c-a)/r),height:Math.round((h-l)/n)},v={width:Math.round((e.xmax-e.xmin)/r),height:Math.round((e.ymax-e.ymin)/n)};return Math.round(y.width/i.pixelBlock.width)*Math.round(y.height/i.pixelBlock.height)!==o.length||p.x<0||p.y<0||y.widthx.pixelBlock),y,{clipOffset:p,clipSize:v})}}function xCe(t,e,i,r,n,s){const{width:o,height:a}=i.block,{x:l,y:c}=i.offset,{width:h,height:p}=i.mosaic,y=GYt(o,a,r,n,l,c,h,p);let v=0,x=0;if(s){const I=s.hasGCSSShiftTransform?360:s.halfWorldWidth??0,P=o*s.resolutionX,F=s.startX+r*P;FI?x=s.rightPadding:F>=I&&(v=s.leftMargin-s.rightPadding,x=0)}if(y.xmax-=x,typeof e!="number")for(let I=y.ymin;ITh(Z));if(lt(a))return null;const l=n?n.width:e.width,c=n?n.height:e.height,h=a.width,p=a.height,y=e.width/h,v=e.height/p,x={offset:r||{x:0,y:0},mosaic:n||e,block:{width:h,height:p}},I=a.pixelType,P=dn.getPixelArrayConstructor(I),F=a.pixels.length,k=[];let j,V;for(let Z=0;Zlt(Z)||ve(Z.mask)&&Z.mask.length>0)){Y=new Uint8Array(l*c);for(let Z=0;Zve(v));if(lt(r))return null;const n=t.some(v=>!ve(v)||!!v.mask),{width:s,height:o}=e,a=n?new Uint8Array(s*o):null,{blockWidths:l}=i,c=[],h=r.getPlaneCount(),p=dn.getPixelArrayConstructor(r.pixelType);if(n)for(let v=0,x=0;vr||l>n||s===0&&o===0&&a===r&&l===n)return t;t.mask||(t.mask=new Uint8Array(r*n));const c=t.mask;for(let h=0;h=l||y=a?0:1}return t.updateStatistics(),t}function WYt(t){if(!Th(t))return null;const e=t.clone(),{width:i,height:r,pixels:n}=t,s=n[0],o=e.pixels[0],a=t.mask;for(let l=2;le&&(i=s.value,e=r),s=n.next();return i}function nae(t,e,i){if(i===0)return;const r=t.get(e);r===1?t.delete(e):t.set(e,r-1)}function nY(t,e,i){i!==0&&t.set(e,t.has(e)?t.get(e)+1:1)}function qYt(t,e,i){let{x:r,y:n}=e;const{width:s,height:o}=i;if(r===0&&n===0&&o===t.height&&s===t.width)return t;const{width:a,height:l}=t,c=Math.max(0,n),h=Math.max(0,r),p=Math.min(r+s,a),y=Math.min(n+o,l);if(p<0||y<0||!Th(t))return null;r=Math.max(0,-r),n=Math.max(0,-n);const{pixels:v}=t,x=s*o,I=v.length,P=[];for(let V=0;V{const xe=ce instanceof Float32Array||ce instanceof Float64Array?0:.5;for(let Pe=0;Pe0){const[mt,Pt]=Jg(k,Z,e,l),[$t,Ct]=Jg(P,F,e,l);xe.push(mt),xe.push(Pt),xe.push(et),xe.push(Ze),xe.push($t),xe.push(Ct)}else{const[mt,Pt]=Jg(k,j,e,l),[$t,Ct]=Jg(V,Y,e,l),[Et,Ft]=Jg(ie,ce,e,l);Pe.push(et),Pe.push(Ze),Pe.push(Et),Pe.push(Ft),Pe.push($t),Pe.push(Ct),Pe.push(mt),Pe.push(Pt)}Z+=s,F+=s,j+=s,Y+=s,ce+=s}const[ke,J]=Jg(c+I,h+o,e,l),de=(r/2+p)*x,[Se,Ie]=Jg(c+de,h+o,e,l),[Re,Oe]=Jg(c+I,h-a,e,l),[Ge,Be]=Jg(c+de,h-a,e,l);return{pennants:xe,barbs:Pe,shaft:[ke,J,Se,Ie,Re,Oe,Ge,Be]}}function Jg(t,e,i,r=1){const n=Math.sqrt(t*t+e*e)/r,s=(2*Math.PI+Math.atan2(e,t))%(2*Math.PI);return[n,(2*Math.PI+s-i)%(2*Math.PI)]}const aae=[0,1,3,6,10,16,21,27,33,40,47,55,63],QYt=[0,.5,1,1.5,2],eXt=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function $5(t,e,i,r){const n=sae(r||"knots",i);let s;for(s=1;sY>0).length:y*v,k=new Float32Array(F*l),j=new Uint32Array(c*F),V=e.invertDirection?rKe(0,0,0,!1):JYt;for(let Y=0;Y=CCe){const F=(a[I]+360)%360/180*Math.PI,{pennants:k,barbs:j,shaft:V}=TCe[Math.min(Math.floor(P/5),29)];if(k.length+j.length===0)continue;let Y=c.length/l;const X=(x+.5)/r,Z=(v+.5)/n;for(let ie=0;ie=(he-ie)*(_e-ce)*(1-n)){F[Z]=1;const[xe,Pe]=oae([I[Z]/X,P[Z]/X]);I[Z]=xe,P[Z]=Pe}else F[Z]=0,I[Z]=0,P[Z]=0}const j=new dn({width:y,height:v,pixels:[I,P],mask:F});return j.updateStatistics(),j}let lae=class{constructor(e,i){this._storage=new pxe,this._storage.maxSize=e,i&&this._storage.registerRemoveFunc("",i)}put(e,i){this._storage.put(e,i,1,1)}pop(e){return this._storage.pop(e)}get(e){return this._storage.get(e)}clear(){this._storage.clearAll()}destroy(){this._storage.destroy()}};function sXt(t){return typeof t=="function"}function gB(t,e,i,r){return sXt(t)?t(e,i,r):t}const oXt=` /-, +`;function sKe(t){let e=t.length;for(;e--;)if(!oXt.includes(t.charAt(e)))return!1;return!0}function oKe(t,e){const i=[];let r=0,n=-1;do if(n=t.indexOf("[",r),n>=r){if(n>r){const s=t.substr(r,n-r);i.push([s,null,sKe(s)])}if(r=n+1,n=t.indexOf("]",r),n>=r){if(n>r){const s=e[t.substr(r,n-r)];s&&i.push([null,s,!1])}r=n+1}}while(n!==-1);if(raKe(n,r,i)}function lKe(t,e){switch(typeof t!="string"&&(t=String(t)),e){case"LowerCase":return t.toLowerCase();case"Allcaps":return t.toUpperCase();default:return t}}function lXt(t,e,i,r,n,s,o=!0){const a=e/n,l=i/s,c=Math.ceil(a/2),h=Math.ceil(l/2);for(let p=0;p=-1&&xe<=1&&(x=2*xe*xe*xe-3*xe*xe+1,x>0&&(_e=4*(he+X*e),V+=x*t[_e+3],P+=x,t[_e+3]<255&&(x=x*t[_e+3]/250),F+=x*t[_e],k+=x*t[_e+1],j+=x*t[_e+2],I+=x))}}r[v]=F/I,r[v+1]=k/I,r[v+2]=j/I,r[v+3]=V/P}}function W1(t){return t?{r:t[0],g:t[1],b:t[2],a:t[3]/255}:{r:0,g:0,b:0,a:0}}function uXt(t){return t!=null&&(t.type==="CIMMarkerPlacementAlongLineRandomSize"||t.type==="CIMMarkerPlacementAlongLineSameSize"||t.type==="CIMMarkerPlacementAlongLineVariableSize"||t.type==="CIMMarkerPlacementAtExtremities"||t.type==="CIMMarkerPlacementAtMeasuredUnits"||t.type==="CIMMarkerPlacementAtRatioPositions"||t.type==="CIMMarkerPlacementOnLine"||t.type==="CIMMarkerPlacementOnVertices")}const Do=(t,e=0)=>t==null||isNaN(t)?e:t,uae=t=>t.tintColor?W1(t.tintColor):{r:255,g:255,b:255,a:1},cXt=t=>{if(!t)return!1;for(const e of t)switch(e.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectOffset":case"CIMGeometricEffectDonut":return!0}return!1};function hXt(){return Promise.resolve().then(()=>pZ)}function dXt(t){if(!t)return"normal";switch(t.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function pXt(t){if(!t)return"normal";switch(t.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function uKe(t){let e="",i="";if(t){const r=t.toLowerCase();r.includes("italic")?e="italic":r.includes("oblique")&&(e="oblique"),r.includes("bold")?i="bold":r.includes("light")&&(i="lighter")}return{style:e,weight:i}}function cKe(t){return t.underline?"underline":t.strikethrough?"line-through":"none"}function B5(t){if(!t)return null;switch(t.type){case"CIMPolygonSymbol":if(t.symbolLayers)for(const e of t.symbolLayers){const i=B5(e);if(i!=null)return i}break;case"CIMTextSymbol":return B5(t.symbol);case"CIMSolidFill":return t.color}}function V5(t){if(t)switch(t.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const e=t.symbolLayers;if(e)for(const i of e){const r=V5(i);if(r!=null)return r}break}case"CIMTextSymbol":return V5(t.symbol);case"CIMSolidStroke":case"CIMSolidFill":return t.color}}function sY(t){if(t)switch(t.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(t.symbolLayers)for(const e of t.symbolLayers){const i=sY(e);if(i!==void 0)return i}break;case"CIMTextSymbol":return sY(t.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return t.width}}function hKe(t){switch(t){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function dKe(t){switch(t){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function fXt(t){return(t?Object.keys(t):[]).map(e=>({name:e,alias:e,type:typeof t[e]=="string"?"esriFieldTypeString":"esriFieldTypeDouble"}))}const yB=t=>t.includes("data:image/svg+xml");new lae(1e3),new en([128,128,128]);const mXt=new en("white");function vB(t,e){if(!t)return null;let i=null;return _R(t)?i=gXt(t):mse(t)&&(i=t.color?new en(t.color):null),i?oY(i,e):null}function gXt(t){const e=t.symbolLayers;if(!e)return null;let i=null;return e.forEach(r=>{r.type==="object"&&r.resource?.href!=null||(i=r.type==="water"?r.color:ve(r.material)?r.material.color:null)}),i?new en(i):null}function oY(t,e){if(e==null||t==null)return t;const i=t.toRgba();return i[3]=i[3]*e,new en(i)}function yXt(t,e,i){const r=t.symbolLayers;if(!r)return;const n=s=>{const o=ve(s)?s:null;return oY(e=e??o??(i!=null?mXt:null),i)};r.forEach(s=>{if(s.type!=="object"||s.resource?.href==null||e)if(s.type==="water")s.color=n(s.color);else{const o=ve(s.material)?s.material.color:null,a=n(o);lt(s.material)?s.material=new F1({color:a}):s.material.color=a,i!=null&&"outline"in s&&ve(s.outline)&&ve(s.outline.color)&&(s.outline.color=oY(s.outline.color,i))}})}function vXt(t,e,i){(e=e??t.color)&&(t.color=oY(e,i)),i!=null&&"outline"in t&&t.outline&&t.outline.color&&(t.outline.color=oY(t.outline.color,i))}function ICe(t,e,i){t&&(e||i!=null)&&(e&&(e=new en(e)),_R(t)?yXt(t,e,i):mse(t)&&vXt(t,e,i))}async function _Xt(t,e){const i=t.symbolLayers;i&&await B6t(i,async r=>bXt(r,e))}async function bXt(t,e){switch(t.type){case"extrude":xXt(t,e);break;case"icon":case"line":case"text":wXt(t,e);break;case"path":CXt(t,e);break;case"object":await SXt(t,e)}}function wXt(t,e){const i=pKe(e);ve(i)&&(t.size=i)}function pKe(t){for(const e of t)if(typeof e=="number")return e;return null}function xXt(t,e){t.size=typeof e[2]=="number"?e[2]:0}async function SXt(t,e){const{resourceSize:i,symbolSize:r}=await TXt(t),n=fKe(e,i,r);t.width=aY(e[0],r[0],i[0],n),t.depth=aY(e[1],r[1],i[1],n),t.height=aY(e[2],r[2],i[2],n)}function CXt(t,e){const i=fKe(e,fne,[t.width,void 0,t.height]);t.width=aY(e[0],t.width,1,i),t.height=aY(e[2],t.height,1,i)}function fKe(t,e,i){for(let r=0;r<3;r++){const n=t[r];switch(n){case"symbol-value":{const s=i[r];return s!=null?s/e[r]:1}case"proportional":break;default:if(n&&e[r])return n/e[r]}}return 1}async function TXt(t){const e=await Promise.resolve().then(()=>Bji),i=await e.computeObjectLayerResourceSize(t,10),{width:r,height:n,depth:s}=t,o=[r,s,n];let a=1;for(let l=0;l<3;l++){const c=o[l];if(c!=null){a=c/i[l];break}}for(let l=0;l<3;l++)o[l]==null&&(o[l]=i[l]*a);return{resourceSize:i,symbolSize:o}}function aY(t,e,i,r){switch(t){case"proportional":return i*r;case"symbol-value":return e??i;default:return t}}function EXt(t,e){const i=pKe(e);if(!lt(i))switch(t.type){case"simple-marker":t.size=i;break;case"picture-marker":{const r=t.width/t.height;r>1?(t.width=i,t.height=i*r):(t.width=i*r,t.height=i);break}case"simple-line":t.width=i;break;case"text":t.font.size=i}}async function mKe(t,e){if(t&&e)return _R(t)?_Xt(t,e):void(mse(t)&&EXt(t,e))}function gKe(t,e,i){if(t&&e!=null)if(_R(t)){const r=t.symbolLayers;r&&r.forEach(n=>{if(n&&n.type==="object")switch(i){case"tilt":n.tilt=e;break;case"roll":n.roll=e;break;default:n.heading=e}})}else mse(t)&&(t.type!=="simple-marker"&&t.type!=="picture-marker"&&t.type!=="text"||(t.angle=e))}async function IXt(t,e){return await t.fetchSymbol(e)||t.fetchCIMSymbol(e)}var ACe;const yKe=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),cae=new Ks({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"}),hae=new Ks({flow_from:"flow-from",flow_to:"flow-to"});let u0=ACe=class extends SR(Ui){constructor(t){super(t),this.attributeField="Magnitude",this.flowRepresentation="flow-from",this.rotationType="arithmetic",this.style="single-arrow",this.symbolTileSize=50,this.type="vector-field"}readInputUnit(t,e){return yKe.has(t)?H1.fromJSON(t):null}readOutputUnit(t,e){return yKe.has(t)?H1.fromJSON(t):null}get styleRenderer(){const t=this.style,e=this.attributeField,i=this._createStyleRenderer(t);return i.field=e,i}get sizeVariables(){const t=[];if(this.visualVariables)for(const e of this.visualVariables)e.type==="size"&&t.push(e);if(t.length===0){const e=new s5({field:"Magnitude",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize});this.visualVariables?this.visualVariables.push(e):this._set("visualVariables",[e]),t.push(e)}return t}get rotationVariables(){const t=[];if(this.visualVariables)for(const e of this.visualVariables)e.type==="rotation"&&t.push(e);if(t.length===0){const e=new Cse({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(e):this._set("visualVariables",[e]),t.push(e)}return t}clone(){return new ACe({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:gi(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(t,e=!1,i=[]){const r=new Array,n=sae(this.inputUnit,this.outputUnit),s=this.rotationVariables[0]?.rotationType||this.rotationType,o=e?mB(t.pixelBlock,"vector-uv",s,n):XYt(t.pixelBlock,"vector-magdir",n);if(lt(o))return r;const a=t.extent,l=ve(o.mask)&&o.mask.length>0;let c=0;const h=(a.xmax-a.xmin)/o.width,p=(a.ymax-a.ymin)/o.height;for(let y=0;yP.intersects(x));if((!l||o.mask[c])&&!I){const P={Magnitude:o.pixels[0][c],Direction:o.pixels[1][c]},F=new io({geometry:{type:"point",x:x.x,y:x.y,spatialReference:a.spatialReference},attributes:P});F.symbol=this._getVisualVariablesAppliedSymbol(F),r.push(F)}}return r}getSymbol(t,e){}async getSymbolAsync(t,e){}getSymbols(){return[]}getClassBreakInfos(){return this.styleRenderer?.classBreakInfos}getDefaultSymbol(){return this.styleRenderer?.defaultSymbol}_getDefaultSymbol(t){return new wd({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new Mm({width:0}),size:20,color:t||new en([0,92,230])})}_getVisualVariablesAppliedSymbol(t){if(!t)return;const e=this.styleRenderer?.getSymbol(t)?.clone(),i=this.sizeVariables,r=this.rotationVariables;if(i&&i.length&&this.sizeVariables.forEach(n=>mKe(e,pze([n],t))),r&&r.length){const n=this.flowRepresentation==="flow-to"==(this.style==="ocean-current-kn"||this.style==="ocean-current-m")?0:180;t.attributes.Direction=t.attributes.Direction+n,this.rotationVariables.forEach(s=>gKe(e,oxe(s,t),s.axis))}return e}_createStyleRenderer(t){let e={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(t){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 o5(e)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const t=[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 en([214,47,39])),classBreakInfos:this._getClassBreaks(t,e)}}_createBeaufortMeterRenderer(){const t=[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 en([214,47,39])),classBreakInfos:this._getClassBreaks(t,e)}}_createBeaufortFeetRenderer(){const t=this._getDefaultSymbol(new en([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 i=[[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:t,classBreakInfos:this._getClassBreaks(e,i)}}_createBeaufortMilesRenderer(){const t=this._getDefaultSymbol(new en([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 i=[[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:t,classBreakInfos:this._getClassBreaks(e,i)}}_createBeaufortKilometersRenderer(){const t=this._getDefaultSymbol(new en([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 i=[[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:t,classBreakInfos:this._getClassBreaks(e,i)}}_createCurrentMeterRenderer(){const t=[0,.5,1,1.5,2],e=[[78,26,153],[179,27,26],[202,128,26],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new en([177,177,177])),classBreakInfos:this._getClassBreaks(t,e)}}_createCurrentKnotsRenderer(){const t=[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 en([177,177,177])),classBreakInfos:this._getClassBreaks(t,e)}}_createClassifiedArrowRenderer(){const t=this._getDefaultSymbol(new en([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 i=[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]];return{defaultSymbol:t,classBreakInfos:this._getClassBreaks(e,i)}}_createSimpleScalarRenderer(){return{defaultSymbol:dA.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 t=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="}],i=dA.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=t.map((n,s)=>{let o;if(s!==t.length-1)if(s===0)o={minValue:n,maxValue:t[s+1],symbol:i};else{const a=dA.fromJSON({type:"esriPMS",imageData:e[s].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});o={minValue:n,maxValue:t[s+1],symbol:a}}return new S9(o)});return{defaultSymbol:i,classBreakInfos:r}}_getClassBreaks(t,e){return e.map((i,r)=>new S9({minValue:t[r],maxValue:t[r+1],symbol:this._getDefaultSymbol(new en(i))}))}};E([N({type:String,json:{write:!0}})],u0.prototype,"attributeField",void 0),E([N({type:hae.apiValues,json:{type:hae.jsonValues,read:{reader:hae.read},write:{writer:hae.write}}})],u0.prototype,"flowRepresentation",void 0),E([N({type:["geographic","arithmetic"],json:{write:!0}})],u0.prototype,"rotationType",void 0),E([N({type:cae.apiValues,json:{type:cae.jsonValues,read:{reader:cae.read},write:{writer:cae.write}}})],u0.prototype,"style",void 0),E([N({json:{write:!0}})],u0.prototype,"symbolTileSize",void 0),E([N({type:H1.apiValues,json:{type:H1.jsonValues,write:{writer:H1.write}}})],u0.prototype,"inputUnit",void 0),E([Vi("inputUnit")],u0.prototype,"readInputUnit",null),E([N({type:H1.apiValues,json:{type:H1.jsonValues,read:{reader:H1.read},write:{writer:H1.write}}})],u0.prototype,"outputUnit",void 0),E([Vi("outputUnit")],u0.prototype,"readOutputUnit",null),E([rn({vectorField:"vector-field"})],u0.prototype,"type",void 0),E([N({type:o5})],u0.prototype,"styleRenderer",null),E([N({type:s5})],u0.prototype,"sizeVariables",null),E([N({type:Cse})],u0.prototype,"rotationVariables",null),u0=ACe=E([dt("esri.renderers.VectorFieldRenderer")],u0);const PCe=u0,lY={key:"type",base:null,typeMap:{"unique-value":WC,"class-breaks":o5,"raster-colormap":fCe,"raster-stretch":yCe,"vector-field":PCe,"raster-shaded-relief":$Xe,flow:xXe}},dae={...lY,typeMap:{...lY.typeMap}};delete dae.typeMap["vector-field"],delete dae.typeMap.flow;const AXt={uniqueValue:WC,classBreaks:o5,rasterStretch:yCe,rasterColormap:fCe,vectorField:PCe,rasterShadedRelief:$Xe,flowRenderer:xXe};function PXt(t){return t&&AXt[t.type]||null}function vKe(t,e){if(!t)return null;if(t.type==="classBreaks"&&t.classificationMethod){const r=t.authoringInfo||{classificationMethod:""};r.classificationMethod=t.classificationMethod,t.authoringInfo=r}t.type==="vectorField"&&t.visualVariables&&!Array.isArray(t.visualVariables)&&(t.visualVariables=[t.visualVariables]);const i=PXt(t);if(i){const r=new i;return r.read(t,e),r}return e&&e.messages&&t&&e.messages.push(new Am("renderer:unsupported","Renderers of type '"+(t.type||"unknown")+"' are not supported",{definition:t,context:e})),null}var OCe;let j5=OCe=class extends Ui{constructor(t){super(t),this.variableName=null,this.dimensionName=null,this.values=[],this.isSlice=!1}clone(){return new OCe({variableName:this.variableName,dimensionName:this.dimensionName,values:gi(this.values),isSlice:this.isSlice})}};E([N({type:String,json:{write:!0}})],j5.prototype,"variableName",void 0),E([N({type:String,json:{write:!0}})],j5.prototype,"dimensionName",void 0),E([N({type:FH.array(FH.oneOf([FH.native(Number),FH.array(FH.native(Number))])),json:{write:!0}})],j5.prototype,"values",void 0),E([N({type:Boolean,json:{write:!0}})],j5.prototype,"isSlice",void 0),j5=OCe=E([dt("esri.layers.support.DimensionalDefinition")],j5);const iM=j5;var RCe;const pae=new Set(["raster","raster2","dem","fillraster"]),fae=new Set(["rasters"]),_Ke=t=>t&&t.rasterFunction?l_.fromJSON(t):t,MCe=t=>t&&t instanceof l_?t.toJSON():t,DCe=t=>t?.functionName&&!t.declaredClass,bKe=t=>DCe(t)?new l_(t):t,OXt=t=>{if(t==null)return null;t=gi(t);const e={};for(const i of Object.keys(t))pae.has(i.toLowerCase())?e[i]=_Ke(t[i]):fae.has(i.toLowerCase())&&Array.isArray(t[i])?e[i]=t[i].map(_Ke):e[i]=t[i];return e};let l_=RCe=class extends Ui{constructor(t){super(t),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.rasterFunctionDefinition=null}set functionArguments(t){if(t){const e=Object.keys(t);if(e.some(i=>pae.has(i.toLowerCase())&&DCe(t[i]))||e.some(i=>fae.has(i.toLowerCase())&&Array.isArray(t[i])&&t[i].some(r=>DCe(r)))){t=gi(t);for(const i of e)pae.has(i.toLowerCase())?t[i]=bKe(t[i]):fae.has(i.toLowerCase())&&Array.isArray(t[i])&&(t[i]=t[i].map(r=>bKe(r)))}}this._set("functionArguments",t)}readFunctionArguments(t){return OXt(t)}writeFunctionArguments(t,e,i){const r={};for(const n of Object.keys(t))pae.has(n.toLowerCase())?r[n]=MCe(t[n]):fae.has(n.toLowerCase())&&Array.isArray(t[n])?r[n]=t[n].map(MCe):r[n]=MCe(t[n]);e[i]=r}readFunctionName(t,e){const i=e.rasterFunctionInfos;return e.name||(i&&i.length&&i[0].name!=="None"?i[0].name:e.rasterFunctionDefinition?e.rasterFunctionDefinition.name:e.rasterFunction)}clone(){return new RCe({functionName:this.functionName,functionArguments:gi(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:gi(this.rasterFunctionDefinition)})}};E([N({json:{type:Object,name:"rasterFunctionArguments"}})],l_.prototype,"functionArguments",null),E([Vi("functionArguments")],l_.prototype,"readFunctionArguments",null),E([Cr("functionArguments")],l_.prototype,"writeFunctionArguments",null),E([N({json:{type:String,write:{target:"rasterFunction"}}})],l_.prototype,"functionName",void 0),E([Vi("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],l_.prototype,"readFunctionName",null),E([rn({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}),N({json:{default:"unknown"}})],l_.prototype,"outputPixelType",void 0),E([N({type:String,json:{read:!0,write:!0}})],l_.prototype,"variableName",void 0),E([N({type:Object,json:{name:"rasterFunctionDefinition"}})],l_.prototype,"rasterFunctionDefinition",void 0),l_=RCe=E([dt("esri.layers.support.RasterFunction")],l_);const pu=l_,RXt={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:""}},MXt=new Set(["u1","u2","u4","u8","s8","u16","s16"]),DXt={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)"},FXt=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function wKe(t){return FXt.has(t.type)}function FCe(t,e){if(!t||!e)return gi(t||e);const i=gi(t);if(i.rasterFunctionDefinition&&e.rasterFunctionDefinition){const r=e.rasterFunctionDefinition;(r.thumbnail||r.thumbnailEx)&&(r.thumbnail=r.thumbnailEx=void 0),xKe(i.rasterFunctionDefinition.arguments,e)}else e.functionName?.toLowerCase()!=="none"&&(SKe(i.functionArguments).Raster=e);return i}function xKe(t,e){for(const i in t)i.toLowerCase()==="raster"&&(t[i].type==="RasterFunctionVariable"?(t[i]=e.rasterFunctionDefinition,t[i].type="RasterFunctionTemplate"):t[i].type==="RasterFunctionTemplate"&&xKe(t[i].arguments,e))}function nT(t){const e=gi(RXt[t.functionName+"Function"]),i=t.functionArguments;for(const r in i)r.toLowerCase()==="raster"?(e.arguments[r]=nT(i[r]),e.arguments[r].type="RasterFunctionTemplate"):r.toLowerCase()==="colormap"?(e.arguments[r].value=UXt(i[r]),e.arguments.ColorSchemeType.value=0):e.arguments[r].value=i[r];return e}function LXt(t,e){switch(e=e||{},t.type){case"raster-stretch":return $Xt(t,e);case"class-breaks":return BXt(t,e);case"unique-value":return VXt(t,e);case"raster-colormap":return jXt(t,e);case"vector-field":return NXt(t,e);case"raster-shaded-relief":return kXt(t,e);case"flow":throw new Error("Unsupported rendering rule.")}}function SKe(t){const e=t?.Raster;return e&&e.declaredClass==="esri.layers.support.RasterFunction"?SKe(e.functionArguments):t}const uY={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function NXt(t,e){const i=new pu;i.functionName="VectorFieldRenderer";const{dataType:r,bandProperties:n}=e,s=r==="vector-uv";let o,a;n&&n.length===2&&(o=n.map(y=>y.BandName.toLowerCase()).indexOf("magnitude"),a=n.map(y=>y.BandName.toLowerCase()).indexOf("direction")),o!==-1&&o!==null||(o=0,a=1);const l=t.rotationType==="arithmetic"?1:2,c=t.flowRepresentation==="flow-from"?0:1,h=t.visualVariables?t.visualVariables.find(y=>y.field==="Magnitude"):new s5,p={magnitudeBandID:o,directionBandID:a,isUVComponents:s,referenceSystem:l,massFlowAngleRepresentation:c,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:DXt[t.style.toLowerCase().replace("-","_")],minimumMagnitude:h.minDataValue,maximumMagnitude:h.maxDataValue,minimumSymbolSize:h.minSize,maximumSymbolSize:h.maxSize};return i.functionArguments=p,e.convertToRFT?new pu({rasterFunctionDefinition:nT(i)}):i}function kXt(t,e){const i=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 pu;const r=new pu;r.functionName="Hillshade";const n=t.hillshadeType==="traditional"?0:1,s=t.scalingType==="none"?1:3,o={HillshadeType:n,SlopeType:s,ZFactor:t.zFactor};return n===0&&(o.Azimuth=t.azimuth,o.Altitude=t.altitude),s===3&&(o.PSPower=t.pixelSizePower,o.PSZFactor=t.pixelSizeFactor),r.functionArguments=o,r.variableName="Raster",t.colorRamp&&(r.functionName="ShadedRelief",i?o.ColorRamp=LXe(t.colorRamp):o.Colormap=$A(t.colorRamp)),i?new pu({rasterFunctionDefinition:nT(r)}):r}function $Xt(t,e){const i=e.convertToRFT,r=new pu;r.functionName="Stretch";const n=uY[eY.toJSON(t.stretchType)],s="u8",o={StretchType:n,Statistics:GXt(t.statistics??[]),DRA:t.dynamicRangeAdjustment,UseGamma:t.useGamma,Gamma:t.gamma,ComputeGamma:t.computeGamma};if(t.outputMin!=null&&(o.Min=t.outputMin),t.outputMax!=null&&(o.Max=t.outputMax),n===uY.standardDeviation?(o.NumberOfStandardDeviations=t.numberOfStandardDeviations,r.outputPixelType=s):n===uY.percentClip?(o.MinPercent=t.minPercent,o.MaxPercent=t.maxPercent,r.outputPixelType=s):n===uY.minMax?r.outputPixelType=s:n===uY.sigmoid&&(o.SigmoidStrengthLevel=t.sigmoidStrengthLevel),r.functionArguments=o,r.variableName="Raster",t.colorRamp){const a=t.colorRamp,l=new pu;if(i)l.functionArguments={ColorRamp:LXe(a)};else{const c=MXe(a);if(c)l.functionArguments={colorRamp:c};else if(!e.convertColorRampToColormap||a.type!=="algorithmic"&&a.type!=="multipart"){const h=t.colorRamp.toJSON();h.type==="algorithmic"?h.algorithm=h.algorithm||"esriCIELabAlgorithm":h.type==="multipart"&&h.colorRamps?.length&&h.colorRamps.forEach(p=>p.algorithm=p.algorithm||"esriCIELabAlgorithm"),l.functionArguments={colorRamp:h}}else l.functionArguments={Colormap:$A(a)}}return l.variableName="Raster",l.functionName="Colormap",l.functionArguments.Raster=r,i?new pu({rasterFunctionDefinition:nT(l)}):l}return i?new pu({rasterFunctionDefinition:nT(r)}):r}function BXt(t,e){const i=[],r=[],n=[],s=[],{pixelType:a,rasterAttributeTable:l}=e,c=lt(l)?null:l.features,h=CKe(l);if(h&&c&&Array.isArray(c)&&t.classBreakInfos){t.classBreakInfos.forEach((P,F)=>{const k=P.symbol?.color;let j;k?.a&&P.minValue!=null&&P.maxValue!=null&&c.forEach(V=>{P.minValue!=null&&P.maxValue!=null&&(j=V.attributes[t.field],(j>=P.minValue&&j=P.minValue)&&s.push([V.attributes[h],k.r,k.g,k.b]))})});const x=a?mae(s,a):s,I=new pu;return I.functionName="Colormap",I.functionArguments={},I.functionArguments.Colormap=x,I.variableName="Raster",e.convertToRFT?new pu({rasterFunctionDefinition:nT(I)}):I}t.classBreakInfos.forEach((x,I)=>{if(x.minValue==null||x.maxValue==null)return;const P=x.symbol&&x.symbol.color;P?.a?(I===0?i.push(x.minValue,x.maxValue+1e-6):i.push(x.minValue+1e-6,x.maxValue+1e-6),r.push(I),s.push([I,P.r,P.g,P.b])):n.push(x.minValue,x.maxValue)});const p=a?mae(s,a):s,y=new pu;y.functionName="Remap",y.functionArguments={InputRanges:i,OutputValues:r,NoDataRanges:n},y.variableName="Raster";const v=new pu;return v.functionName="Colormap",v.functionArguments={Colormap:p,Raster:y},e.convertToRFT?new pu({rasterFunctionDefinition:nT(v)}):v}function mae(t,e){const i=MXt.has(e)?rT(e):null;return i&&t.push([Math.floor(i[0]-1),0,0,0],[Math.ceil(i[1]+1),0,0,0]),t}function CKe(t){if(lt(t))return;const{fields:e}=t,i=e&&e.find(r=>r&&r.name&&r.name.toLowerCase()==="value");return i&&i.name}function VXt(t,e){const i=[],{pixelType:r,rasterAttributeTable:n}=e,s=lt(n)?null:n.features,o=CKe(n),a=t.defaultSymbol?.color?.toRgb(),l=t.uniqueValueInfos;if(l)if(s){if(o){const p=new Map;l.forEach(v=>{const x=v.value,I=v.symbol?.color;x!=null&&I&&I.a&&p.set(String(x),I.toRgb())});const y=t.field;s.forEach(({attributes:v})=>{const x=String(v[y]),I=v[o],P=p.get(x);P?i.push([I,...P]):a&&i.push([I,...a])})}}else for(let p=0;p0?mae(i,r):i,h=new pu;return h.functionName="Colormap",h.functionArguments={},h.functionArguments.Colormap=c,h.variableName="Raster",e.convertToRFT?new pu({rasterFunctionDefinition:nT(h)}):h}function jXt(t,e){const i=t.extractColormap();if(!i||i.length===0)return null;const{pixelType:r}=e,n=r?mae(i,r):i,s=new pu;return s.functionName="Colormap",s.functionArguments={},s.functionArguments.Colormap=n,e.convertToRFT?new pu({rasterFunctionDefinition:nT(s)}):s}function GXt(t){const e=[];return t?.forEach(i=>{const r=i;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 UXt(t){const e=[],i=[];return t.forEach(r=>{e.push(r[0]),i.push(TYt([...r.slice(1),255]))}),{type:"RasterColormap",values:e,colors:i}}var LCe;const cY=ta()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),NCe=ta()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function zXt(t){let e;switch(t?t.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 NCe.fromJSON(e)}let Nm=LCe=class extends Ui{constructor(t){super(t),this.ascending=!0,this.itemRenderingRule=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(t,e){return e.ascending!=null?e.ascending:e.sortAscending==null||e.sortAscending}readMethod(t,e){return zXt(e.mosaicMethod||e.defaultMosaicMethod)}writeMultidimensionalDefinition(t,e,i){t!=null&&(t=t.filter(({variableName:r,dimensionName:n})=>r&&r!=="*"||n)).length&&(e[i]=t.map(r=>r.toJSON()))}readOperation(t,e){const i=e.mosaicOperation,r=e.mosaicOperator&&e.mosaicOperator.toLowerCase(),n=i||(r?cY.toJSON(r):null);return cY.fromJSON(n)||"first"}castSortValue(t){return t==null||typeof t=="string"||typeof t=="number"?t:`${t}`}clone(){return new LCe({ascending:this.ascending,itemRenderingRule:gi(this.itemRenderingRule),lockRasterIds:gi(this.lockRasterIds),method:this.method,multidimensionalDefinition:gi(this.multidimensionalDefinition),objectIds:gi(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:gi(this.viewpoint),where:this.where})}};E([N({type:Boolean,json:{write:!0}})],Nm.prototype,"ascending",void 0),E([Vi("ascending",["ascending","sortAscending"])],Nm.prototype,"readAscending",null),E([N({type:pu,json:{write:!0}})],Nm.prototype,"itemRenderingRule",void 0),E([N({type:[Ls],json:{write:{overridePolicy(){return{enabled:this.method==="lock-raster"}}}}})],Nm.prototype,"lockRasterIds",void 0),E([N({type:String,json:{type:NCe.jsonValues,write:{target:"mosaicMethod",writer:NCe.write}}})],Nm.prototype,"method",void 0),E([Vi("method",["mosaicMethod","defaultMosaicMethod"])],Nm.prototype,"readMethod",null),E([N({type:[iM],json:{write:!0}})],Nm.prototype,"multidimensionalDefinition",void 0),E([Cr("multidimensionalDefinition")],Nm.prototype,"writeMultidimensionalDefinition",null),E([N({type:[Ls],json:{name:"fids",write:!0}})],Nm.prototype,"objectIds",void 0),E([N({json:{type:cY.jsonValues,read:{reader:cY.read},write:{target:"mosaicOperation",writer:cY.write}}})],Nm.prototype,"operation",void 0),E([Vi("operation",["mosaicOperation","mosaicOperator"])],Nm.prototype,"readOperation",null),E([N({type:String,json:{write:{overridePolicy(){return{enabled:this.method==="attribute"}}}}})],Nm.prototype,"sortField",void 0),E([N({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:this.method==="attribute",allowNull:!0}}}}})],Nm.prototype,"sortValue",void 0),E([ho("sortValue")],Nm.prototype,"castSortValue",null),E([N({type:er,json:{write:!0}})],Nm.prototype,"viewpoint",void 0),E([N({type:String,json:{write:!0}})],Nm.prototype,"where",void 0),Nm=LCe=E([dt("esri.layers.support.MosaicRule")],Nm);const q1=Nm,BA=ta()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),hY=ta()({esriNoDataMatchAny:"any",esriNoDataMatchAll:"all"});let kp=class extends Ui{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,i,r){this.layer.version<10.3||(i[r]=e)}get bandIds(){return this.layer.bandIds}get compressionQuality(){return this.layer.compressionQuality}writeCompressionQuality(e,i,r){this.format&&this.format.toLowerCase().includes("jpg")&&e!=null&&(i[r]=e)}get compressionTolerance(){return this.layer.compressionTolerance}writeCompressionTolerance(e,i,r){this.format==="lerc"&&e!=null&&(i[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,i,r){this.format==="lerc"&&this.layer.version>=10.5&&(i[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("renderingRule"),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 i=e.mosaicRule;const r=e.definitionExpression;return i?r&&r!==i.where&&(i=i.clone(),i.where=r):r&&(i=new q1({where:r})),i}get renderingRule(){const e=this.layer;let i=e.renderingRule;const r=e.pixelFilter,n=!e.format||e.format.includes("jpg")||e.format.includes("png");i=this._addResampleRasterFunction(i);const s=e.multidimensionalSubset?.areaOfInterest;return s&&(i=this._addClipFunction(i,s)),n&&!r&&e.renderer?.type!=="vector-field"&&(i=this.combineRendererWithRenderingRule(i)),i}combineRendererWithRenderingRule(e){const i=this.layer,{rasterInfo:r,renderer:n}=i;return e=e||i.renderingRule,!n||!wKe(n)?e:FCe(LXt(n,{rasterAttributeTable:r.attributeTable,pixelType:r.pixelType,dataType:r.dataType,bandProperties:r.keyProperties?.BandProperties,convertColorRampToColormap:i.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 i=this.layer.serviceDataType==="esriImageServiceDataTypeVector-UV"?7:10,r=this.layer.serviceRasterInfo.pixelSize;let n=new pu({functionName:"Resample",functionArguments:{ResamplingType:i,InputCellSize:r}});return n=e?.rasterFunctionDefinition?new pu({rasterFunctionDefinition:nT(n)}):n,FCe(n,e)}_addClipFunction(e,i){const r=new pu({functionName:"Clip",functionArguments:{ClippingGeometry:i.toJSON(),ClippingType:1}});return FCe(r,e)}};E([N()],kp.prototype,"layer",void 0),E([N({json:{write:!0}})],kp.prototype,"adjustAspectRatio",null),E([Cr("adjustAspectRatio")],kp.prototype,"writeAdjustAspectRatio",null),E([N({json:{write:!0}})],kp.prototype,"bandIds",null),E([N({json:{write:!0}})],kp.prototype,"compression",void 0),E([N({json:{write:!0}})],kp.prototype,"compressionQuality",null),E([Cr("compressionQuality")],kp.prototype,"writeCompressionQuality",null),E([N({json:{write:!0}})],kp.prototype,"compressionTolerance",null),E([Cr("compressionTolerance")],kp.prototype,"writeCompressionTolerance",null),E([N({json:{write:!0}})],kp.prototype,"format",null),E([N({type:String,json:{read:{reader:BA.read},write:{writer:BA.write}}})],kp.prototype,"interpolation",null),E([N({json:{write:!0}})],kp.prototype,"noData",null),E([N({type:String,json:{read:{reader:hY.read},write:{writer:hY.write}}})],kp.prototype,"noDataInterpretation",null),E([N({json:{write:!0}})],kp.prototype,"pixelType",void 0),E([N({json:{write:!0}})],kp.prototype,"lercVersion",void 0),E([Cr("lercVersion")],kp.prototype,"writeLercVersion",null),E([N({type:Number})],kp.prototype,"version",null),E([N({json:{write:!0}})],kp.prototype,"mosaicRule",null),E([N({json:{write:!0}})],kp.prototype,"renderingRule",null),kp=E([dt("esri.layers.mixins.ExportImageServiceParameters")],kp);async function rM(t,e){try{return await createImageBitmap(t)}catch(i){throw new st("request:server",`Unable to load ${e}`,{url:e,error:i})}}var kCe;const HXt={base:un,key:"type",typeMap:{extent:Ar,polygon:To}};let G5=kCe=class extends Ui{constructor(t){super(t),this.areaOfInterest=null,this.subsetDefinitions=null}get dimensions(){const{subsetDefinitions:t}=this;if(t==null||t.length===0)return[];const e=new Map;t.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 i=[];for(const r of e)i.push({name:r[0],extent:r[1]});return i}get variables(){const{subsetDefinitions:t}=this;if(t==null||t.length===0)return[];const e=new Set;return t.forEach(i=>{i.variableName&&e.add(i.variableName)}),[...e]}clone(){const t=this.subsetDefinitions?.map(i=>i.clone()),e=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new kCe({areaOfInterest:e,subsetDefinitions:t})}};E([N({types:HXt,json:{read:Sl,write:!0}})],G5.prototype,"areaOfInterest",void 0),E([N({readOnly:!0})],G5.prototype,"dimensions",null),E([N({readOnly:!0})],G5.prototype,"variables",null),E([N({type:[iM],json:{write:!0}})],G5.prototype,"subsetDefinitions",void 0),G5=kCe=E([dt("esri.layers.support.MultidimensionalSubset")],G5);const TKe=G5;var $Ce;let Zg=$Ce=class extends Ui{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 $Ce({blockWidth:this.blockWidth,blockHeight:this.blockHeight,compression:this.compression,origin:gi(this.origin),firstPyramidLevel:this.firstPyramidLevel,maximumPyramidLevel:this.maximumPyramidLevel,pyramidResolutions:gi(this.pyramidResolutions),pyramidScalingFactor:this.pyramidScalingFactor,pyramidBlockWidth:this.pyramidBlockWidth,pyramidBlockHeight:this.pyramidBlockHeight,isVirtualTileInfo:this.isVirtualTileInfo,tileInfo:gi(this.tileInfo),transposeInfo:gi(this.transposeInfo),blockBoundary:gi(this.blockBoundary)})}};E([N({type:Number,json:{write:!0}})],Zg.prototype,"blockWidth",void 0),E([N({type:Number,json:{write:!0}})],Zg.prototype,"blockHeight",void 0),E([N({type:String,json:{write:!0}})],Zg.prototype,"compression",void 0),E([N({type:er,json:{write:!0}})],Zg.prototype,"origin",void 0),E([N({type:Number,json:{write:!0}})],Zg.prototype,"firstPyramidLevel",void 0),E([N({type:Number,json:{write:!0}})],Zg.prototype,"maximumPyramidLevel",void 0),E([N({json:{write:!0}})],Zg.prototype,"pyramidResolutions",void 0),E([N({type:Number,json:{write:!0}})],Zg.prototype,"pyramidScalingFactor",void 0),E([N({type:Number,json:{write:!0}})],Zg.prototype,"pyramidBlockWidth",void 0),E([N({type:Number,json:{write:!0}})],Zg.prototype,"pyramidBlockHeight",void 0),E([N({type:Boolean,json:{write:!0}})],Zg.prototype,"isVirtualTileInfo",void 0),E([N({json:{write:!0}})],Zg.prototype,"tileInfo",void 0),E([N()],Zg.prototype,"transposeInfo",void 0),E([N()],Zg.prototype,"blockBoundary",void 0),Zg=$Ce=E([dt("esri.layers.support.RasterStorageInfo")],Zg);const U5=Zg;var BCe;let Td=BCe=class extends Ui{constructor(t){super(t),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 dataType(){const t=this.keyProperties?.DataType?.toLowerCase()??"generic";return t==="stdtime"?"standard-time":t}get nativeExtent(){return this._get("nativeExtent")||this.extent}set nativeExtent(t){t&&this._set("nativeExtent",t)}get nativePixelSize(){if(lt(this.transform)||!this.transform.affectsPixelSize)return this.pixelSize;const t=this.nativeExtent;return{x:t.width/this.width,y:t.height/this.height}}get hasMultidimensionalTranspose(){return!!this.storageInfo?.transposeInfo}clone(){return new BCe({attributeTable:gi(this.attributeTable),bandCount:this.bandCount,colormap:gi(this.colormap),extent:gi(this.extent),nativePixelSize:gi(this.nativePixelSize),format:this.format,height:this.height,width:this.width,histograms:gi(this.histograms),keyProperties:gi(this.keyProperties),multidimensionalInfo:gi(this.multidimensionalInfo),noDataValue:this.noDataValue,pixelSize:gi(this.pixelSize),pixelType:this.pixelType,isPseudoSpatialReference:this.isPseudoSpatialReference,spatialReference:gi(this.spatialReference),statistics:gi(this.statistics),storageInfo:gi(this.storageInfo),transform:gi(this.transform)})}};E([N({json:{write:!0}})],Td.prototype,"attributeTable",void 0),E([N({json:{write:!0}})],Td.prototype,"bandCount",void 0),E([N({json:{write:!0}})],Td.prototype,"colormap",void 0),E([N({type:String,readOnly:!0})],Td.prototype,"dataType",null),E([N({type:Ar,json:{write:!0}})],Td.prototype,"extent",void 0),E([N({type:Ar,json:{write:!0}})],Td.prototype,"nativeExtent",null),E([N({json:{write:!0}})],Td.prototype,"nativePixelSize",null),E([N({json:{write:!0}})],Td.prototype,"format",void 0),E([N({json:{write:!0}})],Td.prototype,"height",void 0),E([N({json:{write:!0}})],Td.prototype,"width",void 0),E([N({json:{write:!0}})],Td.prototype,"hasMultidimensionalTranspose",null),E([N({json:{write:!0}})],Td.prototype,"histograms",void 0),E([N({json:{write:!0}})],Td.prototype,"keyProperties",void 0),E([N({json:{write:!0}})],Td.prototype,"multidimensionalInfo",void 0),E([N({json:{write:!0}})],Td.prototype,"noDataValue",void 0),E([N({json:{write:!0}})],Td.prototype,"pixelSize",void 0),E([N({json:{write:!0}})],Td.prototype,"pixelType",void 0),E([N()],Td.prototype,"isPseudoSpatialReference",void 0),E([N({type:hr,json:{write:!0}})],Td.prototype,"spatialReference",void 0),E([N({json:{write:!0}})],Td.prototype,"statistics",void 0),E([N({type:U5,json:{write:!0}})],Td.prototype,"storageInfo",void 0),E([N({json:{write:!0}})],Td.prototype,"transform",void 0),Td=BCe=E([dt("esri.layers.support.RasterInfo")],Td);const O2=Td;let EKe=class{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const e=await bA("RasterWorker");this._destroyed?e.close():this._workerThread=e}destroy(){this._destroyed=!0,this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(e,i){if(!this._workerThread)throw new st("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:e.pixelBlock.toJSON(),type:e.dataType},i);return r?new dn(r):null}async decode(e,i){if(!this._workerThread)throw new st("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("decode",e,i);return r?new dn(r):null}async symbolize(e,i){if(!this._workerThread)throw new st("raster-jobhandler:no-connection","no available worker connection");const r={extent:e.extent&&e.extent.toJSON(),pixelBlock:ve(e.pixelBlock)&&e.pixelBlock.toJSON(),simpleStretchParams:e.simpleStretchParams,bandIds:e.bandIds},n=await this._workerThread.invoke("symbolize",r,i);return n?new dn(n):null}async updateSymbolizer(e,i){if(!this._workerThread)throw new st("raster-jobhandler:no-connection","no available worker connection");const r=e?.rendererJSON?.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:e.toJSON(),histograms:r},i))}async updateRasterFunction(e,i){if(!this._workerThread)throw new st("raster-jobhandler:no-connection","no available worker connection");await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:e.toJSON()},i))}async process(e,i){if(!this._workerThread)throw new st("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("process",{extent:e.extent?.toJSON(),primaryPixelBlocks:e.primaryPixelBlocks.map(n=>ve(n)?n.toJSON():null),primaryRasterIds:e.primaryRasterIds},i);return r?new dn(r):null}async stretch(e,i){if(!this._workerThread)throw new st("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,i);return n?new dn(n):null}async split(e,i){if(!this._workerThread)throw new st("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},n=await this._workerThread.invoke("split",r,i);return n&&n.forEach((s,o)=>{n.set(o,s?dn.fromJSON(s):null)}),n}async estimateStatisticsHistograms(e,i){if(!this._workerThread)throw new st("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,i)}async mosaicAndTransform(e,i){if(!this._workerThread)throw new st("raster-jobhandler:no-connection","no available worker connection");if(!e?.srcPixelBlocks?.length)return{pixelBlock:null};const r={...e,srcPixelBlocks:e.srcPixelBlocks.map(s=>ve(s)?s.toJSON():null)},n=await this._workerThread.invoke("mosaicAndTransform",r,i);return{pixelBlock:n.pixelBlock?new dn(n.pixelBlock):null,localNorthDirections:n.localNorthDirections}}async createFlowMesh(e,i){if(!this._workerThread)throw new st("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},{...i,transferList:[r.buffer,r.maskBuffer]});return{vertexData:new Float32Array(o.vertexBuffer),indexData:new Uint32Array(o.indexBuffer)}}getProjectionOffsetGrid(e,i){if(!this._workerThread)throw new st("raster-jobhandler:no-connection","no available worker connection");const r=ve(e.datumTransformation)?e.datumTransformation.steps.map(o=>({wkid:o.wkid,wkt:o.wkt,isInverse:o.isInverse})):null,n=ve(e.rasterTransform)?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,i)}};function IKe(t,e,i){const r=e.shift();if(i.length===0){const s=[];i.push({sliceId:-1,multidimensionalDefinition:s})}const n=i.length;for(let s=0;s{i.push({sliceId:-1,multidimensionalDefinition:[...o,{variableName:t,dimensionName:r.name,values:[a]}]})})}e.length&&IKe(t,e,i)}function WXt(t,e){const i=[];let r=0;return(e?t.variables.filter(n=>n.name.toLowerCase()===e.toLowerCase()):[...t.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);IKe(n.name,o,s),s.forEach(a=>{i.push({...a,sliceId:r++})})}),i}function qXt(t,e,i){let r=t;if(e&&(e=[...e].sort((n,s)=>n.dimensionName{s.length&&(r=r.filter(a=>{const l=a.multidimensionalDefinition.find(h=>h.dimensionName===n);if(l==null)return!1;const c=l.values[0];return typeof c=="number"?typeof s[0]=="number"?s.includes(c):s.some(h=>h[0]<=c&&h[1]>=c):typeof s[0]=="number"?s.some(h=>c[0]<=h&&c[1]>=h):o?s.some(h=>h[0]===c[0]&&h[0]===c[1]):s.some(h=>h[0]>=c[0]&&h[0]<=c[1]||h[1]>=c[0]&&h[1]<=c[1]||h[0]c[1])}))}),r.length&&i&&ve(i.start)&&ve(i.end)){const n=i.start.getTime(),s=i.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 AKe(t,e){return Array.isArray(t)?e[0]===e[1]?t[0]===e[0]||t[1]===e[0]:t[0]>=e[0]&&t[0]<=e[1]&&t[1]>=e[0]&&t[1]<=e[1]:t>=e[0]&&t<=e[1]}function YXt(t,e){return t[0]<=e[0]&&t[1]>=e[0]||t[0]<=e[1]&&t[1]>=e[1]||t[0]>=e[0]&&t[1]<=e[1]}function PKe(t){return t.length===1?[t[0],t[0]]:[t[0],t[t.length-1]]}function OKe(t,e,i){if(!e?.subsetDefinitions?.length)return t;let r;if(i){const{variables:o}=e;if(o.length&&!o.includes(i))return null;const a=e.subsetDefinitions.find(l=>l.dimensionName===t.name&&l.variableName===i);if(!a?.values?.length)return t;r=PKe(a.values)}else r=e.dimensions.find(({name:o})=>o===t.name)?.extent;const n=r;if(!n||!n?.length)return t;const s=t.values.filter(o=>AKe(o,n));return{...t,extent:[...n],values:s}}function dY(t,e,i){if(!e?.subsetDefinitions?.length)return!1;const{variables:r}=e;if(r.length&&t.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=PKe(o.values);if(!s.isSlice&&s.values.length===2&&!Array.isArray(s.values[0])&&s.values[0]!==s.values[1]&&i){if(!YXt(s.values,a))return!0}else if(s.values.some(l=>!AKe(l,a)))return!0}}return!1}function VCe(t,e){if(lt(t))return{isOutside:!1};const{geometry:i,timeExtent:r,multidimensionalDefinition:n}=e;let s=null;if(ve(r)&&(s=XXt(t,r),lt(s)))return{isOutside:!0};const{areaOfInterest:o}=t;if(o&&i){const a=i.type==="point"?i:i.type==="extent"?i.center:i.type==="polygon"?i.centroid:null;if(a&&!o.contains(a))return{isOutside:!0}}return ve(n)&&n.length&&dY(n,t,!0)?{isOutside:!0}:{isOutside:!1,intersection:{geometry:i,timeExtent:s,multidimensionalDefinition:n}}}function XXt(t,e){const i=t.dimensions.find(({name:o})=>o==="StdTime");if(i==null||lt(e.start)&<(e.end))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&&i?.extent.length&&(s[0]=Math.max(s[0],i.extent[0]),s[1]=Math.min(s[1],i.extent[1]??i.extent[0]),s[1]s.variables.includes(h))),l?c.find(({name:h})=>h===l)??c[0]:c[0]}function GCe(t,e={}){const i=jCe(t,e);if(!i)return null;const r=[],{dimensions:n,name:s}=i;if(n.length===0)return[new iM({variableName:s,dimensionName:"",values:[],isSlice:!0})];for(let o=0;o{if(e.values==null)return!0;const i=e.values.length;return i===0||i>1||!e.isSlice&&Array.isArray(e.values[0])})}function MKe(t,e){if(lt(e)||lt(t))return null;let i=e.variables.map(r=>({...r}));return t?.variables?.length&&(i=i.filter(({name:r})=>t.variables.includes(r)),i.forEach(r=>{r.dimensions=r.dimensions.map(n=>OKe(n,t,r.name)).filter(ve)})),i}function KXt(t,e){const{values:i}=e;if(i?.length)return Array.isArray(i[0])!==Array.isArray(t)?-1:Array.isArray(i[0])?i.findIndex(a=>a[0]===t[0]&&a[1]===t[1]):i.indexOf(t);const{extent:r}=e;if(Array.isArray(t)||tr[1])return-1;const n=e.interval||1;if(e.unit!=="ISO8601")return Math.round((t-r[0])/n);const s=r[0];let o=-1;switch(e.intervalUnit?.toLowerCase()||"seconds"){case"seconds":o=Math.round((t-s)/1e3/n);break;case"minutes":o=Math.round((t-s)/6e4/n);break;case"hours":o=Math.round((t-s)/36e5/n);break;case"days":o=Math.round((t-s)/864e5/n);break;case"months":{const a=new Date(t).getUTCFullYear()-new Date(s).getUTCFullYear(),l=new Date(s).getUTCMonth(),c=new Date(t).getUTCMonth();o=a===0?c-l:c+11-l+12*(a-1)}break;case"years":o=Math.round((new Date(t).getUTCFullYear()-new Date(s).getUTCFullYear())/n);break;case"decades":o=Math.round((new Date(t).getUTCFullYear()-new Date(s).getUTCFullYear())/10/n)}return o}function DKe(t){let e=t.values?.length;if(e)return e;const{extent:i,unit:r}=t,n=t.interval||1,s=i?i[1]-i[0]:0;if(r!=="ISO8601")return Math.round(s/n);switch(t.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(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear(),a=new Date(i[1][0]).getUTCMonth(),l=new Date(i[1][1]).getUTCMonth();e=o===0?l-a+1:l+11-a+12*(o-1)+1}break;case"years":e=Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/n);break;case"decades":e=Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/10/n);break;default:e=0}return e}function JXt(t,e){let i=0;const r=t[0].variableName,n=[...e.variables].sort((s,o)=>s.name>o.name?1:-1);for(let s=0;sh.name>p.name?-1:1);if(o.name!==r){i+=a.map(h=>DKe(h)).reduce((h,p)=>h*p);continue}const l=a.map(h=>DKe(h)),c=a.length;for(let h=0;hv.dimensionName===a[h].name);if(p==null)return null;const y=KXt(p.values[0],a[h]);if(y===-1)return null;l.shift(),i+=h===c-1?y:y*l.reduce((v,x)=>v*x)}break}return i}var UCe,FKe,LKe,z5={},ZXt={get exports(){return z5},set exports(t){z5=t}};FKe=ZXt,UCe=function(){function t(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return t.prototype={ensureBuffer:function(e){var i=this.buffer,r=i?i.byteLength:0;if(en&&(r=n)}else{for(;!this.eof;)this.readBlock();r=this.bufferLength}return this.pos=r,this.buffer.subarray(i,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,i,r){for(var n=e+i;this.bufferLength<=n&&!this.eof;)this.readBlock();return new Stream(this.buffer,e,i,r)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=0}},t}(),(LKe=function(){if(!self||!self.Uint32Array)return null;var t=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]),i=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,c=a[l++],h=a[l++];c!=-1&&h!=-1||s("Invalid header in flate stream"),(15&c)!=8&&s("Unknown compression method in flate stream"),((c<<8)+h)%31!=0&&s("Bad FCHECK in flate stream"),32&h&&s("FDICT bit set in flate stream"),this.bytes=a,this.bytesPos=l,this.codeSize=0,this.codeBuf=0,UCe.call(this)}return o.prototype=Object.create(UCe.prototype),o.prototype.getBits=function(a){for(var l,c=this.codeSize,h=this.codeBuf,p=this.bytes,y=this.bytesPos;c>a,this.codeSize=c-=a,this.bytesPos=y,l},o.prototype.getCode=function(a){for(var l=a[0],c=a[1],h=this.codeSize,p=this.codeBuf,y=this.bytes,v=this.bytesPos;h>16,F=65535&I;return(h==0||h>P,this.codeSize=h-P,this.bytesPos=v,F},o.prototype.generateHuffmanTable=function(a){for(var l=a.length,c=0,h=0;hc&&(c=a[h]);for(var p=1<>=1;for(h=F;h0;)Ge[I++]=et}var l=this.getBits(3);if(1&l&&(this.eof=!0),(l>>=1)!=0){var c,h;if(l==1)c=r,h=n;else if(l==2){for(var p=this.getBits(5)+257,y=this.getBits(5)+1,v=this.getBits(4)+4,x=Array(t.length),I=0;I=Y&&(Y=(Se=this.ensureBuffer(X+1)).length),Se[X++]=Z;else{if(Z==256)return void(this.bufferLength=X);var ie=(Z=e[Z-=257])>>16;ie>0&&(ie=this.getBits(ie)),F=(65535&Z)+ie,Z=this.getCode(h),(ie=(Z=i[Z])>>16)>0&&(ie=this.getBits(ie));var ce=(65535&Z)+ie;X+F>=Y&&(Y=(Se=this.ensureBuffer(X+F)).length);for(var he=0;he{let h=null;o==="jpg"&&a&&(h=XLt._getMask(e,{width:n,height:s}));const p=new Blob([new Uint8Array(e)],{type:"image/"+o=="jpg"?"jpeg":o}),y=URL.createObjectURL(p),v=new Image;let x;v.src=y,v.onload=()=>{if(URL.revokeObjectURL(y),Im(r))return void c(Sc());n=v.width,s=v.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(v,0,0);const I=this._ctx.getImageData(0,0,n,s);let P;if(x=I.data,i.renderOnCanvas){if(h)for(P=0;P{URL.revokeObjectURL(y),c("cannot load image")}})}static _getMask(e,i){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;p--)r[c++]=l[h]>>p&1}}catch{}return r}};var NKe,kKe,$Ke,gae={},eKt={get exports(){return gae},set exports(t){gae=t}};NKe=eKt,kKe=function(){var t=function(){function e(i){this.message="JPEG error: "+i}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]),i=4017,r=799,n=3406,s=2276,o=1567,a=3784,l=5793,c=2896;function h(){this.decodeTransform=null,this.colorTransform=-1}function p(F,k){for(var j,V,Y=0,X=[],Z=16;Z>0&&!F[Z-1];)Z--;X.push({children:[],index:0});var ie,ce=X[0];for(j=0;j0;)ce=X.pop();for(ce.index++,X.push(ce);X.length<=j;)X.push(ie={children:[],index:0}),ce.children[ce.index]=ie.children,ce=ie;Y++}j+10)return ke--,Pe>>ke&1;if((Pe=F[k++])===255){var Ae=F[k++];if(Ae)throw new t("unexpected marker "+(Pe<<8|Ae).toString(16))}return ke=7,Pe>>>7}function de(Ae){for(var tt=Ae;;){if(typeof(tt=tt[J()])=="number")return tt;if(typeof tt!="object")throw new t("invalid huffman sequence")}}function Se(Ae){for(var tt=0;Ae>0;)tt=tt<<1|J(),Ae--;return tt}function Ie(Ae){if(Ae===1)return J()===1?1:-1;var tt=Se(Ae);return tt>=1<>4;if(nt!==0){var Xt=e[Ot+=$e];Ae.blockData[tt+Xt]=Ie(nt),Ot++}else{if($e<15)break;Ot+=16}}}function Oe(Ae,tt){var gt=de(Ae.huffmanTableDC),ze=gt===0?0:Ie(gt)<0)Be--;else for(var gt=X,ze=Z;gt<=ze;){var Ot=de(Ae.huffmanTableAC),jt=15&Ot,nt=Ot>>4;if(jt!==0){var $e=e[gt+=nt];Ae.blockData[tt+$e]=Ie(jt)*(1<>4,(gt=15&ze)==0)nt<15?(Be=Se(nt)+(1<=65488&&pe<=65495))break;k+=2}return(kt=P(F,k))&&kt.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+kt.invalid),k=kt.offset),k-xe}function x(F,k,j){var V,Y,X,Z,ie,ce,he,_e,xe,Pe,ke,J,de,Se,Ie,Re,Oe,Ge=F.quantizationTable,Be=F.blockData;if(!Ge)throw new t("missing required Quantization Table.");for(var qe=0;qe<64;qe+=8)xe=Be[k+qe],Pe=Be[k+qe+1],ke=Be[k+qe+2],J=Be[k+qe+3],de=Be[k+qe+4],Se=Be[k+qe+5],Ie=Be[k+qe+6],Re=Be[k+qe+7],xe*=Ge[qe],Pe|ke|J|de|Se|Ie|Re?(Pe*=Ge[qe+1],ke*=Ge[qe+2],J*=Ge[qe+3],de*=Ge[qe+4],Se*=Ge[qe+5],Ie*=Ge[qe+6],Re*=Ge[qe+7],Y=(V=(V=l*xe+128>>8)+(Y=l*de+128>>8)+1>>1)-Y,Oe=(X=ke)*a+(Z=Ie)*o+128>>8,X=X*o-Z*a+128>>8,he=(ie=(ie=c*(Pe-Re)+128>>8)+(he=Se<<4)+1>>1)-he,ce=(_e=(_e=c*(Pe+Re)+128>>8)+(ce=J<<4)+1>>1)-ce,Z=(V=V+(Z=Oe)+1>>1)-Z,X=(Y=Y+X+1>>1)-X,Oe=ie*s+_e*n+2048>>12,ie=ie*n-_e*s+2048>>12,_e=Oe,Oe=ce*r+he*i+2048>>12,ce=ce*i-he*r+2048>>12,he=Oe,j[qe]=V+_e,j[qe+7]=V-_e,j[qe+1]=Y+he,j[qe+6]=Y-he,j[qe+2]=X+ce,j[qe+5]=X-ce,j[qe+3]=Z+ie,j[qe+4]=Z-ie):(Oe=l*xe+512>>10,j[qe]=Oe,j[qe+1]=Oe,j[qe+2]=Oe,j[qe+3]=Oe,j[qe+4]=Oe,j[qe+5]=Oe,j[qe+6]=Oe,j[qe+7]=Oe);for(var et=0;et<8;++et)xe=j[et],(Pe=j[et+8])|(ke=j[et+16])|(J=j[et+24])|(de=j[et+32])|(Se=j[et+40])|(Ie=j[et+48])|(Re=j[et+56])?(Y=(V=4112+((V=l*xe+2048>>12)+(Y=l*de+2048>>12)+1>>1))-Y,Oe=(X=ke)*a+(Z=Ie)*o+2048>>12,X=X*o-Z*a+2048>>12,Z=Oe,he=(ie=(ie=c*(Pe-Re)+2048>>12)+(he=Se)+1>>1)-he,ce=(_e=(_e=c*(Pe+Re)+2048>>12)+(ce=J)+1>>1)-ce,Oe=ie*s+_e*n+2048>>12,ie=ie*n-_e*s+2048>>12,_e=Oe,Oe=ce*r+he*i+2048>>12,ce=ce*i-he*r+2048>>12,xe=(xe=(V=V+Z+1>>1)+_e)<16?0:xe>=4080?255:xe>>4,Pe=(Pe=(Y=Y+X+1>>1)+(he=Oe))<16?0:Pe>=4080?255:Pe>>4,ke=(ke=(X=Y-X)+ce)<16?0:ke>=4080?255:ke>>4,J=(J=(Z=V-Z)+ie)<16?0:J>=4080?255:J>>4,de=(de=Z-ie)<16?0:de>=4080?255:de>>4,Se=(Se=X-ce)<16?0:Se>=4080?255:Se>>4,Ie=(Ie=Y-he)<16?0:Ie>=4080?255:Ie>>4,Re=(Re=V-_e)<16?0:Re>=4080?255:Re>>4,Be[k+et]=xe,Be[k+et+8]=Pe,Be[k+et+16]=ke,Be[k+et+24]=J,Be[k+et+32]=de,Be[k+et+40]=Se,Be[k+et+48]=Ie,Be[k+et+56]=Re):(Oe=(Oe=l*xe+8192>>14)<-2040?0:Oe>=2024?255:Oe+2056>>4,Be[k+et]=Oe,Be[k+et+8]=Oe,Be[k+et+16]=Oe,Be[k+et+24]=Oe,Be[k+et+32]=Oe,Be[k+et+40]=Oe,Be[k+et+48]=Oe,Be[k+et+56]=Oe)}function I(F,k){for(var j=k.blocksPerLine,V=k.blocksPerColumn,Y=new Int16Array(64),X=0;X=Y)return null;var Z=V(k);if(Z>=65472&&Z<=65534)return{invalid:null,marker:Z,offset:k};for(var ie=V(X);!(ie>=65472&&ie<=65534);){if(++X>=Y)return null;ie=V(X)}return{invalid:Z.toString(16),marker:ie,offset:X}}return h.prototype={parse:function(F){function k(){var Ae=F[Z]<<8|F[Z+1];return Z+=2,Ae}function j(){var Ae=k(),tt=Z+Ae-2,gt=P(F,tt,Z);gt&>.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+gt.invalid),tt=gt.offset);var ze=F.subarray(Z,tt);return Z+=ze.length,ze}function V(Ae){for(var tt=Math.ceil(Ae.samplesPerLine/8/Ae.maxH),gt=Math.ceil(Ae.scanLines/8/Ae.maxV),ze=0;ze>4){if(Re>>4!=1)throw new t("DQT - invalid table spec");for(J=0;J<64;J++)Oe[e[J]]=k()}else for(J=0;J<64;J++)Oe[e[J]]=F[Z++];he[15&Re]=Oe}break;case 65472:case 65473:case 65474:if(Y)throw new t("Only single frame JPEGs supported");k(),(Y={}).extended=Pe===65473,Y.progressive=Pe===65474,Y.precision=F[Z++],Y.scanLines=k(),Y.samplesPerLine=k(),Y.components=[],Y.componentIds={};var Ge,Be=F[Z++],qe=0,et=0;for(ke=0;ke>4,mt=15&F[Z+1];qe>4?_e:xe)[15&Ct]=p(Et,ot)}break;case 65501:k(),X=k();break;case 65498:k();var Te,je=F[Z++],pt=[];for(ke=0;ke>4],Te.huffmanTableAC=_e[15&ct],pt.push(Te)}var ae=F[Z++],ht=F[Z++],wt=F[Z++],Ne=v(F,Z,Y,pt,X,ae,ht,wt>>4,15&wt);Z+=Ne;break;case 65535:F[Z]!==255&&Z--;break;default:if(F[Z-3]===255&&F[Z-2]>=192&&F[Z-2]<=254){Z-=3;break}throw new t("unknown marker "+Pe.toString(16))}Pe=k()}for(this.width=Y.samplesPerLine,this.height=Y.scanLines,this.jfif=ie,this.eof=Z,this.adobe=ce,this.components=[],ke=0;ke>8)+Be[_e+1];return Re},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this.colorTransform!==0:this.colorTransform===1},_convertYccToRgb:function(F){for(var k,j,V,Y=0,X=F.length;Y4)throw new t("Unsupported color mode");var V=this._getLinearizedBlockData(F,k);if(this.numComponents===1&&j){for(var Y=V.length,X=new Uint8ClampedArray(3*Y),Z=0,ie=0;ie=0;I--)y[F++]=P[v]>>I&1}catch{}if(a===1&&c.length===s*o){const P=new Uint8Array(c.buffer);p=[P,P,P]}else{for(p=[],v=0;v<3;v++)p.push(new Uint8Array(h));for(I=0,x=0;xGji).then(t=>t.l).then(({default:t})=>t({locateFile:e=>Ql(`esri/layers/support/rasterFormats/${e}`)})).then(t=>{rKt(t)}),zCe)}const yae={getBlobInfo:null,decode:null};function iKt(t){return 16+(t>>3<<3)}function nM(t,e,i){i.set(t.slice(e,e+i.length))}function rKt(t){const{_malloc:e,_free:i,_lerc_getBlobInfo:r,_lerc_getDataRanges:n,_lerc_decode_4D:s,asm:o}=t;let a;const l=Object.values(o).find(h=>h&&"buffer"in h&&h.buffer===t.HEAPU8.buffer),c=h=>{const p=h.map(I=>iKt(I)),y=p.reduce((I,P)=>I+P),v=e(y);a=new Uint8Array(l.buffer);let x=p[0];p[0]=v;for(let I=1;I{const v=new Uint8Array(48),x=new Uint8Array(8*3),[I,P,F]=c([h.length,v.length,x.length]);a.set(h,I),a.set(v,P),a.set(x,F);let k=r(I,h.length,P,F,12,3);if(k)throw i(I),new Error(`lerc-getBlobInfo: error code is ${k}`);a=new Uint8Array(l.buffer),nM(a,P,v),nM(a,F,x);const j=new Uint32Array(v.buffer),V=new Float64Array(x.buffer),[Y,X,,Z,ie,ce,he,_e,xe,Pe,ke]=j,J={version:Y,depthCount:Pe,width:Z,height:ie,validPixelCount:he,bandCount:ce,blobSize:_e,maskCount:xe,dataType:X,minValue:V[0],maxValue:V[1],maxZerror:V[2],statistics:[],bandCountWithNoData:ke};if(ke)return J;if(Pe===1&&ce===1)return i(I),J.statistics.push({minValue:V[0],maxValue:V[1]}),J;const de=Pe*ce*8,Se=new Uint8Array(de),Ie=new Uint8Array(de);let Re=I,Oe=0,Ge=0,Be=!1;if(a.byteLength1){const Pt=qe.slice(mt*Pe,(mt+1)*Pe),$t=et.slice(mt*Pe,(mt+1)*Pe),Ct=Math.min.apply(null,Pt),Et=Math.max.apply(null,$t);Ze.push({minValue:Ct,maxValue:Et,depthStats:{minValues:Pt,maxValues:$t}})}else Ze.push({minValue:qe[mt],maxValue:et[mt]});return i(Re),Be||i(Oe),J},yae.decode=(h,p)=>{const{maskCount:y,depthCount:v,bandCount:x,width:I,height:P,dataType:F,bandCountWithNoData:k}=p,j=BKe[F],V=I*P,Y=new Uint8Array(V*x),X=V*v*x*j.size,Z=new Uint8Array(X),ie=new Uint8Array(x),ce=new Uint8Array(8*x),[he,_e,xe,Pe,ke]=c([h.length,Y.length,Z.length,ie.length,ce.length]);a.set(h,he),a.set(Y,_e),a.set(Z,xe),a.set(ie,Pe),a.set(ce,ke);const J=s(he,h.length,y,_e,v,I,P,x,F,xe,Pe,ke);if(J)throw i(he),new Error(`lerc-decode: error code is ${J}`);a=new Uint8Array(l.buffer),nM(a,xe,Z),nM(a,_e,Y);let de=null;if(k){nM(a,Pe,ie),nM(a,ke,ce),de=[];const Se=new Float64Array(ce.buffer);for(let Ie=0;Ie1){Y.set(k[0]);for(let he=1;he=X;if(v>0&&Z)for(let he=0;he1?k:null,{pixelType:ce}=I;return{width:l,height:c,bandCount:h,pixelType:ce,depthCount:p,statistics:x,pixels:F,mask:Y,bandMasks:ie,noDataValues:a}}function sKt(t,e,i,r=!0){if(e%4!=0||i%4!=0){const n=new ArrayBuffer(4*Math.ceil(i/4)),s=new Uint8Array(n),o=new Uint8Array(t,e,i);if(r)for(let a=0;a=s)a-=s,y=p>>>32-s,p<<=s;else{y=p>>>32-a,p=n[h++];const F=s-a;a=32-F,y=(y<>>a),p<<=F}if(y===257)break;if(y===256){s=9,o=GKe(),l=o.length,c=[];continue}const P=o[y];if(P==null){if(y>o.length)throw new Error("data integrity issue: code does not exist on code page");c.push(c[0]),o[l++]=c.slice(),UKe(I,c)}else UKe(I,P),c.push(P[0]),c.length>1&&(o[l++]=c.slice()),c=P.slice();if(_B.has(l)&&s++,a===0&&(p=n[h++],a=32),h>v||h===v&&a<=x)break}return new Uint8Array(I)}_B.add(511),_B.add(1023),_B.add(2047),_B.add(4095),_B.add(8191);const zKe=(t,e)=>{const i=e.width*e.height,r=e.pixelType;return Math.floor(t.byteLength/(i*HKe(r)))},HKe=t=>{let e=1;switch(t){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},oKt=(t,e)=>{if(8*t.byteLength=0;a--)r[n++]=s>>a&1;for(a=7;n>a&1,a--;return r};let aKt=class{static decode(e,i){const r=i.pixelType,n=[],s=i.width*i.height,o=zKe(e,i),{bandIds:a,format:l}=i,c=a&&a.length||zKe(e,i),h=e.byteLength-e.byteLength%(s*HKe(r)),p=new r(e,0,s*o);let y,v,x,I,P=null;if(l==="bip")for(y=0;y>4,n<8?n=1:n===15?(n=4,s=(7&s)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++]):n===14?(n=3,s=(15&s)<<12|(63&t[i++])<<6|63&t[i++]):(n=2,s=(31&s)<<6|63&t[i++]),(s!==0||e)&&(r+=String.fromCharCode(s));return r}const qCe=(()=>{const t=[];return t[254]="NEWSUBFILETYPE",t[255]="SUBFILETYPE",t[256]="IMAGEWIDTH",t[257]="IMAGELENGTH",t[258]="BITSPERSAMPLE",t[259]="COMPRESSION",t[262]="PHOTOMETRICINTERPRETATION",t[263]="THRESHHOLDING",t[264]="CELLWIDTH",t[265]="CELLLENGTH",t[266]="FILLORDER",t[269]="DOCUMENTNAME",t[270]="IMAGEDESCRIPTION",t[271]="MAKE",t[272]="MODEL",t[273]="STRIPOFFSETS",t[274]="ORIENTATION",t[277]="SAMPLESPERPIXEL",t[278]="ROWSPERSTRIP",t[279]="STRIPBYTECOUNTS",t[280]="MINSAMPLEVALUE",t[281]="MAXSAMPLEVALUE",t[282]="XRESOLUTION",t[283]="YRESOLUTION",t[284]="PLANARCONFIGURATION",t[285]="PAGENAME",t[286]="XPOSITION",t[287]="YPOSITION",t[288]="FREEOFFSETS",t[289]="FREEBYTECOUNTS",t[290]="GRAYRESPONSEUNIT",t[291]="GRAYRESPONSECURVE",t[292]="T4OPTIONS",t[293]="T6OPTIONS",t[296]="RESOLUTIONUNIT",t[297]="PAGENUMBER",t[300]="COLORRESPONSEUNIT",t[301]="TRANSFERFUNCTION",t[305]="SOFTWARE",t[306]="DATETIME",t[315]="ARTIST",t[316]="HOSTCOMPUTER",t[317]="PREDICTOR",t[318]="WHITEPOINT",t[319]="PRIMARYCHROMATICITIES",t[320]="COLORMAP",t[321]="HALFTONEHINTS",t[322]="TILEWIDTH",t[323]="TILELENGTH",t[324]="TILEOFFSETS",t[325]="TILEBYTECOUNTS",t[326]="BADFAXLINES",t[327]="CLEANFAXDATA",t[328]="CONSECUTIVEBADFAXLINES",t[330]="SUBIFD",t[332]="INKSET",t[333]="INKNAMES",t[334]="NUMBEROFINKS",t[336]="DOTRANGE",t[337]="TARGETPRINTER",t[338]="EXTRASAMPLES",t[339]="SAMPLEFORMAT",t[340]="SMINSAMPLEVALUE",t[341]="SMAXSAMPLEVALUE",t[342]="TRANSFERRANGE",t[347]="JPEGTABLES",t[512]="JPEGPROC",t[513]="JPEGIFOFFSET",t[514]="JPEGIFBYTECOUNT",t[515]="JPEGRESTARTINTERVAL",t[517]="JPEGLOSSLESSPREDICTORS",t[518]="JPEGPOINTTRANSFORM",t[519]="JPEGQTABLES",t[520]="JPEGDCTABLES",t[521]="JPEGACTABLES",t[529]="YCBCRCOEFFICIENTS",t[530]="YCBCRSUBSAMPLING",t[531]="YCBCRPOSITIONING",t[532]="REFERENCEBLACKWHITE",t[700]="XMP",t[33550]="GEOPIXELSCALE",t[33922]="GEOTIEPOINTS",t[33432]="COPYRIGHT",t[42112]="GDAL_METADATA",t[42113]="GDAL_NODATA",t[50844]="RPCCOEFFICIENT",t[34264]="GEOTRANSMATRIX",t[34735]="GEOKEYDIRECTORY",t[34736]="GEODOUBLEPARAMS",t[34737]="GEOASCIIPARAMS",t[34665]="EXIFIFD",t[34853]="GPSIFD",t[40965]="INTEROPERABILITYIFD",t})(),lKt=(()=>{const t=qCe.slice();return t[36864]="ExifVersion",t[40960]="FlashpixVersion",t[40961]="ColorSpace",t[42240]="Gamma",t[37121]="ComponentsConfiguration",t[37122]="CompressedBitsPerPixel",t[40962]="PixelXDimension",t[40963]="PixelYDimension",t[37500]="MakerNote",t[37510]="UserComment",t[40964]="RelatedSoundFile",t[36867]="DateTimeOriginal",t[36868]="DateTimeDigitized",t[36880]="OffsetTime",t[36881]="OffsetTimeOriginal",t[36882]="OffsetTimeDigitized",t[37520]="SubSecTime",t[37521]="SubSecTimeOriginal",t[37522]="SubSecTimeDigitized",t[37888]="Temperature",t[37889]="Humidity",t[37890]="Pressure",t[37891]="WaterDepth",t[37892]="Acceleration",t[37893]="CameraElevationAngle",t[42016]="ImageUniqueID",t[42032]="CameraOwnerName",t[42033]="BodySerialNumber",t[42034]="LensSpecification",t[42035]="LensMake",t[42036]="LensModel",t[42037]="LensSerialNumber",t[33434]="ExposureTime",t[33437]="FNumber",t[34850]="ExposureProgram",t[34852]="SpectralSensitivity",t[34855]="PhotographicSensitivity",t[34856]="OECF",t[34864]="SensitivityType",t[34865]="StandardOutputSensitivity",t[34866]="RecommendedExposureIndex",t[34867]="ISOSpeed",t[34868]="ISOSpeedLatitudeyyy",t[34869]="ISOSpeedLatitudezzz",t[37377]="ShutterSpeedValue",t[37378]="ApertureValue",t[37379]="BrightnessValue",t[37380]="ExposureBiasValue",t[37381]="MaxApertureValue",t[37382]="SubjectDistance",t[37383]="MeteringMode",t[37384]="LightSource",t[37385]="Flash",t[37386]="FocalLength",t[37396]="SubjectArea",t[41483]="FlashEnergy",t[41484]="SpatialFrequencyResponse",t[41486]="FocalPlaneXResolution",t[41487]="FocalPlaneYResolution",t[41488]="FocalPlaneResolutionUnit",t[41492]="SubjectLocation",t[41493]="ExposureIndex",t[41495]="SensingMethod",t[41728]="FileSource",t[41729]="SceneType",t[41730]="CFAPattern",t[41985]="CustomRendered",t[41986]="ExposureMode",t[41987]="WhiteBalance",t[41988]="DigitalZoomRatio",t[41989]="FocalLengthIn35mmFilm",t[41990]="SceneCaptureType",t[41991]="GainControl",t[41992]="Contrast",t[41993]="Saturation",t[41994]="Sharpness",t[41995]="DeviceSettingDescription",t[41996]="SubjectDistanceRange",t})(),uKt=["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"],cKt=(()=>{const t=[];return t[1024]="GTModelTypeGeoKey",t[1025]="GTRasterTypeGeoKey",t[1026]="GTCitationGeoKey",t[2048]="GeographicTypeGeoKey",t[2049]="GeogCitationGeoKey",t[2050]="GeogGeodeticDatumGeoKey",t[2051]="GeogPrimeMeridianGeoKey",t[2052]="GeogLinearUnitsGeoKey",t[2053]="GeogLinearUnitSizeGeoKey",t[2054]="GeogAngularUnitsGeoKey",t[2055]="GeogAngularUnitSizeGeoKey",t[2056]="GeogEllipsoidGeoKey",t[2057]="GeogSemiMajorAxisGeoKey",t[2058]="GeogSemiMinorAxisGeoKey",t[2059]="GeogInvFlatteningGeoKey",t[2061]="GeogPrimeMeridianLongGeoKey",t[2060]="GeogAzimuthUnitsGeoKey",t[3072]="ProjectedCSTypeGeoKey",t[3073]="PCSCitationGeoKey",t[3074]="ProjectionGeoKey",t[3075]="ProjCoordTransGeoKey",t[3076]="ProjLinearUnitsGeoKey",t[3077]="ProjLinearUnitSizeGeoKey",t[3078]="ProjStdParallel1GeoKey",t[3079]="ProjStdParallel2GeoKey",t[3080]="ProjNatOriginLongGeoKey",t[3081]="ProjNatOriginLatGeoKey",t[3082]="ProjFalseEastingGeoKey",t[3083]="ProjFalseNorthingGeoKey",t[3084]="ProjFalseOriginLongGeoKey",t[3085]="ProjFalseOriginLatGeoKey",t[3086]="ProjFalseOriginEastingGeoKey",t[3087]="ProjFalseOriginNorthingGeoKey",t[3088]="ProjCenterLongGeoKey",t[3090]="ProjCenterEastingGeoKey",t[3091]="ProjCenterNorthingGeoKey",t[3092]="ProjScaleAtNatOriginGeoKey",t[3093]="ProjScaleAtCenterGeoKey",t[3094]="ProjAzimuthAngleGeoKey",t[3095]="ProjStraightVertPoleLongGeoKey",t[4096]="VerticalCSTypeGeoKey",t[4097]="VerticalCitationGeoKey",t[4098]="VerticalDatumGeoKey",t[4099]="VerticalUnitsGeoKey",t})(),hKt=(t,e)=>{let i=(e||qCe)[t];return i===void 0&&(i="unknown"+String(t)),i},YCe=new Map;YCe.set("EXIFIFD",lKt),YCe.set("GPSIFD",uKt);const sT={TIFF_TAGS:qCe,ifdTags:YCe,GEO_KEYS:cKt,getTagName:hKt},vae=(()=>{const t=new ArrayBuffer(4),e=new Uint8Array(t);return new Uint32Array(t)[0]=1,e[0]===1})(),WKe=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],bB=4294967296,dKt=new Set([1,5,6,7,8,34712,34887]);function XCe(t,e){let i="unknown";return t===3?i=e===64?"f64":"f32":t===1?e===1?i="u1":e===2?i="u2":e===4?i="u4":e<=8?i="u8":e<=16?i="u16":e<=32&&(i="u32"):t===2&&(e<=8?i="s8":e<=16?i="s16":e<=32&&(i="s32")),i}function _ae(t){let e=null;switch(t?t.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 pKt(t,e){return{x:e[0]*t.x+e[1]*t.y+e[2],y:e[3]*t.x+e[4]*t.y+e[5]}}function qKe(t,e){return t.get(e)?.values}function H5(t,e){return t.get(e)?.values}function YKe(t,e){return t.get(e)?.values?.[0]}function il(t,e){return t.get(e)?.values?.[0]}function KCe(t,e,i,r=0,n=sT.TIFF_TAGS,s=4){const o=s===8,a=o?rTe(new DataView(t,i,8),0,e):new DataView(t,i,2).getUint16(0,e),l=4+2*s,c=o?8:2,h=c+a*l;if(i+h>t.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:h};const p=i+h+4<=t.byteLength?xae(new DataView(t,i+h,s===8?8:4),0,e,s===8):null,y=i+c,v=new Map;let x,I,P,F,k,j=0,V=0;for(let Y=0;YjKe(t,{inputOffset:e}).pixels[0];function JCe(t,e){if(e!==1&&e!==2&&e!==4)return t;const i=new Uint8Array(t),r=8/e,n=new Uint8Array(t.byteLength*r);let s=0;const o=2**e-1;for(let a=0;a>>8-e&o}return n.buffer}function ZCe(t,e,i){const r=new gae;r.parse(t),r.colorTransform=i===6?-1:0;const n=r.getData(r.width,r.height,e!==1);return new Uint8Array(n.buffer)}function QCe(t){const e=new z5(t).getBytes(),i=new ArrayBuffer(e.length),r=new Uint8Array(i);return r.set(e),r}async function eTe(t,e,i,r,n){const s=vae===e,o=il(i,"BITSPERSAMPLE"),a=il(i,"SAMPLESPERPIXEL"),l=il(i,"PHOTOMETRICINTERPRETATION"),c=XCe(il(i,"SAMPLEFORMAT")??1,o),h=il(i,"COMPRESSION")??1,p=_ae(c);let y,v,x;if(h===34887)return await VKe(),fKt(t,r);if(h===1)y=t.slice(r,r+n),v=new Uint8Array(y);else if(h===8||h===32946)v=new Uint8Array(t,r,n),v=QCe(v),y=v.buffer;else if(h===6)v=new Uint8Array(t,r,n),v=ZCe(v,a,l),y=v.buffer;else if(h===7){const I=i.get("JPEGTABLES").values,P=I.length-2;v=new Uint8Array(P+n-2);for(let k=0;k1){const J=Math.round(r.length/p);for(F=0;F{const r=vae===e.littleEndian,n=H5(i,"STRIPOFFSETS");if(n===void 0)return null;const{width:s,height:o,pixelType:a}=bae([i]),l=il(i,"SAMPLESPERPIXEL")||e.planes,c=il(i,"PHOTOMETRICINTERPRETATION"),h=s*o,p=il(i,"BITSPERSAMPLE"),y=_ae(a),v=new y(h*l),x=H5(i,"STRIPBYTECOUNTS"),I=il(i,"ROWSPERSTRIP"),P=il(i,"COMPRESSION")??1;let F,k,j,V,Y,X,Z,ie,ce,he=I;if(p%8==0)for(F=0;Fo?o-F*I:I,a==="u8"||a==="s8"||r)P===8||P===32946?(Z=new Uint8Array(t,n[F],x[F]),Z=QCe(Z),X=Z.buffer):P===6?(Z=new Uint8Array(t,n[F],x[F]),Z=ZCe(Z,l,c),X=Z.buffer):P===5?(Z=HCe(t,n[F],x[F],e.littleEndian),X=Z.buffer):(x[F]!==he*s*l*p/8&&console.log("strip byte counts is different than expected"),X=t.slice(n[F],n[F]+x[F])),X=JCe(X,p),V=new y(X);else{switch(P===6||P===8||P===32946?(Z=new Uint8Array(t,n[F],x[F]),ie=QCe(Z),X=ie.buffer):(x[F]!==he*s*l*p/8&&console.log("strip byte counts is different than expected"),X=new ArrayBuffer(x[F]),Z=new Uint8Array(t,n[F],x[F]),ie=new Uint8Array(X)),a){case"u16":case"s16":for(j=0;j{if(!(t&&t.length>0&&e&&i))return null;let r,n,s;const o=t[0].length,a=t.length,l=new Uint8Array(o);for(let c=0;cs?0:1;else for(let h=0;hs?0:1);return l},vKt=t=>{if(!t)return null;const e=t.match(//gi);if(!e||e.length===0)return null;const i=new Map;let r,n,s,o,a;for(let F=0;F")),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?i.has(n)?i.get(n)[a]=s:i.set(n,[s]):i.set(n,s)),a=null;const l=i.get("STATISTICS_MINIMUM"),c=i.get("STATISTICS_MAXIMUM"),h=i.get("STATISTICS_MEAN"),p=i.get("STATISTICS_STDDEV");let y=null;if(l&&c){y=[];for(let F=0;FP&&y>(n?t.byteLength:t?t.byteLength-l+r:0))return i.offlineOffsetSize=[l,y],i.values=null,!1;if(v<=P){if(!e)if(P<=32)l>>>=32-v;else{const k=F?.length?F[0]:l>>>0,j=F?.length?F[1]:Math.round((l-k)/bB);v<=32?(l=k>>>32-v,F[0]=l):(l=k*2**(32-v)+(j>>>32-v),F[0]=k,F[1]=j>>>32-v)}if(a===1&&p===P)c=[l];else if(P===64){const k=F?.length?F[0]:l>>>0,j=F?.length?F[1]:Math.round((l-k)/bB);let V=k,Y=32;for(I=1;I<=a;I++){const X=32-p*I%32;if(Y>>32-Y,ie=j<<32-Y>>>32-Y;V=j,c.push(Z+ie*2**(p-Y)),Y-=32-(p-Y)}else c.push(V<>>32-p),Y-=p;Y===0&&(Y=32,V=j)}}else for(I=1;I<=a;I++){const k=32-p*I;c.push(l<>>32-p)}}else{l-=r,n&&(l=0);for(let k=l;kparseFloat(Re)),y.some(Re=>isNaN(Re))&&(y=null));const v=il(e,"COMPRESSION")??1;let x;switch(v){case 1:x="NONE";break;case 2:case 3:case 4:case 32771:x="CCITT";break;case 5:x="LZW";break;case 6:case 7:x="JPEG";break;case 32773:x="PACKBITS";break;case 8:case 32946:x="DEFLATE";break;case 34712:x="JPEG2000";break;case 34887:x="LERC";break;default:x=String(v)}let I=!0,P="";dKt.has(v)||(I=!1,P+="unsupported tag compression "+v),l>3&&(I=!1,P+="unsupported tag sampleFormat "+l),o!==1&&o!==2&&o!==4&&o%8!=0&&(I=!1,P+="unsupported tag bitsPerSample "+o);const F=YKe(e,"GEOASCIIPARAMS");let k;if(F){const Re=F.split("|").find(Ge=>Ge.includes("ESRI PE String = ")),Oe=Re?Re.replace("ESRI PE String = ",""):"";k=Oe.startsWith("COMPD_CS")||Oe.startsWith("PROJCS")||Oe.startsWith("GEOGCS")?{wkid:null,wkt:Oe}:null}const j=H5(e,"GEOTIEPOINTS"),V=H5(e,"GEOPIXELSCALE"),Y=H5(e,"GEOTRANSMATRIX"),X=e.has("GEOKEYDIRECTORY")?e.get("GEOKEYDIRECTORY").data:null;let Z,ie,ce=!1,he=!1;if(X){ce=il(X,"GTRasterTypeGeoKey")===2;const Re=il(X,"GTModelTypeGeoKey");if(Re===2){const Oe=il(X,"GeographicTypeGeoKey");Oe>=1024&&Oe<=32766&&(k={wkid:Oe}),k||Oe!==32767||(he=!0,k={wkid:4326})}else if(Re===1){const Oe=il(X,"ProjectedCSTypeGeoKey");Oe>=1024&&Oe<=32766&&(k={wkid:Oe})}}if(V&&j&&j.length>=6?(Z=[V[0],0,j[3]-j[0]*V[0],0,-Math.abs(V[1]),j[4]-j[1]*V[1]],ce&&(Z[2]-=.5*Z[0]+.5*Z[1],Z[5]-=.5*Z[3]+.5*Z[4])):Y&&Y.length===16&&(Z=ce?[Y[0],Y[1],Y[3]-.5*Y[0],Y[4],Y[5],Y[7]-.5*Y[5]]:[Y[0],Y[1],Y[3],Y[4],Y[5],Y[7]]),Z){const Re=[{x:0,y:s},{x:0,y:0},{x:n,y:s},{x:n,y:0}];let Oe,Ge=Number.POSITIVE_INFINITY,Be=Number.POSITIVE_INFINITY,qe=Number.NEGATIVE_INFINITY,et=Number.NEGATIVE_INFINITY;for(let Ze=0;ZeGe?Ge:Oe.x,qe=Oe.xBe?Be:Oe.y,et=Oe.y400||Math.max(Math.abs(ie.xmin),Math.abs(ie.xmax))>361)&&(k=null,ie.spatialReference=null);const _e=tTe(t);let xe,Pe,ke,J,de;if(_e.length>0){ke=Math.round(Math.log(n/il(_e[0],"IMAGEWIDTH"))/Math.LN2);const Re=_e[_e.length-1];J=Math.round(Math.log(n/il(Re,"IMAGEWIDTH"))/Math.LN2),xe=il(Re,"TILEWIDTH"),Pe=il(Re,"TILELENGTH")}xe=J!=null&&J>0?xe||i:null,Pe=J!=null&&J>0?Pe||r:null,i&&(de=[{maxCol:Math.ceil(n/i)-1,maxRow:Math.ceil(s/r)-1,minRow:0,minCol:0}],_e.forEach(Re=>{de.push({maxCol:Math.ceil(il(Re,"IMAGEWIDTH")/il(Re,"TILEWIDTH"))-1,maxRow:Math.ceil(il(Re,"IMAGELENGTH")/il(Re,"TILELENGTH"))-1,minRow:0,minCol:0})}));const Se=YKe(t[0],"GDAL_METADATA"),Ie=vKt(Se);return P+=" "+ZKe({width:n,height:s,tileWidth:i,tileHeight:r,planes:a,ifds:t}),{width:n,height:s,tileWidth:i,tileHeight:r,planes:a,isBSQ:h,pixelType:c,compression:x,noData:y,hasMaskBand:iTe(t).length===_e.length+1,isSupported:I,message:P,extent:ie,isPseudoGeographic:he,affine:V?null:Z,firstPyramidLevel:ke,maximumPyramidLevel:J,pyramidBlockWidth:xe,pyramidBlockHeight:Pe,tileBoundary:de,metadata:Ie}}function wae(t,e){const i=qKe(t,"PLANARCONFIGURATION");return i?i[0]===2:!!e&&e.isBSQ}function tTe(t){return t.filter(e=>il(e,"NEWSUBFILETYPE")===1)}function iTe(t){return t.filter(e=>{const i=(4&(il(e,"NEWSUBFILETYPE")??0))==4,r=il(e,"PHOTOMETRICINTERPRETATION")===4;return i&&r})}function _Kt(t){const{littleEndian:e,isBigTiff:i,firstIFDPos:r}=KKe(t);let n=r;const s=[];do{const o=JKe(t,e,n,0,sT.TIFF_TAGS,i?8:4);if(!o.success)break;s.push(o.ifd),n=o.nextIFD}while(n>0);return{...bae(s),littleEndian:e,isBigTiff:i,ifds:s,pyramidIFDs:tTe(s),maskIFDs:iTe(s)}}function rTe(t,e,i){const r=t.getUint32(e,i),n=t.getUint32(e+4,i);return i?n*bB+r:r*bB+n}function bKt(t,e,i){let r=i?t.getInt32(e,i):t.getUint32(e,i),n=i?t.getUint32(e+4,i):t.getInt32(e+4,i);const s=(i?r:n)>=0?1:-1;return i?r*=s:n*=s,s*(i?n*bB+r:r*bB+n)}function xae(t,e,i,r){return r?rTe(t,e,i):t.getUint32(e,i)}function KKe(t){const e=new DataView(t,0,16),i=e.getUint16(0,!1);let r=null;if(i===18761)r=!0;else{if(i!==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:xae(e,s,r,o)}}function JKe(t,e,i,r=0,n=sT.TIFF_TAGS,s=4){const o=KCe(t,e,i,r,n,s);let a;const l=o.ifd;if(l){if(sT.ifdTags.forEach((c,h)=>{l.has(h)&&(a=l.get(h),a.data=KCe(t,e,a.valueOffset-r,r,c).ifd)}),l.has("GEOKEYDIRECTORY")){a=l.get("GEOKEYDIRECTORY");const c=a.values;if(c&&c.length>4){const h=c[0]+"."+c[1]+"."+c[2];a.data=KCe(t,e,a.valueOffset+6-r,r,sT.GEO_KEYS,2).ifd,a.data&&a.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[h]})}}if(l.has("XMP")){a=l.get("XMP");const c=a.values;typeof c[0]=="number"&&a.type===7&&(a.values=[WCe(new Uint8Array(c))])}}return o}function ZKe(t){const{width:e,height:i,tileHeight:r,tileWidth:n}=t,s=t.planes,o=n?n*r:e*i,a=il(t.ifds[0],"BITSPERSAMPLE");let l="";return o*s>1073741824/(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}async function wKt(t,e){const{headerInfo:i,ifd:r,offsets:n,sizes:s}=e,o=[];for(let ce=0;cece.min):null,Z=Y?Y.map(ce=>ce.max):null,ie={pixelType:c,width:y,height:v,pixels:F,noDataValue:V};return V!=null?Qoe(ie,V):X&&Z&&e.applyMinMaxConstraint&&(ie.mask=yKt(F,X,Z)),ie}async function xKt(t,e={}){const i=e.pyramidLevel||0,r=e.headerInfo||_Kt(t),{ifds:n,noData:s}=r;if(n.length===0)throw new Error("no valid image file directory");const o=ZKe(r);if(o)throw o;let a=null;const l=i===-1?n[n.length-1]:n[i],c=s??e.noDataValue;return a=r.tileWidth?await mKt(t,r,l):await gKt(t,r,l),a&&(c!=null&&Qoe(a,c),a)}var SKt=function(t){var e,i,r,n,s,o;function a(l){var c,h,p,y,v,x,I,P,F,k,j,V,Y;for(this.data=l,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},v=null;;){switch(c=this.readUInt32(),P=function(){var X,Z;for(Z=[],X=0;X<4;++X)Z.push(String.fromCharCode(this.data[this.pos++]));return Z}.call(this).join(""),P){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(c);break;case"fcTL":v&&this.animation.frames.push(v),this.pos+=4,v={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},y=this.readUInt16(),p=this.readUInt16()||100,v.delay=1e3*y/p,v.disposeOp=this.data[this.pos++],v.blendOp=this.data[this.pos++],v.data=[];break;case"IDAT":case"fdAT":for(P==="fdAT"&&(this.pos+=4,c-=4),l=v?.data||this.imgData,j=0;0<=c?jc;0<=c?++j:--j)l.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(c),(F=255-this.transparency.indexed.length)>0)for(V=0;0<=F?VF;0<=F?++V:--V)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(c)[0];break;case 2:this.transparency.rgb=this.read(c)}break;case"tEXt":x=(k=this.read(c)).indexOf(0),I=String.fromCharCode.apply(String,k.slice(0,x)),this.text[I]=String.fromCharCode.apply(String,k.slice(x+1));break;case"IEND":return v&&this.animation.frames.push(v),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=(Y=this.colorType)===4||Y===6,h=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*h,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+=c}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return a.load=function(l,c,h){var p;return typeof c=="function"&&(h=c),(p=new XMLHttpRequest).open("GET",l,!0),p.responseType="arraybuffer",p.onload=function(){var y;return y=new a(new Uint8Array(p.response||p.mozResponseArrayBuffer)),typeof c?.getContext=="function"&&y.render(c),typeof h=="function"?h(y):void 0},p.send(null)},i=1,r=2,e=0,a.prototype.read=function(l){var c,h;for(h=[],c=0;0<=l?cl;0<=l?++c:--c)h.push(this.data[this.pos++]);return h},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 c,h,p,y,v,x,I,P,F,k,j,V,Y,X,Z,ie,ce,he,_e,xe,Pe,ke,J;if(l==null&&(l=this.imgData),l.length===0)return new Uint8Array(0);for(l=(l=new z5(l)).getBytes(),ie=(V=this.pixelBitlength/8)*this.width,Y=new Uint8Array(ie*this.height),x=l.length,Z=0,X=0,h=0;X1&&h/yOKt(i,r,t);break;case"tiff":e=EKt;break;case"deflate":e=AKt;break;case"lzw":e=PKt;break;case"error":e=()=>{throw new st("rasterCodec:decode","input data contains error")};break;default:e=()=>{throw new st("rasterCodec:decode","unsupported raster format")}}return e}function LKt(t){let e=null,i=null;switch(t?t.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":i=255,e=Uint8Array;break;case"u16":i=i||65535,e=Uint16Array;break;case"u32":i=i||4294967295,e=Uint32Array;break;case"s8":i=i||-128,e=Int8Array;break;case"s16":i=i||-32768,e=Int16Array;break;case"s32":i=i||-2147483648,e=Int32Array;break;default:e=Float32Array}return{pixelTypeCtor:e,noDataValue:i}}function NKt(t,e=1){if(!t)return;const{pixels:i,width:r,height:n,mask:s}=t;if(!i||i.length===0)return;const o=i.length,a=r-1,l=n-1,c=[];let h,p,y,v,x,I,P=null;const F=dn.getPixelArrayConstructor(t.pixelType);if(e===0){for(h=0;hh-p);const l=a[0],c=a[a.length-1];if(i==="equal-interval")if(a.length>=s){const h=(c-l)/s;let p=l;for(let y=1;y{o.push({minValue:h,maxValue:h,label:u_(h,h,r)})});else if(i==="natural-breaks"){const h=jKt(a),p=t.valueFrequency||h.valueFrequency,y=GKt(h.uniqueValues,p,s);let v=l;for(let x=1;xx){const I=wB(h.uniqueValues[y[x]],6);o.push({minValue:v,maxValue:I,label:u_(v,I,r)}),v=I}o.push({minValue:v,maxValue:c,label:u_(v,c,r)})}else if(i==="quantile")if(a.length>=s&&l!==c){let h=l,p=Math.ceil(a.length/s),y=0;for(let v=1;va.length&&(x=a.length-1),x<0&&(x=0),o.push({minValue:h,maxValue:a[x],label:u_(h,a[x],r)}),h=a[x],y+=p,p=Math.ceil((a.length-y)/(s-v))}o.push({minValue:h,maxValue:c,label:u_(h,c,r)})}else{let h=-1;for(let p=0;p=1;P--){const F=wB(h-(P-.5)*y,6);o.push({minValue:x,maxValue:F,label:u_(x,F,r)}),x=F,v++}let I=wB(h+.5*y,6);o.push({minValue:x,maxValue:I,label:u_(x,I,r)}),x=I,v++;for(let P=1;P<=s;P++)I=v===2*s?c:wB(h+(P+.5)*y,6),o.push({minValue:x,maxValue:I,label:u_(x,I,r)}),x=I,v++}}else if(i==="defined-interval"){if(!n)return o;const h=a[0],p=a[a.length-1],y=Math.ceil((p-h)/n);let v=h;for(let x=1;xr&&(i=r);for(let o=0;o0&&x!==t[v+1]&&Math.abs(h-l[v])>Math.abs(h-l[v-1]))t[v]=x;else if(vMath.abs(h-l[v+1])){t[v+1]=x-1;break}p=a,a=0,s=[],o=[];for(let v=0;vp){for(let v=0;v0;y--)for(;i[y]!==i[y-1]+1;){i[y]=i[y]-1;const v=xB(y-1,i,r,n);l=v.sbMean,o=v.sbSdcm;const x=xB(y,i,r,n);if(c=x.sbMean,a=x.sbSdcm,!(o+a=1?1:s>=.5?.5:.25,s}function HKt(t){let e=0;for(let i=0;in===i?.toLowerCase());return e==="Map"?r??"bilinear":t.dataType==="standard-time"?r??"nearest":t.dataType==="thematic"||t.attributeTable||t.colormap?r==="nearest"||r==="majority"?r:"nearest":r??"bilinear"}function JKt(t,e){t=sTe(t,e?.variableName);const{bandCount:i}=t;let{bandIds:r,stretchType:n}=e||{};r?.some(p=>p>=i)&&(r=null);let s=t.statistics,o=t.histograms;i>1?(r=r?.length?r:oTe(t),s=s==null?null:r?.map(p=>s[p]),o=o==null?null:r?.map(p=>o[p])):r=[0],n==null&&(n=QKt(t));let a=!1;switch(n){case"none":a=!1;break;case"percent-clip":a=!o?.length;break;default:a=!s?.length}const{dataType:l}=t,c=r?.length===1&&oJe.has(l)?YKt:null,h=new yCe({stretchType:n,dynamicRangeAdjustment:a,colorRamp:c,outputMin:0,outputMax:255,gamma:r?.length===1?[1]:[1,1,1],useGamma:!1});return n==="percent-clip"?h.maxPercent=h.minPercent=qKt:n==="standard-deviation"&&(h.numberOfStandardDeviations=2),a||!ve(t.multidimensionalInfo)&&!e?.includeStatisticsInStretch||(n==="percent-clip"?h.histograms=o:n!=="min-max"&&n!=="standard-deviation"||(h.statistics=s)),h}function sTe(t,e){if(!e)return t;let i=t.statistics,r=t.histograms;const{multidimensionalInfo:n}=t;if(e&&ve(n)){const s=n.variables.find(o=>o.name===e);if(s){const{statistics:o,histograms:a}=s;o?.length&&(i=o),a?.length&&(r=a)}}return O2.fromJSON({...t.toJSON(),statistics:i,histograms:r})}function oTe(t){const e=t.bandCount;if(e===1)return null;if(e===2)return[0];const i=t.keyProperties&&t.keyProperties.BandProperties;let r;if(i&&i.length===e){const{red:n,green:s,blue:o,nir:a}=ZKt(i);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 ZKt(t){const e={};for(let i=0;i=410&&s<=480&&o>=480&&o<=540?e.blue=i:e.green==null&&s>=490&&s<=560&&o>=560&&o<=610?e.green=i:e.red==null&&s>=595&&s<=670&&o>=660&&o<=730?e.red=i:e.nir==null&&s>=700&&s<=860&&o>=800&&o<=950&&(e.nir=i)}}return e}function QKt(t){let e="percent-clip";const{pixelType:i,dataType:r,histograms:n,statistics:s,multidimensionalInfo:o}=t,a=oJe.has(r)||r==="generic"&&ve(o);return i!=="u8"||r!=="processed"&&ve(n)&&ve(s)?i==="u8"||r==="elevation"||a?e="min-max":ve(n)?e="percent-clip":ve(s)&&(e="min-max"):e="none",e}function eJt(t,e,i,r){if(!lJe(t,e))return null;const{attributeTable:n,statistics:s}=t,o=aJe(n,e),a=pY(n,"red"),l=pY(n,"green"),c=pY(n,"blue"),h=new HW,p=[],y=new Set,v=!!(a&&l&&c);if(ve(n))n.features.forEach(x=>{const I=x.attributes[o.name];if(!y.has(x.attributes[o.name])&&I!=null){y.add(I);const P=v&&(a.type==="single"||a.type==="double")&&(l.type==="single"||l.type==="double")&&(c.type==="single"||c.type==="double")&&!n.features.some(k=>k.attributes[a.name]>1||k.attributes[l.name]>1||k.attributes[c.name]>1),F=P?255:1;p.push(new c5({value:x.attributes[o.name],label:x.attributes[o.name]+"",symbol:{type:"simple-fill",style:"solid",outline:null,color:new en(v?[x.attributes[a.name]*F,x.attributes[l.name]*F,x.attributes[c.name]*F,1]:[0,0,0,0])}}))}});else if(s?.[0])for(let x=s[0].min;x<=s[0].max;x++)p.push(new c5({value:x,label:x.toString(),symbol:{type:"simple-fill",style:"solid",outline:null,color:new en([0,0,0,0])}}));if(p.sort((x,I)=>x.value&&typeof x.value.valueOf()=="string"?0:x.value>I.value?1:-1),!v){const x=$A(sJe,{numColors:p.length});p.forEach((I,P)=>I.symbol.color=new en(x[P].slice(1,4))),h.colorRamp=sJe}if(i||r){const x=i||$A(r,{numColors:p.length}).map(I=>I.slice(1));p.forEach((I,P)=>I.symbol.color=new en(x[P])),h.colorRamp=r}return new WC({field:o.name,uniqueValueInfos:p,authoringInfo:h})}function aJe(t,e,i){let r;return ve(t)?(r=e?t.fields.find(n=>e.toLowerCase()===n.name.toLowerCase()):tJt(t.fields),r||(i||(r=t.fields.find(n=>n.type==="string")),r||(r=pY(t,"value")))):r=new Jo({name:"value"}),r}function tJt(t){let e;for(let i=0;ii.name.toLowerCase()===e)}function lJe(t,e){const{attributeTable:i,bandCount:r}=t;return lt(i)&&sJt(t)?!0:!(lt(i)||r>1||e&&i.fields.find(n=>n.name.toLowerCase()===e.toLowerCase())==null)}function uJe(t){const{bandCount:e,colormap:i}=t;return ve(i)&&i.length>0&&e===1}function iJt(t){if(!uJe(t))return null;let e;const{attributeTable:i,colormap:r}=t;if(ve(i)){const n=pY(i,"value"),s=aJe(i,null,!0);s.type==="string"&&(e={},i.features.forEach(o=>{const a=o.attributes;e[a[n.name]]=s?a[s.name]:a[n.name]}))}return fCe.createFromColormap(r,e)}function rJt(t){const{bandCount:e,dataType:i,pixelType:r}=t;return i==="elevation"||i==="generic"&&e===1&&(r==="s16"||r==="s32"||r==="f32"||r==="f64")}function nJt(t,e=!1){const{attributeTable:i,bandCount:r}=t;return r===1&&(!e||ve(i)||ve(t.histograms))}function sJt(t){return["u8","s8"].includes(t.pixelType)&&t.statistics?.[0]?.min!=null&&t.statistics[0]?.max!=null&&t.bandCount===1}function aTe(t){const{dataType:e}=t;return e==="vector-uv"||e==="vector-magdir"}function oJt(t){const{dataType:e}=t;return e==="vector-uv"||e==="vector-magdir"}const aJt=new Map([["m/s","meter-per-second"],["km/h","kilometer-per-hour"],["knots","knots"],["ft/s","feet-per-second"],["mph","mile-per-hour"]]);function lJt(t){if(!aTe(t))return null;let e;if(ve(t.statistics)&&t.statistics.length&&(t.dataType==="vector-magdir"||t.dataType==="vector-uv")){const{minMagnitude:n,maxMagnitude:s}=uJt(t.dataType,t.statistics);e=[{type:"size",field:"Magnitude",minSize:10,maxSize:40,minDataValue:n,maxDataValue:s}]}const i=ve(t.multidimensionalInfo)?aJt.get(t.multidimensionalInfo.variables[0].unit):null,r=new PCe({visualVariables:e,inputUnit:i,rotationType:"geographic"});return r.visualVariables=[...r.sizeVariables,...r.rotationVariables],r}function cJe(t){return{color:t.symbolLayers[0].material?.color,type:"esriSFS",style:"esriSFSSolid"}}function lTe(t){if(t.type==="uniqueValue"){const e=t.uniqueValueInfos;return e?.[0].symbol?.symbolLayers?.length&&(t.uniqueValueInfos=e?.map(r=>({value:r.value,label:r.label,symbol:r.symbol?cJe(r.symbol):null}))),t}if(t.type==="classBreaks"){const e=t.classBreakInfos;return e[0].symbol?.symbolLayers?.length&&(t.classBreakInfos=e.map(i=>({classMinValue:i.classMinValue,classMaxValue:i.classMaxValue,label:i.label,symbol:i.symbol?cJe(i.symbol):null}))),t}return t}function uJt(t,e){let i,r;if(t==="vector-magdir")i=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;i=0,r=Math.max(Math.abs(n),Math.abs(o),Math.abs(s),Math.abs(a))}return{minMagnitude:i,maxMagnitude:r}}const uTe=1,cJt=[.299,.587,.114];function hJe(t,e=256){e=Math.min(e,256);const{size:i,counts:r}=t,n=new Uint8Array(i),s=r.reduce((h,p)=>h+p/e,0);let o=0,a=0,l=0,c=s;for(let h=0;h=l){const Y=pTe(l,r);for(c=0;c1&&(j-=(1/I)**(P*Y[c])),ke[c]){const X=j*I*P**(1/r[c])+o;V[h]=s==="floor"?Math.floor(X):s==="round"?Math.round(X):X}else k>=i[c]?V[h]=a:V[h]=o;else V[h]=o;F[c]=V}}else for(c=0;c=i[c])V[h]=a;else{const Y=(k-e[c])*v[c]+o;V[h]=s==="floor"?Math.floor(Y):s==="round"?Math.round(Y):Y}F[c]=V}if(t.contrastOffset!=null){const Y=hJt(t.contrastOffset,t.brightnessOffset);for(c=0;c0&&i<100?a=(200*o-100*n+2*n*r)/(2*(100-i))+s:i<=0&&i>-100?a=(200*o-100*n+2*n*r)*(100+i)/2e4+s:i===100?(a=200*o-100*n+(n+1)*(100-i)+2*n*r,a=a>0?n:0):i===-100&&(a=s),l[o]=a>n?n:a<0?0:a;return l}function dJt(t,e,i){const r=[];for(let n=0;n=255)return uTe;let e=0;t!==150&&(e=t<=150?45*Math.cos(.01047*t):17*Math.sin(.021*t));const i=255,r=t+e,n=Math.log(t/i),s=Math.log(r/i);if(s===0)return uTe;const o=n/s;return isNaN(o)?uTe:Math.min(9.9,Math.max(.01,o))}function hTe(t){if(lt(t)||!t.pixels?.length)return null;const{pixels:e,mask:i,pixelType:r}=t,n=t.width*t.height,s=e.length;let o,a,l,c,h;const p=[],y=[];let v,x,I,P,F,k,j,V,Y,X;const Z=256;for(c=0;c[he.minValue,he.maxValue,0,0]);else{const he=hTe(i);o=ve(he)?he.statistics:null,a=ve(he)?he.histograms:null}else o=t.statistics?.length>0?t.statistics:s.statistics,a=t.histograms||s.histograms;l!=="percentClip"&&l!=="histogramEqualization"||a?.length||(l="minMax");const c=o?.length||a?.length||s.bandCount,h=[],p=[];let y,v,x,I,P,F,k,j,V;o&&!Array.isArray(o[0])&&(o=o.map(he=>[he.min,he.max,he.avg,he.stddev]));const[Y,X]=rT(s.pixelType);if(!o?.length){for(o=[],j=0;jo[j][1]&&(p[j]=o[j][1]);break;case"histogramEqualization":for(sg(a),j=0;j=20&&(I[0]=I[1]=I[2]=I[I.length-1]=I[I.length-2]=0),x=0,v=(y.max-y.min)/y.size,k=y.min===-.5&&v===1?.5:0,V=0;VF){h[j]=y.min+v*(V+k);break}for(F=(1-(t.maxPercent||0)/100)*x,p[j]=y.max+k,V=y.size-2;V>=0;V--)if(P[V]hJe(he)))):(ie=t.max||255,Z=t.min||0),fJt({minCutOff:h,maxCutOff:p,outMax:ie,outMin:Z,histogramLut:ce},r)}function fJt(t,e){if(e==null||e.length===0)return t;const i=Math.max.apply(null,e),{minCutOff:r,maxCutOff:n,outMin:s,outMax:o,histogramLut:a}=t;return r.length===e.length||r.length<=i?t:{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 pTe(t,e){const i=new Float32Array(t);for(let r=0;r1?e[r]>2?i[r]=6.5+(e[r]-2)**2.5:i[r]=6.5+100*(2-e[r])**4:i[r]=1;return i}function Cae(t,e){if(lt(t)||!t.pixels?.length)return t;const{mask:i,width:r,height:n,pixels:s}=t,{minCutOff:o,maxCutOff:a,gamma:l}=e,c=e.outMin||0,h=e.outMax||255,p=r*n,y=e.outputPixelType||"u8",v=t.pixels.map(()=>dn.createEmptyBand(y,p)),x=v.length;let I,P,F,k,j;const V=h-c,Y=[],X=[];for(I=0;I=x,ce=!!e.isRenderer;if(ie){const _e=pTe(x,l);for(P=0;P1&&(k-=(1/V)**(j*_e[I])),Fo[I]){const xe=k*V*j**(1/l[I])+c;v[I][P]=ce?Math.floor(xe):Z?Math.round(xe):xe}else F>=a[I]?v[I][P]=h:v[I][P]=c;else v[I][P]=c}else for(P=0;Po[I]){const _e=(F-o[I])*Y[I]+c;v[I][P]=ce?Math.floor(_e):Z?Math.round(_e):_e}else F>=a[I]?v[I][P]=h:v[I][P]=c;const he=new dn({width:r,height:n,mask:i,pixels:v,pixelType:y});return he.updateStatistics(),he}function dJe(t){let{altitude:e,azimuth:i}=t;const{hillshadeType:r,pixelSizePower:n=1,pixelSizeFactor:s=1,scalingType:o,isGCS:a,resolution:l}=t,c=r==="multi-directional"?2*t.zFactor:t.zFactor,{x:h,y:p}=l;let y=c/(8*h),v=c/(8*p);if(a&&c>.001&&(y/=111e3,v/=111e3),o==="adjusted")if(a){const xe=111e3*h,Pe=111e3*p;y=(c+xe**n*s)/(8*xe),v=(c+Pe**n*s)/(8*Pe)}else y=(c+h**n*s)/(8*h),v=(c+p**n*s)/(8*p);let x=(90-e)*Math.PI/180,I=Math.cos(x),P=(360-i+90)*Math.PI/180,F=Math.sin(x)*Math.cos(P),k=Math.sin(x)*Math.sin(P);const j=[315,270,225,360,180,0],V=[60,60,60,60,60,90],Y=new Float32Array([3,5,3,2,1,4]),X=Y.reduce((xe,Pe)=>xe+Pe),Z=Y.map(xe=>xe/X),ie=r==="multi-directional"?j.length:1,ce=new Float32Array(6),he=new Float32Array(6),_e=new Float32Array(6);if(r==="multi-directional")for(let xe=0;xex?x:P],j=o[I],V=j*k,Y=V*(1-Math.abs(F%2-1)),X=j-V;switch(Math.floor(F)){case 0:p[I]=V+X,y[I]=Y+X,v[I]=X;break;case 1:p[I]=Y+X,y[I]=V+X,v[I]=X;break;case 2:p[I]=X,y[I]=V+X,v[I]=Y+X;break;case 3:p[I]=X,y[I]=Y+X,v[I]=V+X;break;case 4:p[I]=Y+X,y[I]=X,v[I]=V+X;break;case 5:case 6:p[I]=V+X,y[I]=X,v[I]=Y+X}}t.pixels=[p,y,v],t.updateStatistics()}function yJt(t,e){if(!Th(t))return t;const i=e.zFactor,r=e.pixelSizePower??1,n=e.pixelSizeFactor??1,s=e.slopeType,o=e.isGCS,{width:a,height:l,mask:c}=t,h=t.pixels[0],p=new Uint8Array(a*l);let y=1;if(ve(c)){for(let Pe=0;Pe360&&(_e%=360)),a[X+Z]=_e}}for(let Y=0;Y1||e&&i.fields.find(n=>n.name.toLowerCase()===e.toLowerCase())==null)}function bJt(t){const{bandCount:e,dataType:i,pixelType:r}=t;return i==="elevation"||i==="generic"&&e===1&&(r==="s16"||r==="f32"||r==="f64")}function wJt(t){const{bandCount:e,colormap:i}=t;return ve(i)&&i.length>0&&e===1}let W5=class extends Ui{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let i;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":i=this._updateUVRenderer(e);break;case"rasterColormap":i=this._updateColormapRenderer(e);break;case"rasterStretch":i=this._updateStretchRenderer(e);break;case"classBreaks":i=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":i=this._updateShadedReliefRenderer(e);break;case"vectorField":i=this._updateVectorFieldRenderer();break;case"flowRenderer":i=this._updateFlowRenderer()}return i}symbolize(e){let i=e&&e.pixelBlock;if(!pJe(i))return i;if(e.simpleStretchParams&&this.rendererJSON.type==="rasterStretch")return this.simpleStretch(i,e.simpleStretchParams);try{let r;switch(i.pixels.length>3&&(i=iae(i,[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(i);break;case"classBreaks":r=this._symbolizeClassBreaks(i);break;case"rasterStretch":r=this._symbolizeStretch(i,e.bandIds);break;case"rasterShadedRelief":{const n=e.extent,s=n.spatialReference.isGeographic,o={x:(n.xmax-n.xmin)/i.width,y:(n.ymax-n.ymin)/i.height};r=this._symbolizeShadedRelief(i,{isGCS:s,resolution:o});break}}return r}catch(r){return Oi.getLogger(this.declaredClass).error("symbolize",r.message),i}}simpleStretch(e,i){if(!pJe(e))return e;try{return e.pixels.length>3&&(e=iae(e,[0,1,2])),Cae(e,{...i,isRenderer:!0})}catch(r){return Oi.getLogger(this.declaredClass).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:i,isGCS:r,resolution:n,bandIds:s}=e,{rendererJSON:o}=this;return o.type==="rasterStretch"?this._generateStretchWebGLParams(i,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 i=this.rendererJSON.colorRamp;return e?JSON.stringify(i)!==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:bCe(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:i}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?e:i?bCe(e,this.lookup.colormapLut):kYt(e,this.lookup.remapLut??[])}_symbolizeStretch(e,i){const{rasterInfo:r}=this,{pixelType:n,bandCount:s}=r,o=this.rendererJSON,a=["u8","u16","s8","s16"].includes(n);let l,c;const{dra:h}=o,{gamma:p}=this.lookup;if(o.stretchType==="histogramEqualization"){const y=h?null:this.lookup?.histogramLut,v=sM(o,{rasterInfo:r,pixelBlock:e,bandIds:i,returnHistogramLut:!y}),x=Cae(e,{...v,gamma:p,isRenderer:!0});c=rae(x,{lut:h?v.histogramLut:y,offset:0})}else if(a){if(h){const y=sM(o,{rasterInfo:r,pixelBlock:e,bandIds:i});l=cTe({pixelType:n,...y,gamma:p,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&&i?.length===e?.pixels.length&&l?.lut.length===s&&(l={lut:i.map(y=>l.lut[y]),offset:l.offset}),c=rae(e,l)}else{const y=sM(o,{rasterInfo:r,pixelBlock:e,bandIds:i});c=Cae(e,{...y,gamma:p,isRenderer:!0})}if(o.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;c=bCe(c,this.lookup?.colormapLut)}return c}_symbolizeShadedRelief(e,i){const r=this.rendererJSON,n={...r,...i},s=mJt(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 gJt(s,e,o,a),s}_isVectorFieldData(){const{bandCount:e,dataType:i}=this.rasterInfo;return e===2&&(i==="vector-magdir"||i==="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:i,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=i===1&&["u8","s8"].includes(n);if(!_Jt(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(ve(r)){const h=r.fields.find(p=>p.name.toLowerCase()==="value");if(!h)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(p=>{const y=e.uniqueValueInfos?.find(x=>String(x.value)===String(p.attributes[s])),v=y?.symbol?.color;v?l.push([p.attributes[h.name]].concat(v)):o&&l.push([p.attributes[h.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(h=>{const p=h?.symbol?.color;p?l.push([parseInt(""+h.value,10)].concat(p)):o&&l.push([parseInt(""+h.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 c=iY({colormap:l});return this.lookup={rendererJSON:e,colormapLut:c},this.canRenderInWebGL=!0,{success:!0}}_updateColormapRenderer(e){if(!wJt(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const i=e.colormapInfos.map(n=>[n.value].concat(n.color)).sort((n,s)=>n[0]-s[0]);if(!i||i.length===0)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=iY({colormap:i});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=!0,{success:!0}}_updateShadedReliefRenderer(e){if(!bJt(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 i=$A(e.colorRamp,{interpolateAlpha:!0}),r=iY({colormap:i}),n=[],s=r.indexedColormap;for(let o=0;oa.name.toLowerCase()==="value"):null,s=ve(i)?i.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:i}=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((y,v)=>y.classMaxValue-v.classMaxValue),l=a[a.length-1];let c=e.minValue;if(!r){const y=[];for(let v=0;vV>k);j&&h.push([F].concat(j.symbol.color))}}else{c=Math.floor(e.minValue);for(let y=0;y0&&e[0].min!=null&&e[0].max!=null}_updateStretchRenderer(e){let{stretchType:i,dra:r}=e;if(!(i==="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||(i="minMax");const{computeGamma:s,useGamma:o,colorRamp:a}=e;let{gamma:l}=e;if(o&&s&&!l?.length){const p=e.statistics?.length?e.statistics:this.rasterInfo.statistics;l=dJt(this.rasterInfo.pixelType,p)}const c=this.rasterInfo.pixelType,h=!r&&["u8","u16","s8","s16"].includes(c);if(i==="histogramEqualization"){const p=n.map(y=>hJe(y));this.lookup={rendererJSON:e,histogramLut:p}}else if(h){const p=sM(e,{rasterInfo:this.rasterInfo}),y=cTe({pixelType:c,...p,gamma:o?l:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:y}}if(a){const p=$A(a,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=iY({colormap:p}),this.lookup.rendererJSON=e}return this.lookup.gamma=o&&l?.length?l:null,this.canRenderInWebGL=!0,{success:!0}}_generateStretchWebGLParams(e,i,r){let n=null,s=null;const o=this.lookup&&this.lookup.colormapLut;i.colorRamp&&o&&(n=o.indexedColormap,s=o.offset),i.stretchType==="histogramEqualization"&&(i={...i,stretchType:"minMax"});const{gamma:a}=this.lookup,l=!!(i.useGamma&&a&&a.some(V=>V!==1)),{minCutOff:c,maxCutOff:h,outMin:p,outMax:y}=sM(i,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let v=0;ve(e)&&(v=e.getPlaneCount(),v===2&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:x}=this.rasterInfo,I=Math.min(3,r?.length||v||x,x),P=new Float32Array(I),F=n||l?1:255;let k;for(k=0;k1?a[k]>2?j[k]=6.5+(a[k]-2)**2.5:j[k]=6.5+100*(2-a[k])**4:j[k]=1;return{bandCount:I,outMin:p/F,outMax:y/F,minCutOff:c,maxCutOff:h,factor:P,useGamma:l,gamma:l?a:[1,1,1],gammaCorrection:l?j:[1,1,1],colormap:n,colormapOffset:s,stretchType:i.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,i=!1,r={x:0,y:0}){let n=null,s=null;const o=this.lookup&&this.lookup.colormapLut;e.colorRamp&&o&&(n=o.indexedColormap,s=o.offset);const a={...e,isGCS:i,resolution:r},l=dJe(a),c=this.rasterInfo.statistics?.[0];return{...l,minValue:c?.min??0,maxValue:c?.max??8e3,hillshadeType:e.hillshadeType==="traditional"?0:1,type:"hillshade",colormap:n,colormapOffset:s}}_generateVectorFieldWebGLParams(e){const{style:i,inputUnit:r,outputUnit:n,visualVariables:s,symbolTileSize:o,flowRepresentation:a}=e;let l;const c=this.rasterInfo.statistics?.[0].min??0,h=this.rasterInfo.statistics?.[0].max??50,p=s?.find(k=>k.type==="sizeInfo")??{type:"sizeInfo",field:"Magnitude",maxDataValue:h,maxSize:.8*o,minDataValue:c,minSize:.2*o},y=p.minDataValue??c,v=p.maxDataValue??h,x=ve(p.maxSize)&&ve(p.minSize)?[p.minSize/o,p.maxSize/o]:[.2,.8];if(i==="wind_speed"){const k=(x[0]+x[1])/2;x[0]=x[1]=k}const I=ve(y)&&ve(v)?[y,v]:null;if(i==="classified_arrow")if(ve(y)&&ve(v)&&ve(p)){l=[];const k=(p.maxDataValue-p.minDataValue)/5;for(let j=0;j<6;j++)l.push(p.minDataValue+k*j)}else l=[0,1e-6,3.5,7,10.5,14];const P=a==="flow_to"==(i==="ocean_current_kn"||i==="ocean_current_m")?0:Math.PI,F=s?.find(k=>k.type==="rotationInfo");return{breakValues:l,dataRange:I,inputUnit:r,outputUnit:n,symbolTileSize:o,symbolPercentRange:x,style:i||"single_arrow",rotation:P,rotationType:this.rasterInfo.storageInfo?.tileInfo&&this.rasterInfo.dataType==="vector-uv"?"geographic":F?.rotationType||e.rotationType,type:"vectorField"}}};function pJe(t){return Th(t)&&t.validPixelCount!==0}E([N({json:{write:!0}})],W5.prototype,"rendererJSON",void 0),E([N({type:O2,json:{write:!0}})],W5.prototype,"rasterInfo",void 0),E([N({json:{write:!0}})],W5.prototype,"lookup",void 0),E([N()],W5.prototype,"canRenderInWebGL",void 0),W5=E([dt("esri.renderers.support.RasterSymbolizer")],W5);const fTe=W5;let SB=class extends Ui{constructor(e){super(e),this.north=null,this.up=null,this.spatialReference=null}};E([N({type:Number,json:{write:!0}})],SB.prototype,"north",void 0),E([N({type:Number,json:{write:!0}})],SB.prototype,"up",void 0),E([N({type:hr,json:{write:!0}})],SB.prototype,"spatialReference",void 0),SB=E([dt("esri.rest.support.ImageAngleResult")],SB);const xJt=SB;let oM=class extends Ui{constructor(){super(...arguments),this.value=null,this.displayValue=null,this.uncertainty=null}};E([N({type:Number,json:{read:!0,write:!0}})],oM.prototype,"value",void 0),E([N({type:String,json:{read:!0,write:!0}})],oM.prototype,"displayValue",void 0),E([N({type:Number,json:{read:!0,write:!0}})],oM.prototype,"uncertainty",void 0),oM=E([dt("esri.rest.support.ImageMeasureResultValue")],oM);let CB=class extends oM{constructor(){super(...arguments),this.unit=null}};E([N({type:String,json:{read:iA.read,write:iA.write}})],CB.prototype,"unit",void 0),CB=E([dt("esri.rest.support.ImageMeasureResultLengthValue")],CB);let Tae=class extends oM{constructor(){super(...arguments),this.unit=null}};E([N({type:String,json:{read:UH.read,write:UH.write}})],Tae.prototype,"unit",void 0),Tae=E([dt("esri.rest.support.ImageMeasureResultAreaValue")],Tae);let fY=class extends oM{constructor(){super(...arguments),this.unit=null}};E([N({type:String,json:{read:sne.read,write:sne.write}})],fY.prototype,"unit",void 0),fY=E([dt("esri.rest.support.ImageMeasureResultAngleValue")],fY);let aM=class extends Ui{constructor(){super(...arguments),this.name=null,this.sensorName=null}};E([N({type:String,json:{read:!0,write:!0}})],aM.prototype,"name",void 0),E([N({type:String,json:{read:!0,write:!0}})],aM.prototype,"sensorName",void 0),aM=E([dt("esri.rest.support.BaseImageMeasureResult")],aM);let mY=class extends aM{constructor(){super(...arguments),this.area=null,this.perimeter=null}};E([N({type:Tae,json:{read:!0,write:!0}})],mY.prototype,"area",void 0),E([N({type:CB,json:{read:!0,write:!0}})],mY.prototype,"perimeter",void 0),mY=E([dt("esri.rest.support.ImageAreaResult")],mY);const SJt=mY;let TB=class extends aM{constructor(){super(...arguments),this.distance=null,this.azimuthAngle=null,this.elevationAngle=null}};E([N({type:CB,json:{read:!0,write:!0}})],TB.prototype,"distance",void 0),E([N({type:fY,json:{read:!0,write:!0}})],TB.prototype,"azimuthAngle",void 0),E([N({type:fY,json:{read:!0,write:!0}})],TB.prototype,"elevationAngle",void 0),TB=E([dt("esri.rest.support.ImageDistanceResult")],TB);const CJt=TB;let Eae=class extends aM{constructor(){super(...arguments),this.height=null}};E([N({type:CB,json:{read:!0,write:!0}})],Eae.prototype,"height",void 0),Eae=E([dt("esri.rest.support.ImageHeightResult")],Eae);const TJt=Eae;let M2=class extends Ui{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}};E([N({json:{write:!0}})],M2.prototype,"catalogItemVisibilities",void 0),E([N({type:tc,json:{write:!0}})],M2.prototype,"catalogItems",void 0),E([N({type:er,json:{write:!0}})],M2.prototype,"location",void 0),E([N({json:{write:!0}})],M2.prototype,"name",void 0),E([N({json:{write:!0}})],M2.prototype,"objectId",void 0),E([N({json:{write:!0}})],M2.prototype,"processedValues",void 0),E([N({json:{write:!0}})],M2.prototype,"properties",void 0),E([N({json:{write:!0}})],M2.prototype,"value",void 0),M2=E([dt("esri.rest.support.ImageIdentifyResult")],M2);const EJt=M2;let Iae=class extends Ui{constructor(){super(...arguments),this.geometries=null}};E([N({json:{write:!0}})],Iae.prototype,"geometries",void 0),Iae=E([dt("esri.rest.support.ImagePixelLocationResult")],Iae);const IJt=Iae;let Aae=class extends aM{constructor(){super(...arguments),this.point=null}};E([N({type:er,json:{name:"point.value",read:!0,write:!0}})],Aae.prototype,"point",void 0),Aae=E([dt("esri.rest.support.ImagePointResult")],Aae);const AJt=Aae;let VA=class extends Ui{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};E([N({json:{write:!0}})],VA.prototype,"attributes",void 0),E([N({type:er,json:{write:!0}})],VA.prototype,"location",void 0),E([N({json:{write:!0}})],VA.prototype,"locationId",void 0),E([N({json:{write:!0}})],VA.prototype,"rasterId",void 0),E([N({json:{write:!0}})],VA.prototype,"resolution",void 0),E([N({json:{write:!0}})],VA.prototype,"pixelValue",void 0),VA=E([dt("esri.rest.support.ImageSample")],VA);const PJt=VA;let Pae=class extends Ui{constructor(){super(...arguments),this.samples=null}};E([N({type:[PJt],json:{write:!0}})],Pae.prototype,"samples",void 0),Pae=E([dt("esri.rest.support.ImageSampleResult")],Pae);const OJt=Pae;function fJe(t){const e=t?.time;if(e&&(e.start!=null||e.end!=null)){const i=[];e.start!=null&&i.push(e.start),e.end==null||i.includes(e.end)||i.push(e.end),t.time=i.join(",")}}async function mJe(t,e,i){const r=hh(t),n=e.geometry?[e.geometry]:[],s=await ov(n),o=e.toJSON();fJe(o);const a=s&&s[0];ve(a)&&(o.geometry=a.toJSON());const l=iT({...r.query,f:"json",...o});return a_(l,i)}async function RJt(t,e,i){const r=e.toJSON();ve(r.angleName)&&(r.angleName=r.angleName.join(",")),ve(e.point)&&e.point.spatialReference?.imageCoordinateSystem&&(r.point.spatialReference=Rae(e.point.spatialReference)),ve(e.spatialReference)&&e.spatialReference.imageCoordinateSystem&&(r.spatialReference=vJe(e.spatialReference));const n=hh(t),s=iT({...n.query,f:"json",...r}),o=a_(s,i),{data:a}=await ur(`${n.path}/computeAngles`,o);return a.spatialReference=a.spatialReference?a.spatialReference.geodataXform!=null?new hr({wkid:0,imageCoordinateSystem:a.spatialReference}):hr.fromJSON(a.spatialReference):null,a.north==="NaN"&&(a.north=null),a.up==="NaN"&&(a.up=null),new xJt(a)}async function MJt(t,e,i){const r=e.toJSON(),{geometries:n}=e;if(n)for(let c=0;c{a.avg=a.mean,a.stddev=a.standardDeviation}),{statistics:o,histograms:s.histograms}}async function FJt(t,e,i){const r=await mJe(t,e,i),n=hh(t),{data:s}=await ur(`${n.path}/computeHistograms`,r);return{histograms:s.histograms}}async function LJt(t,e,i){const r=e.toJSON();fJe(r),r.outFields?.length&&(r.outFields=r.outFields.join(","));const n=(await ov(e.geometry))?.[0];ve(n)&&(r.geometry=n.toJSON());const s=hh(t),o=iT({...s.query,f:"json",...r}),a=a_(o,i),{data:l}=await ur(`${s.path}/getSamples`,a),c=l?.samples?.map(h=>{const p=h.value==="NaN"||h.value===""?null:h.value.split(" ").map(y=>Number(y));return{...h,pixelValue:p}});return OJt.fromJSON({samples:c})}async function gJe(t,e,i){const r=hh(t),n=e.geometry?[e.geometry]:[];return ov(n).then(s=>{const o=e.toJSON(),a=s&&s[0];ve(a)&&(o.geometry=JSON.stringify(a.toJSON()));const l=iT({...r.query,f:"json",...o}),c=a_(l,i);return ur(r.path+"/identify",c)}).then(s=>EJt.fromJSON(s.data))}async function NJt(t,e,i){const r=await Oae(t,e,[e.fromGeometry,e.toGeometry],i);return TJt.fromJSON(r)}async function kJt(t,e,i){const r=await Oae(t,e,[e.geometry],i);return SJt.fromJSON(r)}async function $Jt(t,e,i){const r=await Oae(t,e,[e.geometry],i);return AJt.fromJSON(r)}async function BJt(t,e,i){const r=await Oae(t,e,[e.fromGeometry,e.toGeometry],i);return CJt.fromJSON(r)}async function Oae(t,e,i,r){const n=hh(t),s=await ov(i),o=e.toJSON();ve(s[0])&&(o.fromGeometry=JSON.stringify(yJe(s[0]))),ve(s[1])&&(o.toGeometry=JSON.stringify(yJe(s[1])));const a=iT({...n.query,f:"json",...o}),l=a_(a,r),{data:c}=await ur(n.path+"/measure",l);return c}function yJe(t){const e=t.toJSON();return t.spatialReference?.imageCoordinateSystem&&(e.spatialReference=Rae(t.spatialReference)),e}function Rae(t){const{imageCoordinateSystem:e}=t;if(e){const{id:i,referenceServiceName:r}=e;return i!=null?r?{icsid:i,icsns:r}:{icsid:i}:{ics:e}}return t.toJSON()}function vJe(t,e){const i=Rae(t),{icsid:r,icsns:n,wkid:s}=i;return r!=null?n==null||e?.toLowerCase().includes("/"+n.toLowerCase()+"/")?`0:${r}`:JSON.stringify(i):s?s.toString():JSON.stringify(i)}function gY(t){const e={};for(const i in t){if(i==="declaredClass")continue;const r=t[i];if(r!=null&&typeof r!="function")if(Array.isArray(r)){e[i]=[];for(let n=0;n>3,this._dataType=7&i,!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;return e=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128?e:(e=(e|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128?e:void 0))))}getUInt64(){return this._decodeVarint()}getSInt32(){const e=this.getUInt32();if(e!==void 0)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,i=this._pos,r=e.getUint32(i,!0)+e.getUint32(i+4,!0)*_Je;return this._skip(8),r}getSFixed64(){const e=this._dataView,i=this._pos,r=e.getUint32(i,!0)+e.getInt32(i+4,!0)*_Je;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(),i=this._pos,r=this._toString(this._data,i,i+e);return this._skip(e),r}getBytes(){const e=this._getLength(),i=this._pos,r=this._toBytes(this._data,i,i+e);return this._skip(e),r}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(e,i,r,n){const s=this.getMessage(),o=e(s,i,r,n);return s.release(),o}processMessage(e){const i=this.getMessage(),r=e(i);return i.release(),r}getMessage(){const e=this._getLength(),i=Zve.pool.acquire();return i._init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),i}release(){Zve.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case lM.varint:this._decodeVarint();break;case lM.fixed64:this._skip(8);break;case lM.delimited:this._skip(this._getLength());break;case lM.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 i=this._pos,r=0,n=0;if(this._end-i>=10)do{if(n=e[i++],r|=127&n,(128&n)==0||(n=e[i++],r|=(127&n)<<7,(128&n)==0)||(n=e[i++],r|=(127&n)<<14,(128&n)==0)||(n=e[i++],r|=(127&n)<<21,(128&n)==0)||(n=e[i++],r+=268435456*(127&n),(128&n)==0)||(n=e[i++],r+=34359738368*(127&n),(128&n)==0)||(n=e[i++],r+=4398046511104*(127&n),(128&n)==0)||(n=e[i++],r+=562949953421312*(127&n),(128&n)==0)||(n=e[i++],r+=72057594037927940*(127&n),(128&n)==0)||(n=e[i++],r+=9223372036854776e3*(127&n),(128&n)==0))break;throw new Error("Varint too long!")}while(0);else{let s=1;for(;i!==this._end&&(n=e[i],(128&n)!=0);)++i,r+=(127&n)*s,s*=128;if(i===this._end)throw new Error("Varint overrun!");++i,r+=n*s}return this._pos=i,r}_decodeSVarint(){const e=this._data;let i=this._pos,r=0,n=0;const s=1&e[i];if(this._end-i>=10)do{if(n=e[i++],r|=127&n,(128&n)==0||(n=e[i++],r|=(127&n)<<7,(128&n)==0)||(n=e[i++],r|=(127&n)<<14,(128&n)==0)||(n=e[i++],r|=(127&n)<<21,(128&n)==0)||(n=e[i++],r+=268435456*(127&n),(128&n)==0)||(n=e[i++],r+=34359738368*(127&n),(128&n)==0)||(n=e[i++],r+=4398046511104*(127&n),(128&n)==0)||(n=e[i++],r+=562949953421312*(127&n),(128&n)==0)||(n=e[i++],r+=72057594037927940*(127&n),(128&n)==0)||(n=e[i++],r+=9223372036854776e3*(127&n),(128&n)==0))break;throw new Error("Varint too long!")}while(0);else{let o=1;for(;i!==this._end&&(n=e[i],(128&n)!=0);)++i,r+=(127&n)*o,o*=128;if(i===this._end)throw new Error("Varint overrun!");++i,r+=n*o}return this._pos=i,s?-(r+1)/2:r/2}_getLength(){if(this._dataType!==lM.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(e,i,r){if((r=Math.min(this._end,r))-i>jJt){const o=e.subarray(i,r);return VJt.decode(o)}let n="",s="";for(let o=i;o{t._data=null,t._dataView=null});let Ml=class Qve{constructor(e=[],i=[],r=!1){this.lengths=e??[],this.coords=i??[],this.hasIndeterminateRingOrder=r}static fromRect(e){const[i,r,n,s]=e,o=n-i,a=s-r;return new Qve([5],[i,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,i)=>e+i)}forEachVertex(e){let i=0;this.lengths.length||e(this.coords[0],this.coords[1]);for(let r=0;ri+r,0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,i){e.coords[this._coordinatePtr++]=i}addCoordinatePoint(e,i){e.coords.push(i)}addLength(e,i){e.lengths.push(i)}addQueryGeometry(e,i){e.queryGeometry=i.queryGeometry,e.queryGeometryType=i.queryGeometryType}createPointGeometry(){return new Ml}};const xJe=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML"],SJe=["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"],CJe=["upperLeft","lowerLeft"];function gTe(t){return t>=xJe.length?null:xJe[t]}function UJt(t){return t>=SJe.length?null:SJe[t]}function TJe(t){return t>=CJe.length?null:CJe[t]}function EJe(t,e){return e>=t.geometryTypes.length?null:t.geometryTypes[e]}function zJt(t,e,i){const n=t.asUnsafe(),s=e.createPointGeometry(i);for(;n.next();)switch(n.tag()){case 3:{const o=n.getUInt32(),a=n.pos()+o;let l=0;for(;n.pos(){const n=r.data;if(n.hasOwnProperty("extent"))return r;if(n.features)throw new Error(PJe);if(n.hasOwnProperty("count"))throw new Error(PJe);return r})}function yY(t,e,i,r={},n={}){const s=typeof t=="string"?fa(t):t,o=e.geometry?[e.geometry]:[];return r.responseType=i==="pbf"?"array-buffer":"json",ov(o,null,r).then(a=>{const l=a&&a[0];ve(l)&&((e=e.clone()).geometry=l);const c=gY({...s.query,f:i,...n,...sZt(e,n)});return ur(yd(s.path,"query"),{...r,query:{...c,...r.query}})})}async function IB(t,e,i){const r=await DJe(t,e,i);return tc.fromJSON(r)}async function DJe(t,e,i){const r=hh(t),n={...i},s=Ns.from(e),{data:o}=await EB(r,s,s.sourceSpatialReference,n);return o}function Qg(t,e){return t?e?4:3:e?3:2}const AB=Oi.getLogger("esri.layers.graphics.featureConversionUtils"),FJe={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0},aZt=(t,e,i,r,n,s)=>{t[i]=n,t[i+1]=s},LJe=(t,e,i,r,n,s)=>{t[i]=n,t[i+1]=s,t[i+2]=e[r+2]},lZt=(t,e,i,r,n,s)=>{t[i]=n,t[i+1]=s,t[i+2]=e[r+3]},uZt=(t,e,i,r,n,s)=>{t[i]=n,t[i+1]=s,t[i+2]=e[r+2],t[i+3]=e[r+3]};function vTe(t,e,i,r){if(t){if(i)return e&&r?uZt:LJe;if(e&&r)return lZt}else if(e&&r)return LJe;return aZt}function vY({scale:t,translate:e},i){return Math.round((i-e[0])/t[0])}function _Y({scale:t,translate:e},i){return Math.round((e[1]-i)/t[1])}function _Te({scale:t,translate:e},i,r){return i*t[r]+e[r]}function bTe(t,e,i){return t?e?i?STe(t):wTe(t):i?xTe(t):Mae(t):null}function Mae(t){const e=t.coords;return{x:e[0],y:e[1]}}function NJe(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t}function wTe(t){const e=t.coords;return{x:e[0],y:e[1],z:e[2]}}function cZt(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.z,t}function xTe(t){const e=t.coords;return{x:e[0],y:e[1],m:e[2]}}function hZt(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.m,t}function STe(t){const e=t.coords;return{x:e[0],y:e[1],z:e[2],m:e[3]}}function dZt(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.z,t.coords[3]=e.m,t}function pZt(t,e,i,r){let n=Mae;i&&r?n=STe:i?n=wTe:r&&(n=xTe);for(const s of e){const{geometry:o,attributes:a}=s,l=ve(o)?n(o):null;t.push({attributes:a,geometry:l})}return t}function CTe(t,e){return t&&e?dZt:t?cZt:e?hZt:NJe}function kJe(t,e,i,r,n){const s=CTe(i,r);for(const{geometry:o,attributes:a}of e){const l=ve(o)?s(new Ml,o):null;t.push(new c_(l,a,null,n?a[n]:void 0))}return t}function fZt(t,e,i=CTe(e.z!=null,e.m!=null)){return i(t,e)}function mZt(t,e,i,r){for(const{geometry:n,attributes:s}of e)t.push({attributes:s,geometry:ve(n)?TTe(n,i,r):null});return t}function TTe(t,e,i){if(lt(t))return null;const r=Qg(e,i),n=[];for(let s=0;s=l&&(t.lengths.push(X),V=j)}return D2(t.coords,V),t.coords.length?t:null}function WJe(t,e,i,r,n,s,o=i,a=r){if(GA(t),!e||!e.coords.length)return null;const l=FJe[n],{coords:c,lengths:h}=e,p=Qg(i,r),y=Qg(i&&o,r&&a),v=vTe(i,r,o,a);if(!h.length)return v(t.coords,c,0,0,c[0],c[1]),GA(t,p,0),t;let x=0;const I=s*s;for(const P of h){if(P=l?t.lengths.push(V):D2(t.coords,F*y),x+=P*p}return t.coords.length?t:null}function wZt(t,e,i,r){const n=t[e],s=t[e+1],o=t[i],a=t[i+1],l=t[r],c=t[r+1];let h=o,p=a,y=l-h,v=c-p;if(y!==0||v!==0){const x=((n-h)*y+(s-p)*v)/(y*y+v*v);x>1?(h=l,p=c):x>0&&(h+=y*x,p+=v*x)}return y=n-h,v=s-p,y*y+v*v}function RTe(t,e,i,r,n,s,o){let a,l=r,c=0;for(let h=s+i;hl&&(c=h,l=a);l>r&&(c-s>i&&RTe(t,e,i,r,n,s,c),n(t,e,t.length,c,e[c],e[c+1]),o-c>i&&RTe(t,e,i,r,n,c,o))}function Fae(t,e,i,r){if(lt(e)||!e.coords||!e.coords.length)return null;const n=Qg(i,r);let s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;if(e&&e.coords){const c=e.coords;for(let h=0;hs.name===i);return n?IZt({tagName:r,tags:n.tags}):null}function IZt(t){const{tagName:e,tags:i}=t;if(!i||!e)return null;const r=i.find(n=>n.name===e);return r&&r.value||null}var DTe;const AZt={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 h_=DTe=class extends Ui{constructor(t){super(t),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:t}=this,e=EZt({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:t});return AZt[e]||null}clone(){return new DTe({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})}};E([N({type:String})],h_.prototype,"contentType",void 0),E([N()],h_.prototype,"exifInfo",void 0),E([N({readOnly:!0})],h_.prototype,"orientationInfo",null),E([N({type:Ls})],h_.prototype,"id",void 0),E([N({type:String})],h_.prototype,"globalId",void 0),E([N({type:String})],h_.prototype,"keywords",void 0),E([N({type:String})],h_.prototype,"name",void 0),E([N({json:{read:!1}})],h_.prototype,"parentGlobalId",void 0),E([N({json:{read:!1}})],h_.prototype,"parentObjectId",void 0),E([N({type:Ls})],h_.prototype,"size",void 0),E([N({json:{read:!1}})],h_.prototype,"url",void 0),h_=DTe=E([dt("esri.layers.support.AttachmentInfo")],h_);const qJe=h_;async function FTe(t,e,i){const r=hh(t);return RJe(r,Ns.from(e),{...i}).then(n=>n.data.count)}async function Lae(t,e,i){const r=hh(t);return oZt(r,Ns.from(e),{...i}).then(n=>n.data.objectIds)}async function YJe(t,e,i){const r=hh(t),{renderingRule:n,sourceJSON:s}=e||{},o=n?JSON.stringify(n.rasterFunctionDefinition||n):null,a=iT({...r.query,renderingRule:o,f:"json"}),l=a_(a,i);t=r.path;const c=s||await ur(t,l).then(Pe=>Pe.data),h=c.hasRasterAttributeTable?ur(`${t}/rasterAttributeTable`,l):null,p=c.hasColormap?ur(`${t}/colormap`,l):null,y=c.hasHistograms?ur(`${t}/histograms`,l):null,v=c.currentVersion>=10.3?ur(`${t}/keyProperties`,l):null,x=c.hasMultidimensions?ur(`${t}/multidimensionalInfo`,l):null,I=await Promise.allSettled([h,p,y,v,x]);let P=null;if(c.minValues&&c.minValues.length===c.bandCount){P=[];for(let Pe=0;Pe{Pe.statistics?.length&&Pe.statistics.forEach(ke=>{ke.avg=ke.mean,ke.stddev=ke.standardDeviation})});const{defaultVariable:he,serviceDataType:_e}=c;he&&he!==ie.DefaultVariable&&(ie.DefaultVariable=he),_e&&_e.includes("esriImageServiceDataTypeVector")&&!_e.includes(ie.DataType)&&(ie.DataType=_e.replace("esriImageServiceDataType",""));let xe=c.noDataValue;return c.noDataValues?.length&&c.noDataValues.some(Pe=>Pe!==xe)&&(xe=c.noDataValues),new O2({width:k,height:j,bandCount:c.bandCount,extent:Ar.fromJSON(c.extent),spatialReference:V,pixelSize:new er({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:V}),pixelType:c.pixelType.toLowerCase(),statistics:P,attributeTable:Y,colormap:X,histograms:Z,keyProperties:ie,noDataValue:xe,multidimensionalInfo:ce})}function XJe(t,e,i){return YJe(t,{sourceJSON:e},i)}function PZt(t,e,i){return YJe(t,{renderingRule:e},i)}async function OZt(t,e,i){const r=hh(t),n=iT({...r?.query,f:"json"}),s=a_(n,i),o=`${r?.path}/${e}/info`,a=ur(`${o}`,s),l=ur(`${o}/keyProperties`,s),c=await Promise.allSettled([a,l]),h=c[0].status==="fulfilled"?c[0].value.data:null,p=c[1].status==="fulfilled"?c[1].value.data:null;let y=null;h.statistics?.length&&(y=h.statistics.map(V=>({min:V[0],max:V[1],avg:V[2],stddev:V[3]})));const v=Ar.fromJSON(h.extent),x=Math.ceil(v.width/h.pixelSizeX-.1),I=Math.ceil(v.height/h.pixelSizeY-.1),P=v.spatialReference,F=new er({x:h.pixelSizeX,y:h.pixelSizeY,spatialReference:P}),k=h.histograms?.length?h.histograms:null,j=new U5({origin:h.origin,blockWidth:h.blockWidth,blockHeight:h.blockHeight,firstPyramidLevel:h.firstPyramidLevel,maximumPyramidLevel:h.maxPyramidLevel});return new O2({width:x,height:I,bandCount:h.bandCount,extent:v,spatialReference:P,pixelSize:F,pixelType:h.pixelType.toLowerCase(),statistics:y,histograms:k,keyProperties:p,storageInfo:j})}var LTe;let X5=LTe=class extends Ui{constructor(t){super(t),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new LTe(gi({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};E([N({type:[String],json:{name:"angleName",write:!0}})],X5.prototype,"angleNames",void 0),E([N({type:er,json:{write:!0}})],X5.prototype,"point",void 0),E([N({type:hr,json:{write:!0}})],X5.prototype,"spatialReference",void 0),E([N({type:Ls,json:{write:!0}})],X5.prototype,"rasterId",void 0),X5=LTe=E([dt("esri.rest.support.ImageAngleParameters")],X5);const RZt=X5,fw=new Ks({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 mw=class extends Ui{constructor(){super(...arguments),this.type=null,this.measureOperation=null,this.mosaicRule=null,this.renderingRule=null,this.pixelSize=null,this.raster=void 0}};E([N()],mw.prototype,"type",void 0),E([N({type:fw.apiValues,json:{read:fw.read,write:fw.write}})],mw.prototype,"measureOperation",void 0),E([N({type:q1,json:{write:!0}})],mw.prototype,"mosaicRule",void 0),E([N({type:pu,json:{write:!0}})],mw.prototype,"renderingRule",void 0),E([N({type:er,json:{write:!0}})],mw.prototype,"pixelSize",void 0),E([N({json:{write:!0}})],mw.prototype,"raster",void 0),mw=E([dt("esri.rest.support.BaseImageMeasureParameters")],mw);var NTe;let UA=NTe=class extends mw{constructor(){super(...arguments),this.type="area-perimeter",this.geometry=null,this.is3D=!1,this.linearUnit="meters",this.areaUnit="square-meters"}writeGeometry(t,e,i){t!=null&&(e.geometryType=bd(t),e[i]=t.toJSON())}get measureOperation(){return this.is3D?"area-and-perimeter-3D":"area-and-perimeter"}clone(){return new NTe(gi({geometry:this.geometry,is3D:this.is3D,linearUnit:this.linearUnit,areaUnit:this.areaUnit,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster}))}};E([N({types:R1,json:{name:"fromGeometry",read:!0,write:!0}})],UA.prototype,"geometry",void 0),E([Cr("geometry")],UA.prototype,"writeGeometry",null),E([N({type:fw.apiValues,json:{write:fw.write}})],UA.prototype,"measureOperation",null),E([N({json:{read:!0}})],UA.prototype,"is3D",void 0),E([N({type:String,json:{read:iA.read,write:iA.write}})],UA.prototype,"linearUnit",void 0),E([N({type:String,json:{read:UH.read,write:UH.write}})],UA.prototype,"areaUnit",void 0),UA=NTe=E([dt("esri.rest.support.ImageAreaParameters")],UA);const MZt=UA;var kTe;let oT=kTe=class extends mw{constructor(){super(...arguments),this.type="distance-angle",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit="meters",this.angularUnit="degrees"}writeFromGeometry(t,e,i){t!=null&&(e.geometryType=bd(t),e[i]=t.toJSON())}get measureOperation(){return this.is3D?"distance-and-angle-3D":"distance-and-angle"}clone(){return new kTe(gi({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster}))}};E([N({type:er,json:{read:!0,write:!0}})],oT.prototype,"fromGeometry",void 0),E([Cr("fromGeometry")],oT.prototype,"writeFromGeometry",null),E([N({type:er,json:{read:!0,write:!0}})],oT.prototype,"toGeometry",void 0),E([N({type:fw.apiValues,json:{write:fw.write}})],oT.prototype,"measureOperation",null),E([N({json:{read:!0}})],oT.prototype,"is3D",void 0),E([N({type:String,json:{read:iA.read,write:iA.write}})],oT.prototype,"linearUnit",void 0),E([N({type:String,json:{read:sne.read,write:sne.write}})],oT.prototype,"angularUnit",void 0),oT=kTe=E([dt("esri.rest.support.ImageDistanceParameters")],oT);const DZt=oT;var $Te;let zA=$Te=class extends mw{constructor(){super(...arguments),this.type="height",this.fromGeometry=null,this.toGeometry=null,this.operationType="base-and-top",this.linearUnit="meters"}writeFromGeometry(t,e,i){t!=null&&(e.geometryType=bd(t),e[i]=t.toJSON())}get measureOperation(){return this.operationType}clone(){return new $Te(gi({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster}))}};E([N({type:er,json:{read:!0}})],zA.prototype,"fromGeometry",void 0),E([Cr("fromGeometry")],zA.prototype,"writeFromGeometry",null),E([N({type:er,json:{read:!0,write:!0}})],zA.prototype,"toGeometry",void 0),E([N({type:fw.apiValues,json:{write:fw.write}})],zA.prototype,"measureOperation",null),E([N({json:{read:!0}})],zA.prototype,"operationType",void 0),E([N({type:String,json:{read:iA.read,write:iA.write}})],zA.prototype,"linearUnit",void 0),zA=$Te=E([dt("esri.rest.support.ImageHeightParameters")],zA);const FZt=zA;var BTe;let aT=BTe=class extends Ui{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.renderingRule=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(t,e,i){t!=null&&(e.geometryType=bd(t),e[i]=t.toJSON())}clone(){return new BTe(gi({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};E([N({types:R1,json:{read:Sl}})],aT.prototype,"geometry",void 0),E([Cr("geometry")],aT.prototype,"writeGeometry",null),E([N({type:q1,json:{write:!0}})],aT.prototype,"mosaicRule",void 0),E([N({type:pu,json:{write:!0}})],aT.prototype,"renderingRule",void 0),E([N({type:er,json:{write:!0}})],aT.prototype,"pixelSize",void 0),E([N({json:{write:!0}})],aT.prototype,"raster",void 0),E([N({type:Xg,json:{read:{source:"time"},write:{target:"time"}}})],aT.prototype,"timeExtent",void 0),aT=BTe=E([dt("esri.rest.support.ImageHistogramParameters")],aT);const KJe=aT;var VTe;let $p=VTe=class extends Ui{constructor(){super(...arguments),this.geometry=null,this.renderingRules=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(t,e,i){t!=null&&(e.geometryType=bd(t),e[i]=JSON.stringify(t.toJSON()))}set mosaicRule(t){let e=t;e&&e.mosaicMethod&&(e=q1.fromJSON({...e.toJSON(),mosaicMethod:e.mosaicMethod,mosaicOperation:e.mosaicOperation})),this._set("mosaicRule",e)}writeMosaicRule(t,e,i){t!=null&&(e[i]=JSON.stringify(t.toJSON()))}set renderingRule(t){let e=t;e&&e.rasterFunction&&(e=pu.fromJSON({...e.toJSON(),rasterFunction:e.rasterFunction,rasterFunctionArguments:e.rasterFunctionArguments})),this._set("renderingRule",e)}writeRenderingRule(t,e,i){t!=null&&(e[i]=JSON.stringify(t.toJSON())),t.rasterFunctionDefinition&&(e[i]=JSON.stringify(t.rasterFunctionDefinition))}writeRenderingRules(t,e,i){t!=null&&(e[i]=JSON.stringify(t.map(r=>r.rasterFunctionDefinition||r.toJSON())))}writePixelSize(t,e,i){t!=null&&(e[i]=JSON.stringify(t))}writeTimeExtent(t,e,i){if(t!=null){const r=ve(t.start)?t.start.getTime():null,n=ve(t.end)?t.end.getTime():null;e[i]=r!=null?n!=null?`${r},${n}`:`${r}`:null}}clone(){return new VTe(gi({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,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}))}};E([N({json:{write:!0}})],$p.prototype,"geometry",void 0),E([Cr("geometry")],$p.prototype,"writeGeometry",null),E([N({type:q1,json:{write:!0}})],$p.prototype,"mosaicRule",null),E([Cr("mosaicRule")],$p.prototype,"writeMosaicRule",null),E([N({type:pu,json:{write:!0}})],$p.prototype,"renderingRule",null),E([Cr("renderingRule")],$p.prototype,"writeRenderingRule",null),E([N({type:[pu],json:{write:!0}})],$p.prototype,"renderingRules",void 0),E([Cr("renderingRules")],$p.prototype,"writeRenderingRules",null),E([N({type:er,json:{write:!0}})],$p.prototype,"pixelSize",void 0),E([Cr("pixelSize")],$p.prototype,"writePixelSize",null),E([N({type:Boolean,json:{write:!0}})],$p.prototype,"returnGeometry",void 0),E([N({type:Boolean,json:{write:!0}})],$p.prototype,"returnCatalogItems",void 0),E([N({type:Boolean,json:{write:!0}})],$p.prototype,"returnPixelValues",void 0),E([N({type:Number,json:{write:!0}})],$p.prototype,"maxItemCount",void 0),E([N({type:Xg,json:{write:{target:"time"}}})],$p.prototype,"timeExtent",void 0),E([Cr("timeExtent")],$p.prototype,"writeTimeExtent",null),E([N({json:{write:!0}})],$p.prototype,"raster",void 0),E([N({json:{write:!0}})],$p.prototype,"viewId",void 0),E([N({type:Boolean,json:{write:!0}})],$p.prototype,"processAsMultidimensional",void 0),$p=VTe=E([dt("esri.rest.support.ImageIdentifyParameters")],$p);const JJe=$p;var jTe;let MB=jTe=class extends Ui{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(t,e,i){e.geometries={geometryType:"esriGeometryPoint",geometries:t.map(r=>r.toJSON())}}clone(){return new jTe({geometries:this.geometries?.map(t=>t.clone())??[],rasterId:this.rasterId})}};E([N({type:[er],json:{write:!0}})],MB.prototype,"geometries",void 0),E([Cr("geometries")],MB.prototype,"writeGeometry",null),E([N({type:Ls,json:{write:!0}})],MB.prototype,"rasterId",void 0),MB=jTe=E([dt("esri.rest.support.ImagePixelLocationParameters")],MB);const LZt=MB;var GTe;let K5=GTe=class extends mw{constructor(){super(...arguments),this.type="point",this.geometry=null,this.is3D=!1}writeGeometry(t,e,i){t!=null&&(e.geometryType=bd(t),e[i]=t.toJSON())}get measureOperation(){const{is3D:t,geometry:e}=this;return e.type==="point"?t?"point-3D":"point":t?"centroid-3D":"centroid"}clone(){return new GTe(gi({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster}))}};E([N({types:R1,json:{name:"fromGeometry",read:Sl}})],K5.prototype,"geometry",void 0),E([Cr("geometry")],K5.prototype,"writeGeometry",null),E([N({type:fw.apiValues,json:{read:fw.read,write:fw.write}})],K5.prototype,"measureOperation",null),E([N({json:{read:!0}})],K5.prototype,"is3D",void 0),K5=GTe=E([dt("esri.rest.support.ImagePointParameters")],K5);const NZt=K5;var UTe;let c0=UTe=class extends Ui{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(t,e,i){t!=null&&(e.geometryType=bd(t),e[i]=t.toJSON())}set locations(t){if(t?.length){const e=new _d({spatialReference:t[0].spatialReference});e.points=t.map(i=>[i.x,i.y]),this._set("locations",t),this.geometry=e}}clone(){return new UTe(gi({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}))}};E([N({types:R1,json:{read:Sl}})],c0.prototype,"geometry",void 0),E([Cr("geometry")],c0.prototype,"writeGeometry",null),E([N()],c0.prototype,"locations",null),E([N({type:String,json:{type:BA.jsonValues,read:BA.read,write:BA.write}})],c0.prototype,"interpolation",void 0),E([N({type:q1,json:{write:!0}})],c0.prototype,"mosaicRule",void 0),E([N({type:[String],json:{write:!0}})],c0.prototype,"outFields",void 0),E([N({type:er,json:{write:!0}})],c0.prototype,"pixelSize",void 0),E([N({type:String,json:{write:!0}})],c0.prototype,"raster",void 0),E([N({type:Boolean,json:{write:!0}})],c0.prototype,"returnFirstValueOnly",void 0),E([N({type:Number,json:{write:!0}})],c0.prototype,"sampleDistance",void 0),E([N({type:Number,json:{write:!0}})],c0.prototype,"sampleCount",void 0),E([N({type:Number,json:{write:!0}})],c0.prototype,"sliceId",void 0),E([N({type:Xg,json:{read:{source:"time"},write:{target:"time"}}})],c0.prototype,"timeExtent",void 0),c0=UTe=E([dt("esri.rest.support.ImageSampleParameters")],c0);const kZt=c0,F2=Oi.getLogger("esri.views.2d.engine.flow.dataUtils"),$Zt=10;async function zTe(t,e,i,r){const n=performance.now(),s=BZt(e,i),o=performance.now(),a=jZt(e,s,i.width,i.height),l=performance.now(),c=UZt(a,!0),h=performance.now(),p=t==="Streamlines"?zZt(c,$Zt):HZt(c),y=performance.now();return Hi("esri-2d-profiler")&&(F2.info("I.1","_createFlowFieldFromData (ms)",Math.round(o-n)),F2.info("I.2","_getStreamlines (ms)",Math.round(l-o)),F2.info("I.3","createAnimatedLinesData (ms)",Math.round(h-l)),F2.info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(y-h)),F2.info("I.5","createFlowMesh (ms)",Math.round(y-n)),F2.info("I.6","Mesh size (bytes)",p.vertexData.buffer.byteLength+p.indexData.buffer.byteLength)),await Promise.resolve(),yn(r),p}function BZt(t,e){const i=GZt(e.data,e.width,e.height,t.smoothing);return t.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,c=s,h=o,p=s{const s=Math.round(r),o=Math.round(n);return s<0||s>=e.width||o<0||o>=e.height?[0,0]:[i[2*(o*e.width+s)+0],i[2*(o*e.width+s)+1]]}}function VZt(t,e,i,r,n,s,o,a,l){const c=[];let h=i,p=r,y=0,[v,x]=e(h,p);v*=t.velocityScale,x*=t.velocityScale;const I=Math.sqrt(v*v+x*x);let P,F;c.push({x:h,y:p,t:y,speed:I});for(let k=0;kt.maxTurnAngle)return c;if(t.collisions){const ie=Math.round(h*l),ce=Math.round(p*l);if(ie<0||ie>o-1||ce<0||ce>a-1)return c;const he=s[ce*o+ie];if(he!==-1&&he!==n)return c;s[ce*o+ie]=n}c.push({x:h,y:p,t:y,speed:Y}),P=X,F=Z}return c}function jZt(t,e,i,r){const n=[],s=new vC,o=1/Math.max(t.lineCollisionWidth,1),a=Math.round(i*o),l=Math.round(r*o),c=new Int32Array(a*l);for(let p=0;pp.sort-y.sort);for(const{x:p,y}of h)if(s.getFloat()=e)continue;const x=s[v+n];p+=x*t[2*(c*e+(h+v))+0],y+=x*t[2*(c*e+(h+v))+1]}a[2*(c*e+h)+0]=p,a[2*(c*e+h)+1]=y}const l=new Float32Array(t.length);for(let c=0;c=i)continue;const x=s[v+n];p+=x*a[2*((h+v)*e+c)+0],y+=x*a[2*((h+v)*e+c)+1]}l[2*(h*e+c)+0]=p,l[2*(h*e+c)+1]=y}return l}function UZt(t,e){const i=new vC,r=t.reduce((l,c)=>l+c.length,0),n=new Float32Array(4*r),s=new Array(t.length);let o=0,a=0;for(const l of t){const c=o;for(const h of l)n[4*o+0]=h.x,n[4*o+1]=h.y,n[4*o+2]=h.t,n[4*o+3]=h.speed,o++;s[a++]={startVertex:c,numberOfVertices:l.length,totalTime:l[l.length-1].t,timeSeed:e?i.getFloat():0}}return{lineVertices:n,lineDescriptors:s}}function zZt(t,e){const{lineVertices:r,lineDescriptors:n}=t;let s=0,o=0;for(const v of n)s+=2*v.numberOfVertices,o+=6*(v.numberOfVertices-1);const a=new Float32Array(s*9),l=new Uint32Array(o);let c=0,h=0;function p(){l[h++]=c-2,l[h++]=c,l[h++]=c-1,l[h++]=c,l[h++]=c+1,l[h++]=c-1}function y(v,x,I,P,F,k,j,V){const Y=c*9;let X=0;a[Y+X++]=v,a[Y+X++]=x,a[Y+X++]=1,a[Y+X++]=I,a[Y+X++]=k,a[Y+X++]=j,a[Y+X++]=P/2,a[Y+X++]=F/2,a[Y+X++]=V,c++,a[Y+X++]=v,a[Y+X++]=x,a[Y+X++]=-1,a[Y+X++]=I,a[Y+X++]=k,a[Y+X++]=j,a[Y+X++]=-P/2,a[Y+X++]=-F/2,a[Y+X++]=V,c++}for(const v of n){const{totalTime:x,timeSeed:I}=v;let P=null,F=null,k=null,j=null,V=null,Y=null;for(let X=0;X0){_e=Z-P,xe=ie-F;const J=Math.sqrt(_e*_e+xe*xe);if(_e/=J,xe/=J,X>1){let de=_e+V,Se=xe+Y;const Ie=Math.sqrt(de*de+Se*Se);de/=Ie,Se/=Ie;const Re=Math.min(1/(de*_e+Se*xe),e);de*=Re,Se*=Re,Pe=-Se,ke=de}else Pe=-xe,ke=_e;Pe!==null&&ke!==null&&(y(P,F,k,Pe,ke,x,I,he),p())}P=Z,F=ie,k=ce,V=_e,Y=xe,j=he}y(P,F,k,-Y,V,x,I,j)}return{vertexData:a,indexData:l}}function HZt(t){const{lineVertices:n,lineDescriptors:s}=t;let o=0,a=0;for(const J of s){const de=J.numberOfVertices-1;o+=4*de*2,a+=6*de*2}const l=new Float32Array(o*16),c=new Uint32Array(a);let h,p,y,v,x,I,P,F,k,j,V,Y,X,Z,ie=0,ce=0;function he(){c[ce++]=ie-8,c[ce++]=ie-7,c[ce++]=ie-6,c[ce++]=ie-7,c[ce++]=ie-5,c[ce++]=ie-6,c[ce++]=ie-4,c[ce++]=ie-3,c[ce++]=ie-2,c[ce++]=ie-3,c[ce++]=ie-1,c[ce++]=ie-2}function _e(J,de,Se,Ie,Re,Oe,Ge,Be,qe,et,Ze,mt,Pt,$t){const Ct=ie*16;let Et=0;for(const Ft of[1,2])for(const ot of[1,2,3,4])l[Ct+Et++]=J,l[Ct+Et++]=de,l[Ct+Et++]=Se,l[Ct+Et++]=Ie,l[Ct+Et++]=Ge,l[Ct+Et++]=Be,l[Ct+Et++]=qe,l[Ct+Et++]=et,l[Ct+Et++]=Ft,l[Ct+Et++]=ot,l[Ct+Et++]=Pt,l[Ct+Et++]=$t,l[Ct+Et++]=Re/2,l[Ct+Et++]=Oe/2,l[Ct+Et++]=Ze/2,l[Ct+Et++]=mt/2,ie++}function xe(J,de){let Se=k+V,Ie=j+Y;const Re=Math.sqrt(Se*Se+Ie*Ie);Se/=Re,Ie/=Re;const Oe=k*Se+j*Ie;Se/=Oe,Ie/=Oe;let Ge=V+X,Be=Y+Z;const qe=Math.sqrt(Ge*Ge+Be*Be);Ge/=qe,Be/=qe;const et=V*Ge+Y*Be;Ge/=et,Be/=et,_e(h,p,y,v,-Ie,Se,x,I,P,F,-Be,Ge,J,de),he()}function Pe(J,de,Se,Ie,Re,Oe){if(k=V,j=Y,V=X,Y=Z,k==null&&j==null&&(k=V,j=Y),x!=null&&I!=null){X=J-x,Z=de-I;const Ge=Math.sqrt(X*X+Z*Z);X/=Ge,Z/=Ge}k!=null&&j!=null&&xe(Re,Oe),h=x,p=I,y=P,v=F,x=J,I=de,P=Se,F=Ie}function ke(J,de){k=V,j=Y,V=X,Y=Z,k==null&&j==null&&(k=V,j=Y),k!=null&&j!=null&&xe(J,de)}for(const J of s){h=null,p=null,y=null,v=null,x=null,I=null,P=null,F=null,k=null,j=null,V=null,Y=null,X=null,Z=null;const{totalTime:de,timeSeed:Se}=J;for(let Ie=0;Ie=i||(k.data[2*(Y*i+j+X)+0]=V.data[2*(Y*V.width+X)+0],k.data[2*(Y*i+j+X)+1]=V.data[2*(Y*V.width+X)+1],k.mask[Y*i+j+X]=V.mask[Y*V.width+X]);j+=V.width}return Hi("esri-2d-profiler")&&F2.info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-o)),k}async function eZe(t,e,i,r,n,s){const o={requestProjectedLocalDirections:!0,signal:s};if(ve(n)&&(o.timeExtent=n),t.type==="imagery"){await t.load({signal:s});const c=t.rasterInfo.dataType,h=await t.fetchImage(e,i,r,o);return!h||lt(h.pixelData)||lt(h.pixelData.pixelBlock)?{data:new Float32Array(i*r*2),mask:new Uint8Array(i*r),width:i,height:r}:ZJe(c,h.pixelData.pixelBlock)}await t.load({signal:s});const a=t.rasterInfo.dataType,l=await t.fetchPixels(e,i,r,o);return!l||lt(l.pixelBlock)?{data:new Float32Array(i*r*2),mask:new Uint8Array(i*r),width:i,height:r}:ZJe(a,l.pixelBlock)}const HTe=ta()({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"}),WZt=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),qZt=oje(jd,{min:0,max:255});function YZt(t){if(!t)return null;const e=JSON.stringify(t).match(/"rasterFunction":"(.*?")/gi)?.map(i=>i.replace('"rasterFunction":"',"").replace('"',""));return e?e.join("/"):null}const XZt=t=>{let e=class extends t{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 kp({layer:this}))}readServiceSupportsMosaicRule(r,n){return this._isMosaicRuleSupported(n)}get _rasterFunctionNamesIndex(){const r=new Map;return!this.rasterFunctionInfos||ve(this.rasterFunctionInfos)&&this.rasterFunctionInfos.length<1||ve(this.rasterFunctionInfos)&&this.rasterFunctionInfos.forEach(n=>{r.set(n.name.toLowerCase().replace(/ /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?q1.fromJSON(n):null}get fieldsIndex(){return this.fields?new Lm(this.fields):null}set format(r){r&&WZt.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&&n.mosaicMethod&&(n=q1.fromJSON({...n.toJSON(),mosaicMethod:n.mosaicMethod,mosaicOperation:n.mosaicOperation})),this._set("mosaicRule",n)}readMosaicRule(r,n){const s=r||n.mosaicRule;return s?q1.fromJSON(s):this._isMosaicRuleSupported(n)?q1.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 q1({where:a})),this._isValidCustomizedMosaicRule(o)&&(n[s]=o.toJSON())}writeNoData(r,n,s){r!=null&&typeof r=="number"&&(n[s]=qZt(r))}readObjectIdField(r,n){if(!r){const s=n.fields.filter(o=>o.type==="esriFieldTypeOID"||o.type==="oid");r=s&&s[0]&&s[0].name}return r}get parsedUrl(){return fa(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=vKe(o,s);return a==null?null:(a.type==="vector-field"&&n.symbolTileSize&&!o.symbolTileSize&&(a.symbolTileSize=n.symbolTileSize),wKe(a)||Oi.getLogger(this.declaredClass).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||"Raster.",n=new Jo({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),s=new Jo({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),o=new Jo({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let a=this.fields?gi(this.fields):[];a.push(s),this.capabilities?.operations.supportsQuery&&this.fields&&this.fields.length>0&&a.push(n),this.version>=10.4&&ve(this.rasterFunctionInfos)&&this.rasterFunctionInfos.some(c=>c.name.toLowerCase()==="none")&&a.push(o),ve(this.rasterFunctionInfos)&&this.rasterFunctionInfos.filter(c=>c.name.toLowerCase()!=="none").forEach(c=>{a.push(new Jo({name:"Raster.ServicePixelValue."+c.name,alias:c.name,domain:null,editable:!1,length:50,type:"string"}))}),this._isVectorDataSet()&&(a.push(new Jo({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),a.push(new Jo({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:l}=this.rasterInfo??{};if(ve(l)){const c=l.fields.filter(h=>h.type!=="esriFieldTypeOID"&&h.name.toLowerCase()!=="value").map(h=>{const p=gi(h);return p.name=r+h.name,p});a=a.concat(c)}return a}set renderingRule(r){let n=r;n&&n.rasterFunction&&(n=pu.fromJSON({...n.toJSON(),rasterFunction:n.rasterFunction,rasterFunctionArguments:n.rasterFunctionArguments})),this._set("renderingRule",n)}readRenderingRule(r,n){const s=n.rasterFunctionInfos;return n.renderingRule||s&&s.length&&s[0].name!=="None"?this._isRFTJson(n.renderingRule)?pu.fromJSON({rasterFunctionDefinition:n.renderingRule}):pu.fromJSON(n.renderingRule||{rasterFunctionInfos:n.rasterFunctionInfos}):null}writeRenderingRule(r,n,s){const o=r.toJSON();o.rasterFunctionDefinition?n[s]=o.rasterFunctionDefinition:n[s]=o}readSpatialReference(r,n){const s=r||n.extent.spatialReference;return s?hr.fromJSON(s):null}readPixelType(r){return HTe.fromJSON(r)||r}writePixelType(r,n,s){(lt(this.serviceRasterInfo)||this.pixelType!==this.serviceRasterInfo.pixelType)&&(n[s]=HTe.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:c}=this;if(!this._isPicture()&&o&&a&&!l){const h=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(o.toJSON()),p=this._rasterJobHandler.instance;if(p){h&&(a.bind(),await p.updateSymbolizer(a,n),this._cachedRendererJson=o.toJSON());const y=await p.symbolize({bandIds:c,...r},n);s={extent:r.extent,pixelBlock:y}}else s={extent:r.extent,pixelBlock:a.symbolize({bandIds:c,...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 st("imagery-layer:compute-angles","this operation is not supported on the input image service");return r=Gd(RZt,r).clone(),RJt(this.url,r,this._getRequestOptions(n))}async computePixelSpaceLocations(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsComputePixelLocation)throw new st("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return r=Gd(LZt,r).clone(),MJt(this.url,r,this._getRequestOptions(n))}async computeHistograms(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsComputeHistograms)throw new st("imagery-layer:compute-histograms","this operation is not supported on the input image service");return r=Gd(KJe,r).clone(),this._applyMosaicAndRenderingRules(r),FJt(this.url,r,this._getRequestOptions(n))}async computeStatisticsHistograms(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsComputeStatisticsHistograms)throw new st("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return r=Gd(KJe,r).clone(),this._applyMosaicAndRenderingRules(r),DJt(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 st("imagery-layer:measure-height","this operation is not supported on the input image service");return r=Gd(FZt,r).clone(),this._applyMosaicAndRenderingRules(r),NJt(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 st("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return r=Gd(MZt,r).clone(),this._applyMosaicAndRenderingRules(r),kJt(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 st("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return r=Gd(DZt,r).clone(),this._applyMosaicAndRenderingRules(r),BJt(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 st("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return r=Gd(NZt,r).clone(),this._applyMosaicAndRenderingRules(r),$Jt(this.url,r,this._getRequestOptions(n))}getField(r){const{fieldsIndex:n}=this;return ve(n)?n.get(r):void 0}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 st("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 p=await this.generateRasterInfo(this.renderingRule,{signal:o.signal});p&&(this.rasterInfo=p)}const a=this.getExportImageServiceParameters(r,n,s,o.timeExtent);if(a==null){if(o.requestAsImageElement&&this._canRequestImageElement(this.format)){const F=document.createElement("canvas");return F.width=n,F.height=s,o.returnImageBitmap?{imageBitmap:await rM(F,`${i(this.parsedUrl)}/exportImage`)}:{imageOrCanvasElement:F}}const{bandIds:p,rasterInfo:y}=this,v=(p?.length||y.bandCount)??0,x=n*s,I=y.pixelType,P=[];for(let F=0;F=10.3?r?.renderingRule:null})}).then(n=>n.data)}fetchRasterAttributeTable(r){return this.version<10.1?Promise.reject(new st("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):ur(i(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?r?.renderingRule:null})}).then(n=>tc.fromJSON(n.data))}getCatalogItemRasterInfo(r,n){const s={...n,query:this._getQueryParams()};return OZt(i(this.parsedUrl),r,s)}async getCatalogItemICSInfo(r,n){const{data:s}=await ur(i(this.parsedUrl)+"/"+r+"/info/ics",{query:this._getQueryParams(),...n}),o=s&&s.ics;if(!o)return;let a=null;try{a=(await ur(i(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?ur(i(this.parsedUrl)+"/"+r+"/info/icstopixel",{query:this._getQueryParams(),...n}).then(de=>de.data).catch(()=>({})):{},c=a.spatialReference,h={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[a]}),inSR:c.wkid||JSON.stringify(c),outSR:"0:"+r},p=ur(i(this.parsedUrl)+"/project",{query:this._getQueryParams(h),...n}).then(de=>de.data).catch(()=>({})),y=5,v=(a.xmin+a.xmax)/2,x=(a.ymax-a.ymin)/(y+1),I=a.ymin+x,P=[];for(let de=0;dede.data).catch(()=>({})),j=await Promise.all([l,p,k]);let V=j[0].ipxf;if(V==null){const de=o.geodataXform?.xf_0;de?.name?.toLowerCase()==="topup"&&de?.coefficients?.length===6&&(V={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:de.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const Y=Ar.fromJSON(j[1]&&j[1].geometries&&j[1].geometries[0]);Y&&(Y.spatialReference=new hr({wkid:0,imageCoordinateSystem:o}));const X=j[2].geometries?j[2].geometries.filter(de=>de!=null&&de.x!=null&&de.y!=null&&de.x!=="NaN"&&de.y!=="NaN"):[],Z=X.length;if(Z<3)return{ics:o,icsToPixelTransform:V,icsExtent:Y,northDirection:null};let ie=0,ce=0,he=0,_e=0;for(let de=0;deX[0].x,J=X[y-1].y>X[0].y;return xe===1/0?Pe=J?90:270:xe===0?Pe=ke?0:180:xe>0?Pe=ke?180*Math.atan(xe)/Math.PI:180*Math.atan(xe)/Math.PI+180:xe<0&&(Pe=J?180+180*Math.atan(xe)/Math.PI:360+180*Math.atan(xe)/Math.PI),{ics:o,icsToPixelTransform:V,icsExtent:Y,northDirection:Pe}}async generateRasterInfo(r,n){if(r=Gd(pu,r),this.serviceRasterInfo&&(!r||r.functionName?.toLowerCase()==="none"||this._isVectorFieldResampleFunction(r)))return this.serviceRasterInfo;const s=YZt(r);if(!s)return null;if(this._functionRasterInfos[s])return this._functionRasterInfos[s];const o=this._generateRasterInfo(r,n);this._functionRasterInfos[s]=o;try{return await o}catch{return this._functionRasterInfos[s]=null,null}}getExportImageServiceParameters(r,n,s,o){r=r.clone().shiftCentralMeridian();const a=vJe(r.spatialReference,i(this.parsedUrl));this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const l=this.exportImageServiceParameters.toJSON(),{bandIds:c,noData:h}=l;let{renderingRule:p}=l;const y=this.renderingRule?.rasterFunctionDefinition,v=!this.renderer||this.renderer.type==="raster-stretch";if(c?.length&&this._hasRenderingRule(this.renderingRule)&&!y&&v){const P={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:c}};if(p.rasterFunction==="Stretch")P.rasterFunctionArguments.Raster=p.rasterFunctionArguments.Raster,p.rasterFunctionArguments.Raster=P;else if(p.rasterFunction==="Colormap"){const F=p.rasterFunctionArguments.Raster;F?.rasterFunction==="Stretch"?(P.rasterFunctionArguments.Raster=F.rasterFunctionArguments.Raster,F.rasterFunctionArguments.Raster=P):(P.rasterFunctionArguments.Raster=F,p.rasterFunctionArguments.Raster=P)}else P.rasterFunctionArguments.Raster=p,p=P;l.bandIds=void 0}else l.bandIds=c?.join(",");h instanceof Array&&h.length>0&&(l.noData=h.join(","));const x=this._processMultidimensionalIntersection(null,o,this.exportImageServiceParameters.mosaicRule);if(x.isOutSide)return null;l.mosaicRule=ve(x.mosaicRule)?JSON.stringify(x.mosaicRule):null,o=x.timeExtent,l.renderingRule=this._getRenderingRuleString(pu.fromJSON(p));const I={};if(ve(o)){const{start:P,end:F}=o.toJSON();P&&F&&P===F?I.time=""+P:P==null&&F==null||(I.time=`${P??"null"},${F??"null"}`)}return{bbox:r.xmin+","+r.ymin+","+r.xmax+","+r.ymax,bboxSR:a,imageSR:a,size:n+","+s,...l,...I}}async getSamples(r,n){if(!(await this._fetchCapabilities(n?.signal))?.operations.supportsGetSamples)throw new st("imagery-layer:get-samples","getSamples operation is not supported on the input image service");r=Gd(kZt,r).clone();const{raster:s}=this;return s&&r.raster==null&&(r.raster=s),LJt(this.url,r,this._getRequestOptions(n))}async identify(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsIdentify)throw new st("imagery-layer:identify","identify operation is not supported on the input image service");r=Gd(JJe,r).clone();const s=this._processMultidimensionalIntersection(r.geometry,r.timeExtent,r.mosaicRule||this.mosaicRule);if(s.isOutSide)throw new st("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,renderingRule:a}=this;return a&&r.renderingRule==null&&(r.renderingRule=a),o&&r.raster==null&&(r.raster=o),gJe(this.url,r,this._getRequestOptions(n))}createQuery(){const r=new Ns;return r.outFields=["*"],r.returnGeometry=!0,r.where=this.definitionExpression||"1=1",r}async queryRasters(r,n){return{query:r,requestOptions:n}=await this._prepareForQuery(r,n),IB(this.url,r,n)}async queryObjectIds(r,n){return{query:r,requestOptions:n}=await this._prepareForQuery(r,n),Lae(this.url,r,n)}async queryRasterCount(r,n){return{query:r,requestOptions:n}=await this._prepareForQuery(r,n),FTe(this.url,r,n)}async queryVisibleRasters(r,n){if(!r)throw new st("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 c=!1,h=null,p=null;const y="raster.servicepixelvalue",v=this._rasterFunctionNamesIndex;if(ve(r.outFields)&&(c=r.outFields.some(V=>!V.toLowerCase().includes(y)),this.version>=10.4)){const V=r.outFields.filter(X=>X.toLowerCase().includes(y)&&X.length>y.length).map(X=>{const Z=X.slice(y.length+1);return[this._updateRenderingRulesFunctionName(Z,v),Z]});h=V.map(X=>new pu({functionName:X[0]})),p=V.map(X=>X[1]);const{renderingRule:Y}=this;h.length===0?Y?.functionName?(h.push(Y),p.push(Y.functionName)):h=null:Y?.functionName&&!h.some(X=>X.functionName===Y.functionName)&&(h.push(Y),p.push(Y.functionName))}const x=lt(r.outSpatialReference)||r.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:I}=this;let P=r.timeExtent||this.timeExtent;if(I){const{isOutside:V,intersection:Y}=VCe(I,{geometry:r.geometry,timeExtent:r.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(V)throw new st("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");Y&&ve(Y.timeExtent)&&(P=Y.timeExtent)}const F=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,P),k=this._getQueryParams({geometry:r.geometry,timeExtent:P,mosaicRule:F,renderingRule:this.version<10.4?this.renderingRule:null,renderingRules:h,pixelSize:s,returnCatalogItems:c,returnGeometry:x,raster:this.raster,maxItemCount:a?1:null});delete k.f;const j=new JJe(k);try{await this.generateRasterInfo(this.renderingRule);const V=await gJe(this.url,j,{signal:n?.signal,query:{...this.customParameters}}),Y=r.outFields,X=V.value!=null&&V.value.toLowerCase().includes("nodata");if(!(c&&!x&&V?.catalogItems?.features.length&&(l||!X)))return this._processVisibleRastersResponse(V,{returnDomainValues:o,templateRRFunctionNames:p,showNoDataRecords:l,templateFields:Y});const Z=this.objectIdField||"ObjectId",ie=V.catalogItems?.features??[],ce=ie.map(xe=>xe.attributes?.[Z]),he=new Ns({objectIds:ce,returnGeometry:!0,outSpatialReference:r.outSpatialReference,outFields:[Z]}),_e=await this.queryRasters(he);return _e?.features?.length&&_e.features.forEach(xe=>{ie.forEach(Pe=>{Pe.attributes[Z]===xe.attributes[Z]&&(Pe.geometry=new To(xe.geometry),ve(r.outSpatialReference)&&(Pe.geometry.spatialReference=r.outSpatialReference))})}),this._processVisibleRastersResponse(V,{returnDomainValues:o,templateRRFunctionNames:p,showNoDataRecords:l,templateFields:Y})}catch{throw new st("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(r,n){const s=ur(i(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:r}),signal:n}).then(l=>l.data?.statistics),o=ur(i(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):zTe(r.meshType,r.simulationSettings,r.flowData,ve(n.signal)?n.signal:new AbortController().signal)}getMultidimensionalSubsetVariables(r){const n=r??this.serviceRasterInfo.multidimensionalInfo;return MKe(this.multidimensionalSubset,n)}async _fetchService(r){await this._fetchServiceInfo(r),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const n=this.sourceJSON,s=ve(this.serviceRasterInfo)?Promise.resolve(this.serviceRasterInfo):XJe(i(this.parsedUrl),n,{signal:r,query:this._getQueryParams()}).then(l=>(this._set("serviceRasterInfo",l),this._set("multidimensionalInfo",l.multidimensionalInfo),l)),o=this._hasRenderingRule(this.renderingRule)?this.generateRasterInfo(this.renderingRule,{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),Oi.getLogger(this.declaredClass).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([sr(()=>this.renderingRule,h=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this.generateRasterInfo(h).then(p=>{p&&(this.rasterInfo=p)})})]);const{serviceRasterInfo:c}=this;ve(c.multidimensionalInfo)&&this._updateMultidimensionalDefinition(c)})}_combineMosaicRuleWithTimeExtent(r,n){const s=this.timeInfo,{multidimensionalInfo:o}=this.serviceRasterInfo;if(lt(r)||lt(o)||lt(n)||lt(s?.startField))return r;const{startField:a}=s,l=o.variables.some(I=>I.dimensions.some(P=>P.name===a))?a:"StdTime";if(r=r.clone(),this.sourceType==="mosaic-dataset")return r.multidimensionalDefinition=r.multidimensionalDefinition?.filter(I=>I.dimensionName!==l),this._cleanupMultidimensionalDefinition(r);r.multidimensionalDefinition=r.multidimensionalDefinition||[];const c=r.multidimensionalDefinition.filter(I=>I.dimensionName===l),h=ve(n.start)?n.start.getTime():null,p=ve(n.end)?n.end.getTime():null,y=h==null||p==null||h===p,v=y?[h||p]:[[h,p]],x=this.version>=10.8;if(c.length)c.forEach(I=>{I.dimensionName===l&&(x?(I.dimensionName=null,I.isSlice=!1,I.values=[]):(I.isSlice=y,I.values=v))});else if(!x){const I=r.multidimensionalDefinition.filter(P=>P.variableName!=null&&P.dimensionName==null);I.length?I.forEach(P=>{P.dimensionName=l,P.isSlice=y,P.values=v}):r.multidimensionalDefinition.push(new iM({variableName:"",dimensionName:l,isSlice:y,values:v}))}return this._cleanupMultidimensionalDefinition(r)}_cleanupMultidimensionalDefinition(r){return lt(r)?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 st("imagery-layer:query-rasters","query operation is not supported on the input image service");return r=ve(r)?Gd(Ns,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 EKe;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,renderingRule:s}=this;return r.type==="unique-value"&&this._hasRenderingRule(s)&&n?.bandCount===1&&["u8","s8"].includes(n.pixelType)||n!=null&&r!=null&&XKt(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 ur(i(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 st("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(lt(r))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=oTe(s);!a||s.bandCount===3&&a[0]===0&&a[1]===1&&a[2]===2||(this.bandIds=a)}r||(r=nTe(s,{bandIds:this.bandIds,variableName:this.renderingRule?null:this.mosaicRule?.multidimensionalDefinition?.[0].variableName}));const o=lTe(r.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=s):this.symbolizer=new fTe({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:ve(r.pixelBlock)?r.pixelBlock.clone():null}}_getQueryParams(r){r&&ve(r.renderingRule)&&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}):Sae(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 ur(i(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 I=`${i(this.parsedUrl)}/exportImage`,{data:P}=await ur(I,{responseType:o?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...r.imageServiceParameters}),signal:a});return P instanceof Blob?{imageBitmap:await rM(P,I),params:n}:{imageOrCanvasElement:P,params:n}}const l=this._initJobHandler(),c=ur(i(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...r.imageServiceParameters}),signal:a}),h=(await Promise.all([c,l]))[0].data,p=n.format||"jpgpng";let y=p;if(y!=="bsq"&&y!=="bip"&&(y=tJe(h)),!y)throw new st("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(h)));const v={signal:a};return{pixelData:{pixelBlock:await(p==="gif"||p==="bmp"||p.includes("png")&&(y==="png"||y==="jpg")?Sae(h,{useCanvas:!0,...n},v):this._decodePixelBlock(h,{width:n.width,height:n.height,planes:null,pixelType:null,noDataValue:null,format:p},v)),extent:n.extent},params:n}}_generateRasterInfo(r,n){const s={...n,query:this._getQueryParams()};return PZt(i(this.parsedUrl),r,s)}_isValidCustomizedMosaicRule(r){return r&&JSON.stringify(r.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(r){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let n=GCe(r,{multidimensionalSubset:this.multidimensionalSubset});if(ve(n)&&n.length>0){this.mosaicRule=this.mosaicRule||new q1;const s=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.renderingRule&&this.renderingRule.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:c}=n,h=r.processedValues;let p=r.catalogItems&&r.catalogItems.features,y=r.properties&&r.properties.Values&&r.properties.Values.map(j=>j.replace(/ /gi,", "))||[];const v=this.objectIdField||"ObjectId",x=typeof s=="string"&&s.toLowerCase().includes("nodata"),I=[];if(s&&!p&&!x){const j={};j[v]=0,y=[s],p=[new io(this.fullExtent,null,j)]}if(!p)return[];let P,F,k;this._updateResponseFieldNames(p,c),x&&!a&&(p=[]);for(let j=0;j0&&o&&o.length>0&&o.includes(this.renderingRule.functionName)?h[o.indexOf(this.renderingRule.functionName)]:s,F.toLowerCase()==="nodata"&&!a)continue;const V="Raster.ItemPixelValue",Y="Raster.ServicePixelValue";P.attributes[V]=F,P.attributes[Y]=k,this._updateFeatureWithMagDirValues(P,F);const X=this.fields&&this.fields.length>0;let Z=this.renderingRule&&ve(this.serviceRasterInfo.attributeTable)?X?F:s:k;this.renderingRule||(Z=X?F:s),this._updateFeatureWithRasterAttributeTableValues(P,Z)}if(P.sourceLayer=P.layer=this,l&&this._updateFeatureWithDomainValues(P),o&&h&&o.length===h.length)for(let V=0;Vp.name).filter(p=>p.toLowerCase()==="value"),c=l&&l[0];if(!c)return;const h=o.filter(p=>p.attributes[c]===(n!=null?parseInt(n,10):null));h&&h[0]&&a.forEach(p=>{const y=this._rasterAttributeTableFieldPrefix+p.name;r.attributes[y]=h[0].attributes[p.name]})}_updateFeatureWithMagDirValues(r,n){if(!this._isVectorDataSet())return;const s=n.split(/,\s*/).map(h=>parseFloat(h)),o=s.map(h=>[h]),a=s.map(h=>({minValue:h,maxValue:h,noDataValue:null})),l=new dn({height:1,width:1,pixelType:"f32",pixels:o,statistics:a});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:l,extent:new Ar(0,0,0,0,this.spatialReference)});const c=this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"?[l.pixels[0][0],l.pixels[1][0]]:oae([l.pixels[0][0],l.pixels[1][0]]);r.attributes["Raster.Magnitude"]=c[0],r.attributes["Raster.Direction"]=c[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;lt(s)||r.forEach(o=>{if(o&&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}_hasRenderingRule(r){return r!=null&&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().replace(/ /gi,"_");return n.has(s)?n.get(s):r}_isRFTJson(r){return r&&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,renderingRule:o}=this;o&&r.renderingRule==null&&(r.renderingRule=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"),c=r.serviceDataType==="esriImageServiceDataTypeElevation",h=!!(r.spatialReference||r.extent&&r.extent.spatialReference),p=n.includes("edit"),y=n.includes("mensuration")&&h,v=r.mensurationCapabilities==null?[]:r.mensurationCapabilities.toLowerCase().split(",").map(I=>I.trim()),x=y&&v.includes("basic");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:l,supportsExportImage:l,supportsIdentify:l,supportsMeasure:y,supportsDownload:n.includes("download"),supportsQuery:n.includes("catalog")&&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&&c,supportsComputePixelLocation:s>=10.7&&n.includes("catalog"),supportsComputeAngles:s>=10.91,supportsAdd:p,supportsDelete:p,supportsEditing:p,supportsUpdate:p,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryTopFeatures:!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,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:x,supportsAreaAndPerimeter:x,supportsPointOrCentroid:x,supportsHeightFromBaseAndTop:y&&v.includes("base-top height"),supportsHeightFromBaseAndTopShadow:y&&v.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:y&&v.includes("top-top shadow height"),supports3D:y&&v.includes("3d")}}}};function i(r){return r?.path??""}return E([N()],e.prototype,"_functionRasterInfos",void 0),E([N()],e.prototype,"_rasterJobHandler",void 0),E([N()],e.prototype,"_cachedRendererJson",void 0),E([N({readOnly:!0})],e.prototype,"_serviceSupportsMosaicRule",void 0),E([Vi("_serviceSupportsMosaicRule",["currentVersion","fields"])],e.prototype,"readServiceSupportsMosaicRule",null),E([N()],e.prototype,"_rasterAttributeTableFieldPrefix",void 0),E([N({readOnly:!0})],e.prototype,"_rasterFunctionNamesIndex",null),E([N()],e.prototype,"adjustAspectRatio",void 0),E([N({type:[Ls],json:{write:!0}})],e.prototype,"bandIds",void 0),E([Vi("bandIds")],e.prototype,"readBandIds",null),E([N({readOnly:!0,json:{read:!1}})],e.prototype,"capabilities",void 0),E([Vi("service","capabilities",["capabilities","currentVersion","serviceDataType"])],e.prototype,"readCapabilities",null),E([N({type:Number})],e.prototype,"compressionQuality",void 0),E([Cr("compressionQuality")],e.prototype,"writeCompressionQuality",null),E([N({type:Number})],e.prototype,"compressionTolerance",void 0),E([Cr("compressionTolerance")],e.prototype,"writeCompressionTolerance",null),E([N({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),E([N({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],e.prototype,"defaultMosaicRule",void 0),E([Vi("defaultMosaicRule",["defaultMosaicMethod"])],e.prototype,"readDefaultMosaicRule",null),E([N({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],e.prototype,"definitionExpression",void 0),E([N({readOnly:!0,constructOnly:!0})],e.prototype,"exportImageServiceParameters",void 0),E([N()],e.prototype,"rasterInfo",void 0),E([N({readOnly:!0,type:[Jo]})],e.prototype,"fields",void 0),E([N({readOnly:!0})],e.prototype,"fieldsIndex",null),E([N({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],e.prototype,"format",null),E([Vi("service","format",["serviceDataType"])],e.prototype,"readFormat",null),E([N({type:Ar})],e.prototype,"fullExtent",void 0),E([N({readOnly:!0})],e.prototype,"hasMultidimensions",void 0),E([N({json:{read:{source:"maxImageHeight"}}})],e.prototype,"imageMaxHeight",void 0),E([N({json:{read:{source:"maxImageWidth"}}})],e.prototype,"imageMaxWidth",void 0),E([N({type:String,json:{type:BA.jsonValues,read:BA.read,write:BA.write}})],e.prototype,"interpolation",void 0),E([N()],e.prototype,"minScale",void 0),E([Vi("service","minScale")],e.prototype,"readMinScale",null),E([N()],e.prototype,"maxScale",void 0),E([Vi("service","maxScale")],e.prototype,"readMaxScale",null),E([N({type:q1})],e.prototype,"mosaicRule",null),E([Vi("mosaicRule",["mosaicRule","defaultMosaicMethod"])],e.prototype,"readMosaicRule",null),E([Cr("mosaicRule")],e.prototype,"writeMosaicRule",null),E([N()],e.prototype,"multidimensionalInfo",void 0),E([N({type:TKe,json:{write:!0}})],e.prototype,"multidimensionalSubset",void 0),E([N({json:{type:Ls}})],e.prototype,"noData",void 0),E([Cr("noData")],e.prototype,"writeNoData",null),E([N({type:String,json:{type:hY.jsonValues,read:hY.read,write:hY.write}})],e.prototype,"noDataInterpretation",void 0),E([N({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],e.prototype,"objectIdField",void 0),E([Vi("objectIdField")],e.prototype,"readObjectIdField",null),E([N({})],e.prototype,"geometryType",void 0),E([N({})],e.prototype,"typeIdField",void 0),E([N({})],e.prototype,"types",void 0),E([N({readOnly:!0})],e.prototype,"parsedUrl",null),E([N({type:Function})],e.prototype,"pixelFilter",void 0),E([N()],e.prototype,"raster",void 0),E([N({readOnly:!0})],e.prototype,"sourceType",void 0),E([Vi("sourceType",["serviceSourceType","fields"])],e.prototype,"readSourceType",null),E([N()],e.prototype,"viewId",void 0),E([N({types:lY,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:dae,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:r=>({enabled:r&&r.type!=="vector-field"&&r.type!=="flow"})}}}}})],e.prototype,"renderer",null),E([Vi("renderer")],e.prototype,"readRenderer",null),E([Cr("renderer")],e.prototype,"writeRenderer",null),E([N()],e.prototype,"symbolizer",void 0),E([N(Tq)],e.prototype,"opacity",void 0),E([N({readOnly:!0})],e.prototype,"rasterFields",null),E([N({constructOnly:!0})],e.prototype,"rasterFunctionInfos",void 0),E([N({type:pu})],e.prototype,"renderingRule",null),E([Vi("renderingRule",["renderingRule","rasterFunctionInfos"])],e.prototype,"readRenderingRule",null),E([Cr("renderingRule")],e.prototype,"writeRenderingRule",null),E([N()],e.prototype,"serviceDataType",void 0),E([N({readOnly:!0,type:hr})],e.prototype,"spatialReference",void 0),E([Vi("spatialReference",["spatialReference","extent"])],e.prototype,"readSpatialReference",null),E([N({json:{type:HTe.jsonValues}})],e.prototype,"pixelType",void 0),E([Vi("pixelType")],e.prototype,"readPixelType",null),E([Cr("pixelType")],e.prototype,"writePixelType",null),E([N({constructOnly:!0,type:O2})],e.prototype,"serviceRasterInfo",void 0),E([N()],e.prototype,"sourceJSON",void 0),E([N(Qy)],e.prototype,"url",void 0),E([N({readOnly:!0})],e.prototype,"version",void 0),E([Vi("version",["currentVersion","fields","timeInfo"])],e.prototype,"readVersion",null),e=E([dt("esri.layers.mixins.ArcGISImageService")],e),e};let gw=class extends up(eT(Ch(qc(Sh(XZt(s0(y2(r_(Yu(du)))))))))){constructor(...e){super(...e),this.legendEnabled=!0,this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery"}normalizeCtorArgs(e,i){return typeof e=="string"?{url:e,...i}:e}load(e){const i=ve(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(Ya).then(()=>this._fetchService(i))),Promise.resolve(this)}writeOperationalLayerType(e,i,r){const n=this.renderer?.type==="vector-field";i[r]=n?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const i=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 l of i){const c=l.name.toLowerCase();a.has(c)||c.includes("raster.servicepixelvalue.")||n.add(l.name)}return o&&n.add("raster.magnitude").add("raster.direction"),G1({fields:i,title:r},{...e,visibleFieldNames:n})}queryFeatures(e,i){return this.queryRasters(e,i).then(r=>{if(r?.features)for(const n of r.features)n.layer=n.sourceLayer=this;return r})}queryFeatureCount(e,i){return this.queryRasterCount(e,i)}redraw(){this.emit("redraw")}serviceSupportsSpatialReference(e){return Woe(this,e)}};E([N(B1)],gw.prototype,"legendEnabled",void 0),E([N({type:["show","hide"]})],gw.prototype,"listMode",void 0),E([N({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],gw.prototype,"isReference",void 0),E([N({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],gw.prototype,"operationalLayerType",void 0),E([Cr("web-map","operationalLayerType")],gw.prototype,"writeOperationalLayerType",null),E([N(s_)],gw.prototype,"popupEnabled",void 0),E([N({type:wh,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],gw.prototype,"popupTemplate",void 0),E([N({readOnly:!0})],gw.prototype,"defaultPopupTemplate",null),E([N({readOnly:!0,json:{read:!1}})],gw.prototype,"type",void 0),gw=E([dt("esri.layers.ImageryLayer")],gw);const KZt=Object.freeze(Object.defineProperty({__proto__:null,default:gw},Symbol.toStringTag,{value:"Module"})),tZe=96;function Nae(t,e){const i=e||t.extent,r=t.width,n=Hc(i&&i.spatialReference);return i&&r?i.width/r*n*eGe*tZe:0}function JZt(t,e){return t/(Hc(e)*eGe*tZe)}let J5=class{constructor(e,i,r=""){this.major=e,this.minor=i,this._context=r}lessThan(e,i){return this.major{let e=class extends t{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesPromise=null,this._allLayersAndTablesMap=null}readCapabilities(i,r){const n=r.capabilities&&r.capabilities.split(",").map(k=>k.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"),c=!!r.exportTilesAllowed,h=n.includes("tilemap"),p=n.includes("data"),y=s!=="tile"&&(!r.tileInfo||o),v=s!=="tile"&&(!r.tileInfo||o),x=s!=="tile",I=r.cimVersion&&J5.parse(r.cimVersion),P=I?.since(1,4)??!1,F=I?.since(2,0)??!1;return{operations:{supportsExportMap:l,supportsExportTiles:c,supportsIdentify:a,supportsQuery:p,supportsTileMap:h},exportMap:l?{supportsArcadeExpressionForLabeling:P,supportsSublayersChanges:x,supportsDynamicLayers:o,supportsSublayerVisibility:y,supportsSublayerDefinitionExpression:v,supportsCIMSymbols:F}:null,exportTiles:c?{maxExportTilesCount:+r.maxExportTilesCount}:null}}readVersion(i,r){let n=r.currentVersion;return n||(n=r.hasOwnProperty("capabilities")||r.hasOwnProperty("tables")?10:r.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),n}async fetchSublayerInfo(i,r){try{return await this.fetchAllLayersAndTables(r),this._allLayersAndTablesMap?.get(i)}catch{return}}async fetchAllLayersAndTables(i){await this.load(i),this._allLayersAndTablesPromise||(this._allLayersAndTablesPromise=ur(fa(this.url).path+"/layers",{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(n=>{this._allLayersAndTablesMap=new Map;for(const s of n.data.layers)this._allLayersAndTablesMap.set(s.id,s);return{result:n.data}},n=>({error:n})));const r=await this._allLayersAndTablesPromise;if(yn(i),"result"in r)return r.result;throw r.error}};return E([N({readOnly:!0})],e.prototype,"capabilities",void 0),E([Vi("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],e.prototype,"readCapabilities",null),E([N({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),E([N({type:Ar})],e.prototype,"fullExtent",void 0),E([N(G9)],e.prototype,"id",void 0),E([N({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],e.prototype,"legendEnabled",void 0),E([N(s_)],e.prototype,"popupEnabled",void 0),E([N({type:hr})],e.prototype,"spatialReference",void 0),E([N({readOnly:!0})],e.prototype,"version",void 0),E([Vi("version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],e.prototype,"readVersion",null),e=E([dt("esri.layers.mixins.ArcGISMapService")],e),e};let DB=class extends Sr{constructor(e){super(e),this.getCollections=null}initialize(){this.own(KVe(()=>this._refresh()))}destroy(){this.getCollections=null}_refresh(){const e=ve(this.getCollections)?this.getCollections():null;if(lt(e))return void this.removeAll();let i=0;for(const r of e)ve(r)&&(i=this._processCollection(i,r));this.splice(i,this.length)}_createNewInstance(e){return new Sr(e)}_processCollection(e,i){if(!i)return e;const r=this.itemFilterFunction?this.itemFilterFunction:n=>!!n;for(const n of i)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}};E([N()],DB.prototype,"getCollections",void 0),E([N()],DB.prototype,"getChildrenFunction",void 0),E([N()],DB.prototype,"itemFilterFunction",void 0),DB=E([dt("esri.core.CollectionFlattener")],DB);const L2=DB;async function ZZt(t,e,i){const r=hh(t);return MJe(r,Ns.from(e),{...i}).then(n=>({count:n.data.count,extent:Ar.fromJSON(n.data.extent)}))}function QZt(t,e){return e}function WTe(t,e,i,r){switch(i){case 0:return wY(t,e+r,0);case 1:return t.originPosition==="lowerLeft"?wY(t,e+r,1):iQt(t,e+r,1)}}function rZe(t,e,i,r){return i===2?wY(t,e,2):WTe(t,e,i,r)}function eQt(t,e,i,r){return i===2?wY(t,e,3):WTe(t,e,i,r)}function tQt(t,e,i,r){return i===3?wY(t,e,3):rZe(t,e,i,r)}function wY({translate:t,scale:e},i,r){return t[r]+i*e[r]}function iQt({translate:t,scale:e},i,r){return t[r]-i*e[r]}let rQt=class{constructor(e){this._options=e,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=QZt,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const i=F9(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(!lt(i))for(const r of e.features)i(r.geometry)}createSpatialReference(){return{}}addField(e,i){const r=e.fields;sg(r),r.push(i);const n=r.map(s=>s.name);this._attributesConstructor=function(){for(const s of n)this[s]=null}}addFeature(e,i){e.features.push(i)}prepareFeatures(e){switch(this._transform=e.transform,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"esriGeometryPoint":this.addCoordinate=(i,r,n)=>this.addCoordinatePoint(i,r,n),this.createGeometry=i=>this.createPointGeometry(i);break;case"esriGeometryPolygon":this.addCoordinate=(i,r,n)=>this._addCoordinatePolygon(i,r,n),this.createGeometry=i=>this._createPolygonGeometry(i);break;case"esriGeometryPolyline":this.addCoordinate=(i,r,n)=>this._addCoordinatePolyline(i,r,n),this.createGeometry=i=>this._createPolylineGeometry(i);break;case"esriGeometryMultipoint":this.addCoordinate=(i,r,n)=>this._addCoordinateMultipoint(i,r,n),this.createGeometry=i=>this._createMultipointGeometry(i)}}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,i,r){this._lengths.length===0&&(this._toAddInCurrentPath=i),this._lengths.push(i)}addQueryGeometry(e,i){const{queryGeometry:r,queryGeometryType:n}=i,s=RB(r.clone(),r,!1,!1,this._transform),o=pw(s,n,!1,!1);e.queryGeometryType=n,e.queryGeometry={...o}}createPointGeometry(e){const i={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(i.z=0),e.hasM&&(i.m=0),i}addCoordinatePoint(e,i,r){const n=Ou(this._transform,"transform");switch(i=this._applyTransform(n,i,r,0),r){case 0:e.x=i;break;case 1:e.y=i;break;case 2:"z"in e?e.z=i:e.m=i;break;case 3:e.m=i}}_transformPathLikeValue(e,i){let r=0;i<=1&&(r=this._previousCoordinate[i],this._previousCoordinate[i]+=e);const n=Ou(this._transform,"transform");return this._applyTransform(n,e,i,r)}_addCoordinatePolyline(e,i,r){this._dehydratedAddPointsCoordinate(e.paths,i,r)}_addCoordinatePolygon(e,i,r){this._dehydratedAddPointsCoordinate(e.rings,i,r)}_addCoordinateMultipoint(e,i,r){r===0&&e.points.push([]);const n=this._transformPathLikeValue(i,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,i,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(i,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:i,hasM:r}=e;return i&&r?tQt:i?rZe:r?eQt:WTe}};async function nQt(t,e,i){const r=hh(t),n={...i},s=Ns.from(e),o=!s.quantizationParameters,{data:a}=await yTe(r,s,new rQt({sourceSpatialReference:s.sourceSpatialReference,applyTransform:o}),n);return a}let yw=class extends Tn{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 fa(this.url)}async execute(e,i){const r=await this.executeJSON(e,i);return this.featureSetFromJSON(e,r,i)}async executeJSON(e,i){const r=this._normalizeQuery(e),n=e.outStatistics?.[0]!=null,s=Hi("featurelayer-pbf-statistics"),o=!n||s;let a;if(this.pbfSupported&&o)try{a=await nQt(this.url,r,i)}catch(l){if(l.name!=="query:parsing-pbf")throw l;this.pbfSupported=!1}return this.pbfSupported&&o||(a=await DJe(this.url,r,i)),this._normalizeFields(a.fields),a}async featureSetFromJSON(e,i,r){if(!this._queryIs3DObjectFormat(e)||lt(this.infoFor3D)||!i.assetMaps||!i.features||!i.features.length)return tc.fromJSON(i);const{meshFeatureSetFromJSON:n}=await zg(Promise.resolve().then(()=>$Gi),r);return n(e,this.infoFor3D,i)}executeForCount(e,i){return FTe(this.url,this._normalizeQuery(e),i)}executeForExtent(e,i){return ZZt(this.url,this._normalizeQuery(e),i)}executeForIds(e,i){return Lae(this.url,this._normalizeQuery(e),i)}async executeRelationshipQuery(e,i){const[{default:r},{executeRelationshipQuery:n}]=await zg(Promise.all([Promise.resolve().then(()=>Qqe),Promise.resolve().then(()=>ZZe)]),i);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,i)}async executeRelationshipQueryForCount(e,i){const[{default:r},{executeRelationshipQueryForCount:n}]=await zg(Promise.all([Promise.resolve().then(()=>Qqe),Promise.resolve().then(()=>ZZe)]),i);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,i)}async executeAttachmentQuery(e,i){const{executeAttachmentQuery:r,fetchAttachments:n,processAttachmentQueryResult:s}=await zg(Promise.resolve().then(()=>KQt),i),o=hh(this.url);return s(o,await(this.queryAttachmentsSupported?r(o,e,i):n(o,e,i)))}async executeTopFeaturesQuery(e,i){const{executeTopFeaturesQuery:r}=await zg(Promise.resolve().then(()=>lei),i);return r(this.parsedUrl,e,this.sourceSpatialReference,i)}async executeForTopIds(e,i){const{executeForTopIds:r}=await zg(Promise.resolve().then(()=>cei),i);return r(this.parsedUrl,e,i)}async executeForTopExtents(e,i){const{executeForTopExtents:r}=await zg(Promise.resolve().then(()=>dei),i);return r(this.parsedUrl,e,i)}async executeForTopCount(e,i){const{executeForTopCount:r}=await zg(Promise.resolve().then(()=>fei),i);return r(this.parsedUrl,e,i)}_normalizeQuery(e){let i=Ns.from(e);if(i.sourceSpatialReference=i.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(i=i===e?i.clone():i,i.gdbVersion=e.gdbVersion||this.gdbVersion,i.dynamicDataSource=e.dynamicDataSource?rv.from(e.dynamicDataSource):this.dynamicDataSource),ve(this.infoFor3D)&&this._queryIs3DObjectFormat(e)){i=i===e?i.clone():i,i.formatOf3DObjects=null;for(const r of this.infoFor3D.queryFormats){if(r==="3D_glb"){i.formatOf3DObjects=r;break}r!=="3D_gltf"||i.formatOf3DObjects||(i.formatOf3DObjects=r)}if(!i.formatOf3DObjects)throw new st("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(lt(i.outFields)||!i.outFields.includes("*")){i=i===e?i.clone():i,lt(i.outFields)&&(i.outFields=[]);const{originX:r,originY:n,originZ:s,translationX:o,translationY:a,translationZ:l,scaleX:c,scaleY:h,scaleZ:p,rotationX:y,rotationY:v,rotationZ:x,rotationDeg:I}=this.infoFor3D.transformFieldRoles;i.outFields.push(r,n,s,o,a,l,c,h,p,y,v,x,I)}}return i}_normalizeFields(e){if(ve(this.fieldsIndex)&&ve(e))for(const i of e){const r=this.fieldsIndex.get(i.name);r&&Object.assign(i,r.toJSON())}}_queryIs3DObjectFormat(e){return ve(this.infoFor3D)&&e.returnGeometry===!0&&e.multipatchOption!=="xyFootprint"&&!e.outStatistics}};E([N({type:rv})],yw.prototype,"dynamicDataSource",void 0),E([N()],yw.prototype,"fieldsIndex",void 0),E([N()],yw.prototype,"gdbVersion",void 0),E([N()],yw.prototype,"infoFor3D",void 0),E([N({readOnly:!0})],yw.prototype,"parsedUrl",null),E([N()],yw.prototype,"pbfSupported",void 0),E([N()],yw.prototype,"queryAttachmentsSupported",void 0),E([N()],yw.prototype,"sourceSpatialReference",void 0),E([N({type:String})],yw.prototype,"url",void 0),yw=E([dt("esri.tasks.QueryTask")],yw);const nZe=yw;var kae;function qTe(t){return t!=null&&t.type==="esriSMS"}function YTe(t,e,i){const r=this.originIdOf(e)>=Ug(i.origin);return{ignoreOrigin:!0,allowNull:r,enabled:!!i&&i.layer?.type==="map-image"&&(i.writeSublayerStructure||r)}}function sZe(t,e,i){return{enabled:!!i&&i.layer?.type==="tile"&&this._isOverridden(e)}}function vw(t,e,i){return{ignoreOrigin:!0,enabled:i&&i.writeSublayerStructure||!1}}function $ae(t,e,i){return{ignoreOrigin:!0,enabled:!!i&&(i.writeSublayerStructure||this.originIdOf(e)>=Ug(i.origin))}}let sQt=0;const Z5=new Set;Z5.add("layer"),Z5.add("parent"),Z5.add("loaded"),Z5.add("loadStatus"),Z5.add("loadError"),Z5.add("loadWarnings");let ma=kae=class extends Ud(Yu(D1(gd))){constructor(t){super(t),this.capabilities=void 0,this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.legendEnabled=!0,this.objectIdField=null,this.popupEnabled=!0,this.popupTemplate=null,this.sourceJSON=null,this.title=null,this.typeIdField=null,this.types=null,this._lastParsedUrl=null}async load(t){return this.addResolvingPromise((async()=>{const{layer:e,source:i,url:r}=this;if(!e&&!r)throw new st("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});let n=null;if(!e||this.originIdOf("url")>Yn.SERVICE||i?.type==="data-layer")n=(await ur(r,{responseType:"json",query:{f:"json"},...t})).data;else{let s=this.id;i?.type==="map-layer"&&(s=i.mapLayerId),n=await e.fetchSublayerInfo(s,t)}n&&(this.sourceJSON=n,this.read({layerDefinition:n},{origin:"service"}))})()),this}readCapabilities(t,e){e=e.layerDefinition||e;const{operations:{supportsQuery:i,supportsQueryAttachments:r},query:{supportsFormatPBF:n},data:{supportsAttachment:s}}=fSe(e,this.url);return{exportMap:{supportsModification:!!e.canModifyLayer},operations:{supportsQuery:i,supportsQueryAttachments:r},data:{supportsAttachment:s},query:{supportsFormatPBF:n}}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(t){this._setAndNotifyLayer("definitionExpression",t)}get fieldsIndex(){return new Lm(this.fields||[])}set floorInfo(t){this._setAndNotifyLayer("floorInfo",t)}readGlobalIdFieldFromService(t,e){if((e=e.layerDefinition||e).globalIdField)return e.globalIdField;if(e.fields){for(const i of e.fields)if(i.type==="esriFieldTypeGlobalID")return i.name}}get id(){return this._get("id")??sQt++}set id(t){this._get("id")!==t&&(this.layer?.capabilities?.exportMap?.supportsDynamicLayers!==!1?this._set("id",t):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}set labelingInfo(t){this._setAndNotifyLayer("labelingInfo",t)}writeLabelingInfo(t,e,i,r){t&&t.length&&(e.layerDefinition={drawingInfo:{labelingInfo:t.map(n=>n.write({},r))}})}set labelsVisible(t){this._setAndNotifyLayer("labelsVisible",t)}set layer(t){this._set("layer",t),this.sublayers&&this.sublayers.forEach(e=>e.layer=t)}set listMode(t){this._set("listMode",t)}set minScale(t){this._setAndNotifyLayer("minScale",t)}readMinScale(t,e){return e.minScale||e.layerDefinition&&e.layerDefinition.minScale||0}set maxScale(t){this._setAndNotifyLayer("maxScale",t)}readMaxScale(t,e){return e.maxScale||e.layerDefinition&&e.layerDefinition.maxScale||0}get effectiveScaleRange(){const{minScale:t,maxScale:e}=this;return{minScale:t,maxScale:e}}readObjectIdFieldFromService(t,e){if((e=e.layerDefinition||e).objectIdField)return e.objectIdField;if(e.fields){for(const i of e.fields)if(i.type==="esriFieldTypeOID")return i.name}}set opacity(t){this._setAndNotifyLayer("opacity",t)}readOpacity(t,e){const i=e.layerDefinition;return 1-.01*((i?.transparency!=null?i.transparency:i?.drawingInfo?.transparency)??0)}writeOpacity(t,e,i,r){e.layerDefinition={drawingInfo:{transparency:100-100*t}}}writeParent(t,e){this.parent&&this.parent!==this.layer?e.parentLayerId=zre(this.parent.id):e.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{spatialReference:t}=this.layer,e="gdbVersion"in this.layer?this.layer.gdbVersion:void 0,{capabilities:i,fieldsIndex:r}=this,n=Hi("featurelayer-pbf")&&i?.query.supportsFormatPBF,s=i?.operations?.supportsQueryAttachments??!1;return new nZe({url:this.url,pbfSupported:n,fieldsIndex:r,gdbVersion:e,sourceSpatialReference:t,queryAttachmentsSupported:s})}set renderer(t){if(t){for(const e of t.getSymbols())if(_R(e)){Oi.getLogger(this.declaredClass).warn("Sublayer renderer should use 2D symbols");break}}this._setAndNotifyLayer("renderer",t)}get source(){return this._get("source")||new CA({mapLayerId:this.id})}set source(t){this._setAndNotifyLayer("source",t)}set sublayers(t){this._handleSublayersChange(t,this._get("sublayers")),this._set("sublayers",t)}castSublayers(t){return fd(Sr.ofType(kae),t)}writeSublayers(t,e,i){this.sublayers?.length&&(e[i]=this.sublayers.map(r=>r.id).toArray().reverse())}readTypeIdField(t,e){let i=(e=e.layerDefinition||e).typeIdField;if(i&&e.fields){i=i.toLowerCase();const r=e.fields.find(n=>n.name.toLowerCase()===i);r&&(i=r.name)}return i}get url(){const t=this.layer?.parsedUrl??this._lastParsedUrl,e=this.source;if(!t)return null;if(this._lastParsedUrl=t,e?.type==="map-layer")return`${t.path}/${e.mapLayerId}`;const i={layer:JSON.stringify({source:this.source})};return`${t.path}/dynamicLayer?${Wv(i)}`}set url(t){this._overrideIfSome("url",t)}set visible(t){this._setAndNotifyLayer("visible",t)}writeVisible(t,e,i,r){e[i]=this.getAtOrigin("defaultVisibility","service")||t}clone(){const{store:t}=Mp(this),e=new kae;return Mp(e).store=t.clone(Z5),this.commitProperty("url"),e._lastParsedUrl=this._lastParsedUrl,e}createPopupTemplate(t){return G1(this,t)}createQuery(){return new Ns({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const{layer:t}=this,e=t?.parsedUrl,i=new(await Promise.resolve().then(()=>lCe)).default({url:e?.path});return e&&this.source&&(this.source.type==="map-layer"?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source),t?.refreshInterval!=null&&(i.refreshInterval=t.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=gi(this.floorInfo)),this.originIdOf("labelingInfo")>Yn.SERVICE&&(i.labelingInfo=gi(this.labelingInfo)),this.originIdOf("labelsVisible")>Yn.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>Yn.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>Yn.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>Yn.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>Yn.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>Yn.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>Yn.DEFAULTS&&(i.popupTemplate=gi(this.popupTemplate)),this.originIdOf("renderer")>Yn.SERVICE&&(i.renderer=gi(this.renderer)),this.source?.type==="data-layer"&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>Yn.DEFAULTS&&(i.title=this.title),t?.type==="map-image"&&t.originIdOf("customParameters")>Yn.DEFAULTS&&(i.customParameters=t.customParameters),t?.type==="tile"&&t.originIdOf("customParameters")>Yn.DEFAULTS&&(i.customParameters=t.customParameters),i}getField(t){return this.fieldsIndex.get(t)}getFeatureType(t){const{typeIdField:e,types:i}=this;if(!e||!t)return null;const r=t.attributes?t.attributes[e]:void 0;if(r==null)return null;let n=null;return i?.some(s=>{const{id:o}=s;return o!=null&&(o.toString()===r.toString()&&(n=s),!!n)}),n}getFieldDomain(t,e){const i=e&&e.feature,r=this.getFeatureType(i);if(r){const n=r.domains&&r.domains[t];if(n&&n.type!=="inherited")return n}return this._getLayerDomain(t)}async queryAttachments(t,e){await this.load(),t=Toe.from(t);const i=this.capabilities;if(!i?.data?.supportsAttachment)throw new st("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:r,objectIds:n,globalIds:s,num:o,size:a,start:l,where:c}=t;if(!i?.operations?.supportsQueryAttachments&&(r?.length>0||s?.length>0||a?.length>0||o||l||c))throw new st("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",t);if(!(n?.length||s?.length||c))throw new st("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",t);return this.queryTask.executeAttachmentQuery(t,e)}async queryFeatures(t=this.createQuery(),e){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new st("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new st("queryFeatures:not-supported","this layer has no url.");const i=await this.queryTask.execute(t,{...e,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(i?.features)for(const r of i.features)r.sourceLayer=this;return i}toExportImageJSON(t){const e={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},i=OR(t,this.definitionExpression);ve(i)&&(e.definitionExpression=i);const r=["renderer","labelingInfo","opacity","labelsVisible"].reduce((s,o)=>(s[o]=this.originIdOf(o),s),{});if(Object.keys(r).some(s=>r[s]>Yn.SERVICE)){const s=e.drawingInfo={};if(r.renderer>Yn.SERVICE&&(s.renderer=this.renderer?this.renderer.toJSON():null),r.labelsVisible>Yn.SERVICE&&(s.showLabels=this.labelsVisible),this.labelsVisible&&r.labelingInfo>Yn.SERVICE){!this.loaded&&this.labelingInfo.some(a=>!a.labelPlacement)&&Oi.getLogger(this.declaredClass).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;ve(this.geometryType)&&(o=iCe(this.labelingInfo,Yy.toJSON(this.geometryType))),s.labelingInfo=o.filter(a=>a.labelPlacement).map(a=>a.toJSON({origin:"service",layer:this.layer})),s.showLabels=!0}r.opacity>Yn.SERVICE&&(s.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(s.renderer)}return e}_assignDefaultSymbolColors(t){this._forEachSimpleMarkerSymbols(t,e=>{e.color||e.style!=="esriSMSX"&&e.style!=="esriSMSCross"||(e.outline&&e.outline.color?e.color=e.outline.color:e.color=[0,0,0,0])})}_forEachSimpleMarkerSymbols(t,e){if(t){const i=("uniqueValueInfos"in t?t.uniqueValueInfos:"classBreakInfos"in t?t.classBreakInfos:null)??[];for(const r of i)qTe(r.symbol)&&e(r.symbol);"symbol"in t&&qTe(t.symbol)&&e(t.symbol),"defaultSymbol"in t&&qTe(t.defaultSymbol)&&e(t.defaultSymbol)}}_setAndNotifyLayer(t,e){const i=this.layer,r=this._get(t);let n,s;switch(t){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=Mp(this).getDefaultOrigin();if(o!=="service"){if(n&&this.layer?.capabilities?.exportMap?.[n]===!1)return void this._logLockedError(t,`capability not available 'layer.capabilities.exportMap.${n}'`);if(s&&this.capabilities?.exportMap[s]===!1)return void this._logLockedError(t,`capability not available 'capabilities.exportMap.${s}'`)}t!=="source"||this.loadStatus==="not-loaded"?(this._set(t,e),o!=="service"&&r!==e&&i&&i.emit&&i.emit("sublayer-update",{propertyName:t,target:this})):this._logLockedError(t,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(t,e){e&&(e.forEach(i=>{i.parent=null,i.layer=null}),this.handles.removeAll()),t&&(t.forEach(i=>{i.parent=this,i.layer=this.layer}),this.handles.add([t.on("after-add",({item:i})=>{i.parent=this,i.layer=this.layer}),t.on("after-remove",({item:i})=>{i.parent=null,i.layer=null}),t.on("before-changes",i=>{const r=this.layer?.capabilities?.exportMap?.supportsSublayersChanges;r==null||r||(Oi.getLogger(this.declaredClass).error(new st("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),i.preventDefault())})]))}_logLockedError(t,e){const{layer:i,declaredClass:r}=this;Oi.getLogger(r).error(new st("sublayer:locked",`Property '${String(t)}' can't be changed on Sublayer from the layer '${i?.id}'`,{reason:e,sublayer:this,layer:i}))}_getLayerDomain(t){const e=this.fieldsIndex.get(t);return e?e.domain:null}};ma.test={isMapImageLayerOverridePolicy:t=>t===vw||t===YTe,isTileImageLayerOverridePolicy:t=>t===sZe},E([N({readOnly:!0})],ma.prototype,"capabilities",void 0),E([Vi("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],ma.prototype,"readCapabilities",null),E([N()],ma.prototype,"defaultPopupTemplate",null),E([N({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:YTe}}})],ma.prototype,"definitionExpression",null),E([N({type:[Jo],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],ma.prototype,"fields",void 0),E([N({readOnly:!0})],ma.prototype,"fieldsIndex",null),E([N({type:pSe,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:YTe},origins:{"web-scene":{read:!1,write:!1}}}})],ma.prototype,"floorInfo",null),E([N({type:Ar,json:{read:{source:"layerDefinition.extent"}}})],ma.prototype,"fullExtent",void 0),E([N({type:Yy.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:Yy.read}}}}})],ma.prototype,"geometryType",void 0),E([N({type:String})],ma.prototype,"globalIdField",void 0),E([Vi("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],ma.prototype,"readGlobalIdFieldFromService",null),E([N({type:Ls,json:{write:{ignoreOrigin:!0}}})],ma.prototype,"id",null),E([N({value:null,type:[E2],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:vw}}})],ma.prototype,"labelingInfo",null),E([Cr("labelingInfo")],ma.prototype,"writeLabelingInfo",null),E([N({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:vw}}})],ma.prototype,"labelsVisible",null),E([N({value:null})],ma.prototype,"layer",null),E([N({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:$ae}}})],ma.prototype,"legendEnabled",void 0),E([N({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],ma.prototype,"listMode",null),E([N({type:Number,value:0,json:{write:{overridePolicy:vw}}})],ma.prototype,"minScale",null),E([Vi("minScale",["minScale","layerDefinition.minScale"])],ma.prototype,"readMinScale",null),E([N({type:Number,value:0,json:{write:{overridePolicy:vw}}})],ma.prototype,"maxScale",null),E([Vi("maxScale",["maxScale","layerDefinition.maxScale"])],ma.prototype,"readMaxScale",null),E([N({readOnly:!0})],ma.prototype,"effectiveScaleRange",null),E([N({type:String})],ma.prototype,"objectIdField",void 0),E([Vi("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],ma.prototype,"readObjectIdFieldFromService",null),E([N({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:vw}}})],ma.prototype,"opacity",null),E([Vi("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],ma.prototype,"readOpacity",null),E([Cr("opacity")],ma.prototype,"writeOpacity",null),E([N({json:{type:Ls,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:vw}}})],ma.prototype,"parent",void 0),E([Cr("parent")],ma.prototype,"writeParent",null),E([N({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(t,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy:$ae,writer(t,e,i){e[i]=!t}}}})],ma.prototype,"popupEnabled",void 0),E([N({type:wh,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:$ae}}})],ma.prototype,"popupTemplate",void 0),E([N({readOnly:!0})],ma.prototype,"queryTask",null),E([N({types:vA,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:vw},origins:{"web-scene":{types:AR,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:vw}}}}})],ma.prototype,"renderer",null),E([N({types:{key:"type",base:null,typeMap:{"data-layer":rv,"map-layer":CA}},cast(t){if(t){if("mapLayerId"in t)return Gd(CA,t);if("dataSource"in t)return Gd(rv,t)}return t},json:{name:"layerDefinition.source",write:{overridePolicy:vw}}})],ma.prototype,"source",null),E([N()],ma.prototype,"sourceJSON",void 0),E([N({value:null,json:{type:[Ls],write:{target:"subLayerIds",allowNull:!0,overridePolicy:vw}}})],ma.prototype,"sublayers",null),E([ho("sublayers")],ma.prototype,"castSublayers",null),E([Cr("sublayers")],ma.prototype,"writeSublayers",null),E([N({type:String,json:{name:"name",write:{overridePolicy:$ae}}})],ma.prototype,"title",void 0),E([N({type:String})],ma.prototype,"typeIdField",void 0),E([Vi("typeIdField",["layerDefinition.typeIdField"])],ma.prototype,"readTypeIdField",null),E([N({type:[cB],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],ma.prototype,"types",void 0),E([N({type:String,json:{read:{source:"layerUrl"},write:{target:"layerUrl",overridePolicy:sZe}}})],ma.prototype,"url",null),E([N({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:vw}}})],ma.prototype,"visible",null),E([Cr("visible")],ma.prototype,"writeVisible",null),ma=kae=E([dt("esri.layers.support.Sublayer")],ma);const xY=ma;function oZe(t,e,i){return e.flatten(({sublayers:n})=>n).length!==t.length?!0:!!t.some(n=>n.originIdOf("minScale")>i||n.originIdOf("maxScale")>i||n.originIdOf("renderer")>i||n.originIdOf("labelingInfo")>i||n.originIdOf("opacity")>i||n.originIdOf("labelsVisible")>i||n.originIdOf("source")>i)||!lZe(t,e)}function aZe(t,e,i){return!!t.some(r=>{const n=r.source;return!(!n||n.type==="map-layer"&&n.mapLayerId===r.id&&(lt(n.gdbVersion)||n.gdbVersion===i))||r.originIdOf("renderer")>Yn.SERVICE||r.originIdOf("labelingInfo")>Yn.SERVICE||r.originIdOf("opacity")>Yn.SERVICE||r.originIdOf("labelsVisible")>Yn.SERVICE})||!lZe(t,e)}function lZe(t,e){if(!t||!t.length||lt(e))return!0;const i=e.slice().reverse().flatten(({sublayers:s})=>s&&s.toArray().reverse()).map(s=>s.id).toArray();if(t.length>i.length)return!1;let r=0;const n=i.length;for(const{id:s}of t){for(;r=n)return!1}return!0}function oQt(t){return!!t&&t.some(e=>e.minScale!=null||e.layerDefinition&&e.layerDefinition.minScale!=null)}const aQt=Oi.getLogger("esri.layers.TileLayer");function lQt(t,e){const i=[],r={};return t&&t.forEach(n=>{const s=new xY;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 i.unshift(s)}),i}const XTe=Sr.ofType(xY);function uZe(t,e){t&&t.forEach(i=>{e(i),i.sublayers&&i.sublayers.length&&uZe(i.sublayers,e)})}const cZe=t=>{let e=class extends t{constructor(...i){super(...i),this.allSublayers=new L2({getCollections:()=>[this.sublayers],getChildrenFunction:r=>r.sublayers}),this.sublayersSourceJSON={[Yn.SERVICE]:{},[Yn.PORTAL_ITEM]:{},[Yn.WEB_SCENE]:{},[Yn.WEB_MAP]:{}},this.addHandles(sr(()=>this.sublayers,(r,n)=>this._handleSublayersChange(r,n),qu))}readSublayers(i,r){if(!r||!i)return;const{sublayersSourceJSON:n}=this,s=Ug(r.origin);if(sYn.SERVICE))return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:o,origin:a}=this.createSublayersForOrigin("web-document"),l=Mp(this);l.setDefaultOrigin(a),this._set("sublayers",new XTe(o)),l.setDefaultOrigin("user")}findSublayerById(i){return this.allSublayers.find(r=>r.id===i)}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(i){const r=Ug(i==="web-document"?"web-map":i);let n=Yn.SERVICE,s=this.sublayersSourceJSON[Yn.SERVICE].layers,o=this.sublayersSourceJSON[Yn.SERVICE].context,a=null;const l=[Yn.PORTAL_ITEM,Yn.WEB_SCENE,Yn.WEB_MAP].filter(x=>x<=r);for(const x of l){const I=this.sublayersSourceJSON[x];oQt(I.layers)&&(n=x,s=I.layers,o=I.context,I.visibleLayers&&(a={visibleLayers:I.visibleLayers,context:I.context}))}const c=[Yn.PORTAL_ITEM,Yn.WEB_SCENE,Yn.WEB_MAP].filter(x=>x>n&&x<=r);let h=null;for(const x of c){const{layers:I,visibleLayers:P,context:F}=this.sublayersSourceJSON[x];I&&(h={layers:I,context:F}),P&&(a={visibleLayers:P,context:F})}const p=lQt(s,o),y=new Map,v=new Set;if(h)for(const x of h.layers)y.set(x.id,x);if(a?.visibleLayers)for(const x of a.visibleLayers)v.add(x);return uZe(p,x=>{h&&x.read(y.get(x.id),h.context),a&&x.read({defaultVisibility:v.has(x.id)},a.context)}),{origin:SH(n),sublayers:new XTe({items:p})}}read(i,r){super.read(i,r),this.readSublayers(i,r)}_handleSublayersChange(i,r){r&&(r.forEach(n=>{n.parent=null,n.layer=null}),this.handles.remove("sublayers-owner")),i&&(i.forEach(n=>{n.parent=this,n.layer=this}),this.handles.add([i.on("after-add",({item:n})=>{n.parent=this,n.layer=this}),i.on("after-remove",({item:n})=>{n.parent=null,n.layer=null})],"sublayers-owner"),this.type==="tile"&&this.handles.add(i.on("before-changes",n=>{aQt.error(new st("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),n.preventDefault()}),"sublayers-owner"))}};return E([N({readOnly:!0})],e.prototype,"allSublayers",void 0),E([N({readOnly:!0,type:Sr.ofType(xY)})],e.prototype,"serviceSublayers",void 0),E([N({value:null,type:XTe,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],e.prototype,"sublayers",void 0),E([N({readOnly:!0})],e.prototype,"sublayersSourceJSON",void 0),e=E([dt("esri.layers.mixins.SublayersOwner")],e),e};function hZe(t){const e=t.layer;return"floorInfo"in e&&e.floorInfo?.floorField&&"floors"in t.view?dZe(t.view.floors,e.floorInfo.floorField):null}function SY(t,e){return"floorInfo"in e&&e.floorInfo?.floorField?dZe(t,e.floorInfo.floorField):null}function dZe(t,e){if(!t?.length)return null;const i=t.filter(r=>r!=="").map(r=>`'${r}'`);return i.push("''"),`${e} IN (${i.join(",")}) OR ${e} IS NULL`}const uQt={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let d_=class extends Ud(Tn){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(i=>{const r=SY(this.floors,i);return i.toExportImageJSON(r)});return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&aZe(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.handles.remove("layer"),e&&this.handles.add([e.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("sublayer-update",i=>this.notifyChange(uQt[i.propertyName]))],"layer"))}get layers(){const e=this.visibleSublayers;return e?e.length?"show:"+e.map(i=>i.id).join(","):"show:-1":null}get layerDefs(){const e=!!this.floors?.length,i=this.visibleSublayers.filter(r=>r.definitionExpression!=null||e&&r.floorInfo!=null);return i.length?JSON.stringify(i.reduce((r,n)=>{const s=SY(this.floors,n),o=OR(s,n.definitionExpression);return ve(o)&&(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 i=this.layer.sublayers,r=s=>{const o=this.scale,a=o===0,l=s.minScale===0||o<=s.minScale,c=s.maxScale===0||o>=s.maxScale;s.visible&&(a||l&&c)&&(s.sublayers?s.sublayers.forEach(r):e.unshift(s))};i&&i.forEach(r);const n=this._get("visibleSublayers");return!n||n.length!==e.length||n.some((s,o)=>e[o]!==s)?e:n}toJSON(){const e=this.layer;let i={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?i.dynamicLayers=this.dynamicLayers:i={...i,layers:this.layers,layerDefs:this.layerDefs},i}};E([N({readOnly:!0})],d_.prototype,"dynamicLayers",null),E([N()],d_.prototype,"floors",void 0),E([N({readOnly:!0})],d_.prototype,"hasDynamicLayers",null),E([N()],d_.prototype,"layer",null),E([N({readOnly:!0})],d_.prototype,"layers",null),E([N({readOnly:!0})],d_.prototype,"layerDefs",null),E([N({type:Number})],d_.prototype,"scale",void 0),E([N(j9)],d_.prototype,"timeExtent",void 0),E([N({readOnly:!0})],d_.prototype,"version",null),E([N({readOnly:!0})],d_.prototype,"visibleSublayers",null),d_=E([dt("esri.layers.mixins.ExportImageParameters")],d_);let hp=class extends up(eT(Ch(cZe(iZe(r_(qc(Sh(Yu(s0(m2(y2(Ud(du))))))))))))){constructor(...e){super(...e),this.dateFieldsTimeReference=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.preferredTimeReference=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null}normalizeCtorArgs(e,i){return typeof e=="string"?{url:e,...i}:e}load(e){const i=ve(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(Ya).then(()=>this._fetchService(i))),Promise.resolve(this)}readImageFormat(e,i){const r=i.supportedImageFormatTypes;return r&&r.includes("PNG32")?"png32":"png24"}writeSublayers(e,i,r,n){if(!this.loaded||!e)return;const s=e.slice().reverse().flatten(({sublayers:h})=>h&&h.toArray().reverse()).toArray();let o=!1;if(this.capabilities&&this.capabilities.operations.supportsExportMap&&this.capabilities.exportMap?.supportsDynamicLayers){const h=Ug(n.origin);if(h===Yn.PORTAL_ITEM){const p=this.createSublayersForOrigin("service").sublayers;o=oZe(s,p,Yn.SERVICE)}else if(h>Yn.PORTAL_ITEM){const p=this.createSublayersForOrigin("portal-item");o=oZe(s,p.sublayers,Ug(p.origin))}}const a=[],l={writeSublayerStructure:o,...n};let c=o;s.forEach(h=>{const p=h.write({},l);a.push(p),c=c||h.originOf("visible")==="user"}),a.some(h=>Object.keys(h).length>1)&&(i.layers=a),c&&(i.visibleLayers=s.filter(h=>h.visible).map(h=>h.id))}createExportImageParameters(e,i,r,n){const s=n&&n.pixelRatio||1;e&&this.version>=10&&(e=e.clone().shiftCentralMeridian());const o=new d_({layer:this,floors:n?.floors,scale:Nae({extent:e,width:i})*s}),a=o.toJSON();o.destroy();const l=!n||!n.rotation||this.version<10.3?{}:{rotation:-n.rotation},c=e&&e.spatialReference,h=c.wkid||JSON.stringify(c.toJSON());a.dpi*=s;const p={};if(n?.timeExtent){const{start:y,end:v}=n.timeExtent.toJSON();p.time=y&&v&&y===v?""+y:`${y??"null"},${v??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(p.time="null,null");return{bbox:e&&e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:h,imageSR:h,size:i+","+r,...a,...l,...p}}async fetchImage(e,i,r,n){const{data:s}=await this._fetchImage("image",e,i,r,n);return s}async fetchImageBitmap(e,i,r,n){const{data:s,url:o}=await this._fetchImage("blob",e,i,r,n);return rM(s,o)}async fetchRecomputedExtents(e={}){const i={...e,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:r}=await ur(this.url,i),{extent:n,fullExtent:s,timeExtent:o}=r,a=n||s;return{fullExtent:a&&Ar.fromJSON(a),timeExtent:o&&Xg.fromJSON({start:o[0],end:o[1]})}}loadAll(){return mL(this,e=>{e(this.allSublayers)})}serviceSupportsSpatialReference(e){return Woe(this,e)}async _fetchImage(e,i,r,n,s){const o={responseType:e,signal:s?.signal??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(i,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 st("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 ur(a,o);return{data:l,url:a}}catch(l){throw ys(l)?l:new st("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:i,ssl:r}=await ur(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=i,this.read(i,{origin:"service",url:this.parsedUrl})}};E([N({type:VR})],hp.prototype,"dateFieldsTimeReference",void 0),E([N({type:Boolean})],hp.prototype,"datesInUnknownTimezone",void 0),E([N()],hp.prototype,"dpi",void 0),E([N()],hp.prototype,"gdbVersion",void 0),E([N()],hp.prototype,"imageFormat",void 0),E([Vi("imageFormat",["supportedImageFormatTypes"])],hp.prototype,"readImageFormat",null),E([N({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],hp.prototype,"imageMaxHeight",void 0),E([N({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],hp.prototype,"imageMaxWidth",void 0),E([N()],hp.prototype,"imageTransparency",void 0),E([N({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],hp.prototype,"isReference",void 0),E([N({json:{read:!1,write:!1}})],hp.prototype,"labelsVisible",void 0),E([N({type:["ArcGISMapServiceLayer"]})],hp.prototype,"operationalLayerType",void 0),E([N({json:{read:!1,write:!1}})],hp.prototype,"popupEnabled",void 0),E([N({type:VR})],hp.prototype,"preferredTimeReference",void 0),E([N()],hp.prototype,"sourceJSON",void 0),E([N({json:{write:{ignoreOrigin:!0}}})],hp.prototype,"sublayers",void 0),E([Cr("sublayers",{layers:{type:[xY]},visibleLayers:{type:[Ls]}})],hp.prototype,"writeSublayers",null),E([N({type:["show","hide","hide-children"]})],hp.prototype,"listMode",void 0),E([N({json:{read:!1},readOnly:!0,value:"map-image"})],hp.prototype,"type",void 0),E([N(Qy)],hp.prototype,"url",void 0),hp=E([dt("esri.layers.MapImageLayer")],hp);const KTe=hp,cQt=Object.freeze(Object.defineProperty({__proto__:null,default:KTe},Symbol.toStringTag,{value:"Module"}));var JTe;let lT=JTe=class extends Ui{constructor(t){super(t),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new JTe({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};E([N({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],lT.prototype,"cols",void 0),E([N({type:Ls,json:{write:!0}})],lT.prototype,"level",void 0),E([N({type:String,json:{write:!0}})],lT.prototype,"levelValue",void 0),E([N({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],lT.prototype,"origin",void 0),E([N({type:Number,json:{write:!0}})],lT.prototype,"resolution",void 0),E([N({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],lT.prototype,"rows",void 0),E([N({type:Number,json:{write:!0}})],lT.prototype,"scale",void 0),lT=JTe=E([dt("esri.layers.support.LOD")],lT);const rs=lT;let FB=class{constructor(e,i,r,n,s){this.id=e,this.level=i,this.row=r,this.col=n,this.extent=s}};var hM;const pZe=new Ks({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 km=hM=class extends Ui{static create(t={}){const{resolutionFactor:e=1,scales:i,size:r=256,spatialReference:n=hr.WebMercator,numLODs:s=24}=t;if(!bh(n)){const p=[];if(i)for(let y=0;y=0;v--)p.unshift(new rs({level:v,scale:y,resolution:y})),y*=2}return new hM({dpi:96,lods:p,origin:new er(0,0,n),size:[r,r],spatialReference:n})}const o=vd(n),a=t.origin?new er({x:t.origin.x,y:t.origin.y,spatialReference:n}):new er(o?{x:o.origin[0],y:o.origin[1],spatialReference:n}:{x:0,y:0,spatialReference:n}),l=96,c=1/(Hc(n)*39.37*l),h=[];if(i)for(let p=0;p{r.push(s.scale),e=s.scale>e?s.scale:e,i=s.scale=e.length-1)return e[e.length-1];const i=Math.floor(t),r=i+1;return e[i]/(e[i]/e[r])**(t-i)}scaleToZoom(t){const e=this.scales,i=e.length-1;let r=0;for(;rt&&s=e?this.zoomToScale(Math.ceil(i)):this.zoomToScale(Math.floor(i))}tileAt(t,e,i,r){const n=this.lodAt(t);if(!n)return null;let s,o;if(typeof e=="number")s=e,o=i;else if(Da(e.spatialReference,this.spatialReference))s=e.x,o=e.y,r=i;else{const c=bL(e,this.spatialReference);if(lt(c))return null;s=c.x,o=c.y,r=i}const a=n.resolution*this.size[0],l=n.resolution*this.size[1];return r||(r=new FB(null,0,0,0,Mo())),r.level=t,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(t,e=hM.ExtrapolateOptions.NONE){let i=this.lodAt(t.level);if(!i&&e===hM.ExtrapolateOptions.POWER_OF_TWO){const o=this.lods[this.lods.length-1];o.levelArray.isArray(t)?t:typeof t=="number"?[t,t]:[256,256]})],km.prototype,"size",void 0),E([Vi("size",["rows","cols"])],km.prototype,"readSize",null),E([Cr("size",{cols:{type:Ls},rows:{type:Ls}})],km.prototype,"writeSize",null),E([N({type:hr,json:{write:!0}})],km.prototype,"spatialReference",void 0),km=hM=E([dt("esri.layers.support.TileInfo")],km),function(t){var e;(e=t.ExtrapolateOptions||(t.ExtrapolateOptions={}))[e.NONE=0]="NONE",e[e.POWER_OF_TWO=1]="POWER_OF_TWO"}(km||(km={}));const Ul=km;var ZTe;let HA=ZTe=class extends Ui{constructor(t){super(t)}clone(){return new ZTe({customLayerParameters:gi(this.customLayerParameters),customParameters:gi(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};E([N({json:{type:Object,write:!0}})],HA.prototype,"customLayerParameters",void 0),E([N({json:{type:Object,write:!0}})],HA.prototype,"customParameters",void 0),E([N({type:String,json:{write:!0}})],HA.prototype,"layerIdentifier",void 0),E([N({type:String,json:{write:!0}})],HA.prototype,"tileMatrixSet",void 0),E([N({type:String,json:{write:!0}})],HA.prototype,"url",void 0),HA=ZTe=E([dt("esri.layer.support.WMTSLayerInfo")],HA);var QTe;let dp=QTe=class extends up(s0(Ch(qc(Sh(Yu(du)))))){constructor(...t){super(...t),this.copyright="",this.fullExtent=new Ar(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,hr.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=hr.WebMercator,this.subDomains=null,this.tileInfo=new Ul({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new er({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:hr.WebMercator}),spatialReference:hr.WebMercator,lods:[new rs({level:0,scale:591657527591555e-6,resolution:156543.033928}),new rs({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new rs({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new rs({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new rs({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new rs({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new rs({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new rs({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new rs({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new rs({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new rs({level:10,scale:577790.554289,resolution:152.874056570411}),new rs({level:11,scale:288895.277144,resolution:76.4370282850732}),new rs({level:12,scale:144447.638572,resolution:38.2185141425366}),new rs({level:13,scale:72223.819286,resolution:19.1092570712683}),new rs({level:14,scale:36111.909643,resolution:9.55462853563415}),new rs({level:15,scale:18055.954822,resolution:4.77731426794937}),new rs({level:16,scale:9027.977411,resolution:2.38865713397468}),new rs({level:17,scale:4513.988705,resolution:1.19432856685505}),new rs({level:18,scale:2256.994353,resolution:.597164283559817}),new rs({level:19,scale:1128.497176,resolution:.298582141647617}),new rs({level:20,scale:564.248588,resolution:.14929107082380833}),new rs({level:21,scale:282.124294,resolution:.07464553541190416}),new rs({level:22,scale:141.062147,resolution:.03732276770595208}),new rs({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(t,e){return typeof t=="string"?{urlTemplate:t,...e}:t}load(t){const e=this.loadFromPortal({supportedTypes:["WMTS"]},t).then(()=>{let i="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const r=new Hg(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&r.authority?.includes("{subDomain}")&&(i="is missing 'subDomains' property")}else i="spatialReference must match tileInfo.spatialReference";else i="is missing the required 'urlTemplate' property value";if(i)throw new st("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${i}`)});return this.addResolvingPromise(e),Promise.resolve(this)}get levelValues(){const t=[];if(!this.tileInfo)return null;for(const e of this.tileInfo.lods)t[e.level]=e.levelValue||e.level;return t}readSpatialReference(t,e){return t||e.fullExtent&&e.fullExtent.spatialReference&&hr.fromJSON(e.fullExtent.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const t=[],{urlTemplate:e,subDomains:i}=this,r=new Hg(e),n=r.scheme?r.scheme+"://":"//",s=n+r.authority+"/",o=r.authority;if(o?.includes("{subDomain}")){if(i&&i.length>0&&o.split(".").length>1)for(const a of i)t.push(n+o.replace(/\{subDomain\}/gi,a)+"/")}else t.push(s);return t.map(a=>(a.charAt(a.length-1)!=="/"&&(a+="/"),a))}get urlPath(){if(!this.urlTemplate)return null;const t=this.urlTemplate,e=new Hg(t),i=(e.scheme?e.scheme+"://":"//")+e.authority+"/";return t.substring(i.length)}readUrlTemplate(t,e){return t||e.templateUrl}writeUrlTemplate(t,e){t&&P1(t)&&(t="https:"+t),t&&(t=t.replace(/\{z\}/gi,"{level}").replace(/\{x\}/gi,"{col}").replace(/\{y\}/gi,"{row}"),t=Uy(t)),e.templateUrl=t}fetchTile(t,e,i,r={}){const{signal:n}=r,s=this.getTileUrl(t,e,i),o={responseType:"image",signal:n,query:{...this.refreshParameters}};return ur(s,o).then(a=>a.data)}async fetchImageBitmapTile(t,e,i,r={}){const{signal:n}=r;if(this.fetchTile!==QTe.prototype.fetchTile){const l=await this.fetchTile(t,e,i,r);try{return createImageBitmap(l)}catch(c){throw new st("request:server",`Unable to load tile ${t}/${e}/${i}`,{error:c,level:t,row:e,col:i})}}const s=this.getTileUrl(t,e,i),o={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:a}=await ur(s,o);return rM(a,s)}getTileUrl(t,e,i){const{levelValues:r,tileServers:n,urlPath:s}=this;if(!r||!n||!s)return"";const o=r[t];return n[e%n.length]+Xx(s,{level:o,z:o,col:i,x:i,row:e,y:e})}};E([N({type:String,value:"",json:{write:!0}})],dp.prototype,"copyright",void 0),E([N({type:Ar,json:{write:!0},nonNullable:!0})],dp.prototype,"fullExtent",void 0),E([N({readOnly:!0,json:{read:!1,write:!1}})],dp.prototype,"legendEnabled",void 0),E([N({type:["show","hide"]})],dp.prototype,"listMode",void 0),E([N({json:{read:!0,write:!0}})],dp.prototype,"blendMode",void 0),E([N()],dp.prototype,"levelValues",null),E([N({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],dp.prototype,"isReference",void 0),E([N({type:["WebTiledLayer"],value:"WebTiledLayer"})],dp.prototype,"operationalLayerType",void 0),E([N({readOnly:!0,json:{read:!1,write:!1}})],dp.prototype,"popupEnabled",void 0),E([N({type:hr})],dp.prototype,"spatialReference",void 0),E([Vi("spatialReference",["spatialReference","fullExtent.spatialReference"])],dp.prototype,"readSpatialReference",null),E([N({type:[String],json:{write:!0}})],dp.prototype,"subDomains",void 0),E([N({type:Ul,json:{write:!0}})],dp.prototype,"tileInfo",void 0),E([N({readOnly:!0})],dp.prototype,"tileServers",null),E([N({json:{read:!1}})],dp.prototype,"type",void 0),E([N()],dp.prototype,"urlPath",null),E([N({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],dp.prototype,"urlTemplate",void 0),E([Vi("urlTemplate",["urlTemplate","templateUrl"])],dp.prototype,"readUrlTemplate",null),E([Cr("urlTemplate",{templateUrl:{type:String}})],dp.prototype,"writeUrlTemplate",null),E([N({type:HA,json:{write:!0}})],dp.prototype,"wmtsInfo",void 0),dp=QTe=E([dt("esri.layers.WebTileLayer")],dp);const eEe=dp,hQt=Object.freeze(Object.defineProperty({__proto__:null,default:eEe},Symbol.toStringTag,{value:"Module"}));let av=class extends eEe{constructor(...e){super(...e),this.portalItem=null,this.isReference=null,this.tileInfo=new Ul({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new er({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:hr.WebMercator}),spatialReference:hr.WebMercator,lods:[new rs({level:0,scale:591657527591555e-6,resolution:156543.033928}),new rs({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new rs({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new rs({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new rs({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new rs({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new rs({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new rs({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new rs({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new rs({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new rs({level:10,scale:577790.554289,resolution:152.874056570411}),new rs({level:11,scale:288895.277144,resolution:76.4370282850732}),new rs({level:12,scale:144447.638572,resolution:38.2185141425366}),new rs({level:13,scale:72223.819286,resolution:19.1092570712683}),new rs({level:14,scale:36111.909643,resolution:9.55462853563415}),new rs({level:15,scale:18055.954822,resolution:4.77731426794937}),new rs({level:16,scale:9027.977411,resolution:2.38865713397468}),new rs({level:17,scale:4513.988705,resolution:1.19432856685505}),new rs({level:18,scale:2256.994353,resolution:.597164283559817}),new rs({level:19,scale:1128.497176,resolution:.298582141647617})]}),this.subDomains=["a","b","c"],this.fullExtent=new Ar(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,hr.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}};E([N({type:Q0,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],av.prototype,"portalItem",void 0),E([N({type:Boolean,json:{read:!1,write:!1}})],av.prototype,"isReference",void 0),E([N({type:Number,readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],av.prototype,"refreshInterval",null),E([N({type:Ul,json:{write:!1}})],av.prototype,"tileInfo",void 0),E([N({type:["show","hide"]})],av.prototype,"listMode",void 0),E([N({readOnly:!0,json:{read:!1,write:!1}})],av.prototype,"subDomains",void 0),E([N({readOnly:!0,json:{read:!1,write:!1},nonNullable:!0})],av.prototype,"fullExtent",void 0),E([N({readOnly:!0,json:{read:!1,write:!1}})],av.prototype,"urlTemplate",void 0),E([N({type:["OpenStreetMap"]})],av.prototype,"operationalLayerType",void 0),E([N({json:{read:!1}})],av.prototype,"type",void 0),E([N({json:{read:!1,write:!1}})],av.prototype,"copyright",void 0),E([N({json:{read:!1,write:!1}})],av.prototype,"wmtsInfo",void 0),av=E([dt("esri.layers.OpenStreetMapLayer")],av);const tEe=av,dQt=Object.freeze(Object.defineProperty({__proto__:null,default:tEe},Symbol.toStringTag,{value:"Module"})),pQt={type:Ul,json:{origins:{service:{read:{source:["tileInfo","minScale","maxScale","minLOD","maxLOD"],reader:iEe}}}}};function iEe(t,e,i,r){if(!t)return null;const{minScale:n,maxScale:s,minLOD:o,maxLOD:a}=e;if(o!=null&&a!=null)return r&&r.ignoreMinMaxLOD?Ul.fromJSON(t):Ul.fromJSON({...t,lods:t.lods.filter(({level:l})=>l!=null&&l>=o&&l<=a)});if(n!==0&&s!==0){const l=p=>Math.round(1e4*p)/1e4,c=n?l(n):1/0,h=s?l(s):-1/0;return Ul.fromJSON({...t,lods:t.lods.filter(p=>{const y=l(p.scale);return y<=c&&y>=h})})}return Ul.fromJSON(t)}function fZe(t){return 32+t.length}function mZe(t){return 16}function fQt(t){if(!t)return 0;let e=_Ze;for(const i in t)if(t.hasOwnProperty(i)){const r=t[i];switch(typeof r){case"string":e+=fZe(r);break;case"number":e+=mZe();break;case"boolean":e+=4}}return e}function gZe(t){if(!t)return 0;if(Array.isArray(t))return mQt(t);let e=_Ze;for(const i in t)t.hasOwnProperty(i)&&(e+=yZe(t[i]));return e}function mQt(t){const e=t.length;if(e===0||typeof t[0]=="number")return 32+8*e;let i=bZe;for(let r=0;r>3,o=this._tileAvailabilityBitSet;return s<0||s>o.length?"unknown":o[s]&1<c.data).catch(c=>{if(c&&c.details&&c.details.httpStatus===422)return{location:{top:n,left:s,width:o,height:a},valid:!0,data:jNt(o*a,0)};throw c}).then(c=>{if(c.location&&(c.location.top!==n||c.location.left!==s||c.location.width!==o||c.location.height!==a))throw new st("tilemap:location-mismatch","Tilemap response for different location than requested",{response:c,definition:{top:n,left:s,width:o,height:a}});return e_e.fromJSON(c)})}static fromJSON(e){e_e._validateJSON(e);const i=new e_e;return i.location=Object.freeze(gi(e.location)),i._updateFromData(e.data),Object.freeze(i)}static _validateJSON(e){if(!e||!e.location)throw new st("tilemap:missing-location","Location missing from tilemap response");if(e.valid===!1)throw new st("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new st("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new st("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new st("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}};function xZe(t){return`${t.level}/${t.row}/${t.col}/${t.width}/${t.height}`}function gQt(t){let e;if(t.service.type==="vector-tile")e=`${t.service.url}/tilemap/${t.level}/${t.row}/${t.col}/${t.width}/${t.height}`;else{const r=t.service.tileServers;e=`${r&&r.length?r[t.row%r.length]:t.service.url}/tilemap/${t.level}/${t.row}/${t.col}/${t.width}/${t.height}`}const i=t.service.query;return i&&(e=`${e}?${i}`),e}var eN;let Y1=eN=class extends Ud(Tn){constructor(t){super(t),this._pendingTilemapRequests={},this._availableLevels={},this.levels=5,this.cacheByteSize=2*Q5.MEGABYTES,this.request=ur,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new C9(this.cacheByteSize),this.addHandles([sr(()=>{const{layer:t}=this;return[t?.parsedUrl,t?.tileServers,t?.apiKey,t?.customParameters]},()=>this._initializeTilemapDefinition()),sr(()=>this.layer?.tileInfo?.lods,t=>this._initializeAvailableLevels(t),Wh)]),this._initializeTilemapDefinition()}castLevels(t){return t<=2?(Oi.getLogger(this.declaredClass).error("Minimum levels for Tilemap is 3, but got ",t),3):t}get size(){return 1<{ap(o,()=>l(Sc()));const c=xZe(n);let h=this._pendingTilemapRequests[c];if(!h){h=wZe.fromDefinition(n,r).then(y=>(this._tilemapCache.put(c,y,y.byteSize),y));const p=()=>delete this._pendingTilemapRequests[c];this._pendingTilemapRequests[c]=h,h.then(p,p)}h.then(a,l)})}getAvailability(t,e,i){if(!this._availableLevels[t])return"unavailable";const r=this._tilemapFromCache(t,e,i,this._tmpTilemapDefinition);return r?r.getAvailability(e,i):"unknown"}fetchAvailability(t,e,i,r){return this._availableLevels[t]?this.fetchTilemap(t,e,i,r).catch(n=>n).then(n=>{if(n instanceof wZe){const s=n.getAvailability(e,i);if(s==="unavailable")throw new st("tile-map:tile-unavailable","Tile is not available",{level:t,row:e,col:i});return s}if(ys(n))throw n;return"unknown"}):Promise.reject(new st("tilemap-cache:level-unavailable",`Level ${t} is unavailable in the service`))}fetchAvailabilityUpsample(t,e,i,r,n){r.level=t,r.row=e,r.col=i;const s=this.layer.tileInfo;s.updateTileInfo(r);const o=this.fetchAvailability(t,e,i,n).catch(a=>{if(ys(a))throw a;if(s.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r);throw a});return this._fetchAvailabilityUpsamplePrefetch(r.id,t,e,i,n,o),o}async _fetchAvailabilityUpsamplePrefetch(t,e,i,r,n,s){if(!this._prefetchingEnabled||t==null)return;const o=`prefetch-${t}`;if(this.handles.has(o))return;const a=new AbortController;s.then(()=>a.abort(),()=>a.abort());let l=!1;const c={remove(){l||(l=!0,a.abort())}};if(this.handles.add(c,o),await Akt(10,a.signal).catch(()=>{}),l||(l=!0,this.handles.remove(o)),Im(a))return;const h=new FB(t,e,i,r),p={...n,signal:a.signal},y=this.layer.tileInfo;for(let v=0;eN._prefetches.length{eN._prefetches.removeUnordered(x)};x.then(I,I)}}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:t,apiKey:e,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:t.path,query:Wv({...t.query,...i,token:e??t.query?.token}),tileServers:this.layer.tileServers,request:this.request,type:this.layer.type},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(t,e,i,r){r.level=t,r.row=e-e%this.size,r.col=i-i%this.size;const n=xZe(r);return this._tilemapCache.get(n)}_initializeAvailableLevels(t){this._availableLevels={},t&&t.forEach(e=>this._availableLevels[e.level]=!0)}get test(){const t=this;return{get prefetchingEnabled(){return t._prefetchingEnabled},set prefetchingEnabled(e){t._prefetchingEnabled=e},hasTilemap:(e,i,r)=>!!t._tilemapFromCache(e,i,r,t._tmpTilemapDefinition)}}};Y1._maxPrefetch=4,Y1._prefetches=new Em({initialSize:eN._maxPrefetch}),E([N({constructOnly:!0,type:Number})],Y1.prototype,"levels",void 0),E([ho("levels")],Y1.prototype,"castLevels",null),E([N({readOnly:!0,type:Number})],Y1.prototype,"size",null),E([N({constructOnly:!0,type:Number})],Y1.prototype,"cacheByteSize",void 0),E([N({constructOnly:!0})],Y1.prototype,"layer",void 0),E([N({constructOnly:!0})],Y1.prototype,"request",void 0),Y1=eN=E([dt("esri.layers.support.TilemapCache")],Y1);const rEe=t=>{let e=class extends t{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}readMinScale(i,r){return r.minLOD!=null&&r.maxLOD!=null?i:0}readMaxScale(i,r){return r.minLOD!=null&&r.maxLOD!=null?i:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(i,r){return r.capabilities&&r.capabilities.includes("Tilemap")?new Y1({layer:this}):null}};return E([N({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),E([N()],e.prototype,"minScale",void 0),E([Vi("service","minScale")],e.prototype,"readMinScale",null),E([N()],e.prototype,"maxScale",void 0),E([Vi("service","maxScale")],e.prototype,"readMaxScale",null),E([N({type:hr})],e.prototype,"spatialReference",void 0),E([N({readOnly:!0})],e.prototype,"supportsBlankTile",null),E([N(pQt)],e.prototype,"tileInfo",void 0),E([N()],e.prototype,"tilemapCache",void 0),E([Vi("service","tilemapCache",["capabilities"])],e.prototype,"readTilemapCache",null),E([N()],e.prototype,"version",void 0),e=E([dt("esri.layers.mixins.ArcGISCachedService")],e),e},SZe=["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 mf=class extends up(cZe(Ch(qc(Sh(rEe(iZe(r_(Yu(Ud(s0(m2(y2(du))))))))))))){constructor(...e){super(...e),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(e,i){return typeof e=="string"?{url:e,...i}:e}load(e){const i=ve(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(Ya).then(()=>this._fetchService(i))),Promise.resolve(this)}get attributionDataUrl(){const e=this.parsedUrl?.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,i){return(e=e||i.tileInfo&&i.tileInfo.spatialReference)&&hr.fromJSON(e)}writeSublayers(e,i,r,n){if(!this.loaded||!e)return;const s=e.slice().reverse().flatten(({sublayers:l})=>l&&l.toArray().reverse()).toArray(),o=[],a={writeSublayerStructure:!1,...n};s.forEach(l=>{const c=l.write({},a);o.push(c)}),o.some(l=>Object.keys(l).length>1)&&(i.layers=o)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl?.path)}castTileServers(e){return Array.isArray(e)?e.map(i=>fa(i).path):null}fetchTile(e,i,r,n={}){const{signal:s}=n,o=this.getTileUrl(e,i,r),a={responseType:"image",signal:s,query:{...this.refreshParameters}};return ur(o,a).then(l=>l.data)}async fetchImageBitmapTile(e,i,r,n={}){const{signal:s}=n,o=this.getTileUrl(e,i,r),a={responseType:"blob",signal:s,query:{...this.refreshParameters}},{data:l}=await ur(o,a);return rM(l,o)}getTileUrl(e,i,r){const n=!this.tilemapCache&&this.supportsBlankTile,s=Wv({...this.parsedUrl?.query,blankTile:!n&&null,...this.customParameters,token:this.apiKey}),o=this.tileServers;return`${o&&o.length?o[i%o.length]:this.parsedUrl?.path}/tile/${e}/${i}/${r}${s?"?"+s:""}`}loadAll(){return mL(this,e=>{e(this.allSublayers)})}_fetchService(e){return new Promise((i,r)=>{if(this.sourceJSON){if(this.sourceJSON.bandCount!=null&&this.sourceJSON.pixelSizeX!=null)throw new st("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void i({data:this.sourceJSON})}if(!this.parsedUrl)throw new st("tile-layer:undefined-url","layer's url is not defined");const n=XC(this.parsedUrl.path);if(ve(n)&&n.serverType==="ImageServer")throw new st("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");ur(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(i,r)}).then(i=>{let r=this.url;if(i.ssl&&(r=this.url=r.replace(/^http:/i,"https:")),this.sourceJSON=i.data,this.read(i.data,{origin:"service",url:this.parsedUrl}),this.version===10.1&&!L9(r))return this._fetchServerVersion(r,e).then(n=>{this.read({currentVersion:n})}).catch(()=>{})})}_fetchServerVersion(e,i){if(!FHe(e))return Promise.reject();const r=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return ur(r,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:i}).then(n=>{if(n.data&&n.data.currentVersion)return n.data.currentVersion;throw new st("tile-layer:version-not-available")})}_getMapName(e){const i=e.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/mapserver/i);return i?i[2]:void 0}_getDefaultAttribution(e){if(e==null)return null;let i;e=e.toLowerCase();for(let r=0,n=SZe.length;r({enabled:!1})}}})],mf.prototype,"isReference",void 0),E([N({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],mf.prototype,"operationalLayerType",void 0),E([N({type:Boolean})],mf.prototype,"resampling",void 0),E([N()],mf.prototype,"sourceJSON",void 0),E([N({type:hr})],mf.prototype,"spatialReference",void 0),E([Vi("spatialReference",["spatialReference","tileInfo"])],mf.prototype,"readSpatialReference",null),E([N({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],mf.prototype,"path",void 0),E([N({readOnly:!0})],mf.prototype,"sublayers",void 0),E([Cr("sublayers",{layers:{type:[xY]}})],mf.prototype,"writeSublayers",null),E([N({json:{read:!1,write:!1}})],mf.prototype,"popupEnabled",void 0),E([N()],mf.prototype,"tileServers",null),E([ho("tileServers")],mf.prototype,"castTileServers",null),E([N({readOnly:!0,json:{read:!1}})],mf.prototype,"type",void 0),E([N(Qy)],mf.prototype,"url",void 0),mf=E([dt("esri.layers.TileLayer")],mf),mf.prototype.fetchTile.__isDefault__=!0;const nEe=mf,yQt=Object.freeze(Object.defineProperty({__proto__:null,default:nEe},Symbol.toStringTag,{value:"Module"})),vQt=[[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 LB(t){return t!=null&&vQt.some(([e,i])=>t>=e&&t<=i)}const _Qt={visible:"visibleSublayers"};let uT=class extends Ud(Tn){constructor(e){super(e),this.scale=0}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.handles.remove("layer"),e&&this.handles.add([e.sublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("wms-sublayer-update",i=>this.notifyChange(_Qt[i.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:i}=this,r=e?.sublayers,n=[],s=o=>{const{minScale:a,maxScale:l,sublayers:c,visible:h}=o;h&&(i===0||(a===0||i<=a)&&(l===0||i>=l))&&(c?c.forEach(s):n.push(o))};return r?.forEach(s),n}toJSON(){const{layer:e,layers:i}=this,{imageFormat:r,imageTransparency:n,version:s}=e;return{format:r,request:"GetMap",service:"WMS",styles:"",transparent:n?"TRUE":"FALSE",version:s,layers:i}}};E([N()],uT.prototype,"layer",null),E([N({readOnly:!0})],uT.prototype,"layers",null),E([N({type:Number})],uT.prototype,"scale",void 0),E([N({readOnly:!0})],uT.prototype,"version",null),E([N({readOnly:!0})],uT.prototype,"visibleSublayers",null),uT=E([dt("esri.layers.support.ExportWMSImageParameters")],uT);var Bae;let bQt=0,Ed=Bae=class extends D1(Vse){constructor(t){super(t),this.dimensions=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.addHandles([Wu(()=>this.sublayers,"after-add",({item:e})=>{e.parent=this,e.layer=this.layer},qu),Wu(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=e.parent=null},qu),sr(()=>this.sublayers,(e,i)=>{if(i)for(const r of i)r.layer=r.parent=null;if(e)for(const r of e)r.parent=this,r.layer=this.layer},qu)])}get description(){return this._get("description")}set description(t){this._set("description",t)}get fullExtent(){return this._get("fullExtent")}set fullExtent(t){this._set("fullExtent",t)}readExtent(t,e){return(t=e.extent)?Ar.fromJSON(t):null}get id(){return this._get("id")??bQt++}set id(t){this._set("id",t)}readLegendUrl(t,e){return e?.legendUrl??e?.legendURL??null}get effectiveScaleRange(){const{minScale:t,maxScale:e}=this;return{minScale:t,maxScale:e}}get name(){return this._get("name")}set name(t){this._set("name",t)}castSublayers(t){return fd(Sr.ofType(Bae),t)}get title(){return this._get("title")}set title(t){this._set("title",t)}get visible(){return this._get("visible")}set visible(t){this._setAndNotifyLayer("visible",t)}clone(){const t=new Bae;return this.hasOwnProperty("description")&&(t.description=this.description),this.hasOwnProperty("fullExtent")&&(t.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(t.fullExtents=this.fullExtents?.map(e=>e.clone())??null),this.hasOwnProperty("legendUrl")&&(t.legendUrl=this.legendUrl),this.hasOwnProperty("legendEnabled")&&(t.legendEnabled=this.legendEnabled),this.hasOwnProperty("layer")&&(t.layer=this.layer),this.hasOwnProperty("name")&&(t.name=this.name),this.hasOwnProperty("parent")&&(t.parent=this.parent),this.hasOwnProperty("queryable")&&(t.queryable=this.queryable),this.hasOwnProperty("sublayers")&&(t.sublayers=this.sublayers&&this.sublayers.map(e=>e.clone())),this.hasOwnProperty("spatialReferences")&&(t.spatialReferences=this.spatialReferences?.map(e=>e)),this.hasOwnProperty("visible")&&(t.visible=this.visible),this.hasOwnProperty("title")&&(t.title=this.title),t}_setAndNotifyLayer(t,e){const i=this.layer;this._get(t)!==e&&(this._set(t,e),i&&i.emit("wms-sublayer-update",{propertyName:t,id:this.id}))}};E([N()],Ed.prototype,"description",null),E([N({readOnly:!0})],Ed.prototype,"dimensions",void 0),E([N({value:null})],Ed.prototype,"fullExtent",null),E([Vi("fullExtent",["extent"])],Ed.prototype,"readExtent",null),E([N()],Ed.prototype,"fullExtents",void 0),E([N({type:Number,json:{write:{enabled:!1,overridePolicy:()=>({ignoreOrigin:!0,enabled:!0})}}})],Ed.prototype,"id",null),E([N({type:String,json:{origins:{"web-document":{read:{source:["legendUrl","legendURL"]},write:{target:"legendUrl",ignoreOrigin:!0}}},read:{source:"legendURL"},write:{ignoreOrigin:!0}}})],Ed.prototype,"legendUrl",void 0),E([Vi(["web-document"],"legendUrl")],Ed.prototype,"readLegendUrl",null),E([N({value:!0,type:Boolean,json:{read:{source:"showLegend"},write:{target:"showLegend"},origins:{"web-map":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],Ed.prototype,"legendEnabled",void 0),E([N()],Ed.prototype,"layer",void 0),E([N()],Ed.prototype,"maxScale",void 0),E([N()],Ed.prototype,"minScale",void 0),E([N({readOnly:!0})],Ed.prototype,"effectiveScaleRange",null),E([N({type:String,value:null,json:{read:{source:"name"},write:{ignoreOrigin:!0}}})],Ed.prototype,"name",null),E([N()],Ed.prototype,"parent",void 0),E([N({type:Boolean,json:{read:{source:"showPopup"},write:{ignoreOrigin:!0,target:"showPopup"}}})],Ed.prototype,"popupEnabled",void 0),E([N({type:Boolean,json:{write:{ignoreOrigin:!0}}})],Ed.prototype,"queryable",void 0),E([N()],Ed.prototype,"sublayers",void 0),E([ho("sublayers")],Ed.prototype,"castSublayers",null),E([N({type:[Number],json:{read:{source:"spatialReferences"}}})],Ed.prototype,"spatialReferences",void 0),E([N({type:String,value:null,json:{write:{ignoreOrigin:!0}}})],Ed.prototype,"title",null),E([N({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],Ed.prototype,"visible",null),Ed=Bae=E([dt("esri.layers.support.WMSSublayer")],Ed);const sEe=Ed,Vae={84:4326,83:4269,27:4267};function wQt(t){if(!t)return null;const e={idCounter:-1};typeof t=="string"&&(t=new DOMParser().parseFromString(t,"text/xml"));const i=t.documentElement;if(i.nodeName==="ServiceExceptionReport"){const Re=Array.prototype.slice.call(i.childNodes).map(Oe=>Oe.textContent).join(`\r +`);throw new st("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",Re)}const r=h0("Capability",i),n=h0("Service",i),s=r&&h0("Request",r);if(!r||!n||!s)return null;const o=h0("Layer",r);if(!o)return null;const a=i.nodeName==="WMS_Capabilities"||i.nodeName==="WMT_MS_Capabilities"?i.getAttribute("version"):"1.3.0",l=cT("Title",n,"")||cT("Name",n,""),c=cT("AccessConstraints",n,""),h=/^none$/i.test(c)?"":c,p=cT("Abstract",n,""),y=parseInt(cT("MaxWidth",n,"5000"),10),v=parseInt(cT("MaxHeight",n,"5000"),10),x=IZe(s,"GetMap"),I=EZe(s,"GetMap"),P=TY(o,a,e);if(!P)return null;let F,k=0;const j=Array.prototype.slice.call(r.childNodes),V=P.sublayers??[],Y=Re=>{Re!=null&&V.push(Re)};j.forEach(Re=>{Re.nodeName==="Layer"&&(k===0?F=Re:(k===1&&P.name&&(P.name="",Y(TY(F,a,e))),Y(TY(Re,a,e))),k++)});let X=P.sublayers,Z=P.extent;const ie=P.fullExtents??[];if(X||(X=[]),X.length===0&&X.push(P),!Z){const Re=new Ar(X[0].extent);P.extent=Re.toJSON(),Z=P.extent}const ce=P.spatialReferences.length>0?P.spatialReferences:CZe(P),he=EZe(s,"GetFeatureInfo"),_e=he?IZe(s,"GetFeatureInfo"):null,xe=TZe(X),Pe=P.minScale||0,ke=P.maxScale||0,J=P.dimensions??[],de=xe.reduce((Re,Oe)=>Re.concat(Oe.dimensions??[]),[]),Se=J.concat(de).filter(OZe);let Ie=null;if(Se.length){const Re=Se.map(Oe=>{const{extent:Ge}=Oe;return CQt(Ge)?Ge.map(Be=>Be.getTime()):Ge?.map(Be=>[Be.min.getTime(),Be.max.getTime()])}).flat(2).filter(ve);Ie={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[Math.min(...Re),Math.max(...Re)]}}return{copyright:h,description:p,dimensions:J,extent:Z,fullExtents:ie,featureInfoFormats:_e,featureInfoUrl:he,mapUrl:I,maxWidth:y,maxHeight:v,maxScale:ke,minScale:Pe,layers:xe,spatialReferences:ce,supportedImageFormatTypes:x,timeInfo:Ie,title:l,version:a}}function xQt(t){const e=t.filter(i=>i.popupEnabled&&i.name&&i.queryable);return e.length?e.map(({name:i})=>i).join():null}function CZe(t){if(t.spatialReferences.length>0)return t.spatialReferences;if(t.sublayers)for(const e of t.sublayers){const i=CZe(e);if(i.length>0)return i}return[]}function TZe(t){let e=[];for(const i of t)e.push(i),i.sublayers?.length&&(e=e.concat(TZe(i.sublayers)),delete i.sublayers);return e}function jae(t,e,i){return e.getAttribute(t)??i}function SQt(t,e,i,r){const n=h0(t,i);return n?jae(e,n,r):r}function h0(t,e){for(let i=0;in).filter(ve);const r=[];for(const n of i)if(n.getAttribute("name")===e){const s=Gae("Format",n);for(const{textContent:o}of s)o!=null&&r.push(o)}return r}function AZe(t,e,i){const r=h0(e,t);if(!r)return i;const{textContent:n}=r;if(n==null||n==="")return i;const s=Number(n);return isNaN(s)?i:s}function TY(t,e,i){if(!t)return null;const r={id:i.idCounter++,fullExtents:[],parentLayerId:null,queryable:t.getAttribute("queryable")==="1",spatialReferences:[],sublayers:null},n=h0("LatLonBoundingBox",t),s=h0("EX_GeographicBoundingBox",t);let o=null;n&&(o=CY(n,4326)),s&&(o=new Ar(0,0,0,0,new hr({wkid:4326})),o.xmin=parseFloat(cT("westBoundLongitude",s,"0")),o.ymin=parseFloat(cT("southBoundLatitude",s,"0")),o.xmax=parseFloat(cT("eastBoundLongitude",s,"0")),o.ymax=parseFloat(cT("northBoundLatitude",s,"0"))),n||s||(o=new Ar(-180,-90,180,90,new hr({wkid:4326}))),r.minScale=AZe(t,"MaxScaleDenominator",0),r.maxScale=AZe(t,"MinScaleDenominator",0);const a=["1.0.0","1.1.0","1.1.1"].includes(e)?"SRS":"CRS";return Array.prototype.slice.call(t.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 c=l.getAttribute(a);if(c&&c.indexOf("EPSG:")===0){const p=parseInt(c.substring(5),10);p===0||isNaN(p)||o||(o=e==="1.3.0"?CY(l,p,LB(p)):CY(l,p))}const h=c&&c.indexOf(":");if(h&&h>-1){let p=parseInt(c.substring(h+1,c.length),10);p===0||isNaN(p)||(p=Vae[p]?Vae[p]:p);const y=e==="1.3.0"?CY(l,p,LB(p)):CY(l,p);y&&r.fullExtents&&r.fullExtents.push(y)}}else if(l.nodeName===a)(l.textContent?.split(" ")??[]).forEach(c=>{const h=c.includes(":")?parseInt(c.split(":")[1],10):parseInt(c,10);if(h!==0&&!isNaN(h)){const p=Vae[h]?Vae[h]:h;r.spatialReferences.includes(p)||r.spatialReferences.push(p)}});else if(l.nodeName!=="Style"||r.legendURL){if(l.nodeName==="Layer"){const c=TY(l,e,i);c&&(c.parentLayerId=r.id,r.sublayers||(r.sublayers=[]),r.sublayers.push(c))}}else{const c=h0("LegendURL",l);if(c){const h=h0("OnlineResource",c);h&&(r.legendURL=h.getAttribute("xlink:href"))}}}),r.extent=o?.toJSON(),r.dimensions=Gae("Dimension",t).filter(l=>l.getAttribute("name")&&l.getAttribute("units")&&l.textContent).map(l=>{const c=l.getAttribute("name"),h=l.getAttribute("units"),p=l.textContent,y=l.getAttribute("unitSymbol")??void 0,v=l.getAttribute("default")??void 0,x=jae("default",l,"0")!=="0",I=jae("nearestValue",l,"0")!=="0",P=jae("current",l,"0")!=="0";return OZe({name:c,units:h})?{name:"time",units:"ISO8601",extent:DZe(p),default:DZe(v),multipleValues:x,nearestValue:I,current:P}:TQt({name:c,units:h})?{name:"elevation",units:h,extent:RZe(p),unitSymbol:y,default:RZe(v),multipleValues:x,nearestValue:I}:{name:c,units:h,extent:MZe(p),unitSymbol:y,default:MZe(v),multipleValues:x,nearestValue:I}}),r}function CQt(t){return Array.isArray(t)&&t.length>0&&t[0]instanceof Date}function PZe(t){return t.nodeType===Node.ELEMENT_NODE}function TQt(t){return/^elevation$/i.test(t.name)&&/^(epsg|crs):\d+$/i.test(t.units)}function OZe(t){return/^time$/i.test(t.name)&&/^iso8601$/i.test(t.units)}function EQt(t,e){const i=[],r=fa(t);for(const n in r.query)r.query.hasOwnProperty(n)&&(e.includes(n.toLowerCase())||i.push(n+"="+r.query[n]));return r.path+(i.length?"?"+i.join("&"):"")}function RZe(t){if(!t)return;const e=t.includes("/"),i=t.split(",");return e?i.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(ve):i.map(r=>parseFloat(r))}function MZe(t){if(!t)return;const e=t.includes("/"),i=t.split(",");return e?i.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(ve):i}function DZe(t){if(!t)return;const e=t.includes("/"),i=t.split(",");return e?i.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"?IQt(n[2]):void 0}}).filter(ve):i.map(r=>new Date(r))}function IQt(t){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,i=t.match(e);return i?{years:NB(i[1]),months:NB(i[2]),days:NB(i[3]),hours:NB(i[4]),minutes:NB(i[5]),seconds:NB(i[6])}:null}function NB(t){if(!t)return 0;const e=/(?:\d+(?:.|,)\d+|\d+)/,i=t.match(e);if(!i)return 0;const r=i[0].replace(",",".");return Number(r)}function kB(t){return t.toISOString().replace(/\.[0-9]{3}/,"")}const FZe=new Set([102100,3857,102113,900913]),AQt=new Set([3395,54004]);function PQt(t,e){let i=t.wkid;return lt(e)?i:(i!=null&&e.includes(i)||!t.latestWkid||(i=t.latestWkid),i!=null&&FZe.has(i)?e.find(r=>FZe.has(r))||e.find(r=>AQt.has(r))||102100:i)}const oEe=new Ks({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function LZe(t){return t==="text/html"}function NZe(t){return t==="text/plain"}let zl=class extends up(eT(s0(Ch(qc(Sh(Yu(du))))))){constructor(...e){super(...e),this.allSublayers=new L2({getCollections:()=>[this.sublayers],getChildrenFunction:i=>i.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.url=null,this.version=null,this.addHandles([Wu(()=>this.sublayers,"after-add",({item:i})=>{i.parent=i.layer=this},qu),Wu(()=>this.sublayers,"after-remove",({item:i})=>{i.layer=i.parent=null},qu),sr(()=>this.sublayers,(i,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(i)for(const n of i)n.parent=n.layer=this},qu)])}normalizeCtorArgs(e,i){return typeof e=="string"?{url:e,...i}:e}load(e){const i=ve(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch(Ya).then(()=>this._fetchService(i))),Promise.resolve(this)}readFullExtentFromItemOrMap(e,i){const r=i.extent;return r?new Ar({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]}):null}writeFullExtent(e,i){i.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return lt(this.featureInfoFormats)?null:this.featureInfoFormats.find(LZe)??this.featureInfoFormats.find(NZe)??null}set featureInfoFormat(e){ve(e)?(LZe(e)||NZe(e))&&this._override("featureInfoFormat",e):(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat"))}readImageFormat(e,i){const r=i.supportedImageFormatTypes;return r&&r.includes("image/png")?"image/png":r&&r[0]}readSpatialReferenceFromItemOrDocument(e,i){return new hr(i.spatialReferences[0])}writeSpatialReferences(e,i){const r=this.spatialReference?.wkid;e&&r?(i.spatialReferences=e.filter(n=>n!==r),i.spatialReferences.unshift(r)):i.spatialReferences=e}readSublayersFromItemOrMap(e,i,r){return kZe(i.layers,r,i.visibleLayers)}readSublayers(e,i,r){return kZe(i.layers,r)}writeSublayers(e,i,r,n){i.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},c=a.write({parentLayerId:typeof a.parent?.id=="number"?a.parent.id:-1},l);if(s.has(a.id)&&(c.sublayerIds=s.get(a.id)),!a.sublayers&&a.name){const h=a.write({},l);delete h.id,i.layers.push(h)}}i.visibleLayers=o.filter(({visible:a,sublayers:l})=>a&&!l).map(({name:a})=>a).toArray()}createExportImageParameters(e,i,r,n){const s=n?.pixelRatio??1,o=Nae({extent:e,width:i})*s,a=new uT({layer:this,scale:o}),{xmin:l,ymin:c,xmax:h,ymax:p,spatialReference:y}=e,v=PQt(y,this.spatialReferences),x=this.version==="1.3.0"&&LB(v)?`${c},${l},${p},${h}`:`${l},${c},${h},${p}`,I=a.toJSON();return{bbox:x,[this.version==="1.3.0"?"crs":"srs"]:v==null||isNaN(v)?void 0:"EPSG:"+v,...I}}async fetchImage(e,i,r,n){const s=this.mapUrl,o=this.createExportImageParameters(e,i,r,n);if(!o.layers){const p=document.createElement("canvas");return p.width=i,p.height=r,p}const a=n?.timeExtent?.start,l=n?.timeExtent?.end,c=ve(a)&&ve(l)?a.getTime()===l.getTime()?kB(a):`${kB(a)}/${kB(l)}`:void 0,h={responseType:"image",query:this._mixCustomParameters({width:i,height:r,...o,time:c,...this.refreshParameters}),signal:n?.signal};return ur(s??"",h).then(p=>p.data)}async fetchImageBitmap(e,i,r,n){const s=this.mapUrl??"",o=this.createExportImageParameters(e,i,r,n);if(!o.layers){const y=document.createElement("canvas");return y.width=i,y.height=r,y}const a=n?.timeExtent?.start,l=n?.timeExtent?.end,c=ve(a)&&ve(l)?a.getTime()===l.getTime()?kB(a):`${kB(a)}/${kB(l)}`:void 0,h={responseType:"blob",query:this._mixCustomParameters({width:i,height:r,...o,time:c,...this.refreshParameters}),signal:n?.signal},{data:p}=await ur(s,h);return rM(p,s)}fetchFeatureInfo(e,i,r,n,s){const o=Nae({extent:e,width:i}),a=new uT({layer:this,scale:o}),l=xQt(a.visibleSublayers);if(lt(this.featureInfoUrl)||lt(l))return Promise.resolve([]);if(lt(this.fetchFeatureInfoFunction)&<(this.featureInfoFormat))return Promise.resolve([]);const c=this.version==="1.3.0"?{I:n,J:s}:{x:n,y:s},h={query_layers:l,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:i,height:r,...c},p={...this.createExportImageParameters(e,i,r),...h},y=this._mixCustomParameters(p);return ve(this.fetchFeatureInfoFunction)?this.fetchFeatureInfoFunction(y):this._defaultFetchFeatureInfoFunction(zy(this.featureInfoUrl,y))}findSublayerById(e){return this.allSublayers.find(i=>i.id===e)}findSublayerByName(e){return this.allSublayers.find(i=>i.name===e)}serviceSupportsSpatialReference(e){return RUt(this.url)||this.spatialReferences!=null&&this.spatialReferences.some(i=>{const r=i===900913?hr.WebMercator:new hr({wkid:i});return Da(r,e)})}_defaultFetchFeatureInfoFunction(e){const i=document.createElement("iframe");i.src=Vje(e),i.style.border="none",i.style.margin="0",i.style.width="100%",i.setAttribute("sandbox","");const r=new wh({title:this.title,content:i}),n=new io({sourceLayer:this,popupTemplate:r});return Promise.resolve([n])}async _fetchService(e){if(!this.resourceInfo){const{path:i,query:r}=this.parsedUrl??{};r?.service&&(r.SERVICE=r.service,delete r.service),r?.request&&(r.REQUEST=r.request,delete r.request);const{data:n}=await ur(i??"",{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...r,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=wQt(n)}if(this.parsedUrl){const i=new Hg(this.parsedUrl.path),{httpsDomains:r}=pa.request;i.scheme!=="https"||i.port&&i.port!=="443"||!i.host||r.includes(i.host)||r.push(i.host)}this.read(this.resourceInfo,{origin:"service"})}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const i={...this.customParameters,...this.customLayerParameters};for(const r in i)e[r.toLowerCase()]=i[r];return e}};function OQt(t,e){return t.some(i=>{for(const r in i)if(Aje(i,r,null,e))return!0;return!1})}function kZe(t,e,i){t=t??[];const r=new Map;t.every(s=>s.id==null)&&(t=gi(t)).forEach((s,o)=>s.id=o);for(const s of t){const o=new sEe;o.read(s,e),i&&!i.includes(o.name)&&(o.visible=!1),r.set(o.id,o)}const n=[];for(const s of t){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 Sr),a.sublayers.push(o)}else n.push(o)}return n}E([N({readOnly:!0})],zl.prototype,"allSublayers",void 0),E([N({json:{type:Object,write:!0}})],zl.prototype,"customParameters",void 0),E([N({json:{type:Object,write:!0}})],zl.prototype,"customLayerParameters",void 0),E([N({type:String,json:{write:!0}})],zl.prototype,"copyright",void 0),E([N()],zl.prototype,"description",void 0),E([N({readOnly:!0})],zl.prototype,"dimensions",void 0),E([N({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],zl.prototype,"fullExtent",void 0),E([Vi(["web-document","portal-item"],"fullExtent",["extent"])],zl.prototype,"readFullExtentFromItemOrMap",null),E([Cr(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],zl.prototype,"writeFullExtent",null),E([N()],zl.prototype,"fullExtents",void 0),E([N({type:String,json:{write:{ignoreOrigin:!0}}})],zl.prototype,"featureInfoFormat",null),E([N({type:[String],readOnly:!0})],zl.prototype,"featureInfoFormats",void 0),E([N({type:String,json:{write:{ignoreOrigin:!0}}})],zl.prototype,"featureInfoUrl",void 0),E([N()],zl.prototype,"fetchFeatureInfoFunction",void 0),E([N({type:String,json:{origins:{"web-document":{default:"image/png",type:oEe.jsonValues,read:{reader:oEe.read,source:"format"},write:{writer:oEe.write,target:"format"}}}}})],zl.prototype,"imageFormat",void 0),E([Vi("imageFormat",["supportedImageFormatTypes"])],zl.prototype,"readImageFormat",null),E([N({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],zl.prototype,"imageMaxHeight",void 0),E([N({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],zl.prototype,"imageMaxWidth",void 0),E([N()],zl.prototype,"imageTransparency",void 0),E([N(B1)],zl.prototype,"legendEnabled",void 0),E([N({type:["show","hide","hide-children"]})],zl.prototype,"listMode",void 0),E([N({type:String,json:{write:{ignoreOrigin:!0}}})],zl.prototype,"mapUrl",void 0),E([N({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],zl.prototype,"isReference",void 0),E([N({type:["WMS"]})],zl.prototype,"operationalLayerType",void 0),E([N()],zl.prototype,"resourceInfo",void 0),E([N({type:hr,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],zl.prototype,"spatialReference",void 0),E([Vi(["web-document","portal-item"],"spatialReference",["spatialReferences"])],zl.prototype,"readSpatialReferenceFromItemOrDocument",null),E([N({type:[Ls],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],zl.prototype,"spatialReferences",void 0),E([Cr(["web-document","portal-item"],"spatialReferences")],zl.prototype,"writeSpatialReferences",null),E([N({type:Sr.ofType(sEe),json:{write:{target:"layers",overridePolicy(t,e,i){if(OQt(this.allSublayers,i))return{ignoreOrigin:!0}}}}})],zl.prototype,"sublayers",void 0),E([Vi(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],zl.prototype,"readSublayersFromItemOrMap",null),E([Vi("service","sublayers",["layers"])],zl.prototype,"readSublayers",null),E([Cr("sublayers",{layers:{type:[sEe]},visibleLayers:{type:[String]}})],zl.prototype,"writeSublayers",null),E([N({json:{read:!1},readOnly:!0,value:"wms"})],zl.prototype,"type",void 0),E([N(Qy)],zl.prototype,"url",void 0),E([N({type:String,json:{write:{ignoreOrigin:!0}}})],zl.prototype,"version",void 0),zl=E([dt("esri.layers.WMSLayer")],zl);const $Ze=zl,RQt=Object.freeze(Object.defineProperty({__proto__:null,default:$Ze},Symbol.toStringTag,{value:"Module"}));var aEe;let Uae=aEe=class extends Ui{constructor(t){super(t),this.type="none"}clone(){return new aEe({type:this.type})}};E([rn({none:"none",stayAbove:"stay-above"})],Uae.prototype,"type",void 0),Uae=aEe=E([dt("esri.ground.NavigationConstraint")],Uae);let Yh=class extends Tn{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1,this.TERRAIN_USE_LEGACY_SHADING=!1}};E([N()],Yh.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),E([N()],Yh.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),E([N()],Yh.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),E([N()],Yh.prototype,"DECONFLICTOR_SHOW_GRID",void 0),E([N()],Yh.prototype,"LABELS_SHOW_BORDER",void 0),E([N()],Yh.prototype,"TEXT_SHOW_BASELINE",void 0),E([N()],Yh.prototype,"TEXT_SHOW_BORDER",void 0),E([N()],Yh.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),E([N()],Yh.prototype,"OVERLAY_SHOW_CENTER",void 0),E([N()],Yh.prototype,"SHOW_POI",void 0),E([N()],Yh.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),E([N()],Yh.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),E([N()],Yh.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),E([N()],Yh.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),E([N()],Yh.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),E([N()],Yh.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),E([N()],Yh.prototype,"I3S_TREE_SHOW_TILES",void 0),E([N()],Yh.prototype,"I3S_SHOW_MODIFICATIONS",void 0),E([N()],Yh.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),E([N()],Yh.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),E([N()],Yh.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),E([N()],Yh.prototype,"LINE_WIREFRAMES",void 0),E([N()],Yh.prototype,"TERRAIN_USE_LEGACY_SHADING",void 0),Yh=E([dt("esri.views.3d.support.DebugFlags")],Yh);const MQt=new Yh;var lEe;let hT=lEe=class extends Y0(gd){constructor(t){super(t),this.opacity=1,this.shading=!MQt.TERRAIN_USE_LEGACY_SHADING,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new Sr;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"&&Oi.getLogger(this.declaredClass).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.`)},i=r=>{r.parent=null};this.layers.on("after-add",r=>e(r.item)),this.layers.on("after-remove",r=>i(r.item))}initialize(){this.when().catch(t=>{Oi.getLogger(this.declaredClass).error("#load()","Failed to load ground",t)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const t=this.layers.removeAll();for(const e of t)e.destroy();this.layers.destroy()}normalizeCtorArgs(t){return t&&"resourceInfo"in t&&(this._set("resourceInfo",t.resourceInfo),delete(t={...t}).resourceInfo),t}set layers(t){this._set("layers",og(t,this._get("layers")))}writeLayers(t,e,i,r){const n=[];t&&(r={...r,layerContainerType:"ground"},t.forEach(s=>{if("write"in s){const o={};Pjt(s)().write(o,r)&&n.push(o)}else r&&r.messages&&r.messages.push(new st("layer:unsupported",`Layers (${s.title}, ${s.id}) of type '${s.declaredClass}' cannot be persisted in the ground`,{layer:s}))})),e.layers=n}load(t){return this.addResolvingPromise(this._loadFromSource(t)),Promise.resolve(this)}loadAll(){return mL(this,t=>{t(this.layers)})}async queryElevation(t,e){await this.load({signal:e?.signal});const{ElevationQuery:i}=await Promise.resolve().then(()=>tme);yn(e);const r=new i,n=this.layers.filter(BZe).toArray();return r.queryAll(n,t,e)}async createElevationSampler(t,e){await this.load({signal:e?.signal});const{ElevationQuery:i}=await Promise.resolve().then(()=>tme);yn(e);const r=new i,n=this.layers.filter(BZe).toArray();return r.createSamplerAll(n,t,e)}clone(){const t={opacity:this.opacity,surfaceColor:gi(this.surfaceColor),navigationConstraint:gi(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(t.loadStatus="loaded"),new lEe({resourceInfo:this.resourceInfo}).set(t)}read(t,e){this.resourceInfo||this._set("resourceInfo",{data:t,context:e}),super.read(t,e)}_loadFromSource(t){const e=this.resourceInfo;return e?this._loadLayersFromJSON(e.data,e.context,t):Promise.resolve()}_loadLayersFromJSON(t,e,i){const r=e&&e.origin||"web-scene",n=e&&e.portal||null,s=e&&e.url||null;return Promise.resolve().then(()=>Vpt).then(({populateOperationalLayers:o})=>{yn(i);const a=[];if(t.layers&&Array.isArray(t.layers)){const l={context:{origin:r,url:s,portal:n,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};a.push(o(this.layers,t.layers,l))}return Ru(a)}).then(()=>{})}};function DQt(t){return t&&"createElevationSampler"in t}function BZe(t){return t.type==="elevation"||DQt(t)}E([N({json:{read:!1}})],hT.prototype,"layers",null),E([Cr("layers")],hT.prototype,"writeLayers",null),E([N({readOnly:!0})],hT.prototype,"resourceInfo",void 0),E([N({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:Ls,read:{reader:h9,source:"transparency"},write:{writer:(t,e)=>{e.transparency=qne(t)},target:"transparency"}}})],hT.prototype,"opacity",void 0),E([N({type:Boolean,nonNullable:!0,json:{read:!1}})],hT.prototype,"shading",void 0),E([N({type:en,json:{type:[Ls],write:(t,e)=>{e.surfaceColor=t.toJSON().slice(0,3)}}})],hT.prototype,"surfaceColor",void 0),E([N({type:Uae,json:{write:!0}})],hT.prototype,"navigationConstraint",void 0),hT=lEe=E([dt("esri.Ground")],hT);const zae=hT;function FQt(t){return!(!t?.loaded||!AL(t)?.operations?.supportsEditing||"editingEnabled"in t&&!jGe(t))}const VZe=Oi.getLogger("esri.support.basemapUtils");function LQt(){return{}}function NQt(t){for(const e in t){const i=t[e];i?.destroyed===!1&&i.destroy(),delete t[e]}}function kQt(t,e){let i;if(typeof t=="string"){if(!(t in $1e)){const r=Object.entries($1e).filter(([n,s])=>pa.apiKey&&!s.classic||!pa.apiKey&&s.classic&&!s.deprecated).map(([n])=>`"${n}"`).join(", ");return VZe.warn(`Unable to find basemap definition for: ${t}. Try one of these: ${r}`),null}e&&(i=e[t]),i||(i=iR.fromId(t),e&&(e[t]=i))}else i=fd(iR,t);return i?.destroyed&&(VZe.warn("The provided basemap is already destroyed",{basemap:i}),i=null),i}function $Qt(t,e){return t===e?!0:UQt(jZe(t),jZe(e),{mustMatchReferences:!0})==="equal"}function BQt(t,e){if(lt(e)||lt(t))return{spatialReference:null,updating:!1};if(e.loadStatus==="not-loaded")return e.load(),{spatialReference:null,updating:!0};if(e.spatialReference)return{spatialReference:e.spatialReference,updating:!1};if(e.baseLayers.length===0)return{spatialReference:null,updating:!1};const i=e.baseLayers.getItemAt(0);switch(i.loadStatus){case"not-loaded":i.load();case"loading":return{spatialReference:null,updating:!0};case"failed":return{spatialReference:null,updating:!1}}const r=(("supportedSpatialReferences"in i?i.supportedSpatialReferences:null)||["tileInfo"in i?i.tileInfo?.spatialReference:i.spatialReference]).filter(Boolean),n=t.spatialReference;return n?{spatialReference:r.find(s=>n.equals(s))??r[0]??null,updating:!1}:{spatialReference:r[0],updating:!1}}function jZe(t){return t?!t.loaded&&t.resourceInfo?jQt(t.resourceInfo.data):{baseLayers:GZe(t.baseLayers),referenceLayers:GZe(t.referenceLayers)}:null}function GZe(t){return(Sr.isCollection(t)?t.toArray():t).map(VQt)}function VQt(t){return{type:t.type,url:HZe("urlTemplate"in t&&t.urlTemplate||t.url||"styleUrl"in t&&t.styleUrl||""),minScale:"minScale"in t&&t.minScale!=null?t.minScale:0,maxScale:"maxScale"in t&&t.maxScale!=null?t.maxScale:0,opacity:t.opacity!=null?t.opacity:1,visible:t.visible==null||!!t.visible,sublayers:t.type!=="map-image"&&t.type!=="wms"||!ve(t.sublayers)?void 0:t.sublayers?.map(e=>({id:e.id,visible:e.visible})),activeLayerId:t.type==="wmts"?t.activeLayer?.id:void 0}}function jQt(t){return t?{baseLayers:UZe((t.baseMapLayers??[]).filter(e=>!e.isReference)),referenceLayers:UZe((t.baseMapLayers??[]).filter(e=>e.isReference))}:null}function UZe(t){return t.map(e=>GQt(e))}function GQt(t){let e;switch(t.layerType){case"VectorTileLayer":e="vector-tile";break;case"ArcGISTiledMapServiceLayer":e="tile";break;default:e="unknown"}return{type:e,url:HZe(t.templateUrl||t.urlTemplate||t.styleUrl||t.url),minScale:t.minScale!=null?t.minScale:0,maxScale:t.maxScale!=null?t.maxScale:0,opacity:t.opacity!=null?t.opacity:1,visible:t.visibility==null||!!t.visibility,sublayers:void 0,activeLayerId:void 0}}function UQt(t,e,i){return t!=null!=(e!=null)?"not-equal":!t||!e?"equal":zZe(t.baseLayers,e.baseLayers)?zZe(t.referenceLayers,e.referenceLayers)?"equal":i.mustMatchReferences?"not-equal":"base-layers-equal":"not-equal"}function zZe(t,e){if(t.length!==e.length)return!1;for(let i=0;i[t.tables,t.layers],getChildrenFunction:e=>{const i=[];return"tables"in e&&i.push(e.tables),"layers"in e&&i.push(e.layers),i},itemFilterFunction:e=>{const i=e.parent;return!!i&&"tables"in i&&i.tables.includes(e)}})}const qZe={"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 HQt(t){let e=null;if(typeof t=="string")if(t in qZe){const i=qZe[t];e=new zae({resourceInfo:{data:{layers:[i]}}})}else Oi.getLogger("esri.support.groundUtils").warn(`Unable to find ground definition for: ${t}. Try "world-elevation"`);else e=fd(zae,t);return e}function uEe(t,e,i){let r,n;if(t)for(let s=0,o=t.length;s{let e=class extends t{constructor(...i){super(...i),this.layers=new Sr;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"||Oi.getLogger(this.declaredClass).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.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 i=this.layers.removeAll();for(const r of i)this.layerRemoved(r),r.destroy();this.layers.destroy()}set layers(i){this._set("layers",og(i,this._get("layers")))}add(i,r){const n=this.layers;if(r=n.getNextIndex(r),i instanceof du){const s=i;s.parent===this?this.reorder(s,r):n.add(s,r)}else Fp(i)?i.then(s=>{this.destroyed||this.add(s,r)}):Oi.getLogger(this.declaredClass).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(i,r){const n=this.layers;let s=n.getNextIndex(r);i.slice().forEach(o=>{o.parent!==this?(n.add(o,s),s+=1):this.reorder(o,s)})}findLayerById(i){return uEe(this.layers,"id",i)}findLayerByUid(i){return uEe(this.layers,"uid",i)}remove(i){return this.layers.remove(i)}removeMany(i){return this.layers.removeMany(i)}removeAll(){return this.layers.removeAll()}reorder(i,r){return this.layers.reorder(i,r)}layerAdded(i){}layerRemoved(i){}};return E([N()],e.prototype,"layers",null),e=E([dt("esri.support.LayersMixin")],e),e};function cEe(t,e,i){if(t)for(let r=0,n=t.length;r{let e=class extends t{constructor(...i){super(...i),this.tables=new Sr,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"&&Oi.getLogger(this.declaredClass).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 i=this.tables.removeAll();for(const r of i)r.destroy();this.tables.destroy()}set tables(i){this._set("tables",og(i,this._get("tables")))}findTableById(i){return cEe(this.tables,"id",i)}findTableByUid(i){return cEe(this.tables,"uid",i)}};return E([N()],e.prototype,"tables",null),e=E([dt("esri.support.TablesMixin")],e),e};let dT=class extends XZe(YZe(md.EventedMixin(Tn))){constructor(e){super(e),this.allLayers=new L2({getCollections:()=>[this.basemap?.baseLayers,this.ground?.layers,this.layers,this.basemap?.referenceLayers],getChildrenFunction:i=>"layers"in i?i.layers:null}),this.allTables=WZe(this),this.basemap=null,this.editableLayers=new L2({getCollections:()=>[this.allLayers],itemFilterFunction:FQt}),this.ground=new zae,this._basemapCache=LQt()}destroy(){this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),this.ground?.destroy(),this.basemap?.destroy(),NQt(this._basemapCache),this._basemapCache=null}castBasemap(e){return kQt(e,this._basemapCache)}castGround(e){const i=HQt(e);return lt(i)?this._get("ground"):i}findLayerById(e){return this.allLayers.find(i=>i.id===e)}findTableById(e){return this.allTables.find(i=>i.id===e)}};E([N({readOnly:!0,dependsOn:[]})],dT.prototype,"allLayers",void 0),E([N({readOnly:!0})],dT.prototype,"allTables",void 0),E([N({type:iR})],dT.prototype,"basemap",void 0),E([ho("basemap")],dT.prototype,"castBasemap",null),E([N({readOnly:!0})],dT.prototype,"editableLayers",void 0),E([N({type:zae,nonNullable:!0})],dT.prototype,"ground",void 0),E([ho("ground")],dT.prototype,"castGround",null),dT=E([dt("esri.Map")],dT);const KZe=dT;function WQt(t){const e=t.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 qQt(t,e){const i={};for(const r of e){const{parentObjectId:n,parentGlobalId:s,attachmentInfos:o}=r;for(const a of o){const{id:l}=a,c=Vje(z$t(`${t.path}/${n}/attachments/${l}`)),h=qJe.fromJSON(a);h.set({url:c,parentObjectId:n,parentGlobalId:s}),i[n]?i[n].push(h):i[n]=[h]}}return i}function YQt(t,e,i){let r={query:gY({...t.query,f:"json",...WQt(e)})};return i&&(r={...i,...r,query:{...i.query,...r.query}}),ur(t.path+"/queryAttachments",r).then(n=>n.data.attachmentGroups)}async function XQt(t,e,i){const{objectIds:r}=e,n=[];for(const s of r)n.push(ur(t.path+"/"+s+"/attachments",i));return Promise.all(n).then(s=>r.map((o,a)=>({parentObjectId:o,attachmentInfos:s[a].data.attachmentInfos})))}const KQt=Object.freeze(Object.defineProperty({__proto__:null,executeAttachmentQuery:YQt,fetchAttachments:XQt,processAttachmentQueryResult:qQt},Symbol.toStringTag,{value:"Module"}));function JQt(t,e){const i=t.toJSON();return i.objectIds&&(i.objectIds=i.objectIds.join(",")),i.orderByFields&&(i.orderByFields=i.orderByFields.join(",")),i.outFields&&!e?.returnCountOnly?i.outFields.includes("*")?i.outFields="*":i.outFields=i.outFields.join(","):delete i.outFields,i.outSpatialReference&&(i.outSR=i.outSR.wkid||JSON.stringify(i.outSR.toJSON()),delete i.outSpatialReference),i.dynamicDataSource&&(i.layer=JSON.stringify({source:i.dynamicDataSource}),delete i.dynamicDataSource),i}async function ZQt(t,e,i){const r=await JZe(t,e,i),n=r.data,s=n.geometryType,o=n.spatialReference,a={};for(const l of n.relatedRecordGroups){const c={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]=c;else for(const h in l)l.hasOwnProperty(h)&&h!=="relatedRecords"&&(a[l[h]]=c)}return{...r,data:a}}async function QQt(t,e,i){const r=await JZe(t,e,i,{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 JZe(t,e,i={},r){const n=gY({...t.query,f:"json",...r,...JQt(e,r)});return ur(t.path+"/queryRelatedRecords",{...i,query:{...i.query,...n}})}async function eei(t,e,i){e=ZC.from(e);const r=hh(t);return ZQt(r,e,i).then(n=>{const s=n.data,o={};return Object.keys(s).forEach(a=>o[a]=tc.fromJSON(s[a])),o})}async function tei(t,e,i){e=ZC.from(e);const r=hh(t);return QQt(r,e,{...i}).then(n=>n.data)}const ZZe=Object.freeze(Object.defineProperty({__proto__:null,executeRelationshipQuery:eei,executeRelationshipQueryForCount:tei},Symbol.toStringTag,{value:"Module"})),QZe="Layer does not support extent calculation.";function iei(t,e){const i=t.geometry,r=t.toJSON(),n=r;if(ve(i)&&(n.geometry=JSON.stringify(i),n.geometryType=bd(i),n.inSR=i.spatialReference.wkid||JSON.stringify(i.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=r.outSR.wkid||JSON.stringify(r.outSR):i&&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 rei(t,e,i,r){const n=await Hae(t,e,"json",r);return ioe(e,i,n.data),n}async function nei(t,e,i){return ve(e.timeExtent)&&e.timeExtent.isEmpty?{data:{objectIds:[]}}:Hae(t,e,"json",i,{returnIdsOnly:!0})}async function sei(t,e,i){return ve(e.timeExtent)&&e.timeExtent.isEmpty?{data:{count:0,extent:null}}:Hae(t,e,"json",i,{returnExtentOnly:!0,returnCountOnly:!0}).then(r=>{const n=r.data;if(n.hasOwnProperty("extent"))return r;if(n.features)throw new Error(QZe);if(n.hasOwnProperty("count"))throw new Error(QZe);return r})}function oei(t,e,i){return ve(e.timeExtent)&&e.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):Hae(t,e,"json",i,{returnIdsOnly:!0,returnCountOnly:!0})}function Hae(t,e,i,r={},n={}){const s=typeof t=="string"?fa(t):t,o=e.geometry?[e.geometry]:[];return r.responseType=i==="pbf"?"array-buffer":"json",ov(o,null,r).then(a=>{const l=a&&a[0];ve(l)&&((e=e.clone()).geometry=l);const c=gY({...s.query,f:i,...n,...iei(e,n)});return ur(yd(s.path,"queryTopFeatures"),{...r,query:{...c,...r.query}})})}async function aei(t,e,i,r){const n=hh(t),s={...r},{data:o}=await rei(n,QR.from(e),i,s);return tc.fromJSON(o)}const lei=Object.freeze(Object.defineProperty({__proto__:null,executeTopFeaturesQuery:aei},Symbol.toStringTag,{value:"Module"}));async function uei(t,e,i){const r=hh(t);return(await nei(r,QR.from(e),{...i})).data.objectIds}const cei=Object.freeze(Object.defineProperty({__proto__:null,executeForTopIds:uei},Symbol.toStringTag,{value:"Module"}));async function hei(t,e,i){const r=hh(t),n=await sei(r,QR.from(e),{...i});return{count:n.data.count,extent:Ar.fromJSON(n.data.extent)}}const dei=Object.freeze(Object.defineProperty({__proto__:null,executeForTopExtents:hei},Symbol.toStringTag,{value:"Module"}));async function pei(t,e,i){const r=hh(t);return(await oei(r,QR.from(e),{...i})).data.count}const fei=Object.freeze(Object.defineProperty({__proto__:null,executeForTopCount:pei},Symbol.toStringTag,{value:"Module"}));let hEe=class{constructor(e,i){this.min=e,this.max=i,this.range=i-e}ndiff(e,i=0){return Math.ceil((e-i)/this.range)*this.range+i}_normalize(e,i,r,n=0,s=!1){return(r-=n)i&&(r-=this.ndiff(r-i)),s&&r===i&&(r=e),r+n}normalize(e,i=0,r=!1){return this._normalize(this.min,this.max,e,i,r)}clamp(e,i=0){return eu(e-i,this.min,this.max)+i}monotonic(e,i,r){return ee&&r_w.normalize(jd(t)))],WA.prototype,"heading",void 0),E([N({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),ho(t=>eu(jd(t),-180,180))],WA.prototype,"tilt",void 0),E([N({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],WA.prototype,"fov",void 0),WA=E([dt("esri.Camera")],WA);const mei=WA;var pEe;let dM=pEe=class extends Ui{constructor(t){super(t),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(t){return(t%=360)<0&&(t+=360),t}clone(){return new pEe({rotation:this.rotation,scale:this.scale,targetGeometry:ve(this.targetGeometry)?this.targetGeometry.clone():null,camera:ve(this.camera)?this.camera.clone():null})}};function fEe(){return{enabled:!this.camera}}E([N({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:fEe}}}}})],dM.prototype,"rotation",void 0),E([ho("rotation")],dM.prototype,"castRotation",null),E([N({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:fEe}}}}})],dM.prototype,"scale",void 0),E([N({types:R1,json:{read:Sl,write:!0,origins:{"web-scene":{read:Sl,write:{overridePolicy:fEe}}}}})],dM.prototype,"targetGeometry",void 0),E([N({type:mei,json:{write:!0}})],dM.prototype,"camera",void 0),dM=pEe=E([dt("esri.Viewpoint")],dM);const p_=dM,Wae={widthBreakpoint:{getValue(t){const e=t.viewSize[0],i=t.breakpoints,r=this.values;return e<=i.xsmall?r.xsmall:e<=i.small?r.small:e<=i.medium?r.medium:e<=i.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(t){const e=t.viewSize[1],i=t.breakpoints,r=this.values;return e<=i.xsmall?r.xsmall:e<=i.small?r.small:e<=i.medium?r.medium:e<=i.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(t){const e=t.viewSize,i=e[0],r=e[1],n=this.values;return r>=i?n.portrait:n.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},mEe={xsmall:544,small:768,medium:992,large:1200};function gei(t){const e=t;return e&&e.xsmall{let e=class extends t{constructor(...i){super(...i),this._breakpointsHandles=new df,this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=mEe}initialize(){this._breakpointsHandles.add(sr(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),Yo))}destroy(){this.destroyed||(this._removeActiveClassNames(),this._breakpointsHandles=da(this._breakpointsHandles))}set breakpoints(i){if(i===this._get("breakpoints"))return;const r=gei(i);if(!r){const n=JSON.stringify(mEe,null,2);console.warn("provided breakpoints are not valid, using defaults:"+n)}i=r?i:mEe,this._set("breakpoints",{...i})}_updateClassNames(){if(!this.container)return;const i=Gg.acquire(),r=Gg.acquire();let n,s=!1;for(n in Wae){const o=this[n],a=Wae[n].getValue({viewSize:this.size,breakpoints:this.breakpoints});o!==a&&(s=!0,this[n]=a,gEe(n,o).forEach(l=>r.push(l)),gEe(n,a).forEach(l=>i.push(l)))}s&&(this._applyClassNameChanges(i,r),Gg.release(i),Gg.release(r))}_applyClassNameChanges(i,r){const n=this.container;n&&(r.forEach(s=>n.classList.remove(s)),i.forEach(s=>n.classList.add(s)))}_removeActiveClassNames(){const i=this.container;if(!i)return;let r;for(r in Wae)gEe(r,this[r]).forEach(n=>i.classList.remove(n))}};return E([N()],e.prototype,"breakpoints",null),E([N()],e.prototype,"orientation",void 0),E([N()],e.prototype,"widthBreakpoint",void 0),E([N()],e.prototype,"heightBreakpoint",void 0),e=E([dt("esri.views.BreakpointsOwner")],e),e};function yEe(t){return typeof t=="string"?document.getElementById(t):t??null}function eQe(t){for(;t.hasChildNodes();)t.removeChild(t.firstChild)}function tQe(t,e){const i=e.parentNode;i&&i.insertBefore(t,e)}function iQe(t,e){for(;;){const i=t.firstChild;if(!i)break;e.appendChild(i)}}/*! * @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 @@ -43,23 +43,23 @@ var RAMP4=function(U0){"use strict";var S1=(t=>(t.BLOB="blob",t.DATE="date",t.DO * Copyright (c) 2012-2018 Zongmin Lei(雷宗民) * http://ucdok.com * MIT License, see https://github.com/leizongmin/js-xss/blob/master/LICENSE for details - */var XQt=function(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},Z5={exports:{}},op={},EY={exports:{}},Q5={};function QZe(){var t={};return t["align-content"]=!1,t["align-items"]=!1,t["align-self"]=!1,t["alignment-adjust"]=!1,t["alignment-baseline"]=!1,t.all=!1,t["anchor-point"]=!1,t.animation=!1,t["animation-delay"]=!1,t["animation-direction"]=!1,t["animation-duration"]=!1,t["animation-fill-mode"]=!1,t["animation-iteration-count"]=!1,t["animation-name"]=!1,t["animation-play-state"]=!1,t["animation-timing-function"]=!1,t.azimuth=!1,t["backface-visibility"]=!1,t.background=!0,t["background-attachment"]=!0,t["background-clip"]=!0,t["background-color"]=!0,t["background-image"]=!0,t["background-origin"]=!0,t["background-position"]=!0,t["background-repeat"]=!0,t["background-size"]=!0,t["baseline-shift"]=!1,t.binding=!1,t.bleed=!1,t["bookmark-label"]=!1,t["bookmark-level"]=!1,t["bookmark-state"]=!1,t.border=!0,t["border-bottom"]=!0,t["border-bottom-color"]=!0,t["border-bottom-left-radius"]=!0,t["border-bottom-right-radius"]=!0,t["border-bottom-style"]=!0,t["border-bottom-width"]=!0,t["border-collapse"]=!0,t["border-color"]=!0,t["border-image"]=!0,t["border-image-outset"]=!0,t["border-image-repeat"]=!0,t["border-image-slice"]=!0,t["border-image-source"]=!0,t["border-image-width"]=!0,t["border-left"]=!0,t["border-left-color"]=!0,t["border-left-style"]=!0,t["border-left-width"]=!0,t["border-radius"]=!0,t["border-right"]=!0,t["border-right-color"]=!0,t["border-right-style"]=!0,t["border-right-width"]=!0,t["border-spacing"]=!0,t["border-style"]=!0,t["border-top"]=!0,t["border-top-color"]=!0,t["border-top-left-radius"]=!0,t["border-top-right-radius"]=!0,t["border-top-style"]=!0,t["border-top-width"]=!0,t["border-width"]=!0,t.bottom=!1,t["box-decoration-break"]=!0,t["box-shadow"]=!0,t["box-sizing"]=!0,t["box-snap"]=!0,t["box-suppress"]=!0,t["break-after"]=!0,t["break-before"]=!0,t["break-inside"]=!0,t["caption-side"]=!1,t.chains=!1,t.clear=!0,t.clip=!1,t["clip-path"]=!1,t["clip-rule"]=!1,t.color=!0,t["color-interpolation-filters"]=!0,t["column-count"]=!1,t["column-fill"]=!1,t["column-gap"]=!1,t["column-rule"]=!1,t["column-rule-color"]=!1,t["column-rule-style"]=!1,t["column-rule-width"]=!1,t["column-span"]=!1,t["column-width"]=!1,t.columns=!1,t.contain=!1,t.content=!1,t["counter-increment"]=!1,t["counter-reset"]=!1,t["counter-set"]=!1,t.crop=!1,t.cue=!1,t["cue-after"]=!1,t["cue-before"]=!1,t.cursor=!1,t.direction=!1,t.display=!0,t["display-inside"]=!0,t["display-list"]=!0,t["display-outside"]=!0,t["dominant-baseline"]=!1,t.elevation=!1,t["empty-cells"]=!1,t.filter=!1,t.flex=!1,t["flex-basis"]=!1,t["flex-direction"]=!1,t["flex-flow"]=!1,t["flex-grow"]=!1,t["flex-shrink"]=!1,t["flex-wrap"]=!1,t.float=!1,t["float-offset"]=!1,t["flood-color"]=!1,t["flood-opacity"]=!1,t["flow-from"]=!1,t["flow-into"]=!1,t.font=!0,t["font-family"]=!0,t["font-feature-settings"]=!0,t["font-kerning"]=!0,t["font-language-override"]=!0,t["font-size"]=!0,t["font-size-adjust"]=!0,t["font-stretch"]=!0,t["font-style"]=!0,t["font-synthesis"]=!0,t["font-variant"]=!0,t["font-variant-alternates"]=!0,t["font-variant-caps"]=!0,t["font-variant-east-asian"]=!0,t["font-variant-ligatures"]=!0,t["font-variant-numeric"]=!0,t["font-variant-position"]=!0,t["font-weight"]=!0,t.grid=!1,t["grid-area"]=!1,t["grid-auto-columns"]=!1,t["grid-auto-flow"]=!1,t["grid-auto-rows"]=!1,t["grid-column"]=!1,t["grid-column-end"]=!1,t["grid-column-start"]=!1,t["grid-row"]=!1,t["grid-row-end"]=!1,t["grid-row-start"]=!1,t["grid-template"]=!1,t["grid-template-areas"]=!1,t["grid-template-columns"]=!1,t["grid-template-rows"]=!1,t["hanging-punctuation"]=!1,t.height=!0,t.hyphens=!1,t.icon=!1,t["image-orientation"]=!1,t["image-resolution"]=!1,t["ime-mode"]=!1,t["initial-letters"]=!1,t["inline-box-align"]=!1,t["justify-content"]=!1,t["justify-items"]=!1,t["justify-self"]=!1,t.left=!1,t["letter-spacing"]=!0,t["lighting-color"]=!0,t["line-box-contain"]=!1,t["line-break"]=!1,t["line-grid"]=!1,t["line-height"]=!1,t["line-snap"]=!1,t["line-stacking"]=!1,t["line-stacking-ruby"]=!1,t["line-stacking-shift"]=!1,t["line-stacking-strategy"]=!1,t["list-style"]=!0,t["list-style-image"]=!0,t["list-style-position"]=!0,t["list-style-type"]=!0,t.margin=!0,t["margin-bottom"]=!0,t["margin-left"]=!0,t["margin-right"]=!0,t["margin-top"]=!0,t["marker-offset"]=!1,t["marker-side"]=!1,t.marks=!1,t.mask=!1,t["mask-box"]=!1,t["mask-box-outset"]=!1,t["mask-box-repeat"]=!1,t["mask-box-slice"]=!1,t["mask-box-source"]=!1,t["mask-box-width"]=!1,t["mask-clip"]=!1,t["mask-image"]=!1,t["mask-origin"]=!1,t["mask-position"]=!1,t["mask-repeat"]=!1,t["mask-size"]=!1,t["mask-source-type"]=!1,t["mask-type"]=!1,t["max-height"]=!0,t["max-lines"]=!1,t["max-width"]=!0,t["min-height"]=!0,t["min-width"]=!0,t["move-to"]=!1,t["nav-down"]=!1,t["nav-index"]=!1,t["nav-left"]=!1,t["nav-right"]=!1,t["nav-up"]=!1,t["object-fit"]=!1,t["object-position"]=!1,t.opacity=!1,t.order=!1,t.orphans=!1,t.outline=!1,t["outline-color"]=!1,t["outline-offset"]=!1,t["outline-style"]=!1,t["outline-width"]=!1,t.overflow=!1,t["overflow-wrap"]=!1,t["overflow-x"]=!1,t["overflow-y"]=!1,t.padding=!0,t["padding-bottom"]=!0,t["padding-left"]=!0,t["padding-right"]=!0,t["padding-top"]=!0,t.page=!1,t["page-break-after"]=!1,t["page-break-before"]=!1,t["page-break-inside"]=!1,t["page-policy"]=!1,t.pause=!1,t["pause-after"]=!1,t["pause-before"]=!1,t.perspective=!1,t["perspective-origin"]=!1,t.pitch=!1,t["pitch-range"]=!1,t["play-during"]=!1,t.position=!1,t["presentation-level"]=!1,t.quotes=!1,t["region-fragment"]=!1,t.resize=!1,t.rest=!1,t["rest-after"]=!1,t["rest-before"]=!1,t.richness=!1,t.right=!1,t.rotation=!1,t["rotation-point"]=!1,t["ruby-align"]=!1,t["ruby-merge"]=!1,t["ruby-position"]=!1,t["shape-image-threshold"]=!1,t["shape-outside"]=!1,t["shape-margin"]=!1,t.size=!1,t.speak=!1,t["speak-as"]=!1,t["speak-header"]=!1,t["speak-numeral"]=!1,t["speak-punctuation"]=!1,t["speech-rate"]=!1,t.stress=!1,t["string-set"]=!1,t["tab-size"]=!1,t["table-layout"]=!1,t["text-align"]=!0,t["text-align-last"]=!0,t["text-combine-upright"]=!0,t["text-decoration"]=!0,t["text-decoration-color"]=!0,t["text-decoration-line"]=!0,t["text-decoration-skip"]=!0,t["text-decoration-style"]=!0,t["text-emphasis"]=!0,t["text-emphasis-color"]=!0,t["text-emphasis-position"]=!0,t["text-emphasis-style"]=!0,t["text-height"]=!0,t["text-indent"]=!0,t["text-justify"]=!0,t["text-orientation"]=!0,t["text-overflow"]=!0,t["text-shadow"]=!0,t["text-space-collapse"]=!0,t["text-transform"]=!0,t["text-underline-position"]=!0,t["text-wrap"]=!0,t.top=!1,t.transform=!1,t["transform-origin"]=!1,t["transform-style"]=!1,t.transition=!1,t["transition-delay"]=!1,t["transition-duration"]=!1,t["transition-property"]=!1,t["transition-timing-function"]=!1,t["unicode-bidi"]=!1,t["vertical-align"]=!1,t.visibility=!1,t["voice-balance"]=!1,t["voice-duration"]=!1,t["voice-family"]=!1,t["voice-pitch"]=!1,t["voice-range"]=!1,t["voice-rate"]=!1,t["voice-stress"]=!1,t["voice-volume"]=!1,t.volume=!1,t["white-space"]=!1,t.widows=!1,t.width=!0,t["will-change"]=!1,t["word-break"]=!0,t["word-spacing"]=!0,t["word-wrap"]=!0,t["wrap-flow"]=!1,t["wrap-through"]=!1,t["writing-mode"]=!1,t["z-index"]=!1,t}function KQt(t,e,i){}function JQt(t,e,i){}var ZQt=/javascript\s*\:/img;function QQt(t,e){return ZQt.test(e)?"":e}Q5.whiteList=QZe(),Q5.getDefaultWhiteList=QZe,Q5.onAttr=KQt,Q5.onIgnoreAttr=JQt,Q5.safeAttrValue=QQt;var eei={indexOf:function(t,e){var i,r;if(Array.prototype.indexOf)return t.indexOf(e);for(i=0,r=t.length;i/g,mei=/"/g,gei=/"/g,yei=/&#([a-zA-Z0-9]*);?/gim,vei=/:?/gim,_ei=/&newline;?/gim,Zae=/((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,sQe=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,oQe=/u\s*r\s*l\s*\(.*/gi;function aQe(t){return t.replace(mei,""")}function lQe(t){return t.replace(gei,'"')}function uQe(t){return t.replace(yei,function(i,r){return r[0]==="x"||r[0]==="X"?String.fromCharCode(parseInt(r.substr(1),16)):String.fromCharCode(parseInt(r,10))})}function cQe(t){return t.replace(vei,":").replace(_ei," ")}function hQe(t){for(var e="",i=0,r=t.length;i",r);if(n===-1)break;i=n+3}return e}function Sei(t){var e=t.split("");return e=e.filter(function(i){var r=i.charCodeAt(0);return r===127?!1:r<=31?r===10||r===13:!0}),e.join("")}op.whiteList=iQe(),op.getDefaultWhiteList=iQe,op.onTag=lei,op.onIgnoreTag=uei,op.onTagAttr=cei,op.onIgnoreTagAttr=hei,op.safeAttrValue=dei,op.escapeHtml=nQe,op.escapeQuote=aQe,op.unescapeQuote=lQe,op.escapeHtmlEntities=uQe,op.escapeDangerHtml5Entities=cQe,op.clearNonPrintableCharacter=hQe,op.friendlyAttrValue=dQe,op.escapeAttrValue=pQe,op.onIgnoreTagStripAll=bei,op.StripTagBody=wei,op.stripCommentTag=xei,op.stripBlankChar=Sei,op.cssFilter=rQe,op.getDefaultCSSWhiteList=aei;var Qae={},pM=fEe;function Cei(t){var e=pM.spaceIndex(t),i;return e===-1?i=t.slice(1,-1):i=t.slice(1,e+1),i=pM.trim(i).toLowerCase(),i.slice(0,1)==="/"&&(i=i.slice(1)),i.slice(-1)==="/"&&(i=i.slice(0,-1)),i}function Tei(t){return t.slice(0,2)===""){r+=i(t.slice(n,s)),d=t.slice(s,a+1),c=Cei(d),r+=e(s,r.length,c,d,Tei(d)),n=a+1,s=!1;continue}if(p==='"'||p==="'")for(var y=1,v=t.charAt(a-y);v.trim()===""||v==="=";){if(v==="="){o=p;continue e}v=t.charAt(a-++y)}}else if(p===o){o=!1;continue}}return n0;e--){var i=t[e];if(i!==" ")return i==="="?e:-1}}function Mei(t){return t[0]==='"'&&t[t.length-1]==='"'||t[0]==="'"&&t[t.length-1]==="'"}function fQe(t){return Mei(t)?t.substr(1,t.length-2):t}Qae.parseTag=Eei,Qae.parseAttr=Aei;var Dei=EY.exports.FilterCSS,N2=op,mQe=Qae,Fei=mQe.parseTag,Lei=mQe.parseAttr,ele=fEe;function tle(t){return t==null}function kei(t){var e=ele.spaceIndex(t);if(e===-1)return{html:"",closing:t[t.length-2]==="/"};t=ele.trim(t.slice(e+1,-1));var i=t[t.length-1]==="/";return i&&(t=ele.trim(t.slice(0,-1))),{html:t,closing:i}}function Nei(t){var e={};for(var i in t)e[i]=t[i];return e}function $ei(t){var e={};for(var i in t)Array.isArray(t[i])?e[i.toLowerCase()]=t[i].map(function(r){return r.toLowerCase()}):e[i.toLowerCase()]=t[i];return e}function gQe(t){t=Nei(t||{}),t.stripIgnoreTag&&(t.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),t.onIgnoreTag=N2.onIgnoreTagStripAll),t.whiteList||t.allowList?t.whiteList=$ei(t.whiteList||t.allowList):t.whiteList=N2.whiteList,t.onTag=t.onTag||N2.onTag,t.onTagAttr=t.onTagAttr||N2.onTagAttr,t.onIgnoreTag=t.onIgnoreTag||N2.onIgnoreTag,t.onIgnoreTagAttr=t.onIgnoreTagAttr||N2.onIgnoreTagAttr,t.safeAttrValue=t.safeAttrValue||N2.safeAttrValue,t.escapeHtml=t.escapeHtml||N2.escapeHtml,this.options=t,t.css===!1?this.cssFilter=!1:(t.css=t.css||{},this.cssFilter=new Dei(t.css))}gQe.prototype.process=function(t){if(t=t||"",t=t.toString(),!t)return"";var e=this,i=e.options,r=i.whiteList,n=i.onTag,s=i.onIgnoreTag,o=i.onTagAttr,a=i.onIgnoreTagAttr,l=i.safeAttrValue,c=i.escapeHtml,d=e.cssFilter;i.stripBlankChar&&(t=N2.stripBlankChar(t)),i.allowCommentTag||(t=N2.stripCommentTag(t));var p=!1;i.stripIgnoreTagBody&&(p=N2.StripTagBody(i.stripIgnoreTagBody,s),s=p.onIgnoreTag);var y=Fei(t,function(v,S,I,O,L){var N={sourcePosition:v,position:S,isClosing:L,isWhite:Object.prototype.hasOwnProperty.call(r,I)},G=n(I,O,N);if(!tle(G))return G;if(N.isWhite){if(N.isClosing)return"";var V=kei(O),Y=r[I],X=Lei(V.html,function(te,re){var fe=ele.indexOf(Y,te)!==-1,ge=o(I,te,re,fe);return tle(ge)?fe?(re=l(I,te,re,d),re?te+'="'+re+'"':te):(ge=a(I,te,re,fe),tle(ge)?void 0:ge):ge});return O="<"+I,X&&(O+=" "+X),V.closing&&(O+=" /"),O+=">",O}else return G=s(I,O,N),tle(G)?c(O):G},c);return p&&(y=p.remove(y)),y};var Bei=gQe;(function(t,e){var i=op,r=Qae,n=Bei;function s(a,l){var c=new n(l);return c.process(a)}e=t.exports=s,e.filterXSS=s,e.FilterXSS=n,function(){for(var a in i)e[a]=i[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=t.exports)})(Z5,Z5.exports);var Gei=function(){function t(e,i){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):Z5.exports.safeAttrValue(s,o,a,l)}},this._entityMap={"&":"8","<":"<",">":">",'"':""","'":"'","/":"/"};var n;e&&!i?n=e:e&&i?(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 Z5.exports.FilterXSS(n)}return t.prototype.sanitize=function(e,i){switch(i===void 0&&(i={}),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,i);default:return i.allowUndefined&&typeof e>"u"?void 0:null}},t.prototype.sanitizeUrl=function(e,i){var r=(i??{}).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?Z5.exports.escapeAttrValue(e):!s&&!n?Z5.exports.escapeAttrValue("https://".concat(e)):""},t.prototype.sanitizeHTMLAttribute=function(e,i,r,n){return typeof this.xssFilterOptions.safeAttrValue=="function"?this.xssFilterOptions.safeAttrValue(e,i,r,n):Z5.exports.safeAttrValue(e,i,r,n)},t.prototype.validate=function(e,i){i===void 0&&(i={});var r=this.sanitize(e,i);return{isValid:e===r,sanitized:r}},t.prototype.encodeHTML=function(e){var i=this;return String(e).replace(/[&<>"'\/]/g,function(r){return i._entityMap[r]})},t.prototype.encodeAttrValue=function(e){var i=/^[a-zA-Z0-9]$/;return String(e).replace(/[\x00-\xFF]/g,function(r,n){return i.test(r)?r:"&#x".concat(Number(e.charCodeAt(n)).toString(16),";")})},t.prototype._extendObjectOfArrays=function(e){var i={};return e.forEach(function(r){Object.keys(r).forEach(function(n){Array.isArray(r[n])&&Array.isArray(i[n])?i[n]=i[n].concat(r[n]):i[n]=r[n]})}),i},t.prototype._iterateOverObject=function(e,i){var r=this;i===void 0&&(i={});try{var n=!1,s=void 0;if(Array.isArray(e))s=e.reduce(function(a,l){var c=r.validate(l,i);return c.isValid?a.concat([l]):(n=!0,a.concat([c.sanitized]))},[]);else if(XQt(e)){var o=Object.keys(e);s=o.reduce(function(a,l){var c=e[l],d=r.validate(c,i);return d.isValid?a[l]=c:(n=!0,a[l]=d.sanitized),a},{})}else return i.allowUndefined&&typeof e>"u"?void 0:null;return n?s:e}catch{return null}},t.prototype._trim=function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},t}();const ile=new Map;function yQe(){ile.clear()}function Vei(t){return ile.get(t)}function Uei(t,e){ile.set(t,e)}function mEe(t){ile.delete(t)}var ek,GB,jei=function(t){if("WebkitTransition"in t.style)ek="webkitTransitionEnd",GB="webkitAnimationEnd";else{if(!("transition"in t.style))throw new Error("Your browser is not supported!");ek="transitionend",GB="animationend"}},vQe=function(t){ek||jei(t)},zei=function(t,e){return e===void 0&&(e=t+"-active"),function(i){vQe(i);var r=!1,n=function(s){r||(r=!0,i.removeEventListener(ek,n),i.removeEventListener(GB,n),i.classList.remove(t),i.classList.remove(e))};i.classList.add(t),i.addEventListener(ek,n),i.addEventListener(GB,n),requestAnimationFrame(function(){i.classList.add(e)})}},Hei=function(t,e){return e===void 0&&(e=t+"-active"),function(i,r){vQe(i);var n=!1,s=function(o){n||(n=!0,i.removeEventListener(ek,s),i.removeEventListener(GB,s),r())};i.classList.add(t),i.addEventListener(ek,s),i.addEventListener(GB,s),requestAnimationFrame(function(){i.classList.add(e)})}};const Wei=Ei.getLogger("esri.widgets.support.widgetUtils");function _Qe(t){const e=Bg.acquire();for(let r=0;r{const t=new Map,e=new ResizeObserver(i=>{yQe();for(const r of i)t.get(r.target)?.(r)});return(i,r,n)=>(t.has(i)&&Wei.error("Already observing element",i),t.set(i,r),e.observe(i,n),KI(()=>{e.unobserve(i),t.delete(i)}))})();function mT(t){const e=t?.closest("[dir]");return e!==null&&e instanceof HTMLElement&&e.dir==="rtl"||document.dir==="rtl"}function bQe(t){const e="data-node-ref";this[t.getAttribute(e)]=null}function VB(t){const e="data-node-ref";this[t.getAttribute(e)]=t}function qei(t,e){return(t==="enter"?zei:Hei)(e)}const Yei=["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"],Xei=Yei.reduce((t,e)=>(t[e]=[],t),{}),Kei=["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"],wQe=new Gei({whiteList:Xei,onTagAttr:(t,e,i)=>{const r=`${e}="${i}"`;if(Kei.includes(e))return r},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0);function Jei(t){return t==="Enter"||t===" "}const xQe="http://www.w3.org/",rle=`${xQe}2000/svg`,SQe=`${xQe}1999/xlink`;let CQe=[],gEe=(t,e)=>{let i={};return Object.keys(t).forEach(r=>{i[r]=t[r]}),e&&Object.keys(e).forEach(r=>{i[r]=e[r]}),i},yEe=(t,e)=>t.vnodeSelector===e.vnodeSelector&&(t.properties&&e.properties?t.properties.key===e.properties.key&&t.properties.bind===e.properties.bind:!t.properties&&!e.properties),TQe=t=>{if(typeof t!="string")throw new Error("Style values must be strings")},Zei=(t,e,i)=>{if(e.vnodeSelector!==""){for(let r=i;r{let n=t[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(t.properties){let e=t.properties.enterAnimation;e&&e(t.domNode,t.properties)}},_Ee=[],bEe=!1,EQe=t=>{(t.children||[]).forEach(EQe),t.properties&&t.properties.afterRemoved&&t.properties.afterRemoved.apply(t.properties.bind||t.properties,[t.domNode])},IQe=()=>{bEe=!1,_Ee.forEach(EQe),_Ee.length=0},AQe=t=>{_Ee.push(t),bEe||(bEe=!0,typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(IQe,{timeout:16}):setTimeout(IQe,16))},PQe=t=>{let e=t.domNode;if(t.properties){let i=t.properties.exitAnimation;if(i)return e.style.pointerEvents="none",void i(e,()=>{e.parentNode&&(e.parentNode.removeChild(e),AQe(t))},t.properties)}e.parentNode&&(e.parentNode.removeChild(e),AQe(t))},eti=(t,e,i)=>{if(!e)return;let r=i.eventHandlerInterceptor,n=Object.keys(e),s=n.length;for(let o=0;o{if(e)for(let r of e)UB(r,t,void 0,i)},RQe=(t,e,i)=>{tti(t,e.children,i),e.text&&(t.textContent=e.text),eti(t,e.properties,i),e.properties&&e.properties.afterCreate&&e.properties.afterCreate.apply(e.properties.bind||e.properties,[t,i,e.vnodeSelector,e.properties,e.children])},UB=(t,e,i,r)=>{let n,s=0,o=t.vnodeSelector,a=e.ownerDocument;if(o==="")n=t.domNode=a.createTextNode(t.text),i!==void 0?e.insertBefore(n,i):e.appendChild(n);else{for(let l=0;l<=o.length;++l){let c=o.charAt(l);if(l===o.length||c==="."||c==="#"){let d=o.charAt(s-1),p=o.slice(s,l);d==="."?n.classList.add(p):d==="#"?n.id=p:(p==="svg"&&(r=gEe(r,{namespace:rle})),r.namespace!==void 0?n=t.domNode=a.createElementNS(r.namespace,p):(n=t.domNode=t.domNode||a.createElement(p),p==="input"&&t.properties&&t.properties.type!==void 0&&n.setAttribute("type",t.properties.type)),i!==void 0?e.insertBefore(n,i):n.parentNode!==e&&e.appendChild(n)),s=l+1}}RQe(n,t,r)}},wEe=(t,e,i)=>{e&&e.split(" ").forEach(r=>{r&&t.classList.toggle(r,i)})},iti=(t,e,i,r)=>{if(!i)return;let n=!1,s=Object.keys(i),o=s.length;for(let a=0;a{if(i===r)return!1;r=r||CQe;let s,o=(i=i||CQe).length,a=r.length,l=0,c=0,d=!1;for(;c=0){for(s=l;sl)for(s=l;s{let r=t.domNode,n=!1;if(t===e)return!1;let s=!1;if(e.vnodeSelector===""){if(e.text!==t.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&&(i=gEe(i,{namespace:rle})),t.text!==e.text&&(s=!0,e.text===void 0?r.removeChild(r.firstChild):r.textContent=e.text),e.domNode=r,s=rti(e,r,t.children,e.children,i)||s,s=iti(r,t.properties,e.properties,i)||s,e.properties&&e.properties.afterUpdate&&e.properties.afterUpdate.apply(e.properties.bind||e.properties,[r,i,e.vnodeSelector,e.properties,e.children]);return s&&e.properties&&e.properties.updateAnimation&&e.properties.updateAnimation(r,e.properties,t.properties),n};let AY=(t,e)=>({getLastRender:()=>t,update:i=>{if(t.vnodeSelector!==i.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=t;t=i,nle(r,i,e)},domNode:t.domNode});const nti={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(t,e,i)=>{e.charAt(0)==="-"?t.style.setProperty(e,i):t.style[e]=i}};let jB=t=>gEe(nti,t),fM={create:(t,e)=>(e=jB(e),UB(t,document.createElement("div"),void 0,e),AY(t,e)),append:(t,e,i)=>(i=jB(i),UB(e,t,void 0,i),AY(e,i)),insertBefore:(t,e,i)=>(i=jB(i),UB(e,t.parentNode,t,i),AY(e,i)),merge:(t,e,i)=>(i=jB(i),e.domNode=t,RQe(t,e,i),AY(e,i)),replace:(t,e,i)=>(i=jB(i),UB(e,t.parentNode,t,i),t.parentNode.removeChild(t),AY(e,i))},MQe,sti=(t,e)=>{let i=[];for(;t&&t!==e;)i.push(t),t=t.parentNode;return i};MQe=Array.prototype.find?(t,e)=>t.find(e):(t,e)=>t.filter(e)[0];let oti=(t,e)=>{let i=t;return e.forEach(r=>{i=i&&i.children?MQe(i.children,n=>n.domNode===r):void 0}),i},ati=(t,e,i)=>{let r=function(n){i("domEvent",n);let s=e(),o=sti(n.currentTarget,s.domNode);o.reverse();let a,l=oti(s.getLastRender(),o);return t.scheduleRender(),l&&(a=l.properties[`on${n.type}`].apply(l.properties.bind||this,arguments)),i("domEventProcessed",n),a};return(n,s,o,a)=>r},xEe=t=>{let e,i,r=jB(t),n=r.performanceLogger,s=!0,o=!1,a=[],l=[],c=(p,y,v)=>{let S,I=()=>S;r.eventHandlerInterceptor=ati(e,I,n),S=p(y,v(),r),a.push(S),l.push(v)},d=()=>{if(i=void 0,s){s=!1,n("renderStart",void 0);for(let p=0;p{i||o||(i=requestAnimationFrame(d))},stop:()=>{i&&(cancelAnimationFrame(i),i=void 0),o=!0},resume:()=>{o=!1,s=!0,e.scheduleRender()},append:(p,y)=>{c(fM.append,p,y)},insertBefore:(p,y)=>{c(fM.insertBefore,p,y)},merge:(p,y)=>{c(fM.merge,p,y)},replace:(p,y)=>{c(fM.replace,p,y)},detach:p=>{for(let y=0;y0}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,i=>{for(const r of i.added){const n=()=>r.render();this._callbacks.set(r,n),this._projector.append(this.surface,n)}for(const r of i.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 i=this._hiddenSurface,r=this._hiddenProjector;let n;const s=()=>(n=e.render(),n);r.append(i,s),r.renderNow();const o={left:0,top:0,right:0,bottom:0};if(n&&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);i.firstChild;)i.removeChild(i.firstChild);return o}overlaps(e,i){const r=this.computeBoundingRect(e),n=this.computeBoundingRect(i);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){if(!this.items.some(r=>r.visible))return;const i=e.getContext("2d");i.save(),i.font=this._fontString(),this.items.forEach(r=>{i.save(),r.renderCanvas(i),i.restore()}),i.restore()}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};E([k({readOnly:!0})],mM.prototype,"surface",void 0),E([k({readOnly:!0})],mM.prototype,"items",void 0),E([k({readOnly:!0})],mM.prototype,"needsRender",null),E([k({readOnly:!0})],mM.prototype,"_watchUpdatingTracking",void 0),E([k({readOnly:!0})],mM.prototype,"updating",null),mM=E([ht("esri.views.overlay.ViewOverlay")],mM);const DQe=mM;function tk(t,e,i,r){let n=null,s=1e3;typeof e=="number"?(s=e,r=i):(n=e??null,s=i);let o,a=0;const l=()=>{a=0,t.apply(r,o)},c=(...d)=>{n&&n.apply(r,d),o=d,s?a||(a=setTimeout(l,s)):l()};return c.remove=()=>{a&&(clearTimeout(a),a=0)},c.forceUpdate=()=>{a&&(clearTimeout(a),l())},c.hasPendingUpdates=()=>!!a,c}const lti="randomUUID"in crypto;function zB(){if(lti)return crypto.randomUUID();const t=crypto.getRandomValues(new Uint16Array(8));t[3]=4095&t[3]|16384,t[4]=16383&t[4]|32768;const e=i=>t[i].toString(16).padStart(4,"0");return e(0)+e(1)+"-"+e(2)+"-"+e(3)+"-"+e(4)+"-"+e(5)+e(6)+e(7)}const uti={handleInterceptedEvent:(t,e,i,r)=>(t.scheduleRender(),e.properties[`on${r.type}`].apply(e.properties.bind||i,[r]))},cti={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(t,e,i)=>{t.style[e]=i}},hti=t=>({...cti,...t}),dti=(t,e)=>{const i=[];for(;t&&t!==e;)i.push(t),t=t.parentNode;return i},pti=(t,e)=>t.find(e),FQe=(t,e,i=!1)=>{let r=t;return e.forEach((n,s)=>{const o=r?.children?pti(r.children,a=>a.domNode===n):void 0;i&&!o&&s!==e.length-1||(r=o)}),r},fti=t=>{let e;const i={...uti,...t},r=hti(i),n=r.performanceLogger;let s,o=!0,a=!1;const l=[],c=[],d=(y,v,S)=>{let I;r.eventHandlerInterceptor=(L,N,G,V)=>function(Y){let X;n("domEvent",Y);const te=dti(Y.currentTarget,I.domNode),re=te.some(ge=>customElements.get(ge?.tagName?.toLowerCase()));if(Y.eventPhase===Event.CAPTURING_PHASE||!re)te.reverse(),X=FQe(I.getLastRender(),te);else{const ge=Y.composedPath(),_e=ge.slice(ge.indexOf(Y.currentTarget),ge.indexOf(I.domNode)).filter(Ie=>Ie.getRootNode()===Ie.ownerDocument).reverse();X=FQe(I.getLastRender(),_e,!0)}let fe;return X&&(fe=i.handleInterceptedEvent(e,X,this,Y)),n("domEventProcessed",Y),fe},i.postProcessProjectionOptions?.(r);const O=S();I=y(v,O,r),l.push(I),c.push(S),i.afterFirstVNodeRendered&&i.afterFirstVNodeRendered(I,O)};let p=()=>{if(s=void 0,o){o=!1,n("renderStart",void 0);for(let y=0;y{s||a||(s=requestAnimationFrame(p))},stop:()=>{s&&(cancelAnimationFrame(s),s=void 0),a=!0},resume:()=>{a=!1,o=!0,e.scheduleRender()},append:(y,v)=>{d(fM.append,y,v)},insertBefore:(y,v)=>{d(fM.insertBefore,y,v)},merge:(y,v)=>{d(fM.merge,y,v)},replace:(y,v)=>{d(fM.replace,y,v)},detach:y=>{for(let v=0;v{const e=new URL(t,Jg.$resourcesUrl$);return e.origin!==MY.location.origin?e.href:e.pathname},mti=t=>Jg.$resourcesUrl$=t,ik=(t,e="")=>()=>{},BQe="http://www.w3.org/1999/xlink",GQe={},gti="http://www.w3.org/2000/svg",yti="http://www.w3.org/1999/xhtml",vti=t=>t!=null,TEe=t=>(t=typeof t,t==="object"||t==="function"),dr=(t,e,...i)=>{let r=null,n=null,s=null,o=!1,a=!1;const l=[],c=p=>{for(let y=0;yp[y]).join(" "))}}if(typeof t=="function")return t(e===null?{}:e,l,bti);const d=ale(t,null);return d.$attrs$=e,l.length>0&&(d.$children$=l),d.$key$=n,d.$name$=s,d},ale=(t,e)=>{const i={$flags$:0,$tag$:t,$text$:e,$elm$:null,$children$:null};return i.$attrs$=null,i.$key$=null,i.$name$=null,i},YA={},_ti=t=>t&&t.$tag$===YA,bti={forEach:(t,e)=>t.map(VQe).forEach(e),map:(t,e)=>t.map(VQe).map(e).map(wti)},VQe=t=>({vattrs:t.$attrs$,vchildren:t.$children$,vkey:t.$key$,vname:t.$name$,vtag:t.$tag$,vtext:t.$text$}),wti=t=>{if(typeof t.vtag=="function"){const i=Object.assign({},t.vattrs);return t.vkey&&(i.key=t.vkey),t.vname&&(i.name=t.vname),dr(t.vtag,i,...t.vchildren||[])}const e=ale(t.vtag,t.vtext);return e.$attrs$=t.vattrs,e.$children$=t.vchildren,e.$key$=t.vkey,e.$name$=t.vname,e},xti=t=>Xti.map(e=>e(t)).find(e=>!!e),Sti=(t,e)=>t!=null&&!TEe(t)?e&4?t==="false"?!1:t===""||!!t:e&2?parseFloat(t):e&1?String(t):t:t,Cti=t=>t,Wh=(t,e,i)=>{const r=Cti(t);return{emit:n=>Tti(r,e,{bubbles:!!(i&4),composed:!!(i&2),cancelable:!!(i&1),detail:n})}},Tti=(t,e,i)=>{const r=Jg.ce(e,i);return t.dispatchEvent(r),r},UQe=new WeakMap,Eti=(t,e,i)=>{let r=cle.get(t);Zti&&i?(r=r||new CSSStyleSheet,typeof r=="string"?r=e:r.replaceSync(e)):r=e,cle.set(t,r)},Iti=(t,e,i,r)=>{let n=jQe(e,i);const s=cle.get(n);if(t=t.nodeType===11?t:gT,s)if(typeof s=="string"){t=t.head||t;let o=UQe.get(t),a;o||UQe.set(t,o=new Set),o.has(n)||(a=gT.createElement("style"),a.innerHTML=s,t.insertBefore(a,t.querySelector("link")),o&&o.add(n))}else t.adoptedStyleSheets.includes(s)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,s]);return n},Ati=t=>{const e=t.$cmpMeta$,i=t.$hostElement$,r=e.$flags$,n=ik("attachStyles",e.$tagName$),s=Iti(i.shadowRoot?i.shadowRoot:i.getRootNode(),e,t.$modeName$);r&10&&(i["s-sc"]=s,i.classList.add(s+"-h"),r&2&&i.classList.add(s+"-s")),n()},jQe=(t,e)=>"sc-"+(e&&t.$flags$&32?t.$tagName$+"-"+e:t.$tagName$),zQe=(t,e,i,r,n,s)=>{if(i!==r){let o=ret(t,e),a=e.toLowerCase();if(e==="class"){const l=t.classList,c=HQe(i),d=HQe(r);l.remove(...c.filter(p=>p&&!d.includes(p))),l.add(...d.filter(p=>p&&!c.includes(p)))}else if(e==="style"){for(const l in i)(!r||r[l]==null)&&(l.includes("-")?t.style.removeProperty(l):t.style[l]="");for(const l in r)(!i||r[l]!==i[l])&&(l.includes("-")?t.style.setProperty(l,r[l]):t.style[l]=r[l])}else if(e!=="key")if(e==="ref")r&&r(t);else if(!t.__lookupSetter__(e)&&e[0]==="o"&&e[1]==="n")e[2]==="-"?e=e.slice(3):ret(MY,a)?e=a.slice(2):e=a[2]+e.slice(3),i&&Jg.rel(t,e,i,!1),r&&Jg.ael(t,e,r,!1);else{const l=TEe(r);if((o||l&&r!==null)&&!n)try{if(t.tagName.includes("-"))t[e]=r;else{const d=r??"";e==="list"?o=!1:(i==null||t[e]!=d)&&(t[e]=d)}}catch{}let c=!1;a!==(a=a.replace(/^xlink\:?/,""))&&(e=a,c=!0),r==null||r===!1?(r!==!1||t.getAttribute(e)==="")&&(c?t.removeAttributeNS(BQe,e):t.removeAttribute(e)):(!o||s&4||n)&&!l&&(r=r===!0?"":r,c?t.setAttributeNS(BQe,e,r):t.setAttribute(e,r))}}},Pti=/\s/,HQe=t=>t?t.split(Pti):[],WQe=(t,e,i,r)=>{const n=e.$elm$.nodeType===11&&e.$elm$.host?e.$elm$.host:e.$elm$,s=t&&t.$attrs$||GQe,o=e.$attrs$||GQe;for(r in s)r in o||zQe(n,r,s[r],void 0,i,e.$flags$);for(r in o)zQe(n,r,s[r],o[r],i,e.$flags$)},lle=(t,e,i,r)=>{const n=e.$children$[i];let s=0,o,a,l;if(kQe||(SEe=!0,n.$tag$==="slot"&&(WB&&r.classList.add(WB+"-s"),n.$flags$|=n.$children$?2:1)),n.$text$!==null)o=n.$elm$=gT.createTextNode(n.$text$);else if(n.$flags$&1)o=n.$elm$=gT.createTextNode("");else{if(q1||(q1=n.$tag$==="svg"),o=n.$elm$=gT.createElementNS(q1?gti:yti,n.$flags$&2?"slot-fb":n.$tag$),q1&&n.$tag$==="foreignObject"&&(q1=!1),WQe(null,n,q1),vti(WB)&&o["s-si"]!==WB&&o.classList.add(o["s-si"]=WB),n.$children$)for(s=0;s{Jg.$flags$|=1;const i=t.childNodes;for(let r=i.length-1;r>=0;r--){const n=i[r];n["s-hn"]!==sle&&n["s-ol"]&&(XQe(n).insertBefore(n,EEe(n)),n["s-ol"].remove(),n["s-ol"]=void 0,SEe=!0),e&&PY(n,e)}Jg.$flags$&=-2},qQe=(t,e,i,r,n,s)=>{let o=t["s-cr"]&&t["s-cr"].parentNode||t,a;for(o.shadowRoot&&o.tagName===sle&&(o=o.shadowRoot);n<=s;++n)r[n]&&(a=lle(null,i,n,t),a&&(r[n].$elm$=a,o.insertBefore(a,EEe(e))))},YQe=(t,e,i,r,n)=>{for(;e<=i;++e)(r=t[e])&&(n=r.$elm$,QQe(r),ole=!0,n["s-ol"]?n["s-ol"].remove():PY(n,!0),n.remove())},Oti=(t,e,i,r)=>{let n=0,s=0,o=0,a=0,l=e.length-1,c=e[0],d=e[l],p=r.length-1,y=r[0],v=r[p],S,I;for(;n<=l&&s<=p;)if(c==null)c=e[++n];else if(d==null)d=e[--l];else if(y==null)y=r[++s];else if(v==null)v=r[--p];else if(ule(c,y))qB(c,y),c=e[++n],y=r[++s];else if(ule(d,v))qB(d,v),d=e[--l],v=r[--p];else if(ule(c,v))(c.$tag$==="slot"||v.$tag$==="slot")&&PY(c.$elm$.parentNode,!1),qB(c,v),t.insertBefore(c.$elm$,d.$elm$.nextSibling),c=e[++n],v=r[--p];else if(ule(d,y))(c.$tag$==="slot"||v.$tag$==="slot")&&PY(d.$elm$.parentNode,!1),qB(d,y),t.insertBefore(d.$elm$,c.$elm$),d=e[--l],y=r[++s];else{for(o=-1,a=n;a<=l;++a)if(e[a]&&e[a].$key$!==null&&e[a].$key$===y.$key$){o=a;break}o>=0?(I=e[o],I.$tag$!==y.$tag$?S=lle(e&&e[s],i,o,t):(qB(I,y),e[o]=void 0,S=I.$elm$),y=r[++s]):(S=lle(e&&e[s],i,s,t),y=r[++s]),S&&XQe(c.$elm$).insertBefore(S,EEe(c.$elm$))}n>l?qQe(t,r[p+1]==null?null:r[p+1].$elm$,i,r,s,p):s>p&&YQe(e,n,l)},ule=(t,e)=>t.$tag$===e.$tag$?t.$tag$==="slot"?t.$name$===e.$name$:t.$key$===e.$key$:!1,EEe=t=>t&&t["s-ol"]||t,XQe=t=>(t["s-ol"]?t["s-ol"]:t).parentNode,qB=(t,e)=>{const i=e.$elm$=t.$elm$,r=t.$children$,n=e.$children$,s=e.$tag$,o=e.$text$;let a;o===null?(q1=s==="svg"?!0:s==="foreignObject"?!1:q1,s==="slot"||WQe(t,e,q1),r!==null&&n!==null?Oti(i,r,e,n):n!==null?(t.$text$!==null&&(i.textContent=""),qQe(i,null,e,n,0,n.length-1)):r!==null&&YQe(r,0,r.length-1),q1&&s==="svg"&&(q1=!1)):(a=i["s-cr"])?a.parentNode.textContent=o:t.$text$!==o&&(i.data=o)},KQe=t=>{const e=t.childNodes;let i,r,n,s,o,a;for(r=0,n=e.length;r{let e,i,r,n,s,o,a=0;const l=t.childNodes,c=l.length;for(;a=0;o--)i=r[o],!i["s-cn"]&&!i["s-nr"]&&i["s-hn"]!==e["s-hn"]&&(ZQe(i,n)?(s=$2.find(d=>d.$nodeToRelocate$===i),ole=!0,i["s-sn"]=i["s-sn"]||n,s?s.$slotRefNode$=e:$2.push({$slotRefNode$:e,$nodeToRelocate$:i}),i["s-sr"]&&$2.map(d=>{ZQe(d.$nodeToRelocate$,i["s-sn"])&&(s=$2.find(p=>p.$nodeToRelocate$===i),s&&!d.$slotRefNode$&&(d.$slotRefNode$=s.$slotRefNode$))})):$2.some(d=>d.$nodeToRelocate$===i)||$2.push({$nodeToRelocate$:i}));e.nodeType===1&&JQe(e)}},ZQe=(t,e)=>t.nodeType===1?t.getAttribute("slot")===null&&e===""||t.getAttribute("slot")===e:t["s-sn"]===e?!0:e==="",QQe=t=>{t.$attrs$&&t.$attrs$.ref&&t.$attrs$.ref(null),t.$children$&&t.$children$.map(QQe)},Rti=(t,e)=>{const i=t.$hostElement$,r=t.$cmpMeta$,n=t.$vnode$||ale(null,null),s=_ti(e)?e:dr(null,null,e);sle=i.tagName,r.$attrsToReflect$&&(s.$attrs$=s.$attrs$||{},r.$attrsToReflect$.map(([o,a])=>s.$attrs$[a]=i[o])),s.$tag$=null,s.$flags$|=4,t.$vnode$=s,s.$elm$=n.$elm$=i.shadowRoot||i,WB=i["s-sc"],LQe=i["s-cr"],kQe=(r.$flags$&1)!==0,ole=!1,qB(n,s);{if(Jg.$flags$|=1,SEe){JQe(s.$elm$);let o,a,l,c,d,p,y=0;for(;y<$2.length;y++)o=$2[y],a=o.$nodeToRelocate$,a["s-ol"]||(l=gT.createTextNode(""),l["s-nr"]=a,a.parentNode.insertBefore(a["s-ol"]=l,a));for(y=0;y<$2.length;y++)if(o=$2[y],a=o.$nodeToRelocate$,o.$slotRefNode$){for(c=o.$slotRefNode$.parentNode,d=o.$slotRefNode$.nextSibling,l=a["s-ol"];l=l.previousSibling;)if(p=l["s-nr"],p&&p["s-sn"]===a["s-sn"]&&c===p.parentNode&&(p=p.nextSibling,!p||!p["s-nr"])){d=p;break}(!d&&c!==a.parentNode||a.nextSibling!==d)&&a!==d&&(!a["s-hn"]&&a["s-ol"]&&(a["s-hn"]=a["s-ol"].parentNode.nodeName),c.insertBefore(a,d))}else a.nodeType===1&&(a.hidden=!0)}ole&&KQe(s.$elm$),Jg.$flags$&=-2,$2.length=0}},Mti=(t,e)=>{},IEe=(t,e)=>(t.$flags$|=16,Mti(t,t.$ancestorComponent$),tii(()=>Dti(t,e))),Dti=(t,e)=>{const i=t.$hostElement$,r=ik("scheduleUpdate",t.$cmpMeta$.$tagName$),n=i;let s;return e?s=YB(n,"componentWillLoad"):s=YB(n,"componentWillUpdate"),s=eet(s,()=>YB(n,"componentWillRender")),r(),eet(s,()=>Fti(t,n,e))},Fti=async(t,e,i)=>{const r=t.$hostElement$,n=ik("update",t.$cmpMeta$.$tagName$);r["s-rc"],i&&Ati(t);const s=ik("render",t.$cmpMeta$.$tagName$);Lti(t,e,r),s(),n(),kti(t)},Lti=(t,e,i)=>{try{NQe=e,e=e.render&&e.render(),t.$flags$&=-17,t.$flags$|=2,(HB.hasRenderFn||HB.reflect)&&(HB.vdomRender||HB.reflect)&&(HB.hydrateServerSide||Rti(t,e))}catch(a){RY(a,t.$hostElement$)}return NQe=null,null},kti=t=>{const e=t.$cmpMeta$.$tagName$,i=t.$hostElement$,r=ik("postUpdate",e),n=i;t.$ancestorComponent$,YB(n,"componentDidRender"),t.$flags$&64?(YB(n,"componentDidUpdate"),r()):(t.$flags$|=64,YB(n,"componentDidLoad"),r())},AEe=t=>{{const e=OY(t),i=e.$hostElement$.isConnected;return i&&(e.$flags$&18)===2&&IEe(e,!1),i}},YB=(t,e,i)=>{if(t&&t[e])try{return t[e](i)}catch(r){RY(r)}},eet=(t,e)=>t&&t.then?t.then(e):e(),Nti=(t,e)=>OY(t).$instanceValues$.get(e),$ti=(t,e,i,r)=>{const n=OY(t),s=t,o=n.$instanceValues$.get(e),a=n.$flags$,l=s;i=Sti(i,r.$members$[e][0]);const c=Number.isNaN(o)&&Number.isNaN(i);if(i!==o&&!c){n.$instanceValues$.set(e,i);{if(r.$watchers$&&a&128){const p=r.$watchers$[e];p&&p.map(y=>{try{l[y](i,o,e)}catch(v){RY(v,s)}})}if((a&18)===2){if(l.componentShouldUpdate&&l.componentShouldUpdate(i,o,e)===!1)return;IEe(n,!1)}}}},Bti=(t,e,i)=>{if(e.$members$){t.watchers&&(e.$watchers$=t.watchers);const r=Object.entries(e.$members$),n=t.prototype;r.map(([s,[o]])=>{(o&31||o&32)&&Object.defineProperty(n,s,{get(){return Nti(this,s)},set(a){$ti(this,s,a,e)},configurable:!0,enumerable:!0})});{const s=new Map;n.attributeChangedCallback=function(o,a,l){Jg.jmp(()=>{const c=s.get(o);if(this.hasOwnProperty(c))l=this[c],delete this[c];else if(n.hasOwnProperty(c)&&typeof this[c]=="number"&&this[c]==l)return;this[c]=l===null&&typeof this[c]=="boolean"?!1:l})},t.observedAttributes=r.filter(([o,a])=>a[0]&15).map(([o,a])=>{const l=a[1]||o;return s.set(l,o),a[0]&512&&e.$attrsToReflect$.push([o,l]),l})}}return t},Gti=async(t,e,i,r,n)=>{if(!(e.$flags$&32)&&(n=t.constructor,e.$flags$|=32,customElements.whenDefined(i.$tagName$).then(()=>e.$flags$|=128),n.style)){let o=n.style;typeof o!="string"&&(o=o[e.$modeName$=xti(t)]);const a=jQe(i,e.$modeName$);if(!cle.has(a)){const l=ik("registerStyles",i.$tagName$);Eti(a,o,!!(i.$flags$&1)),l()}}e.$ancestorComponent$,(()=>IEe(e,!0))()},Vti=t=>{},Uti=t=>{if(!(Jg.$flags$&1)){const e=OY(t),i=e.$cmpMeta$,r=ik("connectedCallback",i.$tagName$);e.$flags$&1?(tet(t,e,i.$listeners$),Vti(e.$lazyInstance$)):(e.$flags$|=1,i.$flags$&12&&jti(t),i.$members$&&Object.entries(i.$members$).map(([n,[s]])=>{if(s&31&&t.hasOwnProperty(n)){const o=t[n];delete t[n],t[n]=o}}),Gti(t,e,i)),r()}},jti=t=>{const e=t["s-cr"]=gT.createComment("");e["s-cn"]=!0,t.insertBefore(e,t.firstChild)},zti=t=>{if(!(Jg.$flags$&1)){const e=OY(t);e.$rmListeners$&&(e.$rmListeners$.map(i=>i()),e.$rmListeners$=void 0)}},h0=(t,e)=>{const i={$flags$:e[0],$tagName$:e[1]};i.$members$=e[2],i.$listeners$=e[3],i.$watchers$=t.$watchers$,i.$attrsToReflect$=[],!net&&i.$flags$&1&&(i.$flags$|=8);const r=t.prototype.connectedCallback,n=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__registerHost(){Yti(this,i)},connectedCallback(){Uti(this),r&&r.call(this)},disconnectedCallback(){zti(this),n&&n.call(this)},__attachShadow(){net?this.attachShadow({mode:"open",delegatesFocus:!!(i.$flags$&16)}):this.shadowRoot=this}}),t.is=i.$tagName$,Bti(t,i)},PEe=(t,e)=>e,tet=(t,e,i,r)=>{i&&i.map(([n,s,o])=>{const a=Wti(t,n),l=Hti(e,o),c=qti(n);Jg.ael(a,s,l,c),(e.$rmListeners$=e.$rmListeners$||[]).push(()=>Jg.rel(a,s,l,c))})},Hti=(t,e)=>i=>{try{HB.lazyLoad||t.$hostElement$[e](i)}catch(r){RY(r)}},Wti=(t,e)=>e&4?gT:e&8?MY:e&16?gT.body:t,qti=t=>Kti?{passive:(t&1)!==0,capture:(t&2)!==0}:(t&2)!==0,iet=new WeakMap,OY=t=>iet.get(t),Yti=(t,e)=>{const i={$flags$:0,$hostElement$:t,$cmpMeta$:e,$instanceValues$:new Map};return tet(t,i,e.$listeners$),iet.set(t,i)},ret=(t,e)=>e in t,RY=(t,e)=>(0,console.error)(t,e),cle=new Map,Xti=[],MY=typeof window<"u"?window:{},gT=MY.document||{head:{}},d0=MY.HTMLElement||class{},Jg={$flags$:0,$resourcesUrl$:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,i,r)=>t.addEventListener(e,i,r),rel:(t,e,i,r)=>t.removeEventListener(e,i,r),ce:(t,e)=>new CustomEvent(t,e)},net=!0,Kti=(()=>{let t=!1;try{gT.addEventListener("e",null,Object.defineProperty({},"passive",{get(){t=!0}}))}catch{}return t})(),Jti=t=>Promise.resolve(t),Zti=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replaceSync=="function"}catch{}return!1})(),set=[],oet=[],Qti=(t,e)=>i=>{t.push(i),CEe||(CEe=!0,e&&Jg.$flags$&4?eii(OEe):Jg.raf(OEe))},aet=t=>{for(let e=0;e{aet(set),aet(oet),(CEe=set.length>0)&&Jg.raf(OEe)},eii=t=>Jti().then(t),tii=Qti(oet,!0);/*! + */var vei=function(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},tN={exports:{}},pp={},EY={exports:{}},iN={};function rQe(){var t={};return t["align-content"]=!1,t["align-items"]=!1,t["align-self"]=!1,t["alignment-adjust"]=!1,t["alignment-baseline"]=!1,t.all=!1,t["anchor-point"]=!1,t.animation=!1,t["animation-delay"]=!1,t["animation-direction"]=!1,t["animation-duration"]=!1,t["animation-fill-mode"]=!1,t["animation-iteration-count"]=!1,t["animation-name"]=!1,t["animation-play-state"]=!1,t["animation-timing-function"]=!1,t.azimuth=!1,t["backface-visibility"]=!1,t.background=!0,t["background-attachment"]=!0,t["background-clip"]=!0,t["background-color"]=!0,t["background-image"]=!0,t["background-origin"]=!0,t["background-position"]=!0,t["background-repeat"]=!0,t["background-size"]=!0,t["baseline-shift"]=!1,t.binding=!1,t.bleed=!1,t["bookmark-label"]=!1,t["bookmark-level"]=!1,t["bookmark-state"]=!1,t.border=!0,t["border-bottom"]=!0,t["border-bottom-color"]=!0,t["border-bottom-left-radius"]=!0,t["border-bottom-right-radius"]=!0,t["border-bottom-style"]=!0,t["border-bottom-width"]=!0,t["border-collapse"]=!0,t["border-color"]=!0,t["border-image"]=!0,t["border-image-outset"]=!0,t["border-image-repeat"]=!0,t["border-image-slice"]=!0,t["border-image-source"]=!0,t["border-image-width"]=!0,t["border-left"]=!0,t["border-left-color"]=!0,t["border-left-style"]=!0,t["border-left-width"]=!0,t["border-radius"]=!0,t["border-right"]=!0,t["border-right-color"]=!0,t["border-right-style"]=!0,t["border-right-width"]=!0,t["border-spacing"]=!0,t["border-style"]=!0,t["border-top"]=!0,t["border-top-color"]=!0,t["border-top-left-radius"]=!0,t["border-top-right-radius"]=!0,t["border-top-style"]=!0,t["border-top-width"]=!0,t["border-width"]=!0,t.bottom=!1,t["box-decoration-break"]=!0,t["box-shadow"]=!0,t["box-sizing"]=!0,t["box-snap"]=!0,t["box-suppress"]=!0,t["break-after"]=!0,t["break-before"]=!0,t["break-inside"]=!0,t["caption-side"]=!1,t.chains=!1,t.clear=!0,t.clip=!1,t["clip-path"]=!1,t["clip-rule"]=!1,t.color=!0,t["color-interpolation-filters"]=!0,t["column-count"]=!1,t["column-fill"]=!1,t["column-gap"]=!1,t["column-rule"]=!1,t["column-rule-color"]=!1,t["column-rule-style"]=!1,t["column-rule-width"]=!1,t["column-span"]=!1,t["column-width"]=!1,t.columns=!1,t.contain=!1,t.content=!1,t["counter-increment"]=!1,t["counter-reset"]=!1,t["counter-set"]=!1,t.crop=!1,t.cue=!1,t["cue-after"]=!1,t["cue-before"]=!1,t.cursor=!1,t.direction=!1,t.display=!0,t["display-inside"]=!0,t["display-list"]=!0,t["display-outside"]=!0,t["dominant-baseline"]=!1,t.elevation=!1,t["empty-cells"]=!1,t.filter=!1,t.flex=!1,t["flex-basis"]=!1,t["flex-direction"]=!1,t["flex-flow"]=!1,t["flex-grow"]=!1,t["flex-shrink"]=!1,t["flex-wrap"]=!1,t.float=!1,t["float-offset"]=!1,t["flood-color"]=!1,t["flood-opacity"]=!1,t["flow-from"]=!1,t["flow-into"]=!1,t.font=!0,t["font-family"]=!0,t["font-feature-settings"]=!0,t["font-kerning"]=!0,t["font-language-override"]=!0,t["font-size"]=!0,t["font-size-adjust"]=!0,t["font-stretch"]=!0,t["font-style"]=!0,t["font-synthesis"]=!0,t["font-variant"]=!0,t["font-variant-alternates"]=!0,t["font-variant-caps"]=!0,t["font-variant-east-asian"]=!0,t["font-variant-ligatures"]=!0,t["font-variant-numeric"]=!0,t["font-variant-position"]=!0,t["font-weight"]=!0,t.grid=!1,t["grid-area"]=!1,t["grid-auto-columns"]=!1,t["grid-auto-flow"]=!1,t["grid-auto-rows"]=!1,t["grid-column"]=!1,t["grid-column-end"]=!1,t["grid-column-start"]=!1,t["grid-row"]=!1,t["grid-row-end"]=!1,t["grid-row-start"]=!1,t["grid-template"]=!1,t["grid-template-areas"]=!1,t["grid-template-columns"]=!1,t["grid-template-rows"]=!1,t["hanging-punctuation"]=!1,t.height=!0,t.hyphens=!1,t.icon=!1,t["image-orientation"]=!1,t["image-resolution"]=!1,t["ime-mode"]=!1,t["initial-letters"]=!1,t["inline-box-align"]=!1,t["justify-content"]=!1,t["justify-items"]=!1,t["justify-self"]=!1,t.left=!1,t["letter-spacing"]=!0,t["lighting-color"]=!0,t["line-box-contain"]=!1,t["line-break"]=!1,t["line-grid"]=!1,t["line-height"]=!1,t["line-snap"]=!1,t["line-stacking"]=!1,t["line-stacking-ruby"]=!1,t["line-stacking-shift"]=!1,t["line-stacking-strategy"]=!1,t["list-style"]=!0,t["list-style-image"]=!0,t["list-style-position"]=!0,t["list-style-type"]=!0,t.margin=!0,t["margin-bottom"]=!0,t["margin-left"]=!0,t["margin-right"]=!0,t["margin-top"]=!0,t["marker-offset"]=!1,t["marker-side"]=!1,t.marks=!1,t.mask=!1,t["mask-box"]=!1,t["mask-box-outset"]=!1,t["mask-box-repeat"]=!1,t["mask-box-slice"]=!1,t["mask-box-source"]=!1,t["mask-box-width"]=!1,t["mask-clip"]=!1,t["mask-image"]=!1,t["mask-origin"]=!1,t["mask-position"]=!1,t["mask-repeat"]=!1,t["mask-size"]=!1,t["mask-source-type"]=!1,t["mask-type"]=!1,t["max-height"]=!0,t["max-lines"]=!1,t["max-width"]=!0,t["min-height"]=!0,t["min-width"]=!0,t["move-to"]=!1,t["nav-down"]=!1,t["nav-index"]=!1,t["nav-left"]=!1,t["nav-right"]=!1,t["nav-up"]=!1,t["object-fit"]=!1,t["object-position"]=!1,t.opacity=!1,t.order=!1,t.orphans=!1,t.outline=!1,t["outline-color"]=!1,t["outline-offset"]=!1,t["outline-style"]=!1,t["outline-width"]=!1,t.overflow=!1,t["overflow-wrap"]=!1,t["overflow-x"]=!1,t["overflow-y"]=!1,t.padding=!0,t["padding-bottom"]=!0,t["padding-left"]=!0,t["padding-right"]=!0,t["padding-top"]=!0,t.page=!1,t["page-break-after"]=!1,t["page-break-before"]=!1,t["page-break-inside"]=!1,t["page-policy"]=!1,t.pause=!1,t["pause-after"]=!1,t["pause-before"]=!1,t.perspective=!1,t["perspective-origin"]=!1,t.pitch=!1,t["pitch-range"]=!1,t["play-during"]=!1,t.position=!1,t["presentation-level"]=!1,t.quotes=!1,t["region-fragment"]=!1,t.resize=!1,t.rest=!1,t["rest-after"]=!1,t["rest-before"]=!1,t.richness=!1,t.right=!1,t.rotation=!1,t["rotation-point"]=!1,t["ruby-align"]=!1,t["ruby-merge"]=!1,t["ruby-position"]=!1,t["shape-image-threshold"]=!1,t["shape-outside"]=!1,t["shape-margin"]=!1,t.size=!1,t.speak=!1,t["speak-as"]=!1,t["speak-header"]=!1,t["speak-numeral"]=!1,t["speak-punctuation"]=!1,t["speech-rate"]=!1,t.stress=!1,t["string-set"]=!1,t["tab-size"]=!1,t["table-layout"]=!1,t["text-align"]=!0,t["text-align-last"]=!0,t["text-combine-upright"]=!0,t["text-decoration"]=!0,t["text-decoration-color"]=!0,t["text-decoration-line"]=!0,t["text-decoration-skip"]=!0,t["text-decoration-style"]=!0,t["text-emphasis"]=!0,t["text-emphasis-color"]=!0,t["text-emphasis-position"]=!0,t["text-emphasis-style"]=!0,t["text-height"]=!0,t["text-indent"]=!0,t["text-justify"]=!0,t["text-orientation"]=!0,t["text-overflow"]=!0,t["text-shadow"]=!0,t["text-space-collapse"]=!0,t["text-transform"]=!0,t["text-underline-position"]=!0,t["text-wrap"]=!0,t.top=!1,t.transform=!1,t["transform-origin"]=!1,t["transform-style"]=!1,t.transition=!1,t["transition-delay"]=!1,t["transition-duration"]=!1,t["transition-property"]=!1,t["transition-timing-function"]=!1,t["unicode-bidi"]=!1,t["vertical-align"]=!1,t.visibility=!1,t["voice-balance"]=!1,t["voice-duration"]=!1,t["voice-family"]=!1,t["voice-pitch"]=!1,t["voice-range"]=!1,t["voice-rate"]=!1,t["voice-stress"]=!1,t["voice-volume"]=!1,t.volume=!1,t["white-space"]=!1,t.widows=!1,t.width=!0,t["will-change"]=!1,t["word-break"]=!0,t["word-spacing"]=!0,t["word-wrap"]=!0,t["wrap-flow"]=!1,t["wrap-through"]=!1,t["writing-mode"]=!1,t["z-index"]=!1,t}function _ei(t,e,i){}function bei(t,e,i){}var wei=/javascript\s*\:/img;function xei(t,e){return wei.test(e)?"":e}iN.whiteList=rQe(),iN.getDefaultWhiteList=rQe,iN.onAttr=_ei,iN.onIgnoreAttr=bei,iN.safeAttrValue=xei;var Sei={indexOf:function(t,e){var i,r;if(Array.prototype.indexOf)return t.indexOf(e);for(i=0,r=t.length;i/g,$ei=/"/g,Bei=/"/g,Vei=/&#([a-zA-Z0-9]*);?/gim,jei=/:?/gim,Gei=/&newline;?/gim,Xae=/((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,uQe=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,cQe=/u\s*r\s*l\s*\(.*/gi;function hQe(t){return t.replace($ei,""")}function dQe(t){return t.replace(Bei,'"')}function pQe(t){return t.replace(Vei,function(i,r){return r[0]==="x"||r[0]==="X"?String.fromCharCode(parseInt(r.substr(1),16)):String.fromCharCode(parseInt(r,10))})}function fQe(t){return t.replace(jei,":").replace(Gei," ")}function mQe(t){for(var e="",i=0,r=t.length;i",r);if(n===-1)break;i=n+3}return e}function Wei(t){var e=t.split("");return e=e.filter(function(i){var r=i.charCodeAt(0);return r===127?!1:r<=31?r===10||r===13:!0}),e.join("")}pp.whiteList=oQe(),pp.getDefaultWhiteList=oQe,pp.onTag=Rei,pp.onIgnoreTag=Mei,pp.onTagAttr=Dei,pp.onIgnoreTagAttr=Fei,pp.safeAttrValue=Lei,pp.escapeHtml=lQe,pp.escapeQuote=hQe,pp.unescapeQuote=dQe,pp.escapeHtmlEntities=pQe,pp.escapeDangerHtml5Entities=fQe,pp.clearNonPrintableCharacter=mQe,pp.friendlyAttrValue=gQe,pp.escapeAttrValue=yQe,pp.onIgnoreTagStripAll=Uei,pp.StripTagBody=zei,pp.stripCommentTag=Hei,pp.stripBlankChar=Wei,pp.cssFilter=aQe,pp.getDefaultCSSWhiteList=Oei;var Kae={},pM=vEe;function qei(t){var e=pM.spaceIndex(t),i;return e===-1?i=t.slice(1,-1):i=t.slice(1,e+1),i=pM.trim(i).toLowerCase(),i.slice(0,1)==="/"&&(i=i.slice(1)),i.slice(-1)==="/"&&(i=i.slice(0,-1)),i}function Yei(t){return t.slice(0,2)===""){r+=i(t.slice(n,s)),h=t.slice(s,a+1),c=qei(h),r+=e(s,r.length,c,h,Yei(h)),n=a+1,s=!1;continue}if(p==='"'||p==="'")for(var y=1,v=t.charAt(a-y);v.trim()===""||v==="=";){if(v==="="){o=p;continue e}v=t.charAt(a-++y)}}else if(p===o){o=!1;continue}}return n0;e--){var i=t[e];if(i!==" ")return i==="="?e:-1}}function tti(t){return t[0]==='"'&&t[t.length-1]==='"'||t[0]==="'"&&t[t.length-1]==="'"}function vQe(t){return tti(t)?t.substr(1,t.length-2):t}Kae.parseTag=Xei,Kae.parseAttr=Jei;var iti=EY.exports.FilterCSS,N2=pp,_Qe=Kae,rti=_Qe.parseTag,nti=_Qe.parseAttr,Jae=vEe;function Zae(t){return t==null}function sti(t){var e=Jae.spaceIndex(t);if(e===-1)return{html:"",closing:t[t.length-2]==="/"};t=Jae.trim(t.slice(e+1,-1));var i=t[t.length-1]==="/";return i&&(t=Jae.trim(t.slice(0,-1))),{html:t,closing:i}}function oti(t){var e={};for(var i in t)e[i]=t[i];return e}function ati(t){var e={};for(var i in t)Array.isArray(t[i])?e[i.toLowerCase()]=t[i].map(function(r){return r.toLowerCase()}):e[i.toLowerCase()]=t[i];return e}function bQe(t){t=oti(t||{}),t.stripIgnoreTag&&(t.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),t.onIgnoreTag=N2.onIgnoreTagStripAll),t.whiteList||t.allowList?t.whiteList=ati(t.whiteList||t.allowList):t.whiteList=N2.whiteList,t.onTag=t.onTag||N2.onTag,t.onTagAttr=t.onTagAttr||N2.onTagAttr,t.onIgnoreTag=t.onIgnoreTag||N2.onIgnoreTag,t.onIgnoreTagAttr=t.onIgnoreTagAttr||N2.onIgnoreTagAttr,t.safeAttrValue=t.safeAttrValue||N2.safeAttrValue,t.escapeHtml=t.escapeHtml||N2.escapeHtml,this.options=t,t.css===!1?this.cssFilter=!1:(t.css=t.css||{},this.cssFilter=new iti(t.css))}bQe.prototype.process=function(t){if(t=t||"",t=t.toString(),!t)return"";var e=this,i=e.options,r=i.whiteList,n=i.onTag,s=i.onIgnoreTag,o=i.onTagAttr,a=i.onIgnoreTagAttr,l=i.safeAttrValue,c=i.escapeHtml,h=e.cssFilter;i.stripBlankChar&&(t=N2.stripBlankChar(t)),i.allowCommentTag||(t=N2.stripCommentTag(t));var p=!1;i.stripIgnoreTagBody&&(p=N2.StripTagBody(i.stripIgnoreTagBody,s),s=p.onIgnoreTag);var y=rti(t,function(v,x,I,P,F){var k={sourcePosition:v,position:x,isClosing:F,isWhite:Object.prototype.hasOwnProperty.call(r,I)},j=n(I,P,k);if(!Zae(j))return j;if(k.isWhite){if(k.isClosing)return"";var V=sti(P),Y=r[I],X=nti(V.html,function(Z,ie){var ce=Jae.indexOf(Y,Z)!==-1,he=o(I,Z,ie,ce);return Zae(he)?ce?(ie=l(I,Z,ie,h),ie?Z+'="'+ie+'"':Z):(he=a(I,Z,ie,ce),Zae(he)?void 0:he):he});return P="<"+I,X&&(P+=" "+X),V.closing&&(P+=" /"),P+=">",P}else return j=s(I,P,k),Zae(j)?c(P):j},c);return p&&(y=p.remove(y)),y};var lti=bQe;(function(t,e){var i=pp,r=Kae,n=lti;function s(a,l){var c=new n(l);return c.process(a)}e=t.exports=s,e.filterXSS=s,e.FilterXSS=n,function(){for(var a in i)e[a]=i[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=t.exports)})(tN,tN.exports);var uti=function(){function t(e,i){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):tN.exports.safeAttrValue(s,o,a,l)}},this._entityMap={"&":"8","<":"<",">":">",'"':""","'":"'","/":"/"};var n;e&&!i?n=e:e&&i?(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 tN.exports.FilterXSS(n)}return t.prototype.sanitize=function(e,i){switch(i===void 0&&(i={}),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,i);default:return i.allowUndefined&&typeof e>"u"?void 0:null}},t.prototype.sanitizeUrl=function(e,i){var r=(i??{}).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?tN.exports.escapeAttrValue(e):!s&&!n?tN.exports.escapeAttrValue("https://".concat(e)):""},t.prototype.sanitizeHTMLAttribute=function(e,i,r,n){return typeof this.xssFilterOptions.safeAttrValue=="function"?this.xssFilterOptions.safeAttrValue(e,i,r,n):tN.exports.safeAttrValue(e,i,r,n)},t.prototype.validate=function(e,i){i===void 0&&(i={});var r=this.sanitize(e,i);return{isValid:e===r,sanitized:r}},t.prototype.encodeHTML=function(e){var i=this;return String(e).replace(/[&<>"'\/]/g,function(r){return i._entityMap[r]})},t.prototype.encodeAttrValue=function(e){var i=/^[a-zA-Z0-9]$/;return String(e).replace(/[\x00-\xFF]/g,function(r,n){return i.test(r)?r:"&#x".concat(Number(e.charCodeAt(n)).toString(16),";")})},t.prototype._extendObjectOfArrays=function(e){var i={};return e.forEach(function(r){Object.keys(r).forEach(function(n){Array.isArray(r[n])&&Array.isArray(i[n])?i[n]=i[n].concat(r[n]):i[n]=r[n]})}),i},t.prototype._iterateOverObject=function(e,i){var r=this;i===void 0&&(i={});try{var n=!1,s=void 0;if(Array.isArray(e))s=e.reduce(function(a,l){var c=r.validate(l,i);return c.isValid?a.concat([l]):(n=!0,a.concat([c.sanitized]))},[]);else if(vei(e)){var o=Object.keys(e);s=o.reduce(function(a,l){var c=e[l],h=r.validate(c,i);return h.isValid?a[l]=c:(n=!0,a[l]=h.sanitized),a},{})}else return i.allowUndefined&&typeof e>"u"?void 0:null;return n?s:e}catch{return null}},t.prototype._trim=function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},t}();const Qae=new Map;function wQe(){Qae.clear()}function cti(t){return Qae.get(t)}function hti(t,e){Qae.set(t,e)}function _Ee(t){Qae.delete(t)}var rN,$B,dti=function(t){if("WebkitTransition"in t.style)rN="webkitTransitionEnd",$B="webkitAnimationEnd";else{if(!("transition"in t.style))throw new Error("Your browser is not supported!");rN="transitionend",$B="animationend"}},xQe=function(t){rN||dti(t)},pti=function(t,e){return e===void 0&&(e=t+"-active"),function(i){xQe(i);var r=!1,n=function(s){r||(r=!0,i.removeEventListener(rN,n),i.removeEventListener($B,n),i.classList.remove(t),i.classList.remove(e))};i.classList.add(t),i.addEventListener(rN,n),i.addEventListener($B,n),requestAnimationFrame(function(){i.classList.add(e)})}},fti=function(t,e){return e===void 0&&(e=t+"-active"),function(i,r){xQe(i);var n=!1,s=function(o){n||(n=!0,i.removeEventListener(rN,s),i.removeEventListener($B,s),r())};i.classList.add(t),i.addEventListener(rN,s),i.addEventListener($B,s),requestAnimationFrame(function(){i.classList.add(e)})}};const mti=Oi.getLogger("esri.widgets.support.widgetUtils");function SQe(t){const e=Gg.acquire();for(let r=0;r{const t=new Map,e=new ResizeObserver(i=>{wQe();for(const r of i)t.get(r.target)?.(r)});return(i,r,n)=>(t.has(i)&&mti.error("Already observing element",i),t.set(i,r),e.observe(i,n),XI(()=>{e.unobserve(i),t.delete(i)}))})();function pT(t){const e=t?.closest("[dir]");return e!==null&&e instanceof HTMLElement&&e.dir==="rtl"||document.dir==="rtl"}function CQe(t){const e="data-node-ref";this[t.getAttribute(e)]=null}function BB(t){const e="data-node-ref";this[t.getAttribute(e)]=t}function gti(t,e){return(t==="enter"?pti:fti)(e)}const yti=["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"],vti=yti.reduce((t,e)=>(t[e]=[],t),{}),_ti=["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"],TQe=new uti({whiteList:vti,onTagAttr:(t,e,i)=>{const r=`${e}="${i}"`;if(_ti.includes(e))return r},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0);function bti(t){return t==="Enter"||t===" "}const EQe="http://www.w3.org/",ele=`${EQe}2000/svg`,IQe=`${EQe}1999/xlink`;let AQe=[],bEe=(t,e)=>{let i={};return Object.keys(t).forEach(r=>{i[r]=t[r]}),e&&Object.keys(e).forEach(r=>{i[r]=e[r]}),i},wEe=(t,e)=>t.vnodeSelector===e.vnodeSelector&&(t.properties&&e.properties?t.properties.key===e.properties.key&&t.properties.bind===e.properties.bind:!t.properties&&!e.properties),PQe=t=>{if(typeof t!="string")throw new Error("Style values must be strings")},wti=(t,e,i)=>{if(e.vnodeSelector!==""){for(let r=i;r{let n=t[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(t.properties){let e=t.properties.enterAnimation;e&&e(t.domNode,t.properties)}},SEe=[],CEe=!1,OQe=t=>{(t.children||[]).forEach(OQe),t.properties&&t.properties.afterRemoved&&t.properties.afterRemoved.apply(t.properties.bind||t.properties,[t.domNode])},RQe=()=>{CEe=!1,SEe.forEach(OQe),SEe.length=0},MQe=t=>{SEe.push(t),CEe||(CEe=!0,typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(RQe,{timeout:16}):setTimeout(RQe,16))},DQe=t=>{let e=t.domNode;if(t.properties){let i=t.properties.exitAnimation;if(i)return e.style.pointerEvents="none",void i(e,()=>{e.parentNode&&(e.parentNode.removeChild(e),MQe(t))},t.properties)}e.parentNode&&(e.parentNode.removeChild(e),MQe(t))},Sti=(t,e,i)=>{if(!e)return;let r=i.eventHandlerInterceptor,n=Object.keys(e),s=n.length;for(let o=0;o{if(e)for(let r of e)VB(r,t,void 0,i)},LQe=(t,e,i)=>{Cti(t,e.children,i),e.text&&(t.textContent=e.text),Sti(t,e.properties,i),e.properties&&e.properties.afterCreate&&e.properties.afterCreate.apply(e.properties.bind||e.properties,[t,i,e.vnodeSelector,e.properties,e.children])},VB=(t,e,i,r)=>{let n,s=0,o=t.vnodeSelector,a=e.ownerDocument;if(o==="")n=t.domNode=a.createTextNode(t.text),i!==void 0?e.insertBefore(n,i):e.appendChild(n);else{for(let l=0;l<=o.length;++l){let c=o.charAt(l);if(l===o.length||c==="."||c==="#"){let h=o.charAt(s-1),p=o.slice(s,l);h==="."?n.classList.add(p):h==="#"?n.id=p:(p==="svg"&&(r=bEe(r,{namespace:ele})),r.namespace!==void 0?n=t.domNode=a.createElementNS(r.namespace,p):(n=t.domNode=t.domNode||a.createElement(p),p==="input"&&t.properties&&t.properties.type!==void 0&&n.setAttribute("type",t.properties.type)),i!==void 0?e.insertBefore(n,i):n.parentNode!==e&&e.appendChild(n)),s=l+1}}LQe(n,t,r)}},TEe=(t,e,i)=>{e&&e.split(" ").forEach(r=>{r&&t.classList.toggle(r,i)})},Tti=(t,e,i,r)=>{if(!i)return;let n=!1,s=Object.keys(i),o=s.length;for(let a=0;a{if(i===r)return!1;r=r||AQe;let s,o=(i=i||AQe).length,a=r.length,l=0,c=0,h=!1;for(;c=0){for(s=l;sl)for(s=l;s{let r=t.domNode,n=!1;if(t===e)return!1;let s=!1;if(e.vnodeSelector===""){if(e.text!==t.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&&(i=bEe(i,{namespace:ele})),t.text!==e.text&&(s=!0,e.text===void 0?r.removeChild(r.firstChild):r.textContent=e.text),e.domNode=r,s=Eti(e,r,t.children,e.children,i)||s,s=Tti(r,t.properties,e.properties,i)||s,e.properties&&e.properties.afterUpdate&&e.properties.afterUpdate.apply(e.properties.bind||e.properties,[r,i,e.vnodeSelector,e.properties,e.children]);return s&&e.properties&&e.properties.updateAnimation&&e.properties.updateAnimation(r,e.properties,t.properties),n};let AY=(t,e)=>({getLastRender:()=>t,update:i=>{if(t.vnodeSelector!==i.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=t;t=i,tle(r,i,e)},domNode:t.domNode});const Iti={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(t,e,i)=>{e.charAt(0)==="-"?t.style.setProperty(e,i):t.style[e]=i}};let jB=t=>bEe(Iti,t),fM={create:(t,e)=>(e=jB(e),VB(t,document.createElement("div"),void 0,e),AY(t,e)),append:(t,e,i)=>(i=jB(i),VB(e,t,void 0,i),AY(e,i)),insertBefore:(t,e,i)=>(i=jB(i),VB(e,t.parentNode,t,i),AY(e,i)),merge:(t,e,i)=>(i=jB(i),e.domNode=t,LQe(t,e,i),AY(e,i)),replace:(t,e,i)=>(i=jB(i),VB(e,t.parentNode,t,i),t.parentNode.removeChild(t),AY(e,i))},NQe,Ati=(t,e)=>{let i=[];for(;t&&t!==e;)i.push(t),t=t.parentNode;return i};NQe=Array.prototype.find?(t,e)=>t.find(e):(t,e)=>t.filter(e)[0];let Pti=(t,e)=>{let i=t;return e.forEach(r=>{i=i&&i.children?NQe(i.children,n=>n.domNode===r):void 0}),i},Oti=(t,e,i)=>{let r=function(n){i("domEvent",n);let s=e(),o=Ati(n.currentTarget,s.domNode);o.reverse();let a,l=Pti(s.getLastRender(),o);return t.scheduleRender(),l&&(a=l.properties[`on${n.type}`].apply(l.properties.bind||this,arguments)),i("domEventProcessed",n),a};return(n,s,o,a)=>r},EEe=t=>{let e,i,r=jB(t),n=r.performanceLogger,s=!0,o=!1,a=[],l=[],c=(p,y,v)=>{let x,I=()=>x;r.eventHandlerInterceptor=Oti(e,I,n),x=p(y,v(),r),a.push(x),l.push(v)},h=()=>{if(i=void 0,s){s=!1,n("renderStart",void 0);for(let p=0;p{i||o||(i=requestAnimationFrame(h))},stop:()=>{i&&(cancelAnimationFrame(i),i=void 0),o=!0},resume:()=>{o=!1,s=!0,e.scheduleRender()},append:(p,y)=>{c(fM.append,p,y)},insertBefore:(p,y)=>{c(fM.insertBefore,p,y)},merge:(p,y)=>{c(fM.merge,p,y)},replace:(p,y)=>{c(fM.replace,p,y)},detach:p=>{for(let y=0;y0}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,i=>{for(const r of i.added){const n=()=>r.render();this._callbacks.set(r,n),this._projector.append(this.surface,n)}for(const r of i.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 i=this._hiddenSurface,r=this._hiddenProjector;let n;const s=()=>(n=e.render(),n);r.append(i,s),r.renderNow();const o={left:0,top:0,right:0,bottom:0};if(n&&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);i.firstChild;)i.removeChild(i.firstChild);return o}overlaps(e,i){const r=this.computeBoundingRect(e),n=this.computeBoundingRect(i);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){if(!this.items.some(r=>r.visible))return;const i=e.getContext("2d");i.save(),i.font=this._fontString(),this.items.forEach(r=>{i.save(),r.renderCanvas(i),i.restore()}),i.restore()}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};E([N({readOnly:!0})],mM.prototype,"surface",void 0),E([N({readOnly:!0})],mM.prototype,"items",void 0),E([N({readOnly:!0})],mM.prototype,"needsRender",null),E([N({readOnly:!0})],mM.prototype,"_watchUpdatingTracking",void 0),E([N({readOnly:!0})],mM.prototype,"updating",null),mM=E([dt("esri.views.overlay.ViewOverlay")],mM);const kQe=mM;function nN(t,e,i,r){let n=null,s=1e3;typeof e=="number"?(s=e,r=i):(n=e??null,s=i);let o,a=0;const l=()=>{a=0,t.apply(r,o)},c=(...h)=>{n&&n.apply(r,h),o=h,s?a||(a=setTimeout(l,s)):l()};return c.remove=()=>{a&&(clearTimeout(a),a=0)},c.forceUpdate=()=>{a&&(clearTimeout(a),l())},c.hasPendingUpdates=()=>!!a,c}const Rti="randomUUID"in crypto;function GB(){if(Rti)return crypto.randomUUID();const t=crypto.getRandomValues(new Uint16Array(8));t[3]=4095&t[3]|16384,t[4]=16383&t[4]|32768;const e=i=>t[i].toString(16).padStart(4,"0");return e(0)+e(1)+"-"+e(2)+"-"+e(3)+"-"+e(4)+"-"+e(5)+e(6)+e(7)}const Mti={handleInterceptedEvent:(t,e,i,r)=>(t.scheduleRender(),e.properties[`on${r.type}`].apply(e.properties.bind||i,[r]))},Dti={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(t,e,i)=>{t.style[e]=i}},Fti=t=>({...Dti,...t}),Lti=(t,e)=>{const i=[];for(;t&&t!==e;)i.push(t),t=t.parentNode;return i},Nti=(t,e)=>t.find(e),$Qe=(t,e,i=!1)=>{let r=t;return e.forEach((n,s)=>{const o=r?.children?Nti(r.children,a=>a.domNode===n):void 0;i&&!o&&s!==e.length-1||(r=o)}),r},kti=t=>{let e;const i={...Mti,...t},r=Fti(i),n=r.performanceLogger;let s,o=!0,a=!1;const l=[],c=[],h=(y,v,x)=>{let I;r.eventHandlerInterceptor=(F,k,j,V)=>function(Y){let X;n("domEvent",Y);const Z=Lti(Y.currentTarget,I.domNode),ie=Z.some(he=>customElements.get(he?.tagName?.toLowerCase()));if(Y.eventPhase===Event.CAPTURING_PHASE||!ie)Z.reverse(),X=$Qe(I.getLastRender(),Z);else{const he=Y.composedPath(),_e=he.slice(he.indexOf(Y.currentTarget),he.indexOf(I.domNode)).filter(xe=>xe.getRootNode()===xe.ownerDocument).reverse();X=$Qe(I.getLastRender(),_e,!0)}let ce;return X&&(ce=i.handleInterceptedEvent(e,X,this,Y)),n("domEventProcessed",Y),ce},i.postProcessProjectionOptions?.(r);const P=x();I=y(v,P,r),l.push(I),c.push(x),i.afterFirstVNodeRendered&&i.afterFirstVNodeRendered(I,P)};let p=()=>{if(s=void 0,o){o=!1,n("renderStart",void 0);for(let y=0;y{s||a||(s=requestAnimationFrame(p))},stop:()=>{s&&(cancelAnimationFrame(s),s=void 0),a=!0},resume:()=>{a=!1,o=!0,e.scheduleRender()},append:(y,v)=>{h(fM.append,y,v)},insertBefore:(y,v)=>{h(fM.insertBefore,y,v)},merge:(y,v)=>{h(fM.merge,y,v)},replace:(y,v)=>{h(fM.replace,y,v)},detach:y=>{for(let v=0;v{const e=new URL(t,ey.$resourcesUrl$);return e.origin!==MY.location.origin?e.href:e.pathname},$ti=t=>ey.$resourcesUrl$=t,sN=(t,e="")=>()=>{},UQe="http://www.w3.org/1999/xlink",zQe={},Bti="http://www.w3.org/2000/svg",Vti="http://www.w3.org/1999/xhtml",jti=t=>t!=null,PEe=t=>(t=typeof t,t==="object"||t==="function"),br=(t,e,...i)=>{let r=null,n=null,s=null,o=!1,a=!1;const l=[],c=p=>{for(let y=0;yp[y]).join(" "))}}if(typeof t=="function")return t(e===null?{}:e,l,Uti);const h=nle(t,null);return h.$attrs$=e,l.length>0&&(h.$children$=l),h.$key$=n,h.$name$=s,h},nle=(t,e)=>{const i={$flags$:0,$tag$:t,$text$:e,$elm$:null,$children$:null};return i.$attrs$=null,i.$key$=null,i.$name$=null,i},qA={},Gti=t=>t&&t.$tag$===qA,Uti={forEach:(t,e)=>t.map(HQe).forEach(e),map:(t,e)=>t.map(HQe).map(e).map(zti)},HQe=t=>({vattrs:t.$attrs$,vchildren:t.$children$,vkey:t.$key$,vname:t.$name$,vtag:t.$tag$,vtext:t.$text$}),zti=t=>{if(typeof t.vtag=="function"){const i=Object.assign({},t.vattrs);return t.vkey&&(i.key=t.vkey),t.vname&&(i.name=t.vname),br(t.vtag,i,...t.vchildren||[])}const e=nle(t.vtag,t.vtext);return e.$attrs$=t.vattrs,e.$children$=t.vchildren,e.$key$=t.vkey,e.$name$=t.vname,e},Hti=t=>vii.map(e=>e(t)).find(e=>!!e),Wti=(t,e)=>t!=null&&!PEe(t)?e&4?t==="false"?!1:t===""||!!t:e&2?parseFloat(t):e&1?String(t):t:t,qti=t=>t,Xh=(t,e,i)=>{const r=qti(t);return{emit:n=>Yti(r,e,{bubbles:!!(i&4),composed:!!(i&2),cancelable:!!(i&1),detail:n})}},Yti=(t,e,i)=>{const r=ey.ce(e,i);return t.dispatchEvent(r),r},WQe=new WeakMap,Xti=(t,e,i)=>{let r=ale.get(t);wii&&i?(r=r||new CSSStyleSheet,typeof r=="string"?r=e:r.replaceSync(e)):r=e,ale.set(t,r)},Kti=(t,e,i,r)=>{let n=qQe(e,i);const s=ale.get(n);if(t=t.nodeType===11?t:fT,s)if(typeof s=="string"){t=t.head||t;let o=WQe.get(t),a;o||WQe.set(t,o=new Set),o.has(n)||(a=fT.createElement("style"),a.innerHTML=s,t.insertBefore(a,t.querySelector("link")),o&&o.add(n))}else t.adoptedStyleSheets.includes(s)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,s]);return n},Jti=t=>{const e=t.$cmpMeta$,i=t.$hostElement$,r=e.$flags$,n=sN("attachStyles",e.$tagName$),s=Kti(i.shadowRoot?i.shadowRoot:i.getRootNode(),e,t.$modeName$);r&10&&(i["s-sc"]=s,i.classList.add(s+"-h"),r&2&&i.classList.add(s+"-s")),n()},qQe=(t,e)=>"sc-"+(e&&t.$flags$&32?t.$tagName$+"-"+e:t.$tagName$),YQe=(t,e,i,r,n,s)=>{if(i!==r){let o=aet(t,e),a=e.toLowerCase();if(e==="class"){const l=t.classList,c=XQe(i),h=XQe(r);l.remove(...c.filter(p=>p&&!h.includes(p))),l.add(...h.filter(p=>p&&!c.includes(p)))}else if(e==="style"){for(const l in i)(!r||r[l]==null)&&(l.includes("-")?t.style.removeProperty(l):t.style[l]="");for(const l in r)(!i||r[l]!==i[l])&&(l.includes("-")?t.style.setProperty(l,r[l]):t.style[l]=r[l])}else if(e!=="key")if(e==="ref")r&&r(t);else if(!t.__lookupSetter__(e)&&e[0]==="o"&&e[1]==="n")e[2]==="-"?e=e.slice(3):aet(MY,a)?e=a.slice(2):e=a[2]+e.slice(3),i&&ey.rel(t,e,i,!1),r&&ey.ael(t,e,r,!1);else{const l=PEe(r);if((o||l&&r!==null)&&!n)try{if(t.tagName.includes("-"))t[e]=r;else{const h=r??"";e==="list"?o=!1:(i==null||t[e]!=h)&&(t[e]=h)}}catch{}let c=!1;a!==(a=a.replace(/^xlink\:?/,""))&&(e=a,c=!0),r==null||r===!1?(r!==!1||t.getAttribute(e)==="")&&(c?t.removeAttributeNS(UQe,e):t.removeAttribute(e)):(!o||s&4||n)&&!l&&(r=r===!0?"":r,c?t.setAttributeNS(UQe,e,r):t.setAttribute(e,r))}}},Zti=/\s/,XQe=t=>t?t.split(Zti):[],KQe=(t,e,i,r)=>{const n=e.$elm$.nodeType===11&&e.$elm$.host?e.$elm$.host:e.$elm$,s=t&&t.$attrs$||zQe,o=e.$attrs$||zQe;for(r in s)r in o||YQe(n,r,s[r],void 0,i,e.$flags$);for(r in o)YQe(n,r,s[r],o[r],i,e.$flags$)},sle=(t,e,i,r)=>{const n=e.$children$[i];let s=0,o,a,l;if(VQe||(IEe=!0,n.$tag$==="slot"&&(zB&&r.classList.add(zB+"-s"),n.$flags$|=n.$children$?2:1)),n.$text$!==null)o=n.$elm$=fT.createTextNode(n.$text$);else if(n.$flags$&1)o=n.$elm$=fT.createTextNode("");else{if(X1||(X1=n.$tag$==="svg"),o=n.$elm$=fT.createElementNS(X1?Bti:Vti,n.$flags$&2?"slot-fb":n.$tag$),X1&&n.$tag$==="foreignObject"&&(X1=!1),KQe(null,n,X1),jti(zB)&&o["s-si"]!==zB&&o.classList.add(o["s-si"]=zB),n.$children$)for(s=0;s{ey.$flags$|=1;const i=t.childNodes;for(let r=i.length-1;r>=0;r--){const n=i[r];n["s-hn"]!==ile&&n["s-ol"]&&(QQe(n).insertBefore(n,OEe(n)),n["s-ol"].remove(),n["s-ol"]=void 0,IEe=!0),e&&PY(n,e)}ey.$flags$&=-2},JQe=(t,e,i,r,n,s)=>{let o=t["s-cr"]&&t["s-cr"].parentNode||t,a;for(o.shadowRoot&&o.tagName===ile&&(o=o.shadowRoot);n<=s;++n)r[n]&&(a=sle(null,i,n,t),a&&(r[n].$elm$=a,o.insertBefore(a,OEe(e))))},ZQe=(t,e,i,r,n)=>{for(;e<=i;++e)(r=t[e])&&(n=r.$elm$,ret(r),rle=!0,n["s-ol"]?n["s-ol"].remove():PY(n,!0),n.remove())},Qti=(t,e,i,r)=>{let n=0,s=0,o=0,a=0,l=e.length-1,c=e[0],h=e[l],p=r.length-1,y=r[0],v=r[p],x,I;for(;n<=l&&s<=p;)if(c==null)c=e[++n];else if(h==null)h=e[--l];else if(y==null)y=r[++s];else if(v==null)v=r[--p];else if(ole(c,y))HB(c,y),c=e[++n],y=r[++s];else if(ole(h,v))HB(h,v),h=e[--l],v=r[--p];else if(ole(c,v))(c.$tag$==="slot"||v.$tag$==="slot")&&PY(c.$elm$.parentNode,!1),HB(c,v),t.insertBefore(c.$elm$,h.$elm$.nextSibling),c=e[++n],v=r[--p];else if(ole(h,y))(c.$tag$==="slot"||v.$tag$==="slot")&&PY(h.$elm$.parentNode,!1),HB(h,y),t.insertBefore(h.$elm$,c.$elm$),h=e[--l],y=r[++s];else{for(o=-1,a=n;a<=l;++a)if(e[a]&&e[a].$key$!==null&&e[a].$key$===y.$key$){o=a;break}o>=0?(I=e[o],I.$tag$!==y.$tag$?x=sle(e&&e[s],i,o,t):(HB(I,y),e[o]=void 0,x=I.$elm$),y=r[++s]):(x=sle(e&&e[s],i,s,t),y=r[++s]),x&&QQe(c.$elm$).insertBefore(x,OEe(c.$elm$))}n>l?JQe(t,r[p+1]==null?null:r[p+1].$elm$,i,r,s,p):s>p&&ZQe(e,n,l)},ole=(t,e)=>t.$tag$===e.$tag$?t.$tag$==="slot"?t.$name$===e.$name$:t.$key$===e.$key$:!1,OEe=t=>t&&t["s-ol"]||t,QQe=t=>(t["s-ol"]?t["s-ol"]:t).parentNode,HB=(t,e)=>{const i=e.$elm$=t.$elm$,r=t.$children$,n=e.$children$,s=e.$tag$,o=e.$text$;let a;o===null?(X1=s==="svg"?!0:s==="foreignObject"?!1:X1,s==="slot"||KQe(t,e,X1),r!==null&&n!==null?Qti(i,r,e,n):n!==null?(t.$text$!==null&&(i.textContent=""),JQe(i,null,e,n,0,n.length-1)):r!==null&&ZQe(r,0,r.length-1),X1&&s==="svg"&&(X1=!1)):(a=i["s-cr"])?a.parentNode.textContent=o:t.$text$!==o&&(i.data=o)},eet=t=>{const e=t.childNodes;let i,r,n,s,o,a;for(r=0,n=e.length;r{let e,i,r,n,s,o,a=0;const l=t.childNodes,c=l.length;for(;a=0;o--)i=r[o],!i["s-cn"]&&!i["s-nr"]&&i["s-hn"]!==e["s-hn"]&&(iet(i,n)?(s=k2.find(h=>h.$nodeToRelocate$===i),rle=!0,i["s-sn"]=i["s-sn"]||n,s?s.$slotRefNode$=e:k2.push({$slotRefNode$:e,$nodeToRelocate$:i}),i["s-sr"]&&k2.map(h=>{iet(h.$nodeToRelocate$,i["s-sn"])&&(s=k2.find(p=>p.$nodeToRelocate$===i),s&&!h.$slotRefNode$&&(h.$slotRefNode$=s.$slotRefNode$))})):k2.some(h=>h.$nodeToRelocate$===i)||k2.push({$nodeToRelocate$:i}));e.nodeType===1&&tet(e)}},iet=(t,e)=>t.nodeType===1?t.getAttribute("slot")===null&&e===""||t.getAttribute("slot")===e:t["s-sn"]===e?!0:e==="",ret=t=>{t.$attrs$&&t.$attrs$.ref&&t.$attrs$.ref(null),t.$children$&&t.$children$.map(ret)},eii=(t,e)=>{const i=t.$hostElement$,r=t.$cmpMeta$,n=t.$vnode$||nle(null,null),s=Gti(e)?e:br(null,null,e);ile=i.tagName,r.$attrsToReflect$&&(s.$attrs$=s.$attrs$||{},r.$attrsToReflect$.map(([o,a])=>s.$attrs$[a]=i[o])),s.$tag$=null,s.$flags$|=4,t.$vnode$=s,s.$elm$=n.$elm$=i.shadowRoot||i,zB=i["s-sc"],BQe=i["s-cr"],VQe=(r.$flags$&1)!==0,rle=!1,HB(n,s);{if(ey.$flags$|=1,IEe){tet(s.$elm$);let o,a,l,c,h,p,y=0;for(;y{},REe=(t,e)=>(t.$flags$|=16,tii(t,t.$ancestorComponent$),Cii(()=>iii(t,e))),iii=(t,e)=>{const i=t.$hostElement$,r=sN("scheduleUpdate",t.$cmpMeta$.$tagName$),n=i;let s;return e?s=WB(n,"componentWillLoad"):s=WB(n,"componentWillUpdate"),s=net(s,()=>WB(n,"componentWillRender")),r(),net(s,()=>rii(t,n,e))},rii=async(t,e,i)=>{const r=t.$hostElement$,n=sN("update",t.$cmpMeta$.$tagName$);r["s-rc"],i&&Jti(t);const s=sN("render",t.$cmpMeta$.$tagName$);nii(t,e,r),s(),n(),sii(t)},nii=(t,e,i)=>{try{jQe=e,e=e.render&&e.render(),t.$flags$&=-17,t.$flags$|=2,(UB.hasRenderFn||UB.reflect)&&(UB.vdomRender||UB.reflect)&&(UB.hydrateServerSide||eii(t,e))}catch(a){RY(a,t.$hostElement$)}return jQe=null,null},sii=t=>{const e=t.$cmpMeta$.$tagName$,i=t.$hostElement$,r=sN("postUpdate",e),n=i;t.$ancestorComponent$,WB(n,"componentDidRender"),t.$flags$&64?(WB(n,"componentDidUpdate"),r()):(t.$flags$|=64,WB(n,"componentDidLoad"),r())},MEe=t=>{{const e=OY(t),i=e.$hostElement$.isConnected;return i&&(e.$flags$&18)===2&&REe(e,!1),i}},WB=(t,e,i)=>{if(t&&t[e])try{return t[e](i)}catch(r){RY(r)}},net=(t,e)=>t&&t.then?t.then(e):e(),oii=(t,e)=>OY(t).$instanceValues$.get(e),aii=(t,e,i,r)=>{const n=OY(t),s=t,o=n.$instanceValues$.get(e),a=n.$flags$,l=s;i=Wti(i,r.$members$[e][0]);const c=Number.isNaN(o)&&Number.isNaN(i);if(i!==o&&!c){n.$instanceValues$.set(e,i);{if(r.$watchers$&&a&128){const p=r.$watchers$[e];p&&p.map(y=>{try{l[y](i,o,e)}catch(v){RY(v,s)}})}if((a&18)===2){if(l.componentShouldUpdate&&l.componentShouldUpdate(i,o,e)===!1)return;REe(n,!1)}}}},lii=(t,e,i)=>{if(e.$members$){t.watchers&&(e.$watchers$=t.watchers);const r=Object.entries(e.$members$),n=t.prototype;r.map(([s,[o]])=>{(o&31||o&32)&&Object.defineProperty(n,s,{get(){return oii(this,s)},set(a){aii(this,s,a,e)},configurable:!0,enumerable:!0})});{const s=new Map;n.attributeChangedCallback=function(o,a,l){ey.jmp(()=>{const c=s.get(o);if(this.hasOwnProperty(c))l=this[c],delete this[c];else if(n.hasOwnProperty(c)&&typeof this[c]=="number"&&this[c]==l)return;this[c]=l===null&&typeof this[c]=="boolean"?!1:l})},t.observedAttributes=r.filter(([o,a])=>a[0]&15).map(([o,a])=>{const l=a[1]||o;return s.set(l,o),a[0]&512&&e.$attrsToReflect$.push([o,l]),l})}}return t},uii=async(t,e,i,r,n)=>{if(!(e.$flags$&32)&&(n=t.constructor,e.$flags$|=32,customElements.whenDefined(i.$tagName$).then(()=>e.$flags$|=128),n.style)){let o=n.style;typeof o!="string"&&(o=o[e.$modeName$=Hti(t)]);const a=qQe(i,e.$modeName$);if(!ale.has(a)){const l=sN("registerStyles",i.$tagName$);Xti(a,o,!!(i.$flags$&1)),l()}}e.$ancestorComponent$,(()=>REe(e,!0))()},cii=t=>{},hii=t=>{if(!(ey.$flags$&1)){const e=OY(t),i=e.$cmpMeta$,r=sN("connectedCallback",i.$tagName$);e.$flags$&1?(set(t,e,i.$listeners$),cii(e.$lazyInstance$)):(e.$flags$|=1,i.$flags$&12&&dii(t),i.$members$&&Object.entries(i.$members$).map(([n,[s]])=>{if(s&31&&t.hasOwnProperty(n)){const o=t[n];delete t[n],t[n]=o}}),uii(t,e,i)),r()}},dii=t=>{const e=t["s-cr"]=fT.createComment("");e["s-cn"]=!0,t.insertBefore(e,t.firstChild)},pii=t=>{if(!(ey.$flags$&1)){const e=OY(t);e.$rmListeners$&&(e.$rmListeners$.map(i=>i()),e.$rmListeners$=void 0)}},d0=(t,e)=>{const i={$flags$:e[0],$tagName$:e[1]};i.$members$=e[2],i.$listeners$=e[3],i.$watchers$=t.$watchers$,i.$attrsToReflect$=[];const r=t.prototype.connectedCallback,n=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__registerHost(){yii(this,i)},connectedCallback(){hii(this),r&&r.call(this)},disconnectedCallback(){pii(this),n&&n.call(this)},__attachShadow(){this.attachShadow({mode:"open",delegatesFocus:!!(i.$flags$&16)})}}),t.is=i.$tagName$,lii(t,i)},DEe=(t,e)=>e,set=(t,e,i,r)=>{i&&i.map(([n,s,o])=>{const a=mii(t,n),l=fii(e,o),c=gii(n);ey.ael(a,s,l,c),(e.$rmListeners$=e.$rmListeners$||[]).push(()=>ey.rel(a,s,l,c))})},fii=(t,e)=>i=>{try{UB.lazyLoad||t.$hostElement$[e](i)}catch(r){RY(r)}},mii=(t,e)=>e&4?fT:e&8?MY:e&16?fT.body:t,gii=t=>_ii?{passive:(t&1)!==0,capture:(t&2)!==0}:(t&2)!==0,oet=new WeakMap,OY=t=>oet.get(t),yii=(t,e)=>{const i={$flags$:0,$hostElement$:t,$cmpMeta$:e,$instanceValues$:new Map};return set(t,i,e.$listeners$),oet.set(t,i)},aet=(t,e)=>e in t,RY=(t,e)=>(0,console.error)(t,e),ale=new Map,vii=[],MY=typeof window<"u"?window:{},fT=MY.document||{head:{}},p0=MY.HTMLElement||class{},ey={$flags$:0,$resourcesUrl$:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,i,r)=>t.addEventListener(e,i,r),rel:(t,e,i,r)=>t.removeEventListener(e,i,r),ce:(t,e)=>new CustomEvent(t,e)},_ii=(()=>{let t=!1;try{fT.addEventListener("e",null,Object.defineProperty({},"passive",{get(){t=!0}}))}catch{}return t})(),bii=t=>Promise.resolve(t),wii=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replaceSync=="function"}catch{}return!1})(),uet=[],cet=[],xii=(t,e)=>i=>{t.push(i),AEe||(AEe=!0,e&&ey.$flags$&4?Sii(FEe):ey.raf(FEe))},het=t=>{for(let e=0;e{het(uet),het(cet),(AEe=uet.length>0)&&ey.raf(FEe)},Sii=t=>bii().then(t),Cii=xii(cet,!0);/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */function iii(t){return t.map(e=>{let i="";for(let r=0;riii([2,1,1,1,3]);/*! + */function Tii(t){return t.map(e=>{let i="";for(let r=0;rTii([2,1,1,1,3]);/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const uet="calcite-mode-auto",cet="calcite-mode-dark",rii={autoMode:uet,darkMode:cet,lightMode:"calcite-mode-light",rtl:"calcite--rtl"};/*! + */const det="calcite-mode-auto",pet="calcite-mode-dark",Eii={autoMode:det,darkMode:pet,lightMode:"calcite-mode-light",rtl:"calcite--rtl"};/*! * tabbable 6.0.1 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE -*/var het=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],hle=het.join(","),det=typeof Element>"u",rk=det?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,dle=!det&&Element.prototype.getRootNode?function(t){return t.getRootNode()}:function(t){return t.ownerDocument},pet=function(e,i,r){var n=Array.prototype.slice.apply(e.querySelectorAll(hle));return i&&rk.call(e,hle)&&n.unshift(e),n=n.filter(r),n},fet=function t(e,i,r){for(var n=[],s=Array.from(e);s.length;){var o=s.shift();if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,c=t(l,!0,r);r.flatten?n.push.apply(n,c):n.push({scopeParent:o,candidates:c})}else{var d=rk.call(o,hle);d&&r.filter(o)&&(i||!e.includes(o))&&n.push(o);var p=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),y=!r.shadowRootFilter||r.shadowRootFilter(o);if(p&&y){var v=t(p===!0?o.children:p.children,!0,r);r.flatten?n.push.apply(n,v):n.push({scopeParent:o,candidates:v})}else s.unshift.apply(s,o.children)}}return n},met=function(e,i){return e.tabIndex<0&&(i||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},nii=function(e,i){return e.tabIndex===i.tabIndex?e.documentOrder-i.documentOrder:e.tabIndex-i.tabIndex},get=function(e){return e.tagName==="INPUT"},sii=function(e){return get(e)&&e.type==="hidden"},oii=function(e){var i=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return i},aii=function(e,i){for(var r=0;rsummary:first-of-type"),o=s?e.parentElement:e;if(rk.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,c=dle(e);if(l&&!l.shadowRoot&&n(l)===!0)return yet(e);e.assignedSlot?e=e.assignedSlot:!l&&c!==e.ownerDocument?e=c.host:e=l}e=a}if(hii(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return yet(e);return!1},pii=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var i=e.parentElement;i;){if(i.tagName==="FIELDSET"&&i.disabled){for(var r=0;r=0)},mii=function t(e){var i=[],r=[];return e.forEach(function(n,s){var o=!!n.scopeParent,a=o?n.scopeParent:n,l=met(a,o),c=o?t(n.candidates):a;l===0?o?i.push.apply(i,c):i.push(a):r.push({documentOrder:s,tabIndex:l,item:n,isScope:o,content:c})}),r.sort(nii).reduce(function(n,s){return s.isScope?n.push.apply(n,s.content):n.push(s.content),n},[]).concat(i)},vet=function(e,i){i=i||{};var r;return i.getShadowRoot?r=fet([e],i.includeContainer,{filter:REe.bind(null,i),flatten:!1,getShadowRoot:i.getShadowRoot,shadowRootFilter:fii}):r=pet(e,i.includeContainer,REe.bind(null,i)),mii(r)},gii=function(e,i){i=i||{};var r;return i.getShadowRoot?r=fet([e],i.includeContainer,{filter:ple.bind(null,i),flatten:!0,getShadowRoot:i.getShadowRoot}):r=pet(e,i.includeContainer,ple.bind(null,i)),r},fle=function(e,i){if(i=i||{},!e)throw new Error("No node provided");return rk.call(e,hle)===!1?!1:REe(i,e)},yii=het.concat("iframe").join(","),MEe=function(e,i){if(i=i||{},!e)throw new Error("No node provided");return rk.call(e,yii)===!1?!1:ple(i,e)};const _et={getShadowRoot:!0};function FY(t){const e="dir",i=`[${e}]`,r=XB(t,i);return r?r.getAttribute(e):"ltr"}function bet(t,e,i){const r=`[${e}]`,n=t.closest(r);return n?n.getAttribute(e):i}function wet(t){return t.getRootNode()}function xet(t){return t.host||null}function DEe(t,{selector:e,id:i}){function r(n){if(!n)return null;n.assignedSlot&&(n=n.assignedSlot);const s=wet(n),o=i?"getElementById"in s?s.getElementById(i):null:e?s.querySelector(e):null,a=xet(s);return o||(a?r(a):null)}return r(t)}function XB(t,e){function i(r){return r?r.closest(e)||i(xet(wet(r))):null}return i(t)}function vii(t,e){return Cet(t,e)}function Cet(t,e){if(!t)return;const i=e(t);if(i!==void 0)return i;const{parentNode:r}=t;return Cet(r instanceof ShadowRoot?r.host:r,e)}function _ii(t,e){return!!vii(e,i=>i===t?!0:void 0)}function bii(t){return typeof t?.setFocus=="function"}async function Tet(t){if(t)return bii(t)?t.setFocus():t.focus()}function Eet(t){(vet(t,_et)[0]||t).focus()}const LY=":not([slot])";function FEe(t,e,i){e&&!Array.isArray(e)&&typeof e!="string"&&(i=e,e=null);const r=e?Array.isArray(e)?e.map(n=>`[slot="${n}"]`).join(","):`[slot="${e}"]`:LY;return i?.all?wii(t,r,i):xii(t,r,i)}function Iet(t,e){return t?Array.from(t.children||[]).filter(i=>i?.matches(e)):[]}function wii(t,e,i){let r=e===LY?Iet(t,LY):Array.from(t.querySelectorAll(e));r=i&&i.direct===!1?r:r.filter(s=>s.parentElement===t),r=i?.matches?r.filter(s=>s?.matches(i.matches)):r;const n=i?.selector;return n?r.map(s=>Array.from(s.querySelectorAll(n))).reduce((s,o)=>[...s,...o],[]).filter(s=>!!s):r}function xii(t,e,i){let r=e===LY?Iet(t,LY)[0]||null:t.querySelector(e);r=i&&i.direct===!1||r?.parentElement===t?r:null,r=i?.matches?r?.matches(i.matches)?r:null:r;const n=i?.selector;return n?r?.querySelector(n):r}function mle(t,e,i){if(typeof e=="string"&&e!=="")return e;if(e==="")return t[i]}function yw(t){return Boolean(t).toString()}function kY(t){return!!Sii(t).length}function Sii(t){return t.target.assignedElements({flatten:!0})}function NY(t){return!!(t.isPrimary&&t.button===0)}/*! +*/var fet=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],lle=fet.join(","),met=typeof Element>"u",oN=met?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ule=!met&&Element.prototype.getRootNode?function(t){return t.getRootNode()}:function(t){return t.ownerDocument},get=function(e,i,r){var n=Array.prototype.slice.apply(e.querySelectorAll(lle));return i&&oN.call(e,lle)&&n.unshift(e),n=n.filter(r),n},yet=function t(e,i,r){for(var n=[],s=Array.from(e);s.length;){var o=s.shift();if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,c=t(l,!0,r);r.flatten?n.push.apply(n,c):n.push({scopeParent:o,candidates:c})}else{var h=oN.call(o,lle);h&&r.filter(o)&&(i||!e.includes(o))&&n.push(o);var p=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),y=!r.shadowRootFilter||r.shadowRootFilter(o);if(p&&y){var v=t(p===!0?o.children:p.children,!0,r);r.flatten?n.push.apply(n,v):n.push({scopeParent:o,candidates:v})}else s.unshift.apply(s,o.children)}}return n},vet=function(e,i){return e.tabIndex<0&&(i||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},Iii=function(e,i){return e.tabIndex===i.tabIndex?e.documentOrder-i.documentOrder:e.tabIndex-i.tabIndex},_et=function(e){return e.tagName==="INPUT"},Aii=function(e){return _et(e)&&e.type==="hidden"},Pii=function(e){var i=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return i},Oii=function(e,i){for(var r=0;rsummary:first-of-type"),o=s?e.parentElement:e;if(oN.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,c=ule(e);if(l&&!l.shadowRoot&&n(l)===!0)return bet(e);e.assignedSlot?e=e.assignedSlot:!l&&c!==e.ownerDocument?e=c.host:e=l}e=a}if(Fii(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return bet(e);return!1},Nii=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var i=e.parentElement;i;){if(i.tagName==="FIELDSET"&&i.disabled){for(var r=0;r=0)},$ii=function t(e){var i=[],r=[];return e.forEach(function(n,s){var o=!!n.scopeParent,a=o?n.scopeParent:n,l=vet(a,o),c=o?t(n.candidates):a;l===0?o?i.push.apply(i,c):i.push(a):r.push({documentOrder:s,tabIndex:l,item:n,isScope:o,content:c})}),r.sort(Iii).reduce(function(n,s){return s.isScope?n.push.apply(n,s.content):n.push(s.content),n},[]).concat(i)},wet=function(e,i){i=i||{};var r;return i.getShadowRoot?r=yet([e],i.includeContainer,{filter:LEe.bind(null,i),flatten:!1,getShadowRoot:i.getShadowRoot,shadowRootFilter:kii}):r=get(e,i.includeContainer,LEe.bind(null,i)),$ii(r)},Bii=function(e,i){i=i||{};var r;return i.getShadowRoot?r=yet([e],i.includeContainer,{filter:cle.bind(null,i),flatten:!0,getShadowRoot:i.getShadowRoot}):r=get(e,i.includeContainer,cle.bind(null,i)),r},hle=function(e,i){if(i=i||{},!e)throw new Error("No node provided");return oN.call(e,lle)===!1?!1:LEe(i,e)},Vii=fet.concat("iframe").join(","),NEe=function(e,i){if(i=i||{},!e)throw new Error("No node provided");return oN.call(e,Vii)===!1?!1:cle(i,e)};const xet={getShadowRoot:!0};function FY(t){const e="dir",i=`[${e}]`,r=qB(t,i);return r?r.getAttribute(e):"ltr"}function Cet(t,e,i){const r=`[${e}]`,n=t.closest(r);return n?n.getAttribute(e):i}function Tet(t){return t.getRootNode()}function Eet(t){return t.host||null}function kEe(t,{selector:e,id:i}){function r(n){if(!n)return null;n.assignedSlot&&(n=n.assignedSlot);const s=Tet(n),o=i?"getElementById"in s?s.getElementById(i):null:e?s.querySelector(e):null,a=Eet(s);return o||(a?r(a):null)}return r(t)}function qB(t,e){function i(r){return r?r.closest(e)||i(Eet(Tet(r))):null}return i(t)}function jii(t,e){return Iet(t,e)}function Iet(t,e){if(!t)return;const i=e(t);if(i!==void 0)return i;const{parentNode:r}=t;return Iet(r instanceof ShadowRoot?r.host:r,e)}function Gii(t,e){return!!jii(e,i=>i===t?!0:void 0)}function Uii(t){return typeof t?.setFocus=="function"}async function Aet(t){if(t)return Uii(t)?t.setFocus():t.focus()}function Pet(t){(wet(t,xet)[0]||t).focus()}const LY=":not([slot])";function $Ee(t,e,i){e&&!Array.isArray(e)&&typeof e!="string"&&(i=e,e=null);const r=e?Array.isArray(e)?e.map(n=>`[slot="${n}"]`).join(","):`[slot="${e}"]`:LY;return i?.all?zii(t,r,i):Hii(t,r,i)}function Oet(t,e){return t?Array.from(t.children||[]).filter(i=>i?.matches(e)):[]}function zii(t,e,i){let r=e===LY?Oet(t,LY):Array.from(t.querySelectorAll(e));r=i&&i.direct===!1?r:r.filter(s=>s.parentElement===t),r=i?.matches?r.filter(s=>s?.matches(i.matches)):r;const n=i?.selector;return n?r.map(s=>Array.from(s.querySelectorAll(n))).reduce((s,o)=>[...s,...o],[]).filter(s=>!!s):r}function Hii(t,e,i){let r=e===LY?Oet(t,LY)[0]||null:t.querySelector(e);r=i&&i.direct===!1||r?.parentElement===t?r:null,r=i?.matches?r?.matches(i.matches)?r:null:r;const n=i?.selector;return n?r?.querySelector(n):r}function dle(t,e,i){if(typeof e=="string"&&e!=="")return e;if(e==="")return t[i]}function bw(t){return(!!t).toString()}function NY(t){return!!Wii(t).length}function Wii(t){return t.target.assignedElements({flatten:!0})}function kY(t){return!!(t.isPrimary&&t.button===0)}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */function Aet(){const{classList:t}=document.body,e=window.matchMedia("(prefers-color-scheme: dark)").matches,i=()=>t.contains(cet)||t.contains(uet)&&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=i();r(s),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",o=>n(o.matches?"dark":"light")),new MutationObserver(()=>n(i())).observe(document.body,{attributes:!0,attributeFilter:["class"]})}function Cii(){typeof window<"u"&&typeof location<"u"&&typeof document<"u"&&window.location===location&&window.document===document&&(document.readyState==="interactive"?Aet():document.addEventListener("DOMContentLoaded",()=>Aet(),{once:!0}))}Cii();let Pet;function Tii(){mti(Vy(zl(Pet)))}Pet="components/assets";const Oet=Symbol("widget"),Eii=Symbol("widget-test-data"),Iii=[],Aii={},gle=new WeakMap;function Ret(t,e){let i=e.children;if(i&&i.length)for(let n=0;nMet(t)))}function Oii(t,e,i,{widgetProperties:r}){const n=gle.get(t);n&&(n.set(r),n.afterUpdate?.(n,t))}function Met(t){const e=gle.get(t);e&&(e.afterRemoved?.(e,t),e.destroy(),gle.delete(t))}function LEe(t){return typeof t=="function"&&t[Oet]}const Det=new Set;function Rii(t){Det.add(t),t.finally(()=>Det.delete(t))}var Fet;const Mii="esri.widgets.Widget";let Dii=0;const Fii={widgetIcon:"esri-icon-checkbox-unchecked"};function Let(t,e){for(const i in e)t[i]!=null&&(typeof t[i]=="object"&&typeof e[i]=="object"?Let(t[i],e?.[i]):t[i]=e[i]);return t}const Lii=fti({postProcessProjectionOptions(t){const e=t.eventHandlerInterceptor,i=/capture$/i;t.eventHandlerInterceptor=(r,n,s,o)=>{const a=e?.(r,n,s,o),l=i.test(r);if(!((r=r.replace(i,"")).toLowerCase()in s)||l){const c=r[2].toLowerCase()+r.slice(3),d=v=>a?.call(s,v);s.addEventListener(c,d,l);const p=()=>s.removeEventListener(c,d,l),y=o.afterRemoved;o.afterRemoved=v=>{y?.(v),p()}}return a}},handleInterceptedEvent(t,e,i,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))&&(yQe(),t.scheduleRender(),l[a].call(l.bind||i,r))}});let kEe=!1,Rm=class extends Zx(cd.EventedAccessor){constructor(e,i){super(e,i),this._attached=!1,this._internalHandles=new uf,this._projector=Lii,this._readyForTrueRender=!1,this.iconClass=Fii.widgetIcon,this.key=this,this._loadLocale=$y(async()=>{if(this._messageBundleProps&&this._messageBundleProps.length){const o=await bu(this._messageBundleProps.map(async({bundlePath:a,propertyName:l})=>{let c=await MUe(a);this.uiStrings&&Object.keys(this.uiStrings)&&(c=Let(hi(c),this.uiStrings)),this[l]=c}));for(const a of o)a.error&&Ei.getLogger(this.declaredClass).error("widget-intl:locale-error",this.declaredClass,a.error)}await this.loadLocale()}),Tii();const r="esri-widget-uid-"+zB(),n=this.render.bind(this);this._trackingTarget=new Vre(()=>this.scheduleRender());const s=()=>{if(!this._readyForTrueRender||this.destroyed)return null;if(!this.visible)return{vnodeSelector:"div",properties:{key:r,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0};const o=n();let{properties:a}=o;a||(o.properties=a={});let{key:l,styles:c}=a;l||(a.key=r),c||(a.styles=c={}),c.display||(c.display="");let d=0;return o.children?.forEach(p=>{if(LEe(p.vnodeSelector))return;let{properties:y}=p;y||(p.properties=y={}),y.key||(y.key=`${this.id}--${d++}`)}),Ret(this,o)};this.render=()=>{if(kEe)return s();let o=Vei(this)??null;if(o)return o;this._trackingTarget.clear(),kEe=!0;try{o=ZI(this._trackingTarget,s)}catch(a){throw console.error(a),a}finally{kEe=!1}return o&&Uei(this,o),o},this.addResolvingPromise(this._resourcesFetch=this.beforeFirstRender().then(()=>{this._readyForTrueRender=!0,this._postInitialize()})),Rii(this._resourcesFetch)}normalizeCtorArgs(e,i){const r={...e};return i&&(r.container=i),r}postInitialize(){}beforeFirstRender(){return Promise.all([this.loadDependencies(),this._loadLocale()]).then(()=>{}).catch(wC)}async loadDependencies(){}async loadLocale(){}destroy(){this.destroyed||(ra(this._trackingTarget),ra(this.viewModel),this._detach(this.container),this._set("container",null),this._internalHandles.destroy(),this._emitter.clear(),this.render=()=>null,this._projector=null,mEe(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return pEe(e)}get domNode(){return this.container}set domNode(e){this.container=e}get id(){return this._get("id")||this.get("container.id")||Date.now().toString(16)+"-widget-"+Dii++}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[(Fet=Oet,Eii)](){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(mEe(this),this._projector.scheduleRender())}classes(...e){return _Qe.apply(this,e)}renderNow(){mEe(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this._internalHandles.add(Qi(()=>this.viewModel,(i,r)=>{r&&this._internalHandles.remove("delegated-events"),i&&Lre(i)&&this._internalHandles.add(this._delegatedEventNames.map(n=>QI(i,n,s=>{this.emit(n,s)})),"delegated-events")},Fo)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(wC),this.scheduleRender()};this._internalHandles.add([EUe(e),Qi(()=>this.uiStrings,e),Hg(()=>this.container,i=>{this.destroyed||this._attach(i)},{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)}};Rm[Fet]=!0,E([k()],Rm.prototype,"_readyForTrueRender",void 0),E([k({value:null})],Rm.prototype,"container",null),E([Zs("container")],Rm.prototype,"castContainer",null),E([k()],Rm.prototype,"iconClass",void 0),E([k()],Rm.prototype,"id",null),E([k()],Rm.prototype,"label",null),E([k()],Rm.prototype,"renderable",null),E([k()],Rm.prototype,"uiStrings",void 0),E([k()],Rm.prototype,"viewModel",void 0),E([k({value:!0})],Rm.prototype,"visible",null),E([k()],Rm.prototype,"key",void 0),E([k()],Rm.prototype,"children",void 0),E([k()],Rm.prototype,"afterCreate",void 0),E([k()],Rm.prototype,"afterUpdate",void 0),E([k()],Rm.prototype,"afterRemoved",void 0),Rm=E([ht(Mii)],Rm);const Gf=Rm,ket=["B","kB","MB","GB","TB"];function kii(t,e){let i=e===0?0:Math.floor(Math.log(e)/Math.log(K5.KILOBYTES));i=Hl(i,0,ket.length-1);const r=aA(e/K5.KILOBYTES**i,{maximumFractionDigits:2});return Kx(t.units.bytes[ket[i]],{fileSize:r})}const Nii="esri.widgets.Feature.support.featureUtils",Net=Ei.getLogger(Nii),$ii=/href=(""|'')/gi,Bii=/(\{([^\{\r\n]+)\})/g,Gii=/\'/g,$et=/^\s*expression\//i,Vii=/(\n)/gi,Uii=/[\u00A0-\u9999<>\&]/gim,jii=/href\s*=\s*(?:\"([^\"]+)\"|\'([^\']+)\')/gi,zii=/^(?:mailto:|tel:)/,Bet="relationships/",NEe=Nne("short-date-short-time");function Get(t){if(!lt(t))return t.get("sourceLayer")||t.get("layer")}async function yle(t,e){return typeof t=="function"?t.call(null,e):t}function Vet(t=""){if(t)return!zii.test(t.trim().toLowerCase())}function $Ee(t){return!!t&&$et.test(t)}function Hii(t,e){if(!$Ee(e)||!t)return null;const i=e.replace($et,"").toLowerCase();let r=null;return t.some(n=>n.name.toLowerCase()===i&&(r=n,!0)),r}function Uet(t,e){const i=Hii(e,t?.fieldName);return i?i.title||null:t?t.label||t.fieldName:null}function Wii(t,e){const i=e.get(t.toLowerCase());return`{${i&&i.fieldName||t}}`}function qii(t){return t.replace($ii,"")}function $Y(t,e){const i=BEe(e,t);return i?i.name:t}function Yii(t,e){return t&&t.map(i=>$Y(i,e))}function BEe(t,e){return t&&typeof t.getField=="function"&&e?t.getField(e)??null:null}function jet(t){return`${t}`.trim()}function nk({attributes:t,globalAttributes:e,layer:i,text:r,expressionAttributes:n,fieldInfoMap:s}){return r?GEe({formattedAttributes:e,template:Zii(r,{...e,...n,...t},i),fieldInfoMap:s}):""}function GEe({formattedAttributes:t,template:e,fieldInfoMap:i}){return jet(qii(Kx(Kx(e,r=>Wii(r,i)),t)))}function Xii(t,e,i=!1){const r=e[t];if(typeof r=="string"){const n="%27",s=(i?encodeURIComponent(r):r).replace(Gii,n);e[t]=s}}function Kii(t,e=!1){const i={...t};return Object.keys(i).forEach(r=>Xii(r,i,e)),i}function Jii(t,e,i){const r=(e=jet(e))&&e[0]!=="{";return Kx(t,Kii(i,r||!1))}function VEe(t,e){return t.replace(Bii,(i,r,n)=>{const s=BEe(e,n);return s?`{${s.name}}`:r})}function Zii(t,e,i){const r=VEe(t,i);return r&&r.replace(jii,(n,s,o)=>Jii(n,s||o,e))}function Qii(t,e){if(typeof t=="string"&&e&&e.dateFormat==null&&(e.places!=null||e.digitSeparator!=null)){const i=Number(t);if(!isNaN(i))return i}return t}function eri(t){return t?.type==="feature"}function zet(t){return!!t?.layer}function tri(t){return t?.type==="map-image"}function iri(t,e){const i=e.fieldInfos,r=e.fieldName,n=Het(i,r)?.clone(),s=e.preventPlacesFormatting,o=e.layer,a=BEe(o,r);if(n&&a?.type==="date"){const c=n.format||new s9;c.dateFormat=c.dateFormat||"short-date-short-time",c.dateTimeFormatOptions=!zet(o)&&eri(o)&&o.datesInUnknownTimezone||zet(o)&&tri(o.layer)&&o.layer.datesInUnknownTimezone?{timeZone:"UTC"}:null,n.format=c}const l=n&&n.format;return typeof t=="string"&&$je(r)&&l?l.formatRasterPixelValue(t):typeof(t=Qii(t,l))=="string"||t==null||l==null?BY(t):s?aA(t,{...Uje(l),minimumFractionDigits:0,maximumFractionDigits:20}):l.format(t)}function Het(t,e){if(!t||!t.length||!e)return;const i=e.toLowerCase();let r;return t.some(n=>!(!n.fieldName||n.fieldName.toLowerCase()!==i)&&(r=n,!0)),r}function rri({fieldName:t,graphic:e,layer:i}){if(XA(t)||!i||typeof i.getFeatureType!="function")return null;const{typeIdField:r}=i;if(!r||t!==r)return null;const n=i.getFeatureType(e);return n?n.name:null}function nri({fieldName:t,value:e,graphic:i,layer:r}){if(XA(t)||!r||typeof r.getFieldDomain!="function")return null;const n=i&&r.getFieldDomain(t,{feature:i});return n&&n.type==="coded-value"?n.getName(e):null}function sri(t,e){const{creatorField:i,creationDateField:r,editorField:n,editDateField:s}=t;if(!e)return;const o=e[s];if(typeof o=="number"){const l=e[n];return{type:"edit",date:kC(o,NEe),user:l}}const a=e[r];if(typeof a=="number"){const l=e[i];return{type:"create",date:kC(a,NEe),user:l}}return null}function ori(t,e){const i=new Map;return t&&t.forEach(r=>{const n=$Y(r.fieldName,e);r.fieldName=n,i.set(n.toLowerCase(),r)}),i}function Wet(t){const e=[];if(!t)return e;const{fieldInfos:i,content:r}=t;return i&&e.push(...i),r&&Array.isArray(r)&&r.forEach(n=>{if(n.type==="fields"){const s=n&&n.fieldInfos;s&&e.push(...s)}}),e}function UEe(t){return t.replace(Uii,e=>`&#${e.charCodeAt(0)};`)}function BY(t){return typeof t=="string"?t.replace(Vii,'
'):t}function qet(t){const{value:e,fieldName:i,fieldInfos:r,fieldInfoMap:n,layer:s,graphic:o}=t;if(e==null)return"";const a=nri({fieldName:i,value:e,graphic:o,layer:s});if(a)return a;const l=rri({fieldName:i,graphic:o,layer:s});if(l)return l;if(n.get(i.toLowerCase()))return iri(e,{fieldInfos:r||Array.from(n.values()),fieldName:i,layer:s});const c=s&&s.fieldsIndex;return c&&c.isDateField(i)?kC(e,NEe):BY(e)}function jEe({fieldInfos:t,attributes:e,layer:i,graphic:r,fieldInfoMap:n,relatedInfos:s}){const o={};return s?.forEach(a=>cri({attributes:o,relatedInfo:a,fieldInfoMap:n,fieldInfos:t,layer:i})),e&&Object.keys(e).forEach(a=>{const l=e[a];o[a]=qet({fieldName:a,fieldInfos:t,fieldInfoMap:n,layer:i,value:l,graphic:r})}),o}async function Yet(t,e){const{layer:i,graphic:r,outFields:n,objectIds:s,returnGeometry:o,spatialReference:a}=t,l=s[0];if(typeof l!="number"&&typeof l!="string"){const d="Could not query required fields for the specified feature. The feature's ID is invalid.",p={layer:i,graphic:r,objectId:l,requiredFields:n};return Net.warn(d,p),null}if(!TL(i)?.operations?.supportsQuery){const d="The specified layer cannot be queried. The following fields will not be available.",p={layer:i,graphic:r,requiredFields:n,returnGeometry:o};return Net.warn(d,p),null}const c=i.createQuery();return c.objectIds=s,c.outFields=n?.length?n:[i.objectIdField],c.returnGeometry=!!o,c.returnZ=!!o,c.returnM=!!o,c.outSpatialReference=a,(await i.queryFeatures(c,e)).features[0]}async function ari(t){if(!t.expressionInfos?.length)return!1;const e=await Wv(),{arcadeUtils:{hasGeometryFunctions:i}}=e;return i(t)}async function lri({graphic:t,popupTemplate:e,layer:i,spatialReference:r},n){if(!i||!e||(typeof i.load=="function"&&await i.load(n),!t.attributes))return;const s=t.attributes[i.objectIdField];if(s==null)return;const o=[s],a=await e.getRequiredFields(i.fieldsIndex),l=Nje(a,t),c=l?[]:a,d=e.returnGeometry||await ari(e);if(l&&!d)return;const p=await Yet({layer:i,graphic:t,outFields:c,objectIds:o,returnGeometry:d,spatialReference:r},n);p&&(p.geometry&&(t.geometry=p.geometry),p.attributes&&(t.attributes={...t.attributes,...p.attributes}))}function XA(t=""){return!!t&&t.includes(Bet)}function uri(t){return t?`${Bet}${t.layerId}/${t.fieldName}`:""}function Xet({attributes:t,graphic:e,relatedInfo:i,fieldInfos:r,fieldInfoMap:n,layer:s}){t&&e&&i&&Object.keys(e.attributes).forEach(o=>{const a=uri({layerId:i.relation.id.toString(),fieldName:o}),l=e.attributes[o];t[a]=qet({fieldName:a,fieldInfos:r,fieldInfoMap:n,layer:s,value:l,graphic:e})})}function cri({attributes:t,relatedInfo:e,fieldInfoMap:i,fieldInfos:r,layer:n}){t&&e&&(e.relatedFeatures&&e.relatedFeatures&&e.relatedFeatures.forEach(s=>Xet({attributes:t,graphic:s,relatedInfo:e,fieldInfoMap:i,fieldInfos:r,layer:n})),e.relatedStatsFeatures&&e.relatedStatsFeatures&&e.relatedStatsFeatures.forEach(s=>Xet({attributes:t,graphic:s,relatedInfo:e,fieldInfoMap:i,fieldInfos:r,layer:n})))}const Ket=t=>{if(!t)return!1;const e=t.toUpperCase();return e.includes("CURRENT_TIMESTAMP")||e.includes("CURRENT_DATE")||e.includes("CURRENT_TIME")},Jet=({layer:t,method:e,query:i,definitionExpression:r})=>{if(!t.capabilities?.query?.supportsCacheHint||e==="attachments")return;const n=ye(i.where)?i.where:null,s=ye(i.geometry)?i.geometry:null;Ket(r)||Ket(n)||s?.type==="extent"||i.resultType==="tile"||(i.cacheHint=!0)},hri=({query:t,layer:e,method:i})=>{Jet({layer:e,method:i,query:t,definitionExpression:`${e.definitionExpression} ${e.serviceDefinitionExpression}`})},dri=({queryPayload:t,layer:e,method:i})=>{Jet({layer:e,method:i,query:t,definitionExpression:`${e.definitionExpression} ${e.serviceDefinitionExpression}`})};function pri(t,e,i){return t&&e&&i?Zet(t.allLayers,e,i)||Zet(t.allTables,e,i):null}function Zet(t,e,i){return t.find(r=>r!==e&&r.type==="feature"&&r.url===e.url&&r.layerId===i.relatedTableId)}const Qet={editing:!1,operations:{add:!0,update:!0,delete:!0}},ett=fr.ofType(jJe);let c_=class extends fn{constructor(e){super(e),this._getAttachmentsPromise=null,this._attachmentLayer=null,this.abilities={...Qet},this.activeAttachmentInfo=null,this.activeFileInfo=null,this.attachmentInfos=new ett,this.fileInfos=new fr,this.graphic=null,this.mode="view",this.filesEnabled=!1,this.addHandles(Qi(()=>this.graphic,()=>this._graphicChanged(),Fo))}destroy(){this._attachmentLayer=null,this.graphic=null}castAbilities(e){return{...Qet,...e}}get state(){return this._getAttachmentsPromise?"loading":this.graphic?"ready":"disabled"}get supportsResizeAttachments(){const{graphic:e}=this;if(!e)return!1;const i=e.layer||e.sourceLayer;return i?.loaded&&"capabilities"in i&&i.capabilities&&"operations"in i.capabilities&&"supportsResizeAttachments"in i.capabilities.operations&&i.capabilities.operations.supportsResizeAttachments||!1}async getAttachments(){const{_attachmentLayer:e,attachmentInfos:i}=this;if(!e||typeof e.queryAttachments!="function")throw new st("invalid-layer","getAttachments(): A valid layer is required.");const r=this._getObjectId(),n=new Aoe({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 i.removeAll(),a.length&&i.addMany(a),this._getAttachmentsPromise=null,this.notifyChange("state"),a}async addAttachment(e,i=this.graphic){const{_attachmentLayer:r,attachmentInfos:n,abilities:s}=this;if(!i)throw new st("invalid-graphic","addAttachment(): A valid graphic is required.",{graphic:i});if(!e)throw new st("invalid-attachment","addAttachment(): An attachment is required.",{attachment:e});if(!s.operations?.add)throw new st("invalid-abilities","addAttachment(): add abilities are required.");if(!r||typeof r.addAttachment!="function")throw new st("invalid-layer","addAttachment(): A valid layer is required.");const o=r.addAttachment(i,e).then(l=>this._queryAttachment(l.objectId,i)),a=await o;return n.add(a),a}async deleteAttachment(e){const{_attachmentLayer:i,attachmentInfos:r,graphic:n,abilities:s}=this;if(!e)throw new st("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:e});if(!s.operations?.delete)throw new st("invalid-abilities","deleteAttachment(): delete abilities are required.");if(!i||typeof i.deleteAttachments!="function")throw new st("invalid-layer","deleteAttachment(): A valid layer is required.");if(!n)throw new st("invalid-graphic","deleteAttachment(): A graphic is required.");const o=i.deleteAttachments(n,[e.id]).then(()=>e),a=await o;return r.remove(a),a}async updateAttachment(e,i=this.activeAttachmentInfo){const{_attachmentLayer:r,attachmentInfos:n,graphic:s,abilities:o}=this;if(!e)throw new st("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:e});if(!i)throw new st("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:i});if(!o.operations?.update)throw new st("invalid-abilities","updateAttachment(): Update abilities are required.");const a=n.findIndex(d=>d===i);if(!r||typeof r.updateAttachment!="function")throw new st("invalid-layer","updateAttachment(): A valid layer is required.");if(!s)throw new st("invalid-graphic","updateAttachment(): A graphic is required.");const l=r.updateAttachment(s,i.id,e).then(d=>this._queryAttachment(d.objectId)),c=await l;return n.splice(a,1,c),c}async commitFiles(){return await Promise.all(this.fileInfos.items.map(e=>this.addAttachment(e.form))),this.fileInfos.removeAll(),this.getAttachments()}addFile(e,i){if(!e||!i)return null;const r={file:e,form:i};return this.fileInfos.add(r),r}updateFile(e,i,r=this.activeFileInfo){if(!e||!i||!r)return null;const n=this.fileInfos.findIndex(s=>r===s);return n>-1&&this.fileInfos.splice(n,1,{file:e,form:i}),this.fileInfos.items[n]}deleteFile(e){const i=this.fileInfos.find(r=>r.file===e);return i?(this.fileInfos.remove(i),i):null}async _queryAttachment(e,i){const{_attachmentLayer:r}=this;if(!e||!r?.queryAttachments)throw new st("invalid-attachment-id","Could not query attachment.");const n=this._getObjectId(i),s=new Aoe({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,i=Get(e);this._attachmentLayer=i?i.type==="scene"&&ye(i.associatedLayer)?i.associatedLayer:i:null}};E([k()],c_.prototype,"abilities",void 0),E([Zs("abilities")],c_.prototype,"castAbilities",null),E([k()],c_.prototype,"activeAttachmentInfo",void 0),E([k()],c_.prototype,"activeFileInfo",void 0),E([k({readOnly:!0,type:ett})],c_.prototype,"attachmentInfos",void 0),E([k()],c_.prototype,"fileInfos",void 0),E([k({type:js})],c_.prototype,"graphic",void 0),E([k()],c_.prototype,"mode",void 0),E([k({readOnly:!0})],c_.prototype,"state",null),E([k()],c_.prototype,"filesEnabled",void 0),E([k({readOnly:!0})],c_.prototype,"supportsResizeAttachments",null),c_=E([ht("esri.widgets.Attachments.AttachmentsViewModel")],c_);const zEe=c_;function ttt(t){const e=t.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 fri(t){const e=zl("esri/themes/base/images/files/");return t?t==="text/plain"?`${e}text-32.svg`:t==="application/pdf"?`${e}pdf-32.svg`:t==="text/csv"?`${e}csv-32.svg`:t==="application/gpx+xml"?`${e}gpx-32.svg`:t==="application/x-dwf"?`${e}cad-32.svg`:t==="application/postscript"||t==="application/json"||t==="text/xml"||t==="model/vrml"?`${e}code-32.svg`:t==="application/x-zip-compressed"||t==="application/x-7z-compressed"||t==="application/x-gzip"||t==="application/x-tar"||t==="application/x-gtar"||t==="application/x-bzip2"||t==="application/gzip"||t==="application/x-compress"||t==="application/x-apple-diskimage"||t==="application/x-rar-compressed"||t==="application/zip"?`${e}zip-32.svg`:t.includes("image/")?`${e}image-32.svg`:t.includes("audio/")?`${e}sound-32.svg`:t.includes("video/")?`${e}video-32.svg`:t.includes("msexcel")||t.includes("ms-excel")||t.includes("spreadsheetml")?`${e}excel-32.svg`:t.includes("msword")||t.includes("ms-word")||t.includes("wordprocessingml")?`${e}word-32.svg`:t.includes("powerpoint")||t.includes("presentationml")?`${e}report-32.svg`:`${e}generic-32.svg`:`${e}generic-32.svg`}function Vf(t){return(e,i)=>{e.hasOwnProperty("_messageBundleProps")||(e._messageBundleProps=e._messageBundleProps?e._messageBundleProps.slice():[]),e._messageBundleProps.push({bundlePath:t,propertyName:i})}}var mri=function(t){return{vnodeSelector:"",properties:void 0,children:void 0,text:t.toString(),domNode:null}},itt=function(t,e){for(var i=0,r=t.length;ithis.viewModel?.attachmentInfos,"change",()=>this.scheduleRender()),ku(()=>this.viewModel?.fileInfos,"change",()=>this.scheduleRender()),Qi(()=>this.viewModel?.mode,()=>this._modeChanged(),Fo)])}loadDependencies(){return Promise.all([Promise.resolve().then(()=>rLe)])}get abilities(){return this.viewModel.abilities}set abilities(e){this.viewModel.abilities=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{...rtt,...e}}addAttachment(){const{_addAttachmentForm:e,viewModel:i}=this;return this._set("submitting",!0),this._set("error",null),i.addAttachment(e).then(r=>(this._set("submitting",!1),this._set("error",null),i.mode="view",r)).catch(r=>{throw this._set("submitting",!1),this._set("error",new st("attachments:add-attachment",this.messages.addErrorMessage,r)),r})}deleteAttachment(e){const{viewModel:i}=this;return this._set("submitting",!0),this._set("error",null),i.deleteAttachment(e).then(r=>(this._set("submitting",!1),this._set("error",null),i.mode="view",r)).catch(r=>{throw this._set("submitting",!1),this._set("error",new st("attachments:delete-attachment",this.messages.deleteErrorMessage,r)),r})}updateAttachment(){const{viewModel:e}=this,{_updateAttachmentForm:i}=this;return this._set("submitting",!0),this._set("error",null),e.updateAttachment(i).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 st("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,i=e.updateFile(this.selectedFile,this._updateAttachmentForm,e.activeFileInfo);return e.mode="view",i}deleteFile(e){const i=this.viewModel.deleteFile(e||this.viewModel.activeFileInfo?.file);return this.viewModel.mode="view",i}render(){const{submitting:e,viewModel:i}=this,{state:r}=i;return ki("div",{class:this.classes(On.base,On.esriWidget)},e?this.renderProgressBar():null,r==="loading"?this.renderLoading():this.renderAttachments(),this.renderErrorMessage())}renderErrorMessage(){const{error:e,visibleElements:i}=this;return e&&i.errorMessage?ki("div",{key:"error-message",class:On.errorMessage},e.message):null}renderAttachments(){const{activeFileInfo:e,mode:i,activeAttachmentInfo:r}=this.viewModel;return i==="add"?this.renderAddForm():i==="edit"?this.renderDetailsForm(r||e):this.renderAttachmentContainer()}renderLoading(){return ki("div",{class:On.loaderContainer,key:"loader"},ki("div",{class:On.loader}))}renderProgressBar(){return this.visibleElements.progressBar?ki("div",{class:On.progressBar,key:"progress-bar"}):null}renderAddForm(){const{submitting:e,selectedFile:i}=this,r=e||!i,n=this.visibleElements.cancelAddButton?ki("button",{type:"button",bind:this,disabled:e,onclick:this._cancelForm,class:this.classes(On.esriButton,On.esriButtonTertiary,On.esriButtonSmall,On.esriButtonHalf,e&&On.buttonDisabled)},this.messages.cancel):null,s=this.visibleElements.addSubmitButton?ki("button",{type:"submit",disabled:r,class:this.classes(On.esriButton,On.esriButtonSecondary,On.esriButtonSmall,On.esriButtonHalf,{[On.buttonDisabled]:r})},this.messages.add):null,o=i?ki("span",{key:"file-name",class:On.fileName},i.name):null,a=ki("form",{bind:this,afterCreate:VB,afterRemoved:bQe,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},ki("fieldset",{class:On.fileFieldset},o,ki("label",{class:this.classes(On.fileLabel,On.esriButton,On.esriButtonSecondary)},i?this.messages.changeFile:this.messages.selectFile,ki("input",{class:On.fileInput,type:"file",name:"attachment",bind:this,onchange:this._handleFileInputChange}))),s,n);return ki("div",{key:"add-form-container",class:On.formNode},a)}renderDetailsForm(e){const{visibleElements:i,viewModel:r,selectedFile:n,submitting:s}=this,{abilities:o}=r,a=s||!n;let l,c,d,p;n?(l=n.type,c=n.name,d=n.size):e&&"file"in e?(l=e.file.type,c=e.file.name,d=e.file.size):e&&"contentType"in e&&(l=e.contentType,c=e.name,d=e.size,p=e.url);const y=o.editing&&o.operations?.delete&&i.deleteButton?ki("button",{key:"delete-button",type:"button",disabled:s,bind:this,onclick:V=>this._submitDeleteAttachment(V,e),class:this.classes(On.esriButton,On.esriButtonSmall,On.esriButtonTertiary,On.deleteButton,{[On.buttonDisabled]:s})},this.messages.delete):void 0,v=o.editing&&o.operations?.update&&i.updateButton?ki("button",{disabled:a,key:"update-button",type:"submit",class:this.classes(On.esriButton,On.esriButtonSmall,On.esriButtonThird,{[On.buttonDisabled]:a})},this.messages.update):void 0,S=this.visibleElements.cancelUpdateButton?ki("button",{disabled:s,key:"cancel-button",type:"button",bind:this,onclick:this._cancelForm,class:this.classes(On.esriButton,On.esriButtonSmall,On.esriButtonTertiary,On.esriButtonThird,{[On.buttonDisabled]:s})},this.messages.cancel):void 0,I=o.editing&&o.operations?.update?ki("fieldset",{key:"file",class:On.fileFieldset},ki("span",{key:"file-name",class:On.fileName},c),ki("label",{class:this.classes(On.fileLabel,On.esriButton,On.esriButtonSecondary)},this.messages.changeFile,ki("input",{class:On.fileInput,type:"file",name:"attachment",bind:this,onchange:this._handleFileInputChange}))):void 0,O=ki("fieldset",{key:"size",class:On.metadataFieldset},ki("label",null,kii(this.messagesUnits,d??0))),L=ki("fieldset",{key:"content-type",class:On.metadataFieldset},ki("label",null,l)),N=ye(p)?ki("a",{class:On.itemLink,href:p,rel:"noreferrer",target:"_blank"},this.renderImageMask(e,400),ki("div",{class:On.itemLinkOverlay},ki("span",{class:On.itemLinkOverlayIcon},ki("calcite-icon",{icon:"launch"})))):this.renderImageMask(e,400),G=ki("form",{bind:this,afterCreate:VB,afterRemoved:bQe,"data-node-ref":"_updateAttachmentForm",onsubmit:V=>this._submitUpdateAttachment(V,e)},ki("div",{class:On.metadata},O,L),I,ki("div",{class:On.actions},y,S,v));return ki("div",{key:"edit-form-container",class:On.formNode},N,G)}renderImageMask(e,i){return e?"file"in e?this.renderGenericImageMask(e.file.name,e.file.type):this.renderImageMaskForAttachment(e,i):null}renderGenericImageMask(e,i){const{supportsResizeAttachments:r}=this.viewModel,n=fri(i),s={[On.itemImageResizable]:r};return ki("div",{class:this.classes(On.itemMaskIcon,On.itemMask)},ki("img",{title:e,alt:e,src:n,class:this.classes(s,On.itemImage)}))}renderImageMaskForAttachment(e,i){const{supportsResizeAttachments:r}=this.viewModel;if(!e)return null;const{contentType:n,name:s,url:o}=e;if(!r||!ttt(n))return this.renderGenericImageMask(s,n);const a=this._getCSSTransform(e),l=a?{transform:a,"image-orientation":"none"}:{},c=`${o}${o?.includes("?")?"&":"?"}w=${i}`,d={[On.itemImageResizable]:r};return ki("div",{class:this.classes(On.itemMask)},ki("img",{styles:l,alt:s,title:s,src:c,class:this.classes(d,On.itemImage)}))}renderFile(e){const{file:i}=e;return ki("li",{class:On.item,key:i},ki("button",{key:"details-button",bind:this,class:On.itemButton,title:this.messages.attachmentDetails,"aria-label":this.messages.attachmentDetails,onclick:()=>this._startEditFile(e),type:"button"},this.renderImageMask(e),ki("label",{class:On.itemLabel},ki("span",{class:On.itemFilename},i.name||this.messages.noTitle),ki("span",{"aria-hidden":"true",class:this.classes(On.itemChevronIcon,mT(this.container)?On.iconLeft:On.iconRight)}))))}renderAttachmentInfo({attachmentInfo:e,displayType:i}){const{viewModel:r,effectiveDisplayType:n}=this,{abilities:s,supportsResizeAttachments:o}=r,{contentType:a,name:l,url:c}=e,d=this.renderImageMask(e,i==="list"?48:400),p=s.editing?ki("span",{"aria-hidden":"true",class:this.classes(On.itemChevronIcon,mT(this.container)?On.iconLeft:On.iconRight)}):null,y=[d,n==="preview"&&o&&ttt(a)?null:ki("label",{class:On.itemLabel},ki("span",{class:On.itemFilename},l||this.messages.noTitle),p)],v=s.editing?ki("button",{key:"details-button",bind:this,class:On.itemButton,title:this.messages.attachmentDetails,"aria-label":this.messages.attachmentDetails,"data-attachment-info-id":e.id,onclick:()=>this._startEditAttachment(e),type:"button"},y):ki("a",{key:"details-link",class:On.itemButton,href:c??void 0,target:"_blank"},y);return ki("li",{class:On.item,key:e},v)}renderAttachmentContainer(){const{effectiveDisplayType:e,viewModel:i,visibleElements:r}=this,{attachmentInfos:n,abilities:s,fileInfos:o}=i,a=!!n?.length,l=!!o?.length,c={[On.containerList]:e!=="preview",[On.containerPreview]:e==="preview"},d=s.editing&&s.operations?.add&&r.addButton?ki("button",{bind:this,onclick:()=>this._startAddAttachment(),class:this.classes(On.esriButton,On.esriButtonTertiary,On.addAttachmentButton),type:"button"},ki("span",{"aria-hidden":"true",class:this.classes(On.itemAddIcon,On.iconPlus)}),this.messages.add):void 0,p=a?ki("ul",{key:"attachments-list",class:On.items},n.toArray().map(S=>this.renderAttachmentInfo({attachmentInfo:S,displayType:e}))):void 0,y=l?ki("ul",{key:"file-list",class:On.items},o.toArray().map(S=>this.renderFile(S))):void 0,v=l||a?void 0:ki("div",{class:On.empty},this.messages.noAttachments);return ki("div",{key:"attachments-container",class:this.classes(On.container,c)},p,y,v,d)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(e){const i=e.target,r=i&&i.files&&i.files.item(0);this._set("selectedFile",r)}_submitDeleteAttachment(e,i){e.preventDefault(),i&&("file"in i?this.deleteFile(i.file):i&&this.deleteAttachment(i))}_submitAddAttachment(e){e.preventDefault(),this.viewModel.filesEnabled?this.addFile():this.addAttachment()}_submitUpdateAttachment(e,i){e.preventDefault(),i&&"file"in i?this.updateFile():this.updateAttachment()}_startEditAttachment(e){const{viewModel:i}=this;i.activeFileInfo=null,i.activeAttachmentInfo=e,i.mode="edit"}_startEditFile(e){const{viewModel:i}=this;i.activeAttachmentInfo=null,i.activeFileInfo=e,i.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(e){e.preventDefault(),this.viewModel.mode="view"}_getCSSTransform(e){const{orientationInfo:i}=e;return!this._supportsImageOrientation&&i?[i.rotation?`rotate(${i.rotation}deg)`:"",i.mirrored?"scaleX(-1)":""].join(" "):""}};E([k()],p0.prototype,"abilities",null),E([k()],p0.prototype,"displayType",void 0),E([k({readOnly:!0})],p0.prototype,"effectiveDisplayType",null),E([k()],p0.prototype,"graphic",null),E([k()],p0.prototype,"label",null),E([k(),Vf("esri/widgets/Attachments/t9n/Attachments")],p0.prototype,"messages",void 0),E([k(),Vf("esri/core/t9n/Units")],p0.prototype,"messagesUnits",void 0),E([k({readOnly:!0})],p0.prototype,"selectedFile",void 0),E([k({readOnly:!0})],p0.prototype,"submitting",void 0),E([k({readOnly:!0})],p0.prototype,"error",void 0),E([k({type:zEe})],p0.prototype,"viewModel",void 0),E([k()],p0.prototype,"visibleElements",void 0),E([Zs("visibleElements")],p0.prototype,"castVisibleElements",null),p0=E([ht("esri.widgets.Attachments")],p0);const yri=p0;let GY=class extends zEe{constructor(e){super(e),this.description=null,this.title=null}};E([k()],GY.prototype,"description",void 0),E([k()],GY.prototype,"title",void 0),GY=E([ht("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],GY);const WEe=GY,vri={heading:"esri-widget__heading"};function vle({level:t,class:e,...i},r){const n=_ri(t);return ki(`h${n}`,{...i,class:_Qe(vri.heading,e),role:"heading","aria-level":String(n)},r)}function _ri(t){return Hl(Math.ceil(t),1,6)}const qEe="esri-feature-element-info",YEe={base:qEe,title:`${qEe}__title`,description:`${qEe}__description`};let KB=class extends Gf{constructor(e,i){super(e,i),this.description=null,this.headingLevel=2,this.title=null}render(){return ki("div",{class:YEe.base},this.renderTitle(),this.renderDescription())}renderTitle(){const{title:e}=this;return e?ki(vle,{level:this.headingLevel,class:YEe.title},e):null}renderDescription(){const{description:e}=this;return e?ki("div",{key:"description",class:YEe.description},e):null}};E([k()],KB.prototype,"description",void 0),E([k()],KB.prototype,"headingLevel",void 0),E([k()],KB.prototype,"title",void 0),KB=E([ht("esri.widgets.Feature.support.FeatureElementInfo")],KB);const _le=KB,bri={base:"esri-feature-attachments"};let yT=class extends Gf{constructor(e,i){super(e,i),this._featureElementInfo=null,this.attachmentsWidget=new yri,this.headingLevel=2,this.viewModel=new WEe}initialize(){this._featureElementInfo=new _le,this.addHandles([Qi(()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel],()=>this._setupFeatureElementInfo(),Fo),Qi(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,Fo)])}destroy(){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 ki("div",{class:bri.base},this._featureElementInfo?.render(),e?.render())}_setupFeatureElementInfo(){const{description:e,title:i,headingLevel:r}=this;this._featureElementInfo?.set({description:e,title:i,headingLevel:r})}};E([k({readOnly:!0})],yT.prototype,"attachmentsWidget",void 0),E([k()],yT.prototype,"description",null),E([k()],yT.prototype,"displayType",null),E([k()],yT.prototype,"graphic",null),E([k()],yT.prototype,"headingLevel",void 0),E([k()],yT.prototype,"title",null),E([k({type:WEe})],yT.prototype,"viewModel",void 0),yT=E([ht("esri.widgets.Feature.FeatureAttachments")],yT);const wri=yT;let gM=class extends Nd(fn){constructor(e){super(e),this._loadingPromise=null,this.created=null,this.creator=null,this.destroyer=null,this.graphic=null,this.handles.add(Qi(()=>this.creator,i=>{this._destroyContent(),this._createContent(i)},Fo))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const{created:e,graphic:i,destroyer:r}=this;e&&i&&(yle(r,{graphic:i}).catch(()=>null),this._set("created",null))}async _createContent(e){const i=this.graphic;if(!i||!e)return;const r=yle(e,{graphic:i}).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))}};E([k({readOnly:!0})],gM.prototype,"created",void 0),E([k()],gM.prototype,"creator",void 0),E([k()],gM.prototype,"destroyer",void 0),E([k({type:js})],gM.prototype,"graphic",void 0),E([k({readOnly:!0})],gM.prototype,"state",null),gM=E([ht("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],gM);const ble=gM;function Y1(){return function(t,e){if(!t[e])throw new TypeError(`Cannot auto bind undefined function '${e}'`);return{value:Sri(t[e])}}}function xri(t){const e=t?.type;return t instanceof KeyboardEvent||e==="keyup"||e==="keydown"||e==="keypress"}function Sri(t){return function(e,...i){xri(e)?Jei(e.key)&&(e.preventDefault(),e.stopPropagation(),e.target.click()):t.call(this,e,...i)}}function Cri(t){return e=>{e.hasOwnProperty("_delegatedEventNames")||(e._delegatedEventNames=e._delegatedEventNames?e._delegatedEventNames.slice():[]);const i=e._delegatedEventNames,r=Array.isArray(t)?t:Tri(t);i.push(...r)}}function Tri(t){return t.split(",").map(e=>e.trim())}const ntt="calcite-mode-";function Eri(){return getComputedStyle(document.body).getPropertyValue("--esri-calcite-mode-name").replace(/\s|'|"/g,"")}function wle(){return Eri().startsWith("dark")}function Iri(){return`${ntt}${wle()?"dark":"light"}`}function Ari(t){Pri(t),t.classList.add(Iri())}function Pri(t){Array.from(t.classList).forEach(e=>{e.startsWith(ntt)&&t.classList.remove(e)})}function XEe(t){return t&&typeof t.render=="function"}function Ori(t){return t&&typeof t.postMixInProperties=="function"&&typeof t.buildRendering=="function"&&typeof t.postCreate=="function"&&typeof t.startup=="function"}const KEe="esri-feature-content",JEe={base:KEe,loaderContainer:`${KEe}__loader-container`,loader:`${KEe}__loader`};let JB=class extends Gf{constructor(e,i){super(e,i),this.viewModel=null,this._addTargetToAnchors=r=>{Array.from(r.querySelectorAll("a")).forEach(n=>{Vet(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)}renderLoading(){return ki("div",{class:JEe.loaderContainer,key:"loader"},ki("div",{class:JEe.loader}))}renderCreated(){const e=this.viewModel?.created;return e?e instanceof HTMLElement?ki("div",{key:e,bind:e,afterCreate:this._attachToNode}):XEe(e)?ki("div",{key:e},!e.destroyed&&e.render()):ki("div",{key:e,innerHTML:e,afterCreate:this._addTargetToAnchors}):null}render(){const e=this.viewModel?.state;return ki("div",{class:JEe.base},e==="loading"?this.renderLoading():this.renderCreated())}_attachToNode(e){const i=this;e.appendChild(i)}};E([k()],JB.prototype,"creator",null),E([k()],JB.prototype,"graphic",null),E([k({type:ble})],JB.prototype,"viewModel",void 0),JB=E([ht("esri.widgets.Feature.FeatureContent")],JB);const xle=JB;let KA=class extends fn{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:i}=this,r=[];return i?.forEach(n=>{if(!(!n.hasOwnProperty("visible")||n.visible))return;const s=n.clone();s.label=Uet(s,e),r.push(s)}),r}};E([k()],KA.prototype,"attributes",void 0),E([k({type:[Wne]})],KA.prototype,"expressionInfos",void 0),E([k()],KA.prototype,"description",void 0),E([k({type:[hW]})],KA.prototype,"fieldInfos",void 0),E([k({readOnly:!0})],KA.prototype,"formattedFieldInfos",null),E([k()],KA.prototype,"title",void 0),KA=E([ht("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],KA);const Sle=KA,Rri=[{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 Mri(t){let e=null;return Rri.some(i=>(i.pattern.test(t)&&(e=i),!!e)),e}function Dri(t,e){if(typeof e!="string"||!e)return e;const i=Mri(e);if(!i)return e;const r=e.match(i.pattern),n=r&&r[2],s=Kx(Kx(i.label,{messages:t,hierPart:n}),{appName:i.appName}),o=i.target?` target="${i.target}"`:"",a=i.target==="_blank"?' rel="noreferrer"':"";return e.replace(i.pattern,`${s}`)}const Cle="esri-feature-fields",VY={base:Cle,fieldHeader:`${Cle}__field-header`,fieldData:`${Cle}__field-data`,fieldDataDate:`${Cle}__field-data--date`,esriTable:"esri-widget__table"};let B2=class extends Gf{constructor(e,i){super(e,i),this._featureElementInfo=null,this.viewModel=new Sle,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new _le,this.addHandles(Qi(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),Fo))}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}renderFieldInfo(e,i){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):Dri(this.messagesURIUtils,o),c={[VY.fieldDataDate]:a};return ki("tr",{key:`fields-element-info-row-${n}-${i}`},ki("th",{key:`fields-element-info-row-header-${n}-${i}`,class:VY.fieldHeader,innerHTML:s}),ki("td",{key:`fields-element-info-row-data-${n}-${i}`,class:this.classes(VY.fieldData,c),innerHTML:l}))}renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e?.length?ki("table",{class:VY.esriTable,summary:this.messages.fieldsSummary},ki("tbody",null,e.map((i,r)=>this.renderFieldInfo(i,r)))):null}render(){return ki("div",{class:VY.base},this._featureElementInfo?.render(),this.renderFields())}_setupFeatureElementInfo(){const{description:e,title:i}=this;this._featureElementInfo?.set({description:e,title:i})}_forceLTR(e){return`‎${e}`}};E([k()],B2.prototype,"attributes",null),E([k()],B2.prototype,"description",null),E([k()],B2.prototype,"expressionInfos",null),E([k()],B2.prototype,"fieldInfos",null),E([k()],B2.prototype,"title",null),E([k({type:Sle,nonNullable:!0})],B2.prototype,"viewModel",void 0),E([k(),Vf("esri/widgets/Feature/t9n/Feature")],B2.prototype,"messages",void 0),E([k(),Vf("esri/widgets/support/t9n/uriUtils")],B2.prototype,"messagesURIUtils",void 0),B2=E([ht("esri.widgets.Feature.FeatureFields")],B2);const stt=B2,Fri={maximumFractionDigits:20};function Lri(t){return aA(t,Fri)}const kri="<",Nri=">",$ri=Nne("short-date");function Bri(t,e,i,r){let n="";e===0?n=`${kri} `:e===i&&(n=`${Nri} `);let s=null;return s=r?kC(t,$ri):Lri(t),n+s}const Gri=new $r([64,64,64]);function Vri(t,e){const i=[],r=t.length-1;return t.length===5?i.push(0,2,4):i.push(0,r),t.map((n,s)=>i.includes(s)?Bri(n,s,r,e):null)}async function Uri(t,e,i){let r=!1,n=[],s=[];if(t.stops){const c=t.stops;n=c.map(d=>d.value),r=c.some(d=>!!d.label),r&&(s=c.map(d=>d.label))}const o=n[0],a=n[n.length-1];if(o==null&&a==null)return null;const l=r?null:Vri(n,i??!1);return(await Promise.all(n.map(async(c,d)=>({value:c,color:t.type==="opacity"?await jri(c,t,e):(await Promise.resolve().then(()=>Rse)).getColor(t,c),label:r?s[d]:l?.[d]??""})))).reverse()}async function jri(t,e,i=Gri){const r=new $r(i),n=(await Promise.resolve().then(()=>Rse)).getOpacity(e,t);return n!=null&&(r.a=n),r}function zri(t){if(!t.colorStops)return[];const e=[...t.colorStops].filter(r=>r.color?.a>0);let i=e.length-1;if(e&&e[0]){const r=e[i];r&&r.ratio!==1&&(e.push(new QW({ratio:1,color:r.color})),i++)}return e.map((r,n)=>{let s="";return n===0?s=t.legendOptions?.minLabel||"low":n===i&&(s=t.legendOptions?.maxLabel||"high"),{color:r.color,label:s,ratio:r.ratio}}).reverse()}Ei.getLogger("esri.renderers.support.utils");async function X1(t,e,i){xC(t,e,()=>[]).push(...i)}async function Hri(t){const e=new Map;if(!t)return e;if("visualVariables"in t&&t.visualVariables){const i=t.visualVariables.filter(r=>r.type==="color");for(const r of i){const n=(await Uri(r)??[]).map(s=>s.color);await X1(e,r.field||r.valueExpression,n)}}if(t.type==="heatmap"){const i=zri(t).map(r=>r.color);await X1(e,t.field||t.valueExpression,i)}else if(t.type==="pie-chart"){for(const i of t.attributes)await X1(e,i.field||i.valueExpression,[i.color]);await X1(e,"default",[t?.othersCategory?.color,bB(t.backgroundFillSymbol,null)])}else if(t.type==="dot-density"){for(const i of t.attributes)await X1(e,i.field||i.valueExpression,[i.color]);await X1(e,"default",[t.backgroundColor])}else if(t.type==="unique-value")if(t.authoringInfo?.type==="predominance")for(const i of t.uniqueValueInfos??[])await X1(e,i.value.toString(),[bB(i.symbol,null)]);else{const i=(t.uniqueValueInfos??[]).map(a=>bB(a.symbol,null)),{field:r,field2:n,field3:s,valueExpression:o}=t;(r||o)&&await X1(e,r||o,i),n&&await X1(e,n,i),s&&await X1(e,s,i)}else if(t.type==="class-breaks"){const i=t.classBreakInfos.map(s=>bB(s.symbol,null)),{field:r,valueExpression:n}=t;await X1(e,r??n,i)}else t.type==="simple"&&await X1(e,"default",[bB(t.symbol,null)]);return"defaultSymbol"in t&&t.defaultSymbol&&await X1(e,"default",[bB(t.defaultSymbol,null)]),e.forEach((i,r)=>{const n=fkt(i.filter(Boolean),(s,o)=>JSON.stringify(s)===JSON.stringify(o));e.set(r,n)}),e}const Wri="esri.widgets.Feature.support.relatedFeatureUtils",ott=Ei.getLogger(Wri),att=new Map;function Tle(t){if(!XA(t))return null;const[e,i]=t.split("/").slice(1);return{layerId:e,fieldName:i}}function qri(t,e){if(!e.relationships)return null;let i=null;const{relationships:r}=e;return r.some(n=>n.id===parseInt(t,10)&&(i=n,!0)),i}function Yri({originRelationship:t,relationships:e,layerId:i}){let r=null;return e&&e.some(n=>(`${n.relatedTableId}`===i&&n.id===t?.id&&(r=n),!!r)),r}function Xri(t,e){const i=e.toLowerCase();for(const r in t)if(r.toLowerCase()===i)return t[r];return null}function Kri(t,e){const i=qri(t,e);if(i)return{url:`${e.url}/${i.relatedTableId}`,sourceSpatialReference:e.spatialReference,relation:i,relatedFields:[],outStatistics:[]}}function Jri(t,e){if(!e||!t)return;const{features:i,statsFeatures:r}=t,n=i&&i.value;e.relatedFeatures=n?n.features:[];const s=r&&r.value;e.relatedStatsFeatures=s?s.features:[]}function Zri(t,e,i,r){const n=new eT;return n.outFields=["*"],n.relationshipId=typeof e.id=="number"?e.id:parseInt(e.id,10),n.objectIds=[t.attributes[i.objectIdField]],i.queryRelatedFeatures?.(n,r)??Promise.resolve({})}function Qri(t,e,i){let r=0;const n=[];for(;rI.attributes[s.objectIdField]);if(l?.length&&s.supportsStatistics){const I=new Ss;I.where=Qri(s.objectIdField,S,1e3),I.outFields=a,I.outStatistics=l,I.sourceSpatialReference=d;const O={features:Promise.resolve(v),statsFeatures:PB(c,I)};return bu(O)}}const y=p?.keyField;if(y){const v=r9(sni(s.fields,y)),S=Xri(t.attributes,o.keyField),I=v?`${y}=${S}`:`${y}='${S}'`,O=PB(c,new Ss({where:I,outFields:e.relatedFields,sourceSpatialReference:d}),r),L=e.outStatistics&&e.outStatistics.length>0&&s.supportsStatistics?PB(c,new Ss({where:I,outFields:e.relatedFields,outStatistics:e.outStatistics,sourceSpatialReference:d}),r):null,N={features:O};return L&&(N.statsFeatures=L),bu(N)}return null}function tni(t,e){return ir(t,{query:{f:"json"},signal:e&&e.signal})}function ini({relatedInfos:t,layer:e},i){const r={};return t.forEach((n,s)=>{const{relation:o}=n;if(!o){const p=new st("relation-required","A relation is required on a layer to retrieve related records.");throw ott.error(p),p}const{relatedTableId:a}=o;if(typeof a!="number"){const p=new st("A related table ID is required on a layer to retrieve related records.");throw ott.error(p),p}const l=`${e.url}/${a}`,c=att.get(l),d=c||tni(l);c||att.set(l,d),r[s]=d}),Vg(bu(r),i)}function rni({graphic:t,relatedInfos:e,layer:i},r){const n={};return e.forEach((s,o)=>{s.layerInfo&&(n[o]=eni(t,s,i,r))}),bu(n)}function nni({relatedInfo:t,fieldName:e,fieldInfo:i}){if(t.relatedFields?.push(e),i.statisticType){const r=new coe({statisticType:i.statisticType,onStatisticField:e,outStatisticFieldName:e});t.outStatistics?.push(r)}}function sni(t,e){if(t!=null){e=e.toLowerCase();for(const i of t)if(i&&i.name.toLowerCase()===e)return i}return null}const ltt={chartAnimation:!0};let Uf=class extends fn{constructor(e){super(e),this.abilities={...ltt},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{...ltt,...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:i}=this,r=(e+i)%i;this.activeMediaInfoIndex=r}_pageContentElementMedia(e){const{activeMediaInfoIndex:i}=this,r=i+e;this._setContentElementMedia(r)}_formatMediaInfos(){const{mediaInfos:e,layer:i}=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=nk({attributes:r,fieldInfoMap:o,globalAttributes:n,expressionAttributes:s,layer:i,text:l.title}),l.caption=nk({attributes:r,fieldInfoMap:o,globalAttributes:n,expressionAttributes:s,layer:i,text:l.caption}),l.altText=nk({attributes:r,fieldInfoMap:o,globalAttributes:n,expressionAttributes:s,layer:i,text:l.altText}),l.type==="image"){const{value:c}=l;return this._setImageValue({value:c,formattedAttributes:n,layer:i}),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:c}=l;return this._setChartValue({value:c,chartType:l.type,attributes:r,formattedAttributes:n,layer:i,expressionAttributes:s}),l}return null}).filter(ye)??[]}_setImageValue(e){const i=this.fieldInfoMap??new Map,{value:r,formattedAttributes:n,layer:s}=e,{linkURL:o,sourceURL:a}=r;if(a){const l=VEe(a,s);r.sourceURL=GEe({formattedAttributes:n,template:l,fieldInfoMap:i})}if(o){const l=VEe(o,s);r.linkURL=GEe({formattedAttributes:n,template:l,fieldInfoMap:i})}}_setChartValue(e){const{value:i,attributes:r,formattedAttributes:n,chartType:s,layer:o,expressionAttributes:a}=e,{popupTemplate:l,relatedInfos:c}=this,{fields:d,normalizeField:p}=i,y=o;if(i.fields=Yii(d,y),p&&(i.normalizeField=$Y(p,y)),!d.some(S=>!!(n[S]!=null||XA(S)&&c?.size)))return;const v=l?.fieldInfos??[];d.forEach(S=>{if(XA(S))return void(i.series=[...i.series,...this._getRelatedChartInfos({fieldInfos:v,fieldName:S,formattedAttributes:n,chartType:s,value:i})]);const I=this._getChartOption({value:i,attributes:r,chartType:s,formattedAttributes:n,expressionAttributes:a,fieldName:S,fieldInfos:v});i.series.push(I)})}_getRelatedChartInfos(e){const{fieldInfos:i,fieldName:r,formattedAttributes:n,chartType:s,value:o}=e,a=[],l=Tle(r),c=l&&this.relatedInfos?.get(l.layerId.toString());if(!c)return a;const{relatedFeatures:d,relation:p}=c;if(!p||!d)return a;const{cardinality:y}=p;return d.forEach(v=>{const{attributes:S}=v;S&&Object.keys(S).forEach(I=>{I===l.fieldName&&a.push(this._getChartOption({value:o,attributes:S,formattedAttributes:n,fieldName:r,chartType:s,relatedFieldName:I,hasMultipleRelatedFeatures:d?.length>1,fieldInfos:i}))})}),y==="one-to-many"||y==="many-to-many"?a:[a[0]]}_getTooltip({label:e,value:i,chartType:r}){return r==="pie-chart"?`${e}`:`${e}: ${i}`}_getChartOption(e){const{value:i,attributes:r,formattedAttributes:n,expressionAttributes:s,fieldName:o,relatedFieldName:a,fieldInfos:l,chartType:c,hasMultipleRelatedFeatures:d}=e,p=this.layer,y=this.fieldInfoMap??new Map,{normalizeField:v,tooltipField:S}=i,I=v?XA(v)?r[Tle(v).fieldName]:r[v]:null,O=$Ee(o)&&s&&s[o]!==void 0?s[o]:a&&r[a]!==void 0?r[a]:r[o]!==void 0?r[o]:n[o],L=new jje({fieldName:o,value:O===void 0?null:O&&I?O/I:O});if(XA(o)){const X=y.get(o.toLowerCase()),te=S&&y.get(S.toLowerCase()),re=X?.fieldName??o,fe=d&&S?Tle(S).fieldName:te?.fieldName??S,ge=d&&fe?r[fe]:n[fe]??X?.label??X?.fieldName??a,_e=d&&a?r[a]:n[re];return L.tooltip=this._getTooltip({label:ge,value:_e,chartType:c}),L}const N=Het(l,o),G=$Y(o,p),V=S&&n[S]!==void 0?n[S]:Uet(N||new hW({fieldName:G}),this.popupTemplate?.expressionInfos),Y=n[G];return L.tooltip=this._getTooltip({label:V,value:Y,chartType:c}),L}};E([k()],Uf.prototype,"abilities",void 0),E([Zs("abilities")],Uf.prototype,"castAbilities",null),E([k()],Uf.prototype,"activeMediaInfoIndex",void 0),E([k({readOnly:!0})],Uf.prototype,"activeMediaInfo",null),E([k()],Uf.prototype,"attributes",void 0),E([k()],Uf.prototype,"description",void 0),E([k()],Uf.prototype,"fieldInfoMap",void 0),E([k()],Uf.prototype,"formattedAttributes",void 0),E([k()],Uf.prototype,"expressionAttributes",void 0),E([k({readOnly:!0})],Uf.prototype,"formattedMediaInfos",null),E([k()],Uf.prototype,"isAggregate",void 0),E([k()],Uf.prototype,"layer",void 0),E([k({readOnly:!0})],Uf.prototype,"formattedMediaInfoCount",null),E([k()],Uf.prototype,"mediaInfos",void 0),E([k()],Uf.prototype,"popupTemplate",void 0),E([k()],Uf.prototype,"relatedInfos",void 0),E([k()],Uf.prototype,"title",void 0),Uf=E([ht("esri.widgets.Feature.FeatureMedia.FeatureMediaViewModel")],Uf);const ok=Uf;var utt=["#ffffff","#858585","#ffbebe","#ffebbe","#ffebaf","#ffffbe","#e9ffbe","#d3ffbe","#beffe8","#bee8ff","#bed2ff","#e8beff","#ffbee8","#ebebeb","#707070","#ff7f7f","#ffa77f","#ffd37f","#ffff73","#d1ff73","#a3ff73","#73ffdf","#73dfff","#73b2ff","#df73ff","#ff73df","#d6d6d6","#5c5c5c","#ff0000","#ff5500","#ffaa00","#ffff00","#aaff00","#55ff00","#00ffc5","#00c5ff","#0070ff","#c500ff","#ff00c5","#c2c2c2","#474747","#e60000","#e64c00","#e69800","#e6e600","#98e600","#4ce600","#00e6a9","#00a9e6","#005ce6","#a900e6","#e600a9","#adadad","#242424","#a80000","#a83800","#a87000","#a8a800","#70a800","#38a800","#00a884","#0084a8","#004da8","#8400a8","#a80084","#999999","#1a1a1a","#730000","#732600","#734c00","#737300","#4c7300","#267300","#00734c","#004c73","#002673","#4c0073","#73004"],oni=[].concat(utt.slice(30,39),utt.slice(28,30).reverse()),ani=[{name:"default",colors:oni},{name:"cat-dark",colors:["#ed5151","#149ece","#a7c636","#9e559c","#fc921f","#ffde3e","#f789d8","#b7814a","#3caf99","#6b6bd6","#b54779","#7f7f7f"]},{name:"tropical-bliss",colors:["#fce138","#ff9399","#fcd27e","#f1983c","#a553b7","#b1a9d0","#6ecffc","#4c81cd","#fc6f84","#fc3e5a","#6af689","#48885c"]},{name:"desert-blooms",colors:["#102432","#144d59","#ffc730","#ed9310","#a64f1b","#661510","#d9351a","#b31515","#4a0932","#8c213f","#18382e","#2c6954"]},{name:"under-the-sea",colors:["#bf9727","#607100","#00734c","#704489","#01acca","#024e76","#f09100","#ea311f","#c6004b","#7570b3","#666666","#333333"]},{name:"vibrant-rainbow",colors:["#fffb00","#f5cb11","#9fd40c","#46e39c","#32b8a6","#7ff2fa","#ac08cc","#dd33ff","#eb7200","#e8a784","#bf2e2e","#6c7000"]},{name:"ocean-bay",colors:["#191921","#11495c","#78b1c2","#454f4b","#8f8f82","#9be0c0","#87b051","#f7ec88","#ebdcc1","#dbb658","#c43541","#75351e"]},{name:"prairie-summer",colors:["#332424","#751555","#d47013","#d68989","#211173","#82aad6","#7bfaeb","#6ec9a8","#6b6408","#eada40","#ccc54a","#1fc235"]},{name:"pastel-chalk",colors:["#fffd99","#f5e6a4","#c1d48c","#b8e3d0","#a0b8b5","#cbf7fa","#d791f2","#dfc1eb","#f2b983","#e8c4b2","#bf8e8e","#94995c"]},{name:"seq-yellow-orange-red-bright",colors:["#910000","#b1260b","#c0370f","#e05919","#ef6a1d","#ff7b22","#ffa143","#ffb454","#ffda74","#ffed85"]},{name:"seq-reds-bright",colors:["#57453b","#7b4238","#9f4036","#c23d33","#d7483c","#ec5244","#f3696c","#f9816c","#ffc4ae","#fff0dc"]},{name:"seq-purples-bright",colors:["#4e465c","#5a4a78","#695291","#775baa","#8663c3","#946bdc","#aa89e8","#c1a6f3","#d7c4ff","#e6e1ff"]},{name:"seq-blues-bright",colors:["#404d54","#435c6c","#48799d","#4b88b6","#4d96ce","#50a5e7","#74bbed","#98d0f3","#bce6f9","#e6faff"]},{name:"seq-greens-bright",colors:["#39544c","#386757","#368165","#359b73","#33b581","#4bc392","#64d2a2","#7ce0b3","#cbf6d9","#f4ffea"]},{name:"seq-browns-bright",colors:["#524834","#715b38","#8f6e3c","#ae8140","#cc9444","#eba748","#eeb664","#f0c47f","#f9e0b7","#fff8eb"]}];const ctt="en-us",ZEe=new Map([["ar",()=>Promise.resolve().then(()=>QVi).then(t=>t.a)],["bg-bg",()=>Promise.resolve().then(()=>rUi).then(t=>t.b)],["bs-ba",()=>Promise.resolve().then(()=>aUi).then(t=>t.b)],["ca-es",()=>Promise.resolve().then(()=>hUi).then(t=>t.c)],["cs-cz",()=>Promise.resolve().then(()=>mUi).then(t=>t.c)],["da-dk",()=>Promise.resolve().then(()=>_Ui).then(t=>t.d)],["de-de",()=>Promise.resolve().then(()=>SUi).then(t=>t.d)],["de-ch",()=>Promise.resolve().then(()=>IUi).then(t=>t.d)],["el-gr",()=>Promise.resolve().then(()=>RUi).then(t=>t.e)],["en-us",()=>Promise.resolve().then(()=>LUi).then(t=>t.e)],["en-ca",()=>Promise.resolve().then(()=>BUi).then(t=>t.e)],["es-es",()=>Promise.resolve().then(()=>jUi).then(t=>t.e)],["et-ee",()=>Promise.resolve().then(()=>qUi).then(t=>t.e)],["fi-fi",()=>Promise.resolve().then(()=>JUi).then(t=>t.f)],["fr-fr",()=>Promise.resolve().then(()=>tji).then(t=>t.f)],["he-il",()=>Promise.resolve().then(()=>sji).then(t=>t.h)],["hr-hr",()=>Promise.resolve().then(()=>uji).then(t=>t.h)],["hu-hu",()=>Promise.resolve().then(()=>pji).then(t=>t.h)],["id-id",()=>Promise.resolve().then(()=>yji).then(t=>t.i)],["it-it",()=>Promise.resolve().then(()=>wji).then(t=>t.i)],["ja-jp",()=>Promise.resolve().then(()=>Tji).then(t=>t.j)],["ko-kr",()=>Promise.resolve().then(()=>Pji).then(t=>t.k)],["lt-lt",()=>Promise.resolve().then(()=>Dji).then(t=>t.l)],["lv-lv",()=>Promise.resolve().then(()=>Nji).then(t=>t.l)],["nb-no",()=>Promise.resolve().then(()=>Vji).then(t=>t.n)],["nl-nl",()=>Promise.resolve().then(()=>Hji).then(t=>t.n)],["pl-pl",()=>Promise.resolve().then(()=>Xji).then(t=>t.p)],["pt-br",()=>Promise.resolve().then(()=>Qji).then(t=>t.p)],["pt-pt",()=>Promise.resolve().then(()=>r7i).then(t=>t.p)],["ro-ro",()=>Promise.resolve().then(()=>a7i).then(t=>t.r)],["ru-ru",()=>Promise.resolve().then(()=>h7i).then(t=>t.r)],["sk-sk",()=>Promise.resolve().then(()=>m7i).then(t=>t.s)],["sl-sl",()=>Promise.resolve().then(()=>_7i).then(t=>t.s)],["sr-rs",()=>Promise.resolve().then(()=>S7i).then(t=>t.s)],["sv-se",()=>Promise.resolve().then(()=>I7i).then(t=>t.s)],["th-th",()=>Promise.resolve().then(()=>R7i).then(t=>t.t)],["tr-tr",()=>Promise.resolve().then(()=>L7i).then(t=>t.t)],["uk-ua",()=>Promise.resolve().then(()=>B7i).then(t=>t.u)],["vi-vn",()=>Promise.resolve().then(()=>j7i).then(t=>t.v)],["zh-cn",()=>Promise.resolve().then(()=>q7i).then(t=>t.z)],["zh-hk",()=>Promise.resolve().then(()=>Oxt).then(t=>t.z)],["zh-tw",()=>Promise.resolve().then(()=>Oxt).then(t=>t.z)]]);function lni(t){const e=t.split("-")[0].toLowerCase();let i=null;for(const r of ZEe.keys())if(r.startsWith(e)){i=r;break}return i}function uni(t){return t?ZEe.has(t.toLowerCase())?t.toLowerCase():lni(t)||ctt:ctt}let ZB=null,UY=null;async function cni(t=Y0()){if(t=uni(t),ZB&&t===UY)return ZB;ZB=Promise.resolve().then(()=>Q7i).then(e=>e.i),UY=t;try{const[e,i]=await Promise.all([ZB,ZEe.get(UY)()]);UY===t&&(e.am4core.options.defaultLocale=i.default),e.am4core.options.suppressWarnings=!0,e.am4core.options.autoDispose=!0}catch{return ZB=null,UY=null,null}return ZB}function hni(t,e="default"){const i=ani.find(r=>r.name===e);return i?i.colors.map(r=>t.color(r)):null}const nv="esri-feature-media",ap={base:nv,mediaContainer:`${nv}__container`,mediaItemContainer:`${nv}__item-container`,mediaItem:`${nv}__item`,mediaItemTitle:`${nv}__item-title`,mediaItemCaption:`${nv}__item-caption`,mediaPrevious:`${nv}__previous`,mediaPreviousIconLTR:`${nv}__previous-icon`,mediaPreviousIconRTL:`${nv}__previous-icon--rtl`,mediaNext:`${nv}__next`,mediaNextIconLTR:`${nv}__next-icon`,mediaNextIconRTL:`${nv}__next-icon--rtl`,mediaChart:`${nv}__chart`,mediaButton:`${nv}__button`,mediaIcon:`${nv}__icon`,iconLeftTriangleArrow:"esri-icon-left-triangle-arrow",iconRightTriangleArrow:"esri-icon-right-triangle-arrow"},QEe=.05,eIe=.95,tIe=15,JA="color",yM="tooltip",jY="value",htt="default-line-value";let h_=class extends Gf{constructor(e,i){super(e,i),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this.viewModel=new ok,this.messages=null,this._getChartDependencies=async r=>{const n=await cni(),{destroyed:s,viewModel:o}=this;if(s||!o||!r)return;const{activeMediaInfo:a}=o,l=await this._getRendererColors(n);this._renderChart({chartDiv:r,mediaInfo:a,chartsModule:n,colorMap:l})}}initialize(){this._featureElementInfo=new _le,this.addHandles([Qi(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),Fo),Qi(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),Fo)])}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 ki("div",{bind:this,class:ap.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this.renderMedia())}renderMedia(){const{formattedMediaInfoCount:e}=this.viewModel;return e?ki("div",{key:"media-element-container",class:ap.mediaContainer},this.renderMediaPageButton("previous"),this.renderMediaInfo(),this.renderMediaPageButton("next")):null}renderImageMediaInfo(e){const{_refreshIntervalInfo:i}=this,{activeMediaInfoIndex:r,formattedMediaInfoCount:n}=this.viewModel,{value:s,refreshInterval:o,altText:a,title:l,type:c}=e,{sourceURL:d,linkURL:p}=s,y=Vet(p??void 0)?"_blank":"_self",v=y==="_blank"?"noreferrer":"",S=o?i:null,I=S?S.timestamp:0,O=S?S.sourceURL:d,L=ki("img",{alt:a||l,key:`media-${c}-${r}-${n}-${I}`,src:O??void 0});return(p?ki("a",{title:l,href:p,rel:v,target:y},L):null)||L}renderChartMediaInfo(e){const{activeMediaInfoIndex:i,formattedMediaInfoCount:r}=this.viewModel;return ki("div",{key:`media-${e.type}-${i}-${r}`,bind:this,class:ap.mediaChart,afterCreate:this._getChartDependencies})}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;if(!e)return null;const i=e.title?ki("div",{key:"media-title",class:ap.mediaItemTitle,innerHTML:e.title}):null,r=e.caption?ki("div",{key:"media-caption",class:ap.mediaItemCaption,innerHTML:e.caption}):null;return ki("div",{key:"media-container",class:ap.mediaItemContainer},ki("div",{key:"media-item-container",class:ap.mediaItem},this.renderMediaInfoType()),i,r)}renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const i=e==="previous",r=i?this.messages.previous:this.messages.next,n=i?this.classes(ap.mediaButton,ap.mediaPrevious):this.classes(ap.mediaButton,ap.mediaNext),s=i?this.classes(ap.mediaIcon,ap.mediaPreviousIconLTR,ap.iconLeftTriangleArrow):this.classes(ap.mediaIcon,ap.mediaNextIconLTR,ap.iconRightTriangleArrow),o=i?this.classes(ap.mediaIcon,ap.mediaPreviousIconRTL,ap.iconRightTriangleArrow):this.classes(ap.mediaIcon,ap.mediaNextIconRTL,ap.iconLeftTriangleArrow),a=i?"media-previous":"media-next",l=i?this._previous:this._next;return ki("button",{type:"button",key:a,title:r,"aria-label":r,tabIndex:0,class:n,bind:this,onclick:l},ki("span",{"aria-hidden":"true",class:s}),ki("span",{"aria-hidden":"true",class:o}))}_setupFeatureElementInfo(){const{description:e,title:i}=this;this._featureElementInfo?.set({description:e,title:i})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){const{isAggregate:e,layer:i}=this.viewModel;return e&&i?.featureReduction&&"renderer"in i.featureReduction?i.featureReduction.renderer:i?.renderer}async _getRendererColors(e){const{am4core:i}=e,r=new Map,n=this._getRenderer(),s="default";if(!n)return r;const o=await Hri(n);return o.delete(s),Array.from(o.values()).every(a=>a?.length===1)&&(r.set(htt,i.color({r:50,g:50,b:50,a:1})),Array.from(o.keys()).forEach(a=>{a&&r.set(a,i.color(o.get(a)?.[0].toCss(!0)))})),r}_handleMediaKeyup(e){const i=aL(e);i==="ArrowLeft"&&(e.stopPropagation(),this.viewModel.previous()),i==="ArrowRight"&&(e.stopPropagation(),this.viewModel.next())}_renderChart(e){const{abilities:i}=this.viewModel,{chartsModule:r,chartDiv:n,mediaInfo:s,colorMap:o}=e,{value:a,type:l}=s,{am4core:c}=r,d=hni(c);function p(S){S instanceof c.ColorSet&&d&&(S.list=d)}wle()&&c.useTheme(r.am4themes_dark);const y=window.matchMedia("(prefers-reduced-motion: reduce)");i.chartAnimation&&!y.matches?c.useTheme(r.am4themes_animated):c.unuseTheme(r.am4themes_animated),c.useTheme(p);const v=l==="pie-chart"?this._createPieChart(e):this._createXYChart(e);n.setAttribute("aria-label",s.altText||s.title),v.data=a.series.map(S=>({[yM]:S.tooltip,[jY]:S.value,[JA]:o.get(S.fieldName)})).filter(S=>l!=="pie-chart"||S.value!=null&&S.value>0)}_customizeChartTooltip(e,i){e&&(e.label.wrap=!0,e.label.maxWidth=200,e.autoTextColor=!1,e.getFillFromObject=!1,e.label.fill=i.color("#ffffff"),e.background.fill=i.color({r:0,g:0,b:0,a:.7}))}_createPieChart(e){const{chartDiv:i,chartsModule:r}=e,{am4core:n,am4charts:s}=r,o=n.create(i,s.PieChart);o.rtl=mT(this.container);const a=o.series.push(new s.PieSeries);return a.labels.template.disabled=!0,a.ticks.template.disabled=!0,a.dataFields.value=jY,a.dataFields.category=yM,this._customizeChartTooltip(a.tooltip,n),a.slices.template.propertyFields.fill=JA,a.slices.template.propertyFields.stroke=JA,o}_getMinSeriesValue(e){let i=0;return e.forEach(r=>i=Math.min(r.value,i)),i}_createColumnChart(e,i){const{chartsModule:r,mediaInfo:n}=i,{value:s}=n,{am4core:o,am4charts:a}=r,l=e.xAxes.push(new a.CategoryAxis);l.dataFields.category=yM,l.renderer.labels.template.disabled=!0;const c=l.tooltip;this._customizeChartTooltip(c,o),c.events.on("sizechanged",()=>{c.dy=-c.contentHeight});const d=e.yAxes.push(new a.ValueAxis),p=d.renderer.labels.template;d.renderer.minLabelPosition=QEe,d.renderer.maxLabelPosition=eIe,d.min=this._getMinSeriesValue(s.series),this._customizeChartTooltip(d.tooltip,o),p.wrap=!0;const y=e.series.push(new a.ColumnSeries);y.dataFields.valueY=jY,y.dataFields.categoryX=yM,y.columns.template.propertyFields.fill=JA,y.columns.template.propertyFields.stroke=JA,e.cursor=new a.XYCursor,s.series.length>tIe&&(e.scrollbarX=new o.Scrollbar)}_createBarChart(e,i){const{chartsModule:r,mediaInfo:n}=i,{value:s}=n,{am4core:o,am4charts:a}=r,l=e.yAxes.push(new a.CategoryAxis);l.dataFields.category=yM,l.renderer.inversed=!0,l.renderer.labels.template.disabled=!0;const c=l.tooltip;this._customizeChartTooltip(c,o),c.events.on("sizechanged",()=>{c.dx=c.contentWidth});const d=e.xAxes.push(new a.ValueAxis),p=d.renderer.labels.template;d.renderer.minLabelPosition=QEe,d.renderer.maxLabelPosition=eIe,d.min=this._getMinSeriesValue(s.series),this._customizeChartTooltip(d.tooltip,o),p.wrap=!0;const y=e.series.push(new a.ColumnSeries);y.dataFields.valueX=jY,y.dataFields.categoryY=yM,y.columns.template.propertyFields.fill=JA,y.columns.template.propertyFields.stroke=JA,e.cursor=new a.XYCursor,s.series.length>tIe&&(e.scrollbarY=new o.Scrollbar)}_createLineChart(e,i){const{chartsModule:r,mediaInfo:n,colorMap:s}=i,{value:o}=n,{am4core:a,am4charts:l}=r,c=e.xAxes.push(new l.CategoryAxis);c.dataFields.category=yM,c.renderer.labels.template.disabled=!0;const d=c.tooltip;this._customizeChartTooltip(d,a),d.events.on("sizechanged",()=>{d.dy=-d.contentHeight});const p=e.yAxes.push(new l.ValueAxis),y=p.renderer.labels.template;p.renderer.minLabelPosition=QEe,p.renderer.maxLabelPosition=eIe,p.min=this._getMinSeriesValue(o.series),this._customizeChartTooltip(p.tooltip,a),y.wrap=!0;const v=e.series.push(new l.LineSeries);v.dataFields.categoryX=yM,v.dataFields.valueY=jY,v.strokeWidth=1;const S=s.get(htt);S&&(v.stroke=S);const I=v.bullets.push(new l.CircleBullet);I.propertyFields.fill=JA,I.propertyFields.stroke=JA,e.cursor=new l.XYCursor,o.series.length>tIe&&(e.scrollbarX=new a.Scrollbar)}_createXYChart(e){const{chartDiv:i,chartsModule:r,mediaInfo:n}=e,{type:s}=n,{am4core:o,am4charts:a}=r,l=o.create(i,a.XYChart);return l.rtl=mT(this.container),s==="column-chart"&&this._createColumnChart(l,e),s==="bar-chart"&&this._createBarChart(l,e),s==="line-chart"&&this._createLineChart(l,e),l}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const i=Date.now();this._refreshIntervalInfo={timestamp:i,sourceURL:e&&this._getImageSource(e,i)},this.scheduleRender()}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e&&e.type==="image"&&e.refreshInterval&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:i,value:r}=e;if(!i)return;const n=6e4*i;this._updateMediaInfoTimestamp(r.sourceURL);const s=setInterval(()=>{this._updateMediaInfoTimestamp(r.sourceURL)},n);this._refreshTimer=s}_getImageSource(e,i){const r=e.includes("?")?"&":"?",[n,s=""]=e.split("#");return`${n}${r}timestamp=${i}${s?"#":""}${s}`}};E([k()],h_.prototype,"attributes",null),E([k()],h_.prototype,"activeMediaInfoIndex",null),E([k()],h_.prototype,"description",null),E([k()],h_.prototype,"fieldInfoMap",null),E([k()],h_.prototype,"layer",null),E([k()],h_.prototype,"mediaInfos",null),E([k()],h_.prototype,"popupTemplate",null),E([k()],h_.prototype,"relatedInfos",null),E([k()],h_.prototype,"title",null),E([k({type:ok})],h_.prototype,"viewModel",void 0),E([k(),Vf("esri/widgets/Feature/t9n/Feature")],h_.prototype,"messages",void 0),h_=E([ht("esri.widgets.Feature.FeatureMedia")],h_);const dtt=h_,dni=["$datastore","$map","$layer","$aggregatedfeatures"],pni="esri.widgets.Feature.support.arcadeFeatureUtils",fni=Ei.getLogger(pni);function mni(t){return typeof t=="string"?BY(UEe(t)):Array.isArray(t)?gni(t):t?.declaredClass==="esri.arcade.Dictionary"?yni(t):t}function gni(t){return`
    ${t.map(e=>`
  • ${typeof e=="string"?BY(UEe(e)):e}
  • `).join("")}
`}function yni(t){return`${t.keys().map(e=>{const i=t.field(e);return``}).join("")}
${e}${typeof i=="string"?BY(UEe(i)):i}
`}function vni({aggregatedFeatures:t,arcadeUtils:e,featureSetVars:i,context:r,viewInfo:n,map:s,graphic:o,interceptor:a}){i.forEach(l=>{const c=l.toLowerCase(),d=n.sr,p={map:s,spatialReference:d,interceptor:a};if(c==="$map"&&(r.vars[c]=e.convertMapToFeatureSetCollection(p)),c==="$layer"&&(r.vars[c]=e.convertFeatureLayerToFeatureSet({layer:o.sourceLayer,spatialReference:d,interceptor:a})),c==="$datastore"&&(r.vars[c]=e.convertServiceUrlToWorkspace({url:o.sourceLayer.url,spatialReference:d,interceptor:a})),c==="$aggregatedfeatures"){const y=o.layer,{fields:v,objectIdField:S,geometryType:I,spatialReference:O,displayField:L}=y,N=new Hc({fields:v,objectIdField:S,geometryType:I,spatialReference:O,displayField:L,...y.type==="feature"?{templates:y.templates,typeIdField:y.typeIdField,types:y.types}:null,source:t});r.vars[c]=e.convertFeatureLayerToFeatureSet({layer:N,spatialReference:O,interceptor:a})}})}function ptt(){return Promise.resolve().then(()=>Dft)}function _ni(t){return"createQuery"in t&&"queryFeatures"in t}async function bni({graphic:t,view:e}){const{isAggregate:i,layer:r}=t;if(!i||!r||e?.type!=="2d")return[];const n=await e.whenLayerView(r);if(!_ni(n))return[];const s=n.createQuery(),o=t.getObjectId();s.aggregateIds=o!=null?[o]:[];const{features:a}=await n.queryFeatures(s);return a}async function ftt({expressionInfo:t,arcadeUtils:e,interceptor:i,spatialReference:r,map:n,graphic:s,view:o}){if(!t||!t.expression)return null;const a=e.createSyntaxTree(t.expression),l=dni.filter(v=>e.hasVariable(a,v)),[c]=await Promise.all([bni({graphic:s,view:o}),e.loadScriptDependencies(a,!0,l)]),d=e.getViewInfo({spatialReference:r}),p=e.createExecContext(s,d);p.interceptor=i,p.useAsync=!0,vni({aggregatedFeatures:c,arcadeUtils:e,featureSetVars:l,context:p,viewInfo:d,map:n,graphic:s,interceptor:i});const y=e.createFunction(a,p);return e.executeAsyncFunction(y,p).catch(v=>fni.error("arcade-execution-error",{error:v,graphic:s,expressionInfo:t}))}async function wni({expressionInfos:t,spatialReference:e,graphic:i,interceptor:r,map:n,view:s}){if(!t||!t.length)return{};const o=await ptt(),a={};for(const d of t)a[`expression/${d.name}`]=ftt({expressionInfo:d,arcadeUtils:o,interceptor:r,spatialReference:e,map:n,graphic:i,view:s});const l=await bu(a),c={};for(const d in l)c[d]=mni(l[d].value);return c}const xni=1;let K1=class extends Nd(fn){constructor(e){super(e),this._abortController=null,this.expressionInfo=null,this.graphic=null,this.contentElement=null,this.contentElementViewModel=null,this.interceptor=null,this.view=null,this._cancelQuery=()=>{const{_abortController:i}=this;i&&i.abort(),this._abortController=null},this._createVM=()=>{const i=this.contentElement?.type;this.contentElementViewModel?.destroy();const r=i==="fields"?new Sle:i==="media"?new ok:i==="text"?new ble:null;this._set("contentElementViewModel",r)},this._compile=async()=>{this._cancelQuery();const i=new AbortController;this._abortController=i,await this._compileExpression(),this._abortController===i&&(this._abortController=null)},this._compileThrottled=tk(this._compile,xni,this),this._compileExpression=async()=>{const{expressionInfo:i,graphic:r,interceptor:n,spatialReference:s,map:o,view:a,_abortController:l}=this;if(!(i&&r&&s&&o))return void this._set("contentElement",null);const c=await ptt();if(l!==this._abortController)return;const d=await ftt({arcadeUtils:c,expressionInfo:i,graphic:r,interceptor:n,map:o,spatialReference:s,view:a});if(!d||d.declaredClass!=="esri.arcade.Dictionary")return void this._set("contentElement",null);const p=await d.castAsJsonAsync(l?.signal),y=p?.type,v=y==="media"?fW.fromJSON(p):y==="text"?u9.fromJSON(p):y==="fields"?o9.fromJSON(p):null;this._set("contentElement",v)},this.handles.add([Qi(()=>[this.expressionInfo,this.graphic,this.map,this.spatialReference,this.view],()=>this._compileThrottled(),Fo),Qi(()=>[this.contentElement],()=>this._createVM(),Fo)])}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:i,contentElementViewModel:r}=this;return e?"loading":i||r?"ready":"disabled"}get map(){return this.view?.map??null}set map(e){this._override("map",e)}};E([k()],K1.prototype,"_abortController",void 0),E([k({type:Bje})],K1.prototype,"expressionInfo",void 0),E([k({type:js})],K1.prototype,"graphic",void 0),E([k({readOnly:!0})],K1.prototype,"contentElement",void 0),E([k({readOnly:!0})],K1.prototype,"contentElementViewModel",void 0),E([k()],K1.prototype,"interceptor",void 0),E([k()],K1.prototype,"spatialReference",null),E([k({readOnly:!0})],K1.prototype,"state",null),E([k()],K1.prototype,"map",null),E([k()],K1.prototype,"view",void 0),K1=E([ht("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],K1);const iIe=K1,Ele={iconLoading:"esri-icon-loading-indicator esri-rotating",base:"esri-feature-expression",loadingSpinnerContainer:"esri-feature__loading-container",spinner:"esri-feature__loading-spinner"};let Ile=class extends Gf{constructor(e,i){super(e,i),this._contentWidget=null,this.viewModel=new iIe}initialize(){this.addHandles(Qi(()=>this.viewModel?.contentElementViewModel,()=>this._setupExpressionWidget(),Fo))}destroy(){this._destroyContentWidget()}renderLoading(){return ki("div",{key:"loading-container",class:Ele.loadingSpinnerContainer},ki("span",{class:this.classes(Ele.iconLoading,Ele.spinner)}))}render(){const{state:e}=this.viewModel;return ki("div",{class:Ele.base},e==="loading"?this.renderLoading():e==="disabled"?null:this._contentWidget?.render())}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:i}=this.viewModel,r=i?.type;this._destroyContentWidget();const n=e?r==="fields"?new stt({viewModel:e}):r==="media"?new dtt({viewModel:e}):r==="text"?new xle({viewModel:e}):null:null;this._contentWidget=n,this.scheduleRender()}};E([k({type:iIe})],Ile.prototype,"viewModel",void 0),Ile=E([ht("esri.widgets.Feature.FeatureExpression")],Ile);const Sni=Ile,rIe=100;let Wc=class extends ua(R1(Nd(fn))){constructor(e){super(e),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:i}=this;i&&i.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:i}=this;i&&i.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:i}=this;i&&i.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const i=new AbortController;this._queryAbortController=i,await cf(this._query()),this._queryAbortController===i&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._cancelQueryFeatureCount();const i=new AbortController;this._queryFeatureCountAbortController=i,await cf(this._queryFeatureCount()),this._queryFeatureCountAbortController===i&&(this._queryFeatureCountAbortController=null)},this._queryPageController=async()=>{const i=new AbortController;this._queryPageAbortController=i,await cf(this._queryPage()),this._queryPageAbortController===i&&(this._queryPageAbortController=null)},this._queryThrottled=tk(this._queryController,rIe,this),this._queryFeatureCountThrottled=tk(this._queryFeatureCountController,rIe,this),this._queryPageThrottled=tk(this._queryPageController,rIe,this),this._query=async()=>{const{_queryAbortController:i,relatedFeatures:r}=this;this._destroyRelatedFeatureViewModels(),this.featurePage=1,r.removeAll(),r.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:i?.signal})))},this.handles.add([Qi(()=>[this.displayCount,this.graphic,this.layer,this.map,this.orderByFieldsFixedCasing,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount],()=>this._queryThrottled(),Fo),Qi(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageThrottled()),Qi(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery],()=>this._queryFeatureCountThrottled())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.removeAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:i,featureCount:r}=this,n=1,s=Math.ceil(r/i)||1;this._set("featurePage",Math.min(Math.max(e,n),s))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:i}=this;return e&&i?.loaded?e.map(r=>{const n=r.clone(),s=$Y(r.field,i);return n.field=s,n}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}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 fr}get relatedLayer(){const{layer:e,map:i,relationship:r}=this;return e?.loaded&&i&&r?pri(i,e,r)??null:null}get relationship(){const{relationshipId:e,layer:i}=this;return typeof e=="number"?i?.relationships?.find(({id:r})=>r===e)??null:null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new fr}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:i,_queryPageAbortController:r,canQuery:n}=this;return i?"loading":e||r?"querying":n?"ready":"disabled"}_destroyRelatedFeatureViewModels(){this.relatedFeatureViewModels?.forEach(e=>!e.destroyed&&e.destroy()),this.relatedFeatureViewModels.removeAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:i,relationshipId:r,objectId:n,_queryFeatureCountAbortController:s,canQuery:o,supportsCacheHint:a}=this;if(await e?.load(),await i?.load(),!o||!e||!i)return void this._set("featureCount",0);const l=i.createQuery(),c=new eT({cacheHint:a,relationshipId:r,returnGeometry:!1,objectIds:[n],where:d_e(l.where,void 0)}),d=await e.queryRelatedFeaturesCount(c,{signal:s?.signal});this._set("featureCount",d[n]||0)}_sliceFeatures(e){const{showAllEnabled:i,displayCount:r}=this;return i?e:r?e.slice(0,r):[]}async _queryPage(){const{relatedFeatures:e,featurePage:i,showAllEnabled:r,_queryPageAbortController:n}=this;!r||i<2||e.addMany(await this._queryRelatedFeatures({signal:n?.signal}))}async _queryRelatedFeatures(e){const{orderByFieldsFixedCasing:i,showAllEnabled:r,featuresPerPage:n,displayCount:s,layer:o,relationshipId:a,featurePage:l,featureCount:c,relatedLayer:d,supportsCacheHint:p}=this,{canQuery:y,objectId:v}=this;if(!y||!o||!d)return[];const S=r?((l-1)*n+c)%c:0,I=r?n:s,O=d.objectIdField,L=[...i?.map(X=>X.field),O].filter(ye),N=i?.map(X=>`${X.field} ${X.order}`),G=d.createQuery(),V=new eT({orderByFields:N,start:S,num:I,outFields:L,cacheHint:p,relationshipId:a,returnGeometry:!1,objectIds:[v],where:d_e(G.where,void 0)}),Y=(await o.queryRelatedFeatures(V,{signal:e?.signal}))[v]?.features||[];return Y.forEach(X=>{X.sourceLayer=d,X.layer=d}),Y}};E([k()],Wc.prototype,"_queryAbortController",void 0),E([k()],Wc.prototype,"_queryPageAbortController",void 0),E([k()],Wc.prototype,"_queryFeatureCountAbortController",void 0),E([k({value:1})],Wc.prototype,"featurePage",null),E([k()],Wc.prototype,"featuresPerPage",void 0),E([k({readOnly:!0})],Wc.prototype,"orderByFieldsFixedCasing",null),E([k({readOnly:!0})],Wc.prototype,"supportsCacheHint",null),E([k({readOnly:!0})],Wc.prototype,"canQuery",null),E([k()],Wc.prototype,"description",void 0),E([k({readOnly:!0})],Wc.prototype,"itemDescriptionFieldName",null),E([k({value:3})],Wc.prototype,"displayCount",null),E([k({type:js})],Wc.prototype,"graphic",void 0),E([k()],Wc.prototype,"layer",void 0),E([k()],Wc.prototype,"map",void 0),E([k({readOnly:!0})],Wc.prototype,"objectId",null),E([k({readOnly:!0})],Wc.prototype,"objectIdField",null),E([k()],Wc.prototype,"orderByFields",void 0),E([k({readOnly:!0})],Wc.prototype,"relatedFeatures",null),E([k({readOnly:!0})],Wc.prototype,"relatedLayer",null),E([k({readOnly:!0})],Wc.prototype,"relationship",null),E([k()],Wc.prototype,"featureCount",void 0),E([k({readOnly:!0})],Wc.prototype,"relatedFeatureViewModels",null),E([k()],Wc.prototype,"relationshipId",void 0),E([k()],Wc.prototype,"showAllEnabled",void 0),E([k()],Wc.prototype,"state",null),E([k()],Wc.prototype,"title",void 0),Wc=E([ht("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],Wc);const nIe=Wc,zY="esri-feature",sIe=`${zY}-relationship`,ZA={base:sIe,esriWidget:"esri-widget",listContainer:`${sIe}__list`,listContainerQuerying:`${sIe}__list--querying`,featureObserver:`${zY}__feature-observer`,stickySpinnerContainer:`${zY}__sticky-loading-container`,loadingSpinnerContainer:`${zY}__loading-container`,spinner:`${zY}__loading-spinner`,iconLoading:"esri-icon-loading-indicator esri-rotating"},mtt={title:!0,description:!0};let sv=class extends Gf{constructor(e,i){super(e,i),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([r])=>{r?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.headingLevel=2,this.viewModel=new nIe,this.messages=null,this.messagesCommon=null,this.visibleElements={...mtt},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 _le,this.addHandles([Qi(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),Fo),Qi(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),ku(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return Promise.all([Promise.resolve().then(()=>PWi),Promise.resolve().then(()=>MWi),Promise.resolve().then(()=>rLe),Promise.resolve().then(()=>D2t)])}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=ra(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:i,displayCount:r}=this.viewModel;return!e&&!!i&&(i>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:i}=this.viewModel;return m2(i===1?e?.numberRecord:e?.numberRecords,{number:i})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...mtt,...e}}renderStickyLoading(){return this.viewModel.state==="querying"?ki("div",{key:"sticky-loader",class:ZA.stickySpinnerContainer},this.renderLoadingIcon()):null}renderLoadingIcon(){return ki("span",{class:this.classes(ZA.iconLoading,ZA.spinner)})}renderLoading(){return ki("div",{key:"loading-container",class:ZA.loadingSpinnerContainer},this.renderLoadingIcon())}renderShowAllIconNode(){return ki("calcite-icon",{scale:"s",icon:"list",slot:"content-end"})}renderChevronIconNode(){const e=mT(this.container)?"chevron-left":"chevron-right";return ki("calcite-icon",{scale:"s",icon:e,slot:"content-end"})}renderRelatedFeature(e){const{itemDescriptionFieldName:i}=this.viewModel,r=e.title;e.description=i&&e.formattedAttributes?.global[i];const n=e.state==="loading";return ki("calcite-list-item",{key:e.uid,label:n?`${this.messagesCommon?.loading}…`:r,description:n?"…":e.description??"",onCalciteListItemSelect:()=>this.emit("select-record",{featureViewModel:e})},this.renderChevronIconNode())}renderShowAllListItem(){return this.displayShowAllButton?ki("calcite-list-item",{key:"show-all-item",label:this.messages?.showAll,description:this.featureCountDescription,onCalciteListItemSelect:()=>this.emit("show-all-records")},this.renderShowAllIconNode()):null}renderNoRelatedFeaturesMessage(){return ki("calcite-notice",{key:"no-related-features-message",icon:"information",open:!0,kind:"brand",scale:"s",width:"full"},ki("div",{slot:"message"},this.messages?.noRelatedFeatures))}renderFeatureObserver(){return ki("div",{key:"feature-observer",class:ZA.featureObserver,bind:this,afterCreate:this._relatedFeatureIntersectionObserverCreated})}renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return ki("calcite-list",null,e.toArray().map(i=>this.renderRelatedFeature(i)),this.renderShowAllListItem())}renderRelatedFeatures(){const{displayListItems:e}=this,{state:i}=this.viewModel;return ki("div",{key:"list-container",class:this.classes(ZA.listContainer,{[ZA.listContainerQuerying]:i==="querying"})},e?this.renderList():i==="ready"?this.renderNoRelatedFeaturesMessage():null,this.renderStickyLoading(),this.renderFeatureObserver())}renderRelationshipNotFound(){return ki("calcite-notice",{key:"relationship-not-found",icon:"exclamation-mark-triangle",open:!0,kind:"danger",scale:"s",width:"full"},ki("div",{slot:"message"},this.messages?.relationshipNotFound))}render(){const{state:e}=this.viewModel;return ki("div",{class:this.classes(ZA.base,ZA.esriWidget)},this._featureElementInfo?.render(),e==="loading"?this.renderLoading():e==="disabled"?this.renderRelationshipNotFound():this.renderRelatedFeatures())}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,i="related-feature-viewmodels";this.removeHandles(i),e?.forEach(r=>{this.addHandles(Qi(()=>[r.title,r.state],()=>this.scheduleRender(),Fo),i)}),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:i}=this,r=i.description&&this.description,n=i.title&&this.title;this._featureElementInfo?.set({description:r,title:n,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:i}=this.viewModel;await B3(0),this._relatedFeatureIntersectionObserverNode&&e==="ready"&&i&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};E([k()],sv.prototype,"_relatedFeatureIntersectionObserverNode",void 0),E([k({readOnly:!0})],sv.prototype,"displayShowAllButton",null),E([k({readOnly:!0})],sv.prototype,"displayListItems",null),E([k()],sv.prototype,"description",null),E([k({readOnly:!0})],sv.prototype,"featureCountDescription",null),E([k()],sv.prototype,"headingLevel",void 0),E([k()],sv.prototype,"title",null),E([k({type:nIe})],sv.prototype,"viewModel",void 0),E([k(),Vf("esri/widgets/Feature/t9n/Feature")],sv.prototype,"messages",void 0),E([k(),Vf("esri/t9n/common")],sv.prototype,"messagesCommon",void 0),E([k()],sv.prototype,"visibleElements",void 0),E([Zs("visibleElements")],sv.prototype,"castVisibleElements",null),sv=E([ht("esri.widgets.Feature.FeatureRelationship")],sv);const gtt=sv;let Cni=class{constructor(e,i){this.preLayerQueryCallback=e,this.preRequestCallback=i,this.preLayerQueryCallback||(this.preLayerQueryCallback=r=>{}),this.preRequestCallback||(this.preLayerQueryCallback=r=>{})}};var HY;const Tni=1,ytt="content-view-models",vtt="relationship-view-models",_tt={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0};let qh=HY=class extends R1(fn){constructor(t){super(t),this._handles=new uf,this._error=null,this._featureAbortController=null,this._graphicChangedThrottled=tk(this._graphicChanged,Tni,this),this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={..._tt},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.relatedInfos=new Map,this.title="",this.view=null,this._isAllowedContentType=e=>{const{abilities:i}=this;return e.type==="attachments"&&!!i.attachmentsContent||e.type==="custom"&&!!i.customContent||e.type==="fields"&&!!i.fieldsContent||e.type==="media"&&!!i.mediaContent||e.type==="text"&&!!i.textContent||e.type==="expression"&&!!i.expressionContent||e.type==="relationship"&&!!i.relationshipContent},this._handles.add(Qi(()=>[this.graphic,this._effectivePopupTemplate,this.abilities],()=>this._graphicChangedThrottled(),Fo))}destroy(){this._clear(),this._cancelFeatureQuery(),this._error=null,this._handles.destroy(),this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}get _effectivePopupTemplate(){return ye(this.graphic)?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return ori(Wet(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return Get(this.graphic)}castAbilities(t){return{..._tt,...t}}get isTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(t){this._set("graphic",t?t.clone():null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(t){this._override("spatialReference",t)}get map(){return this.view?.map||null}set map(t){this._override("map",t)}get waitingForContent(){return!!this._featureAbortController}setActiveMedia(t,e){const i=this.contentViewModels[t];i instanceof ok&&i.setActiveMedia(e)}nextMedia(t){const e=this.contentViewModels[t];e instanceof ok&&e.next()}previousMedia(t){const e=this.contentViewModels[t];e instanceof ok&&e.previous()}async updateGeometry(){const{graphic:t,spatialReference:e,_sourceLayer:i}=this;await i?.load();const r=i?.objectIdField;if(!r||!t||!i)return;const n=t?.attributes?.[r];if(n==null)return;const s=[n];if(!t.geometry){const o=(await Yet({layer:i,graphic:t,outFields:[],objectIds:s,returnGeometry:!0,spatialReference:e}))?.geometry;o&&(t.geometry=o)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}async _graphicChanged(){this._cancelFeatureQuery(),this._error=null,this._clear();const{graphic:t}=this;if(!t)return;const e=new AbortController;this._featureAbortController=e;try{await this._queryFeature({signal:e.signal})}catch(i){ss(i)||(this._error=i,Ei.getLogger(this.declaredClass).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:t,popupTemplate:this._effectivePopupTemplate}))}this._featureAbortController===e&&(this._featureAbortController=null)}_cancelFeatureQuery(){const{_featureAbortController:t}=this;t&&t.abort(),this._featureAbortController=null}_compileContentElement(t,e){return t.type==="attachments"?this._compileAttachments(t,e):t.type==="custom"?this._compileCustom(t,e):t.type==="fields"?this._compileFields(t,e):t.type==="media"?this._compileMedia(t,e):t.type==="text"?this._compileText(t,e):t.type==="expression"?this._compileExpression(t,e):t.type==="relationship"?this._compileRelationship(t,e):void 0}_compileContent(t){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(t)?t.filter(this._isAllowedContentType).map((e,i)=>this._compileContentElement(e,i)).filter(ye):typeof t=="string"?this._compileText(new u9({text:t}),0).text:t}_destroyContentViewModels(){this._handles?.remove(vtt),this._handles?.remove(ytt),this.contentViewModels.forEach(t=>t&&!t.destroyed&&t.destroy()),this._set("contentViewModels",[])}_matchesFeature(t,e){const i=t?.graphic?.getObjectId(),r=e?.getObjectId();return ye(i)&&ye(r)&&i===r}_setRelatedFeaturesViewModels({relatedFeatureViewModels:t,relatedFeatures:e,map:i}){const{view:r,spatialReference:n}=this;e?.filter(Boolean).forEach(s=>{t.find(o=>this._matchesFeature(o,s))||t.add(new HY({abilities:{relationshipContent:!1},map:i,view:r,spatialReference:n,graphic:s}))}),t.forEach(s=>{e?.find(a=>this._matchesFeature(s,a))||t.remove(s)})}_setExpressionContentVM(t,e){const i=this.formattedAttributes,{contentElement:r,contentElementViewModel:n}=t,s=r?.type;n&&s&&(s==="fields"&&(this._createFieldsFormattedAttributes({contentElement:r,contentElementIndex:e,formattedAttributes:i}),n.set(this._createFieldsVMParams(r,e))),s==="media"&&(this._createMediaFormattedAttributes({contentElement:r,contentElementIndex:e,formattedAttributes:i}),n.set(this._createMediaVMParams(r,e))),s==="text"&&n.set(this._createTextVMParams(r)))}_compileRelationship(t,e){const{displayCount:i,orderByFields:r,relationshipId:n,title:s,description:o}=t,{_sourceLayer:a,graphic:l,map:c}=this,d=new nIe({displayCount:i,graphic:l,orderByFields:r,relationshipId:n,layer:a,map:c,...this._compileTitleAndDesc({title:s,description:o})});return this.contentViewModels[e]=d,this._handles.add(ku(()=>d.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(d)),vtt),t}_compileExpression(t,e){const{expressionInfo:i}=t,{graphic:r,map:n,spatialReference:s,view:o}=this,a=new iIe({expressionInfo:i,graphic:r,interceptor:HY.interceptor,map:n,spatialReference:s,view:o});return this.contentViewModels[e]=a,this._handles.add(Qi(()=>a.contentElementViewModel,()=>this._setExpressionContentVM(a,e),Fo),ytt),t}_compileAttachments(t,e){const{graphic:i}=this,{description:r,title:n}=t;return this.contentViewModels[e]=new WEe({graphic:i,...this._compileTitleAndDesc({title:n,description:r})}),t}_compileCustom(t,e){const{graphic:i}=this,{creator:r,destroyer:n}=t;return this.contentViewModels[e]=new ble({graphic:i,creator:r,destroyer:n}),t}_compileTitleAndDesc({title:t,description:e}){const{_fieldInfoMap:i,_sourceLayer:r,graphic:n,formattedAttributes:s}=this,o=n?.attributes,a=this._expressionAttributes,l=s.global;return{title:nk({attributes:o,fieldInfoMap:i,globalAttributes:l,expressionAttributes:a,layer:r,text:t}),description:nk({attributes:o,fieldInfoMap:i,globalAttributes:l,expressionAttributes:a,layer:r,text:e})}}_createFieldsVMParams(t,e){const i=this._effectivePopupTemplate,r=this.formattedAttributes,n={...r?.global,...r?.content[e]},s=(t?.fieldInfos||i?.fieldInfos)?.filter(({fieldName:c})=>$Ee(c)||XA(c)||n.hasOwnProperty(c)),o=i?.expressionInfos,{description:a,title:l}=t;return{attributes:n,expressionInfos:o,fieldInfos:s,...this._compileTitleAndDesc({title:l,description:a})}}_compileFields(t,e){const i=t.clone(),r=new Sle(this._createFieldsVMParams(t,e));return this.contentViewModels[e]=r,i.fieldInfos=r.formattedFieldInfos.slice(0),i}_createMediaVMParams(t,e){const{abilities:i,graphic:r,_fieldInfoMap:n,_effectivePopupTemplate:s,relatedInfos:o,_sourceLayer:a,_expressionAttributes:l}=this,c=this.formattedAttributes,d=r?.attributes??{},{description:p,mediaInfos:y,title:v}=t;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:t.activeMediaInfoIndex||0,attributes:d,isAggregate:r?.isAggregate,layer:a,fieldInfoMap:n,formattedAttributes:{...c?.global,...c?.content[e]},expressionAttributes:l,mediaInfos:y,popupTemplate:s,relatedInfos:o,...this._compileTitleAndDesc({title:v,description:p})}}_compileMedia(t,e){const i=t.clone(),r=new ok(this._createMediaVMParams(t,e));return i.mediaInfos=r.formattedMediaInfos.slice(0),this.contentViewModels[e]=r,i}_createTextVMParams(t){const{graphic:e,_fieldInfoMap:i,_sourceLayer:r,_expressionAttributes:n}=this;if(t&&t.text){const s=e?.attributes??{},o=this.formattedAttributes?.global??{};t.text=nk({attributes:s,fieldInfoMap:i,globalAttributes:o,expressionAttributes:n,layer:r,text:t.text})}return{graphic:e,creator:t.text}}_compileText(t,e){const i=t.clone();return this.contentViewModels[e]=new ble(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:t,_sourceLayer:e,graphic:i}=this;if(!t)return;const{lastEditInfoEnabled:r}=t,n=e?.editFieldsInfo;return r&&n?sri(n,i?.attributes):void 0}_compileTitle(t){const{_fieldInfoMap:e,_sourceLayer:i,graphic:r,_expressionAttributes:n}=this,s=r?.attributes??{},o=this.formattedAttributes?.global??{};return nk({attributes:s,fieldInfoMap:e,globalAttributes:o,expressionAttributes:n,layer:i,text:t})}async _getTitle(){const{_effectivePopupTemplate:t,graphic:e}=this;if(!e)return null;const i=t?.title;return yle(i,{graphic:e})}async _getContent(){const{_effectivePopupTemplate:t,graphic:e}=this;if(!e)return null;const i=t?.content;return yle(i,{graphic:e})}async _queryFeature(t){const{_featureAbortController:e,_sourceLayer:i,graphic:r,_effectivePopupTemplate:n}=this,s=this.map,o=this.view,a=this.spatialReference;if(e!==this._featureAbortController||!r)return;await lri({graphic:r,popupTemplate:n,layer:i,spatialReference:a},t);const{content:{value:l},title:{value:c}}=await bu({content:this._getContent(),title:this._getTitle()}),{expressionAttributes:{value:d}}=await bu({checkForRelatedFeatures:this._checkForRelatedFeatures(t),expressionAttributes:wni({expressionInfos:n?.expressionInfos,spatialReference:a,graphic:r,map:s,interceptor:HY.interceptor,view:o})});e===this._featureAbortController&&r&&(this._expressionAttributes=d,this._graphicExpressionAttributes={...r.attributes,...d},this._set("formattedAttributes",this._createFormattedAttributes(l)),this._set("title",this._compileTitle(c)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(l)||null))}_createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){const{_effectivePopupTemplate:r,graphic:n,relatedInfos:s,_sourceLayer:o,_fieldInfoMap:a,_graphicExpressionAttributes:l}=this;i.content[e]=jEe({fieldInfos:r?.fieldInfos,graphic:n,attributes:{...l,...t.attributes},layer:o,fieldInfoMap:a,relatedInfos:s})}_createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){if(t.fieldInfos){const{graphic:r,relatedInfos:n,_sourceLayer:s,_fieldInfoMap:o,_graphicExpressionAttributes:a}=this;i.content[e]=jEe({fieldInfos:t.fieldInfos,graphic:r,attributes:{...a,...t.attributes},layer:s,fieldInfoMap:o,relatedInfos:n})}}_createFormattedAttributes(t){const{_effectivePopupTemplate:e,graphic:i,relatedInfos:r,_sourceLayer:n,_fieldInfoMap:s,_graphicExpressionAttributes:o}=this,a=e?.fieldInfos,l={global:jEe({fieldInfos:a,graphic:i,attributes:o,layer:n,fieldInfoMap:s,relatedInfos:r}),content:[]};return Array.isArray(t)&&t.forEach((c,d)=>{c.type==="fields"&&this._createFieldsFormattedAttributes({contentElement:c,contentElementIndex:d,formattedAttributes:l}),c.type==="media"&&this._createMediaFormattedAttributes({contentElement:c,contentElementIndex:d,formattedAttributes:l})}),l}_checkForRelatedFeatures(t){const{graphic:e,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(e,Wet(i),t)}async _queryRelatedInfos(t,e,i){const{relatedInfos:r,_sourceLayer:n}=this;r.clear();const s=ye(n?.associatedLayer)?await n?.associatedLayer.load(i):n;if(!s||!t)return;const o=e.filter(c=>c&&XA(c.fieldName));if(!o||!o.length)return;e.forEach(c=>this._configureRelatedInfo(c,s));const a=await ini({relatedInfos:r,layer:s},i);Object.keys(a).forEach(c=>{const d=r.get(c.toString()),p=a[c]?.value;d&&p&&(d.layerInfo=p.data)});const l=await rni({graphic:t,relatedInfos:r,layer:s},i);Object.keys(l).forEach(c=>{Jri(l[c]?.value,r.get(c.toString()))})}_configureRelatedInfo(t,e){const{relatedInfos:i}=this,r=Tle(t.fieldName);if(!r)return;const{layerId:n,fieldName:s}=r;if(!n)return;const o=i.get(n.toString())||Kri(n,e);o&&(nni({relatedInfo:o,fieldName:s,fieldInfo:t}),this.relatedInfos.set(n,o))}};qh.interceptor=new Cni(hri,dri),E([k()],qh.prototype,"_error",void 0),E([k()],qh.prototype,"_featureAbortController",void 0),E([k({readOnly:!0})],qh.prototype,"_effectivePopupTemplate",null),E([k({readOnly:!0})],qh.prototype,"_fieldInfoMap",null),E([k({readOnly:!0})],qh.prototype,"_sourceLayer",null),E([k()],qh.prototype,"abilities",void 0),E([Zs("abilities")],qh.prototype,"castAbilities",null),E([k({readOnly:!0})],qh.prototype,"content",void 0),E([k({readOnly:!0})],qh.prototype,"contentViewModels",void 0),E([k()],qh.prototype,"description",void 0),E([k({type:Boolean})],qh.prototype,"defaultPopupTemplateEnabled",void 0),E([k({readOnly:!0})],qh.prototype,"isTable",null),E([k({readOnly:!0})],qh.prototype,"state",null),E([k({readOnly:!0})],qh.prototype,"formattedAttributes",void 0),E([k({type:js,value:null})],qh.prototype,"graphic",null),E([k({readOnly:!0})],qh.prototype,"lastEditInfo",void 0),E([k({readOnly:!0})],qh.prototype,"relatedInfos",void 0),E([k()],qh.prototype,"spatialReference",null),E([k({readOnly:!0})],qh.prototype,"title",void 0),E([k()],qh.prototype,"map",null),E([k({readOnly:!0})],qh.prototype,"waitingForContent",null),E([k()],qh.prototype,"view",void 0),qh=HY=E([ht("esri.widgets.FeatureViewModel")],qh);const oIe=qh,Zg="esri-feature",Bd={iconText:"esri-icon-font-fallback-text",iconLoading:"esri-icon-loading-indicator esri-rotating",esriTable:"esri-widget__table",esriWidget:"esri-widget",base:Zg,container:`${Zg}__size-container`,title:`${Zg}__title`,main:`${Zg}__main-container`,btn:`${Zg}__button`,icon:`${Zg}__icon`,content:`${Zg}__content`,contentNode:`${Zg}__content-node`,contentElement:`${Zg}__content-element`,text:`${Zg}__text`,lastEditedInfo:`${Zg}__last-edited-info`,fields:`${Zg}__fields`,fieldHeader:`${Zg}__field-header`,fieldData:`${Zg}__field-data`,fieldDataDate:`${Zg}__field-data--date`,loadingSpinnerContainer:`${Zg}__loading-container`,spinner:`${Zg}__loading-spinner`},btt=t=>{let e=class extends t{constructor(){super(...arguments),this.renderNodeContent=i=>XEe(i)&&!i.destroyed?ki("div",{class:Bd.contentNode,key:i},i.render()):i instanceof HTMLElement?ki("div",{class:Bd.contentNode,key:i,bind:i,afterCreate:this._attachToNode}):Ori(i)?ki("div",{class:Bd.contentNode,key:i,bind:i.domNode,afterCreate:this._attachToNode}):null}_attachToNode(i){const r=this;i.appendChild(r)}};return e=E([ht("esri.widgets.Feature.ContentMixin")],e),e};var aIe;const wtt={title:!0,content:!0,lastEditedInfo:!0},xtt="relationship-handles";let Mm=aIe=class extends btt(Gf){constructor(t,e){super(t,e),this._contentWidgets=[],this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesURIUtils=null,this.visibleElements={...wtt},this.viewModel=new oIe}initialize(){this.addHandles(Qi(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),Fo))}loadDependencies(){return Promise.resolve().then(()=>D2t)}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(t){this.viewModel.graphic=t}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(t){this.viewModel.defaultPopupTemplateEnabled=t}get isTable(){return this.viewModel.isTable}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(t){this.viewModel.spatialReference=t}get title(){return this.viewModel.title}castVisibleElements(t){return{...wtt,...t}}get map(){return this.viewModel.map}set map(t){this.viewModel.map=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const{state:t}=this.viewModel,e=ki("div",{class:Bd.container,key:"container"},this.renderTitle(),t==="error"?this.renderError():t==="loading"?this.renderLoading():this.renderContentContainer());return ki("div",{class:this.classes(Bd.base,Bd.esriWidget)},e)}setActiveMedia(t,e){return this.viewModel.setActiveMedia(t,e)}nextMedia(t){return this.viewModel.nextMedia(t)}previousMedia(t){return this.viewModel.previousMedia(t)}renderError(){const{messagesCommon:t,messages:e,visibleElements:i}=this;return ki("calcite-notice",{open:!0,kind:"danger",icon:"exclamation-mark-circle",scale:"s"},i.title?ki("div",{key:"error-title",slot:"title"},t.errorMessage):null,ki("div",{key:"error-message",slot:"message"},e.loadingError))}renderLoading(){return ki("div",{key:"loading-container",class:Bd.loadingSpinnerContainer},ki("span",{class:this.classes(Bd.iconLoading,Bd.spinner)}))}renderContentContainer(){const{visibleElements:t}=this;return t.content?ki("div",{class:Bd.main},[this.renderContent(),this.renderLastEditInfo()]):null}renderTitle(){const{visibleElements:t,title:e}=this;return t.title?ki(vle,{level:this.headingLevel,class:Bd.title,innerHTML:e}):null}renderContent(){const t=this.viewModel.content,e="content";if(!t)return null;if(Array.isArray(t))return t.length?ki("div",{class:Bd.contentNode,key:`${e}-content-elements`},t.map(this.renderContentElement,this)):null;if(typeof t=="string"){const i=this._contentWidgets[0];return!i||i.destroyed?null:ki("div",{class:Bd.contentNode,key:`${e}-content`},i.render())}return this.renderNodeContent(t)}renderContentElement(t,e){const{visibleElements:i}=this;if(typeof i.content!="boolean"&&!i.content?.[t.type])return null;switch(t.type){case"attachments":return this.renderAttachments(e);case"custom":return this.renderCustom(t,e);case"fields":return this.renderFields(e);case"media":return this.renderMedia(e);case"text":return this.renderText(t,e);case"expression":return this.renderExpression(e);case"relationship":return this.renderRelationship(e);default:return null}}renderAttachments(t){const e=this._contentWidgets[t];if(!e||e.destroyed)return null;const{state:i,attachmentInfos:r}=e.viewModel;return i==="loading"||r.length>0?ki("div",{key:this._buildKey("attachments-element",t),class:this.classes(Bd.contentElement)},e.render()):null}renderRelationship(t){const e=this._contentWidgets[t];return e&&!e.destroyed&&this.flowItems?ki("div",{key:this._buildKey("relationship-element",t),class:Bd.contentElement},e.render()):null}renderExpression(t){const e=this._contentWidgets[t];return!e||e.destroyed?null:ki("div",{key:this._buildKey("expression-element",t),class:Bd.contentElement},e.render())}renderCustom(t,e){const{creator:i}=t,r=this._contentWidgets[e];return!r||r.destroyed?null:i?ki("div",{key:this._buildKey("custom-element",e),class:Bd.contentElement},r.render()):null}renderFields(t){const e=this._contentWidgets[t];return!e||e.destroyed?null:ki("div",{key:this._buildKey("fields-element",t),class:Bd.contentElement},e.render())}renderMedia(t){const e=this._contentWidgets[t];return!e||e.destroyed?null:ki("div",{key:this._buildKey("media-element",t),class:Bd.contentElement},e.render())}renderLastEditInfo(){const{visibleElements:t,messages:e}=this,{lastEditInfo:i}=this.viewModel;if(!i||!t.lastEditedInfo)return null;const{date:r,user:n}=i,s=i.type==="edit"?n?e.lastEditedByUser:e.lastEdited:n?e.lastCreatedByUser:e.lastCreated,o=m2(s,{date:r,user:n});return ki("div",{key:"edit-info-element",class:this.classes(Bd.lastEditedInfo,Bd.contentElement)},o)}renderText(t,e){const i=t.text,r=this._contentWidgets[e];return!r||r.destroyed?null:i?ki("div",{key:this._buildKey("text-element",e),class:this.classes(Bd.contentElement,Bd.text)},r.render()):null}_buildKey(t,...e){return`${t}__${this.get("viewModel.graphic.uid")||"0"}-${e.join("-")}`}_destroyContentWidget(t){t&&(t.viewModel=null,!t.destroyed&&t.destroy())}_destroyContentWidgets(){this.removeHandles(xtt),this._contentWidgets.forEach(t=>this._destroyContentWidget(t)),this._contentWidgets=[]}_addFeatureRelationshipHandles(t){const{flowItems:e,visibleElements:i}=this;this.addHandles([ku(()=>t,"select-record",({featureViewModel:r})=>{e&&(r.abilities={relationshipContent:!0},e.push(new aIe({flowItems:e,viewModel:r,visibleElements:i})))}),ku(()=>t,"show-all-records",()=>{if(!e)return;const{viewModel:r}=t;r.showAllEnabled=!0;const n=new gtt({visibleElements:{title:!1,description:!1},viewModel:r});this._addFeatureRelationshipHandles(n),e.push(n)})],xtt)}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:t,visibleElements:e}=this,i=this.get("viewModel.content"),{contentViewModels:r}=this.viewModel;if(Array.isArray(i))i.forEach((n,s)=>{if(n.type==="attachments"&&(this._contentWidgets[s]=new wri({displayType:n.displayType,headingLevel:e.title?t+1:t,viewModel:r[s]})),n.type==="fields"&&(this._contentWidgets[s]=new stt({viewModel:r[s]})),n.type==="media"&&(this._contentWidgets[s]=new dtt({viewModel:r[s]})),n.type==="text"&&(this._contentWidgets[s]=new xle({viewModel:r[s]})),n.type==="custom"&&(this._contentWidgets[s]=new xle({viewModel:r[s]})),n.type==="expression"&&(this._contentWidgets[s]=new Sni({viewModel:r[s]})),n.type==="relationship"){const o=new gtt({viewModel:r[s]});this._addFeatureRelationshipHandles(o),this._contentWidgets[s]=o}},this);else{const n=r[0];n&&!n.destroyed&&(this._contentWidgets[0]=new xle({viewModel:n}))}this.scheduleRender()}};E([k()],Mm.prototype,"graphic",null),E([k()],Mm.prototype,"defaultPopupTemplateEnabled",null),E([k()],Mm.prototype,"flowItems",void 0),E([k()],Mm.prototype,"headingLevel",void 0),E([k({readOnly:!0})],Mm.prototype,"isTable",null),E([k()],Mm.prototype,"label",null),E([k(),Vf("esri/widgets/Feature/t9n/Feature")],Mm.prototype,"messages",void 0),E([k(),Vf("esri/t9n/common")],Mm.prototype,"messagesCommon",void 0),E([k(),Vf("esri/widgets/support/t9n/uriUtils")],Mm.prototype,"messagesURIUtils",void 0),E([k()],Mm.prototype,"spatialReference",null),E([k({readOnly:!0})],Mm.prototype,"title",null),E([k()],Mm.prototype,"visibleElements",void 0),E([Zs("visibleElements")],Mm.prototype,"castVisibleElements",null),E([k()],Mm.prototype,"map",null),E([k()],Mm.prototype,"view",null),E([k({type:oIe})],Mm.prototype,"viewModel",void 0),Mm=aIe=E([ht("esri.widgets.Feature")],Mm);const Eni=Mm;var Stt;const Ale=Symbol("anchorHandles");let ak=class extends cd.EventedAccessor{constructor(e){super(e),this[Stt]=new uf,this.location=null,this.screenLocationEnabled=!1,this.view=null,this[Ale].add([Hg(()=>ya(this.screenLocationEnabled?this.view:null,i=>[i.size,i.type==="3d"?i.camera:i.viewpoint]),()=>this.notifyChange("screenLocation")),Qi(()=>this.screenLocation,(i,r)=>{ye(i)&&ye(r)&&this.emit("view-change")})])}destroy(){this.view=null,this[Ale]=ra(this[Ale])}get screenLocation(){const{location:e,view:i,screenLocationEnabled:r}=this;return r&&ye(e)&&ye(i)&&i.ready?i.toScreen?.(e):null}};Stt=Ale,E([k()],ak.prototype,"location",void 0),E([k()],ak.prototype,"screenLocation",null),E([k()],ak.prototype,"screenLocationEnabled",void 0),E([k()],ak.prototype,"view",void 0),ak=E([ht("esri.widgets.support.AnchorElementViewModel")],ak);const Ctt=ak,Ini="esri.widgets.CompassViewModel";let Ple=class extends Ctt{constructor(e){super(e),this.visible=!1}};E([k()],Ple.prototype,"visible",void 0),Ple=E([ht(Ini)],Ple);const Ttt=Ple,lIe="esri-spinner",uIe={base:lIe,spinnerStart:`${lIe}--start`,spinnerFinish:`${lIe}--finish`};let lk=class extends Gf{constructor(e,i){super(e,i),this._animationDelay=500,this._animationPromise=null,this.viewModel=new Ttt}initialize(){this.addHandles(Qi(()=>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:i,promise:r}=e??{};i&&(this.viewModel.location=i),this.visible=!0;const n=()=>this.hide();r&&r.catch(()=>{}).then(n)}hide(){this.visible=!1}render(){const{visible:e}=this,{screenLocation:i}=this.viewModel,r=!!i,n=e&&r,s=!e&&r,o={[uIe.spinnerStart]:n,[uIe.spinnerFinish]:s},a=this._getPositionStyles();return ki("div",{class:this.classes(uIe.base,o),styles:a})}_visibleChange(e){if(e)return void(this.viewModel.screenLocationEnabled=!0);const i=B3(this._animationDelay);this._animationPromise=i,i.catch(()=>{}).then(()=>{this._animationPromise===i&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)})}_getPositionStyles(){const{screenLocation:e,view:i}=this.viewModel;if(lt(i)||lt(e))return{};const{padding:r}=i;return{left:e.x-r.left+"px",top:e.y-r.top+"px"}}};E([k()],lk.prototype,"location",null),E([k()],lk.prototype,"view",null),E([k({type:Ttt})],lk.prototype,"viewModel",void 0),E([k()],lk.prototype,"visible",null),lk=E([ht("esri.widgets.Spinner")],lk);const Ani=lk,Ole={iconZoom:"esri-icon-zoom-in-magnifying-glass",iconTrash:"esri-icon-trash",iconBrowseClusteredFeatures:"esri-icon-table"},uk=new c9({id:"zoom-to-feature",title:"{messages.zoom}",className:Ole.iconZoom}),Ett=new c9({id:"remove-selected-feature",title:"{messages.remove}",className:Ole.iconTrash}),QB=new c9({id:"zoom-to-clustered-features",title:"{messages.zoom}",className:Ole.iconZoom}),eG=new c9({id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:Ole.iconBrowseClusteredFeatures}),Pni="esri.widgets.Popup.PopupViewModel",Rle=Ei.getLogger(Pni),Oni=t=>{const{event:e,view:i}=t,{action:r}=e,n=i&&i.popup;if(!r)return Promise.reject(new st("trigger-action:missing-arguments","Event has no action"));if(!n)return Promise.reject(new st("trigger-action:missing-arguments","view.popup is missing"));const{disabled:s,id:o}=r;if(!o)return Promise.reject(new st("trigger-action:invalid-action","action.id is missing"));if(s)return Promise.reject(new st("trigger-action:invalid-action","Action is disabled"));if(o===uk.id)return Mni(n.viewModel).catch(wC);if(o===QB.id)return Dni(n.viewModel);if(o===eG.id)return n.featureMenuOpen=!n.featureMenuOpen,n.viewModel.browseClusterEnabled=!n.viewModel.browseClusterEnabled,Promise.resolve();if(n.viewModel.browseClusterEnabled=!1,o===Ett.id){n.close();const{selectedFeature:a}=n;if(!a)return Promise.reject(new st(`trigger-action:${Ett.id}`,"selectedFeature is required",{selectedFeature:a}));const{sourceLayer:l}=a;return l?l.remove(a):i.graphics.remove(a),Promise.resolve()}return Promise.resolve()};function Itt(t){const{selectedFeature:e,location:i,view:r}=t;return r?r.type==="3d"?e??i??null:t.get("selectedFeature.geometry")||i:null}function ck(t){return!!t&&t.isAggregate&&t.sourceLayer?.featureReduction?.type==="cluster"}async function Rni(t,e){if(e?.type!=="3d"||!t||t.declaredClass!=="esri.Graphic")return!0;const i=e.getViewForGraphic(t);if(i&&"whenGraphicBounds"in i){let r;try{r=await i.whenGraphicBounds(t,{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 Mni(t){const{location:e,selectedFeature:i,view:r,zoomFactor:n}=t,s=Itt(t);if(!r||!s){const d=new st("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:s,view:r});throw Rle.error(d),d}const o=r.scale/n,a=t.selectedFeature?.geometry,l=a??e,c=ye(l)&&l.type==="point"&&await Rni(i,r);uk.active=!0,uk.disabled=!0;try{await t.zoomTo({target:{target:s,scale:c?o:void 0}})}catch{const p=new st("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:i});Rle.error(p)}finally{uk.active=!1,uk.disabled=!1,t.zoomToLocation=null,c&&(t.location=l)}}async function Dni(t){const{selectedFeature:e,view:i}=t;if(i?.type!=="2d"){const o=new st("zoomToCluster:invalid-view","View must be 2d MapView.",{view:i});throw Rle.error(o),o}if(!e||!ck(e)){const o=new st("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:e});throw Rle.error(o),o}const[r,n]=await cIe(i,e);QB.active=!0,QB.disabled=!0;const{extent:s}=await r.queryExtent(n);await t.zoomTo({target:s}),QB.active=!1,QB.disabled=!1}async function Fni(t){const{view:e,selectedFeature:i}=t;if(!e||!i)return;const[r,n]=await cIe(e,i),{extent:s}=await r.queryExtent(n);t.selectedClusterBoundaryFeature.geometry=s,e.graphics.add(t.selectedClusterBoundaryFeature)}async function Lni(t){const{selectedFeature:e,view:i}=t;if(!i||!e)return;const[r,n]=await cIe(i,e);eG.active=!0,eG.disabled=!0;const{features:s}=await r.queryFeatures(n);eG.active=!1,eG.disabled=!1,i.popup?.open({features:[e].concat(s),featureMenuOpen:!0})}async function cIe(t,e){const i=await t.whenLayerView(e.sourceLayer),r=i.createQuery(),n=e.getObjectId();return r.aggregateIds=n!=null?[n]:[],[i,r]}function kni(t){const e=t.features.filter(i=>ck(i));e.length&&(t.features=e)}function Att(t){if(lt(t))return null;switch(t.type){case"point":return t;case"extent":return t.center;case"polygon":return t.centroid;case"multipoint":case"polyline":return t.extent?.center;default:return null}}const oo="esri-popup",WY=`${oo}__header`,hk=`${oo}--is-docked`,Yr={calciteThemeLight:"calcite-mode-light",calciteThemeDark:"calcite-mode-dark",iconLeftTriangleArrow:"esri-icon-left-triangle-arrow",iconRightTriangleArrow:"esri-icon-right-triangle-arrow",iconDockToTop:"esri-icon-maximize",iconDockToBottom:"esri-icon-dock-bottom",iconDockToLeft:"esri-icon-dock-left",iconDockToRight:"esri-icon-dock-right",iconClose:"esri-icon-close",iconUndock:"esri-icon-minimize",iconCheckMark:"esri-icon-check-mark",iconLoading:"esri-icon-loading-indicator",iconDefaultAction:"esri-icon-default-action",iconActionsMenu:"esri-icon-handle-horizontal",rotating:"esri-rotating",base:oo,widget:"esri-widget",main:`${oo}__main-container`,loadingContainer:`${oo}__loading-container`,isCollapsible:`${oo}--is-collapsible`,isCollapsed:`${oo}--is-collapsed`,shadow:`${oo}--shadow`,isDocked:hk,isDockedTopLeft:`${hk}-top-left`,isDockedTopCenter:`${hk}-top-center`,isDockedTopRight:`${hk}-top-right`,isDockedBottomLeft:`${hk}-bottom-left`,isDockedBottomCenter:`${hk}-bottom-center`,isDockedBottomRight:`${hk}-bottom-right`,alignTopCenter:`${oo}--aligned-top-center`,alignBottomCenter:`${oo}--aligned-bottom-center`,alignTopLeft:`${oo}--aligned-top-left`,alignBottomLeft:`${oo}--aligned-bottom-left`,alignTopRight:`${oo}--aligned-top-right`,alignBottomRight:`${oo}--aligned-bottom-right`,isFeatureMenuOpen:`${oo}--feature-menu-open`,isActionsMenuOpen:`${oo}--actions-menu-open`,hasFeatureUpdated:`${oo}--feature-updated`,header:WY,headerButtons:`${WY}-buttons`,headerContainer:`${WY}-container`,headerContainerButton:`${WY}-container--button`,headerTitle:`${WY}-title`,content:`${oo}__content`,contentHasFlows:"esri-content--has-flows",contentFlowItem:"esri-content__flow-item",footer:`${oo}__footer`,footerHasPagination:`${oo}__footer--has-pagination`,footerHasActions:`${oo}__footer--has-actions`,footerHasActionsMenu:`${oo}__footer--has-actions-menu`,button:`${oo}__button`,buttonDisabled:`${oo}__button--disabled`,buttonDock:`${oo}__button--dock`,icon:`${oo}__icon`,iconDock:`${oo}__icon--dock-icon`,inlineActionsContainer:`${oo}__inline-actions-container`,actionsMenuButton:`${oo}__actions-menu-button`,actions:`${oo}__actions`,action:`${oo}__action`,actionImage:`${oo}__action-image`,actionText:`${oo}__action-text`,actionToggle:`${oo}__action-toggle`,actionToggleOn:`${oo}__action-toggle--on`,actionExit:`${oo}__action--exit`,actionSelectFeature:`${oo}__action--select-feature`,pointer:`${oo}__pointer`,pointerDirection:`${oo}__pointer-direction`,navigation:`${oo}__navigation`,paginationPrevious:`${oo}__pagination-previous`,paginationNext:`${oo}__pagination-next`,paginationPreviousIconLTR:`${oo}__pagination-previous-icon`,paginationPreviousIconRTL:`${oo}__pagination-previous-icon--rtl`,paginationNextIconLTR:`${oo}__pagination-next-icon`,paginationNextIconRTL:`${oo}__pagination-next-icon--rtl`,featureMenu:`${oo}__feature-menu`,featureMenuList:`${oo}__feature-menu-list`,featureMenuItem:`${oo}__feature-menu-item`,featureMenuViewport:`${oo}__feature-menu-viewport`,featureMenuHeader:`${oo}__feature-menu-header`,featureMenuNote:`${oo}__feature-menu-note`,featureMenuSelected:`${oo}__feature-menu-item--selected`,featureMenuButton:`${oo}__feature-menu-button`,featureMenuTitle:`${oo}__feature-menu-title`,featureMenuObserver:`${oo}__feature-menu-observer`,featureMenuLoader:`${oo}__feature-menu-loader`,collapseButton:`${oo}__collapse-button`,collapseIcon:`${oo}__collapse-icon`},Nni="OBJECTID";var dk;(function(t){t[t.size=22]="size",t[t.lineWidth=50]="lineWidth",t[t.maxSize=120]="maxSize",t[t.maxOutlineSize=80]="maxOutlineSize",t[t.tallSymbolWidth=20]="tallSymbolWidth"})(dk||(dk={}));function d_(){const t=new Float32Array(6);return t[0]=1,t[3]=1,t}function $ni(t){const e=new Float32Array(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Bni(t,e,i,r,n,s){const o=new Float32Array(6);return o[0]=t,o[1]=e,o[2]=i,o[3]=r,o[4]=n,o[5]=s,o}function Gni(t,e){return new Float32Array(t,e,6)}function Ptt(t,e,i,r){const n=e[r],s=e[r+1];t[r]=i[0]*n+i[2]*s+i[4],t[r+1]=i[1]*n+i[3]*s+i[5]}function hIe(t,e,i,r=0,n=0,s=2){const o=n||e.length/s;for(let a=r;a=4,xEe();function Ftt(t){return t=t||globalThis.location.hostname,Jni.some(e=>t?.match(e)!=null)}function Dle(t,e){return t&&(e=e||globalThis.location.hostname)?e.match(Ltt)!=null||e.match(Ntt)!=null?t.replace("static.arcgis.com","staticdev.arcgis.com"):e.match(ktt)!=null||e.match($tt)!=null?t.replace("static.arcgis.com","staticqa.arcgis.com"):t:t}const Ltt=/^devext.arcgis.com$/,ktt=/^qaext.arcgis.com$/,Ntt=/^[\w-]*\.mapsdevext.arcgis.com$/,$tt=/^[\w-]*\.mapsqa.arcgis.com$/,Jni=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,Ltt,ktt,/^jsapps.esri.com$/,Ntt,$tt];function Zni(t,e,i,r){return t.name?t.styleName&&t.styleName==="Esri2DPointSymbolsStyle"?Qni(t,e,r):Cxe(t,e,r).then(n=>Btt(_u(n),t.name,e,i,r)):Promise.reject(new st("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference"))}function Btt(t,e,i,r,n){const s=t.data,o=i&&ye(i.portal)?i.portal:_c.getDefault(),a={portal:o,url:sa(t.baseUrl),origin:"portal-item"},l=s.items.find(v=>v.name===e);if(!l){const v=`The symbol name '${e}' could not be found`;return Promise.reject(new st("symbolstyleutils:symbol-name-not-found",v,{symbolName:e}))}let c=ew(Nze(l,r),a),d=l.thumbnail?.href??null;const p=l.thumbnail&&l.thumbnail.imageData;Ftt()&&(c=Dle(c)??"",d=Dle(d));const y={portal:o,url:sa(VH(c)),origin:"portal-item"};return iq(c,n).then(v=>{const S=r==="cimRef"?Use(v.data):v.data,I=JW(S,y);if(I&&_R(I)){if(d){const O=ew(d,a);I.thumbnail=new zL({url:O})}else p&&(I.thumbnail=new zL({url:`data:image/png;base64,${p}`}));t.styleUrl?I.styleOrigin=new LW({portal:i.portal,styleUrl:t.styleUrl,name:e}):t.styleName&&(I.styleOrigin=new LW({portal:i.portal,styleName:t.styleName,name:e}))}return I})}function Qni(t,e,i){const r=Gze.replace(/\{SymbolName\}/gi,t.name),n=ye(e.portal)?e.portal:_c.getDefault();return iq(r,i).then(s=>{const o=Use(s.data);return JW(o,{portal:n,url:sa(VH(r)),origin:"portal-item"})})}const esi=Object.freeze(Object.defineProperty({__proto__:null,fetchSymbolFromStyle:Btt,resolveWebStyleSymbol:Zni},Symbol.toStringTag,{value:"Module"}));dk.size,dk.maxSize,dk.maxOutlineSize,dk.lineWidth,dk.tallSymbolWidth;function Gtt(t){return t&&"opacity"in t?t.opacity*Gtt(t.parent):1}async function tsi(t,e){if(!t)return;const i=t.sourceLayer,r=(ye(e)&&e.useSourceLayer?i:t.layer)??i,n=Gtt(r);if(ye(t.symbol)&&(!ye(e)||e.ignoreGraphicSymbol!==!0)){const O=t.symbol.type==="web-style"?await nXt(t.symbol,{...e,cache:ye(e)?e.webStyleCache:null}):t.symbol.clone();return SCe(O,null,n),O}const s=(ye(e)?e.renderer:null)??(r&&"renderer"in r?r.renderer:null);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(t,e):null;if(!o)return;if(o=o.type==="web-style"?await o.fetchSymbol({...e,cache:ye(e)?e.webStyleCache:null}):o.clone(),!(s&&"visualVariables"in s&&s.visualVariables&&s.visualVariables.length))return SCe(o,null,n),o;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&(lt(e)||lt(e.arcade))){const O={...e};O.arcade=await Wv(),e=O}const a=await Promise.resolve().then(()=>Rse),l=[],c=[],d=[],p=[];for(const O of s.visualVariables)switch(O.type){case"color":l.push(O);break;case"opacity":c.push(O);break;case"rotation":p.push(O);break;case"size":O.target||d.push(O)}const y=!!l.length&&l[l.length-1],v=y?a.getColor(y,t,e):null,S=!!c.length&&c[c.length-1];let I=S?a.getOpacity(S,t,e):null;if(n!=null&&(I=I!=null?I*n:n),SCe(o,v,I),d.length){const O=a.getAllSizes(d,t,e);await hKe(o,O)}for(const O of p)dKe(o,a.getRotationAngle(O,t,e),O.axis);return o}let isi=class{constructor(e,i){this._owner=i,this._properties={},this._afterDispatchHandle=null;for(const r in e){const n=e[r],s=new FGe(n,void 0,void 0,2,2);this._properties[r]={pool:s,acquired:[]}}this._afterDispatchHandle=mNt(()=>this._release())}destroy(){this._afterDispatchHandle&&(this._afterDispatchHandle.remove(),this._afterDispatchHandle=null);for(const e in this._properties){const i=this._properties[e];for(const r of i.acquired)XGe(r)||i.pool.release(r);i.pool.destroy(),i.pool=null,i.acquired=null}this._properties=null,this._owner=null}get(e){const i=this._owner._get(e),r=this._properties[e];let n=r.pool.acquire();for(r.acquired.push(n);n===i;)r.acquired.push(n),n=r.pool.acquire();return n}_release(){for(const e in this._properties){const i=this._properties[e];let r=0;for(const n of i.acquired)XGe(n)?i.acquired[r++]=n:i.pool.release(n);i.acquired.length=r}}};const rsi=Gi("mac")?"Meta":"Ctrl",Fle={8:"Backspace",9:"Tab",13:"Enter",27:"Escape",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete"};for(let t=48;t<58;t++)Fle[t]=String.fromCharCode(t);for(let t=1;t<25;t++)Fle[111+t]=`F${t}`;for(let t=65;t<91;t++)Fle[t]=[String.fromCharCode(t+32),String.fromCharCode(t)];function nsi(t){if(t.key!==void 0)return aL(t);const e=Fle[t.keyCode];return Array.isArray(e)?t.shiftKey?e[1]:e[0]:e}function ssi(t){switch(t){case"Ctrl":case"Alt":case"Shift":case"Meta":case"Primary":return!0}return!1}let osi=class{constructor(e,i=[]){this.eventType=e,this.keyModifiers=i}matches(e){if(e.type!==this.eventType)return!1;if(this.keyModifiers.length===0)return!0;const i=e.modifiers;for(const r of this.keyModifiers)if(!i.has(r))return!1;return!0}};const Vtt=Ei.getLogger("esri.views.input.InputHandler");let Dm=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 i=this._incoming[e];for(const r of i)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?Vtt.error("This InputHandler has already been registered with an InputManager"):(e.setEventCallback(i=>this._handleEvent(i)),e.setUninstallCallback(()=>this._onUninstall()),this._manager=e)}onUninstall(){}registerIncoming(e,i,r){let n;typeof i=="function"?(r=i,n=[]):n=i||[];const s=typeof e=="string"?new osi(e,n):e,o=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},a=d=>{const p=this._incoming[d.match.eventType];if(p){const y=p.indexOf(d);p.splice(y,1),o(),this._manager&&this._manager.updateDependencies()}},l=new asi(s,r,{onPause:a,onRemove:a,onResume:d=>{const p=this._incoming[d.match.eventType];p&&!p.includes(d)&&(p.push(d),o(),this._manager&&this._manager.updateDependencies())}});let c=this._incoming[s.eventType];return c||(c=[],this._incoming[s.eventType]=c),c.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 i=new lsi(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]=i,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),i}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):Vtt.error("This InputHandler is not registered with an InputManager")}_handleEvent(e){const i=this._incoming[e.type];if(i){for(const r of i)if(r.match.matches(e)&&(r.callback?.(e),e.shouldStopPropagation()))break}}},asi=class{constructor(e,i,r){this.match=e,this._callback=i,this._handler=r}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}},lsi=class{constructor(e,i){this.eventType=e,this._removed=!1,this._handler=i}emit(e,i,r){this._removed||this._handler.onEmit(this,e,i,r)}remove(){this._removed=!0,this._handler.onRemove(this)}},usi=class extends Dm{constructor(e){super(!0),this._onChange=e,this._value="mouse",this._x=null,this._y=null,this.registerIncoming("pointer-move",i=>{this._update(i.data)})}_update(e){const i=e.native.pointerType==="touch"?"touch":"mouse",{x:r,y:n}=e;i===this._value&&this._x===r&&this._y===n||(this._value=i,this._x=r,this._y=n,this._onChange(i,r,n))}},Lle=class{constructor(e){this._observable=new z_e,this._value=e}get(){return Ia(this._observable),this._value}set(e){e!==this._value&&(this._value=e,this._observable.notify())}},csi=class extends Dm{get multiTouchActive(){return this._multiTouchActive.get()}constructor(){super(!0),this._activeTouchPointerIds=new Set,this._multiTouchActive=new Lle(!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.set(this._activeTouchPointerIds.size>1)}},vT=class extends fn{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=rsi,this._latestPointerType="mouse",this._propertiesPool=new isi({latestPointerLocation:dsi},this),this.latestPointerLocation=null,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 i of e)this.uninstallHandlers(i);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}installHandlers(e,i,r=_T.INTERNAL){if(this._nameToGroup[e])return void Ei.getLogger(this.declaredClass).error("There is already an InputHandler group registered under the name `"+e+"`");if(i.length===0)return void Ei.getLogger(this.declaredClass).error("Can't register a group of zero handlers");const n={name:e,handlers:i.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,c,d,p)=>{this._emitInputEvent(o.priorityIndex+1,a,l,c,p,d)},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 i=this._nameToGroup[e];i?(i.handlers.forEach(r=>{r.removed=!0,r.uninstallCallback?.()}),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):Ei.getLogger(this.declaredClass).error("There is no InputHandler group registered under the name `"+e+"`")}hasHandlers(e){return this._nameToGroup[e]!==void 0}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const e=new Set,i=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)ssi(a)||i.add(a)}n.active=s}this._sourceEvents=e,this._keyModifiers=i,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,i,r){this._latestPointerType=e;const n=this._get("latestPointerLocation");if(lt(n)||n.x!==i||n.y!==r){const s=this._propertiesPool.get("latestPointerLocation");s.x=i,s.y=r,this._set("latestPointerLocation",s)}}_onEventReceived(e,i){if(e==="pointer-capture-lost"){const s=i;this._pointerCaptures.delete(s.native.pointerId)}this._updateKeyModifiers(e,i);const r=this.test.timestamp!=null?this.test.timestamp:i.native?i.native.timestamp:void 0,n=i.native?i.native.cancelable:void 0;this._emitInputEventFromSource(e,i,r,n)}_updateKeyModifiers(e,i){if(!i)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=i.key;this._keyModifiers.has(a)&&s(a,e==="key-down")}const o=i.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 usi((e,i,r)=>this._setLatestPointer(e,i,r)),this._multiTouchHandler=new csi,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],_T.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,_T.INTERNAL)}_setPointerCapture(e,i,r,n){const s=e.name+"-"+i.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,i,r,n){this._emitInputEvent(0,e,i,r,n)}_emitInputEvent(e,i,r,n,s,o){const a=n!==void 0?n:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),l=s!==void 0&&s,c={event:new hsi(i,r,a,o||this._activeKeyModifiers,l),priorityIndex:e};this._currentPropagation?this._currentPropagation.events.push(c):this._doNewPropagation(c)}_doNewPropagation(e){this._currentPropagation={events:new lq,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){const e=_u(this._currentPropagation);for(;e.events.length>0;){const{event:i,priorityIndex:r}=e.events.pop(),n=i.data&&i.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&&!i.shouldStopPropagation()&&e.currentHandler.eventCallback?.(i),i.shouldStopPropagation()){n!=null&&this._stoppedPropagationEventIds.add(n);break}if(i.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:i,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 i=new lq;i.push(e);const r=this._currentPropagation;if(r){for(;r.events.length;)i.push(r.events.pop());r.events=i,r.currentHandler=null}}_compareHandlerPriority(e,i){if(e.handler.hasSideEffects!==i.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==i.groupPriority)return e.groupPriority>i.groupPriority?-1:1;for(const r of e.handler.incomingEventMatches)for(const n of i.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>i.priorityIndex?-1:1}_sortHandlersPriority(e){const i=[];for(const r of e){let n=0;for(;n=0;)n++;i.splice(n,0,r)}return i}get debug(){const e=i=>{const r=this._setPointerCapture;this._setPointerCapture=()=>{},i(),this._setPointerCapture=r};return{injectEvent:(i,r)=>{e(()=>{this._onEventReceived(i,r)})},disablePointerCapture:e}}};E([k({readOnly:!0})],vT.prototype,"hasPendingInputs",null),E([k({constructOnly:!0})],vT.prototype,"eventSource",void 0),E([k({constructOnly:!0})],vT.prototype,"recognizers",void 0),E([k()],vT.prototype,"_latestPointerType",void 0),E([k()],vT.prototype,"latestPointerType",null),E([k()],vT.prototype,"multiTouchActive",null),E([k({readOnly:!0})],vT.prototype,"latestPointerLocation",void 0),vT=E([ht("esri.views.input.InputManager")],vT);let hsi=class{constructor(e,i,r,n,s){this.type=e,this.data=i,this.timestamp=r,this.modifiers=n,this.cancelable=s,this._propagationState=_M.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=_M.STOPPED}shouldStopPropagation(){return(this._propagationState&_M.STOPPED)!=0}async(e){this._propagationState|=_M.PAUSED;const i=(r,n)=>{this._propagationState&=~_M.PAUSED;const s=this._resumeCallback;if(this._resumeCallback=null,s&&s(),n)throw r;return r};return(typeof e=="function"?e():e).then(r=>i(r,!1),r=>i(r,!0))}shouldPausePropagation(e){return!!(this._propagationState&_M.PAUSED)&&(this._resumeCallback=e,!0)}preventDefault(){this.data.native.preventDefault()}};var _M;(function(t){t[t.NONE=0]="NONE",t[t.STOPPED=1]="STOPPED",t[t.PAUSED=2]="PAUSED"})(_M||(_M={}));const _T={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3},dsi=class{};function Utt(t){return t&&typeof t.highlight=="function"}const jtt=t=>{let e=class extends t{constructor(...i){super(...i),this.goToOverride=null,this.view=null}callGoTo(i){const{view:r}=this;return ig(r),this.goToOverride?this.goToOverride(r,i):r.goTo(i.target,i.options)}};return E([k()],e.prototype,"goToOverride",void 0),E([k()],e.prototype,"view",void 0),e=E([ht("esri.widgets.support.GoTo")],e),e},YY=fr.ofType({key:"type",defaultKeyValue:"button",base:Yne,typeMap:{button:c9,toggle:Zje}}),psi=()=>[uk.clone()],fsi=()=>[QB.clone(),eG.clone()];let Fl=class extends jtt(Ctt){get isLoadingFeature(){return this.featureViewModels.some(e=>e.waitingForContent)}constructor(e){super(e),this._handles=new uf,this._pendingPromises=new Set,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this.featurePage=null,this.actions=new YY,this.activeFeature=null,this.defaultPopupTemplateEnabled=!1,this.autoCloseEnabled=!1,this.autoOpenEnabled=!0,this.browseClusterEnabled=!1,this.content=null,this.featuresPerPage=20,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new js({symbol:new iw({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}initialize(){this._handles.add([Qi(()=>[this.autoOpenEnabled,this.view],()=>this._autoOpenEnabledChange()),this.on("view-change",()=>this._autoClose()),Qi(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),Qi(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),Qi(()=>this.view?.animation?.state,e=>this._animationStateChange(e)),Qi(()=>this.location,e=>this._locationChange(e)),Qi(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),Qi(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),Qi(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),Qi(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",e=>Oni({event:e,view:this.view})),Hg(()=>!this.waitingForResult,()=>this._waitingForResultChange(),Nu),Qi(()=>[this.features,this.view?.map,this.view?.spatialReference],()=>this._updateFeatureVMs()),Qi(()=>this.view?.scale,()=>this._viewScaleChange()),Hg(()=>!this.visible,()=>this.browseClusterEnabled=!1),Qi(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelFetchingFeatures(),this._handles.destroy(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new YY;e.removeAll();const{actions:i,defaultActions:r,defaultPopupTemplateEnabled:n,includeDefaultActions:s,selectedFeature:o}=this,a=s?r.concat(i):i,l=o&&(typeof o.getEffectivePopupTemplate=="function"&&o.getEffectivePopupTemplate(n)||o.popupTemplate),c=l&&l.actions,d=l&&l.overwriteActions?c:c?c.concat(a):a;return d&&d.filter(Boolean).forEach(p=>e.add(p)),e}get defaultActions(){const e=this._get("defaultActions")||new YY;return e.removeAll(),e.addMany(ck(this.selectedFeature)?fsi():psi()),e}get featureCount(){return this.features.length}get features(){return this._get("features")||[]}set features(e){const i=e||[];this._set("features",i);const{pendingPromisesCount:r,promiseCount:n,selectedFeatureIndex:s}=this,o=n&&i.length;o&&r&&s===-1?this.selectedFeatureIndex=0:o&&s!==-1||(this.selectedFeatureIndex=i.length?0:-1)}get location(){return this._get("location")||null}set location(e){let i=e;const r=this.view?.spatialReference?.isWebMercator;e&&e?.spatialReference?.isWGS84&&r&&(i=Q3(e)),this._set("location",i)}get pendingPromisesCount(){return this._pendingPromises.size}get waitingForResult(){return!(!(this._fetchFeaturesController||this.pendingPromisesCount>0)||this.featureCount!==0)}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){if(this._pendingPromises.clear(),this.features=[],!Array.isArray(e)||!e.length)return this._set("promises",[]),void this.notifyChange("pendingPromisesCount");this._set("promises",e),(e=e.slice(0)).forEach(i=>{this._pendingPromises.add(i);const r=s=>{this._pendingPromises.has(i)&&this._updateFeatures(s),this._updatePendingPromises(i)},n=()=>this._updatePendingPromises(i);i.then(r,n)}),this.notifyChange("pendingPromisesCount")}get selectedFeature(){const{features:e,selectedFeatureIndex:i}=this;return i===-1?null:e[i]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return typeof e=="number"?e:-1}set selectedFeatureIndex(e){const{featureCount:i}=this;e=isNaN(e)||e<-1||!i?-1:(e+i)%i,this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get state(){return this.get("view.ready")?"ready":"disabled"}centerAtLocation(){const{view:e}=this,i=Itt(this);return i&&e?this.callGoTo({target:{target:i,scale:e.scale}}):Promise.reject(new st("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:i,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,i){const{view:r}=this;if(!r||!e)throw new st("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:r});return r.fetchPopupFeatures(e,{event:i&&i.event,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:i&&i.signal})}open(e){const i={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:r}=i;delete i.fetchFeatures,r&&this._setFetchFeaturesPromises(i.location);const n=["actionsMenuOpen","collapsed","featureMenuOpen"];for(const s of n)delete i[s];this.set(i)}triggerAction(e){const i=this.allActions.getItemAt(e);i&&!i.disabled&&this.emit("trigger-action",{action:i})}next(){return this.selectedFeatureIndex=this.selectedFeatureIndex+1,this}previous(){return this.selectedFeatureIndex=this.selectedFeatureIndex-1,this}disableClusterBrowsing(){kni(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:i}=this;e?.type==="2d"?ck(i)?(await Fni(this),await Lni(this)):Ei.getLogger(this.declaredClass).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",i):Ei.getLogger(this.declaredClass).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",i)}_animationStateChange(e){this.zoomToLocation||(uk.disabled=e==="waiting-for-target")}_clearBrowsedClusterGraphics(){const e=this.view?.graphics;e&&(e.remove(this.selectedClusterBoundaryFeature),this._selectedClusterFeature&&e.remove(this._selectedClusterFeature)),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(ck(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:i,updateLocationEnabled:r}=this;r&&e&&(!i||i.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:i,featurePage:r,featuresPerPage:n,featureViewModels:s}=this;if(r===null)return;const o=((r-1)*n+i)%i,a=o+n;s.slice(o,a).forEach((l,c)=>{l&&!l.graphic&&(l.graphic=e[o+c])})}async _selectedFeatureChange(e){const{location:i,updateLocationEnabled:r,view:n}=this;if(e&&n){if(this.browseClusterEnabled)return this._selectedClusterFeature&&(n.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),ck(e)?void 0:(e.symbol=await tsi(e),this._selectedClusterFeature=e,void n.graphics.add(this._selectedClusterFeature));!r&&i||!e.geometry?r&&!e.geometry&&this.centerAtLocation().then(()=>{const s=n.center?.clone();s&&(this.location=s)}):this.location=Att(e.geometry)}}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}_setFetchFeaturesPromises(e){return this._fetchFeaturesWithController(this._getScreenPoint(e||this.location)).then(i=>{const{clientOnlyGraphics:r,promisesPerLayerView:n}=i,s=Promise.resolve(r),o=n.map(a=>a.promise);this.promises=[s,...o]})}_destroyFeatureVMs(){this.featureViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:i,featureViewModels:r}=this;if(ck(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!i||!i.length)return;const n=r.slice(0),s=[];i.forEach((o,a)=>{if(!o)return;let l=null;if(n.some((c,d)=>(c&&c.graphic===o&&(l=c,n.splice(d,1)),!!l)),l)s[a]=l;else{const c=new oIe({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:this.view?.spatialReference,graphic:o===e?o:null,map:this.view?.map,view:this.view});s[a]=c}}),n.forEach(o=>o&&!o.destroyed&&o.destroy()),this._set("featureViewModels",s)}_getScreenPoint(e){const{view:i}=this;return i&&e&&typeof i.toScreen=="function"?i.toScreen(e):null}_autoOpenEnabledChange(){const e="auto-fetch-features",{_handles:i,autoOpenEnabled:r}=this;if(i.remove(e),r&&this.view){const n=this.view.on("click",s=>{s.pointerType==="mouse"&&s.button!==0||this._fetchFeaturesAndOpen(s)},_T.WIDGET);i.add(n,e)}}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null,this.notifyChange("waitingForResult")}_fetchFeaturesWithController(e,i){this._cancelFetchingFeatures();const r=new AbortController,{signal:n}=r;this._fetchFeaturesController=r,this.notifyChange("waitingForResult");const s=this.fetchFeatures(e,{signal:n,event:i});return s.catch(()=>{}).then(()=>{this._fetchFeaturesController=null,this.notifyChange("waitingForResult")}),s}_fetchFeaturesAndOpen(e){const{screenPoint:i,mapPoint:r}=e,{view:n}=this;this._fetchFeaturesWithController(i,e).then(s=>{const{clientOnlyGraphics:o,promisesPerLayerView:a,location:l}=s,c=[Promise.resolve(o),...a.map(d=>d.promise)];return n?.popup?.open({location:l||r,promises:c}),s})}_updatePendingPromises(e){e&&this._pendingPromises.has(e)&&(this._pendingPromises.delete(e),this.notifyChange("pendingPromisesCount"))}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,i){return await e.when(),e.whenLayerView(i)}_getHighlightLayer(e){const{layer:i,sourceLayer:r}=e;return r&&"layer"in r&&r.layer?r.layer:r?.type==="map-notes"||r?.type==="subtype-group"?r:i}_getHighlightTarget(e,i){const r=i.type==="imagery"?void 0:"objectIdField"in i?i.objectIdField||Nni:null,n=e.attributes;return n&&r&&n[r]||e}async _highlightActiveFeature(){const e="highlight-active-feature";this._handles.remove(e);const{highlightEnabled:i,view:r,activeFeature:n,visible:s}=this;if(!(n&&r&&i&&s))return;const o=this._getHighlightLayer(n);if(!(o&&o instanceof iu))return;const a=this._getLayerView(r,o);this._highlightActiveFeaturePromise=a;const l=await a;if(!(l&&Utt(l)&&this._highlightActiveFeaturePromise===a&&this.activeFeature&&this.highlightEnabled))return;const c=l.highlight(this._getHighlightTarget(n,o));this._handles.add(c,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this._handles.remove(e);const{selectedFeature:i,highlightEnabled:r,view:n,visible:s}=this;if(!(i&&n&&r&&s))return;const o=this._getHighlightLayer(i);if(!(o&&o instanceof iu))return;const a=this._getLayerView(n,o);this._highlightSelectedFeaturePromise=a;const l=await a;if(!(l&&Utt(l)&&this._highlightSelectedFeaturePromise===a&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const c=l.highlight(this._getHighlightTarget(i,o));this._handles.add(c,e)}_updateFeatures(e){const{features:i}=this;if(!e||!e.length)return;if(!i.length)return void(this.features=e);const r=e.filter(n=>!i.includes(n));this.features=i.concat(r)}};E([k()],Fl.prototype,"featurePage",void 0),E([k()],Fl.prototype,"isLoadingFeature",null),E([k({type:YY})],Fl.prototype,"actions",void 0),E([k({readOnly:!0})],Fl.prototype,"active",null),E([k()],Fl.prototype,"activeFeature",void 0),E([k({readOnly:!0})],Fl.prototype,"allActions",null),E([k({type:Boolean})],Fl.prototype,"defaultPopupTemplateEnabled",void 0),E([k()],Fl.prototype,"autoCloseEnabled",void 0),E([k()],Fl.prototype,"autoOpenEnabled",void 0),E([k()],Fl.prototype,"browseClusterEnabled",void 0),E([k()],Fl.prototype,"content",void 0),E([k({type:YY,readOnly:!0})],Fl.prototype,"defaultActions",null),E([k({readOnly:!0})],Fl.prototype,"featureCount",null),E([k()],Fl.prototype,"features",null),E([k()],Fl.prototype,"featuresPerPage",void 0),E([k()],Fl.prototype,"featureViewModelAbilities",void 0),E([k({readOnly:!0})],Fl.prototype,"featureViewModels",void 0),E([k()],Fl.prototype,"highlightEnabled",void 0),E([k()],Fl.prototype,"includeDefaultActions",void 0),E([k({type:Yi})],Fl.prototype,"location",null),E([k({readOnly:!0})],Fl.prototype,"pendingPromisesCount",null),E([k({readOnly:!0})],Fl.prototype,"selectedClusterBoundaryFeature",void 0),E([k({readOnly:!0})],Fl.prototype,"waitingForResult",null),E([k({readOnly:!0})],Fl.prototype,"promiseCount",null),E([k()],Fl.prototype,"promises",null),E([k({value:null,readOnly:!0})],Fl.prototype,"selectedFeature",null),E([k({value:-1})],Fl.prototype,"selectedFeatureIndex",null),E([k({readOnly:!0})],Fl.prototype,"selectedFeatureViewModel",null),E([k({readOnly:!0})],Fl.prototype,"state",null),E([k()],Fl.prototype,"title",void 0),E([k()],Fl.prototype,"updateLocationEnabled",void 0),E([k()],Fl.prototype,"view",void 0),E([k()],Fl.prototype,"visible",void 0),E([k()],Fl.prototype,"zoomFactor",void 0),E([k()],Fl.prototype,"zoomToLocation",void 0),E([k()],Fl.prototype,"centerAtLocation",null),Fl=E([ht("esri.widgets.Popup.PopupViewModel")],Fl);const ztt=Fl,Htt="selected-index",msi=0,Wtt="popup-spinner",qtt={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},Ytt="esri-popup";function QA(t,e){return e===void 0?`${Ytt}__${t}`:`${Ytt}__${t}-${e}`}const Xtt={closeButton:!0,featureNavigation:!0};let ao=class extends btt(Gf){constructor(e,i){super(e,i),this._blurClose=!1,this._blurContainer=!1,this._containerNode=null,this._mainContainerNode=null,this._featureMenuNode=null,this._actionsMenuNode=null,this._focusClose=!1,this._focusContainer=!1,this._focusDockButton=!1,this._focusFeatureMenuButton=!1,this._focusActionsMenuButton=!1,this._focusFirstFeature=!1,this._focusFirstAction=!1,this._handles=new uf,this._pointerOffsetInPx=16,this._spinner=null,this._feature=null,this._featureMenuIntersectionObserverNode=null,this._featureMenuViewportNode=null,this._rootFlowItemNode=null,this._featureMenuIntersectionObserverCallback=([r])=>{r?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._displaySpinnerThrottled=tk(()=>this._displaySpinner(),msi),this._exitRelatedRecordsActions=new WeakMap,this._featureSelectionActions=new WeakMap,this._flowItems=new fr,this.alignment="auto",this.collapsed=!1,this.collapseEnabled=!0,this.dockEnabled=!1,this.featureMenuOpen=!1,this.headingLevel=2,this.maxInlineActions=3,this.messages=null,this.messagesCommon=null,this.spinnerEnabled=!0,this.viewModel=new ztt,this.visibleElements={...Xtt},this._handleOpenRelatedFeature=r=>{this._openRelatedFeature(r)},this._addSelectedFeatureIndexHandle(),this.addHandles([Qi(()=>this.viewModel?.screenLocation,()=>this._positionContainer()),Qi(()=>[this.viewModel?.active,this.dockEnabled],()=>this._toggleScreenLocationEnabled()),Qi(()=>this.viewModel?.screenLocation,(r,n)=>{!!r!=!!n&&this.reposition()}),Qi(()=>[this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment],()=>this.reposition()),Qi(()=>this.spinnerEnabled,r=>this._spinnerEnabledChange(r)),Qi(()=>this.viewModel?.view?.size,(r,n)=>this._updateDockEnabledForViewSize(r,n)),Qi(()=>this.viewModel?.view,(r,n)=>this._viewChange(r,n)),Qi(()=>this.viewModel?.view?.ready,(r,n)=>this._viewReadyChange(r??!1,n??!1)),Qi(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),Qi(()=>this.selectedFeatureWidget,()=>this._destroyFlowItemWidgets()),Qi(()=>[this.selectedFeatureWidget?.viewModel?.title,this.selectedFeatureWidget?.viewModel?.state],()=>this._setTitleFromFeatureWidget()),Qi(()=>[this.selectedFeatureWidget?.viewModel?.content,this.selectedFeatureWidget?.viewModel?.state],()=>this._setContentFromFeatureWidget()),Hg(()=>!this.collapsed,()=>{this.viewModel?.view?.widthBreakpoint==="xsmall"&&this.viewModel.active&&this.collapseEnabled&&this.viewModel.centerAtLocation()}),ku(()=>this.viewModel?.allActions,"change",()=>this._watchActions()),Qi(()=>this.viewModel?.allActions,()=>this._watchActions(),Fo),Qi(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),ku(()=>this._flowItems,"change",()=>{this.notifyChange("_activeFlowItemWidget"),this.scheduleRender()}),Qi(()=>[this._activeFlowItemWidget?.viewModel?.state,this._activeFlowItemWidget?.viewModel?.title],()=>this.scheduleRender())])}loadDependencies(){return Promise.all([Promise.resolve().then(()=>GXi),Promise.resolve().then(()=>tJi),Promise.resolve().then(()=>iJi),Promise.resolve().then(()=>rJi),Promise.resolve().then(()=>rLe)])}destroy(){this._destroyFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._handles?.destroy(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect()}get actionsMenuId(){return`${this.id}-actions-menu`}get actionsMenuButtonId(){return`${this.id}-actions-menu-button`}get featureMenuId(){return`${this.id}-feature-menu`}get titleId(){return`${this.id}-popup-title`}get contentId(){return`${this.id}-popup-content`}get hasContent(){const{selectedFeatureWidget:e,viewModel:i}=this;if(!e)return!!i?.content;const r=e.viewModel;if(r?.waitingForContent||r?.state==="error")return!0;const n=r?.content;return Array.isArray(n)?!!n.length:!!n}get featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation!=null}get collapsible(){return!!(this.collapseEnabled&&this.viewModel.title&&this.hasContent)}get featureMenuVisible(){return this.featureNavigationVisible&&this.featureMenuOpen}get contentCollapsed(){return this.collapsible&&!this.featureMenuVisible&&this.collapsed}get dividedActions(){return this._divideActions()}get _activeFlowItemWidget(){const{_flowItems:e}=this;return e.getItemAt(e.length-1)||null}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}set actionsMenuOpen(e){this._set("actionsMenuOpen",!!e)}get actionsMenuOpen(){return!!this.viewModel.active&&this._get("actionsMenuOpen")}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=e}get autoOpenEnabled(){return this.viewModel.autoOpenEnabled}set autoOpenEnabled(e){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 currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||qtt}set dockOptions(e){const i={...qtt},r=this.viewModel?.view?.breakpoints,n={};r&&(n.width=r.xsmall,n.height=r.xsmall);const s={...i,...e},o={...i.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 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(){const{_feature:e,visibleElements:i,headingLevel:r,_flowItems:n}=this,{selectedFeatureViewModel:s}=this.viewModel,o={...i,title:!1};return s?(e?(e.viewModel=s,e.visibleElements=o):this._feature=new Eni({flowItems:n,headingLevel:r+1,viewModel:s,visibleElements:o}),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}castVisibleElements(e){return{...Xtt,...e}}blur(){const{active:e}=this.viewModel;e||Ei.getLogger(this.declaredClass).warn("Popup can only be blurred when currently active."),this.visibleElements.closeButton?this._blurClose=!0:this._blurContainer=!0,this.scheduleRender()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,i){return this.viewModel.fetchFeatures(e,i)}focus(){const{active:e}=this.viewModel;e||Ei.getLogger(this.declaredClass).warn("Popup can only be focused when currently active."),this.visibleElements.closeButton?this._focusClose=!0:this._focusContainer=!0,this.scheduleRender()}next(){return this.viewModel.next()}open(e){this._handles.remove(Htt);const i=!!e&&!!e.featureMenuOpen,r=!!e&&!!e.actionsMenuOpen,n={collapsed:!!e&&!!e.collapsed,actionsMenuOpen:r,featureMenuOpen:i};this.viewModel?.view?.widthBreakpoint==="xsmall"&&(n.collapsed=!0),this.set(n),this.viewModel.open(e),this._shouldFocus(e),this._addSelectedFeatureIndexHandle()}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){const{actionsMenuOpen:e,dockEnabled:i,featureMenuVisible:r,dividedActions:n,currentAlignment:s,currentDockPosition:o}=this,{active:a}=this.viewModel,{menuActions:l}=n,c=a&&l.length>1&&e,d=a&&i,p=a&&!i,y=this.selectedFeature?.layer?.title,v=this.selectedFeature?.layer?.id,S={[Yr.alignTopCenter]:s==="top-center",[Yr.alignBottomCenter]:s==="bottom-center",[Yr.alignTopLeft]:s==="top-left",[Yr.alignBottomLeft]:s==="bottom-left",[Yr.alignTopRight]:s==="top-right",[Yr.alignBottomRight]:s==="bottom-right",[Yr.isDocked]:d,[Yr.shadow]:p,[Yr.isDockedTopLeft]:o==="top-left",[Yr.isDockedTopCenter]:o==="top-center",[Yr.isDockedTopRight]:o==="top-right",[Yr.isDockedBottomLeft]:o==="bottom-left",[Yr.isDockedBottomCenter]:o==="bottom-center",[Yr.isDockedBottomRight]:o==="bottom-right",[Yr.isFeatureMenuOpen]:r,[Yr.isActionsMenuOpen]:c};return ki("div",{class:this.classes(Yr.base,S),role:"presentation","data-layer-title":y,"data-layer-id":v,bind:this,afterCreate:this._positionContainer,afterUpdate:this._positionContainer},a?[this.renderMainContainer(),this.renderPointer()]:null)}renderLoadingIcon(){return ki("span",{"aria-hidden":"true",class:this.classes(Yr.icon,Yr.iconLoading,Yr.rotating)})}renderNavigationLoading(){const{messagesCommon:e}=this;return this.viewModel.pendingPromisesCount?ki("div",{key:QA("loading-container"),role:"presentation",class:Yr.loadingContainer,"aria-label":e.loading,title:e.loading},this.renderLoadingIcon()):null}renderPreviousIcon(){const e=mT(this.container),i={[Yr.iconRightTriangleArrow]:e,[Yr.paginationPreviousIconRTL]:e,[Yr.iconLeftTriangleArrow]:!e,[Yr.paginationPreviousIconLTR]:!e};return ki("span",{"aria-hidden":"true",class:this.classes(Yr.icon,i)})}renderPreviousButton(){const{messages:e}=this;return ki("div",{role:"button",tabIndex:0,bind:this,onclick:this._previous,onkeydown:this._previous,class:this.classes(Yr.button,Yr.paginationPrevious),"aria-label":e.previous,title:e.previous},this.renderPreviousIcon())}renderNextIcon(){const e=mT(this.container),i={[Yr.iconLeftTriangleArrow]:e,[Yr.paginationNextIconRTL]:e,[Yr.iconRightTriangleArrow]:!e,[Yr.paginationNextIconLTR]:!e};return ki("span",{"aria-hidden":"true",class:this.classes(Yr.icon,i)})}renderNextButton(){const{messages:e}=this;return ki("div",{role:"button",tabIndex:0,bind:this,onclick:this._next,onkeydown:this._next,class:this.classes(Yr.button,Yr.paginationNext),"aria-label":e.next,title:e.next},this.renderNextIcon())}renderFeatureMenuButton(){const{featureMenuOpen:e,featureMenuId:i,messagesCommon:r}=this,{featureCount:n,selectedFeatureIndex:s}=this.viewModel;return ki("div",{role:"button",tabIndex:0,bind:this,onclick:this._toggleFeatureMenu,onkeydown:this._toggleFeatureMenu,afterCreate:this._focusFeatureMenuButtonNode,afterUpdate:this._focusFeatureMenuButtonNode,class:this.classes(Yr.button,Yr.featureMenuButton),"aria-haspopup":"true","aria-controls":i,"aria-expanded":e.toString(),"aria-label":r.menu,title:r.menu},this._getPageText(n,s))}renderNavigationButtons(){return this.featureNavigationVisible?[this.renderPreviousButton(),this.renderNavigationLoading()||this.renderFeatureMenuButton(),this.renderNextButton()]:[]}renderDockIcon(){const{dockEnabled:e}=this,i=this._wouldDockTo(),r={[Yr.iconUndock]:e,[Yr.iconDock]:!e,[Yr.iconDockToRight]:!e&&(i==="top-right"||i==="bottom-right"),[Yr.iconDockToLeft]:!e&&(i==="top-left"||i==="bottom-left"),[Yr.iconDockToTop]:!e&&i==="top-center",[Yr.iconDockToBottom]:!e&&i==="bottom-center"};return ki("span",{"aria-hidden":"true",class:this.classes(r,Yr.icon)})}renderDockButton(){const{dockEnabled:e,messages:i}=this,r=this.viewModel?.view?.widthBreakpoint,n=e?i.undock:i.dock;return r!=="xsmall"&&this.dockOptions?.buttonEnabled?ki("div",{role:"button","aria-label":n,title:n,tabIndex:0,bind:this,onclick:this._toggleDockEnabled,onkeydown:this._toggleDockEnabled,afterCreate:this._focusDockButtonNode,afterUpdate:this._focusDockButtonNode,class:this.classes(Yr.button,Yr.buttonDock)},this.renderDockIcon()):null}renderTitle(){const{title:e}=this.viewModel,{titleId:i,collapsible:r,contentCollapsed:n,messagesCommon:s}=this,o={[Yr.headerContainerButton]:r},a=ki(vle,{level:this.headingLevel,class:Yr.headerTitle,innerHTML:e??""}),l=r?ki("button",{key:`${e}--collapsible`,id:i,title:n?s.expand:s.collapse,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(Yr.headerContainer,o),"aria-expanded":n?"false":"true",onclick:this._toggleCollapsed,type:"button"},a,ki("calcite-icon",{class:Yr.collapseIcon,key:"collapse-icon",icon:n?"chevron-down":"chevron-up",scale:"m"})):ki("div",{key:e??"title",id:i,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(Yr.headerContainer,o)},a);return e?l:null}renderCloseIcon(){return ki("span",{"aria-hidden":"true",class:this.classes(Yr.icon,Yr.iconClose)})}renderCloseButton(){const{visibleElements:e,messagesCommon:i}=this;return e.closeButton?ki("div",{role:"button",tabIndex:0,bind:this,onclick:this._close,onkeydown:this._close,class:Yr.button,"aria-label":i.close,title:i.close,afterCreate:this._closeButtonNodeUpdated,afterUpdate:this._closeButtonNodeUpdated},this.renderCloseIcon()):null}renderHeader(){return ki("header",{class:Yr.header},this.renderTitle(),ki("div",{class:Yr.headerButtons},this.renderDockButton(),this.renderCloseButton()))}renderContentContainer(){const{contentId:e,hasContent:i,contentCollapsed:r,_flowItems:n}=this,{content:s}=this.viewModel,o=n.toArray(),a={[Yr.contentHasFlows]:!!o.length};return i&&!r?ki("div",{key:s??"content",enterAnimation:this._createFeatureUpdatedAnimation(),id:e,class:this.classes(Yr.content,a)},ki("calcite-flow",{bind:this},ki("calcite-flow-item",{bind:this,"data-node-ref":"_rootFlowItemNode",afterCreate:VB,key:"root-flow-item",onCalciteFlowItemBack:this._handleBackClick},this.renderContent()),o.map(l=>this.renderFlowItem(l))),o.map(l=>this.renderFlowItemTooltips(l))):null}renderFlowItem(e){const{messages:i}=this,r=wle(),n="graphic"in e&&!e.isTable;return ki("calcite-flow-item",{bind:this,class:this.classes({[Yr.calciteThemeDark]:!r,[Yr.calciteThemeLight]:r}),heading:e.title??"",description:this._getFlowItemDescription(e),onCalciteFlowItemBack:this._handleBackClick,key:`flow-item-${e.viewModel.uid}`},ki("calcite-action",{class:Yr.actionExit,icon:"move-up",label:i?.exitRelatedRecords,text:i?.exitRelatedRecords,slot:"header-actions-start",bind:this,afterCreate:s=>this._storeExitRelatedRecordsAction(e,s),onclick:this._destroyFlowItemWidgets}),n?ki("calcite-action",{class:Yr.actionSelectFeature,icon:"zoom-to-object",label:i?.selectFeature,text:i?.selectFeature,slot:"header-actions-end",bind:this,afterCreate:s=>this._storeFeatureSelectionAction(e,s),onclick:()=>this._handleOpenRelatedFeature(e)}):null,ki("div",{class:this.classes(Yr.contentFlowItem,{[Yr.calciteThemeDark]:r,[Yr.calciteThemeLight]:!r})},e.render()))}renderFlowItemTooltips(e){const{messages:i,_exitRelatedRecordsActions:r,_featureSelectionActions:n}=this,s=wle(),o=n.get(e);return[ki("calcite-tooltip",{class:this.classes({[Yr.calciteThemeDark]:!s,[Yr.calciteThemeLight]:s}),key:`exit-related-records-tooltip-${e.viewModel.uid}`,label:i?.exitRelatedRecords,overlayPositioning:"fixed",referenceElement:r.get(e),placement:"top"},i?.exitRelatedRecords),o?ki("calcite-tooltip",{class:this.classes({[Yr.calciteThemeDark]:!s,[Yr.calciteThemeLight]:s}),key:`select-related-record-tooltip-${e.viewModel.uid}`,label:i?.selectFeature,overlayPositioning:"fixed",referenceElement:o,placement:"top"},i?.selectFeature):null]}renderActionsMenuButton(){const{actionsMenuId:e,actionsMenuButtonId:i,actionsMenuOpen:r,dividedActions:n,messagesCommon:s}=this,o=r?s.close:s.open,{menuActions:a}=n;return a.length?ki("div",{key:QA("actions-menu-button"),class:this.classes(Yr.button,Yr.actionsMenuButton),role:"button",id:i,"aria-haspopup":"true","aria-controls":r?e:null,tabIndex:0,bind:this,onclick:this._toggleActionsMenu,onkeydown:this._toggleActionsMenu,afterCreate:this._focusActionsMenuButtonNode,afterUpdate:this._focusActionsMenuButtonNode,"aria-label":o,title:o},ki("span",{"aria-hidden":"true",class:Yr.iconActionsMenu})):null}renderMenuActions(){const{actionsMenuId:e,actionsMenuButtonId:i,actionsMenuOpen:r,dividedActions:n}=this,{menuActions:s}=n;return s.length&&r?ki("ul",{id:e,role:"menu","aria-labelledby":i,key:QA("actions"),class:Yr.actions,bind:this,onkeyup:this._handleActionMenuKeyup,afterCreate:this._actionsMenuNodeUpdated,afterUpdate:this._actionsMenuNodeUpdated},s.toArray().map(o=>this.renderAction({action:o,type:"menu-item"}))):null}renderInlineActions(){const{inlineActions:e}=this.dividedActions;return e.length?e.toArray().map(i=>this.renderAction({action:i,type:"inline"})):[]}renderInlineActionsContainer(){const{inlineActions:e,menuActions:i}=this.dividedActions,r=!!e.length,n=!!i.length;return r||n?ki("div",{key:"inline-actions-container","data-inline-actions":r.toString(),"data-menu-actions":n.toString(),class:Yr.inlineActionsContainer},this.renderInlineActions(),this.renderActionsMenuButton(),this.renderMenuActions()):null}renderNavigation(){return this.featureNavigationVisible?ki("section",{key:QA("navigation"),class:this.classes(Yr.navigation)},this.renderNavigationButtons()):null}renderFooter(){const{featureNavigationVisible:e,dividedActions:i}=this,{inlineActions:r,menuActions:n}=i,s=!!r.length,o=!!n.length,a={[Yr.footerHasPagination]:e,[Yr.footerHasActions]:s,[Yr.footerHasActionsMenu]:o};return e||s?ki("div",{key:QA("feature-buttons"),class:this.classes(Yr.footer,a)},this.renderInlineActionsContainer(),this.renderNavigation()):null}renderFeatureMenuContainer(){const{messages:e}=this,{featureViewModels:i,isLoadingFeature:r}=this.viewModel,n=m2(e.selectedFeatures,{total:i.length});return ki("section",{key:QA("menu"),class:Yr.featureMenu},ki("strong",{class:Yr.featureMenuHeader},n),ki("nav",{bind:this,class:Yr.featureMenuViewport,"data-node-ref":"_featureMenuViewportNode",afterCreate:VB},this.renderFeatureMenu(),ki("div",{class:Yr.featureMenuObserver,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),r?ki("div",{class:Yr.featureMenuLoader},this.renderLoadingIcon()):null))}renderPointer(){return this.dockEnabled?null:ki("div",{key:QA("pointer"),class:Yr.pointer,role:"presentation"},ki("div",{class:this.classes(Yr.pointerDirection,Yr.shadow)}))}renderMainContainer(){const{dockEnabled:e,currentAlignment:i,currentDockPosition:r,titleId:n,contentId:s,collapsible:o,hasContent:a,contentCollapsed:l,visibleElements:c}=this,{title:d}=this.viewModel,p=i==="bottom-left"||i==="bottom-center"||i==="bottom-right"||r==="top-left"||r==="top-center"||r==="top-right",y=i==="top-left"||i==="top-center"||i==="top-right"||r==="bottom-left"||r==="bottom-center"||r==="bottom-right",v={[Yr.shadow]:e,[Yr.isCollapsible]:o,[Yr.isCollapsed]:l};return ki("div",{class:this.classes(Yr.main,Yr.widget,v),tabIndex:c.closeButton?void 0:-1,role:"dialog","aria-labelledby":d?n:"","aria-describedby":a&&!l?s:"",bind:this,onkeyup:this._handleMainKeyup,afterCreate:this._mainContainerNodeUpdated,afterUpdate:this._mainContainerNodeUpdated},p?this.renderFooter():null,p?this.renderFeatureMenuContainer():null,this.renderHeader(),this.renderContentContainer(),y?this.renderFooter():null,y?this.renderFeatureMenuContainer():null)}renderContent(){const e=this.viewModel?.content;return e?typeof e=="string"?ki("div",{class:Bd.contentNode,key:e,innerHTML:e}):this.renderNodeContent(e):null}renderActionText(e){return ki("span",{key:"text",class:Yr.actionText},e)}renderActionIcon(e){const i=this._getActionClass(e),r=this._getActionImage(e),n={[Yr.iconLoading]:e.active,[Yr.rotating]:e.active,[Yr.icon]:!!i,[Yr.actionImage]:!e.active&&!!r};return i&&(n[i]=!e.active),ki("span",{key:"icon","aria-hidden":"true",class:this.classes(Yr.icon,n),styles:this._getIconStyles(r)})}renderAction(e){const{action:i,type:r}=e,n=this._getActionTitle(i),s={[Yr.action]:i.type!=="toggle",[Yr.actionToggle]:i.type==="toggle",[Yr.actionToggleOn]:i.type==="toggle"&&i.value,[Yr.buttonDisabled]:i.disabled},o=[this.renderActionIcon(i),this.renderActionText(n)],a=r==="menu-item"?ki("li",{key:i.uid,role:"menuitem",tabIndex:0,title:n,"aria-label":n,class:this.classes(Yr.button,s),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":i.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},o):ki("div",{key:i.uid,role:"button",tabIndex:0,title:n,"aria-label":n,class:this.classes(Yr.button,s),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":i.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},o);return i.visible?a:null}renderFeatureMenuItem(e,i){const{messages:r,messagesCommon:n}=this,{selectedFeatureIndex:s,selectedFeatureViewModel:o}=this.viewModel,a=e===o,l={[Yr.featureMenuSelected]:a},c=a?ki("span",{key:QA(`feature-menu-selected-feature-${s}`),title:r.selectedFeature,"aria-label":r.selectedFeature,class:Yr.iconCheckMark}):null,d=ki("span",{innerHTML:e.title||n.untitled});return ki("li",{role:"menuitem",tabIndex:-1,key:QA(`feature-menu-feature-${s}`),class:this.classes(l,Yr.featureMenuItem),bind:this,"data-feature-index":i,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onkeyup:this._handleFeatureMenuItemKeyup,onclick:this._selectFeature,onkeydown:this._selectFeature,onmouseover:this._setActiveFeature,onmouseleave:this._removeActiveFeature},ki("span",{class:Yr.featureMenuTitle},d,c))}renderFeatureMenu(){const{featureMenuId:e}=this,{featureViewModels:i}=this.viewModel;return i.length>1?ki("ol",{class:Yr.featureMenuList,id:e,bind:this,afterCreate:this._featureMenuNodeUpdated,afterUpdate:this._featureMenuNodeUpdated,onkeyup:this._handleFeatureMenuKeyup,role:"menu"},i.filter(r=>!!r.graphic).map((r,n)=>this.renderFeatureMenuItem(r,n))):null}_storeFeatureSelectionAction(e,i){this._featureSelectionActions.set(e,i),this.scheduleRender()}_storeExitRelatedRecordsAction(e,i){this._exitRelatedRecordsActions.set(e,i),this.scheduleRender()}_getFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description??""}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const i=e.graphic,r=i?.geometry;if(lt(r)||lt(i))return;this._destroyFlowItemWidgets(),await this.viewModel.zoomTo({target:r});const n=Att(r);this.open({features:[i],location:ye(n)?n:void 0})}_destroyFlowItemWidgets(){this._flowItems.removeAll().forEach(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()})}_handleBackClick(){const e=this._flowItems.pop();e&&(this._exitRelatedRecordsActions.delete(e),this._featureSelectionActions.delete(e),"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_getActionTitle(e){const{messages:i,selectedFeature:r,messagesCommon:n}=this,{id:s}=e,o=r?.attributes,a=e.title??"",l=s==="zoom-to-feature"?m2(a,{messages:i}):s==="remove-selected-feature"?m2(a,{messages:n}):s==="zoom-to-clustered-features"||s==="browse-clustered-features"?m2(a,{messages:i}):e.title;return l&&o?m2(l,o):l??""}_getActionClass(e){const{selectedFeature:i}=this,r=i?.attributes,{className:n,image:s}=e,o=s||n?n:Yr.iconDefaultAction;return o&&r?m2(o,r):o??""}_getActionImage(e){const{selectedFeature:i}=this,r=i?.attributes,{image:n}=e;return n&&r?m2(n,r):n??""}_createFeatureUpdatedAnimation(){return qei("enter",Yr.hasFeatureUpdated)}_getInlineActionCount(){const{maxInlineActions:e,featureNavigationVisible:i}=this;if(typeof e!="number")return null;const r=Math.round(e);return Math.max(i?r-1:r,0)}_watchActions(){const{allActions:e}=this.viewModel;this.notifyChange("dividedActions");const i="actions";this._handles.remove(i),e&&e.forEach(r=>{this._handles.add(Qi(()=>[r.uid,r.active,r.className,r.disabled,r.id,r.title,r.image,r.visible],()=>this.scheduleRender()),i)})}_divideActions(){const{allActions:e}=this.viewModel,i=e.filter(o=>o.visible),r=this._getInlineActionCount(),n=r===null,s=r===0;return{inlineActions:n?i.slice(0):s?new fr:i.slice(0,r),menuActions:n?new fr:s?i.slice(0):i.slice(r)}}_featureMenuOpenChanged(e){e?this._focusFirstFeature=!0:this._focusFeatureMenuButton=!0}_actionsMenuOpenChanged(e){e?this._focusFirstAction=!0:this._focusActionsMenuButton=!0}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:i}=this;e&&(this.viewModel.title=e.viewModel?.state==="error"?i.errorMessage:e.viewModel?.title||"")}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_handleFeatureMenuKeyup(e){aL(e)==="Escape"&&(e.stopPropagation(),this._focusFeatureMenuButton=!0,this.featureMenuOpen=!1,this.scheduleRender())}_handleActionMenuKeyup(e){aL(e)==="Escape"&&(e.stopPropagation(),this._focusActionsMenuButton=!0,this.actionsMenuOpen=!1,this.scheduleRender())}_setActiveFeature(e){const{viewModel:i}=this,r=e.currentTarget["data-feature-index"];i.activeFeature=i.features[r]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_handleFeatureMenuItemKeyup(e){const i=aL(e),{_featureMenuNode:r}=this,n=e.currentTarget["data-feature-index"];if(!r)return;const s=r.querySelectorAll("li"),o=s.length;i!=="ArrowUp"?i!=="ArrowDown"?i!=="Home"?i!=="End"||(e.stopPropagation(),s[s.length-1].focus()):(e.stopPropagation(),s[0].focus()):(e.stopPropagation(),s[(n+1+o)%o].focus()):(e.stopPropagation(),s[(n-1+o)%o].focus())}_handleActionMenuItemKeyup(e){const i=aL(e),{_actionsMenuNode:r}=this,n=e.currentTarget.dataset.actionUid,{menuActions:s}=this.dividedActions,o=s.findIndex(c=>c.uid===n);if(!r)return;const a=r.querySelectorAll("li"),l=a.length;i!=="ArrowUp"?i!=="ArrowDown"?i!=="Home"?i!=="End"||(e.stopPropagation(),a[a.length-1].focus()):(e.stopPropagation(),a[0].focus()):(e.stopPropagation(),a[(o+1+l)%l].focus()):(e.stopPropagation(),a[(o-1+l)%l].focus())}_handleMainKeyup(e){const i=aL(e);i==="ArrowLeft"&&(e.stopPropagation(),this.previous()),i==="ArrowRight"&&(e.stopPropagation(),this.next())}_spinnerEnabledChange(e){if(this._destroySpinner(),!e)return;const i=this.get("viewModel.view");this._createSpinner(i)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:i,waitingForResult:r}=this.viewModel;r&&i?e.show({location:i}):e.hide()}_getIconStyles(e){return{"background-image":e?`url(${e})`:""}}async _shouldFocus(e){e?.shouldFocus&&(await F1(()=>this.viewModel?.active===!0),this.focus())}_addSelectedFeatureIndexHandle(){const e=Qi(()=>this.viewModel?.selectedFeatureIndex,(i,r)=>this._selectedFeatureIndexUpdated(i,r));this._handles.add(e,Htt)}_selectedFeatureIndexUpdated(e,i){const{featureCount:r}=this;r&&e!==i&&e!==-1&&(this._destroyFlowItemWidgets(),this.actionsMenuOpen=!1,this.featureMenuOpen=!1,this._mainContainerNode&&(this._mainContainerNode.scrollTop=0),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,e&&!e.destroyed&&e.destroy()),this._feature=null}_isScreenLocationWithinView(e,i){return e.x>-1&&e.y>-1&&e.x<=i.width&&e.y<=i.height}_isOutsideView(e){const{popupHeight:i,popupWidth:r,screenLocation:n,side:s,view:o}=e;if(isNaN(r)||isNaN(i)||!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:i,_containerNode:r,_mainContainerNode:n,viewModel:s}=this,{screenLocation:o,view:a}=s;if(lt(o)||!a||!r)return"top-center";if(!this._isScreenLocationWithinView(o,a))return this._get("currentAlignment")||"top-center";function l(V){return parseInt(V.replace(/[^-\d\.]/g,""),10)}const c=n?window.getComputedStyle(n,null):null,d=c?l(c.getPropertyValue("max-height")):0,p=c?l(c.getPropertyValue("height")):0,{height:y,width:v}=r.getBoundingClientRect(),S=v+i,I=Math.max(y,d,p)+i,O=this._isOutsideView({popupHeight:I,popupWidth:S,screenLocation:o,side:"right",view:a}),L=this._isOutsideView({popupHeight:I,popupWidth:S,screenLocation:o,side:"left",view:a}),N=this._isOutsideView({popupHeight:I,popupWidth:S,screenLocation:o,side:"top",view:a}),G=this._isOutsideView({popupHeight:I,popupWidth:S,screenLocation:o,side:"bottom",view:a});return L?N?"bottom-right":"top-right":O?N?"bottom-left":"top-left":N?G?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(e){return typeof e=="function"?e.call(this):e}_getCurrentAlignment(){const{alignment:e,dockEnabled:i}=this;return i||!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 i=["left","right"];return mT(this.container)&&i.reverse(),e.replace(/leading/gi,i[0]).replace(/trailing/gi,i[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}_wouldDockTo(){return this.dockEnabled?null:this._getDockPosition()}_calculateAutoDockPosition(e){if(e!=="auto")return e;const i=this.viewModel?.view,r=mT(this.container)?"top-left":"top-right";if(!i)return r;const n=i.padding||{left:0,right:0,top:0,bottom:0},s=i.width-n.left-n.right,{breakpoints:o}=i;return o&&s<=o.xsmall?"bottom-center":r}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!this._containerNode)return;const{screenLocation:i}=this.viewModel,{width:r}=this._containerNode.getBoundingClientRect(),n=this._calculatePositionStyle(i,r);n&&Object.assign(this._containerNode.style,n)}_calculateFullWidth(e){const{currentAlignment:i,_pointerOffsetInPx:r}=this;return i==="top-left"||i==="bottom-left"||i==="top-right"||i==="bottom-right"?e+r:e}_calculateAlignmentPosition(e,i,r,n){const{currentAlignment:s,_pointerOffsetInPx:o}=this;if(!r)return;const{padding:a}=r,l=n/2,c=r.height-i,d=r.width-e;return s==="bottom-center"?{top:i+o-a.top,left:e-l-a.left}:s==="top-left"?{bottom:c+o-a.bottom,right:d+o-a.right}:s==="bottom-left"?{top:i+o-a.top,right:d+o-a.right}:s==="top-right"?{bottom:c+o-a.bottom,left:e+o-a.left}:s==="bottom-right"?{top:i+o-a.top,left:e+o-a.left}:s==="top-center"?{bottom:c+o-a.bottom,left:e-l-a.left}:void 0}_calculatePositionStyle(e,i){const{dockEnabled:r,view:n}=this;if(!n)return;if(r)return{left:"",top:"",right:"",bottom:""};if(lt(e)||!i)return;const s=this._calculateFullWidth(i),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,i){e&&i&&(this.close(),this.clear())}_viewReadyChange(e,i){if(e){const r=this.get("viewModel.view");this._wireUpView(r)}else i&&(this.close(),this.clear())}_wireUpView(e){if(this._destroySpinner(),!e)return;const{spinnerEnabled:i}=this;i&&this._createSpinner(e),this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,i,r){const[n,s]=e,[o,a]=i,{width:l=0,height:c=0}=r??{};return n<=l&&o>l||n>l&&o<=l||s<=c&&a>c||s>c&&a<=c}_updateDockEnabledForViewSize(e,i){if(!e||!i)return;const r=this.get("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]=i[0]-n,a[1]=i[1]-s;const{dockOptions:l}=this,c=l.breakpoint;this._dockingThresholdCrossed(o,a,c)&&this._setDockEnabledForViewSize(l),this._setCurrentDockPosition()}_focusDockButtonNode(e){this._focusDockButton&&(this._focusDockButton=!1,e.focus())}_closeButtonNodeUpdated(e){return this._focusClose?(this._focusClose=!1,void e.focus()):this._blurClose?(this._blurClose=!1,void e.blur()):void 0}_mainContainerNodeUpdated(e){return this._mainContainerNode=e,this._focusContainer?(this._focusContainer=!1,void e.focus()):this._blurContainer?(this._blurContainer=!1,void e.blur()):void 0}_featureMenuNodeUpdated(e){if(this._featureMenuNode=e,!e||!this._focusFirstFeature)return;this._focusFirstFeature=!1;const i=e.querySelectorAll("li");i.length&&i[0].focus()}_actionsMenuNodeUpdated(e){if(this._actionsMenuNode=e,!e||!this._focusFirstAction)return;this._focusFirstAction=!1;const i=e.querySelectorAll("li");i.length&&i[0].focus()}_focusFeatureMenuButtonNode(e){this._focusFeatureMenuButton&&(this._focusFeatureMenuButton=!1,e.focus())}_focusActionsMenuButtonNode(e){this._focusActionsMenuButton&&(this._focusActionsMenuButton=!1,e.focus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&(this._featureMenuViewportNode.scrollTop=0)}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:i}=this;if(!i)return;const r=i.active&&!e;i.screenLocationEnabled=r}_shouldDockAtCurrentViewSize(e){const i=e.breakpoint,r=this.viewModel?.view?.ui;if(!r)return!1;const{width:n,height:s}=r;if(isNaN(n)||isNaN(s)||!i)return!1;const o=i.hasOwnProperty("width")&&n<=(i.width??0),a=i.hasOwnProperty("height")&&s<=(i.height??0);return o||a}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}_getPageText(e,i){return this.featureNavigationVisible?m2(this.messages.pageText,{index:i+1,total:e}):null}_destroySpinner(){const{_spinner:e,view:i}=this;e&&(i&&i.ui&&i.ui.remove(e,Wtt),e.destroy(),this._spinner=null)}_createSpinner(e){e&&(this._spinner=new Ani({view:e}),e.ui.add(this._spinner,{key:Wtt,position:"manual"}))}_toggleCollapsed(){this.collapsed=!this.collapsed}_close(){this.close(),this.view&&this.view.focus()}_toggleDockEnabled(){this.dockEnabled=!this.dockEnabled,this._focusDockButton=!0,this.scheduleRender()}_toggleFeatureMenu(){const e=!this.featureMenuOpen;this._featureMenuOpenChanged(e),this.actionsMenuOpen=!1,this.featureMenuOpen=e}_toggleActionsMenu(){const e=!this.actionsMenuOpen;this._actionsMenuOpenChanged(e),this.featureMenuOpen=!1,this.actionsMenuOpen=e}_triggerAction(e){const i=e.currentTarget.dataset.actionUid,{allActions:r}=this.viewModel,n=r.findIndex(o=>o.uid===i),s=r.getItemAt(n);s&&s.type==="toggle"&&(s.value=!s.value),this.actionsMenuOpen=!1,this.viewModel.triggerAction(n)}_selectFeature(e){const i=e.currentTarget["data-feature-index"];isNaN(i)||(this.viewModel.selectedFeatureIndex=i),this.featureMenuOpen=!1,this._focusFeatureMenuButton=!0,this.scheduleRender()}_next(){this.next()}_previous(){this.previous()}};E([k({readOnly:!0})],ao.prototype,"actionsMenuId",null),E([k({readOnly:!0})],ao.prototype,"actionsMenuButtonId",null),E([k({readOnly:!0})],ao.prototype,"featureMenuId",null),E([k({readOnly:!0})],ao.prototype,"titleId",null),E([k({readOnly:!0})],ao.prototype,"contentId",null),E([k({readOnly:!0})],ao.prototype,"hasContent",null),E([k({readOnly:!0})],ao.prototype,"featureNavigationVisible",null),E([k({readOnly:!0})],ao.prototype,"collapsible",null),E([k({readOnly:!0})],ao.prototype,"featureMenuVisible",null),E([k({readOnly:!0})],ao.prototype,"contentCollapsed",null),E([k({readOnly:!0})],ao.prototype,"dividedActions",null),E([k({readOnly:!0,dependsOn:["_flowItems.length"]})],ao.prototype,"_activeFlowItemWidget",null),E([k()],ao.prototype,"actions",null),E([k()],ao.prototype,"actionsMenuOpen",null),E([k()],ao.prototype,"alignment",void 0),E([k()],ao.prototype,"autoCloseEnabled",null),E([k()],ao.prototype,"autoOpenEnabled",null),E([k()],ao.prototype,"defaultPopupTemplateEnabled",null),E([k()],ao.prototype,"content",null),E([k()],ao.prototype,"collapsed",void 0),E([k()],ao.prototype,"collapseEnabled",void 0),E([k({readOnly:!0})],ao.prototype,"currentAlignment",null),E([k({readOnly:!0})],ao.prototype,"currentDockPosition",null),E([k()],ao.prototype,"dockOptions",null),E([k()],ao.prototype,"dockEnabled",void 0),E([k({readOnly:!0})],ao.prototype,"featureCount",null),E([k()],ao.prototype,"featureMenuOpen",void 0),E([k()],ao.prototype,"features",null),E([k()],ao.prototype,"goToOverride",null),E([k()],ao.prototype,"headingLevel",void 0),E([k()],ao.prototype,"highlightEnabled",null),E([k()],ao.prototype,"location",null),E([k()],ao.prototype,"label",null),E([k()],ao.prototype,"maxInlineActions",void 0),E([k(),Vf("esri/widgets/Popup/t9n/Popup")],ao.prototype,"messages",void 0),E([k(),Vf("esri/t9n/common")],ao.prototype,"messagesCommon",void 0),E([k()],ao.prototype,"promises",null),E([k({readOnly:!0})],ao.prototype,"selectedFeature",null),E([k()],ao.prototype,"selectedFeatureIndex",null),E([k({readOnly:!0})],ao.prototype,"selectedFeatureWidget",null),E([k()],ao.prototype,"spinnerEnabled",void 0),E([k()],ao.prototype,"title",null),E([k()],ao.prototype,"updateLocationEnabled",null),E([k()],ao.prototype,"view",null),E([k({type:ztt}),Cri(["triggerAction","trigger-action"])],ao.prototype,"viewModel",void 0),E([k()],ao.prototype,"visible",null),E([k()],ao.prototype,"visibleElements",void 0),E([Zs("visibleElements")],ao.prototype,"castVisibleElements",null),E([Y1()],ao.prototype,"_close",null),E([Y1()],ao.prototype,"_toggleDockEnabled",null),E([Y1()],ao.prototype,"_toggleFeatureMenu",null),E([Y1()],ao.prototype,"_toggleActionsMenu",null),E([Y1()],ao.prototype,"_triggerAction",null),E([Y1()],ao.prototype,"_selectFeature",null),E([Y1()],ao.prototype,"_next",null),E([Y1()],ao.prototype,"_previous",null),ao=E([ht("esri.widgets.Popup")],ao);const Ktt=ao,fIe=[0,0];function gsi(t){const e=(t.ownerDocument||window.document).defaultView,i=t.getBoundingClientRect();return fIe[0]=i.left+(e?.pageXOffset??0),fIe[1]=i.top+(e?.pageYOffset??0),fIe}function Jtt(t){t&&(KZe(t),t.parentNode&&t.parentNode.removeChild(t))}function ysi(t){const e=document.createElement("div");return t.appendChild(e),e}const XY=16,kle=750,vsi=512,_si=2,bsi=t=>{let e=class extends t{constructor(...i){super(...i),this._freqInfo={freq:XY,time:kle},this._overlayRenderTaskHandle=null,this.height=0,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,i.length!==0&&i[0]?.popup!==void 0||(this.popup=new Ktt({view:this})),this.handles.add([Qi(()=>this.cursor,r=>{const{surface:n}=this;n&&n.setAttribute("data-cursor",r)}),Qi(()=>this.interacting,r=>{const{surface:n}=this;n&&n.setAttribute("data-interacting",r.toString())})])}initialize(){this.handles.add(Qi(()=>this.ui,(i,r)=>this._handleUIChange(i,r))),this._wireUI(this.ui),this.handles.add([this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui=ra(this.ui),this.popup&&!this.popup.destroyed&&this.popup.destroy(),this.container=null)}get container(){return this._get("container")??null}set container(i){const r=this._get("container"),n=pEe(i);if(n||typeof i!="string"||Ei.getLogger(this.declaredClass).error("#container",`element with id '${i}' not found`),r===n)return;const s="dom-size";if(this.handles.remove(s),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&&(Jtt(this.root),this._set("root",null)),this.userContent&&(ZZe(this.userContent,r),Jtt(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 o=document.createElement("div");o.className="esri-view-user-storage",ZZe(n,o),n.appendChild(o),this._set("userContent",o);const a=document.createElement("div");a.className="esri-view-root",n.insertBefore(a,n.firstChild),this._set("root",a);const l=document.createElement("div");l.className="esri-view-surface",l.setAttribute("role","application"),l.tabIndex=0,a.appendChild(l),this._set("surface",l);const c=new DQe;a.appendChild(c.surface),this._set("overlay",c),Qi(()=>c.needsRender,d=>{d&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=uL({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=Bc(this._overlayRenderTaskHandle)}),this.forceDOMReadyCycle(),this.handles.add(Qi(()=>this.size,d=>{const[p,y]=d,v="esri-view-surface--inset-outline";p>=document.body.clientWidth||y>=document.body.clientHeight?l.classList.add(v):l.classList.remove(v)},Fo),s),this._set("container",n),this._startMeasuring()}get focused(){const i=document.activeElement===this.surface;return document.hasFocus()&&i}set popup(i){const r=this._get("popup");r&&r!==i&&r.destroy(),this._set("popup",i)}get size(){return[this.width,this.height]}blur(){this.surface&&this.surface.blur()}focus(){this.surface&&this.surface.focus()}pageToContainer(i,r,n){const s=this.position;return i-=s?s[0]:0,r-=s?s[1]:0,n?(n[0]=i,n[1]=r):n=[i,r],n}containerToPage(i,r,n){const s=this.position;return i+=s?s[0]:0,r+=s?s[1]:0,n?(n[0]=i,n[1]=r):n=[i,r],n}_handleUIChange(i,r){r&&(this.handles.remove("ui"),r.destroy()),i&&this._wireUI(i),this._set("ui",i)}_wireUI(i){this.handles.remove("ui"),i&&(i.view=this,this.handles.add([Qi(()=>this.root,r=>{i.container=r?ysi(r):null},Fo),Qi(()=>this.popup,(r,n)=>{const s="popup",o="manual";n&&i.remove(n,s),r&&(r.view=i.view,i.add(r,{key:s,position:o}))},Fo)],"ui"))}_stopMeasuring(){this.handles.remove("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const i=this._freqInfo;i.freq=XY,i.time=kle,this.handles.add([(()=>{const r=()=>{i.freq=XY,i.time=kle};return window.addEventListener("resize",r),{remove(){window.removeEventListener("resize",r)}}})(),uL({prepare:r=>{const n=this._measure(),s=this._freqInfo;if(s.time+=r.deltaTime,n&&(s.freq=XY,this._get("resizing")||this._set("resizing",!0)),s.time=vsi&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const i=this.container,r=i?i.clientWidth:0,n=i?i.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 i=this.container,r=this.position,n=i&&gsi(i);return!!n&&(!r||n[0]!==r[0]||n[1]!==r[1])&&(this._set("position",[n[0],n[1]]),!0)}forceDOMReadyCycle(){}};return E([k()],e.prototype,"container",null),E([k({readOnly:!0})],e.prototype,"focused",null),E([k({readOnly:!0})],e.prototype,"height",void 0),E([k({type:Ktt})],e.prototype,"popup",null),E([k({type:DQe})],e.prototype,"overlay",void 0),E([k({readOnly:!0})],e.prototype,"position",void 0),E([k({readOnly:!0})],e.prototype,"resizing",void 0),E([k({readOnly:!0})],e.prototype,"root",void 0),E([k({value:null,readOnly:!0})],e.prototype,"size",null),E([k({readOnly:!0})],e.prototype,"surface",void 0),E([k({readOnly:!0})],e.prototype,"suspended",void 0),E([k()],e.prototype,"ui",void 0),E([k({readOnly:!0})],e.prototype,"userContent",void 0),E([k({readOnly:!0})],e.prototype,"width",void 0),E([k()],e.prototype,"widthBreakpoint",void 0),e=E([ht("esri.views.DOMContainer")],e),e},wsi=t=>{let e=class extends t{async fetchPopupFeatures(i,r){await this.when();const{location:n,queryArea:s,layerViewsAndGraphics:o,clientOnlyGraphics:a}=await this._prepareFetchPopupFeatures(i,r),l=Promise.resolve(a),c=this._queryLayerPopupFeatures(s,o,r),d=c.map(p=>p.promise);return{location:n,clientOnlyGraphics:a,allGraphicsPromise:AH([l,...d]).then(p=>Array.from(new Set(p.flat()))),promisesPerLayerView:c}}_queryLayerPopupFeatures(i,r,n){return r.map(({layerView:s,graphics:o})=>{const a={clientGraphics:o,event:ye(n)?n.event:void 0,signal:ye(n)?n.signal:void 0,defaultPopupTemplateEnabled:!!ye(n)&&!!n.defaultPopupTemplateEnabled},l=s.fetchPopupFeatures(i,a);return{layerView:s,promise:l}})}_isValidPopupGraphic(i,r){return i&&!!i.getEffectivePopupTemplate(ye(r)&&r.defaultPopupTemplateEnabled)}async _prepareFetchPopupFeatures(i,r){const{clientGraphics:n,queryArea:s,location:o}=await this._popupHitTestGraphics(i,r),a=this._getFetchPopupLayerViews(),{layerViewsAndGraphics:l,clientOnlyGraphics:c}=this._graphicsPerFetchPopupLayerView(n,a);return{clientOnlyGraphics:c,layerViewsAndGraphics:l,queryArea:s,location:o}}async _popupHitTestGraphics(i,r){const n=await this.popupHitTest(i),s=n.results,o=n.mapPoint,a=s.filter(c=>c.type==="graphic"&&this._isValidPopupGraphic(c.graphic,r)),l=a.length?a[0].mapPoint:null;return{clientGraphics:a.map(c=>c.graphic),queryArea:o,location:o||l}}_getFetchPopupLayerViews(){const i=[];return this.allLayerViews.forEach(r=>{this._isValidPopupLayerView(r)&&i.push(r)}),ye(this.graphicsView)&&this._isValidPopupLayerView(this.graphicsView)&&i.push(this.graphicsView),i.reverse()}_isValidPopupLayerView(i){return ye(i)&&(!("layer"in i)||!i.suspended)&&"fetchPopupFeatures"in i}_graphicsPerFetchPopupLayerView(i,r){const n=[],s=new Map,o=r.map(a=>{const l=[];return"layer"in a?s.set(a.layer,l):s.set(a.graphics,l),{layerView:a,graphics:l}});for(const a of i){const l=s.get(a.layer)||s.get(a.sourceLayer)||null;l?l.push(a):n.push(a)}return{layerViewsAndGraphics:o,clientOnlyGraphics:n}}};return e=E([ht("esri.views.PopupView")],e),e};let Nle=class extends Jq{constructor(e){super(e),this.handles.add(this.on("before-add",i=>{lt(i.item)||i.item.parent===this.owner&&(Ei.getLogger(this.declaredClass).warn("Analysis inside the collection must be unique. Not adding this element again."),i.preventDefault())}))}_own(e){e.parent=this.owner}_release(e){e.parent=null}};Nle=E([ht("esri.support.AnalysesCollection")],Nle);let bM=class extends fn{constructor(e){super(e),this.view=null,this.baseLayerViews=new fr,this.referenceLayerViews=new fr,this._loadingHandle=Qi(()=>this.view?.map?.basemap,i=>{i&&i.load().catch(()=>{})},Fo)}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null)}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(i=>i.updating)||this.referenceLayerViews.some(i=>i.updating))}};E([k({constructOnly:!0})],bM.prototype,"view",void 0),E([k({readOnly:!0})],bM.prototype,"baseLayerViews",void 0),E([k({readOnly:!0})],bM.prototype,"referenceLayerViews",void 0),E([k({readOnly:!0})],bM.prototype,"suspended",null),E([k({type:Boolean,readOnly:!0})],bM.prototype,"updating",null),bM=E([ht("esri.views.BasemapView")],bM);function xsi(t){return"tryRecycleWith"in t}let Ssi=class{constructor(e,i,r){this.layer=e,this.view=i,this.layerViewImporter=r,this._controller=new AbortController,this._deferred=Jx(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,ep(this._controller.signal,()=>{const n=new st("cancelled:layerview-create","layerview creation cancelled",{layer:e});this._deferred.reject(n)})}tryRecycle(e){if(!this.done||!this.layerView||!xsi(this.layerView))return null;const i=this.layer.type,r=this._controller.signal;for(let n=0;n(sn(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((c,d)=>ep(this._controller.signal,()=>d(vc())))]),this.promise}}return null}destroy(){this._controller.abort();const{layerView:e}=this;if(!e)return;const{layer:i,view:r}=this;i.emit("layerview-destroy",{view:r,layerView:e}),r.emit("layerview-destroy",{layer:i,layerView:e}),this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null}async start(){if(this._started)return;this._started=!0;const{_controller:{signal:e},layer:i,view:r}=this;this._map=r.map;try{let n,s;if(await i.load({signal:e}),"prefetchResources"in i&&await i.prefetchResources?.({signal:e}),Tsi(i))n=await i.createLayerView(r,{signal:e});else{if(!this.layerViewImporter.hasLayerViewModule(i))throw new st("layer:view-not-supported","No layerview implementation was found");const l=await this.layerViewImporter.importLayerView(i);sn(e),n="default"in l?new l.default({layer:i,view:r}):new l({layer:i,view:r})}const o=()=>{s=Bc(s),n.destroyed||n.destroy(),n.layer=null,n.parent=null,n.view=null,this.done=!0};s=ep(e,o),sn(e);try{await n.when()}catch(l){throw o(),l}if(!this._map?.allLayers?.includes(i))return o(),void this._deferred.reject(new st("view:no-layerview-for-layer","The layer has been removed from the map",{layer:i}));this.layerView=n,i.emit("layerview-create",{view:r,layerView:n}),r.emit("layerview-create",{layer:i,layerView:n}),this.done=!0,this._deferred.resolve(n)}catch(n){i.emit("layerview-create-error",{view:r,error:n}),r.emit("layerview-create-error",{layer:i,error:n}),this.done=!0,this._deferred.reject(new st("layerview:create-error","layerview creation failed",{layer:i,error:n}))}}},vw=class extends fn{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new RR,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const i=this.view.map?.allLayers;if(i)for(const r of i)this.layerViewImporter.hasLayerViewModule(r)&&this.layerViewImporter.importLayerView(r)},this._reschedule=()=>(lt(this._workPromise)&&(this._workPromise=Jx(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(G3(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{const i=this.view.map;if(this._map!==i&&(this.clear(),this._map=i),lt(this._workPromise))return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,n=[],s=this.view.ready,o=l=>{if(!lt(l)){for(const c of l)if(c){r.add(c);const d=this._layerLayerViewInfoMap.get(c);d&&s?d.start():d||this._recyclingInfoMap.has(c)||n.push(c),"layers"in c&&c.layers&&o(c.layers)}}};for(const l of this._rootCollectionNames)o(this.get(l));for(const[l,c]of this._layerLayerViewInfoMap)if(!r.has(l)){this._layerLayerViewInfoMap.delete(c.layer);const d=c.tryRecycle(n);d?(this._recyclingInfoMap.set(c.layer,c),d.then(()=>{this._recyclingInfoMap.delete(c.layer),this._layerLayerViewInfoMap.set(c.layer,c),this._reschedule()}).catch(()=>{this._recyclingInfoMap.delete(c.layer),c.destroy(),this._reschedule()})):c.destroy()}for(const[l,c]of this._recyclingInfoMap)r.has(l)||(this._recyclingInfoMap.delete(c.layer),c.destroy());for(const l of n)this._createLayerView(l);this._refreshCollections();const a=[i?.ground?.layers,i?.basemap?.baseLayers,i?.basemap?.referenceLayers,i?.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.own([ku(()=>this.view?.map?.allLayers,"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),Qi(()=>{const e=this.view,i=e?.map;return[i?.basemap,i?.ground,i?.layers,e?.ready]},()=>this._reschedule(),jh)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),this._watchUpdatingTracking.destroy(),this._map=null,ye(this._workPromise)&&(this._workPromise.reject(vc()),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 ye(this._workPromise)||this._watchUpdatingTracking.updating||Wre(this._layerLayerViewInfoMap,e=>!e.done)}get updatingRemaining(){let e=0;for(const i of this._layerLayerViewInfoMap.values())i.done||++e;return e}clear(){if(!this.destroyed){for(const e of this._layerLayerViewInfoMap.values())e.destroy();this._layerLayerViewInfoMap.clear(),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 st("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,i]of this._layersToLayerViews)this._populateLayerViewsOwners(this.get(e),this.get(i),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(e,i,r){if(!e||!i)return void(i&&i.removeAll());let n=0;for(const s of e){const o=this._layerLayerViewInfoMap.get(s);if(!o||!o.layerView)continue;const a=o.layerView;a.layer=s,a.parent=r,i.getItemAt(n)!==a&&i.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 i=new Ssi(e,this.view,this.layerViewImporter);i.promise.then(()=>this._refreshCollections(),r=>{r&&(ss(r)||r.name==="cancelled:layerview-create")||Ei.getLogger(this.declaredClass).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,i),this.view.ready&&i.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};E([k()],vw.prototype,"_workPromise",void 0),E([k({readOnly:!0})],vw.prototype,"_watchUpdatingTracking",void 0),E([k({readOnly:!0})],vw.prototype,"_layersToLayerViews",null),E([k({readOnly:!0})],vw.prototype,"_rootCollectionNames",null),E([k()],vw.prototype,"layerViewImporter",void 0),E([k()],vw.prototype,"supportsGround",void 0),E([k({readOnly:!0})],vw.prototype,"updating",null),E([k({readOnly:!0})],vw.prototype,"updatingRemaining",null),E([k({constructOnly:!0})],vw.prototype,"view",void 0),vw=E([ht("esri.views.LayerViewManager")],vw);const Csi=vw;function Tsi(t){return"createLayerView"in t&&t.createLayerView!=null}let J1=class extends fn{constructor(e){super(e),this.factor=1.5,this.offset=Vh(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}};E([k({type:Number})],J1.prototype,"factor",void 0),E([k({nonNullable:!0})],J1.prototype,"offset",void 0),E([k()],J1.prototype,"position",void 0),E([k({type:Number,range:{min:0}})],J1.prototype,"size",void 0),E([k()],J1.prototype,"maskUrl",void 0),E([k()],J1.prototype,"maskEnabled",void 0),E([k()],J1.prototype,"overlayUrl",void 0),E([k()],J1.prototype,"overlayEnabled",void 0),E([k({readOnly:!0})],J1.prototype,"version",null),E([k({type:Boolean})],J1.prototype,"visible",void 0),J1=E([ht("esri.views.Magnifier")],J1);const Ztt=J1;let Esi=class{constructor(){this._tasks=new Array,this._running=new Lle(!1)}get length(){return this._tasks.length}get running(){return this._running.get()}destroy(){this.cancelAll()}runTask(e){for(;!e.done&&this._process(e);)e.madeProgress()}push(e,i,r){return this._running.set(!0),new Promise((n,s)=>this._tasks.push(new Qtt(n,s,e,i,r)))}unshift(e,i,r){return this._running.set(!0),new Promise((n,s)=>this._tasks.unshift(new Qtt(n,s,e,i,r)))}_process(e){if(this._tasks.length===0)return!1;const i=this._tasks.shift();try{const r=bm(i.signal);if(r&&!i.abortCallback)i.reject(vc());else{const n=r?i.abortCallback?.(vc()):i.callback(e);Ip(n)?n.then(i.resolve,i.reject):i.resolve(n)}}catch(r){i.reject(r)}return this._running.set(this._tasks.length>0),!0}cancelAll(){const e=vc();for(const i of this._tasks)if(i.abortCallback){const r=i.abortCallback(e);i.resolve(r)}else i.reject(e);this._tasks.length=0,this._running.set(!1)}},Qtt=class{constructor(e,i,r,n,s){this.resolve=e,this.reject=i,this.callback=r,this.signal=n,this.abortCallback=s}},KY=class extends fn{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};E([k()],KY.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),E([k()],KY.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),KY=E([ht("esri.views.support.DebugFlags")],KY);const Isi=new KY;var Z1;(function(t){t[t.ANIMATING=0]="ANIMATING",t[t.INTERACTING=1]="INTERACTING",t[t.IDLE=2]="IDLE"})(Z1||(Z1={}));var mIe,sl;(function(t){t[t.YIELD=1]="YIELD"})(mIe||(mIe={})),function(t){t.RESOURCE_CONTROLLER_IMMEDIATE="immediate",t.RESOURCE_CONTROLLER="schedule",t.SLIDE="slide",t.STREAM_DATA_LOADER="stream loader",t.ELEVATION_QUERY="elevation query",t.TERRAIN_SURFACE="terrain",t.SURFACE_GEOMETRY_UPDATES="surface geometry updates",t.LOD_RENDERER="LoD renderer",t.GRAPHICS_CORE="Graphics3D",t.I3S_CONTROLLER="I3S",t.POINT_CLOUD_LAYER="point cloud",t.FEATURE_TILE_FETCHER="feature fetcher",t.OVERLAY="overlay",t.STAGE="stage",t.GRAPHICS_DECONFLICTOR="graphics deconflictor",t.FILTER_VISIBILITY="Graphics3D filter visibility",t.SCALE_VISIBILITY="Graphics3D scale visibility",t.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",t.POINT_OF_INTEREST_FREQUENT="POI frequent",t.POINT_OF_INTEREST_INFREQUENT="POI infrequent",t.LABELER="labeler",t.FEATURE_QUERY_ENGINE="feature query",t.FEATURE_TILE_TREE="feature tile tree",t.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",t.ELEVATION_ALIGNMENT="elevation alignment",t.TEXT_TEXTURE_ATLAS="text texture atlas",t.TEXTURE_UNLOAD="texture unload",t.LINE_OF_SIGHT_TOOL="line of sight tool",t.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",t.ELEVATION_PROFILE="elevation profile",t.SNAPPING="snapping",t.SHADOW_ACCUMULATOR="shadow accumulator",t.CLOUDS_GENERATOR="clouds generator",t[t.TEST_PRIO=1]="TEST_PRIO"}(sl||(sl={}));const bT=0,eit=new Map([[sl.RESOURCE_CONTROLLER_IMMEDIATE,bT],[sl.RESOURCE_CONTROLLER,4],[sl.SLIDE,bT],[sl.STREAM_DATA_LOADER,bT],[sl.ELEVATION_QUERY,bT],[sl.TERRAIN_SURFACE,1],[sl.SURFACE_GEOMETRY_UPDATES,1],[sl.LOD_RENDERER,2],[sl.GRAPHICS_CORE,2],[sl.I3S_CONTROLLER,2],[sl.POINT_CLOUD_LAYER,2],[sl.FEATURE_TILE_FETCHER,2],[sl.OVERLAY,4],[sl.STAGE,4],[sl.GRAPHICS_DECONFLICTOR,4],[sl.FILTER_VISIBILITY,4],[sl.SCALE_VISIBILITY,4],[sl.FRUSTUM_VISIBILITY,4],[sl.CLOUDS_GENERATOR,4],[sl.POINT_OF_INTEREST_FREQUENT,6],[sl.POINT_OF_INTEREST_INFREQUENT,30],[sl.LABELER,8],[sl.FEATURE_QUERY_ENGINE,8],[sl.FEATURE_TILE_TREE,16],[sl.FEATURE_TILE_TREE_ACTIVE,bT],[sl.ELEVATION_ALIGNMENT,12],[sl.TEXT_TEXTURE_ATLAS,12],[sl.TEXTURE_UNLOAD,12],[sl.LINE_OF_SIGHT_TOOL,16],[sl.LINE_OF_SIGHT_TOOL_INTERACTIVE,bT],[sl.SNAPPING,bT],[sl.SHADOW_ACCUMULATOR,30]]);function tit(t){return eit.has(t)?eit.get(t):typeof t=="number"?t:1}const iit=6.5,rit=1,Asi=30,nit=1e3/30,sit=100,oit=.9;var gIe,fk;(function(t){class e{get updating(){return this._updating.get()}_updatingChanged(){this._updating.set(this._tasks.some(s=>s.needsUpdate))}constructor(){this._updating=new Lle(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new EH("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new r,this._state=Z1.INTERACTING,this._tasks=new _m,this._runQueue=new _m,this._load=0,this._idleStateCallbacks=new _m,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=Qi(()=>Isi.SCHEDULER_LOG_SLOW_TASKS,o=>this._debug=o,Fo);for(const o of Object.keys(sl))this.performanceInfo.tasks.set(sl[o],new EH(sl[o]));const s=this;this._test={FRAME_SAFETY_BUDGET:iit,INTERACTING_BUDGET:nit,IDLE_BUDGET:sit,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(),Bc(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=tit(s),l=new i(this,s,o,a);return this._tasks.push(l),this._updatingChanged(),this.performanceInfo.tasks.has(s)||this.performanceInfo.tasks.set(s,new EH(s)),l}registerIdleStateCallbacks(s,o){const a={idleBegin:s,idleEnd:o};this._idleStateCallbacks.push(a),this.state===Z1.IDLE&&this._idleUpdatesStartFired&&a.idleBegin();const l=this;return{remove:()=>this._removeIdleStateCallbacks(a),set idleBegin(c){l._idleUpdatesStartFired&&(a.idleEnd(),l._state===Z1.IDLE&&c()),a.idleBegin=c},set idleEnd(c){a.idleEnd=c}}}get load(){return this._load}set state(s){this._state!==s&&(this._state=s,this.state!==Z1.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=iit,a=s.frameDuration,l=rit;switch(this.state){case Z1.IDLE:o=0,a=Math.max(sit,s.frameDuration),l=Asi;break;case Z1.INTERACTING:a=Math.max(nit,s.frameDuration);case Z1.ANIMATING:}return a=a-s.elapsedFrameTime-o,this.state!==Z1.IDLE&&as.idleBegin())),this._runIdle();break;case Z1.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 fk.SCHEDULED;let o=fk.IDLE;return this._tasks.forAll(a=>{a.name===s&&a.needsUpdate&&(a.schedulePriority<=1?o=fk.READY:o!==fk.READY&&(o=fk.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*oit+s*(1-oit)}_schedule(){for(this._runQueue.filterInPlace(s=>!!s.needsUpdate||(s.schedulePriority=s.basePriority,!1)),this._tasks.forAll(s=>{s.basePriority===bT&&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!==bT&&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)===mIe.YIELD&&(a.blockFrame=this._frameNumber)}catch(c){Ei.getLogger("esri.views.support.Scheduler").error(`Exception in task "${a.name}"`,c)}!this._budget.hasProgressed&&a.blockFrame!==this._frameNumber&&a.needsUpdate&&(a.name,sl.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(sl))this._frameTaskTimes.set(sl[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}}t.Scheduler=e;class i{get task(){return this._task.get()}get updating(){return this._queue.running}constructor(s,o,a,l){this._scheduler=s,this.name=o,this._basePriority=l,this.blockFrame=0,this.runtime=0,this._queue=new Esi,this._handles=new uf,this.schedulePriority=this._basePriority,this._task=new Lle(ye(a)?a:this._queue),this._handles.add(Hg(()=>this.task.running,c=>s.taskRunningChanged(c)))}remove(){this.processQueue($le),this._scheduler.removeTask(this),this.schedule=yIe.schedule,this.reschedule=yIe.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(s){this.name=s;const o=tit(s);this._basePriority!==bT&&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){this._queue.runTask(s)}}class r{constructor(){this._begin=typeof performance<"u"?performance.now():0,this._budget=0,this._state=Z1.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}}t.Budget=r})(gIe||(gIe={})),function(t){t.SCHEDULED="s",t.READY="r",t.WAITING="w",t.IDLE="i"}(fk||(fk={}));const $le=(()=>{const t=new gIe.Budget;return t.enabled=!1,t})();let Psi=class{remove(){}processQueue(){}schedule(e,i,r){try{if(bm(i)){const n=vc();return r?Promise.resolve(r(n)):Promise.reject(n)}return C_e(e($le))}catch(n){return Promise.reject(n)}}reschedule(e,i,r){return this.schedule(e,i,r)}};const yIe=new Psi;let JY=class extends fn{constructor(e,i){super({}),this._stage=e,this._textureRequests=new Map,this._frameTask=i?.registerTask(sl.TEXTURE_UNLOAD)??yIe}normalizeCtorArgs(){return{}}destroy(){super.destroy(),this._frameTask.remove(),this._textureRequests.forEach(e=>this._releaseTextureRequest(e)),this._textureRequests.clear()}get updating(){return this._frameTask.updating}fromData(e,i,r){const n=this.makeUid(e);let s=this._textureRequests.get(n);if(!s){const o=i();s={referenceCount:0,texture:o,textureAsync:null,abortController:null,onRemove:r},this._stage&&(this._stage.add(o),this._stage.loadImmediate(o)),this._textureRequests.set(n,s)}return s.referenceCount++,{uid:n,texture:s.texture,release:()=>this._release(n)}}_release(e){const i=this._textureRequests.get(e);i?(i.referenceCount<1&&console.warn("TextureCollection: reference count is < 1 for "+e),i.referenceCount--,i.referenceCount<1&&this._frameTask.schedule(()=>this._releaseNow(e))):console.warn(`TextureCollection: texture doesn't exist: '${e}'`)}get test(){return{textureRequests:this._textureRequests}}_releaseNow(e){if(!this._textureRequests)return;const i=this._textureRequests.get(e);!i||i.referenceCount>0||(this._releaseTextureRequest(i),this._textureRequests.delete(e))}_releaseTextureRequest(e){e.onRemove&&e.onRemove(),e.texture?this._stage?.remove(e.texture):e.abortController&&(e.abortController.abort(),e.abortController=null)}makeUid(e,i=null){return ye(i)?`${e}.${i}px`:e}};E([k()],JY.prototype,"_frameTask",void 0),E([k()],JY.prototype,"updating",null),JY=E([ht("esri.views.3d.support.TextureCollection")],JY);var ait;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right"})(ait||(ait={}));const lit=["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"],uit={};function cit(t){return!!uit[t]}function Osi(t){for(const e of t)if(!cit(e))return!1;return!0}lit.forEach(t=>{uit[t]=!0});let Rsi=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:i,priority:r},n)=>this.inputManager?.installHandlers(n,[i],r))}disconnect(){this.inputManager&&this._handlers.forEach((e,i)=>this.inputManager?.uninstallHandlers(i)),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(e,i,r,n){const s=Array.isArray(e)?e:e.split(",");if(!Osi(s))return s.some(cit)&&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(i)?a=i:(o=i,a=[]),typeof r=="function"?o=r:n=r,n=n??_T.DEFAULT;const l=this._createUniqueGroupName(),c=new Msi(this.view,s,a,o);this._handlers.set(l,{handler:c,priority:n});for(const d of s){const p=this._handlerCounts.get(d)||0;this._handlerCounts.set(d,p+1)}return this.inputManager&&this.inputManager.installHandlers(l,[c],n),{remove:()=>this._removeHandler(l,s)}}hasHandler(e){return!!this._handlerCounts.get(e)}_removeHandler(e,i){if(this._handlers.has(e)){this._handlers.delete(e);for(const r of i){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}`}},Msi=class extends Dm{constructor(e,i,r,n){super(!0),this._latestDragStart=void 0,this.view=e;for(const s of i)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:i=>e.async(i),preventDefault:()=>e.preventDefault()}}_wrapBlur(e){return{type:"blur",timestamp:e.timestamp,native:e.data.native,cancelable:e.cancelable,stopPropagation:()=>e.stopPropagation(),async:i=>e.async(i),preventDefault:()=>e.preventDefault()}}_wrapClick(e){const{pointerType:i,button:r,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,{cancelable:c,timestamp:d}=e;return{type:"click",pointerType:i,button:r,buttons:n,x:s,y:o,native:a,timestamp:d,screenPoint:Vh(s,o),mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:c,stopPropagation:()=>e.stopPropagation(),async:p=>e.async(p),preventDefault:()=>e.preventDefault()}}_wrapDoubleClick(e){const{pointerType:i,button:r,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,{cancelable:c,timestamp:d}=e;return{type:"double-click",pointerType:i,button:r,buttons:n,x:s,y:o,native:a,timestamp:d,mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:c,stopPropagation:()=>e.stopPropagation(),async:p=>e.async(p),preventDefault:()=>e.preventDefault()}}_wrapImmediateClick(e){const{pointerType:i,button:r,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,c=a.pointerId,{cancelable:d,timestamp:p}=e;return{type:"immediate-click",pointerId:c,pointerType:i,button:r,buttons:n,x:s,y:o,native:a,timestamp:p,mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:d,stopPropagation:()=>e.stopPropagation(),async:y=>e.async(y),preventDefault:()=>e.preventDefault()}}_wrapImmediateDoubleClick(e){const{pointerType:i,button:r,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,c=a.pointerId,{cancelable:d,timestamp:p}=e;return{type:"immediate-double-click",pointerId:c,pointerType:i,button:r,buttons:n,x:s,y:o,native:a,timestamp:p,mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:d,stopPropagation:()=>e.stopPropagation(),async:y=>e.async(y),preventDefault:()=>e.preventDefault()}}_wrapHold(e){const{pointerType:i,button:r,buttons:n,x:s,y:o,native:a}=e.data,{cancelable:l,timestamp:c}=e;return{type:"hold",pointerType:i,button:r,buttons:n,x:s,y:o,native:a,timestamp:c,mapPoint:this._getMapPoint(s,o),cancelable:l,stopPropagation:()=>e.stopPropagation(),async:d=>e.async(d),preventDefault:()=>e.preventDefault()}}_getMapPoint(e,i){return this.view.toMap(Vh(e,i),{exclude:[]})}_wrapDrag(e){const i=e.data,{x:r,y:n}=i.center,{action:s,pointerType:o,button:a}=i;if(s==="start"&&(this._latestDragStart=i),!this._latestDragStart)return;const l=i.pointer.native,c=i.buttons,{cancelable:d,timestamp:p}=e,y={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:y,pointerType:o,button:a,buttons:c,radius:i.radius,angle:xne(i.angle),native:l,timestamp:p,cancelable:d,stopPropagation:()=>e.stopPropagation(),async:v=>e.async(v),preventDefault:()=>e.preventDefault()}}_wrapKeyDown(e){const{key:i,repeat:r,native:n}=e.data,{cancelable:s,timestamp:o}=e;return{type:"key-down",key:i,repeat:r,native:n,timestamp:o,cancelable:s,stopPropagation:()=>e.stopPropagation(),async:a=>e.async(a),preventDefault:()=>e.preventDefault()}}_wrapKeyUp(e){const{key:i,native:r}=e.data,{cancelable:n,timestamp:s}=e;return{type:"key-up",key:i,native:r,timestamp:s,cancelable:n,stopPropagation:()=>e.stopPropagation(),async:o=>e.async(o),preventDefault:()=>e.preventDefault()}}_wrapPointer(e,i){const{x:r,y:n,button:s,buttons:o,native:a,eventId:l}=e.data,c=a.pointerId,d=a.pointerType,{cancelable:p,timestamp:y}=e;return{type:i,x:r,y:n,pointerId:c,pointerType:d,button:s,buttons:o,native:a,timestamp:y,eventId:l,cancelable:p,stopPropagation:()=>e.stopPropagation(),async:v=>e.async(v),preventDefault:()=>e.preventDefault()}}_wrapPointerDrag(e){const{x:i,y:r,buttons:n,native:s,eventId:o}=e.data.currentEvent,{button:a}=e.data.startEvent,l=e.data.startEvent.native.pointerId,c=e.data.startEvent.native.pointerType,d=e.data.action,p={x:e.data.startEvent.x,y:e.data.startEvent.y},{cancelable:y,timestamp:v}=e;return{type:"pointer-drag",x:i,y:r,pointerId:l,pointerType:c,button:a,buttons:n,action:d,origin:p,native:s,timestamp:v,eventId:o,cancelable:y,stopPropagation:()=>e.stopPropagation(),async:S=>e.async(S),preventDefault:()=>e.preventDefault()}}_wrapMouseWheel(e){const{cancelable:i,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:i,stopPropagation:()=>e.stopPropagation(),async:c=>e.async(c),preventDefault:()=>e.preventDefault()}}_wrapGamepad(e){const{action:i,state:r,device:n}=e.data,{cancelable:s,timestamp:o}=e,{buttons:a,axes:l}=r;return{type:"gamepad",device:n,timestamp:o,action:i,buttons:a,axes:l,cancelable:s,stopPropagation:()=>e.stopPropagation(),async:c=>e.async(c),preventDefault:()=>e.preventDefault()}}};var ZY,hit,dit;(function(t){t[t.USER=0]="USER",t[t.MANAGER=1]="MANAGER"})(ZY||(ZY={})),function(t){t[t.None=0]="None",t[t.Unfocused=1]="Unfocused",t[t.Focused=2]="Focused",t[t.Unselected=4]="Unselected",t[t.Selected=8]="Selected",t[t.All=15]="All"}(hit||(hit={})),function(t){t[t.None=0]="None",t[t.Custom1=16]="Custom1",t[t.Custom2=32]="Custom2",t[t.Custom3=64]="Custom3",t[t.Custom4=128]="Custom4",t[t.Custom5=256]="Custom5",t[t.Custom6=512]="Custom6",t[t.Custom7=1024]="Custom7",t[t.Custom8=2048]="Custom8",t[t.Custom9=4096]="Custom9",t[t.Custom10=8192]="Custom10",t[t.Custom11=16384]="Custom11",t[t.Custom12=32768]="Custom12",t[t.All=65520]="All"}(dit||(dit={}));function Dsi(t){return[t.on("before-add",e=>{const i=e.item;if(i==null||t.includes(i))return Ei.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();i.onAdd()}),t.on("after-remove",e=>{const i=e.item;i.active&&(i.view.activeTool=null),i.destroy()})]}function vIe(t){return t.visible&&t.getEditableFlag!=null&&t.getEditableFlag(ZY.USER)&&t.getEditableFlag(ZY.MANAGER)}function wT(t){return Vh(t.x,t.y)}function pit(t,e){const i=(t instanceof HTMLElement?t:t.surface)?.getBoundingClientRect();return i?Vh(e.clientX-i.left,e.clientY-i.top):Vh(0,0)}function fit(t,e){return e instanceof Event?pit(t,e):wT(e)}function mit(t){if(t instanceof Event)return!0;if(typeof t=="object"&&"type"in t)switch(t.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 Fsi=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}handleInputEvent(e,i){const r=()=>e.stopPropagation();switch(e.type){case"pointer-move":git(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(!yit(e))break;const n=wT(e),s=this._intersect(n,e.pointerType,i.forEachTool);if(lt(s))break;const o=s.manipulator,a=s.tool;!(ye(o)&&ye(a)&&o.interactive)||o.grabbable&&o.grabbableForEvent(e)||!o.grabbing||o.dragging||this._ungrabManipulatorBeforeDragging(o,e,i),ye(o)&&ye(a)&&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&<(i.activeTool)&&(this._revertToNullActiveTool=!0,i.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,i);break;case"pointer-drag":{if(!yit(e))break;const n=this._grabbedManipulators.get(e.pointerId),s=ya(n,({manipulator:d})=>d),o=ya(n,({tool:d})=>d);if(lt(s)||lt(o))break;const a=wT(e);a.x=Hl(a.x,0,i.view.width),a.y=Hl(a.y,0,i.view.height);const l=n.start,c=this._draggedManipulators.get(e.pointerId);switch(e.action){case"start":case"update":e.action!=="update"&&this._grabbedManipulators.size!==1||(s.dragging=!0,c?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,c&&s.events.emit("drag",{action:"end",start:l,screenPoint:a}),this._draggedManipulators.delete(e.pointerId),this._handlePointerEnd(e,i)}r();break}case"immediate-click":{const n=wT(e),s=this._intersect(n,e.pointerType,i.forEachTool);if(Lsi(e)||i.forEachTool(c=>{if((!ye(s)||s.tool!==c||c.automaticManipulatorSelection)&&c.manipulators){let d=!1;c.manipulators.forEach(({manipulator:p})=>{p.selected&&(p.selected=!1,d=!0)}),d&&c.onManipulatorSelectionChanged&&c.onManipulatorSelectionChanged()}}),lt(s))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});break}case"click":{const n=wT(e),s=this._intersect(n,e.pointerType,i.forEachTool),o=ye(s)?s.manipulator:null;if(lt(o)||!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=wT(e),s=this._intersect(n,e.pointerType,i.forEachTool),o=ye(s)?s.manipulator:null;if(lt(o)||!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});break}case"immediate-double-click":{const n=wT(e),s=this._intersect(n,e.pointerType,i.forEachTool),o=ye(s)?s.manipulator:null;if(lt(o)||!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});break}}this._onFocusChange(i.forEachTool)}_ungrabManipulatorBeforeDragging(e,i,r){e.grabbing=!1,e.events.emit("grab-changed",{action:"end",pointerType:i.pointerType,screenPoint:wT(i)}),this._grabbedManipulators.forEach(({manipulator:n},s)=>{n===e&&this._grabbedManipulators.delete(s)}),this._afterManipulatorUngrab(r.setActiveTool)}_handlePointerEnd(e,i){const r=ya(this._grabbedManipulators.get(e.pointerId),({manipulator:n})=>n);lt(r)||r.grabbing&&(r.grabbing=!1,r.events.emit("grab-changed",{action:"end",pointerType:e.pointerType,screenPoint:wT(e)}),this._grabbedManipulators.delete(e.pointerId),this._afterManipulatorUngrab(i.setActiveTool))}_cursorFromMap(e){let i=null;return Wre(e,({manipulator:r})=>!(lt(r)||!r.interactive)&&(r.grabbing&&r.grabCursor?(i=r.grabCursor,!0):!!r.cursor&&(i=r.cursor,!0))),i}_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 i=new Set,r=new Set;this._grabbedManipulators.forEach(({tool:n})=>{i.add(n)}),this._hoveredManipulators.forEach(({tool:n})=>{r.add(n)}),e(n=>{n.hasGrabbedManipulators=i.has(n),n.hasHoveredManipulators=r.has(n);const s=this._grabbedManipulators.values(),o=xre(s,({tool:a})=>a===n);n.firstGrabbedManipulator=ye(o)?o.manipulator:null})}clearPointers(e,{forEachTool:i,setActiveTool:r},n=!0,s){const o=(a,l)=>a===e&&(lt(s)||s===l);this._grabbedManipulators.forEach(({tool:a,manipulator:l,pointerType:c},d)=>{o(a,l)&&(this._grabbedManipulators.delete(d),l.grabbing=!1,l.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:c}))}),this._draggedManipulators.forEach(({tool:a,manipulator:l},c)=>{o(a,l)&&(this._draggedManipulators.delete(c),l.dragging=!1,l.events.emit("drag",{action:"cancel"}))}),n&&this._hoveredManipulators.forEach(({tool:a,manipulator:l},c)=>{o(a,l)&&(this._hoveredManipulators.delete(c),l.hovering=!1)}),this._afterManipulatorUngrab(r),this._onFocusChange(i)}_intersect(e,i,r){let n=null;return r(s=>{if(s.manipulators==null||!vIe(s))return!1;const o=s.manipulators.intersect(e,i);return!lt(o)&&(n={tool:s,manipulator:o},!0)}),n}updateHoveredStateFromKnownPointers(e){this._pointerLocations.forEach((i,r)=>{this._updateHoveredStateForPointerAtScreenPosition(Vh(i.x,i.y),r,i.pointerType,e)})}handleHoverEvent(e,i){e.type!=="pointer-up"&&e.type!=="immediate-click"&&e.type!=="pointer-move"||!git(e.pointerType)||this._updateHoveredStateForPointerAtScreenPosition(wT(e),e.pointerId,e.pointerType,i)}_updateHoveredStateForPointerAtScreenPosition(e,i,r,n){let s=this._intersect(e,r,n);const o=ya(this._hoveredManipulators.get(i),({manipulator:a})=>a);ye(s)&&!s.manipulator.interactive&&(s=null),ye(s)&&o===s.manipulator||(ye(o)&&(o.hovering=!1),ye(s)?(s.manipulator.hovering=!0,this._hoveredManipulators.set(i,s)):this._hoveredManipulators.delete(i),this._onFocusChange(n))}_afterManipulatorUngrab(e){this._grabbedManipulators.size===0&&this._revertToNullActiveTool&&(e(null),this._revertToNullActiveTool=!1)}};function git(t){return t==="mouse"}function yit(t){return t.pointerType!=="mouse"||t.button===0}function Lsi(t){return!!t.native.shiftKey}const vit="attached",_Ie="tools";let eP=class extends KC{constructor(e){super(e),this._manipulatorState=new Fsi,this.tools=new fr,this.cursor=null,this._forEachTool=i=>{for(const r of this.tools.items)if(i(r))return}}initialize(){this.handles.add([this.view.on(lit,e=>{this._handleInputEvent(e)},_T.TOOL),...Dsi(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.detach(),this.handles.removeAll()}get _manipulatorStateEventArgs(){return{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:e=>{this.activeTool=e},view:this.view}}set activeTool(e){if(ye(e)&&!this.view.ready)return void Ei.getLogger(this.declaredClass).error("Cannot set active tool while view is not ready.");if(e===this.activeTool)return;const i=this.activeTool;this._set("activeTool",e),ye(i)&&i.deactivate(),ye(e)&&e.activate(),this._removeIncompleteTools(e);for(const r of this.tools){this._updateToolEditableFlag(r);const n=vIe(r);!lt(this.activeTool)&&n||this._manipulatorState.clearPointers(r,this._manipulatorStateEventArgs,!n)}this._updateCursor()}get updating(){return this.updatingHandles.updating||this.tools.some(e=>e.updating)||(this.textures?.updating??!1)}attach(){this.view.type==="3d"?(this._set("textures",new JY(this.view._stage,this.view.resourceController.scheduler)),this.handles.add([Qi(()=>{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(i=>i.onElevationChange(e))),KI(()=>this._set("textures",ra(this.textures)))],vit)):this.handles.add(Qi(()=>this.view.extent,()=>this._forEachManipulator(e=>e.onViewChange())))}detach(){ye(this.activeTool)&&(this.activeTool=null),this.tools.removeAll(),this.handles.remove(vit)}_forEachManipulator(e){this._forEachTool(i=>{i.manipulators&&i.manipulators.forEach(({manipulator:r})=>e(r,i))})}_handleInputEvent(e){let i=!1;const r={...e,stopPropagation:()=>{i=!0,e.stopPropagation()}};ye(this.activeTool)?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(r):this._forEachTool(n=>{!i&&n.visible&&n.handleInputEvent(r)}),!i&&e.type==="key-down"&&e.key==="Escape"&&this.activeTool&&(e.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(r,this._manipulatorStateEventArgs),!i&&ye(this.activeTool)&&this.activeTool.handleInputEventAfter(r),this._manipulatorState.handleHoverEvent(r,this._forEachTool),this._updateCursor()}_refreshToolWatchers(){this.handles.remove(_Ie),this._forEachTool(e=>{if(e instanceof fn){const i=Qi(()=>[e.cursor,e.visible,e.editable],()=>{vIe(e)||this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs),this._updateCursor()});this.handles.add(i,_Ie)}e.manipulators&&this.handles.add([e.manipulators.on("after-remove",i=>{this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs,!0,i.item.manipulator)}),e.manipulators.on("change",()=>{this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})],_Ie)}),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateToolEditableFlag(e){e.setEditableFlag?.(ZY.MANAGER,lt(this.activeTool)||e===this.activeTool)}_updateCursor(){let e=this._manipulatorState.cursor;lt(e)&&this._forEachTool(i=>!(!ye(i.cursor)||!i.visible)&&(e=i.cursor,!0)),this._get("cursor")!==e&&this._set("cursor",e)}_removeIncompleteTools(e){this.tools.filter(i=>(lt(e)||i!==e)&&!i.created&&i.removeIncompleteOnCancel).forEach(i=>{this.tools.remove(i)})}};E([k({constructOnly:!0,nonNullable:!0})],eP.prototype,"view",void 0),E([k({readOnly:!0,nonNullable:!0})],eP.prototype,"textures",void 0),E([k({value:null})],eP.prototype,"activeTool",null),E([k({readOnly:!0,type:fr})],eP.prototype,"tools",void 0),E([k({readOnly:!0})],eP.prototype,"cursor",void 0),E([k({readOnly:!0})],eP.prototype,"updating",null),eP=E([ht("esri.views.ToolViewManager")],eP);const ksi=eP;let iG=class extends fn{constructor(e){super(),this.nativeIndex=null,this._detectedDeviceType="unknown",e.mapping==="standard"?this._detectedDeviceType="standard":Nsi.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.nativeIndexaJi).then(e=>wIe=e)),await xIe,sn(t)}async function Eit(t,e,i,r){if(!t)return null;const n=t.spatialReference;return lw()||i_(n,e)?rp(t,e):wIe?wIe.projectGeometry(t,e,i,r):(await Promise.race([Hsi(r),P2(r)]),Eit(t,e,i,r))}let qc=class extends fn{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=rL(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 ye(this.userSpatialReference)?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 lt(this.userSpatialReference)||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){const e=this.map?.(),i=[];return ye(this.priorityCollection)&&i.push(this.priorityCollection),i.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}),i}get _allLayers(){return this._collectLayers(this.mapCollections)}get _spatialReferenceTask(){if(this.suspended)return this._get("_spatialReferenceTask")??{updating:!1};const{layers:e,updating:i}=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);ye(a)&&(r=a)}if(ye(r)&&r.length===1)break}if(i&&(lt(r)||r.length!==1))return{updating:!0};const n=this._pickSpatialReferenceCandidate(r);return{spatialReference:ye(n)?n.spatialReference:null,viewingMode:ye(n)?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:i}=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:i}}get _heightModelInfoTask(){if(!this.required.heightModelInfo||this.suspended&&this._get("_heightModelInfoTask")?.heightModelInfo)return this._get("_heightModelInfoTask")??{updating:!1};const{layers:e,updating:i}=this._allLayers;for(const r of e)if(jsi(r)){const n=Vsi(r);if(n)return{heightModelInfo:n,vcsWkid:r.spatialReference?.vcsWkid,latestVcsWkid:r.spatialReference?.latestVcsWkid,updating:!1}}return{updating:i}}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,i=e.updating,r=[];for(const n of e.layers){const s="fullExtents"in n&&n.fullExtents||(ye(n.fullExtent)?[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:i}}get _extentTask(){const{candidates:e,updating:i}=this._extentCandidatesTask;if(i)return{updating:i};if(lt(e)||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:ye(this._projectExtentTask.task)&&!this._projectExtentTask.task.finished}:(ye(this._projectExtentTask.task)&&(this._projectExtentTask.task=rL(this._projectExtentTask.task)),this._projectExtentTask={input:r.extent.clone(),output:null,spatialReference:n.clone(),task:EC(async s=>{try{const o=await Eit(r.extent,n,r.layer.portalItem,s);this._projectExtentTask={...this._projectExtentTask,task:null,output:o}}catch{if(bm(s))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(e,i){if(lt(e))return i;const r=[],n=(s,o)=>ye(s)?ye(o)?s===o&&s:s:o;for(const s of e)for(const o of i){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 i=this.defaultSpatialReference;return lt(e)||e.length<1?ye(i)?{spatialReference:i,viewingMode:null}:null:(ye(i)&&e.length>1&&e.some(({spatialReference:r})=>r.equals(i))&&(e=e.filter(({spatialReference:r})=>r.equals(i))),e.length>1&&e.some(({viewingMode:r})=>r!==_w.Local)&&(e=e.filter(({viewingMode:r})=>r!==_w.Local)),e[0])}_getSupportedSpatialReferences(e){const i="supportedSpatialReferences"in e&&e.supportedSpatialReferences||(e.spatialReference?[e.spatialReference]:[]);if(i.length===0)return[];const r=[];for(const n of i){const s=this.getSpatialReferenceSupport({spatialReference:n,layer:e});if(ye(s)){const o=ye(s.constraints)?s.constraints:[{spatialReference:n,viewingMode:null}];for(const{spatialReference:a,viewingMode:l}of o)(!this.requiresExtentInSpatialReference||lt(this.userSpatialReference)||a.equals(this.userSpatialReference))&&r.push({spatialReference:a,viewingMode:l})}}return r}_pickExtentCandidate(e){const i=this.spatialReference;return e.find(({extent:r})=>i.equals(r.spatialReference))||e[0]}_collectLayers(e){if(this._loadMaybe(this.map?.())!=="loaded")return{layers:[],updating:!0};const i={layers:[],preloading:-1,updating:!1};for(const r of e)if(this._collectCollection(r,i),i.preloading===this.sourcePreloadCount)break;return{layers:i.layers,updating:i.updating}}_collectCollection(e,i){if(e.layers){switch(this._loadMaybe(e.parent)){case"loading":return i.updating=!0,void++i.preloading;case"failed":return}for(const r of e.layers){switch(this._loadMaybe(r)){case"failed":continue;case"loading":i.updating=!0,++i.preloading;break;case"loaded":i.updating||i.layers.push(r),"layers"in r&&this._collectCollection({layers:r.layers},i)}if(i.preloading===this.sourcePreloadCount)break}}}_loadMaybe(e){return e&&"loadStatus"in e&&e.loadStatus!=null?e.loadStatus==="not-loaded"?(e.load().catch(()=>{}),"loading"):e.loadStatus:"loaded"}};E([k()],qc.prototype,"required",void 0),E([k({constructOnly:!0})],qc.prototype,"map",void 0),E([k({constructOnly:!0})],qc.prototype,"getSpatialReferenceSupport",void 0),E([k()],qc.prototype,"defaultSpatialReference",void 0),E([k()],qc.prototype,"userSpatialReference",void 0),E([k()],qc.prototype,"sourcePreloadCount",void 0),E([k()],qc.prototype,"priorityCollection",void 0),E([k()],qc.prototype,"requiresExtentInSpatialReference",void 0),E([k()],qc.prototype,"suspended",void 0),E([k({readOnly:!0})],qc.prototype,"ready",null),E([k({readOnly:!0})],qc.prototype,"heightModelInfoReady",null),E([k({readOnly:!0})],qc.prototype,"spatialReference",null),E([k({readOnly:!0})],qc.prototype,"extent",null),E([k({readOnly:!0})],qc.prototype,"heightModelInfo",null),E([k({readOnly:!0})],qc.prototype,"vcsWkid",null),E([k({readOnly:!0})],qc.prototype,"latestVcsWkid",null),E([k({readOnly:!0})],qc.prototype,"viewingMode",null),E([k({readOnly:!0})],qc.prototype,"tileInfo",null),E([k({readOnly:!0})],qc.prototype,"mapCollections",null),E([k({readOnly:!0})],qc.prototype,"_allLayers",null),E([k({readOnly:!0})],qc.prototype,"_spatialReferenceTask",null),E([k({readOnly:!0})],qc.prototype,"_tileInfoTask",null),E([k({readOnly:!0})],qc.prototype,"_heightModelInfoTask",null),E([k({readOnly:!0})],qc.prototype,"_extentCandidatesTask",null),E([k()],qc.prototype,"_extentTask",null),E([k()],qc.prototype,"_projectExtentTask",void 0),qc=E([ht("esri.views.support.DefaultsFromMap")],qc);var Gle;let So=Gle=class extends Nd(cd.EventedMixin(Zx(fn))){constructor(t){super(t),this._userSpatialReference=null,this._cursor=null,this.allLayerViews=new k2({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:e=>e.layerViews}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new V1,this.analyses=new Nle,this.typeSpecificPreconditionsReady=!0,this.layerViews=new fr,this.magnifier=new Ztt,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.timeReference=new GR,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new Gsi,this.navigation=new bit,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new Rsi(this),this.persistableViewModels=new fr,this._isValid=!1,this._readyCycleForced=!1,this._currentSpatialReference=null,this.handles.add(Qi(()=>this.preconditionsReady,e=>{e?(this._currentSpatialReference=this.spatialReference,Gle.views.add(this)):(this._currentSpatialReference=null,Gle.views.remove(this)),this.notifyChange("spatialReference"),!e&&this.ready?(this.toolViewManager?.detach(),ye(this.analysisViewManager)&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown()):e&&!this.ready&&(this._startup(),ye(this.analysisViewManager)&&this.analysisViewManager.attach(),this.toolViewManager.attach())},Nu))}initialize(){this.addResolvingPromise(this.validate().then(()=>(this._isValid=!0,F1(()=>this.ready)))),this.basemapView=new bM({view:this}),this.layerViewManager=new Csi({view:this,layerViewImporter:{importLayerView:t=>this.importLayerView(t),hasLayerViewModule:t=>this.hasLayerViewModule(t)},supportsGround:this.supportsGround}),this.toolViewManager=new ksi({view:this}),this._setupSpatialReferenceLogger(),this.handles.add([Qi(()=>this.initialExtentRequired,t=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:t},{sync:!0,initial:!0}),Qi(()=>this.ready,t=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=t,this.defaultsFromMap.userSpatialReference=t?this.spatialReference:this._userSpatialReference)},{sync:!0}),Qi(()=>this._userSpatialReference,t=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=t)},{sync:!0,initial:!0})])}_setupSpatialReferenceLogger(){let t=null;this.handles.add([Qi(()=>this.defaultsFromMap?.ready,e=>{const i=this.map?.allLayers.length>0;if(e&&!this.spatialReference&&i){if(ye(t))return;const r=KI(()=>t=rL(t));t=EC(async n=>{try{await B3(this.spatialReferenceWarningDelay,null,n)}catch{return}finally{t=null}Ei.getLogger(this.declaredClass).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),this.handles.add(r,"spatial-reference-logger-task")}else this.handles.remove("spatial-reference-logger-task")},{sync:!0})])}destroy(){if(this.destroyed)return;this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=ra(this.graphics),this.analyses=ra(this.analyses),this.handles.remove("defaultsFromMap"),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),ra(this.analysisViewManager),this.toolViewManager=ra(this.toolViewManager),this.layerViewManager=ra(this.layerViewManager),this.basemapView=ra(this.basemapView),this.invalidate(),this._emitter.clear(),this.handles.removeAll();const t=this.map;this.map=null,t?.destroy()}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return Ei.getLogger(this.declaredClass).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(t){this.toolViewManager&&(this.toolViewManager.activeTool=t)}get animation(){return this._get("animation")}set animation(t){this._set("animation",t)}get center(){return null}get _defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new qc({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:t=>this.getSpatialReferenceSupport(t),...this._defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(t){this._set("extent",t)}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||hd.isLoadable(this.map)&&!this.map.loaded||this.width===0||this.height===0||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._currentSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(t){t!==this._get("map")&&(t?.destroyed&&(Ei.getLogger(this.declaredClass).warn("#map","The provided map is already destroyed",{map:t}),t=null),hd.isLoadable(t)&&t.load().catch(()=>{}),this.constructed&&(this.forceReadyCycle(),this._currentSpatialReference=null),this._set("map",t))}get spatialReference(){let t=this._userSpatialReference||this._currentSpatialReference||this.getDefaultSpatialReference()||null;return t&&this.defaultsFromMap?.required?.heightModelInfo&&(t=t.clone(),t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid),t}set spatialReference(t){const e=!Ca(t,this._get("spatialReference"));this._set("_userSpatialReference",t),e&&(this._set("spatialReference",t),this._spatialReferenceChanged(t))}_spatialReferenceChanged(t){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){const t=this.toolViewManager?this.toolViewManager.cursor:null;return ye(t)?t:this._cursor||"default"}set cursor(t){this._cursor=t,this.notifyChange("cursor")}get size(){return[this.width,this.height]}whenLayerView(t){return this.layerViewManager.whenLayerView(t)}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}importLayerView(t){throw new st("importLayerView() not implemented")}hasLayerViewModule(t){return!1}async validate(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(t){return ye(this.getSpatialReferenceSupport({spatialReference:t}))}when(t,e){return this.isResolved()&&!this.ready&&Ei.getLogger(this.declaredClass).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(t,e)}forceReadyCycle(){this.ready&&(Hg(()=>this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(t){this.toolViewManager.tools.add(t),this.activeTool=t}tryFatalErrorRecovery(){this.fatalError=null}};So.views=new fr,E([k()],So.prototype,"_userSpatialReference",void 0),E([k()],So.prototype,"activeTool",null),E([k({readOnly:!0})],So.prototype,"allLayerViews",void 0),E([k()],So.prototype,"groundView",void 0),E([k()],So.prototype,"animation",null),E([k()],So.prototype,"basemapView",void 0),E([k()],So.prototype,"center",null),E([k({readOnly:!0})],So.prototype,"_defaultsFromMapSettings",null),E([k()],So.prototype,"defaultsFromMap",null),E([k()],So.prototype,"fatalError",void 0),E([k({type:vr})],So.prototype,"extent",null),E([k(sCe(V1,"graphics"))],So.prototype,"graphics",void 0),E([k(sCe(Nle,"analyses"))],So.prototype,"analyses",void 0),E([k({readOnly:!0,type:V9})],So.prototype,"heightModelInfo",null),E([k({readOnly:!0})],So.prototype,"interacting",null),E([k({readOnly:!0})],So.prototype,"navigating",null),E([k({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_currentSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],So.prototype,"preconditionsReady",null),E([k({readOnly:!0})],So.prototype,"typeSpecificPreconditionsReady",void 0),E([k({type:fr,readOnly:!0})],So.prototype,"layerViews",void 0),E([k()],So.prototype,"resolution",null),E([k({type:Ztt})],So.prototype,"magnifier",void 0),E([k({value:null,type:WZe})],So.prototype,"map",null),E([k()],So.prototype,"padding",void 0),E([k({readOnly:!0})],So.prototype,"ready",void 0),E([k({type:rr})],So.prototype,"spatialReference",null),E([k()],So.prototype,"spatialReferenceWarningDelay",void 0),E([k()],So.prototype,"stationary",null),E([k({readOnly:!0})],So.prototype,"supportsGround",void 0),E([k({type:Wg})],So.prototype,"timeExtent",void 0),E([k({type:GR,nonNullable:!0})],So.prototype,"timeReference",void 0),E([k()],So.prototype,"tools",null),E([k()],So.prototype,"toolViewManager",void 0),E([k({readOnly:!0})],So.prototype,"type",void 0),E([k({type:Number})],So.prototype,"scale",void 0),E([k({readOnly:!0})],So.prototype,"updating",void 0),E([k({readOnly:!0})],So.prototype,"initialExtentRequired",void 0),E([k({readOnly:!0})],So.prototype,"initialExtent",null),E([k()],So.prototype,"cursor",null),E([k({readOnly:!0})],So.prototype,"input",void 0),E([k({type:bit,nonNullable:!0})],So.prototype,"navigation",void 0),E([k()],So.prototype,"layerViewManager",void 0),E([k()],So.prototype,"analysisViewManager",void 0),E([k()],So.prototype,"width",void 0),E([k()],So.prototype,"height",void 0),E([k({readOnly:!0})],So.prototype,"resizing",void 0),E([k({value:null,readOnly:!0})],So.prototype,"size",null),E([k({readOnly:!0})],So.prototype,"suspended",void 0),E([k({readOnly:!0})],So.prototype,"viewEvents",void 0),E([k({readOnly:!0})],So.prototype,"persistableViewModels",void 0),E([k()],So.prototype,"_isValid",void 0),E([k()],So.prototype,"_readyCycleForced",void 0),E([k()],So.prototype,"_currentSpatialReference",void 0),So=Gle=E([ht("esri.views.View")],So);const Wsi=So;let xM=class extends kH{constructor(e){super(e),this.state="running",this.target=null,this._dfd=null}initialize(){this.addResolvingPromise(new Promise((e,i)=>this._dfd={resolve:e,reject:i}))}get done(){return this.state==="finished"||this.state==="stopped"}stop(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","stopped"),this._dfd?.reject(new st("ViewAnimation stopped")))}finish(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","finished"),this._dfd?.resolve())}update(e,i){i||(i=Ip(e)?"waiting-for-target":"running"),this._set("target",e),this._set("state",i)}};E([k({readOnly:!0})],xM.prototype,"done",null),E([k({readOnly:!0,type:String})],xM.prototype,"state",void 0),E([k()],xM.prototype,"target",void 0),xM=E([ht("esri.views.ViewAnimation")],xM),function(t){t.State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"}}(xM||(xM={}));const SIe=xM;function SM(t,e,i,r){const n=3*t,s=3*(i-t)-n,o=1-n-s,a=3*e,l=3*(r-e)-a,c=1-a-l;function d(S){return((o*S+s)*S+n)*S}function p(S){return((c*S+l)*S+a)*S}function y(S){return(3*o*S+2*s)*S+n}function v(S,I){let O,L,N,G,V,Y;for(N=S,Y=0;Y<8;Y++){if(G=d(N)-S,Math.abs(G)L)return L;for(;OG?O=N:L=N,N=.5*(L-O)+O}return N}return function(S,I=1e-6){return p(v(S,I))}}const qsi=/^cubic-bezier\((.*)\)/,bw={};function Ysi(t){let e=bw[t]||null;if(!e){const i=qsi.exec(t);if(i){const r=i[1].split(",").map(n=>parseFloat(n.trim()));r.length!==4||r.some(n=>isNaN(n))||(e=SM.apply(SM,r))}}return e}bw.ease=SM(.25,.1,.25,1),bw.linear=SM(0,0,1,1),bw.easeIn=bw["ease-in"]=SM(.42,0,1,1),bw.easeOut=bw["ease-out"]=SM(0,0,.58,1),bw.easeInOut=bw["ease-in-out"]=SM(.42,0,.58,1);function CM(){return[1,0,0,1,0,0]}function Xsi(t){return[t[0],t[1],t[2],t[3],t[4],t[5]]}function Ksi(t,e,i,r,n,s){return[t,e,i,r,n,s]}function Jsi(t,e){return new Float64Array(t,e,6)}Object.freeze(Object.defineProperty({__proto__:null,clone:Xsi,create:CM,createView:Jsi,fromValues:Ksi},Symbol.toStringTag,{value:"Module"}));function rG(t,e){return t[0]=e[0],t[1]=e[1],t}function aa(t,e,i){return t[0]=e,t[1]=i,t}function CIe(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}function eX(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function Iit(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t}function Ait(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t}function Zsi(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function Qsi(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function eoi(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t}function toi(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t}function ioi(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function tX(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}function roi(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t}function iX(t,e){const i=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(i*i+r*r)}function Vle(t,e){const i=e[0]-t[0],r=e[1]-t[1];return i*i+r*r}function Ule(t){const e=t[0],i=t[1];return Math.sqrt(e*e+i*i)}function Pit(t){const e=t[0],i=t[1];return e*e+i*i}function Oit(t,e){return t[0]=-e[0],t[1]=-e[1],t}function noi(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function TIe(t,e){const i=e[0],r=e[1];let n=i*i+r*r;return n>0&&(n=1/Math.sqrt(n),t[0]=e[0]*n,t[1]=e[1]*n),t}function Rit(t,e){return t[0]*e[0]+t[1]*e[1]}function Mit(t,e,i){const r=e[0]*i[1]-e[1]*i[0];return t[0]=t[1]=0,t[2]=r,t}function EIe(t,e,i,r){const n=e[0],s=e[1];return t[0]=n+r*(i[0]-n),t[1]=s+r*(i[1]-s),t}function soi(t,e){e=e||1;const i=2*ZH()*Math.PI;return t[0]=Math.cos(i)*e,t[1]=Math.sin(i)*e,t}function ooi(t,e,i){const r=e[0],n=e[1];return t[0]=i[0]*r+i[2]*n,t[1]=i[1]*r+i[3]*n,t}function f0(t,e,i){const r=e[0],n=e[1];return t[0]=i[0]*r+i[2]*n+i[4],t[1]=i[1]*r+i[3]*n+i[5],t}function aoi(t,e,i){const r=e[0],n=e[1];return t[0]=i[0]*r+i[3]*n+i[6],t[1]=i[1]*r+i[4]*n+i[7],t}function loi(t,e,i){const r=e[0],n=e[1];return t[0]=i[0]*r+i[4]*n+i[12],t[1]=i[1]*r+i[5]*n+i[13],t}function gk(t,e,i,r){const n=e[0]-i[0],s=e[1]-i[1],o=Math.sin(r),a=Math.cos(r);return t[0]=n*a-s*o+i[0],t[1]=n*o+s*a+i[1],t}function uoi(t,e){const i=t[0],r=t[1],n=e[0],s=e[1];let o=i*i+r*r;o>0&&(o=1/Math.sqrt(o));let a=n*n+s*s;a>0&&(a=1/Math.sqrt(a));const l=(i*n+r*s)*o*a;return l>1?0:l<-1?Math.PI:Math.acos(l)}function coi(t){return"vec2("+t[0]+", "+t[1]+")"}function hoi(t,e){return t[0]===e[0]&&t[1]===e[1]}function doi(t,e){const i=t[0],r=t[1],n=e[0],s=e[1],o=jv();return Math.abs(i-n)<=o*Math.max(1,Math.abs(i),Math.abs(n))&&Math.abs(r-s)<=o*Math.max(1,Math.abs(r),Math.abs(s))}function poi(t,e,i,r,n){let s=e[0]-i[0],o=e[1]-i[1];const a=(r[0]*s+r[1]*o)*(n-1);return s=r[0]*a,o=r[1]*a,t[0]=e[0]+s,t[1]=e[1]+o,t}const foi=Ule,IIe=eX;Object.freeze(Object.defineProperty({__proto__:null,add:CIe,angle:uoi,ceil:Zsi,copy:rG,cross:Mit,dist:iX,distance:iX,div:Ait,divide:Ait,dot:Rit,equals:doi,exactEquals:hoi,floor:Qsi,inverse:noi,len:foi,length:Ule,lerp:EIe,max:toi,min:eoi,mul:Iit,multiply:Iit,negate:Oit,normalize:TIe,projectAndScale:poi,random:soi,rotate:gk,round:ioi,scale:tX,scaleAndAdd:roi,set:aa,sqrDist:Vle,sqrLen:Pit,squaredDistance:Vle,squaredLength:Pit,str:coi,sub:IIe,subtract:eX,transformMat2:ooi,transformMat2d:f0,transformMat3:aoi,transformMat4:loi},Symbol.toStringTag,{value:"Module"}));function Xa(){return[0,0]}function moi(t){return[t[0],t[1]]}function xT(t,e){return[t,e]}function goi(t){const e=Xa(),i=Math.min(2,t.length);for(let r=0;r"attributes"in d),l=t.some(d=>!d.geometry);let c=t;if(a&&l&&e&&e.allLayerViews){const d=new Map;for(const S of t){const I=S.layer,O=d.get(I)||[],L=S.attributes[I.objectIdField];L!=null&&O.push(L),d.set(I,O)}const p=[];d.forEach((S,I)=>{const O=e.allLayerViews.find(L=>L.layer.id===I.id);if(O&&"queryFeatures"in O){const L=I.createQuery();L.objectIds=S,L.returnGeometry=!0,p.push(O.queryFeatures(L))}});const y=await Promise.all(p),v=[];for(const S of y)if(S&&S.features&&S.features.length)for(const I of S.features)ye(I.geometry)&&v.push(I.geometry);c=v}for(const d of c)r=await nX(d,e,i,r);return r}if(Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")n=new Yi(t);else if(t instanceof Jr)n=t;else if("geometry"in t){if(t.geometry)n=t.geometry;else if(t.layer){const a=t.layer,l=e.allLayerViews.find(c=>c.layer.id===a.id);if(l&&"queryFeatures"in l){const c=a.createQuery();c.objectIds=[t.attributes[a.objectIdField]],c.returnGeometry=!0;const d=await l.queryFeatures(c);n=qx(d,"features",0,"geometry")}}}if(lt(n)||(s=n.type==="point"?new vr({xmin:n.x,ymin:n.y,xmax:n.x,ymax:n.y,spatialReference:n.spatialReference}):n.extent,!s))return null;lw()||i_(s.spatialReference,i)||await P2();const o=rp(s,i);return o?r=r?r.union(o):o:null}function woi(t){if(t&&(!Array.isArray(t)||typeof t[0]!="number")&&(typeof t=="object"||Array.isArray(t)&&typeof t[0]=="object")){if("layer"in t&&t.layer&&t.layer.minScale&&t.layer.maxScale){const e=t.layer;return{min:e.minScale,max:e.maxScale}}if(Array.isArray(t)&&t.length&&t.every(e=>"layer"in e)){let e=0,i=0;for(const r of t){const n=r.layer;n&&n.minScale&&n.maxScale&&(e=n.minScalei?n.maxScale:i)}return e&&i?{min:e,max:i}:null}}}function PIe(t,e){return Ca(Git(t),e)?t:rp(t,e)}async function xoi(t,e){if(!t||!e)return new u_({targetGeometry:new Yi,scale:0,rotation:0});let i=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;t instanceof u_?l=t:t.viewpoint?l=t.viewpoint:t.target&&t.target.declaredClass==="esri.Viewpoint"&&(l=t.target);let c=null;l&&l.targetGeometry?c=l.targetGeometry:t instanceof vr?c=t:(t||t&&("center"in t||"extent"in t||"target"in t))&&(c=await nX(t.center,e,i)||await nX(t.extent,e,i)||await nX(t.target,e,i)||await nX(t,e,i)),!c&&s&&s.targetGeometry?c=s.targetGeometry:!c&&e.extent&&(c=e.extent),i||(i=Git(e.spatialReference||e.extent||c)),lw()||Ca(c.spatialReference,i)||i_(c,i)||await P2();const d=PIe(c.center?c.center:c,i);let p=0;if(l&&ye(l.targetGeometry)&&l.targetGeometry.type==="point")p=l.scale;else if("scale"in t&&t.scale)p=t.scale;else if("zoom"in t&&t.zoom!==-1&&r&&r.effectiveLODs)p=r.zoomToScale(t.zoom);else if(Array.isArray(c)||c.type==="point"||c.type==="extent"&&c.width===0&&c.height===0){const I=PIe(e.extent,i);p=ye(I)?rX(I,a):e.extent?rX(e.extent,a):s.scale}else p=rX(PIe(c.extent,i),a);const y=woi(t);y&&(y.min&&y.min>p?p=y.min:y.max&&y.max180?this.dRotation-=360:this.dRotation<-180&&(this.dRotation+=360)}applyRatio(e,i){const r=this.easing(i);let n,s,o,a;i>=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}},iP=class extends fn{constructor(e){super(e),this.updateFunction=null,this.animation=null,this.duration=200,this.transition=null,this.easing=bw.ease,this.view=null,this.viewpoint=new u_({targetGeometry:new Yi,scale:0,rotation:0}),this._updateTask=uL({postRender:this._postRender.bind(this)}),this._updateTask.pause()}destroy(){this._updateTask=Bc(this._updateTask)}animate(e,i,r){this.stop();const n=this.viewpoint;G2(n,i),this.transition=new koi(this.viewpoint,e.target,r&&r.duration||this.duration,r&&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,i){this.stop(),this.updateFunction=i,this.viewpoint=e;const r=new SIe({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 i=this.animation;if(i&&i.state!==SIe.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()}};E([k()],iP.prototype,"animation",void 0),E([k()],iP.prototype,"duration",void 0),E([k()],iP.prototype,"transition",void 0),E([k()],iP.prototype,"easing",void 0),E([k()],iP.prototype,"view",void 0),E([k()],iP.prototype,"viewpoint",void 0),iP=E([ht("esri.views.2d.AnimationManager")],iP);const Noi=iP;let $oi=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=()=>{this._updateRequested=!1;const{basemapView:i,graphicsView:r,labelManager:n,layerViews:s,state:{id:o}}=this.view;i?.baseLayerViews.forEach(this._updateLayerView,this),s.forEach(this._updateLayerView,this),i?.referenceLayerViews.forEach(this._updateLayerView,this),ye(n)&&(n.lastUpdateId!==o&&(n.viewChange(),n.lastUpdateId=o),n.updateRequested&&n.processUpdate(this._updateParameters)),ye(r)&&(r.lastUpdateId!==o&&(r.viewChange(),r.lastUpdateId=o),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=Qi(()=>e.stationary,i=>{this.stationary=i,this.requestFrame()}),this._frameTaskHandle=uL(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 i=this.view.state,r=e.lastUpdateId;r!=null&&(this.stationary||e.moving)||(e.moving=!0,e.moveStart()),r!==i.id&&e.viewChange(),this.stationary&&e.moving&&(e.moving=!1,e.moveEnd()),e.lastUpdateId=i.id,e.updateRequested&&e.processUpdate(this._updateParameters),"layerViews"in e&&e.layerViews.forEach(this._updateLayerView,this)}};function Mp(){return Promise.all([Promise.resolve().then(()=>ATt),Promise.resolve().then(()=>OAt)])}const sX=()=>Mp().then(()=>Promise.resolve().then(()=>Znr)),sG=()=>Mp().then(()=>Promise.resolve().then(()=>lsr)),Yit={"base-dynamic":()=>Mp().then(()=>Promise.resolve().then(()=>psr)),"base-tile":sX,"bing-maps":sX,csv:sG,"geo-rss":()=>Mp().then(()=>Promise.resolve().then(()=>fsr)),feature:sG,geojson:sG,graphics:()=>Mp().then(()=>Promise.resolve().then(()=>gsr)),group:()=>Mp().then(()=>Promise.resolve().then(()=>vsr)),imagery:()=>Mp().then(()=>Promise.resolve().then(()=>ror)),"imagery-tile":()=>Mp().then(()=>Promise.resolve().then(()=>cPt)),kml:()=>Mp().then(()=>Promise.resolve().then(()=>War)),"knowledge-graph":()=>Mp().then(()=>Promise.resolve().then(()=>fPt)),"link-chart":()=>Mp().then(()=>Promise.resolve().then(()=>fPt)),"knowledge-graph-sublayer":sG,"map-image":()=>Mp().then(()=>Promise.resolve().then(()=>Yar)),"map-notes":()=>Mp().then(()=>Promise.resolve().then(()=>Kar)),media:()=>Mp().then(()=>Promise.resolve().then(()=>elr)),"ogc-feature":()=>Mp().then(()=>Promise.resolve().then(()=>ilr)),"open-street-map":sX,"oriented-imagery":sG,route:()=>Mp().then(()=>Promise.resolve().then(()=>vlr)),stream:()=>Mp().then(()=>Promise.resolve().then(()=>_lr)),"subtype-group":()=>Mp().then(()=>Promise.resolve().then(()=>wlr)),tile:sX,"vector-tile":()=>Mp().then(()=>Promise.resolve().then(()=>nur)),wcs:()=>Mp().then(()=>Promise.resolve().then(()=>cPt)),"web-tile":sX,wfs:sG,wms:()=>Mp().then(()=>Promise.resolve().then(()=>our)),wmts:()=>Mp().then(()=>Promise.resolve().then(()=>uur)),"line-of-sight":null,"base-elevation":null,"building-scene":null,dimension:null,elevation:null,"integrated-mesh":null,"point-cloud":null,voxel:null,scene:null,unknown:null,unsupported:null};function Boi(t){const e=t.declaredClass?t.declaredClass.slice(t.declaredClass.lastIndexOf(".")+1):"Unknown",i=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new st(`${i}:view-not-supported`,`${e} is not supported in 2D`)}const Xit={hasLayerViewModule:t=>ye(Yit[t.type]),importLayerView:t=>{const e=Yit[t.type];if(lt(e))throw Boi(t);return e(t)}};function Goi(t,e){const{spatialReference:i}=e,r=[e.x,e.y];let n=Number.POSITIVE_INFINITY,s=0,o=0;const a=[0,0],l=t.type==="extent"?[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]:t.rings;for(const c of l)for(let d=0;dd.clone()),e.sort((d,p)=>p.scale-d.scale),e.forEach((d,p)=>d.level=p);for(const d of e)!l&&i>0&&i>=d.scale&&(o=d.level,l=!0),!c&&r>0&&r>=d.scale&&(a=t?t.level:-1,c=!0),t=d;n===-1&&(n=i===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]),i=e[n].scale,r=e[s].scale,e.splice(0,n),e.splice(s-n+1,e.length),e.forEach((d,p)=>{this._lodByScale[d.scale]=d,this._scales[p]=d.scale}),this._set("effectiveLODs",e),this._set("effectiveMinZoom",n),this._set("effectiveMaxZoom",s),this._set("effectiveMinScale",i),this._set("effectiveMaxScale",r)}constrain(t,e){if(e&&t.scale===e.scale)return t;const i=this.effectiveMinScale,r=this.effectiveMaxScale,n=t.targetGeometry,s=e&&e.targetGeometry,o=r!==0&&t.scalei;if(o||a){const l=a?i:r;if(e&&s){const c=(l-e.scale)/(t.scale-e.scale);n.x=s.x+(n.x-s.x)*c,n.y=s.y+(n.y-s.y)*c}t.scale=l}return this.snapToZoom&&this.effectiveLODs&&(t.scale=this._getClosestScale(t.scale)),t}fit(t){if(!this.effectiveLODs||!this.snapToZoom)return this.constrain(t,null);const e=this.scaleToZoom(t.scale),i=Math.abs(e-Math.floor(e));return t.scale=this.zoomToScale(i>.99?Math.round(e):Math.floor(e)),t}zoomToScale(t){if(!this.effectiveLODs)return 0;t-=this.effectiveMinZoom,t=Math.max(0,t);const e=this._scales;if(t<=0)return e[0];if(t>=e.length)return e[e.length-1];const i=Math.round(t-.5),r=Math.round(t);return e[r]+(r-t)*(e[i]-e[r])}scaleToZoom(t){if(!this.effectiveLODs)return-1;const e=this._scales;let i,r;if(t>=e[0])return this.effectiveMinZoom;if(t<=e[e.length-1])return this.effectiveMaxZoom;for(let n=0;nt&&rMath.abs(i-t)<=Math.abs(e-t)?i:e,this._scales[0])),this._lodByScale[t].scale}};E([k({readOnly:!0})],p_.prototype,"effectiveLODs",void 0),E([k({readOnly:!0})],p_.prototype,"effectiveMinZoom",void 0),E([k({readOnly:!0})],p_.prototype,"effectiveMaxZoom",void 0),E([k({readOnly:!0})],p_.prototype,"effectiveMinScale",void 0),E([k({readOnly:!0})],p_.prototype,"effectiveMaxScale",void 0),E([k()],p_.prototype,"lods",void 0),E([k()],p_.prototype,"minZoom",void 0),E([k()],p_.prototype,"maxZoom",void 0),E([k()],p_.prototype,"minScale",void 0),E([k()],p_.prototype,"maxScale",void 0),E([k()],p_.prototype,"snapToZoom",void 0),p_=GIe=E([ht("esri.views.2d.constraints.ZoomConstraint")],p_);const Jit=p_,Voi={base:null,key:"type",typeMap:{extent:vr,polygon:po}};let Dp=class extends fn{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}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 _defaultLODs(){const e=this.view?.defaultsFromMap?.tileInfo,i=this.view?.spatialReference;return e&&i&&e.spatialReference.equals(i)?e.lods:null}get _geometry(){return new yk({geometry:this.geometry,spatialReference:this.view?.spatialReference})}get _rotation(){return new Kit({rotationEnabled:this.rotationEnabled})}get _zoom(){const e=this._get("_zoom"),i=this.lods||this._defaultLODs,r=this.minZoom,n=this.maxZoom,s=this.minScale,o=this.maxScale,a=this.snapToZoom;return e&&e.lods===i&&e.minZoom===r&&e.maxZoom===n&&e.minScale===s&&e.maxScale===o&&e.snapToZoom===a?e:new Jit({lods:i,minZoom:r,maxZoom:n,minScale:s,maxScale:o,snapToZoom:a})}canZoomInTo(e){const i=this.effectiveMaxScale;return i===0||e>=i}canZoomOutTo(e){const i=this.effectiveMinScale;return i===0||e<=i}constrain(e,i){return this._zoom.constrain(e,i),this._rotation.constrain(e,i),this._geometry.constrain(e,i),e}constrainByGeometry(e){return this._geometry.constrain(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)}};E([k({readOnly:!0})],Dp.prototype,"effectiveLODs",null),E([k({readOnly:!0})],Dp.prototype,"effectiveMinScale",null),E([k({readOnly:!0})],Dp.prototype,"effectiveMaxScale",null),E([k({readOnly:!0})],Dp.prototype,"effectiveMinZoom",null),E([k({readOnly:!0})],Dp.prototype,"effectiveMaxZoom",null),E([k({types:Voi,value:null})],Dp.prototype,"geometry",null),E([k({type:[jn]})],Dp.prototype,"lods",void 0),E([k()],Dp.prototype,"minScale",void 0),E([k()],Dp.prototype,"maxScale",void 0),E([k()],Dp.prototype,"minZoom",void 0),E([k()],Dp.prototype,"maxZoom",void 0),E([k()],Dp.prototype,"rotationEnabled",void 0),E([k()],Dp.prototype,"snapToZoom",void 0),E([k()],Dp.prototype,"view",void 0),E([k({readOnly:!0})],Dp.prototype,"version",null),E([k()],Dp.prototype,"_defaultLODs",null),E([k({type:yk})],Dp.prototype,"_geometry",null),E([k({type:Kit})],Dp.prototype,"_rotation",null),E([k({readOnly:!0,type:Jit})],Dp.prototype,"_zoom",null),Dp=E([ht("esri.views.2d.MapViewConstraints")],Dp);const Zit=Dp;function aX(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function Uoi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function vk(t,e,i,r,n,s,o,a,l,c){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t[4]=s,t[5]=o,t[6]=a,t[7]=l,t[8]=c,t}function rP(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function lX(t,e){if(t===e){const i=e[1],r=e[2],n=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=r,t[7]=n}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function Qit(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],p=d*o-a*c,y=-d*s+a*l,v=c*s-o*l;let S=i*p+r*y+n*v;return S?(S=1/S,t[0]=p*S,t[1]=(-d*r+n*c)*S,t[2]=(a*r-n*o)*S,t[3]=y*S,t[4]=(d*i-n*l)*S,t[5]=(-a*i+n*s)*S,t[6]=v*S,t[7]=(-c*i+r*l)*S,t[8]=(o*i-r*s)*S,t):null}function VIe(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8];return t[0]=o*d-a*c,t[1]=n*c-r*d,t[2]=r*a-n*o,t[3]=a*l-s*d,t[4]=i*d-n*l,t[5]=n*s-i*a,t[6]=s*c-o*l,t[7]=r*l-i*c,t[8]=i*o-r*s,t}function joi(t){const e=t[0],i=t[1],r=t[2],n=t[3],s=t[4],o=t[5],a=t[6],l=t[7],c=t[8];return e*(c*s-o*l)+i*(-c*n+o*a)+r*(l*n-s*a)}function ov(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],d=e[7],p=e[8],y=i[0],v=i[1],S=i[2],I=i[3],O=i[4],L=i[5],N=i[6],G=i[7],V=i[8];return t[0]=y*r+v*o+S*c,t[1]=y*n+v*a+S*d,t[2]=y*s+v*l+S*p,t[3]=I*r+O*o+L*c,t[4]=I*n+O*a+L*d,t[5]=I*s+O*l+L*p,t[6]=N*r+G*o+V*c,t[7]=N*n+G*a+V*d,t[8]=N*s+G*l+V*p,t}function ug(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],d=e[7],p=e[8],y=i[0],v=i[1];return t[0]=r,t[1]=n,t[2]=s,t[3]=o,t[4]=a,t[5]=l,t[6]=y*r+v*o+c,t[7]=y*n+v*a+d,t[8]=y*s+v*l+p,t}function ST(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],d=e[7],p=e[8],y=Math.sin(i),v=Math.cos(i);return t[0]=v*r+y*o,t[1]=v*n+y*a,t[2]=v*s+y*l,t[3]=v*o-y*r,t[4]=v*a-y*n,t[5]=v*l-y*s,t[6]=c,t[7]=d,t[8]=p,t}function nP(t,e,i){const r=i[0],n=i[1],s=i[2];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t[6]=s*e[6],t[7]=s*e[7],t[8]=s*e[8],t}function jle(t,e,i){const r=i[0],n=i[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t}function UIe(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function zoi(t,e){const i=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Hoi(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Woi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function qoi(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=i+i,a=r+r,l=n+n,c=i*o,d=r*o,p=r*a,y=n*o,v=n*a,S=n*l,I=s*o,O=s*a,L=s*l;return t[0]=1-p-S,t[3]=d-L,t[6]=y+O,t[1]=d+L,t[4]=1-c-S,t[7]=v-I,t[2]=y-O,t[5]=v+I,t[8]=1-c-p,t}function Yoi(t,e){const i=e[0],r=e[1],n=e[2],s=e[4],o=e[5],a=e[6],l=e[8],c=e[9],d=e[10],p=d*o-a*c,y=-d*s+a*l,v=c*s-o*l,S=i*p+r*y+n*v;if(!S)return null;const I=1/S;return t[0]=p*I,t[1]=(-d*r+n*c)*I,t[2]=(a*r-n*o)*I,t[3]=y*I,t[4]=(d*i-n*l)*I,t[5]=(-a*i+n*s)*I,t[6]=v*I,t[7]=(-c*i+r*l)*I,t[8]=(o*i-r*s)*I,t}function sP(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],p=e[9],y=e[10],v=e[11],S=e[12],I=e[13],O=e[14],L=e[15],N=i*a-r*o,G=i*l-n*o,V=i*c-s*o,Y=r*l-n*a,X=r*c-s*a,te=n*c-s*l,re=d*I-p*S,fe=d*O-y*S,ge=d*L-v*S,_e=p*O-y*I,Ie=p*L-v*I,ke=y*L-v*O;let Ne=N*ke-G*Ie+V*_e+Y*ge-X*fe+te*re;return Ne?(Ne=1/Ne,t[0]=(a*ke-l*Ie+c*_e)*Ne,t[1]=(l*ge-o*ke-c*fe)*Ne,t[2]=(o*Ie-a*ge+c*re)*Ne,t[3]=(n*Ie-r*ke-s*_e)*Ne,t[4]=(i*ke-n*ge+s*fe)*Ne,t[5]=(r*ge-i*Ie-s*re)*Ne,t[6]=(I*te-O*X+L*Y)*Ne,t[7]=(O*V-S*te-L*G)*Ne,t[8]=(S*X-I*V+L*N)*Ne,t):null}function Xoi(t,e,i){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/i,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function Koi(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function Joi(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2)}function Zoi(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t[6]=e[6]+i[6],t[7]=e[7]+i[7],t[8]=e[8]+i[8],t}function ert(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t[6]=e[6]-i[6],t[7]=e[7]-i[7],t[8]=e[8]-i[8],t}function Qoi(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*i,t}function eai(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t[3]=e[3]+i[3]*r,t[4]=e[4]+i[4]*r,t[5]=e[5]+i[5]*r,t[6]=e[6]+i[6]*r,t[7]=e[7]+i[7]*r,t[8]=e[8]+i[8]*r,t}function tai(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function iai(t,e){const i=t[0],r=t[1],n=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],d=t[8],p=e[0],y=e[1],v=e[2],S=e[3],I=e[4],O=e[5],L=e[6],N=e[7],G=e[8],V=jv();return Math.abs(i-p)<=V*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(r-y)<=V*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-v)<=V*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(s-S)<=V*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(o-I)<=V*Math.max(1,Math.abs(o),Math.abs(I))&&Math.abs(a-O)<=V*Math.max(1,Math.abs(a),Math.abs(O))&&Math.abs(l-L)<=V*Math.max(1,Math.abs(l),Math.abs(L))&&Math.abs(c-N)<=V*Math.max(1,Math.abs(c),Math.abs(N))&&Math.abs(d-G)<=V*Math.max(1,Math.abs(d),Math.abs(G))}function jIe(t){const e=jv(),i=t[0],r=t[1],n=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],d=t[8];return Math.abs(1-(i*i+s*s+l*l))<=e&&Math.abs(1-(r*r+o*o+c*c))<=e&&Math.abs(1-(n*n+a*a+d*d))<=e}Object.freeze(Object.defineProperty({__proto__:null,add:Zoi,adjoint:VIe,copy:Uoi,determinant:joi,equals:iai,exactEquals:tai,frob:Joi,fromMat2d:Woi,fromMat4:aX,fromQuat:qoi,fromRotation:zoi,fromScaling:Hoi,fromTranslation:UIe,identity:rP,invert:Qit,isOrthoNormal:jIe,mul:ov,multiply:ov,multiplyScalar:Qoi,multiplyScalarAndAdd:eai,normalFromMat4:sP,normalFromMat4Legacy:Yoi,projection:Xoi,rotate:ST,scale:nP,scaleByVec2:jle,set:vk,str:Koi,sub:ert,subtract:ert,translate:ug,transpose:lX},Symbol.toStringTag,{value:"Module"}));function Cl(){const t=new Float32Array(9);return t[0]=1,t[4]=1,t[8]=1,t}function trt(t){const e=new Float32Array(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function zle(t,e,i,r,n,s,o,a,l){const c=new Float32Array(9);return c[0]=t,c[1]=e,c[2]=i,c[3]=r,c[4]=n,c[5]=s,c[6]=o,c[7]=a,c[8]=l,c}function rai(t,e){return new Float32Array(t,e,9)}Object.freeze(Object.defineProperty({__proto__:null,clone:trt,create:Cl,createView:rai,fromValues:zle},Symbol.toStringTag,{value:"Module"}));function CT(){return new Float32Array(2)}function nai(t){const e=new Float32Array(2);return e[0]=t[0],e[1]=t[1],e}function lp(t,e){const i=new Float32Array(2);return i[0]=t,i[1]=e,i}function sai(t,e){return new Float32Array(t,e,2)}function irt(){return CT()}function rrt(){return lp(1,1)}function nrt(){return lp(1,0)}function srt(){return lp(0,1)}const ort=irt(),art=rrt(),oai=nrt(),aai=srt();Object.freeze(Object.defineProperty({__proto__:null,ONES:art,UNIT_X:oai,UNIT_Y:aai,ZEROS:ort,clone:nai,create:CT,createView:sai,fromValues:lp,ones:rrt,unitX:nrt,unitY:srt,zeros:irt},Symbol.toStringTag,{value:"Module"}));function lai(t){return t instanceof Float32Array&&t.length>=2}function uai(t){return Array.isArray(t)&&t.length>=2}function zIe(t){return lai(t)||uai(t)}var HIe;const oP=[0,0];let EM=HIe=class extends Ni{constructor(t){super(t),this._viewpoint2D={center:Xa(),rotation:0,scale:0,spatialReference:void 0},this.center=[0,0],this.extent=new vr,this.id=0,this.inverseTransform=CM(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=CM(),this.transformNoRotation=CM(),this.displayMat3=Cl(),this.displayViewMat3=Cl(),this.viewMat3=Cl(),this.viewMat2d=d_(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(t){this._set("pixelRatio",t),this._update()}set size(t){this._set("size",t),this._update()}set viewpoint(t){if(t){const e=this._viewpoint2D,i=t.targetGeometry;e.center[0]=i.x,e.center[1]=i.y,e.rotation=t.rotation,e.scale=t.scale,e.spatialReference=i.spatialReference}this._update()}copy(t){const e=this.size,i=this.viewpoint;return i&&e?(this.viewpoint=G2(i,t.viewpoint),this._set("size",rG(e,t.size))):(this.viewpoint=t.viewpoint.clone(),this._set("size",[t.size[0],t.size[1]])),this._set("pixelRatio",t.pixelRatio),this}clone(){return new HIe({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(t,e,i){return zIe(e)?f0(t,e,this.inverseTransform):(oP[0]=e,oP[1]=i,f0(t,oP,this.inverseTransform))}toScreen(t,e,i){return zIe(e)?f0(t,e,this.transform):(oP[0]=e,oP[1]=i,f0(t,oP,this.transform))}toScreenNoRotation(t,e,i){return zIe(e)?f0(t,e,this.transformNoRotation):(oP[0]=e,oP[1]=i,f0(t,oP,this.transformNoRotation))}getScreenTransform(t,e){const{center:i}=this._viewpoint2D,r=this._get("pixelRatio")||1,n=this._get("size");return MIe(t,i,n,e,0,r),t}_update(){const{center:t,spatialReference:e,scale:i,rotation:r}=this._viewpoint2D,n=this._get("pixelRatio")||1,s=this._get("size"),o=new u_({targetGeometry:new Yi(t[0],t[1],e),scale:i,rotation:r});if(this._set("viewpoint",o),!s||!e||!i)return;this.resolution=nG(o),this.rotation=r,this.scale=i,this.spatialReference=e,rG(this.center,t);const a=s[0]!==0?2/s[0]:0,l=s[1]!==0?-2/s[1]:0;vk(this.displayMat3,a,0,0,0,l,0,-1,1,1);const c=rP(this.viewMat3),d=lp(s[0]/2,s[1]/2),p=lp(-s[0]/2,-s[1]/2),y=IL(r);ug(c,c,d),ST(c,c,y),ug(c,c,p),ov(this.displayViewMat3,this.displayMat3,c);const v=Mle(this.viewMat2d,d);return pk(v,v,y),vM(v,v,p),Soi(this.extent,o,s),DIe(this.transform,o,s,n),dIe(this.inverseTransform,this.transform),Ooi(this.transformNoRotation,o,s,n),this.worldScreenWidth=Roi(this.spatialReference,this.resolution),this._set("id",this.id+1),this}};E([k({readOnly:!0})],EM.prototype,"id",void 0),E([k({value:1,json:{write:!0}})],EM.prototype,"pixelRatio",null),E([k({json:{write:!0}})],EM.prototype,"size",null),E([k()],EM.prototype,"spatialReference",void 0),E([k({type:u_,json:{write:!0}})],EM.prototype,"viewpoint",null),EM=HIe=E([ht("esri.views.2d.ViewState")],EM);const lrt=EM;var WIe,qIe;let aP=WIe=class extends fn{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new WIe({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};E([k()],aP.prototype,"left",void 0),E([k()],aP.prototype,"top",void 0),E([k()],aP.prototype,"right",void 0),E([k()],aP.prototype,"bottom",void 0),aP=WIe=E([ht("esri.views.2d.PaddedViewState.Padding")],aP);let oG=qIe=class extends lrt{constructor(...t){super(...t),this.paddedViewState=new lrt,this._updateContent=(()=>{const e=Xa();return()=>{const i=this._get("size"),r=this._get("padding");if(!i||!r)return;const n=this.paddedViewState;aa(e,r.left+r.right,r.top+r.bottom),eX(e,i,e),rG(n.size,e);const s=n.viewpoint;s&&(this.viewpoint=s)}})(),this.addHandles(Qi(()=>[this.size,this.padding],()=>this._updateContent(),Nu)),this.padding=new aP,this.size=[0,0]}set padding(t){this._set("padding",t||new aP)}set viewpoint(t){if(t){const e=t.clone();this.paddedViewState.viewpoint=t,Moi(e,t,this._get("size"),this._get("padding"));const i=this._viewpoint2D,r=e.targetGeometry;i.center[0]=r.x,i.center[1]=r.y,i.rotation=e.rotation,i.scale=e.scale,i.spatialReference=r.spatialReference,this._update()}}clone(){return new qIe({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};E([k()],oG.prototype,"paddedViewState",void 0),E([k({type:aP})],oG.prototype,"padding",null),E([k()],oG.prototype,"viewpoint",null),oG=qIe=E([ht("esri.views.2d.PaddedViewState")],oG);const cai=oG;let hai=class{constructor(e,i){this.item=e,this.controller=i,this.promise=null}},_k=class{constructor(e){this._deferreds=new Map,this._controllers=new Map,this._processingItems=new Map,this._isPaused=!1,this._schedule=null,this._task=null,this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new lq(e.peeker),this.process=e.process;const i=e.scheduler;e.priority&&ye(i)&&(this._task=i.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule&&(this._schedule.remove(),this._schedule=null),this._task&&(this._task.remove(),this._task=null)}get length(){return this._processingItems.size+this._queue.length}abort(e){const i=this._controllers.get(e);i&&i.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach(i=>e.push(i)),this._controllers.clear(),e.forEach(i=>i.abort()),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((i,r)=>e(r))}get(e){const i=this._deferreds.get(e);return i?i.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._isPaused||(this._isPaused=!0,this._cancelNext())}push(e,i){const r=this.get(e);if(r)return r;const n=new AbortController;let s=null;i&&(s=ep(i,()=>n.abort()));const o=()=>{const d=this._processingItems.get(e);d&&d.controller.abort(),a(),c.reject(vc())},a=()=>{l.remove(),ye(s)&&s.remove(),this._deferreds.delete(e),this._controllers.delete(e),this._queue.remove(e),this._processingItems.delete(e),this._scheduleNext()},l=k8(n.signal,o),c=Jx();return this._deferreds.set(e,c),this._controllers.set(e,n),c.promise.then(a,a),this._queue.push(e),this._scheduleNext(),c.promise}last(){return this._queue.last()}peek(){return this._queue.peek()}popLast(){return this._queue.popLast()}reset(){const e=[];this._processingItems.forEach(i=>e.push(i)),this._processingItems.clear();for(const i of e)this._queue.push(i.item),i.controller.abort();this._scheduleNext()}resume(){this._isPaused&&(this._isPaused=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._isPaused&&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,i)}get test(){return{update:e=>this.runTask(e)}}};function dai(t,e){return t.length=0,e.forEach(i=>t.push(i)),t}const YIe=new Set,Hle=[],aG=new Map,urt=[0,0];let IM=class extends fn{constructor(e){super(e),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:e,process:i}=this;this._queue=new _k({concurrency:e,process:(r,n)=>{const s=this._keyToItem.get(r);return i(s,{signal:n})},peeker:r=>r.values().next().value})}destroy(){this.clear(),this._queue=ra(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}get updating(){return this.length>0||this.onGoingCount>0}abort(e){const i=typeof e=="string"?e:e.id;this._queue.abort(i)}clear(){this._queue.clear(),this._keyToItem.clear(),this.notifyChange("updating")}has(e){return typeof e=="string"?this._keyToItem.has(e):this._keyToItem.has(e.id)}isOngoing(e){const i=typeof e=="string"?e:e.id;return this.has(i)&&this._queue.isOngoing(i)}pause(){this._queue.pause()}push(e,i){const r=e.key.id+"-"+i;if(this.has(r))return this.get(r);const n=this._queue.push(r),s=()=>{this._keyToItem.delete(r),this.notifyChange("updating")};return this._keyToItem.set(r,e),n.then(s,s),this.notifyChange("updating"),n}reset(){this._queue.reset(),this.notifyChange("updating")}resume(){this._queue.resume()}_peekByScaleFirst(e){if(!this.state)return e.values().next().value;const i=this.tileInfoView;let r=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY;e.forEach(d=>{const p=this._keyToItem.get(d),y=this.tileInfoView.getTileScale(p.key);aG.has(y)||(aG.set(y,[]),r=Math.max(y,r),n=Math.min(y,n)),aG.get(y).push(p.key),YIe.add(y)});let s=this.state.scale;aG.has(s)||(dai(Hle,YIe),Hle.sort((d,p)=>d-p),s=Hle.reduce((d,p)=>Math.abs(p-s){const y=a.denormalizeCol(d.col,d.world),v=a.denormalizeCol(p.col,p.world);return Math.sqrt((l-y)*(l-y)+(c-d.row)*(c-d.row))-Math.sqrt((l-v)*(l-v)+(c-p.row)*(c-p.row))}),YIe.clear(),aG.clear(),o[0].id}_peekByCenterFirst(e){if(!this.state)return e.values().next().value;const i=this.tileInfoView,r=this.state.center;let n,s=Number.POSITIVE_INFINITY;return e.forEach(o=>{const a=this._keyToItem.get(o);i.getTileCoords(urt,a.key);const l=iX(urt,r);l=0&&this.row===e.row>>i&&this.col===e.col>>i&&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 P8(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,i,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=+i,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 P8(this.level-1,this.row>>1,this.col>>1,this.world)}getChildKeys(){const e=this.level+1,i=this.row<<1,r=this.col<<1,n=this.world;return[new P8(e,i,r,n),new P8(e,i,r+1,n),new P8(e,i+1,r,n),new P8(e,i+1,r+1,n)]}compareRowMajor(e){return this.rowe.row?1:this.cole.col?1:0}};xh.pool=new _C(xh,null,null,25,50);function AM(t,e){return[t,e]}function bk(t,e,i){return t[0]=e,t[1]=i,t}function pai(t,e,i,r,n){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t}const V2=new xh("0/0/0/0");let fai=class ALt{static create(e,i,r=null){const n=pd(e.spatialReference),s=i.origin||AM(e.origin.x,e.origin.y),o=AM(e.size[0]*i.resolution,e.size[1]*i.resolution),a=AM(-1/0,-1/0),l=AM(1/0,1/0),c=AM(1/0,1/0);ye(r)&&(bk(a,Math.max(0,Math.floor((r.xmin-s[0])/o[0])),Math.max(0,Math.floor((s[1]-r.ymax)/o[1]))),bk(l,Math.max(0,Math.floor((r.xmax-s[0])/o[0])),Math.max(0,Math.floor((s[1]-r.ymin)/o[1]))),bk(c,l[0]-a[0]+1,l[1]-a[1]+1));const{cols:d,rows:p}=i;let y,v,S,I;return!r&&d&&p&&(bk(a,d[0],p[0]),bk(l,d[1],p[1]),bk(c,d[1]-d[0]+1,p[1]-p[0]+1)),e.isWrappable?(y=AM(Math.ceil(Math.round((n.valid[1]-n.valid[0])/i.resolution)/e.size[0]),c[1]),v=AM(Math.floor((n.origin[0]-s[0])/o[0]),a[1]),S=AM(y[0]+v[0]-1,l[1]),I=!0):(v=a,S=l,y=c,I=!1),new ALt(i.level,i.resolution,i.scale,s,a,l,c,o,v,S,y,I)}constructor(e,i,r,n,s,o,a,l,c,d,p,y){this.level=e,this.resolution=i,this.scale=r,this.origin=n,this.first=s,this.last=o,this.size=a,this.norm=l,this.worldStart=c,this.worldEnd=d,this.worldSize=p,this.wrap=y}normalizeCol(e){if(!this.wrap)return e;const i=this.worldSize[0];return e<0?i-1-Math.abs((e+1)%i):e%i}denormalizeCol(e,i){return this.wrap?this.worldSize[0]*i+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,i,r=!1){V2.set(i);const n=r?V2.col:this.denormalizeCol(V2.col,V2.world),s=V2.row;return pai(e,this.getXForColumn(n),this.getYForRow(s+1),this.getXForColumn(n+1),this.getYForRow(s)),e}getTileCoords(e,i,r=!1){V2.set(i);const n=r?V2.col:this.denormalizeCol(V2.col,V2.world);return Array.isArray(e)?bk(e,this.getXForColumn(n),this.getYForRow(V2.row)):(e.x=this.getXForColumn(n),e.y=this.getYForRow(V2.row)),e}},lP=class{constructor(){this.spans=[]}acquire(e){this.lodInfo=e}release(){this.lodInfo=null,this.spans.length=0}forEach(e,i){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 c=a;c<=l;c++)e.call(i,s,o,n.normalizeCol(c),n.getWorldForColumn(c))}};lP.pool=new _C(lP);let XIe=class{constructor(e,i,r){this.row=e,this.colFrom=i,this.colTo=r}};const xd=new xh("0/0/0/0");let mai=class PLt{static create(e,i){e[1]>i[1]&&([e,i]=[i,e]);const[r,n]=e,[s,o]=i,a=s-r,l=o-n,c=l!==0?a/l:0,d=(Math.ceil(n)-n)*c,p=(Math.floor(n)-n)*c;return new PLt(r,Math.floor(n),Math.ceil(o),c,a<0?d:p,a<0?p:d,a<0?s:r,a<0?r:s)}constructor(e,i,r,n,s,o,a,l){this.x=e,this.ymin=i,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 Q1=[[0,0],[0,0],[0,0],[0,0]],gai=1e-6;let wk=class{constructor(e,i=null){this.tileInfo=e,this.fullExtent=i,this.scales=[],this._infoByScale={},this._infoByLevel={};const r=e.lods.slice();r.sort((s,o)=>o.scale-s.scale);const n=this._lodInfos=r.map(s=>fai.create(e,s,i));r.forEach((s,o)=>{this._infoByLevel[s.level]=n[o],this._infoByScale[s.scale]=n[o],this.scales[o]=s.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,i,r=!1){xd.set(i);const n=this._infoByLevel[xd.level];return n?n.getTileBounds(e,xd,r):e}getTileCoords(e,i,r=!1){xd.set(i);const n=this._infoByLevel[xd.level];return n?n.getTileCoords(e,xd,r):e}getTileCoverage(e,i=192,r="closest"){const n=r==="closest"?this.getClosestInfoForScale(e.scale):this.getSmallestInfoForScale(e.scale),s=lP.pool.acquire(n),o=this._wrap;let a,l,c,d=1/0,p=-1/0;const y=s.spans;Q1[0][0]=Q1[0][1]=Q1[1][1]=Q1[3][0]=-i,Q1[1][0]=Q1[2][0]=e.size[0]+i,Q1[2][1]=Q1[3][1]=e.size[1]+i;for(const O of Q1)e.toMap(O,O),O[0]=n.getColumnForX(O[0]),O[1]=n.getRowForY(O[1]);const v=[];let S=3;for(let O=0;O<4;O++){if(Q1[O][1]===Q1[S][1]){S=O;continue}const L=mai.create(Q1[O],Q1[S]);d=Math.min(L.ymin,d),p=Math.max(L.ymax,p),v[L.ymin]===void 0&&(v[L.ymin]=[]),v[L.ymin].push(L),S=O}if(d==null||p==null||p-d>100)return null;let I=[];for(a=d;a=0;O--){const L=I[O];l=Math.min(l,L.getLeftCol()),c=Math.max(c,L.getRightCol())}if(l=Math.floor(l),c=Math.floor(c),a>=n.first[1]&&a<=n.last[1])if(o)if(n.size[0]n.last[0]||c=0;O--){const L=I[O];L.ymax>=a?L.incrRow():I.splice(O,1)}}return s}getTileParentId(e){xd.set(e);const i=this._infoByLevel[xd.level],r=this._lodInfos.indexOf(i)-1;return r<0?null:(this._getTileIdAtLOD(xd,this._lodInfos[r],xd),xd.id)}getTileResolution(e){const i=this._infoByLevel[typeof e=="object"?e.level:e];return i?i.resolution:-1}getTileScale(e){const i=this._infoByLevel[e.level];return i?i.scale:-1}intersects(e,i){xd.set(i);const r=this._infoByLevel[xd.level],n=e.lodInfo;if(n.resolution>r.resolution){this._getTileIdAtLOD(xd,n,xd);const o=n.denormalizeCol(xd.col,xd.world);for(const a of e.spans)if(a.row===xd.row&&a.colFrom<=o&&a.colTo>=o)return!0}if(n.resolution(I[0]=Math.min(I[0],O.row),I[1]=Math.max(I[1],O.row),I[2]=Math.min(I[2],O.colFrom),I[3]=Math.max(I[3],O.colTo),I),[1/0,-1/0,1/0,-1/0]),d=r.denormalizeCol(xd.col,xd.world),p=n.getColumnForX(r.getXForColumn(d)),y=n.getRowForY(r.getYForRow(xd.row)),v=n.getColumnForX(r.getXForColumn(d+1))-1,S=n.getRowForY(r.getYForRow(xd.row+1))-1;return!(p>c||va||So.row===xd.row&&o.colFrom<=s&&o.colTo>=s)}normalizeBounds(e,i,r){if(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],this._wrap){const n=pd(this.tileInfo.spatialReference),s=-r*(n.valid[1]-n.valid[0]);e[0]+=s,e[2]+=s}return e}getSmallestInfoForScale(e){const i=this.scales;if(this._infoByScale[e])return this._infoByScale[e];if(e>i[0])return this._infoByScale[i[0]];for(let r=1;ri[r]+gai)return this._infoByScale[i[r-1]];return this._infoByScale[i[i.length-1]]}getClosestInfoForScale(e){const i=this.scales;return this._infoByScale[e]||(e=i.reduce((r,n)=>Math.abs(n-e)=0;r--)if(et.push(i)),t}const KIe=new Set,Wle=[],lG=new Map,crt=[0,0];let uP=class extends fn{constructor(e){super(e),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:e,process:i,strategy:r}=this;this._queue=new _k({concurrency:e,process:(n,s)=>{const o=this._keyToItem.get(n);return i(o,{signal:s})},peeker:r==="scale-first"?n=>this._peekByScaleFirst(n):n=>this._peekByCenterFirst(n)})}destroy(){this.clear(),this._queue=ra(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}get updating(){return this.length>0||this.onGoingCount>0}abort(e){const i=typeof e=="string"?e:e.id;this._queue.abort(i)}clear(){this._queue.clear(),this._keyToItem.clear(),this.notifyChange("updating")}has(e){return typeof e=="string"?this._keyToItem.has(e):this._keyToItem.has(e.id)}isOngoing(e){const i=typeof e=="string"?e:e.id;return this.has(i)&&this._queue.isOngoing(i)}pause(){this._queue.pause()}push(e){const i=e.key.id;if(this._queue.has(i))return this._queue.get(i);const r=this._queue.push(i),n=()=>{this._keyToItem.delete(i),this.notifyChange("updating")};return this._keyToItem.set(i,e),r.then(n,n),this.notifyChange("updating"),r}reset(){this._queue.reset()}resume(){this._queue.resume()}_peekByScaleFirst(e){if(!this.state)return e.values().next().value;const i=this.tileInfoView;let r=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY;e.forEach(d=>{const p=this._keyToItem.get(d),y=this.tileInfoView.getTileScale(p.key);lG.has(y)||(lG.set(y,[]),r=Math.max(y,r),n=Math.min(y,n)),lG.get(y).push(p.key),KIe.add(y)});let s=this.state.scale;lG.has(s)||(yai(Wle,KIe),Wle.sort((d,p)=>d-p),s=Wle.reduce((d,p)=>Math.abs(p-s){const y=a.denormalizeCol(d.col,d.world),v=a.denormalizeCol(p.col,p.world);return Math.sqrt((l-y)*(l-y)+(c-d.row)*(c-d.row))-Math.sqrt((l-v)*(l-v)+(c-p.row)*(c-p.row))}),KIe.clear(),lG.clear(),o[0].id}_peekByCenterFirst(e){if(!this.state)return e.values().next().value;const i=this.tileInfoView,r=this.state.center;let n,s=Number.POSITIVE_INFINITY;return e.forEach(o=>{const a=this._keyToItem.get(o);i.getTileCoords(crt,a.key);const l=iX(crt,r);lthis.maxSize&&s>=0;)s!==e&&(n=this._pruneAroundCenterTile(n,i,r,s)),s--;n>this.maxSize&&(n=this._pruneAroundCenterTile(n,i,r,e))}_pruneAroundCenterTile(e,i,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],c=r*o[1],d=[0,0],p=[0,0];for(s.sort((y,v)=>(d[0]=a.x+l*(y.col+.5),d[1]=a.y-c*(y.row+.5),p[0]=a.x+l*(v.col+.5),p[1]=a.y-c*(v.row+.5),Vle(d,i)-Vle(p,i)));s.length>0;){const y=s.pop();if(this._removeTile(y.id),--e===this.maxSize)break}return e}_removeTile(e){const i=this._tilePerId.get(e);this._removedFunc&&i&&this._removedFunc(i),hrt(this._tilePerId,e)}};function hrt(t,e){t.delete(e)}const xk=new xh(0,0,0,0),ww=new Map,cG=[],qle=[];let uX=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,this.resampling=e.resampling==null||!!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 vai(e.cacheSize,this.tileInfoView,i=>{this.releaseTile(i)}))}destroy(){this.tileIndex.clear()}update(e){const{resampling:i,tileIndex:r}=this,n=this.tileInfoView.getTileCoverage(e.state,this.buffer,this.coveragePolicy);if(qle.length=0,cG.length=0,ww.clear(),!n)return;const{minScale:s,maxScale:o}=this.tileInfoView.tileInfo,{spans:a,lodInfo:l}=n,{level:c}=l,{scale:d,center:p,resolution:y}=e.state,v=!e.stationary&&d>this._previousScale;if(this._previousScale=d,this.tiles.length=0,!i&&(d>s||d{this.releaseTile(L)}),r.clear(),qle.length=0,cG.length=0,ww.clear(),lP.pool.release(n),!0;r.forEach(L=>L.visible=!0);let S=0,I=0;if(a.length>0)for(const{row:L,colFrom:N,colTo:G}of a)for(let V=N;V<=G;V++){S++;const Y=xk.set(c,L,l.normalizeCol(V),l.getWorldForColumn(V)).id;if(r.has(Y)){const X=r.get(Y);X.isReady?(ww.set(Y,X),I++):v||this._addParentTile(Y,ww)}else{let X;if(this._tileCache&&this._tileCache.has(Y)){if(X=this._tileCache.pop(Y),this.tileIndex.set(Y,X),X.isReady){ww.set(Y,X),I++;continue}}else X=this.acquireTile(xk),this.tileIndex.set(Y,X);v||this._addParentTile(Y,ww)}}const O=I===S;r.forEach((L,N)=>{if(xk.set(N),ww.has(N))return;const G=this.tileInfoView.intersects(n,xk),V=this.cachePolicy==="purge"?xk.level!==c:xk.level>c;!G||!v&&O?!V&&G||cG.push(N):L.isReady?V&&this.cachePolicy==="purge"&&this._hasReadyAncestor(xk,c)?cG.push(N):qle.push(N):V&&cG.push(N)});for(const L of qle){const N=r.get(L);N&&N.isReady&&ww.set(L,N)}for(const L of cG){const N=r.get(L);this._tileCache?this._tileCache.add(N):this.releaseTile(N),r.delete(L)}return ww.forEach(L=>this.tiles.push(L)),r.forEach(L=>{ww.has(L.key.id)||(L.visible=!1)}),this._tileCache&&this._tileCache.prune(c,p,y),lP.pool.release(n),ww.clear(),O}clear(e=!0){const{tileIndex:i}=this;e&&i.forEach(r=>{this.releaseTile(r)}),i.clear()}updateCacheSize(e){this._tileCache&&(this._tileCache.maxSize=e)}_addParentTile(e,i){let r=e,n=null;for(;r=this.tileInfoView.getTileParentId(r),r;)if(this.tileIndex.has(r)){if(n=this.tileIndex.get(r),n&&n.isReady){i.has(n.key.id)||i.set(n.key.id,n);break}}else if(this._tileCache&&this._tileCache.has(r)&&(n=this._tileCache.pop(r),this.tileIndex.set(r,n),n&&n.isReady)){i.has(n.key.id)||i.set(n.key.id,n);break}}_hasReadyAncestor(e,i){const r=_o();this.tileInfoView.getTileBounds(r,e,!0);for(const n of this.tileIndex.values())if(n.isReady&&n.key.level>=i&&n.key.levelthis._handleDoubleClick(r,i))}_handleDoubleClick(e,i){JIe(e.data,"primary")&&(e.stopPropagation(),i?this._view.mapViewNavigation.zoomOut([e.data.x,e.data.y]):this._view.mapViewNavigation.zoomIn([e.data.x,e.data.y]))}},_ai=class extends Dm{constructor(e,i,r){super(!0),this.view=e,this.pointerType=i,this.registerIncoming("double-tap-drag",r,n=>this._handleDoubleTapDrag(n))}_handleDoubleTapDrag(e){const{data:i}=e,{pointerType:r}=i;if(r!==this.pointerType)return;e.stopPropagation();const{action:n,delta:s}=i,{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,c=this._startScale*l,d=c/this._currentScale;a.setViewpointImmediate(d),this._currentScale=c;break}case"end":{const{constraints:l}=o,{effectiveLODs:c,snapToZoom:d}=l;if(!d||!c)return void a.end();const p=l.snapScale(this._currentScale),y=(s.y>0?Math.max(p,l.snapToPreviousScale(this._startScale)):Math.min(p,l.snapToNextScale(this._startScale)))/this._currentScale;a.zoom(y);break}}}},Yle=class{constructor(e){this._callbacks=e,this._currentCount=0,this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(e){const i=e.data,r=i.pointers.size;switch(i.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}},bai=class extends Dm{constructor(e,i,r){super(!0),this.view=e,this.pointerAction=i,this.registerIncoming("drag",r,n=>this._handleDrag(n)),this.registerIncoming("pointer-down",()=>this.stopMomentumNavigation())}onInstall(e){super.onInstall(e),this._dragEventSeparator=new Yle({start:(i,r)=>{this.view.mapViewNavigation.pan.begin(this.view,r.data),r.stopPropagation()},update:(i,r)=>{this.view.mapViewNavigation.pan.update(this.view,r.data),r.stopPropagation()},end:(i,r)=>{this.view.mapViewNavigation.pan.end(this.view,r.data),r.stopPropagation()},condition:(i,r)=>i===1&&JIe(r.data,this.pointerAction)})}_handleDrag(e){const i=this.view.mapViewNavigation;i.pinch.zoomMomentum||i.pinch.rotateMomentum?this.stopMomentumNavigation():this._dragEventSeparator.handle(e)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}},wai=class extends Dm{constructor(e,i,r){super(!0),this._view=e,this.pointerAction=i;const n=this._view.mapViewNavigation;this._dragEventSeparator=new Yle({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&&JIe(o.data,this.pointerAction)}),this.registerIncoming("drag",r,s=>this._dragEventSeparator.handle(s))}};function U2(t){let e=t*t;return t<0&&(e*=-1),e}function xai(t){return t.translation[0]=0,t.translation[1]=0,t.translation[2]=0,t.heading=0,t.tilt=0,t}function Sai(t,e,i){const r=i,n=t.state,s=t.device,o=e.tiltDirection==="forward-down"?1:-1,a=1;return s.deviceType==="standard"?(r.translation[0]=U2(n.axes[0]),r.translation[1]=U2(n.axes[1]),r.translation[2]=U2(n.buttons[7])-U2(n.buttons[6]),r.heading=U2(n.axes[2]),r.tilt=U2(n.axes[3])):s.deviceType==="spacemouse"&&(r.translation[0]=1.2*U2(n.axes[0]),r.translation[1]=1.2*U2(n.axes[1]),r.translation[2]=2*-U2(n.axes[2]),r.heading=1.2*U2(n.axes[5]),r.tilt=1.2*U2(n.axes[3])),r.tilt*=o,Gh(r.translation,r.translation,a),r}function Cai(t){return t.translation[0]===0&&t.translation[1]===0&&t.translation[2]===0&&t.heading===0&&t.tilt===0&&t.zoom===0}let Tai=class extends Dm{constructor(e){super(!0),this._view=e,this._frameTask=null,this._watchHandles=new uf,this._currentDevice=null,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._handle=this.registerIncoming("gamepad",i=>this._handleGamePadEvent(i)),this._handle.pause()}onInstall(e){super.onInstall(e),this._watchHandles.add([Qi(()=>this._view.navigation.gamepad?.enabled,i=>{i?(this._handle.resume(),this._frameTask||(this._frameTask=uL({update:r=>this._frameUpdate(r.deltaTime)}))):(this._handle.pause(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null))},Fo)])}onUninstall(){this._watchHandles.removeAll(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null),super.onUninstall()}_handleGamePadEvent(e){const i=this._view.navigation.gamepad.device;i&&e.data.device!==i||this._currentDevice&&this._currentDevice!==e.data.device||(e.data.action==="end"?(this._currentDevice=null,xai(this._transformation)):(this._currentDevice=e.data.device,Sai(e.data,this._view.navigation.gamepad,this._transformation)))}_frameUpdate(e){const i=this._transformation;if(Cai(i))return;const r=this._view.viewpoint.clone(),n=this._view.navigation.gamepad.velocityFactor,s=Iai*n*e;TM(r,r,[i.translation[0]*s,-i.translation[1]*s]);const o=1+i.translation[2]*Aai*e,a=this._view.constraints.rotationEnabled?-i.heading*Eai*e:0,l=this._view.size,c=[l[0]/2,l[1]];NIe(r,r,o,a,c,l);const d=this._view.constraints.constrain(r,this._view.viewpoint);this._view.viewpoint=d}};const Eai=.06,Iai=.7,Aai=6e-4;let Pai=class extends Dm{constructor(e,i,r){super(!0),this.view=e,this.keys=i,this._pressed=!1,this._keyMap={[i.left]:"left",[i.right]:"right",[i.up]:"up",[i.down]:"down"},this.registerIncoming("key-down",r,n=>this._handleKeyDown(n)),this.registerIncoming("key-up",r,n=>this._handleKeyUp(n)),this.registerIncoming("blur",r,()=>this._handleBlur())}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleBlur(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,i){const r=this._keyMap[e.data.key];if(this._pressed=r!=null,this._pressed){if(i)switch(this.view.mapViewNavigation.begin(),r){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 this._pressed=!1,this.view.mapViewNavigation.stop();e.stopPropagation()}}},Oai=class extends Dm{constructor(e,i,r){super(!0),this.view=e,this.keys=i,this._pressed=!1,this._keyToDirection={[i.clockwiseOption1]:"clockwise",[i.clockwiseOption2]:"clockwise",[i.counterClockwiseOption1]:"counterClockwise",[i.counterClockwiseOption2]:"counterClockwise",[i.resetOption1]:"reset",[i.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._handleBlur())}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleBlur(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,i){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(i)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 hG;(function(t){t[t.IN=0]="IN",t[t.OUT=1]="OUT"})(hG||(hG={}));let Rai=class extends Dm{constructor(e,i,r){super(!0),this.view=e,this.keys=i,this._keysToZoomAction={},this.registerIncoming("key-down",r,n=>this._handleKeyDown(n)),i.zoomIn.forEach(n=>this._keysToZoomAction[n]=hG.IN),i.zoomOut.forEach(n=>this._keysToZoomAction[n]=hG.OUT)}_handleKeyDown(e){this._handleKey(e)}_handleKey(e){const i=e.modifiers;if(i.size>0&&!i.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 hG.IN:o=s.zoomIn();break;case hG.OUT:o=s.zoomOut();break;default:return}s.begin(),o.then(()=>s.end()),e.stopPropagation()}};const Mai=.6;let Dai=class extends Dm{constructor(e,i){super(!0),this._view=e,this._canZoom=!0,this.registerIncoming("mouse-wheel",i,r=>this._handleMouseWheel(r))}_handleMouseWheel(e){if(!this._view.navigation.mouseWheelZoomEnabled||(e.preventDefault(),e.stopPropagation(),!this._canZoom))return;const i=this._view.mapViewNavigation,{x:r,y:n,deltaY:s}=e.data,o=1/Mai**(1/60*s),a=i.zoom(o,[r,n]);a&&(this._canZoom=!1,a.catch(()=>{}).then(()=>{this._canZoom=!0,i.end()}))}},Fai=class extends Dm{constructor(e){super(!0),this.view=e,this.registerIncoming("drag",r=>this._handleDrag(r)),this.registerIncoming("pointer-down",()=>this._stopMomentumNavigation());const i=this.view.mapViewNavigation;this._dragEventSeparator=new Yle({start:(r,n)=>{i.pinch.begin(this.view,n.data),n.stopPropagation()},update:(r,n)=>{i.pinch.update(this.view,n.data),n.stopPropagation()},end:(r,n)=>{i.pinch.end(this.view),n.stopPropagation()},condition:r=>r>=2})}_handleDrag(e){this._dragEventSeparator.handle(e)}_stopMomentumNavigation(){this.view.mapViewNavigation.pinch.stopMomentumNavigation()}};function prt(t){const e=t.native;return e?{buttons:e.buttons.map(i=>i.pressed?i.value?i.value:1:0),axes:e.axes.map(i=>Nai(i,t.axisThreshold))}:{buttons:[],axes:[]}}function Lai(t,e){if(t.axes.length!==e.axes.length||t.buttons.length!==e.buttons.length)return!1;for(let i=0;i{this._connectGamepad(s.gamepad)},this._onDisconnectGamepad=s=>{const o=s.gamepad,a=o.index,l=this._inputDevices[a];l&&(this._emitGamepadEvent(o,prt(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 i=new bIe(e);i.deviceType!=="unknown"&&(this._inputDevices[e.index]=i,this._input.gamepad.devices.add(i)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){this._frameTask==null&&(this._frameTask=uL({update:()=>this._readGamepadState()}))}_stopPolling(){this._frameTask!=null&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const e=document.hasFocus(),i=this._element.contains(document.activeElement),r=this._input.gamepad.enabledFocusMode==="document"&&!e||this._input.gamepad.enabledFocusMode==="view"&&!i;this._forEachGamepad(n=>{const s=this._inputDevices[n.index];if(!s)return;const o=this._latestUpdate[n.index],a=prt(s),l=r||kai(a);o&&(o.timestamp===n.timestamp||!o.active&&l||Lai(o.state,a))||this._emitGamepadEvent(n,a,!l)})}_forEachGamepad(e){const i=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 $ai(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=ra(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 i in this._active)if(!e||!e.has(i)){const r=this._active[i];this._element.removeEventListener(ZIe[i],r),delete this._active[i]}e&&e.forEach(i=>{if(!this._active[i]&&ZIe[i]){const r=(this._eventHandlers[i]||this._handleDefault).bind(this,i);this._element.addEventListener(ZIe[i],r),this._active[i]=r}}),this._gamepadSource.hasEventListeners=e?.has("gamepad")??!1}setPointerCapture(e,i){i?(this._element.setPointerCapture(e.pointerId),this._activePointerCaptures.add(e.pointerId)):(this._releasePointerCaptureSafe(e.pointerId),this._activePointerCaptures.delete(e.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?dG.touchNone:dG.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?dG.touchPan:dG.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(dG.touchNone),this._element.classList.remove(dG.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_releasePointerCaptureSafe(e){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(e))return;this._element.releasePointerCapture(e)}catch{}}_updateNormalizedPointerLikeEvent(e,i){const r=pit(this._element,e);return OLt.test.disableSubpixelCoordinates&&(r.x=Math.round(r.x),r.y=Math.round(r.y)),i.x=r.x,i.y=r.y,i}_handleKey(e,i){const r=nsi(i);r&&e==="key-up"&&this._keyDownState.delete(r);const n={native:i,key:r,repeat:!!r&&this._keyDownState.has(r)};r&&e==="key-down"&&this._keyDownState.add(n.key),this._callback(e,n)}_handlePointer(e,i){const r=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});this._callback(e,r)}_handlePointerPreventDefault(e,i){const r=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});i.preventDefault(),this._callback(e,r)}_handleMouseWheel(e,i){let r=i.deltaY;switch(i.deltaMode){case 0:frt&&(r=r/document.documentElement.clientHeight*600);break;case 1:r*=30;break;case 2:r*=900}frt?r*=.7:Bai||Vai?r*=.6:Gai&&(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(i,{native:i,x:0,y:0,deltaY:r});this._callback(e,o)}_handlePointerCaptureLost(e,i){this._activePointerCaptures.delete(i.pointerId),this._handleDefault(e,i)}_handleDefault(e,i){const r={native:i};i.preventDefault(),this._callback(e,r)}_preventAltKeyDefault(e){e.key==="Alt"&&e.preventDefault()}_preventMultiTouchPanning(e){e.touches.length>1&&e.preventDefault()}};grt.test={disableSubpixelCoordinates:!1};const ZIe={"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 Uai=class extends Dm{constructor(){super(!0),this.registerIncoming("context-menu",e=>{e.data.native.preventDefault()})}};function QIe(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)}function jai(t,e){const i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)}function zai(t,e){if(e?(e.radius=0,e.center.x=0,e.center.y=0):e={radius:0,center:Vh()},t.length===0)return e;if(t.length===1)return e.center.x=t[0].x,e.center.y=t[0].y,e;if(t.length===2){const[G,V]=t,[Y,X]=[V.x-G.x,V.y-G.y];return e.radius=Math.sqrt(Y*Y+X*X)/2,e.center.x=(G.x+V.x)/2,e.center.y=(G.y+V.y)/2,e}let i=0,r=0;for(let G=0;GG.x-i),s=t.map(G=>G.y-r);let o=0,a=0,l=0,c=0,d=0,p=0,y=0;for(let G=0;Ge.doubleClickTimer=Bc(e.doubleClickTimer))}get hasPendingInputs(){return Wre(this._pointerState,e=>e.doubleClickTimer!=null)}_clearDoubleClickTimer(e,i){const r=this._pointerState.get(e);r&&(r.doubleClickTimer=Bc(r.doubleClickTimer),i&&this._click.emit(r.event.data,void 0,r.event.modifiers),this._pointerState.delete(e),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(e){const i=this._pointerState.get(e);i.pointerDownCount===1&&this._click.emit(i.event.data,void 0,i.event.modifiers),i.doubleClickTimer=null,this._pointerState.delete(e),this.refreshHasPendingInputs()}_getPointerId(e){const{pointerId:i,pointerType:r,button:n}=e.native;return r==="mouse"?`${i}:${n}`:`${r}`}_handleImmediateClick(e){const i=e.data,{pointerType:r}=i.native,n=this._getPointerId(i);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;QIe(o,i)>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 i=Sk(e.data),r=this._pointerState.get(i);r&&(r.pointerDownCount+=1)}_startClick(e){const{data:i}=e,{native:{pointerType:r}}=i,n=Sk(i),s=r==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._doubleClickTimeoutExceeded(n),s),a=1;this._pointerState.set(n,{event:e,doubleClickTimer:o,pointerDownCount:a}),this.refreshHasPendingInputs()}},Wai=class extends Dm{constructor(e=xw.maximumDoubleClickDelay,i=xw.maximumDoubleClickDistance,r=xw.maximumDoubleTouchDelay,n=xw.maximumDoubleTouchDistance,s=IH){super(!1),this._maximumDoubleClickDelay=e,this._maximumDoubleClickDistance=i,this._maximumDoubleTouchDelay=r,this._maximumDoubleTouchDistance=n,this._clock=s,this._doubleTapDragReady=!1,this._doubleTapDragActive=!1,this._dragStartCenter=Vh(0,0),this._pointerState=new Map,this._doubleTapDrag=this.registerOutgoing("double-tap-drag"),this._dragEventSeparator=new Yle({start:(o,a)=>this._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=Bc(e.doubleTapTimeout)})}get hasPendingInputs(){return Wre(this._pointerState,e=>e.doubleTapTimeout!=null)}_clearPointerDown(e){const i=this._pointerState.get(e);i&&(i.doubleTapTimeout=Bc(i.doubleTapTimeout),this._pointerState.delete(e),this.refreshHasPendingInputs())}_createDoubleTapDragData(e,i,r){const{button:n,buttons:s,pointer:o,pointers:a,pointerType:l,timestamp:c}=r;return{action:e,delta:i,button:n,buttons:s,pointer:o,pointers:a,pointerType:l,timestamp:c}}_dragStart(e,i){if(!this._doubleTapDragReady||e!==1)return;this._doubleTapDragReady=!1,this._doubleTapDragActive=!0;const{data:r,modifiers:n}=i,{center:s}=r;this._dragStartCenter=s;const o=this._createDoubleTapDragData("begin",Vh(0,0),r);this._doubleTapDrag.emit(o,void 0,n),i.stopPropagation()}_dragUpdate(e){if(!this._doubleTapDragActive)return;const{data:i,modifiers:r}=e,{center:n}=i,s=Vh(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),o=this._createDoubleTapDragData("update",s,i);this._doubleTapDrag.emit(o,void 0,r),e.stopPropagation()}_dragEnd(e){if(!this._doubleTapDragActive)return;const{data:i,modifiers:r}=e,{center:n}=i,s=Vh(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),o=this._createDoubleTapDragData("end",s,i);this._doubleTapDrag.emit(o,void 0,r),this._doubleTapDragActive=!1,e.stopPropagation()}_handlePointerDown(e){const{data:i}=e,r=Sk(i),n=this._pointerState.get(r),{pointerType:s}=i.native;if(n){const o=s==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;this._clearPointerDown(r),QIe(n.event.data,i)>o?this._storePointerDown(e):this._doubleTapDragReady=!0}else this._storePointerDown(e)}_handlePointerUp(){this._doubleTapDragReady=!1}_storePointerDown(e){const{data:i}=e,{pointerType:r}=i.native,n=Sk(i),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()}},qai=class extends Dm{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,i,r,n){return{action:e,pointerType:this._pointerType,button:this._mouseButton,buttons:i.buttons,timestamp:n,pointers:Yai(this._activePointerMap),pointer:i,angle:r.angle,radius:r.radius,center:r.center}}_addPointer(e){const i=e.native.pointerId,r=Xle(this._activePointerMap).angle,n={event:e,initialAngle:0,lastAngle:0};this._activePointerMap.set(i,n);const s=Kle(n,yrt(this._activePointerMap));n.initialAngle=s,n.lastAngle=s,this._updatePointerAngles(r)}_updatePointer(e){if(e&&e.x==null&&e.y==null)return;const i=e.native.pointerId,r=this._activePointerMap.get(i);r?r.event=e:this._addPointer(e)}_removePointer(e){const i=Xle(this._activePointerMap).angle;this._activePointerMap.delete(e),this._updatePointerAngles(i)}_updatePointerAngles(e){const i=Xle(this._activePointerMap);this._activePointerMap.forEach(r=>{r.initialAngle=Kle(r,i)-e,r.lastAngle=Kle(r,i)-e})}_emitEvent(e,i,r){const n=Xle(this._activePointerMap);this._drag.emit(this._createPayload(e,i,n,r),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(e){const i=e.data.native.pointerId,r=e.timestamp;this._activePointerMap.get(i)&&(this._activePointerMap.size===1?(this._updatePointer(e.data),!this._isCurrentDragSuppressed&&this._emitEvent("end",e.data,r),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(i)):(this._removePointer(i),this._emitEvent("removed",e.data,e.timestamp)))}_handlePointerDrag(e){const i=e.data,r=i.currentEvent,n=e.timestamp;switch(i.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 yrt(t){const e=[];return t.forEach(i=>{e.push(Vh(i.event.x,i.event.y))}),zai(e)}function Xle(t){const e=yrt(t);let i=0;return t.forEach(r=>{let n=Kle(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;i+=o}),i/=t.size||1,{angle:i,radius:e.radius,center:e.center}}function Yai(t){const e=new Map;return t.forEach((i,r)=>e.set(r,i.event)),e}function Kle(t,e){const i=t.event,r=i.x-e.center.x,n=i.y-e.center.y;return Math.atan2(n,r)}var vrt;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right",t[t.Back=3]="Back",t[t.Forward=4]="Forward",t[t.Undefined=-1]="Undefined"})(vrt||(vrt={}));let Xai=class extends Dm{constructor(e=xw.maximumDoubleClickDelay,i=xw.maximumDoubleClickDistance,r=xw.maximumDoubleTouchDelay,n=xw.maximumDoubleTouchDistance,s=IH){super(!1),this._maximumDoubleClickDelay=e,this._maximumDoubleClickDistance=i,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 i=e.data,r=Sk(i);if(!this._pointerState.has(r)){const n={downButton:i.native.button,immediateDoubleClick:null};this._pointerState.set(r,n),this.startCapturingPointer(i.native)}}_handlePointerUp(e){const i=e.data,r=Sk(i),n=this._pointerState.get(r);if(n&&n.downButton===i.native.button){const s=n.immediateDoubleClick;if(s){s.timeoutHandle.remove();const o=e.data.native.pointerType==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;QIe(s,e.data)>o?this._startImmediateDoubleClick(e,n):(this._immediateDoubleClick.emit(e.data,void 0,s.modifiers),this._removeState(i))}else this._startImmediateDoubleClick(e,n)}}_startImmediateDoubleClick(e,i){const r=e.data.native.pointerType==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;i.immediateDoubleClick={x:e.data.x,y:e.data.y,modifiers:e.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(e.data),r)}}_removeState(e){const i=Sk(e);this._pointerState.delete(i),this.stopCapturingPointer(e.native),this.refreshHasPendingInputs()}};const cX={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500};let Kai=class extends Dm{constructor(e=cX.maximumClickDelay,i=cX.movementUntilMouseDrag,r=cX.movementUntilPenDrag,n=cX.movementUntilTouchDrag,s=cX.holdDelay,o=IH){super(!1),this._maximumClickDelay=e,this._movementUntilMouseDrag=i,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=Bc(e.holdTimeout)}),super.onUninstall()}_handlePointerDown(e){const i=e.data,r=i.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:i,previousEvent:i,startTimestamp:e.timestamp,isDragging:!1,downButton:i.native.button,holdTimeout:n,modifiers:new Set};this._pointerState.set(r,s),this.startCapturingPointer(i.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(e)}_createPointerDragData(e,i,r){return{action:e,startEvent:i.startEvent,previousEvent:i.previousEvent,currentEvent:r}}_handlePointerMove(e){const i=e.data,r=i.native.pointerId,n=this._pointerState.get(r);n&&(n.isDragging?this._pointerDrag.emit(this._createPointerDragData("update",n,i),void 0,n.modifiers):jai(i,n.startEvent)>this._getDragThreshold(i.native.pointerType)&&this._startDragging(e),n.previousEvent=i)}_getDragThreshold(e){switch(e){case"touch":return this._movementUntilTouchDrag;case"pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(e){const i=e.data,r=i.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,i)):this._pointerDrag.emit(this._createPointerDragData("start",n,n.previousEvent),e.timestamp))})}_handlePointerLoss(e,i){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,i==="pointer-up"?r:s.previousEvent),void 0,s.modifiers):i==="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())}};const Jle={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 Ck=class extends fn{constructor(){super(...arguments),this._handles=new uf}initialize(){const e=()=>this.view?.ready;this._handles.add([Hg(()=>!e(),()=>this._disconnect()),Hg(e,()=>this._connect())])}destroy(){this._handles=ra(this._handles),this._disconnect()}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}_disconnect(){this.view.viewEvents.disconnect(),this._inputManager=ra(this._inputManager)}_connect(){const e=this.view.surface,i=new grt(e,this.view.input),r=[new Xai,new Kai,new Hai,new qai(this.view.navigation),new Wai],n=new vT({eventSource:i,recognizers:r});n.installHandlers("prevent-context-menu",[new Uai],_T.INTERNAL),n.installHandlers("navigation",[new Fai(this.view),new Tai(this.view),new Dai(this.view),new drt(this.view),new drt(this.view,[Jle.counter]),new bai(this.view,"primary"),new Pai(this.view,Jle.pan),new Rai(this.view,Jle.zoom),new Oai(this.view,Jle.rotate),new wai(this.view,"secondary"),new _ai(this.view,"touch")],_T.INTERNAL),this.view.viewEvents.connect(n),this._source=i,this._inputManager=n,Qi(()=>this.view?.navigation?.browserTouchPanEnabled,s=>{this._source&&(this._source.browserTouchPanningEnabled=!s)},Fo)}get test(){return{inputManager:this._inputManager}}};E([k()],Ck.prototype,"view",void 0),E([k()],Ck.prototype,"latestPointerType",null),E([k()],Ck.prototype,"latestPointerLocation",null),E([k()],Ck.prototype,"multiTouchActive",null),Ck=E([ht("esri.views.2d.input.MapViewInputManager")],Ck);const Jai=Ck;var _rt,brt,wrt,eAe={},Zai={get exports(){return eAe},set exports(t){eAe=t}};_rt=Zai,brt=function(){function t(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 c=a-o+1,d=s-o+1,p=Math.log(c),y=.5*Math.exp(2*p/3),v=.5*Math.sqrt(p*y*(c-y)/c)*(d-c/2<0?-1:1);e(n,s,Math.max(o,Math.floor(s-d*y/c+v)),Math.min(a,Math.floor(s+(c-d)*y/c+v)),l)}var S=n[s],I=o,O=a;for(i(n,o,s),l(n[a],S)>0&&i(n,o,a);I0;)O--}l(n[o],S)===0?i(n,o,O):i(n,++O,a),O<=s&&(o=O+1),s<=O&&(a=O-1)}}function i(n,s,o){var a=n[s];n[s]=n[o],n[o]=a}function r(n,s){return ns?1:0}return t},(wrt=brt())!==void 0&&(_rt.exports=wrt);const xrt=eAe;function Tk(t,e){if(!(this instanceof Tk))return new Tk(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&(typeof e=="function"?this.toBBox=e:this._initFormat(e)),this.clear()}function Qai(t,e,i){if(!i)return e.indexOf(t);for(var r=0;r=t.minX&&e.maxY>=t.minY}function fG(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Trt(t,e,i,r,n){for(var s,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=r||(s=e+Math.ceil((i-e)/r/2)*r,xrt(t,s,e,i,n),o.push(e,s,s,i))}Tk.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],r=this.toBBox;if(!Qle(t,e))return i;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(t,e){var i=t[e],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);var s=this._chooseSplitIndex(i,n,r),o=fG(i.children.splice(s,i.children.length-s));o.height=i.height,o.leaf=i.leaf,pG(i,this.toBBox),pG(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=fG([t,e]),this.data.height=t.height+1,this.data.leaf=!1,pG(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var r,n,s,o,a,l,c,d;for(l=c=1/0,r=e;r<=i-e;r++)o=tli(n=hX(t,0,r,this.toBBox),s=hX(t,r,i,this.toBBox)),a=tAe(n)+tAe(s),o=e;n--)s=t.children[n],dX(l,t.leaf?o(s):s),c+=Zle(l);return c},_adjustParentBBoxes:function(t,e,i){for(var r=i;r>=0;r--)dX(e[r],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)t[i].children.length===0?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():pG(t[i],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};let Ert=class RLt{constructor(e,i){this.key=new xh(0,0,0,0),this.bounds=_o(),this.objectIds=new Set,this.key.set(i);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 id(){return this.key.id}get extent(){return vr.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createChildTiles(){const e=this.key.getChildKeys(),i=Bg.acquire();for(let r=0;r({minX:i.bounds[0],minY:i.bounds[1],maxX:i.bounds[2],maxY:i.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)}boundsIntersections(e){return this._index.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]})}updateTiles(e){const i={added:[],removed:[]};for(const r of e.added)if(!this.has(r)){const n=new Ert(this.tileScheme,r);this._tiles.set(r,n),this._index.insert(n),i.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),i.removed.push(n)}this.tiles.length=0,this._tiles.forEach(r=>this.tiles.push(r)),(i.added.length||i.removed.length)&&this.emit("update",i)}setViewState(e){const i=this.tileScheme.getTileCoverage(e,0);if(!i)return;const{spans:r,lodInfo:n}=i,{level:s}=n;if(r.length>0)for(const{row:o,colFrom:a,colTo:l}of r)for(let c=a;c<=l;c++){const d=ili.set(s,o,n.normalizeCol(c),n.getWorldForColumn(c)).id;if(rAe.add(d),!this.has(d)){const p=new Ert(this.tileScheme,d);this._tiles.set(d,p),this._index.insert(p),this.tiles.push(p),Ek.added.push(p)}}for(let o=this.tiles.length-1;o>=0;o--){const a=this.tiles[o];rAe.has(a.id)||(this._tiles.delete(a.id),this.tiles.splice(o,1),this._index.remove(a),Ek.removed.push(a))}(Ek.added.length||Ek.removed.length)&&this.emit("update",Ek),lP.pool.release(i),rAe.clear(),Ek.added.length=0,Ek.removed.length=0}},Ik=class extends fn{constructor(){super(...arguments),this.color=new $r([0,255,255]),this.haloOpacity=1,this.fillOpacity=.25}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}};E([k({type:$r})],Ik.prototype,"color",void 0),E([k({type:$r})],Ik.prototype,"haloColor",void 0),E([k()],Ik.prototype,"haloOpacity",void 0),E([k()],Ik.prototype,"fillOpacity",void 0),Ik=E([ht("esri.views.2d.support.HighlightOptions")],Ik);const nAe=Ik,rli=t=>t.includes("Brush");let sAe=class{constructor(){this._names=new Map}begin(e){this._names.has(e)||(this._names.set(e,!1),rli(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 nli(t,e,i,r,n,s,o,a){t.ignorePadding&&(r={left:0,right:0,top:0,bottom:0});let l=null;t.width!=null&&t.height!=null?l=[t.width,t.height]:t.width==null&&t.height!=null?l=[t.height,t.height]:t.width!=null&&t.height==null?l=[t.width,t.width]:t.width==null&&t.height==null&&(l=null);const c=i[0]-(r.left+r.right),d=i[1]-(r.top+r.bottom);let p,y,v=t.area||{x:0,y:0,width:c,height:d};if(l){const S=c/d,I=l[0]/l[1];if(I>S){const O=v.width/I;v={x:v.x,y:Math.round(v.y+(v.height-O)/2),width:v.width,height:Math.round(O)}}else{const O=v.height*I;v={x:Math.round(v.x+(v.width-O)/2),y:v.y,width:Math.round(O),height:v.height}}}else l=[v.width,v.height];return l[0]>v.width?(p=Math.min(l[0]/v.width,e),y=l[0]/v.width/p):(p=1,y=l[0]/v.width),{resolutionScale:p,cropArea:{x:Math.round((v.x+r.left)*p),y:Math.round((v.y+r.top)*p),width:Math.round(v.width*p),height:Math.round(v.height*p)},outputScale:y,format:n,quality:s,children:o,rotation:a}}let pX=null,eue=!0;function sli(t,e,i){if(!t||!e)throw new Error("Cannot construct image data without dimensions");if(eue)try{return new ImageData(t,e)}catch{eue=!1}return Art(t,e,i)}function oli(t,e,i,r){if(!e||!i)throw new Error("Cannot construct image data without dimensions");if(eue)try{return new ImageData(t,e,i)}catch{eue=!1}const n=Art(e,i,r);return n.data.set(t,0),n}function ali(){return pX||(pX=document.createElement("canvas"),pX.width=1,pX.height=1),pX}function Art(t,e,i){return i||(i=ali()),i.getContext("2d").createImageData(t,e)}function lli(t,e,i){const{ctx:r,canvas:n}=Prt(t,i),s=r.getImageData(0,0,t.width,t.height),o=hli(n,e);return Ort(n),{dataUrl:o,data:s}}function uli(t,e){const{ctx:i,canvas:r}=Prt(t,e),n=i.getImageData(0,0,t.width,t.height);return Ort(r),n}function Prt(t,e){const i=cli();e.premultipliedAlpha&&yli(t),i.width=t.width,i.height=t.height;const r=i.getContext("2d",{willReadFrequently:!0});return r.putImageData(t,0,0),e.flipY&&gli(r),{ctx:r,canvas:i}}function Ort(t){t.width=0,t.height=0}function cli(){return lt(oAe)&&(oAe=document.createElement("canvas")),oAe}let oAe=null;function hli(t,e){const i=vli[e.format],r=e.quality/100;return t.toDataURL(i,r)}function dli(t,e){const i=mli(t),r=bli[i];return{format:i,quality:Hl(e??r,0,100)}}function pli(t,e){return e/Math.max(t[0],t[1])}function fli(t,e,i,r=0,n=0,s=t.width-r,o=t.height-n,a=!1){const{data:l}=t,{width:c,height:d,data:p}=e,y=s/c,v=o/d,S=Math.ceil(y/2),I=Math.ceil(v/2),O=t.width;for(let L=0;L=1)continue;let Pe=2*xe*xe*xe-3*xe*xe+1;const Oe=4*(r+J+(n+_e)*O);fe+=Pe*l[Oe+3],Y+=Pe,!i&&l[Oe+3]<255&&(Pe=Pe*l[Oe+3]/255),X+=Pe*l[Oe],te+=Pe*l[Oe+1],re+=Pe*l[Oe+2],V+=Pe}}p[G]=X/V,p[G+1]=te/V,p[G+2]=re/V,p[G+3]=fe/Y}return e}function mli(t){switch(t){case"png":case"jpg":case"jpeg":return t;default:return _li}}function gli(t){t.save(),t.globalCompositeOperation="copy",t.scale(1,-1),t.translate(0,-t.canvas.height),t.drawImage(t.canvas,0,0),t.restore()}function yli(t){const e=t.data,i=e.length;for(let r=0;r0){const s=255/n;e[r+0]=e[r+0]*s,e[r+1]=e[r+1]*s,e[r+2]=e[r+2]*s}}}const vli={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},Rrt=98,_li="png",bli={png:100,jpg:Rrt,jpeg:Rrt};var lo;function Mrt(t,e,i={}){const r=Drt(t);for(;r.length>1;){const n=tue(e,r.shift(),i);if(ye(n))return n}return wli(e,r.shift(),i)}function Drt(t){const e=Gi("esri-force-webgl");if(e===lo.WEBGL1||e===lo.WEBGL2)return[e];switch(t){case"2d":return Gi("mac")&&Gi("chrome")?[lo.WEBGL1,lo.WEBGL2]:[lo.WEBGL2,lo.WEBGL1];case"3d":return[lo.WEBGL2,lo.WEBGL1]}}function wli(t,e,i={}){if(!window.WebGLRenderingContext)return Frt(t,xli),null;const r=tue(t,e,i);return lt(r)&&Frt(t,Sli),r}function tue(t,e,i={}){const r=e===lo.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let n=null;for(const s of r){try{n=t.getContext(s,i)}catch{}if(n)break}return n}function Frt(t,e){const i=t.parentNode;i&&(i.innerHTML='
'+e+"
")}(function(t){t[t.WEBGL1=1]="WEBGL1",t[t.WEBGL2=2]="WEBGL2"})(lo||(lo={}));const xli='This page requires a browser that supports WebGL.
Click here to upgrade your browser.',Sli=`It doesn't appear your computer can support WebGL.
Click here for more information.`;let aAe,lAe;function TT(t){const e=Drt(t);for(;e.length>1;){const i=Lrt(e.shift());if(i.available)return i}return Lrt(e.shift())}function Lrt(t){switch(t){case lo.WEBGL1:return Cli();case lo.WEBGL2:return Tli()}}function Cli(){return aAe||(aAe=Ali()),aAe}function Tli(){return lAe||(lAe=Pli()),lAe}let krt=class{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsElementIndexUint=!1,this.supportsStandardDerivatives=!1,this.supportsInstancedArrays=!1,this.supportsTextureFloat=!1,this.supportsTextureHalfFloat=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1}},Eli=class extends krt{constructor(){super(...arguments),this.type=lo.WEBGL1}},Ili=class extends krt{constructor(){super(...arguments),this.type=lo.WEBGL2,this.supportsElementIndexUint=!0,this.supportsStandardDerivatives=!0,this.supportsInstancedArrays=!0,this.supportsTextureFloat=!0,this.supportsTextureHalfFloat=!0}};function Nrt(t,e){if(t===lo.WEBGL1&&typeof WebGLRenderingContext>"u"||t===lo.WEBGL2&&typeof WebGL2RenderingContext>"u")return null;const i=document.createElement("canvas");if(!i)return null;let r=tue(i,t,{failIfMajorPerformanceCaveat:!0});if(lt(r)&&(r=tue(i,t),ye(r)&&(e.majorPerformanceCaveat=!0)),lt(r))return r;if(t===lo.WEBGL1){const s=r.getParameter(r.VERSION)?.match(/^WebGL\s+([\d.]*)/);if(s){const o=parseFloat(s[1]);e.available=o>=.94}}else e.available=!0;e.maxTextureSize=r.getParameter(r.MAX_TEXTURE_SIZE),e.supportsVertexShaderSamplers=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const n=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);return n&&(e.supportsHighPrecisionFragment=n.precision>0),r}function Ali(){const t=new Eli,e=Nrt(lo.WEBGL1,t);return lt(e)||(t.supportsElementIndexUint=e.getExtension("OES_element_index_uint")!==null,t.supportsStandardDerivatives=e.getExtension("OES_standard_derivatives")!==null,t.supportsInstancedArrays=e.getExtension("ANGLE_instanced_arrays")!==null,t.supportsTextureFloat=e.getExtension("OES_texture_float")!==null,t.supportsTextureHalfFloat=e.getExtension("OES_texture_half_float")!==null,t.supportsColorBufferFloat=e.getExtension("WEBGL_color_buffer_float")!==null,t.supportsColorBufferFloatBlend=e.getExtension("EXT_float_blend")!==null,t.supportsColorBufferHalfFloat=e.getExtension("EXT_color_buffer_half_float")!==null),t}function Pli(){const t=new Ili,e=Nrt(lo.WEBGL2,t);return lt(e)||(t.supportsColorBufferFloat=e.getExtension("EXT_color_buffer_float")!==null,t.supportsColorBufferFloatBlend=e.getExtension("EXT_float_blend")!==null,t.supportsColorBufferHalfFloat=t.supportsColorBufferFloat||e.getExtension("EXT_color_buffer_half_float")!==null),t}function Oli(t){const e=TT(t);if(!e.available)return new st("webgl:required","WebGL is required but not supported.");if(t==="3d"&&e.majorPerformanceCaveat)return new st("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.");if(!e.supportsHighPrecisionFragment)return new st("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported.");if(!e.supportsVertexShaderSamplers)return new st("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported.");if(e.type===lo.WEBGL1){if(!e.supportsElementIndexUint)return new st("webgl:element-index-uint-required","WebGL support for uint vertex indices is required but not supported.");if(!e.supportsStandardDerivatives)return new st("webgl:standard-derivatives-required","WebGL support for standard derivatives is required but not supported.");if(!e.supportsInstancedArrays)return new st("webgl:instanced-arrays-required","WebGL support for instanced rendering is required but not supported.")}return null}function Rli(t){return t&&"nodeType"in t}function Mli(t){return t&&typeof t.render=="function"}const $rt={component:"esri-component"};let Ak=class extends fn{constructor(){super(...arguments),this.widget=null}destroy(){this.widget&&this.widget.destroy(),this.node=null}get id(){return this.get("widget.id")||this.get("node.id")}set node(e){const i=this._get("node");e!==i&&(e&&e.classList.add($rt.component),i&&i.classList.remove($rt.component),this._set("node",e))}castNode(e){return e?typeof e=="string"||Rli(e)?(this._set("widget",null),pEe(e)):(Mli(e)&&!e.domNode&&(e.domNode=document.createElement("div")),this._set("widget",e),e.domNode):(this._set("widget",null),null)}};E([k({dependsOn:[]})],Ak.prototype,"id",null),E([k()],Ak.prototype,"node",null),E([Zs("node")],Ak.prototype,"castNode",null),E([k({readOnly:!0})],Ak.prototype,"widget",void 0),Ak=E([ht("esri.views.ui.Component")],Ak);const iue=Ak,Dli={left:0,top:0,bottom:0,right:0},Brt={bottom:30,top:15,right:15,left:15},uAe="manual",cP="esri-ui",av={ui:cP,corner:`${cP}-corner`,innerContainer:`${cP}-inner-container`,manualContainer:`${cP}-manual-container`,cornerContainer:`${cP}-corner-container`,topLeft:`${cP}-top-left`,topRight:`${cP}-top-right`,bottomLeft:`${cP}-bottom-left`,bottomRight:`${cP}-bottom-right`};function Fli(t){return t&&!t._started&&typeof t.postMixInProperties=="function"&&typeof t.buildRendering=="function"&&typeof t.postCreate=="function"&&typeof t.startup=="function"}function cAe(t){const e=t,i=typeof e=="object"&&e!==null&&Object.getPrototypeOf(e);return(i===null||i===Object.prototype)&&("component"in e||"index"in e||"position"in e)?t:null}function hAe(t,{top:e,bottom:i,left:r,right:n}){t.style.top=e,t.style.bottom=i,t.style.left=r,t.style.right=n}let ET=class extends cd.EventedAccessor{constructor(e){super(e),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentToKey=new Map,this._locale=Y0(),this.view=null,this._applyViewPadding=()=>{const i=this.container;i&&hAe(i,this._toPxPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const i=this._innerContainer;i&&hAe(i,this._toPxPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([Qi(()=>[this.view?.padding,this.container],this._applyViewPadding,Fo),Qi(()=>this.padding,this._applyUIPadding,Fo),Qi(()=>[this.container,this._locale],([e,i])=>{e&&e.setAttribute("lang",i)},Fo),EUe(e=>{this._locale=e})])}destroy(){this.container=null;for(const e of this._components)e.destroy();this._components.length=0,this._componentToKey.clear()}set container(e){const i=this._get("container");e!==i&&(e&&(e.classList.add(av.ui),Ari(e),this._attachContainers(e)),i&&(i.classList.remove(av.ui),hAe(i,{top:"",bottom:"",left:"",right:""}),KZe(i)),this._set("container",e))}get height(){const e=this.get("view.height")||0;if(e===0)return e;const i=this._getViewPadding(),r=i.top+i.bottom;return Math.max(e-r,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}:{...Brt,...e}}get width(){const e=this.get("view.width")||0;if(e===0)return e;const i=this._getViewPadding(),r=i.left+i.right;return Math.max(e-r,0)}add(e,i){let r,n;if(Array.isArray(e))return void e.forEach(o=>this.add(o,i));const s=cAe(e);s&&({index:r,position:i,component:e,key:n}=s),i&&typeof i=="object"&&({index:r,key:n,position:i}=i),!e||i&&!this._isValidPosition(i)||this._add(e,i,r,n)}remove(e,i){if(!e)return;if(Array.isArray(e))return e.map(n=>this.remove(n,i));const r=this._find(e);if(r){const n=this._componentToKey;if(n.has(e)&&n.get(e)!==i)return;const s=this._components.indexOf(r);return r.node.parentNode&&r.node.parentNode.removeChild(r.node),this._componentToKey.delete(e),this._components.splice(s,1)[0]}}empty(e){return Array.isArray(e)?e.map(i=>this.empty(i)).reduce((i,r)=>i.concat(r)):(e=e||uAe)===uAe?Array.prototype.slice.call(this._manualContainer.children).filter(i=>!i.classList.contains(av.corner)).map(i=>this.remove(i)):this._isValidPosition(e)?Array.prototype.slice.call(this._cornerNameToContainerLookup[e].children).map(this.remove,this):null}move(e,i){if(Array.isArray(e)&&e.forEach(o=>this.move(o,i)),!e)return;let r;const n=cAe(e)||cAe(i);if(n&&(r=n.index,i=n.position,e=n.component||e),i&&!this._isValidPosition(i))return;const s=this.remove(e);s&&this.add(s,{position:i,index:r})}find(e){if(!e)return null;const i=this._findById(e);return i&&(i.widget||i.node)}getPosition(e){for(const i in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[i].contains(e))return i;return null}_add(e,i,r,n){e instanceof iue||(e=new iue({node:e})),this._place({component:e,position:i,index:r}),this._components.push(e),n&&this._componentToKey.set(e,n)}_find(e){return e?e instanceof iue?this._findByComponent(e):typeof e=="string"?this._findById(e):this._findByNode(e.domNode||e):null}_getViewPadding(){return this.get("view.padding")||Dli}_attachContainers(e){e.appendChild(this._innerContainer),e.appendChild(this._manualContainer)}_initContainers(){const e=document.createElement("div");e.classList.add(av.innerContainer),e.classList.add(av.cornerContainer);const i=document.createElement("div");i.classList.add(av.innerContainer),i.classList.add(av.manualContainer);const r=document.createElement("div");r.classList.add(av.topLeft),r.classList.add(av.corner),e.appendChild(r);const n=document.createElement("div");n.classList.add(av.topRight),n.classList.add(av.corner),e.appendChild(n);const s=document.createElement("div");s.classList.add(av.bottomLeft),s.classList.add(av.corner),e.appendChild(s);const o=document.createElement("div");o.classList.add(av.bottomRight),o.classList.add(av.corner),e.appendChild(o),this._innerContainer=e,this._manualContainer=i;const a=mT();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:i,...this._cornerNameToContainerLookup}}_isValidPosition(e){return!!this._positionNameToContainerLookup[e]}_place(e){const i=e.component,r=e.position||uAe,n=e.index,s=this._positionNameToContainerLookup[r],o=n!=null&&n>-1;if(Fli(i.widget)&&i.widget.startup(),!o)return void s.appendChild(i.node);const a=Array.prototype.slice.call(s.children);if(n===0)return void(s.firstChild?JZe(i.node,s.firstChild):s.appendChild(i.node));n>=a.length?s.appendChild(i.node):JZe(i.node,a[n])}_toPxPosition(e){return{top:this._toPxUnit(e.top),left:this._toPxUnit(e.left),right:this._toPxUnit(e.right),bottom:this._toPxUnit(e.bottom)}}_toPxUnit(e){return e===0?"0":e+"px"}_findByComponent(e){let i,r=null;return this._components.some(n=>(i=n===e,i&&(r=n),i)),r}_findById(e){let i,r=null;return this._components.some(n=>(i=n.id===e,i&&(r=n),i)),r}_findByNode(e){let i,r=null;return this._components.some(n=>(i=n.node===e,i&&(r=n),i)),r}};E([k()],ET.prototype,"_locale",void 0),E([k()],ET.prototype,"container",null),E([k()],ET.prototype,"height",null),E([k({value:Brt})],ET.prototype,"padding",null),E([Zs("padding")],ET.prototype,"castPadding",null),E([k()],ET.prototype,"view",void 0),E([k()],ET.prototype,"width",null),ET=E([ht("esri.views.ui.UI")],ET);const Lli=ET;function Grt(t,e){return t&&"copyright"in t&&(!e||typeof t.originOf=="function"&&t.originOf("copyright")==="user")}function kli(t,e){return t.length!==e.length||t.some((i,r)=>i.text!==e[r].text)}function rue(t,e,i){!i||!e||t.find(r=>r.layerView===e&&r.text===i)||t.push({text:i,layerView:e})}function Nli(t){return t.type==="bing-maps"}const PM=[];let mG=class extends KC{constructor(e){super(e),this._clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.handles.remove("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new fr,this.view=null,this._allLayerViewsChange=i=>{this.handles.remove("suspension");const r=this.get("view.allLayerViews");r&&this.handles.add(r.map(n=>Qi(()=>[n.suspended,n.layer?.attributionVisible],()=>this._updateAttributionItems())),"suspension"),i&&i.removed&&i.removed.forEach(n=>{this._pendingAttributions.delete(n),this._fetchedAttributionData.delete(n)}),this._updateAttributionItems()},this.handles.add([ku(()=>this.view?.allLayerViews,"change",i=>this._allLayerViewsChange(i),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),Hg(()=>this.view?.stationary===!0,()=>this._updateAttributionItems())])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){return this.get("view.ready")?this._pendingAttributions.size>0?"loading":"ready":"disabled"}_updateAttributionItems(){const e=this.view,i=e?.allLayerViews;PM.length=0,e&&i?(i.forEach(r=>{if(r.suspended||!r.layer?.attributionVisible)return;const n=r.layer;if(Grt(n,"user"))return void rue(PM,r,n.copyright);if(n.hasAttributionData){if(this._fetchedAttributionData.has(r)){const o=this._fetchedAttributionData.get(r);return void(o?rue(PM,r,this._getDynamicAttribution(o,e,n)):Grt(n)&&rue(PM,r,n.copyright))}return void this._fetchAttributionData(r)}const s=n.get("portalItem.accessInformation");rue(PM,r,s||n.copyright)}),kli(this.items,PM)&&(this.items.removeAll(),this.items.addMany(PM)),PM.length=0,this.notifyChange("state")):this._clear()}async _fetchAttributionData(e){if(this._pendingAttributions.has(e))return;this._pendingAttributions.add(e);const i=await TC(e.layer.fetchAttributionData());if(this._pendingAttributions.has(e)){const r=i.ok?this._createContributionIndex(i.value,Nli(e.layer)):null;this._pendingAttributions.delete(e),this._fetchedAttributionData.set(e,r)}this._updateAttributionItems()}_createContributionIndex(e,i){const r=e.contributors,n={};if(!r)return n;for(let s=0;s{const p=d.id,y=!c[p]&&l&&d.extent&&WH(d.extent,l);return y&&(c[p]=!0),y}).sort((d,p)=>p.score-d.score||d.objectId-p.objectId).map(d=>d.attribution).join(", "):""}};E([k({readOnly:!0,type:fr})],mG.prototype,"items",void 0),E([k({readOnly:!0})],mG.prototype,"state",null),E([k()],mG.prototype,"view",void 0),mG=E([ht("esri.widgets.Attribution.AttributionViewModel")],mG);const Vrt=mG,gG="esri-attribution",OM={base:`${gG} esri-widget`,poweredBy:`${gG}__powered-by`,sources:`${gG}__sources`,open:`${gG}--open`,sourcesOpen:`${gG}__sources--open`,link:`${gG}__link`,widgetIcon:"esri-icon-description",interactive:"esri-interactive"};let lv=class extends Gf{constructor(e,i){super(e,i),this._isOpen=!1,this._attributionTextOverflowed=!1,this._prevSourceNodeHeight=0,this._resizeObserver=new ResizeObserver(r=>r.forEach(({target:n})=>this._checkSourceTextOverflow(n))),this.iconClass=OM.widgetIcon,this.itemDelimiter=" | ",this.messages=null,this.viewModel=new Vrt}initialize(){this.addHandles(ku(()=>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,i)=>(e.includes(i.text)||e.push(i.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={[OM.open]:this._isOpen};return ki("div",{bind:this,class:this.classes(OM.base,e),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this.renderSourcesNode(),this.renderPoweredBy())}renderPoweredBy(){return ki("div",{class:OM.poweredBy},"Powered by"," ",ki("a",{class:OM.link,href:"http://www.esri.com/",target:"_blank",rel:"noreferrer"},"Esri"))}renderSourcesNode(){const e=this._isOpen,i=this._isInteractive,r=i?"0":"",{attributionText:n}=this,s={[OM.sourcesOpen]:e,[OM.interactive]:i};return ki("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(OM.sources,s),innerHTML:n,tabindex:r})}_afterSourcesNodeCreate(e){this._prevSourceNodeHeight=e.clientWidth,this._resizeObserver.observe(e)}_checkSourceTextOverflow(e){let i=!1;const{clientHeight:r,clientWidth:n,scrollWidth:s}=e,o=s>n,a=this._attributionTextOverflowed!==o;if(this._attributionTextOverflowed=o,a&&(i=!0),this._isOpen){const l=rthis.view,this._updateRotationWatcher,Fo))}destroy(){Bc(this._handles),this.view=null}get canShowNorth(){const e=this.get("view.spatialReference");return!(!e||!e.isWebMercator&&!e.isGeographic)}get state(){return this.get("view.ready")?this.canShowNorth?"compass":"rotation":"disabled"}reset(){if(!this.get("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 i=-e.heading;this.orientation={x:0,y:0,z:i}}_updateRotationWatcher(e){this._handles.removeAll(),e&&this._handles.add(e.type==="2d"?Qi(()=>e?.rotation,this._updateForRotation,Fo):Qi(()=>e?.camera,this._updateForCamera,Fo))}};E([k({readOnly:!0})],Pk.prototype,"canShowNorth",null),E([k()],Pk.prototype,"orientation",void 0),E([k({readOnly:!0})],Pk.prototype,"state",null),E([k()],Pk.prototype,"view",void 0),Pk=E([ht(Bli)],Pk);const Urt=Pk,RM={base:"esri-compass esri-widget--button esri-widget",text:"esri-icon-font-fallback-text",icon:"esri-compass__icon",rotationIcon:"esri-icon-dial",northIcon:"esri-icon-compass",widgetIcon:"esri-icon-locate-circled",interactive:"esri-interactive",disabled:"esri-disabled"};let IT=class extends Gf{constructor(e,i){super(e,i),this.iconClass=RM.widgetIcon,this.messages=null,this.viewModel=new Urt}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:i}=this.viewModel,r=i==="disabled",n=(i==="rotation"?"rotation":"compass")=="compass",s=r?-1:0,o={[RM.disabled]:r,[RM.interactive]:!r},a={[RM.northIcon]:n,[RM.rotationIcon]:!n},{messages:l}=this;return ki("div",{bind:this,class:this.classes(RM.base,o),onclick:this._reset,onkeydown:this._reset,role:"button",tabIndex:s,"aria-label":l.reset,title:l.reset},ki("span",{"aria-hidden":"true",class:this.classes(RM.icon,a),styles:this._toRotationTransform(e)}),ki("span",{class:RM.text},l.reset))}_reset(){this.viewModel.reset()}_toRotationTransform(e){return{transform:`rotateZ(${e.z}deg)`}}};E([k()],IT.prototype,"goToOverride",null),E([k()],IT.prototype,"iconClass",void 0),E([k()],IT.prototype,"label",null),E([k(),Vf("esri/widgets/Compass/t9n/Compass")],IT.prototype,"messages",void 0),E([k()],IT.prototype,"view",null),E([k({type:Urt})],IT.prototype,"viewModel",void 0),E([Y1()],IT.prototype,"_reset",null),IT=E([ht("esri.widgets.Compass")],IT);const Gli=IT,yG="esri-navigation-toggle",Sw={base:`${yG} esri-widget`,button:`${yG}__button esri-widget--button`,activeButton:`${yG}__button--active`,panButton:`${yG}__button--pan`,rotateButton:`${yG}__button--rotate`,isLayoutHorizontal:`${yG}--horizontal`,rotationIcon:"esri-icon-rotate",panIcon:"esri-icon-pan",widgetIcon:"esri-icon-pan2",disabled:"esri-disabled"};let vG=class extends fn{constructor(e){super(e),this.navigationMode="pan",this.view=null}initialize(){this.own(Hg(()=>this.view?.inputManager,()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){return this.get("view.ready")&&this.view?.type==="3d"?"ready":"disabled"}toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate",this._setNavigationMode())}_setNavigationMode(){this.get("view.inputManager").primaryDragAction=this.navigationMode==="pan"?"pan":"rotate"}};E([k({readOnly:!0})],vG.prototype,"state",null),E([k()],vG.prototype,"navigationMode",void 0),E([k()],vG.prototype,"view",void 0),vG=E([ht("esri.widgets.NavigationToggleViewModel")],vG);const jrt=vG;let AT=class extends Gf{constructor(e,i){super(e,i),this.iconClass=Sw.widgetIcon,this.messages=null,this.viewModel=new jrt}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}toggle(){return this.viewModel.toggle()}render(){const e=this.get("viewModel.state")==="disabled",i=this.get("viewModel.navigationMode")==="pan",r={[Sw.disabled]:e,[Sw.isLayoutHorizontal]:this.layout==="horizontal"},n={[Sw.activeButton]:i},s={[Sw.activeButton]:!i},o=e?-1:0,a=this.messages.toggle;return ki("div",{bind:this,class:this.classes(Sw.base,r),onclick:this._toggle,onkeydown:this._toggle,tabIndex:o,"aria-label":a,title:a},ki("div",{class:this.classes(Sw.button,Sw.panButton,n)},ki("span",{class:Sw.panIcon})),ki("div",{class:this.classes(Sw.button,Sw.rotateButton,s)},ki("span",{class:Sw.rotationIcon})))}_toggle(){this.toggle()}};E([k()],AT.prototype,"iconClass",void 0),E([k()],AT.prototype,"label",null),E([k({value:"vertical"})],AT.prototype,"layout",null),E([k(),Vf("esri/widgets/NavigationToggle/t9n/NavigationToggle")],AT.prototype,"messages",void 0),E([k()],AT.prototype,"view",null),E([k({type:jrt})],AT.prototype,"viewModel",void 0),E([Y1()],AT.prototype,"_toggle",null),AT=E([ht("esri.widgets.NavigationToggle")],AT);const Vli=AT,fX={button:"esri-widget--button esri-widget",disabled:"esri-disabled",interactive:"esri-interactive",iconText:"esri-icon-font-fallback-text",icon:"esri-icon"};let MM=class extends Gf{constructor(){super(...arguments),this.enabled=!0,this.iconClass="",this.title=""}render(){const e=this.enabled?0:-1,i={[fX.disabled]:!this.enabled,[fX.interactive]:this.enabled},r={[this.iconClass]:!!this.iconClass};return ki("div",{bind:this,class:this.classes(fX.button,i),onclick:this._triggerAction,onkeydown:this._triggerAction,role:"button",tabIndex:e,title:this.title},ki("span",{"aria-hidden":"true",role:"presentation",class:this.classes(fX.icon,r)}),ki("span",{class:fX.iconText},this.title))}_triggerAction(){this.action.call(this)}};E([k()],MM.prototype,"action",void 0),E([k()],MM.prototype,"enabled",void 0),E([k()],MM.prototype,"iconClass",void 0),E([k()],MM.prototype,"title",void 0),E([Y1()],MM.prototype,"_triggerAction",null),MM=E([ht("esri.widgets.IconButton")],MM);const zrt=MM;let _G=class extends fn{get canZoomIn(){if(!this.get("view.ready"))return!1;const e=this.get("view.animation.target.scale")||this.get("view.scale"),i=this.get("view.constraints.effectiveMaxScale");return i===0||e>i}get canZoomOut(){if(!this.get("view.ready"))return!1;const e=this.get("view.animation.target.scale")||this.get("view.scale"),i=this.get("view.constraints.effectiveMinScale");return i===0||ethis.components,this._componentsWatcher.bind(this),Fo),Qi(()=>this.view,this._updateViewAwareWidgets.bind(this),Fo)])}_add(e,i,r,n){let s=e;if(typeof e=="string"&&this._defaultPositionLookup[e]){if(this._find(e))return;s=this._createComponent(e)}super._add(s,i,r,n)}_removeComponents(e){e.forEach(i=>{const r=this._find(i);r&&(this.remove(r),r.destroy())})}_updateViewAwareWidgets(e){this.components.forEach(i=>{const r=this._find(i),n=r&&r.widget;Hli(n)&&(n.view=e)})}_componentsWatcher(e,i){this._removeComponents(i),this._addComponents(e),this._adjustPadding(e)}_adjustPadding(e){if(!e.includes("attribution")&&!this._isOverridden("padding")){const{top:i}=this.padding;this.padding=i}}_addComponents(e){this.constructed&&e.forEach(i=>this.add(this._createComponent(i),this._defaultPositionLookup[i]))}_createComponent(e){const i=this._createWidget(e);if(i)return new iue({id:e,node:i})}_createWidget(e){return e==="attribution"?this._createAttribution():e==="compass"?this._createCompass():e==="navigation-toggle"?this._createNavigationToggle():e==="zoom"?this._createZoom():void 0}_createAttribution(){return new $li({view:this.view})}_createCompass(){return new Gli({view:this.view})}_createNavigationToggle(){return new Vli({view:this.view})}_createZoom(){return new zli({view:this.view})}};E([k()],nue.prototype,"components",void 0),nue=E([ht("esri.views.ui.DefaultUI")],nue);const Wli=nue;let sue=class extends Wli{constructor(e){super(e),this.components=["attribution","zoom"]}};E([k()],sue.prototype,"components",void 0),sue=E([ht("esri.views.ui.2d.DefaultUI2D")],sue);const Wrt=sue;var dAe;let oue=dAe=class extends Ni{constructor(t){super(t),this.color=new $r([0,0,0,1])}clone(){return new dAe(hi({color:this.color}))}};E([k({type:$r,json:{write:!0}})],oue.prototype,"color",void 0),oue=dAe=E([ht("esri.webmap.background.ColorBackground")],oue);const qli=oue;let qrt,Yrt,Xrt,Krt,Jrt,Zrt;async function Yli(){const[,{GraphicsView2D:t,GraphicContainer:e,LabelManager:i,MapViewNavigation:r,MagnifierView2D:n,Stage:s}]=await Promise.all([Promise.resolve().then(()=>ATt),Promise.resolve().then(()=>OAt)]);Yrt=t,Xrt=e,Krt=i,Jrt=r,Zrt=n,qrt=s}const Qrt=160;function Xli(t){return t&&t.declaredClass==="esri.Viewpoint"}let ca=class extends YQt(bsi(wsi(Wsi))){constructor(e){super(e),this._magnifierView=null,this._stage=null,this._resolveWhenReady=[],this.rootLayerViews=new k2({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.graphicsView=null,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.rendering=!1,this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this._stationaryTimer=null,this._gotoTask=null,this.frameTask=new $oi(this),this._pePromise=null,this.floors=new fr,this.highlightOptions=new nAe,this.inputManager=new Jai({view:this}),this.map=null,this.resizeAlign="center",this.spatialReferenceLocked=!1,this.timeline=new sAe,this.type="2d",this.ui=new Wrt,this._pixelFormat={flipY:!0,premultipliedAlpha:!0},this.constraints=new Zit,this.padding={top:0,right:0,bottom:0,left:0},this.handles.add([Qi(()=>this.viewpoint,()=>{this._lastStationaryEventTimestamp=performance.now(),this._flipStationary(Qrt)},Nu),this.on("resize",i=>this._resizeHandler(i)),Qi(()=>this.animationManager?.animation,i=>{this.animation=i})]),KUt()}destroy(){this._set("preconditionsReady",!1),this._gotoTask=this.frameTask=null,this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new Irt(this.featuresTilingScheme)}get initialExtentRequired(){const{scale:e,constraints:i,center:r,viewpoint:n,extent:s}=this;let o=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&!s&&(i?.effectiveLODs||(o=-1),(!r||e===0&&o===-1)&&(!n||!ye(n.targetGeometry)||n.targetGeometry.type!=="extent"&&!n.scale))}get resourceManager(){return this._stage.resourceManager}get textureManager(){return this._stage.painter.textureManager}get _defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get _projectionEngineLoaded(){return!!lw()||(this._pePromise||(this._pePromise=P2().finally(()=>{this._pePromise=null})),!1)}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const i=this.spatialReference,r=e.targetGeometry;return!!i_(r.spatialReference,i)||this._projectionEngineLoaded}set animation(e){const i=this._get("animation");if(e===i)return;if(i&&i.stop(),!e||e.isFulfilled())return void this._set("animation",null);this._set("animation",e),this.frameTask.animationInProgress=!0;const r=()=>{e===this._get("animation")&&(this._set("animation",null),this.frameTask?.requestFrame()),this.frameTask&&(this.frameTask.animationInProgress=!1)};e.when(r,r)}get background(){return Kli(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){if(!this.ready)return this._get("center");const{center:e,spatialReference:i}=this.state.paddedViewState;return new Yi({x:e[0],y:e[1],spatialReference:i})}set center(e){if(e==null)return;if(!this.ready)return this._set("center",e),void this.notifyChange("initialExtentRequired");let i;try{i=this._project(e,this.spatialReference)}catch(n){return void Ei.getLogger(this.declaredClass).error(new st("mapview:invalid-center","could not project the value in the view's spatial reference",{input:e,error:n}))}const r=this.viewpoint;LIe(r,r,i),this.viewpoint=r}set constraints(e){const i=this._get("constraints");i&&(this.handles.remove("map-view-constraints"),i.destroy()),this._set("constraints",e),e&&(e.view=this,this.ready&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint)),this.handles.add(Qi(()=>e.version,()=>{this.ready&&this.state&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint))},Nu),"map-view-constraints"))}get extent(){return this.ready?this.state.paddedViewState.extent.clone():this._get("extent")}set extent(e){if(e==null)return;if(!e.width||!e.height)return void Ei.getLogger(this.declaredClass).error(new st("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",e),this._set("center",null),this._set("viewpoint",null),this._set("scale",0),this._set("zoom",-1),void this.notifyChange("initialExtentRequired");let i;try{i=this._project(e,this.spatialReference)}catch(n){return void Ei.getLogger(this.declaredClass).error(new st("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:n}))}const r=this.viewpoint;Coi(r,r,i,this.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.state?this.state.resolution:0}get rotation(){return this.ready?this.state.rotation:this._get("rotation")}set rotation(e){if(isNaN(e))return;if(!this.ready)return void this._set("rotation",e);const i=this.viewpoint;Foi(i,i,e),this.viewpoint=i}get scale(){return this.ready?this.state.scale:this._get("scale")}set scale(e){if(!e||isNaN(e))return;if(!this.ready){this._set("scale",e),this._set("zoom",-1);const r=this._get("extent");return r&&(this._set("extent",null),this._set("center",r.center)),void this.notifyChange("initialExtentRequired")}const i=this.viewpoint;zit(i,i,e),this.viewpoint=i}get stationary(){return!(this.animation||this.navigating||this.resizing||this._stationaryTimer)}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(i=>!i.destroyed&&!("layerViews"in i)&&i.updating===!0));if(Gi("esri-2d-log-updating")){const i=this.allLayerViews.reduce((r,n)=>({...r,[n.layer.id]:!n.destroyed&&!("layerViews"in n)&&n.updating}),{});console.log(`Updating MapView: ${e} + */function Ret(){const{classList:t}=document.body,e=window.matchMedia("(prefers-color-scheme: dark)").matches,i=()=>t.contains(pet)||t.contains(det)&&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=i();r(s),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",o=>n(o.matches?"dark":"light")),new MutationObserver(()=>n(i())).observe(document.body,{attributes:!0,attributeFilter:["class"]})}function qii(){typeof window<"u"&&typeof location<"u"&&typeof document<"u"&&window.location===location&&window.document===document&&(document.readyState==="interactive"?Ret():document.addEventListener("DOMContentLoaded",()=>Ret(),{once:!0}))}qii();let Met;function Yii(){$ti(Gy(Ql(Met)))}Met="components/assets";const Det=Symbol("widget"),Xii=Symbol("widget-test-data"),Kii=[],Jii={},ple=new WeakMap;function Fet(t,e){let i=e.children;if(i&&i.length)for(let n=0;nLet(t)))}function Qii(t,e,i,{widgetProperties:r}){const n=ple.get(t);n&&(n.set(r),n.afterUpdate?.(n,t))}function Let(t){const e=ple.get(t);e&&(e.afterRemoved?.(e,t),e.destroy(),ple.delete(t))}function BEe(t){return typeof t=="function"&&t[Det]}const Net=new Set;function eri(t){Net.add(t),t.finally(()=>Net.delete(t))}var ket;const tri="esri.widgets.Widget";let iri=0;const rri={widgetIcon:"esri-icon-checkbox-unchecked"};function $et(t,e){for(const i in e)t[i]!=null&&(typeof t[i]=="object"&&typeof e[i]=="object"?$et(t[i],e?.[i]):t[i]=e[i]);return t}const nri=kti({postProcessProjectionOptions(t){const e=t.eventHandlerInterceptor,i=/capture$/i;t.eventHandlerInterceptor=(r,n,s,o)=>{const a=e?.(r,n,s,o),l=i.test(r);if(!((r=r.replace(i,"")).toLowerCase()in s)||l){const c=r[2].toLowerCase()+r.slice(3),h=v=>a?.call(s,v);s.addEventListener(c,h,l);const p=()=>s.removeEventListener(c,h,l),y=o.afterRemoved;o.afterRemoved=v=>{y?.(v),p()}}return a}},handleInterceptedEvent(t,e,i,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))&&(wQe(),t.scheduleRender(),l[a].call(l.bind||i,r))}});let VEe=!1,$m=class extends Jx(md.EventedAccessor){constructor(e,i){super(e,i),this._attached=!1,this._internalHandles=new df,this._projector=nri,this._readyForTrueRender=!1,this.iconClass=rri.widgetIcon,this.key=this,this._loadLocale=q0(async()=>{if(this._messageBundleProps&&this._messageBundleProps.length){const o=await Ru(this._messageBundleProps.map(async({bundlePath:a,propertyName:l})=>{let c=await NGe(a);this.uiStrings&&Object.keys(this.uiStrings)&&(c=$et(gi(c),this.uiStrings)),this[l]=c}));for(const a of o)a.error&&Oi.getLogger(this.declaredClass).error("widget-intl:locale-error",this.declaredClass,a.error)}await this.loadLocale()}),Yii();const r="esri-widget-uid-"+GB(),n=this.render.bind(this);this._trackingTarget=new $re(()=>this.scheduleRender());const s=()=>{if(!this._readyForTrueRender||this.destroyed)return null;if(!this.visible)return{vnodeSelector:"div",properties:{key:r,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0};const o=n();let{properties:a}=o;a||(o.properties=a={});let{key:l,styles:c}=a;l||(a.key=r),c||(a.styles=c={}),c.display||(c.display="");let h=0;return o.children?.forEach(p=>{if(BEe(p.vnodeSelector))return;let{properties:y}=p;y||(p.properties=y={}),y.key||(y.key=`${this.id}--${h++}`)}),Fet(this,o)};this.render=()=>{if(VEe)return s();let o=cti(this)??null;if(o)return o;this._trackingTarget.clear(),VEe=!0;try{o=JI(this._trackingTarget,s)}catch(a){throw console.error(a),a}finally{VEe=!1}return o&&hti(this,o),o},this.addResolvingPromise(this._resourcesFetch=this.beforeFirstRender().then(()=>{this._readyForTrueRender=!0,this._postInitialize()})),eri(this._resourcesFetch)}normalizeCtorArgs(e,i){const r={...e};return i&&(r.container=i),r}postInitialize(){}beforeFirstRender(){return Promise.all([this.loadDependencies(),this._loadLocale()]).then(()=>{}).catch(_C)}async loadDependencies(){}async loadLocale(){}destroy(){this.destroyed||(da(this._trackingTarget),da(this.viewModel),this._detach(this.container),this._set("container",null),this._internalHandles.destroy(),this._emitter.clear(),this.render=()=>null,this._projector=null,_Ee(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return yEe(e)}get domNode(){return this.container}set domNode(e){this.container=e}get id(){return this._get("id")||this.get("container.id")||Date.now().toString(16)+"-widget-"+iri++}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[(ket=Det,Xii)](){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(_Ee(this),this._projector.scheduleRender())}classes(...e){return SQe.apply(this,e)}renderNow(){_Ee(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this._internalHandles.add(sr(()=>this.viewModel,(i,r)=>{r&&this._internalHandles.remove("delegated-events"),i&&Mre(i)&&this._internalHandles.add(this._delegatedEventNames.map(n=>ZI(i,n,s=>{this.emit(n,s)})),"delegated-events")},Yo)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(_C),this.scheduleRender()};this._internalHandles.add([OGe(e),sr(()=>this.uiStrings,e),Yg(()=>this.container,i=>{this.destroyed||this._attach(i)},{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)}};$m[ket]=!0,E([N()],$m.prototype,"_readyForTrueRender",void 0),E([N({value:null})],$m.prototype,"container",null),E([ho("container")],$m.prototype,"castContainer",null),E([N()],$m.prototype,"iconClass",void 0),E([N()],$m.prototype,"id",null),E([N()],$m.prototype,"label",null),E([N()],$m.prototype,"renderable",null),E([N()],$m.prototype,"uiStrings",void 0),E([N()],$m.prototype,"viewModel",void 0),E([N({value:!0})],$m.prototype,"visible",null),E([N()],$m.prototype,"key",void 0),E([N()],$m.prototype,"children",void 0),E([N()],$m.prototype,"afterCreate",void 0),E([N()],$m.prototype,"afterUpdate",void 0),E([N()],$m.prototype,"afterRemoved",void 0),$m=E([dt(tri)],$m);const Hf=$m,Bet=["B","kB","MB","GB","TB"];function sri(t,e){let i=e===0?0:Math.floor(Math.log(e)/Math.log(Q5.KILOBYTES));i=eu(i,0,Bet.length-1);const r=oA(e/Q5.KILOBYTES**i,{maximumFractionDigits:2});return Xx(t.units.bytes[Bet[i]],{fileSize:r})}const ori="esri.widgets.Feature.support.featureUtils",Vet=Oi.getLogger(ori),ari=/href=(""|'')/gi,lri=/(\{([^\{\r\n]+)\})/g,uri=/\'/g,jet=/^\s*expression\//i,cri=/(\n)/gi,hri=/[\u00A0-\u9999<>\&]/gim,dri=/href\s*=\s*(?:\"([^\"]+)\"|\'([^\']+)\')/gi,pri=/^(?:mailto:|tel:)/,Get="relationships/",jEe=Fne("short-date-short-time");function Uet(t){if(!lt(t))return t.get("sourceLayer")||t.get("layer")}async function fle(t,e){return typeof t=="function"?t.call(null,e):t}function zet(t=""){if(t)return!pri.test(t.trim().toLowerCase())}function GEe(t){return!!t&&jet.test(t)}function fri(t,e){if(!GEe(e)||!t)return null;const i=e.replace(jet,"").toLowerCase();let r=null;return t.some(n=>n.name.toLowerCase()===i&&(r=n,!0)),r}function Het(t,e){const i=fri(e,t?.fieldName);return i?i.title||null:t?t.label||t.fieldName:null}function mri(t,e){const i=e.get(t.toLowerCase());return`{${i&&i.fieldName||t}}`}function gri(t){return t.replace(ari,"")}function $Y(t,e){const i=UEe(e,t);return i?i.name:t}function yri(t,e){return t&&t.map(i=>$Y(i,e))}function UEe(t,e){return t&&typeof t.getField=="function"&&e?t.getField(e)??null:null}function Wet(t){return`${t}`.trim()}function aN({attributes:t,globalAttributes:e,layer:i,text:r,expressionAttributes:n,fieldInfoMap:s}){return r?zEe({formattedAttributes:e,template:wri(r,{...e,...n,...t},i),fieldInfoMap:s}):""}function zEe({formattedAttributes:t,template:e,fieldInfoMap:i}){return Wet(gri(Xx(Xx(e,r=>mri(r,i)),t)))}function vri(t,e,i=!1){const r=e[t];if(typeof r=="string"){const n="%27",s=(i?encodeURIComponent(r):r).replace(uri,n);e[t]=s}}function _ri(t,e=!1){const i={...t};return Object.keys(i).forEach(r=>vri(r,i,e)),i}function bri(t,e,i){const r=(e=Wet(e))&&e[0]!=="{";return Xx(t,_ri(i,r||!1))}function HEe(t,e){return t.replace(lri,(i,r,n)=>{const s=UEe(e,n);return s?`{${s.name}}`:r})}function wri(t,e,i){const r=HEe(t,i);return r&&r.replace(dri,(n,s,o)=>bri(n,s||o,e))}function xri(t,e){if(typeof t=="string"&&e&&e.dateFormat==null&&(e.places!=null||e.digitSeparator!=null)){const i=Number(t);if(!isNaN(i))return i}return t}function Sri(t){return t?.type==="feature"}function qet(t){return!!t?.layer}function Cri(t){return t?.type==="map-image"}function Tri(t,e){const i=e.fieldInfos,r=e.fieldName,n=Yet(i,r)?.clone(),s=e.preventPlacesFormatting,o=e.layer,a=UEe(o,r);if(n&&a?.type==="date"){const c=n.format||new r9;c.dateFormat=c.dateFormat||"short-date-short-time",c.dateTimeFormatOptions=!qet(o)&&Sri(o)&&o.datesInUnknownTimezone||qet(o)&&Cri(o.layer)&&o.layer.datesInUnknownTimezone?{timeZone:"UTC"}:null,n.format=c}const l=n&&n.format;return typeof t=="string"&&GUe(r)&&l?l.formatRasterPixelValue(t):typeof(t=xri(t,l))=="string"||t==null||l==null?BY(t):s?oA(t,{...WUe(l),minimumFractionDigits:0,maximumFractionDigits:20}):l.format(t)}function Yet(t,e){if(!t||!t.length||!e)return;const i=e.toLowerCase();let r;return t.some(n=>!(!n.fieldName||n.fieldName.toLowerCase()!==i)&&(r=n,!0)),r}function Eri({fieldName:t,graphic:e,layer:i}){if(YA(t)||!i||typeof i.getFeatureType!="function")return null;const{typeIdField:r}=i;if(!r||t!==r)return null;const n=i.getFeatureType(e);return n?n.name:null}function Iri({fieldName:t,value:e,graphic:i,layer:r}){if(YA(t)||!r||typeof r.getFieldDomain!="function")return null;const n=i&&r.getFieldDomain(t,{feature:i});return n&&n.type==="coded-value"?n.getName(e):null}function Ari(t,e){const{creatorField:i,creationDateField:r,editorField:n,editDateField:s}=t;if(!e)return;const o=e[s];if(typeof o=="number"){const l=e[n];return{type:"edit",date:FC(o,jEe),user:l}}const a=e[r];if(typeof a=="number"){const l=e[i];return{type:"create",date:FC(a,jEe),user:l}}return null}function Pri(t,e){const i=new Map;return t&&t.forEach(r=>{const n=$Y(r.fieldName,e);r.fieldName=n,i.set(n.toLowerCase(),r)}),i}function Xet(t){const e=[];if(!t)return e;const{fieldInfos:i,content:r}=t;return i&&e.push(...i),r&&Array.isArray(r)&&r.forEach(n=>{if(n.type==="fields"){const s=n&&n.fieldInfos;s&&e.push(...s)}}),e}function WEe(t){return t.replace(hri,e=>`&#${e.charCodeAt(0)};`)}function BY(t){return typeof t=="string"?t.replace(cri,'
'):t}function Ket(t){const{value:e,fieldName:i,fieldInfos:r,fieldInfoMap:n,layer:s,graphic:o}=t;if(e==null)return"";const a=Iri({fieldName:i,value:e,graphic:o,layer:s});if(a)return a;const l=Eri({fieldName:i,graphic:o,layer:s});if(l)return l;if(n.get(i.toLowerCase()))return Tri(e,{fieldInfos:r||Array.from(n.values()),fieldName:i,layer:s});const c=s&&s.fieldsIndex;return c&&c.isDateField(i)?FC(e,jEe):BY(e)}function qEe({fieldInfos:t,attributes:e,layer:i,graphic:r,fieldInfoMap:n,relatedInfos:s}){const o={};return s?.forEach(a=>Dri({attributes:o,relatedInfo:a,fieldInfoMap:n,fieldInfos:t,layer:i})),e&&Object.keys(e).forEach(a=>{const l=e[a];o[a]=Ket({fieldName:a,fieldInfos:t,fieldInfoMap:n,layer:i,value:l,graphic:r})}),o}async function Jet(t,e){const{layer:i,graphic:r,outFields:n,objectIds:s,returnGeometry:o,spatialReference:a}=t,l=s[0];if(typeof l!="number"&&typeof l!="string"){const h="Could not query required fields for the specified feature. The feature's ID is invalid.",p={layer:i,graphic:r,objectId:l,requiredFields:n};return Vet.warn(h,p),null}if(!AL(i)?.operations?.supportsQuery){const h="The specified layer cannot be queried. The following fields will not be available.",p={layer:i,graphic:r,requiredFields:n,returnGeometry:o};return Vet.warn(h,p),null}const c=i.createQuery();return c.objectIds=s,c.outFields=n?.length?n:[i.objectIdField],c.returnGeometry=!!o,c.returnZ=!!o,c.returnM=!!o,c.outSpatialReference=a,(await i.queryFeatures(c,e)).features[0]}async function Ori(t){if(!t.expressionInfos?.length)return!1;const e=await Kv(),{arcadeUtils:{hasGeometryFunctions:i}}=e;return i(t)}async function Rri({graphic:t,popupTemplate:e,layer:i,spatialReference:r},n){if(!i||!e||(typeof i.load=="function"&&await i.load(n),!t.attributes))return;const s=t.attributes[i.objectIdField];if(s==null)return;const o=[s],a=await e.getRequiredFields(i.fieldsIndex),l=jUe(a,t),c=l?[]:a,h=e.returnGeometry||await Ori(e);if(l&&!h)return;const p=await Jet({layer:i,graphic:t,outFields:c,objectIds:o,returnGeometry:h,spatialReference:r},n);p&&(p.geometry&&(t.geometry=p.geometry),p.attributes&&(t.attributes={...t.attributes,...p.attributes}))}function YA(t=""){return!!t&&t.includes(Get)}function Mri(t){return t?`${Get}${t.layerId}/${t.fieldName}`:""}function Zet({attributes:t,graphic:e,relatedInfo:i,fieldInfos:r,fieldInfoMap:n,layer:s}){t&&e&&i&&Object.keys(e.attributes).forEach(o=>{const a=Mri({layerId:i.relation.id.toString(),fieldName:o}),l=e.attributes[o];t[a]=Ket({fieldName:a,fieldInfos:r,fieldInfoMap:n,layer:s,value:l,graphic:e})})}function Dri({attributes:t,relatedInfo:e,fieldInfoMap:i,fieldInfos:r,layer:n}){t&&e&&(e.relatedFeatures&&e.relatedFeatures&&e.relatedFeatures.forEach(s=>Zet({attributes:t,graphic:s,relatedInfo:e,fieldInfoMap:i,fieldInfos:r,layer:n})),e.relatedStatsFeatures&&e.relatedStatsFeatures&&e.relatedStatsFeatures.forEach(s=>Zet({attributes:t,graphic:s,relatedInfo:e,fieldInfoMap:i,fieldInfos:r,layer:n})))}const Qet=t=>{if(!t)return!1;const e=t.toUpperCase();return e.includes("CURRENT_TIMESTAMP")||e.includes("CURRENT_DATE")||e.includes("CURRENT_TIME")},ett=({layer:t,method:e,query:i,definitionExpression:r})=>{if(!t.capabilities?.query?.supportsCacheHint||e==="attachments")return;const n=ve(i.where)?i.where:null,s=ve(i.geometry)?i.geometry:null;Qet(r)||Qet(n)||s?.type==="extent"||i.resultType==="tile"||(i.cacheHint=!0)},Fri=({query:t,layer:e,method:i})=>{ett({layer:e,method:i,query:t,definitionExpression:`${e.definitionExpression} ${e.serviceDefinitionExpression}`})},Lri=({queryPayload:t,layer:e,method:i})=>{ett({layer:e,method:i,query:t,definitionExpression:`${e.definitionExpression} ${e.serviceDefinitionExpression}`})};function Nri(t,e,i){return t&&e&&i?ttt(t.allLayers,e,i)||ttt(t.allTables,e,i):null}function ttt(t,e,i){return t.find(r=>r!==e&&r.type==="feature"&&r.url===e.url&&r.layerId===i.relatedTableId)}const itt={editing:!1,operations:{add:!0,update:!0,delete:!0}},rtt=Sr.ofType(qJe);let f_=class extends Tn{constructor(e){super(e),this._getAttachmentsPromise=null,this._attachmentLayer=null,this.abilities={...itt},this.activeAttachmentInfo=null,this.activeFileInfo=null,this.attachmentInfos=new rtt,this.fileInfos=new Sr,this.graphic=null,this.mode="view",this.filesEnabled=!1,this.addHandles(sr(()=>this.graphic,()=>this._graphicChanged(),Yo))}destroy(){this._attachmentLayer=null,this.graphic=null}castAbilities(e){return{...itt,...e}}get state(){return this._getAttachmentsPromise?"loading":this.graphic?"ready":"disabled"}get supportsResizeAttachments(){const{graphic:e}=this;if(!e)return!1;const i=e.layer||e.sourceLayer;return i?.loaded&&"capabilities"in i&&i.capabilities&&"operations"in i.capabilities&&"supportsResizeAttachments"in i.capabilities.operations&&i.capabilities.operations.supportsResizeAttachments||!1}async getAttachments(){const{_attachmentLayer:e,attachmentInfos:i}=this;if(!e||typeof e.queryAttachments!="function")throw new st("invalid-layer","getAttachments(): A valid layer is required.");const r=this._getObjectId(),n=new Toe({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 i.removeAll(),a.length&&i.addMany(a),this._getAttachmentsPromise=null,this.notifyChange("state"),a}async addAttachment(e,i=this.graphic){const{_attachmentLayer:r,attachmentInfos:n,abilities:s}=this;if(!i)throw new st("invalid-graphic","addAttachment(): A valid graphic is required.",{graphic:i});if(!e)throw new st("invalid-attachment","addAttachment(): An attachment is required.",{attachment:e});if(!s.operations?.add)throw new st("invalid-abilities","addAttachment(): add abilities are required.");if(!r||typeof r.addAttachment!="function")throw new st("invalid-layer","addAttachment(): A valid layer is required.");const o=r.addAttachment(i,e).then(l=>this._queryAttachment(l.objectId,i)),a=await o;return n.add(a),a}async deleteAttachment(e){const{_attachmentLayer:i,attachmentInfos:r,graphic:n,abilities:s}=this;if(!e)throw new st("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:e});if(!s.operations?.delete)throw new st("invalid-abilities","deleteAttachment(): delete abilities are required.");if(!i||typeof i.deleteAttachments!="function")throw new st("invalid-layer","deleteAttachment(): A valid layer is required.");if(!n)throw new st("invalid-graphic","deleteAttachment(): A graphic is required.");const o=i.deleteAttachments(n,[e.id]).then(()=>e),a=await o;return r.remove(a),a}async updateAttachment(e,i=this.activeAttachmentInfo){const{_attachmentLayer:r,attachmentInfos:n,graphic:s,abilities:o}=this;if(!e)throw new st("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:e});if(!i)throw new st("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:i});if(!o.operations?.update)throw new st("invalid-abilities","updateAttachment(): Update abilities are required.");const a=n.findIndex(h=>h===i);if(!r||typeof r.updateAttachment!="function")throw new st("invalid-layer","updateAttachment(): A valid layer is required.");if(!s)throw new st("invalid-graphic","updateAttachment(): A graphic is required.");const l=r.updateAttachment(s,i.id,e).then(h=>this._queryAttachment(h.objectId)),c=await l;return n.splice(a,1,c),c}async commitFiles(){return await Promise.all(this.fileInfos.items.map(e=>this.addAttachment(e.form))),this.fileInfos.removeAll(),this.getAttachments()}addFile(e,i){if(!e||!i)return null;const r={file:e,form:i};return this.fileInfos.add(r),r}updateFile(e,i,r=this.activeFileInfo){if(!e||!i||!r)return null;const n=this.fileInfos.findIndex(s=>r===s);return n>-1&&this.fileInfos.splice(n,1,{file:e,form:i}),this.fileInfos.items[n]}deleteFile(e){const i=this.fileInfos.find(r=>r.file===e);return i?(this.fileInfos.remove(i),i):null}async _queryAttachment(e,i){const{_attachmentLayer:r}=this;if(!e||!r?.queryAttachments)throw new st("invalid-attachment-id","Could not query attachment.");const n=this._getObjectId(i),s=new Toe({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,i=Uet(e);this._attachmentLayer=i?i.type==="scene"&&ve(i.associatedLayer)?i.associatedLayer:i:null}};E([N()],f_.prototype,"abilities",void 0),E([ho("abilities")],f_.prototype,"castAbilities",null),E([N()],f_.prototype,"activeAttachmentInfo",void 0),E([N()],f_.prototype,"activeFileInfo",void 0),E([N({readOnly:!0,type:rtt})],f_.prototype,"attachmentInfos",void 0),E([N()],f_.prototype,"fileInfos",void 0),E([N({type:io})],f_.prototype,"graphic",void 0),E([N()],f_.prototype,"mode",void 0),E([N({readOnly:!0})],f_.prototype,"state",null),E([N()],f_.prototype,"filesEnabled",void 0),E([N({readOnly:!0})],f_.prototype,"supportsResizeAttachments",null),f_=E([dt("esri.widgets.Attachments.AttachmentsViewModel")],f_);const YEe=f_;function ntt(t){const e=t.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 kri(t){const e=Ql("esri/themes/base/images/files/");return t?t==="text/plain"?`${e}text-32.svg`:t==="application/pdf"?`${e}pdf-32.svg`:t==="text/csv"?`${e}csv-32.svg`:t==="application/gpx+xml"?`${e}gpx-32.svg`:t==="application/x-dwf"?`${e}cad-32.svg`:t==="application/postscript"||t==="application/json"||t==="text/xml"||t==="model/vrml"?`${e}code-32.svg`:t==="application/x-zip-compressed"||t==="application/x-7z-compressed"||t==="application/x-gzip"||t==="application/x-tar"||t==="application/x-gtar"||t==="application/x-bzip2"||t==="application/gzip"||t==="application/x-compress"||t==="application/x-apple-diskimage"||t==="application/x-rar-compressed"||t==="application/zip"?`${e}zip-32.svg`:t.includes("image/")?`${e}image-32.svg`:t.includes("audio/")?`${e}sound-32.svg`:t.includes("video/")?`${e}video-32.svg`:t.includes("msexcel")||t.includes("ms-excel")||t.includes("spreadsheetml")?`${e}excel-32.svg`:t.includes("msword")||t.includes("ms-word")||t.includes("wordprocessingml")?`${e}word-32.svg`:t.includes("powerpoint")||t.includes("presentationml")?`${e}report-32.svg`:`${e}generic-32.svg`:`${e}generic-32.svg`}function Wf(t){return(e,i)=>{e.hasOwnProperty("_messageBundleProps")||(e._messageBundleProps=e._messageBundleProps?e._messageBundleProps.slice():[]),e._messageBundleProps.push({bundlePath:t,propertyName:i})}}var $ri=function(t){return{vnodeSelector:"",properties:void 0,children:void 0,text:t.toString(),domNode:null}},stt=function(t,e){for(var i=0,r=t.length;ithis.viewModel?.attachmentInfos,"change",()=>this.scheduleRender()),Wu(()=>this.viewModel?.fileInfos,"change",()=>this.scheduleRender()),sr(()=>this.viewModel?.mode,()=>this._modeChanged(),Yo)])}loadDependencies(){return Promise.all([Promise.resolve().then(()=>TLe)])}get abilities(){return this.viewModel.abilities}set abilities(e){this.viewModel.abilities=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{...ott,...e}}addAttachment(){const{_addAttachmentForm:e,viewModel:i}=this;return this._set("submitting",!0),this._set("error",null),i.addAttachment(e).then(r=>(this._set("submitting",!1),this._set("error",null),i.mode="view",r)).catch(r=>{throw this._set("submitting",!1),this._set("error",new st("attachments:add-attachment",this.messages.addErrorMessage,r)),r})}deleteAttachment(e){const{viewModel:i}=this;return this._set("submitting",!0),this._set("error",null),i.deleteAttachment(e).then(r=>(this._set("submitting",!1),this._set("error",null),i.mode="view",r)).catch(r=>{throw this._set("submitting",!1),this._set("error",new st("attachments:delete-attachment",this.messages.deleteErrorMessage,r)),r})}updateAttachment(){const{viewModel:e}=this,{_updateAttachmentForm:i}=this;return this._set("submitting",!0),this._set("error",null),e.updateAttachment(i).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 st("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,i=e.updateFile(this.selectedFile,this._updateAttachmentForm,e.activeFileInfo);return e.mode="view",i}deleteFile(e){const i=this.viewModel.deleteFile(e||this.viewModel.activeFileInfo?.file);return this.viewModel.mode="view",i}render(){const{submitting:e,viewModel:i}=this,{state:r}=i;return Gi("div",{class:this.classes(zn.base,zn.esriWidget)},e?this.renderProgressBar():null,r==="loading"?this.renderLoading():this.renderAttachments(),this.renderErrorMessage())}renderErrorMessage(){const{error:e,visibleElements:i}=this;return e&&i.errorMessage?Gi("div",{key:"error-message",class:zn.errorMessage},e.message):null}renderAttachments(){const{activeFileInfo:e,mode:i,activeAttachmentInfo:r}=this.viewModel;return i==="add"?this.renderAddForm():i==="edit"?this.renderDetailsForm(r||e):this.renderAttachmentContainer()}renderLoading(){return Gi("div",{class:zn.loaderContainer,key:"loader"},Gi("div",{class:zn.loader}))}renderProgressBar(){return this.visibleElements.progressBar?Gi("div",{class:zn.progressBar,key:"progress-bar"}):null}renderAddForm(){const{submitting:e,selectedFile:i}=this,r=e||!i,n=this.visibleElements.cancelAddButton?Gi("button",{type:"button",bind:this,disabled:e,onclick:this._cancelForm,class:this.classes(zn.esriButton,zn.esriButtonTertiary,zn.esriButtonSmall,zn.esriButtonHalf,e&&zn.buttonDisabled)},this.messages.cancel):null,s=this.visibleElements.addSubmitButton?Gi("button",{type:"submit",disabled:r,class:this.classes(zn.esriButton,zn.esriButtonSecondary,zn.esriButtonSmall,zn.esriButtonHalf,{[zn.buttonDisabled]:r})},this.messages.add):null,o=i?Gi("span",{key:"file-name",class:zn.fileName},i.name):null,a=Gi("form",{bind:this,afterCreate:BB,afterRemoved:CQe,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},Gi("fieldset",{class:zn.fileFieldset},o,Gi("label",{class:this.classes(zn.fileLabel,zn.esriButton,zn.esriButtonSecondary)},i?this.messages.changeFile:this.messages.selectFile,Gi("input",{class:zn.fileInput,type:"file",name:"attachment",bind:this,onchange:this._handleFileInputChange}))),s,n);return Gi("div",{key:"add-form-container",class:zn.formNode},a)}renderDetailsForm(e){const{visibleElements:i,viewModel:r,selectedFile:n,submitting:s}=this,{abilities:o}=r,a=s||!n;let l,c,h,p;n?(l=n.type,c=n.name,h=n.size):e&&"file"in e?(l=e.file.type,c=e.file.name,h=e.file.size):e&&"contentType"in e&&(l=e.contentType,c=e.name,h=e.size,p=e.url);const y=o.editing&&o.operations?.delete&&i.deleteButton?Gi("button",{key:"delete-button",type:"button",disabled:s,bind:this,onclick:V=>this._submitDeleteAttachment(V,e),class:this.classes(zn.esriButton,zn.esriButtonSmall,zn.esriButtonTertiary,zn.deleteButton,{[zn.buttonDisabled]:s})},this.messages.delete):void 0,v=o.editing&&o.operations?.update&&i.updateButton?Gi("button",{disabled:a,key:"update-button",type:"submit",class:this.classes(zn.esriButton,zn.esriButtonSmall,zn.esriButtonThird,{[zn.buttonDisabled]:a})},this.messages.update):void 0,x=this.visibleElements.cancelUpdateButton?Gi("button",{disabled:s,key:"cancel-button",type:"button",bind:this,onclick:this._cancelForm,class:this.classes(zn.esriButton,zn.esriButtonSmall,zn.esriButtonTertiary,zn.esriButtonThird,{[zn.buttonDisabled]:s})},this.messages.cancel):void 0,I=o.editing&&o.operations?.update?Gi("fieldset",{key:"file",class:zn.fileFieldset},Gi("span",{key:"file-name",class:zn.fileName},c),Gi("label",{class:this.classes(zn.fileLabel,zn.esriButton,zn.esriButtonSecondary)},this.messages.changeFile,Gi("input",{class:zn.fileInput,type:"file",name:"attachment",bind:this,onchange:this._handleFileInputChange}))):void 0,P=Gi("fieldset",{key:"size",class:zn.metadataFieldset},Gi("label",null,sri(this.messagesUnits,h??0))),F=Gi("fieldset",{key:"content-type",class:zn.metadataFieldset},Gi("label",null,l)),k=ve(p)?Gi("a",{class:zn.itemLink,href:p,rel:"noreferrer",target:"_blank"},this.renderImageMask(e,400),Gi("div",{class:zn.itemLinkOverlay},Gi("span",{class:zn.itemLinkOverlayIcon},Gi("calcite-icon",{icon:"launch"})))):this.renderImageMask(e,400),j=Gi("form",{bind:this,afterCreate:BB,afterRemoved:CQe,"data-node-ref":"_updateAttachmentForm",onsubmit:V=>this._submitUpdateAttachment(V,e)},Gi("div",{class:zn.metadata},P,F),I,Gi("div",{class:zn.actions},y,x,v));return Gi("div",{key:"edit-form-container",class:zn.formNode},k,j)}renderImageMask(e,i){return e?"file"in e?this.renderGenericImageMask(e.file.name,e.file.type):this.renderImageMaskForAttachment(e,i):null}renderGenericImageMask(e,i){const{supportsResizeAttachments:r}=this.viewModel,n=kri(i),s={[zn.itemImageResizable]:r};return Gi("div",{class:this.classes(zn.itemMaskIcon,zn.itemMask)},Gi("img",{title:e,alt:e,src:n,class:this.classes(s,zn.itemImage)}))}renderImageMaskForAttachment(e,i){const{supportsResizeAttachments:r}=this.viewModel;if(!e)return null;const{contentType:n,name:s,url:o}=e;if(!r||!ntt(n))return this.renderGenericImageMask(s,n);const a=this._getCSSTransform(e),l=a?{transform:a,"image-orientation":"none"}:{},c=`${o}${o?.includes("?")?"&":"?"}w=${i}`,h={[zn.itemImageResizable]:r};return Gi("div",{class:this.classes(zn.itemMask)},Gi("img",{styles:l,alt:s,title:s,src:c,class:this.classes(h,zn.itemImage)}))}renderFile(e){const{file:i}=e;return Gi("li",{class:zn.item,key:i},Gi("button",{key:"details-button",bind:this,class:zn.itemButton,title:this.messages.attachmentDetails,"aria-label":this.messages.attachmentDetails,onclick:()=>this._startEditFile(e),type:"button"},this.renderImageMask(e),Gi("label",{class:zn.itemLabel},Gi("span",{class:zn.itemFilename},i.name||this.messages.noTitle),Gi("span",{"aria-hidden":"true",class:this.classes(zn.itemChevronIcon,pT(this.container)?zn.iconLeft:zn.iconRight)}))))}renderAttachmentInfo({attachmentInfo:e,displayType:i}){const{viewModel:r,effectiveDisplayType:n}=this,{abilities:s,supportsResizeAttachments:o}=r,{contentType:a,name:l,url:c}=e,h=this.renderImageMask(e,i==="list"?48:400),p=s.editing?Gi("span",{"aria-hidden":"true",class:this.classes(zn.itemChevronIcon,pT(this.container)?zn.iconLeft:zn.iconRight)}):null,y=[h,n==="preview"&&o&&ntt(a)?null:Gi("label",{class:zn.itemLabel},Gi("span",{class:zn.itemFilename},l||this.messages.noTitle),p)],v=s.editing?Gi("button",{key:"details-button",bind:this,class:zn.itemButton,title:this.messages.attachmentDetails,"aria-label":this.messages.attachmentDetails,"data-attachment-info-id":e.id,onclick:()=>this._startEditAttachment(e),type:"button"},y):Gi("a",{key:"details-link",class:zn.itemButton,href:c??void 0,target:"_blank"},y);return Gi("li",{class:zn.item,key:e},v)}renderAttachmentContainer(){const{effectiveDisplayType:e,viewModel:i,visibleElements:r}=this,{attachmentInfos:n,abilities:s,fileInfos:o}=i,a=!!n?.length,l=!!o?.length,c={[zn.containerList]:e!=="preview",[zn.containerPreview]:e==="preview"},h=s.editing&&s.operations?.add&&r.addButton?Gi("button",{bind:this,onclick:()=>this._startAddAttachment(),class:this.classes(zn.esriButton,zn.esriButtonTertiary,zn.addAttachmentButton),type:"button"},Gi("span",{"aria-hidden":"true",class:this.classes(zn.itemAddIcon,zn.iconPlus)}),this.messages.add):void 0,p=a?Gi("ul",{key:"attachments-list",class:zn.items},n.toArray().map(x=>this.renderAttachmentInfo({attachmentInfo:x,displayType:e}))):void 0,y=l?Gi("ul",{key:"file-list",class:zn.items},o.toArray().map(x=>this.renderFile(x))):void 0,v=l||a?void 0:Gi("div",{class:zn.empty},this.messages.noAttachments);return Gi("div",{key:"attachments-container",class:this.classes(zn.container,c)},p,y,v,h)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(e){const i=e.target,r=i&&i.files&&i.files.item(0);this._set("selectedFile",r)}_submitDeleteAttachment(e,i){e.preventDefault(),i&&("file"in i?this.deleteFile(i.file):i&&this.deleteAttachment(i))}_submitAddAttachment(e){e.preventDefault(),this.viewModel.filesEnabled?this.addFile():this.addAttachment()}_submitUpdateAttachment(e,i){e.preventDefault(),i&&"file"in i?this.updateFile():this.updateAttachment()}_startEditAttachment(e){const{viewModel:i}=this;i.activeFileInfo=null,i.activeAttachmentInfo=e,i.mode="edit"}_startEditFile(e){const{viewModel:i}=this;i.activeAttachmentInfo=null,i.activeFileInfo=e,i.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(e){e.preventDefault(),this.viewModel.mode="view"}_getCSSTransform(e){const{orientationInfo:i}=e;return!this._supportsImageOrientation&&i?[i.rotation?`rotate(${i.rotation}deg)`:"",i.mirrored?"scaleX(-1)":""].join(" "):""}};E([N()],f0.prototype,"abilities",null),E([N()],f0.prototype,"displayType",void 0),E([N({readOnly:!0})],f0.prototype,"effectiveDisplayType",null),E([N()],f0.prototype,"graphic",null),E([N()],f0.prototype,"label",null),E([N(),Wf("esri/widgets/Attachments/t9n/Attachments")],f0.prototype,"messages",void 0),E([N(),Wf("esri/core/t9n/Units")],f0.prototype,"messagesUnits",void 0),E([N({readOnly:!0})],f0.prototype,"selectedFile",void 0),E([N({readOnly:!0})],f0.prototype,"submitting",void 0),E([N({readOnly:!0})],f0.prototype,"error",void 0),E([N({type:YEe})],f0.prototype,"viewModel",void 0),E([N()],f0.prototype,"visibleElements",void 0),E([ho("visibleElements")],f0.prototype,"castVisibleElements",null),f0=E([dt("esri.widgets.Attachments")],f0);const Vri=f0;let VY=class extends YEe{constructor(e){super(e),this.description=null,this.title=null}};E([N()],VY.prototype,"description",void 0),E([N()],VY.prototype,"title",void 0),VY=E([dt("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],VY);const KEe=VY,jri={heading:"esri-widget__heading"};function mle({level:t,class:e,...i},r){const n=Gri(t);return Gi(`h${n}`,{...i,class:SQe(jri.heading,e),role:"heading","aria-level":String(n)},r)}function Gri(t){return eu(Math.ceil(t),1,6)}const JEe="esri-feature-element-info",ZEe={base:JEe,title:`${JEe}__title`,description:`${JEe}__description`};let YB=class extends Hf{constructor(e,i){super(e,i),this.description=null,this.headingLevel=2,this.title=null}render(){return Gi("div",{class:ZEe.base},this.renderTitle(),this.renderDescription())}renderTitle(){const{title:e}=this;return e?Gi(mle,{level:this.headingLevel,class:ZEe.title},e):null}renderDescription(){const{description:e}=this;return e?Gi("div",{key:"description",class:ZEe.description},e):null}};E([N()],YB.prototype,"description",void 0),E([N()],YB.prototype,"headingLevel",void 0),E([N()],YB.prototype,"title",void 0),YB=E([dt("esri.widgets.Feature.support.FeatureElementInfo")],YB);const gle=YB,Uri={base:"esri-feature-attachments"};let mT=class extends Hf{constructor(e,i){super(e,i),this._featureElementInfo=null,this.attachmentsWidget=new Vri,this.headingLevel=2,this.viewModel=new KEe}initialize(){this._featureElementInfo=new gle,this.addHandles([sr(()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel],()=>this._setupFeatureElementInfo(),Yo),sr(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,Yo)])}destroy(){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 Gi("div",{class:Uri.base},this._featureElementInfo?.render(),e?.render())}_setupFeatureElementInfo(){const{description:e,title:i,headingLevel:r}=this;this._featureElementInfo?.set({description:e,title:i,headingLevel:r})}};E([N({readOnly:!0})],mT.prototype,"attachmentsWidget",void 0),E([N()],mT.prototype,"description",null),E([N()],mT.prototype,"displayType",null),E([N()],mT.prototype,"graphic",null),E([N()],mT.prototype,"headingLevel",void 0),E([N()],mT.prototype,"title",null),E([N({type:KEe})],mT.prototype,"viewModel",void 0),mT=E([dt("esri.widgets.Feature.FeatureAttachments")],mT);const zri=mT;let gM=class extends Ud(Tn){constructor(e){super(e),this._loadingPromise=null,this.created=null,this.creator=null,this.destroyer=null,this.graphic=null,this.handles.add(sr(()=>this.creator,i=>{this._destroyContent(),this._createContent(i)},Yo))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const{created:e,graphic:i,destroyer:r}=this;e&&i&&(fle(r,{graphic:i}).catch(()=>null),this._set("created",null))}async _createContent(e){const i=this.graphic;if(!i||!e)return;const r=fle(e,{graphic:i}).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))}};E([N({readOnly:!0})],gM.prototype,"created",void 0),E([N()],gM.prototype,"creator",void 0),E([N()],gM.prototype,"destroyer",void 0),E([N({type:io})],gM.prototype,"graphic",void 0),E([N({readOnly:!0})],gM.prototype,"state",null),gM=E([dt("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],gM);const yle=gM;function K1(){return function(t,e){if(!t[e])throw new TypeError(`Cannot auto bind undefined function '${e}'`);return{value:Wri(t[e])}}}function Hri(t){const e=t?.type;return t instanceof KeyboardEvent||e==="keyup"||e==="keydown"||e==="keypress"}function Wri(t){return function(e,...i){Hri(e)?bti(e.key)&&(e.preventDefault(),e.stopPropagation(),e.target.click()):t.call(this,e,...i)}}function qri(t){return e=>{e.hasOwnProperty("_delegatedEventNames")||(e._delegatedEventNames=e._delegatedEventNames?e._delegatedEventNames.slice():[]);const i=e._delegatedEventNames,r=Array.isArray(t)?t:Yri(t);i.push(...r)}}function Yri(t){return t.split(",").map(e=>e.trim())}const att="calcite-mode-";function Xri(){return getComputedStyle(document.body).getPropertyValue("--esri-calcite-mode-name").replace(/\s|'|"/g,"")}function vle(){return Xri().startsWith("dark")}function Kri(){return`${att}${vle()?"dark":"light"}`}function Jri(t){Zri(t),t.classList.add(Kri())}function Zri(t){Array.from(t.classList).forEach(e=>{e.startsWith(att)&&t.classList.remove(e)})}function QEe(t){return t&&typeof t.render=="function"}function Qri(t){return t&&typeof t.postMixInProperties=="function"&&typeof t.buildRendering=="function"&&typeof t.postCreate=="function"&&typeof t.startup=="function"}const eIe="esri-feature-content",tIe={base:eIe,loaderContainer:`${eIe}__loader-container`,loader:`${eIe}__loader`};let XB=class extends Hf{constructor(e,i){super(e,i),this.viewModel=null,this._addTargetToAnchors=r=>{Array.from(r.querySelectorAll("a")).forEach(n=>{zet(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)}renderLoading(){return Gi("div",{class:tIe.loaderContainer,key:"loader"},Gi("div",{class:tIe.loader}))}renderCreated(){const e=this.viewModel?.created;return e?e instanceof HTMLElement?Gi("div",{key:e,bind:e,afterCreate:this._attachToNode}):QEe(e)?Gi("div",{key:e},!e.destroyed&&e.render()):Gi("div",{key:e,innerHTML:e,afterCreate:this._addTargetToAnchors}):null}render(){const e=this.viewModel?.state;return Gi("div",{class:tIe.base},e==="loading"?this.renderLoading():this.renderCreated())}_attachToNode(e){const i=this;e.appendChild(i)}};E([N()],XB.prototype,"creator",null),E([N()],XB.prototype,"graphic",null),E([N({type:yle})],XB.prototype,"viewModel",void 0),XB=E([dt("esri.widgets.Feature.FeatureContent")],XB);const _le=XB;let XA=class extends Tn{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:i}=this,r=[];return i?.forEach(n=>{if(!(!n.hasOwnProperty("visible")||n.visible))return;const s=n.clone();s.label=Het(s,e),r.push(s)}),r}};E([N()],XA.prototype,"attributes",void 0),E([N({type:[Une]})],XA.prototype,"expressionInfos",void 0),E([N()],XA.prototype,"description",void 0),E([N({type:[hW]})],XA.prototype,"fieldInfos",void 0),E([N({readOnly:!0})],XA.prototype,"formattedFieldInfos",null),E([N()],XA.prototype,"title",void 0),XA=E([dt("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],XA);const ble=XA,eni=[{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 tni(t){let e=null;return eni.some(i=>(i.pattern.test(t)&&(e=i),!!e)),e}function ini(t,e){if(typeof e!="string"||!e)return e;const i=tni(e);if(!i)return e;const r=e.match(i.pattern),n=r&&r[2],s=Xx(Xx(i.label,{messages:t,hierPart:n}),{appName:i.appName}),o=i.target?` target="${i.target}"`:"",a=i.target==="_blank"?' rel="noreferrer"':"";return e.replace(i.pattern,`${s}`)}const wle="esri-feature-fields",jY={base:wle,fieldHeader:`${wle}__field-header`,fieldData:`${wle}__field-data`,fieldDataDate:`${wle}__field-data--date`,esriTable:"esri-widget__table"};let $2=class extends Hf{constructor(e,i){super(e,i),this._featureElementInfo=null,this.viewModel=new ble,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new gle,this.addHandles(sr(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),Yo))}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}renderFieldInfo(e,i){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):ini(this.messagesURIUtils,o),c={[jY.fieldDataDate]:a};return Gi("tr",{key:`fields-element-info-row-${n}-${i}`},Gi("th",{key:`fields-element-info-row-header-${n}-${i}`,class:jY.fieldHeader,innerHTML:s}),Gi("td",{key:`fields-element-info-row-data-${n}-${i}`,class:this.classes(jY.fieldData,c),innerHTML:l}))}renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e?.length?Gi("table",{class:jY.esriTable,summary:this.messages.fieldsSummary},Gi("tbody",null,e.map((i,r)=>this.renderFieldInfo(i,r)))):null}render(){return Gi("div",{class:jY.base},this._featureElementInfo?.render(),this.renderFields())}_setupFeatureElementInfo(){const{description:e,title:i}=this;this._featureElementInfo?.set({description:e,title:i})}_forceLTR(e){return`‎${e}`}};E([N()],$2.prototype,"attributes",null),E([N()],$2.prototype,"description",null),E([N()],$2.prototype,"expressionInfos",null),E([N()],$2.prototype,"fieldInfos",null),E([N()],$2.prototype,"title",null),E([N({type:ble,nonNullable:!0})],$2.prototype,"viewModel",void 0),E([N(),Wf("esri/widgets/Feature/t9n/Feature")],$2.prototype,"messages",void 0),E([N(),Wf("esri/widgets/support/t9n/uriUtils")],$2.prototype,"messagesURIUtils",void 0),$2=E([dt("esri.widgets.Feature.FeatureFields")],$2);const ltt=$2,rni={maximumFractionDigits:20};function nni(t){return oA(t,rni)}const sni="<",oni=">",ani=Fne("short-date");function lni(t,e,i,r){let n="";e===0?n=`${sni} `:e===i&&(n=`${oni} `);let s=null;return s=r?FC(t,ani):nni(t),n+s}const uni=new en([64,64,64]);function cni(t,e){const i=[],r=t.length-1;return t.length===5?i.push(0,2,4):i.push(0,r),t.map((n,s)=>i.includes(s)?lni(n,s,r,e):null)}async function hni(t,e,i){let r=!1,n=[],s=[];if(t.stops){const c=t.stops;n=c.map(h=>h.value),r=c.some(h=>!!h.label),r&&(s=c.map(h=>h.label))}const o=n[0],a=n[n.length-1];if(o==null&&a==null)return null;const l=r?null:cni(n,i??!1);return(await Promise.all(n.map(async(c,h)=>({value:c,color:t.type==="opacity"?await dni(c,t,e):(await Promise.resolve().then(()=>Ase)).getColor(t,c),label:r?s[h]:l?.[h]??""})))).reverse()}async function dni(t,e,i=uni){const r=new en(i),n=(await Promise.resolve().then(()=>Ase)).getOpacity(e,t);return n!=null&&(r.a=n),r}function pni(t){if(!t.colorStops)return[];const e=[...t.colorStops].filter(r=>r.color?.a>0);let i=e.length-1;if(e&&e[0]){const r=e[i];r&&r.ratio!==1&&(e.push(new QW({ratio:1,color:r.color})),i++)}return e.map((r,n)=>{let s="";return n===0?s=t.legendOptions?.minLabel||"low":n===i&&(s=t.legendOptions?.maxLabel||"high"),{color:r.color,label:s,ratio:r.ratio}}).reverse()}Oi.getLogger("esri.renderers.support.utils");async function J1(t,e,i){bC(t,e,()=>[]).push(...i)}async function fni(t){const e=new Map;if(!t)return e;if("visualVariables"in t&&t.visualVariables){const i=t.visualVariables.filter(r=>r.type==="color");for(const r of i){const n=(await hni(r)??[]).map(s=>s.color);await J1(e,r.field||r.valueExpression,n)}}if(t.type==="heatmap"){const i=pni(t).map(r=>r.color);await J1(e,t.field||t.valueExpression,i)}else if(t.type==="pie-chart"){for(const i of t.attributes)await J1(e,i.field||i.valueExpression,[i.color]);await J1(e,"default",[t?.othersCategory?.color,vB(t.backgroundFillSymbol,null)])}else if(t.type==="dot-density"){for(const i of t.attributes)await J1(e,i.field||i.valueExpression,[i.color]);await J1(e,"default",[t.backgroundColor])}else if(t.type==="unique-value")if(t.authoringInfo?.type==="predominance")for(const i of t.uniqueValueInfos??[])await J1(e,i.value.toString(),[vB(i.symbol,null)]);else{const i=(t.uniqueValueInfos??[]).map(a=>vB(a.symbol,null)),{field:r,field2:n,field3:s,valueExpression:o}=t;(r||o)&&await J1(e,r||o,i),n&&await J1(e,n,i),s&&await J1(e,s,i)}else if(t.type==="class-breaks"){const i=t.classBreakInfos.map(s=>vB(s.symbol,null)),{field:r,valueExpression:n}=t;await J1(e,r??n,i)}else t.type==="simple"&&await J1(e,"default",[vB(t.symbol,null)]);return"defaultSymbol"in t&&t.defaultSymbol&&await J1(e,"default",[vB(t.defaultSymbol,null)]),e.forEach((i,r)=>{const n=$Nt(i.filter(Boolean),(s,o)=>JSON.stringify(s)===JSON.stringify(o));e.set(r,n)}),e}const mni="esri.widgets.Feature.support.relatedFeatureUtils",utt=Oi.getLogger(mni),ctt=new Map;function xle(t){if(!YA(t))return null;const[e,i]=t.split("/").slice(1);return{layerId:e,fieldName:i}}function gni(t,e){if(!e.relationships)return null;let i=null;const{relationships:r}=e;return r.some(n=>n.id===parseInt(t,10)&&(i=n,!0)),i}function yni({originRelationship:t,relationships:e,layerId:i}){let r=null;return e&&e.some(n=>(`${n.relatedTableId}`===i&&n.id===t?.id&&(r=n),!!r)),r}function vni(t,e){const i=e.toLowerCase();for(const r in t)if(r.toLowerCase()===i)return t[r];return null}function _ni(t,e){const i=gni(t,e);if(i)return{url:`${e.url}/${i.relatedTableId}`,sourceSpatialReference:e.spatialReference,relation:i,relatedFields:[],outStatistics:[]}}function bni(t,e){if(!e||!t)return;const{features:i,statsFeatures:r}=t,n=i&&i.value;e.relatedFeatures=n?n.features:[];const s=r&&r.value;e.relatedStatsFeatures=s?s.features:[]}function wni(t,e,i,r){const n=new ZC;return n.outFields=["*"],n.relationshipId=typeof e.id=="number"?e.id:parseInt(e.id,10),n.objectIds=[t.attributes[i.objectIdField]],i.queryRelatedFeatures?.(n,r)??Promise.resolve({})}function xni(t,e,i){let r=0;const n=[];for(;rI.attributes[s.objectIdField]);if(l?.length&&s.supportsStatistics){const I=new Ns;I.where=xni(s.objectIdField,x,1e3),I.outFields=a,I.outStatistics=l,I.sourceSpatialReference=h;const P={features:Promise.resolve(v),statsFeatures:IB(c,I)};return Ru(P)}}const y=p?.keyField;if(y){const v=t9(Ani(s.fields,y)),x=vni(t.attributes,o.keyField),I=v?`${y}=${x}`:`${y}='${x}'`,P=IB(c,new Ns({where:I,outFields:e.relatedFields,sourceSpatialReference:h}),r),F=e.outStatistics&&e.outStatistics.length>0&&s.supportsStatistics?IB(c,new Ns({where:I,outFields:e.relatedFields,outStatistics:e.outStatistics,sourceSpatialReference:h}),r):null,k={features:P};return F&&(k.statsFeatures=F),Ru(k)}return null}function Cni(t,e){return ur(t,{query:{f:"json"},signal:e&&e.signal})}function Tni({relatedInfos:t,layer:e},i){const r={};return t.forEach((n,s)=>{const{relation:o}=n;if(!o){const p=new st("relation-required","A relation is required on a layer to retrieve related records.");throw utt.error(p),p}const{relatedTableId:a}=o;if(typeof a!="number"){const p=new st("A related table ID is required on a layer to retrieve related records.");throw utt.error(p),p}const l=`${e.url}/${a}`,c=ctt.get(l),h=c||Cni(l);c||ctt.set(l,h),r[s]=h}),zg(Ru(r),i)}function Eni({graphic:t,relatedInfos:e,layer:i},r){const n={};return e.forEach((s,o)=>{s.layerInfo&&(n[o]=Sni(t,s,i,r))}),Ru(n)}function Ini({relatedInfo:t,fieldName:e,fieldInfo:i}){if(t.relatedFields?.push(e),i.statisticType){const r=new aoe({statisticType:i.statisticType,onStatisticField:e,outStatisticFieldName:e});t.outStatistics?.push(r)}}function Ani(t,e){if(t!=null){e=e.toLowerCase();for(const i of t)if(i&&i.name.toLowerCase()===e)return i}return null}const htt={chartAnimation:!0};let qf=class extends Tn{constructor(e){super(e),this.abilities={...htt},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{...htt,...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:i}=this,r=(e+i)%i;this.activeMediaInfoIndex=r}_pageContentElementMedia(e){const{activeMediaInfoIndex:i}=this,r=i+e;this._setContentElementMedia(r)}_formatMediaInfos(){const{mediaInfos:e,layer:i}=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=aN({attributes:r,fieldInfoMap:o,globalAttributes:n,expressionAttributes:s,layer:i,text:l.title}),l.caption=aN({attributes:r,fieldInfoMap:o,globalAttributes:n,expressionAttributes:s,layer:i,text:l.caption}),l.altText=aN({attributes:r,fieldInfoMap:o,globalAttributes:n,expressionAttributes:s,layer:i,text:l.altText}),l.type==="image"){const{value:c}=l;return this._setImageValue({value:c,formattedAttributes:n,layer:i}),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:c}=l;return this._setChartValue({value:c,chartType:l.type,attributes:r,formattedAttributes:n,layer:i,expressionAttributes:s}),l}return null}).filter(ve)??[]}_setImageValue(e){const i=this.fieldInfoMap??new Map,{value:r,formattedAttributes:n,layer:s}=e,{linkURL:o,sourceURL:a}=r;if(a){const l=HEe(a,s);r.sourceURL=zEe({formattedAttributes:n,template:l,fieldInfoMap:i})}if(o){const l=HEe(o,s);r.linkURL=zEe({formattedAttributes:n,template:l,fieldInfoMap:i})}}_setChartValue(e){const{value:i,attributes:r,formattedAttributes:n,chartType:s,layer:o,expressionAttributes:a}=e,{popupTemplate:l,relatedInfos:c}=this,{fields:h,normalizeField:p}=i,y=o;if(i.fields=yri(h,y),p&&(i.normalizeField=$Y(p,y)),!h.some(x=>!!(n[x]!=null||YA(x)&&c?.size)))return;const v=l?.fieldInfos??[];h.forEach(x=>{if(YA(x))return void(i.series=[...i.series,...this._getRelatedChartInfos({fieldInfos:v,fieldName:x,formattedAttributes:n,chartType:s,value:i})]);const I=this._getChartOption({value:i,attributes:r,chartType:s,formattedAttributes:n,expressionAttributes:a,fieldName:x,fieldInfos:v});i.series.push(I)})}_getRelatedChartInfos(e){const{fieldInfos:i,fieldName:r,formattedAttributes:n,chartType:s,value:o}=e,a=[],l=xle(r),c=l&&this.relatedInfos?.get(l.layerId.toString());if(!c)return a;const{relatedFeatures:h,relation:p}=c;if(!p||!h)return a;const{cardinality:y}=p;return h.forEach(v=>{const{attributes:x}=v;x&&Object.keys(x).forEach(I=>{I===l.fieldName&&a.push(this._getChartOption({value:o,attributes:x,formattedAttributes:n,fieldName:r,chartType:s,relatedFieldName:I,hasMultipleRelatedFeatures:h?.length>1,fieldInfos:i}))})}),y==="one-to-many"||y==="many-to-many"?a:[a[0]]}_getTooltip({label:e,value:i,chartType:r}){return r==="pie-chart"?`${e}`:`${e}: ${i}`}_getChartOption(e){const{value:i,attributes:r,formattedAttributes:n,expressionAttributes:s,fieldName:o,relatedFieldName:a,fieldInfos:l,chartType:c,hasMultipleRelatedFeatures:h}=e,p=this.layer,y=this.fieldInfoMap??new Map,{normalizeField:v,tooltipField:x}=i,I=v?YA(v)?r[xle(v).fieldName]:r[v]:null,P=GEe(o)&&s&&s[o]!==void 0?s[o]:a&&r[a]!==void 0?r[a]:r[o]!==void 0?r[o]:n[o],F=new qUe({fieldName:o,value:P===void 0?null:P&&I?P/I:P});if(YA(o)){const X=y.get(o.toLowerCase()),Z=x&&y.get(x.toLowerCase()),ie=X?.fieldName??o,ce=h&&x?xle(x).fieldName:Z?.fieldName??x,he=h&&ce?r[ce]:n[ce]??X?.label??X?.fieldName??a,_e=h&&a?r[a]:n[ie];return F.tooltip=this._getTooltip({label:he,value:_e,chartType:c}),F}const k=Yet(l,o),j=$Y(o,p),V=x&&n[x]!==void 0?n[x]:Het(k||new hW({fieldName:j}),this.popupTemplate?.expressionInfos),Y=n[j];return F.tooltip=this._getTooltip({label:V,value:Y,chartType:c}),F}};E([N()],qf.prototype,"abilities",void 0),E([ho("abilities")],qf.prototype,"castAbilities",null),E([N()],qf.prototype,"activeMediaInfoIndex",void 0),E([N({readOnly:!0})],qf.prototype,"activeMediaInfo",null),E([N()],qf.prototype,"attributes",void 0),E([N()],qf.prototype,"description",void 0),E([N()],qf.prototype,"fieldInfoMap",void 0),E([N()],qf.prototype,"formattedAttributes",void 0),E([N()],qf.prototype,"expressionAttributes",void 0),E([N({readOnly:!0})],qf.prototype,"formattedMediaInfos",null),E([N()],qf.prototype,"isAggregate",void 0),E([N()],qf.prototype,"layer",void 0),E([N({readOnly:!0})],qf.prototype,"formattedMediaInfoCount",null),E([N()],qf.prototype,"mediaInfos",void 0),E([N()],qf.prototype,"popupTemplate",void 0),E([N()],qf.prototype,"relatedInfos",void 0),E([N()],qf.prototype,"title",void 0),qf=E([dt("esri.widgets.Feature.FeatureMedia.FeatureMediaViewModel")],qf);const uN=qf;var dtt=["#ffffff","#858585","#ffbebe","#ffebbe","#ffebaf","#ffffbe","#e9ffbe","#d3ffbe","#beffe8","#bee8ff","#bed2ff","#e8beff","#ffbee8","#ebebeb","#707070","#ff7f7f","#ffa77f","#ffd37f","#ffff73","#d1ff73","#a3ff73","#73ffdf","#73dfff","#73b2ff","#df73ff","#ff73df","#d6d6d6","#5c5c5c","#ff0000","#ff5500","#ffaa00","#ffff00","#aaff00","#55ff00","#00ffc5","#00c5ff","#0070ff","#c500ff","#ff00c5","#c2c2c2","#474747","#e60000","#e64c00","#e69800","#e6e600","#98e600","#4ce600","#00e6a9","#00a9e6","#005ce6","#a900e6","#e600a9","#adadad","#242424","#a80000","#a83800","#a87000","#a8a800","#70a800","#38a800","#00a884","#0084a8","#004da8","#8400a8","#a80084","#999999","#1a1a1a","#730000","#732600","#734c00","#737300","#4c7300","#267300","#00734c","#004c73","#002673","#4c0073","#73004"],Pni=[].concat(dtt.slice(30,39),dtt.slice(28,30).reverse()),Oni=[{name:"default",colors:Pni},{name:"cat-dark",colors:["#ed5151","#149ece","#a7c636","#9e559c","#fc921f","#ffde3e","#f789d8","#b7814a","#3caf99","#6b6bd6","#b54779","#7f7f7f"]},{name:"tropical-bliss",colors:["#fce138","#ff9399","#fcd27e","#f1983c","#a553b7","#b1a9d0","#6ecffc","#4c81cd","#fc6f84","#fc3e5a","#6af689","#48885c"]},{name:"desert-blooms",colors:["#102432","#144d59","#ffc730","#ed9310","#a64f1b","#661510","#d9351a","#b31515","#4a0932","#8c213f","#18382e","#2c6954"]},{name:"under-the-sea",colors:["#bf9727","#607100","#00734c","#704489","#01acca","#024e76","#f09100","#ea311f","#c6004b","#7570b3","#666666","#333333"]},{name:"vibrant-rainbow",colors:["#fffb00","#f5cb11","#9fd40c","#46e39c","#32b8a6","#7ff2fa","#ac08cc","#dd33ff","#eb7200","#e8a784","#bf2e2e","#6c7000"]},{name:"ocean-bay",colors:["#191921","#11495c","#78b1c2","#454f4b","#8f8f82","#9be0c0","#87b051","#f7ec88","#ebdcc1","#dbb658","#c43541","#75351e"]},{name:"prairie-summer",colors:["#332424","#751555","#d47013","#d68989","#211173","#82aad6","#7bfaeb","#6ec9a8","#6b6408","#eada40","#ccc54a","#1fc235"]},{name:"pastel-chalk",colors:["#fffd99","#f5e6a4","#c1d48c","#b8e3d0","#a0b8b5","#cbf7fa","#d791f2","#dfc1eb","#f2b983","#e8c4b2","#bf8e8e","#94995c"]},{name:"seq-yellow-orange-red-bright",colors:["#910000","#b1260b","#c0370f","#e05919","#ef6a1d","#ff7b22","#ffa143","#ffb454","#ffda74","#ffed85"]},{name:"seq-reds-bright",colors:["#57453b","#7b4238","#9f4036","#c23d33","#d7483c","#ec5244","#f3696c","#f9816c","#ffc4ae","#fff0dc"]},{name:"seq-purples-bright",colors:["#4e465c","#5a4a78","#695291","#775baa","#8663c3","#946bdc","#aa89e8","#c1a6f3","#d7c4ff","#e6e1ff"]},{name:"seq-blues-bright",colors:["#404d54","#435c6c","#48799d","#4b88b6","#4d96ce","#50a5e7","#74bbed","#98d0f3","#bce6f9","#e6faff"]},{name:"seq-greens-bright",colors:["#39544c","#386757","#368165","#359b73","#33b581","#4bc392","#64d2a2","#7ce0b3","#cbf6d9","#f4ffea"]},{name:"seq-browns-bright",colors:["#524834","#715b38","#8f6e3c","#ae8140","#cc9444","#eba748","#eeb664","#f0c47f","#f9e0b7","#fff8eb"]}];const ptt="en-us",iIe=new Map([["ar",()=>Promise.resolve().then(()=>rUi).then(t=>t.a)],["bg-bg",()=>Promise.resolve().then(()=>aUi).then(t=>t.b)],["bs-ba",()=>Promise.resolve().then(()=>hUi).then(t=>t.b)],["ca-es",()=>Promise.resolve().then(()=>mUi).then(t=>t.c)],["cs-cz",()=>Promise.resolve().then(()=>_Ui).then(t=>t.c)],["da-dk",()=>Promise.resolve().then(()=>SUi).then(t=>t.d)],["de-de",()=>Promise.resolve().then(()=>IUi).then(t=>t.d)],["de-ch",()=>Promise.resolve().then(()=>RUi).then(t=>t.d)],["el-gr",()=>Promise.resolve().then(()=>LUi).then(t=>t.e)],["en-us",()=>Promise.resolve().then(()=>BUi).then(t=>t.e)],["en-ca",()=>Promise.resolve().then(()=>UUi).then(t=>t.e)],["es-es",()=>Promise.resolve().then(()=>qUi).then(t=>t.e)],["et-ee",()=>Promise.resolve().then(()=>JUi).then(t=>t.e)],["fi-fi",()=>Promise.resolve().then(()=>t7i).then(t=>t.f)],["fr-fr",()=>Promise.resolve().then(()=>s7i).then(t=>t.f)],["he-il",()=>Promise.resolve().then(()=>u7i).then(t=>t.h)],["hr-hr",()=>Promise.resolve().then(()=>p7i).then(t=>t.h)],["hu-hu",()=>Promise.resolve().then(()=>y7i).then(t=>t.h)],["id-id",()=>Promise.resolve().then(()=>w7i).then(t=>t.i)],["it-it",()=>Promise.resolve().then(()=>T7i).then(t=>t.i)],["ja-jp",()=>Promise.resolve().then(()=>P7i).then(t=>t.j)],["ko-kr",()=>Promise.resolve().then(()=>D7i).then(t=>t.k)],["lt-lt",()=>Promise.resolve().then(()=>k7i).then(t=>t.l)],["lv-lv",()=>Promise.resolve().then(()=>j7i).then(t=>t.l)],["nb-no",()=>Promise.resolve().then(()=>H7i).then(t=>t.n)],["nl-nl",()=>Promise.resolve().then(()=>X7i).then(t=>t.n)],["pl-pl",()=>Promise.resolve().then(()=>Q7i).then(t=>t.p)],["pt-br",()=>Promise.resolve().then(()=>rzi).then(t=>t.p)],["pt-pt",()=>Promise.resolve().then(()=>azi).then(t=>t.p)],["ro-ro",()=>Promise.resolve().then(()=>hzi).then(t=>t.r)],["ru-ru",()=>Promise.resolve().then(()=>mzi).then(t=>t.r)],["sk-sk",()=>Promise.resolve().then(()=>_zi).then(t=>t.s)],["sl-sl",()=>Promise.resolve().then(()=>Szi).then(t=>t.s)],["sr-rs",()=>Promise.resolve().then(()=>Izi).then(t=>t.s)],["sv-se",()=>Promise.resolve().then(()=>Rzi).then(t=>t.s)],["th-th",()=>Promise.resolve().then(()=>Lzi).then(t=>t.t)],["tr-tr",()=>Promise.resolve().then(()=>Bzi).then(t=>t.t)],["uk-ua",()=>Promise.resolve().then(()=>Uzi).then(t=>t.u)],["vi-vn",()=>Promise.resolve().then(()=>qzi).then(t=>t.v)],["zh-cn",()=>Promise.resolve().then(()=>Jzi).then(t=>t.z)],["zh-hk",()=>Promise.resolve().then(()=>y2t).then(t=>t.z)],["zh-tw",()=>Promise.resolve().then(()=>y2t).then(t=>t.z)]]);function Rni(t){const e=t.split("-")[0].toLowerCase();let i=null;for(const r of iIe.keys())if(r.startsWith(e)){i=r;break}return i}function Mni(t){return t?iIe.has(t.toLowerCase())?t.toLowerCase():Rni(t)||ptt:ptt}let KB=null,GY=null;async function Dni(t=Z0()){if(t=Mni(t),KB&&t===GY)return KB;KB=Promise.resolve().then(()=>rHi).then(e=>e.i),GY=t;try{const[e,i]=await Promise.all([KB,iIe.get(GY)()]);GY===t&&(e.am4core.options.defaultLocale=i.default),e.am4core.options.suppressWarnings=!0,e.am4core.options.autoDispose=!0}catch{return KB=null,GY=null,null}return KB}function Fni(t,e="default"){const i=Oni.find(r=>r.name===e);return i?i.colors.map(r=>t.color(r)):null}const lv="esri-feature-media",fp={base:lv,mediaContainer:`${lv}__container`,mediaItemContainer:`${lv}__item-container`,mediaItem:`${lv}__item`,mediaItemTitle:`${lv}__item-title`,mediaItemCaption:`${lv}__item-caption`,mediaPrevious:`${lv}__previous`,mediaPreviousIconLTR:`${lv}__previous-icon`,mediaPreviousIconRTL:`${lv}__previous-icon--rtl`,mediaNext:`${lv}__next`,mediaNextIconLTR:`${lv}__next-icon`,mediaNextIconRTL:`${lv}__next-icon--rtl`,mediaChart:`${lv}__chart`,mediaButton:`${lv}__button`,mediaIcon:`${lv}__icon`,iconLeftTriangleArrow:"esri-icon-left-triangle-arrow",iconRightTriangleArrow:"esri-icon-right-triangle-arrow"},rIe=.05,nIe=.95,sIe=15,KA="color",yM="tooltip",UY="value",ftt="default-line-value";let m_=class extends Hf{constructor(e,i){super(e,i),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this.viewModel=new uN,this.messages=null,this._getChartDependencies=async r=>{const n=await Dni(),{destroyed:s,viewModel:o}=this;if(s||!o||!r)return;const{activeMediaInfo:a}=o,l=await this._getRendererColors(n);this._renderChart({chartDiv:r,mediaInfo:a,chartsModule:n,colorMap:l})}}initialize(){this._featureElementInfo=new gle,this.addHandles([sr(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),Yo),sr(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),Yo)])}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 Gi("div",{bind:this,class:fp.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this.renderMedia())}renderMedia(){const{formattedMediaInfoCount:e}=this.viewModel;return e?Gi("div",{key:"media-element-container",class:fp.mediaContainer},this.renderMediaPageButton("previous"),this.renderMediaInfo(),this.renderMediaPageButton("next")):null}renderImageMediaInfo(e){const{_refreshIntervalInfo:i}=this,{activeMediaInfoIndex:r,formattedMediaInfoCount:n}=this.viewModel,{value:s,refreshInterval:o,altText:a,title:l,type:c}=e,{sourceURL:h,linkURL:p}=s,y=zet(p??void 0)?"_blank":"_self",v=y==="_blank"?"noreferrer":"",x=o?i:null,I=x?x.timestamp:0,P=x?x.sourceURL:h,F=Gi("img",{alt:a||l,key:`media-${c}-${r}-${n}-${I}`,src:P??void 0});return(p?Gi("a",{title:l,href:p,rel:v,target:y},F):null)||F}renderChartMediaInfo(e){const{activeMediaInfoIndex:i,formattedMediaInfoCount:r}=this.viewModel;return Gi("div",{key:`media-${e.type}-${i}-${r}`,bind:this,class:fp.mediaChart,afterCreate:this._getChartDependencies})}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;if(!e)return null;const i=e.title?Gi("div",{key:"media-title",class:fp.mediaItemTitle,innerHTML:e.title}):null,r=e.caption?Gi("div",{key:"media-caption",class:fp.mediaItemCaption,innerHTML:e.caption}):null;return Gi("div",{key:"media-container",class:fp.mediaItemContainer},Gi("div",{key:"media-item-container",class:fp.mediaItem},this.renderMediaInfoType()),i,r)}renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const i=e==="previous",r=i?this.messages.previous:this.messages.next,n=i?this.classes(fp.mediaButton,fp.mediaPrevious):this.classes(fp.mediaButton,fp.mediaNext),s=i?this.classes(fp.mediaIcon,fp.mediaPreviousIconLTR,fp.iconLeftTriangleArrow):this.classes(fp.mediaIcon,fp.mediaNextIconLTR,fp.iconRightTriangleArrow),o=i?this.classes(fp.mediaIcon,fp.mediaPreviousIconRTL,fp.iconRightTriangleArrow):this.classes(fp.mediaIcon,fp.mediaNextIconRTL,fp.iconLeftTriangleArrow),a=i?"media-previous":"media-next",l=i?this._previous:this._next;return Gi("button",{type:"button",key:a,title:r,"aria-label":r,tabIndex:0,class:n,bind:this,onclick:l},Gi("span",{"aria-hidden":"true",class:s}),Gi("span",{"aria-hidden":"true",class:o}))}_setupFeatureElementInfo(){const{description:e,title:i}=this;this._featureElementInfo?.set({description:e,title:i})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){const{isAggregate:e,layer:i}=this.viewModel;return e&&i?.featureReduction&&"renderer"in i.featureReduction?i.featureReduction.renderer:i?.renderer}async _getRendererColors(e){const{am4core:i}=e,r=new Map,n=this._getRenderer(),s="default";if(!n)return r;const o=await fni(n);return o.delete(s),Array.from(o.values()).every(a=>a?.length===1)&&(r.set(ftt,i.color({r:50,g:50,b:50,a:1})),Array.from(o.keys()).forEach(a=>{a&&r.set(a,i.color(o.get(a)?.[0].toCss(!0)))})),r}_handleMediaKeyup(e){const i=cL(e);i==="ArrowLeft"&&(e.stopPropagation(),this.viewModel.previous()),i==="ArrowRight"&&(e.stopPropagation(),this.viewModel.next())}_renderChart(e){const{abilities:i}=this.viewModel,{chartsModule:r,chartDiv:n,mediaInfo:s,colorMap:o}=e,{value:a,type:l}=s,{am4core:c}=r,h=Fni(c);function p(x){x instanceof c.ColorSet&&h&&(x.list=h)}vle()&&c.useTheme(r.am4themes_dark);const y=window.matchMedia("(prefers-reduced-motion: reduce)");i.chartAnimation&&!y.matches?c.useTheme(r.am4themes_animated):c.unuseTheme(r.am4themes_animated),c.useTheme(p);const v=l==="pie-chart"?this._createPieChart(e):this._createXYChart(e);n.setAttribute("aria-label",s.altText||s.title),v.data=a.series.map(x=>({[yM]:x.tooltip,[UY]:x.value,[KA]:o.get(x.fieldName)})).filter(x=>l!=="pie-chart"||x.value!=null&&x.value>0)}_customizeChartTooltip(e,i){e&&(e.label.wrap=!0,e.label.maxWidth=200,e.autoTextColor=!1,e.getFillFromObject=!1,e.label.fill=i.color("#ffffff"),e.background.fill=i.color({r:0,g:0,b:0,a:.7}))}_createPieChart(e){const{chartDiv:i,chartsModule:r}=e,{am4core:n,am4charts:s}=r,o=n.create(i,s.PieChart);o.rtl=pT(this.container);const a=o.series.push(new s.PieSeries);return a.labels.template.disabled=!0,a.ticks.template.disabled=!0,a.dataFields.value=UY,a.dataFields.category=yM,this._customizeChartTooltip(a.tooltip,n),a.slices.template.propertyFields.fill=KA,a.slices.template.propertyFields.stroke=KA,o}_getMinSeriesValue(e){let i=0;return e.forEach(r=>i=Math.min(r.value,i)),i}_createColumnChart(e,i){const{chartsModule:r,mediaInfo:n}=i,{value:s}=n,{am4core:o,am4charts:a}=r,l=e.xAxes.push(new a.CategoryAxis);l.dataFields.category=yM,l.renderer.labels.template.disabled=!0;const c=l.tooltip;this._customizeChartTooltip(c,o),c.events.on("sizechanged",()=>{c.dy=-c.contentHeight});const h=e.yAxes.push(new a.ValueAxis),p=h.renderer.labels.template;h.renderer.minLabelPosition=rIe,h.renderer.maxLabelPosition=nIe,h.min=this._getMinSeriesValue(s.series),this._customizeChartTooltip(h.tooltip,o),p.wrap=!0;const y=e.series.push(new a.ColumnSeries);y.dataFields.valueY=UY,y.dataFields.categoryX=yM,y.columns.template.propertyFields.fill=KA,y.columns.template.propertyFields.stroke=KA,e.cursor=new a.XYCursor,s.series.length>sIe&&(e.scrollbarX=new o.Scrollbar)}_createBarChart(e,i){const{chartsModule:r,mediaInfo:n}=i,{value:s}=n,{am4core:o,am4charts:a}=r,l=e.yAxes.push(new a.CategoryAxis);l.dataFields.category=yM,l.renderer.inversed=!0,l.renderer.labels.template.disabled=!0;const c=l.tooltip;this._customizeChartTooltip(c,o),c.events.on("sizechanged",()=>{c.dx=c.contentWidth});const h=e.xAxes.push(new a.ValueAxis),p=h.renderer.labels.template;h.renderer.minLabelPosition=rIe,h.renderer.maxLabelPosition=nIe,h.min=this._getMinSeriesValue(s.series),this._customizeChartTooltip(h.tooltip,o),p.wrap=!0;const y=e.series.push(new a.ColumnSeries);y.dataFields.valueX=UY,y.dataFields.categoryY=yM,y.columns.template.propertyFields.fill=KA,y.columns.template.propertyFields.stroke=KA,e.cursor=new a.XYCursor,s.series.length>sIe&&(e.scrollbarY=new o.Scrollbar)}_createLineChart(e,i){const{chartsModule:r,mediaInfo:n,colorMap:s}=i,{value:o}=n,{am4core:a,am4charts:l}=r,c=e.xAxes.push(new l.CategoryAxis);c.dataFields.category=yM,c.renderer.labels.template.disabled=!0;const h=c.tooltip;this._customizeChartTooltip(h,a),h.events.on("sizechanged",()=>{h.dy=-h.contentHeight});const p=e.yAxes.push(new l.ValueAxis),y=p.renderer.labels.template;p.renderer.minLabelPosition=rIe,p.renderer.maxLabelPosition=nIe,p.min=this._getMinSeriesValue(o.series),this._customizeChartTooltip(p.tooltip,a),y.wrap=!0;const v=e.series.push(new l.LineSeries);v.dataFields.categoryX=yM,v.dataFields.valueY=UY,v.strokeWidth=1;const x=s.get(ftt);x&&(v.stroke=x);const I=v.bullets.push(new l.CircleBullet);I.propertyFields.fill=KA,I.propertyFields.stroke=KA,e.cursor=new l.XYCursor,o.series.length>sIe&&(e.scrollbarX=new a.Scrollbar)}_createXYChart(e){const{chartDiv:i,chartsModule:r,mediaInfo:n}=e,{type:s}=n,{am4core:o,am4charts:a}=r,l=o.create(i,a.XYChart);return l.rtl=pT(this.container),s==="column-chart"&&this._createColumnChart(l,e),s==="bar-chart"&&this._createBarChart(l,e),s==="line-chart"&&this._createLineChart(l,e),l}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const i=Date.now();this._refreshIntervalInfo={timestamp:i,sourceURL:e&&this._getImageSource(e,i)},this.scheduleRender()}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e&&e.type==="image"&&e.refreshInterval&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:i,value:r}=e;if(!i)return;const n=6e4*i;this._updateMediaInfoTimestamp(r.sourceURL);const s=setInterval(()=>{this._updateMediaInfoTimestamp(r.sourceURL)},n);this._refreshTimer=s}_getImageSource(e,i){const r=e.includes("?")?"&":"?",[n,s=""]=e.split("#");return`${n}${r}timestamp=${i}${s?"#":""}${s}`}};E([N()],m_.prototype,"attributes",null),E([N()],m_.prototype,"activeMediaInfoIndex",null),E([N()],m_.prototype,"description",null),E([N()],m_.prototype,"fieldInfoMap",null),E([N()],m_.prototype,"layer",null),E([N()],m_.prototype,"mediaInfos",null),E([N()],m_.prototype,"popupTemplate",null),E([N()],m_.prototype,"relatedInfos",null),E([N()],m_.prototype,"title",null),E([N({type:uN})],m_.prototype,"viewModel",void 0),E([N(),Wf("esri/widgets/Feature/t9n/Feature")],m_.prototype,"messages",void 0),m_=E([dt("esri.widgets.Feature.FeatureMedia")],m_);const mtt=m_,Lni=["$datastore","$map","$layer","$aggregatedfeatures"],Nni="esri.widgets.Feature.support.arcadeFeatureUtils",kni=Oi.getLogger(Nni);function $ni(t){return typeof t=="string"?BY(WEe(t)):Array.isArray(t)?Bni(t):t?.declaredClass==="esri.arcade.Dictionary"?Vni(t):t}function Bni(t){return`
    ${t.map(e=>`
  • ${typeof e=="string"?BY(WEe(e)):e}
  • `).join("")}
`}function Vni(t){return`${t.keys().map(e=>{const i=t.field(e);return``}).join("")}
${e}${typeof i=="string"?BY(WEe(i)):i}
`}function jni({aggregatedFeatures:t,arcadeUtils:e,featureSetVars:i,context:r,viewInfo:n,map:s,graphic:o,interceptor:a}){i.forEach(l=>{const c=l.toLowerCase(),h=n.sr,p={map:s,spatialReference:h,interceptor:a};if(c==="$map"&&(r.vars[c]=e.convertMapToFeatureSetCollection(p)),c==="$layer"&&(r.vars[c]=e.convertFeatureLayerToFeatureSet({layer:o.sourceLayer,spatialReference:h,interceptor:a})),c==="$datastore"&&(r.vars[c]=e.convertServiceUrlToWorkspace({url:o.sourceLayer.url,spatialReference:h,interceptor:a})),c==="$aggregatedfeatures"){const y=o.layer,{fields:v,objectIdField:x,geometryType:I,spatialReference:P,displayField:F}=y,k=new Xc({fields:v,objectIdField:x,geometryType:I,spatialReference:P,displayField:F,...y.type==="feature"?{templates:y.templates,typeIdField:y.typeIdField,types:y.types}:null,source:t});r.vars[c]=e.convertFeatureLayerToFeatureSet({layer:k,spatialReference:P,interceptor:a})}})}function gtt(){return Promise.resolve().then(()=>_mt)}function Gni(t){return"createQuery"in t&&"queryFeatures"in t}async function Uni({graphic:t,view:e}){const{isAggregate:i,layer:r}=t;if(!i||!r||e?.type!=="2d")return[];const n=await e.whenLayerView(r);if(!Gni(n))return[];const s=n.createQuery(),o=t.getObjectId();s.aggregateIds=o!=null?[o]:[];const{features:a}=await n.queryFeatures(s);return a}async function ytt({expressionInfo:t,arcadeUtils:e,interceptor:i,spatialReference:r,map:n,graphic:s,view:o}){if(!t||!t.expression)return null;const a=e.createSyntaxTree(t.expression),l=Lni.filter(v=>e.hasVariable(a,v)),[c]=await Promise.all([Uni({graphic:s,view:o}),e.loadScriptDependencies(a,!0,l)]),h=e.getViewInfo({spatialReference:r}),p=e.createExecContext(s,h);p.interceptor=i,p.useAsync=!0,jni({aggregatedFeatures:c,arcadeUtils:e,featureSetVars:l,context:p,viewInfo:h,map:n,graphic:s,interceptor:i});const y=e.createFunction(a,p);return e.executeAsyncFunction(y,p).catch(v=>kni.error("arcade-execution-error",{error:v,graphic:s,expressionInfo:t}))}async function zni({expressionInfos:t,spatialReference:e,graphic:i,interceptor:r,map:n,view:s}){if(!t||!t.length)return{};const o=await gtt(),a={};for(const h of t)a[`expression/${h.name}`]=ytt({expressionInfo:h,arcadeUtils:o,interceptor:r,spatialReference:e,map:n,graphic:i,view:s});const l=await Ru(a),c={};for(const h in l)c[h]=$ni(l[h].value);return c}const Hni=1;let Z1=class extends Ud(Tn){constructor(e){super(e),this._abortController=null,this.expressionInfo=null,this.graphic=null,this.contentElement=null,this.contentElementViewModel=null,this.interceptor=null,this.view=null,this._cancelQuery=()=>{const{_abortController:i}=this;i&&i.abort(),this._abortController=null},this._createVM=()=>{const i=this.contentElement?.type;this.contentElementViewModel?.destroy();const r=i==="fields"?new ble:i==="media"?new uN:i==="text"?new yle:null;this._set("contentElementViewModel",r)},this._compile=async()=>{this._cancelQuery();const i=new AbortController;this._abortController=i,await this._compileExpression(),this._abortController===i&&(this._abortController=null)},this._compileThrottled=nN(this._compile,Hni,this),this._compileExpression=async()=>{const{expressionInfo:i,graphic:r,interceptor:n,spatialReference:s,map:o,view:a,_abortController:l}=this;if(!(i&&r&&s&&o))return void this._set("contentElement",null);const c=await gtt();if(l!==this._abortController)return;const h=await ytt({arcadeUtils:c,expressionInfo:i,graphic:r,interceptor:n,map:o,spatialReference:s,view:a});if(!h||h.declaredClass!=="esri.arcade.Dictionary")return void this._set("contentElement",null);const p=await h.castAsJsonAsync(l?.signal),y=p?.type,v=y==="media"?fW.fromJSON(p):y==="text"?a9.fromJSON(p):y==="fields"?n9.fromJSON(p):null;this._set("contentElement",v)},this.handles.add([sr(()=>[this.expressionInfo,this.graphic,this.map,this.spatialReference,this.view],()=>this._compileThrottled(),Yo),sr(()=>[this.contentElement],()=>this._createVM(),Yo)])}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:i,contentElementViewModel:r}=this;return e?"loading":i||r?"ready":"disabled"}get map(){return this.view?.map??null}set map(e){this._override("map",e)}};E([N()],Z1.prototype,"_abortController",void 0),E([N({type:UUe})],Z1.prototype,"expressionInfo",void 0),E([N({type:io})],Z1.prototype,"graphic",void 0),E([N({readOnly:!0})],Z1.prototype,"contentElement",void 0),E([N({readOnly:!0})],Z1.prototype,"contentElementViewModel",void 0),E([N()],Z1.prototype,"interceptor",void 0),E([N()],Z1.prototype,"spatialReference",null),E([N({readOnly:!0})],Z1.prototype,"state",null),E([N()],Z1.prototype,"map",null),E([N()],Z1.prototype,"view",void 0),Z1=E([dt("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],Z1);const oIe=Z1,Sle={iconLoading:"esri-icon-loading-indicator esri-rotating",base:"esri-feature-expression",loadingSpinnerContainer:"esri-feature__loading-container",spinner:"esri-feature__loading-spinner"};let Cle=class extends Hf{constructor(e,i){super(e,i),this._contentWidget=null,this.viewModel=new oIe}initialize(){this.addHandles(sr(()=>this.viewModel?.contentElementViewModel,()=>this._setupExpressionWidget(),Yo))}destroy(){this._destroyContentWidget()}renderLoading(){return Gi("div",{key:"loading-container",class:Sle.loadingSpinnerContainer},Gi("span",{class:this.classes(Sle.iconLoading,Sle.spinner)}))}render(){const{state:e}=this.viewModel;return Gi("div",{class:Sle.base},e==="loading"?this.renderLoading():e==="disabled"?null:this._contentWidget?.render())}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:i}=this.viewModel,r=i?.type;this._destroyContentWidget();const n=e?r==="fields"?new ltt({viewModel:e}):r==="media"?new mtt({viewModel:e}):r==="text"?new _le({viewModel:e}):null:null;this._contentWidget=n,this.scheduleRender()}};E([N({type:oIe})],Cle.prototype,"viewModel",void 0),Cle=E([dt("esri.widgets.Feature.FeatureExpression")],Cle);const Wni=Cle,aIe=100;let Kc=class extends _a(D1(Ud(Tn))){constructor(e){super(e),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:i}=this;i&&i.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:i}=this;i&&i.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:i}=this;i&&i.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const i=new AbortController;this._queryAbortController=i,await pf(this._query()),this._queryAbortController===i&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._cancelQueryFeatureCount();const i=new AbortController;this._queryFeatureCountAbortController=i,await pf(this._queryFeatureCount()),this._queryFeatureCountAbortController===i&&(this._queryFeatureCountAbortController=null)},this._queryPageController=async()=>{const i=new AbortController;this._queryPageAbortController=i,await pf(this._queryPage()),this._queryPageAbortController===i&&(this._queryPageAbortController=null)},this._queryThrottled=nN(this._queryController,aIe,this),this._queryFeatureCountThrottled=nN(this._queryFeatureCountController,aIe,this),this._queryPageThrottled=nN(this._queryPageController,aIe,this),this._query=async()=>{const{_queryAbortController:i,relatedFeatures:r}=this;this._destroyRelatedFeatureViewModels(),this.featurePage=1,r.removeAll(),r.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:i?.signal})))},this.handles.add([sr(()=>[this.displayCount,this.graphic,this.layer,this.map,this.orderByFieldsFixedCasing,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount],()=>this._queryThrottled(),Yo),sr(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageThrottled()),sr(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery],()=>this._queryFeatureCountThrottled())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.removeAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:i,featureCount:r}=this,n=1,s=Math.ceil(r/i)||1;this._set("featurePage",Math.min(Math.max(e,n),s))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:i}=this;return e&&i?.loaded?e.map(r=>{const n=r.clone(),s=$Y(r.field,i);return n.field=s,n}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}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 Sr}get relatedLayer(){const{layer:e,map:i,relationship:r}=this;return e?.loaded&&i&&r?Nri(i,e,r)??null:null}get relationship(){const{relationshipId:e,layer:i}=this;return typeof e=="number"?i?.relationships?.find(({id:r})=>r===e)??null:null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new Sr}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:i,_queryPageAbortController:r,canQuery:n}=this;return i?"loading":e||r?"querying":n?"ready":"disabled"}_destroyRelatedFeatureViewModels(){this.relatedFeatureViewModels?.forEach(e=>!e.destroyed&&e.destroy()),this.relatedFeatureViewModels.removeAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:i,relationshipId:r,objectId:n,_queryFeatureCountAbortController:s,canQuery:o,supportsCacheHint:a}=this;if(await e?.load(),await i?.load(),!o||!e||!i)return void this._set("featureCount",0);const l=i.createQuery(),c=new ZC({cacheHint:a,relationshipId:r,returnGeometry:!1,objectIds:[n],where:g_e(l.where,void 0)}),h=await e.queryRelatedFeaturesCount(c,{signal:s?.signal});this._set("featureCount",h[n]||0)}_sliceFeatures(e){const{showAllEnabled:i,displayCount:r}=this;return i?e:r?e.slice(0,r):[]}async _queryPage(){const{relatedFeatures:e,featurePage:i,showAllEnabled:r,_queryPageAbortController:n}=this;!r||i<2||e.addMany(await this._queryRelatedFeatures({signal:n?.signal}))}async _queryRelatedFeatures(e){const{orderByFieldsFixedCasing:i,showAllEnabled:r,featuresPerPage:n,displayCount:s,layer:o,relationshipId:a,featurePage:l,featureCount:c,relatedLayer:h,supportsCacheHint:p}=this,{canQuery:y,objectId:v}=this;if(!y||!o||!h)return[];const x=r?((l-1)*n+c)%c:0,I=r?n:s,P=h.objectIdField,F=[...i?.map(X=>X.field),P].filter(ve),k=i?.map(X=>`${X.field} ${X.order}`),j=h.createQuery(),V=new ZC({orderByFields:k,start:x,num:I,outFields:F,cacheHint:p,relationshipId:a,returnGeometry:!1,objectIds:[v],where:g_e(j.where,void 0)}),Y=(await o.queryRelatedFeatures(V,{signal:e?.signal}))[v]?.features||[];return Y.forEach(X=>{X.sourceLayer=h,X.layer=h}),Y}};E([N()],Kc.prototype,"_queryAbortController",void 0),E([N()],Kc.prototype,"_queryPageAbortController",void 0),E([N()],Kc.prototype,"_queryFeatureCountAbortController",void 0),E([N({value:1})],Kc.prototype,"featurePage",null),E([N()],Kc.prototype,"featuresPerPage",void 0),E([N({readOnly:!0})],Kc.prototype,"orderByFieldsFixedCasing",null),E([N({readOnly:!0})],Kc.prototype,"supportsCacheHint",null),E([N({readOnly:!0})],Kc.prototype,"canQuery",null),E([N()],Kc.prototype,"description",void 0),E([N({readOnly:!0})],Kc.prototype,"itemDescriptionFieldName",null),E([N({value:3})],Kc.prototype,"displayCount",null),E([N({type:io})],Kc.prototype,"graphic",void 0),E([N()],Kc.prototype,"layer",void 0),E([N()],Kc.prototype,"map",void 0),E([N({readOnly:!0})],Kc.prototype,"objectId",null),E([N({readOnly:!0})],Kc.prototype,"objectIdField",null),E([N()],Kc.prototype,"orderByFields",void 0),E([N({readOnly:!0})],Kc.prototype,"relatedFeatures",null),E([N({readOnly:!0})],Kc.prototype,"relatedLayer",null),E([N({readOnly:!0})],Kc.prototype,"relationship",null),E([N()],Kc.prototype,"featureCount",void 0),E([N({readOnly:!0})],Kc.prototype,"relatedFeatureViewModels",null),E([N()],Kc.prototype,"relationshipId",void 0),E([N()],Kc.prototype,"showAllEnabled",void 0),E([N()],Kc.prototype,"state",null),E([N()],Kc.prototype,"title",void 0),Kc=E([dt("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],Kc);const lIe=Kc,zY="esri-feature",uIe=`${zY}-relationship`,JA={base:uIe,esriWidget:"esri-widget",listContainer:`${uIe}__list`,listContainerQuerying:`${uIe}__list--querying`,featureObserver:`${zY}__feature-observer`,stickySpinnerContainer:`${zY}__sticky-loading-container`,loadingSpinnerContainer:`${zY}__loading-container`,spinner:`${zY}__loading-spinner`,iconLoading:"esri-icon-loading-indicator esri-rotating"},vtt={title:!0,description:!0};let uv=class extends Hf{constructor(e,i){super(e,i),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([r])=>{r?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.headingLevel=2,this.viewModel=new lIe,this.messages=null,this.messagesCommon=null,this.visibleElements={...vtt},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 gle,this.addHandles([sr(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),Yo),sr(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),Wu(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return Promise.all([Promise.resolve().then(()=>Dqi),Promise.resolve().then(()=>Nqi),Promise.resolve().then(()=>TLe),Promise.resolve().then(()=>bSt)])}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=da(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:i,displayCount:r}=this.viewModel;return!e&&!!i&&(i>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:i}=this.viewModel;return f2(i===1?e?.numberRecord:e?.numberRecords,{number:i})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...vtt,...e}}renderStickyLoading(){return this.viewModel.state==="querying"?Gi("div",{key:"sticky-loader",class:JA.stickySpinnerContainer},this.renderLoadingIcon()):null}renderLoadingIcon(){return Gi("span",{class:this.classes(JA.iconLoading,JA.spinner)})}renderLoading(){return Gi("div",{key:"loading-container",class:JA.loadingSpinnerContainer},this.renderLoadingIcon())}renderShowAllIconNode(){return Gi("calcite-icon",{scale:"s",icon:"list",slot:"content-end"})}renderChevronIconNode(){const e=pT(this.container)?"chevron-left":"chevron-right";return Gi("calcite-icon",{scale:"s",icon:e,slot:"content-end"})}renderRelatedFeature(e){const{itemDescriptionFieldName:i}=this.viewModel,r=e.title;e.description=i&&e.formattedAttributes?.global[i];const n=e.state==="loading";return Gi("calcite-list-item",{key:e.uid,label:n?`${this.messagesCommon?.loading}…`:r,description:n?"…":e.description??"",onCalciteListItemSelect:()=>this.emit("select-record",{featureViewModel:e})},this.renderChevronIconNode())}renderShowAllListItem(){return this.displayShowAllButton?Gi("calcite-list-item",{key:"show-all-item",label:this.messages?.showAll,description:this.featureCountDescription,onCalciteListItemSelect:()=>this.emit("show-all-records")},this.renderShowAllIconNode()):null}renderNoRelatedFeaturesMessage(){return Gi("calcite-notice",{key:"no-related-features-message",icon:"information",open:!0,kind:"brand",scale:"s",width:"full"},Gi("div",{slot:"message"},this.messages?.noRelatedFeatures))}renderFeatureObserver(){return Gi("div",{key:"feature-observer",class:JA.featureObserver,bind:this,afterCreate:this._relatedFeatureIntersectionObserverCreated})}renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return Gi("calcite-list",null,e.toArray().map(i=>this.renderRelatedFeature(i)),this.renderShowAllListItem())}renderRelatedFeatures(){const{displayListItems:e}=this,{state:i}=this.viewModel;return Gi("div",{key:"list-container",class:this.classes(JA.listContainer,{[JA.listContainerQuerying]:i==="querying"})},e?this.renderList():i==="ready"?this.renderNoRelatedFeaturesMessage():null,this.renderStickyLoading(),this.renderFeatureObserver())}renderRelationshipNotFound(){return Gi("calcite-notice",{key:"relationship-not-found",icon:"exclamation-mark-triangle",open:!0,kind:"danger",scale:"s",width:"full"},Gi("div",{slot:"message"},this.messages?.relationshipNotFound))}render(){const{state:e}=this.viewModel;return Gi("div",{class:this.classes(JA.base,JA.esriWidget)},this._featureElementInfo?.render(),e==="loading"?this.renderLoading():e==="disabled"?this.renderRelationshipNotFound():this.renderRelatedFeatures())}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,i="related-feature-viewmodels";this.removeHandles(i),e?.forEach(r=>{this.addHandles(sr(()=>[r.title,r.state],()=>this.scheduleRender(),Yo),i)}),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:i}=this,r=i.description&&this.description,n=i.title&&this.title;this._featureElementInfo?.set({description:r,title:n,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:i}=this.viewModel;await B3(0),this._relatedFeatureIntersectionObserverNode&&e==="ready"&&i&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};E([N()],uv.prototype,"_relatedFeatureIntersectionObserverNode",void 0),E([N({readOnly:!0})],uv.prototype,"displayShowAllButton",null),E([N({readOnly:!0})],uv.prototype,"displayListItems",null),E([N()],uv.prototype,"description",null),E([N({readOnly:!0})],uv.prototype,"featureCountDescription",null),E([N()],uv.prototype,"headingLevel",void 0),E([N()],uv.prototype,"title",null),E([N({type:lIe})],uv.prototype,"viewModel",void 0),E([N(),Wf("esri/widgets/Feature/t9n/Feature")],uv.prototype,"messages",void 0),E([N(),Wf("esri/t9n/common")],uv.prototype,"messagesCommon",void 0),E([N()],uv.prototype,"visibleElements",void 0),E([ho("visibleElements")],uv.prototype,"castVisibleElements",null),uv=E([dt("esri.widgets.Feature.FeatureRelationship")],uv);const _tt=uv;let qni=class{constructor(e,i){this.preLayerQueryCallback=e,this.preRequestCallback=i,this.preLayerQueryCallback||(this.preLayerQueryCallback=r=>{}),this.preRequestCallback||(this.preLayerQueryCallback=r=>{})}};var HY;const Yni=1,btt="content-view-models",wtt="relationship-view-models",xtt={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0};let Kh=HY=class extends D1(Tn){constructor(t){super(t),this._handles=new df,this._error=null,this._featureAbortController=null,this._graphicChangedThrottled=nN(this._graphicChanged,Yni,this),this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...xtt},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.relatedInfos=new Map,this.title="",this.view=null,this._isAllowedContentType=e=>{const{abilities:i}=this;return e.type==="attachments"&&!!i.attachmentsContent||e.type==="custom"&&!!i.customContent||e.type==="fields"&&!!i.fieldsContent||e.type==="media"&&!!i.mediaContent||e.type==="text"&&!!i.textContent||e.type==="expression"&&!!i.expressionContent||e.type==="relationship"&&!!i.relationshipContent},this._handles.add(sr(()=>[this.graphic,this._effectivePopupTemplate,this.abilities],()=>this._graphicChangedThrottled(),Yo))}destroy(){this._clear(),this._cancelFeatureQuery(),this._error=null,this._handles.destroy(),this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}get _effectivePopupTemplate(){return ve(this.graphic)?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return Pri(Xet(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return Uet(this.graphic)}castAbilities(t){return{...xtt,...t}}get isTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(t){this._set("graphic",t?t.clone():null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(t){this._override("spatialReference",t)}get map(){return this.view?.map||null}set map(t){this._override("map",t)}get waitingForContent(){return!!this._featureAbortController}setActiveMedia(t,e){const i=this.contentViewModels[t];i instanceof uN&&i.setActiveMedia(e)}nextMedia(t){const e=this.contentViewModels[t];e instanceof uN&&e.next()}previousMedia(t){const e=this.contentViewModels[t];e instanceof uN&&e.previous()}async updateGeometry(){const{graphic:t,spatialReference:e,_sourceLayer:i}=this;await i?.load();const r=i?.objectIdField;if(!r||!t||!i)return;const n=t?.attributes?.[r];if(n==null)return;const s=[n];if(!t.geometry){const o=(await Jet({layer:i,graphic:t,outFields:[],objectIds:s,returnGeometry:!0,spatialReference:e}))?.geometry;o&&(t.geometry=o)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}async _graphicChanged(){this._cancelFeatureQuery(),this._error=null,this._clear();const{graphic:t}=this;if(!t)return;const e=new AbortController;this._featureAbortController=e;try{await this._queryFeature({signal:e.signal})}catch(i){ys(i)||(this._error=i,Oi.getLogger(this.declaredClass).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:t,popupTemplate:this._effectivePopupTemplate}))}this._featureAbortController===e&&(this._featureAbortController=null)}_cancelFeatureQuery(){const{_featureAbortController:t}=this;t&&t.abort(),this._featureAbortController=null}_compileContentElement(t,e){return t.type==="attachments"?this._compileAttachments(t,e):t.type==="custom"?this._compileCustom(t,e):t.type==="fields"?this._compileFields(t,e):t.type==="media"?this._compileMedia(t,e):t.type==="text"?this._compileText(t,e):t.type==="expression"?this._compileExpression(t,e):t.type==="relationship"?this._compileRelationship(t,e):void 0}_compileContent(t){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(t)?t.filter(this._isAllowedContentType).map((e,i)=>this._compileContentElement(e,i)).filter(ve):typeof t=="string"?this._compileText(new a9({text:t}),0).text:t}_destroyContentViewModels(){this._handles?.remove(wtt),this._handles?.remove(btt),this.contentViewModels.forEach(t=>t&&!t.destroyed&&t.destroy()),this._set("contentViewModels",[])}_matchesFeature(t,e){const i=t?.graphic?.getObjectId(),r=e?.getObjectId();return ve(i)&&ve(r)&&i===r}_setRelatedFeaturesViewModels({relatedFeatureViewModels:t,relatedFeatures:e,map:i}){const{view:r,spatialReference:n}=this;e?.filter(Boolean).forEach(s=>{t.find(o=>this._matchesFeature(o,s))||t.add(new HY({abilities:{relationshipContent:!1},map:i,view:r,spatialReference:n,graphic:s}))}),t.forEach(s=>{e?.find(a=>this._matchesFeature(s,a))||t.remove(s)})}_setExpressionContentVM(t,e){const i=this.formattedAttributes,{contentElement:r,contentElementViewModel:n}=t,s=r?.type;n&&s&&(s==="fields"&&(this._createFieldsFormattedAttributes({contentElement:r,contentElementIndex:e,formattedAttributes:i}),n.set(this._createFieldsVMParams(r,e))),s==="media"&&(this._createMediaFormattedAttributes({contentElement:r,contentElementIndex:e,formattedAttributes:i}),n.set(this._createMediaVMParams(r,e))),s==="text"&&n.set(this._createTextVMParams(r)))}_compileRelationship(t,e){const{displayCount:i,orderByFields:r,relationshipId:n,title:s,description:o}=t,{_sourceLayer:a,graphic:l,map:c}=this,h=new lIe({displayCount:i,graphic:l,orderByFields:r,relationshipId:n,layer:a,map:c,...this._compileTitleAndDesc({title:s,description:o})});return this.contentViewModels[e]=h,this._handles.add(Wu(()=>h.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(h)),wtt),t}_compileExpression(t,e){const{expressionInfo:i}=t,{graphic:r,map:n,spatialReference:s,view:o}=this,a=new oIe({expressionInfo:i,graphic:r,interceptor:HY.interceptor,map:n,spatialReference:s,view:o});return this.contentViewModels[e]=a,this._handles.add(sr(()=>a.contentElementViewModel,()=>this._setExpressionContentVM(a,e),Yo),btt),t}_compileAttachments(t,e){const{graphic:i}=this,{description:r,title:n}=t;return this.contentViewModels[e]=new KEe({graphic:i,...this._compileTitleAndDesc({title:n,description:r})}),t}_compileCustom(t,e){const{graphic:i}=this,{creator:r,destroyer:n}=t;return this.contentViewModels[e]=new yle({graphic:i,creator:r,destroyer:n}),t}_compileTitleAndDesc({title:t,description:e}){const{_fieldInfoMap:i,_sourceLayer:r,graphic:n,formattedAttributes:s}=this,o=n?.attributes,a=this._expressionAttributes,l=s.global;return{title:aN({attributes:o,fieldInfoMap:i,globalAttributes:l,expressionAttributes:a,layer:r,text:t}),description:aN({attributes:o,fieldInfoMap:i,globalAttributes:l,expressionAttributes:a,layer:r,text:e})}}_createFieldsVMParams(t,e){const i=this._effectivePopupTemplate,r=this.formattedAttributes,n={...r?.global,...r?.content[e]},s=(t?.fieldInfos||i?.fieldInfos)?.filter(({fieldName:c})=>GEe(c)||YA(c)||n.hasOwnProperty(c)),o=i?.expressionInfos,{description:a,title:l}=t;return{attributes:n,expressionInfos:o,fieldInfos:s,...this._compileTitleAndDesc({title:l,description:a})}}_compileFields(t,e){const i=t.clone(),r=new ble(this._createFieldsVMParams(t,e));return this.contentViewModels[e]=r,i.fieldInfos=r.formattedFieldInfos.slice(0),i}_createMediaVMParams(t,e){const{abilities:i,graphic:r,_fieldInfoMap:n,_effectivePopupTemplate:s,relatedInfos:o,_sourceLayer:a,_expressionAttributes:l}=this,c=this.formattedAttributes,h=r?.attributes??{},{description:p,mediaInfos:y,title:v}=t;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:t.activeMediaInfoIndex||0,attributes:h,isAggregate:r?.isAggregate,layer:a,fieldInfoMap:n,formattedAttributes:{...c?.global,...c?.content[e]},expressionAttributes:l,mediaInfos:y,popupTemplate:s,relatedInfos:o,...this._compileTitleAndDesc({title:v,description:p})}}_compileMedia(t,e){const i=t.clone(),r=new uN(this._createMediaVMParams(t,e));return i.mediaInfos=r.formattedMediaInfos.slice(0),this.contentViewModels[e]=r,i}_createTextVMParams(t){const{graphic:e,_fieldInfoMap:i,_sourceLayer:r,_expressionAttributes:n}=this;if(t&&t.text){const s=e?.attributes??{},o=this.formattedAttributes?.global??{};t.text=aN({attributes:s,fieldInfoMap:i,globalAttributes:o,expressionAttributes:n,layer:r,text:t.text})}return{graphic:e,creator:t.text}}_compileText(t,e){const i=t.clone();return this.contentViewModels[e]=new yle(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:t,_sourceLayer:e,graphic:i}=this;if(!t)return;const{lastEditInfoEnabled:r}=t,n=e?.editFieldsInfo;return r&&n?Ari(n,i?.attributes):void 0}_compileTitle(t){const{_fieldInfoMap:e,_sourceLayer:i,graphic:r,_expressionAttributes:n}=this,s=r?.attributes??{},o=this.formattedAttributes?.global??{};return aN({attributes:s,fieldInfoMap:e,globalAttributes:o,expressionAttributes:n,layer:i,text:t})}async _getTitle(){const{_effectivePopupTemplate:t,graphic:e}=this;if(!e)return null;const i=t?.title;return fle(i,{graphic:e})}async _getContent(){const{_effectivePopupTemplate:t,graphic:e}=this;if(!e)return null;const i=t?.content;return fle(i,{graphic:e})}async _queryFeature(t){const{_featureAbortController:e,_sourceLayer:i,graphic:r,_effectivePopupTemplate:n}=this,s=this.map,o=this.view,a=this.spatialReference;if(e!==this._featureAbortController||!r)return;await Rri({graphic:r,popupTemplate:n,layer:i,spatialReference:a},t);const{content:{value:l},title:{value:c}}=await Ru({content:this._getContent(),title:this._getTitle()}),{expressionAttributes:{value:h}}=await Ru({checkForRelatedFeatures:this._checkForRelatedFeatures(t),expressionAttributes:zni({expressionInfos:n?.expressionInfos,spatialReference:a,graphic:r,map:s,interceptor:HY.interceptor,view:o})});e===this._featureAbortController&&r&&(this._expressionAttributes=h,this._graphicExpressionAttributes={...r.attributes,...h},this._set("formattedAttributes",this._createFormattedAttributes(l)),this._set("title",this._compileTitle(c)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(l)||null))}_createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){const{_effectivePopupTemplate:r,graphic:n,relatedInfos:s,_sourceLayer:o,_fieldInfoMap:a,_graphicExpressionAttributes:l}=this;i.content[e]=qEe({fieldInfos:r?.fieldInfos,graphic:n,attributes:{...l,...t.attributes},layer:o,fieldInfoMap:a,relatedInfos:s})}_createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){if(t.fieldInfos){const{graphic:r,relatedInfos:n,_sourceLayer:s,_fieldInfoMap:o,_graphicExpressionAttributes:a}=this;i.content[e]=qEe({fieldInfos:t.fieldInfos,graphic:r,attributes:{...a,...t.attributes},layer:s,fieldInfoMap:o,relatedInfos:n})}}_createFormattedAttributes(t){const{_effectivePopupTemplate:e,graphic:i,relatedInfos:r,_sourceLayer:n,_fieldInfoMap:s,_graphicExpressionAttributes:o}=this,a=e?.fieldInfos,l={global:qEe({fieldInfos:a,graphic:i,attributes:o,layer:n,fieldInfoMap:s,relatedInfos:r}),content:[]};return Array.isArray(t)&&t.forEach((c,h)=>{c.type==="fields"&&this._createFieldsFormattedAttributes({contentElement:c,contentElementIndex:h,formattedAttributes:l}),c.type==="media"&&this._createMediaFormattedAttributes({contentElement:c,contentElementIndex:h,formattedAttributes:l})}),l}_checkForRelatedFeatures(t){const{graphic:e,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(e,Xet(i),t)}async _queryRelatedInfos(t,e,i){const{relatedInfos:r,_sourceLayer:n}=this;r.clear();const s=ve(n?.associatedLayer)?await n?.associatedLayer.load(i):n;if(!s||!t)return;const o=e.filter(c=>c&&YA(c.fieldName));if(!o||!o.length)return;e.forEach(c=>this._configureRelatedInfo(c,s));const a=await Tni({relatedInfos:r,layer:s},i);Object.keys(a).forEach(c=>{const h=r.get(c.toString()),p=a[c]?.value;h&&p&&(h.layerInfo=p.data)});const l=await Eni({graphic:t,relatedInfos:r,layer:s},i);Object.keys(l).forEach(c=>{bni(l[c]?.value,r.get(c.toString()))})}_configureRelatedInfo(t,e){const{relatedInfos:i}=this,r=xle(t.fieldName);if(!r)return;const{layerId:n,fieldName:s}=r;if(!n)return;const o=i.get(n.toString())||_ni(n,e);o&&(Ini({relatedInfo:o,fieldName:s,fieldInfo:t}),this.relatedInfos.set(n,o))}};Kh.interceptor=new qni(Fri,Lri),E([N()],Kh.prototype,"_error",void 0),E([N()],Kh.prototype,"_featureAbortController",void 0),E([N({readOnly:!0})],Kh.prototype,"_effectivePopupTemplate",null),E([N({readOnly:!0})],Kh.prototype,"_fieldInfoMap",null),E([N({readOnly:!0})],Kh.prototype,"_sourceLayer",null),E([N()],Kh.prototype,"abilities",void 0),E([ho("abilities")],Kh.prototype,"castAbilities",null),E([N({readOnly:!0})],Kh.prototype,"content",void 0),E([N({readOnly:!0})],Kh.prototype,"contentViewModels",void 0),E([N()],Kh.prototype,"description",void 0),E([N({type:Boolean})],Kh.prototype,"defaultPopupTemplateEnabled",void 0),E([N({readOnly:!0})],Kh.prototype,"isTable",null),E([N({readOnly:!0})],Kh.prototype,"state",null),E([N({readOnly:!0})],Kh.prototype,"formattedAttributes",void 0),E([N({type:io,value:null})],Kh.prototype,"graphic",null),E([N({readOnly:!0})],Kh.prototype,"lastEditInfo",void 0),E([N({readOnly:!0})],Kh.prototype,"relatedInfos",void 0),E([N()],Kh.prototype,"spatialReference",null),E([N({readOnly:!0})],Kh.prototype,"title",void 0),E([N()],Kh.prototype,"map",null),E([N({readOnly:!0})],Kh.prototype,"waitingForContent",null),E([N()],Kh.prototype,"view",void 0),Kh=HY=E([dt("esri.widgets.FeatureViewModel")],Kh);const cIe=Kh,ty="esri-feature",Hd={iconText:"esri-icon-font-fallback-text",iconLoading:"esri-icon-loading-indicator esri-rotating",esriTable:"esri-widget__table",esriWidget:"esri-widget",base:ty,container:`${ty}__size-container`,title:`${ty}__title`,main:`${ty}__main-container`,btn:`${ty}__button`,icon:`${ty}__icon`,content:`${ty}__content`,contentNode:`${ty}__content-node`,contentElement:`${ty}__content-element`,text:`${ty}__text`,lastEditedInfo:`${ty}__last-edited-info`,fields:`${ty}__fields`,fieldHeader:`${ty}__field-header`,fieldData:`${ty}__field-data`,fieldDataDate:`${ty}__field-data--date`,loadingSpinnerContainer:`${ty}__loading-container`,spinner:`${ty}__loading-spinner`},Stt=t=>{let e=class extends t{constructor(){super(...arguments),this.renderNodeContent=i=>QEe(i)&&!i.destroyed?Gi("div",{class:Hd.contentNode,key:i},i.render()):i instanceof HTMLElement?Gi("div",{class:Hd.contentNode,key:i,bind:i,afterCreate:this._attachToNode}):Qri(i)?Gi("div",{class:Hd.contentNode,key:i,bind:i.domNode,afterCreate:this._attachToNode}):null}_attachToNode(i){const r=this;i.appendChild(r)}};return e=E([dt("esri.widgets.Feature.ContentMixin")],e),e};var hIe;const Ctt={title:!0,content:!0,lastEditedInfo:!0},Ttt="relationship-handles";let Bm=hIe=class extends Stt(Hf){constructor(t,e){super(t,e),this._contentWidgets=[],this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesURIUtils=null,this.visibleElements={...Ctt},this.viewModel=new cIe}initialize(){this.addHandles(sr(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),Yo))}loadDependencies(){return Promise.resolve().then(()=>bSt)}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(t){this.viewModel.graphic=t}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(t){this.viewModel.defaultPopupTemplateEnabled=t}get isTable(){return this.viewModel.isTable}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(t){this.viewModel.spatialReference=t}get title(){return this.viewModel.title}castVisibleElements(t){return{...Ctt,...t}}get map(){return this.viewModel.map}set map(t){this.viewModel.map=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const{state:t}=this.viewModel,e=Gi("div",{class:Hd.container,key:"container"},this.renderTitle(),t==="error"?this.renderError():t==="loading"?this.renderLoading():this.renderContentContainer());return Gi("div",{class:this.classes(Hd.base,Hd.esriWidget)},e)}setActiveMedia(t,e){return this.viewModel.setActiveMedia(t,e)}nextMedia(t){return this.viewModel.nextMedia(t)}previousMedia(t){return this.viewModel.previousMedia(t)}renderError(){const{messagesCommon:t,messages:e,visibleElements:i}=this;return Gi("calcite-notice",{open:!0,kind:"danger",icon:"exclamation-mark-circle",scale:"s"},i.title?Gi("div",{key:"error-title",slot:"title"},t.errorMessage):null,Gi("div",{key:"error-message",slot:"message"},e.loadingError))}renderLoading(){return Gi("div",{key:"loading-container",class:Hd.loadingSpinnerContainer},Gi("span",{class:this.classes(Hd.iconLoading,Hd.spinner)}))}renderContentContainer(){const{visibleElements:t}=this;return t.content?Gi("div",{class:Hd.main},[this.renderContent(),this.renderLastEditInfo()]):null}renderTitle(){const{visibleElements:t,title:e}=this;return t.title?Gi(mle,{level:this.headingLevel,class:Hd.title,innerHTML:e}):null}renderContent(){const t=this.viewModel.content,e="content";if(!t)return null;if(Array.isArray(t))return t.length?Gi("div",{class:Hd.contentNode,key:`${e}-content-elements`},t.map(this.renderContentElement,this)):null;if(typeof t=="string"){const i=this._contentWidgets[0];return!i||i.destroyed?null:Gi("div",{class:Hd.contentNode,key:`${e}-content`},i.render())}return this.renderNodeContent(t)}renderContentElement(t,e){const{visibleElements:i}=this;if(typeof i.content!="boolean"&&!i.content?.[t.type])return null;switch(t.type){case"attachments":return this.renderAttachments(e);case"custom":return this.renderCustom(t,e);case"fields":return this.renderFields(e);case"media":return this.renderMedia(e);case"text":return this.renderText(t,e);case"expression":return this.renderExpression(e);case"relationship":return this.renderRelationship(e);default:return null}}renderAttachments(t){const e=this._contentWidgets[t];if(!e||e.destroyed)return null;const{state:i,attachmentInfos:r}=e.viewModel;return i==="loading"||r.length>0?Gi("div",{key:this._buildKey("attachments-element",t),class:this.classes(Hd.contentElement)},e.render()):null}renderRelationship(t){const e=this._contentWidgets[t];return e&&!e.destroyed&&this.flowItems?Gi("div",{key:this._buildKey("relationship-element",t),class:Hd.contentElement},e.render()):null}renderExpression(t){const e=this._contentWidgets[t];return!e||e.destroyed?null:Gi("div",{key:this._buildKey("expression-element",t),class:Hd.contentElement},e.render())}renderCustom(t,e){const{creator:i}=t,r=this._contentWidgets[e];return!r||r.destroyed?null:i?Gi("div",{key:this._buildKey("custom-element",e),class:Hd.contentElement},r.render()):null}renderFields(t){const e=this._contentWidgets[t];return!e||e.destroyed?null:Gi("div",{key:this._buildKey("fields-element",t),class:Hd.contentElement},e.render())}renderMedia(t){const e=this._contentWidgets[t];return!e||e.destroyed?null:Gi("div",{key:this._buildKey("media-element",t),class:Hd.contentElement},e.render())}renderLastEditInfo(){const{visibleElements:t,messages:e}=this,{lastEditInfo:i}=this.viewModel;if(!i||!t.lastEditedInfo)return null;const{date:r,user:n}=i,s=i.type==="edit"?n?e.lastEditedByUser:e.lastEdited:n?e.lastCreatedByUser:e.lastCreated,o=f2(s,{date:r,user:n});return Gi("div",{key:"edit-info-element",class:this.classes(Hd.lastEditedInfo,Hd.contentElement)},o)}renderText(t,e){const i=t.text,r=this._contentWidgets[e];return!r||r.destroyed?null:i?Gi("div",{key:this._buildKey("text-element",e),class:this.classes(Hd.contentElement,Hd.text)},r.render()):null}_buildKey(t,...e){return`${t}__${this.get("viewModel.graphic.uid")||"0"}-${e.join("-")}`}_destroyContentWidget(t){t&&(t.viewModel=null,!t.destroyed&&t.destroy())}_destroyContentWidgets(){this.removeHandles(Ttt),this._contentWidgets.forEach(t=>this._destroyContentWidget(t)),this._contentWidgets=[]}_addFeatureRelationshipHandles(t){const{flowItems:e,visibleElements:i}=this;this.addHandles([Wu(()=>t,"select-record",({featureViewModel:r})=>{e&&(r.abilities={relationshipContent:!0},e.push(new hIe({flowItems:e,viewModel:r,visibleElements:i})))}),Wu(()=>t,"show-all-records",()=>{if(!e)return;const{viewModel:r}=t;r.showAllEnabled=!0;const n=new _tt({visibleElements:{title:!1,description:!1},viewModel:r});this._addFeatureRelationshipHandles(n),e.push(n)})],Ttt)}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:t,visibleElements:e}=this,i=this.get("viewModel.content"),{contentViewModels:r}=this.viewModel;if(Array.isArray(i))i.forEach((n,s)=>{if(n.type==="attachments"&&(this._contentWidgets[s]=new zri({displayType:n.displayType,headingLevel:e.title?t+1:t,viewModel:r[s]})),n.type==="fields"&&(this._contentWidgets[s]=new ltt({viewModel:r[s]})),n.type==="media"&&(this._contentWidgets[s]=new mtt({viewModel:r[s]})),n.type==="text"&&(this._contentWidgets[s]=new _le({viewModel:r[s]})),n.type==="custom"&&(this._contentWidgets[s]=new _le({viewModel:r[s]})),n.type==="expression"&&(this._contentWidgets[s]=new Wni({viewModel:r[s]})),n.type==="relationship"){const o=new _tt({viewModel:r[s]});this._addFeatureRelationshipHandles(o),this._contentWidgets[s]=o}},this);else{const n=r[0];n&&!n.destroyed&&(this._contentWidgets[0]=new _le({viewModel:n}))}this.scheduleRender()}};E([N()],Bm.prototype,"graphic",null),E([N()],Bm.prototype,"defaultPopupTemplateEnabled",null),E([N()],Bm.prototype,"flowItems",void 0),E([N()],Bm.prototype,"headingLevel",void 0),E([N({readOnly:!0})],Bm.prototype,"isTable",null),E([N()],Bm.prototype,"label",null),E([N(),Wf("esri/widgets/Feature/t9n/Feature")],Bm.prototype,"messages",void 0),E([N(),Wf("esri/t9n/common")],Bm.prototype,"messagesCommon",void 0),E([N(),Wf("esri/widgets/support/t9n/uriUtils")],Bm.prototype,"messagesURIUtils",void 0),E([N()],Bm.prototype,"spatialReference",null),E([N({readOnly:!0})],Bm.prototype,"title",null),E([N()],Bm.prototype,"visibleElements",void 0),E([ho("visibleElements")],Bm.prototype,"castVisibleElements",null),E([N()],Bm.prototype,"map",null),E([N()],Bm.prototype,"view",null),E([N({type:cIe})],Bm.prototype,"viewModel",void 0),Bm=hIe=E([dt("esri.widgets.Feature")],Bm);const Xni=Bm;var Ett;const Tle=Symbol("anchorHandles");let cN=class extends md.EventedAccessor{constructor(e){super(e),this[Ett]=new df,this.location=null,this.screenLocationEnabled=!1,this.view=null,this[Tle].add([Yg(()=>Pa(this.screenLocationEnabled?this.view:null,i=>[i.size,i.type==="3d"?i.camera:i.viewpoint]),()=>this.notifyChange("screenLocation")),sr(()=>this.screenLocation,(i,r)=>{ve(i)&&ve(r)&&this.emit("view-change")})])}destroy(){this.view=null,this[Tle]=da(this[Tle])}get screenLocation(){const{location:e,view:i,screenLocationEnabled:r}=this;return r&&ve(e)&&ve(i)&&i.ready?i.toScreen?.(e):null}};Ett=Tle,E([N()],cN.prototype,"location",void 0),E([N()],cN.prototype,"screenLocation",null),E([N()],cN.prototype,"screenLocationEnabled",void 0),E([N()],cN.prototype,"view",void 0),cN=E([dt("esri.widgets.support.AnchorElementViewModel")],cN);const Itt=cN,Kni="esri.widgets.CompassViewModel";let Ele=class extends Itt{constructor(e){super(e),this.visible=!1}};E([N()],Ele.prototype,"visible",void 0),Ele=E([dt(Kni)],Ele);const Att=Ele,dIe="esri-spinner",pIe={base:dIe,spinnerStart:`${dIe}--start`,spinnerFinish:`${dIe}--finish`};let hN=class extends Hf{constructor(e,i){super(e,i),this._animationDelay=500,this._animationPromise=null,this.viewModel=new Att}initialize(){this.addHandles(sr(()=>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:i,promise:r}=e??{};i&&(this.viewModel.location=i),this.visible=!0;const n=()=>this.hide();r&&r.catch(()=>{}).then(n)}hide(){this.visible=!1}render(){const{visible:e}=this,{screenLocation:i}=this.viewModel,r=!!i,n=e&&r,s=!e&&r,o={[pIe.spinnerStart]:n,[pIe.spinnerFinish]:s},a=this._getPositionStyles();return Gi("div",{class:this.classes(pIe.base,o),styles:a})}_visibleChange(e){if(e)return void(this.viewModel.screenLocationEnabled=!0);const i=B3(this._animationDelay);this._animationPromise=i,i.catch(()=>{}).then(()=>{this._animationPromise===i&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)})}_getPositionStyles(){const{screenLocation:e,view:i}=this.viewModel;if(lt(i)||lt(e))return{};const{padding:r}=i;return{left:e.x-r.left+"px",top:e.y-r.top+"px"}}};E([N()],hN.prototype,"location",null),E([N()],hN.prototype,"view",null),E([N({type:Att})],hN.prototype,"viewModel",void 0),E([N()],hN.prototype,"visible",null),hN=E([dt("esri.widgets.Spinner")],hN);const Jni=hN,Ile={iconZoom:"esri-icon-zoom-in-magnifying-glass",iconTrash:"esri-icon-trash",iconBrowseClusteredFeatures:"esri-icon-table"},dN=new l9({id:"zoom-to-feature",title:"{messages.zoom}",className:Ile.iconZoom}),Ptt=new l9({id:"remove-selected-feature",title:"{messages.remove}",className:Ile.iconTrash}),JB=new l9({id:"zoom-to-clustered-features",title:"{messages.zoom}",className:Ile.iconZoom}),ZB=new l9({id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:Ile.iconBrowseClusteredFeatures}),Zni="esri.widgets.Popup.PopupViewModel",Ale=Oi.getLogger(Zni),Qni=t=>{const{event:e,view:i}=t,{action:r}=e,n=i&&i.popup;if(!r)return Promise.reject(new st("trigger-action:missing-arguments","Event has no action"));if(!n)return Promise.reject(new st("trigger-action:missing-arguments","view.popup is missing"));const{disabled:s,id:o}=r;if(!o)return Promise.reject(new st("trigger-action:invalid-action","action.id is missing"));if(s)return Promise.reject(new st("trigger-action:invalid-action","Action is disabled"));if(o===dN.id)return tsi(n.viewModel).catch(_C);if(o===JB.id)return isi(n.viewModel);if(o===ZB.id)return n.featureMenuOpen=!n.featureMenuOpen,n.viewModel.browseClusterEnabled=!n.viewModel.browseClusterEnabled,Promise.resolve();if(n.viewModel.browseClusterEnabled=!1,o===Ptt.id){n.close();const{selectedFeature:a}=n;if(!a)return Promise.reject(new st(`trigger-action:${Ptt.id}`,"selectedFeature is required",{selectedFeature:a}));const{sourceLayer:l}=a;return l?l.remove(a):i.graphics.remove(a),Promise.resolve()}return Promise.resolve()};function Ott(t){const{selectedFeature:e,location:i,view:r}=t;return r?r.type==="3d"?e??i??null:t.get("selectedFeature.geometry")||i:null}function pN(t){return!!t&&t.isAggregate&&t.sourceLayer?.featureReduction?.type==="cluster"}async function esi(t,e){if(e?.type!=="3d"||!t||t.declaredClass!=="esri.Graphic")return!0;const i=e.getViewForGraphic(t);if(i&&"whenGraphicBounds"in i){let r;try{r=await i.whenGraphicBounds(t,{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 tsi(t){const{location:e,selectedFeature:i,view:r,zoomFactor:n}=t,s=Ott(t);if(!r||!s){const h=new st("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:s,view:r});throw Ale.error(h),h}const o=r.scale/n,a=t.selectedFeature?.geometry,l=a??e,c=ve(l)&&l.type==="point"&&await esi(i,r);dN.active=!0,dN.disabled=!0;try{await t.zoomTo({target:{target:s,scale:c?o:void 0}})}catch{const p=new st("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:i});Ale.error(p)}finally{dN.active=!1,dN.disabled=!1,t.zoomToLocation=null,c&&(t.location=l)}}async function isi(t){const{selectedFeature:e,view:i}=t;if(i?.type!=="2d"){const o=new st("zoomToCluster:invalid-view","View must be 2d MapView.",{view:i});throw Ale.error(o),o}if(!e||!pN(e)){const o=new st("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:e});throw Ale.error(o),o}const[r,n]=await fIe(i,e);JB.active=!0,JB.disabled=!0;const{extent:s}=await r.queryExtent(n);await t.zoomTo({target:s}),JB.active=!1,JB.disabled=!1}async function rsi(t){const{view:e,selectedFeature:i}=t;if(!e||!i)return;const[r,n]=await fIe(e,i),{extent:s}=await r.queryExtent(n);t.selectedClusterBoundaryFeature.geometry=s,e.graphics.add(t.selectedClusterBoundaryFeature)}async function nsi(t){const{selectedFeature:e,view:i}=t;if(!i||!e)return;const[r,n]=await fIe(i,e);ZB.active=!0,ZB.disabled=!0;const{features:s}=await r.queryFeatures(n);ZB.active=!1,ZB.disabled=!1,i.popup?.open({features:[e].concat(s),featureMenuOpen:!0})}async function fIe(t,e){const i=await t.whenLayerView(e.sourceLayer),r=i.createQuery(),n=e.getObjectId();return r.aggregateIds=n!=null?[n]:[],[i,r]}function ssi(t){const e=t.features.filter(i=>pN(i));e.length&&(t.features=e)}function Rtt(t){if(lt(t))return null;switch(t.type){case"point":return t;case"extent":return t.center;case"polygon":return t.centroid;case"multipoint":case"polyline":return t.extent?.center;default:return null}}const vo="esri-popup",WY=`${vo}__header`,fN=`${vo}--is-docked`,sn={calciteThemeLight:"calcite-mode-light",calciteThemeDark:"calcite-mode-dark",iconLeftTriangleArrow:"esri-icon-left-triangle-arrow",iconRightTriangleArrow:"esri-icon-right-triangle-arrow",iconDockToTop:"esri-icon-maximize",iconDockToBottom:"esri-icon-dock-bottom",iconDockToLeft:"esri-icon-dock-left",iconDockToRight:"esri-icon-dock-right",iconClose:"esri-icon-close",iconUndock:"esri-icon-minimize",iconCheckMark:"esri-icon-check-mark",iconLoading:"esri-icon-loading-indicator",iconDefaultAction:"esri-icon-default-action",iconActionsMenu:"esri-icon-handle-horizontal",rotating:"esri-rotating",base:vo,widget:"esri-widget",main:`${vo}__main-container`,loadingContainer:`${vo}__loading-container`,isCollapsible:`${vo}--is-collapsible`,isCollapsed:`${vo}--is-collapsed`,shadow:`${vo}--shadow`,isDocked:fN,isDockedTopLeft:`${fN}-top-left`,isDockedTopCenter:`${fN}-top-center`,isDockedTopRight:`${fN}-top-right`,isDockedBottomLeft:`${fN}-bottom-left`,isDockedBottomCenter:`${fN}-bottom-center`,isDockedBottomRight:`${fN}-bottom-right`,alignTopCenter:`${vo}--aligned-top-center`,alignBottomCenter:`${vo}--aligned-bottom-center`,alignTopLeft:`${vo}--aligned-top-left`,alignBottomLeft:`${vo}--aligned-bottom-left`,alignTopRight:`${vo}--aligned-top-right`,alignBottomRight:`${vo}--aligned-bottom-right`,isFeatureMenuOpen:`${vo}--feature-menu-open`,isActionsMenuOpen:`${vo}--actions-menu-open`,hasFeatureUpdated:`${vo}--feature-updated`,header:WY,headerButtons:`${WY}-buttons`,headerContainer:`${WY}-container`,headerContainerButton:`${WY}-container--button`,headerTitle:`${WY}-title`,content:`${vo}__content`,contentHasFlows:"esri-content--has-flows",contentFlowItem:"esri-content__flow-item",footer:`${vo}__footer`,footerHasPagination:`${vo}__footer--has-pagination`,footerHasActions:`${vo}__footer--has-actions`,footerHasActionsMenu:`${vo}__footer--has-actions-menu`,button:`${vo}__button`,buttonDisabled:`${vo}__button--disabled`,buttonDock:`${vo}__button--dock`,icon:`${vo}__icon`,iconDock:`${vo}__icon--dock-icon`,inlineActionsContainer:`${vo}__inline-actions-container`,actionsMenuButton:`${vo}__actions-menu-button`,actions:`${vo}__actions`,action:`${vo}__action`,actionImage:`${vo}__action-image`,actionText:`${vo}__action-text`,actionToggle:`${vo}__action-toggle`,actionToggleOn:`${vo}__action-toggle--on`,actionExit:`${vo}__action--exit`,actionSelectFeature:`${vo}__action--select-feature`,pointer:`${vo}__pointer`,pointerDirection:`${vo}__pointer-direction`,navigation:`${vo}__navigation`,paginationPrevious:`${vo}__pagination-previous`,paginationNext:`${vo}__pagination-next`,paginationPreviousIconLTR:`${vo}__pagination-previous-icon`,paginationPreviousIconRTL:`${vo}__pagination-previous-icon--rtl`,paginationNextIconLTR:`${vo}__pagination-next-icon`,paginationNextIconRTL:`${vo}__pagination-next-icon--rtl`,featureMenu:`${vo}__feature-menu`,featureMenuList:`${vo}__feature-menu-list`,featureMenuItem:`${vo}__feature-menu-item`,featureMenuViewport:`${vo}__feature-menu-viewport`,featureMenuHeader:`${vo}__feature-menu-header`,featureMenuNote:`${vo}__feature-menu-note`,featureMenuSelected:`${vo}__feature-menu-item--selected`,featureMenuButton:`${vo}__feature-menu-button`,featureMenuTitle:`${vo}__feature-menu-title`,featureMenuObserver:`${vo}__feature-menu-observer`,featureMenuLoader:`${vo}__feature-menu-loader`,collapseButton:`${vo}__collapse-button`,collapseIcon:`${vo}__collapse-icon`},osi="OBJECTID";var mN;(function(t){t[t.size=22]="size",t[t.lineWidth=50]="lineWidth",t[t.maxSize=120]="maxSize",t[t.maxOutlineSize=80]="maxOutlineSize",t[t.tallSymbolWidth=20]="tallSymbolWidth"})(mN||(mN={}));function g_(){const t=new Float32Array(6);return t[0]=1,t[3]=1,t}function asi(t){const e=new Float32Array(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function lsi(t,e,i,r,n,s){const o=new Float32Array(6);return o[0]=t,o[1]=e,o[2]=i,o[3]=r,o[4]=n,o[5]=s,o}function usi(t,e){return new Float32Array(t,e,6)}function Mtt(t,e,i,r){const n=e[r],s=e[r+1];t[r]=i[0]*n+i[2]*s+i[4],t[r+1]=i[1]*n+i[3]*s+i[5]}function mIe(t,e,i,r=0,n=0,s=2){const o=n||e.length/s;for(let a=r;a=4,EEe();function ktt(t){return t=t||globalThis.location.hostname,bsi.some(e=>t?.match(e)!=null)}function Ole(t,e){return t&&(e=e||globalThis.location.hostname)?e.match($tt)!=null||e.match(Vtt)!=null?t.replace("static.arcgis.com","staticdev.arcgis.com"):e.match(Btt)!=null||e.match(jtt)!=null?t.replace("static.arcgis.com","staticqa.arcgis.com"):t:t}const $tt=/^devext.arcgis.com$/,Btt=/^qaext.arcgis.com$/,Vtt=/^[\w-]*\.mapsdevext.arcgis.com$/,jtt=/^[\w-]*\.mapsqa.arcgis.com$/,bsi=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,$tt,Btt,/^jsapps.esri.com$/,Vtt,jtt];function wsi(t,e,i,r){return t.name?t.styleName&&t.styleName==="Esri2DPointSymbolsStyle"?xsi(t,e,r):Axe(t,e,r).then(n=>Gtt(Ou(n),t.name,e,i,r)):Promise.reject(new st("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference"))}function Gtt(t,e,i,r,n){const s=t.data,o=i&&ve(i.portal)?i.portal:Cc.getDefault(),a={portal:o,url:fa(t.baseUrl),origin:"portal-item"},l=s.items.find(v=>v.name===e);if(!l){const v=`The symbol name '${e}' could not be found`;return Promise.reject(new st("symbolstyleutils:symbol-name-not-found",v,{symbolName:e}))}let c=rw(jze(l,r),a),h=l.thumbnail?.href??null;const p=l.thumbnail&&l.thumbnail.imageData;ktt()&&(c=Ole(c)??"",h=Ole(h));const y={portal:o,url:fa(jH(c)),origin:"portal-item"};return iq(c,n).then(v=>{const x=r==="cimRef"?Bse(v.data):v.data,I=JW(x,y);if(I&&_R(I)){if(h){const P=rw(h,a);I.thumbnail=new qL({url:P})}else p&&(I.thumbnail=new qL({url:`data:image/png;base64,${p}`}));t.styleUrl?I.styleOrigin=new LW({portal:i.portal,styleUrl:t.styleUrl,name:e}):t.styleName&&(I.styleOrigin=new LW({portal:i.portal,styleName:t.styleName,name:e}))}return I})}function xsi(t,e,i){const r=zze.replace(/\{SymbolName\}/gi,t.name),n=ve(e.portal)?e.portal:Cc.getDefault();return iq(r,i).then(s=>{const o=Bse(s.data);return JW(o,{portal:n,url:fa(jH(r)),origin:"portal-item"})})}const Ssi=Object.freeze(Object.defineProperty({__proto__:null,fetchSymbolFromStyle:Gtt,resolveWebStyleSymbol:wsi},Symbol.toStringTag,{value:"Module"}));mN.size,mN.maxSize,mN.maxOutlineSize,mN.lineWidth,mN.tallSymbolWidth;function Utt(t){return t&&"opacity"in t?t.opacity*Utt(t.parent):1}async function Csi(t,e){if(!t)return;const i=t.sourceLayer,r=(ve(e)&&e.useSourceLayer?i:t.layer)??i,n=Utt(r);if(ve(t.symbol)&&(!ve(e)||e.ignoreGraphicSymbol!==!0)){const P=t.symbol.type==="web-style"?await IXt(t.symbol,{...e,cache:ve(e)?e.webStyleCache:null}):t.symbol.clone();return ICe(P,null,n),P}const s=(ve(e)?e.renderer:null)??(r&&"renderer"in r?r.renderer:null);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(t,e):null;if(!o)return;if(o=o.type==="web-style"?await o.fetchSymbol({...e,cache:ve(e)?e.webStyleCache:null}):o.clone(),!(s&&"visualVariables"in s&&s.visualVariables&&s.visualVariables.length))return ICe(o,null,n),o;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&(lt(e)||lt(e.arcade))){const P={...e};P.arcade=await Kv(),e=P}const a=await Promise.resolve().then(()=>Ase),l=[],c=[],h=[],p=[];for(const P of s.visualVariables)switch(P.type){case"color":l.push(P);break;case"opacity":c.push(P);break;case"rotation":p.push(P);break;case"size":P.target||h.push(P)}const y=!!l.length&&l[l.length-1],v=y?a.getColor(y,t,e):null,x=!!c.length&&c[c.length-1];let I=x?a.getOpacity(x,t,e):null;if(n!=null&&(I=I!=null?I*n:n),ICe(o,v,I),h.length){const P=a.getAllSizes(h,t,e);await mKe(o,P)}for(const P of p)gKe(o,a.getRotationAngle(P,t,e),P.axis);return o}let Tsi=class{constructor(e,i){this._owner=i,this._properties={},this._afterDispatchHandle=null;for(const r in e){const n=e[r],s=new $Ve(n,void 0,void 0,2,2);this._properties[r]={pool:s,acquired:[]}}this._afterDispatchHandle=Bkt(()=>this._release())}destroy(){this._afterDispatchHandle&&(this._afterDispatchHandle.remove(),this._afterDispatchHandle=null);for(const e in this._properties){const i=this._properties[e];for(const r of i.acquired)QVe(r)||i.pool.release(r);i.pool.destroy(),i.pool=null,i.acquired=null}this._properties=null,this._owner=null}get(e){const i=this._owner._get(e),r=this._properties[e];let n=r.pool.acquire();for(r.acquired.push(n);n===i;)r.acquired.push(n),n=r.pool.acquire();return n}_release(){for(const e in this._properties){const i=this._properties[e];let r=0;for(const n of i.acquired)QVe(n)?i.acquired[r++]=n:i.pool.release(n);i.acquired.length=r}}};const Esi=Hi("mac")?"Meta":"Ctrl",Rle={8:"Backspace",9:"Tab",13:"Enter",27:"Escape",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete"};for(let t=48;t<58;t++)Rle[t]=String.fromCharCode(t);for(let t=1;t<25;t++)Rle[111+t]=`F${t}`;for(let t=65;t<91;t++)Rle[t]=[String.fromCharCode(t+32),String.fromCharCode(t)];function Isi(t){if(t.key!==void 0)return cL(t);const e=Rle[t.keyCode];return Array.isArray(e)?t.shiftKey?e[1]:e[0]:e}function Asi(t){switch(t){case"Ctrl":case"Alt":case"Shift":case"Meta":case"Primary":return!0}return!1}let Psi=class{constructor(e,i=[]){this.eventType=e,this.keyModifiers=i}matches(e){if(e.type!==this.eventType)return!1;if(this.keyModifiers.length===0)return!0;const i=e.modifiers;for(const r of this.keyModifiers)if(!i.has(r))return!1;return!0}};const ztt=Oi.getLogger("esri.views.input.InputHandler");let Vm=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 i=this._incoming[e];for(const r of i)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?ztt.error("This InputHandler has already been registered with an InputManager"):(e.setEventCallback(i=>this._handleEvent(i)),e.setUninstallCallback(()=>this._onUninstall()),this._manager=e)}onUninstall(){}registerIncoming(e,i,r){let n;typeof i=="function"?(r=i,n=[]):n=i||[];const s=typeof e=="string"?new Psi(e,n):e,o=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},a=h=>{const p=this._incoming[h.match.eventType];if(p){const y=p.indexOf(h);p.splice(y,1),o(),this._manager&&this._manager.updateDependencies()}},l=new Osi(s,r,{onPause:a,onRemove:a,onResume:h=>{const p=this._incoming[h.match.eventType];p&&!p.includes(h)&&(p.push(h),o(),this._manager&&this._manager.updateDependencies())}});let c=this._incoming[s.eventType];return c||(c=[],this._incoming[s.eventType]=c),c.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 i=new Rsi(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]=i,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),i}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):ztt.error("This InputHandler is not registered with an InputManager")}_handleEvent(e){const i=this._incoming[e.type];if(i){for(const r of i)if(r.match.matches(e)&&(r.callback?.(e),e.shouldStopPropagation()))break}}},Osi=class{constructor(e,i,r){this.match=e,this._callback=i,this._handler=r}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}},Rsi=class{constructor(e,i){this.eventType=e,this._removed=!1,this._handler=i}emit(e,i,r){this._removed||this._handler.onEmit(this,e,i,r)}remove(){this._removed=!0,this._handler.onRemove(this)}},Msi=class extends Vm{constructor(e){super(!0),this._onChange=e,this._value="mouse",this._x=null,this._y=null,this.registerIncoming("pointer-move",i=>{this._update(i.data)})}_update(e){const i=e.native.pointerType==="touch"?"touch":"mouse",{x:r,y:n}=e;i===this._value&&this._x===r&&this._y===n||(this._value=i,this._x=r,this._y=n,this._onChange(i,r,n))}},Mle=class{constructor(e){this._observable=new Y_e,this._value=e}get(){return Na(this._observable),this._value}set(e){e!==this._value&&(this._value=e,this._observable.notify())}},Dsi=class extends Vm{get multiTouchActive(){return this._multiTouchActive.get()}constructor(){super(!0),this._activeTouchPointerIds=new Set,this._multiTouchActive=new Mle(!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.set(this._activeTouchPointerIds.size>1)}},gT=class extends Tn{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=Esi,this._latestPointerType="mouse",this._propertiesPool=new Tsi({latestPointerLocation:Lsi},this),this.latestPointerLocation=null,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 i of e)this.uninstallHandlers(i);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}installHandlers(e,i,r=yT.INTERNAL){if(this._nameToGroup[e])return void Oi.getLogger(this.declaredClass).error("There is already an InputHandler group registered under the name `"+e+"`");if(i.length===0)return void Oi.getLogger(this.declaredClass).error("Can't register a group of zero handlers");const n={name:e,handlers:i.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,c,h,p)=>{this._emitInputEvent(o.priorityIndex+1,a,l,c,p,h)},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 i=this._nameToGroup[e];i?(i.handlers.forEach(r=>{r.removed=!0,r.uninstallCallback?.()}),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):Oi.getLogger(this.declaredClass).error("There is no InputHandler group registered under the name `"+e+"`")}hasHandlers(e){return this._nameToGroup[e]!==void 0}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const e=new Set,i=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)Asi(a)||i.add(a)}n.active=s}this._sourceEvents=e,this._keyModifiers=i,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,i,r){this._latestPointerType=e;const n=this._get("latestPointerLocation");if(lt(n)||n.x!==i||n.y!==r){const s=this._propertiesPool.get("latestPointerLocation");s.x=i,s.y=r,this._set("latestPointerLocation",s)}}_onEventReceived(e,i){if(e==="pointer-capture-lost"){const s=i;this._pointerCaptures.delete(s.native.pointerId)}this._updateKeyModifiers(e,i);const r=this.test.timestamp!=null?this.test.timestamp:i.native?i.native.timestamp:void 0,n=i.native?i.native.cancelable:void 0;this._emitInputEventFromSource(e,i,r,n)}_updateKeyModifiers(e,i){if(!i)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=i.key;this._keyModifiers.has(a)&&s(a,e==="key-down")}const o=i.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 Msi((e,i,r)=>this._setLatestPointer(e,i,r)),this._multiTouchHandler=new Dsi,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],yT.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,yT.INTERNAL)}_setPointerCapture(e,i,r,n){const s=e.name+"-"+i.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,i,r,n){this._emitInputEvent(0,e,i,r,n)}_emitInputEvent(e,i,r,n,s,o){const a=n!==void 0?n:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),l=s!==void 0&&s,c={event:new Fsi(i,r,a,o||this._activeKeyModifiers,l),priorityIndex:e};this._currentPropagation?this._currentPropagation.events.push(c):this._doNewPropagation(c)}_doNewPropagation(e){this._currentPropagation={events:new lq,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){const e=Ou(this._currentPropagation);for(;e.events.length>0;){const{event:i,priorityIndex:r}=e.events.pop(),n=i.data&&i.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&&!i.shouldStopPropagation()&&e.currentHandler.eventCallback?.(i),i.shouldStopPropagation()){n!=null&&this._stoppedPropagationEventIds.add(n);break}if(i.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:i,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 i=new lq;i.push(e);const r=this._currentPropagation;if(r){for(;r.events.length;)i.push(r.events.pop());r.events=i,r.currentHandler=null}}_compareHandlerPriority(e,i){if(e.handler.hasSideEffects!==i.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==i.groupPriority)return e.groupPriority>i.groupPriority?-1:1;for(const r of e.handler.incomingEventMatches)for(const n of i.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>i.priorityIndex?-1:1}_sortHandlersPriority(e){const i=[];for(const r of e){let n=0;for(;n=0;)n++;i.splice(n,0,r)}return i}get debug(){const e=i=>{const r=this._setPointerCapture;this._setPointerCapture=()=>{},i(),this._setPointerCapture=r};return{injectEvent:(i,r)=>{e(()=>{this._onEventReceived(i,r)})},disablePointerCapture:e}}};E([N({readOnly:!0})],gT.prototype,"hasPendingInputs",null),E([N({constructOnly:!0})],gT.prototype,"eventSource",void 0),E([N({constructOnly:!0})],gT.prototype,"recognizers",void 0),E([N()],gT.prototype,"_latestPointerType",void 0),E([N()],gT.prototype,"latestPointerType",null),E([N()],gT.prototype,"multiTouchActive",null),E([N({readOnly:!0})],gT.prototype,"latestPointerLocation",void 0),gT=E([dt("esri.views.input.InputManager")],gT);let Fsi=class{constructor(e,i,r,n,s){this.type=e,this.data=i,this.timestamp=r,this.modifiers=n,this.cancelable=s,this._propagationState=_M.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=_M.STOPPED}shouldStopPropagation(){return(this._propagationState&_M.STOPPED)!=0}async(e){this._propagationState|=_M.PAUSED;const i=(r,n)=>{this._propagationState&=~_M.PAUSED;const s=this._resumeCallback;if(this._resumeCallback=null,s&&s(),n)throw r;return r};return(typeof e=="function"?e():e).then(r=>i(r,!1),r=>i(r,!0))}shouldPausePropagation(e){return!!(this._propagationState&_M.PAUSED)&&(this._resumeCallback=e,!0)}preventDefault(){this.data.native.preventDefault()}};var _M;(function(t){t[t.NONE=0]="NONE",t[t.STOPPED=1]="STOPPED",t[t.PAUSED=2]="PAUSED"})(_M||(_M={}));const yT={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3},Lsi=class{};function Htt(t){return t&&typeof t.highlight=="function"}const Wtt=t=>{let e=class extends t{constructor(...i){super(...i),this.goToOverride=null,this.view=null}callGoTo(i){const{view:r}=this;return sg(r),this.goToOverride?this.goToOverride(r,i):r.goTo(i.target,i.options)}};return E([N()],e.prototype,"goToOverride",void 0),E([N()],e.prototype,"view",void 0),e=E([dt("esri.widgets.support.GoTo")],e),e},YY=Sr.ofType({key:"type",defaultKeyValue:"button",base:Hne,typeMap:{button:l9,toggle:i7e}}),Nsi=()=>[dN.clone()],ksi=()=>[JB.clone(),ZB.clone()];let Hl=class extends Wtt(Itt){get isLoadingFeature(){return this.featureViewModels.some(e=>e.waitingForContent)}constructor(e){super(e),this._handles=new df,this._pendingPromises=new Set,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this.featurePage=null,this.actions=new YY,this.activeFeature=null,this.defaultPopupTemplateEnabled=!1,this.autoCloseEnabled=!1,this.autoOpenEnabled=!0,this.browseClusterEnabled=!1,this.content=null,this.featuresPerPage=20,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new io({symbol:new sw({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}initialize(){this._handles.add([sr(()=>[this.autoOpenEnabled,this.view],()=>this._autoOpenEnabledChange()),this.on("view-change",()=>this._autoClose()),sr(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),sr(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),sr(()=>this.view?.animation?.state,e=>this._animationStateChange(e)),sr(()=>this.location,e=>this._locationChange(e)),sr(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),sr(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),sr(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),sr(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",e=>Qni({event:e,view:this.view})),Yg(()=>!this.waitingForResult,()=>this._waitingForResultChange(),qu),sr(()=>[this.features,this.view?.map,this.view?.spatialReference],()=>this._updateFeatureVMs()),sr(()=>this.view?.scale,()=>this._viewScaleChange()),Yg(()=>!this.visible,()=>this.browseClusterEnabled=!1),sr(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelFetchingFeatures(),this._handles.destroy(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new YY;e.removeAll();const{actions:i,defaultActions:r,defaultPopupTemplateEnabled:n,includeDefaultActions:s,selectedFeature:o}=this,a=s?r.concat(i):i,l=o&&(typeof o.getEffectivePopupTemplate=="function"&&o.getEffectivePopupTemplate(n)||o.popupTemplate),c=l&&l.actions,h=l&&l.overwriteActions?c:c?c.concat(a):a;return h&&h.filter(Boolean).forEach(p=>e.add(p)),e}get defaultActions(){const e=this._get("defaultActions")||new YY;return e.removeAll(),e.addMany(pN(this.selectedFeature)?ksi():Nsi()),e}get featureCount(){return this.features.length}get features(){return this._get("features")||[]}set features(e){const i=e||[];this._set("features",i);const{pendingPromisesCount:r,promiseCount:n,selectedFeatureIndex:s}=this,o=n&&i.length;o&&r&&s===-1?this.selectedFeatureIndex=0:o&&s!==-1||(this.selectedFeatureIndex=i.length?0:-1)}get location(){return this._get("location")||null}set location(e){let i=e;const r=this.view?.spatialReference?.isWebMercator;e&&e?.spatialReference?.isWGS84&&r&&(i=Q3(e)),this._set("location",i)}get pendingPromisesCount(){return this._pendingPromises.size}get waitingForResult(){return!(!(this._fetchFeaturesController||this.pendingPromisesCount>0)||this.featureCount!==0)}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){if(this._pendingPromises.clear(),this.features=[],!Array.isArray(e)||!e.length)return this._set("promises",[]),void this.notifyChange("pendingPromisesCount");this._set("promises",e),(e=e.slice(0)).forEach(i=>{this._pendingPromises.add(i);const r=s=>{this._pendingPromises.has(i)&&this._updateFeatures(s),this._updatePendingPromises(i)},n=()=>this._updatePendingPromises(i);i.then(r,n)}),this.notifyChange("pendingPromisesCount")}get selectedFeature(){const{features:e,selectedFeatureIndex:i}=this;return i===-1?null:e[i]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return typeof e=="number"?e:-1}set selectedFeatureIndex(e){const{featureCount:i}=this;e=isNaN(e)||e<-1||!i?-1:(e+i)%i,this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get state(){return this.get("view.ready")?"ready":"disabled"}centerAtLocation(){const{view:e}=this,i=Ott(this);return i&&e?this.callGoTo({target:{target:i,scale:e.scale}}):Promise.reject(new st("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:i,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,i){const{view:r}=this;if(!r||!e)throw new st("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:r});return r.fetchPopupFeatures(e,{event:i&&i.event,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:i&&i.signal})}open(e){const i={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:r}=i;delete i.fetchFeatures,r&&this._setFetchFeaturesPromises(i.location);const n=["actionsMenuOpen","collapsed","featureMenuOpen"];for(const s of n)delete i[s];this.set(i)}triggerAction(e){const i=this.allActions.getItemAt(e);i&&!i.disabled&&this.emit("trigger-action",{action:i})}next(){return this.selectedFeatureIndex=this.selectedFeatureIndex+1,this}previous(){return this.selectedFeatureIndex=this.selectedFeatureIndex-1,this}disableClusterBrowsing(){ssi(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:i}=this;e?.type==="2d"?pN(i)?(await rsi(this),await nsi(this)):Oi.getLogger(this.declaredClass).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",i):Oi.getLogger(this.declaredClass).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",i)}_animationStateChange(e){this.zoomToLocation||(dN.disabled=e==="waiting-for-target")}_clearBrowsedClusterGraphics(){const e=this.view?.graphics;e&&(e.remove(this.selectedClusterBoundaryFeature),this._selectedClusterFeature&&e.remove(this._selectedClusterFeature)),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(pN(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:i,updateLocationEnabled:r}=this;r&&e&&(!i||i.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:i,featurePage:r,featuresPerPage:n,featureViewModels:s}=this;if(r===null)return;const o=((r-1)*n+i)%i,a=o+n;s.slice(o,a).forEach((l,c)=>{l&&!l.graphic&&(l.graphic=e[o+c])})}async _selectedFeatureChange(e){const{location:i,updateLocationEnabled:r,view:n}=this;if(e&&n){if(this.browseClusterEnabled)return this._selectedClusterFeature&&(n.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),pN(e)?void 0:(e.symbol=await Csi(e),this._selectedClusterFeature=e,void n.graphics.add(this._selectedClusterFeature));!r&&i||!e.geometry?r&&!e.geometry&&this.centerAtLocation().then(()=>{const s=n.center?.clone();s&&(this.location=s)}):this.location=Rtt(e.geometry)}}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}_setFetchFeaturesPromises(e){return this._fetchFeaturesWithController(this._getScreenPoint(e||this.location)).then(i=>{const{clientOnlyGraphics:r,promisesPerLayerView:n}=i,s=Promise.resolve(r),o=n.map(a=>a.promise);this.promises=[s,...o]})}_destroyFeatureVMs(){this.featureViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:i,featureViewModels:r}=this;if(pN(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!i||!i.length)return;const n=r.slice(0),s=[];i.forEach((o,a)=>{if(!o)return;let l=null;if(n.some((c,h)=>(c&&c.graphic===o&&(l=c,n.splice(h,1)),!!l)),l)s[a]=l;else{const c=new cIe({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:this.view?.spatialReference,graphic:o===e?o:null,map:this.view?.map,view:this.view});s[a]=c}}),n.forEach(o=>o&&!o.destroyed&&o.destroy()),this._set("featureViewModels",s)}_getScreenPoint(e){const{view:i}=this;return i&&e&&typeof i.toScreen=="function"?i.toScreen(e):null}_autoOpenEnabledChange(){const e="auto-fetch-features",{_handles:i,autoOpenEnabled:r}=this;if(i.remove(e),r&&this.view){const n=this.view.on("click",s=>{s.pointerType==="mouse"&&s.button!==0||this._fetchFeaturesAndOpen(s)},yT.WIDGET);i.add(n,e)}}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null,this.notifyChange("waitingForResult")}_fetchFeaturesWithController(e,i){this._cancelFetchingFeatures();const r=new AbortController,{signal:n}=r;this._fetchFeaturesController=r,this.notifyChange("waitingForResult");const s=this.fetchFeatures(e,{signal:n,event:i});return s.catch(()=>{}).then(()=>{this._fetchFeaturesController=null,this.notifyChange("waitingForResult")}),s}_fetchFeaturesAndOpen(e){const{screenPoint:i,mapPoint:r}=e,{view:n}=this;this._fetchFeaturesWithController(i,e).then(s=>{const{clientOnlyGraphics:o,promisesPerLayerView:a,location:l}=s,c=[Promise.resolve(o),...a.map(h=>h.promise)];return n?.popup?.open({location:l||r,promises:c}),s})}_updatePendingPromises(e){e&&this._pendingPromises.has(e)&&(this._pendingPromises.delete(e),this.notifyChange("pendingPromisesCount"))}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,i){return await e.when(),e.whenLayerView(i)}_getHighlightLayer(e){const{layer:i,sourceLayer:r}=e;return r&&"layer"in r&&r.layer?r.layer:r?.type==="map-notes"||r?.type==="subtype-group"?r:i}_getHighlightTarget(e,i){const r=i.type==="imagery"?void 0:"objectIdField"in i?i.objectIdField||osi:null,n=e.attributes;return n&&r&&n[r]||e}async _highlightActiveFeature(){const e="highlight-active-feature";this._handles.remove(e);const{highlightEnabled:i,view:r,activeFeature:n,visible:s}=this;if(!(n&&r&&i&&s))return;const o=this._getHighlightLayer(n);if(!(o&&o instanceof du))return;const a=this._getLayerView(r,o);this._highlightActiveFeaturePromise=a;const l=await a;if(!(l&&Htt(l)&&this._highlightActiveFeaturePromise===a&&this.activeFeature&&this.highlightEnabled))return;const c=l.highlight(this._getHighlightTarget(n,o));this._handles.add(c,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this._handles.remove(e);const{selectedFeature:i,highlightEnabled:r,view:n,visible:s}=this;if(!(i&&n&&r&&s))return;const o=this._getHighlightLayer(i);if(!(o&&o instanceof du))return;const a=this._getLayerView(n,o);this._highlightSelectedFeaturePromise=a;const l=await a;if(!(l&&Htt(l)&&this._highlightSelectedFeaturePromise===a&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const c=l.highlight(this._getHighlightTarget(i,o));this._handles.add(c,e)}_updateFeatures(e){const{features:i}=this;if(!e||!e.length)return;if(!i.length)return void(this.features=e);const r=e.filter(n=>!i.includes(n));this.features=i.concat(r)}};E([N()],Hl.prototype,"featurePage",void 0),E([N()],Hl.prototype,"isLoadingFeature",null),E([N({type:YY})],Hl.prototype,"actions",void 0),E([N({readOnly:!0})],Hl.prototype,"active",null),E([N()],Hl.prototype,"activeFeature",void 0),E([N({readOnly:!0})],Hl.prototype,"allActions",null),E([N({type:Boolean})],Hl.prototype,"defaultPopupTemplateEnabled",void 0),E([N()],Hl.prototype,"autoCloseEnabled",void 0),E([N()],Hl.prototype,"autoOpenEnabled",void 0),E([N()],Hl.prototype,"browseClusterEnabled",void 0),E([N()],Hl.prototype,"content",void 0),E([N({type:YY,readOnly:!0})],Hl.prototype,"defaultActions",null),E([N({readOnly:!0})],Hl.prototype,"featureCount",null),E([N()],Hl.prototype,"features",null),E([N()],Hl.prototype,"featuresPerPage",void 0),E([N()],Hl.prototype,"featureViewModelAbilities",void 0),E([N({readOnly:!0})],Hl.prototype,"featureViewModels",void 0),E([N()],Hl.prototype,"highlightEnabled",void 0),E([N()],Hl.prototype,"includeDefaultActions",void 0),E([N({type:er})],Hl.prototype,"location",null),E([N({readOnly:!0})],Hl.prototype,"pendingPromisesCount",null),E([N({readOnly:!0})],Hl.prototype,"selectedClusterBoundaryFeature",void 0),E([N({readOnly:!0})],Hl.prototype,"waitingForResult",null),E([N({readOnly:!0})],Hl.prototype,"promiseCount",null),E([N()],Hl.prototype,"promises",null),E([N({value:null,readOnly:!0})],Hl.prototype,"selectedFeature",null),E([N({value:-1})],Hl.prototype,"selectedFeatureIndex",null),E([N({readOnly:!0})],Hl.prototype,"selectedFeatureViewModel",null),E([N({readOnly:!0})],Hl.prototype,"state",null),E([N()],Hl.prototype,"title",void 0),E([N()],Hl.prototype,"updateLocationEnabled",void 0),E([N()],Hl.prototype,"view",void 0),E([N()],Hl.prototype,"visible",void 0),E([N()],Hl.prototype,"zoomFactor",void 0),E([N()],Hl.prototype,"zoomToLocation",void 0),E([N()],Hl.prototype,"centerAtLocation",null),Hl=E([dt("esri.widgets.Popup.PopupViewModel")],Hl);const qtt=Hl,Ytt="selected-index",$si=0,Xtt="popup-spinner",Ktt={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},Jtt="esri-popup";function ZA(t,e){return e===void 0?`${Jtt}__${t}`:`${Jtt}__${t}-${e}`}const Ztt={closeButton:!0,featureNavigation:!0};let _o=class extends Stt(Hf){constructor(e,i){super(e,i),this._blurClose=!1,this._blurContainer=!1,this._containerNode=null,this._mainContainerNode=null,this._featureMenuNode=null,this._actionsMenuNode=null,this._focusClose=!1,this._focusContainer=!1,this._focusDockButton=!1,this._focusFeatureMenuButton=!1,this._focusActionsMenuButton=!1,this._focusFirstFeature=!1,this._focusFirstAction=!1,this._handles=new df,this._pointerOffsetInPx=16,this._spinner=null,this._feature=null,this._featureMenuIntersectionObserverNode=null,this._featureMenuViewportNode=null,this._rootFlowItemNode=null,this._featureMenuIntersectionObserverCallback=([r])=>{r?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._displaySpinnerThrottled=nN(()=>this._displaySpinner(),$si),this._exitRelatedRecordsActions=new WeakMap,this._featureSelectionActions=new WeakMap,this._flowItems=new Sr,this.alignment="auto",this.collapsed=!1,this.collapseEnabled=!0,this.dockEnabled=!1,this.featureMenuOpen=!1,this.headingLevel=2,this.maxInlineActions=3,this.messages=null,this.messagesCommon=null,this.spinnerEnabled=!0,this.viewModel=new qtt,this.visibleElements={...Ztt},this._handleOpenRelatedFeature=r=>{this._openRelatedFeature(r)},this._addSelectedFeatureIndexHandle(),this.addHandles([sr(()=>this.viewModel?.screenLocation,()=>this._positionContainer()),sr(()=>[this.viewModel?.active,this.dockEnabled],()=>this._toggleScreenLocationEnabled()),sr(()=>this.viewModel?.screenLocation,(r,n)=>{!!r!=!!n&&this.reposition()}),sr(()=>[this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment],()=>this.reposition()),sr(()=>this.spinnerEnabled,r=>this._spinnerEnabledChange(r)),sr(()=>this.viewModel?.view?.size,(r,n)=>this._updateDockEnabledForViewSize(r,n)),sr(()=>this.viewModel?.view,(r,n)=>this._viewChange(r,n)),sr(()=>this.viewModel?.view?.ready,(r,n)=>this._viewReadyChange(r??!1,n??!1)),sr(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),sr(()=>this.selectedFeatureWidget,()=>this._destroyFlowItemWidgets()),sr(()=>[this.selectedFeatureWidget?.viewModel?.title,this.selectedFeatureWidget?.viewModel?.state],()=>this._setTitleFromFeatureWidget()),sr(()=>[this.selectedFeatureWidget?.viewModel?.content,this.selectedFeatureWidget?.viewModel?.state],()=>this._setContentFromFeatureWidget()),Yg(()=>!this.collapsed,()=>{this.viewModel?.view?.widthBreakpoint==="xsmall"&&this.viewModel.active&&this.collapseEnabled&&this.viewModel.centerAtLocation()}),Wu(()=>this.viewModel?.allActions,"change",()=>this._watchActions()),sr(()=>this.viewModel?.allActions,()=>this._watchActions(),Yo),sr(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),Wu(()=>this._flowItems,"change",()=>{this.notifyChange("_activeFlowItemWidget"),this.scheduleRender()}),sr(()=>[this._activeFlowItemWidget?.viewModel?.state,this._activeFlowItemWidget?.viewModel?.title],()=>this.scheduleRender())])}loadDependencies(){return Promise.all([Promise.resolve().then(()=>zKi),Promise.resolve().then(()=>sZi),Promise.resolve().then(()=>oZi),Promise.resolve().then(()=>aZi),Promise.resolve().then(()=>TLe)])}destroy(){this._destroyFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._handles?.destroy(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect()}get actionsMenuId(){return`${this.id}-actions-menu`}get actionsMenuButtonId(){return`${this.id}-actions-menu-button`}get featureMenuId(){return`${this.id}-feature-menu`}get titleId(){return`${this.id}-popup-title`}get contentId(){return`${this.id}-popup-content`}get hasContent(){const{selectedFeatureWidget:e,viewModel:i}=this;if(!e)return!!i?.content;const r=e.viewModel;if(r?.waitingForContent||r?.state==="error")return!0;const n=r?.content;return Array.isArray(n)?!!n.length:!!n}get featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation!=null}get collapsible(){return!!(this.collapseEnabled&&this.viewModel.title&&this.hasContent)}get featureMenuVisible(){return this.featureNavigationVisible&&this.featureMenuOpen}get contentCollapsed(){return this.collapsible&&!this.featureMenuVisible&&this.collapsed}get dividedActions(){return this._divideActions()}get _activeFlowItemWidget(){const{_flowItems:e}=this;return e.getItemAt(e.length-1)||null}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}set actionsMenuOpen(e){this._set("actionsMenuOpen",!!e)}get actionsMenuOpen(){return!!this.viewModel.active&&this._get("actionsMenuOpen")}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=e}get autoOpenEnabled(){return this.viewModel.autoOpenEnabled}set autoOpenEnabled(e){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 currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||Ktt}set dockOptions(e){const i={...Ktt},r=this.viewModel?.view?.breakpoints,n={};r&&(n.width=r.xsmall,n.height=r.xsmall);const s={...i,...e},o={...i.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 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(){const{_feature:e,visibleElements:i,headingLevel:r,_flowItems:n}=this,{selectedFeatureViewModel:s}=this.viewModel,o={...i,title:!1};return s?(e?(e.viewModel=s,e.visibleElements=o):this._feature=new Xni({flowItems:n,headingLevel:r+1,viewModel:s,visibleElements:o}),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}castVisibleElements(e){return{...Ztt,...e}}blur(){const{active:e}=this.viewModel;e||Oi.getLogger(this.declaredClass).warn("Popup can only be blurred when currently active."),this.visibleElements.closeButton?this._blurClose=!0:this._blurContainer=!0,this.scheduleRender()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,i){return this.viewModel.fetchFeatures(e,i)}focus(){const{active:e}=this.viewModel;e||Oi.getLogger(this.declaredClass).warn("Popup can only be focused when currently active."),this.visibleElements.closeButton?this._focusClose=!0:this._focusContainer=!0,this.scheduleRender()}next(){return this.viewModel.next()}open(e){this._handles.remove(Ytt);const i=!!e&&!!e.featureMenuOpen,r=!!e&&!!e.actionsMenuOpen,n={collapsed:!!e&&!!e.collapsed,actionsMenuOpen:r,featureMenuOpen:i};this.viewModel?.view?.widthBreakpoint==="xsmall"&&(n.collapsed=!0),this.set(n),this.viewModel.open(e),this._shouldFocus(e),this._addSelectedFeatureIndexHandle()}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){const{actionsMenuOpen:e,dockEnabled:i,featureMenuVisible:r,dividedActions:n,currentAlignment:s,currentDockPosition:o}=this,{active:a}=this.viewModel,{menuActions:l}=n,c=a&&l.length>1&&e,h=a&&i,p=a&&!i,y=this.selectedFeature?.layer?.title,v=this.selectedFeature?.layer?.id,x={[sn.alignTopCenter]:s==="top-center",[sn.alignBottomCenter]:s==="bottom-center",[sn.alignTopLeft]:s==="top-left",[sn.alignBottomLeft]:s==="bottom-left",[sn.alignTopRight]:s==="top-right",[sn.alignBottomRight]:s==="bottom-right",[sn.isDocked]:h,[sn.shadow]:p,[sn.isDockedTopLeft]:o==="top-left",[sn.isDockedTopCenter]:o==="top-center",[sn.isDockedTopRight]:o==="top-right",[sn.isDockedBottomLeft]:o==="bottom-left",[sn.isDockedBottomCenter]:o==="bottom-center",[sn.isDockedBottomRight]:o==="bottom-right",[sn.isFeatureMenuOpen]:r,[sn.isActionsMenuOpen]:c};return Gi("div",{class:this.classes(sn.base,x),role:"presentation","data-layer-title":y,"data-layer-id":v,bind:this,afterCreate:this._positionContainer,afterUpdate:this._positionContainer},a?[this.renderMainContainer(),this.renderPointer()]:null)}renderLoadingIcon(){return Gi("span",{"aria-hidden":"true",class:this.classes(sn.icon,sn.iconLoading,sn.rotating)})}renderNavigationLoading(){const{messagesCommon:e}=this;return this.viewModel.pendingPromisesCount?Gi("div",{key:ZA("loading-container"),role:"presentation",class:sn.loadingContainer,"aria-label":e.loading,title:e.loading},this.renderLoadingIcon()):null}renderPreviousIcon(){const e=pT(this.container),i={[sn.iconRightTriangleArrow]:e,[sn.paginationPreviousIconRTL]:e,[sn.iconLeftTriangleArrow]:!e,[sn.paginationPreviousIconLTR]:!e};return Gi("span",{"aria-hidden":"true",class:this.classes(sn.icon,i)})}renderPreviousButton(){const{messages:e}=this;return Gi("div",{role:"button",tabIndex:0,bind:this,onclick:this._previous,onkeydown:this._previous,class:this.classes(sn.button,sn.paginationPrevious),"aria-label":e.previous,title:e.previous},this.renderPreviousIcon())}renderNextIcon(){const e=pT(this.container),i={[sn.iconLeftTriangleArrow]:e,[sn.paginationNextIconRTL]:e,[sn.iconRightTriangleArrow]:!e,[sn.paginationNextIconLTR]:!e};return Gi("span",{"aria-hidden":"true",class:this.classes(sn.icon,i)})}renderNextButton(){const{messages:e}=this;return Gi("div",{role:"button",tabIndex:0,bind:this,onclick:this._next,onkeydown:this._next,class:this.classes(sn.button,sn.paginationNext),"aria-label":e.next,title:e.next},this.renderNextIcon())}renderFeatureMenuButton(){const{featureMenuOpen:e,featureMenuId:i,messagesCommon:r}=this,{featureCount:n,selectedFeatureIndex:s}=this.viewModel;return Gi("div",{role:"button",tabIndex:0,bind:this,onclick:this._toggleFeatureMenu,onkeydown:this._toggleFeatureMenu,afterCreate:this._focusFeatureMenuButtonNode,afterUpdate:this._focusFeatureMenuButtonNode,class:this.classes(sn.button,sn.featureMenuButton),"aria-haspopup":"true","aria-controls":i,"aria-expanded":e.toString(),"aria-label":r.menu,title:r.menu},this._getPageText(n,s))}renderNavigationButtons(){return this.featureNavigationVisible?[this.renderPreviousButton(),this.renderNavigationLoading()||this.renderFeatureMenuButton(),this.renderNextButton()]:[]}renderDockIcon(){const{dockEnabled:e}=this,i=this._wouldDockTo(),r={[sn.iconUndock]:e,[sn.iconDock]:!e,[sn.iconDockToRight]:!e&&(i==="top-right"||i==="bottom-right"),[sn.iconDockToLeft]:!e&&(i==="top-left"||i==="bottom-left"),[sn.iconDockToTop]:!e&&i==="top-center",[sn.iconDockToBottom]:!e&&i==="bottom-center"};return Gi("span",{"aria-hidden":"true",class:this.classes(r,sn.icon)})}renderDockButton(){const{dockEnabled:e,messages:i}=this,r=this.viewModel?.view?.widthBreakpoint,n=e?i.undock:i.dock;return r!=="xsmall"&&this.dockOptions?.buttonEnabled?Gi("div",{role:"button","aria-label":n,title:n,tabIndex:0,bind:this,onclick:this._toggleDockEnabled,onkeydown:this._toggleDockEnabled,afterCreate:this._focusDockButtonNode,afterUpdate:this._focusDockButtonNode,class:this.classes(sn.button,sn.buttonDock)},this.renderDockIcon()):null}renderTitle(){const{title:e}=this.viewModel,{titleId:i,collapsible:r,contentCollapsed:n,messagesCommon:s}=this,o={[sn.headerContainerButton]:r},a=Gi(mle,{level:this.headingLevel,class:sn.headerTitle,innerHTML:e??""}),l=r?Gi("button",{key:`${e}--collapsible`,id:i,title:n?s.expand:s.collapse,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(sn.headerContainer,o),"aria-expanded":n?"false":"true",onclick:this._toggleCollapsed,type:"button"},a,Gi("calcite-icon",{class:sn.collapseIcon,key:"collapse-icon",icon:n?"chevron-down":"chevron-up",scale:"m"})):Gi("div",{key:e??"title",id:i,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(sn.headerContainer,o)},a);return e?l:null}renderCloseIcon(){return Gi("span",{"aria-hidden":"true",class:this.classes(sn.icon,sn.iconClose)})}renderCloseButton(){const{visibleElements:e,messagesCommon:i}=this;return e.closeButton?Gi("div",{role:"button",tabIndex:0,bind:this,onclick:this._close,onkeydown:this._close,class:sn.button,"aria-label":i.close,title:i.close,afterCreate:this._closeButtonNodeUpdated,afterUpdate:this._closeButtonNodeUpdated},this.renderCloseIcon()):null}renderHeader(){return Gi("header",{class:sn.header},this.renderTitle(),Gi("div",{class:sn.headerButtons},this.renderDockButton(),this.renderCloseButton()))}renderContentContainer(){const{contentId:e,hasContent:i,contentCollapsed:r,_flowItems:n}=this,{content:s}=this.viewModel,o=n.toArray(),a={[sn.contentHasFlows]:!!o.length};return i&&!r?Gi("div",{key:s??"content",enterAnimation:this._createFeatureUpdatedAnimation(),id:e,class:this.classes(sn.content,a)},Gi("calcite-flow",{bind:this},Gi("calcite-flow-item",{bind:this,"data-node-ref":"_rootFlowItemNode",afterCreate:BB,key:"root-flow-item",onCalciteFlowItemBack:this._handleBackClick},this.renderContent()),o.map(l=>this.renderFlowItem(l))),o.map(l=>this.renderFlowItemTooltips(l))):null}renderFlowItem(e){const{messages:i}=this,r=vle(),n="graphic"in e&&!e.isTable;return Gi("calcite-flow-item",{bind:this,class:this.classes({[sn.calciteThemeDark]:!r,[sn.calciteThemeLight]:r}),heading:e.title??"",description:this._getFlowItemDescription(e),onCalciteFlowItemBack:this._handleBackClick,key:`flow-item-${e.viewModel.uid}`},Gi("calcite-action",{class:sn.actionExit,icon:"move-up",label:i?.exitRelatedRecords,text:i?.exitRelatedRecords,slot:"header-actions-start",bind:this,afterCreate:s=>this._storeExitRelatedRecordsAction(e,s),onclick:this._destroyFlowItemWidgets}),n?Gi("calcite-action",{class:sn.actionSelectFeature,icon:"zoom-to-object",label:i?.selectFeature,text:i?.selectFeature,slot:"header-actions-end",bind:this,afterCreate:s=>this._storeFeatureSelectionAction(e,s),onclick:()=>this._handleOpenRelatedFeature(e)}):null,Gi("div",{class:this.classes(sn.contentFlowItem,{[sn.calciteThemeDark]:r,[sn.calciteThemeLight]:!r})},e.render()))}renderFlowItemTooltips(e){const{messages:i,_exitRelatedRecordsActions:r,_featureSelectionActions:n}=this,s=vle(),o=n.get(e);return[Gi("calcite-tooltip",{class:this.classes({[sn.calciteThemeDark]:!s,[sn.calciteThemeLight]:s}),key:`exit-related-records-tooltip-${e.viewModel.uid}`,label:i?.exitRelatedRecords,overlayPositioning:"fixed",referenceElement:r.get(e),placement:"top"},i?.exitRelatedRecords),o?Gi("calcite-tooltip",{class:this.classes({[sn.calciteThemeDark]:!s,[sn.calciteThemeLight]:s}),key:`select-related-record-tooltip-${e.viewModel.uid}`,label:i?.selectFeature,overlayPositioning:"fixed",referenceElement:o,placement:"top"},i?.selectFeature):null]}renderActionsMenuButton(){const{actionsMenuId:e,actionsMenuButtonId:i,actionsMenuOpen:r,dividedActions:n,messagesCommon:s}=this,o=r?s.close:s.open,{menuActions:a}=n;return a.length?Gi("div",{key:ZA("actions-menu-button"),class:this.classes(sn.button,sn.actionsMenuButton),role:"button",id:i,"aria-haspopup":"true","aria-controls":r?e:null,tabIndex:0,bind:this,onclick:this._toggleActionsMenu,onkeydown:this._toggleActionsMenu,afterCreate:this._focusActionsMenuButtonNode,afterUpdate:this._focusActionsMenuButtonNode,"aria-label":o,title:o},Gi("span",{"aria-hidden":"true",class:sn.iconActionsMenu})):null}renderMenuActions(){const{actionsMenuId:e,actionsMenuButtonId:i,actionsMenuOpen:r,dividedActions:n}=this,{menuActions:s}=n;return s.length&&r?Gi("ul",{id:e,role:"menu","aria-labelledby":i,key:ZA("actions"),class:sn.actions,bind:this,onkeyup:this._handleActionMenuKeyup,afterCreate:this._actionsMenuNodeUpdated,afterUpdate:this._actionsMenuNodeUpdated},s.toArray().map(o=>this.renderAction({action:o,type:"menu-item"}))):null}renderInlineActions(){const{inlineActions:e}=this.dividedActions;return e.length?e.toArray().map(i=>this.renderAction({action:i,type:"inline"})):[]}renderInlineActionsContainer(){const{inlineActions:e,menuActions:i}=this.dividedActions,r=!!e.length,n=!!i.length;return r||n?Gi("div",{key:"inline-actions-container","data-inline-actions":r.toString(),"data-menu-actions":n.toString(),class:sn.inlineActionsContainer},this.renderInlineActions(),this.renderActionsMenuButton(),this.renderMenuActions()):null}renderNavigation(){return this.featureNavigationVisible?Gi("section",{key:ZA("navigation"),class:this.classes(sn.navigation)},this.renderNavigationButtons()):null}renderFooter(){const{featureNavigationVisible:e,dividedActions:i}=this,{inlineActions:r,menuActions:n}=i,s=!!r.length,o=!!n.length,a={[sn.footerHasPagination]:e,[sn.footerHasActions]:s,[sn.footerHasActionsMenu]:o};return e||s?Gi("div",{key:ZA("feature-buttons"),class:this.classes(sn.footer,a)},this.renderInlineActionsContainer(),this.renderNavigation()):null}renderFeatureMenuContainer(){const{messages:e}=this,{featureViewModels:i,isLoadingFeature:r}=this.viewModel,n=f2(e.selectedFeatures,{total:i.length});return Gi("section",{key:ZA("menu"),class:sn.featureMenu},Gi("strong",{class:sn.featureMenuHeader},n),Gi("nav",{bind:this,class:sn.featureMenuViewport,"data-node-ref":"_featureMenuViewportNode",afterCreate:BB},this.renderFeatureMenu(),Gi("div",{class:sn.featureMenuObserver,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),r?Gi("div",{class:sn.featureMenuLoader},this.renderLoadingIcon()):null))}renderPointer(){return this.dockEnabled?null:Gi("div",{key:ZA("pointer"),class:sn.pointer,role:"presentation"},Gi("div",{class:this.classes(sn.pointerDirection,sn.shadow)}))}renderMainContainer(){const{dockEnabled:e,currentAlignment:i,currentDockPosition:r,titleId:n,contentId:s,collapsible:o,hasContent:a,contentCollapsed:l,visibleElements:c}=this,{title:h}=this.viewModel,p=i==="bottom-left"||i==="bottom-center"||i==="bottom-right"||r==="top-left"||r==="top-center"||r==="top-right",y=i==="top-left"||i==="top-center"||i==="top-right"||r==="bottom-left"||r==="bottom-center"||r==="bottom-right",v={[sn.shadow]:e,[sn.isCollapsible]:o,[sn.isCollapsed]:l};return Gi("div",{class:this.classes(sn.main,sn.widget,v),tabIndex:c.closeButton?void 0:-1,role:"dialog","aria-labelledby":h?n:"","aria-describedby":a&&!l?s:"",bind:this,onkeyup:this._handleMainKeyup,afterCreate:this._mainContainerNodeUpdated,afterUpdate:this._mainContainerNodeUpdated},p?this.renderFooter():null,p?this.renderFeatureMenuContainer():null,this.renderHeader(),this.renderContentContainer(),y?this.renderFooter():null,y?this.renderFeatureMenuContainer():null)}renderContent(){const e=this.viewModel?.content;return e?typeof e=="string"?Gi("div",{class:Hd.contentNode,key:e,innerHTML:e}):this.renderNodeContent(e):null}renderActionText(e){return Gi("span",{key:"text",class:sn.actionText},e)}renderActionIcon(e){const i=this._getActionClass(e),r=this._getActionImage(e),n={[sn.iconLoading]:e.active,[sn.rotating]:e.active,[sn.icon]:!!i,[sn.actionImage]:!e.active&&!!r};return i&&(n[i]=!e.active),Gi("span",{key:"icon","aria-hidden":"true",class:this.classes(sn.icon,n),styles:this._getIconStyles(r)})}renderAction(e){const{action:i,type:r}=e,n=this._getActionTitle(i),s={[sn.action]:i.type!=="toggle",[sn.actionToggle]:i.type==="toggle",[sn.actionToggleOn]:i.type==="toggle"&&i.value,[sn.buttonDisabled]:i.disabled},o=[this.renderActionIcon(i),this.renderActionText(n)],a=r==="menu-item"?Gi("li",{key:i.uid,role:"menuitem",tabIndex:0,title:n,"aria-label":n,class:this.classes(sn.button,s),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":i.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},o):Gi("div",{key:i.uid,role:"button",tabIndex:0,title:n,"aria-label":n,class:this.classes(sn.button,s),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":i.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},o);return i.visible?a:null}renderFeatureMenuItem(e,i){const{messages:r,messagesCommon:n}=this,{selectedFeatureIndex:s,selectedFeatureViewModel:o}=this.viewModel,a=e===o,l={[sn.featureMenuSelected]:a},c=a?Gi("span",{key:ZA(`feature-menu-selected-feature-${s}`),title:r.selectedFeature,"aria-label":r.selectedFeature,class:sn.iconCheckMark}):null,h=Gi("span",{innerHTML:e.title||n.untitled});return Gi("li",{role:"menuitem",tabIndex:-1,key:ZA(`feature-menu-feature-${s}`),class:this.classes(l,sn.featureMenuItem),bind:this,"data-feature-index":i,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onkeyup:this._handleFeatureMenuItemKeyup,onclick:this._selectFeature,onkeydown:this._selectFeature,onmouseover:this._setActiveFeature,onmouseleave:this._removeActiveFeature},Gi("span",{class:sn.featureMenuTitle},h,c))}renderFeatureMenu(){const{featureMenuId:e}=this,{featureViewModels:i}=this.viewModel;return i.length>1?Gi("ol",{class:sn.featureMenuList,id:e,bind:this,afterCreate:this._featureMenuNodeUpdated,afterUpdate:this._featureMenuNodeUpdated,onkeyup:this._handleFeatureMenuKeyup,role:"menu"},i.filter(r=>!!r.graphic).map((r,n)=>this.renderFeatureMenuItem(r,n))):null}_storeFeatureSelectionAction(e,i){this._featureSelectionActions.set(e,i),this.scheduleRender()}_storeExitRelatedRecordsAction(e,i){this._exitRelatedRecordsActions.set(e,i),this.scheduleRender()}_getFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description??""}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const i=e.graphic,r=i?.geometry;if(lt(r)||lt(i))return;this._destroyFlowItemWidgets(),await this.viewModel.zoomTo({target:r});const n=Rtt(r);this.open({features:[i],location:ve(n)?n:void 0})}_destroyFlowItemWidgets(){this._flowItems.removeAll().forEach(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()})}_handleBackClick(){const e=this._flowItems.pop();e&&(this._exitRelatedRecordsActions.delete(e),this._featureSelectionActions.delete(e),"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_getActionTitle(e){const{messages:i,selectedFeature:r,messagesCommon:n}=this,{id:s}=e,o=r?.attributes,a=e.title??"",l=s==="zoom-to-feature"?f2(a,{messages:i}):s==="remove-selected-feature"?f2(a,{messages:n}):s==="zoom-to-clustered-features"||s==="browse-clustered-features"?f2(a,{messages:i}):e.title;return l&&o?f2(l,o):l??""}_getActionClass(e){const{selectedFeature:i}=this,r=i?.attributes,{className:n,image:s}=e,o=s||n?n:sn.iconDefaultAction;return o&&r?f2(o,r):o??""}_getActionImage(e){const{selectedFeature:i}=this,r=i?.attributes,{image:n}=e;return n&&r?f2(n,r):n??""}_createFeatureUpdatedAnimation(){return gti("enter",sn.hasFeatureUpdated)}_getInlineActionCount(){const{maxInlineActions:e,featureNavigationVisible:i}=this;if(typeof e!="number")return null;const r=Math.round(e);return Math.max(i?r-1:r,0)}_watchActions(){const{allActions:e}=this.viewModel;this.notifyChange("dividedActions");const i="actions";this._handles.remove(i),e&&e.forEach(r=>{this._handles.add(sr(()=>[r.uid,r.active,r.className,r.disabled,r.id,r.title,r.image,r.visible],()=>this.scheduleRender()),i)})}_divideActions(){const{allActions:e}=this.viewModel,i=e.filter(o=>o.visible),r=this._getInlineActionCount(),n=r===null,s=r===0;return{inlineActions:n?i.slice(0):s?new Sr:i.slice(0,r),menuActions:n?new Sr:s?i.slice(0):i.slice(r)}}_featureMenuOpenChanged(e){e?this._focusFirstFeature=!0:this._focusFeatureMenuButton=!0}_actionsMenuOpenChanged(e){e?this._focusFirstAction=!0:this._focusActionsMenuButton=!0}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:i}=this;e&&(this.viewModel.title=e.viewModel?.state==="error"?i.errorMessage:e.viewModel?.title||"")}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_handleFeatureMenuKeyup(e){cL(e)==="Escape"&&(e.stopPropagation(),this._focusFeatureMenuButton=!0,this.featureMenuOpen=!1,this.scheduleRender())}_handleActionMenuKeyup(e){cL(e)==="Escape"&&(e.stopPropagation(),this._focusActionsMenuButton=!0,this.actionsMenuOpen=!1,this.scheduleRender())}_setActiveFeature(e){const{viewModel:i}=this,r=e.currentTarget["data-feature-index"];i.activeFeature=i.features[r]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_handleFeatureMenuItemKeyup(e){const i=cL(e),{_featureMenuNode:r}=this,n=e.currentTarget["data-feature-index"];if(!r)return;const s=r.querySelectorAll("li"),o=s.length;i!=="ArrowUp"?i!=="ArrowDown"?i!=="Home"?i!=="End"||(e.stopPropagation(),s[s.length-1].focus()):(e.stopPropagation(),s[0].focus()):(e.stopPropagation(),s[(n+1+o)%o].focus()):(e.stopPropagation(),s[(n-1+o)%o].focus())}_handleActionMenuItemKeyup(e){const i=cL(e),{_actionsMenuNode:r}=this,n=e.currentTarget.dataset.actionUid,{menuActions:s}=this.dividedActions,o=s.findIndex(c=>c.uid===n);if(!r)return;const a=r.querySelectorAll("li"),l=a.length;i!=="ArrowUp"?i!=="ArrowDown"?i!=="Home"?i!=="End"||(e.stopPropagation(),a[a.length-1].focus()):(e.stopPropagation(),a[0].focus()):(e.stopPropagation(),a[(o+1+l)%l].focus()):(e.stopPropagation(),a[(o-1+l)%l].focus())}_handleMainKeyup(e){const i=cL(e);i==="ArrowLeft"&&(e.stopPropagation(),this.previous()),i==="ArrowRight"&&(e.stopPropagation(),this.next())}_spinnerEnabledChange(e){if(this._destroySpinner(),!e)return;const i=this.get("viewModel.view");this._createSpinner(i)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:i,waitingForResult:r}=this.viewModel;r&&i?e.show({location:i}):e.hide()}_getIconStyles(e){return{"background-image":e?`url(${e})`:""}}async _shouldFocus(e){e?.shouldFocus&&(await N1(()=>this.viewModel?.active===!0),this.focus())}_addSelectedFeatureIndexHandle(){const e=sr(()=>this.viewModel?.selectedFeatureIndex,(i,r)=>this._selectedFeatureIndexUpdated(i,r));this._handles.add(e,Ytt)}_selectedFeatureIndexUpdated(e,i){const{featureCount:r}=this;r&&e!==i&&e!==-1&&(this._destroyFlowItemWidgets(),this.actionsMenuOpen=!1,this.featureMenuOpen=!1,this._mainContainerNode&&(this._mainContainerNode.scrollTop=0),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,e&&!e.destroyed&&e.destroy()),this._feature=null}_isScreenLocationWithinView(e,i){return e.x>-1&&e.y>-1&&e.x<=i.width&&e.y<=i.height}_isOutsideView(e){const{popupHeight:i,popupWidth:r,screenLocation:n,side:s,view:o}=e;if(isNaN(r)||isNaN(i)||!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:i,_containerNode:r,_mainContainerNode:n,viewModel:s}=this,{screenLocation:o,view:a}=s;if(lt(o)||!a||!r)return"top-center";if(!this._isScreenLocationWithinView(o,a))return this._get("currentAlignment")||"top-center";function l(V){return parseInt(V.replace(/[^-\d\.]/g,""),10)}const c=n?window.getComputedStyle(n,null):null,h=c?l(c.getPropertyValue("max-height")):0,p=c?l(c.getPropertyValue("height")):0,{height:y,width:v}=r.getBoundingClientRect(),x=v+i,I=Math.max(y,h,p)+i,P=this._isOutsideView({popupHeight:I,popupWidth:x,screenLocation:o,side:"right",view:a}),F=this._isOutsideView({popupHeight:I,popupWidth:x,screenLocation:o,side:"left",view:a}),k=this._isOutsideView({popupHeight:I,popupWidth:x,screenLocation:o,side:"top",view:a}),j=this._isOutsideView({popupHeight:I,popupWidth:x,screenLocation:o,side:"bottom",view:a});return F?k?"bottom-right":"top-right":P?k?"bottom-left":"top-left":k?j?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(e){return typeof e=="function"?e.call(this):e}_getCurrentAlignment(){const{alignment:e,dockEnabled:i}=this;return i||!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 i=["left","right"];return pT(this.container)&&i.reverse(),e.replace(/leading/gi,i[0]).replace(/trailing/gi,i[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}_wouldDockTo(){return this.dockEnabled?null:this._getDockPosition()}_calculateAutoDockPosition(e){if(e!=="auto")return e;const i=this.viewModel?.view,r=pT(this.container)?"top-left":"top-right";if(!i)return r;const n=i.padding||{left:0,right:0,top:0,bottom:0},s=i.width-n.left-n.right,{breakpoints:o}=i;return o&&s<=o.xsmall?"bottom-center":r}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!this._containerNode)return;const{screenLocation:i}=this.viewModel,{width:r}=this._containerNode.getBoundingClientRect(),n=this._calculatePositionStyle(i,r);n&&Object.assign(this._containerNode.style,n)}_calculateFullWidth(e){const{currentAlignment:i,_pointerOffsetInPx:r}=this;return i==="top-left"||i==="bottom-left"||i==="top-right"||i==="bottom-right"?e+r:e}_calculateAlignmentPosition(e,i,r,n){const{currentAlignment:s,_pointerOffsetInPx:o}=this;if(!r)return;const{padding:a}=r,l=n/2,c=r.height-i,h=r.width-e;return s==="bottom-center"?{top:i+o-a.top,left:e-l-a.left}:s==="top-left"?{bottom:c+o-a.bottom,right:h+o-a.right}:s==="bottom-left"?{top:i+o-a.top,right:h+o-a.right}:s==="top-right"?{bottom:c+o-a.bottom,left:e+o-a.left}:s==="bottom-right"?{top:i+o-a.top,left:e+o-a.left}:s==="top-center"?{bottom:c+o-a.bottom,left:e-l-a.left}:void 0}_calculatePositionStyle(e,i){const{dockEnabled:r,view:n}=this;if(!n)return;if(r)return{left:"",top:"",right:"",bottom:""};if(lt(e)||!i)return;const s=this._calculateFullWidth(i),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,i){e&&i&&(this.close(),this.clear())}_viewReadyChange(e,i){if(e){const r=this.get("viewModel.view");this._wireUpView(r)}else i&&(this.close(),this.clear())}_wireUpView(e){if(this._destroySpinner(),!e)return;const{spinnerEnabled:i}=this;i&&this._createSpinner(e),this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,i,r){const[n,s]=e,[o,a]=i,{width:l=0,height:c=0}=r??{};return n<=l&&o>l||n>l&&o<=l||s<=c&&a>c||s>c&&a<=c}_updateDockEnabledForViewSize(e,i){if(!e||!i)return;const r=this.get("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]=i[0]-n,a[1]=i[1]-s;const{dockOptions:l}=this,c=l.breakpoint;this._dockingThresholdCrossed(o,a,c)&&this._setDockEnabledForViewSize(l),this._setCurrentDockPosition()}_focusDockButtonNode(e){this._focusDockButton&&(this._focusDockButton=!1,e.focus())}_closeButtonNodeUpdated(e){return this._focusClose?(this._focusClose=!1,void e.focus()):this._blurClose?(this._blurClose=!1,void e.blur()):void 0}_mainContainerNodeUpdated(e){return this._mainContainerNode=e,this._focusContainer?(this._focusContainer=!1,void e.focus()):this._blurContainer?(this._blurContainer=!1,void e.blur()):void 0}_featureMenuNodeUpdated(e){if(this._featureMenuNode=e,!e||!this._focusFirstFeature)return;this._focusFirstFeature=!1;const i=e.querySelectorAll("li");i.length&&i[0].focus()}_actionsMenuNodeUpdated(e){if(this._actionsMenuNode=e,!e||!this._focusFirstAction)return;this._focusFirstAction=!1;const i=e.querySelectorAll("li");i.length&&i[0].focus()}_focusFeatureMenuButtonNode(e){this._focusFeatureMenuButton&&(this._focusFeatureMenuButton=!1,e.focus())}_focusActionsMenuButtonNode(e){this._focusActionsMenuButton&&(this._focusActionsMenuButton=!1,e.focus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&(this._featureMenuViewportNode.scrollTop=0)}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:i}=this;if(!i)return;const r=i.active&&!e;i.screenLocationEnabled=r}_shouldDockAtCurrentViewSize(e){const i=e.breakpoint,r=this.viewModel?.view?.ui;if(!r)return!1;const{width:n,height:s}=r;if(isNaN(n)||isNaN(s)||!i)return!1;const o=i.hasOwnProperty("width")&&n<=(i.width??0),a=i.hasOwnProperty("height")&&s<=(i.height??0);return o||a}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}_getPageText(e,i){return this.featureNavigationVisible?f2(this.messages.pageText,{index:i+1,total:e}):null}_destroySpinner(){const{_spinner:e,view:i}=this;e&&(i&&i.ui&&i.ui.remove(e,Xtt),e.destroy(),this._spinner=null)}_createSpinner(e){e&&(this._spinner=new Jni({view:e}),e.ui.add(this._spinner,{key:Xtt,position:"manual"}))}_toggleCollapsed(){this.collapsed=!this.collapsed}_close(){this.close(),this.view&&this.view.focus()}_toggleDockEnabled(){this.dockEnabled=!this.dockEnabled,this._focusDockButton=!0,this.scheduleRender()}_toggleFeatureMenu(){const e=!this.featureMenuOpen;this._featureMenuOpenChanged(e),this.actionsMenuOpen=!1,this.featureMenuOpen=e}_toggleActionsMenu(){const e=!this.actionsMenuOpen;this._actionsMenuOpenChanged(e),this.featureMenuOpen=!1,this.actionsMenuOpen=e}_triggerAction(e){const i=e.currentTarget.dataset.actionUid,{allActions:r}=this.viewModel,n=r.findIndex(o=>o.uid===i),s=r.getItemAt(n);s&&s.type==="toggle"&&(s.value=!s.value),this.actionsMenuOpen=!1,this.viewModel.triggerAction(n)}_selectFeature(e){const i=e.currentTarget["data-feature-index"];isNaN(i)||(this.viewModel.selectedFeatureIndex=i),this.featureMenuOpen=!1,this._focusFeatureMenuButton=!0,this.scheduleRender()}_next(){this.next()}_previous(){this.previous()}};E([N({readOnly:!0})],_o.prototype,"actionsMenuId",null),E([N({readOnly:!0})],_o.prototype,"actionsMenuButtonId",null),E([N({readOnly:!0})],_o.prototype,"featureMenuId",null),E([N({readOnly:!0})],_o.prototype,"titleId",null),E([N({readOnly:!0})],_o.prototype,"contentId",null),E([N({readOnly:!0})],_o.prototype,"hasContent",null),E([N({readOnly:!0})],_o.prototype,"featureNavigationVisible",null),E([N({readOnly:!0})],_o.prototype,"collapsible",null),E([N({readOnly:!0})],_o.prototype,"featureMenuVisible",null),E([N({readOnly:!0})],_o.prototype,"contentCollapsed",null),E([N({readOnly:!0})],_o.prototype,"dividedActions",null),E([N({readOnly:!0,dependsOn:["_flowItems.length"]})],_o.prototype,"_activeFlowItemWidget",null),E([N()],_o.prototype,"actions",null),E([N()],_o.prototype,"actionsMenuOpen",null),E([N()],_o.prototype,"alignment",void 0),E([N()],_o.prototype,"autoCloseEnabled",null),E([N()],_o.prototype,"autoOpenEnabled",null),E([N()],_o.prototype,"defaultPopupTemplateEnabled",null),E([N()],_o.prototype,"content",null),E([N()],_o.prototype,"collapsed",void 0),E([N()],_o.prototype,"collapseEnabled",void 0),E([N({readOnly:!0})],_o.prototype,"currentAlignment",null),E([N({readOnly:!0})],_o.prototype,"currentDockPosition",null),E([N()],_o.prototype,"dockOptions",null),E([N()],_o.prototype,"dockEnabled",void 0),E([N({readOnly:!0})],_o.prototype,"featureCount",null),E([N()],_o.prototype,"featureMenuOpen",void 0),E([N()],_o.prototype,"features",null),E([N()],_o.prototype,"goToOverride",null),E([N()],_o.prototype,"headingLevel",void 0),E([N()],_o.prototype,"highlightEnabled",null),E([N()],_o.prototype,"location",null),E([N()],_o.prototype,"label",null),E([N()],_o.prototype,"maxInlineActions",void 0),E([N(),Wf("esri/widgets/Popup/t9n/Popup")],_o.prototype,"messages",void 0),E([N(),Wf("esri/t9n/common")],_o.prototype,"messagesCommon",void 0),E([N()],_o.prototype,"promises",null),E([N({readOnly:!0})],_o.prototype,"selectedFeature",null),E([N()],_o.prototype,"selectedFeatureIndex",null),E([N({readOnly:!0})],_o.prototype,"selectedFeatureWidget",null),E([N()],_o.prototype,"spinnerEnabled",void 0),E([N()],_o.prototype,"title",null),E([N()],_o.prototype,"updateLocationEnabled",null),E([N()],_o.prototype,"view",null),E([N({type:qtt}),qri(["triggerAction","trigger-action"])],_o.prototype,"viewModel",void 0),E([N()],_o.prototype,"visible",null),E([N()],_o.prototype,"visibleElements",void 0),E([ho("visibleElements")],_o.prototype,"castVisibleElements",null),E([K1()],_o.prototype,"_close",null),E([K1()],_o.prototype,"_toggleDockEnabled",null),E([K1()],_o.prototype,"_toggleFeatureMenu",null),E([K1()],_o.prototype,"_toggleActionsMenu",null),E([K1()],_o.prototype,"_triggerAction",null),E([K1()],_o.prototype,"_selectFeature",null),E([K1()],_o.prototype,"_next",null),E([K1()],_o.prototype,"_previous",null),_o=E([dt("esri.widgets.Popup")],_o);const Qtt=_o,vIe=[0,0];function Bsi(t){const e=(t.ownerDocument||window.document).defaultView,i=t.getBoundingClientRect();return vIe[0]=i.left+(e?.pageXOffset??0),vIe[1]=i.top+(e?.pageYOffset??0),vIe}function eit(t){t&&(eQe(t),t.parentNode&&t.parentNode.removeChild(t))}function Vsi(t){const e=document.createElement("div");return t.appendChild(e),e}const XY=16,Dle=750,jsi=512,Gsi=2,Usi=t=>{let e=class extends t{constructor(...i){super(...i),this._freqInfo={freq:XY,time:Dle},this._overlayRenderTaskHandle=null,this.height=0,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,i.length!==0&&i[0]?.popup!==void 0||(this.popup=new Qtt({view:this})),this.handles.add([sr(()=>this.cursor,r=>{const{surface:n}=this;n&&n.setAttribute("data-cursor",r)}),sr(()=>this.interacting,r=>{const{surface:n}=this;n&&n.setAttribute("data-interacting",r.toString())})])}initialize(){this.handles.add(sr(()=>this.ui,(i,r)=>this._handleUIChange(i,r))),this._wireUI(this.ui),this.handles.add([this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui=da(this.ui),this.popup&&!this.popup.destroyed&&this.popup.destroy(),this.container=null)}get container(){return this._get("container")??null}set container(i){const r=this._get("container"),n=yEe(i);if(n||typeof i!="string"||Oi.getLogger(this.declaredClass).error("#container",`element with id '${i}' not found`),r===n)return;const s="dom-size";if(this.handles.remove(s),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&&(eit(this.root),this._set("root",null)),this.userContent&&(iQe(this.userContent,r),eit(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 o=document.createElement("div");o.className="esri-view-user-storage",iQe(n,o),n.appendChild(o),this._set("userContent",o);const a=document.createElement("div");a.className="esri-view-root",n.insertBefore(a,n.firstChild),this._set("root",a);const l=document.createElement("div");l.className="esri-view-surface",l.setAttribute("role","application"),l.tabIndex=0,a.appendChild(l),this._set("surface",l);const c=new kQe;a.appendChild(c.surface),this._set("overlay",c),sr(()=>c.needsRender,h=>{h&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=dL({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=Uc(this._overlayRenderTaskHandle)}),this.forceDOMReadyCycle(),this.handles.add(sr(()=>this.size,h=>{const[p,y]=h,v="esri-view-surface--inset-outline";p>=document.body.clientWidth||y>=document.body.clientHeight?l.classList.add(v):l.classList.remove(v)},Yo),s),this._set("container",n),this._startMeasuring()}get focused(){const i=document.activeElement===this.surface;return document.hasFocus()&&i}set popup(i){const r=this._get("popup");r&&r!==i&&r.destroy(),this._set("popup",i)}get size(){return[this.width,this.height]}blur(){this.surface&&this.surface.blur()}focus(){this.surface&&this.surface.focus()}pageToContainer(i,r,n){const s=this.position;return i-=s?s[0]:0,r-=s?s[1]:0,n?(n[0]=i,n[1]=r):n=[i,r],n}containerToPage(i,r,n){const s=this.position;return i+=s?s[0]:0,r+=s?s[1]:0,n?(n[0]=i,n[1]=r):n=[i,r],n}_handleUIChange(i,r){r&&(this.handles.remove("ui"),r.destroy()),i&&this._wireUI(i),this._set("ui",i)}_wireUI(i){this.handles.remove("ui"),i&&(i.view=this,this.handles.add([sr(()=>this.root,r=>{i.container=r?Vsi(r):null},Yo),sr(()=>this.popup,(r,n)=>{const s="popup",o="manual";n&&i.remove(n,s),r&&(r.view=i.view,i.add(r,{key:s,position:o}))},Yo)],"ui"))}_stopMeasuring(){this.handles.remove("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const i=this._freqInfo;i.freq=XY,i.time=Dle,this.handles.add([(()=>{const r=()=>{i.freq=XY,i.time=Dle};return window.addEventListener("resize",r),{remove(){window.removeEventListener("resize",r)}}})(),dL({prepare:r=>{const n=this._measure(),s=this._freqInfo;if(s.time+=r.deltaTime,n&&(s.freq=XY,this._get("resizing")||this._set("resizing",!0)),s.time=jsi&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const i=this.container,r=i?i.clientWidth:0,n=i?i.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 i=this.container,r=this.position,n=i&&Bsi(i);return!!n&&(!r||n[0]!==r[0]||n[1]!==r[1])&&(this._set("position",[n[0],n[1]]),!0)}forceDOMReadyCycle(){}};return E([N()],e.prototype,"container",null),E([N({readOnly:!0})],e.prototype,"focused",null),E([N({readOnly:!0})],e.prototype,"height",void 0),E([N({type:Qtt})],e.prototype,"popup",null),E([N({type:kQe})],e.prototype,"overlay",void 0),E([N({readOnly:!0})],e.prototype,"position",void 0),E([N({readOnly:!0})],e.prototype,"resizing",void 0),E([N({readOnly:!0})],e.prototype,"root",void 0),E([N({value:null,readOnly:!0})],e.prototype,"size",null),E([N({readOnly:!0})],e.prototype,"surface",void 0),E([N({readOnly:!0})],e.prototype,"suspended",void 0),E([N()],e.prototype,"ui",void 0),E([N({readOnly:!0})],e.prototype,"userContent",void 0),E([N({readOnly:!0})],e.prototype,"width",void 0),E([N()],e.prototype,"widthBreakpoint",void 0),e=E([dt("esri.views.DOMContainer")],e),e},zsi=t=>{let e=class extends t{async fetchPopupFeatures(i,r){await this.when();const{location:n,queryArea:s,layerViewsAndGraphics:o,clientOnlyGraphics:a}=await this._prepareFetchPopupFeatures(i,r),l=Promise.resolve(a),c=this._queryLayerPopupFeatures(s,o,r),h=c.map(p=>p.promise);return{location:n,clientOnlyGraphics:a,allGraphicsPromise:AH([l,...h]).then(p=>Array.from(new Set(p.flat()))),promisesPerLayerView:c}}_queryLayerPopupFeatures(i,r,n){return r.map(({layerView:s,graphics:o})=>{const a={clientGraphics:o,event:ve(n)?n.event:void 0,signal:ve(n)?n.signal:void 0,defaultPopupTemplateEnabled:!!ve(n)&&!!n.defaultPopupTemplateEnabled},l=s.fetchPopupFeatures(i,a);return{layerView:s,promise:l}})}_isValidPopupGraphic(i,r){return i&&!!i.getEffectivePopupTemplate(ve(r)&&r.defaultPopupTemplateEnabled)}async _prepareFetchPopupFeatures(i,r){const{clientGraphics:n,queryArea:s,location:o}=await this._popupHitTestGraphics(i,r),a=this._getFetchPopupLayerViews(),{layerViewsAndGraphics:l,clientOnlyGraphics:c}=this._graphicsPerFetchPopupLayerView(n,a);return{clientOnlyGraphics:c,layerViewsAndGraphics:l,queryArea:s,location:o}}async _popupHitTestGraphics(i,r){const n=await this.popupHitTest(i),s=n.results,o=n.mapPoint,a=s.filter(c=>c.type==="graphic"&&this._isValidPopupGraphic(c.graphic,r)),l=a.length?a[0].mapPoint:null;return{clientGraphics:a.map(c=>c.graphic),queryArea:o,location:o||l}}_getFetchPopupLayerViews(){const i=[];return this.allLayerViews.forEach(r=>{this._isValidPopupLayerView(r)&&i.push(r)}),ve(this.graphicsView)&&this._isValidPopupLayerView(this.graphicsView)&&i.push(this.graphicsView),i.reverse()}_isValidPopupLayerView(i){return ve(i)&&(!("layer"in i)||!i.suspended)&&"fetchPopupFeatures"in i}_graphicsPerFetchPopupLayerView(i,r){const n=[],s=new Map,o=r.map(a=>{const l=[];return"layer"in a?s.set(a.layer,l):s.set(a.graphics,l),{layerView:a,graphics:l}});for(const a of i){const l=s.get(a.layer)||s.get(a.sourceLayer)||null;l?l.push(a):n.push(a)}return{layerViewsAndGraphics:o,clientOnlyGraphics:n}}};return e=E([dt("esri.views.PopupView")],e),e};let Fle=class extends Jq{constructor(e){super(e),this.handles.add(this.on("before-add",i=>{lt(i.item)||i.item.parent===this.owner&&(Oi.getLogger(this.declaredClass).warn("Analysis inside the collection must be unique. Not adding this element again."),i.preventDefault())}))}_own(e){e.parent=this.owner}_release(e){e.parent=null}};Fle=E([dt("esri.support.AnalysesCollection")],Fle);let bM=class extends Tn{constructor(e){super(e),this.view=null,this.baseLayerViews=new Sr,this.referenceLayerViews=new Sr,this._loadingHandle=sr(()=>this.view?.map?.basemap,i=>{i&&i.load().catch(()=>{})},Yo)}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null)}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(i=>i.updating)||this.referenceLayerViews.some(i=>i.updating))}};E([N({constructOnly:!0})],bM.prototype,"view",void 0),E([N({readOnly:!0})],bM.prototype,"baseLayerViews",void 0),E([N({readOnly:!0})],bM.prototype,"referenceLayerViews",void 0),E([N({readOnly:!0})],bM.prototype,"suspended",null),E([N({type:Boolean,readOnly:!0})],bM.prototype,"updating",null),bM=E([dt("esri.views.BasemapView")],bM);function Hsi(t){return"tryRecycleWith"in t}let Wsi=class{constructor(e,i,r){this.layer=e,this.view=i,this.layerViewImporter=r,this._controller=new AbortController,this._deferred=Kx(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,ap(this._controller.signal,()=>{const n=new st("cancelled:layerview-create","layerview creation cancelled",{layer:e});this._deferred.reject(n)})}tryRecycle(e){if(!this.done||!this.layerView||!Hsi(this.layerView))return null;const i=this.layer.type,r=this._controller.signal;for(let n=0;n(yn(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((c,h)=>ap(this._controller.signal,()=>h(Sc())))]),this.promise}}return null}destroy(){this._controller.abort();const{layerView:e}=this;if(!e)return;const{layer:i,view:r}=this;i.emit("layerview-destroy",{view:r,layerView:e}),r.emit("layerview-destroy",{layer:i,layerView:e}),this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null}async start(){if(this._started)return;this._started=!0;const{_controller:{signal:e},layer:i,view:r}=this;this._map=r.map;try{let n,s;if(await i.load({signal:e}),"prefetchResources"in i&&await i.prefetchResources?.({signal:e}),Ysi(i))n=await i.createLayerView(r,{signal:e});else{if(!this.layerViewImporter.hasLayerViewModule(i))throw new st("layer:view-not-supported","No layerview implementation was found");const l=await this.layerViewImporter.importLayerView(i);yn(e),n="default"in l?new l.default({layer:i,view:r}):new l({layer:i,view:r})}const o=()=>{s=Uc(s),n.destroyed||n.destroy(),n.layer=null,n.parent=null,n.view=null,this.done=!0};s=ap(e,o),yn(e);try{await n.when()}catch(l){throw o(),l}if(!this._map?.allLayers?.includes(i))return o(),void this._deferred.reject(new st("view:no-layerview-for-layer","The layer has been removed from the map",{layer:i}));this.layerView=n,i.emit("layerview-create",{view:r,layerView:n}),r.emit("layerview-create",{layer:i,layerView:n}),this.done=!0,this._deferred.resolve(n)}catch(n){i.emit("layerview-create-error",{view:r,error:n}),r.emit("layerview-create-error",{layer:i,error:n}),this.done=!0,this._deferred.reject(new st("layerview:create-error","layerview creation failed",{layer:i,error:n}))}}},ww=class extends Tn{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new RR,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const i=this.view.map?.allLayers;if(i)for(const r of i)this.layerViewImporter.hasLayerViewModule(r)&&this.layerViewImporter.importLayerView(r)},this._reschedule=()=>(lt(this._workPromise)&&(this._workPromise=Kx(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(V3(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{const i=this.view.map;if(this._map!==i&&(this.clear(),this._map=i),lt(this._workPromise))return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,n=[],s=this.view.ready,o=l=>{if(!lt(l)){for(const c of l)if(c){r.add(c);const h=this._layerLayerViewInfoMap.get(c);h&&s?h.start():h||this._recyclingInfoMap.has(c)||n.push(c),"layers"in c&&c.layers&&o(c.layers)}}};for(const l of this._rootCollectionNames)o(this.get(l));for(const[l,c]of this._layerLayerViewInfoMap)if(!r.has(l)){this._layerLayerViewInfoMap.delete(c.layer);const h=c.tryRecycle(n);h?(this._recyclingInfoMap.set(c.layer,c),h.then(()=>{this._recyclingInfoMap.delete(c.layer),this._layerLayerViewInfoMap.set(c.layer,c),this._reschedule()}).catch(()=>{this._recyclingInfoMap.delete(c.layer),c.destroy(),this._reschedule()})):c.destroy()}for(const[l,c]of this._recyclingInfoMap)r.has(l)||(this._recyclingInfoMap.delete(c.layer),c.destroy());for(const l of n)this._createLayerView(l);this._refreshCollections();const a=[i?.ground?.layers,i?.basemap?.baseLayers,i?.basemap?.referenceLayers,i?.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.own([Wu(()=>this.view?.map?.allLayers,"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),sr(()=>{const e=this.view,i=e?.map;return[i?.basemap,i?.ground,i?.layers,e?.ready]},()=>this._reschedule(),Wh)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),this._watchUpdatingTracking.destroy(),this._map=null,ve(this._workPromise)&&(this._workPromise.reject(Sc()),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 ve(this._workPromise)||this._watchUpdatingTracking.updating||Ure(this._layerLayerViewInfoMap,e=>!e.done)}get updatingRemaining(){let e=0;for(const i of this._layerLayerViewInfoMap.values())i.done||++e;return e}clear(){if(!this.destroyed){for(const e of this._layerLayerViewInfoMap.values())e.destroy();this._layerLayerViewInfoMap.clear(),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 st("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,i]of this._layersToLayerViews)this._populateLayerViewsOwners(this.get(e),this.get(i),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(e,i,r){if(!e||!i)return void(i&&i.removeAll());let n=0;for(const s of e){const o=this._layerLayerViewInfoMap.get(s);if(!o||!o.layerView)continue;const a=o.layerView;a.layer=s,a.parent=r,i.getItemAt(n)!==a&&i.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 i=new Wsi(e,this.view,this.layerViewImporter);i.promise.then(()=>this._refreshCollections(),r=>{r&&(ys(r)||r.name==="cancelled:layerview-create")||Oi.getLogger(this.declaredClass).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,i),this.view.ready&&i.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};E([N()],ww.prototype,"_workPromise",void 0),E([N({readOnly:!0})],ww.prototype,"_watchUpdatingTracking",void 0),E([N({readOnly:!0})],ww.prototype,"_layersToLayerViews",null),E([N({readOnly:!0})],ww.prototype,"_rootCollectionNames",null),E([N()],ww.prototype,"layerViewImporter",void 0),E([N()],ww.prototype,"supportsGround",void 0),E([N({readOnly:!0})],ww.prototype,"updating",null),E([N({readOnly:!0})],ww.prototype,"updatingRemaining",null),E([N({constructOnly:!0})],ww.prototype,"view",void 0),ww=E([dt("esri.views.LayerViewManager")],ww);const qsi=ww;function Ysi(t){return"createLayerView"in t&&t.createLayerView!=null}let Q1=class extends Tn{constructor(e){super(e),this.factor=1.5,this.offset=zh(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}};E([N({type:Number})],Q1.prototype,"factor",void 0),E([N({nonNullable:!0})],Q1.prototype,"offset",void 0),E([N()],Q1.prototype,"position",void 0),E([N({type:Number,range:{min:0}})],Q1.prototype,"size",void 0),E([N()],Q1.prototype,"maskUrl",void 0),E([N()],Q1.prototype,"maskEnabled",void 0),E([N()],Q1.prototype,"overlayUrl",void 0),E([N()],Q1.prototype,"overlayEnabled",void 0),E([N({readOnly:!0})],Q1.prototype,"version",null),E([N({type:Boolean})],Q1.prototype,"visible",void 0),Q1=E([dt("esri.views.Magnifier")],Q1);const tit=Q1;let Xsi=class{constructor(){this._tasks=new Array,this._running=new Mle(!1)}get length(){return this._tasks.length}get running(){return this._running.get()}destroy(){this.cancelAll()}runTask(e){for(;!e.done&&this._process(e);)e.madeProgress()}push(e,i,r){return this._running.set(!0),new Promise((n,s)=>this._tasks.push(new iit(n,s,e,i,r)))}unshift(e,i,r){return this._running.set(!0),new Promise((n,s)=>this._tasks.unshift(new iit(n,s,e,i,r)))}_process(e){if(this._tasks.length===0)return!1;const i=this._tasks.shift();try{const r=Im(i.signal);if(r&&!i.abortCallback)i.reject(Sc());else{const n=r?i.abortCallback?.(Sc()):i.callback(e);Fp(n)?n.then(i.resolve,i.reject):i.resolve(n)}}catch(r){i.reject(r)}return this._running.set(this._tasks.length>0),!0}cancelAll(){const e=Sc();for(const i of this._tasks)if(i.abortCallback){const r=i.abortCallback(e);i.resolve(r)}else i.reject(e);this._tasks.length=0,this._running.set(!1)}},iit=class{constructor(e,i,r,n,s){this.resolve=e,this.reject=i,this.callback=r,this.signal=n,this.abortCallback=s}},KY=class extends Tn{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};E([N()],KY.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),E([N()],KY.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),KY=E([dt("esri.views.support.DebugFlags")],KY);const Ksi=new KY;var eb;(function(t){t[t.ANIMATING=0]="ANIMATING",t[t.INTERACTING=1]="INTERACTING",t[t.IDLE=2]="IDLE"})(eb||(eb={}));var _Ie,fl;(function(t){t[t.YIELD=1]="YIELD"})(_Ie||(_Ie={})),function(t){t.RESOURCE_CONTROLLER_IMMEDIATE="immediate",t.RESOURCE_CONTROLLER="schedule",t.SLIDE="slide",t.STREAM_DATA_LOADER="stream loader",t.ELEVATION_QUERY="elevation query",t.TERRAIN_SURFACE="terrain",t.SURFACE_GEOMETRY_UPDATES="surface geometry updates",t.LOD_RENDERER="LoD renderer",t.GRAPHICS_CORE="Graphics3D",t.I3S_CONTROLLER="I3S",t.POINT_CLOUD_LAYER="point cloud",t.FEATURE_TILE_FETCHER="feature fetcher",t.OVERLAY="overlay",t.STAGE="stage",t.GRAPHICS_DECONFLICTOR="graphics deconflictor",t.FILTER_VISIBILITY="Graphics3D filter visibility",t.SCALE_VISIBILITY="Graphics3D scale visibility",t.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",t.POINT_OF_INTEREST_FREQUENT="POI frequent",t.POINT_OF_INTEREST_INFREQUENT="POI infrequent",t.LABELER="labeler",t.FEATURE_QUERY_ENGINE="feature query",t.FEATURE_TILE_TREE="feature tile tree",t.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",t.ELEVATION_ALIGNMENT="elevation alignment",t.TEXT_TEXTURE_ATLAS="text texture atlas",t.TEXTURE_UNLOAD="texture unload",t.LINE_OF_SIGHT_TOOL="line of sight tool",t.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",t.ELEVATION_PROFILE="elevation profile",t.SNAPPING="snapping",t.SHADOW_ACCUMULATOR="shadow accumulator",t.CLOUDS_GENERATOR="clouds generator",t[t.TEST_PRIO=1]="TEST_PRIO"}(fl||(fl={}));const vT=0,rit=new Map([[fl.RESOURCE_CONTROLLER_IMMEDIATE,vT],[fl.RESOURCE_CONTROLLER,4],[fl.SLIDE,vT],[fl.STREAM_DATA_LOADER,vT],[fl.ELEVATION_QUERY,vT],[fl.TERRAIN_SURFACE,1],[fl.SURFACE_GEOMETRY_UPDATES,1],[fl.LOD_RENDERER,2],[fl.GRAPHICS_CORE,2],[fl.I3S_CONTROLLER,2],[fl.POINT_CLOUD_LAYER,2],[fl.FEATURE_TILE_FETCHER,2],[fl.OVERLAY,4],[fl.STAGE,4],[fl.GRAPHICS_DECONFLICTOR,4],[fl.FILTER_VISIBILITY,4],[fl.SCALE_VISIBILITY,4],[fl.FRUSTUM_VISIBILITY,4],[fl.CLOUDS_GENERATOR,4],[fl.POINT_OF_INTEREST_FREQUENT,6],[fl.POINT_OF_INTEREST_INFREQUENT,30],[fl.LABELER,8],[fl.FEATURE_QUERY_ENGINE,8],[fl.FEATURE_TILE_TREE,16],[fl.FEATURE_TILE_TREE_ACTIVE,vT],[fl.ELEVATION_ALIGNMENT,12],[fl.TEXT_TEXTURE_ATLAS,12],[fl.TEXTURE_UNLOAD,12],[fl.LINE_OF_SIGHT_TOOL,16],[fl.LINE_OF_SIGHT_TOOL_INTERACTIVE,vT],[fl.SNAPPING,vT],[fl.SHADOW_ACCUMULATOR,30]]);function nit(t){return rit.has(t)?rit.get(t):typeof t=="number"?t:1}const sit=6.5,oit=1,Jsi=30,ait=1e3/30,lit=100,uit=.9;var bIe,yN;(function(t){class e{get updating(){return this._updating.get()}_updatingChanged(){this._updating.set(this._tasks.some(s=>s.needsUpdate))}constructor(){this._updating=new Mle(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new EH("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new r,this._state=eb.INTERACTING,this._tasks=new Em,this._runQueue=new Em,this._load=0,this._idleStateCallbacks=new Em,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=sr(()=>Ksi.SCHEDULER_LOG_SLOW_TASKS,o=>this._debug=o,Yo);for(const o of Object.keys(fl))this.performanceInfo.tasks.set(fl[o],new EH(fl[o]));const s=this;this._test={FRAME_SAFETY_BUDGET:sit,INTERACTING_BUDGET:ait,IDLE_BUDGET:lit,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(),Uc(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=nit(s),l=new i(this,s,o,a);return this._tasks.push(l),this._updatingChanged(),this.performanceInfo.tasks.has(s)||this.performanceInfo.tasks.set(s,new EH(s)),l}registerIdleStateCallbacks(s,o){const a={idleBegin:s,idleEnd:o};this._idleStateCallbacks.push(a),this.state===eb.IDLE&&this._idleUpdatesStartFired&&a.idleBegin();const l=this;return{remove:()=>this._removeIdleStateCallbacks(a),set idleBegin(c){l._idleUpdatesStartFired&&(a.idleEnd(),l._state===eb.IDLE&&c()),a.idleBegin=c},set idleEnd(c){a.idleEnd=c}}}get load(){return this._load}set state(s){this._state!==s&&(this._state=s,this.state!==eb.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=sit,a=s.frameDuration,l=oit;switch(this.state){case eb.IDLE:o=0,a=Math.max(lit,s.frameDuration),l=Jsi;break;case eb.INTERACTING:a=Math.max(ait,s.frameDuration);case eb.ANIMATING:}return a=a-s.elapsedFrameTime-o,this.state!==eb.IDLE&&as.idleBegin())),this._runIdle();break;case eb.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 yN.SCHEDULED;let o=yN.IDLE;return this._tasks.forAll(a=>{a.name===s&&a.needsUpdate&&(a.schedulePriority<=1?o=yN.READY:o!==yN.READY&&(o=yN.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*uit+s*(1-uit)}_schedule(){for(this._runQueue.filterInPlace(s=>!!s.needsUpdate||(s.schedulePriority=s.basePriority,!1)),this._tasks.forAll(s=>{s.basePriority===vT&&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!==vT&&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)===_Ie.YIELD&&(a.blockFrame=this._frameNumber)}catch(c){Oi.getLogger("esri.views.support.Scheduler").error(`Exception in task "${a.name}"`,c)}!this._budget.hasProgressed&&a.blockFrame!==this._frameNumber&&a.needsUpdate&&(a.name,fl.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(fl))this._frameTaskTimes.set(fl[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}}t.Scheduler=e;class i{get task(){return this._task.get()}get updating(){return this._queue.running}constructor(s,o,a,l){this._scheduler=s,this.name=o,this._basePriority=l,this.blockFrame=0,this.runtime=0,this._queue=new Xsi,this._handles=new df,this.schedulePriority=this._basePriority,this._task=new Mle(ve(a)?a:this._queue),this._handles.add(Yg(()=>this.task.running,c=>s.taskRunningChanged(c)))}remove(){this.processQueue(Lle),this._scheduler.removeTask(this),this.schedule=wIe.schedule,this.reschedule=wIe.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(s){this.name=s;const o=nit(s);this._basePriority!==vT&&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){this._queue.runTask(s)}}class r{constructor(){this._begin=typeof performance<"u"?performance.now():0,this._budget=0,this._state=eb.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}}t.Budget=r})(bIe||(bIe={})),function(t){t.SCHEDULED="s",t.READY="r",t.WAITING="w",t.IDLE="i"}(yN||(yN={}));const Lle=(()=>{const t=new bIe.Budget;return t.enabled=!1,t})();let Zsi=class{remove(){}processQueue(){}schedule(e,i,r){try{if(Im(i)){const n=Sc();return r?Promise.resolve(r(n)):Promise.reject(n)}return A_e(e(Lle))}catch(n){return Promise.reject(n)}}reschedule(e,i,r){return this.schedule(e,i,r)}};const wIe=new Zsi;let JY=class extends Tn{constructor(e,i){super({}),this._stage=e,this._textureRequests=new Map,this._frameTask=i?.registerTask(fl.TEXTURE_UNLOAD)??wIe}normalizeCtorArgs(){return{}}destroy(){super.destroy(),this._frameTask.remove(),this._textureRequests.forEach(e=>this._releaseTextureRequest(e)),this._textureRequests.clear()}get updating(){return this._frameTask.updating}fromData(e,i,r){const n=this.makeUid(e);let s=this._textureRequests.get(n);if(!s){const o=i();s={referenceCount:0,texture:o,textureAsync:null,abortController:null,onRemove:r},this._stage&&(this._stage.add(o),this._stage.loadImmediate(o)),this._textureRequests.set(n,s)}return s.referenceCount++,{uid:n,texture:s.texture,release:()=>this._release(n)}}_release(e){const i=this._textureRequests.get(e);i?(i.referenceCount<1&&console.warn("TextureCollection: reference count is < 1 for "+e),i.referenceCount--,i.referenceCount<1&&this._frameTask.schedule(()=>this._releaseNow(e))):console.warn(`TextureCollection: texture doesn't exist: '${e}'`)}get test(){return{textureRequests:this._textureRequests}}_releaseNow(e){if(!this._textureRequests)return;const i=this._textureRequests.get(e);!i||i.referenceCount>0||(this._releaseTextureRequest(i),this._textureRequests.delete(e))}_releaseTextureRequest(e){e.onRemove&&e.onRemove(),e.texture?this._stage?.remove(e.texture):e.abortController&&(e.abortController.abort(),e.abortController=null)}makeUid(e,i=null){return ve(i)?`${e}.${i}px`:e}};E([N()],JY.prototype,"_frameTask",void 0),E([N()],JY.prototype,"updating",null),JY=E([dt("esri.views.3d.support.TextureCollection")],JY);var cit;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right"})(cit||(cit={}));const hit=["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"],dit={};function pit(t){return!!dit[t]}function Qsi(t){for(const e of t)if(!pit(e))return!1;return!0}hit.forEach(t=>{dit[t]=!0});let eoi=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:i,priority:r},n)=>this.inputManager?.installHandlers(n,[i],r))}disconnect(){this.inputManager&&this._handlers.forEach((e,i)=>this.inputManager?.uninstallHandlers(i)),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(e,i,r,n){const s=Array.isArray(e)?e:e.split(",");if(!Qsi(s))return s.some(pit)&&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(i)?a=i:(o=i,a=[]),typeof r=="function"?o=r:n=r,n=n??yT.DEFAULT;const l=this._createUniqueGroupName(),c=new toi(this.view,s,a,o);this._handlers.set(l,{handler:c,priority:n});for(const h of s){const p=this._handlerCounts.get(h)||0;this._handlerCounts.set(h,p+1)}return this.inputManager&&this.inputManager.installHandlers(l,[c],n),{remove:()=>this._removeHandler(l,s)}}hasHandler(e){return!!this._handlerCounts.get(e)}_removeHandler(e,i){if(this._handlers.has(e)){this._handlers.delete(e);for(const r of i){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}`}},toi=class extends Vm{constructor(e,i,r,n){super(!0),this._latestDragStart=void 0,this.view=e;for(const s of i)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:i=>e.async(i),preventDefault:()=>e.preventDefault()}}_wrapBlur(e){return{type:"blur",timestamp:e.timestamp,native:e.data.native,cancelable:e.cancelable,stopPropagation:()=>e.stopPropagation(),async:i=>e.async(i),preventDefault:()=>e.preventDefault()}}_wrapClick(e){const{pointerType:i,button:r,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,{cancelable:c,timestamp:h}=e;return{type:"click",pointerType:i,button:r,buttons:n,x:s,y:o,native:a,timestamp:h,screenPoint:zh(s,o),mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:c,stopPropagation:()=>e.stopPropagation(),async:p=>e.async(p),preventDefault:()=>e.preventDefault()}}_wrapDoubleClick(e){const{pointerType:i,button:r,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,{cancelable:c,timestamp:h}=e;return{type:"double-click",pointerType:i,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()}}_wrapImmediateClick(e){const{pointerType:i,button:r,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,c=a.pointerId,{cancelable:h,timestamp:p}=e;return{type:"immediate-click",pointerId:c,pointerType:i,button:r,buttons:n,x:s,y:o,native:a,timestamp:p,mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:h,stopPropagation:()=>e.stopPropagation(),async:y=>e.async(y),preventDefault:()=>e.preventDefault()}}_wrapImmediateDoubleClick(e){const{pointerType:i,button:r,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,c=a.pointerId,{cancelable:h,timestamp:p}=e;return{type:"immediate-double-click",pointerId:c,pointerType:i,button:r,buttons:n,x:s,y:o,native:a,timestamp:p,mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:h,stopPropagation:()=>e.stopPropagation(),async:y=>e.async(y),preventDefault:()=>e.preventDefault()}}_wrapHold(e){const{pointerType:i,button:r,buttons:n,x:s,y:o,native:a}=e.data,{cancelable:l,timestamp:c}=e;return{type:"hold",pointerType:i,button:r,buttons:n,x:s,y:o,native:a,timestamp:c,mapPoint:this._getMapPoint(s,o),cancelable:l,stopPropagation:()=>e.stopPropagation(),async:h=>e.async(h),preventDefault:()=>e.preventDefault()}}_getMapPoint(e,i){return this.view.toMap(zh(e,i),{exclude:[]})}_wrapDrag(e){const i=e.data,{x:r,y:n}=i.center,{action:s,pointerType:o,button:a}=i;if(s==="start"&&(this._latestDragStart=i),!this._latestDragStart)return;const l=i.pointer.native,c=i.buttons,{cancelable:h,timestamp:p}=e,y={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:y,pointerType:o,button:a,buttons:c,radius:i.radius,angle:_ne(i.angle),native:l,timestamp:p,cancelable:h,stopPropagation:()=>e.stopPropagation(),async:v=>e.async(v),preventDefault:()=>e.preventDefault()}}_wrapKeyDown(e){const{key:i,repeat:r,native:n}=e.data,{cancelable:s,timestamp:o}=e;return{type:"key-down",key:i,repeat:r,native:n,timestamp:o,cancelable:s,stopPropagation:()=>e.stopPropagation(),async:a=>e.async(a),preventDefault:()=>e.preventDefault()}}_wrapKeyUp(e){const{key:i,native:r}=e.data,{cancelable:n,timestamp:s}=e;return{type:"key-up",key:i,native:r,timestamp:s,cancelable:n,stopPropagation:()=>e.stopPropagation(),async:o=>e.async(o),preventDefault:()=>e.preventDefault()}}_wrapPointer(e,i){const{x:r,y:n,button:s,buttons:o,native:a,eventId:l}=e.data,c=a.pointerId,h=a.pointerType,{cancelable:p,timestamp:y}=e;return{type:i,x:r,y:n,pointerId:c,pointerType:h,button:s,buttons:o,native:a,timestamp:y,eventId:l,cancelable:p,stopPropagation:()=>e.stopPropagation(),async:v=>e.async(v),preventDefault:()=>e.preventDefault()}}_wrapPointerDrag(e){const{x:i,y:r,buttons:n,native:s,eventId:o}=e.data.currentEvent,{button:a}=e.data.startEvent,l=e.data.startEvent.native.pointerId,c=e.data.startEvent.native.pointerType,h=e.data.action,p={x:e.data.startEvent.x,y:e.data.startEvent.y},{cancelable:y,timestamp:v}=e;return{type:"pointer-drag",x:i,y:r,pointerId:l,pointerType:c,button:a,buttons:n,action:h,origin:p,native:s,timestamp:v,eventId:o,cancelable:y,stopPropagation:()=>e.stopPropagation(),async:x=>e.async(x),preventDefault:()=>e.preventDefault()}}_wrapMouseWheel(e){const{cancelable:i,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:i,stopPropagation:()=>e.stopPropagation(),async:c=>e.async(c),preventDefault:()=>e.preventDefault()}}_wrapGamepad(e){const{action:i,state:r,device:n}=e.data,{cancelable:s,timestamp:o}=e,{buttons:a,axes:l}=r;return{type:"gamepad",device:n,timestamp:o,action:i,buttons:a,axes:l,cancelable:s,stopPropagation:()=>e.stopPropagation(),async:c=>e.async(c),preventDefault:()=>e.preventDefault()}}};var ZY,fit,mit;(function(t){t[t.USER=0]="USER",t[t.MANAGER=1]="MANAGER"})(ZY||(ZY={})),function(t){t[t.None=0]="None",t[t.Unfocused=1]="Unfocused",t[t.Focused=2]="Focused",t[t.Unselected=4]="Unselected",t[t.Selected=8]="Selected",t[t.All=15]="All"}(fit||(fit={})),function(t){t[t.None=0]="None",t[t.Custom1=16]="Custom1",t[t.Custom2=32]="Custom2",t[t.Custom3=64]="Custom3",t[t.Custom4=128]="Custom4",t[t.Custom5=256]="Custom5",t[t.Custom6=512]="Custom6",t[t.Custom7=1024]="Custom7",t[t.Custom8=2048]="Custom8",t[t.Custom9=4096]="Custom9",t[t.Custom10=8192]="Custom10",t[t.Custom11=16384]="Custom11",t[t.Custom12=32768]="Custom12",t[t.All=65520]="All"}(mit||(mit={}));function ioi(t){return[t.on("before-add",e=>{const i=e.item;if(i==null||t.includes(i))return Oi.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();i.onAdd()}),t.on("after-remove",e=>{const i=e.item;i.active&&(i.view.activeTool=null),i.destroy()})]}function xIe(t){return t.visible&&t.getEditableFlag!=null&&t.getEditableFlag(ZY.USER)&&t.getEditableFlag(ZY.MANAGER)}function _T(t){return zh(t.x,t.y)}function git(t,e){const i=(t instanceof HTMLElement?t:t.surface)?.getBoundingClientRect();return i?zh(e.clientX-i.left,e.clientY-i.top):zh(0,0)}function yit(t,e){return e instanceof Event?git(t,e):_T(e)}function vit(t){if(t instanceof Event)return!0;if(typeof t=="object"&&"type"in t)switch(t.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 roi=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}handleInputEvent(e,i){const r=()=>e.stopPropagation();switch(e.type){case"pointer-move":_it(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(!bit(e))break;const n=_T(e),s=this._intersect(n,e.pointerType,i.forEachTool);if(lt(s))break;const o=s.manipulator,a=s.tool;!(ve(o)&&ve(a)&&o.interactive)||o.grabbable&&o.grabbableForEvent(e)||!o.grabbing||o.dragging||this._ungrabManipulatorBeforeDragging(o,e,i),ve(o)&&ve(a)&&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&<(i.activeTool)&&(this._revertToNullActiveTool=!0,i.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,i);break;case"pointer-drag":{if(!bit(e))break;const n=this._grabbedManipulators.get(e.pointerId),s=Pa(n,({manipulator:h})=>h),o=Pa(n,({tool:h})=>h);if(lt(s)||lt(o))break;const a=_T(e);a.x=eu(a.x,0,i.view.width),a.y=eu(a.y,0,i.view.height);const l=n.start,c=this._draggedManipulators.get(e.pointerId);switch(e.action){case"start":case"update":e.action!=="update"&&this._grabbedManipulators.size!==1||(s.dragging=!0,c?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,c&&s.events.emit("drag",{action:"end",start:l,screenPoint:a}),this._draggedManipulators.delete(e.pointerId),this._handlePointerEnd(e,i)}r();break}case"immediate-click":{const n=_T(e),s=this._intersect(n,e.pointerType,i.forEachTool);if(noi(e)||i.forEachTool(c=>{if((!ve(s)||s.tool!==c||c.automaticManipulatorSelection)&&c.manipulators){let h=!1;c.manipulators.forEach(({manipulator:p})=>{p.selected&&(p.selected=!1,h=!0)}),h&&c.onManipulatorSelectionChanged&&c.onManipulatorSelectionChanged()}}),lt(s))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});break}case"click":{const n=_T(e),s=this._intersect(n,e.pointerType,i.forEachTool),o=ve(s)?s.manipulator:null;if(lt(o)||!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=_T(e),s=this._intersect(n,e.pointerType,i.forEachTool),o=ve(s)?s.manipulator:null;if(lt(o)||!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});break}case"immediate-double-click":{const n=_T(e),s=this._intersect(n,e.pointerType,i.forEachTool),o=ve(s)?s.manipulator:null;if(lt(o)||!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});break}}this._onFocusChange(i.forEachTool)}_ungrabManipulatorBeforeDragging(e,i,r){e.grabbing=!1,e.events.emit("grab-changed",{action:"end",pointerType:i.pointerType,screenPoint:_T(i)}),this._grabbedManipulators.forEach(({manipulator:n},s)=>{n===e&&this._grabbedManipulators.delete(s)}),this._afterManipulatorUngrab(r.setActiveTool)}_handlePointerEnd(e,i){const r=Pa(this._grabbedManipulators.get(e.pointerId),({manipulator:n})=>n);lt(r)||r.grabbing&&(r.grabbing=!1,r.events.emit("grab-changed",{action:"end",pointerType:e.pointerType,screenPoint:_T(e)}),this._grabbedManipulators.delete(e.pointerId),this._afterManipulatorUngrab(i.setActiveTool))}_cursorFromMap(e){let i=null;return Ure(e,({manipulator:r})=>!(lt(r)||!r.interactive)&&(r.grabbing&&r.grabCursor?(i=r.grabCursor,!0):!!r.cursor&&(i=r.cursor,!0))),i}_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 i=new Set,r=new Set;this._grabbedManipulators.forEach(({tool:n})=>{i.add(n)}),this._hoveredManipulators.forEach(({tool:n})=>{r.add(n)}),e(n=>{n.hasGrabbedManipulators=i.has(n),n.hasHoveredManipulators=r.has(n);const s=this._grabbedManipulators.values(),o=_re(s,({tool:a})=>a===n);n.firstGrabbedManipulator=ve(o)?o.manipulator:null})}clearPointers(e,{forEachTool:i,setActiveTool:r},n=!0,s){const o=(a,l)=>a===e&&(lt(s)||s===l);this._grabbedManipulators.forEach(({tool:a,manipulator:l,pointerType:c},h)=>{o(a,l)&&(this._grabbedManipulators.delete(h),l.grabbing=!1,l.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:c}))}),this._draggedManipulators.forEach(({tool:a,manipulator:l},c)=>{o(a,l)&&(this._draggedManipulators.delete(c),l.dragging=!1,l.events.emit("drag",{action:"cancel"}))}),n&&this._hoveredManipulators.forEach(({tool:a,manipulator:l},c)=>{o(a,l)&&(this._hoveredManipulators.delete(c),l.hovering=!1)}),this._afterManipulatorUngrab(r),this._onFocusChange(i)}_intersect(e,i,r){let n=null;return r(s=>{if(s.manipulators==null||!xIe(s))return!1;const o=s.manipulators.intersect(e,i);return!lt(o)&&(n={tool:s,manipulator:o},!0)}),n}updateHoveredStateFromKnownPointers(e){this._pointerLocations.forEach((i,r)=>{this._updateHoveredStateForPointerAtScreenPosition(zh(i.x,i.y),r,i.pointerType,e)})}handleHoverEvent(e,i){e.type!=="pointer-up"&&e.type!=="immediate-click"&&e.type!=="pointer-move"||!_it(e.pointerType)||this._updateHoveredStateForPointerAtScreenPosition(_T(e),e.pointerId,e.pointerType,i)}_updateHoveredStateForPointerAtScreenPosition(e,i,r,n){let s=this._intersect(e,r,n);const o=Pa(this._hoveredManipulators.get(i),({manipulator:a})=>a);ve(s)&&!s.manipulator.interactive&&(s=null),ve(s)&&o===s.manipulator||(ve(o)&&(o.hovering=!1),ve(s)?(s.manipulator.hovering=!0,this._hoveredManipulators.set(i,s)):this._hoveredManipulators.delete(i),this._onFocusChange(n))}_afterManipulatorUngrab(e){this._grabbedManipulators.size===0&&this._revertToNullActiveTool&&(e(null),this._revertToNullActiveTool=!1)}};function _it(t){return t==="mouse"}function bit(t){return t.pointerType!=="mouse"||t.button===0}function noi(t){return!!t.native.shiftKey}const wit="attached",SIe="tools";let QA=class extends YC{constructor(e){super(e),this._manipulatorState=new roi,this.tools=new Sr,this.cursor=null,this._forEachTool=i=>{for(const r of this.tools.items)if(i(r))return}}initialize(){this.handles.add([this.view.on(hit,e=>{this._handleInputEvent(e)},yT.TOOL),...ioi(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.detach(),this.handles.removeAll()}get _manipulatorStateEventArgs(){return{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:e=>{this.activeTool=e},view:this.view}}set activeTool(e){if(ve(e)&&!this.view.ready)return void Oi.getLogger(this.declaredClass).error("Cannot set active tool while view is not ready.");if(e===this.activeTool)return;const i=this.activeTool;this._set("activeTool",e),ve(i)&&i.deactivate(),ve(e)&&e.activate(),this._removeIncompleteTools(e);for(const r of this.tools){this._updateToolEditableFlag(r);const n=xIe(r);!lt(this.activeTool)&&n||this._manipulatorState.clearPointers(r,this._manipulatorStateEventArgs,!n)}this._updateCursor()}get updating(){return this.updatingHandles.updating||this.tools.some(e=>e.updating)||(this.textures?.updating??!1)}attach(){this.view.type==="3d"?(this._set("textures",new JY(this.view._stage,this.view.resourceController.scheduler)),this.handles.add([sr(()=>{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(i=>i.onElevationChange(e))),XI(()=>this._set("textures",da(this.textures)))],wit)):this.handles.add(sr(()=>this.view.extent,()=>this._forEachManipulator(e=>e.onViewChange())))}detach(){ve(this.activeTool)&&(this.activeTool=null),this.tools.removeAll(),this.handles.remove(wit)}_forEachManipulator(e){this._forEachTool(i=>{i.manipulators&&i.manipulators.forEach(({manipulator:r})=>e(r,i))})}_handleInputEvent(e){let i=!1;const r={...e,stopPropagation:()=>{i=!0,e.stopPropagation()}};ve(this.activeTool)?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(r):this._forEachTool(n=>{!i&&n.visible&&n.handleInputEvent(r)}),!i&&e.type==="key-down"&&e.key==="Escape"&&this.activeTool&&(e.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(r,this._manipulatorStateEventArgs),!i&&ve(this.activeTool)&&this.activeTool.handleInputEventAfter(r),this._manipulatorState.handleHoverEvent(r,this._forEachTool),this._updateCursor()}_refreshToolWatchers(){this.handles.remove(SIe),this._forEachTool(e=>{if(e instanceof Tn){const i=sr(()=>[e.cursor,e.visible,e.editable],()=>{xIe(e)||this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs),this._updateCursor()});this.handles.add(i,SIe)}e.manipulators&&this.handles.add([e.manipulators.on("after-remove",i=>{this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs,!0,i.item.manipulator)}),e.manipulators.on("change",()=>{this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})],SIe)}),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateToolEditableFlag(e){e.setEditableFlag?.(ZY.MANAGER,lt(this.activeTool)||e===this.activeTool)}_updateCursor(){let e=this._manipulatorState.cursor;lt(e)&&this._forEachTool(i=>!(!ve(i.cursor)||!i.visible)&&(e=i.cursor,!0)),this._get("cursor")!==e&&this._set("cursor",e)}_removeIncompleteTools(e){this.tools.filter(i=>(lt(e)||i!==e)&&!i.created&&i.removeIncompleteOnCancel).forEach(i=>{this.tools.remove(i)})}};E([N({constructOnly:!0,nonNullable:!0})],QA.prototype,"view",void 0),E([N({readOnly:!0,nonNullable:!0})],QA.prototype,"textures",void 0),E([N({value:null})],QA.prototype,"activeTool",null),E([N({readOnly:!0,type:Sr})],QA.prototype,"tools",void 0),E([N({readOnly:!0})],QA.prototype,"cursor",void 0),E([N({readOnly:!0})],QA.prototype,"updating",null),QA=E([dt("esri.views.ToolViewManager")],QA);const soi=QA;let eV=class extends Tn{constructor(e){super(),this.nativeIndex=null,this._detectedDeviceType="unknown",e.mapping==="standard"?this._detectedDeviceType="standard":ooi.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.nativeIndexhZi).then(e=>TIe=e)),await EIe,yn(t)}async function Pit(t,e,i,r){if(!t)return null;const n=t.spatialReference;return hw()||o_(n,e)?cp(t,e):TIe?TIe.projectGeometry(t,e,i,r):(await Promise.race([foi(r),A2(r)]),Pit(t,e,i,r))}let Jc=class extends Tn{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=oL(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 ve(this.userSpatialReference)?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 lt(this.userSpatialReference)||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){const e=this.map?.(),i=[];return ve(this.priorityCollection)&&i.push(this.priorityCollection),i.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}),i}get _allLayers(){return this._collectLayers(this.mapCollections)}get _spatialReferenceTask(){if(this.suspended)return this._get("_spatialReferenceTask")??{updating:!1};const{layers:e,updating:i}=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);ve(a)&&(r=a)}if(ve(r)&&r.length===1)break}if(i&&(lt(r)||r.length!==1))return{updating:!0};const n=this._pickSpatialReferenceCandidate(r);return{spatialReference:ve(n)?n.spatialReference:null,viewingMode:ve(n)?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:i}=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:i}}get _heightModelInfoTask(){if(!this.required.heightModelInfo||this.suspended&&this._get("_heightModelInfoTask")?.heightModelInfo)return this._get("_heightModelInfoTask")??{updating:!1};const{layers:e,updating:i}=this._allLayers;for(const r of e)if(doi(r)){const n=coi(r);if(n)return{heightModelInfo:n,vcsWkid:r.spatialReference?.vcsWkid,latestVcsWkid:r.spatialReference?.latestVcsWkid,updating:!1}}return{updating:i}}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,i=e.updating,r=[];for(const n of e.layers){const s="fullExtents"in n&&n.fullExtents||(ve(n.fullExtent)?[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:i}}get _extentTask(){const{candidates:e,updating:i}=this._extentCandidatesTask;if(i)return{updating:i};if(lt(e)||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:ve(this._projectExtentTask.task)&&!this._projectExtentTask.task.finished}:(ve(this._projectExtentTask.task)&&(this._projectExtentTask.task=oL(this._projectExtentTask.task)),this._projectExtentTask={input:r.extent.clone(),output:null,spatialReference:n.clone(),task:CC(async s=>{try{const o=await Pit(r.extent,n,r.layer.portalItem,s);this._projectExtentTask={...this._projectExtentTask,task:null,output:o}}catch{if(Im(s))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(e,i){if(lt(e))return i;const r=[],n=(s,o)=>ve(s)?ve(o)?s===o&&s:s:o;for(const s of e)for(const o of i){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 i=this.defaultSpatialReference;return lt(e)||e.length<1?ve(i)?{spatialReference:i,viewingMode:null}:null:(ve(i)&&e.length>1&&e.some(({spatialReference:r})=>r.equals(i))&&(e=e.filter(({spatialReference:r})=>r.equals(i))),e.length>1&&e.some(({viewingMode:r})=>r!==xw.Local)&&(e=e.filter(({viewingMode:r})=>r!==xw.Local)),e[0])}_getSupportedSpatialReferences(e){const i="supportedSpatialReferences"in e&&e.supportedSpatialReferences||(e.spatialReference?[e.spatialReference]:[]);if(i.length===0)return[];const r=[];for(const n of i){const s=this.getSpatialReferenceSupport({spatialReference:n,layer:e});if(ve(s)){const o=ve(s.constraints)?s.constraints:[{spatialReference:n,viewingMode:null}];for(const{spatialReference:a,viewingMode:l}of o)(!this.requiresExtentInSpatialReference||lt(this.userSpatialReference)||a.equals(this.userSpatialReference))&&r.push({spatialReference:a,viewingMode:l})}}return r}_pickExtentCandidate(e){const i=this.spatialReference;return e.find(({extent:r})=>i.equals(r.spatialReference))||e[0]}_collectLayers(e){if(this._loadMaybe(this.map?.())!=="loaded")return{layers:[],updating:!0};const i={layers:[],preloading:-1,updating:!1};for(const r of e)if(this._collectCollection(r,i),i.preloading===this.sourcePreloadCount)break;return{layers:i.layers,updating:i.updating}}_collectCollection(e,i){if(e.layers){switch(this._loadMaybe(e.parent)){case"loading":return i.updating=!0,void++i.preloading;case"failed":return}for(const r of e.layers){switch(this._loadMaybe(r)){case"failed":continue;case"loading":i.updating=!0,++i.preloading;break;case"loaded":i.updating||i.layers.push(r),"layers"in r&&this._collectCollection({layers:r.layers},i)}if(i.preloading===this.sourcePreloadCount)break}}}_loadMaybe(e){return e&&"loadStatus"in e&&e.loadStatus!=null?e.loadStatus==="not-loaded"?(e.load().catch(()=>{}),"loading"):e.loadStatus:"loaded"}};E([N()],Jc.prototype,"required",void 0),E([N({constructOnly:!0})],Jc.prototype,"map",void 0),E([N({constructOnly:!0})],Jc.prototype,"getSpatialReferenceSupport",void 0),E([N()],Jc.prototype,"defaultSpatialReference",void 0),E([N()],Jc.prototype,"userSpatialReference",void 0),E([N()],Jc.prototype,"sourcePreloadCount",void 0),E([N()],Jc.prototype,"priorityCollection",void 0),E([N()],Jc.prototype,"requiresExtentInSpatialReference",void 0),E([N()],Jc.prototype,"suspended",void 0),E([N({readOnly:!0})],Jc.prototype,"ready",null),E([N({readOnly:!0})],Jc.prototype,"heightModelInfoReady",null),E([N({readOnly:!0})],Jc.prototype,"spatialReference",null),E([N({readOnly:!0})],Jc.prototype,"extent",null),E([N({readOnly:!0})],Jc.prototype,"heightModelInfo",null),E([N({readOnly:!0})],Jc.prototype,"vcsWkid",null),E([N({readOnly:!0})],Jc.prototype,"latestVcsWkid",null),E([N({readOnly:!0})],Jc.prototype,"viewingMode",null),E([N({readOnly:!0})],Jc.prototype,"tileInfo",null),E([N({readOnly:!0})],Jc.prototype,"mapCollections",null),E([N({readOnly:!0})],Jc.prototype,"_allLayers",null),E([N({readOnly:!0})],Jc.prototype,"_spatialReferenceTask",null),E([N({readOnly:!0})],Jc.prototype,"_tileInfoTask",null),E([N({readOnly:!0})],Jc.prototype,"_heightModelInfoTask",null),E([N({readOnly:!0})],Jc.prototype,"_extentCandidatesTask",null),E([N()],Jc.prototype,"_extentTask",null),E([N()],Jc.prototype,"_projectExtentTask",void 0),Jc=E([dt("esri.views.support.DefaultsFromMap")],Jc);var kle;let No=kle=class extends Ud(md.EventedMixin(Jx(Tn))){constructor(t){super(t),this._userSpatialReference=null,this._cursor=null,this.allLayerViews=new L2({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:e=>e.layerViews}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new U1,this.analyses=new Fle,this.typeSpecificPreconditionsReady=!0,this.layerViews=new Sr,this.magnifier=new tit,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.timeReference=new VR,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new uoi,this.navigation=new Sit,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new eoi(this),this.persistableViewModels=new Sr,this._isValid=!1,this._readyCycleForced=!1,this._currentSpatialReference=null,this.handles.add(sr(()=>this.preconditionsReady,e=>{e?(this._currentSpatialReference=this.spatialReference,kle.views.add(this)):(this._currentSpatialReference=null,kle.views.remove(this)),this.notifyChange("spatialReference"),!e&&this.ready?(this.toolViewManager?.detach(),ve(this.analysisViewManager)&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown()):e&&!this.ready&&(this._startup(),ve(this.analysisViewManager)&&this.analysisViewManager.attach(),this.toolViewManager.attach())},qu))}initialize(){this.addResolvingPromise(this.validate().then(()=>(this._isValid=!0,N1(()=>this.ready)))),this.basemapView=new bM({view:this}),this.layerViewManager=new qsi({view:this,layerViewImporter:{importLayerView:t=>this.importLayerView(t),hasLayerViewModule:t=>this.hasLayerViewModule(t)},supportsGround:this.supportsGround}),this.toolViewManager=new soi({view:this}),this._setupSpatialReferenceLogger(),this.handles.add([sr(()=>this.initialExtentRequired,t=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:t},{sync:!0,initial:!0}),sr(()=>this.ready,t=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=t,this.defaultsFromMap.userSpatialReference=t?this.spatialReference:this._userSpatialReference)},{sync:!0}),sr(()=>this._userSpatialReference,t=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=t)},{sync:!0,initial:!0})])}_setupSpatialReferenceLogger(){let t=null;this.handles.add([sr(()=>this.defaultsFromMap?.ready,e=>{const i=this.map?.allLayers.length>0;if(e&&!this.spatialReference&&i){if(ve(t))return;const r=XI(()=>t=oL(t));t=CC(async n=>{try{await B3(this.spatialReferenceWarningDelay,null,n)}catch{return}finally{t=null}Oi.getLogger(this.declaredClass).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),this.handles.add(r,"spatial-reference-logger-task")}else this.handles.remove("spatial-reference-logger-task")},{sync:!0})])}destroy(){if(this.destroyed)return;this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=da(this.graphics),this.analyses=da(this.analyses),this.handles.remove("defaultsFromMap"),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),da(this.analysisViewManager),this.toolViewManager=da(this.toolViewManager),this.layerViewManager=da(this.layerViewManager),this.basemapView=da(this.basemapView),this.invalidate(),this._emitter.clear(),this.handles.removeAll();const t=this.map;this.map=null,t?.destroy()}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return Oi.getLogger(this.declaredClass).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(t){this.toolViewManager&&(this.toolViewManager.activeTool=t)}get animation(){return this._get("animation")}set animation(t){this._set("animation",t)}get center(){return null}get _defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new Jc({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:t=>this.getSpatialReferenceSupport(t),...this._defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(t){this._set("extent",t)}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||gd.isLoadable(this.map)&&!this.map.loaded||this.width===0||this.height===0||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._currentSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(t){t!==this._get("map")&&(t?.destroyed&&(Oi.getLogger(this.declaredClass).warn("#map","The provided map is already destroyed",{map:t}),t=null),gd.isLoadable(t)&&t.load().catch(()=>{}),this.constructed&&(this.forceReadyCycle(),this._currentSpatialReference=null),this._set("map",t))}get spatialReference(){let t=this._userSpatialReference||this._currentSpatialReference||this.getDefaultSpatialReference()||null;return t&&this.defaultsFromMap?.required?.heightModelInfo&&(t=t.clone(),t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid),t}set spatialReference(t){const e=!Da(t,this._get("spatialReference"));this._set("_userSpatialReference",t),e&&(this._set("spatialReference",t),this._spatialReferenceChanged(t))}_spatialReferenceChanged(t){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){const t=this.toolViewManager?this.toolViewManager.cursor:null;return ve(t)?t:this._cursor||"default"}set cursor(t){this._cursor=t,this.notifyChange("cursor")}get size(){return[this.width,this.height]}whenLayerView(t){return this.layerViewManager.whenLayerView(t)}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}importLayerView(t){throw new st("importLayerView() not implemented")}hasLayerViewModule(t){return!1}async validate(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(t){return ve(this.getSpatialReferenceSupport({spatialReference:t}))}when(t,e){return this.isResolved()&&!this.ready&&Oi.getLogger(this.declaredClass).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(t,e)}forceReadyCycle(){this.ready&&(Yg(()=>this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(t){this.toolViewManager.tools.add(t),this.activeTool=t}tryFatalErrorRecovery(){this.fatalError=null}};No.views=new Sr,E([N()],No.prototype,"_userSpatialReference",void 0),E([N()],No.prototype,"activeTool",null),E([N({readOnly:!0})],No.prototype,"allLayerViews",void 0),E([N()],No.prototype,"groundView",void 0),E([N()],No.prototype,"animation",null),E([N()],No.prototype,"basemapView",void 0),E([N()],No.prototype,"center",null),E([N({readOnly:!0})],No.prototype,"_defaultsFromMapSettings",null),E([N()],No.prototype,"defaultsFromMap",null),E([N()],No.prototype,"fatalError",void 0),E([N({type:Ar})],No.prototype,"extent",null),E([N(uCe(U1,"graphics"))],No.prototype,"graphics",void 0),E([N(uCe(Fle,"analyses"))],No.prototype,"analyses",void 0),E([N({readOnly:!0,type:B9})],No.prototype,"heightModelInfo",null),E([N({readOnly:!0})],No.prototype,"interacting",null),E([N({readOnly:!0})],No.prototype,"navigating",null),E([N({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_currentSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],No.prototype,"preconditionsReady",null),E([N({readOnly:!0})],No.prototype,"typeSpecificPreconditionsReady",void 0),E([N({type:Sr,readOnly:!0})],No.prototype,"layerViews",void 0),E([N()],No.prototype,"resolution",null),E([N({type:tit})],No.prototype,"magnifier",void 0),E([N({value:null,type:KZe})],No.prototype,"map",null),E([N()],No.prototype,"padding",void 0),E([N({readOnly:!0})],No.prototype,"ready",void 0),E([N({type:hr})],No.prototype,"spatialReference",null),E([N()],No.prototype,"spatialReferenceWarningDelay",void 0),E([N()],No.prototype,"stationary",null),E([N({readOnly:!0})],No.prototype,"supportsGround",void 0),E([N({type:Xg})],No.prototype,"timeExtent",void 0),E([N({type:VR,nonNullable:!0})],No.prototype,"timeReference",void 0),E([N()],No.prototype,"tools",null),E([N()],No.prototype,"toolViewManager",void 0),E([N({readOnly:!0})],No.prototype,"type",void 0),E([N({type:Number})],No.prototype,"scale",void 0),E([N({readOnly:!0})],No.prototype,"updating",void 0),E([N({readOnly:!0})],No.prototype,"initialExtentRequired",void 0),E([N({readOnly:!0})],No.prototype,"initialExtent",null),E([N()],No.prototype,"cursor",null),E([N({readOnly:!0})],No.prototype,"input",void 0),E([N({type:Sit,nonNullable:!0})],No.prototype,"navigation",void 0),E([N()],No.prototype,"layerViewManager",void 0),E([N()],No.prototype,"analysisViewManager",void 0),E([N()],No.prototype,"width",void 0),E([N()],No.prototype,"height",void 0),E([N({readOnly:!0})],No.prototype,"resizing",void 0),E([N({value:null,readOnly:!0})],No.prototype,"size",null),E([N({readOnly:!0})],No.prototype,"suspended",void 0),E([N({readOnly:!0})],No.prototype,"viewEvents",void 0),E([N({readOnly:!0})],No.prototype,"persistableViewModels",void 0),E([N()],No.prototype,"_isValid",void 0),E([N()],No.prototype,"_readyCycleForced",void 0),E([N()],No.prototype,"_currentSpatialReference",void 0),No=kle=E([dt("esri.views.View")],No);const moi=No;let xM=class extends NH{constructor(e){super(e),this.state="running",this.target=null,this._dfd=null}initialize(){this.addResolvingPromise(new Promise((e,i)=>this._dfd={resolve:e,reject:i}))}get done(){return this.state==="finished"||this.state==="stopped"}stop(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","stopped"),this._dfd?.reject(new st("ViewAnimation stopped")))}finish(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","finished"),this._dfd?.resolve())}update(e,i){i||(i=Fp(e)?"waiting-for-target":"running"),this._set("target",e),this._set("state",i)}};E([N({readOnly:!0})],xM.prototype,"done",null),E([N({readOnly:!0,type:String})],xM.prototype,"state",void 0),E([N()],xM.prototype,"target",void 0),xM=E([dt("esri.views.ViewAnimation")],xM),function(t){t.State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"}}(xM||(xM={}));const IIe=xM;function SM(t,e,i,r){const n=3*t,s=3*(i-t)-n,o=1-n-s,a=3*e,l=3*(r-e)-a,c=1-a-l;function h(x){return((o*x+s)*x+n)*x}function p(x){return((c*x+l)*x+a)*x}function y(x){return(3*o*x+2*s)*x+n}function v(x,I){let P,F,k,j,V,Y;for(k=x,Y=0;Y<8;Y++){if(j=h(k)-x,Math.abs(j)F)return F;for(;Pj?P=k:F=k,k=.5*(F-P)+P}return k}return function(x,I=1e-6){return p(v(x,I))}}const goi=/^cubic-bezier\((.*)\)/,Sw={};function yoi(t){let e=Sw[t]||null;if(!e){const i=goi.exec(t);if(i){const r=i[1].split(",").map(n=>parseFloat(n.trim()));r.length!==4||r.some(n=>isNaN(n))||(e=SM.apply(SM,r))}}return e}Sw.ease=SM(.25,.1,.25,1),Sw.linear=SM(0,0,1,1),Sw.easeIn=Sw["ease-in"]=SM(.42,0,1,1),Sw.easeOut=Sw["ease-out"]=SM(0,0,.58,1),Sw.easeInOut=Sw["ease-in-out"]=SM(.42,0,.58,1);function CM(){return[1,0,0,1,0,0]}function voi(t){return[t[0],t[1],t[2],t[3],t[4],t[5]]}function _oi(t,e,i,r,n,s){return[t,e,i,r,n,s]}function boi(t,e){return new Float64Array(t,e,6)}Object.freeze(Object.defineProperty({__proto__:null,clone:voi,create:CM,createView:boi,fromValues:_oi},Symbol.toStringTag,{value:"Module"}));function tV(t,e){return t[0]=e[0],t[1]=e[1],t}function ga(t,e,i){return t[0]=e,t[1]=i,t}function AIe(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}function eX(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function Oit(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t}function Rit(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t}function woi(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function xoi(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function Soi(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t}function Coi(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t}function Toi(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function tX(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}function Eoi(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t}function iX(t,e){const i=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(i*i+r*r)}function $le(t,e){const i=e[0]-t[0],r=e[1]-t[1];return i*i+r*r}function Ble(t){const e=t[0],i=t[1];return Math.sqrt(e*e+i*i)}function Mit(t){const e=t[0],i=t[1];return e*e+i*i}function Dit(t,e){return t[0]=-e[0],t[1]=-e[1],t}function Ioi(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function PIe(t,e){const i=e[0],r=e[1];let n=i*i+r*r;return n>0&&(n=1/Math.sqrt(n),t[0]=e[0]*n,t[1]=e[1]*n),t}function Fit(t,e){return t[0]*e[0]+t[1]*e[1]}function Lit(t,e,i){const r=e[0]*i[1]-e[1]*i[0];return t[0]=t[1]=0,t[2]=r,t}function OIe(t,e,i,r){const n=e[0],s=e[1];return t[0]=n+r*(i[0]-n),t[1]=s+r*(i[1]-s),t}function Aoi(t,e){e=e||1;const i=2*ZH()*Math.PI;return t[0]=Math.cos(i)*e,t[1]=Math.sin(i)*e,t}function Poi(t,e,i){const r=e[0],n=e[1];return t[0]=i[0]*r+i[2]*n,t[1]=i[1]*r+i[3]*n,t}function m0(t,e,i){const r=e[0],n=e[1];return t[0]=i[0]*r+i[2]*n+i[4],t[1]=i[1]*r+i[3]*n+i[5],t}function Ooi(t,e,i){const r=e[0],n=e[1];return t[0]=i[0]*r+i[3]*n+i[6],t[1]=i[1]*r+i[4]*n+i[7],t}function Roi(t,e,i){const r=e[0],n=e[1];return t[0]=i[0]*r+i[4]*n+i[12],t[1]=i[1]*r+i[5]*n+i[13],t}function _N(t,e,i,r){const n=e[0]-i[0],s=e[1]-i[1],o=Math.sin(r),a=Math.cos(r);return t[0]=n*a-s*o+i[0],t[1]=n*o+s*a+i[1],t}function Moi(t,e){const i=t[0],r=t[1],n=e[0],s=e[1];let o=i*i+r*r;o>0&&(o=1/Math.sqrt(o));let a=n*n+s*s;a>0&&(a=1/Math.sqrt(a));const l=(i*n+r*s)*o*a;return l>1?0:l<-1?Math.PI:Math.acos(l)}function Doi(t){return"vec2("+t[0]+", "+t[1]+")"}function Foi(t,e){return t[0]===e[0]&&t[1]===e[1]}function Loi(t,e){const i=t[0],r=t[1],n=e[0],s=e[1],o=qv();return Math.abs(i-n)<=o*Math.max(1,Math.abs(i),Math.abs(n))&&Math.abs(r-s)<=o*Math.max(1,Math.abs(r),Math.abs(s))}function Noi(t,e,i,r,n){let s=e[0]-i[0],o=e[1]-i[1];const a=(r[0]*s+r[1]*o)*(n-1);return s=r[0]*a,o=r[1]*a,t[0]=e[0]+s,t[1]=e[1]+o,t}const koi=Ble,RIe=eX;Object.freeze(Object.defineProperty({__proto__:null,add:AIe,angle:Moi,ceil:woi,copy:tV,cross:Lit,dist:iX,distance:iX,div:Rit,divide:Rit,dot:Fit,equals:Loi,exactEquals:Foi,floor:xoi,inverse:Ioi,len:koi,length:Ble,lerp:OIe,max:Coi,min:Soi,mul:Oit,multiply:Oit,negate:Dit,normalize:PIe,projectAndScale:Noi,random:Aoi,rotate:_N,round:Toi,scale:tX,scaleAndAdd:Eoi,set:ga,sqrDist:$le,sqrLen:Mit,squaredDistance:$le,squaredLength:Mit,str:Doi,sub:RIe,subtract:eX,transformMat2:Poi,transformMat2d:m0,transformMat3:Ooi,transformMat4:Roi},Symbol.toStringTag,{value:"Module"}));function rl(){return[0,0]}function $oi(t){return[t[0],t[1]]}function bT(t,e){return[t,e]}function Boi(t){const e=rl(),i=Math.min(2,t.length);for(let r=0;r"attributes"in h),l=t.some(h=>!h.geometry);let c=t;if(a&&l&&e&&e.allLayerViews){const h=new Map;for(const x of t){const I=x.layer,P=h.get(I)||[],F=x.attributes[I.objectIdField];F!=null&&P.push(F),h.set(I,P)}const p=[];h.forEach((x,I)=>{const P=e.allLayerViews.find(F=>F.layer.id===I.id);if(P&&"queryFeatures"in P){const F=I.createQuery();F.objectIds=x,F.returnGeometry=!0,p.push(P.queryFeatures(F))}});const y=await Promise.all(p),v=[];for(const x of y)if(x&&x.features&&x.features.length)for(const I of x.features)ve(I.geometry)&&v.push(I.geometry);c=v}for(const h of c)r=await nX(h,e,i,r);return r}if(Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")n=new er(t);else if(t instanceof un)n=t;else if("geometry"in t){if(t.geometry)n=t.geometry;else if(t.layer){const a=t.layer,l=e.allLayerViews.find(c=>c.layer.id===a.id);if(l&&"queryFeatures"in l){const c=a.createQuery();c.objectIds=[t.attributes[a.objectIdField]],c.returnGeometry=!0;const h=await l.queryFeatures(c);n=Wx(h,"features",0,"geometry")}}}if(lt(n)||(s=n.type==="point"?new Ar({xmin:n.x,ymin:n.y,xmax:n.x,ymax:n.y,spatialReference:n.spatialReference}):n.extent,!s))return null;hw()||o_(s.spatialReference,i)||await A2();const o=cp(s,i);return o?r=r?r.union(o):o:null}function zoi(t){if(t&&(!Array.isArray(t)||typeof t[0]!="number")&&(typeof t=="object"||Array.isArray(t)&&typeof t[0]=="object")){if("layer"in t&&t.layer&&t.layer.minScale&&t.layer.maxScale){const e=t.layer;return{min:e.minScale,max:e.maxScale}}if(Array.isArray(t)&&t.length&&t.every(e=>"layer"in e)){let e=0,i=0;for(const r of t){const n=r.layer;n&&n.minScale&&n.maxScale&&(e=n.minScalei?n.maxScale:i)}return e&&i?{min:e,max:i}:null}}}function DIe(t,e){return Da(Uit(t),e)?t:cp(t,e)}async function Hoi(t,e){if(!t||!e)return new p_({targetGeometry:new er,scale:0,rotation:0});let i=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;t instanceof p_?l=t:t.viewpoint?l=t.viewpoint:t.target&&t.target.declaredClass==="esri.Viewpoint"&&(l=t.target);let c=null;l&&l.targetGeometry?c=l.targetGeometry:t instanceof Ar?c=t:(t||t&&("center"in t||"extent"in t||"target"in t))&&(c=await nX(t.center,e,i)||await nX(t.extent,e,i)||await nX(t.target,e,i)||await nX(t,e,i)),!c&&s&&s.targetGeometry?c=s.targetGeometry:!c&&e.extent&&(c=e.extent),i||(i=Uit(e.spatialReference||e.extent||c)),hw()||Da(c.spatialReference,i)||o_(c,i)||await A2();const h=DIe(c.center?c.center:c,i);let p=0;if(l&&ve(l.targetGeometry)&&l.targetGeometry.type==="point")p=l.scale;else if("scale"in t&&t.scale)p=t.scale;else if("zoom"in t&&t.zoom!==-1&&r&&r.effectiveLODs)p=r.zoomToScale(t.zoom);else if(Array.isArray(c)||c.type==="point"||c.type==="extent"&&c.width===0&&c.height===0){const I=DIe(e.extent,i);p=ve(I)?rX(I,a):e.extent?rX(e.extent,a):s.scale}else p=rX(DIe(c.extent,i),a);const y=zoi(t);y&&(y.min&&y.min>p?p=y.min:y.max&&y.max180?this.dRotation-=360:this.dRotation<-180&&(this.dRotation+=360)}applyRatio(e,i){const r=this.easing(i);let n,s,o,a;i>=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}},tP=class extends Tn{constructor(e){super(e),this.updateFunction=null,this.animation=null,this.duration=200,this.transition=null,this.easing=Sw.ease,this.view=null,this.viewpoint=new p_({targetGeometry:new er,scale:0,rotation:0}),this._updateTask=dL({postRender:this._postRender.bind(this)}),this._updateTask.pause()}destroy(){this._updateTask=Uc(this._updateTask)}animate(e,i,r){this.stop();const n=this.viewpoint;B2(n,i),this.transition=new sai(this.viewpoint,e.target,r&&r.duration||this.duration,r&&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,i){this.stop(),this.updateFunction=i,this.viewpoint=e;const r=new IIe({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 i=this.animation;if(i&&i.state!==IIe.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()}};E([N()],tP.prototype,"animation",void 0),E([N()],tP.prototype,"duration",void 0),E([N()],tP.prototype,"transition",void 0),E([N()],tP.prototype,"easing",void 0),E([N()],tP.prototype,"view",void 0),E([N()],tP.prototype,"viewpoint",void 0),tP=E([dt("esri.views.2d.AnimationManager")],tP);const oai=tP;let aai=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=()=>{this._updateRequested=!1;const{basemapView:i,graphicsView:r,labelManager:n,layerViews:s,state:{id:o}}=this.view;i?.baseLayerViews.forEach(this._updateLayerView,this),s.forEach(this._updateLayerView,this),i?.referenceLayerViews.forEach(this._updateLayerView,this),ve(n)&&(n.lastUpdateId!==o&&(n.viewChange(),n.lastUpdateId=o),n.updateRequested&&n.processUpdate(this._updateParameters)),ve(r)&&(r.lastUpdateId!==o&&(r.viewChange(),r.lastUpdateId=o),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=sr(()=>e.stationary,i=>{this.stationary=i,this.requestFrame()}),this._frameTaskHandle=dL(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 i=this.view.state,r=e.lastUpdateId;r!=null&&(this.stationary||e.moving)||(e.moving=!0,e.moveStart()),r!==i.id&&e.viewChange(),this.stationary&&e.moving&&(e.moving=!1,e.moveEnd()),e.lastUpdateId=i.id,e.updateRequested&&e.processUpdate(this._updateParameters),"layerViews"in e&&e.layerViews.forEach(this._updateLayerView,this)}};function Bp(){return Promise.all([Promise.resolve().then(()=>mEt),Promise.resolve().then(()=>yPt)])}const sX=()=>Bp().then(()=>Promise.resolve().then(()=>ior)),rV=()=>Bp().then(()=>Promise.resolve().then(()=>dor)),Jit={"base-dynamic":()=>Bp().then(()=>Promise.resolve().then(()=>vor)),"base-tile":sX,"bing-maps":sX,csv:rV,"geo-rss":()=>Bp().then(()=>Promise.resolve().then(()=>_or)),feature:rV,geojson:rV,graphics:()=>Bp().then(()=>Promise.resolve().then(()=>wor)),group:()=>Bp().then(()=>Promise.resolve().then(()=>Sor)),imagery:()=>Bp().then(()=>Promise.resolve().then(()=>lar)),"imagery-tile":()=>Bp().then(()=>Promise.resolve().then(()=>JPt)),kml:()=>Bp().then(()=>Promise.resolve().then(()=>Klr)),"knowledge-graph":()=>Bp().then(()=>Promise.resolve().then(()=>tOt)),"link-chart":()=>Bp().then(()=>Promise.resolve().then(()=>tOt)),"knowledge-graph-sublayer":rV,"map-image":()=>Bp().then(()=>Promise.resolve().then(()=>Zlr)),"map-notes":()=>Bp().then(()=>Promise.resolve().then(()=>eur)),media:()=>Bp().then(()=>Promise.resolve().then(()=>nur)),"ogc-feature":()=>Bp().then(()=>Promise.resolve().then(()=>our)),"open-street-map":sX,"oriented-imagery":rV,route:()=>Bp().then(()=>Promise.resolve().then(()=>xur)),stream:()=>Bp().then(()=>Promise.resolve().then(()=>Sur)),"subtype-group":()=>Bp().then(()=>Promise.resolve().then(()=>Tur)),tile:sX,"vector-tile":()=>Bp().then(()=>Promise.resolve().then(()=>lcr)),wcs:()=>Bp().then(()=>Promise.resolve().then(()=>JPt)),"web-tile":sX,wfs:rV,wms:()=>Bp().then(()=>Promise.resolve().then(()=>ccr)),wmts:()=>Bp().then(()=>Promise.resolve().then(()=>pcr)),"line-of-sight":null,"base-elevation":null,"building-scene":null,dimension:null,elevation:null,"integrated-mesh":null,"point-cloud":null,voxel:null,scene:null,unknown:null,unsupported:null};function lai(t){const e=t.declaredClass?t.declaredClass.slice(t.declaredClass.lastIndexOf(".")+1):"Unknown",i=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new st(`${i}:view-not-supported`,`${e} is not supported in 2D`)}const Zit={hasLayerViewModule:t=>ve(Jit[t.type]),importLayerView:t=>{const e=Jit[t.type];if(lt(e))throw lai(t);return e(t)}};function uai(t,e){const{spatialReference:i}=e,r=[e.x,e.y];let n=Number.POSITIVE_INFINITY,s=0,o=0;const a=[0,0],l=t.type==="extent"?[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]:t.rings;for(const c of l)for(let h=0;hh.clone()),e.sort((h,p)=>p.scale-h.scale),e.forEach((h,p)=>h.level=p);for(const h of e)!l&&i>0&&i>=h.scale&&(o=h.level,l=!0),!c&&r>0&&r>=h.scale&&(a=t?t.level:-1,c=!0),t=h;n===-1&&(n=i===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]),i=e[n].scale,r=e[s].scale,e.splice(0,n),e.splice(s-n+1,e.length),e.forEach((h,p)=>{this._lodByScale[h.scale]=h,this._scales[p]=h.scale}),this._set("effectiveLODs",e),this._set("effectiveMinZoom",n),this._set("effectiveMaxZoom",s),this._set("effectiveMinScale",i),this._set("effectiveMaxScale",r)}constrain(t,e){if(e&&t.scale===e.scale)return t;const i=this.effectiveMinScale,r=this.effectiveMaxScale,n=t.targetGeometry,s=e&&e.targetGeometry,o=r!==0&&t.scalei;if(o||a){const l=a?i:r;if(e&&s){const c=(l-e.scale)/(t.scale-e.scale);n.x=s.x+(n.x-s.x)*c,n.y=s.y+(n.y-s.y)*c}t.scale=l}return this.snapToZoom&&this.effectiveLODs&&(t.scale=this._getClosestScale(t.scale)),t}fit(t){if(!this.effectiveLODs||!this.snapToZoom)return this.constrain(t,null);const e=this.scaleToZoom(t.scale),i=Math.abs(e-Math.floor(e));return t.scale=this.zoomToScale(i>.99?Math.round(e):Math.floor(e)),t}zoomToScale(t){if(!this.effectiveLODs)return 0;t-=this.effectiveMinZoom,t=Math.max(0,t);const e=this._scales;if(t<=0)return e[0];if(t>=e.length)return e[e.length-1];const i=Math.round(t-.5),r=Math.round(t);return e[r]+(r-t)*(e[i]-e[r])}scaleToZoom(t){if(!this.effectiveLODs)return-1;const e=this._scales;let i,r;if(t>=e[0])return this.effectiveMinZoom;if(t<=e[e.length-1])return this.effectiveMaxZoom;for(let n=0;nt&&rMath.abs(i-t)<=Math.abs(e-t)?i:e,this._scales[0])),this._lodByScale[t].scale}};E([N({readOnly:!0})],y_.prototype,"effectiveLODs",void 0),E([N({readOnly:!0})],y_.prototype,"effectiveMinZoom",void 0),E([N({readOnly:!0})],y_.prototype,"effectiveMaxZoom",void 0),E([N({readOnly:!0})],y_.prototype,"effectiveMinScale",void 0),E([N({readOnly:!0})],y_.prototype,"effectiveMaxScale",void 0),E([N()],y_.prototype,"lods",void 0),E([N()],y_.prototype,"minZoom",void 0),E([N()],y_.prototype,"maxZoom",void 0),E([N()],y_.prototype,"minScale",void 0),E([N()],y_.prototype,"maxScale",void 0),E([N()],y_.prototype,"snapToZoom",void 0),y_=zIe=E([dt("esri.views.2d.constraints.ZoomConstraint")],y_);const ert=y_,cai={base:null,key:"type",typeMap:{extent:Ar,polygon:To}};let Vp=class extends Tn{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}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 _defaultLODs(){const e=this.view?.defaultsFromMap?.tileInfo,i=this.view?.spatialReference;return e&&i&&e.spatialReference.equals(i)?e.lods:null}get _geometry(){return new bN({geometry:this.geometry,spatialReference:this.view?.spatialReference})}get _rotation(){return new Qit({rotationEnabled:this.rotationEnabled})}get _zoom(){const e=this._get("_zoom"),i=this.lods||this._defaultLODs,r=this.minZoom,n=this.maxZoom,s=this.minScale,o=this.maxScale,a=this.snapToZoom;return e&&e.lods===i&&e.minZoom===r&&e.maxZoom===n&&e.minScale===s&&e.maxScale===o&&e.snapToZoom===a?e:new ert({lods:i,minZoom:r,maxZoom:n,minScale:s,maxScale:o,snapToZoom:a})}canZoomInTo(e){const i=this.effectiveMaxScale;return i===0||e>=i}canZoomOutTo(e){const i=this.effectiveMinScale;return i===0||e<=i}constrain(e,i){return this._zoom.constrain(e,i),this._rotation.constrain(e,i),this._geometry.constrain(e,i),e}constrainByGeometry(e){return this._geometry.constrain(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)}};E([N({readOnly:!0})],Vp.prototype,"effectiveLODs",null),E([N({readOnly:!0})],Vp.prototype,"effectiveMinScale",null),E([N({readOnly:!0})],Vp.prototype,"effectiveMaxScale",null),E([N({readOnly:!0})],Vp.prototype,"effectiveMinZoom",null),E([N({readOnly:!0})],Vp.prototype,"effectiveMaxZoom",null),E([N({types:cai,value:null})],Vp.prototype,"geometry",null),E([N({type:[rs]})],Vp.prototype,"lods",void 0),E([N()],Vp.prototype,"minScale",void 0),E([N()],Vp.prototype,"maxScale",void 0),E([N()],Vp.prototype,"minZoom",void 0),E([N()],Vp.prototype,"maxZoom",void 0),E([N()],Vp.prototype,"rotationEnabled",void 0),E([N()],Vp.prototype,"snapToZoom",void 0),E([N()],Vp.prototype,"view",void 0),E([N({readOnly:!0})],Vp.prototype,"version",null),E([N()],Vp.prototype,"_defaultLODs",null),E([N({type:bN})],Vp.prototype,"_geometry",null),E([N({type:Qit})],Vp.prototype,"_rotation",null),E([N({readOnly:!0,type:ert})],Vp.prototype,"_zoom",null),Vp=E([dt("esri.views.2d.MapViewConstraints")],Vp);const trt=Vp;function aX(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function hai(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function wN(t,e,i,r,n,s,o,a,l,c){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t[4]=s,t[5]=o,t[6]=a,t[7]=l,t[8]=c,t}function iP(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function lX(t,e){if(t===e){const i=e[1],r=e[2],n=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=r,t[7]=n}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function irt(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8],p=h*o-a*c,y=-h*s+a*l,v=c*s-o*l;let x=i*p+r*y+n*v;return x?(x=1/x,t[0]=p*x,t[1]=(-h*r+n*c)*x,t[2]=(a*r-n*o)*x,t[3]=y*x,t[4]=(h*i-n*l)*x,t[5]=(-a*i+n*s)*x,t[6]=v*x,t[7]=(-c*i+r*l)*x,t[8]=(o*i-r*s)*x,t):null}function HIe(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8];return t[0]=o*h-a*c,t[1]=n*c-r*h,t[2]=r*a-n*o,t[3]=a*l-s*h,t[4]=i*h-n*l,t[5]=n*s-i*a,t[6]=s*c-o*l,t[7]=r*l-i*c,t[8]=i*o-r*s,t}function dai(t){const e=t[0],i=t[1],r=t[2],n=t[3],s=t[4],o=t[5],a=t[6],l=t[7],c=t[8];return e*(c*s-o*l)+i*(-c*n+o*a)+r*(l*n-s*a)}function cv(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],h=e[7],p=e[8],y=i[0],v=i[1],x=i[2],I=i[3],P=i[4],F=i[5],k=i[6],j=i[7],V=i[8];return t[0]=y*r+v*o+x*c,t[1]=y*n+v*a+x*h,t[2]=y*s+v*l+x*p,t[3]=I*r+P*o+F*c,t[4]=I*n+P*a+F*h,t[5]=I*s+P*l+F*p,t[6]=k*r+j*o+V*c,t[7]=k*n+j*a+V*h,t[8]=k*s+j*l+V*p,t}function dg(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],h=e[7],p=e[8],y=i[0],v=i[1];return t[0]=r,t[1]=n,t[2]=s,t[3]=o,t[4]=a,t[5]=l,t[6]=y*r+v*o+c,t[7]=y*n+v*a+h,t[8]=y*s+v*l+p,t}function wT(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],c=e[6],h=e[7],p=e[8],y=Math.sin(i),v=Math.cos(i);return t[0]=v*r+y*o,t[1]=v*n+y*a,t[2]=v*s+y*l,t[3]=v*o-y*r,t[4]=v*a-y*n,t[5]=v*l-y*s,t[6]=c,t[7]=h,t[8]=p,t}function rP(t,e,i){const r=i[0],n=i[1],s=i[2];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t[6]=s*e[6],t[7]=s*e[7],t[8]=s*e[8],t}function Vle(t,e,i){const r=i[0],n=i[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t}function WIe(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function pai(t,e){const i=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function fai(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function mai(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function gai(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=i+i,a=r+r,l=n+n,c=i*o,h=r*o,p=r*a,y=n*o,v=n*a,x=n*l,I=s*o,P=s*a,F=s*l;return t[0]=1-p-x,t[3]=h-F,t[6]=y+P,t[1]=h+F,t[4]=1-c-x,t[7]=v-I,t[2]=y-P,t[5]=v+I,t[8]=1-c-p,t}function yai(t,e){const i=e[0],r=e[1],n=e[2],s=e[4],o=e[5],a=e[6],l=e[8],c=e[9],h=e[10],p=h*o-a*c,y=-h*s+a*l,v=c*s-o*l,x=i*p+r*y+n*v;if(!x)return null;const I=1/x;return t[0]=p*I,t[1]=(-h*r+n*c)*I,t[2]=(a*r-n*o)*I,t[3]=y*I,t[4]=(h*i-n*l)*I,t[5]=(-a*i+n*s)*I,t[6]=v*I,t[7]=(-c*i+r*l)*I,t[8]=(o*i-r*s)*I,t}function nP(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8],p=e[9],y=e[10],v=e[11],x=e[12],I=e[13],P=e[14],F=e[15],k=i*a-r*o,j=i*l-n*o,V=i*c-s*o,Y=r*l-n*a,X=r*c-s*a,Z=n*c-s*l,ie=h*I-p*x,ce=h*P-y*x,he=h*F-v*x,_e=p*P-y*I,xe=p*F-v*I,Pe=y*F-v*P;let ke=k*Pe-j*xe+V*_e+Y*he-X*ce+Z*ie;return ke?(ke=1/ke,t[0]=(a*Pe-l*xe+c*_e)*ke,t[1]=(l*he-o*Pe-c*ce)*ke,t[2]=(o*xe-a*he+c*ie)*ke,t[3]=(n*xe-r*Pe-s*_e)*ke,t[4]=(i*Pe-n*he+s*ce)*ke,t[5]=(r*he-i*xe-s*ie)*ke,t[6]=(I*Z-P*X+F*Y)*ke,t[7]=(P*V-x*Z-F*j)*ke,t[8]=(x*X-I*V+F*k)*ke,t):null}function vai(t,e,i){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/i,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function _ai(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function bai(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2)}function wai(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t[6]=e[6]+i[6],t[7]=e[7]+i[7],t[8]=e[8]+i[8],t}function rrt(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t[6]=e[6]-i[6],t[7]=e[7]-i[7],t[8]=e[8]-i[8],t}function xai(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*i,t}function Sai(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t[3]=e[3]+i[3]*r,t[4]=e[4]+i[4]*r,t[5]=e[5]+i[5]*r,t[6]=e[6]+i[6]*r,t[7]=e[7]+i[7]*r,t[8]=e[8]+i[8]*r,t}function Cai(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Tai(t,e){const i=t[0],r=t[1],n=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8],p=e[0],y=e[1],v=e[2],x=e[3],I=e[4],P=e[5],F=e[6],k=e[7],j=e[8],V=qv();return Math.abs(i-p)<=V*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(r-y)<=V*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-v)<=V*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(s-x)<=V*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(o-I)<=V*Math.max(1,Math.abs(o),Math.abs(I))&&Math.abs(a-P)<=V*Math.max(1,Math.abs(a),Math.abs(P))&&Math.abs(l-F)<=V*Math.max(1,Math.abs(l),Math.abs(F))&&Math.abs(c-k)<=V*Math.max(1,Math.abs(c),Math.abs(k))&&Math.abs(h-j)<=V*Math.max(1,Math.abs(h),Math.abs(j))}function qIe(t){const e=qv(),i=t[0],r=t[1],n=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8];return Math.abs(1-(i*i+s*s+l*l))<=e&&Math.abs(1-(r*r+o*o+c*c))<=e&&Math.abs(1-(n*n+a*a+h*h))<=e}Object.freeze(Object.defineProperty({__proto__:null,add:wai,adjoint:HIe,copy:hai,determinant:dai,equals:Tai,exactEquals:Cai,frob:bai,fromMat2d:mai,fromMat4:aX,fromQuat:gai,fromRotation:pai,fromScaling:fai,fromTranslation:WIe,identity:iP,invert:irt,isOrthoNormal:qIe,mul:cv,multiply:cv,multiplyScalar:xai,multiplyScalarAndAdd:Sai,normalFromMat4:nP,normalFromMat4Legacy:yai,projection:vai,rotate:wT,scale:rP,scaleByVec2:Vle,set:wN,str:_ai,sub:rrt,subtract:rrt,translate:dg,transpose:lX},Symbol.toStringTag,{value:"Module"}));function Dl(){const t=new Float32Array(9);return t[0]=1,t[4]=1,t[8]=1,t}function nrt(t){const e=new Float32Array(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function jle(t,e,i,r,n,s,o,a,l){const c=new Float32Array(9);return c[0]=t,c[1]=e,c[2]=i,c[3]=r,c[4]=n,c[5]=s,c[6]=o,c[7]=a,c[8]=l,c}function Eai(t,e){return new Float32Array(t,e,9)}Object.freeze(Object.defineProperty({__proto__:null,clone:nrt,create:Dl,createView:Eai,fromValues:jle},Symbol.toStringTag,{value:"Module"}));function xT(){return new Float32Array(2)}function Iai(t){const e=new Float32Array(2);return e[0]=t[0],e[1]=t[1],e}function mp(t,e){const i=new Float32Array(2);return i[0]=t,i[1]=e,i}function Aai(t,e){return new Float32Array(t,e,2)}function srt(){return xT()}function ort(){return mp(1,1)}function art(){return mp(1,0)}function lrt(){return mp(0,1)}const urt=srt(),crt=ort(),Pai=art(),Oai=lrt();Object.freeze(Object.defineProperty({__proto__:null,ONES:crt,UNIT_X:Pai,UNIT_Y:Oai,ZEROS:urt,clone:Iai,create:xT,createView:Aai,fromValues:mp,ones:ort,unitX:art,unitY:lrt,zeros:srt},Symbol.toStringTag,{value:"Module"}));function Rai(t){return t instanceof Float32Array&&t.length>=2}function Mai(t){return Array.isArray(t)&&t.length>=2}function YIe(t){return Rai(t)||Mai(t)}var XIe;const sP=[0,0];let EM=XIe=class extends Ui{constructor(t){super(t),this._viewpoint2D={center:rl(),rotation:0,scale:0,spatialReference:void 0},this.center=[0,0],this.extent=new Ar,this.id=0,this.inverseTransform=CM(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=CM(),this.transformNoRotation=CM(),this.displayMat3=Dl(),this.displayViewMat3=Dl(),this.viewMat3=Dl(),this.viewMat2d=g_(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(t){this._set("pixelRatio",t),this._update()}set size(t){this._set("size",t),this._update()}set viewpoint(t){if(t){const e=this._viewpoint2D,i=t.targetGeometry;e.center[0]=i.x,e.center[1]=i.y,e.rotation=t.rotation,e.scale=t.scale,e.spatialReference=i.spatialReference}this._update()}copy(t){const e=this.size,i=this.viewpoint;return i&&e?(this.viewpoint=B2(i,t.viewpoint),this._set("size",tV(e,t.size))):(this.viewpoint=t.viewpoint.clone(),this._set("size",[t.size[0],t.size[1]])),this._set("pixelRatio",t.pixelRatio),this}clone(){return new XIe({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(t,e,i){return YIe(e)?m0(t,e,this.inverseTransform):(sP[0]=e,sP[1]=i,m0(t,sP,this.inverseTransform))}toScreen(t,e,i){return YIe(e)?m0(t,e,this.transform):(sP[0]=e,sP[1]=i,m0(t,sP,this.transform))}toScreenNoRotation(t,e,i){return YIe(e)?m0(t,e,this.transformNoRotation):(sP[0]=e,sP[1]=i,m0(t,sP,this.transformNoRotation))}getScreenTransform(t,e){const{center:i}=this._viewpoint2D,r=this._get("pixelRatio")||1,n=this._get("size");return NIe(t,i,n,e,0,r),t}_update(){const{center:t,spatialReference:e,scale:i,rotation:r}=this._viewpoint2D,n=this._get("pixelRatio")||1,s=this._get("size"),o=new p_({targetGeometry:new er(t[0],t[1],e),scale:i,rotation:r});if(this._set("viewpoint",o),!s||!e||!i)return;this.resolution=iV(o),this.rotation=r,this.scale=i,this.spatialReference=e,tV(this.center,t);const a=s[0]!==0?2/s[0]:0,l=s[1]!==0?-2/s[1]:0;wN(this.displayMat3,a,0,0,0,l,0,-1,1,1);const c=iP(this.viewMat3),h=mp(s[0]/2,s[1]/2),p=mp(-s[0]/2,-s[1]/2),y=OL(r);dg(c,c,h),wT(c,c,y),dg(c,c,p),cv(this.displayViewMat3,this.displayMat3,c);const v=Ple(this.viewMat2d,h);return gN(v,v,y),vM(v,v,p),Woi(this.extent,o,s),kIe(this.transform,o,s,n),gIe(this.inverseTransform,this.transform),Qoi(this.transformNoRotation,o,s,n),this.worldScreenWidth=eai(this.spatialReference,this.resolution),this._set("id",this.id+1),this}};E([N({readOnly:!0})],EM.prototype,"id",void 0),E([N({value:1,json:{write:!0}})],EM.prototype,"pixelRatio",null),E([N({json:{write:!0}})],EM.prototype,"size",null),E([N()],EM.prototype,"spatialReference",void 0),E([N({type:p_,json:{write:!0}})],EM.prototype,"viewpoint",null),EM=XIe=E([dt("esri.views.2d.ViewState")],EM);const hrt=EM;var KIe,JIe;let oP=KIe=class extends Tn{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new KIe({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};E([N()],oP.prototype,"left",void 0),E([N()],oP.prototype,"top",void 0),E([N()],oP.prototype,"right",void 0),E([N()],oP.prototype,"bottom",void 0),oP=KIe=E([dt("esri.views.2d.PaddedViewState.Padding")],oP);let nV=JIe=class extends hrt{constructor(...t){super(...t),this.paddedViewState=new hrt,this._updateContent=(()=>{const e=rl();return()=>{const i=this._get("size"),r=this._get("padding");if(!i||!r)return;const n=this.paddedViewState;ga(e,r.left+r.right,r.top+r.bottom),eX(e,i,e),tV(n.size,e);const s=n.viewpoint;s&&(this.viewpoint=s)}})(),this.addHandles(sr(()=>[this.size,this.padding],()=>this._updateContent(),qu)),this.padding=new oP,this.size=[0,0]}set padding(t){this._set("padding",t||new oP)}set viewpoint(t){if(t){const e=t.clone();this.paddedViewState.viewpoint=t,tai(e,t,this._get("size"),this._get("padding"));const i=this._viewpoint2D,r=e.targetGeometry;i.center[0]=r.x,i.center[1]=r.y,i.rotation=e.rotation,i.scale=e.scale,i.spatialReference=r.spatialReference,this._update()}}clone(){return new JIe({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};E([N()],nV.prototype,"paddedViewState",void 0),E([N({type:oP})],nV.prototype,"padding",null),E([N()],nV.prototype,"viewpoint",null),nV=JIe=E([dt("esri.views.2d.PaddedViewState")],nV);const Dai=nV;let Fai=class{constructor(e,i){this.item=e,this.controller=i,this.promise=null}},xN=class{constructor(e){this._deferreds=new Map,this._controllers=new Map,this._processingItems=new Map,this._isPaused=!1,this._schedule=null,this._task=null,this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new lq(e.peeker),this.process=e.process;const i=e.scheduler;e.priority&&ve(i)&&(this._task=i.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule&&(this._schedule.remove(),this._schedule=null),this._task&&(this._task.remove(),this._task=null)}get length(){return this._processingItems.size+this._queue.length}abort(e){const i=this._controllers.get(e);i&&i.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach(i=>e.push(i)),this._controllers.clear(),e.forEach(i=>i.abort()),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((i,r)=>e(r))}get(e){const i=this._deferreds.get(e);return i?i.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._isPaused||(this._isPaused=!0,this._cancelNext())}push(e,i){const r=this.get(e);if(r)return r;const n=new AbortController;let s=null;i&&(s=ap(i,()=>n.abort()));const o=()=>{const h=this._processingItems.get(e);h&&h.controller.abort(),a(),c.reject(Sc())},a=()=>{l.remove(),ve(s)&&s.remove(),this._deferreds.delete(e),this._controllers.delete(e),this._queue.remove(e),this._processingItems.delete(e),this._scheduleNext()},l=F8(n.signal,o),c=Kx();return this._deferreds.set(e,c),this._controllers.set(e,n),c.promise.then(a,a),this._queue.push(e),this._scheduleNext(),c.promise}last(){return this._queue.last()}peek(){return this._queue.peek()}popLast(){return this._queue.popLast()}reset(){const e=[];this._processingItems.forEach(i=>e.push(i)),this._processingItems.clear();for(const i of e)this._queue.push(i.item),i.controller.abort();this._scheduleNext()}resume(){this._isPaused&&(this._isPaused=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._isPaused&&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,i)}get test(){return{update:e=>this.runTask(e)}}};function Lai(t,e){return t.length=0,e.forEach(i=>t.push(i)),t}const ZIe=new Set,Gle=[],sV=new Map,drt=[0,0];let IM=class extends Tn{constructor(e){super(e),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:e,process:i}=this;this._queue=new xN({concurrency:e,process:(r,n)=>{const s=this._keyToItem.get(r);return i(s,{signal:n})},peeker:r=>r.values().next().value})}destroy(){this.clear(),this._queue=da(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}get updating(){return this.length>0||this.onGoingCount>0}abort(e){const i=typeof e=="string"?e:e.id;this._queue.abort(i)}clear(){this._queue.clear(),this._keyToItem.clear(),this.notifyChange("updating")}has(e){return typeof e=="string"?this._keyToItem.has(e):this._keyToItem.has(e.id)}isOngoing(e){const i=typeof e=="string"?e:e.id;return this.has(i)&&this._queue.isOngoing(i)}pause(){this._queue.pause()}push(e,i){const r=e.key.id+"-"+i;if(this.has(r))return this.get(r);const n=this._queue.push(r),s=()=>{this._keyToItem.delete(r),this.notifyChange("updating")};return this._keyToItem.set(r,e),n.then(s,s),this.notifyChange("updating"),n}reset(){this._queue.reset(),this.notifyChange("updating")}resume(){this._queue.resume()}_peekByScaleFirst(e){if(!this.state)return e.values().next().value;const i=this.tileInfoView;let r=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY;e.forEach(h=>{const p=this._keyToItem.get(h),y=this.tileInfoView.getTileScale(p.key);sV.has(y)||(sV.set(y,[]),r=Math.max(y,r),n=Math.min(y,n)),sV.get(y).push(p.key),ZIe.add(y)});let s=this.state.scale;sV.has(s)||(Lai(Gle,ZIe),Gle.sort((h,p)=>h-p),s=Gle.reduce((h,p)=>Math.abs(p-s){const y=a.denormalizeCol(h.col,h.world),v=a.denormalizeCol(p.col,p.world);return Math.sqrt((l-y)*(l-y)+(c-h.row)*(c-h.row))-Math.sqrt((l-v)*(l-v)+(c-p.row)*(c-p.row))}),ZIe.clear(),sV.clear(),o[0].id}_peekByCenterFirst(e){if(!this.state)return e.values().next().value;const i=this.tileInfoView,r=this.state.center;let n,s=Number.POSITIVE_INFINITY;return e.forEach(o=>{const a=this._keyToItem.get(o);i.getTileCoords(drt,a.key);const l=iX(drt,r);l=0&&this.row===e.row>>i&&this.col===e.col>>i&&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 I8(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,i,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=+i,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 I8(this.level-1,this.row>>1,this.col>>1,this.world)}getChildKeys(){const e=this.level+1,i=this.row<<1,r=this.col<<1,n=this.world;return[new I8(e,i,r,n),new I8(e,i,r+1,n),new I8(e,i+1,r,n),new I8(e,i+1,r+1,n)]}compareRowMajor(e){return this.rowe.row?1:this.cole.col?1:0}};Eh.pool=new yC(Eh,null,null,25,50);function AM(t,e){return[t,e]}function SN(t,e,i){return t[0]=e,t[1]=i,t}function Nai(t,e,i,r,n){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t}const V2=new Eh("0/0/0/0");let kai=class ZLt{static create(e,i,r=null){const n=vd(e.spatialReference),s=i.origin||AM(e.origin.x,e.origin.y),o=AM(e.size[0]*i.resolution,e.size[1]*i.resolution),a=AM(-1/0,-1/0),l=AM(1/0,1/0),c=AM(1/0,1/0);ve(r)&&(SN(a,Math.max(0,Math.floor((r.xmin-s[0])/o[0])),Math.max(0,Math.floor((s[1]-r.ymax)/o[1]))),SN(l,Math.max(0,Math.floor((r.xmax-s[0])/o[0])),Math.max(0,Math.floor((s[1]-r.ymin)/o[1]))),SN(c,l[0]-a[0]+1,l[1]-a[1]+1));const{cols:h,rows:p}=i;let y,v,x,I;return!r&&h&&p&&(SN(a,h[0],p[0]),SN(l,h[1],p[1]),SN(c,h[1]-h[0]+1,p[1]-p[0]+1)),e.isWrappable?(y=AM(Math.ceil(Math.round((n.valid[1]-n.valid[0])/i.resolution)/e.size[0]),c[1]),v=AM(Math.floor((n.origin[0]-s[0])/o[0]),a[1]),x=AM(y[0]+v[0]-1,l[1]),I=!0):(v=a,x=l,y=c,I=!1),new ZLt(i.level,i.resolution,i.scale,s,a,l,c,o,v,x,y,I)}constructor(e,i,r,n,s,o,a,l,c,h,p,y){this.level=e,this.resolution=i,this.scale=r,this.origin=n,this.first=s,this.last=o,this.size=a,this.norm=l,this.worldStart=c,this.worldEnd=h,this.worldSize=p,this.wrap=y}normalizeCol(e){if(!this.wrap)return e;const i=this.worldSize[0];return e<0?i-1-Math.abs((e+1)%i):e%i}denormalizeCol(e,i){return this.wrap?this.worldSize[0]*i+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,i,r=!1){V2.set(i);const n=r?V2.col:this.denormalizeCol(V2.col,V2.world),s=V2.row;return Nai(e,this.getXForColumn(n),this.getYForRow(s+1),this.getXForColumn(n+1),this.getYForRow(s)),e}getTileCoords(e,i,r=!1){V2.set(i);const n=r?V2.col:this.denormalizeCol(V2.col,V2.world);return Array.isArray(e)?SN(e,this.getXForColumn(n),this.getYForRow(V2.row)):(e.x=this.getXForColumn(n),e.y=this.getYForRow(V2.row)),e}},aP=class{constructor(){this.spans=[]}acquire(e){this.lodInfo=e}release(){this.lodInfo=null,this.spans.length=0}forEach(e,i){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 c=a;c<=l;c++)e.call(i,s,o,n.normalizeCol(c),n.getWorldForColumn(c))}};aP.pool=new yC(aP);let QIe=class{constructor(e,i,r){this.row=e,this.colFrom=i,this.colTo=r}};const Id=new Eh("0/0/0/0");let $ai=class QLt{static create(e,i){e[1]>i[1]&&([e,i]=[i,e]);const[r,n]=e,[s,o]=i,a=s-r,l=o-n,c=l!==0?a/l:0,h=(Math.ceil(n)-n)*c,p=(Math.floor(n)-n)*c;return new QLt(r,Math.floor(n),Math.ceil(o),c,a<0?h:p,a<0?p:h,a<0?s:r,a<0?r:s)}constructor(e,i,r,n,s,o,a,l){this.x=e,this.ymin=i,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 tb=[[0,0],[0,0],[0,0],[0,0]],Bai=1e-6;let CN=class{constructor(e,i=null){this.tileInfo=e,this.fullExtent=i,this.scales=[],this._infoByScale={},this._infoByLevel={};const r=e.lods.slice();r.sort((s,o)=>o.scale-s.scale);const n=this._lodInfos=r.map(s=>kai.create(e,s,i));r.forEach((s,o)=>{this._infoByLevel[s.level]=n[o],this._infoByScale[s.scale]=n[o],this.scales[o]=s.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,i,r=!1){Id.set(i);const n=this._infoByLevel[Id.level];return n?n.getTileBounds(e,Id,r):e}getTileCoords(e,i,r=!1){Id.set(i);const n=this._infoByLevel[Id.level];return n?n.getTileCoords(e,Id,r):e}getTileCoverage(e,i=192,r="closest"){const n=r==="closest"?this.getClosestInfoForScale(e.scale):this.getSmallestInfoForScale(e.scale),s=aP.pool.acquire(n),o=this._wrap;let a,l,c,h=1/0,p=-1/0;const y=s.spans;tb[0][0]=tb[0][1]=tb[1][1]=tb[3][0]=-i,tb[1][0]=tb[2][0]=e.size[0]+i,tb[2][1]=tb[3][1]=e.size[1]+i;for(const P of tb)e.toMap(P,P),P[0]=n.getColumnForX(P[0]),P[1]=n.getRowForY(P[1]);const v=[];let x=3;for(let P=0;P<4;P++){if(tb[P][1]===tb[x][1]){x=P;continue}const F=$ai.create(tb[P],tb[x]);h=Math.min(F.ymin,h),p=Math.max(F.ymax,p),v[F.ymin]===void 0&&(v[F.ymin]=[]),v[F.ymin].push(F),x=P}if(h==null||p==null||p-h>100)return null;let I=[];for(a=h;a=0;P--){const F=I[P];l=Math.min(l,F.getLeftCol()),c=Math.max(c,F.getRightCol())}if(l=Math.floor(l),c=Math.floor(c),a>=n.first[1]&&a<=n.last[1])if(o)if(n.size[0]n.last[0]||c=0;P--){const F=I[P];F.ymax>=a?F.incrRow():I.splice(P,1)}}return s}getTileParentId(e){Id.set(e);const i=this._infoByLevel[Id.level],r=this._lodInfos.indexOf(i)-1;return r<0?null:(this._getTileIdAtLOD(Id,this._lodInfos[r],Id),Id.id)}getTileResolution(e){const i=this._infoByLevel[typeof e=="object"?e.level:e];return i?i.resolution:-1}getTileScale(e){const i=this._infoByLevel[e.level];return i?i.scale:-1}intersects(e,i){Id.set(i);const r=this._infoByLevel[Id.level],n=e.lodInfo;if(n.resolution>r.resolution){this._getTileIdAtLOD(Id,n,Id);const o=n.denormalizeCol(Id.col,Id.world);for(const a of e.spans)if(a.row===Id.row&&a.colFrom<=o&&a.colTo>=o)return!0}if(n.resolution(I[0]=Math.min(I[0],P.row),I[1]=Math.max(I[1],P.row),I[2]=Math.min(I[2],P.colFrom),I[3]=Math.max(I[3],P.colTo),I),[1/0,-1/0,1/0,-1/0]),h=r.denormalizeCol(Id.col,Id.world),p=n.getColumnForX(r.getXForColumn(h)),y=n.getRowForY(r.getYForRow(Id.row)),v=n.getColumnForX(r.getXForColumn(h+1))-1,x=n.getRowForY(r.getYForRow(Id.row+1))-1;return!(p>c||va||xo.row===Id.row&&o.colFrom<=s&&o.colTo>=s)}normalizeBounds(e,i,r){if(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],this._wrap){const n=vd(this.tileInfo.spatialReference),s=-r*(n.valid[1]-n.valid[0]);e[0]+=s,e[2]+=s}return e}getSmallestInfoForScale(e){const i=this.scales;if(this._infoByScale[e])return this._infoByScale[e];if(e>i[0])return this._infoByScale[i[0]];for(let r=1;ri[r]+Bai)return this._infoByScale[i[r-1]];return this._infoByScale[i[i.length-1]]}getClosestInfoForScale(e){const i=this.scales;return this._infoByScale[e]||(e=i.reduce((r,n)=>Math.abs(n-e)=0;r--)if(et.push(i)),t}const eAe=new Set,Ule=[],oV=new Map,prt=[0,0];let lP=class extends Tn{constructor(e){super(e),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:e,process:i,strategy:r}=this;this._queue=new xN({concurrency:e,process:(n,s)=>{const o=this._keyToItem.get(n);return i(o,{signal:s})},peeker:r==="scale-first"?n=>this._peekByScaleFirst(n):n=>this._peekByCenterFirst(n)})}destroy(){this.clear(),this._queue=da(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}get updating(){return this.length>0||this.onGoingCount>0}abort(e){const i=typeof e=="string"?e:e.id;this._queue.abort(i)}clear(){this._queue.clear(),this._keyToItem.clear(),this.notifyChange("updating")}has(e){return typeof e=="string"?this._keyToItem.has(e):this._keyToItem.has(e.id)}isOngoing(e){const i=typeof e=="string"?e:e.id;return this.has(i)&&this._queue.isOngoing(i)}pause(){this._queue.pause()}push(e){const i=e.key.id;if(this._queue.has(i))return this._queue.get(i);const r=this._queue.push(i),n=()=>{this._keyToItem.delete(i),this.notifyChange("updating")};return this._keyToItem.set(i,e),r.then(n,n),this.notifyChange("updating"),r}reset(){this._queue.reset()}resume(){this._queue.resume()}_peekByScaleFirst(e){if(!this.state)return e.values().next().value;const i=this.tileInfoView;let r=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY;e.forEach(h=>{const p=this._keyToItem.get(h),y=this.tileInfoView.getTileScale(p.key);oV.has(y)||(oV.set(y,[]),r=Math.max(y,r),n=Math.min(y,n)),oV.get(y).push(p.key),eAe.add(y)});let s=this.state.scale;oV.has(s)||(Vai(Ule,eAe),Ule.sort((h,p)=>h-p),s=Ule.reduce((h,p)=>Math.abs(p-s){const y=a.denormalizeCol(h.col,h.world),v=a.denormalizeCol(p.col,p.world);return Math.sqrt((l-y)*(l-y)+(c-h.row)*(c-h.row))-Math.sqrt((l-v)*(l-v)+(c-p.row)*(c-p.row))}),eAe.clear(),oV.clear(),o[0].id}_peekByCenterFirst(e){if(!this.state)return e.values().next().value;const i=this.tileInfoView,r=this.state.center;let n,s=Number.POSITIVE_INFINITY;return e.forEach(o=>{const a=this._keyToItem.get(o);i.getTileCoords(prt,a.key);const l=iX(prt,r);lthis.maxSize&&s>=0;)s!==e&&(n=this._pruneAroundCenterTile(n,i,r,s)),s--;n>this.maxSize&&(n=this._pruneAroundCenterTile(n,i,r,e))}_pruneAroundCenterTile(e,i,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],c=r*o[1],h=[0,0],p=[0,0];for(s.sort((y,v)=>(h[0]=a.x+l*(y.col+.5),h[1]=a.y-c*(y.row+.5),p[0]=a.x+l*(v.col+.5),p[1]=a.y-c*(v.row+.5),$le(h,i)-$le(p,i)));s.length>0;){const y=s.pop();if(this._removeTile(y.id),--e===this.maxSize)break}return e}_removeTile(e){const i=this._tilePerId.get(e);this._removedFunc&&i&&this._removedFunc(i),frt(this._tilePerId,e)}};function frt(t,e){t.delete(e)}const TN=new Eh(0,0,0,0),Cw=new Map,lV=[],zle=[];let uX=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,this.resampling=e.resampling==null||!!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 jai(e.cacheSize,this.tileInfoView,i=>{this.releaseTile(i)}))}destroy(){this.tileIndex.clear()}update(e){const{resampling:i,tileIndex:r}=this,n=this.tileInfoView.getTileCoverage(e.state,this.buffer,this.coveragePolicy);if(zle.length=0,lV.length=0,Cw.clear(),!n)return;const{minScale:s,maxScale:o}=this.tileInfoView.tileInfo,{spans:a,lodInfo:l}=n,{level:c}=l,{scale:h,center:p,resolution:y}=e.state,v=!e.stationary&&h>this._previousScale;if(this._previousScale=h,this.tiles.length=0,!i&&(h>s||h{this.releaseTile(F)}),r.clear(),zle.length=0,lV.length=0,Cw.clear(),aP.pool.release(n),!0;r.forEach(F=>F.visible=!0);let x=0,I=0;if(a.length>0)for(const{row:F,colFrom:k,colTo:j}of a)for(let V=k;V<=j;V++){x++;const Y=TN.set(c,F,l.normalizeCol(V),l.getWorldForColumn(V)).id;if(r.has(Y)){const X=r.get(Y);X.isReady?(Cw.set(Y,X),I++):v||this._addParentTile(Y,Cw)}else{let X;if(this._tileCache&&this._tileCache.has(Y)){if(X=this._tileCache.pop(Y),this.tileIndex.set(Y,X),X.isReady){Cw.set(Y,X),I++;continue}}else X=this.acquireTile(TN),this.tileIndex.set(Y,X);v||this._addParentTile(Y,Cw)}}const P=I===x;r.forEach((F,k)=>{if(TN.set(k),Cw.has(k))return;const j=this.tileInfoView.intersects(n,TN),V=this.cachePolicy==="purge"?TN.level!==c:TN.level>c;!j||!v&&P?!V&&j||lV.push(k):F.isReady?V&&this.cachePolicy==="purge"&&this._hasReadyAncestor(TN,c)?lV.push(k):zle.push(k):V&&lV.push(k)});for(const F of zle){const k=r.get(F);k&&k.isReady&&Cw.set(F,k)}for(const F of lV){const k=r.get(F);this._tileCache?this._tileCache.add(k):this.releaseTile(k),r.delete(F)}return Cw.forEach(F=>this.tiles.push(F)),r.forEach(F=>{Cw.has(F.key.id)||(F.visible=!1)}),this._tileCache&&this._tileCache.prune(c,p,y),aP.pool.release(n),Cw.clear(),P}clear(e=!0){const{tileIndex:i}=this;e&&i.forEach(r=>{this.releaseTile(r)}),i.clear()}updateCacheSize(e){this._tileCache&&(this._tileCache.maxSize=e)}_addParentTile(e,i){let r=e,n=null;for(;r=this.tileInfoView.getTileParentId(r),r;)if(this.tileIndex.has(r)){if(n=this.tileIndex.get(r),n&&n.isReady){i.has(n.key.id)||i.set(n.key.id,n);break}}else if(this._tileCache&&this._tileCache.has(r)&&(n=this._tileCache.pop(r),this.tileIndex.set(r,n),n&&n.isReady)){i.has(n.key.id)||i.set(n.key.id,n);break}}_hasReadyAncestor(e,i){const r=Mo();this.tileInfoView.getTileBounds(r,e,!0);for(const n of this.tileIndex.values())if(n.isReady&&n.key.level>=i&&n.key.levelthis._handleDoubleClick(r,i))}_handleDoubleClick(e,i){tAe(e.data,"primary")&&(e.stopPropagation(),i?this._view.mapViewNavigation.zoomOut([e.data.x,e.data.y]):this._view.mapViewNavigation.zoomIn([e.data.x,e.data.y]))}},Gai=class extends Vm{constructor(e,i,r){super(!0),this.view=e,this.pointerType=i,this.registerIncoming("double-tap-drag",r,n=>this._handleDoubleTapDrag(n))}_handleDoubleTapDrag(e){const{data:i}=e,{pointerType:r}=i;if(r!==this.pointerType)return;e.stopPropagation();const{action:n,delta:s}=i,{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,c=this._startScale*l,h=c/this._currentScale;a.setViewpointImmediate(h),this._currentScale=c;break}case"end":{const{constraints:l}=o,{effectiveLODs:c,snapToZoom:h}=l;if(!h||!c)return void a.end();const p=l.snapScale(this._currentScale),y=(s.y>0?Math.max(p,l.snapToPreviousScale(this._startScale)):Math.min(p,l.snapToNextScale(this._startScale)))/this._currentScale;a.zoom(y);break}}}},Hle=class{constructor(e){this._callbacks=e,this._currentCount=0,this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(e){const i=e.data,r=i.pointers.size;switch(i.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}},Uai=class extends Vm{constructor(e,i,r){super(!0),this.view=e,this.pointerAction=i,this.registerIncoming("drag",r,n=>this._handleDrag(n)),this.registerIncoming("pointer-down",()=>this.stopMomentumNavigation())}onInstall(e){super.onInstall(e),this._dragEventSeparator=new Hle({start:(i,r)=>{this.view.mapViewNavigation.pan.begin(this.view,r.data),r.stopPropagation()},update:(i,r)=>{this.view.mapViewNavigation.pan.update(this.view,r.data),r.stopPropagation()},end:(i,r)=>{this.view.mapViewNavigation.pan.end(this.view,r.data),r.stopPropagation()},condition:(i,r)=>i===1&&tAe(r.data,this.pointerAction)})}_handleDrag(e){const i=this.view.mapViewNavigation;i.pinch.zoomMomentum||i.pinch.rotateMomentum?this.stopMomentumNavigation():this._dragEventSeparator.handle(e)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}},zai=class extends Vm{constructor(e,i,r){super(!0),this._view=e,this.pointerAction=i;const n=this._view.mapViewNavigation;this._dragEventSeparator=new Hle({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&&tAe(o.data,this.pointerAction)}),this.registerIncoming("drag",r,s=>this._dragEventSeparator.handle(s))}};function j2(t){let e=t*t;return t<0&&(e*=-1),e}function Hai(t){return t.translation[0]=0,t.translation[1]=0,t.translation[2]=0,t.heading=0,t.tilt=0,t}function Wai(t,e,i){const r=i,n=t.state,s=t.device,o=e.tiltDirection==="forward-down"?1:-1,a=1;return s.deviceType==="standard"?(r.translation[0]=j2(n.axes[0]),r.translation[1]=j2(n.axes[1]),r.translation[2]=j2(n.buttons[7])-j2(n.buttons[6]),r.heading=j2(n.axes[2]),r.tilt=j2(n.axes[3])):s.deviceType==="spacemouse"&&(r.translation[0]=1.2*j2(n.axes[0]),r.translation[1]=1.2*j2(n.axes[1]),r.translation[2]=2*-j2(n.axes[2]),r.heading=1.2*j2(n.axes[5]),r.tilt=1.2*j2(n.axes[3])),r.tilt*=o,Uh(r.translation,r.translation,a),r}function qai(t){return t.translation[0]===0&&t.translation[1]===0&&t.translation[2]===0&&t.heading===0&&t.tilt===0&&t.zoom===0}let Yai=class extends Vm{constructor(e){super(!0),this._view=e,this._frameTask=null,this._watchHandles=new df,this._currentDevice=null,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._handle=this.registerIncoming("gamepad",i=>this._handleGamePadEvent(i)),this._handle.pause()}onInstall(e){super.onInstall(e),this._watchHandles.add([sr(()=>this._view.navigation.gamepad?.enabled,i=>{i?(this._handle.resume(),this._frameTask||(this._frameTask=dL({update:r=>this._frameUpdate(r.deltaTime)}))):(this._handle.pause(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null))},Yo)])}onUninstall(){this._watchHandles.removeAll(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null),super.onUninstall()}_handleGamePadEvent(e){const i=this._view.navigation.gamepad.device;i&&e.data.device!==i||this._currentDevice&&this._currentDevice!==e.data.device||(e.data.action==="end"?(this._currentDevice=null,Hai(this._transformation)):(this._currentDevice=e.data.device,Wai(e.data,this._view.navigation.gamepad,this._transformation)))}_frameUpdate(e){const i=this._transformation;if(qai(i))return;const r=this._view.viewpoint.clone(),n=this._view.navigation.gamepad.velocityFactor,s=Kai*n*e;TM(r,r,[i.translation[0]*s,-i.translation[1]*s]);const o=1+i.translation[2]*Jai*e,a=this._view.constraints.rotationEnabled?-i.heading*Xai*e:0,l=this._view.size,c=[l[0]/2,l[1]];jIe(r,r,o,a,c,l);const h=this._view.constraints.constrain(r,this._view.viewpoint);this._view.viewpoint=h}};const Xai=.06,Kai=.7,Jai=6e-4;let Zai=class extends Vm{constructor(e,i,r){super(!0),this.view=e,this.keys=i,this._pressed=!1,this._keyMap={[i.left]:"left",[i.right]:"right",[i.up]:"up",[i.down]:"down"},this.registerIncoming("key-down",r,n=>this._handleKeyDown(n)),this.registerIncoming("key-up",r,n=>this._handleKeyUp(n)),this.registerIncoming("blur",r,()=>this._handleBlur())}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleBlur(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,i){const r=this._keyMap[e.data.key];if(this._pressed=r!=null,this._pressed){if(i)switch(this.view.mapViewNavigation.begin(),r){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 this._pressed=!1,this.view.mapViewNavigation.stop();e.stopPropagation()}}},Qai=class extends Vm{constructor(e,i,r){super(!0),this.view=e,this.keys=i,this._pressed=!1,this._keyToDirection={[i.clockwiseOption1]:"clockwise",[i.clockwiseOption2]:"clockwise",[i.counterClockwiseOption1]:"counterClockwise",[i.counterClockwiseOption2]:"counterClockwise",[i.resetOption1]:"reset",[i.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._handleBlur())}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleBlur(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,i){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(i)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 uV;(function(t){t[t.IN=0]="IN",t[t.OUT=1]="OUT"})(uV||(uV={}));let eli=class extends Vm{constructor(e,i,r){super(!0),this.view=e,this.keys=i,this._keysToZoomAction={},this.registerIncoming("key-down",r,n=>this._handleKeyDown(n)),i.zoomIn.forEach(n=>this._keysToZoomAction[n]=uV.IN),i.zoomOut.forEach(n=>this._keysToZoomAction[n]=uV.OUT)}_handleKeyDown(e){this._handleKey(e)}_handleKey(e){const i=e.modifiers;if(i.size>0&&!i.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 uV.IN:o=s.zoomIn();break;case uV.OUT:o=s.zoomOut();break;default:return}s.begin(),o.then(()=>s.end()),e.stopPropagation()}};const tli=.6;let ili=class extends Vm{constructor(e,i){super(!0),this._view=e,this._canZoom=!0,this.registerIncoming("mouse-wheel",i,r=>this._handleMouseWheel(r))}_handleMouseWheel(e){if(!this._view.navigation.mouseWheelZoomEnabled||(e.preventDefault(),e.stopPropagation(),!this._canZoom))return;const i=this._view.mapViewNavigation,{x:r,y:n,deltaY:s}=e.data,o=1/tli**(1/60*s),a=i.zoom(o,[r,n]);a&&(this._canZoom=!1,a.catch(()=>{}).then(()=>{this._canZoom=!0,i.end()}))}},rli=class extends Vm{constructor(e){super(!0),this.view=e,this.registerIncoming("drag",r=>this._handleDrag(r)),this.registerIncoming("pointer-down",()=>this._stopMomentumNavigation());const i=this.view.mapViewNavigation;this._dragEventSeparator=new Hle({start:(r,n)=>{i.pinch.begin(this.view,n.data),n.stopPropagation()},update:(r,n)=>{i.pinch.update(this.view,n.data),n.stopPropagation()},end:(r,n)=>{i.pinch.end(this.view),n.stopPropagation()},condition:r=>r>=2})}_handleDrag(e){this._dragEventSeparator.handle(e)}_stopMomentumNavigation(){this.view.mapViewNavigation.pinch.stopMomentumNavigation()}};function grt(t){const e=t.native;return e?{buttons:e.buttons.map(i=>i.pressed?i.value?i.value:1:0),axes:e.axes.map(i=>oli(i,t.axisThreshold))}:{buttons:[],axes:[]}}function nli(t,e){if(t.axes.length!==e.axes.length||t.buttons.length!==e.buttons.length)return!1;for(let i=0;i{this._connectGamepad(s.gamepad)},this._onDisconnectGamepad=s=>{const o=s.gamepad,a=o.index,l=this._inputDevices[a];l&&(this._emitGamepadEvent(o,grt(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 i=new CIe(e);i.deviceType!=="unknown"&&(this._inputDevices[e.index]=i,this._input.gamepad.devices.add(i)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){this._frameTask==null&&(this._frameTask=dL({update:()=>this._readGamepadState()}))}_stopPolling(){this._frameTask!=null&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const e=document.hasFocus(),i=this._element.contains(document.activeElement),r=this._input.gamepad.enabledFocusMode==="document"&&!e||this._input.gamepad.enabledFocusMode==="view"&&!i;this._forEachGamepad(n=>{const s=this._inputDevices[n.index];if(!s)return;const o=this._latestUpdate[n.index],a=grt(s),l=r||sli(a);o&&(o.timestamp===n.timestamp||!o.active&&l||nli(o.state,a))||this._emitGamepadEvent(n,a,!l)})}_forEachGamepad(e){const i=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 ali(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=da(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 i in this._active)if(!e||!e.has(i)){const r=this._active[i];this._element.removeEventListener(iAe[i],r),delete this._active[i]}e&&e.forEach(i=>{if(!this._active[i]&&iAe[i]){const r=(this._eventHandlers[i]||this._handleDefault).bind(this,i);this._element.addEventListener(iAe[i],r),this._active[i]=r}}),this._gamepadSource.hasEventListeners=e?.has("gamepad")??!1}setPointerCapture(e,i){i?(this._element.setPointerCapture(e.pointerId),this._activePointerCaptures.add(e.pointerId)):(this._releasePointerCaptureSafe(e.pointerId),this._activePointerCaptures.delete(e.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?cV.touchNone:cV.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?cV.touchPan:cV.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(cV.touchNone),this._element.classList.remove(cV.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_releasePointerCaptureSafe(e){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(e))return;this._element.releasePointerCapture(e)}catch{}}_updateNormalizedPointerLikeEvent(e,i){const r=git(this._element,e);return e5t.test.disableSubpixelCoordinates&&(r.x=Math.round(r.x),r.y=Math.round(r.y)),i.x=r.x,i.y=r.y,i}_handleKey(e,i){const r=Isi(i);r&&e==="key-up"&&this._keyDownState.delete(r);const n={native:i,key:r,repeat:!!r&&this._keyDownState.has(r)};r&&e==="key-down"&&this._keyDownState.add(n.key),this._callback(e,n)}_handlePointer(e,i){const r=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});this._callback(e,r)}_handlePointerPreventDefault(e,i){const r=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});i.preventDefault(),this._callback(e,r)}_handleMouseWheel(e,i){let r=i.deltaY;switch(i.deltaMode){case 0:yrt&&(r=r/document.documentElement.clientHeight*600);break;case 1:r*=30;break;case 2:r*=900}yrt?r*=.7:lli||cli?r*=.6:uli&&(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(i,{native:i,x:0,y:0,deltaY:r});this._callback(e,o)}_handlePointerCaptureLost(e,i){this._activePointerCaptures.delete(i.pointerId),this._handleDefault(e,i)}_handleDefault(e,i){const r={native:i};i.preventDefault(),this._callback(e,r)}_preventAltKeyDefault(e){e.key==="Alt"&&e.preventDefault()}_preventMultiTouchPanning(e){e.touches.length>1&&e.preventDefault()}};_rt.test={disableSubpixelCoordinates:!1};const iAe={"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 hli=class extends Vm{constructor(){super(!0),this.registerIncoming("context-menu",e=>{e.data.native.preventDefault()})}};function rAe(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)}function dli(t,e){const i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)}function pli(t,e){if(e?(e.radius=0,e.center.x=0,e.center.y=0):e={radius:0,center:zh()},t.length===0)return e;if(t.length===1)return e.center.x=t[0].x,e.center.y=t[0].y,e;if(t.length===2){const[j,V]=t,[Y,X]=[V.x-j.x,V.y-j.y];return e.radius=Math.sqrt(Y*Y+X*X)/2,e.center.x=(j.x+V.x)/2,e.center.y=(j.y+V.y)/2,e}let i=0,r=0;for(let j=0;jj.x-i),s=t.map(j=>j.y-r);let o=0,a=0,l=0,c=0,h=0,p=0,y=0;for(let j=0;je.doubleClickTimer=Uc(e.doubleClickTimer))}get hasPendingInputs(){return Ure(this._pointerState,e=>e.doubleClickTimer!=null)}_clearDoubleClickTimer(e,i){const r=this._pointerState.get(e);r&&(r.doubleClickTimer=Uc(r.doubleClickTimer),i&&this._click.emit(r.event.data,void 0,r.event.modifiers),this._pointerState.delete(e),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(e){const i=this._pointerState.get(e);i.pointerDownCount===1&&this._click.emit(i.event.data,void 0,i.event.modifiers),i.doubleClickTimer=null,this._pointerState.delete(e),this.refreshHasPendingInputs()}_getPointerId(e){const{pointerId:i,pointerType:r,button:n}=e.native;return r==="mouse"?`${i}:${n}`:`${r}`}_handleImmediateClick(e){const i=e.data,{pointerType:r}=i.native,n=this._getPointerId(i);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;rAe(o,i)>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 i=EN(e.data),r=this._pointerState.get(i);r&&(r.pointerDownCount+=1)}_startClick(e){const{data:i}=e,{native:{pointerType:r}}=i,n=EN(i),s=r==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._doubleClickTimeoutExceeded(n),s),a=1;this._pointerState.set(n,{event:e,doubleClickTimer:o,pointerDownCount:a}),this.refreshHasPendingInputs()}},mli=class extends Vm{constructor(e=Tw.maximumDoubleClickDelay,i=Tw.maximumDoubleClickDistance,r=Tw.maximumDoubleTouchDelay,n=Tw.maximumDoubleTouchDistance,s=IH){super(!1),this._maximumDoubleClickDelay=e,this._maximumDoubleClickDistance=i,this._maximumDoubleTouchDelay=r,this._maximumDoubleTouchDistance=n,this._clock=s,this._doubleTapDragReady=!1,this._doubleTapDragActive=!1,this._dragStartCenter=zh(0,0),this._pointerState=new Map,this._doubleTapDrag=this.registerOutgoing("double-tap-drag"),this._dragEventSeparator=new Hle({start:(o,a)=>this._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=Uc(e.doubleTapTimeout)})}get hasPendingInputs(){return Ure(this._pointerState,e=>e.doubleTapTimeout!=null)}_clearPointerDown(e){const i=this._pointerState.get(e);i&&(i.doubleTapTimeout=Uc(i.doubleTapTimeout),this._pointerState.delete(e),this.refreshHasPendingInputs())}_createDoubleTapDragData(e,i,r){const{button:n,buttons:s,pointer:o,pointers:a,pointerType:l,timestamp:c}=r;return{action:e,delta:i,button:n,buttons:s,pointer:o,pointers:a,pointerType:l,timestamp:c}}_dragStart(e,i){if(!this._doubleTapDragReady||e!==1)return;this._doubleTapDragReady=!1,this._doubleTapDragActive=!0;const{data:r,modifiers:n}=i,{center:s}=r;this._dragStartCenter=s;const o=this._createDoubleTapDragData("begin",zh(0,0),r);this._doubleTapDrag.emit(o,void 0,n),i.stopPropagation()}_dragUpdate(e){if(!this._doubleTapDragActive)return;const{data:i,modifiers:r}=e,{center:n}=i,s=zh(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),o=this._createDoubleTapDragData("update",s,i);this._doubleTapDrag.emit(o,void 0,r),e.stopPropagation()}_dragEnd(e){if(!this._doubleTapDragActive)return;const{data:i,modifiers:r}=e,{center:n}=i,s=zh(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),o=this._createDoubleTapDragData("end",s,i);this._doubleTapDrag.emit(o,void 0,r),this._doubleTapDragActive=!1,e.stopPropagation()}_handlePointerDown(e){const{data:i}=e,r=EN(i),n=this._pointerState.get(r),{pointerType:s}=i.native;if(n){const o=s==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;this._clearPointerDown(r),rAe(n.event.data,i)>o?this._storePointerDown(e):this._doubleTapDragReady=!0}else this._storePointerDown(e)}_handlePointerUp(){this._doubleTapDragReady=!1}_storePointerDown(e){const{data:i}=e,{pointerType:r}=i.native,n=EN(i),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()}},gli=class extends Vm{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,i,r,n){return{action:e,pointerType:this._pointerType,button:this._mouseButton,buttons:i.buttons,timestamp:n,pointers:yli(this._activePointerMap),pointer:i,angle:r.angle,radius:r.radius,center:r.center}}_addPointer(e){const i=e.native.pointerId,r=Wle(this._activePointerMap).angle,n={event:e,initialAngle:0,lastAngle:0};this._activePointerMap.set(i,n);const s=qle(n,brt(this._activePointerMap));n.initialAngle=s,n.lastAngle=s,this._updatePointerAngles(r)}_updatePointer(e){if(e&&e.x==null&&e.y==null)return;const i=e.native.pointerId,r=this._activePointerMap.get(i);r?r.event=e:this._addPointer(e)}_removePointer(e){const i=Wle(this._activePointerMap).angle;this._activePointerMap.delete(e),this._updatePointerAngles(i)}_updatePointerAngles(e){const i=Wle(this._activePointerMap);this._activePointerMap.forEach(r=>{r.initialAngle=qle(r,i)-e,r.lastAngle=qle(r,i)-e})}_emitEvent(e,i,r){const n=Wle(this._activePointerMap);this._drag.emit(this._createPayload(e,i,n,r),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(e){const i=e.data.native.pointerId,r=e.timestamp;this._activePointerMap.get(i)&&(this._activePointerMap.size===1?(this._updatePointer(e.data),!this._isCurrentDragSuppressed&&this._emitEvent("end",e.data,r),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(i)):(this._removePointer(i),this._emitEvent("removed",e.data,e.timestamp)))}_handlePointerDrag(e){const i=e.data,r=i.currentEvent,n=e.timestamp;switch(i.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 brt(t){const e=[];return t.forEach(i=>{e.push(zh(i.event.x,i.event.y))}),pli(e)}function Wle(t){const e=brt(t);let i=0;return t.forEach(r=>{let n=qle(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;i+=o}),i/=t.size||1,{angle:i,radius:e.radius,center:e.center}}function yli(t){const e=new Map;return t.forEach((i,r)=>e.set(r,i.event)),e}function qle(t,e){const i=t.event,r=i.x-e.center.x,n=i.y-e.center.y;return Math.atan2(n,r)}var wrt;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right",t[t.Back=3]="Back",t[t.Forward=4]="Forward",t[t.Undefined=-1]="Undefined"})(wrt||(wrt={}));let vli=class extends Vm{constructor(e=Tw.maximumDoubleClickDelay,i=Tw.maximumDoubleClickDistance,r=Tw.maximumDoubleTouchDelay,n=Tw.maximumDoubleTouchDistance,s=IH){super(!1),this._maximumDoubleClickDelay=e,this._maximumDoubleClickDistance=i,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 i=e.data,r=EN(i);if(!this._pointerState.has(r)){const n={downButton:i.native.button,immediateDoubleClick:null};this._pointerState.set(r,n),this.startCapturingPointer(i.native)}}_handlePointerUp(e){const i=e.data,r=EN(i),n=this._pointerState.get(r);if(n&&n.downButton===i.native.button){const s=n.immediateDoubleClick;if(s){s.timeoutHandle.remove();const o=e.data.native.pointerType==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;rAe(s,e.data)>o?this._startImmediateDoubleClick(e,n):(this._immediateDoubleClick.emit(e.data,void 0,s.modifiers),this._removeState(i))}else this._startImmediateDoubleClick(e,n)}}_startImmediateDoubleClick(e,i){const r=e.data.native.pointerType==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;i.immediateDoubleClick={x:e.data.x,y:e.data.y,modifiers:e.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(e.data),r)}}_removeState(e){const i=EN(e);this._pointerState.delete(i),this.stopCapturingPointer(e.native),this.refreshHasPendingInputs()}};const cX={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500};let _li=class extends Vm{constructor(e=cX.maximumClickDelay,i=cX.movementUntilMouseDrag,r=cX.movementUntilPenDrag,n=cX.movementUntilTouchDrag,s=cX.holdDelay,o=IH){super(!1),this._maximumClickDelay=e,this._movementUntilMouseDrag=i,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=Uc(e.holdTimeout)}),super.onUninstall()}_handlePointerDown(e){const i=e.data,r=i.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:i,previousEvent:i,startTimestamp:e.timestamp,isDragging:!1,downButton:i.native.button,holdTimeout:n,modifiers:new Set};this._pointerState.set(r,s),this.startCapturingPointer(i.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(e)}_createPointerDragData(e,i,r){return{action:e,startEvent:i.startEvent,previousEvent:i.previousEvent,currentEvent:r}}_handlePointerMove(e){const i=e.data,r=i.native.pointerId,n=this._pointerState.get(r);n&&(n.isDragging?this._pointerDrag.emit(this._createPointerDragData("update",n,i),void 0,n.modifiers):dli(i,n.startEvent)>this._getDragThreshold(i.native.pointerType)&&this._startDragging(e),n.previousEvent=i)}_getDragThreshold(e){switch(e){case"touch":return this._movementUntilTouchDrag;case"pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(e){const i=e.data,r=i.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,i)):this._pointerDrag.emit(this._createPointerDragData("start",n,n.previousEvent),e.timestamp))})}_handlePointerLoss(e,i){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,i==="pointer-up"?r:s.previousEvent),void 0,s.modifiers):i==="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())}};const Yle={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 IN=class extends Tn{constructor(){super(...arguments),this._handles=new df}initialize(){const e=()=>this.view?.ready;this._handles.add([Yg(()=>!e(),()=>this._disconnect()),Yg(e,()=>this._connect())])}destroy(){this._handles=da(this._handles),this._disconnect()}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}_disconnect(){this.view.viewEvents.disconnect(),this._inputManager=da(this._inputManager)}_connect(){const e=this.view.surface,i=new _rt(e,this.view.input),r=[new vli,new _li,new fli,new gli(this.view.navigation),new mli],n=new gT({eventSource:i,recognizers:r});n.installHandlers("prevent-context-menu",[new hli],yT.INTERNAL),n.installHandlers("navigation",[new rli(this.view),new Yai(this.view),new ili(this.view),new mrt(this.view),new mrt(this.view,[Yle.counter]),new Uai(this.view,"primary"),new Zai(this.view,Yle.pan),new eli(this.view,Yle.zoom),new Qai(this.view,Yle.rotate),new zai(this.view,"secondary"),new Gai(this.view,"touch")],yT.INTERNAL),this.view.viewEvents.connect(n),this._source=i,this._inputManager=n,sr(()=>this.view?.navigation?.browserTouchPanEnabled,s=>{this._source&&(this._source.browserTouchPanningEnabled=!s)},Yo)}get test(){return{inputManager:this._inputManager}}};E([N()],IN.prototype,"view",void 0),E([N()],IN.prototype,"latestPointerType",null),E([N()],IN.prototype,"latestPointerLocation",null),E([N()],IN.prototype,"multiTouchActive",null),IN=E([dt("esri.views.2d.input.MapViewInputManager")],IN);const bli=IN;var xrt,Srt,Crt,nAe={},wli={get exports(){return nAe},set exports(t){nAe=t}};xrt=wli,Srt=function(){function t(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 c=a-o+1,h=s-o+1,p=Math.log(c),y=.5*Math.exp(2*p/3),v=.5*Math.sqrt(p*y*(c-y)/c)*(h-c/2<0?-1:1);e(n,s,Math.max(o,Math.floor(s-h*y/c+v)),Math.min(a,Math.floor(s+(c-h)*y/c+v)),l)}var x=n[s],I=o,P=a;for(i(n,o,s),l(n[a],x)>0&&i(n,o,a);I0;)P--}l(n[o],x)===0?i(n,o,P):i(n,++P,a),P<=s&&(o=P+1),s<=P&&(a=P-1)}}function i(n,s,o){var a=n[s];n[s]=n[o],n[o]=a}function r(n,s){return ns?1:0}return t},(Crt=Srt())!==void 0&&(xrt.exports=Crt);const Trt=nAe;function AN(t,e){if(!(this instanceof AN))return new AN(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&(typeof e=="function"?this.toBBox=e:this._initFormat(e)),this.clear()}function xli(t,e,i){if(!i)return e.indexOf(t);for(var r=0;r=t.minX&&e.maxY>=t.minY}function dV(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Art(t,e,i,r,n){for(var s,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=r||(s=e+Math.ceil((i-e)/r/2)*r,Trt(t,s,e,i,n),o.push(e,s,s,i))}AN.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],r=this.toBBox;if(!Kle(t,e))return i;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(t,e){var i=t[e],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);var s=this._chooseSplitIndex(i,n,r),o=dV(i.children.splice(s,i.children.length-s));o.height=i.height,o.leaf=i.leaf,hV(i,this.toBBox),hV(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=dV([t,e]),this.data.height=t.height+1,this.data.leaf=!1,hV(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var r,n,s,o,a,l,c,h;for(l=c=1/0,r=e;r<=i-e;r++)o=Cli(n=hX(t,0,r,this.toBBox),s=hX(t,r,i,this.toBBox)),a=sAe(n)+sAe(s),o=e;n--)s=t.children[n],dX(l,t.leaf?o(s):s),c+=Xle(l);return c},_adjustParentBBoxes:function(t,e,i){for(var r=i;r>=0;r--)dX(e[r],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)t[i].children.length===0?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():hV(t[i],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};let Prt=class t5t{constructor(e,i){this.key=new Eh(0,0,0,0),this.bounds=Mo(),this.objectIds=new Set,this.key.set(i);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 id(){return this.key.id}get extent(){return Ar.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createChildTiles(){const e=this.key.getChildKeys(),i=Gg.acquire();for(let r=0;r({minX:i.bounds[0],minY:i.bounds[1],maxX:i.bounds[2],maxY:i.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)}boundsIntersections(e){return this._index.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]})}updateTiles(e){const i={added:[],removed:[]};for(const r of e.added)if(!this.has(r)){const n=new Prt(this.tileScheme,r);this._tiles.set(r,n),this._index.insert(n),i.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),i.removed.push(n)}this.tiles.length=0,this._tiles.forEach(r=>this.tiles.push(r)),(i.added.length||i.removed.length)&&this.emit("update",i)}setViewState(e){const i=this.tileScheme.getTileCoverage(e,0);if(!i)return;const{spans:r,lodInfo:n}=i,{level:s}=n;if(r.length>0)for(const{row:o,colFrom:a,colTo:l}of r)for(let c=a;c<=l;c++){const h=Tli.set(s,o,n.normalizeCol(c),n.getWorldForColumn(c)).id;if(aAe.add(h),!this.has(h)){const p=new Prt(this.tileScheme,h);this._tiles.set(h,p),this._index.insert(p),this.tiles.push(p),PN.added.push(p)}}for(let o=this.tiles.length-1;o>=0;o--){const a=this.tiles[o];aAe.has(a.id)||(this._tiles.delete(a.id),this.tiles.splice(o,1),this._index.remove(a),PN.removed.push(a))}(PN.added.length||PN.removed.length)&&this.emit("update",PN),aP.pool.release(i),aAe.clear(),PN.added.length=0,PN.removed.length=0}},ON=class extends Tn{constructor(){super(...arguments),this.color=new en([0,255,255]),this.haloOpacity=1,this.fillOpacity=.25}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}};E([N({type:en})],ON.prototype,"color",void 0),E([N({type:en})],ON.prototype,"haloColor",void 0),E([N()],ON.prototype,"haloOpacity",void 0),E([N()],ON.prototype,"fillOpacity",void 0),ON=E([dt("esri.views.2d.support.HighlightOptions")],ON);const lAe=ON,Eli=t=>t.includes("Brush");let uAe=class{constructor(){this._names=new Map}begin(e){this._names.has(e)||(this._names.set(e,!1),Eli(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 Ili(t,e,i,r,n,s,o,a){t.ignorePadding&&(r={left:0,right:0,top:0,bottom:0});let l=null;t.width!=null&&t.height!=null?l=[t.width,t.height]:t.width==null&&t.height!=null?l=[t.height,t.height]:t.width!=null&&t.height==null?l=[t.width,t.width]:t.width==null&&t.height==null&&(l=null);const c=i[0]-(r.left+r.right),h=i[1]-(r.top+r.bottom);let p,y,v=t.area||{x:0,y:0,width:c,height:h};if(l){const x=c/h,I=l[0]/l[1];if(I>x){const P=v.width/I;v={x:v.x,y:Math.round(v.y+(v.height-P)/2),width:v.width,height:Math.round(P)}}else{const P=v.height*I;v={x:Math.round(v.x+(v.width-P)/2),y:v.y,width:Math.round(P),height:v.height}}}else l=[v.width,v.height];return l[0]>v.width?(p=Math.min(l[0]/v.width,e),y=l[0]/v.width/p):(p=1,y=l[0]/v.width),{resolutionScale:p,cropArea:{x:Math.round((v.x+r.left)*p),y:Math.round((v.y+r.top)*p),width:Math.round(v.width*p),height:Math.round(v.height*p)},outputScale:y,format:n,quality:s,children:o,rotation:a}}let pX=null,Jle=!0;function Ali(t,e,i){if(!t||!e)throw new Error("Cannot construct image data without dimensions");if(Jle)try{return new ImageData(t,e)}catch{Jle=!1}return Rrt(t,e,i)}function Pli(t,e,i,r){if(!e||!i)throw new Error("Cannot construct image data without dimensions");if(Jle)try{return new ImageData(t,e,i)}catch{Jle=!1}const n=Rrt(e,i,r);return n.data.set(t,0),n}function Oli(){return pX||(pX=document.createElement("canvas"),pX.width=1,pX.height=1),pX}function Rrt(t,e,i){return i||(i=Oli()),i.getContext("2d").createImageData(t,e)}function Rli(t,e,i){const{ctx:r,canvas:n}=Mrt(t,i),s=r.getImageData(0,0,t.width,t.height),o=Fli(n,e);return Drt(n),{dataUrl:o,data:s}}function Mli(t,e){const{ctx:i,canvas:r}=Mrt(t,e),n=i.getImageData(0,0,t.width,t.height);return Drt(r),n}function Mrt(t,e){const i=Dli();e.premultipliedAlpha&&Vli(t),i.width=t.width,i.height=t.height;const r=i.getContext("2d",{willReadFrequently:!0});return r.putImageData(t,0,0),e.flipY&&Bli(r),{ctx:r,canvas:i}}function Drt(t){t.width=0,t.height=0}function Dli(){return lt(cAe)&&(cAe=document.createElement("canvas")),cAe}let cAe=null;function Fli(t,e){const i=jli[e.format],r=e.quality/100;return t.toDataURL(i,r)}function Lli(t,e){const i=$li(t),r=Uli[i];return{format:i,quality:eu(e??r,0,100)}}function Nli(t,e){return e/Math.max(t[0],t[1])}function kli(t,e,i,r=0,n=0,s=t.width-r,o=t.height-n,a=!1){const{data:l}=t,{width:c,height:h,data:p}=e,y=s/c,v=o/h,x=Math.ceil(y/2),I=Math.ceil(v/2),P=t.width;for(let F=0;F=1)continue;let Ie=2*Se*Se*Se-3*Se*Se+1;const Re=4*(r+J+(n+_e)*P);ce+=Ie*l[Re+3],Y+=Ie,!i&&l[Re+3]<255&&(Ie=Ie*l[Re+3]/255),X+=Ie*l[Re],Z+=Ie*l[Re+1],ie+=Ie*l[Re+2],V+=Ie}}p[j]=X/V,p[j+1]=Z/V,p[j+2]=ie/V,p[j+3]=ce/Y}return e}function $li(t){switch(t){case"png":case"jpg":case"jpeg":return t;default:return Gli}}function Bli(t){t.save(),t.globalCompositeOperation="copy",t.scale(1,-1),t.translate(0,-t.canvas.height),t.drawImage(t.canvas,0,0),t.restore()}function Vli(t){const e=t.data,i=e.length;for(let r=0;r0){const s=255/n;e[r+0]=e[r+0]*s,e[r+1]=e[r+1]*s,e[r+2]=e[r+2]*s}}}const jli={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},Frt=98,Gli="png",Uli={png:100,jpg:Frt,jpeg:Frt};var bo;function Lrt(t,e,i={}){const r=Nrt(t);for(;r.length>1;){const n=Zle(e,r.shift(),i);if(ve(n))return n}return zli(e,r.shift(),i)}function Nrt(t){const e=Hi("esri-force-webgl");if(e===bo.WEBGL1||e===bo.WEBGL2)return[e];switch(t){case"2d":return Hi("mac")&&Hi("chrome")?[bo.WEBGL1,bo.WEBGL2]:[bo.WEBGL2,bo.WEBGL1];case"3d":return[bo.WEBGL2,bo.WEBGL1]}}function zli(t,e,i={}){if(!window.WebGLRenderingContext)return krt(t,Hli),null;const r=Zle(t,e,i);return lt(r)&&krt(t,Wli),r}function Zle(t,e,i={}){const r=e===bo.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let n=null;for(const s of r){try{n=t.getContext(s,i)}catch{}if(n)break}return n}function krt(t,e){const i=t.parentNode;i&&(i.innerHTML='
'+e+"
")}(function(t){t[t.WEBGL1=1]="WEBGL1",t[t.WEBGL2=2]="WEBGL2"})(bo||(bo={}));const Hli='This page requires a browser that supports WebGL.
Click here to upgrade your browser.',Wli=`It doesn't appear your computer can support WebGL.
Click here for more information.`;let hAe,dAe;function ST(t){const e=Nrt(t);for(;e.length>1;){const i=$rt(e.shift());if(i.available)return i}return $rt(e.shift())}function $rt(t){switch(t){case bo.WEBGL1:return qli();case bo.WEBGL2:return Yli()}}function qli(){return hAe||(hAe=Jli()),hAe}function Yli(){return dAe||(dAe=Zli()),dAe}let Brt=class{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsElementIndexUint=!1,this.supportsStandardDerivatives=!1,this.supportsInstancedArrays=!1,this.supportsTextureFloat=!1,this.supportsTextureHalfFloat=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1}},Xli=class extends Brt{constructor(){super(...arguments),this.type=bo.WEBGL1}},Kli=class extends Brt{constructor(){super(...arguments),this.type=bo.WEBGL2,this.supportsElementIndexUint=!0,this.supportsStandardDerivatives=!0,this.supportsInstancedArrays=!0,this.supportsTextureFloat=!0,this.supportsTextureHalfFloat=!0}};function Vrt(t,e){if(t===bo.WEBGL1&&typeof WebGLRenderingContext>"u"||t===bo.WEBGL2&&typeof WebGL2RenderingContext>"u")return null;const i=document.createElement("canvas");if(!i)return null;let r=Zle(i,t,{failIfMajorPerformanceCaveat:!0});if(lt(r)&&(r=Zle(i,t),ve(r)&&(e.majorPerformanceCaveat=!0)),lt(r))return r;if(t===bo.WEBGL1){const s=r.getParameter(r.VERSION)?.match(/^WebGL\s+([\d.]*)/);if(s){const o=parseFloat(s[1]);e.available=o>=.94}}else e.available=!0;e.maxTextureSize=r.getParameter(r.MAX_TEXTURE_SIZE),e.supportsVertexShaderSamplers=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const n=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);return n&&(e.supportsHighPrecisionFragment=n.precision>0),r}function Jli(){const t=new Xli,e=Vrt(bo.WEBGL1,t);return lt(e)||(t.supportsElementIndexUint=e.getExtension("OES_element_index_uint")!==null,t.supportsStandardDerivatives=e.getExtension("OES_standard_derivatives")!==null,t.supportsInstancedArrays=e.getExtension("ANGLE_instanced_arrays")!==null,t.supportsTextureFloat=e.getExtension("OES_texture_float")!==null,t.supportsTextureHalfFloat=e.getExtension("OES_texture_half_float")!==null,t.supportsColorBufferFloat=e.getExtension("WEBGL_color_buffer_float")!==null,t.supportsColorBufferFloatBlend=e.getExtension("EXT_float_blend")!==null,t.supportsColorBufferHalfFloat=e.getExtension("EXT_color_buffer_half_float")!==null),t}function Zli(){const t=new Kli,e=Vrt(bo.WEBGL2,t);return lt(e)||(t.supportsColorBufferFloat=e.getExtension("EXT_color_buffer_float")!==null,t.supportsColorBufferFloatBlend=e.getExtension("EXT_float_blend")!==null,t.supportsColorBufferHalfFloat=t.supportsColorBufferFloat||e.getExtension("EXT_color_buffer_half_float")!==null),t}function Qli(t){const e=ST(t);if(!e.available)return new st("webgl:required","WebGL is required but not supported.");if(t==="3d"&&e.majorPerformanceCaveat)return new st("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.");if(!e.supportsHighPrecisionFragment)return new st("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported.");if(!e.supportsVertexShaderSamplers)return new st("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported.");if(e.type===bo.WEBGL1){if(!e.supportsElementIndexUint)return new st("webgl:element-index-uint-required","WebGL support for uint vertex indices is required but not supported.");if(!e.supportsStandardDerivatives)return new st("webgl:standard-derivatives-required","WebGL support for standard derivatives is required but not supported.");if(!e.supportsInstancedArrays)return new st("webgl:instanced-arrays-required","WebGL support for instanced rendering is required but not supported.")}return null}function eui(t){return t&&"nodeType"in t}function tui(t){return t&&typeof t.render=="function"}const jrt={component:"esri-component"};let RN=class extends Tn{constructor(){super(...arguments),this.widget=null}destroy(){this.widget&&this.widget.destroy(),this.node=null}get id(){return this.get("widget.id")||this.get("node.id")}set node(e){const i=this._get("node");e!==i&&(e&&e.classList.add(jrt.component),i&&i.classList.remove(jrt.component),this._set("node",e))}castNode(e){return e?typeof e=="string"||eui(e)?(this._set("widget",null),yEe(e)):(tui(e)&&!e.domNode&&(e.domNode=document.createElement("div")),this._set("widget",e),e.domNode):(this._set("widget",null),null)}};E([N({dependsOn:[]})],RN.prototype,"id",null),E([N()],RN.prototype,"node",null),E([ho("node")],RN.prototype,"castNode",null),E([N({readOnly:!0})],RN.prototype,"widget",void 0),RN=E([dt("esri.views.ui.Component")],RN);const Qle=RN,iui={left:0,top:0,bottom:0,right:0},Grt={bottom:30,top:15,right:15,left:15},pAe="manual",uP="esri-ui",hv={ui:uP,corner:`${uP}-corner`,innerContainer:`${uP}-inner-container`,manualContainer:`${uP}-manual-container`,cornerContainer:`${uP}-corner-container`,topLeft:`${uP}-top-left`,topRight:`${uP}-top-right`,bottomLeft:`${uP}-bottom-left`,bottomRight:`${uP}-bottom-right`};function rui(t){return t&&!t._started&&typeof t.postMixInProperties=="function"&&typeof t.buildRendering=="function"&&typeof t.postCreate=="function"&&typeof t.startup=="function"}function fAe(t){const e=t,i=typeof e=="object"&&e!==null&&Object.getPrototypeOf(e);return(i===null||i===Object.prototype)&&("component"in e||"index"in e||"position"in e)?t:null}function mAe(t,{top:e,bottom:i,left:r,right:n}){t.style.top=e,t.style.bottom=i,t.style.left=r,t.style.right=n}let CT=class extends md.EventedAccessor{constructor(e){super(e),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentToKey=new Map,this._locale=Z0(),this.view=null,this._applyViewPadding=()=>{const i=this.container;i&&mAe(i,this._toPxPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const i=this._innerContainer;i&&mAe(i,this._toPxPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([sr(()=>[this.view?.padding,this.container],this._applyViewPadding,Yo),sr(()=>this.padding,this._applyUIPadding,Yo),sr(()=>[this.container,this._locale],([e,i])=>{e&&e.setAttribute("lang",i)},Yo),OGe(e=>{this._locale=e})])}destroy(){this.container=null;for(const e of this._components)e.destroy();this._components.length=0,this._componentToKey.clear()}set container(e){const i=this._get("container");e!==i&&(e&&(e.classList.add(hv.ui),Jri(e),this._attachContainers(e)),i&&(i.classList.remove(hv.ui),mAe(i,{top:"",bottom:"",left:"",right:""}),eQe(i)),this._set("container",e))}get height(){const e=this.get("view.height")||0;if(e===0)return e;const i=this._getViewPadding(),r=i.top+i.bottom;return Math.max(e-r,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}:{...Grt,...e}}get width(){const e=this.get("view.width")||0;if(e===0)return e;const i=this._getViewPadding(),r=i.left+i.right;return Math.max(e-r,0)}add(e,i){let r,n;if(Array.isArray(e))return void e.forEach(o=>this.add(o,i));const s=fAe(e);s&&({index:r,position:i,component:e,key:n}=s),i&&typeof i=="object"&&({index:r,key:n,position:i}=i),!e||i&&!this._isValidPosition(i)||this._add(e,i,r,n)}remove(e,i){if(!e)return;if(Array.isArray(e))return e.map(n=>this.remove(n,i));const r=this._find(e);if(r){const n=this._componentToKey;if(n.has(e)&&n.get(e)!==i)return;const s=this._components.indexOf(r);return r.node.parentNode&&r.node.parentNode.removeChild(r.node),this._componentToKey.delete(e),this._components.splice(s,1)[0]}}empty(e){return Array.isArray(e)?e.map(i=>this.empty(i)).reduce((i,r)=>i.concat(r)):(e=e||pAe)===pAe?Array.prototype.slice.call(this._manualContainer.children).filter(i=>!i.classList.contains(hv.corner)).map(i=>this.remove(i)):this._isValidPosition(e)?Array.prototype.slice.call(this._cornerNameToContainerLookup[e].children).map(this.remove,this):null}move(e,i){if(Array.isArray(e)&&e.forEach(o=>this.move(o,i)),!e)return;let r;const n=fAe(e)||fAe(i);if(n&&(r=n.index,i=n.position,e=n.component||e),i&&!this._isValidPosition(i))return;const s=this.remove(e);s&&this.add(s,{position:i,index:r})}find(e){if(!e)return null;const i=this._findById(e);return i&&(i.widget||i.node)}getPosition(e){for(const i in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[i].contains(e))return i;return null}_add(e,i,r,n){e instanceof Qle||(e=new Qle({node:e})),this._place({component:e,position:i,index:r}),this._components.push(e),n&&this._componentToKey.set(e,n)}_find(e){return e?e instanceof Qle?this._findByComponent(e):typeof e=="string"?this._findById(e):this._findByNode(e.domNode||e):null}_getViewPadding(){return this.get("view.padding")||iui}_attachContainers(e){e.appendChild(this._innerContainer),e.appendChild(this._manualContainer)}_initContainers(){const e=document.createElement("div");e.classList.add(hv.innerContainer),e.classList.add(hv.cornerContainer);const i=document.createElement("div");i.classList.add(hv.innerContainer),i.classList.add(hv.manualContainer);const r=document.createElement("div");r.classList.add(hv.topLeft),r.classList.add(hv.corner),e.appendChild(r);const n=document.createElement("div");n.classList.add(hv.topRight),n.classList.add(hv.corner),e.appendChild(n);const s=document.createElement("div");s.classList.add(hv.bottomLeft),s.classList.add(hv.corner),e.appendChild(s);const o=document.createElement("div");o.classList.add(hv.bottomRight),o.classList.add(hv.corner),e.appendChild(o),this._innerContainer=e,this._manualContainer=i;const a=pT();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:i,...this._cornerNameToContainerLookup}}_isValidPosition(e){return!!this._positionNameToContainerLookup[e]}_place(e){const i=e.component,r=e.position||pAe,n=e.index,s=this._positionNameToContainerLookup[r],o=n!=null&&n>-1;if(rui(i.widget)&&i.widget.startup(),!o)return void s.appendChild(i.node);const a=Array.prototype.slice.call(s.children);if(n===0)return void(s.firstChild?tQe(i.node,s.firstChild):s.appendChild(i.node));n>=a.length?s.appendChild(i.node):tQe(i.node,a[n])}_toPxPosition(e){return{top:this._toPxUnit(e.top),left:this._toPxUnit(e.left),right:this._toPxUnit(e.right),bottom:this._toPxUnit(e.bottom)}}_toPxUnit(e){return e===0?"0":e+"px"}_findByComponent(e){let i,r=null;return this._components.some(n=>(i=n===e,i&&(r=n),i)),r}_findById(e){let i,r=null;return this._components.some(n=>(i=n.id===e,i&&(r=n),i)),r}_findByNode(e){let i,r=null;return this._components.some(n=>(i=n.node===e,i&&(r=n),i)),r}};E([N()],CT.prototype,"_locale",void 0),E([N()],CT.prototype,"container",null),E([N()],CT.prototype,"height",null),E([N({value:Grt})],CT.prototype,"padding",null),E([ho("padding")],CT.prototype,"castPadding",null),E([N()],CT.prototype,"view",void 0),E([N()],CT.prototype,"width",null),CT=E([dt("esri.views.ui.UI")],CT);const nui=CT;function Urt(t,e){return t&&"copyright"in t&&(!e||typeof t.originOf=="function"&&t.originOf("copyright")==="user")}function sui(t,e){return t.length!==e.length||t.some((i,r)=>i.text!==e[r].text)}function eue(t,e,i){!i||!e||t.find(r=>r.layerView===e&&r.text===i)||t.push({text:i,layerView:e})}function oui(t){return t.type==="bing-maps"}const PM=[];let pV=class extends YC{constructor(e){super(e),this._clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.handles.remove("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new Sr,this.view=null,this._allLayerViewsChange=i=>{this.handles.remove("suspension");const r=this.get("view.allLayerViews");r&&this.handles.add(r.map(n=>sr(()=>[n.suspended,n.layer?.attributionVisible],()=>this._updateAttributionItems())),"suspension"),i&&i.removed&&i.removed.forEach(n=>{this._pendingAttributions.delete(n),this._fetchedAttributionData.delete(n)}),this._updateAttributionItems()},this.handles.add([Wu(()=>this.view?.allLayerViews,"change",i=>this._allLayerViewsChange(i),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),Yg(()=>this.view?.stationary===!0,()=>this._updateAttributionItems())])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){return this.get("view.ready")?this._pendingAttributions.size>0?"loading":"ready":"disabled"}_updateAttributionItems(){const e=this.view,i=e?.allLayerViews;PM.length=0,e&&i?(i.forEach(r=>{if(r.suspended||!r.layer?.attributionVisible)return;const n=r.layer;if(Urt(n,"user"))return void eue(PM,r,n.copyright);if(n.hasAttributionData){if(this._fetchedAttributionData.has(r)){const o=this._fetchedAttributionData.get(r);return void(o?eue(PM,r,this._getDynamicAttribution(o,e,n)):Urt(n)&&eue(PM,r,n.copyright))}return void this._fetchAttributionData(r)}const s=n.get("portalItem.accessInformation");eue(PM,r,s||n.copyright)}),sui(this.items,PM)&&(this.items.removeAll(),this.items.addMany(PM)),PM.length=0,this.notifyChange("state")):this._clear()}async _fetchAttributionData(e){if(this._pendingAttributions.has(e))return;this._pendingAttributions.add(e);const i=await SC(e.layer.fetchAttributionData());if(this._pendingAttributions.has(e)){const r=i.ok?this._createContributionIndex(i.value,oui(e.layer)):null;this._pendingAttributions.delete(e),this._fetchedAttributionData.set(e,r)}this._updateAttributionItems()}_createContributionIndex(e,i){const r=e.contributors,n={};if(!r)return n;for(let s=0;s{const p=h.id,y=!c[p]&&l&&h.extent&&WH(h.extent,l);return y&&(c[p]=!0),y}).sort((h,p)=>p.score-h.score||h.objectId-p.objectId).map(h=>h.attribution).join(", "):""}};E([N({readOnly:!0,type:Sr})],pV.prototype,"items",void 0),E([N({readOnly:!0})],pV.prototype,"state",null),E([N()],pV.prototype,"view",void 0),pV=E([dt("esri.widgets.Attribution.AttributionViewModel")],pV);const zrt=pV,fV="esri-attribution",OM={base:`${fV} esri-widget`,poweredBy:`${fV}__powered-by`,sources:`${fV}__sources`,open:`${fV}--open`,sourcesOpen:`${fV}__sources--open`,link:`${fV}__link`,widgetIcon:"esri-icon-description",interactive:"esri-interactive"};let dv=class extends Hf{constructor(e,i){super(e,i),this._isOpen=!1,this._attributionTextOverflowed=!1,this._prevSourceNodeHeight=0,this._resizeObserver=new ResizeObserver(r=>r.forEach(({target:n})=>this._checkSourceTextOverflow(n))),this.iconClass=OM.widgetIcon,this.itemDelimiter=" | ",this.messages=null,this.viewModel=new zrt}initialize(){this.addHandles(Wu(()=>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,i)=>(e.includes(i.text)||e.push(i.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={[OM.open]:this._isOpen};return Gi("div",{bind:this,class:this.classes(OM.base,e),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this.renderSourcesNode(),this.renderPoweredBy())}renderPoweredBy(){return Gi("div",{class:OM.poweredBy},"Powered by"," ",Gi("a",{class:OM.link,href:"http://www.esri.com/",target:"_blank",rel:"noreferrer"},"Esri"))}renderSourcesNode(){const e=this._isOpen,i=this._isInteractive,r=i?"0":"",{attributionText:n}=this,s={[OM.sourcesOpen]:e,[OM.interactive]:i};return Gi("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(OM.sources,s),innerHTML:n,tabindex:r})}_afterSourcesNodeCreate(e){this._prevSourceNodeHeight=e.clientWidth,this._resizeObserver.observe(e)}_checkSourceTextOverflow(e){let i=!1;const{clientHeight:r,clientWidth:n,scrollWidth:s}=e,o=s>n,a=this._attributionTextOverflowed!==o;if(this._attributionTextOverflowed=o,a&&(i=!0),this._isOpen){const l=rthis.view,this._updateRotationWatcher,Yo))}destroy(){Uc(this._handles),this.view=null}get canShowNorth(){const e=this.get("view.spatialReference");return!(!e||!e.isWebMercator&&!e.isGeographic)}get state(){return this.get("view.ready")?this.canShowNorth?"compass":"rotation":"disabled"}reset(){if(!this.get("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 i=-e.heading;this.orientation={x:0,y:0,z:i}}_updateRotationWatcher(e){this._handles.removeAll(),e&&this._handles.add(e.type==="2d"?sr(()=>e?.rotation,this._updateForRotation,Yo):sr(()=>e?.camera,this._updateForCamera,Yo))}};E([N({readOnly:!0})],MN.prototype,"canShowNorth",null),E([N()],MN.prototype,"orientation",void 0),E([N({readOnly:!0})],MN.prototype,"state",null),E([N()],MN.prototype,"view",void 0),MN=E([dt(lui)],MN);const Hrt=MN,RM={base:"esri-compass esri-widget--button esri-widget",text:"esri-icon-font-fallback-text",icon:"esri-compass__icon",rotationIcon:"esri-icon-dial",northIcon:"esri-icon-compass",widgetIcon:"esri-icon-locate-circled",interactive:"esri-interactive",disabled:"esri-disabled"};let TT=class extends Hf{constructor(e,i){super(e,i),this.iconClass=RM.widgetIcon,this.messages=null,this.viewModel=new Hrt}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:i}=this.viewModel,r=i==="disabled",n=(i==="rotation"?"rotation":"compass")=="compass",s=r?-1:0,o={[RM.disabled]:r,[RM.interactive]:!r},a={[RM.northIcon]:n,[RM.rotationIcon]:!n},{messages:l}=this;return Gi("div",{bind:this,class:this.classes(RM.base,o),onclick:this._reset,onkeydown:this._reset,role:"button",tabIndex:s,"aria-label":l.reset,title:l.reset},Gi("span",{"aria-hidden":"true",class:this.classes(RM.icon,a),styles:this._toRotationTransform(e)}),Gi("span",{class:RM.text},l.reset))}_reset(){this.viewModel.reset()}_toRotationTransform(e){return{transform:`rotateZ(${e.z}deg)`}}};E([N()],TT.prototype,"goToOverride",null),E([N()],TT.prototype,"iconClass",void 0),E([N()],TT.prototype,"label",null),E([N(),Wf("esri/widgets/Compass/t9n/Compass")],TT.prototype,"messages",void 0),E([N()],TT.prototype,"view",null),E([N({type:Hrt})],TT.prototype,"viewModel",void 0),E([K1()],TT.prototype,"_reset",null),TT=E([dt("esri.widgets.Compass")],TT);const uui=TT,mV="esri-navigation-toggle",Ew={base:`${mV} esri-widget`,button:`${mV}__button esri-widget--button`,activeButton:`${mV}__button--active`,panButton:`${mV}__button--pan`,rotateButton:`${mV}__button--rotate`,isLayoutHorizontal:`${mV}--horizontal`,rotationIcon:"esri-icon-rotate",panIcon:"esri-icon-pan",widgetIcon:"esri-icon-pan2",disabled:"esri-disabled"};let gV=class extends Tn{constructor(e){super(e),this.navigationMode="pan",this.view=null}initialize(){this.own(Yg(()=>this.view?.inputManager,()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){return this.get("view.ready")&&this.view?.type==="3d"?"ready":"disabled"}toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate",this._setNavigationMode())}_setNavigationMode(){this.get("view.inputManager").primaryDragAction=this.navigationMode==="pan"?"pan":"rotate"}};E([N({readOnly:!0})],gV.prototype,"state",null),E([N()],gV.prototype,"navigationMode",void 0),E([N()],gV.prototype,"view",void 0),gV=E([dt("esri.widgets.NavigationToggleViewModel")],gV);const Wrt=gV;let ET=class extends Hf{constructor(e,i){super(e,i),this.iconClass=Ew.widgetIcon,this.messages=null,this.viewModel=new Wrt}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}toggle(){return this.viewModel.toggle()}render(){const e=this.get("viewModel.state")==="disabled",i=this.get("viewModel.navigationMode")==="pan",r={[Ew.disabled]:e,[Ew.isLayoutHorizontal]:this.layout==="horizontal"},n={[Ew.activeButton]:i},s={[Ew.activeButton]:!i},o=e?-1:0,a=this.messages.toggle;return Gi("div",{bind:this,class:this.classes(Ew.base,r),onclick:this._toggle,onkeydown:this._toggle,tabIndex:o,"aria-label":a,title:a},Gi("div",{class:this.classes(Ew.button,Ew.panButton,n)},Gi("span",{class:Ew.panIcon})),Gi("div",{class:this.classes(Ew.button,Ew.rotateButton,s)},Gi("span",{class:Ew.rotationIcon})))}_toggle(){this.toggle()}};E([N()],ET.prototype,"iconClass",void 0),E([N()],ET.prototype,"label",null),E([N({value:"vertical"})],ET.prototype,"layout",null),E([N(),Wf("esri/widgets/NavigationToggle/t9n/NavigationToggle")],ET.prototype,"messages",void 0),E([N()],ET.prototype,"view",null),E([N({type:Wrt})],ET.prototype,"viewModel",void 0),E([K1()],ET.prototype,"_toggle",null),ET=E([dt("esri.widgets.NavigationToggle")],ET);const cui=ET,fX={button:"esri-widget--button esri-widget",disabled:"esri-disabled",interactive:"esri-interactive",iconText:"esri-icon-font-fallback-text",icon:"esri-icon"};let MM=class extends Hf{constructor(){super(...arguments),this.enabled=!0,this.iconClass="",this.title=""}render(){const e=this.enabled?0:-1,i={[fX.disabled]:!this.enabled,[fX.interactive]:this.enabled},r={[this.iconClass]:!!this.iconClass};return Gi("div",{bind:this,class:this.classes(fX.button,i),onclick:this._triggerAction,onkeydown:this._triggerAction,role:"button",tabIndex:e,title:this.title},Gi("span",{"aria-hidden":"true",role:"presentation",class:this.classes(fX.icon,r)}),Gi("span",{class:fX.iconText},this.title))}_triggerAction(){this.action.call(this)}};E([N()],MM.prototype,"action",void 0),E([N()],MM.prototype,"enabled",void 0),E([N()],MM.prototype,"iconClass",void 0),E([N()],MM.prototype,"title",void 0),E([K1()],MM.prototype,"_triggerAction",null),MM=E([dt("esri.widgets.IconButton")],MM);const qrt=MM;let yV=class extends Tn{get canZoomIn(){if(!this.get("view.ready"))return!1;const e=this.get("view.animation.target.scale")||this.get("view.scale"),i=this.get("view.constraints.effectiveMaxScale");return i===0||e>i}get canZoomOut(){if(!this.get("view.ready"))return!1;const e=this.get("view.animation.target.scale")||this.get("view.scale"),i=this.get("view.constraints.effectiveMinScale");return i===0||ethis.components,this._componentsWatcher.bind(this),Yo),sr(()=>this.view,this._updateViewAwareWidgets.bind(this),Yo)])}_add(e,i,r,n){let s=e;if(typeof e=="string"&&this._defaultPositionLookup[e]){if(this._find(e))return;s=this._createComponent(e)}super._add(s,i,r,n)}_removeComponents(e){e.forEach(i=>{const r=this._find(i);r&&(this.remove(r),r.destroy())})}_updateViewAwareWidgets(e){this.components.forEach(i=>{const r=this._find(i),n=r&&r.widget;fui(n)&&(n.view=e)})}_componentsWatcher(e,i){this._removeComponents(i),this._addComponents(e),this._adjustPadding(e)}_adjustPadding(e){if(!e.includes("attribution")&&!this._isOverridden("padding")){const{top:i}=this.padding;this.padding=i}}_addComponents(e){this.constructed&&e.forEach(i=>this.add(this._createComponent(i),this._defaultPositionLookup[i]))}_createComponent(e){const i=this._createWidget(e);if(i)return new Qle({id:e,node:i})}_createWidget(e){return e==="attribution"?this._createAttribution():e==="compass"?this._createCompass():e==="navigation-toggle"?this._createNavigationToggle():e==="zoom"?this._createZoom():void 0}_createAttribution(){return new aui({view:this.view})}_createCompass(){return new uui({view:this.view})}_createNavigationToggle(){return new cui({view:this.view})}_createZoom(){return new pui({view:this.view})}};E([N()],tue.prototype,"components",void 0),tue=E([dt("esri.views.ui.DefaultUI")],tue);const mui=tue;let iue=class extends mui{constructor(e){super(e),this.components=["attribution","zoom"]}};E([N()],iue.prototype,"components",void 0),iue=E([dt("esri.views.ui.2d.DefaultUI2D")],iue);const Xrt=iue;var gAe;let rue=gAe=class extends Ui{constructor(t){super(t),this.color=new en([0,0,0,1])}clone(){return new gAe(gi({color:this.color}))}};E([N({type:en,json:{write:!0}})],rue.prototype,"color",void 0),rue=gAe=E([dt("esri.webmap.background.ColorBackground")],rue);const gui=rue;let Krt,Jrt,Zrt,Qrt,ent,tnt;async function yui(){const[,{GraphicsView2D:t,GraphicContainer:e,LabelManager:i,MapViewNavigation:r,MagnifierView2D:n,Stage:s}]=await Promise.all([Promise.resolve().then(()=>mEt),Promise.resolve().then(()=>yPt)]);Jrt=t,Zrt=e,Qrt=i,ent=r,tnt=n,Krt=s}const int=160;function vui(t){return t&&t.declaredClass==="esri.Viewpoint"}let ba=class extends yei(Usi(zsi(moi))){constructor(e){super(e),this._magnifierView=null,this._stage=null,this._resolveWhenReady=[],this.rootLayerViews=new L2({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.graphicsView=null,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.rendering=!1,this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this._stationaryTimer=null,this._gotoTask=null,this.frameTask=new aai(this),this._pePromise=null,this.floors=new Sr,this.highlightOptions=new lAe,this.inputManager=new bli({view:this}),this.map=null,this.resizeAlign="center",this.spatialReferenceLocked=!1,this.timeline=new uAe,this.type="2d",this.ui=new Xrt,this._pixelFormat={flipY:!0,premultipliedAlpha:!0},this.constraints=new trt,this.padding={top:0,right:0,bottom:0,left:0},this.handles.add([sr(()=>this.viewpoint,()=>{this._lastStationaryEventTimestamp=performance.now(),this._flipStationary(int)},qu),this.on("resize",i=>this._resizeHandler(i)),sr(()=>this.animationManager?.animation,i=>{this.animation=i})]),_Ut()}destroy(){this._set("preconditionsReady",!1),this._gotoTask=this.frameTask=null,this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new Ort(this.featuresTilingScheme)}get initialExtentRequired(){const{scale:e,constraints:i,center:r,viewpoint:n,extent:s}=this;let o=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&!s&&(i?.effectiveLODs||(o=-1),(!r||e===0&&o===-1)&&(!n||!ve(n.targetGeometry)||n.targetGeometry.type!=="extent"&&!n.scale))}get resourceManager(){return this._stage.resourceManager}get textureManager(){return this._stage.painter.textureManager}get _defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get _projectionEngineLoaded(){return!!hw()||(this._pePromise||(this._pePromise=A2().finally(()=>{this._pePromise=null})),!1)}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const i=this.spatialReference,r=e.targetGeometry;return!!o_(r.spatialReference,i)||this._projectionEngineLoaded}set animation(e){const i=this._get("animation");if(e===i)return;if(i&&i.stop(),!e||e.isFulfilled())return void this._set("animation",null);this._set("animation",e),this.frameTask.animationInProgress=!0;const r=()=>{e===this._get("animation")&&(this._set("animation",null),this.frameTask?.requestFrame()),this.frameTask&&(this.frameTask.animationInProgress=!1)};e.when(r,r)}get background(){return _ui(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){if(!this.ready)return this._get("center");const{center:e,spatialReference:i}=this.state.paddedViewState;return new er({x:e[0],y:e[1],spatialReference:i})}set center(e){if(e==null)return;if(!this.ready)return this._set("center",e),void this.notifyChange("initialExtentRequired");let i;try{i=this._project(e,this.spatialReference)}catch(n){return void Oi.getLogger(this.declaredClass).error(new st("mapview:invalid-center","could not project the value in the view's spatial reference",{input:e,error:n}))}const r=this.viewpoint;BIe(r,r,i),this.viewpoint=r}set constraints(e){const i=this._get("constraints");i&&(this.handles.remove("map-view-constraints"),i.destroy()),this._set("constraints",e),e&&(e.view=this,this.ready&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint)),this.handles.add(sr(()=>e.version,()=>{this.ready&&this.state&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint))},qu),"map-view-constraints"))}get extent(){return this.ready?this.state.paddedViewState.extent.clone():this._get("extent")}set extent(e){if(e==null)return;if(!e.width||!e.height)return void Oi.getLogger(this.declaredClass).error(new st("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",e),this._set("center",null),this._set("viewpoint",null),this._set("scale",0),this._set("zoom",-1),void this.notifyChange("initialExtentRequired");let i;try{i=this._project(e,this.spatialReference)}catch(n){return void Oi.getLogger(this.declaredClass).error(new st("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:n}))}const r=this.viewpoint;qoi(r,r,i,this.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.state?this.state.resolution:0}get rotation(){return this.ready?this.state.rotation:this._get("rotation")}set rotation(e){if(isNaN(e))return;if(!this.ready)return void this._set("rotation",e);const i=this.viewpoint;rai(i,i,e),this.viewpoint=i}get scale(){return this.ready?this.state.scale:this._get("scale")}set scale(e){if(!e||isNaN(e))return;if(!this.ready){this._set("scale",e),this._set("zoom",-1);const r=this._get("extent");return r&&(this._set("extent",null),this._set("center",r.center)),void this.notifyChange("initialExtentRequired")}const i=this.viewpoint;qit(i,i,e),this.viewpoint=i}get stationary(){return!(this.animation||this.navigating||this.resizing||this._stationaryTimer)}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(i=>!i.destroyed&&!("layerViews"in i)&&i.updating===!0));if(Hi("esri-2d-log-updating")){const i=this.allLayerViews.reduce((r,n)=>({...r,[n.layer.id]:!n.destroyed&&!("layerViews"in n)&&n.updating}),{});console.log(`Updating MapView: ${e} -> Null LayerViewManager: ${!this.layerViewManager} -> Null LabelManager: ${!this.labelManager} -> Null GraphicsView: ${!this.graphicsView} @@ -67,53 +67,57 @@ var RAMP4=function(U0){"use strict";var S1=(t=>(t.BLOB="blob",t.DATE="date",t.DO -> labelManager.updating: ${this.labelManager?.updating} -> graphicsView.updating: ${this.graphicsView?.updating} -> allLayerViews: ${JSON.stringify(i)} -`)}return e}get viewpoint(){if(!this.ready)return this._get("viewpoint");const e=this.state.paddedViewState;return e&&e.viewpoint.clone()}set viewpoint(e){if(e==null)return;if(!this.ready)return this._set("viewpoint",e),this._set("extent",null),this._set("center",null),this._set("zoom",-1),this._set("scale",0),void this.notifyChange("initialExtentRequired");let i,r;try{i=this._project(e,this.spatialReference),!e.scale||isNaN(e.scale)?r=new st("mapview:invalid-viewpoint",`invalid scale value of ${e.scale}`):lt(e.targetGeometry)&&(r=new st("mapview:invalid-viewpoint","geometry not defined"))}catch(s){r=new st("mapview:invalid-viewpoint","could not project the value in the view's spatial reference",{error:s})}if(r)return void Ei.getLogger(this.declaredClass).error(r);this._scaleBeforeChangingSpatialReference=null;const n=new u_({targetGeometry:new Yi,scale:0,rotation:0});G2(n,i),this.constraints.constrain(n,this.state.paddedViewState.viewpoint),this.state.viewpoint=n,this.frameTask.requestFrame(),this._set("viewpoint",n)}get zoom(){return this.ready?this.constraints.scaleToZoom(this.scale):this._get("zoom")}set zoom(e){if(e==null)return;if(!this.ready){this._set("zoom",e),this._set("scale",0);const r=this._get("extent");return r&&(this._set("extent",null),this._set("center",r.center)),void this.notifyChange("initialExtentRequired")}if(!this.constraints.effectiveLODs)return void this._set("zoom",-1);const i=this.viewpoint;zit(i,i,this.constraints.zoomToScale(e)),this.viewpoint=i,this._set("zoom",this.constraints.scaleToZoom(this.scale))}get navigating(){return!(!this.mapViewNavigation||!this.mapViewNavigation.interacting)}goTo(e,i){if(e)return this.animation&&(this.animation=null),this._createAnimation(),F1(()=>this.ready,i).then(()=>{const r={animate:!0,...i},n=xoi(e,this);return this.animation?.update(n),this._gotoTask={},r.animate?this._gotoAnimated(n,r):this._gotoImmediate(n,r)});Ei.getLogger(this.declaredClass).error("#goTo()","target cannot be null or undefined")}async hitTest(e,i){const r=mit(e)?fit(this,e):e;if(!this.ready||isNaN(r.x)||isNaN(r.y))return{screenPoint:r,results:[]};let n=new Set,s=!1,o=null,a=null;i?.include?int(i.include,tnt(this,p=>n.add(p),p=>{o||(o=new Set),o.add(p)},p=>n.add(p),()=>s=!0)):(s=!0,n=new Set(this.allLayerViews)),i?.exclude&&int(i.exclude,tnt(this,p=>n.delete(p),p=>{a||(a=new Set),a.add(p)}));const l=this.allLayerViews.filter(p=>!p.suspended&&n.has(p)).reverse(),c=this.toMap(r);let d=[...s?this.graphicsView.hitTest(c).map(p=>({type:"graphic",graphic:p,layer:null,mapPoint:c})):[],...await Promise.all(l.map(p=>p.hitTest(c,r)).toArray())].filter(ye).flat().filter(ye);return o&&(d=d.filter(p=>!("graphic"in p)||!p.graphic||o?.has(pAe(p.graphic)))),a&&(d=d.filter(p=>!("graphic"in p)||!p.graphic||a?.has(pAe(p.graphic)))),{screenPoint:r,results:d}}async takeScreenshot(e){const i=this._createScreenshotPlan(e),r=await this._stage.takeScreenshot(i);return lli(r,{format:i.format,quality:i.quality,rotation:0,disableDecorations:!1},this._pixelFormat)}async _takeScreenshot(e){const i=this._createScreenshotPlan(e),r=await this._stage.takeScreenshot(i);return uli(r,this._pixelFormat)}_createScreenshotPlan(e){e=e??{};const i=this.supersampleScreenshotsEnabled?Math.min(4,pli(this.size,Math.min(4096,this._stage.context.parameters.maxTextureSize))):1;let r;e.layers?(r=[],e.layers.forEach(o=>{const a=this.allLayerViews.find(l=>l.layer.id===o.id);a&&"container"in a&&a.container&&r.push(a.container)})):r=this._stage.children;const{format:n,quality:s}=dli(e.format,e.quality);return nli(e,i,this.size,this.padding,n,s,r,e.rotation)}get test(){return{takeScreenshot:e=>this._takeScreenshot(e)}}toMap(e){if(!this.ready)return null;const i=mit(e)?fit(this,e):e,r=[0,0],[n,s]=this.state.toMap(r,[i.x,i.y]),o=this.spatialReference;return new Yi({x:n,y:s,spatialReference:o})}toScreen(e){if(!this.ready)return null;const i=this._project(e,this.spatialReference),r=[i.x,i.y];return this.state.toScreen(r,r),Vh(r[0],r[1])}on(e,i,r,n){return this.inputManager&&this.viewEvents.on(e,i,r,n)||super.on(e,i)}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}hasLayerViewModule(e){return Xit.hasLayerViewModule(e)}importLayerView(e){return Xit.importLayerView(e)}pixelSizeAt(){return this.ready?this.state.resolution:(Ei.getLogger(this.declaredClass).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}popupHitTest(e){return this.hitTest(e).then(i=>({...i,mapPoint:this.toMap(e)}))}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}validate(){let e=Oli(this.type);return Gi("safari")&&Gi("safari")<9&&(e=new st("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:Gi("safari")})),ye(e)?(Ei.getLogger(this.declaredClass).warn("#validate()",e.message),Promise.reject(e)):Yli()}_createAnimation(){return this.animation&&!this.animation.done||(this.animation=new SIe),this.animation}_cancellableGoTo(e,i,r){const n=()=>e===this._gotoTask,s=r.then(()=>{n()&&(this.animation=null)}).catch(a=>{throw n()&&(i&&!i.done&&(i.stop(),this.frameTask.animationInProgress=!1),this.animation=null),a}),o=new Promise(a=>a(s));return i.when().catch(()=>{n()&&o.cancel&&o.cancel()}),o}_gotoImmediate(e,i){const r=this._gotoTask,n=this.animation,s=e.then(o=>{if(sn(i),r!==this._gotoTask)throw new st("view:goto-interrupted","Goto was interrupted");this.viewpoint=n.target=o,n.finish()});return this._cancellableGoTo(r,n,s)}_flipStationary(e){return this._stationaryTimer!==null||(this._stationaryTimer=setTimeout(()=>{this._stationaryTimer=null;const i=performance.now()-this._lastStationaryEventTimestamp;i{if(sn(i),r!==this._gotoTask)throw new st("view:goto-interrupted","Goto was interrupted");return n.update(o),this.animationManager.animate(n,this.viewpoint,i),n.when().then(()=>{},()=>{})});return this._cancellableGoTo(r,n,s)}_project(e,i){const r=e&&e.targetGeometry||e;if(!i)return e;if(!r)return null;if(i.imageCoordinateSystem||r.spatialReference?.imageCoordinateSystem||Ca(i,r.spatialReference))return e;const n=rp(r,i);if(!n)throw new st("mapview:projection-not-possible","projecting input geometry to target spatial reference returned a null value",{geometry:r,spatialReference:i});return Xli(e)?(e.targetGeometry=n,e):n}_resizeHandler(e){if(!this.ready)return;const i=this.state;let r=this.state.paddedViewState.viewpoint;const n=this.state.paddedViewState.size.concat();i.size=[e.width,e.height],Doi(r,r,n,this.state.paddedViewState.size,this.resizeAlign),r=this.constraints.constrain(r,void 0),this.state.viewpoint=r}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint(),i=e.targetGeometry;try{this._project(e,this.spatialReference)}catch(l){Ei.getLogger(this.declaredClass).warn(new wm("mapview:startup-projection-error","projection of initial viewpoint to the view's spatial reference, defaulting to the initial viewpoint.",{center:i.toJSON(),spatialReference:this.spatialReference,error:l})),e.targetGeometry=this.defaultsFromMap.extent?.center||new Yi({x:0,y:0,spatialReference:this.spatialReference})}this.constraints?.fit(e),this._set("state",new cai({padding:this._get("padding"),size:this.size,viewpoint:e})),this.graphics.owner=this;const r=new qrt(this.surface,{canvas:this.renderCanvas,supersampleScreenshots:this.supersampleScreenshotsEnabled,contextOptions:{disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},renderingOptions:this.renderingOptions,timeline:this.timeline});this._stage=r,this._magnifierView=new Zrt,this._magnifierView.magnifier=this.magnifier;const n=new Krt({view:this});this._set("labelManager",n);const s=new Noi({view:this});this._set("animationManager",s);const o=new Jrt({view:this,animationManager:s});this._set("mapViewNavigation",o),this._setupSpatialReferenceDependentProperties(),this.handles.add([this.rootLayerViews.on("change",()=>this._updateStageChildren()),r.on("post-render",()=>this._set("rendering",r.renderRequested)),r.on("will-render",()=>this._set("rendering",r.renderRequested)),r.on("webgl-error",l=>this.fatalError=l.error),Qi(()=>this.stationary,l=>r.stationary=l,jh),Qi(()=>this.background,l=>{r.background=l,this._magnifierView.background=l},jh),Qi(()=>this.magnifier,l=>this._magnifierView.magnifier=l,jh),Qi(()=>this.renderingOptions,l=>r.renderingOptions=l,jh),Qi(()=>this.highlightOptions,l=>r.highlightOptions=l,jh),Qi(()=>this.state.id,()=>r.state=this.state,jh)],"map-view"),this._updateStageChildren();const a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach(l=>l(this)),this.timeline.end("MapView Startup"),this.frameTask&&this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.handles.remove("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",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&&this.frameTask.stop(),this._stationaryTimer&&(clearTimeout(this._stationaryTimer),this._stationaryTimer=null),this._set("ready",!1);const{center:[e,i],spatialReference:r,rotation:n,scale:s}=this.state.paddedViewState,o=new Yi({x:e,y:i,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("spatialReference",r),this._set("state",null),this.animation=null}_updateStageChildren(){this._stage.removeAllChildren(),this.rootLayerViews.forEach(i=>{this._stage.addChild(i.container)});const e=this.graphicsView;this._stage.addChild(e.container),this._stage.addChild(this._magnifierView)}_setupSpatialReferenceDependentProperties(){const e=new wk(Ml.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const i=new Yrt({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new Xrt(e)});this.frameTask.graphicsView=i,this._set("graphicsView",i)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),this.frameTask.graphicsView=null,e.destroy(),this._set("featuresTilingScheme",null)}_spatialReferenceChanged(e){if(!this.ready)return;this.frameTask.stop();for(const l of this.allLayerViews)l.processDetach();this._destroySpatialReferenceDependentProperties();const i=this.state.paddedViewState.clone();if(lt(this._scaleBeforeChangingSpatialReference))this._scaleBeforeChangingSpatialReference=i.scale;else{const l=i.viewpoint.clone();l.scale=this._scaleBeforeChangingSpatialReference,i.viewpoint=l}const r=i.clone(),[n,s]=i.center;let o=null;try{o=this._project(new Yi({x:n,y:s,spatialReference:i.spatialReference}),e)}catch(l){lw()||Ei.getLogger(this.declaredClass).warn(new wm("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 Yi({x:0,y:0,spatialReference:e}));const a=LIe(new u_({targetGeometry:new Yi,scale:0,rotation:0}),i.viewpoint,o);r.viewpoint=a;try{const c=[i.size[0]/2,i.size[1]/2],d=[c[0]+20,c[1]],p=i.toMap([0,0],d),{x:y,y:v}=this._project(new Yi({x:p[0],y:p[1],spatialReference:i.spatialReference}),e);p[0]=y,p[1]=v,r.toScreen(p,p);const S=jit(c,p,d),I=Math.hypot(p[0]-c[0],p[1]-c[1])/20;!Number.isFinite(I)||Math.abs(I)>4?(a.rotation=0,a.targetGeometry=new Yi({x:0,y:0,spatialReference:e})):(a.scale*=I,a.scale>Gi("mapview-srswitch-adjust-rotation-scale-threshold")?a.rotation=0:a.rotation+=Number.isFinite(S)?S:0)}catch{}this._get("constraints").constrain(a,void 0),this._get("state").viewpoint=a,this._stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const l of this.allLayerViews)l.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}};ca.type="2d",E([k({readOnly:!0})],ca.prototype,"animationManager",void 0),E([k({constructOnly:!0})],ca.prototype,"deactivatedWebGLExtensions",void 0),E([k({constructOnly:!0})],ca.prototype,"debugWebGLExtensions",void 0),E([k({readOnly:!0})],ca.prototype,"featuresTilingScheme",void 0),E([k({readOnly:!0})],ca.prototype,"fullOpacity",void 0),E([k({readOnly:!0})],ca.prototype,"graphicsTileStore",null),E([k()],ca.prototype,"graphicsView",void 0),E([k({readOnly:!0})],ca.prototype,"state",void 0),E([k()],ca.prototype,"initialExtentRequired",null),E([k()],ca.prototype,"labelManager",void 0),E([k({readOnly:!0})],ca.prototype,"resourceManager",null),E([k({readOnly:!0})],ca.prototype,"textureManager",null),E([k({readOnly:!0})],ca.prototype,"mapViewNavigation",void 0),E([k({constructOnly:!0})],ca.prototype,"renderCanvas",void 0),E([k()],ca.prototype,"renderingOptions",void 0),E([k({readOnly:!0})],ca.prototype,"rendering",void 0),E([k({constructOnly:!0})],ca.prototype,"supersampleScreenshotsEnabled",void 0),E([k({readOnly:!0})],ca.prototype,"supportsGround",void 0),E([k()],ca.prototype,"_stationaryTimer",void 0),E([k()],ca.prototype,"_defaultsFromMapSettings",null),E([k()],ca.prototype,"_pePromise",void 0),E([k({readOnly:!0})],ca.prototype,"typeSpecificPreconditionsReady",null),E([k()],ca.prototype,"animation",null),E([k({type:qli})],ca.prototype,"background",null),E([k({value:null,type:Yi,dependsOn:["state.id","ready"]})],ca.prototype,"center",null),E([k({type:Zit})],ca.prototype,"constraints",null),E([k({value:null,type:vr,dependsOn:["state.id","ready"]})],ca.prototype,"extent",null),E([k()],ca.prototype,"floors",void 0),E([k({type:nAe})],ca.prototype,"highlightOptions",void 0),E([k({readOnly:!0})],ca.prototype,"inputManager",void 0),E([k()],ca.prototype,"map",void 0),E([k({value:{top:0,right:0,bottom:0,left:0},cast:t=>({top:0,right:0,bottom:0,left:0,...t})})],ca.prototype,"padding",null),E([k()],ca.prototype,"resizeAlign",void 0),E([k({readOnly:!0,dependsOn:["state.id"]})],ca.prototype,"resolution",null),E([k({value:0,type:Number,dependsOn:["state.id","ready"]})],ca.prototype,"rotation",null),E([k({value:0,type:Number,dependsOn:["state.id","ready"]})],ca.prototype,"scale",null),E([k({constructOnly:!0})],ca.prototype,"spatialReferenceLocked",void 0),E([k()],ca.prototype,"stationary",null),E([k({type:sAe,readOnly:!0})],ca.prototype,"timeline",void 0),E([k({readOnly:!0})],ca.prototype,"type",void 0),E([k({readOnly:!0})],ca.prototype,"updating",null),E([k({value:null,type:u_,dependsOn:["state.id","ready"]})],ca.prototype,"viewpoint",null),E([k({value:-1,dependsOn:["state.id","ready"]})],ca.prototype,"zoom",null),E([k({readOnly:!0})],ca.prototype,"navigating",null),E([k({type:Wrt})],ca.prototype,"ui",void 0),ca=E([ht("esri.views.MapView")],ca);const ent=ca;function pAe(t){const e=t.getObjectId();return e?`${t.layer?.uid??t.sourceLayer?.uid??"MapView"}/${e}`:`"MapView/${t.uid}`}function tnt(t,e,i,r,n){return s=>{if(s instanceof js){if(s.layer===t)n?.();else{const o=t.allLayerViews.find(a=>a.layer===s.layer);o&&r?.(o)}i(pAe(s))}else{const o=t.allLayerViews.find(a=>a.layer===s);o&&e(o)}}}function int(t,e){if(t)if(Sre(t))for(const i of t)if(Sre(i))for(const r of i)e(r);else e(i);else e(t)}function Kli(t){return t?.declaredClass==="esri.WebMap"}let Jli=class{constructor(e){this.message=e}toString(){return`AssertException: ${this.message}`}};function Fp(t,e){if(!t){e=e||"Assertion";const i=new Error(e).stack;throw new Jli(`${e} at ${i}`)}}function rnt(t,e,i,r){let n,s=(i[0]-t[0])/e[0],o=(r[0]-t[0])/e[0];s>o&&(n=s,s=o,o=n);let a=(i[1]-t[1])/e[1],l=(r[1]-t[1])/e[1];if(a>l&&(n=a,a=l,l=n),s>l||a>o)return!1;a>s&&(s=a),ld&&(n=c,c=d,d=n),!(s>d||c>o)&&(dnew Qli(s))}destroy(){this._clients.length=0}hasQuota(e){const i=this._clients[e];return!!i&&(this._totalNumWorkersthis._taskCallback(r,n))):i.tasks.push(e))}cancel(e){this._taskFinished(e),e._cancelled=!0}_taskFinished(e){const i=this._clients[e.client];this._totalNumWorkers--,i.numWorkers--,i.statistics.requests++,i.statistics.size+=e.size||0,i.statistics.duration+=e.duration||0,i.statistics.speed=i.statistics.duration>0?i.statistics.size/i.statistics.duration:0,Fp(i.numWorkers>=0),this._next()}_next(){for(const e of this._clients)if(e&&e.numWorkers0;)if(this._workerFunc(e.tasks.shift(),(i,r)=>this._taskCallback(i,r)))return e.numWorkers++,this._totalNumWorkers++,!0;return!1}_taskCallback(e,i){e._cancelled||(this._callbackFunc(e,i),this._taskFinished(e))}getStatsForType(e){const i=this._clients[e];return i?{quota:i.typeWorkerQuota,workers:i.numWorkers,queueSize:i.tasks.length,requestStats:i.statistics}:null}get test(){const e=this;return{set workerFunc(i){e._workerFunc=i}}}},fAe=class extends fn{constructor(){super(...arguments),this._tasks=new Map,this._onLoadQueue=new Array,this._doneQueue=new Array,this.updating=!1}setup(e,i,r){this._loadQueue=new tui((n,s)=>this._startLoading(n,s),(n,s)=>this._doneLoadingCB(n,s),e,i),r&&(this._frameTask=r.registerTask(sl.STREAM_DATA_LOADER,this))}destroy(){this._frameTask=Bc(this._frameTask),this._tasks.forEach(e=>rL(e.abortController)),this._loadQueue=ra(this._loadQueue),this._onLoadQueue=null,this._doneQueue=null,this._tasks=null}hasDownloadSlots(e){return this._loadQueue.hasQuota(e)}request(e,i,r,n={}){const s=Mf();s.__signal=ye(n)?n.signal:null;const o=this._createOrUpdateTask(e,i,r,n,s);return ep(n,()=>this._cancelRequest(o,s)),s.promise}_createTask(e,i,r,n,s,o){const a=new sui(e,i,r,n,s);return this._updateTask(a,o),this._tasks.set(s,a),this._tasks.size===1&&this._set("updating",!0),this._loadQueue.push(a),a}_cancelRequest(e,i){iGe(e.resolvers,i),i.reject(vc()),e.resolvers.length===0&&(e.status===Cw.DOWNLOADING&&(e.status=Cw.CANCELLED,this._loadQueue.cancel(e),e.abortController?.abort(),e.request=null,e.abortController=null),e.status=Cw.CANCELLED,this._tasks.delete(e.key),this._tasks.size===0&&this._set("updating",!1))}_updateTask(e,i){e.resolvers.push(i)}_createOrUpdateTask(e,i,r,n,s){const o=oui(ye(n)&&n.uid||e,i,r),a=this._tasks.get(o);return a?(this._updateTask(a,s),a):this._createTask(e,n,i,r,o,s)}_doneLoadingCB(e,i){this._loadQueue&&(Fp(e.status===Cw.DOWNLOADING),e.status=Cw.DOWNLOADED,this._frameTask?this._doneQueue.push({task:e,err:i}):this._doneLoading(e,i))}get running(){return this._doneQueue.length>0||this._onLoadQueue.length>0}runTask(e){for(;!e.done&&this._onLoadQueue.length>0;){const i=this._onLoadQueue.shift();sn(i.task.abortController),i.task.abortController=null,i.callback(i.task),e.madeProgress()}for(;!e.done&&this._doneQueue.length>0;){const i=this._doneQueue.shift();i.task.status!==Cw.DOWNLOADED&&(i.err=i.err||vc()),this._doneLoading(i.task,i.err),e.madeProgress()}}_doneLoading(e,i){if(i&&!ss(i)&&e.numRetries>0)return--e.numRetries,void this._loadQueue.push(e);let r=e.result instanceof HTMLImageElement?0:e.resolvers.length;for(const n of e.resolvers)if(i)ss(i)?n.reject(i):n.reject(new st("stream-data-loader:request-error",`Failed to request resource at '${e.url}'. ${i}`,{url:e.url,error:i}));else{--r;const s=r<=0?e.result:hi(e.result);n.resolve(s)}this._tasks.delete(e.key),this._tasks.size===0&&this._set("updating",!1)}_startLoading(e,i){if(e.status===Cw.CANCELLED)return!1;let r,n;switch(e.startTime=performance.now(),e.status=Cw.DOWNLOADING,e.docType){case"binary":n="array-buffer",r=0;break;case"image":n="image";break;case"image+type":n="array-buffer";break;default:n="json"}e.abortController=new AbortController;const s=e.abortController.signal;e.request=ir(e.url,{...e.options,responseType:n,timeout:r,signal:s});let o=()=>{};const a=c=>{e.duration=performance.now()-e.startTime,e.size=c instanceof ArrayBuffer?c.byteLength:e.size||0,e.result=c,this._frameTask?this._onLoadQueue.push({callback:i,task:e}):(e.abortController=null,i(e))},l=c=>{e.status===Cw.DOWNLOADING&&i(e,c),o()};return e.docType!=="image+type"?(e.request.then(c=>a(c.data),l),!0):(e.request.then(c=>{const d=c.data,p=rui(d);if(n="image",e.size=d.byteLength,p==="unknown")return e.request=ir(e.url,{responseType:n,timeout:r,signal:s}),void e.request.then(S=>a(S.data),l);const y=new Blob([d],{type:p}),v=window.URL.createObjectURL(y);o=()=>window.URL.revokeObjectURL(v),e.request=ir(v,{responseType:n,timeout:r,signal:s}),e.request.then(S=>a(new nui(S.data,p,o)),l)},l),!0)}get test(){return{loadQueue:this._loadQueue}}};E([k({readOnly:!0})],fAe.prototype,"updating",void 0),fAe=E([ht("esri.views.3d.support.StreamDataLoader")],fAe);const iui={numRetries:0};function rui(t){if(t.byteLength<2)return"unknown";const e=new Uint8Array(t,0,t.byteLength);return e[0]===137&&e[1]===80?"image/png":e[0]===71&&e[1]===73?"image/gif":e[0]===66&&e[1]===77?"image/bmp":e[0]===255&&e[1]===216?"image/jpeg":"unknown"}let nui=class{constructor(e,i,r){this.image=e,this.type=i,this.release=r}get isOpaque(){return this.type==="image/jpeg"}},sui=class extends Zli{constructor(e,i,r,n,s){super(n),this.url=e,this.options=i,this.docType=r,this.key=s,this.result=null,this.status=Cw.QUEUED,this.request=null,this.abortController=null,this.resolvers=new Array,this.startTime=0,this.numRetries=iui.numRetries}};function oui(t,e,i){return`${t}:${e}:${i}`}var Cw;(function(t){t[t.QUEUED=1]="QUEUED",t[t.DOWNLOADING=2]="DOWNLOADING",t[t.DOWNLOADED=3]="DOWNLOADED",t[t.CANCELLED=4]="CANCELLED"})(Cw||(Cw={}));var nnt,snt,PT,ont,ant,lnt,unt;(function(t){t[t.INNER=0]="INNER",t[t.OUTER=1]="OUTER"})(nnt||(nnt={})),function(t){t[t.REGULAR=0]="REGULAR",t[t.HAS_NORTH_POLE=1]="HAS_NORTH_POLE",t[t.HAS_SOUTH_POLE=2]="HAS_SOUTH_POLE",t[t.HAS_BOTH_POLES=3]="HAS_BOTH_POLES"}(snt||(snt={})),function(t){t[t.NORTH=0]="NORTH",t[t.NORTH_EAST=1]="NORTH_EAST",t[t.EAST=2]="EAST",t[t.SOUTH_EAST=3]="SOUTH_EAST",t[t.SOUTH=4]="SOUTH",t[t.SOUTH_WEST=5]="SOUTH_WEST",t[t.WEST=6]="WEST",t[t.NORTH_WEST=7]="NORTH_WEST"}(PT||(PT={})),function(t){t[t.OFF=0]="OFF",t[t.ON=1]="ON"}(ont||(ont={})),function(t){t[t.Color=0]="Color",t[t.ColorNoRasterImage=1]="ColorNoRasterImage",t[t.Highlight=2]="Highlight",t[t.Water=3]="Water",t[t.Occluded=4]="Occluded",t[t.ObjectAndLayerIdColor=5]="ObjectAndLayerIdColor"}(ant||(ant={})),function(t){t[t.FADING=0]="FADING",t[t.IMMEDIATE=1]="IMMEDIATE",t[t.UNFADED=2]="UNFADED"}(lnt||(lnt={})),function(t){t[t.INSIDE=0]="INSIDE",t[t.INTERSECTS=1]="INTERSECTS",t[t.OUTSIDE=2]="OUTSIDE"}(unt||(unt={}));const aui=12;let dP=class Bv{constructor(e){const i=Bv.checkUnsupported(e);if(ye(i))throw i;const r=e;this.spatialReference=r.spatialReference,this._isWebMercator=this.spatialReference.isWebMercator,this._isGCS=zSe(this.spatialReference)||fL(this.spatialReference)||mL(this.spatialReference),this.origin=[r.origin.x,r.origin.y],this.pixelSize=r.size[0],this.dpi=r.dpi;const n=r.lods.reduce((c,d,p)=>(d.levelnew jn({level:i,scale:e.scale,resolution:e.resolution}))})}getExtent(e,i,r,n){const s=this.levels[e],o=s.tileSize[0],a=s.tileSize[1];n[0]=this.origin[0]+r*o,n[2]=this.origin[0]+(r+1)*o,n[3]=this.origin[1]-i*a,n[1]=this.origin[1]-(i+1)*a}convertExtentToRadians(e,i){this._isWebMercator?(i[0]=yUe(e[0]),i[1]=b1e(e[1]),i[2]=yUe(e[2]),i[3]=b1e(e[3])):this._isGCS&&(i[0]=Jb(e[0]),i[1]=Jb(e[1]),i[2]=Jb(e[2]),i[3]=Jb(e[3]))}getExtentGeometry(e,i,r,n=new vr){return this.getExtent(e,i,r,OT),n.spatialReference=this.spatialReference,n.xmin=OT[0],n.ymin=OT[1],n.xmax=OT[2],n.ymax=OT[3],n.zmin=void 0,n.zmax=void 0,n}ensureMaxLod(e){if(e==null)return!1;let i=!1;for(;this.levels.length<=e;){const r=this.levels[this.levels.length-1],n=r.resolution/2;this.levels.push({resolution:n,scale:r.scale/2,tileSize:[n*this.pixelSize,n*this.pixelSize]}),i=!0}return i}capMaxLod(e){this.levels.length>e+1&&(this.levels.length=e+1)}getMaxLod(){return this.levels.length-1}scaleAtLevel(e){return this.levels[0].scale/2**e}levelAtScale(e){const i=this.levels[0].scale;return e>=i?0:Math.log(i/e)*Math.LOG2E}resolutionAtLevel(e){return this.levels[0].resolution/2**e}compatibleWith(e){if(!(e instanceof Bv)){if(Bv.checkUnsupported(e))return!1;e=new Bv(e)}if(!e.spatialReference.equals(this.spatialReference)||e.pixelSize!==this.pixelSize)return!1;const i=Math.min(this.levels.length,e.levels.length)-1,r=this.levels[i].resolution;let n=.5*r;return!K8(e.origin[0],this.origin[0],n)||!K8(e.origin[1],this.origin[1],n)?!1:(n=.5*r/2**i/this.pixelSize*aui,K8(r,e.levels[i].resolution,n))}rootTilesInExtent(e,i=null,r=1/0){const n=new Array,s=this.levels[0].tileSize;if(lt(e)||s[0]===0||s[1]===0)return n;Bv.computeRowColExtent(e,s,this.origin,OT);let o=OT[1],a=OT[3],l=OT[0],c=OT[2];const d=c-l,p=a-o;if(d*p>r){const y=Math.floor(Math.sqrt(r));p>y&&(o=o+Math.floor(.5*p)-Math.floor(.5*y),a=o+y),d>y&&(l=l+Math.floor(.5*d)-Math.floor(.5*y),c=l+y)}for(let y=o;y!S9t(n.resolution,r/2**n.level))}static hasGapInLevels(e){const i=e.lods.map(r=>r.level);i.sort((r,n)=>r-n);for(let r=1;r=128&&i<=512}static hasOriginPerLODs(e){const i=e.origin;return e.lods.some(r=>r.origin!=null&&(r.origin[0]!==i.x||r.origin[1]!==i.y))}static getMissingTileInfoError(){return new st("tilingscheme:tile-info-missing","Tiling scheme must have tiling information")}static checkUnsupported(e){return lt(e)?mAe():e.lods.length<1?new st("tilingscheme:generic","Tiling scheme must have at least one level"):Bv.isPowerOfTwo(e)?Bv.hasGapInLevels(e)?new st("tilingscheme:gaps","Tiling scheme levels must not have gaps between min and max level"):Bv.tileSizeSupported(e)?Bv.hasOriginPerLODs(e)?new st("tilingscheme:multiple-origin","Tiling scheme levels must not have their own origin"):null:new st("tilingscheme:tile-size","Tiles must be square and size must be one of [128, 256, 512]"):new st("tilingscheme:power-of-two","Tiling scheme must be power of two")}static fromExtent(e,i){const r=e[2]-e[0],n=e[3]-e[1],s=Vc(i),o=1.2*Math.max(r,n),a=256,l=96,c=.0254,d=new Bv(new Ml({size:[a,a],origin:new Yi({x:e[0]-.5*(o-r),y:e[3]+.5*(o-n)}),lods:[new jn({level:0,resolution:o/a,scale:1/(a/l*c/(o*s))})],spatialReference:i}));return d.ensureMaxLod(20),d}static makeWebMercatorAuxiliarySphere(e){const i=new Bv(Bv.WebMercatorAuxiliarySphereTileInfo);return i.ensureMaxLod(e),i}static makeGCSWithTileSize(e,i=256,r=16){const n=256/i,s=new Bv(new Ml({size:[i,i],origin:new Yi({x:-180,y:90,spatialReference:e}),spatialReference:e,lods:[new jn({level:0,resolution:.703125*n,scale:295497598570834e-6*n})]}));return s.ensureMaxLod(r),s}get test(){return{isWebMercator:this._isWebMercator,isGCS:this._isGCS}}};function mAe(){return new st("tilingscheme:tile-info-missing","Tiling scheme must have tiling information")}dP.WebMercatorAuxiliarySphereTileInfo=new Ml({size:[256,256],origin:new Yi({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:rr.WebMercator}),spatialReference:rr.WebMercator,lods:[new jn({level:0,resolution:156543.03392800014,scale:591657527591555e-6})]}),dP.WebMercatorAuxiliarySphere=dP.makeWebMercatorAuxiliarySphere(19);const OT=_o(),cnt=64;K1e(oA/10);const lui=_o();dP.WebMercatorAuxiliarySphere.getExtent(0,0,0,lui),_o([-180,-90,180,90]);const wG=Qr(),uui=Qr(),pP=Qr(),fP=Qr();function cui(t,e,i=0){const r=t.extent;if(lt(r))return!1;if(i===0)return lGt(r,e);const n=Math.min(r[2]-r[0],r[3]-r[1]);return rse(r,e,i*n)}function aue(t,e,i,r){Hv(wG,i),wG[r]=e[r];const n=bc(wG,wG,e),s=bc(uui,t,e),o=Kb(s,n),a=Kb(n,n);let l;l=o<=0?e:a<=o?i:Uc(wG,e,Gh(n,n,o/a));const c=bc(wG,t,l);return Math.PI/2-Math.atan(c[2]/Math.sqrt(c[0]*c[0]+c[1]*c[1]))}function hui(t,e,i){const r=t.extent;if(lt(r))return 0;pP[0]=r[0],pP[1]=r[1],pP[2]=i,fP[0]=r[2],fP[1]=r[3],fP[2]=i;let n=1/0,s=1/0;return e[0]fP[0]&&(n=aue(e,fP,pP,0)),e[1]fP[1]&&(s=aue(e,fP,pP,1)),Math.min(n,s)}function dui(t,e,i){if(lt(t))return mAe();if(t.spatialReference.isGeographic&&!zSe(t.spatialReference))return new st("tilingscheme:local-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in local scenes");const r=dP.checkUnsupported(t);if(ye(r))return r;if(lt(i))return new st("tilingscheme:extent-not-exist","The layer does not provide a layer extent.");const n=pui(t,i);if(n)return n;const s=t.spatialReference;return ye(e)&&!(s.equals(e)||e.isWGS84&&s.isWebMercator)?new st("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the local scene"):null}function pui(t,e){const i=t.lods,r=i[0].resolution*2**i[0].level,n=[r*t.size[0],r*t.size[1]],s=[t.origin.x,t.origin.y],o=fR(e),a=_o();dP.computeRowColExtent(o,n,s,a);const l=(a[2]-a[0])*(a[3]-a[1]);if(l>cnt){const c=i[0].scale*2**i[0].level;let d=Math.max((o[3]-o[1])/t.size[1],(o[2]-o[0])/t.size[0])*c/r;const p=Math.floor(Math.log(d)/Math.log(10));return d=Math.ceil(d/10**p)*10**p,new st("tilingscheme:too-many-root-tiles","Scale of level 0 of the tiling scheme (1:"+Math.floor(c).toLocaleString()+") is too large for the layer's extent. Suggested scale: 1:"+d.toLocaleString()+".",{level0Scale:c,suggestedLevel0Scale:d,requiredNumRootTiles:l,allowedNumRootTiles:cnt})}return null}const fui=Object.freeze(Object.defineProperty({__proto__:null,checkIfTileInfoSupportedForViewSR:dui,isInsideExtent:cui,tiltToExtentEdge:hui},Symbol.toStringTag,{value:"Module"}));function mui(){return!0}function gui(){return 0}function yui(t,e){if(lt(t))return mAe();const i=t.lods.length-1,r=t.spatialReference,n=zSe(r)||fL(r)||mL(r);if(r.isWebMercator){if(!dP.makeWebMercatorAuxiliarySphere(i).compatibleWith(t))return new st("tilingscheme:incompatible-global-web-mercator","The tiling scheme is not compatible with the ArcGIS Online Web Mercator tiling scheme")}else{if(!n)return new st("tilingscheme:global-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in global scenes");if(!dP.makeGCSWithTileSize(t.spatialReference,t.size[0],i).compatibleWith(t))return t.spatialReference.isWGS84?new st("tilingscheme:incompatible-global-wgs84","The tiling scheme is not compatible with the ArcGIS Online WGS84 tiling scheme"):new st("tilingscheme:incompatible-global","The tiling scheme is not compatible with the ArcGIS Online tiling scheme")}return ye(e)&&!t.spatialReference.equals(e)?new st("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the global scene"):void 0}const vui=Object.freeze(Object.defineProperty({__proto__:null,checkIfTileInfoSupportedForViewSR:yui,isInsideExtent:mui,tiltToExtentEdge:gui},Symbol.toStringTag,{value:"Module"})),_ui={[_w.Global]:vui,[_w.Local]:fui};function gAe(t,e,i,r){return _ui[r].checkIfTileInfoSupportedForViewSR(t,i,e)}function bui(t,e,i){const r=b8t(t);if(ye(r)){if(!fr.isCollection(r))return{tileInfo:r.tileInfo,fullExtent:r.fullExtent};{const n=r.find(s=>gAe(s.tileInfo,s.fullExtent,e,i)==null);if(n)return{tileInfo:n.tileInfo,fullExtent:n.fullExtent}}}return{tileInfo:null,fullExtent:null}}PT.NORTH,PT.EAST,PT.SOUTH,PT.WEST,PT.NORTH_EAST,PT.SOUTH_EAST,PT.SOUTH_WEST,PT.NORTH_WEST;function wui(t,e){return t!=null&&(e==null||(e===_w.Local?!t.isGeographic||t.isWGS84||t.wkid===Hb.CGCS2000:t.isWebMercator||t.isWGS84||t.wkid===Hb.CGCS2000||t.wkid===Hb.GCSMARS2000||t.wkid===Hb.GCSMARS2000_SPHERE||t.wkid===Hb.GCSMOON2000))}async function xui(t,e={}){await Cui(t,e),sn(e)}async function Sui(t,e={}){const{basemap:i,view:r}=t;if(sn(e),"spatialReferenceLocked"in r&&!r.spatialReferenceLocked||(await i.load(e),sn(e),i.baseLayers.length===0))return;const n=i.baseLayers.getItemAt(0);if(!v8t(n))return;if(i.spatialReference){if(r.spatialReference.equals(i.spatialReference))return;hnt()}await n.load(e),sn(e);const s=(("supportedSpatialReferences"in n?n.supportedSpatialReferences:null)||["tileInfo"in n?n.tileInfo?.spatialReference:null]).filter(ye);s.length!==0&&s.every(o=>!r.spatialReference.equals(o))&&hnt()}function hnt(){throw new st("basemap-compatibility:incompatible-spatial-reference","Basemap spatial reference is not compatible with the view")}async function Cui(t,e){const{basemap:i,view:r}=t;if(await i.load(e),i.baseLayers.length===0)return;const n=i.baseLayers.concat(i.referenceLayers).toArray().filter(o=>!FUe(o)).map(o=>new st("basemap-compatibility:unsupported-basemap-layer-type","Unsupported basemap layer type ${operationalLayerType}",{layer:o,operationalLayerType:o.operationalLayerType||"unknown"}));if(n.length)throw n[0];const s=i.baseLayers.getItemAt(0);if(FUe(s)){try{await s.load(e)}catch(o){const a="basemap-compatibility:unknown-error",l="Unknown basemap compatibility error",{name:c=a,message:d=l,details:p}=o;throw new st(c,d,p)}Tui(s,r)}}function Tui(t,e){const i=e.state.viewingMode;if(!i)return;let r,n;if(t?.type==="wmts"){const l=bui(t,e.spatialReference,i);if(lt(l.tileInfo))throw new st("basemapgalleryitem:tiling-scheme-incompatible","Basemap tiling scheme is incompatible with the view");r=l.tileInfo,n=l.fullExtent}else r=t.tileInfo,n=t.fullExtent;if(lt(r))return;if(!wui(r.spatialReference,i))throw new st(`basemapgalleryitem:spatial-reference-unsupported-${Tit(i)}`,`Basemap spatial reference is unsupported in ${Tit(i)} mode`);const s=r.spatialReference.isGeographic,o=t?.type==="vector-tile"?r.getOrCreateCompatible(256,s?1:2):null;if(i===_w.Global){let l=gAe(r,n,null,i);if(l&&t?.type==="vector-tile"&&ye(n)&&o&&!gAe(o,n,null,i)&&(l=null),l){const c=r.spatialReference.isWebMercator?"web-mercator":"wgs84";throw new st(`basemapgalleryitem:tiling-scheme-unsupported-${c}-global`,"Basemap tiling scheme is unsupported in global mode",{error:l})}}else if(dP.checkUnsupported(r))throw new st("basemapgalleryitem:tiling-scheme-unsupported-local","Basemap tiling scheme is unsupported in local mode");const a=e.get("basemapTerrain.tilingScheme");if(a&&!a.compatibleWith(r)&&(t?.type!=="vector-tile"||!o||!a.compatibleWith(o)))throw new st("basemapgalleryitem:tiling-scheme-incompatible","Basemap tiling scheme is incompatible with the view")}let RT=class extends R1(Nd(fn)){constructor(e){super(e),this.compatibilityFunction=null,this.error=null,this.state="loading",this.view=null}initialize(){const e=()=>this.refresh();this.handles.add([Qi(()=>this.basemap?.loadStatus,e),Qi(()=>this.compatibilityFunction,e),Qi(()=>this.view&&"basemapTerrain"in this.view&&this.view.basemapTerrain?.tilingScheme,e),Qi(()=>this.view?.ready,e),Qi(()=>this.view?.spatialReference,e)]),this.refresh()}destroy(){this._cancelRefresh(),this.basemap=null,this.compatibilityFunction=null,this.view=null}get _spatialReferenceTask(){return gQt(this.view,this.basemap)}set basemap(e){const i=this._get("basemap");i&&i.cancelLoad(),e&&e.load().catch(()=>{}),this._set("basemap",e)}get spatialReference(){return this._spatialReferenceTask.spatialReference}refresh(){this._cancelRefresh(),this._set("state","loading");const e=this.basemap?.loadStatus;if(e!=="loaded"&&e!=="failed")return;if(!this.compatibilityFunction)return void(e==="loaded"?(this._set("state","ready"),this._set("error",null)):(this._set("state","error"),this._set("error",this.basemap.loadError)));const i=new AbortController,{signal:r}=i;this.compatibilityFunction(this,{signal:r}).then(()=>F1(()=>!this._spatialReferenceTask.updating,r)).then(()=>{this._set("state","ready"),this._set("error",null)}).catch(n=>{ss(n)||(this._set("state","error"),this._set("error",n))}),this._refreshController=i}_cancelRefresh(){this._refreshController&&(this._refreshController.abort(),this._refreshController=null)}};E([k({readOnly:!0})],RT.prototype,"_spatialReferenceTask",null),E([k()],RT.prototype,"basemap",null),E([k()],RT.prototype,"compatibilityFunction",void 0),E([k({readOnly:!0})],RT.prototype,"error",void 0),E([k({readOnly:!0})],RT.prototype,"spatialReference",null),E([k({readOnly:!0})],RT.prototype,"state",void 0),E([k()],RT.prototype,"view",void 0),RT=E([ht("esri.widgets.BasemapGallery.support.BasemapGalleryItem")],RT);const dnt=RT,pnt=fr.ofType(iR);let gX=class extends fn{constructor(e){super(e),this.basemaps=new pnt}get state(){return"ready"}refresh(){}};E([k({type:pnt})],gX.prototype,"basemaps",void 0),E([k({readOnly:!0})],gX.prototype,"state",null),gX=E([ht("esri.widgets.BasemapGallery.support.LocalBasemapsSource")],gX);const fnt=gX,mnt=fr.ofType(iR);let mP=class extends hd.LoadableMixin(Zx(fnt)){constructor(e){super(e),this._handles=new uf,this.basemaps=new mnt,this.filterFunction=null,this.portal=_c.getDefault(),this.query=null,this.updateBasemapsCallback=null}initialize(){this._handles.add([Qi(()=>[this.filterFunction,this.loadStatus,this.portal?.basemapGalleryGroupQuery,this.portal?.user,this.query,this.updateBasemapsCallback],()=>this.refresh(),Fo)])}destroy(){this._handles.destroy(),this._handles=null,this.filterFunction=null,this.portal=null}get state(){return this.loadStatus==="not-loaded"?"not-loaded":this.loadStatus==="loading"||this._lastPortalBasemapFetchController?"loading":"ready"}load(e){return this.addResolvingPromise(this.portal.load(e)),this.notifyChange("state"),Promise.resolve(this)}async refresh(){if(this.state!=="ready")return;this._lastPortalBasemapFetchController&&(this._lastPortalBasemapFetchController.abort(),this._lastPortalBasemapFetchController=null);const e=this.portal,i=new AbortController;this._lastPortalBasemapFetchController=i,this.notifyChange("state");try{const r=await e.fetchBasemaps(this._toQueryString(this.query),i);this._updateBasemaps(r)}catch(r){if(ss(r))throw r;Ei.getLogger(this.declaredClass).warn(new st("basemap-source:fetch-basemaps-error","Could not fetch basemaps from portal.",{error:r})),this._updateBasemaps()}this._lastPortalBasemapFetchController=null,this.notifyChange("state")}_toQueryString(e){return e&&typeof e!="string"?Object.keys(e).map(i=>`${i}:${e[i]}`).join(" AND "):e}_updateBasemaps(e=[]){let i=this.filterFunction?e.filter(this.filterFunction):e;i=this.updateBasemapsCallback?this.updateBasemapsCallback(i):i,this.basemaps.removeAll(),this.basemaps.addMany(i)}};E([k({readOnly:!0,type:mnt})],mP.prototype,"basemaps",void 0),E([k()],mP.prototype,"filterFunction",void 0),E([k({type:_c})],mP.prototype,"portal",void 0),E([k()],mP.prototype,"query",void 0),E([k({readOnly:!0})],mP.prototype,"state",null),E([k()],mP.prototype,"updateBasemapsCallback",void 0),mP=E([ht("esri.widgets.BasemapGallery.support.PortalBasemapsSource")],mP);const lue=mP,gnt=fr.ofType(dnt);function Eui(t){return t&&t.declaredClass==="esri.portal.Portal"}function Iui(t){return t&&!(t instanceof lue)&&(!!t.portal||!!t.query)}function Aui(t){return t&&"basemaps"in t&&"state"in t&&"refresh"in t}let Tw=class extends Nd(hd){constructor(e){super(e),this._loadingProjectionEngine=!1,this.items=new gnt,this.source=new lue,this.view=null}initialize(){const e=()=>this._recreateItems();this.handles.add([Qi(()=>this.state==="ready"?this.compatibilityFunction:null,()=>this._updateItems()),ku(()=>this.source?.basemaps,"change",e,{onListenerAdd:e})])}get activeBasemap(){return this.view?.map?.basemap??null}set activeBasemap(e){if(!this.view.map)return;const i=typeof e=="string"?iR.fromId(e):e;if(!i||!this.view.ready)return this.view.map.basemap=i,void this._clearOverride("activeBasemap");const r=i.spatialReference||this.items?.find(n=>this.basemapEquals(i,n.basemap))?.spatialReference;if(r&&"spatialReferenceLocked"in this.view&&!this.view.spatialReferenceLocked){const n=this.view.spatialReference;if(ye(r)&&!Ca(n,r)&&!i_(this.view.spatialReference,r)&&!lw())return this._override("activeBasemap",i),this._loadingProjectionEngine=!0,void P2().then(()=>{this._get("activeBasemap")===e&&(this.view.map.basemap=e,this.view.spatialReference=r,this._clearOverride("activeBasemap"))},()=>{}).then(()=>{this._loadingProjectionEngine=!1});this.view.map.basemap=i,this._clearOverride("activeBasemap"),ye(r)&&!Ca(this.view.spatialReference,r)&&(this.view.spatialReference=r)}else this.view.map.basemap=i,this._clearOverride("activeBasemap")}get activeBasemapIndex(){const{state:e,items:i,activeBasemap:r}=this;if(e!=="ready")return-1;const n=i.findIndex(s=>s.basemap===r);return n===-1?i.findIndex(s=>this.basemapEquals(s.basemap,r)):n}get compatibilityFunction(){return this.view?.type==="3d"?xui:Sui}set compatibilityFunction(e){this._overrideIfSome("compatibilityFunction",e)}castSource(e){return Array.isArray(e)||fr.isCollection(e)?new fnt({basemaps:e}):Eui(e)?new lue({portal:e}):Iui(e)?new lue(e):Aui(e)?e:null}get state(){return this.view?.ready&&this.source?this._loadingProjectionEngine?"loading":"ready":"disabled"}basemapEquals(e,i){return mQt(e,i)}refresh(){this._recreateItems()}load(e){return this.addResolvingPromise(hd.isLoadable(this.source)?this.source.load(e):null),Promise.resolve(this)}_recreateItems(){const e=this.source?.basemaps,{view:i,compatibilityFunction:r}=this;this.items.removeAll().forEach(n=>n.destroy()),e&&this.items.addMany(e.map(n=>new dnt({basemap:n,compatibilityFunction:r,view:i})))}_updateItems(){for(const e of this.items)e.compatibilityFunction=this.compatibilityFunction,e.view=this.view}};E([k()],Tw.prototype,"_loadingProjectionEngine",void 0),E([k()],Tw.prototype,"activeBasemap",null),E([k({readOnly:!0})],Tw.prototype,"activeBasemapIndex",null),E([k()],Tw.prototype,"compatibilityFunction",null),E([k({readOnly:!0,type:gnt})],Tw.prototype,"items",void 0),E([k()],Tw.prototype,"source",void 0),E([Zs("source")],Tw.prototype,"castSource",null),E([k({readOnly:!0})],Tw.prototype,"state",null),E([k()],Tw.prototype,"view",void 0),Tw=E([ht("esri.widgets.BasemapGallery.BasemapGalleryViewModel")],Tw);const Pui=Tw,gP="esri-basemap-gallery",eb={base:`${gP} esri-widget esri-widget--panel-height-only`,sourceLoading:`${gP}--source-loading`,loader:`${gP}__loader`,item:`${gP}__item`,itemContainer:`${gP}__item-container`,itemTitle:`${gP}__item-title`,itemThumbnail:`${gP}__item-thumbnail`,selectedItem:`${gP}__item--selected`,itemError:`${gP}__item--error`,emptyMessage:"esri-widget__content--empty",widgetIcon:"esri-icon-basemap",disabled:"esri-disabled",loaderAnimation:"esri-widget__loader-animation"};let Ew=class extends Gf{constructor(e,i){super(e,i),this._handles=new uf,this._focusBasemapItemEnabled=!1,this.disabled=!1,this.headingLevel=2,this.iconClass=eb.widgetIcon,this.messages=null,this.viewModel=new Pui}initialize(){const e=this._handles;this.addHandles([ku(()=>this.viewModel.items,"change",i=>{const r="basemap-gallery-item-changes",{added:n,moved:s}=i;e.remove(r),e.add([...n,...s].map(o=>Qi(()=>o.state,()=>this.scheduleRender())),r),this.scheduleRender()}),Hg(()=>this.source,()=>this.viewModel.load(),{initial:!0,once:!0})])}destroy(){this._handles.destroy()}loadDependencies(){return Promise.resolve().then(()=>cur)}get activeBasemap(){return this.viewModel.activeBasemap}set activeBasemap(e){this.viewModel.activeBasemap=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get source(){return this.viewModel.source}set source(e){this.viewModel.source=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e=this.source.state==="loading",i=this.disabled||this.viewModel.state==="disabled",r=this.viewModel.items.map((a,l)=>this._renderBasemapGalleryItem(a,l)).toArray(),n={[eb.sourceLoading]:e,[eb.disabled]:i},s=e?ki("div",{class:eb.loader,key:"esri-basemap-gallery__loader"}):null,o=e?null:r.length>0?ki("ul",{bind:this,"aria-disabled":this.disabled,"aria-label":this.label,class:eb.itemContainer,key:"esri-basemap-gallery__item-container",onkeydown:this._handleKeyDown,role:"radiogroup"},r):ki("div",{class:eb.emptyMessage,key:"esri-basemap-gallery__empty-message"},ki(vle,{level:this.headingLevel},this.messages.noBasemaps));return ki("div",{class:this.classes(eb.base,n)},s,o)}_getRoundRobinIndex(e,i){return(e+i)%i}_handleKeyDown(e){const{key:i}=e;if(!["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(i))return;e.preventDefault();const{items:r,activeBasemapIndex:n}=this.viewModel,s=i==="ArrowUp"||i==="ArrowLeft"?this._getRoundRobinIndex(Math.max(n-1,-1),r.length):this._getRoundRobinIndex(n+1,r.length),o=r.getItemAt(s);o?.state==="ready"&&(this.viewModel.activeBasemap=o.basemap),this._focusBasemapItemEnabled=!0}_focusBasemapItem(e){this._focusBasemapItemEnabled&&e.tabIndex===0&&(e.focus(),this._focusBasemapItemEnabled=!1)}_handleClick(e){const i=e.currentTarget["data-item"];i.state==="ready"&&(this.viewModel.activeBasemap=i.basemap)}_renderBasemapGalleryItem(e,i){const r=e.basemap.thumbnailUrl||zl("esri/themes/base/images/basemap-toggle-64.svg"),n=e.basemap.title,s=e.basemap.portalItem?.snippet,o=e.error?.message||s||n,{viewModel:{state:a,activeBasemapIndex:l}}=this,c=this.disabled||a==="disabled",d=l===i,p=d||l===-1&&i===0?0:-1,y=a==="loading",v={[eb.selectedItem]:d,[eb.itemError]:e.state==="error"},S=`basemapgallery-item-${e.uid}`;return ki("li",{"aria-checked":d.toString(),"aria-disabled":c.toString(),"aria-labelledby":S,bind:this,class:this.classes(eb.item,v),"data-item":e,onkeydown:this._handleClick,onclick:this._handleClick,role:"radio",tabIndex:p,afterUpdate:this._focusBasemapItem,title:o},ki("img",{alt:"",class:eb.itemThumbnail,src:r}),ki("div",{id:S,class:eb.itemTitle},n),e.state==="loading"||d&&y?ki("calcite-scrim",null,ki("span",{"aria-hidden":"true",role:"presentation",class:eb.loaderAnimation})):null)}};E([k()],Ew.prototype,"activeBasemap",null),E([k()],Ew.prototype,"disabled",void 0),E([k()],Ew.prototype,"headingLevel",void 0),E([k()],Ew.prototype,"iconClass",void 0),E([k()],Ew.prototype,"label",null),E([k(),Vf("esri/widgets/BasemapGallery/t9n/BasemapGallery")],Ew.prototype,"messages",void 0),E([k()],Ew.prototype,"source",null),E([k()],Ew.prototype,"view",null),E([k()],Ew.prototype,"viewModel",void 0),E([Y1()],Ew.prototype,"_handleClick",null),Ew=E([ht("esri.widgets.BasemapGallery")],Ew);const uv="esri-scale-bar",up={base:`${uv} esri-widget`,labelContainer:`${uv}__label-container`,rulerLabelContainer:`${uv}__label-container--ruler`,lineLabelContainer:`${uv}__label-container--line`,topLabelContainer:`${uv}__label-container--top`,bottomLabelContainer:`${uv}__label-container--bottom`,label:`${uv}__label`,line:`${uv}__line`,topLine:`${uv}__line--top`,bottomLine:`${uv}__line--bottom`,ruler:`${uv}__ruler`,rulerBlock:`${uv}__ruler-block`,barContainer:`${uv}__bar-container`,rulerBarContainer:`${uv}__bar-container--ruler`,lineBarContainer:`${uv}__bar-container--line`,disabled:"esri-disabled"};function ynt(t){if(!t)return null;if(ane(t)&&t.wkid){const e=BWt[t.wkid];if(e)return e}if(t.wkt){const e=Oui(t.wkt);if(e)return e}return null}function Oui(t){const e=NWt.exec(t);if(!e||e.length!==2)return null;const i=e[1].split(",");if(!i||i.length<3)return null;const r=parseFloat(i[1]),n=parseFloat(i[2]);return isNaN(r)||isNaN(n)?null:{a:r,f:n===0?0:1/n}}function Rui(t){const e=ynt(t??rr.WGS84);if(Mui(e))return e;const i=e.a*(1-e.f);return Object.assign(e,{b:i,eSq:1-(i/e.a)**2,radius:(2*e.a+i)/3,densificationRatio:1e4/((2*e.a+i)/3)})}function Mui(t){return t!=null&&"b"in t&&"eSq"in t&&"radius"in t}function vnt(t){return ynt(t)!==null}function Dui(t,e="meters"){if(!t)throw new st("geodesic-lengths:invalid-geometries","the input geometries type is not supported");if(t.some(r=>!vnt(r.spatialReference)))throw new st("geodesic-lengths:invalid-spatial-reference","the input geometries spatial reference is not supported");const i=[];for(let r=0;r1e-12&&--ke>0);if(ke===0){const Ae=p,ze=Math.acos(Math.sin(s)*Math.sin(a)+Math.cos(s)*Math.cos(a)*Math.cos(o-n))*Ae,Ge=o-n,Je=Math.sin(Ge)*Math.cos(a),et=Math.cos(s)*Math.sin(a)-Math.sin(s)*Math.cos(a)*Math.cos(Ge),tt=Math.atan2(Je,et);return t.azimuth=tt/E5,t.distance=ze,t.reverseAzimuth=void 0,t}const J=V*(l*l-c*c)/(c*c),he=J/1024*(256+J*(J*(74-47*J)-128)),xe=c*(1+J/16384*(4096+J*(J*(320-175*J)-768)))*(re-he*Y*(X+he/4*(te*(2*X*X-1)-he/6*X*(4*Y*Y-3)*(4*X*X-3)))),Pe=Math.atan2(N*Math.sin(Ne),O*L-I*N*Math.cos(Ne)),Oe=Math.atan2(O*Math.sin(Ne),O*L*Math.cos(Ne)-I*N);return t.azimuth=Pe/E5,t.distance=xe,t.reverseAzimuth=Oe/E5,t}function kui(t){const{wkid:e}=t;if(ri[e]!=null)return ri.values[ri[e]];const{wkt:i}=t,r=i.lastIndexOf(",")+1,n=i.lastIndexOf("]]");return parseFloat(i.substring(r,n))}function _nt(t,e){return t&&t.includes(e)}function bnt(t,e){const{x:i,y:r}=t==="decimal-degrees"?vL(e,!0):e;return[i,r]}function wnt({state:{paddedViewState:t},spatialReference:e,width:i}){return e.isWrappable&&t.worldScreenWidthn?a=n:a<0&&(a=0);const l=Vh(0,a),c=Vh(r,a);return[e.toMap(l),e.toMap(c)]}_getScaleBarProps(e,i,r){const{view:n}=this;let s=e*i/(wnt(n)?n.state.paddedViewState.worldScreenWidth:n.width),o=r==="metric"?"km":"mi";s<.1&&(o==="mi"?(s*=5280,o="ft"):o==="km"&&(s*=1e3,o="m"));let a=0;for(;s>=1;)s/=10,a++;const l=this._getConstraints(s);if(!l)return null;const{min:c,max:d}=l,p=d/s>=s/c?c:d;return{length:e*(p/s),value:10**a*p,unit:o}}_getConstraints(e){return e>.5?{min:.5,max:1}:e>.3?{min:.3,max:.5}:e>.2?{min:.2,max:.3}:e>.15?{min:.15,max:.2}:e>=.1?{min:.15,max:.1}:void 0}};E([k()],xG.prototype,"scaleComputedFrom",void 0),E([k({readOnly:!0})],xG.prototype,"state",null),E([k()],xG.prototype,"view",void 0),xG=E([ht("esri.widgets.Scalebar.ScaleBarViewModel")],xG);const Nui=xG;function uue(t){return 2*t}let MT=class extends Gf{constructor(e,i){super(e,i),this.messages=null,this.unit="non-metric",this.viewModel=new Nui}initialize(){this.addHandles([Qi(()=>{const{view:e}=this;return[e?.stationary,e?.center,e?.scale,e?.zoom]},([e])=>{e&&this.scheduleRender()})])}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}set style(e){const i=this.unit==="dual"?"line":e;this._set("style",i)}castStyle(e){return e==="line"?e:"ruler"}castUnit(e){return e==="metric"||e==="dual"?e:"non-metric"}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e=this.get("viewModel.state")==="disabled",i={[up.disabled]:e};let r,n;if(!e){const{unit:s,style:o}=this,a=s==="metric"||s==="dual",l=50;if(s==="non-metric"||s==="dual"){const c=this.viewModel.getScaleBarProperties(l,"non-metric");c&&(n=o==="ruler"?this._renderRuler(c):this._renderLine(c,"bottom"))}if(a){const c=this.viewModel.getScaleBarProperties(l,"metric");c&&(r=o==="ruler"?this._renderRuler(c):this._renderLine(c,"top"))}}return ki("div",{afterCreate:this._handleRootCreateOrUpdate,afterUpdate:this._handleRootCreateOrUpdate,bind:this,class:this.classes(up.base,i)},r,n)}_renderRuler(e){const i=uue(Math.round(e.length)),{messages:r}=this,n=r[e.unit]||r.unknownUnit,s=`${uue(e.value)} ${n}`;return ki("div",{class:this.classes(up.barContainer,up.rulerBarContainer),key:"esri-scale-bar__ruler"},ki("div",{class:up.ruler,styles:{width:`${i}px`}},ki("div",{class:up.rulerBlock}),ki("div",{class:up.rulerBlock}),ki("div",{class:up.rulerBlock}),ki("div",{class:up.rulerBlock})),ki("div",{class:this.classes(up.labelContainer,up.rulerLabelContainer)},ki("div",{class:up.label},"0"),ki("div",{class:up.label},s)))}_renderLine(e,i){const{messages:r}=this,n=r[e.unit]||r.unknownUnit,s=`${uue(e.value)} ${n}`,o={[up.topLabelContainer]:i==="top",[up.bottomLabelContainer]:i==="bottom"},a=ki("div",{class:this.classes(up.labelContainer,up.lineLabelContainer,o),key:"esri-scale-bar__label"},ki("div",{class:up.label},s)),l={[up.topLine]:i==="top",[up.bottomLine]:i==="bottom"},c=uue(Math.round(e.length)),d=ki("div",{class:this.classes(up.line,l),key:"esri-scale-bar__line",styles:{width:`${c}px`}});return ki("div",{class:this.classes(up.barContainer,up.lineBarContainer),key:"esri-scale-bar__line-container"},[d,a])}_handleRootCreateOrUpdate(e){const i=this.viewModel;if(!i)return;const r=e.getBoundingClientRect(),n=r.left+window.pageXOffset,s=r.top+window.pageYOffset,o=Vh(n,s);(o.x!==i.scaleComputedFrom.x||o.y!==i.scaleComputedFrom.y)&&(i.scaleComputedFrom=o)}};E([k()],MT.prototype,"label",null),E([k(),Vf("esri/widgets/ScaleBar/t9n/ScaleBar")],MT.prototype,"messages",void 0),E([k()],MT.prototype,"style",null),E([Zs("style")],MT.prototype,"castStyle",null),E([k()],MT.prototype,"unit",void 0),E([Zs("unit")],MT.prototype,"castUnit",null),E([k()],MT.prototype,"view",null),E([k()],MT.prototype,"viewModel",void 0),MT=E([ht("esri.widgets.ScaleBar")],MT);class nu{wkid;latestWkid;wkt;constructor(e,i){typeof e=="string"?this.wkt=e:(this.wkid=e,this.latestWkid=i)}isEqual(e){return this.isWebMercator()&&e.isWebMercator()?!0:this.wkid===e.wkid&&this.wkt===e.wkt&&this.latestWkid===e.latestWkid}clone(){const e=new nu("");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 nu(4326)}static fromConfig(e){if(e.wkt)return new nu(e.wkt);if(e.wkid)return new nu(e.wkid,e.latestWkid);throw new Error("Could not parse config spatial reference object")}static parseSR(e){return e?e instanceof nu?e.clone():new nu(e):nu.latLongSR()}static fromESRI(e){if(e.wkt)return new nu(e.wkt);{const i=e.toJSON().latestWkid,r=new nu(e.wkid);return i&&(r.latestWkid=i),r}}toESRI(){return new rr(this.lean())}static fromGeoJSON(e){const i=nu.parseGeoJsonCrs(e);return i.substring(0,5)==="EPSG:"?new nu(parseInt(i.slice(5))):new nu(i)}static parseGeoJsonCrs(e){if(e){if(e.type==="name"){const i=/urn:ogc:def:crs:EPSG::(\d+)/,r=e.properties.name,n=r.match(i);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 Ok{sr;id;constructor(e,i){this.id=e?e.toString():"",this.sr=nu.parseSR(i)}get type(){return Rl.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===Rl.NONE||this.type===Rl.UNKNOWN}geoJsonFactory(e,i){const r={type:e,coordinates:i};return this.sr&&(r.crs=this.sr.toGeoJSON()),r}}class SG extends Ok{constructor(){super("no_geometry")}get type(){return Rl.NONE}}let Qg=class Jie extends Ok{rawArray;constructor(e,i,r,n){super(e,i.sr||r),n?this.rawArray=i.slice():this.rawArray=Jie.parseXY(i)}get type(){return Rl.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 i;if(Array.isArray(e)&&e.length===2)i=e;else{if(e instanceof Jie)return e.toArray();i=[e.x,e.y]}if(isNaN(i[0])||isNaN(i[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(i[0]),parseFloat(i[1])]}static fromESRI(e,i){return new Jie(i,[e.x,e.y],nu.fromESRI(e.spatialReference),!0)}toESRI(){return new Yi({x:this.x,y:this.y,spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,i){return new Jie(i,e.coordinates,nu.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(Cp.POINT,this.toArray())}};class f_ extends Ok{rawArray;constructor(e,i,r,n){super(e,i.sr||r),n?this.rawArray=f_.arrayDeepCopy(i):i instanceof f_?this.rawArray=i.toArray():this.rawArray=f_.parsePointSet(i)}get pointArray(){return this.rawArray.map((e,i)=>new Qg(this.childIdGenerator(i),e,this.sr,!0))}getAt(e){return new Qg(this.childIdGenerator(e),this.rawArray[e],this.sr,!0)}updateAt(e,i){this.rawArray[i]=Qg.parseXY(e)}get length(){return this.rawArray.length}toArray(){return f_.arrayDeepCopy(this.rawArray)}static parsePointSet(e){if(Array.isArray(e)){if(e.length===0)throw new Error("no verticies provided");return e.map(i=>Qg.parseXY(i))}else throw new Error("Bad geometry input encountered")}static arrayDeepCopy(e){return e.map(i=>i.slice())}}class CG extends f_{constructor(e,i,r,n){super(e,i,r,n)}get type(){return Rl.MULTIPOINT}static fromESRI(e,i){return new CG(i,e.points,nu.fromESRI(e.spatialReference),!0)}toESRI(){return new fd({points:this.toArray(),spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,i){return new CG(i,e.coordinates,nu.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(Cp.MULTIPOINT,this.toArray())}}class FM extends f_{constructor(e,i,r,n){if(super(e,i,r,n),this.rawArray.length<2)throw new Error("lines require at least two verticies")}get type(){return Rl.LINESTRING}static fromESRI(e,i){return new FM(i,e.paths[0],nu.fromESRI(e.spatialReference),!0)}toESRI(){return new va({paths:[this.toArray()],spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,i){return new FM(i,e.coordinates,nu.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(Cp.LINESTRING,this.toArray())}}class j2 extends Ok{rawArray;constructor(e,i,r,n){if(super(e,i.sr||r),n)this.rawArray=j2.arrayDeepCopy(i);else if(i instanceof j2)this.rawArray=i.toArray();else if(i instanceof f_)this.rawArray=[i.toArray()];else if(Array.isArray(i)){if(i.length===0)throw new Error("no lines provided");this.rawArray=i.map(s=>f_.parsePointSet(s))}else throw new Error("invalid lines format for MulitLineString")}get lineArray(){return this.rawArray.map((e,i)=>new FM(this.childIdGenerator(i),e,this.sr,!0))}getAt(e){return new FM(this.childIdGenerator(e),this.rawArray[e],this.sr,!0)}updateAt(e,i){this.rawArray[i]=f_.parsePointSet(e)}get length(){return this.rawArray.length}get type(){return Rl.MULTILINESTRING}toArray(){return j2.arrayDeepCopy(this.rawArray)}static arrayDeepCopy(e){return e.map(i=>i.map(r=>r.slice()))}static fromESRI(e,i){return new j2(i,e.paths,nu.fromESRI(e.spatialReference),!0)}toESRI(){return new va({paths:this.toArray(),spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,i){return new j2(i,e.coordinates,nu.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(Cp.MULTILINESTRING,this.toArray())}}class Rk extends f_{constructor(e,i,r,n){if(super(e,i,r,n),Rk.closeRing(this.rawArray),this.length<4)throw new Error("Linear Ring must have at least 3 distinct vertices.")}get type(){return Rl.LINEARRING}updateAt(e,i){const r=this.length-1;i===0?super.updateAt(e,r):i===r&&super.updateAt(e,0),super.updateAt(e,i)}static closeRing(e){const i=e[0],r=e[e.length-1];(i[0]!==r[0]||i[1]!==r[1])&&e.push(i.slice())}static fromESRI(e,i){return new Rk(i,e.rings[0],nu.fromESRI(e.spatialReference),!0)}toESRI(){return new po({rings:[this.toArray()],spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,i){return new Rk(i,e.coordinates,nu.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(Cp.POLYGON,[this.toArray()])}}class ey extends Ok{rawArray;constructor(e,i,r,n){super(e,i.sr||r),n?this.rawArray=ey.arrayDeepCopy(i):this.rawArray=ey.parsePolygon(i)}addLinearRings(e){e.forEach(i=>this.rawArray.push(i.toArray()))}get ringArray(){return this.rawArray.map((e,i)=>new Rk(this.childIdGenerator(i),e,this.sr,!0))}get type(){return Rl.POLYGON}toArray(){return ey.arrayDeepCopy(this.rawArray)}static parsePolygon(e){let i=[];if(e instanceof ey)return e.toArray();if(e instanceof j2)i=e.toArray();else if(e instanceof f_)i=[e.toArray()];else if(Array.isArray(e)){if(e.length===0)throw new Error("no rings provided");i=e.map(r=>f_.parsePointSet(r))}else throw new Error("invalid input format for parsePolygon");return i.forEach(r=>Rk.closeRing(r)),i}static arrayDeepCopy(e){return e.map(i=>i.map(r=>r.slice()))}static fromESRI(e,i){return new ey(i,e.rings,nu.fromESRI(e.spatialReference),!0)}toESRI(){return new po({rings:this.toArray(),spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,i){return new ey(i,e.coordinates,nu.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(Cp.POLYGON,this.toArray())}}class yP extends Ok{rawArray;constructor(e,i,r,n){super(e,i.sr||r),n?this.rawArray=yP.arrayDeepCopy(i):this.rawArray=yP.parseMultiPolygon(i)}addPolygon(e){this.rawArray.push(e.toArray())}get polygonArray(){return this.rawArray.map((e,i)=>new ey(this.childIdGenerator(i),e,this.sr,!0))}get type(){return Rl.MULTIPOLYGON}toArray(){return yP.arrayDeepCopy(this.rawArray)}static parseMultiPolygon(e){if(e instanceof yP)return e.toArray();if(e instanceof ey)return[e.toArray()];if(e instanceof j2||e instanceof f_)return[ey.parsePolygon(e)];if(Array.isArray(e)){if(e.length===0)throw new Error("no polygons provided");return e.map(i=>ey.parsePolygon(i))}else throw new Error("invalid input format for parseMultiPolygon")}static arrayDeepCopy(e){return e.map(i=>i.map(r=>r.map(n=>n.slice())))}static fromESRI(e,i){return new yP(i,[e.rings],nu.fromESRI(e.spatialReference),!0)}toESRI(){const e=[];return this.toArray().forEach(i=>{i.forEach(r=>e.push(r))}),new po({rings:e,spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,i){return new yP(i,e.coordinates,nu.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(Cp.MULTIPOLYGON,this.toArray())}}class Lp extends Ok{rawMin;rawMax;constructor(e,i,r,n){super(e,i.sr||n),this.rawMin=Qg.parseXY(i),this.rawMax=Qg.parseXY(r)}get type(){return Rl.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 Qg(this.id+"_centerPoint",[(this.xmax-this.xmin)/2+this.xmin,(this.ymax-this.ymin)/2+this.ymin],this.sr,!0)}expand(e){return Lp.fromESRI(this.toESRI().expand(e),`${this.id}-expanded`)}clone(){return new Lp(this.id,this.rawMin,this.rawMax,this.sr)}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 ey(this.id,this.toPolygonArray(),this.sr,!0)}static fromParams(e,i,r,n,s,o){return new Lp(e,[i,r],[n,s],o)}static fromConfig(e,i){return new Lp(e,[i.xmin,i.ymin],[i.xmax,i.ymax],nu.fromConfig(i.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,i){return Lp.fromParams(i,e.xmin,e.ymin,e.xmax,e.ymax,nu.fromESRI(e.spatialReference))}toESRI(){return new vr({xmin:this.xmin,ymin:this.ymin,xmax:this.xmax,ymax:this.ymax,spatialReference:this.sr.toESRI()})}static fromArcServer(e,i){return Lp.fromESRI(vr.fromJSON(e),i)}static fromGeoJSON(e,i){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)),i===3&&this.c.push(1)}else if(typeof e=="string"){const i=e.substring(0,1)==="#"?e.substring(1):e;this.c=[0,2,4,6].map(r=>{const n=i.substring(r,r+2);return LM.hexToInt(n)})}else this.c=[e.r,e.g,e.b,e.a??1];this.c.forEach((i,r)=>{i<0&&(console.error("Negative value passed to colour"),this.c[r]=0),i>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(i=>LM.intToHex(i)).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 $r(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 i=e.toString(16);return i.length===1?`0${i}`:i}}class vP{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 i;const r=e.length;if(r===0)return;const n=e.substring(r-2);return n==="px"?i=parseFloat(e.substring(0,r-2))*1.333333:n==="pt"?i=parseFloat(e.substring(0,r-2)):i=parseFloat(e),i}else return e}}class _P extends vP{_height;_xOffset;_yOffset;_icon;_width;_size;_colour;_style;_outline;_path;_angle;constructor(e){if(e=e||{style:vC.CIRCLE},super(),this._style=e.style||vC.CIRCLE,e.style===vC.ICON){const i=e;this._icon=i.icon||"",this._height=vP.convToPoints(i.height)||16.5,this._width=vP.convToPoints(i.width)||16.5,this._size=0,this._colour=new LM,this._outline=new DT,this._path=""}else{const i=e;this._size=vP.convToPoints(i.size)||12,this._colour=new LM(i.colour??"#ffffff40"),this._outline=new DT(i.outline),this._path=this._style===vC.PATH&&i.path||"",this._height=0,this._width=0,this._icon=""}this._xOffset=vP.convToPoints(e.xOffset)||0,this._yOffset=vP.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===vC.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===vC.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===vC.ICON?_P.isImageUrl(this.icon)?(e=new pA,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 gd,e.color=new $r(this.colour.rgba),e.size=this.width,e.xoffset=this.xOffset,e.yoffset=this.yOffset,e.angle=this.angle):(e=new gd,e.color=new $r(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 i={xOffset:e.xoffset,yOffset:e.yoffset,angle:e.angle};if(e.type==="simple-marker"){const r=i;r.style=e.style,r.colour=e.color.toRgba(),r.size=e.size,r.path=e.path,r.outline=DT.fromESRI(e.outline).toOptions()}else{const r=i;r.style=vC.ICON,r.width=e.width,r.height=e.height,r.icon=e.url}return new _P(i)}static fromArcServer(e){return _P.fromESRI(JW(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 DT extends vP{_style;_width;_miter;_cap;_join;_colour;constructor(e){e=e||{},super(),this._style=e.style||Gv.SOLID;const i=vP.convToPoints(e.width);this._width=typeof i>"u"||i<0?.75:i,this._colour=new LM(e.colour),this._miter=e.miter??2,this._cap=e.cap||XBe.ROUND,this._join=e.join||YBe.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 Tm;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 i={width:e.width,colour:e.color.toRgba(),style:e.style};return new DT(i)}static fromArcServer(e){return DT.fromESRI(JW(e))}}class TG extends vP{_outlineStyle;_fillColour;_fillStyle;constructor(e){super(),e=e||{},e.fill||(e.fill={}),this._fillColour=new LM(e.fill.colour),this._fillStyle=e.fill.style||KBe.SOLID,this._outlineStyle=new DT(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(),i=new $r(this.fillColour.rgba),r=new iw;return r.style=this.fillStyleType,r.color=i,r.outline=e,r}static fromESRI(e){const i={fill:{colour:e.color.toRgba(),style:e.style},outline:DT.fromESRI(e.outline).toOptions()};return new TG(i)}static fromArcServer(e){return TG.fromESRI(JW(e))}}class $ui{Extent=Lp;Graphic=Wx;LineString=FM;LineStyle=DT;LinearRing=Rk;MultiLineString=j2;MultiPoint=CG;MultiPolygon=yP;Point=Qg;PointStyle=_P;Polygon=ey;PolygonStyle=TG;SpatialReference=nu;esriMapClickToRamp(e,i){return{mapPoint:Qg.fromESRI(e.mapPoint,i),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,i){switch(e.type){case"point":return Qg.fromESRI(e,i);case"polyline":{const r=e;return r.paths.length===1?FM.fromESRI(r,i):j2.fromESRI(r,i)}case"polygon":return ey.fromESRI(e,i);case"extent":return Lp.fromESRI(e,i);case"multipoint":return CG.fromESRI(e,i);default:throw new Error(`Encountered unhandled geometry type ${e.type}`)}}geomGeoJsonToRamp(e,i){switch(e.type){case Cp.POINT:return Qg.fromGeoJSON(e,i);case Cp.LINESTRING:return FM.fromGeoJSON(e,i);case Cp.POLYGON:return ey.fromGeoJSON(e,i);case Cp.MULTIPOINT:return CG.fromGeoJSON(e,i);case Cp.MULTILINESTRING:return j2.fromGeoJSON(e,i);case Cp.MULTIPOLYGON:return yP.fromGeoJSON(e,i);default:throw new Error(`Encountered unhandled geometry type ${e.type}`)}}geomRampToGeoJson(e){return e.toGeoJSON()}graphicRampToGeoJson(e){const i={},r={type:"Feature",geometry:this.geomRampToGeoJson(e.geometry),properties:i};return Object.keys(e.attributes).forEach(n=>r.properties[n]=e.attributes[n]),r}graphicGeoJsonToRamp(e,i){if(e.type!=="Feature")throw new Error("Expected input parameter of graphicGeoJsonToRamp to be a GeoJson feature");const r=this.geomGeoJsonToRamp(e.geometry,i),n={};return Object.keys(e.properties.forEach(o=>n[o]=e.properties[o])),new Wx(r,"",n)}graphicRampToEsri(e){const i={attributes:{},id:e.id};return i.geometry=this.geomRampToEsri(e.geometry),Object.keys(e.attributes).forEach(r=>i.attributes[r]=e.attributes[r]),e.style&&(i.symbol=this.styleRampToEsri(e.style)),new js(i)}styleRampToEsri(e){return e.toESRI()}styleEsriToRamp(e){switch(e.type){case"picture-marker":case"simple-marker":return _P.fromESRI(e);case"simple-line":return DT.fromESRI(e);case"simple-fill":return TG.fromESRI(e);default:return console.error(`Unsupported ESRI symbol type encountered: ${e.type}`),new _P}}serverGeomTypeToRampGeomType(e){if(!e)return Rl.NONE;switch(e){case"esriGeometryPolygon":return Rl.POLYGON;case"esriGeometryPolyline":return Rl.LINESTRING;case"esriGeometryPoint":return Rl.POINT;case"esriGeometryMultipoint":return Rl.MULTIPOINT;case"esriGeometryEnvelope":return Rl.EXTENT;default:return console.error(`Unrecognized server geometry type encountered: ${e}`),Rl.UNKNOWN}}clientGeomTypeToRampGeomType(e){if(!e)return Rl.NONE;switch(e){case"polygon":return Rl.POLYGON;case"polyline":return Rl.LINESTRING;case"point":return Rl.POINT;case"multipoint":return Rl.MULTIPOINT;default:return console.error(`Unrecognized client geometry type encountered: ${e}`),Rl.UNKNOWN}}geoJsonGeomTypeToEsriGeomType(e){switch(e){case Cp.POINT:return"point";case Cp.LINESTRING:case Cp.MULTILINESTRING:return"polyline";case Cp.POLYGON:case Cp.MULTIPOLYGON:return"polygon";case Cp.MULTIPOINT:return"multipoint";default:throw new Error(`Encountered unhandled geometry type ${e}`)}}isImageUrl(e){return _P.isImageUrl(e)}}class yX{layerIdx;name;children;uid;isRoot;constructor(e,i,r="",n=!0){this.layerIdx=e,this.name=r,this.isRoot=n,this.children=[],this.uid=i}findChildByUid(e){if(this.uid===e)return this;{let i;return this.children.some(r=>i=r.findChildByUid(e)),i}}findChildByIdx(e){if(this.layerIdx===e)return this;{let i;return this.children.some(r=>i=r.findChildByIdx(e)),i}}get isLogicalLayer(){return this.layerIdx>-1&&this.children.length===0}get isLayerRoot(){return this.isRoot}}class xnt{minScale;maxScale;constructor(e=0,i=0){this.minScale=e,this.maxScale=i}isOffScale(e){const i={offScale:!1,zoomIn:!1};return ethis.minScale&&this.minScale!==0&&(i.offScale=!0,i.zoomIn=!0),i}}let Bui=class{sql;cache;extent;constructor(e="",i=""){this.sql={[$g.PERMANENT]:e,[$g.INITIAL]:i},this.extent=void 0,this.cache={}}sqlActiveFilters(e=[]){const i=this.sql,r=Object.keys(i).filter(n=>i[n]);return e.length===0?r:r.filter(n=>e.indexOf(n)===-1)}isActive(){return this.sqlActiveFilters([$g.PERMANENT]).length>0}getCombinedSql(e=[]){const i=this.sqlActiveFilters(e),r=i.length;return r===0?"":r===1?this.sql[i[0]]:i.map(n=>`(${this.sql[n]})`).join(" AND ")}setSql(e,i){e===$g.PERMANENT?console.error("Attempted to overwrite a permanent filter. Not allowed."):(this.sql[e]=i,this.clearCacheSet(e))}getSql(e){return this.sql[e]||""}setExtent(e){e.isEqual(this.extent)||(this.extent=e,this.clearCacheSet($g.EXTENT))}getCacheKey(e,i){return`_cache$${e.sort().join("$")}${i?"$"+$g.EXTENT:""}$`}getCache(e,i){const r=this.getCacheKey(e,i);return this.cache[r]}setCache(e,i,r){const n=this.getCacheKey(i,r);this.cache[n]=e}cacheActiveKeys(){const e=this.cache;return Object.keys(e).filter(i=>e[i])}clearAllCaches(){this.cache={}}clearCacheSet(e){this.cacheActiveKeys().forEach(i=>{i.indexOf(`$${e}$`)>-1&&delete this.cache[i]})}clearAll(){this.sql={[$g.PERMANENT]:this.sql[$g.PERMANENT]},this.extent=void 0,this.clearAllCaches()}};class vX{id;sr;_defaultExtent;_fullExtent;_maximumExtent;constructor(e,i,r=void 0,n=void 0){this.id=e,this.sr=i.sr.clone(),this._defaultExtent=i.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 vX(e.id,Lp.fromConfig(`${e.id}-extent-default`,e.default),e.full!==void 0?Lp.fromConfig(`${e.id}-extent-full`,e.full):void 0,e.maximum!==void 0?Lp.fromConfig(`${e.id}-extent-maximum`,e.maximum):void 0)}clone(){return new vX(this.id,this._defaultExtent,this._fullExtent,this._maximumExtent)}}class Fm{realPromise;resolveMe(){}rejectMe(){}getPromise(){return this.realPromise}constructor(){this.realPromise=new Promise((e,i)=>{this.resolveMe=e,this.rejectMe=i})}}var kp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Snt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function cue(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var i=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)};i.prototype=e.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(i,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}),i}var Gui=function(e){return Vui(e)&&!Uui(e)};function Vui(t){return!!t&&typeof t=="object"}function Uui(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||Hui(t)}var jui=typeof Symbol=="function"&&Symbol.for,zui=jui?Symbol.for("react.element"):60103;function Hui(t){return t.$$typeof===zui}function Wui(t){return Array.isArray(t)?[]:{}}function _X(t,e){return e.clone!==!1&&e.isMergeableObject(t)?EG(Wui(t),t,e):t}function qui(t,e,i){return t.concat(e).map(function(r){return _X(r,i)})}function Yui(t,e){if(!e.customMerge)return EG;var i=e.customMerge(t);return typeof i=="function"?i:EG}function Xui(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function Cnt(t){return Object.keys(t).concat(Xui(t))}function Tnt(t,e){try{return e in t}catch{return!1}}function Kui(t,e){return Tnt(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function Jui(t,e,i){var r={};return i.isMergeableObject(t)&&Cnt(t).forEach(function(n){r[n]=_X(t[n],i)}),Cnt(e).forEach(function(n){Kui(t,n)||(Tnt(t,n)&&i.isMergeableObject(e[n])?r[n]=Yui(n,i)(t[n],e[n],i):r[n]=_X(e[n],i))}),r}function EG(t,e,i){i=i||{},i.arrayMerge=i.arrayMerge||qui,i.isMergeableObject=i.isMergeableObject||Gui,i.cloneUnlessOtherwiseSpecified=_X;var r=Array.isArray(e),n=Array.isArray(t),s=r===n;return s?r?i.arrayMerge(t,e,i):Jui(t,e,i):_X(e,i)}EG.all=function(e,i){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,n){return EG(r,n,i)},{})};var Zui=EG,IG=Zui;class Qui{generateUUID(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(i==="x"?r:r&3|8).toString(16)})}convertImageToCanvas(e,i,r=!0){const n=i??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",c=>l(c))});return s.src=e,o}async convertImagetoDataURL(e,i="image/png"){return e.startsWith("data")?e:this.convertImageToCanvas(e).then(r=>r.toDataURL(i)).catch(r=>(console.error("Failed to load crossorigin image",e,r),e))}parseUrlIndex(e){const i={rootUrl:e,index:0},r=/\/(\d+)\/?$/,n=e.match(r);if(n){const s=n[1];i.index=isNaN(parseInt(s))?void 0:parseInt(s),i.rootUrl=e.substr(0,e.length-n[0].length)}else console.warn("Cannot extract layer index from url "+e);return i}}class bX{_url;_base;_query;_queryMap={};constructor(e){this._url=e,[this._base,this._query]=e.split("?").concat(""),this._queryMap=this._query.split("&").reduce((i,r)=>{const[n,s]=r.split("=");return i[n]=s,i},{})}get query(){return this._query}get base(){return this._base}get queryMap(){return this._queryMap}updateQuery(e){const i=IG.all([{},this.queryMap,e]);return`${this.base}${Object.entries(i).filter(([n,s])=>s!==void 0).map(([n,s],o)=>`${o===0?"?":""}${n}=${s}`).join("&")}`}}var hue={},eci={get exports(){return hue},set exports(t){hue=t}},Ent;function Int(){return Ent||(Ent=1,function(t,e){(function(i,r){t.exports=r(),typeof window=="object"&&(i.Terraformer=r())})(kp,function(){var i={},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(le){return Object.prototype.toString.call(le)==="[object Array]"}function c(){var le=Array.prototype.slice.apply(arguments);typeof console!==void 0&&console.warn&&console.warn.apply(console,le)}function d(le,it){for(var pt in it)it.hasOwnProperty(pt)&&(le[pt]=it[pt]);return le}function p(le){if(le.type)switch(le.type){case"Point":return[le.coordinates[0],le.coordinates[1],le.coordinates[0],le.coordinates[1]];case"MultiPoint":return S(le.coordinates);case"LineString":return S(le.coordinates);case"MultiLineString":return y(le.coordinates);case"Polygon":return y(le.coordinates);case"MultiPolygon":return v(le.coordinates);case"Feature":return le.geometry?p(le.geometry):null;case"FeatureCollection":return I(le);case"GeometryCollection":return O(le);default:throw new Error("Unknown type: "+le.type)}return null}function y(le){for(var it=null,pt=null,Le=null,ce=null,Ce=0;Cept)&&(pt=At),(Le===null||iice)&&(ce=ii)}return[it,Le,pt,ce]}function v(le){for(var it=null,pt=null,Le=null,ce=null,Ce=0;Cept)&&(pt=gt),(Le===null||Uece)&&(ce=Ue)}return[it,Le,pt,ce]}function S(le){for(var it=null,pt=null,Le=null,ce=null,Ce=0;Cept)&&(pt=yt),(Le===null||Vece)&&(ce=Ve)}return[it,Le,pt,ce]}function I(le){for(var it=[],pt,Le=le.features.length-1;Le>=0;Le--)pt=p(le.features[Le].geometry),it.push([pt[0],pt[1]]),it.push([pt[2],pt[3]]);return S(it)}function O(le){for(var it=[],pt,Le=le.geometries.length-1;Le>=0;Le--)pt=p(le.geometries[Le]),it.push([pt[0],pt[1]]),it.push([pt[2],pt[3]]);return S(it)}function L(le){var it=p(le);return{x:it[0],y:it[1],w:Math.abs(it[0]-it[2]),h:Math.abs(it[1]-it[3])}}function N(le){return le*n}function G(le){return le*s}function V(le,it){for(var pt=0;ptit?1:0}function _e(le,it){return le[0]>it[0]?-1:le[0]it[1]?-1:le[1]ke(it,pt))&&(pt=le[Le])}return pt}function J(le){if(le.length===0)return[];if(le.length===1)return le;for(var it=[le.sort(_e)[0]],pt=0;pt0||!it&&yt<0)return!1}return!0}function xe(le,it){for(var pt=!1,Le=-1,ce=le.length,Ce=ce-1;++Le=3)le=this.coordinates;else return null;else if(this.type==="Polygon"||this.type==="MultiLineString")if(this.coordinates&&this.coordinates.length>0){for(it=0;it0){for(it=0;it=2)this.coordinates=it;else throw"Terraformer: invalid input for Terraformer.Point";this.type="Point"}Pt.prototype=new ft,Pt.prototype.constructor=Pt;function $t(le){if(le&&le.type==="MultiPoint"&&le.coordinates)d(this,le);else if(l(le))this.coordinates=le;else throw"Terraformer: invalid input for Terraformer.MultiPoint";this.type="MultiPoint"}$t.prototype=new ft,$t.prototype.constructor=$t,$t.prototype.forEach=function(le){for(var it=0;it1},Lt.prototype.holes=function(){var le=[];if(this.hasHoles())for(var it=1;it=this.text.length)return;t=this.text[this.place++]}switch(this.state){case SX:return this.neutral(t);case Rnt:return this.keyword(t);case due:return this.quoted(t);case Dnt:return this.afterquote(t);case Mnt:return this.number(t);case _Ae:return}},bP.prototype.afterquote=function(t){if(t==='"'){this.word+='"',this.state=due;return}if(pue.test(t)){this.word=this.word.trim(),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in afterquote yet, index '+this.place)},bP.prototype.afterItem=function(t){if(t===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=SX;return}if(t==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=SX,this.currentObject=this.stack.pop(),this.currentObject||(this.state=_Ae);return}},bP.prototype.number=function(t){if(Fnt.test(t)){this.word+=t;return}if(pue.test(t)){this.word=parseFloat(this.word),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in number yet, index '+this.place)},bP.prototype.quoted=function(t){if(t==='"'){this.state=Dnt;return}this.word+=t},bP.prototype.keyword=function(t){if(hci.test(t)){this.word+=t;return}if(t==="["){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=SX;return}if(pue.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in keyword yet, index '+this.place)},bP.prototype.neutral=function(t){if(cci.test(t)){this.word=t,this.state=Rnt;return}if(t==='"'){this.word="",this.state=due;return}if(Fnt.test(t)){this.word=t,this.state=Mnt;return}if(pue.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in neutral yet, index '+this.place)},bP.prototype.output=function(){for(;this.place0?90:-90),t.lat_ts=t.lat1)}function knt(t){var e=dci(t),i=e.shift(),r=e.shift();e.unshift(["name",r]),e.unshift(["type",i]);var n={};return PG(e,n),mci(n),n}function cv(t){var e=this;if(arguments.length===2){var i=arguments[1];typeof i=="string"?i.charAt(0)==="+"?cv[t]=vAe(arguments[1]):cv[t]=knt(arguments[1]):cv[t]=i}else if(arguments.length===1){if(Array.isArray(t))return t.map(function(r){Array.isArray(r)?cv.apply(e,r):cv(r)});if(typeof t=="string"){if(t in cv)return cv[t]}else"EPSG"in t?cv["EPSG:"+t.EPSG]=t:"ESRI"in t?cv["ESRI:"+t.ESRI]=t:"IAU2000"in t?cv["IAU2000:"+t.IAU2000]=t:console.log(t);return}}ici(cv);function gci(t){return typeof t=="string"}function yci(t){return t in cv}var vci=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function _ci(t){return vci.some(function(e){return t.indexOf(e)>-1})}var bci=["3857","900913","3785","102113"];function wci(t){var e=kM(t,"authority");if(e){var i=kM(e,"epsg");return i&&bci.indexOf(i)>-1}}function xci(t){var e=kM(t,"extension");if(e)return kM(e,"proj4")}function Sci(t){return t[0]==="+"}function Cci(t){if(gci(t)){if(yci(t))return cv[t];if(_ci(t)){var e=knt(t);if(wci(e))return cv["EPSG:3857"];var i=xci(e);return i?vAe(i):e}if(Sci(t))return vAe(t)}else return t}function Nnt(t,e){t=t||{};var i,r;if(!e)return t;for(r in e)i=e[r],i!==void 0&&(t[r]=i);return t}function LT(t,e,i){var r=t*e;return i/Math.sqrt(1-r*r)}function CX(t){return t<0?-1:1}function ys(t){return Math.abs(t)<=pf?t:t-CX(t)*xX}function z2(t,e,i){var r=t*i,n=.5*t;return r=Math.pow((1-r)/(1+r),n),Math.tan(.5*(gn-e))/r}function TX(t,e){for(var i=.5*t,r,n,s=gn-2*Math.atan(e),o=0;o<=15;o++)if(r=t*Math.sin(s),n=gn-2*Math.atan(e*Math.pow((1-r)/(1+r),i))-s,s+=n,Math.abs(n)<=1e-10)return s;return-9999}function Tci(){var t=this.b/this.a;this.es=1-t*t,"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=LT(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Eci(t){var e=t.x,i=t.y;if(i*FT>90&&i*FT<-90&&e*FT>180&&e*FT<-180)return null;var r,n;if(Math.abs(Math.abs(i)-gn)<=ns)return null;if(this.sphere)r=this.x0+this.a*this.k0*ys(e-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(Rc+.5*i));else{var s=Math.sin(i),o=z2(this.e,i,s);r=this.x0+this.a*this.k0*ys(e-this.long0),n=this.y0-this.a*this.k0*Math.log(o)}return t.x=r,t.y=n,t}function Ici(t){var e=t.x-this.x0,i=t.y-this.y0,r,n;if(this.sphere)n=gn-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var s=Math.exp(-i/(this.a*this.k0));if(n=TX(this.e,s),n===-9999)return null}return r=ys(this.long0+e/(this.a*this.k0)),t.x=r,t.y=n,t}var Aci=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const Pci={init:Tci,forward:Eci,inverse:Ici,names:Aci};function Oci(){}function $nt(t){return t}var Rci=["longlat","identity"],Mci=[Pci,{init:Oci,forward:$nt,inverse:$nt,names:Rci}],fue={},mue=[];function Bnt(t,e){var i=mue.length;return t.names?(mue[i]=t,t.names.forEach(function(r){fue[r.toLowerCase()]=i}),this):(console.log(e),!0)}function Dci(t){if(!t)return!1;var e=t.toLowerCase();if(typeof fue[e]<"u"&&mue[fue[e]])return mue[fue[e]]}function Fci(){Mci.forEach(Bnt)}const Lci={start:Fci,add:Bnt,get:Dci};var Ua={};Ua.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},Ua.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},Ua.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},Ua.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},Ua.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},Ua.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},Ua.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},Ua.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},Ua.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},Ua.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},Ua.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},Ua.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},Ua.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},Ua.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},Ua.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},Ua.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},Ua.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},Ua.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},Ua.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},Ua.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},Ua.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},Ua.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},Ua.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},Ua.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},Ua.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},Ua.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},Ua.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},Ua.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},Ua.hough={a:6378270,rf:297,ellipseName:"Hough"},Ua.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},Ua.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},Ua.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},Ua.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},Ua.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},Ua.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},Ua.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},Ua.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},Ua.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},Ua.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},Ua.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},Ua.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var kci=Ua.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Ua.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function Nci(t,e,i,r){var n=t*t,s=e*e,o=(n-s)/n,a=0;r?(t*=1-o*(sci+o*(oci+o*aci)),n=t*t,o=0):a=Math.sqrt(o);var l=(n-s)/s;return{es:o,e:a,ep2:l}}function $ci(t,e,i,r,n){if(!t){var s=kM(Ua,r);s||(s=kci),t=s.a,e=s.b,i=s.rf}return i&&!e&&(e=(1-1/i)*t),(i===0||Math.abs(t-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=Dk,a.datum_params[3]*=wX,a.datum_params[4]*=wX,a.datum_params[5]*=wX,a.datum_params[6]=a.datum_params[6]/1e6+1)),o&&(a.datum_type=AG,a.grids=o),a.a=i,a.b=r,a.es=n,a.ep2=s,a}var Gnt={};function Gci(t,e){var i=new DataView(e),r=jci(i),n=zci(i,r);n.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var s=Hci(i,n,r),o={header:n,subgrids:s};return Gnt[t]=o,o}function Vci(t){if(t===void 0)return null;var e=t.split(",");return e.map(Uci)}function Uci(t){if(t.length===0)return null;var e=t[0]==="@";return e&&(t=t.slice(1)),t==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:Gnt[t]||null,isNull:!1}}function OG(t){return t/3600*Math.PI/180}function jci(t){var e=t.getInt32(8,!1);return e===11?!1:(e=t.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function zci(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:bAe(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}function bAe(t,e,i){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,i)))}function Hci(t,e,i){for(var r=176,n=[],s=0;s5e-11?!1:t.datum_type===Mk?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type===Dk?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]:!0}function Vnt(t,e,i){var r=t.x,n=t.y,s=t.z?t.z:0,o,a,l,c;if(n<-gn&&n>-1.001*gn)n=-gn;else if(n>gn&&n<1.001*gn)n=gn;else{if(n<-gn)return{x:-1/0,y:-1/0,z:t.z};if(n>gn)return{x:1/0,y:1/0,z:t.z}}return r>Math.PI&&(r-=2*Math.PI),a=Math.sin(n),c=Math.cos(n),l=a*a,o=i/Math.sqrt(1-e*l),{x:(o+s)*c*Math.cos(r),y:(o+s)*c*Math.sin(r),z:(o*(1-e)+s)*a}}function Unt(t,e,i,r){var n=1e-12,s=n*n,o=30,a,l,c,d,p,y,v,S,I,O,L,N,G,V=t.x,Y=t.y,X=t.z?t.z:0,te,re,fe;if(a=Math.sqrt(V*V+Y*Y),l=Math.sqrt(V*V+Y*Y+X*X),a/is&&Gr.y||d>r.x||va&&Math.abs(l.y)>a);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=ys(s.x+i.ll[0]),r.y=s.y+i.ll[1]}else isNaN(s.x)||(r.x=t.x+s.x,r.y=t.y+s.y);return r}function znt(t,e){var i={x:t.x/e.del[0],y:t.y/e.del[1]},r={x:Math.floor(i.x),y:Math.floor(i.y)},n={x:i.x-1*r.x,y:i.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 c={x:e.cvs[o][0],y:e.cvs[o][1]};o--;var d={x:e.cvs[o][0],y:e.cvs[o][1]},p=n.x*n.y,y=n.x*(1-n.y),v=(1-n.x)*(1-n.y),S=(1-n.x)*n.y;return s.x=v*a.x+y*l.x+S*d.x+p*c.x,s.y=v*a.y+y*l.y+S*d.y+p*c.y,s}function Hnt(t,e,i){var r=i.x,n=i.y,s=i.z||0,o,a,l,c={};for(l=0;l<3;l++)if(!(e&&l===2&&i.z===void 0))switch(l===0?(o=r,"ew".indexOf(t.axis[l])!==-1?a="x":a="y"):l===1?(o=n,"ns".indexOf(t.axis[l])!==-1?a="y":a="x"):(o=s,a="z"),t.axis[l]){case"e":c[a]=o;break;case"w":c[a]=-o;break;case"n":c[a]=o;break;case"s":c[a]=-o;break;case"u":i[a]!==void 0&&(c.z=o);break;case"d":i[a]!==void 0&&(c.z=-o);break;default:return null}return c}function Wnt(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function ehi(t){qnt(t.x),qnt(t.y)}function qnt(t){if(typeof Number.isFinite=="function"){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if(typeof t!="number"||t!==t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function thi(t,e){return(t.datum.datum_type===Mk||t.datum.datum_type===Dk||t.datum.datum_type===AG)&&e.datumCode!=="WGS84"||(e.datum.datum_type===Mk||e.datum.datum_type===Dk||e.datum.datum_type===AG)&&t.datumCode!=="WGS84"}function yue(t,e,i,r){var n;Array.isArray(i)?i=Wnt(i):i={x:i.x,y:i.y,z:i.z,m:i.m};var s=i.z!==void 0;if(ehi(i),t.datum&&e.datum&&thi(t,e)&&(n=new kT("WGS84"),i=yue(t,n,i,r),t=n),r&&t.axis!=="enu"&&(i=Hnt(t,!1,i)),t.projName==="longlat")i={x:i.x*ty,y:i.y*ty,z:i.z||0};else if(t.to_meter&&(i={x:i.x*t.to_meter,y:i.y*t.to_meter,z:i.z||0}),i=t.inverse(i),!i)return;if(t.from_greenwich&&(i.x+=t.from_greenwich),i=Zci(t.datum,e.datum,i),!!i)return e.from_greenwich&&(i={x:i.x-e.from_greenwich,y:i.y,z:i.z||0}),e.projName==="longlat"?i={x:i.x*FT,y:i.y*FT,z:i.z||0}:(i=e.forward(i),e.to_meter&&(i={x:i.x/e.to_meter,y:i.y/e.to_meter,z:i.z||0})),r&&e.axis!=="enu"?Hnt(e,!0,i):(s||delete i.z,i)}var Ynt=kT("WGS84");function wAe(t,e,i,r){var n,s,o;return Array.isArray(i)?(n=yue(t,e,i,r)||{x:NaN,y:NaN},i.length>2?typeof t.name<"u"&&t.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"?typeof n.z=="number"?[n.x,n.y,n.z].concat(i.splice(3)):[n.x,n.y,i[2]].concat(i.splice(3)):[n.x,n.y].concat(i.splice(2)):[n.x,n.y]):(s=yue(t,e,i,r),o=Object.keys(i),o.length===2||o.forEach(function(a){if(typeof t.name<"u"&&t.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]=i[a]}),s)}function Xnt(t){return t instanceof kT?t:t.oProj?t.oProj:kT(t)}function Sh(t,e,i){t=Xnt(t);var r=!1,n;return typeof e>"u"?(e=t,t=Ynt,r=!0):(typeof e.x<"u"||Array.isArray(e))&&(i=e,e=t,t=Ynt,r=!0),e=Xnt(e),i?wAe(t,e,i):(n={forward:function(s,o){return wAe(t,e,s,o)},inverse:function(s,o){return wAe(e,t,s,o)}},r&&(n.oProj=e),n)}var Knt=6,Jnt="AJSAJS",Znt="AFAFAF",RG=65,g_=73,Iw=79,EX=86,IX=90;const ihi={forward:Qnt,inverse:rhi,toPoint:est};function Qnt(t,e){return e=e||5,ohi(nhi({lat:t[1],lon:t[0]}),e)}function rhi(t){var e=SAe(rst(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function est(t){var e=SAe(rst(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function xAe(t){return t*(Math.PI/180)}function tst(t){return 180*(t/Math.PI)}function nhi(t){var e=t.lat,i=t.lon,r=6378137,n=.00669438,s=.9996,o,a,l,c,d,p,y,v=xAe(e),S=xAe(i),I,O;O=Math.floor((i+180)/6)+1,i===180&&(O=60),e>=56&&e<64&&i>=3&&i<12&&(O=32),e>=72&&e<84&&(i>=0&&i<9?O=31:i>=9&&i<21?O=33:i>=21&&i<33?O=35:i>=33&&i<42&&(O=37)),o=(O-1)*6-180+3,I=xAe(o),a=n/(1-n),l=r/Math.sqrt(1-n*Math.sin(v)*Math.sin(v)),c=Math.tan(v)*Math.tan(v),d=a*Math.cos(v)*Math.cos(v),p=Math.cos(v)*(S-I),y=r*((1-n/4-3*n*n/64-5*n*n*n/256)*v-(3*n/8+3*n*n/32+45*n*n*n/1024)*Math.sin(2*v)+(15*n*n/256+45*n*n*n/1024)*Math.sin(4*v)-35*n*n*n/3072*Math.sin(6*v));var L=s*l*(p+(1-c+d)*p*p*p/6+(5-18*c+c*c+72*d-58*a)*p*p*p*p*p/120)+5e5,N=s*(y+l*Math.tan(v)*(p*p/2+(5-c+9*d+4*d*d)*p*p*p*p/24+(61-58*c+c*c+600*d-330*a)*p*p*p*p*p*p/720));return e<0&&(N+=1e7),{northing:Math.round(N),easting:Math.round(L),zoneNumber:O,zoneLetter:shi(e)}}function SAe(t){var e=t.northing,i=t.easting,r=t.zoneLetter,n=t.zoneNumber;if(n<0||n>60)return null;var s=.9996,o=6378137,a=.00669438,l,c=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a)),d,p,y,v,S,I,O,L,N,G=i-5e5,V=e;r<"N"&&(V-=1e7),O=(n-1)*6-180+3,l=a/(1-a),I=V/s,L=I/(o*(1-a/4-3*a*a/64-5*a*a*a/256)),N=L+(3*c/2-27*c*c*c/32)*Math.sin(2*L)+(21*c*c/16-55*c*c*c*c/32)*Math.sin(4*L)+151*c*c*c/96*Math.sin(6*L),d=o/Math.sqrt(1-a*Math.sin(N)*Math.sin(N)),p=Math.tan(N)*Math.tan(N),y=l*Math.cos(N)*Math.cos(N),v=o*(1-a)/Math.pow(1-a*Math.sin(N)*Math.sin(N),1.5),S=G/(d*s);var Y=N-d*Math.tan(N)/v*(S*S/2-(5+3*p+10*y-4*y*y-9*l)*S*S*S*S/24+(61+90*p+298*y+45*p*p-252*l-3*y*y)*S*S*S*S*S*S/720);Y=tst(Y);var X=(S-(1+2*p+y)*S*S*S/6+(5-2*y+28*p-3*y*y+8*l+24*p*p)*S*S*S*S*S/120)/Math.cos(N);X=O+tst(X);var te;if(t.accuracy){var re=SAe({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});te={top:re.lat,right:re.lon,bottom:Y,left:X}}else te={lat:Y,lon:X};return te}function shi(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function ohi(t,e){var i="00000"+t.easting,r="00000"+t.northing;return t.zoneNumber+t.zoneLetter+ahi(t.easting,t.northing,t.zoneNumber)+i.substr(i.length-5,e)+r.substr(r.length-5,e)}function ahi(t,e,i){var r=ist(i),n=Math.floor(t/1e5),s=Math.floor(e/1e5)%20;return lhi(n,s,r)}function ist(t){var e=t%Knt;return e===0&&(e=Knt),e}function lhi(t,e,i){var r=i-1,n=Jnt.charCodeAt(r),s=Znt.charCodeAt(r),o=n+t-1,a=s+e,l=!1;o>IX&&(o=o-IX+RG-1,l=!0),(o===g_||ng_||(o>g_||nIw||(o>Iw||nIX&&(o=o-IX+RG-1),a>EX?(a=a-EX+RG-1,l=!0):l=!1,(a===g_||sg_||(a>g_||sIw||(a>Iw||sEX&&(a=a-EX+RG-1);var c=String.fromCharCode(o)+String.fromCharCode(a);return c}function rst(t){if(t&&t.length===0)throw"MGRSPoint coverting from nothing";for(var e=t.length,i=null,r="",n,s=0;!/[A-Z]/.test(n=t.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+t;r+=n,s++}var o=parseInt(r,10);if(s===0||s+3>e)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(s++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O")throw"MGRSPoint zone letter "+a+" not handled: "+t;i=t.substring(s,s+=2);for(var l=ist(o),c=uhi(i.charAt(0),l),d=chi(i.charAt(1),l);dthis.ready,i).then(()=>{const r={animate:!0,...i},n=Hoi(e,this);return this.animation?.update(n),this._gotoTask={},r.animate?this._gotoAnimated(n,r):this._gotoImmediate(n,r)});Oi.getLogger(this.declaredClass).error("#goTo()","target cannot be null or undefined")}async hitTest(e,i){const r=vit(e)?yit(this,e):e;if(!this.ready||isNaN(r.x)||isNaN(r.y))return{screenPoint:r,results:[]};let n=new Set,s=!1,o=null,a=null;i?.include?snt(i.include,nnt(this,p=>n.add(p),p=>{o||(o=new Set),o.add(p)},p=>n.add(p),()=>s=!0)):(s=!0,n=new Set(this.allLayerViews)),i?.exclude&&snt(i.exclude,nnt(this,p=>n.delete(p),p=>{a||(a=new Set),a.add(p)}));const l=this.allLayerViews.filter(p=>!p.suspended&&n.has(p)).reverse(),c=this.toMap(r);let h=[...s?this.graphicsView.hitTest(c).map(p=>({type:"graphic",graphic:p,layer:null,mapPoint:c})):[],...await Promise.all(l.map(p=>p.hitTest(c,r)).toArray())].filter(ve).flat().filter(ve);return o&&(h=h.filter(p=>!("graphic"in p)||!p.graphic||o?.has(yAe(p.graphic)))),a&&(h=h.filter(p=>!("graphic"in p)||!p.graphic||a?.has(yAe(p.graphic)))),{screenPoint:r,results:h}}async takeScreenshot(e){const i=this._createScreenshotPlan(e),r=await this._stage.takeScreenshot(i);return Rli(r,{format:i.format,quality:i.quality,rotation:0,disableDecorations:!1},this._pixelFormat)}async _takeScreenshot(e){const i=this._createScreenshotPlan(e),r=await this._stage.takeScreenshot(i);return Mli(r,this._pixelFormat)}_createScreenshotPlan(e){e=e??{};const i=this.supersampleScreenshotsEnabled?Math.min(4,Nli(this.size,Math.min(4096,this._stage.context.parameters.maxTextureSize))):1;let r;e.layers?(r=[],e.layers.forEach(o=>{const a=this.allLayerViews.find(l=>l.layer.id===o.id);a&&"container"in a&&a.container&&r.push(a.container)})):r=this._stage.children;const{format:n,quality:s}=Lli(e.format,e.quality);return Ili(e,i,this.size,this.padding,n,s,r,e.rotation)}get test(){return{takeScreenshot:e=>this._takeScreenshot(e)}}toMap(e){if(!this.ready)return null;const i=vit(e)?yit(this,e):e,r=[0,0],[n,s]=this.state.toMap(r,[i.x,i.y]),o=this.spatialReference;return new er({x:n,y:s,spatialReference:o})}toScreen(e){if(!this.ready)return null;const i=this._project(e,this.spatialReference),r=[i.x,i.y];return this.state.toScreen(r,r),zh(r[0],r[1])}on(e,i,r,n){return this.inputManager&&this.viewEvents.on(e,i,r,n)||super.on(e,i)}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}hasLayerViewModule(e){return Zit.hasLayerViewModule(e)}importLayerView(e){return Zit.importLayerView(e)}pixelSizeAt(){return this.ready?this.state.resolution:(Oi.getLogger(this.declaredClass).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}popupHitTest(e){return this.hitTest(e).then(i=>({...i,mapPoint:this.toMap(e)}))}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}validate(){let e=Qli(this.type);return Hi("safari")&&Hi("safari")<9&&(e=new st("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:Hi("safari")})),ve(e)?(Oi.getLogger(this.declaredClass).warn("#validate()",e.message),Promise.reject(e)):yui()}_createAnimation(){return this.animation&&!this.animation.done||(this.animation=new IIe),this.animation}_cancellableGoTo(e,i,r){const n=()=>e===this._gotoTask,s=r.then(()=>{n()&&(this.animation=null)}).catch(a=>{throw n()&&(i&&!i.done&&(i.stop(),this.frameTask.animationInProgress=!1),this.animation=null),a}),o=new Promise(a=>a(s));return i.when().catch(()=>{n()&&o.cancel&&o.cancel()}),o}_gotoImmediate(e,i){const r=this._gotoTask,n=this.animation,s=e.then(o=>{if(yn(i),r!==this._gotoTask)throw new st("view:goto-interrupted","Goto was interrupted");this.viewpoint=n.target=o,n.finish()});return this._cancellableGoTo(r,n,s)}_flipStationary(e){return this._stationaryTimer!==null||(this._stationaryTimer=setTimeout(()=>{this._stationaryTimer=null;const i=performance.now()-this._lastStationaryEventTimestamp;i{if(yn(i),r!==this._gotoTask)throw new st("view:goto-interrupted","Goto was interrupted");return n.update(o),this.animationManager.animate(n,this.viewpoint,i),n.when().then(()=>{},()=>{})});return this._cancellableGoTo(r,n,s)}_project(e,i){const r=e&&e.targetGeometry||e;if(!i)return e;if(!r)return null;if(i.imageCoordinateSystem||r.spatialReference?.imageCoordinateSystem||Da(i,r.spatialReference))return e;const n=cp(r,i);if(!n)throw new st("mapview:projection-not-possible","projecting input geometry to target spatial reference returned a null value",{geometry:r,spatialReference:i});return vui(e)?(e.targetGeometry=n,e):n}_resizeHandler(e){if(!this.ready)return;const i=this.state;let r=this.state.paddedViewState.viewpoint;const n=this.state.paddedViewState.size.concat();i.size=[e.width,e.height],iai(r,r,n,this.state.paddedViewState.size,this.resizeAlign),r=this.constraints.constrain(r,void 0),this.state.viewpoint=r}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint(),i=e.targetGeometry;try{this._project(e,this.spatialReference)}catch(l){Oi.getLogger(this.declaredClass).warn(new Am("mapview:startup-projection-error","projection of initial viewpoint to the view's spatial reference, defaulting to the initial viewpoint.",{center:i.toJSON(),spatialReference:this.spatialReference,error:l})),e.targetGeometry=this.defaultsFromMap.extent?.center||new er({x:0,y:0,spatialReference:this.spatialReference})}this.constraints?.fit(e),this._set("state",new Dai({padding:this._get("padding"),size:this.size,viewpoint:e})),this.graphics.owner=this;const r=new Krt(this.surface,{canvas:this.renderCanvas,supersampleScreenshots:this.supersampleScreenshotsEnabled,contextOptions:{disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},renderingOptions:this.renderingOptions,timeline:this.timeline});this._stage=r,this._magnifierView=new tnt,this._magnifierView.magnifier=this.magnifier;const n=new Qrt({view:this});this._set("labelManager",n);const s=new oai({view:this});this._set("animationManager",s);const o=new ent({view:this,animationManager:s});this._set("mapViewNavigation",o),this._setupSpatialReferenceDependentProperties(),this.handles.add([this.rootLayerViews.on("change",()=>this._updateStageChildren()),r.on("post-render",()=>this._set("rendering",r.renderRequested)),r.on("will-render",()=>this._set("rendering",r.renderRequested)),r.on("webgl-error",l=>this.fatalError=l.error),sr(()=>this.stationary,l=>r.stationary=l,Wh),sr(()=>this.background,l=>{r.background=l,this._magnifierView.background=l},Wh),sr(()=>this.magnifier,l=>this._magnifierView.magnifier=l,Wh),sr(()=>this.renderingOptions,l=>r.renderingOptions=l,Wh),sr(()=>this.highlightOptions,l=>r.highlightOptions=l,Wh),sr(()=>this.state.id,()=>r.state=this.state,Wh)],"map-view"),this._updateStageChildren();const a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach(l=>l(this)),this.timeline.end("MapView Startup"),this.frameTask&&this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.handles.remove("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",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&&this.frameTask.stop(),this._stationaryTimer&&(clearTimeout(this._stationaryTimer),this._stationaryTimer=null),this._set("ready",!1);const{center:[e,i],spatialReference:r,rotation:n,scale:s}=this.state.paddedViewState,o=new er({x:e,y:i,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("spatialReference",r),this._set("state",null),this.animation=null}_updateStageChildren(){this._stage.removeAllChildren(),this.rootLayerViews.forEach(i=>{this._stage.addChild(i.container)});const e=this.graphicsView;this._stage.addChild(e.container),this._stage.addChild(this._magnifierView)}_setupSpatialReferenceDependentProperties(){const e=new CN(Ul.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const i=new Jrt({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new Zrt(e)});this.frameTask.graphicsView=i,this._set("graphicsView",i)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),this.frameTask.graphicsView=null,e.destroy(),this._set("featuresTilingScheme",null)}_spatialReferenceChanged(e){if(!this.ready)return;this.frameTask.stop();for(const l of this.allLayerViews)l.processDetach();this._destroySpatialReferenceDependentProperties();const i=this.state.paddedViewState.clone();if(lt(this._scaleBeforeChangingSpatialReference))this._scaleBeforeChangingSpatialReference=i.scale;else{const l=i.viewpoint.clone();l.scale=this._scaleBeforeChangingSpatialReference,i.viewpoint=l}const r=i.clone(),[n,s]=i.center;let o=null;try{o=this._project(new er({x:n,y:s,spatialReference:i.spatialReference}),e)}catch(l){hw()||Oi.getLogger(this.declaredClass).warn(new Am("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 er({x:0,y:0,spatialReference:e}));const a=BIe(new p_({targetGeometry:new er,scale:0,rotation:0}),i.viewpoint,o);r.viewpoint=a;try{const c=[i.size[0]/2,i.size[1]/2],h=[c[0]+20,c[1]],p=i.toMap([0,0],h),{x:y,y:v}=this._project(new er({x:p[0],y:p[1],spatialReference:i.spatialReference}),e);p[0]=y,p[1]=v,r.toScreen(p,p);const x=Wit(c,p,h),I=Math.hypot(p[0]-c[0],p[1]-c[1])/20;!Number.isFinite(I)||Math.abs(I)>4?(a.rotation=0,a.targetGeometry=new er({x:0,y:0,spatialReference:e})):(a.scale*=I,a.scale>Hi("mapview-srswitch-adjust-rotation-scale-threshold")?a.rotation=0:a.rotation+=Number.isFinite(x)?x:0)}catch{}this._get("constraints").constrain(a,void 0),this._get("state").viewpoint=a,this._stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const l of this.allLayerViews)l.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}};ba.type="2d",E([N({readOnly:!0})],ba.prototype,"animationManager",void 0),E([N({constructOnly:!0})],ba.prototype,"deactivatedWebGLExtensions",void 0),E([N({constructOnly:!0})],ba.prototype,"debugWebGLExtensions",void 0),E([N({readOnly:!0})],ba.prototype,"featuresTilingScheme",void 0),E([N({readOnly:!0})],ba.prototype,"fullOpacity",void 0),E([N({readOnly:!0})],ba.prototype,"graphicsTileStore",null),E([N()],ba.prototype,"graphicsView",void 0),E([N({readOnly:!0})],ba.prototype,"state",void 0),E([N()],ba.prototype,"initialExtentRequired",null),E([N()],ba.prototype,"labelManager",void 0),E([N({readOnly:!0})],ba.prototype,"resourceManager",null),E([N({readOnly:!0})],ba.prototype,"textureManager",null),E([N({readOnly:!0})],ba.prototype,"mapViewNavigation",void 0),E([N({constructOnly:!0})],ba.prototype,"renderCanvas",void 0),E([N()],ba.prototype,"renderingOptions",void 0),E([N({readOnly:!0})],ba.prototype,"rendering",void 0),E([N({constructOnly:!0})],ba.prototype,"supersampleScreenshotsEnabled",void 0),E([N({readOnly:!0})],ba.prototype,"supportsGround",void 0),E([N()],ba.prototype,"_stationaryTimer",void 0),E([N()],ba.prototype,"_defaultsFromMapSettings",null),E([N()],ba.prototype,"_pePromise",void 0),E([N({readOnly:!0})],ba.prototype,"typeSpecificPreconditionsReady",null),E([N()],ba.prototype,"animation",null),E([N({type:gui})],ba.prototype,"background",null),E([N({value:null,type:er,dependsOn:["state.id","ready"]})],ba.prototype,"center",null),E([N({type:trt})],ba.prototype,"constraints",null),E([N({value:null,type:Ar,dependsOn:["state.id","ready"]})],ba.prototype,"extent",null),E([N()],ba.prototype,"floors",void 0),E([N({type:lAe})],ba.prototype,"highlightOptions",void 0),E([N({readOnly:!0})],ba.prototype,"inputManager",void 0),E([N()],ba.prototype,"map",void 0),E([N({value:{top:0,right:0,bottom:0,left:0},cast:t=>({top:0,right:0,bottom:0,left:0,...t})})],ba.prototype,"padding",null),E([N()],ba.prototype,"resizeAlign",void 0),E([N({readOnly:!0,dependsOn:["state.id"]})],ba.prototype,"resolution",null),E([N({value:0,type:Number,dependsOn:["state.id","ready"]})],ba.prototype,"rotation",null),E([N({value:0,type:Number,dependsOn:["state.id","ready"]})],ba.prototype,"scale",null),E([N({constructOnly:!0})],ba.prototype,"spatialReferenceLocked",void 0),E([N()],ba.prototype,"stationary",null),E([N({type:uAe,readOnly:!0})],ba.prototype,"timeline",void 0),E([N({readOnly:!0})],ba.prototype,"type",void 0),E([N({readOnly:!0})],ba.prototype,"updating",null),E([N({value:null,type:p_,dependsOn:["state.id","ready"]})],ba.prototype,"viewpoint",null),E([N({value:-1,dependsOn:["state.id","ready"]})],ba.prototype,"zoom",null),E([N({readOnly:!0})],ba.prototype,"navigating",null),E([N({type:Xrt})],ba.prototype,"ui",void 0),ba=E([dt("esri.views.MapView")],ba);const rnt=ba;function yAe(t){const e=t.getObjectId();return e?`${t.layer?.uid??t.sourceLayer?.uid??"MapView"}/${e}`:`"MapView/${t.uid}`}function nnt(t,e,i,r,n){return s=>{if(s instanceof io){if(s.layer===t)n?.();else{const o=t.allLayerViews.find(a=>a.layer===s.layer);o&&r?.(o)}i(yAe(s))}else{const o=t.allLayerViews.find(a=>a.layer===s);o&&e(o)}}}function snt(t,e){if(t)if(bre(t))for(const i of t)if(bre(i))for(const r of i)e(r);else e(i);else e(t)}function _ui(t){return t?.declaredClass==="esri.WebMap"}let bui=class{constructor(e){this.message=e}toString(){return`AssertException: ${this.message}`}};function jp(t,e){if(!t){e=e||"Assertion";const i=new Error(e).stack;throw new bui(`${e} at ${i}`)}}function ont(t,e,i,r){let n,s=(i[0]-t[0])/e[0],o=(r[0]-t[0])/e[0];s>o&&(n=s,s=o,o=n);let a=(i[1]-t[1])/e[1],l=(r[1]-t[1])/e[1];if(a>l&&(n=a,a=l,l=n),s>l||a>o)return!1;a>s&&(s=a),lh&&(n=c,c=h,h=n),!(s>h||c>o)&&(hnew xui(s))}destroy(){this._clients.length=0}hasQuota(e){const i=this._clients[e];return!!i&&(this._totalNumWorkersthis._taskCallback(r,n))):i.tasks.push(e))}cancel(e){this._taskFinished(e),e._cancelled=!0}_taskFinished(e){const i=this._clients[e.client];this._totalNumWorkers--,i.numWorkers--,i.statistics.requests++,i.statistics.size+=e.size||0,i.statistics.duration+=e.duration||0,i.statistics.speed=i.statistics.duration>0?i.statistics.size/i.statistics.duration:0,jp(i.numWorkers>=0),this._next()}_next(){for(const e of this._clients)if(e&&e.numWorkers0;)if(this._workerFunc(e.tasks.shift(),(i,r)=>this._taskCallback(i,r)))return e.numWorkers++,this._totalNumWorkers++,!0;return!1}_taskCallback(e,i){e._cancelled||(this._callbackFunc(e,i),this._taskFinished(e))}getStatsForType(e){const i=this._clients[e];return i?{quota:i.typeWorkerQuota,workers:i.numWorkers,queueSize:i.tasks.length,requestStats:i.statistics}:null}get test(){const e=this;return{set workerFunc(i){e._workerFunc=i}}}},vAe=class extends Tn{constructor(){super(...arguments),this._tasks=new Map,this._onLoadQueue=new Array,this._doneQueue=new Array,this.updating=!1}setup(e,i,r){this._loadQueue=new Cui((n,s)=>this._startLoading(n,s),(n,s)=>this._doneLoadingCB(n,s),e,i),r&&(this._frameTask=r.registerTask(fl.STREAM_DATA_LOADER,this))}destroy(){this._frameTask=Uc(this._frameTask),this._tasks.forEach(e=>oL(e.abortController)),this._loadQueue=da(this._loadQueue),this._onLoadQueue=null,this._doneQueue=null,this._tasks=null}hasDownloadSlots(e){return this._loadQueue.hasQuota(e)}request(e,i,r,n={}){const s=kf();s.__signal=ve(n)?n.signal:null;const o=this._createOrUpdateTask(e,i,r,n,s);return ap(n,()=>this._cancelRequest(o,s)),s.promise}_createTask(e,i,r,n,s,o){const a=new Aui(e,i,r,n,s);return this._updateTask(a,o),this._tasks.set(s,a),this._tasks.size===1&&this._set("updating",!0),this._loadQueue.push(a),a}_cancelRequest(e,i){oVe(e.resolvers,i),i.reject(Sc()),e.resolvers.length===0&&(e.status===Iw.DOWNLOADING&&(e.status=Iw.CANCELLED,this._loadQueue.cancel(e),e.abortController?.abort(),e.request=null,e.abortController=null),e.status=Iw.CANCELLED,this._tasks.delete(e.key),this._tasks.size===0&&this._set("updating",!1))}_updateTask(e,i){e.resolvers.push(i)}_createOrUpdateTask(e,i,r,n,s){const o=Pui(ve(n)&&n.uid||e,i,r),a=this._tasks.get(o);return a?(this._updateTask(a,s),a):this._createTask(e,n,i,r,o,s)}_doneLoadingCB(e,i){this._loadQueue&&(jp(e.status===Iw.DOWNLOADING),e.status=Iw.DOWNLOADED,this._frameTask?this._doneQueue.push({task:e,err:i}):this._doneLoading(e,i))}get running(){return this._doneQueue.length>0||this._onLoadQueue.length>0}runTask(e){for(;!e.done&&this._onLoadQueue.length>0;){const i=this._onLoadQueue.shift();yn(i.task.abortController),i.task.abortController=null,i.callback(i.task),e.madeProgress()}for(;!e.done&&this._doneQueue.length>0;){const i=this._doneQueue.shift();i.task.status!==Iw.DOWNLOADED&&(i.err=i.err||Sc()),this._doneLoading(i.task,i.err),e.madeProgress()}}_doneLoading(e,i){if(i&&!ys(i)&&e.numRetries>0)return--e.numRetries,void this._loadQueue.push(e);let r=e.result instanceof HTMLImageElement?0:e.resolvers.length;for(const n of e.resolvers)if(i)ys(i)?n.reject(i):n.reject(new st("stream-data-loader:request-error",`Failed to request resource at '${e.url}'. ${i}`,{url:e.url,error:i}));else{--r;const s=r<=0?e.result:gi(e.result);n.resolve(s)}this._tasks.delete(e.key),this._tasks.size===0&&this._set("updating",!1)}_startLoading(e,i){if(e.status===Iw.CANCELLED)return!1;let r,n;switch(e.startTime=performance.now(),e.status=Iw.DOWNLOADING,e.docType){case"binary":n="array-buffer",r=0;break;case"image":n="image";break;case"image+type":n="array-buffer";break;default:n="json"}e.abortController=new AbortController;const s=e.abortController.signal;e.request=ur(e.url,{...e.options,responseType:n,timeout:r,signal:s});let o=()=>{};const a=c=>{e.duration=performance.now()-e.startTime,e.size=c instanceof ArrayBuffer?c.byteLength:e.size||0,e.result=c,this._frameTask?this._onLoadQueue.push({callback:i,task:e}):(e.abortController=null,i(e))},l=c=>{e.status===Iw.DOWNLOADING&&i(e,c),o()};return e.docType!=="image+type"?(e.request.then(c=>a(c.data),l),!0):(e.request.then(c=>{const h=c.data,p=Eui(h);if(n="image",e.size=h.byteLength,p==="unknown")return e.request=ur(e.url,{responseType:n,timeout:r,signal:s}),void e.request.then(x=>a(x.data),l);const y=new Blob([h],{type:p}),v=window.URL.createObjectURL(y);o=()=>window.URL.revokeObjectURL(v),e.request=ur(v,{responseType:n,timeout:r,signal:s}),e.request.then(x=>a(new Iui(x.data,p,o)),l)},l),!0)}get test(){return{loadQueue:this._loadQueue}}};E([N({readOnly:!0})],vAe.prototype,"updating",void 0),vAe=E([dt("esri.views.3d.support.StreamDataLoader")],vAe);const Tui={numRetries:0};function Eui(t){if(t.byteLength<2)return"unknown";const e=new Uint8Array(t,0,t.byteLength);return e[0]===137&&e[1]===80?"image/png":e[0]===71&&e[1]===73?"image/gif":e[0]===66&&e[1]===77?"image/bmp":e[0]===255&&e[1]===216?"image/jpeg":"unknown"}let Iui=class{constructor(e,i,r){this.image=e,this.type=i,this.release=r}get isOpaque(){return this.type==="image/jpeg"}},Aui=class extends wui{constructor(e,i,r,n,s){super(n),this.url=e,this.options=i,this.docType=r,this.key=s,this.result=null,this.status=Iw.QUEUED,this.request=null,this.abortController=null,this.resolvers=new Array,this.startTime=0,this.numRetries=Tui.numRetries}};function Pui(t,e,i){return`${t}:${e}:${i}`}var Iw;(function(t){t[t.QUEUED=1]="QUEUED",t[t.DOWNLOADING=2]="DOWNLOADING",t[t.DOWNLOADED=3]="DOWNLOADED",t[t.CANCELLED=4]="CANCELLED"})(Iw||(Iw={}));var ant,lnt,IT,unt,cnt,hnt,dnt;(function(t){t[t.INNER=0]="INNER",t[t.OUTER=1]="OUTER"})(ant||(ant={})),function(t){t[t.REGULAR=0]="REGULAR",t[t.HAS_NORTH_POLE=1]="HAS_NORTH_POLE",t[t.HAS_SOUTH_POLE=2]="HAS_SOUTH_POLE",t[t.HAS_BOTH_POLES=3]="HAS_BOTH_POLES"}(lnt||(lnt={})),function(t){t[t.NORTH=0]="NORTH",t[t.NORTH_EAST=1]="NORTH_EAST",t[t.EAST=2]="EAST",t[t.SOUTH_EAST=3]="SOUTH_EAST",t[t.SOUTH=4]="SOUTH",t[t.SOUTH_WEST=5]="SOUTH_WEST",t[t.WEST=6]="WEST",t[t.NORTH_WEST=7]="NORTH_WEST"}(IT||(IT={})),function(t){t[t.OFF=0]="OFF",t[t.ON=1]="ON"}(unt||(unt={})),function(t){t[t.Color=0]="Color",t[t.ColorNoRasterImage=1]="ColorNoRasterImage",t[t.Highlight=2]="Highlight",t[t.Water=3]="Water",t[t.Occluded=4]="Occluded",t[t.ObjectAndLayerIdColor=5]="ObjectAndLayerIdColor"}(cnt||(cnt={})),function(t){t[t.FADING=0]="FADING",t[t.IMMEDIATE=1]="IMMEDIATE",t[t.UNFADED=2]="UNFADED"}(hnt||(hnt={})),function(t){t[t.INSIDE=0]="INSIDE",t[t.INTERSECTS=1]="INTERSECTS",t[t.OUTSIDE=2]="OUTSIDE"}(dnt||(dnt={}));const Oui=12;let hP=class jv{constructor(e){const i=jv.checkUnsupported(e);if(ve(i))throw i;const r=e;this.spatialReference=r.spatialReference,this._isWebMercator=this.spatialReference.isWebMercator,this._isGCS=YSe(this.spatialReference)||yL(this.spatialReference)||vL(this.spatialReference),this.origin=[r.origin.x,r.origin.y],this.pixelSize=r.size[0],this.dpi=r.dpi;const n=r.lods.reduce((c,h,p)=>(h.levelnew rs({level:i,scale:e.scale,resolution:e.resolution}))})}getExtent(e,i,r,n){const s=this.levels[e],o=s.tileSize[0],a=s.tileSize[1];n[0]=this.origin[0]+r*o,n[2]=this.origin[0]+(r+1)*o,n[3]=this.origin[1]-i*a,n[1]=this.origin[1]-(i+1)*a}convertExtentToRadians(e,i){this._isWebMercator?(i[0]=wGe(e[0]),i[1]=C1e(e[1]),i[2]=wGe(e[2]),i[3]=C1e(e[3])):this._isGCS&&(i[0]=ew(e[0]),i[1]=ew(e[1]),i[2]=ew(e[2]),i[3]=ew(e[3]))}getExtentGeometry(e,i,r,n=new Ar){return this.getExtent(e,i,r,AT),n.spatialReference=this.spatialReference,n.xmin=AT[0],n.ymin=AT[1],n.xmax=AT[2],n.ymax=AT[3],n.zmin=void 0,n.zmax=void 0,n}ensureMaxLod(e){if(e==null)return!1;let i=!1;for(;this.levels.length<=e;){const r=this.levels[this.levels.length-1],n=r.resolution/2;this.levels.push({resolution:n,scale:r.scale/2,tileSize:[n*this.pixelSize,n*this.pixelSize]}),i=!0}return i}capMaxLod(e){this.levels.length>e+1&&(this.levels.length=e+1)}getMaxLod(){return this.levels.length-1}scaleAtLevel(e){return this.levels[0].scale/2**e}levelAtScale(e){const i=this.levels[0].scale;return e>=i?0:Math.log(i/e)*Math.LOG2E}resolutionAtLevel(e){return this.levels[0].resolution/2**e}compatibleWith(e){if(!(e instanceof jv)){if(jv.checkUnsupported(e))return!1;e=new jv(e)}if(!e.spatialReference.equals(this.spatialReference)||e.pixelSize!==this.pixelSize)return!1;const i=Math.min(this.levels.length,e.levels.length)-1,r=this.levels[i].resolution;let n=.5*r;return!Y8(e.origin[0],this.origin[0],n)||!Y8(e.origin[1],this.origin[1],n)?!1:(n=.5*r/2**i/this.pixelSize*Oui,Y8(r,e.levels[i].resolution,n))}rootTilesInExtent(e,i=null,r=1/0){const n=new Array,s=this.levels[0].tileSize;if(lt(e)||s[0]===0||s[1]===0)return n;jv.computeRowColExtent(e,s,this.origin,AT);let o=AT[1],a=AT[3],l=AT[0],c=AT[2];const h=c-l,p=a-o;if(h*p>r){const y=Math.floor(Math.sqrt(r));p>y&&(o=o+Math.floor(.5*p)-Math.floor(.5*y),a=o+y),h>y&&(l=l+Math.floor(.5*h)-Math.floor(.5*y),c=l+y)}for(let y=o;y!W9t(n.resolution,r/2**n.level))}static hasGapInLevels(e){const i=e.lods.map(r=>r.level);i.sort((r,n)=>r-n);for(let r=1;r=128&&i<=512}static hasOriginPerLODs(e){const i=e.origin;return e.lods.some(r=>r.origin!=null&&(r.origin[0]!==i.x||r.origin[1]!==i.y))}static getMissingTileInfoError(){return new st("tilingscheme:tile-info-missing","Tiling scheme must have tiling information")}static checkUnsupported(e){return lt(e)?_Ae():e.lods.length<1?new st("tilingscheme:generic","Tiling scheme must have at least one level"):jv.isPowerOfTwo(e)?jv.hasGapInLevels(e)?new st("tilingscheme:gaps","Tiling scheme levels must not have gaps between min and max level"):jv.tileSizeSupported(e)?jv.hasOriginPerLODs(e)?new st("tilingscheme:multiple-origin","Tiling scheme levels must not have their own origin"):null:new st("tilingscheme:tile-size","Tiles must be square and size must be one of [128, 256, 512]"):new st("tilingscheme:power-of-two","Tiling scheme must be power of two")}static fromExtent(e,i){const r=e[2]-e[0],n=e[3]-e[1],s=Hc(i),o=1.2*Math.max(r,n),a=256,l=96,c=.0254,h=new jv(new Ul({size:[a,a],origin:new er({x:e[0]-.5*(o-r),y:e[3]+.5*(o-n)}),lods:[new rs({level:0,resolution:o/a,scale:1/(a/l*c/(o*s))})],spatialReference:i}));return h.ensureMaxLod(20),h}static makeWebMercatorAuxiliarySphere(e){const i=new jv(jv.WebMercatorAuxiliarySphereTileInfo);return i.ensureMaxLod(e),i}static makeGCSWithTileSize(e,i=256,r=16){const n=256/i,s=new jv(new Ul({size:[i,i],origin:new er({x:-180,y:90,spatialReference:e}),spatialReference:e,lods:[new rs({level:0,resolution:.703125*n,scale:295497598570834e-6*n})]}));return s.ensureMaxLod(r),s}get test(){return{isWebMercator:this._isWebMercator,isGCS:this._isGCS}}};function _Ae(){return new st("tilingscheme:tile-info-missing","Tiling scheme must have tiling information")}hP.WebMercatorAuxiliarySphereTileInfo=new Ul({size:[256,256],origin:new er({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:hr.WebMercator}),spatialReference:hr.WebMercator,lods:[new rs({level:0,resolution:156543.03392800014,scale:591657527591555e-6})]}),hP.WebMercatorAuxiliarySphere=hP.makeWebMercatorAuxiliarySphere(19);const AT=Mo(),pnt=64;ebe(sA/10);const Rui=Mo();hP.WebMercatorAuxiliarySphere.getExtent(0,0,0,Rui),Mo([-180,-90,180,90]);const _V=hn(),Mui=hn(),dP=hn(),pP=hn();function Dui(t,e,i=0){const r=t.extent;if(lt(r))return!1;if(i===0)return RVt(r,e);const n=Math.min(r[2]-r[0],r[3]-r[1]);return ese(r,e,i*n)}function nue(t,e,i,r){Xv(_V,i),_V[r]=e[r];const n=Tc(_V,_V,e),s=Tc(Mui,t,e),o=Qb(s,n),a=Qb(n,n);let l;l=o<=0?e:a<=o?i:Wc(_V,e,Uh(n,n,o/a));const c=Tc(_V,t,l);return Math.PI/2-Math.atan(c[2]/Math.sqrt(c[0]*c[0]+c[1]*c[1]))}function Fui(t,e,i){const r=t.extent;if(lt(r))return 0;dP[0]=r[0],dP[1]=r[1],dP[2]=i,pP[0]=r[2],pP[1]=r[3],pP[2]=i;let n=1/0,s=1/0;return e[0]pP[0]&&(n=nue(e,pP,dP,0)),e[1]pP[1]&&(s=nue(e,pP,dP,1)),Math.min(n,s)}function Lui(t,e,i){if(lt(t))return _Ae();if(t.spatialReference.isGeographic&&!YSe(t.spatialReference))return new st("tilingscheme:local-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in local scenes");const r=hP.checkUnsupported(t);if(ve(r))return r;if(lt(i))return new st("tilingscheme:extent-not-exist","The layer does not provide a layer extent.");const n=Nui(t,i);if(n)return n;const s=t.spatialReference;return ve(e)&&!(s.equals(e)||e.isWGS84&&s.isWebMercator)?new st("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the local scene"):null}function Nui(t,e){const i=t.lods,r=i[0].resolution*2**i[0].level,n=[r*t.size[0],r*t.size[1]],s=[t.origin.x,t.origin.y],o=fR(e),a=Mo();hP.computeRowColExtent(o,n,s,a);const l=(a[2]-a[0])*(a[3]-a[1]);if(l>pnt){const c=i[0].scale*2**i[0].level;let h=Math.max((o[3]-o[1])/t.size[1],(o[2]-o[0])/t.size[0])*c/r;const p=Math.floor(Math.log(h)/Math.log(10));return h=Math.ceil(h/10**p)*10**p,new st("tilingscheme:too-many-root-tiles","Scale of level 0 of the tiling scheme (1:"+Math.floor(c).toLocaleString()+") is too large for the layer's extent. Suggested scale: 1:"+h.toLocaleString()+".",{level0Scale:c,suggestedLevel0Scale:h,requiredNumRootTiles:l,allowedNumRootTiles:pnt})}return null}const kui=Object.freeze(Object.defineProperty({__proto__:null,checkIfTileInfoSupportedForViewSR:Lui,isInsideExtent:Dui,tiltToExtentEdge:Fui},Symbol.toStringTag,{value:"Module"}));function $ui(){return!0}function Bui(){return 0}function Vui(t,e){if(lt(t))return _Ae();const i=t.lods.length-1,r=t.spatialReference,n=YSe(r)||yL(r)||vL(r);if(r.isWebMercator){if(!hP.makeWebMercatorAuxiliarySphere(i).compatibleWith(t))return new st("tilingscheme:incompatible-global-web-mercator","The tiling scheme is not compatible with the ArcGIS Online Web Mercator tiling scheme")}else{if(!n)return new st("tilingscheme:global-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in global scenes");if(!hP.makeGCSWithTileSize(t.spatialReference,t.size[0],i).compatibleWith(t))return t.spatialReference.isWGS84?new st("tilingscheme:incompatible-global-wgs84","The tiling scheme is not compatible with the ArcGIS Online WGS84 tiling scheme"):new st("tilingscheme:incompatible-global","The tiling scheme is not compatible with the ArcGIS Online tiling scheme")}return ve(e)&&!t.spatialReference.equals(e)?new st("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the global scene"):void 0}const jui=Object.freeze(Object.defineProperty({__proto__:null,checkIfTileInfoSupportedForViewSR:Vui,isInsideExtent:$ui,tiltToExtentEdge:Bui},Symbol.toStringTag,{value:"Module"})),Gui={[xw.Global]:jui,[xw.Local]:kui};function bAe(t,e,i,r){return Gui[r].checkIfTileInfoSupportedForViewSR(t,i,e)}function Uui(t,e,i){const r=U8t(t);if(ve(r)){if(!Sr.isCollection(r))return{tileInfo:r.tileInfo,fullExtent:r.fullExtent};{const n=r.find(s=>bAe(s.tileInfo,s.fullExtent,e,i)==null);if(n)return{tileInfo:n.tileInfo,fullExtent:n.fullExtent}}}return{tileInfo:null,fullExtent:null}}IT.NORTH,IT.EAST,IT.SOUTH,IT.WEST,IT.NORTH_EAST,IT.SOUTH_EAST,IT.SOUTH_WEST,IT.NORTH_WEST;function zui(t,e){return t!=null&&(e==null||(e===xw.Local?!t.isGeographic||t.isWGS84||t.wkid===Yb.CGCS2000:t.isWebMercator||t.isWGS84||t.wkid===Yb.CGCS2000||t.wkid===Yb.GCSMARS2000||t.wkid===Yb.GCSMARS2000_SPHERE||t.wkid===Yb.GCSMOON2000))}async function Hui(t,e={}){await qui(t,e),yn(e)}async function Wui(t,e={}){const{basemap:i,view:r}=t;if(yn(e),"spatialReferenceLocked"in r&&!r.spatialReferenceLocked||(await i.load(e),yn(e),i.baseLayers.length===0))return;const n=i.baseLayers.getItemAt(0);if(!G8t(n))return;if(i.spatialReference){if(r.spatialReference.equals(i.spatialReference))return;fnt()}await n.load(e),yn(e);const s=(("supportedSpatialReferences"in n?n.supportedSpatialReferences:null)||["tileInfo"in n?n.tileInfo?.spatialReference:null]).filter(ve);s.length!==0&&s.every(o=>!r.spatialReference.equals(o))&&fnt()}function fnt(){throw new st("basemap-compatibility:incompatible-spatial-reference","Basemap spatial reference is not compatible with the view")}async function qui(t,e){const{basemap:i,view:r}=t;if(await i.load(e),i.baseLayers.length===0)return;const n=i.baseLayers.concat(i.referenceLayers).toArray().filter(o=>!$Ge(o)).map(o=>new st("basemap-compatibility:unsupported-basemap-layer-type","Unsupported basemap layer type ${operationalLayerType}",{layer:o,operationalLayerType:o.operationalLayerType||"unknown"}));if(n.length)throw n[0];const s=i.baseLayers.getItemAt(0);if($Ge(s)){try{await s.load(e)}catch(o){const a="basemap-compatibility:unknown-error",l="Unknown basemap compatibility error",{name:c=a,message:h=l,details:p}=o;throw new st(c,h,p)}Yui(s,r)}}function Yui(t,e){const i=e.state.viewingMode;if(!i)return;let r,n;if(t?.type==="wmts"){const l=Uui(t,e.spatialReference,i);if(lt(l.tileInfo))throw new st("basemapgalleryitem:tiling-scheme-incompatible","Basemap tiling scheme is incompatible with the view");r=l.tileInfo,n=l.fullExtent}else r=t.tileInfo,n=t.fullExtent;if(lt(r))return;if(!zui(r.spatialReference,i))throw new st(`basemapgalleryitem:spatial-reference-unsupported-${Ait(i)}`,`Basemap spatial reference is unsupported in ${Ait(i)} mode`);const s=r.spatialReference.isGeographic,o=t?.type==="vector-tile"?r.getOrCreateCompatible(256,s?1:2):null;if(i===xw.Global){let l=bAe(r,n,null,i);if(l&&t?.type==="vector-tile"&&ve(n)&&o&&!bAe(o,n,null,i)&&(l=null),l){const c=r.spatialReference.isWebMercator?"web-mercator":"wgs84";throw new st(`basemapgalleryitem:tiling-scheme-unsupported-${c}-global`,"Basemap tiling scheme is unsupported in global mode",{error:l})}}else if(hP.checkUnsupported(r))throw new st("basemapgalleryitem:tiling-scheme-unsupported-local","Basemap tiling scheme is unsupported in local mode");const a=e.get("basemapTerrain.tilingScheme");if(a&&!a.compatibleWith(r)&&(t?.type!=="vector-tile"||!o||!a.compatibleWith(o)))throw new st("basemapgalleryitem:tiling-scheme-incompatible","Basemap tiling scheme is incompatible with the view")}let PT=class extends D1(Ud(Tn)){constructor(e){super(e),this.compatibilityFunction=null,this.error=null,this.state="loading",this.view=null}initialize(){const e=()=>this.refresh();this.handles.add([sr(()=>this.basemap?.loadStatus,e),sr(()=>this.compatibilityFunction,e),sr(()=>this.view&&"basemapTerrain"in this.view&&this.view.basemapTerrain?.tilingScheme,e),sr(()=>this.view?.ready,e),sr(()=>this.view?.spatialReference,e)]),this.refresh()}destroy(){this._cancelRefresh(),this.basemap=null,this.compatibilityFunction=null,this.view=null}get _spatialReferenceTask(){return BQt(this.view,this.basemap)}set basemap(e){const i=this._get("basemap");i&&i.cancelLoad(),e&&e.load().catch(()=>{}),this._set("basemap",e)}get spatialReference(){return this._spatialReferenceTask.spatialReference}refresh(){this._cancelRefresh(),this._set("state","loading");const e=this.basemap?.loadStatus;if(e!=="loaded"&&e!=="failed")return;if(!this.compatibilityFunction)return void(e==="loaded"?(this._set("state","ready"),this._set("error",null)):(this._set("state","error"),this._set("error",this.basemap.loadError)));const i=new AbortController,{signal:r}=i;this.compatibilityFunction(this,{signal:r}).then(()=>N1(()=>!this._spatialReferenceTask.updating,r)).then(()=>{this._set("state","ready"),this._set("error",null)}).catch(n=>{ys(n)||(this._set("state","error"),this._set("error",n))}),this._refreshController=i}_cancelRefresh(){this._refreshController&&(this._refreshController.abort(),this._refreshController=null)}};E([N({readOnly:!0})],PT.prototype,"_spatialReferenceTask",null),E([N()],PT.prototype,"basemap",null),E([N()],PT.prototype,"compatibilityFunction",void 0),E([N({readOnly:!0})],PT.prototype,"error",void 0),E([N({readOnly:!0})],PT.prototype,"spatialReference",null),E([N({readOnly:!0})],PT.prototype,"state",void 0),E([N()],PT.prototype,"view",void 0),PT=E([dt("esri.widgets.BasemapGallery.support.BasemapGalleryItem")],PT);const mnt=PT,gnt=Sr.ofType(iR);let gX=class extends Tn{constructor(e){super(e),this.basemaps=new gnt}get state(){return"ready"}refresh(){}};E([N({type:gnt})],gX.prototype,"basemaps",void 0),E([N({readOnly:!0})],gX.prototype,"state",null),gX=E([dt("esri.widgets.BasemapGallery.support.LocalBasemapsSource")],gX);const ynt=gX,vnt=Sr.ofType(iR);let fP=class extends gd.LoadableMixin(Jx(ynt)){constructor(e){super(e),this._handles=new df,this.basemaps=new vnt,this.filterFunction=null,this.portal=Cc.getDefault(),this.query=null,this.updateBasemapsCallback=null}initialize(){this._handles.add([sr(()=>[this.filterFunction,this.loadStatus,this.portal?.basemapGalleryGroupQuery,this.portal?.user,this.query,this.updateBasemapsCallback],()=>this.refresh(),Yo)])}destroy(){this._handles.destroy(),this._handles=null,this.filterFunction=null,this.portal=null}get state(){return this.loadStatus==="not-loaded"?"not-loaded":this.loadStatus==="loading"||this._lastPortalBasemapFetchController?"loading":"ready"}load(e){return this.addResolvingPromise(this.portal.load(e)),this.notifyChange("state"),Promise.resolve(this)}async refresh(){if(this.state!=="ready")return;this._lastPortalBasemapFetchController&&(this._lastPortalBasemapFetchController.abort(),this._lastPortalBasemapFetchController=null);const e=this.portal,i=new AbortController;this._lastPortalBasemapFetchController=i,this.notifyChange("state");try{const r=await e.fetchBasemaps(this._toQueryString(this.query),i);this._updateBasemaps(r)}catch(r){if(ys(r))throw r;Oi.getLogger(this.declaredClass).warn(new st("basemap-source:fetch-basemaps-error","Could not fetch basemaps from portal.",{error:r})),this._updateBasemaps()}this._lastPortalBasemapFetchController=null,this.notifyChange("state")}_toQueryString(e){return e&&typeof e!="string"?Object.keys(e).map(i=>`${i}:${e[i]}`).join(" AND "):e}_updateBasemaps(e=[]){let i=this.filterFunction?e.filter(this.filterFunction):e;i=this.updateBasemapsCallback?this.updateBasemapsCallback(i):i,this.basemaps.removeAll(),this.basemaps.addMany(i)}};E([N({readOnly:!0,type:vnt})],fP.prototype,"basemaps",void 0),E([N()],fP.prototype,"filterFunction",void 0),E([N({type:Cc})],fP.prototype,"portal",void 0),E([N()],fP.prototype,"query",void 0),E([N({readOnly:!0})],fP.prototype,"state",null),E([N()],fP.prototype,"updateBasemapsCallback",void 0),fP=E([dt("esri.widgets.BasemapGallery.support.PortalBasemapsSource")],fP);const sue=fP,_nt=Sr.ofType(mnt);function Xui(t){return t&&t.declaredClass==="esri.portal.Portal"}function Kui(t){return t&&!(t instanceof sue)&&(!!t.portal||!!t.query)}function Jui(t){return t&&"basemaps"in t&&"state"in t&&"refresh"in t}let Aw=class extends Ud(gd){constructor(e){super(e),this._loadingProjectionEngine=!1,this.items=new _nt,this.source=new sue,this.view=null}initialize(){const e=()=>this._recreateItems();this.handles.add([sr(()=>this.state==="ready"?this.compatibilityFunction:null,()=>this._updateItems()),Wu(()=>this.source?.basemaps,"change",e,{onListenerAdd:e})])}get activeBasemap(){return this.view?.map?.basemap??null}set activeBasemap(e){if(!this.view.map)return;const i=typeof e=="string"?iR.fromId(e):e;if(!i||!this.view.ready)return this.view.map.basemap=i,void this._clearOverride("activeBasemap");const r=i.spatialReference||this.items?.find(n=>this.basemapEquals(i,n.basemap))?.spatialReference;if(r&&"spatialReferenceLocked"in this.view&&!this.view.spatialReferenceLocked){const n=this.view.spatialReference;if(ve(r)&&!Da(n,r)&&!o_(this.view.spatialReference,r)&&!hw())return this._override("activeBasemap",i),this._loadingProjectionEngine=!0,void A2().then(()=>{this._get("activeBasemap")===e&&(this.view.map.basemap=e,this.view.spatialReference=r,this._clearOverride("activeBasemap"))},()=>{}).then(()=>{this._loadingProjectionEngine=!1});this.view.map.basemap=i,this._clearOverride("activeBasemap"),ve(r)&&!Da(this.view.spatialReference,r)&&(this.view.spatialReference=r)}else this.view.map.basemap=i,this._clearOverride("activeBasemap")}get activeBasemapIndex(){const{state:e,items:i,activeBasemap:r}=this;if(e!=="ready")return-1;const n=i.findIndex(s=>s.basemap===r);return n===-1?i.findIndex(s=>this.basemapEquals(s.basemap,r)):n}get compatibilityFunction(){return this.view?.type==="3d"?Hui:Wui}set compatibilityFunction(e){this._overrideIfSome("compatibilityFunction",e)}castSource(e){return Array.isArray(e)||Sr.isCollection(e)?new ynt({basemaps:e}):Xui(e)?new sue({portal:e}):Kui(e)?new sue(e):Jui(e)?e:null}get state(){return this.view?.ready&&this.source?this._loadingProjectionEngine?"loading":"ready":"disabled"}basemapEquals(e,i){return $Qt(e,i)}refresh(){this._recreateItems()}load(e){return this.addResolvingPromise(gd.isLoadable(this.source)?this.source.load(e):null),Promise.resolve(this)}_recreateItems(){const e=this.source?.basemaps,{view:i,compatibilityFunction:r}=this;this.items.removeAll().forEach(n=>n.destroy()),e&&this.items.addMany(e.map(n=>new mnt({basemap:n,compatibilityFunction:r,view:i})))}_updateItems(){for(const e of this.items)e.compatibilityFunction=this.compatibilityFunction,e.view=this.view}};E([N()],Aw.prototype,"_loadingProjectionEngine",void 0),E([N()],Aw.prototype,"activeBasemap",null),E([N({readOnly:!0})],Aw.prototype,"activeBasemapIndex",null),E([N()],Aw.prototype,"compatibilityFunction",null),E([N({readOnly:!0,type:_nt})],Aw.prototype,"items",void 0),E([N()],Aw.prototype,"source",void 0),E([ho("source")],Aw.prototype,"castSource",null),E([N({readOnly:!0})],Aw.prototype,"state",null),E([N()],Aw.prototype,"view",void 0),Aw=E([dt("esri.widgets.BasemapGallery.BasemapGalleryViewModel")],Aw);const Zui=Aw,mP="esri-basemap-gallery",ib={base:`${mP} esri-widget esri-widget--panel-height-only`,sourceLoading:`${mP}--source-loading`,loader:`${mP}__loader`,item:`${mP}__item`,itemContainer:`${mP}__item-container`,itemTitle:`${mP}__item-title`,itemThumbnail:`${mP}__item-thumbnail`,selectedItem:`${mP}__item--selected`,itemError:`${mP}__item--error`,emptyMessage:"esri-widget__content--empty",widgetIcon:"esri-icon-basemap",disabled:"esri-disabled",loaderAnimation:"esri-widget__loader-animation"};let Pw=class extends Hf{constructor(e,i){super(e,i),this._handles=new df,this._focusBasemapItemEnabled=!1,this.disabled=!1,this.headingLevel=2,this.iconClass=ib.widgetIcon,this.messages=null,this.viewModel=new Zui}initialize(){const e=this._handles;this.addHandles([Wu(()=>this.viewModel.items,"change",i=>{const r="basemap-gallery-item-changes",{added:n,moved:s}=i;e.remove(r),e.add([...n,...s].map(o=>sr(()=>o.state,()=>this.scheduleRender())),r),this.scheduleRender()}),Yg(()=>this.source,()=>this.viewModel.load(),{initial:!0,once:!0})])}destroy(){this._handles.destroy()}loadDependencies(){return Promise.resolve().then(()=>fcr)}get activeBasemap(){return this.viewModel.activeBasemap}set activeBasemap(e){this.viewModel.activeBasemap=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get source(){return this.viewModel.source}set source(e){this.viewModel.source=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e=this.source.state==="loading",i=this.disabled||this.viewModel.state==="disabled",r=this.viewModel.items.map((a,l)=>this._renderBasemapGalleryItem(a,l)).toArray(),n={[ib.sourceLoading]:e,[ib.disabled]:i},s=e?Gi("div",{class:ib.loader,key:"esri-basemap-gallery__loader"}):null,o=e?null:r.length>0?Gi("ul",{bind:this,"aria-disabled":this.disabled,"aria-label":this.label,class:ib.itemContainer,key:"esri-basemap-gallery__item-container",onkeydown:this._handleKeyDown,role:"radiogroup"},r):Gi("div",{class:ib.emptyMessage,key:"esri-basemap-gallery__empty-message"},Gi(mle,{level:this.headingLevel},this.messages.noBasemaps));return Gi("div",{class:this.classes(ib.base,n)},s,o)}_getRoundRobinIndex(e,i){return(e+i)%i}_handleKeyDown(e){const{key:i}=e;if(!["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(i))return;e.preventDefault();const{items:r,activeBasemapIndex:n}=this.viewModel,s=i==="ArrowUp"||i==="ArrowLeft"?this._getRoundRobinIndex(Math.max(n-1,-1),r.length):this._getRoundRobinIndex(n+1,r.length),o=r.getItemAt(s);o?.state==="ready"&&(this.viewModel.activeBasemap=o.basemap),this._focusBasemapItemEnabled=!0}_focusBasemapItem(e){this._focusBasemapItemEnabled&&e.tabIndex===0&&(e.focus(),this._focusBasemapItemEnabled=!1)}_handleClick(e){const i=e.currentTarget["data-item"];i.state==="ready"&&(this.viewModel.activeBasemap=i.basemap)}_renderBasemapGalleryItem(e,i){const r=e.basemap.thumbnailUrl||Ql("esri/themes/base/images/basemap-toggle-64.svg"),n=e.basemap.title,s=e.basemap.portalItem?.snippet,o=e.error?.message||s||n,{viewModel:{state:a,activeBasemapIndex:l}}=this,c=this.disabled||a==="disabled",h=l===i,p=h||l===-1&&i===0?0:-1,y=a==="loading",v={[ib.selectedItem]:h,[ib.itemError]:e.state==="error"},x=`basemapgallery-item-${e.uid}`;return Gi("li",{"aria-checked":h.toString(),"aria-disabled":c.toString(),"aria-labelledby":x,bind:this,class:this.classes(ib.item,v),"data-item":e,onkeydown:this._handleClick,onclick:this._handleClick,role:"radio",tabIndex:p,afterUpdate:this._focusBasemapItem,title:o},Gi("img",{alt:"",class:ib.itemThumbnail,src:r}),Gi("div",{id:x,class:ib.itemTitle},n),e.state==="loading"||h&&y?Gi("calcite-scrim",null,Gi("span",{"aria-hidden":"true",role:"presentation",class:ib.loaderAnimation})):null)}};E([N()],Pw.prototype,"activeBasemap",null),E([N()],Pw.prototype,"disabled",void 0),E([N()],Pw.prototype,"headingLevel",void 0),E([N()],Pw.prototype,"iconClass",void 0),E([N()],Pw.prototype,"label",null),E([N(),Wf("esri/widgets/BasemapGallery/t9n/BasemapGallery")],Pw.prototype,"messages",void 0),E([N()],Pw.prototype,"source",null),E([N()],Pw.prototype,"view",null),E([N()],Pw.prototype,"viewModel",void 0),E([K1()],Pw.prototype,"_handleClick",null),Pw=E([dt("esri.widgets.BasemapGallery")],Pw);const pv="esri-scale-bar",gp={base:`${pv} esri-widget`,labelContainer:`${pv}__label-container`,rulerLabelContainer:`${pv}__label-container--ruler`,lineLabelContainer:`${pv}__label-container--line`,topLabelContainer:`${pv}__label-container--top`,bottomLabelContainer:`${pv}__label-container--bottom`,label:`${pv}__label`,line:`${pv}__line`,topLine:`${pv}__line--top`,bottomLine:`${pv}__line--bottom`,ruler:`${pv}__ruler`,rulerBlock:`${pv}__ruler-block`,barContainer:`${pv}__bar-container`,rulerBarContainer:`${pv}__bar-container--ruler`,lineBarContainer:`${pv}__bar-container--line`,disabled:"esri-disabled"};function bnt(t){if(!t)return null;if(nne(t)&&t.wkid){const e=lqt[t.wkid];if(e)return e}if(t.wkt){const e=Qui(t.wkt);if(e)return e}return null}function Qui(t){const e=oqt.exec(t);if(!e||e.length!==2)return null;const i=e[1].split(",");if(!i||i.length<3)return null;const r=parseFloat(i[1]),n=parseFloat(i[2]);return isNaN(r)||isNaN(n)?null:{a:r,f:n===0?0:1/n}}function eci(t){const e=bnt(t??hr.WGS84);if(tci(e))return e;const i=e.a*(1-e.f);return Object.assign(e,{b:i,eSq:1-(i/e.a)**2,radius:(2*e.a+i)/3,densificationRatio:1e4/((2*e.a+i)/3)})}function tci(t){return t!=null&&"b"in t&&"eSq"in t&&"radius"in t}function wnt(t){return bnt(t)!==null}function ici(t,e="meters"){if(!t)throw new st("geodesic-lengths:invalid-geometries","the input geometries type is not supported");if(t.some(r=>!wnt(r.spatialReference)))throw new st("geodesic-lengths:invalid-spatial-reference","the input geometries spatial reference is not supported");const i=[];for(let r=0;r1e-12&&--Pe>0);if(Pe===0){const Oe=p,Ge=Math.acos(Math.sin(s)*Math.sin(a)+Math.cos(s)*Math.cos(a)*Math.cos(o-n))*Oe,Be=o-n,qe=Math.sin(Be)*Math.cos(a),et=Math.cos(s)*Math.sin(a)-Math.sin(s)*Math.cos(a)*Math.cos(Be),Ze=Math.atan2(qe,et);return t.azimuth=Ze/P5,t.distance=Ge,t.reverseAzimuth=void 0,t}const J=V*(l*l-c*c)/(c*c),de=J/1024*(256+J*(J*(74-47*J)-128)),Se=c*(1+J/16384*(4096+J*(J*(320-175*J)-768)))*(ie-de*Y*(X+de/4*(Z*(2*X*X-1)-de/6*X*(4*Y*Y-3)*(4*X*X-3)))),Ie=Math.atan2(k*Math.sin(ke),P*F-I*k*Math.cos(ke)),Re=Math.atan2(P*Math.sin(ke),P*F*Math.cos(ke)-I*k);return t.azimuth=Ie/P5,t.distance=Se,t.reverseAzimuth=Re/P5,t}function sci(t){const{wkid:e}=t;if(ai[e]!=null)return ai.values[ai[e]];const{wkt:i}=t,r=i.lastIndexOf(",")+1,n=i.lastIndexOf("]]");return parseFloat(i.substring(r,n))}function xnt(t,e){return t&&t.includes(e)}function Snt(t,e){const{x:i,y:r}=t==="decimal-degrees"?wL(e,!0):e;return[i,r]}function Cnt({state:{paddedViewState:t},spatialReference:e,width:i}){return e.isWrappable&&t.worldScreenWidthn?a=n:a<0&&(a=0);const l=zh(0,a),c=zh(r,a);return[e.toMap(l),e.toMap(c)]}_getScaleBarProps(e,i,r){const{view:n}=this;let s=e*i/(Cnt(n)?n.state.paddedViewState.worldScreenWidth:n.width),o=r==="metric"?"km":"mi";s<.1&&(o==="mi"?(s*=5280,o="ft"):o==="km"&&(s*=1e3,o="m"));let a=0;for(;s>=1;)s/=10,a++;const l=this._getConstraints(s);if(!l)return null;const{min:c,max:h}=l,p=h/s>=s/c?c:h;return{length:e*(p/s),value:10**a*p,unit:o}}_getConstraints(e){return e>.5?{min:.5,max:1}:e>.3?{min:.3,max:.5}:e>.2?{min:.2,max:.3}:e>.15?{min:.15,max:.2}:e>=.1?{min:.15,max:.1}:void 0}};E([N()],bV.prototype,"scaleComputedFrom",void 0),E([N({readOnly:!0})],bV.prototype,"state",null),E([N()],bV.prototype,"view",void 0),bV=E([dt("esri.widgets.Scalebar.ScaleBarViewModel")],bV);const oci=bV;function oue(t){return 2*t}let OT=class extends Hf{constructor(e,i){super(e,i),this.messages=null,this.unit="non-metric",this.viewModel=new oci}initialize(){this.addHandles([sr(()=>{const{view:e}=this;return[e?.stationary,e?.center,e?.scale,e?.zoom]},([e])=>{e&&this.scheduleRender()})])}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}set style(e){const i=this.unit==="dual"?"line":e;this._set("style",i)}castStyle(e){return e==="line"?e:"ruler"}castUnit(e){return e==="metric"||e==="dual"?e:"non-metric"}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e=this.get("viewModel.state")==="disabled",i={[gp.disabled]:e};let r,n;if(!e){const{unit:s,style:o}=this,a=s==="metric"||s==="dual",l=50;if(s==="non-metric"||s==="dual"){const c=this.viewModel.getScaleBarProperties(l,"non-metric");c&&(n=o==="ruler"?this._renderRuler(c):this._renderLine(c,"bottom"))}if(a){const c=this.viewModel.getScaleBarProperties(l,"metric");c&&(r=o==="ruler"?this._renderRuler(c):this._renderLine(c,"top"))}}return Gi("div",{afterCreate:this._handleRootCreateOrUpdate,afterUpdate:this._handleRootCreateOrUpdate,bind:this,class:this.classes(gp.base,i)},r,n)}_renderRuler(e){const i=oue(Math.round(e.length)),{messages:r}=this,n=r[e.unit]||r.unknownUnit,s=`${oue(e.value)} ${n}`;return Gi("div",{class:this.classes(gp.barContainer,gp.rulerBarContainer),key:"esri-scale-bar__ruler"},Gi("div",{class:gp.ruler,styles:{width:`${i}px`}},Gi("div",{class:gp.rulerBlock}),Gi("div",{class:gp.rulerBlock}),Gi("div",{class:gp.rulerBlock}),Gi("div",{class:gp.rulerBlock})),Gi("div",{class:this.classes(gp.labelContainer,gp.rulerLabelContainer)},Gi("div",{class:gp.label},"0"),Gi("div",{class:gp.label},s)))}_renderLine(e,i){const{messages:r}=this,n=r[e.unit]||r.unknownUnit,s=`${oue(e.value)} ${n}`,o={[gp.topLabelContainer]:i==="top",[gp.bottomLabelContainer]:i==="bottom"},a=Gi("div",{class:this.classes(gp.labelContainer,gp.lineLabelContainer,o),key:"esri-scale-bar__label"},Gi("div",{class:gp.label},s)),l={[gp.topLine]:i==="top",[gp.bottomLine]:i==="bottom"},c=oue(Math.round(e.length)),h=Gi("div",{class:this.classes(gp.line,l),key:"esri-scale-bar__line",styles:{width:`${c}px`}});return Gi("div",{class:this.classes(gp.barContainer,gp.lineBarContainer),key:"esri-scale-bar__line-container"},[h,a])}_handleRootCreateOrUpdate(e){const i=this.viewModel;if(!i)return;const r=e.getBoundingClientRect(),n=r.left+window.pageXOffset,s=r.top+window.pageYOffset,o=zh(n,s);(o.x!==i.scaleComputedFrom.x||o.y!==i.scaleComputedFrom.y)&&(i.scaleComputedFrom=o)}};E([N()],OT.prototype,"label",null),E([N(),Wf("esri/widgets/ScaleBar/t9n/ScaleBar")],OT.prototype,"messages",void 0),E([N()],OT.prototype,"style",null),E([ho("style")],OT.prototype,"castStyle",null),E([N()],OT.prototype,"unit",void 0),E([ho("unit")],OT.prototype,"castUnit",null),E([N()],OT.prototype,"view",null),E([N()],OT.prototype,"viewModel",void 0),OT=E([dt("esri.widgets.ScaleBar")],OT);class ml{wkid;latestWkid;wkt;constructor(e,i){typeof e=="string"?this.wkt=e:(this.wkid=e,this.latestWkid=i)}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 ml("");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 ml(4326)}static fromConfig(e){if(e.wkt)return new ml(e.wkt);if(e.wkid)return new ml(e.wkid,e.latestWkid);throw new Error("Could not parse config spatial reference object")}static parseSR(e){return e?e instanceof ml?e.clone():new ml(e):ml.latLongSR()}static fromESRI(e){if(e.wkt)return new ml(e.wkt);{const i=e.toJSON().latestWkid,r=new ml(e.wkid);return i&&(r.latestWkid=i),r}}toESRI(){return new hr(this.lean())}static fromGeoJSON(e){const i=ml.parseGeoJsonCrs(e);return i.substring(0,5)==="EPSG:"?new ml(parseInt(i.slice(5))):new ml(i)}static parseGeoJsonCrs(e){if(e){if(e.type==="name"){const i=/urn:ogc:def:crs:EPSG::(\d+)/,r=e.properties.name,n=r.match(i);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 DN{sr;id;constructor(e,i){this.id=e?e.toString():"",this.sr=ml.parseSR(i)}get type(){return pl.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===pl.NONE||this.type===pl.UNKNOWN}geoJsonFactory(e,i){const r={type:e,coordinates:i};return this.sr&&(r.crs=this.sr.toGeoJSON()),r}}class FM extends DN{constructor(){super("no_geometry")}get type(){return pl.NONE}}let iy=class Yie extends DN{rawArray;constructor(e,i,r,n){super(e,i.sr||r),n?this.rawArray=i.slice():this.rawArray=Yie.parseXY(i)}get type(){return pl.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 i;if(Array.isArray(e)&&e.length===2)i=e;else{if(e instanceof Yie)return e.toArray();i=[e.x,e.y]}if(isNaN(i[0])||isNaN(i[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(i[0]),parseFloat(i[1])]}static fromESRI(e,i){return new Yie(i,[e.x,e.y],ml.fromESRI(e.spatialReference),!0)}toESRI(){return new er({x:this.x,y:this.y,spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,i){return new Yie(i,e.coordinates,ml.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(Op.POINT,this.toArray())}};class v_ extends DN{rawArray;constructor(e,i,r,n){super(e,i.sr||r),n?this.rawArray=v_.arrayDeepCopy(i):i instanceof v_?this.rawArray=i.toArray():this.rawArray=v_.parsePointSet(i)}get pointArray(){return this.rawArray.map((e,i)=>new iy(this.childIdGenerator(i),e,this.sr,!0))}getAt(e){return new iy(this.childIdGenerator(e),this.rawArray[e],this.sr,!0)}updateAt(e,i){this.rawArray[i]=iy.parseXY(e)}get length(){return this.rawArray.length}toArray(){return v_.arrayDeepCopy(this.rawArray)}static parsePointSet(e){if(Array.isArray(e)){if(e.length===0)throw new Error("no verticies provided");return e.map(i=>iy.parseXY(i))}else throw new Error("Bad geometry input encountered")}static arrayDeepCopy(e){return e.map(i=>i.slice())}}class wV extends v_{constructor(e,i,r,n){super(e,i,r,n)}get type(){return pl.MULTIPOINT}static fromESRI(e,i){return new wV(i,e.points,ml.fromESRI(e.spatialReference),!0)}toESRI(){return new _d({points:this.toArray(),spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,i){return new wV(i,e.coordinates,ml.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(Op.MULTIPOINT,this.toArray())}}class LM extends v_{constructor(e,i,r,n){if(super(e,i,r,n),this.rawArray.length<2)throw new Error("lines require at least two verticies")}get type(){return pl.LINESTRING}static fromESRI(e,i){return new LM(i,e.paths[0],ml.fromESRI(e.spatialReference),!0)}toESRI(){return new Oa({paths:[this.toArray()],spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,i){return new LM(i,e.coordinates,ml.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(Op.LINESTRING,this.toArray())}}class G2 extends DN{rawArray;constructor(e,i,r,n){if(super(e,i.sr||r),n)this.rawArray=G2.arrayDeepCopy(i);else if(i instanceof G2)this.rawArray=i.toArray();else if(i instanceof v_)this.rawArray=[i.toArray()];else if(Array.isArray(i)){if(i.length===0)throw new Error("no lines provided");this.rawArray=i.map(s=>v_.parsePointSet(s))}else throw new Error("invalid lines format for MulitLineString")}get lineArray(){return this.rawArray.map((e,i)=>new LM(this.childIdGenerator(i),e,this.sr,!0))}getAt(e){return new LM(this.childIdGenerator(e),this.rawArray[e],this.sr,!0)}updateAt(e,i){this.rawArray[i]=v_.parsePointSet(e)}get length(){return this.rawArray.length}get type(){return pl.MULTILINESTRING}toArray(){return G2.arrayDeepCopy(this.rawArray)}static arrayDeepCopy(e){return e.map(i=>i.map(r=>r.slice()))}static fromESRI(e,i){return new G2(i,e.paths,ml.fromESRI(e.spatialReference),!0)}toESRI(){return new Oa({paths:this.toArray(),spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,i){return new G2(i,e.coordinates,ml.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(Op.MULTILINESTRING,this.toArray())}}class FN extends v_{constructor(e,i,r,n){if(super(e,i,r,n),FN.closeRing(this.rawArray),this.length<4)throw new Error("Linear Ring must have at least 3 distinct vertices.")}get type(){return pl.LINEARRING}updateAt(e,i){const r=this.length-1;i===0?super.updateAt(e,r):i===r&&super.updateAt(e,0),super.updateAt(e,i)}static closeRing(e){const i=e[0],r=e[e.length-1];(i[0]!==r[0]||i[1]!==r[1])&&e.push(i.slice())}static fromESRI(e,i){return new FN(i,e.rings[0],ml.fromESRI(e.spatialReference),!0)}toESRI(){return new To({rings:[this.toArray()],spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,i){return new FN(i,e.coordinates,ml.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(Op.POLYGON,[this.toArray()])}}class ry extends DN{rawArray;constructor(e,i,r,n){super(e,i.sr||r),n?this.rawArray=ry.arrayDeepCopy(i):this.rawArray=ry.parsePolygon(i)}addLinearRings(e){e.forEach(i=>this.rawArray.push(i.toArray()))}get ringArray(){return this.rawArray.map((e,i)=>new FN(this.childIdGenerator(i),e,this.sr,!0))}get type(){return pl.POLYGON}toArray(){return ry.arrayDeepCopy(this.rawArray)}static parsePolygon(e){let i=[];if(e instanceof ry)return e.toArray();if(e instanceof G2)i=e.toArray();else if(e instanceof v_)i=[e.toArray()];else if(Array.isArray(e)){if(e.length===0)throw new Error("no rings provided");i=e.map(r=>v_.parsePointSet(r))}else throw new Error("invalid input format for parsePolygon");return i.forEach(r=>FN.closeRing(r)),i}static arrayDeepCopy(e){return e.map(i=>i.map(r=>r.slice()))}static fromESRI(e,i){return new ry(i,e.rings,ml.fromESRI(e.spatialReference),!0)}toESRI(){return new To({rings:this.toArray(),spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,i){return new ry(i,e.coordinates,ml.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(Op.POLYGON,this.toArray())}}class gP extends DN{rawArray;constructor(e,i,r,n){super(e,i.sr||r),n?this.rawArray=gP.arrayDeepCopy(i):this.rawArray=gP.parseMultiPolygon(i)}addPolygon(e){this.rawArray.push(e.toArray())}get polygonArray(){return this.rawArray.map((e,i)=>new ry(this.childIdGenerator(i),e,this.sr,!0))}get type(){return pl.MULTIPOLYGON}toArray(){return gP.arrayDeepCopy(this.rawArray)}static parseMultiPolygon(e){if(e instanceof gP)return e.toArray();if(e instanceof ry)return[e.toArray()];if(e instanceof G2||e instanceof v_)return[ry.parsePolygon(e)];if(Array.isArray(e)){if(e.length===0)throw new Error("no polygons provided");return e.map(i=>ry.parsePolygon(i))}else throw new Error("invalid input format for parseMultiPolygon")}static arrayDeepCopy(e){return e.map(i=>i.map(r=>r.map(n=>n.slice())))}static fromESRI(e,i){return new gP(i,[e.rings],ml.fromESRI(e.spatialReference),!0)}toESRI(){const e=[];return this.toArray().forEach(i=>{i.forEach(r=>e.push(r))}),new To({rings:e,spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,i){return new gP(i,e.coordinates,ml.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(Op.MULTIPOLYGON,this.toArray())}}class Ad extends DN{rawMin;rawMax;constructor(e,i,r,n){super(e,i.sr||n),this.rawMin=iy.parseXY(i),this.rawMax=iy.parseXY(r)}get type(){return pl.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 iy(this.id+"_centerPoint",[(this.xmax-this.xmin)/2+this.xmin,(this.ymax-this.ymin)/2+this.ymin],this.sr,!0)}expand(e){return Ad.fromESRI(this.toESRI().expand(e),`${this.id}-expanded`)}clone(){return new Ad(this.id,this.rawMin,this.rawMax,this.sr)}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 ry(this.id,this.toPolygonArray(),this.sr,!0)}static fromParams(e,i,r,n,s,o){return new Ad(e,[i,r],[n,s],o)}static fromConfig(e,i){return new Ad(e,[i.xmin,i.ymin],[i.xmax,i.ymax],ml.fromConfig(i.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,i){return Ad.fromParams(i,e.xmin,e.ymin,e.xmax,e.ymax,ml.fromESRI(e.spatialReference))}toESRI(){return new Ar({xmin:this.xmin,ymin:this.ymin,xmax:this.xmax,ymax:this.ymax,spatialReference:this.sr.toESRI()})}static fromArcServer(e,i){return Ad.fromESRI(Ar.fromJSON(e),i)}static fromGeoJSON(e,i){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)),i===3&&this.c.push(1)}else if(typeof e=="string"){const i=e.substring(0,1)==="#"?e.substring(1):e;this.c=[0,2,4,6].map(r=>{const n=i.substring(r,r+2);return yP.hexToInt(n)})}else this.c=[e.r,e.g,e.b,e.a??1];this.c.forEach((i,r)=>{i<0&&(console.error("Negative value passed to colour"),this.c[r]=0),i>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(i=>yP.intToHex(i)).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 en(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 i=e.toString(16);return i.length===1?`0${i}`:i}}class vP{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 i;const r=e.length;if(r===0)return;const n=e.substring(r-2);return n==="px"?i=parseFloat(e.substring(0,r-2))*1.333333:n==="pt"?i=parseFloat(e.substring(0,r-2)):i=parseFloat(e),i}else return e}}class _P extends vP{_height;_xOffset;_yOffset;_icon;_width;_size;_colour;_style;_outline;_path;_angle;constructor(e){if(e=e||{style:gC.CIRCLE},super(),this._style=e.style||gC.CIRCLE,e.style===gC.ICON){const i=e;this._icon=i.icon||"",this._height=vP.convToPoints(i.height)||16.5,this._width=vP.convToPoints(i.width)||16.5,this._size=0,this._colour=new yP,this._outline=new RT,this._path=""}else{const i=e;this._size=vP.convToPoints(i.size)||12,this._colour=new yP(i.colour??"#ffffff40"),this._outline=new RT(i.outline),this._path=this._style===gC.PATH&&i.path||"",this._height=0,this._width=0,this._icon=""}this._xOffset=vP.convToPoints(e.xOffset)||0,this._yOffset=vP.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===gC.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===gC.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===gC.ICON?_P.isImageUrl(this.icon)?(e=new dA,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 wd,e.color=new en(this.colour.rgba),e.size=this.width,e.xoffset=this.xOffset,e.yoffset=this.yOffset,e.angle=this.angle):(e=new wd,e.color=new en(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 i={xOffset:e.xoffset,yOffset:e.yoffset,angle:e.angle};if(e.type==="simple-marker"){const r=i;r.style=e.style,r.colour=e.color.toRgba(),r.size=e.size,r.path=e.path,r.outline=RT.fromESRI(e.outline).toOptions()}else{const r=i;r.style=gC.ICON,r.width=e.width,r.height=e.height,r.icon=e.url}return new _P(i)}static fromArcServer(e){return _P.fromESRI(JW(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 RT extends vP{_style;_width;_miter;_cap;_join;_colour;constructor(e){e=e||{},super(),this._style=e.style||Gv.SOLID;const i=vP.convToPoints(e.width);this._width=typeof i>"u"||i<0?.75:i,this._colour=new yP(e.colour),this._miter=e.miter??2,this._cap=e.cap||QBe.ROUND,this._join=e.join||ZBe.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 Mm;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 i={width:e.width,colour:e.color.toRgba(),style:e.style};return new RT(i)}static fromArcServer(e){return RT.fromESRI(JW(e))}}class xV extends vP{_outlineStyle;_fillColour;_fillStyle;constructor(e){super(),e=e||{},e.fill||(e.fill={}),this._fillColour=new yP(e.fill.colour),this._fillStyle=e.fill.style||eVe.SOLID,this._outlineStyle=new RT(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(),i=new en(this.fillColour.rgba),r=new sw;return r.style=this.fillStyleType,r.color=i,r.outline=e,r}static fromESRI(e){const i={fill:{colour:e.color.toRgba(),style:e.style},outline:RT.fromESRI(e.outline).toOptions()};return new xV(i)}static fromArcServer(e){return xV.fromESRI(JW(e))}}class aci{Extent=Ad;Graphic=I1;LineString=LM;LineStyle=RT;LinearRing=FN;MultiLineString=G2;MultiPoint=wV;MultiPolygon=gP;Point=iy;PointStyle=_P;Polygon=ry;PolygonStyle=xV;SpatialReference=ml;esriMapClickToRamp(e,i){return{mapPoint:iy.fromESRI(e.mapPoint,i),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,i){switch(e.type){case"point":return iy.fromESRI(e,i);case"polyline":{const r=e;return r.paths.length===1?LM.fromESRI(r,i):G2.fromESRI(r,i)}case"polygon":return ry.fromESRI(e,i);case"extent":return Ad.fromESRI(e,i);case"multipoint":return wV.fromESRI(e,i);default:throw new Error(`Encountered unhandled geometry type ${e.type}`)}}geomGeoJsonToRamp(e,i){switch(e.type){case Op.POINT:return iy.fromGeoJSON(e,i);case Op.LINESTRING:return LM.fromGeoJSON(e,i);case Op.POLYGON:return ry.fromGeoJSON(e,i);case Op.MULTIPOINT:return wV.fromGeoJSON(e,i);case Op.MULTILINESTRING:return G2.fromGeoJSON(e,i);case Op.MULTIPOLYGON:return gP.fromGeoJSON(e,i);default:throw new Error(`Encountered unhandled geometry type ${e.type}`)}}geomRampToGeoJson(e){return e.toGeoJSON()}graphicRampToGeoJson(e){const i={},r={type:"Feature",geometry:this.geomRampToGeoJson(e.geometry),properties:i};return Object.keys(e.attributes).forEach(n=>r.properties[n]=e.attributes[n]),r}graphicGeoJsonToRamp(e,i){if(e.type!=="Feature")throw new Error("Expected input parameter of graphicGeoJsonToRamp to be a GeoJson feature");const r=this.geomGeoJsonToRamp(e.geometry,i),n={};return Object.keys(e.properties.forEach(o=>n[o]=e.properties[o])),new I1(r,"",n)}graphicRampToEsri(e){const i={attributes:{},id:e.id};return i.geometry=this.geomRampToEsri(e.geometry),Object.keys(e.attributes).forEach(r=>i.attributes[r]=e.attributes[r]),e.style&&(i.symbol=this.styleRampToEsri(e.style)),new io(i)}styleRampToEsri(e){return e.toESRI()}styleEsriToRamp(e){switch(e.type){case"picture-marker":case"simple-marker":return _P.fromESRI(e);case"simple-line":return RT.fromESRI(e);case"simple-fill":return xV.fromESRI(e);default:return console.error(`Unsupported ESRI symbol type encountered: ${e.type}`),new _P}}serverGeomTypeToRampGeomType(e){if(!e)return pl.NONE;switch(e){case"esriGeometryPolygon":return pl.POLYGON;case"esriGeometryPolyline":return pl.LINESTRING;case"esriGeometryPoint":return pl.POINT;case"esriGeometryMultipoint":return pl.MULTIPOINT;case"esriGeometryEnvelope":return pl.EXTENT;default:return console.error(`Unrecognized server geometry type encountered: ${e}`),pl.UNKNOWN}}clientGeomTypeToRampGeomType(e){if(!e)return pl.NONE;switch(e){case"polygon":return pl.POLYGON;case"polyline":return pl.LINESTRING;case"point":return pl.POINT;case"multipoint":return pl.MULTIPOINT;default:return console.error(`Unrecognized client geometry type encountered: ${e}`),pl.UNKNOWN}}geoJsonGeomTypeToEsriGeomType(e){switch(e){case Op.POINT:return"point";case Op.LINESTRING:case Op.MULTILINESTRING:return"polyline";case Op.POLYGON:case Op.MULTIPOLYGON:return"polygon";case Op.MULTIPOINT:return"multipoint";default:throw new Error(`Encountered unhandled geometry type ${e}`)}}isImageUrl(e){return _P.isImageUrl(e)}}class aue{layerIdx;name;children;uid;isRoot;constructor(e,i,r="",n=!0){this.layerIdx=e,this.name=r,this.isRoot=n,this.children=[],this.uid=i}findChildByUid(e){if(this.uid===e)return this;{let i;return this.children.some(r=>i=r.findChildByUid(e)),i}}findChildByIdx(e){if(this.layerIdx===e)return this;{let i;return this.children.some(r=>i=r.findChildByIdx(e)),i}}get isLogicalLayer(){return this.layerIdx>-1&&this.children.length===0}get isLayerRoot(){return this.isRoot}}class Tnt{minScale;maxScale;constructor(e=0,i=0){this.minScale=e,this.maxScale=i}isOffScale(e){const i={offScale:!1,zoomIn:!1};return ethis.minScale&&this.minScale!==0&&(i.offScale=!0,i.zoomIn=!0),i}}let Ent=class{sql;cache;extent;constructor(e="",i=""){this.sql={[Nf.PERMANENT]:e,[Nf.INITIAL]:i},this.extent=void 0,this.cache={}}sqlActiveFilters(e=[]){const i=this.sql,r=Object.keys(i).filter(n=>i[n]);return e.length===0?r:r.filter(n=>e.indexOf(n)===-1)}isActive(){return this.sqlActiveFilters([Nf.PERMANENT]).length>0}getCombinedSql(e=[]){const i=this.sqlActiveFilters(e),r=i.length;return r===0?"":r===1?this.sql[i[0]]:i.map(n=>`(${this.sql[n]})`).join(" AND ")}setSql(e,i){e===Nf.PERMANENT?console.error("Attempted to overwrite a permanent filter. Not allowed."):(this.sql[e]=i,this.clearCacheSet(e))}getSql(e){return this.sql[e]||""}setExtent(e){e.isEqual(this.extent)||(this.extent=e,this.clearCacheSet(Nf.EXTENT))}getCacheKey(e,i){return`_cache$${e.sort().join("$")}${i?"$"+Nf.EXTENT:""}$`}getCache(e,i){const r=this.getCacheKey(e,i);return this.cache[r]}setCache(e,i,r){const n=this.getCacheKey(i,r);this.cache[n]=e}cacheActiveKeys(){const e=this.cache;return Object.keys(e).filter(i=>e[i])}clearAllCaches(){this.cache={}}clearCacheSet(e){this.cacheActiveKeys().forEach(i=>{i.indexOf(`$${e}$`)>-1&&delete this.cache[i]})}clearAll(){this.sql={[Nf.PERMANENT]:this.sql[Nf.PERMANENT]},this.extent=void 0,this.clearAllCaches()}};class yX{id;sr;_defaultExtent;_fullExtent;_maximumExtent;constructor(e,i,r=void 0,n=void 0){this.id=e,this.sr=i.sr.clone(),this._defaultExtent=i.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 yX(e.id,Ad.fromConfig(`${e.id}-extent-default`,e.default),e.full!==void 0?Ad.fromConfig(`${e.id}-extent-full`,e.full):void 0,e.maximum!==void 0?Ad.fromConfig(`${e.id}-extent-maximum`,e.maximum):void 0)}clone(){return new yX(this.id,this._defaultExtent,this._fullExtent,this._maximumExtent)}}class Yf{realPromise;resolveMe(){}rejectMe(){}getPromise(){return this.realPromise}constructor(){this.realPromise=new Promise((e,i)=>{this.resolveMe=e,this.rejectMe=i})}}var Jh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function MT(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function lue(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var i=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)};i.prototype=e.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(i,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}),i}var lci=function(e){return uci(e)&&!cci(e)};function uci(t){return!!t&&typeof t=="object"}function cci(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||pci(t)}var hci=typeof Symbol=="function"&&Symbol.for,dci=hci?Symbol.for("react.element"):60103;function pci(t){return t.$$typeof===dci}function fci(t){return Array.isArray(t)?[]:{}}function vX(t,e){return e.clone!==!1&&e.isMergeableObject(t)?SV(fci(t),t,e):t}function mci(t,e,i){return t.concat(e).map(function(r){return vX(r,i)})}function gci(t,e){if(!e.customMerge)return SV;var i=e.customMerge(t);return typeof i=="function"?i:SV}function yci(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function Int(t){return Object.keys(t).concat(yci(t))}function Ant(t,e){try{return e in t}catch{return!1}}function vci(t,e){return Ant(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function _ci(t,e,i){var r={};return i.isMergeableObject(t)&&Int(t).forEach(function(n){r[n]=vX(t[n],i)}),Int(e).forEach(function(n){vci(t,n)||(Ant(t,n)&&i.isMergeableObject(e[n])?r[n]=gci(n,i)(t[n],e[n],i):r[n]=vX(e[n],i))}),r}function SV(t,e,i){i=i||{},i.arrayMerge=i.arrayMerge||mci,i.isMergeableObject=i.isMergeableObject||lci,i.cloneUnlessOtherwiseSpecified=vX;var r=Array.isArray(e),n=Array.isArray(t),s=r===n;return s?r?i.arrayMerge(t,e,i):_ci(t,e,i):vX(e,i)}SV.all=function(e,i){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,n){return SV(r,n,i)},{})};var bci=SV,wci=bci;const uue=MT(wci);class xci{generateUUID(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,i=>{const r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(i==="x"?r:r&3|8).toString(16)})}convertImageToCanvas(e,i,r=!0){const n=i??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",c=>l(c))});return s.src=e,o}async convertImagetoDataURL(e,i="image/png"){return e.startsWith("data")?e:this.convertImageToCanvas(e).then(r=>r.toDataURL(i)).catch(r=>(console.error("Failed to load crossorigin image",e,r),e))}parseUrlIndex(e){const i={rootUrl:e,index:0},r=/\/(\d+)\/?$/,n=e.match(r);if(n){const s=n[1];i.index=isNaN(parseInt(s))?void 0:parseInt(s),i.rootUrl=e.substr(0,e.length-n[0].length)}else console.warn("Cannot extract layer index from url "+e);return i}}class _X{_url;_base;_query;_queryMap={};constructor(e){this._url=e,[this._base,this._query]=e.split("?").concat(""),this._queryMap=this._query.split("&").reduce((i,r)=>{const[n,s]=r.split("=");return i[n]=s,i},{})}get query(){return this._query}get base(){return this._base}get queryMap(){return this._queryMap}updateQuery(e){const i=uue.all([{},this.queryMap,e]);return`${this.base}${Object.entries(i).filter(([,n])=>n!==void 0).map(([n,s],o)=>`${o===0?"?":""}${n}=${s}`).join("&")}`}}var wAe={exports:{}},Pnt;function Ont(){return Pnt||(Pnt=1,function(t,e){(function(i,r){t.exports=r(),typeof window=="object"&&(i.Terraformer=r())})(Jh,function(){var i={},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(ae){return Object.prototype.toString.call(ae)==="[object Array]"}function c(){var ae=Array.prototype.slice.apply(arguments);typeof console!==void 0&&console.warn&&console.warn.apply(console,ae)}function h(ae,ht){for(var wt in ht)ht.hasOwnProperty(wt)&&(ae[wt]=ht[wt]);return ae}function p(ae){if(ae.type)switch(ae.type){case"Point":return[ae.coordinates[0],ae.coordinates[1],ae.coordinates[0],ae.coordinates[1]];case"MultiPoint":return x(ae.coordinates);case"LineString":return x(ae.coordinates);case"MultiLineString":return y(ae.coordinates);case"Polygon":return y(ae.coordinates);case"MultiPolygon":return v(ae.coordinates);case"Feature":return ae.geometry?p(ae.geometry):null;case"FeatureCollection":return I(ae);case"GeometryCollection":return P(ae);default:throw new Error("Unknown type: "+ae.type)}return null}function y(ae){for(var ht=null,wt=null,Ne=null,pe=null,Ae=0;Aewt)&&(wt=Ot),(Ne===null||jtpe)&&(pe=jt)}return[ht,Ne,wt,pe]}function v(ae){for(var ht=null,wt=null,Ne=null,pe=null,Ae=0;Aewt)&&(wt=nt),(Ne===null||$epe)&&(pe=$e)}return[ht,Ne,wt,pe]}function x(ae){for(var ht=null,wt=null,Ne=null,pe=null,Ae=0;Aewt)&&(wt=gt),(Ne===null||zepe)&&(pe=ze)}return[ht,Ne,wt,pe]}function I(ae){for(var ht=[],wt,Ne=ae.features.length-1;Ne>=0;Ne--)wt=p(ae.features[Ne].geometry),ht.push([wt[0],wt[1]]),ht.push([wt[2],wt[3]]);return x(ht)}function P(ae){for(var ht=[],wt,Ne=ae.geometries.length-1;Ne>=0;Ne--)wt=p(ae.geometries[Ne]),ht.push([wt[0],wt[1]]),ht.push([wt[2],wt[3]]);return x(ht)}function F(ae){var ht=p(ae);return{x:ht[0],y:ht[1],w:Math.abs(ht[0]-ht[2]),h:Math.abs(ht[1]-ht[3])}}function k(ae){return ae*n}function j(ae){return ae*s}function V(ae,ht){for(var wt=0;wtht?1:0}function _e(ae,ht){return ae[0]>ht[0]?-1:ae[0]ht[1]?-1:ae[1]Pe(ht,wt))&&(wt=ae[Ne])}return wt}function J(ae){if(ae.length===0)return[];if(ae.length===1)return ae;for(var ht=[ae.sort(_e)[0]],wt=0;wt0||!ht&><0)return!1}return!0}function Se(ae,ht){for(var wt=!1,Ne=-1,pe=ae.length,Ae=pe-1;++Ne=3)ae=this.coordinates;else return null;else if(this.type==="Polygon"||this.type==="MultiLineString")if(this.coordinates&&this.coordinates.length>0){for(ht=0;ht0){for(ht=0;ht=2)this.coordinates=ht;else throw"Terraformer: invalid input for Terraformer.Point";this.type="Point"}Pt.prototype=new mt,Pt.prototype.constructor=Pt;function $t(ae){if(ae&&ae.type==="MultiPoint"&&ae.coordinates)h(this,ae);else if(l(ae))this.coordinates=ae;else throw"Terraformer: invalid input for Terraformer.MultiPoint";this.type="MultiPoint"}$t.prototype=new mt,$t.prototype.constructor=$t,$t.prototype.forEach=function(ae){for(var ht=0;ht1},Ft.prototype.holes=function(){var ae=[];if(this.hasHoles())for(var ht=1;ht=this.text.length)return;t=this.text[this.place++]}switch(this.state){case xX:return this.neutral(t);case Fnt:return this.keyword(t);case cue:return this.quoted(t);case Nnt:return this.afterquote(t);case Lnt:return this.number(t);case CAe:return}},bP.prototype.afterquote=function(t){if(t==='"'){this.word+='"',this.state=cue;return}if(hue.test(t)){this.word=this.word.trim(),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in afterquote yet, index '+this.place)},bP.prototype.afterItem=function(t){if(t===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=xX;return}if(t==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=xX,this.currentObject=this.stack.pop(),this.currentObject||(this.state=CAe);return}},bP.prototype.number=function(t){if(knt.test(t)){this.word+=t;return}if(hue.test(t)){this.word=parseFloat(this.word),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in number yet, index '+this.place)},bP.prototype.quoted=function(t){if(t==='"'){this.state=Nnt;return}this.word+=t},bP.prototype.keyword=function(t){if(Dci.test(t)){this.word+=t;return}if(t==="["){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=xX;return}if(hue.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in keyword yet, index '+this.place)},bP.prototype.neutral=function(t){if(Mci.test(t)){this.word=t,this.state=Fnt;return}if(t==='"'){this.word="",this.state=cue;return}if(knt.test(t)){this.word=t,this.state=Lnt;return}if(hue.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in neutral yet, index '+this.place)},bP.prototype.output=function(){for(;this.place0?90:-90),t.lat_ts=t.lat1)}function Bnt(t){var e=Fci(t),i=e.shift(),r=e.shift();e.unshift(["name",r]),e.unshift(["type",i]);var n={};return TV(e,n),kci(n),n}function fv(t){var e=this;if(arguments.length===2){var i=arguments[1];typeof i=="string"?i.charAt(0)==="+"?fv[t]=SAe(arguments[1]):fv[t]=Bnt(arguments[1]):fv[t]=i}else if(arguments.length===1){if(Array.isArray(t))return t.map(function(r){Array.isArray(r)?fv.apply(e,r):fv(r)});if(typeof t=="string"){if(t in fv)return fv[t]}else"EPSG"in t?fv["EPSG:"+t.EPSG]=t:"ESRI"in t?fv["ESRI:"+t.ESRI]=t:"IAU2000"in t?fv["IAU2000:"+t.IAU2000]=t:console.log(t);return}}Cci(fv);function $ci(t){return typeof t=="string"}function Bci(t){return t in fv}var Vci=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function jci(t){return Vci.some(function(e){return t.indexOf(e)>-1})}var Gci=["3857","900913","3785","102113"];function Uci(t){var e=NM(t,"authority");if(e){var i=NM(e,"epsg");return i&&Gci.indexOf(i)>-1}}function zci(t){var e=NM(t,"extension");if(e)return NM(e,"proj4")}function Hci(t){return t[0]==="+"}function Wci(t){if($ci(t)){if(Bci(t))return fv[t];if(jci(t)){var e=Bnt(t);if(Uci(e))return fv["EPSG:3857"];var i=zci(e);return i?SAe(i):e}if(Hci(t))return SAe(t)}else return t}function Vnt(t,e){t=t||{};var i,r;if(!e)return t;for(r in e)i=e[r],i!==void 0&&(t[r]=i);return t}function FT(t,e,i){var r=t*e;return i/Math.sqrt(1-r*r)}function SX(t){return t<0?-1:1}function Ms(t){return Math.abs(t)<=gf?t:t-SX(t)*wX}function U2(t,e,i){var r=t*i,n=.5*t;return r=Math.pow((1-r)/(1+r),n),Math.tan(.5*(Pn-e))/r}function CX(t,e){for(var i=.5*t,r,n,s=Pn-2*Math.atan(e),o=0;o<=15;o++)if(r=t*Math.sin(s),n=Pn-2*Math.atan(e*Math.pow((1-r)/(1+r),i))-s,s+=n,Math.abs(n)<=1e-10)return s;return-9999}function qci(){var t=this.b/this.a;this.es=1-t*t,"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=FT(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Yci(t){var e=t.x,i=t.y;if(i*DT>90&&i*DT<-90&&e*DT>180&&e*DT<-180)return null;var r,n;if(Math.abs(Math.abs(i)-Pn)<=fs)return null;if(this.sphere)r=this.x0+this.a*this.k0*Ms(e-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(Fc+.5*i));else{var s=Math.sin(i),o=U2(this.e,i,s);r=this.x0+this.a*this.k0*Ms(e-this.long0),n=this.y0-this.a*this.k0*Math.log(o)}return t.x=r,t.y=n,t}function Xci(t){var e=t.x-this.x0,i=t.y-this.y0,r,n;if(this.sphere)n=Pn-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var s=Math.exp(-i/(this.a*this.k0));if(n=CX(this.e,s),n===-9999)return null}return r=Ms(this.long0+e/(this.a*this.k0)),t.x=r,t.y=n,t}var Kci=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const Jci={init:qci,forward:Yci,inverse:Xci,names:Kci};function Zci(){}function jnt(t){return t}var Qci=["longlat","identity"],ehi=[Jci,{init:Zci,forward:jnt,inverse:jnt,names:Qci}],due={},pue=[];function Gnt(t,e){var i=pue.length;return t.names?(pue[i]=t,t.names.forEach(function(r){due[r.toLowerCase()]=i}),this):(console.log(e),!0)}function thi(t){if(!t)return!1;var e=t.toLowerCase();if(typeof due[e]<"u"&&pue[due[e]])return pue[due[e]]}function ihi(){ehi.forEach(Gnt)}const rhi={start:ihi,add:Gnt,get:thi};var Ka={};Ka.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},Ka.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},Ka.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},Ka.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},Ka.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},Ka.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},Ka.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},Ka.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},Ka.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},Ka.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},Ka.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},Ka.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},Ka.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},Ka.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},Ka.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},Ka.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},Ka.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},Ka.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},Ka.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},Ka.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},Ka.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},Ka.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},Ka.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},Ka.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},Ka.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},Ka.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},Ka.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},Ka.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},Ka.hough={a:6378270,rf:297,ellipseName:"Hough"},Ka.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},Ka.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},Ka.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},Ka.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},Ka.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},Ka.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},Ka.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},Ka.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},Ka.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},Ka.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},Ka.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},Ka.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var nhi=Ka.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Ka.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function shi(t,e,i,r){var n=t*t,s=e*e,o=(n-s)/n,a=0;r?(t*=1-o*(Ici+o*(Aci+o*Pci)),n=t*t,o=0):a=Math.sqrt(o);var l=(n-s)/s;return{es:o,e:a,ep2:l}}function ohi(t,e,i,r,n){if(!t){var s=NM(Ka,r);s||(s=nhi),t=s.a,e=s.b,i=s.rf}return i&&!e&&(e=(1-1/i)*t),(i===0||Math.abs(t-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=NN,a.datum_params[3]*=bX,a.datum_params[4]*=bX,a.datum_params[5]*=bX,a.datum_params[6]=a.datum_params[6]/1e6+1)),o&&(a.datum_type=CV,a.grids=o),a.a=i,a.b=r,a.es=n,a.ep2=s,a}var Unt={};function lhi(t,e){var i=new DataView(e),r=hhi(i),n=dhi(i,r);n.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var s=phi(i,n,r),o={header:n,subgrids:s};return Unt[t]=o,o}function uhi(t){if(t===void 0)return null;var e=t.split(",");return e.map(chi)}function chi(t){if(t.length===0)return null;var e=t[0]==="@";return e&&(t=t.slice(1)),t==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:Unt[t]||null,isNull:!1}}function EV(t){return t/3600*Math.PI/180}function hhi(t){var e=t.getInt32(8,!1);return e===11?!1:(e=t.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function dhi(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:TAe(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}function TAe(t,e,i){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,i)))}function phi(t,e,i){for(var r=176,n=[],s=0;s5e-11?!1:t.datum_type===LN?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type===NN?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]:!0}function znt(t,e,i){var r=t.x,n=t.y,s=t.z?t.z:0,o,a,l,c;if(n<-Pn&&n>-1.001*Pn)n=-Pn;else if(n>Pn&&n<1.001*Pn)n=Pn;else{if(n<-Pn)return{x:-1/0,y:-1/0,z:t.z};if(n>Pn)return{x:1/0,y:1/0,z:t.z}}return r>Math.PI&&(r-=2*Math.PI),a=Math.sin(n),c=Math.cos(n),l=a*a,o=i/Math.sqrt(1-e*l),{x:(o+s)*c*Math.cos(r),y:(o+s)*c*Math.sin(r),z:(o*(1-e)+s)*a}}function Hnt(t,e,i,r){var n=1e-12,s=n*n,o=30,a,l,c,h,p,y,v,x,I,P,F,k,j,V=t.x,Y=t.y,X=t.z?t.z:0,Z,ie,ce;if(a=Math.sqrt(V*V+Y*Y),l=Math.sqrt(V*V+Y*Y+X*X),a/is&&jr.y||h>r.x||va&&Math.abs(l.y)>a);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=Ms(s.x+i.ll[0]),r.y=s.y+i.ll[1]}else isNaN(s.x)||(r.x=t.x+s.x,r.y=t.y+s.y);return r}function qnt(t,e){var i={x:t.x/e.del[0],y:t.y/e.del[1]},r={x:Math.floor(i.x),y:Math.floor(i.y)},n={x:i.x-1*r.x,y:i.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 c={x:e.cvs[o][0],y:e.cvs[o][1]};o--;var h={x:e.cvs[o][0],y:e.cvs[o][1]},p=n.x*n.y,y=n.x*(1-n.y),v=(1-n.x)*(1-n.y),x=(1-n.x)*n.y;return s.x=v*a.x+y*l.x+x*h.x+p*c.x,s.y=v*a.y+y*l.y+x*h.y+p*c.y,s}function Ynt(t,e,i){var r=i.x,n=i.y,s=i.z||0,o,a,l,c={};for(l=0;l<3;l++)if(!(e&&l===2&&i.z===void 0))switch(l===0?(o=r,"ew".indexOf(t.axis[l])!==-1?a="x":a="y"):l===1?(o=n,"ns".indexOf(t.axis[l])!==-1?a="y":a="x"):(o=s,a="z"),t.axis[l]){case"e":c[a]=o;break;case"w":c[a]=-o;break;case"n":c[a]=o;break;case"s":c[a]=-o;break;case"u":i[a]!==void 0&&(c.z=o);break;case"d":i[a]!==void 0&&(c.z=-o);break;default:return null}return c}function Xnt(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function xhi(t){Knt(t.x),Knt(t.y)}function Knt(t){if(typeof Number.isFinite=="function"){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if(typeof t!="number"||t!==t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Shi(t,e){return(t.datum.datum_type===LN||t.datum.datum_type===NN||t.datum.datum_type===CV)&&e.datumCode!=="WGS84"||(e.datum.datum_type===LN||e.datum.datum_type===NN||e.datum.datum_type===CV)&&t.datumCode!=="WGS84"}function mue(t,e,i,r){var n;Array.isArray(i)?i=Xnt(i):i={x:i.x,y:i.y,z:i.z,m:i.m};var s=i.z!==void 0;if(xhi(i),t.datum&&e.datum&&Shi(t,e)&&(n=new LT("WGS84"),i=mue(t,n,i,r),t=n),r&&t.axis!=="enu"&&(i=Ynt(t,!1,i)),t.projName==="longlat")i={x:i.x*ny,y:i.y*ny,z:i.z||0};else if(t.to_meter&&(i={x:i.x*t.to_meter,y:i.y*t.to_meter,z:i.z||0}),i=t.inverse(i),!i)return;if(t.from_greenwich&&(i.x+=t.from_greenwich),i=bhi(t.datum,e.datum,i),!!i)return e.from_greenwich&&(i={x:i.x-e.from_greenwich,y:i.y,z:i.z||0}),e.projName==="longlat"?i={x:i.x*DT,y:i.y*DT,z:i.z||0}:(i=e.forward(i),e.to_meter&&(i={x:i.x/e.to_meter,y:i.y/e.to_meter,z:i.z||0})),r&&e.axis!=="enu"?Ynt(e,!0,i):(s||delete i.z,i)}var Jnt=LT("WGS84");function EAe(t,e,i,r){var n,s,o;return Array.isArray(i)?(n=mue(t,e,i,r)||{x:NaN,y:NaN},i.length>2?typeof t.name<"u"&&t.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"?typeof n.z=="number"?[n.x,n.y,n.z].concat(i.splice(3)):[n.x,n.y,i[2]].concat(i.splice(3)):[n.x,n.y].concat(i.splice(2)):[n.x,n.y]):(s=mue(t,e,i,r),o=Object.keys(i),o.length===2||o.forEach(function(a){if(typeof t.name<"u"&&t.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]=i[a]}),s)}function Znt(t){return t instanceof LT?t:t.oProj?t.oProj:LT(t)}function Ih(t,e,i){t=Znt(t);var r=!1,n;return typeof e>"u"?(e=t,t=Jnt,r=!0):(typeof e.x<"u"||Array.isArray(e))&&(i=e,e=t,t=Jnt,r=!0),e=Znt(e),i?EAe(t,e,i):(n={forward:function(s,o){return EAe(t,e,s,o)},inverse:function(s,o){return EAe(e,t,s,o)}},r&&(n.oProj=e),n)}var Qnt=6,est="AJSAJS",tst="AFAFAF",IV=65,b_=73,Ow=79,TX=86,EX=90;const Chi={forward:ist,inverse:Thi,toPoint:rst};function ist(t,e){return e=e||5,Ahi(Ehi({lat:t[1],lon:t[0]}),e)}function Thi(t){var e=AAe(ost(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function rst(t){var e=AAe(ost(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function IAe(t){return t*(Math.PI/180)}function nst(t){return 180*(t/Math.PI)}function Ehi(t){var e=t.lat,i=t.lon,r=6378137,n=.00669438,s=.9996,o,a,l,c,h,p,y,v=IAe(e),x=IAe(i),I,P;P=Math.floor((i+180)/6)+1,i===180&&(P=60),e>=56&&e<64&&i>=3&&i<12&&(P=32),e>=72&&e<84&&(i>=0&&i<9?P=31:i>=9&&i<21?P=33:i>=21&&i<33?P=35:i>=33&&i<42&&(P=37)),o=(P-1)*6-180+3,I=IAe(o),a=n/(1-n),l=r/Math.sqrt(1-n*Math.sin(v)*Math.sin(v)),c=Math.tan(v)*Math.tan(v),h=a*Math.cos(v)*Math.cos(v),p=Math.cos(v)*(x-I),y=r*((1-n/4-3*n*n/64-5*n*n*n/256)*v-(3*n/8+3*n*n/32+45*n*n*n/1024)*Math.sin(2*v)+(15*n*n/256+45*n*n*n/1024)*Math.sin(4*v)-35*n*n*n/3072*Math.sin(6*v));var F=s*l*(p+(1-c+h)*p*p*p/6+(5-18*c+c*c+72*h-58*a)*p*p*p*p*p/120)+5e5,k=s*(y+l*Math.tan(v)*(p*p/2+(5-c+9*h+4*h*h)*p*p*p*p/24+(61-58*c+c*c+600*h-330*a)*p*p*p*p*p*p/720));return e<0&&(k+=1e7),{northing:Math.round(k),easting:Math.round(F),zoneNumber:P,zoneLetter:Ihi(e)}}function AAe(t){var e=t.northing,i=t.easting,r=t.zoneLetter,n=t.zoneNumber;if(n<0||n>60)return null;var s=.9996,o=6378137,a=.00669438,l,c=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a)),h,p,y,v,x,I,P,F,k,j=i-5e5,V=e;r<"N"&&(V-=1e7),P=(n-1)*6-180+3,l=a/(1-a),I=V/s,F=I/(o*(1-a/4-3*a*a/64-5*a*a*a/256)),k=F+(3*c/2-27*c*c*c/32)*Math.sin(2*F)+(21*c*c/16-55*c*c*c*c/32)*Math.sin(4*F)+151*c*c*c/96*Math.sin(6*F),h=o/Math.sqrt(1-a*Math.sin(k)*Math.sin(k)),p=Math.tan(k)*Math.tan(k),y=l*Math.cos(k)*Math.cos(k),v=o*(1-a)/Math.pow(1-a*Math.sin(k)*Math.sin(k),1.5),x=j/(h*s);var Y=k-h*Math.tan(k)/v*(x*x/2-(5+3*p+10*y-4*y*y-9*l)*x*x*x*x/24+(61+90*p+298*y+45*p*p-252*l-3*y*y)*x*x*x*x*x*x/720);Y=nst(Y);var X=(x-(1+2*p+y)*x*x*x/6+(5-2*y+28*p-3*y*y+8*l+24*p*p)*x*x*x*x*x/120)/Math.cos(k);X=P+nst(X);var Z;if(t.accuracy){var ie=AAe({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});Z={top:ie.lat,right:ie.lon,bottom:Y,left:X}}else Z={lat:Y,lon:X};return Z}function Ihi(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function Ahi(t,e){var i="00000"+t.easting,r="00000"+t.northing;return t.zoneNumber+t.zoneLetter+Phi(t.easting,t.northing,t.zoneNumber)+i.substr(i.length-5,e)+r.substr(r.length-5,e)}function Phi(t,e,i){var r=sst(i),n=Math.floor(t/1e5),s=Math.floor(e/1e5)%20;return Ohi(n,s,r)}function sst(t){var e=t%Qnt;return e===0&&(e=Qnt),e}function Ohi(t,e,i){var r=i-1,n=est.charCodeAt(r),s=tst.charCodeAt(r),o=n+t-1,a=s+e,l=!1;o>EX&&(o=o-EX+IV-1,l=!0),(o===b_||nb_||(o>b_||nOw||(o>Ow||nEX&&(o=o-EX+IV-1),a>TX?(a=a-TX+IV-1,l=!0):l=!1,(a===b_||sb_||(a>b_||sOw||(a>Ow||sTX&&(a=a-TX+IV-1);var c=String.fromCharCode(o)+String.fromCharCode(a);return c}function ost(t){if(t&&t.length===0)throw"MGRSPoint coverting from nothing";for(var e=t.length,i=null,r="",n,s=0;!/[A-Z]/.test(n=t.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+t;r+=n,s++}var o=parseInt(r,10);if(s===0||s+3>e)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(s++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O")throw"MGRSPoint zone letter "+a+" not handled: "+t;i=t.substring(s,s+=2);for(var l=sst(o),c=Rhi(i.charAt(0),l),h=Mhi(i.charAt(1),l);h0&&(I=1e5/Math.pow(10,y),O=t.substring(s,s+y),v=parseFloat(O)*I,L=t.substring(s+y),S=parseFloat(L)*I),N=v+c,G=S+d,{easting:N,northing:G,zoneLetter:a,zoneNumber:o,accuracy:I}}function uhi(t,e){for(var i=Jnt.charCodeAt(e-1),r=1e5,n=!1;i!==t.charCodeAt(0);){if(i++,i===g_&&i++,i===Iw&&i++,i>IX){if(n)throw"Bad character: "+t;i=RG,n=!0}r+=1e5}return r}function chi(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i=Znt.charCodeAt(e-1),r=0,n=!1;i!==t.charCodeAt(0);){if(i++,i===g_&&i++,i===Iw&&i++,i>EX){if(n)throw"Bad character: "+t;i=RG,n=!0}r+=1e5}return r}function hhi(t){var e;switch(t){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: "+t}function MG(t,e,i){if(!(this instanceof MG))return new MG(t,e,i);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if(typeof t=="object")this.x=t.x,this.y=t.y,this.z=t.z||0;else if(typeof t=="string"&&typeof e>"u"){var r=t.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=t,this.y=e,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}MG.fromMGRS=function(t){return new MG(est(t))},MG.prototype.toMGRS=function(t){return Qnt([this.x,this.y],t)};var dhi=1,phi=.25,nst=.046875,sst=.01953125,ost=.01068115234375,fhi=.75,mhi=.46875,ghi=.013020833333333334,yhi=.007120768229166667,vhi=.3645833333333333,_hi=.005696614583333333,bhi=.3076171875;function ast(t){var e=[];e[0]=dhi-t*(phi+t*(nst+t*(sst+t*ost))),e[1]=t*(fhi-t*(nst+t*(sst+t*ost)));var i=t*t;return e[2]=i*(mhi-t*(ghi+t*yhi)),i*=t,e[3]=i*(vhi-t*_hi),e[4]=i*t*bhi,e}function vue(t,e,i,r){return i*=e,e*=e,r[0]*t-i*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))}var whi=20;function lst(t,e,i){for(var r=1/(1-e),n=t,s=whi;s;--s){var o=Math.sin(n),a=1-e*o*o;if(a=(vue(n,o,Math.cos(n),i)-t)*(a*Math.sqrt(a))*r,n-=a,Math.abs(a)ns?Math.tan(i):0,I=Math.pow(S,2),O=Math.pow(I,2);n=1-this.es*Math.pow(a,2),d=d/Math.sqrt(n);var L=vue(i,a,l,this.en);s=this.a*(this.k0*d*(1+p/6*(1-I+y+p/20*(5-18*I+O+14*y-58*I*y+p/42*(61+179*O-O*I-479*I)))))+this.x0,o=this.a*(this.k0*(L-this.ml0+a*r*d/2*(1+p/12*(5-I+9*y+4*v+p/30*(61+O-58*I+270*y-330*I*y+p/56*(1385+543*O-O*I-3111*I))))))+this.y0}else{var c=l*Math.sin(r);if(Math.abs(Math.abs(c)-1)=1){if(c-1>ns)return 93;o=0}else o=Math.acos(o);i<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return t.x=s,t.y=o,t}function Chi(t){var e,i,r,n,s=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+o/this.k0,i=lst(e,this.es,this.en),Math.abs(i)ns?Math.tan(i):0,S=this.ep2*Math.pow(y,2),I=Math.pow(S,2),O=Math.pow(v,2),L=Math.pow(O,2);e=1-this.es*Math.pow(p,2);var N=s*Math.sqrt(e)/this.k0,G=Math.pow(N,2);e=e*v,r=i-e*G/(1-this.es)*.5*(1-G/12*(5+3*O-9*S*O+S-4*I-G/30*(61+90*O-252*S*O+45*L+46*S-G/56*(1385+3633*O+4095*L+1574*L*O)))),n=ys(this.long0+N*(1-G/6*(1+2*O+S-G/20*(5+28*O+24*L+8*S*O+6*S-G/42*(61+662*O+1320*L+720*L*O))))/y)}else r=gn*CX(o),n=0;else{var a=Math.exp(s/this.k0),l=.5*(a-1/a),c=this.lat0+o/this.k0,d=Math.cos(c);e=Math.sqrt((1-Math.pow(d,2))/(1+Math.pow(l,2))),r=Math.asin(e),o<0&&(r=-r),l===0&&d===0?n=0:n=ys(Math.atan2(l,d)+this.long0)}return t.x=n,t.y=r,t}var Thi=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const _ue={init:xhi,forward:Shi,inverse:Chi,names:Thi};function ust(t){var e=Math.exp(t);return e=(e-1/e)/2,e}function H2(t,e){t=Math.abs(t),e=Math.abs(e);var i=Math.max(t,e),r=Math.min(t,e)/(i||1);return i*Math.sqrt(1+Math.pow(r,2))}function Ehi(t){var e=1+t,i=e-1;return i===0?t:t*Math.log(e)/i}function Ihi(t){var e=Math.abs(t);return e=Ehi(e*(1+e/(H2(1,e)+1))),t<0?-e:e}function CAe(t,e){for(var i=2*Math.cos(2*e),r=t.length-1,n=t[r],s=0,o;--r>=0;)o=-s+i*n+t[r],s=n,n=o;return e+o*Math.sin(2*e)}function Ahi(t,e){for(var i=2*Math.cos(e),r=t.length-1,n=t[r],s=0,o;--r>=0;)o=-s+i*n+t[r],s=n,n=o;return Math.sin(e)*o}function Phi(t){var e=Math.exp(t);return e=(e+1/e)/2,e}function cst(t,e,i){for(var r=Math.sin(e),n=Math.cos(e),s=ust(i),o=Phi(i),a=2*n*o,l=-2*r*s,c=t.length-1,d=t[c],p=0,y=0,v=0,S,I;--c>=0;)S=y,I=p,y=d,p=v,d=-S+a*y-l*p+t[c],v=-I+l*y+a*p;return a=r*o,l=n*s,[a*d-l*v,a*v+l*d]}function Ohi(){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&&(_ue.init.apply(this),this.forward=_ue.forward,this.inverse=_ue.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 t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),i=e;this.cgb[0]=e*(2+e*(-.6666666666666666+e*(-2+e*(2.577777777777778+e*(.5777777777777777+e*-4.228148148148148))))),this.cbg[0]=e*(-2+e*(.6666666666666666+e*(1.3333333333333333+e*(-1.8222222222222222+e*(.7111111111111111+e*.9824338624338624))))),i=i*e,this.cgb[1]=i*(2.3333333333333335+e*(-1.6+e*(-5.044444444444444+e*(8.584126984126984+e*2.458201058201058)))),this.cbg[1]=i*(1.6666666666666667+e*(-1.0666666666666667+e*(-1.4444444444444444+e*(2.86984126984127+e*-1.6105820105820106)))),i=i*e,this.cgb[2]=i*(3.7333333333333334+e*(-3.8857142857142857+e*(-12.019047619047619+e*26.03668430335097))),this.cbg[2]=i*(-1.7333333333333334+e*(1.619047619047619+e*(1.6+e*-4.474779541446208))),i=i*e,this.cgb[3]=i*(6.792063492063492+e*(-9.485714285714286+e*-28.188500881834216)),this.cbg[3]=i*(1.9634920634920634+e*(-2.4+e*-1.7518165784832451)),i=i*e,this.cgb[4]=i*(13.250793650793652+e*-23.22238255571589),this.cbg[4]=i*(-2.3301587301587303+e*3.5144460477793813),i=i*e,this.cgb[5]=i*27.011268237934903,this.cbg[5]=i*2.8496841430174764,i=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+i*(.25+i*(.015625+i/256))),this.utg[0]=e*(-.5+e*(.6666666666666666+e*(-.3854166666666667+e*(.002777777777777778+e*(.158203125+e*-.15905919312169312))))),this.gtu[0]=e*(.5+e*(-.6666666666666666+e*(.3125+e*(.22777777777777777+e*(-.4409722222222222+e*.20875661375661375))))),this.utg[1]=i*(-.020833333333333332+e*(-.06666666666666667+e*(.3034722222222222+e*(-.4380952380952381+e*.2890188388723545)))),this.gtu[1]=i*(.2708333333333333+e*(-.6+e*(.38680555555555557+e*(.44603174603174606+e*-1.0248393063822752)))),i=i*e,this.utg[2]=i*(-.035416666666666666+e*(.04404761904761905+e*(.046651785714285715+e*-.06138668430335097))),this.gtu[2]=i*(.25416666666666665+e*(-.7357142857142858+e*(.5603050595238095+e*.9237378747795415))),i=i*e,this.utg[3]=i*(-.02726314484126984+e*(.021825396825396824+e*.11439745921516754)),this.gtu[3]=i*(.30729786706349205+e*(-1.0654761904761905+e*.9096203979276896)),i=i*e,this.utg[4]=i*(-.02841641865079365+e*.027268468414301746),this.gtu[4]=i*(.4306671626984127+e*-1.713007555715889),i=i*e,this.utg[5]=i*-.03233083094085698,this.gtu[5]=i*.6650675310896665;var r=CAe(this.cbg,this.lat0);this.Zb=-this.Qn*(r+Ahi(this.gtu,2*r))}function Rhi(t){var e=ys(t.x-this.long0),i=t.y;i=CAe(this.cbg,i);var r=Math.sin(i),n=Math.cos(i),s=Math.sin(e),o=Math.cos(e);i=Math.atan2(r,o*n),e=Math.atan2(s*n,H2(r,n*o)),e=Ihi(Math.tan(e));var a=cst(this.gtu,2*i,2*e);i=i+a[0],e=e+a[1];var l,c;return Math.abs(e)<=2.623395162778?(l=this.a*(this.Qn*e)+this.x0,c=this.a*(this.Qn*i+this.Zb)+this.y0):(l=1/0,c=1/0),t.x=l,t.y=c,t}function Mhi(t){var e=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);i=(i-this.Zb)/this.Qn,e=e/this.Qn;var r,n;if(Math.abs(e)<=2.623395162778){var s=cst(this.utg,2*i,2*e);i=i+s[0],e=e+s[1],e=Math.atan(ust(e));var o=Math.sin(i),a=Math.cos(i),l=Math.sin(e),c=Math.cos(e);i=Math.atan2(o*c,H2(l,c*a)),e=Math.atan2(l,c*a),r=ys(e+this.long0),n=CAe(this.cgb,i)}else r=1/0,n=1/0;return t.x=r,t.y=n,t}var Dhi=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"];const bue={init:Ohi,forward:Rhi,inverse:Mhi,names:Dhi};function Fhi(t,e){if(t===void 0){if(t=Math.floor((ys(e)+Math.PI)*30/Math.PI)+1,t<0)return 0;if(t>60)return 60}return t}var Lhi="etmerc";function khi(){var t=Fhi(this.zone,this.long0);if(t===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*ty,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,bue.init.apply(this),this.forward=bue.forward,this.inverse=bue.inverse}var Nhi=["Universal Transverse Mercator System","utm"];const $hi={init:khi,names:Nhi,dependsOn:Lhi};function TAe(t,e){return Math.pow((1-t)/(1+t),e)}var Bhi=20;function Ghi(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Rc)/(Math.pow(Math.tan(.5*this.lat0+Rc),this.C)*TAe(this.e*t,this.ratexp))}function Vhi(t){var e=t.x,i=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+Rc),this.C)*TAe(this.e*Math.sin(i),this.ratexp))-gn,t.x=this.C*e,t}function Uhi(t){for(var e=1e-14,i=t.x/this.C,r=t.y,n=Math.pow(Math.tan(.5*r+Rc)/this.K,1/this.C),s=Bhi;s>0&&(r=2*Math.atan(n*TAe(this.e*Math.sin(t.y),-.5*this.e))-gn,!(Math.abs(r-t.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)<=ns&&(this.k0=.5*this.cons*LT(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/z2(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=LT(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-gn,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function Jhi(t){var e=t.x,i=t.y,r=Math.sin(i),n=Math.cos(i),s,o,a,l,c,d,p=ys(e-this.long0);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=ns&&Math.abs(i+this.lat0)<=ns?(t.x=NaN,t.y=NaN,t):this.sphere?(s=2*this.k0/(1+this.sinlat0*r+this.coslat0*n*Math.cos(p)),t.x=this.a*s*n*Math.sin(p)+this.x0,t.y=this.a*s*(this.coslat0*r-this.sinlat0*n*Math.cos(p))+this.y0,t):(o=2*Math.atan(this.ssfn_(i,r,this.e))-gn,l=Math.cos(o),a=Math.sin(o),Math.abs(this.coslat0)<=ns?(c=z2(this.e,i*this.con,this.con*r),d=2*this.a*this.k0*c/this.cons,t.x=this.x0+d*Math.sin(e-this.long0),t.y=this.y0-this.con*d*Math.cos(e-this.long0),t):(Math.abs(this.sinlat0)0?e=ys(this.long0+Math.atan2(t.x,-1*t.y)):e=ys(this.long0+Math.atan2(t.x,t.y)):e=ys(this.long0+Math.atan2(t.x*Math.sin(a),o*this.coslat0*Math.cos(a)-t.y*this.sinlat0*Math.sin(a))),t.x=e,t.y=i,t)}else if(Math.abs(this.coslat0)<=ns){if(o<=ns)return i=this.lat0,e=this.long0,t.x=e,t.y=i,t;t.x*=this.con,t.y*=this.con,r=o*this.cons/(2*this.a*this.k0),i=this.con*TX(this.e,r),e=this.con*ys(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else n=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=ns?s=this.X0:(s=Math.asin(Math.cos(n)*this.sinX0+t.y*Math.sin(n)*this.cosX0/o),e=ys(this.long0+Math.atan2(t.x*Math.sin(n),o*this.cosX0*Math.cos(n)-t.y*this.sinX0*Math.sin(n)))),i=-1*TX(this.e,Math.tan(.5*(gn+s)));return t.x=e,t.y=i,t}var Qhi=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"];const edi={init:Khi,forward:Jhi,inverse:Zhi,names:Qhi,ssfn_:Xhi};function tdi(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),i=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*i*Math.sqrt(1-s)/(1-s*Math.pow(e,2)),this.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(t),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+t/2)),c=Math.log((1+o*e)/(1-o*e));this.K=a-this.alpha*l+this.alpha*o/2*c}function idi(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),r=-this.alpha*(e+i)+this.K,n=2*(Math.atan(Math.exp(r))-Math.PI/4),s=this.alpha*(t.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 t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,t.x=this.R*o+this.x0,t}function rdi(t){for(var e=t.x-this.x0,i=t.y-this.y0,r=e/this.R,n=2*(Math.atan(Math.exp(i/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,c=s,d=-1e3,p=0;Math.abs(c-d)>1e-7;){if(++p>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(c))/2)),d=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=a,t.y=c,t}var ndi=["somerc"];const sdi={init:tdi,forward:idi,inverse:rdi,names:ndi};var DG=1e-7;function odi(t){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],i=typeof t.PROJECTION=="object"?Object.keys(t.PROJECTION)[0]:t.PROJECTION;return"no_uoff"in t||"no_off"in t||e.indexOf(i)!==-1}function adi(){var t,e,i,r,n,s,o,a,l,c,d=0,p,y=0,v=0,S=0,I=0,O=0,L=0;this.no_off=odi(this),this.no_rot="no_rot"in this;var N=!1;"alpha"in this&&(N=!0);var G=!1;if("rectified_grid_angle"in this&&(G=!0),N&&(L=this.alpha),G&&(d=this.rectified_grid_angle*ty),N||G)y=this.longc;else if(v=this.long1,I=this.lat1,S=this.long2,O=this.lat2,Math.abs(I-O)<=DG||(t=Math.abs(I))<=DG||Math.abs(t-gn)<=DG||Math.abs(Math.abs(this.lat0)-gn)<=DG||Math.abs(Math.abs(O)-gn)<=DG)throw new Error;var V=1-this.es;e=Math.sqrt(V),Math.abs(this.lat0)>ns?(a=Math.sin(this.lat0),i=Math.cos(this.lat0),t=1-this.es*a*a,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/V),this.A=this.B*this.k0*e/t,r=this.B*e/(i*Math.sqrt(t)),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(z2(this.e,this.lat0,a),this.B)):(this.B=1/e,this.A=this.k0,this.E=r=n=1),N||G?(N?(p=Math.asin(Math.sin(L)/r),G||(d=L)):(p=d,L=Math.asin(r*Math.sin(p))),this.lam0=y-Math.asin(.5*(n-1/n)*Math.tan(p))/this.B):(s=Math.pow(z2(this.e,I,Math.sin(I)),this.B),o=Math.pow(z2(this.e,O,Math.sin(O)),this.B),n=this.E/s,l=(o-s)/(o+s),c=this.E*this.E,c=(c-o*s)/(c+o*s),t=v-S,t<-Math.pi?S-=xX:t>Math.pi&&(S+=xX),this.lam0=ys(.5*(v+S)-Math.atan(c*Math.tan(.5*this.B*(v-S))/l)/this.B),p=Math.atan(2*Math.sin(this.B*ys(v-this.lam0))/(n-1/n)),d=L=Math.asin(r*Math.sin(p))),this.singam=Math.sin(p),this.cosgam=Math.cos(p),this.sinrot=Math.sin(d),this.cosrot=Math.cos(d),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(L))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*p,this.v_pole_n=this.ArB*Math.log(Math.tan(Rc-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(Rc+n))}function ldi(t){var e={},i,r,n,s,o,a,l,c;if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-gn)>ns){if(o=this.E/Math.pow(z2(this.e,t.y,Math.sin(t.y)),this.B),a=1/o,i=.5*(o-a),r=.5*(o+a),s=Math.sin(this.B*t.x),n=(i*this.singam-s*this.cosgam)/r,Math.abs(Math.abs(n)-1)0?this.v_pole_n:this.v_pole_s,l=this.ArB*t.y;return this.no_rot?(e.x=l,e.y=c):(l-=this.u_0,e.x=c*this.cosrot+l*this.sinrot,e.y=l*this.cosrot-c*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function udi(t){var e,i,r,n,s,o,a,l={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(i=t.y,e=t.x):(i=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*i),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)ns?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(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function pdi(t){var e=t.x,i=t.y;Math.abs(2*Math.abs(i)-Math.PI)<=ns&&(i=CX(i)*(gn-2*ns));var r=Math.abs(Math.abs(i)-gn),n,s;if(r>ns)n=z2(this.e,i,Math.sin(i)),s=this.a*this.f0*Math.pow(n,this.ns);else{if(r=i*this.ns,r<=0)return null;s=0}var o=this.ns*ys(e-this.long0);return t.x=this.k0*(s*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-s*Math.cos(o))+this.y0,t}function fdi(t){var e,i,r,n,s,o=(t.x-this.x0)/this.k0,a=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+a*a),i=1):(e=-Math.sqrt(o*o+a*a),i=-1);var l=0;if(e!==0&&(l=Math.atan2(i*o,i*a)),e!==0||this.ns>0){if(i=1/this.ns,r=Math.pow(e/(this.a*this.f0),i),n=TX(this.e,r),n===-9999)return null}else n=-gn;return s=ys(l/this.ns+this.long0),t.x=s,t.y=n,t}var mdi=["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 gdi={init:ddi,forward:pdi,inverse:fdi,names:mdi};function ydi(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),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 vdi(t){var e,i,r,n,s,o,a,l=t.x,c=t.y,d=ys(l-this.long0);return e=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/e)-this.s45),r=-d*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),s=Math.asin(Math.cos(i)*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),t.y=a*Math.cos(o)/1,t.x=a*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t}function _di(t){var e,i,r,n,s,o,a,l,c=t.x;t.x=t.y,t.y=c,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),s=Math.atan2(t.y,t.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)),i=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(e)),t.x=this.long0-i/this.alfa,a=e,l=0;var d=0;do t.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-t.y)<1e-10&&(l=1),a=t.y,d+=1;while(l===0&&d<15);return d>=15?null:t}var bdi=["Krovak","krovak"];const wdi={init:ydi,forward:vdi,inverse:_di,names:bdi};function hv(t,e,i,r,n){return t*n-e*Math.sin(2*n)+i*Math.sin(4*n)-r*Math.sin(6*n)}function AX(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function PX(t){return .375*t*(1+.25*t*(1+.46875*t))}function OX(t){return .05859375*t*t*(1+.75*t)}function RX(t){return t*t*t*.011393229166666666}function FG(t,e,i){var r=e*i;return t/Math.sqrt(1-r*r)}function LG(t){return Math.abs(t)1e-7?(i=t*e,(1-t*t)*(e/(1-i*i)-.5/t*Math.log((1-i)/(1+i)))):2*e}var Idi=1,Adi=2,Pdi=3,Odi=4;function Rdi(){var t=Math.abs(this.lat0);if(Math.abs(t-gn)0){var e;switch(this.qp=NM(this.e,1),this.mmf=.5/(1-this.es),this.apa=Gdi(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=NM(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 Mdi(t){var e,i,r,n,s,o,a,l,c,d,p=t.x,y=t.y;if(p=ys(p-this.long0),this.sphere){if(s=Math.sin(y),d=Math.cos(y),r=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(i=this.mode===this.EQUIT?1+d*r:1+this.sinph0*s+this.cosph0*d*r,i<=ns)return null;i=Math.sqrt(2/i),e=i*d*Math.sin(p),i*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*d*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(y+this.lat0)=0?(e=(c=Math.sqrt(o))*n,i=r*(this.mode===this.S_POLE?c:-c)):e=i=0;break}}return t.x=this.a*e+this.x0,t.y=this.a*i+this.y0,t}function Ddi(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,i=t.y/this.a,r,n,s,o,a,l,c;if(this.sphere){var d=0,p,y=0;if(p=Math.sqrt(e*e+i*i),n=p*.5,n>1)return null;switch(n=2*Math.asin(n),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(y=Math.sin(n),d=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(p)<=ns?0:Math.asin(i*y/p),e*=y,i=d*p;break;case this.OBLIQ:n=Math.abs(p)<=ns?this.lat0:Math.asin(d*this.sinph0+i*y*this.cosph0/p),e*=y*this.cosph0,i=(d-Math.sin(n)*this.sinph0)*p;break;case this.N_POLE:i=-i,n=gn-n;break;case this.S_POLE:n-=gn;break}r=i===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,i)}else{if(c=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,i*=this.dd,l=Math.sqrt(e*e+i*i),l1&&(t=t>1?1:-1),Math.asin(t)}function zdi(){Math.abs(this.lat1+this.lat2)ns?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 Hdi(t){var e=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var r=NM(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,s=this.ns0*ys(e-this.long0),o=n*Math.sin(s)+this.x0,a=this.rh-n*Math.cos(s)+this.y0;return t.x=o,t.y=a,t}function Wdi(t){var e,i,r,n,s,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1),n=0,e!==0&&(n=Math.atan2(r*t.x,r*t.y)),r=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-r*r)/(2*this.ns0)):(i=(this.c-r*r)/this.ns0,o=this.phi1z(this.e3,i)),s=ys(n/this.ns0+this.long0),t.x=s,t.y=o,t}function qdi(t,e){var i,r,n,s,o,a=$M(.5*e);if(t0||Math.abs(o)<=ns?(a=this.x0+this.a*s*i*Math.sin(r)/o,l=this.y0+this.a*s*(this.cos_p14*e-this.sin_p14*i*n)/o):(a=this.x0+this.infinity_dist*i*Math.sin(r),l=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*i*n)),t.x=a,t.y=l,t}function Zdi(t){var e,i,r,n,s,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(n=Math.atan2(e,this.rc),i=Math.sin(n),r=Math.cos(n),o=$M(r*this.sin_p14+t.y*i*this.cos_p14/e),s=Math.atan2(t.x*i,e*this.cos_p14*r-t.y*this.sin_p14*i),s=ys(this.long0+s)):(o=this.phic0,s=0),t.x=s,t.y=o,t}var Qdi=["gnom"];const epi={init:Kdi,forward:Jdi,inverse:Zdi,names:Qdi};function tpi(t,e){var i=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-i)<1e-6)return e<0?-1*gn:gn;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=t*s,n=Math.pow(1-a*a,2)/(2*o)*(e/(1-t*t)-s/(1-a*a)+.5/t*Math.log((1-a)/(1+a))),r+=n,Math.abs(n)<=1e-10)return r;return NaN}function ipi(){this.sphere||(this.k0=LT(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function rpi(t){var e=t.x,i=t.y,r,n,s=ys(e-this.long0);if(this.sphere)r=this.x0+this.a*s*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var o=NM(this.e,Math.sin(i));r=this.x0+this.a*this.k0*s,n=this.y0+this.a*o*.5/this.k0}return t.x=r,t.y=n,t}function npi(t){t.x-=this.x0,t.y-=this.y0;var e,i;return this.sphere?(e=ys(this.long0+t.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(i=tpi(this.e,2*t.y*this.k0/this.a),e=ys(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=i,t}var spi=["cea"];const opi={init:ipi,forward:rpi,inverse:npi,names:spi};function api(){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 lpi(t){var e=t.x,i=t.y,r=ys(e-this.long0),n=LG(i-this.lat0);return t.x=this.x0+this.a*r*this.rc,t.y=this.y0+this.a*n,t}function upi(t){var e=t.x,i=t.y;return t.x=ys(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=LG(this.lat0+(i-this.y0)/this.a),t}var cpi=["Equirectangular","Equidistant_Cylindrical","eqc"];const hpi={init:api,forward:lpi,inverse:upi,names:cpi};var hst=20;function dpi(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=AX(this.es),this.e1=PX(this.es),this.e2=OX(this.es),this.e3=RX(this.es),this.ml0=this.a*hv(this.e0,this.e1,this.e2,this.e3,this.lat0)}function ppi(t){var e=t.x,i=t.y,r,n,s,o=ys(e-this.long0);if(s=o*Math.sin(i),this.sphere)Math.abs(i)<=ns?(r=this.a*o,n=-1*this.a*this.lat0):(r=this.a*Math.sin(s)/Math.tan(i),n=this.a*(LG(i-this.lat0)+(1-Math.cos(s))/Math.tan(i)));else if(Math.abs(i)<=ns)r=this.a*o,n=-1*this.ml0;else{var a=FG(this.a,this.e,Math.sin(i))/Math.tan(i);r=a*Math.sin(s),n=this.a*hv(this.e0,this.e1,this.e2,this.e3,i)-this.ml0+a*(1-Math.cos(s))}return t.x=r+this.x0,t.y=n+this.y0,t}function fpi(t){var e,i,r,n,s,o,a,l,c;if(r=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=ns)e=ys(r/this.a+this.long0),i=0;else{o=this.lat0+n/this.a,a=r*r/this.a/this.a+o*o,l=o;var d;for(s=hst;s;--s)if(d=Math.tan(l),c=-1*(o*(l*d+1)-l-.5*(l*l+a)*d)/((l-o)/d-1),l+=c,Math.abs(c)<=ns){i=l;break}e=ys(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(n+this.ml0)<=ns)i=0,e=ys(this.long0+r/this.a);else{o=(this.ml0+n)/this.a,a=r*r/this.a/this.a+o*o,l=o;var p,y,v,S,I;for(s=hst;s;--s)if(I=this.e*Math.sin(l),p=Math.sqrt(1-I*I)*Math.tan(l),y=this.a*hv(this.e0,this.e1,this.e2,this.e3,l),v=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),S=y/this.a,c=(o*(p*S+1)-S-.5*p*(S*S+a))/(this.es*Math.sin(2*l)*(S*S+a-2*o*S)/(4*p)+(o-S)*(p*v-2/Math.sin(2*l))-v),l-=c,Math.abs(c)<=ns){i=l;break}p=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),e=ys(this.long0+Math.asin(r*p/this.a)/Math.sin(i))}return t.x=e,t.y=i,t}var mpi=["Polyconic","poly"];const gpi={init:dpi,forward:ppi,inverse:fpi,names:mpi};function ypi(){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 vpi(t){var e,i=t.x,r=t.y,n=r-this.lat0,s=i-this.long0,o=n/wX*1e-5,a=s,l=1,c=0;for(e=1;e<=10;e++)l=l*o,c=c+this.A[e]*l;var d=c,p=a,y=1,v=0,S,I,O=0,L=0;for(e=1;e<=6;e++)S=y*d-v*p,I=v*d+y*p,y=S,v=I,O=O+this.B_re[e]*y-this.B_im[e]*v,L=L+this.B_im[e]*y+this.B_re[e]*v;return t.x=L*this.a+this.x0,t.y=O*this.a+this.y0,t}function _pi(t){var e,i=t.x,r=t.y,n=i-this.x0,s=r-this.y0,o=s/this.a,a=n/this.a,l=1,c=0,d,p,y=0,v=0;for(e=1;e<=6;e++)d=l*o-c*a,p=c*o+l*a,l=d,c=p,y=y+this.C_re[e]*l-this.C_im[e]*c,v=v+this.C_im[e]*l+this.C_re[e]*c;for(var S=0;S.999999999999&&(i=.999999999999),e=Math.asin(i);var r=ys(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),i=(2*e+Math.sin(2*e))/Math.PI,Math.abs(i)>1&&(i=1);var n=Math.asin(i);return t.x=r,t.y=n,t}var kpi=["Mollweide","moll"];const Npi={init:Dpi,forward:Fpi,inverse:Lpi,names:kpi};function $pi(){Math.abs(this.lat1+this.lat2)=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var s=0;if(i!==0&&(s=Math.atan2(e*t.x,e*t.y)),this.sphere)return n=ys(this.long0+s/this.ns),r=LG(this.g-i/this.a),t.x=n,t.y=r,t;var o=this.g-i/this.a;return r=wue(o,this.e0,this.e1,this.e2,this.e3),n=ys(this.long0+s/this.ns),t.x=n,t.y=r,t}var Vpi=["Equidistant_Conic","eqdc"];const Upi={init:$pi,forward:Bpi,inverse:Gpi,names:Vpi};function jpi(){this.R=this.a}function zpi(t){var e=t.x,i=t.y,r=ys(e-this.long0),n,s;Math.abs(i)<=ns&&(n=this.x0+this.R*r,s=this.y0);var o=$M(2*Math.abs(i/Math.PI));(Math.abs(r)<=ns||Math.abs(Math.abs(i)-gn)<=ns)&&(n=this.x0,i>=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,c=Math.sin(o),d=Math.cos(o),p=d/(c+d-1),y=p*p,v=p*(2/c-1),S=v*v,I=Math.PI*this.R*(a*(p-S)+Math.sqrt(l*(p-S)*(p-S)-(S+l)*(y-S)))/(S+l);r<0&&(I=-I),n=this.x0+I;var O=l+p;return I=Math.PI*this.R*(v*O-a*Math.sqrt((S+l)*(l+1)-O*O))/(S+l),i>=0?s=this.y0+I:s=this.y0-I,t.x=n,t.y=s,t}function Hpi(t){var e,i,r,n,s,o,a,l,c,d,p,y,v;return t.x-=this.x0,t.y-=this.y0,p=Math.PI*this.R,r=t.x/p,n=t.y/p,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,v=n*n/l+(2*a*a*a/l/l/l-9*o*a/l/l)/27,c=(o-a*a/3/l)/l,d=2*Math.sqrt(-c/3),p=3*v/c/d,Math.abs(p)>1&&(p>=0?p=1:p=-1),y=Math.acos(p)/3,t.y>=0?i=(-d*Math.cos(y+Math.PI/3)-a/3/l)*Math.PI:i=-(-d*Math.cos(y+Math.PI/3)-a/3/l)*Math.PI,Math.abs(r)2*gn*this.a?void 0:(i=e/this.a,r=Math.sin(i),n=Math.cos(i),s=this.long0,Math.abs(e)<=ns?o=this.lat0:(o=$M(n*this.sin_p12+t.y*r*this.cos_p12/e),a=Math.abs(this.lat0)-gn,Math.abs(a)<=ns?this.lat0>=0?s=ys(this.long0+Math.atan2(t.x,-t.y)):s=ys(this.long0-Math.atan2(-t.x,t.y)):s=ys(this.long0+Math.atan2(t.x*r,e*this.cos_p12*n-t.y*this.sin_p12*r))),t.x=s,t.y=o,t)):(l=AX(this.es),c=PX(this.es),d=OX(this.es),p=RX(this.es),Math.abs(this.sin_p12-1)<=ns?(y=this.a*hv(l,c,d,p,gn),e=Math.sqrt(t.x*t.x+t.y*t.y),v=y-e,o=wue(v/this.a,l,c,d,p),s=ys(this.long0+Math.atan2(t.x,-1*t.y)),t.x=s,t.y=o,t):Math.abs(this.sin_p12+1)<=ns?(y=this.a*hv(l,c,d,p,gn),e=Math.sqrt(t.x*t.x+t.y*t.y),v=e-y,o=wue(v/this.a,l,c,d,p),s=ys(this.long0+Math.atan2(t.x,t.y)),t.x=s,t.y=o,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),O=Math.atan2(t.x,t.y),S=FG(this.a,this.e,this.sin_p12),L=Math.cos(O),N=this.e*this.cos_p12*L,G=-N*N/(1-this.es),V=3*this.es*(1-G)*this.sin_p12*this.cos_p12*L/(1-this.es),Y=e/S,X=Y-G*(1+G)*Math.pow(Y,3)/6-V*(1+3*G)*Math.pow(Y,4)/24,te=1-G*X*X/2-Y*X*X*X/6,I=Math.asin(this.sin_p12*Math.cos(X)+this.cos_p12*Math.sin(X)*L),s=ys(this.long0+Math.asin(Math.sin(O)*Math.sin(X)/Math.cos(I))),re=Math.sin(I),o=Math.atan2((re-this.es*te*this.sin_p12)*Math.tan(I),re*(1-this.es)),t.x=s,t.y=o,t))}var Jpi=["Azimuthal_Equidistant","aeqd"];const Zpi={init:Ypi,forward:Xpi,inverse:Kpi,names:Jpi};function Qpi(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function efi(t){var e,i,r,n,s,o,a,l,c=t.x,d=t.y;return r=ys(c-this.long0),e=Math.sin(d),i=Math.cos(d),n=Math.cos(r),o=this.sin_p14*e+this.cos_p14*i*n,s=1,(o>0||Math.abs(o)<=ns)&&(a=this.a*s*i*Math.sin(r),l=this.y0+this.a*s*(this.cos_p14*e-this.sin_p14*i*n)),t.x=a,t.y=l,t}function tfi(t){var e,i,r,n,s,o,a;return t.x-=this.x0,t.y-=this.y0,e=Math.sqrt(t.x*t.x+t.y*t.y),i=$M(e/this.a),r=Math.sin(i),n=Math.cos(i),o=this.long0,Math.abs(e)<=ns?(a=this.lat0,t.x=o,t.y=a,t):(a=$M(n*this.sin_p14+t.y*r*this.cos_p14/e),s=Math.abs(this.lat0)-gn,Math.abs(s)<=ns?(this.lat0>=0?o=ys(this.long0+Math.atan2(t.x,-t.y)):o=ys(this.long0-Math.atan2(-t.x,t.y)),t.x=o,t.y=a,t):(o=ys(this.long0+Math.atan2(t.x*r,e*this.cos_p14*n-t.y*this.sin_p14*r)),t.x=o,t.y=a,t))}var ifi=["ortho"];const rfi={init:Qpi,forward:efi,inverse:tfi,names:ifi};var cp={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Mc={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function nfi(){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>=gn-Rc/2?this.face=cp.TOP:this.lat0<=-(gn-Rc/2)?this.face=cp.BOTTOM:Math.abs(this.long0)<=Rc?this.face=cp.FRONT:Math.abs(this.long0)<=gn+Rc?this.face=this.long0>0?cp.RIGHT:cp.LEFT:this.face=cp.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 sfi(t){var e={x:0,y:0},i,r,n,s,o,a,l={value:0};if(t.x-=this.long0,this.es!==0?i=Math.atan(this.one_minus_f_squared*Math.tan(t.y)):i=t.y,r=t.x,this.face===cp.TOP)s=gn-i,r>=Rc&&r<=gn+Rc?(l.value=Mc.AREA_0,n=r-gn):r>gn+Rc||r<=-(gn+Rc)?(l.value=Mc.AREA_1,n=r>0?r-pf:r+pf):r>-(gn+Rc)&&r<=-Rc?(l.value=Mc.AREA_2,n=r+gn):(l.value=Mc.AREA_3,n=r);else if(this.face===cp.BOTTOM)s=gn+i,r>=Rc&&r<=gn+Rc?(l.value=Mc.AREA_0,n=-r+gn):r=-Rc?(l.value=Mc.AREA_1,n=-r):r<-Rc&&r>=-(gn+Rc)?(l.value=Mc.AREA_2,n=-r-gn):(l.value=Mc.AREA_3,n=r>0?-r+pf:-r-pf);else{var c,d,p,y,v,S,I;this.face===cp.RIGHT?r=kG(r,+gn):this.face===cp.BACK?r=kG(r,+pf):this.face===cp.LEFT&&(r=kG(r,-gn)),y=Math.sin(i),v=Math.cos(i),S=Math.sin(r),I=Math.cos(r),c=v*I,d=v*S,p=y,this.face===cp.FRONT?(s=Math.acos(c),n=xue(s,p,d,l)):this.face===cp.RIGHT?(s=Math.acos(d),n=xue(s,p,-c,l)):this.face===cp.BACK?(s=Math.acos(-c),n=xue(s,p,-d,l)):this.face===cp.LEFT?(s=Math.acos(-d),n=xue(s,p,c,l)):(s=n=0,l.value=Mc.AREA_0)}return a=Math.atan(12/pf*(n+Math.acos(Math.sin(n)*Math.cos(Rc))-gn)),o=Math.sqrt((1-Math.cos(s))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(n))))),l.value===Mc.AREA_1?a+=gn:l.value===Mc.AREA_2?a+=pf:l.value===Mc.AREA_3&&(a+=1.5*pf),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,t.x=e.x,t.y=e.y,t}function ofi(t){var e={lam:0,phi:0},i,r,n,s,o,a,l,c,d,p={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,r=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?p.value=Mc.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(p.value=Mc.AREA_1,i-=gn):t.x<0&&-t.x>=Math.abs(t.y)?(p.value=Mc.AREA_2,i=i<0?i+pf:i-pf):(p.value=Mc.AREA_3,i+=gn),d=pf/12*Math.tan(i),o=Math.sin(d)/(Math.cos(d)-1/Math.sqrt(2)),a=Math.atan(o),n=Math.cos(i),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===cp.TOP)c=Math.acos(l),e.phi=gn-c,p.value===Mc.AREA_0?e.lam=a+gn:p.value===Mc.AREA_1?e.lam=a<0?a+pf:a-pf:p.value===Mc.AREA_2?e.lam=a-gn:e.lam=a;else if(this.face===cp.BOTTOM)c=Math.acos(l),e.phi=c-gn,p.value===Mc.AREA_0?e.lam=-a+gn:p.value===Mc.AREA_1?e.lam=-a:p.value===Mc.AREA_2?e.lam=-a-gn:e.lam=a<0?-a-pf:-a+pf;else{var y,v,S;y=l,d=y*y,d>=1?S=0:S=Math.sqrt(1-d)*Math.sin(a),d+=S*S,d>=1?v=0:v=Math.sqrt(1-d),p.value===Mc.AREA_1?(d=v,v=-S,S=d):p.value===Mc.AREA_2?(v=-v,S=-S):p.value===Mc.AREA_3&&(d=v,v=S,S=-d),this.face===cp.RIGHT?(d=y,y=-v,v=d):this.face===cp.BACK?(y=-y,v=-v):this.face===cp.LEFT&&(d=y,y=v,v=-d),e.phi=Math.acos(-S)-gn,e.lam=Math.atan2(v,y),this.face===cp.RIGHT?e.lam=kG(e.lam,-gn):this.face===cp.BACK?e.lam=kG(e.lam,-pf):this.face===cp.LEFT&&(e.lam=kG(e.lam,+gn))}if(this.es!==0){var I,O,L;I=e.phi<0?1:0,O=Math.tan(e.phi),L=this.b/Math.sqrt(O*O+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-L*L)/(this.one_minus_f*L)),I&&(e.phi=-e.phi)}return e.lam+=this.long0,t.x=e.lam,t.y=e.phi,t}function xue(t,e,i,r){var n;return tRc&&n<=gn+Rc?(r.value=Mc.AREA_1,n-=gn):n>gn+Rc||n<=-(gn+Rc)?(r.value=Mc.AREA_2,n=n>=0?n-pf:n+pf):(r.value=Mc.AREA_3,n+=gn)),n}function kG(t,e){var i=t+e;return i<-pf?i+=xX:i>+pf&&(i-=xX),i}var afi=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const lfi={init:nfi,forward:sfi,inverse:ofi,names:afi};var IAe=[[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]],MX=[[-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]],dst=.8487,pst=1.3523,fst=FT/5,ufi=1/fst,NG=18,Sue=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},cfi=function(t,e){return t[1]+e*(2*t[2]+e*3*t[3])};function hfi(t,e,i,r){for(var n=e;r;--r){var s=t(n);if(n-=s,Math.abs(s)=NG&&(r=NG-1),i=FT*(i-ufi*r);var n={x:Sue(IAe[r],i)*e,y:Sue(MX[r],i)};return t.y<0&&(n.y=-n.y),n.x=n.x*this.a*dst+this.x0,n.y=n.y*this.a*pst+this.y0,n}function ffi(t){var e={x:(t.x-this.x0)/(this.a*dst),y:Math.abs(t.y-this.y0)/(this.a*pst)};if(e.y>=1)e.x/=IAe[NG][0],e.y=t.y<0?-gn:gn;else{var i=Math.floor(e.y*NG);for(i<0?i=0:i>=NG&&(i=NG-1);;)if(MX[i][0]>e.y)--i;else if(MX[i+1][0]<=e.y)++i;else break;var r=MX[i],n=5*(e.y-r[0])/(MX[i+1][0]-r[0]);n=hfi(function(s){return(Sue(r,s)-e.y)/cfi(r,s)},n,ns,100),e.x/=Sue(IAe[i],n),e.y=(5*i+n)*ty,t.y<0&&(e.y=-e.y)}return e.x=ys(e.x+this.long0),e}var mfi=["Robinson","robin"];const gfi={init:dfi,forward:pfi,inverse:ffi,names:mfi};function yfi(){this.name="geocent"}function vfi(t){var e=Vnt(t,this.es,this.a);return e}function _fi(t){var e=Unt(t,this.es,this.a,this.b);return e}var bfi=["Geocentric","geocentric","geocent","Geocent"];const wfi={init:yfi,forward:vfi,inverse:_fi,names:bfi};var m0={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},DX={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 xfi(){if(Object.keys(DX).forEach(function(i){if(typeof this[i]>"u")this[i]=DX[i].def;else{if(DX[i].num&&isNaN(this[i]))throw new Error("Invalid parameter value, must be numeric "+i+" = "+this[i]);DX[i].num&&(this[i]=parseFloat(this[i]))}DX[i].degrees&&(this[i]=this[i]*ty)}.bind(this)),Math.abs(Math.abs(this.lat0)-gn)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 t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)}function Sfi(t){t.x-=this.long0;var e=Math.sin(t.y),i=Math.cos(t.y),r=Math.cos(t.x),n,s;switch(this.mode){case m0.OBLIQ:s=this.sinph0*e+this.cosph0*i*r;break;case m0.EQUIT:s=i*r;break;case m0.S_POLE:s=-e;break;case m0.N_POLE:s=e;break}switch(s=this.pn1/(this.p-s),n=s*i*Math.sin(t.x),this.mode){case m0.OBLIQ:s*=this.cosph0*e-this.sinph0*i*r;break;case m0.EQUIT:s*=e;break;case m0.N_POLE:s*=-(i*r);break;case m0.S_POLE:s*=i*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,t.x=n*this.a,t.y=s*this.a,t}function Cfi(t){t.x/=this.a,t.y/=this.a;var e={x:t.x,y:t.y},i,r,n;n=1/(this.pn1-t.y*this.sw),i=this.pn1*t.x*n,r=this.pn1*t.y*this.cw*n,t.x=i*this.cg+r*this.sg,t.y=r*this.cg-i*this.sg;var s=H2(t.x,t.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 t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,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 Afi(t){var e=t.x,i=t.y,r,n,s,o;if(e=e-this.long0,this.shape==="ellipse"){i=Math.atan(this.radius_p2*Math.tan(i));var a=this.radius_p/H2(this.radius_p*Math.cos(i),Math.sin(i));if(n=a*Math.cos(e)*Math.cos(i),s=a*Math.sin(e)*Math.cos(i),o=a*Math.sin(i),(this.radius_g-n)*n-s*s-o*o*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;r=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(s/H2(o,r)),t.y=this.radius_g_1*Math.atan(o/r)):(t.x=this.radius_g_1*Math.atan(s/r),t.y=this.radius_g_1*Math.atan(o/H2(s,r)))}else this.shape==="sphere"&&(r=Math.cos(i),n=Math.cos(e)*r,s=Math.sin(e)*r,o=Math.sin(i),r=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(s/H2(o,r)),t.y=this.radius_g_1*Math.atan(o/r)):(t.x=this.radius_g_1*Math.atan(s/r),t.y=this.radius_g_1*Math.atan(o/H2(s,r))));return t.x=t.x*this.a,t.y=t.y*this.a,t}function Pfi(t){var e=-1,i=0,r=0,n,s,o,a;if(t.x=t.x/this.a,t.y=t.y/this.a,this.shape==="ellipse"){this.flip_axis?(r=Math.tan(t.y/this.radius_g_1),i=Math.tan(t.x/this.radius_g_1)*H2(1,r)):(i=Math.tan(t.x/this.radius_g_1),r=Math.tan(t.y/this.radius_g_1)*H2(1,i));var l=r/this.radius_p;if(n=i*i+l*l+e*e,s=2*this.radius_g*e,o=s*s-4*n*this.C,o<0)return t.x=Number.NaN,t.y=Number.NaN,t;a=(-s-Math.sqrt(o))/(2*n),e=this.radius_g+a*e,i*=a,r*=a,t.x=Math.atan2(i,e),t.y=Math.atan(r*Math.cos(t.x)/e),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if(this.shape==="sphere"){if(this.flip_axis?(r=Math.tan(t.y/this.radius_g_1),i=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+r*r)):(i=Math.tan(t.x/this.radius_g_1),r=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+i*i)),n=i*i+r*r+e*e,s=2*this.radius_g*e,o=s*s-4*n*this.C,o<0)return t.x=Number.NaN,t.y=Number.NaN,t;a=(-s-Math.sqrt(o))/(2*n),e=this.radius_g+a*e,i*=a,r*=a,t.x=Math.atan2(i,e),t.y=Math.atan(r*Math.cos(t.x)/e)}return t.x=t.x+this.long0,t}var Ofi=["Geostationary Satellite View","Geostationary_Satellite","geos"];const Rfi={init:Ifi,forward:Afi,inverse:Pfi,names:Ofi};function Mfi(t){t.Proj.projections.add(_ue),t.Proj.projections.add(bue),t.Proj.projections.add($hi),t.Proj.projections.add(Yhi),t.Proj.projections.add(edi),t.Proj.projections.add(sdi),t.Proj.projections.add(hdi),t.Proj.projections.add(gdi),t.Proj.projections.add(wdi),t.Proj.projections.add(Edi),t.Proj.projections.add(jdi),t.Proj.projections.add(Xdi),t.Proj.projections.add(epi),t.Proj.projections.add(opi),t.Proj.projections.add(hpi),t.Proj.projections.add(gpi),t.Proj.projections.add(wpi),t.Proj.projections.add(Epi),t.Proj.projections.add(Mpi),t.Proj.projections.add(Npi),t.Proj.projections.add(Upi),t.Proj.projections.add(qpi),t.Proj.projections.add(Zpi),t.Proj.projections.add(rfi),t.Proj.projections.add(lfi),t.Proj.projections.add(gfi),t.Proj.projections.add(wfi),t.Proj.projections.add(Efi),t.Proj.projections.add(Rfi)}Sh.defaultDatum="WGS84",Sh.Proj=kT,Sh.WGS84=new Sh.Proj("WGS84"),Sh.Point=MG,Sh.toPoint=Wnt,Sh.defs=cv,Sh.nadgrid=Gci,Sh.transform=yue,Sh.mgrs=ihi,Sh.version="__VERSION__",Mfi(Sh);const mst="EPSG:4326";class Dfi{espgWorker;constructor(){this.espgWorker=this.defaultEpsgLookup,Sh.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"),Sh.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"),Sh.defs("EPSG:54004","+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"),Sh.defs("EPSG:102100",Sh.defs("EPSG:3857")),Sh.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"),Sh.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 i=e<10?`0${e}`:e;Sh.defs(`EPSG:326${i}`,`+proj=utm +zone=${e} +ellps=WGS84 +datum=WGS84 +units=m +no_defs`),e++}}addProjection(e,i){e=typeof e=="number"?`EPSG:${e}`:e,Sh.defs(e,i)}defaultEpsgLookup(e){const i=/urn:ogc:def:crs:EPSG::(\d+)/,r=/EPSG:(\d+)/,n=String(e).match(i)||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`;ir(a,{responseType:"text"}).then(d=>{d.data?s(d.data):o()},d=>{o(d)})})}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 i,r="";if(e.wkt)return!0;try{i=this.normalizeProj(e)}catch{return!1}e.latestWkid&&(r=this.normalizeProj(e.latestWkid));const n=(l,c)=>{l!==c&&Sh.defs(c,Sh.defs(l))};if(Sh.defs(i))return!0;if(r&&Sh.defs(r))return n(r,i),!0;const s=async l=>{try{const c=await this.epsgLookup(l);return c===null||c===""?!1:(Sh.defs(l,c),!0)}catch{return!1}};return await(r?s(r):Promise.resolve(!1))?(n(r,i),!0):s(i)}async checkProjBomber(e){if(e.length>0){const i=e.pop();if(await this.checkProj(i))return this.checkProjBomber(e);throw console.error("Unable to parse or locate projection information for this item:",i),new Error("Could not find projection information, see console for details")}}async projectGeoJson(e,i,r){let n=this.normalizeProj(i),s=this.normalizeProj(r);if(!n&&e.crs&&e.crs.type==="name"&&(n=nu.parseGeoJsonCrs(e.crs)),n||(n=mst),s||(s=mst),s===n)return e;await this.checkProjBomber([n,s]);const o=Sh(n,s).forward;return tci.Tools.applyConverter(e,o)}async projectGeometry(e,i){if(i.type===Rl.EXTENT)return this.projectExtent(e,i);await this.checkProjBomber([e,i.sr]);const r=i.toGeoJSON(),n=await this.projectGeoJson(r,this.normalizeProj(i.sr),this.normalizeProj(e)),s=vN.geom.geomGeoJsonToRamp(n,i.id);return s.sr=nu.parseSR(e),s}async projectExtent(e,i){const r=(I,O,L)=>{if(L===0)return[I,O];const N=[(I[0]+O[0])/2,(I[1]+O[1])/2];if(L===1)return[I,N,O];if(L>1){const G=r(I,N,L-1),V=r(N,O,L-1);return G.concat(V.slice(1))}return[[]]},n=i.toPolygonArray().pop()||[];let s=[];[0,1,2,3].map(I=>r(n[I],n[I+1],3).slice(1)).forEach(I=>s=s.concat(I));const o=new ey("warpy",[s],i.sr,!0),a=await this.projectGeometry(e,o),l=a.toArray().pop()||[],c=l.map(I=>I[0]),d=l.map(I=>I[1]),p=Math.min.apply(null,c),y=Math.max.apply(null,c),v=Math.min.apply(null,d),S=Math.max.apply(null,d);return Lp.fromParams(i.id+"_projected",p,v,y,S,a.sr)}}class Ffi{DEFAULT_MERCATOR="DEFAULT_ESRI_World_AuxMerc_3857";DEFAULT_LAMBERT="DEFAULT_NRCAN_Lambert_3978";proj;geom;sharedUtils;constructor(){this.proj=new Dfi,this.geom=new $ui,this.sharedUtils=new Qui}defaultTileSchemas(){return[this.DEFAULT_LAMBERT,this.DEFAULT_MERCATOR]}defaultLODs(e){const i=r=>r.map(n=>({level:n[0],resolution:n[1],scale:n[2]}));if(e===this.DEFAULT_LAMBERT)return i([[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 i([[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 Np{$iApi;get $vApp(){return this.$iApi.$vApp}get $element(){return this.$iApi.$element}constructor(e){this.$iApi=e}}function Lfi(t){return typeof t=="function"&&t.render&&typeof t.render=="function"}function kfi(t){const e=["data","props","propsData","computed","methods","watch","template","render","components","model"];return typeof t=="object"&&!t.functional&&e.some(i=>t[i]!==void 0)}function Nfi(t){return typeof t=="object"&&t.default!==void 0}var AAe={},$fi={get exports(){return AAe},set exports(t){AAe=t}};function PAe(){}PAe.prototype={on:function(t,e,i){var r=this.e||(this.e={});return(r[t]||(r[t]=[])).push({fn:e,ctx:i}),this},once:function(t,e,i){var r=this;function n(){r.off(t,n),e.apply(i,arguments)}return n._=e,this.on(t,n,i)},emit:function(t){var e=[].slice.call(arguments,1),i=((this.e||(this.e={}))[t]||[]).slice(),r=0,n=i.length;for(r;r!!i[n.toLowerCase()]:n=>!!i[n]}const Gfi=y_("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt");function tb(t){if(vs(t)){const e={};for(let i=0;i{if(i){const r=i.split(Ufi);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function fs(t){let e="";if(ol(t))e=t;else if(vs(t))for(let i=0;iBM(i,e))}const gr=t=>ol(t)?t:t==null?"":vs(t)||oh(t)&&(t.toString===wst||!Fa(t.toString))?JSON.stringify(t,_st,2):String(t),_st=(t,e)=>e&&e.__v_isRef?_st(t,e.value):BG(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((i,[r,n])=>(i[`${r} =>`]=n,i),{})}:Lk(e)?{[`Set(${e.size})`]:[...e.values()]}:oh(e)&&!vs(e)&&!xst(e)?String(e):e,Yc={},$G=[],dv=()=>{},Tue=()=>!1,Zfi=/^on[^a-z]/,Fk=t=>Zfi.test(t),RAe=t=>t.startsWith("onUpdate:"),xc=Object.assign,MAe=(t,e)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)},Qfi=Object.prototype.hasOwnProperty,Yu=(t,e)=>Qfi.call(t,e),vs=Array.isArray,BG=t=>GG(t)==="[object Map]",Lk=t=>GG(t)==="[object Set]",bst=t=>GG(t)==="[object Date]",emi=t=>GG(t)==="[object RegExp]",Fa=t=>typeof t=="function",ol=t=>typeof t=="string",GM=t=>typeof t=="symbol",oh=t=>t!==null&&typeof t=="object",DAe=t=>oh(t)&&Fa(t.then)&&Fa(t.catch),wst=Object.prototype.toString,GG=t=>wst.call(t),tmi=t=>GG(t).slice(8,-1),xst=t=>GG(t)==="[object Object]",FAe=t=>ol(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,kk=y_(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),imi=y_("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Eue=t=>{const e=Object.create(null);return i=>e[i]||(e[i]=t(i))},rmi=/-(\w)/g,Lm=Eue(t=>t.replace(rmi,(e,i)=>i?i.toUpperCase():"")),nmi=/\B([A-Z])/g,ib=Eue(t=>t.replace(nmi,"-$1").toLowerCase()),VM=Eue(t=>t.charAt(0).toUpperCase()+t.slice(1)),Nk=Eue(t=>t?`on${VM(t)}`:""),VG=(t,e)=>!Object.is(t,e),UG=(t,e)=>{for(let i=0;i{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:i})},Aue=t=>{const e=parseFloat(t);return isNaN(e)?t:e},Pue=t=>{const e=ol(t)?Number(t):NaN;return isNaN(e)?t:e};let Sst;const smi=()=>Sst||(Sst=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});let rb;class Oue{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=rb,!e&&rb&&(this.index=(rb.scopes||(rb.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const i=rb;try{return rb=this,e()}finally{rb=i}}}on(){rb=this}off(){rb=this.parent}stop(e){if(this._active){let i,r;for(i=0,r=this.effects.length;i{const e=new Set(t);return e.w=0,e.n=0,e},Tst=t=>(t.w&UM)>0,Est=t=>(t.n&UM)>0,omi=({deps:t})=>{if(t.length)for(let e=0;e{const{deps:e}=t;if(e.length){let i=0;for(let r=0;r{(d==="length"||d>=l)&&a.push(c)})}else switch(i!==void 0&&a.push(o.get(i)),e){case"add":vs(t)?FAe(i)&&a.push(o.get("length")):(a.push(o.get($k)),BG(t)&&a.push(o.get($Ae)));break;case"delete":vs(t)||(a.push(o.get($k)),BG(t)&&a.push(o.get($Ae)));break;case"set":BG(t)&&a.push(o.get($k));break}if(a.length===1)a[0]&&BAe(a[0]);else{const l=[];for(const c of a)c&&l.push(...c);BAe(kAe(l))}}function BAe(t,e){const i=vs(t)?t:[...t];for(const r of i)r.computed&&Mst(r);for(const r of i)r.computed||Mst(r)}function Mst(t,e){(t!==W2||t.allowRecurse)&&(t.scheduler?t.scheduler():t.run())}function lmi(t,e){var i;return(i=Mue.get(t))===null||i===void 0?void 0:i.get(e)}const umi=y_("__proto__,__v_isRef,__isVue"),Dst=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(GM)),cmi=Due(),hmi=Due(!1,!0),dmi=Due(!0),pmi=Due(!0,!0),Fst=fmi();function fmi(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...i){const r=Hs(this);for(let s=0,o=this.length;s{t[e]=function(...i){zG();const r=Hs(this)[e].apply(this,i);return HG(),r}}),t}function mmi(t){const e=Hs(this);return v_(e,"has",t),e.hasOwnProperty(t)}function Due(t=!1,e=!1){return function(r,n,s){if(n==="__v_isReactive")return!t;if(n==="__v_isReadonly")return t;if(n==="__v_isShallow")return e;if(n==="__v_raw"&&s===(t?e?Hst:zst:e?jst:Ust).get(r))return r;const o=vs(r);if(!t){if(o&&Yu(Fst,n))return Reflect.get(Fst,n,s);if(n==="hasOwnProperty")return mmi}const a=Reflect.get(r,n,s);return(GM(n)?Dst.has(n):umi(n))||(t||v_(r,"get",n),e)?a:lc(a)?o&&FAe(n)?a:a.value:oh(a)?t?Vue(a):Tl(a):a}}const gmi=Lst(),ymi=Lst(!0);function Lst(t=!1){return function(i,r,n,s){let o=i[r];if(HM(o)&&lc(o)&&!lc(n))return!1;if(!t&&(!WG(n)&&!HM(n)&&(o=Hs(o),n=Hs(n)),!vs(i)&&lc(o)&&!lc(n)))return o.value=n,!0;const a=vs(i)&&FAe(r)?Number(r)t,Fue=t=>Reflect.getPrototypeOf(t);function Lue(t,e,i=!1,r=!1){t=t.__v_raw;const n=Hs(t),s=Hs(e);i||(e!==s&&v_(n,"get",e),v_(n,"get",s));const{has:o}=Fue(n),a=r?GAe:i?UAe:kX;if(o.call(n,e))return a(t.get(e));if(o.call(n,s))return a(t.get(s));t!==n&&t.get(e)}function kue(t,e=!1){const i=this.__v_raw,r=Hs(i),n=Hs(t);return e||(t!==n&&v_(r,"has",t),v_(r,"has",n)),t===n?i.has(t):i.has(t)||i.has(n)}function Nue(t,e=!1){return t=t.__v_raw,!e&&v_(Hs(t),"iterate",$k),Reflect.get(t,"size",t)}function $st(t){t=Hs(t);const e=Hs(this);return Fue(e).has.call(e,t)||(e.add(t),xP(e,"add",t,t)),this}function Bst(t,e){e=Hs(e);const i=Hs(this),{has:r,get:n}=Fue(i);let s=r.call(i,t);s||(t=Hs(t),s=r.call(i,t));const o=n.call(i,t);return i.set(t,e),s?VG(e,o)&&xP(i,"set",t,e):xP(i,"add",t,e),this}function Gst(t){const e=Hs(this),{has:i,get:r}=Fue(e);let n=i.call(e,t);n||(t=Hs(t),n=i.call(e,t)),r&&r.call(e,t);const s=e.delete(t);return n&&xP(e,"delete",t,void 0),s}function Vst(){const t=Hs(this),e=t.size!==0,i=t.clear();return e&&xP(t,"clear",void 0,void 0),i}function $ue(t,e){return function(r,n){const s=this,o=s.__v_raw,a=Hs(o),l=e?GAe:t?UAe:kX;return!t&&v_(a,"iterate",$k),o.forEach((c,d)=>r.call(n,l(c),l(d),s))}}function Bue(t,e,i){return function(...r){const n=this.__v_raw,s=Hs(n),o=BG(s),a=t==="entries"||t===Symbol.iterator&&o,l=t==="keys"&&o,c=n[t](...r),d=i?GAe:e?UAe:kX;return!e&&v_(s,"iterate",l?$Ae:$k),{next(){const{value:p,done:y}=c.next();return y?{value:p,done:y}:{value:a?[d(p[0]),d(p[1])]:d(p),done:y}},[Symbol.iterator](){return this}}}}function zM(t){return function(...e){return t==="delete"?!1:this}}function Smi(){const t={get(s){return Lue(this,s)},get size(){return Nue(this)},has:kue,add:$st,set:Bst,delete:Gst,clear:Vst,forEach:$ue(!1,!1)},e={get(s){return Lue(this,s,!1,!0)},get size(){return Nue(this)},has:kue,add:$st,set:Bst,delete:Gst,clear:Vst,forEach:$ue(!1,!0)},i={get(s){return Lue(this,s,!0)},get size(){return Nue(this,!0)},has(s){return kue.call(this,s,!0)},add:zM("add"),set:zM("set"),delete:zM("delete"),clear:zM("clear"),forEach:$ue(!0,!1)},r={get(s){return Lue(this,s,!0,!0)},get size(){return Nue(this,!0)},has(s){return kue.call(this,s,!0)},add:zM("add"),set:zM("set"),delete:zM("delete"),clear:zM("clear"),forEach:$ue(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(s=>{t[s]=Bue(s,!1,!1),i[s]=Bue(s,!0,!1),e[s]=Bue(s,!1,!0),r[s]=Bue(s,!0,!0)}),[t,i,e,r]}const[Cmi,Tmi,Emi,Imi]=Smi();function Gue(t,e){const i=e?t?Imi:Emi:t?Tmi:Cmi;return(r,n,s)=>n==="__v_isReactive"?!t:n==="__v_isReadonly"?t:n==="__v_raw"?r:Reflect.get(Yu(i,n)&&n in r?i:r,n,s)}const Ami={get:Gue(!1,!1)},Pmi={get:Gue(!1,!0)},Omi={get:Gue(!0,!1)},Rmi={get:Gue(!0,!0)},Ust=new WeakMap,jst=new WeakMap,zst=new WeakMap,Hst=new WeakMap;function Mmi(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Dmi(t){return t.__v_skip||!Object.isExtensible(t)?0:Mmi(tmi(t))}function Tl(t){return HM(t)?t:Uue(t,!1,kst,Ami,Ust)}function VAe(t){return Uue(t,!1,wmi,Pmi,jst)}function Vue(t){return Uue(t,!0,Nst,Omi,zst)}function Wst(t){return Uue(t,!0,xmi,Rmi,Hst)}function Uue(t,e,i,r,n){if(!oh(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=n.get(t);if(s)return s;const o=Dmi(t);if(o===0)return t;const a=new Proxy(t,o===2?r:i);return n.set(t,a),a}function Aw(t){return HM(t)?Aw(t.__v_raw):!!(t&&t.__v_isReactive)}function HM(t){return!!(t&&t.__v_isReadonly)}function WG(t){return!!(t&&t.__v_isShallow)}function jue(t){return Aw(t)||HM(t)}function Hs(t){const e=t&&t.__v_raw;return e?Hs(e):t}function Ho(t){return Iue(t,"__v_skip",!0),t}const kX=t=>oh(t)?Tl(t):t,UAe=t=>oh(t)?Vue(t):t;function jAe(t){jM&&W2&&(t=Hs(t),Rst(t.dep||(t.dep=kAe())))}function zue(t,e){t=Hs(t);const i=t.dep;i&&BAe(i)}function lc(t){return!!(t&&t.__v_isRef===!0)}function Pi(t){return qst(t,!1)}function zAe(t){return qst(t,!0)}function qst(t,e){return lc(t)?t:new Fmi(t,e)}class Fmi{constructor(e,i){this.__v_isShallow=i,this.dep=void 0,this.__v_isRef=!0,this._rawValue=i?e:Hs(e),this._value=i?e:kX(e)}get value(){return jAe(this),this._value}set value(e){const i=this.__v_isShallow||WG(e)||HM(e);e=i?e:Hs(e),VG(e,this._rawValue)&&(this._rawValue=e,this._value=i?e:kX(e),zue(this))}}function Yst(t){zue(t)}function Qt(t){return lc(t)?t.value:t}const Lmi={get:(t,e,i)=>Qt(Reflect.get(t,e,i)),set:(t,e,i,r)=>{const n=t[e];return lc(n)&&!lc(i)?(n.value=i,!0):Reflect.set(t,e,i,r)}};function Hue(t){return Aw(t)?t:new Proxy(t,Lmi)}class kmi{constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:i,set:r}=e(()=>jAe(this),()=>zue(this));this._get=i,this._set=r}get value(){return this._get()}set value(e){this._set(e)}}function Xst(t){return new kmi(t)}function Bk(t){const e=vs(t)?new Array(t.length):{};for(const i in t)e[i]=Wue(t,i);return e}class Nmi{constructor(e,i,r){this._object=e,this._key=i,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 lmi(Hs(this._object),this._key)}}function Wue(t,e,i){const r=t[e];return lc(r)?r:new Nmi(t,e,i)}var Kst;class $mi{constructor(e,i,r,n){this._setter=i,this.dep=void 0,this.__v_isRef=!0,this[Kst]=!1,this._dirty=!0,this.effect=new jG(e,()=>{this._dirty||(this._dirty=!0,zue(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!n,this.__v_isReadonly=r}get value(){const e=Hs(this);return jAe(e),(e._dirty||!e._cacheable)&&(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}Kst="__v_isReadonly";function Bmi(t,e,i=!1){let r,n;const s=Fa(t);return s?(r=t,n=dv):(r=t.get,n=t.set),new $mi(r,n,s||!n,i)}function Jst(t,...e){}function Zst(t,e){}function NT(t,e,i,r){let n;try{n=r?t(...r):t()}catch(s){WM(s,e,i)}return n}function __(t,e,i,r){if(Fa(t)){const s=NT(t,e,i,r);return s&&DAe(s)&&s.catch(o=>{WM(o,e,i)}),s}const n=[];for(let s=0;s>>1;$X(g0[r])$T&&g0.splice(e,1)}function Yue(t){vs(t)?qG.push(...t):(!SP||!SP.includes(t,t.allowRecurse?Gk+1:Gk))&&qG.push(t),eot()}function tot(t,e=NX?$T+1:0){for(;e$X(i)-$X(r)),Gk=0;Gkt.id==null?1/0:t.id,jmi=(t,e)=>{const i=$X(t)-$X(e);if(i===0){if(t.pre&&!e.pre)return-1;if(e.pre&&!t.pre)return 1}return i};function iot(t){HAe=!1,NX=!0,g0.sort(jmi);const e=dv;try{for($T=0;$TVk.emit(n,...s)),Kue=[]):typeof window<"u"&&window.HTMLElement&&!(!((r=(i=window.navigator)===null||i===void 0?void 0:i.userAgent)===null||r===void 0)&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{qAe(s,e)}),setTimeout(()=>{Vk||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Kue=[])},3e3)):Kue=[]}function zmi(t,e,...i){if(t.isUnmounted)return;const r=t.vnode.props||Yc;let n=i;const s=e.startsWith("update:"),o=s&&e.slice(7);if(o&&o in r){const d=`${o==="modelValue"?"model":o}Modifiers`,{number:p,trim:y}=r[d]||Yc;y&&(n=i.map(v=>ol(v)?v.trim():v)),p&&(n=i.map(Aue))}let a,l=r[a=Nk(e)]||r[a=Nk(Lm(e))];!l&&s&&(l=r[a=Nk(ib(e))]),l&&__(l,t,6,n);const c=r[a+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,__(c,t,6,n)}}function rot(t,e,i=!1){const r=e.emitsCache,n=r.get(t);if(n!==void 0)return n;const s=t.emits;let o={},a=!1;if(!Fa(t)){const l=c=>{const d=rot(c,e,!0);d&&(a=!0,xc(o,d))};!i&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!s&&!a?(oh(t)&&r.set(t,null),null):(vs(s)?s.forEach(l=>o[l]=null):xc(o,s),oh(t)&&r.set(t,o),o)}function Jue(t,e){return!t||!Fk(e)?!1:(e=e.slice(2).replace(/Once$/,""),Yu(t,e[0].toLowerCase()+e.slice(1))||Yu(t,ib(e))||Yu(t,e))}let ry=null,Zue=null;function BX(t){const e=ry;return ry=t,Zue=t&&t.type.__scopeId||null,e}function Xc(t){Zue=t}function Kc(){Zue=null}const not=t=>yn;function yn(t,e=ry,i){if(!e||t._n)return t;const r=(...n)=>{r._d&&dce(-1);const s=BX(e);let o;try{o=t(...n)}finally{BX(s),r._d&&dce(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function ODr(){}function Que(t){const{type:e,vnode:i,proxy:r,withProxy:n,props:s,propsOptions:[o],slots:a,attrs:l,emit:c,render:d,renderCache:p,data:y,setupState:v,ctx:S,inheritAttrs:I}=t;let O,L;const N=BX(t);try{if(i.shapeFlag&4){const V=n||r;O=nb(d.call(V,V,p,s,v,y,S)),L=l}else{const V=e;O=nb(V.length>1?V(s,{attrs:l,slots:a,emit:c}):V(s,null)),L=e.props?l:Wmi(l)}}catch(V){YX.length=0,WM(V,t,1),O=Rn(sy)}let G=O;if(L&&I!==!1){const V=Object.keys(L),{shapeFlag:Y}=G;V.length&&Y&7&&(o&&V.some(RAe)&&(L=qmi(L,o)),G=Y2(G,L))}return i.dirs&&(G=Y2(G),G.dirs=G.dirs?G.dirs.concat(i.dirs):i.dirs),i.transition&&(G.transition=i.transition),O=G,BX(N),O}function Hmi(t){let e;for(let i=0;i{let e;for(const i in t)(i==="class"||i==="style"||Fk(i))&&((e||(e={}))[i]=t[i]);return e},qmi=(t,e)=>{const i={};for(const r in t)(!RAe(r)||!(r.slice(9)in e))&&(i[r]=t[r]);return i};function Ymi(t,e,i){const{props:r,children:n,component:s}=t,{props:o,children:a,patchFlag:l}=e,c=s.emitsOptions;if(e.dirs||e.transition)return!0;if(i&&l>=0){if(l&1024)return!0;if(l&16)return r?sot(r,o,c):!!o;if(l&8){const d=e.dynamicProps;for(let p=0;pt.__isSuspense,aot={name:"Suspense",__isSuspense:!0,process(t,e,i,r,n,s,o,a,l,c){t==null?Xmi(e,i,r,n,s,o,a,l,c):Kmi(t,e,i,r,n,o,a,l,c)},hydrate:Jmi,create:XAe,normalize:Zmi};function GX(t,e){const i=t.props&&t.props[e];Fa(i)&&i()}function Xmi(t,e,i,r,n,s,o,a,l){const{p:c,o:{createElement:d}}=l,p=d("div"),y=t.suspense=XAe(t,n,r,e,p,i,s,o,a,l);c(null,y.pendingBranch=t.ssContent,p,null,r,y,s,o),y.deps>0?(GX(t,"onPending"),GX(t,"onFallback"),c(null,t.ssFallback,e,i,r,null,s,o),YG(y,t.ssFallback)):y.resolve()}function Kmi(t,e,i,r,n,s,o,a,{p:l,um:c,o:{createElement:d}}){const p=e.suspense=t.suspense;p.vnode=e,e.el=t.el;const y=e.ssContent,v=e.ssFallback,{activeBranch:S,pendingBranch:I,isInFallback:O,isHydrating:L}=p;if(I)p.pendingBranch=y,q2(y,I)?(l(I,y,p.hiddenContainer,null,n,p,s,o,a),p.deps<=0?p.resolve():O&&(l(S,v,i,r,n,null,s,o,a),YG(p,v))):(p.pendingId++,L?(p.isHydrating=!1,p.activeBranch=I):c(I,n,p),p.deps=0,p.effects.length=0,p.hiddenContainer=d("div"),O?(l(null,y,p.hiddenContainer,null,n,p,s,o,a),p.deps<=0?p.resolve():(l(S,v,i,r,n,null,s,o,a),YG(p,v))):S&&q2(y,S)?(l(S,y,i,r,n,p,s,o,a),p.resolve(!0)):(l(null,y,p.hiddenContainer,null,n,p,s,o,a),p.deps<=0&&p.resolve()));else if(S&&q2(y,S))l(S,y,i,r,n,p,s,o,a),YG(p,y);else if(GX(e,"onPending"),p.pendingBranch=y,p.pendingId++,l(null,y,p.hiddenContainer,null,n,p,s,o,a),p.deps<=0)p.resolve();else{const{timeout:N,pendingId:G}=p;N>0?setTimeout(()=>{p.pendingId===G&&p.fallback(v)},N):N===0&&p.fallback(v)}}function XAe(t,e,i,r,n,s,o,a,l,c,d=!1){const{p,m:y,um:v,n:S,o:{parentNode:I,remove:O}}=c,L=t.props?Pue(t.props.timeout):void 0,N={vnode:t,parent:e,parentComponent:i,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:d,isUnmounted:!1,effects:[],resolve(G=!1){const{vnode:V,activeBranch:Y,pendingBranch:X,pendingId:te,effects:re,parentComponent:fe,container:ge}=N;if(N.isHydrating)N.isHydrating=!1;else if(!G){const ke=Y&&X.transition&&X.transition.mode==="out-in";ke&&(Y.transition.afterLeave=()=>{te===N.pendingId&&y(X,ge,Ne,0)});let{anchor:Ne}=N;Y&&(Ne=S(Y),v(Y,fe,N,!0)),ke||y(X,ge,Ne,0)}YG(N,X),N.pendingBranch=null,N.isInFallback=!1;let _e=N.parent,Ie=!1;for(;_e;){if(_e.pendingBranch){_e.effects.push(...re),Ie=!0;break}_e=_e.parent}Ie||Yue(re),N.effects=[],GX(V,"onResolve")},fallback(G){if(!N.pendingBranch)return;const{vnode:V,activeBranch:Y,parentComponent:X,container:te,isSVG:re}=N;GX(V,"onFallback");const fe=S(Y),ge=()=>{N.isInFallback&&(p(null,G,te,fe,X,null,re,a,l),YG(N,G))},_e=G.transition&&G.transition.mode==="out-in";_e&&(Y.transition.afterLeave=ge),N.isInFallback=!0,v(Y,X,null,!0),_e||ge()},move(G,V,Y){N.activeBranch&&y(N.activeBranch,G,V,Y),N.container=G},next(){return N.activeBranch&&S(N.activeBranch)},registerDep(G,V){const Y=!!N.pendingBranch;Y&&N.deps++;const X=G.vnode.el;G.asyncDep.catch(te=>{WM(te,G,0)}).then(te=>{if(G.isUnmounted||N.isUnmounted||N.pendingId!==G.suspenseId)return;G.asyncResolved=!0;const{vnode:re}=G;xPe(G,te,!1),X&&(re.el=X);const fe=!X&&G.subTree.el;V(G,re,I(X||G.subTree.el),X?null:S(G.subTree),N,o,l),fe&&O(fe),YAe(G,re.el),Y&&--N.deps===0&&N.resolve()})},unmount(G,V){N.isUnmounted=!0,N.activeBranch&&v(N.activeBranch,i,G,V),N.pendingBranch&&v(N.pendingBranch,i,G,V)}};return N}function Jmi(t,e,i,r,n,s,o,a,l){const c=e.suspense=XAe(e,r,i,t.parentNode,document.createElement("div"),null,n,s,o,a,!0),d=l(t,c.pendingBranch=e.ssContent,i,c,s,o);return c.deps===0&&c.resolve(),d}function Zmi(t){const{shapeFlag:e,children:i}=t,r=e&32;t.ssContent=lot(r?i.default:i),t.ssFallback=r?lot(i.fallback):Rn(sy)}function lot(t){let e;if(Fa(t)){const i=Xk&&t._c;i&&(t._d=!1,Kt()),t=t(),i&&(t._d=!0,e=b_,Bot())}return vs(t)&&(t=Hmi(t)),t=nb(t),e&&!t.dynamicChildren&&(t.dynamicChildren=e.filter(i=>i!==t)),t}function uot(t,e){e&&e.pendingBranch?vs(t)?e.effects.push(...t):e.effects.push(t):Yue(t)}function YG(t,e){t.activeBranch=e;const{vnode:i,parentComponent:r}=t,n=i.el=e.el;r&&r.subTree===i&&(r.vnode.el=n,YAe(r,n))}function ece(t,e){if($p){let i=$p.provides;const r=$p.parent&&$p.parent.provides;r===i&&(i=$p.provides=Object.create(r)),i[t]=e}}function Qs(t,e,i=!1){const r=$p||ry;if(r){const n=r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides;if(n&&t in n)return n[t];if(arguments.length>1)return i&&Fa(e)?e.call(r.proxy):e}}function cot(t,e){return VX(t,null,e)}function KAe(t,e){return VX(t,null,{flush:"post"})}function hot(t,e){return VX(t,null,{flush:"sync"})}const tce={};function Sc(t,e,i){return VX(t,e,i)}function VX(t,e,{immediate:i,deep:r,flush:n,onTrack:s,onTrigger:o}=Yc){const a=Rue()===$p?.scope?$p:null;let l,c=!1,d=!1;if(lc(t)?(l=()=>t.value,c=WG(t)):Aw(t)?(l=()=>t,r=!0):vs(t)?(d=!0,c=t.some(G=>Aw(G)||WG(G)),l=()=>t.map(G=>{if(lc(G))return G.value;if(Aw(G))return Uk(G);if(Fa(G))return NT(G,a,2)})):Fa(t)?e?l=()=>NT(t,a,2):l=()=>{if(!(a&&a.isUnmounted))return p&&p(),__(t,a,3,[y])}:l=dv,e&&r){const G=l;l=()=>Uk(G())}let p,y=G=>{p=L.onStop=()=>{NT(G,a,4)}},v;if(XG)if(y=dv,e?i&&__(e,a,3,[l(),d?[]:void 0,y]):l(),n==="sync"){const G=IPe();v=G.__watcherHandles||(G.__watcherHandles=[])}else return dv;let S=d?new Array(t.length).fill(tce):tce;const I=()=>{if(L.active)if(e){const G=L.run();(r||c||(d?G.some((V,Y)=>VG(V,S[Y])):VG(G,S)))&&(p&&p(),__(e,a,3,[G,S===tce?void 0:d&&S[0]===tce?[]:S,y]),S=G)}else L.run()};I.allowRecurse=!!e;let O;n==="sync"?O=I:n==="post"?O=()=>ny(I,a&&a.suspense):(I.pre=!0,a&&(I.id=a.uid),O=()=>que(I));const L=new jG(l,O);e?i?I():S=L.run():n==="post"?ny(L.run.bind(L),a&&a.suspense):L.run();const N=()=>{L.stop(),a&&a.scope&&MAe(a.scope.effects,L)};return v&&v.push(N),N}function Qmi(t,e,i){const r=this.proxy,n=ol(t)?t.includes(".")?dot(r,t):()=>r[t]:t.bind(r,r);let s;Fa(e)?s=e:(s=e.handler,i=e);const o=$p;JM(this);const a=VX(n,s.bind(r),i);return o?JM(o):ZM(),a}function dot(t,e){const i=e.split(".");return()=>{let r=t;for(let n=0;n{Uk(i,e)});else if(xst(t))for(const i in t)Uk(t[i],e);return t}function ice(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return al(()=>{t.isMounted=!0}),su(()=>{t.isUnmounting=!0}),t}const Pw=[Function,Array],rce={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Pw,onEnter:Pw,onAfterEnter:Pw,onEnterCancelled:Pw,onBeforeLeave:Pw,onLeave:Pw,onAfterLeave:Pw,onLeaveCancelled:Pw,onBeforeAppear:Pw,onAppear:Pw,onAfterAppear:Pw,onAppearCancelled:Pw},setup(t,{slots:e}){const i=ff(),r=ice();let n;return()=>{const s=e.default&&UX(e.default(),!0);if(!s||!s.length)return;let o=s[0];if(s.length>1){for(const I of s)if(I.type!==sy){o=I;break}}const a=Hs(t),{mode:l}=a;if(r.isLeaving)return JAe(o);const c=fot(o);if(!c)return JAe(o);const d=jk(c,a,r,i);qM(c,d);const p=i.subTree,y=p&&fot(p);let v=!1;const{getTransitionKey:S}=c.type;if(S){const I=S();n===void 0?n=I:I!==n&&(n=I,v=!0)}if(y&&y.type!==sy&&(!q2(c,y)||v)){const I=jk(y,a,r,i);if(qM(y,I),l==="out-in")return r.isLeaving=!0,I.afterLeave=()=>{r.isLeaving=!1,i.update.active!==!1&&i.update()},JAe(o);l==="in-out"&&c.type!==sy&&(I.delayLeave=(O,L,N)=>{const G=pot(r,y);G[String(y.key)]=y,O._leaveCb=()=>{L(),O._leaveCb=void 0,delete d.delayedLeave},d.delayedLeave=N})}return o}}};function pot(t,e){const{leavingVNodes:i}=t;let r=i.get(e.type);return r||(r=Object.create(null),i.set(e.type,r)),r}function jk(t,e,i,r){const{appear:n,mode:s,persisted:o=!1,onBeforeEnter:a,onEnter:l,onAfterEnter:c,onEnterCancelled:d,onBeforeLeave:p,onLeave:y,onAfterLeave:v,onLeaveCancelled:S,onBeforeAppear:I,onAppear:O,onAfterAppear:L,onAppearCancelled:N}=e,G=String(t.key),V=pot(i,t),Y=(re,fe)=>{re&&__(re,r,9,fe)},X=(re,fe)=>{const ge=fe[1];Y(re,fe),vs(re)?re.every(_e=>_e.length<=1)&&ge():re.length<=1&&ge()},te={mode:s,persisted:o,beforeEnter(re){let fe=a;if(!i.isMounted)if(n)fe=I||a;else return;re._leaveCb&&re._leaveCb(!0);const ge=V[G];ge&&q2(t,ge)&&ge.el._leaveCb&&ge.el._leaveCb(),Y(fe,[re])},enter(re){let fe=l,ge=c,_e=d;if(!i.isMounted)if(n)fe=O||l,ge=L||c,_e=N||d;else return;let Ie=!1;const ke=re._enterCb=Ne=>{Ie||(Ie=!0,Ne?Y(_e,[re]):Y(ge,[re]),te.delayedLeave&&te.delayedLeave(),re._enterCb=void 0)};fe?X(fe,[re,ke]):ke()},leave(re,fe){const ge=String(t.key);if(re._enterCb&&re._enterCb(!0),i.isUnmounting)return fe();Y(p,[re]);let _e=!1;const Ie=re._leaveCb=ke=>{_e||(_e=!0,fe(),ke?Y(S,[re]):Y(v,[re]),re._leaveCb=void 0,V[ge]===t&&delete V[ge])};V[ge]=t,y?X(y,[re,Ie]):Ie()},clone(re){return jk(re,e,i,r)}};return te}function JAe(t){if(zX(t))return t=Y2(t),t.children=null,t}function fot(t){return zX(t)?t.children?t.children[0]:void 0:t}function qM(t,e){t.shapeFlag&6&&t.component?qM(t.component.subTree,e):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function UX(t,e=!1,i){let r=[],n=0;for(let s=0;s1)for(let s=0;s!!t.type.__asyncLoader;function jX(t){Fa(t)&&(t={loader:t});const{loader:e,loadingComponent:i,errorComponent:r,delay:n=200,timeout:s,suspensible:o=!0,onError:a}=t;let l=null,c,d=0;const p=()=>(d++,l=null,y()),y=()=>{let v;return l||(v=l=e().catch(S=>{if(S=S instanceof Error?S:new Error(String(S)),a)return new Promise((I,O)=>{a(S,()=>I(p()),()=>O(S),d+1)});throw S}).then(S=>v!==l&&l?l:(S&&(S.__esModule||S[Symbol.toStringTag]==="Module")&&(S=S.default),c=S,S)))};return Zr({name:"AsyncComponentWrapper",__asyncLoader:y,get __asyncResolved(){return c},setup(){const v=$p;if(c)return()=>ZAe(c,v);const S=N=>{l=null,WM(N,v,13,!r)};if(o&&v.suspense||XG)return y().then(N=>()=>ZAe(N,v)).catch(N=>(S(N),()=>r?Rn(r,{error:N}):null));const I=Pi(!1),O=Pi(),L=Pi(!!n);return n&&setTimeout(()=>{L.value=!1},n),s!=null&&setTimeout(()=>{if(!I.value&&!O.value){const N=new Error(`Async component timed out after ${s}ms.`);S(N),O.value=N}},s),y().then(()=>{I.value=!0,v.parent&&zX(v.parent.vnode)&&que(v.parent.update)}).catch(N=>{S(N),O.value=N}),()=>{if(I.value&&c)return ZAe(c,v);if(O.value&&r)return Rn(r,{error:O.value});if(i&&!L.value)return Rn(i)}}})}function ZAe(t,e){const{ref:i,props:r,children:n,ce:s}=e.vnode,o=Rn(t,r,n);return o.ref=i,o.ce=s,delete e.vnode.ce,o}const zX=t=>t.type.__isKeepAlive,mot={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(t,{slots:e}){const i=ff(),r=i.ctx;if(!r.renderer)return()=>{const N=e.default&&e.default();return N&&N.length===1?N[0]:N};const n=new Map,s=new Set;let o=null;const a=i.suspense,{renderer:{p:l,m:c,um:d,o:{createElement:p}}}=r,y=p("div");r.activate=(N,G,V,Y,X)=>{const te=N.component;c(N,G,V,0,a),l(te.vnode,N,G,V,te,a,Y,N.slotScopeIds,X),ny(()=>{te.isDeactivated=!1,te.a&&UG(te.a);const re=N.props&&N.props.onVnodeMounted;re&&w_(re,te.parent,N)},a)},r.deactivate=N=>{const G=N.component;c(N,y,null,1,a),ny(()=>{G.da&&UG(G.da);const V=N.props&&N.props.onVnodeUnmounted;V&&w_(V,G.parent,N),G.isDeactivated=!0},a)};function v(N){tPe(N),d(N,i,a,!0)}function S(N){n.forEach((G,V)=>{const Y=TPe(G.type);Y&&(!N||!N(Y))&&I(V)})}function I(N){const G=n.get(N);!o||!q2(G,o)?v(G):o&&tPe(o),n.delete(N),s.delete(N)}Sc(()=>[t.include,t.exclude],([N,G])=>{N&&S(V=>HX(N,V)),G&&S(V=>!HX(G,V))},{flush:"post",deep:!0});let O=null;const L=()=>{O!=null&&n.set(O,iPe(i.subTree))};return al(L),Hk(L),su(()=>{n.forEach(N=>{const{subTree:G,suspense:V}=i,Y=iPe(G);if(N.type===Y.type&&N.key===Y.key){tPe(Y);const X=Y.component.da;X&&ny(X,V);return}v(N)})}),()=>{if(O=null,!e.default)return null;const N=e.default(),G=N[0];if(N.length>1)return o=null,N;if(!GT(G)||!(G.shapeFlag&4)&&!(G.shapeFlag&128))return o=null,G;let V=iPe(G);const Y=V.type,X=TPe(zk(V)?V.type.__asyncResolved||{}:Y),{include:te,exclude:re,max:fe}=t;if(te&&(!X||!HX(te,X))||re&&X&&HX(re,X))return o=V,G;const ge=V.key==null?Y:V.key,_e=n.get(ge);return V.el&&(V=Y2(V),G.shapeFlag&128&&(G.ssContent=V)),O=ge,_e?(V.el=_e.el,V.component=_e.component,V.transition&&qM(V,V.transition),V.shapeFlag|=512,s.delete(ge),s.add(ge)):(s.add(ge),fe&&s.size>parseInt(fe,10)&&I(s.values().next().value)),V.shapeFlag|=256,o=V,oot(G.type)?G:V}}};function HX(t,e){return vs(t)?t.some(i=>HX(i,e)):ol(t)?t.split(",").includes(e):emi(t)?t.test(e):!1}function QAe(t,e){got(t,"a",e)}function ePe(t,e){got(t,"da",e)}function got(t,e,i=$p){const r=t.__wdc||(t.__wdc=()=>{let n=i;for(;n;){if(n.isDeactivated)return;n=n.parent}return t()});if(nce(e,r,i),i){let n=i.parent;for(;n&&n.parent;)zX(n.parent.vnode)&&egi(r,e,i,n),n=n.parent}}function egi(t,e,i,r){const n=nce(e,t,r,!0);Wk(()=>{MAe(r[e],n)},i)}function tPe(t){t.shapeFlag&=-257,t.shapeFlag&=-513}function iPe(t){return t.shapeFlag&128?t.ssContent:t}function nce(t,e,i=$p,r=!1){if(i){const n=i[t]||(i[t]=[]),s=e.__weh||(e.__weh=(...o)=>{if(i.isUnmounted)return;zG(),JM(i);const a=__(e,i,t,o);return ZM(),HG(),a});return r?n.unshift(s):n.push(s),s}}const CP=t=>(e,i=$p)=>(!XG||t==="sp")&&nce(t,(...r)=>e(...r),i),pv=CP("bm"),al=CP("m"),sce=CP("bu"),Hk=CP("u"),su=CP("bum"),Wk=CP("um"),rPe=CP("sp"),nPe=CP("rtg"),sPe=CP("rtc");function oce(t,e=$p){nce("ec",t,e)}function Br(t,e){const i=ry;if(i===null)return t;const r=yce(i)||i.proxy,n=t.dirs||(t.dirs=[]);for(let s=0;se(o,a,void 0,s&&s[a]));else{const o=Object.keys(t);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 t}function jf(t,e,i={},r,n){if(ry.isCE||ry.parent&&zk(ry.parent)&&ry.parent.isCE)return e!=="default"&&(i.name=e),Rn("slot",i,r&&r());let s=t[e];s&&s._c&&(s._d=!1),Kt();const o=s&&bot(s(i)),a=Pn(eo,{key:i.key||o&&o.key||`_${e}`},o||(r?r():[]),o&&t._===1?64:-2);return!n&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),s&&s._c&&(s._d=!0),a}function bot(t){return t.some(e=>GT(e)?!(e.type===sy||e.type===eo&&!bot(e.children)):!0)?t:null}function wot(t,e){const i={};for(const r in t)i[e&&/[A-Z]/.test(r)?`on:${r}`:Nk(r)]=t[r];return i}const lPe=t=>t?zot(t)?yce(t)||t.proxy:lPe(t.parent):null,WX=xc(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>lPe(t.parent),$root:t=>lPe(t.root),$emit:t=>t.emit,$options:t=>dPe(t),$forceUpdate:t=>t.f||(t.f=()=>que(t.update)),$nextTick:t=>t.n||(t.n=iy.bind(t.proxy)),$watch:t=>Qmi.bind(t)}),uPe=(t,e)=>t!==Yc&&!t.__isScriptSetup&&Yu(t,e),cPe={get({_:t},e){const{ctx:i,setupState:r,data:n,props:s,accessCache:o,type:a,appContext:l}=t;let c;if(e[0]!=="$"){const v=o[e];if(v!==void 0)switch(v){case 1:return r[e];case 2:return n[e];case 4:return i[e];case 3:return s[e]}else{if(uPe(r,e))return o[e]=1,r[e];if(n!==Yc&&Yu(n,e))return o[e]=2,n[e];if((c=t.propsOptions[0])&&Yu(c,e))return o[e]=3,s[e];if(i!==Yc&&Yu(i,e))return o[e]=4,i[e];hPe&&(o[e]=0)}}const d=WX[e];let p,y;if(d)return e==="$attrs"&&v_(t,"get",e),d(t);if((p=a.__cssModules)&&(p=p[e]))return p;if(i!==Yc&&Yu(i,e))return o[e]=4,i[e];if(y=l.config.globalProperties,Yu(y,e))return y[e]},set({_:t},e,i){const{data:r,setupState:n,ctx:s}=t;return uPe(n,e)?(n[e]=i,!0):r!==Yc&&Yu(r,e)?(r[e]=i,!0):Yu(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=i,!0)},has({_:{data:t,setupState:e,accessCache:i,ctx:r,appContext:n,propsOptions:s}},o){let a;return!!i[o]||t!==Yc&&Yu(t,o)||uPe(e,o)||(a=s[0])&&Yu(a,o)||Yu(r,o)||Yu(WX,o)||Yu(n.config.globalProperties,o)},defineProperty(t,e,i){return i.get!=null?t._.accessCache[e]=0:Yu(i,"value")&&this.set(t,e,i.value,null),Reflect.defineProperty(t,e,i)}},igi=xc({},cPe,{get(t,e){if(e!==Symbol.unscopables)return cPe.get(t,e,t)},has(t,e){return e[0]!=="_"&&!Gfi(e)}});let hPe=!0;function rgi(t){const e=dPe(t),i=t.proxy,r=t.ctx;hPe=!1,e.beforeCreate&&xot(e.beforeCreate,t,"bc");const{data:n,computed:s,methods:o,watch:a,provide:l,inject:c,created:d,beforeMount:p,mounted:y,beforeUpdate:v,updated:S,activated:I,deactivated:O,beforeDestroy:L,beforeUnmount:N,destroyed:G,unmounted:V,render:Y,renderTracked:X,renderTriggered:te,errorCaptured:re,serverPrefetch:fe,expose:ge,inheritAttrs:_e,components:Ie,directives:ke,filters:Ne}=e;if(c&&ngi(c,r,null,t.appContext.config.unwrapInjectedRef),o)for(const xe in o){const Pe=o[xe];Fa(Pe)&&(r[xe]=Pe.bind(i))}if(n){const xe=n.call(i,i);oh(xe)&&(t.data=Tl(xe))}if(hPe=!0,s)for(const xe in s){const Pe=s[xe],Oe=Fa(Pe)?Pe.bind(i,i):Fa(Pe.get)?Pe.get.bind(i,i):dv,Ae=!Fa(Pe)&&Fa(Pe.set)?Pe.set.bind(i):dv,ze=Vr({get:Oe,set:Ae});Object.defineProperty(r,xe,{enumerable:!0,configurable:!0,get:()=>ze.value,set:Ge=>ze.value=Ge})}if(a)for(const xe in a)Sot(a[xe],r,i,xe);if(l){const xe=Fa(l)?l.call(i):l;Reflect.ownKeys(xe).forEach(Pe=>{ece(Pe,xe[Pe])})}d&&xot(d,t,"c");function he(xe,Pe){vs(Pe)?Pe.forEach(Oe=>xe(Oe.bind(i))):Pe&&xe(Pe.bind(i))}if(he(pv,p),he(al,y),he(sce,v),he(Hk,S),he(QAe,I),he(ePe,O),he(oce,re),he(sPe,X),he(nPe,te),he(su,N),he(Wk,V),he(rPe,fe),vs(ge))if(ge.length){const xe=t.exposed||(t.exposed={});ge.forEach(Pe=>{Object.defineProperty(xe,Pe,{get:()=>i[Pe],set:Oe=>i[Pe]=Oe})})}else t.exposed||(t.exposed={});Y&&t.render===dv&&(t.render=Y),_e!=null&&(t.inheritAttrs=_e),Ie&&(t.components=Ie),ke&&(t.directives=ke)}function ngi(t,e,i=dv,r=!1){vs(t)&&(t=pPe(t));for(const n in t){const s=t[n];let o;oh(s)?"default"in s?o=Qs(s.from||n,s.default,!0):o=Qs(s.from||n):o=Qs(s),lc(o)&&r?Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:a=>o.value=a}):e[n]=o}}function xot(t,e,i){__(vs(t)?t.map(r=>r.bind(e.proxy)):t.bind(e.proxy),e,i)}function Sot(t,e,i,r){const n=r.includes(".")?dot(i,r):()=>i[r];if(ol(t)){const s=e[t];Fa(s)&&Sc(n,s)}else if(Fa(t))Sc(n,t.bind(i));else if(oh(t))if(vs(t))t.forEach(s=>Sot(s,e,i,r));else{const s=Fa(t.handler)?t.handler.bind(i):e[t.handler];Fa(s)&&Sc(n,s,t)}}function dPe(t){const e=t.type,{mixins:i,extends:r}=e,{mixins:n,optionsCache:s,config:{optionMergeStrategies:o}}=t.appContext,a=s.get(e);let l;return a?l=a:!n.length&&!i&&!r?l=e:(l={},n.length&&n.forEach(c=>ace(l,c,o,!0)),ace(l,e,o)),oh(e)&&s.set(e,l),l}function ace(t,e,i,r=!1){const{mixins:n,extends:s}=e;s&&ace(t,s,i,!0),n&&n.forEach(o=>ace(t,o,i,!0));for(const o in e)if(!(r&&o==="expose")){const a=sgi[o]||i&&i[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const sgi={data:Cot,props:qk,emits:qk,methods:qk,computed:qk,beforeCreate:fv,created:fv,beforeMount:fv,mounted:fv,beforeUpdate:fv,updated:fv,beforeDestroy:fv,beforeUnmount:fv,destroyed:fv,unmounted:fv,activated:fv,deactivated:fv,errorCaptured:fv,serverPrefetch:fv,components:qk,directives:qk,watch:agi,provide:Cot,inject:ogi};function Cot(t,e){return e?t?function(){return xc(Fa(t)?t.call(this,this):t,Fa(e)?e.call(this,this):e)}:e:t}function ogi(t,e){return qk(pPe(t),pPe(e))}function pPe(t){if(vs(t)){const e={};for(let i=0;i0)&&!(o&16)){if(o&8){const d=t.vnode.dynamicProps;for(let p=0;p{l=!0;const[y,v]=Eot(p,e,!0);xc(o,y),v&&a.push(...v)};!i&&e.mixins.length&&e.mixins.forEach(d),t.extends&&d(t.extends),t.mixins&&t.mixins.forEach(d)}if(!s&&!l)return oh(t)&&r.set(t,$G),$G;if(vs(s))for(let d=0;d-1,v[1]=I<0||S-1||Yu(v,"default"))&&a.push(p)}}}const c=[o,a];return oh(t)&&r.set(t,c),c}function Iot(t){return t[0]!=="$"}function Aot(t){const e=t&&t.toString().match(/^\s*(function|class) (\w+)/);return e?e[2]:t===null?"null":""}function Pot(t,e){return Aot(t)===Aot(e)}function Oot(t,e){return vs(e)?e.findIndex(i=>Pot(i,t)):Fa(e)&&Pot(e,t)?0:-1}const Rot=t=>t[0]==="_"||t==="$stable",mPe=t=>vs(t)?t.map(nb):[nb(t)],cgi=(t,e,i)=>{if(e._n)return e;const r=yn((...n)=>mPe(e(...n)),i);return r._c=!1,r},Mot=(t,e,i)=>{const r=t._ctx;for(const n in t){if(Rot(n))continue;const s=t[n];if(Fa(s))e[n]=cgi(n,s,r);else if(s!=null){const o=mPe(s);e[n]=()=>o}}},Dot=(t,e)=>{const i=mPe(e);t.slots.default=()=>i},hgi=(t,e)=>{if(t.vnode.shapeFlag&32){const i=e._;i?(t.slots=Hs(e),Iue(e,"_",i)):Mot(e,t.slots={})}else t.slots={},e&&Dot(t,e);Iue(t.slots,pce,1)},dgi=(t,e,i)=>{const{vnode:r,slots:n}=t;let s=!0,o=Yc;if(r.shapeFlag&32){const a=e._;a?i&&a===1?s=!1:(xc(n,e),!i&&a===1&&delete n._):(s=!e.$stable,Mot(e,n)),o=e}else e&&(Dot(t,e),o={default:1});if(s)for(const a in n)!Rot(a)&&!(a in o)&&delete n[a]};function Fot(){return{app:null,config:{isNativeTag:Tue,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let pgi=0;function fgi(t,e){return function(r,n=null){Fa(r)||(r=Object.assign({},r)),n!=null&&!oh(n)&&(n=null);const s=Fot(),o=new Set;let a=!1;const l=s.app={_uid:pgi++,_component:r,_props:n,_container:null,_context:s,_instance:null,version:APe,get config(){return s.config},set config(c){},use(c,...d){return o.has(c)||(c&&Fa(c.install)?(o.add(c),c.install(l,...d)):Fa(c)&&(o.add(c),c(l,...d))),l},mixin(c){return s.mixins.includes(c)||s.mixins.push(c),l},component(c,d){return d?(s.components[c]=d,l):s.components[c]},directive(c,d){return d?(s.directives[c]=d,l):s.directives[c]},mount(c,d,p){if(!a){const y=Rn(r,n);return y.appContext=s,d&&e?e(y,c):t(y,c,p),a=!0,l._container=c,c.__vue_app__=l,yce(y.component)||y.component.proxy}},unmount(){a&&(t(null,l._container),delete l._container.__vue_app__)},provide(c,d){return s.provides[c]=d,l}};return l}}function lce(t,e,i,r,n=!1){if(vs(t)){t.forEach((y,v)=>lce(y,e&&(vs(e)?e[v]:e),i,r,n));return}if(zk(r)&&!n)return;const s=r.shapeFlag&4?yce(r.component)||r.component.proxy:r.el,o=n?null:s,{i:a,r:l}=t,c=e&&e.r,d=a.refs===Yc?a.refs={}:a.refs,p=a.setupState;if(c!=null&&c!==l&&(ol(c)?(d[c]=null,Yu(p,c)&&(p[c]=null)):lc(c)&&(c.value=null)),Fa(l))NT(l,a,12,[o,d]);else{const y=ol(l),v=lc(l);if(y||v){const S=()=>{if(t.f){const I=y?Yu(p,l)?p[l]:d[l]:l.value;n?vs(I)&&MAe(I,s):vs(I)?I.includes(s)||I.push(s):y?(d[l]=[s],Yu(p,l)&&(p[l]=d[l])):(l.value=[s],t.k&&(d[t.k]=l.value))}else y?(d[l]=o,Yu(p,l)&&(p[l]=o)):v&&(l.value=o,t.k&&(d[t.k]=o))};o?(S.id=-1,ny(S,i)):S()}}}let YM=!1;const uce=t=>/svg/.test(t.namespaceURI)&&t.tagName!=="foreignObject",cce=t=>t.nodeType===8;function mgi(t){const{mt:e,p:i,o:{patchProp:r,createText:n,nextSibling:s,parentNode:o,remove:a,insert:l,createComment:c}}=t,d=(L,N)=>{if(!N.hasChildNodes()){i(null,L,N),Xue(),N._vnode=L;return}YM=!1,p(N.firstChild,L,null,null,null),Xue(),N._vnode=L,YM&&console.error("Hydration completed but contains mismatches.")},p=(L,N,G,V,Y,X=!1)=>{const te=cce(L)&&L.data==="[",re=()=>I(L,N,G,V,Y,te),{type:fe,ref:ge,shapeFlag:_e,patchFlag:Ie}=N;let ke=L.nodeType;N.el=L,Ie===-2&&(X=!1,N.dynamicChildren=null);let Ne=null;switch(fe){case EP:ke!==3?N.children===""?(l(N.el=n(""),o(L),L),Ne=L):Ne=re():(L.data!==N.children&&(YM=!0,L.data=N.children),Ne=s(L));break;case sy:ke!==8||te?Ne=re():Ne=s(L);break;case XM:if(te&&(L=s(L),ke=L.nodeType),ke===1||ke===3){Ne=L;const J=!N.children.length;for(let he=0;he{X=X||!!N.dynamicChildren;const{type:te,props:re,patchFlag:fe,shapeFlag:ge,dirs:_e}=N,Ie=te==="input"&&_e||te==="option";if(Ie||fe!==-1){if(_e&&BT(N,null,G,"created"),re)if(Ie||!X||fe&48)for(const Ne in re)(Ie&&Ne.endsWith("value")||Fk(Ne)&&!kk(Ne))&&r(L,Ne,null,re[Ne],!1,void 0,G);else re.onClick&&r(L,"onClick",null,re.onClick,!1,void 0,G);let ke;if((ke=re&&re.onVnodeBeforeMount)&&w_(ke,G,N),_e&&BT(N,null,G,"beforeMount"),((ke=re&&re.onVnodeMounted)||_e)&&uot(()=>{ke&&w_(ke,G,N),_e&&BT(N,null,G,"mounted")},V),ge&16&&!(re&&(re.innerHTML||re.textContent))){let Ne=v(L.firstChild,N,L,G,V,Y,X);for(;Ne;){YM=!0;const J=Ne;Ne=Ne.nextSibling,a(J)}}else ge&8&&L.textContent!==N.children&&(YM=!0,L.textContent=N.children)}return L.nextSibling},v=(L,N,G,V,Y,X,te)=>{te=te||!!N.dynamicChildren;const re=N.children,fe=re.length;for(let ge=0;ge{const{slotScopeIds:te}=N;te&&(Y=Y?Y.concat(te):te);const re=o(L),fe=v(s(L),N,re,G,V,Y,X);return fe&&cce(fe)&&fe.data==="]"?s(N.anchor=fe):(YM=!0,l(N.anchor=c("]"),re,fe),fe)},I=(L,N,G,V,Y,X)=>{if(YM=!0,N.el=null,X){const fe=O(L);for(;;){const ge=s(L);if(ge&&ge!==fe)a(ge);else break}}const te=s(L),re=o(L);return a(L),i(null,N,re,te,G,V,uce(re),Y),te},O=L=>{let N=0;for(;L;)if(L=s(L),L&&cce(L)&&(L.data==="["&&N++,L.data==="]")){if(N===0)return s(L);N--}return L};return[d,p]}const ny=uot;function gPe(t){return Lot(t)}function yPe(t){return Lot(t,mgi)}function Lot(t,e){const i=smi();i.__VUE__=!0;const{insert:r,remove:n,patchProp:s,createElement:o,createText:a,createComment:l,setText:c,setElementText:d,parentNode:p,nextSibling:y,setScopeId:v=dv,insertStaticContent:S}=t,I=(at,Ee,Be,mt=null,kt=null,ct=null,le=!1,it=null,pt=!!Ee.dynamicChildren)=>{if(at===Ee)return;at&&!q2(at,Ee)&&(mt=Pt(at),Ge(at,kt,ct,!0),at=null),Ee.patchFlag===-2&&(pt=!1,Ee.dynamicChildren=null);const{type:Le,ref:ce,shapeFlag:Ce}=Ee;switch(Le){case EP:O(at,Ee,Be,mt);break;case sy:L(at,Ee,Be,mt);break;case XM:at==null&&N(Ee,Be,mt,le);break;case eo:Ie(at,Ee,Be,mt,kt,ct,le,it,pt);break;default:Ce&1?Y(at,Ee,Be,mt,kt,ct,le,it,pt):Ce&6?ke(at,Ee,Be,mt,kt,ct,le,it,pt):(Ce&64||Ce&128)&&Le.process(at,Ee,Be,mt,kt,ct,le,it,pt,St)}ce!=null&&kt&&lce(ce,at&&at.ref,ct,Ee||at,!Ee)},O=(at,Ee,Be,mt)=>{if(at==null)r(Ee.el=a(Ee.children),Be,mt);else{const kt=Ee.el=at.el;Ee.children!==at.children&&c(kt,Ee.children)}},L=(at,Ee,Be,mt)=>{at==null?r(Ee.el=l(Ee.children||""),Be,mt):Ee.el=at.el},N=(at,Ee,Be,mt)=>{[at.el,at.anchor]=S(at.children,Ee,Be,mt,at.el,at.anchor)},G=({el:at,anchor:Ee},Be,mt)=>{let kt;for(;at&&at!==Ee;)kt=y(at),r(at,Be,mt),at=kt;r(Ee,Be,mt)},V=({el:at,anchor:Ee})=>{let Be;for(;at&&at!==Ee;)Be=y(at),n(at),at=Be;n(Ee)},Y=(at,Ee,Be,mt,kt,ct,le,it,pt)=>{le=le||Ee.type==="svg",at==null?X(Ee,Be,mt,kt,ct,le,it,pt):fe(at,Ee,kt,ct,le,it,pt)},X=(at,Ee,Be,mt,kt,ct,le,it)=>{let pt,Le;const{type:ce,props:Ce,shapeFlag:Ze,transition:yt,dirs:Ve}=at;if(pt=at.el=o(at.type,ct,Ce&&Ce.is,Ce),Ze&8?d(pt,at.children):Ze&16&&re(at.children,pt,null,mt,kt,ct&&ce!=="foreignObject",le,it),Ve&&BT(at,null,mt,"created"),te(pt,at,at.scopeId,le,mt),Ce){for(const ii in Ce)ii!=="value"&&!kk(ii)&&s(pt,ii,null,Ce[ii],ct,at.children,mt,kt,ft);"value"in Ce&&s(pt,"value",null,Ce.value),(Le=Ce.onVnodeBeforeMount)&&w_(Le,mt,at)}Ve&&BT(at,null,mt,"beforeMount");const At=(!kt||kt&&!kt.pendingBranch)&&yt&&!yt.persisted;At&&yt.beforeEnter(pt),r(pt,Ee,Be),((Le=Ce&&Ce.onVnodeMounted)||At||Ve)&&ny(()=>{Le&&w_(Le,mt,at),At&&yt.enter(pt),Ve&&BT(at,null,mt,"mounted")},kt)},te=(at,Ee,Be,mt,kt)=>{if(Be&&v(at,Be),mt)for(let ct=0;ct{for(let Le=pt;Le{const it=Ee.el=at.el;let{patchFlag:pt,dynamicChildren:Le,dirs:ce}=Ee;pt|=at.patchFlag&16;const Ce=at.props||Yc,Ze=Ee.props||Yc;let yt;Be&&Yk(Be,!1),(yt=Ze.onVnodeBeforeUpdate)&&w_(yt,Be,Ee,at),ce&&BT(Ee,at,Be,"beforeUpdate"),Be&&Yk(Be,!0);const Ve=kt&&Ee.type!=="foreignObject";if(Le?ge(at.dynamicChildren,Le,it,Be,mt,Ve,ct):le||Pe(at,Ee,it,null,Be,mt,Ve,ct,!1),pt>0){if(pt&16)_e(it,Ee,Ce,Ze,Be,mt,kt);else if(pt&2&&Ce.class!==Ze.class&&s(it,"class",null,Ze.class,kt),pt&4&&s(it,"style",Ce.style,Ze.style,kt),pt&8){const At=Ee.dynamicProps;for(let ii=0;ii{yt&&w_(yt,Be,Ee,at),ce&&BT(Ee,at,Be,"updated")},mt)},ge=(at,Ee,Be,mt,kt,ct,le)=>{for(let it=0;it{if(Be!==mt){if(Be!==Yc)for(const it in Be)!kk(it)&&!(it in mt)&&s(at,it,Be[it],null,le,Ee.children,kt,ct,ft);for(const it in mt){if(kk(it))continue;const pt=mt[it],Le=Be[it];pt!==Le&&it!=="value"&&s(at,it,Le,pt,le,Ee.children,kt,ct,ft)}"value"in mt&&s(at,"value",Be.value,mt.value)}},Ie=(at,Ee,Be,mt,kt,ct,le,it,pt)=>{const Le=Ee.el=at?at.el:a(""),ce=Ee.anchor=at?at.anchor:a("");let{patchFlag:Ce,dynamicChildren:Ze,slotScopeIds:yt}=Ee;yt&&(it=it?it.concat(yt):yt),at==null?(r(Le,Be,mt),r(ce,Be,mt),re(Ee.children,Be,ce,kt,ct,le,it,pt)):Ce>0&&Ce&64&&Ze&&at.dynamicChildren?(ge(at.dynamicChildren,Ze,Be,kt,ct,le,it),(Ee.key!=null||kt&&Ee===kt.subTree)&&vPe(at,Ee,!0)):Pe(at,Ee,Be,ce,kt,ct,le,it,pt)},ke=(at,Ee,Be,mt,kt,ct,le,it,pt)=>{Ee.slotScopeIds=it,at==null?Ee.shapeFlag&512?kt.ctx.activate(Ee,Be,mt,le,pt):Ne(Ee,Be,mt,kt,ct,le,pt):J(at,Ee,pt)},Ne=(at,Ee,Be,mt,kt,ct,le)=>{const it=at.component=jot(at,mt,kt);if(zX(at)&&(it.ctx.renderer=St),Hot(it),it.asyncDep){if(kt&&kt.registerDep(it,he),!at.el){const pt=it.subTree=Rn(sy);L(null,pt,Ee,Be)}return}he(it,at,Ee,Be,kt,ct,le)},J=(at,Ee,Be)=>{const mt=Ee.component=at.component;if(Ymi(at,Ee,Be))if(mt.asyncDep&&!mt.asyncResolved){xe(mt,Ee,Be);return}else mt.next=Ee,Umi(mt.update),mt.update();else Ee.el=at.el,mt.vnode=Ee},he=(at,Ee,Be,mt,kt,ct,le)=>{const it=()=>{if(at.isMounted){let{next:ce,bu:Ce,u:Ze,parent:yt,vnode:Ve}=at,At=ce,ii;Yk(at,!1),ce?(ce.el=Ve.el,xe(at,ce,le)):ce=Ve,Ce&&UG(Ce),(ii=ce.props&&ce.props.onVnodeBeforeUpdate)&&w_(ii,yt,ce,Ve),Yk(at,!0);const gt=Que(at),Ue=at.subTree;at.subTree=gt,I(Ue,gt,p(Ue.el),Pt(Ue),at,kt,ct),ce.el=gt.el,At===null&&YAe(at,gt.el),Ze&&ny(Ze,kt),(ii=ce.props&&ce.props.onVnodeUpdated)&&ny(()=>w_(ii,yt,ce,Ve),kt)}else{let ce;const{el:Ce,props:Ze}=Ee,{bm:yt,m:Ve,parent:At}=at,ii=zk(Ee);if(Yk(at,!1),yt&&UG(yt),!ii&&(ce=Ze&&Ze.onVnodeBeforeMount)&&w_(ce,At,Ee),Yk(at,!0),Ce&&Lt){const gt=()=>{at.subTree=Que(at),Lt(Ce,at.subTree,at,kt,null)};ii?Ee.type.__asyncLoader().then(()=>!at.isUnmounted&>()):gt()}else{const gt=at.subTree=Que(at);I(null,gt,Be,mt,at,kt,ct),Ee.el=gt.el}if(Ve&&ny(Ve,kt),!ii&&(ce=Ze&&Ze.onVnodeMounted)){const gt=Ee;ny(()=>w_(ce,At,gt),kt)}(Ee.shapeFlag&256||At&&zk(At.vnode)&&At.vnode.shapeFlag&256)&&at.a&&ny(at.a,kt),at.isMounted=!0,Ee=Be=mt=null}},pt=at.effect=new jG(it,()=>que(Le),at.scope),Le=at.update=()=>pt.run();Le.id=at.uid,Yk(at,!0),Le()},xe=(at,Ee,Be)=>{Ee.component=at;const mt=at.vnode.props;at.vnode=Ee,at.next=null,ugi(at,Ee.props,mt,Be),dgi(at,Ee.children,Be),zG(),tot(),HG()},Pe=(at,Ee,Be,mt,kt,ct,le,it,pt=!1)=>{const Le=at&&at.children,ce=at?at.shapeFlag:0,Ce=Ee.children,{patchFlag:Ze,shapeFlag:yt}=Ee;if(Ze>0){if(Ze&128){Ae(Le,Ce,Be,mt,kt,ct,le,it,pt);return}else if(Ze&256){Oe(Le,Ce,Be,mt,kt,ct,le,it,pt);return}}yt&8?(ce&16&&ft(Le,kt,ct),Ce!==Le&&d(Be,Ce)):ce&16?yt&16?Ae(Le,Ce,Be,mt,kt,ct,le,it,pt):ft(Le,kt,ct,!0):(ce&8&&d(Be,""),yt&16&&re(Ce,Be,mt,kt,ct,le,it,pt))},Oe=(at,Ee,Be,mt,kt,ct,le,it,pt)=>{at=at||$G,Ee=Ee||$G;const Le=at.length,ce=Ee.length,Ce=Math.min(Le,ce);let Ze;for(Ze=0;Zece?ft(at,kt,ct,!0,!1,Ce):re(Ee,Be,mt,kt,ct,le,it,pt,Ce)},Ae=(at,Ee,Be,mt,kt,ct,le,it,pt)=>{let Le=0;const ce=Ee.length;let Ce=at.length-1,Ze=ce-1;for(;Le<=Ce&&Le<=Ze;){const yt=at[Le],Ve=Ee[Le]=pt?KM(Ee[Le]):nb(Ee[Le]);if(q2(yt,Ve))I(yt,Ve,Be,null,kt,ct,le,it,pt);else break;Le++}for(;Le<=Ce&&Le<=Ze;){const yt=at[Ce],Ve=Ee[Ze]=pt?KM(Ee[Ze]):nb(Ee[Ze]);if(q2(yt,Ve))I(yt,Ve,Be,null,kt,ct,le,it,pt);else break;Ce--,Ze--}if(Le>Ce){if(Le<=Ze){const yt=Ze+1,Ve=ytZe)for(;Le<=Ce;)Ge(at[Le],kt,ct,!0),Le++;else{const yt=Le,Ve=Le,At=new Map;for(Le=Ve;Le<=Ze;Le++){const T=Ee[Le]=pt?KM(Ee[Le]):nb(Ee[Le]);T.key!=null&&At.set(T.key,Le)}let ii,gt=0;const Ue=Ze-Ve+1;let ni=!1,A=0;const ve=new Array(Ue);for(Le=0;Le=Ue){Ge(T,kt,ct,!0);continue}let b;if(T.key!=null)b=At.get(T.key);else for(ii=Ve;ii<=Ze;ii++)if(ve[ii-Ve]===0&&q2(T,Ee[ii])){b=ii;break}b===void 0?Ge(T,kt,ct,!0):(ve[b-Ve]=Le+1,b>=A?A=b:ni=!0,I(T,Ee[b],Be,null,kt,ct,le,it,pt),gt++)}const W=ni?ggi(ve):$G;for(ii=W.length-1,Le=Ue-1;Le>=0;Le--){const T=Ve+Le,b=Ee[T],m=T+1{const{el:ct,type:le,transition:it,children:pt,shapeFlag:Le}=at;if(Le&6){ze(at.component.subTree,Ee,Be,mt);return}if(Le&128){at.suspense.move(Ee,Be,mt);return}if(Le&64){le.move(at,Ee,Be,St);return}if(le===eo){r(ct,Ee,Be);for(let Ce=0;Ceit.enter(ct),kt);else{const{leave:Ce,delayLeave:Ze,afterLeave:yt}=it,Ve=()=>r(ct,Ee,Be),At=()=>{Ce(ct,()=>{Ve(),yt&&yt()})};Ze?Ze(ct,Ve,At):At()}else r(ct,Ee,Be)},Ge=(at,Ee,Be,mt=!1,kt=!1)=>{const{type:ct,props:le,ref:it,children:pt,dynamicChildren:Le,shapeFlag:ce,patchFlag:Ce,dirs:Ze}=at;if(it!=null&&lce(it,null,Be,at,!0),ce&256){Ee.ctx.deactivate(at);return}const yt=ce&1&&Ze,Ve=!zk(at);let At;if(Ve&&(At=le&&le.onVnodeBeforeUnmount)&&w_(At,Ee,at),ce&6)tt(at.component,Be,mt);else{if(ce&128){at.suspense.unmount(Be,mt);return}yt&&BT(at,null,Ee,"beforeUnmount"),ce&64?at.type.remove(at,Ee,Be,kt,St,mt):Le&&(ct!==eo||Ce>0&&Ce&64)?ft(Le,Ee,Be,!1,!0):(ct===eo&&Ce&384||!kt&&ce&16)&&ft(pt,Ee,Be),mt&&Je(at)}(Ve&&(At=le&&le.onVnodeUnmounted)||yt)&&ny(()=>{At&&w_(At,Ee,at),yt&&BT(at,null,Ee,"unmounted")},Be)},Je=at=>{const{type:Ee,el:Be,anchor:mt,transition:kt}=at;if(Ee===eo){et(Be,mt);return}if(Ee===XM){V(at);return}const ct=()=>{n(Be),kt&&!kt.persisted&&kt.afterLeave&&kt.afterLeave()};if(at.shapeFlag&1&&kt&&!kt.persisted){const{leave:le,delayLeave:it}=kt,pt=()=>le(Be,ct);it?it(at.el,ct,pt):pt()}else ct()},et=(at,Ee)=>{let Be;for(;at!==Ee;)Be=y(at),n(at),at=Be;n(Ee)},tt=(at,Ee,Be)=>{const{bum:mt,scope:kt,update:ct,subTree:le,um:it}=at;mt&&UG(mt),kt.stop(),ct&&(ct.active=!1,Ge(le,at,Ee,Be)),it&&ny(it,Ee),ny(()=>{at.isUnmounted=!0},Ee),Ee&&Ee.pendingBranch&&!Ee.isUnmounted&&at.asyncDep&&!at.asyncResolved&&at.suspenseId===Ee.pendingId&&(Ee.deps--,Ee.deps===0&&Ee.resolve())},ft=(at,Ee,Be,mt=!1,kt=!1,ct=0)=>{for(let le=ct;leat.shapeFlag&6?Pt(at.component.subTree):at.shapeFlag&128?at.suspense.next():y(at.anchor||at.el),$t=(at,Ee,Be)=>{at==null?Ee._vnode&&Ge(Ee._vnode,null,null,!0):I(Ee._vnode||null,at,Ee,null,null,null,Be),tot(),Xue(),Ee._vnode=at},St={p:I,um:Ge,m:ze,r:Je,mt:Ne,mc:re,pc:Pe,pbc:ge,n:Pt,o:t};let Tt,Lt;return e&&([Tt,Lt]=e(St)),{render:$t,hydrate:Tt,createApp:fgi($t,Tt)}}function Yk({effect:t,update:e},i){t.allowRecurse=e.allowRecurse=i}function vPe(t,e,i=!1){const r=t.children,n=e.children;if(vs(r)&&vs(n))for(let s=0;s>1,t[i[a]]0&&(e[r]=i[s-1]),i[s]=r)}}for(s=i.length,o=i[s-1];s-- >0;)i[s]=o,o=e[o];return i}const ygi=t=>t.__isTeleport,qX=t=>t&&(t.disabled||t.disabled===""),kot=t=>typeof SVGElement<"u"&&t instanceof SVGElement,_Pe=(t,e)=>{const i=t&&t.to;return ol(i)?e?e(i):null:i},vgi={__isTeleport:!0,process(t,e,i,r,n,s,o,a,l,c){const{mc:d,pc:p,pbc:y,o:{insert:v,querySelector:S,createText:I,createComment:O}}=c,L=qX(e.props);let{shapeFlag:N,children:G,dynamicChildren:V}=e;if(t==null){const Y=e.el=I(""),X=e.anchor=I("");v(Y,i,r),v(X,i,r);const te=e.target=_Pe(e.props,S),re=e.targetAnchor=I("");te&&(v(re,te),o=o||kot(te));const fe=(ge,_e)=>{N&16&&d(G,ge,_e,n,s,o,a,l)};L?fe(i,X):te&&fe(te,re)}else{e.el=t.el;const Y=e.anchor=t.anchor,X=e.target=t.target,te=e.targetAnchor=t.targetAnchor,re=qX(t.props),fe=re?i:X,ge=re?Y:te;if(o=o||kot(X),V?(y(t.dynamicChildren,V,fe,n,s,o,a),vPe(t,e,!0)):l||p(t,e,fe,ge,n,s,o,a,!1),L)re||hce(e,i,Y,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const _e=e.target=_Pe(e.props,S);_e&&hce(e,_e,null,c,0)}else re&&hce(e,X,te,c,1)}$ot(e)},remove(t,e,i,r,{um:n,o:{remove:s}},o){const{shapeFlag:a,children:l,anchor:c,targetAnchor:d,target:p,props:y}=t;if(p&&s(d),(o||!qX(y))&&(s(c),a&16))for(let v=0;v0?b_||$G:null,Bot(),Xk>0&&b_&&b_.push(t),t}function ci(t,e,i,r,n,s){return Got(Mt(t,e,i,r,n,s,!0))}function Pn(t,e,i,r,n){return Got(Rn(t,e,i,r,n,!0))}function GT(t){return t?t.__v_isVNode===!0:!1}function q2(t,e){return t.type===e.type&&t.key===e.key}function Vot(t){}const pce="__vInternal",Uot=({key:t})=>t??null,fce=({ref:t,ref_key:e,ref_for:i})=>t!=null?ol(t)||lc(t)||Fa(t)?{i:ry,r:t,k:e,f:!!i}:t:null;function Mt(t,e=null,i=null,r=0,n=null,s=t===eo?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Uot(e),ref:e&&fce(e),scopeId:Zue,slotScopeIds:null,children:i,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:ry};return a?(wPe(l,i),s&128&&t.normalize(l)):i&&(l.shapeFlag|=ol(i)?8:16),Xk>0&&!o&&b_&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&b_.push(l),l}const Rn=bgi;function bgi(t,e=null,i=null,r=0,n=null,s=!1){if((!t||t===yot)&&(t=sy),GT(t)){const a=Y2(t,e,!0);return i&&wPe(a,i),Xk>0&&!s&&b_&&(a.shapeFlag&6?b_[b_.indexOf(t)]=a:b_.push(a)),a.patchFlag|=-2,a}if(Tgi(t)&&(t=t.__vccOpts),e){e=bPe(e);let{class:a,style:l}=e;a&&!ol(a)&&(e.class=fs(a)),oh(l)&&(jue(l)&&!vs(l)&&(l=xc({},l)),e.style=tb(l))}const o=ol(t)?1:oot(t)?128:ygi(t)?64:oh(t)?4:Fa(t)?2:0;return Mt(t,e,i,r,n,o,s,!0)}function bPe(t){return t?jue(t)||pce in t?xc({},t):t:null}function Y2(t,e,i=!1){const{props:r,ref:n,patchFlag:s,children:o}=t,a=e?XX(r||{},e):r;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:a,key:a&&Uot(a),ref:e&&e.ref?i&&n?vs(n)?n.concat(fce(e)):[n,fce(e)]:fce(e):n,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:o,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==eo?s===-1?16:s|16:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Y2(t.ssContent),ssFallback:t.ssFallback&&Y2(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce}}function Fs(t=" ",e=0){return Rn(EP,null,t,e)}function mce(t,e){const i=Rn(XM,null,t);return i.staticCount=e,i}function hn(t="",e=!1){return e?(Kt(),Pn(sy,null,t)):Rn(sy,null,t)}function nb(t){return t==null||typeof t=="boolean"?Rn(sy):vs(t)?Rn(eo,null,t.slice()):typeof t=="object"?KM(t):Rn(EP,null,String(t))}function KM(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Y2(t)}function wPe(t,e){let i=0;const{shapeFlag:r}=t;if(e==null)e=null;else if(vs(e))i=16;else if(typeof e=="object")if(r&65){const n=e.default;n&&(n._c&&(n._d=!1),wPe(t,n()),n._c&&(n._d=!0));return}else{i=32;const n=e._;!n&&!(pce in e)?e._ctx=ry:n===3&&ry&&(ry.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else Fa(e)?(e={default:e,_ctx:ry},i=32):(e=String(e),r&64?(i=16,e=[Fs(e)]):i=8);t.children=e,t.shapeFlag|=i}function XX(...t){const e={};for(let i=0;i$p||ry,JM=t=>{$p=t,t.scope.on()},ZM=()=>{$p&&$p.scope.off(),$p=null};function zot(t){return t.vnode.shapeFlag&4}let XG=!1;function Hot(t,e=!1){XG=e;const{props:i,children:r}=t.vnode,n=zot(t);lgi(t,i,n,e),hgi(t,r);const s=n?Sgi(t,e):void 0;return XG=!1,s}function Sgi(t,e){const i=t.type;t.accessCache=Object.create(null),t.proxy=Ho(new Proxy(t.ctx,cPe));const{setup:r}=i;if(r){const n=t.setupContext=r.length>1?Yot(t):null;JM(t),zG();const s=NT(r,t,0,[t.props,n]);if(HG(),ZM(),DAe(s)){if(s.then(ZM,ZM),e)return s.then(o=>{xPe(t,o,e)}).catch(o=>{WM(o,t,0)});t.asyncDep=s}else xPe(t,s,e)}else qot(t,e)}function xPe(t,e,i){Fa(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:oh(e)&&(t.setupState=Hue(e)),qot(t,i)}let gce,SPe;function CPe(t){gce=t,SPe=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,igi))}}const Wot=()=>!gce;function qot(t,e,i){const r=t.type;if(!t.render){if(!e&&gce&&!r.render){const n=r.template||dPe(t).template;if(n){const{isCustomElement:s,compilerOptions:o}=t.appContext.config,{delimiters:a,compilerOptions:l}=r,c=xc(xc({isCustomElement:s,delimiters:a},o),l);r.render=gce(n,c)}}t.render=r.render||dv,SPe&&SPe(t)}JM(t),zG(),rgi(t),HG(),ZM()}function Cgi(t){return new Proxy(t.attrs,{get(e,i){return v_(t,"get","$attrs"),e[i]}})}function Yot(t){const e=r=>{t.exposed=r||{}};let i;return{get attrs(){return i||(i=Cgi(t))},slots:t.slots,emit:t.emit,expose:e}}function yce(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy(Hue(Ho(t.exposed)),{get(e,i){if(i in e)return e[i];if(i in WX)return WX[i](t)},has(e,i){return i in e||i in WX}}))}function TPe(t,e=!0){return Fa(t)?t.displayName||t.name:t.name||e&&t.__name}function Tgi(t){return Fa(t)&&"__vccOpts"in t}const Vr=(t,e)=>Bmi(t,e,XG);function Xot(){return null}function Kot(){return null}function Jot(t){}function Zot(t,e){return null}function Qot(){return tat().slots}function eat(){return tat().attrs}function tat(){const t=ff();return t.setupContext||(t.setupContext=Yot(t))}function iat(t,e){const i=vs(t)?t.reduce((r,n)=>(r[n]={},r),{}):t;for(const r in e){const n=i[r];n?vs(n)||Fa(n)?i[r]={type:n,default:e[r]}:n.default=e[r]:n===null&&(i[r]={default:e[r]})}return i}function rat(t,e){const i={};for(const r in t)e.includes(r)||Object.defineProperty(i,r,{enumerable:!0,get:()=>t[r]});return i}function nat(t){const e=ff();let i=t();return ZM(),DAe(i)&&(i=i.catch(r=>{throw JM(e),r})),[i,()=>JM(e)]}function X2(t,e,i){const r=arguments.length;return r===2?oh(e)&&!vs(e)?GT(e)?Rn(t,null,[e]):Rn(t,e):Rn(t,null,e):(r>3?i=Array.prototype.slice.call(arguments,2):r===3&>(i)&&(i=[i]),Rn(t,e,i))}const EPe=Symbol(""),IPe=()=>Qs(EPe);function sat(){}function oat(t,e,i,r){const n=i[r];if(n&&vce(n,t))return n;const s=e();return s.memo=t.slice(),i[r]=s}function vce(t,e){const i=t.memo;if(i.length!=e.length)return!1;for(let r=0;r0&&b_&&b_.push(t),!0}const APe="3.2.47",aat={createComponentInstance:jot,setupComponent:Hot,renderComponentRoot:Que,setCurrentRenderingInstance:BX,isVNode:GT,normalizeVNode:nb},lat=null,uat=null,Egi="http://www.w3.org/2000/svg",Kk=typeof document<"u"?document:null,cat=Kk&&Kk.createElement("template"),Igi={insert:(t,e,i)=>{e.insertBefore(t,i||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,i,r)=>{const n=e?Kk.createElementNS(Egi,t):Kk.createElement(t,i?{is:i}:void 0);return t==="select"&&r&&r.multiple!=null&&n.setAttribute("multiple",r.multiple),n},createText:t=>Kk.createTextNode(t),createComment:t=>Kk.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Kk.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,i,r,n,s){const o=i?i.previousSibling:e.lastChild;if(n&&(n===s||n.nextSibling))for(;e.insertBefore(n.cloneNode(!0),i),!(n===s||!(n=n.nextSibling)););else{cat.innerHTML=r?`${t}`:t;const a=cat.content;if(r){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,i)}return[o?o.nextSibling:e.firstChild,i?i.previousSibling:e.lastChild]}};function Agi(t,e,i){const r=t._vtc;r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):i?t.setAttribute("class",e):t.className=e}function Pgi(t,e,i){const r=t.style,n=ol(i);if(i&&!n){if(e&&!ol(e))for(const s in e)i[s]==null&&PPe(r,s,"");for(const s in i)PPe(r,s,i[s])}else{const s=r.display;n?e!==i&&(r.cssText=i):e&&t.removeAttribute("style"),"_vod"in t&&(r.display=s)}}const hat=/\s*!important$/;function PPe(t,e,i){if(vs(i))i.forEach(r=>PPe(t,e,r));else if(i==null&&(i=""),e.startsWith("--"))t.setProperty(e,i);else{const r=Ogi(t,e);hat.test(i)?t.setProperty(ib(r),i.replace(hat,""),"important"):t[r]=i}}const dat=["Webkit","Moz","ms"],OPe={};function Ogi(t,e){const i=OPe[e];if(i)return i;let r=Lm(e);if(r!=="filter"&&r in t)return OPe[e]=r;r=VM(r);for(let n=0;nRPe||(kgi.then(()=>RPe=0),RPe=Date.now());function $gi(t,e){const i=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=i.attached)return;__(Bgi(r,i.value),e,5,[r])};return i.value=t,i.attached=Ngi(),i}function Bgi(t,e){if(vs(e)){const i=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{i.call(t),t._stopped=!0},e.map(r=>n=>!n._stopped&&r&&r(n))}else return e}const mat=/^on[a-z]/,Ggi=(t,e,i,r,n=!1,s,o,a,l)=>{e==="class"?Agi(t,r,n):e==="style"?Pgi(t,i,r):Fk(e)?RAe(e)||Fgi(t,e,i,r,o):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Vgi(t,e,r,n))?Mgi(t,e,r,s,o,a,l):(e==="true-value"?t._trueValue=r:e==="false-value"&&(t._falseValue=r),Rgi(t,e,r,n))};function Vgi(t,e,i,r){return r?!!(e==="innerHTML"||e==="textContent"||e in t&&mat.test(e)&&Fa(i)):e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA"||mat.test(e)&&ol(i)?!1:e in t}function MPe(t,e){const i=Zr(t);class r extends KX{constructor(s){super(i,s,e)}}return r.def=i,r}const gat=t=>MPe(t,$Pe),Ugi=typeof HTMLElement<"u"?HTMLElement:class{};class KX extends Ugi{constructor(e,i={},r){super(),this._def=e,this._props=i,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,iy(()=>{this._connected||(K2(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&&!vs(s))for(const l in s){const c=s[l];(c===Number||c&&c.type===Number)&&(l in this._props&&(this._props[l]=Pue(this._props[l])),(a||(a=Object.create(null)))[Lm(l)]=!0)}this._numberProps=a,n&&this._resolveProps(r),this._applyStyles(o),this._update()},i=this._def.__asyncLoader;i?i().then(r=>e(r,!0)):e(this._def)}_resolveProps(e){const{props:i}=e,r=vs(i)?i:Object.keys(i||{});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(Lm))Object.defineProperty(this,n,{get(){return this._getProp(n)},set(s){this._setProp(n,s)}})}_setAttr(e){let i=this.getAttribute(e);const r=Lm(e);this._numberProps&&this._numberProps[r]&&(i=Pue(i)),this._setProp(r,i,!1)}_getProp(e){return this._props[e]}_setProp(e,i,r=!0,n=!0){i!==this._props[e]&&(this._props[e]=i,n&&this._instance&&this._update(),r&&(i===!0?this.setAttribute(ib(e),""):typeof i=="string"||typeof i=="number"?this.setAttribute(ib(e),i+""):i||this.removeAttribute(ib(e))))}_update(){K2(this._createVNode(),this.shadowRoot)}_createVNode(){const e=Rn(this._def,xc({},this._props));return this._instance||(e.ce=i=>{this._instance=i,i.isCE=!0;const r=(s,o)=>{this.dispatchEvent(new CustomEvent(s,{detail:o}))};i.emit=(s,...o)=>{r(s,o),ib(s)!==s&&r(ib(s),o)};let n=this;for(;n=n&&(n.parentNode||n.host);)if(n instanceof KX){i.parent=n._instance,i.provides=n._instance.provides;break}}),e}_applyStyles(e){e&&e.forEach(i=>{const r=document.createElement("style");r.textContent=i,this.shadowRoot.appendChild(r)})}}function yat(t="$style"){{const e=ff();if(!e)return Yc;const i=e.type.__cssModules;if(!i)return Yc;const r=i[t];return r||Yc}}function vat(t){const e=ff();if(!e)return;const i=e.ut=(n=t(e.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(s=>FPe(s,n))},r=()=>{const n=t(e.proxy);DPe(e.subTree,n),i(n)};KAe(r),al(()=>{const n=new MutationObserver(r);n.observe(e.subTree.el.parentNode,{childList:!0}),Wk(()=>n.disconnect())})}function DPe(t,e){if(t.shapeFlag&128){const i=t.suspense;t=i.activeBranch,i.pendingBranch&&!i.isHydrating&&i.effects.push(()=>{DPe(i.activeBranch,e)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)FPe(t.el,e);else if(t.type===eo)t.children.forEach(i=>DPe(i,e));else if(t.type===XM){let{el:i,anchor:r}=t;for(;i&&(FPe(i,e),i!==r);)i=i.nextSibling}}function FPe(t,e){if(t.nodeType===1){const i=t.style;for(const r in e)i.setProperty(`--${r}`,e[r])}}const QM="transition",JX="animation",Jk=(t,{slots:e})=>X2(rce,wat(t),e);Jk.displayName="Transition";const _at={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},jgi=Jk.props=xc({},rce.props,_at),Zk=(t,e=[])=>{vs(t)?t.forEach(i=>i(...e)):t&&t(...e)},bat=t=>t?vs(t)?t.some(e=>e.length>1):t.length>1:!1;function wat(t){const e={};for(const Ie in t)Ie in _at||(e[Ie]=t[Ie]);if(t.css===!1)return e;const{name:i="v",type:r,duration:n,enterFromClass:s=`${i}-enter-from`,enterActiveClass:o=`${i}-enter-active`,enterToClass:a=`${i}-enter-to`,appearFromClass:l=s,appearActiveClass:c=o,appearToClass:d=a,leaveFromClass:p=`${i}-leave-from`,leaveActiveClass:y=`${i}-leave-active`,leaveToClass:v=`${i}-leave-to`}=t,S=zgi(n),I=S&&S[0],O=S&&S[1],{onBeforeEnter:L,onEnter:N,onEnterCancelled:G,onLeave:V,onLeaveCancelled:Y,onBeforeAppear:X=L,onAppear:te=N,onAppearCancelled:re=G}=e,fe=(Ie,ke,Ne)=>{eD(Ie,ke?d:a),eD(Ie,ke?c:o),Ne&&Ne()},ge=(Ie,ke)=>{Ie._isLeaving=!1,eD(Ie,p),eD(Ie,v),eD(Ie,y),ke&&ke()},_e=Ie=>(ke,Ne)=>{const J=Ie?te:N,he=()=>fe(ke,Ie,Ne);Zk(J,[ke,he]),xat(()=>{eD(ke,Ie?l:s),AP(ke,Ie?d:a),bat(J)||Sat(ke,r,I,he)})};return xc(e,{onBeforeEnter(Ie){Zk(L,[Ie]),AP(Ie,s),AP(Ie,o)},onBeforeAppear(Ie){Zk(X,[Ie]),AP(Ie,l),AP(Ie,c)},onEnter:_e(!1),onAppear:_e(!0),onLeave(Ie,ke){Ie._isLeaving=!0;const Ne=()=>ge(Ie,ke);AP(Ie,p),Iat(),AP(Ie,y),xat(()=>{Ie._isLeaving&&(eD(Ie,p),AP(Ie,v),bat(V)||Sat(Ie,r,O,Ne))}),Zk(V,[Ie,Ne])},onEnterCancelled(Ie){fe(Ie,!1),Zk(G,[Ie])},onAppearCancelled(Ie){fe(Ie,!0),Zk(re,[Ie])},onLeaveCancelled(Ie){ge(Ie),Zk(Y,[Ie])}})}function zgi(t){if(t==null)return null;if(oh(t))return[LPe(t.enter),LPe(t.leave)];{const e=LPe(t);return[e,e]}}function LPe(t){return Pue(t)}function AP(t,e){e.split(/\s+/).forEach(i=>i&&t.classList.add(i)),(t._vtc||(t._vtc=new Set)).add(e)}function eD(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.remove(r));const{_vtc:i}=t;i&&(i.delete(e),i.size||(t._vtc=void 0))}function xat(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let Hgi=0;function Sat(t,e,i,r){const n=t._endId=++Hgi,s=()=>{n===t._endId&&r()};if(i)return setTimeout(s,i);const{type:o,timeout:a,propCount:l}=Cat(t,e);if(!o)return r();const c=o+"end";let d=0;const p=()=>{t.removeEventListener(c,y),s()},y=v=>{v.target===t&&++d>=l&&p()};setTimeout(()=>{d(i[S]||"").split(", "),n=r(`${QM}Delay`),s=r(`${QM}Duration`),o=Tat(n,s),a=r(`${JX}Delay`),l=r(`${JX}Duration`),c=Tat(a,l);let d=null,p=0,y=0;e===QM?o>0&&(d=QM,p=o,y=s.length):e===JX?c>0&&(d=JX,p=c,y=l.length):(p=Math.max(o,c),d=p>0?o>c?QM:JX:null,y=d?d===QM?s.length:l.length:0);const v=d===QM&&/\b(transform|all)(,|$)/.test(r(`${QM}Property`).toString());return{type:d,timeout:p,propCount:y,hasTransform:v}}function Tat(t,e){for(;t.lengthEat(i)+Eat(t[r])))}function Eat(t){return Number(t.slice(0,-1).replace(",","."))*1e3}function Iat(){return document.body.offsetHeight}const Aat=new WeakMap,Pat=new WeakMap,Oat={name:"TransitionGroup",props:xc({},jgi,{tag:String,moveClass:String}),setup(t,{slots:e}){const i=ff(),r=ice();let n,s;return Hk(()=>{if(!n.length)return;const o=t.moveClass||`${t.name||"v"}-move`;if(!Kgi(n[0].el,i.vnode.el,o))return;n.forEach(qgi),n.forEach(Ygi);const a=n.filter(Xgi);Iat(),a.forEach(l=>{const c=l.el,d=c.style;AP(c,o),d.transform=d.webkitTransform=d.transitionDuration="";const p=c._moveCb=y=>{y&&y.target!==c||(!y||/transform$/.test(y.propertyName))&&(c.removeEventListener("transitionend",p),c._moveCb=null,eD(c,o))};c.addEventListener("transitionend",p)})}),()=>{const o=Hs(t),a=wat(o);let l=o.tag||eo;n=s,s=e.default?UX(e.default()):[];for(let c=0;cdelete t.mode;Oat.props;const kPe=Oat;function qgi(t){const e=t.el;e._moveCb&&e._moveCb(),e._enterCb&&e._enterCb()}function Ygi(t){Pat.set(t,t.el.getBoundingClientRect())}function Xgi(t){const e=Aat.get(t),i=Pat.get(t),r=e.left-i.left,n=e.top-i.top;if(r||n){const s=t.el.style;return s.transform=s.webkitTransform=`translate(${r}px,${n}px)`,s.transitionDuration="0s",t}}function Kgi(t,e,i){const r=t.cloneNode();t._vtc&&t._vtc.forEach(o=>{o.split(/\s+/).forEach(a=>a&&r.classList.remove(a))}),i.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}=Cat(r);return n.removeChild(r),s}const tD=t=>{const e=t.props["onUpdate:modelValue"]||!1;return vs(e)?i=>UG(e,i):e};function Jgi(t){t.target.composing=!0}function Rat(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const Ow={created(t,{modifiers:{lazy:e,trim:i,number:r}},n){t._assign=tD(n);const s=r||n.props&&n.props.type==="number";IP(t,e?"change":"input",o=>{if(o.target.composing)return;let a=t.value;i&&(a=a.trim()),s&&(a=Aue(a)),t._assign(a)}),i&&IP(t,"change",()=>{t.value=t.value.trim()}),e||(IP(t,"compositionstart",Jgi),IP(t,"compositionend",Rat),IP(t,"change",Rat))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,modifiers:{lazy:i,trim:r,number:n}},s){if(t._assign=tD(s),t.composing||document.activeElement===t&&t.type!=="range"&&(i||r&&t.value.trim()===e||(n||t.type==="number")&&Aue(t.value)===e))return;const o=e??"";t.value!==o&&(t.value=o)}},_ce={deep:!0,created(t,e,i){t._assign=tD(i),IP(t,"change",()=>{const r=t._modelValue,n=KG(t),s=t.checked,o=t._assign;if(vs(r)){const a=Cue(r,n),l=a!==-1;if(s&&!l)o(r.concat(n));else if(!s&&l){const c=[...r];c.splice(a,1),o(c)}}else if(Lk(r)){const a=new Set(r);s?a.add(n):a.delete(n),o(a)}else o(Fat(t,s))})},mounted:Mat,beforeUpdate(t,e,i){t._assign=tD(i),Mat(t,e,i)}};function Mat(t,{value:e,oldValue:i},r){t._modelValue=e,vs(e)?t.checked=Cue(e,r.props.value)>-1:Lk(e)?t.checked=e.has(r.props.value):e!==i&&(t.checked=BM(e,Fat(t,!0)))}const bce={created(t,{value:e},i){t.checked=BM(e,i.props.value),t._assign=tD(i),IP(t,"change",()=>{t._assign(KG(t))})},beforeUpdate(t,{value:e,oldValue:i},r){t._assign=tD(r),e!==i&&(t.checked=BM(e,r.props.value))}},ZX={deep:!0,created(t,{value:e,modifiers:{number:i}},r){const n=Lk(e);IP(t,"change",()=>{const s=Array.prototype.filter.call(t.options,o=>o.selected).map(o=>i?Aue(KG(o)):KG(o));t._assign(t.multiple?n?new Set(s):s:s[0])}),t._assign=tD(r)},mounted(t,{value:e}){Dat(t,e)},beforeUpdate(t,e,i){t._assign=tD(i)},updated(t,{value:e}){Dat(t,e)}};function Dat(t,e){const i=t.multiple;if(!(i&&!vs(e)&&!Lk(e))){for(let r=0,n=t.options.length;r-1:s.selected=e.has(o);else if(BM(KG(s),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!i&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function KG(t){return"_value"in t?t._value:t.value}function Fat(t,e){const i=e?"_trueValue":"_falseValue";return i in t?t[i]:e}const NPe={created(t,e,i){wce(t,e,i,null,"created")},mounted(t,e,i){wce(t,e,i,null,"mounted")},beforeUpdate(t,e,i,r){wce(t,e,i,r,"beforeUpdate")},updated(t,e,i,r){wce(t,e,i,r,"updated")}};function Lat(t,e){switch(t){case"SELECT":return ZX;case"TEXTAREA":return Ow;default:switch(e){case"checkbox":return _ce;case"radio":return bce;default:return Ow}}}function wce(t,e,i,r,n){const o=Lat(t.tagName,i.props&&i.props.type)[n];o&&o(t,e,i,r)}function Zgi(){Ow.getSSRProps=({value:t})=>({value:t}),bce.getSSRProps=({value:t},e)=>{if(e.props&&BM(e.props.value,t))return{checked:!0}},_ce.getSSRProps=({value:t},e)=>{if(vs(t)){if(e.props&&Cue(t,e.props.value)>-1)return{checked:!0}}else if(Lk(t)){if(e.props&&t.has(e.props.value))return{checked:!0}}else if(t)return{checked:!0}},NPe.getSSRProps=(t,e)=>{if(typeof e.type!="string")return;const i=Lat(e.type.toUpperCase(),e.props&&e.props.type);if(i.getSSRProps)return i.getSSRProps(t,e)}}const Qgi=["ctrl","shift","alt","meta"],eyi={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>Qgi.some(i=>t[`${i}Key`]&&!e.includes(i))},_a=(t,e)=>(i,...r)=>{for(let n=0;ni=>{if(!("key"in i))return;const r=ib(i.key);if(e.some(n=>n===r||tyi[n]===r))return t(i)},Bp={beforeMount(t,{value:e},{transition:i}){t._vod=t.style.display==="none"?"":t.style.display,i&&e?i.beforeEnter(t):QX(t,e)},mounted(t,{value:e},{transition:i}){i&&e&&i.enter(t)},updated(t,{value:e,oldValue:i},{transition:r}){!e!=!i&&(r?e?(r.beforeEnter(t),QX(t,!0),r.enter(t)):r.leave(t,()=>{QX(t,!1)}):QX(t,e))},beforeUnmount(t,{value:e}){QX(t,e)}};function QX(t,e){t.style.display=e?t._vod:"none"}function iyi(){Bp.getSSRProps=({value:t})=>{if(!t)return{style:{display:"none"}}}}const kat=xc({patchProp:Ggi},Igi);let eK,Nat=!1;function $at(){return eK||(eK=gPe(kat))}function Bat(){return eK=Nat?eK:yPe(kat),Nat=!0,eK}const K2=(...t)=>{$at().render(...t)},$Pe=(...t)=>{Bat().hydrate(...t)},xce=(...t)=>{const e=$at().createApp(...t),{mount:i}=e;return e.mount=r=>{const n=Vat(r);if(!n)return;const s=e._component;!Fa(s)&&!s.render&&!s.template&&(s.template=n.innerHTML),n.innerHTML="";const o=i(n,!1,n instanceof SVGElement);return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),o},e},Gat=(...t)=>{const e=Bat().createApp(...t),{mount:i}=e;return e.mount=r=>{const n=Vat(r);if(n)return i(n,!0,n instanceof SVGElement)},e};function Vat(t){return ol(t)?document.querySelector(t):t}let Uat=!1;const jat=()=>{Uat||(Uat=!0,Zgi(),iyi())},ryi=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:rce,Comment:sy,EffectScope:Oue,Fragment:eo,KeepAlive:mot,ReactiveEffect:jG,Static:XM,Suspense:aot,Teleport:Not,Text:EP,Transition:Jk,TransitionGroup:kPe,VueElement:KX,assertNumber:Zst,callWithAsyncErrorHandling:__,callWithErrorHandling:NT,camelize:Lm,capitalize:VM,cloneVNode:Y2,compatUtils:uat,computed:Vr,createApp:xce,createBlock:Pn,createCommentVNode:hn,createElementBlock:ci,createElementVNode:Mt,createHydrationRenderer:yPe,createPropsRestProxy:rat,createRenderer:gPe,createSSRApp:Gat,createSlots:_ot,createStaticVNode:mce,createTextVNode:Fs,createVNode:Rn,customRef:Xst,defineAsyncComponent:jX,defineComponent:Zr,defineCustomElement:MPe,defineEmits:Kot,defineExpose:Jot,defineProps:Xot,defineSSRCustomElement:gat,get devtools(){return Vk},effect:Ast,effectScope:FX,getCurrentInstance:ff,getCurrentScope:Rue,getTransitionRawChildren:UX,guardReactiveProps:bPe,h:X2,handleError:WM,hydrate:$Pe,initCustomFormatter:sat,initDirectivesForSSR:jat,inject:Qs,isMemoSame:vce,isProxy:jue,isReactive:Aw,isReadonly:HM,isRef:lc,isRuntimeOnly:Wot,isShallow:WG,isVNode:GT,markRaw:Ho,mergeDefaults:iat,mergeProps:XX,nextTick:iy,normalizeClass:fs,normalizeProps:yst,normalizeStyle:tb,onActivated:QAe,onBeforeMount:pv,onBeforeUnmount:su,onBeforeUpdate:sce,onDeactivated:ePe,onErrorCaptured:oce,onMounted:al,onRenderTracked:sPe,onRenderTriggered:nPe,onScopeDispose:LAe,onServerPrefetch:rPe,onUnmounted:Wk,onUpdated:Hk,openBlock:Kt,popScopeId:Kc,provide:ece,proxyRefs:Hue,pushScopeId:Xc,queuePostFlushCb:Yue,reactive:Tl,readonly:Vue,ref:Pi,registerRuntimeCompiler:CPe,render:K2,renderList:ou,renderSlot:jf,resolveComponent:Io,resolveDirective:Qn,resolveDynamicComponent:TP,resolveFilter:lat,resolveTransitionHooks:jk,setBlockTracking:dce,setDevtoolsHook:qAe,setTransitionHooks:qM,shallowReactive:VAe,shallowReadonly:Wst,shallowRef:zAe,ssrContextKey:EPe,ssrUtils:aat,stop:Pst,toDisplayString:gr,toHandlerKey:Nk,toHandlers:wot,toRaw:Hs,toRef:Wue,toRefs:Bk,transformVNodeArgs:Vot,triggerRef:Yst,unref:Qt,useAttrs:eat,useCssModule:yat,useCssVars:vat,useSSRContext:IPe,useSlots:Qot,useTransitionState:ice,vModelCheckbox:_ce,vModelDynamic:NPe,vModelRadio:bce,vModelSelect:ZX,vModelText:Ow,vShow:Bp,version:APe,warn:Jst,watch:Sc,watchEffect:cot,watchPostEffect:KAe,watchSyncEffect:hot,withAsyncContext:nat,withCtx:yn,withDefaults:Zot,withDirectives:Br,withKeys:Ch,withMemo:oat,withModifiers:_a,withScopeId:not},Symbol.toStringTag,{value:"Module"}));function BPe(t){throw t}function zat(t){}function Gd(t,e,i,r){const n=t,s=new SyntaxError(String(n));return s.code=t,s.loc=e,s}const tK=Symbol(""),iK=Symbol(""),GPe=Symbol(""),Sce=Symbol(""),Hat=Symbol(""),Qk=Symbol(""),Wat=Symbol(""),qat=Symbol(""),VPe=Symbol(""),UPe=Symbol(""),rK=Symbol(""),jPe=Symbol(""),Yat=Symbol(""),zPe=Symbol(""),Cce=Symbol(""),HPe=Symbol(""),WPe=Symbol(""),qPe=Symbol(""),YPe=Symbol(""),Xat=Symbol(""),Kat=Symbol(""),Tce=Symbol(""),Ece=Symbol(""),XPe=Symbol(""),KPe=Symbol(""),nK=Symbol(""),sK=Symbol(""),JPe=Symbol(""),ZPe=Symbol(""),nyi=Symbol(""),QPe=Symbol(""),Ice=Symbol(""),syi=Symbol(""),oyi=Symbol(""),eOe=Symbol(""),ayi=Symbol(""),lyi=Symbol(""),tOe=Symbol(""),Jat=Symbol(""),JG={[tK]:"Fragment",[iK]:"Teleport",[GPe]:"Suspense",[Sce]:"KeepAlive",[Hat]:"BaseTransition",[Qk]:"openBlock",[Wat]:"createBlock",[qat]:"createElementBlock",[VPe]:"createVNode",[UPe]:"createElementVNode",[rK]:"createCommentVNode",[jPe]:"createTextVNode",[Yat]:"createStaticVNode",[zPe]:"resolveComponent",[Cce]:"resolveDynamicComponent",[HPe]:"resolveDirective",[WPe]:"resolveFilter",[qPe]:"withDirectives",[YPe]:"renderList",[Xat]:"renderSlot",[Kat]:"createSlots",[Tce]:"toDisplayString",[Ece]:"mergeProps",[XPe]:"normalizeClass",[KPe]:"normalizeStyle",[nK]:"normalizeProps",[sK]:"guardReactiveProps",[JPe]:"toHandlers",[ZPe]:"camelize",[nyi]:"capitalize",[QPe]:"toHandlerKey",[Ice]:"setBlockTracking",[syi]:"pushScopeId",[oyi]:"popScopeId",[eOe]:"withCtx",[ayi]:"unref",[lyi]:"isRef",[tOe]:"withMemo",[Jat]:"isMemoSame"};function uyi(t){Object.getOwnPropertySymbols(t).forEach(e=>{JG[e]=t[e]})}const sb={source:"",start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}};function cyi(t,e=sb){return{type:0,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:0,temps:0,codegenNode:void 0,loc:e}}function oK(t,e,i,r,n,s,o,a=!1,l=!1,c=!1,d=sb){return t&&(a?(t.helper(Qk),t.helper(tV(t.inSSR,c))):t.helper(eV(t.inSSR,c)),o&&t.helper(qPe)),{type:13,tag:e,props:i,children:r,patchFlag:n,dynamicProps:s,directives:o,isBlock:a,disableTracking:l,isComponent:c,loc:d}}function aK(t,e=sb){return{type:17,loc:e,elements:t}}function Rw(t,e=sb){return{type:15,loc:e,properties:t}}function Gp(t,e){return{type:16,loc:sb,key:ol(t)?Ll(t,!0):t,value:e}}function Ll(t,e=!1,i=sb,r=0){return{type:4,loc:i,content:t,isStatic:e,constType:e?3:r}}function J2(t,e=sb){return{type:8,loc:e,children:t}}function zf(t,e=[],i=sb){return{type:14,loc:i,callee:t,arguments:e}}function ZG(t,e=void 0,i=!1,r=!1,n=sb){return{type:18,params:t,returns:e,newline:i,isSlot:r,loc:n}}function iOe(t,e,i,r=!0){return{type:19,test:t,consequent:e,alternate:i,newline:r,loc:sb}}function hyi(t,e,i=!1){return{type:20,index:t,value:e,isVNode:i,loc:sb}}function dyi(t){return{type:21,body:t,loc:sb}}const x_=t=>t.type===4&&t.isStatic,QG=(t,e)=>t===e||t===ib(e);function Zat(t){if(QG(t,"Teleport"))return iK;if(QG(t,"Suspense"))return GPe;if(QG(t,"KeepAlive"))return Sce;if(QG(t,"BaseTransition"))return Hat}const pyi=/^\d|[^\$\w]/,rOe=t=>!pyi.test(t),fyi=/[A-Za-z_$\xA0-\uFFFF]/,myi=/[\.\?\w$\xA0-\uFFFF]/,gyi=/\s+[.[]\s*|\s*[.[]\s+/g,Qat=t=>{t=t.trim().replace(gyi,o=>o.trim());let e=0,i=[],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 nOe(t){return t.type===5||t.type===2}function vyi(t){return t.type===7&&t.name==="slot"}function Rce(t){return t.type===1&&t.tagType===3}function Mce(t){return t.type===1&&t.tagType===2}function eV(t,e){return t||e?VPe:UPe}function tV(t,e){return t||e?Wat:qat}const _yi=new Set([nK,sK]);function tlt(t,e=[]){if(t&&!ol(t)&&t.type===14){const i=t.callee;if(!ol(i)&&_yi.has(i))return tlt(t.arguments[0],e.concat(t))}return[t,e]}function Dce(t,e,i){let r,n=t.type===13?t.props:t.arguments[2],s=[],o;if(n&&!ol(n)&&n.type===14){const a=tlt(n);n=a[0],s=a[1],o=s[s.length-1]}if(n==null||ol(n))r=Rw([e]);else if(n.type===14){const a=n.arguments[0];!ol(a)&&a.type===15?ilt(e,a)||a.properties.unshift(e):n.callee===JPe?r=zf(i.helper(Ece),[Rw([e]),n]):n.arguments.unshift(Rw([e])),!r&&(r=n)}else n.type===15?(ilt(e,n)||n.properties.unshift(e),r=n):(r=zf(i.helper(Ece),[Rw([e]),n]),o&&o.callee===sK&&(o=s[s.length-2]));t.type===13?o?o.arguments[0]=r:t.props=r:o?o.arguments[0]=r:t.arguments[2]=r}function ilt(t,e){let i=!1;if(t.key.type===4){const r=t.key.content;i=e.properties.some(n=>n.key.type===4&&n.key.content===r)}return i}function lK(t,e){return`_${e}_${t.replace(/[^\w]/g,(i,r)=>i==="-"?"_":t.charCodeAt(r).toString())}`}function byi(t){return t.type===14&&t.callee===tOe?t.arguments[1].returns:t}function sOe(t,{helper:e,removeHelper:i,inSSR:r}){t.isBlock||(t.isBlock=!0,i(eV(r,t.isComponent)),e(Qk),e(tV(r,t.isComponent)))}function rlt(t,e){const i=e.options?e.options.compatConfig:e.compatConfig,r=i&&i[t];return t==="MODE"?r||3:r}function tN(t,e){const i=rlt("MODE",e),r=rlt(t,e);return i===3?r===!0:r!==!1}function uK(t,e,i,...r){return tN(t,e)}const wyi=/&(gt|lt|amp|apos|quot);/g,xyi={gt:">",lt:"<",amp:"&",apos:"'",quot:'"'},nlt={delimiters:["{{","}}"],getNamespace:()=>0,getTextMode:()=>0,isVoidTag:Tue,isPreTag:Tue,isCustomElement:Tue,decodeEntities:t=>t.replace(wyi,(e,i)=>xyi[i]),onError:BPe,onWarn:zat,comments:!1};function Syi(t,e={}){const i=Cyi(t,e),r=ob(i);return cyi(oOe(i,0,[]),Dw(i,r))}function Cyi(t,e){const i=xc({},nlt);let r;for(r in e)i[r]=e[r]===void 0?nlt[r]:e[r];return{options:i,column:1,line:1,offset:0,originalSource:t,source:t,inPre:!1,inVPre:!1,onWarn:i.onWarn}}function oOe(t,e,i){const r=Fce(i),n=r?r.ns:0,s=[];for(;!Dyi(t,e,i);){const a=t.source;let l;if(e===0||e===1){if(!t.inVPre&&y0(a,t.options.delimiters[0]))l=Ryi(t,e);else if(e===0&&a[0]==="<")if(a.length===1)Jc(t,5,1);else if(a[1]==="!")y0(a,"=0;){const c=o[a];c&&c.type===9&&(l+=c.branches.length)}return()=>{if(s)r.codegenNode=blt(n,l,i);else{const c=r0i(r.codegenNode);c.alternate=blt(n,l+r.branches.length-1,i)}}}));function i0i(t,e,i,r){if(e.name!=="else"&&(!e.exp||!e.exp.content.trim())){const n=e.exp?e.exp.loc:t.loc;i.onError(Gd(28,e.loc)),e.exp=Ll("true",!1,n)}if(e.name==="if"){const n=_lt(t,e),s={type:9,loc:t.loc,branches:[n]};if(i.replaceNode(s),r)return r(s,n,!0)}else{const n=i.parent.children;let s=n.indexOf(t);for(;s-->=-1;){const o=n[s];if(o&&o.type===3){i.removeNode(o);continue}if(o&&o.type===2&&!o.content.trim().length){i.removeNode(o);continue}if(o&&o.type===9){e.name==="else-if"&&o.branches[o.branches.length-1].condition===void 0&&i.onError(Gd(30,t.loc)),i.removeNode();const a=_lt(t,e);o.branches.push(a);const l=r&&r(o,a,!1);kce(a,i),l&&l(),i.currentNode=null}else i.onError(Gd(30,t.loc));break}}}function _lt(t,e){const i=t.tagType===3;return{type:10,loc:t.loc,condition:e.name==="else"?void 0:e.exp,children:i&&!Mw(t,"for")?t.children:[t],userKey:Oce(t,"key"),isTemplateIf:i}}function blt(t,e,i){return t.condition?iOe(t.condition,wlt(t,e,i),zf(i.helper(rK),['""',"true"])):wlt(t,e,i)}function wlt(t,e,i){const{helper:r}=i,n=Gp("key",Ll(`${e}`,!1,sb,2)),{children:s}=t,o=s[0];if(s.length!==1||o.type!==1)if(s.length===1&&o.type===11){const l=o.codegenNode;return Dce(l,n,i),l}else{let l=64;return oK(i,r(tK),Rw([n]),s,l+"",void 0,void 0,!0,!1,!1,t.loc)}else{const l=o.codegenNode,c=byi(l);return c.type===13&&sOe(c,i),Dce(c,n,i),l}}function r0i(t){for(;;)if(t.type===19)if(t.alternate.type===19)t=t.alternate;else return t;else t.type===20&&(t=t.value)}const n0i=flt("for",(t,e,i)=>{const{helper:r,removeHelper:n}=i;return s0i(t,e,i,s=>{const o=zf(r(YPe),[s.source]),a=Rce(t),l=Mw(t,"memo"),c=Oce(t,"key"),d=c&&(c.type===6?Ll(c.value.content,!0):c.exp),p=c?Gp("key",d):null,y=s.source.type===4&&s.source.constType>0,v=y?64:c?128:256;return s.codegenNode=oK(i,r(tK),void 0,o,v+"",void 0,void 0,!0,!y,!1,t.loc),()=>{let S;const{children:I}=s,O=I.length!==1||I[0].type!==1,L=Mce(t)?t:a&&t.children.length===1&&Mce(t.children[0])?t.children[0]:null;if(L?(S=L.codegenNode,a&&p&&Dce(S,p,i)):O?S=oK(i,r(tK),p?Rw([p]):void 0,t.children,64+"",void 0,void 0,!0,void 0,!1):(S=I[0].codegenNode,a&&p&&Dce(S,p,i),S.isBlock!==!y&&(S.isBlock?(n(Qk),n(tV(i.inSSR,S.isComponent))):n(eV(i.inSSR,S.isComponent))),S.isBlock=!y,S.isBlock?(r(Qk),r(tV(i.inSSR,S.isComponent))):r(eV(i.inSSR,S.isComponent))),l){const N=ZG(hOe(s.parseResult,[Ll("_cached")]));N.body=dyi([J2(["const _memo = (",l.exp,")"]),J2(["if (_cached",...d?[" && _cached.key === ",d]:[],` && ${i.helperString(Jat)}(_cached, _memo)) return _cached`]),J2(["const _item = ",S]),Ll("_item.memo = _memo"),Ll("return _item")]),o.arguments.push(N,Ll("_cache"),Ll(String(i.cached++)))}else o.arguments.push(ZG(hOe(s.parseResult),S,!0))}})});function s0i(t,e,i,r){if(!e.exp){i.onError(Gd(31,e.loc));return}const n=Slt(e.exp);if(!n){i.onError(Gd(32,e.loc));return}const{addIdentifiers:s,removeIdentifiers:o,scopes:a}=i,{source:l,value:c,key:d,index:p}=n,y={type:11,loc:e.loc,source:l,valueAlias:c,keyAlias:d,objectIndexAlias:p,parseResult:n,children:Rce(t)?t.children:[t]};i.replaceNode(y),a.vFor++;const v=r&&r(y);return()=>{a.vFor--,v&&v()}}const o0i=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,xlt=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,a0i=/^\(|\)$/g;function Slt(t,e){const i=t.loc,r=t.content,n=r.match(o0i);if(!n)return;const[,s,o]=n,a={source:$ce(i,o.trim(),r.indexOf(o,s.length)),value:void 0,key:void 0,index:void 0};let l=s.trim().replace(a0i,"").trim();const c=s.indexOf(l),d=l.match(xlt);if(d){l=l.replace(xlt,"").trim();const p=d[1].trim();let y;if(p&&(y=r.indexOf(p,c+l.length),a.key=$ce(i,p,y)),d[2]){const v=d[2].trim();v&&(a.index=$ce(i,v,r.indexOf(v,a.key?y+p.length:c+l.length)))}}return l&&(a.value=$ce(i,l,c)),a}function $ce(t,e,i){return Ll(e,!1,elt(t,i,e.length))}function hOe({value:t,key:e,index:i},r=[]){return l0i([t,e,i,...r])}function l0i(t){let e=t.length;for(;e--&&!t[e];);return t.slice(0,e+1).map((i,r)=>i||Ll("_".repeat(r+1),!1))}const Clt=Ll("undefined",!1),u0i=(t,e)=>{if(t.type===1&&(t.tagType===1||t.tagType===3)){const i=Mw(t,"slot");if(i)return i.exp,e.scopes.vSlot++,()=>{e.scopes.vSlot--}}},c0i=(t,e,i)=>ZG(t,e,!1,!0,e.length?e[0].loc:i);function h0i(t,e,i=c0i){e.helper(eOe);const{children:r,loc:n}=t,s=[],o=[];let a=e.scopes.vSlot>0||e.scopes.vFor>0;const l=Mw(t,"slot",!0);if(l){const{arg:O,exp:L}=l;O&&!x_(O)&&(a=!0),s.push(Gp(O||Ll("default",!0),i(L,r,n)))}let c=!1,d=!1;const p=[],y=new Set;let v=0;for(let O=0;O{const G=i(L,N,n);return e.compatConfig&&(G.isNonScopedSlot=!0),Gp("default",G)};c?p.length&&p.some(L=>Tlt(L))&&(d?e.onError(Gd(39,p[0].loc)):s.push(O(void 0,p))):s.push(O(void 0,r))}const S=a?2:Gce(t.children)?3:1;let I=Rw(s.concat(Gp("_",Ll(S+"",!1))),n);return o.length&&(I=zf(e.helper(Kat),[I,aK(o)])),{slots:I,hasDynamicSlots:a}}function Bce(t,e,i){const r=[Gp("name",t),Gp("fn",e)];return i!=null&&r.push(Gp("key",Ll(String(i),!0))),Rw(r)}function Gce(t){for(let e=0;efunction(){if(t=e.currentNode,!(t.type===1&&(t.tagType===0||t.tagType===1)))return;const{tag:r,props:n}=t,s=t.tagType===1;let o=s?p0i(t,e):`"${r}"`;const a=oh(o)&&o.callee===Cce;let l,c,d,p=0,y,v,S,I=a||o===iK||o===GPe||!s&&(r==="svg"||r==="foreignObject");if(n.length>0){const O=Ilt(t,e,void 0,s,a);l=O.props,p=O.patchFlag,v=O.dynamicPropNames;const L=O.directives;S=L&&L.length?aK(L.map(N=>m0i(N,e))):void 0,O.shouldUseBlock&&(I=!0)}if(t.children.length>0)if(o===Sce&&(I=!0,p|=1024),s&&o!==iK&&o!==Sce){const{slots:L,hasDynamicSlots:N}=h0i(t,e);c=L,N&&(p|=1024)}else if(t.children.length===1&&o!==iK){const L=t.children[0],N=L.type,G=N===5||N===8;G&&Fw(L,e)===0&&(p|=1),G||N===2?c=L:c=t.children}else c=t.children;p!==0&&(d=String(p),v&&v.length&&(y=g0i(v))),t.codegenNode=oK(e,o,l,c,d,y,S,!!I,!1,s,t.loc)};function p0i(t,e,i=!1){let{tag:r}=t;const n=dOe(r),s=Oce(t,"is");if(s)if(n||tN("COMPILER_IS_ON_ELEMENT",e)){const l=s.type===6?s.value&&Ll(s.value.content,!0):s.exp;if(l)return zf(e.helper(Cce),[l])}else s.type===6&&s.value.content.startsWith("vue:")&&(r=s.value.content.slice(4));const o=!n&&Mw(t,"is");if(o&&o.exp)return zf(e.helper(Cce),[o.exp]);const a=Zat(r)||e.isBuiltInComponent(r);return a?(i||e.helper(a),a):(e.helper(zPe),e.components.add(r),lK(r,"component"))}function Ilt(t,e,i=t.props,r,n,s=!1){const{tag:o,loc:a,children:l}=t;let c=[];const d=[],p=[],y=l.length>0;let v=!1,S=0,I=!1,O=!1,L=!1,N=!1,G=!1,V=!1;const Y=[],X=fe=>{c.length&&(d.push(Rw(Alt(c),a)),c=[]),fe&&d.push(fe)},te=({key:fe,value:ge})=>{if(x_(fe)){const _e=fe.content,Ie=Fk(_e);if(Ie&&(!r||n)&&_e.toLowerCase()!=="onclick"&&_e!=="onUpdate:modelValue"&&!kk(_e)&&(N=!0),Ie&&kk(_e)&&(V=!0),ge.type===20||(ge.type===4||ge.type===8)&&Fw(ge,e)>0)return;_e==="ref"?I=!0:_e==="class"?O=!0:_e==="style"?L=!0:_e!=="key"&&!Y.includes(_e)&&Y.push(_e),r&&(_e==="class"||_e==="style")&&!Y.includes(_e)&&Y.push(_e)}else G=!0};for(let fe=0;fe0&&c.push(Gp(Ll("ref_for",!0),Ll("true")))),Ie==="is"&&(dOe(o)||ke&&ke.content.startsWith("vue:")||tN("COMPILER_IS_ON_ELEMENT",e)))continue;c.push(Gp(Ll(Ie,!0,elt(_e,0,Ie.length)),Ll(ke?ke.content:"",Ne,ke?ke.loc:_e)))}else{const{name:_e,arg:Ie,exp:ke,loc:Ne}=ge,J=_e==="bind",he=_e==="on";if(_e==="slot"){r||e.onError(Gd(40,Ne));continue}if(_e==="once"||_e==="memo"||_e==="is"||J&&eN(Ie,"is")&&(dOe(o)||tN("COMPILER_IS_ON_ELEMENT",e))||he&&s)continue;if((J&&eN(Ie,"key")||he&&y&&eN(Ie,"vue:before-update"))&&(v=!0),J&&eN(Ie,"ref")&&e.scopes.vFor>0&&c.push(Gp(Ll("ref_for",!0),Ll("true"))),!Ie&&(J||he)){if(G=!0,ke)if(J){if(X(),tN("COMPILER_V_BIND_OBJECT_ORDER",e)){d.unshift(ke);continue}d.push(ke)}else X({type:14,loc:Ne,callee:e.helper(JPe),arguments:r?[ke]:[ke,"true"]});else e.onError(Gd(J?34:35,Ne));continue}const xe=e.directiveTransforms[_e];if(xe){const{props:Pe,needRuntime:Oe}=xe(ge,t,e);!s&&Pe.forEach(te),he&&Ie&&!x_(Ie)?X(Rw(Pe,a)):c.push(...Pe),Oe&&(p.push(ge),GM(Oe)&&Elt.set(ge,Oe))}else imi(_e)||(p.push(ge),y&&(v=!0))}}let re;if(d.length?(X(),d.length>1?re=zf(e.helper(Ece),d,a):re=d[0]):c.length&&(re=Rw(Alt(c),a)),G?S|=16:(O&&!r&&(S|=2),L&&!r&&(S|=4),Y.length&&(S|=8),N&&(S|=32)),!v&&(S===0||S===32)&&(I||V||p.length>0)&&(S|=512),!e.inSSR&&re)switch(re.type){case 15:let fe=-1,ge=-1,_e=!1;for(let Ne=0;NeGp(o,s)),n))}return aK(i,t.loc)}function g0i(t){let e="[";for(let i=0,r=t.length;i{const e=Object.create(null);return i=>e[i]||(e[i]=t(i))},v0i=/-(\w)/g,Plt=y0i(t=>t.replace(v0i,(e,i)=>i?i.toUpperCase():"")),_0i=(t,e)=>{if(Mce(t)){const{children:i,loc:r}=t,{slotName:n,slotProps:s}=b0i(t,e),o=[e.prefixIdentifiers?"_ctx.$slots":"$slots",n,"{}","undefined","true"];let a=2;s&&(o[2]=s,a=3),i.length&&(o[3]=ZG([],i,!1,!1,r),a=4),e.scopeId&&!e.slotted&&(a=5),o.splice(a),t.codegenNode=zf(e.helper(Xat),o,r)}};function b0i(t,e){let i='"default"',r;const n=[];for(let s=0;s0){const{props:s,directives:o}=Ilt(t,e,n,!1,!1);r=s,o.length&&e.onError(Gd(36,o[0].loc))}return{slotName:i,slotProps:r}}const w0i=/^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,Olt=(t,e,i,r)=>{const{loc:n,modifiers:s,arg:o}=t;!t.exp&&!s.length&&i.onError(Gd(35,n));let a;if(o.type===4)if(o.isStatic){let p=o.content;p.startsWith("vue:")&&(p=`vnode-${p.slice(4)}`);const y=e.tagType!==0||p.startsWith("vnode")||!/[A-Z]/.test(p)?Nk(Lm(p)):`on:${p}`;a=Ll(y,!0,o.loc)}else a=J2([`${i.helperString(QPe)}(`,o,")"]);else a=o,a.children.unshift(`${i.helperString(QPe)}(`),a.children.push(")");let l=t.exp;l&&!l.content.trim()&&(l=void 0);let c=i.cacheHandlers&&!l&&!i.inVOnce;if(l){const p=Qat(l.content),y=!(p||w0i.test(l.content)),v=l.content.includes(";");(y||c&&p)&&(l=J2([`${y?"$event":"(...args)"} => ${v?"{":"("}`,l,v?"}":")"]))}let d={props:[Gp(a,l||Ll("() => {}",!1,n))]};return r&&(d=r(d)),c&&(d.props[0].value=i.cache(d.props[0].value)),d.props.forEach(p=>p.key.isHandlerKey=!0),d},x0i=(t,e,i)=>{const{exp:r,modifiers:n,loc:s}=t,o=t.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=Lm(o.content):o.content=`${i.helperString(ZPe)}(${o.content})`:(o.children.unshift(`${i.helperString(ZPe)}(`),o.children.push(")"))),i.inSSR||(n.includes("prop")&&Rlt(o,"."),n.includes("attr")&&Rlt(o,"^")),!r||r.type===4&&!r.content.trim()?(i.onError(Gd(34,s)),{props:[Gp(o,Ll("",!0,s))]}):{props:[Gp(o,r)]}},Rlt=(t,e)=>{t.type===4?t.isStatic?t.content=e+t.content:t.content=`\`${e}\${${t.content}}\``:(t.children.unshift(`'${e}' + (`),t.children.push(")"))},S0i=(t,e)=>{if(t.type===0||t.type===1||t.type===11||t.type===10)return()=>{const i=t.children;let r,n=!1;for(let s=0;ss.type===7&&!e.directiveTransforms[s.name])&&t.tag!=="template")))for(let s=0;s{if(t.type===1&&Mw(t,"once",!0))return Mlt.has(t)||e.inVOnce?void 0:(Mlt.add(t),e.inVOnce=!0,e.helper(Ice),()=>{e.inVOnce=!1;const i=e.currentNode;i.codegenNode&&(i.codegenNode=e.cache(i.codegenNode,!0))})},Dlt=(t,e,i)=>{const{exp:r,arg:n}=t;if(!r)return i.onError(Gd(41,t.loc)),Vce();const s=r.loc.source,o=r.type===4?r.content:s,a=i.bindingMetadata[s];if(a==="props"||a==="props-aliased")return i.onError(Gd(44,r.loc)),Vce();const l=!1;if(!o.trim()||!Qat(o)&&!l)return i.onError(Gd(42,r.loc)),Vce();const c=n||Ll("modelValue",!0),d=n?x_(n)?`onUpdate:${Lm(n.content)}`:J2(['"onUpdate:" + ',n]):"onUpdate:modelValue";let p;const y=i.isTS?"($event: any)":"$event";p=J2([`${y} => ((`,r,") = $event)"]);const v=[Gp(c,t.exp),Gp(d,p)];if(t.modifiers.length&&e.tagType===1){const S=t.modifiers.map(O=>(rOe(O)?O:JSON.stringify(O))+": true").join(", "),I=n?x_(n)?`${n.content}Modifiers`:J2([n,' + "Modifiers"']):"modelModifiers";v.push(Gp(I,Ll(`{ ${S} }`,!1,t.loc,2)))}return Vce(v)};function Vce(t=[]){return{props:t}}const T0i=/[\w).+\-_$\]]/,E0i=(t,e)=>{tN("COMPILER_FILTER",e)&&(t.type===5&&Uce(t.content,e),t.type===1&&t.props.forEach(i=>{i.type===7&&i.name!=="for"&&i.exp&&Uce(i.exp,e)}))};function Uce(t,e){if(t.type===4)Flt(t,e);else for(let i=0;i=0&&(N=i.charAt(L),N===" ");L--);(!N||!T0i.test(N))&&(o=!0)}}S===void 0?S=i.slice(0,v).trim():d!==0&&O();function O(){I.push(i.slice(d,v).trim()),d=v+1}if(I.length){for(v=0;v{if(t.type===1){const i=Mw(t,"memo");return!i||Llt.has(t)?void 0:(Llt.add(t),()=>{const r=t.codegenNode||e.currentNode.codegenNode;r&&r.type===13&&(t.tagType!==1&&sOe(r,e),t.codegenNode=zf(e.helper(tOe),[i.exp,ZG(void 0,r),"_cache",String(e.cached++)]))})}};function P0i(t){return[[C0i,t0i,A0i,n0i,E0i,_0i,d0i,u0i,S0i],{on:Olt,bind:x0i,model:Dlt}]}function O0i(t,e={}){const i=e.onError||BPe,r=e.mode==="module";e.prefixIdentifiers===!0?i(Gd(47)):r&&i(Gd(48));const n=!1;e.cacheHandlers&&i(Gd(49)),e.scopeId&&!r&&i(Gd(50));const s=ol(t)?Syi(t,e):t,[o,a]=P0i();return Nyi(s,xc({},e,{prefixIdentifiers:n,nodeTransforms:[...o,...e.nodeTransforms||[]],directiveTransforms:xc({},a,e.directiveTransforms||{})})),Gyi(s,xc({},e,{prefixIdentifiers:n}))}const R0i=()=>({props:[]}),klt=Symbol(""),Nlt=Symbol(""),$lt=Symbol(""),Blt=Symbol(""),pOe=Symbol(""),Glt=Symbol(""),Vlt=Symbol(""),Ult=Symbol(""),jlt=Symbol(""),zlt=Symbol("");uyi({[klt]:"vModelRadio",[Nlt]:"vModelCheckbox",[$lt]:"vModelText",[Blt]:"vModelSelect",[pOe]:"vModelDynamic",[Glt]:"withModifiers",[Vlt]:"withKeys",[Ult]:"vShow",[jlt]:"Transition",[zlt]:"TransitionGroup"});let iV;function M0i(t,e=!1){return iV||(iV=document.createElement("div")),e?(iV.innerHTML=`
`,iV.children[0].getAttribute("foo")):(iV.innerHTML=t,iV.textContent)}const D0i=y_("style,iframe,script,noscript",!0),F0i={isVoidTag:Xfi,isNativeTag:t=>qfi(t)||Yfi(t),isPreTag:t=>t==="pre",decodeEntities:M0i,isBuiltInComponent:t=>{if(QG(t,"Transition"))return jlt;if(QG(t,"TransitionGroup"))return zlt},getNamespace(t,e){let i=e?e.ns:0;if(e&&i===2)if(e.tag==="annotation-xml"){if(t==="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"))&&(i=0)}else/^m(?:[ions]|text)$/.test(e.tag)&&t!=="mglyph"&&t!=="malignmark"&&(i=0);else e&&i===1&&(e.tag==="foreignObject"||e.tag==="desc"||e.tag==="title")&&(i=0);if(i===0){if(t==="svg")return 1;if(t==="math")return 2}return i},getTextMode({tag:t,ns:e}){if(e===0){if(t==="textarea"||t==="title")return 1;if(D0i(t))return 2}return 0}},L0i=t=>{t.type===1&&t.props.forEach((e,i)=>{e.type===6&&e.name==="style"&&e.value&&(t.props[i]={type:7,name:"bind",arg:Ll("style",!0,e.loc),exp:k0i(e.value.content,e.loc),modifiers:[],loc:e.loc})})},k0i=(t,e)=>{const i=gst(t);return Ll(JSON.stringify(i),!1,e,3)};function PP(t,e){return Gd(t,e)}const N0i=(t,e,i)=>{const{exp:r,loc:n}=t;return r||i.onError(PP(51,n)),e.children.length&&(i.onError(PP(52,n)),e.children.length=0),{props:[Gp(Ll("innerHTML",!0,n),r||Ll("",!0))]}},$0i=(t,e,i)=>{const{exp:r,loc:n}=t;return r||i.onError(PP(53,n)),e.children.length&&(i.onError(PP(54,n)),e.children.length=0),{props:[Gp(Ll("textContent",!0),r?Fw(r,i)>0?r:zf(i.helperString(Tce),[r],n):Ll("",!0))]}},B0i=(t,e,i)=>{const r=Dlt(t,e,i);if(!r.props.length||e.tagType===1)return r;t.arg&&i.onError(PP(56,t.arg.loc));const{tag:n}=e,s=i.isCustomElement(n);if(n==="input"||n==="textarea"||n==="select"||s){let o=$lt,a=!1;if(n==="input"||s){const l=Oce(e,"type");if(l){if(l.type===7)o=pOe;else if(l.value)switch(l.value.content){case"radio":o=klt;break;case"checkbox":o=Nlt;break;case"file":a=!0,i.onError(PP(57,t.loc));break}}else yyi(e)&&(o=pOe)}else n==="select"&&(o=Blt);a||(r.needRuntime=i.helper(o))}else i.onError(PP(55,t.loc));return r.props=r.props.filter(o=>!(o.key.type===4&&o.key.content==="modelValue")),r},G0i=y_("passive,once,capture"),V0i=y_("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),U0i=y_("left,right"),Hlt=y_("onkeyup,onkeydown,onkeypress",!0),j0i=(t,e,i,r)=>{const n=[],s=[],o=[];for(let a=0;ax_(t)&&t.content.toLowerCase()==="onclick"?Ll(e,!0):t.type!==4?J2(["(",t,`) === "onClick" ? "${e}" : (`,t,")"]):t,z0i=(t,e,i)=>Olt(t,e,i,r=>{const{modifiers:n}=t;if(!n.length)return r;let{key:s,value:o}=r.props[0];const{keyModifiers:a,nonKeyModifiers:l,eventOptionModifiers:c}=j0i(s,n,i,t.loc);if(l.includes("right")&&(s=Wlt(s,"onContextmenu")),l.includes("middle")&&(s=Wlt(s,"onMouseup")),l.length&&(o=zf(i.helper(Glt),[o,JSON.stringify(l)])),a.length&&(!x_(s)||Hlt(s.content))&&(o=zf(i.helper(Vlt),[o,JSON.stringify(a)])),c.length){const d=c.map(VM).join("");s=x_(s)?Ll(`${s.content}${d}`,!0):J2(["(",s,`) + "${d}"`])}return{props:[Gp(s,o)]}}),H0i=(t,e,i)=>{const{exp:r,loc:n}=t;return r||i.onError(PP(59,n)),{props:[],needRuntime:i.helper(Ult)}},W0i=(t,e)=>{t.type===1&&t.tagType===0&&(t.tag==="script"||t.tag==="style")&&(e.onError(PP(61,t.loc)),e.removeNode())},q0i=[L0i],Y0i={cloak:R0i,html:N0i,text:$0i,model:B0i,on:z0i,show:H0i};function X0i(t,e={}){return O0i(t,xc({},F0i,e,{nodeTransforms:[W0i,...q0i,...e.nodeTransforms||[]],directiveTransforms:xc({},Y0i,e.directiveTransforms||{}),transformHoist:null}))}const qlt=Object.create(null);function Ylt(t,e){if(!ol(t))if(t.nodeType)t=t.innerHTML;else return dv;const i=t,r=qlt[i];if(r)return r;if(t[0]==="#"){const a=document.querySelector(t);t=a?a.innerHTML:""}const n=xc({hoistStatic:!0,onError:void 0,onWarn:dv},e);!n.isCustomElement&&typeof customElements<"u"&&(n.isCustomElement=a=>!!customElements.get(a));const{code:s}=X0i(t,n),o=new Function("Vue",s)(ryi);return o._rc=!0,qlt[i]=o}CPe(Ylt);const K0i=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:rce,Comment:sy,EffectScope:Oue,Fragment:eo,KeepAlive:mot,ReactiveEffect:jG,Static:XM,Suspense:aot,Teleport:Not,Text:EP,Transition:Jk,TransitionGroup:kPe,VueElement:KX,assertNumber:Zst,callWithAsyncErrorHandling:__,callWithErrorHandling:NT,camelize:Lm,capitalize:VM,cloneVNode:Y2,compatUtils:uat,compile:Ylt,computed:Vr,createApp:xce,createBlock:Pn,createCommentVNode:hn,createElementBlock:ci,createElementVNode:Mt,createHydrationRenderer:yPe,createPropsRestProxy:rat,createRenderer:gPe,createSSRApp:Gat,createSlots:_ot,createStaticVNode:mce,createTextVNode:Fs,createVNode:Rn,customRef:Xst,defineAsyncComponent:jX,defineComponent:Zr,defineCustomElement:MPe,defineEmits:Kot,defineExpose:Jot,defineProps:Xot,defineSSRCustomElement:gat,get devtools(){return Vk},effect:Ast,effectScope:FX,getCurrentInstance:ff,getCurrentScope:Rue,getTransitionRawChildren:UX,guardReactiveProps:bPe,h:X2,handleError:WM,hydrate:$Pe,initCustomFormatter:sat,initDirectivesForSSR:jat,inject:Qs,isMemoSame:vce,isProxy:jue,isReactive:Aw,isReadonly:HM,isRef:lc,isRuntimeOnly:Wot,isShallow:WG,isVNode:GT,markRaw:Ho,mergeDefaults:iat,mergeProps:XX,nextTick:iy,normalizeClass:fs,normalizeProps:yst,normalizeStyle:tb,onActivated:QAe,onBeforeMount:pv,onBeforeUnmount:su,onBeforeUpdate:sce,onDeactivated:ePe,onErrorCaptured:oce,onMounted:al,onRenderTracked:sPe,onRenderTriggered:nPe,onScopeDispose:LAe,onServerPrefetch:rPe,onUnmounted:Wk,onUpdated:Hk,openBlock:Kt,popScopeId:Kc,provide:ece,proxyRefs:Hue,pushScopeId:Xc,queuePostFlushCb:Yue,reactive:Tl,readonly:Vue,ref:Pi,registerRuntimeCompiler:CPe,render:K2,renderList:ou,renderSlot:jf,resolveComponent:Io,resolveDirective:Qn,resolveDynamicComponent:TP,resolveFilter:lat,resolveTransitionHooks:jk,setBlockTracking:dce,setDevtoolsHook:qAe,setTransitionHooks:qM,shallowReactive:VAe,shallowReadonly:Wst,shallowRef:zAe,ssrContextKey:EPe,ssrUtils:aat,stop:Pst,toDisplayString:gr,toHandlerKey:Nk,toHandlers:wot,toRaw:Hs,toRef:Wue,toRefs:Bk,transformVNodeArgs:Vot,triggerRef:Yst,unref:Qt,useAttrs:eat,useCssModule:yat,useCssVars:vat,useSSRContext:IPe,useSlots:Qot,useTransitionState:ice,vModelCheckbox:_ce,vModelDynamic:NPe,vModelRadio:bce,vModelSelect:ZX,vModelText:Ow,vShow:Bp,version:APe,warn:Jst,watch:Sc,watchEffect:cot,watchPostEffect:KAe,watchSyncEffect:hot,withAsyncContext:nat,withCtx:yn,withDefaults:Zot,withDirectives:Br,withKeys:Ch,withMemo:oat,withModifiers:_a,withScopeId:not},Symbol.toStringTag,{value:"Module"}));var J0i=!1;/*! +northing meters`+t;var y=p/2,v=0,x=0,I,P,F,k,j;return y>0&&(I=1e5/Math.pow(10,y),P=t.substring(s,s+y),v=parseFloat(P)*I,F=t.substring(s+y),x=parseFloat(F)*I),k=v+c,j=x+h,{easting:k,northing:j,zoneLetter:a,zoneNumber:o,accuracy:I}}function Rhi(t,e){for(var i=est.charCodeAt(e-1),r=1e5,n=!1;i!==t.charCodeAt(0);){if(i++,i===b_&&i++,i===Ow&&i++,i>EX){if(n)throw"Bad character: "+t;i=IV,n=!0}r+=1e5}return r}function Mhi(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i=tst.charCodeAt(e-1),r=0,n=!1;i!==t.charCodeAt(0);){if(i++,i===b_&&i++,i===Ow&&i++,i>TX){if(n)throw"Bad character: "+t;i=IV,n=!0}r+=1e5}return r}function Dhi(t){var e;switch(t){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: "+t}function AV(t,e,i){if(!(this instanceof AV))return new AV(t,e,i);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if(typeof t=="object")this.x=t.x,this.y=t.y,this.z=t.z||0;else if(typeof t=="string"&&typeof e>"u"){var r=t.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=t,this.y=e,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}AV.fromMGRS=function(t){return new AV(rst(t))},AV.prototype.toMGRS=function(t){return ist([this.x,this.y],t)};var Fhi=1,Lhi=.25,ast=.046875,lst=.01953125,ust=.01068115234375,Nhi=.75,khi=.46875,$hi=.013020833333333334,Bhi=.007120768229166667,Vhi=.3645833333333333,jhi=.005696614583333333,Ghi=.3076171875;function cst(t){var e=[];e[0]=Fhi-t*(Lhi+t*(ast+t*(lst+t*ust))),e[1]=t*(Nhi-t*(ast+t*(lst+t*ust)));var i=t*t;return e[2]=i*(khi-t*($hi+t*Bhi)),i*=t,e[3]=i*(Vhi-t*jhi),e[4]=i*t*Ghi,e}function gue(t,e,i,r){return i*=e,e*=e,r[0]*t-i*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))}var Uhi=20;function hst(t,e,i){for(var r=1/(1-e),n=t,s=Uhi;s;--s){var o=Math.sin(n),a=1-e*o*o;if(a=(gue(n,o,Math.cos(n),i)-t)*(a*Math.sqrt(a))*r,n-=a,Math.abs(a)fs?Math.tan(i):0,I=Math.pow(x,2),P=Math.pow(I,2);n=1-this.es*Math.pow(a,2),h=h/Math.sqrt(n);var F=gue(i,a,l,this.en);s=this.a*(this.k0*h*(1+p/6*(1-I+y+p/20*(5-18*I+P+14*y-58*I*y+p/42*(61+179*P-P*I-479*I)))))+this.x0,o=this.a*(this.k0*(F-this.ml0+a*r*h/2*(1+p/12*(5-I+9*y+4*v+p/30*(61+P-58*I+270*y-330*I*y+p/56*(1385+543*P-P*I-3111*I))))))+this.y0}else{var c=l*Math.sin(r);if(Math.abs(Math.abs(c)-1)=1){if(c-1>fs)return 93;o=0}else o=Math.acos(o);i<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return t.x=s,t.y=o,t}function Whi(t){var e,i,r,n,s=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+o/this.k0,i=hst(e,this.es,this.en),Math.abs(i)fs?Math.tan(i):0,x=this.ep2*Math.pow(y,2),I=Math.pow(x,2),P=Math.pow(v,2),F=Math.pow(P,2);e=1-this.es*Math.pow(p,2);var k=s*Math.sqrt(e)/this.k0,j=Math.pow(k,2);e=e*v,r=i-e*j/(1-this.es)*.5*(1-j/12*(5+3*P-9*x*P+x-4*I-j/30*(61+90*P-252*x*P+45*F+46*x-j/56*(1385+3633*P+4095*F+1574*F*P)))),n=Ms(this.long0+k*(1-j/6*(1+2*P+x-j/20*(5+28*P+24*F+8*x*P+6*x-j/42*(61+662*P+1320*F+720*F*P))))/y)}else r=Pn*SX(o),n=0;else{var a=Math.exp(s/this.k0),l=.5*(a-1/a),c=this.lat0+o/this.k0,h=Math.cos(c);e=Math.sqrt((1-Math.pow(h,2))/(1+Math.pow(l,2))),r=Math.asin(e),o<0&&(r=-r),l===0&&h===0?n=0:n=Ms(Math.atan2(l,h)+this.long0)}return t.x=n,t.y=r,t}var qhi=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const yue={init:zhi,forward:Hhi,inverse:Whi,names:qhi};function dst(t){var e=Math.exp(t);return e=(e-1/e)/2,e}function z2(t,e){t=Math.abs(t),e=Math.abs(e);var i=Math.max(t,e),r=Math.min(t,e)/(i||1);return i*Math.sqrt(1+Math.pow(r,2))}function Yhi(t){var e=1+t,i=e-1;return i===0?t:t*Math.log(e)/i}function Xhi(t){var e=Math.abs(t);return e=Yhi(e*(1+e/(z2(1,e)+1))),t<0?-e:e}function PAe(t,e){for(var i=2*Math.cos(2*e),r=t.length-1,n=t[r],s=0,o;--r>=0;)o=-s+i*n+t[r],s=n,n=o;return e+o*Math.sin(2*e)}function Khi(t,e){for(var i=2*Math.cos(e),r=t.length-1,n=t[r],s=0,o;--r>=0;)o=-s+i*n+t[r],s=n,n=o;return Math.sin(e)*o}function Jhi(t){var e=Math.exp(t);return e=(e+1/e)/2,e}function pst(t,e,i){for(var r=Math.sin(e),n=Math.cos(e),s=dst(i),o=Jhi(i),a=2*n*o,l=-2*r*s,c=t.length-1,h=t[c],p=0,y=0,v=0,x,I;--c>=0;)x=y,I=p,y=h,p=v,h=-x+a*y-l*p+t[c],v=-I+l*y+a*p;return a=r*o,l=n*s,[a*h-l*v,a*v+l*h]}function Zhi(){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&&(yue.init.apply(this),this.forward=yue.forward,this.inverse=yue.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 t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),i=e;this.cgb[0]=e*(2+e*(-.6666666666666666+e*(-2+e*(2.577777777777778+e*(.5777777777777777+e*-4.228148148148148))))),this.cbg[0]=e*(-2+e*(.6666666666666666+e*(1.3333333333333333+e*(-1.8222222222222222+e*(.7111111111111111+e*.9824338624338624))))),i=i*e,this.cgb[1]=i*(2.3333333333333335+e*(-1.6+e*(-5.044444444444444+e*(8.584126984126984+e*2.458201058201058)))),this.cbg[1]=i*(1.6666666666666667+e*(-1.0666666666666667+e*(-1.4444444444444444+e*(2.86984126984127+e*-1.6105820105820106)))),i=i*e,this.cgb[2]=i*(3.7333333333333334+e*(-3.8857142857142857+e*(-12.019047619047619+e*26.03668430335097))),this.cbg[2]=i*(-1.7333333333333334+e*(1.619047619047619+e*(1.6+e*-4.474779541446208))),i=i*e,this.cgb[3]=i*(6.792063492063492+e*(-9.485714285714286+e*-28.188500881834216)),this.cbg[3]=i*(1.9634920634920634+e*(-2.4+e*-1.7518165784832451)),i=i*e,this.cgb[4]=i*(13.250793650793652+e*-23.22238255571589),this.cbg[4]=i*(-2.3301587301587303+e*3.5144460477793813),i=i*e,this.cgb[5]=i*27.011268237934903,this.cbg[5]=i*2.8496841430174764,i=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+i*(.25+i*(.015625+i/256))),this.utg[0]=e*(-.5+e*(.6666666666666666+e*(-.3854166666666667+e*(.002777777777777778+e*(.158203125+e*-.15905919312169312))))),this.gtu[0]=e*(.5+e*(-.6666666666666666+e*(.3125+e*(.22777777777777777+e*(-.4409722222222222+e*.20875661375661375))))),this.utg[1]=i*(-.020833333333333332+e*(-.06666666666666667+e*(.3034722222222222+e*(-.4380952380952381+e*.2890188388723545)))),this.gtu[1]=i*(.2708333333333333+e*(-.6+e*(.38680555555555557+e*(.44603174603174606+e*-1.0248393063822752)))),i=i*e,this.utg[2]=i*(-.035416666666666666+e*(.04404761904761905+e*(.046651785714285715+e*-.06138668430335097))),this.gtu[2]=i*(.25416666666666665+e*(-.7357142857142858+e*(.5603050595238095+e*.9237378747795415))),i=i*e,this.utg[3]=i*(-.02726314484126984+e*(.021825396825396824+e*.11439745921516754)),this.gtu[3]=i*(.30729786706349205+e*(-1.0654761904761905+e*.9096203979276896)),i=i*e,this.utg[4]=i*(-.02841641865079365+e*.027268468414301746),this.gtu[4]=i*(.4306671626984127+e*-1.713007555715889),i=i*e,this.utg[5]=i*-.03233083094085698,this.gtu[5]=i*.6650675310896665;var r=PAe(this.cbg,this.lat0);this.Zb=-this.Qn*(r+Khi(this.gtu,2*r))}function Qhi(t){var e=Ms(t.x-this.long0),i=t.y;i=PAe(this.cbg,i);var r=Math.sin(i),n=Math.cos(i),s=Math.sin(e),o=Math.cos(e);i=Math.atan2(r,o*n),e=Math.atan2(s*n,z2(r,n*o)),e=Xhi(Math.tan(e));var a=pst(this.gtu,2*i,2*e);i=i+a[0],e=e+a[1];var l,c;return Math.abs(e)<=2.623395162778?(l=this.a*(this.Qn*e)+this.x0,c=this.a*(this.Qn*i+this.Zb)+this.y0):(l=1/0,c=1/0),t.x=l,t.y=c,t}function edi(t){var e=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);i=(i-this.Zb)/this.Qn,e=e/this.Qn;var r,n;if(Math.abs(e)<=2.623395162778){var s=pst(this.utg,2*i,2*e);i=i+s[0],e=e+s[1],e=Math.atan(dst(e));var o=Math.sin(i),a=Math.cos(i),l=Math.sin(e),c=Math.cos(e);i=Math.atan2(o*c,z2(l,c*a)),e=Math.atan2(l,c*a),r=Ms(e+this.long0),n=PAe(this.cgb,i)}else r=1/0,n=1/0;return t.x=r,t.y=n,t}var tdi=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"];const vue={init:Zhi,forward:Qhi,inverse:edi,names:tdi};function idi(t,e){if(t===void 0){if(t=Math.floor((Ms(e)+Math.PI)*30/Math.PI)+1,t<0)return 0;if(t>60)return 60}return t}var rdi="etmerc";function ndi(){var t=idi(this.zone,this.long0);if(t===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*ny,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,vue.init.apply(this),this.forward=vue.forward,this.inverse=vue.inverse}var sdi=["Universal Transverse Mercator System","utm"];const odi={init:ndi,names:sdi,dependsOn:rdi};function OAe(t,e){return Math.pow((1-t)/(1+t),e)}var adi=20;function ldi(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Fc)/(Math.pow(Math.tan(.5*this.lat0+Fc),this.C)*OAe(this.e*t,this.ratexp))}function udi(t){var e=t.x,i=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+Fc),this.C)*OAe(this.e*Math.sin(i),this.ratexp))-Pn,t.x=this.C*e,t}function cdi(t){for(var e=1e-14,i=t.x/this.C,r=t.y,n=Math.pow(Math.tan(.5*r+Fc)/this.K,1/this.C),s=adi;s>0&&(r=2*Math.atan(n*OAe(this.e*Math.sin(t.y),-.5*this.e))-Pn,!(Math.abs(r-t.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)<=fs&&(this.k0=.5*this.cons*FT(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/U2(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=FT(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Pn,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function _di(t){var e=t.x,i=t.y,r=Math.sin(i),n=Math.cos(i),s,o,a,l,c,h,p=Ms(e-this.long0);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=fs&&Math.abs(i+this.lat0)<=fs?(t.x=NaN,t.y=NaN,t):this.sphere?(s=2*this.k0/(1+this.sinlat0*r+this.coslat0*n*Math.cos(p)),t.x=this.a*s*n*Math.sin(p)+this.x0,t.y=this.a*s*(this.coslat0*r-this.sinlat0*n*Math.cos(p))+this.y0,t):(o=2*Math.atan(this.ssfn_(i,r,this.e))-Pn,l=Math.cos(o),a=Math.sin(o),Math.abs(this.coslat0)<=fs?(c=U2(this.e,i*this.con,this.con*r),h=2*this.a*this.k0*c/this.cons,t.x=this.x0+h*Math.sin(e-this.long0),t.y=this.y0-this.con*h*Math.cos(e-this.long0),t):(Math.abs(this.sinlat0)0?e=Ms(this.long0+Math.atan2(t.x,-1*t.y)):e=Ms(this.long0+Math.atan2(t.x,t.y)):e=Ms(this.long0+Math.atan2(t.x*Math.sin(a),o*this.coslat0*Math.cos(a)-t.y*this.sinlat0*Math.sin(a))),t.x=e,t.y=i,t)}else if(Math.abs(this.coslat0)<=fs){if(o<=fs)return i=this.lat0,e=this.long0,t.x=e,t.y=i,t;t.x*=this.con,t.y*=this.con,r=o*this.cons/(2*this.a*this.k0),i=this.con*CX(this.e,r),e=this.con*Ms(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else n=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=fs?s=this.X0:(s=Math.asin(Math.cos(n)*this.sinX0+t.y*Math.sin(n)*this.cosX0/o),e=Ms(this.long0+Math.atan2(t.x*Math.sin(n),o*this.cosX0*Math.cos(n)-t.y*this.sinX0*Math.sin(n)))),i=-1*CX(this.e,Math.tan(.5*(Pn+s)));return t.x=e,t.y=i,t}var wdi=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"];const xdi={init:vdi,forward:_di,inverse:bdi,names:wdi,ssfn_:ydi};function Sdi(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),i=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*i*Math.sqrt(1-s)/(1-s*Math.pow(e,2)),this.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(t),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+t/2)),c=Math.log((1+o*e)/(1-o*e));this.K=a-this.alpha*l+this.alpha*o/2*c}function Cdi(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),r=-this.alpha*(e+i)+this.K,n=2*(Math.atan(Math.exp(r))-Math.PI/4),s=this.alpha*(t.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 t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,t.x=this.R*o+this.x0,t}function Tdi(t){for(var e=t.x-this.x0,i=t.y-this.y0,r=e/this.R,n=2*(Math.atan(Math.exp(i/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,c=s,h=-1e3,p=0;Math.abs(c-h)>1e-7;){if(++p>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(c))/2)),h=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=a,t.y=c,t}var Edi=["somerc"];const Idi={init:Sdi,forward:Cdi,inverse:Tdi,names:Edi};var PV=1e-7;function Adi(t){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],i=typeof t.PROJECTION=="object"?Object.keys(t.PROJECTION)[0]:t.PROJECTION;return"no_uoff"in t||"no_off"in t||e.indexOf(i)!==-1}function Pdi(){var t,e,i,r,n,s,o,a,l,c,h=0,p,y=0,v=0,x=0,I=0,P=0,F=0;this.no_off=Adi(this),this.no_rot="no_rot"in this;var k=!1;"alpha"in this&&(k=!0);var j=!1;if("rectified_grid_angle"in this&&(j=!0),k&&(F=this.alpha),j&&(h=this.rectified_grid_angle*ny),k||j)y=this.longc;else if(v=this.long1,I=this.lat1,x=this.long2,P=this.lat2,Math.abs(I-P)<=PV||(t=Math.abs(I))<=PV||Math.abs(t-Pn)<=PV||Math.abs(Math.abs(this.lat0)-Pn)<=PV||Math.abs(Math.abs(P)-Pn)<=PV)throw new Error;var V=1-this.es;e=Math.sqrt(V),Math.abs(this.lat0)>fs?(a=Math.sin(this.lat0),i=Math.cos(this.lat0),t=1-this.es*a*a,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/V),this.A=this.B*this.k0*e/t,r=this.B*e/(i*Math.sqrt(t)),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(U2(this.e,this.lat0,a),this.B)):(this.B=1/e,this.A=this.k0,this.E=r=n=1),k||j?(k?(p=Math.asin(Math.sin(F)/r),j||(h=F)):(p=h,F=Math.asin(r*Math.sin(p))),this.lam0=y-Math.asin(.5*(n-1/n)*Math.tan(p))/this.B):(s=Math.pow(U2(this.e,I,Math.sin(I)),this.B),o=Math.pow(U2(this.e,P,Math.sin(P)),this.B),n=this.E/s,l=(o-s)/(o+s),c=this.E*this.E,c=(c-o*s)/(c+o*s),t=v-x,t<-Math.pi?x-=wX:t>Math.pi&&(x+=wX),this.lam0=Ms(.5*(v+x)-Math.atan(c*Math.tan(.5*this.B*(v-x))/l)/this.B),p=Math.atan(2*Math.sin(this.B*Ms(v-this.lam0))/(n-1/n)),h=F=Math.asin(r*Math.sin(p))),this.singam=Math.sin(p),this.cosgam=Math.cos(p),this.sinrot=Math.sin(h),this.cosrot=Math.cos(h),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(F))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*p,this.v_pole_n=this.ArB*Math.log(Math.tan(Fc-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(Fc+n))}function Odi(t){var e={},i,r,n,s,o,a,l,c;if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-Pn)>fs){if(o=this.E/Math.pow(U2(this.e,t.y,Math.sin(t.y)),this.B),a=1/o,i=.5*(o-a),r=.5*(o+a),s=Math.sin(this.B*t.x),n=(i*this.singam-s*this.cosgam)/r,Math.abs(Math.abs(n)-1)0?this.v_pole_n:this.v_pole_s,l=this.ArB*t.y;return this.no_rot?(e.x=l,e.y=c):(l-=this.u_0,e.x=c*this.cosrot+l*this.sinrot,e.y=l*this.cosrot-c*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function Rdi(t){var e,i,r,n,s,o,a,l={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(i=t.y,e=t.x):(i=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*i),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)fs?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(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Ldi(t){var e=t.x,i=t.y;Math.abs(2*Math.abs(i)-Math.PI)<=fs&&(i=SX(i)*(Pn-2*fs));var r=Math.abs(Math.abs(i)-Pn),n,s;if(r>fs)n=U2(this.e,i,Math.sin(i)),s=this.a*this.f0*Math.pow(n,this.ns);else{if(r=i*this.ns,r<=0)return null;s=0}var o=this.ns*Ms(e-this.long0);return t.x=this.k0*(s*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-s*Math.cos(o))+this.y0,t}function Ndi(t){var e,i,r,n,s,o=(t.x-this.x0)/this.k0,a=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+a*a),i=1):(e=-Math.sqrt(o*o+a*a),i=-1);var l=0;if(e!==0&&(l=Math.atan2(i*o,i*a)),e!==0||this.ns>0){if(i=1/this.ns,r=Math.pow(e/(this.a*this.f0),i),n=CX(this.e,r),n===-9999)return null}else n=-Pn;return s=Ms(l/this.ns+this.long0),t.x=s,t.y=n,t}var kdi=["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 $di={init:Fdi,forward:Ldi,inverse:Ndi,names:kdi};function Bdi(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),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 Vdi(t){var e,i,r,n,s,o,a,l=t.x,c=t.y,h=Ms(l-this.long0);return e=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/e)-this.s45),r=-h*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),s=Math.asin(Math.cos(i)*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),t.y=a*Math.cos(o)/1,t.x=a*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t}function jdi(t){var e,i,r,n,s,o,a,l,c=t.x;t.x=t.y,t.y=c,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),s=Math.atan2(t.y,t.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)),i=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(e)),t.x=this.long0-i/this.alfa,a=e,l=0;var h=0;do t.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-t.y)<1e-10&&(l=1),a=t.y,h+=1;while(l===0&&h<15);return h>=15?null:t}var Gdi=["Krovak","krovak"];const Udi={init:Bdi,forward:Vdi,inverse:jdi,names:Gdi};function mv(t,e,i,r,n){return t*n-e*Math.sin(2*n)+i*Math.sin(4*n)-r*Math.sin(6*n)}function IX(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function AX(t){return .375*t*(1+.25*t*(1+.46875*t))}function PX(t){return .05859375*t*t*(1+.75*t)}function OX(t){return t*t*t*.011393229166666666}function OV(t,e,i){var r=e*i;return t/Math.sqrt(1-r*r)}function RV(t){return Math.abs(t)1e-7?(i=t*e,(1-t*t)*(e/(1-i*i)-.5/t*Math.log((1-i)/(1+i)))):2*e}var Xdi=1,Kdi=2,Jdi=3,Zdi=4;function Qdi(){var t=Math.abs(this.lat0);if(Math.abs(t-Pn)0){var e;switch(this.qp=kM(this.e,1),this.mmf=.5/(1-this.es),this.apa=lpi(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=kM(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 epi(t){var e,i,r,n,s,o,a,l,c,h,p=t.x,y=t.y;if(p=Ms(p-this.long0),this.sphere){if(s=Math.sin(y),h=Math.cos(y),r=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(i=this.mode===this.EQUIT?1+h*r:1+this.sinph0*s+this.cosph0*h*r,i<=fs)return null;i=Math.sqrt(2/i),e=i*h*Math.sin(p),i*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*h*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(y+this.lat0)=0?(e=(c=Math.sqrt(o))*n,i=r*(this.mode===this.S_POLE?c:-c)):e=i=0;break}}return t.x=this.a*e+this.x0,t.y=this.a*i+this.y0,t}function tpi(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,i=t.y/this.a,r,n,s,o,a,l,c;if(this.sphere){var h=0,p,y=0;if(p=Math.sqrt(e*e+i*i),n=p*.5,n>1)return null;switch(n=2*Math.asin(n),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(y=Math.sin(n),h=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(p)<=fs?0:Math.asin(i*y/p),e*=y,i=h*p;break;case this.OBLIQ:n=Math.abs(p)<=fs?this.lat0:Math.asin(h*this.sinph0+i*y*this.cosph0/p),e*=y*this.cosph0,i=(h-Math.sin(n)*this.sinph0)*p;break;case this.N_POLE:i=-i,n=Pn-n;break;case this.S_POLE:n-=Pn;break}r=i===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,i)}else{if(c=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,i*=this.dd,l=Math.sqrt(e*e+i*i),l1&&(t=t>1?1:-1),Math.asin(t)}function dpi(){Math.abs(this.lat1+this.lat2)fs?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 ppi(t){var e=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var r=kM(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,s=this.ns0*Ms(e-this.long0),o=n*Math.sin(s)+this.x0,a=this.rh-n*Math.cos(s)+this.y0;return t.x=o,t.y=a,t}function fpi(t){var e,i,r,n,s,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1),n=0,e!==0&&(n=Math.atan2(r*t.x,r*t.y)),r=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-r*r)/(2*this.ns0)):(i=(this.c-r*r)/this.ns0,o=this.phi1z(this.e3,i)),s=Ms(n/this.ns0+this.long0),t.x=s,t.y=o,t}function mpi(t,e){var i,r,n,s,o,a=$M(.5*e);if(t0||Math.abs(o)<=fs?(a=this.x0+this.a*s*i*Math.sin(r)/o,l=this.y0+this.a*s*(this.cos_p14*e-this.sin_p14*i*n)/o):(a=this.x0+this.infinity_dist*i*Math.sin(r),l=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*i*n)),t.x=a,t.y=l,t}function bpi(t){var e,i,r,n,s,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(n=Math.atan2(e,this.rc),i=Math.sin(n),r=Math.cos(n),o=$M(r*this.sin_p14+t.y*i*this.cos_p14/e),s=Math.atan2(t.x*i,e*this.cos_p14*r-t.y*this.sin_p14*i),s=Ms(this.long0+s)):(o=this.phic0,s=0),t.x=s,t.y=o,t}var wpi=["gnom"];const xpi={init:vpi,forward:_pi,inverse:bpi,names:wpi};function Spi(t,e){var i=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-i)<1e-6)return e<0?-1*Pn:Pn;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=t*s,n=Math.pow(1-a*a,2)/(2*o)*(e/(1-t*t)-s/(1-a*a)+.5/t*Math.log((1-a)/(1+a))),r+=n,Math.abs(n)<=1e-10)return r;return NaN}function Cpi(){this.sphere||(this.k0=FT(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Tpi(t){var e=t.x,i=t.y,r,n,s=Ms(e-this.long0);if(this.sphere)r=this.x0+this.a*s*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var o=kM(this.e,Math.sin(i));r=this.x0+this.a*this.k0*s,n=this.y0+this.a*o*.5/this.k0}return t.x=r,t.y=n,t}function Epi(t){t.x-=this.x0,t.y-=this.y0;var e,i;return this.sphere?(e=Ms(this.long0+t.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(i=Spi(this.e,2*t.y*this.k0/this.a),e=Ms(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=i,t}var Ipi=["cea"];const Api={init:Cpi,forward:Tpi,inverse:Epi,names:Ipi};function Ppi(){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 Opi(t){var e=t.x,i=t.y,r=Ms(e-this.long0),n=RV(i-this.lat0);return t.x=this.x0+this.a*r*this.rc,t.y=this.y0+this.a*n,t}function Rpi(t){var e=t.x,i=t.y;return t.x=Ms(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=RV(this.lat0+(i-this.y0)/this.a),t}var Mpi=["Equirectangular","Equidistant_Cylindrical","eqc"];const Dpi={init:Ppi,forward:Opi,inverse:Rpi,names:Mpi};var fst=20;function Fpi(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=IX(this.es),this.e1=AX(this.es),this.e2=PX(this.es),this.e3=OX(this.es),this.ml0=this.a*mv(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Lpi(t){var e=t.x,i=t.y,r,n,s,o=Ms(e-this.long0);if(s=o*Math.sin(i),this.sphere)Math.abs(i)<=fs?(r=this.a*o,n=-1*this.a*this.lat0):(r=this.a*Math.sin(s)/Math.tan(i),n=this.a*(RV(i-this.lat0)+(1-Math.cos(s))/Math.tan(i)));else if(Math.abs(i)<=fs)r=this.a*o,n=-1*this.ml0;else{var a=OV(this.a,this.e,Math.sin(i))/Math.tan(i);r=a*Math.sin(s),n=this.a*mv(this.e0,this.e1,this.e2,this.e3,i)-this.ml0+a*(1-Math.cos(s))}return t.x=r+this.x0,t.y=n+this.y0,t}function Npi(t){var e,i,r,n,s,o,a,l,c;if(r=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=fs)e=Ms(r/this.a+this.long0),i=0;else{o=this.lat0+n/this.a,a=r*r/this.a/this.a+o*o,l=o;var h;for(s=fst;s;--s)if(h=Math.tan(l),c=-1*(o*(l*h+1)-l-.5*(l*l+a)*h)/((l-o)/h-1),l+=c,Math.abs(c)<=fs){i=l;break}e=Ms(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(n+this.ml0)<=fs)i=0,e=Ms(this.long0+r/this.a);else{o=(this.ml0+n)/this.a,a=r*r/this.a/this.a+o*o,l=o;var p,y,v,x,I;for(s=fst;s;--s)if(I=this.e*Math.sin(l),p=Math.sqrt(1-I*I)*Math.tan(l),y=this.a*mv(this.e0,this.e1,this.e2,this.e3,l),v=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),x=y/this.a,c=(o*(p*x+1)-x-.5*p*(x*x+a))/(this.es*Math.sin(2*l)*(x*x+a-2*o*x)/(4*p)+(o-x)*(p*v-2/Math.sin(2*l))-v),l-=c,Math.abs(c)<=fs){i=l;break}p=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),e=Ms(this.long0+Math.asin(r*p/this.a)/Math.sin(i))}return t.x=e,t.y=i,t}var kpi=["Polyconic","poly"];const $pi={init:Fpi,forward:Lpi,inverse:Npi,names:kpi};function Bpi(){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 Vpi(t){var e,i=t.x,r=t.y,n=r-this.lat0,s=i-this.long0,o=n/bX*1e-5,a=s,l=1,c=0;for(e=1;e<=10;e++)l=l*o,c=c+this.A[e]*l;var h=c,p=a,y=1,v=0,x,I,P=0,F=0;for(e=1;e<=6;e++)x=y*h-v*p,I=v*h+y*p,y=x,v=I,P=P+this.B_re[e]*y-this.B_im[e]*v,F=F+this.B_im[e]*y+this.B_re[e]*v;return t.x=F*this.a+this.x0,t.y=P*this.a+this.y0,t}function jpi(t){var e,i=t.x,r=t.y,n=i-this.x0,s=r-this.y0,o=s/this.a,a=n/this.a,l=1,c=0,h,p,y=0,v=0;for(e=1;e<=6;e++)h=l*o-c*a,p=c*o+l*a,l=h,c=p,y=y+this.C_re[e]*l-this.C_im[e]*c,v=v+this.C_im[e]*l+this.C_re[e]*c;for(var x=0;x.999999999999&&(i=.999999999999),e=Math.asin(i);var r=Ms(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),i=(2*e+Math.sin(2*e))/Math.PI,Math.abs(i)>1&&(i=1);var n=Math.asin(i);return t.x=r,t.y=n,t}var nfi=["Mollweide","moll"];const sfi={init:tfi,forward:ifi,inverse:rfi,names:nfi};function ofi(){Math.abs(this.lat1+this.lat2)=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var s=0;if(i!==0&&(s=Math.atan2(e*t.x,e*t.y)),this.sphere)return n=Ms(this.long0+s/this.ns),r=RV(this.g-i/this.a),t.x=n,t.y=r,t;var o=this.g-i/this.a;return r=_ue(o,this.e0,this.e1,this.e2,this.e3),n=Ms(this.long0+s/this.ns),t.x=n,t.y=r,t}var ufi=["Equidistant_Conic","eqdc"];const cfi={init:ofi,forward:afi,inverse:lfi,names:ufi};function hfi(){this.R=this.a}function dfi(t){var e=t.x,i=t.y,r=Ms(e-this.long0),n,s;Math.abs(i)<=fs&&(n=this.x0+this.R*r,s=this.y0);var o=$M(2*Math.abs(i/Math.PI));(Math.abs(r)<=fs||Math.abs(Math.abs(i)-Pn)<=fs)&&(n=this.x0,i>=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,c=Math.sin(o),h=Math.cos(o),p=h/(c+h-1),y=p*p,v=p*(2/c-1),x=v*v,I=Math.PI*this.R*(a*(p-x)+Math.sqrt(l*(p-x)*(p-x)-(x+l)*(y-x)))/(x+l);r<0&&(I=-I),n=this.x0+I;var P=l+p;return I=Math.PI*this.R*(v*P-a*Math.sqrt((x+l)*(l+1)-P*P))/(x+l),i>=0?s=this.y0+I:s=this.y0-I,t.x=n,t.y=s,t}function pfi(t){var e,i,r,n,s,o,a,l,c,h,p,y,v;return t.x-=this.x0,t.y-=this.y0,p=Math.PI*this.R,r=t.x/p,n=t.y/p,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,v=n*n/l+(2*a*a*a/l/l/l-9*o*a/l/l)/27,c=(o-a*a/3/l)/l,h=2*Math.sqrt(-c/3),p=3*v/c/h,Math.abs(p)>1&&(p>=0?p=1:p=-1),y=Math.acos(p)/3,t.y>=0?i=(-h*Math.cos(y+Math.PI/3)-a/3/l)*Math.PI:i=-(-h*Math.cos(y+Math.PI/3)-a/3/l)*Math.PI,Math.abs(r)2*Pn*this.a?void 0:(i=e/this.a,r=Math.sin(i),n=Math.cos(i),s=this.long0,Math.abs(e)<=fs?o=this.lat0:(o=$M(n*this.sin_p12+t.y*r*this.cos_p12/e),a=Math.abs(this.lat0)-Pn,Math.abs(a)<=fs?this.lat0>=0?s=Ms(this.long0+Math.atan2(t.x,-t.y)):s=Ms(this.long0-Math.atan2(-t.x,t.y)):s=Ms(this.long0+Math.atan2(t.x*r,e*this.cos_p12*n-t.y*this.sin_p12*r))),t.x=s,t.y=o,t)):(l=IX(this.es),c=AX(this.es),h=PX(this.es),p=OX(this.es),Math.abs(this.sin_p12-1)<=fs?(y=this.a*mv(l,c,h,p,Pn),e=Math.sqrt(t.x*t.x+t.y*t.y),v=y-e,o=_ue(v/this.a,l,c,h,p),s=Ms(this.long0+Math.atan2(t.x,-1*t.y)),t.x=s,t.y=o,t):Math.abs(this.sin_p12+1)<=fs?(y=this.a*mv(l,c,h,p,Pn),e=Math.sqrt(t.x*t.x+t.y*t.y),v=e-y,o=_ue(v/this.a,l,c,h,p),s=Ms(this.long0+Math.atan2(t.x,t.y)),t.x=s,t.y=o,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),P=Math.atan2(t.x,t.y),x=OV(this.a,this.e,this.sin_p12),F=Math.cos(P),k=this.e*this.cos_p12*F,j=-k*k/(1-this.es),V=3*this.es*(1-j)*this.sin_p12*this.cos_p12*F/(1-this.es),Y=e/x,X=Y-j*(1+j)*Math.pow(Y,3)/6-V*(1+3*j)*Math.pow(Y,4)/24,Z=1-j*X*X/2-Y*X*X*X/6,I=Math.asin(this.sin_p12*Math.cos(X)+this.cos_p12*Math.sin(X)*F),s=Ms(this.long0+Math.asin(Math.sin(P)*Math.sin(X)/Math.cos(I))),ie=Math.sin(I),o=Math.atan2((ie-this.es*Z*this.sin_p12)*Math.tan(I),ie*(1-this.es)),t.x=s,t.y=o,t))}var _fi=["Azimuthal_Equidistant","aeqd"];const bfi={init:gfi,forward:yfi,inverse:vfi,names:_fi};function wfi(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function xfi(t){var e,i,r,n,s,o,a,l,c=t.x,h=t.y;return r=Ms(c-this.long0),e=Math.sin(h),i=Math.cos(h),n=Math.cos(r),o=this.sin_p14*e+this.cos_p14*i*n,s=1,(o>0||Math.abs(o)<=fs)&&(a=this.a*s*i*Math.sin(r),l=this.y0+this.a*s*(this.cos_p14*e-this.sin_p14*i*n)),t.x=a,t.y=l,t}function Sfi(t){var e,i,r,n,s,o,a;return t.x-=this.x0,t.y-=this.y0,e=Math.sqrt(t.x*t.x+t.y*t.y),i=$M(e/this.a),r=Math.sin(i),n=Math.cos(i),o=this.long0,Math.abs(e)<=fs?(a=this.lat0,t.x=o,t.y=a,t):(a=$M(n*this.sin_p14+t.y*r*this.cos_p14/e),s=Math.abs(this.lat0)-Pn,Math.abs(s)<=fs?(this.lat0>=0?o=Ms(this.long0+Math.atan2(t.x,-t.y)):o=Ms(this.long0-Math.atan2(-t.x,t.y)),t.x=o,t.y=a,t):(o=Ms(this.long0+Math.atan2(t.x*r,e*this.cos_p14*n-t.y*this.sin_p14*r)),t.x=o,t.y=a,t))}var Cfi=["ortho"];const Tfi={init:wfi,forward:xfi,inverse:Sfi,names:Cfi};var yp={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Lc={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Efi(){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>=Pn-Fc/2?this.face=yp.TOP:this.lat0<=-(Pn-Fc/2)?this.face=yp.BOTTOM:Math.abs(this.long0)<=Fc?this.face=yp.FRONT:Math.abs(this.long0)<=Pn+Fc?this.face=this.long0>0?yp.RIGHT:yp.LEFT:this.face=yp.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 Ifi(t){var e={x:0,y:0},i,r,n,s,o,a,l={value:0};if(t.x-=this.long0,this.es!==0?i=Math.atan(this.one_minus_f_squared*Math.tan(t.y)):i=t.y,r=t.x,this.face===yp.TOP)s=Pn-i,r>=Fc&&r<=Pn+Fc?(l.value=Lc.AREA_0,n=r-Pn):r>Pn+Fc||r<=-(Pn+Fc)?(l.value=Lc.AREA_1,n=r>0?r-gf:r+gf):r>-(Pn+Fc)&&r<=-Fc?(l.value=Lc.AREA_2,n=r+Pn):(l.value=Lc.AREA_3,n=r);else if(this.face===yp.BOTTOM)s=Pn+i,r>=Fc&&r<=Pn+Fc?(l.value=Lc.AREA_0,n=-r+Pn):r=-Fc?(l.value=Lc.AREA_1,n=-r):r<-Fc&&r>=-(Pn+Fc)?(l.value=Lc.AREA_2,n=-r-Pn):(l.value=Lc.AREA_3,n=r>0?-r+gf:-r-gf);else{var c,h,p,y,v,x,I;this.face===yp.RIGHT?r=MV(r,+Pn):this.face===yp.BACK?r=MV(r,+gf):this.face===yp.LEFT&&(r=MV(r,-Pn)),y=Math.sin(i),v=Math.cos(i),x=Math.sin(r),I=Math.cos(r),c=v*I,h=v*x,p=y,this.face===yp.FRONT?(s=Math.acos(c),n=bue(s,p,h,l)):this.face===yp.RIGHT?(s=Math.acos(h),n=bue(s,p,-c,l)):this.face===yp.BACK?(s=Math.acos(-c),n=bue(s,p,-h,l)):this.face===yp.LEFT?(s=Math.acos(-h),n=bue(s,p,c,l)):(s=n=0,l.value=Lc.AREA_0)}return a=Math.atan(12/gf*(n+Math.acos(Math.sin(n)*Math.cos(Fc))-Pn)),o=Math.sqrt((1-Math.cos(s))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(n))))),l.value===Lc.AREA_1?a+=Pn:l.value===Lc.AREA_2?a+=gf:l.value===Lc.AREA_3&&(a+=1.5*gf),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,t.x=e.x,t.y=e.y,t}function Afi(t){var e={lam:0,phi:0},i,r,n,s,o,a,l,c,h,p={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,r=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?p.value=Lc.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(p.value=Lc.AREA_1,i-=Pn):t.x<0&&-t.x>=Math.abs(t.y)?(p.value=Lc.AREA_2,i=i<0?i+gf:i-gf):(p.value=Lc.AREA_3,i+=Pn),h=gf/12*Math.tan(i),o=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),a=Math.atan(o),n=Math.cos(i),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===yp.TOP)c=Math.acos(l),e.phi=Pn-c,p.value===Lc.AREA_0?e.lam=a+Pn:p.value===Lc.AREA_1?e.lam=a<0?a+gf:a-gf:p.value===Lc.AREA_2?e.lam=a-Pn:e.lam=a;else if(this.face===yp.BOTTOM)c=Math.acos(l),e.phi=c-Pn,p.value===Lc.AREA_0?e.lam=-a+Pn:p.value===Lc.AREA_1?e.lam=-a:p.value===Lc.AREA_2?e.lam=-a-Pn:e.lam=a<0?-a-gf:-a+gf;else{var y,v,x;y=l,h=y*y,h>=1?x=0:x=Math.sqrt(1-h)*Math.sin(a),h+=x*x,h>=1?v=0:v=Math.sqrt(1-h),p.value===Lc.AREA_1?(h=v,v=-x,x=h):p.value===Lc.AREA_2?(v=-v,x=-x):p.value===Lc.AREA_3&&(h=v,v=x,x=-h),this.face===yp.RIGHT?(h=y,y=-v,v=h):this.face===yp.BACK?(y=-y,v=-v):this.face===yp.LEFT&&(h=y,y=v,v=-h),e.phi=Math.acos(-x)-Pn,e.lam=Math.atan2(v,y),this.face===yp.RIGHT?e.lam=MV(e.lam,-Pn):this.face===yp.BACK?e.lam=MV(e.lam,-gf):this.face===yp.LEFT&&(e.lam=MV(e.lam,+Pn))}if(this.es!==0){var I,P,F;I=e.phi<0?1:0,P=Math.tan(e.phi),F=this.b/Math.sqrt(P*P+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-F*F)/(this.one_minus_f*F)),I&&(e.phi=-e.phi)}return e.lam+=this.long0,t.x=e.lam,t.y=e.phi,t}function bue(t,e,i,r){var n;return tFc&&n<=Pn+Fc?(r.value=Lc.AREA_1,n-=Pn):n>Pn+Fc||n<=-(Pn+Fc)?(r.value=Lc.AREA_2,n=n>=0?n-gf:n+gf):(r.value=Lc.AREA_3,n+=Pn)),n}function MV(t,e){var i=t+e;return i<-gf?i+=wX:i>+gf&&(i-=wX),i}var Pfi=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const Ofi={init:Efi,forward:Ifi,inverse:Afi,names:Pfi};var MAe=[[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]],RX=[[-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]],mst=.8487,gst=1.3523,yst=DT/5,Rfi=1/yst,DV=18,wue=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},Mfi=function(t,e){return t[1]+e*(2*t[2]+e*3*t[3])};function Dfi(t,e,i,r){for(var n=e;r;--r){var s=t(n);if(n-=s,Math.abs(s)=DV&&(r=DV-1),i=DT*(i-Rfi*r);var n={x:wue(MAe[r],i)*e,y:wue(RX[r],i)};return t.y<0&&(n.y=-n.y),n.x=n.x*this.a*mst+this.x0,n.y=n.y*this.a*gst+this.y0,n}function Nfi(t){var e={x:(t.x-this.x0)/(this.a*mst),y:Math.abs(t.y-this.y0)/(this.a*gst)};if(e.y>=1)e.x/=MAe[DV][0],e.y=t.y<0?-Pn:Pn;else{var i=Math.floor(e.y*DV);for(i<0?i=0:i>=DV&&(i=DV-1);;)if(RX[i][0]>e.y)--i;else if(RX[i+1][0]<=e.y)++i;else break;var r=RX[i],n=5*(e.y-r[0])/(RX[i+1][0]-r[0]);n=Dfi(function(s){return(wue(r,s)-e.y)/Mfi(r,s)},n,fs,100),e.x/=wue(MAe[i],n),e.y=(5*i+n)*ny,t.y<0&&(e.y=-e.y)}return e.x=Ms(e.x+this.long0),e}var kfi=["Robinson","robin"];const $fi={init:Ffi,forward:Lfi,inverse:Nfi,names:kfi};function Bfi(){this.name="geocent"}function Vfi(t){var e=znt(t,this.es,this.a);return e}function jfi(t){var e=Hnt(t,this.es,this.a,this.b);return e}var Gfi=["Geocentric","geocentric","geocent","Geocent"];const Ufi={init:Bfi,forward:Vfi,inverse:jfi,names:Gfi};var g0={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},MX={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 zfi(){if(Object.keys(MX).forEach(function(i){if(typeof this[i]>"u")this[i]=MX[i].def;else{if(MX[i].num&&isNaN(this[i]))throw new Error("Invalid parameter value, must be numeric "+i+" = "+this[i]);MX[i].num&&(this[i]=parseFloat(this[i]))}MX[i].degrees&&(this[i]=this[i]*ny)}.bind(this)),Math.abs(Math.abs(this.lat0)-Pn)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 t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)}function Hfi(t){t.x-=this.long0;var e=Math.sin(t.y),i=Math.cos(t.y),r=Math.cos(t.x),n,s;switch(this.mode){case g0.OBLIQ:s=this.sinph0*e+this.cosph0*i*r;break;case g0.EQUIT:s=i*r;break;case g0.S_POLE:s=-e;break;case g0.N_POLE:s=e;break}switch(s=this.pn1/(this.p-s),n=s*i*Math.sin(t.x),this.mode){case g0.OBLIQ:s*=this.cosph0*e-this.sinph0*i*r;break;case g0.EQUIT:s*=e;break;case g0.N_POLE:s*=-(i*r);break;case g0.S_POLE:s*=i*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,t.x=n*this.a,t.y=s*this.a,t}function Wfi(t){t.x/=this.a,t.y/=this.a;var e={x:t.x,y:t.y},i,r,n;n=1/(this.pn1-t.y*this.sw),i=this.pn1*t.x*n,r=this.pn1*t.y*this.cw*n,t.x=i*this.cg+r*this.sg,t.y=r*this.cg-i*this.sg;var s=z2(t.x,t.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 t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,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 Kfi(t){var e=t.x,i=t.y,r,n,s,o;if(e=e-this.long0,this.shape==="ellipse"){i=Math.atan(this.radius_p2*Math.tan(i));var a=this.radius_p/z2(this.radius_p*Math.cos(i),Math.sin(i));if(n=a*Math.cos(e)*Math.cos(i),s=a*Math.sin(e)*Math.cos(i),o=a*Math.sin(i),(this.radius_g-n)*n-s*s-o*o*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;r=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(s/z2(o,r)),t.y=this.radius_g_1*Math.atan(o/r)):(t.x=this.radius_g_1*Math.atan(s/r),t.y=this.radius_g_1*Math.atan(o/z2(s,r)))}else this.shape==="sphere"&&(r=Math.cos(i),n=Math.cos(e)*r,s=Math.sin(e)*r,o=Math.sin(i),r=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(s/z2(o,r)),t.y=this.radius_g_1*Math.atan(o/r)):(t.x=this.radius_g_1*Math.atan(s/r),t.y=this.radius_g_1*Math.atan(o/z2(s,r))));return t.x=t.x*this.a,t.y=t.y*this.a,t}function Jfi(t){var e=-1,i=0,r=0,n,s,o,a;if(t.x=t.x/this.a,t.y=t.y/this.a,this.shape==="ellipse"){this.flip_axis?(r=Math.tan(t.y/this.radius_g_1),i=Math.tan(t.x/this.radius_g_1)*z2(1,r)):(i=Math.tan(t.x/this.radius_g_1),r=Math.tan(t.y/this.radius_g_1)*z2(1,i));var l=r/this.radius_p;if(n=i*i+l*l+e*e,s=2*this.radius_g*e,o=s*s-4*n*this.C,o<0)return t.x=Number.NaN,t.y=Number.NaN,t;a=(-s-Math.sqrt(o))/(2*n),e=this.radius_g+a*e,i*=a,r*=a,t.x=Math.atan2(i,e),t.y=Math.atan(r*Math.cos(t.x)/e),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if(this.shape==="sphere"){if(this.flip_axis?(r=Math.tan(t.y/this.radius_g_1),i=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+r*r)):(i=Math.tan(t.x/this.radius_g_1),r=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+i*i)),n=i*i+r*r+e*e,s=2*this.radius_g*e,o=s*s-4*n*this.C,o<0)return t.x=Number.NaN,t.y=Number.NaN,t;a=(-s-Math.sqrt(o))/(2*n),e=this.radius_g+a*e,i*=a,r*=a,t.x=Math.atan2(i,e),t.y=Math.atan(r*Math.cos(t.x)/e)}return t.x=t.x+this.long0,t}var Zfi=["Geostationary Satellite View","Geostationary_Satellite","geos"];const Qfi={init:Xfi,forward:Kfi,inverse:Jfi,names:Zfi};function emi(t){t.Proj.projections.add(yue),t.Proj.projections.add(vue),t.Proj.projections.add(odi),t.Proj.projections.add(gdi),t.Proj.projections.add(xdi),t.Proj.projections.add(Idi),t.Proj.projections.add(Ddi),t.Proj.projections.add($di),t.Proj.projections.add(Udi),t.Proj.projections.add(Ydi),t.Proj.projections.add(hpi),t.Proj.projections.add(ypi),t.Proj.projections.add(xpi),t.Proj.projections.add(Api),t.Proj.projections.add(Dpi),t.Proj.projections.add($pi),t.Proj.projections.add(Upi),t.Proj.projections.add(Ypi),t.Proj.projections.add(efi),t.Proj.projections.add(sfi),t.Proj.projections.add(cfi),t.Proj.projections.add(mfi),t.Proj.projections.add(bfi),t.Proj.projections.add(Tfi),t.Proj.projections.add(Ofi),t.Proj.projections.add($fi),t.Proj.projections.add(Ufi),t.Proj.projections.add(Yfi),t.Proj.projections.add(Qfi)}Ih.defaultDatum="WGS84",Ih.Proj=LT,Ih.WGS84=new Ih.Proj("WGS84"),Ih.Point=AV,Ih.toPoint=Xnt,Ih.defs=fv,Ih.nadgrid=lhi,Ih.transform=mue,Ih.mgrs=Chi,Ih.version="__VERSION__",emi(Ih);const vst="EPSG:4326";class tmi{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 i=e<10?`0${e}`:e;Ih.defs(`EPSG:326${i}`,`+proj=utm +zone=${e} +ellps=WGS84 +datum=WGS84 +units=m +no_defs`),e++}}addProjection(e,i){e=typeof e=="number"?`EPSG:${e}`:e,Ih.defs(e,i)}defaultEpsgLookup(e){const i=/urn:ogc:def:crs:EPSG::(\d+)/,r=/EPSG:(\d+)/,n=String(e).match(i)||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`;ur(a,{responseType:"text"}).then(h=>{h.data?s(h.data):o()},h=>{o(h)})})}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 i,r="";if(e.wkt)return!0;try{i=this.normalizeProj(e)}catch{return!1}e.latestWkid&&(r=this.normalizeProj(e.latestWkid));const n=(l,c)=>{l!==c&&Ih.defs(c,Ih.defs(l))};if(Ih.defs(i))return!0;if(r&&Ih.defs(r))return n(r,i),!0;const s=async l=>{try{const c=await this.epsgLookup(l);return c===null||c===""?!1:(Ih.defs(l,c),!0)}catch{return!1}};return await(r?s(r):Promise.resolve(!1))?(n(r,i),!0):s(i)}async checkProjBomber(e){if(e.length>0){const i=e.pop();if(await this.checkProj(i))return this.checkProjBomber(e);throw console.error("Unable to parse or locate projection information for this item:",i),new Error("Could not find projection information, see console for details")}}async projectGeoJson(e,i,r){let n=this.normalizeProj(i),s=this.normalizeProj(r);if(!n&&e.crs&&e.crs.type==="name"&&(n=ml.parseGeoJsonCrs(e.crs)),n||(n=vst),s||(s=vst),s===n)return e;await this.checkProjBomber([n,s]);const o=Ih(n,s).forward;return Sci.Tools.applyConverter(e,o)}async projectGeometry(e,i){if(i.type===pl.EXTENT)return this.projectExtent(e,i);await this.checkProjBomber([e,i.sr]);const r=i.toGeoJSON(),n=await this.projectGeoJson(r,this.normalizeProj(i.sr),this.normalizeProj(e)),s=bk.geom.geomGeoJsonToRamp(n,i.id);return s.sr=ml.parseSR(e),s}async projectExtent(e,i){const r=(I,P,F)=>{if(F===0)return[I,P];const k=[(I[0]+P[0])/2,(I[1]+P[1])/2];if(F===1)return[I,k,P];if(F>1){const j=r(I,k,F-1),V=r(k,P,F-1);return j.concat(V.slice(1))}return[[]]},n=i.toPolygonArray().pop()||[];let s=[];[0,1,2,3].map(I=>r(n[I],n[I+1],3).slice(1)).forEach(I=>s=s.concat(I));const o=new ry("warpy",[s],i.sr,!0),a=await this.projectGeometry(e,o),l=a.toArray().pop()||[],c=l.map(I=>I[0]),h=l.map(I=>I[1]),p=Math.min.apply(null,c),y=Math.max.apply(null,c),v=Math.min.apply(null,h),x=Math.max.apply(null,h);return Ad.fromParams(i.id+"_projected",p,v,y,x,a.sr)}}class imi{DEFAULT_MERCATOR="DEFAULT_ESRI_World_AuxMerc_3857";DEFAULT_LAMBERT="DEFAULT_NRCAN_Lambert_3978";proj;geom;sharedUtils;constructor(){this.proj=new tmi,this.geom=new aci,this.sharedUtils=new xci}defaultTileSchemas(){return[this.DEFAULT_LAMBERT,this.DEFAULT_MERCATOR]}defaultLODs(e){const i=r=>r.map(n=>({level:n[0],resolution:n[1],scale:n[2]}));if(e===this.DEFAULT_LAMBERT)return i([[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 i([[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 Gp{$iApi;get $vApp(){return this.$iApi.$vApp}get $element(){return this.$iApi.$element}constructor(e){this.$iApi=e}}function rmi(t){return typeof t=="function"&&t.render&&typeof t.render=="function"}function nmi(t){const e=["data","props","propsData","computed","methods","watch","template","render","components","model"];return typeof t=="object"&&!t.functional&&e.some(i=>t[i]!==void 0)}function smi(t){return typeof t=="object"&&t.default!==void 0}var _st={exports:{}};function DAe(){}DAe.prototype={on:function(t,e,i){var r=this.e||(this.e={});return(r[t]||(r[t]=[])).push({fn:e,ctx:i}),this},once:function(t,e,i){var r=this;function n(){r.off(t,n),e.apply(i,arguments)}return n._=e,this.on(t,n,i)},emit:function(t){var e=[].slice.call(arguments,1),i=((this.e||(this.e={}))[t]||[]).slice(),r=0,n=i.length;for(r;r!!i[n.toLowerCase()]:n=>!!i[n]}const Zc={},FV=[],gv=()=>{},xue=()=>!1,ami=/^on[^a-z]/,kN=t=>ami.test(t),LAe=t=>t.startsWith("onUpdate:"),Lu=Object.assign,NAe=(t,e)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)},lmi=Object.prototype.hasOwnProperty,rc=(t,e)=>lmi.call(t,e),xs=Array.isArray,LV=t=>NV(t)==="[object Map]",$N=t=>NV(t)==="[object Set]",bst=t=>NV(t)==="[object Date]",umi=t=>NV(t)==="[object RegExp]",Fa=t=>typeof t=="function",gl=t=>typeof t=="string",BM=t=>typeof t=="symbol",Qc=t=>t!==null&&typeof t=="object",kAe=t=>Qc(t)&&Fa(t.then)&&Fa(t.catch),wst=Object.prototype.toString,NV=t=>wst.call(t),cmi=t=>NV(t).slice(8,-1),xst=t=>NV(t)==="[object Object]",$Ae=t=>gl(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,BN=w_(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),hmi=w_("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Sue=t=>{const e=Object.create(null);return i=>e[i]||(e[i]=t(i))},dmi=/-(\w)/g,yf=Sue(t=>t.replace(dmi,(e,i)=>i?i.toUpperCase():"")),pmi=/\B([A-Z])/g,rb=Sue(t=>t.replace(pmi,"-$1").toLowerCase()),VM=Sue(t=>t.charAt(0).toUpperCase()+t.slice(1)),VN=Sue(t=>t?`on${VM(t)}`:""),kV=(t,e)=>!Object.is(t,e),$V=(t,e)=>{for(let i=0;i{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:i})},Tue=t=>{const e=parseFloat(t);return isNaN(e)?t:e},Eue=t=>{const e=gl(t)?Number(t):NaN;return isNaN(e)?t:e};let Sst;const BAe=()=>Sst||(Sst=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),fmi=w_("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");function nb(t){if(xs(t)){const e={};for(let i=0;i{if(i){const r=i.split(gmi);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function ms(t){let e="";if(gl(t))e=t;else if(xs(t))for(let i=0;ijM(i,e))}const xr=t=>gl(t)?t:t==null?"":xs(t)||Qc(t)&&(t.toString===wst||!Fa(t.toString))?JSON.stringify(t,Ist,2):String(t),Ist=(t,e)=>e&&e.__v_isRef?Ist(t,e.value):LV(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((i,[r,n])=>(i[`${r} =>`]=n,i),{})}:$N(e)?{[`Set(${e.size})`]:[...e.values()]}:Qc(e)&&!xs(e)&&!xst(e)?String(e):e;let sb;class Aue{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=sb,!e&&sb&&(this.index=(sb.scopes||(sb.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const i=sb;try{return sb=this,e()}finally{sb=i}}}on(){sb=this}off(){sb=this.parent}stop(e){if(this._active){let i,r;for(i=0,r=this.effects.length;i{const e=new Set(t);return e.w=0,e.n=0,e},Pst=t=>(t.w&GM)>0,Ost=t=>(t.n&GM)>0,Emi=({deps:t})=>{if(t.length)for(let e=0;e{const{deps:e}=t;if(e.length){let i=0;for(let r=0;r{(h==="length"||h>=l)&&a.push(c)})}else switch(i!==void 0&&a.push(o.get(i)),e){case"add":xs(t)?$Ae(i)&&a.push(o.get("length")):(a.push(o.get(jN)),LV(t)&&a.push(o.get(UAe)));break;case"delete":xs(t)||(a.push(o.get(jN)),LV(t)&&a.push(o.get(UAe)));break;case"set":LV(t)&&a.push(o.get(jN));break}if(a.length===1)a[0]&&zAe(a[0]);else{const l=[];for(const c of a)c&&l.push(...c);zAe(jAe(l))}}function zAe(t,e){const i=xs(t)?t:[...t];for(const r of i)r.computed&&Nst(r);for(const r of i)r.computed||Nst(r)}function Nst(t,e){(t!==H2||t.allowRecurse)&&(t.scheduler?t.scheduler():t.run())}function Ami(t,e){var i;return(i=Oue.get(t))==null?void 0:i.get(e)}const Pmi=w_("__proto__,__v_isRef,__isVue"),kst=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(BM)),Omi=Rue(),Rmi=Rue(!1,!0),Mmi=Rue(!0),Dmi=Rue(!0,!0),$st=Fmi();function Fmi(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...i){const r=Qs(this);for(let s=0,o=this.length;s{t[e]=function(...i){VV();const r=Qs(this)[e].apply(this,i);return jV(),r}}),t}function Lmi(t){const e=Qs(this);return x_(e,"has",t),e.hasOwnProperty(t)}function Rue(t=!1,e=!1){return function(r,n,s){if(n==="__v_isReactive")return!t;if(n==="__v_isReadonly")return t;if(n==="__v_isShallow")return e;if(n==="__v_raw"&&s===(t?e?Xst:Yst:e?qst:Wst).get(r))return r;const o=xs(r);if(!t){if(o&&rc($st,n))return Reflect.get($st,n,s);if(n==="hasOwnProperty")return Lmi}const a=Reflect.get(r,n,s);return(BM(n)?kst.has(n):Pmi(n))||(t||x_(r,"get",n),e)?a:Ic(a)?o&&$Ae(n)?a:a.value:Qc(a)?t?Bue(a):Fl(a):a}}const Nmi=Bst(),kmi=Bst(!0);function Bst(t=!1){return function(i,r,n,s){let o=i[r];if(HM(o)&&Ic(o)&&!Ic(n))return!1;if(!t&&(!GV(n)&&!HM(n)&&(o=Qs(o),n=Qs(n)),!xs(i)&&Ic(o)&&!Ic(n)))return o.value=n,!0;const a=xs(i)&&$Ae(r)?Number(r)t,Mue=t=>Reflect.getPrototypeOf(t);function Due(t,e,i=!1,r=!1){t=t.__v_raw;const n=Qs(t),s=Qs(e);i||(e!==s&&x_(n,"get",e),x_(n,"get",s));const{has:o}=Mue(n),a=r?HAe:i?qAe:LX;if(o.call(n,e))return a(t.get(e));if(o.call(n,s))return a(t.get(s));t!==n&&t.get(e)}function Fue(t,e=!1){const i=this.__v_raw,r=Qs(i),n=Qs(t);return e||(t!==n&&x_(r,"has",t),x_(r,"has",n)),t===n?i.has(t):i.has(t)||i.has(n)}function Lue(t,e=!1){return t=t.__v_raw,!e&&x_(Qs(t),"iterate",jN),Reflect.get(t,"size",t)}function Gst(t){t=Qs(t);const e=Qs(this);return Mue(e).has.call(e,t)||(e.add(t),xP(e,"add",t,t)),this}function Ust(t,e){e=Qs(e);const i=Qs(this),{has:r,get:n}=Mue(i);let s=r.call(i,t);s||(t=Qs(t),s=r.call(i,t));const o=n.call(i,t);return i.set(t,e),s?kV(e,o)&&xP(i,"set",t,e):xP(i,"add",t,e),this}function zst(t){const e=Qs(this),{has:i,get:r}=Mue(e);let n=i.call(e,t);n||(t=Qs(t),n=i.call(e,t)),r&&r.call(e,t);const s=e.delete(t);return n&&xP(e,"delete",t,void 0),s}function Hst(){const t=Qs(this),e=t.size!==0,i=t.clear();return e&&xP(t,"clear",void 0,void 0),i}function Nue(t,e){return function(r,n){const s=this,o=s.__v_raw,a=Qs(o),l=e?HAe:t?qAe:LX;return!t&&x_(a,"iterate",jN),o.forEach((c,h)=>r.call(n,l(c),l(h),s))}}function kue(t,e,i){return function(...r){const n=this.__v_raw,s=Qs(n),o=LV(s),a=t==="entries"||t===Symbol.iterator&&o,l=t==="keys"&&o,c=n[t](...r),h=i?HAe:e?qAe:LX;return!e&&x_(s,"iterate",l?UAe:jN),{next(){const{value:p,done:y}=c.next();return y?{value:p,done:y}:{value:a?[h(p[0]),h(p[1])]:h(p),done:y}},[Symbol.iterator](){return this}}}}function zM(t){return function(...e){return t==="delete"?!1:this}}function Umi(){const t={get(s){return Due(this,s)},get size(){return Lue(this)},has:Fue,add:Gst,set:Ust,delete:zst,clear:Hst,forEach:Nue(!1,!1)},e={get(s){return Due(this,s,!1,!0)},get size(){return Lue(this)},has:Fue,add:Gst,set:Ust,delete:zst,clear:Hst,forEach:Nue(!1,!0)},i={get(s){return Due(this,s,!0)},get size(){return Lue(this,!0)},has(s){return Fue.call(this,s,!0)},add:zM("add"),set:zM("set"),delete:zM("delete"),clear:zM("clear"),forEach:Nue(!0,!1)},r={get(s){return Due(this,s,!0,!0)},get size(){return Lue(this,!0)},has(s){return Fue.call(this,s,!0)},add:zM("add"),set:zM("set"),delete:zM("delete"),clear:zM("clear"),forEach:Nue(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(s=>{t[s]=kue(s,!1,!1),i[s]=kue(s,!0,!1),e[s]=kue(s,!1,!0),r[s]=kue(s,!0,!0)}),[t,i,e,r]}const[zmi,Hmi,Wmi,qmi]=Umi();function $ue(t,e){const i=e?t?qmi:Wmi:t?Hmi:zmi;return(r,n,s)=>n==="__v_isReactive"?!t:n==="__v_isReadonly"?t:n==="__v_raw"?r:Reflect.get(rc(i,n)&&n in r?i:r,n,s)}const Ymi={get:$ue(!1,!1)},Xmi={get:$ue(!1,!0)},Kmi={get:$ue(!0,!1)},Jmi={get:$ue(!0,!0)},Wst=new WeakMap,qst=new WeakMap,Yst=new WeakMap,Xst=new WeakMap;function Zmi(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Qmi(t){return t.__v_skip||!Object.isExtensible(t)?0:Zmi(cmi(t))}function Fl(t){return HM(t)?t:Vue(t,!1,Vst,Ymi,Wst)}function WAe(t){return Vue(t,!1,jmi,Xmi,qst)}function Bue(t){return Vue(t,!0,jst,Kmi,Yst)}function Kst(t){return Vue(t,!0,Gmi,Jmi,Xst)}function Vue(t,e,i,r,n){if(!Qc(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=n.get(t);if(s)return s;const o=Qmi(t);if(o===0)return t;const a=new Proxy(t,o===2?r:i);return n.set(t,a),a}function Rw(t){return HM(t)?Rw(t.__v_raw):!!(t&&t.__v_isReactive)}function HM(t){return!!(t&&t.__v_isReadonly)}function GV(t){return!!(t&&t.__v_isShallow)}function jue(t){return Rw(t)||HM(t)}function Qs(t){const e=t&&t.__v_raw;return e?Qs(e):t}function ya(t){return Cue(t,"__v_skip",!0),t}const LX=t=>Qc(t)?Fl(t):t,qAe=t=>Qc(t)?Bue(t):t;function YAe(t){UM&&H2&&(t=Qs(t),Lst(t.dep||(t.dep=jAe())))}function Gue(t,e){t=Qs(t);const i=t.dep;i&&zAe(i)}function Ic(t){return!!(t&&t.__v_isRef===!0)}function Mi(t){return Jst(t,!1)}function XAe(t){return Jst(t,!0)}function Jst(t,e){return Ic(t)?t:new egi(t,e)}class egi{constructor(e,i){this.__v_isShallow=i,this.dep=void 0,this.__v_isRef=!0,this._rawValue=i?e:Qs(e),this._value=i?e:LX(e)}get value(){return YAe(this),this._value}set value(e){const i=this.__v_isShallow||GV(e)||HM(e);e=i?e:Qs(e),kV(e,this._rawValue)&&(this._rawValue=e,this._value=i?e:LX(e),Gue(this))}}function Zst(t){Gue(t)}function vi(t){return Ic(t)?t.value:t}function Qst(t){return Fa(t)?t():vi(t)}const tgi={get:(t,e,i)=>vi(Reflect.get(t,e,i)),set:(t,e,i,r)=>{const n=t[e];return Ic(n)&&!Ic(i)?(n.value=i,!0):Reflect.set(t,e,i,r)}};function Uue(t){return Rw(t)?t:new Proxy(t,tgi)}class igi{constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:i,set:r}=e(()=>YAe(this),()=>Gue(this));this._get=i,this._set=r}get value(){return this._get()}set value(e){this._set(e)}}function eot(t){return new igi(t)}function GN(t){const e=xs(t)?new Array(t.length):{};for(const i in t)e[i]=tot(t,i);return e}class rgi{constructor(e,i,r){this._object=e,this._key=i,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 Ami(Qs(this._object),this._key)}}class ngi{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function zue(t,e,i){return Ic(t)?t:Fa(t)?new ngi(t):Qc(t)&&arguments.length>1?tot(t,e,i):Mi(t)}function tot(t,e,i){const r=t[e];return Ic(r)?r:new rgi(t,e,i)}class sgi{constructor(e,i,r,n){this._setter=i,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new BV(e,()=>{this._dirty||(this._dirty=!0,Gue(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!n,this.__v_isReadonly=r}get value(){const e=Qs(this);return YAe(e),(e._dirty||!e._cacheable)&&(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function ogi(t,e,i=!1){let r,n;const s=Fa(t);return s?(r=t,n=gv):(r=t.get,n=t.set),new sgi(r,n,s||!n,i)}function iot(t,...e){}function rot(t,e){}function NT(t,e,i,r){let n;try{n=r?t(...r):t()}catch(s){WM(s,e,i)}return n}function S_(t,e,i,r){if(Fa(t)){const s=NT(t,e,i,r);return s&&kAe(s)&&s.catch(o=>{WM(o,e,i)}),s}const n=[];for(let s=0;s>>1;kX(y0[r])kT&&y0.splice(e,1)}function Wue(t){xs(t)?UV.push(...t):(!SP||!SP.includes(t,t.allowRecurse?UN+1:UN))&&UV.push(t),sot()}function oot(t,e=NX?kT+1:0){for(;ekX(i)-kX(r)),UN=0;UNt.id==null?1/0:t.id,cgi=(t,e)=>{const i=kX(t)-kX(e);if(i===0){if(t.pre&&!e.pre)return-1;if(e.pre&&!t.pre)return 1}return i};function aot(t){KAe=!1,NX=!0,y0.sort(cgi);const e=gv;try{for(kT=0;kTzN.emit(n,...s)),Yue=[]):typeof window<"u"&&window.HTMLElement&&!((r=(i=window.navigator)==null?void 0:i.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{ZAe(s,e)}),setTimeout(()=>{zN||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Yue=[])},3e3)):Yue=[]}function hgi(t,e,...i){if(t.isUnmounted)return;const r=t.vnode.props||Zc;let n=i;const s=e.startsWith("update:"),o=s&&e.slice(7);if(o&&o in r){const h=`${o==="modelValue"?"model":o}Modifiers`,{number:p,trim:y}=r[h]||Zc;y&&(n=i.map(v=>gl(v)?v.trim():v)),p&&(n=i.map(Tue))}let a,l=r[a=VN(e)]||r[a=VN(yf(e))];!l&&s&&(l=r[a=VN(rb(e))]),l&&S_(l,t,6,n);const c=r[a+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,S_(c,t,6,n)}}function lot(t,e,i=!1){const r=e.emitsCache,n=r.get(t);if(n!==void 0)return n;const s=t.emits;let o={},a=!1;if(!Fa(t)){const l=c=>{const h=lot(c,e,!0);h&&(a=!0,Lu(o,h))};!i&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!s&&!a?(Qc(t)&&r.set(t,null),null):(xs(s)?s.forEach(l=>o[l]=null):Lu(o,s),Qc(t)&&r.set(t,o),o)}function Xue(t,e){return!t||!kN(e)?!1:(e=e.slice(2).replace(/Once$/,""),rc(t,e[0].toLowerCase()+e.slice(1))||rc(t,rb(e))||rc(t,e))}let fg=null,Kue=null;function $X(t){const e=fg;return fg=t,Kue=t&&t.type.__scopeId||null,e}function eh(t){Kue=t}function th(){Kue=null}const uot=t=>En;function En(t,e=fg,i){if(!e||t._n)return t;const r=(...n)=>{r._d&&cce(-1);const s=$X(e);let o;try{o=t(...n)}finally{$X(s),r._d&&cce(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function xFr(){}function Jue(t){const{type:e,vnode:i,proxy:r,withProxy:n,props:s,propsOptions:[o],slots:a,attrs:l,emit:c,render:h,renderCache:p,data:y,setupState:v,ctx:x,inheritAttrs:I}=t;let P,F;const k=$X(t);try{if(i.shapeFlag&4){const V=n||r;P=ob(h.call(V,V,p,s,v,y,x)),F=l}else{const V=e;P=ob(V.length>1?V(s,{attrs:l,slots:a,emit:c}):V(s,null)),F=e.props?l:pgi(l)}}catch(V){KX.length=0,WM(V,t,1),P=Un(oy)}let j=P;if(F&&I!==!1){const V=Object.keys(F),{shapeFlag:Y}=j;V.length&&Y&7&&(o&&V.some(LAe)&&(F=fgi(F,o)),j=q2(j,F))}return i.dirs&&(j=q2(j),j.dirs=j.dirs?j.dirs.concat(i.dirs):i.dirs),i.transition&&(j.transition=i.transition),P=j,$X(k),P}function dgi(t){let e;for(let i=0;i{let e;for(const i in t)(i==="class"||i==="style"||kN(i))&&((e||(e={}))[i]=t[i]);return e},fgi=(t,e)=>{const i={};for(const r in t)(!LAe(r)||!(r.slice(9)in e))&&(i[r]=t[r]);return i};function mgi(t,e,i){const{props:r,children:n,component:s}=t,{props:o,children:a,patchFlag:l}=e,c=s.emitsOptions;if(e.dirs||e.transition)return!0;if(i&&l>=0){if(l&1024)return!0;if(l&16)return r?cot(r,o,c):!!o;if(l&8){const h=e.dynamicProps;for(let p=0;pt.__isSuspense,dot={name:"Suspense",__isSuspense:!0,process(t,e,i,r,n,s,o,a,l,c){t==null?ggi(e,i,r,n,s,o,a,l,c):ygi(t,e,i,r,n,o,a,l,c)},hydrate:vgi,create:ePe,normalize:_gi};function BX(t,e){const i=t.props&&t.props[e];Fa(i)&&i()}function ggi(t,e,i,r,n,s,o,a,l){const{p:c,o:{createElement:h}}=l,p=h("div"),y=t.suspense=ePe(t,n,r,e,p,i,s,o,a,l);c(null,y.pendingBranch=t.ssContent,p,null,r,y,s,o),y.deps>0?(BX(t,"onPending"),BX(t,"onFallback"),c(null,t.ssFallback,e,i,r,null,s,o),zV(y,t.ssFallback)):y.resolve(!1,!0)}function ygi(t,e,i,r,n,s,o,a,{p:l,um:c,o:{createElement:h}}){const p=e.suspense=t.suspense;p.vnode=e,e.el=t.el;const y=e.ssContent,v=e.ssFallback,{activeBranch:x,pendingBranch:I,isInFallback:P,isHydrating:F}=p;if(I)p.pendingBranch=y,W2(y,I)?(l(I,y,p.hiddenContainer,null,n,p,s,o,a),p.deps<=0?p.resolve():P&&(l(x,v,i,r,n,null,s,o,a),zV(p,v))):(p.pendingId++,F?(p.isHydrating=!1,p.activeBranch=I):c(I,n,p),p.deps=0,p.effects.length=0,p.hiddenContainer=h("div"),P?(l(null,y,p.hiddenContainer,null,n,p,s,o,a),p.deps<=0?p.resolve():(l(x,v,i,r,n,null,s,o,a),zV(p,v))):x&&W2(y,x)?(l(x,y,i,r,n,p,s,o,a),p.resolve(!0)):(l(null,y,p.hiddenContainer,null,n,p,s,o,a),p.deps<=0&&p.resolve()));else if(x&&W2(y,x))l(x,y,i,r,n,p,s,o,a),zV(p,y);else if(BX(e,"onPending"),p.pendingBranch=y,p.pendingId++,l(null,y,p.hiddenContainer,null,n,p,s,o,a),p.deps<=0)p.resolve();else{const{timeout:k,pendingId:j}=p;k>0?setTimeout(()=>{p.pendingId===j&&p.fallback(v)},k):k===0&&p.fallback(v)}}function ePe(t,e,i,r,n,s,o,a,l,c,h=!1){const{p,m:y,um:v,n:x,o:{parentNode:I,remove:P}}=c;let F;const k=bgi(t);k&&e?.pendingBranch&&(F=e.pendingId,e.deps++);const j=t.props?Eue(t.props.timeout):void 0,V={vnode:t,parent:e,parentComponent:i,isSVG:o,container:r,hiddenContainer:n,anchor:s,deps:0,pendingId:0,timeout:typeof j=="number"?j:-1,activeBranch:null,pendingBranch:null,isInFallback:!0,isHydrating:h,isUnmounted:!1,effects:[],resolve(Y=!1,X=!1){const{vnode:Z,activeBranch:ie,pendingBranch:ce,pendingId:he,effects:_e,parentComponent:xe,container:Pe}=V;if(V.isHydrating)V.isHydrating=!1;else if(!Y){const de=ie&&ce.transition&&ce.transition.mode==="out-in";de&&(ie.transition.afterLeave=()=>{he===V.pendingId&&y(ce,Pe,Se,0)});let{anchor:Se}=V;ie&&(Se=x(ie),v(ie,xe,V,!0)),de||y(ce,Pe,Se,0)}zV(V,ce),V.pendingBranch=null,V.isInFallback=!1;let ke=V.parent,J=!1;for(;ke;){if(ke.pendingBranch){ke.effects.push(..._e),J=!0;break}ke=ke.parent}J||Wue(_e),V.effects=[],k&&e&&e.pendingBranch&&F===e.pendingId&&(e.deps--,e.deps===0&&!X&&e.resolve()),BX(Z,"onResolve")},fallback(Y){if(!V.pendingBranch)return;const{vnode:X,activeBranch:Z,parentComponent:ie,container:ce,isSVG:he}=V;BX(X,"onFallback");const _e=x(Z),xe=()=>{V.isInFallback&&(p(null,Y,ce,_e,ie,null,he,a,l),zV(V,Y))},Pe=Y.transition&&Y.transition.mode==="out-in";Pe&&(Z.transition.afterLeave=xe),V.isInFallback=!0,v(Z,ie,null,!0),Pe||xe()},move(Y,X,Z){V.activeBranch&&y(V.activeBranch,Y,X,Z),V.container=Y},next(){return V.activeBranch&&x(V.activeBranch)},registerDep(Y,X){const Z=!!V.pendingBranch;Z&&V.deps++;const ie=Y.vnode.el;Y.asyncDep.catch(ce=>{WM(ce,Y,0)}).then(ce=>{if(Y.isUnmounted||V.isUnmounted||V.pendingId!==Y.suspenseId)return;Y.asyncResolved=!0;const{vnode:he}=Y;OPe(Y,ce,!1),ie&&(he.el=ie);const _e=!ie&&Y.subTree.el;X(Y,he,I(ie||Y.subTree.el),ie?null:x(Y.subTree),V,o,l),_e&&P(_e),QAe(Y,he.el),Z&&--V.deps===0&&V.resolve()})},unmount(Y,X){V.isUnmounted=!0,V.activeBranch&&v(V.activeBranch,i,Y,X),V.pendingBranch&&v(V.pendingBranch,i,Y,X)}};return V}function vgi(t,e,i,r,n,s,o,a,l){const c=e.suspense=ePe(e,r,i,t.parentNode,document.createElement("div"),null,n,s,o,a,!0),h=l(t,c.pendingBranch=e.ssContent,i,c,s,o);return c.deps===0&&c.resolve(!1,!0),h}function _gi(t){const{shapeFlag:e,children:i}=t,r=e&32;t.ssContent=pot(r?i.default:i),t.ssFallback=r?pot(i.fallback):Un(oy)}function pot(t){let e;if(Fa(t)){const i=JN&&t._c;i&&(t._d=!1,Qt()),t=t(),i&&(t._d=!0,e=T_,oat())}return xs(t)&&(t=dgi(t)),t=ob(t),e&&!t.dynamicChildren&&(t.dynamicChildren=e.filter(i=>i!==t)),t}function fot(t,e){e&&e.pendingBranch?xs(t)?e.effects.push(...t):e.effects.push(t):Wue(t)}function zV(t,e){t.activeBranch=e;const{vnode:i,parentComponent:r}=t,n=i.el=e.el;r&&r.subTree===i&&(r.vnode.el=n,QAe(r,n))}function bgi(t){var e;return((e=t.props)==null?void 0:e.suspensible)!=null&&t.props.suspensible!==!1}function mot(t,e){return VX(t,null,e)}function tPe(t,e){return VX(t,null,{flush:"post"})}function got(t,e){return VX(t,null,{flush:"sync"})}const Zue={};function bu(t,e,i){return VX(t,e,i)}function VX(t,e,{immediate:i,deep:r,flush:n,onTrack:s,onTrigger:o}=Zc){var a;const l=Pue()===((a=Kf)==null?void 0:a.scope)?Kf:null;let c,h=!1,p=!1;if(Ic(t)?(c=()=>t.value,h=GV(t)):Rw(t)?(c=()=>t,r=!0):xs(t)?(p=!0,h=t.some(V=>Rw(V)||GV(V)),c=()=>t.map(V=>{if(Ic(V))return V.value;if(Rw(V))return HN(V);if(Fa(V))return NT(V,l,2)})):Fa(t)?e?c=()=>NT(t,l,2):c=()=>{if(!(l&&l.isUnmounted))return y&&y(),S_(t,l,3,[v])}:c=gv,e&&r){const V=c;c=()=>HN(V())}let y,v=V=>{y=k.onStop=()=>{NT(V,l,4)}},x;if(WV)if(v=gv,e?i&&S_(e,l,3,[c(),p?[]:void 0,v]):c(),n==="sync"){const V=LPe();x=V.__watcherHandles||(V.__watcherHandles=[])}else return gv;let I=p?new Array(t.length).fill(Zue):Zue;const P=()=>{if(k.active)if(e){const V=k.run();(r||h||(p?V.some((Y,X)=>kV(Y,I[X])):kV(V,I)))&&(y&&y(),S_(e,l,3,[V,I===Zue?void 0:p&&I[0]===Zue?[]:I,v]),I=V)}else k.run()};P.allowRecurse=!!e;let F;n==="sync"?F=P:n==="post"?F=()=>sy(P,l&&l.suspense):(P.pre=!0,l&&(P.id=l.uid),F=()=>Hue(P));const k=new BV(c,F);e?i?P():I=k.run():n==="post"?sy(k.run.bind(k),l&&l.suspense):k.run();const j=()=>{k.stop(),l&&l.scope&&NAe(l.scope.effects,k)};return x&&x.push(j),j}function wgi(t,e,i){const r=this.proxy,n=gl(t)?t.includes(".")?yot(r,t):()=>r[t]:t.bind(r,r);let s;Fa(e)?s=e:(s=e.handler,i=e);const o=Kf;JM(this);const a=VX(n,s.bind(r),i);return o?JM(o):ZM(),a}function yot(t,e){const i=e.split(".");return()=>{let r=t;for(let n=0;n{HN(i,e)});else if(xst(t))for(const i in t)HN(t[i],e);return t}function Zr(t,e){const i=fg;if(i===null)return t;const r=mce(i)||i.proxy,n=t.dirs||(t.dirs=[]);for(let s=0;s{t.isMounted=!0}),Ll(()=>{t.isUnmounting=!0}),t}const Mw=[Function,Array],ece={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Mw,onEnter:Mw,onAfterEnter:Mw,onEnterCancelled:Mw,onBeforeLeave:Mw,onLeave:Mw,onAfterLeave:Mw,onLeaveCancelled:Mw,onBeforeAppear:Mw,onAppear:Mw,onAfterAppear:Mw,onAppearCancelled:Mw},iPe={name:"BaseTransition",props:ece,setup(t,{slots:e}){const i=Up(),r=Que();let n;return()=>{const s=e.default&&jX(e.default(),!0);if(!s||!s.length)return;let o=s[0];if(s.length>1){for(const I of s)if(I.type!==oy){o=I;break}}const a=Qs(t),{mode:l}=a;if(r.isLeaving)return rPe(o);const c=_ot(o);if(!c)return rPe(o);const h=WN(c,a,r,i);qM(c,h);const p=i.subTree,y=p&&_ot(p);let v=!1;const{getTransitionKey:x}=c.type;if(x){const I=x();n===void 0?n=I:I!==n&&(n=I,v=!0)}if(y&&y.type!==oy&&(!W2(c,y)||v)){const I=WN(y,a,r,i);if(qM(y,I),l==="out-in")return r.isLeaving=!0,I.afterLeave=()=>{r.isLeaving=!1,i.update.active!==!1&&i.update()},rPe(o);l==="in-out"&&c.type!==oy&&(I.delayLeave=(P,F,k)=>{const j=vot(r,y);j[String(y.key)]=y,P._leaveCb=()=>{F(),P._leaveCb=void 0,delete h.delayedLeave},h.delayedLeave=k})}return o}}};function vot(t,e){const{leavingVNodes:i}=t;let r=i.get(e.type);return r||(r=Object.create(null),i.set(e.type,r)),r}function WN(t,e,i,r){const{appear:n,mode:s,persisted:o=!1,onBeforeEnter:a,onEnter:l,onAfterEnter:c,onEnterCancelled:h,onBeforeLeave:p,onLeave:y,onAfterLeave:v,onLeaveCancelled:x,onBeforeAppear:I,onAppear:P,onAfterAppear:F,onAppearCancelled:k}=e,j=String(t.key),V=vot(i,t),Y=(ie,ce)=>{ie&&S_(ie,r,9,ce)},X=(ie,ce)=>{const he=ce[1];Y(ie,ce),xs(ie)?ie.every(_e=>_e.length<=1)&&he():ie.length<=1&&he()},Z={mode:s,persisted:o,beforeEnter(ie){let ce=a;if(!i.isMounted)if(n)ce=I||a;else return;ie._leaveCb&&ie._leaveCb(!0);const he=V[j];he&&W2(t,he)&&he.el._leaveCb&&he.el._leaveCb(),Y(ce,[ie])},enter(ie){let ce=l,he=c,_e=h;if(!i.isMounted)if(n)ce=P||l,he=F||c,_e=k||h;else return;let xe=!1;const Pe=ie._enterCb=ke=>{xe||(xe=!0,ke?Y(_e,[ie]):Y(he,[ie]),Z.delayedLeave&&Z.delayedLeave(),ie._enterCb=void 0)};ce?X(ce,[ie,Pe]):Pe()},leave(ie,ce){const he=String(t.key);if(ie._enterCb&&ie._enterCb(!0),i.isUnmounting)return ce();Y(p,[ie]);let _e=!1;const xe=ie._leaveCb=Pe=>{_e||(_e=!0,ce(),Pe?Y(x,[ie]):Y(v,[ie]),ie._leaveCb=void 0,V[he]===t&&delete V[he])};V[he]=t,y?X(y,[ie,xe]):xe()},clone(ie){return WN(ie,e,i,r)}};return Z}function rPe(t){if(UX(t))return t=q2(t),t.children=null,t}function _ot(t){return UX(t)?t.children?t.children[0]:void 0:t}function qM(t,e){t.shapeFlag&6&&t.component?qM(t.component.subTree,e):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function jX(t,e=!1,i){let r=[],n=0;for(let s=0;s1)for(let s=0;sLu({name:t.name},e,{setup:t}))():t}const qN=t=>!!t.type.__asyncLoader;function GX(t){Fa(t)&&(t={loader:t});const{loader:e,loadingComponent:i,errorComponent:r,delay:n=200,timeout:s,suspensible:o=!0,onError:a}=t;let l=null,c,h=0;const p=()=>(h++,l=null,y()),y=()=>{let v;return l||(v=l=e().catch(x=>{if(x=x instanceof Error?x:new Error(String(x)),a)return new Promise((I,P)=>{a(x,()=>I(p()),()=>P(x),h+1)});throw x}).then(x=>v!==l&&l?l:(x&&(x.__esModule||x[Symbol.toStringTag]==="Module")&&(x=x.default),c=x,x)))};return an({name:"AsyncComponentWrapper",__asyncLoader:y,get __asyncResolved(){return c},setup(){const v=Kf;if(c)return()=>nPe(c,v);const x=k=>{l=null,WM(k,v,13,!r)};if(o&&v.suspense||WV)return y().then(k=>()=>nPe(k,v)).catch(k=>(x(k),()=>r?Un(r,{error:k}):null));const I=Mi(!1),P=Mi(),F=Mi(!!n);return n&&setTimeout(()=>{F.value=!1},n),s!=null&&setTimeout(()=>{if(!I.value&&!P.value){const k=new Error(`Async component timed out after ${s}ms.`);x(k),P.value=k}},s),y().then(()=>{I.value=!0,v.parent&&UX(v.parent.vnode)&&Hue(v.parent.update)}).catch(k=>{x(k),P.value=k}),()=>{if(I.value&&c)return nPe(c,v);if(P.value&&r)return Un(r,{error:P.value});if(i&&!F.value)return Un(i)}}})}function nPe(t,e){const{ref:i,props:r,children:n,ce:s}=e.vnode,o=Un(t,r,n);return o.ref=i,o.ce=s,delete e.vnode.ce,o}const UX=t=>t.type.__isKeepAlive,bot={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(t,{slots:e}){const i=Up(),r=i.ctx;if(!r.renderer)return()=>{const k=e.default&&e.default();return k&&k.length===1?k[0]:k};const n=new Map,s=new Set;let o=null;const a=i.suspense,{renderer:{p:l,m:c,um:h,o:{createElement:p}}}=r,y=p("div");r.activate=(k,j,V,Y,X)=>{const Z=k.component;c(k,j,V,0,a),l(Z.vnode,k,j,V,Z,a,Y,k.slotScopeIds,X),sy(()=>{Z.isDeactivated=!1,Z.a&&$V(Z.a);const ie=k.props&&k.props.onVnodeMounted;ie&&E_(ie,Z.parent,k)},a)},r.deactivate=k=>{const j=k.component;c(k,y,null,1,a),sy(()=>{j.da&&$V(j.da);const V=k.props&&k.props.onVnodeUnmounted;V&&E_(V,j.parent,k),j.isDeactivated=!0},a)};function v(k){aPe(k),h(k,i,a,!0)}function x(k){n.forEach((j,V)=>{const Y=DPe(j.type);Y&&(!k||!k(Y))&&I(V)})}function I(k){const j=n.get(k);!o||!W2(j,o)?v(j):o&&aPe(o),n.delete(k),s.delete(k)}bu(()=>[t.include,t.exclude],([k,j])=>{k&&x(V=>zX(k,V)),j&&x(V=>!zX(j,V))},{flush:"post",deep:!0});let P=null;const F=()=>{P!=null&&n.set(P,lPe(i.subTree))};return Ja(F),YN(F),Ll(()=>{n.forEach(k=>{const{subTree:j,suspense:V}=i,Y=lPe(j);if(k.type===Y.type&&k.key===Y.key){aPe(Y);const X=Y.component.da;X&&sy(X,V);return}v(k)})}),()=>{if(P=null,!e.default)return null;const k=e.default(),j=k[0];if(k.length>1)return o=null,k;if(!BT(j)||!(j.shapeFlag&4)&&!(j.shapeFlag&128))return o=null,j;let V=lPe(j);const Y=V.type,X=DPe(qN(V)?V.type.__asyncResolved||{}:Y),{include:Z,exclude:ie,max:ce}=t;if(Z&&(!X||!zX(Z,X))||ie&&X&&zX(ie,X))return o=V,j;const he=V.key==null?Y:V.key,_e=n.get(he);return V.el&&(V=q2(V),j.shapeFlag&128&&(j.ssContent=V)),P=he,_e?(V.el=_e.el,V.component=_e.component,V.transition&&qM(V,V.transition),V.shapeFlag|=512,s.delete(he),s.add(he)):(s.add(he),ce&&s.size>parseInt(ce,10)&&I(s.values().next().value)),V.shapeFlag|=256,o=V,hot(j.type)?j:V}}};function zX(t,e){return xs(t)?t.some(i=>zX(i,e)):gl(t)?t.split(",").includes(e):umi(t)?t.test(e):!1}function sPe(t,e){wot(t,"a",e)}function oPe(t,e){wot(t,"da",e)}function wot(t,e,i=Kf){const r=t.__wdc||(t.__wdc=()=>{let n=i;for(;n;){if(n.isDeactivated)return;n=n.parent}return t()});if(tce(e,r,i),i){let n=i.parent;for(;n&&n.parent;)UX(n.parent.vnode)&&xgi(r,e,i,n),n=n.parent}}function xgi(t,e,i,r){const n=tce(e,t,r,!0);XN(()=>{NAe(r[e],n)},i)}function aPe(t){t.shapeFlag&=-257,t.shapeFlag&=-513}function lPe(t){return t.shapeFlag&128?t.ssContent:t}function tce(t,e,i=Kf,r=!1){if(i){const n=i[t]||(i[t]=[]),s=e.__weh||(e.__weh=(...o)=>{if(i.isUnmounted)return;VV(),JM(i);const a=S_(e,i,t,o);return ZM(),jV(),a});return r?n.unshift(s):n.push(s),s}}const CP=t=>(e,i=Kf)=>(!WV||t==="sp")&&tce(t,(...r)=>e(...r),i),C_=CP("bm"),Ja=CP("m"),ice=CP("bu"),YN=CP("u"),Ll=CP("bum"),XN=CP("um"),uPe=CP("sp"),cPe=CP("rtg"),hPe=CP("rtc");function rce(t,e=Kf){tce("ec",t,e)}const dPe="components",Sgi="directives";function Vo(t,e){return pPe(dPe,t,!0,e)||t}const xot=Symbol.for("v-ndc");function TP(t){return gl(t)?pPe(dPe,t,!1)||t:t||xot}function as(t){return pPe(Sgi,t)}function pPe(t,e,i=!0,r=!1){const n=fg||Kf;if(n){const s=n.type;if(t===dPe){const a=DPe(s,!1);if(a&&(a===e||a===yf(e)||a===VM(yf(e))))return s}const o=Sot(n[t]||s[t],e)||Sot(n.appContext[t],e);return!o&&r?s:o}}function Sot(t,e){return t&&(t[e]||t[yf(e)]||t[VM(yf(e))])}function fu(t,e,i,r){let n;const s=i&&i[r];if(xs(t)||gl(t)){n=new Array(t.length);for(let o=0,a=t.length;oe(o,a,void 0,s&&s[a]));else{const o=Object.keys(t);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 t}function Xf(t,e,i={},r,n){if(fg.isCE||fg.parent&&qN(fg.parent)&&fg.parent.isCE)return e!=="default"&&(i.name=e),Un("slot",i,r&&r());let s=t[e];s&&s._c&&(s._d=!1),Qt();const o=s&&Tot(s(i)),a=Bn(po,{key:i.key||o&&o.key||`_${e}`},o||(r?r():[]),o&&t._===1?64:-2);return!n&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),s&&s._c&&(s._d=!0),a}function Tot(t){return t.some(e=>BT(e)?!(e.type===oy||e.type===po&&!Tot(e.children)):!0)?t:null}function Eot(t,e){const i={};for(const r in t)i[e&&/[A-Z]/.test(r)?`on:${r}`:VN(r)]=t[r];return i}const fPe=t=>t?dat(t)?mce(t)||t.proxy:fPe(t.parent):null,HX=Lu(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>fPe(t.parent),$root:t=>fPe(t.root),$emit:t=>t.emit,$options:t=>vPe(t),$forceUpdate:t=>t.f||(t.f=()=>Hue(t.update)),$nextTick:t=>t.n||(t.n=v0.bind(t.proxy)),$watch:t=>wgi.bind(t)}),mPe=(t,e)=>t!==Zc&&!t.__isScriptSetup&&rc(t,e),gPe={get({_:t},e){const{ctx:i,setupState:r,data:n,props:s,accessCache:o,type:a,appContext:l}=t;let c;if(e[0]!=="$"){const v=o[e];if(v!==void 0)switch(v){case 1:return r[e];case 2:return n[e];case 4:return i[e];case 3:return s[e]}else{if(mPe(r,e))return o[e]=1,r[e];if(n!==Zc&&rc(n,e))return o[e]=2,n[e];if((c=t.propsOptions[0])&&rc(c,e))return o[e]=3,s[e];if(i!==Zc&&rc(i,e))return o[e]=4,i[e];yPe&&(o[e]=0)}}const h=HX[e];let p,y;if(h)return e==="$attrs"&&x_(t,"get",e),h(t);if((p=a.__cssModules)&&(p=p[e]))return p;if(i!==Zc&&rc(i,e))return o[e]=4,i[e];if(y=l.config.globalProperties,rc(y,e))return y[e]},set({_:t},e,i){const{data:r,setupState:n,ctx:s}=t;return mPe(n,e)?(n[e]=i,!0):r!==Zc&&rc(r,e)?(r[e]=i,!0):rc(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=i,!0)},has({_:{data:t,setupState:e,accessCache:i,ctx:r,appContext:n,propsOptions:s}},o){let a;return!!i[o]||t!==Zc&&rc(t,o)||mPe(e,o)||(a=s[0])&&rc(a,o)||rc(r,o)||rc(HX,o)||rc(n.config.globalProperties,o)},defineProperty(t,e,i){return i.get!=null?t._.accessCache[e]=0:rc(i,"value")&&this.set(t,e,i.value,null),Reflect.defineProperty(t,e,i)}},Cgi=Lu({},gPe,{get(t,e){if(e!==Symbol.unscopables)return gPe.get(t,e,t)},has(t,e){return e[0]!=="_"&&!fmi(e)}});function Iot(){return null}function Aot(){return null}function Pot(t){}function Oot(t){}function Rot(){return null}function Mot(){}function Dot(t,e){return null}function Fot(){return kot().slots}function Lot(){return kot().attrs}function Not(t,e,i){const r=Up();if(i&&i.local){const n=Mi(t[e]);return bu(()=>t[e],s=>n.value=s),bu(n,s=>{s!==t[e]&&r.emit(`update:${e}`,s)}),n}else return{__v_isRef:!0,get value(){return t[e]},set value(n){r.emit(`update:${e}`,n)}}}function kot(){const t=Up();return t.setupContext||(t.setupContext=gat(t))}function WX(t){return xs(t)?t.reduce((e,i)=>(e[i]=null,e),{}):t}function $ot(t,e){const i=WX(t);for(const r in e){if(r.startsWith("__skip"))continue;let n=i[r];n?xs(n)||Fa(n)?n=i[r]={type:n,default:e[r]}:n.default=e[r]:n===null&&(n=i[r]={default:e[r]}),n&&e[`__skip_${r}`]&&(n.skipFactory=!0)}return i}function Bot(t,e){return!t||!e?t||e:xs(t)&&xs(e)?t.concat(e):Lu({},WX(t),WX(e))}function Vot(t,e){const i={};for(const r in t)e.includes(r)||Object.defineProperty(i,r,{enumerable:!0,get:()=>t[r]});return i}function jot(t){const e=Up();let i=t();return ZM(),kAe(i)&&(i=i.catch(r=>{throw JM(e),r})),[i,()=>JM(e)]}let yPe=!0;function Tgi(t){const e=vPe(t),i=t.proxy,r=t.ctx;yPe=!1,e.beforeCreate&&Got(e.beforeCreate,t,"bc");const{data:n,computed:s,methods:o,watch:a,provide:l,inject:c,created:h,beforeMount:p,mounted:y,beforeUpdate:v,updated:x,activated:I,deactivated:P,beforeDestroy:F,beforeUnmount:k,destroyed:j,unmounted:V,render:Y,renderTracked:X,renderTriggered:Z,errorCaptured:ie,serverPrefetch:ce,expose:he,inheritAttrs:_e,components:xe,directives:Pe,filters:ke}=e;if(c&&Egi(c,r,null),o)for(const Se in o){const Ie=o[Se];Fa(Ie)&&(r[Se]=Ie.bind(i))}if(n){const Se=n.call(i,i);Qc(Se)&&(t.data=Fl(Se))}if(yPe=!0,s)for(const Se in s){const Ie=s[Se],Re=Fa(Ie)?Ie.bind(i,i):Fa(Ie.get)?Ie.get.bind(i,i):gv,Oe=!Fa(Ie)&&Fa(Ie.set)?Ie.set.bind(i):gv,Ge=Jr({get:Re,set:Oe});Object.defineProperty(r,Se,{enumerable:!0,configurable:!0,get:()=>Ge.value,set:Be=>Ge.value=Be})}if(a)for(const Se in a)Uot(a[Se],r,i,Se);if(l){const Se=Fa(l)?l.call(i):l;Reflect.ownKeys(Se).forEach(Ie=>{sce(Ie,Se[Ie])})}h&&Got(h,t,"c");function de(Se,Ie){xs(Ie)?Ie.forEach(Re=>Se(Re.bind(i))):Ie&&Se(Ie.bind(i))}if(de(C_,p),de(Ja,y),de(ice,v),de(YN,x),de(sPe,I),de(oPe,P),de(rce,ie),de(hPe,X),de(cPe,Z),de(Ll,k),de(XN,V),de(uPe,ce),xs(he))if(he.length){const Se=t.exposed||(t.exposed={});he.forEach(Ie=>{Object.defineProperty(Se,Ie,{get:()=>i[Ie],set:Re=>i[Ie]=Re})})}else t.exposed||(t.exposed={});Y&&t.render===gv&&(t.render=Y),_e!=null&&(t.inheritAttrs=_e),xe&&(t.components=xe),Pe&&(t.directives=Pe)}function Egi(t,e,i=gv){xs(t)&&(t=_Pe(t));for(const r in t){const n=t[r];let s;Qc(n)?"default"in n?s=no(n.from||r,n.default,!0):s=no(n.from||r):s=no(n),Ic(s)?Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[r]=s}}function Got(t,e,i){S_(xs(t)?t.map(r=>r.bind(e.proxy)):t.bind(e.proxy),e,i)}function Uot(t,e,i,r){const n=r.includes(".")?yot(i,r):()=>i[r];if(gl(t)){const s=e[t];Fa(s)&&bu(n,s)}else if(Fa(t))bu(n,t.bind(i));else if(Qc(t))if(xs(t))t.forEach(s=>Uot(s,e,i,r));else{const s=Fa(t.handler)?t.handler.bind(i):e[t.handler];Fa(s)&&bu(n,s,t)}}function vPe(t){const e=t.type,{mixins:i,extends:r}=e,{mixins:n,optionsCache:s,config:{optionMergeStrategies:o}}=t.appContext,a=s.get(e);let l;return a?l=a:!n.length&&!i&&!r?l=e:(l={},n.length&&n.forEach(c=>nce(l,c,o,!0)),nce(l,e,o)),Qc(e)&&s.set(e,l),l}function nce(t,e,i,r=!1){const{mixins:n,extends:s}=e;s&&nce(t,s,i,!0),n&&n.forEach(o=>nce(t,o,i,!0));for(const o in e)if(!(r&&o==="expose")){const a=Igi[o]||i&&i[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const Igi={data:zot,props:Hot,emits:Hot,methods:qX,computed:qX,beforeCreate:yv,created:yv,beforeMount:yv,mounted:yv,beforeUpdate:yv,updated:yv,beforeDestroy:yv,beforeUnmount:yv,destroyed:yv,unmounted:yv,activated:yv,deactivated:yv,errorCaptured:yv,serverPrefetch:yv,components:qX,directives:qX,watch:Pgi,provide:zot,inject:Agi};function zot(t,e){return e?t?function(){return Lu(Fa(t)?t.call(this,this):t,Fa(e)?e.call(this,this):e)}:e:t}function Agi(t,e){return qX(_Pe(t),_Pe(e))}function _Pe(t){if(xs(t)){const e={};for(let i=0;i1)return i&&Fa(e)?e.call(r&&r.proxy):e}}function qot(){return!!(Kf||fg||YX)}function Mgi(t,e,i,r=!1){const n={},s={};Cue(s,hce,1),t.propsDefaults=Object.create(null),Yot(t,e,n,s);for(const o in t.propsOptions[0])o in n||(n[o]=void 0);i?t.props=r?n:WAe(n):t.type.props?t.props=n:t.props=s,t.attrs=s}function Dgi(t,e,i,r){const{props:n,attrs:s,vnode:{patchFlag:o}}=t,a=Qs(n),[l]=t.propsOptions;let c=!1;if((r||o>0)&&!(o&16)){if(o&8){const h=t.vnode.dynamicProps;for(let p=0;p{l=!0;const[y,v]=Xot(p,e,!0);Lu(o,y),v&&a.push(...v)};!i&&e.mixins.length&&e.mixins.forEach(h),t.extends&&h(t.extends),t.mixins&&t.mixins.forEach(h)}if(!s&&!l)return Qc(t)&&r.set(t,FV),FV;if(xs(s))for(let h=0;h-1,v[1]=I<0||x-1||rc(v,"default"))&&a.push(p)}}}const c=[o,a];return Qc(t)&&r.set(t,c),c}function Kot(t){return t[0]!=="$"}function Jot(t){const e=t&&t.toString().match(/^\s*(function|class) (\w+)/);return e?e[2]:t===null?"null":""}function Zot(t,e){return Jot(t)===Jot(e)}function Qot(t,e){return xs(e)?e.findIndex(i=>Zot(i,t)):Fa(e)&&Zot(e,t)?0:-1}const eat=t=>t[0]==="_"||t==="$stable",wPe=t=>xs(t)?t.map(ob):[ob(t)],Fgi=(t,e,i)=>{if(e._n)return e;const r=En((...n)=>wPe(e(...n)),i);return r._c=!1,r},tat=(t,e,i)=>{const r=t._ctx;for(const n in t){if(eat(n))continue;const s=t[n];if(Fa(s))e[n]=Fgi(n,s,r);else if(s!=null){const o=wPe(s);e[n]=()=>o}}},iat=(t,e)=>{const i=wPe(e);t.slots.default=()=>i},Lgi=(t,e)=>{if(t.vnode.shapeFlag&32){const i=e._;i?(t.slots=Qs(e),Cue(e,"_",i)):tat(e,t.slots={})}else t.slots={},e&&iat(t,e);Cue(t.slots,hce,1)},Ngi=(t,e,i)=>{const{vnode:r,slots:n}=t;let s=!0,o=Zc;if(r.shapeFlag&32){const a=e._;a?i&&a===1?s=!1:(Lu(n,e),!i&&a===1&&delete n._):(s=!e.$stable,tat(e,n)),o=e}else e&&(iat(t,e),o={default:1});if(s)for(const a in n)!eat(a)&&!(a in o)&&delete n[a]};function oce(t,e,i,r,n=!1){if(xs(t)){t.forEach((y,v)=>oce(y,e&&(xs(e)?e[v]:e),i,r,n));return}if(qN(r)&&!n)return;const s=r.shapeFlag&4?mce(r.component)||r.component.proxy:r.el,o=n?null:s,{i:a,r:l}=t,c=e&&e.r,h=a.refs===Zc?a.refs={}:a.refs,p=a.setupState;if(c!=null&&c!==l&&(gl(c)?(h[c]=null,rc(p,c)&&(p[c]=null)):Ic(c)&&(c.value=null)),Fa(l))NT(l,a,12,[o,h]);else{const y=gl(l),v=Ic(l);if(y||v){const x=()=>{if(t.f){const I=y?rc(p,l)?p[l]:h[l]:l.value;n?xs(I)&&NAe(I,s):xs(I)?I.includes(s)||I.push(s):y?(h[l]=[s],rc(p,l)&&(p[l]=h[l])):(l.value=[s],t.k&&(h[t.k]=l.value))}else y?(h[l]=o,rc(p,l)&&(p[l]=o)):v&&(l.value=o,t.k&&(h[t.k]=o))};o?(x.id=-1,sy(x,i)):x()}}}let YM=!1;const ace=t=>/svg/.test(t.namespaceURI)&&t.tagName!=="foreignObject",lce=t=>t.nodeType===8;function kgi(t){const{mt:e,p:i,o:{patchProp:r,createText:n,nextSibling:s,parentNode:o,remove:a,insert:l,createComment:c}}=t,h=(F,k)=>{if(!k.hasChildNodes()){i(null,F,k),que(),k._vnode=F;return}YM=!1,p(k.firstChild,F,null,null,null),que(),k._vnode=F,YM&&console.error("Hydration completed but contains mismatches.")},p=(F,k,j,V,Y,X=!1)=>{const Z=lce(F)&&F.data==="[",ie=()=>I(F,k,j,V,Y,Z),{type:ce,ref:he,shapeFlag:_e,patchFlag:xe}=k;let Pe=F.nodeType;k.el=F,xe===-2&&(X=!1,k.dynamicChildren=null);let ke=null;switch(ce){case EP:Pe!==3?k.children===""?(l(k.el=n(""),o(F),F),ke=F):ke=ie():(F.data!==k.children&&(YM=!0,F.data=k.children),ke=s(F));break;case oy:Pe!==8||Z?ke=ie():ke=s(F);break;case XM:if(Z&&(F=s(F),Pe=F.nodeType),Pe===1||Pe===3){ke=F;const J=!k.children.length;for(let de=0;de{X=X||!!k.dynamicChildren;const{type:Z,props:ie,patchFlag:ce,shapeFlag:he,dirs:_e}=k,xe=Z==="input"&&_e||Z==="option";if(xe||ce!==-1){if(_e&&$T(k,null,j,"created"),ie)if(xe||!X||ce&48)for(const ke in ie)(xe&&ke.endsWith("value")||kN(ke)&&!BN(ke))&&r(F,ke,null,ie[ke],!1,void 0,j);else ie.onClick&&r(F,"onClick",null,ie.onClick,!1,void 0,j);let Pe;if((Pe=ie&&ie.onVnodeBeforeMount)&&E_(Pe,j,k),_e&&$T(k,null,j,"beforeMount"),((Pe=ie&&ie.onVnodeMounted)||_e)&&fot(()=>{Pe&&E_(Pe,j,k),_e&&$T(k,null,j,"mounted")},V),he&16&&!(ie&&(ie.innerHTML||ie.textContent))){let ke=v(F.firstChild,k,F,j,V,Y,X);for(;ke;){YM=!0;const J=ke;ke=ke.nextSibling,a(J)}}else he&8&&F.textContent!==k.children&&(YM=!0,F.textContent=k.children)}return F.nextSibling},v=(F,k,j,V,Y,X,Z)=>{Z=Z||!!k.dynamicChildren;const ie=k.children,ce=ie.length;for(let he=0;he{const{slotScopeIds:Z}=k;Z&&(Y=Y?Y.concat(Z):Z);const ie=o(F),ce=v(s(F),k,ie,j,V,Y,X);return ce&&lce(ce)&&ce.data==="]"?s(k.anchor=ce):(YM=!0,l(k.anchor=c("]"),ie,ce),ce)},I=(F,k,j,V,Y,X)=>{if(YM=!0,k.el=null,X){const ce=P(F);for(;;){const he=s(F);if(he&&he!==ce)a(he);else break}}const Z=s(F),ie=o(F);return a(F),i(null,k,ie,Z,j,V,ace(ie),Y),Z},P=F=>{let k=0;for(;F;)if(F=s(F),F&&lce(F)&&(F.data==="["&&k++,F.data==="]")){if(k===0)return s(F);k--}return F};return[h,p]}const sy=fot;function xPe(t){return rat(t)}function SPe(t){return rat(t,kgi)}function rat(t,e){const i=BAe();i.__VUE__=!0;const{insert:r,remove:n,patchProp:s,createElement:o,createText:a,createComment:l,setText:c,setElementText:h,parentNode:p,nextSibling:y,setScopeId:v=gv,insertStaticContent:x}=t,I=(ot,Te,je,pt=null,kt=null,ct=null,ae=!1,ht=null,wt=!!Te.dynamicChildren)=>{if(ot===Te)return;ot&&!W2(ot,Te)&&(pt=Pt(ot),Be(ot,kt,ct,!0),ot=null),Te.patchFlag===-2&&(wt=!1,Te.dynamicChildren=null);const{type:Ne,ref:pe,shapeFlag:Ae}=Te;switch(Ne){case EP:P(ot,Te,je,pt);break;case oy:F(ot,Te,je,pt);break;case XM:ot==null&&k(Te,je,pt,ae);break;case po:xe(ot,Te,je,pt,kt,ct,ae,ht,wt);break;default:Ae&1?Y(ot,Te,je,pt,kt,ct,ae,ht,wt):Ae&6?Pe(ot,Te,je,pt,kt,ct,ae,ht,wt):(Ae&64||Ae&128)&&Ne.process(ot,Te,je,pt,kt,ct,ae,ht,wt,Ct)}pe!=null&&kt&&oce(pe,ot&&ot.ref,ct,Te||ot,!Te)},P=(ot,Te,je,pt)=>{if(ot==null)r(Te.el=a(Te.children),je,pt);else{const kt=Te.el=ot.el;Te.children!==ot.children&&c(kt,Te.children)}},F=(ot,Te,je,pt)=>{ot==null?r(Te.el=l(Te.children||""),je,pt):Te.el=ot.el},k=(ot,Te,je,pt)=>{[ot.el,ot.anchor]=x(ot.children,Te,je,pt,ot.el,ot.anchor)},j=({el:ot,anchor:Te},je,pt)=>{let kt;for(;ot&&ot!==Te;)kt=y(ot),r(ot,je,pt),ot=kt;r(Te,je,pt)},V=({el:ot,anchor:Te})=>{let je;for(;ot&&ot!==Te;)je=y(ot),n(ot),ot=je;n(Te)},Y=(ot,Te,je,pt,kt,ct,ae,ht,wt)=>{ae=ae||Te.type==="svg",ot==null?X(Te,je,pt,kt,ct,ae,ht,wt):ce(ot,Te,kt,ct,ae,ht,wt)},X=(ot,Te,je,pt,kt,ct,ae,ht)=>{let wt,Ne;const{type:pe,props:Ae,shapeFlag:tt,transition:gt,dirs:ze}=ot;if(wt=ot.el=o(ot.type,ct,Ae&&Ae.is,Ae),tt&8?h(wt,ot.children):tt&16&&ie(ot.children,wt,null,pt,kt,ct&&pe!=="foreignObject",ae,ht),ze&&$T(ot,null,pt,"created"),Z(wt,ot,ot.scopeId,ae,pt),Ae){for(const jt in Ae)jt!=="value"&&!BN(jt)&&s(wt,jt,null,Ae[jt],ct,ot.children,pt,kt,mt);"value"in Ae&&s(wt,"value",null,Ae.value),(Ne=Ae.onVnodeBeforeMount)&&E_(Ne,pt,ot)}ze&&$T(ot,null,pt,"beforeMount");const Ot=(!kt||kt&&!kt.pendingBranch)&>&&!gt.persisted;Ot&>.beforeEnter(wt),r(wt,Te,je),((Ne=Ae&&Ae.onVnodeMounted)||Ot||ze)&&sy(()=>{Ne&&E_(Ne,pt,ot),Ot&>.enter(wt),ze&&$T(ot,null,pt,"mounted")},kt)},Z=(ot,Te,je,pt,kt)=>{if(je&&v(ot,je),pt)for(let ct=0;ct{for(let Ne=wt;Ne{const ht=Te.el=ot.el;let{patchFlag:wt,dynamicChildren:Ne,dirs:pe}=Te;wt|=ot.patchFlag&16;const Ae=ot.props||Zc,tt=Te.props||Zc;let gt;je&&KN(je,!1),(gt=tt.onVnodeBeforeUpdate)&&E_(gt,je,Te,ot),pe&&$T(Te,ot,je,"beforeUpdate"),je&&KN(je,!0);const ze=kt&&Te.type!=="foreignObject";if(Ne?he(ot.dynamicChildren,Ne,ht,je,pt,ze,ct):ae||Ie(ot,Te,ht,null,je,pt,ze,ct,!1),wt>0){if(wt&16)_e(ht,Te,Ae,tt,je,pt,kt);else if(wt&2&&Ae.class!==tt.class&&s(ht,"class",null,tt.class,kt),wt&4&&s(ht,"style",Ae.style,tt.style,kt),wt&8){const Ot=Te.dynamicProps;for(let jt=0;jt{gt&&E_(gt,je,Te,ot),pe&&$T(Te,ot,je,"updated")},pt)},he=(ot,Te,je,pt,kt,ct,ae)=>{for(let ht=0;ht{if(je!==pt){if(je!==Zc)for(const ht in je)!BN(ht)&&!(ht in pt)&&s(ot,ht,je[ht],null,ae,Te.children,kt,ct,mt);for(const ht in pt){if(BN(ht))continue;const wt=pt[ht],Ne=je[ht];wt!==Ne&&ht!=="value"&&s(ot,ht,Ne,wt,ae,Te.children,kt,ct,mt)}"value"in pt&&s(ot,"value",je.value,pt.value)}},xe=(ot,Te,je,pt,kt,ct,ae,ht,wt)=>{const Ne=Te.el=ot?ot.el:a(""),pe=Te.anchor=ot?ot.anchor:a("");let{patchFlag:Ae,dynamicChildren:tt,slotScopeIds:gt}=Te;gt&&(ht=ht?ht.concat(gt):gt),ot==null?(r(Ne,je,pt),r(pe,je,pt),ie(Te.children,je,pe,kt,ct,ae,ht,wt)):Ae>0&&Ae&64&&tt&&ot.dynamicChildren?(he(ot.dynamicChildren,tt,je,kt,ct,ae,ht),(Te.key!=null||kt&&Te===kt.subTree)&&CPe(ot,Te,!0)):Ie(ot,Te,je,pe,kt,ct,ae,ht,wt)},Pe=(ot,Te,je,pt,kt,ct,ae,ht,wt)=>{Te.slotScopeIds=ht,ot==null?Te.shapeFlag&512?kt.ctx.activate(Te,je,pt,ae,wt):ke(Te,je,pt,kt,ct,ae,wt):J(ot,Te,wt)},ke=(ot,Te,je,pt,kt,ct,ae)=>{const ht=ot.component=cat(ot,pt,kt);if(UX(ot)&&(ht.ctx.renderer=Ct),pat(ht),ht.asyncDep){if(kt&&kt.registerDep(ht,de),!ot.el){const wt=ht.subTree=Un(oy);F(null,wt,Te,je)}return}de(ht,ot,Te,je,kt,ct,ae)},J=(ot,Te,je)=>{const pt=Te.component=ot.component;if(mgi(ot,Te,je))if(pt.asyncDep&&!pt.asyncResolved){Se(pt,Te,je);return}else pt.next=Te,ugi(pt.update),pt.update();else Te.el=ot.el,pt.vnode=Te},de=(ot,Te,je,pt,kt,ct,ae)=>{const ht=()=>{if(ot.isMounted){let{next:pe,bu:Ae,u:tt,parent:gt,vnode:ze}=ot,Ot=pe,jt;KN(ot,!1),pe?(pe.el=ze.el,Se(ot,pe,ae)):pe=ze,Ae&&$V(Ae),(jt=pe.props&&pe.props.onVnodeBeforeUpdate)&&E_(jt,gt,pe,ze),KN(ot,!0);const nt=Jue(ot),$e=ot.subTree;ot.subTree=nt,I($e,nt,p($e.el),Pt($e),ot,kt,ct),pe.el=nt.el,Ot===null&&QAe(ot,nt.el),tt&&sy(tt,kt),(jt=pe.props&&pe.props.onVnodeUpdated)&&sy(()=>E_(jt,gt,pe,ze),kt)}else{let pe;const{el:Ae,props:tt}=Te,{bm:gt,m:ze,parent:Ot}=ot,jt=qN(Te);if(KN(ot,!1),gt&&$V(gt),!jt&&(pe=tt&&tt.onVnodeBeforeMount)&&E_(pe,Ot,Te),KN(ot,!0),Ae&&Ft){const nt=()=>{ot.subTree=Jue(ot),Ft(Ae,ot.subTree,ot,kt,null)};jt?Te.type.__asyncLoader().then(()=>!ot.isUnmounted&&nt()):nt()}else{const nt=ot.subTree=Jue(ot);I(null,nt,je,pt,ot,kt,ct),Te.el=nt.el}if(ze&&sy(ze,kt),!jt&&(pe=tt&&tt.onVnodeMounted)){const nt=Te;sy(()=>E_(pe,Ot,nt),kt)}(Te.shapeFlag&256||Ot&&qN(Ot.vnode)&&Ot.vnode.shapeFlag&256)&&ot.a&&sy(ot.a,kt),ot.isMounted=!0,Te=je=pt=null}},wt=ot.effect=new BV(ht,()=>Hue(Ne),ot.scope),Ne=ot.update=()=>wt.run();Ne.id=ot.uid,KN(ot,!0),Ne()},Se=(ot,Te,je)=>{Te.component=ot;const pt=ot.vnode.props;ot.vnode=Te,ot.next=null,Dgi(ot,Te.props,pt,je),Ngi(ot,Te.children,je),VV(),oot(),jV()},Ie=(ot,Te,je,pt,kt,ct,ae,ht,wt=!1)=>{const Ne=ot&&ot.children,pe=ot?ot.shapeFlag:0,Ae=Te.children,{patchFlag:tt,shapeFlag:gt}=Te;if(tt>0){if(tt&128){Oe(Ne,Ae,je,pt,kt,ct,ae,ht,wt);return}else if(tt&256){Re(Ne,Ae,je,pt,kt,ct,ae,ht,wt);return}}gt&8?(pe&16&&mt(Ne,kt,ct),Ae!==Ne&&h(je,Ae)):pe&16?gt&16?Oe(Ne,Ae,je,pt,kt,ct,ae,ht,wt):mt(Ne,kt,ct,!0):(pe&8&&h(je,""),gt&16&&ie(Ae,je,pt,kt,ct,ae,ht,wt))},Re=(ot,Te,je,pt,kt,ct,ae,ht,wt)=>{ot=ot||FV,Te=Te||FV;const Ne=ot.length,pe=Te.length,Ae=Math.min(Ne,pe);let tt;for(tt=0;ttpe?mt(ot,kt,ct,!0,!1,Ae):ie(Te,je,pt,kt,ct,ae,ht,wt,Ae)},Oe=(ot,Te,je,pt,kt,ct,ae,ht,wt)=>{let Ne=0;const pe=Te.length;let Ae=ot.length-1,tt=pe-1;for(;Ne<=Ae&&Ne<=tt;){const gt=ot[Ne],ze=Te[Ne]=wt?KM(Te[Ne]):ob(Te[Ne]);if(W2(gt,ze))I(gt,ze,je,null,kt,ct,ae,ht,wt);else break;Ne++}for(;Ne<=Ae&&Ne<=tt;){const gt=ot[Ae],ze=Te[tt]=wt?KM(Te[tt]):ob(Te[tt]);if(W2(gt,ze))I(gt,ze,je,null,kt,ct,ae,ht,wt);else break;Ae--,tt--}if(Ne>Ae){if(Ne<=tt){const gt=tt+1,ze=gttt)for(;Ne<=Ae;)Be(ot[Ne],kt,ct,!0),Ne++;else{const gt=Ne,ze=Ne,Ot=new Map;for(Ne=ze;Ne<=tt;Ne++){const T=Te[Ne]=wt?KM(Te[Ne]):ob(Te[Ne]);T.key!=null&&Ot.set(T.key,Ne)}let jt,nt=0;const $e=tt-ze+1;let Xt=!1,A=0;const ye=new Array($e);for(Ne=0;Ne<$e;Ne++)ye[Ne]=0;for(Ne=gt;Ne<=Ae;Ne++){const T=ot[Ne];if(nt>=$e){Be(T,kt,ct,!0);continue}let b;if(T.key!=null)b=Ot.get(T.key);else for(jt=ze;jt<=tt;jt++)if(ye[jt-ze]===0&&W2(T,Te[jt])){b=jt;break}b===void 0?Be(T,kt,ct,!0):(ye[b-ze]=Ne+1,b>=A?A=b:Xt=!0,I(T,Te[b],je,null,kt,ct,ae,ht,wt),nt++)}const H=Xt?$gi(ye):FV;for(jt=H.length-1,Ne=$e-1;Ne>=0;Ne--){const T=ze+Ne,b=Te[T],m=T+1{const{el:ct,type:ae,transition:ht,children:wt,shapeFlag:Ne}=ot;if(Ne&6){Ge(ot.component.subTree,Te,je,pt);return}if(Ne&128){ot.suspense.move(Te,je,pt);return}if(Ne&64){ae.move(ot,Te,je,Ct);return}if(ae===po){r(ct,Te,je);for(let Ae=0;Aeht.enter(ct),kt);else{const{leave:Ae,delayLeave:tt,afterLeave:gt}=ht,ze=()=>r(ct,Te,je),Ot=()=>{Ae(ct,()=>{ze(),gt&>()})};tt?tt(ct,ze,Ot):Ot()}else r(ct,Te,je)},Be=(ot,Te,je,pt=!1,kt=!1)=>{const{type:ct,props:ae,ref:ht,children:wt,dynamicChildren:Ne,shapeFlag:pe,patchFlag:Ae,dirs:tt}=ot;if(ht!=null&&oce(ht,null,je,ot,!0),pe&256){Te.ctx.deactivate(ot);return}const gt=pe&1&&tt,ze=!qN(ot);let Ot;if(ze&&(Ot=ae&&ae.onVnodeBeforeUnmount)&&E_(Ot,Te,ot),pe&6)Ze(ot.component,je,pt);else{if(pe&128){ot.suspense.unmount(je,pt);return}gt&&$T(ot,null,Te,"beforeUnmount"),pe&64?ot.type.remove(ot,Te,je,kt,Ct,pt):Ne&&(ct!==po||Ae>0&&Ae&64)?mt(Ne,Te,je,!1,!0):(ct===po&&Ae&384||!kt&&pe&16)&&mt(wt,Te,je),pt&&qe(ot)}(ze&&(Ot=ae&&ae.onVnodeUnmounted)||gt)&&sy(()=>{Ot&&E_(Ot,Te,ot),gt&&$T(ot,null,Te,"unmounted")},je)},qe=ot=>{const{type:Te,el:je,anchor:pt,transition:kt}=ot;if(Te===po){et(je,pt);return}if(Te===XM){V(ot);return}const ct=()=>{n(je),kt&&!kt.persisted&&kt.afterLeave&&kt.afterLeave()};if(ot.shapeFlag&1&&kt&&!kt.persisted){const{leave:ae,delayLeave:ht}=kt,wt=()=>ae(je,ct);ht?ht(ot.el,ct,wt):wt()}else ct()},et=(ot,Te)=>{let je;for(;ot!==Te;)je=y(ot),n(ot),ot=je;n(Te)},Ze=(ot,Te,je)=>{const{bum:pt,scope:kt,update:ct,subTree:ae,um:ht}=ot;pt&&$V(pt),kt.stop(),ct&&(ct.active=!1,Be(ae,ot,Te,je)),ht&&sy(ht,Te),sy(()=>{ot.isUnmounted=!0},Te),Te&&Te.pendingBranch&&!Te.isUnmounted&&ot.asyncDep&&!ot.asyncResolved&&ot.suspenseId===Te.pendingId&&(Te.deps--,Te.deps===0&&Te.resolve())},mt=(ot,Te,je,pt=!1,kt=!1,ct=0)=>{for(let ae=ct;aeot.shapeFlag&6?Pt(ot.component.subTree):ot.shapeFlag&128?ot.suspense.next():y(ot.anchor||ot.el),$t=(ot,Te,je)=>{ot==null?Te._vnode&&Be(Te._vnode,null,null,!0):I(Te._vnode||null,ot,Te,null,null,null,je),oot(),que(),Te._vnode=ot},Ct={p:I,um:Be,m:Ge,r:qe,mt:ke,mc:ie,pc:Ie,pbc:he,n:Pt,o:t};let Et,Ft;return e&&([Et,Ft]=e(Ct)),{render:$t,hydrate:Et,createApp:Rgi($t,Et)}}function KN({effect:t,update:e},i){t.allowRecurse=e.allowRecurse=i}function CPe(t,e,i=!1){const r=t.children,n=e.children;if(xs(r)&&xs(n))for(let s=0;s>1,t[i[a]]0&&(e[r]=i[s-1]),i[s]=r)}}for(s=i.length,o=i[s-1];s-- >0;)i[s]=o,o=e[o];return i}const Bgi=t=>t.__isTeleport,XX=t=>t&&(t.disabled||t.disabled===""),nat=t=>typeof SVGElement<"u"&&t instanceof SVGElement,TPe=(t,e)=>{const i=t&&t.to;return gl(i)?e?e(i):null:i},Vgi={__isTeleport:!0,process(t,e,i,r,n,s,o,a,l,c){const{mc:h,pc:p,pbc:y,o:{insert:v,querySelector:x,createText:I,createComment:P}}=c,F=XX(e.props);let{shapeFlag:k,children:j,dynamicChildren:V}=e;if(t==null){const Y=e.el=I(""),X=e.anchor=I("");v(Y,i,r),v(X,i,r);const Z=e.target=TPe(e.props,x),ie=e.targetAnchor=I("");Z&&(v(ie,Z),o=o||nat(Z));const ce=(he,_e)=>{k&16&&h(j,he,_e,n,s,o,a,l)};F?ce(i,X):Z&&ce(Z,ie)}else{e.el=t.el;const Y=e.anchor=t.anchor,X=e.target=t.target,Z=e.targetAnchor=t.targetAnchor,ie=XX(t.props),ce=ie?i:X,he=ie?Y:Z;if(o=o||nat(X),V?(y(t.dynamicChildren,V,ce,n,s,o,a),CPe(t,e,!0)):l||p(t,e,ce,he,n,s,o,a,!1),F)ie||uce(e,i,Y,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const _e=e.target=TPe(e.props,x);_e&&uce(e,_e,null,c,0)}else ie&&uce(e,X,Z,c,1)}sat(e)},remove(t,e,i,r,{um:n,o:{remove:s}},o){const{shapeFlag:a,children:l,anchor:c,targetAnchor:h,target:p,props:y}=t;if(p&&s(h),(o||!XX(y))&&(s(c),a&16))for(let v=0;v0?T_||FV:null,oat(),JN>0&&T_&&T_.push(t),t}function hi(t,e,i,r,n,s){return aat(Dt(t,e,i,r,n,s,!0))}function Bn(t,e,i,r,n){return aat(Un(t,e,i,r,n,!0))}function BT(t){return t?t.__v_isVNode===!0:!1}function W2(t,e){return t.type===e.type&&t.key===e.key}function lat(t){}const hce="__vInternal",uat=({key:t})=>t??null,dce=({ref:t,ref_key:e,ref_for:i})=>(typeof t=="number"&&(t=""+t),t!=null?gl(t)||Ic(t)||Fa(t)?{i:fg,r:t,k:e,f:!!i}:t:null);function Dt(t,e=null,i=null,r=0,n=null,s=t===po?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&uat(e),ref:e&&dce(e),scopeId:Kue,slotScopeIds:null,children:i,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:fg};return a?(APe(l,i),s&128&&t.normalize(l)):i&&(l.shapeFlag|=gl(i)?8:16),JN>0&&!o&&T_&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&T_.push(l),l}const Un=Ggi;function Ggi(t,e=null,i=null,r=0,n=null,s=!1){if((!t||t===xot)&&(t=oy),BT(t)){const a=q2(t,e,!0);return i&&APe(a,i),JN>0&&!s&&T_&&(a.shapeFlag&6?T_[T_.indexOf(t)]=a:T_.push(a)),a.patchFlag|=-2,a}if(qgi(t)&&(t=t.__vccOpts),e){e=IPe(e);let{class:a,style:l}=e;a&&!gl(a)&&(e.class=ms(a)),Qc(l)&&(jue(l)&&!xs(l)&&(l=Lu({},l)),e.style=nb(l))}const o=gl(t)?1:hot(t)?128:Bgi(t)?64:Qc(t)?4:Fa(t)?2:0;return Dt(t,e,i,r,n,o,s,!0)}function IPe(t){return t?jue(t)||hce in t?Lu({},t):t:null}function q2(t,e,i=!1){const{props:r,ref:n,patchFlag:s,children:o}=t,a=e?JX(r||{},e):r;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:a,key:a&&uat(a),ref:e&&e.ref?i&&n?xs(n)?n.concat(dce(e)):[n,dce(e)]:dce(e):n,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:o,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==po?s===-1?16:s|16:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&q2(t.ssContent),ssFallback:t.ssFallback&&q2(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce}}function ks(t=" ",e=0){return Un(EP,null,t,e)}function pce(t,e){const i=Un(XM,null,t);return i.staticCount=e,i}function fn(t="",e=!1){return e?(Qt(),Bn(oy,null,t)):Un(oy,null,t)}function ob(t){return t==null||typeof t=="boolean"?Un(oy):xs(t)?Un(po,null,t.slice()):typeof t=="object"?KM(t):Un(EP,null,String(t))}function KM(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:q2(t)}function APe(t,e){let i=0;const{shapeFlag:r}=t;if(e==null)e=null;else if(xs(e))i=16;else if(typeof e=="object")if(r&65){const n=e.default;n&&(n._c&&(n._d=!1),APe(t,n()),n._c&&(n._d=!0));return}else{i=32;const n=e._;!n&&!(hce in e)?e._ctx=fg:n===3&&fg&&(fg.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else Fa(e)?(e={default:e,_ctx:fg},i=32):(e=String(e),r&64?(i=16,e=[ks(e)]):i=8);t.children=e,t.shapeFlag|=i}function JX(...t){const e={};for(let i=0;iKf||fg;let PPe,HV,hat="__VUE_INSTANCE_SETTERS__";(HV=BAe()[hat])||(HV=BAe()[hat]=[]),HV.push(t=>Kf=t),PPe=t=>{HV.length>1?HV.forEach(e=>e(t)):HV[0](t)};const JM=t=>{PPe(t),t.scope.on()},ZM=()=>{Kf&&Kf.scope.off(),PPe(null)};function dat(t){return t.vnode.shapeFlag&4}let WV=!1;function pat(t,e=!1){WV=e;const{props:i,children:r}=t.vnode,n=dat(t);Mgi(t,i,n,e),Lgi(t,r);const s=n?Hgi(t,e):void 0;return WV=!1,s}function Hgi(t,e){const i=t.type;t.accessCache=Object.create(null),t.proxy=ya(new Proxy(t.ctx,gPe));const{setup:r}=i;if(r){const n=t.setupContext=r.length>1?gat(t):null;JM(t),VV();const s=NT(r,t,0,[t.props,n]);if(jV(),ZM(),kAe(s)){if(s.then(ZM,ZM),e)return s.then(o=>{OPe(t,o,e)}).catch(o=>{WM(o,t,0)});t.asyncDep=s}else OPe(t,s,e)}else mat(t,e)}function OPe(t,e,i){Fa(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Qc(e)&&(t.setupState=Uue(e)),mat(t,i)}let fce,RPe;function MPe(t){fce=t,RPe=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,Cgi))}}const fat=()=>!fce;function mat(t,e,i){const r=t.type;if(!t.render){if(!e&&fce&&!r.render){const n=r.template||vPe(t).template;if(n){const{isCustomElement:s,compilerOptions:o}=t.appContext.config,{delimiters:a,compilerOptions:l}=r,c=Lu(Lu({isCustomElement:s,delimiters:a},o),l);r.render=fce(n,c)}}t.render=r.render||gv,RPe&&RPe(t)}JM(t),VV(),Tgi(t),jV(),ZM()}function Wgi(t){return t.attrsProxy||(t.attrsProxy=new Proxy(t.attrs,{get(e,i){return x_(t,"get","$attrs"),e[i]}}))}function gat(t){const e=i=>{t.exposed=i||{}};return{get attrs(){return Wgi(t)},slots:t.slots,emit:t.emit,expose:e}}function mce(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy(Uue(ya(t.exposed)),{get(e,i){if(i in e)return e[i];if(i in HX)return HX[i](t)},has(e,i){return i in e||i in HX}}))}function DPe(t,e=!0){return Fa(t)?t.displayName||t.name:t.name||e&&t.__name}function qgi(t){return Fa(t)&&"__vccOpts"in t}const Jr=(t,e)=>ogi(t,e,WV);function Y2(t,e,i){const r=arguments.length;return r===2?Qc(e)&&!xs(e)?BT(e)?Un(t,null,[e]):Un(t,e):Un(t,null,e):(r>3?i=Array.prototype.slice.call(arguments,2):r===3&&BT(i)&&(i=[i]),Un(t,e,i))}const FPe=Symbol.for("v-scx"),LPe=()=>no(FPe);function yat(){}function vat(t,e,i,r){const n=i[r];if(n&&gce(n,t))return n;const s=e();return s.memo=t.slice(),i[r]=s}function gce(t,e){const i=t.memo;if(i.length!=e.length)return!1;for(let r=0;r0&&T_&&T_.push(t),!0}const NPe="3.3.4",_at={createComponentInstance:cat,setupComponent:pat,renderComponentRoot:Jue,setCurrentRenderingInstance:$X,isVNode:BT,normalizeVNode:ob},bat=null,wat=null,Ygi="http://www.w3.org/2000/svg",ZN=typeof document<"u"?document:null,xat=ZN&&ZN.createElement("template"),Xgi={insert:(t,e,i)=>{e.insertBefore(t,i||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,i,r)=>{const n=e?ZN.createElementNS(Ygi,t):ZN.createElement(t,i?{is:i}:void 0);return t==="select"&&r&&r.multiple!=null&&n.setAttribute("multiple",r.multiple),n},createText:t=>ZN.createTextNode(t),createComment:t=>ZN.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>ZN.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,i,r,n,s){const o=i?i.previousSibling:e.lastChild;if(n&&(n===s||n.nextSibling))for(;e.insertBefore(n.cloneNode(!0),i),!(n===s||!(n=n.nextSibling)););else{xat.innerHTML=r?`${t}`:t;const a=xat.content;if(r){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,i)}return[o?o.nextSibling:e.firstChild,i?i.previousSibling:e.lastChild]}};function Kgi(t,e,i){const r=t._vtc;r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):i?t.setAttribute("class",e):t.className=e}function Jgi(t,e,i){const r=t.style,n=gl(i);if(i&&!n){if(e&&!gl(e))for(const s in e)i[s]==null&&kPe(r,s,"");for(const s in i)kPe(r,s,i[s])}else{const s=r.display;n?e!==i&&(r.cssText=i):e&&t.removeAttribute("style"),"_vod"in t&&(r.display=s)}}const Sat=/\s*!important$/;function kPe(t,e,i){if(xs(i))i.forEach(r=>kPe(t,e,r));else if(i==null&&(i=""),e.startsWith("--"))t.setProperty(e,i);else{const r=Zgi(t,e);Sat.test(i)?t.setProperty(rb(r),i.replace(Sat,""),"important"):t[r]=i}}const Cat=["Webkit","Moz","ms"],$Pe={};function Zgi(t,e){const i=$Pe[e];if(i)return i;let r=yf(e);if(r!=="filter"&&r in t)return $Pe[e]=r;r=VM(r);for(let n=0;nBPe||(nyi.then(()=>BPe=0),BPe=Date.now());function oyi(t,e){const i=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=i.attached)return;S_(ayi(r,i.value),e,5,[r])};return i.value=t,i.attached=syi(),i}function ayi(t,e){if(xs(e)){const i=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{i.call(t),t._stopped=!0},e.map(r=>n=>!n._stopped&&r&&r(n))}else return e}const Iat=/^on[a-z]/,lyi=(t,e,i,r,n=!1,s,o,a,l)=>{e==="class"?Kgi(t,r,n):e==="style"?Jgi(t,i,r):kN(e)?LAe(e)||iyi(t,e,i,r,o):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):uyi(t,e,r,n))?eyi(t,e,r,s,o,a,l):(e==="true-value"?t._trueValue=r:e==="false-value"&&(t._falseValue=r),Qgi(t,e,r,n))};function uyi(t,e,i,r){return r?!!(e==="innerHTML"||e==="textContent"||e in t&&Iat.test(e)&&Fa(i)):e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA"||Iat.test(e)&&gl(i)?!1:e in t}function VPe(t,e){const i=an(t);class r extends ZX{constructor(s){super(i,s,e)}}return r.def=i,r}const Aat=t=>VPe(t,HPe),cyi=typeof HTMLElement<"u"?HTMLElement:class{};class ZX extends cyi{constructor(e,i={},r){super(),this._def=e,this._props=i,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,v0(()=>{this._connected||(K2(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&&!xs(s))for(const l in s){const c=s[l];(c===Number||c&&c.type===Number)&&(l in this._props&&(this._props[l]=Eue(this._props[l])),(a||(a=Object.create(null)))[yf(l)]=!0)}this._numberProps=a,n&&this._resolveProps(r),this._applyStyles(o),this._update()},i=this._def.__asyncLoader;i?i().then(r=>e(r,!0)):e(this._def)}_resolveProps(e){const{props:i}=e,r=xs(i)?i:Object.keys(i||{});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(yf))Object.defineProperty(this,n,{get(){return this._getProp(n)},set(s){this._setProp(n,s)}})}_setAttr(e){let i=this.getAttribute(e);const r=yf(e);this._numberProps&&this._numberProps[r]&&(i=Eue(i)),this._setProp(r,i,!1)}_getProp(e){return this._props[e]}_setProp(e,i,r=!0,n=!0){i!==this._props[e]&&(this._props[e]=i,n&&this._instance&&this._update(),r&&(i===!0?this.setAttribute(rb(e),""):typeof i=="string"||typeof i=="number"?this.setAttribute(rb(e),i+""):i||this.removeAttribute(rb(e))))}_update(){K2(this._createVNode(),this.shadowRoot)}_createVNode(){const e=Un(this._def,Lu({},this._props));return this._instance||(e.ce=i=>{this._instance=i,i.isCE=!0;const r=(s,o)=>{this.dispatchEvent(new CustomEvent(s,{detail:o}))};i.emit=(s,...o)=>{r(s,o),rb(s)!==s&&r(rb(s),o)};let n=this;for(;n=n&&(n.parentNode||n.host);)if(n instanceof ZX){i.parent=n._instance,i.provides=n._instance.provides;break}}),e}_applyStyles(e){e&&e.forEach(i=>{const r=document.createElement("style");r.textContent=i,this.shadowRoot.appendChild(r)})}}function Pat(t="$style"){{const e=Up();if(!e)return Zc;const i=e.type.__cssModules;if(!i)return Zc;const r=i[t];return r||Zc}}function Oat(t){const e=Up();if(!e)return;const i=e.ut=(n=t(e.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(s=>GPe(s,n))},r=()=>{const n=t(e.proxy);jPe(e.subTree,n),i(n)};tPe(r),Ja(()=>{const n=new MutationObserver(r);n.observe(e.subTree.el.parentNode,{childList:!0}),XN(()=>n.disconnect())})}function jPe(t,e){if(t.shapeFlag&128){const i=t.suspense;t=i.activeBranch,i.pendingBranch&&!i.isHydrating&&i.effects.push(()=>{jPe(i.activeBranch,e)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)GPe(t.el,e);else if(t.type===po)t.children.forEach(i=>jPe(i,e));else if(t.type===XM){let{el:i,anchor:r}=t;for(;i&&(GPe(i,e),i!==r);)i=i.nextSibling}}function GPe(t,e){if(t.nodeType===1){const i=t.style;for(const r in e)i.setProperty(`--${r}`,e[r])}}const QM="transition",QX="animation",eD=(t,{slots:e})=>Y2(iPe,Dat(t),e);eD.displayName="Transition";const Rat={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},hyi=eD.props=Lu({},ece,Rat),QN=(t,e=[])=>{xs(t)?t.forEach(i=>i(...e)):t&&t(...e)},Mat=t=>t?xs(t)?t.some(e=>e.length>1):t.length>1:!1;function Dat(t){const e={};for(const xe in t)xe in Rat||(e[xe]=t[xe]);if(t.css===!1)return e;const{name:i="v",type:r,duration:n,enterFromClass:s=`${i}-enter-from`,enterActiveClass:o=`${i}-enter-active`,enterToClass:a=`${i}-enter-to`,appearFromClass:l=s,appearActiveClass:c=o,appearToClass:h=a,leaveFromClass:p=`${i}-leave-from`,leaveActiveClass:y=`${i}-leave-active`,leaveToClass:v=`${i}-leave-to`}=t,x=dyi(n),I=x&&x[0],P=x&&x[1],{onBeforeEnter:F,onEnter:k,onEnterCancelled:j,onLeave:V,onLeaveCancelled:Y,onBeforeAppear:X=F,onAppear:Z=k,onAppearCancelled:ie=j}=e,ce=(xe,Pe,ke)=>{tD(xe,Pe?h:a),tD(xe,Pe?c:o),ke&&ke()},he=(xe,Pe)=>{xe._isLeaving=!1,tD(xe,p),tD(xe,v),tD(xe,y),Pe&&Pe()},_e=xe=>(Pe,ke)=>{const J=xe?Z:k,de=()=>ce(Pe,xe,ke);QN(J,[Pe,de]),Fat(()=>{tD(Pe,xe?l:s),AP(Pe,xe?h:a),Mat(J)||Lat(Pe,r,I,de)})};return Lu(e,{onBeforeEnter(xe){QN(F,[xe]),AP(xe,s),AP(xe,o)},onBeforeAppear(xe){QN(X,[xe]),AP(xe,l),AP(xe,c)},onEnter:_e(!1),onAppear:_e(!0),onLeave(xe,Pe){xe._isLeaving=!0;const ke=()=>he(xe,Pe);AP(xe,p),Bat(),AP(xe,y),Fat(()=>{xe._isLeaving&&(tD(xe,p),AP(xe,v),Mat(V)||Lat(xe,r,P,ke))}),QN(V,[xe,ke])},onEnterCancelled(xe){ce(xe,!1),QN(j,[xe])},onAppearCancelled(xe){ce(xe,!0),QN(ie,[xe])},onLeaveCancelled(xe){he(xe),QN(Y,[xe])}})}function dyi(t){if(t==null)return null;if(Qc(t))return[UPe(t.enter),UPe(t.leave)];{const e=UPe(t);return[e,e]}}function UPe(t){return Eue(t)}function AP(t,e){e.split(/\s+/).forEach(i=>i&&t.classList.add(i)),(t._vtc||(t._vtc=new Set)).add(e)}function tD(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.remove(r));const{_vtc:i}=t;i&&(i.delete(e),i.size||(t._vtc=void 0))}function Fat(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let pyi=0;function Lat(t,e,i,r){const n=t._endId=++pyi,s=()=>{n===t._endId&&r()};if(i)return setTimeout(s,i);const{type:o,timeout:a,propCount:l}=Nat(t,e);if(!o)return r();const c=o+"end";let h=0;const p=()=>{t.removeEventListener(c,y),s()},y=v=>{v.target===t&&++h>=l&&p()};setTimeout(()=>{h(i[x]||"").split(", "),n=r(`${QM}Delay`),s=r(`${QM}Duration`),o=kat(n,s),a=r(`${QX}Delay`),l=r(`${QX}Duration`),c=kat(a,l);let h=null,p=0,y=0;e===QM?o>0&&(h=QM,p=o,y=s.length):e===QX?c>0&&(h=QX,p=c,y=l.length):(p=Math.max(o,c),h=p>0?o>c?QM:QX:null,y=h?h===QM?s.length:l.length:0);const v=h===QM&&/\b(transform|all)(,|$)/.test(r(`${QM}Property`).toString());return{type:h,timeout:p,propCount:y,hasTransform:v}}function kat(t,e){for(;t.length$at(i)+$at(t[r])))}function $at(t){return Number(t.slice(0,-1).replace(",","."))*1e3}function Bat(){return document.body.offsetHeight}const Vat=new WeakMap,jat=new WeakMap,Gat={name:"TransitionGroup",props:Lu({},hyi,{tag:String,moveClass:String}),setup(t,{slots:e}){const i=Up(),r=Que();let n,s;return YN(()=>{if(!n.length)return;const o=t.moveClass||`${t.name||"v"}-move`;if(!vyi(n[0].el,i.vnode.el,o))return;n.forEach(myi),n.forEach(gyi);const a=n.filter(yyi);Bat(),a.forEach(l=>{const c=l.el,h=c.style;AP(c,o),h.transform=h.webkitTransform=h.transitionDuration="";const p=c._moveCb=y=>{y&&y.target!==c||(!y||/transform$/.test(y.propertyName))&&(c.removeEventListener("transitionend",p),c._moveCb=null,tD(c,o))};c.addEventListener("transitionend",p)})}),()=>{const o=Qs(t),a=Dat(o);let l=o.tag||po;n=s,s=e.default?jX(e.default()):[];for(let c=0;cdelete t.mode;Gat.props;const yce=Gat;function myi(t){const e=t.el;e._moveCb&&e._moveCb(),e._enterCb&&e._enterCb()}function gyi(t){jat.set(t,t.el.getBoundingClientRect())}function yyi(t){const e=Vat.get(t),i=jat.get(t),r=e.left-i.left,n=e.top-i.top;if(r||n){const s=t.el.style;return s.transform=s.webkitTransform=`translate(${r}px,${n}px)`,s.transitionDuration="0s",t}}function vyi(t,e,i){const r=t.cloneNode();t._vtc&&t._vtc.forEach(o=>{o.split(/\s+/).forEach(a=>a&&r.classList.remove(a))}),i.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}=Nat(r);return n.removeChild(r),s}const iD=t=>{const e=t.props["onUpdate:modelValue"]||!1;return xs(e)?i=>$V(e,i):e};function _yi(t){t.target.composing=!0}function Uat(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const X2={created(t,{modifiers:{lazy:e,trim:i,number:r}},n){t._assign=iD(n);const s=r||n.props&&n.props.type==="number";IP(t,e?"change":"input",o=>{if(o.target.composing)return;let a=t.value;i&&(a=a.trim()),s&&(a=Tue(a)),t._assign(a)}),i&&IP(t,"change",()=>{t.value=t.value.trim()}),e||(IP(t,"compositionstart",_yi),IP(t,"compositionend",Uat),IP(t,"change",Uat))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,modifiers:{lazy:i,trim:r,number:n}},s){if(t._assign=iD(s),t.composing||document.activeElement===t&&t.type!=="range"&&(i||r&&t.value.trim()===e||(n||t.type==="number")&&Tue(t.value)===e))return;const o=e??"";t.value!==o&&(t.value=o)}},vce={deep:!0,created(t,e,i){t._assign=iD(i),IP(t,"change",()=>{const r=t._modelValue,n=qV(t),s=t.checked,o=t._assign;if(xs(r)){const a=Iue(r,n),l=a!==-1;if(s&&!l)o(r.concat(n));else if(!s&&l){const c=[...r];c.splice(a,1),o(c)}}else if($N(r)){const a=new Set(r);s?a.add(n):a.delete(n),o(a)}else o(Wat(t,s))})},mounted:zat,beforeUpdate(t,e,i){t._assign=iD(i),zat(t,e,i)}};function zat(t,{value:e,oldValue:i},r){t._modelValue=e,xs(e)?t.checked=Iue(e,r.props.value)>-1:$N(e)?t.checked=e.has(r.props.value):e!==i&&(t.checked=jM(e,Wat(t,!0)))}const _ce={created(t,{value:e},i){t.checked=jM(e,i.props.value),t._assign=iD(i),IP(t,"change",()=>{t._assign(qV(t))})},beforeUpdate(t,{value:e,oldValue:i},r){t._assign=iD(r),e!==i&&(t.checked=jM(e,r.props.value))}},bce={deep:!0,created(t,{value:e,modifiers:{number:i}},r){const n=$N(e);IP(t,"change",()=>{const s=Array.prototype.filter.call(t.options,o=>o.selected).map(o=>i?Tue(qV(o)):qV(o));t._assign(t.multiple?n?new Set(s):s:s[0])}),t._assign=iD(r)},mounted(t,{value:e}){Hat(t,e)},beforeUpdate(t,e,i){t._assign=iD(i)},updated(t,{value:e}){Hat(t,e)}};function Hat(t,e){const i=t.multiple;if(!(i&&!xs(e)&&!$N(e))){for(let r=0,n=t.options.length;r-1:s.selected=e.has(o);else if(jM(qV(s),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!i&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function qV(t){return"_value"in t?t._value:t.value}function Wat(t,e){const i=e?"_trueValue":"_falseValue";return i in t?t[i]:e}const zPe={created(t,e,i){wce(t,e,i,null,"created")},mounted(t,e,i){wce(t,e,i,null,"mounted")},beforeUpdate(t,e,i,r){wce(t,e,i,r,"beforeUpdate")},updated(t,e,i,r){wce(t,e,i,r,"updated")}};function qat(t,e){switch(t){case"SELECT":return bce;case"TEXTAREA":return X2;default:switch(e){case"checkbox":return vce;case"radio":return _ce;default:return X2}}}function wce(t,e,i,r,n){const o=qat(t.tagName,i.props&&i.props.type)[n];o&&o(t,e,i,r)}function byi(){X2.getSSRProps=({value:t})=>({value:t}),_ce.getSSRProps=({value:t},e)=>{if(e.props&&jM(e.props.value,t))return{checked:!0}},vce.getSSRProps=({value:t},e)=>{if(xs(t)){if(e.props&&Iue(t,e.props.value)>-1)return{checked:!0}}else if($N(t)){if(e.props&&t.has(e.props.value))return{checked:!0}}else if(t)return{checked:!0}},zPe.getSSRProps=(t,e)=>{if(typeof e.type!="string")return;const i=qat(e.type.toUpperCase(),e.props&&e.props.type);if(i.getSSRProps)return i.getSSRProps(t,e)}}const wyi=["ctrl","shift","alt","meta"],xyi={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>wyi.some(i=>t[`${i}Key`]&&!e.includes(i))},wa=(t,e)=>(i,...r)=>{for(let n=0;ni=>{if(!("key"in i))return;const r=rb(i.key);if(e.some(n=>n===r||Syi[n]===r))return t(i)},vf={beforeMount(t,{value:e},{transition:i}){t._vod=t.style.display==="none"?"":t.style.display,i&&e?i.beforeEnter(t):eK(t,e)},mounted(t,{value:e},{transition:i}){i&&e&&i.enter(t)},updated(t,{value:e,oldValue:i},{transition:r}){!e!=!i&&(r?e?(r.beforeEnter(t),eK(t,!0),r.enter(t)):r.leave(t,()=>{eK(t,!1)}):eK(t,e))},beforeUnmount(t,{value:e}){eK(t,e)}};function eK(t,e){t.style.display=e?t._vod:"none"}function Cyi(){vf.getSSRProps=({value:t})=>{if(!t)return{style:{display:"none"}}}}const Yat=Lu({patchProp:lyi},Xgi);let tK,Xat=!1;function Kat(){return tK||(tK=xPe(Yat))}function Jat(){return tK=Xat?tK:SPe(Yat),Xat=!0,tK}const K2=(...t)=>{Kat().render(...t)},HPe=(...t)=>{Jat().hydrate(...t)},xce=(...t)=>{const e=Kat().createApp(...t),{mount:i}=e;return e.mount=r=>{const n=Qat(r);if(!n)return;const s=e._component;!Fa(s)&&!s.render&&!s.template&&(s.template=n.innerHTML),n.innerHTML="";const o=i(n,!1,n instanceof SVGElement);return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),o},e},Zat=(...t)=>{const e=Jat().createApp(...t),{mount:i}=e;return e.mount=r=>{const n=Qat(r);if(n)return i(n,!0,n instanceof SVGElement)},e};function Qat(t){return gl(t)?document.querySelector(t):t}let elt=!1;const tlt=()=>{elt||(elt=!0,byi(),Cyi())},Tyi=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:iPe,BaseTransitionPropsValidators:ece,Comment:oy,EffectScope:Aue,Fragment:po,KeepAlive:bot,ReactiveEffect:BV,Static:XM,Suspense:dot,Teleport:EPe,Text:EP,Transition:eD,TransitionGroup:yce,VueElement:ZX,assertNumber:rot,callWithAsyncErrorHandling:S_,callWithErrorHandling:NT,camelize:yf,capitalize:VM,cloneVNode:q2,compatUtils:wat,computed:Jr,createApp:xce,createBlock:Bn,createCommentVNode:fn,createElementBlock:hi,createElementVNode:Dt,createHydrationRenderer:SPe,createPropsRestProxy:Vot,createRenderer:xPe,createSSRApp:Zat,createSlots:Cot,createStaticVNode:pce,createTextVNode:ks,createVNode:Un,customRef:eot,defineAsyncComponent:GX,defineComponent:an,defineCustomElement:VPe,defineEmits:Aot,defineExpose:Pot,defineModel:Mot,defineOptions:Oot,defineProps:Iot,defineSSRCustomElement:Aat,defineSlots:Rot,get devtools(){return zN},effect:Mst,effectScope:DX,getCurrentInstance:Up,getCurrentScope:Pue,getTransitionRawChildren:jX,guardReactiveProps:IPe,h:Y2,handleError:WM,hasInjectionContext:qot,hydrate:HPe,initCustomFormatter:yat,initDirectivesForSSR:tlt,inject:no,isMemoSame:gce,isProxy:jue,isReactive:Rw,isReadonly:HM,isRef:Ic,isRuntimeOnly:fat,isShallow:GV,isVNode:BT,markRaw:ya,mergeDefaults:$ot,mergeModels:Bot,mergeProps:JX,nextTick:v0,normalizeClass:ms,normalizeProps:Tst,normalizeStyle:nb,onActivated:sPe,onBeforeMount:C_,onBeforeUnmount:Ll,onBeforeUpdate:ice,onDeactivated:oPe,onErrorCaptured:rce,onMounted:Ja,onRenderTracked:hPe,onRenderTriggered:cPe,onScopeDispose:VAe,onServerPrefetch:uPe,onUnmounted:XN,onUpdated:YN,openBlock:Qt,popScopeId:th,provide:sce,proxyRefs:Uue,pushScopeId:eh,queuePostFlushCb:Wue,reactive:Fl,readonly:Bue,ref:Mi,registerRuntimeCompiler:MPe,render:K2,renderList:fu,renderSlot:Xf,resolveComponent:Vo,resolveDirective:as,resolveDynamicComponent:TP,resolveFilter:bat,resolveTransitionHooks:WN,setBlockTracking:cce,setDevtoolsHook:ZAe,setTransitionHooks:qM,shallowReactive:WAe,shallowReadonly:Kst,shallowRef:XAe,ssrContextKey:FPe,ssrUtils:_at,stop:Dst,toDisplayString:xr,toHandlerKey:VN,toHandlers:Eot,toRaw:Qs,toRef:zue,toRefs:GN,toValue:Qst,transformVNodeArgs:lat,triggerRef:Zst,unref:vi,useAttrs:Lot,useCssModule:Pat,useCssVars:Oat,useModel:Not,useSSRContext:LPe,useSlots:Fot,useTransitionState:Que,vModelCheckbox:vce,vModelDynamic:zPe,vModelRadio:_ce,vModelSelect:bce,vModelText:X2,vShow:vf,version:NPe,warn:iot,watch:bu,watchEffect:mot,watchPostEffect:tPe,watchSyncEffect:got,withAsyncContext:jot,withCtx:En,withDefaults:Dot,withDirectives:Zr,withKeys:Zh,withMemo:vat,withModifiers:wa,withScopeId:uot},Symbol.toStringTag,{value:"Module"}));function WPe(t){throw t}function ilt(t){}function Wd(t,e,i,r){const n=t,s=new SyntaxError(String(n));return s.code=t,s.loc=e,s}const iK=Symbol(""),rK=Symbol(""),qPe=Symbol(""),Sce=Symbol(""),rlt=Symbol(""),ek=Symbol(""),nlt=Symbol(""),slt=Symbol(""),YPe=Symbol(""),XPe=Symbol(""),nK=Symbol(""),KPe=Symbol(""),olt=Symbol(""),JPe=Symbol(""),Cce=Symbol(""),ZPe=Symbol(""),QPe=Symbol(""),eOe=Symbol(""),tOe=Symbol(""),alt=Symbol(""),llt=Symbol(""),Tce=Symbol(""),Ece=Symbol(""),iOe=Symbol(""),rOe=Symbol(""),sK=Symbol(""),oK=Symbol(""),nOe=Symbol(""),sOe=Symbol(""),Eyi=Symbol(""),oOe=Symbol(""),Ice=Symbol(""),Iyi=Symbol(""),Ayi=Symbol(""),aOe=Symbol(""),Pyi=Symbol(""),Oyi=Symbol(""),lOe=Symbol(""),ult=Symbol(""),YV={[iK]:"Fragment",[rK]:"Teleport",[qPe]:"Suspense",[Sce]:"KeepAlive",[rlt]:"BaseTransition",[ek]:"openBlock",[nlt]:"createBlock",[slt]:"createElementBlock",[YPe]:"createVNode",[XPe]:"createElementVNode",[nK]:"createCommentVNode",[KPe]:"createTextVNode",[olt]:"createStaticVNode",[JPe]:"resolveComponent",[Cce]:"resolveDynamicComponent",[ZPe]:"resolveDirective",[QPe]:"resolveFilter",[eOe]:"withDirectives",[tOe]:"renderList",[alt]:"renderSlot",[llt]:"createSlots",[Tce]:"toDisplayString",[Ece]:"mergeProps",[iOe]:"normalizeClass",[rOe]:"normalizeStyle",[sK]:"normalizeProps",[oK]:"guardReactiveProps",[nOe]:"toHandlers",[sOe]:"camelize",[Eyi]:"capitalize",[oOe]:"toHandlerKey",[Ice]:"setBlockTracking",[Iyi]:"pushScopeId",[Ayi]:"popScopeId",[aOe]:"withCtx",[Pyi]:"unref",[Oyi]:"isRef",[lOe]:"withMemo",[ult]:"isMemoSame"};function Ryi(t){Object.getOwnPropertySymbols(t).forEach(e=>{YV[e]=t[e]})}const ab={source:"",start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}};function Myi(t,e=ab){return{type:0,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:0,temps:0,codegenNode:void 0,loc:e}}function aK(t,e,i,r,n,s,o,a=!1,l=!1,c=!1,h=ab){return t&&(a?(t.helper(ek),t.helper(JV(t.inSSR,c))):t.helper(KV(t.inSSR,c)),o&&t.helper(eOe)),{type:13,tag:e,props:i,children:r,patchFlag:n,dynamicProps:s,directives:o,isBlock:a,disableTracking:l,isComponent:c,loc:h}}function lK(t,e=ab){return{type:17,loc:e,elements:t}}function Dw(t,e=ab){return{type:15,loc:e,properties:t}}function zp(t,e){return{type:16,loc:ab,key:gl(t)?Wl(t,!0):t,value:e}}function Wl(t,e=!1,i=ab,r=0){return{type:4,loc:i,content:t,isStatic:e,constType:e?3:r}}function J2(t,e=ab){return{type:8,loc:e,children:t}}function Jf(t,e=[],i=ab){return{type:14,loc:i,callee:t,arguments:e}}function XV(t,e=void 0,i=!1,r=!1,n=ab){return{type:18,params:t,returns:e,newline:i,isSlot:r,loc:n}}function uOe(t,e,i,r=!0){return{type:19,test:t,consequent:e,alternate:i,newline:r,loc:ab}}function Dyi(t,e,i=!1){return{type:20,index:t,value:e,isVNode:i,loc:ab}}function Fyi(t){return{type:21,body:t,loc:ab}}function KV(t,e){return t||e?YPe:XPe}function JV(t,e){return t||e?nlt:slt}function cOe(t,{helper:e,removeHelper:i,inSSR:r}){t.isBlock||(t.isBlock=!0,i(KV(r,t.isComponent)),e(ek),e(JV(r,t.isComponent)))}const I_=t=>t.type===4&&t.isStatic,ZV=(t,e)=>t===e||t===rb(e);function clt(t){if(ZV(t,"Teleport"))return rK;if(ZV(t,"Suspense"))return qPe;if(ZV(t,"KeepAlive"))return Sce;if(ZV(t,"BaseTransition"))return rlt}const Lyi=/^\d|[^\$\w]/,hOe=t=>!Lyi.test(t),Nyi=/[A-Za-z_$\xA0-\uFFFF]/,kyi=/[\.\?\w$\xA0-\uFFFF]/,$yi=/\s+[.[]\s*|\s*[.[]\s+/g,hlt=t=>{t=t.trim().replace($yi,o=>o.trim());let e=0,i=[],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 dOe(t){return t.type===5||t.type===2}function Vyi(t){return t.type===7&&t.name==="slot"}function Rce(t){return t.type===1&&t.tagType===3}function Mce(t){return t.type===1&&t.tagType===2}const jyi=new Set([sK,oK]);function plt(t,e=[]){if(t&&!gl(t)&&t.type===14){const i=t.callee;if(!gl(i)&&jyi.has(i))return plt(t.arguments[0],e.concat(t))}return[t,e]}function Dce(t,e,i){let r,n=t.type===13?t.props:t.arguments[2],s=[],o;if(n&&!gl(n)&&n.type===14){const a=plt(n);n=a[0],s=a[1],o=s[s.length-1]}if(n==null||gl(n))r=Dw([e]);else if(n.type===14){const a=n.arguments[0];!gl(a)&&a.type===15?flt(e,a)||a.properties.unshift(e):n.callee===nOe?r=Jf(i.helper(Ece),[Dw([e]),n]):n.arguments.unshift(Dw([e])),!r&&(r=n)}else n.type===15?(flt(e,n)||n.properties.unshift(e),r=n):(r=Jf(i.helper(Ece),[Dw([e]),n]),o&&o.callee===oK&&(o=s[s.length-2]));t.type===13?o?o.arguments[0]=r:t.props=r:o?o.arguments[0]=r:t.arguments[2]=r}function flt(t,e){let i=!1;if(t.key.type===4){const r=t.key.content;i=e.properties.some(n=>n.key.type===4&&n.key.content===r)}return i}function uK(t,e){return`_${e}_${t.replace(/[^\w]/g,(i,r)=>i==="-"?"_":t.charCodeAt(r).toString())}`}function Gyi(t){return t.type===14&&t.callee===lOe?t.arguments[1].returns:t}function mlt(t,e){const i=e.options?e.options.compatConfig:e.compatConfig,r=i&&i[t];return t==="MODE"?r||3:r}function ik(t,e){const i=mlt("MODE",e),r=mlt(t,e);return i===3?r===!0:r!==!1}function cK(t,e,i,...r){return ik(t,e)}const Uyi=/&(gt|lt|amp|apos|quot);/g,zyi={gt:">",lt:"<",amp:"&",apos:"'",quot:'"'},glt={delimiters:["{{","}}"],getNamespace:()=>0,getTextMode:()=>0,isVoidTag:xue,isPreTag:xue,isCustomElement:xue,decodeEntities:t=>t.replace(Uyi,(e,i)=>zyi[i]),onError:WPe,onWarn:ilt,comments:!1};function Hyi(t,e={}){const i=Wyi(t,e),r=lb(i);return Myi(pOe(i,0,[]),Lw(i,r))}function Wyi(t,e){const i=Lu({},glt);let r;for(r in e)i[r]=e[r]===void 0?glt[r]:e[r];return{options:i,column:1,line:1,offset:0,originalSource:t,source:t,inPre:!1,inVPre:!1,onWarn:i.onWarn}}function pOe(t,e,i){const r=Lce(i),n=r?r.ns:0,s=[];for(;!t0i(t,e,i);){const a=t.source;let l;if(e===0||e===1){if(!t.inVPre&&_0(a,t.options.delimiters[0]))l=Qyi(t,e);else if(e===0&&a[0]==="<")if(a.length===1)ih(t,5,1);else if(a[1]==="!")_0(a,"=0;){const c=o[a];c&&c.type===9&&(l+=c.branches.length)}return()=>{if(s)r.codegenNode=Mlt(n,l,i);else{const c=T0i(r.codegenNode);c.alternate=Mlt(n,l+r.branches.length-1,i)}}}));function C0i(t,e,i,r){if(e.name!=="else"&&(!e.exp||!e.exp.content.trim())){const n=e.exp?e.exp.loc:t.loc;i.onError(Wd(28,e.loc)),e.exp=Wl("true",!1,n)}if(e.name==="if"){const n=Rlt(t,e),s={type:9,loc:t.loc,branches:[n]};if(i.replaceNode(s),r)return r(s,n,!0)}else{const n=i.parent.children;let s=n.indexOf(t);for(;s-->=-1;){const o=n[s];if(o&&o.type===3){i.removeNode(o);continue}if(o&&o.type===2&&!o.content.trim().length){i.removeNode(o);continue}if(o&&o.type===9){e.name==="else-if"&&o.branches[o.branches.length-1].condition===void 0&&i.onError(Wd(30,t.loc)),i.removeNode();const a=Rlt(t,e);o.branches.push(a);const l=r&&r(o,a,!1);kce(a,i),l&&l(),i.currentNode=null}else i.onError(Wd(30,t.loc));break}}}function Rlt(t,e){const i=t.tagType===3;return{type:10,loc:t.loc,condition:e.name==="else"?void 0:e.exp,children:i&&!Fw(t,"for")?t.children:[t],userKey:Oce(t,"key"),isTemplateIf:i}}function Mlt(t,e,i){return t.condition?uOe(t.condition,Dlt(t,e,i),Jf(i.helper(nK),['""',"true"])):Dlt(t,e,i)}function Dlt(t,e,i){const{helper:r}=i,n=zp("key",Wl(`${e}`,!1,ab,2)),{children:s}=t,o=s[0];if(s.length!==1||o.type!==1)if(s.length===1&&o.type===11){const l=o.codegenNode;return Dce(l,n,i),l}else{let l=64;return aK(i,r(iK),Dw([n]),s,l+"",void 0,void 0,!0,!1,!1,t.loc)}else{const l=o.codegenNode,c=Gyi(l);return c.type===13&&cOe(c,i),Dce(c,n,i),l}}function T0i(t){for(;;)if(t.type===19)if(t.alternate.type===19)t=t.alternate;else return t;else t.type===20&&(t=t.value)}const E0i=Elt("for",(t,e,i)=>{const{helper:r,removeHelper:n}=i;return I0i(t,e,i,s=>{const o=Jf(r(tOe),[s.source]),a=Rce(t),l=Fw(t,"memo"),c=Oce(t,"key"),h=c&&(c.type===6?Wl(c.value.content,!0):c.exp),p=c?zp("key",h):null,y=s.source.type===4&&s.source.constType>0,v=y?64:c?128:256;return s.codegenNode=aK(i,r(iK),void 0,o,v+"",void 0,void 0,!0,!y,!1,t.loc),()=>{let x;const{children:I}=s,P=I.length!==1||I[0].type!==1,F=Mce(t)?t:a&&t.children.length===1&&Mce(t.children[0])?t.children[0]:null;if(F?(x=F.codegenNode,a&&p&&Dce(x,p,i)):P?x=aK(i,r(iK),p?Dw([p]):void 0,t.children,"64",void 0,void 0,!0,void 0,!1):(x=I[0].codegenNode,a&&p&&Dce(x,p,i),x.isBlock!==!y&&(x.isBlock?(n(ek),n(JV(i.inSSR,x.isComponent))):n(KV(i.inSSR,x.isComponent))),x.isBlock=!y,x.isBlock?(r(ek),r(JV(i.inSSR,x.isComponent))):r(KV(i.inSSR,x.isComponent))),l){const k=XV(vOe(s.parseResult,[Wl("_cached")]));k.body=Fyi([J2(["const _memo = (",l.exp,")"]),J2(["if (_cached",...h?[" && _cached.key === ",h]:[],` && ${i.helperString(ult)}(_cached, _memo)) return _cached`]),J2(["const _item = ",x]),Wl("_item.memo = _memo"),Wl("return _item")]),o.arguments.push(k,Wl("_cache"),Wl(String(i.cached++)))}else o.arguments.push(XV(vOe(s.parseResult),x,!0))}})});function I0i(t,e,i,r){if(!e.exp){i.onError(Wd(31,e.loc));return}const n=Llt(e.exp);if(!n){i.onError(Wd(32,e.loc));return}const{addIdentifiers:s,removeIdentifiers:o,scopes:a}=i,{source:l,value:c,key:h,index:p}=n,y={type:11,loc:e.loc,source:l,valueAlias:c,keyAlias:h,objectIndexAlias:p,parseResult:n,children:Rce(t)?t.children:[t]};i.replaceNode(y),a.vFor++;const v=r&&r(y);return()=>{a.vFor--,v&&v()}}const A0i=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Flt=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,P0i=/^\(|\)$/g;function Llt(t,e){const i=t.loc,r=t.content,n=r.match(A0i);if(!n)return;const[,s,o]=n,a={source:Bce(i,o.trim(),r.indexOf(o,s.length)),value:void 0,key:void 0,index:void 0};let l=s.trim().replace(P0i,"").trim();const c=s.indexOf(l),h=l.match(Flt);if(h){l=l.replace(Flt,"").trim();const p=h[1].trim();let y;if(p&&(y=r.indexOf(p,c+l.length),a.key=Bce(i,p,y)),h[2]){const v=h[2].trim();v&&(a.index=Bce(i,v,r.indexOf(v,a.key?y+p.length:c+l.length)))}}return l&&(a.value=Bce(i,l,c)),a}function Bce(t,e,i){return Wl(e,!1,dlt(t,i,e.length))}function vOe({value:t,key:e,index:i},r=[]){return O0i([t,e,i,...r])}function O0i(t){let e=t.length;for(;e--&&!t[e];);return t.slice(0,e+1).map((i,r)=>i||Wl("_".repeat(r+1),!1))}const Nlt=Wl("undefined",!1),R0i=(t,e)=>{if(t.type===1&&(t.tagType===1||t.tagType===3)){const i=Fw(t,"slot");if(i)return i.exp,e.scopes.vSlot++,()=>{e.scopes.vSlot--}}},M0i=(t,e,i)=>XV(t,e,!1,!0,e.length?e[0].loc:i);function D0i(t,e,i=M0i){e.helper(aOe);const{children:r,loc:n}=t,s=[],o=[];let a=e.scopes.vSlot>0||e.scopes.vFor>0;const l=Fw(t,"slot",!0);if(l){const{arg:P,exp:F}=l;P&&!I_(P)&&(a=!0),s.push(zp(P||Wl("default",!0),i(F,r,n)))}let c=!1,h=!1;const p=[],y=new Set;let v=0;for(let P=0;P{const j=i(F,k,n);return e.compatConfig&&(j.isNonScopedSlot=!0),zp("default",j)};c?p.length&&p.some(F=>klt(F))&&(h?e.onError(Wd(39,p[0].loc)):s.push(P(void 0,p))):s.push(P(void 0,r))}const x=a?2:jce(t.children)?3:1;let I=Dw(s.concat(zp("_",Wl(x+"",!1))),n);return o.length&&(I=Jf(e.helper(llt),[I,lK(o)])),{slots:I,hasDynamicSlots:a}}function Vce(t,e,i){const r=[zp("name",t),zp("fn",e)];return i!=null&&r.push(zp("key",Wl(String(i),!0))),Dw(r)}function jce(t){for(let e=0;efunction(){if(t=e.currentNode,!(t.type===1&&(t.tagType===0||t.tagType===1)))return;const{tag:r,props:n}=t,s=t.tagType===1;let o=s?L0i(t,e):`"${r}"`;const a=Qc(o)&&o.callee===Cce;let l,c,h,p=0,y,v,x,I=a||o===rK||o===qPe||!s&&(r==="svg"||r==="foreignObject");if(n.length>0){const P=Blt(t,e,void 0,s,a);l=P.props,p=P.patchFlag,v=P.dynamicPropNames;const F=P.directives;x=F&&F.length?lK(F.map(k=>k0i(k,e))):void 0,P.shouldUseBlock&&(I=!0)}if(t.children.length>0)if(o===Sce&&(I=!0,p|=1024),s&&o!==rK&&o!==Sce){const{slots:F,hasDynamicSlots:k}=D0i(t,e);c=F,k&&(p|=1024)}else if(t.children.length===1&&o!==rK){const F=t.children[0],k=F.type,j=k===5||k===8;j&&Nw(F,e)===0&&(p|=1),j||k===2?c=F:c=t.children}else c=t.children;p!==0&&(h=String(p),v&&v.length&&(y=$0i(v))),t.codegenNode=aK(e,o,l,c,h,y,x,!!I,!1,s,t.loc)};function L0i(t,e,i=!1){let{tag:r}=t;const n=_Oe(r),s=Oce(t,"is");if(s)if(n||ik("COMPILER_IS_ON_ELEMENT",e)){const l=s.type===6?s.value&&Wl(s.value.content,!0):s.exp;if(l)return Jf(e.helper(Cce),[l])}else s.type===6&&s.value.content.startsWith("vue:")&&(r=s.value.content.slice(4));const o=!n&&Fw(t,"is");if(o&&o.exp)return Jf(e.helper(Cce),[o.exp]);const a=clt(r)||e.isBuiltInComponent(r);return a?(i||e.helper(a),a):(e.helper(JPe),e.components.add(r),uK(r,"component"))}function Blt(t,e,i=t.props,r,n,s=!1){const{tag:o,loc:a,children:l}=t;let c=[];const h=[],p=[],y=l.length>0;let v=!1,x=0,I=!1,P=!1,F=!1,k=!1,j=!1,V=!1;const Y=[],X=ce=>{c.length&&(h.push(Dw(Vlt(c),a)),c=[]),ce&&h.push(ce)},Z=({key:ce,value:he})=>{if(I_(ce)){const _e=ce.content,xe=kN(_e);if(xe&&(!r||n)&&_e.toLowerCase()!=="onclick"&&_e!=="onUpdate:modelValue"&&!BN(_e)&&(k=!0),xe&&BN(_e)&&(V=!0),he.type===20||(he.type===4||he.type===8)&&Nw(he,e)>0)return;_e==="ref"?I=!0:_e==="class"?P=!0:_e==="style"?F=!0:_e!=="key"&&!Y.includes(_e)&&Y.push(_e),r&&(_e==="class"||_e==="style")&&!Y.includes(_e)&&Y.push(_e)}else j=!0};for(let ce=0;ce0&&c.push(zp(Wl("ref_for",!0),Wl("true")))),xe==="is"&&(_Oe(o)||Pe&&Pe.content.startsWith("vue:")||ik("COMPILER_IS_ON_ELEMENT",e)))continue;c.push(zp(Wl(xe,!0,dlt(_e,0,xe.length)),Wl(Pe?Pe.content:"",ke,Pe?Pe.loc:_e)))}else{const{name:_e,arg:xe,exp:Pe,loc:ke}=he,J=_e==="bind",de=_e==="on";if(_e==="slot"){r||e.onError(Wd(40,ke));continue}if(_e==="once"||_e==="memo"||_e==="is"||J&&tk(xe,"is")&&(_Oe(o)||ik("COMPILER_IS_ON_ELEMENT",e))||de&&s)continue;if((J&&tk(xe,"key")||de&&y&&tk(xe,"vue:before-update"))&&(v=!0),J&&tk(xe,"ref")&&e.scopes.vFor>0&&c.push(zp(Wl("ref_for",!0),Wl("true"))),!xe&&(J||de)){if(j=!0,Pe)if(J){if(X(),ik("COMPILER_V_BIND_OBJECT_ORDER",e)){h.unshift(Pe);continue}h.push(Pe)}else X({type:14,loc:ke,callee:e.helper(nOe),arguments:r?[Pe]:[Pe,"true"]});else e.onError(Wd(J?34:35,ke));continue}const Se=e.directiveTransforms[_e];if(Se){const{props:Ie,needRuntime:Re}=Se(he,t,e);!s&&Ie.forEach(Z),de&&xe&&!I_(xe)?X(Dw(Ie,a)):c.push(...Ie),Re&&(p.push(he),BM(Re)&&$lt.set(he,Re))}else hmi(_e)||(p.push(he),y&&(v=!0))}}let ie;if(h.length?(X(),h.length>1?ie=Jf(e.helper(Ece),h,a):ie=h[0]):c.length&&(ie=Dw(Vlt(c),a)),j?x|=16:(P&&!r&&(x|=2),F&&!r&&(x|=4),Y.length&&(x|=8),k&&(x|=32)),!v&&(x===0||x===32)&&(I||V||p.length>0)&&(x|=512),!e.inSSR&&ie)switch(ie.type){case 15:let ce=-1,he=-1,_e=!1;for(let ke=0;kezp(o,s)),n))}return lK(i,t.loc)}function $0i(t){let e="[";for(let i=0,r=t.length;i{if(Mce(t)){const{children:i,loc:r}=t,{slotName:n,slotProps:s}=V0i(t,e),o=[e.prefixIdentifiers?"_ctx.$slots":"$slots",n,"{}","undefined","true"];let a=2;s&&(o[2]=s,a=3),i.length&&(o[3]=XV([],i,!1,!1,r),a=4),e.scopeId&&!e.slotted&&(a=5),o.splice(a),t.codegenNode=Jf(e.helper(alt),o,r)}};function V0i(t,e){let i='"default"',r;const n=[];for(let s=0;s0){const{props:s,directives:o}=Blt(t,e,n,!1,!1);r=s,o.length&&e.onError(Wd(36,o[0].loc))}return{slotName:i,slotProps:r}}const j0i=/^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,jlt=(t,e,i,r)=>{const{loc:n,modifiers:s,arg:o}=t;!t.exp&&!s.length&&i.onError(Wd(35,n));let a;if(o.type===4)if(o.isStatic){let p=o.content;p.startsWith("vue:")&&(p=`vnode-${p.slice(4)}`);const y=e.tagType!==0||p.startsWith("vnode")||!/[A-Z]/.test(p)?VN(yf(p)):`on:${p}`;a=Wl(y,!0,o.loc)}else a=J2([`${i.helperString(oOe)}(`,o,")"]);else a=o,a.children.unshift(`${i.helperString(oOe)}(`),a.children.push(")");let l=t.exp;l&&!l.content.trim()&&(l=void 0);let c=i.cacheHandlers&&!l&&!i.inVOnce;if(l){const p=hlt(l.content),y=!(p||j0i.test(l.content)),v=l.content.includes(";");(y||c&&p)&&(l=J2([`${y?"$event":"(...args)"} => ${v?"{":"("}`,l,v?"}":")"]))}let h={props:[zp(a,l||Wl("() => {}",!1,n))]};return r&&(h=r(h)),c&&(h.props[0].value=i.cache(h.props[0].value)),h.props.forEach(p=>p.key.isHandlerKey=!0),h},G0i=(t,e,i)=>{const{exp:r,modifiers:n,loc:s}=t,o=t.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=yf(o.content):o.content=`${i.helperString(sOe)}(${o.content})`:(o.children.unshift(`${i.helperString(sOe)}(`),o.children.push(")"))),i.inSSR||(n.includes("prop")&&Glt(o,"."),n.includes("attr")&&Glt(o,"^")),!r||r.type===4&&!r.content.trim()?(i.onError(Wd(34,s)),{props:[zp(o,Wl("",!0,s))]}):{props:[zp(o,r)]}},Glt=(t,e)=>{t.type===4?t.isStatic?t.content=e+t.content:t.content=`\`${e}\${${t.content}}\``:(t.children.unshift(`'${e}' + (`),t.children.push(")"))},U0i=(t,e)=>{if(t.type===0||t.type===1||t.type===11||t.type===10)return()=>{const i=t.children;let r,n=!1;for(let s=0;ss.type===7&&!e.directiveTransforms[s.name])&&t.tag!=="template")))for(let s=0;s{if(t.type===1&&Fw(t,"once",!0))return Ult.has(t)||e.inVOnce||e.inSSR?void 0:(Ult.add(t),e.inVOnce=!0,e.helper(Ice),()=>{e.inVOnce=!1;const i=e.currentNode;i.codegenNode&&(i.codegenNode=e.cache(i.codegenNode,!0))})},zlt=(t,e,i)=>{const{exp:r,arg:n}=t;if(!r)return i.onError(Wd(41,t.loc)),Gce();const s=r.loc.source,o=r.type===4?r.content:s,a=i.bindingMetadata[s];if(a==="props"||a==="props-aliased")return i.onError(Wd(44,r.loc)),Gce();const l=!1;if(!o.trim()||!hlt(o)&&!l)return i.onError(Wd(42,r.loc)),Gce();const c=n||Wl("modelValue",!0),h=n?I_(n)?`onUpdate:${yf(n.content)}`:J2(['"onUpdate:" + ',n]):"onUpdate:modelValue";let p;const y=i.isTS?"($event: any)":"$event";p=J2([`${y} => ((`,r,") = $event)"]);const v=[zp(c,t.exp),zp(h,p)];if(t.modifiers.length&&e.tagType===1){const x=t.modifiers.map(P=>(hOe(P)?P:JSON.stringify(P))+": true").join(", "),I=n?I_(n)?`${n.content}Modifiers`:J2([n,' + "Modifiers"']):"modelModifiers";v.push(zp(I,Wl(`{ ${x} }`,!1,t.loc,2)))}return Gce(v)};function Gce(t=[]){return{props:t}}const H0i=/[\w).+\-_$\]]/,W0i=(t,e)=>{ik("COMPILER_FILTER",e)&&(t.type===5&&Uce(t.content,e),t.type===1&&t.props.forEach(i=>{i.type===7&&i.name!=="for"&&i.exp&&Uce(i.exp,e)}))};function Uce(t,e){if(t.type===4)Hlt(t,e);else for(let i=0;i=0&&(k=i.charAt(F),k===" ");F--);(!k||!H0i.test(k))&&(o=!0)}}x===void 0?x=i.slice(0,v).trim():h!==0&&P();function P(){I.push(i.slice(h,v).trim()),h=v+1}if(I.length){for(v=0;v{if(t.type===1){const i=Fw(t,"memo");return!i||Wlt.has(t)?void 0:(Wlt.add(t),()=>{const r=t.codegenNode||e.currentNode.codegenNode;r&&r.type===13&&(t.tagType!==1&&cOe(r,e),t.codegenNode=Jf(e.helper(lOe),[i.exp,XV(void 0,r),"_cache",String(e.cached++)]))})}};function X0i(t){return[[z0i,S0i,Y0i,E0i,W0i,B0i,F0i,R0i,U0i],{on:jlt,bind:G0i,model:zlt}]}function K0i(t,e={}){const i=e.onError||WPe,r=e.mode==="module";e.prefixIdentifiers===!0?i(Wd(47)):r&&i(Wd(48));const n=!1;e.cacheHandlers&&i(Wd(49)),e.scopeId&&!r&&i(Wd(50));const s=gl(t)?Hyi(t,e):t,[o,a]=X0i();return s0i(s,Lu({},e,{prefixIdentifiers:n,nodeTransforms:[...o,...e.nodeTransforms||[]],directiveTransforms:Lu({},a,e.directiveTransforms||{})})),l0i(s,Lu({},e,{prefixIdentifiers:n}))}const J0i=()=>({props:[]}),qlt=Symbol(""),Ylt=Symbol(""),Xlt=Symbol(""),Klt=Symbol(""),bOe=Symbol(""),Jlt=Symbol(""),Zlt=Symbol(""),Qlt=Symbol(""),eut=Symbol(""),tut=Symbol("");Ryi({[qlt]:"vModelRadio",[Ylt]:"vModelCheckbox",[Xlt]:"vModelText",[Klt]:"vModelSelect",[bOe]:"vModelDynamic",[Jlt]:"withModifiers",[Zlt]:"withKeys",[Qlt]:"vShow",[eut]:"Transition",[tut]:"TransitionGroup"});let QV;function Z0i(t,e=!1){return QV||(QV=document.createElement("div")),e?(QV.innerHTML=`
`,QV.children[0].getAttribute("foo")):(QV.innerHTML=t,QV.textContent)}const Q0i=w_("style,iframe,script,noscript",!0),evi={isVoidTag:Smi,isNativeTag:t=>wmi(t)||xmi(t),isPreTag:t=>t==="pre",decodeEntities:Z0i,isBuiltInComponent:t=>{if(ZV(t,"Transition"))return eut;if(ZV(t,"TransitionGroup"))return tut},getNamespace(t,e){let i=e?e.ns:0;if(e&&i===2)if(e.tag==="annotation-xml"){if(t==="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"))&&(i=0)}else/^m(?:[ions]|text)$/.test(e.tag)&&t!=="mglyph"&&t!=="malignmark"&&(i=0);else e&&i===1&&(e.tag==="foreignObject"||e.tag==="desc"||e.tag==="title")&&(i=0);if(i===0){if(t==="svg")return 1;if(t==="math")return 2}return i},getTextMode({tag:t,ns:e}){if(e===0){if(t==="textarea"||t==="title")return 1;if(Q0i(t))return 2}return 0}},tvi=t=>{t.type===1&&t.props.forEach((e,i)=>{e.type===6&&e.name==="style"&&e.value&&(t.props[i]={type:7,name:"bind",arg:Wl("style",!0,e.loc),exp:ivi(e.value.content,e.loc),modifiers:[],loc:e.loc})})},ivi=(t,e)=>{const i=Cst(t);return Wl(JSON.stringify(i),!1,e,3)};function rD(t,e){return Wd(t,e)}const rvi=(t,e,i)=>{const{exp:r,loc:n}=t;return r||i.onError(rD(53,n)),e.children.length&&(i.onError(rD(54,n)),e.children.length=0),{props:[zp(Wl("innerHTML",!0,n),r||Wl("",!0))]}},nvi=(t,e,i)=>{const{exp:r,loc:n}=t;return r||i.onError(rD(55,n)),e.children.length&&(i.onError(rD(56,n)),e.children.length=0),{props:[zp(Wl("textContent",!0),r?Nw(r,i)>0?r:Jf(i.helperString(Tce),[r],n):Wl("",!0))]}},svi=(t,e,i)=>{const r=zlt(t,e,i);if(!r.props.length||e.tagType===1)return r;t.arg&&i.onError(rD(58,t.arg.loc));const{tag:n}=e,s=i.isCustomElement(n);if(n==="input"||n==="textarea"||n==="select"||s){let o=Xlt,a=!1;if(n==="input"||s){const l=Oce(e,"type");if(l){if(l.type===7)o=bOe;else if(l.value)switch(l.value.content){case"radio":o=qlt;break;case"checkbox":o=Ylt;break;case"file":a=!0,i.onError(rD(59,t.loc));break}}else Byi(e)&&(o=bOe)}else n==="select"&&(o=Klt);a||(r.needRuntime=i.helper(o))}else i.onError(rD(57,t.loc));return r.props=r.props.filter(o=>!(o.key.type===4&&o.key.content==="modelValue")),r},ovi=w_("passive,once,capture"),avi=w_("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),lvi=w_("left,right"),iut=w_("onkeyup,onkeydown,onkeypress",!0),uvi=(t,e,i,r)=>{const n=[],s=[],o=[];for(let a=0;aI_(t)&&t.content.toLowerCase()==="onclick"?Wl(e,!0):t.type!==4?J2(["(",t,`) === "onClick" ? "${e}" : (`,t,")"]):t,cvi=(t,e,i)=>jlt(t,e,i,r=>{const{modifiers:n}=t;if(!n.length)return r;let{key:s,value:o}=r.props[0];const{keyModifiers:a,nonKeyModifiers:l,eventOptionModifiers:c}=uvi(s,n,i,t.loc);if(l.includes("right")&&(s=rut(s,"onContextmenu")),l.includes("middle")&&(s=rut(s,"onMouseup")),l.length&&(o=Jf(i.helper(Jlt),[o,JSON.stringify(l)])),a.length&&(!I_(s)||iut(s.content))&&(o=Jf(i.helper(Zlt),[o,JSON.stringify(a)])),c.length){const h=c.map(VM).join("");s=I_(s)?Wl(`${s.content}${h}`,!0):J2(["(",s,`) + "${h}"`])}return{props:[zp(s,o)]}}),hvi=(t,e,i)=>{const{exp:r,loc:n}=t;return r||i.onError(rD(61,n)),{props:[],needRuntime:i.helper(Qlt)}},dvi=(t,e)=>{t.type===1&&t.tagType===0&&(t.tag==="script"||t.tag==="style")&&e.removeNode()},pvi=[tvi],fvi={cloak:J0i,html:rvi,text:nvi,model:svi,on:cvi,show:hvi};function mvi(t,e={}){return K0i(t,Lu({},evi,e,{nodeTransforms:[dvi,...pvi,...e.nodeTransforms||[]],directiveTransforms:Lu({},fvi,e.directiveTransforms||{}),transformHoist:null}))}const nut=Object.create(null);function sut(t,e){if(!gl(t))if(t.nodeType)t=t.innerHTML;else return gv;const i=t,r=nut[i];if(r)return r;if(t[0]==="#"){const a=document.querySelector(t);t=a?a.innerHTML:""}const n=Lu({hoistStatic:!0,onError:void 0,onWarn:gv},e);!n.isCustomElement&&typeof customElements<"u"&&(n.isCustomElement=a=>!!customElements.get(a));const{code:s}=mvi(t,n),o=new Function("Vue",s)(Tyi);return o._rc=!0,nut[i]=o}MPe(sut);const gvi=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:iPe,BaseTransitionPropsValidators:ece,Comment:oy,EffectScope:Aue,Fragment:po,KeepAlive:bot,ReactiveEffect:BV,Static:XM,Suspense:dot,Teleport:EPe,Text:EP,Transition:eD,TransitionGroup:yce,VueElement:ZX,assertNumber:rot,callWithAsyncErrorHandling:S_,callWithErrorHandling:NT,camelize:yf,capitalize:VM,cloneVNode:q2,compatUtils:wat,compile:sut,computed:Jr,createApp:xce,createBlock:Bn,createCommentVNode:fn,createElementBlock:hi,createElementVNode:Dt,createHydrationRenderer:SPe,createPropsRestProxy:Vot,createRenderer:xPe,createSSRApp:Zat,createSlots:Cot,createStaticVNode:pce,createTextVNode:ks,createVNode:Un,customRef:eot,defineAsyncComponent:GX,defineComponent:an,defineCustomElement:VPe,defineEmits:Aot,defineExpose:Pot,defineModel:Mot,defineOptions:Oot,defineProps:Iot,defineSSRCustomElement:Aat,defineSlots:Rot,get devtools(){return zN},effect:Mst,effectScope:DX,getCurrentInstance:Up,getCurrentScope:Pue,getTransitionRawChildren:jX,guardReactiveProps:IPe,h:Y2,handleError:WM,hasInjectionContext:qot,hydrate:HPe,initCustomFormatter:yat,initDirectivesForSSR:tlt,inject:no,isMemoSame:gce,isProxy:jue,isReactive:Rw,isReadonly:HM,isRef:Ic,isRuntimeOnly:fat,isShallow:GV,isVNode:BT,markRaw:ya,mergeDefaults:$ot,mergeModels:Bot,mergeProps:JX,nextTick:v0,normalizeClass:ms,normalizeProps:Tst,normalizeStyle:nb,onActivated:sPe,onBeforeMount:C_,onBeforeUnmount:Ll,onBeforeUpdate:ice,onDeactivated:oPe,onErrorCaptured:rce,onMounted:Ja,onRenderTracked:hPe,onRenderTriggered:cPe,onScopeDispose:VAe,onServerPrefetch:uPe,onUnmounted:XN,onUpdated:YN,openBlock:Qt,popScopeId:th,provide:sce,proxyRefs:Uue,pushScopeId:eh,queuePostFlushCb:Wue,reactive:Fl,readonly:Bue,ref:Mi,registerRuntimeCompiler:MPe,render:K2,renderList:fu,renderSlot:Xf,resolveComponent:Vo,resolveDirective:as,resolveDynamicComponent:TP,resolveFilter:bat,resolveTransitionHooks:WN,setBlockTracking:cce,setDevtoolsHook:ZAe,setTransitionHooks:qM,shallowReactive:WAe,shallowReadonly:Kst,shallowRef:XAe,ssrContextKey:FPe,ssrUtils:_at,stop:Dst,toDisplayString:xr,toHandlerKey:VN,toHandlers:Eot,toRaw:Qs,toRef:zue,toRefs:GN,toValue:Qst,transformVNodeArgs:lat,triggerRef:Zst,unref:vi,useAttrs:Lot,useCssModule:Pat,useCssVars:Oat,useModel:Not,useSSRContext:LPe,useSlots:Fot,useTransitionState:Que,vModelCheckbox:vce,vModelDynamic:zPe,vModelRadio:_ce,vModelSelect:bce,vModelText:X2,vShow:vf,version:NPe,warn:iot,watch:bu,watchEffect:mot,watchPostEffect:tPe,watchSyncEffect:got,withAsyncContext:jot,withCtx:En,withDefaults:Dot,withDirectives:Zr,withKeys:Zh,withMemo:vat,withModifiers:wa,withScopeId:uot},Symbol.toStringTag,{value:"Module"}));var yvi=!1;/*! * pinia v2.0.32 * (c) 2023 Eduardo San Martin Morote * @license MIT - */let Xlt;const jce=t=>Xlt=t,Klt=Symbol();function fOe(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var fK;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(fK||(fK={}));function Z0i(){const t=FX(!0),e=t.run(()=>Pi({}));let i=[],r=[];const n=Ho({install(s){jce(n),n._a=s,s.provide(Klt,n),s.config.globalProperties.$pinia=n,r.forEach(o=>i.push(o)),r=[]},use(s){return!this._a&&!J0i?r.push(s):i.push(s),this},_p:i,_a:null,_e:t,_s:new Map,state:e});return n}const Jlt=()=>{};function Zlt(t,e,i,r=Jlt){t.push(e);const n=()=>{const s=t.indexOf(e);s>-1&&(t.splice(s,1),r())};return!i&&Rue()&&LAe(n),n}function rV(t,...e){t.slice().forEach(i=>{i(...e)})}function mOe(t,e){t instanceof Map&&e instanceof Map&&e.forEach((i,r)=>t.set(r,i)),t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const i in e){if(!e.hasOwnProperty(i))continue;const r=e[i],n=t[i];fOe(n)&&fOe(r)&&t.hasOwnProperty(i)&&!lc(r)&&!Aw(r)?t[i]=mOe(n,r):t[i]=r}return t}const Q0i=Symbol();function evi(t){return!fOe(t)||!t.hasOwnProperty(Q0i)}const{assign:iD}=Object;function tvi(t){return!!(lc(t)&&t.effect)}function ivi(t,e,i,r){const{state:n,actions:s,getters:o}=e,a=i.state.value[t];let l;function c(){a||(i.state.value[t]=n?n():{});const d=Bk(i.state.value[t]);return iD(d,s,Object.keys(o||{}).reduce((p,y)=>(p[y]=Ho(Vr(()=>{jce(i);const v=i._s.get(t);return o[y].call(v,v)})),p),{}))}return l=Qlt(t,c,e,i,r,!0),l.$reset=function(){const p=n?n():{};this.$patch(y=>{iD(y,p)})},l}function Qlt(t,e,i={},r,n,s){let o;const a=iD({actions:{}},i),l={deep:!0};let c,d,p=Ho([]),y=Ho([]),v;const S=r.state.value[t];!s&&!S&&(r.state.value[t]={}),Pi({});let I;function O(te){let re;c=d=!1,typeof te=="function"?(te(r.state.value[t]),re={type:fK.patchFunction,storeId:t,events:v}):(mOe(r.state.value[t],te),re={type:fK.patchObject,payload:te,storeId:t,events:v});const fe=I=Symbol();iy().then(()=>{I===fe&&(c=!0)}),d=!0,rV(p,re,r.state.value[t])}const L=Jlt;function N(){o.stop(),p=[],y=[],r._s.delete(t)}function G(te,re){return function(){jce(r);const fe=Array.from(arguments),ge=[],_e=[];function Ie(J){ge.push(J)}function ke(J){_e.push(J)}rV(y,{args:fe,name:te,store:Y,after:Ie,onError:ke});let Ne;try{Ne=re.apply(this&&this.$id===t?this:Y,fe)}catch(J){throw rV(_e,J),J}return Ne instanceof Promise?Ne.then(J=>(rV(ge,J),J)).catch(J=>(rV(_e,J),Promise.reject(J))):(rV(ge,Ne),Ne)}}const V={_p:r,$id:t,$onAction:Zlt.bind(null,y),$patch:O,$reset:L,$subscribe(te,re={}){const fe=Zlt(p,te,re.detached,()=>ge()),ge=o.run(()=>Sc(()=>r.state.value[t],_e=>{(re.flush==="sync"?d:c)&&te({storeId:t,type:fK.direct,events:v},_e)},iD({},l,re)));return fe},$dispose:N},Y=Tl(V);r._s.set(t,Y);const X=r._e.run(()=>(o=FX(),o.run(()=>e())));for(const te in X){const re=X[te];if(lc(re)&&!tvi(re)||Aw(re))s||(S&&evi(re)&&(lc(re)?re.value=S[te]:mOe(re,S[te])),r.state.value[t][te]=re);else if(typeof re=="function"){const fe=G(te,re);X[te]=fe,a.actions[te]=re}}return iD(Y,X),iD(Hs(Y),X),Object.defineProperty(Y,"$state",{get:()=>r.state.value[t],set:te=>{O(re=>{iD(re,te)})}}),r._p.forEach(te=>{iD(Y,o.run(()=>te({store:Y,app:r._a,pinia:r,options:a})))}),S&&s&&i.hydrate&&i.hydrate(Y.$state,S),c=!0,d=!0,Y}function Vp(t,e,i){let r,n;const s=typeof e=="function";typeof t=="string"?(r=t,n=s?i:e):(n=t,r=t.id);function o(a,l){const c=ff();return a=a||c&&Qs(Klt,null),a&&jce(a),a=Xlt,a._s.has(r)||(s?Qlt(r,e,n,a):ivi(r,n,a)),a._s.get(r)}return o.$id=r,o}const hg=Vp("appbar",()=>{const t=Pi({}),e=Pi([]),i=Pi([]),r=Vr(()=>e.value.map(o=>o.map(a=>t.value[a]).filter(a=>{if(typeof a=="string"||a.componentId)return!0})).filter(o=>o.length>0));function n(o){i.value.includes(o)||i.value.push(o)}function s(o){const a=i.value.indexOf(o);a!==-1&&i.value.splice(a,1),o in t.value&&delete t.value[o],e.value.forEach(l=>{const c=l.indexOf(o);c!==-1&&l.splice(c,1)})}return{items:t,order:e,temporary:i,visible:r,addTempButton:n,removeButton:s}}),iN=Vp("grid",()=>{const t=Pi({}),e=Pi(),i=Pi();function r(s){t.value={...t.value,[s.id]:s}}function n(s){t.value[s]!==void 0&&delete t.value[s]}return{grids:t,panel:e,currentId:i,addGrid:r,removeGrid:n}});function OP(t,e,i,r){var n,s=!1,o=0;function a(){n&&clearTimeout(n)}function l(){a(),s=!0}typeof e!="boolean"&&(r=i,i=e,e=void 0);function c(){for(var d=arguments.length,p=new Array(d),y=0;yt?I():e!==!0&&(n=setTimeout(r?O:I,r===void 0?t-S:t))}return c.cancel=l,c}function Z2(t,e,i){return i===void 0?OP(t,e,!1):OP(t,i,e!==!1)}const rD=Vp("map-caption",()=>{const t=Pi({text:{},logo:{}}),e=Pi({}),i=Pi({});function r(n){n!==void 0?e.value.isImperialScale=n:e.value.isImperialScale=!e.value.isImperialScale}return{attribution:t,scale:e,coords:i,toggleScale:r}}),eut=(t,e)=>{const i=[...t];for(;i.length>0;){const r=i.shift();if(e(r))return r;r&&i.push(...r.sublayers)}},mv=Vp("layer",()=>{const t=Pi([]),e=Pi([]),i=Pi([]);function r(y){return eut(t.value,v=>v?.uid===y)}function n(y){return eut(t.value,v=>v?.id===y)}function s(y){i.value=[...i.value,y]}function o(y){t.value=[...t.value,y]}function a(y){e.value=[...e.value,y]}function l(y,v=t.value.length){const S=t.value.findIndex(I=>I.uid===y.uid);S!==-1&&S!==v&&(t.value.splice(S,1),t.value.splice(v,0,y),t.value=[...t.value])}function c(y){const v=t.value.filter(S=>S.id!==y.id||S.uid!==y.uid);t.value=v}function d(y){const v=y instanceof gN?y.id:y,S=y instanceof gN?y.uid:y,I=e.value.filter(O=>O.id!==v&&O.uid!==S);e.value=I}function p(y){const v=i.value.filter(S=>S.id!==y);i.value=v}return{layers:t,penaltyBox:e,layerConfigs:i,getLayerByUid:r,getLayerById:n,addLayerConfig:s,addLayer:o,addErrorLayer:a,reorderLayer:l,removeLayer:c,removeErrorLayer:d,removeLayerConfig:p}}),dg=Vp("config",()=>{const t=Pi({map:{lodSets:[],extentSets:[],tileSchemas:[],basemaps:[],initialBasemapId:""},fixtures:{},layers:[]}),e=Pi([]),i=Pi(),r=Pi({}),n=Pi({});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 c={...t.value,...l};if(t.value=c,Array.isArray(t.value.layers)){const d=mv();d.layerConfigs=[...d.layerConfigs,t.value.layers]}}function a(l){const c=l.configLangs,d=l.config,p=l.allLangs;c!==void 0&&c.length>0&&c.forEach(y=>{r.value[y]=d,n.value[y]=y}),p!==void 0&&p.length>0&&p.forEach(y=>{n.value[y]=Object.keys(r.value)[0]})}return{config:t,startingFixtures:e,activeBasemapConfig:i,registeredConfigs:r,registeredLangs:n,getActiveConfig:s,newConfig:o,registerConfig:a}});class rvi{id;name;template;componentId;constructor(e){const i={...typeof e=="string"?{id:e,template:"",name:""}:e};({template:this.template,id:this.id,name:this.name}=i)}}const rN=Vp("details",()=>{const t=Pi([]),e=Pi({}),i=Pi({}),r=Pi(),n=Pi(!1),s=Pi(0),o=Pi(0),a=Pi(!0);function l(c){const d=t.value.findIndex(p=>p.uid===c.uid);d!==-1&&t.value.splice(d,1)}return{payload:t,properties:e,defaultTemplates:i,currentFeatureId:r,slowLoadingFlag:n,activeGreedy:s,lastHilight:o,hilightToggle:a,removeLayer:l}});var an=(t=>(t.APPBAR_BUTTON_CLICK="appbar/click",t.COMPONENT="ramp/component",t.CONFIG_CHANGE="config/configchanged",t.DETAILS_TOGGLE="details/toggle",t.FILTER_CHANGE="filter/change",t.FIXTURE_ADDED="fixture/added",t.FIXTURE_REMOVED="fixture/removed",t.GRID_TOGGLE="grid/toggle",t.HELP_TOGGLE="help/toggle",t.LAYER_DRAWSTATECHANGE="layer/drawstatechange",t.LAYER_INITIATIONSTATECHANGE="layer/initiationStatechange",t.LAYER_LAYERSTATECHANGE="layer/layerstatechange",t.LAYER_OPACITYCHANGE="layer/opacitychange",t.LAYER_REGISTERED="layer/registered",t.LAYER_RELOAD_END="layer/reloadend",t.LAYER_RELOAD_START="layer/reloadstart",t.LAYER_REMOVE="layer/remove",t.LAYER_VISIBILITYCHANGE="layer/visibilitychange",t.MAP_BASEMAPCHANGE="map/basemapchanged",t.MAP_BLUR="map/blur",t.MAP_CLICK="map/click",t.MAP_CREATED="map/created",t.MAP_DESTROYED="map/destroyed",t.MAP_DOUBLECLICK="map/doubleclick",t.MAP_EXTENTCHANGE="map/extentchanged",t.MAP_FOCUS="map/focus",t.MAP_GRAPHICHIT="map/graphichit",t.MAP_IDENTIFY="map/identify",t.MAP_KEYDOWN="map/keydown",t.MAP_KEYUP="map/keyup",t.MAP_MOUSEDOWN="map/mousedown",t.MAP_MOUSEMOVE="map/mousemove",t.MAP_MOUSEMOVE_END="map/mousemoveend",t.MAP_MOUSEMOVE_START="map/mousemovestart",t.MAP_REFRESH_END="map/refreshend",t.MAP_REFRESH_START="map/refreshstart",t.MAP_REORDER="map/reorder",t.MAP_RESIZED="map/resized",t.MAP_SCALECHANGE="map/scalechanged",t.MAP_START="map/start",t.METADATA_TOGGLE="metadata/toggle",t.PANEL_CLOSED="panel/closed",t.PANEL_MINIMIZED="panel/minimized",t.PANEL_OPENED="panel/opened",t.RAMP_MOBILEVIEW_CHANGE="ramp/mobileviewchange",t.REORDER_TOGGLE="reorder/toggle",t.SETTINGS_TOGGLE="settings/toggle",t.USER_LAYER_ADDED="user/layeradded",t.WIZARD_TOGGLE="wizard/toggle",t))(an||{});class nvi{eventName;handlerName;handlerFunc;constructor(e,i,r){this.eventName=e,this.handlerName=i,this.handlerFunc=r}}class svi extends Np{_eventBus;_eventRegister;_nameRegister;_funCounter;constructor(e){super(e),this._eventBus=new Bfi,this._eventRegister=[],this._funCounter=1,this._nameRegister=Object.values(an).filter(i=>typeof i=="string"&&i.indexOf("/")>-1)}findHandler(e){return this._eventRegister.find(i=>i.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,i,r=""){if(this.findHandler(r))throw new Error("Duplicate handler name registration: "+r);r||(r=this.handlerNamer(e));const n=new nvi(e,r,i);return this._eventRegister.push(n),this._eventBus.on(e,i),r}off(e){const i=this.findHandler(e);i&&(this._eventRegister.splice(this._eventRegister.indexOf(i),1),this._eventBus.off(i.eventName,i.handlerFunc))}offAll(e=""){this.activeHandlers(e).forEach(r=>this.off(r))}emit(e,...i){this._eventBus.emit(e,...i)}once(e,i,r=""){r||(r=this.handlerNamer(e));const n=(...s)=>{i(...s),this.off(r)};return this.on(e,n,r)}activeHandlers(e=""){return e===""?this._eventRegister.map(i=>i.handlerName):this._eventRegister.filter(i=>i.eventName===e).map(i=>i.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_closes_grid","ramp_layer_remove_updates_legend","ramp_layer_useradd_updates_legend","ramp_map_basemap_updates_map_attribs","ramp_map_blur_updates_key_handler","ramp_map_click_runs_identify","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_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(i=>this.defaultHandlerFactory(i))}defaultHandlerFactory(e){let i;switch(e){case"ramp_config_change_updates_map_attribs":i=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",i,e);break;case"ramp_layer_error_updates_legend":i=r=>{if(r.layer.layerState===j0.ERROR){const n=this.$iApi.fixture.get("legend");n&&n.updateLegend(r.layer)}},this.$iApi.event.on("layer/layerstatechange",i,e);break;case"ramp_layer_register_binds_legend":i=r=>{const n=this.$iApi.fixture.get("legend");n&&n.updateLegend(r)},this.$iApi.event.on("layer/registered",i,e);break;case"ramp_layer_reload_end_binds_legend":i=r=>{const n=this.$iApi.fixture.get("legend");n&&n.updateLegend(r)},this.$iApi.event.on("layer/reloadend",i,e);break;case"ramp_layer_reload_start_updates_legend":i=r=>{const n=this.$iApi.fixture.get("legend");n&&n.reloadLayerItem(r.uid)},this.$iApi.event.on("layer/reloadstart",i,e);break;case"ramp_layer_remove_closes_grid":i=r=>{if(this.$iApi.fixture.get("grid")){const n=iN(this.$vApp.$pinia);n.removeGrid(r.id);const s=n.currentId;if(r.id===s){const o=this.$iApi.panel.get("grid");this.$iApi.panel.close(o),n.currentId=void 0}}},this.$iApi.event.on("layer/remove",i,e);break;case"ramp_layer_remove_updates_details":i=r=>{const n=rN(this.$vApp.$pinia);this.$iApi.fixture.get("details")&&n.removeLayer(r)},this.$iApi.event.on("layer/remove",i,e);break;case"ramp_layer_remove_updates_legend":i=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",i,e);break;case"ramp_layer_useradd_updates_legend":i=r=>{const n=this.$iApi.fixture.get("legend");n&&n.addLayerItem(r)},this.$iApi.event.on("user/layeradded",i,e);break;case"ramp_map_basemap_updates_map_attribs":i=()=>{this.$iApi.geo.map.caption.updateAttribution(dg(this.$vApp.$pinia).activeBasemapConfig?.attribution)},this.$iApi.event.on("map/basemapchanged",i,e);break;case"ramp_map_blur_updates_key_handler":i=r=>{this.$iApi.geo.map.stopKeyPan()},this.$iApi.event.on("map/blur",i,e);break;case"ramp_map_click_runs_identify":i=r=>{r.button===0&&this.$iApi.geo.map.runIdentify(r)},this.on("map/click",i,e);break;case"ramp_map_created_updates_map_attribs":i=()=>{this.$iApi.geo.map.caption.updateAttribution(dg(this.$vApp.$pinia).activeBasemapConfig?.attribution)},this.$iApi.geo.map.created&&i(),this.$iApi.event.on("map/created",i,e);break;case"ramp_map_extent_updates_maptip":i=()=>{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",OP(50,!0,()=>i()),e);break;case"ramp_map_graphichit_creates_maptip":i=r=>{this.$iApi.geo.map.maptip.generateDefaultMaptip(r)},this.$iApi.event.on("map/graphichit",i,e);break;case"ramp_map_identify_opens_identify_results":i=r=>{const n=this.$iApi.fixture.get("details");n&&n.openDetails(r.results)},this.on("map/identify",i,e);break;case"ramp_map_keydown_updates_coords":this.$iApi.event.on("map/keydown",OP(200,()=>{const r=rD(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":i=r=>{this.$iApi.geo.map.mapKeyDown(r)},this.$iApi.event.on("map/keydown",i,e);break;case"ramp_map_keyup_updates_key_handler":i=r=>{this.$iApi.geo.map.mapKeyUp(r)},this.$iApi.event.on("map/keyup",i,e);break;case"ramp_map_mouse_updates_coords":this.$iApi.event.on("map/mousemove",OP(200,r=>{const n=rD(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":i=r=>{this.$iApi.geo.map.maptip.checkAtCoord({screenX:r.screenX,screenY:r.screenY})},this.$iApi.event.on("map/mousemove",OP(200,r=>i(r)),e);break;case"ramp_map_resize_updates_scalebar":this.$iApi.event.on("map/resized",Z2(100,()=>this.$iApi.geo.map.caption.updateScale()),e);break;case"ramp_map_scale_updates_scalebar":this.$iApi.event.on("map/scalechanged",Z2(300,()=>this.$iApi.geo.map.caption.updateScale()),e);break;case"ramp_panel_close_updates_appbar":i=r=>{const n=hg(this.$vApp.$pinia);this.$iApi.fixture.get("appbar")&&!n.order.flat().find(s=>s===r.id)&&n.removeButton(r.id)},this.on("panel/closed",i,e);break;case"ramp_panel_open_updates_appbar":i=r=>{const n=hg(this.$vApp.$pinia);this.$iApi.fixture.get("appbar")&&!n.order.flat().find(s=>s===r.id)&&n.addTempButton(r.id)},this.on("panel/opened",i,e);break;case"ramp_toggle_details":i=(r,n)=>{const s=this.$iApi.fixture.get("details");s&&s.toggleFeature(r,n)},this.$iApi.event.on("details/toggle",i,e);break;case"ramp_toggle_grid":i=(r,n)=>{const s=this.$iApi.fixture.get("grid");s&&s.toggleGrid(r.id,n)},this.$iApi.event.on("grid/toggle",i,e);break;case"ramp_toggle_help":i=r=>{const n=this.$iApi.fixture.get("help");n&&n.toggleHelp(r)},this.$iApi.event.on("help/toggle",i,e);break;case"ramp_toggle_metadata":i=(r,n)=>{const s=this.$iApi.fixture.get("metadata");s&&s.toggleMetadata(r,n)},this.$iApi.event.on("metadata/toggle",i,e);break;case"ramp_toggle_reorder":i=r=>{const n=this.$iApi.fixture.get("layer-reorder");n&&n.toggleLayerReorder(r)},this.$iApi.event.on("reorder/toggle",i,e);break;case"ramp_toggle_settings":i=(r,n)=>{const s=this.$iApi.fixture.get("settings");s&&s.toggleSettings(r,n)},this.$iApi.event.on("settings/toggle",i,e);break;case"ramp_toggle_wizard":i=r=>{const n=this.$iApi.fixture.get("wizard");n&&n.toggleWizard(r)},this.$iApi.event.on("wizard/toggle",i,e);break;default:return console.error(`Unrecognized default event handler name encountered: ${e}`),`ERROR_NOT_REGISTERED__${e}`}return e}}/*! + */let out;const zce=t=>out=t,aut=Symbol();function wOe(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var mK;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(mK||(mK={}));function vvi(){const t=DX(!0),e=t.run(()=>Mi({}));let i=[],r=[];const n=ya({install(s){zce(n),n._a=s,s.provide(aut,n),s.config.globalProperties.$pinia=n,r.forEach(o=>i.push(o)),r=[]},use(s){return!this._a&&!yvi?r.push(s):i.push(s),this},_p:i,_a:null,_e:t,_s:new Map,state:e});return n}const lut=()=>{};function uut(t,e,i,r=lut){t.push(e);const n=()=>{const s=t.indexOf(e);s>-1&&(t.splice(s,1),r())};return!i&&Pue()&&VAe(n),n}function ej(t,...e){t.slice().forEach(i=>{i(...e)})}function xOe(t,e){t instanceof Map&&e instanceof Map&&e.forEach((i,r)=>t.set(r,i)),t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const i in e){if(!e.hasOwnProperty(i))continue;const r=e[i],n=t[i];wOe(n)&&wOe(r)&&t.hasOwnProperty(i)&&!Ic(r)&&!Rw(r)?t[i]=xOe(n,r):t[i]=r}return t}const _vi=Symbol();function bvi(t){return!wOe(t)||!t.hasOwnProperty(_vi)}const{assign:nD}=Object;function wvi(t){return!!(Ic(t)&&t.effect)}function xvi(t,e,i,r){const{state:n,actions:s,getters:o}=e,a=i.state.value[t];let l;function c(){a||(i.state.value[t]=n?n():{});const h=GN(i.state.value[t]);return nD(h,s,Object.keys(o||{}).reduce((p,y)=>(p[y]=ya(Jr(()=>{zce(i);const v=i._s.get(t);return o[y].call(v,v)})),p),{}))}return l=cut(t,c,e,i,r,!0),l.$reset=function(){const p=n?n():{};this.$patch(y=>{nD(y,p)})},l}function cut(t,e,i={},r,n,s){let o;const a=nD({actions:{}},i),l={deep:!0};let c,h,p=ya([]),y=ya([]),v;const x=r.state.value[t];!s&&!x&&(r.state.value[t]={}),Mi({});let I;function P(Z){let ie;c=h=!1,typeof Z=="function"?(Z(r.state.value[t]),ie={type:mK.patchFunction,storeId:t,events:v}):(xOe(r.state.value[t],Z),ie={type:mK.patchObject,payload:Z,storeId:t,events:v});const ce=I=Symbol();v0().then(()=>{I===ce&&(c=!0)}),h=!0,ej(p,ie,r.state.value[t])}const F=lut;function k(){o.stop(),p=[],y=[],r._s.delete(t)}function j(Z,ie){return function(){zce(r);const ce=Array.from(arguments),he=[],_e=[];function xe(J){he.push(J)}function Pe(J){_e.push(J)}ej(y,{args:ce,name:Z,store:Y,after:xe,onError:Pe});let ke;try{ke=ie.apply(this&&this.$id===t?this:Y,ce)}catch(J){throw ej(_e,J),J}return ke instanceof Promise?ke.then(J=>(ej(he,J),J)).catch(J=>(ej(_e,J),Promise.reject(J))):(ej(he,ke),ke)}}const V={_p:r,$id:t,$onAction:uut.bind(null,y),$patch:P,$reset:F,$subscribe(Z,ie={}){const ce=uut(p,Z,ie.detached,()=>he()),he=o.run(()=>bu(()=>r.state.value[t],_e=>{(ie.flush==="sync"?h:c)&&Z({storeId:t,type:mK.direct,events:v},_e)},nD({},l,ie)));return ce},$dispose:k},Y=Fl(V);r._s.set(t,Y);const X=r._e.run(()=>(o=DX(),o.run(()=>e())));for(const Z in X){const ie=X[Z];if(Ic(ie)&&!wvi(ie)||Rw(ie))s||(x&&bvi(ie)&&(Ic(ie)?ie.value=x[Z]:xOe(ie,x[Z])),r.state.value[t][Z]=ie);else if(typeof ie=="function"){const ce=j(Z,ie);X[Z]=ce,a.actions[Z]=ie}}return nD(Y,X),nD(Qs(Y),X),Object.defineProperty(Y,"$state",{get:()=>r.state.value[t],set:Z=>{P(ie=>{nD(ie,Z)})}}),r._p.forEach(Z=>{nD(Y,o.run(()=>Z({store:Y,app:r._a,pinia:r,options:a})))}),x&&s&&i.hydrate&&i.hydrate(Y.$state,x),c=!0,h=!0,Y}function Hp(t,e,i){let r,n;const s=typeof e=="function";typeof t=="string"?(r=t,n=s?i:e):(n=t,r=t.id);function o(a,l){const c=Up();return a=a||c&&no(aut,null),a&&zce(a),a=out,a._s.has(r)||(s?cut(r,e,n,a):xvi(r,n,a)),a._s.get(r)}return o.$id=r,o}const mg=Hp("appbar",()=>{const t=Mi({}),e=Mi([]),i=Mi([]),r=Jr(()=>e.value.map(o=>o.map(a=>t.value[a]).filter(a=>{if(typeof a=="string"||a.componentId)return!0})).filter(o=>o.length>0));function n(o){i.value.includes(o)||i.value.push(o)}function s(o){const a=i.value.indexOf(o);a!==-1&&i.value.splice(a,1),o in t.value&&delete t.value[o],e.value.forEach(l=>{const c=l.indexOf(o);c!==-1&&l.splice(c,1)})}return{items:t,order:e,temporary:i,visible:r,addTempButton:n,removeButton:s}}),tj=Hp("grid",()=>{const t=Mi({}),e=Mi(),i=Mi();function r(a){t.value={...t.value,[a.id]:a}}function n(a){t.value[a]!==void 0&&delete t.value[a]}function s(a){return Object.keys(t.value).find(l=>t.value[l].layerIds.includes(a))}function o(a,l){t.value[a].layerIds=t.value[a].layerIds.filter(c=>c!==l)}return{grids:t,panel:e,currentId:i,addGrid:r,removeGrid:n,getGridId:s,removeLayer:o}});function PP(t,e,i,r){var n,s=!1,o=0;function a(){n&&clearTimeout(n)}function l(){a(),s=!0}typeof e!="boolean"&&(r=i,i=e,e=void 0);function c(){for(var h=arguments.length,p=new Array(h),y=0;yt?I():e!==!0&&(n=setTimeout(r?P:I,r===void 0?t-x:t))}return c.cancel=l,c}function Z2(t,e,i){return i===void 0?PP(t,e,!1):PP(t,i,e!==!1)}const sD=Hp("map-caption",()=>{const t=Mi({text:{},logo:{}}),e=Mi({}),i=Mi({});function r(n){n!==void 0?e.value.isImperialScale=n:e.value.isImperialScale=!e.value.isImperialScale}return{attribution:t,scale:e,coords:i,toggleScale:r}}),hut=(t,e)=>{const i=[...t];for(;i.length>0;){const r=i.shift();if(e(r))return r;r&&i.push(...r.sublayers)}},gg=Hp("layer",()=>{const t=Mi([]),e=Mi([]),i=Mi([]),r=Mi([]),n=Mi([]);function s(F){return hut(t.value.concat(i.value,r.value,e.value),k=>k?.uid===F)}function o(F){return hut(t.value.concat(i.value,r.value,e.value),k=>k?.id===F)}function a(F){n.value=[...n.value,F]}function l(F){t.value=[...t.value,F]}function c(F){e.value=[...e.value,F]}function h(F){i.value=[...i.value,F]}function p(F){r.value=[...r.value,F]}function y(F,k=t.value.length){const j=t.value.findIndex(V=>V.uid===F.uid);j!==-1&&j!==k&&(t.value.splice(j,1),t.value.splice(k,0,F),t.value=[...t.value])}function v(F){if(F.mapLayer){const k=t.value.filter(j=>j.id!==F.id||j.uid!==F.uid);t.value=k}else{const k=e.value.filter(j=>j.id!==F.id||j.uid!==F.uid);e.value=k}}function x(F){const k=F instanceof $P?F.id:F,j=F instanceof $P?F.uid:F,V=i.value.filter(Y=>Y.id!==k&&Y.uid!==j);i.value=V}function I(F){const k=F instanceof $P?F.id:F,j=F instanceof $P?F.uid:F,V=r.value.filter(Y=>Y.id!==k&&Y.uid!==j);r.value=V}function P(F){const k=n.value.filter(j=>j.id!==F);n.value=k}return{layers:t,dataLayers:e,penaltyBox:i,initiatingLayers:r,layerConfigs:n,getLayerByUid:s,getLayerById:o,addLayerConfig:a,addLayer:l,addDataLayer:c,addErrorLayer:h,addInitiatingLayer:p,reorderLayer:y,removeLayer:v,removeErrorLayer:x,removeInitiatingLayer:I,removeLayerConfig:P}}),yg=Hp("config",()=>{const t=Mi({map:{lodSets:[],extentSets:[],tileSchemas:[],basemaps:[],initialBasemapId:""},fixtures:{},layers:[]}),e=Mi([]),i=Mi(),r=Mi({}),n=Mi({});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 c={...t.value,...l};if(t.value=c,Array.isArray(t.value.layers)){const h=gg();h.layerConfigs=[...h.layerConfigs,t.value.layers]}}function a(l){const c=l.configLangs,h=l.config,p=l.allLangs;c!==void 0&&c.length>0&&c.forEach(y=>{r.value[y]=h,n.value[y]=y}),p!==void 0&&p.length>0&&p.forEach(y=>{n.value[y]=Object.keys(r.value)[0]})}return{config:t,startingFixtures:e,activeBasemapConfig:i,registeredConfigs:r,registeredLangs:n,getActiveConfig:s,newConfig:o,registerConfig:a}});class Svi{id;name;template;componentId;constructor(e){const i={...typeof e=="string"?{id:e,template:"",name:""}:e};({template:this.template,id:this.id,name:this.name}=i)}}const rk=Hp("details",()=>{const t=Mi([]),e=Mi({}),i=Mi({}),r=Mi(),n=Mi(!1),s=Mi(0),o=Mi(0),a=Mi(!0);function l(c){const h=t.value.findIndex(p=>p.uid===c.uid);h!==-1&&t.value.splice(h,1)}return{payload:t,properties:e,defaultTemplates:i,currentFeatureId:r,slowLoadingFlag:n,activeGreedy:s,lastHilight:o,hilightToggle:a,removeLayer:l}}),OP=Hp("fixture",()=>{const t=Mi({}),e=Mi({});function i(o){return o.map(a=>e.value[a].getPromise())}function r(o){if(t.value={...t.value,[o.id]:ya(o)},o.id in e.value)e.value[o.id].resolveMe();else{const a=new Yf;a.resolveMe(),e.value={...e.value,[o.id]:a}}typeof o.added=="function"&&o.added()}function n(o){delete t.value[o.id],t.value={...t.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 Yf}}return{items:t,loadPromises:e,getLoadPromises:i,addFixture:r,removeFixture:n,addLoadPromise:s}});var cn=(t=>(t.APPBAR_BUTTON_CLICK="appbar/click",t.COMPONENT="ramp/component",t.CONFIG_CHANGE="config/configchanged",t.DETAILS_TOGGLE="details/toggle",t.FILTER_CHANGE="filter/change",t.FIXTURE_ADDED="fixture/added",t.FIXTURE_REMOVED="fixture/removed",t.GRID_TOGGLE="grid/toggle",t.HELP_TOGGLE="help/toggle",t.LAYER_DRAWSTATECHANGE="layer/drawstatechange",t.LAYER_INITIATIONSTATECHANGE="layer/initiationStatechange",t.LAYER_LAYERSTATECHANGE="layer/layerstatechange",t.LAYER_OPACITYCHANGE="layer/opacitychange",t.LAYER_REGISTERED="layer/registered",t.LAYER_RELOAD_END="layer/reloadend",t.LAYER_RELOAD_START="layer/reloadstart",t.LAYER_REMOVE="layer/remove",t.LAYER_VISIBILITYCHANGE="layer/visibilitychange",t.MAP_BASEMAPCHANGE="map/basemapchanged",t.MAP_BLUR="map/blur",t.MAP_CLICK="map/click",t.MAP_CREATED="map/created",t.MAP_DESTROYED="map/destroyed",t.MAP_DOUBLECLICK="map/doubleclick",t.MAP_EXTENTCHANGE="map/extentchanged",t.MAP_FOCUS="map/focus",t.MAP_GRAPHICHIT="map/graphichit",t.MAP_IDENTIFY="map/identify",t.MAP_KEYDOWN="map/keydown",t.MAP_KEYUP="map/keyup",t.MAP_MOUSEDOWN="map/mousedown",t.MAP_MOUSELEAVE="map/mouseleave",t.MAP_MOUSEMOVE="map/mousemove",t.MAP_MOUSEMOVE_END="map/mousemoveend",t.MAP_MOUSEMOVE_START="map/mousemovestart",t.MAP_REFRESH_END="map/refreshend",t.MAP_REFRESH_START="map/refreshstart",t.MAP_REORDER="map/reorder",t.MAP_RESIZED="map/resized",t.MAP_SCALECHANGE="map/scalechanged",t.MAP_START="map/start",t.METADATA_TOGGLE="metadata/toggle",t.PANEL_CLOSED="panel/closed",t.PANEL_MINIMIZED="panel/minimized",t.PANEL_OPENED="panel/opened",t.RAMP_MOBILEVIEW_CHANGE="ramp/mobileviewchange",t.REORDER_TOGGLE="reorder/toggle",t.SETTINGS_TOGGLE="settings/toggle",t.USER_LAYER_ADDED="user/layeradded",t.WIZARD_TOGGLE="wizard/toggle",t))(cn||{});class Cvi{eventName;handlerName;handlerFunc;constructor(e,i,r){this.eventName=e,this.handlerName=i,this.handlerFunc=r}}class Tvi extends Gp{_eventBus;_eventRegister;_nameRegister;_funCounter;constructor(e){super(e),this._eventBus=new omi,this._eventRegister=[],this._funCounter=1,this._nameRegister=Object.values(cn).filter(i=>typeof i=="string"&&i.indexOf("/")>-1)}findHandler(e){return this._eventRegister.find(i=>i.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,i,r=""){if(this.findHandler(r))throw new Error("Duplicate handler name registration: "+r);r||(r=this.handlerNamer(e));const n=new Cvi(e,r,i);return this._eventRegister.push(n),this._eventBus.on(e,i),r}off(e){const i=this.findHandler(e);i&&(this._eventRegister.splice(this._eventRegister.indexOf(i),1),this._eventBus.off(i.eventName,i.handlerFunc))}offAll(e=""){this.activeHandlers(e).forEach(r=>this.off(r))}emit(e,...i){this._eventBus.emit(e,...i)}once(e,i,r=""){r||(r=this.handlerNamer(e));const n=(...s)=>{i(...s),this.off(r)};return this.on(e,n,r)}activeHandlers(e=""){return e===""?this._eventRegister.map(i=>i.handlerName):this._eventRegister.filter(i=>i.eventName===e).map(i=>i.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(i=>this.defaultHandlerFactory(i))}defaultHandlerFactory(e){let i;switch(e){case"ramp_config_change_updates_map_attribs":i=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",i,e);break;case"ramp_layer_error_updates_legend":i=r=>{if(r.layer.layerState===Rp.ERROR){const n=this.$iApi.fixture.get("legend");n&&n.updateLegend(r.layer)}},this.$iApi.event.on("layer/layerstatechange",i,e);break;case"ramp_layer_register_binds_legend":i=r=>{const n=this.$iApi.fixture.get("legend");n&&n.updateLegend(r)},this.$iApi.event.on("layer/registered",i,e);break;case"ramp_layer_reload_end_binds_legend":i=r=>{const n=this.$iApi.fixture.get("legend");n&&n.updateLegend(r)},this.$iApi.event.on("layer/reloadend",i,e);break;case"ramp_layer_reload_start_updates_legend":i=r=>{const n=this.$iApi.fixture.get("legend");n&&n.reloadLayerItem(r.uid)},this.$iApi.event.on("layer/reloadstart",i,e);break;case"ramp_layer_remove_checks_grid":i=r=>{if(this.$iApi.fixture.get("grid")){const n=tj(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",i,e);break;case"ramp_layer_remove_updates_details":i=r=>{const n=rk(this.$vApp.$pinia);this.$iApi.fixture.get("details")&&n.removeLayer(r)},this.$iApi.event.on("layer/remove",i,e);break;case"ramp_layer_remove_updates_legend":i=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",i,e);break;case"ramp_layer_useradd_updates_legend":i=r=>{const n=this.$iApi.fixture.get("legend");n&&n.addLayerItem(r)},this.$iApi.event.on("user/layeradded",i,e);break;case"ramp_map_basemap_checks_tile_proj":i=()=>{this.$iApi.geo.layer.allLayers().filter(r=>r.layerType===_n.TILE).forEach(r=>{r.checkProj()})},this.$iApi.event.on("map/basemapchanged",i,e);break;case"ramp_map_basemap_updates_map_attribs":i=()=>{this.$iApi.geo.map.caption.updateAttribution(yg(this.$vApp.$pinia).activeBasemapConfig?.attribution)},this.$iApi.event.on("map/basemapchanged",i,e);break;case"ramp_map_blur_updates_key_handler":i=()=>{this.$iApi.geo.map.stopKeyPan()},this.$iApi.event.on("map/blur",i,e);break;case"ramp_map_click_runs_identify":i=r=>{r.button===0&&this.$iApi.geo.map.runIdentify(r)},this.on("map/click",i,e);break;case"ramp_map_created_initializes_fixtures":i=()=>{const r=OP(this.$vApp.$pinia).items;Object.keys(r).forEach(n=>{r[n].initialized?.()})},this.$iApi.geo.map.created&&i(),this.$iApi.event.on("map/created",i,e);break;case"ramp_map_created_updates_map_attribs":i=()=>{this.$iApi.geo.map.caption.updateAttribution(yg(this.$vApp.$pinia).activeBasemapConfig?.attribution)},this.$iApi.geo.map.created&&i(),this.$iApi.event.on("map/created",i,e);break;case"ramp_map_extent_updates_maptip":i=()=>{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",PP(50,!0,()=>i()),e);break;case"ramp_map_graphichit_creates_maptip":i=r=>{this.$iApi.geo.map.maptip.generateDefaultMaptip(r)},this.$iApi.event.on("map/graphichit",i,e);break;case"ramp_map_identify_opens_identify_results":i=r=>{const n=this.$iApi.fixture.get("details");n&&n.openDetails(r.results)},this.on("map/identify",i,e);break;case"ramp_map_keydown_updates_coords":this.$iApi.event.on("map/keydown",PP(200,()=>{const r=sD(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":i=r=>{this.$iApi.geo.map.mapKeyDown(r)},this.$iApi.event.on("map/keydown",i,e);break;case"ramp_map_keyup_updates_key_handler":i=r=>{this.$iApi.geo.map.mapKeyUp(r)},this.$iApi.event.on("map/keyup",i,e);break;case"ramp_map_mouse_updates_coords":this.$iApi.event.on("map/mousemove",PP(200,r=>{const n=sD(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":i=r=>{this.$iApi.geo.map.maptip.checkAtCoord({screenX:r.screenX,screenY:r.screenY})},this.$iApi.event.on("map/mousemove",PP(200,r=>i(r)),e);break;case"ramp_map_mouseleave_removes_maptip":i=()=>{this.$iApi.geo.map.maptip.clear()},this.$iApi.event.on("map/mouseleave",i);break;case"ramp_map_resize_updates_scalebar":this.$iApi.event.on("map/resized",Z2(100,()=>this.$iApi.geo.map.caption.updateScale()),e);break;case"ramp_map_scale_updates_scalebar":this.$iApi.event.on("map/scalechanged",Z2(300,()=>this.$iApi.geo.map.caption.updateScale()),e);break;case"ramp_panel_close_updates_appbar":i=r=>{const n=mg(this.$vApp.$pinia);this.$iApi.fixture.get("appbar")&&!n.order.flat().find(s=>s===r.id)&&n.removeButton(r.id)},this.on("panel/closed",i,e);break;case"ramp_panel_open_updates_appbar":i=r=>{const n=mg(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",i,e);break;case"ramp_toggle_details":i=(r,n)=>{const s=this.$iApi.fixture.get("details");s&&s.toggleFeature(r,n)},this.$iApi.event.on("details/toggle",i,e);break;case"ramp_toggle_grid":i=(r,n)=>{const s=this.$iApi.fixture.get("grid");s&&s.toggleGrid(r.id,n)},this.$iApi.event.on("grid/toggle",i,e);break;case"ramp_toggle_help":i=r=>{const n=this.$iApi.fixture.get("help");n&&n.toggleHelp(r)},this.$iApi.event.on("help/toggle",i,e);break;case"ramp_toggle_metadata":i=(r,n)=>{const s=this.$iApi.fixture.get("metadata");s&&s.toggleMetadata(r,n)},this.$iApi.event.on("metadata/toggle",i,e);break;case"ramp_toggle_reorder":i=r=>{const n=this.$iApi.fixture.get("layer-reorder");n&&n.toggleLayerReorder(r)},this.$iApi.event.on("reorder/toggle",i,e);break;case"ramp_toggle_settings":i=(r,n)=>{const s=this.$iApi.fixture.get("settings");s&&s.toggleSettings(r,n)},this.$iApi.event.on("settings/toggle",i,e);break;case"ramp_toggle_wizard":i=r=>{const n=this.$iApi.fixture.get("wizard");n&&n.toggleWizard(r)},this.$iApi.event.on("wizard/toggle",i,e);break;default:return console.error(`Unrecognized default event handler name encountered: ${e}`),`ERROR_NOT_REGISTERED__${e}`}return e}}/*! * shared v9.2.2 * (c) 2022 kazuya kawaguchi * Released under the MIT License. - */const gOe=typeof window<"u",ovi=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",nD=t=>ovi?Symbol(t):t,avi=(t,e,i)=>lvi({l:t,k:e,s:i}),lvi=t=>JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Nm=t=>typeof t=="number"&&isFinite(t),uvi=t=>vOe(t)==="[object Date]",sD=t=>vOe(t)==="[object RegExp]",zce=t=>ja(t)&&Object.keys(t).length===0;function cvi(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}const pg=Object.assign;let tut;const mK=()=>tut||(tut=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function iut(t){return t.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const hvi=Object.prototype.hasOwnProperty;function yOe(t,e){return hvi.call(t,e)}const Yh=Array.isArray,mf=t=>typeof t=="function",os=t=>typeof t=="string",Cu=t=>typeof t=="boolean",Xh=t=>t!==null&&typeof t=="object",rut=Object.prototype.toString,vOe=t=>rut.call(t),ja=t=>vOe(t)==="[object Object]",dvi=t=>t==null?"":Yh(t)||ja(t)&&t.toString===rut?JSON.stringify(t,null,2):String(t);/*! + */const SOe=typeof window<"u",Evi=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",oD=t=>Evi?Symbol(t):t,Ivi=(t,e,i)=>Avi({l:t,k:e,s:i}),Avi=t=>JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Gm=t=>typeof t=="number"&&isFinite(t),Pvi=t=>TOe(t)==="[object Date]",aD=t=>TOe(t)==="[object RegExp]",Hce=t=>Za(t)&&Object.keys(t).length===0;function Ovi(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}const vg=Object.assign;let dut;const gK=()=>dut||(dut=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function put(t){return t.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const Rvi=Object.prototype.hasOwnProperty;function COe(t,e){return Rvi.call(t,e)}const Qh=Array.isArray,_f=t=>typeof t=="function",vs=t=>typeof t=="string",Nu=t=>typeof t=="boolean",ed=t=>t!==null&&typeof t=="object",fut=Object.prototype.toString,TOe=t=>fut.call(t),Za=t=>TOe(t)==="[object Object]",Mvi=t=>t==null?"":Qh(t)||Za(t)&&t.toString===fut?JSON.stringify(t,null,2):String(t);/*! * message-compiler v9.2.2 * (c) 2022 kazuya kawaguchi * Released under the MIT License. - */const uc={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,__EXTEND_POINT__:15};function Hce(t,e,i={}){const{domain:r,messages:n,args:s}=i,o=t,a=new SyntaxError(String(o));return a.code=t,e&&(a.location=e),a.domain=r,a}function pvi(t){throw t}function fvi(t,e,i){return{line:t,column:e,offset:i}}function _Oe(t,e,i){const r={start:t,end:e};return i!=null&&(r.source=i),r}const RP=" ",mvi="\r",gv=` -`,gvi=String.fromCharCode(8232),yvi=String.fromCharCode(8233);function vvi(t){const e=t;let i=0,r=1,n=1,s=0;const o=te=>e[te]===mvi&&e[te+1]===gv,a=te=>e[te]===gv,l=te=>e[te]===yvi,c=te=>e[te]===gvi,d=te=>o(te)||a(te)||l(te)||c(te),p=()=>i,y=()=>r,v=()=>n,S=()=>s,I=te=>o(te)||l(te)||c(te)?gv:e[te],O=()=>I(i),L=()=>I(i+s);function N(){return s=0,d(i)&&(r++,n=0),o(i)&&i++,i++,n++,e[i]}function G(){return o(i+s)&&s++,s++,e[i+s]}function V(){i=0,r=1,n=1,s=0}function Y(te=0){s=te}function X(){const te=i+s;for(;te!==i;)N();s=0}return{index:p,line:y,column:v,peekOffset:S,charAt:I,currentChar:O,currentPeek:L,next:N,peek:G,reset:V,resetPeek:Y,skipToPeek:X}}const oD=void 0,nut="'",_vi="tokenizer";function bvi(t,e={}){const i=e.location!==!1,r=vvi(t),n=()=>r.index(),s=()=>fvi(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:""},c=()=>l,{onError:d}=e;function p(Ee,Be,mt,...kt){const ct=c();if(Be.column+=mt,Be.offset+=mt,d){const le=_Oe(ct.startLoc,Be),it=Hce(Ee,le,{domain:_vi,args:kt});d(it)}}function y(Ee,Be,mt){Ee.endLoc=s(),Ee.currentType=Be;const kt={type:Be};return i&&(kt.loc=_Oe(Ee.startLoc,Ee.endLoc)),mt!=null&&(kt.value=mt),kt}const v=Ee=>y(Ee,14);function S(Ee,Be){return Ee.currentChar()===Be?(Ee.next(),Be):(p(uc.EXPECTED_TOKEN,s(),0,Be),"")}function I(Ee){let Be="";for(;Ee.currentPeek()===RP||Ee.currentPeek()===gv;)Be+=Ee.currentPeek(),Ee.peek();return Be}function O(Ee){const Be=I(Ee);return Ee.skipToPeek(),Be}function L(Ee){if(Ee===oD)return!1;const Be=Ee.charCodeAt(0);return Be>=97&&Be<=122||Be>=65&&Be<=90||Be===95}function N(Ee){if(Ee===oD)return!1;const Be=Ee.charCodeAt(0);return Be>=48&&Be<=57}function G(Ee,Be){const{currentType:mt}=Be;if(mt!==2)return!1;I(Ee);const kt=L(Ee.currentPeek());return Ee.resetPeek(),kt}function V(Ee,Be){const{currentType:mt}=Be;if(mt!==2)return!1;I(Ee);const kt=Ee.currentPeek()==="-"?Ee.peek():Ee.currentPeek(),ct=N(kt);return Ee.resetPeek(),ct}function Y(Ee,Be){const{currentType:mt}=Be;if(mt!==2)return!1;I(Ee);const kt=Ee.currentPeek()===nut;return Ee.resetPeek(),kt}function X(Ee,Be){const{currentType:mt}=Be;if(mt!==8)return!1;I(Ee);const kt=Ee.currentPeek()===".";return Ee.resetPeek(),kt}function te(Ee,Be){const{currentType:mt}=Be;if(mt!==9)return!1;I(Ee);const kt=L(Ee.currentPeek());return Ee.resetPeek(),kt}function re(Ee,Be){const{currentType:mt}=Be;if(!(mt===8||mt===12))return!1;I(Ee);const kt=Ee.currentPeek()===":";return Ee.resetPeek(),kt}function fe(Ee,Be){const{currentType:mt}=Be;if(mt!==10)return!1;const kt=()=>{const le=Ee.currentPeek();return le==="{"?L(Ee.peek()):le==="@"||le==="%"||le==="|"||le===":"||le==="."||le===RP||!le?!1:le===gv?(Ee.peek(),kt()):L(le)},ct=kt();return Ee.resetPeek(),ct}function ge(Ee){I(Ee);const Be=Ee.currentPeek()==="|";return Ee.resetPeek(),Be}function _e(Ee){const Be=I(Ee),mt=Ee.currentPeek()==="%"&&Ee.peek()==="{";return Ee.resetPeek(),{isModulo:mt,hasSpace:Be.length>0}}function Ie(Ee,Be=!0){const mt=(ct=!1,le="",it=!1)=>{const pt=Ee.currentPeek();return pt==="{"?le==="%"?!1:ct:pt==="@"||!pt?le==="%"?!0:ct:pt==="%"?(Ee.peek(),mt(ct,"%",!0)):pt==="|"?le==="%"||it?!0:!(le===RP||le===gv):pt===RP?(Ee.peek(),mt(!0,RP,it)):pt===gv?(Ee.peek(),mt(!0,gv,it)):!0},kt=mt();return Be&&Ee.resetPeek(),kt}function ke(Ee,Be){const mt=Ee.currentChar();return mt===oD?oD:Be(mt)?(Ee.next(),mt):null}function Ne(Ee){return ke(Ee,mt=>{const kt=mt.charCodeAt(0);return kt>=97&&kt<=122||kt>=65&&kt<=90||kt>=48&&kt<=57||kt===95||kt===36})}function J(Ee){return ke(Ee,mt=>{const kt=mt.charCodeAt(0);return kt>=48&&kt<=57})}function he(Ee){return ke(Ee,mt=>{const kt=mt.charCodeAt(0);return kt>=48&&kt<=57||kt>=65&&kt<=70||kt>=97&&kt<=102})}function xe(Ee){let Be="",mt="";for(;Be=J(Ee);)mt+=Be;return mt}function Pe(Ee){O(Ee);const Be=Ee.currentChar();return Be!=="%"&&p(uc.EXPECTED_TOKEN,s(),0,Be),Ee.next(),"%"}function Oe(Ee){let Be="";for(;;){const mt=Ee.currentChar();if(mt==="{"||mt==="}"||mt==="@"||mt==="|"||!mt)break;if(mt==="%")if(Ie(Ee))Be+=mt,Ee.next();else break;else if(mt===RP||mt===gv)if(Ie(Ee))Be+=mt,Ee.next();else{if(ge(Ee))break;Be+=mt,Ee.next()}else Be+=mt,Ee.next()}return Be}function Ae(Ee){O(Ee);let Be="",mt="";for(;Be=Ne(Ee);)mt+=Be;return Ee.currentChar()===oD&&p(uc.UNTERMINATED_CLOSING_BRACE,s(),0),mt}function ze(Ee){O(Ee);let Be="";return Ee.currentChar()==="-"?(Ee.next(),Be+=`-${xe(Ee)}`):Be+=xe(Ee),Ee.currentChar()===oD&&p(uc.UNTERMINATED_CLOSING_BRACE,s(),0),Be}function Ge(Ee){O(Ee),S(Ee,"'");let Be="",mt="";const kt=le=>le!==nut&&le!==gv;for(;Be=ke(Ee,kt);)Be==="\\"?mt+=Je(Ee):mt+=Be;const ct=Ee.currentChar();return ct===gv||ct===oD?(p(uc.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),ct===gv&&(Ee.next(),S(Ee,"'")),mt):(S(Ee,"'"),mt)}function Je(Ee){const Be=Ee.currentChar();switch(Be){case"\\":case"'":return Ee.next(),`\\${Be}`;case"u":return et(Ee,Be,4);case"U":return et(Ee,Be,6);default:return p(uc.UNKNOWN_ESCAPE_SEQUENCE,s(),0,Be),""}}function et(Ee,Be,mt){S(Ee,Be);let kt="";for(let ct=0;ctct!=="{"&&ct!=="}"&&ct!==RP&&ct!==gv;for(;Be=ke(Ee,kt);)mt+=Be;return mt}function ft(Ee){let Be="",mt="";for(;Be=Ne(Ee);)mt+=Be;return mt}function Pt(Ee){const Be=(mt=!1,kt)=>{const ct=Ee.currentChar();return ct==="{"||ct==="%"||ct==="@"||ct==="|"||!ct||ct===RP?kt:ct===gv?(kt+=ct,Ee.next(),Be(mt,kt)):(kt+=ct,Ee.next(),Be(!0,kt))};return Be(!1,"")}function $t(Ee){O(Ee);const Be=S(Ee,"|");return O(Ee),Be}function St(Ee,Be){let mt=null;switch(Ee.currentChar()){case"{":return Be.braceNest>=1&&p(uc.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),Ee.next(),mt=y(Be,2,"{"),O(Ee),Be.braceNest++,mt;case"}":return Be.braceNest>0&&Be.currentType===2&&p(uc.EMPTY_PLACEHOLDER,s(),0),Ee.next(),mt=y(Be,3,"}"),Be.braceNest--,Be.braceNest>0&&O(Ee),Be.inLinked&&Be.braceNest===0&&(Be.inLinked=!1),mt;case"@":return Be.braceNest>0&&p(uc.UNTERMINATED_CLOSING_BRACE,s(),0),mt=Tt(Ee,Be)||v(Be),Be.braceNest=0,mt;default:let ct=!0,le=!0,it=!0;if(ge(Ee))return Be.braceNest>0&&p(uc.UNTERMINATED_CLOSING_BRACE,s(),0),mt=y(Be,1,$t(Ee)),Be.braceNest=0,Be.inLinked=!1,mt;if(Be.braceNest>0&&(Be.currentType===5||Be.currentType===6||Be.currentType===7))return p(uc.UNTERMINATED_CLOSING_BRACE,s(),0),Be.braceNest=0,Lt(Ee,Be);if(ct=G(Ee,Be))return mt=y(Be,5,Ae(Ee)),O(Ee),mt;if(le=V(Ee,Be))return mt=y(Be,6,ze(Ee)),O(Ee),mt;if(it=Y(Ee,Be))return mt=y(Be,7,Ge(Ee)),O(Ee),mt;if(!ct&&!le&&!it)return mt=y(Be,13,tt(Ee)),p(uc.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,mt.value),O(Ee),mt;break}return mt}function Tt(Ee,Be){const{currentType:mt}=Be;let kt=null;const ct=Ee.currentChar();switch((mt===8||mt===9||mt===12||mt===10)&&(ct===gv||ct===RP)&&p(uc.INVALID_LINKED_FORMAT,s(),0),ct){case"@":return Ee.next(),kt=y(Be,8,"@"),Be.inLinked=!0,kt;case".":return O(Ee),Ee.next(),y(Be,9,".");case":":return O(Ee),Ee.next(),y(Be,10,":");default:return ge(Ee)?(kt=y(Be,1,$t(Ee)),Be.braceNest=0,Be.inLinked=!1,kt):X(Ee,Be)||re(Ee,Be)?(O(Ee),Tt(Ee,Be)):te(Ee,Be)?(O(Ee),y(Be,12,ft(Ee))):fe(Ee,Be)?(O(Ee),ct==="{"?St(Ee,Be)||kt:y(Be,11,Pt(Ee))):(mt===8&&p(uc.INVALID_LINKED_FORMAT,s(),0),Be.braceNest=0,Be.inLinked=!1,Lt(Ee,Be))}}function Lt(Ee,Be){let mt={type:14};if(Be.braceNest>0)return St(Ee,Be)||v(Be);if(Be.inLinked)return Tt(Ee,Be)||v(Be);switch(Ee.currentChar()){case"{":return St(Ee,Be)||v(Be);case"}":return p(uc.UNBALANCED_CLOSING_BRACE,s(),0),Ee.next(),y(Be,3,"}");case"@":return Tt(Ee,Be)||v(Be);default:if(ge(Ee))return mt=y(Be,1,$t(Ee)),Be.braceNest=0,Be.inLinked=!1,mt;const{isModulo:ct,hasSpace:le}=_e(Ee);if(ct)return le?y(Be,0,Oe(Ee)):y(Be,4,Pe(Ee));if(Ie(Ee))return y(Be,0,Oe(Ee));break}return mt}function at(){const{currentType:Ee,offset:Be,startLoc:mt,endLoc:kt}=l;return l.lastType=Ee,l.lastOffset=Be,l.lastStartLoc=mt,l.lastEndLoc=kt,l.offset=n(),l.startLoc=s(),r.currentChar()===oD?y(l,14):Lt(r,l)}return{nextToken:at,currentOffset:n,currentPosition:s,context:c}}const wvi="parser",xvi=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function Svi(t,e,i){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||i,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function Cvi(t={}){const e=t.location!==!1,{onError:i}=t;function r(L,N,G,V,...Y){const X=L.currentPosition();if(X.offset+=V,X.column+=V,i){const te=_Oe(G,X),re=Hce(N,te,{domain:wvi,args:Y});i(re)}}function n(L,N,G){const V={type:L,start:N,end:N};return e&&(V.loc={start:G,end:G}),V}function s(L,N,G,V){L.end=N,V&&(L.type=V),e&&L.loc&&(L.loc.end=G)}function o(L,N){const G=L.context(),V=n(3,G.offset,G.startLoc);return V.value=N,s(V,L.currentOffset(),L.currentPosition()),V}function a(L,N){const G=L.context(),{lastOffset:V,lastStartLoc:Y}=G,X=n(5,V,Y);return X.index=parseInt(N,10),L.nextToken(),s(X,L.currentOffset(),L.currentPosition()),X}function l(L,N){const G=L.context(),{lastOffset:V,lastStartLoc:Y}=G,X=n(4,V,Y);return X.key=N,L.nextToken(),s(X,L.currentOffset(),L.currentPosition()),X}function c(L,N){const G=L.context(),{lastOffset:V,lastStartLoc:Y}=G,X=n(9,V,Y);return X.value=N.replace(xvi,Svi),L.nextToken(),s(X,L.currentOffset(),L.currentPosition()),X}function d(L){const N=L.nextToken(),G=L.context(),{lastOffset:V,lastStartLoc:Y}=G,X=n(8,V,Y);return N.type!==12?(r(L,uc.UNEXPECTED_EMPTY_LINKED_MODIFIER,G.lastStartLoc,0),X.value="",s(X,V,Y),{nextConsumeToken:N,node:X}):(N.value==null&&r(L,uc.UNEXPECTED_LEXICAL_ANALYSIS,G.lastStartLoc,0,VT(N)),X.value=N.value||"",s(X,L.currentOffset(),L.currentPosition()),{node:X})}function p(L,N){const G=L.context(),V=n(7,G.offset,G.startLoc);return V.value=N,s(V,L.currentOffset(),L.currentPosition()),V}function y(L){const N=L.context(),G=n(6,N.offset,N.startLoc);let V=L.nextToken();if(V.type===9){const Y=d(L);G.modifier=Y.node,V=Y.nextConsumeToken||L.nextToken()}switch(V.type!==10&&r(L,uc.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,VT(V)),V=L.nextToken(),V.type===2&&(V=L.nextToken()),V.type){case 11:V.value==null&&r(L,uc.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,VT(V)),G.key=p(L,V.value||"");break;case 5:V.value==null&&r(L,uc.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,VT(V)),G.key=l(L,V.value||"");break;case 6:V.value==null&&r(L,uc.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,VT(V)),G.key=a(L,V.value||"");break;case 7:V.value==null&&r(L,uc.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,VT(V)),G.key=c(L,V.value||"");break;default:r(L,uc.UNEXPECTED_EMPTY_LINKED_KEY,N.lastStartLoc,0);const Y=L.context(),X=n(7,Y.offset,Y.startLoc);return X.value="",s(X,Y.offset,Y.startLoc),G.key=X,s(G,Y.offset,Y.startLoc),{nextConsumeToken:V,node:G}}return s(G,L.currentOffset(),L.currentPosition()),{node:G}}function v(L){const N=L.context(),G=N.currentType===1?L.currentOffset():N.offset,V=N.currentType===1?N.endLoc:N.startLoc,Y=n(2,G,V);Y.items=[];let X=null;do{const fe=X||L.nextToken();switch(X=null,fe.type){case 0:fe.value==null&&r(L,uc.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,VT(fe)),Y.items.push(o(L,fe.value||""));break;case 6:fe.value==null&&r(L,uc.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,VT(fe)),Y.items.push(a(L,fe.value||""));break;case 5:fe.value==null&&r(L,uc.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,VT(fe)),Y.items.push(l(L,fe.value||""));break;case 7:fe.value==null&&r(L,uc.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,VT(fe)),Y.items.push(c(L,fe.value||""));break;case 8:const ge=y(L);Y.items.push(ge.node),X=ge.nextConsumeToken||null;break}}while(N.currentType!==14&&N.currentType!==1);const te=N.currentType===1?N.lastOffset:L.currentOffset(),re=N.currentType===1?N.lastEndLoc:L.currentPosition();return s(Y,te,re),Y}function S(L,N,G,V){const Y=L.context();let X=V.items.length===0;const te=n(1,N,G);te.cases=[],te.cases.push(V);do{const re=v(L);X||(X=re.items.length===0),te.cases.push(re)}while(Y.currentType!==14);return X&&r(L,uc.MUST_HAVE_MESSAGES_IN_PLURAL,G,0),s(te,L.currentOffset(),L.currentPosition()),te}function I(L){const N=L.context(),{offset:G,startLoc:V}=N,Y=v(L);return N.currentType===14?Y:S(L,G,V,Y)}function O(L){const N=bvi(L,pg({},t)),G=N.context(),V=n(0,G.offset,G.startLoc);return e&&V.loc&&(V.loc.source=L),V.body=I(N),G.currentType!==14&&r(N,uc.UNEXPECTED_LEXICAL_ANALYSIS,G.lastStartLoc,0,L[G.offset]||""),s(V,N.currentOffset(),N.currentPosition()),V}return{parse:O}}function VT(t){if(t.type===14)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function Tvi(t,e={}){const i={ast:t,helpers:new Set};return{context:()=>i,helper:s=>(i.helpers.add(s),s)}}function sut(t,e){for(let i=0;io;function l(I,O){o.code+=I}function c(I,O=!0){const L=O?n:"";l(s?L+" ".repeat(I):L)}function d(I=!0){const O=++o.indentLevel;I&&c(O)}function p(I=!0){const O=--o.indentLevel;I&&c(O)}function y(){c(o.indentLevel)}return{context:a,push:l,indent:d,deindent:p,newline:y,helper:I=>`_${I}`,needIndent:()=>o.needIndent}}function Avi(t,e){const{helper:i}=t;t.push(`${i("linked")}(`),nV(t,e.key),e.modifier?(t.push(", "),nV(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function Pvi(t,e){const{helper:i,needIndent:r}=t;t.push(`${i("normalize")}([`),t.indent(r());const n=e.items.length;for(let s=0;s1){t.push(`${i("plural")}([`),t.indent(r());const n=e.cases.length;for(let s=0;s{const i=os(e.mode)?e.mode:"normal",r=os(e.filename)?e.filename:"message.intl",n=!!e.sourceMap,s=e.breakLineCode!=null?e.breakLineCode:i==="arrow"?";":` -`,o=e.needIndent?e.needIndent:i!=="arrow",a=t.helpers||[],l=Ivi(t,{mode:i,filename:r,sourceMap:n,breakLineCode:s,needIndent:o});l.push(i==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(o),a.length>0&&(l.push(`const { ${a.map(p=>`${p}: _${p}`).join(", ")} } = ctx`),l.newline()),l.push("return "),nV(l,t),l.deindent(o),l.push("}");const{code:c,map:d}=l.context();return{ast:t,code:c,map:d?d.toJSON():void 0}};function Dvi(t,e={}){const i=pg({},e),n=Cvi(i).parse(t);return Evi(n,i),Mvi(n,i)}/*! + */const gc={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,__EXTEND_POINT__:15};function Wce(t,e,i={}){const{domain:r,messages:n,args:s}=i,o=t,a=new SyntaxError(String(o));return a.code=t,e&&(a.location=e),a.domain=r,a}function Dvi(t){throw t}function Fvi(t,e,i){return{line:t,column:e,offset:i}}function EOe(t,e,i){const r={start:t,end:e};return i!=null&&(r.source=i),r}const RP=" ",Lvi="\r",vv=` +`,Nvi=String.fromCharCode(8232),kvi=String.fromCharCode(8233);function $vi(t){const e=t;let i=0,r=1,n=1,s=0;const o=Z=>e[Z]===Lvi&&e[Z+1]===vv,a=Z=>e[Z]===vv,l=Z=>e[Z]===kvi,c=Z=>e[Z]===Nvi,h=Z=>o(Z)||a(Z)||l(Z)||c(Z),p=()=>i,y=()=>r,v=()=>n,x=()=>s,I=Z=>o(Z)||l(Z)||c(Z)?vv:e[Z],P=()=>I(i),F=()=>I(i+s);function k(){return s=0,h(i)&&(r++,n=0),o(i)&&i++,i++,n++,e[i]}function j(){return o(i+s)&&s++,s++,e[i+s]}function V(){i=0,r=1,n=1,s=0}function Y(Z=0){s=Z}function X(){const Z=i+s;for(;Z!==i;)k();s=0}return{index:p,line:y,column:v,peekOffset:x,charAt:I,currentChar:P,currentPeek:F,next:k,peek:j,reset:V,resetPeek:Y,skipToPeek:X}}const lD=void 0,mut="'",Bvi="tokenizer";function Vvi(t,e={}){const i=e.location!==!1,r=$vi(t),n=()=>r.index(),s=()=>Fvi(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:""},c=()=>l,{onError:h}=e;function p(Te,je,pt,...kt){const ct=c();if(je.column+=pt,je.offset+=pt,h){const ae=EOe(ct.startLoc,je),ht=Wce(Te,ae,{domain:Bvi,args:kt});h(ht)}}function y(Te,je,pt){Te.endLoc=s(),Te.currentType=je;const kt={type:je};return i&&(kt.loc=EOe(Te.startLoc,Te.endLoc)),pt!=null&&(kt.value=pt),kt}const v=Te=>y(Te,14);function x(Te,je){return Te.currentChar()===je?(Te.next(),je):(p(gc.EXPECTED_TOKEN,s(),0,je),"")}function I(Te){let je="";for(;Te.currentPeek()===RP||Te.currentPeek()===vv;)je+=Te.currentPeek(),Te.peek();return je}function P(Te){const je=I(Te);return Te.skipToPeek(),je}function F(Te){if(Te===lD)return!1;const je=Te.charCodeAt(0);return je>=97&&je<=122||je>=65&&je<=90||je===95}function k(Te){if(Te===lD)return!1;const je=Te.charCodeAt(0);return je>=48&&je<=57}function j(Te,je){const{currentType:pt}=je;if(pt!==2)return!1;I(Te);const kt=F(Te.currentPeek());return Te.resetPeek(),kt}function V(Te,je){const{currentType:pt}=je;if(pt!==2)return!1;I(Te);const kt=Te.currentPeek()==="-"?Te.peek():Te.currentPeek(),ct=k(kt);return Te.resetPeek(),ct}function Y(Te,je){const{currentType:pt}=je;if(pt!==2)return!1;I(Te);const kt=Te.currentPeek()===mut;return Te.resetPeek(),kt}function X(Te,je){const{currentType:pt}=je;if(pt!==8)return!1;I(Te);const kt=Te.currentPeek()===".";return Te.resetPeek(),kt}function Z(Te,je){const{currentType:pt}=je;if(pt!==9)return!1;I(Te);const kt=F(Te.currentPeek());return Te.resetPeek(),kt}function ie(Te,je){const{currentType:pt}=je;if(!(pt===8||pt===12))return!1;I(Te);const kt=Te.currentPeek()===":";return Te.resetPeek(),kt}function ce(Te,je){const{currentType:pt}=je;if(pt!==10)return!1;const kt=()=>{const ae=Te.currentPeek();return ae==="{"?F(Te.peek()):ae==="@"||ae==="%"||ae==="|"||ae===":"||ae==="."||ae===RP||!ae?!1:ae===vv?(Te.peek(),kt()):F(ae)},ct=kt();return Te.resetPeek(),ct}function he(Te){I(Te);const je=Te.currentPeek()==="|";return Te.resetPeek(),je}function _e(Te){const je=I(Te),pt=Te.currentPeek()==="%"&&Te.peek()==="{";return Te.resetPeek(),{isModulo:pt,hasSpace:je.length>0}}function xe(Te,je=!0){const pt=(ct=!1,ae="",ht=!1)=>{const wt=Te.currentPeek();return wt==="{"?ae==="%"?!1:ct:wt==="@"||!wt?ae==="%"?!0:ct:wt==="%"?(Te.peek(),pt(ct,"%",!0)):wt==="|"?ae==="%"||ht?!0:!(ae===RP||ae===vv):wt===RP?(Te.peek(),pt(!0,RP,ht)):wt===vv?(Te.peek(),pt(!0,vv,ht)):!0},kt=pt();return je&&Te.resetPeek(),kt}function Pe(Te,je){const pt=Te.currentChar();return pt===lD?lD:je(pt)?(Te.next(),pt):null}function ke(Te){return Pe(Te,pt=>{const kt=pt.charCodeAt(0);return kt>=97&&kt<=122||kt>=65&&kt<=90||kt>=48&&kt<=57||kt===95||kt===36})}function J(Te){return Pe(Te,pt=>{const kt=pt.charCodeAt(0);return kt>=48&&kt<=57})}function de(Te){return Pe(Te,pt=>{const kt=pt.charCodeAt(0);return kt>=48&&kt<=57||kt>=65&&kt<=70||kt>=97&&kt<=102})}function Se(Te){let je="",pt="";for(;je=J(Te);)pt+=je;return pt}function Ie(Te){P(Te);const je=Te.currentChar();return je!=="%"&&p(gc.EXPECTED_TOKEN,s(),0,je),Te.next(),"%"}function Re(Te){let je="";for(;;){const pt=Te.currentChar();if(pt==="{"||pt==="}"||pt==="@"||pt==="|"||!pt)break;if(pt==="%")if(xe(Te))je+=pt,Te.next();else break;else if(pt===RP||pt===vv)if(xe(Te))je+=pt,Te.next();else{if(he(Te))break;je+=pt,Te.next()}else je+=pt,Te.next()}return je}function Oe(Te){P(Te);let je="",pt="";for(;je=ke(Te);)pt+=je;return Te.currentChar()===lD&&p(gc.UNTERMINATED_CLOSING_BRACE,s(),0),pt}function Ge(Te){P(Te);let je="";return Te.currentChar()==="-"?(Te.next(),je+=`-${Se(Te)}`):je+=Se(Te),Te.currentChar()===lD&&p(gc.UNTERMINATED_CLOSING_BRACE,s(),0),je}function Be(Te){P(Te),x(Te,"'");let je="",pt="";const kt=ae=>ae!==mut&&ae!==vv;for(;je=Pe(Te,kt);)je==="\\"?pt+=qe(Te):pt+=je;const ct=Te.currentChar();return ct===vv||ct===lD?(p(gc.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),ct===vv&&(Te.next(),x(Te,"'")),pt):(x(Te,"'"),pt)}function qe(Te){const je=Te.currentChar();switch(je){case"\\":case"'":return Te.next(),`\\${je}`;case"u":return et(Te,je,4);case"U":return et(Te,je,6);default:return p(gc.UNKNOWN_ESCAPE_SEQUENCE,s(),0,je),""}}function et(Te,je,pt){x(Te,je);let kt="";for(let ct=0;ctct!=="{"&&ct!=="}"&&ct!==RP&&ct!==vv;for(;je=Pe(Te,kt);)pt+=je;return pt}function mt(Te){let je="",pt="";for(;je=ke(Te);)pt+=je;return pt}function Pt(Te){const je=(pt=!1,kt)=>{const ct=Te.currentChar();return ct==="{"||ct==="%"||ct==="@"||ct==="|"||!ct||ct===RP?kt:ct===vv?(kt+=ct,Te.next(),je(pt,kt)):(kt+=ct,Te.next(),je(!0,kt))};return je(!1,"")}function $t(Te){P(Te);const je=x(Te,"|");return P(Te),je}function Ct(Te,je){let pt=null;switch(Te.currentChar()){case"{":return je.braceNest>=1&&p(gc.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),Te.next(),pt=y(je,2,"{"),P(Te),je.braceNest++,pt;case"}":return je.braceNest>0&&je.currentType===2&&p(gc.EMPTY_PLACEHOLDER,s(),0),Te.next(),pt=y(je,3,"}"),je.braceNest--,je.braceNest>0&&P(Te),je.inLinked&&je.braceNest===0&&(je.inLinked=!1),pt;case"@":return je.braceNest>0&&p(gc.UNTERMINATED_CLOSING_BRACE,s(),0),pt=Et(Te,je)||v(je),je.braceNest=0,pt;default:let ct=!0,ae=!0,ht=!0;if(he(Te))return je.braceNest>0&&p(gc.UNTERMINATED_CLOSING_BRACE,s(),0),pt=y(je,1,$t(Te)),je.braceNest=0,je.inLinked=!1,pt;if(je.braceNest>0&&(je.currentType===5||je.currentType===6||je.currentType===7))return p(gc.UNTERMINATED_CLOSING_BRACE,s(),0),je.braceNest=0,Ft(Te,je);if(ct=j(Te,je))return pt=y(je,5,Oe(Te)),P(Te),pt;if(ae=V(Te,je))return pt=y(je,6,Ge(Te)),P(Te),pt;if(ht=Y(Te,je))return pt=y(je,7,Be(Te)),P(Te),pt;if(!ct&&!ae&&!ht)return pt=y(je,13,Ze(Te)),p(gc.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,pt.value),P(Te),pt;break}return pt}function Et(Te,je){const{currentType:pt}=je;let kt=null;const ct=Te.currentChar();switch((pt===8||pt===9||pt===12||pt===10)&&(ct===vv||ct===RP)&&p(gc.INVALID_LINKED_FORMAT,s(),0),ct){case"@":return Te.next(),kt=y(je,8,"@"),je.inLinked=!0,kt;case".":return P(Te),Te.next(),y(je,9,".");case":":return P(Te),Te.next(),y(je,10,":");default:return he(Te)?(kt=y(je,1,$t(Te)),je.braceNest=0,je.inLinked=!1,kt):X(Te,je)||ie(Te,je)?(P(Te),Et(Te,je)):Z(Te,je)?(P(Te),y(je,12,mt(Te))):ce(Te,je)?(P(Te),ct==="{"?Ct(Te,je)||kt:y(je,11,Pt(Te))):(pt===8&&p(gc.INVALID_LINKED_FORMAT,s(),0),je.braceNest=0,je.inLinked=!1,Ft(Te,je))}}function Ft(Te,je){let pt={type:14};if(je.braceNest>0)return Ct(Te,je)||v(je);if(je.inLinked)return Et(Te,je)||v(je);switch(Te.currentChar()){case"{":return Ct(Te,je)||v(je);case"}":return p(gc.UNBALANCED_CLOSING_BRACE,s(),0),Te.next(),y(je,3,"}");case"@":return Et(Te,je)||v(je);default:if(he(Te))return pt=y(je,1,$t(Te)),je.braceNest=0,je.inLinked=!1,pt;const{isModulo:ct,hasSpace:ae}=_e(Te);if(ct)return ae?y(je,0,Re(Te)):y(je,4,Ie(Te));if(xe(Te))return y(je,0,Re(Te));break}return pt}function ot(){const{currentType:Te,offset:je,startLoc:pt,endLoc:kt}=l;return l.lastType=Te,l.lastOffset=je,l.lastStartLoc=pt,l.lastEndLoc=kt,l.offset=n(),l.startLoc=s(),r.currentChar()===lD?y(l,14):Ft(r,l)}return{nextToken:ot,currentOffset:n,currentPosition:s,context:c}}const jvi="parser",Gvi=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function Uvi(t,e,i){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||i,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function zvi(t={}){const e=t.location!==!1,{onError:i}=t;function r(F,k,j,V,...Y){const X=F.currentPosition();if(X.offset+=V,X.column+=V,i){const Z=EOe(j,X),ie=Wce(k,Z,{domain:jvi,args:Y});i(ie)}}function n(F,k,j){const V={type:F,start:k,end:k};return e&&(V.loc={start:j,end:j}),V}function s(F,k,j,V){F.end=k,V&&(F.type=V),e&&F.loc&&(F.loc.end=j)}function o(F,k){const j=F.context(),V=n(3,j.offset,j.startLoc);return V.value=k,s(V,F.currentOffset(),F.currentPosition()),V}function a(F,k){const j=F.context(),{lastOffset:V,lastStartLoc:Y}=j,X=n(5,V,Y);return X.index=parseInt(k,10),F.nextToken(),s(X,F.currentOffset(),F.currentPosition()),X}function l(F,k){const j=F.context(),{lastOffset:V,lastStartLoc:Y}=j,X=n(4,V,Y);return X.key=k,F.nextToken(),s(X,F.currentOffset(),F.currentPosition()),X}function c(F,k){const j=F.context(),{lastOffset:V,lastStartLoc:Y}=j,X=n(9,V,Y);return X.value=k.replace(Gvi,Uvi),F.nextToken(),s(X,F.currentOffset(),F.currentPosition()),X}function h(F){const k=F.nextToken(),j=F.context(),{lastOffset:V,lastStartLoc:Y}=j,X=n(8,V,Y);return k.type!==12?(r(F,gc.UNEXPECTED_EMPTY_LINKED_MODIFIER,j.lastStartLoc,0),X.value="",s(X,V,Y),{nextConsumeToken:k,node:X}):(k.value==null&&r(F,gc.UNEXPECTED_LEXICAL_ANALYSIS,j.lastStartLoc,0,VT(k)),X.value=k.value||"",s(X,F.currentOffset(),F.currentPosition()),{node:X})}function p(F,k){const j=F.context(),V=n(7,j.offset,j.startLoc);return V.value=k,s(V,F.currentOffset(),F.currentPosition()),V}function y(F){const k=F.context(),j=n(6,k.offset,k.startLoc);let V=F.nextToken();if(V.type===9){const Y=h(F);j.modifier=Y.node,V=Y.nextConsumeToken||F.nextToken()}switch(V.type!==10&&r(F,gc.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,VT(V)),V=F.nextToken(),V.type===2&&(V=F.nextToken()),V.type){case 11:V.value==null&&r(F,gc.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,VT(V)),j.key=p(F,V.value||"");break;case 5:V.value==null&&r(F,gc.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,VT(V)),j.key=l(F,V.value||"");break;case 6:V.value==null&&r(F,gc.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,VT(V)),j.key=a(F,V.value||"");break;case 7:V.value==null&&r(F,gc.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,VT(V)),j.key=c(F,V.value||"");break;default:r(F,gc.UNEXPECTED_EMPTY_LINKED_KEY,k.lastStartLoc,0);const Y=F.context(),X=n(7,Y.offset,Y.startLoc);return X.value="",s(X,Y.offset,Y.startLoc),j.key=X,s(j,Y.offset,Y.startLoc),{nextConsumeToken:V,node:j}}return s(j,F.currentOffset(),F.currentPosition()),{node:j}}function v(F){const k=F.context(),j=k.currentType===1?F.currentOffset():k.offset,V=k.currentType===1?k.endLoc:k.startLoc,Y=n(2,j,V);Y.items=[];let X=null;do{const ce=X||F.nextToken();switch(X=null,ce.type){case 0:ce.value==null&&r(F,gc.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,VT(ce)),Y.items.push(o(F,ce.value||""));break;case 6:ce.value==null&&r(F,gc.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,VT(ce)),Y.items.push(a(F,ce.value||""));break;case 5:ce.value==null&&r(F,gc.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,VT(ce)),Y.items.push(l(F,ce.value||""));break;case 7:ce.value==null&&r(F,gc.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,VT(ce)),Y.items.push(c(F,ce.value||""));break;case 8:const he=y(F);Y.items.push(he.node),X=he.nextConsumeToken||null;break}}while(k.currentType!==14&&k.currentType!==1);const Z=k.currentType===1?k.lastOffset:F.currentOffset(),ie=k.currentType===1?k.lastEndLoc:F.currentPosition();return s(Y,Z,ie),Y}function x(F,k,j,V){const Y=F.context();let X=V.items.length===0;const Z=n(1,k,j);Z.cases=[],Z.cases.push(V);do{const ie=v(F);X||(X=ie.items.length===0),Z.cases.push(ie)}while(Y.currentType!==14);return X&&r(F,gc.MUST_HAVE_MESSAGES_IN_PLURAL,j,0),s(Z,F.currentOffset(),F.currentPosition()),Z}function I(F){const k=F.context(),{offset:j,startLoc:V}=k,Y=v(F);return k.currentType===14?Y:x(F,j,V,Y)}function P(F){const k=Vvi(F,vg({},t)),j=k.context(),V=n(0,j.offset,j.startLoc);return e&&V.loc&&(V.loc.source=F),V.body=I(k),j.currentType!==14&&r(k,gc.UNEXPECTED_LEXICAL_ANALYSIS,j.lastStartLoc,0,F[j.offset]||""),s(V,k.currentOffset(),k.currentPosition()),V}return{parse:P}}function VT(t){if(t.type===14)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function Hvi(t,e={}){const i={ast:t,helpers:new Set};return{context:()=>i,helper:s=>(i.helpers.add(s),s)}}function gut(t,e){for(let i=0;io;function l(I,P){o.code+=I}function c(I,P=!0){const F=P?n:"";l(s?F+" ".repeat(I):F)}function h(I=!0){const P=++o.indentLevel;I&&c(P)}function p(I=!0){const P=--o.indentLevel;I&&c(P)}function y(){c(o.indentLevel)}return{context:a,push:l,indent:h,deindent:p,newline:y,helper:I=>`_${I}`,needIndent:()=>o.needIndent}}function Yvi(t,e){const{helper:i}=t;t.push(`${i("linked")}(`),ij(t,e.key),e.modifier?(t.push(", "),ij(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function Xvi(t,e){const{helper:i,needIndent:r}=t;t.push(`${i("normalize")}([`),t.indent(r());const n=e.items.length;for(let s=0;s1){t.push(`${i("plural")}([`),t.indent(r());const n=e.cases.length;for(let s=0;s{const i=vs(e.mode)?e.mode:"normal",r=vs(e.filename)?e.filename:"message.intl",n=!!e.sourceMap,s=e.breakLineCode!=null?e.breakLineCode:i==="arrow"?";":` +`,o=e.needIndent?e.needIndent:i!=="arrow",a=t.helpers||[],l=qvi(t,{mode:i,filename:r,sourceMap:n,breakLineCode:s,needIndent:o});l.push(i==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(o),a.length>0&&(l.push(`const { ${a.map(p=>`${p}: _${p}`).join(", ")} } = ctx`),l.newline()),l.push("return "),ij(l,t),l.deindent(o),l.push("}");const{code:c,map:h}=l.context();return{ast:t,code:c,map:h?h.toJSON():void 0}};function Qvi(t,e={}){const i=vg({},e),n=zvi(i).parse(t);return Wvi(n,i),Zvi(n,i)}/*! * devtools-if v9.2.2 * (c) 2022 kazuya kawaguchi * Released under the MIT License. - */const out={I18nInit:"i18n:init",FunctionTranslate:"function:translate"};/*! + */const yut={I18nInit:"i18n:init",FunctionTranslate:"function:translate"};/*! * core-base v9.2.2 * (c) 2022 kazuya kawaguchi * Released under the MIT License. - */const aD=[];aD[0]={w:[0],i:[3,0],["["]:[4],o:[7]},aD[1]={w:[1],["."]:[2],["["]:[4],o:[7]},aD[2]={w:[2],i:[3,0],[0]:[3,0]},aD[3]={i:[3,0],[0]:[3,0],w:[1,1],["."]:[2,1],["["]:[4,1],o:[7,1]},aD[4]={["'"]:[5,0],['"']:[6,0],["["]:[4,2],["]"]:[1,3],o:8,l:[4,0]},aD[5]={["'"]:[4,0],o:8,l:[5,0]},aD[6]={['"']:[4,0],o:8,l:[6,0]};const Fvi=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Lvi(t){return Fvi.test(t)}function kvi(t){const e=t.charCodeAt(0),i=t.charCodeAt(t.length-1);return e===i&&(e===34||e===39)?t.slice(1,-1):t}function Nvi(t){if(t==null)return"o";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;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 $vi(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:Lvi(e)?kvi(e):"*"+e}function Bvi(t){const e=[];let i=-1,r=0,n=0,s,o,a,l,c,d,p;const y=[];y[0]=()=>{o===void 0?o=a:o+=a},y[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},y[2]=()=>{y[0](),n++},y[3]=()=>{if(n>0)n--,r=4,y[0]();else{if(n=0,o===void 0||(o=$vi(o),o===!1))return!1;y[1]()}};function v(){const S=t[i+1];if(r===5&&S==="'"||r===6&&S==='"')return i++,a="\\"+S,y[0](),!0}for(;r!==null;)if(i++,s=t[i],!(s==="\\"&&v())){if(l=Nvi(s),p=aD[r],c=p[l]||p.l||8,c===8||(r=c[0],c[1]!==void 0&&(d=y[c[1]],d&&(a=s,d()===!1))))return;if(r===7)return e}}const aut=new Map;function Gvi(t,e){return Xh(t)?t[e]:null}function Vvi(t,e){if(!Xh(t))return null;let i=aut.get(e);if(i||(i=Bvi(e),i&&aut.set(e,i)),!i)return null;const r=i.length;let n=t,s=0;for(;st,jvi=t=>"",zvi="text",Hvi=t=>t.length===0?"":t.join(""),Wvi=dvi;function lut(t,e){return t=Math.abs(t),e===2?t?t>1?1:0:1:t?Math.min(t,2):0}function qvi(t){const e=Nm(t.pluralIndex)?t.pluralIndex:-1;return t.named&&(Nm(t.named.count)||Nm(t.named.n))?Nm(t.named.count)?t.named.count:Nm(t.named.n)?t.named.n:e:e}function Yvi(t,e){e.count||(e.count=t),e.n||(e.n=t)}function Xvi(t={}){const e=t.locale,i=qvi(t),r=Xh(t.pluralRules)&&os(e)&&mf(t.pluralRules[e])?t.pluralRules[e]:lut,n=Xh(t.pluralRules)&&os(e)&&mf(t.pluralRules[e])?lut:void 0,s=L=>L[r(i,L.length,n)],o=t.list||[],a=L=>o[L],l=t.named||{};Nm(t.pluralIndex)&&Yvi(i,l);const c=L=>l[L];function d(L){const N=mf(t.messages)?t.messages(L):Xh(t.messages)?t.messages[L]:!1;return N||(t.parent?t.parent.message(L):jvi)}const p=L=>t.modifiers?t.modifiers[L]:Uvi,y=ja(t.processor)&&mf(t.processor.normalize)?t.processor.normalize:Hvi,v=ja(t.processor)&&mf(t.processor.interpolate)?t.processor.interpolate:Wvi,S=ja(t.processor)&&os(t.processor.type)?t.processor.type:zvi,O={list:a,named:c,plural:s,linked:(L,...N)=>{const[G,V]=N;let Y="text",X="";N.length===1?Xh(G)?(X=G.modifier||X,Y=G.type||Y):os(G)&&(X=G||X):N.length===2&&(os(G)&&(X=G||X),os(V)&&(Y=V||Y));let te=d(L)(O);return Y==="vnode"&&Yh(te)&&X&&(te=te[0]),X?p(X)(te,Y):te},message:d,type:S,interpolate:v,normalize:y};return O}let gK=null;function Kvi(t){gK=t}function Jvi(t,e,i){gK&&gK.emit(out.I18nInit,{timestamp:Date.now(),i18n:t,version:e,meta:i})}const Zvi=Qvi(out.FunctionTranslate);function Qvi(t){return e=>gK&&gK.emit(t,e)}function e_i(t,e,i){return[...new Set([i,...Yh(e)?e:Xh(e)?Object.keys(e):os(e)?[e]:[i]])]}function uut(t,e,i){const r=os(i)?i:yK,n=t;n.__localeChainCache||(n.__localeChainCache=new Map);let s=n.__localeChainCache.get(r);if(!s){s=[];let o=[i];for(;Yh(o);)o=cut(s,o,e);const a=Yh(e)||!ja(e)?e:e.default?e.default:null;o=os(a)?[a]:a,Yh(o)&&cut(s,o,!1),n.__localeChainCache.set(r,s)}return s}function cut(t,e,i){let r=!0;for(let n=0;n`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function n_i(){return{upper:(t,e)=>e==="text"&&os(t)?t.toUpperCase():e==="vnode"&&Xh(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&os(t)?t.toLowerCase():e==="vnode"&&Xh(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&os(t)?dut(t):e==="vnode"&&Xh(t)&&"__v_isVNode"in t?dut(t.children):t}}let put;function s_i(t){put=t}let fut;function o_i(t){fut=t}let mut;function a_i(t){mut=t}let gut=null;const yut=t=>{gut=t},l_i=()=>gut;let vut=null;const _ut=t=>{vut=t},u_i=()=>vut;let but=0;function c_i(t={}){const e=os(t.version)?t.version:r_i,i=os(t.locale)?t.locale:yK,r=Yh(t.fallbackLocale)||ja(t.fallbackLocale)||os(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:i,n=ja(t.messages)?t.messages:{[i]:{}},s=ja(t.datetimeFormats)?t.datetimeFormats:{[i]:{}},o=ja(t.numberFormats)?t.numberFormats:{[i]:{}},a=pg({},t.modifiers||{},n_i()),l=t.pluralRules||{},c=mf(t.missing)?t.missing:null,d=Cu(t.missingWarn)||sD(t.missingWarn)?t.missingWarn:!0,p=Cu(t.fallbackWarn)||sD(t.fallbackWarn)?t.fallbackWarn:!0,y=!!t.fallbackFormat,v=!!t.unresolving,S=mf(t.postTranslation)?t.postTranslation:null,I=ja(t.processor)?t.processor:null,O=Cu(t.warnHtmlMessage)?t.warnHtmlMessage:!0,L=!!t.escapeParameter,N=mf(t.messageCompiler)?t.messageCompiler:put,G=mf(t.messageResolver)?t.messageResolver:fut||Gvi,V=mf(t.localeFallbacker)?t.localeFallbacker:mut||e_i,Y=Xh(t.fallbackContext)?t.fallbackContext:void 0,X=mf(t.onWarn)?t.onWarn:cvi,te=t,re=Xh(te.__datetimeFormatters)?te.__datetimeFormatters:new Map,fe=Xh(te.__numberFormatters)?te.__numberFormatters:new Map,ge=Xh(te.__meta)?te.__meta:{};but++;const _e={version:e,cid:but,locale:i,fallbackLocale:r,messages:n,modifiers:a,pluralRules:l,missing:c,missingWarn:d,fallbackWarn:p,fallbackFormat:y,unresolving:v,postTranslation:S,processor:I,warnHtmlMessage:O,escapeParameter:L,messageCompiler:N,messageResolver:G,localeFallbacker:V,fallbackContext:Y,onWarn:X,__meta:ge};return _e.datetimeFormats=s,_e.numberFormats=o,_e.__datetimeFormatters=re,_e.__numberFormatters=fe,__INTLIFY_PROD_DEVTOOLS__&&Jvi(_e,e,ge),_e}function wOe(t,e,i,r,n){const{missing:s,onWarn:o}=t;if(s!==null){const a=s(t,i,e,n);return os(a)?a:e}else return e}function vK(t,e,i){const r=t;r.__localeChainCache=new Map,t.localeFallbacker(t,i,e)}const h_i=t=>t;let wut=Object.create(null);function d_i(t,e={}){{const r=(e.onCacheKey||h_i)(t),n=wut[r];if(n)return n;let s=!1;const o=e.onError||pvi;e.onError=c=>{s=!0,o(c)};const{code:a}=Dvi(t,e),l=new Function(`return ${a}`)();return s?l:wut[r]=l}}let xut=uc.__EXTEND_POINT__;const xOe=()=>++xut,sV={INVALID_ARGUMENT:xut,INVALID_DATE_ARGUMENT:xOe(),INVALID_ISO_DATE_ARGUMENT:xOe(),__EXTEND_POINT__:xOe()};function oV(t){return Hce(t,null,void 0)}const Sut=()=>"",UT=t=>mf(t);function Cut(t,...e){const{fallbackFormat:i,postTranslation:r,unresolving:n,messageCompiler:s,fallbackLocale:o,messages:a}=t,[l,c]=SOe(...e),d=Cu(c.missingWarn)?c.missingWarn:t.missingWarn,p=Cu(c.fallbackWarn)?c.fallbackWarn:t.fallbackWarn,y=Cu(c.escapeParameter)?c.escapeParameter:t.escapeParameter,v=!!c.resolvedMessage,S=os(c.default)||Cu(c.default)?Cu(c.default)?s?l:()=>l:c.default:i?s?l:()=>l:"",I=i||S!=="",O=os(c.locale)?c.locale:t.locale;y&&p_i(c);let[L,N,G]=v?[l,O,a[O]||{}]:Tut(t,l,O,o,p,d),V=L,Y=l;if(!v&&!(os(V)||UT(V))&&I&&(V=S,Y=V),!v&&(!(os(V)||UT(V))||!os(N)))return n?Wce:l;let X=!1;const te=()=>{X=!0},re=UT(V)?V:Eut(t,l,N,V,Y,te);if(X)return V;const fe=g_i(t,N,G,c),ge=Xvi(fe),_e=f_i(t,re,ge),Ie=r?r(_e,l):_e;if(__INTLIFY_PROD_DEVTOOLS__){const ke={timestamp:Date.now(),key:os(l)?l:UT(V)?V.key:"",locale:N||(UT(V)?V.locale:""),format:os(V)?V:UT(V)?V.source:"",message:Ie};ke.meta=pg({},t.__meta,l_i()||{}),Zvi(ke)}return Ie}function p_i(t){Yh(t.list)?t.list=t.list.map(e=>os(e)?iut(e):e):Xh(t.named)&&Object.keys(t.named).forEach(e=>{os(t.named[e])&&(t.named[e]=iut(t.named[e]))})}function Tut(t,e,i,r,n,s){const{messages:o,onWarn:a,messageResolver:l,localeFallbacker:c}=t,d=c(t,r,i);let p={},y,v=null;const S="translate";for(let I=0;Ir;return c.locale=i,c.key=e,c}const l=o(r,m_i(t,i,n,r,a,s));return l.locale=i,l.key=e,l.source=r,l}function f_i(t,e,i){return e(i)}function SOe(...t){const[e,i,r]=t,n={};if(!os(e)&&!Nm(e)&&!UT(e))throw oV(sV.INVALID_ARGUMENT);const s=Nm(e)?String(e):(UT(e),e);return Nm(i)?n.plural=i:os(i)?n.default=i:ja(i)&&!zce(i)?n.named=i:Yh(i)&&(n.list=i),Nm(r)?n.plural=r:os(r)?n.default=r:ja(r)&&pg(n,r),[s,n]}function m_i(t,e,i,r,n,s){return{warnHtmlMessage:n,onError:o=>{throw s&&s(o),o},onCacheKey:o=>avi(e,i,o)}}function g_i(t,e,i,r){const{modifiers:n,pluralRules:s,messageResolver:o,fallbackLocale:a,fallbackWarn:l,missingWarn:c,fallbackContext:d}=t,y={locale:e,modifiers:n,pluralRules:s,messages:v=>{let S=o(i,v);if(S==null&&d){const[,,I]=Tut(d,v,e,a,l,c);S=o(I,v)}if(os(S)){let I=!1;const L=Eut(t,v,e,S,v,()=>{I=!0});return I?Sut:L}else return UT(S)?S:Sut}};return t.processor&&(y.processor=t.processor),r.list&&(y.list=r.list),r.named&&(y.named=r.named),Nm(r.plural)&&(y.pluralIndex=r.plural),y}function Iut(t,...e){const{datetimeFormats:i,unresolving:r,fallbackLocale:n,onWarn:s,localeFallbacker:o}=t,{__datetimeFormatters:a}=t,[l,c,d,p]=COe(...e),y=Cu(d.missingWarn)?d.missingWarn:t.missingWarn;Cu(d.fallbackWarn)?d.fallbackWarn:t.fallbackWarn;const v=!!d.part,S=os(d.locale)?d.locale:t.locale,I=o(t,n,S);if(!os(l)||l==="")return new Intl.DateTimeFormat(S,p).format(c);let O={},L,N=null;const G="datetime format";for(let X=0;X{Aut.includes(l)?o[l]=i[l]:s[l]=i[l]}),os(r)?s.locale=r:ja(r)&&(o=r),ja(n)&&(o=n),[s.key||"",a,s,o]}function Put(t,e,i){const r=t;for(const n in i){const s=`${e}__${n}`;r.__datetimeFormatters.has(s)&&r.__datetimeFormatters.delete(s)}}function Out(t,...e){const{numberFormats:i,unresolving:r,fallbackLocale:n,onWarn:s,localeFallbacker:o}=t,{__numberFormatters:a}=t,[l,c,d,p]=TOe(...e),y=Cu(d.missingWarn)?d.missingWarn:t.missingWarn;Cu(d.fallbackWarn)?d.fallbackWarn:t.fallbackWarn;const v=!!d.part,S=os(d.locale)?d.locale:t.locale,I=o(t,n,S);if(!os(l)||l==="")return new Intl.NumberFormat(S,p).format(c);let O={},L,N=null;const G="number format";for(let X=0;X{Rut.includes(l)?o[l]=i[l]:s[l]=i[l]}),os(r)?s.locale=r:ja(r)&&(o=r),ja(n)&&(o=n),[s.key||"",a,s,o]}function Mut(t,e,i){const r=t;for(const n in i){const s=`${e}__${n}`;r.__numberFormatters.has(s)&&r.__numberFormatters.delete(s)}}typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(mK().__INTLIFY_PROD_DEVTOOLS__=!1);/*! + */const uD=[];uD[0]={w:[0],i:[3,0],["["]:[4],o:[7]},uD[1]={w:[1],["."]:[2],["["]:[4],o:[7]},uD[2]={w:[2],i:[3,0],[0]:[3,0]},uD[3]={i:[3,0],[0]:[3,0],w:[1,1],["."]:[2,1],["["]:[4,1],o:[7,1]},uD[4]={["'"]:[5,0],['"']:[6,0],["["]:[4,2],["]"]:[1,3],o:8,l:[4,0]},uD[5]={["'"]:[4,0],o:8,l:[5,0]},uD[6]={['"']:[4,0],o:8,l:[6,0]};const e_i=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function t_i(t){return e_i.test(t)}function i_i(t){const e=t.charCodeAt(0),i=t.charCodeAt(t.length-1);return e===i&&(e===34||e===39)?t.slice(1,-1):t}function r_i(t){if(t==null)return"o";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;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 n_i(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:t_i(e)?i_i(e):"*"+e}function s_i(t){const e=[];let i=-1,r=0,n=0,s,o,a,l,c,h,p;const y=[];y[0]=()=>{o===void 0?o=a:o+=a},y[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},y[2]=()=>{y[0](),n++},y[3]=()=>{if(n>0)n--,r=4,y[0]();else{if(n=0,o===void 0||(o=n_i(o),o===!1))return!1;y[1]()}};function v(){const x=t[i+1];if(r===5&&x==="'"||r===6&&x==='"')return i++,a="\\"+x,y[0](),!0}for(;r!==null;)if(i++,s=t[i],!(s==="\\"&&v())){if(l=r_i(s),p=uD[r],c=p[l]||p.l||8,c===8||(r=c[0],c[1]!==void 0&&(h=y[c[1]],h&&(a=s,h()===!1))))return;if(r===7)return e}}const vut=new Map;function o_i(t,e){return ed(t)?t[e]:null}function a_i(t,e){if(!ed(t))return null;let i=vut.get(e);if(i||(i=s_i(e),i&&vut.set(e,i)),!i)return null;const r=i.length;let n=t,s=0;for(;st,u_i=t=>"",c_i="text",h_i=t=>t.length===0?"":t.join(""),d_i=Mvi;function _ut(t,e){return t=Math.abs(t),e===2?t?t>1?1:0:1:t?Math.min(t,2):0}function p_i(t){const e=Gm(t.pluralIndex)?t.pluralIndex:-1;return t.named&&(Gm(t.named.count)||Gm(t.named.n))?Gm(t.named.count)?t.named.count:Gm(t.named.n)?t.named.n:e:e}function f_i(t,e){e.count||(e.count=t),e.n||(e.n=t)}function m_i(t={}){const e=t.locale,i=p_i(t),r=ed(t.pluralRules)&&vs(e)&&_f(t.pluralRules[e])?t.pluralRules[e]:_ut,n=ed(t.pluralRules)&&vs(e)&&_f(t.pluralRules[e])?_ut:void 0,s=F=>F[r(i,F.length,n)],o=t.list||[],a=F=>o[F],l=t.named||{};Gm(t.pluralIndex)&&f_i(i,l);const c=F=>l[F];function h(F){const k=_f(t.messages)?t.messages(F):ed(t.messages)?t.messages[F]:!1;return k||(t.parent?t.parent.message(F):u_i)}const p=F=>t.modifiers?t.modifiers[F]:l_i,y=Za(t.processor)&&_f(t.processor.normalize)?t.processor.normalize:h_i,v=Za(t.processor)&&_f(t.processor.interpolate)?t.processor.interpolate:d_i,x=Za(t.processor)&&vs(t.processor.type)?t.processor.type:c_i,P={list:a,named:c,plural:s,linked:(F,...k)=>{const[j,V]=k;let Y="text",X="";k.length===1?ed(j)?(X=j.modifier||X,Y=j.type||Y):vs(j)&&(X=j||X):k.length===2&&(vs(j)&&(X=j||X),vs(V)&&(Y=V||Y));let Z=h(F)(P);return Y==="vnode"&&Qh(Z)&&X&&(Z=Z[0]),X?p(X)(Z,Y):Z},message:h,type:x,interpolate:v,normalize:y};return P}let yK=null;function g_i(t){yK=t}function y_i(t,e,i){yK&&yK.emit(yut.I18nInit,{timestamp:Date.now(),i18n:t,version:e,meta:i})}const v_i=__i(yut.FunctionTranslate);function __i(t){return e=>yK&&yK.emit(t,e)}function b_i(t,e,i){return[...new Set([i,...Qh(e)?e:ed(e)?Object.keys(e):vs(e)?[e]:[i]])]}function but(t,e,i){const r=vs(i)?i:vK,n=t;n.__localeChainCache||(n.__localeChainCache=new Map);let s=n.__localeChainCache.get(r);if(!s){s=[];let o=[i];for(;Qh(o);)o=wut(s,o,e);const a=Qh(e)||!Za(e)?e:e.default?e.default:null;o=vs(a)?[a]:a,Qh(o)&&wut(s,o,!1),n.__localeChainCache.set(r,s)}return s}function wut(t,e,i){let r=!0;for(let n=0;n`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function C_i(){return{upper:(t,e)=>e==="text"&&vs(t)?t.toUpperCase():e==="vnode"&&ed(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&vs(t)?t.toLowerCase():e==="vnode"&&ed(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&vs(t)?Sut(t):e==="vnode"&&ed(t)&&"__v_isVNode"in t?Sut(t.children):t}}let Cut;function T_i(t){Cut=t}let Tut;function E_i(t){Tut=t}let Eut;function I_i(t){Eut=t}let Iut=null;const Aut=t=>{Iut=t},A_i=()=>Iut;let Put=null;const Out=t=>{Put=t},P_i=()=>Put;let Rut=0;function O_i(t={}){const e=vs(t.version)?t.version:S_i,i=vs(t.locale)?t.locale:vK,r=Qh(t.fallbackLocale)||Za(t.fallbackLocale)||vs(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:i,n=Za(t.messages)?t.messages:{[i]:{}},s=Za(t.datetimeFormats)?t.datetimeFormats:{[i]:{}},o=Za(t.numberFormats)?t.numberFormats:{[i]:{}},a=vg({},t.modifiers||{},C_i()),l=t.pluralRules||{},c=_f(t.missing)?t.missing:null,h=Nu(t.missingWarn)||aD(t.missingWarn)?t.missingWarn:!0,p=Nu(t.fallbackWarn)||aD(t.fallbackWarn)?t.fallbackWarn:!0,y=!!t.fallbackFormat,v=!!t.unresolving,x=_f(t.postTranslation)?t.postTranslation:null,I=Za(t.processor)?t.processor:null,P=Nu(t.warnHtmlMessage)?t.warnHtmlMessage:!0,F=!!t.escapeParameter,k=_f(t.messageCompiler)?t.messageCompiler:Cut,j=_f(t.messageResolver)?t.messageResolver:Tut||o_i,V=_f(t.localeFallbacker)?t.localeFallbacker:Eut||b_i,Y=ed(t.fallbackContext)?t.fallbackContext:void 0,X=_f(t.onWarn)?t.onWarn:Ovi,Z=t,ie=ed(Z.__datetimeFormatters)?Z.__datetimeFormatters:new Map,ce=ed(Z.__numberFormatters)?Z.__numberFormatters:new Map,he=ed(Z.__meta)?Z.__meta:{};Rut++;const _e={version:e,cid:Rut,locale:i,fallbackLocale:r,messages:n,modifiers:a,pluralRules:l,missing:c,missingWarn:h,fallbackWarn:p,fallbackFormat:y,unresolving:v,postTranslation:x,processor:I,warnHtmlMessage:P,escapeParameter:F,messageCompiler:k,messageResolver:j,localeFallbacker:V,fallbackContext:Y,onWarn:X,__meta:he};return _e.datetimeFormats=s,_e.numberFormats=o,_e.__datetimeFormatters=ie,_e.__numberFormatters=ce,__INTLIFY_PROD_DEVTOOLS__&&y_i(_e,e,he),_e}function AOe(t,e,i,r,n){const{missing:s,onWarn:o}=t;if(s!==null){const a=s(t,i,e,n);return vs(a)?a:e}else return e}function _K(t,e,i){const r=t;r.__localeChainCache=new Map,t.localeFallbacker(t,i,e)}const R_i=t=>t;let Mut=Object.create(null);function M_i(t,e={}){{const r=(e.onCacheKey||R_i)(t),n=Mut[r];if(n)return n;let s=!1;const o=e.onError||Dvi;e.onError=c=>{s=!0,o(c)};const{code:a}=Qvi(t,e),l=new Function(`return ${a}`)();return s?l:Mut[r]=l}}let Dut=gc.__EXTEND_POINT__;const POe=()=>++Dut,rj={INVALID_ARGUMENT:Dut,INVALID_DATE_ARGUMENT:POe(),INVALID_ISO_DATE_ARGUMENT:POe(),__EXTEND_POINT__:POe()};function nj(t){return Wce(t,null,void 0)}const Fut=()=>"",jT=t=>_f(t);function Lut(t,...e){const{fallbackFormat:i,postTranslation:r,unresolving:n,messageCompiler:s,fallbackLocale:o,messages:a}=t,[l,c]=OOe(...e),h=Nu(c.missingWarn)?c.missingWarn:t.missingWarn,p=Nu(c.fallbackWarn)?c.fallbackWarn:t.fallbackWarn,y=Nu(c.escapeParameter)?c.escapeParameter:t.escapeParameter,v=!!c.resolvedMessage,x=vs(c.default)||Nu(c.default)?Nu(c.default)?s?l:()=>l:c.default:i?s?l:()=>l:"",I=i||x!=="",P=vs(c.locale)?c.locale:t.locale;y&&D_i(c);let[F,k,j]=v?[l,P,a[P]||{}]:Nut(t,l,P,o,p,h),V=F,Y=l;if(!v&&!(vs(V)||jT(V))&&I&&(V=x,Y=V),!v&&(!(vs(V)||jT(V))||!vs(k)))return n?qce:l;let X=!1;const Z=()=>{X=!0},ie=jT(V)?V:kut(t,l,k,V,Y,Z);if(X)return V;const ce=N_i(t,k,j,c),he=m_i(ce),_e=F_i(t,ie,he),xe=r?r(_e,l):_e;if(__INTLIFY_PROD_DEVTOOLS__){const Pe={timestamp:Date.now(),key:vs(l)?l:jT(V)?V.key:"",locale:k||(jT(V)?V.locale:""),format:vs(V)?V:jT(V)?V.source:"",message:xe};Pe.meta=vg({},t.__meta,A_i()||{}),v_i(Pe)}return xe}function D_i(t){Qh(t.list)?t.list=t.list.map(e=>vs(e)?put(e):e):ed(t.named)&&Object.keys(t.named).forEach(e=>{vs(t.named[e])&&(t.named[e]=put(t.named[e]))})}function Nut(t,e,i,r,n,s){const{messages:o,onWarn:a,messageResolver:l,localeFallbacker:c}=t,h=c(t,r,i);let p={},y,v=null;const x="translate";for(let I=0;Ir;return c.locale=i,c.key=e,c}const l=o(r,L_i(t,i,n,r,a,s));return l.locale=i,l.key=e,l.source=r,l}function F_i(t,e,i){return e(i)}function OOe(...t){const[e,i,r]=t,n={};if(!vs(e)&&!Gm(e)&&!jT(e))throw nj(rj.INVALID_ARGUMENT);const s=Gm(e)?String(e):(jT(e),e);return Gm(i)?n.plural=i:vs(i)?n.default=i:Za(i)&&!Hce(i)?n.named=i:Qh(i)&&(n.list=i),Gm(r)?n.plural=r:vs(r)?n.default=r:Za(r)&&vg(n,r),[s,n]}function L_i(t,e,i,r,n,s){return{warnHtmlMessage:n,onError:o=>{throw s&&s(o),o},onCacheKey:o=>Ivi(e,i,o)}}function N_i(t,e,i,r){const{modifiers:n,pluralRules:s,messageResolver:o,fallbackLocale:a,fallbackWarn:l,missingWarn:c,fallbackContext:h}=t,y={locale:e,modifiers:n,pluralRules:s,messages:v=>{let x=o(i,v);if(x==null&&h){const[,,I]=Nut(h,v,e,a,l,c);x=o(I,v)}if(vs(x)){let I=!1;const F=kut(t,v,e,x,v,()=>{I=!0});return I?Fut:F}else return jT(x)?x:Fut}};return t.processor&&(y.processor=t.processor),r.list&&(y.list=r.list),r.named&&(y.named=r.named),Gm(r.plural)&&(y.pluralIndex=r.plural),y}function $ut(t,...e){const{datetimeFormats:i,unresolving:r,fallbackLocale:n,onWarn:s,localeFallbacker:o}=t,{__datetimeFormatters:a}=t,[l,c,h,p]=ROe(...e),y=Nu(h.missingWarn)?h.missingWarn:t.missingWarn;Nu(h.fallbackWarn)?h.fallbackWarn:t.fallbackWarn;const v=!!h.part,x=vs(h.locale)?h.locale:t.locale,I=o(t,n,x);if(!vs(l)||l==="")return new Intl.DateTimeFormat(x,p).format(c);let P={},F,k=null;const j="datetime format";for(let X=0;X{But.includes(l)?o[l]=i[l]:s[l]=i[l]}),vs(r)?s.locale=r:Za(r)&&(o=r),Za(n)&&(o=n),[s.key||"",a,s,o]}function Vut(t,e,i){const r=t;for(const n in i){const s=`${e}__${n}`;r.__datetimeFormatters.has(s)&&r.__datetimeFormatters.delete(s)}}function jut(t,...e){const{numberFormats:i,unresolving:r,fallbackLocale:n,onWarn:s,localeFallbacker:o}=t,{__numberFormatters:a}=t,[l,c,h,p]=MOe(...e),y=Nu(h.missingWarn)?h.missingWarn:t.missingWarn;Nu(h.fallbackWarn)?h.fallbackWarn:t.fallbackWarn;const v=!!h.part,x=vs(h.locale)?h.locale:t.locale,I=o(t,n,x);if(!vs(l)||l==="")return new Intl.NumberFormat(x,p).format(c);let P={},F,k=null;const j="number format";for(let X=0;X{Gut.includes(l)?o[l]=i[l]:s[l]=i[l]}),vs(r)?s.locale=r:Za(r)&&(o=r),Za(n)&&(o=n),[s.key||"",a,s,o]}function Uut(t,e,i){const r=t;for(const n in i){const s=`${e}__${n}`;r.__numberFormatters.has(s)&&r.__numberFormatters.delete(s)}}typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(gK().__INTLIFY_PROD_DEVTOOLS__=!1);/*! * vue-i18n v9.2.2 * (c) 2022 kazuya kawaguchi * Released under the MIT License. - */const y_i="9.2.2";function v_i(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(mK().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(mK().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(mK().__INTLIFY_PROD_DEVTOOLS__=!1)}let Dut=uc.__EXTEND_POINT__;const S_=()=>++Dut,Hf={UNEXPECTED_RETURN_TYPE:Dut,INVALID_ARGUMENT:S_(),MUST_BE_CALL_SETUP_TOP:S_(),NOT_INSLALLED:S_(),NOT_AVAILABLE_IN_LEGACY_MODE:S_(),REQUIRED_VALUE:S_(),INVALID_VALUE:S_(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:S_(),NOT_INSLALLED_WITH_PROVIDE:S_(),UNEXPECTED_ERROR:S_(),NOT_COMPATIBLE_LEGACY_VUE_I18N:S_(),BRIDGE_SUPPORT_VUE_2_ONLY:S_(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:S_(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:S_(),__EXTEND_POINT__:S_()};function $m(t,...e){return Hce(t,null,void 0)}const EOe=nD("__transrateVNode"),IOe=nD("__datetimeParts"),AOe=nD("__numberParts"),Fut=nD("__setPluralRules");nD("__intlifyMeta");const Lut=nD("__injectWithOption");function POe(t){if(!Xh(t))return t;for(const e in t)if(yOe(t,e))if(!e.includes("."))Xh(t[e])&&POe(t[e]);else{const i=e.split("."),r=i.length-1;let n=t;for(let s=0;s{if("locale"in a&&"resource"in a){const{locale:l,resource:c}=a;l?(o[l]=o[l]||{},_K(c,o[l])):_K(c,o)}else os(a)&&_K(JSON.parse(a),o)}),n==null&&s)for(const a in o)yOe(o,a)&&POe(o[a]);return o}const Yce=t=>!Xh(t)||Yh(t);function _K(t,e){if(Yce(t)||Yce(e))throw $m(Hf.INVALID_VALUE);for(const i in t)yOe(t,i)&&(Yce(t[i])||Yce(e[i])?e[i]=t[i]:_K(t[i],e[i]))}function kut(t){return t.type}function Nut(t,e,i){let r=Xh(e.messages)?e.messages:{};"__i18nGlobal"in i&&(r=qce(t.locale.value,{messages:r,__i18n:i.__i18nGlobal}));const n=Object.keys(r);n.length&&n.forEach(s=>{t.mergeLocaleMessage(s,r[s])});{if(Xh(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(o=>{t.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(Xh(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(o=>{t.mergeNumberFormat(o,e.numberFormats[o])})}}}function $ut(t){return Rn(EP,null,t,0)}const But="__INTLIFY_META__";let Gut=0;function Vut(t){return(e,i,r,n)=>t(i,r,ff()||void 0,n)}const __i=()=>{const t=ff();let e=null;return t&&(e=kut(t)[But])?{[But]:e}:null};function OOe(t={},e){const{__root:i}=t,r=i===void 0;let n=Cu(t.inheritLocale)?t.inheritLocale:!0;const s=Pi(i&&n?i.locale.value:os(t.locale)?t.locale:yK),o=Pi(i&&n?i.fallbackLocale.value:os(t.fallbackLocale)||Yh(t.fallbackLocale)||ja(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:s.value),a=Pi(qce(s.value,t)),l=Pi(ja(t.datetimeFormats)?t.datetimeFormats:{[s.value]:{}}),c=Pi(ja(t.numberFormats)?t.numberFormats:{[s.value]:{}});let d=i?i.missingWarn:Cu(t.missingWarn)||sD(t.missingWarn)?t.missingWarn:!0,p=i?i.fallbackWarn:Cu(t.fallbackWarn)||sD(t.fallbackWarn)?t.fallbackWarn:!0,y=i?i.fallbackRoot:Cu(t.fallbackRoot)?t.fallbackRoot:!0,v=!!t.fallbackFormat,S=mf(t.missing)?t.missing:null,I=mf(t.missing)?Vut(t.missing):null,O=mf(t.postTranslation)?t.postTranslation:null,L=i?i.warnHtmlMessage:Cu(t.warnHtmlMessage)?t.warnHtmlMessage:!0,N=!!t.escapeParameter;const G=i?i.modifiers:ja(t.modifiers)?t.modifiers:{};let V=t.pluralRules||i&&i.pluralRules,Y;Y=(()=>{r&&_ut(null);const ce={version:y_i,locale:s.value,fallbackLocale:o.value,messages:a.value,modifiers:G,pluralRules:V,missing:I===null?void 0:I,missingWarn:d,fallbackWarn:p,fallbackFormat:v,unresolving:!0,postTranslation:O===null?void 0:O,warnHtmlMessage:L,escapeParameter:N,messageResolver:t.messageResolver,__meta:{framework:"vue"}};ce.datetimeFormats=l.value,ce.numberFormats=c.value,ce.__datetimeFormatters=ja(Y)?Y.__datetimeFormatters:void 0,ce.__numberFormatters=ja(Y)?Y.__numberFormatters:void 0;const Ce=c_i(ce);return r&&_ut(Ce),Ce})(),vK(Y,s.value,o.value);function te(){return[s.value,o.value,a.value,l.value,c.value]}const re=Vr({get:()=>s.value,set:ce=>{s.value=ce,Y.locale=s.value}}),fe=Vr({get:()=>o.value,set:ce=>{o.value=ce,Y.fallbackLocale=o.value,vK(Y,s.value,ce)}}),ge=Vr(()=>a.value),_e=Vr(()=>l.value),Ie=Vr(()=>c.value);function ke(){return mf(O)?O:null}function Ne(ce){O=ce,Y.postTranslation=ce}function J(){return S}function he(ce){ce!==null&&(I=Vut(ce)),S=ce,Y.missing=I}const xe=(ce,Ce,Ze,yt,Ve,At)=>{te();let ii;if(__INTLIFY_PROD_DEVTOOLS__)try{yut(__i()),r||(Y.fallbackContext=i?u_i():void 0),ii=ce(Y)}finally{yut(null),r||(Y.fallbackContext=void 0)}else ii=ce(Y);if(Nm(ii)&&ii===Wce){const[gt,Ue]=Ce();return i&&y?yt(i):Ve(gt)}else{if(At(ii))return ii;throw $m(Hf.UNEXPECTED_RETURN_TYPE)}};function Pe(...ce){return xe(Ce=>Reflect.apply(Cut,null,[Ce,...ce]),()=>SOe(...ce),"translate",Ce=>Reflect.apply(Ce.t,Ce,[...ce]),Ce=>Ce,Ce=>os(Ce))}function Oe(...ce){const[Ce,Ze,yt]=ce;if(yt&&!Xh(yt))throw $m(Hf.INVALID_ARGUMENT);return Pe(Ce,Ze,pg({resolvedMessage:!0},yt||{}))}function Ae(...ce){return xe(Ce=>Reflect.apply(Iut,null,[Ce,...ce]),()=>COe(...ce),"datetime format",Ce=>Reflect.apply(Ce.d,Ce,[...ce]),()=>hut,Ce=>os(Ce))}function ze(...ce){return xe(Ce=>Reflect.apply(Out,null,[Ce,...ce]),()=>TOe(...ce),"number format",Ce=>Reflect.apply(Ce.n,Ce,[...ce]),()=>hut,Ce=>os(Ce))}function Ge(ce){return ce.map(Ce=>os(Ce)||Nm(Ce)||Cu(Ce)?$ut(String(Ce)):Ce)}const et={normalize:Ge,interpolate:ce=>ce,type:"vnode"};function tt(...ce){return xe(Ce=>{let Ze;const yt=Ce;try{yt.processor=et,Ze=Reflect.apply(Cut,null,[yt,...ce])}finally{yt.processor=null}return Ze},()=>SOe(...ce),"translate",Ce=>Ce[EOe](...ce),Ce=>[$ut(Ce)],Ce=>Yh(Ce))}function ft(...ce){return xe(Ce=>Reflect.apply(Out,null,[Ce,...ce]),()=>TOe(...ce),"number format",Ce=>Ce[AOe](...ce),()=>[],Ce=>os(Ce)||Yh(Ce))}function Pt(...ce){return xe(Ce=>Reflect.apply(Iut,null,[Ce,...ce]),()=>COe(...ce),"datetime format",Ce=>Ce[IOe](...ce),()=>[],Ce=>os(Ce)||Yh(Ce))}function $t(ce){V=ce,Y.pluralRules=V}function St(ce,Ce){const Ze=os(Ce)?Ce:s.value,yt=at(Ze);return Y.messageResolver(yt,ce)!==null}function Tt(ce){let Ce=null;const Ze=uut(Y,o.value,s.value);for(let yt=0;yt{n&&(s.value=ce,Y.locale=ce,vK(Y,s.value,o.value))}),Sc(i.fallbackLocale,ce=>{n&&(o.value=ce,Y.fallbackLocale=ce,vK(Y,s.value,o.value))}));const Le={id:Gut,locale:re,fallbackLocale:fe,get inheritLocale(){return n},set inheritLocale(ce){n=ce,ce&&i&&(s.value=i.locale.value,o.value=i.fallbackLocale.value,vK(Y,s.value,o.value))},get availableLocales(){return Object.keys(a.value).sort()},messages:ge,get modifiers(){return G},get pluralRules(){return V||{}},get isGlobal(){return r},get missingWarn(){return d},set missingWarn(ce){d=ce,Y.missingWarn=d},get fallbackWarn(){return p},set fallbackWarn(ce){p=ce,Y.fallbackWarn=p},get fallbackRoot(){return y},set fallbackRoot(ce){y=ce},get fallbackFormat(){return v},set fallbackFormat(ce){v=ce,Y.fallbackFormat=v},get warnHtmlMessage(){return L},set warnHtmlMessage(ce){L=ce,Y.warnHtmlMessage=ce},get escapeParameter(){return N},set escapeParameter(ce){N=ce,Y.escapeParameter=ce},t:Pe,getLocaleMessage:at,setLocaleMessage:Ee,mergeLocaleMessage:Be,getPostTranslationHandler:ke,setPostTranslationHandler:Ne,getMissingHandler:J,setMissingHandler:he,[Fut]:$t};return Le.datetimeFormats=_e,Le.numberFormats=Ie,Le.rt=Oe,Le.te=St,Le.tm=Lt,Le.d=Ae,Le.n=ze,Le.getDateTimeFormat=mt,Le.setDateTimeFormat=kt,Le.mergeDateTimeFormat=ct,Le.getNumberFormat=le,Le.setNumberFormat=it,Le.mergeNumberFormat=pt,Le[Lut]=t.__injectWithOption,Le[EOe]=tt,Le[IOe]=Pt,Le[AOe]=ft,Le}function b_i(t){const e=os(t.locale)?t.locale:yK,i=os(t.fallbackLocale)||Yh(t.fallbackLocale)||ja(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:e,r=mf(t.missing)?t.missing:void 0,n=Cu(t.silentTranslationWarn)||sD(t.silentTranslationWarn)?!t.silentTranslationWarn:!0,s=Cu(t.silentFallbackWarn)||sD(t.silentFallbackWarn)?!t.silentFallbackWarn:!0,o=Cu(t.fallbackRoot)?t.fallbackRoot:!0,a=!!t.formatFallbackMessages,l=ja(t.modifiers)?t.modifiers:{},c=t.pluralizationRules,d=mf(t.postTranslation)?t.postTranslation:void 0,p=os(t.warnHtmlInMessage)?t.warnHtmlInMessage!=="off":!0,y=!!t.escapeParameterHtml,v=Cu(t.sync)?t.sync:!0;let S=t.messages;if(ja(t.sharedMessages)){const Y=t.sharedMessages;S=Object.keys(Y).reduce((te,re)=>{const fe=te[re]||(te[re]={});return pg(fe,Y[re]),te},S||{})}const{__i18n:I,__root:O,__injectWithOption:L}=t,N=t.datetimeFormats,G=t.numberFormats,V=t.flatJson;return{locale:e,fallbackLocale:i,messages:S,flatJson:V,datetimeFormats:N,numberFormats:G,missing:r,missingWarn:n,fallbackWarn:s,fallbackRoot:o,fallbackFormat:a,modifiers:l,pluralRules:c,postTranslation:d,warnHtmlMessage:p,escapeParameter:y,messageResolver:t.messageResolver,inheritLocale:v,__i18n:I,__root:O,__injectWithOption:L}}function ROe(t={},e){{const i=OOe(b_i(t)),r={id:i.id,get locale(){return i.locale.value},set locale(n){i.locale.value=n},get fallbackLocale(){return i.fallbackLocale.value},set fallbackLocale(n){i.fallbackLocale.value=n},get messages(){return i.messages.value},get datetimeFormats(){return i.datetimeFormats.value},get numberFormats(){return i.numberFormats.value},get availableLocales(){return i.availableLocales},get formatter(){return{interpolate(){return[]}}},set formatter(n){},get missing(){return i.getMissingHandler()},set missing(n){i.setMissingHandler(n)},get silentTranslationWarn(){return Cu(i.missingWarn)?!i.missingWarn:i.missingWarn},set silentTranslationWarn(n){i.missingWarn=Cu(n)?!n:n},get silentFallbackWarn(){return Cu(i.fallbackWarn)?!i.fallbackWarn:i.fallbackWarn},set silentFallbackWarn(n){i.fallbackWarn=Cu(n)?!n:n},get modifiers(){return i.modifiers},get formatFallbackMessages(){return i.fallbackFormat},set formatFallbackMessages(n){i.fallbackFormat=n},get postTranslation(){return i.getPostTranslationHandler()},set postTranslation(n){i.setPostTranslationHandler(n)},get sync(){return i.inheritLocale},set sync(n){i.inheritLocale=n},get warnHtmlInMessage(){return i.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(n){i.warnHtmlMessage=n!=="off"},get escapeParameterHtml(){return i.escapeParameter},set escapeParameterHtml(n){i.escapeParameter=n},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(n){},get pluralizationRules(){return i.pluralRules||{}},__composer:i,t(...n){const[s,o,a]=n,l={};let c=null,d=null;if(!os(s))throw $m(Hf.INVALID_ARGUMENT);const p=s;return os(o)?l.locale=o:Yh(o)?c=o:ja(o)&&(d=o),Yh(a)?c=a:ja(a)&&(d=a),Reflect.apply(i.t,i,[p,c||d||{},l])},rt(...n){return Reflect.apply(i.rt,i,[...n])},tc(...n){const[s,o,a]=n,l={plural:1};let c=null,d=null;if(!os(s))throw $m(Hf.INVALID_ARGUMENT);const p=s;return os(o)?l.locale=o:Nm(o)?l.plural=o:Yh(o)?c=o:ja(o)&&(d=o),os(a)?l.locale=a:Yh(a)?c=a:ja(a)&&(d=a),Reflect.apply(i.t,i,[p,c||d||{},l])},te(n,s){return i.te(n,s)},tm(n){return i.tm(n)},getLocaleMessage(n){return i.getLocaleMessage(n)},setLocaleMessage(n,s){i.setLocaleMessage(n,s)},mergeLocaleMessage(n,s){i.mergeLocaleMessage(n,s)},d(...n){return Reflect.apply(i.d,i,[...n])},getDateTimeFormat(n){return i.getDateTimeFormat(n)},setDateTimeFormat(n,s){i.setDateTimeFormat(n,s)},mergeDateTimeFormat(n,s){i.mergeDateTimeFormat(n,s)},n(...n){return Reflect.apply(i.n,i,[...n])},getNumberFormat(n){return i.getNumberFormat(n)},setNumberFormat(n,s){i.setNumberFormat(n,s)},mergeNumberFormat(n,s){i.mergeNumberFormat(n,s)},getChoiceIndex(n,s){return-1},__onComponentInstanceCreated(n){const{componentInstanceCreatedListener:s}=t;s&&s(n,r)}};return r}}const MOe={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function w_i({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,n)=>r=[...r,...Yh(n.children)?n.children:[n]],[]):e.reduce((i,r)=>{const n=t[r];return n&&(i[r]=n()),i},{})}function Uut(t){return eo}const jut={name:"i18n-t",props:pg({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Nm(t)||!isNaN(t)}},MOe),setup(t,e){const{slots:i,attrs:r}=e,n=t.i18n||qn({useScope:t.scope,__useComponent:!0});return()=>{const s=Object.keys(i).filter(p=>p!=="_"),o={};t.locale&&(o.locale=t.locale),t.plural!==void 0&&(o.plural=os(t.plural)?+t.plural:t.plural);const a=w_i(e,s),l=n[EOe](t.keypath,a,o),c=pg({},r),d=os(t.tag)||Xh(t.tag)?t.tag:Uut();return X2(d,c,l)}}};function x_i(t){return Yh(t)&&!os(t[0])}function zut(t,e,i,r){const{slots:n,attrs:s}=e;return()=>{const o={part:!0};let a={};t.locale&&(o.locale=t.locale),os(t.format)?o.key=t.format:Xh(t.format)&&(os(t.format.key)&&(o.key=t.format.key),a=Object.keys(t.format).reduce((y,v)=>i.includes(v)?pg({},y,{[v]:t.format[v]}):y,{}));const l=r(t.value,o,a);let c=[o.key];Yh(l)?c=l.map((y,v)=>{const S=n[y.type],I=S?S({[y.type]:y.value,index:v,parts:l}):[y.value];return x_i(I)&&(I[0].key=`${y.type}-${v}`),I}):os(l)&&(c=[l]);const d=pg({},s),p=os(t.tag)||Xh(t.tag)?t.tag:Uut();return X2(p,d,c)}}const Hut={name:"i18n-n",props:pg({value:{type:Number,required:!0},format:{type:[String,Object]}},MOe),setup(t,e){const i=t.i18n||qn({useScope:"parent",__useComponent:!0});return zut(t,e,Rut,(...r)=>i[AOe](...r))}},Wut={name:"i18n-d",props:pg({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},MOe),setup(t,e){const i=t.i18n||qn({useScope:"parent",__useComponent:!0});return zut(t,e,Aut,(...r)=>i[IOe](...r))}};function S_i(t,e){const i=t;if(t.mode==="composition")return i.__getInstance(e)||t.global;{const r=i.__getInstance(e);return r!=null?r.__composer:t.global.__composer}}function C_i(t){const e=o=>{const{instance:a,modifiers:l,value:c}=o;if(!a||!a.$)throw $m(Hf.UNEXPECTED_ERROR);const d=S_i(t,a.$),p=qut(c);return[Reflect.apply(d.t,d,[...Yut(p)]),d]};return{created:(o,a)=>{const[l,c]=e(a);gOe&&t.global===c&&(o.__i18nWatcher=Sc(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),o.__composer=c,o.textContent=l},unmounted:o=>{gOe&&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,c=qut(a);o.textContent=Reflect.apply(l.t,l,[...Yut(c)])}},getSSRProps:o=>{const[a]=e(o);return{textContent:a}}}}function qut(t){if(os(t))return{path:t};if(ja(t)){if(!("path"in t))throw $m(Hf.REQUIRED_VALUE,"path");return t}else throw $m(Hf.INVALID_VALUE)}function Yut(t){const{path:e,locale:i,args:r,choice:n,plural:s}=t,o={},a=r||{};return os(i)&&(o.locale=i),Nm(n)&&(o.plural=n),Nm(s)&&(o.plural=s),[e,a,o]}function T_i(t,e,...i){const r=ja(i[0])?i[0]:{},n=!!r.useI18nComponentName;(Cu(r.globalInstall)?r.globalInstall:!0)&&(t.component(n?"i18n":jut.name,jut),t.component(Hut.name,Hut),t.component(Wut.name,Wut)),t.directive("t",C_i(e))}function E_i(t,e,i){return{beforeCreate(){const r=ff();if(!r)throw $m(Hf.UNEXPECTED_ERROR);const n=this.$options;if(n.i18n){const s=n.i18n;n.__i18n&&(s.__i18n=n.__i18n),s.__root=e,this===this.$root?this.$i18n=Xut(t,s):(s.__injectWithOption=!0,this.$i18n=ROe(s))}else n.__i18n?this===this.$root?this.$i18n=Xut(t,n):this.$i18n=ROe({__i18n:n.__i18n,__injectWithOption:!0,__root:e}):this.$i18n=t;n.__i18nGlobal&&Nut(e,n,n),t.__onComponentInstanceCreated(this.$i18n),i.__setInstance(r,this.$i18n),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)},mounted(){},unmounted(){const r=ff();if(!r)throw $m(Hf.UNEXPECTED_ERROR);delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,i.__deleteInstance(r),delete this.$i18n}}}function Xut(t,e){t.locale=e.locale||t.locale,t.fallbackLocale=e.fallbackLocale||t.fallbackLocale,t.missing=e.missing||t.missing,t.silentTranslationWarn=e.silentTranslationWarn||t.silentFallbackWarn,t.silentFallbackWarn=e.silentFallbackWarn||t.silentFallbackWarn,t.formatFallbackMessages=e.formatFallbackMessages||t.formatFallbackMessages,t.postTranslation=e.postTranslation||t.postTranslation,t.warnHtmlInMessage=e.warnHtmlInMessage||t.warnHtmlInMessage,t.escapeParameterHtml=e.escapeParameterHtml||t.escapeParameterHtml,t.sync=e.sync||t.sync,t.__composer[Fut](e.pluralizationRules||t.pluralizationRules);const i=qce(t.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(i).forEach(r=>t.mergeLocaleMessage(r,i[r])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(r=>t.mergeDateTimeFormat(r,e.datetimeFormats[r])),e.numberFormats&&Object.keys(e.numberFormats).forEach(r=>t.mergeNumberFormat(r,e.numberFormats[r])),t}const I_i=nD("global-vue-i18n");function A_i(t={},e){const i=__VUE_I18N_LEGACY_API__&&Cu(t.legacy)?t.legacy:__VUE_I18N_LEGACY_API__,r=Cu(t.globalInjection)?t.globalInjection:!0,n=__VUE_I18N_LEGACY_API__&&i?!!t.allowComposition:!0,s=new Map,[o,a]=P_i(t,i),l=nD("");function c(y){return s.get(y)||null}function d(y,v){s.set(y,v)}function p(y){s.delete(y)}{const y={get mode(){return __VUE_I18N_LEGACY_API__&&i?"legacy":"composition"},get allowComposition(){return n},async install(v,...S){v.__VUE_I18N_SYMBOL__=l,v.provide(v.__VUE_I18N_SYMBOL__,y),!i&&r&&$_i(v,y.global),__VUE_I18N_FULL_INSTALL__&&T_i(v,y,...S),__VUE_I18N_LEGACY_API__&&i&&v.mixin(E_i(a,a.__composer,y));const I=v.unmount;v.unmount=()=>{y.dispose(),I()}},get global(){return a},dispose(){o.stop()},__instances:s,__getInstance:c,__setInstance:d,__deleteInstance:p};return y}}function qn(t={}){const e=ff();if(e==null)throw $m(Hf.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw $m(Hf.NOT_INSLALLED);const i=O_i(e),r=M_i(i),n=kut(e),s=R_i(t,n);if(__VUE_I18N_LEGACY_API__&&i.mode==="legacy"&&!t.__useComponent){if(!i.allowComposition)throw $m(Hf.NOT_AVAILABLE_IN_LEGACY_MODE);return L_i(e,s,r,t)}if(s==="global")return Nut(r,t,n),r;if(s==="parent"){let l=D_i(i,e,t.__useComponent);return l==null&&(l=r),l}const o=i;let a=o.__getInstance(e);if(a==null){const l=pg({},t);"__i18n"in n&&(l.__i18n=n.__i18n),r&&(l.__root=r),a=OOe(l),F_i(o,e),o.__setInstance(e,a)}return a}function P_i(t,e,i){const r=FX();{const n=__VUE_I18N_LEGACY_API__&&e?r.run(()=>ROe(t)):r.run(()=>OOe(t));if(n==null)throw $m(Hf.UNEXPECTED_ERROR);return[r,n]}}function O_i(t){{const e=Qs(t.isCE?I_i:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw $m(t.isCE?Hf.NOT_INSLALLED_WITH_PROVIDE:Hf.UNEXPECTED_ERROR);return e}}function R_i(t,e){return zce(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function M_i(t){return t.mode==="composition"?t.global:t.global.__composer}function D_i(t,e,i=!1){let r=null;const n=e.root;let s=e.parent;for(;s!=null;){const o=t;if(t.mode==="composition")r=o.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const a=o.__getInstance(s);a!=null&&(r=a.__composer,i&&r&&!r[Lut]&&(r=null))}if(r!=null||n===s)break;s=s.parent}return r}function F_i(t,e,i){al(()=>{},e),Wk(()=>{t.__deleteInstance(e)},e)}function L_i(t,e,i,r={}){const n=e==="local",s=zAe(null);if(n&&t.proxy&&!(t.proxy.$options.i18n||t.proxy.$options.__i18n))throw $m(Hf.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const o=Cu(r.inheritLocale)?r.inheritLocale:!0,a=Pi(n&&o?i.locale.value:os(r.locale)?r.locale:yK),l=Pi(n&&o?i.fallbackLocale.value:os(r.fallbackLocale)||Yh(r.fallbackLocale)||ja(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:a.value),c=Pi(qce(a.value,r)),d=Pi(ja(r.datetimeFormats)?r.datetimeFormats:{[a.value]:{}}),p=Pi(ja(r.numberFormats)?r.numberFormats:{[a.value]:{}}),y=n?i.missingWarn:Cu(r.missingWarn)||sD(r.missingWarn)?r.missingWarn:!0,v=n?i.fallbackWarn:Cu(r.fallbackWarn)||sD(r.fallbackWarn)?r.fallbackWarn:!0,S=n?i.fallbackRoot:Cu(r.fallbackRoot)?r.fallbackRoot:!0,I=!!r.fallbackFormat,O=mf(r.missing)?r.missing:null,L=mf(r.postTranslation)?r.postTranslation:null,N=n?i.warnHtmlMessage:Cu(r.warnHtmlMessage)?r.warnHtmlMessage:!0,G=!!r.escapeParameter,V=n?i.modifiers:ja(r.modifiers)?r.modifiers:{},Y=r.pluralRules||n&&i.pluralRules;function X(){return[a.value,l.value,c.value,d.value,p.value]}const te=Vr({get:()=>s.value?s.value.locale.value:a.value,set:Be=>{s.value&&(s.value.locale.value=Be),a.value=Be}}),re=Vr({get:()=>s.value?s.value.fallbackLocale.value:l.value,set:Be=>{s.value&&(s.value.fallbackLocale.value=Be),l.value=Be}}),fe=Vr(()=>s.value?s.value.messages.value:c.value),ge=Vr(()=>d.value),_e=Vr(()=>p.value);function Ie(){return s.value?s.value.getPostTranslationHandler():L}function ke(Be){s.value&&s.value.setPostTranslationHandler(Be)}function Ne(){return s.value?s.value.getMissingHandler():O}function J(Be){s.value&&s.value.setMissingHandler(Be)}function he(Be){return X(),Be()}function xe(...Be){return s.value?he(()=>Reflect.apply(s.value.t,null,[...Be])):he(()=>"")}function Pe(...Be){return s.value?Reflect.apply(s.value.rt,null,[...Be]):""}function Oe(...Be){return s.value?he(()=>Reflect.apply(s.value.d,null,[...Be])):he(()=>"")}function Ae(...Be){return s.value?he(()=>Reflect.apply(s.value.n,null,[...Be])):he(()=>"")}function ze(Be){return s.value?s.value.tm(Be):{}}function Ge(Be,mt){return s.value?s.value.te(Be,mt):!1}function Je(Be){return s.value?s.value.getLocaleMessage(Be):{}}function et(Be,mt){s.value&&(s.value.setLocaleMessage(Be,mt),c.value[Be]=mt)}function tt(Be,mt){s.value&&s.value.mergeLocaleMessage(Be,mt)}function ft(Be){return s.value?s.value.getDateTimeFormat(Be):{}}function Pt(Be,mt){s.value&&(s.value.setDateTimeFormat(Be,mt),d.value[Be]=mt)}function $t(Be,mt){s.value&&s.value.mergeDateTimeFormat(Be,mt)}function St(Be){return s.value?s.value.getNumberFormat(Be):{}}function Tt(Be,mt){s.value&&(s.value.setNumberFormat(Be,mt),p.value[Be]=mt)}function Lt(Be,mt){s.value&&s.value.mergeNumberFormat(Be,mt)}const at={get id(){return s.value?s.value.id:-1},locale:te,fallbackLocale:re,messages:fe,datetimeFormats:ge,numberFormats:_e,get inheritLocale(){return s.value?s.value.inheritLocale:o},set inheritLocale(Be){s.value&&(s.value.inheritLocale=Be)},get availableLocales(){return s.value?s.value.availableLocales:Object.keys(c.value)},get modifiers(){return s.value?s.value.modifiers:V},get pluralRules(){return s.value?s.value.pluralRules:Y},get isGlobal(){return s.value?s.value.isGlobal:!1},get missingWarn(){return s.value?s.value.missingWarn:y},set missingWarn(Be){s.value&&(s.value.missingWarn=Be)},get fallbackWarn(){return s.value?s.value.fallbackWarn:v},set fallbackWarn(Be){s.value&&(s.value.missingWarn=Be)},get fallbackRoot(){return s.value?s.value.fallbackRoot:S},set fallbackRoot(Be){s.value&&(s.value.fallbackRoot=Be)},get fallbackFormat(){return s.value?s.value.fallbackFormat:I},set fallbackFormat(Be){s.value&&(s.value.fallbackFormat=Be)},get warnHtmlMessage(){return s.value?s.value.warnHtmlMessage:N},set warnHtmlMessage(Be){s.value&&(s.value.warnHtmlMessage=Be)},get escapeParameter(){return s.value?s.value.escapeParameter:G},set escapeParameter(Be){s.value&&(s.value.escapeParameter=Be)},t:xe,getPostTranslationHandler:Ie,setPostTranslationHandler:ke,getMissingHandler:Ne,setMissingHandler:J,rt:Pe,d:Oe,n:Ae,tm:ze,te:Ge,getLocaleMessage:Je,setLocaleMessage:et,mergeLocaleMessage:tt,getDateTimeFormat:ft,setDateTimeFormat:Pt,mergeDateTimeFormat:$t,getNumberFormat:St,setNumberFormat:Tt,mergeNumberFormat:Lt};function Ee(Be){Be.locale.value=a.value,Be.fallbackLocale.value=l.value,Object.keys(c.value).forEach(mt=>{Be.mergeLocaleMessage(mt,c.value[mt])}),Object.keys(d.value).forEach(mt=>{Be.mergeDateTimeFormat(mt,d.value[mt])}),Object.keys(p.value).forEach(mt=>{Be.mergeNumberFormat(mt,p.value[mt])}),Be.escapeParameter=G,Be.fallbackFormat=I,Be.fallbackRoot=S,Be.fallbackWarn=v,Be.missingWarn=y,Be.warnHtmlMessage=N}return pv(()=>{if(t.proxy==null||t.proxy.$i18n==null)throw $m(Hf.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const Be=s.value=t.proxy.$i18n.__composer;e==="global"?(a.value=Be.locale.value,l.value=Be.fallbackLocale.value,c.value=Be.messages.value,d.value=Be.datetimeFormats.value,p.value=Be.numberFormats.value):n&&Ee(Be)}),at}const k_i=["locale","fallbackLocale","availableLocales"],N_i=["t","rt","d","n","tm"];function $_i(t,e){const i=Object.create(null);k_i.forEach(r=>{const n=Object.getOwnPropertyDescriptor(e,r);if(!n)throw $m(Hf.UNEXPECTED_ERROR);const s=lc(n.value)?{get(){return n.value.value},set(o){n.value.value=o}}:{get(){return n.get&&n.get()}};Object.defineProperty(i,r,s)}),t.config.globalProperties.$i18n=i,N_i.forEach(r=>{const n=Object.getOwnPropertyDescriptor(e,r);if(!n||!n.value)throw $m(Hf.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${r}`,n)})}if(s_i(d_i),o_i(Vvi),a_i(uut),v_i(),__INTLIFY_PROD_DEVTOOLS__){const t=mK();t.__INTLIFY__=!0,Kvi(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const B_i={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.toggleScaleUnits":"Toggle between imperial and metric 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":"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.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"},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.toggleScaleUnits":"Basculer entre les échelles métriques et impériales pour la carte","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":"Accéder à la fenêtre","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.alert.open":"Fenêtre {name} ouverte","panels.alert.close":"Fenêtre {name} fermée","panels.alert.minimize":"Fenêtre {name} réduite","layer.error":"[fr] {id} n'a pas pu être chargée","layer.longload":"Le chargement de {id} met plus de temps que prévu","layer.longdraw":"[fr] {id} prend plus longtemps que prévu pour dessiner"}},Kut="en",G_i={en:{number:{style:"decimal",useGrouping:!1,maximumFractionDigits:20}},fr:{number:{style:"decimal",useGrouping:!1,maximumFractionDigits:20}}};function V_i(){return A_i({legacy:!1,locale:document.documentElement.getAttribute("lang")||Kut,fallbackLocale:Kut,globalInjection:!0,messages:B_i,numberFormats:G_i})}var Lw={},U_i={get exports(){return Lw},set exports(t){Lw=t}};/*! + */const k_i="9.2.2";function $_i(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(gK().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(gK().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(gK().__INTLIFY_PROD_DEVTOOLS__=!1)}let zut=gc.__EXTEND_POINT__;const A_=()=>++zut,Zf={UNEXPECTED_RETURN_TYPE:zut,INVALID_ARGUMENT:A_(),MUST_BE_CALL_SETUP_TOP:A_(),NOT_INSLALLED:A_(),NOT_AVAILABLE_IN_LEGACY_MODE:A_(),REQUIRED_VALUE:A_(),INVALID_VALUE:A_(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:A_(),NOT_INSLALLED_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 Um(t,...e){return Wce(t,null,void 0)}const DOe=oD("__transrateVNode"),FOe=oD("__datetimeParts"),LOe=oD("__numberParts"),Hut=oD("__setPluralRules");oD("__intlifyMeta");const Wut=oD("__injectWithOption");function NOe(t){if(!ed(t))return t;for(const e in t)if(COe(t,e))if(!e.includes("."))ed(t[e])&&NOe(t[e]);else{const i=e.split("."),r=i.length-1;let n=t;for(let s=0;s{if("locale"in a&&"resource"in a){const{locale:l,resource:c}=a;l?(o[l]=o[l]||{},bK(c,o[l])):bK(c,o)}else vs(a)&&bK(JSON.parse(a),o)}),n==null&&s)for(const a in o)COe(o,a)&&NOe(o[a]);return o}const Xce=t=>!ed(t)||Qh(t);function bK(t,e){if(Xce(t)||Xce(e))throw Um(Zf.INVALID_VALUE);for(const i in t)COe(t,i)&&(Xce(t[i])||Xce(e[i])?e[i]=t[i]:bK(t[i],e[i]))}function qut(t){return t.type}function Yut(t,e,i){let r=ed(e.messages)?e.messages:{};"__i18nGlobal"in i&&(r=Yce(t.locale.value,{messages:r,__i18n:i.__i18nGlobal}));const n=Object.keys(r);n.length&&n.forEach(s=>{t.mergeLocaleMessage(s,r[s])});{if(ed(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(o=>{t.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(ed(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(o=>{t.mergeNumberFormat(o,e.numberFormats[o])})}}}function Xut(t){return Un(EP,null,t,0)}const Kut="__INTLIFY_META__";let Jut=0;function Zut(t){return(e,i,r,n)=>t(i,r,Up()||void 0,n)}const B_i=()=>{const t=Up();let e=null;return t&&(e=qut(t)[Kut])?{[Kut]:e}:null};function kOe(t={},e){const{__root:i}=t,r=i===void 0;let n=Nu(t.inheritLocale)?t.inheritLocale:!0;const s=Mi(i&&n?i.locale.value:vs(t.locale)?t.locale:vK),o=Mi(i&&n?i.fallbackLocale.value:vs(t.fallbackLocale)||Qh(t.fallbackLocale)||Za(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:s.value),a=Mi(Yce(s.value,t)),l=Mi(Za(t.datetimeFormats)?t.datetimeFormats:{[s.value]:{}}),c=Mi(Za(t.numberFormats)?t.numberFormats:{[s.value]:{}});let h=i?i.missingWarn:Nu(t.missingWarn)||aD(t.missingWarn)?t.missingWarn:!0,p=i?i.fallbackWarn:Nu(t.fallbackWarn)||aD(t.fallbackWarn)?t.fallbackWarn:!0,y=i?i.fallbackRoot:Nu(t.fallbackRoot)?t.fallbackRoot:!0,v=!!t.fallbackFormat,x=_f(t.missing)?t.missing:null,I=_f(t.missing)?Zut(t.missing):null,P=_f(t.postTranslation)?t.postTranslation:null,F=i?i.warnHtmlMessage:Nu(t.warnHtmlMessage)?t.warnHtmlMessage:!0,k=!!t.escapeParameter;const j=i?i.modifiers:Za(t.modifiers)?t.modifiers:{};let V=t.pluralRules||i&&i.pluralRules,Y;Y=(()=>{r&&Out(null);const pe={version:k_i,locale:s.value,fallbackLocale:o.value,messages:a.value,modifiers:j,pluralRules:V,missing:I===null?void 0:I,missingWarn:h,fallbackWarn:p,fallbackFormat:v,unresolving:!0,postTranslation:P===null?void 0:P,warnHtmlMessage:F,escapeParameter:k,messageResolver:t.messageResolver,__meta:{framework:"vue"}};pe.datetimeFormats=l.value,pe.numberFormats=c.value,pe.__datetimeFormatters=Za(Y)?Y.__datetimeFormatters:void 0,pe.__numberFormatters=Za(Y)?Y.__numberFormatters:void 0;const Ae=O_i(pe);return r&&Out(Ae),Ae})(),_K(Y,s.value,o.value);function Z(){return[s.value,o.value,a.value,l.value,c.value]}const ie=Jr({get:()=>s.value,set:pe=>{s.value=pe,Y.locale=s.value}}),ce=Jr({get:()=>o.value,set:pe=>{o.value=pe,Y.fallbackLocale=o.value,_K(Y,s.value,pe)}}),he=Jr(()=>a.value),_e=Jr(()=>l.value),xe=Jr(()=>c.value);function Pe(){return _f(P)?P:null}function ke(pe){P=pe,Y.postTranslation=pe}function J(){return x}function de(pe){pe!==null&&(I=Zut(pe)),x=pe,Y.missing=I}const Se=(pe,Ae,tt,gt,ze,Ot)=>{Z();let jt;if(__INTLIFY_PROD_DEVTOOLS__)try{Aut(B_i()),r||(Y.fallbackContext=i?P_i():void 0),jt=pe(Y)}finally{Aut(null),r||(Y.fallbackContext=void 0)}else jt=pe(Y);if(Gm(jt)&&jt===qce){const[nt,$e]=Ae();return i&&y?gt(i):ze(nt)}else{if(Ot(jt))return jt;throw Um(Zf.UNEXPECTED_RETURN_TYPE)}};function Ie(...pe){return Se(Ae=>Reflect.apply(Lut,null,[Ae,...pe]),()=>OOe(...pe),"translate",Ae=>Reflect.apply(Ae.t,Ae,[...pe]),Ae=>Ae,Ae=>vs(Ae))}function Re(...pe){const[Ae,tt,gt]=pe;if(gt&&!ed(gt))throw Um(Zf.INVALID_ARGUMENT);return Ie(Ae,tt,vg({resolvedMessage:!0},gt||{}))}function Oe(...pe){return Se(Ae=>Reflect.apply($ut,null,[Ae,...pe]),()=>ROe(...pe),"datetime format",Ae=>Reflect.apply(Ae.d,Ae,[...pe]),()=>xut,Ae=>vs(Ae))}function Ge(...pe){return Se(Ae=>Reflect.apply(jut,null,[Ae,...pe]),()=>MOe(...pe),"number format",Ae=>Reflect.apply(Ae.n,Ae,[...pe]),()=>xut,Ae=>vs(Ae))}function Be(pe){return pe.map(Ae=>vs(Ae)||Gm(Ae)||Nu(Ae)?Xut(String(Ae)):Ae)}const et={normalize:Be,interpolate:pe=>pe,type:"vnode"};function Ze(...pe){return Se(Ae=>{let tt;const gt=Ae;try{gt.processor=et,tt=Reflect.apply(Lut,null,[gt,...pe])}finally{gt.processor=null}return tt},()=>OOe(...pe),"translate",Ae=>Ae[DOe](...pe),Ae=>[Xut(Ae)],Ae=>Qh(Ae))}function mt(...pe){return Se(Ae=>Reflect.apply(jut,null,[Ae,...pe]),()=>MOe(...pe),"number format",Ae=>Ae[LOe](...pe),()=>[],Ae=>vs(Ae)||Qh(Ae))}function Pt(...pe){return Se(Ae=>Reflect.apply($ut,null,[Ae,...pe]),()=>ROe(...pe),"datetime format",Ae=>Ae[FOe](...pe),()=>[],Ae=>vs(Ae)||Qh(Ae))}function $t(pe){V=pe,Y.pluralRules=V}function Ct(pe,Ae){const tt=vs(Ae)?Ae:s.value,gt=ot(tt);return Y.messageResolver(gt,pe)!==null}function Et(pe){let Ae=null;const tt=but(Y,o.value,s.value);for(let gt=0;gt{n&&(s.value=pe,Y.locale=pe,_K(Y,s.value,o.value))}),bu(i.fallbackLocale,pe=>{n&&(o.value=pe,Y.fallbackLocale=pe,_K(Y,s.value,o.value))}));const Ne={id:Jut,locale:ie,fallbackLocale:ce,get inheritLocale(){return n},set inheritLocale(pe){n=pe,pe&&i&&(s.value=i.locale.value,o.value=i.fallbackLocale.value,_K(Y,s.value,o.value))},get availableLocales(){return Object.keys(a.value).sort()},messages:he,get modifiers(){return j},get pluralRules(){return V||{}},get isGlobal(){return r},get missingWarn(){return h},set missingWarn(pe){h=pe,Y.missingWarn=h},get fallbackWarn(){return p},set fallbackWarn(pe){p=pe,Y.fallbackWarn=p},get fallbackRoot(){return y},set fallbackRoot(pe){y=pe},get fallbackFormat(){return v},set fallbackFormat(pe){v=pe,Y.fallbackFormat=v},get warnHtmlMessage(){return F},set warnHtmlMessage(pe){F=pe,Y.warnHtmlMessage=pe},get escapeParameter(){return k},set escapeParameter(pe){k=pe,Y.escapeParameter=pe},t:Ie,getLocaleMessage:ot,setLocaleMessage:Te,mergeLocaleMessage:je,getPostTranslationHandler:Pe,setPostTranslationHandler:ke,getMissingHandler:J,setMissingHandler:de,[Hut]:$t};return Ne.datetimeFormats=_e,Ne.numberFormats=xe,Ne.rt=Re,Ne.te=Ct,Ne.tm=Ft,Ne.d=Oe,Ne.n=Ge,Ne.getDateTimeFormat=pt,Ne.setDateTimeFormat=kt,Ne.mergeDateTimeFormat=ct,Ne.getNumberFormat=ae,Ne.setNumberFormat=ht,Ne.mergeNumberFormat=wt,Ne[Wut]=t.__injectWithOption,Ne[DOe]=Ze,Ne[FOe]=Pt,Ne[LOe]=mt,Ne}function V_i(t){const e=vs(t.locale)?t.locale:vK,i=vs(t.fallbackLocale)||Qh(t.fallbackLocale)||Za(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:e,r=_f(t.missing)?t.missing:void 0,n=Nu(t.silentTranslationWarn)||aD(t.silentTranslationWarn)?!t.silentTranslationWarn:!0,s=Nu(t.silentFallbackWarn)||aD(t.silentFallbackWarn)?!t.silentFallbackWarn:!0,o=Nu(t.fallbackRoot)?t.fallbackRoot:!0,a=!!t.formatFallbackMessages,l=Za(t.modifiers)?t.modifiers:{},c=t.pluralizationRules,h=_f(t.postTranslation)?t.postTranslation:void 0,p=vs(t.warnHtmlInMessage)?t.warnHtmlInMessage!=="off":!0,y=!!t.escapeParameterHtml,v=Nu(t.sync)?t.sync:!0;let x=t.messages;if(Za(t.sharedMessages)){const Y=t.sharedMessages;x=Object.keys(Y).reduce((Z,ie)=>{const ce=Z[ie]||(Z[ie]={});return vg(ce,Y[ie]),Z},x||{})}const{__i18n:I,__root:P,__injectWithOption:F}=t,k=t.datetimeFormats,j=t.numberFormats,V=t.flatJson;return{locale:e,fallbackLocale:i,messages:x,flatJson:V,datetimeFormats:k,numberFormats:j,missing:r,missingWarn:n,fallbackWarn:s,fallbackRoot:o,fallbackFormat:a,modifiers:l,pluralRules:c,postTranslation:h,warnHtmlMessage:p,escapeParameter:y,messageResolver:t.messageResolver,inheritLocale:v,__i18n:I,__root:P,__injectWithOption:F}}function $Oe(t={},e){{const i=kOe(V_i(t)),r={id:i.id,get locale(){return i.locale.value},set locale(n){i.locale.value=n},get fallbackLocale(){return i.fallbackLocale.value},set fallbackLocale(n){i.fallbackLocale.value=n},get messages(){return i.messages.value},get datetimeFormats(){return i.datetimeFormats.value},get numberFormats(){return i.numberFormats.value},get availableLocales(){return i.availableLocales},get formatter(){return{interpolate(){return[]}}},set formatter(n){},get missing(){return i.getMissingHandler()},set missing(n){i.setMissingHandler(n)},get silentTranslationWarn(){return Nu(i.missingWarn)?!i.missingWarn:i.missingWarn},set silentTranslationWarn(n){i.missingWarn=Nu(n)?!n:n},get silentFallbackWarn(){return Nu(i.fallbackWarn)?!i.fallbackWarn:i.fallbackWarn},set silentFallbackWarn(n){i.fallbackWarn=Nu(n)?!n:n},get modifiers(){return i.modifiers},get formatFallbackMessages(){return i.fallbackFormat},set formatFallbackMessages(n){i.fallbackFormat=n},get postTranslation(){return i.getPostTranslationHandler()},set postTranslation(n){i.setPostTranslationHandler(n)},get sync(){return i.inheritLocale},set sync(n){i.inheritLocale=n},get warnHtmlInMessage(){return i.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(n){i.warnHtmlMessage=n!=="off"},get escapeParameterHtml(){return i.escapeParameter},set escapeParameterHtml(n){i.escapeParameter=n},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(n){},get pluralizationRules(){return i.pluralRules||{}},__composer:i,t(...n){const[s,o,a]=n,l={};let c=null,h=null;if(!vs(s))throw Um(Zf.INVALID_ARGUMENT);const p=s;return vs(o)?l.locale=o:Qh(o)?c=o:Za(o)&&(h=o),Qh(a)?c=a:Za(a)&&(h=a),Reflect.apply(i.t,i,[p,c||h||{},l])},rt(...n){return Reflect.apply(i.rt,i,[...n])},tc(...n){const[s,o,a]=n,l={plural:1};let c=null,h=null;if(!vs(s))throw Um(Zf.INVALID_ARGUMENT);const p=s;return vs(o)?l.locale=o:Gm(o)?l.plural=o:Qh(o)?c=o:Za(o)&&(h=o),vs(a)?l.locale=a:Qh(a)?c=a:Za(a)&&(h=a),Reflect.apply(i.t,i,[p,c||h||{},l])},te(n,s){return i.te(n,s)},tm(n){return i.tm(n)},getLocaleMessage(n){return i.getLocaleMessage(n)},setLocaleMessage(n,s){i.setLocaleMessage(n,s)},mergeLocaleMessage(n,s){i.mergeLocaleMessage(n,s)},d(...n){return Reflect.apply(i.d,i,[...n])},getDateTimeFormat(n){return i.getDateTimeFormat(n)},setDateTimeFormat(n,s){i.setDateTimeFormat(n,s)},mergeDateTimeFormat(n,s){i.mergeDateTimeFormat(n,s)},n(...n){return Reflect.apply(i.n,i,[...n])},getNumberFormat(n){return i.getNumberFormat(n)},setNumberFormat(n,s){i.setNumberFormat(n,s)},mergeNumberFormat(n,s){i.mergeNumberFormat(n,s)},getChoiceIndex(n,s){return-1},__onComponentInstanceCreated(n){const{componentInstanceCreatedListener:s}=t;s&&s(n,r)}};return r}}const BOe={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function j_i({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,n)=>r=[...r,...Qh(n.children)?n.children:[n]],[]):e.reduce((i,r)=>{const n=t[r];return n&&(i[r]=n()),i},{})}function Qut(t){return po}const ect={name:"i18n-t",props:vg({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Gm(t)||!isNaN(t)}},BOe),setup(t,e){const{slots:i,attrs:r}=e,n=t.i18n||ns({useScope:t.scope,__useComponent:!0});return()=>{const s=Object.keys(i).filter(p=>p!=="_"),o={};t.locale&&(o.locale=t.locale),t.plural!==void 0&&(o.plural=vs(t.plural)?+t.plural:t.plural);const a=j_i(e,s),l=n[DOe](t.keypath,a,o),c=vg({},r),h=vs(t.tag)||ed(t.tag)?t.tag:Qut();return Y2(h,c,l)}}};function G_i(t){return Qh(t)&&!vs(t[0])}function tct(t,e,i,r){const{slots:n,attrs:s}=e;return()=>{const o={part:!0};let a={};t.locale&&(o.locale=t.locale),vs(t.format)?o.key=t.format:ed(t.format)&&(vs(t.format.key)&&(o.key=t.format.key),a=Object.keys(t.format).reduce((y,v)=>i.includes(v)?vg({},y,{[v]:t.format[v]}):y,{}));const l=r(t.value,o,a);let c=[o.key];Qh(l)?c=l.map((y,v)=>{const x=n[y.type],I=x?x({[y.type]:y.value,index:v,parts:l}):[y.value];return G_i(I)&&(I[0].key=`${y.type}-${v}`),I}):vs(l)&&(c=[l]);const h=vg({},s),p=vs(t.tag)||ed(t.tag)?t.tag:Qut();return Y2(p,h,c)}}const ict={name:"i18n-n",props:vg({value:{type:Number,required:!0},format:{type:[String,Object]}},BOe),setup(t,e){const i=t.i18n||ns({useScope:"parent",__useComponent:!0});return tct(t,e,Gut,(...r)=>i[LOe](...r))}},rct={name:"i18n-d",props:vg({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},BOe),setup(t,e){const i=t.i18n||ns({useScope:"parent",__useComponent:!0});return tct(t,e,But,(...r)=>i[FOe](...r))}};function U_i(t,e){const i=t;if(t.mode==="composition")return i.__getInstance(e)||t.global;{const r=i.__getInstance(e);return r!=null?r.__composer:t.global.__composer}}function z_i(t){const e=o=>{const{instance:a,modifiers:l,value:c}=o;if(!a||!a.$)throw Um(Zf.UNEXPECTED_ERROR);const h=U_i(t,a.$),p=nct(c);return[Reflect.apply(h.t,h,[...sct(p)]),h]};return{created:(o,a)=>{const[l,c]=e(a);SOe&&t.global===c&&(o.__i18nWatcher=bu(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),o.__composer=c,o.textContent=l},unmounted:o=>{SOe&&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,c=nct(a);o.textContent=Reflect.apply(l.t,l,[...sct(c)])}},getSSRProps:o=>{const[a]=e(o);return{textContent:a}}}}function nct(t){if(vs(t))return{path:t};if(Za(t)){if(!("path"in t))throw Um(Zf.REQUIRED_VALUE,"path");return t}else throw Um(Zf.INVALID_VALUE)}function sct(t){const{path:e,locale:i,args:r,choice:n,plural:s}=t,o={},a=r||{};return vs(i)&&(o.locale=i),Gm(n)&&(o.plural=n),Gm(s)&&(o.plural=s),[e,a,o]}function H_i(t,e,...i){const r=Za(i[0])?i[0]:{},n=!!r.useI18nComponentName;(Nu(r.globalInstall)?r.globalInstall:!0)&&(t.component(n?"i18n":ect.name,ect),t.component(ict.name,ict),t.component(rct.name,rct)),t.directive("t",z_i(e))}function W_i(t,e,i){return{beforeCreate(){const r=Up();if(!r)throw Um(Zf.UNEXPECTED_ERROR);const n=this.$options;if(n.i18n){const s=n.i18n;n.__i18n&&(s.__i18n=n.__i18n),s.__root=e,this===this.$root?this.$i18n=oct(t,s):(s.__injectWithOption=!0,this.$i18n=$Oe(s))}else n.__i18n?this===this.$root?this.$i18n=oct(t,n):this.$i18n=$Oe({__i18n:n.__i18n,__injectWithOption:!0,__root:e}):this.$i18n=t;n.__i18nGlobal&&Yut(e,n,n),t.__onComponentInstanceCreated(this.$i18n),i.__setInstance(r,this.$i18n),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)},mounted(){},unmounted(){const r=Up();if(!r)throw Um(Zf.UNEXPECTED_ERROR);delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,i.__deleteInstance(r),delete this.$i18n}}}function oct(t,e){t.locale=e.locale||t.locale,t.fallbackLocale=e.fallbackLocale||t.fallbackLocale,t.missing=e.missing||t.missing,t.silentTranslationWarn=e.silentTranslationWarn||t.silentFallbackWarn,t.silentFallbackWarn=e.silentFallbackWarn||t.silentFallbackWarn,t.formatFallbackMessages=e.formatFallbackMessages||t.formatFallbackMessages,t.postTranslation=e.postTranslation||t.postTranslation,t.warnHtmlInMessage=e.warnHtmlInMessage||t.warnHtmlInMessage,t.escapeParameterHtml=e.escapeParameterHtml||t.escapeParameterHtml,t.sync=e.sync||t.sync,t.__composer[Hut](e.pluralizationRules||t.pluralizationRules);const i=Yce(t.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(i).forEach(r=>t.mergeLocaleMessage(r,i[r])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(r=>t.mergeDateTimeFormat(r,e.datetimeFormats[r])),e.numberFormats&&Object.keys(e.numberFormats).forEach(r=>t.mergeNumberFormat(r,e.numberFormats[r])),t}const q_i=oD("global-vue-i18n");function Y_i(t={},e){const i=__VUE_I18N_LEGACY_API__&&Nu(t.legacy)?t.legacy:__VUE_I18N_LEGACY_API__,r=Nu(t.globalInjection)?t.globalInjection:!0,n=__VUE_I18N_LEGACY_API__&&i?!!t.allowComposition:!0,s=new Map,[o,a]=X_i(t,i),l=oD("");function c(y){return s.get(y)||null}function h(y,v){s.set(y,v)}function p(y){s.delete(y)}{const y={get mode(){return __VUE_I18N_LEGACY_API__&&i?"legacy":"composition"},get allowComposition(){return n},async install(v,...x){v.__VUE_I18N_SYMBOL__=l,v.provide(v.__VUE_I18N_SYMBOL__,y),!i&&r&&n1i(v,y.global),__VUE_I18N_FULL_INSTALL__&&H_i(v,y,...x),__VUE_I18N_LEGACY_API__&&i&&v.mixin(W_i(a,a.__composer,y));const I=v.unmount;v.unmount=()=>{y.dispose(),I()}},get global(){return a},dispose(){o.stop()},__instances:s,__getInstance:c,__setInstance:h,__deleteInstance:p};return y}}function ns(t={}){const e=Up();if(e==null)throw Um(Zf.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Um(Zf.NOT_INSLALLED);const i=K_i(e),r=Z_i(i),n=qut(e),s=J_i(t,n);if(__VUE_I18N_LEGACY_API__&&i.mode==="legacy"&&!t.__useComponent){if(!i.allowComposition)throw Um(Zf.NOT_AVAILABLE_IN_LEGACY_MODE);return t1i(e,s,r,t)}if(s==="global")return Yut(r,t,n),r;if(s==="parent"){let l=Q_i(i,e,t.__useComponent);return l==null&&(l=r),l}const o=i;let a=o.__getInstance(e);if(a==null){const l=vg({},t);"__i18n"in n&&(l.__i18n=n.__i18n),r&&(l.__root=r),a=kOe(l),e1i(o,e),o.__setInstance(e,a)}return a}function X_i(t,e,i){const r=DX();{const n=__VUE_I18N_LEGACY_API__&&e?r.run(()=>$Oe(t)):r.run(()=>kOe(t));if(n==null)throw Um(Zf.UNEXPECTED_ERROR);return[r,n]}}function K_i(t){{const e=no(t.isCE?q_i:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Um(t.isCE?Zf.NOT_INSLALLED_WITH_PROVIDE:Zf.UNEXPECTED_ERROR);return e}}function J_i(t,e){return Hce(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function Z_i(t){return t.mode==="composition"?t.global:t.global.__composer}function Q_i(t,e,i=!1){let r=null;const n=e.root;let s=e.parent;for(;s!=null;){const o=t;if(t.mode==="composition")r=o.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const a=o.__getInstance(s);a!=null&&(r=a.__composer,i&&r&&!r[Wut]&&(r=null))}if(r!=null||n===s)break;s=s.parent}return r}function e1i(t,e,i){Ja(()=>{},e),XN(()=>{t.__deleteInstance(e)},e)}function t1i(t,e,i,r={}){const n=e==="local",s=XAe(null);if(n&&t.proxy&&!(t.proxy.$options.i18n||t.proxy.$options.__i18n))throw Um(Zf.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const o=Nu(r.inheritLocale)?r.inheritLocale:!0,a=Mi(n&&o?i.locale.value:vs(r.locale)?r.locale:vK),l=Mi(n&&o?i.fallbackLocale.value:vs(r.fallbackLocale)||Qh(r.fallbackLocale)||Za(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:a.value),c=Mi(Yce(a.value,r)),h=Mi(Za(r.datetimeFormats)?r.datetimeFormats:{[a.value]:{}}),p=Mi(Za(r.numberFormats)?r.numberFormats:{[a.value]:{}}),y=n?i.missingWarn:Nu(r.missingWarn)||aD(r.missingWarn)?r.missingWarn:!0,v=n?i.fallbackWarn:Nu(r.fallbackWarn)||aD(r.fallbackWarn)?r.fallbackWarn:!0,x=n?i.fallbackRoot:Nu(r.fallbackRoot)?r.fallbackRoot:!0,I=!!r.fallbackFormat,P=_f(r.missing)?r.missing:null,F=_f(r.postTranslation)?r.postTranslation:null,k=n?i.warnHtmlMessage:Nu(r.warnHtmlMessage)?r.warnHtmlMessage:!0,j=!!r.escapeParameter,V=n?i.modifiers:Za(r.modifiers)?r.modifiers:{},Y=r.pluralRules||n&&i.pluralRules;function X(){return[a.value,l.value,c.value,h.value,p.value]}const Z=Jr({get:()=>s.value?s.value.locale.value:a.value,set:je=>{s.value&&(s.value.locale.value=je),a.value=je}}),ie=Jr({get:()=>s.value?s.value.fallbackLocale.value:l.value,set:je=>{s.value&&(s.value.fallbackLocale.value=je),l.value=je}}),ce=Jr(()=>s.value?s.value.messages.value:c.value),he=Jr(()=>h.value),_e=Jr(()=>p.value);function xe(){return s.value?s.value.getPostTranslationHandler():F}function Pe(je){s.value&&s.value.setPostTranslationHandler(je)}function ke(){return s.value?s.value.getMissingHandler():P}function J(je){s.value&&s.value.setMissingHandler(je)}function de(je){return X(),je()}function Se(...je){return s.value?de(()=>Reflect.apply(s.value.t,null,[...je])):de(()=>"")}function Ie(...je){return s.value?Reflect.apply(s.value.rt,null,[...je]):""}function Re(...je){return s.value?de(()=>Reflect.apply(s.value.d,null,[...je])):de(()=>"")}function Oe(...je){return s.value?de(()=>Reflect.apply(s.value.n,null,[...je])):de(()=>"")}function Ge(je){return s.value?s.value.tm(je):{}}function Be(je,pt){return s.value?s.value.te(je,pt):!1}function qe(je){return s.value?s.value.getLocaleMessage(je):{}}function et(je,pt){s.value&&(s.value.setLocaleMessage(je,pt),c.value[je]=pt)}function Ze(je,pt){s.value&&s.value.mergeLocaleMessage(je,pt)}function mt(je){return s.value?s.value.getDateTimeFormat(je):{}}function Pt(je,pt){s.value&&(s.value.setDateTimeFormat(je,pt),h.value[je]=pt)}function $t(je,pt){s.value&&s.value.mergeDateTimeFormat(je,pt)}function Ct(je){return s.value?s.value.getNumberFormat(je):{}}function Et(je,pt){s.value&&(s.value.setNumberFormat(je,pt),p.value[je]=pt)}function Ft(je,pt){s.value&&s.value.mergeNumberFormat(je,pt)}const ot={get id(){return s.value?s.value.id:-1},locale:Z,fallbackLocale:ie,messages:ce,datetimeFormats:he,numberFormats:_e,get inheritLocale(){return s.value?s.value.inheritLocale:o},set inheritLocale(je){s.value&&(s.value.inheritLocale=je)},get availableLocales(){return s.value?s.value.availableLocales:Object.keys(c.value)},get modifiers(){return s.value?s.value.modifiers:V},get pluralRules(){return s.value?s.value.pluralRules:Y},get isGlobal(){return s.value?s.value.isGlobal:!1},get missingWarn(){return s.value?s.value.missingWarn:y},set missingWarn(je){s.value&&(s.value.missingWarn=je)},get fallbackWarn(){return s.value?s.value.fallbackWarn:v},set fallbackWarn(je){s.value&&(s.value.missingWarn=je)},get fallbackRoot(){return s.value?s.value.fallbackRoot:x},set fallbackRoot(je){s.value&&(s.value.fallbackRoot=je)},get fallbackFormat(){return s.value?s.value.fallbackFormat:I},set fallbackFormat(je){s.value&&(s.value.fallbackFormat=je)},get warnHtmlMessage(){return s.value?s.value.warnHtmlMessage:k},set warnHtmlMessage(je){s.value&&(s.value.warnHtmlMessage=je)},get escapeParameter(){return s.value?s.value.escapeParameter:j},set escapeParameter(je){s.value&&(s.value.escapeParameter=je)},t:Se,getPostTranslationHandler:xe,setPostTranslationHandler:Pe,getMissingHandler:ke,setMissingHandler:J,rt:Ie,d:Re,n:Oe,tm:Ge,te:Be,getLocaleMessage:qe,setLocaleMessage:et,mergeLocaleMessage:Ze,getDateTimeFormat:mt,setDateTimeFormat:Pt,mergeDateTimeFormat:$t,getNumberFormat:Ct,setNumberFormat:Et,mergeNumberFormat:Ft};function Te(je){je.locale.value=a.value,je.fallbackLocale.value=l.value,Object.keys(c.value).forEach(pt=>{je.mergeLocaleMessage(pt,c.value[pt])}),Object.keys(h.value).forEach(pt=>{je.mergeDateTimeFormat(pt,h.value[pt])}),Object.keys(p.value).forEach(pt=>{je.mergeNumberFormat(pt,p.value[pt])}),je.escapeParameter=j,je.fallbackFormat=I,je.fallbackRoot=x,je.fallbackWarn=v,je.missingWarn=y,je.warnHtmlMessage=k}return C_(()=>{if(t.proxy==null||t.proxy.$i18n==null)throw Um(Zf.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const je=s.value=t.proxy.$i18n.__composer;e==="global"?(a.value=je.locale.value,l.value=je.fallbackLocale.value,c.value=je.messages.value,h.value=je.datetimeFormats.value,p.value=je.numberFormats.value):n&&Te(je)}),ot}const i1i=["locale","fallbackLocale","availableLocales"],r1i=["t","rt","d","n","tm"];function n1i(t,e){const i=Object.create(null);i1i.forEach(r=>{const n=Object.getOwnPropertyDescriptor(e,r);if(!n)throw Um(Zf.UNEXPECTED_ERROR);const s=Ic(n.value)?{get(){return n.value.value},set(o){n.value.value=o}}:{get(){return n.get&&n.get()}};Object.defineProperty(i,r,s)}),t.config.globalProperties.$i18n=i,r1i.forEach(r=>{const n=Object.getOwnPropertyDescriptor(e,r);if(!n||!n.value)throw Um(Zf.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${r}`,n)})}if(T_i(M_i),E_i(a_i),I_i(but),$_i(),__INTLIFY_PROD_DEVTOOLS__){const t=gK();t.__INTLIFY__=!0,g_i(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const s1i={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.toggleScaleUnits":"Toggle between imperial and metric 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.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"},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.toggleScaleUnits":"Basculer entre les échelles métriques et impériales pour la carte","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 Espace 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.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":"{name} ne peut pas être affiché dans la projection actuelle","layer.filtersdisabled":"Les filtres ont été désactivés par {name}","layer.filterwarning":"Vous tentez d'utiliser une grille contenant des calques non modifiables. Le filtrage sera partiellement désactivé"}},act="en",o1i={en:{number:{style:"decimal",useGrouping:!1,maximumFractionDigits:20}},fr:{number:{style:"decimal",useGrouping:!1,maximumFractionDigits:20}}};function a1i(){return Y_i({legacy:!1,locale:document.documentElement.getAttribute("lang")||act,fallbackLocale:act,globalInjection:!0,messages:s1i,numberFormats:o1i})}var lct={exports:{}};/*! * screenfull * v5.0.2 - 2020-02-13 * (c) Sindre Sorhus; MIT License -*/(function(t){(function(){var e=typeof window<"u"&&typeof window.document<"u"?window.document:{},i=t.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,c=a.length,d={};l{const t=Pi(void 0),e=Pi(void 0),i=Pi("");function r(o){t.value=o}function n(o){e.value=o}function s(o){i.value=o}return{maptipInstance:t,maptipPoint:e,content:i,setMaptipInstance:r,setMaptipPoint:n,setMaptipContent:s}}),z_i=Zr({__name:"esri-map",setup(t){const e=Xce(),i=Qs("iApi"),r=Vr(()=>e.maptipPoint),n=Vr(()=>e.maptipInstance),s=Vr(()=>e.content),o=Tl([]);o.push(Sc(r,()=>{if(r.value){let l,c;const d=i.geo.map.getPixelWidth()/2,p=0,y=i.geo.map.mapPointToScreenPoint(r.value);l=y.screenX-d,c=p-y.screenY,n.value.setProps({offset:[l,c]}),s.value&&s.value!==""&&n.value.show()}else n.value.hide()})),o.push(Sc(s,l=>{l&&l!==""&&r?(n.value.setContent(l),n.value.show()):n.value.hide()})),su(()=>{o.forEach(l=>l())});const a=()=>{i.geo.map.setMouseFocus()};return(l,c)=>{const d=Qn("tippy");return Br((Kt(),ci("div",{name:"esriMap",id:"esriMap",class:"h-full overflow-hidden",onMousedown:a,onKeydown:c[0]||(c[0]=Ch(_a(()=>{},["prevent"]),["up","down","left","right"]))},null,544)),[[d,{allowHTML:!0,zIndex:5,theme:"ramp4",trigger:"manual",appendTo:"parent",arrow:!1,delay:200,duration:[200,200]}]])}}});var Jut={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},DOe={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},H_i=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Kce={CSS:{},springs:{}};function jT(t,e,i){return Math.min(Math.max(t,e),i)}function bK(t,e){return t.indexOf(e)>-1}function FOe(t,e){return t.apply(null,e)}var Ao={arr:function(t){return Array.isArray(t)},obj:function(t){return bK(Object.prototype.toString.call(t),"Object")},pth:function(t){return Ao.obj(t)&&t.hasOwnProperty("totalLength")},svg:function(t){return t instanceof SVGElement},inp:function(t){return t instanceof HTMLInputElement},dom:function(t){return t.nodeType||Ao.svg(t)},str:function(t){return typeof t=="string"},fnc:function(t){return typeof t=="function"},und:function(t){return typeof t>"u"},nil:function(t){return Ao.und(t)||t===null},hex:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)},rgb:function(t){return/^rgb/.test(t)},hsl:function(t){return/^hsl/.test(t)},col:function(t){return Ao.hex(t)||Ao.rgb(t)||Ao.hsl(t)},key:function(t){return!Jut.hasOwnProperty(t)&&!DOe.hasOwnProperty(t)&&t!=="targets"&&t!=="keyframes"}};function Zut(t){var e=/\(([^)]+)\)/.exec(t);return e?e[1].split(",").map(function(i){return parseFloat(i)}):[]}function Qut(t,e){var i=Zut(t),r=jT(Ao.und(i[0])?1:i[0],.1,100),n=jT(Ao.und(i[1])?100:i[1],.1,100),s=jT(Ao.und(i[2])?10:i[2],.1,100),o=jT(Ao.und(i[3])?0:i[3],.1,100),a=Math.sqrt(n/r),l=s/(2*Math.sqrt(n*r)),c=l<1?a*Math.sqrt(1-l*l):0,d=1,p=l<1?(l*a+-o)/c:-o+a;function y(S){var I=e?e*S/1e3:S;return l<1?I=Math.exp(-I*l*a)*(d*Math.cos(c*I)+p*Math.sin(c*I)):I=(d+p*I)*Math.exp(-I*a),S===0||S===1?S:1-I}function v(){var S=Kce.springs[t];if(S)return S;for(var I=1/6,O=0,L=0;;)if(O+=I,y(O)===1){if(L++,L>=16)break}else L=0;var N=O*I*1e3;return Kce.springs[t]=N,N}return e?y:v}function W_i(t){return t===void 0&&(t=10),function(e){return Math.ceil(jT(e,1e-6,1)*t)*(1/t)}}var q_i=function(){var t=11,e=1/(t-1);function i(d,p){return 1-3*p+3*d}function r(d,p){return 3*p-6*d}function n(d){return 3*d}function s(d,p,y){return((i(p,y)*d+r(p,y))*d+n(p))*d}function o(d,p,y){return 3*i(p,y)*d*d+2*r(p,y)*d+n(p)}function a(d,p,y,v,S){var I,O,L=0;do O=p+(y-p)/2,I=s(O,v,S)-d,I>0?y=O:p=O;while(Math.abs(I)>1e-7&&++L<10);return O}function l(d,p,y,v){for(var S=0;S<4;++S){var I=o(p,y,v);if(I===0)return p;var O=s(p,y,v)-d;p-=O/I}return p}function c(d,p,y,v){if(!(0<=d&&d<=1&&0<=y&&y<=1))return;var S=new Float32Array(t);if(d!==p||y!==v)for(var I=0;I=.001?l(L,X,d,y):te===0?X:a(L,N,N+e,d,y)}return function(L){return d===p&&y===v||L===0||L===1?L:s(O(L),p,v)}}return c}(),ect=function(){var t={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=jT(r,1,10),o=jT(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)}}},i=["Quad","Cubic","Quart","Quint","Expo"];return i.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];t["easeIn"+r]=n,t["easeOut"+r]=function(s,o){return function(a){return 1-n(s,o)(1-a)}},t["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}},t["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}}}),t}();function LOe(t,e){if(Ao.fnc(t))return t;var i=t.split("(")[0],r=ect[i],n=Zut(t);switch(i){case"spring":return Qut(t,e);case"cubicBezier":return FOe(q_i,n);case"steps":return FOe(W_i,n);default:return FOe(r,n)}}function tct(t){try{var e=document.querySelectorAll(t);return e}catch{return}}function Jce(t,e){for(var i=t.length,r=arguments.length>=2?arguments[1]:void 0,n=[],s=0;s1&&(S-=1),S<.16666666666666666?y+(v-y)*6*S:S<.5?v:S<.6666666666666666?y+(v-y)*(.6666666666666666-S)*6:y}var a,l,c;if(r==0)a=l=c=n;else{var d=n<.5?n*(1+r):n+r-n*r,p=2*n-d;a=o(p,d,i+.3333333333333333),l=o(p,d,i),c=o(p,d,i-.3333333333333333)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function J_i(t){if(Ao.rgb(t))return Y_i(t);if(Ao.hex(t))return X_i(t);if(Ao.hsl(t))return K_i(t)}function MP(t){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(t);if(e)return e[1]}function Z_i(t){if(bK(t,"translate")||t==="perspective")return"px";if(bK(t,"rotate")||bK(t,"skew"))return"deg"}function BOe(t,e){return Ao.fnc(t)?t(e.target,e.id,e.total):t}function zT(t,e){return t.getAttribute(e)}function GOe(t,e,i){var r=MP(e);if(kOe([i,"deg","rad","turn"],r))return e;var n=Kce.CSS[e+i];if(!Ao.und(n))return n;var s=100,o=document.createElement(t.tagName),a=t.parentNode&&t.parentNode!==document?t.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+i;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Kce.CSS[e+i]=c,c}function rct(t,e,i){if(e in t.style){var r=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),n=t.style[e]||getComputedStyle(t).getPropertyValue(r)||"0";return i?GOe(t,n,i):n}}function VOe(t,e){if(Ao.dom(t)&&!Ao.inp(t)&&(!Ao.nil(zT(t,e))||Ao.svg(t)&&t[e]))return"attribute";if(Ao.dom(t)&&kOe(H_i,e))return"transform";if(Ao.dom(t)&&e!=="transform"&&rct(t,e))return"css";if(t[e]!=null)return"object"}function nct(t){if(Ao.dom(t)){for(var e=t.style.transform||"",i=/(\w+)\(([^)]*)\)/g,r=new Map,n;n=i.exec(e);)r.set(n[1],n[2]);return r}}function Q_i(t,e,i,r){var n=bK(e,"scale")?1:0+Z_i(e),s=nct(t).get(e)||n;return i&&(i.transforms.list.set(e,s),i.transforms.last=e),r?GOe(t,s,r):s}function UOe(t,e,i,r){switch(VOe(t,e)){case"transform":return Q_i(t,e,r,i);case"css":return rct(t,e,i);case"attribute":return zT(t,e);default:return t[e]||0}}function jOe(t,e){var i=/^(\*=|\+=|-=)/.exec(t);if(!i)return t;var r=MP(t)||0,n=parseFloat(e),s=parseFloat(t.replace(i[0],""));switch(i[0][0]){case"+":return n+s+r;case"-":return n-s+r;case"*":return n*s+r}}function sct(t,e){if(Ao.col(t))return J_i(t);if(/\s/g.test(t))return t;var i=MP(t),r=i?t.substr(0,t.length-i.length):t;return e?r+e:r}function zOe(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function e1i(t){return Math.PI*2*zT(t,"r")}function t1i(t){return zT(t,"width")*2+zT(t,"height")*2}function i1i(t){return zOe({x:zT(t,"x1"),y:zT(t,"y1")},{x:zT(t,"x2"),y:zT(t,"y2")})}function oct(t){for(var e=t.points,i=0,r,n=0;n0&&(i+=zOe(r,s)),r=s}return i}function r1i(t){var e=t.points;return oct(t)+zOe(e.getItem(e.numberOfItems-1),e.getItem(0))}function act(t){if(t.getTotalLength)return t.getTotalLength();switch(t.tagName.toLowerCase()){case"circle":return e1i(t);case"rect":return t1i(t);case"line":return i1i(t);case"polyline":return oct(t);case"polygon":return r1i(t)}}function n1i(t){var e=act(t);return t.setAttribute("stroke-dasharray",e),e}function s1i(t){for(var e=t.parentNode;Ao.svg(e)&&Ao.svg(e.parentNode);)e=e.parentNode;return e}function lct(t,e){var i=e||{},r=i.el||s1i(t),n=r.getBoundingClientRect(),s=zT(r,"viewBox"),o=n.width,a=n.height,l=i.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 o1i(t,e){var i=Ao.str(t)?tct(t)[0]:t,r=e||100;return function(n){return{property:n,el:i,svg:lct(i),totalLength:act(i)*(r/100)}}}function a1i(t,e,i){function r(d){d===void 0&&(d=0);var p=e+d>=1?e+d:0;return t.el.getPointAtLength(p)}var n=lct(t.el,t.svg),s=r(),o=r(-1),a=r(1),l=i?1:n.w/n.vW,c=i?1:n.h/n.vH;switch(t.property){case"x":return(s.x-n.x)*l;case"y":return(s.y-n.y)*c;case"angle":return Math.atan2(a.y-o.y,a.x-o.x)*180/Math.PI}}function uct(t,e){var i=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=sct(Ao.pth(t)?t.totalLength:t,e)+"";return{original:r,numbers:r.match(i)?r.match(i).map(Number):[0],strings:Ao.str(t)||e?r.split(i):[]}}function HOe(t){var e=t?Zce(Ao.arr(t)?t.map(ict):ict(t)):[];return Jce(e,function(i,r,n){return n.indexOf(i)===r})}function cct(t){var e=HOe(t);return e.map(function(i,r){return{target:i,id:r,total:e.length,transforms:{list:nct(i)}}})}function l1i(t,e){var i=NOe(e);if(/^spring/.test(i.easing)&&(i.duration=Qut(i.easing)),Ao.arr(t)){var r=t.length,n=r===2&&!Ao.obj(t[0]);n?t={value:t}:Ao.fnc(e.duration)||(i.duration=e.duration/r)}var s=Ao.arr(t)?t:[t];return s.map(function(o,a){var l=Ao.obj(o)&&!Ao.pth(o)?o:{value:o};return Ao.und(l.delay)&&(l.delay=a?0:e.delay),Ao.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return Qce(o,i)})}function u1i(t){for(var e=Jce(Zce(t.map(function(s){return Object.keys(s)})),function(s){return Ao.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),i={},r=function(s){var o=e[s];i[o]=t.map(function(a){var l={};for(var c in a)Ao.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},n=0;n0&&(t=requestAnimationFrame(i))}function i(n){for(var s=Q2.length,o=0;o0?requestAnimationFrame(i):void 0}function r(){hp.suspendWhenDocumentHidden&&(gct()?t=cancelAnimationFrame(t):(Q2.forEach(function(n){return n._onDocumentVisibility()}),mct()))}return typeof document<"u"&&document.addEventListener("visibilitychange",r),e}();function gct(){return!!document&&document.hidden}function hp(t){t===void 0&&(t={});var e=0,i=0,r=0,n,s=0,o=null;function a(N){var G=window.Promise&&new Promise(function(V){return o=V});return N.finished=G,G}var l=m1i(t);a(l);function c(){var N=l.direction;N!=="alternate"&&(l.direction=N!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,n.forEach(function(G){return G.reversed=l.reversed})}function d(N){return l.reversed?l.duration-N:N}function p(){e=0,i=d(l.currentTime)*(1/hp.speed)}function y(N,G){G&&G.seek(N-G.timelineOffset)}function v(N){if(l.reversePlayback)for(var V=s;V--;)y(N,n[V]);else for(var G=0;G2||(Oe=Math.round(Oe*Ne)/Ne)),J.push(Oe)}var Ge=ke.length;if(!Ge)xe=J[0];else{xe=ke[0];for(var Je=0;Je0&&(l.began=!0,I("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,I("loopBegin")),X<=V&&l.currentTime!==0&&S(0),(X>=Y&&l.currentTime!==G||!G)&&S(G),X>V&&X=G&&(i=0,O(),l.remaining?(e=r,I("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&c()):(l.paused=!0,l.completed||(l.completed=!0,I("loopComplete"),I("complete"),!l.passThrough&&"Promise"in window&&(o(),a(l)))))}return l.reset=function(){var N=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=N==="reverse",l.remaining=l.loop,n=l.children,s=n.length;for(var G=s;G--;)l.children[G].reset();(l.reversed&&l.loop!==!0||N==="alternate"&&l.loop===1)&&l.remaining++,S(l.reversed?l.duration:0)},l._onDocumentVisibility=p,l.set=function(N,G){return dct(N,G),l},l.tick=function(N){r=N,e||(e=r),L((r+(i-e))*hp.speed)},l.seek=function(N){L(d(N))},l.pause=function(){l.paused=!0,p()},l.play=function(){l.paused&&(l.completed&&l.reset(),l.paused=!1,Q2.push(l),p(),mct())},l.reverse=function(){c(),l.completed=!l.reversed,p()},l.restart=function(){l.reset(),l.play()},l.remove=function(N){var G=HOe(N);vct(G,l)},l.reset(),l.autoplay&&l.play(),l}function yct(t,e){for(var i=e.length;i--;)kOe(t,e[i].animatable.target)&&e.splice(i,1)}function vct(t,e){var i=e.animations,r=e.children;yct(t,i);for(var n=r.length;n--;){var s=r[n],o=s.animations;yct(t,o),!o.length&&!s.children.length&&r.splice(n,1)}!i.length&&!r.length&&e.pause()}function g1i(t){for(var e=HOe(t),i=Q2.length;i--;){var r=Q2[i];vct(e,r)}}function y1i(t,e){e===void 0&&(e={});var i=e.direction||"normal",r=e.easing?LOe(e.easing):null,n=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",d=Ao.arr(t),p=parseFloat(d?t[0]:t),y=d?parseFloat(t[1]):0,v=MP(d?t[1]:t)||0,S=e.start||0+(d?p:0),I=[],O=0;return function(L,N,G){if(a&&(o=0),l&&(o=(G-1)/2),c&&(o=G-1),!I.length){for(var V=0;V-1&&Q2.splice(n,1);function o(y){y.passThrough=!0}for(var a=0;a{if(r.value)return c();hp({targets:l,opacity:{value:d,duration:400,easing:"cubicBezier(.5, .05, .1, .3)"},complete:c})},s=(l,c)=>{n(l,c,[0,1])},o=l=>{l.classList.contains("screen-spinner")||(r.value=e.panel.isScreenLoaded(e.panel.route.screen),i.value.querySelectorAll("[focus-item").forEach(c=>c.classList.remove("default-focus-style")))},a=(l,c)=>{n(l,c,[0,1])};return(l,c)=>{const d=Qn("focus-container");return Kt(),ci("div",{class:fs(["shadow-tm bg-white h-full xs:mr-0 sm:mr-12 last:mr-0 pointer-events-auto min-w-0 shrink-0",t.panel.expanded?"flex-grow max-w-full":""]),style:tb(t.panel.style),"data-cy":t.panel.id,ref_key:"componentEl",ref:i},[Rn(Jk,{onBeforeLeave:o,onLeave:a,onEnter:s},{default:yn(()=>[Br((Kt(),Pn(TP(t.panel.route.screen),XX(t.panel.route.props,{panel:t.panel}),null,16,["panel"])),[[d]])]),_:1})],14,_1i)}}}),C_=Vp("panel",()=>{const t=Pi(null),e=Pi(null),i=Pi(0),r=Pi(0),n=Pi(!1),s=Pi(!0),o=Pi({}),a=Pi({}),l=Pi([]),c=Pi([]),d=Vr(()=>r.value);function p(_e){return _e==="xs"&&c.value.length>0?[c.value.slice().pop()]:c.value}function y(_e){const Ie=[];return _e.forEach(ke=>{ke in a.value&&Ie.push(a.value[ke].getPromise())}),Ie}function v(_e){X(_e),e.value=null,V()}function S(_e){e.value===_e&&(e.value=null),te(_e),V()}function I(_e,Ie){re(_e,Ie),V()}function O(_e){e.value===_e&&(e.value=null),fe(_e),V()}function L(_e){V()}function N(_e){i.value=_e,V()}function G(_e){n.value=_e}function V(){let _e=i.value;const Ie=[];for(let ke=l.value.length-1;ke>=0;ke--){let Ne=l.value[ke].width||350;n.value?Ne=_e:Ne+=12,(_e>=Ne&&!n.value||Ie.length===0)&&(_e-=Ne,Ie.unshift(l.value[ke]))}if(t.value&&!Ie.includes(t.value)){let ke;for(let xe=0;xe=(t.value.width||350)?Ie.unshift(t.value):e.value||(ke=Ie.shift(),Ie.unshift(t.value));const Ne=l.value.indexOf(t.value),J=l.value.indexOf(ke),he=l.value.slice();J>-1&&(he.splice(Ne,1),he.splice(J,0,t.value)),l.value=he}else e.value=null;r.value=_e,c.value=Ie}function Y(_e){if(o.value={...o.value,[_e.id]:_e},_e.id in a.value)a.value[_e.id].resolveMe();else{const Ie=new Fm;Ie.resolveMe(),a.value={...a.value,[_e.id]:Ie}}}function X(_e){l.value=[...l.value,_e]}function te(_e){const Ie=l.value.indexOf(_e);Ie!==-1&&(l.value=[...l.value.slice(0,Ie),...l.value.slice(Ie+1)])}function re(_e,Ie){const ke=l.value.indexOf(_e),Ne=Ie==="right"?1:-1;c.value.includes(l.value[ke+Ne])&&([l.value[ke],l.value[ke+Ne]]=[l.value[ke+Ne],l.value[ke]])}function fe(_e){o.value[_e.id]!==void 0&&delete o.value[_e.id],a.value[_e.id]!==void 0&&delete a.value[_e.id];const Ie=c.value.indexOf(_e);Ie!==-1&&(c.value=[...c.value.slice(0,Ie),...c.value.slice(Ie+1)]),t.value!==null&&t.value.id==_e.id&&(t.value=null)}function ge(_e){a.value={...a.value,[_e]:new Fm}}return{items:o,regPromises:a,orderedItems:l,pinned:t,priority:e,visible:c,stackWidth:i,remWidth:r,mobileView:n,reorderable:s,getRemainingWidth:d,getVisible:p,getRegPromises:y,openPanel:v,closePanel:S,movePanel:I,removePanel:O,setWidth:L,setStackWidth:N,setMobileView:G,updateVisible:V,registerPanel:Y,addRegPromise:ge}}),w1i=Zr({__name:"panel-stack",setup(t){const e=C_(),i=Qs("iApi"),r=Pi(),n=Vr(()=>e.mobileView);al(()=>{new ResizeObserver(d=>{const p=!(i?.$vApp.$root?.$refs["app-size"]).classList.contains("sm");n.value!==p&&(e.mobileView=p,i?.event.emit(an.RAMP_MOBILEVIEW_CHANGE,p)),e.setStackWidth(d[0].contentRect.width)}).observe(r.value?.$el)});const s=c=>e.getVisible(c),o=(c,d)=>{l(c,d,[[6,0],[0,1]])},a=(c,d)=>{const[p,y]=[c.children[0].getBoundingClientRect(),c.parentElement.getBoundingClientRect()];c.style.width=`${p.width}px`,c.style.height=`${p.height}px`,c.style.left=`${p.left-y.left}px`,c.style.position="absolute",l(c,d,[[0,-6],[1,0]])},l=(c,d,p)=>{hp({targets:c,duration:300,translateY:{value:p[0],easing:"cubicBezier(.5, .05, .1, .3)"},opacity:{value:p[1],duration:250,easing:"cubicBezier(.5, .05, .1, .3)"},complete:d})};return(c,d)=>(Kt(),Pn(kPe,{onEnter:o,onLeave:a,name:"panel-container",tag:"div",ref_key:"el",ref:r},{default:yn(()=>[(Kt(!0),ci(eo,null,ou(s(Qt(i).screenSize),p=>(Kt(),Pn(b1i,{key:`${p.id}`,panel:p},null,8,["panel"]))),128))]),_:1},512))}}),NDr="",kl=(t,e)=>{const i=t.__vccOpts||t;for(const[r,n]of e)i[r]=n;return i},x1i=kl(w1i,[["__scopeId","data-v-d1336914"]]);var T_="top",kw="bottom",Nw="right",E_="left",WOe="auto",wK=[T_,kw,Nw,E_],aV="start",xK="end",S1i="clippingParents",_ct="viewport",SK="popper",C1i="reference",bct=wK.reduce(function(t,e){return t.concat([e+"-"+aV,e+"-"+xK])},[]),wct=[].concat(wK,[WOe]).reduce(function(t,e){return t.concat([e,e+"-"+aV,e+"-"+xK])},[]),T1i="beforeRead",E1i="read",I1i="afterRead",A1i="beforeMain",P1i="main",O1i="afterMain",R1i="beforeWrite",M1i="write",D1i="afterWrite",F1i=[T1i,E1i,I1i,A1i,P1i,O1i,R1i,M1i,D1i];function HT(t){return t?(t.nodeName||"").toLowerCase():null}function $w(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function nN(t){var e=$w(t).Element;return t instanceof e||t instanceof Element}function Bw(t){var e=$w(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function qOe(t){if(typeof ShadowRoot>"u")return!1;var e=$w(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function L1i(t){var e=t.state;Object.keys(e.elements).forEach(function(i){var r=e.styles[i]||{},n=e.attributes[i]||{},s=e.elements[i];!Bw(s)||!HT(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 k1i(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.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]:i[r]),a=o.reduce(function(l,c){return l[c]="",l},{});!Bw(n)||!HT(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}const N1i={name:"applyStyles",enabled:!0,phase:"write",fn:L1i,effect:k1i,requires:["computeStyles"]};function WT(t){return t.split("-")[0]}var sN=Math.max,ehe=Math.min,lV=Math.round;function YOe(){var t=navigator.userAgentData;return t!=null&&t.brands?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function xct(){return!/^((?!chrome|android).)*safari/i.test(YOe())}function uV(t,e,i){e===void 0&&(e=!1),i===void 0&&(i=!1);var r=t.getBoundingClientRect(),n=1,s=1;e&&Bw(t)&&(n=t.offsetWidth>0&&lV(r.width)/t.offsetWidth||1,s=t.offsetHeight>0&&lV(r.height)/t.offsetHeight||1);var o=nN(t)?$w(t):window,a=o.visualViewport,l=!xct()&&i,c=(r.left+(l&&a?a.offsetLeft:0))/n,d=(r.top+(l&&a?a.offsetTop:0))/s,p=r.width/n,y=r.height/s;return{width:p,height:y,top:d,right:c+p,bottom:d+y,left:c,x:c,y:d}}function XOe(t){var e=uV(t),i=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:r}}function Sct(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&qOe(i)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function DP(t){return $w(t).getComputedStyle(t)}function $1i(t){return["table","td","th"].indexOf(HT(t))>=0}function lD(t){return((nN(t)?t.ownerDocument:t.document)||window.document).documentElement}function the(t){return HT(t)==="html"?t:t.assignedSlot||t.parentNode||(qOe(t)?t.host:null)||lD(t)}function Cct(t){return!Bw(t)||DP(t).position==="fixed"?null:t.offsetParent}function B1i(t){var e=/firefox/i.test(YOe()),i=/Trident/i.test(YOe());if(i&&Bw(t)){var r=DP(t);if(r.position==="fixed")return null}var n=the(t);for(qOe(n)&&(n=n.host);Bw(n)&&["html","body"].indexOf(HT(n))<0;){var s=DP(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 CK(t){for(var e=$w(t),i=Cct(t);i&&$1i(i)&&DP(i).position==="static";)i=Cct(i);return i&&(HT(i)==="html"||HT(i)==="body"&&DP(i).position==="static")?e:i||B1i(t)||e}function KOe(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function TK(t,e,i){return sN(t,ehe(e,i))}function G1i(t,e,i){var r=TK(t,e,i);return r>i?i:r}function Tct(){return{top:0,right:0,bottom:0,left:0}}function Ect(t){return Object.assign({},Tct(),t)}function Ict(t,e){return e.reduce(function(i,r){return i[r]=t,i},{})}var V1i=function(e,i){return e=typeof e=="function"?e(Object.assign({},i.rects,{placement:i.placement})):e,Ect(typeof e!="number"?e:Ict(e,wK))};function U1i(t){var e,i=t.state,r=t.name,n=t.options,s=i.elements.arrow,o=i.modifiersData.popperOffsets,a=WT(i.placement),l=KOe(a),c=[E_,Nw].indexOf(a)>=0,d=c?"height":"width";if(!(!s||!o)){var p=V1i(n.padding,i),y=XOe(s),v=l==="y"?T_:E_,S=l==="y"?kw:Nw,I=i.rects.reference[d]+i.rects.reference[l]-o[l]-i.rects.popper[d],O=o[l]-i.rects.reference[l],L=CK(s),N=L?l==="y"?L.clientHeight||0:L.clientWidth||0:0,G=I/2-O/2,V=p[v],Y=N-y[d]-p[S],X=N/2-y[d]/2+G,te=TK(V,X,Y),re=l;i.modifiersData[r]=(e={},e[re]=te,e.centerOffset=te-X,e)}}function j1i(t){var e=t.state,i=t.options,r=i.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||Sct(e.elements.popper,n)&&(e.elements.arrow=n))}const z1i={name:"arrow",enabled:!0,phase:"main",fn:U1i,effect:j1i,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function cV(t){return t.split("-")[1]}var H1i={top:"auto",right:"auto",bottom:"auto",left:"auto"};function W1i(t){var e=t.x,i=t.y,r=window,n=r.devicePixelRatio||1;return{x:lV(e*n)/n||0,y:lV(i*n)/n||0}}function Act(t){var e,i=t.popper,r=t.popperRect,n=t.placement,s=t.variation,o=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,p=t.isFixed,y=o.x,v=y===void 0?0:y,S=o.y,I=S===void 0?0:S,O=typeof d=="function"?d({x:v,y:I}):{x:v,y:I};v=O.x,I=O.y;var L=o.hasOwnProperty("x"),N=o.hasOwnProperty("y"),G=E_,V=T_,Y=window;if(c){var X=CK(i),te="clientHeight",re="clientWidth";if(X===$w(i)&&(X=lD(i),DP(X).position!=="static"&&a==="absolute"&&(te="scrollHeight",re="scrollWidth")),X=X,n===T_||(n===E_||n===Nw)&&s===xK){V=kw;var fe=p&&X===Y&&Y.visualViewport?Y.visualViewport.height:X[te];I-=fe-r.height,I*=l?1:-1}if(n===E_||(n===T_||n===kw)&&s===xK){G=Nw;var ge=p&&X===Y&&Y.visualViewport?Y.visualViewport.width:X[re];v-=ge-r.width,v*=l?1:-1}}var _e=Object.assign({position:a},c&&H1i),Ie=d===!0?W1i({x:v,y:I}):{x:v,y:I};if(v=Ie.x,I=Ie.y,l){var ke;return Object.assign({},_e,(ke={},ke[V]=N?"0":"",ke[G]=L?"0":"",ke.transform=(Y.devicePixelRatio||1)<=1?"translate("+v+"px, "+I+"px)":"translate3d("+v+"px, "+I+"px, 0)",ke))}return Object.assign({},_e,(e={},e[V]=N?I+"px":"",e[G]=L?v+"px":"",e.transform="",e))}function q1i(t){var e=t.state,i=t.options,r=i.gpuAcceleration,n=r===void 0?!0:r,s=i.adaptive,o=s===void 0?!0:s,a=i.roundOffsets,l=a===void 0?!0:a,c={placement:WT(e.placement),variation:cV(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,Act(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Act(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Y1i={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:q1i,data:{}};var ihe={passive:!0};function X1i(t){var e=t.state,i=t.instance,r=t.options,n=r.scroll,s=n===void 0?!0:n,o=r.resize,a=o===void 0?!0:o,l=$w(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(d){d.addEventListener("scroll",i.update,ihe)}),a&&l.addEventListener("resize",i.update,ihe),function(){s&&c.forEach(function(d){d.removeEventListener("scroll",i.update,ihe)}),a&&l.removeEventListener("resize",i.update,ihe)}}const K1i={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:X1i,data:{}};var J1i={left:"right",right:"left",bottom:"top",top:"bottom"};function rhe(t){return t.replace(/left|right|bottom|top/g,function(e){return J1i[e]})}var Z1i={start:"end",end:"start"};function Pct(t){return t.replace(/start|end/g,function(e){return Z1i[e]})}function JOe(t){var e=$w(t),i=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:i,scrollTop:r}}function ZOe(t){return uV(lD(t)).left+JOe(t).scrollLeft}function Q1i(t,e){var i=$w(t),r=lD(t),n=i.visualViewport,s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(n){s=n.width,o=n.height;var c=xct();(c||!c&&e==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:s,height:o,x:a+ZOe(t),y:l}}function ebi(t){var e,i=lD(t),r=JOe(t),n=(e=t.ownerDocument)==null?void 0:e.body,s=sN(i.scrollWidth,i.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=sN(i.scrollHeight,i.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-r.scrollLeft+ZOe(t),l=-r.scrollTop;return DP(n||i).direction==="rtl"&&(a+=sN(i.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function QOe(t){var e=DP(t),i=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+n+r)}function Oct(t){return["html","body","#document"].indexOf(HT(t))>=0?t.ownerDocument.body:Bw(t)&&QOe(t)?t:Oct(the(t))}function EK(t,e){var i;e===void 0&&(e=[]);var r=Oct(t),n=r===((i=t.ownerDocument)==null?void 0:i.body),s=$w(r),o=n?[s].concat(s.visualViewport||[],QOe(r)?r:[]):r,a=e.concat(o);return n?a:a.concat(EK(the(o)))}function e3e(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function tbi(t,e){var i=uV(t,!1,e==="fixed");return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}function Rct(t,e,i){return e===_ct?e3e(Q1i(t,i)):nN(e)?tbi(e,i):e3e(ebi(lD(t)))}function ibi(t){var e=EK(the(t)),i=["absolute","fixed"].indexOf(DP(t).position)>=0,r=i&&Bw(t)?CK(t):t;return nN(r)?e.filter(function(n){return nN(n)&&Sct(n,r)&&HT(n)!=="body"}):[]}function rbi(t,e,i,r){var n=e==="clippingParents"?ibi(t):[].concat(e),s=[].concat(n,[i]),o=s[0],a=s.reduce(function(l,c){var d=Rct(t,c,r);return l.top=sN(d.top,l.top),l.right=ehe(d.right,l.right),l.bottom=ehe(d.bottom,l.bottom),l.left=sN(d.left,l.left),l},Rct(t,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 Mct(t){var e=t.reference,i=t.element,r=t.placement,n=r?WT(r):null,s=r?cV(r):null,o=e.x+e.width/2-i.width/2,a=e.y+e.height/2-i.height/2,l;switch(n){case T_:l={x:o,y:e.y-i.height};break;case kw:l={x:o,y:e.y+e.height};break;case Nw:l={x:e.x+e.width,y:a};break;case E_:l={x:e.x-i.width,y:a};break;default:l={x:e.x,y:e.y}}var c=n?KOe(n):null;if(c!=null){var d=c==="y"?"height":"width";switch(s){case aV:l[c]=l[c]-(e[d]/2-i[d]/2);break;case xK:l[c]=l[c]+(e[d]/2-i[d]/2);break}}return l}function IK(t,e){e===void 0&&(e={});var i=e,r=i.placement,n=r===void 0?t.placement:r,s=i.strategy,o=s===void 0?t.strategy:s,a=i.boundary,l=a===void 0?S1i:a,c=i.rootBoundary,d=c===void 0?_ct:c,p=i.elementContext,y=p===void 0?SK:p,v=i.altBoundary,S=v===void 0?!1:v,I=i.padding,O=I===void 0?0:I,L=Ect(typeof O!="number"?O:Ict(O,wK)),N=y===SK?C1i:SK,G=t.rects.popper,V=t.elements[S?N:y],Y=rbi(nN(V)?V:V.contextElement||lD(t.elements.popper),l,d,o),X=uV(t.elements.reference),te=Mct({reference:X,element:G,strategy:"absolute",placement:n}),re=e3e(Object.assign({},G,te)),fe=y===SK?re:X,ge={top:Y.top-fe.top+L.top,bottom:fe.bottom-Y.bottom+L.bottom,left:Y.left-fe.left+L.left,right:fe.right-Y.right+L.right},_e=t.modifiersData.offset;if(y===SK&&_e){var Ie=_e[n];Object.keys(ge).forEach(function(ke){var Ne=[Nw,kw].indexOf(ke)>=0?1:-1,J=[T_,kw].indexOf(ke)>=0?"y":"x";ge[ke]+=Ie[J]*Ne})}return ge}function nbi(t,e){e===void 0&&(e={});var i=e,r=i.placement,n=i.boundary,s=i.rootBoundary,o=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=l===void 0?wct:l,d=cV(r),p=d?a?bct:bct.filter(function(S){return cV(S)===d}):wK,y=p.filter(function(S){return c.indexOf(S)>=0});y.length===0&&(y=p);var v=y.reduce(function(S,I){return S[I]=IK(t,{placement:I,boundary:n,rootBoundary:s,padding:o})[WT(I)],S},{});return Object.keys(v).sort(function(S,I){return v[S]-v[I]})}function sbi(t){if(WT(t)===WOe)return[];var e=rhe(t);return[Pct(t),e,Pct(e)]}function obi(t){var e=t.state,i=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var n=i.mainAxis,s=n===void 0?!0:n,o=i.altAxis,a=o===void 0?!0:o,l=i.fallbackPlacements,c=i.padding,d=i.boundary,p=i.rootBoundary,y=i.altBoundary,v=i.flipVariations,S=v===void 0?!0:v,I=i.allowedAutoPlacements,O=e.options.placement,L=WT(O),N=L===O,G=l||(N||!S?[rhe(O)]:sbi(O)),V=[O].concat(G).reduce(function(et,tt){return et.concat(WT(tt)===WOe?nbi(e,{placement:tt,boundary:d,rootBoundary:p,padding:c,flipVariations:S,allowedAutoPlacements:I}):tt)},[]),Y=e.rects.reference,X=e.rects.popper,te=new Map,re=!0,fe=V[0],ge=0;ge=0,J=Ne?"width":"height",he=IK(e,{placement:_e,boundary:d,rootBoundary:p,altBoundary:y,padding:c}),xe=Ne?ke?Nw:E_:ke?kw:T_;Y[J]>X[J]&&(xe=rhe(xe));var Pe=rhe(xe),Oe=[];if(s&&Oe.push(he[Ie]<=0),a&&Oe.push(he[xe]<=0,he[Pe]<=0),Oe.every(function(et){return et})){fe=_e,re=!1;break}te.set(_e,Oe)}if(re)for(var Ae=S?3:1,ze=function(tt){var ft=V.find(function(Pt){var $t=te.get(Pt);if($t)return $t.slice(0,tt).every(function(St){return St})});if(ft)return fe=ft,"break"},Ge=Ae;Ge>0;Ge--){var Je=ze(Ge);if(Je==="break")break}e.placement!==fe&&(e.modifiersData[r]._skip=!0,e.placement=fe,e.reset=!0)}}const abi={name:"flip",enabled:!0,phase:"main",fn:obi,requiresIfExists:["offset"],data:{_skip:!1}};function Dct(t,e,i){return i===void 0&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Fct(t){return[T_,Nw,kw,E_].some(function(e){return t[e]>=0})}function lbi(t){var e=t.state,i=t.name,r=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=IK(e,{elementContext:"reference"}),a=IK(e,{altBoundary:!0}),l=Dct(o,r),c=Dct(a,n,s),d=Fct(l),p=Fct(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}const ubi={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:lbi};function cbi(t,e,i){var r=WT(t),n=[E_,T_].indexOf(r)>=0?-1:1,s=typeof i=="function"?i(Object.assign({},e,{placement:t})):i,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[E_,Nw].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function hbi(t){var e=t.state,i=t.options,r=t.name,n=i.offset,s=n===void 0?[0,0]:n,o=wct.reduce(function(d,p){return d[p]=cbi(p,e.rects,s),d},{}),a=o[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}const dbi={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:hbi};function pbi(t){var e=t.state,i=t.name;e.modifiersData[i]=Mct({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const fbi={name:"popperOffsets",enabled:!0,phase:"read",fn:pbi,data:{}};function mbi(t){return t==="x"?"y":"x"}function gbi(t){var e=t.state,i=t.options,r=t.name,n=i.mainAxis,s=n===void 0?!0:n,o=i.altAxis,a=o===void 0?!1:o,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,p=i.padding,y=i.tether,v=y===void 0?!0:y,S=i.tetherOffset,I=S===void 0?0:S,O=IK(e,{boundary:l,rootBoundary:c,padding:p,altBoundary:d}),L=WT(e.placement),N=cV(e.placement),G=!N,V=KOe(L),Y=mbi(V),X=e.modifiersData.popperOffsets,te=e.rects.reference,re=e.rects.popper,fe=typeof I=="function"?I(Object.assign({},e.rects,{placement:e.placement})):I,ge=typeof fe=="number"?{mainAxis:fe,altAxis:fe}:Object.assign({mainAxis:0,altAxis:0},fe),_e=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,Ie={x:0,y:0};if(X){if(s){var ke,Ne=V==="y"?T_:E_,J=V==="y"?kw:Nw,he=V==="y"?"height":"width",xe=X[V],Pe=xe+O[Ne],Oe=xe-O[J],Ae=v?-re[he]/2:0,ze=N===aV?te[he]:re[he],Ge=N===aV?-re[he]:-te[he],Je=e.elements.arrow,et=v&&Je?XOe(Je):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Tct(),ft=tt[Ne],Pt=tt[J],$t=TK(0,te[he],et[he]),St=G?te[he]/2-Ae-$t-ft-ge.mainAxis:ze-$t-ft-ge.mainAxis,Tt=G?-te[he]/2+Ae+$t+Pt+ge.mainAxis:Ge+$t+Pt+ge.mainAxis,Lt=e.elements.arrow&&CK(e.elements.arrow),at=Lt?V==="y"?Lt.clientTop||0:Lt.clientLeft||0:0,Ee=(ke=_e?.[V])!=null?ke:0,Be=xe+St-Ee-at,mt=xe+Tt-Ee,kt=TK(v?ehe(Pe,Be):Pe,xe,v?sN(Oe,mt):Oe);X[V]=kt,Ie[V]=kt-xe}if(a){var ct,le=V==="x"?T_:E_,it=V==="x"?kw:Nw,pt=X[Y],Le=Y==="y"?"height":"width",ce=pt+O[le],Ce=pt-O[it],Ze=[T_,E_].indexOf(L)!==-1,yt=(ct=_e?.[Y])!=null?ct:0,Ve=Ze?ce:pt-te[Le]-re[Le]-yt+ge.altAxis,At=Ze?pt+te[Le]+re[Le]-yt-ge.altAxis:Ce,ii=v&&Ze?G1i(Ve,pt,At):TK(v?Ve:ce,pt,v?At:Ce);X[Y]=ii,Ie[Y]=ii-pt}e.modifiersData[r]=Ie}}const ybi={name:"preventOverflow",enabled:!0,phase:"main",fn:gbi,requiresIfExists:["offset"]};function vbi(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function _bi(t){return t===$w(t)||!Bw(t)?JOe(t):vbi(t)}function bbi(t){var e=t.getBoundingClientRect(),i=lV(e.width)/t.offsetWidth||1,r=lV(e.height)/t.offsetHeight||1;return i!==1||r!==1}function wbi(t,e,i){i===void 0&&(i=!1);var r=Bw(e),n=Bw(e)&&bbi(e),s=lD(e),o=uV(t,n,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!i)&&((HT(e)!=="body"||QOe(s))&&(a=_bi(e)),Bw(e)?(l=uV(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=ZOe(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function xbi(t){var e=new Map,i=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function n(s){i.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!i.has(a)){var l=e.get(a);l&&n(l)}}),r.push(s)}return t.forEach(function(s){i.has(s.name)||n(s)}),r}function Sbi(t){var e=xbi(t);return F1i.reduce(function(i,r){return i.concat(e.filter(function(n){return n.phase===r}))},[])}function Cbi(t){var e;return function(){return e||(e=new Promise(function(i){Promise.resolve().then(function(){e=void 0,i(t())})})),e}}function Tbi(t){var e=t.reduce(function(i,r){var n=i[r.name];return i[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,i},{});return Object.keys(e).map(function(i){return e[i]})}var Lct={placement:"bottom",modifiers:[],strategy:"absolute"};function kct(){for(var t=arguments.length,e=new Array(t),i=0;i{r.value.update()})),al(()=>{window.addEventListener("click",l=>{(!s.value||!s.value.contains(l.target))&&(i.value=!1)},{capture:!0}),window.addEventListener("blur",()=>{i.value=!1}),window.addEventListener("focusin",l=>{(!s.value||!s.value.contains(l.target))&&(i.value=!1)}),iy(()=>{a.value&&o.value&&(r.value=Abi(a.value,o.value,{placement:e.position||"bottom",modifiers:[{name:"offset",options:{offset:[0,5]}}],...e.popperOptions}))})}),su(()=>{n.forEach(l=>l()),window.removeEventListener("click",l=>{(!s.value||!s.value.contains(l.target))&&(i.value=!1)},{capture:!0}),window.removeEventListener("blur",()=>{i.value=!1}),window.removeEventListener("focusin",l=>{(!s.value||!s.value.contains(l.target))&&(i.value=!1)}),i.value=!1}),(l,c)=>{const d=Qn("tippy");return Kt(),ci("div",{ref_key:"el",ref:s},[Br((Kt(),ci("button",{type:"button",class:"text-gray-500 hover:text-black dropdown-button",onClick:c[0]||(c[0]=p=>i.value=!i.value),content:t.tooltip,ref_key:"dropdownTrigger",ref:a},[jf(l.$slots,"header")],8,Pbi)),[[d,{placement:t.tooltipPlacement,theme:t.tooltipTheme,animation:t.tooltipAnimation,appendTo:"parent"}]]),Br(Mt("div",{onClick:c[1]||(c[1]=p=>r.value.update()),class:fs(["rv-dropdown shadow-md border border-gray:200 py-8 bg-white rounded z-10",{"text-center":t.centered}]),ref_key:"dropdown",ref:o},[jf(l.$slots,"default",{close:()=>i.value=!i.value})],2),[[Bp,i.value]])],512)}}}),$Dr="",qT=Vp("notification",()=>{const t=Pi([]),e=Pi({}),i=Vr(()=>t.value.length>=99?99:t.value.length);function r(c){t.value=[c,...t.value]}function n(c){if(t.value.includes(c)){const d=t.value.indexOf(c);c instanceof Nct&&l(c),d>-1&&t.value.splice(d,1)}}function s(c){e.value[c.id]=c}function o(c,d){e.value[c]&&(e.value[c].messageList.push(d),t.value.includes(e.value[c])||(t.value=[e.value[c],...t.value]))}function a(){Object.values(e.value).forEach(c=>l(c)),t.value=[]}function l(c){const d=t.value.indexOf(c);d>-1&&t.value.splice(d,1),c.messageList=[]}return{notificationStack:t,groups:e,notificationNumber:i,showNotification:r,removeNotification:n,registerGroup:s,addToGroup:o,clearAll:a}}),Obi={class:"h-full flex flex-col"},Rbi={class:"w-full flex mb-6"},Mbi=["content"],Dbi=[Mt("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current h-24 w-24"},[Mt("path",{d:"M0 0h24v24H0z",fill:"none"}),Mt("path",{d:"M5 13h14v-2H5v2zm-2 4h14v-2H3v2zM7 7v2h14V7H7z"})],-1)],Fbi=Zr({__name:"screen",props:{panel:{type:Object,required:!0}},setup(t){const e=qT(),{t:i}=qn(),r=Vr(()=>e.notificationNumber),n=()=>e.clearAll();return(s,o)=>{const a=Io("panel-screen"),l=Qn("tippy");return Kt(),Pn(a,{panel:t.panel},{header:yn(()=>[Fs(gr(Qt(i)("notifications.title")),1)]),content:yn(()=>[Mt("div",Obi,[Mt("div",Rbi,[Br((Kt(),ci("button",{type:"button",onClick:n,class:fs(["p-4 ml-auto",[Qt(r)?"text-gray-500 hover:text-black":"text-gray-300 cursor-default pointer-events-none"]]),content:Qt(i)("notifications.controls.clearAll")},Dbi,10,Mbi)),[[l,{placement:"bottom",theme:"ramp4",animation:"scale"}]])]),Rn($ct,{class:"overflow-y-auto"})])]),_:1},8,["panel"])}}});var uD=(t=>(t.ERROR="error",t.INFO="info",t.WARNING="warning",t))(uD||{});class Lbi extends Np{notificationStore;constructor(e){super(e),this.$iApi.panel.register({id:"notifications",config:{screens:{"notifications-screen":Ho(Fbi)},alertName:"notifications.title"}}),this.notificationStore=qT(this.$vApp.$pinia)}show(e,i){this.notificationStore.showNotification({type:e,message:i})}addGroup(e,i,r){if(this.getGroup(e))throw new Error("Duplicate notification group id registration: "+e);const n=new Nct(this.$iApi,e,i,r);return this.notificationStore.registerGroup(n),n}getGroup(e){return this.notificationStore.groups[e]}}class Nct extends Np{notificationStore=qT(this.$vApp.$pinia);id;message;type;messageList=[];constructor(e,i,r,n){super(e),this.id=i,this.type=r,this.message=n}show(e){this.notificationStore.addToGroup(this.id,e)}}const kbi=["content"],Nbi={class:"flex items-center text-left"},$bi=Mt("span",{class:"flex-grow"},null,-1),Bbi=[Mt("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},[Mt("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})],-1)],Gbi=["content"],Vbi=[Mt("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},[Mt("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)],Ubi={key:0,class:"text-left"},jbi=Zr({__name:"notification-item",props:{notification:{type:Object,required:!0}},setup(t){const e=t,i=qT(),{t:r}=qn(),n=Pi(!1),s=Tl({[uD.WARNING]:"⚠",[uD.INFO]:"☑",[uD.ERROR]:"❌"}),o=l=>{i.removeNotification(l)},a=()=>{if(!e.notification.messageList)return!1};return(l,c)=>{const d=Qn("tippy");return Br((Kt(),ci("li",{class:fs(["flex-col default-focus-style p-4",t.notification.messageList?"cursor-pointer":""]),content:Qt(r)(n.value?"notifications.controls.collapse":"notifications.controls.expand"),onClick:c[1]||(c[1]=p=>n.value=!n.value)},[Mt("div",Nbi,[Mt("span",null,gr(s[t.notification.type])+" "+gr(t.notification.message),1),$bi,t.notification.messageList?(Kt(),ci("div",{key:0,class:fs(["dropdown-icon p-4 pointer-events-none",{"transform -rotate-180":n.value}])},Bbi,2)):hn("",!0),Br((Kt(),ci("button",{type:"button",onClick:c[0]||(c[0]=_a(p=>o(t.notification),["stop"])),class:"mx-4 p-4",content:Qt(r)("notifications.controls.dismiss")},Vbi,8,Gbi)),[[d,{theme:"ramp4",animation:"scale"}]])]),t.notification.messageList&&n.value?(Kt(),ci("div",Ubi,[(Kt(!0),ci(eo,null,ou(t.notification.messageList,(p,y)=>(Kt(),ci("p",{key:t.notification.id+p+y},gr(p),1))),128))])):hn("",!0)],10,kbi)),[[d,{onShow:a,theme:"ramp4",animation:"scale"}]])}}}),UDr="",zbi={key:0},Hbi={key:0,class:"w-full border-b border-black"},Wbi={key:1,class:"flex flex-col items-center h-full"},qbi=Mt("span",{class:"flex-grow"},null,-1),Ybi=Mt("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"h-48 w-48 fill-current"},[Mt("path",{d:"M0 0h24v24H0z",fill:"none"}),Mt("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),Xbi=Mt("span",{style:{"flex-grow":"6"}},null,-1),$ct=Zr({__name:"notification-list",setup(t){const e=qT(),{t:i}=qn(),r=Vr(()=>e.notificationStack);return(n,s)=>{const o=Qn("focus-item"),a=Qn("focus-list");return Kt(),ci("div",null,[Qt(r).length>0?Br((Kt(),ci("ul",zbi,[(Kt(!0),ci(eo,null,ou(Qt(r),(l,c)=>(Kt(),ci(eo,{key:l.message+c},[c>0?(Kt(),ci("div",Hbi)):hn("",!0),Br(Rn(jbi,{class:fs([l.type]),notification:l},null,8,["class","notification"]),[[o]])],64))),128))])),[[a]]):(Kt(),ci("div",Wbi,[qbi,Ybi,Mt("span",null,gr(Qt(i)("notifications.empty")),1),Xbi]))])}}}),Bct=t=>(Xc("data-v-60b0e75f"),t=t(),Kc(),t),Kbi={class:"flex items-center hover:text-white"},Jbi=["aria-label"],Zbi=[Bct(()=>Mt("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))],Qbi={key:0,class:"number rounded-full w-18 text-white"},ewi={class:"notification-dropdown pointer-events-auto bg-white rounded text-center text-black w-500 h-256 flex flex-col p-0"},twi={class:"pb-8 border-b border-gray-600"},iwi={class:"absolute flex right-3 top-3"},rwi=["content"],nwi=[Bct(()=>Mt("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current h-24 w-24"},[Mt("path",{d:"M0 0h24v24H0z",fill:"none"}),Mt("path",{d:"M5 13h14v-2H5v2zm-2 4h14v-2H3v2zM7 7v2h14V7H7z"})],-1))],swi=Zr({__name:"caption-button",setup(t){const e=qT(),{t:i}=qn(),r=Vr(()=>e.notificationNumber),n=()=>e.clearAll();return(s,o)=>{const a=Io("close"),l=Qn("tippy");return Kt(),Pn(t3e,{position:"top-start",tooltip:Qt(i)("notifications.title"),tooltipPlacement:"top",class:"pointer-events-auto sm:flex ml-4 mr-8"},{header:yn(()=>[Mt("div",Kbi,[(Kt(),ci("svg",{class:"fill-current w-24 h-24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-label":Qt(i)("notifications.open")},Zbi,8,Jbi)),Qt(r)&&Qt(r)>0?(Kt(),ci("span",Qbi,gr(Qt(r)),1)):hn("",!0)])]),default:yn(c=>[Mt("div",ewi,[Mt("div",null,[Mt("h4",twi,gr(Qt(i)("notifications.title")),1),Mt("div",iwi,[Br((Kt(),ci("button",{type:"button",onClick:n,class:fs(["p-4 mr-6",[Qt(r)?"text-gray-500 hover:text-black":"text-gray-300 cursor-default pointer-events-none"]]),content:Qt(i)("notifications.controls.clearAll")},nwi,10,rwi)),[[l,{placement:"bottom",theme:"ramp4",animation:"scale",appendTo:"parent"}]]),Rn(a,{onClick:c.close},null,8,["onClick"])])]),Rn($ct,{class:"overflow-y-auto h-230"})])]),_:1},8,["tooltip"])}}}),HDr="",owi=kl(swi,[["__scopeId","data-v-60b0e75f"]]),Gct=t=>(Xc("data-v-d52f3169"),t=t(),Kc(),t),awi={class:"flex hover:text-white"},lwi=["aria-label"],uwi=[Gct(()=>Mt("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))],cwi={class:"about-ramp-dropdown pointer-events-auto bg-white rounded w-256 h-50"},hwi={class:"pb-8 border-b border-gray-600 mb-10"},dwi={class:"absolute right-5 top-5"},pwi={class:"select-text"},fwi={class:"font-bold cursor-text"},mwi={class:"text-sm cursor-text"},gwi={class:"text-sm cursor-text"},ywi=Gct(()=>Mt("div",{class:"mt-5"},[Mt("a",{class:"text-sm underline text-blue-600",href:"https://github.com/ramp4-pcar4/ramp4-pcar4",target:"_blank"},[Mt("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"inline-block fill-black w-16 h-16"},[Mt("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"})]),Fs(" ramp4-pcar4 ")])],-1)),vwi=Zr({__name:"about-ramp-dropdown",props:{position:{type:String,default:"top-start"}},setup(t){const{t:e}=qn(),i=Vr(()=>`${SV.major}.${SV.minor}.${SV.patch}`),r=Vr(()=>SV.hash.slice(0,9)),n=Vr(()=>{let s=new Date(SV.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=Io("close"),l=Io("dropdown-menu"),c=Qn("focus-item");return Br((Kt(),Pn(l,{class:"pointer-events-auto sm:flex",position:t.position,tooltip:Qt(e)("ramp.about"),tooltipPlacement:t.position},{header:yn(()=>[Mt("div",awi,[(Kt(),ci("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-20 h-20","aria-label":Qt(e)("ramp.about.open")},uwi,8,lwi))])]),default:yn(d=>[Mt("div",cwi,[Mt("div",null,[Mt("h4",hwi,gr(Qt(e)("ramp.about")),1),Mt("div",dwi,[Rn(a,{onClick:d.close},null,8,["onClick"])]),Mt("div",pwi,[Mt("div",null,[Mt("span",fwi,gr(Qt(i)),1),Mt("span",mwi," ["+gr(Qt(r))+"] ",1)]),Mt("div",null,[Mt("span",gwi,gr(Qt(n)),1)]),ywi])])])]),_:1},8,["position","tooltip","tooltipPlacement"])),[[c]])}}}),qDr="",Vct=kl(vwi,[["__scopeId","data-v-d52f3169"]]),_wi={class:"map-caption absolute bottom-0 flex justify-end pointer-events-auto cursor-default select-none text-gray-400 bg-black-75 left-0 right-0 py-2 sm:py-6"},bwi={key:0,class:"relative top-2 sm:top-1 ml-4 sm:ml-0 shrink-0"},wwi=["href","aria-label"],xwi=["src","alt"],Swi={key:1,class:"relative ml-10 top-2 text-sm sm:text-base"},Cwi=Mt("span",{class:"flex-grow w-15"},null,-1),Twi={class:"flex min-w-fit justify-end"},Ewi={key:0,class:"pl-8 px-14 sm:block display-none relative top-2"},Iwi=["aria-pressed","aria-label","content"],Awi={class:"relative top-1 text-sm sm:text-base"},Pwi={class:"text-gray-400 hover:text-white text-sm sm:text-base pb-5"},Owi=["onClick"],Rwi={key:0,class:"sr-only"},Mwi=Zr({__name:"map-caption",setup(t){const e=rD(),i=dg(),{t:r}=qn(),n=Qs("iApi"),s=Vr(()=>e.scale),o=Vr(()=>e.attribution),a=Vr(()=>e.coords),l=Vr(()=>i.config.map),c=Pi([]),d=Tl([]);d.push(Sc(l,v=>{v&&n.geo.map.caption.createCaption(l.value?.caption)})),su(()=>{d.forEach(v=>v())}),Hk(()=>{iy(()=>{n.$i18n.locale.value&&c.value.length==0&&(c.value=n.$i18n.availableLocales)})});const p=v=>{n.$i18n.locale.value!=v&&n.setLanguage(v)},y=()=>{e.toggleScale(),n.geo.map.caption.updateScale()};return(v,S)=>{const I=Io("dropdown-menu"),O=Qn("truncate"),L=Qn("tippy");return Kt(),ci("div",_wi,[Rn(Vct,{class:"sm:block display-none ml-8 mr-4",position:"top-end"}),Rn(owi,{class:"sm:block display-none"}),Qt(o)?.logo.disabled?hn("",!0):(Kt(),ci("span",bwi,[Mt("a",{class:"pointer-events-auto cursor-pointer",href:Qt(o)?.logo.link,target:"_blank","aria-label":Qt(o)?.logo.altText},[Mt("img",{class:"object-contain h-18 sm:h-26",src:Qt(o)?.logo.value,alt:Qt(o)?.logo.altText},null,8,xwi)],8,wwi)])),Qt(o)?.text.disabled?hn("",!0):Br((Kt(),ci("span",Swi,[Fs(gr(Qt(o)?.text.value),1)])),[[O,{options:{placement:"top",hideOnClick:!1,theme:"ramp4",animation:"scale"}}]]),Cwi,Mt("div",Twi,[Qt(a)?.disabled?hn("",!0):Br((Kt(),ci("div",Ewi,[Fs(gr(Qt(a)?.formattedString),1)])),[[O,{options:{hideOnClick:!1,theme:"ramp4",animation:"scale"}}]]),Qt(s)?.disabled?hn("",!0):Br((Kt(),ci("button",{key:1,type:"button",class:"flex-shrink-0 mx-2 sm:mx-10 px-4 pointer-events-auto cursor-pointer border-none",onClick:y,"aria-pressed":Qt(s)?.isImperialScale,"aria-label":Qt(r)("map.toggleScaleUnits"),content:Qt(r)("map.toggleScaleUnits")},[Mt("span",{class:"border-solid border-2 border-white border-t-0 h-5 mr-4 inline-block",style:tb({width:Qt(s)?.width})},null,4),Mt("span",Awi,gr(Qt(s)?.label),1)],8,Iwi)),[[L,{delay:[300,0],placement:"top",hideOnClick:!1,theme:"ramp4",animation:"scale",touch:["hold",200]}]]),Br((Kt(),Pn(I,{class:"flex-shrink-0 pointer-events-auto focus:outline-none px-4 mr-4 relative top-2",position:"top-end",content:Qt(r)("map.changeLanguage")},{header:yn(()=>[Mt("span",Pwi,gr(Qt(r)("map.language.short")),1)]),default:yn(()=>[(Kt(!0),ci(eo,null,ou(c.value,(N,G)=>(Kt(),ci("a",{key:`${N}-${G}`,class:fs(["flex-auto items-center text-sm sm:text-base cursor-pointer",{"font-bold":N===v.$iApi.$i18n.locale.value}]),href:"javascript:;",onClick:V=>p(N)},[Fs(gr(Qt(r)("map.language."+N))+" ",1),N===v.$iApi.$i18n.locale.value?(Kt(),ci("span",Rwi,gr(Qt(r)("map.language.curr")),1)):hn("",!0)],10,Owi))),128))]),_:1},8,["content"])),[[L,{delay:[300,0],placement:"top-end",theme:"ramp4",animation:"scale",touch:["hold",200]}]])])])}}}),YDr="",Dwi=t=>(Xc("data-v-e3d7209b"),t=t(),Kc(),t),Fwi=["content"],Lwi=Dwi(()=>Mt("svg",{class:"fill-current w-24 h-24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Mt("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)),kwi={key:0,class:"number absolute -top-2 -right-2 text-white w-18 rounded-full"},Nwi=Zr({__name:"floating-button",setup(t){const e=qT(),{t:i}=qn(),r=Vr(()=>e.notificationNumber);return(n,s)=>{const o=Qn("tippy");return Br((Kt(),ci("button",{type:"button",onClick:s[0]||(s[0]=a=>n.$iApi.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:Qt(i)("notifications.title")},[Lwi,Qt(r)&&Qt(r)>0?(Kt(),ci("span",kwi,gr(Qt(r)),1)):hn("",!0)],8,Fwi)),[[o]])}}}),XDr="",$wi=kl(Nwi,[["__scopeId","data-v-e3d7209b"]]),Bwi={class:"flex items-center mb-20"},Gwi={class:"text-xl"},Vwi=Zr({__name:"keyboard-instructions",setup(t){const e=Qs("iApi"),{t:i}=qn(),r=Pi(!1),n=Pi(["app","lists","map"]),s=Pi([]),o=Pi(null),a=Pi(null);al(()=>{s.value.push(e.event.on("openKeyboardInstructions",()=>{r.value=!0,iy(()=>{o.value.focus()})}))}),su(()=>{s.value.forEach(c=>e?.event.off(c))});const l=c=>{c.key==="Tab"?c.shiftKey&&c.target===o.value?(c.preventDefault(),a.value.focus()):!c.shiftKey&&c.target===a.value&&(c.preventDefault(),o.value.focus()):c.key==="Escape"&&(c.preventDefault(),r.value=!1)};return(c,d)=>{const p=Io("close");return r.value?(Kt(),ci("div",{key:0,class:"absolute inset-0 flex justify-center items-center bg-opacity-30 bg-black z-50 pointer-events-auto",onClick:d[3]||(d[3]=y=>r.value=!1),onKeydown:l},[Mt("div",{class:"bg-white w-500 pointer-events-auto shadow-2xl p-20 flex flex-col",onClick:d[2]||(d[2]=_a(()=>{},["stop","prevent"])),tabindex:"0",ref_key:"firstEl",ref:o},[Mt("div",Bwi,[Mt("h2",Gwi,gr(Qt(i)("keyboardInstructions.title")),1),Rn(p,{class:"ml-auto",onClick:d[0]||(d[0]=y=>r.value=!1)})]),(Kt(!0),ci(eo,null,ou(n.value,y=>(Kt(),ci("p",{class:"whitespace-pre-line pb-10",key:y},gr(Qt(i)(`keyboardInstructions.${y}`)),1))),128)),Mt("button",{type:"button",class:"mt-auto self-end mr-10 mb-10 px-20 py-10",onClick:d[1]||(d[1]=y=>r.value=!1),ref_key:"lastEl",ref:a},gr(Qt(i)("keyboardInstructions.OK")),513)],512)],32)):hn("",!0)}}}),FP=Vp("fixture",()=>{const t=Pi({}),e=Pi({});function i(o){return o.map(a=>e.value[a].getPromise())}function r(o){if(t.value={...t.value,[o.id]:Ho(o)},o.id in e.value)e.value[o.id].resolveMe();else{const a=new Fm;a.resolveMe(),e.value={...e.value,[o.id]:a}}typeof o.added=="function"&&o.added()}function n(o){delete t.value[o.id],t.value={...t.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 Fm}}return{items:t,loadPromises:e,getLoadPromises:i,addFixture:r,removeFixture:n,addLoadPromise:s}}),hV=Vp("instance",()=>({started:Pi(!1)})),Uct=t=>(Xc("data-v-97e56545"),t=t(),Kc(),t),Uwi={class:"h-full relative"},jwi={class:"inner-shell absolute top-0 left-0 h-full w-full pointer-events-none"},zwi=Uct(()=>Mt("div",{class:"sr-only screen-reader-alert"},null,-1)),Hwi={class:"absolute top-8 w-full flex justify-center"},Wwi={key:1,class:"w-full h-full"},qwi=[Uct(()=>Mt("div",{class:"spinner relative inset-x-1/2 inset-y-9/20"},null,-1))],Ywi=Zr({__name:"shell",setup(t){const e=Qs("iApi"),i=hV(),r=FP(),{t:n}=qn(),s=Vr(()=>r.items.appbar),o=()=>{e?.event.emit("openKeyboardInstructions")};return(a,l)=>(Kt(),ci("div",Uwi,[Mt("div",jwi,[zwi,Mt("div",Hwi,[Mt("button",{type:"button",class:"bg-white opacity-0 focus:opacity-100 z-50 shadow-md px-10",onClick:o},gr(Qt(n)("keyboardInstructions.open")),1)]),Rn(Vwi),Rn(x1i,{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"}),Qt(s)?hn("",!0):(Kt(),Pn($wi,{key:0})),Rn(Mwi,{class:"z-30"})]),Qt(i).started?(Kt(),Pn(z_i,{key:0})):(Kt(),ci("div",Wwi,qwi))]))}}),JDr="",Xwi=kl(Ywi,[["__scopeId","data-v-97e56545"]]);if("ResizeObserver"in self)var Kwi=new ResizeObserver(function(t){var e={xs:200,sm:576,md:768,lg:960};t.forEach(function(i){var r=i.target.dataset.breakpoints?JSON.parse(i.target.dataset.breakpoints):e;Object.keys(r).forEach(function(n){var s=r[n];i.contentRect.width>=s?i.target.classList.add(n):i.target.classList.remove(n)})})});const Jwi=Kwi,ZDr="";/*! +*/(function(t){(function(){var e=typeof window<"u"&&typeof window.document<"u"?window.document:{},i=t.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,c=a.length,h={};l-1}function Ni(fi,dr){var wr=this.__data__,on=An(wr,fi);return on<0?wr.push([fi,dr]):wr[on][1]=dr,this}ti.prototype.clear=Zt,ti.prototype.delete=ii,ti.prototype.get=Ci,ti.prototype.has=ki,ti.prototype.set=Ni;function tr(fi){var dr=-1,wr=fi?fi.length:0;for(this.clear();++dr-1&&fi%1==0&&fi-1&&fi%1==0&&fi<=n}function zr(fi){var dr=typeof fi;return!!fi&&(dr=="object"||dr=="function")}function Ir(fi){return!!fi&&typeof fi=="object"}function Fn(fi){return mi(fi)?Xr(fi):Wt(fi)}function gs(){return[]}function Ts(){return!1}t.exports=Di}(Kce,Kce.exports);var u1i=Kce.exports;const uct=MT(u1i),AFr="",Jce=Hp("maptip",()=>{const t=Mi(void 0),e=Mi(void 0),i=Mi("");function r(o){t.value=o}function n(o){e.value=o}function s(o){i.value=o}return{maptipInstance:t,maptipPoint:e,content:i,setMaptipInstance:r,setMaptipPoint:n,setMaptipContent:s}}),c1i=an({__name:"esri-map",setup(t){const e=Jce(),i=no("iApi"),r=Jr(()=>e.maptipPoint),n=Jr(()=>e.maptipInstance),s=Jr(()=>e.content),o=Fl([]);o.push(bu(r,()=>{if(r.value){let l,c;const h=i.geo.map.getPixelWidth()/2,p=0,y=i.geo.map.mapPointToScreenPoint(r.value);l=y.screenX-h,c=p-y.screenY,n.value.setProps({offset:[l,c]}),s.value&&s.value!==""&&n.value.show()}else n.value.hide()})),o.push(bu(s,l=>{l&&l!==""&&r?(n.value.setContent(l),n.value.show()):n.value.hide()})),Ll(()=>{o.forEach(l=>l())});const a=()=>{i.geo.map.setMouseFocus()};return(l,c)=>{const h=as("tippy");return Zr((Qt(),hi("div",{name:"esriMap",id:"esriMap",class:"h-full overflow-hidden",onMousedown:a,onKeydown:c[0]||(c[0]=Zh(wa(()=>{},["prevent"]),["up","down","left","right"]))},null,544)),[[h,{allowHTML:!0,zIndex:150,theme:"ramp4",trigger:"manual",appendTo:"parent",arrow:!1,delay:200,duration:[200,200]}]])}}});var cct={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},VOe={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},h1i=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],Zce={CSS:{},springs:{}};function UT(t,e,i){return Math.min(Math.max(t,e),i)}function wK(t,e){return t.indexOf(e)>-1}function jOe(t,e){return t.apply(null,e)}var jo={arr:function(t){return Array.isArray(t)},obj:function(t){return wK(Object.prototype.toString.call(t),"Object")},pth:function(t){return jo.obj(t)&&t.hasOwnProperty("totalLength")},svg:function(t){return t instanceof SVGElement},inp:function(t){return t instanceof HTMLInputElement},dom:function(t){return t.nodeType||jo.svg(t)},str:function(t){return typeof t=="string"},fnc:function(t){return typeof t=="function"},und:function(t){return typeof t>"u"},nil:function(t){return jo.und(t)||t===null},hex:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)},rgb:function(t){return/^rgb/.test(t)},hsl:function(t){return/^hsl/.test(t)},col:function(t){return jo.hex(t)||jo.rgb(t)||jo.hsl(t)},key:function(t){return!cct.hasOwnProperty(t)&&!VOe.hasOwnProperty(t)&&t!=="targets"&&t!=="keyframes"}};function hct(t){var e=/\(([^)]+)\)/.exec(t);return e?e[1].split(",").map(function(i){return parseFloat(i)}):[]}function dct(t,e){var i=hct(t),r=UT(jo.und(i[0])?1:i[0],.1,100),n=UT(jo.und(i[1])?100:i[1],.1,100),s=UT(jo.und(i[2])?10:i[2],.1,100),o=UT(jo.und(i[3])?0:i[3],.1,100),a=Math.sqrt(n/r),l=s/(2*Math.sqrt(n*r)),c=l<1?a*Math.sqrt(1-l*l):0,h=1,p=l<1?(l*a+-o)/c:-o+a;function y(x){var I=e?e*x/1e3:x;return l<1?I=Math.exp(-I*l*a)*(h*Math.cos(c*I)+p*Math.sin(c*I)):I=(h+p*I)*Math.exp(-I*a),x===0||x===1?x:1-I}function v(){var x=Zce.springs[t];if(x)return x;for(var I=1/6,P=0,F=0;;)if(P+=I,y(P)===1){if(F++,F>=16)break}else F=0;var k=P*I*1e3;return Zce.springs[t]=k,k}return e?y:v}function d1i(t){return t===void 0&&(t=10),function(e){return Math.ceil(UT(e,1e-6,1)*t)*(1/t)}}var p1i=function(){var t=11,e=1/(t-1);function i(h,p){return 1-3*p+3*h}function r(h,p){return 3*p-6*h}function n(h){return 3*h}function s(h,p,y){return((i(p,y)*h+r(p,y))*h+n(p))*h}function o(h,p,y){return 3*i(p,y)*h*h+2*r(p,y)*h+n(p)}function a(h,p,y,v,x){var I,P,F=0;do P=p+(y-p)/2,I=s(P,v,x)-h,I>0?y=P:p=P;while(Math.abs(I)>1e-7&&++F<10);return P}function l(h,p,y,v){for(var x=0;x<4;++x){var I=o(p,y,v);if(I===0)return p;var P=s(p,y,v)-h;p-=P/I}return p}function c(h,p,y,v){if(!(0<=h&&h<=1&&0<=y&&y<=1))return;var x=new Float32Array(t);if(h!==p||y!==v)for(var I=0;I=.001?l(F,X,h,y):Z===0?X:a(F,k,k+e,h,y)}return function(F){return h===p&&y===v||F===0||F===1?F:s(P(F),p,v)}}return c}(),pct=function(){var t={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=UT(r,1,10),o=UT(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)}}},i=["Quad","Cubic","Quart","Quint","Expo"];return i.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];t["easeIn"+r]=n,t["easeOut"+r]=function(s,o){return function(a){return 1-n(s,o)(1-a)}},t["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}},t["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}}}),t}();function GOe(t,e){if(jo.fnc(t))return t;var i=t.split("(")[0],r=pct[i],n=hct(t);switch(i){case"spring":return dct(t,e);case"cubicBezier":return jOe(p1i,n);case"steps":return jOe(d1i,n);default:return jOe(r,n)}}function fct(t){try{var e=document.querySelectorAll(t);return e}catch{return}}function Qce(t,e){for(var i=t.length,r=arguments.length>=2?arguments[1]:void 0,n=[],s=0;s1&&(x-=1),x<.16666666666666666?y+(v-y)*6*x:x<.5?v:x<.6666666666666666?y+(v-y)*(.6666666666666666-x)*6:y}var a,l,c;if(r==0)a=l=c=n;else{var h=n<.5?n*(1+r):n+r-n*r,p=2*n-h;a=o(p,h,i+.3333333333333333),l=o(p,h,i),c=o(p,h,i-.3333333333333333)}return"rgba("+a*255+","+l*255+","+c*255+","+s+")"}function y1i(t){if(jo.rgb(t))return f1i(t);if(jo.hex(t))return m1i(t);if(jo.hsl(t))return g1i(t)}function MP(t){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(t);if(e)return e[1]}function v1i(t){if(wK(t,"translate")||t==="perspective")return"px";if(wK(t,"rotate")||wK(t,"skew"))return"deg"}function WOe(t,e){return jo.fnc(t)?t(e.target,e.id,e.total):t}function zT(t,e){return t.getAttribute(e)}function qOe(t,e,i){var r=MP(e);if(UOe([i,"deg","rad","turn"],r))return e;var n=Zce.CSS[e+i];if(!jo.und(n))return n;var s=100,o=document.createElement(t.tagName),a=t.parentNode&&t.parentNode!==document?t.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+i;var l=s/o.offsetWidth;a.removeChild(o);var c=l*parseFloat(e);return Zce.CSS[e+i]=c,c}function gct(t,e,i){if(e in t.style){var r=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),n=t.style[e]||getComputedStyle(t).getPropertyValue(r)||"0";return i?qOe(t,n,i):n}}function YOe(t,e){if(jo.dom(t)&&!jo.inp(t)&&(!jo.nil(zT(t,e))||jo.svg(t)&&t[e]))return"attribute";if(jo.dom(t)&&UOe(h1i,e))return"transform";if(jo.dom(t)&&e!=="transform"&&gct(t,e))return"css";if(t[e]!=null)return"object"}function yct(t){if(jo.dom(t)){for(var e=t.style.transform||"",i=/(\w+)\(([^)]*)\)/g,r=new Map,n;n=i.exec(e);)r.set(n[1],n[2]);return r}}function _1i(t,e,i,r){var n=wK(e,"scale")?1:0+v1i(e),s=yct(t).get(e)||n;return i&&(i.transforms.list.set(e,s),i.transforms.last=e),r?qOe(t,s,r):s}function XOe(t,e,i,r){switch(YOe(t,e)){case"transform":return _1i(t,e,r,i);case"css":return gct(t,e,i);case"attribute":return zT(t,e);default:return t[e]||0}}function KOe(t,e){var i=/^(\*=|\+=|-=)/.exec(t);if(!i)return t;var r=MP(t)||0,n=parseFloat(e),s=parseFloat(t.replace(i[0],""));switch(i[0][0]){case"+":return n+s+r;case"-":return n-s+r;case"*":return n*s+r}}function vct(t,e){if(jo.col(t))return y1i(t);if(/\s/g.test(t))return t;var i=MP(t),r=i?t.substr(0,t.length-i.length):t;return e?r+e:r}function JOe(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function b1i(t){return Math.PI*2*zT(t,"r")}function w1i(t){return zT(t,"width")*2+zT(t,"height")*2}function x1i(t){return JOe({x:zT(t,"x1"),y:zT(t,"y1")},{x:zT(t,"x2"),y:zT(t,"y2")})}function _ct(t){for(var e=t.points,i=0,r,n=0;n0&&(i+=JOe(r,s)),r=s}return i}function S1i(t){var e=t.points;return _ct(t)+JOe(e.getItem(e.numberOfItems-1),e.getItem(0))}function bct(t){if(t.getTotalLength)return t.getTotalLength();switch(t.tagName.toLowerCase()){case"circle":return b1i(t);case"rect":return w1i(t);case"line":return x1i(t);case"polyline":return _ct(t);case"polygon":return S1i(t)}}function C1i(t){var e=bct(t);return t.setAttribute("stroke-dasharray",e),e}function T1i(t){for(var e=t.parentNode;jo.svg(e)&&jo.svg(e.parentNode);)e=e.parentNode;return e}function wct(t,e){var i=e||{},r=i.el||T1i(t),n=r.getBoundingClientRect(),s=zT(r,"viewBox"),o=n.width,a=n.height,l=i.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 E1i(t,e){var i=jo.str(t)?fct(t)[0]:t,r=e||100;return function(n){return{property:n,el:i,svg:wct(i),totalLength:bct(i)*(r/100)}}}function I1i(t,e,i){function r(h){h===void 0&&(h=0);var p=e+h>=1?e+h:0;return t.el.getPointAtLength(p)}var n=wct(t.el,t.svg),s=r(),o=r(-1),a=r(1),l=i?1:n.w/n.vW,c=i?1:n.h/n.vH;switch(t.property){case"x":return(s.x-n.x)*l;case"y":return(s.y-n.y)*c;case"angle":return Math.atan2(a.y-o.y,a.x-o.x)*180/Math.PI}}function xct(t,e){var i=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=vct(jo.pth(t)?t.totalLength:t,e)+"";return{original:r,numbers:r.match(i)?r.match(i).map(Number):[0],strings:jo.str(t)||e?r.split(i):[]}}function ZOe(t){var e=t?ehe(jo.arr(t)?t.map(mct):mct(t)):[];return Qce(e,function(i,r,n){return n.indexOf(i)===r})}function Sct(t){var e=ZOe(t);return e.map(function(i,r){return{target:i,id:r,total:e.length,transforms:{list:yct(i)}}})}function A1i(t,e){var i=zOe(e);if(/^spring/.test(i.easing)&&(i.duration=dct(i.easing)),jo.arr(t)){var r=t.length,n=r===2&&!jo.obj(t[0]);n?t={value:t}:jo.fnc(e.duration)||(i.duration=e.duration/r)}var s=jo.arr(t)?t:[t];return s.map(function(o,a){var l=jo.obj(o)&&!jo.pth(o)?o:{value:o};return jo.und(l.delay)&&(l.delay=a?0:e.delay),jo.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return the(o,i)})}function P1i(t){for(var e=Qce(ehe(t.map(function(s){return Object.keys(s)})),function(s){return jo.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),i={},r=function(s){var o=e[s];i[o]=t.map(function(a){var l={};for(var c in a)jo.key(c)?c==o&&(l.value=a[c]):l[c]=a[c];return l})},n=0;n0&&(t=requestAnimationFrame(i))}function i(n){for(var s=Q2.length,o=0;o0?requestAnimationFrame(i):void 0}function r(){vp.suspendWhenDocumentHidden&&(Pct()?t=cancelAnimationFrame(t):(Q2.forEach(function(n){return n._onDocumentVisibility()}),Act()))}return typeof document<"u"&&document.addEventListener("visibilitychange",r),e}();function Pct(){return!!document&&document.hidden}function vp(t){t===void 0&&(t={});var e=0,i=0,r=0,n,s=0,o=null;function a(k){var j=window.Promise&&new Promise(function(V){return o=V});return k.finished=j,j}var l=L1i(t);a(l);function c(){var k=l.direction;k!=="alternate"&&(l.direction=k!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,n.forEach(function(j){return j.reversed=l.reversed})}function h(k){return l.reversed?l.duration-k:k}function p(){e=0,i=h(l.currentTime)*(1/vp.speed)}function y(k,j){j&&j.seek(k-j.timelineOffset)}function v(k){if(l.reversePlayback)for(var V=s;V--;)y(k,n[V]);else for(var j=0;j2||(Re=Math.round(Re*ke)/ke)),J.push(Re)}var Be=Pe.length;if(!Be)Se=J[0];else{Se=Pe[0];for(var qe=0;qe0&&(l.began=!0,I("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,I("loopBegin")),X<=V&&l.currentTime!==0&&x(0),(X>=Y&&l.currentTime!==j||!j)&&x(j),X>V&&X=j&&(i=0,P(),l.remaining?(e=r,I("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&c()):(l.paused=!0,l.completed||(l.completed=!0,I("loopComplete"),I("complete"),!l.passThrough&&"Promise"in window&&(o(),a(l)))))}return l.reset=function(){var k=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=k==="reverse",l.remaining=l.loop,n=l.children,s=n.length;for(var j=s;j--;)l.children[j].reset();(l.reversed&&l.loop!==!0||k==="alternate"&&l.loop===1)&&l.remaining++,x(l.reversed?l.duration:0)},l._onDocumentVisibility=p,l.set=function(k,j){return Tct(k,j),l},l.tick=function(k){r=k,e||(e=r),F((r+(i-e))*vp.speed)},l.seek=function(k){F(h(k))},l.pause=function(){l.paused=!0,p()},l.play=function(){l.paused&&(l.completed&&l.reset(),l.paused=!1,Q2.push(l),p(),Act())},l.reverse=function(){c(),l.completed=!l.reversed,p()},l.restart=function(){l.reset(),l.play()},l.remove=function(k){var j=ZOe(k);Rct(j,l)},l.reset(),l.autoplay&&l.play(),l}function Oct(t,e){for(var i=e.length;i--;)UOe(t,e[i].animatable.target)&&e.splice(i,1)}function Rct(t,e){var i=e.animations,r=e.children;Oct(t,i);for(var n=r.length;n--;){var s=r[n],o=s.animations;Oct(t,o),!o.length&&!s.children.length&&r.splice(n,1)}!i.length&&!r.length&&e.pause()}function N1i(t){for(var e=ZOe(t),i=Q2.length;i--;){var r=Q2[i];Rct(e,r)}}function k1i(t,e){e===void 0&&(e={});var i=e.direction||"normal",r=e.easing?GOe(e.easing):null,n=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",c=o==="last",h=jo.arr(t),p=parseFloat(h?t[0]:t),y=h?parseFloat(t[1]):0,v=MP(h?t[1]:t)||0,x=e.start||0+(h?p:0),I=[],P=0;return function(F,k,j){if(a&&(o=0),l&&(o=(j-1)/2),c&&(o=j-1),!I.length){for(var V=0;V-1&&Q2.splice(n,1);function o(y){y.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 B1i=["data-cy"],Dct=an({__name:"panel-container",props:{panel:{type:Object,required:!0}},setup(t){const e=t,i=Mi(null),r=Mi(!1);Ja(()=>{e.panel.teleport&&new Mct({xs:0,sm:461,...e.panel.teleport.breakpoints}).observe(i.value)});const n=(l,c,h)=>{if(r.value)return c();vp({targets:l,opacity:{value:h,duration:400,easing:"cubicBezier(.5, .05, .1, .3)"},complete:c})},s=(l,c)=>{n(l,c,[0,1])},o=l=>{l.classList.contains("screen-spinner")||(r.value=e.panel.isScreenLoaded(e.panel.route.screen),i.value.querySelectorAll("[focus-item").forEach(c=>c.classList.remove("default-focus-style")))},a=(l,c)=>{n(l,c,[0,1])};return(l,c)=>{const h=as("focus-container");return Qt(),hi("div",{class:ms(["shadow-tm bg-white h-full xs:mr-0 sm:mr-12 last:mr-0 pointer-events-auto min-w-0 shrink-0",t.panel.expanded?"flex-grow max-w-full":""]),style:nb(t.panel.style),"data-cy":t.panel.id,ref_key:"componentEl",ref:i},[Un(eD,{onBeforeLeave:o,onLeave:a,onEnter:s},{default:En(()=>[Zr((Qt(),Bn(TP(t.panel.route.screen),JX(t.panel.route.props,{panel:t.panel}),null,16,["panel"])),[[h]])]),_:1})],14,B1i)}}}),ay=Hp("panel",()=>{const t=Mi(void 0),e=Mi(void 0),i=Mi(0),r=Mi(0),n=Mi(!1),s=Mi(!0),o=Mi({}),a=Mi({}),l=Mi([]),c=Mi([]),h=Mi([]),p=Jr(()=>r.value);function y(_e){return _e==="xs"&&h.value.length>0?[h.value.slice().pop()]:h.value}function v(_e){const xe=[];return _e.forEach(Pe=>{Pe in a.value&&xe.push(a.value[Pe].getPromise())}),xe}function x(_e){X(_e),V(),e.value=void 0}function I(_e){Z(_e),V()}function P(_e,xe){ie(_e,xe),V()}function F(_e){ce(_e),V()}function k(_e){i.value=_e,V()}function j(_e){n.value=_e}function V(){let _e=i.value;const xe=[];for(let Pe=l.value.length-1;Pe>=0;Pe--){let ke=l.value[Pe].width||350;n.value?ke=_e:ke+=12,(_e>=ke&&!n.value||xe.length===0)&&(_e-=ke,xe.unshift(l.value[Pe]))}if(t.value&&!xe.includes(t.value)&&!n.value){let Pe;for(let Se=0;Se=(t.value.width||350)?xe.unshift(t.value):e.value||(Pe=xe.shift(),xe.unshift(t.value));const ke=l.value.indexOf(t.value),J=l.value.indexOf(Pe),de=l.value.slice();J>-1&&(de.splice(ke,1),de.splice(J,0,t.value)),l.value=de}r.value=_e,h.value=xe}function Y(_e){if(o.value={...o.value,[_e.id]:_e},_e.id in a.value)a.value[_e.id].resolveMe();else{const xe=new Yf;xe.resolveMe(),a.value={...a.value,[_e.id]:xe}}}function X(_e){_e.teleport?c.value=[...c.value,_e]:(l.value=[...l.value,_e],e.value=_e)}function Z(_e){if(_e.teleport){const xe=c.value.indexOf(_e);xe!==-1&&(c.value=[...c.value.slice(0,xe),...c.value.slice(xe+1)])}else{const xe=l.value.indexOf(_e);xe!==-1&&(l.value=[...l.value.slice(0,xe),...l.value.slice(xe+1)])}}function ie(_e,xe){const Pe=l.value.indexOf(_e),ke=xe==="right"?1:-1;h.value.includes(l.value[Pe+ke])&&([l.value[Pe],l.value[Pe+ke]]=[l.value[Pe+ke],l.value[Pe]])}function ce(_e){o.value[_e.id]!==void 0&&delete o.value[_e.id],a.value[_e.id]!==void 0&&delete a.value[_e.id];const xe=h.value.indexOf(_e);xe!==-1&&(h.value=[...h.value.slice(0,xe),...h.value.slice(xe+1)]),t.value&&t.value.id==_e.id&&(t.value=void 0)}function he(_e){a.value={...a.value,[_e]:new Yf}}return{items:o,regPromises:a,orderedItems:l,pinned:t,priority:e,visible:h,stackWidth:i,remWidth:r,mobileView:n,reorderable:s,teleported:c,getRemainingWidth:p,getVisible:y,getRegPromises:v,openPanel:x,closePanel:I,movePanel:P,removePanel:F,setStackWidth:k,setMobileView:j,updateVisible:V,registerPanel:Y,addRegPromise:he}}),V1i=an({__name:"panel-stack",setup(t){const e=ay(),i=no("iApi"),r=Mi(),n=Jr(()=>e.mobileView);Ja(()=>{new ResizeObserver(h=>{const p=!(i?.$vApp.$root?.$refs["app-size"]).classList.contains("sm");n.value!==p&&(e.mobileView=p,i?.event.emit(cn.RAMP_MOBILEVIEW_CHANGE,p)),e.setStackWidth(h[0].contentRect.width)}).observe(r.value?.$el)});const s=c=>e.getVisible(c),o=(c,h)=>{l(c,h,[[6,0],[0,1]])},a=(c,h)=>{const[p,y]=[c.children[0].getBoundingClientRect(),c.parentElement.getBoundingClientRect()];c.style.width=`${p.width}px`,c.style.height=`${p.height}px`,c.style.left=`${p.left-y.left}px`,c.style.position="absolute",l(c,h,[[0,-6],[1,0]])},l=(c,h,p)=>{vp({targets:c,duration:300,translateY:{value:p[0],easing:"cubicBezier(.5, .05, .1, .3)"},opacity:{value:p[1],duration:250,easing:"cubicBezier(.5, .05, .1, .3)"},complete:h})};return(c,h)=>(Qt(),Bn(yce,{onEnter:o,onLeave:a,name:"panel-container",tag:"div",ref_key:"el",ref:r},{default:En(()=>[(Qt(!0),hi(po,null,fu(s(vi(i).screenSize),p=>(Qt(),Bn(Dct,{key:`${p.id}`,panel:p},null,8,["panel"]))),128))]),_:1},512))}}),PFr="",Nl=(t,e)=>{const i=t.__vccOpts||t;for(const[r,n]of e)i[r]=n;return i},j1i=Nl(V1i,[["__scopeId","data-v-6def3362"]]);var P_="top",kw="bottom",$w="right",O_="left",QOe="auto",xK=[P_,kw,$w,O_],sj="start",SK="end",G1i="clippingParents",Fct="viewport",CK="popper",U1i="reference",Lct=xK.reduce(function(t,e){return t.concat([e+"-"+sj,e+"-"+SK])},[]),Nct=[].concat(xK,[QOe]).reduce(function(t,e){return t.concat([e,e+"-"+sj,e+"-"+SK])},[]),z1i="beforeRead",H1i="read",W1i="afterRead",q1i="beforeMain",Y1i="main",X1i="afterMain",K1i="beforeWrite",J1i="write",Z1i="afterWrite",Q1i=[z1i,H1i,W1i,q1i,Y1i,X1i,K1i,J1i,Z1i];function HT(t){return t?(t.nodeName||"").toLowerCase():null}function Bw(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function nk(t){var e=Bw(t).Element;return t instanceof e||t instanceof Element}function Vw(t){var e=Bw(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function e3e(t){if(typeof ShadowRoot>"u")return!1;var e=Bw(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function ebi(t){var e=t.state;Object.keys(e.elements).forEach(function(i){var r=e.styles[i]||{},n=e.attributes[i]||{},s=e.elements[i];!Vw(s)||!HT(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 tbi(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.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]:i[r]),a=o.reduce(function(l,c){return l[c]="",l},{});!Vw(n)||!HT(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}const ibi={name:"applyStyles",enabled:!0,phase:"write",fn:ebi,effect:tbi,requires:["computeStyles"]};function WT(t){return t.split("-")[0]}var sk=Math.max,ihe=Math.min,oj=Math.round;function t3e(){var t=navigator.userAgentData;return t!=null&&t.brands?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function kct(){return!/^((?!chrome|android).)*safari/i.test(t3e())}function aj(t,e,i){e===void 0&&(e=!1),i===void 0&&(i=!1);var r=t.getBoundingClientRect(),n=1,s=1;e&&Vw(t)&&(n=t.offsetWidth>0&&oj(r.width)/t.offsetWidth||1,s=t.offsetHeight>0&&oj(r.height)/t.offsetHeight||1);var o=nk(t)?Bw(t):window,a=o.visualViewport,l=!kct()&&i,c=(r.left+(l&&a?a.offsetLeft:0))/n,h=(r.top+(l&&a?a.offsetTop:0))/s,p=r.width/n,y=r.height/s;return{width:p,height:y,top:h,right:c+p,bottom:h+y,left:c,x:c,y:h}}function i3e(t){var e=aj(t),i=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:r}}function $ct(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&e3e(i)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function DP(t){return Bw(t).getComputedStyle(t)}function rbi(t){return["table","td","th"].indexOf(HT(t))>=0}function cD(t){return((nk(t)?t.ownerDocument:t.document)||window.document).documentElement}function rhe(t){return HT(t)==="html"?t:t.assignedSlot||t.parentNode||(e3e(t)?t.host:null)||cD(t)}function Bct(t){return!Vw(t)||DP(t).position==="fixed"?null:t.offsetParent}function nbi(t){var e=/firefox/i.test(t3e()),i=/Trident/i.test(t3e());if(i&&Vw(t)){var r=DP(t);if(r.position==="fixed")return null}var n=rhe(t);for(e3e(n)&&(n=n.host);Vw(n)&&["html","body"].indexOf(HT(n))<0;){var s=DP(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 TK(t){for(var e=Bw(t),i=Bct(t);i&&rbi(i)&&DP(i).position==="static";)i=Bct(i);return i&&(HT(i)==="html"||HT(i)==="body"&&DP(i).position==="static")?e:i||nbi(t)||e}function r3e(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function EK(t,e,i){return sk(t,ihe(e,i))}function sbi(t,e,i){var r=EK(t,e,i);return r>i?i:r}function Vct(){return{top:0,right:0,bottom:0,left:0}}function jct(t){return Object.assign({},Vct(),t)}function Gct(t,e){return e.reduce(function(i,r){return i[r]=t,i},{})}var obi=function(e,i){return e=typeof e=="function"?e(Object.assign({},i.rects,{placement:i.placement})):e,jct(typeof e!="number"?e:Gct(e,xK))};function abi(t){var e,i=t.state,r=t.name,n=t.options,s=i.elements.arrow,o=i.modifiersData.popperOffsets,a=WT(i.placement),l=r3e(a),c=[O_,$w].indexOf(a)>=0,h=c?"height":"width";if(!(!s||!o)){var p=obi(n.padding,i),y=i3e(s),v=l==="y"?P_:O_,x=l==="y"?kw:$w,I=i.rects.reference[h]+i.rects.reference[l]-o[l]-i.rects.popper[h],P=o[l]-i.rects.reference[l],F=TK(s),k=F?l==="y"?F.clientHeight||0:F.clientWidth||0:0,j=I/2-P/2,V=p[v],Y=k-y[h]-p[x],X=k/2-y[h]/2+j,Z=EK(V,X,Y),ie=l;i.modifiersData[r]=(e={},e[ie]=Z,e.centerOffset=Z-X,e)}}function lbi(t){var e=t.state,i=t.options,r=i.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||$ct(e.elements.popper,n)&&(e.elements.arrow=n))}const ubi={name:"arrow",enabled:!0,phase:"main",fn:abi,effect:lbi,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function lj(t){return t.split("-")[1]}var cbi={top:"auto",right:"auto",bottom:"auto",left:"auto"};function hbi(t){var e=t.x,i=t.y,r=window,n=r.devicePixelRatio||1;return{x:oj(e*n)/n||0,y:oj(i*n)/n||0}}function Uct(t){var e,i=t.popper,r=t.popperRect,n=t.placement,s=t.variation,o=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,p=t.isFixed,y=o.x,v=y===void 0?0:y,x=o.y,I=x===void 0?0:x,P=typeof h=="function"?h({x:v,y:I}):{x:v,y:I};v=P.x,I=P.y;var F=o.hasOwnProperty("x"),k=o.hasOwnProperty("y"),j=O_,V=P_,Y=window;if(c){var X=TK(i),Z="clientHeight",ie="clientWidth";if(X===Bw(i)&&(X=cD(i),DP(X).position!=="static"&&a==="absolute"&&(Z="scrollHeight",ie="scrollWidth")),X=X,n===P_||(n===O_||n===$w)&&s===SK){V=kw;var ce=p&&X===Y&&Y.visualViewport?Y.visualViewport.height:X[Z];I-=ce-r.height,I*=l?1:-1}if(n===O_||(n===P_||n===kw)&&s===SK){j=$w;var he=p&&X===Y&&Y.visualViewport?Y.visualViewport.width:X[ie];v-=he-r.width,v*=l?1:-1}}var _e=Object.assign({position:a},c&&cbi),xe=h===!0?hbi({x:v,y:I}):{x:v,y:I};if(v=xe.x,I=xe.y,l){var Pe;return Object.assign({},_e,(Pe={},Pe[V]=k?"0":"",Pe[j]=F?"0":"",Pe.transform=(Y.devicePixelRatio||1)<=1?"translate("+v+"px, "+I+"px)":"translate3d("+v+"px, "+I+"px, 0)",Pe))}return Object.assign({},_e,(e={},e[V]=k?I+"px":"",e[j]=F?v+"px":"",e.transform="",e))}function dbi(t){var e=t.state,i=t.options,r=i.gpuAcceleration,n=r===void 0?!0:r,s=i.adaptive,o=s===void 0?!0:s,a=i.roundOffsets,l=a===void 0?!0:a,c={placement:WT(e.placement),variation:lj(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,Uct(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Uct(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const pbi={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:dbi,data:{}};var nhe={passive:!0};function fbi(t){var e=t.state,i=t.instance,r=t.options,n=r.scroll,s=n===void 0?!0:n,o=r.resize,a=o===void 0?!0:o,l=Bw(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(h){h.addEventListener("scroll",i.update,nhe)}),a&&l.addEventListener("resize",i.update,nhe),function(){s&&c.forEach(function(h){h.removeEventListener("scroll",i.update,nhe)}),a&&l.removeEventListener("resize",i.update,nhe)}}const mbi={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:fbi,data:{}};var gbi={left:"right",right:"left",bottom:"top",top:"bottom"};function she(t){return t.replace(/left|right|bottom|top/g,function(e){return gbi[e]})}var ybi={start:"end",end:"start"};function zct(t){return t.replace(/start|end/g,function(e){return ybi[e]})}function n3e(t){var e=Bw(t),i=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:i,scrollTop:r}}function s3e(t){return aj(cD(t)).left+n3e(t).scrollLeft}function vbi(t,e){var i=Bw(t),r=cD(t),n=i.visualViewport,s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(n){s=n.width,o=n.height;var c=kct();(c||!c&&e==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:s,height:o,x:a+s3e(t),y:l}}function _bi(t){var e,i=cD(t),r=n3e(t),n=(e=t.ownerDocument)==null?void 0:e.body,s=sk(i.scrollWidth,i.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=sk(i.scrollHeight,i.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-r.scrollLeft+s3e(t),l=-r.scrollTop;return DP(n||i).direction==="rtl"&&(a+=sk(i.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function o3e(t){var e=DP(t),i=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+n+r)}function Hct(t){return["html","body","#document"].indexOf(HT(t))>=0?t.ownerDocument.body:Vw(t)&&o3e(t)?t:Hct(rhe(t))}function IK(t,e){var i;e===void 0&&(e=[]);var r=Hct(t),n=r===((i=t.ownerDocument)==null?void 0:i.body),s=Bw(r),o=n?[s].concat(s.visualViewport||[],o3e(r)?r:[]):r,a=e.concat(o);return n?a:a.concat(IK(rhe(o)))}function a3e(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function bbi(t,e){var i=aj(t,!1,e==="fixed");return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}function Wct(t,e,i){return e===Fct?a3e(vbi(t,i)):nk(e)?bbi(e,i):a3e(_bi(cD(t)))}function wbi(t){var e=IK(rhe(t)),i=["absolute","fixed"].indexOf(DP(t).position)>=0,r=i&&Vw(t)?TK(t):t;return nk(r)?e.filter(function(n){return nk(n)&&$ct(n,r)&&HT(n)!=="body"}):[]}function xbi(t,e,i,r){var n=e==="clippingParents"?wbi(t):[].concat(e),s=[].concat(n,[i]),o=s[0],a=s.reduce(function(l,c){var h=Wct(t,c,r);return l.top=sk(h.top,l.top),l.right=ihe(h.right,l.right),l.bottom=ihe(h.bottom,l.bottom),l.left=sk(h.left,l.left),l},Wct(t,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 qct(t){var e=t.reference,i=t.element,r=t.placement,n=r?WT(r):null,s=r?lj(r):null,o=e.x+e.width/2-i.width/2,a=e.y+e.height/2-i.height/2,l;switch(n){case P_:l={x:o,y:e.y-i.height};break;case kw:l={x:o,y:e.y+e.height};break;case $w:l={x:e.x+e.width,y:a};break;case O_:l={x:e.x-i.width,y:a};break;default:l={x:e.x,y:e.y}}var c=n?r3e(n):null;if(c!=null){var h=c==="y"?"height":"width";switch(s){case sj:l[c]=l[c]-(e[h]/2-i[h]/2);break;case SK:l[c]=l[c]+(e[h]/2-i[h]/2);break}}return l}function uj(t,e){e===void 0&&(e={});var i=e,r=i.placement,n=r===void 0?t.placement:r,s=i.strategy,o=s===void 0?t.strategy:s,a=i.boundary,l=a===void 0?G1i:a,c=i.rootBoundary,h=c===void 0?Fct:c,p=i.elementContext,y=p===void 0?CK:p,v=i.altBoundary,x=v===void 0?!1:v,I=i.padding,P=I===void 0?0:I,F=jct(typeof P!="number"?P:Gct(P,xK)),k=y===CK?U1i:CK,j=t.rects.popper,V=t.elements[x?k:y],Y=xbi(nk(V)?V:V.contextElement||cD(t.elements.popper),l,h,o),X=aj(t.elements.reference),Z=qct({reference:X,element:j,strategy:"absolute",placement:n}),ie=a3e(Object.assign({},j,Z)),ce=y===CK?ie:X,he={top:Y.top-ce.top+F.top,bottom:ce.bottom-Y.bottom+F.bottom,left:Y.left-ce.left+F.left,right:ce.right-Y.right+F.right},_e=t.modifiersData.offset;if(y===CK&&_e){var xe=_e[n];Object.keys(he).forEach(function(Pe){var ke=[$w,kw].indexOf(Pe)>=0?1:-1,J=[P_,kw].indexOf(Pe)>=0?"y":"x";he[Pe]+=xe[J]*ke})}return he}function Sbi(t,e){e===void 0&&(e={});var i=e,r=i.placement,n=i.boundary,s=i.rootBoundary,o=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=l===void 0?Nct:l,h=lj(r),p=h?a?Lct:Lct.filter(function(x){return lj(x)===h}):xK,y=p.filter(function(x){return c.indexOf(x)>=0});y.length===0&&(y=p);var v=y.reduce(function(x,I){return x[I]=uj(t,{placement:I,boundary:n,rootBoundary:s,padding:o})[WT(I)],x},{});return Object.keys(v).sort(function(x,I){return v[x]-v[I]})}function Cbi(t){if(WT(t)===QOe)return[];var e=she(t);return[zct(t),e,zct(e)]}function Tbi(t){var e=t.state,i=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var n=i.mainAxis,s=n===void 0?!0:n,o=i.altAxis,a=o===void 0?!0:o,l=i.fallbackPlacements,c=i.padding,h=i.boundary,p=i.rootBoundary,y=i.altBoundary,v=i.flipVariations,x=v===void 0?!0:v,I=i.allowedAutoPlacements,P=e.options.placement,F=WT(P),k=F===P,j=l||(k||!x?[she(P)]:Cbi(P)),V=[P].concat(j).reduce(function(et,Ze){return et.concat(WT(Ze)===QOe?Sbi(e,{placement:Ze,boundary:h,rootBoundary:p,padding:c,flipVariations:x,allowedAutoPlacements:I}):Ze)},[]),Y=e.rects.reference,X=e.rects.popper,Z=new Map,ie=!0,ce=V[0],he=0;he=0,J=ke?"width":"height",de=uj(e,{placement:_e,boundary:h,rootBoundary:p,altBoundary:y,padding:c}),Se=ke?Pe?$w:O_:Pe?kw:P_;Y[J]>X[J]&&(Se=she(Se));var Ie=she(Se),Re=[];if(s&&Re.push(de[xe]<=0),a&&Re.push(de[Se]<=0,de[Ie]<=0),Re.every(function(et){return et})){ce=_e,ie=!1;break}Z.set(_e,Re)}if(ie)for(var Oe=x?3:1,Ge=function(Ze){var mt=V.find(function(Pt){var $t=Z.get(Pt);if($t)return $t.slice(0,Ze).every(function(Ct){return Ct})});if(mt)return ce=mt,"break"},Be=Oe;Be>0;Be--){var qe=Ge(Be);if(qe==="break")break}e.placement!==ce&&(e.modifiersData[r]._skip=!0,e.placement=ce,e.reset=!0)}}const Ebi={name:"flip",enabled:!0,phase:"main",fn:Tbi,requiresIfExists:["offset"],data:{_skip:!1}};function Yct(t,e,i){return i===void 0&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Xct(t){return[P_,$w,kw,O_].some(function(e){return t[e]>=0})}function Ibi(t){var e=t.state,i=t.name,r=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=uj(e,{elementContext:"reference"}),a=uj(e,{altBoundary:!0}),l=Yct(o,r),c=Yct(a,n,s),h=Xct(l),p=Xct(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":p})}const Abi={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ibi};function Pbi(t,e,i){var r=WT(t),n=[O_,P_].indexOf(r)>=0?-1:1,s=typeof i=="function"?i(Object.assign({},e,{placement:t})):i,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[O_,$w].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function Obi(t){var e=t.state,i=t.options,r=t.name,n=i.offset,s=n===void 0?[0,0]:n,o=Nct.reduce(function(h,p){return h[p]=Pbi(p,e.rects,s),h},{}),a=o[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}const Rbi={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Obi};function Mbi(t){var e=t.state,i=t.name;e.modifiersData[i]=qct({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Dbi={name:"popperOffsets",enabled:!0,phase:"read",fn:Mbi,data:{}};function Fbi(t){return t==="x"?"y":"x"}function Lbi(t){var e=t.state,i=t.options,r=t.name,n=i.mainAxis,s=n===void 0?!0:n,o=i.altAxis,a=o===void 0?!1:o,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,p=i.padding,y=i.tether,v=y===void 0?!0:y,x=i.tetherOffset,I=x===void 0?0:x,P=uj(e,{boundary:l,rootBoundary:c,padding:p,altBoundary:h}),F=WT(e.placement),k=lj(e.placement),j=!k,V=r3e(F),Y=Fbi(V),X=e.modifiersData.popperOffsets,Z=e.rects.reference,ie=e.rects.popper,ce=typeof I=="function"?I(Object.assign({},e.rects,{placement:e.placement})):I,he=typeof ce=="number"?{mainAxis:ce,altAxis:ce}:Object.assign({mainAxis:0,altAxis:0},ce),_e=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,xe={x:0,y:0};if(X){if(s){var Pe,ke=V==="y"?P_:O_,J=V==="y"?kw:$w,de=V==="y"?"height":"width",Se=X[V],Ie=Se+P[ke],Re=Se-P[J],Oe=v?-ie[de]/2:0,Ge=k===sj?Z[de]:ie[de],Be=k===sj?-ie[de]:-Z[de],qe=e.elements.arrow,et=v&&qe?i3e(qe):{width:0,height:0},Ze=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Vct(),mt=Ze[ke],Pt=Ze[J],$t=EK(0,Z[de],et[de]),Ct=j?Z[de]/2-Oe-$t-mt-he.mainAxis:Ge-$t-mt-he.mainAxis,Et=j?-Z[de]/2+Oe+$t+Pt+he.mainAxis:Be+$t+Pt+he.mainAxis,Ft=e.elements.arrow&&TK(e.elements.arrow),ot=Ft?V==="y"?Ft.clientTop||0:Ft.clientLeft||0:0,Te=(Pe=_e?.[V])!=null?Pe:0,je=Se+Ct-Te-ot,pt=Se+Et-Te,kt=EK(v?ihe(Ie,je):Ie,Se,v?sk(Re,pt):Re);X[V]=kt,xe[V]=kt-Se}if(a){var ct,ae=V==="x"?P_:O_,ht=V==="x"?kw:$w,wt=X[Y],Ne=Y==="y"?"height":"width",pe=wt+P[ae],Ae=wt-P[ht],tt=[P_,O_].indexOf(F)!==-1,gt=(ct=_e?.[Y])!=null?ct:0,ze=tt?pe:wt-Z[Ne]-ie[Ne]-gt+he.altAxis,Ot=tt?wt+Z[Ne]+ie[Ne]-gt-he.altAxis:Ae,jt=v&&tt?sbi(ze,wt,Ot):EK(v?ze:pe,wt,v?Ot:Ae);X[Y]=jt,xe[Y]=jt-wt}e.modifiersData[r]=xe}}const Nbi={name:"preventOverflow",enabled:!0,phase:"main",fn:Lbi,requiresIfExists:["offset"]};function kbi(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function $bi(t){return t===Bw(t)||!Vw(t)?n3e(t):kbi(t)}function Bbi(t){var e=t.getBoundingClientRect(),i=oj(e.width)/t.offsetWidth||1,r=oj(e.height)/t.offsetHeight||1;return i!==1||r!==1}function Vbi(t,e,i){i===void 0&&(i=!1);var r=Vw(e),n=Vw(e)&&Bbi(e),s=cD(e),o=aj(t,n,i),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!i)&&((HT(e)!=="body"||o3e(s))&&(a=$bi(e)),Vw(e)?(l=aj(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=s3e(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function jbi(t){var e=new Map,i=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function n(s){i.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!i.has(a)){var l=e.get(a);l&&n(l)}}),r.push(s)}return t.forEach(function(s){i.has(s.name)||n(s)}),r}function Gbi(t){var e=jbi(t);return Q1i.reduce(function(i,r){return i.concat(e.filter(function(n){return n.phase===r}))},[])}function Ubi(t){var e;return function(){return e||(e=new Promise(function(i){Promise.resolve().then(function(){e=void 0,i(t())})})),e}}function zbi(t){var e=t.reduce(function(i,r){var n=i[r.name];return i[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,i},{});return Object.keys(e).map(function(i){return e[i]})}var Kct={placement:"bottom",modifiers:[],strategy:"absolute"};function Jct(){for(var t=arguments.length,e=new Array(t),i=0;i{r.value.update()})),Ja(()=>{window.addEventListener("click",l=>{(!s.value||!s.value.contains(l.target))&&(i.value=!1)},{capture:!0}),window.addEventListener("blur",()=>{i.value=!1}),window.addEventListener("focusin",l=>{(!s.value||!s.value.contains(l.target))&&(i.value=!1)}),v0(()=>{const l={name:"overflowScroll",enabled:!0,phase:"main",fn({state:c}){const{bottom:h}=uj(c);h>0?(c.styles.popper.overflowY=h>100?"auto":void 0,c.styles.popper.overflowX="hidden",c.styles.popper.height=`${c.rects.popper.height-h-8}px`):c.styles.popper.height="auto"}};a.value&&o.value&&(r.value=qbi(a.value,o.value,{placement:e.position||"bottom",modifiers:[l,{name:"offset",options:{offset:[0,5]}}],...e.popperOptions}))})}),Ll(()=>{n.forEach(l=>l()),window.removeEventListener("click",l=>{(!s.value||!s.value.contains(l.target))&&(i.value=!1)},{capture:!0}),window.removeEventListener("blur",()=>{i.value=!1}),window.removeEventListener("focusin",l=>{(!s.value||!s.value.contains(l.target))&&(i.value=!1)}),i.value=!1}),(l,c)=>{const h=as("tippy");return Qt(),hi("div",{ref_key:"el",ref:s},[Zr((Qt(),hi("button",{type:"button",class:"text-gray-500 hover:text-black dropdown-button",onClick:c[0]||(c[0]=p=>i.value=!i.value),content:t.tooltip,"aria-label":String(t.tooltip),ref_key:"dropdownTrigger",ref:a},[Xf(l.$slots,"header")],8,Ybi)),[[h,{placement:t.tooltipPlacement,theme:t.tooltipTheme,animation:t.tooltipAnimation,appendTo:"parent"}]]),Zr(Dt("div",{onClick:c[1]||(c[1]=p=>r.value.update()),class:ms(["rv-dropdown shadow-md border border-gray:200 py-8 bg-white rounded z-10",{"text-center":t.centered}]),ref_key:"dropdown",ref:o},[Xf(l.$slots,"default",{close:()=>i.value=!i.value})],2),[[vf,i.value]])],512)}}}),OFr="",qT=Hp("notification",()=>{const t=Mi([]),e=Mi({}),i=Jr(()=>t.value.length>=99?99:t.value.length);function r(c){t.value=[c,...t.value]}function n(c){if(t.value.includes(c)){const h=t.value.indexOf(c);c instanceof Zct&&l(c),h>-1&&t.value.splice(h,1)}}function s(c){e.value[c.id]=c}function o(c,h){e.value[c]&&(e.value[c].messageList.push(h),t.value.includes(e.value[c])||(t.value=[e.value[c],...t.value]))}function a(){Object.values(e.value).forEach(c=>l(c)),t.value=[]}function l(c){const h=t.value.indexOf(c);h>-1&&t.value.splice(h,1),c.messageList=[]}return{notificationStack:t,groups:e,notificationNumber:i,showNotification:r,removeNotification:n,registerGroup:s,addToGroup:o,clearAll:a}}),Xbi={class:"h-full flex flex-col"},Kbi={class:"w-full flex mb-6"},Jbi=["content","aria-label"],Zbi=[Dt("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current h-24 w-24"},[Dt("path",{d:"M0 0h24v24H0z",fill:"none"}),Dt("path",{d:"M5 13h14v-2H5v2zm-2 4h14v-2H3v2zM7 7v2h14V7H7z"})],-1)],Qbi=an({__name:"screen",props:{panel:{type:Object,required:!0}},setup(t){const e=qT(),{t:i}=ns(),r=Jr(()=>e.notificationNumber),n=()=>e.clearAll();return(s,o)=>{const a=Vo("panel-screen"),l=as("tippy");return Qt(),Bn(a,{panel:t.panel},{header:En(()=>[ks(xr(vi(i)("notifications.title")),1)]),content:En(()=>[Dt("div",Xbi,[Dt("div",Kbi,[Zr((Qt(),hi("button",{type:"button",onClick:n,class:ms(["p-4 ml-auto",[r.value?"text-gray-500 hover:text-black":"text-gray-300 cursor-default pointer-events-none"]]),content:vi(i)("notifications.controls.clearAll"),"aria-label":vi(i)("notifications.controls.clearAll")},Zbi,10,Jbi)),[[l,{placement:"bottom",theme:"ramp4",animation:"scale"}]])]),Un(Qct,{class:"overflow-y-auto"})])]),_:1},8,["panel"])}}});var ub=(t=>(t.ERROR="error",t.INFO="info",t.WARNING="warning",t))(ub||{});class ewi extends Gp{notificationStore;constructor(e){super(e),this.$iApi.panel.register({id:"notifications",config:{screens:{"notifications-screen":ya(Qbi)},alertName:"notifications.title"}}),this.notificationStore=qT(this.$vApp.$pinia)}show(e,i){this.notificationStore.showNotification({type:e,message:i})}addGroup(e,i,r){if(this.getGroup(e))throw new Error("Duplicate notification group id registration: "+e);const n=new Zct(this.$iApi,e,i,r);return this.notificationStore.registerGroup(n),n}getGroup(e){return this.notificationStore.groups[e]}}class Zct extends Gp{notificationStore=qT(this.$vApp.$pinia);id;message;type;messageList=[];constructor(e,i,r,n){super(e),this.id=i,this.type=r,this.message=n}show(e){this.notificationStore.addToGroup(this.id,e)}}const twi=["content"],iwi={class:"flex items-center text-left"},rwi={class:"select-text cursor-text"},nwi=Dt("span",{class:"flex-grow"},null,-1),swi=[Dt("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},[Dt("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})],-1)],owi=["content"],awi=[Dt("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},[Dt("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)],lwi={key:0,class:"text-left"},uwi=an({__name:"notification-item",props:{notification:{type:Object,required:!0}},setup(t){const e=t,i=qT(),{t:r}=ns(),n=Mi(!1),s=Fl({[ub.WARNING]:"⚠",[ub.INFO]:"☑",[ub.ERROR]:"❌"}),o=l=>{i.removeNotification(l)},a=()=>{if(!e.notification.messageList)return!1};return(l,c)=>{const h=as("tippy");return Zr((Qt(),hi("li",{class:ms(["flex-col default-focus-style p-4",t.notification.messageList?"cursor-pointer":""]),content:vi(r)(n.value?"notifications.controls.collapse":"notifications.controls.expand"),onClick:c[1]||(c[1]=p=>n.value=!n.value)},[Dt("div",iwi,[Dt("span",null,[ks(xr(s[t.notification.type])+" ",1),Dt("span",rwi,xr(t.notification.message),1)]),nwi,t.notification.messageList?(Qt(),hi("div",{key:0,class:ms(["dropdown-icon p-4 pointer-events-none",{"transform -rotate-180":n.value}])},swi,2)):fn("",!0),Zr((Qt(),hi("button",{type:"button",onClick:c[0]||(c[0]=wa(p=>o(t.notification),["stop"])),class:"mx-4 p-4",content:vi(r)("notifications.controls.dismiss")},awi,8,owi)),[[h,{theme:"ramp4",animation:"scale"}]])]),t.notification.messageList&&n.value?(Qt(),hi("div",lwi,[(Qt(!0),hi(po,null,fu(t.notification.messageList,(p,y)=>(Qt(),hi("p",{key:t.notification.id+p+y},xr(p),1))),128))])):fn("",!0)],10,twi)),[[h,{onShow:a,theme:"ramp4",animation:"scale"}]])}}}),FFr="",cwi={key:0},hwi={key:0,class:"w-full border-b border-black"},dwi={key:1,class:"flex flex-col items-center h-full"},pwi=Dt("span",{class:"flex-grow"},null,-1),fwi=Dt("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"h-48 w-48 fill-current"},[Dt("path",{d:"M0 0h24v24H0z",fill:"none"}),Dt("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),mwi=Dt("span",{style:{"flex-grow":"6"}},null,-1),Qct=an({__name:"notification-list",setup(t){const e=qT(),{t:i}=ns(),r=Jr(()=>e.notificationStack);return(n,s)=>{const o=as("focus-item"),a=as("focus-list");return Qt(),hi("div",null,[r.value.length>0?Zr((Qt(),hi("ul",cwi,[(Qt(!0),hi(po,null,fu(r.value,(l,c)=>(Qt(),hi(po,{key:l.message+c},[c>0?(Qt(),hi("div",hwi)):fn("",!0),Zr(Un(uwi,{class:ms([l.type]),notification:l},null,8,["class","notification"]),[[o]])],64))),128))])),[[a]]):(Qt(),hi("div",dwi,[pwi,fwi,Dt("span",null,xr(vi(i)("notifications.empty")),1),mwi]))])}}}),eht=t=>(eh("data-v-c029166a"),t=t(),th(),t),gwi={class:"flex items-center hover:text-white"},ywi=["aria-label"],vwi=[eht(()=>Dt("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))],_wi={key:0,class:"number rounded-full w-18 text-white"},bwi={class:"notification-dropdown pointer-events-auto bg-white rounded text-center text-black w-500 h-256 flex flex-col p-0"},wwi={class:"pb-8 border-b border-gray-600"},xwi={class:"absolute flex right-3 top-3"},Swi=["content","aria-label"],Cwi=[eht(()=>Dt("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current h-24 w-24"},[Dt("path",{d:"M0 0h24v24H0z",fill:"none"}),Dt("path",{d:"M5 13h14v-2H5v2zm-2 4h14v-2H3v2zM7 7v2h14V7H7z"})],-1))],Twi=an({__name:"caption-button",setup(t){const e=qT(),{t:i}=ns(),r=Jr(()=>e.notificationNumber),n=()=>e.clearAll();return(s,o)=>{const a=Vo("close"),l=as("tippy");return Qt(),Bn(l3e,{position:"top-start",tooltip:vi(i)("notifications.title"),tooltipPlacement:"top",class:"pointer-events-auto sm:flex ml-4 mr-8"},{header:En(()=>[Dt("div",gwi,[(Qt(),hi("svg",{class:"fill-current w-24 h-24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-label":vi(i)("notifications.open")},vwi,8,ywi)),r.value&&r.value>0?(Qt(),hi("span",_wi,xr(r.value),1)):fn("",!0)])]),default:En(c=>[Dt("div",bwi,[Dt("div",null,[Dt("h4",wwi,xr(vi(i)("notifications.title")),1),Dt("div",xwi,[Zr((Qt(),hi("button",{type:"button",onClick:n,class:ms(["p-4 mr-6",[r.value?"text-gray-500 hover:text-black":"text-gray-300 cursor-default pointer-events-none"]]),content:vi(i)("notifications.controls.clearAll"),"aria-label":vi(i)("notifications.controls.clearAll")},Cwi,10,Swi)),[[l,{placement:"bottom",theme:"ramp4",animation:"scale",appendTo:"parent"}]]),Un(a,{onClick:c.close},null,8,["onClick"])])]),Un(Qct,{class:"overflow-y-auto h-230"})])]),_:1},8,["tooltip"])}}}),kFr="",Ewi=Nl(Twi,[["__scopeId","data-v-c029166a"]]),tht=t=>(eh("data-v-02cf9ee5"),t=t(),th(),t),Iwi={class:"flex hover:text-white"},Awi=["aria-label"],Pwi=[tht(()=>Dt("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))],Owi={class:"about-ramp-dropdown pointer-events-auto bg-white rounded w-256 h-50"},Rwi={class:"pb-8 border-b border-gray-600 mb-10"},Mwi={class:"absolute right-5 top-5"},Dwi={class:"select-text"},Fwi={class:"font-bold cursor-text"},Lwi={class:"text-sm cursor-text"},Nwi={class:"text-sm cursor-text"},kwi=tht(()=>Dt("div",{class:"mt-5"},[Dt("a",{class:"text-sm underline text-blue-600",href:"https://github.com/ramp4-pcar4/ramp4-pcar4",target:"_blank"},[Dt("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"inline-block fill-black w-16 h-16"},[Dt("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"})]),ks(" ramp4-pcar4 ")])],-1)),$wi=an({__name:"about-ramp-dropdown",props:{position:{type:String,default:"top-start"}},setup(t){const{t:e}=ns(),i=Jr(()=>`${Rj.major}.${Rj.minor}.${Rj.patch}`),r=Jr(()=>Rj.hash.slice(0,9)),n=Jr(()=>{let s=new Date(Rj.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=Vo("close"),l=Vo("dropdown-menu"),c=as("focus-item");return Zr((Qt(),Bn(l,{class:"pointer-events-auto sm:flex",position:t.position,tooltip:vi(e)("ramp.about"),tooltipPlacement:t.position},{header:En(()=>[Dt("div",Iwi,[(Qt(),hi("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-20 h-20","aria-label":vi(e)("ramp.about.open")},Pwi,8,Awi))])]),default:En(h=>[Dt("div",Owi,[Dt("div",null,[Dt("h4",Rwi,xr(vi(e)("ramp.about")),1),Dt("div",Mwi,[Un(a,{onClick:h.close},null,8,["onClick"])]),Dt("div",Dwi,[Dt("div",null,[Dt("span",Fwi,xr(i.value),1),Dt("span",Lwi," ["+xr(r.value)+"] ",1)]),Dt("div",null,[Dt("span",Nwi,xr(n.value),1)]),kwi])])])]),_:1},8,["position","tooltip","tooltipPlacement"])),[[c]])}}}),BFr="",iht=Nl($wi,[["__scopeId","data-v-02cf9ee5"]]),Bwi={class:"map-caption absolute bottom-0 flex justify-end pointer-events-auto cursor-default select-none text-gray-400 bg-black-75 left-0 right-0 py-2 sm:py-6"},Vwi={key:0,class:"relative top-2 sm:top-1 ml-4 sm:ml-0 shrink-0"},jwi=["href","aria-label"],Gwi=["src","alt"],Uwi={key:1,class:"relative ml-10 top-2 text-sm sm:text-base"},zwi=Dt("span",{class:"flex-grow w-15"},null,-1),Hwi={class:"flex min-w-fit justify-end"},Wwi={key:0,class:"pl-8 px-14 sm:block display-none relative top-2"},qwi=["aria-pressed","aria-label","content"],Ywi={class:"relative top-1 text-sm sm:text-base"},Xwi={class:"text-gray-400 hover:text-white text-sm sm:text-base pb-5"},Kwi=["onClick"],Jwi={key:0,class:"sr-only"},Zwi=an({__name:"map-caption",setup(t){const e=sD(),i=yg(),{t:r}=ns(),n=no("iApi"),s=Jr(()=>e.scale),o=Jr(()=>e.attribution),a=Jr(()=>e.coords),l=Jr(()=>i.config.map),c=Mi([]),h=Fl([]);h.push(bu(l,v=>{v&&n.geo.map.caption.createCaption(l.value?.caption)})),Ll(()=>{h.forEach(v=>v())}),YN(()=>{v0(()=>{n.$i18n.locale.value&&c.value.length==0&&(c.value=n.$i18n.availableLocales)})});const p=v=>{n.$i18n.locale.value!=v&&n.setLanguage(v)},y=()=>{e.toggleScale(),n.geo.map.caption.updateScale()};return(v,x)=>{const I=Vo("dropdown-menu"),P=as("truncate"),F=as("tippy");return Qt(),hi("div",Bwi,[Un(iht,{class:"sm:block display-none ml-8 mr-4",position:"top-end"}),Un(Ewi,{class:"sm:block display-none"}),o.value?.logo.disabled?fn("",!0):(Qt(),hi("span",Vwi,[Dt("a",{class:"pointer-events-auto cursor-pointer",href:o.value?.logo.link,target:"_blank","aria-label":o.value?.logo.altText},[Dt("img",{class:"object-contain h-18 sm:h-26",src:o.value?.logo.value,alt:o.value?.logo.altText},null,8,Gwi)],8,jwi)])),o.value?.text.disabled?fn("",!0):Zr((Qt(),hi("span",Uwi,[ks(xr(o.value?.text.value),1)])),[[P,{options:{placement:"top",hideOnClick:!1,theme:"ramp4",animation:"scale"}}]]),zwi,Dt("div",Hwi,[a.value?.disabled?fn("",!0):Zr((Qt(),hi("div",Wwi,[ks(xr(a.value?.formattedString),1)])),[[P,{options:{hideOnClick:!1,theme:"ramp4",animation:"scale"}}]]),s.value?.disabled?fn("",!0):Zr((Qt(),hi("button",{key:1,type:"button",class:"flex-shrink-0 mx-2 sm:mx-10 px-4 pointer-events-auto cursor-pointer border-none",onClick:y,"aria-pressed":s.value?.isImperialScale,"aria-label":vi(r)("map.toggleScaleUnits"),content:vi(r)("map.toggleScaleUnits")},[Dt("span",{class:"border-solid border-2 border-white border-t-0 h-5 mr-4 inline-block",style:nb({width:s.value?.width})},null,4),Dt("span",Ywi,xr(s.value?.label),1)],8,qwi)),[[F,{delay:[300,0],placement:"top",hideOnClick:!1,theme:"ramp4",animation:"scale",touch:["hold",200]}]]),Zr((Qt(),Bn(I,{class:"flex-shrink-0 pointer-events-auto focus:outline-none px-4 mr-4 relative top-2",position:"top-end",content:vi(r)("map.changeLanguage")},{header:En(()=>[Dt("span",Xwi,xr(vi(r)("map.language.short")),1)]),default:En(()=>[(Qt(!0),hi(po,null,fu(c.value,(k,j)=>(Qt(),hi("a",{key:`${k}-${j}`,class:ms(["flex-auto items-center text-sm sm:text-base cursor-pointer",{"font-bold":k===vi(n).$i18n.locale.value}]),href:"javascript:;",onClick:V=>p(k)},[ks(xr(vi(r)("map.language."+k))+" ",1),k===vi(n).$i18n.locale.value?(Qt(),hi("span",Jwi,xr(vi(r)("map.language.curr")),1)):fn("",!0)],10,Kwi))),128))]),_:1},8,["content"])),[[F,{delay:[300,0],placement:"top-end",theme:"ramp4",animation:"scale",touch:["hold",200]}]])])])}}}),VFr="",Qwi=t=>(eh("data-v-4181d508"),t=t(),th(),t),exi=["content"],txi=Qwi(()=>Dt("svg",{class:"fill-current w-24 h-24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Dt("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)),ixi={key:0,class:"number absolute -top-2 -right-2 text-white w-18 rounded-full"},rxi=an({__name:"floating-button",setup(t){const e=qT(),i=no("iApi"),{t:r}=ns(),n=Jr(()=>e.notificationNumber);return(s,o)=>{const a=as("tippy");return Zr((Qt(),hi("button",{type:"button",onClick:o[0]||(o[0]=l=>vi(i).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:vi(r)("notifications.title")},[txi,n.value&&n.value>0?(Qt(),hi("span",ixi,xr(n.value),1)):fn("",!0)],8,exi)),[[a]])}}}),jFr="",nxi=Nl(rxi,[["__scopeId","data-v-4181d508"]]),sxi={class:"flex items-center mb-20"},oxi={class:"text-xl"},axi=an({__name:"keyboard-instructions",setup(t){const e=no("iApi"),{t:i}=ns(),r=Mi(!1),n=Mi(["app","lists","map"]),s=Mi([]),o=Mi(null),a=Mi(null);Ja(()=>{s.value.push(e.event.on("openKeyboardInstructions",()=>{r.value=!0,v0(()=>{o.value.focus()})}))}),Ll(()=>{s.value.forEach(c=>e?.event.off(c))});const l=c=>{c.key==="Tab"?c.shiftKey&&c.target===o.value?(c.preventDefault(),a.value.focus()):!c.shiftKey&&c.target===a.value&&(c.preventDefault(),o.value.focus()):c.key==="Escape"&&(c.preventDefault(),r.value=!1)};return(c,h)=>{const p=Vo("close");return r.value?(Qt(),hi("div",{key:0,class:"absolute inset-0 flex justify-center items-center bg-opacity-30 bg-black z-50 pointer-events-auto",onClick:h[3]||(h[3]=y=>r.value=!1),onKeydown:l},[Dt("div",{class:"bg-white w-500 pointer-events-auto shadow-2xl p-20 flex flex-col",onClick:h[2]||(h[2]=wa(()=>{},["stop","prevent"])),tabindex:"0",ref_key:"firstEl",ref:o},[Dt("div",sxi,[Dt("h2",oxi,xr(vi(i)("keyboardInstructions.title")),1),Un(p,{class:"ml-auto",onClick:h[0]||(h[0]=y=>r.value=!1)})]),(Qt(!0),hi(po,null,fu(n.value,y=>(Qt(),hi("p",{class:"whitespace-pre-line pb-10",key:y},xr(vi(i)(`keyboardInstructions.${y}`)),1))),128)),Dt("button",{type:"button",class:"mt-auto self-end mr-10 mb-10 px-20 py-10",onClick:h[1]||(h[1]=y=>r.value=!1),ref_key:"lastEl",ref:a},xr(vi(i)("keyboardInstructions.OK")),513)],512)],32)):fn("",!0)}}}),cj=Hp("instance",()=>({started:Mi(!1)})),rht=t=>(eh("data-v-8c24ed63"),t=t(),th(),t),lxi={class:"h-full relative"},uxi={class:"inner-shell absolute top-0 left-0 h-full w-full pointer-events-none"},cxi=rht(()=>Dt("div",{class:"sr-only screen-reader-alert"},null,-1)),hxi={class:"absolute top-8 w-full flex justify-center"},dxi={key:1,class:"w-full h-full"},pxi=[rht(()=>Dt("div",{class:"spinner relative inset-x-1/2 inset-y-9/20"},null,-1))],fxi=an({__name:"shell",setup(t){const e=no("iApi"),i=cj(),r=OP(),n=ay(),{t:s}=ns(),o=Jr(()=>r.items.appbar),a=()=>{e?.event.emit("openKeyboardInstructions")},l=()=>n.teleported;return(c,h)=>(Qt(),hi("div",lxi,[Dt("div",uxi,[cxi,Dt("div",hxi,[Dt("button",{type:"button",class:"bg-white opacity-0 focus:opacity-100 z-50 shadow-md px-10",onClick:a},xr(vi(s)("keyboardInstructions.open")),1)]),Un(axi),Un(j1i,{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?fn("",!0):(Qt(),Bn(nxi,{key:0})),Un(Zwi,{class:"z-30"})]),vi(i).started?(Qt(),Bn(c1i,{key:0})):(Qt(),hi("div",dxi,pxi)),(Qt(!0),hi(po,null,fu(l(),p=>(Qt(),Bn(EPe,{to:p.teleport?.target,key:p.id},[(Qt(),Bn(Dct,{key:`${p.id}`,panel:p},null,8,["panel"]))],8,["to"]))),128))]))}}),UFr="",mxi=Nl(fxi,[["__scopeId","data-v-8c24ed63"]]),zFr="";/*! * vue-tippy v6.0.0 * (c) 2022 * @license MIT - */var I_="top",Gw="bottom",Vw="right",A_="left",i3e="auto",AK=[I_,Gw,Vw,A_],dV="start",PK="end",Zwi="clippingParents",jct="viewport",OK="popper",Qwi="reference",zct=AK.reduce(function(t,e){return t.concat([e+"-"+dV,e+"-"+PK])},[]),Hct=[].concat(AK,[i3e]).reduce(function(t,e){return t.concat([e,e+"-"+dV,e+"-"+PK])},[]),exi="beforeRead",txi="read",ixi="afterRead",rxi="beforeMain",nxi="main",sxi="afterMain",oxi="beforeWrite",axi="write",lxi="afterWrite",uxi=[exi,txi,ixi,rxi,nxi,sxi,oxi,axi,lxi];function YT(t){return t?(t.nodeName||"").toLowerCase():null}function eS(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function pV(t){var e=eS(t).Element;return t instanceof e||t instanceof Element}function Uw(t){var e=eS(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Wct(t){if(typeof ShadowRoot>"u")return!1;var e=eS(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function cxi(t){var e=t.state;Object.keys(e.elements).forEach(function(i){var r=e.styles[i]||{},n=e.attributes[i]||{},s=e.elements[i];!Uw(s)||!YT(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 hxi(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.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]:i[r]),a=o.reduce(function(l,c){return l[c]="",l},{});!Uw(n)||!YT(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}var qct={name:"applyStyles",enabled:!0,phase:"write",fn:cxi,effect:hxi,requires:["computeStyles"]};function XT(t){return t.split("-")[0]}var oN=Math.max,nhe=Math.min,fV=Math.round;function mV(t,e){e===void 0&&(e=!1);var i=t.getBoundingClientRect(),r=1,n=1;if(Uw(t)&&e){var s=t.offsetHeight,o=t.offsetWidth;o>0&&(r=fV(i.width)/o||1),s>0&&(n=fV(i.height)/s||1)}return{width:i.width/r,height:i.height/n,top:i.top/n,right:i.right/r,bottom:i.bottom/n,left:i.left/r,x:i.left/r,y:i.top/n}}function r3e(t){var e=mV(t),i=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:r}}function Yct(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&Wct(i)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function KT(t){return eS(t).getComputedStyle(t)}function dxi(t){return["table","td","th"].indexOf(YT(t))>=0}function cD(t){return((pV(t)?t.ownerDocument:t.document)||window.document).documentElement}function she(t){return YT(t)==="html"?t:t.assignedSlot||t.parentNode||(Wct(t)?t.host:null)||cD(t)}function Xct(t){return!Uw(t)||KT(t).position==="fixed"?null:t.offsetParent}function pxi(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,i=navigator.userAgent.indexOf("Trident")!==-1;if(i&&Uw(t)){var r=KT(t);if(r.position==="fixed")return null}for(var n=she(t);Uw(n)&&["html","body"].indexOf(YT(n))<0;){var s=KT(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 RK(t){for(var e=eS(t),i=Xct(t);i&&dxi(i)&&KT(i).position==="static";)i=Xct(i);return i&&(YT(i)==="html"||YT(i)==="body"&&KT(i).position==="static")?e:i||pxi(t)||e}function n3e(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function MK(t,e,i){return oN(t,nhe(e,i))}function fxi(t,e,i){var r=MK(t,e,i);return r>i?i:r}function Kct(){return{top:0,right:0,bottom:0,left:0}}function Jct(t){return Object.assign({},Kct(),t)}function Zct(t,e){return e.reduce(function(i,r){return i[r]=t,i},{})}var mxi=function(e,i){return e=typeof e=="function"?e(Object.assign({},i.rects,{placement:i.placement})):e,Jct(typeof e!="number"?e:Zct(e,AK))};function gxi(t){var e,i=t.state,r=t.name,n=t.options,s=i.elements.arrow,o=i.modifiersData.popperOffsets,a=XT(i.placement),l=n3e(a),c=[A_,Vw].indexOf(a)>=0,d=c?"height":"width";if(!(!s||!o)){var p=mxi(n.padding,i),y=r3e(s),v=l==="y"?I_:A_,S=l==="y"?Gw:Vw,I=i.rects.reference[d]+i.rects.reference[l]-o[l]-i.rects.popper[d],O=o[l]-i.rects.reference[l],L=RK(s),N=L?l==="y"?L.clientHeight||0:L.clientWidth||0:0,G=I/2-O/2,V=p[v],Y=N-y[d]-p[S],X=N/2-y[d]/2+G,te=MK(V,X,Y),re=l;i.modifiersData[r]=(e={},e[re]=te,e.centerOffset=te-X,e)}}function yxi(t){var e=t.state,i=t.options,r=i.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||Yct(e.elements.popper,n)&&(e.elements.arrow=n))}var vxi={name:"arrow",enabled:!0,phase:"main",fn:gxi,effect:yxi,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function gV(t){return t.split("-")[1]}var _xi={top:"auto",right:"auto",bottom:"auto",left:"auto"};function bxi(t){var e=t.x,i=t.y,r=window,n=r.devicePixelRatio||1;return{x:fV(e*n)/n||0,y:fV(i*n)/n||0}}function Qct(t){var e,i=t.popper,r=t.popperRect,n=t.placement,s=t.variation,o=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,p=t.isFixed,y=d===!0?bxi(o):typeof d=="function"?d(o):o,v=y.x,S=v===void 0?0:v,I=y.y,O=I===void 0?0:I,L=o.hasOwnProperty("x"),N=o.hasOwnProperty("y"),G=A_,V=I_,Y=window;if(c){var X=RK(i),te="clientHeight",re="clientWidth";if(X===eS(i)&&(X=cD(i),KT(X).position!=="static"&&a==="absolute"&&(te="scrollHeight",re="scrollWidth")),X=X,n===I_||(n===A_||n===Vw)&&s===PK){V=Gw;var fe=p&&Y.visualViewport?Y.visualViewport.height:X[te];O-=fe-r.height,O*=l?1:-1}if(n===A_||(n===I_||n===Gw)&&s===PK){G=Vw;var ge=p&&Y.visualViewport?Y.visualViewport.width:X[re];S-=ge-r.width,S*=l?1:-1}}var _e=Object.assign({position:a},c&&_xi);if(l){var Ie;return Object.assign({},_e,(Ie={},Ie[V]=N?"0":"",Ie[G]=L?"0":"",Ie.transform=(Y.devicePixelRatio||1)<=1?"translate("+S+"px, "+O+"px)":"translate3d("+S+"px, "+O+"px, 0)",Ie))}return Object.assign({},_e,(e={},e[V]=N?O+"px":"",e[G]=L?S+"px":"",e.transform="",e))}function wxi(t){var e=t.state,i=t.options,r=i.gpuAcceleration,n=r===void 0?!0:r,s=i.adaptive,o=s===void 0?!0:s,a=i.roundOffsets,l=a===void 0?!0:a,c={placement:XT(e.placement),variation:gV(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,Qct(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Qct(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var xxi={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:wxi,data:{}},ohe={passive:!0};function Sxi(t){var e=t.state,i=t.instance,r=t.options,n=r.scroll,s=n===void 0?!0:n,o=r.resize,a=o===void 0?!0:o,l=eS(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(d){d.addEventListener("scroll",i.update,ohe)}),a&&l.addEventListener("resize",i.update,ohe),function(){s&&c.forEach(function(d){d.removeEventListener("scroll",i.update,ohe)}),a&&l.removeEventListener("resize",i.update,ohe)}}var Cxi={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Sxi,data:{}},Txi={left:"right",right:"left",bottom:"top",top:"bottom"};function ahe(t){return t.replace(/left|right|bottom|top/g,function(e){return Txi[e]})}var Exi={start:"end",end:"start"};function eht(t){return t.replace(/start|end/g,function(e){return Exi[e]})}function s3e(t){var e=eS(t),i=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:i,scrollTop:r}}function o3e(t){return mV(cD(t)).left+s3e(t).scrollLeft}function Ixi(t){var e=eS(t),i=cD(t),r=e.visualViewport,n=i.clientWidth,s=i.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+o3e(t),y:a}}function Axi(t){var e,i=cD(t),r=s3e(t),n=(e=t.ownerDocument)==null?void 0:e.body,s=oN(i.scrollWidth,i.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=oN(i.scrollHeight,i.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-r.scrollLeft+o3e(t),l=-r.scrollTop;return KT(n||i).direction==="rtl"&&(a+=oN(i.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function a3e(t){var e=KT(t),i=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+n+r)}function tht(t){return["html","body","#document"].indexOf(YT(t))>=0?t.ownerDocument.body:Uw(t)&&a3e(t)?t:tht(she(t))}function DK(t,e){var i;e===void 0&&(e=[]);var r=tht(t),n=r===((i=t.ownerDocument)==null?void 0:i.body),s=eS(r),o=n?[s].concat(s.visualViewport||[],a3e(r)?r:[]):r,a=e.concat(o);return n?a:a.concat(DK(she(o)))}function l3e(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Pxi(t){var e=mV(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function iht(t,e){return e===jct?l3e(Ixi(t)):pV(e)?Pxi(e):l3e(Axi(cD(t)))}function Oxi(t){var e=DK(she(t)),i=["absolute","fixed"].indexOf(KT(t).position)>=0,r=i&&Uw(t)?RK(t):t;return pV(r)?e.filter(function(n){return pV(n)&&Yct(n,r)&&YT(n)!=="body"&&(i?KT(n).position!=="static":!0)}):[]}function Rxi(t,e,i){var r=e==="clippingParents"?Oxi(t):[].concat(e),n=[].concat(r,[i]),s=n[0],o=n.reduce(function(a,l){var c=iht(t,l);return a.top=oN(c.top,a.top),a.right=nhe(c.right,a.right),a.bottom=nhe(c.bottom,a.bottom),a.left=oN(c.left,a.left),a},iht(t,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function rht(t){var e=t.reference,i=t.element,r=t.placement,n=r?XT(r):null,s=r?gV(r):null,o=e.x+e.width/2-i.width/2,a=e.y+e.height/2-i.height/2,l;switch(n){case I_:l={x:o,y:e.y-i.height};break;case Gw:l={x:o,y:e.y+e.height};break;case Vw:l={x:e.x+e.width,y:a};break;case A_:l={x:e.x-i.width,y:a};break;default:l={x:e.x,y:e.y}}var c=n?n3e(n):null;if(c!=null){var d=c==="y"?"height":"width";switch(s){case dV:l[c]=l[c]-(e[d]/2-i[d]/2);break;case PK:l[c]=l[c]+(e[d]/2-i[d]/2);break}}return l}function FK(t,e){e===void 0&&(e={});var i=e,r=i.placement,n=r===void 0?t.placement:r,s=i.boundary,o=s===void 0?Zwi:s,a=i.rootBoundary,l=a===void 0?jct:a,c=i.elementContext,d=c===void 0?OK:c,p=i.altBoundary,y=p===void 0?!1:p,v=i.padding,S=v===void 0?0:v,I=Jct(typeof S!="number"?S:Zct(S,AK)),O=d===OK?Qwi:OK,L=t.rects.popper,N=t.elements[y?O:d],G=Rxi(pV(N)?N:N.contextElement||cD(t.elements.popper),o,l),V=mV(t.elements.reference),Y=rht({reference:V,element:L,strategy:"absolute",placement:n}),X=l3e(Object.assign({},L,Y)),te=d===OK?X:V,re={top:G.top-te.top+I.top,bottom:te.bottom-G.bottom+I.bottom,left:G.left-te.left+I.left,right:te.right-G.right+I.right},fe=t.modifiersData.offset;if(d===OK&&fe){var ge=fe[n];Object.keys(re).forEach(function(_e){var Ie=[Vw,Gw].indexOf(_e)>=0?1:-1,ke=[I_,Gw].indexOf(_e)>=0?"y":"x";re[_e]+=ge[ke]*Ie})}return re}function Mxi(t,e){e===void 0&&(e={});var i=e,r=i.placement,n=i.boundary,s=i.rootBoundary,o=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=l===void 0?Hct:l,d=gV(r),p=d?a?zct:zct.filter(function(S){return gV(S)===d}):AK,y=p.filter(function(S){return c.indexOf(S)>=0});y.length===0&&(y=p);var v=y.reduce(function(S,I){return S[I]=FK(t,{placement:I,boundary:n,rootBoundary:s,padding:o})[XT(I)],S},{});return Object.keys(v).sort(function(S,I){return v[S]-v[I]})}function Dxi(t){if(XT(t)===i3e)return[];var e=ahe(t);return[eht(t),e,eht(e)]}function Fxi(t){var e=t.state,i=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var n=i.mainAxis,s=n===void 0?!0:n,o=i.altAxis,a=o===void 0?!0:o,l=i.fallbackPlacements,c=i.padding,d=i.boundary,p=i.rootBoundary,y=i.altBoundary,v=i.flipVariations,S=v===void 0?!0:v,I=i.allowedAutoPlacements,O=e.options.placement,L=XT(O),N=L===O,G=l||(N||!S?[ahe(O)]:Dxi(O)),V=[O].concat(G).reduce(function(et,tt){return et.concat(XT(tt)===i3e?Mxi(e,{placement:tt,boundary:d,rootBoundary:p,padding:c,flipVariations:S,allowedAutoPlacements:I}):tt)},[]),Y=e.rects.reference,X=e.rects.popper,te=new Map,re=!0,fe=V[0],ge=0;ge=0,J=Ne?"width":"height",he=FK(e,{placement:_e,boundary:d,rootBoundary:p,altBoundary:y,padding:c}),xe=Ne?ke?Vw:A_:ke?Gw:I_;Y[J]>X[J]&&(xe=ahe(xe));var Pe=ahe(xe),Oe=[];if(s&&Oe.push(he[Ie]<=0),a&&Oe.push(he[xe]<=0,he[Pe]<=0),Oe.every(function(et){return et})){fe=_e,re=!1;break}te.set(_e,Oe)}if(re)for(var Ae=S?3:1,ze=function(tt){var ft=V.find(function(Pt){var $t=te.get(Pt);if($t)return $t.slice(0,tt).every(function(St){return St})});if(ft)return fe=ft,"break"},Ge=Ae;Ge>0;Ge--){var Je=ze(Ge);if(Je==="break")break}e.placement!==fe&&(e.modifiersData[r]._skip=!0,e.placement=fe,e.reset=!0)}}var Lxi={name:"flip",enabled:!0,phase:"main",fn:Fxi,requiresIfExists:["offset"],data:{_skip:!1}};function nht(t,e,i){return i===void 0&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function sht(t){return[I_,Vw,Gw,A_].some(function(e){return t[e]>=0})}function kxi(t){var e=t.state,i=t.name,r=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=FK(e,{elementContext:"reference"}),a=FK(e,{altBoundary:!0}),l=nht(o,r),c=nht(a,n,s),d=sht(l),p=sht(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}var Nxi={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:kxi};function $xi(t,e,i){var r=XT(t),n=[A_,I_].indexOf(r)>=0?-1:1,s=typeof i=="function"?i(Object.assign({},e,{placement:t})):i,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[A_,Vw].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function Bxi(t){var e=t.state,i=t.options,r=t.name,n=i.offset,s=n===void 0?[0,0]:n,o=Hct.reduce(function(d,p){return d[p]=$xi(p,e.rects,s),d},{}),a=o[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}var Gxi={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Bxi};function Vxi(t){var e=t.state,i=t.name;e.modifiersData[i]=rht({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Uxi={name:"popperOffsets",enabled:!0,phase:"read",fn:Vxi,data:{}};function jxi(t){return t==="x"?"y":"x"}function zxi(t){var e=t.state,i=t.options,r=t.name,n=i.mainAxis,s=n===void 0?!0:n,o=i.altAxis,a=o===void 0?!1:o,l=i.boundary,c=i.rootBoundary,d=i.altBoundary,p=i.padding,y=i.tether,v=y===void 0?!0:y,S=i.tetherOffset,I=S===void 0?0:S,O=FK(e,{boundary:l,rootBoundary:c,padding:p,altBoundary:d}),L=XT(e.placement),N=gV(e.placement),G=!N,V=n3e(L),Y=jxi(V),X=e.modifiersData.popperOffsets,te=e.rects.reference,re=e.rects.popper,fe=typeof I=="function"?I(Object.assign({},e.rects,{placement:e.placement})):I,ge=typeof fe=="number"?{mainAxis:fe,altAxis:fe}:Object.assign({mainAxis:0,altAxis:0},fe),_e=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,Ie={x:0,y:0};if(X){if(s){var ke,Ne=V==="y"?I_:A_,J=V==="y"?Gw:Vw,he=V==="y"?"height":"width",xe=X[V],Pe=xe+O[Ne],Oe=xe-O[J],Ae=v?-re[he]/2:0,ze=N===dV?te[he]:re[he],Ge=N===dV?-re[he]:-te[he],Je=e.elements.arrow,et=v&&Je?r3e(Je):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Kct(),ft=tt[Ne],Pt=tt[J],$t=MK(0,te[he],et[he]),St=G?te[he]/2-Ae-$t-ft-ge.mainAxis:ze-$t-ft-ge.mainAxis,Tt=G?-te[he]/2+Ae+$t+Pt+ge.mainAxis:Ge+$t+Pt+ge.mainAxis,Lt=e.elements.arrow&&RK(e.elements.arrow),at=Lt?V==="y"?Lt.clientTop||0:Lt.clientLeft||0:0,Ee=(ke=_e?.[V])!=null?ke:0,Be=xe+St-Ee-at,mt=xe+Tt-Ee,kt=MK(v?nhe(Pe,Be):Pe,xe,v?oN(Oe,mt):Oe);X[V]=kt,Ie[V]=kt-xe}if(a){var ct,le=V==="x"?I_:A_,it=V==="x"?Gw:Vw,pt=X[Y],Le=Y==="y"?"height":"width",ce=pt+O[le],Ce=pt-O[it],Ze=[I_,A_].indexOf(L)!==-1,yt=(ct=_e?.[Y])!=null?ct:0,Ve=Ze?ce:pt-te[Le]-re[Le]-yt+ge.altAxis,At=Ze?pt+te[Le]+re[Le]-yt-ge.altAxis:Ce,ii=v&&Ze?fxi(Ve,pt,At):MK(v?Ve:ce,pt,v?At:Ce);X[Y]=ii,Ie[Y]=ii-pt}e.modifiersData[r]=Ie}}var Hxi={name:"preventOverflow",enabled:!0,phase:"main",fn:zxi,requiresIfExists:["offset"]};function Wxi(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function qxi(t){return t===eS(t)||!Uw(t)?s3e(t):Wxi(t)}function Yxi(t){var e=t.getBoundingClientRect(),i=fV(e.width)/t.offsetWidth||1,r=fV(e.height)/t.offsetHeight||1;return i!==1||r!==1}function Xxi(t,e,i){i===void 0&&(i=!1);var r=Uw(e),n=Uw(e)&&Yxi(e),s=cD(e),o=mV(t,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!i)&&((YT(e)!=="body"||a3e(s))&&(a=qxi(e)),Uw(e)?(l=mV(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=o3e(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Kxi(t){var e=new Map,i=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function n(s){i.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!i.has(a)){var l=e.get(a);l&&n(l)}}),r.push(s)}return t.forEach(function(s){i.has(s.name)||n(s)}),r}function Jxi(t){var e=Kxi(t);return uxi.reduce(function(i,r){return i.concat(e.filter(function(n){return n.phase===r}))},[])}function Zxi(t){var e;return function(){return e||(e=new Promise(function(i){Promise.resolve().then(function(){e=void 0,i(t())})})),e}}function Qxi(t){var e=t.reduce(function(i,r){var n=i[r.name];return i[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,i},{});return Object.keys(e).map(function(i){return e[i]})}var oht={placement:"bottom",modifiers:[],strategy:"absolute"};function aht(){for(var t=arguments.length,e=new Array(t),i=0;i-1}function pht(t,e){return typeof t=="function"?t.apply(void 0,e):t}function fht(t,e){if(e===0)return t;var i;return function(r){clearTimeout(i),i=setTimeout(function(){t(r)},e)}}function n2i(t,e){var i=Object.assign({},t);return e.forEach(function(r){delete i[r]}),i}function s2i(t){return t.split(/\s+/).filter(Boolean)}function lN(t){return[].concat(t)}function mht(t,e){t.indexOf(e)===-1&&t.push(e)}function o2i(t){return t.filter(function(e,i){return t.indexOf(e)===i})}function ght(t){return t.split("-")[0]}function yV(t){return[].slice.call(t)}function yht(t){return Object.keys(t).reduce(function(e,i){return t[i]!==void 0&&(e[i]=t[i]),e},{})}function uN(){return document.createElement("div")}function lhe(t){return["Element","Fragment"].some(function(e){return c3e(t,e)})}function a2i(t){return c3e(t,"NodeList")}function h3e(t){return c3e(t,"MouseEvent")}function l2i(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function u2i(t){return lhe(t)?[t]:a2i(t)?yV(t):Array.isArray(t)?t:yV(document.querySelectorAll(t))}function d3e(t,e){t.forEach(function(i){i&&(i.style.transitionDuration=e+"ms")})}function LK(t,e){t.forEach(function(i){i&&i.setAttribute("data-state",e)})}function vht(t){var e,i=lN(t),r=i[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function c2i(t,e){var i=e.clientX,r=e.clientY;return t.every(function(n){var s=n.popperRect,o=n.popperState,a=n.props,l=a.interactiveBorder,c=ght(o.placement),d=o.modifiersData.offset;if(!d)return!0;var p=c==="bottom"?d.top.y:0,y=c==="top"?d.bottom.y:0,v=c==="right"?d.left.x:0,S=c==="left"?d.right.x:0,I=s.top-r+p>l,O=r-s.bottom-y>l,L=s.left-i+v>l,N=i-s.right-S>l;return I||O||L||N})}function p3e(t,e,i){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){t[r](n,i)})}function _ht(t,e){for(var i=e;i;){var r;if(t.contains(i))return!0;i=i.getRootNode==null||(r=i.getRootNode())==null?void 0:r.host}return!1}var JT={isTouch:!1},bht=0;function h2i(){JT.isTouch||(JT.isTouch=!0,window.performance&&document.addEventListener("mousemove",wht))}function wht(){var t=performance.now();t-bht<20&&(JT.isTouch=!1,document.removeEventListener("mousemove",wht)),bht=t}function d2i(){var t=document.activeElement;if(l2i(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function p2i(){document.addEventListener("touchstart",h2i,aN),window.addEventListener("blur",d2i)}var f2i=typeof window<"u"&&typeof document<"u",m2i=f2i?!!window.msCrypto:!1,g2i={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},y2i={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},tS=Object.assign({appendTo:dht,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},g2i,y2i),v2i=Object.keys(tS),_2i=function(e){var i=Object.keys(e);i.forEach(function(r){tS[r]=e[r]})};function xht(t){var e=t.plugins||[],i=e.reduce(function(r,n){var s=n.name,o=n.defaultValue;if(s){var a;r[s]=t[s]!==void 0?t[s]:(a=tS[s])!=null?a:o}return r},{});return Object.assign({},t,i)}function b2i(t,e){var i=e?Object.keys(xht(Object.assign({},tS,{plugins:e}))):v2i,r=i.reduce(function(n,s){var o=(t.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 Sht(t,e){var i=Object.assign({},e,{content:pht(e.content,[t])},e.ignoreAttributes?{}:b2i(t,e.plugins));return i.aria=Object.assign({},tS.aria,i.aria),i.aria={expanded:i.aria.expanded==="auto"?e.interactive:i.aria.expanded,content:i.aria.content==="auto"?e.interactive?null:"describedby":i.aria.content},i}var w2i=function(){return"innerHTML"};function f3e(t,e){t[w2i()]=e}function Cht(t){var e=uN();return t===!0?e.className=cht:(e.className=hht,lhe(t)?e.appendChild(t):f3e(e,t)),e}function Tht(t,e){lhe(e.content)?(f3e(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?f3e(t,e.content):t.textContent=e.content)}function uhe(t){var e=t.firstElementChild,i=yV(e.children);return{box:e,content:i.find(function(r){return r.classList.contains(lht)}),arrow:i.find(function(r){return r.classList.contains(cht)||r.classList.contains(hht)}),backdrop:i.find(function(r){return r.classList.contains(uht)})}}function Eht(t){var e=uN(),i=uN();i.className=r2i,i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var r=uN();r.className=lht,r.setAttribute("data-state","hidden"),Tht(r,t.props),e.appendChild(i),i.appendChild(r),n(t.props,t.props);function n(s,o){var a=uhe(e),l=a.box,c=a.content,d=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)&&Tht(c,t.props),o.arrow?d?s.arrow!==o.arrow&&(l.removeChild(d),l.appendChild(Cht(o.arrow))):l.appendChild(Cht(o.arrow)):d&&l.removeChild(d)}return{popper:e,onUpdate:n}}Eht.$$tippy=!0;var x2i=1,che=[],m3e=[];function S2i(t,e){var i=Sht(t,Object.assign({},tS,xht(yht(e)))),r,n,s,o=!1,a=!1,l=!1,c=!1,d,p,y,v=[],S=fht(Be,i.interactiveDebounce),I,O=x2i++,L=null,N=o2i(i.plugins),G={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},V={id:O,reference:t,popper:uN(),popperInstance:L,props:i,state:G,plugins:N,clearDelayTimeouts:Ve,setProps:At,setContent:ii,show:gt,hide:Ue,hideWithInteractivity:ni,enable:Ze,disable:yt,unmount:A,destroy:ve};if(!i.render)return V;var Y=i.render(V),X=Y.popper,te=Y.onUpdate;X.setAttribute("data-tippy-root",""),X.id="tippy-"+V.id,V.popper=X,t._tippy=V,X._tippy=V;var re=N.map(function(W){return W.fn(V)}),fe=t.hasAttribute("aria-expanded");return Lt(),Ae(),xe(),Pe("onCreate",[V]),i.showOnCreate&&ce(),X.addEventListener("mouseenter",function(){V.props.interactive&&V.state.isVisible&&V.clearDelayTimeouts()}),X.addEventListener("mouseleave",function(){V.props.interactive&&V.props.trigger.indexOf("mouseenter")>=0&&Ne().addEventListener("mousemove",S)}),V;function ge(){var W=V.props.touch;return Array.isArray(W)?W:[W,0]}function _e(){return ge()[0]==="hold"}function Ie(){var W;return!!((W=V.props.render)!=null&&W.$$tippy)}function ke(){return I||t}function Ne(){var W=ke().parentNode;return W?vht(W):document}function J(){return uhe(X)}function he(W){return V.state.isMounted&&!V.state.isVisible||JT.isTouch||d&&d.type==="focus"?0:u3e(V.props.delay,W?0:1,tS.delay)}function xe(W){W===void 0&&(W=!1),X.style.pointerEvents=V.props.interactive&&!W?"":"none",X.style.zIndex=""+V.props.zIndex}function Pe(W,T,b){if(b===void 0&&(b=!0),re.forEach(function(_){_[W]&&_[W].apply(_,T)}),b){var m;(m=V.props)[W].apply(m,T)}}function Oe(){var W=V.props.aria;if(W.content){var T="aria-"+W.content,b=X.id,m=lN(V.props.triggerTarget||t);m.forEach(function(_){var C=_.getAttribute(T);if(V.state.isVisible)_.setAttribute(T,C?C+" "+b:b);else{var D=C&&C.replace(b,"").trim();D?_.setAttribute(T,D):_.removeAttribute(T)}})}}function Ae(){if(!(fe||!V.props.aria.expanded)){var W=lN(V.props.triggerTarget||t);W.forEach(function(T){V.props.interactive?T.setAttribute("aria-expanded",V.state.isVisible&&T===ke()?"true":"false"):T.removeAttribute("aria-expanded")})}}function ze(){Ne().removeEventListener("mousemove",S),che=che.filter(function(W){return W!==S})}function Ge(W){if(!(JT.isTouch&&(l||W.type==="mousedown"))){var T=W.composedPath&&W.composedPath()[0]||W.target;if(!(V.props.interactive&&_ht(X,T))){if(lN(V.props.triggerTarget||t).some(function(b){return _ht(b,T)})){if(JT.isTouch||V.state.isVisible&&V.props.trigger.indexOf("click")>=0)return}else Pe("onClickOutside",[V,W]);V.props.hideOnClick===!0&&(V.clearDelayTimeouts(),V.hide(),a=!0,setTimeout(function(){a=!1}),V.state.isMounted||ft())}}}function Je(){l=!0}function et(){l=!1}function tt(){var W=Ne();W.addEventListener("mousedown",Ge,!0),W.addEventListener("touchend",Ge,aN),W.addEventListener("touchstart",et,aN),W.addEventListener("touchmove",Je,aN)}function ft(){var W=Ne();W.removeEventListener("mousedown",Ge,!0),W.removeEventListener("touchend",Ge,aN),W.removeEventListener("touchstart",et,aN),W.removeEventListener("touchmove",Je,aN)}function Pt(W,T){St(W,function(){!V.state.isVisible&&X.parentNode&&X.parentNode.contains(X)&&T()})}function $t(W,T){St(W,T)}function St(W,T){var b=J().box;function m(_){_.target===b&&(p3e(b,"remove",m),T())}if(W===0)return T();p3e(b,"remove",p),p3e(b,"add",m),p=m}function Tt(W,T,b){b===void 0&&(b=!1);var m=lN(V.props.triggerTarget||t);m.forEach(function(_){_.addEventListener(W,T,b),v.push({node:_,eventType:W,handler:T,options:b})})}function Lt(){_e()&&(Tt("touchstart",Ee,{passive:!0}),Tt("touchend",mt,{passive:!0})),s2i(V.props.trigger).forEach(function(W){if(W!=="manual")switch(Tt(W,Ee),W){case"mouseenter":Tt("mouseleave",mt);break;case"focus":Tt(m2i?"focusout":"blur",kt);break;case"focusin":Tt("focusout",kt);break}})}function at(){v.forEach(function(W){var T=W.node,b=W.eventType,m=W.handler,_=W.options;T.removeEventListener(b,m,_)}),v=[]}function Ee(W){var T,b=!1;if(!(!V.state.isEnabled||ct(W)||a)){var m=((T=d)==null?void 0:T.type)==="focus";d=W,I=W.currentTarget,Ae(),!V.state.isVisible&&h3e(W)&&che.forEach(function(_){return _(W)}),W.type==="click"&&(V.props.trigger.indexOf("mouseenter")<0||o)&&V.props.hideOnClick!==!1&&V.state.isVisible?b=!0:ce(W),W.type==="click"&&(o=!b),b&&!m&&Ce(W)}}function Be(W){var T=W.target,b=ke().contains(T)||X.contains(T);if(!(W.type==="mousemove"&&b)){var m=Le().concat(X).map(function(_){var C,D=_._tippy,F=(C=D.popperInstance)==null?void 0:C.state;return F?{popperRect:_.getBoundingClientRect(),popperState:F,props:i}:null}).filter(Boolean);c2i(m,W)&&(ze(),Ce(W))}}function mt(W){var T=ct(W)||V.props.trigger.indexOf("click")>=0&&o;if(!T){if(V.props.interactive){V.hideWithInteractivity(W);return}Ce(W)}}function kt(W){V.props.trigger.indexOf("focusin")<0&&W.target!==ke()||V.props.interactive&&W.relatedTarget&&X.contains(W.relatedTarget)||Ce(W)}function ct(W){return JT.isTouch?_e()!==W.type.indexOf("touch")>=0:!1}function le(){it();var W=V.props,T=W.popperOptions,b=W.placement,m=W.offset,_=W.getReferenceClientRect,C=W.moveTransition,D=Ie()?uhe(X).arrow:null,F=_?{getBoundingClientRect:_,contextElement:_.contextElement||ke()}:t,B={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(oe){var ue=oe.state;if(Ie()){var be=J(),De=be.box;["placement","reference-hidden","escaped"].forEach(function(qe){qe==="placement"?De.setAttribute("data-placement",ue.placement):ue.attributes.popper["data-popper-"+qe]?De.setAttribute("data-"+qe,""):De.removeAttribute("data-"+qe)}),ue.attributes.popper={}}}},q=[{name:"offset",options:{offset:m}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!C}},B];Ie()&&D&&q.push({name:"arrow",options:{element:D,padding:3}}),q.push.apply(q,T?.modifiers||[]),V.popperInstance=i2i(F,X,Object.assign({},T,{placement:b,onFirstUpdate:y,modifiers:q}))}function it(){V.popperInstance&&(V.popperInstance.destroy(),V.popperInstance=null)}function pt(){var W=V.props.appendTo,T,b=ke();V.props.interactive&&W===dht||W==="parent"?T=b.parentNode:T=pht(W,[b]),T.contains(X)||T.appendChild(X),V.state.isMounted=!0,le()}function Le(){return yV(X.querySelectorAll("[data-tippy-root]"))}function ce(W){V.clearDelayTimeouts(),W&&Pe("onTrigger",[V,W]),tt();var T=he(!0),b=ge(),m=b[0],_=b[1];JT.isTouch&&m==="hold"&&_&&(T=_),T?r=setTimeout(function(){V.show()},T):V.show()}function Ce(W){if(V.clearDelayTimeouts(),Pe("onUntrigger",[V,W]),!V.state.isVisible){ft();return}if(!(V.props.trigger.indexOf("mouseenter")>=0&&V.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(W.type)>=0&&o)){var T=he(!1);T?n=setTimeout(function(){V.state.isVisible&&V.hide()},T):s=requestAnimationFrame(function(){V.hide()})}}function Ze(){V.state.isEnabled=!0}function yt(){V.hide(),V.state.isEnabled=!1}function Ve(){clearTimeout(r),clearTimeout(n),cancelAnimationFrame(s)}function At(W){if(!V.state.isDestroyed){Pe("onBeforeUpdate",[V,W]),at();var T=V.props,b=Sht(t,Object.assign({},T,yht(W),{ignoreAttributes:!0}));V.props=b,Lt(),T.interactiveDebounce!==b.interactiveDebounce&&(ze(),S=fht(Be,b.interactiveDebounce)),T.triggerTarget&&!b.triggerTarget?lN(T.triggerTarget).forEach(function(m){m.removeAttribute("aria-expanded")}):b.triggerTarget&&t.removeAttribute("aria-expanded"),Ae(),xe(),te&&te(T,b),V.popperInstance&&(le(),Le().forEach(function(m){requestAnimationFrame(m._tippy.popperInstance.forceUpdate)})),Pe("onAfterUpdate",[V,W])}}function ii(W){V.setProps({content:W})}function gt(){var W=V.state.isVisible,T=V.state.isDestroyed,b=!V.state.isEnabled,m=JT.isTouch&&!V.props.touch,_=u3e(V.props.duration,0,tS.duration);if(!(W||T||b||m)&&!ke().hasAttribute("disabled")&&(Pe("onShow",[V],!1),V.props.onShow(V)!==!1)){if(V.state.isVisible=!0,Ie()&&(X.style.visibility="visible"),xe(),tt(),V.state.isMounted||(X.style.transition="none"),Ie()){var C=J(),D=C.box,F=C.content;d3e([D,F],0)}y=function(){var q;if(!(!V.state.isVisible||c)){if(c=!0,X.offsetHeight,X.style.transition=V.props.moveTransition,Ie()&&V.props.animation){var Z=J(),oe=Z.box,ue=Z.content;d3e([oe,ue],_),LK([oe,ue],"visible")}Oe(),Ae(),mht(m3e,V),(q=V.popperInstance)==null||q.forceUpdate(),Pe("onMount",[V]),V.props.animation&&Ie()&&$t(_,function(){V.state.isShown=!0,Pe("onShown",[V])})}},pt()}}function Ue(){var W=!V.state.isVisible,T=V.state.isDestroyed,b=!V.state.isEnabled,m=u3e(V.props.duration,1,tS.duration);if(!(W||T||b)&&(Pe("onHide",[V],!1),V.props.onHide(V)!==!1)){if(V.state.isVisible=!1,V.state.isShown=!1,c=!1,o=!1,Ie()&&(X.style.visibility="hidden"),ze(),ft(),xe(!0),Ie()){var _=J(),C=_.box,D=_.content;V.props.animation&&(d3e([C,D],m),LK([C,D],"hidden"))}Oe(),Ae(),V.props.animation?Ie()&&Pt(m,V.unmount):V.unmount()}}function ni(W){Ne().addEventListener("mousemove",S),mht(che,S),S(W)}function A(){V.state.isVisible&&V.hide(),V.state.isMounted&&(it(),Le().forEach(function(W){W._tippy.unmount()}),X.parentNode&&X.parentNode.removeChild(X),m3e=m3e.filter(function(W){return W!==V}),V.state.isMounted=!1,Pe("onHidden",[V]))}function ve(){V.state.isDestroyed||(V.clearDelayTimeouts(),V.unmount(),at(),delete t._tippy,V.state.isDestroyed=!0,Pe("onDestroy",[V]))}}function wo(t,e){e===void 0&&(e={});var i=tS.plugins.concat(e.plugins||[]);p2i();var r=Object.assign({},e,{plugins:i}),n=u2i(t),s=n.reduce(function(o,a){var l=a&&S2i(a,r);return l&&o.push(l),o},[]);return lhe(t)?s[0]:s}wo.defaultProps=tS,wo.setDefaultProps=_2i,wo.currentInput=JT;var C2i=Object.assign({},qct,{effect:function(e){var i=e.state,r={popper:{position:i.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(i.elements.popper.style,r.popper),i.styles=r,i.elements.arrow&&Object.assign(i.elements.arrow.style,r.arrow)}}),T2i=function(e,i){var r;i===void 0&&(i={});var n=e,s=[],o=[],a,l=i.overrides,c=[],d=!1;function p(){o=n.map(function(V){return lN(V.props.triggerTarget||V.reference)}).reduce(function(V,Y){return V.concat(Y)},[])}function y(){s=n.map(function(V){return V.reference})}function v(V){n.forEach(function(Y){V?Y.enable():Y.disable()})}function S(V){return n.map(function(Y){var X=Y.setProps;return Y.setProps=function(te){X(te),Y.reference===a&&V.setProps(te)},function(){Y.setProps=X}})}function I(V,Y){var X=o.indexOf(Y);if(Y!==a){a=Y;var te=(l||[]).concat("content").reduce(function(re,fe){return re[fe]=n[X].props[fe],re},{});V.setProps(Object.assign({},te,{getReferenceClientRect:typeof te.getReferenceClientRect=="function"?te.getReferenceClientRect:function(){var re;return(re=s[X])==null?void 0:re.getBoundingClientRect()}}))}}v(!1),y(),p();var O={fn:function(){return{onDestroy:function(){v(!0)},onHidden:function(){a=null},onClickOutside:function(X){X.props.showOnCreate&&!d&&(d=!0,a=null)},onShow:function(X){X.props.showOnCreate&&!d&&(d=!0,I(X,s[0]))},onTrigger:function(X,te){I(X,te.currentTarget)}}}},L=wo(uN(),Object.assign({},n2i(i,["overrides"]),{plugins:[O].concat(i.plugins||[]),triggerTarget:o,popperOptions:Object.assign({},i.popperOptions,{modifiers:[].concat(((r=i.popperOptions)==null?void 0:r.modifiers)||[],[C2i])})})),N=L.show;L.show=function(V){if(N(),!a&&V==null)return I(L,s[0]);if(!(a&&V==null)){if(typeof V=="number")return s[V]&&I(L,s[V]);if(n.indexOf(V)>=0){var Y=V.reference;return I(L,Y)}if(s.indexOf(V)>=0)return I(L,V)}},L.showNext=function(){var V=s[0];if(!a)return L.show(0);var Y=s.indexOf(a);L.show(s[Y+1]||V)},L.showPrevious=function(){var V=s[s.length-1];if(!a)return L.show(V);var Y=s.indexOf(a),X=s[Y-1]||V;L.show(X)};var G=L.setProps;return L.setProps=function(V){l=V.overrides||l,G(V)},L.setInstances=function(V){v(!0),c.forEach(function(Y){return Y()}),n=V,v(!1),y(),p(),c=S(L),L.setProps({triggerTarget:o})},c=S(L),L},E2i={name:"animateFill",defaultValue:!1,fn:function(e){var i;if(!((i=e.props.render)!=null&&i.$$tippy))return{};var r=uhe(e.popper),n=r.box,s=r.content,o=e.props.animateFill?I2i():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,c=Number(l.replace("ms",""));s.style.transitionDelay=Math.round(c/10)+"ms",o.style.transitionDuration=l,LK([o],"visible")}},onShow:function(){o&&(o.style.transitionDuration="0ms")},onHide:function(){o&&LK([o],"hidden")}}}};function I2i(){var t=uN();return t.className=uht,LK([t],"hidden"),t}var g3e={clientX:0,clientY:0},hhe=[];function Iht(t){var e=t.clientX,i=t.clientY;g3e={clientX:e,clientY:i}}function A2i(t){t.addEventListener("mousemove",Iht)}function P2i(t){t.removeEventListener("mousemove",Iht)}var O2i={name:"followCursor",defaultValue:!1,fn:function(e){var i=e.reference,r=vht(e.props.triggerTarget||i),n=!1,s=!1,o=!0,a=e.props;function l(){return e.props.followCursor==="initial"&&e.state.isVisible}function c(){r.addEventListener("mousemove",y)}function d(){r.removeEventListener("mousemove",y)}function p(){n=!0,e.setProps({getReferenceClientRect:null}),n=!1}function y(I){var O=I.target?i.contains(I.target):!0,L=e.props.followCursor,N=I.clientX,G=I.clientY,V=i.getBoundingClientRect(),Y=N-V.left,X=G-V.top;(O||!e.props.interactive)&&e.setProps({getReferenceClientRect:function(){var re=i.getBoundingClientRect(),fe=N,ge=G;L==="initial"&&(fe=re.left+Y,ge=re.top+X);var _e=L==="horizontal"?re.top:ge,Ie=L==="vertical"?re.right:fe,ke=L==="horizontal"?re.bottom:ge,Ne=L==="vertical"?re.left:fe;return{width:Ie-Ne,height:ke-_e,top:_e,right:Ie,bottom:ke,left:Ne}}})}function v(){e.props.followCursor&&(hhe.push({instance:e,doc:r}),A2i(r))}function S(){hhe=hhe.filter(function(I){return I.instance!==e}),hhe.filter(function(I){return I.doc===r}).length===0&&P2i(r)}return{onCreate:v,onDestroy:S,onBeforeUpdate:function(){a=e.props},onAfterUpdate:function(O,L){var N=L.followCursor;n||N!==void 0&&a.followCursor!==N&&(S(),N?(v(),e.state.isMounted&&!s&&!l()&&c()):(d(),p()))},onMount:function(){e.props.followCursor&&!s&&(o&&(y(g3e),o=!1),l()||c())},onTrigger:function(O,L){h3e(L)&&(g3e={clientX:L.clientX,clientY:L.clientY}),s=L.type==="focus"},onHidden:function(){e.props.followCursor&&(p(),d(),o=!0)}}}};function R2i(t,e){var i;return{popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((((i=t.popperOptions)==null?void 0:i.modifiers)||[]).filter(function(r){var n=r.name;return n!==e.name}),[e])})}}var M2i={name:"inlinePositioning",defaultValue:!1,fn:function(e){var i=e.reference;function r(){return!!e.props.inlinePositioning}var n,s=-1,o=!1,a=[],l={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(v){var S=v.state;r()&&(a.indexOf(S.placement)!==-1&&(a=[]),n!==S.placement&&a.indexOf(S.placement)===-1&&(a.push(S.placement),e.setProps({getReferenceClientRect:function(){return c(S.placement)}})),n=S.placement)}};function c(y){return D2i(ght(y),i.getBoundingClientRect(),yV(i.getClientRects()),s)}function d(y){o=!0,e.setProps(y),o=!1}function p(){o||d(R2i(e.props,l))}return{onCreate:p,onAfterUpdate:p,onTrigger:function(v,S){if(h3e(S)){var I=yV(e.reference.getClientRects()),O=I.find(function(N){return N.left-2<=S.clientX&&N.right+2>=S.clientX&&N.top-2<=S.clientY&&N.bottom+2>=S.clientY}),L=I.indexOf(O);s=L>-1?L:s}},onHidden:function(){s=-1}}}};function D2i(t,e,i,r){if(i.length<2||t===null)return e;if(i.length===2&&r>=0&&i[0].left>i[1].right)return i[r]||e;switch(t){case"top":case"bottom":{var n=i[0],s=i[i.length-1],o=t==="top",a=n.top,l=s.bottom,c=o?n.left:s.left,d=o?n.right:s.right,p=d-c,y=l-a;return{top:a,bottom:l,left:c,right:d,width:p,height:y}}case"left":case"right":{var v=Math.min.apply(Math,i.map(function(X){return X.left})),S=Math.max.apply(Math,i.map(function(X){return X.right})),I=i.filter(function(X){return t==="left"?X.left===v:X.right===S}),O=I[0].top,L=I[I.length-1].bottom,N=v,G=S,V=G-N,Y=L-O;return{top:O,bottom:L,left:N,right:G,width:V,height:Y}}default:return e}}var F2i={name:"sticky",defaultValue:!1,fn:function(e){var i=e.reference,r=e.popper;function n(){return e.popperInstance?e.popperInstance.state.elements.reference:i}function s(c){return e.props.sticky===!0||e.props.sticky===c}var o=null,a=null;function l(){var c=s("reference")?n().getBoundingClientRect():null,d=s("popper")?r.getBoundingClientRect():null;(c&&Aht(o,c)||d&&Aht(a,d))&&e.popperInstance&&e.popperInstance.update(),o=c,a=d,e.state.isMounted&&requestAnimationFrame(l)}return{onMount:function(){e.props.sticky&&l()}}}};function Aht(t,e){return t&&e?t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom||t.left!==e.left:!0}wo.setDefaultProps({render:Eht}),wo.setDefaultProps({onShow:t=>{if(!t.props.content)return!1}});function y3e(t,e={},i={mount:!0}){const r=ff(),n=Pi(),s=Pi({isEnabled:!1,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1});let o=null;const a=()=>o||(o=document.createDocumentFragment(),o),l=X=>{let te,re=lc(X)?X.value:X;if(GT(re))r&&(re.appContext=r.appContext),K2(re,a()),te=()=>a();else if(typeof re=="object"){let fe=X2(re);r&&(fe.appContext=r.appContext),K2(fe,a()),te=()=>a()}else te=re;return te},c=X=>{let te={};return lc(X)?te=X.value||{}:Aw(X)?te={...X}:te={...X},te.content&&(te.content=l(te.content)),te.triggerTarget&&(te.triggerTarget=lc(te.triggerTarget)?te.triggerTarget.value:te.triggerTarget),(!te.plugins||!Array.isArray(te.plugins))&&(te.plugins=[]),te.plugins=te.plugins.filter(re=>re.name!=="vueTippyReactiveState"),te.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}})}),te},d=()=>{n.value&&n.value.setProps(c(e))},p=()=>{!n.value||!e.content||n.value.setContent(l(e.content))},y=X=>{var te;(te=n.value)===null||te===void 0||te.setContent(l(X))},v=X=>{var te;(te=n.value)===null||te===void 0||te.setProps(c(X))},S=()=>{n.value&&(n.value.destroy(),n.value=void 0),o=null},I=()=>{var X;(X=n.value)===null||X===void 0||X.show()},O=()=>{var X;(X=n.value)===null||X===void 0||X.hide()},L=()=>{var X;(X=n.value)===null||X===void 0||X.disable(),s.value.isEnabled=!1},N=()=>{var X;(X=n.value)===null||X===void 0||X.enable(),s.value.isEnabled=!0},G=()=>{var X;(X=n.value)===null||X===void 0||X.unmount()},V=()=>{if(!t)return;let X=lc(t)?t.value:t;typeof X=="function"&&(X=X()),X&&(n.value=wo(X,c(e)),X.$tippy=Y)},Y={tippy:n,refresh:d,refreshContent:p,setContent:y,setProps:v,destroy:S,hide:O,show:I,disable:L,enable:N,unmount:G,mount:V,state:s};return i.mount&&(r?(r.isMounted?V():al(V),Wk(()=>{S()})):V()),lc(e)||Aw(e)?Sc(e,d,{immediate:!1}):lc(e.content)&&Sc(e.content,p,{immediate:!1}),Y}function L2i(t,e){const i=Pi();return al(()=>{const n=(Array.isArray(t)?t.map(s=>s.value):typeof t=="function"?t():t.value).map(s=>s instanceof Element?s._tippy:s).filter(Boolean);i.value=T2i(n,e?{allowHTML:!0,...e}:{allowHTML:!0})}),{singleton:i}}const k2i=Zr({props:{to:{type:[String,Function]},tag:{type:String,default:"span"},contentTag:{type:String,default:"span"},contentClass:{type:String,default:null},appendTo:{default:()=>wo.defaultProps.appendTo},aria:{default:()=>wo.defaultProps.aria},delay:{default:()=>wo.defaultProps.delay},duration:{default:()=>wo.defaultProps.duration},getReferenceClientRect:{default:()=>wo.defaultProps.getReferenceClientRect},hideOnClick:{type:[Boolean,String],default:()=>wo.defaultProps.hideOnClick},ignoreAttributes:{type:Boolean,default:()=>wo.defaultProps.ignoreAttributes},interactive:{type:Boolean,default:()=>wo.defaultProps.interactive},interactiveBorder:{default:()=>wo.defaultProps.interactiveBorder},interactiveDebounce:{default:()=>wo.defaultProps.interactiveDebounce},moveTransition:{default:()=>wo.defaultProps.moveTransition},offset:{default:()=>wo.defaultProps.offset},onAfterUpdate:{default:()=>wo.defaultProps.onAfterUpdate},onBeforeUpdate:{default:()=>wo.defaultProps.onBeforeUpdate},onCreate:{default:()=>wo.defaultProps.onCreate},onDestroy:{default:()=>wo.defaultProps.onDestroy},onHidden:{default:()=>wo.defaultProps.onHidden},onHide:{default:()=>wo.defaultProps.onHide},onMount:{default:()=>wo.defaultProps.onMount},onShow:{default:()=>wo.defaultProps.onShow},onShown:{default:()=>wo.defaultProps.onShown},onTrigger:{default:()=>wo.defaultProps.onTrigger},onUntrigger:{default:()=>wo.defaultProps.onUntrigger},onClickOutside:{default:()=>wo.defaultProps.onClickOutside},placement:{default:()=>wo.defaultProps.placement},plugins:{default:()=>wo.defaultProps.plugins},popperOptions:{default:()=>wo.defaultProps.popperOptions},render:{default:()=>wo.defaultProps.render},showOnCreate:{type:Boolean,default:()=>wo.defaultProps.showOnCreate},touch:{type:[Boolean,String,Array],default:()=>wo.defaultProps.touch},trigger:{default:()=>wo.defaultProps.trigger},triggerTarget:{default:()=>wo.defaultProps.triggerTarget},animateFill:{type:Boolean,default:()=>wo.defaultProps.animateFill},followCursor:{type:[Boolean,String],default:()=>wo.defaultProps.followCursor},inlinePositioning:{type:Boolean,default:()=>wo.defaultProps.inlinePositioning},sticky:{type:[Boolean,String],default:()=>wo.defaultProps.sticky},allowHTML:{type:Boolean,default:()=>wo.defaultProps.allowHTML},animation:{default:()=>wo.defaultProps.animation},arrow:{default:()=>wo.defaultProps.arrow},content:{default:()=>wo.defaultProps.content},inertia:{default:()=>wo.defaultProps.inertia},maxWidth:{default:()=>wo.defaultProps.maxWidth},role:{default:()=>wo.defaultProps.role},theme:{default:()=>wo.defaultProps.theme},zIndex:{default:()=>wo.defaultProps.zIndex}},emits:["state"],setup(t,{slots:e,emit:i,expose:r}){const n=Pi(),s=Pi(),o=Pi(!1),a=()=>{let p={...t};for(const y of["to","tag","contentTag","contentClass"])p.hasOwnProperty(y)&&delete p[y];return p};let l=n;t.to&&(typeof Element<"u"&&t.to instanceof Element?l=()=>t.to:(typeof t.to=="string"||t.to instanceof String)&&(l=()=>document.querySelector(t.to)));const c=y3e(l,a());al(()=>{o.value=!0,iy(()=>{e.content&&c.setContent(()=>s.value)})}),Sc(c.state,()=>{i("state",Qt(c.state))},{immediate:!0,deep:!0}),Sc(()=>t,()=>{c.setProps(a()),e.content&&c.setContent(()=>s.value)},{deep:!0});let d=Tl({elem:n,contentElem:s,mounted:o,...c});return r(d),()=>{const p=e.default?e.default(d):[];return X2(t.tag,{ref:n,"data-v-tippy":""},e.content?[p,X2(t.contentTag,{ref:s,style:{display:o.value?"inherit":"none"},class:t.contentClass},e.content(d))]:p)}}}),N2i=["a11y","allowHTML","arrow","flip","flipOnUpdate","hideOnClick","ignoreAttributes","inertia","interactive","lazy","multiple","showOnInit","touch","touchHold"];let v3e={};Object.keys(wo.defaultProps).forEach(t=>{N2i.includes(t)?v3e[t]={type:Boolean,default:function(){return wo.defaultProps[t]}}:v3e[t]={default:function(){return wo.defaultProps[t]}}});const $2i=Zr({props:v3e,setup(t){const e=Pi([]),{singleton:i}=L2i(e,t);return{instances:e,singleton:i}},mounted(){var t;const i=this.$el.parentElement.querySelectorAll("[data-v-tippy]");this.instances=Array.from(i).map(r=>r._tippy).filter(Boolean),(t=this.singleton)===null||t===void 0||t.setInstances(this.instances)},render(){let t=this.$slots.default?this.$slots.default():[];return X2(()=>t)}}),B2i={mounted(t,e,i){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),i.props&&i.props.onTippyShow&&(r.onShow=function(...a){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyShow(...a)}),i.props&&i.props.onTippyShown&&(r.onShown=function(...a){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyShown(...a)}),i.props&&i.props.onTippyHidden&&(r.onHidden=function(...a){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyHidden(...a)}),i.props&&i.props.onTippyHide&&(r.onHide=function(...a){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyHide(...a)}),i.props&&i.props.onTippyMount&&(r.onMount=function(...a){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyMount(...a)}),t.getAttribute("title")&&!r.content&&(r.content=t.getAttribute("title"),t.removeAttribute("title")),t.getAttribute("content")&&!r.content&&(r.content=t.getAttribute("content")),y3e(t,r)},unmounted(t){t.$tippy?t.$tippy.destroy():t._tippy&&t._tippy.destroy()},updated(t,e){const i=typeof e.value=="string"?{content:e.value}:e.value||{};t.getAttribute("title")&&!i.content&&(i.content=t.getAttribute("title"),t.removeAttribute("title")),t.getAttribute("content")&&!i.content&&(i.content=t.getAttribute("content")),t.$tippy?t.$tippy.setProps(i||{}):t._tippy&&t._tippy.setProps(i||{})}},G2i={install(t,e={}){wo.setDefaultProps(e.defaultProps||{}),t.directive(e.directive||"tippy",B2i),t.component(e.component||"tippy",k2i),t.component(e.componentSingleton||"tippy-singleton",$2i)}},Pht=wo.setDefaultProps;Pht({ignoreAttributes:!0,plugins:[F2i,M2i,O2i,E2i]});const V2i=Zr({name:"App",components:{Shell:Xwi},setup(){const t=ff();al(()=>{Jwi.observe(t?.proxy?.$refs["app-size"]),Pht({aria:{content:"labelledby"},theme:"ramp4",animation:"scale",inertia:!0,trigger:"mouseenter manual focus",touch:["hold",200],delay:[300,0],appendTo:t?.proxy?.$el})})}}),QDr="",U2i=["lang"],j2i={class:"h-full",ref:"app-size"};function z2i(t,e,i,r,n,s){const o=Io("shell");return Kt(),ci("div",{class:"ramp-app animation-enabled",lang:t.$i18n.locale},[Mt("div",j2i,[Rn(o)],512)],8,U2i)}const H2i=kl(V2i,[["render",z2i]]),ZT="focus-list",cN="focus-item",vV=`[${ZT}],[focus-container]`,dhe="truncate-text",phe="show-truncate",_V="focused",Oht=`button,input,select,a,textarea,[contenteditable],[${ZT}]`,W2i={mounted(t,e){+t.getAttribute("tabindex")<=0&&t.setAttribute("tabindex","0"),t.toggleAttribute(ZT,!0),new q2i(t,e.value)},updated(t){Rht(t)}};function Rht(t){t.querySelectorAll(Oht).forEach(i=>{if(i.closest(vV)===t||i.closest(vV)===i&&i.parentElement.closest(vV)===t)if(i.closest(`[${ZT}],.${_V}`).classList.contains(_V))i.setAttribute("tabindex","0");else{i.setAttribute("tabindex","-1");return}})}class q2i{element;highlightedItem;isHorizontal;isClicked;isTapped;constructor(e,i){this.element=e,this.highlightedItem=this.element,this.isHorizontal=i==="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(n){r.onFocus()}),e.addEventListener("blur",function(n){r.onBlur()}),e.addEventListener("mousedown",function(n){r.onMousedown()}),e.addEventListener("touchstart",function(n){r.onTouchstart()})}setTabIndex(e,i=this.element){i.querySelectorAll(Oht).forEach(n=>{(e===-1||n.closest(vV)===this.element||n.closest(vV)===n&&n.parentElement.closest(vV)===this.element||n.closest(`[${ZT}],.${_V}`).classList.contains(_V))&&n.setAttribute("tabindex",e.toString())})}defocusItem(e){e.classList.remove(_V),this.setTabIndex(-1,e),e._tippy&&e._tippy.hide(),e.getAttribute(cN)===phe&&e.querySelector(`[${dhe}]`)?._tippy?.hide()}focusItem(e){e.classList.add(_V),this.setAriaActiveDescendant(e),this.setTabIndex(0,e),e.scrollIntoView({block:"nearest"}),e._tippy&&!this.isTapped&&e._tippy.show(),e.getAttribute(cN)===phe&&e.querySelector(`[${dhe}]`)?._tippy?.show(),this.isTapped=!1}setAriaActiveDescendant(e){this.element.setAttribute("aria-activedescendant",e.getAttribute("id"))}shiftHighlight(e,i=!1){if(this.defocusItem(this.highlightedItem),i)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 i=this,r=Array.prototype.filter.call(this.element.querySelectorAll(`[${cN}]`),n=>n.closest(`[${ZT}]`)===i.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 i=e.target;if(!i.hasAttribute(ZT))for(;i.parentElement.closest(`[${ZT}]`)!==this.element;)i=i.parentElement.closest(`[${ZT}]`);this.highlightedItem=i.closest(`[${cN}]`)||i.closest(`[${ZT}]`)||this.highlightedItem,i.hasAttribute(`${cN}`)&&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(cN)===phe&&this.highlightedItem.querySelector(`[${dhe}]`)?._tippy?.show()),this.isClicked=!1,this.element.hasAttribute("aria-activedescendant")||this.highlightedItem===this.element||this.setAriaActiveDescendant(this.highlightedItem),Rht(this.element)}onBlur(){this.highlightedItem&&(this.highlightedItem._tippy&&this.highlightedItem._tippy.hide(),this.highlightedItem.getAttribute(cN)===phe&&this.highlightedItem.querySelector(`[${dhe}]`)?._tippy?.hide())}onMousedown(){this.isClicked=!0}onTouchstart(){this.isTapped=!0}}const Mht="focus-item",Y2i={beforeMount(t,e){t.hasAttribute("id")||t.setAttribute("id",X2i()),e.value?t.setAttribute(Mht,e.value):t.toggleAttribute(Mht,!0)}};function X2i(){let t;do t="focus-item-"+Math.random().toString(36).substring(2,9);while(document.getElementById(t)!==null);return t}const _3e="focus-container",Dht="focus-list",b3e=`[${Dht}],[${_3e}]`,w3e=`button,input,select,a,textarea,[contenteditable],.ag-tab-guard,[${Dht}],[${_3e}]`;let x3e=[];const K2i={mounted(t,e){x3e.push(new J2i(t,e.value))},beforeUnmount(t){x3e=x3e.filter(e=>e.element===t?(e.removeEventListeners(),!1):!0)}};class J2i{element;constructor(e,i){this.element=e,this.element.toggleAttribute(_3e,!0),this.element.tabIndex=0,this.disableTabbing();const r=this;this.element.addEventListener("keypress",function(n){r.onKeypress(n)}),this.element.addEventListener("click",function(){r.onClick()}),this.element.addEventListener("focusout",function(n){r.onFocusOut(n)}),this.element.addEventListener("focus",function(n){r.onFocus()})}removeEventListeners(){const e=this;this.element.removeEventListener("keypress",function(i){e.onKeypress(i)}),this.element.removeEventListener("click",function(){e.onClick()}),this.element.removeEventListener("focusout",function(i){e.onFocusOut(i)}),this.element.removeEventListener("focus",function(i){e.onFocus()})}onKeypress(e){e.target===this.element&&(e.key==="Enter"||e.key===" ")&&(this.enableTabbing(),this.element.querySelector(w3e).focus())}onClick(){this.enableTabbing()}onFocusOut(e){this.element.contains(e.relatedTarget)||this.disableTabbing()}onFocus(){this.disableTabbing()}disableTabbing(){Array.prototype.filter.call(this.element.querySelectorAll(w3e),i=>!0).forEach(i=>{i.tabIndex=-1})}enableTabbing(){Array.prototype.map.call(this.element.querySelectorAll(w3e),e=>{(e.closest(b3e)===this.element||e.closest(b3e)===e&&e.parentElement.closest(b3e)===this.element)&&e.offsetParent&&(e.tabIndex=0)})}}const Z2i="truncate-text",Q2i="truncate-trigger",eSi={beforeMount(t){t.classList.contains("truncate")||t.classList.add("truncate"),t.toggleAttribute(Z2i,!0)},mounted(t,e){let i;e.value&&e.value.externalTrigger&&(i=t.closest(`[${Q2i}]`)),y3e(t,{content:t.textContent,onShow:tSi,placement:"bottom-start",triggerTarget:i,...e.value?.options||{}})},updated(t,e){t._tippy&&(t._tippy.setContent(t.textContent),e.value&&e.value.options&&t._tippy.setProps(e.value.options))},unmounted(t){t._tippy&&t._tippy.destroy()}};function tSi(t){if(t.reference.clientWidth>=t.reference.scrollWidth)return!1}const iSi=["content"],rSi={key:0,class:"flex flex-shrink-0 items-center border-b border-solid border-gray-600 px-8 h-48 overflow-hidden",tabindex:"-1"},nSi={class:"flex-grow text-lg py-16 pl-8 min-w-0"},sSi={class:"display-none sm:flex"},oSi={key:1,class:"p-8 flex-grow overflow-y-auto"},aSi={key:2,class:"px-16 py-16 border-t border-gray-400 default-focus-style"},lSi=Zr({__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(t){const e=t,{t:i}=qn(),r=C_(),n=hg(),s=Qs("iApi"),o=Pi(),a=Vr(()=>s?.fixture.get("appbar")?n.temporary:[]),l=Vr(()=>r.mobileView),c=Vr(()=>r.reorderable),d=()=>!l.value,p=y=>{e.panel.move(y),y==="left"&&iy(()=>{(o.value?.querySelector(".move-left")).focus()})};return(y,v)=>{const S=Io("back"),I=Io("panel-options-menu"),O=Io("left"),L=Io("right"),N=Io("pin"),G=Io("expand"),V=Io("minimize"),Y=Io("close"),X=Qn("truncate"),te=Qn("focus-item"),re=Qn("tippy");return Br((Kt(),ci("div",{class:"h-full flex flex-col items-stretch",content:Qt(i)("panels.access"),ref_key:"el",ref:o},[t.header?(Kt(),ci("header",rSi,[Rn(S,{class:"block sm:display-none",onClick:v[0]||(v[0]=fe=>t.panel.close())}),Br((Kt(),ci("h2",nSi,[jf(y.$slots,"header")])),[[X]]),y.$slots.controls?(Kt(),Pn(I,{key:0},{default:yn(()=>[jf(y.$slots,"controls")]),_:3})):hn("",!0),Mt("div",sSi,[Qt(c)?(Kt(),Pn(O,{key:0,onClick:v[1]||(v[1]=fe=>p("left")),active:!t.panel.isLeftMostPanel},null,8,["active"])):hn("",!0),Qt(c)?(Kt(),Pn(L,{key:1,onClick:v[2]||(v[2]=fe=>p("right")),active:!t.panel.isRightMostPanel},null,8,["active"])):hn("",!0),Rn(N,{onClick:v[3]||(v[3]=fe=>t.panel.pin()),active:t.panel.isPinned},null,8,["active"]),t.panel.controls&&t.panel.controls.expand?(Kt(),Pn(G,{key:2,onClick:v[4]||(v[4]=fe=>t.panel.expand()),active:t.panel.expanded},null,8,["active"])):hn("",!0),t.panel.button&&Qt(a)?.includes(t.panel.id)?(Kt(),Pn(V,{key:3,onClick:v[5]||(v[5]=fe=>t.panel.minimize())})):hn("",!0),Rn(Y,{onClick:v[6]||(v[6]=fe=>t.panel.close())})])])):hn("",!0),t.content?(Kt(),ci("div",oSi,[jf(y.$slots,"content")])):hn("",!0),t.footer?Br((Kt(),ci("div",aSi,[jf(y.$slots,"footer")])),[[te]]):hn("",!0)],8,iSi)),[[re,{trigger:"focus",appendTo:"parent",onShow:d,popperOptions:{modifiers:[{name:"preventOverflow",options:{altAxis:!0}}]}}]])}}}),uSi={class:"relative",tabindex:"-1"},cSi=["content"],hSi=["transform"],dSi=[Mt("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)],pSi=Zr({__name:"pin",props:{active:Boolean},setup(t){const{t:e}=qn();return(i,r)=>{const n=Qn("tippy");return Kt(),ci("div",uSi,[Br((Kt(),ci("button",{type:"button",class:fs(["text-gray-500 hover:text-black focus:text-black p-8",{"text-gray-700":t.active}]),content:Qt(e)(t.active?"panels.controls.unpin":"panels.controls.pin")},[(Kt(),ci("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",transform:`rotate(${t.active?30:0})`},dSi,8,hSi))],10,cSi)),[[n,{placement:"bottom",hideOnClick:!1}]])])}}}),fSi={class:"relative",tabindex:"-1"},mSi=["content"],gSi=[Mt("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},[Mt("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)],ySi=Zr({__name:"close",props:{active:Boolean},setup(t){const{t:e}=qn();return(i,r)=>{const n=Qn("tippy");return Kt(),ci("div",fSi,[Br((Kt(),ci("button",{type:"button",class:fs(["text-gray-500 hover:text-black focus:text-black p-8",{"text-gray-700":t.active}]),content:Qt(e)("panels.controls.close")},gSi,10,mSi)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),vSi={class:"relative",tabindex:"-1"},_Si=["content"],bSi=[Mt("svg",{xmlns:"http://www.w3.org/2000/svg",class:"fill-current w-16 h-16",viewBox:"0 0 16 16"},[Mt("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)],wSi=Zr({__name:"back",props:{active:Boolean},setup(t){const{t:e}=qn();return(i,r)=>{const n=Qn("tippy");return Kt(),ci("div",vSi,[Br((Kt(),ci("button",{type:"button",class:fs(["text-gray-500 hover:text-black focus:text-black p-8",{"text-gray-700":t.active}]),content:Qt(e)("panels.controls.back")},bSi,10,_Si)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),xSi={class:"w-32 h-32"},SSi=["content"],CSi={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"h-24 w-24 fill-current transform rotate-90"},TSi=[Mt("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),Mt("path",{d:"M0 0h24v24H0V0z",fill:"none"},null,-1),Mt("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"},null,-1)],ESi={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"h-24 w-24 fill-current transform rotate-90"},ISi=[Mt("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),Mt("path",{d:"M0 0h24v24H0V0z",fill:"none"},null,-1),Mt("path",{d:"M8 19h3v3h2v-3h3l-4-4-4 4zm8-15h-3V1h-2v3H8l4 4 4-4zM4 9v2h16V9H4z"},null,-1),Mt("path",{d:"M4 12h16v2H4z"},null,-1)],ASi=Zr({__name:"expand",props:{active:Boolean},setup(t){const{t:e}=qn();return(i,r)=>{const n=Qn("tippy");return Kt(),ci("div",xSi,[Br((Kt(),ci("button",{type:"button",class:"text-gray-500 hover:text-black focus:text-black w-full h-full flex justify-center items-center",content:Qt(e)(`panels.controls.${t.active?"collapse":"expand"}`)},[t.active?(Kt(),ci("svg",ESi,ISi)):(Kt(),ci("svg",CSi,TSi))],8,SSi)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale",hideOnClick:!1}]])])}}}),PSi={class:"relative",tabindex:"-1"},OSi=["content"],RSi=[Mt("svg",{class:"fill-current w-20 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Mt("path",{d:"M0 0h24v24H0V0z",fill:"none"}),Mt("path",{d:"M6 19h12v2H6z"})],-1)],MSi=Zr({__name:"minimize",props:{active:Boolean},setup(t){const{t:e}=qn();return(i,r)=>{const n=Qn("tippy");return Kt(),ci("div",PSi,[Br((Kt(),ci("button",{type:"button",class:fs(["text-gray-500 hover:text-black focus:text-black p-6",{"text-gray-700":t.active}]),content:Qt(e)("panels.controls.minimize")},RSi,10,OSi)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),DSi={class:"relative",tabindex:"-1"},FSi=["content"],LSi=["aria-label"],kSi=[Mt("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"},null,-1)],NSi=Zr({__name:"right",props:{active:Boolean},setup(t){const{t:e}=qn();return(i,r)=>{const n=Qn("tippy");return Kt(),ci("div",DSi,[Br((Kt(),ci("button",{type:"button",class:fs(["p-8",{"text-gray-500 hover:text-black focus:text-black":t.active,"text-gray-300":!t.active}]),content:Qt(e)("panels.controls.moveRight")},[(Kt(),ci("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"4 4 16 16","aria-label":Qt(e)("panels.controls.moveRight")},kSi,8,LSi))],10,FSi)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),$Si={class:"relative",tabindex:"-1"},BSi=["content"],GSi=["aria-label"],VSi=[Mt("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"},null,-1)],USi=Zr({__name:"left",props:{active:Boolean},setup(t){const{t:e}=qn();return(i,r)=>{const n=Qn("tippy");return Kt(),ci("div",$Si,[Br((Kt(),ci("button",{type:"button",class:fs(["p-8 move-left",{"text-gray-500 hover:text-black focus:text-black":t.active,"text-gray-300":!t.active}]),content:Qt(e)("panels.controls.moveLeft")},[(Kt(),ci("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"4 4 16 16","aria-label":Qt(e)("panels.controls.moveLeft")},VSi,8,GSi))],10,BSi)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),jSi=(t=>(Xc("data-v-91e6bb9a"),t=t(),Kc(),t))(()=>Mt("div",{class:"p-6"},[Mt("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-20 h-20"},[Mt("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)),zSi=Zr({__name:"panel-options-menu",setup(t){const{t:e}=qn();return Pi(!1),(i,r)=>(Kt(),Pn(t3e,{class:"flex",tooltip:Qt(e)("panels.controls.optionsMenu"),popperOptions:{strategy:"fixed"},position:"bottom-end"},{header:yn(()=>[jSi]),default:yn(()=>[jf(i.$slots,"default",{},void 0,!0)]),_:3},8,["tooltip"]))}}),mFr="",HSi=kl(zSi,[["__scopeId","data-v-91e6bb9a"]]),WSi={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},qSi=[Mt("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),Mt("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"},null,-1)],YSi={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},XSi=[Mt("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),Mt("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"},null,-1)],KSi=Zr({__name:"fullscreen-nav",setup(t){const{t:e}=qn(),i=Qs("iApi"),r=()=>{i.toggleFullscreen()};return(n,s)=>{const o=Io("mapnav-button");return Kt(),Pn(o,{onClickFunction:r,tooltip:Qt(e)("mapnav.fullscreen")},{default:yn(()=>[n.$iApi.isFullscreen?(Kt(),ci("svg",WSi,qSi)):(Kt(),ci("svg",YSi,XSi))]),_:1},8,["tooltip"])}}}),JSi=Mt("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[Mt("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),ZSi=Zr({__name:"geolocator-nav",setup(t){const{t:e}=qn(),i=Qs("iApi");let r=Tl([]);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?i.notify.show(uD.ERROR,e("mapnav.geolocator.error.permission")):i.notify.show(uD.ERROR,e("mapnav.geolocator.error.internal"))});a&&(r=[a.coords.longitude,a.coords.latitude],s(r))}},s=a=>{let l=new Qg("geolocation",a,nu.latLongSR(),!0);i.geo.map.zoomMapTo(l)},o=a=>new Promise((l,c)=>navigator.geolocation.getCurrentPosition(l,c,a));return(a,l)=>{const c=Io("mapnav-button");return Kt(),Pn(c,{onClickFunction:n,tooltip:Qt(e)("mapnav.geolocator")},{default:yn(()=>[JSi]),_:1},8,["tooltip"])}}}),QSi=Mt("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[Mt("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"}),Mt("path",{d:"M0 0h24v24H0z",fill:"none"})],-1),eCi=Zr({__name:"home-nav",setup(t){const{t:e}=qn(),i=Qs("iApi"),r=()=>{const n=i.geo.map.getExtentSet();i.geo.map.zoomMapTo(n.fullExtent)};return(n,s)=>{const o=Io("mapnav-button");return Kt(),Pn(o,{onClickFunction:r,tooltip:Qt(e)("mapnav.home")},{default:yn(()=>[QSi]),_:1},8,["tooltip"])}}}),tCi={class:"relative w-32 h-32 text-gray-600 hover:text-black",tabindex:"-1"},iCi=["content"],rCi=Zr({__name:"button",props:{onClickFunction:{type:Function,required:!0},tooltip:{type:[String,Boolean],default:!1}},setup(t){return(e,i)=>{const r=Qn("focus-item"),n=Qn("tippy");return Kt(),ci("div",tCi,[Br((Kt(),ci("button",{type:"button",class:"w-full h-full default-focus-style focus:outline-none",onClick:i[0]||(i[0]=s=>t.onClickFunction()),content:t.tooltip},[jf(e.$slots,"default")],8,iCi)),[[r],[n,{placement:"left"}]])])}}}),nCi={class:"relative",tabindex:"-1"},sCi=["content"],oCi=Zr({__name:"button",props:{onClickFunction:{type:Function,required:!0},id:{type:String,required:!0},tooltip:{type:[String,Boolean],default:!1}},setup(t){const e=t,i=Qs("iApi"),r=()=>i?.event.emit(an.APPBAR_BUTTON_CLICK,e.id);return(n,s)=>{const o=Qn("focus-item"),a=Qn("tippy");return Kt(),ci("div",nCi,[Br((Kt(),ci("button",{type:"button",class:"py-6 w-full h-full",onClick:s[0]||(s[0]=()=>{t.onClickFunction(),r()}),content:t.tooltip},[jf(n.$slots,"default",{},void 0,!0)],8,sCi)),[[o],[a,{placement:"right"}]])])}}}),bFr="",aCi=kl(oCi,[["__scopeId","data-v-14ee4c24"]]),fhe=Vp("areas-of-interest",()=>({areas:Pi([])})),bV=Vp("export",()=>{const t=Pi({title:!0,map:!0,mapElements:!0,legend:!0,footnote:!0,timestamp:!0}),e=Pi("");function i(r){if(t.value[r.name]!==void 0){const n=t.value[r.name];t.value[r.name]=r.selected!==void 0?r.selected:!n}}return{componentSelectedState:t,fileName:e,toggleSelected:i}}),LP=function t(e){function i(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 c=o?a.toLowerCase():a,d=s[a];l[c]=c in l&&typeof d=="object"?i(l[c],d,c=="headers"):d}return l}function r(n,s,o,a,l){var c=typeof n!="string"?(s=n).url:n,d={config:s},p=i(e,s),y={};a=a||p.data,(p.transformRequest||[]).map(function(v){a=v(a,p.headers)||a}),p.auth&&(y.authorization=p.auth),a&&typeof a=="object"&&typeof a.append!="function"&&typeof a.text!="function"&&(a=JSON.stringify(a),y["content-type"]="application/json");try{y[p.xsrfHeaderName]=decodeURIComponent(document.cookie.match(RegExp("(^|; )"+p.xsrfCookieName+"=([^;]*)"))[2])}catch{}return p.baseURL&&(c=c.replace(/^(?!.*\/\/)\/?/,p.baseURL+"/")),p.params&&(c+=(~c.indexOf("?")?"&":"?")+(p.paramsSerializer?p.paramsSerializer(p.params):new URLSearchParams(p.params))),(p.fetch||fetch)(c,{method:(o||p.method||"get").toUpperCase(),body:a,headers:i(p.headers,y,!0),credentials:p.withCredentials?"include":l}).then(function(v){for(var S in v)typeof v[S]!="function"&&(d[S]=v[S]);return p.responseType=="stream"?(d.data=v.body,d):v[p.responseType||"text"]().then(function(I){d.data=I,d.data=JSON.parse(I)}).catch(Object).then(function(){return(p.validateStatus?p.validateStatus(v.status):v.ok)?d:Promise.reject(d)})})}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=t,r}(),lCi={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},S3e={en:{},fr:{}};class uCi{list={};listFetched=!1;constructor(e,i){LP.get(i).then(r=>{r.data.definitions.forEach(n=>S3e[e][n.code]=n.description),Object.keys(S3e[e]).forEach(n=>{this.list[n]=S3e[e][n]}),this.listFetched=!0})}fsaToProvinces(e){const i={};let r=lCi[e.substring(0,1).toUpperCase()];return typeof r=="number"&&(r=[r]),r.forEach(n=>{i[n]=this.list[n]}),i}}function cCi(t,e){return new uCi(t,e)}const mhe={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 hCi{allTypes={};validTypes={};filterComplete=!1;typesFetched=!1;constructor(e,i){LP.get(i).then(r=>{r.data.definitions.forEach(n=>{mhe[e][n.code]=n.term.split(`${n.code}-`)[1]}),Object.keys(mhe[e]).forEach(n=>{this.allTypes[n]=mhe[e][n],this.validTypes[n]=mhe[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 i of e)delete this.validTypes[i];return this.filterComplete=!0,this.validTypes}}function dCi(t,e){return new hCi(t,e)}function pCi(t,e){const i=/^[-+]?([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(i.test(e)&&!t.disabledSearchTypes.includes("LAT/LNG")){const s=e.slice(0,-1);return new fCi(t,s)}else return n.test(e)&&!t.disabledSearchTypes.includes("FSA")?new mCi(t,e):r.test(e)&&!t.disabledSearchTypes.includes("NTS")?new gCi(t,e.substring(0,6).toUpperCase()):new yCi(t,e)}class ghe{config;query;failedServs=[];results=[];onComplete;latLongResult;featureResults=[];resultType="geoname";constructor(e,i){this.query=i,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,i,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(i=>this.config.types.validTypes[i.concise.code]).map(i=>({name:i.name,location:i.location,province:this.config.provinces.list[i.province.code],type:this.config.types.allTypes[i.concise.code],LatLon:{lat:i.latitude,lon:i.longitude},bbox:i.bbox,order:this.config.sortOrder.indexOf(i.concise.code)>=0?this.config.sortOrder.indexOf(i.concise.code):this.config.sortOrder.length}))}jsonRequest(e){return new Promise((i,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;i(s)}else r("Could not load results from remote service.")},n.send()})}locateByQuery(){return this.jsonRequest(this.getUrl(!0,void 0))}nameByLatLon(e,i,r){return this.jsonRequest(this.getUrl(!1,r,e,i)).then(n=>this.normalizeNameItems(n.items)).catch(()=>(console.error("LatLon service failed"),this.failedServs.push("geoname"),this.normalizeNameItems([])))}}class fCi extends ghe{constructor(e,i){super(e,i),this.resultType="latlong";let r;r=i.split(/[\s|,|;|]/).filter(a=>!isNaN(a)&&a!=="").map(a=>parseFloat(a));const s=.015,o=[r[1]-s,r[0]-s,r[1]+s,r[0]+s];this.latLongResult={name:`${r[0]},${r[1]}`,location:{latitude:r[0],longitude:r[1]},type:"Latitude/Longitude",position:[r[1],r[0]],bbox:o},this.onComplete=new Promise((a,l)=>{this.nameByLatLon(r[0],r[1]).then(c=>{c?(this.results=c,a(this)):l("Given lat lon coordinates cannot be found")})})}}class mCi extends ghe{constructor(e,i){i=i.substring(0,3).toUpperCase(),super(e,i),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 i=this.config.provinces.fsaToProvinces(this.query);return{fsa:this.query,code:"FSA",desc:this.config.types.allTypes.FSA,province:Object.keys(i).map(r=>i[r]).join(","),_provinces:i,LatLon:{lat:e[0].geometry.coordinates[1],lon:e[0].geometry.coordinates[0]}}}}).catch(()=>{console.error("FSA service failed"),this.failedServs.push("geolocation")})}}class gCi extends ghe{unitName;unit;mapSheets=[];constructor(e,i){super(e,i),this.resultType="nts",i=isNaN(parseInt(i[2]))?"0"+i:i,this.unitName=i,this.onComplete=new Promise((r,n)=>{this.locateByQuery().then(s=>{if(s.length>0&&this.query){const o=this.locateToResult(s);this.unit=o[0],this.mapSheets=o,this.featureResults.push(this.unit),this.nameByLatLon(this.unit.LatLon.lat,this.unit.LatLon.lon).then(a=>{this.results=a,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 yCi extends ghe{constructor(e,i){i=encodeURIComponent(i.trim()),super(e,i),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 Fht="https://geogratis.gc.ca/services/geolocation/@{language}/locate",Lht="https://geogratis.gc.ca/services/geoname/@{language}/geonames.json",kht="https://geogratis.gc.ca/services/geoname/@{language}/codes/province.json",Nht="https://geogratis.gc.ca/services/geoname/@{language}/codes/concise.json",vCi={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 $ht{config;constructor(e,i){let r,n,s,o;const a=i?.serviceUrls;a?(r=a.geoLocation?a.geoLocation:Fht,n=a.geoNames?a.geoNames:Lht,s=a.geoProvince?a.geoProvince:kht,o=a.geoTypes?a.geoTypes:Nht):(r=Fht,n=Lht,s=kht,o=Nht),r=r.replace("@{language}",e),n=n.replace("@{language}",e),s=s.replace("@{language}",e),o=o.replace("@{language}",e);const l=i?.settings;let c,d,p,y,v;l?(c=l.categories?l.categories:[],d=l.sortOrder?l.sortOrder:[],p=l.disabledSearchTypes?l.disabledSearchTypes:[],y=l.maxResults>0?l.maxResults:100,v=!!l.officialOnly):(c=[],d=[],p=[],y=100,v=!1),this.config={language:e,geoNameUrl:n,geoLocateUrl:r,types:dCi(e,o),provinces:cCi(e,s),categories:c,sortOrder:d,disabledSearchTypes:p,maxResults:y,officialOnly:v},this.config.types.filterValidTypes(i?.excludeTypes),this._provinceList=[],this._typeList=[],this._excludedTypes=i?.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,i){i=i.toLowerCase().trim();const r=decodeURI(e.query.toLowerCase().replace("*","")),n=[];for(let s=0;s<=i.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]===i[s-1]?0:1))}return n[i.length][r.length]}findProvinceObj(e){return this.provinceList.find(i=>i.name===e)}query(e){return pCi(this.config,e.toUpperCase()).onComplete.then(i=>{let r=[];i.featureResults.length>0?i.resultType==="fsa"?r=i.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})):i.resultType==="nts"?r=i.featureResults.map(s=>({name:s.nts,bbox:s.bbox,type:s.desc,position:[s.LatLon.lon,s.LatLon.lat],location:{city:s.location,latitude:s.LatLon.lat,longitude:s.LatLon.lon},order:-1})):i.resultType==="address"&&(r=i.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(i,s.name)>this.levenshteinDistance(i,o.name)?1:-1))):i.resultType==="latlong"&&(r=[i.latLongResult],r[0].order=-1);const n=i.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(i,s.name)>this.levenshteinDistance(i,o.name)?1:-1),failedServs:i.failedServs}})}fetchProvinces(){return new Promise(e=>{const i=setInterval(()=>{if(this.config.provinces.listFetched){clearInterval(i);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:vCi[o],name:s[o]});this.provinceList=r,e(this.provinceList)}})})}fetchTypes(){return new Promise(e=>{const i=setInterval(()=>{if(this.config.types.typesFetched){clearInterval(i);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 Bht(t,e,i){return t&&e.extent&&(i=i.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!=="..."&&(i=i.filter(r=>r.location.province?.name&&r.location.province.name===e.province)),e.type&&e.type!=="..."&&(i=i.filter(r=>r.type===e.type)),i}const hN=Vp("geosearch",()=>{const t=Pi(new $ht("en",void 0)),e=Pi({type:"",province:"",extent:void 0}),i=Pi(!1),r=Pi(""),n=Pi(""),s=Pi([]),o=Pi([]),a=Pi(!1),l=Pi([]),c=Vr(()=>new Promise(L=>{t.value.fetchProvinces().then(N=>{N.sort((G,V)=>G.name>V.name?1:-1),L(N)})})),d=Vr(()=>new Promise(L=>{t.value.fetchTypes().then(N=>{N.sort((G,V)=>G.name>V.name?1:-1),L(N)})}));function p(L,N){t.value=new $ht(L,N)}function y(L){if(a.value=!0,!r.value)s.value=[],o.value=[],a.value=!1;else if(r.value&&r.value!==n.value||L){const N=setInterval(()=>{t.value.config.provinces.listFetched&&t.value.config.types.typesFetched&&(clearInterval(N),t.value.query(`${r.value}*`).then(G=>{l.value=G.failedServs,n.value=r.value,o.value=G.results;const V=Bht(i.value,e.value,o.value);s.value=V||[],a.value=!1}))},250)}else{const N=Bht(i.value,e.value,o.value);s.value=N||[],a.value=!1}}function v(L){e.value.province=typeof L.province>"u"?"":L.province,y(L.forceReRun)}function S(L){e.value.type=typeof L.type>"u"?"":L.type,y(L.forceReRun)}function I(L){n.value=r.value,r.value=L,y()}function O(L){if(L.visible!==void 0&&(i.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,y()}return{GSservice:t,queryParams:e,resultsVisible:i,searchVal:r,lastSearchVal:n,searchResults:s,savedResults:o,loadingResults:a,failedServices:l,getProvinces:c,getTypes:d,initService:p,runQuery:y,setProvince:v,setType:S,setSearchTerm:I,setMapExtent:O}}),yhe=Vp("help",()=>({location:Pi("./help/")}));var C3e=(t=>(t.Visibility="visibilityButton",t.Expand="expandButton",t))(C3e||{}),Bm=(t=>(t.Item="item",t.Placeholder="placeholder",t.Error="error",t))(Bm||{});class vhe extends Np{_uid;_name;_type;_children=[];_parent=void 0;_loadPromise;_hidden;_expanded;_visibility;_exclusive;_controls;_disabledControls;_lastVisible;_visibleChildren;constructor(e,i,r){super(e),this._uid=vN.sharedUtils.generateUUID(),this._name=i.name,this._type=i.type??"placeholder",this._parent=r,this._children=[],this._loadPromise=new Fm,this._hidden=i.hidden??!1,this._expanded=i.expanded??!0,this._visibility=!0,this._exclusive=i.exclusive??!1,this._controls=i.controls?.slice()??["visibilityButton","expandButton"],this._disabledControls=i.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,i){i&&this._disabledControls?.includes(e)?(this._disabledControls=this._disabledControls.filter(r=>r!==e),this._controls?.push(e)):!i&&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,i=!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 cc)||this._lastVisible.layerControlAvailable(jl.Visibility)))this._lastVisible.toggleVisibility(!0);else{const r=this.children.find(n=>!(n instanceof cc)||n.layerControlAvailable(jl.Visibility));r&&r.toggleVisibility(!0)}else this._lastVisible=this.children.find(r=>r.visibility),this._lastVisible?.toggleVisibility(!1);this.parent&&i&&this.parent.checkVisibility(this)}}checkVisibilityRules(){this.parent&&!this.parent.visibility?this.toggleVisibility(!1,!1):this.parent?.exclusive&&this.parent.children.some(i=>i.visibility&&i!==this&&i.type==="item")&&this.toggleVisibility(!1,!1)}checkVisibility(e){this instanceof cc&&!this.layerControlAvailable(jl.Visibility)||(this.exclusive?e.visibility?(this.children.forEach(i=>{i.uid!==e.uid&&i.toggleVisibility(!1,!1)}),this._lastVisible=e,this._visibility=!0,this instanceof cc&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!0)):(this._visibility=!1,this instanceof cc&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!1),this._lastVisible=e):this.children.some(i=>i.visibility)?(this._visibility=!0,this._visibleChildren=this.children.filter(i=>i.visibility),this instanceof cc&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!0)):(this._visibility=!1,this._visibleChildren=[],this instanceof cc&&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},i=[];return this.children.forEach(r=>{i.push(r.getConfig())}),this.exclusive?e.exclusiveVisibility=i:e.children=i,e}onAdded(){}onRemoved(){this.toggleVisibility(!1)}load(){this._type="item",this._loadPromise.resolveMe(),this.checkVisibilityRules()}reload(){this._type="placeholder",this._loadPromise=new Fm}error(){this._type="error",this._loadPromise.rejectMe(),this.checkVisibilityRules()}}class cc extends vhe{_layerId;_layerIdx;_layerUid="";_layer;_layerInitVis;_layerRedrawing=!1;_layerOffscale=!1;_loadCancelled=!1;_treeGrown=!1;_coverIcon;_description;_symbologyExpanded;_origLayerControls;_origLayerDisabledControls;_layerControls;_layerDisabledControls;_symbologyRenderStyle;_symbologyStack;handlers=[];constructor(e,i,r,n){super(e,i,r),this._type=Bm.Placeholder,this._layerId=i.layerId,this._layerIdx=i.sublayerIndex,this._layerControls=i.layerControls??[],this._origLayerControls=i.layerControls,this._layerDisabledControls=i.disabledLayerControls??[],this._origLayerDisabledControls=i.disabledLayerControls,this._layerRedrawing=!1,this._symbologyExpanded=i.symbologyExpanded||!1,i.coverIcon&&(this._coverIcon=i.coverIcon),i.description&&(this._description=i.description),this._symbologyRenderStyle=i.symbologyRenderStyle??"icons",this._symbologyStack=i.symbologyStack?.map(s=>({uid:this.$iApi.geo.shared.generateUUID(),label:s.text,definitionClause:s.sqlQuery,imgUrl:s.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._symbologyStack=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,i=!0,r=!1){if(!((!this.layerControlAvailable(jl.Visibility)||this._loadCancelled)&&!r)&&(super.toggleVisibility(e,i),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,i){this._symbologyStack.some(r=>((e===void 0||r.uid===e)&&(r.visibility=i,r.lastVisbility=i),e!==void 0&&r.uid===e))}load(e){if(e){if(this._layer=e instanceof gN?e:this.$iApi.geo.layer.getLayer(this._layerId??this._layerUid),this.layer=e,this._loadCancelled){this.toggleVisibility(!1,!0,!0);return}this._layer?.loadPromise().then(()=>{this._layer?.layerType===_n.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(an.LAYER_VISIBILITYCHANGE,i=>{i.layer.uid===this.layer.uid&&this._type===Bm.Item&&this.toggleVisibility(i.visibility,!0,!0)})),this.handlers.push(this.$iApi.event.on(an.LAYER_DRAWSTATECHANGE,i=>{this.layer.uid===i.layer.uid&&(i.layer.drawState===Ub.REFRESH?this.layerRedrawing=!0:setTimeout(()=>{this.layerRedrawing=i.layer.drawState===Ub.REFRESH},500))})),this._layerOffscale=this.$iApi.geo.map.created?this.layer?.isOffscale():!1,this.handlers.push(this.$iApi.event.on(an.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 kK=(t=>(t.Title="title",t.Text="text",t.Image="image",t.Markdown="markdown",t.Template="template",t))(kK||{});class _he extends vhe{_infoType;_content;constructor(e,i,r){super(e,i,r),this._infoType=i.infoType??"title",this._content=i.content??"",i.infoType==="template"&&this.$element.component(`${this._uid}-info-section`,{template:this._content}),(i.infoType||i.content)&&(this._controls=i.controls?.slice()??[C3e.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 hD=Vp("legend",()=>{const t=Pi(),e=Pi([]),i=Pi([]);function r(o){if(o.parent===void 0)e.value.push(o.item);else{if(!(o.item instanceof _he)&&!(o.item instanceof cc)){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(c=>(c===o&&!c.children.length&&c.onRemoved(),c!==o)),l.forEach(c=>{c.children=a(c.children)}),l=l.filter(c=>!(c instanceof _he&&!c.children.length&&c.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:t,children:e,headerControls:i,addItem:r,removeItem:n,replaceItem:s}}),dD=Vp("mapnav",()=>{const t=Pi({}),e=Pi([]);function i(r){r in t.value&&delete t.value[r];const n=e.value.indexOf(r);n!==-1&&e.value.splice(n,1)}return{items:t,order:e,removeItem:i}}),T3e=Vp("metadata",()=>{const t=Pi(""),e=Pi({type:"LineString",coordinates:[]});return{status:t,response:e}}),bhe=Vp("northarrow",()=>{const t=Pi(""),e=Pi("");return{arrowIcon:t,poleIcon:e}}),NK=Vp("overviewmap",()=>{const t=Pi(void 0),e=Pi({}),i=Pi(!0),r=Pi(1.5),n=Pi("#FF0000"),s=Pi(1),o=Pi("#000000"),a=Pi(.25);function l(c){t.value.initialBasemapId=c}return{mapConfig:t,basemaps:e,startMinimized:i,expandFactor:r,borderColour:n,borderWidth:s,areaColour:o,areaOpacity:a,updateInitialBasemap:l}}),$K=Vp("scrollguard",()=>{const t=Pi(!1);function e(i){t.value=i}return{enabled:t,setEnabled:e}});var dp=(t=>(t[t.UPLOAD=0]="UPLOAD",t[t.FORMAT=1]="FORMAT",t[t.CONFIGURE=2]="CONFIGURE",t))(dp||{});const E3e=Vp("wizard",()=>{const t=Pi(null),e=Pi(""),i=Pi(""),r=Pi(null),n=Pi({config:{id:"Placeholder",layerType:_n.UNKNOWN,url:""},configOptions:[]}),s=Pi(dp.UPLOAD);function o(a){switch(s.value){case dp.UPLOAD:a===dp.UPLOAD?e.value="":a===dp.FORMAT&&(s.value=dp.FORMAT);break;case dp.FORMAT:a===dp.UPLOAD?(r.value&&(e.value="",r.value=null),i.value="",s.value=dp.UPLOAD):a===dp.CONFIGURE&&(s.value=dp.CONFIGURE);break;case dp.CONFIGURE:a===dp.UPLOAD?(e.value="",i.value="",r.value=null,n.value={config:null,configOptions:[]},s.value=dp.UPLOAD):a===dp.FORMAT&&(n.value={config:null,configOptions:[]},s.value=dp.FORMAT);break}}return{layerSource:t,url:e,typeSelection:i,fileData:r,layerInfo:n,currStep:s,goToStep:o}});class _Ci{fixture;panel;event;geo;notify;ui;startRequired=!1;$vApp;$element;$i18n;_isFullscreen;constructor(e,i,r){this.event=new svi(this);const n=bCi(e,this);this.$vApp=n.app,this.$element=n.element,this.$i18n=n.i18n,this.fixture=new zTi(this),this.panel=new HTi(this),this.geo=new UTi(this),this.ui={maptip:this.geo.map.maptip},this.notify=new Lbi(this),this._isFullscreen=Lw.isEnabled&&!!this.$vApp.$root&&Lw.isFullscreen&&Lw.element===this.$vApp.$root.$el,Lw.isEnabled&&Lw.onchange(()=>{this._isFullscreen=Lw.isEnabled&&!!this.$vApp.$root&&Lw.isFullscreen&&Lw.element===this.$vApp.$root.$el}),this.initialize(i,r)}initialize(e,i){const r=dg(this.$vApp.$pinia),n=C_(this.$vApp.$pinia),s=Xce(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 d in a)r.registerConfig({config:a[d],configLangs:[d]});r.activeBasemapConfig=l.map.basemaps.find(d=>d.id===l.map.initialBasemapId);const c=setInterval(()=>{const d=this.$vApp.$el.querySelector("#esriMap");d&&(clearInterval(c),this.geo.map.createMap(l.map,d),d._tippy.hide(0),s.setMaptipInstance(d._tippy),l.layers&&l.layers.length>0&&l.layers.map(p=>{const y=this.geo.layer.createLayer(p);return this.geo.map.addLayer(y),y}).filter(Boolean).forEach((p,y)=>{p?.loadPromise().then(()=>{p?.isLoaded&&this.geo.map.reorder(p,y)}).catch(()=>console.error(`Failed to add/reorder layer: ${p.id}.`))}))},100);if(l.panels){if(l.panels.open&&l.panels.open.length>0){const d=l.panels.open.map(p=>p.id);this.panel.isRegistered(d).then(()=>{l.panels?.open?.forEach(p=>{this.panel.open({id:p.id,screen:p.screen}),p.pin&&this.panel.pin(p.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)}i||(i={});const o=hV(this.$vApp.$pinia);i?.startRequired?(this.startRequired=!0,o.started=!1):(this.startRequired=!1,o.started=!0,this.event.emit(an.MAP_START)),(i.loadDefaultFixtures!==!1||e?.startingFixtures!==void 0)&&this.fixture.addDefaultFixtures(e?.startingFixtures),i.loadDefaultEvents!==!1&&this.event.addDefaultEvents()}reload(e,i){const r=hV(this.$vApp.$pinia),n=qT(this.$vApp.$pinia),s=dg(this.$vApp.$pinia),o=FP(this.$vApp.$pinia);Object.keys(o.items).forEach(l=>{this.fixture.get(l)!==void 0&&this.fixture.remove(l)}),r.started=!1,this.geo.map.destroyMap(),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,i)}component(e,i){if(i){const r=this.$element.component(e,i);return this.event.emit(an.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=dg(this.$vApp.$pinia);return JSON.parse(JSON.stringify(e.getActiveConfig(this.language)))}useStore(e){if(!(["appbar","areas-of-interest","details","export","geosearch","grid","help","legend","mapnav","metadata","northarrow","overviewmap","scrollguard","wizard"].includes(e)&&!this.fixture.get(e)))switch(e){case"appbar":return hg(this.$vApp.$pinia);case"areas-of-interest":return fhe(this.$vApp.$pinia);case"details":return rN(this.$vApp.$pinia);case"export":return bV(this.$vApp.$pinia);case"geosearch":return hN(this.$vApp.$pinia);case"grid":return iN(this.$vApp.$pinia);case"help":return yhe(this.$vApp.$pinia);case"legend":return hD(this.$vApp.$pinia);case"mapnav":return dD(this.$vApp.$pinia);case"metadata":return T3e(this.$vApp.$pinia);case"northarrow":return bhe(this.$vApp.$pinia);case"overviewmap":return NK(this.$vApp.$pinia);case"scrollguard":return $K(this.$vApp.$pinia);case"wizard":return E3e(this.$vApp.$pinia);case"config":return dg(this.$vApp.$pinia);case"fixture":return FP(this.$vApp.$pinia);case"instance":return hV(this.$vApp.$pinia);case"layer":return mv(this.$vApp.$pinia);case"map-caption":return rD(this.$vApp.$pinia);case"maptip":return Xce(this.$vApp.$pinia);case"notification":return qT(this.$vApp.$pinia);case"panel":return C_(this.$vApp.$pinia);default:console.error(`The store ${e} does not exist.`);return}}setLanguage(e){if(this.$i18n.locale.value===e)return;const r=dg(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.$vApp.$iApi.event.emit(an.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(){Lw.isEnabled&&Lw.toggle(this.$element._container||void 0)}get isFullscreen(){return this._isFullscreen}get started(){return hV(this.$vApp.$pinia).started}updateAlert(e){const i=this.$vApp.$el.querySelector(".screen-reader-alert");i.childNodes.length>0&&(i.innerHTML="");const r=document.createElement("span");r.setAttribute("role","alert");const n=document.createTextNode(e);r.appendChild(n),i.insertBefore(r,null)}start(){const e=hV(this.$vApp.$pinia);!e.started&&this.startRequired?(this.event.emit(an.MAP_START),e.started=!0):e.started&&console.warn("start has already been called")}}function bCi(t,e){const i=Z0i();i.use(({store:o})=>{const a=IG({},o.$state);o.$reset=()=>o.$patch(IG({},{},a))});const r=V_i(),n=xce(H2i).use(r).use(G2i,{directive:"tippy",component:"tippy"}).use(j_i).use(i);n.directive("focus-container",K2i),n.directive("focus-list",W2i),n.directive("focus-item",Y2i),n.directive("truncate",eSi),n.component("panel-screen",lSi),n.component("pin",pSi),n.component("close",ySi),n.component("back",wSi),n.component("expand",ASi),n.component("panel-options-menu",HSi),n.component("dropdown-menu",t3e),n.component("minimize",MSi),n.component("right",NSi),n.component("left",USi),n.component("fullscreen-nav-button",KSi),n.component("geolocator-nav-button",ZSi),n.component("home-nav-button",eCi),n.component("mapnav-button",rCi),n.component("appbar-button",aCi),n.config.globalProperties.$iApi=e,n.config.globalProperties.$pinia=i,n.provide("iApi",e);const s=n.mount(t);return{element:n,app:s,i18n:r.global}}class Ght{esriBasemap;config;constructor(e){this.config=e,this.esriBasemap=new iR({baseLayers:e.layers.map(i=>{if(i.layerType===_n.TILE)return new eEe({url:i.url,opacity:i.opacity});if(i.layerType===_n.MAPIMAGE)return new WTe({url:i.url,opacity:i.opacity});if(i.layerType===_n.OSM)return new JTe({opacity:i.opacity});throw new Error(`Unsupported layer type provided to basemap config: ${i.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}}class Vht extends Np{esriMap;_basemapStore;created=!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 Fm,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")}createMap(e,i){this._basemapStore=e.basemaps.map(n=>new Ght(n));const r={};e.initialBasemapId&&(r.basemap=Hs(this.findBasemap(e.initialBasemapId).esriBasemap)),this.esriMap=Ho(new WZe(r)),this.pointZoomScale=e.pointZoomScale&&e.pointZoomScale>0?e.pointZoomScale:5e4,this._targetDiv=i,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,i){if(!this.esriMap||!this.esriView){this.noMapErr();return}this.destroyMap(),this.createMap(e,i)}createMapView(e){this.abstractError()}destroyMapView(){if(!this.esriView){this.noMapErr();return}this._viewPromise=new Fm,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 i=this._basemapStore.find(r=>r.id===e);if(i)return i;throw new Error(`Invalid basemap id requested: ${e}`)}applyBasemap(e){if(!this.esriMap){this.noMapErr();return}const i=typeof e=="string"?this.findBasemap(e):e;this.esriMap.basemap=Hs(i.esriBasemap)}setBasemap(e){return this.abstractError(),!1}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,i,r=!0){if(this.esriView){if(e.invalid())throw new Error("attempt to zoom to invalid geometry");const n=await this.geomToMapSR(e),s={target:this.$iApi.geo.geom.geomRampToEsri(n)};n.type===Rl.POINT&&(s.scale=i||this.pointZoomScale);const o={animate:r};return this.viewPromise.then(()=>this.esriView.goTo(s,o))}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?Lp.fromESRI(this.esriView.extent):(this.noMapErr(),Lp.fromParams("i_am_error",0,1,0,1))}getExtentSet(){return this._rampExtentSet?this._rampExtentSet:(this.noMapErr(),vX.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(),nu.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 wCi extends Np{maptipStore;constructor(e){super(e),this.maptipStore=Xce(this.$vApp.$pinia)}#e=void 0;#t=void 0;async checkAtCoord(e){this.#t=e;const i=await this.$iApi.geo.map.getGraphicAtCoord(e);if(this.#t!==e)return;if(!i){this.#e=void 0,this.clear();return}if(this.#e&&this.#e.layerId===i.layerId&&this.#e.oid===i.oid&&this.#e.layerIdx===i.layerIdx)return;this.#e=i,this.clear();const r=this.$iApi.geo.layer.getLayer(i.layerId);if(!r){console.error(`graphic hit test returned non-existent layer id: ${i.layerId}`);return}if(!r.hovertips)return;const n=await r.getIcon(i.oid),s=await r.getGraphic(i.oid,{getAttribs:!0});this.setPoint(this.$iApi.geo.map.screenPointToMapPoint(e)),this.$iApi.event.emit(an.MAP_GRAPHICHIT,{layer:r,graphicHit:i,attributes:s.attributes,icon:n,screenPoint:e})}generateDefaultMaptip(e){this.setContent(`
${e.icon}${e.attributes[e.layer.config.tooltipField||e.layer.nameField]}
`)}clear(){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 xCi extends Vht{overviewGraphicLayer;overviewmapStore;constructor(e){super(e),this.overviewGraphicLayer=this.$iApi.geo.layer.createLayer({id:"RampOverviewGraphic",layerType:_n.GRAPHIC,url:"",cosmetic:!0}),this.overviewmapStore=NK(this.$vApp.$pinia)}createMapView(e){if(!e)throw new Error("Attempted to create overview map view without a basemap");const i=typeof e=="string"?this.findBasemap(e):e;this.applyBasemap(i),this._rampExtentSet=this.$iApi.geo.map.getExtentSet().clone(),this._rampSR=this._rampExtentSet.sr.clone();const r=this.overviewmapStore.expandFactor;this.esriView=Ho(new ent({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.when(()=>{this._viewPromise.resolveMe(),this.created=!0})}async addMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}const e=new Wx(this.$iApi.geo.map.getExtent(),"overview-graphic"),i=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 TG({fill:{colour:o},outline:{colour:i,width:r}}),await this.overviewGraphicLayer.initiate(),await this.overviewGraphicLayer.addGraphic(e),this.esriMap?.add(this.overviewGraphicLayer.esriLayer)}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(),this.overviewGraphicLayer.terminate(),this.esriMap.remove(this.overviewGraphicLayer.esriLayer)}destroyMapView(){this.esriView?.container.removeEventListener("touchmove",e=>{e.preventDefault()}),this.removeMapGraphicLayer(),super.destroyMapView()}findBasemap(e){const i=this._basemapStore.find(r=>r.id===e);if(i)return i;{const n=dg(this.$vApp.$pinia).config.map;if(n){const s=n.basemaps.find(o=>o.id===e);if(s)return new Ght(s)}}throw new Error(`Invalid basemap id requested: ${e}`)}setBasemap(e){if(!this.esriView||!this.esriMap)return this.noMapErr(),!1;const i=this.findBasemap(e),n=(this.getCurrentBasemapId()?this.findBasemap(this.getCurrentBasemapId()):void 0)?.tileSchemaId!==i.tileSchemaId;return n?(this.destroyMapView(),this.createMapView(i),this.addMapGraphicLayer()):this.applyBasemap(i),n}startExtent=null;async mapDrag(e){if(e.native.pointerType==="mouse"){if(e.action==="start")await this.cursorHitTest(e)&&(this.startExtent=Ho(this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry));else if(this.startExtent){const i=this.esriView.toMap(e.origin),r=this.esriView.toMap({x:e.x,y:e.y}),n=this.startExtent.clone().offset(r.x-i.x,r.y-i.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 i=this.overviewmapStore.expandFactor,r=this.zoomMapTo(e.expand(i),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 SCi extends Np{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 i=rD(this.$vApp.$pinia);if(e.mapCoords.disabled)i.coords={disabled:!0};else{const r=e.mapCoords.formatter;r!==void 0&&this.setPointFormatter(r)}if(e.scaleBar.disabled)i.scale={disabled:!0};else{const r=e.scaleBar.imperialScale;r!==void 0&&(i.toggleScale(r),this.$iApi.geo.map.viewPromise.then(()=>{this.updateScale()}))}}updateAttribution(e){const i={text:{value:"Powered by ESRI"},logo:{altText:"ESRI logo",link:"https://www.esri.com/",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"}};if(e){e.logo.disabled||(i.logo.altText=e.logo.altText||i.logo.altText,i.logo.link=e.logo.link||i.logo.link,i.logo.value=e.logo.value||i.logo.value),e.text.disabled||(i.text.value=e.text.value||i.text.value);const r=rD(this.$vApp.$pinia);r.attribution=i}if(!e||e.text.disabled){if(!this.$iApi.geo.map.esriMap){console.warn("Attempted to fetch map attribution with undefined map");return}let r="";const n=5e3,s=20,o=this.$iApi.geo.map.esriMap.basemap.baseLayers.map(a=>new Promise((l,c)=>{let d=0;const p=n/s,y=setInterval(function(){a.loaded&&!a.loadError?(clearInterval(y),l(a)):d>p&&(clearInterval(y),l(null)),d++},s)})).toArray();Promise.all(o).then(a=>{r=a.filter(c=>c?.copyright).map(c=>c.copyright).join(" | "),i.text.value=r||i.text.value;const l=rD(this.$vApp.$pinia);l.attribution=i})}}updateScale(){const e=rD(this.$vApp.$pinia),i=e.scale;if(i?.disabled)return;const r=i?.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,i=this.$iApi.geo.map.getResolution(),r=[],n=i*e,s=1609.34,o=3.28084,a=n>1e3?["km","mi"]:["m","ft"];for(let l=0;l<2;l++){const c=l===1;if(r.push({isImperialScale:c,units:a[l],pixels:0,distance:0}),n>1e3){const d=i*e/(c?s:1e3),p=Math.round(d).toString().length,y=Math.pow(10,p-1);r[l].distance=Math.ceil(d/y)*y,r[l].pixels=r[l].distance*(c?s:1e3)/i}else r[l].distance=Math.ceil(c?n*o:n),r[l].pixels=n/i}return r}wrapValue(e,i,r){return((e-i)%(r-i)+(r-i))%(r-i)+i}async formatLatLongDMS(e){const i=await this.$iApi.geo.proj.projectGeometry(4326,e),r=this.wrapValue(i.y,-90,90),n=this.wrapValue(i.x,-180,180),s=String.fromCharCode(176),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),c=Math.floor(Math.abs(n))*(n<0?-1:1),d=Math.floor(Math.abs((n-c)*60)),p=Math.floor((Math.abs(n)-Math.abs(c)-d/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(c),"number")}${s} ${this.$iApi.$i18n.n(d,"number",{minimumIntegerDigits:2})}' ${this.$iApi.$i18n.n(p,"number",{minimumIntegerDigits:2})}" ${this.$iApi.$i18n.t("map.coordinates."+(0>n?"west":"east"))}`}async formatLatLongDDM(e){const i=await this.$iApi.geo.proj.projectGeometry(4326,e),r=this.wrapValue(i.y,-90,90),n=this.wrapValue(i.x,-180,180),s=String.fromCharCode(176),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),c=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(c,"number",{minimumIntegerDigits:2,minimumFractionDigits:5,maximumFractionDigits:5})} ${this.$iApi.$i18n.t("map.coordinates."+(0>n?"west":"east"))}`}async formatLatLongDD(e){const i=await this.$iApi.geo.proj.projectGeometry(4326,e),r=this.wrapValue(i.y,-90,90),n=this.wrapValue(i.x,-180,180),s=String.fromCharCode(176),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 i=await this.$iApi.geo.proj.projectGeometry(102100,e);return`${this.$iApi.$i18n.n(Math.floor(i.x),"number")} m | ${this.$iApi.$i18n.n(Math.floor(i.y),"number")} m`}async formatLambert(e){const i=await this.$iApi.geo.proj.projectGeometry(3978,e);return`${this.$iApi.$i18n.n(Math.abs(Math.floor(i.x)),"number")} m ${this.$iApi.$i18n.t("map.coordinates."+(0>i.x?"west":"east"))} | ${this.$iApi.$i18n.n(Math.abs(Math.floor(i.y)),"number")} m ${this.$iApi.$i18n.t("map.coordinates."+(i.y>0?"north":"south"))}`}async formatUTM(e){const i=await this.$iApi.geo.proj.projectGeometry(4326,e),r=this.wrapValue(i.y,-90,90),n=this.wrapValue(i.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 i=await this.$iApi.geo.proj.projectGeometry(this.$iApi.geo.map.getSR(),e);return`${this.$iApi.$i18n.n(i.x,"number")} | ${this.$iApi.$i18n.n(i.y,"number")}`}}class CCi extends Vht{maptip;caption;mapMouseThrottle;constructor(e){super(e),this.maptip=new wCi(e),this.caption=new SCi(e),this.mapMouseThrottle=0}createMap(e,i){this.setMapMouseThrottle(e.mapMouseThrottle??0),super.createMap(e,i),this.viewPromise.then(()=>{this.$iApi.event.emit(an.MAP_CREATED)})}destroyMap(){if(!this.esriMap||!this.esriView){this.noMapErr();return}this.$iApi.geo.layer.allLayers().map(e=>e.uid).forEach(e=>this.removeLayer(e)),super.destroyMap(),this.$iApi.event.emit(an.MAP_DESTROYED)}createMapView(e){const r=dg(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);this.applyBasemap(n);const 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=vX.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=Ho(new ent({map:this.esriMap,container:this._targetDiv,constraints:{lods:a.lods,rotationEnabled:!1},spatialReference:this._rampSR.toESRI(),extent:this._rampExtentSet.defaultExtent.toESRI(),navigation:{browserTouchPanEnabled:!1}})),this.esriView.ui.components=[],this.handlers.push({type:"extent",handler:this.esriView.watch("extent",l=>{const c=this.$iApi.geo.geom.geomEsriToRamp(l,"map_extent_event");this.$iApi.event.emit(an.MAP_EXTENTCHANGE,c),this.$iApi.event.emit(an.FILTER_CHANGE,{extent:c,filterKey:$g.EXTENT})})}),this.handlers.push({type:"scale",handler:this.esriView.watch("scale",l=>{this.$iApi.event.emit(an.MAP_SCALECHANGE,l)})}),this.handlers.push({type:"resize",handler:this.esriView.on("resize",l=>{this.$iApi.event.emit(an.MAP_RESIZED,{height:l.height,width:l.width})})}),this.handlers.push({type:"click",handler:this.esriView.on("click",l=>{this.$iApi.event.emit(an.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(an.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",Z2(100,!0,l=>{this.$iApi.event.emit(an.MAP_MOUSEMOVE_START,this.$iApi.geo.geom.esriMapMouseToRamp(l))}))}),this.handlers.push({type:"pointer-move-end",handler:this.esriView.on("pointer-move",Z2(100,l=>{this.$iApi.event.emit(an.MAP_MOUSEMOVE_END,this.$iApi.geo.geom.esriMapMouseToRamp(l))}))}),this.handlers.push({type:"pointer-down",handler:this.esriView.on("pointer-down",l=>{this.$iApi.event.emit(an.MAP_MOUSEDOWN,l.native)})}),this.handlers.push({type:"key-down",handler:this.esriView.on("key-down",l=>{this.$iApi.event.emit(an.MAP_KEYDOWN,l.native),l.stopPropagation()})}),this.handlers.push({type:"key-up",handler:this.esriView.on("key-up",l=>{this.$iApi.event.emit(an.MAP_KEYUP,l.native),l.stopPropagation()})}),this.handlers.push({type:"focus",handler:this.esriView.on("focus",l=>{this.$iApi.event.emit(an.MAP_FOCUS,l.native)})}),this.handlers.push({type:"blur",handler:this.esriView.on("blur",l=>{this.$iApi.event.emit(an.MAP_BLUR,l.native)})}),this.esriView.container.addEventListener("touchmove",l=>{l.preventDefault()}),this.esriView.when(()=>{this._viewPromise.resolveMe(),this.created=!0})}destroyMapView(){this.esriView?.container.removeEventListener("touchmove",e=>{e.preventDefault()}),super.destroyMapView()}applyBasemap(e){if(!this.esriMap){this.noMapErr();return}const i=typeof e=="string"?this.findBasemap(e):e;this.esriMap.basemap=Hs(i.esriBasemap);const r=dg(this.$vApp.$pinia);r.activeBasemapConfig=i.config}setBasemap(e){if(!this.esriView||!this.esriMap)return this.noMapErr(),!1;const i=dg(this.$vApp.$pinia),r=this.findBasemap(e),s=i.activeBasemapConfig.tileSchemaId!==r.tileSchemaId;if(s){const o=this.getExtent();this._viewPromise=new Fm,this.created=!1,this.$iApi.event.emit(an.MAP_REFRESH_START),this.destroyMapView(),this.createMapView(r),this.viewPromise.then(()=>{this.$iApi.event.emit(an.MAP_REFRESH_END),this.$iApi.geo.proj.projectExtent(this._rampSR,o).then(a=>this.zoomMapTo(a))})}else this.applyBasemap(r);return this.$iApi.event.emit(an.MAP_BASEMAPCHANGE,{basemapId:e,schemaChanged:s}),s}addLayer(e,i=void 0){return new Promise((r,n)=>{this.esriMap||(this.noMapErr(),n()),e.initiationState!==T1.INITIATING&&e.initiationState!==T1.INITIATED&&e.layerState!==j0.ERROR&&e.initiate();const s=mv(this.$vApp.$pinia);let o=0;const a=setInterval(()=>{o+=250,o>=2e4||e.layerState===j0.ERROR?(clearInterval(a),s.addErrorLayer(e),e.onError(),n()):e.initiationState===T1.INITIATED&&e.esriLayer&&(clearInterval(a),this.esriMap?.add(e.esriLayer),s.addLayer(e),i!==void 0&&this.reorder(e,i),this.$iApi.event.emit(an.LAYER_REGISTERED,e),r())},250)})}reorder(e,i,r=!1){if(!this.esriMap){this.noMapErr();return}if(e.esriLayer){if(r&&e.isCosmetic)return;const n=mv(this.$vApp.$pinia),s=n.layers,o=s.slice(0,i+1).filter(l=>!this.esriMap.layers.find(c=>c.id===l.id)).length,a=this.esriMap.layers.indexOf(this.esriMap.layers.filter(l=>{const c=s.find(d=>d.id===l.id);return!!c&&!(r&&c.isCosmetic)}).slice(0,i+1-o).pop());this.esriMap.reorder(e.esriLayer,a),n.reorderLayer(e,i),this.$iApi.event.emit(an.MAP_REORDER,{layer:e,newIndex:i})}else console.error("Attempted reorder without an esri layer. Likely layer.initiate() was not called or had not finished.")}removeSublayer(e){let i,r;if(typeof e=="string")i=e,r=this.$iApi.geo.layer.getLayer(i);else{if(!e.isSublayer)throw new Error(`Attempted to call removeSublayer on a non-sublayer object: ${e}`);i=e.uid,r=e}if(!r)throw new Error("Sublayer could not be found for removal.");this.$iApi.event.emit(an.LAYER_REMOVE,e),r.visibility=!1,r.isRemoved=!0,r.parentLayer?.sublayers.every(n=>n.isRemoved)&&this.removeLayer(r.parentLayer)}removeLayer(e){if(!this.esriMap){this.noMapErr();return}let i;if(e instanceof gN?i=e:i=this.$iApi.geo.layer.getLayer(e),!i)throw new Error("Layer could not be found for removal.");if(i.isSublayer){this.removeSublayer(i);return}if(!i.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.");i.supportsSublayers&&i.sublayers.some(n=>!n.isRemoved)&&i.sublayers.forEach(n=>this.removeSublayer(n)),i.terminate();const r=mv(this.$vApp.$pinia);r.removeLayer(i),r.removeLayerConfig(i.id),this.esriMap.remove(i.esriLayer),i.isRemoved=!0,this.$iApi.event.emit(an.LAYER_REMOVE,i)}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 i=this.handlers.findIndex(r=>r.type==="pointer-move");if(i!==-1){const r=this.handlers[i];this.handlers.splice(i,1),r.handler.remove()}return i!==-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 OP(this.mapMouseThrottle,e=>{this.$iApi.event.emit(an.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 i=e.isOffScale(this.getScale());if(!i.offScale)return;const r=this.esriView.constraints.lods;if(!r)return this.zoomMapTo(this.getExtent().center(),(i.zoomIn,e.minScale));const n=i.zoomIn?r:[...r].reverse(),s=n.find(o=>i.zoomIn?o.scalee.maxScale)||n[n.length-1];return this.zoomToLevel(s.level)}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?Qg.fromESRI(this.esriView.toMap({x:e.screenX,y:e.screenY}),"mappoint"):(this.noMapErr(),new Qg("i_am_error",[0,0],void 0,!0))}mapPointToScreenPoint(e){if(this.esriView){const i=this.esriView.toScreen(e.toESRI());return{screenX:i.x,screenY:i.y}}else return this.noMapErr(),{screenX:1,screenY:1}}runIdentify(e){const i=mv(this.$vApp.$pinia).layers;let r;if(e instanceof Qg){const c=this.mapPointToScreenPoint(e);r={mapPoint:e,screenX:c.screenX,screenY:c.screenY,button:0,input:"mouse",clickTime:Date.now()}}else r=e;if(i===void 0)return{click:r,results:[]};let n=Promise.resolve([]);i.some(c=>c.canIdentify()&&(c.identifyMode===vm.HYBRID||c.identifyMode===vm.SYMBOLIC))&&(n=this.esriView.hitTest({x:r.screenX,y:r.screenY}).then(c=>c.results.map(d=>({layerId:d.layer.id,layerIdx:0,oid:d.graphic.getObjectId()}))));const s={geometry:r.mapPoint,hitTest:n},o=i.filter(c=>c.supportsIdentify).map(c=>(s.tolerance=r.input=="touch"?c.touchTolerance:c.mouseTolerance,c.runIdentify(s))).flat(),a=Date.now();o.forEach(c=>{c.requestTime=a});const l={results:o,click:r};return this.$iApi.event.emit(an.MAP_IDENTIFY,l),l}async getGraphicAtCoord(e){if(!this.esriView){this.noMapErr();return}const i=mv(this.$vApp.$pinia).layers?.slice(0);if(i===void 0)return;i.reverse();const r=await this.esriView.hitTest({x:e.screenX,y:e.screenY});if(r.results.length===0)return;let n;if(i.some(s=>{const o=r.results.find(a=>a.graphic.layer.id===s.id);if(o){if(s.isCosmetic)return!0;n=s}return o!==void 0}),n){n.sublayers.length>1&&console.warn("Found layer with sublayers during hitTest"),n.drawOrder.length===0&&console.warn("Found layer with no draw order during hitTest");let s=r.results.filter(d=>d.graphic.layer.id===n.id);const o=(d,p)=>d===p?0:d>p?1:-1;let a=[],l;if(n.drawOrder.some((d,p)=>(a=[s.pop()],l=a[0].graphic.attributes[d.field],s.forEach(y=>{const v=y.graphic.attributes[d.field],S=o(l,v);S===0?a.push(y):(d.ascending&&S>0||!d.ascending&&S<0)&&(a=[y],l=v)}),a.length===1||p===n.drawOrder.length-1?!0:(s=a,!1))),a.length===0){console.error("Hit test failed to find topmost item using draw order");return}return{oid:a[0].graphic.getObjectId(),layerId:n.id,layerIdx:n.getLayerTree().layerIdx}}}_activeKeys=[];_panInterval;_mouseFocus=!1;mapKeyDown(e){const i=["=","-"];["Shift","Control","ArrowDown","ArrowLeft","ArrowRight","ArrowUp"].includes(e.key)&&!this._activeKeys.includes(e.key)?(this._activeKeys.push(e.key),this._activeKeys.some(n=>i.includes(n))||this.keyPan()):i.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 i=["=","-"];this._activeKeys.includes(e.key)&&!i.includes(e.key)&&(this._activeKeys.splice(this._activeKeys.indexOf(e.key),1),this._activeKeys.some(r=>i.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(),i=this.mapPointToScreenPoint(e),r=this.screenPointToMapPoint({screenX:i.screenX+5,screenY:i.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 d=0;d{e.x+=l*o,e.y+=l*a,this.zoomMapTo(e,c,!1)},25)}}const TCi={circlePoint:{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}}}},solidLine:{geometryType:"polyline",renderer:{type:"simple",symbol:{type:"esriSLS",style:"esriSLSSolid",color:[90,90,90,200],width:2}}},outlinedPoly:{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}}}},boundingBoxPoly:{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}}}}};var I3e={},ECi={get exports(){return I3e},set exports(t){I3e=t}};(function(t,e){(function(i,r){if(t.exports=r(Int()),typeof i.navigator=="object"){if(!i.Terraformer)throw new Error("Terraformer.ArcGIS requires the core Terraformer library. https://github.com/esri/Terraformer");i.Terraformer.ArcGIS=r(i.Terraformer)}})(kp,function(i){var r={};function n(O){var L=0,N=0,G=[],V,Y,X,te;X=O.match(/((\+|\-)[^\+\-]+)/g),te=parseInt(X[0],32);for(var re=1;re=0}function c(O){var L=[],N=O.slice(0),G=s(N.shift().slice(0));if(G.length>=4){l(G)||G.reverse(),L.push(G);for(var V=0;V=4&&(l(Y)&&Y.reverse(),L.push(Y))}}return L}function d(O){for(var L=[],N=0;N=0;V--){var Y=G[V].slice(0);L.push(Y)}return L}function p(O,L){var N=i.Tools.arraysIntersectArrays(O,L),G=i.Tools.coordinatesContainPoint(O,L[0]);return!!(!N&&G)}function y(O){for(var L=[],N=[],G,V,Y,X=0;X=0;G--)if(V=L[G][0],p(V,Y)){L[G].push(Y),ge=!0;break}ge||fe.push(Y)}for(;fe.length;){Y=fe.pop();var _e=!1;for(G=L.length-1;G>=0;G--)if(V=L[G][0],i.Tools.arraysIntersectArrays(V,Y)){L[G].push(Y),_e=!0;break}_e||L.push([Y.reverse()])}return L.length===1?{type:"Polygon",coordinates:L[0]}:{type:"MultiPolygon",coordinates:L}}function v(O,L){var N={};return L=L||{},L.idAttribute=L.idAttribute||void 0,O.spatialReference&&(O.spatialReference.wkid===3857||O.spatialReference.wkid===102100)&&(N.crs=i.MercatorCRS),typeof O.x=="number"&&typeof O.y=="number"&&(N.type="Point",N.coordinates=[O.x,O.y],(O.z||O.m)&&N.coordinates.push(O.z),O.m&&N.coordinates.push(O.m)),O.points&&(N.type="MultiPoint",N.coordinates=O.points.slice(0)),O.paths&&(O.paths.length===1?(N.type="LineString",N.coordinates=O.paths[0].slice(0)):(N.type="MultiLineString",N.coordinates=O.paths.slice(0))),O.rings&&(N=y(O.rings.slice(0))),typeof O.xmin=="number"&&typeof O.ymin=="number"&&typeof O.xmax=="number"&&typeof O.ymax=="number"&&(N.type="Polygon",N.coordinates=[[[O.xmax,O.ymax],[O.xmin,O.ymax],[O.xmin,O.ymin],[O.xmax,O.ymin],[O.xmax,O.ymax]]]),(O.compressedGeometry||O.geometry||O.attributes)&&(N.type="Feature",O.compressedGeometry&&(O.geometry={paths:[n(O.compressedGeometry)]}),N.geometry=O.geometry?v(O.geometry):null,N.properties=O.attributes?a(O.attributes):null,O.attributes&&(N.id=O.attributes[L.idAttribute]||O.attributes.OBJECTID||O.attributes.FID)),new i.Primitive(N)}function S(O,L){var N;L=L||{};var G=L.idAttribute||"OBJECTID";L.sr?N={wkid:L.sr}:O&&O.crs&&O.crs.properties.name!="urn:ogc:def:crs:OGC:1.3:CRS84"?N=null:N={wkid:4326};var V={},Y;switch(O.type){case"Point":V.x=O.coordinates[0],V.y=O.coordinates[1],O.coordinates[2]&&(V.z=O.coordinates[2]),O.coordinates[3]&&(V.m=O.coordinates[3]),V.spatialReference=N;break;case"MultiPoint":V.points=O.coordinates.slice(0),V.spatialReference=N;break;case"LineString":V.paths=[O.coordinates.slice(0)],V.spatialReference=N;break;case"MultiLineString":V.paths=O.coordinates.slice(0),V.spatialReference=N;break;case"Polygon":V.rings=c(O.coordinates.slice(0)),V.spatialReference=N;break;case"MultiPolygon":V.rings=d(O.coordinates.slice(0)),V.spatialReference=N;break;case"Feature":O.geometry&&(V.geometry=S(O.geometry,L)),V.attributes=O.properties?a(O.properties):{},O.id&&(V.attributes[G]=O.id);break;case"FeatureCollection":for(V=[],Y=0;Y=S)return y;if(N)return N=!1,p;var Y=I,X;if(c.charCodeAt(Y)===34){for(var te=Y;te++"u")return!1;var e=eS(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Axi(t){var e=t.state;Object.keys(e.elements).forEach(function(i){var r=e.styles[i]||{},n=e.attributes[i]||{},s=e.elements[i];!Uw(s)||!YT(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 Pxi(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.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]:i[r]),a=o.reduce(function(l,c){return l[c]="",l},{});!Uw(n)||!YT(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}var lht={name:"applyStyles",enabled:!0,phase:"write",fn:Axi,effect:Pxi,requires:["computeStyles"]};function XT(t){return t.split("-")[0]}var ok=Math.max,ohe=Math.min,pj=Math.round;function fj(t,e){e===void 0&&(e=!1);var i=t.getBoundingClientRect(),r=1,n=1;if(Uw(t)&&e){var s=t.offsetHeight,o=t.offsetWidth;o>0&&(r=pj(i.width)/o||1),s>0&&(n=pj(i.height)/s||1)}return{width:i.width/r,height:i.height/n,top:i.top/n,right:i.right/r,bottom:i.bottom/n,left:i.left/r,x:i.left/r,y:i.top/n}}function c3e(t){var e=fj(t),i=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:r}}function uht(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&aht(i)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function KT(t){return eS(t).getComputedStyle(t)}function Oxi(t){return["table","td","th"].indexOf(YT(t))>=0}function hD(t){return((dj(t)?t.ownerDocument:t.document)||window.document).documentElement}function ahe(t){return YT(t)==="html"?t:t.assignedSlot||t.parentNode||(aht(t)?t.host:null)||hD(t)}function cht(t){return!Uw(t)||KT(t).position==="fixed"?null:t.offsetParent}function Rxi(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,i=navigator.userAgent.indexOf("Trident")!==-1;if(i&&Uw(t)){var r=KT(t);if(r.position==="fixed")return null}for(var n=ahe(t);Uw(n)&&["html","body"].indexOf(YT(n))<0;){var s=KT(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 RK(t){for(var e=eS(t),i=cht(t);i&&Oxi(i)&&KT(i).position==="static";)i=cht(i);return i&&(YT(i)==="html"||YT(i)==="body"&&KT(i).position==="static")?e:i||Rxi(t)||e}function h3e(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function MK(t,e,i){return ok(t,ohe(e,i))}function Mxi(t,e,i){var r=MK(t,e,i);return r>i?i:r}function hht(){return{top:0,right:0,bottom:0,left:0}}function dht(t){return Object.assign({},hht(),t)}function pht(t,e){return e.reduce(function(i,r){return i[r]=t,i},{})}var Dxi=function(e,i){return e=typeof e=="function"?e(Object.assign({},i.rects,{placement:i.placement})):e,dht(typeof e!="number"?e:pht(e,AK))};function Fxi(t){var e,i=t.state,r=t.name,n=t.options,s=i.elements.arrow,o=i.modifiersData.popperOffsets,a=XT(i.placement),l=h3e(a),c=[M_,Gw].indexOf(a)>=0,h=c?"height":"width";if(!(!s||!o)){var p=Dxi(n.padding,i),y=c3e(s),v=l==="y"?R_:M_,x=l==="y"?jw:Gw,I=i.rects.reference[h]+i.rects.reference[l]-o[l]-i.rects.popper[h],P=o[l]-i.rects.reference[l],F=RK(s),k=F?l==="y"?F.clientHeight||0:F.clientWidth||0:0,j=I/2-P/2,V=p[v],Y=k-y[h]-p[x],X=k/2-y[h]/2+j,Z=MK(V,X,Y),ie=l;i.modifiersData[r]=(e={},e[ie]=Z,e.centerOffset=Z-X,e)}}function Lxi(t){var e=t.state,i=t.options,r=i.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||uht(e.elements.popper,n)&&(e.elements.arrow=n))}var Nxi={name:"arrow",enabled:!0,phase:"main",fn:Fxi,effect:Lxi,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function mj(t){return t.split("-")[1]}var kxi={top:"auto",right:"auto",bottom:"auto",left:"auto"};function $xi(t){var e=t.x,i=t.y,r=window,n=r.devicePixelRatio||1;return{x:pj(e*n)/n||0,y:pj(i*n)/n||0}}function fht(t){var e,i=t.popper,r=t.popperRect,n=t.placement,s=t.variation,o=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,p=t.isFixed,y=h===!0?$xi(o):typeof h=="function"?h(o):o,v=y.x,x=v===void 0?0:v,I=y.y,P=I===void 0?0:I,F=o.hasOwnProperty("x"),k=o.hasOwnProperty("y"),j=M_,V=R_,Y=window;if(c){var X=RK(i),Z="clientHeight",ie="clientWidth";if(X===eS(i)&&(X=hD(i),KT(X).position!=="static"&&a==="absolute"&&(Z="scrollHeight",ie="scrollWidth")),X=X,n===R_||(n===M_||n===Gw)&&s===PK){V=jw;var ce=p&&Y.visualViewport?Y.visualViewport.height:X[Z];P-=ce-r.height,P*=l?1:-1}if(n===M_||(n===R_||n===jw)&&s===PK){j=Gw;var he=p&&Y.visualViewport?Y.visualViewport.width:X[ie];x-=he-r.width,x*=l?1:-1}}var _e=Object.assign({position:a},c&&kxi);if(l){var xe;return Object.assign({},_e,(xe={},xe[V]=k?"0":"",xe[j]=F?"0":"",xe.transform=(Y.devicePixelRatio||1)<=1?"translate("+x+"px, "+P+"px)":"translate3d("+x+"px, "+P+"px, 0)",xe))}return Object.assign({},_e,(e={},e[V]=k?P+"px":"",e[j]=F?x+"px":"",e.transform="",e))}function Bxi(t){var e=t.state,i=t.options,r=i.gpuAcceleration,n=r===void 0?!0:r,s=i.adaptive,o=s===void 0?!0:s,a=i.roundOffsets,l=a===void 0?!0:a,c={placement:XT(e.placement),variation:mj(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,fht(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,fht(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Vxi={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Bxi,data:{}},lhe={passive:!0};function jxi(t){var e=t.state,i=t.instance,r=t.options,n=r.scroll,s=n===void 0?!0:n,o=r.resize,a=o===void 0?!0:o,l=eS(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(h){h.addEventListener("scroll",i.update,lhe)}),a&&l.addEventListener("resize",i.update,lhe),function(){s&&c.forEach(function(h){h.removeEventListener("scroll",i.update,lhe)}),a&&l.removeEventListener("resize",i.update,lhe)}}var Gxi={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:jxi,data:{}},Uxi={left:"right",right:"left",bottom:"top",top:"bottom"};function uhe(t){return t.replace(/left|right|bottom|top/g,function(e){return Uxi[e]})}var zxi={start:"end",end:"start"};function mht(t){return t.replace(/start|end/g,function(e){return zxi[e]})}function d3e(t){var e=eS(t),i=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:i,scrollTop:r}}function p3e(t){return fj(hD(t)).left+d3e(t).scrollLeft}function Hxi(t){var e=eS(t),i=hD(t),r=e.visualViewport,n=i.clientWidth,s=i.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+p3e(t),y:a}}function Wxi(t){var e,i=hD(t),r=d3e(t),n=(e=t.ownerDocument)==null?void 0:e.body,s=ok(i.scrollWidth,i.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=ok(i.scrollHeight,i.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-r.scrollLeft+p3e(t),l=-r.scrollTop;return KT(n||i).direction==="rtl"&&(a+=ok(i.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function f3e(t){var e=KT(t),i=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+n+r)}function ght(t){return["html","body","#document"].indexOf(YT(t))>=0?t.ownerDocument.body:Uw(t)&&f3e(t)?t:ght(ahe(t))}function DK(t,e){var i;e===void 0&&(e=[]);var r=ght(t),n=r===((i=t.ownerDocument)==null?void 0:i.body),s=eS(r),o=n?[s].concat(s.visualViewport||[],f3e(r)?r:[]):r,a=e.concat(o);return n?a:a.concat(DK(ahe(o)))}function m3e(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function qxi(t){var e=fj(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function yht(t,e){return e===nht?m3e(Hxi(t)):dj(e)?qxi(e):m3e(Wxi(hD(t)))}function Yxi(t){var e=DK(ahe(t)),i=["absolute","fixed"].indexOf(KT(t).position)>=0,r=i&&Uw(t)?RK(t):t;return dj(r)?e.filter(function(n){return dj(n)&&uht(n,r)&&YT(n)!=="body"&&(i?KT(n).position!=="static":!0)}):[]}function Xxi(t,e,i){var r=e==="clippingParents"?Yxi(t):[].concat(e),n=[].concat(r,[i]),s=n[0],o=n.reduce(function(a,l){var c=yht(t,l);return a.top=ok(c.top,a.top),a.right=ohe(c.right,a.right),a.bottom=ohe(c.bottom,a.bottom),a.left=ok(c.left,a.left),a},yht(t,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function vht(t){var e=t.reference,i=t.element,r=t.placement,n=r?XT(r):null,s=r?mj(r):null,o=e.x+e.width/2-i.width/2,a=e.y+e.height/2-i.height/2,l;switch(n){case R_:l={x:o,y:e.y-i.height};break;case jw:l={x:o,y:e.y+e.height};break;case Gw:l={x:e.x+e.width,y:a};break;case M_:l={x:e.x-i.width,y:a};break;default:l={x:e.x,y:e.y}}var c=n?h3e(n):null;if(c!=null){var h=c==="y"?"height":"width";switch(s){case hj:l[c]=l[c]-(e[h]/2-i[h]/2);break;case PK:l[c]=l[c]+(e[h]/2-i[h]/2);break}}return l}function FK(t,e){e===void 0&&(e={});var i=e,r=i.placement,n=r===void 0?t.placement:r,s=i.boundary,o=s===void 0?gxi:s,a=i.rootBoundary,l=a===void 0?nht:a,c=i.elementContext,h=c===void 0?OK:c,p=i.altBoundary,y=p===void 0?!1:p,v=i.padding,x=v===void 0?0:v,I=dht(typeof x!="number"?x:pht(x,AK)),P=h===OK?yxi:OK,F=t.rects.popper,k=t.elements[y?P:h],j=Xxi(dj(k)?k:k.contextElement||hD(t.elements.popper),o,l),V=fj(t.elements.reference),Y=vht({reference:V,element:F,strategy:"absolute",placement:n}),X=m3e(Object.assign({},F,Y)),Z=h===OK?X:V,ie={top:j.top-Z.top+I.top,bottom:Z.bottom-j.bottom+I.bottom,left:j.left-Z.left+I.left,right:Z.right-j.right+I.right},ce=t.modifiersData.offset;if(h===OK&&ce){var he=ce[n];Object.keys(ie).forEach(function(_e){var xe=[Gw,jw].indexOf(_e)>=0?1:-1,Pe=[R_,jw].indexOf(_e)>=0?"y":"x";ie[_e]+=he[Pe]*xe})}return ie}function Kxi(t,e){e===void 0&&(e={});var i=e,r=i.placement,n=i.boundary,s=i.rootBoundary,o=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=l===void 0?oht:l,h=mj(r),p=h?a?sht:sht.filter(function(x){return mj(x)===h}):AK,y=p.filter(function(x){return c.indexOf(x)>=0});y.length===0&&(y=p);var v=y.reduce(function(x,I){return x[I]=FK(t,{placement:I,boundary:n,rootBoundary:s,padding:o})[XT(I)],x},{});return Object.keys(v).sort(function(x,I){return v[x]-v[I]})}function Jxi(t){if(XT(t)===u3e)return[];var e=uhe(t);return[mht(t),e,mht(e)]}function Zxi(t){var e=t.state,i=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var n=i.mainAxis,s=n===void 0?!0:n,o=i.altAxis,a=o===void 0?!0:o,l=i.fallbackPlacements,c=i.padding,h=i.boundary,p=i.rootBoundary,y=i.altBoundary,v=i.flipVariations,x=v===void 0?!0:v,I=i.allowedAutoPlacements,P=e.options.placement,F=XT(P),k=F===P,j=l||(k||!x?[uhe(P)]:Jxi(P)),V=[P].concat(j).reduce(function(et,Ze){return et.concat(XT(Ze)===u3e?Kxi(e,{placement:Ze,boundary:h,rootBoundary:p,padding:c,flipVariations:x,allowedAutoPlacements:I}):Ze)},[]),Y=e.rects.reference,X=e.rects.popper,Z=new Map,ie=!0,ce=V[0],he=0;he=0,J=ke?"width":"height",de=FK(e,{placement:_e,boundary:h,rootBoundary:p,altBoundary:y,padding:c}),Se=ke?Pe?Gw:M_:Pe?jw:R_;Y[J]>X[J]&&(Se=uhe(Se));var Ie=uhe(Se),Re=[];if(s&&Re.push(de[xe]<=0),a&&Re.push(de[Se]<=0,de[Ie]<=0),Re.every(function(et){return et})){ce=_e,ie=!1;break}Z.set(_e,Re)}if(ie)for(var Oe=x?3:1,Ge=function(Ze){var mt=V.find(function(Pt){var $t=Z.get(Pt);if($t)return $t.slice(0,Ze).every(function(Ct){return Ct})});if(mt)return ce=mt,"break"},Be=Oe;Be>0;Be--){var qe=Ge(Be);if(qe==="break")break}e.placement!==ce&&(e.modifiersData[r]._skip=!0,e.placement=ce,e.reset=!0)}}var Qxi={name:"flip",enabled:!0,phase:"main",fn:Zxi,requiresIfExists:["offset"],data:{_skip:!1}};function _ht(t,e,i){return i===void 0&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function bht(t){return[R_,Gw,jw,M_].some(function(e){return t[e]>=0})}function e2i(t){var e=t.state,i=t.name,r=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=FK(e,{elementContext:"reference"}),a=FK(e,{altBoundary:!0}),l=_ht(o,r),c=_ht(a,n,s),h=bht(l),p=bht(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":p})}var t2i={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:e2i};function i2i(t,e,i){var r=XT(t),n=[M_,R_].indexOf(r)>=0?-1:1,s=typeof i=="function"?i(Object.assign({},e,{placement:t})):i,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[M_,Gw].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function r2i(t){var e=t.state,i=t.options,r=t.name,n=i.offset,s=n===void 0?[0,0]:n,o=oht.reduce(function(h,p){return h[p]=i2i(p,e.rects,s),h},{}),a=o[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}var n2i={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:r2i};function s2i(t){var e=t.state,i=t.name;e.modifiersData[i]=vht({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var o2i={name:"popperOffsets",enabled:!0,phase:"read",fn:s2i,data:{}};function a2i(t){return t==="x"?"y":"x"}function l2i(t){var e=t.state,i=t.options,r=t.name,n=i.mainAxis,s=n===void 0?!0:n,o=i.altAxis,a=o===void 0?!1:o,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,p=i.padding,y=i.tether,v=y===void 0?!0:y,x=i.tetherOffset,I=x===void 0?0:x,P=FK(e,{boundary:l,rootBoundary:c,padding:p,altBoundary:h}),F=XT(e.placement),k=mj(e.placement),j=!k,V=h3e(F),Y=a2i(V),X=e.modifiersData.popperOffsets,Z=e.rects.reference,ie=e.rects.popper,ce=typeof I=="function"?I(Object.assign({},e.rects,{placement:e.placement})):I,he=typeof ce=="number"?{mainAxis:ce,altAxis:ce}:Object.assign({mainAxis:0,altAxis:0},ce),_e=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,xe={x:0,y:0};if(X){if(s){var Pe,ke=V==="y"?R_:M_,J=V==="y"?jw:Gw,de=V==="y"?"height":"width",Se=X[V],Ie=Se+P[ke],Re=Se-P[J],Oe=v?-ie[de]/2:0,Ge=k===hj?Z[de]:ie[de],Be=k===hj?-ie[de]:-Z[de],qe=e.elements.arrow,et=v&&qe?c3e(qe):{width:0,height:0},Ze=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:hht(),mt=Ze[ke],Pt=Ze[J],$t=MK(0,Z[de],et[de]),Ct=j?Z[de]/2-Oe-$t-mt-he.mainAxis:Ge-$t-mt-he.mainAxis,Et=j?-Z[de]/2+Oe+$t+Pt+he.mainAxis:Be+$t+Pt+he.mainAxis,Ft=e.elements.arrow&&RK(e.elements.arrow),ot=Ft?V==="y"?Ft.clientTop||0:Ft.clientLeft||0:0,Te=(Pe=_e?.[V])!=null?Pe:0,je=Se+Ct-Te-ot,pt=Se+Et-Te,kt=MK(v?ohe(Ie,je):Ie,Se,v?ok(Re,pt):Re);X[V]=kt,xe[V]=kt-Se}if(a){var ct,ae=V==="x"?R_:M_,ht=V==="x"?jw:Gw,wt=X[Y],Ne=Y==="y"?"height":"width",pe=wt+P[ae],Ae=wt-P[ht],tt=[R_,M_].indexOf(F)!==-1,gt=(ct=_e?.[Y])!=null?ct:0,ze=tt?pe:wt-Z[Ne]-ie[Ne]-gt+he.altAxis,Ot=tt?wt+Z[Ne]+ie[Ne]-gt-he.altAxis:Ae,jt=v&&tt?Mxi(ze,wt,Ot):MK(v?ze:pe,wt,v?Ot:Ae);X[Y]=jt,xe[Y]=jt-wt}e.modifiersData[r]=xe}}var u2i={name:"preventOverflow",enabled:!0,phase:"main",fn:l2i,requiresIfExists:["offset"]};function c2i(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function h2i(t){return t===eS(t)||!Uw(t)?d3e(t):c2i(t)}function d2i(t){var e=t.getBoundingClientRect(),i=pj(e.width)/t.offsetWidth||1,r=pj(e.height)/t.offsetHeight||1;return i!==1||r!==1}function p2i(t,e,i){i===void 0&&(i=!1);var r=Uw(e),n=Uw(e)&&d2i(e),s=hD(e),o=fj(t,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!i)&&((YT(e)!=="body"||f3e(s))&&(a=h2i(e)),Uw(e)?(l=fj(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=p3e(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function f2i(t){var e=new Map,i=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function n(s){i.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!i.has(a)){var l=e.get(a);l&&n(l)}}),r.push(s)}return t.forEach(function(s){i.has(s.name)||n(s)}),r}function m2i(t){var e=f2i(t);return Ixi.reduce(function(i,r){return i.concat(e.filter(function(n){return n.phase===r}))},[])}function g2i(t){var e;return function(){return e||(e=new Promise(function(i){Promise.resolve().then(function(){e=void 0,i(t())})})),e}}function y2i(t){var e=t.reduce(function(i,r){var n=i[r.name];return i[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,i},{});return Object.keys(e).map(function(i){return e[i]})}var wht={placement:"bottom",modifiers:[],strategy:"absolute"};function xht(){for(var t=arguments.length,e=new Array(t),i=0;i-1}function Aht(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Pht(t,e){if(e===0)return t;var i;return function(r){clearTimeout(i),i=setTimeout(function(){t(r)},e)}}function x2i(t,e){var i=Object.assign({},t);return e.forEach(function(r){delete i[r]}),i}function S2i(t){return t.split(/\s+/).filter(Boolean)}function lk(t){return[].concat(t)}function Oht(t,e){t.indexOf(e)===-1&&t.push(e)}function C2i(t){return t.filter(function(e,i){return t.indexOf(e)===i})}function Rht(t){return t.split("-")[0]}function gj(t){return[].slice.call(t)}function Mht(t){return Object.keys(t).reduce(function(e,i){return t[i]!==void 0&&(e[i]=t[i]),e},{})}function uk(){return document.createElement("div")}function che(t){return["Element","Fragment"].some(function(e){return y3e(t,e)})}function T2i(t){return y3e(t,"NodeList")}function v3e(t){return y3e(t,"MouseEvent")}function E2i(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function I2i(t){return che(t)?[t]:T2i(t)?gj(t):Array.isArray(t)?t:gj(document.querySelectorAll(t))}function _3e(t,e){t.forEach(function(i){i&&(i.style.transitionDuration=e+"ms")})}function LK(t,e){t.forEach(function(i){i&&i.setAttribute("data-state",e)})}function Dht(t){var e,i=lk(t),r=i[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function A2i(t,e){var i=e.clientX,r=e.clientY;return t.every(function(n){var s=n.popperRect,o=n.popperState,a=n.props,l=a.interactiveBorder,c=Rht(o.placement),h=o.modifiersData.offset;if(!h)return!0;var p=c==="bottom"?h.top.y:0,y=c==="top"?h.bottom.y:0,v=c==="right"?h.left.x:0,x=c==="left"?h.right.x:0,I=s.top-r+p>l,P=r-s.bottom-y>l,F=s.left-i+v>l,k=i-s.right-x>l;return I||P||F||k})}function b3e(t,e,i){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){t[r](n,i)})}function Fht(t,e){for(var i=e;i;){var r;if(t.contains(i))return!0;i=i.getRootNode==null||(r=i.getRootNode())==null?void 0:r.host}return!1}var JT={isTouch:!1},Lht=0;function P2i(){JT.isTouch||(JT.isTouch=!0,window.performance&&document.addEventListener("mousemove",Nht))}function Nht(){var t=performance.now();t-Lht<20&&(JT.isTouch=!1,document.removeEventListener("mousemove",Nht)),Lht=t}function O2i(){var t=document.activeElement;if(E2i(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function R2i(){document.addEventListener("touchstart",P2i,ak),window.addEventListener("blur",O2i)}var M2i=typeof window<"u"&&typeof document<"u",D2i=M2i?!!window.msCrypto:!1,F2i={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},L2i={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},tS=Object.assign({appendTo:Iht,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},F2i,L2i),N2i=Object.keys(tS),k2i=function(e){var i=Object.keys(e);i.forEach(function(r){tS[r]=e[r]})};function kht(t){var e=t.plugins||[],i=e.reduce(function(r,n){var s=n.name,o=n.defaultValue;if(s){var a;r[s]=t[s]!==void 0?t[s]:(a=tS[s])!=null?a:o}return r},{});return Object.assign({},t,i)}function $2i(t,e){var i=e?Object.keys(kht(Object.assign({},tS,{plugins:e}))):N2i,r=i.reduce(function(n,s){var o=(t.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 $ht(t,e){var i=Object.assign({},e,{content:Aht(e.content,[t])},e.ignoreAttributes?{}:$2i(t,e.plugins));return i.aria=Object.assign({},tS.aria,i.aria),i.aria={expanded:i.aria.expanded==="auto"?e.interactive:i.aria.expanded,content:i.aria.content==="auto"?e.interactive?null:"describedby":i.aria.content},i}var B2i=function(){return"innerHTML"};function w3e(t,e){t[B2i()]=e}function Bht(t){var e=uk();return t===!0?e.className=Tht:(e.className=Eht,che(t)?e.appendChild(t):w3e(e,t)),e}function Vht(t,e){che(e.content)?(w3e(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?w3e(t,e.content):t.textContent=e.content)}function hhe(t){var e=t.firstElementChild,i=gj(e.children);return{box:e,content:i.find(function(r){return r.classList.contains(Sht)}),arrow:i.find(function(r){return r.classList.contains(Tht)||r.classList.contains(Eht)}),backdrop:i.find(function(r){return r.classList.contains(Cht)})}}function jht(t){var e=uk(),i=uk();i.className=w2i,i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var r=uk();r.className=Sht,r.setAttribute("data-state","hidden"),Vht(r,t.props),e.appendChild(i),i.appendChild(r),n(t.props,t.props);function n(s,o){var a=hhe(e),l=a.box,c=a.content,h=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)&&Vht(c,t.props),o.arrow?h?s.arrow!==o.arrow&&(l.removeChild(h),l.appendChild(Bht(o.arrow))):l.appendChild(Bht(o.arrow)):h&&l.removeChild(h)}return{popper:e,onUpdate:n}}jht.$$tippy=!0;var V2i=1,dhe=[],x3e=[];function j2i(t,e){var i=$ht(t,Object.assign({},tS,kht(Mht(e)))),r,n,s,o=!1,a=!1,l=!1,c=!1,h,p,y,v=[],x=Pht(je,i.interactiveDebounce),I,P=V2i++,F=null,k=C2i(i.plugins),j={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},V={id:P,reference:t,popper:uk(),popperInstance:F,props:i,state:j,plugins:k,clearDelayTimeouts:ze,setProps:Ot,setContent:jt,show:nt,hide:$e,hideWithInteractivity:Xt,enable:tt,disable:gt,unmount:A,destroy:ye};if(!i.render)return V;var Y=i.render(V),X=Y.popper,Z=Y.onUpdate;X.setAttribute("data-tippy-root",""),X.id="tippy-"+V.id,V.popper=X,t._tippy=V,X._tippy=V;var ie=k.map(function(H){return H.fn(V)}),ce=t.hasAttribute("aria-expanded");return Ft(),Oe(),Se(),Ie("onCreate",[V]),i.showOnCreate&&pe(),X.addEventListener("mouseenter",function(){V.props.interactive&&V.state.isVisible&&V.clearDelayTimeouts()}),X.addEventListener("mouseleave",function(){V.props.interactive&&V.props.trigger.indexOf("mouseenter")>=0&&ke().addEventListener("mousemove",x)}),V;function he(){var H=V.props.touch;return Array.isArray(H)?H:[H,0]}function _e(){return he()[0]==="hold"}function xe(){var H;return!!((H=V.props.render)!=null&&H.$$tippy)}function Pe(){return I||t}function ke(){var H=Pe().parentNode;return H?Dht(H):document}function J(){return hhe(X)}function de(H){return V.state.isMounted&&!V.state.isVisible||JT.isTouch||h&&h.type==="focus"?0:g3e(V.props.delay,H?0:1,tS.delay)}function Se(H){H===void 0&&(H=!1),X.style.pointerEvents=V.props.interactive&&!H?"":"none",X.style.zIndex=""+V.props.zIndex}function Ie(H,T,b){if(b===void 0&&(b=!0),ie.forEach(function(_){_[H]&&_[H].apply(_,T)}),b){var m;(m=V.props)[H].apply(m,T)}}function Re(){var H=V.props.aria;if(H.content){var T="aria-"+H.content,b=X.id,m=lk(V.props.triggerTarget||t);m.forEach(function(_){var C=_.getAttribute(T);if(V.state.isVisible)_.setAttribute(T,C?C+" "+b:b);else{var D=C&&C.replace(b,"").trim();D?_.setAttribute(T,D):_.removeAttribute(T)}})}}function Oe(){if(!(ce||!V.props.aria.expanded)){var H=lk(V.props.triggerTarget||t);H.forEach(function(T){V.props.interactive?T.setAttribute("aria-expanded",V.state.isVisible&&T===Pe()?"true":"false"):T.removeAttribute("aria-expanded")})}}function Ge(){ke().removeEventListener("mousemove",x),dhe=dhe.filter(function(H){return H!==x})}function Be(H){if(!(JT.isTouch&&(l||H.type==="mousedown"))){var T=H.composedPath&&H.composedPath()[0]||H.target;if(!(V.props.interactive&&Fht(X,T))){if(lk(V.props.triggerTarget||t).some(function(b){return Fht(b,T)})){if(JT.isTouch||V.state.isVisible&&V.props.trigger.indexOf("click")>=0)return}else Ie("onClickOutside",[V,H]);V.props.hideOnClick===!0&&(V.clearDelayTimeouts(),V.hide(),a=!0,setTimeout(function(){a=!1}),V.state.isMounted||mt())}}}function qe(){l=!0}function et(){l=!1}function Ze(){var H=ke();H.addEventListener("mousedown",Be,!0),H.addEventListener("touchend",Be,ak),H.addEventListener("touchstart",et,ak),H.addEventListener("touchmove",qe,ak)}function mt(){var H=ke();H.removeEventListener("mousedown",Be,!0),H.removeEventListener("touchend",Be,ak),H.removeEventListener("touchstart",et,ak),H.removeEventListener("touchmove",qe,ak)}function Pt(H,T){Ct(H,function(){!V.state.isVisible&&X.parentNode&&X.parentNode.contains(X)&&T()})}function $t(H,T){Ct(H,T)}function Ct(H,T){var b=J().box;function m(_){_.target===b&&(b3e(b,"remove",m),T())}if(H===0)return T();b3e(b,"remove",p),b3e(b,"add",m),p=m}function Et(H,T,b){b===void 0&&(b=!1);var m=lk(V.props.triggerTarget||t);m.forEach(function(_){_.addEventListener(H,T,b),v.push({node:_,eventType:H,handler:T,options:b})})}function Ft(){_e()&&(Et("touchstart",Te,{passive:!0}),Et("touchend",pt,{passive:!0})),S2i(V.props.trigger).forEach(function(H){if(H!=="manual")switch(Et(H,Te),H){case"mouseenter":Et("mouseleave",pt);break;case"focus":Et(D2i?"focusout":"blur",kt);break;case"focusin":Et("focusout",kt);break}})}function ot(){v.forEach(function(H){var T=H.node,b=H.eventType,m=H.handler,_=H.options;T.removeEventListener(b,m,_)}),v=[]}function Te(H){var T,b=!1;if(!(!V.state.isEnabled||ct(H)||a)){var m=((T=h)==null?void 0:T.type)==="focus";h=H,I=H.currentTarget,Oe(),!V.state.isVisible&&v3e(H)&&dhe.forEach(function(_){return _(H)}),H.type==="click"&&(V.props.trigger.indexOf("mouseenter")<0||o)&&V.props.hideOnClick!==!1&&V.state.isVisible?b=!0:pe(H),H.type==="click"&&(o=!b),b&&!m&&Ae(H)}}function je(H){var T=H.target,b=Pe().contains(T)||X.contains(T);if(!(H.type==="mousemove"&&b)){var m=Ne().concat(X).map(function(_){var C,D=_._tippy,L=(C=D.popperInstance)==null?void 0:C.state;return L?{popperRect:_.getBoundingClientRect(),popperState:L,props:i}:null}).filter(Boolean);A2i(m,H)&&(Ge(),Ae(H))}}function pt(H){var T=ct(H)||V.props.trigger.indexOf("click")>=0&&o;if(!T){if(V.props.interactive){V.hideWithInteractivity(H);return}Ae(H)}}function kt(H){V.props.trigger.indexOf("focusin")<0&&H.target!==Pe()||V.props.interactive&&H.relatedTarget&&X.contains(H.relatedTarget)||Ae(H)}function ct(H){return JT.isTouch?_e()!==H.type.indexOf("touch")>=0:!1}function ae(){ht();var H=V.props,T=H.popperOptions,b=H.placement,m=H.offset,_=H.getReferenceClientRect,C=H.moveTransition,D=xe()?hhe(X).arrow:null,L=_?{getBoundingClientRect:_,contextElement:_.contextElement||Pe()}:t,B={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(oe){var le=oe.state;if(xe()){var be=J(),Me=be.box;["placement","reference-hidden","escaped"].forEach(function(Ye){Ye==="placement"?Me.setAttribute("data-placement",le.placement):le.attributes.popper["data-popper-"+Ye]?Me.setAttribute("data-"+Ye,""):Me.removeAttribute("data-"+Ye)}),le.attributes.popper={}}}},q=[{name:"offset",options:{offset:m}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!C}},B];xe()&&D&&q.push({name:"arrow",options:{element:D,padding:3}}),q.push.apply(q,T?.modifiers||[]),V.popperInstance=b2i(L,X,Object.assign({},T,{placement:b,onFirstUpdate:y,modifiers:q}))}function ht(){V.popperInstance&&(V.popperInstance.destroy(),V.popperInstance=null)}function wt(){var H=V.props.appendTo,T,b=Pe();V.props.interactive&&H===Iht||H==="parent"?T=b.parentNode:T=Aht(H,[b]),T.contains(X)||T.appendChild(X),V.state.isMounted=!0,ae()}function Ne(){return gj(X.querySelectorAll("[data-tippy-root]"))}function pe(H){V.clearDelayTimeouts(),H&&Ie("onTrigger",[V,H]),Ze();var T=de(!0),b=he(),m=b[0],_=b[1];JT.isTouch&&m==="hold"&&_&&(T=_),T?r=setTimeout(function(){V.show()},T):V.show()}function Ae(H){if(V.clearDelayTimeouts(),Ie("onUntrigger",[V,H]),!V.state.isVisible){mt();return}if(!(V.props.trigger.indexOf("mouseenter")>=0&&V.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(H.type)>=0&&o)){var T=de(!1);T?n=setTimeout(function(){V.state.isVisible&&V.hide()},T):s=requestAnimationFrame(function(){V.hide()})}}function tt(){V.state.isEnabled=!0}function gt(){V.hide(),V.state.isEnabled=!1}function ze(){clearTimeout(r),clearTimeout(n),cancelAnimationFrame(s)}function Ot(H){if(!V.state.isDestroyed){Ie("onBeforeUpdate",[V,H]),ot();var T=V.props,b=$ht(t,Object.assign({},T,Mht(H),{ignoreAttributes:!0}));V.props=b,Ft(),T.interactiveDebounce!==b.interactiveDebounce&&(Ge(),x=Pht(je,b.interactiveDebounce)),T.triggerTarget&&!b.triggerTarget?lk(T.triggerTarget).forEach(function(m){m.removeAttribute("aria-expanded")}):b.triggerTarget&&t.removeAttribute("aria-expanded"),Oe(),Se(),Z&&Z(T,b),V.popperInstance&&(ae(),Ne().forEach(function(m){requestAnimationFrame(m._tippy.popperInstance.forceUpdate)})),Ie("onAfterUpdate",[V,H])}}function jt(H){V.setProps({content:H})}function nt(){var H=V.state.isVisible,T=V.state.isDestroyed,b=!V.state.isEnabled,m=JT.isTouch&&!V.props.touch,_=g3e(V.props.duration,0,tS.duration);if(!(H||T||b||m)&&!Pe().hasAttribute("disabled")&&(Ie("onShow",[V],!1),V.props.onShow(V)!==!1)){if(V.state.isVisible=!0,xe()&&(X.style.visibility="visible"),Se(),Ze(),V.state.isMounted||(X.style.transition="none"),xe()){var C=J(),D=C.box,L=C.content;_3e([D,L],0)}y=function(){var q;if(!(!V.state.isVisible||c)){if(c=!0,X.offsetHeight,X.style.transition=V.props.moveTransition,xe()&&V.props.animation){var Q=J(),oe=Q.box,le=Q.content;_3e([oe,le],_),LK([oe,le],"visible")}Re(),Oe(),Oht(x3e,V),(q=V.popperInstance)==null||q.forceUpdate(),Ie("onMount",[V]),V.props.animation&&xe()&&$t(_,function(){V.state.isShown=!0,Ie("onShown",[V])})}},wt()}}function $e(){var H=!V.state.isVisible,T=V.state.isDestroyed,b=!V.state.isEnabled,m=g3e(V.props.duration,1,tS.duration);if(!(H||T||b)&&(Ie("onHide",[V],!1),V.props.onHide(V)!==!1)){if(V.state.isVisible=!1,V.state.isShown=!1,c=!1,o=!1,xe()&&(X.style.visibility="hidden"),Ge(),mt(),Se(!0),xe()){var _=J(),C=_.box,D=_.content;V.props.animation&&(_3e([C,D],m),LK([C,D],"hidden"))}Re(),Oe(),V.props.animation?xe()&&Pt(m,V.unmount):V.unmount()}}function Xt(H){ke().addEventListener("mousemove",x),Oht(dhe,x),x(H)}function A(){V.state.isVisible&&V.hide(),V.state.isMounted&&(ht(),Ne().forEach(function(H){H._tippy.unmount()}),X.parentNode&&X.parentNode.removeChild(X),x3e=x3e.filter(function(H){return H!==V}),V.state.isMounted=!1,Ie("onHidden",[V]))}function ye(){V.state.isDestroyed||(V.clearDelayTimeouts(),V.unmount(),ot(),delete t._tippy,V.state.isDestroyed=!0,Ie("onDestroy",[V]))}}function Fo(t,e){e===void 0&&(e={});var i=tS.plugins.concat(e.plugins||[]);R2i();var r=Object.assign({},e,{plugins:i}),n=I2i(t),s=n.reduce(function(o,a){var l=a&&j2i(a,r);return l&&o.push(l),o},[]);return che(t)?s[0]:s}Fo.defaultProps=tS,Fo.setDefaultProps=k2i,Fo.currentInput=JT;var G2i=Object.assign({},lht,{effect:function(e){var i=e.state,r={popper:{position:i.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(i.elements.popper.style,r.popper),i.styles=r,i.elements.arrow&&Object.assign(i.elements.arrow.style,r.arrow)}}),U2i=function(e,i){var r;i===void 0&&(i={});var n=e,s=[],o=[],a,l=i.overrides,c=[],h=!1;function p(){o=n.map(function(V){return lk(V.props.triggerTarget||V.reference)}).reduce(function(V,Y){return V.concat(Y)},[])}function y(){s=n.map(function(V){return V.reference})}function v(V){n.forEach(function(Y){V?Y.enable():Y.disable()})}function x(V){return n.map(function(Y){var X=Y.setProps;return Y.setProps=function(Z){X(Z),Y.reference===a&&V.setProps(Z)},function(){Y.setProps=X}})}function I(V,Y){var X=o.indexOf(Y);if(Y!==a){a=Y;var Z=(l||[]).concat("content").reduce(function(ie,ce){return ie[ce]=n[X].props[ce],ie},{});V.setProps(Object.assign({},Z,{getReferenceClientRect:typeof Z.getReferenceClientRect=="function"?Z.getReferenceClientRect:function(){var ie;return(ie=s[X])==null?void 0:ie.getBoundingClientRect()}}))}}v(!1),y(),p();var P={fn:function(){return{onDestroy:function(){v(!0)},onHidden:function(){a=null},onClickOutside:function(X){X.props.showOnCreate&&!h&&(h=!0,a=null)},onShow:function(X){X.props.showOnCreate&&!h&&(h=!0,I(X,s[0]))},onTrigger:function(X,Z){I(X,Z.currentTarget)}}}},F=Fo(uk(),Object.assign({},x2i(i,["overrides"]),{plugins:[P].concat(i.plugins||[]),triggerTarget:o,popperOptions:Object.assign({},i.popperOptions,{modifiers:[].concat(((r=i.popperOptions)==null?void 0:r.modifiers)||[],[G2i])})})),k=F.show;F.show=function(V){if(k(),!a&&V==null)return I(F,s[0]);if(!(a&&V==null)){if(typeof V=="number")return s[V]&&I(F,s[V]);if(n.indexOf(V)>=0){var Y=V.reference;return I(F,Y)}if(s.indexOf(V)>=0)return I(F,V)}},F.showNext=function(){var V=s[0];if(!a)return F.show(0);var Y=s.indexOf(a);F.show(s[Y+1]||V)},F.showPrevious=function(){var V=s[s.length-1];if(!a)return F.show(V);var Y=s.indexOf(a),X=s[Y-1]||V;F.show(X)};var j=F.setProps;return F.setProps=function(V){l=V.overrides||l,j(V)},F.setInstances=function(V){v(!0),c.forEach(function(Y){return Y()}),n=V,v(!1),y(),p(),c=x(F),F.setProps({triggerTarget:o})},c=x(F),F},z2i={name:"animateFill",defaultValue:!1,fn:function(e){var i;if(!((i=e.props.render)!=null&&i.$$tippy))return{};var r=hhe(e.popper),n=r.box,s=r.content,o=e.props.animateFill?H2i():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,c=Number(l.replace("ms",""));s.style.transitionDelay=Math.round(c/10)+"ms",o.style.transitionDuration=l,LK([o],"visible")}},onShow:function(){o&&(o.style.transitionDuration="0ms")},onHide:function(){o&&LK([o],"hidden")}}}};function H2i(){var t=uk();return t.className=Cht,LK([t],"hidden"),t}var S3e={clientX:0,clientY:0},phe=[];function Ght(t){var e=t.clientX,i=t.clientY;S3e={clientX:e,clientY:i}}function W2i(t){t.addEventListener("mousemove",Ght)}function q2i(t){t.removeEventListener("mousemove",Ght)}var Y2i={name:"followCursor",defaultValue:!1,fn:function(e){var i=e.reference,r=Dht(e.props.triggerTarget||i),n=!1,s=!1,o=!0,a=e.props;function l(){return e.props.followCursor==="initial"&&e.state.isVisible}function c(){r.addEventListener("mousemove",y)}function h(){r.removeEventListener("mousemove",y)}function p(){n=!0,e.setProps({getReferenceClientRect:null}),n=!1}function y(I){var P=I.target?i.contains(I.target):!0,F=e.props.followCursor,k=I.clientX,j=I.clientY,V=i.getBoundingClientRect(),Y=k-V.left,X=j-V.top;(P||!e.props.interactive)&&e.setProps({getReferenceClientRect:function(){var ie=i.getBoundingClientRect(),ce=k,he=j;F==="initial"&&(ce=ie.left+Y,he=ie.top+X);var _e=F==="horizontal"?ie.top:he,xe=F==="vertical"?ie.right:ce,Pe=F==="horizontal"?ie.bottom:he,ke=F==="vertical"?ie.left:ce;return{width:xe-ke,height:Pe-_e,top:_e,right:xe,bottom:Pe,left:ke}}})}function v(){e.props.followCursor&&(phe.push({instance:e,doc:r}),W2i(r))}function x(){phe=phe.filter(function(I){return I.instance!==e}),phe.filter(function(I){return I.doc===r}).length===0&&q2i(r)}return{onCreate:v,onDestroy:x,onBeforeUpdate:function(){a=e.props},onAfterUpdate:function(P,F){var k=F.followCursor;n||k!==void 0&&a.followCursor!==k&&(x(),k?(v(),e.state.isMounted&&!s&&!l()&&c()):(h(),p()))},onMount:function(){e.props.followCursor&&!s&&(o&&(y(S3e),o=!1),l()||c())},onTrigger:function(P,F){v3e(F)&&(S3e={clientX:F.clientX,clientY:F.clientY}),s=F.type==="focus"},onHidden:function(){e.props.followCursor&&(p(),h(),o=!0)}}}};function X2i(t,e){var i;return{popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((((i=t.popperOptions)==null?void 0:i.modifiers)||[]).filter(function(r){var n=r.name;return n!==e.name}),[e])})}}var K2i={name:"inlinePositioning",defaultValue:!1,fn:function(e){var i=e.reference;function r(){return!!e.props.inlinePositioning}var n,s=-1,o=!1,a=[],l={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(v){var x=v.state;r()&&(a.indexOf(x.placement)!==-1&&(a=[]),n!==x.placement&&a.indexOf(x.placement)===-1&&(a.push(x.placement),e.setProps({getReferenceClientRect:function(){return c(x.placement)}})),n=x.placement)}};function c(y){return J2i(Rht(y),i.getBoundingClientRect(),gj(i.getClientRects()),s)}function h(y){o=!0,e.setProps(y),o=!1}function p(){o||h(X2i(e.props,l))}return{onCreate:p,onAfterUpdate:p,onTrigger:function(v,x){if(v3e(x)){var I=gj(e.reference.getClientRects()),P=I.find(function(k){return k.left-2<=x.clientX&&k.right+2>=x.clientX&&k.top-2<=x.clientY&&k.bottom+2>=x.clientY}),F=I.indexOf(P);s=F>-1?F:s}},onHidden:function(){s=-1}}}};function J2i(t,e,i,r){if(i.length<2||t===null)return e;if(i.length===2&&r>=0&&i[0].left>i[1].right)return i[r]||e;switch(t){case"top":case"bottom":{var n=i[0],s=i[i.length-1],o=t==="top",a=n.top,l=s.bottom,c=o?n.left:s.left,h=o?n.right:s.right,p=h-c,y=l-a;return{top:a,bottom:l,left:c,right:h,width:p,height:y}}case"left":case"right":{var v=Math.min.apply(Math,i.map(function(X){return X.left})),x=Math.max.apply(Math,i.map(function(X){return X.right})),I=i.filter(function(X){return t==="left"?X.left===v:X.right===x}),P=I[0].top,F=I[I.length-1].bottom,k=v,j=x,V=j-k,Y=F-P;return{top:P,bottom:F,left:k,right:j,width:V,height:Y}}default:return e}}var Z2i={name:"sticky",defaultValue:!1,fn:function(e){var i=e.reference,r=e.popper;function n(){return e.popperInstance?e.popperInstance.state.elements.reference:i}function s(c){return e.props.sticky===!0||e.props.sticky===c}var o=null,a=null;function l(){var c=s("reference")?n().getBoundingClientRect():null,h=s("popper")?r.getBoundingClientRect():null;(c&&Uht(o,c)||h&&Uht(a,h))&&e.popperInstance&&e.popperInstance.update(),o=c,a=h,e.state.isMounted&&requestAnimationFrame(l)}return{onMount:function(){e.props.sticky&&l()}}}};function Uht(t,e){return t&&e?t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom||t.left!==e.left:!0}Fo.setDefaultProps({render:jht}),Fo.setDefaultProps({onShow:t=>{if(!t.props.content)return!1}});function C3e(t,e={},i={mount:!0}){const r=Up(),n=Mi(),s=Mi({isEnabled:!1,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1});let o=null;const a=()=>o||(o=document.createDocumentFragment(),o),l=X=>{let Z,ie=Ic(X)?X.value:X;if(BT(ie))r&&(ie.appContext=r.appContext),K2(ie,a()),Z=()=>a();else if(typeof ie=="object"){let ce=Y2(ie);r&&(ce.appContext=r.appContext),K2(ce,a()),Z=()=>a()}else Z=ie;return Z},c=X=>{let Z={};return Ic(X)?Z=X.value||{}:Rw(X)?Z={...X}:Z={...X},Z.content&&(Z.content=l(Z.content)),Z.triggerTarget&&(Z.triggerTarget=Ic(Z.triggerTarget)?Z.triggerTarget.value:Z.triggerTarget),(!Z.plugins||!Array.isArray(Z.plugins))&&(Z.plugins=[]),Z.plugins=Z.plugins.filter(ie=>ie.name!=="vueTippyReactiveState"),Z.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}})}),Z},h=()=>{n.value&&n.value.setProps(c(e))},p=()=>{!n.value||!e.content||n.value.setContent(l(e.content))},y=X=>{var Z;(Z=n.value)===null||Z===void 0||Z.setContent(l(X))},v=X=>{var Z;(Z=n.value)===null||Z===void 0||Z.setProps(c(X))},x=()=>{n.value&&(n.value.destroy(),n.value=void 0),o=null},I=()=>{var X;(X=n.value)===null||X===void 0||X.show()},P=()=>{var X;(X=n.value)===null||X===void 0||X.hide()},F=()=>{var X;(X=n.value)===null||X===void 0||X.disable(),s.value.isEnabled=!1},k=()=>{var X;(X=n.value)===null||X===void 0||X.enable(),s.value.isEnabled=!0},j=()=>{var X;(X=n.value)===null||X===void 0||X.unmount()},V=()=>{if(!t)return;let X=Ic(t)?t.value:t;typeof X=="function"&&(X=X()),X&&(n.value=Fo(X,c(e)),X.$tippy=Y)},Y={tippy:n,refresh:h,refreshContent:p,setContent:y,setProps:v,destroy:x,hide:P,show:I,disable:F,enable:k,unmount:j,mount:V,state:s};return i.mount&&(r?(r.isMounted?V():Ja(V),XN(()=>{x()})):V()),Ic(e)||Rw(e)?bu(e,h,{immediate:!1}):Ic(e.content)&&bu(e.content,p,{immediate:!1}),Y}function Q2i(t,e){const i=Mi();return Ja(()=>{const n=(Array.isArray(t)?t.map(s=>s.value):typeof t=="function"?t():t.value).map(s=>s instanceof Element?s._tippy:s).filter(Boolean);i.value=U2i(n,e?{allowHTML:!0,...e}:{allowHTML:!0})}),{singleton:i}}const eSi=an({props:{to:{type:[String,Function]},tag:{type:String,default:"span"},contentTag:{type:String,default:"span"},contentClass:{type:String,default:null},appendTo:{default:()=>Fo.defaultProps.appendTo},aria:{default:()=>Fo.defaultProps.aria},delay:{default:()=>Fo.defaultProps.delay},duration:{default:()=>Fo.defaultProps.duration},getReferenceClientRect:{default:()=>Fo.defaultProps.getReferenceClientRect},hideOnClick:{type:[Boolean,String],default:()=>Fo.defaultProps.hideOnClick},ignoreAttributes:{type:Boolean,default:()=>Fo.defaultProps.ignoreAttributes},interactive:{type:Boolean,default:()=>Fo.defaultProps.interactive},interactiveBorder:{default:()=>Fo.defaultProps.interactiveBorder},interactiveDebounce:{default:()=>Fo.defaultProps.interactiveDebounce},moveTransition:{default:()=>Fo.defaultProps.moveTransition},offset:{default:()=>Fo.defaultProps.offset},onAfterUpdate:{default:()=>Fo.defaultProps.onAfterUpdate},onBeforeUpdate:{default:()=>Fo.defaultProps.onBeforeUpdate},onCreate:{default:()=>Fo.defaultProps.onCreate},onDestroy:{default:()=>Fo.defaultProps.onDestroy},onHidden:{default:()=>Fo.defaultProps.onHidden},onHide:{default:()=>Fo.defaultProps.onHide},onMount:{default:()=>Fo.defaultProps.onMount},onShow:{default:()=>Fo.defaultProps.onShow},onShown:{default:()=>Fo.defaultProps.onShown},onTrigger:{default:()=>Fo.defaultProps.onTrigger},onUntrigger:{default:()=>Fo.defaultProps.onUntrigger},onClickOutside:{default:()=>Fo.defaultProps.onClickOutside},placement:{default:()=>Fo.defaultProps.placement},plugins:{default:()=>Fo.defaultProps.plugins},popperOptions:{default:()=>Fo.defaultProps.popperOptions},render:{default:()=>Fo.defaultProps.render},showOnCreate:{type:Boolean,default:()=>Fo.defaultProps.showOnCreate},touch:{type:[Boolean,String,Array],default:()=>Fo.defaultProps.touch},trigger:{default:()=>Fo.defaultProps.trigger},triggerTarget:{default:()=>Fo.defaultProps.triggerTarget},animateFill:{type:Boolean,default:()=>Fo.defaultProps.animateFill},followCursor:{type:[Boolean,String],default:()=>Fo.defaultProps.followCursor},inlinePositioning:{type:Boolean,default:()=>Fo.defaultProps.inlinePositioning},sticky:{type:[Boolean,String],default:()=>Fo.defaultProps.sticky},allowHTML:{type:Boolean,default:()=>Fo.defaultProps.allowHTML},animation:{default:()=>Fo.defaultProps.animation},arrow:{default:()=>Fo.defaultProps.arrow},content:{default:()=>Fo.defaultProps.content},inertia:{default:()=>Fo.defaultProps.inertia},maxWidth:{default:()=>Fo.defaultProps.maxWidth},role:{default:()=>Fo.defaultProps.role},theme:{default:()=>Fo.defaultProps.theme},zIndex:{default:()=>Fo.defaultProps.zIndex}},emits:["state"],setup(t,{slots:e,emit:i,expose:r}){const n=Mi(),s=Mi(),o=Mi(!1),a=()=>{let p={...t};for(const y of["to","tag","contentTag","contentClass"])p.hasOwnProperty(y)&&delete p[y];return p};let l=n;t.to&&(typeof Element<"u"&&t.to instanceof Element?l=()=>t.to:(typeof t.to=="string"||t.to instanceof String)&&(l=()=>document.querySelector(t.to)));const c=C3e(l,a());Ja(()=>{o.value=!0,v0(()=>{e.content&&c.setContent(()=>s.value)})}),bu(c.state,()=>{i("state",vi(c.state))},{immediate:!0,deep:!0}),bu(()=>t,()=>{c.setProps(a()),e.content&&c.setContent(()=>s.value)},{deep:!0});let h=Fl({elem:n,contentElem:s,mounted:o,...c});return r(h),()=>{const p=e.default?e.default(h):[];return Y2(t.tag,{ref:n,"data-v-tippy":""},e.content?[p,Y2(t.contentTag,{ref:s,style:{display:o.value?"inherit":"none"},class:t.contentClass},e.content(h))]:p)}}}),tSi=["a11y","allowHTML","arrow","flip","flipOnUpdate","hideOnClick","ignoreAttributes","inertia","interactive","lazy","multiple","showOnInit","touch","touchHold"];let T3e={};Object.keys(Fo.defaultProps).forEach(t=>{tSi.includes(t)?T3e[t]={type:Boolean,default:function(){return Fo.defaultProps[t]}}:T3e[t]={default:function(){return Fo.defaultProps[t]}}});const iSi=an({props:T3e,setup(t){const e=Mi([]),{singleton:i}=Q2i(e,t);return{instances:e,singleton:i}},mounted(){var t;const i=this.$el.parentElement.querySelectorAll("[data-v-tippy]");this.instances=Array.from(i).map(r=>r._tippy).filter(Boolean),(t=this.singleton)===null||t===void 0||t.setInstances(this.instances)},render(){let t=this.$slots.default?this.$slots.default():[];return Y2(()=>t)}}),rSi={mounted(t,e,i){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),i.props&&i.props.onTippyShow&&(r.onShow=function(...a){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyShow(...a)}),i.props&&i.props.onTippyShown&&(r.onShown=function(...a){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyShown(...a)}),i.props&&i.props.onTippyHidden&&(r.onHidden=function(...a){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyHidden(...a)}),i.props&&i.props.onTippyHide&&(r.onHide=function(...a){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyHide(...a)}),i.props&&i.props.onTippyMount&&(r.onMount=function(...a){var l;return(l=i.props)===null||l===void 0?void 0:l.onTippyMount(...a)}),t.getAttribute("title")&&!r.content&&(r.content=t.getAttribute("title"),t.removeAttribute("title")),t.getAttribute("content")&&!r.content&&(r.content=t.getAttribute("content")),C3e(t,r)},unmounted(t){t.$tippy?t.$tippy.destroy():t._tippy&&t._tippy.destroy()},updated(t,e){const i=typeof e.value=="string"?{content:e.value}:e.value||{};t.getAttribute("title")&&!i.content&&(i.content=t.getAttribute("title"),t.removeAttribute("title")),t.getAttribute("content")&&!i.content&&(i.content=t.getAttribute("content")),t.$tippy?t.$tippy.setProps(i||{}):t._tippy&&t._tippy.setProps(i||{})}},nSi={install(t,e={}){Fo.setDefaultProps(e.defaultProps||{}),t.directive(e.directive||"tippy",rSi),t.component(e.component||"tippy",eSi),t.component(e.componentSingleton||"tippy-singleton",iSi)}},zht=Fo.setDefaultProps;zht({ignoreAttributes:!0,plugins:[Z2i,K2i,Y2i,z2i]});const sSi=nSi,oSi=an({name:"App",components:{Shell:mxi},setup(){const t=Up();Ja(()=>{new Mct().observe(t?.proxy?.$refs["app-size"]),zht({aria:{content:"labelledby"},theme:"ramp4",animation:"scale",inertia:!0,trigger:"mouseenter manual focus",touch:["hold",200],delay:[300,0],appendTo:t?.proxy?.$el})})}}),HFr="",aSi=["lang"],lSi={class:"h-full",ref:"app-size"};function uSi(t,e,i,r,n,s){const o=Vo("shell");return Qt(),hi("div",{class:"ramp-app ramp-styles animation-enabled",lang:t.$i18n.locale},[Dt("div",lSi,[Un(o)],512)],8,aSi)}const cSi=Nl(oSi,[["render",uSi]]),ZT="focus-list",ck="focus-item",hSi="focus-icon",yj=`[${ZT}],[focus-container]`,fhe="truncate-text",mhe="show-truncate",vj="focused",Hht=`button,input,select,a,textarea,[contenteditable],[${ZT}],[${hSi}]`,dSi={mounted(t,e){+t.getAttribute("tabindex")<=0&&t.setAttribute("tabindex","0"),t.toggleAttribute(ZT,!0),new pSi(t,e.value)},updated(t){Wht(t)}};function Wht(t){t.querySelectorAll(Hht).forEach(i=>{if(i.closest(yj)===t||i.closest(yj)===i&&i.parentElement.closest(yj)===t)if(i.closest(`[${ZT}],.${vj}`).classList.contains(vj))i.setAttribute("tabindex","0");else{i.setAttribute("tabindex","-1");return}})}class pSi{element;highlightedItem;isHorizontal;isClicked;isTapped;constructor(e,i){this.element=e,this.highlightedItem=this.element,this.isHorizontal=i==="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,i=this.element){i.querySelectorAll(Hht).forEach(n=>{(e===-1||n.closest(yj)===this.element||n.closest(yj)===n&&n.parentElement.closest(yj)===this.element||n.closest(`[${ZT}],.${vj}`).classList.contains(vj))&&n.setAttribute("tabindex",e.toString())})}defocusItem(e){e.classList.remove(vj),this.setTabIndex(-1,e),e._tippy&&e._tippy.hide(),e.getAttribute(ck)===mhe&&e.querySelector(`[${fhe}]`)?._tippy?.hide()}focusItem(e){e.classList.add(vj),this.setAriaActiveDescendant(e),this.setTabIndex(0,e),e.scrollIntoView({block:"nearest"}),e._tippy&&!this.isTapped&&e._tippy.show(),e.getAttribute(ck)===mhe&&e.querySelector(`[${fhe}]`)?._tippy?.show(),this.isTapped=!1}setAriaActiveDescendant(e){this.element.setAttribute("aria-activedescendant",e.getAttribute("id"))}shiftHighlight(e,i=!1){if(this.defocusItem(this.highlightedItem),i)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 i=this,r=Array.prototype.filter.call(this.element.querySelectorAll(`[${ck}]`),n=>n.closest(`[${ZT}]`)===i.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 i=e.target;if(!i.hasAttribute(ZT))for(;i.parentElement.closest(`[${ZT}]`)!==this.element;)i=i.parentElement.closest(`[${ZT}]`);this.highlightedItem=i.closest(`[${ck}]`)||i.closest(`[${ZT}]`)||this.highlightedItem,i.hasAttribute(`${ck}`)&&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(ck)===mhe&&this.highlightedItem.querySelector(`[${fhe}]`)?._tippy?.show()),this.isClicked=!1,this.element.hasAttribute("aria-activedescendant")||this.highlightedItem===this.element||this.setAriaActiveDescendant(this.highlightedItem),Wht(this.element)}onBlur(){this.highlightedItem&&(this.highlightedItem._tippy&&this.highlightedItem._tippy.hide(),this.highlightedItem.getAttribute(ck)===mhe&&this.highlightedItem.querySelector(`[${fhe}]`)?._tippy?.hide())}onMousedown(){this.isClicked=!0}onTouchstart(){this.isTapped=!0}}const qht="focus-item",fSi={beforeMount(t,e){t.hasAttribute("id")||t.setAttribute("id",mSi()),e.value?t.setAttribute(qht,e.value):t.toggleAttribute(qht,!0)}};function mSi(){let t;do t="focus-item-"+Math.random().toString(36).substring(2,9);while(document.getElementById(t)!==null);return t}const E3e="focus-container",Yht="focus-list",gSi="focus-icon",I3e=`[${Yht}],[${E3e}]`,Xht=`button,input,select,a,textarea,[contenteditable],.ag-tab-guard,[${Yht}],[${E3e}],[${gSi}]`;let A3e=[];const ySi={mounted(t){[...document.querySelectorAll(".inner-shell")].some(i=>i.contains(t))&&A3e.push(new vSi(t))},beforeUnmount(t){A3e=A3e.filter(e=>e.element===t?(e.removeEventListeners(),!1):!0)}};class vSi{element;constructor(e){this.element=e,this.element.toggleAttribute(E3e,!0),this.element.tabIndex=0,this.disableTabbing();const i=this;this.element.addEventListener("keypress",function(r){i.onKeypress(r)}),this.element.addEventListener("click",function(){i.onClick()}),this.element.addEventListener("focusout",function(r){i.onFocusOut(r)}),this.element.addEventListener("focus",function(){i.onFocus()})}removeEventListeners(){const e=this;this.element.removeEventListener("keypress",function(i){e.onKeypress(i)}),this.element.removeEventListener("click",function(){e.onClick()}),this.element.removeEventListener("focusout",function(i){e.onFocusOut(i)}),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(Xht),()=>!0).forEach(i=>{i.tabIndex=-1})}enableTabbing(){let e;return Array.prototype.map.call(this.element.querySelectorAll(Xht),i=>{(i.closest(I3e)===this.element||i.closest(I3e)===i&&i.parentElement.closest(I3e)===this.element)&&i.offsetParent&&(i.tabIndex=0,e===void 0&&(e=i))}),e}}const _Si="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",bSi="ελ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",_j=(t,e)=>{for(const i in e)t[i]=e[i];return t},P3e="numeric",O3e="ascii",R3e="alpha",ghe="asciinumeric",yhe="alphanumeric",M3e="domain",Kht="emoji",wSi="scheme",xSi="slashscheme",Jht="whitespace";function SSi(t,e){return t in e||(e[t]=[]),e[t]}function hk(t,e,i){e[P3e]&&(e[ghe]=!0,e[yhe]=!0),e[O3e]&&(e[ghe]=!0,e[R3e]=!0),e[ghe]&&(e[yhe]=!0),e[R3e]&&(e[yhe]=!0),e[yhe]&&(e[M3e]=!0),e[Kht]&&(e[M3e]=!0);for(const r in e){const n=SSi(r,i);n.indexOf(t)<0&&n.push(t)}}function CSi(t,e){const i={};for(const r in e)e[r].indexOf(t)>=0&&(i[r]=!0);return i}function cb(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}cb.groups={},cb.prototype={accepts(){return!!this.t},go(t){const e=this,i=e.j[t];if(i)return i;for(let r=0;rt.ta(e,i,r,n),zw=(t,e,i,r,n)=>t.tr(e,i,r,n),Zht=(t,e,i,r,n)=>t.ts(e,i,r,n),Nn=(t,e,i,r,n)=>t.tt(e,i,r,n),FP="WORD",D3e="UWORD",NK="LOCALHOST",F3e="TLD",L3e="UTLD",vhe="SCHEME",bj="SLASH_SCHEME",_he="NUM",Qht="WS",N3e="NL",wj="OPENBRACE",kK="OPENBRACKET",$K="OPENANGLEBRACKET",BK="OPENPAREN",dk="CLOSEBRACE",xj="CLOSEBRACKET",Sj="CLOSEANGLEBRACKET",pk="CLOSEPAREN",bhe="AMPERSAND",whe="APOSTROPHE",xhe="ASTERISK",dD="AT",She="BACKSLASH",Che="BACKTICK",The="CARET",pD="COLON",k3e="COMMA",Ehe="DOLLAR",QT="DOT",Ihe="EQUALS",$3e="EXCLAMATION",eE="HYPHEN",Ahe="PERCENT",Phe="PIPE",Ohe="PLUS",Rhe="POUND",Mhe="QUERY",B3e="QUOTE",V3e="SEMI",LP="SLASH",VK="TILDE",Dhe="UNDERSCORE",edt="EMOJI",Fhe="SYM";var tdt=Object.freeze({__proto__:null,WORD:FP,UWORD:D3e,LOCALHOST:NK,TLD:F3e,UTLD:L3e,SCHEME:vhe,SLASH_SCHEME:bj,NUM:_he,WS:Qht,NL:N3e,OPENBRACE:wj,OPENBRACKET:kK,OPENANGLEBRACKET:$K,OPENPAREN:BK,CLOSEBRACE:dk,CLOSEBRACKET:xj,CLOSEANGLEBRACKET:Sj,CLOSEPAREN:pk,AMPERSAND:bhe,APOSTROPHE:whe,ASTERISK:xhe,AT:dD,BACKSLASH:She,BACKTICK:Che,CARET:The,COLON:pD,COMMA:k3e,DOLLAR:Ehe,DOT:QT,EQUALS:Ihe,EXCLAMATION:$3e,HYPHEN:eE,PERCENT:Ahe,PIPE:Phe,PLUS:Ohe,POUND:Rhe,QUERY:Mhe,QUOTE:B3e,SEMI:V3e,SLASH:LP,TILDE:VK,UNDERSCORE:Dhe,EMOJI:edt,SYM:Fhe});const Cj=/[a-z]/,j3e=/\p{L}/u,G3e=/\p{Emoji}/u,U3e=/\d/,idt=/\s/,rdt=` +`,TSi="️",ESi="‍";let Lhe=null,Nhe=null;function ISi(t){t===void 0&&(t=[]);const e={};cb.groups=e;const i=new cb;Lhe==null&&(Lhe=ndt(_Si)),Nhe==null&&(Nhe=ndt(bSi)),Nn(i,"'",whe),Nn(i,"{",wj),Nn(i,"[",kK),Nn(i,"<",$K),Nn(i,"(",BK),Nn(i,"}",dk),Nn(i,"]",xj),Nn(i,">",Sj),Nn(i,")",pk),Nn(i,"&",bhe),Nn(i,"*",xhe),Nn(i,"@",dD),Nn(i,"`",Che),Nn(i,"^",The),Nn(i,":",pD),Nn(i,",",k3e),Nn(i,"$",Ehe),Nn(i,".",QT),Nn(i,"=",Ihe),Nn(i,"!",$3e),Nn(i,"-",eE),Nn(i,"%",Ahe),Nn(i,"|",Phe),Nn(i,"+",Ohe),Nn(i,"#",Rhe),Nn(i,"?",Mhe),Nn(i,'"',B3e),Nn(i,"/",LP),Nn(i,";",V3e),Nn(i,"~",VK),Nn(i,"_",Dhe),Nn(i,"\\",She);const r=zw(i,U3e,_he,{[P3e]:!0});zw(r,U3e,r);const n=zw(i,Cj,FP,{[O3e]:!0});zw(n,Cj,n);const s=zw(i,j3e,D3e,{[R3e]:!0});zw(s,Cj),zw(s,j3e,s);const o=zw(i,idt,Qht,{[Jht]:!0});Nn(i,rdt,N3e,{[Jht]:!0}),Nn(o,rdt),zw(o,idt,o);const a=zw(i,G3e,edt,{[Kht]:!0});zw(a,G3e,a),Nn(a,TSi,a);const l=Nn(a,ESi);zw(l,G3e,a);const c=[[Cj,n]],h=[[Cj,null],[j3e,s]];for(let p=0;pp[0]>y[0]?1:-1);for(let p=0;p=0?x[M3e]=!0:Cj.test(y)?U3e.test(y)?x[ghe]=!0:x[O3e]=!0:x[P3e]=!0,Zht(i,y,y,x)}return Zht(i,"localhost",NK,{ascii:!0}),i.jd=new cb(Fhe),{start:i,tokens:_j({groups:e},tdt)}}function ASi(t,e){const i=PSi(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=i.length,n=[];let s=0,o=0;for(;o=0&&(p+=i[o].length,y++),c+=i[o].length,s+=i[o].length,o++;s-=p,o-=y,c-=p,n.push({t:h.t,v:e.slice(s-c,s),s:s-c,e:s})}return n}function PSi(t){const e=[],i=t.length;let r=0;for(;r56319||r+1===i||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function fD(t,e,i,r,n){let s;const o=e.length;for(let a=0;a=0;)s++;if(s>0){e.push(i.join(""));let o=parseInt(t.substring(r,r+s),10);for(;o>0;o--)i.pop();r+=s}else t[r]==="_"?(e.push(i.join("")),r++):(i.push(t[r]),r++)}return e}const jK={defaultProtocol:"http",events:null,format:sdt,formatHref:sdt,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function z3e(t,e){e===void 0&&(e=null);let i=_j({},jK);t&&(i=_j(i,t instanceof z3e?t.o:t));const r=i.ignoreTags,n=[];for(let s=0;si?r.substring(0,i)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return t===void 0&&(t=jK.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,i=this.toFormattedHref(t),r=t.get("tagName",i,e),n=this.toFormattedString(t),s={},o=t.get("className",i,e),a=t.get("target",i,e),l=t.get("rel",i,e),c=t.getObj("attributes",i,e),h=t.getObj("events",i,e);return s.href=i,o&&(s.class=o),a&&(s.target=a),l&&(s.rel=l),c&&_j(s,c),{tagName:r,attributes:s,content:n,eventListeners:h}}};function khe(t,e){class i extends odt{constructor(n,s){super(n,s),this.t=t}}for(const r in e)i.prototype[r]=e[r];return i.t=t,i}const adt=khe("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ldt=khe("text"),OSi=khe("nl"),fk=khe("url",{isLink:!0,toHref(t){return t===void 0&&(t=jK.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==NK&&t[1].t===pD}}),_g=t=>new cb(t);function RSi(t){let{groups:e}=t;const i=e.domain.concat([bhe,xhe,dD,She,Che,The,Ehe,Ihe,eE,_he,Ahe,Phe,Ohe,Rhe,LP,Fhe,VK,Dhe]),r=[whe,Sj,dk,xj,pk,pD,k3e,QT,$3e,$K,wj,kK,BK,Mhe,B3e,V3e],n=[bhe,whe,xhe,She,Che,The,dk,Ehe,Ihe,eE,_he,wj,Ahe,Phe,Ohe,Rhe,Mhe,LP,Fhe,VK,Dhe],s=_g(),o=Nn(s,VK);ko(o,n,o),ko(o,e.domain,o);const a=_g(),l=_g(),c=_g();ko(s,e.domain,a),ko(s,e.scheme,l),ko(s,e.slashscheme,c),ko(a,n,o),ko(a,e.domain,a);const h=Nn(a,dD);Nn(o,dD,h),Nn(l,dD,h),Nn(c,dD,h);const p=Nn(o,QT);ko(p,n,o),ko(p,e.domain,o);const y=_g();ko(h,e.domain,y),ko(y,e.domain,y);const v=Nn(y,QT);ko(v,e.domain,y);const x=_g(adt);ko(v,e.tld,x),ko(v,e.utld,x),Nn(h,NK,x);const I=Nn(y,eE);ko(I,e.domain,y),ko(x,e.domain,y),Nn(x,QT,v),Nn(x,eE,I);const P=Nn(x,pD);ko(P,e.numeric,adt);const F=Nn(a,eE),k=Nn(a,QT);ko(F,e.domain,a),ko(k,n,o),ko(k,e.domain,a);const j=_g(fk);ko(k,e.tld,j),ko(k,e.utld,j),ko(j,e.domain,a),ko(j,n,o),Nn(j,QT,k),Nn(j,eE,F),Nn(j,dD,h);const V=Nn(j,pD),Y=_g(fk);ko(V,e.numeric,Y);const X=_g(fk),Z=_g();ko(X,i,X),ko(X,r,Z),ko(Z,i,X),ko(Z,r,Z),Nn(j,LP,X),Nn(Y,LP,X);const ie=Nn(l,pD),ce=Nn(c,pD),he=Nn(ce,LP);Nn(he,LP,ie),ko(l,e.domain,a),Nn(l,QT,k),Nn(l,eE,F),ko(c,e.domain,a),Nn(c,QT,k),Nn(c,eE,F),ko(ie,e.domain,X),Nn(ie,LP,X);const _e=Nn(X,wj),xe=Nn(X,kK),Pe=Nn(X,$K),ke=Nn(X,BK);Nn(Z,wj,_e),Nn(Z,kK,xe),Nn(Z,$K,Pe),Nn(Z,BK,ke),Nn(_e,dk,X),Nn(xe,xj,X),Nn(Pe,Sj,X),Nn(ke,pk,X),Nn(_e,dk,X);const J=_g(fk),de=_g(fk),Se=_g(fk),Ie=_g(fk);ko(_e,i,J),ko(xe,i,de),ko(Pe,i,Se),ko(ke,i,Ie);const Re=_g(),Oe=_g(),Ge=_g(),Be=_g();return ko(_e,r),ko(xe,r),ko(Pe,r),ko(ke,r),ko(J,i,J),ko(de,i,de),ko(Se,i,Se),ko(Ie,i,Ie),ko(J,r,J),ko(de,r,de),ko(Se,r,Se),ko(Ie,r,Ie),ko(Re,i,Re),ko(Oe,i,de),ko(Ge,i,Se),ko(Be,i,Ie),ko(Re,r,Re),ko(Oe,r,Oe),ko(Ge,r,Ge),ko(Be,r,Be),Nn(de,xj,X),Nn(Se,Sj,X),Nn(Ie,pk,X),Nn(J,dk,X),Nn(Oe,xj,X),Nn(Ge,Sj,X),Nn(Be,pk,X),Nn(Re,pk,X),Nn(s,NK,j),Nn(s,N3e,OSi),{start:s,tokens:tdt}}function MSi(t,e,i){let r=i.length,n=0,s=[],o=[];for(;n=0&&y++,n++,h++;if(y<0)n-=h,n0&&(s.push(H3e(ldt,e,o)),o=[]),n-=y,h-=y;const v=p.t,x=i.slice(n-h,n);s.push(H3e(v,e,x))}}return o.length>0&&s.push(H3e(ldt,e,o)),s}function H3e(t,e,i){const r=i[0].s,n=i[i.length-1].e,s=e.slice(r,n);return new t(s,i)}const _v={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function DSi(){_v.scanner=ISi(_v.customSchemes);for(let t=0;t<_v.tokenQueue.length;t++)_v.tokenQueue[t][1]({scanner:_v.scanner});_v.parser=RSi(_v.scanner.tokens);for(let t=0;t<_v.pluginQueue.length;t++)_v.pluginQueue[t][1]({scanner:_v.scanner,parser:_v.parser});_v.initialized=!0}function FSi(t){return _v.initialized||DSi(),MSi(_v.parser.start,t,ASi(_v.scanner.start,t))}var LSi={amp:"&",gt:">",lt:"<",nbsp:" ",quot:'"'},NSi=/^#[xX]([A-Fa-f0-9]+)$/,kSi=/^#([0-9]+)$/,$Si=/^([A-Za-z0-9]+)$/,BSi=function(){function t(e){this.named=e}return t.prototype.parse=function(e){if(e){var i=e.match(NSi);if(i)return String.fromCharCode(parseInt(i[1],16));if(i=e.match(kSi),i)return String.fromCharCode(parseInt(i[1],10));if(i=e.match($Si),i)return this.named[i[1]]||"&"+i[1]+";"}},t}(),VSi=/[\t\n\f ]/,jSi=/[A-Za-z]/,GSi=/\r\n?/g;function w0(t){return VSi.test(t)}function udt(t){return jSi.test(t)}function USi(t){return t.replace(GSi,` +`)}var zSi=function(){function t(e,i,r){r===void 0&&(r="precompile"),this.delegate=e,this.entityParser=i,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===":"||udt(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();w0(n)&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var n=this.consume();w0(n)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(n.toLowerCase()))},doctypeName:function(){var n=this.consume();w0(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(!w0(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();w0(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();w0(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();w0(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();w0(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();w0(n)?this.transitionTo("beforeAttributeName"):n==="/"?this.transitionTo("selfClosingStartTag"):n===">"?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(n)},endTagName:function(){var n=this.consume();w0(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(w0(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();w0(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(w0(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();w0(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();w0(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();w0(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===":"||udt(n))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(n))}},this.reset()}return t.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},t.prototype.transitionTo=function(e){this.state=e},t.prototype.tokenize=function(e){this.reset(),this.tokenizePart(e),this.tokenizeEOF()},t.prototype.tokenizePart=function(e){for(this.input+=USi(e);this.index"||e==="style"&&this.input.substring(this.index,this.index+8)!==""||e==="script"&&this.input.substring(this.index,this.index+9)!=="<\/script>"},t}(),HSi=function(){function t(e,i){i===void 0&&(i={}),this.options=i,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new zSi(this,e,i.mode),this._currentAttribute=void 0}return t.prototype.tokenize=function(e){return this.tokens=[],this.tokenizer.tokenize(e),this.tokens},t.prototype.tokenizePart=function(e){return this.tokens=[],this.tokenizer.tokenizePart(e),this.tokens},t.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},t.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},t.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 i=0;i=0))continue;let h=r.length;KSi(l,i,++o,r),o+=r.length-h-1}else if(a.type!==W3e)r.push(a);else{const l=XSi(a.chars,s);r.push.apply(r,l)}}for(let o=0;o0&&(l+=" "+QSi(a.attributes).join(" ")),a.selfClosing&&(l+=" /"),l+=">",n.push(l);break}case hdt:n.push(``);break;case W3e:n.push(Y3e(a.chars));break;case qSi:n.push(``);break;case YSi:{let l=`",n.push(l);break}}}return n.join("")}function XSi(t,e){const i=FSi(t),r=[];for(let n=0;n0;){let s=e[i];s.type===$he&&s.tagName.toUpperCase()===t?n++:s.type===hdt&&s.tagName.toUpperCase()===t&&n--,r.push(s),i++}return r}function JSi(t){let{tagName:e,attributes:i,content:r}=t;return`<${e} ${ZSi(i)}>${Y3e(r)}`}function Y3e(t){return t.replace(/&/g,"&").replace(//g,">")}function ddt(t){return t.replace(/"/g,""")}function ZSi(t){const e=[];for(const i in t){const r=t[i]+"";e.push(`${i}="${ddt(r)}"`)}return e.join(" ")}function QSi(t){const e=[];for(let i=0;i=t.reference.scrollWidth)return!1}function pdt(t){return t===null?"":q3e(t,{target:"_blank",validate:{url:e=>/^https?:\/\//.test(e)}})}const nCi=["content"],sCi={key:0,class:"flex flex-shrink-0 items-center border-b border-solid border-gray-600 px-8 h-48 overflow-hidden",tabindex:"-1"},oCi={class:"flex-grow text-lg py-16 pl-8 min-w-0"},aCi={key:0,class:"flex"},lCi={key:1,class:"p-8 flex-grow overflow-y-auto"},uCi={key:2,class:"px-16 py-16 border-t border-gray-400 default-focus-style"},cCi=an({__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(t){const e=t,{t:i}=ns(),r=ay(),n=mg(),s=no("iApi"),o=Mi(),a=Jr(()=>s?.fixture.get("appbar")?n.temporary:[]),l=Jr(()=>r.mobileView),c=Jr(()=>r.reorderable),h=()=>!l.value&&!e.panel.teleport,p=y=>{e.panel.move(y),y==="left"&&v0(()=>{(o.value?.querySelector(".move-left")).focus()})};return Ja(()=>{o.value?.addEventListener("blur",()=>{o.value._tippy.hide()}),o.value?.addEventListener("keyup",y=>{y.key==="Tab"&&o.value?.matches(":focus")&&o.value._tippy.show()})}),Ll(()=>{o.value?.removeEventListener("blur",()=>{o.value._tippy.hide()}),o.value?.removeEventListener("keyup",y=>{y.key==="Tab"&&o.value?.matches(":focus")&&o.value._tippy.show()})}),(y,v)=>{const x=Vo("back"),I=Vo("panel-options-menu"),P=Vo("left"),F=Vo("right"),k=Vo("pin"),j=Vo("expand"),V=Vo("minimize"),Y=Vo("close"),X=as("truncate"),Z=as("focus-item"),ie=as("tippy");return Zr((Qt(),hi("div",{class:"h-full flex flex-col items-stretch",content:vi(i)("panels.access"),ref_key:"el",ref:o},[t.header?(Qt(),hi("header",sCi,[Un(x,{class:ms(t.panel.teleport?"display-none":"block sm:display-none"),onClick:v[0]||(v[0]=ce=>t.panel.close())},null,8,["class"]),Zr((Qt(),hi("h2",oCi,[Xf(y.$slots,"header")])),[[X]]),y.$slots.controls?(Qt(),Bn(I,{key:0},{default:En(()=>[Xf(y.$slots,"controls")]),_:3})):fn("",!0),Dt("div",{class:ms(t.panel.teleport?"flex":"display-none sm:flex")},[t.panel.teleport?fn("",!0):(Qt(),hi("div",aCi,[c.value?(Qt(),Bn(P,{key:0,onClick:v[1]||(v[1]=ce=>p("left")),active:!t.panel.isLeftMostPanel},null,8,["active"])):fn("",!0),c.value?(Qt(),Bn(F,{key:1,onClick:v[2]||(v[2]=ce=>p("right")),active:!t.panel.isRightMostPanel},null,8,["active"])):fn("",!0),Un(k,{onClick:v[3]||(v[3]=ce=>t.panel.pin()),active:t.panel.isPinned},null,8,["active"]),t.panel.controls&&t.panel.controls.expand?(Qt(),Bn(j,{key:2,onClick:v[4]||(v[4]=ce=>t.panel.expand()),active:t.panel.expanded},null,8,["active"])):fn("",!0)])),t.panel.button&&a.value?.includes(t.panel.id)?(Qt(),Bn(V,{key:1,onClick:v[5]||(v[5]=ce=>t.panel.minimize())})):fn("",!0),Un(Y,{onClick:v[6]||(v[6]=ce=>t.panel.close())})],2)])):fn("",!0),t.content?(Qt(),hi("div",lCi,[Xf(y.$slots,"content")])):fn("",!0),t.footer?Zr((Qt(),hi("div",uCi,[Xf(y.$slots,"footer")])),[[Z]]):fn("",!0)],8,nCi)),[[ie,{trigger:"manual",onShow:h,popperOptions:{placement:"top",modifiers:[{name:"preventOverflow",options:{altAxis:!0}},{name:"flip",options:{fallbackPlacements:["top"]}}]}}]])}}}),hCi={class:"relative",tabindex:"-1"},dCi=["content"],pCi=["transform"],fCi=[Dt("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)],mCi=an({__name:"pin",props:{active:Boolean},setup(t){const{t:e}=ns();return(i,r)=>{const n=as("tippy");return Qt(),hi("div",hCi,[Zr((Qt(),hi("button",{type:"button",class:ms(["text-gray-500 hover:text-black focus:text-black p-8",{"text-gray-700":t.active}]),content:vi(e)(t.active?"panels.controls.unpin":"panels.controls.pin")},[(Qt(),hi("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",transform:`rotate(${t.active?30:0})`},fCi,8,pCi))],10,dCi)),[[n,{placement:"bottom",hideOnClick:!1}]])])}}}),gCi={class:"relative",tabindex:"-1"},yCi=["content","aria-label"],vCi=[Dt("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},[Dt("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)],_Ci=an({__name:"close",props:{active:Boolean},setup(t){const{t:e}=ns();return(i,r)=>{const n=as("tippy");return Qt(),hi("div",gCi,[Zr((Qt(),hi("button",{type:"button",class:ms(["text-gray-500 hover:text-black focus:text-black p-8",{"text-gray-700":t.active}]),content:vi(e)("panels.controls.close"),"aria-label":vi(e)("panels.controls.close")},vCi,10,yCi)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),bCi={class:"relative",tabindex:"-1"},wCi=["content","aria-label"],xCi=[Dt("svg",{xmlns:"http://www.w3.org/2000/svg",class:"fill-current w-16 h-16",viewBox:"0 0 16 16"},[Dt("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)],SCi=an({__name:"back",props:{active:Boolean},setup(t){const{t:e}=ns();return(i,r)=>{const n=as("tippy");return Qt(),hi("div",bCi,[Zr((Qt(),hi("button",{type:"button",class:ms(["text-gray-500 hover:text-black focus:text-black p-8",{"text-gray-700":t.active}]),content:vi(e)("panels.controls.back"),"aria-label":vi(e)("panels.controls.back")},xCi,10,wCi)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),CCi={class:"w-32 h-32"},TCi=["content"],ECi={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"h-24 w-24 fill-current transform rotate-90"},ICi=[Dt("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),Dt("path",{d:"M0 0h24v24H0V0z",fill:"none"},null,-1),Dt("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"},null,-1)],ACi={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"h-24 w-24 fill-current transform rotate-90"},PCi=[Dt("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),Dt("path",{d:"M0 0h24v24H0V0z",fill:"none"},null,-1),Dt("path",{d:"M8 19h3v3h2v-3h3l-4-4-4 4zm8-15h-3V1h-2v3H8l4 4 4-4zM4 9v2h16V9H4z"},null,-1),Dt("path",{d:"M4 12h16v2H4z"},null,-1)],OCi=an({__name:"expand",props:{active:Boolean},setup(t){const{t:e}=ns();return(i,r)=>{const n=as("tippy");return Qt(),hi("div",CCi,[Zr((Qt(),hi("button",{type:"button",class:"text-gray-500 hover:text-black focus:text-black w-full h-full flex justify-center items-center",content:vi(e)(`panels.controls.${t.active?"collapse":"expand"}`)},[t.active?(Qt(),hi("svg",ACi,PCi)):(Qt(),hi("svg",ECi,ICi))],8,TCi)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale",hideOnClick:!1}]])])}}}),RCi={class:"relative",tabindex:"-1"},MCi=["content"],DCi=[Dt("svg",{class:"fill-current w-20 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Dt("path",{d:"M0 0h24v24H0V0z",fill:"none"}),Dt("path",{d:"M6 19h12v2H6z"})],-1)],FCi=an({__name:"minimize",props:{active:Boolean},setup(t){const{t:e}=ns();return(i,r)=>{const n=as("tippy");return Qt(),hi("div",RCi,[Zr((Qt(),hi("button",{type:"button",class:ms(["text-gray-500 hover:text-black focus:text-black p-6",{"text-gray-700":t.active}]),content:vi(e)("panels.controls.minimize")},DCi,10,MCi)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),LCi={class:"relative",tabindex:"-1"},NCi=["content"],kCi=["aria-label"],$Ci=[Dt("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"},null,-1)],BCi=an({__name:"right",props:{active:Boolean},setup(t){const{t:e}=ns();return(i,r)=>{const n=as("tippy");return Qt(),hi("div",LCi,[Zr((Qt(),hi("button",{type:"button",class:ms(["p-8",{"text-gray-500 hover:text-black focus:text-black":t.active,"text-gray-300":!t.active}]),content:vi(e)("panels.controls.moveRight")},[(Qt(),hi("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"4 4 16 16","aria-label":vi(e)("panels.controls.moveRight")},$Ci,8,kCi))],10,NCi)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),VCi={class:"relative",tabindex:"-1"},jCi=["content"],GCi=["aria-label"],UCi=[Dt("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"},null,-1)],zCi=an({__name:"left",props:{active:Boolean},setup(t){const{t:e}=ns();return(i,r)=>{const n=as("tippy");return Qt(),hi("div",VCi,[Zr((Qt(),hi("button",{type:"button",class:ms(["p-8 move-left",{"text-gray-500 hover:text-black focus:text-black":t.active,"text-gray-300":!t.active}]),content:vi(e)("panels.controls.moveLeft")},[(Qt(),hi("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"4 4 16 16","aria-label":vi(e)("panels.controls.moveLeft")},UCi,8,GCi))],10,jCi)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),HCi=(t=>(eh("data-v-9e477d20"),t=t(),th(),t))(()=>Dt("div",{class:"p-6"},[Dt("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-20 h-20"},[Dt("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)),WCi=an({__name:"panel-options-menu",setup(t){const{t:e}=ns();return(i,r)=>(Qt(),Bn(l3e,{class:"flex",tooltip:vi(e)("panels.controls.optionsMenu"),popperOptions:{strategy:"fixed"},position:"bottom-end"},{header:En(()=>[HCi]),default:En(()=>[Xf(i.$slots,"default",{},void 0,!0)]),_:3},8,["tooltip"]))}}),a4r="",qCi=Nl(WCi,[["__scopeId","data-v-9e477d20"]]),YCi={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},XCi=[Dt("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),Dt("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"},null,-1)],KCi={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},JCi=[Dt("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),Dt("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"},null,-1)],ZCi=an({__name:"fullscreen-nav",setup(t){const{t:e}=ns(),i=no("iApi"),r=()=>{i.toggleFullscreen()};return(n,s)=>{const o=Vo("mapnav-button");return Qt(),Bn(o,{onClickFunction:r,tooltip:vi(e)("mapnav.fullscreen")},{default:En(()=>[vi(i).isFullscreen?(Qt(),hi("svg",YCi,XCi)):(Qt(),hi("svg",KCi,JCi))]),_:1},8,["tooltip"])}}}),QCi=Dt("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[Dt("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),eTi=an({__name:"geolocator-nav",setup(t){const{t:e}=ns(),i=no("iApi");let r=Fl([]);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?i.notify.show(ub.ERROR,e("mapnav.geolocator.error.permission")):i.notify.show(ub.ERROR,e("mapnav.geolocator.error.internal"))});a&&(r=[a.coords.longitude,a.coords.latitude],s(r))}},s=a=>{let l=new iy("geolocation",a,ml.latLongSR(),!0);i.geo.map.zoomMapTo(l)},o=a=>new Promise((l,c)=>navigator.geolocation.getCurrentPosition(l,c,a));return(a,l)=>{const c=Vo("mapnav-button");return Qt(),Bn(c,{onClickFunction:n,tooltip:vi(e)("mapnav.geolocator")},{default:En(()=>[QCi]),_:1},8,["tooltip"])}}}),tTi=Dt("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[Dt("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"}),Dt("path",{d:"M0 0h24v24H0z",fill:"none"})],-1),iTi=an({__name:"home-nav",setup(t){const{t:e}=ns(),i=no("iApi"),r=()=>{const n=i.geo.map.getExtentSet();i.geo.map.zoomMapTo(n.fullExtent)};return(n,s)=>{const o=Vo("mapnav-button");return Qt(),Bn(o,{onClickFunction:r,tooltip:vi(e)("mapnav.home")},{default:En(()=>[tTi]),_:1},8,["tooltip"])}}}),rTi={class:"relative w-32 h-32 text-gray-600 hover:text-black",tabindex:"-1"},nTi=["content"],sTi=an({__name:"button",props:{onClickFunction:{type:Function,required:!0},tooltip:{type:[String,Boolean],default:!1}},setup(t){return(e,i)=>{const r=as("focus-item"),n=as("tippy");return Qt(),hi("div",rTi,[Zr((Qt(),hi("button",{type:"button",class:"w-full h-full default-focus-style focus:outline-none",onClick:i[0]||(i[0]=s=>t.onClickFunction()),content:t.tooltip},[Xf(e.$slots,"default")],8,nTi)),[[r],[n,{placement:"left"}]])])}}}),oTi={class:"relative",tabindex:"-1"},aTi=["content","aria-label"],lTi=an({__name:"button",props:{onClickFunction:{type:Function,required:!0},id:{type:String,required:!0},tooltip:{type:[String,Boolean],default:!1}},setup(t){const e=t,i=no("iApi"),r=()=>i?.event.emit(cn.APPBAR_BUTTON_CLICK,e.id);return(n,s)=>{const o=as("focus-item"),a=as("tippy");return Qt(),hi("div",oTi,[Zr((Qt(),hi("button",{type:"button",class:"py-6 w-full h-full",onClick:s[0]||(s[0]=()=>{t.onClickFunction(),r()}),content:t.tooltip,"aria-label":String(t.tooltip)},[Xf(n.$slots,"default",{},void 0,!0)],8,aTi)),[[o],[a,{placement:"right"}]])])}}}),d4r="",uTi=Nl(lTi,[["__scopeId","data-v-0af0697e"]]),Bhe=Hp("areas-of-interest",()=>({areas:Mi([])})),Tj=Hp("export",()=>{const t=Mi({title:!0,map:!0,mapElements:!0,legend:!0,footnote:!0,timestamp:!0}),e=Mi("");function i(r){if(t.value[r.name]!==void 0){const n=t.value[r.name];t.value[r.name]=r.selected!==void 0?r.selected:!n}}return{componentSelectedState:t,fileName:e,toggleSelected:i}}),NP=function t(e){function i(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 c=o?a.toLowerCase():a,h=s[a];l[c]=c in l&&typeof h=="object"?i(l[c],h,c=="headers"):h}return l}function r(n,s,o,a,l){var c=typeof n!="string"?(s=n).url:n,h={config:s},p=i(e,s),y={};a=a||p.data,(p.transformRequest||[]).map(function(v){a=v(a,p.headers)||a}),p.auth&&(y.authorization=p.auth),a&&typeof a=="object"&&typeof a.append!="function"&&typeof a.text!="function"&&(a=JSON.stringify(a),y["content-type"]="application/json");try{y[p.xsrfHeaderName]=decodeURIComponent(document.cookie.match(RegExp("(^|; )"+p.xsrfCookieName+"=([^;]*)"))[2])}catch{}return p.baseURL&&(c=c.replace(/^(?!.*\/\/)\/?/,p.baseURL+"/")),p.params&&(c+=(~c.indexOf("?")?"&":"?")+(p.paramsSerializer?p.paramsSerializer(p.params):new URLSearchParams(p.params))),(p.fetch||fetch)(c,{method:(o||p.method||"get").toUpperCase(),body:a,headers:i(p.headers,y,!0),credentials:p.withCredentials?"include":l}).then(function(v){for(var x in v)typeof v[x]!="function"&&(h[x]=v[x]);return p.responseType=="stream"?(h.data=v.body,h):v[p.responseType||"text"]().then(function(I){h.data=I,h.data=JSON.parse(I)}).catch(Object).then(function(){return(p.validateStatus?p.validateStatus(v.status):v.ok)?h:Promise.reject(h)})})}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=t,r}(),cTi={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},X3e={en:{},fr:{}};class hTi{list={};listFetched=!1;constructor(e,i){NP.get(i).then(r=>{r.data.definitions.forEach(n=>X3e[e][n.code]=n.description),Object.keys(X3e[e]).forEach(n=>{this.list[n]=X3e[e][n]}),this.listFetched=!0})}fsaToProvinces(e){const i={};let r=cTi[e.substring(0,1).toUpperCase()];return typeof r=="number"&&(r=[r]),r.forEach(n=>{i[n]=this.list[n]}),i}}function dTi(t,e){return new hTi(t,e)}const Vhe={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 pTi{allTypes={};validTypes={};filterComplete=!1;typesFetched=!1;constructor(e,i){NP.get(i).then(r=>{r.data.definitions.forEach(n=>{Vhe[e][n.code]=n.term.split(`${n.code}-`)[1]}),Object.keys(Vhe[e]).forEach(n=>{this.allTypes[n]=Vhe[e][n],this.validTypes[n]=Vhe[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 i of e)delete this.validTypes[i];return this.filterComplete=!0,this.validTypes}}function fTi(t,e){return new pTi(t,e)}function mTi(t,e){const i=/^[-+]?([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(i.test(e)&&!t.disabledSearchTypes.includes("LAT/LNG")){const s=e.slice(0,-1);return new gTi(t,s)}else return n.test(e)&&!t.disabledSearchTypes.includes("FSA")?new yTi(t,e):r.test(e)&&!t.disabledSearchTypes.includes("NTS")?new vTi(t,e.substring(0,6).toUpperCase()):new _Ti(t,e)}class jhe{config;query;failedServs=[];results=[];onComplete;latLongResult;featureResults=[];resultType="geoname";constructor(e,i){this.query=i,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,i,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(i=>this.config.types.validTypes[i.concise.code]).map(i=>({name:i.name,location:i.location,province:this.config.provinces.list[i.province.code],type:this.config.types.allTypes[i.concise.code],LatLon:{lat:i.latitude,lon:i.longitude},bbox:i.bbox,order:this.config.sortOrder.indexOf(i.concise.code)>=0?this.config.sortOrder.indexOf(i.concise.code):this.config.sortOrder.length}))}jsonRequest(e){return new Promise((i,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;i(s)}else r("Could not load results from remote service.")},n.send()})}locateByQuery(){return this.jsonRequest(this.getUrl(!0,void 0))}nameByLatLon(e,i,r){return this.jsonRequest(this.getUrl(!1,r,e,i)).then(n=>this.normalizeNameItems(n.items)).catch(()=>(console.error("LatLon service failed"),this.failedServs.push("geoname"),this.normalizeNameItems([])))}}class gTi extends jhe{constructor(e,i){super(e,i),this.resultType="latlong";const n=i.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(c=>{c?(this.results=c,a(this)):l("Given lat lon coordinates cannot be found")})})}}class yTi extends jhe{constructor(e,i){i=i.substring(0,3).toUpperCase(),super(e,i),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 i=this.config.provinces.fsaToProvinces(this.query);return{fsa:this.query,code:"FSA",desc:this.config.types.allTypes.FSA,province:Object.keys(i).map(r=>i[r]).join(","),_provinces:i,LatLon:{lat:e[0].geometry.coordinates[1],lon:e[0].geometry.coordinates[0]}}}}).catch(()=>{console.error("FSA service failed"),this.failedServs.push("geolocation")})}}class vTi extends jhe{unitName;unit;mapSheets=[];constructor(e,i){super(e,i),this.resultType="nts",i=isNaN(parseInt(i[2]))?"0"+i:i,this.unitName=i,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 _Ti extends jhe{constructor(e,i){i=encodeURIComponent(i.trim()),super(e,i),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 fdt="https://geogratis.gc.ca/services/geolocation/@{language}/locate",mdt="https://geogratis.gc.ca/services/geoname/@{language}/geonames.json",gdt="https://geogratis.gc.ca/services/geoname/@{language}/codes/province.json",ydt="https://geogratis.gc.ca/services/geoname/@{language}/codes/concise.json",bTi={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 vdt{config;constructor(e,i){let r,n,s,o;const a=i?.serviceUrls;a?(r=a.geoLocation?a.geoLocation:fdt,n=a.geoNames?a.geoNames:mdt,s=a.geoProvince?a.geoProvince:gdt,o=a.geoTypes?a.geoTypes:ydt):(r=fdt,n=mdt,s=gdt,o=ydt),r=r.replace("@{language}",e),n=n.replace("@{language}",e),s=s.replace("@{language}",e),o=o.replace("@{language}",e);const l=i?.settings;let c,h,p,y,v;l?(c=l.categories?l.categories:[],h=l.sortOrder?l.sortOrder:[],p=l.disabledSearchTypes?l.disabledSearchTypes:[],y=l.maxResults>0?l.maxResults:100,v=!!l.officialOnly):(c=[],h=[],p=[],y=100,v=!1),this.config={language:e,geoNameUrl:n,geoLocateUrl:r,types:fTi(e,o),provinces:dTi(e,s),categories:c,sortOrder:h,disabledSearchTypes:p,maxResults:y,officialOnly:v},this.config.types.filterValidTypes(i?.excludeTypes),this._provinceList=[],this._typeList=[],this._excludedTypes=i?.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,i){i=i.toLowerCase().trim();const r=decodeURI(e.query.toLowerCase().replace("*","")),n=[];for(let s=0;s<=i.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]===i[s-1]?0:1))}return n[i.length][r.length]}findProvinceObj(e){return this.provinceList.find(i=>i.name===e)}query(e){return mTi(this.config,e.toUpperCase()).onComplete.then(i=>{let r=[];i.featureResults.length>0?i.resultType==="fsa"?r=i.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})):i.resultType==="nts"?r=i.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})):i.resultType==="address"&&(r=i.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(i,s.name)>this.levenshteinDistance(i,o.name)?1:-1))):i.resultType==="latlong"&&(r=[i.latLongResult],r[0].order=-1);const n=i.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(i,s.name)>this.levenshteinDistance(i,o.name)?1:-1),failedServs:i.failedServs}})}fetchProvinces(){return new Promise(e=>{const i=setInterval(()=>{if(this.config.provinces.listFetched){clearInterval(i);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:bTi[o],name:s[o]});this.provinceList=r,e(this.provinceList)}})})}fetchTypes(){return new Promise(e=>{const i=setInterval(()=>{if(this.config.types.typesFetched){clearInterval(i);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 _dt(t,e,i){return t&&e.extent&&(i=i.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!=="..."&&(i=i.filter(r=>r.location.province?.name&&r.location.province.name===e.province)),e.type&&e.type!=="..."&&(i=i.filter(r=>r.type===e.type)),i}const mk=Hp("geosearch",()=>{const t=Mi(new vdt("en",void 0)),e=Mi({type:"",province:"",extent:void 0}),i=Mi(!1),r=Mi(""),n=Mi(""),s=Mi([]),o=Mi([]),a=Mi(!1),l=Mi([]),c=Jr(()=>new Promise(F=>{t.value.fetchProvinces().then(k=>{k.sort((j,V)=>j.name>V.name?1:-1),F(k)})})),h=Jr(()=>new Promise(F=>{t.value.fetchTypes().then(k=>{k.sort((j,V)=>j.name>V.name?1:-1),F(k)})}));function p(F,k){t.value=new vdt(F,k)}function y(F){if(a.value=!0,!r.value)s.value=[],o.value=[],a.value=!1;else if(r.value&&r.value!==n.value||F){const k=setInterval(()=>{t.value.config.provinces.listFetched&&t.value.config.types.typesFetched&&(clearInterval(k),t.value.query(`${r.value}*`).then(j=>{l.value=j.failedServs,n.value=r.value,o.value=j.results;const V=_dt(i.value,e.value,o.value);s.value=V||[],a.value=!1}))},250)}else{const k=_dt(i.value,e.value,o.value);s.value=k||[],a.value=!1}}function v(F){e.value.province=typeof F.province>"u"?"":F.province,y(F.forceReRun)}function x(F){e.value.type=typeof F.type>"u"?"":F.type,y(F.forceReRun)}function I(F){n.value=r.value,r.value=F,y()}function P(F){if(F.visible!==void 0&&(i.value=F.visible),F.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=F.extent,y()}return{GSservice:t,queryParams:e,resultsVisible:i,searchVal:r,lastSearchVal:n,searchResults:s,savedResults:o,loadingResults:a,failedServices:l,getProvinces:c,getTypes:h,initService:p,runQuery:y,setProvince:v,setType:x,setSearchTerm:I,setMapExtent:P}}),Ghe=Hp("help",()=>({location:Mi("./help/")}));var kP=(t=>(t.Visibility="visibilityButton",t.Expand="expandButton",t))(kP||{}),Wp=(t=>(t.Item="item",t.Placeholder="placeholder",t.Error="error",t))(Wp||{});class Uhe extends Gp{_uid;_name;_type;_children=[];_parent=void 0;_loadPromise;_hidden;_expanded;_visibility;_exclusive;_controls;_disabledControls;_lastVisible;_visibleChildren;constructor(e,i,r){super(e),this._uid=bk.sharedUtils.generateUUID(),this._name=i.name,this._type=i.type??"placeholder",this._parent=r,this._children=[],this._loadPromise=new Yf,this._hidden=i.hidden??!1,this._expanded=i.expanded??!0,this._visibility=!0,this._exclusive=i.exclusive??!1,this._controls=i.controls?.slice()??["visibilityButton","expandButton"],this._disabledControls=i.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,i){i&&this._disabledControls?.includes(e)?(this._disabledControls=this._disabledControls.filter(r=>r!==e),this._controls?.push(e)):!i&&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,i=!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 tu)||this._lastVisible.layerControlAvailable(ha.Visibility)))this._lastVisible.toggleVisibility(!0);else{const r=this.children.find(n=>!(n instanceof tu)||n.layerControlAvailable(ha.Visibility));r&&r.toggleVisibility(!0)}else this._lastVisible=this.children.find(r=>r.visibility),this._lastVisible?.toggleVisibility(!1);this.parent&&i&&this.parent.checkVisibility(this)}}checkVisibilityRules(){this.parent&&!this.parent.visibility?this.toggleVisibility(!1,!1):this.parent?.exclusive&&this.parent.children.some(i=>i.visibility&&i!==this&&i.type==="item")&&this.toggleVisibility(!1,!1)}checkVisibility(e){this instanceof tu&&!this.layerControlAvailable(ha.Visibility)||(this.exclusive?e.visibility?(this.children.forEach(i=>{i.uid!==e.uid&&i.toggleVisibility(!1,!1)}),this._lastVisible=e,this._visibility=!0,this instanceof tu&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!0)):(this._visibility=!1,this instanceof tu&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!1),this._lastVisible=e):this.children.some(i=>i.visibility)?(this._visibility=!0,this._visibleChildren=this.children.filter(i=>i.visibility),this instanceof tu&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!0)):(this._visibility=!1,this._visibleChildren=[],this instanceof tu&&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},i=[];return this.children.forEach(r=>{i.push(r.getConfig())}),this.exclusive?e.exclusiveVisibility=i:e.children=i,e}onAdded(){}onRemoved(){this.toggleVisibility(!1)}load(){this._type="item",this._loadPromise.resolveMe(),this.checkVisibilityRules()}reload(){this._type="placeholder",this._loadPromise=new Yf}error(){this._type="error",this._loadPromise.rejectMe(),this.checkVisibilityRules()}}class tu extends Uhe{_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,i,r){super(e,i,r),this._type=Wp.Placeholder,this._layerId=i.layerId,this._layerIdx=i.sublayerIndex,this._layerControls=i.layerControls??[],this._origLayerControls=i.layerControls,this._layerDisabledControls=i.disabledLayerControls??[],this._origLayerDisabledControls=i.disabledLayerControls,this._layerRedrawing=!1,this._symbologyExpanded=i.symbologyExpanded||!1,i.coverIcon&&(this._coverIcon=i.coverIcon),i.description&&(this._description=i.description),this._symbologyRenderStyle=i.symbologyRenderStyle??"icons",this._customSymbology=!!i.symbologyStack,this._symbologyStack=i.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._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,i=!0,r=!1){if(!((!this.layerControlAvailable(ha.Visibility)||this._loadCancelled)&&!r)&&(super.toggleVisibility(e,i),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,i){this._symbologyStack.some(r=>((e===void 0||r.uid===e)&&(r.visibility=i,r.lastVisbility=i),e!==void 0&&r.uid===e))}load(e){if(e){if(this._layer=e instanceof $P?e:this.$iApi.geo.layer.getLayer(this._layerId??this._layerUid),this.layer=e,this._layerRedrawing=e.mapLayer&&e.drawState!==zv.UP_TO_DATE,this._loadCancelled){this.toggleVisibility(!1,!0,!0);return}this._layer?.loadPromise().then(()=>{this._layer?.layerType===_n.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(cn.LAYER_VISIBILITYCHANGE,i=>{i.layer.uid===this.layer.uid&&this._type===Wp.Item&&this.toggleVisibility(i.visibility,!0,!0)})),this.handlers.push(this.$iApi.event.on(cn.LAYER_DRAWSTATECHANGE,i=>{this.layer.uid===i.layer.uid&&(i.layer.drawState===zv.REFRESH?this.layerRedrawing=!0:setTimeout(()=>{this.layerRedrawing=i.layer.drawState===zv.REFRESH},500))})),this._layerOffscale=this.$iApi.geo.map.created?this.layer?.isOffscale():!1,this.handlers.push(this.$iApi.event.on(cn.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 Ej=(t=>(t.Title="title",t.Text="text",t.Image="image",t.Markdown="markdown",t.Template="template",t))(Ej||{});class zhe extends Uhe{_infoType;_content;constructor(e,i,r){super(e,i,r),this._infoType=i.infoType??"title",this._content=i.content??"",i.infoType==="template"&&this.$element.component(`${this._uid}-info-section`,{template:this._content}),(i.infoType||i.content)&&(this._controls=i.controls?.slice()??[kP.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 mD=Hp("legend",()=>{const t=Mi(),e=Mi([]),i=Mi([]);function r(o){if(o.parent===void 0)e.value.push(o.item);else{if(!(o.item instanceof zhe)&&!(o.item instanceof tu)){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(c=>(c===o&&!c.children.length&&c.onRemoved(),c!==o)),l.forEach(c=>{c.children=a(c.children)}),l=l.filter(c=>!(c instanceof zhe&&!c.children.length&&c.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:t,children:e,headerControls:i,addItem:r,removeItem:n,replaceItem:s}}),gD=Hp("mapnav",()=>{const t=Mi({}),e=Mi([]);function i(r){r in t.value&&delete t.value[r];const n=e.value.indexOf(r);n!==-1&&e.value.splice(n,1)}return{items:t,order:e,removeItem:i}}),K3e=Hp("metadata",()=>{const t=Mi(""),e=Mi({type:"LineString",coordinates:[]});return{status:t,response:e}}),Hhe=Hp("northarrow",()=>{const t=Mi(""),e=Mi("");return{arrowIcon:t,poleIcon:e}}),GK=Hp("overviewmap",()=>{const t=Mi({lodSets:[],extentSets:[],basemaps:[],tileSchemas:[],initialBasemapId:""}),e=Mi({}),i=Mi(!0),r=Mi(1.5),n=Mi("#FF0000"),s=Mi(1),o=Mi("#000000"),a=Mi(.25);function l(c){t.value.initialBasemapId=c}return{mapConfig:t,basemaps:e,startMinimized:i,expandFactor:r,borderColour:n,borderWidth:s,areaColour:o,areaOpacity:a,updateInitialBasemap:l}}),UK=Hp("scrollguard",()=>{const t=Mi(!1);function e(i){t.value=i}return{enabled:t,setEnabled:e}});var _p=(t=>(t[t.UPLOAD=0]="UPLOAD",t[t.FORMAT=1]="FORMAT",t[t.CONFIGURE=2]="CONFIGURE",t))(_p||{});const J3e=Hp("wizard",()=>{const t={id:"Placeholder",layerType:_n.UNKNOWN,url:""},e=Mi(),i=Mi(""),r=Mi(""),n=Mi(null),s=Mi({config:t,configOptions:[]}),o=Mi(_p.UPLOAD);function a(l){switch(o.value){case _p.UPLOAD:l===_p.UPLOAD?i.value="":l===_p.FORMAT&&(o.value=_p.FORMAT);break;case _p.FORMAT:l===_p.UPLOAD?(n.value&&(i.value="",n.value=null),r.value="",o.value=_p.UPLOAD):l===_p.CONFIGURE&&(o.value=_p.CONFIGURE);break;case _p.CONFIGURE:l===_p.UPLOAD?(i.value="",r.value="",n.value=null,s.value={config:t,configOptions:[]},o.value=_p.UPLOAD):l===_p.FORMAT&&(s.value={config:t,configOptions:[]},o.value=_p.FORMAT);break}}return{layerSource:e,url:i,typeSelection:r,fileData:n,layerInfo:s,currStep:o,goToStep:a}});class wTi{fixture;panel;event;geo;notify;ui;startRequired=!1;$vApp;$element;$i18n;_isFullscreen;constructor(e,i,r){this.event=new Tvi(this);const n=xTi(e,this);this.$vApp=n.app,this.$element=n.element,this.$i18n=n.i18n,this.fixture=new KEi(this),this.panel=new JEi(this),this.geo=new YEi(this),this.ui={maptip:this.geo.map.maptip,exposeOids:!1,getZoomIcon:()=>"",scrollToInstance:!1},this.notify=new ewi(this),this._isFullscreen=GT.isEnabled&&!!this.$vApp.$root&>.isFullscreen&>.element===this.$vApp.$root.$el,GT.isEnabled&>.onchange(()=>{this._isFullscreen=GT.isEnabled&&!!this.$vApp.$root&>.isFullscreen&>.element===this.$vApp.$root.$el}),this.initialize(i,r)}initialize(e,i){const r=yg(this.$vApp.$pinia),n=ay(this.$vApp.$pinia),s=Jce(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 v in a)r.registerConfig({config:a[v],configLangs:[v]});r.activeBasemapConfig=l.map.basemaps.find(v=>v.id===l.map.initialBasemapId);const c=setInterval(()=>{const v=this.$vApp.$el.querySelector("#esriMap");if(v&&(clearInterval(c),this.geo.map.createMap(l.map,v),v._tippy.hide(0),s.setMaptipInstance(v._tippy),l.layers&&l.layers.length>0)){const x=l.layers.map(I=>{const P=this.geo.layer.createLayer(I);return this.geo.map.addLayer(P),P}).filter(Boolean);x.filter(I=>I.mapLayer).forEach((I,P)=>{I.loadPromise().then(()=>{I.isLoaded&&this.geo.map.reorder(I,P)}).catch(()=>console.error(`Failed to add/reorder layer: ${I.id}.`))}),x.filter(I=>!I.mapLayer).forEach(I=>{I.loadPromise().catch(()=>console.error(`Failed to add/reorder layer: ${I.id}.`))})}},100);if(l.panels){if(l.panels.open&&l.panels.open.length>0){const v=l.panels.open.map(x=>x.id);this.panel.isRegistered(v).then(()=>{l.panels?.open?.forEach(x=>{this.panel.open({id:x.id,screen:x.screen}),x.pin&&this.panel.pin(x.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?.scrollToInstance&&(this.ui.scrollToInstance=l.system?.scrollToInstance);const h={magnify:'',globe:''},p=l.system?.zoomIcon||"globe",y=h[p]||p;this.ui.getZoomIcon=()=>y}i||(i={});const o=cj(this.$vApp.$pinia);i?.startRequired?(this.startRequired=!0,o.started=!1):(this.startRequired=!1,o.started=!0,this.event.emit(cn.MAP_START)),(i.loadDefaultFixtures!==!1||e?.startingFixtures!==void 0)&&this.fixture.addDefaultFixtures(e?.startingFixtures),i.loadDefaultEvents!==!1&&this.event.addDefaultEvents()}reload(e,i){const r=cj(this.$vApp.$pinia),n=qT(this.$vApp.$pinia),s=yg(this.$vApp.$pinia),o=OP(this.$vApp.$pinia),a=gg(this.$vApp.$pinia);Object.keys(o.items).forEach(c=>{this.fixture.get(c)!==void 0&&this.fixture.remove(c)}),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,i)}component(e,i){if(i){const r=this.$element.component(e,i);return this.event.emit(cn.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=yg(this.$vApp.$pinia);return JSON.parse(JSON.stringify(e.getActiveConfig(this.language)))}useStore(e){if(!(["appbar","areas-of-interest","details","export","geosearch","grid","help","legend","mapnav","metadata","northarrow","overviewmap","scrollguard","wizard"].includes(e)&&!this.fixture.get(e)))switch(e){case"appbar":return mg(this.$vApp.$pinia);case"areas-of-interest":return Bhe(this.$vApp.$pinia);case"details":return rk(this.$vApp.$pinia);case"export":return Tj(this.$vApp.$pinia);case"geosearch":return mk(this.$vApp.$pinia);case"grid":return tj(this.$vApp.$pinia);case"help":return Ghe(this.$vApp.$pinia);case"legend":return mD(this.$vApp.$pinia);case"mapnav":return gD(this.$vApp.$pinia);case"metadata":return K3e(this.$vApp.$pinia);case"northarrow":return Hhe(this.$vApp.$pinia);case"overviewmap":return GK(this.$vApp.$pinia);case"scrollguard":return UK(this.$vApp.$pinia);case"wizard":return J3e(this.$vApp.$pinia);case"config":return yg(this.$vApp.$pinia);case"fixture":return OP(this.$vApp.$pinia);case"instance":return cj(this.$vApp.$pinia);case"layer":return gg(this.$vApp.$pinia);case"map-caption":return sD(this.$vApp.$pinia);case"maptip":return Jce(this.$vApp.$pinia);case"notification":return qT(this.$vApp.$pinia);case"panel":return ay(this.$vApp.$pinia);default:console.error(`The store ${e} does not exist.`);return}}setLanguage(e){if(this.$i18n.locale.value===e)return;const r=yg(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(cn.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(){GT.isEnabled&>.toggle(this.$element._container||void 0)}get isFullscreen(){return this._isFullscreen}get started(){return cj(this.$vApp.$pinia).started}updateAlert(e){const i=this.$vApp.$el.querySelector(".screen-reader-alert");i.childNodes.length>0&&(i.innerHTML="");const r=document.createElement("span");r.setAttribute("role","alert");const n=document.createTextNode(e);r.appendChild(n),i.insertBefore(r,null)}scrollToInstance(){this.ui.scrollToInstance&&this.$element._container?.scrollIntoView({behavior:"smooth"})}start(){const e=cj(this.$vApp.$pinia);!e.started&&this.startRequired?(this.event.emit(cn.MAP_START),e.started=!0):e.started&&console.warn("start has already been called")}}function xTi(t,e){const i=vvi();i.use(({store:o})=>{const a=uct(o.$state);o.$reset=()=>o.$patch(uct(a))});const r=a1i(),n=xce(cSi).use(r).use(sSi,{directive:"tippy",component:"tippy"}).use(i);n.directive("focus-container",ySi),n.directive("focus-list",dSi),n.directive("focus-item",fSi),n.directive("truncate",iCi),n.component("panel-screen",cCi),n.component("pin",mCi),n.component("close",_Ci),n.component("back",SCi),n.component("expand",OCi),n.component("panel-options-menu",qCi),n.component("dropdown-menu",l3e),n.component("minimize",FCi),n.component("right",BCi),n.component("left",zCi),n.component("fullscreen-nav-button",ZCi),n.component("geolocator-nav-button",eTi),n.component("home-nav-button",iTi),n.component("mapnav-button",sTi),n.component("appbar-button",uTi),n.component("transition",eD),n.component("transition-group",yce),n.config.globalProperties.$iApi=e,n.config.globalProperties.$pinia=i,n.provide("iApi",e);const s=n.mount(t);return{element:n,app:s,i18n:r.global}}class bdt{esriBasemap;config;constructor(e){this.config=e,this.esriBasemap=new iR({baseLayers:e.layers.map(i=>{if(i.layerType===_n.TILE)return new nEe({url:i.url,opacity:i.opacity});if(i.layerType===_n.MAPIMAGE)return new KTe({url:i.url,opacity:i.opacity});if(i.layerType===_n.OSM)return new tEe({opacity:i.opacity});throw new Error(`Unsupported layer type provided to basemap config: ${i.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 wdt extends Gp{esriMap;_basemapStore;created=!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 Yf,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")}createMap(e,i){this._basemapStore=e.basemaps.map(n=>new bdt(n));const r={};e.initialBasemapId&&(r.basemap=Qs(this.findBasemap(e.initialBasemapId).esriBasemap)),this.esriMap=ya(new KZe(r)),this.pointZoomScale=e.pointZoomScale&&e.pointZoomScale>0?e.pointZoomScale:5e4,this._targetDiv=i,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,i){if(!this.esriMap||!this.esriView){this.noMapErr();return}this.destroyMap(),this.createMap(e,i)}createMapView(e){this.abstractError()}destroyMapView(){if(!this.esriView){this.noMapErr();return}this._viewPromise=new Yf,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 i=this._basemapStore.find(r=>r.id===e);if(i)return i;throw new Error(`Invalid basemap id requested: ${e}`)}applyBasemap(e){if(!this.esriMap){this.noMapErr();return}const i=typeof e=="string"?this.findBasemap(e):e;this.esriMap.basemap=Qs(i.esriBasemap)}setBasemap(e){return this.abstractError(),!1}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,i,r=!0){if(this.esriView){if(e.invalid())throw new Error("attempt to zoom to invalid geometry");const n=await this.geomToMapSR(e),s={target:this.$iApi.geo.geom.geomRampToEsri(n)};n.type===pl.POINT&&(s.scale=i||this.pointZoomScale);const o={animate:r};return this.viewPromise.then(()=>this.esriView.goTo(s,o))}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?Ad.fromESRI(this.esriView.extent):(this.noMapErr(),Ad.fromParams("i_am_error",0,1,0,1))}getExtentSet(){return this._rampExtentSet?this._rampExtentSet:(this.noMapErr(),yX.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(),ml.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 STi extends Gp{maptipStore;constructor(e){super(e),this.maptipStore=Jce(this.$vApp.$pinia)}#e=void 0;#t=void 0;async checkAtCoord(e){this.#t=e;const i=await this.$iApi.geo.map.getGraphicAtCoord(e);if(this.#t!==e)return;if(!i){this.clear();return}if(this.#e&&this.#e.layerId===i.layerId&&this.#e.oid===i.oid&&this.#e.layerIdx===i.layerIdx)return;this.clear(),this.#e=i;const r=this.$iApi.geo.layer.getLayer(i.layerId);if(!r){console.error(`graphic hit test returned non-existent layer id: ${i.layerId}`);return}if(!r.hovertips)return;const n=await r.getIcon(i.oid),s=await r.getGraphic(i.oid,{getAttribs:!0});this.setPoint(this.$iApi.geo.map.screenPointToMapPoint(e)),this.$iApi.event.emit(cn.MAP_GRAPHICHIT,{layer:r,graphicHit:i,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 CTi extends wdt{overviewGraphicLayer;overviewmapStore;constructor(e){super(e),this.overviewGraphicLayer=this.$iApi.geo.layer.createLayer({id:"RampOverviewGraphic",layerType:_n.GRAPHIC,url:"",cosmetic:!0}),this.overviewmapStore=GK(this.$vApp.$pinia)}createMapView(e){if(!e)throw new Error("Attempted to create overview map view without a basemap");const i=typeof e=="string"?this.findBasemap(e):e;this.applyBasemap(i),this._rampExtentSet=this.$iApi.geo.map.getExtentSet().clone(),this._rampSR=this._rampExtentSet.sr.clone();const r=this.overviewmapStore.expandFactor;this.esriView=ya(new rnt({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.when(()=>{this._viewPromise.resolveMe(),this.created=!0})}async addMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}const e=new I1(this.$iApi.geo.map.getExtent(),"overview-graphic"),i=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 xV({fill:{colour:o},outline:{colour:i,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 i=this._basemapStore.find(r=>r.id===e);if(i)return i;{const n=yg(this.$vApp.$pinia).config.map;if(n){const s=n.basemaps.find(o=>o.id===e);if(s)return new bdt(s)}}throw new Error(`Invalid basemap id requested: ${e}`)}setBasemap(e){if(!this.esriView||!this.esriMap)return this.noMapErr(),!1;const i=this.findBasemap(e),n=(this.getCurrentBasemapId()?this.findBasemap(this.getCurrentBasemapId()):void 0)?.tileSchemaId!==i.tileSchemaId;return n?(this.destroyMapView(),this.createMapView(i)):this.applyBasemap(i),n}startExtent=null;async mapDrag(e){if(e.native.pointerType==="mouse"){if(e.action==="start")await this.cursorHitTest(e)&&(this.startExtent=ya(this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry));else if(this.startExtent){const i=this.esriView.toMap(e.origin),r=this.esriView.toMap({x:e.x,y:e.y}),n=this.startExtent.clone().offset(r.x-i.x,r.y-i.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 i=this.overviewmapStore.expandFactor,r=this.zoomMapTo(e.expand(i),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 TTi extends Gp{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 i=sD(this.$vApp.$pinia);if(e.mapCoords.disabled)i.coords={disabled:!0};else{const r=e.mapCoords.formatter;r!==void 0&&this.setPointFormatter(r)}if(e.scaleBar.disabled)i.scale={disabled:!0};else{const r=e.scaleBar.imperialScale;r!==void 0&&(i.toggleScale(r),this.$iApi.geo.map.viewPromise.then(()=>{this.updateScale()}))}}updateAttribution(e){const i={text:{value:"Powered by ESRI"},logo:{altText:"ESRI logo",link:"https://www.esri.com/",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"}};if(e){e.logo.disabled||(i.logo.altText=e.logo.altText||i.logo.altText,i.logo.link=e.logo.link||i.logo.link,i.logo.value=e.logo.value||i.logo.value),e.text.disabled||(i.text.value=e.text.value||i.text.value);const r=sD(this.$vApp.$pinia);r.attribution=i}if(!e||e.text.disabled){if(!this.$iApi.geo.map.esriMap){console.warn("Attempted to fetch map attribution with undefined map");return}let r="";const n=5e3,s=20,o=this.$iApi.geo.map.esriMap.basemap.baseLayers.map(a=>new Promise(l=>{let c=0;const h=n/s,p=setInterval(function(){a.loaded&&!a.loadError?(clearInterval(p),l(a)):c>h&&(clearInterval(p),l(null)),c++},s)})).toArray();Promise.all(o).then(a=>{r=a.filter(c=>c?.copyright).map(c=>c.copyright).join(" | "),i.text.value=r||i.text.value;const l=sD(this.$vApp.$pinia);l.attribution=i})}}updateScale(){const e=sD(this.$vApp.$pinia),i=e.scale;if(i?.disabled)return;const r=i?.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,i=this.$iApi.geo.map.getResolution(),r=[],n=i*e,s=1609.34,o=3.28084,a=n>1e3?["km","mi"]:["m","ft"];for(let l=0;l<2;l++){const c=l===1;if(r.push({isImperialScale:c,units:a[l],pixels:0,distance:0}),n>1e3){const h=i*e/(c?s:1e3),p=Math.round(h).toString().length,y=Math.pow(10,p-1);r[l].distance=Math.ceil(h/y)*y,r[l].pixels=r[l].distance*(c?s:1e3)/i}else r[l].distance=Math.ceil(c?n*o:n),r[l].pixels=n/i}return r}wrapValue(e,i,r){return((e-i)%(r-i)+(r-i))%(r-i)+i}async formatLatLongDMS(e){const i=await this.$iApi.geo.proj.projectGeometry(4326,e),r=this.wrapValue(i.y,-90,90),n=this.wrapValue(i.x,-180,180),s=String.fromCharCode(176),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),c=Math.floor(Math.abs(n))*(n<0?-1:1),h=Math.floor(Math.abs((n-c)*60)),p=Math.floor((Math.abs(n)-Math.abs(c)-h/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(c),"number")}${s} ${this.$iApi.$i18n.n(h,"number",{minimumIntegerDigits:2})}' ${this.$iApi.$i18n.n(p,"number",{minimumIntegerDigits:2})}" ${this.$iApi.$i18n.t("map.coordinates."+(0>n?"west":"east"))}`}async formatLatLongDDM(e){const i=await this.$iApi.geo.proj.projectGeometry(4326,e),r=this.wrapValue(i.y,-90,90),n=this.wrapValue(i.x,-180,180),s=String.fromCharCode(176),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),c=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(c,"number",{minimumIntegerDigits:2,minimumFractionDigits:5,maximumFractionDigits:5})} ${this.$iApi.$i18n.t("map.coordinates."+(0>n?"west":"east"))}`}async formatLatLongDD(e){const i=await this.$iApi.geo.proj.projectGeometry(4326,e),r=this.wrapValue(i.y,-90,90),n=this.wrapValue(i.x,-180,180),s=String.fromCharCode(176),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 i=await this.$iApi.geo.proj.projectGeometry(102100,e);return`${this.$iApi.$i18n.n(Math.floor(i.x),"number")} m | ${this.$iApi.$i18n.n(Math.floor(i.y),"number")} m`}async formatLambert(e){const i=await this.$iApi.geo.proj.projectGeometry(3978,e);return`${this.$iApi.$i18n.n(Math.abs(Math.floor(i.x)),"number")} m ${this.$iApi.$i18n.t("map.coordinates."+(0>i.x?"west":"east"))} | ${this.$iApi.$i18n.n(Math.abs(Math.floor(i.y)),"number")} m ${this.$iApi.$i18n.t("map.coordinates."+(i.y>0?"north":"south"))}`}async formatUTM(e){const i=await this.$iApi.geo.proj.projectGeometry(4326,e),r=this.wrapValue(i.y,-90,90),n=this.wrapValue(i.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 i=await this.$iApi.geo.proj.projectGeometry(this.$iApi.geo.map.getSR(),e);return`${this.$iApi.$i18n.n(i.x,"number")} | ${this.$iApi.$i18n.n(i.y,"number")}`}}class ETi extends wdt{maptip;caption;mapMouseThrottle;constructor(e){super(e),this.maptip=new STi(e),this.caption=new TTi(e),this.mapMouseThrottle=0}createMap(e,i){this.setMapMouseThrottle(e.mapMouseThrottle??0),super.createMap(e,i),this.viewPromise.then(()=>{this.$iApi.event.emit(cn.MAP_CREATED)})}destroyMap(){if(!this.esriMap||!this.esriView){this.noMapErr();return}this.$iApi.geo.layer.allLayersOnMap().map(e=>e.uid).forEach(e=>this.removeLayer(e)),super.destroyMap(),this.$iApi.event.emit(cn.MAP_DESTROYED)}createMapView(e){const r=yg(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);this.applyBasemap(n);const 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=yX.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=ya(new rnt({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=>{const c=this.$iApi.geo.geom.geomEsriToRamp(l,"map_extent_event");this.$iApi.event.emit(cn.MAP_EXTENTCHANGE,c),this.$iApi.event.emit(cn.FILTER_CHANGE,{extent:c,filterKey:Nf.EXTENT})})}),this.handlers.push({type:"scale",handler:this.esriView.watch("scale",l=>{this.$iApi.event.emit(cn.MAP_SCALECHANGE,l)})}),this.handlers.push({type:"resize",handler:this.esriView.on("resize",l=>{this.$iApi.event.emit(cn.MAP_RESIZED,{height:l.height,width:l.width})})}),this.handlers.push({type:"click",handler:this.esriView.on("click",l=>{this.$iApi.event.emit(cn.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(cn.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",Z2(100,!0,l=>{this.$iApi.event.emit(cn.MAP_MOUSEMOVE_START,this.$iApi.geo.geom.esriMapMouseToRamp(l))}))}),this.handlers.push({type:"pointer-move-end",handler:this.esriView.on("pointer-move",Z2(100,l=>{this.$iApi.event.emit(cn.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(cn.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(cn.MAP_MOUSEDOWN,l.native)})}),this.handlers.push({type:"key-down",handler:this.esriView.on("key-down",l=>{this.$iApi.event.emit(cn.MAP_KEYDOWN,l.native),l.stopPropagation()})}),this.handlers.push({type:"key-up",handler:this.esriView.on("key-up",l=>{this.$iApi.event.emit(cn.MAP_KEYUP,l.native),l.stopPropagation()})}),this.handlers.push({type:"focus",handler:this.esriView.on("focus",l=>{this.$iApi.event.emit(cn.MAP_FOCUS,l.native)})}),this.handlers.push({type:"blur",handler:this.esriView.on("blur",l=>{this.$iApi.event.emit(cn.MAP_BLUR,l.native)})}),this.esriView.container.addEventListener("touchmove",l=>{l.preventDefault()}),this.esriView.when(()=>{this._viewPromise.resolveMe(),this.created=!0})}destroyMapView(){this.esriView?.container.removeEventListener("touchmove",e=>{e.preventDefault()}),super.destroyMapView()}applyBasemap(e){if(!this.esriMap){this.noMapErr();return}const i=typeof e=="string"?this.findBasemap(e):e;this.esriMap.basemap=Qs(i.esriBasemap);const r=yg(this.$vApp.$pinia);r.activeBasemapConfig=i.config}setBasemap(e){if(!this.esriView||!this.esriMap)return this.noMapErr(),!1;const i=yg(this.$vApp.$pinia),r=this.findBasemap(e),s=i.activeBasemapConfig.tileSchemaId!==r.tileSchemaId;if(s){const o=this.getExtent().center(),a=this.getScale();this._viewPromise=new Yf,this.created=!1,this.$iApi.event.emit(cn.MAP_REFRESH_START),this.destroyMapView(),this.createMapView(r),this.viewPromise.then(()=>{this.$iApi.event.emit(cn.MAP_REFRESH_END);const l=this.findClosestScale(a);this.$iApi.geo.proj.projectGeometry(this._rampSR,o).then(c=>this.zoomMapTo(c,l,!1))})}else this.applyBasemap(r),this.esriView.set("background.color",new yP(r.backgroundColour).toESRI());return this.$iApi.event.emit(cn.MAP_BASEMAPCHANGE,{basemapId:e,schemaChanged:s}),s}addLayer(e,i=void 0){return new Promise((r,n)=>{this.esriMap||(this.noMapErr(),n()),e.initiationState!==Uv.INITIATING&&e.initiationState!==Uv.INITIATED&&e.layerState!==Rp.ERROR&&e.initiate();const s=gg(this.$vApp.$pinia);s.addInitiatingLayer(e);let o=0;const a=setInterval(()=>{o+=250,o>=2e4||e.layerState===Rp.ERROR?(clearInterval(a),s.removeInitiatingLayer(e),s.addErrorLayer(e),e.onError(),n()):e.initiationState===Uv.INITIATED&&(e.esriLayer||!e.mapLayer)&&(clearInterval(a),e.mapLayer?(this.esriMap?.add(e.esriLayer),s.removeInitiatingLayer(e),s.addLayer(e),i!==void 0&&this.reorder(e,i)):(s.removeInitiatingLayer(e),s.addDataLayer(e),e.onLoad()),this.$iApi.event.emit(cn.LAYER_REGISTERED,e),r())},250)})}reorder(e,i,r=!1){if(!this.esriMap){this.noMapErr();return}if(e.esriLayer){if(r&&e.isCosmetic)return;const n=gg(this.$vApp.$pinia),s=n.layers,o=s.slice(0,i+1).filter(l=>!this.esriMap.layers.find(c=>c.id===l.id)).length,a=this.esriMap.layers.indexOf(this.esriMap.layers.filter(l=>{const c=s.find(h=>h.id===l.id);return!!c&&!(r&&c.isCosmetic)}).slice(0,i+1-o).pop());this.esriMap.reorder(e.esriLayer,a),n.reorderLayer(e,i),this.$iApi.event.emit(cn.MAP_REORDER,{layer:e,newIndex:i})}else console.error("Attempted reorder without an esri layer. Likely layer.initiate() was not called or had not finished.")}removeSublayer(e){let i,r;if(typeof e=="string")i=e,r=this.$iApi.geo.layer.getLayer(i);else{if(!e.isSublayer)throw new Error(`Attempted to call removeSublayer on a non-sublayer object: ${e}`);i=e.uid,r=e}if(!r)throw new Error("Sublayer could not be found for removal.");this.$iApi.event.emit(cn.LAYER_REMOVE,e),r.visibility=!1,r.isRemoved=!0,r.parentLayer?.sublayers.every(n=>n.isRemoved)&&this.removeLayer(r.parentLayer)}removeLayer(e){if(!this.esriMap){this.noMapErr();return}let i;if(e instanceof $P?i=e:i=this.$iApi.geo.layer.getLayer(e),!i)throw new Error("Layer could not be found for removal.");if(i.isSublayer){this.removeSublayer(i);return}if(i.mapLayer&&!i.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.");i.supportsSublayers&&i.sublayers.some(n=>!n.isRemoved)&&i.sublayers.forEach(n=>this.removeSublayer(n)),i.terminate();const r=gg(this.$vApp.$pinia);r.removeLayer(i),r.removeLayerConfig(i.id),i.mapLayer&&this.esriMap.remove(i.esriLayer),i.isRemoved=!0,this.$iApi.event.emit(cn.LAYER_REMOVE,i)}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 i=this.handlers.findIndex(r=>r.type==="pointer-move");if(i!==-1){const r=this.handlers[i];this.handlers.splice(i,1),r.handler.remove()}return i!==-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 PP(this.mapMouseThrottle,e=>{this.$iApi.event.emit(cn.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 i=e.isOffScale(this.getScale());if(!i.offScale)return;const r=this.esriView.constraints.lods;if(!r)return this.zoomMapTo(this.getExtent().center(),(i.zoomIn,e.minScale));const n=i.zoomIn?r:[...r].reverse(),s=n.find(o=>i.zoomIn?o.scalee.maxScale)||n[n.length-1];return this.zoomToLevel(s.level)}findClosestScale(e){const i=this.esriView?.constraints.lods;if(!i)return e;const r=i.map(s=>Math.abs(s.scale-e)),n=r.indexOf(Math.min(...r));return i[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?iy.fromESRI(this.esriView.toMap({x:e.screenX,y:e.screenY}),"mappoint"):(this.noMapErr(),new iy("i_am_error",[0,0],void 0,!0))}mapPointToScreenPoint(e){if(this.esriView){const i=this.esriView.toScreen(e.toESRI());return{screenX:i.x,screenY:i.y}}else return this.noMapErr(),{screenX:1,screenY:1}}runIdentify(e){const i=gg(this.$vApp.$pinia).layers;let r;if(e instanceof iy){const c=this.mapPointToScreenPoint(e);r={mapPoint:e,screenX:c.screenX,screenY:c.screenY,button:0,input:"mouse",clickTime:Date.now()}}else r=e;if(i===void 0)return{click:r,results:[]};let n=Promise.resolve([]);i.some(c=>c.canIdentify()&&(c.identifyMode===Tm.HYBRID||c.identifyMode===Tm.SYMBOLIC))&&(n=this.esriView.hitTest({x:r.screenX,y:r.screenY}).then(c=>c.results.map(h=>({layerId:h.layer.id,layerIdx:0,oid:h.graphic.getObjectId()}))));const s={geometry:r.mapPoint,hitTest:n},o=i.filter(c=>c.supportsIdentify).map(c=>(s.tolerance=r.input=="touch"?c.touchTolerance:c.mouseTolerance,c.runIdentify(s))).flat(),a=Date.now();o.forEach(c=>{c.requestTime=a});const l={results:o,click:r};return this.$iApi.event.emit(cn.MAP_IDENTIFY,l),l}async getGraphicAtCoord(e){if(!this.esriView){this.noMapErr();return}const i=gg(this.$vApp.$pinia).layers?.slice(0);if(i===void 0)return;i.reverse();const r=await this.esriView.hitTest({x:e.screenX,y:e.screenY}),n=r.results;if(r.results.length===0)return;let s;if(i.some(o=>{const a=n.find(l=>l.graphic.layer.id===o.id);if(a){if(o.isCosmetic)return!0;s=o}return a!==void 0}),s){s.sublayers.length>1&&console.warn("Found layer with sublayers during hitTest"),s.drawOrder.length===0&&console.warn("Found layer with no draw order during hitTest");let o=n.filter(p=>p.graphic.layer.id===s.id);const a=(p,y)=>p===y?0:p>y?1:-1;let l=[],c;if(s.drawOrder.some((p,y)=>(l=[o.pop()],c=l[0].graphic.attributes[p.field],o.forEach(v=>{const x=v.graphic.attributes[p.field],I=a(c,x);I===0?l.push(v):(p.ascending&&I>0||!p.ascending&&I<0)&&(l=[v],c=x)}),l.length===1||y===s.drawOrder.length-1?!0:(o=l,!1))),l.length===0){console.error("Hit test failed to find topmost item using draw order");return}return{oid:l[0].graphic.getObjectId(),layerId:s.id,layerIdx:s.getLayerTree().layerIdx}}}_activeKeys=[];_panInterval;_mouseFocus=!1;mapKeyDown(e){const i=["=","-"];["Shift","Control","ArrowDown","ArrowLeft","ArrowRight","ArrowUp"].includes(e.key)&&!this._activeKeys.includes(e.key)?(this._activeKeys.push(e.key),this._activeKeys.some(n=>i.includes(n))||this.keyPan()):i.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 i=["=","-"];this._activeKeys.includes(e.key)&&!i.includes(e.key)&&(this._activeKeys.splice(this._activeKeys.indexOf(e.key),1),this._activeKeys.some(r=>i.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(),i=this.mapPointToScreenPoint(e),r=this.screenPointToMapPoint({screenX:i.screenX+5,screenY:i.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 h=0;h{e.x+=l*o,e.y+=l*a,this.zoomMapTo(e,c,!1)},25)}}const ITi={circlePoint:{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}}}},solidLine:{geometryType:"polyline",renderer:{type:"simple",symbol:{type:"esriSLS",style:"esriSLSSolid",color:[90,90,90,200],width:2}}},outlinedPoly:{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}}}},boundingBoxPoly:{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}}}}};var xdt={exports:{}};(function(t,e){(function(i,r){if(t.exports=r(Ont()),typeof i.navigator=="object"){if(!i.Terraformer)throw new Error("Terraformer.ArcGIS requires the core Terraformer library. https://github.com/esri/Terraformer");i.Terraformer.ArcGIS=r(i.Terraformer)}})(Jh,function(i){var r={};function n(P){var F=0,k=0,j=[],V,Y,X,Z;X=P.match(/((\+|\-)[^\+\-]+)/g),Z=parseInt(X[0],32);for(var ie=1;ie=0}function c(P){var F=[],k=P.slice(0),j=s(k.shift().slice(0));if(j.length>=4){l(j)||j.reverse(),F.push(j);for(var V=0;V=4&&(l(Y)&&Y.reverse(),F.push(Y))}}return F}function h(P){for(var F=[],k=0;k=0;V--){var Y=j[V].slice(0);F.push(Y)}return F}function p(P,F){var k=i.Tools.arraysIntersectArrays(P,F),j=i.Tools.coordinatesContainPoint(P,F[0]);return!!(!k&&j)}function y(P){for(var F=[],k=[],j,V,Y,X=0;X=0;j--)if(V=F[j][0],p(V,Y)){F[j].push(Y),he=!0;break}he||ce.push(Y)}for(;ce.length;){Y=ce.pop();var _e=!1;for(j=F.length-1;j>=0;j--)if(V=F[j][0],i.Tools.arraysIntersectArrays(V,Y)){F[j].push(Y),_e=!0;break}_e||F.push([Y.reverse()])}return F.length===1?{type:"Polygon",coordinates:F[0]}:{type:"MultiPolygon",coordinates:F}}function v(P,F){var k={};return F=F||{},F.idAttribute=F.idAttribute||void 0,P.spatialReference&&(P.spatialReference.wkid===3857||P.spatialReference.wkid===102100)&&(k.crs=i.MercatorCRS),typeof P.x=="number"&&typeof P.y=="number"&&(k.type="Point",k.coordinates=[P.x,P.y],(P.z||P.m)&&k.coordinates.push(P.z),P.m&&k.coordinates.push(P.m)),P.points&&(k.type="MultiPoint",k.coordinates=P.points.slice(0)),P.paths&&(P.paths.length===1?(k.type="LineString",k.coordinates=P.paths[0].slice(0)):(k.type="MultiLineString",k.coordinates=P.paths.slice(0))),P.rings&&(k=y(P.rings.slice(0))),typeof P.xmin=="number"&&typeof P.ymin=="number"&&typeof P.xmax=="number"&&typeof P.ymax=="number"&&(k.type="Polygon",k.coordinates=[[[P.xmax,P.ymax],[P.xmin,P.ymax],[P.xmin,P.ymin],[P.xmax,P.ymin],[P.xmax,P.ymax]]]),(P.compressedGeometry||P.geometry||P.attributes)&&(k.type="Feature",P.compressedGeometry&&(P.geometry={paths:[n(P.compressedGeometry)]}),k.geometry=P.geometry?v(P.geometry):null,k.properties=P.attributes?a(P.attributes):null,P.attributes&&(k.id=P.attributes[F.idAttribute]||P.attributes.OBJECTID||P.attributes.FID)),new i.Primitive(k)}function x(P,F){var k;F=F||{};var j=F.idAttribute||"OBJECTID";F.sr?k={wkid:F.sr}:P&&P.crs&&P.crs.properties.name!="urn:ogc:def:crs:OGC:1.3:CRS84"?k=null:k={wkid:4326};var V={},Y;switch(P.type){case"Point":V.x=P.coordinates[0],V.y=P.coordinates[1],P.coordinates[2]&&(V.z=P.coordinates[2]),P.coordinates[3]&&(V.m=P.coordinates[3]),V.spatialReference=k;break;case"MultiPoint":V.points=P.coordinates.slice(0),V.spatialReference=k;break;case"LineString":V.paths=[P.coordinates.slice(0)],V.spatialReference=k;break;case"MultiLineString":V.paths=P.coordinates.slice(0),V.spatialReference=k;break;case"Polygon":V.rings=c(P.coordinates.slice(0)),V.spatialReference=k;break;case"MultiPolygon":V.rings=h(P.coordinates.slice(0)),V.spatialReference=k;break;case"Feature":P.geometry&&(V.geometry=x(P.geometry,F)),V.attributes=P.properties?a(P.properties):{},P.id&&(V.attributes[j]=P.id);break;case"FeatureCollection":for(V=[],Y=0;Y=x)return y;if(k)return k=!1,p;var Y=I,X;if(c.charCodeAt(Y)===34){for(var Z=Y;Z++=0?0:1],n=Math.abs(t),s=Math.floor(n),o=n-s,a=o*60,l=Math.floor(a),c=Math.floor((a-l)*60);return{whole:s,minutes:l,seconds:c,dir:r}}function O3e(t,e){if(e||(e="NSEW"),typeof t!="string")return null;t=t.toUpperCase();var i=/^[\s\,]*([NSEW])?\s*([\-|\—|\―]?[0-9.]+)[°º˚]?\s*(?:([0-9.]+)['’′‘]\s*)?(?:([0-9.]+)(?:''|"|”|″)\s*)?([NSEW])?/,r=t.match(i);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,c=o<0?-1:1;return(s==="S"||s==="W")&&(c*=-1),{val:(Math.abs(o)+a+l)*c,dim:s,matched:n,remain:t.slice(n.length)}}function VCi(t,e){t=t.trim();var i=O3e(t,e);if(!i)return null;t=i.remain.trim();var r=O3e(t,e);return!r||r.remain?null:i.dim?UCi(i.val,r.val,i.dim):[i.val,r.val]}function UCi(t,e,i){if(i==="N"||i==="S")return[t,e];if(i==="W"||i==="E")return[e,t]}var wV=NCi,zht=dN,Hht=/(Lat)(itude)?/gi,Wht=/(L)(on|ng)(gitude)?/i;function qht(t,e){var i,r,n;for(var s in t)r=s.match(e),r&&(!i||r[0].length/s.length>n)&&(n=r[0].length/s.length,i=s);return i}function Yht(t){return qht(t,Hht)}function Xht(t){return qht(t,Wht)}function jCi(t){return!!t.match(Hht)}function zCi(t){return!!t.match(Wht)}function Kht(t){return typeof t=="object"?Object.keys(t).length:0}function Jht(t){var e=[",",";"," ","|"],i=[];return e.forEach(function(r){var n=wV.dsvFormat(r).parse(t);if(n.length>=1){for(var s=Kht(n[0]),o=0;o"u"?typeof self>"u"?typeof window>"u"?{}:window:self:kp)},{"./binaryajax-browser":1,"./combine":3,buffer:8}],3:[function(l,c){(function(d){(function(){const p=d.URL;c.exports=(y,v)=>{if(!v)return y;const S=new p(y);return S.pathname=`${S.pathname}.${v}`,S.href}}).call(this)}).call(this,typeof kp>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:kp)},{}],4:[function(l,c){function d(I){let O=0,L=1;const N=I.length;for(let G,V;L{const y=new d;await y.loadAsync(p);const v=y.file(/.+/),S={};return await Promise.all(v.map(async I=>{let O;O=I.name.slice(-3).toLowerCase()==="shp"||I.name.slice(-3).toLowerCase()==="dbf"?await I.async("nodebuffer"):await I.async("text"),S[I.name]=O})),S}},{jszip:11}],6:[function(l,c,d){function p(te){var re=te.length;if(0>16,_e[Ie++]=255&Ne>>8,_e[Ie++]=255&Ne;return ge===2&&(Ne=N[te.charCodeAt(J)]<<2|N[te.charCodeAt(J+1)]>>4,_e[Ie++]=255&Ne),ge===1&&(Ne=N[te.charCodeAt(J)]<<10|N[te.charCodeAt(J+1)]<<4|N[te.charCodeAt(J+2)]>>2,_e[Ie++]=255&Ne>>8,_e[Ie++]=255&Ne),_e}function S(te){return L[63&te>>18]+L[63&te>>12]+L[63&te>>6]+L[63&te]}function I(te,re,fe){for(var ge=[],_e=re,Ie;_eke?ke:Ie+_e));return fe===1?(Ne=te[re-1],ge.push(L[Ne>>2]+L[63&Ne<<4]+"==")):fe===2&&(Ne=(te[re-2]<<8)+te[re-1],ge.push(L[Ne>>10]+L[63&Ne>>4]+L[63&Ne<<2]+"=")),ge.join("")}d.byteLength=function(te){var re=p(te),fe=re[0],ge=re[1];return 3*(fe+ge)/4-ge},d.toByteArray=v,d.fromByteArray=O;for(var L=[],N=[],G=typeof Uint8Array>"u"?Array:Uint8Array,V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Y=0,X=V.length;YLe)throw new RangeError('The value "'+Le+'" is invalid for option "size"')}function I(Le,ce,Ce){return S(Le),0>=Le||ce===void 0?p(Le):typeof Ce=="string"?p(Le).fill(ce,Ce):p(Le).fill(ce)}function O(Le){return S(Le),p(0>Le?0:0|Y(Le))}function L(Le,ce){if((typeof ce!="string"||ce==="")&&(ce="utf8"),!y.isEncoding(ce))throw new TypeError("Unknown encoding: "+ce);var Ce=0|X(Le,ce),Ze=p(Ce),yt=Ze.write(Le,ce);return yt!==Ce&&(Ze=Ze.slice(0,yt)),Ze}function N(Le){for(var ce=0>Le.length?0:0|Y(Le.length),Ce=p(ce),Ze=0;Zece||Le.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|Le}function X(Le,ce){if(y.isBuffer(Le))return Le.length;if(ArrayBuffer.isView(Le)||kt(Le,ArrayBuffer))return Le.byteLength;if(typeof Le!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Le);var Ce=Le.length,Ze=2>>1;case"base64":return Be(Le).length;default:if(yt)return Ze?-1:Lt(Le).length;ce=(""+ce).toLowerCase(),yt=!0}}function te(Le,ce,Ce){var Ze=!1;if((ce===void 0||0>ce)&&(ce=0),ce>this.length||((Ce===void 0||Ce>this.length)&&(Ce=this.length),0>=Ce)||(Ce>>>=0,ce>>>=0,Ce<=ce))return"";for(Le||(Le="utf8");;)switch(Le){case"hex":return Ge(this,ce,Ce);case"utf8":case"utf-8":return Pe(this,ce,Ce);case"ascii":return Ae(this,ce,Ce);case"latin1":case"binary":return ze(this,ce,Ce);case"base64":return xe(this,ce,Ce);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Je(this,ce,Ce);default:if(Ze)throw new TypeError("Unknown encoding: "+Le);Le=(Le+"").toLowerCase(),Ze=!0}}function re(Le,ce,Ce){var Ze=Le[ce];Le[ce]=Le[Ce],Le[Ce]=Ze}function fe(Le,ce,Ce,Ze,yt){if(Le.length===0)return-1;if(typeof Ce=="string"?(Ze=Ce,Ce=0):2147483647Ce&&(Ce=-2147483648),Ce=+Ce,ct(Ce)&&(Ce=yt?0:Le.length-1),0>Ce&&(Ce=Le.length+Ce),Ce>=Le.length){if(yt)return-1;Ce=Le.length-1}else if(0>Ce)if(yt)Ce=0;else return-1;if(typeof ce=="string"&&(ce=y.from(ce,Ze)),y.isBuffer(ce))return ce.length===0?-1:ge(Le,ce,Ce,Ze,yt);if(typeof ce=="number")return ce&=255,typeof Uint8Array.prototype.indexOf=="function"?yt?Uint8Array.prototype.indexOf.call(Le,ce,Ce):Uint8Array.prototype.lastIndexOf.call(Le,ce,Ce):ge(Le,[ce],Ce,Ze,yt);throw new TypeError("val must be string, number or Buffer")}function ge(Le,ce,Ce,Ze,yt){function Ve(W,T){return At===1?W[T]:W.readUInt16BE(T*At)}var At=1,ii=Le.length,gt=ce.length;if(Ze!==void 0&&(Ze=(Ze+"").toLowerCase(),Ze==="ucs2"||Ze==="ucs-2"||Ze==="utf16le"||Ze==="utf-16le")){if(2>Le.length||2>ce.length)return-1;At=2,ii/=2,gt/=2,Ce/=2}var Ue;if(yt){var ni=-1;for(Ue=Ce;Ueii&&(Ce=ii-gt),Ue=Ce;0<=Ue;Ue--){for(var A=!0,ve=0;veyt&&(Ze=yt)):Ze=yt;var Ve=ce.length;Ze>Ve/2&&(Ze=Ve/2);for(var At=0,ii;AtVe&&(At=Ve):ii===2?(gt=Le[yt+1],(192>)==128&&(A=(31&Ve)<<6|63>,127A||57343A&&(At=A)))}At===null?(At=65533,ii=1):65535>>10),At=56320|1023&At),Ze.push(At),yt+=ii}return Oe(Ze)}function Oe(Le){var ce=Le.length;if(ce<=4096)return o.apply(String,Le);for(var Ce="",Ze=0;Zece)&&(ce=0),(!Ce||0>Ce||Ce>Ze)&&(Ce=Ze);for(var yt="",Ve=ce;VeLe)throw new RangeError("offset is not uint");if(Le+ce>Ce)throw new RangeError("Trying to access beyond buffer length")}function tt(Le,ce,Ce,Ze,yt,Ve){if(!y.isBuffer(Le))throw new TypeError('"buffer" argument must be a Buffer instance');if(ce>yt||ceLe.length)throw new RangeError("Index out of range")}function ft(Le,ce,Ce,Ze){if(Ce+Ze>Le.length)throw new RangeError("Index out of range");if(0>Ce)throw new RangeError("Index out of range")}function Pt(Le,ce,Ce,Ze,yt){return ce=+ce,Ce>>>=0,yt||ft(Le,ce,Ce,4),it.write(Le,ce,Ce,Ze,23,4),Ce+4}function $t(Le,ce,Ce,Ze,yt){return ce=+ce,Ce>>>=0,yt||ft(Le,ce,Ce,8),it.write(Le,ce,Ce,Ze,52,8),Ce+8}function St(Le){if(Le=Le.split("=")[0],Le=Le.trim().replace(pt,""),2>Le.length)return"";for(;Le.length%4!=0;)Le+="=";return Le}function Tt(Le){return 16>Le?"0"+Le.toString(16):Le.toString(16)}function Lt(Le,ce){ce=ce||1/0;for(var Ce=Le.length,Ze=null,yt=[],Ve=0,At;VeAt){if(!Ze){if(56319At){-1<(ce-=3)&&yt.push(239,191,189),Ze=At;continue}At=(Ze-55296<<10|At-56320)+65536}else Ze&&-1<(ce-=3)&&yt.push(239,191,189);if(Ze=null,128>At){if(0>(ce-=1))break;yt.push(At)}else if(2048>At){if(0>(ce-=2))break;yt.push(192|At>>6,128|63&At)}else if(65536>At){if(0>(ce-=3))break;yt.push(224|At>>12,128|63&At>>6,128|63&At)}else if(1114112>At){if(0>(ce-=4))break;yt.push(240|At>>18,128|63&At>>12,128|63&At>>6,128|63&At)}else throw new Error("Invalid code point")}return yt}function at(Le){for(var ce=[],Ce=0;Ce(ce-=2));++Ze)yt=Le.charCodeAt(Ze),Ve=yt>>8,At=yt%256,Ce.push(At),Ce.push(Ve);return Ce}function Be(Le){return le.toByteArray(St(Le))}function mt(Le,ce,Ce,Ze){for(var yt=0;yt=ce.length||yt>=Le.length);++yt)ce[yt+Ce]=Le[yt];return yt}function kt(Le,ce){return Le instanceof ce||Le!=null&&Le.constructor!=null&&Le.constructor.name!=null&&Le.constructor.name===ce.name}function ct(Le){return Le!==Le}var le=l("base64-js"),it=l("ieee754");d.Buffer=y,d.SlowBuffer=function(Le){return+Le!=Le&&(Le=0),y.alloc(+Le)},d.INSPECT_MAX_BYTES=50,d.kMaxLength=2147483647,y.TYPED_ARRAY_SUPPORT=function(){try{var Le=new Uint8Array(1);return Le.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},Le.foo()===42}catch{return!1}}(),y.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(y.prototype,"parent",{enumerable:!0,get:function(){return y.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){return y.isBuffer(this)?this.byteOffset:void 0}}),typeof Symbol<"u"&&Symbol.species!=null&&y[Symbol.species]===y&&Object.defineProperty(y,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),y.poolSize=8192,y.from=function(Le,ce,Ce){return v(Le,ce,Ce)},y.prototype.__proto__=Uint8Array.prototype,y.__proto__=Uint8Array,y.alloc=function(Le,ce,Ce){return I(Le,ce,Ce)},y.allocUnsafe=function(Le){return O(Le)},y.allocUnsafeSlow=function(Le){return O(Le)},y.isBuffer=function(Le){return Le!=null&&Le._isBuffer===!0&&Le!==y.prototype},y.compare=function(Le,ce){if(kt(Le,Uint8Array)&&(Le=y.from(Le,Le.offset,Le.byteLength)),kt(ce,Uint8Array)&&(ce=y.from(ce,ce.offset,ce.byteLength)),!y.isBuffer(Le)||!y.isBuffer(ce))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Le===ce)return 0;for(var Ce=Le.length,Ze=ce.length,yt=0,Ve=a(Ce,Ze);ytce&&(Le+=" ... "),""},y.prototype.compare=function(Le,ce,Ce,Ze,yt){if(kt(Le,Uint8Array)&&(Le=y.from(Le,Le.offset,Le.byteLength)),!y.isBuffer(Le))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Le);if(ce===void 0&&(ce=0),Ce===void 0&&(Ce=Le?Le.length:0),Ze===void 0&&(Ze=0),yt===void 0&&(yt=this.length),0>ce||Ce>Le.length||0>Ze||yt>this.length)throw new RangeError("out of range index");if(Ze>=yt&&ce>=Ce)return 0;if(Ze>=yt)return-1;if(ce>=Ce)return 1;if(ce>>>=0,Ce>>>=0,Ze>>>=0,yt>>>=0,this===Le)return 0;for(var Ve=yt-Ze,At=Ce-ce,ii=a(Ve,At),gt=this.slice(Ze,yt),Ue=Le.slice(ce,Ce),ni=0;ni>>=0,isFinite(Ce)?(Ce>>>=0,Ze===void 0&&(Ze="utf8")):(Ze=Ce,Ce=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var yt=this.length-ce;if((Ce===void 0||Ce>yt)&&(Ce=yt),0Ce||0>ce)||ce>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ze||(Ze="utf8");for(var Ve=!1;;)switch(Ze){case"hex":return _e(this,Le,ce,Ce);case"utf8":case"utf-8":return Ie(this,Le,ce,Ce);case"ascii":return ke(this,Le,ce,Ce);case"latin1":case"binary":return Ne(this,Le,ce,Ce);case"base64":return J(this,Le,ce,Ce);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return he(this,Le,ce,Ce);default:if(Ve)throw new TypeError("Unknown encoding: "+Ze);Ze=(""+Ze).toLowerCase(),Ve=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},y.prototype.slice=function(Le,ce){var Ce=this.length;Le=~~Le,ce=ce===void 0?Ce:~~ce,0>Le?(Le+=Ce,0>Le&&(Le=0)):Le>Ce&&(Le=Ce),0>ce?(ce+=Ce,0>ce&&(ce=0)):ce>Ce&&(ce=Ce),ce>>=0,ce>>>=0,Ce||et(Le,ce,this.length);for(var Ze=this[Le],yt=1,Ve=0;++Ve>>=0,ce>>>=0,Ce||et(Le,ce,this.length);for(var Ze=this[Le+--ce],yt=1;0>>=0,ce||et(Le,1,this.length),this[Le]},y.prototype.readUInt16LE=function(Le,ce){return Le>>>=0,ce||et(Le,2,this.length),this[Le]|this[Le+1]<<8},y.prototype.readUInt16BE=function(Le,ce){return Le>>>=0,ce||et(Le,2,this.length),this[Le]<<8|this[Le+1]},y.prototype.readUInt32LE=function(Le,ce){return Le>>>=0,ce||et(Le,4,this.length),(this[Le]|this[Le+1]<<8|this[Le+2]<<16)+16777216*this[Le+3]},y.prototype.readUInt32BE=function(Le,ce){return Le>>>=0,ce||et(Le,4,this.length),16777216*this[Le]+(this[Le+1]<<16|this[Le+2]<<8|this[Le+3])},y.prototype.readIntLE=function(Le,ce,Ce){Le>>>=0,ce>>>=0,Ce||et(Le,ce,this.length);for(var Ze=this[Le],yt=1,Ve=0;++Ve=yt&&(Ze-=s(2,8*ce)),Ze},y.prototype.readIntBE=function(Le,ce,Ce){Le>>>=0,ce>>>=0,Ce||et(Le,ce,this.length);for(var Ze=ce,yt=1,Ve=this[Le+--Ze];0=yt&&(Ve-=s(2,8*ce)),Ve},y.prototype.readInt8=function(Le,ce){return Le>>>=0,ce||et(Le,1,this.length),128&this[Le]?-1*(255-this[Le]+1):this[Le]},y.prototype.readInt16LE=function(Le,ce){Le>>>=0,ce||et(Le,2,this.length);var Ce=this[Le]|this[Le+1]<<8;return 32768&Ce?4294901760|Ce:Ce},y.prototype.readInt16BE=function(Le,ce){Le>>>=0,ce||et(Le,2,this.length);var Ce=this[Le+1]|this[Le]<<8;return 32768&Ce?4294901760|Ce:Ce},y.prototype.readInt32LE=function(Le,ce){return Le>>>=0,ce||et(Le,4,this.length),this[Le]|this[Le+1]<<8|this[Le+2]<<16|this[Le+3]<<24},y.prototype.readInt32BE=function(Le,ce){return Le>>>=0,ce||et(Le,4,this.length),this[Le]<<24|this[Le+1]<<16|this[Le+2]<<8|this[Le+3]},y.prototype.readFloatLE=function(Le,ce){return Le>>>=0,ce||et(Le,4,this.length),it.read(this,Le,!0,23,4)},y.prototype.readFloatBE=function(Le,ce){return Le>>>=0,ce||et(Le,4,this.length),it.read(this,Le,!1,23,4)},y.prototype.readDoubleLE=function(Le,ce){return Le>>>=0,ce||et(Le,8,this.length),it.read(this,Le,!0,52,8)},y.prototype.readDoubleBE=function(Le,ce){return Le>>>=0,ce||et(Le,8,this.length),it.read(this,Le,!1,52,8)},y.prototype.writeUIntLE=function(Le,ce,Ce,Ze){if(Le=+Le,ce>>>=0,Ce>>>=0,!Ze){var yt=s(2,8*Ce)-1;tt(this,Le,ce,Ce,yt,0)}var Ve=1,At=0;for(this[ce]=255&Le;++At>>=0,Ce>>>=0,!Ze){var yt=s(2,8*Ce)-1;tt(this,Le,ce,Ce,yt,0)}var Ve=Ce-1,At=1;for(this[ce+Ve]=255&Le;0<=--Ve&&(At*=256);)this[ce+Ve]=255&Le/At;return ce+Ce},y.prototype.writeUInt8=function(Le,ce,Ce){return Le=+Le,ce>>>=0,Ce||tt(this,Le,ce,1,255,0),this[ce]=255&Le,ce+1},y.prototype.writeUInt16LE=function(Le,ce,Ce){return Le=+Le,ce>>>=0,Ce||tt(this,Le,ce,2,65535,0),this[ce]=255&Le,this[ce+1]=Le>>>8,ce+2},y.prototype.writeUInt16BE=function(Le,ce,Ce){return Le=+Le,ce>>>=0,Ce||tt(this,Le,ce,2,65535,0),this[ce]=Le>>>8,this[ce+1]=255&Le,ce+2},y.prototype.writeUInt32LE=function(Le,ce,Ce){return Le=+Le,ce>>>=0,Ce||tt(this,Le,ce,4,4294967295,0),this[ce+3]=Le>>>24,this[ce+2]=Le>>>16,this[ce+1]=Le>>>8,this[ce]=255&Le,ce+4},y.prototype.writeUInt32BE=function(Le,ce,Ce){return Le=+Le,ce>>>=0,Ce||tt(this,Le,ce,4,4294967295,0),this[ce]=Le>>>24,this[ce+1]=Le>>>16,this[ce+2]=Le>>>8,this[ce+3]=255&Le,ce+4},y.prototype.writeIntLE=function(Le,ce,Ce,Ze){if(Le=+Le,ce>>>=0,!Ze){var yt=s(2,8*Ce-1);tt(this,Le,ce,Ce,yt-1,-yt)}var Ve=0,At=1,ii=0;for(this[ce]=255&Le;++VeLe&&ii===0&&this[ce+Ve-1]!==0&&(ii=1),this[ce+Ve]=255&(Le/At>>0)-ii;return ce+Ce},y.prototype.writeIntBE=function(Le,ce,Ce,Ze){if(Le=+Le,ce>>>=0,!Ze){var yt=s(2,8*Ce-1);tt(this,Le,ce,Ce,yt-1,-yt)}var Ve=Ce-1,At=1,ii=0;for(this[ce+Ve]=255&Le;0<=--Ve&&(At*=256);)0>Le&&ii===0&&this[ce+Ve+1]!==0&&(ii=1),this[ce+Ve]=255&(Le/At>>0)-ii;return ce+Ce},y.prototype.writeInt8=function(Le,ce,Ce){return Le=+Le,ce>>>=0,Ce||tt(this,Le,ce,1,127,-128),0>Le&&(Le=255+Le+1),this[ce]=255&Le,ce+1},y.prototype.writeInt16LE=function(Le,ce,Ce){return Le=+Le,ce>>>=0,Ce||tt(this,Le,ce,2,32767,-32768),this[ce]=255&Le,this[ce+1]=Le>>>8,ce+2},y.prototype.writeInt16BE=function(Le,ce,Ce){return Le=+Le,ce>>>=0,Ce||tt(this,Le,ce,2,32767,-32768),this[ce]=Le>>>8,this[ce+1]=255&Le,ce+2},y.prototype.writeInt32LE=function(Le,ce,Ce){return Le=+Le,ce>>>=0,Ce||tt(this,Le,ce,4,2147483647,-2147483648),this[ce]=255&Le,this[ce+1]=Le>>>8,this[ce+2]=Le>>>16,this[ce+3]=Le>>>24,ce+4},y.prototype.writeInt32BE=function(Le,ce,Ce){return Le=+Le,ce>>>=0,Ce||tt(this,Le,ce,4,2147483647,-2147483648),0>Le&&(Le=4294967295+Le+1),this[ce]=Le>>>24,this[ce+1]=Le>>>16,this[ce+2]=Le>>>8,this[ce+3]=255&Le,ce+4},y.prototype.writeFloatLE=function(Le,ce,Ce){return Pt(this,Le,ce,!0,Ce)},y.prototype.writeFloatBE=function(Le,ce,Ce){return Pt(this,Le,ce,!1,Ce)},y.prototype.writeDoubleLE=function(Le,ce,Ce){return $t(this,Le,ce,!0,Ce)},y.prototype.writeDoubleBE=function(Le,ce,Ce){return $t(this,Le,ce,!1,Ce)},y.prototype.copy=function(Le,ce,Ce,Ze){if(!y.isBuffer(Le))throw new TypeError("argument should be a Buffer");if(Ce||(Ce=0),Ze||Ze===0||(Ze=this.length),ce>=Le.length&&(ce=Le.length),ce||(ce=0),0ce)throw new RangeError("targetStart out of bounds");if(0>Ce||Ce>=this.length)throw new RangeError("Index out of range");if(0>Ze)throw new RangeError("sourceEnd out of bounds");Ze>this.length&&(Ze=this.length),Le.length-ceyt||Ze==="latin1")&&(Le=yt)}}else typeof Le=="number"&&(Le&=255);if(0>ce||this.length>>=0,Ce=Ce===void 0?this.length:Ce>>>0,Le||(Le=0);var Ve;if(typeof Le=="number")for(Ve=ce;Ve */d.read=function(p,y,v,S,I){var O=8*I-S-1,L=(1<>1,G=-7,V=v?I-1:0,Y=v?-1:1,X=p[y+V],te,re;for(V+=Y,te=X&(1<<-G)-1,X>>=-G,G+=O;0>=-G,G+=S;0>1,Y=I===23?s(2,-24)-s(2,-77):0,X=S?0:O-1,te=S?1:-1,re=0>y||y===0&&0>1/y?1:0,fe,ge,_e;for(y=n(y),isNaN(y)||y===1/0?(ge=isNaN(y)?1:0,fe=G):(fe=i(r(y)/L),1>y*(_e=s(2,-fe))&&(fe--,_e*=2),y+=1<=fe+V?Y/_e:Y*s(2,1-V),2<=y*_e&&(fe++,_e/=2),fe+V>=G?(ge=0,fe=G):1<=fe+V?(ge=(y*_e-1)*s(2,I),fe+=V):(ge=y*s(2,V-1)*s(2,I),fe=0));8<=I;p[v+X]=255&ge,X+=te,ge/=256,I-=8);for(fe=fe<"u"?typeof self>"u"?typeof window>"u"?{}:window:self:kp)},{}],11:[function(l,c,d){(function(p,y,v){(function(){/*! +`)}function a(c){return c.map(l).join(t)}function l(c){return c==null?"":e.test(c+="")?'"'+c.replace(/\"/g,'""')+'"':c}return{parse:r,parseRows:n,format:s,formatRows:o}}var Whe=Z3e(","),MTi=Whe.parse,DTi=Whe.parseRows,FTi=Whe.format,LTi=Whe.formatRows,qhe=Z3e(" "),NTi=qhe.parse,kTi=qhe.parseRows,$Ti=qhe.format,BTi=qhe.formatRows;const VTi=lue(Object.freeze(Object.defineProperty({__proto__:null,csvFormat:FTi,csvFormatRows:LTi,csvParse:MTi,csvParseRows:DTi,dsvFormat:Z3e,tsvFormat:$Ti,tsvFormatRows:BTi,tsvParse:NTi,tsvParseRows:kTi},Symbol.toStringTag,{value:"Module"})));var Ij={exports:{}};Ij.exports=jTi,Ij.exports.pair=UTi,Ij.exports.format=Q3e,Ij.exports.formatPair=GTi,Ij.exports.coordToDMS=Cdt;function jTi(t,e){var i=eRe(t,e);return i===null?null:i.val}function GTi(t){return Q3e(t.lat,"lat")+" "+Q3e(t.lon,"lon")}function Q3e(t,e){var i=Cdt(t,e);return i.whole+"° "+(i.minutes?i.minutes+"' ":"")+(i.seconds?i.seconds+'" ':"")+i.dir}function Cdt(t,e){var i={lat:["N","S"],lon:["E","W"]}[e]||"",r=i[t>=0?0:1],n=Math.abs(t),s=Math.floor(n),o=n-s,a=o*60,l=Math.floor(a),c=Math.floor((a-l)*60);return{whole:s,minutes:l,seconds:c,dir:r}}function eRe(t,e){if(e||(e="NSEW"),typeof t!="string")return null;t=t.toUpperCase();var i=/^[\s\,]*([NSEW])?\s*([\-|\—|\―]?[0-9.]+)[°º˚]?\s*(?:([0-9.]+)['’′‘]\s*)?(?:([0-9.]+)(?:''|"|”|″)\s*)?([NSEW])?/,r=t.match(i);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,c=o<0?-1:1;return(s==="S"||s==="W")&&(c*=-1),{val:(Math.abs(o)+a+l)*c,dim:s,matched:n,remain:t.slice(n.length)}}function UTi(t,e){t=t.trim();var i=eRe(t,e);if(!i)return null;t=i.remain.trim();var r=eRe(t,e);return!r||r.remain?null:i.dim?zTi(i.val,r.val,i.dim):[i.val,r.val]}function zTi(t,e,i){if(i==="N"||i==="S")return[t,e];if(i==="W"||i==="E")return[e,t]}var HTi=Ij.exports,Aj=VTi,Tdt=HTi,Edt=/(Lat)(itude)?/gi,Idt=/(L)(on|ng)(gitude)?/i;function Adt(t,e){var i,r,n;for(var s in t)r=s.match(e),r&&(!i||r[0].length/s.length>n)&&(n=r[0].length/s.length,i=s);return i}function Pdt(t){return Adt(t,Edt)}function Odt(t){return Adt(t,Idt)}function WTi(t){return!!t.match(Edt)}function qTi(t){return!!t.match(Idt)}function Rdt(t){return typeof t=="object"?Object.keys(t).length:0}function Mdt(t){var e=[",",";"," ","|"],i=[];return e.forEach(function(r){var n=Aj.dsvFormat(r).parse(t);if(n.length>=1){for(var s=Rdt(n[0]),o=0;o"u"?typeof self>"u"?typeof window>"u"?{}:window:self:Jh)},{"./binaryajax-browser":1,"./combine":3,buffer:8}],3:[function(l,c){(function(h){(function(){const p=h.URL;c.exports=(y,v)=>{if(!v)return y;const x=new p(y);return x.pathname=`${x.pathname}.${v}`,x.href}}).call(this)}).call(this,typeof Jh>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:Jh)},{}],4:[function(l,c){function h(I){let P=0,F=1;const k=I.length;for(let j,V;F{const y=new h;await y.loadAsync(p);const v=y.file(/.+/),x={};return await Promise.all(v.map(async I=>{let P;P=I.name.slice(-3).toLowerCase()==="shp"||I.name.slice(-3).toLowerCase()==="dbf"?await I.async("nodebuffer"):await I.async("text"),x[I.name]=P})),x}},{jszip:11}],6:[function(l,c,h){function p(Z){var ie=Z.length;if(0>16,_e[xe++]=255&ke>>8,_e[xe++]=255&ke;return he===2&&(ke=k[Z.charCodeAt(J)]<<2|k[Z.charCodeAt(J+1)]>>4,_e[xe++]=255&ke),he===1&&(ke=k[Z.charCodeAt(J)]<<10|k[Z.charCodeAt(J+1)]<<4|k[Z.charCodeAt(J+2)]>>2,_e[xe++]=255&ke>>8,_e[xe++]=255&ke),_e}function x(Z){return F[63&Z>>18]+F[63&Z>>12]+F[63&Z>>6]+F[63&Z]}function I(Z,ie,ce){for(var he=[],_e=ie,xe;_ePe?Pe:xe+_e));return ce===1?(ke=Z[ie-1],he.push(F[ke>>2]+F[63&ke<<4]+"==")):ce===2&&(ke=(Z[ie-2]<<8)+Z[ie-1],he.push(F[ke>>10]+F[63&ke>>4]+F[63&ke<<2]+"=")),he.join("")}h.byteLength=function(Z){var ie=p(Z),ce=ie[0],he=ie[1];return 3*(ce+he)/4-he},h.toByteArray=v,h.fromByteArray=P;for(var F=[],k=[],j=typeof Uint8Array>"u"?Array:Uint8Array,V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Y=0,X=V.length;YNe)throw new RangeError('The value "'+Ne+'" is invalid for option "size"')}function I(Ne,pe,Ae){return x(Ne),0>=Ne||pe===void 0?p(Ne):typeof Ae=="string"?p(Ne).fill(pe,Ae):p(Ne).fill(pe)}function P(Ne){return x(Ne),p(0>Ne?0:0|Y(Ne))}function F(Ne,pe){if((typeof pe!="string"||pe==="")&&(pe="utf8"),!y.isEncoding(pe))throw new TypeError("Unknown encoding: "+pe);var Ae=0|X(Ne,pe),tt=p(Ae),gt=tt.write(Ne,pe);return gt!==Ae&&(tt=tt.slice(0,gt)),tt}function k(Ne){for(var pe=0>Ne.length?0:0|Y(Ne.length),Ae=p(pe),tt=0;ttpe||Ne.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647 .toString(16)+" bytes");return 0|Ne}function X(Ne,pe){if(y.isBuffer(Ne))return Ne.length;if(ArrayBuffer.isView(Ne)||kt(Ne,ArrayBuffer))return Ne.byteLength;if(typeof Ne!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Ne);var Ae=Ne.length,tt=2>>1;case"base64":return je(Ne).length;default:if(gt)return tt?-1:Ft(Ne).length;pe=(""+pe).toLowerCase(),gt=!0}}function Z(Ne,pe,Ae){var tt=!1;if((pe===void 0||0>pe)&&(pe=0),pe>this.length||((Ae===void 0||Ae>this.length)&&(Ae=this.length),0>=Ae)||(Ae>>>=0,pe>>>=0,Ae<=pe))return"";for(Ne||(Ne="utf8");;)switch(Ne){case"hex":return Be(this,pe,Ae);case"utf8":case"utf-8":return Ie(this,pe,Ae);case"ascii":return Oe(this,pe,Ae);case"latin1":case"binary":return Ge(this,pe,Ae);case"base64":return Se(this,pe,Ae);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qe(this,pe,Ae);default:if(tt)throw new TypeError("Unknown encoding: "+Ne);Ne=(Ne+"").toLowerCase(),tt=!0}}function ie(Ne,pe,Ae){var tt=Ne[pe];Ne[pe]=Ne[Ae],Ne[Ae]=tt}function ce(Ne,pe,Ae,tt,gt){if(Ne.length===0)return-1;if(typeof Ae=="string"?(tt=Ae,Ae=0):2147483647Ae&&(Ae=-2147483648),Ae=+Ae,ct(Ae)&&(Ae=gt?0:Ne.length-1),0>Ae&&(Ae=Ne.length+Ae),Ae>=Ne.length){if(gt)return-1;Ae=Ne.length-1}else if(0>Ae)if(gt)Ae=0;else return-1;if(typeof pe=="string"&&(pe=y.from(pe,tt)),y.isBuffer(pe))return pe.length===0?-1:he(Ne,pe,Ae,tt,gt);if(typeof pe=="number")return pe&=255,typeof Uint8Array.prototype.indexOf=="function"?gt?Uint8Array.prototype.indexOf.call(Ne,pe,Ae):Uint8Array.prototype.lastIndexOf.call(Ne,pe,Ae):he(Ne,[pe],Ae,tt,gt);throw new TypeError("val must be string, number or Buffer")}function he(Ne,pe,Ae,tt,gt){function ze(H,T){return Ot===1?H[T]:H.readUInt16BE(T*Ot)}var Ot=1,jt=Ne.length,nt=pe.length;if(tt!==void 0&&(tt=(tt+"").toLowerCase(),tt==="ucs2"||tt==="ucs-2"||tt==="utf16le"||tt==="utf-16le")){if(2>Ne.length||2>pe.length)return-1;Ot=2,jt/=2,nt/=2,Ae/=2}var $e;if(gt){var Xt=-1;for($e=Ae;$ejt&&(Ae=jt-nt),$e=Ae;0<=$e;$e--){for(var A=!0,ye=0;yegt&&(tt=gt)):tt=gt;var ze=pe.length;tt>ze/2&&(tt=ze/2);for(var Ot=0,jt;Otze&&(Ot=ze):jt===2?(nt=Ne[gt+1],(192&nt)==128&&(A=(31&ze)<<6|63&nt,127A||57343A&&(Ot=A)))}Ot===null?(Ot=65533,jt=1):65535>>10),Ot=56320|1023&Ot),tt.push(Ot),gt+=jt}return Re(tt)}function Re(Ne){var pe=Ne.length;if(pe<=4096)return o.apply(String,Ne);for(var Ae="",tt=0;ttpe)&&(pe=0),(!Ae||0>Ae||Ae>tt)&&(Ae=tt);for(var gt="",ze=pe;zeNe)throw new RangeError("offset is not uint");if(Ne+pe>Ae)throw new RangeError("Trying to access beyond buffer length")}function Ze(Ne,pe,Ae,tt,gt,ze){if(!y.isBuffer(Ne))throw new TypeError('"buffer" argument must be a Buffer instance');if(pe>gt||peNe.length)throw new RangeError("Index out of range")}function mt(Ne,pe,Ae,tt){if(Ae+tt>Ne.length)throw new RangeError("Index out of range");if(0>Ae)throw new RangeError("Index out of range")}function Pt(Ne,pe,Ae,tt,gt){return pe=+pe,Ae>>>=0,gt||mt(Ne,pe,Ae,4),ht.write(Ne,pe,Ae,tt,23,4),Ae+4}function $t(Ne,pe,Ae,tt,gt){return pe=+pe,Ae>>>=0,gt||mt(Ne,pe,Ae,8),ht.write(Ne,pe,Ae,tt,52,8),Ae+8}function Ct(Ne){if(Ne=Ne.split("=")[0],Ne=Ne.trim().replace(wt,""),2>Ne.length)return"";for(;Ne.length%4!=0;)Ne+="=";return Ne}function Et(Ne){return 16>Ne?"0"+Ne.toString(16):Ne.toString(16)}function Ft(Ne,pe){pe=pe||1/0;for(var Ae=Ne.length,tt=null,gt=[],ze=0,Ot;zeOt){if(!tt){if(56319Ot){-1<(pe-=3)&>.push(239,191,189),tt=Ot;continue}Ot=(tt-55296<<10|Ot-56320)+65536}else tt&&-1<(pe-=3)&>.push(239,191,189);if(tt=null,128>Ot){if(0>(pe-=1))break;gt.push(Ot)}else if(2048>Ot){if(0>(pe-=2))break;gt.push(192|Ot>>6,128|63&Ot)}else if(65536>Ot){if(0>(pe-=3))break;gt.push(224|Ot>>12,128|63&Ot>>6,128|63&Ot)}else if(1114112>Ot){if(0>(pe-=4))break;gt.push(240|Ot>>18,128|63&Ot>>12,128|63&Ot>>6,128|63&Ot)}else throw new Error("Invalid code point")}return gt}function ot(Ne){for(var pe=[],Ae=0;Ae(pe-=2));++tt)gt=Ne.charCodeAt(tt),ze=gt>>8,Ot=gt%256,Ae.push(Ot),Ae.push(ze);return Ae}function je(Ne){return ae.toByteArray(Ct(Ne))}function pt(Ne,pe,Ae,tt){for(var gt=0;gt=pe.length||gt>=Ne.length);++gt)pe[gt+Ae]=Ne[gt];return gt}function kt(Ne,pe){return Ne instanceof pe||Ne!=null&&Ne.constructor!=null&&Ne.constructor.name!=null&&Ne.constructor.name===pe.name}function ct(Ne){return Ne!==Ne}var ae=l("base64-js"),ht=l("ieee754");h.Buffer=y,h.SlowBuffer=function(Ne){return+Ne!=Ne&&(Ne=0),y.alloc(+Ne)},h.INSPECT_MAX_BYTES=50,h.kMaxLength=2147483647,y.TYPED_ARRAY_SUPPORT=function(){try{var Ne=new Uint8Array(1);return Ne.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},Ne.foo()===42}catch{return!1}}(),y.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(y.prototype,"parent",{enumerable:!0,get:function(){return y.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){return y.isBuffer(this)?this.byteOffset:void 0}}),typeof Symbol<"u"&&Symbol.species!=null&&y[Symbol.species]===y&&Object.defineProperty(y,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),y.poolSize=8192,y.from=function(Ne,pe,Ae){return v(Ne,pe,Ae)},y.prototype.__proto__=Uint8Array.prototype,y.__proto__=Uint8Array,y.alloc=function(Ne,pe,Ae){return I(Ne,pe,Ae)},y.allocUnsafe=function(Ne){return P(Ne)},y.allocUnsafeSlow=function(Ne){return P(Ne)},y.isBuffer=function(Ne){return Ne!=null&&Ne._isBuffer===!0&&Ne!==y.prototype},y.compare=function(Ne,pe){if(kt(Ne,Uint8Array)&&(Ne=y.from(Ne,Ne.offset,Ne.byteLength)),kt(pe,Uint8Array)&&(pe=y.from(pe,pe.offset,pe.byteLength)),!y.isBuffer(Ne)||!y.isBuffer(pe))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Ne===pe)return 0;for(var Ae=Ne.length,tt=pe.length,gt=0,ze=a(Ae,tt);gtpe&&(Ne+=" ... "),""},y.prototype.compare=function(Ne,pe,Ae,tt,gt){if(kt(Ne,Uint8Array)&&(Ne=y.from(Ne,Ne.offset,Ne.byteLength)),!y.isBuffer(Ne))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Ne);if(pe===void 0&&(pe=0),Ae===void 0&&(Ae=Ne?Ne.length:0),tt===void 0&&(tt=0),gt===void 0&&(gt=this.length),0>pe||Ae>Ne.length||0>tt||gt>this.length)throw new RangeError("out of range index");if(tt>=gt&&pe>=Ae)return 0;if(tt>=gt)return-1;if(pe>=Ae)return 1;if(pe>>>=0,Ae>>>=0,tt>>>=0,gt>>>=0,this===Ne)return 0;for(var ze=gt-tt,Ot=Ae-pe,jt=a(ze,Ot),nt=this.slice(tt,gt),$e=Ne.slice(pe,Ae),Xt=0;Xt>>=0,isFinite(Ae)?(Ae>>>=0,tt===void 0&&(tt="utf8")):(tt=Ae,Ae=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var gt=this.length-pe;if((Ae===void 0||Ae>gt)&&(Ae=gt),0Ae||0>pe)||pe>this.length)throw new RangeError("Attempt to write outside buffer bounds");tt||(tt="utf8");for(var ze=!1;;)switch(tt){case"hex":return _e(this,Ne,pe,Ae);case"utf8":case"utf-8":return xe(this,Ne,pe,Ae);case"ascii":return Pe(this,Ne,pe,Ae);case"latin1":case"binary":return ke(this,Ne,pe,Ae);case"base64":return J(this,Ne,pe,Ae);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return de(this,Ne,pe,Ae);default:if(ze)throw new TypeError("Unknown encoding: "+tt);tt=(""+tt).toLowerCase(),ze=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},y.prototype.slice=function(Ne,pe){var Ae=this.length;Ne=~~Ne,pe=pe===void 0?Ae:~~pe,0>Ne?(Ne+=Ae,0>Ne&&(Ne=0)):Ne>Ae&&(Ne=Ae),0>pe?(pe+=Ae,0>pe&&(pe=0)):pe>Ae&&(pe=Ae),pe>>=0,pe>>>=0,Ae||et(Ne,pe,this.length);for(var tt=this[Ne],gt=1,ze=0;++ze>>=0,pe>>>=0,Ae||et(Ne,pe,this.length);for(var tt=this[Ne+--pe],gt=1;0>>=0,pe||et(Ne,1,this.length),this[Ne]},y.prototype.readUInt16LE=function(Ne,pe){return Ne>>>=0,pe||et(Ne,2,this.length),this[Ne]|this[Ne+1]<<8},y.prototype.readUInt16BE=function(Ne,pe){return Ne>>>=0,pe||et(Ne,2,this.length),this[Ne]<<8|this[Ne+1]},y.prototype.readUInt32LE=function(Ne,pe){return Ne>>>=0,pe||et(Ne,4,this.length),(this[Ne]|this[Ne+1]<<8|this[Ne+2]<<16)+16777216*this[Ne+3]},y.prototype.readUInt32BE=function(Ne,pe){return Ne>>>=0,pe||et(Ne,4,this.length),16777216*this[Ne]+(this[Ne+1]<<16|this[Ne+2]<<8|this[Ne+3])},y.prototype.readIntLE=function(Ne,pe,Ae){Ne>>>=0,pe>>>=0,Ae||et(Ne,pe,this.length);for(var tt=this[Ne],gt=1,ze=0;++ze=gt&&(tt-=s(2,8*pe)),tt},y.prototype.readIntBE=function(Ne,pe,Ae){Ne>>>=0,pe>>>=0,Ae||et(Ne,pe,this.length);for(var tt=pe,gt=1,ze=this[Ne+--tt];0=gt&&(ze-=s(2,8*pe)),ze},y.prototype.readInt8=function(Ne,pe){return Ne>>>=0,pe||et(Ne,1,this.length),128&this[Ne]?-1*(255-this[Ne]+1):this[Ne]},y.prototype.readInt16LE=function(Ne,pe){Ne>>>=0,pe||et(Ne,2,this.length);var Ae=this[Ne]|this[Ne+1]<<8;return 32768&Ae?4294901760|Ae:Ae},y.prototype.readInt16BE=function(Ne,pe){Ne>>>=0,pe||et(Ne,2,this.length);var Ae=this[Ne+1]|this[Ne]<<8;return 32768&Ae?4294901760|Ae:Ae},y.prototype.readInt32LE=function(Ne,pe){return Ne>>>=0,pe||et(Ne,4,this.length),this[Ne]|this[Ne+1]<<8|this[Ne+2]<<16|this[Ne+3]<<24},y.prototype.readInt32BE=function(Ne,pe){return Ne>>>=0,pe||et(Ne,4,this.length),this[Ne]<<24|this[Ne+1]<<16|this[Ne+2]<<8|this[Ne+3]},y.prototype.readFloatLE=function(Ne,pe){return Ne>>>=0,pe||et(Ne,4,this.length),ht.read(this,Ne,!0,23,4)},y.prototype.readFloatBE=function(Ne,pe){return Ne>>>=0,pe||et(Ne,4,this.length),ht.read(this,Ne,!1,23,4)},y.prototype.readDoubleLE=function(Ne,pe){return Ne>>>=0,pe||et(Ne,8,this.length),ht.read(this,Ne,!0,52,8)},y.prototype.readDoubleBE=function(Ne,pe){return Ne>>>=0,pe||et(Ne,8,this.length),ht.read(this,Ne,!1,52,8)},y.prototype.writeUIntLE=function(Ne,pe,Ae,tt){if(Ne=+Ne,pe>>>=0,Ae>>>=0,!tt){var gt=s(2,8*Ae)-1;Ze(this,Ne,pe,Ae,gt,0)}var ze=1,Ot=0;for(this[pe]=255&Ne;++Ot>>=0,Ae>>>=0,!tt){var gt=s(2,8*Ae)-1;Ze(this,Ne,pe,Ae,gt,0)}var ze=Ae-1,Ot=1;for(this[pe+ze]=255&Ne;0<=--ze&&(Ot*=256);)this[pe+ze]=255&Ne/Ot;return pe+Ae},y.prototype.writeUInt8=function(Ne,pe,Ae){return Ne=+Ne,pe>>>=0,Ae||Ze(this,Ne,pe,1,255,0),this[pe]=255&Ne,pe+1},y.prototype.writeUInt16LE=function(Ne,pe,Ae){return Ne=+Ne,pe>>>=0,Ae||Ze(this,Ne,pe,2,65535,0),this[pe]=255&Ne,this[pe+1]=Ne>>>8,pe+2},y.prototype.writeUInt16BE=function(Ne,pe,Ae){return Ne=+Ne,pe>>>=0,Ae||Ze(this,Ne,pe,2,65535,0),this[pe]=Ne>>>8,this[pe+1]=255&Ne,pe+2},y.prototype.writeUInt32LE=function(Ne,pe,Ae){return Ne=+Ne,pe>>>=0,Ae||Ze(this,Ne,pe,4,4294967295,0),this[pe+3]=Ne>>>24,this[pe+2]=Ne>>>16,this[pe+1]=Ne>>>8,this[pe]=255&Ne,pe+4},y.prototype.writeUInt32BE=function(Ne,pe,Ae){return Ne=+Ne,pe>>>=0,Ae||Ze(this,Ne,pe,4,4294967295,0),this[pe]=Ne>>>24,this[pe+1]=Ne>>>16,this[pe+2]=Ne>>>8,this[pe+3]=255&Ne,pe+4},y.prototype.writeIntLE=function(Ne,pe,Ae,tt){if(Ne=+Ne,pe>>>=0,!tt){var gt=s(2,8*Ae-1);Ze(this,Ne,pe,Ae,gt-1,-gt)}var ze=0,Ot=1,jt=0;for(this[pe]=255&Ne;++zeNe&&jt===0&&this[pe+ze-1]!==0&&(jt=1),this[pe+ze]=255&(Ne/Ot>>0)-jt;return pe+Ae},y.prototype.writeIntBE=function(Ne,pe,Ae,tt){if(Ne=+Ne,pe>>>=0,!tt){var gt=s(2,8*Ae-1);Ze(this,Ne,pe,Ae,gt-1,-gt)}var ze=Ae-1,Ot=1,jt=0;for(this[pe+ze]=255&Ne;0<=--ze&&(Ot*=256);)0>Ne&&jt===0&&this[pe+ze+1]!==0&&(jt=1),this[pe+ze]=255&(Ne/Ot>>0)-jt;return pe+Ae},y.prototype.writeInt8=function(Ne,pe,Ae){return Ne=+Ne,pe>>>=0,Ae||Ze(this,Ne,pe,1,127,-128),0>Ne&&(Ne=255+Ne+1),this[pe]=255&Ne,pe+1},y.prototype.writeInt16LE=function(Ne,pe,Ae){return Ne=+Ne,pe>>>=0,Ae||Ze(this,Ne,pe,2,32767,-32768),this[pe]=255&Ne,this[pe+1]=Ne>>>8,pe+2},y.prototype.writeInt16BE=function(Ne,pe,Ae){return Ne=+Ne,pe>>>=0,Ae||Ze(this,Ne,pe,2,32767,-32768),this[pe]=Ne>>>8,this[pe+1]=255&Ne,pe+2},y.prototype.writeInt32LE=function(Ne,pe,Ae){return Ne=+Ne,pe>>>=0,Ae||Ze(this,Ne,pe,4,2147483647,-2147483648),this[pe]=255&Ne,this[pe+1]=Ne>>>8,this[pe+2]=Ne>>>16,this[pe+3]=Ne>>>24,pe+4},y.prototype.writeInt32BE=function(Ne,pe,Ae){return Ne=+Ne,pe>>>=0,Ae||Ze(this,Ne,pe,4,2147483647,-2147483648),0>Ne&&(Ne=4294967295+Ne+1),this[pe]=Ne>>>24,this[pe+1]=Ne>>>16,this[pe+2]=Ne>>>8,this[pe+3]=255&Ne,pe+4},y.prototype.writeFloatLE=function(Ne,pe,Ae){return Pt(this,Ne,pe,!0,Ae)},y.prototype.writeFloatBE=function(Ne,pe,Ae){return Pt(this,Ne,pe,!1,Ae)},y.prototype.writeDoubleLE=function(Ne,pe,Ae){return $t(this,Ne,pe,!0,Ae)},y.prototype.writeDoubleBE=function(Ne,pe,Ae){return $t(this,Ne,pe,!1,Ae)},y.prototype.copy=function(Ne,pe,Ae,tt){if(!y.isBuffer(Ne))throw new TypeError("argument should be a Buffer");if(Ae||(Ae=0),tt||tt===0||(tt=this.length),pe>=Ne.length&&(pe=Ne.length),pe||(pe=0),0pe)throw new RangeError("targetStart out of bounds");if(0>Ae||Ae>=this.length)throw new RangeError("Index out of range");if(0>tt)throw new RangeError("sourceEnd out of bounds");tt>this.length&&(tt=this.length),Ne.length-pegt||tt==="latin1")&&(Ne=gt)}}else typeof Ne=="number"&&(Ne&=255);if(0>pe||this.length>>=0,Ae=Ae===void 0?this.length:Ae>>>0,Ne||(Ne=0);var ze;if(typeof Ne=="number")for(ze=pe;ze */h.read=function(p,y,v,x,I){var P=8*I-x-1,F=(1<>1,j=-7,V=v?I-1:0,Y=v?-1:1,X=p[y+V],Z,ie;for(V+=Y,Z=X&(1<<-j)-1,X>>=-j,j+=P;0>=-j,j+=x;0>1,Y=I===23?s(2,-24)-s(2,-77):0,X=x?0:P-1,Z=x?1:-1,ie=0>y||y===0&&0>1/y?1:0,ce,he,_e;for(y=n(y),isNaN(y)||y===1/0?(he=isNaN(y)?1:0,ce=j):(ce=i(r(y)/F),1>y*(_e=s(2,-ce))&&(ce--,_e*=2),y+=1<=ce+V?Y/_e:Y*s(2,1-V),2<=y*_e&&(ce++,_e/=2),ce+V>=j?(he=0,ce=j):1<=ce+V?(he=(y*_e-1)*s(2,I),ce+=V):(he=y*s(2,V-1)*s(2,I),ce=0));8<=I;p[v+X]=255&he,X+=Z,he/=256,I-=8);for(ce=ce<"u"?typeof self>"u"?typeof window>"u"?{}:window:self:Jh)},{}],11:[function(l,c,h){(function(p,y,v){(function(){/*! JSZip v3.6.0 - A JavaScript class for generating and reading zip files @@ -123,16 +127,16 @@ northing meters`+t;var y=p/2,v=0,S=0,I,O,L,N,G;return y>0&&(I=1e5/Math.pow(10,y) JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/master/LICENSE - */(function(S){typeof d=="object"&&typeof c<"u"?c.exports=S():(typeof window>"u"?typeof p>"u"?typeof self>"u"?this:self:p:window).JSZip=S()})(function(){return function S(I,O,L){function N(Y,X){if(!O[Y]){if(!I[Y]){var te=typeof l=="function"&&l;if(!X&&te)return te(Y,!0);if(G)return G(Y,!0);var re=new Error("Cannot find module '"+Y+"'");throw re.code="MODULE_NOT_FOUND",re}var fe=O[Y]={exports:{}};I[Y][0].call(fe.exports,function(ge){var _e=I[Y][1][ge];return N(_e||ge)},fe,fe.exports,S,I,O,L)}return O[Y].exports}for(var G=typeof l=="function"&&l,V=0;V"u"?L===void 0?typeof self>"u"?this:self:L:window).JSZip=N()})(function(){return function N(G,V,Y){function X(fe,ge){if(!V[fe]){if(!G[fe]){var _e=typeof S=="function"&&S;if(!ge&&_e)return _e(fe,!0);if(te)return te(fe,!0);var Ie=new Error("Cannot find module '"+fe+"'");throw Ie.code="MODULE_NOT_FOUND",Ie}var ke=V[fe]={exports:{}};G[fe][0].call(ke.exports,function(Ne){return X(G[fe][1][Ne]||Ne)},ke,ke.exports,N,G,V,Y)}return V[fe].exports}for(var te=typeof S=="function"&&S,re=0;re"u"?Y===void 0?typeof self>"u"?this:self:Y:window).JSZip=X()})(function(){return function X(te,re,fe){function ge(ke,Ne){if(!re[ke]){if(!te[ke]){var J=typeof N=="function"&&N;if(!Ne&&J)return J(ke,!0);if(_e)return _e(ke,!0);var he=new Error("Cannot find module '"+ke+"'");throw he.code="MODULE_NOT_FOUND",he}var xe=re[ke]={exports:{}};te[ke][0].call(xe.exports,function(Pe){return ge(te[ke][1][Pe]||Pe)},xe,xe.exports,X,te,re,fe)}return re[ke].exports}for(var _e=typeof N=="function"&&N,Ie=0;Ie"u"?fe===void 0?typeof self>"u"?this:self:fe:window).JSZip=ge()})(function(){return function ge(_e,Ie,ke){function Ne(xe,Pe){if(!Ie[xe]){if(!_e[xe]){var Oe=typeof X=="function"&&X;if(!Pe&&Oe)return Oe(xe,!0);if(J)return J(xe,!0);var Ae=new Error("Cannot find module '"+xe+"'");throw Ae.code="MODULE_NOT_FOUND",Ae}var ze=Ie[xe]={exports:{}};_e[xe][0].call(ze.exports,function(Ge){return Ne(_e[xe][1][Ge]||Ge)},ze,ze.exports,ge,_e,Ie,ke)}return Ie[xe].exports}for(var J=typeof X=="function"&&X,he=0;he"u"?ke===void 0?typeof self>"u"?this:self:ke:window).JSZip=Ne()})(function(){return function Ne(J,he,xe){function Pe(ze,Ge){if(!he[ze]){if(!J[ze]){var Je=typeof ge=="function"&≥if(!Ge&&Je)return Je(ze,!0);if(Oe)return Oe(ze,!0);var et=new Error("Cannot find module '"+ze+"'");throw et.code="MODULE_NOT_FOUND",et}var tt=he[ze]={exports:{}};J[ze][0].call(tt.exports,function(ft){return Pe(J[ze][1][ft]||ft)},tt,tt.exports,Ne,J,he,xe)}return he[ze].exports}for(var Oe=typeof ge=="function"&&ge,Ae=0;Ae"u"?xe===void 0?typeof self>"u"?this:self:xe:window).JSZip=Pe()})(function(){return function Pe(Oe,Ae,ze){function Ge(tt,ft){if(!Ae[tt]){if(!Oe[tt]){var Pt=typeof Ne=="function"&&Ne;if(!ft&&Pt)return Pt(tt,!0);if(Je)return Je(tt,!0);var $t=new Error("Cannot find module '"+tt+"'");throw $t.code="MODULE_NOT_FOUND",$t}var St=Ae[tt]={exports:{}};Oe[tt][0].call(St.exports,function(Tt){return Ge(Oe[tt][1][Tt]||Tt)},St,St.exports,Pe,Oe,Ae,ze)}return Ae[tt].exports}for(var Je=typeof Ne=="function"&&Ne,et=0;et>2,Ee=(3&St)<<4|Tt>>4,Be=1>6:64,mt=2>4,Pt=(15&St)<<4|(Tt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(Je.charAt(et++)))>>2,$t=(3&Tt)<<6|(Lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(Je.charAt(et++))),Ee[tt++]=ft,Tt!==64&&(Ee[tt++]=Pt),Lt!==64&&(Ee[tt++]=$t);return Ee}},{"./support":30,"./utils":32}],2:[function(Pe,Oe){function Ae(tt,ft,Pt,$t,St){this.compressedSize=tt,this.uncompressedSize=ft,this.crc32=Pt,this.compression=$t,this.compressedContent=St}var ze=Pe("./external"),Ge=Pe("./stream/DataWorker"),Je=Pe("./stream/Crc32Probe"),et=Pe("./stream/DataLengthProbe");Ae.prototype={getContentWorker:function(){var tt=new Ge(ze.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new et("data_length")),ft=this;return tt.on("end",function(){if(this.streamInfo.data_length!==ft.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),tt},getCompressedWorker:function(){return new Ge(ze.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},Ae.createWorkerFrom=function(tt,ft,Pt){return tt.pipe(new Je).pipe(new et("uncompressedSize")).pipe(ft.compressWorker(Pt)).pipe(new et("compressedSize")).withStreamInfo("compression",ft)},Oe.exports=Ae},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(Pe,Oe,Ae){var ze=Pe("./stream/GenericWorker");Ae.STORE={magic:"\0\0",compressWorker:function(){return new ze("STORE compression")},uncompressWorker:function(){return new ze("STORE decompression")}},Ae.DEFLATE=Pe("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(Pe,Oe){var Ae=Pe("./utils"),ze=function(){for(var Ge=[],Je=0,et;256>Je;Je++){et=Je;for(var tt=0;8>tt;tt++)et=1&et?3988292384^et>>>1:et>>>1;Ge[Je]=et}return Ge}();Oe.exports=function(Ge,Je){return Ge!==void 0&&Ge.length?Ae.getTypeOf(Ge)==="string"?function(et,tt,ft){et^=-1;for(var Pt=0;Pt<0+ft;Pt++)et=et>>>8^ze[255&(et^tt.charCodeAt(Pt))];return-1^et}(0|Je,Ge,Ge.length):function(et,tt,ft){et^=-1;for(var Pt=0;Pt<0+ft;Pt++)et=et>>>8^ze[255&(et^tt[Pt])];return-1^et}(0|Je,Ge,Ge.length):0}},{"./utils":32}],5:[function(Pe,Oe,Ae){Ae.base64=!1,Ae.binary=!1,Ae.dir=!1,Ae.createFolders=!0,Ae.date=null,Ae.compression=null,Ae.compressionOptions=null,Ae.comment=null,Ae.unixPermissions=null,Ae.dosPermissions=null},{}],6:[function(Pe,Oe){var Ae;Ae=typeof Promise>"u"?Pe("lie"):Promise,Oe.exports={Promise:Ae}},{lie:37}],7:[function(Pe,Oe,Ae){function ze(Pt,$t){tt.call(this,"FlateWorker/"+Pt),this._pako=null,this._pakoAction=Pt,this._pakoOptions=$t,this.meta={}}var Ge=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",Je=Pe("pako"),et=Pe("./utils"),tt=Pe("./stream/GenericWorker"),ft=Ge?"uint8array":"array";Ae.magic="\b\0",et.inherits(ze,tt),ze.prototype.processChunk=function(Pt){this.meta=Pt.meta,this._pako===null&&this._createPako(),this._pako.push(et.transformTo(ft,Pt.data),!1)},ze.prototype.flush=function(){tt.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},ze.prototype.cleanUp=function(){tt.prototype.cleanUp.call(this),this._pako=null},ze.prototype._createPako=function(){this._pako=new Je[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var Pt=this;this._pako.onData=function($t){Pt.push({data:$t,meta:Pt.meta})}},Ae.compressWorker=function(Pt){return new ze("Deflate",Pt)},Ae.uncompressWorker=function(){return new ze("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(Pe,Oe){function Ae($t,St){var Tt="",Lt;for(Lt=0;Lt>>=8;return Tt}function ze($t,St,Tt,Lt,at,Ee){var Be=$t.file,mt=$t.compression,kt=Ee!==tt.utf8encode,ct=Je.transformTo("string",Ee(Be.name)),le=Je.transformTo("string",tt.utf8encode(Be.name)),it=Be.comment,pt=Je.transformTo("string",Ee(it)),Le=Je.transformTo("string",tt.utf8encode(it)),ce=le.length!==Be.name.length,Ce=Le.length!==it.length,Ze="",yt="",Ve="",At=Be.dir,ii=Be.date,gt={crc32:0,compressedSize:0,uncompressedSize:0},Ue,ni;St&&!Tt||(gt.crc32=$t.crc32,gt.compressedSize=$t.compressedSize,gt.uncompressedSize=$t.uncompressedSize);var A=0;St&&(A|=8),!kt&&(ce||Ce)&&(A|=2048);var ve=0,W=0,T;At&&(ve|=16),at==="UNIX"?(W=798,ve|=((T=Be.unixPermissions)||(T=At?16893:33204),(65535&T)<<16)):(W=20,ve|=63&(Be.dosPermissions||0)),Ue=ii.getUTCHours(),Ue<<=6,Ue|=ii.getUTCMinutes(),Ue<<=5,Ue|=ii.getUTCSeconds()/2,ni=ii.getUTCFullYear()-1980,ni<<=4,ni|=ii.getUTCMonth()+1,ni<<=5,ni|=ii.getUTCDate(),ce&&(Ze+="up"+Ae((yt=Ae(1,1)+Ae(ft(ct),4)+le).length,2)+yt),Ce&&(Ze+="uc"+Ae((Ve=Ae(1,1)+Ae(ft(pt),4)+Le).length,2)+Ve);var b="";return b+=` -\0`,b+=Ae(A,2),b+=mt.magic,b+=Ae(Ue,2),b+=Ae(ni,2),b+=Ae(gt.crc32,4),b+=Ae(gt.compressedSize,4),b+=Ae(gt.uncompressedSize,4),b+=Ae(ct.length,2),b+=Ae(Ze.length,2),{fileRecord:Pt.LOCAL_FILE_HEADER+b+ct+Ze,dirRecord:Pt.CENTRAL_FILE_HEADER+Ae(W,2)+b+Ae(pt.length,2)+"\0\0\0\0"+Ae(ve,4)+Ae(Lt,4)+ct+Ze+pt}}function Ge($t,St,Tt,Lt){et.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=St,this.zipPlatform=Tt,this.encodeFileName=Lt,this.streamFiles=$t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}var Je=Pe("../utils"),et=Pe("../stream/GenericWorker"),tt=Pe("../utf8"),ft=Pe("../crc32"),Pt=Pe("../signature");Je.inherits(Ge,et),Ge.prototype.push=function($t){var St=$t.meta.percent||0,Tt=this.entriesCount,Lt=this._sources.length;this.accumulate?this.contentBuffer.push($t):(this.bytesWritten+=$t.data.length,et.prototype.push.call(this,{data:$t.data,meta:{currentFile:this.currentFile,percent:Tt?(St+100*(Tt-Lt-1))/Tt:100}}))},Ge.prototype.openedSource=function($t){this.currentSourceOffset=this.bytesWritten,this.currentFile=$t.file.name;var St=this.streamFiles&&!$t.file.dir;if(St){var Tt=ze($t,St,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:Tt.fileRecord,meta:{percent:0}})}else this.accumulate=!0},Ge.prototype.closedSource=function($t){this.accumulate=!1;var St=this.streamFiles&&!$t.file.dir,Tt=ze($t,St,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName),Lt;if(this.dirRecords.push(Tt.dirRecord),St)this.push({data:(Lt=$t,Pt.DATA_DESCRIPTOR+Ae(Lt.crc32,4)+Ae(Lt.compressedSize,4)+Ae(Lt.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:Tt.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},Ge.prototype.flush=function(){for(var $t=this.bytesWritten,St=0;StGe)throw new Error("End of data reached (data length = "+this.length+", asked index = "+Ge+"). Corrupted zip ?")},setIndex:function(Ge){this.checkIndex(Ge),this.index=Ge},skip:function(Ge){this.setIndex(this.index+Ge)},byteAt:function(){},readInt:function(Ge){var Je=0,et;for(this.checkOffset(Ge),et=this.index+Ge-1;et>=this.index;et--)Je=(Je<<8)+this.byteAt(et);return this.index+=Ge,Je},readString:function(Ge){return ze.transformTo("string",this.readData(Ge))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var Ge=this.readInt(4);return new Date(Date.UTC(1980+(127&Ge>>25),(15&Ge>>21)-1,31&Ge>>16,31&Ge>>11,63&Ge>>5,(31&Ge)<<1))}},Oe.exports=Ae},{"../utils":32}],19:[function(Pe,Oe){function Ae(Ge){ze.call(this,Ge)}var ze=Pe("./Uint8ArrayReader");Pe("../utils").inherits(Ae,ze),Ae.prototype.readData=function(Ge){this.checkOffset(Ge);var Je=this.data.slice(this.zero+this.index,this.zero+this.index+Ge);return this.index+=Ge,Je},Oe.exports=Ae},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(Pe,Oe){function Ae(Ge){ze.call(this,Ge)}var ze=Pe("./DataReader");Pe("../utils").inherits(Ae,ze),Ae.prototype.byteAt=function(Ge){return this.data.charCodeAt(this.zero+Ge)},Ae.prototype.lastIndexOfSignature=function(Ge){return this.data.lastIndexOf(Ge)-this.zero},Ae.prototype.readAndCheckSignature=function(Ge){return Ge===this.readData(4)},Ae.prototype.readData=function(Ge){this.checkOffset(Ge);var Je=this.data.slice(this.zero+this.index,this.zero+this.index+Ge);return this.index+=Ge,Je},Oe.exports=Ae},{"../utils":32,"./DataReader":18}],21:[function(Pe,Oe){function Ae(Ge){ze.call(this,Ge)}var ze=Pe("./ArrayReader");Pe("../utils").inherits(Ae,ze),Ae.prototype.readData=function(Ge){if(this.checkOffset(Ge),Ge===0)return new Uint8Array(0);var Je=this.data.subarray(this.zero+this.index,this.zero+this.index+Ge);return this.index+=Ge,Je},Oe.exports=Ae},{"../utils":32,"./ArrayReader":17}],22:[function(Pe,Oe){var Ae=Pe("../utils"),ze=Pe("../support"),Ge=Pe("./ArrayReader"),Je=Pe("./StringReader"),et=Pe("./NodeBufferReader"),tt=Pe("./Uint8ArrayReader");Oe.exports=function(ft){var Pt=Ae.getTypeOf(ft);return Ae.checkSupport(Pt),Pt!=="string"||ze.uint8array?Pt==="nodebuffer"?new et(ft):ze.uint8array?new tt(Ae.transformTo("uint8array",ft)):new Ge(Ae.transformTo("array",ft)):new Je(ft)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(Pe,Oe,Ae){Ae.LOCAL_FILE_HEADER="PK",Ae.CENTRAL_FILE_HEADER="PK",Ae.CENTRAL_DIRECTORY_END="PK",Ae.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",Ae.ZIP64_CENTRAL_DIRECTORY_END="PK",Ae.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(Pe,Oe){function Ae(Je){ze.call(this,"ConvertWorker to "+Je),this.destType=Je}var ze=Pe("./GenericWorker"),Ge=Pe("../utils");Ge.inherits(Ae,ze),Ae.prototype.processChunk=function(Je){this.push({data:Ge.transformTo(this.destType,Je.data),meta:Je.meta})},Oe.exports=Ae},{"../utils":32,"./GenericWorker":28}],25:[function(Pe,Oe){function Ae(){ze.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}var ze=Pe("./GenericWorker"),Ge=Pe("../crc32");Pe("../utils").inherits(Ae,ze),Ae.prototype.processChunk=function(Je){this.streamInfo.crc32=Ge(Je.data,this.streamInfo.crc32||0),this.push(Je)},Oe.exports=Ae},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(Pe,Oe){function Ae(Je){Ge.call(this,"DataLengthProbe for "+Je),this.propName=Je,this.withStreamInfo(Je,0)}var ze=Pe("../utils"),Ge=Pe("./GenericWorker");ze.inherits(Ae,Ge),Ae.prototype.processChunk=function(Je){if(Je){var et=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=et+Je.data.length}Ge.prototype.processChunk.call(this,Je)},Oe.exports=Ae},{"../utils":32,"./GenericWorker":28}],27:[function(Pe,Oe){function Ae(Je){Ge.call(this,"DataWorker");var et=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,Je.then(function(tt){et.dataIsReady=!0,et.data=tt,et.max=tt&&tt.length||0,et.type=ze.getTypeOf(tt),et.isPaused||et._tickAndRepeat()},function(tt){et.error(tt)})}var ze=Pe("../utils"),Ge=Pe("./GenericWorker");ze.inherits(Ae,Ge),Ae.prototype.cleanUp=function(){Ge.prototype.cleanUp.call(this),this.data=null},Ae.prototype.resume=function(){return!!Ge.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,ze.delay(this._tickAndRepeat,[],this)),!0)},Ae.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(ze.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},Ae.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var Je=null,et=a(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":Je=this.data.substring(this.index,et);break;case"uint8array":Je=this.data.subarray(this.index,et);break;case"array":case"nodebuffer":Je=this.data.slice(this.index,et)}return this.index=et,this.push({data:Je,meta:{percent:this.max?100*(this.index/this.max):0}})},Oe.exports=Ae},{"../utils":32,"./GenericWorker":28}],28:[function(Pe,Oe){function Ae(ze){this.name=ze||"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}Ae.prototype={push:function(ze){this.emit("data",ze)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(ze){this.emit("error",ze)}return!0},error:function(ze){return!this.isFinished&&(this.isPaused?this.generatedError=ze:(this.isFinished=!0,this.emit("error",ze),this.previous&&this.previous.error(ze),this.cleanUp()),!0)},on:function(ze,Ge){return this._listeners[ze].push(Ge),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(ze,Ge){if(this._listeners[ze])for(var Je=0;Je "+ze:ze}},Oe.exports=Ae},{}],29:[function(Pe,Oe){function Ae($t,St,Tt){var Lt=St;St==="blob"||St==="arraybuffer"?Lt="uint8array":St==="base64"&&(Lt="string");try{this._internalType=Lt,this._outputType=St,this._mimeType=Tt,ze.checkSupport(Lt),this._worker=$t.pipe(new Ge(Lt)),$t.lock()}catch(at){this._worker=new Je("error"),this._worker.error(at)}}var ze=Pe("../utils"),Ge=Pe("./ConvertWorker"),Je=Pe("./GenericWorker"),et=Pe("../base64"),tt=Pe("../support"),ft=Pe("../external"),Pt=null;if(tt.nodestream)try{Pt=Pe("../nodejs/NodejsStreamOutputAdapter")}catch{}Ae.prototype={accumulate:function($t){return St=this,Tt=$t,new ft.Promise(function(Lt,at){var Ee=[],Be=St._internalType,mt=St._outputType,kt=St._mimeType;St.on("data",function(ct,le){Ee.push(ct),Tt&&Tt(le)}).on("error",function(ct){Ee=[],at(ct)}).on("end",function(){try{var ct=function(le,it,pt){return le==="blob"?ze.newBlob(ze.transformTo("arraybuffer",it),pt):le==="base64"?et.encode(it):ze.transformTo(le,it)}(mt,function(le,it){var pt=0,Le=null,ce=0,Ce;for(Ce=0;Ce"u")Ae.blob=!1;else{var ze=new ArrayBuffer(0);try{Ae.blob=new Blob([ze],{type:"application/zip"}).size===0}catch{try{var Ge=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);Ge.append(ze),Ae.blob=Ge.getBlob("application/zip").size===0}catch{Ae.blob=!1}}}try{Ae.nodestream=!!Pe("readable-stream").Readable}catch{Ae.nodestream=!1}},{"readable-stream":16}],31:[function(Pe,Oe,Ae){function ze(){ft.call(this,"utf-8 decode"),this.leftOver=null}function Ge(){ft.call(this,"utf-8 encode")}for(var Je=Pe("./utils"),et=Pe("./support"),tt=Pe("./nodejsUtils"),ft=Pe("./stream/GenericWorker"),Pt=Array(256),$t=0;256>$t;$t++)Pt[$t]=252<=$t?6:248<=$t?5:240<=$t?4:224<=$t?3:192<=$t?2:1;Pt[254]=Pt[254]=1,Ae.utf8encode=function(St){return et.nodebuffer?tt.newBufferFrom(St,"utf-8"):function(Tt){var Lt=Tt.length,at=0,Ee,Be,mt,kt,ct;for(kt=0;ktBe?1:2048>Be?2:65536>Be?3:4;for(Ee=et.uint8array?new Uint8Array(at):Array(at),kt=ct=0;ctBe?Ee[ct++]=Be:(2048>Be?Ee[ct++]=192|Be>>>6:(65536>Be?Ee[ct++]=224|Be>>>12:(Ee[ct++]=240|Be>>>18,Ee[ct++]=128|63&Be>>>12),Ee[ct++]=128|63&Be>>>6),Ee[ct++]=128|63&Be);return Ee}(St)},Ae.utf8decode=function(St){return et.nodebuffer?Je.transformTo("nodebuffer",St).toString("utf-8"):function(Tt){var Lt=Tt.length,at=Array(2*Lt),Ee,Be,mt,kt;for(Ee=Be=0;Ee(mt=Tt[Ee++]))at[Be++]=mt;else if(4<(kt=Pt[mt]))at[Be++]=65533,Ee+=kt-1;else{for(mt&=kt===2?31:kt===3?15:7;1mt?at[Be++]=mt:(mt-=65536,at[Be++]=55296|1023&mt>>10,at[Be++]=56320|1023&mt)}return at.length!==Be&&(at.subarray?at=at.subarray(0,Be):at.length=Be),Je.applyFromCharCode(at)}(St=Je.transformTo(et.uint8array?"uint8array":"array",St))},Je.inherits(ze,ft),ze.prototype.processChunk=function(St){var Tt=Je.transformTo(et.uint8array?"uint8array":"array",St.data);if(this.leftOver&&this.leftOver.length){if(et.uint8array){var Lt=Tt;(Tt=new Uint8Array(Lt.length+this.leftOver.length)).set(this.leftOver,0),Tt.set(Lt,this.leftOver.length)}else Tt=this.leftOver.concat(Tt);this.leftOver=null}var at=function(Be,mt){var kt;for((mt=mt||Be.length)>Be.length&&(mt=Be.length),kt=mt-1;0<=kt&&(192&Be[kt])==128;)kt--;return 0>kt||kt===0?mt:kt+Pt[Be[kt]]>mt?kt:mt}(Tt),Ee=Tt;at!==Tt.length&&(et.uint8array?(Ee=Tt.subarray(0,at),this.leftOver=Tt.subarray(at,Tt.length)):(Ee=Tt.slice(0,at),this.leftOver=Tt.slice(at,Tt.length))),this.push({data:Ae.utf8decode(Ee),meta:St.meta})},ze.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:Ae.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},Ae.Utf8DecodeWorker=ze,Je.inherits(Ge,ft),Ge.prototype.processChunk=function(St){this.push({data:Ae.utf8encode(St.data),meta:St.meta})},Ae.Utf8EncodeWorker=Ge},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(Pe,Oe,Ae){function ze(at){return at}function Ge(at,Ee){for(var Be=0;Be(Be=at.charCodeAt(mt))?"0":"")+Be.toString(16).toUpperCase();return Ee},Ae.delay=function(at,Ee,Be){$t(function(){at.apply(Be||null,Ee||[])})},Ae.inherits=function(at,Ee){function Be(){}Be.prototype=Ee.prototype,at.prototype=new Be},Ae.extend=function(){var at={},Ee,Be;for(Ee=0;Eeft)throw this.isSignature(0,Je.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(ft);var Pt=ft;if(this.checkSignature(Je.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===Ge.MAX_VALUE_16BITS||this.diskWithCentralDirStart===Ge.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===Ge.MAX_VALUE_16BITS||this.centralDirRecords===Ge.MAX_VALUE_16BITS||this.centralDirSize===Ge.MAX_VALUE_32BITS||this.centralDirOffset===Ge.MAX_VALUE_32BITS){if(this.zip64=!0,0>(ft=this.reader.lastIndexOfSignature(Je.ZIP64_CENTRAL_DIRECTORY_LOCATOR)))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(ft),this.checkSignature(Je.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,Je.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(Je.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(Je.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var $t=this.centralDirOffset+this.centralDirSize;this.zip64&&($t+=20,$t+=12+this.zip64EndOfCentralSize);var St=Pt-$t;if(0St)throw new Error("Corrupted zip: missing "+n(St)+" bytes.")},prepareReader:function(ft){this.reader=ze(ft)},load:function(ft){this.prepareReader(ft),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},Oe.exports=Ae},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(Pe,Oe){function Ae($t,St){this.options=$t,this.loadOptions=St}var ze=Pe("./reader/readerFor"),Ge=Pe("./utils"),Je=Pe("./compressedObject"),et=Pe("./crc32"),tt=Pe("./utf8"),ft=Pe("./compressions"),Pt=Pe("./support");Ae.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function($t){var St,Tt;if($t.skip(22),this.fileNameLength=$t.readInt(2),Tt=$t.readInt(2),this.fileName=$t.readData(this.fileNameLength),$t.skip(Tt),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((St=function(Lt){for(var at in ft)if(ft.hasOwnProperty(at)&&ft[at].magic===Lt)return ft[at];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+Ge.pretty(this.compressionMethod)+" unknown (inner file : "+Ge.transformTo("string",this.fileName)+")");this.decompressed=new Je(this.compressedSize,this.uncompressedSize,this.crc32,St,$t.readData(this.compressedSize))},readCentralPart:function($t){this.versionMadeBy=$t.readInt(2),$t.skip(2),this.bitFlag=$t.readInt(2),this.compressionMethod=$t.readString(2),this.date=$t.readDate(),this.crc32=$t.readInt(4),this.compressedSize=$t.readInt(4),this.uncompressedSize=$t.readInt(4);var St=$t.readInt(2);if(this.extraFieldsLength=$t.readInt(2),this.fileCommentLength=$t.readInt(2),this.diskNumberStart=$t.readInt(2),this.internalFileAttributes=$t.readInt(2),this.externalFileAttributes=$t.readInt(4),this.localHeaderOffset=$t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");$t.skip(St),this.readExtraFields($t),this.parseZIP64ExtraField($t),this.fileComment=$t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var $t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),$t==0&&(this.dosPermissions=63&this.externalFileAttributes),$t==3&&(this.unixPermissions=65535&this.externalFileAttributes>>16),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var $t=ze(this.extraFields[1].value);this.uncompressedSize===Ge.MAX_VALUE_32BITS&&(this.uncompressedSize=$t.readInt(8)),this.compressedSize===Ge.MAX_VALUE_32BITS&&(this.compressedSize=$t.readInt(8)),this.localHeaderOffset===Ge.MAX_VALUE_32BITS&&(this.localHeaderOffset=$t.readInt(8)),this.diskNumberStart===Ge.MAX_VALUE_32BITS&&(this.diskNumberStart=$t.readInt(4))}},readExtraFields:function($t){var St=$t.index+this.extraFieldsLength,Tt,Lt,at;for(this.extraFields||(this.extraFields={});$t.index+4"u"?typeof window>"u"?{}:window:self:xe)},{}],37:[function(Pe,Oe){function Ae(){}function ze(at){if(typeof at!="function")throw new TypeError("resolver must be a function");this.state=Lt,this.queue=[],this.outcome=void 0,at!==Ae&&tt(this,at)}function Ge(at,Ee,Be){this.promise=at,typeof Ee=="function"&&(this.onFulfilled=Ee,this.callFulfilled=this.otherCallFulfilled),typeof Be=="function"&&(this.onRejected=Be,this.callRejected=this.otherCallRejected)}function Je(at,Ee,Be){Pt(function(){var mt;try{mt=Ee(Be)}catch(kt){return $t.reject(at,kt)}mt===at?$t.reject(at,new TypeError("Cannot resolve promise with itself")):$t.resolve(at,mt)})}function et(at){var Ee=at&&at.then;if(at&&(typeof at=="object"||typeof at=="function")&&typeof Ee=="function")return function(){Ee.apply(at,arguments)}}function tt(at,Ee){function Be(le){kt||(kt=!0,$t.reject(at,le))}function mt(le){kt||(kt=!0,$t.resolve(at,le))}var kt=!1,ct=ft(function(){Ee(mt,Be)});ct.status==="error"&&Be(ct.value)}function ft(at,Ee){var Be={};try{Be.value=at(Ee),Be.status="success"}catch(mt){Be.status="error",Be.value=mt}return Be}var Pt=Pe("immediate"),$t={},St=["REJECTED"],Tt=["FULFILLED"],Lt=["PENDING"];(Oe.exports=ze).prototype.finally=function(at){if(typeof at!="function")return this;var Ee=this.constructor;return this.then(function(Be){return Ee.resolve(at()).then(function(){return Be})},function(Be){return Ee.resolve(at()).then(function(){throw Be})})},ze.prototype.catch=function(at){return this.then(null,at)},ze.prototype.then=function(at,Ee){if(typeof at!="function"&&this.state===Tt||typeof Ee!="function"&&this.state===St)return this;var Be=new this.constructor(Ae);return this.state===Lt?this.queue.push(new Ge(Be,at,Ee)):Je(Be,this.state===Tt?at:Ee,this.outcome),Be},Ge.prototype.callFulfilled=function(at){$t.resolve(this.promise,at)},Ge.prototype.otherCallFulfilled=function(at){Je(this.promise,this.onFulfilled,at)},Ge.prototype.callRejected=function(at){$t.reject(this.promise,at)},Ge.prototype.otherCallRejected=function(at){Je(this.promise,this.onRejected,at)},$t.resolve=function(at,Ee){var Be=ft(et,Ee);if(Be.status==="error")return $t.reject(at,Be.value);var mt=Be.value;if(mt)tt(at,mt);else{at.state=Tt,at.outcome=Ee;for(var kt=-1,ct=at.queue.length;++ktTt.windowBits&&(Tt.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Pt,this.strm.avail_out=0;var Lt=Je.deflateInit2(this.strm,Tt.level,Tt.method,Tt.windowBits,Tt.memLevel,Tt.strategy);if(Lt!==0)throw new Error(ft[Lt]);if(Tt.header&&Je.deflateSetHeader(this.strm,Tt.header),Tt.dictionary){var at;if(at=typeof Tt.dictionary=="string"?tt.string2buf(Tt.dictionary):$t.call(Tt.dictionary)==="[object ArrayBuffer]"?new Uint8Array(Tt.dictionary):Tt.dictionary,(Lt=Je.deflateSetDictionary(this.strm,at))!==0)throw new Error(ft[Lt]);this._dict_set=!0}}function Ge(St,Tt){var Lt=new ze(Tt);if(Lt.push(St,!0),Lt.err)throw Lt.msg||ft[Lt.err];return Lt.result}var Je=Pe("./zlib/deflate"),et=Pe("./utils/common"),tt=Pe("./utils/strings"),ft=Pe("./zlib/messages"),Pt=Pe("./zlib/zstream"),$t=Object.prototype.toString;ze.prototype.push=function(St,Tt){var Lt=this.strm,at=this.options.chunkSize,Ee,Be;if(this.ended)return!1;Be=Tt===~~Tt?Tt:Tt===!0?4:0,Lt.input=typeof St=="string"?tt.string2buf(St):$t.call(St)==="[object ArrayBuffer]"?new Uint8Array(St):St,Lt.next_in=0,Lt.avail_in=Lt.input.length;do{if(Lt.avail_out===0&&(Lt.output=new et.Buf8(at),Lt.next_out=0,Lt.avail_out=at),(Ee=Je.deflate(Lt,Be))!==1&&Ee!==0)return this.onEnd(Ee),!(this.ended=!0);Lt.avail_out!==0&&(Lt.avail_in!==0||Be!==4&&Be!==2)||(this.options.to==="string"?this.onData(tt.buf2binstring(et.shrinkBuf(Lt.output,Lt.next_out))):this.onData(et.shrinkBuf(Lt.output,Lt.next_out)))}while((0at.windowBits&&(at.windowBits=-at.windowBits,at.windowBits===0&&(at.windowBits=-15)),!(0<=at.windowBits&&16>at.windowBits)||Lt&&Lt.windowBits||(at.windowBits+=32),15at.windowBits&&!(15&at.windowBits)&&(at.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $t,this.strm.avail_out=0;var Ee=Je.inflateInit2(this.strm,at.windowBits);if(Ee!==ft.Z_OK)throw new Error(Pt[Ee]);this.header=new St,Je.inflateGetHeader(this.strm,this.header)}function Ge(Lt,at){var Ee=new ze(at);if(Ee.push(Lt,!0),Ee.err)throw Ee.msg||Pt[Ee.err];return Ee.result}var Je=Pe("./zlib/inflate"),et=Pe("./utils/common"),tt=Pe("./utils/strings"),ft=Pe("./zlib/constants"),Pt=Pe("./zlib/messages"),$t=Pe("./zlib/zstream"),St=Pe("./zlib/gzheader"),Tt=Object.prototype.toString;ze.prototype.push=function(Lt,at){var Ee=this.strm,Be=this.options.chunkSize,mt=this.options.dictionary,kt=!1,ct,le,it,pt,Le,ce;if(this.ended)return!1;le=at===~~at?at:at===!0?ft.Z_FINISH:ft.Z_NO_FLUSH,Ee.input=typeof Lt=="string"?tt.binstring2buf(Lt):Tt.call(Lt)==="[object ArrayBuffer]"?new Uint8Array(Lt):Lt,Ee.next_in=0,Ee.avail_in=Ee.input.length;do{if(Ee.avail_out===0&&(Ee.output=new et.Buf8(Be),Ee.next_out=0,Ee.avail_out=Be),(ct=Je.inflate(Ee,ft.Z_NO_FLUSH))===ft.Z_NEED_DICT&&mt&&(ce=typeof mt=="string"?tt.string2buf(mt):Tt.call(mt)==="[object ArrayBuffer]"?new Uint8Array(mt):mt,ct=Je.inflateSetDictionary(this.strm,ce)),ct===ft.Z_BUF_ERROR&&kt===!0&&(ct=ft.Z_OK,kt=!1),ct!==ft.Z_STREAM_END&&ct!==ft.Z_OK)return this.onEnd(ct),!(this.ended=!0);Ee.next_out&&(Ee.avail_out!==0&&ct!==ft.Z_STREAM_END&&(Ee.avail_in!==0||le!==ft.Z_FINISH&&le!==ft.Z_SYNC_FLUSH)||(this.options.to==="string"?(it=tt.utf8border(Ee.output,Ee.next_out),pt=Ee.next_out-it,Le=tt.buf2string(Ee.output,it),Ee.next_out=pt,Ee.avail_out=Be-pt,pt&&et.arraySet(Ee.output,Ee.output,it,pt,0),this.onData(Le)):this.onData(et.shrinkBuf(Ee.output,Ee.next_out)))),Ee.avail_in===0&&Ee.avail_out===0&&(kt=!0)}while((0$t&&(Pt.subarray&&et||!Pt.subarray&&Je))return o.apply(null,Ge.shrinkBuf(Pt,$t));for(var St="",Tt=0;Tt<$t;Tt++)St+=o(Pt[Tt]);return St}var Ge=Pe("./common"),Je=!0,et=!0;try{o.apply(null,[0])}catch{Je=!1}try{o.apply(null,new Uint8Array(1))}catch{et=!1}for(var tt=new Ge.Buf8(256),ft=0;256>ft;ft++)tt[ft]=252<=ft?6:248<=ft?5:240<=ft?4:224<=ft?3:192<=ft?2:1;tt[254]=tt[254]=1,Ae.string2buf=function(Pt){var $t=Pt.length,St=0,Tt,Lt,at,Ee,Be;for(Ee=0;Ee<$t;Ee++)(64512&(Lt=Pt.charCodeAt(Ee)))==55296&&Ee+1<$t&&(64512&(at=Pt.charCodeAt(Ee+1)))==56320&&(Lt=65536+(Lt-55296<<10)+(at-56320),Ee++),St+=128>Lt?1:2048>Lt?2:65536>Lt?3:4;for(Tt=new Ge.Buf8(St),Ee=Be=0;BeLt?Tt[Be++]=Lt:(2048>Lt?Tt[Be++]=192|Lt>>>6:(65536>Lt?Tt[Be++]=224|Lt>>>12:(Tt[Be++]=240|Lt>>>18,Tt[Be++]=128|63&Lt>>>12),Tt[Be++]=128|63&Lt>>>6),Tt[Be++]=128|63&Lt);return Tt},Ae.buf2binstring=function(Pt){return ze(Pt,Pt.length)},Ae.binstring2buf=function(Pt){for(var $t=new Ge.Buf8(Pt.length),St=0,Tt=$t.length;St(Ee=Pt[Lt++]))Tt[at++]=Ee;else if(4<(Be=tt[Ee]))Tt[at++]=65533,Lt+=Be-1;else{for(Ee&=Be===2?31:Be===3?15:7;1Ee?Tt[at++]=Ee:(Ee-=65536,Tt[at++]=55296|1023&Ee>>10,Tt[at++]=56320|1023&Ee)}return ze(Tt,at)},Ae.utf8border=function(Pt,$t){var St;for(($t=$t||Pt.length)>Pt.length&&($t=Pt.length),St=$t-1;0<=St&&(192&Pt[St])==128;)St--;return 0>St||St===0?$t:St+tt[Pt[St]]>$t?St:$t}},{"./common":41}],43:[function(Pe,Oe){Oe.exports=function(Ae,ze,Ge,Je){for(var et=0|65535&Ae,tt=0|65535&Ae>>>16,ft=0;Ge!==0;){for(Ge-=ft=2e3Ge;Ge++){Je=Ge;for(var et=0;8>et;et++)Je=1&Je?3988292384^Je>>>1:Je>>>1;ze[Ge]=Je}return ze}();Oe.exports=function(ze,Ge,Je,et){ze^=-1;for(var tt=et;tt>>8^Ae[255&(ze^Ge[tt])];return-1^ze}},{}],46:[function(Pe,Oe,Ae){function ze(Ce,Ze){return Ce.msg=Le[Ze],Ze}function Ge(Ce){return(Ce<<1)-(4Ce.avail_out&&(yt=Ce.avail_out),yt!==0&&(ct.arraySet(Ce.output,Ze.pending_buf,Ze.pending_out,yt,Ce.next_out),Ce.next_out+=yt,Ze.pending_out+=yt,Ce.total_out+=yt,Ce.avail_out-=yt,Ze.pending-=yt,Ze.pending===0&&(Ze.pending_out=0))}function tt(Ce,Ze){le._tr_flush_block(Ce,0<=Ce.block_start?Ce.block_start:-1,Ce.strstart-Ce.block_start,Ze),Ce.block_start=Ce.strstart,et(Ce.strm)}function ft(Ce,Ze){Ce.pending_buf[Ce.pending++]=Ze}function Pt(Ce,Ze){Ce.pending_buf[Ce.pending++]=255&Ze>>>8,Ce.pending_buf[Ce.pending++]=255&Ze}function $t(Ce,Ze){var yt=Ce.max_chain_length,Ve=Ce.strstart,At=Ce.prev_length,ii=Ce.nice_match,gt=Ce.strstart>Ce.w_size-262?Ce.strstart-(Ce.w_size-262):0,Ue=Ce.window,ni=Ce.w_mask,A=Ce.prev,ve=Ce.strstart+258,W=Ue[Ve+At-1],T=Ue[Ve+At],b,m;Ce.prev_length>=Ce.good_match&&(yt>>=2),ii>Ce.lookahead&&(ii=Ce.lookahead);do if(Ue[(b=Ze)+At]===T&&Ue[b+At-1]===W&&Ue[b]===Ue[Ve]&&Ue[++b]===Ue[Ve+1]){Ve+=2,b++;do;while(Ue[++Ve]===Ue[++b]&&Ue[++Ve]===Ue[++b]&&Ue[++Ve]===Ue[++b]&&Ue[++Ve]===Ue[++b]&&Ue[++Ve]===Ue[++b]&&Ue[++Ve]===Ue[++b]&&Ue[++Ve]===Ue[++b]&&Ue[++Ve]===Ue[++b]&&Vegt&&--yt!=0);return At<=Ce.lookahead?At:Ce.lookahead}function St(Ce){var Ze=Ce.w_size,yt,Ve,At,ii,gt,Ue,ni,A,ve,W;do{if(ii=Ce.window_size-Ce.lookahead-Ce.strstart,Ce.strstart>=Ze+(Ze-262)){for(ct.arraySet(Ce.window,Ce.window,Ze,Ze,0),Ce.match_start-=Ze,Ce.strstart-=Ze,Ce.block_start-=Ze,yt=Ve=Ce.hash_size;At=Ce.head[--yt],Ce.head[yt]=Ze<=At?At-Ze:0,--Ve;);for(yt=Ve=Ze;At=Ce.prev[--yt],Ce.prev[yt]=Ze<=At?At-Ze:0,--Ve;);ii+=Ze}if(Ce.strm.avail_in===0)break;if(Ue=Ce.strm,ni=Ce.window,A=Ce.strstart+Ce.lookahead,W=void 0,(ve=ii)<(W=Ue.avail_in)&&(W=ve),Ve=W===0?0:(Ue.avail_in-=W,ct.arraySet(ni,Ue.input,Ue.next_in,W,A),Ue.state.wrap===1?Ue.adler=it(Ue.adler,ni,W,A):Ue.state.wrap===2&&(Ue.adler=pt(Ue.adler,ni,W,A)),Ue.next_in+=W,Ue.total_in+=W,W),Ce.lookahead+=Ve,3<=Ce.lookahead+Ce.insert)for(gt=Ce.strstart-Ce.insert,Ce.ins_h=Ce.window[gt],Ce.ins_h=(Ce.ins_h<Ce.lookahead+Ce.insert)););}while(Ce.lookahead<262&&Ce.strm.avail_in!==0)}function Tt(Ce,Ze){for(var yt,Ve;;){if(Ce.lookahead<262){if(St(Ce),Ce.lookahead<262&&Ze===0)return 1;if(Ce.lookahead===0)break}if(yt=0,3<=Ce.lookahead&&(Ce.ins_h=(Ce.ins_h<=Ce.match_length&&(Ce.strategy===1||Ce.match_length===3&&4096Ze.wrap&&(Ze.wrap=-Ze.wrap),Ze.status=Ze.wrap?42:113,Ce.adler=Ze.wrap===2?0:1,Ze.last_flush=0,le._tr_init(Ze),0):ze(Ce,-2)}function mt(Ce){var Ze=Be(Ce),yt;return Ze===0&&((yt=Ce.state).window_size=2*yt.w_size,Je(yt.head),yt.max_lazy_match=ce[yt.level].max_lazy,yt.good_match=ce[yt.level].good_length,yt.nice_match=ce[yt.level].nice_length,yt.max_chain_length=ce[yt.level].max_chain,yt.strstart=0,yt.block_start=0,yt.lookahead=0,yt.insert=0,yt.match_length=yt.prev_length=2,yt.match_available=0,yt.ins_h=0),Ze}function kt(Ce,Ze,yt,Ve,At,ii){if(!Ce)return-2;var gt=1;if(Ze===-1&&(Ze=6),0>Ve?(gt=0,Ve=-Ve):15At||9Ve||15Ze||9ii||4Ce.pending_buf_size-5&&(yt=Ce.pending_buf_size-5);;){if(1>=Ce.lookahead){if(St(Ce),Ce.lookahead===0&&Ze===0)return 1;if(Ce.lookahead===0)break}Ce.strstart+=Ce.lookahead,Ce.lookahead=0;var Ve=Ce.block_start+yt;if((Ce.strstart===0||Ce.strstart>=Ve)&&(Ce.lookahead=Ce.strstart-Ve,Ce.strstart=Ve,tt(Ce,!1),Ce.strm.avail_out===0)||Ce.strstart-Ce.block_start>=Ce.w_size-262&&(tt(Ce,!1),Ce.strm.avail_out===0))return 1}return Ce.insert=0,Ze===4?(tt(Ce,!0),Ce.strm.avail_out===0?3:4):(Ce.strstart>Ce.block_start&&(tt(Ce,!1),Ce.strm.avail_out),1)}),new at(4,4,8,4,Tt),new at(4,5,16,8,Tt),new at(4,6,32,32,Tt),new at(4,4,16,16,Lt),new at(8,16,32,32,Lt),new at(8,16,128,128,Lt),new at(8,32,128,256,Lt),new at(32,128,258,1024,Lt),new at(32,258,258,4096,Lt)],Ae.deflateInit=function(Ce,Ze){return kt(Ce,Ze,8,15,8,0)},Ae.deflateInit2=kt,Ae.deflateReset=mt,Ae.deflateResetKeep=Be,Ae.deflateSetHeader=function(Ce,Ze){return Ce&&Ce.state&&Ce.state.wrap===2?(Ce.state.gzhead=Ze,0):-2},Ae.deflate=function(Ce,Ze){var yt,Ve,At,ii;if(!Ce||!Ce.state||5Ze)return Ce?ze(Ce,-2):-2;if(Ve=Ce.state,!Ce.output||!Ce.input&&Ce.avail_in!==0||Ve.status===666&&Ze!==4)return ze(Ce,Ce.avail_out===0?-5:-2);if(Ve.strm=Ce,yt=Ve.last_flush,Ve.last_flush=Ze,Ve.status===42)if(Ve.wrap===2)Ce.adler=0,ft(Ve,31),ft(Ve,139),ft(Ve,8),Ve.gzhead?(ft(Ve,(Ve.gzhead.text?1:0)+(Ve.gzhead.hcrc?2:0)+(Ve.gzhead.extra?4:0)+(Ve.gzhead.name?8:0)+(Ve.gzhead.comment?16:0)),ft(Ve,255&Ve.gzhead.time),ft(Ve,255&Ve.gzhead.time>>8),ft(Ve,255&Ve.gzhead.time>>16),ft(Ve,255&Ve.gzhead.time>>24),ft(Ve,Ve.level===9?2:2<=Ve.strategy||2>Ve.level?4:0),ft(Ve,255&Ve.gzhead.os),Ve.gzhead.extra&&Ve.gzhead.extra.length&&(ft(Ve,255&Ve.gzhead.extra.length),ft(Ve,255&Ve.gzhead.extra.length>>8)),Ve.gzhead.hcrc&&(Ce.adler=pt(Ce.adler,Ve.pending_buf,Ve.pending,0)),Ve.gzindex=0,Ve.status=69):(ft(Ve,0),ft(Ve,0),ft(Ve,0),ft(Ve,0),ft(Ve,0),ft(Ve,Ve.level===9?2:2<=Ve.strategy||2>Ve.level?4:0),ft(Ve,3),Ve.status=113);else{var gt=8+(Ve.w_bits-8<<4)<<8;gt|=(2<=Ve.strategy||2>Ve.level?0:6>Ve.level?1:Ve.level===6?2:3)<<6,Ve.strstart!==0&&(gt|=32),gt+=31-gt%31,Ve.status=113,Pt(Ve,gt),Ve.strstart!==0&&(Pt(Ve,Ce.adler>>>16),Pt(Ve,65535&Ce.adler)),Ce.adler=1}if(Ve.status===69)if(Ve.gzhead.extra){for(At=Ve.pending;Ve.gzindex<(65535&Ve.gzhead.extra.length)&&(Ve.pending!==Ve.pending_buf_size||(Ve.gzhead.hcrc&&Ve.pending>At&&(Ce.adler=pt(Ce.adler,Ve.pending_buf,Ve.pending-At,At)),et(Ce),At=Ve.pending,Ve.pending!==Ve.pending_buf_size));)ft(Ve,255&Ve.gzhead.extra[Ve.gzindex]),Ve.gzindex++;Ve.gzhead.hcrc&&Ve.pending>At&&(Ce.adler=pt(Ce.adler,Ve.pending_buf,Ve.pending-At,At)),Ve.gzindex===Ve.gzhead.extra.length&&(Ve.gzindex=0,Ve.status=73)}else Ve.status=73;if(Ve.status===73)if(Ve.gzhead.name){At=Ve.pending;do{if(Ve.pending===Ve.pending_buf_size&&(Ve.gzhead.hcrc&&Ve.pending>At&&(Ce.adler=pt(Ce.adler,Ve.pending_buf,Ve.pending-At,At)),et(Ce),At=Ve.pending,Ve.pending===Ve.pending_buf_size)){ii=1;break}ii=Ve.gzindexAt&&(Ce.adler=pt(Ce.adler,Ve.pending_buf,Ve.pending-At,At)),ii===0&&(Ve.gzindex=0,Ve.status=91)}else Ve.status=91;if(Ve.status===91)if(Ve.gzhead.comment){At=Ve.pending;do{if(Ve.pending===Ve.pending_buf_size&&(Ve.gzhead.hcrc&&Ve.pending>At&&(Ce.adler=pt(Ce.adler,Ve.pending_buf,Ve.pending-At,At)),et(Ce),At=Ve.pending,Ve.pending===Ve.pending_buf_size)){ii=1;break}ii=Ve.gzindexAt&&(Ce.adler=pt(Ce.adler,Ve.pending_buf,Ve.pending-At,At)),ii===0&&(Ve.status=103)}else Ve.status=103;if(Ve.status===103&&(Ve.gzhead.hcrc?(Ve.pending+2>Ve.pending_buf_size&&et(Ce),Ve.pending+2<=Ve.pending_buf_size&&(ft(Ve,255&Ce.adler),ft(Ve,255&Ce.adler>>8),Ce.adler=0,Ve.status=113)):Ve.status=113),Ve.pending!==0){if(et(Ce),Ce.avail_out===0)return Ve.last_flush=-1,0}else if(Ce.avail_in===0&&Ge(Ze)<=Ge(yt)&&Ze!==4)return ze(Ce,-5);if(Ve.status===666&&Ce.avail_in!==0)return ze(Ce,-5);if(Ce.avail_in!==0||Ve.lookahead!==0||Ze!==0&&Ve.status!==666){var Ue=Ve.strategy===2?function(ni,A){for(var ve;;){if(ni.lookahead===0&&(St(ni),ni.lookahead===0)){if(A===0)return 1;break}if(ni.match_length=0,ve=le._tr_tally(ni,0,ni.window[ni.strstart]),ni.lookahead--,ni.strstart++,ve&&(tt(ni,!1),ni.strm.avail_out===0))return 1}return ni.insert=0,A===4?(tt(ni,!0),ni.strm.avail_out===0?3:4):ni.last_lit&&(tt(ni,!1),ni.strm.avail_out===0)?1:2}(Ve,Ze):Ve.strategy===3?function(ni,A){for(var ve=ni.window,W,T,b,m;;){if(258>=ni.lookahead){if(St(ni),258>=ni.lookahead&&A===0)return 1;if(ni.lookahead===0)break}if(ni.match_length=0,3<=ni.lookahead&&0ni.lookahead&&(ni.match_length=ni.lookahead)}if(3<=ni.match_length?(W=le._tr_tally(ni,1,ni.match_length-3),ni.lookahead-=ni.match_length,ni.strstart+=ni.match_length,ni.match_length=0):(W=le._tr_tally(ni,0,ni.window[ni.strstart]),ni.lookahead--,ni.strstart++),W&&(tt(ni,!1),ni.strm.avail_out===0))return 1}return ni.insert=0,A===4?(tt(ni,!0),ni.strm.avail_out===0?3:4):ni.last_lit&&(tt(ni,!1),ni.strm.avail_out===0)?1:2}(Ve,Ze):ce[Ve.level].func(Ve,Ze);if(Ue!==3&&Ue!==4||(Ve.status=666),Ue===1||Ue===3)return Ce.avail_out===0&&(Ve.last_flush=-1),0;if(Ue===2&&(Ze===1?le._tr_align(Ve):Ze!=5&&(le._tr_stored_block(Ve,0,0,!1),Ze==3&&(Je(Ve.head),Ve.lookahead===0&&(Ve.strstart=0,Ve.block_start=0,Ve.insert=0))),et(Ce),Ce.avail_out===0))return Ve.last_flush=-1,0}return Ze===4?0>=Ve.wrap?1:(Ve.wrap===2?(ft(Ve,255&Ce.adler),ft(Ve,255&Ce.adler>>8),ft(Ve,255&Ce.adler>>16),ft(Ve,255&Ce.adler>>24),ft(Ve,255&Ce.total_in),ft(Ve,255&Ce.total_in>>8),ft(Ve,255&Ce.total_in>>16),ft(Ve,255&Ce.total_in>>24)):(Pt(Ve,Ce.adler>>>16),Pt(Ve,65535&Ce.adler)),et(Ce),0=Ve.w_size&&(gt===0&&(Je(Ve.head),Ve.strstart=0,Ve.block_start=0,Ve.insert=0),ve=new ct.Buf8(Ve.w_size),ct.arraySet(ve,Ze,yt-Ve.w_size,Ve.w_size,0),Ze=ve,yt=Ve.w_size),Ue=Ce.avail_in,ni=Ce.next_in,A=Ce.input,Ce.avail_in=yt,Ce.next_in=0,Ce.input=Ze,St(Ve);Ve.lookahead>=3;){for(At=Ve.strstart,ii=Ve.lookahead-2;Ve.ins_h=(Ve.ins_h<Be&&(Ee+=yt[Je++]<>>=pt=it>>>24,Be-=pt,(pt=255&it>>>16)==0)Ve[tt++]=65535⁢else{if(!(16&pt)){if(!(64&pt)){it=mt[(65535&it)+(Ee&(1<>>=pt,Be-=pt),15>Be&&(Ee+=yt[Je++]<>>=pt=it>>>24,Be-=pt,!(16&(pt=255&it>>>16))){if(!(64&pt)){it=kt[(65535&it)+(Ee&(1<>>=pt,Be-=pt,(pt=tt-ft)>3,Ee&=(1<<(Be-=Le<<3))-1,Ae.next_in=Je,Ae.next_out=tt,Ae.avail_in=Je>>24)+(65280&ct>>>8)+((65280&ct)<<8)+((255&ct)<<24)}function Ge(){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 St.Buf16(320),this.work=new St.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Je(ct){var le;return ct&&ct.state?(le=ct.state,ct.total_in=ct.total_out=le.total=0,ct.msg="",le.wrap&&(ct.adler=1&le.wrap),le.mode=1,le.last=0,le.havedict=0,le.dmax=32768,le.head=null,le.hold=0,le.bits=0,le.lencode=le.lendyn=new St.Buf32(852),le.distcode=le.distdyn=new St.Buf32(592),le.sane=1,le.back=-1,0):-2}function et(ct){var le;return ct&&ct.state?((le=ct.state).wsize=0,le.whave=0,le.wnext=0,Je(ct)):-2}function tt(ct,le){var it,pt;return ct&&ct.state?(pt=ct.state,0>le?(it=0,le=-le):(it=1+(le>>4),48>le&&(le&=15)),le&&(8>le||15le;)ct.lens[le++]=8;for(;256>le;)ct.lens[le++]=9;for(;280>le;)ct.lens[le++]=7;for(;288>le;)ct.lens[le++]=8;for(Ee(1,ct.lens,0,288,mt,0,ct.work,{bits:9}),le=0;32>le;)ct.lens[le++]=5;Ee(2,ct.lens,0,32,kt,0,ct.work,{bits:5}),Be=!1}ct.lencode=mt,ct.lenbits=9,ct.distcode=kt,ct.distbits=5}function $t(ct,le,it,pt){var Le=ct.state,ce;return Le.window===null&&(Le.wsize=1<=Le.wsize?(St.arraySet(Le.window,le,it-Le.wsize,Le.wsize,0),Le.wnext=0,Le.whave=Le.wsize):(pt<(ce=Le.wsize-Le.wnext)&&(ce=pt),St.arraySet(Le.window,le,it-pt,ce,Le.wnext),(pt-=ce)?(St.arraySet(Le.window,le,it-pt,pt,0),Le.wnext=pt,Le.whave=Le.wsize):(Le.wnext+=ce,Le.wnext===Le.wsize&&(Le.wnext=0),Le.whaveUe;){if(At===0)break e;At--,gt+=Ce[yt++]<>>8,ce.check=Lt(ce.check,pt,2,0),Ue=gt=0,ce.mode=2;break}if(ce.flags=0,ce.head&&(ce.head.done=!1),!(1&ce.wrap)||(((255>)<<8)+(gt>>8))%31){ct.msg="incorrect header check",ce.mode=30;break}if((15>)!=8){ct.msg="unknown compression method",ce.mode=30;break}if(Ue-=4,B=8+(15&(gt>>>=4)),ce.wbits===0)ce.wbits=B;else if(B>ce.wbits){ct.msg="invalid window size",ce.mode=30;break}ce.dmax=1<Ue;){if(At===0)break e;At--,gt+=Ce[yt++]<>8),512&ce.flags&&(pt[0]=255>,pt[1]=255>>>>8,ce.check=Lt(ce.check,pt,2,0)),Ue=gt=0,ce.mode=3;case 3:for(;32>Ue;){if(At===0)break e;At--,gt+=Ce[yt++]<>>8,pt[2]=255>>>>16,pt[3]=255>>>>24,ce.check=Lt(ce.check,pt,4,0)),Ue=gt=0,ce.mode=4;case 4:for(;16>Ue;){if(At===0)break e;At--,gt+=Ce[yt++]<>8),512&ce.flags&&(pt[0]=255>,pt[1]=255>>>>8,ce.check=Lt(ce.check,pt,2,0)),Ue=gt=0,ce.mode=5;case 5:if(1024&ce.flags){for(;16>Ue;){if(At===0)break e;At--,gt+=Ce[yt++]<>>8,ce.check=Lt(ce.check,pt,2,0)),Ue=gt=0}else ce.head&&(ce.head.extra=null);ce.mode=6;case 6:if(1024&ce.flags&&(At<(ve=ce.length)&&(ve=At),ve&&(ce.head&&(B=ce.head.extra_len-ce.length,ce.head.extra||(ce.head.extra=Array(ce.head.extra_len)),St.arraySet(ce.head.extra,Ce,yt,ve,B)),512&ce.flags&&(ce.check=Lt(ce.check,Ce,ve,yt)),At-=ve,yt+=ve,ce.length-=ve),ce.length))break e;ce.length=0,ce.mode=7;case 7:if(2048&ce.flags){if(At===0)break e;for(ve=0;B=Ce[yt+ve++],ce.head&&B&&65536>ce.length&&(ce.head.name+=o(B)),B&&vece.length&&(ce.head.comment+=o(B)),B&&veUe;){if(At===0)break e;At--,gt+=Ce[yt++]<>9,ce.head.done=!0),ct.adler=ce.check=0,ce.mode=12;break;case 10:for(;32>Ue;){if(At===0)break e;At--,gt+=Ce[yt++]<>>=7&Ue,Ue-=7&Ue,ce.mode=27;break}for(;3>Ue;){if(At===0)break e;At--,gt+=Ce[yt++]<>>=1)){case 0:ce.mode=14;break;case 1:if(Pt(ce),ce.mode=20,le!==6)break;gt>>>=2,Ue-=2;break e;case 2:ce.mode=17;break;case 3:ct.msg="invalid block type",ce.mode=30}gt>>>=2,Ue-=2;break;case 14:for(gt>>>=7&Ue,Ue-=7&Ue;32>Ue;){if(At===0)break e;At--,gt+=Ce[yt++]<>>16)){ct.msg="invalid stored block lengths",ce.mode=30;break}if(ce.length=65535>,Ue=gt=0,ce.mode=15,le===6)break e;case 15:ce.mode=16;case 16:if(ve=ce.length){if(AtUe;){if(At===0)break e;At--,gt+=Ce[yt++]<>>=5,Ue-=5,ce.ndist=1+(31>),gt>>>=5,Ue-=5,ce.ncode=4+(15>),gt>>>=4,Ue-=4,286Ue;){if(At===0)break e;At--,gt+=Ce[yt++]<>>=3,Ue-=3}for(;19>ce.have;)ce.lens[Le[ce.have++]]=0;if(ce.lencode=ce.lendyn,ce.lenbits=7,Z={bits:ce.lenbits},q=Ee(0,ce.lens,0,19,ce.lencode,0,ce.work,Z),ce.lenbits=Z.bits,q){ct.msg="invalid code lengths set",ce.mode=30;break}ce.have=0,ce.mode=19;case 19:for(;ce.have>>16,_=65535&it,!((b=it>>>24)<=Ue);){if(At===0)break e;At--,gt+=Ce[yt++]<_)gt>>>=b,Ue-=b,ce.lens[ce.have++]=_;else{if(_===16){for(oe=b+2;Ue>>=b,Ue-=b,ce.have===0){ct.msg="invalid bit length repeat",ce.mode=30;break}B=ce.lens[ce.have-1],ve=3+(3>),gt>>>=2,Ue-=2}else if(_===17){for(oe=b+3;Ue>>=b)),gt>>>=3,Ue-=3}else{for(oe=b+7;Ue>>=b)),gt>>>=7,Ue-=7}if(ce.have+ve>ce.nlen+ce.ndist){ct.msg="invalid bit length repeat",ce.mode=30;break}for(;ve--;)ce.lens[ce.have++]=B}}if(ce.mode===30)break;if(ce.lens[256]===0){ct.msg="invalid code -- missing end-of-block",ce.mode=30;break}if(ce.lenbits=9,Z={bits:ce.lenbits},q=Ee(1,ce.lens,0,ce.nlen,ce.lencode,0,ce.work,Z),ce.lenbits=Z.bits,q){ct.msg="invalid literal/lengths set",ce.mode=30;break}if(ce.distbits=6,ce.distcode=ce.distdyn,Z={bits:ce.distbits},q=Ee(2,ce.lens,ce.nlen,ce.ndist,ce.distcode,0,ce.work,Z),ce.distbits=Z.bits,q){ct.msg="invalid distances set",ce.mode=30;break}if(ce.mode=20,le===6)break e;case 20:ce.mode=21;case 21:if(6<=At&&258<=ii){ct.next_out=Ve,ct.avail_out=ii,ct.next_in=yt,ct.avail_in=At,ce.hold=gt,ce.bits=Ue,at(ct,A),Ve=ct.next_out,Ze=ct.output,ii=ct.avail_out,yt=ct.next_in,Ce=ct.input,At=ct.avail_in,gt=ce.hold,Ue=ce.bits,ce.mode===12&&(ce.back=-1);break}for(ce.back=0;m=255&(it=ce.lencode[gt&(1<>>16,_=65535&it,!((b=it>>>24)<=Ue);){if(At===0)break e;At--,gt+=Ce[yt++]<>C)])>>>16,_=65535&it,!(C+(b=it>>>24)<=Ue);){if(At===0)break e;At--,gt+=Ce[yt++]<>>=C,Ue-=C,ce.back+=C}if(gt>>>=b,Ue-=b,ce.back+=b,ce.length=_,m===0){ce.mode=26;break}if(32&m){ce.back=-1,ce.mode=12;break}if(64&m){ct.msg="invalid literal/length code",ce.mode=30;break}ce.extra=15&m,ce.mode=22;case 22:if(ce.extra){for(oe=ce.extra;Ue>>=ce.extra,Ue-=ce.extra,ce.back+=ce.extra}ce.was=ce.length,ce.mode=23;case 23:for(;m=255&(it=ce.distcode[gt&(1<>>16,_=65535&it,!((b=it>>>24)<=Ue);){if(At===0)break e;At--,gt+=Ce[yt++]<>C)])>>>16,_=65535&it,!(C+(b=it>>>24)<=Ue);){if(At===0)break e;At--,gt+=Ce[yt++]<>>=C,Ue-=C,ce.back+=C}if(gt>>>=b,Ue-=b,ce.back+=b,64&m){ct.msg="invalid distance code",ce.mode=30;break}ce.offset=_,ce.extra=15&m,ce.mode=24;case 24:if(ce.extra){for(oe=ce.extra;Ue>>=ce.extra,Ue-=ce.extra,ce.back+=ce.extra}if(ce.offset>ce.dmax){ct.msg="invalid distance too far back",ce.mode=30;break}ce.mode=25;case 25:if(ii===0)break e;if(ve=A-ii,ce.offset>ve){if((ve=ce.offset-ve)>ce.whave&&ce.sane){ct.msg="invalid distance too far back",ce.mode=30;break}W=ve>ce.wnext?(ve-=ce.wnext,ce.wsize-ve):ce.wnext-ve,ve>ce.length&&(ve=ce.length),T=ce.window}else T=Ze,W=Ve-ce.offset,ve=ce.length;for(iiUe;){if(At===0)break e;At--,gt|=Ce[yt++]<Ue;){if(At===0)break e;At--,gt+=Ce[yt++]<ce.mode&&(27>ce.mode||le!==4))&&$t(ct,ct.output,ct.next_out,A-ct.avail_out)?(ce.mode=31,-4):(ni-=ct.avail_in,A-=ct.avail_out,ct.total_in+=ni,ct.total_out+=A,ce.total+=A,ce.wrap&&A&&(ct.adler=ce.check=ce.flags?Lt(ce.check,Ze,A,ct.next_out-A):Tt(ce.check,Ze,A,ct.next_out-A)),ct.data_type=ce.bits+(ce.last?64:0)+(ce.mode===12?128:0)+(ce.mode===20||ce.mode===15?256:0),(ni==0&&A===0||le===4)&&q===0&&(q=-5),q)},Ae.inflateEnd=function(ct){if(!ct||!ct.state)return-2;var le=ct.state;return le.window&&(le.window=null),ct.state=null,0},Ae.inflateGetHeader=function(ct,le){var it;return ct&&ct.state&&2&(it=ct.state).wrap?((it.head=le).done=!1,0):-2},Ae.inflateSetDictionary=function(ct,le){var it=le.length,pt;return ct&&ct.state?(pt=ct.state).wrap!==0&&pt.mode!==11?-2:pt.mode===11&&Tt(1,le,it,0)!==pt.check?-3:$t(ct,le,it,it)?(pt.mode=31,-4):(pt.havedict=1,0):-2},Ae.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(Pe,Oe){var Ae=Pe("../utils/common"),ze=[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],Ge=[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],Je=[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],et=[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];Oe.exports=function(tt,ft,Pt,$t,St,Tt,Lt,at){var Ee=at.bits,Be=0,mt=0,kt=0,ct=0,le=0,it=0,pt=0,Le=0,ce=0,Ce=0,Ze=null,yt=0,Ve=new Ae.Buf16(16),At=new Ae.Buf16(16),ii=null,gt=0,Ue,ni,A,ve,W,T,b,m,_;for(Be=0;15>=Be;Be++)Ve[Be]=0;for(mt=0;mt<$t;mt++)Ve[ft[Pt+mt]]++;for(le=Ee,ct=15;1<=ct&&Ve[ct]===0;ct--);if(ct=Be;Be++)if(Le<<=1,0>(Le-=Ve[Be]))return-1;if(0Be;Be++)At[Be+1]=At[Be]+Ve[Be];for(mt=0;mt<$t;mt++)ft[Pt+mt]!==0&&(Lt[At[ft[Pt+mt]]++]=mt);if(T=tt===0?(Ze=ii=Lt,19):tt===1?(Ze=ze,yt-=257,ii=Ge,gt-=257,256):(Ze=Je,ii=et,-1),Be=kt,W=Tt,pt=mt=Ce=0,A=-1,ve=(ce=1<<(it=le))-1,tt===1&&852T?(m=ii[gt+Lt[mt]],Ze[yt+Lt[mt]]):(m=96,0),Ue=1<>pt)+(ni-=Ue)]=0|(b<<24|m<<16|_),ni!==0;);for(Ue=1<>=1;if(Ue===0?Ce=0:(Ce&=Ue-1,Ce+=Ue),mt++,--Ve[Be]==0){if(Be===ct)break;Be=ft[Pt+Lt[mt]]}if(le=(Le-=Ve[it+pt]));)it++,Le<<=1;if(ce+=1<T?At[T]:At[256+(T>>>7)]}function tt(T,b){T.pending_buf[T.pending++]=255&b,T.pending_buf[T.pending++]=255&b>>>8}function ft(T,b,m){T.bi_valid>16-m?(T.bi_buf|=65535&b<>16-T.bi_valid,T.bi_valid+=m-16):(T.bi_buf|=65535&b<>>=1,m<<=1,0<--b;);return m>>>1}function St(T,b,m){var _=Array(16),C=0,D,F;for(D=1;D<=15;D++)_[D]=C=C+m[D-1]<<1;for(F=0;F<=b;F++){var B=T[2*F+1];B!==0&&(T[2*F]=$t(_[B]++,B))}}function Tt(T){var b;for(b=0;286>b;b++)T.dyn_ltree[2*b]=0;for(b=0;30>b;b++)T.dyn_dtree[2*b]=0;for(b=0;19>b;b++)T.bl_tree[2*b]=0;T.dyn_ltree[512]=1,T.opt_len=T.static_len=0,T.last_lit=T.matches=0}function Lt(T){8T.heap_len;)m[2*(Z=T.heap[++T.heap_len]=2>F?++F:0)]=1,T.depth[Z]=0,T.opt_len--,C&&(T.static_len-=_[2*Z+1]);for(b.max_code=F,B=T.heap_len>>1;1<=B;B--)Ee(T,m,B);for(Z=D;B=T.heap[1],T.heap[1]=T.heap[T.heap_len--],Ee(T,m,1),q=T.heap[1],T.heap[--T.heap_max]=B,T.heap[--T.heap_max]=q,m[2*Z]=m[2*B]+m[2*q],T.depth[Z]=(T.depth[B]>=T.depth[q]?T.depth[B]:T.depth[q])+1,m[2*B+1]=m[2*q+1]=Z,T.heap[1]=Z++,Ee(T,m,1),2<=T.heap_len;);T.heap[--T.heap_max]=T.heap[1],function(oe,ue){var be=ue.dyn_tree,De=ue.max_code,qe=ue.stat_desc.static_tree,rt=ue.stat_desc.has_stree,Dt=ue.stat_desc.extra_bits,Vt=ue.stat_desc.extra_base,Ke=ue.stat_desc.max_length,Ot=0,ei,Jt,Xt,ti,bi,Fi;for(ti=0;ti<=15;ti++)oe.bl_count[ti]=0;for(be[2*oe.heap[oe.heap_max]+1]=0,ei=oe.heap_max+1;573>ei;ei++)Ke<(ti=be[2*be[2*(Jt=oe.heap[ei])+1]+1]+1)&&(ti=Ke,Ot++),be[2*Jt+1]=ti,De=D?T.bl_tree[34]++:T.bl_tree[36]++:(Z!==_&&T.bl_tree[2*Z]++,T.bl_tree[32]++),_=Z,B=(D=0)===C?(F=138,3):Z===C?(F=6,3):(F=7,4))}function ct(T,b,m){var _=-1,C=b[1],D=0,F=7,B=4,q,Z;for(C===0&&(F=138,B=3),q=0;q<=m;q++)if(Z=C,C=b[2*(q+1)+1],!(++D=D?(Pt(T,17,T.bl_tree),ft(T,D-3,3)):(Pt(T,18,T.bl_tree),ft(T,D-11,7)):(Z!==_&&(Pt(T,Z,T.bl_tree),D--),Pt(T,16,T.bl_tree),ft(T,D-3,2));_=Z,B=(D=0)===C?(F=138,3):Z===C?(F=6,3):(F=7,4)}}function le(T,b,m,_){var C,D,F;ft(T,0+(_?1:0),3),D=b,F=m,Lt(C=T),tt(C,F),tt(C,~F),it.arraySet(C.pending_buf,C.window,D,F,C.pending),C.pending+=F}var it=Pe("../utils/common"),pt=15,Le=[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],ce=[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],Ce=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Ze=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],yt=Array(576);ze(yt);var Ve=Array(60);ze(Ve);var At=Array(512);ze(At);var ii=Array(256);ze(ii);var gt=Array(29);ze(gt);var Ue=Array(30),ni,A,ve;ze(Ue);var W=!1;Ae._tr_init=function(T){W||(function(){var b=Array(pt+1),m,_,C,D,F;for(D=C=0;28>D;D++)for(gt[D]=C,m=0;m<1<D;D++)for(Ue[D]=F,m=0;m<1<>=7;30>D;D++)for(Ue[D]=F<<7,m=0;m<1<=m;)yt[2*m+1]=8,m++,b[8]++;for(;255>=m;)yt[2*m+1]=9,m++,b[9]++;for(;279>=m;)yt[2*m+1]=7,m++,b[7]++;for(;287>=m;)yt[2*m+1]=8,m++,b[8]++;for(St(yt,287,b),m=0;30>m;m++)Ve[2*m+1]=5,Ve[2*m]=$t(m,5);ni=new Ge(yt,Le,257,286,pt),A=new Ge(Ve,ce,0,30,pt),ve=new Ge([],Ce,0,19,7)}(),W=!0),T.l_desc=new Je(T.dyn_ltree,ni),T.d_desc=new Je(T.dyn_dtree,A),T.bl_desc=new Je(T.bl_tree,ve),T.bi_buf=0,T.bi_valid=0,Tt(T)},Ae._tr_stored_block=le,Ae._tr_flush_block=function(T,b,m,_){var C=0,D,F;0=Z;Z++,q>>>=1)if(1&q&&B.dyn_ltree[2*Z]!==0)return 0;if(B.dyn_ltree[18]!==0||B.dyn_ltree[20]!==0||B.dyn_ltree[26]!==0)return 1;for(Z=32;256>Z;Z++)if(B.dyn_ltree[2*Z]!==0)return 1;return 0}(T)),mt(T,T.l_desc),mt(T,T.d_desc),C=function(B){var q;for(kt(B,B.dyn_ltree,B.l_desc.max_code),kt(B,B.dyn_dtree,B.d_desc.max_code),mt(B,B.bl_desc),q=18;3<=q&&B.bl_tree[2*Ze[q]+1]===0;q--);return B.opt_len+=3*(q+1)+5+5+4,q}(T),D=T.opt_len+3+7>>>3,(F=T.static_len+3+7>>>3)<=D&&(D=F)):D=F=m+5,m+4<=D&&b!==-1?le(T,b,m,_):T.strategy===4||F===D?(ft(T,2+(_?1:0),3),Be(T,yt,Ve)):(ft(T,4+(_?1:0),3),function(B,q,Z,oe){var ue;for(ft(B,q-257,5),ft(B,Z-1,5),ft(B,oe-4,4),ue=0;ue>>8,T.pending_buf[T.d_buf+2*T.last_lit+1]=255&b,T.pending_buf[T.l_buf+T.last_lit]=255&m,T.last_lit++,b===0?T.dyn_ltree[2*m]++:(T.matches++,b--,T.dyn_ltree[2*(ii[m]+256+1)]++,T.dyn_dtree[2*et(b)]++),T.last_lit===T.lit_bufsize-1},Ae._tr_align=function(T){var b;ft(T,2,3),Pt(T,256,yt),(b=T).bi_valid===16?(tt(b,b.bi_buf),b.bi_buf=0,b.bi_valid=0):8<=b.bi_valid&&(b.pending_buf[b.pending++]=255&b.bi_buf,b.bi_buf>>=8,b.bi_valid-=8)}},{"../utils/common":41}],53:[function(Pe,Oe){Oe.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(Pe,Oe){Oe.exports=typeof v=="function"?v:function(){var Ae=[].slice.apply(arguments);Ae.splice(1,0,0),setTimeout.apply(null,Ae)}},{}]},{},[10])(10)})}).call(this,ke===void 0?typeof self>"u"?typeof window>"u"?{}:window:self:ke)},{}]},{},[1])(1)})}).call(this,fe===void 0?typeof self>"u"?typeof window>"u"?{}:window:self:fe)},{}]},{},[1])(1)})}).call(this,Y===void 0?typeof self>"u"?typeof window>"u"?{}:window:self:Y)},{}]},{},[1])(1)})}).call(this,L===void 0?typeof self>"u"?typeof window>"u"?{}:window:self:L)},{}]},{},[1])(1)})}).call(this,typeof p>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:p)},{}]},{},[1])(1)})}).call(this)}).call(this,typeof kp>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:kp,l("buffer").Buffer,l("timers").setImmediate)},{buffer:8,timers:22}],12:[function(l,c){function d(){}function p(X){if(typeof X!="function")throw new TypeError("resolver must be a function");this.state=Y,this.queue=[],this.outcome=void 0,X!==d&&I(this,X)}function y(X,te,re){this.promise=X,typeof te=="function"&&(this.onFulfilled=te,this.callFulfilled=this.otherCallFulfilled),typeof re=="function"&&(this.onRejected=re,this.callRejected=this.otherCallRejected)}function v(X,te,re){L(function(){var fe;try{fe=te(re)}catch(ge){return N.reject(X,ge)}fe===X?N.reject(X,new TypeError("Cannot resolve promise with itself")):N.resolve(X,fe)})}function S(X){var te=X&&X.then;if(X&&(typeof X=="object"||typeof X=="function")&&typeof te=="function")return function(){te.apply(X,arguments)}}function I(X,te){function re(Ie){ge||(ge=!0,N.reject(X,Ie))}function fe(Ie){ge||(ge=!0,N.resolve(X,Ie))}var ge=!1,_e=O(function(){te(fe,re)});_e.status==="error"&&re(_e.value)}function O(X,te){var re={};try{re.value=X(te),re.status="success"}catch(fe){re.status="error",re.value=fe}return re}var L=l("immediate"),N={},G=["REJECTED"],V=["FULFILLED"],Y=["PENDING"];c.exports=p,p.prototype.finally=function(X){if(typeof X!="function")return this;var te=this.constructor;return this.then(function(re){return te.resolve(X()).then(function(){return re})},function(re){return te.resolve(X()).then(function(){throw re})})},p.prototype.catch=function(X){return this.then(null,X)},p.prototype.then=function(X,te){if(typeof X!="function"&&this.state===V||typeof te!="function"&&this.state===G)return this;var re=new this.constructor(d);if(this.state!==Y){var fe=this.state===V?X:te;v(re,fe,this.outcome)}else this.queue.push(new y(re,X,te));return re},y.prototype.callFulfilled=function(X){N.resolve(this.promise,X)},y.prototype.otherCallFulfilled=function(X){v(this.promise,this.onFulfilled,X)},y.prototype.callRejected=function(X){N.reject(this.promise,X)},y.prototype.otherCallRejected=function(X){v(this.promise,this.onRejected,X)},N.resolve=function(X,te){var re=O(S,te);if(re.status==="error")return N.reject(X,re.value);var fe=re.value;if(fe)I(X,fe);else{X.state=V,X.outcome=te;for(var ge=-1,_e=X.queue.length;++ge<_e;)X.queue[ge].callFulfilled(te)}return X},N.reject=function(X,te){X.state=G,X.outcome=te;for(var re=-1,fe=X.queue.length;++re=this._max)&&(this._max=1/0),this._lengthCalculator=X.length||p,typeof this._lengthCalculator!="function"&&(this._lengthCalculator=p),this._allowStale=X.stale||!1,this._maxAge=X.maxAge||null,this._dispose=X.dispose,void this.reset()):new v(X)}function S(X,te,re){y(te);var fe=X._cache[te];return fe&&(I(X,fe)?(G(X,fe),!X._allowStale&&(fe=void 0)):re&&O(X,fe),fe&&(fe=fe.value)),fe}function I(X,te){if(!te||!te.maxAge&&!X._maxAge)return!1;var re=!1,fe=Date.now()-te.now;return re=te.maxAge?fe>te.maxAge:X._maxAge&&fe>X._maxAge,re}function O(X,te){N(X,te),te.lu=X._mru++,X._lruList[te.lu]=te}function L(X){for(;X._lruX._max;)G(X,X._lruList[X._lru])}function N(X,te){for(delete X._lruList[te.lu];X._lru=X)||(X=1/0),this._max=X,this._length>this._max&&L(this)},get:function(){return this._max},enumerable:!0}),Object.defineProperty(v.prototype,"lengthCalculator",{set:function(X){if(typeof X!="function")for(var te in this._lengthCalculator=p,this._length=this._itemCount,this._cache)this._cache[te].length=1;else for(var te in this._lengthCalculator=X,this._length=0,this._cache)this._cache[te].length=this._lengthCalculator(this._cache[te].value),this._length+=this._cache[te].length;this._length>this._max&&L(this)},get:function(){return this._lengthCalculator},enumerable:!0}),Object.defineProperty(v.prototype,"length",{get:function(){return this._length},enumerable:!0}),Object.defineProperty(v.prototype,"itemCount",{get:function(){return this._itemCount},enumerable:!0}),v.prototype.forEach=function(X,te){te=te||this;for(var re=0,fe=this._itemCount,ge=this._mru-1;0<=ge&&rethis._max?(G(this,this._cache[X]),!1):(this._dispose&&this._dispose(X,this._cache[X].value),this._cache[X].now=fe,this._cache[X].maxAge=re,this._cache[X].value=te,this._length+=ge-this._cache[X].length,this._cache[X].length=ge,this.get(X),this._length>this._max&&L(this),!0);var _e=new V(X,te,this._mru++,ge,fe,re);return _e.length>this._max?(this._dispose&&this._dispose(X,te),!1):(this._length+=_e.length,this._lruList[_e.lu]=this._cache[X]=_e,this._itemCount++,this._length>this._max&&L(this),!0)},v.prototype.has=function(X){if(y(X),!d(this._cache,X))return!1;var te=this._cache[X];return!I(this,te)},v.prototype.get=function(X){return y(X),S(this,X,!0)},v.prototype.peek=function(X){return y(X),S(this,X,!1)},v.prototype.pop=function(){var X=this._lruList[this._lru];return G(this,X),X||null},v.prototype.del=function(X){y(X),G(this,this._cache[X])},v.prototype.load=function(X){this.reset();for(var te=Date.now(),re=X.length-1,fe;0<=re;re--){fe=X[re],y(fe.k);var ge=fe.e||0;if(ge===0)this.set(fe.k,fe.v);else{var _e=ge-te;0<_e&&this.set(fe.k,fe.v,_e)}}}})()},{}],14:[function(l,c){function d(S){var I=new y,O=I.write(S)+I.end();return O.replace(/\0/g,"").trim()}function p(S,I){if(!S)return d;try{new TextDecoder(S.trim())}catch{var O=v.exec(S);return O&&!I?p("windows-"+O[1],!0):d}return function(L){var N=new TextDecoder(S),G=N.decode(L,{stream:!0})+N.decode();return G.replace(/\0/g,"").trim()}}l("text-encoding-polyfill");var y=l("string_decoder").StringDecoder;c.exports=p;var v=/^(?:ANSI\s)?(\d+)$/m},{string_decoder:19,"text-encoding-polyfill":20}],15:[function(l,c){function d(I){var O={lastUpdated:new Date(I.readUInt8(1)+1900,I.readUInt8(2),I.readUInt8(3)),records:I.readUInt32LE(4),headerLen:I.readUInt16LE(8),recLen:I.readUInt16LE(10)};return O}function p(I,O,L){for(var N=[],G=32;G-1.001*mi)ne=-mi;else if(ne>mi&&ne<1.001*mi)ne=mi;else{if(ne<-mi)return{x:-1/0,y:-1/0,z:pe.z};if(ne>mi)return{x:1/0,y:1/0,z:pe.z}}return bt>O&&(bt-=2*O),me=V(ne),He=Y(ne),Te=me*me,se=We/X(1-Fe*Te),{x:(se+Q)*He*Y(bt),y:(se+Q)*He*V(bt),z:(se*(1-Fe)+Q)*me}}function Ce(pe,Fe,We,bt){var ne=1e-12,Q=pe.x,se=pe.y,me=pe.z?pe.z:0,Te,He,Ye,ot,Ct,Wt,pi,di,Oi,zi,sr,tr,Sr,lr,qr,tn;if(Te=X(Q*Q+se*se),He=X(Q*Q+se*se+me*me),!(Te/Wene*ne&&Sr<30);return qr=L(sr/n(zi)),{x:lr,y:qr,z:tn}}function Ze(pe,Fe,We){if(Fe===1)return{x:pe.x+We[0],y:pe.y+We[1],z:pe.z+We[2]};if(Fe===2){var bt=We[0],ne=We[1],Q=We[2],se=We[3],me=We[4],Te=We[5],He=We[6];return{x:He*(pe.x-Te*pe.y+me*pe.z)+bt,y:He*(Te*pe.x+pe.y-se*pe.z)+ne,z:He*(-me*pe.x+se*pe.y+pe.z)+Q}}}function yt(pe,Fe,We){if(Fe===1)return{x:pe.x-We[0],y:pe.y-We[1],z:pe.z-We[2]};if(Fe===2){var bt=We[0],ne=We[1],Q=We[2],se=We[3],me=We[4],Te=We[5],He=We[6],Ye=(pe.x-bt)/He,ot=(pe.y-ne)/He,Ct=(pe.z-Q)/He;return{x:Ye+Te*ot-me*Ct,y:-Te*Ye+ot+se*Ct,z:me*Ye-se*ot+Ct}}}function Ve(pe){return pe===1||pe===2}function At(pe,Fe,We){if(pe.grids===null||pe.grids.length===0)return console.log("Grid shift grids not found"),-1;for(var bt={x:-We.x,y:We.y},ne={x:v,y:v},Q=[],se=0,me;sebt.y||Ye>bt.x||Wtme&&n(Te.y)>me);if(0>se)return console.log("Inverse grid shift iterator failed to converge."),bt;bt.x=Bt(Q.x+We.ll[0]),bt.y=Q.y+We.ll[1]}else isNaN(Q.x)||(bt.x=pe.x+Q.x,bt.y=pe.y+Q.y);return bt}function gt(pe,Fe){var We={x:pe.x/Fe.del[0],y:pe.y/Fe.del[1]},bt={x:i(We.x),y:i(We.y)},ne={x:We.x-1*bt.x,y:We.y-1*bt.y},Q={x:v,y:v},se;if(0>bt.x||bt.x>=Fe.lim[0]||0>bt.y||bt.y>=Fe.lim[1])return Q;se=bt.y*Fe.lim[0]+bt.x;var me={x:Fe.cvs[se][0],y:Fe.cvs[se][1]};se++;var Te={x:Fe.cvs[se][0],y:Fe.cvs[se][1]};se+=Fe.lim[0];var He={x:Fe.cvs[se][0],y:Fe.cvs[se][1]};se--;var Ye={x:Fe.cvs[se][0],y:Fe.cvs[se][1]},ot=ne.x*ne.y,Ct=ne.x*(1-ne.y),Wt=(1-ne.x)*(1-ne.y),pi=(1-ne.x)*ne.y;return Q.x=Wt*me.x+Ct*Te.x+pi*Ye.x+ot*He.x,Q.y=Wt*me.y+Ct*Te.y+pi*Ye.y+ot*He.y,Q}function Ue(pe){var Fe=Number.isFinite;if(typeof Fe=="function"){if(Fe(pe))return;throw new TypeError("coordinates must be finite numbers")}if(typeof pe!="number"||pe!==pe||!isFinite(pe))throw new TypeError("coordinates must be finite numbers")}function ni(pe,Fe){return(pe.datum.datum_type===1||pe.datum.datum_type===2)&&Fe.datumCode!=="WGS84"||(Fe.datum.datum_type===1||Fe.datum.datum_type===2)&&pe.datumCode!=="WGS84"}function A(pe,Fe,We){var bt;if(Array.isArray(We)&&(We=Ts(We)),xa(We),pe.datum&&Fe.datum&&ni(pe,Fe)&&(bt=new pt("WGS84"),We=A(pe,bt,We),pe=bt),pe.axis!=="enu"&&(We=No(pe,!1,We)),pe.projName==="longlat")We={x:We.x*is,y:We.y*is,z:We.z||0};else if(pe.to_meter&&(We={x:We.x*pe.to_meter,y:We.y*pe.to_meter,z:We.z||0}),We=pe.inverse(We),!We)return;return pe.from_greenwich&&(We.x+=pe.from_greenwich),We=An(pe.datum,Fe.datum,We),!We?void 0:(Fe.from_greenwich&&(We={x:We.x-Fe.from_greenwich,y:We.y,z:We.z||0}),Fe.projName==="longlat"?We={x:We.x*Hn,y:We.y*Hn,z:We.z||0}:(We=Fe.forward(We),Fe.to_meter&&(We={x:We.x/Fe.to_meter,y:We.y/Fe.to_meter,z:We.z||0})),Fe.axis==="enu"?We:No(Fe,!0,We))}function ve(pe,Fe,We){var bt,ne,Q;return Array.isArray(We)?(bt=A(pe,Fe,We)||{x:NaN,y:NaN},2"u"?(Fe=pe,pe=Pu,bt=!0):(typeof Fe.x<"u"||Array.isArray(Fe))&&(We=Fe,Fe=pe,pe=Pu,bt=!0),Fe=W(Fe),We?ve(pe,Fe,We):(ne={forward:function(Q){return ve(pe,Fe,Q)},inverse:function(Q){return ve(Fe,pe,Q)}},bt&&(ne.oProj=Fe),ne)}function b(pe,Fe){return Fe=Fe||5,q(D({lat:pe[1],lon:pe[0]}),Fe)}function m(pe){var Fe=F(be(pe.toUpperCase()));return Fe.lat&&Fe.lon?[Fe.lon,Fe.lat]:[(Fe.left+Fe.right)/2,(Fe.top+Fe.bottom)/2]}function _(pe){return pe*(O/180)}function C(pe){return 180*(pe/O)}function D(pe){var Fe=pe.lat,We=pe.lon,bt=6378137,ne=.00669438,Q=.9996,se=_(Fe),me,Te,He,Ye,ot,Ct;Ct=i((We+180)/6)+1,We===180&&(Ct=60),56<=Fe&&64>Fe&&3<=We&&12>We&&(Ct=32),72<=Fe&&84>Fe&&(0<=We&&9>We?Ct=31:9<=We&&21>We?Ct=33:21<=We&&33>We?Ct=35:33<=We&&42>We&&(Ct=37)),me=ne/(1-ne),Te=bt/X(1-ne*V(se)*V(se)),He=G(se)*G(se),Ye=me*Y(se)*Y(se),ot=bt*((1-ne/4-3*ne*ne/64-5*ne*ne*ne/256)*se-(3*ne/8+3*ne*ne/32+45*ne*ne*ne/1024)*V(2*se)+(15*ne*ne/256+45*ne*ne*ne/1024)*V(4*se)-35*ne*ne*ne/3072*V(6*se));var Wt=Q*Te*(65+65*(65*(65*(1-He+Ye)))/6+65*(65*(65*(65*(65*(5-18*He+He*He+72*Ye-58*me)))))/120)+5e5,pi=Q*(ot+Te*G(se)*(4225/2+65*(65*(65*(65*(5-He+9*Ye+4*Ye*Ye))))/24+65*(65*(65*(65*(65*(65*(61-58*He+He*He+600*Ye-330*me))))))/720));return 0>Fe&&(pi+=1e7),{northing:I(pi),easting:I(Wt),zoneNumber:Ct,zoneLetter:B(Fe)}}function F(pe){var Fe=pe.northing,We=pe.easting,bt=pe.zoneLetter,ne=pe.zoneNumber;if(0>ne||60bt&&(He-=1e7),zi=6*(ne-1)-180+3,Ye=me/(1-me),Oi=He/Q,sr=Oi/(se*(1-me/4-3*me*me/64-5*me*me*me/256)),tr=sr+(3*Te/2-27*Te*Te*Te/32)*V(2*sr)+(21*Te*Te/16-55*Te*Te*Te*Te/32)*V(4*sr)+151*Te*Te*Te/96*V(6*sr),ot=se/X(1-me*V(tr)*V(tr)),Ct=G(tr)*G(tr),Wt=Ye*Y(tr)*Y(tr),pi=se*(1-me)/s(1-me*V(tr)*V(tr),1.5),di=(We-5e5)/(ot*Q);var Sr=tr-ot*G(tr)/pi*(di*di/2-(5+3*Ct+10*Wt-4*Wt*Wt-9*Ye)*di*di*di*di/24+(61+90*Ct+298*Wt+45*Ct*Ct-252*Ye-3*Wt*Wt)*di*di*di*di*di*di/720);Sr=C(Sr);var lr=(di-(1+2*Ct+Wt)*di*di*di/6+(5-2*Wt+28*Ct-3*Wt*Wt+8*Ye+24*Ct*Ct)*di*di*di*di*di/120)/Y(tr);lr=zi+C(lr);var qr;if(pe.accuracy){var tn=F({northing:pe.northing+pe.accuracy,easting:pe.easting+pe.accuracy,zoneLetter:pe.zoneLetter,zoneNumber:pe.zoneNumber});qr={top:tn.lat,right:tn.lon,bottom:Sr,left:lr}}else qr={lat:Sr,lon:lr};return qr}function B(pe){var Fe="Z";return 84>=pe&&72<=pe?Fe="X":72>pe&&64<=pe?Fe="W":64>pe&&56<=pe?Fe="V":56>pe&&48<=pe?Fe="U":48>pe&&40<=pe?Fe="T":40>pe&&32<=pe?Fe="S":32>pe&&24<=pe?Fe="R":24>pe&&16<=pe?Fe="Q":16>pe&&8<=pe?Fe="P":8>pe&&0<=pe?Fe="N":0>pe&&-8<=pe?Fe="M":-8>pe&&-16<=pe?Fe="L":-16>pe&&-24<=pe?Fe="K":-24>pe&&-32<=pe?Fe="J":-32>pe&&-40<=pe?Fe="H":-40>pe&&-48<=pe?Fe="G":-48>pe&&-56<=pe?Fe="F":-56>pe&&-64<=pe?Fe="E":-64>pe&&-72<=pe?Fe="D":-72>pe&&-80<=pe&&(Fe="C"),Fe}function q(pe,Fe){var We="00000"+pe.easting,bt="00000"+pe.northing;return pe.zoneNumber+pe.zoneLetter+Z(pe.easting,pe.northing,pe.zoneNumber)+We.substr(We.length-5,Fe)+bt.substr(bt.length-5,Fe)}function Z(pe,Fe,We){var bt=oe(We),ne=i(pe/1e5),Q=i(Fe/1e5)%20;return ue(ne,Q,bt)}function oe(pe){var Fe=pe%6;return Fe===0&&(Fe=6),Fe}function ue(pe,Fe,We){var bt=We-1,ne="AJSAJS".charCodeAt(bt),Q="AFAFAF".charCodeAt(bt),se=ne+pe-1,me=Q+Fe,Te=!1;90ne&&73ne)&&Te)&&se++,(se===79||79>ne&&79ne)&&Te)&&(se++,se===73&&se++),90Q&&73Q)&&Te)&&me++,(me===79||79>Q&&79Q)&&Te)&&(me++,me===73&&me++),86Fe)throw"MGRSPoint bad conversion from: "+pe;var me=pe.charAt(ne++);if("A">=me||me==="B"||me==="Y"||"Z"<=me||me==="I"||me==="O")throw"MGRSPoint zone letter "+me+" not handled: "+pe;We=pe.substring(ne,ne+=2);for(var Te=oe(se),He=De(We.charAt(0),Te),Ye=qe(We.charAt(1),Te);Ye"u"?typeof p>"u"?typeof self>"u"?this:self:p:window).JSZip=x()})(function(){return function x(I,P,F){function k(Y,X){if(!P[Y]){if(!I[Y]){var Z=typeof l=="function"&&l;if(!X&&Z)return Z(Y,!0);if(j)return j(Y,!0);var ie=new Error("Cannot find module '"+Y+"'");throw ie.code="MODULE_NOT_FOUND",ie}var ce=P[Y]={exports:{}};I[Y][0].call(ce.exports,function(he){var _e=I[Y][1][he];return k(_e||he)},ce,ce.exports,x,I,P,F)}return P[Y].exports}for(var j=typeof l=="function"&&l,V=0;V"u"?F===void 0?typeof self>"u"?this:self:F:window).JSZip=k()})(function(){return function k(j,V,Y){function X(ce,he){if(!V[ce]){if(!j[ce]){var _e=typeof x=="function"&&x;if(!he&&_e)return _e(ce,!0);if(Z)return Z(ce,!0);var xe=new Error("Cannot find module '"+ce+"'");throw xe.code="MODULE_NOT_FOUND",xe}var Pe=V[ce]={exports:{}};j[ce][0].call(Pe.exports,function(ke){return X(j[ce][1][ke]||ke)},Pe,Pe.exports,k,j,V,Y)}return V[ce].exports}for(var Z=typeof x=="function"&&x,ie=0;ie"u"?Y===void 0?typeof self>"u"?this:self:Y:window).JSZip=X()})(function(){return function X(Z,ie,ce){function he(Pe,ke){if(!ie[Pe]){if(!Z[Pe]){var J=typeof k=="function"&&k;if(!ke&&J)return J(Pe,!0);if(_e)return _e(Pe,!0);var de=new Error("Cannot find module '"+Pe+"'");throw de.code="MODULE_NOT_FOUND",de}var Se=ie[Pe]={exports:{}};Z[Pe][0].call(Se.exports,function(Ie){return he(Z[Pe][1][Ie]||Ie)},Se,Se.exports,X,Z,ie,ce)}return ie[Pe].exports}for(var _e=typeof k=="function"&&k,xe=0;xe"u"?ce===void 0?typeof self>"u"?this:self:ce:window).JSZip=he()})(function(){return function he(_e,xe,Pe){function ke(Se,Ie){if(!xe[Se]){if(!_e[Se]){var Re=typeof X=="function"&&X;if(!Ie&&Re)return Re(Se,!0);if(J)return J(Se,!0);var Oe=new Error("Cannot find module '"+Se+"'");throw Oe.code="MODULE_NOT_FOUND",Oe}var Ge=xe[Se]={exports:{}};_e[Se][0].call(Ge.exports,function(Be){return ke(_e[Se][1][Be]||Be)},Ge,Ge.exports,he,_e,xe,Pe)}return xe[Se].exports}for(var J=typeof X=="function"&&X,de=0;de"u"?Pe===void 0?typeof self>"u"?this:self:Pe:window).JSZip=ke()})(function(){return function ke(J,de,Se){function Ie(Ge,Be){if(!de[Ge]){if(!J[Ge]){var qe=typeof he=="function"&&he;if(!Be&&qe)return qe(Ge,!0);if(Re)return Re(Ge,!0);var et=new Error("Cannot find module '"+Ge+"'");throw et.code="MODULE_NOT_FOUND",et}var Ze=de[Ge]={exports:{}};J[Ge][0].call(Ze.exports,function(mt){return Ie(J[Ge][1][mt]||mt)},Ze,Ze.exports,ke,J,de,Se)}return de[Ge].exports}for(var Re=typeof he=="function"&&he,Oe=0;Oe"u"?Se===void 0?typeof self>"u"?this:self:Se:window).JSZip=Ie()})(function(){return function Ie(Re,Oe,Ge){function Be(Ze,mt){if(!Oe[Ze]){if(!Re[Ze]){var Pt=typeof ke=="function"&&ke;if(!mt&&Pt)return Pt(Ze,!0);if(qe)return qe(Ze,!0);var $t=new Error("Cannot find module '"+Ze+"'");throw $t.code="MODULE_NOT_FOUND",$t}var Ct=Oe[Ze]={exports:{}};Re[Ze][0].call(Ct.exports,function(Et){return Be(Re[Ze][1][Et]||Et)},Ct,Ct.exports,Ie,Re,Oe,Ge)}return Oe[Ze].exports}for(var qe=typeof ke=="function"&&ke,et=0;et>2,Te=(3&Ct)<<4|Et>>4,je=1>6:64,pt=2>4,Pt=(15&Ct)<<4|(Et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(qe.charAt(et++)))>>2,$t=(3&Et)<<6|(Ft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(qe.charAt(et++))),Te[Ze++]=mt,Et!==64&&(Te[Ze++]=Pt),Ft!==64&&(Te[Ze++]=$t);return Te}},{"./support":30,"./utils":32}],2:[function(Ie,Re){function Oe(Ze,mt,Pt,$t,Ct){this.compressedSize=Ze,this.uncompressedSize=mt,this.crc32=Pt,this.compression=$t,this.compressedContent=Ct}var Ge=Ie("./external"),Be=Ie("./stream/DataWorker"),qe=Ie("./stream/Crc32Probe"),et=Ie("./stream/DataLengthProbe");Oe.prototype={getContentWorker:function(){var Ze=new Be(Ge.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new et("data_length")),mt=this;return Ze.on("end",function(){if(this.streamInfo.data_length!==mt.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),Ze},getCompressedWorker:function(){return new Be(Ge.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},Oe.createWorkerFrom=function(Ze,mt,Pt){return Ze.pipe(new qe).pipe(new et("uncompressedSize")).pipe(mt.compressWorker(Pt)).pipe(new et("compressedSize")).withStreamInfo("compression",mt)},Re.exports=Oe},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(Ie,Re,Oe){var Ge=Ie("./stream/GenericWorker");Oe.STORE={magic:"\0\0",compressWorker:function(){return new Ge("STORE compression")},uncompressWorker:function(){return new Ge("STORE decompression")}},Oe.DEFLATE=Ie("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(Ie,Re){var Oe=Ie("./utils"),Ge=function(){for(var Be=[],qe=0,et;256>qe;qe++){et=qe;for(var Ze=0;8>Ze;Ze++)et=1&et?3988292384^et>>>1:et>>>1;Be[qe]=et}return Be}();Re.exports=function(Be,qe){return Be!==void 0&&Be.length?Oe.getTypeOf(Be)==="string"?function(et,Ze,mt){et^=-1;for(var Pt=0;Pt<0+mt;Pt++)et=et>>>8^Ge[255&(et^Ze.charCodeAt(Pt))];return-1^et}(0|qe,Be,Be.length):function(et,Ze,mt){et^=-1;for(var Pt=0;Pt<0+mt;Pt++)et=et>>>8^Ge[255&(et^Ze[Pt])];return-1^et}(0|qe,Be,Be.length):0}},{"./utils":32}],5:[function(Ie,Re,Oe){Oe.base64=!1,Oe.binary=!1,Oe.dir=!1,Oe.createFolders=!0,Oe.date=null,Oe.compression=null,Oe.compressionOptions=null,Oe.comment=null,Oe.unixPermissions=null,Oe.dosPermissions=null},{}],6:[function(Ie,Re){var Oe;Oe=typeof Promise>"u"?Ie("lie"):Promise,Re.exports={Promise:Oe}},{lie:37}],7:[function(Ie,Re,Oe){function Ge(Pt,$t){Ze.call(this,"FlateWorker/"+Pt),this._pako=null,this._pakoAction=Pt,this._pakoOptions=$t,this.meta={}}var Be=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",qe=Ie("pako"),et=Ie("./utils"),Ze=Ie("./stream/GenericWorker"),mt=Be?"uint8array":"array";Oe.magic="\b\0",et.inherits(Ge,Ze),Ge.prototype.processChunk=function(Pt){this.meta=Pt.meta,this._pako===null&&this._createPako(),this._pako.push(et.transformTo(mt,Pt.data),!1)},Ge.prototype.flush=function(){Ze.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},Ge.prototype.cleanUp=function(){Ze.prototype.cleanUp.call(this),this._pako=null},Ge.prototype._createPako=function(){this._pako=new qe[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var Pt=this;this._pako.onData=function($t){Pt.push({data:$t,meta:Pt.meta})}},Oe.compressWorker=function(Pt){return new Ge("Deflate",Pt)},Oe.uncompressWorker=function(){return new Ge("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(Ie,Re){function Oe($t,Ct){var Et="",Ft;for(Ft=0;Ft>>=8;return Et}function Ge($t,Ct,Et,Ft,ot,Te){var je=$t.file,pt=$t.compression,kt=Te!==Ze.utf8encode,ct=qe.transformTo("string",Te(je.name)),ae=qe.transformTo("string",Ze.utf8encode(je.name)),ht=je.comment,wt=qe.transformTo("string",Te(ht)),Ne=qe.transformTo("string",Ze.utf8encode(ht)),pe=ae.length!==je.name.length,Ae=Ne.length!==ht.length,tt="",gt="",ze="",Ot=je.dir,jt=je.date,nt={crc32:0,compressedSize:0,uncompressedSize:0},$e,Xt;Ct&&!Et||(nt.crc32=$t.crc32,nt.compressedSize=$t.compressedSize,nt.uncompressedSize=$t.uncompressedSize);var A=0;Ct&&(A|=8),!kt&&(pe||Ae)&&(A|=2048);var ye=0,H=0,T;Ot&&(ye|=16),ot==="UNIX"?(H=798,ye|=((T=je.unixPermissions)||(T=Ot?16893:33204),(65535&T)<<16)):(H=20,ye|=63&(je.dosPermissions||0)),$e=jt.getUTCHours(),$e<<=6,$e|=jt.getUTCMinutes(),$e<<=5,$e|=jt.getUTCSeconds()/2,Xt=jt.getUTCFullYear()-1980,Xt<<=4,Xt|=jt.getUTCMonth()+1,Xt<<=5,Xt|=jt.getUTCDate(),pe&&(tt+="up"+Oe((gt=Oe(1,1)+Oe(mt(ct),4)+ae).length,2)+gt),Ae&&(tt+="uc"+Oe((ze=Oe(1,1)+Oe(mt(wt),4)+Ne).length,2)+ze);var b="";return b+=` +\0`,b+=Oe(A,2),b+=pt.magic,b+=Oe($e,2),b+=Oe(Xt,2),b+=Oe(nt.crc32,4),b+=Oe(nt.compressedSize,4),b+=Oe(nt.uncompressedSize,4),b+=Oe(ct.length,2),b+=Oe(tt.length,2),{fileRecord:Pt.LOCAL_FILE_HEADER+b+ct+tt,dirRecord:Pt.CENTRAL_FILE_HEADER+Oe(H,2)+b+Oe(wt.length,2)+"\0\0\0\0"+Oe(ye,4)+Oe(Ft,4)+ct+tt+wt}}function Be($t,Ct,Et,Ft){et.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=Ct,this.zipPlatform=Et,this.encodeFileName=Ft,this.streamFiles=$t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}var qe=Ie("../utils"),et=Ie("../stream/GenericWorker"),Ze=Ie("../utf8"),mt=Ie("../crc32"),Pt=Ie("../signature");qe.inherits(Be,et),Be.prototype.push=function($t){var Ct=$t.meta.percent||0,Et=this.entriesCount,Ft=this._sources.length;this.accumulate?this.contentBuffer.push($t):(this.bytesWritten+=$t.data.length,et.prototype.push.call(this,{data:$t.data,meta:{currentFile:this.currentFile,percent:Et?(Ct+100*(Et-Ft-1))/Et:100}}))},Be.prototype.openedSource=function($t){this.currentSourceOffset=this.bytesWritten,this.currentFile=$t.file.name;var Ct=this.streamFiles&&!$t.file.dir;if(Ct){var Et=Ge($t,Ct,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:Et.fileRecord,meta:{percent:0}})}else this.accumulate=!0},Be.prototype.closedSource=function($t){this.accumulate=!1;var Ct=this.streamFiles&&!$t.file.dir,Et=Ge($t,Ct,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName),Ft;if(this.dirRecords.push(Et.dirRecord),Ct)this.push({data:(Ft=$t,Pt.DATA_DESCRIPTOR+Oe(Ft.crc32,4)+Oe(Ft.compressedSize,4)+Oe(Ft.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:Et.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},Be.prototype.flush=function(){for(var $t=this.bytesWritten,Ct=0;CtBe)throw new Error("End of data reached (data length = "+this.length+", asked index = "+Be+"). Corrupted zip ?")},setIndex:function(Be){this.checkIndex(Be),this.index=Be},skip:function(Be){this.setIndex(this.index+Be)},byteAt:function(){},readInt:function(Be){var qe=0,et;for(this.checkOffset(Be),et=this.index+Be-1;et>=this.index;et--)qe=(qe<<8)+this.byteAt(et);return this.index+=Be,qe},readString:function(Be){return Ge.transformTo("string",this.readData(Be))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var Be=this.readInt(4);return new Date(Date.UTC(1980+(127&Be>>25),(15&Be>>21)-1,31&Be>>16,31&Be>>11,63&Be>>5,(31&Be)<<1))}},Re.exports=Oe},{"../utils":32}],19:[function(Ie,Re){function Oe(Be){Ge.call(this,Be)}var Ge=Ie("./Uint8ArrayReader");Ie("../utils").inherits(Oe,Ge),Oe.prototype.readData=function(Be){this.checkOffset(Be);var qe=this.data.slice(this.zero+this.index,this.zero+this.index+Be);return this.index+=Be,qe},Re.exports=Oe},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(Ie,Re){function Oe(Be){Ge.call(this,Be)}var Ge=Ie("./DataReader");Ie("../utils").inherits(Oe,Ge),Oe.prototype.byteAt=function(Be){return this.data.charCodeAt(this.zero+Be)},Oe.prototype.lastIndexOfSignature=function(Be){return this.data.lastIndexOf(Be)-this.zero},Oe.prototype.readAndCheckSignature=function(Be){return Be===this.readData(4)},Oe.prototype.readData=function(Be){this.checkOffset(Be);var qe=this.data.slice(this.zero+this.index,this.zero+this.index+Be);return this.index+=Be,qe},Re.exports=Oe},{"../utils":32,"./DataReader":18}],21:[function(Ie,Re){function Oe(Be){Ge.call(this,Be)}var Ge=Ie("./ArrayReader");Ie("../utils").inherits(Oe,Ge),Oe.prototype.readData=function(Be){if(this.checkOffset(Be),Be===0)return new Uint8Array(0);var qe=this.data.subarray(this.zero+this.index,this.zero+this.index+Be);return this.index+=Be,qe},Re.exports=Oe},{"../utils":32,"./ArrayReader":17}],22:[function(Ie,Re){var Oe=Ie("../utils"),Ge=Ie("../support"),Be=Ie("./ArrayReader"),qe=Ie("./StringReader"),et=Ie("./NodeBufferReader"),Ze=Ie("./Uint8ArrayReader");Re.exports=function(mt){var Pt=Oe.getTypeOf(mt);return Oe.checkSupport(Pt),Pt!=="string"||Ge.uint8array?Pt==="nodebuffer"?new et(mt):Ge.uint8array?new Ze(Oe.transformTo("uint8array",mt)):new Be(Oe.transformTo("array",mt)):new qe(mt)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(Ie,Re,Oe){Oe.LOCAL_FILE_HEADER="PK",Oe.CENTRAL_FILE_HEADER="PK",Oe.CENTRAL_DIRECTORY_END="PK",Oe.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",Oe.ZIP64_CENTRAL_DIRECTORY_END="PK",Oe.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(Ie,Re){function Oe(qe){Ge.call(this,"ConvertWorker to "+qe),this.destType=qe}var Ge=Ie("./GenericWorker"),Be=Ie("../utils");Be.inherits(Oe,Ge),Oe.prototype.processChunk=function(qe){this.push({data:Be.transformTo(this.destType,qe.data),meta:qe.meta})},Re.exports=Oe},{"../utils":32,"./GenericWorker":28}],25:[function(Ie,Re){function Oe(){Ge.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}var Ge=Ie("./GenericWorker"),Be=Ie("../crc32");Ie("../utils").inherits(Oe,Ge),Oe.prototype.processChunk=function(qe){this.streamInfo.crc32=Be(qe.data,this.streamInfo.crc32||0),this.push(qe)},Re.exports=Oe},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(Ie,Re){function Oe(qe){Be.call(this,"DataLengthProbe for "+qe),this.propName=qe,this.withStreamInfo(qe,0)}var Ge=Ie("../utils"),Be=Ie("./GenericWorker");Ge.inherits(Oe,Be),Oe.prototype.processChunk=function(qe){if(qe){var et=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=et+qe.data.length}Be.prototype.processChunk.call(this,qe)},Re.exports=Oe},{"../utils":32,"./GenericWorker":28}],27:[function(Ie,Re){function Oe(qe){Be.call(this,"DataWorker");var et=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,qe.then(function(Ze){et.dataIsReady=!0,et.data=Ze,et.max=Ze&&Ze.length||0,et.type=Ge.getTypeOf(Ze),et.isPaused||et._tickAndRepeat()},function(Ze){et.error(Ze)})}var Ge=Ie("../utils"),Be=Ie("./GenericWorker");Ge.inherits(Oe,Be),Oe.prototype.cleanUp=function(){Be.prototype.cleanUp.call(this),this.data=null},Oe.prototype.resume=function(){return!!Be.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,Ge.delay(this._tickAndRepeat,[],this)),!0)},Oe.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(Ge.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},Oe.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var qe=null,et=a(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":qe=this.data.substring(this.index,et);break;case"uint8array":qe=this.data.subarray(this.index,et);break;case"array":case"nodebuffer":qe=this.data.slice(this.index,et)}return this.index=et,this.push({data:qe,meta:{percent:this.max?100*(this.index/this.max):0}})},Re.exports=Oe},{"../utils":32,"./GenericWorker":28}],28:[function(Ie,Re){function Oe(Ge){this.name=Ge||"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}Oe.prototype={push:function(Ge){this.emit("data",Ge)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(Ge){this.emit("error",Ge)}return!0},error:function(Ge){return!this.isFinished&&(this.isPaused?this.generatedError=Ge:(this.isFinished=!0,this.emit("error",Ge),this.previous&&this.previous.error(Ge),this.cleanUp()),!0)},on:function(Ge,Be){return this._listeners[Ge].push(Be),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(Ge,Be){if(this._listeners[Ge])for(var qe=0;qe "+Ge:Ge}},Re.exports=Oe},{}],29:[function(Ie,Re){function Oe($t,Ct,Et){var Ft=Ct;Ct==="blob"||Ct==="arraybuffer"?Ft="uint8array":Ct==="base64"&&(Ft="string");try{this._internalType=Ft,this._outputType=Ct,this._mimeType=Et,Ge.checkSupport(Ft),this._worker=$t.pipe(new Be(Ft)),$t.lock()}catch(ot){this._worker=new qe("error"),this._worker.error(ot)}}var Ge=Ie("../utils"),Be=Ie("./ConvertWorker"),qe=Ie("./GenericWorker"),et=Ie("../base64"),Ze=Ie("../support"),mt=Ie("../external"),Pt=null;if(Ze.nodestream)try{Pt=Ie("../nodejs/NodejsStreamOutputAdapter")}catch{}Oe.prototype={accumulate:function($t){return Ct=this,Et=$t,new mt.Promise(function(Ft,ot){var Te=[],je=Ct._internalType,pt=Ct._outputType,kt=Ct._mimeType;Ct.on("data",function(ct,ae){Te.push(ct),Et&&Et(ae)}).on("error",function(ct){Te=[],ot(ct)}).on("end",function(){try{var ct=function(ae,ht,wt){return ae==="blob"?Ge.newBlob(Ge.transformTo("arraybuffer",ht),wt):ae==="base64"?et.encode(ht):Ge.transformTo(ae,ht)}(pt,function(ae,ht){var wt=0,Ne=null,pe=0,Ae;for(Ae=0;Ae"u")Oe.blob=!1;else{var Ge=new ArrayBuffer(0);try{Oe.blob=new Blob([Ge],{type:"application/zip"}).size===0}catch{try{var Be=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);Be.append(Ge),Oe.blob=Be.getBlob("application/zip").size===0}catch{Oe.blob=!1}}}try{Oe.nodestream=!!Ie("readable-stream").Readable}catch{Oe.nodestream=!1}},{"readable-stream":16}],31:[function(Ie,Re,Oe){function Ge(){mt.call(this,"utf-8 decode"),this.leftOver=null}function Be(){mt.call(this,"utf-8 encode")}for(var qe=Ie("./utils"),et=Ie("./support"),Ze=Ie("./nodejsUtils"),mt=Ie("./stream/GenericWorker"),Pt=Array(256),$t=0;256>$t;$t++)Pt[$t]=252<=$t?6:248<=$t?5:240<=$t?4:224<=$t?3:192<=$t?2:1;Pt[254]=Pt[254]=1,Oe.utf8encode=function(Ct){return et.nodebuffer?Ze.newBufferFrom(Ct,"utf-8"):function(Et){var Ft=Et.length,ot=0,Te,je,pt,kt,ct;for(kt=0;ktje?1:2048>je?2:65536>je?3:4;for(Te=et.uint8array?new Uint8Array(ot):Array(ot),kt=ct=0;ctje?Te[ct++]=je:(2048>je?Te[ct++]=192|je>>>6:(65536>je?Te[ct++]=224|je>>>12:(Te[ct++]=240|je>>>18,Te[ct++]=128|63&je>>>12),Te[ct++]=128|63&je>>>6),Te[ct++]=128|63&je);return Te}(Ct)},Oe.utf8decode=function(Ct){return et.nodebuffer?qe.transformTo("nodebuffer",Ct).toString("utf-8"):function(Et){var Ft=Et.length,ot=Array(2*Ft),Te,je,pt,kt;for(Te=je=0;Te(pt=Et[Te++]))ot[je++]=pt;else if(4<(kt=Pt[pt]))ot[je++]=65533,Te+=kt-1;else{for(pt&=kt===2?31:kt===3?15:7;1pt?ot[je++]=pt:(pt-=65536,ot[je++]=55296|1023&pt>>10,ot[je++]=56320|1023&pt)}return ot.length!==je&&(ot.subarray?ot=ot.subarray(0,je):ot.length=je),qe.applyFromCharCode(ot)}(Ct=qe.transformTo(et.uint8array?"uint8array":"array",Ct))},qe.inherits(Ge,mt),Ge.prototype.processChunk=function(Ct){var Et=qe.transformTo(et.uint8array?"uint8array":"array",Ct.data);if(this.leftOver&&this.leftOver.length){if(et.uint8array){var Ft=Et;(Et=new Uint8Array(Ft.length+this.leftOver.length)).set(this.leftOver,0),Et.set(Ft,this.leftOver.length)}else Et=this.leftOver.concat(Et);this.leftOver=null}var ot=function(je,pt){var kt;for((pt=pt||je.length)>je.length&&(pt=je.length),kt=pt-1;0<=kt&&(192&je[kt])==128;)kt--;return 0>kt||kt===0?pt:kt+Pt[je[kt]]>pt?kt:pt}(Et),Te=Et;ot!==Et.length&&(et.uint8array?(Te=Et.subarray(0,ot),this.leftOver=Et.subarray(ot,Et.length)):(Te=Et.slice(0,ot),this.leftOver=Et.slice(ot,Et.length))),this.push({data:Oe.utf8decode(Te),meta:Ct.meta})},Ge.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:Oe.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},Oe.Utf8DecodeWorker=Ge,qe.inherits(Be,mt),Be.prototype.processChunk=function(Ct){this.push({data:Oe.utf8encode(Ct.data),meta:Ct.meta})},Oe.Utf8EncodeWorker=Be},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(Ie,Re,Oe){function Ge(ot){return ot}function Be(ot,Te){for(var je=0;je(je=ot.charCodeAt(pt))?"0":"")+je.toString(16).toUpperCase();return Te},Oe.delay=function(ot,Te,je){$t(function(){ot.apply(je||null,Te||[])})},Oe.inherits=function(ot,Te){function je(){}je.prototype=Te.prototype,ot.prototype=new je},Oe.extend=function(){var ot={},Te,je;for(Te=0;Temt)throw this.isSignature(0,qe.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(mt);var Pt=mt;if(this.checkSignature(qe.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===Be.MAX_VALUE_16BITS||this.diskWithCentralDirStart===Be.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===Be.MAX_VALUE_16BITS||this.centralDirRecords===Be.MAX_VALUE_16BITS||this.centralDirSize===Be.MAX_VALUE_32BITS||this.centralDirOffset===Be.MAX_VALUE_32BITS){if(this.zip64=!0,0>(mt=this.reader.lastIndexOfSignature(qe.ZIP64_CENTRAL_DIRECTORY_LOCATOR)))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(mt),this.checkSignature(qe.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,qe.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(qe.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(qe.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var $t=this.centralDirOffset+this.centralDirSize;this.zip64&&($t+=20,$t+=12+this.zip64EndOfCentralSize);var Ct=Pt-$t;if(0Ct)throw new Error("Corrupted zip: missing "+n(Ct)+" bytes.")},prepareReader:function(mt){this.reader=Ge(mt)},load:function(mt){this.prepareReader(mt),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},Re.exports=Oe},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(Ie,Re){function Oe($t,Ct){this.options=$t,this.loadOptions=Ct}var Ge=Ie("./reader/readerFor"),Be=Ie("./utils"),qe=Ie("./compressedObject"),et=Ie("./crc32"),Ze=Ie("./utf8"),mt=Ie("./compressions"),Pt=Ie("./support");Oe.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function($t){var Ct,Et;if($t.skip(22),this.fileNameLength=$t.readInt(2),Et=$t.readInt(2),this.fileName=$t.readData(this.fileNameLength),$t.skip(Et),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((Ct=function(Ft){for(var ot in mt)if(mt.hasOwnProperty(ot)&&mt[ot].magic===Ft)return mt[ot];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+Be.pretty(this.compressionMethod)+" unknown (inner file : "+Be.transformTo("string",this.fileName)+")");this.decompressed=new qe(this.compressedSize,this.uncompressedSize,this.crc32,Ct,$t.readData(this.compressedSize))},readCentralPart:function($t){this.versionMadeBy=$t.readInt(2),$t.skip(2),this.bitFlag=$t.readInt(2),this.compressionMethod=$t.readString(2),this.date=$t.readDate(),this.crc32=$t.readInt(4),this.compressedSize=$t.readInt(4),this.uncompressedSize=$t.readInt(4);var Ct=$t.readInt(2);if(this.extraFieldsLength=$t.readInt(2),this.fileCommentLength=$t.readInt(2),this.diskNumberStart=$t.readInt(2),this.internalFileAttributes=$t.readInt(2),this.externalFileAttributes=$t.readInt(4),this.localHeaderOffset=$t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");$t.skip(Ct),this.readExtraFields($t),this.parseZIP64ExtraField($t),this.fileComment=$t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var $t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),$t==0&&(this.dosPermissions=63&this.externalFileAttributes),$t==3&&(this.unixPermissions=65535&this.externalFileAttributes>>16),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var $t=Ge(this.extraFields[1].value);this.uncompressedSize===Be.MAX_VALUE_32BITS&&(this.uncompressedSize=$t.readInt(8)),this.compressedSize===Be.MAX_VALUE_32BITS&&(this.compressedSize=$t.readInt(8)),this.localHeaderOffset===Be.MAX_VALUE_32BITS&&(this.localHeaderOffset=$t.readInt(8)),this.diskNumberStart===Be.MAX_VALUE_32BITS&&(this.diskNumberStart=$t.readInt(4))}},readExtraFields:function($t){var Ct=$t.index+this.extraFieldsLength,Et,Ft,ot;for(this.extraFields||(this.extraFields={});$t.index+4"u"?typeof window>"u"?{}:window:self:Se)},{}],37:[function(Ie,Re){function Oe(){}function Ge(ot){if(typeof ot!="function")throw new TypeError("resolver must be a function");this.state=Ft,this.queue=[],this.outcome=void 0,ot!==Oe&&Ze(this,ot)}function Be(ot,Te,je){this.promise=ot,typeof Te=="function"&&(this.onFulfilled=Te,this.callFulfilled=this.otherCallFulfilled),typeof je=="function"&&(this.onRejected=je,this.callRejected=this.otherCallRejected)}function qe(ot,Te,je){Pt(function(){var pt;try{pt=Te(je)}catch(kt){return $t.reject(ot,kt)}pt===ot?$t.reject(ot,new TypeError("Cannot resolve promise with itself")):$t.resolve(ot,pt)})}function et(ot){var Te=ot&&ot.then;if(ot&&(typeof ot=="object"||typeof ot=="function")&&typeof Te=="function")return function(){Te.apply(ot,arguments)}}function Ze(ot,Te){function je(ae){kt||(kt=!0,$t.reject(ot,ae))}function pt(ae){kt||(kt=!0,$t.resolve(ot,ae))}var kt=!1,ct=mt(function(){Te(pt,je)});ct.status==="error"&&je(ct.value)}function mt(ot,Te){var je={};try{je.value=ot(Te),je.status="success"}catch(pt){je.status="error",je.value=pt}return je}var Pt=Ie("immediate"),$t={},Ct=["REJECTED"],Et=["FULFILLED"],Ft=["PENDING"];(Re.exports=Ge).prototype.finally=function(ot){if(typeof ot!="function")return this;var Te=this.constructor;return this.then(function(je){return Te.resolve(ot()).then(function(){return je})},function(je){return Te.resolve(ot()).then(function(){throw je})})},Ge.prototype.catch=function(ot){return this.then(null,ot)},Ge.prototype.then=function(ot,Te){if(typeof ot!="function"&&this.state===Et||typeof Te!="function"&&this.state===Ct)return this;var je=new this.constructor(Oe);return this.state===Ft?this.queue.push(new Be(je,ot,Te)):qe(je,this.state===Et?ot:Te,this.outcome),je},Be.prototype.callFulfilled=function(ot){$t.resolve(this.promise,ot)},Be.prototype.otherCallFulfilled=function(ot){qe(this.promise,this.onFulfilled,ot)},Be.prototype.callRejected=function(ot){$t.reject(this.promise,ot)},Be.prototype.otherCallRejected=function(ot){qe(this.promise,this.onRejected,ot)},$t.resolve=function(ot,Te){var je=mt(et,Te);if(je.status==="error")return $t.reject(ot,je.value);var pt=je.value;if(pt)Ze(ot,pt);else{ot.state=Et,ot.outcome=Te;for(var kt=-1,ct=ot.queue.length;++ktEt.windowBits&&(Et.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Pt,this.strm.avail_out=0;var Ft=qe.deflateInit2(this.strm,Et.level,Et.method,Et.windowBits,Et.memLevel,Et.strategy);if(Ft!==0)throw new Error(mt[Ft]);if(Et.header&&qe.deflateSetHeader(this.strm,Et.header),Et.dictionary){var ot;if(ot=typeof Et.dictionary=="string"?Ze.string2buf(Et.dictionary):$t.call(Et.dictionary)==="[object ArrayBuffer]"?new Uint8Array(Et.dictionary):Et.dictionary,(Ft=qe.deflateSetDictionary(this.strm,ot))!==0)throw new Error(mt[Ft]);this._dict_set=!0}}function Be(Ct,Et){var Ft=new Ge(Et);if(Ft.push(Ct,!0),Ft.err)throw Ft.msg||mt[Ft.err];return Ft.result}var qe=Ie("./zlib/deflate"),et=Ie("./utils/common"),Ze=Ie("./utils/strings"),mt=Ie("./zlib/messages"),Pt=Ie("./zlib/zstream"),$t=Object.prototype.toString;Ge.prototype.push=function(Ct,Et){var Ft=this.strm,ot=this.options.chunkSize,Te,je;if(this.ended)return!1;je=Et===~~Et?Et:Et===!0?4:0,Ft.input=typeof Ct=="string"?Ze.string2buf(Ct):$t.call(Ct)==="[object ArrayBuffer]"?new Uint8Array(Ct):Ct,Ft.next_in=0,Ft.avail_in=Ft.input.length;do{if(Ft.avail_out===0&&(Ft.output=new et.Buf8(ot),Ft.next_out=0,Ft.avail_out=ot),(Te=qe.deflate(Ft,je))!==1&&Te!==0)return this.onEnd(Te),!(this.ended=!0);Ft.avail_out!==0&&(Ft.avail_in!==0||je!==4&&je!==2)||(this.options.to==="string"?this.onData(Ze.buf2binstring(et.shrinkBuf(Ft.output,Ft.next_out))):this.onData(et.shrinkBuf(Ft.output,Ft.next_out)))}while((0ot.windowBits&&(ot.windowBits=-ot.windowBits,ot.windowBits===0&&(ot.windowBits=-15)),!(0<=ot.windowBits&&16>ot.windowBits)||Ft&&Ft.windowBits||(ot.windowBits+=32),15ot.windowBits&&!(15&ot.windowBits)&&(ot.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $t,this.strm.avail_out=0;var Te=qe.inflateInit2(this.strm,ot.windowBits);if(Te!==mt.Z_OK)throw new Error(Pt[Te]);this.header=new Ct,qe.inflateGetHeader(this.strm,this.header)}function Be(Ft,ot){var Te=new Ge(ot);if(Te.push(Ft,!0),Te.err)throw Te.msg||Pt[Te.err];return Te.result}var qe=Ie("./zlib/inflate"),et=Ie("./utils/common"),Ze=Ie("./utils/strings"),mt=Ie("./zlib/constants"),Pt=Ie("./zlib/messages"),$t=Ie("./zlib/zstream"),Ct=Ie("./zlib/gzheader"),Et=Object.prototype.toString;Ge.prototype.push=function(Ft,ot){var Te=this.strm,je=this.options.chunkSize,pt=this.options.dictionary,kt=!1,ct,ae,ht,wt,Ne,pe;if(this.ended)return!1;ae=ot===~~ot?ot:ot===!0?mt.Z_FINISH:mt.Z_NO_FLUSH,Te.input=typeof Ft=="string"?Ze.binstring2buf(Ft):Et.call(Ft)==="[object ArrayBuffer]"?new Uint8Array(Ft):Ft,Te.next_in=0,Te.avail_in=Te.input.length;do{if(Te.avail_out===0&&(Te.output=new et.Buf8(je),Te.next_out=0,Te.avail_out=je),(ct=qe.inflate(Te,mt.Z_NO_FLUSH))===mt.Z_NEED_DICT&&pt&&(pe=typeof pt=="string"?Ze.string2buf(pt):Et.call(pt)==="[object ArrayBuffer]"?new Uint8Array(pt):pt,ct=qe.inflateSetDictionary(this.strm,pe)),ct===mt.Z_BUF_ERROR&&kt===!0&&(ct=mt.Z_OK,kt=!1),ct!==mt.Z_STREAM_END&&ct!==mt.Z_OK)return this.onEnd(ct),!(this.ended=!0);Te.next_out&&(Te.avail_out!==0&&ct!==mt.Z_STREAM_END&&(Te.avail_in!==0||ae!==mt.Z_FINISH&&ae!==mt.Z_SYNC_FLUSH)||(this.options.to==="string"?(ht=Ze.utf8border(Te.output,Te.next_out),wt=Te.next_out-ht,Ne=Ze.buf2string(Te.output,ht),Te.next_out=wt,Te.avail_out=je-wt,wt&&et.arraySet(Te.output,Te.output,ht,wt,0),this.onData(Ne)):this.onData(et.shrinkBuf(Te.output,Te.next_out)))),Te.avail_in===0&&Te.avail_out===0&&(kt=!0)}while((0$t&&(Pt.subarray&&et||!Pt.subarray&&qe))return o.apply(null,Be.shrinkBuf(Pt,$t));for(var Ct="",Et=0;Et<$t;Et++)Ct+=o(Pt[Et]);return Ct}var Be=Ie("./common"),qe=!0,et=!0;try{o.apply(null,[0])}catch{qe=!1}try{o.apply(null,new Uint8Array(1))}catch{et=!1}for(var Ze=new Be.Buf8(256),mt=0;256>mt;mt++)Ze[mt]=252<=mt?6:248<=mt?5:240<=mt?4:224<=mt?3:192<=mt?2:1;Ze[254]=Ze[254]=1,Oe.string2buf=function(Pt){var $t=Pt.length,Ct=0,Et,Ft,ot,Te,je;for(Te=0;Te<$t;Te++)(64512&(Ft=Pt.charCodeAt(Te)))==55296&&Te+1<$t&&(64512&(ot=Pt.charCodeAt(Te+1)))==56320&&(Ft=65536+(Ft-55296<<10)+(ot-56320),Te++),Ct+=128>Ft?1:2048>Ft?2:65536>Ft?3:4;for(Et=new Be.Buf8(Ct),Te=je=0;jeFt?Et[je++]=Ft:(2048>Ft?Et[je++]=192|Ft>>>6:(65536>Ft?Et[je++]=224|Ft>>>12:(Et[je++]=240|Ft>>>18,Et[je++]=128|63&Ft>>>12),Et[je++]=128|63&Ft>>>6),Et[je++]=128|63&Ft);return Et},Oe.buf2binstring=function(Pt){return Ge(Pt,Pt.length)},Oe.binstring2buf=function(Pt){for(var $t=new Be.Buf8(Pt.length),Ct=0,Et=$t.length;Ct(Te=Pt[Ft++]))Et[ot++]=Te;else if(4<(je=Ze[Te]))Et[ot++]=65533,Ft+=je-1;else{for(Te&=je===2?31:je===3?15:7;1Te?Et[ot++]=Te:(Te-=65536,Et[ot++]=55296|1023&Te>>10,Et[ot++]=56320|1023&Te)}return Ge(Et,ot)},Oe.utf8border=function(Pt,$t){var Ct;for(($t=$t||Pt.length)>Pt.length&&($t=Pt.length),Ct=$t-1;0<=Ct&&(192&Pt[Ct])==128;)Ct--;return 0>Ct||Ct===0?$t:Ct+Ze[Pt[Ct]]>$t?Ct:$t}},{"./common":41}],43:[function(Ie,Re){Re.exports=function(Oe,Ge,Be,qe){for(var et=0|65535&Oe,Ze=0|65535&Oe>>>16,mt=0;Be!==0;){for(Be-=mt=2e3Be;Be++){qe=Be;for(var et=0;8>et;et++)qe=1&qe?3988292384^qe>>>1:qe>>>1;Ge[Be]=qe}return Ge}();Re.exports=function(Ge,Be,qe,et){Ge^=-1;for(var Ze=et;Ze>>8^Oe[255&(Ge^Be[Ze])];return-1^Ge}},{}],46:[function(Ie,Re,Oe){function Ge(Ae,tt){return Ae.msg=Ne[tt],tt}function Be(Ae){return(Ae<<1)-(4Ae.avail_out&&(gt=Ae.avail_out),gt!==0&&(ct.arraySet(Ae.output,tt.pending_buf,tt.pending_out,gt,Ae.next_out),Ae.next_out+=gt,tt.pending_out+=gt,Ae.total_out+=gt,Ae.avail_out-=gt,tt.pending-=gt,tt.pending===0&&(tt.pending_out=0))}function Ze(Ae,tt){ae._tr_flush_block(Ae,0<=Ae.block_start?Ae.block_start:-1,Ae.strstart-Ae.block_start,tt),Ae.block_start=Ae.strstart,et(Ae.strm)}function mt(Ae,tt){Ae.pending_buf[Ae.pending++]=tt}function Pt(Ae,tt){Ae.pending_buf[Ae.pending++]=255&tt>>>8,Ae.pending_buf[Ae.pending++]=255&tt}function $t(Ae,tt){var gt=Ae.max_chain_length,ze=Ae.strstart,Ot=Ae.prev_length,jt=Ae.nice_match,nt=Ae.strstart>Ae.w_size-262?Ae.strstart-(Ae.w_size-262):0,$e=Ae.window,Xt=Ae.w_mask,A=Ae.prev,ye=Ae.strstart+258,H=$e[ze+Ot-1],T=$e[ze+Ot],b,m;Ae.prev_length>=Ae.good_match&&(gt>>=2),jt>Ae.lookahead&&(jt=Ae.lookahead);do if($e[(b=tt)+Ot]===T&&$e[b+Ot-1]===H&&$e[b]===$e[ze]&&$e[++b]===$e[ze+1]){ze+=2,b++;do;while($e[++ze]===$e[++b]&&$e[++ze]===$e[++b]&&$e[++ze]===$e[++b]&&$e[++ze]===$e[++b]&&$e[++ze]===$e[++b]&&$e[++ze]===$e[++b]&&$e[++ze]===$e[++b]&&$e[++ze]===$e[++b]&&zent&&--gt!=0);return Ot<=Ae.lookahead?Ot:Ae.lookahead}function Ct(Ae){var tt=Ae.w_size,gt,ze,Ot,jt,nt,$e,Xt,A,ye,H;do{if(jt=Ae.window_size-Ae.lookahead-Ae.strstart,Ae.strstart>=tt+(tt-262)){for(ct.arraySet(Ae.window,Ae.window,tt,tt,0),Ae.match_start-=tt,Ae.strstart-=tt,Ae.block_start-=tt,gt=ze=Ae.hash_size;Ot=Ae.head[--gt],Ae.head[gt]=tt<=Ot?Ot-tt:0,--ze;);for(gt=ze=tt;Ot=Ae.prev[--gt],Ae.prev[gt]=tt<=Ot?Ot-tt:0,--ze;);jt+=tt}if(Ae.strm.avail_in===0)break;if($e=Ae.strm,Xt=Ae.window,A=Ae.strstart+Ae.lookahead,H=void 0,(ye=jt)<(H=$e.avail_in)&&(H=ye),ze=H===0?0:($e.avail_in-=H,ct.arraySet(Xt,$e.input,$e.next_in,H,A),$e.state.wrap===1?$e.adler=ht($e.adler,Xt,H,A):$e.state.wrap===2&&($e.adler=wt($e.adler,Xt,H,A)),$e.next_in+=H,$e.total_in+=H,H),Ae.lookahead+=ze,3<=Ae.lookahead+Ae.insert)for(nt=Ae.strstart-Ae.insert,Ae.ins_h=Ae.window[nt],Ae.ins_h=(Ae.ins_h<Ae.lookahead+Ae.insert)););}while(Ae.lookahead<262&&Ae.strm.avail_in!==0)}function Et(Ae,tt){for(var gt,ze;;){if(Ae.lookahead<262){if(Ct(Ae),Ae.lookahead<262&&tt===0)return 1;if(Ae.lookahead===0)break}if(gt=0,3<=Ae.lookahead&&(Ae.ins_h=(Ae.ins_h<=Ae.match_length&&(Ae.strategy===1||Ae.match_length===3&&4096tt.wrap&&(tt.wrap=-tt.wrap),tt.status=tt.wrap?42:113,Ae.adler=tt.wrap===2?0:1,tt.last_flush=0,ae._tr_init(tt),0):Ge(Ae,-2)}function pt(Ae){var tt=je(Ae),gt;return tt===0&&((gt=Ae.state).window_size=2*gt.w_size,qe(gt.head),gt.max_lazy_match=pe[gt.level].max_lazy,gt.good_match=pe[gt.level].good_length,gt.nice_match=pe[gt.level].nice_length,gt.max_chain_length=pe[gt.level].max_chain,gt.strstart=0,gt.block_start=0,gt.lookahead=0,gt.insert=0,gt.match_length=gt.prev_length=2,gt.match_available=0,gt.ins_h=0),tt}function kt(Ae,tt,gt,ze,Ot,jt){if(!Ae)return-2;var nt=1;if(tt===-1&&(tt=6),0>ze?(nt=0,ze=-ze):15Ot||9ze||15tt||9jt||4Ae.pending_buf_size-5&&(gt=Ae.pending_buf_size-5);;){if(1>=Ae.lookahead){if(Ct(Ae),Ae.lookahead===0&&tt===0)return 1;if(Ae.lookahead===0)break}Ae.strstart+=Ae.lookahead,Ae.lookahead=0;var ze=Ae.block_start+gt;if((Ae.strstart===0||Ae.strstart>=ze)&&(Ae.lookahead=Ae.strstart-ze,Ae.strstart=ze,Ze(Ae,!1),Ae.strm.avail_out===0)||Ae.strstart-Ae.block_start>=Ae.w_size-262&&(Ze(Ae,!1),Ae.strm.avail_out===0))return 1}return Ae.insert=0,tt===4?(Ze(Ae,!0),Ae.strm.avail_out===0?3:4):(Ae.strstart>Ae.block_start&&(Ze(Ae,!1),Ae.strm.avail_out),1)}),new ot(4,4,8,4,Et),new ot(4,5,16,8,Et),new ot(4,6,32,32,Et),new ot(4,4,16,16,Ft),new ot(8,16,32,32,Ft),new ot(8,16,128,128,Ft),new ot(8,32,128,256,Ft),new ot(32,128,258,1024,Ft),new ot(32,258,258,4096,Ft)],Oe.deflateInit=function(Ae,tt){return kt(Ae,tt,8,15,8,0)},Oe.deflateInit2=kt,Oe.deflateReset=pt,Oe.deflateResetKeep=je,Oe.deflateSetHeader=function(Ae,tt){return Ae&&Ae.state&&Ae.state.wrap===2?(Ae.state.gzhead=tt,0):-2},Oe.deflate=function(Ae,tt){var gt,ze,Ot,jt;if(!Ae||!Ae.state||5tt)return Ae?Ge(Ae,-2):-2;if(ze=Ae.state,!Ae.output||!Ae.input&&Ae.avail_in!==0||ze.status===666&&tt!==4)return Ge(Ae,Ae.avail_out===0?-5:-2);if(ze.strm=Ae,gt=ze.last_flush,ze.last_flush=tt,ze.status===42)if(ze.wrap===2)Ae.adler=0,mt(ze,31),mt(ze,139),mt(ze,8),ze.gzhead?(mt(ze,(ze.gzhead.text?1:0)+(ze.gzhead.hcrc?2:0)+(ze.gzhead.extra?4:0)+(ze.gzhead.name?8:0)+(ze.gzhead.comment?16:0)),mt(ze,255&ze.gzhead.time),mt(ze,255&ze.gzhead.time>>8),mt(ze,255&ze.gzhead.time>>16),mt(ze,255&ze.gzhead.time>>24),mt(ze,ze.level===9?2:2<=ze.strategy||2>ze.level?4:0),mt(ze,255&ze.gzhead.os),ze.gzhead.extra&&ze.gzhead.extra.length&&(mt(ze,255&ze.gzhead.extra.length),mt(ze,255&ze.gzhead.extra.length>>8)),ze.gzhead.hcrc&&(Ae.adler=wt(Ae.adler,ze.pending_buf,ze.pending,0)),ze.gzindex=0,ze.status=69):(mt(ze,0),mt(ze,0),mt(ze,0),mt(ze,0),mt(ze,0),mt(ze,ze.level===9?2:2<=ze.strategy||2>ze.level?4:0),mt(ze,3),ze.status=113);else{var nt=8+(ze.w_bits-8<<4)<<8;nt|=(2<=ze.strategy||2>ze.level?0:6>ze.level?1:ze.level===6?2:3)<<6,ze.strstart!==0&&(nt|=32),nt+=31-nt%31,ze.status=113,Pt(ze,nt),ze.strstart!==0&&(Pt(ze,Ae.adler>>>16),Pt(ze,65535&Ae.adler)),Ae.adler=1}if(ze.status===69)if(ze.gzhead.extra){for(Ot=ze.pending;ze.gzindex<(65535&ze.gzhead.extra.length)&&(ze.pending!==ze.pending_buf_size||(ze.gzhead.hcrc&&ze.pending>Ot&&(Ae.adler=wt(Ae.adler,ze.pending_buf,ze.pending-Ot,Ot)),et(Ae),Ot=ze.pending,ze.pending!==ze.pending_buf_size));)mt(ze,255&ze.gzhead.extra[ze.gzindex]),ze.gzindex++;ze.gzhead.hcrc&&ze.pending>Ot&&(Ae.adler=wt(Ae.adler,ze.pending_buf,ze.pending-Ot,Ot)),ze.gzindex===ze.gzhead.extra.length&&(ze.gzindex=0,ze.status=73)}else ze.status=73;if(ze.status===73)if(ze.gzhead.name){Ot=ze.pending;do{if(ze.pending===ze.pending_buf_size&&(ze.gzhead.hcrc&&ze.pending>Ot&&(Ae.adler=wt(Ae.adler,ze.pending_buf,ze.pending-Ot,Ot)),et(Ae),Ot=ze.pending,ze.pending===ze.pending_buf_size)){jt=1;break}jt=ze.gzindexOt&&(Ae.adler=wt(Ae.adler,ze.pending_buf,ze.pending-Ot,Ot)),jt===0&&(ze.gzindex=0,ze.status=91)}else ze.status=91;if(ze.status===91)if(ze.gzhead.comment){Ot=ze.pending;do{if(ze.pending===ze.pending_buf_size&&(ze.gzhead.hcrc&&ze.pending>Ot&&(Ae.adler=wt(Ae.adler,ze.pending_buf,ze.pending-Ot,Ot)),et(Ae),Ot=ze.pending,ze.pending===ze.pending_buf_size)){jt=1;break}jt=ze.gzindexOt&&(Ae.adler=wt(Ae.adler,ze.pending_buf,ze.pending-Ot,Ot)),jt===0&&(ze.status=103)}else ze.status=103;if(ze.status===103&&(ze.gzhead.hcrc?(ze.pending+2>ze.pending_buf_size&&et(Ae),ze.pending+2<=ze.pending_buf_size&&(mt(ze,255&Ae.adler),mt(ze,255&Ae.adler>>8),Ae.adler=0,ze.status=113)):ze.status=113),ze.pending!==0){if(et(Ae),Ae.avail_out===0)return ze.last_flush=-1,0}else if(Ae.avail_in===0&&Be(tt)<=Be(gt)&&tt!==4)return Ge(Ae,-5);if(ze.status===666&&Ae.avail_in!==0)return Ge(Ae,-5);if(Ae.avail_in!==0||ze.lookahead!==0||tt!==0&&ze.status!==666){var $e=ze.strategy===2?function(Xt,A){for(var ye;;){if(Xt.lookahead===0&&(Ct(Xt),Xt.lookahead===0)){if(A===0)return 1;break}if(Xt.match_length=0,ye=ae._tr_tally(Xt,0,Xt.window[Xt.strstart]),Xt.lookahead--,Xt.strstart++,ye&&(Ze(Xt,!1),Xt.strm.avail_out===0))return 1}return Xt.insert=0,A===4?(Ze(Xt,!0),Xt.strm.avail_out===0?3:4):Xt.last_lit&&(Ze(Xt,!1),Xt.strm.avail_out===0)?1:2}(ze,tt):ze.strategy===3?function(Xt,A){for(var ye=Xt.window,H,T,b,m;;){if(258>=Xt.lookahead){if(Ct(Xt),258>=Xt.lookahead&&A===0)return 1;if(Xt.lookahead===0)break}if(Xt.match_length=0,3<=Xt.lookahead&&0Xt.lookahead&&(Xt.match_length=Xt.lookahead)}if(3<=Xt.match_length?(H=ae._tr_tally(Xt,1,Xt.match_length-3),Xt.lookahead-=Xt.match_length,Xt.strstart+=Xt.match_length,Xt.match_length=0):(H=ae._tr_tally(Xt,0,Xt.window[Xt.strstart]),Xt.lookahead--,Xt.strstart++),H&&(Ze(Xt,!1),Xt.strm.avail_out===0))return 1}return Xt.insert=0,A===4?(Ze(Xt,!0),Xt.strm.avail_out===0?3:4):Xt.last_lit&&(Ze(Xt,!1),Xt.strm.avail_out===0)?1:2}(ze,tt):pe[ze.level].func(ze,tt);if($e!==3&&$e!==4||(ze.status=666),$e===1||$e===3)return Ae.avail_out===0&&(ze.last_flush=-1),0;if($e===2&&(tt===1?ae._tr_align(ze):tt!=5&&(ae._tr_stored_block(ze,0,0,!1),tt==3&&(qe(ze.head),ze.lookahead===0&&(ze.strstart=0,ze.block_start=0,ze.insert=0))),et(Ae),Ae.avail_out===0))return ze.last_flush=-1,0}return tt===4?0>=ze.wrap?1:(ze.wrap===2?(mt(ze,255&Ae.adler),mt(ze,255&Ae.adler>>8),mt(ze,255&Ae.adler>>16),mt(ze,255&Ae.adler>>24),mt(ze,255&Ae.total_in),mt(ze,255&Ae.total_in>>8),mt(ze,255&Ae.total_in>>16),mt(ze,255&Ae.total_in>>24)):(Pt(ze,Ae.adler>>>16),Pt(ze,65535&Ae.adler)),et(Ae),0=ze.w_size&&(nt===0&&(qe(ze.head),ze.strstart=0,ze.block_start=0,ze.insert=0),ye=new ct.Buf8(ze.w_size),ct.arraySet(ye,tt,gt-ze.w_size,ze.w_size,0),tt=ye,gt=ze.w_size),$e=Ae.avail_in,Xt=Ae.next_in,A=Ae.input,Ae.avail_in=gt,Ae.next_in=0,Ae.input=tt,Ct(ze);ze.lookahead>=3;){for(Ot=ze.strstart,jt=ze.lookahead-2;ze.ins_h=(ze.ins_h<je&&(Te+=gt[qe++]<>>=wt=ht>>>24,je-=wt,(wt=255&ht>>>16)==0)ze[Ze++]=65535&ht;else{if(!(16&wt)){if(!(64&wt)){ht=pt[(65535&ht)+(Te&(1<>>=wt,je-=wt),15>je&&(Te+=gt[qe++]<>>=wt=ht>>>24,je-=wt,!(16&(wt=255&ht>>>16))){if(!(64&wt)){ht=kt[(65535&ht)+(Te&(1<>>=wt,je-=wt,(wt=Ze-mt)>3,Te&=(1<<(je-=Ne<<3))-1,Oe.next_in=qe,Oe.next_out=Ze,Oe.avail_in=qe>>24)+(65280&ct>>>8)+((65280&ct)<<8)+((255&ct)<<24)}function Be(){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 Ct.Buf16(320),this.work=new Ct.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function qe(ct){var ae;return ct&&ct.state?(ae=ct.state,ct.total_in=ct.total_out=ae.total=0,ct.msg="",ae.wrap&&(ct.adler=1&ae.wrap),ae.mode=1,ae.last=0,ae.havedict=0,ae.dmax=32768,ae.head=null,ae.hold=0,ae.bits=0,ae.lencode=ae.lendyn=new Ct.Buf32(852),ae.distcode=ae.distdyn=new Ct.Buf32(592),ae.sane=1,ae.back=-1,0):-2}function et(ct){var ae;return ct&&ct.state?((ae=ct.state).wsize=0,ae.whave=0,ae.wnext=0,qe(ct)):-2}function Ze(ct,ae){var ht,wt;return ct&&ct.state?(wt=ct.state,0>ae?(ht=0,ae=-ae):(ht=1+(ae>>4),48>ae&&(ae&=15)),ae&&(8>ae||15ae;)ct.lens[ae++]=8;for(;256>ae;)ct.lens[ae++]=9;for(;280>ae;)ct.lens[ae++]=7;for(;288>ae;)ct.lens[ae++]=8;for(Te(1,ct.lens,0,288,pt,0,ct.work,{bits:9}),ae=0;32>ae;)ct.lens[ae++]=5;Te(2,ct.lens,0,32,kt,0,ct.work,{bits:5}),je=!1}ct.lencode=pt,ct.lenbits=9,ct.distcode=kt,ct.distbits=5}function $t(ct,ae,ht,wt){var Ne=ct.state,pe;return Ne.window===null&&(Ne.wsize=1<=Ne.wsize?(Ct.arraySet(Ne.window,ae,ht-Ne.wsize,Ne.wsize,0),Ne.wnext=0,Ne.whave=Ne.wsize):(wt<(pe=Ne.wsize-Ne.wnext)&&(pe=wt),Ct.arraySet(Ne.window,ae,ht-wt,pe,Ne.wnext),(wt-=pe)?(Ct.arraySet(Ne.window,ae,ht-wt,wt,0),Ne.wnext=wt,Ne.whave=Ne.wsize):(Ne.wnext+=pe,Ne.wnext===Ne.wsize&&(Ne.wnext=0),Ne.whave$e;){if(Ot===0)break e;Ot--,nt+=Ae[gt++]<<$e,$e+=8}if(2&pe.wrap&&nt===35615){wt[pe.check=0]=255&nt,wt[1]=255&nt>>>8,pe.check=Ft(pe.check,wt,2,0),$e=nt=0,pe.mode=2;break}if(pe.flags=0,pe.head&&(pe.head.done=!1),!(1&pe.wrap)||(((255&nt)<<8)+(nt>>8))%31){ct.msg="incorrect header check",pe.mode=30;break}if((15&nt)!=8){ct.msg="unknown compression method",pe.mode=30;break}if($e-=4,B=8+(15&(nt>>>=4)),pe.wbits===0)pe.wbits=B;else if(B>pe.wbits){ct.msg="invalid window size",pe.mode=30;break}pe.dmax=1<$e;){if(Ot===0)break e;Ot--,nt+=Ae[gt++]<<$e,$e+=8}if(pe.flags=nt,(255&pe.flags)!=8){ct.msg="unknown compression method",pe.mode=30;break}if(57344&pe.flags){ct.msg="unknown header flags set",pe.mode=30;break}pe.head&&(pe.head.text=1&nt>>8),512&pe.flags&&(wt[0]=255&nt,wt[1]=255&nt>>>8,pe.check=Ft(pe.check,wt,2,0)),$e=nt=0,pe.mode=3;case 3:for(;32>$e;){if(Ot===0)break e;Ot--,nt+=Ae[gt++]<<$e,$e+=8}pe.head&&(pe.head.time=nt),512&pe.flags&&(wt[0]=255&nt,wt[1]=255&nt>>>8,wt[2]=255&nt>>>16,wt[3]=255&nt>>>24,pe.check=Ft(pe.check,wt,4,0)),$e=nt=0,pe.mode=4;case 4:for(;16>$e;){if(Ot===0)break e;Ot--,nt+=Ae[gt++]<<$e,$e+=8}pe.head&&(pe.head.xflags=255&nt,pe.head.os=nt>>8),512&pe.flags&&(wt[0]=255&nt,wt[1]=255&nt>>>8,pe.check=Ft(pe.check,wt,2,0)),$e=nt=0,pe.mode=5;case 5:if(1024&pe.flags){for(;16>$e;){if(Ot===0)break e;Ot--,nt+=Ae[gt++]<<$e,$e+=8}pe.length=nt,pe.head&&(pe.head.extra_len=nt),512&pe.flags&&(wt[0]=255&nt,wt[1]=255&nt>>>8,pe.check=Ft(pe.check,wt,2,0)),$e=nt=0}else pe.head&&(pe.head.extra=null);pe.mode=6;case 6:if(1024&pe.flags&&(Ot<(ye=pe.length)&&(ye=Ot),ye&&(pe.head&&(B=pe.head.extra_len-pe.length,pe.head.extra||(pe.head.extra=Array(pe.head.extra_len)),Ct.arraySet(pe.head.extra,Ae,gt,ye,B)),512&pe.flags&&(pe.check=Ft(pe.check,Ae,ye,gt)),Ot-=ye,gt+=ye,pe.length-=ye),pe.length))break e;pe.length=0,pe.mode=7;case 7:if(2048&pe.flags){if(Ot===0)break e;for(ye=0;B=Ae[gt+ye++],pe.head&&B&&65536>pe.length&&(pe.head.name+=o(B)),B&&yepe.length&&(pe.head.comment+=o(B)),B&&ye$e;){if(Ot===0)break e;Ot--,nt+=Ae[gt++]<<$e,$e+=8}if(nt!==(65535&pe.check)){ct.msg="header crc mismatch",pe.mode=30;break}$e=nt=0}pe.head&&(pe.head.hcrc=1&pe.flags>>9,pe.head.done=!0),ct.adler=pe.check=0,pe.mode=12;break;case 10:for(;32>$e;){if(Ot===0)break e;Ot--,nt+=Ae[gt++]<<$e,$e+=8}ct.adler=pe.check=Ge(nt),$e=nt=0,pe.mode=11;case 11:if(pe.havedict===0)return ct.next_out=ze,ct.avail_out=jt,ct.next_in=gt,ct.avail_in=Ot,pe.hold=nt,pe.bits=$e,2;ct.adler=pe.check=1,pe.mode=12;case 12:if(ae===5||ae===6)break e;case 13:if(pe.last){nt>>>=7&$e,$e-=7&$e,pe.mode=27;break}for(;3>$e;){if(Ot===0)break e;Ot--,nt+=Ae[gt++]<<$e,$e+=8}switch(pe.last=1&nt,$e-=1,3&(nt>>>=1)){case 0:pe.mode=14;break;case 1:if(Pt(pe),pe.mode=20,ae!==6)break;nt>>>=2,$e-=2;break e;case 2:pe.mode=17;break;case 3:ct.msg="invalid block type",pe.mode=30}nt>>>=2,$e-=2;break;case 14:for(nt>>>=7&$e,$e-=7&$e;32>$e;){if(Ot===0)break e;Ot--,nt+=Ae[gt++]<<$e,$e+=8}if((65535&nt)!=(65535^nt>>>16)){ct.msg="invalid stored block lengths",pe.mode=30;break}if(pe.length=65535&nt,$e=nt=0,pe.mode=15,ae===6)break e;case 15:pe.mode=16;case 16:if(ye=pe.length){if(Ot$e;){if(Ot===0)break e;Ot--,nt+=Ae[gt++]<<$e,$e+=8}if(pe.nlen=257+(31&nt),nt>>>=5,$e-=5,pe.ndist=1+(31&nt),nt>>>=5,$e-=5,pe.ncode=4+(15&nt),nt>>>=4,$e-=4,286$e;){if(Ot===0)break e;Ot--,nt+=Ae[gt++]<<$e,$e+=8}pe.lens[Ne[pe.have++]]=7&nt,nt>>>=3,$e-=3}for(;19>pe.have;)pe.lens[Ne[pe.have++]]=0;if(pe.lencode=pe.lendyn,pe.lenbits=7,Q={bits:pe.lenbits},q=Te(0,pe.lens,0,19,pe.lencode,0,pe.work,Q),pe.lenbits=Q.bits,q){ct.msg="invalid code lengths set",pe.mode=30;break}pe.have=0,pe.mode=19;case 19:for(;pe.have>>16,_=65535&ht,!((b=ht>>>24)<=$e);){if(Ot===0)break e;Ot--,nt+=Ae[gt++]<<$e,$e+=8}if(16>_)nt>>>=b,$e-=b,pe.lens[pe.have++]=_;else{if(_===16){for(oe=b+2;$e>>=b,$e-=b,pe.have===0){ct.msg="invalid bit length repeat",pe.mode=30;break}B=pe.lens[pe.have-1],ye=3+(3&nt),nt>>>=2,$e-=2}else if(_===17){for(oe=b+3;$e>>=b)),nt>>>=3,$e-=3}else{for(oe=b+7;$e>>=b)),nt>>>=7,$e-=7}if(pe.have+ye>pe.nlen+pe.ndist){ct.msg="invalid bit length repeat",pe.mode=30;break}for(;ye--;)pe.lens[pe.have++]=B}}if(pe.mode===30)break;if(pe.lens[256]===0){ct.msg="invalid code -- missing end-of-block",pe.mode=30;break}if(pe.lenbits=9,Q={bits:pe.lenbits},q=Te(1,pe.lens,0,pe.nlen,pe.lencode,0,pe.work,Q),pe.lenbits=Q.bits,q){ct.msg="invalid literal/lengths set",pe.mode=30;break}if(pe.distbits=6,pe.distcode=pe.distdyn,Q={bits:pe.distbits},q=Te(2,pe.lens,pe.nlen,pe.ndist,pe.distcode,0,pe.work,Q),pe.distbits=Q.bits,q){ct.msg="invalid distances set",pe.mode=30;break}if(pe.mode=20,ae===6)break e;case 20:pe.mode=21;case 21:if(6<=Ot&&258<=jt){ct.next_out=ze,ct.avail_out=jt,ct.next_in=gt,ct.avail_in=Ot,pe.hold=nt,pe.bits=$e,ot(ct,A),ze=ct.next_out,tt=ct.output,jt=ct.avail_out,gt=ct.next_in,Ae=ct.input,Ot=ct.avail_in,nt=pe.hold,$e=pe.bits,pe.mode===12&&(pe.back=-1);break}for(pe.back=0;m=255&(ht=pe.lencode[nt&(1<>>16,_=65535&ht,!((b=ht>>>24)<=$e);){if(Ot===0)break e;Ot--,nt+=Ae[gt++]<<$e,$e+=8}if(m&&!(240&m)){for(C=b,D=m,L=_;m=255&(ht=pe.lencode[L+((nt&(1<>C)])>>>16,_=65535&ht,!(C+(b=ht>>>24)<=$e);){if(Ot===0)break e;Ot--,nt+=Ae[gt++]<<$e,$e+=8}nt>>>=C,$e-=C,pe.back+=C}if(nt>>>=b,$e-=b,pe.back+=b,pe.length=_,m===0){pe.mode=26;break}if(32&m){pe.back=-1,pe.mode=12;break}if(64&m){ct.msg="invalid literal/length code",pe.mode=30;break}pe.extra=15&m,pe.mode=22;case 22:if(pe.extra){for(oe=pe.extra;$e>>=pe.extra,$e-=pe.extra,pe.back+=pe.extra}pe.was=pe.length,pe.mode=23;case 23:for(;m=255&(ht=pe.distcode[nt&(1<>>16,_=65535&ht,!((b=ht>>>24)<=$e);){if(Ot===0)break e;Ot--,nt+=Ae[gt++]<<$e,$e+=8}if(!(240&m)){for(C=b,D=m,L=_;m=255&(ht=pe.distcode[L+((nt&(1<>C)])>>>16,_=65535&ht,!(C+(b=ht>>>24)<=$e);){if(Ot===0)break e;Ot--,nt+=Ae[gt++]<<$e,$e+=8}nt>>>=C,$e-=C,pe.back+=C}if(nt>>>=b,$e-=b,pe.back+=b,64&m){ct.msg="invalid distance code",pe.mode=30;break}pe.offset=_,pe.extra=15&m,pe.mode=24;case 24:if(pe.extra){for(oe=pe.extra;$e>>=pe.extra,$e-=pe.extra,pe.back+=pe.extra}if(pe.offset>pe.dmax){ct.msg="invalid distance too far back",pe.mode=30;break}pe.mode=25;case 25:if(jt===0)break e;if(ye=A-jt,pe.offset>ye){if((ye=pe.offset-ye)>pe.whave&&pe.sane){ct.msg="invalid distance too far back",pe.mode=30;break}H=ye>pe.wnext?(ye-=pe.wnext,pe.wsize-ye):pe.wnext-ye,ye>pe.length&&(ye=pe.length),T=pe.window}else T=tt,H=ze-pe.offset,ye=pe.length;for(jt$e;){if(Ot===0)break e;Ot--,nt|=Ae[gt++]<<$e,$e+=8}if(A-=jt,ct.total_out+=A,pe.total+=A,A&&(ct.adler=pe.check=pe.flags?Ft(pe.check,tt,A,ze-A):Et(pe.check,tt,A,ze-A)),A=jt,(pe.flags?nt:Ge(nt))!==pe.check){ct.msg="incorrect data check",pe.mode=30;break}$e=nt=0}pe.mode=28;case 28:if(pe.wrap&&pe.flags){for(;32>$e;){if(Ot===0)break e;Ot--,nt+=Ae[gt++]<<$e,$e+=8}if(nt!==(4294967295&pe.total)){ct.msg="incorrect length check",pe.mode=30;break}$e=nt=0}pe.mode=29;case 29:q=1;break e;case 30:q=-3;break e;case 31:return-4;case 32:default:return-2}return ct.next_out=ze,ct.avail_out=jt,ct.next_in=gt,ct.avail_in=Ot,pe.hold=nt,pe.bits=$e,(pe.wsize||A!==ct.avail_out&&30>pe.mode&&(27>pe.mode||ae!==4))&&$t(ct,ct.output,ct.next_out,A-ct.avail_out)?(pe.mode=31,-4):(Xt-=ct.avail_in,A-=ct.avail_out,ct.total_in+=Xt,ct.total_out+=A,pe.total+=A,pe.wrap&&A&&(ct.adler=pe.check=pe.flags?Ft(pe.check,tt,A,ct.next_out-A):Et(pe.check,tt,A,ct.next_out-A)),ct.data_type=pe.bits+(pe.last?64:0)+(pe.mode===12?128:0)+(pe.mode===20||pe.mode===15?256:0),(Xt==0&&A===0||ae===4)&&q===0&&(q=-5),q)},Oe.inflateEnd=function(ct){if(!ct||!ct.state)return-2;var ae=ct.state;return ae.window&&(ae.window=null),ct.state=null,0},Oe.inflateGetHeader=function(ct,ae){var ht;return ct&&ct.state&&2&(ht=ct.state).wrap?((ht.head=ae).done=!1,0):-2},Oe.inflateSetDictionary=function(ct,ae){var ht=ae.length,wt;return ct&&ct.state?(wt=ct.state).wrap!==0&&wt.mode!==11?-2:wt.mode===11&&Et(1,ae,ht,0)!==wt.check?-3:$t(ct,ae,ht,ht)?(wt.mode=31,-4):(wt.havedict=1,0):-2},Oe.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(Ie,Re){var Oe=Ie("../utils/common"),Ge=[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],Be=[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],qe=[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],et=[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];Re.exports=function(Ze,mt,Pt,$t,Ct,Et,Ft,ot){var Te=ot.bits,je=0,pt=0,kt=0,ct=0,ae=0,ht=0,wt=0,Ne=0,pe=0,Ae=0,tt=null,gt=0,ze=new Oe.Buf16(16),Ot=new Oe.Buf16(16),jt=null,nt=0,$e,Xt,A,ye,H,T,b,m,_;for(je=0;15>=je;je++)ze[je]=0;for(pt=0;pt<$t;pt++)ze[mt[Pt+pt]]++;for(ae=Te,ct=15;1<=ct&&ze[ct]===0;ct--);if(ct=je;je++)if(Ne<<=1,0>(Ne-=ze[je]))return-1;if(0je;je++)Ot[je+1]=Ot[je]+ze[je];for(pt=0;pt<$t;pt++)mt[Pt+pt]!==0&&(Ft[Ot[mt[Pt+pt]]++]=pt);if(T=Ze===0?(tt=jt=Ft,19):Ze===1?(tt=Ge,gt-=257,jt=Be,nt-=257,256):(tt=qe,jt=et,-1),je=kt,H=Et,wt=pt=Ae=0,A=-1,ye=(pe=1<<(ht=ae))-1,Ze===1&&852T?(m=jt[nt+Ft[pt]],tt[gt+Ft[pt]]):(m=96,0),$e=1<>wt)+(Xt-=$e)]=0|(b<<24|m<<16|_),Xt!==0;);for($e=1<>=1;if($e===0?Ae=0:(Ae&=$e-1,Ae+=$e),pt++,--ze[je]==0){if(je===ct)break;je=mt[Pt+Ft[pt]]}if(ae=(Ne-=ze[ht+wt]));)ht++,Ne<<=1;if(pe+=1<T?Ot[T]:Ot[256+(T>>>7)]}function Ze(T,b){T.pending_buf[T.pending++]=255&b,T.pending_buf[T.pending++]=255&b>>>8}function mt(T,b,m){T.bi_valid>16-m?(T.bi_buf|=65535&b<>16-T.bi_valid,T.bi_valid+=m-16):(T.bi_buf|=65535&b<>>=1,m<<=1,0<--b;);return m>>>1}function Ct(T,b,m){var _=Array(16),C=0,D,L;for(D=1;D<=15;D++)_[D]=C=C+m[D-1]<<1;for(L=0;L<=b;L++){var B=T[2*L+1];B!==0&&(T[2*L]=$t(_[B]++,B))}}function Et(T){var b;for(b=0;286>b;b++)T.dyn_ltree[2*b]=0;for(b=0;30>b;b++)T.dyn_dtree[2*b]=0;for(b=0;19>b;b++)T.bl_tree[2*b]=0;T.dyn_ltree[512]=1,T.opt_len=T.static_len=0,T.last_lit=T.matches=0}function Ft(T){8T.heap_len;)m[2*(Q=T.heap[++T.heap_len]=2>L?++L:0)]=1,T.depth[Q]=0,T.opt_len--,C&&(T.static_len-=_[2*Q+1]);for(b.max_code=L,B=T.heap_len>>1;1<=B;B--)Te(T,m,B);for(Q=D;B=T.heap[1],T.heap[1]=T.heap[T.heap_len--],Te(T,m,1),q=T.heap[1],T.heap[--T.heap_max]=B,T.heap[--T.heap_max]=q,m[2*Q]=m[2*B]+m[2*q],T.depth[Q]=(T.depth[B]>=T.depth[q]?T.depth[B]:T.depth[q])+1,m[2*B+1]=m[2*q+1]=Q,T.heap[1]=Q++,Te(T,m,1),2<=T.heap_len;);T.heap[--T.heap_max]=T.heap[1],function(oe,le){var be=le.dyn_tree,Me=le.max_code,Ye=le.stat_desc.static_tree,it=le.stat_desc.has_stree,Lt=le.stat_desc.extra_bits,Ut=le.stat_desc.extra_base,Je=le.stat_desc.max_length,Rt=0,ri,ti,Zt,ii,Ci,ki;for(ii=0;ii<=15;ii++)oe.bl_count[ii]=0;for(be[2*oe.heap[oe.heap_max]+1]=0,ri=oe.heap_max+1;573>ri;ri++)Je<(ii=be[2*be[2*(ti=oe.heap[ri])+1]+1]+1)&&(ii=Je,Rt++),be[2*ti+1]=ii,Me=D?T.bl_tree[34]++:T.bl_tree[36]++:(Q!==_&&T.bl_tree[2*Q]++,T.bl_tree[32]++),_=Q,B=(D=0)===C?(L=138,3):Q===C?(L=6,3):(L=7,4))}function ct(T,b,m){var _=-1,C=b[1],D=0,L=7,B=4,q,Q;for(C===0&&(L=138,B=3),q=0;q<=m;q++)if(Q=C,C=b[2*(q+1)+1],!(++D=D?(Pt(T,17,T.bl_tree),mt(T,D-3,3)):(Pt(T,18,T.bl_tree),mt(T,D-11,7)):(Q!==_&&(Pt(T,Q,T.bl_tree),D--),Pt(T,16,T.bl_tree),mt(T,D-3,2));_=Q,B=(D=0)===C?(L=138,3):Q===C?(L=6,3):(L=7,4)}}function ae(T,b,m,_){var C,D,L;mt(T,0+(_?1:0),3),D=b,L=m,Ft(C=T),Ze(C,L),Ze(C,~L),ht.arraySet(C.pending_buf,C.window,D,L,C.pending),C.pending+=L}var ht=Ie("../utils/common"),wt=15,Ne=[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],pe=[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],Ae=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],tt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],gt=Array(576);Ge(gt);var ze=Array(60);Ge(ze);var Ot=Array(512);Ge(Ot);var jt=Array(256);Ge(jt);var nt=Array(29);Ge(nt);var $e=Array(30),Xt,A,ye;Ge($e);var H=!1;Oe._tr_init=function(T){H||(function(){var b=Array(wt+1),m,_,C,D,L;for(D=C=0;28>D;D++)for(nt[D]=C,m=0;m<1<D;D++)for($e[D]=L,m=0;m<1<>=7;30>D;D++)for($e[D]=L<<7,m=0;m<1<=m;)gt[2*m+1]=8,m++,b[8]++;for(;255>=m;)gt[2*m+1]=9,m++,b[9]++;for(;279>=m;)gt[2*m+1]=7,m++,b[7]++;for(;287>=m;)gt[2*m+1]=8,m++,b[8]++;for(Ct(gt,287,b),m=0;30>m;m++)ze[2*m+1]=5,ze[2*m]=$t(m,5);Xt=new Be(gt,Ne,257,286,wt),A=new Be(ze,pe,0,30,wt),ye=new Be([],Ae,0,19,7)}(),H=!0),T.l_desc=new qe(T.dyn_ltree,Xt),T.d_desc=new qe(T.dyn_dtree,A),T.bl_desc=new qe(T.bl_tree,ye),T.bi_buf=0,T.bi_valid=0,Et(T)},Oe._tr_stored_block=ae,Oe._tr_flush_block=function(T,b,m,_){var C=0,D,L;0=Q;Q++,q>>>=1)if(1&q&&B.dyn_ltree[2*Q]!==0)return 0;if(B.dyn_ltree[18]!==0||B.dyn_ltree[20]!==0||B.dyn_ltree[26]!==0)return 1;for(Q=32;256>Q;Q++)if(B.dyn_ltree[2*Q]!==0)return 1;return 0}(T)),pt(T,T.l_desc),pt(T,T.d_desc),C=function(B){var q;for(kt(B,B.dyn_ltree,B.l_desc.max_code),kt(B,B.dyn_dtree,B.d_desc.max_code),pt(B,B.bl_desc),q=18;3<=q&&B.bl_tree[2*tt[q]+1]===0;q--);return B.opt_len+=3*(q+1)+5+5+4,q}(T),D=T.opt_len+3+7>>>3,(L=T.static_len+3+7>>>3)<=D&&(D=L)):D=L=m+5,m+4<=D&&b!==-1?ae(T,b,m,_):T.strategy===4||L===D?(mt(T,2+(_?1:0),3),je(T,gt,ze)):(mt(T,4+(_?1:0),3),function(B,q,Q,oe){var le;for(mt(B,q-257,5),mt(B,Q-1,5),mt(B,oe-4,4),le=0;le>>8,T.pending_buf[T.d_buf+2*T.last_lit+1]=255&b,T.pending_buf[T.l_buf+T.last_lit]=255&m,T.last_lit++,b===0?T.dyn_ltree[2*m]++:(T.matches++,b--,T.dyn_ltree[2*(jt[m]+256+1)]++,T.dyn_dtree[2*et(b)]++),T.last_lit===T.lit_bufsize-1},Oe._tr_align=function(T){var b;mt(T,2,3),Pt(T,256,gt),(b=T).bi_valid===16?(Ze(b,b.bi_buf),b.bi_buf=0,b.bi_valid=0):8<=b.bi_valid&&(b.pending_buf[b.pending++]=255&b.bi_buf,b.bi_buf>>=8,b.bi_valid-=8)}},{"../utils/common":41}],53:[function(Ie,Re){Re.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(Ie,Re){Re.exports=typeof v=="function"?v:function(){var Oe=[].slice.apply(arguments);Oe.splice(1,0,0),setTimeout.apply(null,Oe)}},{}]},{},[10])(10)})}).call(this,Pe===void 0?typeof self>"u"?typeof window>"u"?{}:window:self:Pe)},{}]},{},[1])(1)})}).call(this,ce===void 0?typeof self>"u"?typeof window>"u"?{}:window:self:ce)},{}]},{},[1])(1)})}).call(this,Y===void 0?typeof self>"u"?typeof window>"u"?{}:window:self:Y)},{}]},{},[1])(1)})}).call(this,F===void 0?typeof self>"u"?typeof window>"u"?{}:window:self:F)},{}]},{},[1])(1)})}).call(this,typeof p>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:p)},{}]},{},[1])(1)})}).call(this)}).call(this,typeof Jh>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:Jh,l("buffer").Buffer,l("timers").setImmediate)},{buffer:8,timers:22}],12:[function(l,c){function h(){}function p(X){if(typeof X!="function")throw new TypeError("resolver must be a function");this.state=Y,this.queue=[],this.outcome=void 0,X!==h&&I(this,X)}function y(X,Z,ie){this.promise=X,typeof Z=="function"&&(this.onFulfilled=Z,this.callFulfilled=this.otherCallFulfilled),typeof ie=="function"&&(this.onRejected=ie,this.callRejected=this.otherCallRejected)}function v(X,Z,ie){F(function(){var ce;try{ce=Z(ie)}catch(he){return k.reject(X,he)}ce===X?k.reject(X,new TypeError("Cannot resolve promise with itself")):k.resolve(X,ce)})}function x(X){var Z=X&&X.then;if(X&&(typeof X=="object"||typeof X=="function")&&typeof Z=="function")return function(){Z.apply(X,arguments)}}function I(X,Z){function ie(xe){he||(he=!0,k.reject(X,xe))}function ce(xe){he||(he=!0,k.resolve(X,xe))}var he=!1,_e=P(function(){Z(ce,ie)});_e.status==="error"&&ie(_e.value)}function P(X,Z){var ie={};try{ie.value=X(Z),ie.status="success"}catch(ce){ie.status="error",ie.value=ce}return ie}var F=l("immediate"),k={},j=["REJECTED"],V=["FULFILLED"],Y=["PENDING"];c.exports=p,p.prototype.finally=function(X){if(typeof X!="function")return this;var Z=this.constructor;return this.then(function(ie){return Z.resolve(X()).then(function(){return ie})},function(ie){return Z.resolve(X()).then(function(){throw ie})})},p.prototype.catch=function(X){return this.then(null,X)},p.prototype.then=function(X,Z){if(typeof X!="function"&&this.state===V||typeof Z!="function"&&this.state===j)return this;var ie=new this.constructor(h);if(this.state!==Y){var ce=this.state===V?X:Z;v(ie,ce,this.outcome)}else this.queue.push(new y(ie,X,Z));return ie},y.prototype.callFulfilled=function(X){k.resolve(this.promise,X)},y.prototype.otherCallFulfilled=function(X){v(this.promise,this.onFulfilled,X)},y.prototype.callRejected=function(X){k.reject(this.promise,X)},y.prototype.otherCallRejected=function(X){v(this.promise,this.onRejected,X)},k.resolve=function(X,Z){var ie=P(x,Z);if(ie.status==="error")return k.reject(X,ie.value);var ce=ie.value;if(ce)I(X,ce);else{X.state=V,X.outcome=Z;for(var he=-1,_e=X.queue.length;++he<_e;)X.queue[he].callFulfilled(Z)}return X},k.reject=function(X,Z){X.state=j,X.outcome=Z;for(var ie=-1,ce=X.queue.length;++ie=this._max)&&(this._max=1/0),this._lengthCalculator=X.length||p,typeof this._lengthCalculator!="function"&&(this._lengthCalculator=p),this._allowStale=X.stale||!1,this._maxAge=X.maxAge||null,this._dispose=X.dispose,void this.reset()):new v(X)}function x(X,Z,ie){y(Z);var ce=X._cache[Z];return ce&&(I(X,ce)?(j(X,ce),!X._allowStale&&(ce=void 0)):ie&&P(X,ce),ce&&(ce=ce.value)),ce}function I(X,Z){if(!Z||!Z.maxAge&&!X._maxAge)return!1;var ie=!1,ce=Date.now()-Z.now;return ie=Z.maxAge?ce>Z.maxAge:X._maxAge&&ce>X._maxAge,ie}function P(X,Z){k(X,Z),Z.lu=X._mru++,X._lruList[Z.lu]=Z}function F(X){for(;X._lruX._max;)j(X,X._lruList[X._lru])}function k(X,Z){for(delete X._lruList[Z.lu];X._lru=X)||(X=1/0),this._max=X,this._length>this._max&&F(this)},get:function(){return this._max},enumerable:!0}),Object.defineProperty(v.prototype,"lengthCalculator",{set:function(X){if(typeof X!="function")for(var Z in this._lengthCalculator=p,this._length=this._itemCount,this._cache)this._cache[Z].length=1;else for(var Z in this._lengthCalculator=X,this._length=0,this._cache)this._cache[Z].length=this._lengthCalculator(this._cache[Z].value),this._length+=this._cache[Z].length;this._length>this._max&&F(this)},get:function(){return this._lengthCalculator},enumerable:!0}),Object.defineProperty(v.prototype,"length",{get:function(){return this._length},enumerable:!0}),Object.defineProperty(v.prototype,"itemCount",{get:function(){return this._itemCount},enumerable:!0}),v.prototype.forEach=function(X,Z){Z=Z||this;for(var ie=0,ce=this._itemCount,he=this._mru-1;0<=he&&iethis._max?(j(this,this._cache[X]),!1):(this._dispose&&this._dispose(X,this._cache[X].value),this._cache[X].now=ce,this._cache[X].maxAge=ie,this._cache[X].value=Z,this._length+=he-this._cache[X].length,this._cache[X].length=he,this.get(X),this._length>this._max&&F(this),!0);var _e=new V(X,Z,this._mru++,he,ce,ie);return _e.length>this._max?(this._dispose&&this._dispose(X,Z),!1):(this._length+=_e.length,this._lruList[_e.lu]=this._cache[X]=_e,this._itemCount++,this._length>this._max&&F(this),!0)},v.prototype.has=function(X){if(y(X),!h(this._cache,X))return!1;var Z=this._cache[X];return!I(this,Z)},v.prototype.get=function(X){return y(X),x(this,X,!0)},v.prototype.peek=function(X){return y(X),x(this,X,!1)},v.prototype.pop=function(){var X=this._lruList[this._lru];return j(this,X),X||null},v.prototype.del=function(X){y(X),j(this,this._cache[X])},v.prototype.load=function(X){this.reset();for(var Z=Date.now(),ie=X.length-1,ce;0<=ie;ie--){ce=X[ie],y(ce.k);var he=ce.e||0;if(he===0)this.set(ce.k,ce.v);else{var _e=he-Z;0<_e&&this.set(ce.k,ce.v,_e)}}}})()},{}],14:[function(l,c){function h(x){var I=new y,P=I.write(x)+I.end();return P.replace(/\0/g,"").trim()}function p(x,I){if(!x)return h;try{new TextDecoder(x.trim())}catch{var P=v.exec(x);return P&&!I?p("windows-"+P[1],!0):h}return function(F){var k=new TextDecoder(x),j=k.decode(F,{stream:!0})+k.decode();return j.replace(/\0/g,"").trim()}}l("text-encoding-polyfill");var y=l("string_decoder").StringDecoder;c.exports=p;var v=/^(?:ANSI\s)?(\d+)$/m},{string_decoder:19,"text-encoding-polyfill":20}],15:[function(l,c){function h(I){var P={lastUpdated:new Date(I.readUInt8(1)+1900,I.readUInt8(2),I.readUInt8(3)),records:I.readUInt32LE(4),headerLen:I.readUInt16LE(8),recLen:I.readUInt16LE(10)};return P}function p(I,P,F){for(var k=[],j=32;j-1.001*wi)ne=-wi;else if(ne>wi&&ne<1.001*wi)ne=wi;else{if(ne<-wi)return{x:-1/0,y:-1/0,z:me.z};if(ne>wi)return{x:1/0,y:1/0,z:me.z}}return bt>P&&(bt-=2*P),ge=V(ne),He=Y(ne),Ee=ge*ge,se=We/X(1-Le*Ee),{x:(se+ee)*He*Y(bt),y:(se+ee)*He*V(bt),z:(se*(1-Le)+ee)*ge}}function Ae(me,Le,We,bt){var ne=1e-12,ee=me.x,se=me.y,ge=me.z?me.z:0,Ee,He,Xe,at,Tt,Yt,bi,_i,Li,Xi,fr,lr,Fr,gr,nn,pn;if(Ee=X(ee*ee+se*se),He=X(ee*ee+se*se+ge*ge),!(Ee/Wene*ne&&Fr<30);return nn=F(fr/n(Xi)),{x:gr,y:nn,z:pn}}function tt(me,Le,We){if(Le===1)return{x:me.x+We[0],y:me.y+We[1],z:me.z+We[2]};if(Le===2){var bt=We[0],ne=We[1],ee=We[2],se=We[3],ge=We[4],Ee=We[5],He=We[6];return{x:He*(me.x-Ee*me.y+ge*me.z)+bt,y:He*(Ee*me.x+me.y-se*me.z)+ne,z:He*(-ge*me.x+se*me.y+me.z)+ee}}}function gt(me,Le,We){if(Le===1)return{x:me.x-We[0],y:me.y-We[1],z:me.z-We[2]};if(Le===2){var bt=We[0],ne=We[1],ee=We[2],se=We[3],ge=We[4],Ee=We[5],He=We[6],Xe=(me.x-bt)/He,at=(me.y-ne)/He,Tt=(me.z-ee)/He;return{x:Xe+Ee*at-ge*Tt,y:-Ee*Xe+at+se*Tt,z:ge*Xe-se*at+Tt}}}function ze(me){return me===1||me===2}function Ot(me,Le,We){if(me.grids===null||me.grids.length===0)return console.log("Grid shift grids not found"),-1;for(var bt={x:-We.x,y:We.y},ne={x:v,y:v},ee=[],se=0,ge;sebt.y||Xe>bt.x||Ytge&&n(Ee.y)>ge);if(0>se)return console.log("Inverse grid shift iterator failed to converge."),bt;bt.x=Bt(ee.x+We.ll[0]),bt.y=ee.y+We.ll[1]}else isNaN(ee.x)||(bt.x=me.x+ee.x,bt.y=me.y+ee.y);return bt}function nt(me,Le){var We={x:me.x/Le.del[0],y:me.y/Le.del[1]},bt={x:i(We.x),y:i(We.y)},ne={x:We.x-1*bt.x,y:We.y-1*bt.y},ee={x:v,y:v},se;if(0>bt.x||bt.x>=Le.lim[0]||0>bt.y||bt.y>=Le.lim[1])return ee;se=bt.y*Le.lim[0]+bt.x;var ge={x:Le.cvs[se][0],y:Le.cvs[se][1]};se++;var Ee={x:Le.cvs[se][0],y:Le.cvs[se][1]};se+=Le.lim[0];var He={x:Le.cvs[se][0],y:Le.cvs[se][1]};se--;var Xe={x:Le.cvs[se][0],y:Le.cvs[se][1]},at=ne.x*ne.y,Tt=ne.x*(1-ne.y),Yt=(1-ne.x)*(1-ne.y),bi=(1-ne.x)*ne.y;return ee.x=Yt*ge.x+Tt*Ee.x+bi*Xe.x+at*He.x,ee.y=Yt*ge.y+Tt*Ee.y+bi*Xe.y+at*He.y,ee}function $e(me){var Le=Number.isFinite;if(typeof Le=="function"){if(Le(me))return;throw new TypeError("coordinates must be finite numbers")}if(typeof me!="number"||me!==me||!isFinite(me))throw new TypeError("coordinates must be finite numbers")}function Xt(me,Le){return(me.datum.datum_type===1||me.datum.datum_type===2)&&Le.datumCode!=="WGS84"||(Le.datum.datum_type===1||Le.datum.datum_type===2)&&me.datumCode!=="WGS84"}function A(me,Le,We){var bt;if(Array.isArray(We)&&(We=si(We)),vt(We),me.datum&&Le.datum&&Xt(me,Le)&&(bt=new wt("WGS84"),We=A(me,bt,We),me=bt),me.axis!=="enu"&&(We=Lo(me,!1,We)),me.projName==="longlat")We={x:We.x*os,y:We.y*os,z:We.z||0};else if(me.to_meter&&(We={x:We.x*me.to_meter,y:We.y*me.to_meter,z:We.z||0}),We=me.inverse(We),!We)return;return me.from_greenwich&&(We.x+=me.from_greenwich),We=Dn(me.datum,Le.datum,We),!We?void 0:(Le.from_greenwich&&(We={x:We.x-Le.from_greenwich,y:We.y,z:We.z||0}),Le.projName==="longlat"?We={x:We.x*Wn,y:We.y*Wn,z:We.z||0}:(We=Le.forward(We),Le.to_meter&&(We={x:We.x/Le.to_meter,y:We.y/Le.to_meter,z:We.z||0})),Le.axis==="enu"?We:Lo(Le,!0,We))}function ye(me,Le,We){var bt,ne,ee;return Array.isArray(We)?(bt=A(me,Le,We)||{x:NaN,y:NaN},2"u"?(Le=me,me=Kt,bt=!0):(typeof Le.x<"u"||Array.isArray(Le))&&(We=Le,Le=me,me=Kt,bt=!0),Le=H(Le),We?ye(me,Le,We):(ne={forward:function(ee){return ye(me,Le,ee)},inverse:function(ee){return ye(Le,me,ee)}},bt&&(ne.oProj=Le),ne)}function b(me,Le){return Le=Le||5,q(D({lat:me[1],lon:me[0]}),Le)}function m(me){var Le=L(be(me.toUpperCase()));return Le.lat&&Le.lon?[Le.lon,Le.lat]:[(Le.left+Le.right)/2,(Le.top+Le.bottom)/2]}function _(me){return me*(P/180)}function C(me){return 180*(me/P)}function D(me){var Le=me.lat,We=me.lon,bt=6378137,ne=.00669438,ee=.9996,se=_(Le),ge,Ee,He,Xe,at,Tt;Tt=i((We+180)/6)+1,We===180&&(Tt=60),56<=Le&&64>Le&&3<=We&&12>We&&(Tt=32),72<=Le&&84>Le&&(0<=We&&9>We?Tt=31:9<=We&&21>We?Tt=33:21<=We&&33>We?Tt=35:33<=We&&42>We&&(Tt=37)),ge=ne/(1-ne),Ee=bt/X(1-ne*V(se)*V(se)),He=j(se)*j(se),Xe=ge*Y(se)*Y(se),at=bt*((1-ne/4-3*ne*ne/64-5*ne*ne*ne/256)*se-(3*ne/8+3*ne*ne/32+45*ne*ne*ne/1024)*V(2*se)+(15*ne*ne/256+45*ne*ne*ne/1024)*V(4*se)-35*ne*ne*ne/3072*V(6*se));var Yt=ee*Ee*(65+65*(65*(65*(1-He+Xe)))/6+65*(65*(65*(65*(65*(5-18*He+He*He+72*Xe-58*ge)))))/120)+5e5,bi=ee*(at+Ee*j(se)*(4225/2+65*(65*(65*(65*(5-He+9*Xe+4*Xe*Xe))))/24+65*(65*(65*(65*(65*(65*(61-58*He+He*He+600*Xe-330*ge))))))/720));return 0>Le&&(bi+=1e7),{northing:I(bi),easting:I(Yt),zoneNumber:Tt,zoneLetter:B(Le)}}function L(me){var Le=me.northing,We=me.easting,bt=me.zoneLetter,ne=me.zoneNumber;if(0>ne||60bt&&(He-=1e7),Xi=6*(ne-1)-180+3,Xe=ge/(1-ge),Li=He/ee,fr=Li/(se*(1-ge/4-3*ge*ge/64-5*ge*ge*ge/256)),lr=fr+(3*Ee/2-27*Ee*Ee*Ee/32)*V(2*fr)+(21*Ee*Ee/16-55*Ee*Ee*Ee*Ee/32)*V(4*fr)+151*Ee*Ee*Ee/96*V(6*fr),at=se/X(1-ge*V(lr)*V(lr)),Tt=j(lr)*j(lr),Yt=Xe*Y(lr)*Y(lr),bi=se*(1-ge)/s(1-ge*V(lr)*V(lr),1.5),_i=(We-5e5)/(at*ee);var Fr=lr-at*j(lr)/bi*(_i*_i/2-(5+3*Tt+10*Yt-4*Yt*Yt-9*Xe)*_i*_i*_i*_i/24+(61+90*Tt+298*Yt+45*Tt*Tt-252*Xe-3*Yt*Yt)*_i*_i*_i*_i*_i*_i/720);Fr=C(Fr);var gr=(_i-(1+2*Tt+Yt)*_i*_i*_i/6+(5-2*Yt+28*Tt-3*Yt*Yt+8*Xe+24*Tt*Tt)*_i*_i*_i*_i*_i/120)/Y(lr);gr=Xi+C(gr);var nn;if(me.accuracy){var pn=L({northing:me.northing+me.accuracy,easting:me.easting+me.accuracy,zoneLetter:me.zoneLetter,zoneNumber:me.zoneNumber});nn={top:pn.lat,right:pn.lon,bottom:Fr,left:gr}}else nn={lat:Fr,lon:gr};return nn}function B(me){var Le="Z";return 84>=me&&72<=me?Le="X":72>me&&64<=me?Le="W":64>me&&56<=me?Le="V":56>me&&48<=me?Le="U":48>me&&40<=me?Le="T":40>me&&32<=me?Le="S":32>me&&24<=me?Le="R":24>me&&16<=me?Le="Q":16>me&&8<=me?Le="P":8>me&&0<=me?Le="N":0>me&&-8<=me?Le="M":-8>me&&-16<=me?Le="L":-16>me&&-24<=me?Le="K":-24>me&&-32<=me?Le="J":-32>me&&-40<=me?Le="H":-40>me&&-48<=me?Le="G":-48>me&&-56<=me?Le="F":-56>me&&-64<=me?Le="E":-64>me&&-72<=me?Le="D":-72>me&&-80<=me&&(Le="C"),Le}function q(me,Le){var We="00000"+me.easting,bt="00000"+me.northing;return me.zoneNumber+me.zoneLetter+Q(me.easting,me.northing,me.zoneNumber)+We.substr(We.length-5,Le)+bt.substr(bt.length-5,Le)}function Q(me,Le,We){var bt=oe(We),ne=i(me/1e5),ee=i(Le/1e5)%20;return le(ne,ee,bt)}function oe(me){var Le=me%6;return Le===0&&(Le=6),Le}function le(me,Le,We){var bt=We-1,ne="AJSAJS".charCodeAt(bt),ee="AFAFAF".charCodeAt(bt),se=ne+me-1,ge=ee+Le,Ee=!1;90ne&&73ne)&&Ee)&&se++,(se===79||79>ne&&79ne)&&Ee)&&(se++,se===73&&se++),90ee&&73ee)&&Ee)&&ge++,(ge===79||79>ee&&79ee)&&Ee)&&(ge++,ge===73&&ge++),86Le)throw"MGRSPoint bad conversion from: "+me;var ge=me.charAt(ne++);if("A">=ge||ge==="B"||ge==="Y"||"Z"<=ge||ge==="I"||ge==="O")throw"MGRSPoint zone letter "+ge+" not handled: "+me;We=me.substring(ne,ne+=2);for(var Ee=oe(se),He=Me(We.charAt(0),Ee),Xe=Ye(We.charAt(1),Ee);Xe"u"){var bt=pe.split(",");this.x=parseFloat(bt[0],10),this.y=parseFloat(bt[1],10),this.z=parseFloat(bt[2],10)||0}else this.x=pe,this.y=Fe,this.z=We||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}function Vt(pe){var Fe=typeof pe.PROJECTION=="object"?Object.keys(pe.PROJECTION)[0]:pe.PROJECTION;return"no_uoff"in pe||"no_off"in pe||["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(Fe)!==-1}function Ke(){var pe=Math.pi,Fe=0,We=0,bt=0,ne=0,Q=0,se=0,me=0,Te,He,Ye,ot,Ct,Wt,pi,di,Oi,zi,sr;this.no_off=Vt(this),this.no_rot="no_rot"in this;var tr=!1;"alpha"in this&&(tr=!0);var Sr=!1;if("rectified_grid_angle"in this&&(Sr=!0),tr&&(me=this.alpha),Sr&&(Fe=this.rectified_grid_angle*is),tr||Sr)We=this.longc;else if(bt=this.long1,Q=this.lat1,ne=this.long2,se=this.lat2,n(Q-se)<=Jp||(Te=n(Q))<=Jp||n(Te-mi)<=Jp||n(n(this.lat0)-mi)<=Jp||n(n(se)-mi)<=Jp)throw new Error;var lr=1-this.es;He=X(lr),n(this.lat0)>kr?(di=V(this.lat0),Ye=Y(this.lat0),Te=1-this.es*di*di,this.B=Ye*Ye,this.B=X(1+this.es*this.B*this.B/lr),this.A=this.B*this.k0*He/Te,ot=this.B*He/(Ye*X(Te)),Ct=ot*ot-1,0>=Ct?Ct=0:(Ct=X(Ct),0>this.lat0&&(Ct=-Ct)),this.E=Ct+=ot,this.E*=s(Ft(this.e,this.lat0,di),this.B)):(this.B=1/He,this.A=this.k0,this.E=ot=Ct=1),tr||Sr?(tr?(sr=p(V(me)/ot),!Sr&&(Fe=me)):(sr=Fe,me=p(ot*V(sr))),this.lam0=We-p(.5*(Ct-1/Ct)*G(sr))/this.B):(Wt=s(Ft(this.e,Q,V(Q)),this.B),pi=s(Ft(this.e,se,V(se)),this.B),Ct=this.E/Wt,Oi=(pi-Wt)/(pi+Wt),zi=this.E*this.E,zi=(zi-pi*Wt)/(zi+pi*Wt),Te=bt-ne,Te<-pe?ne-=Kn:Te>pe&&(ne+=Kn),this.lam0=Bt(.5*(bt+ne)-L(zi*G(.5*this.B*(bt-ne))/Oi)/this.B),sr=L(2*V(this.B*Bt(bt-this.lam0))/(Ct-1/Ct)),Fe=me=p(ot*V(sr))),this.singam=V(sr),this.cosgam=Y(sr),this.sinrot=V(Fe),this.cosrot=Y(Fe),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*L(X(ot*ot-1)/Y(me))),0>this.lat0&&(this.u_0=-this.u_0)),Ct=.5*sr,this.v_pole_n=this.ArB*r(G(En-Ct)),this.v_pole_s=this.ArB*r(G(En+Ct))}function Ot(pe){var Fe=[],We;return Fe[0]=pe*Ag,We=pe*pe,Fe[0]+=We*Pg,Fe[1]=We*fa,We*=pe,Fe[0]+=We*Yd,Fe[1]+=We*cm,Fe[2]=We*dl,Fe}function ei(pe,Fe){var We=pe+pe;return pe+Fe[0]*V(We)+Fe[1]*V(We+We)+Fe[2]*V(We+We+We)}function Jt(pe,Fe,We,bt){var ne;return peEn&&ne<=mi+En?(bt.value=Wa.AREA_1,ne-=mi):ne>mi+En||ne<=-(mi+En)?(bt.value=Wa.AREA_2,ne=0<=ne?ne-$i:ne+$i):(bt.value=Wa.AREA_3,ne+=mi)),ne}function Xt(pe,Fe){var We=pe+Fe;return We<-$i?We+=Kn:We>+$i&&(We-=Kn),We}function ti(pe,Fe,We,bt){for(var ne=Fe,Q;bt&&(Q=pe(ne),ne-=Q,!(n(Q)=this.text.length)return;pe=this.text[this.place++]}switch(this.state){case li:return this.neutral(pe);case H:return this.keyword(pe);case Ta:return this.quoted(pe);case ea:return this.afterquote(pe);case xr:return this.number(pe)}},re.prototype.afterquote=function(pe){if(pe==='"')return this.word+='"',void(this.state=Ta);if(Ha.test(pe))return this.word=this.word.trim(),void this.afterItem(pe);throw new Error(`havn't handled "`+pe+'" in afterquote yet, index '+this.place)},re.prototype.afterItem=function(pe){return pe===","?(this.word!==null&&this.currentObject.push(this.word),this.word=null,void(this.state=li)):pe==="]"?(this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=li,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=zt))):void 0},re.prototype.number=function(pe){if(wi.test(pe))return void(this.word+=pe);if(Ha.test(pe))return this.word=parseFloat(this.word),void this.afterItem(pe);throw new Error(`havn't handled "`+pe+'" in number yet, index '+this.place)},re.prototype.quoted=function(pe){return pe==='"'?void(this.state=ea):void(this.word+=pe)},re.prototype.keyword=function(pe){if(/[A-Za-z84]/.test(pe))return void(this.word+=pe);if(pe==="["){var Fe=[];return Fe.push(this.word),this.level++,this.root===null?this.root=Fe:this.currentObject.push(Fe),this.stack.push(this.currentObject),this.currentObject=Fe,void(this.state=li)}if(Ha.test(pe))return void this.afterItem(pe);throw new Error(`havn't handled "`+pe+'" in keyword yet, index '+this.place)},re.prototype.neutral=function(pe){if(/[A-Za-z]/.test(pe))return this.word=pe,void(this.state=H);if(pe==='"')return this.word="",void(this.state=Ta);if(wi.test(pe))return this.word=pe,void(this.state=xr);if(Ha.test(pe))return void this.afterItem(pe);throw new Error(`havn't handled "`+pe+'" in neutral yet, index '+this.place)},re.prototype.output=function(){for(;this.placepe?-1:1},Bt=function(pe){return n(pe)<=$i?pe:pe-wa(pe)*Kn},Ft=function(pe,Fe,We){var bt=pe*We;return bt=s((1-bt)/(1+bt),.5*pe),G(.5*(mi-Fe))/bt},yi=function(pe,Fe){for(var We=mi-2*L(Fe),bt=0,ne,Q;15>=bt;bt++)if(ne=pe*V(We),Q=mi-2*L(Fe*s((1-ne)/(1+ne),.5*pe))-We,We+=Q,1e-10>=n(Q))return We;return-9999},Ti=[{init:Je,forward:function(pe){var Fe=pe.x,We=pe.y;if(90We*Hn&&180Fe*Hn)return null;var bt,ne;if(n(n(We)-mi)<=kr)return null;if(this.sphere)bt=this.x0+this.a*this.k0*Bt(Fe-this.long0),ne=this.y0+this.a*this.k0*r(G(En+.5*We));else{var Q=V(We),se=Ft(this.e,We,Q);bt=this.x0+this.a*this.k0*Bt(Fe-this.long0),ne=this.y0-this.a*this.k0*r(se)}return pe.x=bt,pe.y=ne,pe},inverse:function(pe){var Fe=pe.x-this.x0,We=pe.y-this.y0,bt,ne;if(this.sphere)ne=mi-2*L(N(-We/(this.a*this.k0)));else{var Q=N(-We/(this.a*this.k0));if(ne=yi(this.e,Q),ne===-9999)return null}return bt=Bt(this.long0+Fe/(this.a*this.k0)),pe.x=bt,pe.y=ne,pe},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:et,inverse:et,names:["longlat","identity"]}],xi={},Ki=[],ur={};ur.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},ur.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},ur.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},ur.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},ur.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},ur.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},ur.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},ur.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},ur.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},ur.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},ur.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},ur.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},ur.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},ur.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},ur.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},ur.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},ur.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},ur.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},ur.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},ur.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},ur.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},ur.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},ur.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},ur.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},ur.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},ur.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},ur.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},ur.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},ur.hough={a:6378270,rf:297,ellipseName:"Hough"},ur.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},ur.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},ur.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},ur.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},ur.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},ur.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},ur.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},ur.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},ur.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},ur.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},ur.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},ur.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var pn=ur.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};ur.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var $n={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"}},ko={};pt.projections={start:function(){Ti.forEach(tt)},add:tt,get:function(pe){if(!pe)return!1;var Fe=pe.toLowerCase();if(typeof xi[Fe]<"u"&&Ki[xi[Fe]])return Ki[xi[Fe]]}},pt.projections.start();var An=function(pe,Fe,We){if(Le(pe,Fe)||pe.datum_type===Fi||Fe.datum_type===Fi)return We;var bt=pe.a,ne=pe.es;if(pe.datum_type===bi){var Q=At(pe,!1,We);if(Q!==0)return;bt=Ri,ne=er}var se=Fe.a,me=Fe.b,Te=Fe.es;if(Fe.datum_type===bi&&(se=Ri,me=6356752314e-3,Te=er),ne===Te&&bt===se&&!Ve(pe.datum_type)&&!Ve(Fe.datum_type))return We;if(We=ce(We,ne,bt),Ve(pe.datum_type)&&(We=Ze(We,pe.datum_type,pe.datum_params)),Ve(Fe.datum_type)&&(We=yt(We,Fe.datum_type,Fe.datum_params)),We=Ce(We,Te,se,me),Fe.datum_type===bi){var He=At(Fe,!0,We);if(He!==0)return}return We},No=function(pe,Fe,We){var bt=We.x,ne=We.y,Q=We.z||0,se={},me,Te,He;for(He=0;3>He;He++)if(!(Fe&&He===2&&We.z===void 0))switch(He===0?(me=bt,Te="ew".indexOf(pe.axis[He])===-1?"y":"x"):He===1?(me=ne,Te="ns".indexOf(pe.axis[He])===-1?"x":"y"):(me=Q,Te="z"),pe.axis[He]){case"e":se[Te]=me;break;case"w":se[Te]=-me;break;case"n":se[Te]=me;break;case"s":se[Te]=-me;break;case"u":We[Te]!==void 0&&(se.z=me);break;case"d":We[Te]!==void 0&&(se.z=-me);break;default:return null}return se},Ts=function(pe){var Fe={x:pe[0],y:pe[1]};return 2kr?G(We):0,di=s(pi,2),Oi=s(di,2);se=1-this.es*s(ne,2),Ye/=X(se);var zi=_i(We,ne,Q,this.en);me=this.a*(this.k0*Ye*(1+ot/6*(1-di+Ct+ot/20*(5-18*di+Oi+14*Ct-58*di*Ct+ot/42*(61+179*Oi-Oi*di-479*di)))))+this.x0,Te=this.a*(this.k0*(zi-this.ml0+ne*bt*Ye/2*(1+ot/12*(5-di+9*Ct+4*Wt+ot/30*(61+Oi-58*di+270*Ct-330*di*Ct+ot/56*(1385+543*Oi-Oi*di-3111*di))))))+this.y0}else{var He=Q*V(bt);if(n(n(He)-1)kr)return 93;Te=0}else Te=y(Te);0>We&&(Te=-Te),Te=this.a*this.k0*(Te-this.lat0)+this.y0}return pe.x=me,pe.y=Te,pe},inverse:function(pe){var Fe=(pe.x-this.x0)*(1/this.a),We=(pe.y-this.y0)*(1/this.a),bt,ne,Q,se;if(this.es)if(bt=this.ml0+We/this.k0,ne=gi(bt,this.es,this.en),n(ne)kr?G(ne):0,pi=this.ep2*s(Ct,2),di=s(pi,2),Oi=s(Wt,2),zi=s(Oi,2);bt=1-this.es*s(ot,2);var sr=Fe*X(bt)/this.k0,tr=s(sr,2);bt*=Wt,Q=ne-.5*(bt*tr/(1-this.es))*(1-tr/12*(5+3*Oi-9*pi*Oi+pi-4*di-tr/30*(61+90*Oi-252*pi*Oi+45*zi+46*pi-tr/56*(1385+3633*Oi+4095*zi+1574*zi*Oi)))),se=Bt(this.long0+sr*(1-tr/6*(1+2*Oi+pi-tr/20*(5+28*Oi+24*zi+8*pi*Oi+6*pi-tr/42*(61+662*Oi+1320*zi+720*zi*Oi))))/Ct)}else Q=mi*wa(We),se=0;else{var me=N(Fe/this.k0),Te=.5*(me-1/me),He=this.lat0+We/this.k0,Ye=Y(He);bt=X((1-s(Ye,2))/(1+s(Te,2))),Q=p(bt),0>We&&(Q=-Q),se=Te===0&&Ye===0?0:Bt(S(Te,Ye)+this.long0)}return pe.x=se,pe.y=Q,pe},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},Wr=function(pe){var Fe=N(pe);return Fe=(Fe-1/Fe)/2,Fe},Gr=function(pe,Fe){var We=Math.max;pe=n(pe),Fe=n(Fe);var bt=We(pe,Fe),ne=a(pe,Fe)/(bt||1);return bt*X(1+s(ne,2))},Kr=function(pe){var Fe=1+pe,We=Fe-1;return We===0?pe:pe*r(Fe)/We},Cr=function(pe){var Fe=n(pe);return Fe=Kr(Fe*(1+Fe/(Gr(1,Fe)+1))),0>pe?-Fe:Fe},Wn=function(pe,Fe){for(var We=2*Y(2*Fe),bt=pe.length-1,ne=pe[bt],Q=0,se;0<=--bt;)se=-Q+We*ne+pe[bt],Q=ne,ne=se;return Fe+se*V(2*Fe)},Rs=function(pe,Fe){for(var We=2*Y(Fe),bt=pe.length-1,ne=pe[bt],Q=0,se;0<=--bt;)se=-Q+We*ne+pe[bt],Q=ne,ne=se;return V(Fe)*se},Ms=function(pe){var Fe=N(pe);return Fe=(Fe+1/Fe)/2,Fe},Vo=function(pe,Fe,We){for(var bt=V(Fe),ne=Y(Fe),Q=Wr(We),se=Ms(We),me=2*ne*se,Te=-2*bt*Q,He=pe.length-1,Ye=pe[He],ot=0,Ct=0,Wt=0,pi,di;0<=--He;)pi=Ct,di=ot,Ct=Ye,ot=Wt,Ye=-pi+me*Ct-Te*ot+pe[He],Wt=-di+Te*Ct+me*ot;return me=bt*se,Te=ne*Q,[me*Ye-Te*Wt,me*Wt+Te*Ye]},Pc={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&&(_r.init.apply(this),this.forward=_r.forward,this.inverse=_r.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 pe=this.es/(1+X(1-this.es)),Fe=pe/(2-pe),We=Fe;this.cgb[0]=Fe*(2+Fe*(-2/3+Fe*(-2+Fe*(116/45+Fe*(26/45+Fe*(-2854/675)))))),this.cbg[0]=Fe*(-2+Fe*(2/3+Fe*(4/3+Fe*(-82/45+Fe*(32/45+Fe*(4642/4725)))))),We*=Fe,this.cgb[1]=We*(7/3+Fe*(-8/5+Fe*(-227/45+Fe*(2704/315+Fe*(2323/945))))),this.cbg[1]=We*(5/3+Fe*(-16/15+Fe*(-13/9+Fe*(904/315+Fe*(-1522/945))))),We*=Fe,this.cgb[2]=We*(56/15+Fe*(-136/35+Fe*(-1262/105+Fe*(73814/2835)))),this.cbg[2]=We*(-26/15+Fe*(34/21+Fe*(8/5+Fe*(-12686/2835)))),We*=Fe,this.cgb[3]=We*(4279/630+Fe*(-332/35+Fe*(-399572/14175))),this.cbg[3]=We*(1237/630+Fe*(-12/5+Fe*(-24832/14175))),We*=Fe,this.cgb[4]=We*(4174/315+Fe*(-144838/6237)),this.cbg[4]=We*(-734/315+Fe*(109598/31185)),We*=Fe,this.cgb[5]=We*(601676/22275),this.cbg[5]=We*(444337/155925),We=s(Fe,2),this.Qn=this.k0/(1+Fe)*(1+We*(1/4+We*(1/64+We/256))),this.utg[0]=Fe*(-.5+Fe*(2/3+Fe*(-37/96+Fe*(1/360+Fe*(81/512+Fe*(-96199/604800)))))),this.gtu[0]=Fe*(.5+Fe*(-2/3+Fe*(5/16+Fe*(41/180+Fe*(-127/288+Fe*(7891/37800)))))),this.utg[1]=We*(-1/48+Fe*(-1/15+Fe*(437/1440+Fe*(-46/105+Fe*(1118711/3870720))))),this.gtu[1]=We*(13/48+Fe*(-3/5+Fe*(557/1440+Fe*(281/630+Fe*(-1983433/1935360))))),We*=Fe,this.utg[2]=We*(-17/480+Fe*(37/840+Fe*(209/4480+Fe*(-5569/90720)))),this.gtu[2]=We*(61/240+Fe*(-103/140+Fe*(15061/26880+Fe*(167603/181440)))),We*=Fe,this.utg[3]=We*(-4397/161280+Fe*(11/504+Fe*(830251/7257600))),this.gtu[3]=We*(49561/161280+Fe*(-179/168+Fe*(6601661/7257600))),We*=Fe,this.utg[4]=We*(-4583/161280+Fe*(108847/3991680)),this.gtu[4]=We*(34729/80640+Fe*(-3418889/1995840)),We*=Fe,this.utg[5]=We*(-20648693/638668800),this.gtu[5]=We*(212378941/319334400);var bt=Wn(this.cbg,this.lat0);this.Zb=-this.Qn*(bt+Rs(this.gtu,2*bt))},forward:function(pe){var Fe=Bt(pe.x-this.long0),We=pe.y;We=Wn(this.cbg,We);var bt=V(We),ne=Y(We),Q=V(Fe),se=Y(Fe);We=S(bt,se*ne),Fe=S(Q*ne,Gr(bt,ne*se)),Fe=Cr(G(Fe));var me=Vo(this.gtu,2*We,2*Fe);We+=me[0],Fe+=me[1];var Te,He;return 2.623395162778>=n(Fe)?(Te=this.a*(this.Qn*Fe)+this.x0,He=this.a*(this.Qn*We+this.Zb)+this.y0):(Te=1/0,He=1/0),pe.x=Te,pe.y=He,pe},inverse:function(pe){var Fe=(pe.x-this.x0)*(1/this.a),We=(pe.y-this.y0)*(1/this.a);We=(We-this.Zb)/this.Qn,Fe/=this.Qn;var bt,ne;if(2.623395162778>=n(Fe)){var Q=Vo(this.utg,2*We,2*Fe);We+=Q[0],Fe+=Q[1],Fe=L(Wr(Fe));var se=V(We),me=Y(We),Te=V(Fe),He=Y(Fe);We=S(se*He,Gr(Te,He*me)),Fe=S(Te,He*me),bt=Bt(Fe+this.long0),ne=Wn(this.cgb,We)}else bt=1/0,ne=1/0;return pe.x=bt,pe.y=ne,pe},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},Ea=function(pe,Fe){if(pe===void 0){if(pe=i(30*(Bt(Fe)+O)/O)+1,0>pe)return 0;if(60kr){if(Q=this.E/s(Ft(this.e,pe.y,V(pe.y)),this.B),se=1/Q,We=.5*(Q-se),bt=.5*(Q+se),V(this.B*pe.x),ne=(We*this.singam-86*this.cosgam)/bt,n(n(ne)-1)Te?-mi:mi;else{if(Fe.y=this.E/X((1+Te)/(1-Te)),Fe.y=yi(this.e,s(Fe.y,1/this.B)),Fe.y===1/0)throw new Error;Fe.x=-this.rB*S(Q*this.cosgam-me*this.singam,Y(this.BrA*We))}return Fe.x+=this.lam0,Fe},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"]},Ig={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)kr?r(bt/me)/r(ne/Te):Fe,isNaN(this.ns)&&(this.ns=Fe),this.f0=bt/(this.ns*s(ne,this.ns)),this.rh=this.a*this.f0*s(He,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(pe){var Fe=pe.x,We=pe.y;n(2*n(We)-O)<=kr&&(We=wa(We)*(mi-2*kr));var bt=n(n(We)-mi),ne,Q;if(bt>kr)ne=Ft(this.e,We,V(We)),Q=this.a*this.f0*s(ne,this.ns);else{if(bt=We*this.ns,0>=bt)return null;Q=0}var se=this.ns*Bt(Fe-this.long0);return pe.x=this.k0*(Q*V(se))+this.x0,pe.y=this.k0*(this.rh-Q*Y(se))+this.y0,pe},inverse:function(pe){var Fe=(pe.x-this.x0)/this.k0,We=this.rh-(pe.y-this.y0)/this.k0,bt,ne,Q,se,me;0n(Te-pe.y)&&(He=1),Te=pe.y,Ye+=1;while(He===0&&15>Ye);return 15<=Ye?null:pe},names:["Krovak","krovak"]},ec=function(pe,Fe,We,bt,ne){return pe*ne-Fe*V(2*ne)+We*V(4*ne)-bt*V(6*ne)},_p=function(pe){return 1-.25*pe*(1+pe/16*(3+1.25*pe))},nd=function(pe){return .375*pe*(1+.25*pe*(1+.46875*pe))},Zp=function(pe){return .05859375*pe*pe*(1+.75*pe)},$l=function(pe){return pe*pe*pe*(35/3072)},hh=function(pe,Fe,We){var bt=Fe*We;return pe/X(1-bt*bt)},sd=function(pe){return n(pe)me;me++)if(se=(pe-(Fe*Q-We*V(2*Q)+bt*V(4*Q)-ne*V(6*Q)))/(Fe-2*We*Y(2*Q)+4*bt*Y(4*Q)-6*ne*Y(6*Q)),Q+=se,1e-10>=n(se))return Q;return NaN},Qp={init:function(){this.sphere||(this.e0=_p(this.es),this.e1=nd(this.es),this.e2=Zp(this.es),this.e3=$l(this.es),this.ml0=this.a*ec(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(pe){var Fe=pe.x,We=pe.y,bt,ne;if(Fe=Bt(Fe-this.long0),this.sphere)bt=this.a*p(Y(We)*V(Fe)),ne=this.a*(S(G(We),Y(Fe))-this.lat0);else{var Q=V(We),se=Y(We),me=hh(this.a,this.e,Q),Te=G(We)*G(We),He=Fe*Y(We),Ye=He*He,ot=this.es*se*se/(1-this.es),Ct=this.a*ec(this.e0,this.e1,this.e2,this.e3,We);bt=me*He*(1-Ye*Te*(1/6-(8-Te+8*ot)*Ye/120)),ne=Ct-this.ml0+me*Q/se*Ye*(.5+(5-Te+6*ot)*Ye/24)}return pe.x=bt+this.x0,pe.y=ne+this.y0,pe},inverse:function(pe){pe.x-=this.x0,pe.y-=this.y0;var Fe=pe.x/this.a,We=pe.y/this.a,bt,ne;if(this.sphere){var Q=We+this.lat0;bt=p(V(Q)*Y(Fe)),ne=S(G(Fe),Y(Q))}else{var se=this.ml0/this.a+We,me=cu(se,this.e0,this.e1,this.e2,this.e3);if(n(n(me)-mi)<=kr)return pe.x=this.long0,pe.y=mi,0>We&&(pe.y*=-1),pe;var Te=hh(this.a,this.e,V(me)),He=Te*Te*Te/this.a/this.a*(1-this.es),Ye=s(G(me),2),ot=Fe*this.a/Te,Ct=ot*ot;bt=me-Te*G(me)/He*ot*ot*(.5-(1+3*Ye)*ot*ot/24),ne=ot*(1-Ct*(Ye/3+(1+3*Ye)*Ye*Ct/15))/Y(me)}return pe.x=Bt(ne+this.long0),pe.y=sd(bt),pe},names:["Cassini","Cassini_Soldner","cass"]},Ph=function(pe,Fe){var We;return 1e-7this.lat0?this.S_POLE:this.N_POLE:n(pe)kr?(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*X(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(pe){var Fe=pe.x,We=pe.y;this.sin_phi=V(We),this.cos_phi=Y(We);var bt=Ph(this.e3,this.sin_phi,this.cos_phi),ne=this.a*X(this.c-this.ns0*bt)/this.ns0,Q=this.ns0*Bt(Fe-this.long0),se=ne*V(Q)+this.x0,me=this.rh-ne*Y(Q)+this.y0;return pe.x=se,pe.y=me,pe},inverse:function(pe){var Fe,We,bt,ne,Q,se;return pe.x-=this.x0,pe.y=this.rh-pe.y+this.y0,0<=this.ns0?(Fe=X(pe.x*pe.x+pe.y*pe.y),bt=1):(Fe=-X(pe.x*pe.x+pe.y*pe.y),bt=-1),ne=0,Fe!==0&&(ne=S(bt*pe.x,bt*pe.y)),bt=Fe*this.ns0/this.a,this.sphere?se=p((this.c-bt*bt)/(2*this.ns0)):(We=(this.c-bt*bt)/this.ns0,se=this.phi1z(this.e3,We)),Q=Bt(ne/this.ns0+this.long0),pe.x=Q,pe.y=se,pe},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(pe,Fe){var We=dh(.5*Fe),bt,ne,Q,se,me;if(pe=Te;Te++)if(bt=V(We),ne=Y(We),Q=pe*bt,se=1-Q*Q,me=.5*se*se/ne*(Fe/(1-pe*pe)-bt/se+.5/pe*r((1-Q)/(1+Q))),We+=me,1e-7>=n(me))return We;return null}},pl={init:function(){this.sin_p14=V(this.lat0),this.cos_p14=Y(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(pe){var Fe=pe.x,We=pe.y,bt,ne,Q,se,me,Te,He,Ye;return Q=Bt(Fe-this.long0),bt=V(We),ne=Y(We),se=Y(Q),Te=this.sin_p14*bt+this.cos_p14*ne*se,me=1,0n(n(Fe)-We))return 0>Fe?-1*mi:mi;for(var bt=p(.5*Fe),ne=0,Q,se,me,Te;30>ne;ne++)if(se=V(bt),me=Y(bt),Te=pe*se,Q=s(1-Te*Te,2)/(2*me)*(Fe/(1-pe*pe)-se/(1-Te*Te)+.5/pe*r((1-Te)/(1+Te))),bt+=Q,1e-10>=n(Q))return bt;return NaN},Og={init:function(){this.sphere||(this.k0=ws(this.e,V(this.lat_ts),Y(this.lat_ts)))},forward:function(pe){var Fe=pe.x,We=pe.y,bt=Bt(Fe-this.long0),ne,Q;if(this.sphere)ne=this.x0+this.a*bt*Y(this.lat_ts),Q=this.y0+this.a*V(We)/Y(this.lat_ts);else{var se=Ph(this.e,V(We));ne=this.x0+this.a*this.k0*bt,Q=this.y0+.5*(this.a*se)/this.k0}return pe.x=ne,pe.y=Q,pe},inverse:function(pe){pe.x-=this.x0,pe.y-=this.y0;var Fe,We;return this.sphere?(Fe=Bt(this.long0+pe.x/this.a/Y(this.lat_ts)),We=p(pe.y/this.a*Y(this.lat_ts))):(We=tf(this.e,2*pe.y*this.k0/this.a),Fe=Bt(this.long0+pe.x/(this.a*this.k0))),pe.x=Fe,pe.y=We,pe},names:["cea"]},ta={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=Y(this.lat_ts)},forward:function(pe){var Fe=pe.x,We=pe.y,bt=Bt(Fe-this.long0),ne=sd(We-this.lat0);return pe.x=this.x0+this.a*bt*this.rc,pe.y=this.y0+this.a*ne,pe},inverse:function(pe){var Fe=pe.x,We=pe.y;return pe.x=Bt(this.long0+(Fe-this.x0)/(this.a*this.rc)),pe.y=sd(this.lat0+(We-this.y0)/this.a),pe},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},bp={init:function(){this.temp=this.b/this.a,this.es=1-s(this.temp,2),this.e=X(this.es),this.e0=_p(this.es),this.e1=nd(this.es),this.e2=Zp(this.es),this.e3=$l(this.es),this.ml0=this.a*ec(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(pe){var Fe=pe.x,We=pe.y,bt=Bt(Fe-this.long0),ne,Q,se;if(se=bt*V(We),this.sphere)n(We)<=kr?(ne=this.a*bt,Q=-1*this.a*this.lat0):(ne=this.a*V(se)/G(We),Q=this.a*(sd(We-this.lat0)+(1-Y(se))/G(We)));else if(n(We)<=kr)ne=this.a*bt,Q=-1*this.ml0;else{var me=hh(this.a,this.e,V(We))/G(We);ne=me*V(se),Q=this.a*ec(this.e0,this.e1,this.e2,this.e3,We)-this.ml0+me*(1-Y(se))}return pe.x=ne+this.x0,pe.y=Q+this.y0,pe},inverse:function(pe){var Fe,We,bt,ne,Q,se,me,Te,He;if(bt=pe.x-this.x0,ne=pe.y-this.y0,this.sphere)if(n(ne+this.a*this.lat0)<=kr)Fe=Bt(bt/this.a+this.long0),We=0;else{se=this.lat0+ne/this.a,me=bt*bt/this.a/this.a+se*se,Te=se;var Ye;for(Q=20;Q;--Q)if(Ye=G(Te),He=-1*(se*(Te*Ye+1)-Te-.5*(Te*Te+me)*Ye)/((Te-se)/Ye-1),Te+=He,n(He)<=kr){We=Te;break}Fe=Bt(this.long0+p(bt*G(Te)/this.a)/V(We))}else if(n(ne+this.ml0)<=kr)We=0,Fe=Bt(this.long0+bt/this.a);else{se=(this.ml0+ne)/this.a,me=bt*bt/this.a/this.a+se*se,Te=se;var ot,Ct,Wt,pi,di;for(Q=20;Q;--Q)if(di=this.e*V(Te),ot=X(1-di*di)*G(Te),Ct=this.a*ec(this.e0,this.e1,this.e2,this.e3,Te),Wt=this.e0-2*this.e1*Y(2*Te)+4*this.e2*Y(4*Te)-6*this.e3*Y(6*Te),pi=Ct/this.a,He=(se*(ot*pi+1)-pi-.5*ot*(pi*pi+me))/(this.es*V(2*Te)*(pi*pi+me-2*se*pi)/(4*ot)+(se-pi)*(ot*Wt-2/V(2*Te))-Wt),Te-=He,n(He)<=kr){We=Te;break}ot=X(1-this.es*s(V(We),2))*G(We),Fe=Bt(this.long0+p(bt*ot/this.a)/V(We))}return pe.x=Fe,pe.y=We,pe},names:["Polyconic","poly"]},Us={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(pe){var Fe=pe.x,We=pe.y,bt=We-this.lat0,ne=Fe-this.long0,Q=1,se=0,me;for(me=1;10>=me;me++)Q*=1e-5*(bt/ar),se+=this.A[me]*Q;var Te=se,He=ne,Ye=1,ot=0,Ct=0,Wt=0,pi,di;for(me=1;6>=me;me++)pi=Ye*Te-ot*He,di=ot*Te+Ye*He,Ye=pi,ot=di,Ct=Ct+this.B_re[me]*Ye-this.B_im[me]*ot,Wt=Wt+this.B_im[me]*Ye+this.B_re[me]*ot;return pe.x=Wt*this.a+this.x0,pe.y=Ct*this.a+this.y0,pe},inverse:function(pe){var Fe=pe.x,We=pe.y,bt=Fe-this.x0,ne=We-this.y0,Q=ne/this.a,se=bt/this.a,me=1,Te=0,He=0,Ye=0,ot,Ct,Wt;for(ot=1;6>=ot;ot++)Ct=me*Q-Te*se,Wt=Te*Q+me*se,me=Ct,Te=Wt,He=He+this.C_re[ot]*me-this.C_im[ot]*Te,Ye=Ye+this.C_im[ot]*me+this.C_re[ot]*Te;for(var pi=0;pi=ot;ot++)tr=di*He-Oi*Ye,Sr=Oi*He+di*Ye,di=tr,Oi=Sr,zi+=(ot-1)*(this.B_re[ot]*di-this.B_im[ot]*Oi),sr+=(ot-1)*(this.B_im[ot]*di+this.B_re[ot]*Oi);di=1,Oi=0;var lr=this.B_re[1],qr=this.B_im[1];for(ot=2;6>=ot;ot++)tr=di*He-Oi*Ye,Sr=Oi*He+di*Ye,di=tr,Oi=Sr,lr+=ot*(this.B_re[ot]*di-this.B_im[ot]*Oi),qr+=ot*(this.B_im[ot]*di+this.B_re[ot]*Oi);var tn=lr*lr+qr*qr;He=(zi*lr+sr*qr)/tn,Ye=(sr*lr-zi*qr)/tn}var kn=He,Ds=Ye,Po=1,tl=0;for(ot=1;9>=ot;ot++)Po*=kn,tl+=this.D[ot]*Po;var Ks=this.lat0+1e5*(tl*ar),hs=this.long0+Ds;return pe.x=hs,pe.y=Ks,pe},names:["New_Zealand_Map_Grid","nzmg"]},Xs={init:function(){},forward:function(pe){var Fe=pe.x,We=pe.y,bt=Bt(Fe-this.long0),ne=this.x0+this.a*bt,Q=this.y0+1.25*(this.a*r(G(O/4+We/2.5)));return pe.x=ne,pe.y=Q,pe},inverse:function(pe){pe.x-=this.x0,pe.y-=this.y0;var Fe=Bt(this.long0+pe.x/this.a),We=2.5*(L(N(.8*pe.y/this.a))-O/4);return pe.x=Fe,pe.y=We,pe},names:["Miller_Cylindrical","mill"]},Ql={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=X((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=fi(this.es)},forward:function(pe){var Fe=pe.x,We=pe.y,bt,ne;if(Fe=Bt(Fe-this.long0),this.sphere){if(!this.m)We=this.n===1?We:p(this.n*V(We));else for(var Q=this.n*V(We),se=20,me;se&&(me=(this.m*We+V(We)-Q)/(this.m+Y(We)),We-=me,!(n(me)O&&(bt=O),We=(2*Fe+V(2*Fe))/O,1bt&&(pi=-pi),ne=this.x0+pi;var di=Te+ot;return pi=O*this.R*(Ct*di-me*X((Wt+Te)*(Te+1)-di*di))/(Wt+Te),Q=0<=We?this.y0+pi:this.y0-pi,pe.x=ne,pe.y=Q,pe},inverse:function(pe){var Fe,We,bt,ne,Q,se,me,Te,He,Ye,ot,Ct,Wt;return pe.x-=this.x0,pe.y-=this.y0,ot=O*this.R,bt=pe.x/ot,ne=pe.y/ot,Q=bt*bt+ne*ne,se=-n(ne)*(1+Q),me=se-2*ne*ne+bt*bt,Te=-2*se+1+2*ne*ne+Q*Q,Wt=ne*ne/Te+(2*me*me*me/Te/Te/Te-9*se*me/Te/Te)/27,He=(se-me*me/3/Te)/Te,Ye=2*X(-He/3),ot=3*Wt/He/Ye,12*mi*this.a?void 0:(We=Fe/this.a,bt=V(We),ne=Y(We),Q=this.long0,n(Fe)<=kr?se=this.lat0:(se=dh(ne*this.sin_p12+pe.y*bt*this.cos_p12/Fe),me=n(this.lat0)-mi,Q=n(me)<=kr?0<=this.lat0?Bt(this.long0+S(pe.x,-pe.y)):Bt(this.long0-S(-pe.x,pe.y)):Bt(this.long0+S(pe.x*bt,Fe*this.cos_p12*ne-pe.y*this.sin_p12*bt))),pe.x=Q,pe.y=se,pe)):(Te=_p(this.es),He=nd(this.es),Ye=Zp(this.es),ot=$l(this.es),n(this.sin_p12-1)<=kr?(Ct=this.a*ec(Te,He,Ye,ot,mi),Fe=X(pe.x*pe.x+pe.y*pe.y),Wt=Ct-Fe,se=cu(Wt/this.a,Te,He,Ye,ot),Q=Bt(this.long0+S(pe.x,-1*pe.y)),pe.x=Q,pe.y=se,pe):n(this.sin_p12+1)<=kr?(Ct=this.a*ec(Te,He,Ye,ot,mi),Fe=X(pe.x*pe.x+pe.y*pe.y),Wt=Fe-Ct,se=cu(Wt/this.a,Te,He,Ye,ot),Q=Bt(this.long0+S(pe.x,pe.y)),pe.x=Q,pe.y=se,pe):(Fe=X(pe.x*pe.x+pe.y*pe.y),Oi=S(pe.x,pe.y),pi=hh(this.a,this.e,this.sin_p12),zi=Y(Oi),sr=this.e*this.cos_p12*zi,tr=-sr*sr/(1-this.es),Sr=3*this.es*(1-tr)*this.sin_p12*this.cos_p12*zi/(1-this.es),lr=Fe/pi,qr=lr-tr*(1+tr)*s(lr,3)/6-Sr*(1+3*tr)*s(lr,4)/24,tn=1-tr*qr*qr/2-lr*qr*qr*qr/6,di=p(this.sin_p12*Y(qr)+this.cos_p12*V(qr)*zi),Q=Bt(this.long0+p(V(Oi)*V(qr)/Y(di))),kn=V(di),se=S((kn-this.es*tn*this.sin_p12)*G(di),kn*(1-this.es)),pe.x=Q,pe.y=se,pe))},names:["Azimuthal_Equidistant","aeqd"]},yu={init:function(){this.sin_p14=V(this.lat0),this.cos_p14=Y(this.lat0)},forward:function(pe){var Fe=pe.x,We=pe.y,bt,ne,Q,se,me,Te,He,Ye;return Q=Bt(Fe-this.long0),bt=V(We),ne=Y(We),se=Y(Q),Te=this.sin_p14*bt+this.cos_p14*ne*se,me=1,(0=mi-En/2?eu.TOP:this.lat0<=-(mi-En/2)?eu.BOTTOM:n(this.long0)<=En?eu.FRONT:n(this.long0)<=mi+En?0=En&&ne<=mi+En?(We.value=Wa.AREA_0,Q=ne-mi):ne>mi+En||ne<=-(mi+En)?(We.value=Wa.AREA_1,Q=0-(mi+En)&&ne<=-En?(We.value=Wa.AREA_2,Q=ne+mi):(We.value=Wa.AREA_3,Q=ne);else if(this.face===eu.BOTTOM)se=mi+bt,ne>=En&&ne<=mi+En?(We.value=Wa.AREA_0,Q=-ne+mi):ne=-En?(We.value=Wa.AREA_1,Q=-ne):ne<-En&&ne>=-(mi+En)?(We.value=Wa.AREA_2,Q=-ne-mi):(We.value=Wa.AREA_3,Q=0=n(pe.y)?We.value=Wa.AREA_0:0<=pe.y&&pe.y>=n(pe.x)?(We.value=Wa.AREA_1,bt-=mi):0>pe.x&&-pe.x>=n(pe.y)?(We.value=Wa.AREA_2,bt=0>bt?bt+$i:bt-$i):(We.value=Wa.AREA_3,bt+=mi),ot=$i/12*G(bt),me=V(ot)/(Y(ot)-1/X(2)),Te=L(me),Q=Y(bt),se=G(ne),He=1-Q*Q*se*se*(1-Y(L(1/Y(Te)))),-1>He?He=-1:1Te?Te+$i:Te-$i:We.value===Wa.AREA_2?Te-mi:Te;else if(this.face===eu.BOTTOM)Ye=y(He),Fe.phi=Ye-mi,Fe.lam=We.value===Wa.AREA_0?-Te+mi:We.value===Wa.AREA_1?-Te:We.value===Wa.AREA_2?-Te-mi:0>Te?-Te-$i:-Te+$i;else{var Ct,Wt,pi;Ct=He,ot=Ct*Ct,pi=1<=ot?0:X(1-ot)*V(Te),ot+=pi*pi,Wt=1<=ot?0:X(1-ot),We.value===Wa.AREA_1?(ot=Wt,Wt=-pi,pi=ot):We.value===Wa.AREA_2?(Wt=-Wt,pi=-pi):We.value===Wa.AREA_3&&(ot=Wt,Wt=pi,pi=-ot),this.face===eu.RIGHT?(ot=Ct,Ct=-Wt,Wt=ot):this.face===eu.BACK?(Ct=-Ct,Wt=-Wt):this.face===eu.LEFT&&(ot=Ct,Ct=Wt,Wt=-ot),Fe.phi=y(-pi)-mi,Fe.lam=S(Wt,Ct),this.face===eu.RIGHT?Fe.lam=Xt(Fe.lam,-mi):this.face===eu.BACK?Fe.lam=Xt(Fe.lam,-$i):this.face===eu.LEFT&&(Fe.lam=Xt(Fe.lam,+mi))}if(this.es!==0){var di,Oi,zi;di=0>Fe.phi?1:0,Oi=G(Fe.phi),zi=this.b/X(Oi*Oi+this.one_minus_f_squared),Fe.phi=L(X(this.a*this.a-zi*zi)/(this.one_minus_f*zi)),di&&(Fe.phi=-Fe.phi)}return Fe.lam+=this.long0,pe.x=Fe.lam,pe.y=Fe.phi,pe},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},tc=[[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]],Bl=[[-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]],Oc=.8487,Xm=1.3523,Xd=Hn/5,Tf=function(pe,Fe){return pe[0]+Fe*(pe[1]+Fe*(pe[2]+Fe*pe[3]))},Py=function(pe,Fe){return pe[1]+Fe*(2*pe[2]+3*Fe*pe[3])},Rg={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(pe){var Fe=Bt(pe.x-this.long0),We=n(pe.y),bt=i(We*Xd);0>bt?bt=0:18<=bt&&(bt=17),We=Hn*(We-1/Xd*bt);var ne={x:Tf(tc[bt],We)*Fe,y:Tf(Bl[bt],We)};return 0>pe.y&&(ne.y=-ne.y),ne.x=ne.x*this.a*Oc+this.x0,ne.y=ne.y*this.a*Xm+this.y0,ne},inverse:function(pe){var Fe={x:(pe.x-this.x0)/(this.a*Oc),y:n(pe.y-this.y0)/(this.a*Xm)};if(1<=Fe.y)Fe.x/=tc[18][0],Fe.y=0>pe.y?-mi:mi;else{var We=i(18*Fe.y);for(0>We?We=0:18<=We&&(We=17);;)if(Bl[We][0]>Fe.y)--We;else if(Bl[We+1][0]<=Fe.y)++We;else break;var bt=Bl[We],ne=5*(Fe.y-bt[0])/(Bl[We+1][0]-bt[0]);ne=ti(function(Q){return(Tf(bt,Q)-Fe.y)/Py(bt,Q)},ne,kr,100),Fe.x/=Tf(tc[We],ne),Fe.y=(5*We+ne)*is,0>pe.y&&(Fe.y=-Fe.y)}return Fe.x=Bt(Fe.x+this.long0),Fe},names:["Robinson","robin"]},Ht={init:function(){this.name="geocent"},forward:function(pe){var Fe=ce(pe,this.es,this.a);return Fe},inverse:function(pe){var Fe=Ce(pe,this.es,this.a,this.b);return Fe},names:["Geocentric","geocentric","geocent","Geocent"]},qt={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Ai={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}},ji={init:function(){if(Object.keys(Ai).forEach(function(We){if(typeof this[We]>"u")this[We]=Ai[We].def;else{if(Ai[We].num&&isNaN(this[We]))throw new Error("Invalid parameter value, must be numeric "+We+" = "+this[We]);Ai[We].num&&(this[We]=parseFloat(this[We]))}Ai[We].degrees&&(this[We]*=is)}.bind(this)),n(n(this.lat0)-mi)this.lat0?qt.S_POLE:qt.N_POLE:n(this.lat0)=this.pn1||1e10 */var v=l("buffer"),S=v.Buffer;S.from&&S.alloc&&S.allocUnsafe&&S.allocUnsafeSlow?c.exports=v:(p(v,d),d.Buffer=y),y.prototype=Object.create(S.prototype),p(S,y),y.from=function(I,O,L){if(typeof I=="number")throw new TypeError("Argument must not be a number");return S(I,O,L)},y.alloc=function(I,O,L){if(typeof I!="number")throw new TypeError("Argument must be a number");var N=S(I);return O===void 0?N.fill(0):typeof L=="string"?N.fill(O,L):N.fill(O),N},y.allocUnsafe=function(I){if(typeof I!="number")throw new TypeError("Argument must be a number");return S(I)},y.allocUnsafeSlow=function(I){if(typeof I!="number")throw new TypeError("Argument must be a number");return v.SlowBuffer(I)}},{buffer:8}],19:[function(l,c,d){function p(ge){if(!ge)return"utf8";for(var _e;;)switch(ge){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 ge;default:if(_e)return;ge=(""+ge).toLowerCase(),_e=!0}}function y(ge){var _e=p(ge);if(typeof _e!="string"&&(re.isEncoding===fe||!fe(ge)))throw new Error("Unknown encoding: "+ge);return _e||ge}function v(ge){this.encoding=y(ge);var _e;switch(this.encoding){case"utf16le":this.text=N,this.end=G,_e=4;break;case"utf8":this.fillLast=L,_e=4;break;case"base64":this.text=V,this.end=Y,_e=3;break;default:return this.write=X,void(this.end=te)}this.lastNeed=0,this.lastTotal=0,this.lastChar=re.allocUnsafe(_e)}function S(ge){return 127>=ge?0:ge>>5==6?2:ge>>4==14?3:ge>>3==30?4:ge>>6==2?-1:-2}function I(ge,_e,Ie){var ke=_e.length-1;if(ke=ke)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=ge[ge.length-2],this.lastChar[1]=ge[ge.length-1],Ie.slice(0,-1)}return Ie}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=ge[ge.length-1],ge.toString("utf16le",_e,ge.length-1)}function G(ge){var _e=ge&&ge.length?this.write(ge):"";if(this.lastNeed){var Ie=this.lastTotal-this.lastNeed;return _e+this.lastChar.toString("utf16le",0,Ie)}return _e}function V(ge,_e){var Ie=(ge.length-_e)%3;return Ie==0?ge.toString("base64",_e):(this.lastNeed=3-Ie,this.lastTotal=3,Ie==1?this.lastChar[0]=ge[ge.length-1]:(this.lastChar[0]=ge[ge.length-2],this.lastChar[1]=ge[ge.length-1]),ge.toString("base64",_e,ge.length-Ie))}function Y(ge){var _e=ge&&ge.length?this.write(ge):"";return this.lastNeed?_e+this.lastChar.toString("base64",0,3-this.lastNeed):_e}function X(ge){return ge.toString(this.encoding)}function te(ge){return ge&&ge.length?this.write(ge):""}var re=l("safe-buffer").Buffer,fe=re.isEncoding||function(ge){switch(ge=""+ge,ge&&ge.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}};d.StringDecoder=v,v.prototype.write=function(ge){if(ge.length===0)return"";var _e,Ie;if(this.lastNeed){if(_e=this.fillLast(ge),_e===void 0)return"";Ie=this.lastNeed,this.lastNeed=0}else Ie=0;return Iegt||57343=gt)ii.push(65533);else if(55296<=gt&&56319>=gt)if(At===Ve-1)ii.push(65533);else{var Ue=yt.charCodeAt(At+1);56320<=Ue&&57343>=Ue?(ii.push(65536+((1023>)<<10)+(1023&Ue)),At+=1):ii.push(65533)}At+=1}return ii}function I(Ze){for(var yt="",Ve=0,At;Ve=At?yt+=o(At):(At-=65536,yt+=o((At>>10)+55296,(1023&At)+56320));return yt}function O(Ze){return 0<=Ze&&127>=Ze}function L(Ze){this.tokens=[].slice.call(Ze),this.tokens.reverse()}function N(Ze,yt){if(Ze)throw TypeError("Decoder error");return yt||65533}function G(Ze){throw TypeError("The code point "+Ze+" could not be encoded.")}function V(Ze){return Ze=(Ze+"").trim().toLowerCase(),Object.prototype.hasOwnProperty.call(it,Ze)?it[Ze]:null}function Y(Ze,yt){return yt&&yt[Ze]||null}function X(Ze,yt){var Ve=yt.indexOf(Ze);return Ve===-1?null:Ve}function te(Ze){if(!("encoding-indexes"in d))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return d["encoding-indexes"][Ze]}function re(Ze){if(39419Ze||1237575>6*At)+ii];0>6*(At-1);gt.push(128|63&Ue),At-=1}return gt}}function he(Ze,yt){var Ve=yt.fatal;this.handler=function(At,ii){if(ii===-1)return-1;if(O(ii))return ii;var gt=Ze[ii-128];return gt===null?N(Ve):gt}}function xe(Ze,yt){yt.fatal,this.handler=function(Ve,At){if(At===-1)return-1;if(kt(At))return At;var ii=X(At,Ze);return ii===null&&G(At),ii+128}}function Pe(Ze){var yt=Ze.fatal,Ve=0,At=0,ii=0;this.handler=function(gt,Ue){if(Ue===-1&&Ve===0&&At===0&&ii===0)return-1;Ue===-1&&(Ve!==0||At!==0||ii!==0)&&(Ve=0,At=0,ii=0,N(yt));var ni;if(ii!==0){ni=null,p(Ue,48,57)&&(ni=re(10*(126*(10*(Ve-129)+At-48)+ii-129)+Ue-48));var A=[At,ii,Ue];return Ve=0,At=0,ii=0,ni===null?(gt.prepend(A),N(yt)):ni}if(At!==0)return p(Ue,129,254)?(ii=Ue,null):(gt.prepend([At,Ue]),Ve=0,At=0,N(yt));if(Ve!==0){if(p(Ue,48,57))return At=Ue,null;var ve=Ve,W=null;Ve=0;var T=127>Ue?64:65;return(p(Ue,64,126)||p(Ue,128,254))&&(W=190*(ve-129)+(Ue-T)),ni=W===null?null:Y(W,te("gb18030")),ni===null&&O(Ue)&>.prepend(Ue),ni===null?N(yt):ni}return O(Ue)?Ue:Ue===128?8364:p(Ue,129,254)?(Ve=Ue,null):N(yt)}}function Oe(Ze,yt){Ze.fatal,this.handler=function(Ve,At){if(At===-1)return-1;if(kt(At))return At;if(At===58853)return G(At);if(yt&&At===8364)return 128;var ii=X(At,te("gb18030"));if(ii!==null){var gt=mt(ii/190)+129,Ue=ii%190,ni=63>Ue?64:65;return[gt,Ue+ni]}if(yt)return G(At);ii=fe(At);var A=mt(ii/10/126/10);ii-=10*(126*(10*A));var ve=mt(ii/10/126);ii-=126*(10*ve);var W=mt(ii/10),T=ii-10*W;return[A+129,ve+48,W+129,T+48]}}function Ae(Ze){var yt=Ze.fatal,Ve=0;this.handler=function(At,ii){if(ii===-1&&Ve!==0)return Ve=0,N(yt);if(ii===-1&&Ve===0)return-1;if(Ve!==0){var gt=Ve,Ue=null;Ve=0;var ni=127>ii?64:98;switch((p(ii,64,126)||p(ii,161,254))&&(Ue=157*(gt-129)+(ii-ni)),Ue){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var A=Ue===null?null:Y(Ue,te("big5"));return A===null&&O(ii)&&At.prepend(ii),A===null?N(yt):A}return O(ii)?ii:p(ii,129,254)?(Ve=ii,null):N(yt)}}function ze(Ze){Ze.fatal,this.handler=function(yt,Ve){if(Ve===-1)return-1;if(kt(Ve))return Ve;var At=_e(Ve);if(At===null)return G(Ve);var ii=mt(At/157)+129;if(161>ii)return G(Ve);var gt=At%157,Ue=63>gt?64:98;return[ii,gt+Ue]}}function Ge(Ze){var yt=Ze.fatal,Ve=!1,At=0;this.handler=function(ii,gt){if(gt===-1&&At!==0)return At=0,N(yt);if(gt===-1&&At===0)return-1;if(At===142&&p(gt,161,223))return At=0,65216+gt;if(At===143&&p(gt,161,254))return Ve=!0,At=gt,null;if(At!==0){var Ue=At;At=0;var ni=null;return p(Ue,161,254)&&p(gt,161,254)&&(ni=Y(94*(Ue-161)+(gt-161),te(Ve?"jis0212":"jis0208"))),Ve=!1,p(gt,161,254)||ii.prepend(gt),ni===null?N(yt):ni}return O(gt)?gt:gt===142||gt===143||p(gt,161,254)?(At=gt,null):N(yt)}}function Je(Ze){Ze.fatal,this.handler=function(yt,Ve){if(Ve===-1)return-1;if(kt(Ve))return Ve;if(Ve===165)return 92;if(Ve===8254)return 126;if(p(Ve,65377,65439))return[142,Ve-65377+161];Ve===8722&&(Ve=65293);var At=X(Ve,te("jis0208"));if(At===null)return G(Ve);var ii=mt(At/94)+161;return[ii,At%94+161]}}function et(Ze){var yt=Ze.fatal,Ve={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},At=Ve.ASCII,ii=Ve.ASCII,gt=0,Ue=!1;this.handler=function(ni,A){switch(At){default:case Ve.ASCII:return A===27?(At=Ve.EscapeStart,null):p(A,0,127)&&A!==14&&A!==15&&A!==27?(Ue=!1,A):A===-1?-1:(Ue=!1,N(yt));case Ve.Roman:return A===27?(At=Ve.EscapeStart,null):A===92?(Ue=!1,165):A===126?(Ue=!1,8254):p(A,0,127)&&A!==14&&A!==15&&A!==27&&A!==92&&A!==126?(Ue=!1,A):A===-1?-1:(Ue=!1,N(yt));case Ve.Katakana:return A===27?(At=Ve.EscapeStart,null):p(A,33,95)?(Ue=!1,65344+A):A===-1?-1:(Ue=!1,N(yt));case Ve.LeadByte:return A===27?(At=Ve.EscapeStart,null):p(A,33,126)?(Ue=!1,gt=A,At=Ve.TrailByte,null):A===-1?-1:(Ue=!1,N(yt));case Ve.TrailByte:if(A===27)return At=Ve.EscapeStart,N(yt);if(p(A,33,126)){At=Ve.LeadByte;var ve=94*(gt-33)+A-33,W=Y(ve,te("jis0208"));return W===null?N(yt):W}return A===-1?(At=Ve.LeadByte,ni.prepend(A),N(yt)):(At=Ve.LeadByte,N(yt));case Ve.EscapeStart:return A===36||A===40?(gt=A,At=Ve.Escape,null):(ni.prepend(A),Ue=!1,At=ii,N(yt));case Ve.Escape:var T=gt;gt=0;var b=null;if(T===40&&A===66&&(b=Ve.ASCII),T===40&&A===74&&(b=Ve.Roman),T===40&&A===73&&(b=Ve.Katakana),T===36&&(A===64||A===66)&&(b=Ve.LeadByte),b!==null){At=At=b;var m=Ue;return Ue=!0,m?N(yt):null}return ni.prepend([T,A]),Ue=!1,At=ii,N(yt)}}}function tt(Ze){Ze.fatal;var yt={ASCII:0,Roman:1,jis0208:2},Ve=yt.ASCII;this.handler=function(At,ii){if(ii===-1&&Ve!==yt.ASCII)return At.prepend(ii),Ve=yt.ASCII,[27,40,66];if(ii===-1&&Ve===yt.ASCII)return-1;if((Ve===yt.ASCII||Ve===yt.Roman)&&(ii===14||ii===15||ii===27))return G(65533);if(Ve===yt.ASCII&&kt(ii))return ii;if(Ve===yt.Roman&&(kt(ii)&&ii!==92&&ii!==126||ii==165||ii==8254)){if(kt(ii))return ii;if(ii===165)return 92;if(ii===8254)return 126}if(kt(ii)&&Ve!==yt.ASCII)return At.prepend(ii),Ve=yt.ASCII,[27,40,66];if((ii===165||ii===8254)&&Ve!==yt.Roman)return At.prepend(ii),Ve=yt.Roman,[27,40,74];ii===8722&&(ii=65293);var gt=X(ii,te("jis0208"));if(gt===null)return G(ii);if(Ve!==yt.jis0208)return At.prepend(ii),Ve=yt.jis0208,[27,36,66];var Ue=mt(gt/94)+33;return[Ue,gt%94+33]}}function ft(Ze){var yt=Ze.fatal,Ve=0;this.handler=function(At,ii){if(ii===-1&&Ve!==0)return Ve=0,N(yt);if(ii===-1&&Ve===0)return-1;if(Ve!==0){var gt=Ve,Ue=null;Ve=0;var ni=127>ii?64:65,A=160>gt?129:193;if((p(ii,64,126)||p(ii,128,252))&&(Ue=188*(gt-A)+ii-ni),p(Ue,8836,10715))return 48508+Ue;var ve=Ue===null?null:Y(Ue,te("jis0208"));return ve===null&&O(ii)&&At.prepend(ii),ve===null?N(yt):ve}return O(ii)||ii===128?ii:p(ii,161,223)?65216+ii:p(ii,129,159)||p(ii,224,252)?(Ve=ii,null):N(yt)}}function Pt(Ze){Ze.fatal,this.handler=function(yt,Ve){if(Ve===-1)return-1;if(kt(Ve)||Ve===128)return Ve;if(Ve===165)return 92;if(Ve===8254)return 126;if(p(Ve,65377,65439))return Ve-65377+161;Ve===8722&&(Ve=65293);var At=ge(Ve);if(At===null)return G(Ve);var ii=mt(At/188),gt=31>ii?129:193,Ue=At%188,ni=63>Ue?64:65;return[ii+gt,Ue+ni]}}function $t(Ze){var yt=Ze.fatal,Ve=0;this.handler=function(At,ii){if(ii===-1&&Ve!==0)return Ve=0,N(yt);if(ii===-1&&Ve===0)return-1;if(Ve!==0){var gt=Ve,Ue=null;Ve=0,p(ii,65,254)&&(Ue=190*(gt-129)+(ii-65));var ni=Ue===null?null:Y(Ue,te("euc-kr"));return Ue===null&&O(ii)&&At.prepend(ii),ni===null?N(yt):ni}return O(ii)?ii:p(ii,129,254)?(Ve=ii,null):N(yt)}}function St(Ze){Ze.fatal,this.handler=function(yt,Ve){if(Ve===-1)return-1;if(kt(Ve))return Ve;var At=X(Ve,te("euc-kr"));if(At===null)return G(Ve);var ii=mt(At/190)+129;return[ii,At%190+65]}}function Tt(Ze,yt){var Ve=Ze>>8,At=255&Ze;return yt?[Ve,At]:[At,Ve]}function Lt(Ze,yt){var Ve=yt.fatal,At=null,ii=null;this.handler=function(gt,Ue){if(Ue===-1&&(At!==null||ii!==null))return N(Ve);if(Ue===-1&&At===null&&ii===null)return-1;if(At===null)return At=Ue,null;var ni;if(ni=Ze?(At<<8)+Ue:(Ue<<8)+At,At=null,ii!==null){var A=ii;return ii=null,p(ni,56320,57343)?65536+1024*(A-55296)+(ni-56320):(gt.prepend(Tt(ni,Ze)),N(Ve))}return p(ni,55296,56319)?(ii=ni,null):p(ni,56320,57343)?N(Ve):ni}}function at(Ze,yt){yt.fatal,this.handler=function(Ve,At){if(At===-1)return-1;if(p(At,0,65535))return Tt(At,Ze);var ii=Tt((At-65536>>10)+55296,Ze),gt=Tt((1023&At-65536)+56320,Ze);return ii.concat(gt)}}function Ee(Ze){Ze.fatal,this.handler=function(yt,Ve){return Ve===-1?-1:O(Ve)?Ve:63360+Ve-128}}function Be(Ze){Ze.fatal,this.handler=function(yt,Ve){return Ve===-1?-1:kt(Ve)?Ve:p(Ve,63360,63487)?Ve-63360+128:G(Ve)}}typeof c<"u"&&c.exports&&!d["encoding-indexes"]&&l("./encoding-indexes.js");var mt=i,kt=O,ct=-1;L.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():ct},prepend:function(Ze){if(Array.isArray(Ze))for(var yt=Ze;yt.length;)this.tokens.push(yt.pop());else this.tokens.push(Ze)},push:function(Ze){if(Array.isArray(Ze))for(var yt=Ze;yt.length;)this.tokens.unshift(yt.shift());else this.tokens.unshift(Ze)}};var le=[{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"}],it={};le.forEach(function(Ze){Ze.encodings.forEach(function(yt){yt.labels.forEach(function(Ve){it[Ve]=yt})})});var pt={},Le={},ce,Ce;Object.defineProperty&&(Object.defineProperty(Ie.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(Ie.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(Ie.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),Ie.prototype.decode=function(Ze,yt){var Ve;Ve=typeof Ze=="object"&&Ze instanceof ArrayBuffer?new Uint8Array(Ze):typeof Ze=="object"&&"buffer"in Ze&&Ze.buffer instanceof ArrayBuffer?new Uint8Array(Ze.buffer,Ze.byteOffset,Ze.byteLength):new Uint8Array(0),yt=v(yt),this._do_not_flush||(this._decoder=Le[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=!!yt.stream;for(var At=new L(Ve),ii=[],gt,Ue;Ue=At.read(),Ue!==ct&&(gt=this._decoder.handler(At,Ue),gt!==-1);)gt!==null&&(Array.isArray(gt)?ii.push.apply(ii,gt):ii.push(gt));if(!this._do_not_flush){do{if(gt=this._decoder.handler(At,At.read()),gt===-1)break;gt!==null&&(Array.isArray(gt)?ii.push.apply(ii,gt):ii.push(gt))}while(!At.endOfStream());this._decoder=null}return function(ni){return!y(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)||this._ignoreBOM||this._BOMseen||(0arguments.length)&&O.call(arguments,1);return L[V]=!0,S(function(){L[V]&&(Y?G.apply(null,Y):G.call(null),d.clearImmediate(V))}),V},d.clearImmediate=typeof y=="function"?y:function(G){delete L[G]}}).call(this)}).call(this,l("timers").setImmediate,l("timers").clearImmediate)},{"process/browser.js":16,timers:22}],23:[function(l,c){(function(d){(function(){function p(Ie){if(!Ie)throw new Error("forgot to pass buffer");return X.isBuffer(Ie)?Ie:y(Ie)?X.from(Ie):y(Ie.buffer)?Ie.BYTES_PER_ELEMENT===1?X.from(Ie):X.from(Ie.buffer):void 0}function y(Ie){return Ie instanceof d.ArrayBuffer||Object.prototype.toString.call(Ie)==="[object ArrayBuffer]"}function v(Ie,ke){return typeof Ie=="string"&&re.has(Ie)?V.resolve(re.get(Ie)):v.getShapefile(Ie,ke).then(function(Ne){return typeof Ie=="string"&&re.set(Ie,Ne),Ne})}async function S(Ie,ke){const Ne=await L(Ie);return v.parseZip(Ne,ke)}let I=l("proj4");I.default&&(I=I.default);const O=l("./unzip"),L=l("./binaryajax"),N=l("./parseShp"),G=l("parsedbf"),V=l("lie"),Y=l("lru-cache"),X=l("buffer").Buffer,te=d.URL,re=new Y({max:20});v.combine=function([Ie,ke]){const Ne={type:"FeatureCollection",features:[]};let J=0;const he=Ie.length;for(ke||(ke=[]);J{const ke=await V.all([L(Ie,"shp"),L(Ie,"prj")]);let Ne=!1;try{ke[1]&&(Ne=I(ke[1]))}catch{Ne=!1}return N(ke[0],Ne)},ge=async Ie=>{const[ke,Ne]=await V.all([L(Ie,"dbf"),L(Ie,"cpg")]);return ke?G(ke,Ne):void 0},_e=(Ie,ke)=>new te(Ie).pathname.slice(-4).toLowerCase()===ke;v.getShapefile=async function(Ie,ke){if(typeof Ie!="string")return v.parseZip(Ie);if(_e(Ie,".zip"))return S(Ie,ke);const Ne=await V.all([fe(Ie),ge(Ie)]);return v.combine(Ne)},v.parseShp=function(Ie,ke){if(Ie=p(Ie),X.isBuffer(ke)&&(ke=ke.toString()),typeof ke=="string")try{ke=I(ke)}catch{ke=!1}return N(Ie,ke)},v.parseDbf=function(Ie,ke){return Ie=p(Ie),G(Ie,ke)},c.exports=v}).call(this)}).call(this,typeof kp>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:kp)},{"./binaryajax":2,"./parseShp":4,"./unzip":5,buffer:8,lie:12,"lru-cache":13,parsedbf:15,proj4:17}]},{},[23])(23)})})(KCi);const JCi={Point:"circlePoint",MultiPoint:"circlePoint",LineString:"solidLine",MultiLineString:"solidLine",Polygon:"outlinedPoly",MultiPolygon:"outlinedPoly"};function ZCi(t){if(t.type!=="FeatureCollection")throw new Error("GeoJSON is not in FeatureCollection format");let e=!0,i=!0;t.features.forEach((r,n)=>{Object.assign(r.properties,{ID_FILE:"",OBJECTID_FILE:""}),"id"in r&&typeof r.id<"u"&&(r.properties.ID_FILE=r.id,e=!1),"OBJECTID"in r.properties&&(r.properties.OBJECTID_FILE=r.properties.OBJECTID,delete r.properties.OBJECTID,i=!1),r.id=n+1}),e&&t.features.forEach(function(r){delete r.properties.ID_FILE}),i&&t.features.forEach(function(r){delete r.properties.OBJECTID_FILE})}function QCi(t,e){const i=r=>r.indexOf(" ")>-1;e.fields?.forEach(r=>{if(r.name&&i(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,t.features.forEach(l=>{l.properties[s]=l.properties[n],delete l.properties[n]})}})}function eTi(t,e){const i=t.features[e].geometry.geometries;if(i.length===1)t.features[e].geometry={type:i[0].type,coordinates:i[0].coordinates};else{const r=i.map(n=>n.coordinates);t.features[e].geometry={type:`Multi${i[0].type}`,coordinates:r}}}class tTi extends Np{async fetchFileData(e,i){const r=await LP.get(e,{responseType:"arraybuffer"});switch(i){case _n.GEOJSON:return JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(r.data)));case _n.SHAPEFILE:return r.data;case _n.CSV:return new TextDecoder("utf-8").decode(new Uint8Array(r.data));default:console.error(`Unsupported file type passed to fetchFileData- '${i}'`)}}extractGeoJsonFields(e){if(e.features.length<1)throw new Error("GeoJSON field extraction requires at least one feature");let i=e.features[0].geometry.type;if(e.features.forEach((o,a)=>{if(o.geometry.type==="GeometryCollection"){const c=o.geometry.geometries;if(c===void 0||c.length===0)return Promise.reject(new Error("GeoJSON file has geometry collection with missing/incomplete geometries"));i=c[0].type,c.forEach(d=>{if(d.type!==i)return Promise.reject(new Error("GeoJSON file has geometry collection containing multiple geometry types"))}),eTi(e,a)}}),[...new Set(e.features.map(o=>o.geometry.type==="MultiLineString"?"LineString":o.geometry.type==="MultiPolygon"?"Polygon":o.geometry.type))].length!==1)throw new Error("GeoJSON file contains multiple geometry types");const r=Object.keys(e.features[0].properties).map(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 c=r.findIndex(d=>d.name===a);r[c]={name:a,type:this.inferType(l)},s.splice(s.indexOf(a),1)}}),s.length===0)break;n++}return r}extractCsvFields(e,i=","){return R3e.dsv.dsvFormat(i).parseRows(e)[0].map(n=>({name:n,type:S1.STRING}))}filterCsvLatLonFields(e,i=","){const r=R3e.dsv.dsvFormat(i).parseRows(e),n=r[0],s={lat:JSON.parse(JSON.stringify(n)),lon:JSON.parse(JSON.stringify(n))};for(let o=0;o90)&&c!==-1&&s.lat.splice(c,1),(isNaN(l)||l<-180||l>180)&&d!==-1&&s.lon.splice(d,1),c===-1&&d===-1)break}return s}async geoJsonToEsriJson(e,i){let r,n="EPSG:4326",s;const o={objectIdField:"OBJECTID",fields:[{name:"OBJECTID",type:S1.OID}]};ZCi(e);const a=e.features[0].geometry.type,l=JCi[a],c=JSON.parse(JSON.stringify(TCi[l]));if(e.crs&&e.crs.type==="name"&&(n=e.crs.properties.name),i){if(i.sourceProjection&&(n=i.sourceProjection),i.targetSR)r=i.targetSR;else throw new Error("geoJsonToEsriJson - missing opts.targetSR arguement");i.layerId?s=i.layerId:s=this.$iApi.geo.shared.generateUUID(),i.colour&&(c.renderer.symbol.color=new LM(i.colour).toArcServer())}else throw new Error("geoJsonToEsriJson - missing opts arguement");o.renderer=Zv.fromJSON(c.renderer),o.fields=(o.fields||[]).concat(i.fieldMetadata?.exclusiveFields?this.extractGeoJsonFields(e).filter(v=>i.fieldMetadata?.fieldInfo?.find(S=>S.name===v.name)):this.extractGeoJsonFields(e)),QCi(e,o);const d=this.$iApi.geo.proj.normalizeProj(r);if(i){if(i.latField){const v=o.fields.find(S=>S.name===i.latField||S.alias===i.latField);v&&(v.type=S1.DOUBLE)}if(i.lonField){const v=o.fields.find(S=>S.name===i.lonField||S.alias===i.lonField);v&&(v.type=S1.DOUBLE)}}await this.$iApi.geo.proj.checkProjBomber([n,r]);const p=new rr(r);await this.$iApi.geo.proj.projectGeoJson(e,n,d);const y=I3e.convert(e,{sr:8888});return o.geometryType=this.$iApi.geo.geom.geoJsonGeomTypeToEsriGeomType(a),y.forEach(v=>{v.geometry.spatialReference=p,v.geometry.type=o.geometryType,Object.keys(v.attributes).forEach(S=>{(Array.isArray(v.attributes[S])||typeof v.attributes[S]=="object")&&v.attributes[S]!=null&&(v.attributes[S]="[Complex Value Removed]")})}),o.source=y,o.spatialReference=p,o.id=s,o}async csvToGeoJson(e,i){const r={latfield:"Lat",lonfield:"Long",delimiter:","};return i&&(i.latfield&&(r.latfield=i.latfield),i.lonfield&&(r.lonfield=i.lonfield),i.delimiter&&(r.delimiter=i.delimiter)),new Promise((n,s)=>{R3e.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 M3e(e)}inferType(e){return typeof e=="number"?S1.DOUBLE:S1.STRING}}const iTi=[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 pD(t,e){return t.then(function(i){return[null,i]}).catch(function(i){return e&&Object.assign(i,e),[i,void 0]})}var Zht={},Qht={},QT={};(function(t){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",i=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",r="["+e+"]["+i+"]*",n=new RegExp("^"+r+"$"),s=function(a,l){const c=[];let d=l.exec(a);for(;d;){const p=[],y=d.length;for(let v=0;v"u")};t.isExist=function(a){return typeof a<"u"},t.isEmptyObject=function(a){return Object.keys(a).length===0},t.merge=function(a,l,c){if(l){const d=Object.keys(l),p=d.length;for(let y=0;y1){r[o]=[];for(let a in t.child[o])t.child[o].hasOwnProperty(a)&&r[o].push(D3e(t.child[o][a],e,o))}else{const a=D3e(t.child[o][0],e,o),l=e.arrayMode===!0&&typeof a=="object"||pN.isTagNameInArrayMode(o,e.arrayMode,i);r[o]=l?[a]:a}}return r};Qht.convertToJson=D3e;var fN={},rTi=function(t,e,i){this.tagname=t,this.parent=e,this.child={},this.attrsMap={},this.val=i,this.addChild=function(r){Array.isArray(this.child[r.tagname])?this.child[r.tagname].push(r):this.child[r.tagname]=[r]}};const mN=QT,nTi=QT.buildOptions,Che=rTi;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,mN.nameRegexp),!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const edt={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,ignoreNameSpace:!1,allowBooleanAttributes:!1,parseNodeValue:!0,parseAttributeValue:!1,arrayMode:!1,trimValues:!0,cdataTagName:!1,cdataPositionChar:"\\c",tagValueProcessor:function(t,e){return t},attrValueProcessor:function(t,e){return t},stopNodes:[]};fN.defaultOptions=edt;const tdt=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","ignoreNameSpace","allowBooleanAttributes","parseNodeValue","parseAttributeValue","arrayMode","trimValues","cdataTagName","cdataPositionChar","tagValueProcessor","attrValueProcessor","parseTrueNumberOnly","stopNodes"];fN.props=tdt;function The(t,e,i){return e&&(i.trimValues&&(e=e.trim()),e=i.tagValueProcessor(e,t),e=idt(e,i.parseNodeValue,i.parseTrueNumberOnly)),e}function sTi(t,e){if(e.ignoreNameSpace){const i=t.split(":"),r=t.charAt(0)==="/"?"/":"";if(i[0]==="xmlns")return"";i.length===2&&(t=r+i[1])}return t}function idt(t,e,i){if(e&&typeof t=="string"){let r;return t.trim()===""||isNaN(t)?r=t==="true"?!0:t==="false"?!1:t:(t.indexOf("0x")!==-1?r=Number.parseInt(t,16):t.indexOf(".")!==-1?(r=Number.parseFloat(t),t=t.replace(/\.?0+$/,"")):r=Number.parseInt(t,10),i&&(r=String(r)===t?r:t)),r}else return mN.isExist(t)?t:""}const oTi=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])(.*?)\\3)?`,"g");function rdt(t,e){if(!e.ignoreAttributes&&typeof t=="string"){t=t.replace(/\r?\n/g," ");const i=mN.getAllMatches(t,oTi),r=i.length,n={};for(let s=0;s",s,"Closing Tag is not closed.");let l=t.substring(s+2,a).trim();if(e.ignoreNameSpace){const c=l.indexOf(":");c!==-1&&(l=l.substr(c+1))}r&&(r.val?r.val=mN.getValue(r.val)+""+The(l,n,e):r.val=The(l,n,e)),e.stopNodes.length&&e.stopNodes.includes(r.tagname)&&(r.child=[],r.attrsMap==null&&(r.attrsMap={}),r.val=t.substr(r.startIndex+1,s-r.startIndex-1)),r=r.parent,n="",s=a}else if(t[s+1]==="?")s=BK(t,"?>",s,"Pi Tag is not closed.");else if(t.substr(s+1,3)==="!--")s=BK(t,"-->",s,"Comment is not closed.");else if(t.substr(s+1,2)==="!D"){const a=BK(t,">",s,"DOCTYPE is not closed.");t.substring(s,a).indexOf("[")>=0?s=t.indexOf("]>",s)+1:s=a}else if(t.substr(s+1,2)==="!["){const a=BK(t,"]]>",s,"CDATA is not closed.")-2,l=t.substring(s+9,a);if(n&&(r.val=mN.getValue(r.val)+""+The(r.tagname,n,e),n=""),e.cdataTagName){const c=new Che(e.cdataTagName,r,l);r.addChild(c),r.val=mN.getValue(r.val)+e.cdataPositionChar,l&&(c.val=l)}else r.val=(r.val||"")+(l||"");s=a+2}else{const a=lTi(t,s+1);let l=a.data;const c=a.index,d=l.indexOf(" ");let p=l,y=!0;if(d!==-1&&(p=l.substr(0,d).replace(/\s\s*$/,""),l=l.substr(d+1)),e.ignoreNameSpace){const v=p.indexOf(":");v!==-1&&(p=p.substr(v+1),y=p!==a.data.substr(v+1))}if(r&&n&&r.tagname!=="!xml"&&(r.val=mN.getValue(r.val)+""+The(r.tagname,n,e)),l.length>0&&l.lastIndexOf("/")===l.length-1){p[p.length-1]==="/"?(p=p.substr(0,p.length-1),l=p):l=l.substr(0,l.length-1);const v=new Che(p,r,"");p!==l&&(v.attrsMap=rdt(l,e)),r.addChild(v)}else{const v=new Che(p,r);e.stopNodes.length&&e.stopNodes.includes(v.tagname)&&(v.startIndex=c),p!==l&&y&&(v.attrsMap=rdt(l,e)),r.addChild(v),r=v}n="",s=c}else n+=t[s];return i};function lTi(t,e){let i,r="";for(let n=e;n")return{data:r,index:n};s===" "&&(s=" ")}r+=s}}function BK(t,e,i,r){const n=t.indexOf(e,i);if(n===-1)throw new Error(r);return n+e.length-1}fN.getTraversalObj=aTi;var ndt={};const Ehe=QT,uTi={allowBooleanAttributes:!1},cTi=["allowBooleanAttributes"];ndt.validate=function(t,e){e=Ehe.buildOptions(e,uTi,cTi);const i=[];let r=!1,n=!1;t[0]==="\uFEFF"&&(t=t.substr(1));for(let s=0;s"&&t[s]!==" "&&t[s]!==" "&&t[s]!==` -`&&t[s]!=="\r";s++)a+=t[s];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),s--),!vTi(a)){let d;return a.trim().length===0?d="There is an unnecessary space between tag name and backward slash '0)return oy("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",iS(t,s));{const d=i.pop();if(a!==d)return oy("InvalidTag","Closing tag '"+d+"' is expected inplace of '"+a+"'.",iS(t,s));i.length==0&&(n=!0)}}else return oy("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",iS(t,s));else{const d=adt(c,e);if(d!==!0)return oy(d.err.code,d.err.msg,iS(t,s-c.length+d.err.line));if(n===!0)return oy("InvalidXml","Multiple possible root nodes found.",iS(t,s));i.push(a),r=!0}for(s++;s0)return oy("InvalidXml","Invalid '"+JSON.stringify(i,null,4).replace(/\r?\n/g,"")+"' found.",1)}else return oy("InvalidXml","Start tag expected.",1);return!0};function sdt(t,e){for(var i=e;e5&&r==="xml")return oy("InvalidXml","XML declaration allowed only at the start of the document.",iS(t,e));if(t[e]=="?"&&t[e+1]==">"){e++;break}else continue}return e}function odt(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){let i=1;for(e+=8;e"&&(i--,i===0))break}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}var hTi='"',dTi="'";function pTi(t,e){let i="",r="",n=!1;for(;e"&&r===""){n=!0;break}i+=t[e]}return r!==""?!1:{value:i,index:e,tagClosed:n}}const fTi=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function adt(t,e){const i=Ehe.getAllMatches(t,fTi),r={};for(let n=0;n1){c+='"'+p+'" : [ ';for(var y in o.child[p])c+=n(o.child[p][y],a)+" , ";c=c.substr(0,c.length-1)+" ] "}else c+='"'+p+'" : '+n(o.child[p][0],a)+" ,"}return t.merge(c,o.attrsMap),t.isEmptyObject(c)?t.isExist(o.val)?o.val:"":(t.isExist(o.val)&&(typeof o.val=="string"&&(o.val===""||o.val===a.cdataPositionChar)||(c+='"'+a.textNodeName+'" : '+s(o.val))),c[c.length-1]===","&&(c=c.substr(0,c.length-2)),c+"}")};function s(o){return o===!0||o===!1||!isNaN(o)?o:'"'+o+'"'}return L3e.convertToJsonString=r,L3e}var k3e,cdt;function wTi(){if(cdt)return k3e;cdt=1;const t=QT.buildOptions,e={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataTagName:!1,cdataPositionChar:"\\c",format:!1,indentBy:" ",supressEmptyNode:!1,tagValueProcessor:function(v){return v},attrValueProcessor:function(v){return v}},i=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","cdataTagName","cdataPositionChar","format","indentBy","supressEmptyNode","tagValueProcessor","attrValueProcessor"];function r(v){this.options=t(v,e,i),this.options.ignoreAttributes||this.options.attrNodeName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=p),this.options.cdataTagName?this.isCDATA=y:this.isCDATA=function(){return!1},this.replaceCDATAstr=n,this.replaceCDATAarr=s,this.options.format?(this.indentate=d,this.tagEndChar=`> +northing meters`+me;var Tt=at/2,Yt=0,bi=0,_i,Li,Xi,fr,lr;return 0"u"){var bt=me.split(",");this.x=parseFloat(bt[0],10),this.y=parseFloat(bt[1],10),this.z=parseFloat(bt[2],10)||0}else this.x=me,this.y=Le,this.z=We||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}function Ut(me){var Le=typeof me.PROJECTION=="object"?Object.keys(me.PROJECTION)[0]:me.PROJECTION;return"no_uoff"in me||"no_off"in me||["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(Le)!==-1}function Je(){var me=Math.pi,Le=0,We=0,bt=0,ne=0,ee=0,se=0,ge=0,Ee,He,Xe,at,Tt,Yt,bi,_i,Li,Xi,fr;this.no_off=Ut(this),this.no_rot="no_rot"in this;var lr=!1;"alpha"in this&&(lr=!0);var Fr=!1;if("rectified_grid_angle"in this&&(Fr=!0),lr&&(ge=this.alpha),Fr&&(Le=this.rectified_grid_angle*os),lr||Fr)We=this.longc;else if(bt=this.long1,ee=this.lat1,ne=this.long2,se=this.lat2,n(ee-se)<=Eu||(Ee=n(ee))<=Eu||n(Ee-wi)<=Eu||n(n(this.lat0)-wi)<=Eu||n(n(se)-wi)<=Eu)throw new Error;var gr=1-this.es;He=X(gr),n(this.lat0)>Ur?(_i=V(this.lat0),Xe=Y(this.lat0),Ee=1-this.es*_i*_i,this.B=Xe*Xe,this.B=X(1+this.es*this.B*this.B/gr),this.A=this.B*this.k0*He/Ee,at=this.B*He/(Xe*X(Ee)),Tt=at*at-1,0>=Tt?Tt=0:(Tt=X(Tt),0>this.lat0&&(Tt=-Tt)),this.E=Tt+=at,this.E*=s(Nt(this.e,this.lat0,_i),this.B)):(this.B=1/He,this.A=this.k0,this.E=at=Tt=1),lr||Fr?(lr?(fr=p(V(ge)/at),!Fr&&(Le=ge)):(fr=Le,ge=p(at*V(fr))),this.lam0=We-p(.5*(Tt-1/Tt)*j(fr))/this.B):(Yt=s(Nt(this.e,ee,V(ee)),this.B),bi=s(Nt(this.e,se,V(se)),this.B),Tt=this.E/Yt,Li=(bi-Yt)/(bi+Yt),Xi=this.E*this.E,Xi=(Xi-bi*Yt)/(Xi+bi*Yt),Ee=bt-ne,Ee<-me?ne-=es:Ee>me&&(ne+=es),this.lam0=Bt(.5*(bt+ne)-F(Xi*j(.5*this.B*(bt-ne))/Li)/this.B),fr=F(2*V(this.B*Bt(bt-this.lam0))/(Tt-1/Tt)),Le=ge=p(at*V(fr))),this.singam=V(fr),this.cosgam=Y(fr),this.sinrot=V(Le),this.cosrot=Y(Le),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*F(X(at*at-1)/Y(ge))),0>this.lat0&&(this.u_0=-this.u_0)),Tt=.5*fr,this.v_pole_n=this.ArB*r(j(Mn-Tt)),this.v_pole_s=this.ArB*r(j(Mn+Tt))}function Rt(me){var Le=[],We;return Le[0]=me*Mg,We=me*me,Le[0]+=We*Dg,Le[1]=We*Ea,We*=me,Le[0]+=We*ep,Le[1]+=We*ym,Le[2]=We*wl,Le}function ri(me,Le){var We=me+me;return me+Le[0]*V(We)+Le[1]*V(We+We)+Le[2]*V(We+We+We)}function ti(me,Le,We,bt){var ne;return meMn&&ne<=wi+Mn?(bt.value=el.AREA_1,ne-=wi):ne>wi+Mn||ne<=-(wi+Mn)?(bt.value=el.AREA_2,ne=0<=ne?ne-ji:ne+ji):(bt.value=el.AREA_3,ne+=wi)),ne}function Zt(me,Le){var We=me+Le;return We<-ji?We+=es:We>+ji&&(We-=es),We}function ii(me,Le,We,bt){for(var ne=Le,ee;bt&&(ee=me(ne),ne-=ee,!(n(ee)=this.text.length)return;me=this.text[this.place++]}switch(this.state){case ui:return this.neutral(me);case W:return this.keyword(me);case Qo:return this.quoted(me);case Go:return this.afterquote(me);case Mr:return this.number(me)}},ie.prototype.afterquote=function(me){if(me==='"')return this.word+='"',void(this.state=Qo);if(Ta.test(me))return this.word=this.word.trim(),void this.afterItem(me);throw new Error(`havn't handled "`+me+'" in afterquote yet, index '+this.place)},ie.prototype.afterItem=function(me){return me===","?(this.word!==null&&this.currentObject.push(this.word),this.word=null,void(this.state=ui)):me==="]"?(this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=ui,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=Wt))):void 0},ie.prototype.number=function(me){if(Ti.test(me))return void(this.word+=me);if(Ta.test(me))return this.word=parseFloat(this.word),void this.afterItem(me);throw new Error(`havn't handled "`+me+'" in number yet, index '+this.place)},ie.prototype.quoted=function(me){return me==='"'?void(this.state=Go):void(this.word+=me)},ie.prototype.keyword=function(me){if(/[A-Za-z84]/.test(me))return void(this.word+=me);if(me==="["){var Le=[];return Le.push(this.word),this.level++,this.root===null?this.root=Le:this.currentObject.push(Le),this.stack.push(this.currentObject),this.currentObject=Le,void(this.state=ui)}if(Ta.test(me))return void this.afterItem(me);throw new Error(`havn't handled "`+me+'" in keyword yet, index '+this.place)},ie.prototype.neutral=function(me){if(/[A-Za-z]/.test(me))return this.word=me,void(this.state=W);if(me==='"')return this.word="",void(this.state=Qo);if(Ti.test(me))return this.word=me,void(this.state=Mr);if(Ta.test(me))return void this.afterItem(me);throw new Error(`havn't handled "`+me+'" in neutral yet, index '+this.place)},ie.prototype.output=function(){for(;this.placeme?-1:1},Bt=function(me){return n(me)<=ji?me:me-ea(me)*es},Nt=function(me,Le,We){var bt=me*We;return bt=s((1-bt)/(1+bt),.5*me),j(.5*(wi-Le))/bt},xi=function(me,Le){for(var We=wi-2*F(Le),bt=0,ne,ee;15>=bt;bt++)if(ne=me*V(We),ee=wi-2*F(Le*s((1-ne)/(1+ne),.5*me))-We,We+=ee,1e-10>=n(ee))return We;return-9999},Ai=[{init:qe,forward:function(me){var Le=me.x,We=me.y;if(90We*Wn&&180Le*Wn)return null;var bt,ne;if(n(n(We)-wi)<=Ur)return null;if(this.sphere)bt=this.x0+this.a*this.k0*Bt(Le-this.long0),ne=this.y0+this.a*this.k0*r(j(Mn+.5*We));else{var ee=V(We),se=Nt(this.e,We,ee);bt=this.x0+this.a*this.k0*Bt(Le-this.long0),ne=this.y0-this.a*this.k0*r(se)}return me.x=bt,me.y=ne,me},inverse:function(me){var Le=me.x-this.x0,We=me.y-this.y0,bt,ne;if(this.sphere)ne=wi-2*F(k(-We/(this.a*this.k0)));else{var ee=k(-We/(this.a*this.k0));if(ne=xi(this.e,ee),ne===-9999)return null}return bt=Bt(this.long0+Le/(this.a*this.k0)),me.x=bt,me.y=ne,me},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:et,inverse:et,names:["longlat","identity"]}],Ei={},ir=[],or={};or.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},or.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},or.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},or.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},or.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},or.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},or.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},or.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},or.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},or.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},or.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},or.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},or.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},or.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},or.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},or.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},or.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},or.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},or.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},or.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},or.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},or.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},or.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},or.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},or.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},or.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},or.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},or.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},or.hough={a:6378270,rf:297,ellipseName:"Hough"},or.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},or.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},or.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},or.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},or.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},or.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},or.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},or.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},or.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},or.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},or.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},or.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var Cn=or.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};or.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Gn={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"}},Po={};wt.projections={start:function(){Ai.forEach(Ze)},add:Ze,get:function(me){if(!me)return!1;var Le=me.toLowerCase();if(typeof Ei[Le]<"u"&&ir[Ei[Le]])return ir[Ei[Le]]}},wt.projections.start();var Dn=function(me,Le,We){if(Ne(me,Le)||me.datum_type===ki||Le.datum_type===ki)return We;var bt=me.a,ne=me.es;if(me.datum_type===Ci){var ee=Ot(me,!1,We);if(ee!==0)return;bt=Ni,ne=tr}var se=Le.a,ge=Le.b,Ee=Le.es;if(Le.datum_type===Ci&&(se=Ni,ge=6356752314e-3,Ee=tr),ne===Ee&&bt===se&&!ze(me.datum_type)&&!ze(Le.datum_type))return We;if(We=pe(We,ne,bt),ze(me.datum_type)&&(We=tt(We,me.datum_type,me.datum_params)),ze(Le.datum_type)&&(We=gt(We,Le.datum_type,Le.datum_params)),We=Ae(We,Ee,se,ge),Le.datum_type===Ci){var He=Ot(Le,!0,We);if(He!==0)return}return We},Lo=function(me,Le,We){var bt=We.x,ne=We.y,ee=We.z||0,se={},ge,Ee,He;for(He=0;3>He;He++)if(!(Le&&He===2&&We.z===void 0))switch(He===0?(ge=bt,Ee="ew".indexOf(me.axis[He])===-1?"y":"x"):He===1?(ge=ne,Ee="ns".indexOf(me.axis[He])===-1?"x":"y"):(ge=ee,Ee="z"),me.axis[He]){case"e":se[Ee]=ge;break;case"w":se[Ee]=-ge;break;case"n":se[Ee]=ge;break;case"s":se[Ee]=-ge;break;case"u":We[Ee]!==void 0&&(se.z=ge);break;case"d":We[Ee]!==void 0&&(se.z=-ge);break;default:return null}return se},si=function(me){var Le={x:me[0],y:me[1]};return 2Ur?j(We):0,_i=s(bi,2),Li=s(_i,2);se=1-this.es*s(ne,2),Xe/=X(se);var Xi=mi(We,ne,ee,this.en);ge=this.a*(this.k0*Xe*(1+at/6*(1-_i+Tt+at/20*(5-18*_i+Li+14*Tt-58*_i*Tt+at/42*(61+179*Li-Li*_i-479*_i)))))+this.x0,Ee=this.a*(this.k0*(Xi-this.ml0+ne*bt*Xe/2*(1+at/12*(5-_i+9*Tt+4*Yt+at/30*(61+Li-58*_i+270*Tt-330*_i*Tt+at/56*(1385+543*Li-Li*_i-3111*_i))))))+this.y0}else{var He=ee*V(bt);if(n(n(He)-1)Ur)return 93;Ee=0}else Ee=y(Ee);0>We&&(Ee=-Ee),Ee=this.a*this.k0*(Ee-this.lat0)+this.y0}return me.x=ge,me.y=Ee,me},inverse:function(me){var Le=(me.x-this.x0)*(1/this.a),We=(me.y-this.y0)*(1/this.a),bt,ne,ee,se;if(this.es)if(bt=this.ml0+We/this.k0,ne=yi(bt,this.es,this.en),n(ne)Ur?j(ne):0,bi=this.ep2*s(Tt,2),_i=s(bi,2),Li=s(Yt,2),Xi=s(Li,2);bt=1-this.es*s(at,2);var fr=Le*X(bt)/this.k0,lr=s(fr,2);bt*=Yt,ee=ne-.5*(bt*lr/(1-this.es))*(1-lr/12*(5+3*Li-9*bi*Li+bi-4*_i-lr/30*(61+90*Li-252*bi*Li+45*Xi+46*bi-lr/56*(1385+3633*Li+4095*Xi+1574*Xi*Li)))),se=Bt(this.long0+fr*(1-lr/6*(1+2*Li+bi-lr/20*(5+28*Li+24*Xi+8*bi*Li+6*bi-lr/42*(61+662*Li+1320*Xi+720*Xi*Li))))/Tt)}else ee=wi*ea(We),se=0;else{var ge=k(Le/this.k0),Ee=.5*(ge-1/ge),He=this.lat0+We/this.k0,Xe=Y(He);bt=X((1-s(Xe,2))/(1+s(Ee,2))),ee=p(bt),0>We&&(ee=-ee),se=Ee===0&&Xe===0?0:Bt(x(Ee,Xe)+this.long0)}return me.x=se,me.y=ee,me},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},Gr=function(me){var Le=k(me);return Le=(Le-1/Le)/2,Le},Or=function(me,Le){var We=Math.max;me=n(me),Le=n(Le);var bt=We(me,Le),ne=a(me,Le)/(bt||1);return bt*X(1+s(ne,2))},zr=function(me){var Le=1+me,We=Le-1;return We===0?me:me*r(Le)/We},Ir=function(me){var Le=n(me);return Le=zr(Le*(1+Le/(Or(1,Le)+1))),0>me?-Le:Le},Fn=function(me,Le){for(var We=2*Y(2*Le),bt=me.length-1,ne=me[bt],ee=0,se;0<=--bt;)se=-ee+We*ne+me[bt],ee=ne,ne=se;return Le+se*V(2*Le)},gs=function(me,Le){for(var We=2*Y(Le),bt=me.length-1,ne=me[bt],ee=0,se;0<=--bt;)se=-ee+We*ne+me[bt],ee=ne,ne=se;return V(Le)*se},Ts=function(me){var Le=k(me);return Le=(Le+1/Le)/2,Le},fi=function(me,Le,We){for(var bt=V(Le),ne=Y(Le),ee=Gr(We),se=Ts(We),ge=2*ne*se,Ee=-2*bt*ee,He=me.length-1,Xe=me[He],at=0,Tt=0,Yt=0,bi,_i;0<=--He;)bi=Tt,_i=at,Tt=Xe,at=Yt,Xe=-bi+ge*Tt-Ee*at+me[He],Yt=-_i+Ee*Tt+ge*at;return ge=bt*se,Ee=ne*ee,[ge*Xe-Ee*Yt,ge*Yt+Ee*Xe]},dr={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&&(vr.init.apply(this),this.forward=vr.forward,this.inverse=vr.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 me=this.es/(1+X(1-this.es)),Le=me/(2-me),We=Le;this.cgb[0]=Le*(2+Le*(-2/3+Le*(-2+Le*(116/45+Le*(26/45+Le*(-2854/675)))))),this.cbg[0]=Le*(-2+Le*(2/3+Le*(4/3+Le*(-82/45+Le*(32/45+Le*(4642/4725)))))),We*=Le,this.cgb[1]=We*(7/3+Le*(-8/5+Le*(-227/45+Le*(2704/315+Le*(2323/945))))),this.cbg[1]=We*(5/3+Le*(-16/15+Le*(-13/9+Le*(904/315+Le*(-1522/945))))),We*=Le,this.cgb[2]=We*(56/15+Le*(-136/35+Le*(-1262/105+Le*(73814/2835)))),this.cbg[2]=We*(-26/15+Le*(34/21+Le*(8/5+Le*(-12686/2835)))),We*=Le,this.cgb[3]=We*(4279/630+Le*(-332/35+Le*(-399572/14175))),this.cbg[3]=We*(1237/630+Le*(-12/5+Le*(-24832/14175))),We*=Le,this.cgb[4]=We*(4174/315+Le*(-144838/6237)),this.cbg[4]=We*(-734/315+Le*(109598/31185)),We*=Le,this.cgb[5]=We*(601676/22275),this.cbg[5]=We*(444337/155925),We=s(Le,2),this.Qn=this.k0/(1+Le)*(1+We*(1/4+We*(1/64+We/256))),this.utg[0]=Le*(-.5+Le*(2/3+Le*(-37/96+Le*(1/360+Le*(81/512+Le*(-96199/604800)))))),this.gtu[0]=Le*(.5+Le*(-2/3+Le*(5/16+Le*(41/180+Le*(-127/288+Le*(7891/37800)))))),this.utg[1]=We*(-1/48+Le*(-1/15+Le*(437/1440+Le*(-46/105+Le*(1118711/3870720))))),this.gtu[1]=We*(13/48+Le*(-3/5+Le*(557/1440+Le*(281/630+Le*(-1983433/1935360))))),We*=Le,this.utg[2]=We*(-17/480+Le*(37/840+Le*(209/4480+Le*(-5569/90720)))),this.gtu[2]=We*(61/240+Le*(-103/140+Le*(15061/26880+Le*(167603/181440)))),We*=Le,this.utg[3]=We*(-4397/161280+Le*(11/504+Le*(830251/7257600))),this.gtu[3]=We*(49561/161280+Le*(-179/168+Le*(6601661/7257600))),We*=Le,this.utg[4]=We*(-4583/161280+Le*(108847/3991680)),this.gtu[4]=We*(34729/80640+Le*(-3418889/1995840)),We*=Le,this.utg[5]=We*(-20648693/638668800),this.gtu[5]=We*(212378941/319334400);var bt=Fn(this.cbg,this.lat0);this.Zb=-this.Qn*(bt+gs(this.gtu,2*bt))},forward:function(me){var Le=Bt(me.x-this.long0),We=me.y;We=Fn(this.cbg,We);var bt=V(We),ne=Y(We),ee=V(Le),se=Y(Le);We=x(bt,se*ne),Le=x(ee*ne,Or(bt,ne*se)),Le=Ir(j(Le));var ge=fi(this.gtu,2*We,2*Le);We+=ge[0],Le+=ge[1];var Ee,He;return 2.623395162778>=n(Le)?(Ee=this.a*(this.Qn*Le)+this.x0,He=this.a*(this.Qn*We+this.Zb)+this.y0):(Ee=1/0,He=1/0),me.x=Ee,me.y=He,me},inverse:function(me){var Le=(me.x-this.x0)*(1/this.a),We=(me.y-this.y0)*(1/this.a);We=(We-this.Zb)/this.Qn,Le/=this.Qn;var bt,ne;if(2.623395162778>=n(Le)){var ee=fi(this.utg,2*We,2*Le);We+=ee[0],Le+=ee[1],Le=F(Gr(Le));var se=V(We),ge=Y(We),Ee=V(Le),He=Y(Le);We=x(se*He,Or(Ee,He*ge)),Le=x(Ee,He*ge),bt=Bt(Le+this.long0),ne=Fn(this.cgb,We)}else bt=1/0,ne=1/0;return me.x=bt,me.y=ne,me},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},wr=function(me,Le){if(me===void 0){if(me=i(30*(Bt(Le)+P)/P)+1,0>me)return 0;if(60Ur){if(ee=this.E/s(Nt(this.e,me.y,V(me.y)),this.B),se=1/ee,We=.5*(ee-se),bt=.5*(ee+se),V(this.B*me.x),ne=(We*this.singam-86*this.cosgam)/bt,n(n(ne)-1)Ee?-wi:wi;else{if(Le.y=this.E/X((1+Ee)/(1-Ee)),Le.y=xi(this.e,s(Le.y,1/this.B)),Le.y===1/0)throw new Error;Le.x=-this.rB*x(ee*this.cosgam-ge*this.singam,Y(this.BrA*We))}return Le.x+=this.lam0,Le},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"]},Vc={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)Ur?r(bt/ge)/r(ne/Ee):Le,isNaN(this.ns)&&(this.ns=Le),this.f0=bt/(this.ns*s(ne,this.ns)),this.rh=this.a*this.f0*s(He,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(me){var Le=me.x,We=me.y;n(2*n(We)-P)<=Ur&&(We=ea(We)*(wi-2*Ur));var bt=n(n(We)-wi),ne,ee;if(bt>Ur)ne=Nt(this.e,We,V(We)),ee=this.a*this.f0*s(ne,this.ns);else{if(bt=We*this.ns,0>=bt)return null;ee=0}var se=this.ns*Bt(Le-this.long0);return me.x=this.k0*(ee*V(se))+this.x0,me.y=this.k0*(this.rh-ee*Y(se))+this.y0,me},inverse:function(me){var Le=(me.x-this.x0)/this.k0,We=this.rh-(me.y-this.y0)/this.k0,bt,ne,ee,se,ge;0n(Ee-me.y)&&(He=1),Ee=me.y,Xe+=1;while(He===0&&15>Xe);return 15<=Xe?null:me},names:["Krovak","krovak"]},Vl=function(me,Le,We,bt,ne){return me*ne-Le*V(2*ne)+We*V(4*ne)-bt*V(6*ne)},fh=function(me){return 1-.25*me*(1+me/16*(3+1.25*me))},ud=function(me){return .375*me*(1+.25*me*(1+.46875*me))},rf=function(me){return .05859375*me*me*(1+.75*me)},Yl=function(me){return me*me*me*(35/3072)},mh=function(me,Le,We){var bt=Le*We;return me/X(1-bt*bt)},cd=function(me){return n(me)ge;ge++)if(se=(me-(Le*ee-We*V(2*ee)+bt*V(4*ee)-ne*V(6*ee)))/(Le-2*We*Y(2*ee)+4*bt*Y(4*ee)-6*ne*Y(6*ee)),ee+=se,1e-10>=n(se))return ee;return NaN},nf={init:function(){this.sphere||(this.e0=fh(this.es),this.e1=ud(this.es),this.e2=rf(this.es),this.e3=Yl(this.es),this.ml0=this.a*Vl(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(me){var Le=me.x,We=me.y,bt,ne;if(Le=Bt(Le-this.long0),this.sphere)bt=this.a*p(Y(We)*V(Le)),ne=this.a*(x(j(We),Y(Le))-this.lat0);else{var ee=V(We),se=Y(We),ge=mh(this.a,this.e,ee),Ee=j(We)*j(We),He=Le*Y(We),Xe=He*He,at=this.es*se*se/(1-this.es),Tt=this.a*Vl(this.e0,this.e1,this.e2,this.e3,We);bt=ge*He*(1-Xe*Ee*(1/6-(8-Ee+8*at)*Xe/120)),ne=Tt-this.ml0+ge*ee/se*Xe*(.5+(5-Ee+6*at)*Xe/24)}return me.x=bt+this.x0,me.y=ne+this.y0,me},inverse:function(me){me.x-=this.x0,me.y-=this.y0;var Le=me.x/this.a,We=me.y/this.a,bt,ne;if(this.sphere){var ee=We+this.lat0;bt=p(V(ee)*Y(Le)),ne=x(j(Le),Y(ee))}else{var se=this.ml0/this.a+We,ge=vu(se,this.e0,this.e1,this.e2,this.e3);if(n(n(ge)-wi)<=Ur)return me.x=this.long0,me.y=wi,0>We&&(me.y*=-1),me;var Ee=mh(this.a,this.e,V(ge)),He=Ee*Ee*Ee/this.a/this.a*(1-this.es),Xe=s(j(ge),2),at=Le*this.a/Ee,Tt=at*at;bt=ge-Ee*j(ge)/He*at*at*(.5-(1+3*Xe)*at*at/24),ne=at*(1-Tt*(Xe/3+(1+3*Xe)*Xe*Tt/15))/Y(ge)}return me.x=Bt(ne+this.long0),me.y=cd(bt),me},names:["Cassini","Cassini_Soldner","cass"]},Mh=function(me,Le){var We;return 1e-7this.lat0?this.S_POLE:this.N_POLE:n(me)Ur?(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*X(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(me){var Le=me.x,We=me.y;this.sin_phi=V(We),this.cos_phi=Y(We);var bt=Mh(this.e3,this.sin_phi,this.cos_phi),ne=this.a*X(this.c-this.ns0*bt)/this.ns0,ee=this.ns0*Bt(Le-this.long0),se=ne*V(ee)+this.x0,ge=this.rh-ne*Y(ee)+this.y0;return me.x=se,me.y=ge,me},inverse:function(me){var Le,We,bt,ne,ee,se;return me.x-=this.x0,me.y=this.rh-me.y+this.y0,0<=this.ns0?(Le=X(me.x*me.x+me.y*me.y),bt=1):(Le=-X(me.x*me.x+me.y*me.y),bt=-1),ne=0,Le!==0&&(ne=x(bt*me.x,bt*me.y)),bt=Le*this.ns0/this.a,this.sphere?se=p((this.c-bt*bt)/(2*this.ns0)):(We=(this.c-bt*bt)/this.ns0,se=this.phi1z(this.e3,We)),ee=Bt(ne/this.ns0+this.long0),me.x=ee,me.y=se,me},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(me,Le){var We=gh(.5*Le),bt,ne,ee,se,ge;if(me=Ee;Ee++)if(bt=V(We),ne=Y(We),ee=me*bt,se=1-ee*ee,ge=.5*se*se/ne*(Le/(1-me*me)-bt/se+.5/me*r((1-ee)/(1+ee))),We+=ge,1e-7>=n(ge))return We;return null}},xl={init:function(){this.sin_p14=V(this.lat0),this.cos_p14=Y(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(me){var Le=me.x,We=me.y,bt,ne,ee,se,ge,Ee,He,Xe;return ee=Bt(Le-this.long0),bt=V(We),ne=Y(We),se=Y(ee),Ee=this.sin_p14*bt+this.cos_p14*ne*se,ge=1,0n(n(Le)-We))return 0>Le?-1*wi:wi;for(var bt=p(.5*Le),ne=0,ee,se,ge,Ee;30>ne;ne++)if(se=V(bt),ge=Y(bt),Ee=me*se,ee=s(1-Ee*Ee,2)/(2*ge)*(Le/(1-me*me)-se/(1-Ee*Ee)+.5/me*r((1-Ee)/(1+Ee))),bt+=ee,1e-10>=n(ee))return bt;return NaN},Fg={init:function(){this.sphere||(this.k0=Cs(this.e,V(this.lat_ts),Y(this.lat_ts)))},forward:function(me){var Le=me.x,We=me.y,bt=Bt(Le-this.long0),ne,ee;if(this.sphere)ne=this.x0+this.a*bt*Y(this.lat_ts),ee=this.y0+this.a*V(We)/Y(this.lat_ts);else{var se=Mh(this.e,V(We));ne=this.x0+this.a*this.k0*bt,ee=this.y0+.5*(this.a*se)/this.k0}return me.x=ne,me.y=ee,me},inverse:function(me){me.x-=this.x0,me.y-=this.y0;var Le,We;return this.sphere?(Le=Bt(this.long0+me.x/this.a/Y(this.lat_ts)),We=p(me.y/this.a*Y(this.lat_ts))):(We=of(this.e,2*me.y*this.k0/this.a),Le=Bt(this.long0+me.x/(this.a*this.k0))),me.x=Le,me.y=We,me},names:["cea"]},ua={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=Y(this.lat_ts)},forward:function(me){var Le=me.x,We=me.y,bt=Bt(Le-this.long0),ne=cd(We-this.lat0);return me.x=this.x0+this.a*bt*this.rc,me.y=this.y0+this.a*ne,me},inverse:function(me){var Le=me.x,We=me.y;return me.x=Bt(this.long0+(Le-this.x0)/(this.a*this.rc)),me.y=cd(this.lat0+(We-this.y0)/this.a),me},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Ep={init:function(){this.temp=this.b/this.a,this.es=1-s(this.temp,2),this.e=X(this.es),this.e0=fh(this.es),this.e1=ud(this.es),this.e2=rf(this.es),this.e3=Yl(this.es),this.ml0=this.a*Vl(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(me){var Le=me.x,We=me.y,bt=Bt(Le-this.long0),ne,ee,se;if(se=bt*V(We),this.sphere)n(We)<=Ur?(ne=this.a*bt,ee=-1*this.a*this.lat0):(ne=this.a*V(se)/j(We),ee=this.a*(cd(We-this.lat0)+(1-Y(se))/j(We)));else if(n(We)<=Ur)ne=this.a*bt,ee=-1*this.ml0;else{var ge=mh(this.a,this.e,V(We))/j(We);ne=ge*V(se),ee=this.a*Vl(this.e0,this.e1,this.e2,this.e3,We)-this.ml0+ge*(1-Y(se))}return me.x=ne+this.x0,me.y=ee+this.y0,me},inverse:function(me){var Le,We,bt,ne,ee,se,ge,Ee,He;if(bt=me.x-this.x0,ne=me.y-this.y0,this.sphere)if(n(ne+this.a*this.lat0)<=Ur)Le=Bt(bt/this.a+this.long0),We=0;else{se=this.lat0+ne/this.a,ge=bt*bt/this.a/this.a+se*se,Ee=se;var Xe;for(ee=20;ee;--ee)if(Xe=j(Ee),He=-1*(se*(Ee*Xe+1)-Ee-.5*(Ee*Ee+ge)*Xe)/((Ee-se)/Xe-1),Ee+=He,n(He)<=Ur){We=Ee;break}Le=Bt(this.long0+p(bt*j(Ee)/this.a)/V(We))}else if(n(ne+this.ml0)<=Ur)We=0,Le=Bt(this.long0+bt/this.a);else{se=(this.ml0+ne)/this.a,ge=bt*bt/this.a/this.a+se*se,Ee=se;var at,Tt,Yt,bi,_i;for(ee=20;ee;--ee)if(_i=this.e*V(Ee),at=X(1-_i*_i)*j(Ee),Tt=this.a*Vl(this.e0,this.e1,this.e2,this.e3,Ee),Yt=this.e0-2*this.e1*Y(2*Ee)+4*this.e2*Y(4*Ee)-6*this.e3*Y(6*Ee),bi=Tt/this.a,He=(se*(at*bi+1)-bi-.5*at*(bi*bi+ge))/(this.es*V(2*Ee)*(bi*bi+ge-2*se*bi)/(4*at)+(se-bi)*(at*Yt-2/V(2*Ee))-Yt),Ee-=He,n(He)<=Ur){We=Ee;break}at=X(1-this.es*s(V(We),2))*j(We),Le=Bt(this.long0+p(bt*at/this.a)/V(We))}return me.x=Le,me.y=We,me},names:["Polyconic","poly"]},to={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(me){var Le=me.x,We=me.y,bt=We-this.lat0,ne=Le-this.long0,ee=1,se=0,ge;for(ge=1;10>=ge;ge++)ee*=1e-5*(bt/cr),se+=this.A[ge]*ee;var Ee=se,He=ne,Xe=1,at=0,Tt=0,Yt=0,bi,_i;for(ge=1;6>=ge;ge++)bi=Xe*Ee-at*He,_i=at*Ee+Xe*He,Xe=bi,at=_i,Tt=Tt+this.B_re[ge]*Xe-this.B_im[ge]*at,Yt=Yt+this.B_im[ge]*Xe+this.B_re[ge]*at;return me.x=Yt*this.a+this.x0,me.y=Tt*this.a+this.y0,me},inverse:function(me){var Le=me.x,We=me.y,bt=Le-this.x0,ne=We-this.y0,ee=ne/this.a,se=bt/this.a,ge=1,Ee=0,He=0,Xe=0,at,Tt,Yt;for(at=1;6>=at;at++)Tt=ge*ee-Ee*se,Yt=Ee*ee+ge*se,ge=Tt,Ee=Yt,He=He+this.C_re[at]*ge-this.C_im[at]*Ee,Xe=Xe+this.C_im[at]*ge+this.C_re[at]*Ee;for(var bi=0;bi=at;at++)lr=_i*He-Li*Xe,Fr=Li*He+_i*Xe,_i=lr,Li=Fr,Xi+=(at-1)*(this.B_re[at]*_i-this.B_im[at]*Li),fr+=(at-1)*(this.B_im[at]*_i+this.B_re[at]*Li);_i=1,Li=0;var gr=this.B_re[1],nn=this.B_im[1];for(at=2;6>=at;at++)lr=_i*He-Li*Xe,Fr=Li*He+_i*Xe,_i=lr,Li=Fr,gr+=at*(this.B_re[at]*_i-this.B_im[at]*Li),nn+=at*(this.B_im[at]*_i+this.B_re[at]*Li);var pn=gr*gr+nn*nn;He=(Xi*gr+fr*nn)/pn,Xe=(fr*gr-Xi*nn)/pn}var Jn=He,Hs=Xe,Uo=1,ul=0;for(at=1;9>=at;at++)Uo*=Jn,ul+=this.D[at]*Uo;var uo=this.lat0+1e5*(ul*cr),Is=this.long0+Hs;return me.x=Is,me.y=uo,me},names:["New_Zealand_Map_Grid","nzmg"]},lo={init:function(){},forward:function(me){var Le=me.x,We=me.y,bt=Bt(Le-this.long0),ne=this.x0+this.a*bt,ee=this.y0+1.25*(this.a*r(j(P/4+We/2.5)));return me.x=ne,me.y=ee,me},inverse:function(me){me.x-=this.x0,me.y-=this.y0;var Le=Bt(this.long0+me.x/this.a),We=2.5*(F(k(.8*me.y/this.a))-P/4);return me.x=Le,me.y=We,me},names:["Miller_Cylindrical","mill"]},uu={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=X((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=oi(this.es)},forward:function(me){var Le=me.x,We=me.y,bt,ne;if(Le=Bt(Le-this.long0),this.sphere){if(!this.m)We=this.n===1?We:p(this.n*V(We));else for(var ee=this.n*V(We),se=20,ge;se&&(ge=(this.m*We+V(We)-ee)/(this.m+Y(We)),We-=ge,!(n(ge)P&&(bt=P),We=(2*Le+V(2*Le))/P,1bt&&(bi=-bi),ne=this.x0+bi;var _i=Ee+at;return bi=P*this.R*(Tt*_i-ge*X((Yt+Ee)*(Ee+1)-_i*_i))/(Yt+Ee),ee=0<=We?this.y0+bi:this.y0-bi,me.x=ne,me.y=ee,me},inverse:function(me){var Le,We,bt,ne,ee,se,ge,Ee,He,Xe,at,Tt,Yt;return me.x-=this.x0,me.y-=this.y0,at=P*this.R,bt=me.x/at,ne=me.y/at,ee=bt*bt+ne*ne,se=-n(ne)*(1+ee),ge=se-2*ne*ne+bt*bt,Ee=-2*se+1+2*ne*ne+ee*ee,Yt=ne*ne/Ee+(2*ge*ge*ge/Ee/Ee/Ee-9*se*ge/Ee/Ee)/27,He=(se-ge*ge/3/Ee)/Ee,Xe=2*X(-He/3),at=3*Yt/He/Xe,12*wi*this.a?void 0:(We=Le/this.a,bt=V(We),ne=Y(We),ee=this.long0,n(Le)<=Ur?se=this.lat0:(se=gh(ne*this.sin_p12+me.y*bt*this.cos_p12/Le),ge=n(this.lat0)-wi,ee=n(ge)<=Ur?0<=this.lat0?Bt(this.long0+x(me.x,-me.y)):Bt(this.long0-x(-me.x,me.y)):Bt(this.long0+x(me.x*bt,Le*this.cos_p12*ne-me.y*this.sin_p12*bt))),me.x=ee,me.y=se,me)):(Ee=fh(this.es),He=ud(this.es),Xe=rf(this.es),at=Yl(this.es),n(this.sin_p12-1)<=Ur?(Tt=this.a*Vl(Ee,He,Xe,at,wi),Le=X(me.x*me.x+me.y*me.y),Yt=Tt-Le,se=vu(Yt/this.a,Ee,He,Xe,at),ee=Bt(this.long0+x(me.x,-1*me.y)),me.x=ee,me.y=se,me):n(this.sin_p12+1)<=Ur?(Tt=this.a*Vl(Ee,He,Xe,at,wi),Le=X(me.x*me.x+me.y*me.y),Yt=Le-Tt,se=vu(Yt/this.a,Ee,He,Xe,at),ee=Bt(this.long0+x(me.x,me.y)),me.x=ee,me.y=se,me):(Le=X(me.x*me.x+me.y*me.y),Li=x(me.x,me.y),bi=mh(this.a,this.e,this.sin_p12),Xi=Y(Li),fr=this.e*this.cos_p12*Xi,lr=-fr*fr/(1-this.es),Fr=3*this.es*(1-lr)*this.sin_p12*this.cos_p12*Xi/(1-this.es),gr=Le/bi,nn=gr-lr*(1+lr)*s(gr,3)/6-Fr*(1+3*lr)*s(gr,4)/24,pn=1-lr*nn*nn/2-gr*nn*nn*nn/6,_i=p(this.sin_p12*Y(nn)+this.cos_p12*V(nn)*Xi),ee=Bt(this.long0+p(V(Li)*V(nn)/Y(_i))),Jn=V(_i),se=x((Jn-this.es*pn*this.sin_p12)*j(_i),Jn*(1-this.es)),me.x=ee,me.y=se,me))},names:["Azimuthal_Equidistant","aeqd"]},Au={init:function(){this.sin_p14=V(this.lat0),this.cos_p14=Y(this.lat0)},forward:function(me){var Le=me.x,We=me.y,bt,ne,ee,se,ge,Ee,He,Xe;return ee=Bt(Le-this.long0),bt=V(We),ne=Y(We),se=Y(ee),Ee=this.sin_p14*bt+this.cos_p14*ne*se,ge=1,(0=wi-Mn/2?cu.TOP:this.lat0<=-(wi-Mn/2)?cu.BOTTOM:n(this.long0)<=Mn?cu.FRONT:n(this.long0)<=wi+Mn?0=Mn&&ne<=wi+Mn?(We.value=el.AREA_0,ee=ne-wi):ne>wi+Mn||ne<=-(wi+Mn)?(We.value=el.AREA_1,ee=0-(wi+Mn)&&ne<=-Mn?(We.value=el.AREA_2,ee=ne+wi):(We.value=el.AREA_3,ee=ne);else if(this.face===cu.BOTTOM)se=wi+bt,ne>=Mn&&ne<=wi+Mn?(We.value=el.AREA_0,ee=-ne+wi):ne=-Mn?(We.value=el.AREA_1,ee=-ne):ne<-Mn&&ne>=-(wi+Mn)?(We.value=el.AREA_2,ee=-ne-wi):(We.value=el.AREA_3,ee=0=n(me.y)?We.value=el.AREA_0:0<=me.y&&me.y>=n(me.x)?(We.value=el.AREA_1,bt-=wi):0>me.x&&-me.x>=n(me.y)?(We.value=el.AREA_2,bt=0>bt?bt+ji:bt-ji):(We.value=el.AREA_3,bt+=wi),at=ji/12*j(bt),ge=V(at)/(Y(at)-1/X(2)),Ee=F(ge),ee=Y(bt),se=j(ne),He=1-ee*ee*se*se*(1-Y(F(1/Y(Ee)))),-1>He?He=-1:1Ee?Ee+ji:Ee-ji:We.value===el.AREA_2?Ee-wi:Ee;else if(this.face===cu.BOTTOM)Xe=y(He),Le.phi=Xe-wi,Le.lam=We.value===el.AREA_0?-Ee+wi:We.value===el.AREA_1?-Ee:We.value===el.AREA_2?-Ee-wi:0>Ee?-Ee-ji:-Ee+ji;else{var Tt,Yt,bi;Tt=He,at=Tt*Tt,bi=1<=at?0:X(1-at)*V(Ee),at+=bi*bi,Yt=1<=at?0:X(1-at),We.value===el.AREA_1?(at=Yt,Yt=-bi,bi=at):We.value===el.AREA_2?(Yt=-Yt,bi=-bi):We.value===el.AREA_3&&(at=Yt,Yt=bi,bi=-at),this.face===cu.RIGHT?(at=Tt,Tt=-Yt,Yt=at):this.face===cu.BACK?(Tt=-Tt,Yt=-Yt):this.face===cu.LEFT&&(at=Tt,Tt=Yt,Yt=-at),Le.phi=y(-bi)-wi,Le.lam=x(Yt,Tt),this.face===cu.RIGHT?Le.lam=Zt(Le.lam,-wi):this.face===cu.BACK?Le.lam=Zt(Le.lam,-ji):this.face===cu.LEFT&&(Le.lam=Zt(Le.lam,+wi))}if(this.es!==0){var _i,Li,Xi;_i=0>Le.phi?1:0,Li=j(Le.phi),Xi=this.b/X(Li*Li+this.one_minus_f_squared),Le.phi=F(X(this.a*this.a-Xi*Xi)/(this.one_minus_f*Xi)),_i&&(Le.phi=-Le.phi)}return Le.lam+=this.long0,me.x=Le.lam,me.y=Le.phi,me},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},uc=[[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]],Xl=[[-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]],Dc=.8487,Zm=1.3523,tp=Wn/5,Af=function(me,Le){return me[0]+Le*(me[1]+Le*(me[2]+Le*me[3]))},Oy=function(me,Le){return me[1]+Le*(2*me[2]+3*Le*me[3])},Lg={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(me){var Le=Bt(me.x-this.long0),We=n(me.y),bt=i(We*tp);0>bt?bt=0:18<=bt&&(bt=17),We=Wn*(We-1/tp*bt);var ne={x:Af(uc[bt],We)*Le,y:Af(Xl[bt],We)};return 0>me.y&&(ne.y=-ne.y),ne.x=ne.x*this.a*Dc+this.x0,ne.y=ne.y*this.a*Zm+this.y0,ne},inverse:function(me){var Le={x:(me.x-this.x0)/(this.a*Dc),y:n(me.y-this.y0)/(this.a*Zm)};if(1<=Le.y)Le.x/=uc[18][0],Le.y=0>me.y?-wi:wi;else{var We=i(18*Le.y);for(0>We?We=0:18<=We&&(We=17);;)if(Xl[We][0]>Le.y)--We;else if(Xl[We+1][0]<=Le.y)++We;else break;var bt=Xl[We],ne=5*(Le.y-bt[0])/(Xl[We+1][0]-bt[0]);ne=ii(function(ee){return(Af(bt,ee)-Le.y)/Oy(bt,ee)},ne,Ur,100),Le.x/=Af(uc[We],ne),Le.y=(5*We+ne)*os,0>me.y&&(Le.y=-Le.y)}return Le.x=Bt(Le.x+this.long0),Le},names:["Robinson","robin"]},qt={init:function(){this.name="geocent"},forward:function(me){var Le=pe(me,this.es,this.a);return Le},inverse:function(me){var Le=Ae(me,this.es,this.a,this.b);return Le},names:["Geocentric","geocentric","geocent","Geocent"]},Jt={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Fi={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}},Yi={init:function(){if(Object.keys(Fi).forEach(function(We){if(typeof this[We]>"u")this[We]=Fi[We].def;else{if(Fi[We].num&&isNaN(this[We]))throw new Error("Invalid parameter value, must be numeric "+We+" = "+this[We]);Fi[We].num&&(this[We]=parseFloat(this[We]))}Fi[We].degrees&&(this[We]*=os)}.bind(this)),n(n(this.lat0)-wi)this.lat0?Jt.S_POLE:Jt.N_POLE:n(this.lat0)=this.pn1||1e10 */var v=l("buffer"),x=v.Buffer;x.from&&x.alloc&&x.allocUnsafe&&x.allocUnsafeSlow?c.exports=v:(p(v,h),h.Buffer=y),y.prototype=Object.create(x.prototype),p(x,y),y.from=function(I,P,F){if(typeof I=="number")throw new TypeError("Argument must not be a number");return x(I,P,F)},y.alloc=function(I,P,F){if(typeof I!="number")throw new TypeError("Argument must be a number");var k=x(I);return P===void 0?k.fill(0):typeof F=="string"?k.fill(P,F):k.fill(P),k},y.allocUnsafe=function(I){if(typeof I!="number")throw new TypeError("Argument must be a number");return x(I)},y.allocUnsafeSlow=function(I){if(typeof I!="number")throw new TypeError("Argument must be a number");return v.SlowBuffer(I)}},{buffer:8}],19:[function(l,c,h){function p(he){if(!he)return"utf8";for(var _e;;)switch(he){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 he;default:if(_e)return;he=(""+he).toLowerCase(),_e=!0}}function y(he){var _e=p(he);if(typeof _e!="string"&&(ie.isEncoding===ce||!ce(he)))throw new Error("Unknown encoding: "+he);return _e||he}function v(he){this.encoding=y(he);var _e;switch(this.encoding){case"utf16le":this.text=k,this.end=j,_e=4;break;case"utf8":this.fillLast=F,_e=4;break;case"base64":this.text=V,this.end=Y,_e=3;break;default:return this.write=X,void(this.end=Z)}this.lastNeed=0,this.lastTotal=0,this.lastChar=ie.allocUnsafe(_e)}function x(he){return 127>=he?0:he>>5==6?2:he>>4==14?3:he>>3==30?4:he>>6==2?-1:-2}function I(he,_e,xe){var Pe=_e.length-1;if(Pe=Pe)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=he[he.length-2],this.lastChar[1]=he[he.length-1],xe.slice(0,-1)}return xe}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=he[he.length-1],he.toString("utf16le",_e,he.length-1)}function j(he){var _e=he&&he.length?this.write(he):"";if(this.lastNeed){var xe=this.lastTotal-this.lastNeed;return _e+this.lastChar.toString("utf16le",0,xe)}return _e}function V(he,_e){var xe=(he.length-_e)%3;return xe==0?he.toString("base64",_e):(this.lastNeed=3-xe,this.lastTotal=3,xe==1?this.lastChar[0]=he[he.length-1]:(this.lastChar[0]=he[he.length-2],this.lastChar[1]=he[he.length-1]),he.toString("base64",_e,he.length-xe))}function Y(he){var _e=he&&he.length?this.write(he):"";return this.lastNeed?_e+this.lastChar.toString("base64",0,3-this.lastNeed):_e}function X(he){return he.toString(this.encoding)}function Z(he){return he&&he.length?this.write(he):""}var ie=l("safe-buffer").Buffer,ce=ie.isEncoding||function(he){switch(he=""+he,he&&he.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}};h.StringDecoder=v,v.prototype.write=function(he){if(he.length===0)return"";var _e,xe;if(this.lastNeed){if(_e=this.fillLast(he),_e===void 0)return"";xe=this.lastNeed,this.lastNeed=0}else xe=0;return xent||57343=nt)jt.push(65533);else if(55296<=nt&&56319>=nt)if(Ot===ze-1)jt.push(65533);else{var $e=gt.charCodeAt(Ot+1);56320<=$e&&57343>=$e?(jt.push(65536+((1023&nt)<<10)+(1023&$e)),Ot+=1):jt.push(65533)}Ot+=1}return jt}function I(tt){for(var gt="",ze=0,Ot;ze=Ot?gt+=o(Ot):(Ot-=65536,gt+=o((Ot>>10)+55296,(1023&Ot)+56320));return gt}function P(tt){return 0<=tt&&127>=tt}function F(tt){this.tokens=[].slice.call(tt),this.tokens.reverse()}function k(tt,gt){if(tt)throw TypeError("Decoder error");return gt||65533}function j(tt){throw TypeError("The code point "+tt+" could not be encoded.")}function V(tt){return tt=(tt+"").trim().toLowerCase(),Object.prototype.hasOwnProperty.call(ht,tt)?ht[tt]:null}function Y(tt,gt){return gt&>[tt]||null}function X(tt,gt){var ze=gt.indexOf(tt);return ze===-1?null:ze}function Z(tt){if(!("encoding-indexes"in h))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return h["encoding-indexes"][tt]}function ie(tt){if(39419tt||1237575>6*Ot)+jt];0>6*(Ot-1);nt.push(128|63&$e),Ot-=1}return nt}}function de(tt,gt){var ze=gt.fatal;this.handler=function(Ot,jt){if(jt===-1)return-1;if(P(jt))return jt;var nt=tt[jt-128];return nt===null?k(ze):nt}}function Se(tt,gt){gt.fatal,this.handler=function(ze,Ot){if(Ot===-1)return-1;if(kt(Ot))return Ot;var jt=X(Ot,tt);return jt===null&&j(Ot),jt+128}}function Ie(tt){var gt=tt.fatal,ze=0,Ot=0,jt=0;this.handler=function(nt,$e){if($e===-1&&ze===0&&Ot===0&&jt===0)return-1;$e===-1&&(ze!==0||Ot!==0||jt!==0)&&(ze=0,Ot=0,jt=0,k(gt));var Xt;if(jt!==0){Xt=null,p($e,48,57)&&(Xt=ie(10*(126*(10*(ze-129)+Ot-48)+jt-129)+$e-48));var A=[Ot,jt,$e];return ze=0,Ot=0,jt=0,Xt===null?(nt.prepend(A),k(gt)):Xt}if(Ot!==0)return p($e,129,254)?(jt=$e,null):(nt.prepend([Ot,$e]),ze=0,Ot=0,k(gt));if(ze!==0){if(p($e,48,57))return Ot=$e,null;var ye=ze,H=null;ze=0;var T=127>$e?64:65;return(p($e,64,126)||p($e,128,254))&&(H=190*(ye-129)+($e-T)),Xt=H===null?null:Y(H,Z("gb18030")),Xt===null&&P($e)&&nt.prepend($e),Xt===null?k(gt):Xt}return P($e)?$e:$e===128?8364:p($e,129,254)?(ze=$e,null):k(gt)}}function Re(tt,gt){tt.fatal,this.handler=function(ze,Ot){if(Ot===-1)return-1;if(kt(Ot))return Ot;if(Ot===58853)return j(Ot);if(gt&&Ot===8364)return 128;var jt=X(Ot,Z("gb18030"));if(jt!==null){var nt=pt(jt/190)+129,$e=jt%190,Xt=63>$e?64:65;return[nt,$e+Xt]}if(gt)return j(Ot);jt=ce(Ot);var A=pt(jt/10/126/10);jt-=10*(126*(10*A));var ye=pt(jt/10/126);jt-=126*(10*ye);var H=pt(jt/10),T=jt-10*H;return[A+129,ye+48,H+129,T+48]}}function Oe(tt){var gt=tt.fatal,ze=0;this.handler=function(Ot,jt){if(jt===-1&&ze!==0)return ze=0,k(gt);if(jt===-1&&ze===0)return-1;if(ze!==0){var nt=ze,$e=null;ze=0;var Xt=127>jt?64:98;switch((p(jt,64,126)||p(jt,161,254))&&($e=157*(nt-129)+(jt-Xt)),$e){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var A=$e===null?null:Y($e,Z("big5"));return A===null&&P(jt)&&Ot.prepend(jt),A===null?k(gt):A}return P(jt)?jt:p(jt,129,254)?(ze=jt,null):k(gt)}}function Ge(tt){tt.fatal,this.handler=function(gt,ze){if(ze===-1)return-1;if(kt(ze))return ze;var Ot=_e(ze);if(Ot===null)return j(ze);var jt=pt(Ot/157)+129;if(161>jt)return j(ze);var nt=Ot%157,$e=63>nt?64:98;return[jt,nt+$e]}}function Be(tt){var gt=tt.fatal,ze=!1,Ot=0;this.handler=function(jt,nt){if(nt===-1&&Ot!==0)return Ot=0,k(gt);if(nt===-1&&Ot===0)return-1;if(Ot===142&&p(nt,161,223))return Ot=0,65216+nt;if(Ot===143&&p(nt,161,254))return ze=!0,Ot=nt,null;if(Ot!==0){var $e=Ot;Ot=0;var Xt=null;return p($e,161,254)&&p(nt,161,254)&&(Xt=Y(94*($e-161)+(nt-161),Z(ze?"jis0212":"jis0208"))),ze=!1,p(nt,161,254)||jt.prepend(nt),Xt===null?k(gt):Xt}return P(nt)?nt:nt===142||nt===143||p(nt,161,254)?(Ot=nt,null):k(gt)}}function qe(tt){tt.fatal,this.handler=function(gt,ze){if(ze===-1)return-1;if(kt(ze))return ze;if(ze===165)return 92;if(ze===8254)return 126;if(p(ze,65377,65439))return[142,ze-65377+161];ze===8722&&(ze=65293);var Ot=X(ze,Z("jis0208"));if(Ot===null)return j(ze);var jt=pt(Ot/94)+161;return[jt,Ot%94+161]}}function et(tt){var gt=tt.fatal,ze={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},Ot=ze.ASCII,jt=ze.ASCII,nt=0,$e=!1;this.handler=function(Xt,A){switch(Ot){default:case ze.ASCII:return A===27?(Ot=ze.EscapeStart,null):p(A,0,127)&&A!==14&&A!==15&&A!==27?($e=!1,A):A===-1?-1:($e=!1,k(gt));case ze.Roman:return A===27?(Ot=ze.EscapeStart,null):A===92?($e=!1,165):A===126?($e=!1,8254):p(A,0,127)&&A!==14&&A!==15&&A!==27&&A!==92&&A!==126?($e=!1,A):A===-1?-1:($e=!1,k(gt));case ze.Katakana:return A===27?(Ot=ze.EscapeStart,null):p(A,33,95)?($e=!1,65344+A):A===-1?-1:($e=!1,k(gt));case ze.LeadByte:return A===27?(Ot=ze.EscapeStart,null):p(A,33,126)?($e=!1,nt=A,Ot=ze.TrailByte,null):A===-1?-1:($e=!1,k(gt));case ze.TrailByte:if(A===27)return Ot=ze.EscapeStart,k(gt);if(p(A,33,126)){Ot=ze.LeadByte;var ye=94*(nt-33)+A-33,H=Y(ye,Z("jis0208"));return H===null?k(gt):H}return A===-1?(Ot=ze.LeadByte,Xt.prepend(A),k(gt)):(Ot=ze.LeadByte,k(gt));case ze.EscapeStart:return A===36||A===40?(nt=A,Ot=ze.Escape,null):(Xt.prepend(A),$e=!1,Ot=jt,k(gt));case ze.Escape:var T=nt;nt=0;var b=null;if(T===40&&A===66&&(b=ze.ASCII),T===40&&A===74&&(b=ze.Roman),T===40&&A===73&&(b=ze.Katakana),T===36&&(A===64||A===66)&&(b=ze.LeadByte),b!==null){Ot=Ot=b;var m=$e;return $e=!0,m?k(gt):null}return Xt.prepend([T,A]),$e=!1,Ot=jt,k(gt)}}}function Ze(tt){tt.fatal;var gt={ASCII:0,Roman:1,jis0208:2},ze=gt.ASCII;this.handler=function(Ot,jt){if(jt===-1&&ze!==gt.ASCII)return Ot.prepend(jt),ze=gt.ASCII,[27,40,66];if(jt===-1&&ze===gt.ASCII)return-1;if((ze===gt.ASCII||ze===gt.Roman)&&(jt===14||jt===15||jt===27))return j(65533);if(ze===gt.ASCII&&kt(jt))return jt;if(ze===gt.Roman&&(kt(jt)&&jt!==92&&jt!==126||jt==165||jt==8254)){if(kt(jt))return jt;if(jt===165)return 92;if(jt===8254)return 126}if(kt(jt)&&ze!==gt.ASCII)return Ot.prepend(jt),ze=gt.ASCII,[27,40,66];if((jt===165||jt===8254)&&ze!==gt.Roman)return Ot.prepend(jt),ze=gt.Roman,[27,40,74];jt===8722&&(jt=65293);var nt=X(jt,Z("jis0208"));if(nt===null)return j(jt);if(ze!==gt.jis0208)return Ot.prepend(jt),ze=gt.jis0208,[27,36,66];var $e=pt(nt/94)+33;return[$e,nt%94+33]}}function mt(tt){var gt=tt.fatal,ze=0;this.handler=function(Ot,jt){if(jt===-1&&ze!==0)return ze=0,k(gt);if(jt===-1&&ze===0)return-1;if(ze!==0){var nt=ze,$e=null;ze=0;var Xt=127>jt?64:65,A=160>nt?129:193;if((p(jt,64,126)||p(jt,128,252))&&($e=188*(nt-A)+jt-Xt),p($e,8836,10715))return 48508+$e;var ye=$e===null?null:Y($e,Z("jis0208"));return ye===null&&P(jt)&&Ot.prepend(jt),ye===null?k(gt):ye}return P(jt)||jt===128?jt:p(jt,161,223)?65216+jt:p(jt,129,159)||p(jt,224,252)?(ze=jt,null):k(gt)}}function Pt(tt){tt.fatal,this.handler=function(gt,ze){if(ze===-1)return-1;if(kt(ze)||ze===128)return ze;if(ze===165)return 92;if(ze===8254)return 126;if(p(ze,65377,65439))return ze-65377+161;ze===8722&&(ze=65293);var Ot=he(ze);if(Ot===null)return j(ze);var jt=pt(Ot/188),nt=31>jt?129:193,$e=Ot%188,Xt=63>$e?64:65;return[jt+nt,$e+Xt]}}function $t(tt){var gt=tt.fatal,ze=0;this.handler=function(Ot,jt){if(jt===-1&&ze!==0)return ze=0,k(gt);if(jt===-1&&ze===0)return-1;if(ze!==0){var nt=ze,$e=null;ze=0,p(jt,65,254)&&($e=190*(nt-129)+(jt-65));var Xt=$e===null?null:Y($e,Z("euc-kr"));return $e===null&&P(jt)&&Ot.prepend(jt),Xt===null?k(gt):Xt}return P(jt)?jt:p(jt,129,254)?(ze=jt,null):k(gt)}}function Ct(tt){tt.fatal,this.handler=function(gt,ze){if(ze===-1)return-1;if(kt(ze))return ze;var Ot=X(ze,Z("euc-kr"));if(Ot===null)return j(ze);var jt=pt(Ot/190)+129;return[jt,Ot%190+65]}}function Et(tt,gt){var ze=tt>>8,Ot=255&tt;return gt?[ze,Ot]:[Ot,ze]}function Ft(tt,gt){var ze=gt.fatal,Ot=null,jt=null;this.handler=function(nt,$e){if($e===-1&&(Ot!==null||jt!==null))return k(ze);if($e===-1&&Ot===null&&jt===null)return-1;if(Ot===null)return Ot=$e,null;var Xt;if(Xt=tt?(Ot<<8)+$e:($e<<8)+Ot,Ot=null,jt!==null){var A=jt;return jt=null,p(Xt,56320,57343)?65536+1024*(A-55296)+(Xt-56320):(nt.prepend(Et(Xt,tt)),k(ze))}return p(Xt,55296,56319)?(jt=Xt,null):p(Xt,56320,57343)?k(ze):Xt}}function ot(tt,gt){gt.fatal,this.handler=function(ze,Ot){if(Ot===-1)return-1;if(p(Ot,0,65535))return Et(Ot,tt);var jt=Et((Ot-65536>>10)+55296,tt),nt=Et((1023&Ot-65536)+56320,tt);return jt.concat(nt)}}function Te(tt){tt.fatal,this.handler=function(gt,ze){return ze===-1?-1:P(ze)?ze:63360+ze-128}}function je(tt){tt.fatal,this.handler=function(gt,ze){return ze===-1?-1:kt(ze)?ze:p(ze,63360,63487)?ze-63360+128:j(ze)}}typeof c<"u"&&c.exports&&!h["encoding-indexes"]&&l("./encoding-indexes.js");var pt=i,kt=P,ct=-1;F.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():ct},prepend:function(tt){if(Array.isArray(tt))for(var gt=tt;gt.length;)this.tokens.push(gt.pop());else this.tokens.push(tt)},push:function(tt){if(Array.isArray(tt))for(var gt=tt;gt.length;)this.tokens.unshift(gt.shift());else this.tokens.unshift(tt)}};var ae=[{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"}],ht={};ae.forEach(function(tt){tt.encodings.forEach(function(gt){gt.labels.forEach(function(ze){ht[ze]=gt})})});var wt={},Ne={},pe,Ae;Object.defineProperty&&(Object.defineProperty(xe.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(xe.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(xe.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),xe.prototype.decode=function(tt,gt){var ze;ze=typeof tt=="object"&&tt instanceof ArrayBuffer?new Uint8Array(tt):typeof tt=="object"&&"buffer"in tt&&tt.buffer instanceof ArrayBuffer?new Uint8Array(tt.buffer,tt.byteOffset,tt.byteLength):new Uint8Array(0),gt=v(gt),this._do_not_flush||(this._decoder=Ne[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=!!gt.stream;for(var Ot=new F(ze),jt=[],nt,$e;$e=Ot.read(),$e!==ct&&(nt=this._decoder.handler(Ot,$e),nt!==-1);)nt!==null&&(Array.isArray(nt)?jt.push.apply(jt,nt):jt.push(nt));if(!this._do_not_flush){do{if(nt=this._decoder.handler(Ot,Ot.read()),nt===-1)break;nt!==null&&(Array.isArray(nt)?jt.push.apply(jt,nt):jt.push(nt))}while(!Ot.endOfStream());this._decoder=null}return function(Xt){return!y(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)||this._ignoreBOM||this._BOMseen||(0arguments.length)&&P.call(arguments,1);return F[V]=!0,x(function(){F[V]&&(Y?j.apply(null,Y):j.call(null),h.clearImmediate(V))}),V},h.clearImmediate=typeof y=="function"?y:function(j){delete F[j]}}).call(this)}).call(this,l("timers").setImmediate,l("timers").clearImmediate)},{"process/browser.js":16,timers:22}],23:[function(l,c){(function(h){(function(){function p(xe){if(!xe)throw new Error("forgot to pass buffer");return X.isBuffer(xe)?xe:y(xe)?X.from(xe):y(xe.buffer)?xe.BYTES_PER_ELEMENT===1?X.from(xe):X.from(xe.buffer):void 0}function y(xe){return xe instanceof h.ArrayBuffer||Object.prototype.toString.call(xe)==="[object ArrayBuffer]"}function v(xe,Pe){return typeof xe=="string"&&ie.has(xe)?V.resolve(ie.get(xe)):v.getShapefile(xe,Pe).then(function(ke){return typeof xe=="string"&&ie.set(xe,ke),ke})}async function x(xe,Pe){const ke=await F(xe);return v.parseZip(ke,Pe)}let I=l("proj4");I.default&&(I=I.default);const P=l("./unzip"),F=l("./binaryajax"),k=l("./parseShp"),j=l("parsedbf"),V=l("lie"),Y=l("lru-cache"),X=l("buffer").Buffer,Z=h.URL,ie=new Y({max:20});v.combine=function([xe,Pe]){const ke={type:"FeatureCollection",features:[]};let J=0;const de=xe.length;for(Pe||(Pe=[]);J{const Pe=await V.all([F(xe,"shp"),F(xe,"prj")]);let ke=!1;try{Pe[1]&&(ke=I(Pe[1]))}catch{ke=!1}return k(Pe[0],ke)},he=async xe=>{const[Pe,ke]=await V.all([F(xe,"dbf"),F(xe,"cpg")]);return Pe?j(Pe,ke):void 0},_e=(xe,Pe)=>new Z(xe).pathname.slice(-4).toLowerCase()===Pe;v.getShapefile=async function(xe,Pe){if(typeof xe!="string")return v.parseZip(xe);if(_e(xe,".zip"))return x(xe,Pe);const ke=await V.all([ce(xe),he(xe)]);return v.combine(ke)},v.parseShp=function(xe,Pe){if(xe=p(xe),X.isBuffer(Pe)&&(Pe=Pe.toString()),typeof Pe=="string")try{Pe=I(Pe)}catch{Pe=!1}return k(xe,Pe)},v.parseDbf=function(xe,Pe){return xe=p(xe),j(xe,Pe)},c.exports=v}).call(this)}).call(this,typeof Jh>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:Jh)},{"./binaryajax":2,"./parseShp":4,"./unzip":5,buffer:8,lie:12,"lru-cache":13,parsedbf:15,proj4:17}]},{},[23])(23)})})(Ddt);var QTi=Ddt.exports;const eEi=MT(QTi),tEi={Point:"circlePoint",MultiPoint:"circlePoint",LineString:"solidLine",MultiLineString:"solidLine",Polygon:"outlinedPoly",MultiPolygon:"outlinedPoly"};function iEi(t){if(t.type!=="FeatureCollection")throw new Error("GeoJSON is not in FeatureCollection format");let e=!0,i=!0;t.features.forEach((r,n)=>{Object.assign(r.properties,{ID_FILE:"",OBJECTID_FILE:""}),"id"in r&&typeof r.id<"u"&&(r.properties.ID_FILE=r.id,e=!1),"OBJECTID"in r.properties&&(r.properties.OBJECTID_FILE=r.properties.OBJECTID,delete r.properties.OBJECTID,i=!1),r.id=n+1}),e&&t.features.forEach(function(r){delete r.properties.ID_FILE}),i&&t.features.forEach(function(r){delete r.properties.OBJECTID_FILE})}function rEi(t,e){const i=r=>r.indexOf(" ")>-1;e.fields?.forEach(r=>{if(r.name&&i(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,t.features.forEach(l=>{l.properties[s]=l.properties[n],delete l.properties[n]})}})}function nEi(t,e){const i=t.features[e].geometry.geometries;if(i.length===1)t.features[e].geometry={type:i[0].type,coordinates:i[0].coordinates};else{const r=i.map(n=>n.coordinates);t.features[e].geometry={type:`Multi${i[0].type}`,coordinates:r}}}class sEi extends Gp{async fetchFileData(e,i){const r=await NP.get(e,{responseType:"arrayBuffer"});switch(i){case _n.GEOJSON:case _n.DATAJSON:return JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(r.data)));case _n.SHAPEFILE:return r.data;case _n.CSV:case _n.DATACSV:return new TextDecoder("utf-8").decode(new Uint8Array(r.data));default:console.error(`Unsupported file type passed to fetchFileData- '${i}'`)}}extractGeoJsonFields(e){if(e.features.length<1)throw new Error("GeoJSON field extraction requires at least one feature");let i=e.features[0].geometry.type;if(e.features.forEach((o,a)=>{if(o.geometry.type==="GeometryCollection"){const c=o.geometry.geometries;if(c===void 0||c.length===0)return Promise.reject(new Error("GeoJSON file has geometry collection with missing/incomplete geometries"));i=c[0].type,c.forEach(h=>{if(h.type!==i)return Promise.reject(new Error("GeoJSON file has geometry collection containing multiple geometry types"))}),nEi(e,a)}}),[...new Set(e.features.map(o=>o.geometry.type==="MultiLineString"?"LineString":o.geometry.type==="MultiPolygon"?"Polygon":o.geometry.type))].length!==1)throw new Error("GeoJSON file contains multiple geometry types");const r=Object.keys(e.features[0].properties).map(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 c=r.findIndex(h=>h.name===a);r[c]={name:a,type:this.inferType(l)},s.splice(s.indexOf(a),1)}}),s.length===0)break;n++}return r}extractCsvFields(e,i=","){return tRe.dsv.dsvFormat(i).parseRows(e)[0].map(n=>({name:n,type:W0.STRING}))}filterCsvLatLonFields(e,i=","){const r=tRe.dsv.dsvFormat(i).parseRows(e),n=r[0],s={lat:JSON.parse(JSON.stringify(n)),lon:JSON.parse(JSON.stringify(n))};for(let o=0;o90)&&c!==-1&&s.lat.splice(c,1),(isNaN(l)||l<-180||l>180)&&h!==-1&&s.lon.splice(h,1),c===-1&&h===-1)break}return s}async geoJsonToEsriJson(e,i){let r,n="EPSG:4326",s;const o={objectIdField:"OBJECTID",fields:[{name:"OBJECTID",type:W0.OID}]};iEi(e);const a=e.features[0].geometry.type,l=tEi[a],c=JSON.parse(JSON.stringify(ITi[l]));if(e.crs&&e.crs.type==="name"&&(n=e.crs.properties.name),i){if(i.sourceProjection&&(n=i.sourceProjection),i.targetSR)r=i.targetSR;else throw new Error("geoJsonToEsriJson - missing opts.targetSR arguement");i.layerId?s=i.layerId:s=this.$iApi.geo.shared.generateUUID(),i.colour&&(c.renderer.symbol.color=new yP(i.colour).toArcServer())}else throw new Error("geoJsonToEsriJson - missing opts arguement");o.renderer=i_.fromJSON(c.renderer),o.fields=(o.fields||[]).concat(i.fieldMetadata?.exclusiveFields?this.extractGeoJsonFields(e).filter(v=>i.fieldMetadata?.fieldInfo?.find(x=>x.name===v.name)):this.extractGeoJsonFields(e)),rEi(e,o);const h=this.$iApi.geo.proj.normalizeProj(r);if(i){if(i.latField){const v=o.fields.find(x=>x.name===i.latField||x.alias===i.latField);v&&(v.type=W0.DOUBLE)}if(i.lonField){const v=o.fields.find(x=>x.name===i.lonField||x.alias===i.lonField);v&&(v.type=W0.DOUBLE)}}await this.$iApi.geo.proj.checkProjBomber([n,r]);const p=new hr(r);await this.$iApi.geo.proj.projectGeoJson(e,n,h);const y=PTi.convert(e,{sr:8888});return o.geometryType=this.$iApi.geo.geom.geoJsonGeomTypeToEsriGeomType(a),y.forEach(v=>{v.geometry.spatialReference=p,v.geometry.type=o.geometryType,Object.keys(v.attributes).forEach(x=>{(Array.isArray(v.attributes[x])||typeof v.attributes[x]=="object")&&v.attributes[x]!=null&&(v.attributes[x]=JSON.stringify(v.attributes[x]))})}),o.source=y,o.spatialReference=p,o.id=s,o}async csvToGeoJson(e,i){const r={latfield:"Lat",lonfield:"Long",delimiter:","};return i&&(i.latfield&&(r.latfield=i.latfield),i.lonfield&&(r.lonfield=i.lonfield),i.delimiter&&(r.delimiter=i.delimiter)),new Promise((n,s)=>{tRe.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 eEi(e)}inferType(e){return typeof e=="number"?W0.DOUBLE:W0.STRING}}const oEi=[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 yD(t,e){return t.then(function(i){return[null,i]}).catch(function(i){return e&&Object.assign(i,e),[i,void 0]})}var Fdt={},Ldt={},tE={};(function(t){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",i=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",r="["+e+"]["+i+"]*",n=new RegExp("^"+r+"$"),s=function(a,l){const c=[];let h=l.exec(a);for(;h;){const p=[],y=h.length;for(let v=0;v"u")};t.isExist=function(a){return typeof a<"u"},t.isEmptyObject=function(a){return Object.keys(a).length===0},t.merge=function(a,l,c){if(l){const h=Object.keys(l),p=h.length;for(let y=0;y1){r[o]=[];for(let a in t.child[o])t.child[o].hasOwnProperty(a)&&r[o].push(iRe(t.child[o][a],e,o))}else{const a=iRe(t.child[o][0],e,o),l=e.arrayMode===!0&&typeof a=="object"||gk.isTagNameInArrayMode(o,e.arrayMode,i);r[o]=l?[a]:a}}return r};Ldt.convertToJson=iRe;var yk={},aEi=function(t,e,i){this.tagname=t,this.parent=e,this.child={},this.attrsMap={},this.val=i,this.addChild=function(r){Array.isArray(this.child[r.tagname])?this.child[r.tagname].push(r):this.child[r.tagname]=[r]}};const vk=tE,lEi=tE.buildOptions,Xhe=aEi;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,vk.nameRegexp),!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const Ndt={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,ignoreNameSpace:!1,allowBooleanAttributes:!1,parseNodeValue:!0,parseAttributeValue:!1,arrayMode:!1,trimValues:!0,cdataTagName:!1,cdataPositionChar:"\\c",tagValueProcessor:function(t,e){return t},attrValueProcessor:function(t,e){return t},stopNodes:[]};yk.defaultOptions=Ndt;const kdt=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","ignoreNameSpace","allowBooleanAttributes","parseNodeValue","parseAttributeValue","arrayMode","trimValues","cdataTagName","cdataPositionChar","tagValueProcessor","attrValueProcessor","parseTrueNumberOnly","stopNodes"];yk.props=kdt;function Khe(t,e,i){return e&&(i.trimValues&&(e=e.trim()),e=i.tagValueProcessor(e,t),e=$dt(e,i.parseNodeValue,i.parseTrueNumberOnly)),e}function uEi(t,e){if(e.ignoreNameSpace){const i=t.split(":"),r=t.charAt(0)==="/"?"/":"";if(i[0]==="xmlns")return"";i.length===2&&(t=r+i[1])}return t}function $dt(t,e,i){if(e&&typeof t=="string"){let r;return t.trim()===""||isNaN(t)?r=t==="true"?!0:t==="false"?!1:t:(t.indexOf("0x")!==-1?r=Number.parseInt(t,16):t.indexOf(".")!==-1?(r=Number.parseFloat(t),t=t.replace(/\.?0+$/,"")):r=Number.parseInt(t,10),i&&(r=String(r)===t?r:t)),r}else return vk.isExist(t)?t:""}const cEi=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])(.*?)\\3)?`,"g");function Bdt(t,e){if(!e.ignoreAttributes&&typeof t=="string"){t=t.replace(/\r?\n/g," ");const i=vk.getAllMatches(t,cEi),r=i.length,n={};for(let s=0;s",s,"Closing Tag is not closed.");let l=t.substring(s+2,a).trim();if(e.ignoreNameSpace){const c=l.indexOf(":");c!==-1&&(l=l.substr(c+1))}r&&(r.val?r.val=vk.getValue(r.val)+""+Khe(l,n,e):r.val=Khe(l,n,e)),e.stopNodes.length&&e.stopNodes.includes(r.tagname)&&(r.child=[],r.attrsMap==null&&(r.attrsMap={}),r.val=t.substr(r.startIndex+1,s-r.startIndex-1)),r=r.parent,n="",s=a}else if(t[s+1]==="?")s=zK(t,"?>",s,"Pi Tag is not closed.");else if(t.substr(s+1,3)==="!--")s=zK(t,"-->",s,"Comment is not closed.");else if(t.substr(s+1,2)==="!D"){const a=zK(t,">",s,"DOCTYPE is not closed.");t.substring(s,a).indexOf("[")>=0?s=t.indexOf("]>",s)+1:s=a}else if(t.substr(s+1,2)==="!["){const a=zK(t,"]]>",s,"CDATA is not closed.")-2,l=t.substring(s+9,a);if(n&&(r.val=vk.getValue(r.val)+""+Khe(r.tagname,n,e),n=""),e.cdataTagName){const c=new Xhe(e.cdataTagName,r,l);r.addChild(c),r.val=vk.getValue(r.val)+e.cdataPositionChar,l&&(c.val=l)}else r.val=(r.val||"")+(l||"");s=a+2}else{const a=dEi(t,s+1);let l=a.data;const c=a.index,h=l.indexOf(" ");let p=l,y=!0;if(h!==-1&&(p=l.substr(0,h).replace(/\s\s*$/,""),l=l.substr(h+1)),e.ignoreNameSpace){const v=p.indexOf(":");v!==-1&&(p=p.substr(v+1),y=p!==a.data.substr(v+1))}if(r&&n&&r.tagname!=="!xml"&&(r.val=vk.getValue(r.val)+""+Khe(r.tagname,n,e)),l.length>0&&l.lastIndexOf("/")===l.length-1){p[p.length-1]==="/"?(p=p.substr(0,p.length-1),l=p):l=l.substr(0,l.length-1);const v=new Xhe(p,r,"");p!==l&&(v.attrsMap=Bdt(l,e)),r.addChild(v)}else{const v=new Xhe(p,r);e.stopNodes.length&&e.stopNodes.includes(v.tagname)&&(v.startIndex=c),p!==l&&y&&(v.attrsMap=Bdt(l,e)),r.addChild(v),r=v}n="",s=c}else n+=t[s];return i};function dEi(t,e){let i,r="";for(let n=e;n")return{data:r,index:n};s===" "&&(s=" ")}r+=s}}function zK(t,e,i,r){const n=t.indexOf(e,i);if(n===-1)throw new Error(r);return n+e.length-1}yk.getTraversalObj=hEi;var Vdt={};const Jhe=tE,pEi={allowBooleanAttributes:!1},fEi=["allowBooleanAttributes"];Vdt.validate=function(t,e){e=Jhe.buildOptions(e,pEi,fEi);const i=[];let r=!1,n=!1;t[0]==="\uFEFF"&&(t=t.substr(1));for(let s=0;s"&&t[s]!==" "&&t[s]!==" "&&t[s]!==` +`&&t[s]!=="\r";s++)a+=t[s];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),s--),!xEi(a)){let h;return a.trim().length===0?h="There is an unnecessary space between tag name and backward slash '0)return ly("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",iS(t,s));{const h=i.pop();if(a!==h)return ly("InvalidTag","Closing tag '"+h+"' is expected inplace of '"+a+"'.",iS(t,s));i.length==0&&(n=!0)}}else return ly("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",iS(t,s));else{const h=Udt(c,e);if(h!==!0)return ly(h.err.code,h.err.msg,iS(t,s-c.length+h.err.line));if(n===!0)return ly("InvalidXml","Multiple possible root nodes found.",iS(t,s));i.push(a),r=!0}for(s++;s0)return ly("InvalidXml","Invalid '"+JSON.stringify(i,null,4).replace(/\r?\n/g,"")+"' found.",1)}else return ly("InvalidXml","Start tag expected.",1);return!0};function jdt(t,e){for(var i=e;e5&&r==="xml")return ly("InvalidXml","XML declaration allowed only at the start of the document.",iS(t,e));if(t[e]=="?"&&t[e+1]==">"){e++;break}else continue}return e}function Gdt(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){let i=1;for(e+=8;e"&&(i--,i===0))break}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}var mEi='"',gEi="'";function yEi(t,e){let i="",r="",n=!1;for(;e"&&r===""){n=!0;break}i+=t[e]}return r!==""?!1:{value:i,index:e,tagClosed:n}}const vEi=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Udt(t,e){const i=Jhe.getAllMatches(t,vEi),r={};for(let n=0;n1){c+='"'+p+'" : [ ';for(var y in o.child[p])c+=n(o.child[p][y],a)+" , ";c=c.substr(0,c.length-1)+" ] "}else c+='"'+p+'" : '+n(o.child[p][0],a)+" ,"}return t.merge(c,o.attrsMap),t.isEmptyObject(c)?t.isExist(o.val)?o.val:"":(t.isExist(o.val)&&(typeof o.val=="string"&&(o.val===""||o.val===a.cdataPositionChar)||(c+='"'+a.textNodeName+'" : '+s(o.val))),c[c.length-1]===","&&(c=c.substr(0,c.length-2)),c+"}")};function s(o){return o===!0||o===!1||!isNaN(o)?o:'"'+o+'"'}return nRe.convertToJsonString=r,nRe}var sRe,Wdt;function TEi(){if(Wdt)return sRe;Wdt=1;const t=tE.buildOptions,e={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataTagName:!1,cdataPositionChar:"\\c",format:!1,indentBy:" ",supressEmptyNode:!1,tagValueProcessor:function(v){return v},attrValueProcessor:function(v){return v}},i=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","cdataTagName","cdataPositionChar","format","indentBy","supressEmptyNode","tagValueProcessor","attrValueProcessor"];function r(v){this.options=t(v,e,i),this.options.ignoreAttributes||this.options.attrNodeName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=p),this.options.cdataTagName?this.isCDATA=y:this.isCDATA=function(){return!1},this.replaceCDATAstr=n,this.replaceCDATAarr=s,this.options.format?(this.indentate=h,this.tagEndChar=`> `,this.newLine=` -`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""),this.options.supressEmptyNode?(this.buildTextNode=c,this.buildObjNode=a):(this.buildTextNode=l,this.buildObjNode=o),this.buildTextValNode=l,this.buildObjectNode=o}r.prototype.parse=function(v){return this.j2x(v,0).val},r.prototype.j2x=function(v,S){let I="",O="";const L=Object.keys(v),N=L.length;for(let G=0;G"u"))if(v[V]===null)O+=this.indentate(S)+"<"+V+"/"+this.tagEndChar;else if(v[V]instanceof Date)O+=this.buildTextNode(v[V],V,"",S);else if(typeof v[V]!="object"){const Y=this.isAttribute(V);Y?I+=" "+Y+'="'+this.options.attrValueProcessor(""+v[V])+'"':this.isCDATA(V)?v[this.options.textNodeName]?O+=this.replaceCDATAstr(v[this.options.textNodeName],v[V]):O+=this.replaceCDATAstr("",v[V]):V===this.options.textNodeName?v[this.options.cdataTagName]||(O+=this.options.tagValueProcessor(""+v[V])):O+=this.buildTextNode(v[V],V,"",S)}else if(Array.isArray(v[V]))if(this.isCDATA(V))O+=this.indentate(S),v[this.options.textNodeName]?O+=this.replaceCDATAarr(v[this.options.textNodeName],v[V]):O+=this.replaceCDATAarr("",v[V]);else{const Y=v[V].length;for(let X=0;X"u"))if(te===null)O+=this.indentate(S)+"<"+V+"/"+this.tagEndChar;else if(typeof te=="object"){const re=this.j2x(te,S+1);O+=this.buildObjNode(re.val,V,re.attrStr,S)}else O+=this.buildTextNode(te,V,"",S)}}else if(this.options.attrNodeName&&V===this.options.attrNodeName){const Y=Object.keys(v[V]),X=Y.length;for(let te=0;te");return v+this.newLine}function o(v,S,I,O){return I&&!v.includes("<")?this.indentate(O)+"<"+S+I+">"+v+""+this.options.tagValueProcessor(v)+"0&&s.features[0].geometry.type===Cp.POINT&&s.features.forEach(v=>{const S=v.geometry.coordinates;v.properties.rvInternalCoordX=S[0],v.properties.rvInternalCoordY=S[1]}),s}reversedAxisWKIDs(){return iTi}parseCapabilities(e){const i=()=>{let o=e;if(e.indexOf("?")===-1)o+="?service=WMS&request=GetCapabilities";else{const a=new bX(e.toUpperCase());"SERVICE"in a.queryMap||(o+="&service=WMS"),"REQUEST"in a.queryMap||(o+="&request=GetCapabilities")}return ir(o,{responseType:"xml"}).then(a=>a.data)},r=new Promise(o=>{i().then(a=>o(a)).catch(()=>{console.error("Get capabilities failed; trying the second time;"),o(i())})}),n=o=>{let a=o.Layer;return a?(Array.isArray(a)||(a=[a]),a.map(l=>{const c=l.Name,d=l.Title;let p=l.Style;const y=[],v={};return p&&(Array.isArray(p)||(p=[p]),p.forEach(S=>{const I=S.Name;if(y.push(I),S.LegendURL){const L=S.LegendURL.OnlineResource["@_xlink:href"];v[I]=L.replaceAll("&","&")}})),{name:c||null,title:d,queryable:l["@_queryable"]==="1",layers:n(l),allStyles:y,styleToURL:v,currentStyle:y[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},c=Zht.parse(a,l);if("ServiceExceptionReport"in c)return console.error(c.ServiceExceptionReport.ServiceException),[];const d=c.WMS_Capabilities.Capability;return{layers:n(d),queryTypes:s(d.Request.GetFeatureInfo)}})}}class STi extends Np{files;ogc;constructor(e){super(e),this.files=new tTi(e),this.ogc=new xTi(e)}createLayer(e){let i;switch(e.layerType){case _n.FEATURE:i=ITi;break;case _n.MAPIMAGE:i=ATi;break;case _n.GRAPHIC:i=ddt;break;case _n.TILE:i=fdt;break;case _n.WFS:i=MTi;break;case _n.WMS:i=RTi;break;case _n.GEOJSON:i=CTi;break;case _n.CSV:i=ETi;break;case _n.SHAPEFILE:i=TTi;break;case _n.OSM:i=OTi;break;default:throw new Error("Unsupported Layer Type "+e.layerType)}return new i(e,this.$iApi)}getLayer(e){let i;const r=mv(this.$vApp.$pinia);return i=r.getLayerById(e),i||(i=r.getLayerByUid(e)),i}allLayers(){return mv(this.$vApp.$pinia).layers||[]}allErrorLayers(){return mv(this.$vApp.$pinia).penaltyBox||[]}getLayerControls(e){const i=this.getLayer(e)??this.allErrorLayers().find(o=>o.id===e||o.uid===e);if(!i)return;const r=i.config.controls?.slice()??[jl.BoundaryZoom,jl.Datatable,jl.Identify,jl.Metadata,jl.Opacity,jl.Refresh,jl.Reload,jl.Remove,jl.Settings,jl.Symbology,jl.Visibility],n=[];return i.supportsFeatures||n.push(jl.Datatable),i.extent===void 0&&n.push(jl.BoundaryZoom),(i.config?.metadata||(i.isSublayer?i.parentLayer?.config?.metadata:{})||{}).url||n.push(jl.Metadata),n.forEach(o=>{const a=r?.indexOf(o)??-1;a!==-1&&r?.splice(a,1)}),{controls:r,disabledControls:i.config.disabledControls??[]}}}class gN extends Np{config={};id;uid;name;layerState;initiationState;drawState;layerIdx;layerType;layerFormat;dataFormat;supportsIdentify;supportsFeatures;featureCount;fields;nameField;oidField;expectedTime;supportsSublayers;isSublayer;isRemoved;isFile;isCosmetic;userAdded;identify;identifyMode;hovertips;geomType;legend;esriLayer;esriSubLayer;esriView;extent;_parentLayer;_sublayers;constructor(e,i){super(i),this.config=e,this.id="",this.uid="",this.name="error",this.layerState=j0.NEW,this.drawState=Ub.NOT_LOADED,this.initiationState=T1.NEW,this.layerIdx=-1,this.layerFormat=Hx.UNKNOWN,this.layerType=_n.UNKNOWN,this.dataFormat=C1.UNKNOWN,this.supportsIdentify=!1,this.identifyMode=vm.NONE,this.supportsFeatures=!1,this.featureCount=-1,this.fields=[],this.nameField="",this.oidField="",this.supportsSublayers=!1,this.isSublayer=!1,this.isRemoved=!1,this.isFile=!1,this.isCosmetic=e.cosmetic||!1,this.userAdded=!1,this.identify=!1,this.hovertips=e.state?.hovertips??!0,this.geomType=Rl.UNKNOWN,this.legend=[],this._sublayers=[],this.expectedTime={draw:0,load:0}}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 yX(0,"Fake tree","getLayerTree() was not implemented in layer")}get visibility(){return!1}set visibility(e){}get opacity(){return 0}set opacity(e){}get scaleSet(){return new xnt}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(e=void 0){return Promise.resolve({features:[],oidIndex:{}})}abortAttributeLoad(){}clearFeatureCache(){}getTabularAttributes(){return Promise.resolve({columns:[],rows:[],fields:[],oidField:"error"})}getGraphic(e,i){return Promise.resolve(new Wx(new SG))}getIcon(e){return Promise.resolve("")}getSqlFilter(e){return""}setSqlFilter(e,i){}applySqlFilter(e=[]){}getFilterOIDs(e=[],i=void 0){return Promise.resolve(void 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 i=this._sublayers.findIndex(r=>r?.uid===e);if(i===-1)throw new Error(`Attempt to access non-existing unique id [layerid ${this.id}, uid ${e}]`);return i}}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 i;if(typeof e=="string"?i=this.uidToIdx(e):i=e,this._sublayers[i]===void 0)throw new Error(`Attempt to access non-existing layer index [layerid ${this.id}, lookup value ${e}]`);return this._sublayers[i]}controlAvailable(e){const i=this.$iApi.geo.layer.getLayerControls(this.id);return i?.disabledControls?.includes(e)?!1:i?.controls.includes(e)??!1}}class GK extends gN{timers;_serverVisibility;_scaleSet;_mouseTolerance;_touchTolerance;_drawOrder;_lastFilterUpdate="";origRampConfig;loadDefProm;viewDefProm;loadPromFulfilled;layerTree;esriWatches;constructor(e,i){super(e,i),this.name=e.name||"",this._scaleSet=new xnt,this._mouseTolerance=e.mouseTolerance!=null?e.mouseTolerance:5,this._touchTolerance=e.touchTolerance!=null?e.touchTolerance:15,this.geomType=Rl.NONE,this.dataFormat=C1.UNKNOWN,this.layerType=_n.UNKNOWN,this.layerFormat=Hx.UNKNOWN,this._drawOrder=[],this.expectedTime.draw=e.expectedDrawTime??1e4,this.expectedTime.load=e.expectedLoadTime??4e3,this.timers={draw:void 0,load:void 0},this.origRampConfig=e,this.id=e.id||"",this.uid=this.$iApi.geo.shared.generateUUID(),this.isRemoved=!1,this.isSublayer=!1,this.supportsIdentify=!1,this.identifyMode=vm.NONE,this.supportsFeatures=!1,this.supportsSublayers=!1,this._serverVisibility=void 0,this.isFile=!1,this.extent=e.extent?Lp.fromConfig(`${this.id}_extent`,e.extent):void 0,this.layerState=j0.NEW,this.initiationState=T1.NEW,this.drawState=Ub.NOT_LOADED,this.loadDefProm=new Fm,this.viewDefProm=new Fm,this.loadPromFulfilled=!1,this.esriWatches=[],this.layerTree=new yX(0,this.uid,this.name,!0)}noLayerErr(){console.error("Attempted to manipulate the layer but no layer found. Likely .initiate() was not finished or failed."),console.trace()}updateInitiationState(e){this.initiationState=e,this.$iApi.event.emit(an.LAYER_INITIATIONSTATECHANGE,{state:e,layer:this})}updateLayerState(e){this.layerState=e,this.$iApi.event.emit(an.LAYER_LAYERSTATECHANGE,{state:e,layer:this})}updateDrawState(e){this.drawState=e,e===Ub.REFRESH?this.startTimer("draw"):e===Ub.UP_TO_DATE&&this.stopTimer("draw"),this.$iApi.event.emit(an.LAYER_DRAWSTATECHANGE,{state:e,layer:this})}async initiate(){this.updateInitiationState(T1.INITIATING),this.startTimer("load");const[e]=await pD(this.onInitiate());this.drawState!==Ub.UP_TO_DATE&&this.startTimer("draw"),e&&(console.error(e.message),this.onError()),this.updateInitiationState(T1.INITIATED)}async onInitiate(){if(this.isSublayer)return console.warn("Attempted to initiate a sublayer as a CommonLayer"),Promise.resolve();if(!this.esriLayer){this.noLayerErr();return}this.initiationState===T1.INITIATED&&console.error(`Encountered layer initialize while already initiated, layer id ${this.id}`),this.esriWatches.push(this.esriLayer.watch("visible",e=>{this.$iApi.event.emit(an.LAYER_VISIBILITYCHANGE,{visibility:e,layer:this})})),this.esriWatches.push(this.esriLayer.watch("opacity",e=>{this.$iApi.event.emit(an.LAYER_OPACITYCHANGE,{opacity:e,layer:this})})),this.esriWatches.push(this.esriLayer.watch("loadStatus",e=>{const i={"not-loaded":j0.LOADING,loading:j0.LOADING,loaded:j0.LOADED,failed:j0.ERROR};e==="loaded"?this.onLoad():e==="failed"?this.onError():this.updateLayerState(i[e])})),this.esriLayer.on("layerview-create",e=>{this.esriView=e.layerView,this.esriWatches.push(e.layerView.watch("updating",i=>{this.updateDrawState(i?Ub.REFRESH:Ub.UP_TO_DATE)})),this.viewDefProm.resolveMe()}),this.sublayers.forEach(e=>e.initiate())}async terminate(){this.updateInitiationState(T1.TERMINATING),this.sublayers.forEach(e=>e.terminate()),this.loadDefProm=new Fm,this.loadPromFulfilled=!1,this.viewDefProm=new Fm,this.esriWatches.forEach(e=>e.remove()),this.esriWatches=[],this.updateLayerState(j0.NEW),this.updateDrawState(Ub.NOT_LOADED),this.updateInitiationState(T1.TERMINATED)}async reload(){if(!this.$iApi.geo.map.esriMap){console.error("Attempted layer reload when no map exists");return}let e=0;if(this.initiationState===T1.INITIATED){if(this.esriLayer){const i=this.$iApi.geo.map.esriMap.layers.findIndex(r=>r.id===this.id);i>-1&&(e=i,this.$iApi.geo.map.esriMap.layers.remove(this.esriLayer))}this.$iApi.event.emit(an.LAYER_RELOAD_START,this),this.sublayers.forEach(i=>this.$iApi.event.emit(an.LAYER_RELOAD_START,i)),await this.terminate()}if(await this.initiate(),!this.esriLayer){console.error("ESRI layer failed to re-create during reload.");return}this.$iApi.geo.map.esriMap.layers.add(this.esriLayer,e),this.$iApi.event.emit(an.LAYER_RELOAD_END,this),this.sublayers.forEach(i=>this.$iApi.event.emit(an.LAYER_RELOAD_END,i))}makeEsriLayerConfig(e){return{id:e.id,url:e.url,opacity:e?.state?.opacity??1,visible:e?.state?.visibility??!0}}onLoad(){let e=!1;const i=setTimeout(()=>{e=!0,this.onError()},2e4),r=this.onLoadActions();Promise.all(r).then(()=>{clearTimeout(i),e?this.visibility=!1:(this.loadPromFulfilled&&(this.loadDefProm=new Fm),this.loadDefProm.resolveMe(),this.loadPromFulfilled=!0,this.stopTimer("load"),this.sublayers.forEach(n=>n.onLoad()),this.updateLayerState(j0.LOADED))}).catch(()=>{clearTimeout(i),this.onError()})}onError(){this.loadPromFulfilled&&(this.loadDefProm=new Fm),this.loadDefProm.rejectMe(),this.loadPromFulfilled=!0,this.sublayers.forEach(e=>e.onError()),this.$iApi.notify.show(uD.ERROR,this.$iApi.$i18n.t("layer.error",{id:this.id})),this.stopTimer("draw"),this.stopTimer("load"),this.updateLayerState(j0.ERROR)}onLoadActions(){return this.name||(this.name=this.esriLayer?.title||this.id),this.isCosmetic||(this.identify=this.config.state?.identify??this.supportsIdentify),[this.$iApi.geo.proj.checkProj(this.esriLayer.spatialReference).then(i=>i?Promise.resolve():Promise.reject())]}loadPromise(){return this.loadDefProm.getPromise()}get isLoaded(){return this.layerState===j0.LOADED}get layerExists(){return!!this.esriLayer}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 i;if(typeof e>"u")if(this.mapCheck())i=this.$iApi.geo.map.getScale();else return!1;else i=e;return this.scaleSet.isOffScale(i).offScale}canIdentify(){return this.supportsIdentify&&this.isLoaded&&this.visibility&&this.identify&&!this.scaleSet.isOffScale(this.$iApi.geo.map.getScale()).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 drawOrder(){return this._drawOrder}getLayerTree(){return this.layerTree?this.layerTree:(this.noLayerErr(),new yX(0,"YOU DID AN ERROR","Error, check your console pls"))}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()}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,i){return this.stubError(),Promise.resolve(new Wx(new SG))}getIcon(e){return this.stubError(),Promise.resolve("")}getSqlFilter(e){return this.stubError(),""}setSqlFilter(e,i){this.stubError()}getFilterOIDs(e=[],i=void 0){return this.stubError(),Promise.resolve(void 0)}applySqlFilter(e=[]){this.stubError()}setCustomParameter(e,i,r=!0){this.stubError()}startTimer(e){this.stopTimer(e),this.expectedTime[e]>0&&(this.timers[e]=setTimeout(()=>this.$iApi.notify.show(uD.WARNING,this.$iApi.$i18n.t(`layer.long${e}`,{id:this.id})),this.expectedTime[e]))}stopTimer(e){this.timers[e]&&clearTimeout(this.timers[e])}}class Ahe extends GK{geomType;esriFields;fieldList;attLoader;renderer;serviceUrl;quickCache;filter;constructor(e,i){super(e,i),this.supportsIdentify=!0,this.geomType=Rl.UNKNOWN,this.serviceUrl="",this.fieldList="",this.esriFields=[],this.filter=new Bui(e.permanentFilteredQuery||"",e.initialFilteredQuery||"")}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[i,r]=await pD(ir(this.serviceUrl,{query:{f:"json"}}));if(!r)return console.error(`Service metadata load error: ${this.serviceUrl}`,i),Promise.reject(new Error(`Service metadata load error: ${this.serviceUrl}`));if(!r.data)return console.error(`Service metadata load error: ${this.serviceUrl}`),Promise.reject(new Error(`Service metadata load error: ${this.serviceUrl}`));const n=r.data;if(this.geomType=this.$iApi.geo.geom.serverGeomTypeToRampGeomType(n.geometryType),this.quickCache=new ydt(this.geomType),this.scaleSet.minScale=n.effectiveMinScale||n.minScale,this.scaleSet.maxScale=n.effectiveMaxScale||n.maxScale,this.supportsFeatures=!1,this.extent=this.extent??(n.extent?Lp.fromArcServer(n.extent,this.id+"_extent"):void 0),this._serverVisibility=n.defaultVisibility,n.type==="Feature Layer"){this.supportsFeatures=!0,this.dataFormat=C1.ESRI_FEATURE,this.esriFields=Ho(n.fields.map(l=>Bo.fromJSON(l))),this.fields=this.esriFields.map(l=>({name:l.name,alias:l.alias,type:l.type,length:l.length})),this.nameField=n.displayField,this.esriFields.every(l=>l.type==="oid"?(this.oidField=l.name,!1):!0)&&(this.oidField=n.objectIdField||(()=>(console.error(`Encountered service with no OID defined: ${this.serviceUrl}`),""))()),this.drawOrder.forEach(l=>{this.esriFields.findIndex(c=>c.name===l.field)===-1&&console.error(`Draw order for layer ${this.id} references invalid field ${l.field}`)});const o=e&&e.customRenderer&&e.customRenderer.type?e.customRenderer:PR(n.drawingInfo.renderer);this.renderer=this.$iApi.geo.symbology.makeRenderer(o,this.esriFields),this.legend=this.$iApi.geo.symbology.rendererToLegend(this.renderer);const a={supportsLimit:(n.currentVersion||1)>=10.1,serviceUrl:this.serviceUrl,oidField:this.oidField,batchSize:-1,attribs:"*",permanentFilter:this.getSqlFilter($g.PERMANENT)};this.attLoader=new FTi(this.$iApi,a),this.origRampConfig.name||(this.name=n.name??this.id)}else this.dataFormat=C1.ESRI_RASTER,this.esriFields=[]}processFieldMetadata(e=void 0){if(!e){this.fieldList="*";return}if(!e.fieldInfo)throw new Error("processFieldMetadata called before fieldInfo was set on config metadata");if(e.exclusiveFields){e.fieldInfo.find(r=>r.name===this.oidField)||e.fieldInfo.push({name:this.oidField}),this.fieldList=e.fieldInfo.map(r=>r.name).join(",");const i=e.fieldInfo;this.esriFields=this.esriFields.filter(r=>i.find(n=>n.name===r.name))}else this.fieldList="*";e.fieldInfo.forEach(i=>{if(i.alias){const r=this.esriFields.find(n=>n.name===i.name);r&&(r.alias=i.alias)}})}getAttributes(){return this.attLoader?this.attLoader.getAttribs():(this.noLayerErr(),Promise.resolve({oidIndex:{},features:[]}))}abortAttributeLoad(){this.attLoader?this.attLoader.abortAttribLoad():this.noLayerErr()}clearFeatureCache(){this.attLoader?this.attLoader.destroyAttribs():this.noLayerErr(),this.quickCache&&this.quickCache.clearAll()}getTabularAttributes(){if(!this.attLoader)throw new Error("getTabularAttributes call with missing attribute loader");return this.attLoader.tabularAttributesCache||(this.attLoader.tabularAttributesCache=this.getTabularAttributesGuts()),this.attLoader.tabularAttributesCache}async getTabularAttributesGuts(){if(!this.attLoader)throw new Error("getTabularAttributesGuts call with missing attribute loader");if(this.dataFormat===C1.ESRI_RASTER)throw new Error("Attempting to get attributes on a raster layer.");const e=await this.attLoader.getAttribs();if(!e.features||e.features.length===0)return{columns:[],rows:[],fields:[],oidField:""};const i=this.esriFields.filter(n=>e.features[0].hasOwnProperty(Hs(n).name)).map(n=>({data:Hs(n).name,title:Hs(n).alias||Hs(n).name})),r=e.features.map(n=>{const s=IG({},n);return s.rvInteractive="",s.rvSymbol=this.renderer?.getGraphicIcon(n),s});return i.forEach(n=>{if(n.data.slice(-2)==="()"){const s=function(){return this[n.data]},o=n.data.slice(0,-2);r.forEach(a=>{a[o]=s})}}),{columns:i,rows:r,fields:this.fields,oidField:this.oidField}}async getGraphic(e,i){let r={},n=new SG;const s=this.$iApi.geo.map;if(!this.quickCache)throw new Error("getGraphic call with missing quickCache");if(!this.attLoader)throw new Error("getGraphic call with missing attribute loader");let o=!1,a=!1,l=0;if(i.getAttribs||i.getStyle){const d=this.quickCache.getAttribs(e);if(d)r=d;else if(this.attLoader.isLoaded()||this.isFile){const p=await this.attLoader.getAttribs();r=p.features[p.oidIndex[e]]}else o=!0}if(i.getGeom){l=s.getScale();const d=this.quickCache.getGeom(e,l);d?n=d:a=!0}if(o||a){const d={oid:e,serviceUrl:this.serviceUrl,includeGeometry:a,attribs:this.fieldList};a&&(d.mapSR=s.getSR().wkid?.toString(),this.quickCache.isPoint||(d.maxOffset=s.esriView?.resolution));const p=await this.$iApi.geo.attributes.loadSingleFeature(d);a&&(this.quickCache.setGeom(e,p.geometry,l),n=p.geometry),(o||typeof this.quickCache.getAttribs(e)>"u")&&(this.quickCache.setAttribs(e,p.attributes),o&&(r=p.attributes))}const c=new Wx(n,"",i.getAttribs?r:void 0);if(i.getStyle){const d=Hs(this.renderer.getGraphicSymbol(r));c.style=this.$iApi.geo.geom.styleEsriToRamp(d)}return c}async getIcon(e){if(!this.renderer)throw new Error("getIcon called before renderer is defined");const i=await this.getGraphic(e,{getAttribs:!0});return this.$iApi.geo.symbology.getGraphicIcon(i.attributes||{},this.renderer)}setSqlFilter(e,i){const r=this.filter.getSql(e);if(i===r)return;this.filter.setSql(e,i),this.$iApi.event.emit(an.FILTER_CHANGE,{uid:this.uid,filterKey:e});const n=`${this.uid}-${e}-${i}`;this._lastFilterUpdate=n,setTimeout(()=>{this._lastFilterUpdate===n&&this.applySqlFilter()},100)}applySqlFilter(e=[]){throw new Error("attempted to apply sql filter 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=[],i=void 0){const r=this.filter.getCombinedSql(e),n=!!i;if(!(r||n))return;i&&this.filter.setExtent(i);const s=this.filter.sqlActiveFilters(e);let o=this.filter.getCache(s,n);if(!o){const a={filterGeometry:i,filterSql:r,includeGeometry:!1};o=this.queryOIDs(a),this.filter.setCache(o,s,n)}return o}async loadFeatureCount(){if(!this.serviceUrl){console.warn("A layer without a url attempted to run the server based feature count routine.");return}const e={query:{f:"json",where:"1=1",returnCountOnly:!0,returnGeometry:!1}},[i,r]=await pD(ir(`${this.serviceUrl}/query`,e));if(!r){console.warn(`Feature count request unsuccessful: ${this.serviceUrl}`,i);return}if(!r.data){console.warn(`Unable to load feature count: ${this.serviceUrl}`);return}this.featureCount=r.data.count}queryOIDs(e){this.isFile&&(console.error("a file layer called a server based query function"),console.trace());const i={url:this.serviceUrl,...e};return this.$iApi.geo.query.arcGisServerQueryIds(i)}async queryFeaturesDiscrete(e){const i=await this.queryOIDs(e),r={getGeom:!!e.includeGeometry,getAttribs:!0};return i.map(n=>({oid:n,graphic:this.getGraphic(n,r)}))}async queryFeatures(e){const i=await this.queryFeaturesDiscrete(e);return Promise.all(i.map(r=>r.graphic))}}class hdt extends GK{constructor(e,i){super(e,i),this.dataFormat=C1.ESRI_FEATURE,this.layerFormat=Hx.GRAPHIC,this.hovertips=!1}_graphics=[];makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}getGraphicCount(){return this._graphics.length}getLocalGraphic(e){return this._graphics.find(i=>i.id===e)}getEsriGraphic(e){return this.esriLayer?.graphics.find(i=>i.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 i;e instanceof Array?i=e:i=[e];const r=i.filter(l=>this._graphics.findIndex(d=>d.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,c)=>{const d=new Wx(o[c],l.id,l.attributes);return d.style=l.style,this.$iApi.geo.geom.graphicRampToEsri(d)});this.esriLayer.addMany(a)}removeGraphic(e){if(!this.esriLayer){this.noLayerErr();return}if(typeof e>"u"){this.esriLayer.removeAll(),this._graphics=[];return}let i;Array.isArray(e)?i=e:i=[e];const r=i.map(s=>typeof s=="string"?s:s.id),n=[];r.forEach(s=>{const o=this.esriLayer?.graphics.find(a=>a.id===s);if(o){n.push(o);const a=this._graphics.findIndex(l=>l.id===s);a!=-1&&this._graphics.splice(a,1)}}),this.esriLayer.removeMany(n),this._graphics=this._graphics.filter(s=>r.includes(s.id))}}class ddt extends hdt{constructor(e,i){super(e,i),this.layerType=_n.GRAPHIC}async onInitiate(){this.esriLayer=Ho(new yXe(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(Ub.UP_TO_DATE),e}}function pdt(t,e){if(t.findIndex(i=>i.name===e)===-1){const i=t.find(r=>r.alias===e);return i?i.name:(console.warn(`Cannot find name field in layer field list: ${e}`),"OBJECTID")}else return e}class Phe extends Ahe{esriJson;sourceGeoJson;tooltipField;constructor(e,i){super(e,i),this.supportsIdentify=!0,this.isFile=!0,this.dataFormat=C1.ESRI_FEATURE,this.layerFormat=Hx.FEATURE,this.tooltipField="",e.identifyMode&&e.identifyMode!==vm.NONE?this.identifyMode=e.identifyMode:this.identifyMode=vm.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 raw data.");const e=typeof this.sourceGeoJson=="string"?JSON.parse(this.sourceGeoJson):JSON.parse(JSON.stringify(this.sourceGeoJson)),i={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(e,i),this.esriLayer=Ho(new Hc(this.makeEsriLayerConfig(this.origRampConfig))),this.esriJson=void 0,this.origRampConfig.caching!==!0&&delete this.origRampConfig.rawData,delete this.sourceGeoJson,await super.onInitiate()}makeEsriLayerConfig(e){const i=super.makeEsriLayerConfig(e),r="OBJECTID";return["source","objectIdField","id","fields","renderer","spatialReference","geometryType"].forEach(s=>{i[s]=this.esriJson[s]}),this.origRampConfig.nameField?i.displayField=pdt(i.fields,this.origRampConfig.nameField)||r:i.displayField=r,i.outFields=["*"],delete i.url,Array.isArray(e.drawOrder)&&e.drawOrder.length>0?(i.orderBy=e.drawOrder.map(s=>({field:s.field,order:s.ascending?"ascending":"descending"})),this._drawOrder=e.drawOrder.slice()):(i.orderBy=[{field:r,order:"descending"}],this._drawOrder=[{field:r,ascending:!1}]),i}onLoadActions(){const e=super.onLoadActions();if(this.esriLayer&&this.origRampConfig.customRenderer?.type&&(this.esriLayer.renderer=PR(this.config.customRenderer)),this.layerTree.name=this.name,this.extractLayerMetadata(),this.origRampConfig.tooltipField?this.tooltipField=pdt(this.esriFields,this.origRampConfig.tooltipField):this.tooltipField=this.nameField,this.processFieldMetadata(this.origRampConfig.fieldMetadata),!this.attLoader)throw new Error("file layer did not have attribute loader object");return this.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 i=new Fm,r=Tl({items:[],loading:i.getPromise(),loaded:!1,uid:this.uid,requestTime:Date.now()});let n=Promise.resolve(),s=Promise.resolve(),o=[];if(this.identifyMode===vm.HYBRID||this.identifyMode===vm.GEOMETRIC){const a={includeGeometry:!1};this.geomType!==Rl.POLYGON&&e.geometry.type===Rl.POINT?a.filterGeometry=this.$iApi.geo.query.makeClickBuffer(e.geometry,e.tolerance):a.filterGeometry=e.geometry,a.filterSql=this.getCombinedSqlFilter(),s=this.queryFeatures(a).then(l=>{o=l})}return e.hitTest&&(this.identifyMode===vm.HYBRID||this.identifyMode===vm.SYMBOLIC)&&(n=s.then(async()=>{const a=await e.hitTest,l=await Promise.all(a.filter(c=>c.layerId===this.id&&o.findIndex(d=>c.oid===d.attributes[this.oidField])===-1).map(c=>this.getGraphic(c.oid,{getAttribs:!0})));o=o.concat(l)})),Promise.all([n,s]).then(()=>{o.forEach(a=>{const l=Tl({data:a.attributes,format:XI.ESRI,loaded:!0,loading:Promise.resolve()});r.items.push(l)}),r.loaded=!0,i.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.quickCache=new ydt(this.geomType),this.scaleSet.minScale=e.minScale||0,this.scaleSet.maxScale=e.maxScale||0,this.extent=this.extent??Lp.fromESRI(e.fullExtent,this.id+"_extent"),this.esriFields=Ho(e.fields.slice()),this.fields=this.esriFields.map(r=>({name:r.name,alias:r.alias,type:r.type,length:r.length})),this.nameField=e.displayField,this.oidField=e.objectIdField,this.renderer=this.$iApi.geo.symbology.makeRenderer(e.renderer,this.esriFields),this.legend=this.$iApi.geo.symbology.rendererToLegend(this.renderer);const i={sourceGraphics:e.source,oidField:this.oidField,attribs:"*",batchSize:-1};this.attLoader=new LTi(this.$iApi,i)}async getGraphic(e,i){const r={filterSql:`${this.oidField}=${e}`,includeGeometry:!!i.getGeom},n=await this.queryFeatures(r);if(n.length===0)throw new Error(`Could not find object id ${e}`);n.length!==1&&console.warn("did not get a single result on a query for a specific object id");const s=n[0];if(i.getStyle){const o=Hs(this.renderer.getGraphicSymbol(s.attributes));s.style=this.$iApi.geo.geom.styleEsriToRamp(o)}return s}async queryFeatures(e){const i={layer:this,...e};return this.$iApi.geo.query.geoJsonQuery(i)}async queryOIDs(e){const i={layer:this,...e};return(await this.$iApi.geo.query.geoJsonQuery(i)).map(n=>n.attributes?n.attributes[this.oidField]:-1)}applySqlFilter(e=[]){if(!this.esriView){this.noLayerErr();return}const i=this.filter.getCombinedSql(e);Hs(this.esriView).filter=new bq({where:i})}}class CTi extends Phe{constructor(e,i){super(e,i),this.layerType=_n.GEOJSON}async onInitiate(){if(this.origRampConfig.rawData&&(typeof this.origRampConfig.rawData=="string"||this.origRampConfig.rawData instanceof Object))this.sourceGeoJson=this.origRampConfig.rawData;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 TTi extends Phe{constructor(e,i){super(e,i),this.layerType=_n.SHAPEFILE}async onInitiate(){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("shapefile file config contains no raw data or url");this.sourceGeoJson=await this.$iApi.geo.layer.files.shapefileToGeoJson(e),await super.onInitiate()}}class ETi extends Phe{constructor(e,i){super(e,i),this.layerType=_n.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 ITi extends Ahe{tooltipField;constructor(e,i){super(e,i),this.dataFormat=C1.ESRI_FEATURE,this.tooltipField="",this.supportsIdentify=!0,this.layerType=_n.FEATURE,this.layerFormat=Hx.FEATURE,e.identifyMode&&e.identifyMode!==vm.NONE?this.identifyMode=e.identifyMode:this.identifyMode=vm.HYBRID}async onInitiate(){Ho(this.esriLayer=new Hc(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){const i=super.makeEsriLayerConfig(e);return(e.initialFilteredQuery||e.permanentFilteredQuery)&&(i.definitionExpression=this.filter.getCombinedSql()),Array.isArray(e.drawOrder)&&e.drawOrder.length>0&&(i.orderBy=e.drawOrder.map(r=>({field:r.field,order:r.ascending?"ascending":"descending"})),this._drawOrder=e.drawOrder.slice()),i}onLoadActions(){const e=super.onLoadActions(),i=this.esriLayer&&this.origRampConfig.customRenderer?.type;i&&(this.esriLayer.renderer=PR(this.config.customRenderer));const r=this.esriLayer.parsedUrl.path,s=this.$iApi.geo.shared.parseUrlIndex(r).index||0;this.serviceUrl=r;const o=this.loadLayerMetadata(i?{customRenderer:this.esriLayer?.renderer}:{}).then(()=>{if(!this.attLoader)throw new Error("layer metadata loader did not create attribute loader");this.visibility=this.origRampConfig?.state?.visibility??this._serverVisibility??!0,this.nameField=this.origRampConfig.nameField||this.nameField||"",this.tooltipField=this.origRampConfig.tooltipField||this.nameField,this.processFieldMetadata(this.origRampConfig.fieldMetadata),this.attLoader.updateFieldList(this.fieldList),this.esriLayer?.orderBy||(this.esriLayer.orderBy=[{field:this.oidField,order:"descending"}],this._drawOrder=[{field:this.oidField,ascending:!1}])}),a=this.loadFeatureCount();return this.layerTree.name=this.name,this.layerTree.layerIdx=s,e.push(o,a),e}runIdentify(e){if(!this.canIdentify())return[];const i=new Fm,r=Tl({items:[],loading:i.getPromise(),loaded:!1,uid:this.uid,requestTime:Date.now()});let n=Promise.resolve(),s=Promise.resolve(),o=[];if(this.identifyMode===vm.HYBRID||this.identifyMode===vm.GEOMETRIC){const a={includeGeometry:!1};this.geomType!==Rl.POLYGON&&e.geometry.type===Rl.POINT?a.filterGeometry=this.$iApi.geo.query.makeClickBuffer(e.geometry,e.tolerance):a.filterGeometry=e.geometry,a.filterSql=this.getCombinedSqlFilter(),s=this.queryFeaturesDiscrete(a).then(l=>{o=l})}return e.hitTest&&(this.identifyMode===vm.HYBRID||this.identifyMode===vm.SYMBOLIC)&&(n=s.then(async()=>{(await e.hitTest).filter(l=>l.layerId===this.id&&o.findIndex(c=>l.oid===c.oid)===-1).forEach(l=>{o.push({oid:l.oid,graphic:this.getGraphic(l.oid,{getAttribs:!0})})})})),Promise.all([n,s]).then(()=>{o.forEach(a=>{const l=Tl({data:void 0,format:XI.ESRI,loaded:!1,loading:new Promise(c=>{a.graphic.then(d=>{l.data=d.attributes,l.loaded=!0,c()})})});r.items.push(l)}),r.loaded=!0,i.resolveMe()}),[r]}applySqlFilter(e=[]){if(!this.esriLayer){this.noLayerErr();return}const i=this.filter.getCombinedSql(e);this.esriLayer.definitionExpression=i}}class ATi extends Ahe{isDynamic;origState;constructor(e,i){super(e,i),this.supportsIdentify=!0,this.supportsSublayers=!0,this.layerType=_n.MAPIMAGE,this.layerFormat=Hx.MAPIMAGE,this.isDynamic=!1,this.hovertips=!1,this.layerTree.layerIdx=-1,this.identifyMode=vm.GEOMETRIC}async onInitiate(){this.esriLayer=Ho(new WTe(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){const i=super.makeEsriLayerConfig(e);return this.origState={visibility:i.visible,opacity:i.opacity},i.visible=!1,e.imageFormat&&(i.imageFormat=e.imageFormat),i}onLoadActions(){const e=super.onLoadActions();if(!this.esriLayer)return this.noLayerErr(),e;this.layerTree.name=this.name,this.isDynamic=this.esriLayer.capabilities.exportMap.supportsDynamicLayers,this.extent=this.extent??Lp.fromESRI(this.esriLayer.fullExtent,this.id+"_extent");const i=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,c=r[l];if(o.sublayers&&o.sublayers.length>0){const d=(c?c.name:"")||o.title||"",p=new yX(l,"",d,!1);a.findChildByIdx(l)||a.children.push(p),o.sublayers.forEach(y=>{s(y,p)})}else{this._sublayers[l]||(this._sublayers[l]=new PTi({id:`${this.id}-${l}`,layerType:_n.SUBLAYER,name:r[l]?.name,state:r[l]?.state??{opacity:this.opacity,visibility:this.visibility,hovertips:this.hovertips,identify:this.identify},extent:r[l]?.extent,controls:r[l]?.controls,disabledControls:r[l]?.disabledControls,initialFilteredQuery:r[l]?.initialFilteredQuery,permanentFilteredQuery:r[l]?.permanentFilteredQuery},this.$iApi,this,l));const d=this._sublayers[l];if(d.isRemoved)return;const p=(c?c.name:"")||o.title||"";if(d.name=p,n.push(d),!a.children.map(y=>y.layerIdx).includes(l)){const y=new yX(l,d.uid,d.name,!1);a.children.push(y)}d.esriWatches.push(o.watch("visible",()=>{this.$iApi.event.emit(an.LAYER_VISIBILITYCHANGE,{visibility:d.visibility,layer:d}),d.parentLayer?.checkVisibility()}),o.watch("opacity",y=>{this.$iApi.event.emit(an.LAYER_OPACITYCHANGE,{opacity:y,layer:d})}))}};return this.origRampConfig.sublayers.forEach(o=>{if(!o.cosmetic){const a=i(o.index||0);s(a,this.layerTree)}}),n.forEach(o=>{const a=i(o.layerIdx),l=r[o.layerIdx];o.serviceUrl=a.url,o.fetchEsriSublayer(this),o.initiate();const c=o.esriSubLayer&&l?.customRenderer?.type;c&&(o.esriSubLayer.renderer=PR(l.customRenderer));const d=o.loadLayerMetadata(c?{customRenderer:o.esriSubLayer?.renderer}:{}).then(()=>{const p=r[o.layerIdx];if(p?(o.visibility=o.isRemoved?!1:p.state?.visibility??(this.origState.visibility?o._serverVisibility??this.origState.visibility:this.origState.visibility??o._serverVisibility)??!0,o.opacity=p.state?.opacity??this.origState.opacity??1,o.nameField=p.nameField||o.nameField||"",o.processFieldMetadata(p.fieldMetadata)):o.processFieldMetadata(),o.supportsFeatures){if(!o.attLoader)throw new Error("Map Image Sublayer - expected attLoader to exist");return o.attLoader.updateFieldList(o.fieldList),o.loadFeatureCount()}else return Promise.resolve()});e.push(d)}),this.esriLayer.allSublayers.forEach(o=>{!o.sublayers&&!n.find(a=>a.layerIdx===o.id)&&(o.visible=!1,o.opacity=0)}),this.visibility=this.origState.visibility??!0,e}updateLayerState(e){super.updateLayerState(e),this.sublayers.forEach(i=>i.updateLayerState(e))}updateDrawState(e){super.updateDrawState(e),this.sublayers.forEach(i=>i.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 i=e.sublayerIds?this._sublayers.filter(n=>e.sublayerIds?.includes(n.uid)):this._sublayers.filter(n=>n.canIdentify());if(i.length===0)return[];let r;return e.geometry.type===Rl.POINT&&(r=this.$iApi.geo.query.makeClickBuffer(e.geometry,e.tolerance)),i.map(n=>{const s=new Fm,o={},a=Tl({items:[],loading:s.getPromise(),loaded:!1,uid:n.uid,requestTime:Date.now()});return n.geomType!==Rl.POLYGON&&r?o.filterGeometry=r:o.filterGeometry=e.geometry,o.filterSql=n.getCombinedSqlFilter(),n.queryFeaturesDiscrete(o).then(l=>{l.forEach(c=>{const d=Tl({data:void 0,format:XI.ESRI,loaded:!1,loading:new Promise(p=>{c.graphic.then(y=>{d.data=y.attributes,d.loaded=!0,p()})})});a.items.push(d)}),a.loaded=!0,s.resolveMe()}),a})}noFeaturesErr(){console.error("This method targets features and must be called on a Sublayer."),console.trace()}getAttributes(){return this.noFeaturesErr(),Promise.resolve({features:[],oidIndex:{}})}abortAttributeLoad(){this.noFeaturesErr()}clearFeatureCache(){this.noFeaturesErr()}getTabularAttributes(){return this.noFeaturesErr(),Promise.resolve({columns:[],rows:[],fields:[],oidField:"error"})}getGraphic(e,i){return this.noFeaturesErr(),Promise.resolve(new Wx(new SG))}getIcon(e){return this.noFeaturesErr(),Promise.resolve("")}getSqlFilter(e){return this.noFeaturesErr(),""}applySqlFilter(e=[]){this.noFeaturesErr()}getFilterOIDs(e=[],i=void 0){return this.noFeaturesErr(),Promise.resolve(void 0)}}class PTi extends Ahe{tooltipField;constructor(e,i,r,n=0){if(super(e,i),this.layerType=_n.SUBLAYER,this.layerFormat=Hx.MAPIMAGE,this.isSublayer=!0,this.layerIdx=n,this.parentLayer=r,this.dataFormat=C1.ESRI_FEATURE,this.tooltipField="",this.hovertips=!1,!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=Ho(e.esriLayer.allSublayers.find(i=>i.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(){this.initiationState=T1.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 i=this.filter.getCombinedSql(e);this.esriSubLayer.definitionExpression=i}}class OTi extends GK{constructor(e,i){super(e,i),this.supportsIdentify=!1,this.layerType=_n.OSM,this.layerFormat=Hx.OSM,this.dataFormat=C1.OSM_TILE,this.supportsFeatures=!1,this.hovertips=!1}async onInitiate(){this.esriLayer=Ho(new JTe(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}onLoadActions(){const e=super.onLoadActions();this.layerTree.name=this.name;const i=this.$iApi.geo.symbology.generatePlaceholderSymbology("O","#03fc4e"),r={uid:this.$iApi.geo.shared.generateUUID(),label:"OpenStreetMap",svgcode:i.svgcode,esriStandard:!0,drawPromise:Promise.resolve()};return this.legend.push(r),e}}class fdt extends GK{constructor(e,i){super(e,i),this.supportsIdentify=!1,this.hovertips=!1,this.layerType=_n.TILE,this.layerFormat=Hx.TILE,this.dataFormat=C1.ESRI_TILE}async onInitiate(){this.esriLayer=Ho(new eEe(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}onLoadActions(){const e=super.onLoadActions();this.layerTree.name=this.name;const i=this.$iApi.geo.symbology.mapServerToLocalLegend(this.origRampConfig.url).then(r=>{this.legend=r});return e.push(i),e}}class RTi extends GK{sublayerNames;mimeType;constructor(e,i){super(e,i),this.supportsIdentify=!0,this.hovertips=!1,this.layerType=_n.WMS,this.layerFormat=Hx.WMS,this.mimeType=e.featureInfoMimeType||"",this.sublayerNames=[],this.dataFormat=C1.OGC_RASTER,this.identifyMode=vm.GEOMETRIC}async onInitiate(){this.esriLayer=Ho(new FZe(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){const i=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 i.customParameters={styles:n},e.url.indexOf("/geomet")!==-1&&(i.customParameters.layers=r[0].id),i}onLoadActions(){const e=super.onLoadActions();this.layerTree.name=this.name;const i=r=>{let n=!1;return r.forEach(s=>{this.sublayerNames.indexOf(s.name)>-1||s.sublayers&&s.sublayers.length>0&&i(s.sublayers)?n=!0:s.visible=!1}),n};return this.esriLayer?i(this.esriLayer.sublayers):this.noLayerErr(),this.loadSymbology(),e}canIdentify(){return super.canIdentify()}runIdentify(e){if(e.geometry.type!==Rl.POINT)throw new Error("a point must be used for WMS Identify");if(this.$iApi.geo.map,!this.canIdentify())return[];const i=new Fm,r=Tl({items:[],loading:i.getPromise(),loaded:!1,uid:this.uid,requestTime:Date.now()});return this.getFeatureInfo(this.sublayerNames,e.geometry,this.mimeType).then(n=>{if(n){const s=Tl({data:n,format:XI.UNKNOWN,loaded:!0,loading:Promise.resolve()});typeof n!="string"?(s.format=XI.JSON,r.items.push(s)):n.indexOf("Search returned no results")===-1&&n!==""&&(s.format=XI.TEXT,r.items.push(s))}r.loaded=!0,i.resolveMe()}),[r]}setCustomParameter(e,i,r=!0){this.esriLayer?(this.esriLayer.customLayerParameters[e]=i,r&&this.esriLayer.refresh()):this.noLayerErr()}getFeatureInfo(e,i,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(),c=s.spatialReferences,d=e.join(","),p=n.esriView.toScreen(i.toESRI()),y=Math.floor(p.x),v=Math.floor(p.y),I={"application/json":"json","text/html":"text","text/plain":"text"}[r]||"text",O=n.getSR();O.wkid?o=O.wkid:(o=4326,console.error("Map is likely in a WKT projection. WMS Identify request will likely fail.")),c&&c.length>1?c.indexOf(o)===-1&&(O.latestWkid&&c.indexOf(O.latestWkid)>-1?o=O.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:y,J:v,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:y,Y:v},a.hasOwnProperty("BBOX")||(a.BBOX=`${l.xmin},${l.ymin},${l.xmax},${l.ymax}`);const L={SERVICE:"WMS",REQUEST:"GetFeatureInfo",VERSION:s.version,WIDTH:n.getPixelWidth(),HEIGHT:n.getPixelHeight(),QUERY_LAYERS:d,LAYERS:d,INFO_FORMAT:r},N=s.customLayerParameters;return N&&Object.keys(N).forEach(G=>{G.toLowerCase()!=="styles"&&(L[G]=N[G])}),Object.keys(L).forEach(G=>a[G]=L[G]),ir(s.url.split("?")[0],{query:a,responseType:I})}getLegendUrls(e){if(!this.esriLayer)return this.noLayerErr(),[];const i=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 bX(n.legendUrl);"STYLE"in o.queryMap&&o.queryMap.STYLE!==s.currentStyle&&(n.legendUrl=o.updateQuery({STYLE:s.currentStyle}))}}),i.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]=i.get(e[s].id))}),r}getWMSLayerTitle(e){if(!this.esriLayer)return"";let i;return this.esriLayer.allSublayers.some(r=>{if(r.name===e)return i=r.title,!0}),i||""}loadSymbology(){const e=this.config.sublayers,i=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=i}}class MTi extends Phe{constructor(e,i){super(e,i),this.layerType=_n.WFS}async onInitiate(){const e=new bX(this.config.url),{startindex:i,limit:r}=e.queryMap;this.sourceGeoJson||(this.sourceGeoJson=await this.$iApi.geo.layer.ogc.loadWfsData(this.config.url,-1,parseInt(i)||0,parseInt(r)||1e3,void 0,this.config.xyInAttribs)),await super.onInitiate()}}class DTi extends Np{constructor(e){super(e)}oidIndexer(e,i){e.features.forEach((r,n)=>{e.oidIndex[r[i]]=n})}async arcGisBatchLoad(e,i){if(i.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 pD(ir(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){i.loadedCount+=l;let c;if(e.supportsLimit?c=o.data.exceededTransferLimit:(e.batchSize===-1&&(e.batchSize=l),c=l>=e.batchSize),c){e.maxId=a[l-1].attributes[e.oidField];const d=await this.arcGisBatchLoad(e,i);return i.loadAbortFlag?[]:a.concat(d)}else return i.loadAbortFlag?[]:a}else return[]}async loadArcGisServerAttributes(e,i){e.maxId=-1,e.batchSize=-1;const n={features:(await this.arcGisBatchLoad(e,i)).map(s=>s.attributes),oidIndex:{}};return this.oidIndexer(n,e.oidField),i.loadIsDone=!0,n}async loadGraphicsAttributes(e,i){if(!e.sourceGraphics)throw new Error("No .sourceGraphics provided to file layer attribute loader");const n={features:e.sourceGraphics.map(s=>Hs(s).attributes).toArray(),oidIndex:{}};return this.oidIndexer(n,e.oidField),i.loadIsDone=!0,i.loadedCount=n.features.length,n}async loadSingleFeature(e){const i={query:{f:"json",objectIds:e.oid,returnGeometry:e.includeGeometry,outFields:e.attribs}};typeof e.maxOffset<"u"&&(i.query.maxAllowableOffset=e.maxOffset),typeof e.mapSR<"u"&&(i.query.outSR=e.mapSR);const[r,n]=await pD(ir(e.serviceUrl+"/query",i));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=fl(o.geometry);a=this.$iApi.geo.geom.geomEsriToRamp(l)}else a=new SG;return new Wx(a,"",o.attributes)}return Promise.reject(new Error(`Could not locate feature ${e.oid} for layer ${e.serviceUrl}`))}}class mdt{loadedCount;loadAbortFlag;loadIsDone;constructor(){this.loadedCount=0,this.loadAbortFlag=!1,this.loadIsDone=!1}}class gdt extends Np{aac;loadPromise;details;tabularAttributesCache;constructor(e,i){super(e),this.aac=new mdt,this.details=i}updateFieldList(e){this.details.attribs=e}getAttribs(){return this.loadPromise||(this.aac=new mdt,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 FTi extends gdt{constructor(e,i){super(e,i)}loadPromiseGenerator(){return this.$iApi.geo.attributes.loadArcGisServerAttributes(this.details,this.aac)}}class LTi extends gdt{constructor(e,i){super(e,i)}loadPromiseGenerator(){return this.$iApi.geo.attributes.loadGraphicsAttributes(this.details,this.aac)}}class ydt{attribs;geoms;isPoint;constructor(e){this.attribs={},this.geoms={},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,i){this.attribs[e]=i}getGeom(e,i=void 0){return this.getGeomStore(i)[e]}setGeom(e,i,r=void 0){const n=this.getGeomStore(r);n[e]=i}clearAll(){this.attribs={},this.geoms={}}}class N3e{innerRenderer;symbolUnits;defaultUnit;type;falseRenderer;constructor(e,i,r=!1){this.innerRenderer=e,this.symbolUnits=[],this.falseRenderer=r,this.type=wre.Unknown}makeSearchParams(e){return e}searchRenderer(e){const i=this.makeSearchParams(e),r=this.symbolUnits.find(s=>s.match(i));if(r)return r;if(this.defaultUnit)return this.defaultUnit;console.error(`renderer search could not find match for ${i}`);const n=new Ohe(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,i){let r="'";if(!i||i.length===0)return r;const n=i.find(s=>s.name===e);return n&&n.type&&n.type!=="string"&&(r=""),r}cleanFieldName(e,i){if(!e)return e;let r=i.find(n=>n.name===e);if(r)return e;{const n=e.toLowerCase();return r=i.find(s=>s.name.toLowerCase()===n),r?r.name:e}}makeElseClause(){return this.falseRenderer?"":`(NOT (${this.symbolUnits.map(i=>i.definitionClause).join(" OR ")}))`}}class Ohe{isDefault=!1;svgCode="";symbol;definitionClause="";label="";parent;constructor(e){this.parent=e,this.symbol=new gd}match(e){return!0}}class kTi extends N3e{constructor(e,i){super(e,i),this.type=wre.Simple;const r=new Ohe(this);r.label=e.label||"",r.symbol=e.symbol,r.definitionClause="1=1",this.symbolUnits.push(r)}}class NTi extends N3e{delim;keyFields;constructor(e,i,r=!1){super(e,i,r),this.type=wre.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,i));const s=this.keyFields.map(o=>this.getFieldDelimiter(o,i));if(e.uniqueValueInfos.forEach(o=>{const a=new vdt(this,o.value);if(a.label=o.label||"",a.symbol=o.symbol,!this.falseRenderer){const l=a.matchValue.split(this.delim),c=this.keyFields.map((d,p)=>`${d} = ${s[p]}${n(l[p])}${s[p]}`).join(" AND ");a.definitionClause=`(${c})`}this.symbolUnits.push(a)}),e.defaultSymbol){const o=new vdt(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(i=>{let r=e[i]===null?"":e[i];return typeof r!="string"&&(r=r.toString()),r}).join(this.delim)}}class vdt extends Ohe{matchValue;constructor(e,i){super(e),typeof i=="number"?this.matchValue=i.toString():this.matchValue=i}match(e){return this.matchValue===e}}class $Ti extends N3e{valField;constructor(e,i,r=!1){if(super(e,i,r),this.valField=this.cleanFieldName(e.field,i),e.classBreakInfos.forEach(n=>{const s=new _dt(this,n.minValue,n.maxValue);s.label=n.label||"",s.symbol=n.symbol,this.falseRenderer||(s.definitionClause=`(${this.valField} > ${n.minValue} AND ${this.valField} <= ${n.maxValue})`),this.symbolUnits.push(s)}),e.defaultSymbol){const n=new _dt(this,0,0);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 _dt extends Ohe{minValue;maxValue;constructor(e,i,r){super(e),this.minValue=i,this.maxValue=r}match(e){return this.minValue===this.maxValue?this.maxValue===e:this.minValue=e}}var fD={},BTi={get exports(){return fD},set exports(t){fD=t}};/*! +`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""),this.options.supressEmptyNode?(this.buildTextNode=c,this.buildObjNode=a):(this.buildTextNode=l,this.buildObjNode=o),this.buildTextValNode=l,this.buildObjectNode=o}r.prototype.parse=function(v){return this.j2x(v,0).val},r.prototype.j2x=function(v,x){let I="",P="";const F=Object.keys(v),k=F.length;for(let j=0;j"u"))if(v[V]===null)P+=this.indentate(x)+"<"+V+"/"+this.tagEndChar;else if(v[V]instanceof Date)P+=this.buildTextNode(v[V],V,"",x);else if(typeof v[V]!="object"){const Y=this.isAttribute(V);Y?I+=" "+Y+'="'+this.options.attrValueProcessor(""+v[V])+'"':this.isCDATA(V)?v[this.options.textNodeName]?P+=this.replaceCDATAstr(v[this.options.textNodeName],v[V]):P+=this.replaceCDATAstr("",v[V]):V===this.options.textNodeName?v[this.options.cdataTagName]||(P+=this.options.tagValueProcessor(""+v[V])):P+=this.buildTextNode(v[V],V,"",x)}else if(Array.isArray(v[V]))if(this.isCDATA(V))P+=this.indentate(x),v[this.options.textNodeName]?P+=this.replaceCDATAarr(v[this.options.textNodeName],v[V]):P+=this.replaceCDATAarr("",v[V]);else{const Y=v[V].length;for(let X=0;X"u"))if(Z===null)P+=this.indentate(x)+"<"+V+"/"+this.tagEndChar;else if(typeof Z=="object"){const ie=this.j2x(Z,x+1);P+=this.buildObjNode(ie.val,V,ie.attrStr,x)}else P+=this.buildTextNode(Z,V,"",x)}}else if(this.options.attrNodeName&&V===this.options.attrNodeName){const Y=Object.keys(v[V]),X=Y.length;for(let Z=0;Z");return v+this.newLine}function o(v,x,I,P){return I&&!v.includes("<")?this.indentate(P)+"<"+x+I+">"+v+""+this.options.tagValueProcessor(v)+"0&&s.features[0].geometry.type===Op.POINT&&s.features.forEach(v=>{const x=v.geometry.coordinates;v.properties.rvInternalCoordX=x[0],v.properties.rvInternalCoordY=x[1]}),s}reversedAxisWKIDs(){return oEi}parseCapabilities(e){const i=()=>{let o=e;if(e.indexOf("?")===-1)o+="?service=WMS&request=GetCapabilities";else{const a=new _X(e.toUpperCase());"SERVICE"in a.queryMap||(o+="&service=WMS"),"REQUEST"in a.queryMap||(o+="&request=GetCapabilities")}return ur(o,{responseType:"xml"}).then(a=>a.data)},r=new Promise(o=>{i().then(a=>o(a)).catch(()=>{console.error("Get capabilities failed; trying the second time;"),o(i())})}),n=o=>{let a=o.Layer;return a?(Array.isArray(a)||(a=[a]),a.map(l=>{const c=l.Name,h=l.Title;let p=l.Style;const y=[],v={};return p&&(Array.isArray(p)||(p=[p]),p.forEach(x=>{const I=x.Name;if(y.push(I),x.LegendURL){const F=x.LegendURL.OnlineResource["@_xlink:href"];v[I]=F.replaceAll("&","&")}})),{name:c?.toString()??null,title:h,queryable:l["@_queryable"]==="1",layers:n(l),allStyles:y,styleToURL:v,currentStyle:y[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},c=Fdt.parse(a,l);if("ServiceExceptionReport"in c)return console.error(c.ServiceExceptionReport.ServiceException),[];const h=c.WMS_Capabilities.Capability;return{layers:n(h),queryTypes:s(h.Request.GetFeatureInfo)}})}}class IEi extends Gp{files;ogc;constructor(e){super(e),this.files=new sEi(e),this.ogc=new EEi(e)}createLayer(e){let i;switch(e.layerType){case _n.FEATURE:i=REi;break;case _n.MAPIMAGE:i=MEi;break;case _n.GRAPHIC:i=Xdt;break;case _n.TILE:i=Kdt;break;case _n.WFS:i=NEi;break;case _n.DATATABLE:i=$Ei;break;case _n.WMS:i=LEi;break;case _n.GEOJSON:i=AEi;break;case _n.CSV:i=OEi;break;case _n.DATAJSON:i=kEi;break;case _n.SHAPEFILE:i=PEi;break;case _n.OSM:i=FEi;break;default:throw new Error("Unsupported Layer Type "+e.layerType)}return new i(e,this.$iApi)}getLayer(e){let i;const r=gg(this.$vApp.$pinia);return i=r.getLayerById(e),i||(i=r.getLayerByUid(e)),i}allLayers(){return this.allActiveLayers().concat(this.allErrorLayers(),this.allInitiatingLayers())}allActiveLayers(){return this.allLayersOnMap().concat(this.allDataLayers()).filter(e=>e.layerState!==Rp.ERROR)}allLayersOnMap(){return gg(this.$vApp.$pinia).layers||[]}allDataLayers(){return gg(this.$vApp.$pinia).dataLayers||[]}allErrorLayers(){return gg(this.$vApp.$pinia).penaltyBox.concat(this.allLayersOnMap().filter(e=>e.layerState===Rp.ERROR),this.allDataLayers().filter(e=>e.layerState===Rp.ERROR))||[]}allInitiatingLayers(){return gg(this.$vApp.$pinia).initiatingLayers||[]}getLayerControls(e){const i=this.getLayer(e);if(!i)return;const r=i.config.controls?.slice()??[ha.BoundaryZoom,ha.Datatable,ha.Identify,ha.Metadata,ha.Opacity,ha.Refresh,ha.Reload,ha.Remove,ha.Settings,ha.Symbology,ha.Visibility],n=[];return i.supportsFeatures||n.push(ha.Datatable),i.extent===void 0&&n.push(ha.BoundaryZoom),(i.config?.metadata||(i.isSublayer?i.parentLayer?.config?.metadata:{})||{}).url||n.push(ha.Metadata),!i.mapLayer&&!i.config.controls?.includes(ha.Settings)&&n.push(ha.Settings),n.forEach(o=>{const a=r?.indexOf(o)??-1;a!==-1&&r?.splice(a,1)}),{controls:r,disabledControls:i.config.disabledControls??[]}}async loadLayerMetadata(e){if(!e.trim())throw new Error("url missing on layer server metadata request.");const[i,r]=await yD(ur(e,{query:{f:"json"}}));if(!r)throw console.error(`Service metadata load error: ${e}`,i),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:pl.NONE,minScale:0,maxScale:0,canModifyLayer:!0,extent:void 0,defaultVisibility:!0,fields:[],displayField:"",objectIdField:"",renderer:void 0,currentVersion:0,name:"",dataFormat:By.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?Ad.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=By.ESRI_FEATURE,s.displayField=n.displayField||"",Array.isArray(n.fields)){const o=n.fields.map(l=>Jo.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=PR(n.drawingInfo.renderer))):s.mapLayer=!1}}else s.dataFormat=By.ESRI_RASTER;return s}async loadFeatureCount(e,i=""){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:i||"1=1",returnCountOnly:!0,returnGeometry:!1}},[n,s]=await yD(ur(`${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 $P extends Gp{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;_parentLayer;_sublayers;constructor(e,i){super(i),this.config=e,this.id="",this.uid="",this.name="error",this.layerState=Rp.NEW,this.drawState=zv.NOT_LOADED,this.initiationState=Uv.NEW,this.layerIdx=-1,this.layerFormat=Hb.UNKNOWN,this.layerType=_n.UNKNOWN,this.dataFormat=By.UNKNOWN,this.supportsIdentify=!1,this.identifyMode=Tm.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=pl.UNKNOWN,this.legend=[],this._sublayers=[],this.expectedTime={draw:0,load:0},this.maxLoadTime=0,this.canModifyLayer=!0}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 aue(0,"Fake tree","getLayerTree() was not implemented in layer")}getSR(){return ml.latLongSR()}get visibility(){return!1}set visibility(e){}get opacity(){return 0}set opacity(e){}get scaleSet(){return new Tnt}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,i){return Promise.resolve(new I1(new FM))}getIcon(e){return Promise.resolve("")}getSqlFilter(e){return""}setSqlFilter(e,i){}applySqlFilter(e=[]){}getFilterOIDs(e=[],i=void 0){return Promise.resolve(void 0)}getGraphicExtent(e){return Promise.resolve(Ad.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 i=this._sublayers.findIndex(r=>r?.uid===e);if(i===-1)throw new Error(`Attempt to access non-existing unique id [layerid ${this.id}, uid ${e}]`);return i}}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 i;if(typeof e=="string"?i=this.uidToIdx(e):i=e,this._sublayers[i]===void 0)throw new Error(`Attempt to access non-existing layer index [layerid ${this.id}, lookup value ${e}]`);return this._sublayers[i]}controlAvailable(e){const i=this.$iApi.geo.layer.getLayerControls(this.id);return i?.disabledControls?.includes(e)?!1:i?.controls.includes(e)??!1}}class qdt extends $P{timers;origRampConfig;loadDefProm;loadPromFulfilled;layerTree;constructor(e,i){super(e,i),this.name=e.name||"",this.geomType=pl.NONE,this.dataFormat=By.UNKNOWN,this.layerType=_n.UNKNOWN,this.layerFormat=Hb.UNKNOWN,this.expectedTime.draw=e.expectedDrawTime??1e4,this.expectedTime.load=e.expectedLoadTime??4e3,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=Tm.NONE,this.supportsFeatures=!1,this.hovertips=!1,this.supportsSublayers=!1,this.isFile=!1,this.layerState=Rp.NEW,this.initiationState=Uv.NEW,this.drawState=zv.NOT_LOADED,this.loadDefProm=new Yf,this.loadPromFulfilled=!1,this.layerTree=new aue(0,this.uid,this.name,!0),this.maxLoadTime=e.maxLoadTime??2e4}updateInitiationState(e){this.initiationState=e,this.$iApi.event.emit(cn.LAYER_INITIATIONSTATECHANGE,{state:e,layer:this})}updateLayerState(e){this.layerState=e,this.$iApi.event.emit(cn.LAYER_LAYERSTATECHANGE,{state:e,layer:this})}updateDrawState(e){this.drawState=e,e===zv.REFRESH?this.startTimer("draw"):e===zv.UP_TO_DATE&&this.stopTimer("draw"),this.$iApi.event.emit(cn.LAYER_DRAWSTATECHANGE,{state:e,layer:this})}async initiate(){this.updateInitiationState(Uv.INITIATING),this.startTimer("load");const[e]=await yD(this.onInitiate());this.drawState!==zv.UP_TO_DATE&&this.startTimer("draw"),e&&(console.error(e.message),this.onError()),this.updateInitiationState(Uv.INITIATED)}async onInitiate(){if(this.isSublayer)return console.warn("Attempted to initiate a sublayer as a CommonLayer"),Promise.resolve();this.initiationState===Uv.INITIATED&&console.error(`Encountered layer initialize while already initiated, layer id ${this.id}`)}async terminate(){this.updateInitiationState(Uv.TERMINATING),await Promise.all(this.sublayers.map(e=>e.terminate())),this.loadDefProm=new Yf,this.loadPromFulfilled=!1,this.updateLayerState(Rp.NEW),this.updateDrawState(zv.NOT_LOADED),this.updateInitiationState(Uv.TERMINATED)}onLoad(){let e=!1;const i=setTimeout(()=>{this.maxLoadTime&&(e=!0,this.onError())},this.maxLoadTime),r=this.onLoadActions();Promise.all(r).then(()=>{clearTimeout(i),e?this.visibility=!1:(this.loadPromFulfilled&&(this.loadDefProm=new Yf),this.loadDefProm.resolveMe(),this.loadPromFulfilled=!0,this.stopTimer("load"),this.sublayers.forEach(n=>n.onLoad()),this.updateLayerState(Rp.LOADED))}).catch(()=>{clearTimeout(i),this.onError()})}onError(){this.loadPromFulfilled&&(this.loadDefProm=new Yf),this.loadDefProm.rejectMe(),this.loadPromFulfilled=!0,this.sublayers.forEach(e=>e.onError()),this.$iApi.notify.show(ub.ERROR,this.$iApi.$i18n.t("layer.error",{id:this.id})),this.stopTimer("draw"),this.stopTimer("load"),this.updateLayerState(Rp.ERROR)}onLoadActions(){return[]}loadPromise(){return this.loadDefProm.getPromise()}get isLoaded(){return this.layerState===Rp.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,i){return this.stubError(),Promise.resolve(new I1(new FM))}getIcon(e){return this.stubError(),Promise.resolve("")}getSqlFilter(e){return this.stubError(),""}setSqlFilter(e,i){this.stubError()}getFilterOIDs(e=[],i=void 0){return this.stubError(),Promise.resolve(void 0)}getGraphicExtent(e){return this.stubError(),Promise.resolve(Ad.fromParams("fake",0,0,0,0))}applySqlFilter(e=[]){this.stubError()}setCustomParameter(e,i,r=!0){this.stubError()}startTimer(e){this.stopTimer(e),this.expectedTime[e]>0&&(this.timers[e]=setTimeout(()=>this.$iApi.notify.show(ub.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])}}class HK extends qdt{_serverVisibility;_scaleSet;_mouseTolerance;_touchTolerance;_drawOrder;_lastFilterUpdate="";viewDefProm;esriWatches;constructor(e,i){super(e,i),this._scaleSet=new Tnt,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?Ad.fromConfig(`${this.id}_extent`,e.extent):void 0,this.viewDefProm=new Yf,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(cn.LAYER_VISIBILITYCHANGE,{visibility:e,layer:this})})),this.esriWatches.push(this.esriLayer.watch("opacity",e=>{this.$iApi.event.emit(cn.LAYER_OPACITYCHANGE,{opacity:e,layer:this})})),this.esriWatches.push(this.esriLayer.watch("loadStatus",e=>{const i={"not-loaded":Rp.LOADING,loading:Rp.LOADING,loaded:Rp.LOADED,failed:Rp.ERROR};e==="loaded"?this.onLoad():e==="failed"?this.onError():this.updateLayerState(i[e])})),this.esriLayer.on("layerview-create",e=>{this.esriView=e.layerView,this.esriWatches.push(e.layerView.watch("updating",i=>{this.updateDrawState(i?zv.REFRESH:zv.UP_TO_DATE)})),this.viewDefProm.resolveMe()}),this.sublayers.forEach(e=>e.initiate())}async terminate(){await super.terminate(),this.viewDefProm=new Yf,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}let e=0;if(this.initiationState===Uv.INITIATED){if(this.esriLayer){const i=this.$iApi.geo.map.esriMap.layers.findIndex(r=>r.id===this.id);i>-1&&(e=i,this.$iApi.geo.map.esriMap.layers.remove(this.esriLayer))}this.$iApi.event.emit(cn.LAYER_RELOAD_START,this),this.sublayers.forEach(i=>this.$iApi.event.emit(cn.LAYER_RELOAD_START,i)),await this.terminate()}if(await this.initiate(),!this.esriLayer){console.error("ESRI layer failed to re-create during reload.");return}this.$iApi.geo.map.esriMap.layers.add(this.esriLayer,e),this.$iApi.event.emit(cn.LAYER_RELOAD_END,this),this.sublayers.forEach(i=>this.$iApi.event.emit(cn.LAYER_RELOAD_END,i))}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 i=this.$iApi.geo.proj.checkProj(this.getSR()).then(r=>r?Promise.resolve():Promise.reject());return e.push(i),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 i;if(typeof e>"u")if(this.mapCheck())i=this.$iApi.geo.map.getScale();else return!1;else i=e;return this.scaleSet.isOffScale(i).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?ml.fromESRI(this.esriLayer.spatialReference):(this.noLayerErr(),ml.latLongSR())}}class Qhe extends HK{attribs;renderer;serviceUrl;canModifyLayer;filter;constructor(e,i){super(e,i),this.supportsIdentify=!0,this.geomType=pl.UNKNOWN,this.serviceUrl="",this.fieldList="",this.canModifyLayer=!0,this.filter=new Ent(e.permanentFilteredQuery||"",e.initialFilteredQuery||""),this.hovertips=e.state?.hovertips??!0,this.attribs=new Zdt}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 i=await this.$iApi.geo.layer.loadLayerMetadata(this.serviceUrl);if(this.geomType=i.geometryType,this.attribs.quickCache=new tpt(this.geomType),this.scaleSet.minScale=i.minScale,this.scaleSet.maxScale=i.maxScale,this.dataFormat=i.dataFormat,this.extent=this.extent??i.extent,this._serverVisibility=i.defaultVisibility,this.dataFormat===By.ESRI_FEATURE){this.supportsFeatures=!0,this.canModifyLayer=this.layerType===_n.SUBLAYER?i.canModifyLayer:!0,this.fields=i.fields,this.nameField=i.displayField,this.oidField=i.objectIdField,this.drawOrder.forEach(s=>{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:i.renderer;this.renderer=this.$iApi.geo.symbology.makeRenderer(r,this.fields),this.legend=this.$iApi.geo.symbology.rendererToLegend(this.renderer);const n={supportsLimit:(i.currentVersion||1)>=10.1,serviceUrl:this.serviceUrl,oidField:this.oidField,batchSize:-1,attribs:"*",permanentFilter:this.getSqlFilter(Nf.PERMANENT)};this.attribs.attLoader=new ept(this.$iApi,n),this.origRampConfig.name||(this.name=i.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,i){let r={},n=new FM;const s=this.$iApi.geo.map;let o=!1,a=!1,l=0;if(i.getAttribs||i.getStyle){const h=this.attribs.quickCache.getAttribs(e);if(h)r=h;else if(this.attribs.attLoader.isLoaded()||this.isFile){const p=await this.attribs.attLoader.getAttribs();r=p.features[p.oidIndex[e]]}else o=!0}if(i.getGeom){l=s.getScale();const h=this.attribs.quickCache.getGeom(e,l);h?n=h:a=!0}if(o||a){const h={oid:e,serviceUrl:this.serviceUrl,includeGeometry:a,attribs:this.fieldList};a&&(h.mapSR=s.getSR().wkid?.toString(),this.attribs.quickCache.isPoint||(h.maxOffset=s.esriView?.resolution));const p=await this.$iApi.geo.attributes.loadSingleFeature(h);a&&(this.attribs.quickCache.setGeom(e,p.geometry,l),n=p.geometry),(o||typeof this.attribs.quickCache.getAttribs(e)>"u")&&(this.attribs.quickCache.setAttribs(e,p.attributes),o&&(r=p.attributes))}const c=new I1(n,"",i.getAttribs?r:void 0);if(i.getStyle){const h=Qs(this.renderer.getGraphicSymbol(r));c.style=this.$iApi.geo.geom.styleEsriToRamp(h)}return c}async getIcon(e){if(!this.renderer)throw new Error("getIcon called before renderer is defined");const i=await this.getGraphic(e,{getAttribs:!0});return this.$iApi.geo.symbology.getGraphicIcon(i.attributes||{},this.renderer)}setSqlFilter(e,i){const r=this.filter.getSql(e);if(i===r)return;this.filter.setSql(e,i),this.$iApi.event.emit(cn.FILTER_CHANGE,{uid:this.uid,filterKey:e});const n=`${this.uid}-${e}-${i}`;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=[],i=void 0){const r=this.filter.getCombinedSql(e),n=!!i;if(!(r||n))return;i&&this.filter.setExtent(i);const s=this.filter.sqlActiveFilters(e);let o=this.filter.getCache(s,n);if(!o){const a={filterGeometry:i,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 i={url:this.serviceUrl,...e};return this.$iApi.geo.query.arcGisServerQueryIds(i)}async queryFeaturesDiscrete(e){const i=await this.queryOIDs(e),r={getGeom:!!e.includeGeometry,getAttribs:!0};return i.map(n=>({oid:n,graphic:this.getGraphic(n,r)}))}async queryFeatures(e){const i=await this.queryFeaturesDiscrete(e);return Promise.all(i.map(r=>r.graphic))}}class Ydt extends HK{constructor(e,i){super(e,i),this.dataFormat=By.ESRI_FEATURE,this.layerFormat=Hb.GRAPHIC,this.hovertips=!1}_graphics=[];makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}getGraphicCount(){return this._graphics.length}getLocalGraphic(e){return this._graphics.find(i=>i.id===e)}getEsriGraphic(e){return this.esriLayer?.graphics.find(i=>i.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 i;e instanceof Array?i=e:i=[e];const r=i.filter(l=>this._graphics.findIndex(h=>h.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,c)=>{const h=new I1(o[c],l.id,l.attributes);return h.style=l.style,this.$iApi.geo.geom.graphicRampToEsri(h)});this.esriLayer.addMany(a)}removeGraphic(e){if(!this.esriLayer){this.noLayerErr();return}if(typeof e>"u"){this.esriLayer.removeAll(),this._graphics=[];return}let i;Array.isArray(e)?i=e:i=[e];const r=i.map(s=>typeof s=="string"?s:s.id),n=[];r.forEach(s=>{const o=this.esriLayer?.graphics.find(a=>a.id===s);if(o){n.push(o);const a=this._graphics.findIndex(l=>l.id===s);a!=-1&&this._graphics.splice(a,1)}}),this.esriLayer.removeMany(n),this._graphics=this._graphics.filter(s=>r.includes(s.id))}}class Xdt extends Ydt{constructor(e,i){super(e,i),this.layerType=_n.GRAPHIC}async onInitiate(){this.esriLayer=ya(new wXe(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(zv.UP_TO_DATE),e}}class ede extends Qhe{esriJson;sourceGeoJson;tooltipField;constructor(e,i){super(e,i),this.supportsIdentify=!0,this.isFile=!0,this.dataFormat=By.ESRI_FEATURE,this.layerFormat=Hb.FEATURE,this.tooltipField="",e.identifyMode&&e.identifyMode!==Tm.NONE?this.identifyMode=e.identifyMode:this.identifyMode=Tm.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 raw data.");const e=typeof this.sourceGeoJson=="string"?JSON.parse(this.sourceGeoJson):JSON.parse(JSON.stringify(this.sourceGeoJson)),i={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(e,i),this.esriLayer=ya(new Xc(this.makeEsriLayerConfig(this.origRampConfig))),this.esriJson=void 0,this.origRampConfig.caching!==!0&&delete this.origRampConfig.rawData,delete this.sourceGeoJson,await super.onInitiate()}makeEsriLayerConfig(e){const i=super.makeEsriLayerConfig(e),r="OBJECTID";return["source","objectIdField","id","fields","renderer","spatialReference","geometryType"].forEach(s=>{i[s]=this.esriJson[s]}),this.origRampConfig.nameField?i.displayField=this.$iApi.geo.attributes.fieldValidator(i.fields,this.origRampConfig.nameField)||r:i.displayField=r,i.outFields=["*"],delete i.url,Array.isArray(e.drawOrder)&&e.drawOrder.length>0?(i.orderBy=e.drawOrder.map(s=>({field:s.field,order:s.ascending?"ascending":"descending"})),this._drawOrder=e.drawOrder.slice()):(i.orderBy=[{field:r,order:"descending"}],this._drawOrder=[{field:r,ascending:!1}]),i}onLoadActions(){const e=super.onLoadActions();return this.esriLayer&&this.origRampConfig.customRenderer?.type&&(this.esriLayer.renderer=PR(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 i=new Yf,r=Fl({items:[],loading:i.getPromise(),loaded:!1,errored:!1,uid:this.uid,requestTime:Date.now()});let n=Promise.resolve(),s=Promise.resolve(),o=[];if(this.identifyMode===Tm.HYBRID||this.identifyMode===Tm.GEOMETRIC){const a={includeGeometry:!1};this.geomType!==pl.POLYGON&&e.geometry.type===pl.POINT?a.filterGeometry=this.$iApi.geo.query.makeClickBuffer(e.geometry,e.tolerance):a.filterGeometry=e.geometry,a.filterSql=this.getCombinedSqlFilter(),s=this.queryFeatures(a).then(l=>{o=l})}return e.hitTest&&(this.identifyMode===Tm.HYBRID||this.identifyMode===Tm.SYMBOLIC)&&(n=s.then(async()=>{const a=await e.hitTest,l=await Promise.all(a.filter(c=>c.layerId===this.id&&o.findIndex(h=>c.oid===h.attributes[this.oidField])===-1).map(c=>this.getGraphic(c.oid,{getAttribs:!0})));o=o.concat(l)})),Promise.all([n,s]).then(()=>{o.forEach(a=>{const l=Fl({data:a.attributes,format:N3.ESRI,loaded:!0,loading:Promise.resolve()});r.items.push(l)}),r.loaded=!0,i.resolveMe()}).catch(()=>{r.errored=!0,i.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??Ad.fromESRI(e.fullExtent,this.id+"_extent");const i=ya(e.fields.slice());this.fields=i.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 VEi(this.$iApi,r)}async getGraphic(e,i){const r={filterSql:`${this.oidField}=${e}`,includeGeometry:!!i.getGeom},n=await this.queryFeatures(r);if(n.length===0)throw new Error(`Could not find object id ${e}`);n.length!==1&&console.warn("did not get a single result on a query for a specific object id");const s=n[0];if(i.getStyle){const o=Qs(this.renderer.getGraphicSymbol(s.attributes));s.style=this.$iApi.geo.geom.styleEsriToRamp(o)}return s}async queryFeatures(e){const i={layer:this,...e};return this.$iApi.geo.query.geoJsonQuery(i)}async queryOIDs(e){const i={layer:this,...e};return(await this.$iApi.geo.query.geoJsonQuery(i)).map(n=>n.attributes?n.attributes[this.oidField]:-1)}applySqlFilter(e=[]){if(!this.esriView){this.noLayerErr();return}const i=this.filter.getCombinedSql(e);Qs(this.esriView).filter=new bq({where:i})}}class AEi extends ede{constructor(e,i){super(e,i),this.layerType=_n.GEOJSON}async onInitiate(){if(this.origRampConfig.rawData&&(typeof this.origRampConfig.rawData=="string"||this.origRampConfig.rawData instanceof Object))this.sourceGeoJson=this.origRampConfig.rawData;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 PEi extends ede{constructor(e,i){super(e,i),this.layerType=_n.SHAPEFILE}async onInitiate(){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("shapefile file config contains no raw data or url");this.sourceGeoJson=await this.$iApi.geo.layer.files.shapefileToGeoJson(e),await super.onInitiate()}}class OEi extends ede{constructor(e,i){super(e,i),this.layerType=_n.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 REi extends Qhe{tooltipField;constructor(e,i){super(e,i),this.dataFormat=By.ESRI_FEATURE,this.tooltipField="",this.supportsIdentify=!0,this.layerType=_n.FEATURE,this.layerFormat=Hb.FEATURE,e.identifyMode&&e.identifyMode!==Tm.NONE?this.identifyMode=e.identifyMode:this.identifyMode=Tm.HYBRID}async onInitiate(){ya(this.esriLayer=new Xc(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){const i=super.makeEsriLayerConfig(e);return(e.initialFilteredQuery||e.permanentFilteredQuery)&&(i.definitionExpression=this.filter.getCombinedSql()),Array.isArray(e.drawOrder)&&e.drawOrder.length>0&&(i.orderBy=e.drawOrder.map(r=>({field:r.field,order:r.ascending?"ascending":"descending"})),this._drawOrder=e.drawOrder.slice()),i}onLoadActions(){const e=super.onLoadActions(),i=this.esriLayer&&this.origRampConfig.customRenderer?.type;i&&(this.esriLayer.renderer=PR(this.config.customRenderer));const r=this.esriLayer.parsedUrl.path,s=this.$iApi.geo.shared.parseUrlIndex(r).index||0;this.serviceUrl=r;const o=this.loadLayerMetadata(i?{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),this.esriLayer?.orderBy||(this.esriLayer.orderBy=[{field:this.oidField,order:"descending"}],this._drawOrder=[{field:this.oidField,ascending:!1}])}),a=this.$iApi.geo.layer.loadFeatureCount(this.serviceUrl,this.getSqlFilter(Nf.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 i=new Yf,r=Fl({items:[],loading:i.getPromise(),loaded:!1,errored:!1,uid:this.uid,requestTime:Date.now()});let n=Promise.resolve(),s=Promise.resolve(),o=[];if(this.identifyMode===Tm.HYBRID||this.identifyMode===Tm.GEOMETRIC){const a={includeGeometry:!1};this.geomType!==pl.POLYGON&&e.geometry.type===pl.POINT?a.filterGeometry=this.$iApi.geo.query.makeClickBuffer(e.geometry,e.tolerance):a.filterGeometry=e.geometry,a.filterSql=this.getCombinedSqlFilter(),s=this.queryFeaturesDiscrete(a).then(l=>{o=l})}return e.hitTest&&(this.identifyMode===Tm.HYBRID||this.identifyMode===Tm.SYMBOLIC)&&(n=s.then(async()=>{(await e.hitTest).filter(l=>l.layerId===this.id&&o.findIndex(c=>l.oid===c.oid)===-1).forEach(l=>{o.push({oid:l.oid,graphic:this.getGraphic(l.oid,{getAttribs:!0})})})})),Promise.all([n,s]).then(()=>{o.forEach(a=>{const l=Fl({data:void 0,format:N3.ESRI,loaded:!1,loading:new Promise(c=>{a.graphic.then(h=>{l.data=h.attributes,l.loaded=!0,c()})})});r.items.push(l)}),r.loaded=!0,i.resolveMe()}).catch(()=>{r.errored=!0,i.resolveMe()}),[r]}applySqlFilter(e=[]){if(!this.esriLayer){this.noLayerErr();return}const i=this.filter.getCombinedSql(e);this.esriLayer.definitionExpression=i}getGraphicExtent(e){return new Promise((i,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?i(n):this.esriLayer.queryExtent({objectIds:[e],outSpatialReference:this.$iApi.geo.map.getSR().toESRI()}).then(s=>{const o=Ad.fromESRI(s.extent);this.attribs.quickCache.setExtent(e,o),i(o)}).catch(()=>{console.error(`Extent querying failed for ${e}.`),r()})}})}}class MEi extends Qhe{isDynamic;origState;constructor(e,i){super(e,i),this.supportsIdentify=!0,this.supportsSublayers=!0,this.layerType=_n.MAPIMAGE,this.layerFormat=Hb.MAPIMAGE,this.isDynamic=!1,this.hovertips=!1,this.layerTree.layerIdx=-1,this.identifyMode=Tm.GEOMETRIC}async onInitiate(){this.esriLayer=ya(new KTe(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){const i=super.makeEsriLayerConfig(e);return this.origState={visibility:i.visible,opacity:i.opacity},i.visible=!1,e.imageFormat&&(i.imageFormat=e.imageFormat),i}onLoadActions(){const e=super.onLoadActions();if(!this.esriLayer)return this.noLayerErr(),e;this.layerTree.name=this.name,this.isDynamic=this.esriLayer.capabilities.exportMap.supportsDynamicLayers,this.extent=this.extent??Ad.fromESRI(this.esriLayer.fullExtent,this.id+"_extent");const i=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,c=r[l];if(o.sublayers&&o.sublayers.length>0){const h=(c?c.name:"")||o.title||"",p=new aue(l,"",h,!1);a.findChildByIdx(l)||a.children.push(p),o.sublayers.reverse().forEach(y=>{s(y,p)})}else{this._sublayers[l]||(this._sublayers[l]=new DEi({id:`${this.id}-${l}`,layerType:_n.SUBLAYER,name:r[l]?.name,state:r[l]?.state??{opacity:this.opacity,visibility:this.visibility,hovertips:this.hovertips,identify:this.identify},extent:r[l]?.extent,controls:r[l]?.controls,disabledControls:r[l]?.disabledControls,initialFilteredQuery:r[l]?.initialFilteredQuery,permanentFilteredQuery:r[l]?.permanentFilteredQuery},this.$iApi,this,l));const h=this._sublayers[l];if(h.isRemoved)return;const p=(c?c.name:"")||o.title||"";if(h.name=p,n.push(h),!a.children.map(y=>y.layerIdx).includes(l)){const y=new aue(l,h.uid,h.name,!1);a.children.push(y)}h.esriWatches.push(o.watch("visible",()=>{this.$iApi.event.emit(cn.LAYER_VISIBILITYCHANGE,{visibility:h.visibility,layer:h}),h.parentLayer?.checkVisibility()}),o.watch("opacity",y=>{this.$iApi.event.emit(cn.LAYER_OPACITYCHANGE,{opacity:y,layer:h})}))}};return this.origRampConfig.sublayers.forEach(o=>{if(!o.cosmetic){const a=i(o.index||0);s(a,this.layerTree)}}),n.forEach(o=>{const a=i(o.layerIdx),l=r[o.layerIdx];o.serviceUrl=a.url,o.fetchEsriSublayer(this),o.initiate();const c=o.esriSubLayer&&l?.customRenderer?.type;c&&(o.esriSubLayer.renderer=PR(l.customRenderer));const h=o.loadLayerMetadata(c?{customRenderer:o.esriSubLayer?.renderer}:{}).then(()=>{const p=r[o.layerIdx];return p?(o.visibility=o.isRemoved?!1:p.state?.visibility??(this.origState.visibility?o._serverVisibility??this.origState.visibility:this.origState.visibility??o._serverVisibility)??!0,o.opacity=p.state?.opacity??this.origState.opacity??1,o.nameField=p.nameField||o.nameField||"",this.$iApi.geo.attributes.applyFieldMetadata(o,p.fieldMetadata),o.canModifyLayer||this.$iApi.notify.show(ub.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(Nf.PERMANENT)).then(y=>{o.featureCount=y})):Promise.resolve()});e.push(h)}),this.esriLayer.allSublayers.forEach(o=>{!o.sublayers&&!n.find(a=>a.layerIdx===o.id)&&(o.visible=!1,o.opacity=0)}),this.visibility=this.origState.visibility??!0,e}updateLayerState(e){super.updateLayerState(e),this.sublayers.forEach(i=>i.updateLayerState(e))}updateDrawState(e){super.updateDrawState(e),this.sublayers.forEach(i=>i.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 i=e.sublayerIds?this._sublayers.filter(n=>e.sublayerIds?.includes(n.uid)):this._sublayers.filter(n=>n.canIdentify());if(i.length===0)return[];let r;return e.geometry.type===pl.POINT&&(r=this.$iApi.geo.query.makeClickBuffer(e.geometry,e.tolerance)),i.map(n=>{const s=new Yf,o={},a=Fl({items:[],loading:s.getPromise(),loaded:!1,errored:!1,uid:n.uid,requestTime:Date.now()});return n.geomType!==pl.POLYGON&&r?o.filterGeometry=r:o.filterGeometry=e.geometry,o.filterSql=n.getCombinedSqlFilter(),n.queryFeaturesDiscrete(o).then(l=>{l.forEach(c=>{const h=Fl({data:void 0,format:N3.ESRI,loaded:!1,loading:new Promise(p=>{c.graphic.then(y=>{h.data=y.attributes,h.loaded=!0,p()})})});a.items.push(h)}),a.loaded=!0,s.resolveMe()}).catch(()=>{a.errored=!0,s.resolveMe()}),a})}noFeaturesErr(){console.error("This method targets features and must be called on a Sublayer."),console.trace()}getAttributes(){return this.noFeaturesErr(),Promise.resolve({features:[],oidIndex:{}})}abortAttributeLoad(){this.noFeaturesErr()}clearFeatureCache(){this.noFeaturesErr()}downloadedAttributes(){return this.noFeaturesErr(),0}attribLoadAborted(){return this.noFeaturesErr(),!1}getTabularAttributes(){return this.noFeaturesErr(),Promise.resolve({columns:[],rows:[],fields:[],oidField:"error"})}getGraphic(e,i){return this.noFeaturesErr(),Promise.resolve(new I1(new FM))}getIcon(e){return this.noFeaturesErr(),Promise.resolve("")}getSqlFilter(e){return this.noFeaturesErr(),""}applySqlFilter(e=[]){this.noFeaturesErr()}getFilterOIDs(e=[],i=void 0){return this.noFeaturesErr(),Promise.resolve(void 0)}}class DEi extends Qhe{tooltipField;constructor(e,i,r,n=0){if(super(e,i),this.layerType=_n.SUBLAYER,this.layerFormat=Hb.MAPIMAGE,this.isSublayer=!0,this.layerIdx=n,this.parentLayer=r,this.dataFormat=By.ESRI_FEATURE,this.tooltipField="",this.hovertips=!1,!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=ya(e.esriLayer.allSublayers.find(i=>i.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(){this.initiationState=Uv.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 i=this.filter.getCombinedSql(e);this.esriSubLayer.definitionExpression=i}getSR(){return this.parentLayer?.esriLayer?ml.fromESRI(this._parentLayer?.esriLayer?.spatialReference):(this.noLayerErr(),ml.latLongSR())}updateFieldList(){this.attribs.attLoader.updateFieldList(this.fieldList)}}class FEi extends HK{constructor(e,i){super(e,i),this.supportsIdentify=!1,this.layerType=_n.OSM,this.layerFormat=Hb.OSM,this.dataFormat=By.OSM_TILE,this.supportsFeatures=!1}async onInitiate(){this.esriLayer=ya(new tEe(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}onLoadActions(){const e=super.onLoadActions();this.layerTree.name=this.name;const i=this.$iApi.geo.symbology.generatePlaceholderSymbology("O","#03fc4e"),r={uid:this.$iApi.geo.shared.generateUUID(),label:"OpenStreetMap",svgcode:i.svgcode,esriStandard:!0,drawPromise:Promise.resolve()};return this.legend.push(r),e}}class Kdt extends HK{constructor(e,i){super(e,i),this.supportsIdentify=!1,this.layerType=_n.TILE,this.layerFormat=Hb.TILE,this.dataFormat=By.ESRI_TILE}async onInitiate(){this.esriLayer=ya(new nEe(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}onLoadActions(){const e=super.onLoadActions();this.layerTree.name=this.name;const i=this.$iApi.geo.symbology.mapServerToLocalLegend(this.origRampConfig.url).then(r=>{this.legend=r});return e.push(i),e.push(this.checkProj()),e}checkProj(){const e=this.getSR(),r=this.$iApi.geo.map.getSR().isEqual(e);if(this.layerState===Rp.LOADED&&!r)this.$iApi.notify.show(ub.WARNING,this.$iApi.$i18n.t("layer.mismatch",{name:this.name||this.id})),this.onError();else if(this.layerState===Rp.ERROR&&r)this.reload();else if(this.layerState!==Rp.ERROR&&!r)return this.$iApi.notify.show(ub.WARNING,this.$iApi.$i18n.t("layer.mismatch",{name:this.name||this.id})),Promise.reject();return Promise.resolve()}}class LEi extends HK{sublayerNames;mimeType;constructor(e,i){super(e,i),this.supportsIdentify=!0,this.layerType=_n.WMS,this.layerFormat=Hb.WMS,this.mimeType=e.featureInfoMimeType||"",this.sublayerNames=[],this.dataFormat=By.OGC_RASTER,this.identifyMode=Tm.GEOMETRIC}async onInitiate(){this.esriLayer=ya(new $Ze(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){const i=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 i.customParameters={styles:n},e.url.indexOf("/geomet")!==-1&&(i.customParameters.layers=r[0].id),i}onLoadActions(){const e=super.onLoadActions();this.layerTree.name=this.name;const i=r=>{let n=!1;return r.forEach(s=>{this.sublayerNames.indexOf(s.name)>-1||s.sublayers&&s.sublayers.length>0&&i(s.sublayers)?n=!0:s.visible=!1}),n};return this.esriLayer?i(this.esriLayer.sublayers):this.noLayerErr(),this.loadSymbology(),e}canIdentify(){return super.canIdentify()}runIdentify(e){if(e.geometry.type!==pl.POINT)throw new Error("a point must be used for WMS Identify");if(!this.canIdentify())return[];const i=new Yf,r=Fl({items:[],loading:i.getPromise(),loaded:!1,errored:!1,uid:this.uid,requestTime:Date.now()});return this.getFeatureInfo(this.sublayerNames,e.geometry,this.mimeType).then(n=>{if(n){const s=Fl({data:n,format:N3.UNKNOWN,loaded:!0,loading:Promise.resolve()});typeof n!="string"?(s.format=N3.JSON,r.items.push(s)):n.indexOf("Search returned no results")===-1&&n!==""&&(s.format=N3.TEXT,r.items.push(s))}r.loaded=!0,i.resolveMe()}).catch(()=>{r.errored=!0,i.resolveMe()}),[r]}setCustomParameter(e,i,r=!0){this.esriLayer?(this.esriLayer.customLayerParameters[e]=i,r&&this.esriLayer.refresh()):this.noLayerErr()}getFeatureInfo(e,i,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(),c=s.spatialReferences,h=e.join(","),p=n.esriView.toScreen(i.toESRI()),y=Math.floor(p.x),v=Math.floor(p.y),I={"application/json":"json","text/html":"text","text/plain":"text"}[r]||"text",P=n.getSR();P.wkid?o=P.wkid:(o=4326,console.error("Map is likely in a WKT projection. WMS Identify request will likely fail.")),c&&c.length>1?c.indexOf(o)===-1&&(P.latestWkid&&c.indexOf(P.latestWkid)>-1?o=P.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:y,J:v,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:y,Y:v},Object.prototype.hasOwnProperty.call(a,"BBOX")||(a.BBOX=`${l.xmin},${l.ymin},${l.xmax},${l.ymax}`);const F={SERVICE:"WMS",REQUEST:"GetFeatureInfo",VERSION:s.version,WIDTH:n.getPixelWidth(),HEIGHT:n.getPixelHeight(),QUERY_LAYERS:h,LAYERS:h,INFO_FORMAT:r},k=s.customLayerParameters;return k&&Object.keys(k).forEach(j=>{j.toLowerCase()!=="styles"&&(F[j]=k[j])}),Object.keys(F).forEach(j=>a[j]=F[j]),ur(s.url.split("?")[0],{query:a,responseType:I})}getLegendUrls(e){if(!this.esriLayer)return this.noLayerErr(),[];const i=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 _X(n.legendUrl);"STYLE"in o.queryMap&&o.queryMap.STYLE!==s.currentStyle&&(n.legendUrl=o.updateQuery({STYLE:s.currentStyle}))}}),i.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]=i.get(e[s].id))}),r}getWMSLayerTitle(e){if(!this.esriLayer)return"";let i;return this.esriLayer.allSublayers.some(r=>{if(r.name===e)return i=r.title,!0}),i||""}loadSymbology(){const e=this.config.sublayers,i=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=i}}class NEi extends ede{constructor(e,i){super(e,i),this.layerType=_n.WFS}async onInitiate(){const e=new _X(this.config.url),{startindex:i,limit:r}=e.queryMap;this.sourceGeoJson||(this.sourceGeoJson=await this.$iApi.geo.layer.ogc.loadWfsData(this.config.url,-1,parseInt(i)||0,parseInt(r)||1e3,void 0,this.config.xyInAttribs)),await super.onInitiate()}}class Jdt extends qdt{sourceJson;attribs;_visibility;constructor(e,i){super(e,i),this.dataFormat=By.ESRI_FEATURE,this.layerFormat=Hb.NOLAYER,this.drawState=zv.NOT_VISUAL,this.attribs=new Zdt,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=typeof this.sourceJson=="string"?JSON.parse(this.sourceJson):this.sourceJson;if(e.data.length===0||e.fields.length===0)throw new Error("Data layer with no columns or now rows.");const i=e.fields.slice(),r=e.data[0].slice(),n=/ /gi;this.fields=i.map((o,a)=>{let l="",c=o;o.indexOf(" ")>-1&&(l=o,c=o.trim().replace(n,"-"),e.fields[a]=c);const h=this.$iApi.geo.layer.files.inferType(r[a]);return{name:c,alias:l,type:h,length:h===W0.STRING?256:void 0}}),this.oidField="rampOID",this.fields.push({name:this.oidField,type:W0.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 jEi(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}else throw new Error("Attempted to initiate file based data layer, sourceJson is missing")}async terminate(){await super.terminate()}async reload(){this.initiationState===Uv.INITIATED&&(this.$iApi.event.emit(cn.LAYER_RELOAD_START,this),await this.terminate()),await this.initiate(),this.layerState!==Rp.ERROR&&this.onLoad(),setTimeout(()=>{this.$iApi.event.emit(cn.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(i=>{this.legend[0].svgcode=i})}],e}getAttributes(){return this.attribs.attLoader.getAttribs()}getTabularAttributes(){return this.$iApi.geo.attributes.generateTabularAttributes(this,this.attribs)}async getGraphic(e,i){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 I1(new FM,"",r)}async getIcon(e){return'D'}async getFilterOIDs(e=[],i=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(cn.LAYER_VISIBILITYCHANGE,{visibility:e,layer:this}))}}class kEi extends Jdt{constructor(e,i){super(e,i),this.layerType=_n.DATAJSON}async onInitiate(){if(this.origRampConfig.rawData&&(typeof this.origRampConfig.rawData=="string"||this.origRampConfig.rawData instanceof Object))this.sourceJson=this.origRampConfig.rawData;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 $Ei extends Jdt{filter;serviceUrl;constructor(e,i){super(e,i),this.layerType=_n.DATATABLE,this.serviceUrl=e.url,this.filter=new Ent(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(Nf.PERMANENT)};this.attribs.attLoader=new ept(this.$iApi,a),this.attribs.quickCache=new tpt(this.geomType)}),s=this.$iApi.geo.layer.loadFeatureCount(this.serviceUrl,this.getSqlFilter(Nf.PERMANENT)).then(o=>{this.featureCount=o});return this.layerTree.layerIdx=r,e.push(n,s),e}async getGraphic(e,i){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 I1(new FM,"",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,i){const r=this.filter.getSql(e);i!==r&&(this.filter.setSql(e,i),this.$iApi.event.emit(cn.FILTER_CHANGE,{uid:this.uid,filterKey:e}))}getSqlFilter(e){return this.filter.getSql(e)}getCombinedSqlFilter(e){return this.filter.getCombinedSql(e)}async getFilterOIDs(e=[],i=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 i={url:this.serviceUrl,...e};return this.$iApi.geo.query.arcGisServerQueryIds(i)}async queryFeaturesDiscrete(e){const i=await this.queryOIDs(e),r={getAttribs:!0};return i.map(n=>({oid:n,graphic:this.getGraphic(n,r)}))}async queryFeatures(e){const i=await this.queryFeaturesDiscrete(e);return Promise.all(i.map(r=>r.graphic))}}class BEi extends Gp{oidIndexer(e,i){e.features.forEach((r,n)=>{e.oidIndex[r[i]]=n})}async arcGisBatchLoad(e,i){if(i.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 yD(ur(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){i.loadedCount+=l;let c;if(e.supportsLimit?c=o.data.exceededTransferLimit:(e.batchSize===-1&&(e.batchSize=l),c=l>=e.batchSize),c){e.maxId=a[l-1].attributes[e.oidField];const h=await this.arcGisBatchLoad(e,i);return i.loadAbortFlag?[]:a.concat(h)}else return i.loadAbortFlag?[]:a}else return[]}async loadArcGisServerAttributes(e,i){e.maxId=-1,e.batchSize=-1;const n={features:(await this.arcGisBatchLoad(e,i)).map(s=>s.attributes),oidIndex:{}};return this.oidIndexer(n,e.oidField),i.loadIsDone=!0,n}async loadGraphicsAttributes(e,i){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),i.loadIsDone=!0,i.loadedCount=n.features.length,n}async loadCompactJsonAttributes(e,i){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,c)=>{a[r[c]]=l}),a}),oidIndex:{}};return this.oidIndexer(s,e.oidField),i.loadIsDone=!0,i.loadedCount=s.features.length,e.sourceDataJson=void 0,s}async loadSingleFeature(e){const i={query:{f:"json",objectIds:e.oid,returnGeometry:e.includeGeometry,outFields:e.attribs}};typeof e.maxOffset<"u"&&(i.query.maxAllowableOffset=e.maxOffset),typeof e.mapSR<"u"&&(i.query.outSR=e.mapSR),typeof e.geometryPrecision<"u"&&e.geometryPrecision>=0&&(i.query.geometryPrecision=e.geometryPrecision);const[r,n]=await yD(ur(e.serviceUrl+"/query",i));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=Sl(o.geometry);a=this.$iApi.geo.geom.geomEsriToRamp(l)}else a=new FM;return new I1(a,"",o.attributes)}return Promise.reject(new Error(`Could not locate feature ${e.oid} for layer ${e.serviceUrl}`))}applyFieldMetadata(e,i=void 0){if(!i||!i.fieldInfo){e.fieldList="*";return}if(i.exclusiveFields){i.fieldInfo.find(n=>n.name===e.oidField)||i.fieldInfo.push({name:e.oidField}),e.fieldList=i.fieldInfo.map(n=>n.name).join(",");const r=i.fieldInfo;e.fields=e.fields.filter(n=>r.find(s=>s.name===n.name))}else e.fieldList="*";i.fieldInfo.forEach(r=>{if(r.alias){const n=e.fields.find(s=>s.name===r.name);n&&(n.alias=r.alias)}})}fieldValidator(e,i){if(e.findIndex(r=>r.name===i)===-1){const r=e.find(n=>n.alias===i);return r?r.name:(console.warn(`Cannot find name field in layer field list: ${i}`),"")}else return i}async generateTabularAttributes(e,i){return i.attLoader.tabularAttributesCache||(i.attLoader.tabularAttributesCache=this.$iApi.geo.attributes.generateTabularAttributesWorker(e,i)),i.attLoader.tabularAttributesCache}async generateTabularAttributesWorker(e,i){if(e.dataFormat===By.ESRI_RASTER)throw new Error("Attempting to get attributes on a raster layer.");const r=await i.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=uue({},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(c=>{c[l]=a})}}),{columns:n,rows:s,fields:e.fields,oidField:e.oidField}}}class Zdt{_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 Qdt{loadedCount;loadAbortFlag;loadIsDone;constructor(){this.loadedCount=0,this.loadAbortFlag=!1,this.loadIsDone=!1}}class oRe extends Gp{aac;loadPromise;details;tabularAttributesCache;constructor(e,i){super(e),this.aac=new Qdt,this.details=i}updateFieldList(e){this.details.attribs=e}getAttribs(){return this.loadPromise||(this.aac=new Qdt,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 ept extends oRe{constructor(e,i){super(e,i)}loadPromiseGenerator(){return this.$iApi.geo.attributes.loadArcGisServerAttributes(this.details,this.aac)}}class VEi extends oRe{constructor(e,i){super(e,i)}loadPromiseGenerator(){return this.$iApi.geo.attributes.loadGraphicsAttributes(this.details,this.aac)}}class jEi extends oRe{constructor(e,i){super(e,i)}loadPromiseGenerator(){return this.$iApi.geo.attributes.loadCompactJsonAttributes(this.details,this.aac)}}class tpt{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,i){this.attribs[e]=i}getGeom(e,i=void 0){return this.getGeomStore(i)[e]}setGeom(e,i,r=void 0){const n=this.getGeomStore(r);n[e]=i}getExtent(e){return this.extents[e]}setExtent(e,i){this.extents[e]=i}clearAll(){this.attribs={},this.geoms={},this.extents={}}}class aRe{innerRenderer;symbolUnits;defaultUnit;type;falseRenderer;constructor(e,i,r=!1){this.innerRenderer=e,this.symbolUnits=[],this.falseRenderer=r,this.type=vre.Unknown}makeSearchParams(e){return e}searchRenderer(e){const i=this.makeSearchParams(e),r=this.symbolUnits.find(s=>s.match(i));if(r)return r;if(this.defaultUnit)return this.defaultUnit;console.error(`renderer search could not find match for ${i}`);const n=new tde(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,i){let r="'";if(!i||i.length===0)return r;const n=i.find(s=>s.name===e);return n&&n.type&&n.type!=="string"&&(r=""),r}cleanFieldName(e,i){if(!e)return e;let r=i.find(n=>n.name===e);if(r)return e;{const n=e.toLowerCase();return r=i.find(s=>s.name.toLowerCase()===n),r?r.name:e}}makeElseClause(){return this.falseRenderer?"":`(NOT (${this.symbolUnits.map(i=>i.definitionClause).join(" OR ")}))`}}class tde{isDefault=!1;svgCode="";symbol;definitionClause="";label="";parent;constructor(e){this.parent=e,this.symbol=new wd}match(e){return!!e}}class GEi extends aRe{constructor(e,i){super(e,i),this.type=vre.Simple;const r=new tde(this);r.label=e.label||"",r.symbol=e.symbol,r.definitionClause="1=1",this.symbolUnits.push(r)}}class UEi extends aRe{delim;keyFields;constructor(e,i,r=!1){super(e,i,r),this.type=vre.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,i));const s=this.keyFields.map(o=>this.getFieldDelimiter(o,i));if(e.uniqueValueInfos.forEach(o=>{const a=new ipt(this,o.value);if(a.label=o.label||"",a.symbol=o.symbol,!this.falseRenderer){const l=a.matchValue.split(this.delim),c=this.keyFields.map((h,p)=>l[p]===""?`${h} IS NULL`:`${h} = ${s[p]}${n(l[p])}${s[p]}`).join(" AND ");a.definitionClause=`(${c})`,a.matchValue=a.matchValue.replace(//g,"")}this.symbolUnits.push(a)}),e.defaultSymbol){const o=new ipt(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(i=>{let r=e[i]===null?"":e[i];return typeof r!="string"&&(r=r.toString()),r}).join(this.delim)}}class ipt extends tde{matchValue;constructor(e,i){super(e),typeof i=="number"?this.matchValue=i.toString():this.matchValue=i}match(e){return this.matchValue===e}}class zEi extends aRe{valField;constructor(e,i,r=!1){if(super(e,i,r),this.valField=this.cleanFieldName(e.field,i),e.classBreakInfos.forEach(n=>{const s=new rpt(this,n.minValue,n.maxValue);s.label=n.label||"",s.symbol=n.symbol,this.falseRenderer||(s.definitionClause=`(${this.valField} > ${n.minValue} AND ${this.valField} <= ${n.maxValue})`),this.symbolUnits.push(s)}),e.defaultSymbol){const n=new rpt(this,0,0);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 rpt extends tde{minValue;maxValue;constructor(e,i,r){super(e),this.minValue=i,this.maxValue=r}match(e){return this.minValue===this.maxValue?this.maxValue===e:this.minValue=e}}var npt={exports:{}};/*! * svg.js - A lightweight library for manipulating and animating SVG. * @version 2.7.1 * https://svgdotjs.github.io/ @@ -141,24 +145,24 @@ northing meters`+pe;var Ct=ot/2,Wt=0,pi=0,di,Oi,zi,sr,tr;return 0=0;Pe--)if(J[Pe])for(xe in he)J[Pe].prototype[xe]=he[xe];s.Set&&s.Set.inherit&&s.Set.inherit()},s.invent=function(J){var he=typeof J.create=="function"?J.create:function(){this.constructor.call(this,s.create(J.create))};return J.inherit&&(he.prototype=new J.inherit),J.extend&&s.extend(he,J.extend),J.construct&&s.extend(J.parent||s.Container,J.construct),he},s.adopt=function(J){if(!J)return null;if(J.instance)return J.instance;var he;return J.nodeName=="svg"?he=J.parentNode instanceof i.SVGElement?new s.Nested:new s.Doc:J.nodeName=="linearGradient"?he=new s.Gradient("linear"):J.nodeName=="radialGradient"?he=new s.Gradient("radial"):s[O(J.nodeName)]?he=new s[O(J.nodeName)]:he=new s.Element(J),he.type=J.nodeName,he.node=J,J.instance=he,he instanceof s.Doc&&he.namespace().defs(),he.setData(JSON.parse(J.getAttribute("svgjs:data"))||{}),he},s.prepare=function(){var J=r.getElementsByTagName("body")[0],he=(J?new s.Doc(J):s.adopt(r.documentElement).nested()).size(2,0);s.parser={body:J||r.documentElement,draw:he.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").attr("focusable","false").node,poly:he.polyline().node,path:he.path().node,native:s.create("svg")}},s.parser={native:s.create("svg")},r.addEventListener("DOMContentLoaded",function(){s.parser.draw||s.prepare()},!1),s.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},s.utils={map:function(J,he){var xe,Pe=J.length,Oe=[];for(xe=0;xe1?1:J,new s.Color({r:~~(this.r+(this.destination.r-this.r)*J),g:~~(this.g+(this.destination.g-this.g)*J),b:~~(this.b+(this.destination.b-this.b)*J)})):this}}),s.Color.test=function(J){return J+="",s.regex.isHex.test(J)||s.regex.isRgb.test(J)},s.Color.isRgb=function(J){return J&&typeof J.r=="number"&&typeof J.g=="number"&&typeof J.b=="number"},s.Color.isColor=function(J){return s.Color.isRgb(J)||s.Color.test(J)},s.Array=function(J,he){J=(J||[]).valueOf(),J.length==0&&he&&(J=he.valueOf()),this.value=this.parse(J)},s.extend(s.Array,{morph:function(J){if(this.destination=this.parse(J),this.value.length!=this.destination.length){for(var he=this.value[this.value.length-1],xe=this.destination[this.destination.length-1];this.value.length>this.destination.length;)this.destination.push(xe);for(;this.value.length=0;Pe--)this.value[Pe]=[this.value[Pe][0]+J,this.value[Pe][1]+he];return this},size:function(J,he){var xe,Pe=this.bbox();for(xe=this.value.length-1;xe>=0;xe--)Pe.width&&(this.value[xe][0]=(this.value[xe][0]-Pe.x)*J/Pe.width+Pe.x),Pe.height&&(this.value[xe][1]=(this.value[xe][1]-Pe.y)*he/Pe.height+Pe.y);return this},bbox:function(){return s.parser.poly.setAttribute("points",this.toString()),s.parser.poly.getBBox()}});for(var o={M:function(J,he,xe){return he.x=xe.x=J[0],he.y=xe.y=J[1],["M",he.x,he.y]},L:function(J,he){return he.x=J[0],he.y=J[1],["L",J[0],J[1]]},H:function(J,he){return he.x=J[0],["H",J[0]]},V:function(J,he){return he.y=J[0],["V",J[0]]},C:function(J,he){return he.x=J[4],he.y=J[5],["C",J[0],J[1],J[2],J[3],J[4],J[5]]},S:function(J,he){return he.x=J[2],he.y=J[3],["S",J[0],J[1],J[2],J[3]]},Q:function(J,he){return he.x=J[2],he.y=J[3],["Q",J[0],J[1],J[2],J[3]]},T:function(J,he){return he.x=J[0],he.y=J[1],["T",J[0],J[1]]},Z:function(J,he,xe){return he.x=xe.x,he.y=xe.y,["Z"]},A:function(J,he){return he.x=J[5],he.y=J[6],["A",J[0],J[1],J[2],J[3],J[4],J[5],J[6]]}},a="mlhvqtcsaz".split(""),l=0,c=a.length;l=0;Oe--)Pe=this.value[Oe][0],Pe=="M"||Pe=="L"||Pe=="T"?(this.value[Oe][1]+=J,this.value[Oe][2]+=he):Pe=="H"?this.value[Oe][1]+=J:Pe=="V"?this.value[Oe][1]+=he:Pe=="C"||Pe=="S"||Pe=="Q"?(this.value[Oe][1]+=J,this.value[Oe][2]+=he,this.value[Oe][3]+=J,this.value[Oe][4]+=he,Pe=="C"&&(this.value[Oe][5]+=J,this.value[Oe][6]+=he)):Pe=="A"&&(this.value[Oe][6]+=J,this.value[Oe][7]+=he);return this},size:function(J,he){var xe,Pe,Oe=this.bbox();for(xe=this.value.length-1;xe>=0;xe--)Pe=this.value[xe][0],Pe=="M"||Pe=="L"||Pe=="T"?(this.value[xe][1]=(this.value[xe][1]-Oe.x)*J/Oe.width+Oe.x,this.value[xe][2]=(this.value[xe][2]-Oe.y)*he/Oe.height+Oe.y):Pe=="H"?this.value[xe][1]=(this.value[xe][1]-Oe.x)*J/Oe.width+Oe.x:Pe=="V"?this.value[xe][1]=(this.value[xe][1]-Oe.y)*he/Oe.height+Oe.y:Pe=="C"||Pe=="S"||Pe=="Q"?(this.value[xe][1]=(this.value[xe][1]-Oe.x)*J/Oe.width+Oe.x,this.value[xe][2]=(this.value[xe][2]-Oe.y)*he/Oe.height+Oe.y,this.value[xe][3]=(this.value[xe][3]-Oe.x)*J/Oe.width+Oe.x,this.value[xe][4]=(this.value[xe][4]-Oe.y)*he/Oe.height+Oe.y,Pe=="C"&&(this.value[xe][5]=(this.value[xe][5]-Oe.x)*J/Oe.width+Oe.x,this.value[xe][6]=(this.value[xe][6]-Oe.y)*he/Oe.height+Oe.y)):Pe=="A"&&(this.value[xe][1]=this.value[xe][1]*J/Oe.width,this.value[xe][2]=this.value[xe][2]*he/Oe.height,this.value[xe][6]=(this.value[xe][6]-Oe.x)*J/Oe.width+Oe.x,this.value[xe][7]=(this.value[xe][7]-Oe.y)*he/Oe.height+Oe.y);return this},equalCommands:function(J){var he,xe,Pe;for(J=new s.PathArray(J),Pe=this.value.length===J.value.length,he=0,xe=this.value.length;Pe&&heze);return Pe},bbox:function(){return s.parser.path.setAttribute("d",this.toString()),s.parser.path.getBBox()}}),s.Number=s.invent({create:function(J,he){this.value=0,this.unit=he||"",typeof J=="number"?this.value=isNaN(J)?0:isFinite(J)?J:J<0?-34e37:34e37:typeof J=="string"?(he=J.match(s.regex.numberAndUnit),he&&(this.value=parseFloat(he[1]),he[5]=="%"?this.value/=100:he[5]=="s"&&(this.value*=1e3),this.unit=he[5])):J instanceof s.Number&&(this.value=J.valueOf(),this.unit=J.unit)},extend:{toString:function(){return(this.unit=="%"?~~(this.value*1e8)/1e6:this.unit=="s"?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(J){return J=new s.Number(J),new s.Number(this+J,this.unit||J.unit)},minus:function(J){return J=new s.Number(J),new s.Number(this-J,this.unit||J.unit)},times:function(J){return J=new s.Number(J),new s.Number(this*J,this.unit||J.unit)},divide:function(J){return J=new s.Number(J),new s.Number(this/J,this.unit||J.unit)},to:function(J){var he=new s.Number(this);return typeof J=="string"&&(he.unit=J),he},morph:function(J){return this.destination=new s.Number(J),J.relative&&(this.destination.value+=this.value),this},at:function(J){return this.destination?new s.Number(this.destination).minus(this).times(J).plus(this):this}}}),s.Element=s.invent({create:function(J){this._stroke=s.defaults.attrs.stroke,this._event=null,this._events={},this.dom={},(this.node=J)&&(this.type=J.nodeName,this.node.instance=this,this._events=J._events||{},this._stroke=J.getAttribute("stroke")||this._stroke)},extend:{x:function(J){return this.attr("x",J)},y:function(J){return this.attr("y",J)},cx:function(J){return J==null?this.x()+this.width()/2:this.x(J-this.width()/2)},cy:function(J){return J==null?this.y()+this.height()/2:this.y(J-this.height()/2)},move:function(J,he){return this.x(J).y(he)},center:function(J,he){return this.cx(J).cy(he)},width:function(J){return this.attr("width",J)},height:function(J){return this.attr("height",J)},size:function(J,he){var xe=G(this,J,he);return this.width(new s.Number(xe.width)).height(new s.Number(xe.height))},clone:function(J){this.writeDataToDom();var he=fe(this.node.cloneNode(!0));return J?J.add(he):this.after(he),he},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(J){return this.after(J).remove(),J},addTo:function(J){return J.put(this)},putIn:function(J){return J.add(this)},id:function(J){return this.attr("id",J)},inside:function(J,he){var xe=this.bbox();return J>xe.x&&he>xe.y&&J/g,"<$1$2>")+"";for(var xe=0,Pe=he.firstChild.childNodes.length;xe/,"").replace(/<\/svg>$/,"");return this},writeDataToDom:function(){if(this.each||this.lines){var J=this.each?this:this.lines();J.each(function(){this.writeDataToDom()})}return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(J){return this.dom=J,this},is:function(J){return v(this,J)}}}),s.easing={"-":function(J){return J},"<>":function(J){return-Math.cos(J*Math.PI)/2+.5},">":function(J){return Math.sin(J*Math.PI/2)},"<":function(J){return-Math.cos(J*Math.PI/2)+1}},s.morph=function(J){return function(he,xe){return new s.MorphObj(he,xe).at(J)}},s.Situation=s.invent({create:function(J){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new s.Number(J.duration).valueOf(),this.delay=new s.Number(J.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=J.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),s.FX=s.invent({create:function(J){this._target=J,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(J,he,xe){typeof J=="object"&&(he=J.ease,xe=J.delay,J=J.duration);var Pe=new s.Situation({duration:J||1e3,delay:xe||0,ease:s.easing[he||"-"]||he});return this.queue(Pe),this},delay:function(J){var he=new s.Situation({duration:J,delay:0,ease:s.easing["-"]});return this.queue(he)},target:function(J){return J&&J instanceof s.Element?(this._target=J,this):this._target},timeToAbsPos:function(J){return(J-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(J){return this.situation.duration/this._speed*J+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=i.requestAnimationFrame(function(){this.step()}.bind(this))},stopAnimFrame:function(){i.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(J){return(typeof J=="function"||J instanceof s.Situation)&&this.situations.push(J),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof s.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var J,he,xe,Pe=this.situation;if(Pe.init)return this;for(J in Pe.animations)for(xe=this.target()[J](),Array.isArray(xe)||(xe=[xe]),Array.isArray(Pe.animations[J])||(Pe.animations[J]=[Pe.animations[J]]),he=xe.length;he--;)Pe.animations[J][he]instanceof s.Number&&(xe[he]=new s.Number(xe[he])),Pe.animations[J][he]=xe[he].morph(Pe.animations[J][he]);for(J in Pe.attrs)Pe.attrs[J]=new s.MorphObj(this.target().attr(J),Pe.attrs[J]);for(J in Pe.styles)Pe.styles[J]=new s.MorphObj(this.target().style(J),Pe.styles[J]);return Pe.initialTransformation=this.target().matrixify(),Pe.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(J,he){var xe=this.active;return this.active=!1,he&&this.clearQueue(),J&&this.situation&&(!xe&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},reset:function(){if(this.situation){var J=this.situation;this.stop(),this.situation=J,this.atStart()}return this},finish:function(){for(this.stop(!0,!1);this.dequeue().situation&&this.stop(!0,!1););return this.clearQueue().clearCurrent(),this},atStart:function(){return this.at(0,!0)},atEnd:function(){return this.situation.loops===!0&&(this.situation.loops=this.situation.loop+1),typeof this.situation.loops=="number"?this.at(this.situation.loops,!0):this.at(1,!0)},at:function(J,he){var xe=this.situation.duration/this._speed;return this.absPos=J,he||(this.situation.reversed&&(this.absPos=1-this.absPos),this.absPos+=this.situation.loop),this.situation.start=+new Date-this.absPos*xe,this.situation.finish=this.situation.start+xe,this.step(!0)},speed:function(J){return J===0?this.pause():J?(this._speed=J,this.at(this.absPos,!0)):this._speed},loop:function(J,he){var xe=this.last();return xe.loops=J??!0,xe.loop=0,he&&(xe.reversing=!0),this},pause:function(){return this.paused=!0,this.stopAnimFrame(),this},play:function(){return this.paused?(this.paused=!1,this.at(this.absPos,!0)):this},reverse:function(J){var he=this.last();return typeof J>"u"?he.reversed=!he.reversed:he.reversed=J,this},progress:function(J){return J?this.situation.ease(this.pos):this.pos},after:function(J){var he=this.last(),xe=function Pe(Oe){Oe.detail.situation==he&&(J.call(this,he),this.off("finished.fx",Pe))};return this.target().on("finished.fx",xe),this._callStart()},during:function(J){var he=this.last(),xe=function(Pe){Pe.detail.situation==he&&J.call(this,Pe.detail.pos,s.morph(Pe.detail.pos),Pe.detail.eased,he)};return this.target().off("during.fx",xe).on("during.fx",xe),this.after(function(){this.off("during.fx",xe)}),this._callStart()},afterAll:function(J){var he=function xe(Pe){J.call(this),this.off("allfinished.fx",xe)};return this.target().off("allfinished.fx",he).on("allfinished.fx",he),this._callStart()},duringAll:function(J){var he=function(xe){J.call(this,xe.detail.pos,s.morph(xe.detail.pos),xe.detail.eased,xe.detail.situation)};return this.target().off("during.fx",he).on("during.fx",he),this.afterAll(function(){this.off("during.fx",he)}),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(J,he,xe){return this.last()[xe||"animations"][J]=he,this._callStart()},step:function(J){if(J||(this.absPos=this.timeToAbsPos(+new Date)),this.situation.loops!==!1){var he,xe,Pe;he=Math.max(this.absPos,0),xe=Math.floor(he),this.situation.loops===!0||xethis.lastPos&&Ae<=Oe&&(this.situation.once[Ae].call(this.target(),this.pos,Oe),delete this.situation.once[Ae]);return this.active&&this.target().fire("during",{pos:this.pos,eased:Oe,fx:this,situation:this.situation}),this.situation?(this.eachAt(),this.pos==1&&!this.situation.reversed||this.situation.reversed&&this.pos==0?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=Oe,this):this},eachAt:function(){var J,he,xe,Pe=this,Oe=this.target(),Ae=this.situation;for(J in Ae.animations)xe=[].concat(Ae.animations[J]).map(function(Ge){return typeof Ge!="string"&&Ge.at?Ge.at(Ae.ease(Pe.pos),Pe.pos):Ge}),Oe[J].apply(Oe,xe);for(J in Ae.attrs)xe=[J].concat(Ae.attrs[J]).map(function(Ge){return typeof Ge!="string"&&Ge.at?Ge.at(Ae.ease(Pe.pos),Pe.pos):Ge}),Oe.attr.apply(Oe,xe);for(J in Ae.styles)xe=[J].concat(Ae.styles[J]).map(function(Ge){return typeof Ge!="string"&&Ge.at?Ge.at(Ae.ease(Pe.pos),Pe.pos):Ge}),Oe.style.apply(Oe,xe);if(Ae.transforms.length){for(xe=Ae.initialTransformation,J=0,he=Ae.transforms.length;J=0;--he)this[ke[he]]=J[ke[he]]!=null?J[ke[he]]:xe[ke[he]]},extend:{extract:function(){var J=V(this,0,1),he=V(this,1,0),xe=180/Math.PI*Math.atan2(J.y,J.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(xe*Math.PI/180)+this.f*Math.sin(xe*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(xe*Math.PI/180)+this.e*Math.sin(-xe*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),skewX:-xe,skewY:180/Math.PI*Math.atan2(he.y,he.x),scaleX:Math.sqrt(this.a*this.a+this.b*this.b),scaleY:Math.sqrt(this.c*this.c+this.d*this.d),rotation:xe,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new s.Matrix(this)}},clone:function(){return new s.Matrix(this)},morph:function(J){return this.destination=new s.Matrix(J),this},at:function(J){if(!this.destination)return this;var he=new s.Matrix({a:this.a+(this.destination.a-this.a)*J,b:this.b+(this.destination.b-this.b)*J,c:this.c+(this.destination.c-this.c)*J,d:this.d+(this.destination.d-this.d)*J,e:this.e+(this.destination.e-this.e)*J,f:this.f+(this.destination.f-this.f)*J});return he},multiply:function(J){return new s.Matrix(this.native().multiply(X(J).native()))},inverse:function(){return new s.Matrix(this.native().inverse())},translate:function(J,he){return new s.Matrix(this.native().translate(J||0,he||0))},scale:function(J,he,xe,Pe){return arguments.length==1?he=J:arguments.length==3&&(Pe=xe,xe=he,he=J),this.around(xe,Pe,new s.Matrix(J,0,0,he,0,0))},rotate:function(J,he,xe){return J=s.utils.radians(J),this.around(he,xe,new s.Matrix(Math.cos(J),Math.sin(J),-Math.sin(J),Math.cos(J),0,0))},flip:function(J,he){return J=="x"?this.scale(-1,1,he,0):J=="y"?this.scale(1,-1,0,he):this.scale(-1,-1,J,he??J)},skew:function(J,he,xe,Pe){return arguments.length==1?he=J:arguments.length==3&&(Pe=xe,xe=he,he=J),J=s.utils.radians(J),he=s.utils.radians(he),this.around(xe,Pe,new s.Matrix(1,Math.tan(he),Math.tan(J),1,0,0))},skewX:function(J,he,xe){return this.skew(J,0,he,xe)},skewY:function(J,he,xe){return this.skew(0,J,he,xe)},around:function(J,he,xe){return this.multiply(new s.Matrix(1,0,0,1,J||0,he||0)).multiply(xe).multiply(new s.Matrix(1,0,0,1,-J||0,-he||0))},native:function(){for(var J=s.parser.native.createSVGMatrix(),he=ke.length-1;he>=0;he--)J[ke[he]]=this[ke[he]];return J},toString:function(){return"matrix("+Ie(this.a)+","+Ie(this.b)+","+Ie(this.c)+","+Ie(this.d)+","+Ie(this.e)+","+Ie(this.f)+")"}},parent:s.Element,construct:{ctm:function(){return new s.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof s.Nested){var J=this.rect(1,1),he=J.node.getScreenCTM();return J.remove(),new s.Matrix(he)}return new s.Matrix(this.node.getScreenCTM())}}}),s.Point=s.invent({create:function(J,he){var xe,Pe={x:0,y:0};xe=Array.isArray(J)?{x:J[0],y:J[1]}:typeof J=="object"?{x:J.x,y:J.y}:J!=null?{x:J,y:he??J}:Pe,this.x=xe.x,this.y=xe.y},extend:{clone:function(){return new s.Point(this)},morph:function(J,he){return this.destination=new s.Point(J,he),this},at:function(J){if(!this.destination)return this;var he=new s.Point({x:this.x+(this.destination.x-this.x)*J,y:this.y+(this.destination.y-this.y)*J});return he},native:function(){var J=s.parser.native.createSVGPoint();return J.x=this.x,J.y=this.y,J},transform:function(J){return new s.Point(this.native().matrixTransform(J.native()))}}}),s.extend(s.Element,{point:function(J,he){return new s.Point(J,he).transform(this.screenCTM().inverse())}}),s.extend(s.Element,{attr:function(J,he,xe){if(J==null){for(J={},he=this.node.attributes,xe=he.length-1;xe>=0;xe--)J[he[xe].nodeName]=s.regex.isNumber.test(he[xe].nodeValue)?parseFloat(he[xe].nodeValue):he[xe].nodeValue;return J}else if(typeof J=="object")for(he in J)this.attr(he,J[he]);else if(he===null)this.node.removeAttribute(J);else{if(he==null)return he=this.node.getAttribute(J),he==null?s.defaults.attrs[J]:s.regex.isNumber.test(he)?parseFloat(he):he;J=="stroke-width"?this.attr("stroke",parseFloat(he)>0?this._stroke:null):J=="stroke"&&(this._stroke=he),(J=="fill"||J=="stroke")&&(s.regex.isImage.test(he)&&(he=this.doc().defs().image(he,0,0)),he instanceof s.Image&&(he=this.doc().defs().pattern(0,0,function(){this.add(he)}))),typeof he=="number"?he=new s.Number(he):s.Color.isColor(he)?he=new s.Color(he):Array.isArray(he)&&(he=new s.Array(he)),J=="leading"?this.leading&&this.leading(he):typeof xe=="string"?this.node.setAttributeNS(xe,J,he.toString()):this.node.setAttribute(J,he.toString()),this.rebuild&&(J=="font-size"||J=="x")&&this.rebuild(J,he)}return this}}),s.extend(s.Element,{transform:function(J,he){var xe=this,Pe,Oe;if(typeof J!="object")return Pe=new s.Matrix(xe).extract(),typeof J=="string"?Pe[J]:Pe;if(Pe=new s.Matrix(xe),he=!!he||!!J.relative,J.a!=null)Pe=he?Pe.multiply(new s.Matrix(J)):new s.Matrix(J);else if(J.rotation!=null)te(J,xe),Pe=he?Pe.rotate(J.rotation,J.cx,J.cy):Pe.rotate(J.rotation-Pe.extract().rotation,J.cx,J.cy);else if(J.scale!=null||J.scaleX!=null||J.scaleY!=null){if(te(J,xe),J.scaleX=J.scale!=null?J.scale:J.scaleX!=null?J.scaleX:1,J.scaleY=J.scale!=null?J.scale:J.scaleY!=null?J.scaleY:1,!he){var Ae=Pe.extract();J.scaleX=J.scaleX*1/Ae.scaleX,J.scaleY=J.scaleY*1/Ae.scaleY}Pe=Pe.scale(J.scaleX,J.scaleY,J.cx,J.cy)}else if(J.skew!=null||J.skewX!=null||J.skewY!=null){if(te(J,xe),J.skewX=J.skew!=null?J.skew:J.skewX!=null?J.skewX:0,J.skewY=J.skew!=null?J.skew:J.skewY!=null?J.skewY:0,!he){var Ae=Pe.extract();Pe=Pe.multiply(new s.Matrix().skew(Ae.skewX,Ae.skewY,J.cx,J.cy).inverse())}Pe=Pe.skew(J.skewX,J.skewY,J.cx,J.cy)}else J.flip?(J.flip=="x"||J.flip=="y"?J.offset=J.offset==null?xe.bbox()["c"+J.flip]:J.offset:J.offset==null?(Oe=xe.bbox(),J.flip=Oe.cx,J.offset=Oe.cy):J.flip=J.offset,Pe=new s.Matrix().flip(J.flip,J.offset)):(J.x!=null||J.y!=null)&&(he?Pe=Pe.translate(J.x,J.y):(J.x!=null&&(Pe.e=J.x),J.y!=null&&(Pe.f=J.y)));return this.attr("transform",Pe)}}),s.extend(s.FX,{transform:function(J,he){var xe=this.target(),Pe,Oe;return typeof J!="object"?(Pe=new s.Matrix(xe).extract(),typeof J=="string"?Pe[J]:Pe):(he=!!he||!!J.relative,J.a!=null?Pe=new s.Matrix(J):J.rotation!=null?(te(J,xe),Pe=new s.Rotate(J.rotation,J.cx,J.cy)):J.scale!=null||J.scaleX!=null||J.scaleY!=null?(te(J,xe),J.scaleX=J.scale!=null?J.scale:J.scaleX!=null?J.scaleX:1,J.scaleY=J.scale!=null?J.scale:J.scaleY!=null?J.scaleY:1,Pe=new s.Scale(J.scaleX,J.scaleY,J.cx,J.cy)):J.skewX!=null||J.skewY!=null?(te(J,xe),J.skewX=J.skewX!=null?J.skewX:0,J.skewY=J.skewY!=null?J.skewY:0,Pe=new s.Skew(J.skewX,J.skewY,J.cx,J.cy)):J.flip?(J.flip=="x"||J.flip=="y"?J.offset=J.offset==null?xe.bbox()["c"+J.flip]:J.offset:J.offset==null?(Oe=xe.bbox(),J.flip=Oe.cx,J.offset=Oe.cy):J.flip=J.offset,Pe=new s.Matrix().flip(J.flip,J.offset)):(J.x!=null||J.y!=null)&&(Pe=new s.Translate(J.x,J.y)),Pe?(Pe.relative=he,this.last().transforms.push(Pe),this._callStart()):this)}}),s.extend(s.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){var J=(this.attr("transform")||"").split(s.regex.transforms).slice(0,-1).map(function(he){var xe=he.trim().split("(");return[xe[0],xe[1].split(s.regex.delimiter).map(function(Pe){return parseFloat(Pe)})]}).reduce(function(he,xe){return xe[0]=="matrix"?he.multiply(Y(xe[1])):he[xe[0]].apply(he,xe[1])},new s.Matrix);return J},toParent:function(J){if(this==J)return this;var he=this.screenCTM(),xe=J.screenCTM().inverse();return this.addTo(J).untransform().transform(xe.multiply(he)),this},toDoc:function(){return this.toParent(this.doc())}}),s.Transformation=s.invent({create:function(J,he){if(arguments.length>1&&typeof he!="boolean")return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(J))for(var xe=0,Pe=this.arguments.length;xe"u"?0:J[this.arguments[he]];return J.cx=this.cx,J.cy=this.cy,this._undo=new s[O(this.method)](J,!0).at(1),this}}}),s.Translate=s.invent({parent:s.Matrix,inherit:s.Transformation,create:function(J,he){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["transformedX","transformedY"],method:"translate"}}),s.Rotate=s.invent({parent:s.Matrix,inherit:s.Transformation,create:function(J,he){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["rotation","cx","cy"],method:"rotate",at:function(J){var he=new s.Matrix().rotate(new s.Number().morph(this.rotation-(this._undo?this._undo.rotation:0)).at(J),this.cx,this.cy);return this.inversed?he.inverse():he},undo:function(J){return this._undo=J,this}}}),s.Scale=s.invent({parent:s.Matrix,inherit:s.Transformation,create:function(J,he){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["scaleX","scaleY","cx","cy"],method:"scale"}}),s.Skew=s.invent({parent:s.Matrix,inherit:s.Transformation,create:function(J,he){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["skewX","skewY","cx","cy"],method:"skew"}}),s.extend(s.Element,{style:function(J,he){if(arguments.length==0)return this.node.style.cssText||"";if(arguments.length<2)if(typeof J=="object")for(he in J)this.style(he,J[he]);else if(s.regex.isCss.test(J))for(J=J.split(/\s*;\s*/).filter(function(xe){return!!xe}).map(function(xe){return xe.split(/\s*:\s*/)});he=J.pop();)this.style(he[0],he[1]);else return this.node.style[I(J)];else this.node.style[I(J)]=he===null||s.regex.isBlank.test(he)?"":he;return this}}),s.Parent=s.invent({create:function(J){this.constructor.call(this,J)},inherit:s.Element,extend:{children:function(){return s.utils.map(s.utils.filterSVGElements(this.node.childNodes),function(J){return s.adopt(J)})},add:function(J,he){return he==null?this.node.appendChild(J.node):J.node!=this.node.childNodes[he]&&this.node.insertBefore(J.node,this.node.childNodes[he]),this},put:function(J,he){return this.add(J,he),J},has:function(J){return this.index(J)>=0},index:function(J){return[].slice.call(this.node.childNodes).indexOf(J.node)},get:function(J){return s.adopt(this.node.childNodes[J])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(J,he){var xe,Pe,Oe=this.children();for(xe=0,Pe=Oe.length;xeOe/Ae?this.height/Ae:this.width/Oe,this.x=xe,this.y=Pe,this.width=Oe,this.height=Ae)}else J=typeof J=="string"?J.match(ft).map(function(Pt){return parseFloat(Pt)}):Array.isArray(J)?J:typeof J=="object"?[J.x,J.y,J.width,J.height]:arguments.length==4?[].slice.call(arguments):he,this.x=J[0],this.y=J[1],this.width=J[2],this.height=J[3]},extend:{toString:function(){return this.x+" "+this.y+" "+this.width+" "+this.height},morph:function(J,he,xe,Pe){return this.destination=new s.ViewBox(J,he,xe,Pe),this},at:function(J){return this.destination?new s.ViewBox([this.x+(this.destination.x-this.x)*J,this.y+(this.destination.y-this.y)*J,this.width+(this.destination.width-this.width)*J,this.height+(this.destination.height-this.height)*J]):this}},parent:s.Container,construct:{viewbox:function(J,he,xe,Pe){return arguments.length==0?new s.ViewBox(this):this.attr("viewBox",new s.ViewBox(J,he,xe,Pe))}}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(J){s.Element.prototype[J]=function(he){return he==null?s.off(this,J):s.on(this,J,he),this}}),s.listenerId=0,s.on=function(J,he,xe,Pe,Oe){var Ae=xe.bind(Pe||J),ze=J instanceof s.Element?J.node:J;ze.instance=ze.instance||{_events:{}};var Ge=ze.instance._events;xe._svgjsListenerId||(xe._svgjsListenerId=++s.listenerId),he.split(s.regex.delimiter).forEach(function(Je){var et=Je.split(".")[0],tt=Je.split(".")[1]||"*";Ge[et]=Ge[et]||{},Ge[et][tt]=Ge[et][tt]||{},Ge[et][tt][xe._svgjsListenerId]=Ae,ze.addEventListener(et,Ae,Oe||!1)})},s.off=function(J,he,xe,Pe){var Oe=J instanceof s.Element?J.node:J;if(Oe.instance&&!(typeof xe=="function"&&(xe=xe._svgjsListenerId,!xe))){var Ae=Oe.instance._events;(he||"").split(s.regex.delimiter).forEach(function(ze){var Ge=ze&&ze.split(".")[0],Je=ze&&ze.split(".")[1],et,tt;if(xe)Ae[Ge]&&Ae[Ge][Je||"*"]&&(Oe.removeEventListener(Ge,Ae[Ge][Je||"*"][xe],Pe||!1),delete Ae[Ge][Je||"*"][xe]);else if(Ge&&Je){if(Ae[Ge]&&Ae[Ge][Je]){for(tt in Ae[Ge][Je])s.off(Oe,[Ge,Je].join("."),tt);delete Ae[Ge][Je]}}else if(Je)for(ze in Ae)for(et in Ae[ze])Je===et&&s.off(Oe,[ze,Je].join("."));else if(Ge){if(Ae[Ge]){for(et in Ae[Ge])s.off(Oe,[Ge,et].join("."));delete Ae[Ge]}}else{for(ze in Ae)s.off(Oe,ze);Oe.instance._events={}}})}},s.extend(s.Element,{on:function(J,he,xe,Pe){return s.on(this,J,he,xe,Pe),this},off:function(J,he){return s.off(this.node,J,he),this},fire:function(J,he){return J instanceof i.Event?this.node.dispatchEvent(J):this.node.dispatchEvent(J=new s.CustomEvent(J,{detail:he,cancelable:!0})),this._event=J,this},event:function(){return this._event}}),s.Defs=s.invent({create:"defs",inherit:s.Container}),s.G=s.invent({create:"g",inherit:s.Container,extend:{x:function(J){return J==null?this.transform("x"):this.transform({x:J-this.x()},!0)},y:function(J){return J==null?this.transform("y"):this.transform({y:J-this.y()},!0)},cx:function(J){return J==null?this.gbox().cx:this.x(J-this.gbox().width/2)},cy:function(J){return J==null?this.gbox().cy:this.y(J-this.gbox().height/2)},gbox:function(){var J=this.bbox(),he=this.transform();return J.x+=he.x,J.x2+=he.x,J.cx+=he.x,J.y+=he.y,J.y2+=he.y,J.cy+=he.y,J}},construct:{group:function(){return this.put(new s.G)}}}),s.Doc=s.invent({create:function(J){J&&(J=typeof J=="string"?r.getElementById(J):J,J.nodeName=="svg"?this.constructor.call(this,J):(this.constructor.call(this,s.create("svg")),J.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:s.Container,extend:{namespace:function(){return this.attr({xmlns:s.ns,version:"1.1"}).attr("xmlns:xlink",s.xlink,s.xmlns).attr("xmlns:svgjs",s.svgjs,s.xmlns)},defs:function(){if(!this._defs){var J;(J=this.node.getElementsByTagName("defs")[0])?this._defs=s.adopt(J):this._defs=new s.Defs,this.node.appendChild(this._defs.node)}return this._defs},parent:function(){return!this.node.parentNode||this.node.parentNode.nodeName=="#document"||this.node.parentNode.nodeName=="#document-fragment"?null:this.node.parentNode},spof:function(){var J=this.node.getScreenCTM();return J&&this.style("left",-J.e%1+"px").style("top",-J.f%1+"px"),this},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,s.parser.draw.parentNode||this.node.appendChild(s.parser.draw),this},clone:function(J){this.writeDataToDom();var he=this.node,xe=fe(he.cloneNode(!0));return J?(J.node||J).appendChild(xe.node):he.parentNode.insertBefore(xe.node,he.nextSibling),xe}}}),s.extend(s.Element,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},previous:function(){return this.siblings()[this.position()-1]},forward:function(){var J=this.position()+1,he=this.parent();return he.removeElement(this).add(this,J),he instanceof s.Doc&&he.node.appendChild(he.defs().node),this},backward:function(){var J=this.position();return J>0&&this.parent().removeElement(this).add(this,J-1),this},front:function(){var J=this.parent();return J.node.appendChild(this.node),J instanceof s.Doc&&J.node.appendChild(J.defs().node),this},back:function(){return this.position()>0&&this.parent().removeElement(this).add(this,0),this},before:function(J){J.remove();var he=this.position();return this.parent().add(J,he),this},after:function(J){J.remove();var he=this.position();return this.parent().add(J,he+1),this}}),s.Mask=s.invent({create:function(){this.constructor.call(this,s.create("mask")),this.targets=[]},inherit:s.Container,extend:{remove:function(){for(var J=this.targets.length-1;J>=0;J--)this.targets[J]&&this.targets[J].unmask();return this.targets=[],s.Element.prototype.remove.call(this),this}},construct:{mask:function(){return this.defs().put(new s.Mask)}}}),s.extend(s.Element,{maskWith:function(J){return this.masker=J instanceof s.Mask?J:this.parent().mask().add(J),this.masker.targets.push(this),this.attr("mask",'url("#'+this.masker.attr("id")+'")')},unmask:function(){return delete this.masker,this.attr("mask",null)}}),s.ClipPath=s.invent({create:function(){this.constructor.call(this,s.create("clipPath")),this.targets=[]},inherit:s.Container,extend:{remove:function(){for(var J=this.targets.length-1;J>=0;J--)this.targets[J]&&this.targets[J].unclip();return this.targets=[],this.parent().removeElement(this),this}},construct:{clip:function(){return this.defs().put(new s.ClipPath)}}}),s.extend(s.Element,{clipWith:function(J){return this.clipper=J instanceof s.ClipPath?J:this.parent().clip().add(J),this.clipper.targets.push(this),this.attr("clip-path",'url("#'+this.clipper.attr("id")+'")')},unclip:function(){return delete this.clipper,this.attr("clip-path",null)}}),s.Gradient=s.invent({create:function(J){this.constructor.call(this,s.create(J+"Gradient")),this.type=J},inherit:s.Container,extend:{at:function(J,he,xe){return this.put(new s.Stop).update(J,he,xe)},update:function(J){return this.clear(),typeof J=="function"&&J.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(J,he,xe){return J=="transform"&&(J="gradientTransform"),s.Container.prototype.attr.call(this,J,he,xe)}},construct:{gradient:function(J,he){return this.defs().gradient(J,he)}}}),s.extend(s.Gradient,s.FX,{from:function(J,he){return(this._target||this).type=="radial"?this.attr({fx:new s.Number(J),fy:new s.Number(he)}):this.attr({x1:new s.Number(J),y1:new s.Number(he)})},to:function(J,he){return(this._target||this).type=="radial"?this.attr({cx:new s.Number(J),cy:new s.Number(he)}):this.attr({x2:new s.Number(J),y2:new s.Number(he)})}}),s.extend(s.Defs,{gradient:function(J,he){return this.put(new s.Gradient(J)).update(he)}}),s.Stop=s.invent({create:"stop",inherit:s.Element,extend:{update:function(J){return(typeof J=="number"||J instanceof s.Number)&&(J={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),J.opacity!=null&&this.attr("stop-opacity",J.opacity),J.color!=null&&this.attr("stop-color",J.color),J.offset!=null&&this.attr("offset",new s.Number(J.offset)),this}}}),s.Pattern=s.invent({create:"pattern",inherit:s.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(J){return this.clear(),typeof J=="function"&&J.call(this,this),this},toString:function(){return this.fill()},attr:function(J,he,xe){return J=="transform"&&(J="patternTransform"),s.Container.prototype.attr.call(this,J,he,xe)}},construct:{pattern:function(J,he,xe){return this.defs().pattern(J,he,xe)}}}),s.extend(s.Defs,{pattern:function(J,he,xe){return this.put(new s.Pattern).update(xe).attr({x:0,y:0,width:J,height:he,patternUnits:"userSpaceOnUse"})}}),s.Shape=s.invent({create:function(J){this.constructor.call(this,J)},inherit:s.Element}),s.Bare=s.invent({create:function(J,he){if(this.constructor.call(this,s.create(J)),he)for(var xe in he.prototype)typeof he.prototype[xe]=="function"&&(this[xe]=he.prototype[xe])},inherit:s.Element,extend:{words:function(J){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this.node.appendChild(r.createTextNode(J)),this}}}),s.extend(s.Parent,{element:function(J,he){return this.put(new s.Bare(J,he))}}),s.Symbol=s.invent({create:"symbol",inherit:s.Container,construct:{symbol:function(){return this.put(new s.Symbol)}}}),s.Use=s.invent({create:"use",inherit:s.Shape,extend:{element:function(J,he){return this.attr("href",(he||"")+"#"+J,s.xlink)}},construct:{use:function(J,he){return this.put(new s.Use).element(J,he)}}}),s.Rect=s.invent({create:"rect",inherit:s.Shape,construct:{rect:function(J,he){return this.put(new s.Rect).size(J,he)}}}),s.Circle=s.invent({create:"circle",inherit:s.Shape,construct:{circle:function(J){return this.put(new s.Circle).rx(new s.Number(J).divide(2)).move(0,0)}}}),s.extend(s.Circle,s.FX,{rx:function(J){return this.attr("r",J)},ry:function(J){return this.rx(J)}}),s.Ellipse=s.invent({create:"ellipse",inherit:s.Shape,construct:{ellipse:function(J,he){return this.put(new s.Ellipse).size(J,he).move(0,0)}}}),s.extend(s.Ellipse,s.Rect,s.FX,{rx:function(J){return this.attr("rx",J)},ry:function(J){return this.attr("ry",J)}}),s.extend(s.Circle,s.Ellipse,{x:function(J){return J==null?this.cx()-this.rx():this.cx(J+this.rx())},y:function(J){return J==null?this.cy()-this.ry():this.cy(J+this.ry())},cx:function(J){return J==null?this.attr("cx"):this.attr("cx",J)},cy:function(J){return J==null?this.attr("cy"):this.attr("cy",J)},width:function(J){return J==null?this.rx()*2:this.rx(new s.Number(J).divide(2))},height:function(J){return J==null?this.ry()*2:this.ry(new s.Number(J).divide(2))},size:function(J,he){var xe=G(this,J,he);return this.rx(new s.Number(xe.width).divide(2)).ry(new s.Number(xe.height).divide(2))}}),s.Line=s.invent({create:"line",inherit:s.Shape,extend:{array:function(){return new s.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(J,he,xe,Pe){return J==null?this.array():(typeof he<"u"?J={x1:J,y1:he,x2:xe,y2:Pe}:J=new s.PointArray(J).toLine(),this.attr(J))},move:function(J,he){return this.attr(this.array().move(J,he).toLine())},size:function(J,he){var xe=G(this,J,he);return this.attr(this.array().size(xe.width,xe.height).toLine())}},construct:{line:function(J,he,xe,Pe){return s.Line.prototype.plot.apply(this.put(new s.Line),J!=null?[J,he,xe,Pe]:[0,0,0,0])}}}),s.Polyline=s.invent({create:"polyline",inherit:s.Shape,construct:{polyline:function(J){return this.put(new s.Polyline).plot(J||new s.PointArray)}}}),s.Polygon=s.invent({create:"polygon",inherit:s.Shape,construct:{polygon:function(J){return this.put(new s.Polygon).plot(J||new s.PointArray)}}}),s.extend(s.Polyline,s.Polygon,{array:function(){return this._array||(this._array=new s.PointArray(this.attr("points")))},plot:function(J){return J==null?this.array():this.clear().attr("points",typeof J=="string"?J:this._array=new s.PointArray(J))},clear:function(){return delete this._array,this},move:function(J,he){return this.attr("points",this.array().move(J,he))},size:function(J,he){var xe=G(this,J,he);return this.attr("points",this.array().size(xe.width,xe.height))}}),s.extend(s.Line,s.Polyline,s.Polygon,{morphArray:s.PointArray,x:function(J){return J==null?this.bbox().x:this.move(J,this.bbox().y)},y:function(J){return J==null?this.bbox().y:this.move(this.bbox().x,J)},width:function(J){var he=this.bbox();return J==null?he.width:this.size(J,he.height)},height:function(J){var he=this.bbox();return J==null?he.height:this.size(he.width,J)}}),s.Path=s.invent({create:"path",inherit:s.Shape,extend:{morphArray:s.PathArray,array:function(){return this._array||(this._array=new s.PathArray(this.attr("d")))},plot:function(J){return J==null?this.array():this.clear().attr("d",typeof J=="string"?J:this._array=new s.PathArray(J))},clear:function(){return delete this._array,this},move:function(J,he){return this.attr("d",this.array().move(J,he))},x:function(J){return J==null?this.bbox().x:this.move(J,this.bbox().y)},y:function(J){return J==null?this.bbox().y:this.move(this.bbox().x,J)},size:function(J,he){var xe=G(this,J,he);return this.attr("d",this.array().size(xe.width,xe.height))},width:function(J){return J==null?this.bbox().width:this.size(J,this.bbox().height)},height:function(J){return J==null?this.bbox().height:this.size(this.bbox().width,J)}},construct:{path:function(J){return this.put(new s.Path).plot(J||new s.PathArray)}}}),s.Image=s.invent({create:"image",inherit:s.Shape,extend:{load:function(J){if(!J)return this;var he=this,xe=new i.Image;return s.on(xe,"load",function(){s.off(xe);var Pe=he.parent(s.Pattern);Pe!==null&&(he.width()==0&&he.height()==0&&he.size(xe.width,xe.height),Pe&&Pe.width()==0&&Pe.height()==0&&Pe.size(he.width(),he.height()),typeof he._loaded=="function"&&he._loaded.call(he,{width:xe.width,height:xe.height,ratio:xe.width/xe.height,url:J}))}),s.on(xe,"error",function(Pe){s.off(xe),typeof he._error=="function"&&he._error.call(he,Pe)}),this.attr("href",xe.src=this.src=J,s.xlink)},loaded:function(J){return this._loaded=J,this},error:function(J){return this._error=J,this}},construct:{image:function(J,he,xe){return this.put(new s.Image).load(J).size(he||0,xe||he||0)}}}),s.Text=s.invent({create:function(){this.constructor.call(this,s.create("text")),this.dom.leading=new s.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",s.defaults.attrs["font-family"])},inherit:s.Shape,extend:{x:function(J){return J==null?this.attr("x"):this.attr("x",J)},y:function(J){var he=this.attr("y"),xe=typeof he=="number"?he-this.bbox().y:0;return J==null?typeof he=="number"?he-xe:he:this.attr("y",typeof J.valueOf()=="number"?J+xe:J)},cx:function(J){return J==null?this.bbox().cx:this.x(J-this.bbox().width/2)},cy:function(J){return J==null?this.bbox().cy:this.y(J-this.bbox().height/2)},text:function(J){if(typeof J>"u"){for(var J="",he=this.node.childNodes,xe=0,Pe=he.length;xe"u")return this;if(typeof Pe=="string"||s.Color.isRgb(Pe)||Pe&&typeof Pe.fill=="function")this.attr(J,Pe);else for(he=d[J].length-1;he>=0;he--)Pe[d[J][he]]!=null&&this.attr(d.prefix(J,d[J][he]),Pe[d[J][he]]);return this},s.extend(s.Element,s.FX,xe)}),s.extend(s.Element,s.FX,{rotate:function(J,he,xe){return this.transform({rotation:J,cx:he,cy:xe})},skew:function(J,he,xe,Pe){return arguments.length==1||arguments.length==3?this.transform({skew:J,cx:he,cy:xe}):this.transform({skewX:J,skewY:he,cx:xe,cy:Pe})},scale:function(J,he,xe,Pe){return arguments.length==1||arguments.length==3?this.transform({scale:J,cx:he,cy:xe}):this.transform({scaleX:J,scaleY:he,cx:xe,cy:Pe})},translate:function(J,he){return this.transform({x:J,y:he})},flip:function(J,he){return he=typeof J=="number"?J:he,this.transform({flip:J||"both",offset:he})},matrix:function(J){return this.attr("transform",new s.Matrix(arguments.length==6?[].slice.call(arguments):J))},opacity:function(J){return this.attr("opacity",J)},dx:function(J){return this.x(new s.Number(J).plus(this instanceof s.FX?0:this.x()),!0)},dy:function(J){return this.y(new s.Number(J).plus(this instanceof s.FX?0:this.y()),!0)},dmove:function(J,he){return this.dx(J).dy(he)}}),s.extend(s.Rect,s.Ellipse,s.Circle,s.Gradient,s.FX,{radius:function(J,he){var xe=(this._target||this).type;return xe=="radial"||xe=="circle"?this.attr("r",new s.Number(J)):this.rx(J).ry(he??J)}}),s.extend(s.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(J){return this.node.getPointAtLength(J)}}),s.extend(s.Parent,s.Text,s.Tspan,s.FX,{font:function(J,he){if(typeof J=="object")for(he in J)this.font(he,J[he]);return J=="leading"?this.leading(he):J=="anchor"?this.attr("text-anchor",he):J=="size"||J=="family"||J=="weight"||J=="stretch"||J=="variant"||J=="style"?this.attr("font-"+J,he):this.attr(J,he)}}),s.Set=s.invent({create:function(J){J instanceof s.Set?this.members=J.members.slice():Array.isArray(J)?this.members=J:this.clear()},extend:{add:function(){var J,he,xe=[].slice.call(arguments);for(J=0,he=xe.length;J-1&&this.members.splice(he,1),this},each:function(J){for(var he=0,xe=this.members.length;he=0},index:function(J){return this.members.indexOf(J)},get:function(J){return this.members[J]},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 J=this.members[0].rbox(this.members[0].doc());return this.each(function(){J=J.merge(this.rbox(this.doc()))}),J}},construct:{set:function(J){return new s.Set(J)}}}),s.FX.Set=s.invent({create:function(J){this.set=J}}),s.Set.inherit=function(){var J,he=[];for(var J in s.Shape.prototype)typeof s.Shape.prototype[J]=="function"&&typeof s.Set.prototype[J]!="function"&&he.push(J);he.forEach(function(xe){s.Set.prototype[xe]=function(){for(var Pe=0,Oe=this.members.length;Pe=0;J--)delete this.memory()[arguments[J]];return this},memory:function(){return this._memory||(this._memory={})}}),s.get=function(J){var he=r.getElementById(_e(J)||J);return s.adopt(he)},s.select=function(J,he){return new s.Set(s.utils.map((he||r).querySelectorAll(J),function(xe){return s.adopt(xe)}))},s.extend(s.Parent,{select:function(J){return s.select(J,this.node)}});function p(J,he,xe,Pe){return xe+Pe.replace(s.regex.dots," .")}function y(J){for(var he=J.slice(0),xe=he.length;xe--;)Array.isArray(he[xe])&&(he[xe]=y(he[xe]));return he}function v(J,he){return J instanceof he}function S(J,he){return(J.matches||J.matchesSelector||J.msMatchesSelector||J.mozMatchesSelector||J.webkitMatchesSelector||J.oMatchesSelector).call(J,he)}function I(J){return J.toLowerCase().replace(/-(.)/g,function(he,xe){return xe.toUpperCase()})}function O(J){return J.charAt(0).toUpperCase()+J.slice(1)}function L(J){return J.length==4?["#",J.substring(1,2),J.substring(1,2),J.substring(2,3),J.substring(2,3),J.substring(3,4),J.substring(3,4)].join(""):J}function N(J){var he=J.toString(16);return he.length==1?"0"+he:he}function G(J,he,xe){if(he==null||xe==null){var Pe=J.bbox();he==null?he=Pe.width/Pe.height*xe:xe==null&&(xe=Pe.height/Pe.width*he)}return{width:he,height:xe}}function V(J,he,xe){return{x:he*J.a+xe*J.c+0,y:he*J.b+xe*J.d+0}}function Y(J){return{a:J[0],b:J[1],c:J[2],d:J[3],e:J[4],f:J[5]}}function X(J){return J instanceof s.Matrix||(J=new s.Matrix(J)),J}function te(J,he){J.cx=J.cx==null?he.bbox().cx:J.cx,J.cy=J.cy==null?he.bbox().cy:J.cy}function re(J){for(var he=0,xe=J.length,Pe="";he=0;he--)J.childNodes[he]instanceof i.SVGElement&&fe(J.childNodes[he]);return s.adopt(J).id(s.eid(J.nodeName))}function ge(J){return J.x==null&&(J.x=0,J.y=0,J.width=0,J.height=0),J.w=J.width,J.h=J.height,J.x2=J.x+J.width,J.y2=J.y+J.height,J.cx=J.x+J.width/2,J.cy=J.y+J.height/2,J}function _e(J){var he=(J||"").toString().match(s.regex.reference);if(he)return he[1]}function Ie(J){return Math.abs(J)>1e-37?J:0}var ke="abcdef".split("");if(typeof i.CustomEvent!="function"){var Ne=function(J,he){he=he||{bubbles:!1,cancelable:!1,detail:void 0};var xe=r.createEvent("CustomEvent");return xe.initCustomEvent(J,he.bubbles,he.cancelable,he.detail),xe};Ne.prototype=i.Event.prototype,s.CustomEvent=Ne}else s.CustomEvent=i.CustomEvent;return function(J){for(var he=0,xe=["moz","webkit"],Pe=0;Pe{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,i=null){i===null&&(i=fD(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(i,r);return i.viewbox(0,0,n.width,n.height),i.svg()}async renderSymbologyIcon(e,i=null){if(i===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),i=fD(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(i,r);return n.center(this.CONTAINER_CENTER,this.CONTAINER_CENTER),this.fitInto(n,this.CONTENT_IMAGE_SIZE),i.svg()}generatePlaceholderSymbology(e,i="#000"){const r=fD(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(i),r.text(e[0].toUpperCase()).size(23).fill("#fff").attr({"font-weight":"bold","font-family":"Roboto"}).center(this.CONTAINER_CENTER,this.CONTAINER_CENTER),{name:e,svgcode:r.svg()}}async generateBlankSymbology(){return fD(window.document.createElement("div")).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).svg()}async symbolToSvg(e){const i=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=fD(n).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).viewbox(0,0,this.CONTAINER_SIZE,this.CONTAINER_SIZE),o={path({size:S,path:I}){return s.path(I).size(S*r)},circle({size:S}){return s.circle(S*r)},cross({size:S}){return s.path("M 0,10 L 20,10 M 10,0 L 10,20").size(S*r)},x({size:S}){return s.path("M 0,0 L 20,20 M 20,0 L 0,20").size(S*r)},triangle({size:S}){return s.path("M 20,20 L 10,0 0,20 Z").size(S*r)},diamond({size:S}){return s.path("M 20,10 L 10,0 0,10 10,20 Z").size(S*r)},square({size:S}){return s.path("M 0,0 20,0 20,20 0,20 Z").size(S*r)}},a={[Gv.SOLID]:"none",[Gv.NONE]:"none",[Gv.DASH]:"5.333,4",[Gv.DOT]:"1.333,4",[Gv.DASHDOT]:"5.333,4,1.333,4",[Gv.LONGDASH]:"10.666,4",[Gv.LONGDASHDOT]:"10.666,4,1.333,4",[Gv.LONGDASHDOTDOT]:"10.666,4,1.333,4,1.333,4",[Gv.SHORTDOT]:"1.333,1.333",[Gv.SHORTDASH]:"5.333,1.333",[Gv.SHORTDASHDOT]:"5.333,1.333,1.333,1.333",[Gv.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},c={color:[0,0,0,0],width:0,style:a.none},d={solid:S=>({color:S.colour,opacity:S.opacity}),none:()=>"transparent",horizontal:(S,I)=>s.pattern(5,5,L=>L.line(0,5/2,5,5/2)).stroke(I),vertical:(S,I)=>s.pattern(5,5,L=>L.line(5/2,0,5/2,5)).stroke(I),"forward-diagonal":(S,I)=>s.pattern(5,5,L=>{L.line(0,0,5,5).stroke(I),L.line(0,0,5,5).move(0,5).stroke(I),L.line(0,0,5,5).move(5,0).stroke(I)}),"backward-diagonal":(S,I)=>s.pattern(5,5,L=>{L.line(5,0,0,5).stroke(I),L.line(5,0,0,5).move(5/2,5/2).stroke(I),L.line(5,0,0,5).move(-5/2,-5/2).stroke(I)}),cross:(S,I)=>s.pattern(5,5,L=>{L.line(5/2,0,5/2,5).stroke(I),L.line(0,5/2,5,5/2).stroke(I)}),"diagonal-cross":(S,I)=>s.pattern(7,7,L=>{L.line(0,0,7,7).stroke(I),L.line(7,0,0,7).stroke(I)})},p={"simple-marker"(){const S=v(e.color);e.outline=e.outline||c;const I=v(e.outline.color),O=y({color:I.colour,opacity:I.opacity,width:e.outline.width,dasharray:a[e.outline.style]}),L=o[e.style](e).fill({color:S.colour,opacity:S.opacity}).stroke(O).center(i.CONTAINER_CENTER,i.CONTAINER_CENTER).rotate(e.angle||0);i.fitInto(L,i.CONTENT_SIZE)},"simple-line"(){const S=v(e.color),I=y({color:S.colour,opacity:S.opacity,width:e.width,linecap:"butt",dasharray:a[e.style]}),O=i.CONTENT_PADDING,L=i.CONTAINER_SIZE-i.CONTENT_PADDING;s.line(O,O,L,L).stroke(I)},esriCLS(){this["simple-line"]()},"simple-fill"(){const S=v(e.color),I=y({color:S.colour,opacity:S.opacity}),O=d[e.style](S,I);e.outline=e.outline||c;const L=v(e.outline.color),N=y({color:L.colour,opacity:L.opacity,width:e.outline.width,linecap:"butt",dasharray:a[e.outline.style]});s.rect(i.CONTENT_SIZE,i.CONTENT_SIZE).center(i.CONTAINER_CENTER,i.CONTAINER_CENTER).fill(O).stroke(N)},text(){console.error("no support for feature service legend of text symbols")},"picture-fill"(){const S=e.imageData?`data:${e.contentType};base64,${e.imageData}`:e.url,I=e.width*e.xscale,O=e.height*e.yscale;e.outline=e.outline||c;const L=v(e.outline.color),N=y({color:L.colour,opacity:L.opacity,width:e.outline.width,dasharray:a[e.outline.style]});return i.$iApi.geo.shared.convertImagetoDataURL(S).then(V=>{const Y=s.pattern(I,O,X=>X.image(V,I,O));s.rect(i.CONTENT_SIZE,i.CONTENT_SIZE).center(i.CONTAINER_CENTER,i.CONTAINER_CENTER).fill(Y).stroke(N)})},"picture-marker"(){const S=e.source,I=S&&S.imageData?`data:${S.contentType};base64,${S.imageData}`:e.url;return i.$iApi.geo.shared.convertImagetoDataURL(I).then(L=>i.svgDrawImage(s,L)).then(({image:L})=>{L.center(i.CONTAINER_CENTER,i.CONTAINER_CENTER).rotate(e.angle||0),i.fitInto(L,i.CONTENT_IMAGE_SIZE)})}};try{return await Promise.resolve(p[e.type]()),window.document.body.removeChild(n),s.svg()}catch(S){return console.error(S),this.generateBlankSymbology()}function y(S){return Object.assign({},l,S)}function v(S){return S?{colour:`rgb(${S.r},${S.g},${S.b})`,opacity:S.a}:{colour:"rgb(0, 0, 0)",opacity:0}}}async svgDrawImage(e,i,r=0,n=0,s=!0){return new Promise((o,a)=>{const l=e.image(i,r,n,s).loaded(c=>o({image:l,loader:c})).error(c=>{a(c),console.error(c)})})}fitInto(e,i){const r=e.node.getBoundingClientRect(),n=i/Math.max(r.width,r.height);n<1&&e.scale(n)}rendererToLegend(e){let i;const r=e.symbolUnits.slice(0);if(e.defaultUnit&&r.push(e.defaultUnit),e.falseRenderer)i=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])}),i=[],n.forEach(s=>i.push(s))}return i.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 i={query:{f:"json"}},r={layers:[]},[n,s]=await pD(ir(`${e}/legend`,i));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,i){const r=e.layers.find(s=>s.layerId===i);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(PR(n),[],!0);throw new Error("attempted to make renderer from non-existing legend data")}mapServerLegendToRendererAll(e){const i=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",field:"fakefield",uniqueValueInfos:[].concat(...i)};return this.makeRenderer(PR(r),[],!0)}async mapServerToLocalLegend(e,i=void 0){const r=await this.getMapServerLegend(e);let n,s;return typeof i>"u"?(s=0,n=this.mapServerLegendToRendererAll(r)):(s=parseInt(i),n=this.mapServerLegendToRenderer(r,s)),this.rendererToLegend(n)}}class VTi extends Np{constructor(e){super(e)}async arcGisServerQueryIds(e){const i=new Ss;i.returnGeometry=!1,e.filterSql&&(i.where=e.filterSql),e.filterGeometry&&(i.geometry=this.queryGeometryHelper(e.filterGeometry,!1,this.$iApi.geo.map.getScale(),e.sourceSR),i.spatialRelationship="intersects");const r=await $ae(e.url,i);return Array.isArray(r)?r:[]}async geoJsonQuery(e){const i=new Ss;if(i.returnGeometry=!!e.includeGeometry,i.outFields=["*"],e.filterGeometry&&(i.geometry=this.queryGeometryHelper(e.filterGeometry,!0),i.spatialRelationship="intersects"),e.filterSql&&(i.where=e.filterSql),await e.layer.loadPromise(),!e.layer.esriLayer)throw new Error("file layer being queried contains no ESRI layer");return(await e.layer.esriLayer.queryFeatures(i)).features.map((n,s)=>{let o;return i.returnGeometry?o=this.$iApi.geo.geom.geomEsriToRamp(n.geometry,`queryResult${s}`):o=new SG,new Wx(o,"",n.attributes)})}queryGeometryHelper(e,i,r,n){let s;return!i&&e.type===Rl.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,i=5){const r=this.$iApi.geo.map,n=r.getExtent(),s=i*(n.xmax-n.xmin)/r.getPixelWidth();return new Lp("ze_buffer",[e.x-s,e.y-s],[e.x+s,e.y+s],e.sr)}}class UTi extends Np{attributes;geom;layer;map;proj;query;shared;symbology;constructor(e){super(e),this.geom=vN.geom,this.proj=vN.proj,this.shared=vN.sharedUtils,this.map=new CCi(e),this.layer=new STi(e),this.attributes=new DTi(e),this.query=new VTi(e),this.symbology=new GTi(e)}set proxy(e){na.request.proxyUrl=e}get proxy(){return na.request.proxyUrl||""}}const jTi=Object.assign({"../fixtures/appbar/index.ts":()=>Promise.resolve().then(()=>Pur),"../fixtures/areas-of-interest/index.ts":()=>Promise.resolve().then(()=>Xur),"../fixtures/basemap/index.ts":()=>Promise.resolve().then(()=>vcr),"../fixtures/crosshairs/index.ts":()=>Promise.resolve().then(()=>Scr),"../fixtures/details/index.ts":()=>Promise.resolve().then(()=>Tdr),"../fixtures/export-legend/index.ts":()=>Promise.resolve().then(()=>Fdr),"../fixtures/export-map/index.ts":()=>Promise.resolve().then(()=>kdr),"../fixtures/export-northarrow/index.ts":()=>Promise.resolve().then(()=>$dr),"../fixtures/export-scalebar/index.ts":()=>Promise.resolve().then(()=>Gdr),"../fixtures/export-title/index.ts":()=>Promise.resolve().then(()=>Udr),"../fixtures/export/index.ts":()=>Promise.resolve().then(()=>rpr),"../fixtures/gazebo/index.ts":()=>Promise.resolve().then(()=>Fpr),"../fixtures/geosearch/index.ts":()=>Promise.resolve().then(()=>Sfr),"../fixtures/grid/index.ts":()=>Promise.resolve().then(()=>Tgr),"../fixtures/help/index.ts":()=>Promise.resolve().then(()=>eyr),"../fixtures/hilight/index.ts":()=>Promise.resolve().then(()=>nyr),"../fixtures/layer-reorder/index.ts":()=>Promise.resolve().then(()=>m0r),"../fixtures/legend/index.ts":()=>Promise.resolve().then(()=>x0r),"../fixtures/mapnav/index.ts":()=>Promise.resolve().then(()=>B0r),"../fixtures/metadata/index.ts":()=>Promise.resolve().then(()=>tvr),"../fixtures/northarrow/index.ts":()=>Promise.resolve().then(()=>avr),"../fixtures/overviewmap/index.ts":()=>Promise.resolve().then(()=>vvr),"../fixtures/panguard/index.ts":()=>Promise.resolve().then(()=>Cvr),"../fixtures/scrollguard/index.ts":()=>Promise.resolve().then(()=>Rvr),"../fixtures/settings/index.ts":()=>Promise.resolve().then(()=>l_r),"../fixtures/snowman/index.ts":()=>Promise.resolve().then(()=>f_r),"../fixtures/wizard/index.ts":()=>Promise.resolve().then(()=>W1r)});class zTi extends Np{constructor(e){super(e);const i=()=>{const r=FP(this.$vApp.$pinia).items;Object.keys(r).forEach(n=>{r[n].initialized?.()})};this.$iApi.event.on(an.MAP_CREATED,i)}async add(e,i){let r;if(e in FP(this.$vApp.$pinia).items)return this.get(e);if(i){if(typeof i!="function")throw new Error("malformed fixture constructor");r=Cc.updateBaseToInstance(new i,e,this.$iApi)}else{const n=(await jTi[`../fixtures/${e}/index.ts`]()).default;r=new n(e,this.$iApi)}return FP(this.$vApp.$pinia).addFixture(r),this.$iApi.event.emit(an.FIXTURE_ADDED,r),this.$iApi.geo.map.created&&r.initialized?.(),r}remove(e){const i=this.get(e);if(!i)throw new Error(`Could not find fixture ${e} for removal`);return FP(this.$vApp.$pinia).removeFixture(i),this.$iApi.event.emit(an.FIXTURE_REMOVED,i),i}get(e){const i=[];typeof e=="string"?i.push(e):Array.isArray(e)?i.push(...e):i.push(e.id);const r=i.map(n=>{const s=FP(this.$vApp.$pinia).items[n];if(s)return s});return r.length===1?r[0]:r}isLoaded(e){const i=FP(this.$vApp.$pinia),r=Array.isArray(e)?e:[e];return r.forEach(n=>{i.loadPromises[n]===void 0&&i.addLoadPromise(n)}),Promise.all(i.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","scrollguard","panguard","settings","wizard"]);const i=dg(this.$vApp.$pinia);return i.startingFixtures=e,Promise.all(e.map(r=>this.add(r)))}}class Cc extends Np{static updateBaseToInstance(e,i,r){const n=new Cc(i,r);return Object.defineProperties(e,{id:{value:i},$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,i){super(i),this.id=e}remove(){return this.$iApi.fixture.remove(this),this}extend(e,i={}){const r=Zr({extends:e,iApi:this.$iApi,data(){return{...i}}}),n=xce(r),{vNode:s,destroy:o,el:a}=this.mount(r,{props:{...i.propsData},app:n});return a}mount(e,{props:i,children:r,element:n,app:s}={}){let o=n,a=X2(e,i,r);return s&&s._context&&(a.appContext=s._context),o?K2(a,o):K2(a,o=document.createElement("div")),{vNode:a,destroy:()=>{o&&K2(null,o),o=null,a=null},el:o}}get config(){return dg(this.$vApp.$pinia).config.fixtures[this.id]}getLayerFixtureConfig(e){return this.getLayerFixtureConfigs()[e]}getLayerFixtureConfigs(){const e=this.$iApi.getConfig(),i={},r=(n,s=void 0)=>{if(n.fixtures&&n.fixtures[this.id]!==void 0){let o=n.id;s!==void 0&&(o=`${s.id}-${n.index}`),i[o]=n.fixtures[this.id]}n.sublayers&&n.sublayers.forEach(o=>r(o,n))};return e.layers?.forEach(n=>r(n)),i}handlePanelWidths(e){if(this.config?.panelWidth){const i={};typeof this.config?.panelWidth=="number"&&(this.config.panelWidth={default:this.config?.panelWidth}),this.config.panelWidth.default&&e.forEach(r=>{i[r]=this.config.panelWidth.default});for(const r in this.config.panelWidth)r!="default"&&(i[r]=this.config.panelWidth[r]);for(const r in i){const n=this.$iApi.panel.get(r);this.$iApi.panel.setStyle(n,{"flex-basis":`${i[r]}px`})}}}}class HTi extends Np{panelStore=C_(this.$vApp.$pinia);register(e,i){const r=WTi(e)?{[e.id]:e.config}:e;if(i){const s=i.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 yN(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 i=Array.isArray(e)?e:[e];return i.forEach(r=>{this.panelStore.regPromises[r]===void 0&&this.panelStore.addRegPromise(r)}),Promise.all(this.panelStore.getRegPromises(i))}remove(e){const i=this.get(e);i.isOpen&&this.close(i),this.panelStore.removePanel(i)}get(e){const i=typeof e=="string"?e:e.id;return this.panelStore.items[i]}open(e){let i,r,n;if(typeof e=="string"||e instanceof yN?i=this.get(e):(i=this.get(e.id),{screen:r,props:n}=e),i.isOpen&&!i.isVisible)i.minimize();else if(i.isOpen)return i;return r||(i.route&&!n?{screen:r,props:n}=i.route:r=Object.keys(i.screens).pop()),this.show(i,{screen:r,props:n})?(this.panelStore.openPanel(i),this.$iApi.updateAlert(this.$iApi.$i18n.t("panels.alert.open",{name:i.alertName?this.$iApi.$i18n.t(i.alertName):i.id})),this.$iApi.event.emit(an.PANEL_OPENED,i)):console.error(`Failed to open ${i.id} panel.`),i}get opened(){return this.panelStore.orderedItems}get visible(){return this.panelStore.visible}close(e){const i=this.get(e);return i.isPinned&&i.pin(!1),this.panelStore.closePanel(i),this.$iApi.updateAlert(this.$iApi.$i18n.t("panels.alert.close",{name:i.alertName?this.$iApi.$i18n.t(i.alertName):i.id})),this.$iApi.event.emit(an.PANEL_CLOSED,i),i}minimize(e){const i=this.get(e);return i.isPinned&&i.pin(!1),this.panelStore.closePanel(i),this.$iApi.updateAlert(this.$iApi.$i18n.t("panels.alert.minimize",{name:i.alertName?this.$iApi.$i18n.t(i.alertName):i.id})),this.$iApi.event.emit(an.PANEL_MINIMIZED,i),i}move(e,i){const r=this.get(e);return this.panelStore.movePanel(r,i),r}toggle(e,i){let r;return typeof e=="string"||e instanceof yN?r=this.get(e):r=this.get(e.id),i=typeof i<"u"?i:!r.isVisible,i!==r.isVisible&&(i?this.open(e):this.close(r)),r}toggleMinimize(e,i){let r;return typeof e=="string"||e instanceof yN?r=this.get(e):r=this.get(e.id),i=typeof i<"u"?i:!r.isVisible,i!==r.isVisible&&(i?this.open(r):this.minimize(r)),r}pin(e,i){const r=this.get(e);return i=typeof i<"u"?i:!r.isPinned,!r.isPinned&&!i||(this.panelStore.pinned=i?r:null),r}get pinned(){return this.panelStore.pinned||null}show(e,i){const r=this.get(e);if(r.screens[i.screen]){if(r.screens[i.screen]?.props){const n=Object.keys(r.screens[i.screen]?.props).filter(o=>o!=="panel"),s=i.props?Object.keys(i.props):[];for(let o=0;o(Xc("data-v-a3c61802"),t=t(),Kc(),t))(()=>Mt("div",{class:"loader"},null,-1));function XTi(t,e){const i=Io("panel-screen");return Kt(),Pn(i,{header:!1,class:"screen-spinner"},{content:yn(()=>[YTi]),_:1})}const KTi=kl(qTi,[["render",XTi],["__scopeId","data-v-a3c61802"]]),JTi=Object.assign({"../fixtures/areas-of-interest/screen.vue":()=>Promise.resolve().then(()=>Hur),"../fixtures/basemap/screen.vue":()=>Promise.resolve().then(()=>pcr),"../fixtures/export/screen.vue":()=>Promise.resolve().then(()=>epr),"../fixtures/geosearch/screen.vue":()=>Promise.resolve().then(()=>yfr),"../fixtures/grid/screen.vue":()=>Promise.resolve().then(()=>xgr),"../fixtures/help/screen.vue":()=>Promise.resolve().then(()=>Xgr),"../fixtures/layer-reorder/screen.vue":()=>Promise.resolve().then(()=>h0r),"../fixtures/legend/screen.vue":()=>Promise.resolve().then(()=>_0r),"../fixtures/metadata/screen.vue":()=>Promise.resolve().then(()=>Z0r),"../fixtures/settings/screen.vue":()=>Promise.resolve().then(()=>s_r),"../fixtures/wizard/screen.vue":()=>Promise.resolve().then(()=>U1r)});class yN extends Np{id;screens;loadedScreens=[];alertName;controls;button;isScreenLoaded(e){return this.loadedScreens.indexOf(e)!==-1}registerScreen(e){const i=this.screens[e];let r;if(kfi(i)||Lfi(i))r=i,this.loadedScreens.push(e);else{let n;typeof i=="string"?n=JTi[`../fixtures/${i}`]():n=i();const s=new Promise((o,a)=>{n.then(l=>{this.loadedScreens.push(e),o(Nfi(l)?l.default:l)}),n.catch(l=>a(l))});r=jX({loader:()=>s,loadingComponent:KTi,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,i,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:i,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(){return this.$iApi.panel.visible.length>0?this.id===this.$iApi.panel.visible[0].id:!1}get isRightMostPanel(){return this.$iApi.panel.visible.length>0?this.id===this.$iApi.panel.visible.slice(-1)[0].id:!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!==null&&this.$iApi.panel.pinned.id===this.id}show(e){const i=typeof e=="string"?{screen:e}:e;return this.route=i,this.$iApi.panel.show(this,i),this}setStyles(e,i=!1){return this.$iApi.panel.setStyle(this,e,i),this}expand(e){return this.$iApi.panel.expand(this,e),this}}function ZTi(t){const e={};(Array.isArray(t)?t:[t]).forEach(o=>{o.language||(console.warn("RAMP2 config with no language supplied. Defaulting to English"),o.language="en");const a=QTi(o);e[o.language]=a});const r=Object.entries(e).map(o=>{const a=o[1].fixturesEnabled;return delete o[1].fixturesEnabled,a});let n=!1;const s=r.reduce((o,a)=>o.filter(l=>{const c=a.includes(l);return n=n||!c,c}));return n&&console.warn("Configs attempted to load different sets of fixtures. Only common fixtures will be loaded (all configs must load the same fixtures)."),s.push("crosshairs","scrollguard","panguard","wizard","layer-reorder","details"),{startingFixtures:s,configs:e}}function QTi(t){const e={version:"4.0",fixtures:{},layers:[],map:{},panels:{open:[]},system:{animate:!0},fixturesEnabled:[]};return tEi(t.services,e),eEi(t.map,e),iEi(t.ui,e),t.plugins&&rEi(t.plugins,e),e}function eEi(t,e){if(t.layers&&t.layers.forEach(i=>{e.layers.push(wdt(i))}),t.initialBasemapId&&(e.map.initialBasemapId=t.initialBasemapId),t.components){if(t.components.geoSearch&&(t.components.geoSearch.enabled&&e.fixturesEnabled.push("geosearch"),typeof t.components.geoSearch.showGraphic<"u"&&console.warn("showGraphic property provided in geoSearch map component cannot be mapped and will be skipped."),typeof t.components.geoSearch.showInfo<"u"&&console.warn("showInfo property provided in geoSearch map component cannot be mapped and will be skipped.")),t.components.overviewMap&&t.components.overviewMap.enabled&&(e.fixtures.overviewmap||(e.fixtures.overviewmap={basemaps:{}},e.fixturesEnabled.push("overviewmap")),e.fixtures.overviewmap.startMinimized=!t.components.overviewMap.initiallyExpanded,e.fixtures.overviewmap.expandFactor=t.components.overviewMap.expandFactor??1.5),t.components.northArrow&&t.components.northArrow.enabled){const i={};t.components.northArrow.arrowIcon&&(i.arrowIcon=t.components.northArrow.arrowIcon),t.components.northArrow.poleIcon&&(i.poleIcon=t.components.northArrow.poleIcon),i&&(e.fixtures.northarrow=i,e.fixturesEnabled.push("northarrow"))}if(t.components.scaleBar&&t.components.scaleBar.enabled){switch(e.map.caption={mapCoords:{disabled:!1},scaleBar:{disabled:!1,imperialScale:t?.components?.scaleBar?.scalebarUnit==="english"||t?.components?.scaleBar?.scalebarUnit==="dual"&&Math.floor(Math.random()*2)===0}},t.components?.mouseInfo?.spatialReference?.wkid){case 4326:e.map.caption.mapCoords.formatter="LAT_LONG_DMS";break;case 3978:e.map.caption.mapCoords.formatter="CANADA_ATLAS_LAMBERT";break;case 102100:e.map.caption.mapCoords.formatter="WEB_MERCATOR";break;default:e.map.caption.mapCoords.formatter="LAT_LONG_DMS";break}t.components.scaleBar.attachTo&&console.warn("attachTo property provided in scaleBar map component cannot be mapped and will be skipped.")}t.components.basemap&&t.components.basemap.enabled&&e.fixturesEnabled.push("basemap")}t.extentSets&&(e.map.extentSets=[],t.extentSets.forEach(i=>{const r={id:i.id,default:{xmin:i.default.xmin,xmax:i.default.xmax,ymin:i.default.ymin,ymax:i.default.ymax,spatialReference:i.spatialReference}};i.full&&(r.full={xmin:i.full.xmin,xmax:i.full.xmax,ymin:i.full.ymin,ymax:i.full.ymax,spatialReference:i.spatialReference}),i.maximum&&(r.maximum={xmin:i.maximum.xmin,xmax:i.maximum.xmax,ymin:i.maximum.ymin,ymax:i.maximum.ymax,spatialReference:i.spatialReference}),e.map.extentSets.push(r)})),t.lodSets&&(e.map.lodSets=t.lodSets),t.tileSchemas&&(e.map.tileSchemas=[],t.tileSchemas.forEach(i=>{const r={id:i.id,name:i.name,extentSetId:i.extentSetId,lodSetId:i.lodSetId,thumbnailTileUrls:[],hasNorthPole:i.hasNorthPole||!1};i.overviewUrl&&(e.fixtures.overviewmap||(e.fixtures.overviewmap={basemaps:{}},e.fixturesEnabled.push("overviewmap")),e.fixtures.overviewmap.basemaps[i.id]={id:i.overviewUrl.id||`overviewmap-basemap-${i.id}`,tileSchemaId:i.id,layers:[{id:i.overviewUrl.id||`overviewmap-basemap-${i.id}-0`,layerType:i.overviewUrl.layerType==="esriDynamic"?_n.MAPIMAGE:_n.TILE,url:i.overviewUrl.url,opacity:i.overviewUrl.opacity??1}]}),e.map.tileSchemas.push(r)})),t.baseMaps&&(e.map.basemaps=[],t.baseMaps.forEach(i=>{const r={id:i.id,tileSchemaId:i.tileSchemaId,name:i.name,description:i.description,altText:i.altText,thumbnailUrl:i.thumbnailUrl,layers:[]};i.attribution&&(r.attribution={text:{},logo:{}},i.attribution.text&&(r.attribution.text.disabled=!i.attribution.text.enabled,r.attribution.text.value=i.attribution.text.value),i.attribution.logo&&(r.attribution.logo.disabled=!i.attribution.logo.enabled,r.attribution.logo.altText=i.attribution.logo.altText,r.attribution.logo.value=i.attribution.logo.value,r.attribution.logo.link=i.attribution.logo.link)),i.layers.forEach((n,s)=>{const o={id:n.id||`${i.id}-${s}`,layerType:n.layerType==="esriDynamic"?_n.MAPIMAGE:_n.TILE,url:n.url,opacity:n.opacity??1};r.layers.push(o)}),e.map.basemaps.push(r)})),t.legend&&(e.fixturesEnabled.push("legend"),t.legend.type==="autopopulate"?(e.fixtures.legend={root:{name:"I'm root",children:[]}},e.layers&&e.layers.forEach(i=>{if(i.type==="esri-map-image"||i.type==="ogc-wms"){const r={name:i.name??`${i.id} Group`,children:[]};i.sublayers.forEach(n=>{const s={layerId:i.id};n.name&&(s.name=n.name),n.controls&&(s.controls=n.controls),n.disabledControls&&(s.disabledControls=n.disabledControls),i.type==="esri-map-image"?s.sublayerIndex=n.index:(s.sublayerId=n.id,console.warn(`sublayerId property defined in legend entry ${s.layerId} is currently not supported.`)),r.children.push(s)}),e.fixtures.legend.root.children.push(r)}else{const r={layerId:i.id};i.controls&&(r.controls=i.controls),i.disabledControls&&(r.disabledControls=i.disabledControls),e.fixtures.legend.root.children.push(r)}})):e.fixtures.legend={root:$3e(t.legend.root)})}function $3e(t){const e={name:t.name,children:[]};typeof t.hidden<"u"&&(e.hidden=t.hidden),typeof t.expanded<"u"&&(e.expanded=t.expanded);const i=["identify","opacity","reload","remove","settings","symbology","visibility"];return t.controls&&t.controls.length>0&&(e.controls=xV(t.controls,i),t.controls.includes("visibility")&&e.controls.push("visibilityButton"),(t.controls.length!==1||t.controls[0]!=="visibility")&&console.warn("Legend entry groups currently support only the visibility control. All other controls are currently not supported."),e.controls.push("expandButton")),t.disabledControls&&t.disabledControls.length>0&&(e.disabledControls=xV(t.disabledControls,i),t.disabledControls.includes("visibility")&&e.disabledControls.push("visibilityButton"),(t.disabledControls.length!==1||t.disabledControls[0]!=="visibility")&&console.warn("Legend entry groups currently support only the visibility control. All other controls are currently not supported.")),t.children.forEach(r=>{if(r.layerId)e.children.push(bdt(r));else if(r.infoType)r.infoType==="unboundLayer"?console.warn(`unboundLayer infoType in infoSection in children list of legend entry group ${e.name} cannot be mapped and will be skipped.`):(e.children.push({infoType:r.infoType,content:r.content}),typeof r.export<"u"&&console.warn(`export property in infoSection in children list of legend entry group ${e.name} cannot be mapped and will be skipped.`));else if(r.exclusiveVisibility){const n={name:"Visibility Set",children:[],exclusive:!0};typeof r.collapse<"u"&&console.warn(`collapse property in visibilitySet in children list of legend entry group ${e.name} cannot be mapped and will be skipped.`),r.exclusiveVisibility.forEach(s=>{s.layerId?n.children.push(bdt(s)):n.children.push($3e(s))}),e.children.push(n)}else e.children.push($3e(r))}),e}function bdt(t){const e=t,i=["boundaryZoom","datatable","identify","metadata","opacity","refresh","reload","remove","settings","symbology","visibility"];return t.controls&&t.controls.length>0&&(e.layerControls=xV(t.controls,i)),t.disabledControls&&t.disabledControls.length>0&&(e.disabledLayerControls=xV(t.disabledControls,i)),t.controlledIds&&(console.warn(`controlledIds property defined in legend entry ${t.layerId} cannot be mapped and will be skipped.`),delete e.controlledIds),t.entryIndex&&(e.sublayerIndex=t.entryIndex,delete t.entryIndex),t.entryId&&console.warn(`entryId property defined in legend entry ${t.layerId} cannot be mapped and will be skipped.`),e}function wdt(t){const e=B3e(t);switch(e.id=t.id,e.url=t.url,t.refreshInterval&&(e.refreshInterval=t.refreshInterval,console.warn("Property refreshInterval in layer is currently not supported.")),t.expectedResponseTime&&(e.expectedLoadTime=t.expectedResponseTime),t.metadataUrl&&(e.metadata={url:t.metadataUrl}),t.catalogueUrl&&(e.catalogueUrl=t.catalogueUrl),typeof t.enableStructuredDelete<"u"&&console.warn(`enableStructuredDelete property provided in layer ${t.id} cannot be mapped and will be skipped.`),t.tooltipField&&(e.tooltipField=t.tooltipField),t.tolerance&&(e.mouseTolerance=t.tolerance,t.layerType==="esriDynamic"&&(e.touchTolerance=t.tolerance+10)),t.customRenderer&&(e.customRenderer=t.customRenderer),t.layerType){case"esriDynamic":e.layerType="esri-map-image",typeof t.singleEntryCollapse<"u"&&(t.singleEntryCollapse=t.singleEntryCollapse),t.imageFormat&&(e.imageFormat=t.imageFormat),t.layerEntries&&(e.sublayers=[],t.layerEntries.forEach(i=>{const r=B3e(i);r.index=i.index,e.sublayers.push(r)}));break;case"esriFeature":e.layerType="esri-feature",t.fileType&&(e.layerType=t.fileType==="shapefile"?"file-shape":`file-${t.fileType}`,t.colour&&(e.colour=t.colour),t.latField&&(e.latField=t.latField),t.longField&&(e.longField=t.longField));break;case"ogcWfs":e.layerType="ogc-wfs",t.colour&&(e.colour=t.colour),typeof t.xyInAttribs<"u"&&(e.xyInAttribs=t.xyInAttribs);break;case"ogcWms":e.layerType="ogc-wms",t.suppressGetCapabilities&&console.warn(`suppressGetCapabilities property provided in layer ${t.id} cannot be mapped and will be skipped.`),t.featureInfoMimeType&&(t.featureInfoMimeType==="text/html;fgpv=summary"?e.featureInfoMimeType="text/html":e.featureInfoMimeType=t.featureInfoMimeType),t.legendMimeType&&console.warn(`legendMimeType property provided in layer ${t.id} cannot be mapped and will be skipped.`),t.layerEntries&&(e.sublayers=[],t.layerEntries.forEach(i=>{const r=B3e(i);r.id=i.id,i.currentStyle&&(r.currentStyle=i.currentStyle,console.warn(`currentStyle property provided in layer entry ${i.id} of layer ${t.id} is currently not supported.`)),i.allStyles&&console.warn(`allStyles property provided in layer entry ${i.id} of layer ${t.id} cannot be mapped and will be skipped.`),e.sublayers.push(r)}));break;case"esriImage":e.layerType="esri-imagery";break;case"esriTile":e.layerType="esri-tile";break;default:console.warn(`Unhandled layer type in ramp 2 config ${t.layerType}`)}return t.details&&console.warn(`Details config provided in layer ${t.id} cannot be mapped and will be skipped.`),e}function B3e(t){const e={};t.name&&(e.name=t.name),t.nameField&&(e.nameField=t.nameField),t.extent&&(e.extent=t.extent);const i=["boundaryZoom","datatable","identify","metadata","opacity","refresh","reload","remove","settings","symbology","visibility"];return t.controls&&t.controls.length>0&&(e.controls=xV(t.controls,i)),t.disabledControls&&t.disabledControls.length>0&&(e.disabledControls=xV(t.disabledControls,i)),t.state&&(e.state={opacity:t.state.opacity??1,visibility:t.state.visibility??!0,identify:t.state.query??!0,hovertips:t.state.hovertips??!0},typeof t.state.snapshot<"u"&&console.warn(`snapshot property provided in initialLayer settings in layer ${t.id} cannot be mapped and will be skipped.`),typeof t.state.boundingBox<"u"&&console.warn(`boundingBox property provided in initialLayer settings in layer ${t.id} cannot be mapped and will be skipped.`)),typeof t.stateOnly<"u"&&(e.cosmetic=t.stateOnly),t.initialFilteredQuery&&(e.initialFilteredQuery=t.initialFilteredQuery),nEi(t,e),(typeof t.toggleSymbology<"u"||t.table)&&(e.fixtures={},typeof t.toggleSymbology<"u"&&(e.fixtures.legend={toggleSymbology:t.toggleSymbology}),t.table&&(e.fixtures.grid={},t.table.title&&(e.fixtures.grid.title=t.table.title),t.table.description&&console.warn(`description property provided in table property in layer ${t.id} cannot be mapped and will be skipped.`),typeof t.table.maximize<"u"&&console.warn(`maximize property provided in table property in layer ${t.id} cannot be mapped and will be skipped.`),t.table.search&&(t.table.search.enabled&&(e.fixtures.grid.search=t.table.search.enabled),t.table.search.value&&(e.fixtures.grid.searchFilter=t.table.search.value)),typeof t.table.lazyFilter<"u"&&console.warn(`lazyFilter property provided in table property in layer ${t.id} cannot be mapped and will be skipped.`),typeof t.table.applyMap<"u"&&(e.fixtures.grid.applyMap=t.table.applyMap),typeof t.table.showFilter<"u"&&(e.fixtures.grid.showFilter=t.table.showFilter),typeof t.table.filterByExtent<"u"&&(e.fixtures.grid.filterByExtent=t.table.filterByExtent),typeof t.table.searchStrictMatch<"u"&&console.warn(`searchStrictMatch property provided in table property in layer ${t.id} cannot be mapped and will be skipped.`),typeof t.table.printEnabled<"u"&&console.warn(`printEnabled property provided in table property in layer ${t.id} cannot be mapped and will be skipped.`),t.table.columns&&(e.fixtures.grid.columns=[],t.table.columns.forEach(r=>{const n={name:r.data};r.title&&(n.title=r.title),r.description&&console.warn(`description property provided in column property in table property in layer ${t.id} cannot be mapped and will be skipped.`),typeof r.visible<"u"&&(n.visible=r.visible),r.width&&(n.width=r.width),r.sort&&(n.sort=r.sort),typeof r.searchable<"u"&&(n.searchable=r.searchable),r.filter&&(n.filter=r.filter),e.fixtures.grid.columns.push(n)})))),e}function xV(t,e){const i=[];return t.forEach(r=>{e.includes("identify")&&r==="query"?i.push("identify"):e.includes(r)?i.push(r):console.warn(`Ignored invalid control: ${r}`)}),i}function tEi(t,e){if(!t)return;t.search&&(e.fixtures.geosearch={},e.fixtures.geosearch.serviceUrls={geoNames:t.search.serviceUrls.geoNames,geoLocation:t.search.serviceUrls.geoLocation,geoProvince:t.search.serviceUrls.provinces,geoTypes:t.search.serviceUrls.types},t.search.serviceUrls.geoSuggest&&console.warn("geoSuggest property provided in serviceUrls of search service cannot be mapped and will be skipped."),t.search.settings&&(e.fixtures.geosearch.settings=t.search.settings),t.search.disabledSearches&&(e.fixtures.geosearch.settings.disabledSearchTypes=t.search.disabledSearches.filter(r=>r!=="SCALE"))),t.export&&(e.fixtures.export||(e.fixtures.export={},e.fixturesEnabled.push("export")),t.export.title&&(e.fixtures.export.title={selected:t.export.title.isSelected??!0,selectable:t.export.title.isSelectable??!0,value:t.export.title.value??"RAMP-Map / PCAR-Carte"}),t.export.map&&(e.fixtures.export.map={selected:t.export.map.isSelected??!0,selectable:t.export.map.isSelectable??!0},t.export.map.value&&console.warn("value property provided in map export component cannot be mapped and will be skipped.")),t.export.mapElements&&(e.fixtures.export.mapElements={selected:t.export.mapElements.isSelected??!0,selectable:t.export.mapElements.isSelectable??!0},t.export.mapElements.value&&console.warn("value property provided in mapElements export component cannot be mapped and will be skipped.")),t.export.legend&&(e.fixtures.export.legend={selected:t.export.legend.isSelected??!0,selectable:t.export.legend.isSelectable??!0},t.export.legend.columnWidth&&(e.fixtures.export.legend.columnWidth=t.export.legend.columnWidth),t.export.legend.value&&console.warn("value property provided in legend export component cannot be mapped and will be skipped."),typeof t.export.legend.showInfoSymbology<"u"&&console.warn("showInfoSymbology property provided in legend export component cannot be mapped and will be skipped."),typeof t.export.legend.showControlledSymbology<"u"&&console.warn("showControlledSymbology property provided in legend export component cannot be mapped and will be skipped.")),t.export.footnote&&(e.fixtures.export.footnote={selected:t.export.footnote.isSelected??!0,selectable:t.export.footnote.isSelectable??!0,value:t.export.footnote.value??""}),t.export.timestamp&&(e.fixtures.export.timestamp={selected:t.export.timestamp.isSelected??!0,selectable:t.export.timestamp.isSelectable??!0},t.export.timestamp.value&&console.warn("value property provided in timestamp export component cannot be mapped and will be skipped.")),t.export.timeout&&console.warn("timeout property provided in export property of services config cannot be mapped and will be skipped."),typeof t.cleanCanvas<"u"&&console.warn("cleanCanvas property provided in export property of services config cannot be mapped and will be skipped.")),t.proxyUrl&&(e.system.proxyUrl=t.proxyUrl),["corsEverywhere","exportMapUrl","geometryUrl","googleAPIKey","esriLibUrl","geolocation","coordInfo","print"].forEach(r=>{typeof t[r]<"u"&&console.warn(`${r} property provided in services config cannot be mapped and will be skipped.`)})}function iEi(t,e){if(t.navBar){e.fixtures.mapnav={zoomOption:t.navBar.zoom||"buttons",items:[]};const n=["geolocator","zoom","home","basemap","help","fullscreen","geosearch","legend"];t.navBar.extra.forEach(s=>{const o=s.toLowerCase();n.includes(o)?e.fixtures.mapnav.items.push(o):console.warn(`Ignored invalid mapnav item: ${s}`)}),e.fixturesEnabled.push("mapnav")}if(t.help&&(e.fixtures.help={location:t.help.folderName&&t.help.folderName!=="default"?`./${t.help.folderName}`:"./help",panelWidth:350},e.fixturesEnabled.push("help")),t.legend){const n=["groupToggle","visibilityToggle"];t.legend.reorderable&&n.push("layerReorder"),t.legend.allowImport&&n.push("wizard"),e.fixtures.legend?e.fixtures.legend.headerControls=n:(e.fixturesEnabled.push("legend"),e.fixtures.legend={headerControls:n,root:{}}),t.legend.isOpen&&t.legend.isOpen.large&&e.panels.open.push({id:"legend"})}e.fixtures.appbar={items:[]},e.fixturesEnabled.push("appbar");const i=["layers","basemap","export","help","geoSearch"];t.appBar?(t.appBar.layers!==!1&&(e.fixtures.appbar.items.push("legend"),e.fixturesEnabled.includes("legend")||e.fixturesEnabled.push("legend")),t.appBar.geoSearch!==!1&&e.fixturesEnabled.includes("geosearch")&&e.fixtures.appbar.items.push("geosearch"),t.appBar.basemap!==!1&&e.fixtures.appbar.items.push("basemap")):(e.fixtures.appbar.items.push("legend"),e.fixturesEnabled.includes("legend")||e.fixturesEnabled.push("legend"),e.fixtures.appbar.items.push("geosearch"),e.fixtures.appbar.items.push("basemap")),t.sideMenu&&t.sideMenu.items&&t.sideMenu.items.length>0&&t.sideMenu.items.forEach(n=>{n.forEach(s=>{s==="layers"&&!e.fixtures.appbar.items.includes("legend")?(e.fixtures.appbar.items.push("legend"),e.fixturesEnabled.includes("legend")||e.fixturesEnabled.push("legend")):s!=="layers"&&i.includes(s)&&!e.fixtures.appbar.items.includes(s.toLowerCase())&&(e.fixtures.appbar.items.push(s.toLowerCase()),(s.toLowerCase()==="help"||s.toLowerCase()==="export"&&!e.fixturesEnabled.includes(s.toLowerCase()))&&e.fixturesEnabled.push(s.toLowerCase()))})}),t.tableIsOpen&&t.tableIsOpen.large,["fullscreen","theme","logoUrl","failureFeedback","title","restrictNavigation","about"].forEach(n=>{typeof t[n]<"u"&&console.warn(`${n} property provided in services config cannot be mapped and will be skipped.`)})}function rEi(t,e){t.areasOfInterest&&(e.fixturesEnabled.includes("areas-of-interest")||e.fixturesEnabled.push("areas-of-interest"),e.fixtures["areas-of-interest"]={areas:t.areasOfInterest.areas.map(i=>({title:`${i["title-en-CA"]} / ${i["title-fr-CA"]}`,thumbnail:i.thumbnailUrl,altText:i.altText??"",description:i.description??"",extent:{xmin:i.xmin,xmax:i.xmax,ymin:i.ymin,ymax:i.ymax,spatialReference:{wkid:i.wkid}}}))})}function nEi(t,e){const i=t.outfields&&t.outfields!=="*";if(!i&&!t.fieldMetadata)return;const r={fieldInfo:[],exclusiveFields:!1};t.fieldMetadata?(r.fieldInfo=t.fieldMetadata.map(n=>{const s={name:n.data};return n.alias&&(s.alias=n.alias),s}),i&&(t.outfields.split(",").map(s=>s.trim()).forEach(s=>{r.fieldInfo.findIndex(o=>o.name===s)===-1&&r.fieldInfo.push({name:s})}),r.exclusiveFields=!0)):i&&(r.fieldInfo=t.outfields.split(",").map(n=>({name:n.trim()})),r.exclusiveFields=!0),e.fieldMetadata=r}console.log(`RAMP v4.1.0 [${"fc325fe9a09eae1b642a38d6a206b2ed8b9f5afb".slice(0,9)}] (Built on ${new Date("Thu Apr 27 10:38:03 2023 -0400".toString()).toLocaleString()})`);const SV={major:"4",minor:"1",patch:"0",timestamp:"Thu Apr 27 10:38:03 2023 -0400",hash:"fc325fe9a09eae1b642a38d6a206b2ed8b9f5afb"};function sEi(t){return ZTi(t)}function oEi(t){return wdt(t)}const aEi=(t,e,i)=>new _Ci(t,e,i),vN=new Ffi;let G3e;function lEi(t,e){let i=e.responseType;i?i!=="array-buffer"&&i!=="blob"&&i!=="json"&&i!=="native"&&i!=="native-request-init"&&i!=="text"&&(i="text"):i="json",e.responseType=i;const r=e.signal;return delete e.signal,globalThis.invokeStaticMessage("request",{url:t,options:e},{signal:r}).then(async n=>{let s,o,a,l,c;if(n.data)if(n.data instanceof ArrayBuffer){if(!(i!=="json"&&i!=="text"&&i!=="blob"||(s=new Blob([n.data]),i!=="json"&&i!=="text"||(G3e||(G3e=new FileReaderSync),l=G3e.readAsText(s),i!=="json")))){try{o=JSON.parse(l||null)}catch(d){const p={...d,url:t,requestOptions:e};throw new st("request:server",d.message,p)}if(o.error){const d={...o.error,url:t,requestOptions:e};throw new st("request:server",o.error.message,d)}}}else i==="native"&&(n.data.signal=r,a=await fetch(n.data.url,n.data),n.httpStatus=a.status);switch(i){case"blob":c=s;break;case"json":c=o;break;case"native":c=a;break;case"text":c=l;break;default:c=n.data}return{data:c,httpStatus:n.httpStatus,requestOptions:e,ssl:n.ssl,url:t}})}const uEi=Object.freeze(Object.defineProperty({__proto__:null,execute:lEi},Symbol.toStringTag,{value:"Module"})),Rhe="esri-identity-form",ab={base:Rhe,group:`${Rhe}__group`,label:`${Rhe}__label`,footer:`${Rhe}__footer`,esriInput:"esri-input",esriButton:"esri-button",esriButtonSecondary:"esri-button--secondary"},cEi="ArcGIS Online";let kP=class extends Gf{constructor(e,i){super(e,i),this._usernameInputNode=null,this._passwordInputNode=null,this.signingIn=!1,this.server=null,this.resource=null,this.error=null,this.oAuthPrompt=!1}render(){const{error:e,server:i,resource:r,signingIn:n,oAuthPrompt:s,messages:o}=this,a=ki("div",{class:ab.group},m2(s?o.oAuthInfo:o.info,{server:i&&/\.arcgis\.com/i.test(i)?cEi:i,resource:`(${r||o.lblItem})`})),l=s?null:ki("div",{class:ab.group,key:"username"},ki("label",{class:ab.label},o.lblUser,ki("input",{value:"",required:!0,autocomplete:"off",spellcheck:!1,type:"text",bind:this,afterCreate:VB,"data-node-ref":"_usernameInputNode",class:ab.esriInput}))),c=s?null:ki("div",{class:ab.group,key:"password"},ki("label",{class:ab.label},o.lblPwd,ki("input",{value:"",required:!0,type:"password",bind:this,afterCreate:VB,"data-node-ref":"_passwordInputNode",class:ab.esriInput}))),d=ki("div",{class:this.classes(ab.group,ab.footer)},ki("input",{type:"submit",disabled:!!n,value:n?o.lblSigning:o.lblOk,class:ab.esriButton}),ki("input",{type:"button",value:o.lblCancel,bind:this,onclick:this._cancel,class:this.classes(ab.esriButton,ab.esriButtonSecondary)})),p=e?ki("div",null,e.details&&e.details.httpStatus?o.invalidUser:o.noAuthService):null;return ki("form",{class:ab.base,bind:this,onsubmit:this._submit},a,p,l,c,d)}_cancel(){this._set("signingIn",!1),this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(e){e.preventDefault(),this._set("signingIn",!0);const i=this.oAuthPrompt?{}:{username:this._usernameInputNode&&this._usernameInputNode.value,password:this._passwordInputNode&&this._passwordInputNode.value};this.emit("submit",i)}};E([k(),Vf("esri/identity/t9n/identity")],kP.prototype,"messages",void 0),E([k()],kP.prototype,"signingIn",void 0),E([k()],kP.prototype,"server",void 0),E([k()],kP.prototype,"resource",void 0),E([k()],kP.prototype,"error",void 0),E([k()],kP.prototype,"oAuthPrompt",void 0),kP=E([ht("esri.identity.IdentityForm")],kP);const hEi=kP;/*! -* tabbable 6.1.1 +*/(function(t,e){(function(i,r){t.exports=i.document?r(i,i.document):function(n){return r(n,n.document)}})(typeof window<"u"?window:Jh,function(i,r){var n=typeof this<"u"?this:i,s=n.SVG=function(J){if(s.supported)return J=new s.Doc(J),s.parser.draw||s.prepare(),J};if(s.ns="http://www.w3.org/2000/svg",s.xmlns="http://www.w3.org/2000/xmlns/",s.xlink="http://www.w3.org/1999/xlink",s.svgjs="http://svgjs.com/svgjs",s.supported=function(){return!!r.createElementNS&&!!r.createElementNS(s.ns,"svg").createSVGRect}(),!s.supported)return!1;s.did=1e3,s.eid=function(J){return"Svgjs"+P(J)+s.did++},s.create=function(J){var de=r.createElementNS(this.ns,J);return de.setAttribute("id",this.eid(J)),de},s.extend=function(){var J,de,Se,Ie;for(J=[].slice.call(arguments),de=J.pop(),Ie=J.length-1;Ie>=0;Ie--)if(J[Ie])for(Se in de)J[Ie].prototype[Se]=de[Se];s.Set&&s.Set.inherit&&s.Set.inherit()},s.invent=function(J){var de=typeof J.create=="function"?J.create:function(){this.constructor.call(this,s.create(J.create))};return J.inherit&&(de.prototype=new J.inherit),J.extend&&s.extend(de,J.extend),J.construct&&s.extend(J.parent||s.Container,J.construct),de},s.adopt=function(J){if(!J)return null;if(J.instance)return J.instance;var de;return J.nodeName=="svg"?de=J.parentNode instanceof i.SVGElement?new s.Nested:new s.Doc:J.nodeName=="linearGradient"?de=new s.Gradient("linear"):J.nodeName=="radialGradient"?de=new s.Gradient("radial"):s[P(J.nodeName)]?de=new s[P(J.nodeName)]:de=new s.Element(J),de.type=J.nodeName,de.node=J,J.instance=de,de instanceof s.Doc&&de.namespace().defs(),de.setData(JSON.parse(J.getAttribute("svgjs:data"))||{}),de},s.prepare=function(){var J=r.getElementsByTagName("body")[0],de=(J?new s.Doc(J):s.adopt(r.documentElement).nested()).size(2,0);s.parser={body:J||r.documentElement,draw:de.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").attr("focusable","false").node,poly:de.polyline().node,path:de.path().node,native:s.create("svg")}},s.parser={native:s.create("svg")},r.addEventListener("DOMContentLoaded",function(){s.parser.draw||s.prepare()},!1),s.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},s.utils={map:function(J,de){var Se,Ie=J.length,Re=[];for(Se=0;Se1?1:J,new s.Color({r:~~(this.r+(this.destination.r-this.r)*J),g:~~(this.g+(this.destination.g-this.g)*J),b:~~(this.b+(this.destination.b-this.b)*J)})):this}}),s.Color.test=function(J){return J+="",s.regex.isHex.test(J)||s.regex.isRgb.test(J)},s.Color.isRgb=function(J){return J&&typeof J.r=="number"&&typeof J.g=="number"&&typeof J.b=="number"},s.Color.isColor=function(J){return s.Color.isRgb(J)||s.Color.test(J)},s.Array=function(J,de){J=(J||[]).valueOf(),J.length==0&&de&&(J=de.valueOf()),this.value=this.parse(J)},s.extend(s.Array,{morph:function(J){if(this.destination=this.parse(J),this.value.length!=this.destination.length){for(var de=this.value[this.value.length-1],Se=this.destination[this.destination.length-1];this.value.length>this.destination.length;)this.destination.push(Se);for(;this.value.length=0;Ie--)this.value[Ie]=[this.value[Ie][0]+J,this.value[Ie][1]+de];return this},size:function(J,de){var Se,Ie=this.bbox();for(Se=this.value.length-1;Se>=0;Se--)Ie.width&&(this.value[Se][0]=(this.value[Se][0]-Ie.x)*J/Ie.width+Ie.x),Ie.height&&(this.value[Se][1]=(this.value[Se][1]-Ie.y)*de/Ie.height+Ie.y);return this},bbox:function(){return s.parser.poly.setAttribute("points",this.toString()),s.parser.poly.getBBox()}});for(var o={M:function(J,de,Se){return de.x=Se.x=J[0],de.y=Se.y=J[1],["M",de.x,de.y]},L:function(J,de){return de.x=J[0],de.y=J[1],["L",J[0],J[1]]},H:function(J,de){return de.x=J[0],["H",J[0]]},V:function(J,de){return de.y=J[0],["V",J[0]]},C:function(J,de){return de.x=J[4],de.y=J[5],["C",J[0],J[1],J[2],J[3],J[4],J[5]]},S:function(J,de){return de.x=J[2],de.y=J[3],["S",J[0],J[1],J[2],J[3]]},Q:function(J,de){return de.x=J[2],de.y=J[3],["Q",J[0],J[1],J[2],J[3]]},T:function(J,de){return de.x=J[0],de.y=J[1],["T",J[0],J[1]]},Z:function(J,de,Se){return de.x=Se.x,de.y=Se.y,["Z"]},A:function(J,de){return de.x=J[5],de.y=J[6],["A",J[0],J[1],J[2],J[3],J[4],J[5],J[6]]}},a="mlhvqtcsaz".split(""),l=0,c=a.length;l=0;Re--)Ie=this.value[Re][0],Ie=="M"||Ie=="L"||Ie=="T"?(this.value[Re][1]+=J,this.value[Re][2]+=de):Ie=="H"?this.value[Re][1]+=J:Ie=="V"?this.value[Re][1]+=de:Ie=="C"||Ie=="S"||Ie=="Q"?(this.value[Re][1]+=J,this.value[Re][2]+=de,this.value[Re][3]+=J,this.value[Re][4]+=de,Ie=="C"&&(this.value[Re][5]+=J,this.value[Re][6]+=de)):Ie=="A"&&(this.value[Re][6]+=J,this.value[Re][7]+=de);return this},size:function(J,de){var Se,Ie,Re=this.bbox();for(Se=this.value.length-1;Se>=0;Se--)Ie=this.value[Se][0],Ie=="M"||Ie=="L"||Ie=="T"?(this.value[Se][1]=(this.value[Se][1]-Re.x)*J/Re.width+Re.x,this.value[Se][2]=(this.value[Se][2]-Re.y)*de/Re.height+Re.y):Ie=="H"?this.value[Se][1]=(this.value[Se][1]-Re.x)*J/Re.width+Re.x:Ie=="V"?this.value[Se][1]=(this.value[Se][1]-Re.y)*de/Re.height+Re.y:Ie=="C"||Ie=="S"||Ie=="Q"?(this.value[Se][1]=(this.value[Se][1]-Re.x)*J/Re.width+Re.x,this.value[Se][2]=(this.value[Se][2]-Re.y)*de/Re.height+Re.y,this.value[Se][3]=(this.value[Se][3]-Re.x)*J/Re.width+Re.x,this.value[Se][4]=(this.value[Se][4]-Re.y)*de/Re.height+Re.y,Ie=="C"&&(this.value[Se][5]=(this.value[Se][5]-Re.x)*J/Re.width+Re.x,this.value[Se][6]=(this.value[Se][6]-Re.y)*de/Re.height+Re.y)):Ie=="A"&&(this.value[Se][1]=this.value[Se][1]*J/Re.width,this.value[Se][2]=this.value[Se][2]*de/Re.height,this.value[Se][6]=(this.value[Se][6]-Re.x)*J/Re.width+Re.x,this.value[Se][7]=(this.value[Se][7]-Re.y)*de/Re.height+Re.y);return this},equalCommands:function(J){var de,Se,Ie;for(J=new s.PathArray(J),Ie=this.value.length===J.value.length,de=0,Se=this.value.length;Ie&&deGe);return Ie},bbox:function(){return s.parser.path.setAttribute("d",this.toString()),s.parser.path.getBBox()}}),s.Number=s.invent({create:function(J,de){this.value=0,this.unit=de||"",typeof J=="number"?this.value=isNaN(J)?0:isFinite(J)?J:J<0?-34e37:34e37:typeof J=="string"?(de=J.match(s.regex.numberAndUnit),de&&(this.value=parseFloat(de[1]),de[5]=="%"?this.value/=100:de[5]=="s"&&(this.value*=1e3),this.unit=de[5])):J instanceof s.Number&&(this.value=J.valueOf(),this.unit=J.unit)},extend:{toString:function(){return(this.unit=="%"?~~(this.value*1e8)/1e6:this.unit=="s"?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(J){return J=new s.Number(J),new s.Number(this+J,this.unit||J.unit)},minus:function(J){return J=new s.Number(J),new s.Number(this-J,this.unit||J.unit)},times:function(J){return J=new s.Number(J),new s.Number(this*J,this.unit||J.unit)},divide:function(J){return J=new s.Number(J),new s.Number(this/J,this.unit||J.unit)},to:function(J){var de=new s.Number(this);return typeof J=="string"&&(de.unit=J),de},morph:function(J){return this.destination=new s.Number(J),J.relative&&(this.destination.value+=this.value),this},at:function(J){return this.destination?new s.Number(this.destination).minus(this).times(J).plus(this):this}}}),s.Element=s.invent({create:function(J){this._stroke=s.defaults.attrs.stroke,this._event=null,this._events={},this.dom={},(this.node=J)&&(this.type=J.nodeName,this.node.instance=this,this._events=J._events||{},this._stroke=J.getAttribute("stroke")||this._stroke)},extend:{x:function(J){return this.attr("x",J)},y:function(J){return this.attr("y",J)},cx:function(J){return J==null?this.x()+this.width()/2:this.x(J-this.width()/2)},cy:function(J){return J==null?this.y()+this.height()/2:this.y(J-this.height()/2)},move:function(J,de){return this.x(J).y(de)},center:function(J,de){return this.cx(J).cy(de)},width:function(J){return this.attr("width",J)},height:function(J){return this.attr("height",J)},size:function(J,de){var Se=j(this,J,de);return this.width(new s.Number(Se.width)).height(new s.Number(Se.height))},clone:function(J){this.writeDataToDom();var de=ce(this.node.cloneNode(!0));return J?J.add(de):this.after(de),de},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(J){return this.after(J).remove(),J},addTo:function(J){return J.put(this)},putIn:function(J){return J.add(this)},id:function(J){return this.attr("id",J)},inside:function(J,de){var Se=this.bbox();return J>Se.x&&de>Se.y&&J/g,"<$1$2>")+"";for(var Se=0,Ie=de.firstChild.childNodes.length;Se/,"").replace(/<\/svg>$/,"");return this},writeDataToDom:function(){if(this.each||this.lines){var J=this.each?this:this.lines();J.each(function(){this.writeDataToDom()})}return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(J){return this.dom=J,this},is:function(J){return v(this,J)}}}),s.easing={"-":function(J){return J},"<>":function(J){return-Math.cos(J*Math.PI)/2+.5},">":function(J){return Math.sin(J*Math.PI/2)},"<":function(J){return-Math.cos(J*Math.PI/2)+1}},s.morph=function(J){return function(de,Se){return new s.MorphObj(de,Se).at(J)}},s.Situation=s.invent({create:function(J){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new s.Number(J.duration).valueOf(),this.delay=new s.Number(J.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=J.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),s.FX=s.invent({create:function(J){this._target=J,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(J,de,Se){typeof J=="object"&&(de=J.ease,Se=J.delay,J=J.duration);var Ie=new s.Situation({duration:J||1e3,delay:Se||0,ease:s.easing[de||"-"]||de});return this.queue(Ie),this},delay:function(J){var de=new s.Situation({duration:J,delay:0,ease:s.easing["-"]});return this.queue(de)},target:function(J){return J&&J instanceof s.Element?(this._target=J,this):this._target},timeToAbsPos:function(J){return(J-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(J){return this.situation.duration/this._speed*J+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=i.requestAnimationFrame(function(){this.step()}.bind(this))},stopAnimFrame:function(){i.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(J){return(typeof J=="function"||J instanceof s.Situation)&&this.situations.push(J),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof s.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var J,de,Se,Ie=this.situation;if(Ie.init)return this;for(J in Ie.animations)for(Se=this.target()[J](),Array.isArray(Se)||(Se=[Se]),Array.isArray(Ie.animations[J])||(Ie.animations[J]=[Ie.animations[J]]),de=Se.length;de--;)Ie.animations[J][de]instanceof s.Number&&(Se[de]=new s.Number(Se[de])),Ie.animations[J][de]=Se[de].morph(Ie.animations[J][de]);for(J in Ie.attrs)Ie.attrs[J]=new s.MorphObj(this.target().attr(J),Ie.attrs[J]);for(J in Ie.styles)Ie.styles[J]=new s.MorphObj(this.target().style(J),Ie.styles[J]);return Ie.initialTransformation=this.target().matrixify(),Ie.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(J,de){var Se=this.active;return this.active=!1,de&&this.clearQueue(),J&&this.situation&&(!Se&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},reset:function(){if(this.situation){var J=this.situation;this.stop(),this.situation=J,this.atStart()}return this},finish:function(){for(this.stop(!0,!1);this.dequeue().situation&&this.stop(!0,!1););return this.clearQueue().clearCurrent(),this},atStart:function(){return this.at(0,!0)},atEnd:function(){return this.situation.loops===!0&&(this.situation.loops=this.situation.loop+1),typeof this.situation.loops=="number"?this.at(this.situation.loops,!0):this.at(1,!0)},at:function(J,de){var Se=this.situation.duration/this._speed;return this.absPos=J,de||(this.situation.reversed&&(this.absPos=1-this.absPos),this.absPos+=this.situation.loop),this.situation.start=+new Date-this.absPos*Se,this.situation.finish=this.situation.start+Se,this.step(!0)},speed:function(J){return J===0?this.pause():J?(this._speed=J,this.at(this.absPos,!0)):this._speed},loop:function(J,de){var Se=this.last();return Se.loops=J??!0,Se.loop=0,de&&(Se.reversing=!0),this},pause:function(){return this.paused=!0,this.stopAnimFrame(),this},play:function(){return this.paused?(this.paused=!1,this.at(this.absPos,!0)):this},reverse:function(J){var de=this.last();return typeof J>"u"?de.reversed=!de.reversed:de.reversed=J,this},progress:function(J){return J?this.situation.ease(this.pos):this.pos},after:function(J){var de=this.last(),Se=function Ie(Re){Re.detail.situation==de&&(J.call(this,de),this.off("finished.fx",Ie))};return this.target().on("finished.fx",Se),this._callStart()},during:function(J){var de=this.last(),Se=function(Ie){Ie.detail.situation==de&&J.call(this,Ie.detail.pos,s.morph(Ie.detail.pos),Ie.detail.eased,de)};return this.target().off("during.fx",Se).on("during.fx",Se),this.after(function(){this.off("during.fx",Se)}),this._callStart()},afterAll:function(J){var de=function Se(Ie){J.call(this),this.off("allfinished.fx",Se)};return this.target().off("allfinished.fx",de).on("allfinished.fx",de),this._callStart()},duringAll:function(J){var de=function(Se){J.call(this,Se.detail.pos,s.morph(Se.detail.pos),Se.detail.eased,Se.detail.situation)};return this.target().off("during.fx",de).on("during.fx",de),this.afterAll(function(){this.off("during.fx",de)}),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(J,de,Se){return this.last()[Se||"animations"][J]=de,this._callStart()},step:function(J){if(J||(this.absPos=this.timeToAbsPos(+new Date)),this.situation.loops!==!1){var de,Se,Ie;de=Math.max(this.absPos,0),Se=Math.floor(de),this.situation.loops===!0||Sethis.lastPos&&Oe<=Re&&(this.situation.once[Oe].call(this.target(),this.pos,Re),delete this.situation.once[Oe]);return this.active&&this.target().fire("during",{pos:this.pos,eased:Re,fx:this,situation:this.situation}),this.situation?(this.eachAt(),this.pos==1&&!this.situation.reversed||this.situation.reversed&&this.pos==0?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=Re,this):this},eachAt:function(){var J,de,Se,Ie=this,Re=this.target(),Oe=this.situation;for(J in Oe.animations)Se=[].concat(Oe.animations[J]).map(function(Be){return typeof Be!="string"&&Be.at?Be.at(Oe.ease(Ie.pos),Ie.pos):Be}),Re[J].apply(Re,Se);for(J in Oe.attrs)Se=[J].concat(Oe.attrs[J]).map(function(Be){return typeof Be!="string"&&Be.at?Be.at(Oe.ease(Ie.pos),Ie.pos):Be}),Re.attr.apply(Re,Se);for(J in Oe.styles)Se=[J].concat(Oe.styles[J]).map(function(Be){return typeof Be!="string"&&Be.at?Be.at(Oe.ease(Ie.pos),Ie.pos):Be}),Re.style.apply(Re,Se);if(Oe.transforms.length){for(Se=Oe.initialTransformation,J=0,de=Oe.transforms.length;J=0;--de)this[Pe[de]]=J[Pe[de]]!=null?J[Pe[de]]:Se[Pe[de]]},extend:{extract:function(){var J=V(this,0,1),de=V(this,1,0),Se=180/Math.PI*Math.atan2(J.y,J.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(Se*Math.PI/180)+this.f*Math.sin(Se*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(Se*Math.PI/180)+this.e*Math.sin(-Se*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),skewX:-Se,skewY:180/Math.PI*Math.atan2(de.y,de.x),scaleX:Math.sqrt(this.a*this.a+this.b*this.b),scaleY:Math.sqrt(this.c*this.c+this.d*this.d),rotation:Se,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new s.Matrix(this)}},clone:function(){return new s.Matrix(this)},morph:function(J){return this.destination=new s.Matrix(J),this},at:function(J){if(!this.destination)return this;var de=new s.Matrix({a:this.a+(this.destination.a-this.a)*J,b:this.b+(this.destination.b-this.b)*J,c:this.c+(this.destination.c-this.c)*J,d:this.d+(this.destination.d-this.d)*J,e:this.e+(this.destination.e-this.e)*J,f:this.f+(this.destination.f-this.f)*J});return de},multiply:function(J){return new s.Matrix(this.native().multiply(X(J).native()))},inverse:function(){return new s.Matrix(this.native().inverse())},translate:function(J,de){return new s.Matrix(this.native().translate(J||0,de||0))},scale:function(J,de,Se,Ie){return arguments.length==1?de=J:arguments.length==3&&(Ie=Se,Se=de,de=J),this.around(Se,Ie,new s.Matrix(J,0,0,de,0,0))},rotate:function(J,de,Se){return J=s.utils.radians(J),this.around(de,Se,new s.Matrix(Math.cos(J),Math.sin(J),-Math.sin(J),Math.cos(J),0,0))},flip:function(J,de){return J=="x"?this.scale(-1,1,de,0):J=="y"?this.scale(1,-1,0,de):this.scale(-1,-1,J,de??J)},skew:function(J,de,Se,Ie){return arguments.length==1?de=J:arguments.length==3&&(Ie=Se,Se=de,de=J),J=s.utils.radians(J),de=s.utils.radians(de),this.around(Se,Ie,new s.Matrix(1,Math.tan(de),Math.tan(J),1,0,0))},skewX:function(J,de,Se){return this.skew(J,0,de,Se)},skewY:function(J,de,Se){return this.skew(0,J,de,Se)},around:function(J,de,Se){return this.multiply(new s.Matrix(1,0,0,1,J||0,de||0)).multiply(Se).multiply(new s.Matrix(1,0,0,1,-J||0,-de||0))},native:function(){for(var J=s.parser.native.createSVGMatrix(),de=Pe.length-1;de>=0;de--)J[Pe[de]]=this[Pe[de]];return J},toString:function(){return"matrix("+xe(this.a)+","+xe(this.b)+","+xe(this.c)+","+xe(this.d)+","+xe(this.e)+","+xe(this.f)+")"}},parent:s.Element,construct:{ctm:function(){return new s.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof s.Nested){var J=this.rect(1,1),de=J.node.getScreenCTM();return J.remove(),new s.Matrix(de)}return new s.Matrix(this.node.getScreenCTM())}}}),s.Point=s.invent({create:function(J,de){var Se,Ie={x:0,y:0};Se=Array.isArray(J)?{x:J[0],y:J[1]}:typeof J=="object"?{x:J.x,y:J.y}:J!=null?{x:J,y:de??J}:Ie,this.x=Se.x,this.y=Se.y},extend:{clone:function(){return new s.Point(this)},morph:function(J,de){return this.destination=new s.Point(J,de),this},at:function(J){if(!this.destination)return this;var de=new s.Point({x:this.x+(this.destination.x-this.x)*J,y:this.y+(this.destination.y-this.y)*J});return de},native:function(){var J=s.parser.native.createSVGPoint();return J.x=this.x,J.y=this.y,J},transform:function(J){return new s.Point(this.native().matrixTransform(J.native()))}}}),s.extend(s.Element,{point:function(J,de){return new s.Point(J,de).transform(this.screenCTM().inverse())}}),s.extend(s.Element,{attr:function(J,de,Se){if(J==null){for(J={},de=this.node.attributes,Se=de.length-1;Se>=0;Se--)J[de[Se].nodeName]=s.regex.isNumber.test(de[Se].nodeValue)?parseFloat(de[Se].nodeValue):de[Se].nodeValue;return J}else if(typeof J=="object")for(de in J)this.attr(de,J[de]);else if(de===null)this.node.removeAttribute(J);else{if(de==null)return de=this.node.getAttribute(J),de==null?s.defaults.attrs[J]:s.regex.isNumber.test(de)?parseFloat(de):de;J=="stroke-width"?this.attr("stroke",parseFloat(de)>0?this._stroke:null):J=="stroke"&&(this._stroke=de),(J=="fill"||J=="stroke")&&(s.regex.isImage.test(de)&&(de=this.doc().defs().image(de,0,0)),de instanceof s.Image&&(de=this.doc().defs().pattern(0,0,function(){this.add(de)}))),typeof de=="number"?de=new s.Number(de):s.Color.isColor(de)?de=new s.Color(de):Array.isArray(de)&&(de=new s.Array(de)),J=="leading"?this.leading&&this.leading(de):typeof Se=="string"?this.node.setAttributeNS(Se,J,de.toString()):this.node.setAttribute(J,de.toString()),this.rebuild&&(J=="font-size"||J=="x")&&this.rebuild(J,de)}return this}}),s.extend(s.Element,{transform:function(J,de){var Se=this,Ie,Re;if(typeof J!="object")return Ie=new s.Matrix(Se).extract(),typeof J=="string"?Ie[J]:Ie;if(Ie=new s.Matrix(Se),de=!!de||!!J.relative,J.a!=null)Ie=de?Ie.multiply(new s.Matrix(J)):new s.Matrix(J);else if(J.rotation!=null)Z(J,Se),Ie=de?Ie.rotate(J.rotation,J.cx,J.cy):Ie.rotate(J.rotation-Ie.extract().rotation,J.cx,J.cy);else if(J.scale!=null||J.scaleX!=null||J.scaleY!=null){if(Z(J,Se),J.scaleX=J.scale!=null?J.scale:J.scaleX!=null?J.scaleX:1,J.scaleY=J.scale!=null?J.scale:J.scaleY!=null?J.scaleY:1,!de){var Oe=Ie.extract();J.scaleX=J.scaleX*1/Oe.scaleX,J.scaleY=J.scaleY*1/Oe.scaleY}Ie=Ie.scale(J.scaleX,J.scaleY,J.cx,J.cy)}else if(J.skew!=null||J.skewX!=null||J.skewY!=null){if(Z(J,Se),J.skewX=J.skew!=null?J.skew:J.skewX!=null?J.skewX:0,J.skewY=J.skew!=null?J.skew:J.skewY!=null?J.skewY:0,!de){var Oe=Ie.extract();Ie=Ie.multiply(new s.Matrix().skew(Oe.skewX,Oe.skewY,J.cx,J.cy).inverse())}Ie=Ie.skew(J.skewX,J.skewY,J.cx,J.cy)}else J.flip?(J.flip=="x"||J.flip=="y"?J.offset=J.offset==null?Se.bbox()["c"+J.flip]:J.offset:J.offset==null?(Re=Se.bbox(),J.flip=Re.cx,J.offset=Re.cy):J.flip=J.offset,Ie=new s.Matrix().flip(J.flip,J.offset)):(J.x!=null||J.y!=null)&&(de?Ie=Ie.translate(J.x,J.y):(J.x!=null&&(Ie.e=J.x),J.y!=null&&(Ie.f=J.y)));return this.attr("transform",Ie)}}),s.extend(s.FX,{transform:function(J,de){var Se=this.target(),Ie,Re;return typeof J!="object"?(Ie=new s.Matrix(Se).extract(),typeof J=="string"?Ie[J]:Ie):(de=!!de||!!J.relative,J.a!=null?Ie=new s.Matrix(J):J.rotation!=null?(Z(J,Se),Ie=new s.Rotate(J.rotation,J.cx,J.cy)):J.scale!=null||J.scaleX!=null||J.scaleY!=null?(Z(J,Se),J.scaleX=J.scale!=null?J.scale:J.scaleX!=null?J.scaleX:1,J.scaleY=J.scale!=null?J.scale:J.scaleY!=null?J.scaleY:1,Ie=new s.Scale(J.scaleX,J.scaleY,J.cx,J.cy)):J.skewX!=null||J.skewY!=null?(Z(J,Se),J.skewX=J.skewX!=null?J.skewX:0,J.skewY=J.skewY!=null?J.skewY:0,Ie=new s.Skew(J.skewX,J.skewY,J.cx,J.cy)):J.flip?(J.flip=="x"||J.flip=="y"?J.offset=J.offset==null?Se.bbox()["c"+J.flip]:J.offset:J.offset==null?(Re=Se.bbox(),J.flip=Re.cx,J.offset=Re.cy):J.flip=J.offset,Ie=new s.Matrix().flip(J.flip,J.offset)):(J.x!=null||J.y!=null)&&(Ie=new s.Translate(J.x,J.y)),Ie?(Ie.relative=de,this.last().transforms.push(Ie),this._callStart()):this)}}),s.extend(s.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){var J=(this.attr("transform")||"").split(s.regex.transforms).slice(0,-1).map(function(de){var Se=de.trim().split("(");return[Se[0],Se[1].split(s.regex.delimiter).map(function(Ie){return parseFloat(Ie)})]}).reduce(function(de,Se){return Se[0]=="matrix"?de.multiply(Y(Se[1])):de[Se[0]].apply(de,Se[1])},new s.Matrix);return J},toParent:function(J){if(this==J)return this;var de=this.screenCTM(),Se=J.screenCTM().inverse();return this.addTo(J).untransform().transform(Se.multiply(de)),this},toDoc:function(){return this.toParent(this.doc())}}),s.Transformation=s.invent({create:function(J,de){if(arguments.length>1&&typeof de!="boolean")return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(J))for(var Se=0,Ie=this.arguments.length;Se"u"?0:J[this.arguments[de]];return J.cx=this.cx,J.cy=this.cy,this._undo=new s[P(this.method)](J,!0).at(1),this}}}),s.Translate=s.invent({parent:s.Matrix,inherit:s.Transformation,create:function(J,de){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["transformedX","transformedY"],method:"translate"}}),s.Rotate=s.invent({parent:s.Matrix,inherit:s.Transformation,create:function(J,de){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["rotation","cx","cy"],method:"rotate",at:function(J){var de=new s.Matrix().rotate(new s.Number().morph(this.rotation-(this._undo?this._undo.rotation:0)).at(J),this.cx,this.cy);return this.inversed?de.inverse():de},undo:function(J){return this._undo=J,this}}}),s.Scale=s.invent({parent:s.Matrix,inherit:s.Transformation,create:function(J,de){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["scaleX","scaleY","cx","cy"],method:"scale"}}),s.Skew=s.invent({parent:s.Matrix,inherit:s.Transformation,create:function(J,de){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["skewX","skewY","cx","cy"],method:"skew"}}),s.extend(s.Element,{style:function(J,de){if(arguments.length==0)return this.node.style.cssText||"";if(arguments.length<2)if(typeof J=="object")for(de in J)this.style(de,J[de]);else if(s.regex.isCss.test(J))for(J=J.split(/\s*;\s*/).filter(function(Se){return!!Se}).map(function(Se){return Se.split(/\s*:\s*/)});de=J.pop();)this.style(de[0],de[1]);else return this.node.style[I(J)];else this.node.style[I(J)]=de===null||s.regex.isBlank.test(de)?"":de;return this}}),s.Parent=s.invent({create:function(J){this.constructor.call(this,J)},inherit:s.Element,extend:{children:function(){return s.utils.map(s.utils.filterSVGElements(this.node.childNodes),function(J){return s.adopt(J)})},add:function(J,de){return de==null?this.node.appendChild(J.node):J.node!=this.node.childNodes[de]&&this.node.insertBefore(J.node,this.node.childNodes[de]),this},put:function(J,de){return this.add(J,de),J},has:function(J){return this.index(J)>=0},index:function(J){return[].slice.call(this.node.childNodes).indexOf(J.node)},get:function(J){return s.adopt(this.node.childNodes[J])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(J,de){var Se,Ie,Re=this.children();for(Se=0,Ie=Re.length;SeRe/Oe?this.height/Oe:this.width/Re,this.x=Se,this.y=Ie,this.width=Re,this.height=Oe)}else J=typeof J=="string"?J.match(mt).map(function(Pt){return parseFloat(Pt)}):Array.isArray(J)?J:typeof J=="object"?[J.x,J.y,J.width,J.height]:arguments.length==4?[].slice.call(arguments):de,this.x=J[0],this.y=J[1],this.width=J[2],this.height=J[3]},extend:{toString:function(){return this.x+" "+this.y+" "+this.width+" "+this.height},morph:function(J,de,Se,Ie){return this.destination=new s.ViewBox(J,de,Se,Ie),this},at:function(J){return this.destination?new s.ViewBox([this.x+(this.destination.x-this.x)*J,this.y+(this.destination.y-this.y)*J,this.width+(this.destination.width-this.width)*J,this.height+(this.destination.height-this.height)*J]):this}},parent:s.Container,construct:{viewbox:function(J,de,Se,Ie){return arguments.length==0?new s.ViewBox(this):this.attr("viewBox",new s.ViewBox(J,de,Se,Ie))}}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(J){s.Element.prototype[J]=function(de){return de==null?s.off(this,J):s.on(this,J,de),this}}),s.listenerId=0,s.on=function(J,de,Se,Ie,Re){var Oe=Se.bind(Ie||J),Ge=J instanceof s.Element?J.node:J;Ge.instance=Ge.instance||{_events:{}};var Be=Ge.instance._events;Se._svgjsListenerId||(Se._svgjsListenerId=++s.listenerId),de.split(s.regex.delimiter).forEach(function(qe){var et=qe.split(".")[0],Ze=qe.split(".")[1]||"*";Be[et]=Be[et]||{},Be[et][Ze]=Be[et][Ze]||{},Be[et][Ze][Se._svgjsListenerId]=Oe,Ge.addEventListener(et,Oe,Re||!1)})},s.off=function(J,de,Se,Ie){var Re=J instanceof s.Element?J.node:J;if(Re.instance&&!(typeof Se=="function"&&(Se=Se._svgjsListenerId,!Se))){var Oe=Re.instance._events;(de||"").split(s.regex.delimiter).forEach(function(Ge){var Be=Ge&&Ge.split(".")[0],qe=Ge&&Ge.split(".")[1],et,Ze;if(Se)Oe[Be]&&Oe[Be][qe||"*"]&&(Re.removeEventListener(Be,Oe[Be][qe||"*"][Se],Ie||!1),delete Oe[Be][qe||"*"][Se]);else if(Be&&qe){if(Oe[Be]&&Oe[Be][qe]){for(Ze in Oe[Be][qe])s.off(Re,[Be,qe].join("."),Ze);delete Oe[Be][qe]}}else if(qe)for(Ge in Oe)for(et in Oe[Ge])qe===et&&s.off(Re,[Ge,qe].join("."));else if(Be){if(Oe[Be]){for(et in Oe[Be])s.off(Re,[Be,et].join("."));delete Oe[Be]}}else{for(Ge in Oe)s.off(Re,Ge);Re.instance._events={}}})}},s.extend(s.Element,{on:function(J,de,Se,Ie){return s.on(this,J,de,Se,Ie),this},off:function(J,de){return s.off(this.node,J,de),this},fire:function(J,de){return J instanceof i.Event?this.node.dispatchEvent(J):this.node.dispatchEvent(J=new s.CustomEvent(J,{detail:de,cancelable:!0})),this._event=J,this},event:function(){return this._event}}),s.Defs=s.invent({create:"defs",inherit:s.Container}),s.G=s.invent({create:"g",inherit:s.Container,extend:{x:function(J){return J==null?this.transform("x"):this.transform({x:J-this.x()},!0)},y:function(J){return J==null?this.transform("y"):this.transform({y:J-this.y()},!0)},cx:function(J){return J==null?this.gbox().cx:this.x(J-this.gbox().width/2)},cy:function(J){return J==null?this.gbox().cy:this.y(J-this.gbox().height/2)},gbox:function(){var J=this.bbox(),de=this.transform();return J.x+=de.x,J.x2+=de.x,J.cx+=de.x,J.y+=de.y,J.y2+=de.y,J.cy+=de.y,J}},construct:{group:function(){return this.put(new s.G)}}}),s.Doc=s.invent({create:function(J){J&&(J=typeof J=="string"?r.getElementById(J):J,J.nodeName=="svg"?this.constructor.call(this,J):(this.constructor.call(this,s.create("svg")),J.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:s.Container,extend:{namespace:function(){return this.attr({xmlns:s.ns,version:"1.1"}).attr("xmlns:xlink",s.xlink,s.xmlns).attr("xmlns:svgjs",s.svgjs,s.xmlns)},defs:function(){if(!this._defs){var J;(J=this.node.getElementsByTagName("defs")[0])?this._defs=s.adopt(J):this._defs=new s.Defs,this.node.appendChild(this._defs.node)}return this._defs},parent:function(){return!this.node.parentNode||this.node.parentNode.nodeName=="#document"||this.node.parentNode.nodeName=="#document-fragment"?null:this.node.parentNode},spof:function(){var J=this.node.getScreenCTM();return J&&this.style("left",-J.e%1+"px").style("top",-J.f%1+"px"),this},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,s.parser.draw.parentNode||this.node.appendChild(s.parser.draw),this},clone:function(J){this.writeDataToDom();var de=this.node,Se=ce(de.cloneNode(!0));return J?(J.node||J).appendChild(Se.node):de.parentNode.insertBefore(Se.node,de.nextSibling),Se}}}),s.extend(s.Element,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},previous:function(){return this.siblings()[this.position()-1]},forward:function(){var J=this.position()+1,de=this.parent();return de.removeElement(this).add(this,J),de instanceof s.Doc&&de.node.appendChild(de.defs().node),this},backward:function(){var J=this.position();return J>0&&this.parent().removeElement(this).add(this,J-1),this},front:function(){var J=this.parent();return J.node.appendChild(this.node),J instanceof s.Doc&&J.node.appendChild(J.defs().node),this},back:function(){return this.position()>0&&this.parent().removeElement(this).add(this,0),this},before:function(J){J.remove();var de=this.position();return this.parent().add(J,de),this},after:function(J){J.remove();var de=this.position();return this.parent().add(J,de+1),this}}),s.Mask=s.invent({create:function(){this.constructor.call(this,s.create("mask")),this.targets=[]},inherit:s.Container,extend:{remove:function(){for(var J=this.targets.length-1;J>=0;J--)this.targets[J]&&this.targets[J].unmask();return this.targets=[],s.Element.prototype.remove.call(this),this}},construct:{mask:function(){return this.defs().put(new s.Mask)}}}),s.extend(s.Element,{maskWith:function(J){return this.masker=J instanceof s.Mask?J:this.parent().mask().add(J),this.masker.targets.push(this),this.attr("mask",'url("#'+this.masker.attr("id")+'")')},unmask:function(){return delete this.masker,this.attr("mask",null)}}),s.ClipPath=s.invent({create:function(){this.constructor.call(this,s.create("clipPath")),this.targets=[]},inherit:s.Container,extend:{remove:function(){for(var J=this.targets.length-1;J>=0;J--)this.targets[J]&&this.targets[J].unclip();return this.targets=[],this.parent().removeElement(this),this}},construct:{clip:function(){return this.defs().put(new s.ClipPath)}}}),s.extend(s.Element,{clipWith:function(J){return this.clipper=J instanceof s.ClipPath?J:this.parent().clip().add(J),this.clipper.targets.push(this),this.attr("clip-path",'url("#'+this.clipper.attr("id")+'")')},unclip:function(){return delete this.clipper,this.attr("clip-path",null)}}),s.Gradient=s.invent({create:function(J){this.constructor.call(this,s.create(J+"Gradient")),this.type=J},inherit:s.Container,extend:{at:function(J,de,Se){return this.put(new s.Stop).update(J,de,Se)},update:function(J){return this.clear(),typeof J=="function"&&J.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(J,de,Se){return J=="transform"&&(J="gradientTransform"),s.Container.prototype.attr.call(this,J,de,Se)}},construct:{gradient:function(J,de){return this.defs().gradient(J,de)}}}),s.extend(s.Gradient,s.FX,{from:function(J,de){return(this._target||this).type=="radial"?this.attr({fx:new s.Number(J),fy:new s.Number(de)}):this.attr({x1:new s.Number(J),y1:new s.Number(de)})},to:function(J,de){return(this._target||this).type=="radial"?this.attr({cx:new s.Number(J),cy:new s.Number(de)}):this.attr({x2:new s.Number(J),y2:new s.Number(de)})}}),s.extend(s.Defs,{gradient:function(J,de){return this.put(new s.Gradient(J)).update(de)}}),s.Stop=s.invent({create:"stop",inherit:s.Element,extend:{update:function(J){return(typeof J=="number"||J instanceof s.Number)&&(J={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),J.opacity!=null&&this.attr("stop-opacity",J.opacity),J.color!=null&&this.attr("stop-color",J.color),J.offset!=null&&this.attr("offset",new s.Number(J.offset)),this}}}),s.Pattern=s.invent({create:"pattern",inherit:s.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(J){return this.clear(),typeof J=="function"&&J.call(this,this),this},toString:function(){return this.fill()},attr:function(J,de,Se){return J=="transform"&&(J="patternTransform"),s.Container.prototype.attr.call(this,J,de,Se)}},construct:{pattern:function(J,de,Se){return this.defs().pattern(J,de,Se)}}}),s.extend(s.Defs,{pattern:function(J,de,Se){return this.put(new s.Pattern).update(Se).attr({x:0,y:0,width:J,height:de,patternUnits:"userSpaceOnUse"})}}),s.Shape=s.invent({create:function(J){this.constructor.call(this,J)},inherit:s.Element}),s.Bare=s.invent({create:function(J,de){if(this.constructor.call(this,s.create(J)),de)for(var Se in de.prototype)typeof de.prototype[Se]=="function"&&(this[Se]=de.prototype[Se])},inherit:s.Element,extend:{words:function(J){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this.node.appendChild(r.createTextNode(J)),this}}}),s.extend(s.Parent,{element:function(J,de){return this.put(new s.Bare(J,de))}}),s.Symbol=s.invent({create:"symbol",inherit:s.Container,construct:{symbol:function(){return this.put(new s.Symbol)}}}),s.Use=s.invent({create:"use",inherit:s.Shape,extend:{element:function(J,de){return this.attr("href",(de||"")+"#"+J,s.xlink)}},construct:{use:function(J,de){return this.put(new s.Use).element(J,de)}}}),s.Rect=s.invent({create:"rect",inherit:s.Shape,construct:{rect:function(J,de){return this.put(new s.Rect).size(J,de)}}}),s.Circle=s.invent({create:"circle",inherit:s.Shape,construct:{circle:function(J){return this.put(new s.Circle).rx(new s.Number(J).divide(2)).move(0,0)}}}),s.extend(s.Circle,s.FX,{rx:function(J){return this.attr("r",J)},ry:function(J){return this.rx(J)}}),s.Ellipse=s.invent({create:"ellipse",inherit:s.Shape,construct:{ellipse:function(J,de){return this.put(new s.Ellipse).size(J,de).move(0,0)}}}),s.extend(s.Ellipse,s.Rect,s.FX,{rx:function(J){return this.attr("rx",J)},ry:function(J){return this.attr("ry",J)}}),s.extend(s.Circle,s.Ellipse,{x:function(J){return J==null?this.cx()-this.rx():this.cx(J+this.rx())},y:function(J){return J==null?this.cy()-this.ry():this.cy(J+this.ry())},cx:function(J){return J==null?this.attr("cx"):this.attr("cx",J)},cy:function(J){return J==null?this.attr("cy"):this.attr("cy",J)},width:function(J){return J==null?this.rx()*2:this.rx(new s.Number(J).divide(2))},height:function(J){return J==null?this.ry()*2:this.ry(new s.Number(J).divide(2))},size:function(J,de){var Se=j(this,J,de);return this.rx(new s.Number(Se.width).divide(2)).ry(new s.Number(Se.height).divide(2))}}),s.Line=s.invent({create:"line",inherit:s.Shape,extend:{array:function(){return new s.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(J,de,Se,Ie){return J==null?this.array():(typeof de<"u"?J={x1:J,y1:de,x2:Se,y2:Ie}:J=new s.PointArray(J).toLine(),this.attr(J))},move:function(J,de){return this.attr(this.array().move(J,de).toLine())},size:function(J,de){var Se=j(this,J,de);return this.attr(this.array().size(Se.width,Se.height).toLine())}},construct:{line:function(J,de,Se,Ie){return s.Line.prototype.plot.apply(this.put(new s.Line),J!=null?[J,de,Se,Ie]:[0,0,0,0])}}}),s.Polyline=s.invent({create:"polyline",inherit:s.Shape,construct:{polyline:function(J){return this.put(new s.Polyline).plot(J||new s.PointArray)}}}),s.Polygon=s.invent({create:"polygon",inherit:s.Shape,construct:{polygon:function(J){return this.put(new s.Polygon).plot(J||new s.PointArray)}}}),s.extend(s.Polyline,s.Polygon,{array:function(){return this._array||(this._array=new s.PointArray(this.attr("points")))},plot:function(J){return J==null?this.array():this.clear().attr("points",typeof J=="string"?J:this._array=new s.PointArray(J))},clear:function(){return delete this._array,this},move:function(J,de){return this.attr("points",this.array().move(J,de))},size:function(J,de){var Se=j(this,J,de);return this.attr("points",this.array().size(Se.width,Se.height))}}),s.extend(s.Line,s.Polyline,s.Polygon,{morphArray:s.PointArray,x:function(J){return J==null?this.bbox().x:this.move(J,this.bbox().y)},y:function(J){return J==null?this.bbox().y:this.move(this.bbox().x,J)},width:function(J){var de=this.bbox();return J==null?de.width:this.size(J,de.height)},height:function(J){var de=this.bbox();return J==null?de.height:this.size(de.width,J)}}),s.Path=s.invent({create:"path",inherit:s.Shape,extend:{morphArray:s.PathArray,array:function(){return this._array||(this._array=new s.PathArray(this.attr("d")))},plot:function(J){return J==null?this.array():this.clear().attr("d",typeof J=="string"?J:this._array=new s.PathArray(J))},clear:function(){return delete this._array,this},move:function(J,de){return this.attr("d",this.array().move(J,de))},x:function(J){return J==null?this.bbox().x:this.move(J,this.bbox().y)},y:function(J){return J==null?this.bbox().y:this.move(this.bbox().x,J)},size:function(J,de){var Se=j(this,J,de);return this.attr("d",this.array().size(Se.width,Se.height))},width:function(J){return J==null?this.bbox().width:this.size(J,this.bbox().height)},height:function(J){return J==null?this.bbox().height:this.size(this.bbox().width,J)}},construct:{path:function(J){return this.put(new s.Path).plot(J||new s.PathArray)}}}),s.Image=s.invent({create:"image",inherit:s.Shape,extend:{load:function(J){if(!J)return this;var de=this,Se=new i.Image;return s.on(Se,"load",function(){s.off(Se);var Ie=de.parent(s.Pattern);Ie!==null&&(de.width()==0&&de.height()==0&&de.size(Se.width,Se.height),Ie&&Ie.width()==0&&Ie.height()==0&&Ie.size(de.width(),de.height()),typeof de._loaded=="function"&&de._loaded.call(de,{width:Se.width,height:Se.height,ratio:Se.width/Se.height,url:J}))}),s.on(Se,"error",function(Ie){s.off(Se),typeof de._error=="function"&&de._error.call(de,Ie)}),this.attr("href",Se.src=this.src=J,s.xlink)},loaded:function(J){return this._loaded=J,this},error:function(J){return this._error=J,this}},construct:{image:function(J,de,Se){return this.put(new s.Image).load(J).size(de||0,Se||de||0)}}}),s.Text=s.invent({create:function(){this.constructor.call(this,s.create("text")),this.dom.leading=new s.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",s.defaults.attrs["font-family"])},inherit:s.Shape,extend:{x:function(J){return J==null?this.attr("x"):this.attr("x",J)},y:function(J){var de=this.attr("y"),Se=typeof de=="number"?de-this.bbox().y:0;return J==null?typeof de=="number"?de-Se:de:this.attr("y",typeof J.valueOf()=="number"?J+Se:J)},cx:function(J){return J==null?this.bbox().cx:this.x(J-this.bbox().width/2)},cy:function(J){return J==null?this.bbox().cy:this.y(J-this.bbox().height/2)},text:function(J){if(typeof J>"u"){for(var J="",de=this.node.childNodes,Se=0,Ie=de.length;Se"u")return this;if(typeof Ie=="string"||s.Color.isRgb(Ie)||Ie&&typeof Ie.fill=="function")this.attr(J,Ie);else for(de=h[J].length-1;de>=0;de--)Ie[h[J][de]]!=null&&this.attr(h.prefix(J,h[J][de]),Ie[h[J][de]]);return this},s.extend(s.Element,s.FX,Se)}),s.extend(s.Element,s.FX,{rotate:function(J,de,Se){return this.transform({rotation:J,cx:de,cy:Se})},skew:function(J,de,Se,Ie){return arguments.length==1||arguments.length==3?this.transform({skew:J,cx:de,cy:Se}):this.transform({skewX:J,skewY:de,cx:Se,cy:Ie})},scale:function(J,de,Se,Ie){return arguments.length==1||arguments.length==3?this.transform({scale:J,cx:de,cy:Se}):this.transform({scaleX:J,scaleY:de,cx:Se,cy:Ie})},translate:function(J,de){return this.transform({x:J,y:de})},flip:function(J,de){return de=typeof J=="number"?J:de,this.transform({flip:J||"both",offset:de})},matrix:function(J){return this.attr("transform",new s.Matrix(arguments.length==6?[].slice.call(arguments):J))},opacity:function(J){return this.attr("opacity",J)},dx:function(J){return this.x(new s.Number(J).plus(this instanceof s.FX?0:this.x()),!0)},dy:function(J){return this.y(new s.Number(J).plus(this instanceof s.FX?0:this.y()),!0)},dmove:function(J,de){return this.dx(J).dy(de)}}),s.extend(s.Rect,s.Ellipse,s.Circle,s.Gradient,s.FX,{radius:function(J,de){var Se=(this._target||this).type;return Se=="radial"||Se=="circle"?this.attr("r",new s.Number(J)):this.rx(J).ry(de??J)}}),s.extend(s.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(J){return this.node.getPointAtLength(J)}}),s.extend(s.Parent,s.Text,s.Tspan,s.FX,{font:function(J,de){if(typeof J=="object")for(de in J)this.font(de,J[de]);return J=="leading"?this.leading(de):J=="anchor"?this.attr("text-anchor",de):J=="size"||J=="family"||J=="weight"||J=="stretch"||J=="variant"||J=="style"?this.attr("font-"+J,de):this.attr(J,de)}}),s.Set=s.invent({create:function(J){J instanceof s.Set?this.members=J.members.slice():Array.isArray(J)?this.members=J:this.clear()},extend:{add:function(){var J,de,Se=[].slice.call(arguments);for(J=0,de=Se.length;J-1&&this.members.splice(de,1),this},each:function(J){for(var de=0,Se=this.members.length;de=0},index:function(J){return this.members.indexOf(J)},get:function(J){return this.members[J]},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 J=this.members[0].rbox(this.members[0].doc());return this.each(function(){J=J.merge(this.rbox(this.doc()))}),J}},construct:{set:function(J){return new s.Set(J)}}}),s.FX.Set=s.invent({create:function(J){this.set=J}}),s.Set.inherit=function(){var J,de=[];for(var J in s.Shape.prototype)typeof s.Shape.prototype[J]=="function"&&typeof s.Set.prototype[J]!="function"&&de.push(J);de.forEach(function(Se){s.Set.prototype[Se]=function(){for(var Ie=0,Re=this.members.length;Ie=0;J--)delete this.memory()[arguments[J]];return this},memory:function(){return this._memory||(this._memory={})}}),s.get=function(J){var de=r.getElementById(_e(J)||J);return s.adopt(de)},s.select=function(J,de){return new s.Set(s.utils.map((de||r).querySelectorAll(J),function(Se){return s.adopt(Se)}))},s.extend(s.Parent,{select:function(J){return s.select(J,this.node)}});function p(J,de,Se,Ie){return Se+Ie.replace(s.regex.dots," .")}function y(J){for(var de=J.slice(0),Se=de.length;Se--;)Array.isArray(de[Se])&&(de[Se]=y(de[Se]));return de}function v(J,de){return J instanceof de}function x(J,de){return(J.matches||J.matchesSelector||J.msMatchesSelector||J.mozMatchesSelector||J.webkitMatchesSelector||J.oMatchesSelector).call(J,de)}function I(J){return J.toLowerCase().replace(/-(.)/g,function(de,Se){return Se.toUpperCase()})}function P(J){return J.charAt(0).toUpperCase()+J.slice(1)}function F(J){return J.length==4?["#",J.substring(1,2),J.substring(1,2),J.substring(2,3),J.substring(2,3),J.substring(3,4),J.substring(3,4)].join(""):J}function k(J){var de=J.toString(16);return de.length==1?"0"+de:de}function j(J,de,Se){if(de==null||Se==null){var Ie=J.bbox();de==null?de=Ie.width/Ie.height*Se:Se==null&&(Se=Ie.height/Ie.width*de)}return{width:de,height:Se}}function V(J,de,Se){return{x:de*J.a+Se*J.c+0,y:de*J.b+Se*J.d+0}}function Y(J){return{a:J[0],b:J[1],c:J[2],d:J[3],e:J[4],f:J[5]}}function X(J){return J instanceof s.Matrix||(J=new s.Matrix(J)),J}function Z(J,de){J.cx=J.cx==null?de.bbox().cx:J.cx,J.cy=J.cy==null?de.bbox().cy:J.cy}function ie(J){for(var de=0,Se=J.length,Ie="";de=0;de--)J.childNodes[de]instanceof i.SVGElement&&ce(J.childNodes[de]);return s.adopt(J).id(s.eid(J.nodeName))}function he(J){return J.x==null&&(J.x=0,J.y=0,J.width=0,J.height=0),J.w=J.width,J.h=J.height,J.x2=J.x+J.width,J.y2=J.y+J.height,J.cx=J.x+J.width/2,J.cy=J.y+J.height/2,J}function _e(J){var de=(J||"").toString().match(s.regex.reference);if(de)return de[1]}function xe(J){return Math.abs(J)>1e-37?J:0}var Pe="abcdef".split("");if(typeof i.CustomEvent!="function"){var ke=function(J,de){de=de||{bubbles:!1,cancelable:!1,detail:void 0};var Se=r.createEvent("CustomEvent");return Se.initCustomEvent(J,de.bubbles,de.cancelable,de.detail),Se};ke.prototype=i.Event.prototype,s.CustomEvent=ke}else s.CustomEvent=i.CustomEvent;return function(J){for(var de=0,Se=["moz","webkit"],Ie=0;Ie{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,i=null){i===null&&(i=Pj(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(i,r);return i.viewbox(0,0,n.width,n.height),i.svg()}async renderSymbologyIcon(e,i=null){if(i===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),i=Pj(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(i,r);return n.center(this.CONTAINER_CENTER,this.CONTAINER_CENTER),this.fitInto(n,this.CONTENT_IMAGE_SIZE),i.svg()}generatePlaceholderSymbology(e,i="#000"){const r=Pj(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(i),r.text(e[0].toUpperCase()).size(23).fill("#fff").attr({"font-weight":"bold","font-family":"Roboto"}).center(this.CONTAINER_CENTER,this.CONTAINER_CENTER),{name:e,svgcode:r.svg()}}async generateBlankSymbology(){return Pj(window.document.createElement("div")).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).svg()}async symbolToSvg(e){const i=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=Pj(n).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).viewbox(0,0,this.CONTAINER_SIZE,this.CONTAINER_SIZE),o={path({size:x,path:I}){return s.path(I).size(x*r)},circle({size:x}){return s.circle(x*r)},cross({size:x}){return s.path("M 0,10 L 20,10 M 10,0 L 10,20").size(x*r)},x({size:x}){return s.path("M 0,0 L 20,20 M 20,0 L 0,20").size(x*r)},triangle({size:x}){return s.path("M 20,20 L 10,0 0,20 Z").size(x*r)},diamond({size:x}){return s.path("M 20,10 L 10,0 0,10 10,20 Z").size(x*r)},square({size:x}){return s.path("M 0,0 20,0 20,20 0,20 Z").size(x*r)}},a={[Gv.SOLID]:"none",[Gv.NONE]:"none",[Gv.DASH]:"5.333,4",[Gv.DOT]:"1.333,4",[Gv.DASHDOT]:"5.333,4,1.333,4",[Gv.LONGDASH]:"10.666,4",[Gv.LONGDASHDOT]:"10.666,4,1.333,4",[Gv.LONGDASHDOTDOT]:"10.666,4,1.333,4,1.333,4",[Gv.SHORTDOT]:"1.333,1.333",[Gv.SHORTDASH]:"5.333,1.333",[Gv.SHORTDASHDOT]:"5.333,1.333,1.333,1.333",[Gv.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},c={color:[0,0,0,0],width:0,style:a.none},h={solid:x=>({color:x.colour,opacity:x.opacity}),none:()=>"transparent",horizontal:(x,I)=>s.pattern(5,5,F=>F.line(0,5/2,5,5/2)).stroke(I),vertical:(x,I)=>s.pattern(5,5,F=>F.line(5/2,0,5/2,5)).stroke(I),"forward-diagonal":(x,I)=>s.pattern(5,5,F=>{F.line(0,0,5,5).stroke(I),F.line(0,0,5,5).move(0,5).stroke(I),F.line(0,0,5,5).move(5,0).stroke(I)}),"backward-diagonal":(x,I)=>s.pattern(5,5,F=>{F.line(5,0,0,5).stroke(I),F.line(5,0,0,5).move(5/2,5/2).stroke(I),F.line(5,0,0,5).move(-5/2,-5/2).stroke(I)}),cross:(x,I)=>s.pattern(5,5,F=>{F.line(5/2,0,5/2,5).stroke(I),F.line(0,5/2,5,5/2).stroke(I)}),"diagonal-cross":(x,I)=>s.pattern(7,7,F=>{F.line(0,0,7,7).stroke(I),F.line(7,0,0,7).stroke(I)})},p={"simple-marker"(){const x=v(e.color);e.outline=e.outline||c;const I=v(e.outline.color),P=y({color:I.colour,opacity:I.opacity,width:e.outline.width,dasharray:a[e.outline.style]}),F=o[e.style](e).fill({color:x.colour,opacity:x.opacity}).stroke(P).center(i.CONTAINER_CENTER,i.CONTAINER_CENTER).rotate(e.angle||0);i.fitInto(F,i.CONTENT_SIZE)},"simple-line"(){const x=v(e.color),I=y({color:x.colour,opacity:x.opacity,width:e.width,linecap:"butt",dasharray:a[e.style]}),P=i.CONTENT_PADDING,F=i.CONTAINER_SIZE-i.CONTENT_PADDING;s.line(P,P,F,F).stroke(I)},esriCLS(){this["simple-line"]()},"simple-fill"(){const x=v(e.color),I=y({color:x.colour,opacity:x.opacity}),P=h[e.style](x,I);e.outline=e.outline||c;const F=v(e.outline.color),k=y({color:F.colour,opacity:F.opacity,width:e.outline.width,linecap:"butt",dasharray:a[e.outline.style]});s.rect(i.CONTENT_SIZE,i.CONTENT_SIZE).center(i.CONTAINER_CENTER,i.CONTAINER_CENTER).fill(P).stroke(k)},text(){console.error("no support for feature service legend of text symbols")},"picture-fill"(){const x=e.imageData?`data:${e.contentType};base64,${e.imageData}`:e.url,I=e.width*e.xscale,P=e.height*e.yscale;e.outline=e.outline||c;const F=v(e.outline.color),k=y({color:F.colour,opacity:F.opacity,width:e.outline.width,dasharray:a[e.outline.style]});return i.$iApi.geo.shared.convertImagetoDataURL(x).then(V=>{const Y=s.pattern(I,P,X=>X.image(V,I,P));s.rect(i.CONTENT_SIZE,i.CONTENT_SIZE).center(i.CONTAINER_CENTER,i.CONTAINER_CENTER).fill(Y).stroke(k)})},"picture-marker"(){const x=e.source,I=x&&x.imageData?`data:${x.contentType};base64,${x.imageData}`:e.url;return i.$iApi.geo.shared.convertImagetoDataURL(I).then(F=>i.svgDrawImage(s,F)).then(({image:F})=>{F.center(i.CONTAINER_CENTER,i.CONTAINER_CENTER).rotate(e.angle||0),i.fitInto(F,i.CONTENT_IMAGE_SIZE)})}};try{return await Promise.resolve(p[e.type]()),window.document.body.removeChild(n),s.svg()}catch(x){return console.error(x),this.generateBlankSymbology()}function y(x){return Object.assign({},l,x)}function v(x){return x?{colour:`rgb(${x.r},${x.g},${x.b})`,opacity:x.a}:{colour:"rgb(0, 0, 0)",opacity:0}}}async svgDrawImage(e,i,r=0,n=0,s=!0){return new Promise((o,a)=>{const l=e.image(i,r,n,s).loaded(c=>o({image:l,loader:c})).error(c=>{a(c),console.error(c)})})}fitInto(e,i){const r=e.node.getBoundingClientRect(),n=i/Math.max(r.width,r.height);n<1&&e.scale(n)}rendererToLegend(e){let i;const r=e.symbolUnits.slice(0);if(e.defaultUnit&&r.push(e.defaultUnit),e.falseRenderer)i=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])}),i=[],n.forEach(s=>i.push(s))}return i.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 i={query:{f:"json"}},r={layers:[]},[n,s]=await yD(ur(`${e}/legend`,i));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,i){const r=e.layers.find(s=>s.layerId===i);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(PR(n),[],!0);throw new Error("attempted to make renderer from non-existing legend data")}mapServerLegendToRendererAll(e){const i=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(...i)};return this.makeRenderer(PR(r),[],!0)}async mapServerToLocalLegend(e,i=void 0){const r=await this.getMapServerLegend(e);let n,s;return typeof i>"u"?(s=0,n=this.mapServerLegendToRendererAll(r)):(s=parseInt(i),n=this.mapServerLegendToRenderer(r,s)),this.rendererToLegend(n)}}class qEi extends Gp{constructor(e){super(e)}async arcGisServerQueryIds(e){const i=new Ns;i.returnGeometry=!1,e.filterSql&&(i.where=e.filterSql),e.filterGeometry&&(i.geometry=this.queryGeometryHelper(e.filterGeometry,!1,this.$iApi.geo.map.getScale(),e.sourceSR),i.spatialRelationship="intersects");const r=await Lae(e.url,i);return Array.isArray(r)?r:[]}async geoJsonQuery(e){const i=new Ns;if(i.returnGeometry=!!e.includeGeometry,i.outFields=["*"],e.filterGeometry&&(i.geometry=this.queryGeometryHelper(e.filterGeometry,!0),i.spatialRelationship="intersects"),e.filterSql&&(i.where=e.filterSql),await e.layer.loadPromise(),!e.layer.esriLayer)throw new Error("file layer being queried contains no ESRI layer");return(await e.layer.esriLayer.queryFeatures(i)).features.map((n,s)=>{let o;return i.returnGeometry?o=this.$iApi.geo.geom.geomEsriToRamp(n.geometry,`queryResult${s}`):o=new FM,new I1(o,"",n.attributes)})}queryGeometryHelper(e,i,r,n){let s;return!i&&e.type===pl.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,i=5){const r=this.$iApi.geo.map,n=r.getExtent(),s=i*(n.xmax-n.xmin)/r.getPixelWidth();return new Ad("ze_buffer",[e.x-s,e.y-s],[e.x+s,e.y+s],e.sr)}}class YEi extends Gp{attributes;geom;layer;map;proj;query;shared;symbology;constructor(e){super(e),this.geom=bk.geom,this.proj=bk.proj,this.shared=bk.sharedUtils,this.map=new ETi(e),this.layer=new IEi(e),this.attributes=new BEi(e),this.query=new qEi(e),this.symbology=new WEi(e)}set proxy(e){pa.request.proxyUrl=e}get proxy(){return pa.request.proxyUrl||""}}const XEi=Object.assign({"../fixtures/appbar/index.ts":()=>Promise.resolve().then(()=>Dcr),"../fixtures/areas-of-interest/index.ts":()=>Promise.resolve().then(()=>Qcr),"../fixtures/basemap/index.ts":()=>Promise.resolve().then(()=>xhr),"../fixtures/crosshairs/index.ts":()=>Promise.resolve().then(()=>Ihr),"../fixtures/details/index.ts":()=>Promise.resolve().then(()=>epr),"../fixtures/export-legend/index.ts":()=>Promise.resolve().then(()=>upr),"../fixtures/export-map/index.ts":()=>Promise.resolve().then(()=>hpr),"../fixtures/export-northarrow/index.ts":()=>Promise.resolve().then(()=>ppr),"../fixtures/export-scalebar/index.ts":()=>Promise.resolve().then(()=>mpr),"../fixtures/export-title/index.ts":()=>Promise.resolve().then(()=>ypr),"../fixtures/export/index.ts":()=>Promise.resolve().then(()=>Dpr),"../fixtures/gazebo/index.ts":()=>Promise.resolve().then(()=>afr),"../fixtures/geosearch/index.ts":()=>Promise.resolve().then(()=>Kfr),"../fixtures/grid/index.ts":()=>Promise.resolve().then(()=>hyr),"../fixtures/help/index.ts":()=>Promise.resolve().then(()=>Gyr),"../fixtures/hilight/index.ts":()=>Promise.resolve().then(()=>Wyr),"../fixtures/layer-reorder/index.ts":()=>Promise.resolve().then(()=>rvr),"../fixtures/legend/index.ts":()=>Promise.resolve().then(()=>cvr),"../fixtures/mapnav/index.ts":()=>Promise.resolve().then(()=>Ivr),"../fixtures/metadata/index.ts":()=>Promise.resolve().then(()=>Uvr),"../fixtures/northarrow/index.ts":()=>Promise.resolve().then(()=>Xvr),"../fixtures/overviewmap/index.ts":()=>Promise.resolve().then(()=>o_r),"../fixtures/panguard/index.ts":()=>Promise.resolve().then(()=>d_r),"../fixtures/scrollguard/index.ts":()=>Promise.resolve().then(()=>__r),"../fixtures/settings/index.ts":()=>Promise.resolve().then(()=>K_r),"../fixtures/snowman/index.ts":()=>Promise.resolve().then(()=>i1r),"../fixtures/wizard/index.ts":()=>Promise.resolve().then(()=>Mbr)});class KEi extends Gp{constructor(e){super(e)}async add(e,i){let r;if(e in OP(this.$vApp.$pinia).items)return this.get(e);if(i){if(typeof i!="function")throw new Error("malformed fixture constructor");r=Ac.updateBaseToInstance(new i,e,this.$iApi)}else{const n=(await XEi[`../fixtures/${e}/index.ts`]()).default;r=new n(e,this.$iApi)}return OP(this.$vApp.$pinia).addFixture(r),this.$iApi.event.emit(cn.FIXTURE_ADDED,r),this.$iApi.geo.map.created&&r.initialized?.(),r}remove(e){const i=this.get(e);if(!i)throw new Error(`Could not find fixture ${e} for removal`);return OP(this.$vApp.$pinia).removeFixture(i),this.$iApi.event.emit(cn.FIXTURE_REMOVED,i),i}get(e){const i=[];typeof e=="string"?i.push(e):Array.isArray(e)?i.push(...e):i.push(e.id);const r=i.map(n=>{const s=OP(this.$vApp.$pinia).items[n];if(s)return s});return r.length===1?r[0]:r}isLoaded(e){const i=OP(this.$vApp.$pinia),r=Array.isArray(e)?e:[e];return r.forEach(n=>{i.loadPromises[n]===void 0&&i.addLoadPromise(n)}),Promise.all(i.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","scrollguard","panguard","settings","wizard"]);const i=yg(this.$vApp.$pinia);return i.startingFixtures=e,Promise.all(e.map(r=>this.add(r)))}}class Ac extends Gp{static updateBaseToInstance(e,i,r){const n=new Ac(i,r);return Object.defineProperties(e,{id:{value:i},$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,i){super(i),this.id=e}remove(){return this.$iApi.fixture.remove(this),this}extend(e,i={}){const r=an({extends:e,iApi:this.$iApi,data(){return{...i}}}),n=xce(r),{el:s}=this.mount(r,{props:{...i.propsData},app:n});return s}mount(e,{props:i,children:r,element:n,app:s}={}){let o=n,a=Y2(e,i,r);return s&&s._context&&(a.appContext=s._context),o?K2(a,o):K2(a,o=document.createElement("div")),{vNode:a,destroy:()=>{o&&K2(null,o),o=null,a=null},el:o}}get config(){return yg(this.$vApp.$pinia).config.fixtures[this.id]}getLayerFixtureConfig(e){return this.getLayerFixtureConfigs()[e]}getLayerFixtureConfigs(){const e=this.$iApi.getConfig(),i={},r=(n,s=void 0)=>{if(n.fixtures&&n.fixtures[this.id]!==void 0){let o=n.id;s!==void 0&&(o=`${s.id}-${n.index}`),i[o]=n.fixtures[this.id]}n.sublayers&&n.sublayers.forEach(o=>r(o,n))};return e.layers?.forEach(n=>r(n)),i}handlePanelWidths(e){if(this.config?.panelWidth){const i={};typeof this.config?.panelWidth=="number"&&(this.config.panelWidth={default:this.config?.panelWidth}),this.config.panelWidth.default&&e.forEach(r=>{i[r]=this.config.panelWidth.default});for(const r in this.config.panelWidth)r!="default"&&(i[r]=this.config.panelWidth[r]);for(const r in i){const n=this.$iApi.panel.get(r);this.$iApi.panel.setStyle(n,{"flex-basis":`${i[r]}px`})}}}handlePanelTeleports(e){if(this.config?.panelTeleport){const i=ay(this.$vApp.$pinia),r=!!this.config.panelTeleport.target;e.forEach(n=>{i.items[n].teleport=r?this.config.panelTeleport:this.config.panelTeleport[n],i.items[n].style.width="100%"})}}}class JEi extends Gp{panelStore=ay(this.$vApp.$pinia);register(e,i){const r=ZEi(e)?{[e.id]:e.config}:e;if(i){const s=i.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 _k(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 i=Array.isArray(e)?e:[e];return i.forEach(r=>{this.panelStore.regPromises[r]===void 0&&this.panelStore.addRegPromise(r)}),Promise.all(this.panelStore.getRegPromises(i))}remove(e){const i=this.get(e);i&&(i.isOpen&&this.close(i),this.panelStore.removePanel(i))}get(e){const i=typeof e=="string"?e:e.id;return this.panelStore.items[i]}open(e){let i,r,n;if(typeof e=="string"||e instanceof _k?i=this.get(e):(i=this.get(e.id),{screen:r,props:n}=e),!i)return i;if(i.isOpen&&!i.isVisible)i.minimize();else if(i.isOpen)return i;return r||(i.route&&!n?{screen:r,props:n}=i.route:r=Object.keys(i.screens).pop()),this.show(i,{screen:r,props:n})?(this.panelStore.openPanel(i),this.$iApi.updateAlert(this.$iApi.$i18n.t("panels.alert.open",{name:i.alertName?this.$iApi.$i18n.t(i.alertName):i.id})),this.$iApi.event.emit(cn.PANEL_OPENED,i)):console.error(`Failed to open ${i.id} panel.`),i}get opened(){return this.panelStore.orderedItems.concat(this.panelStore.teleported)}get visible(){return this.panelStore.visible.concat(this.panelStore.teleported)}close(e){const i=this.get(e);return i&&(i.isPinned&&i.pin(!1),this.panelStore.closePanel(i),this.$iApi.updateAlert(this.$iApi.$i18n.t("panels.alert.close",{name:i.alertName?this.$iApi.$i18n.t(i.alertName):i.id})),this.$iApi.event.emit(cn.PANEL_CLOSED,i),i)}minimize(e){const i=this.get(e);return i&&(i.isPinned&&i.pin(!1),this.panelStore.closePanel(i),this.$iApi.updateAlert(this.$iApi.$i18n.t("panels.alert.minimize",{name:i.alertName?this.$iApi.$i18n.t(i.alertName):i.id})),this.$iApi.event.emit(cn.PANEL_MINIMIZED,i),i)}move(e,i){const r=this.get(e);return r&&(this.panelStore.movePanel(r,i),r)}toggle(e,i){let r;return typeof e=="string"||e instanceof _k?r=this.get(e):r=this.get(e.id),r&&(i=typeof i<"u"?i:!r.isVisible,i!==r.isVisible&&(i?this.open(e):this.close(r)),r)}toggleMinimize(e,i){let r;return typeof e=="string"||e instanceof _k?r=this.get(e):r=this.get(e.id),r&&(i=typeof i<"u"?i:!r.isVisible,i!==r.isVisible&&(i?this.open(r):this.minimize(r)),r)}pin(e,i){const r=this.get(e);return!r||(i=typeof i<"u"?i:!r.isPinned,!r.isPinned&&!i)||(this.panelStore.pinned=i?r:void 0),r}get pinned(){return this.panelStore.pinned||void 0}show(e,i){const r=this.get(e);if(!r)return r;if(r.screens[i.screen]){if(r.screens[i.screen]?.props){const n=Object.keys(r.screens[i.screen]?.props).filter(o=>o!=="panel"),s=i.props?Object.keys(i.props):[];for(let o=0;o(eh("data-v-a3c61802"),t=t(),th(),t))(()=>Dt("div",{class:"loader"},null,-1));function tIi(t,e){const i=Vo("panel-screen");return Qt(),Bn(i,{header:!1,class:"screen-spinner"},{content:En(()=>[eIi]),_:1})}const iIi=Nl(QEi,[["render",tIi],["__scopeId","data-v-a3c61802"]]),rIi=Object.assign({"../fixtures/areas-of-interest/screen.vue":()=>Promise.resolve().then(()=>Xcr),"../fixtures/basemap/screen.vue":()=>Promise.resolve().then(()=>yhr),"../fixtures/export/screen.vue":()=>Promise.resolve().then(()=>Opr),"../fixtures/geosearch/screen.vue":()=>Promise.resolve().then(()=>zfr),"../fixtures/grid/screen.vue":()=>Promise.resolve().then(()=>lyr),"../fixtures/help/screen.vue":()=>Promise.resolve().then(()=>kyr),"../fixtures/layer-reorder/screen.vue":()=>Promise.resolve().then(()=>Q0r),"../fixtures/legend/screen.vue":()=>Promise.resolve().then(()=>avr),"../fixtures/metadata/screen.vue":()=>Promise.resolve().then(()=>Vvr),"../fixtures/settings/screen.vue":()=>Promise.resolve().then(()=>q_r),"../fixtures/wizard/screen.vue":()=>Promise.resolve().then(()=>Abr)});class _k extends Gp{id;screens;loadedScreens=[];alertName;teleport;controls;button;isScreenLoaded(e){return this.loadedScreens.indexOf(e)!==-1}registerScreen(e){const i=this.screens[e];let r;if(nmi(i)||rmi(i))r=i,this.loadedScreens.push(e);else{let n;typeof i=="string"?n=rIi[`../fixtures/${i}`]():n=i();const s=new Promise((o,a)=>{n.then(l=>{this.loadedScreens.push(e),o(smi(l)?l.default:l)}),n.catch(l=>a(l))});r=GX({loader:()=>s,loadingComponent:iIi,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,i,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:i,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(){return this.$iApi.panel.visible.length>0?this.id===this.$iApi.panel.visible[0].id:!1}get isRightMostPanel(){return this.$iApi.panel.visible.length>0?this.id===this.$iApi.panel.visible.slice(-1)[0].id:!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 i=typeof e=="string"?{screen:e}:e;return this.route=i,this.$iApi.panel.show(this,i),this}setStyles(e,i=!1){return this.$iApi.panel.setStyle(this,e,i),this}expand(e){return this.$iApi.panel.expand(this,e),this}}function nIi(t){const e={};(Array.isArray(t)?t:[t]).forEach(o=>{o.language||(console.warn("RAMP2 config with no language supplied. Defaulting to English"),o.language="en");const a=sIi(o);e[o.language]=a});const r=Object.entries(e).map(o=>{const a=o[1].fixturesEnabled;return delete o[1].fixturesEnabled,a});let n=!1;const s=r.reduce((o,a)=>o.filter(l=>{const c=a.includes(l);return n=n||!c,c}));return n&&console.warn("Configs attempted to load different sets of fixtures. Only common fixtures will be loaded (all configs must load the same fixtures)."),s.push("crosshairs","scrollguard","panguard","wizard","layer-reorder","details"),{startingFixtures:s,configs:e}}function sIi(t){const e={version:"4.0",fixtures:{},layers:[],map:{},panels:{open:[]},system:{animate:!0,exposeOid:!1},fixturesEnabled:[]};return aIi(t.services,e),oIi(t.map,e),lIi(t.ui,e),t.plugins&&uIi(t.plugins,e),e}function oIi(t,e){if(t.layers&&t.layers.forEach(i=>{e.layers.push(opt(i))}),t.initialBasemapId&&(e.map.initialBasemapId=t.initialBasemapId),t.components){if(t.components.geoSearch&&(t.components.geoSearch.enabled&&e.fixturesEnabled.push("geosearch"),typeof t.components.geoSearch.showGraphic<"u"&&console.warn("showGraphic property provided in geoSearch map component cannot be mapped and will be skipped."),typeof t.components.geoSearch.showInfo<"u"&&console.warn("showInfo property provided in geoSearch map component cannot be mapped and will be skipped.")),t.components.overviewMap&&t.components.overviewMap.enabled&&(e.fixtures.overviewmap||(e.fixtures.overviewmap={basemaps:{}},e.fixturesEnabled.push("overviewmap")),e.fixtures.overviewmap.startMinimized=!t.components.overviewMap.initiallyExpanded,e.fixtures.overviewmap.expandFactor=t.components.overviewMap.expandFactor??1.5),t.components.northArrow&&t.components.northArrow.enabled){const i={};t.components.northArrow.arrowIcon&&(i.arrowIcon=t.components.northArrow.arrowIcon),t.components.northArrow.poleIcon&&(i.poleIcon=t.components.northArrow.poleIcon),i&&(e.fixtures.northarrow=i,e.fixturesEnabled.push("northarrow"))}if(t.components.scaleBar&&t.components.scaleBar.enabled){switch(e.map.caption={mapCoords:{disabled:!1},scaleBar:{disabled:!1,imperialScale:t?.components?.scaleBar?.scalebarUnit==="english"||t?.components?.scaleBar?.scalebarUnit==="dual"&&Math.floor(Math.random()*2)===0}},t.components?.mouseInfo?.spatialReference?.wkid){case 4326:e.map.caption.mapCoords.formatter="LAT_LONG_DMS";break;case 3978:e.map.caption.mapCoords.formatter="CANADA_ATLAS_LAMBERT";break;case 102100:e.map.caption.mapCoords.formatter="WEB_MERCATOR";break;default:e.map.caption.mapCoords.formatter="LAT_LONG_DMS";break}t.components.scaleBar.attachTo&&console.warn("attachTo property provided in scaleBar map component cannot be mapped and will be skipped.")}t.components.basemap&&t.components.basemap.enabled&&e.fixturesEnabled.push("basemap")}t.extentSets&&(e.map.extentSets=[],t.extentSets.forEach(i=>{const r={id:i.id,default:{xmin:i.default.xmin,xmax:i.default.xmax,ymin:i.default.ymin,ymax:i.default.ymax,spatialReference:i.spatialReference}};i.full&&(r.full={xmin:i.full.xmin,xmax:i.full.xmax,ymin:i.full.ymin,ymax:i.full.ymax,spatialReference:i.spatialReference}),i.maximum&&(r.maximum={xmin:i.maximum.xmin,xmax:i.maximum.xmax,ymin:i.maximum.ymin,ymax:i.maximum.ymax,spatialReference:i.spatialReference}),e.map.extentSets.push(r)})),t.lodSets&&(e.map.lodSets=t.lodSets),t.tileSchemas&&(e.map.tileSchemas=[],t.tileSchemas.forEach(i=>{const r={id:i.id,name:i.name,extentSetId:i.extentSetId,lodSetId:i.lodSetId,thumbnailTileUrls:[],hasNorthPole:i.hasNorthPole||!1};i.overviewUrl&&(e.fixtures.overviewmap||(e.fixtures.overviewmap={basemaps:{}},e.fixturesEnabled.push("overviewmap")),e.fixtures.overviewmap.basemaps[i.id]={id:i.overviewUrl.id||`overviewmap-basemap-${i.id}`,tileSchemaId:i.id,layers:[{id:i.overviewUrl.id||`overviewmap-basemap-${i.id}-0`,layerType:i.overviewUrl.layerType==="esriDynamic"?_n.MAPIMAGE:_n.TILE,url:i.overviewUrl.url,opacity:i.overviewUrl.opacity??1}]}),e.map.tileSchemas.push(r)})),t.baseMaps&&(e.map.basemaps=[],t.baseMaps.forEach(i=>{const r={id:i.id,tileSchemaId:i.tileSchemaId,name:i.name,description:i.description,altText:i.altText,thumbnailUrl:i.thumbnailUrl,layers:[]};i.attribution&&(r.attribution={text:{},logo:{}},i.attribution.text&&(r.attribution.text.disabled=!i.attribution.text.enabled,r.attribution.text.value=i.attribution.text.value),i.attribution.logo&&(r.attribution.logo.disabled=!i.attribution.logo.enabled,r.attribution.logo.altText=i.attribution.logo.altText,r.attribution.logo.value=i.attribution.logo.value,r.attribution.logo.link=i.attribution.logo.link)),i.layers.forEach((n,s)=>{const o={id:n.id||`${i.id}-${s}`,layerType:n.layerType==="esriDynamic"?_n.MAPIMAGE:_n.TILE,url:n.url,opacity:n.opacity??1};r.layers.push(o)}),e.map.basemaps.push(r)})),t.legend&&(e.fixturesEnabled.push("legend"),t.legend.type==="autopopulate"?(e.fixtures.legend={root:{name:"I'm root",children:[]}},e.layers&&e.layers.forEach(i=>{if(i.type==="esri-map-image"||i.type==="ogc-wms"){const r={name:i.name??`${i.id} Group`,children:[]};i.sublayers.forEach(n=>{const s={layerId:i.id};n.name&&(s.name=n.name),n.controls&&(s.controls=n.controls),n.disabledControls&&(s.disabledControls=n.disabledControls),i.type==="esri-map-image"?s.sublayerIndex=n.index:(s.sublayerId=n.id,console.warn(`sublayerId property defined in legend entry ${s.layerId} is currently not supported.`)),r.children.push(s)}),e.fixtures.legend.root.children.push(r)}else{const r={layerId:i.id};i.controls&&(r.controls=i.controls),i.disabledControls&&(r.disabledControls=i.disabledControls),e.fixtures.legend.root.children.push(r)}})):e.fixtures.legend={root:lRe(t.legend.root)})}function lRe(t){const e={name:t.name,children:[]};typeof t.hidden<"u"&&(e.hidden=t.hidden),typeof t.expanded<"u"&&(e.expanded=t.expanded);const i=["identify","opacity","reload","remove","settings","symbology","visibility"];return t.controls&&t.controls.length>0&&(e.controls=Oj(t.controls,i),t.controls.includes("visibility")&&e.controls.push("visibilityButton"),(t.controls.length!==1||t.controls[0]!=="visibility")&&console.warn("Legend entry groups currently support only the visibility control. All other controls are currently not supported."),e.controls.push("expandButton")),t.disabledControls&&t.disabledControls.length>0&&(e.disabledControls=Oj(t.disabledControls,i),t.disabledControls.includes("visibility")&&e.disabledControls.push("visibilityButton"),(t.disabledControls.length!==1||t.disabledControls[0]!=="visibility")&&console.warn("Legend entry groups currently support only the visibility control. All other controls are currently not supported.")),t.children.forEach(r=>{if(r.layerId)e.children.push(spt(r));else if(r.infoType)r.infoType==="unboundLayer"?console.warn(`unboundLayer infoType in infoSection in children list of legend entry group ${e.name} cannot be mapped and will be skipped.`):(e.children.push({infoType:r.infoType,content:r.content}),typeof r.export<"u"&&console.warn(`export property in infoSection in children list of legend entry group ${e.name} cannot be mapped and will be skipped.`));else if(r.exclusiveVisibility){const n={name:"Visibility Set",children:[],exclusive:!0};typeof r.collapse<"u"&&console.warn(`collapse property in visibilitySet in children list of legend entry group ${e.name} cannot be mapped and will be skipped.`),r.exclusiveVisibility.forEach(s=>{s.layerId?n.children.push(spt(s)):n.children.push(lRe(s))}),e.children.push(n)}else e.children.push(lRe(r))}),e}function spt(t){const e=t,i=["boundaryZoom","datatable","identify","metadata","opacity","refresh","reload","remove","settings","symbology","visibility"];return t.controls&&t.controls.length>0&&(e.layerControls=Oj(t.controls,i)),t.disabledControls&&t.disabledControls.length>0&&(e.disabledLayerControls=Oj(t.disabledControls,i)),t.controlledIds&&(console.warn(`controlledIds property defined in legend entry ${t.layerId} cannot be mapped and will be skipped.`),delete e.controlledIds),t.entryIndex&&(e.sublayerIndex=t.entryIndex,delete t.entryIndex),t.entryId&&console.warn(`entryId property defined in legend entry ${t.layerId} cannot be mapped and will be skipped.`),e}function opt(t){const e=uRe(t);switch(e.id=t.id,e.url=t.url,t.refreshInterval&&(e.refreshInterval=t.refreshInterval,console.warn("Property refreshInterval in layer is currently not supported.")),t.expectedResponseTime&&(e.expectedLoadTime=t.expectedResponseTime),t.metadataUrl&&(e.metadata={url:t.metadataUrl}),t.catalogueUrl&&(e.catalogueUrl=t.catalogueUrl),typeof t.enableStructuredDelete<"u"&&console.warn(`enableStructuredDelete property provided in layer ${t.id} cannot be mapped and will be skipped.`),t.tooltipField&&(e.tooltipField=t.tooltipField),t.tolerance&&(e.mouseTolerance=t.tolerance,t.layerType==="esriDynamic"&&(e.touchTolerance=t.tolerance+10)),t.customRenderer&&(e.customRenderer=t.customRenderer),t.layerType){case"esriDynamic":e.layerType="esri-map-image",typeof t.singleEntryCollapse<"u"&&(e.singleEntryCollapse=t.singleEntryCollapse),t.imageFormat&&(e.imageFormat=t.imageFormat),t.layerEntries&&(e.sublayers=[],t.layerEntries.forEach(i=>{const r=uRe(i);r.index=i.index,e.sublayers.push(r)}));break;case"esriFeature":e.layerType="esri-feature",t.fileType&&(e.layerType=t.fileType==="shapefile"?"file-shape":`file-${t.fileType}`,t.colour&&(e.colour=t.colour),t.latField&&(e.latField=t.latField),t.longField&&(e.longField=t.longField));break;case"ogcWfs":e.layerType="ogc-wfs",t.colour&&(e.colour=t.colour),typeof t.xyInAttribs<"u"&&(e.xyInAttribs=t.xyInAttribs);break;case"ogcWms":e.layerType="ogc-wms",t.suppressGetCapabilities&&console.warn(`suppressGetCapabilities property provided in layer ${t.id} cannot be mapped and will be skipped.`),t.featureInfoMimeType&&(t.featureInfoMimeType==="text/html;fgpv=summary"?e.featureInfoMimeType="text/html":e.featureInfoMimeType=t.featureInfoMimeType),t.legendMimeType&&console.warn(`legendMimeType property provided in layer ${t.id} cannot be mapped and will be skipped.`),t.layerEntries&&(e.sublayers=[],t.layerEntries.forEach(i=>{const r=uRe(i);r.id=i.id,i.currentStyle&&(r.currentStyle=i.currentStyle,console.warn(`currentStyle property provided in layer entry ${i.id} of layer ${t.id} is currently not supported.`)),i.allStyles&&console.warn(`allStyles property provided in layer entry ${i.id} of layer ${t.id} cannot be mapped and will be skipped.`),e.sublayers.push(r)}));break;case"esriImage":e.layerType="esri-imagery";break;case"esriTile":e.layerType="esri-tile";break;default:console.warn(`Unhandled layer type in ramp 2 config ${t.layerType}`)}return t.details&&console.warn(`Details config provided in layer ${t.id} cannot be mapped and will be skipped.`),e}function uRe(t){const e={};t.name&&(e.name=t.name),t.nameField&&(e.nameField=t.nameField),t.extent&&(e.extent=t.extent);const i=["boundaryZoom","datatable","identify","metadata","opacity","refresh","reload","remove","settings","symbology","visibility"];return t.controls&&t.controls.length>0&&(e.controls=Oj(t.controls,i)),t.disabledControls&&t.disabledControls.length>0&&(e.disabledControls=Oj(t.disabledControls,i)),t.state&&(e.state={opacity:t.state.opacity??1,visibility:t.state.visibility??!0,identify:t.state.query??!0,hovertips:t.state.hovertips??!0},typeof t.state.snapshot<"u"&&console.warn(`snapshot property provided in initialLayer settings in layer ${t.id} cannot be mapped and will be skipped.`),typeof t.state.boundingBox<"u"&&console.warn(`boundingBox property provided in initialLayer settings in layer ${t.id} cannot be mapped and will be skipped.`)),typeof t.stateOnly<"u"&&(e.cosmetic=t.stateOnly),t.initialFilteredQuery&&(e.initialFilteredQuery=t.initialFilteredQuery),cIi(t,e),(typeof t.toggleSymbology<"u"||t.table)&&(e.fixtures={},typeof t.toggleSymbology<"u"&&(e.fixtures.legend={toggleSymbology:t.toggleSymbology}),t.table&&(e.fixtures.grid={},t.table.title&&(e.fixtures.grid.title=t.table.title),t.table.description&&console.warn(`description property provided in table property in layer ${t.id} cannot be mapped and will be skipped.`),typeof t.table.maximize<"u"&&console.warn(`maximize property provided in table property in layer ${t.id} cannot be mapped and will be skipped.`),t.table.search&&(t.table.search.enabled&&(e.fixtures.grid.search=t.table.search.enabled),t.table.search.value&&(e.fixtures.grid.searchFilter=t.table.search.value)),typeof t.table.lazyFilter<"u"&&console.warn(`lazyFilter property provided in table property in layer ${t.id} cannot be mapped and will be skipped.`),typeof t.table.applyMap<"u"&&(e.fixtures.grid.applyMap=t.table.applyMap),typeof t.table.showFilter<"u"&&(e.fixtures.grid.showFilter=t.table.showFilter),typeof t.table.filterByExtent<"u"&&(e.fixtures.grid.filterByExtent=t.table.filterByExtent),typeof t.table.searchStrictMatch<"u"&&console.warn(`searchStrictMatch property provided in table property in layer ${t.id} cannot be mapped and will be skipped.`),typeof t.table.printEnabled<"u"&&console.warn(`printEnabled property provided in table property in layer ${t.id} cannot be mapped and will be skipped.`),t.table.columns&&(e.fixtures.grid.columns=[],t.table.columns.forEach(r=>{const n={name:r.data};r.title&&(n.title=r.title),r.description&&console.warn(`description property provided in column property in table property in layer ${t.id} cannot be mapped and will be skipped.`),typeof r.visible<"u"&&(n.visible=r.visible),r.width&&(n.width=r.width),r.sort&&(n.sort=r.sort),typeof r.searchable<"u"&&(n.searchable=r.searchable),r.filter&&(n.filter=r.filter),e.fixtures.grid.columns.push(n)})))),e}function Oj(t,e){const i=[];return t.forEach(r=>{e.includes("identify")&&r==="query"?i.push("identify"):e.includes(r)?i.push(r):console.warn(`Ignored invalid control: ${r}`)}),i}function aIi(t,e){if(!t)return;t.search&&(e.fixtures.geosearch={},e.fixtures.geosearch.serviceUrls={geoNames:t.search.serviceUrls.geoNames,geoLocation:t.search.serviceUrls.geoLocation,geoProvince:t.search.serviceUrls.provinces,geoTypes:t.search.serviceUrls.types},t.search.serviceUrls.geoSuggest&&console.warn("geoSuggest property provided in serviceUrls of search service cannot be mapped and will be skipped."),t.search.settings&&(e.fixtures.geosearch.settings=t.search.settings),t.search.disabledSearches&&(e.fixtures.geosearch.settings.disabledSearchTypes=t.search.disabledSearches.filter(r=>r!=="SCALE"))),t.export&&(e.fixtures.export||(e.fixtures.export={},e.fixturesEnabled.push("export")),t.export.title&&(e.fixtures.export.title={selected:t.export.title.isSelected??!0,selectable:t.export.title.isSelectable??!0,value:t.export.title.value??"RAMP-Map / PCAR-Carte"}),t.export.map&&(e.fixtures.export.map={selected:t.export.map.isSelected??!0,selectable:t.export.map.isSelectable??!0},t.export.map.value&&console.warn("value property provided in map export component cannot be mapped and will be skipped.")),t.export.mapElements&&(e.fixtures.export.mapElements={selected:t.export.mapElements.isSelected??!0,selectable:t.export.mapElements.isSelectable??!0},t.export.mapElements.value&&console.warn("value property provided in mapElements export component cannot be mapped and will be skipped.")),t.export.legend&&(e.fixtures.export.legend={selected:t.export.legend.isSelected??!0,selectable:t.export.legend.isSelectable??!0},t.export.legend.columnWidth&&(e.fixtures.export.legend.columnWidth=t.export.legend.columnWidth),t.export.legend.value&&console.warn("value property provided in legend export component cannot be mapped and will be skipped."),typeof t.export.legend.showInfoSymbology<"u"&&console.warn("showInfoSymbology property provided in legend export component cannot be mapped and will be skipped."),typeof t.export.legend.showControlledSymbology<"u"&&console.warn("showControlledSymbology property provided in legend export component cannot be mapped and will be skipped.")),t.export.footnote&&(e.fixtures.export.footnote={selected:t.export.footnote.isSelected??!0,selectable:t.export.footnote.isSelectable??!0,value:t.export.footnote.value??""}),t.export.timestamp&&(e.fixtures.export.timestamp={selected:t.export.timestamp.isSelected??!0,selectable:t.export.timestamp.isSelectable??!0},t.export.timestamp.value&&console.warn("value property provided in timestamp export component cannot be mapped and will be skipped.")),t.export.timeout&&console.warn("timeout property provided in export property of services config cannot be mapped and will be skipped."),typeof t.cleanCanvas<"u"&&console.warn("cleanCanvas property provided in export property of services config cannot be mapped and will be skipped.")),t.proxyUrl&&(e.system.proxyUrl=t.proxyUrl),["corsEverywhere","exportMapUrl","geometryUrl","googleAPIKey","esriLibUrl","geolocation","coordInfo","print"].forEach(r=>{typeof t[r]<"u"&&console.warn(`${r} property provided in services config cannot be mapped and will be skipped.`)})}function lIi(t,e){if(t.navBar){e.fixtures.mapnav={zoomOption:t.navBar.zoom||"buttons",items:[]};const n=["geolocator","zoom","home","basemap","help","fullscreen","geosearch","legend"];t.navBar.extra.forEach(s=>{const o=s.toLowerCase();n.includes(o)?e.fixtures.mapnav.items.push(o):console.warn(`Ignored invalid mapnav item: ${s}`)}),e.fixturesEnabled.push("mapnav")}if(t.help&&(e.fixtures.help={location:t.help.folderName&&t.help.folderName!=="default"?`./${t.help.folderName}`:"./help",panelWidth:350},e.fixturesEnabled.push("help")),t.legend){const n=["groupToggle","visibilityToggle"];t.legend.reorderable&&n.push("layerReorder"),t.legend.allowImport&&n.push("wizard"),e.fixtures.legend?e.fixtures.legend.headerControls=n:(e.fixturesEnabled.push("legend"),e.fixtures.legend={headerControls:n,root:{}}),t.legend.isOpen&&t.legend.isOpen.large&&e.panels.open.push({id:"legend"})}e.fixtures.appbar={items:[]},e.fixturesEnabled.push("appbar");const i=["layers","basemap","export","help","geoSearch"];t.appBar?(t.appBar.layers!==!1&&(e.fixtures.appbar.items.push("legend"),e.fixturesEnabled.includes("legend")||e.fixturesEnabled.push("legend")),t.appBar.geoSearch!==!1&&e.fixturesEnabled.includes("geosearch")&&e.fixtures.appbar.items.push("geosearch"),t.appBar.basemap!==!1&&e.fixtures.appbar.items.push("basemap")):(e.fixtures.appbar.items.push("legend"),e.fixturesEnabled.includes("legend")||e.fixturesEnabled.push("legend"),e.fixtures.appbar.items.push("geosearch"),e.fixtures.appbar.items.push("basemap")),t.sideMenu&&t.sideMenu.items&&t.sideMenu.items.length>0&&t.sideMenu.items.forEach(n=>{n.forEach(s=>{s==="layers"&&!e.fixtures.appbar.items.includes("legend")?(e.fixtures.appbar.items.push("legend"),e.fixturesEnabled.includes("legend")||e.fixturesEnabled.push("legend")):s!=="layers"&&i.includes(s)&&!e.fixtures.appbar.items.includes(s.toLowerCase())&&(e.fixtures.appbar.items.push(s.toLowerCase()),(s.toLowerCase()==="help"||s.toLowerCase()==="export"&&!e.fixturesEnabled.includes(s.toLowerCase()))&&e.fixturesEnabled.push(s.toLowerCase()))})}),t.tableIsOpen&&t.tableIsOpen.large,["fullscreen","theme","logoUrl","failureFeedback","title","restrictNavigation","about"].forEach(n=>{typeof t[n]<"u"&&console.warn(`${n} property provided in services config cannot be mapped and will be skipped.`)})}function uIi(t,e){t.areasOfInterest&&(e.fixturesEnabled.includes("areas-of-interest")||e.fixturesEnabled.push("areas-of-interest"),e.fixtures["areas-of-interest"]={areas:t.areasOfInterest.areas.map(i=>({title:`${i["title-en-CA"]} / ${i["title-fr-CA"]}`,thumbnail:i.thumbnailUrl,altText:i.altText??"",description:i.description??"",extent:{xmin:i.xmin,xmax:i.xmax,ymin:i.ymin,ymax:i.ymax,spatialReference:{wkid:i.wkid}}}))})}function cIi(t,e){const i=t.outfields&&t.outfields!=="*";if(!i&&!t.fieldMetadata)return;const r={fieldInfo:[],exclusiveFields:!1};t.fieldMetadata?(r.fieldInfo=t.fieldMetadata.map(n=>{const s={name:n.data};return n.alias&&(s.alias=n.alias),s}),i&&(t.outfields.split(",").map(s=>s.trim()).forEach(s=>{r.fieldInfo.findIndex(o=>o.name===s)===-1&&r.fieldInfo.push({name:s})}),r.exclusiveFields=!0)):i&&(r.fieldInfo=t.outfields.split(",").map(n=>({name:n.trim()})),r.exclusiveFields=!0),e.fieldMetadata=r}console.info(`RAMP v4.3.0-beta [${"ad512703f90b401aa1002bc623649fb08552d031".slice(0,9)}] (Built on ${new Date("Wed Sep 20 16:27:50 2023 -0400".toString()).toLocaleString()})`);const Rj={major:"4",minor:"3",patch:"0-beta",timestamp:"Wed Sep 20 16:27:50 2023 -0400",hash:"ad512703f90b401aa1002bc623649fb08552d031"};function hIi(t){return nIi(t)}function dIi(t){return opt(t)}const pIi=(t,e,i)=>new wTi(t,e,i),bk=new imi;let cRe;function fIi(t,e){let i=e.responseType;i?i!=="array-buffer"&&i!=="blob"&&i!=="json"&&i!=="native"&&i!=="native-request-init"&&i!=="text"&&(i="text"):i="json",e.responseType=i;const r=e.signal;return delete e.signal,globalThis.invokeStaticMessage("request",{url:t,options:e},{signal:r}).then(async n=>{let s,o,a,l,c;if(n.data)if(n.data instanceof ArrayBuffer){if(!(i!=="json"&&i!=="text"&&i!=="blob"||(s=new Blob([n.data]),i!=="json"&&i!=="text"||(cRe||(cRe=new FileReaderSync),l=cRe.readAsText(s),i!=="json")))){try{o=JSON.parse(l||null)}catch(h){const p={...h,url:t,requestOptions:e};throw new st("request:server",h.message,p)}if(o.error){const h={...o.error,url:t,requestOptions:e};throw new st("request:server",o.error.message,h)}}}else i==="native"&&(n.data.signal=r,a=await fetch(n.data.url,n.data),n.httpStatus=a.status);switch(i){case"blob":c=s;break;case"json":c=o;break;case"native":c=a;break;case"text":c=l;break;default:c=n.data}return{data:c,httpStatus:n.httpStatus,requestOptions:e,ssl:n.ssl,url:t}})}const mIi=Object.freeze(Object.defineProperty({__proto__:null,execute:fIi},Symbol.toStringTag,{value:"Module"})),ide="esri-identity-form",hb={base:ide,group:`${ide}__group`,label:`${ide}__label`,footer:`${ide}__footer`,esriInput:"esri-input",esriButton:"esri-button",esriButtonSecondary:"esri-button--secondary"},gIi="ArcGIS Online";let BP=class extends Hf{constructor(e,i){super(e,i),this._usernameInputNode=null,this._passwordInputNode=null,this.signingIn=!1,this.server=null,this.resource=null,this.error=null,this.oAuthPrompt=!1}render(){const{error:e,server:i,resource:r,signingIn:n,oAuthPrompt:s,messages:o}=this,a=Gi("div",{class:hb.group},f2(s?o.oAuthInfo:o.info,{server:i&&/\.arcgis\.com/i.test(i)?gIi:i,resource:`(${r||o.lblItem})`})),l=s?null:Gi("div",{class:hb.group,key:"username"},Gi("label",{class:hb.label},o.lblUser,Gi("input",{value:"",required:!0,autocomplete:"off",spellcheck:!1,type:"text",bind:this,afterCreate:BB,"data-node-ref":"_usernameInputNode",class:hb.esriInput}))),c=s?null:Gi("div",{class:hb.group,key:"password"},Gi("label",{class:hb.label},o.lblPwd,Gi("input",{value:"",required:!0,type:"password",bind:this,afterCreate:BB,"data-node-ref":"_passwordInputNode",class:hb.esriInput}))),h=Gi("div",{class:this.classes(hb.group,hb.footer)},Gi("input",{type:"submit",disabled:!!n,value:n?o.lblSigning:o.lblOk,class:hb.esriButton}),Gi("input",{type:"button",value:o.lblCancel,bind:this,onclick:this._cancel,class:this.classes(hb.esriButton,hb.esriButtonSecondary)})),p=e?Gi("div",null,e.details&&e.details.httpStatus?o.invalidUser:o.noAuthService):null;return Gi("form",{class:hb.base,bind:this,onsubmit:this._submit},a,p,l,c,h)}_cancel(){this._set("signingIn",!1),this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(e){e.preventDefault(),this._set("signingIn",!0);const i=this.oAuthPrompt?{}:{username:this._usernameInputNode&&this._usernameInputNode.value,password:this._passwordInputNode&&this._passwordInputNode.value};this.emit("submit",i)}};E([N(),Wf("esri/identity/t9n/identity")],BP.prototype,"messages",void 0),E([N()],BP.prototype,"signingIn",void 0),E([N()],BP.prototype,"server",void 0),E([N()],BP.prototype,"resource",void 0),E([N()],BP.prototype,"error",void 0),E([N()],BP.prototype,"oAuthPrompt",void 0),BP=E([dt("esri.identity.IdentityForm")],BP);const yIi=BP;/*! +* tabbable 6.1.2 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE -*/var xdt=["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])"],Mhe=xdt.join(","),Sdt=typeof Element>"u",_N=Sdt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Dhe=!Sdt&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},Fhe=function t(e,i){var r;i===void 0&&(i=!0);var n=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),s=n===""||n==="true",o=s||i&&e&&t(e.parentNode);return o},dEi=function(e){var i,r=e==null||(i=e.getAttribute)===null||i===void 0?void 0:i.call(e,"contenteditable");return r===""||r==="true"},Cdt=function(e,i,r){if(Fhe(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(Mhe));return i&&_N.call(e,Mhe)&&n.unshift(e),n=n.filter(r),n},Tdt=function t(e,i,r){for(var n=[],s=Array.from(e);s.length;){var o=s.shift();if(!Fhe(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,c=t(l,!0,r);r.flatten?n.push.apply(n,c):n.push({scopeParent:o,candidates:c})}else{var d=_N.call(o,Mhe);d&&r.filter(o)&&(i||!e.includes(o))&&n.push(o);var p=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),y=!Fhe(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(p&&y){var v=t(p===!0?o.children:p.children,!0,r);r.flatten?n.push.apply(n,v):n.push({scopeParent:o,candidates:v})}else s.unshift.apply(s,o.children)}}return n},Edt=function(e,i){return e.tabIndex<0&&(i||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||dEi(e))&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},pEi=function(e,i){return e.tabIndex===i.tabIndex?e.documentOrder-i.documentOrder:e.tabIndex-i.tabIndex},Idt=function(e){return e.tagName==="INPUT"},fEi=function(e){return Idt(e)&&e.type==="hidden"},mEi=function(e){var i=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return i},gEi=function(e,i){for(var r=0;rsummary:first-of-type"),o=s?e.parentElement:e;if(_N.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,c=Dhe(e);if(l&&!l.shadowRoot&&n(l)===!0)return Adt(e);e.assignedSlot?e=e.assignedSlot:!l&&c!==e.ownerDocument?e=c.host:e=l}e=a}if(bEi(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Adt(e);return!1},xEi=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var i=e.parentElement;i;){if(i.tagName==="FIELDSET"&&i.disabled){for(var r=0;r=0)},CEi=function t(e){var i=[],r=[];return e.forEach(function(n,s){var o=!!n.scopeParent,a=o?n.scopeParent:n,l=Edt(a,o),c=o?t(n.candidates):a;l===0?o?i.push.apply(i,c):i.push(a):r.push({documentOrder:s,tabIndex:l,item:n,isScope:o,content:c})}),r.sort(pEi).reduce(function(n,s){return s.isScope?n.push.apply(n,s.content):n.push(s.content),n},[]).concat(i)},TEi=function(e,i){i=i||{};var r;return i.getShadowRoot?r=Tdt([e],i.includeContainer,{filter:V3e.bind(null,i),flatten:!1,getShadowRoot:i.getShadowRoot,shadowRootFilter:SEi}):r=Cdt(e,i.includeContainer,V3e.bind(null,i)),CEi(r)},EEi=function(e,i){i=i||{};var r;return i.getShadowRoot?r=Tdt([e],i.includeContainer,{filter:Lhe.bind(null,i),flatten:!0,getShadowRoot:i.getShadowRoot}):r=Cdt(e,i.includeContainer,Lhe.bind(null,i)),r},khe=function(e,i){if(i=i||{},!e)throw new Error("No node provided");return _N.call(e,Mhe)===!1?!1:V3e(i,e)},IEi=xdt.concat("iframe").join(","),U3e=function(e,i){if(i=i||{},!e)throw new Error("No node provided");return _N.call(e,IEi)===!1?!1:Lhe(i,e)};/*! +*/var apt=["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])"],rde=apt.join(","),lpt=typeof Element>"u",wk=lpt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,nde=!lpt&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},sde=function t(e,i){var r;i===void 0&&(i=!0);var n=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),s=n===""||n==="true",o=s||i&&e&&t(e.parentNode);return o},vIi=function(e){var i,r=e==null||(i=e.getAttribute)===null||i===void 0?void 0:i.call(e,"contenteditable");return r===""||r==="true"},upt=function(e,i,r){if(sde(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(rde));return i&&wk.call(e,rde)&&n.unshift(e),n=n.filter(r),n},cpt=function t(e,i,r){for(var n=[],s=Array.from(e);s.length;){var o=s.shift();if(!sde(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,c=t(l,!0,r);r.flatten?n.push.apply(n,c):n.push({scopeParent:o,candidates:c})}else{var h=wk.call(o,rde);h&&r.filter(o)&&(i||!e.includes(o))&&n.push(o);var p=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),y=!sde(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(p&&y){var v=t(p===!0?o.children:p.children,!0,r);r.flatten?n.push.apply(n,v):n.push({scopeParent:o,candidates:v})}else s.unshift.apply(s,o.children)}}return n},hpt=function(e,i){return e.tabIndex<0&&(i||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||vIi(e))&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},_Ii=function(e,i){return e.tabIndex===i.tabIndex?e.documentOrder-i.documentOrder:e.tabIndex-i.tabIndex},dpt=function(e){return e.tagName==="INPUT"},bIi=function(e){return dpt(e)&&e.type==="hidden"},wIi=function(e){var i=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return i},xIi=function(e,i){for(var r=0;rsummary:first-of-type"),o=s?e.parentElement:e;if(wk.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,c=nde(e);if(l&&!l.shadowRoot&&n(l)===!0)return ppt(e);e.assignedSlot?e=e.assignedSlot:!l&&c!==e.ownerDocument?e=c.host:e=l}e=a}if(EIi(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return ppt(e);return!1},AIi=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var i=e.parentElement;i;){if(i.tagName==="FIELDSET"&&i.disabled){for(var r=0;r=0)},OIi=function t(e){var i=[],r=[];return e.forEach(function(n,s){var o=!!n.scopeParent,a=o?n.scopeParent:n,l=hpt(a,o),c=o?t(n.candidates):a;l===0?o?i.push.apply(i,c):i.push(a):r.push({documentOrder:s,tabIndex:l,item:n,isScope:o,content:c})}),r.sort(_Ii).reduce(function(n,s){return s.isScope?n.push.apply(n,s.content):n.push(s.content),n},[]).concat(i)},RIi=function(e,i){i=i||{};var r;return i.getShadowRoot?r=cpt([e],i.includeContainer,{filter:hRe.bind(null,i),flatten:!1,getShadowRoot:i.getShadowRoot,shadowRootFilter:PIi}):r=upt(e,i.includeContainer,hRe.bind(null,i)),OIi(r)},MIi=function(e,i){i=i||{};var r;return i.getShadowRoot?r=cpt([e],i.includeContainer,{filter:ode.bind(null,i),flatten:!0,getShadowRoot:i.getShadowRoot}):r=upt(e,i.includeContainer,ode.bind(null,i)),r},ade=function(e,i){if(i=i||{},!e)throw new Error("No node provided");return wk.call(e,rde)===!1?!1:hRe(i,e)},DIi=apt.concat("iframe").join(","),dRe=function(e,i){if(i=i||{},!e)throw new Error("No node provided");return wk.call(e,DIi)===!1?!1:ode(i,e)};/*! * focus-trap 7.2.0 * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE -*/function Pdt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function Odt(t){for(var e=1;e0){var r=e[e.length-1];r!==i&&r.pause()}var n=e.indexOf(i);n===-1||e.splice(n,1),e.push(i)},deactivateTrap:function(e,i){var r=e.indexOf(i);r!==-1&&e.splice(r,1),e.length>0&&e[e.length-1].unpause()}},REi=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},MEi=function(e){return e.key==="Escape"||e.key==="Esc"||e.keyCode===27},VK=function(e){return e.key==="Tab"||e.keyCode===9},DEi=function(e){return VK(e)&&!e.shiftKey},FEi=function(e){return VK(e)&&e.shiftKey},Mdt=function(e){return setTimeout(e,0)},Ddt=function(e,i){var r=-1;return e.every(function(n,s){return i(n)?(r=s,!1):!0}),r},UK=function(e){for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n1?fe-1:0),_e=1;_e=0)te=r.activeElement;else{var re=o.tabbableGroups[0],fe=re&&re.firstTabbableNode;te=fe||d("fallbackFocus")}if(!te)throw new Error("Your focus-trap needs to have at least one focusable element");return te},y=function(){if(o.containerGroups=o.containers.map(function(te){var re=TEi(te,s.tabbableOptions),fe=EEi(te,s.tabbableOptions);return{container:te,tabbableNodes:re,focusableNodes:fe,firstTabbableNode:re.length>0?re[0]:null,lastTabbableNode:re.length>0?re[re.length-1]:null,nextTabbableNode:function(_e){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ke=fe.findIndex(function(Ne){return Ne===_e});if(!(ke<0))return Ie?fe.slice(ke+1).find(function(Ne){return khe(Ne,s.tabbableOptions)}):fe.slice(0,ke).reverse().find(function(Ne){return khe(Ne,s.tabbableOptions)})}}}),o.tabbableGroups=o.containerGroups.filter(function(te){return te.tabbableNodes.length>0}),o.tabbableGroups.length<=0&&!d("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},v=function X(te){if(te!==!1&&te!==r.activeElement){if(!te||!te.focus){X(p());return}te.focus({preventScroll:!!s.preventScroll}),o.mostRecentlyFocusedNode=te,REi(te)&&te.select()}},S=function(te){var re=d("setReturnFocus",te);return re||(re===!1?!1:te)},I=function(te){var re=Nhe(te);if(!(c(re)>=0)){if(UK(s.clickOutsideDeactivates,te)){a.deactivate({returnFocus:s.returnFocusOnDeactivate&&!U3e(re,s.tabbableOptions)});return}UK(s.allowOutsideClick,te)||te.preventDefault()}},O=function(te){var re=Nhe(te),fe=c(re)>=0;fe||re instanceof Document?fe&&(o.mostRecentlyFocusedNode=re):(te.stopImmediatePropagation(),v(o.mostRecentlyFocusedNode||p()))},L=function(te){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,fe=Nhe(te);y();var ge=null;if(o.tabbableGroups.length>0){var _e=c(fe),Ie=_e>=0?o.containerGroups[_e]:void 0;if(_e<0)re?ge=o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:ge=o.tabbableGroups[0].firstTabbableNode;else if(re){var ke=Ddt(o.tabbableGroups,function(Oe){var Ae=Oe.firstTabbableNode;return fe===Ae});if(ke<0&&(Ie.container===fe||U3e(fe,s.tabbableOptions)&&!khe(fe,s.tabbableOptions)&&!Ie.nextTabbableNode(fe,!1))&&(ke=_e),ke>=0){var Ne=ke===0?o.tabbableGroups.length-1:ke-1,J=o.tabbableGroups[Ne];ge=J.lastTabbableNode}else VK(te)||(ge=Ie.nextTabbableNode(fe,!1))}else{var he=Ddt(o.tabbableGroups,function(Oe){var Ae=Oe.lastTabbableNode;return fe===Ae});if(he<0&&(Ie.container===fe||U3e(fe,s.tabbableOptions)&&!khe(fe,s.tabbableOptions)&&!Ie.nextTabbableNode(fe))&&(he=_e),he>=0){var xe=he===o.tabbableGroups.length-1?0:he+1,Pe=o.tabbableGroups[xe];ge=Pe.firstTabbableNode}else VK(te)||(ge=Ie.nextTabbableNode(fe))}}else ge=d("fallbackFocus");ge&&(VK(te)&&te.preventDefault(),v(ge))},N=function(te){if(MEi(te)&&UK(s.escapeDeactivates,te)!==!1){te.preventDefault(),a.deactivate();return}(s.isKeyForward(te)||s.isKeyBackward(te))&&L(te,s.isKeyBackward(te))},G=function(te){var re=Nhe(te);c(re)>=0||UK(s.clickOutsideDeactivates,te)||UK(s.allowOutsideClick,te)||(te.preventDefault(),te.stopImmediatePropagation())},V=function(){if(o.active)return Rdt.activateTrap(n,a),o.delayInitialFocusTimer=s.delayInitialFocus?Mdt(function(){v(p())}):v(p()),r.addEventListener("focusin",O,!0),r.addEventListener("mousedown",I,{capture:!0,passive:!1}),r.addEventListener("touchstart",I,{capture:!0,passive:!1}),r.addEventListener("click",G,{capture:!0,passive:!1}),r.addEventListener("keydown",N,{capture:!0,passive:!1}),a},Y=function(){if(o.active)return r.removeEventListener("focusin",O,!0),r.removeEventListener("mousedown",I,!0),r.removeEventListener("touchstart",I,!0),r.removeEventListener("click",G,!0),r.removeEventListener("keydown",N,!0),a};return a={get active(){return o.active},get paused(){return o.paused},activate:function(te){if(o.active)return this;var re=l(te,"onActivate"),fe=l(te,"onPostActivate"),ge=l(te,"checkCanFocusTrap");ge||y(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,re&&re();var _e=function(){ge&&y(),V(),fe&&fe()};return ge?(ge(o.containers.concat()).then(_e,_e),this):(_e(),this)},deactivate:function(te){if(!o.active)return this;var re=Odt({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},te);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,Y(),o.active=!1,o.paused=!1,Rdt.deactivateTrap(n,a);var fe=l(re,"onDeactivate"),ge=l(re,"onPostDeactivate"),_e=l(re,"checkCanReturnFocus"),Ie=l(re,"returnFocus","returnFocusOnDeactivate");fe&&fe();var ke=function(){Mdt(function(){Ie&&v(S(o.nodeFocusedBeforeActivation)),ge&&ge()})};return Ie&&_e?(_e(S(o.nodeFocusedBeforeActivation)).then(ke,ke),this):(ke(),this)},pause:function(){return o.paused||!o.active?this:(o.paused=!0,Y(),this)},unpause:function(){return!o.paused||!o.active?this:(o.paused=!1,y(),V(),this)},updateContainerElements:function(te){var re=[].concat(te).filter(Boolean);return o.containers=re.map(function(fe){return typeof fe=="string"?r.querySelector(fe):fe}),o.active&&y(),this}},a.updateContainerElements(e),a};const bN="esri-identity-modal",eE={base:bN,open:`${bN}--open`,closed:`${bN}--closed`,title:`${bN}__title`,dialog:`${bN}__dialog`,content:`${bN}__content`,closeButton:`${bN}__close-button`,iconClose:"esri-icon-close"};let mD=class extends Gf{constructor(e,i){super(e,i),this.container=document.createElement("div"),this.content=null,this.open=!1,this._focusTrap=null,this._close=()=>{this.open=!1},document.body.appendChild(this.container),this.addHandles(Qi(()=>this.open,()=>this._toggleFocusTrap()))}destroy(){this._destroyFocusTrap()}get title(){return this.messages?.auth.signIn}render(){const e=this.id,{open:i,content:r,title:n,messages:s}=this,o=i&&!!r,a={[eE.open]:o,[eE.closed]:!o},l=ki("button",{class:eE.closeButton,"aria-label":s.close,title:s.close,bind:this,onclick:this._close,type:"button"},ki("span",{"aria-hidden":"true",class:eE.iconClose})),c=`${e}_title`,d=`${e}_content`,p=n?ki("h1",{id:c,class:eE.title},n):null,y=o?ki("div",{bind:this,class:eE.dialog,role:"dialog","aria-labelledby":c,"aria-describedby":d,afterCreate:this._createFocusTrap},l,p,this._renderContent(d)):null;return ki("div",{tabIndex:-1,class:this.classes(eE.base,a)},y)}_destroyFocusTrap(){this._focusTrap?.deactivate({onDeactivate:()=>{}}),this._focusTrap=null}_toggleFocusTrap(){const{_focusTrap:e,open:i}=this;e&&(i?e.activate():e.deactivate())}_createFocusTrap(e){this._destroyFocusTrap();const i=requestAnimationFrame(()=>{this._focusTrap=kEi(e,{initialFocus:"input",onDeactivate:this._close}),this._toggleFocusTrap()});this.addHandles(KI(()=>cancelAnimationFrame(i)))}_renderContent(e){const i=this.content;return typeof i=="string"?ki("div",{class:eE.content,id:e,innerHTML:i}):XEe(i)?ki("div",{class:eE.content,id:e},i.render()):i instanceof HTMLElement?ki("div",{class:eE.content,id:e,bind:i,afterCreate:this._attachToNode}):null}_attachToNode(e){const i=this;e.appendChild(i)}};E([k({readOnly:!0})],mD.prototype,"container",void 0),E([k()],mD.prototype,"content",void 0),E([k()],mD.prototype,"open",void 0),E([k(),Vf("esri/t9n/common")],mD.prototype,"messages",void 0),E([k()],mD.prototype,"title",null),mD=E([ht("esri.identity.IdentityModal")],mD);const Fdt=mD,j3e="esriJSAPIOAuth";let z3e=class{constructor(e,i){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=i,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 i=Date.now();this.expires>i&&(this.expires-i)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}}return e}save(){if(!this.storage)return!1;const e=this._load(),i=this.oAuthInfo;if(i&&i.authNamespace&&i.portalUrl){let r=e[i.authNamespace];r||(r=e[i.authNamespace]={}),this.appId||(this.appId=i.appId),r[i.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(j3e,JSON.stringify(e))}catch(n){return console.warn(n),!1}return!0}return!1}destroy(){const e=this._load(),i=this.oAuthInfo;if(i&&i.appId&&i.portalUrl&&(this.expires==null||this.expires>Date.now())&&(this.refreshToken||this.token)){const r=i.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",i.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(i&&i.authNamespace&&i.portalUrl&&this.storage){const r=e[i.authNamespace];if(r){delete r[i.portalUrl];try{this.storage.setItem(j3e,JSON.stringify(e))}catch(n){console.log(n)}}}i&&(i._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),i=this.oAuthInfo;if(i&&i.authNamespace&&i.portalUrl){let r=e[i.authNamespace];r&&(r=r[i.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 i=this.storage.getItem(j3e);if(i)try{e=JSON.parse(i)}catch(r){console.warn(r)}}return e}};z3e.prototype.declaredClass="esri.identity.OAuthCredential";var H3e;let ay=H3e=class extends Ni{constructor(t){super(t),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 H3e.fromJSON(this.toJSON())}};E([k({json:{write:!0}})],ay.prototype,"appId",void 0),E([k({json:{write:!0}})],ay.prototype,"authNamespace",void 0),E([k({json:{write:!0}})],ay.prototype,"expiration",void 0),E([k({json:{write:!0}})],ay.prototype,"flowType",void 0),E([k({json:{write:!0}})],ay.prototype,"forceLogin",void 0),E([k({json:{write:!0}})],ay.prototype,"forceUserId",void 0),E([k({json:{write:!0}})],ay.prototype,"locale",void 0),E([k({json:{write:!0}})],ay.prototype,"minTimeUntilExpiration",void 0),E([k({json:{write:!0}})],ay.prototype,"popup",void 0),E([k({json:{write:!0}})],ay.prototype,"popupCallbackUrl",void 0),E([k({json:{write:!0}})],ay.prototype,"popupWindowFeatures",void 0),E([k({json:{write:!0}})],ay.prototype,"portalUrl",void 0),E([k({json:{write:!0}})],ay.prototype,"preserveUrlHash",void 0),E([k({json:{write:!0}})],ay.prototype,"userId",void 0),ay=H3e=E([ht("esri.identity.OAuthInfo")],ay);const Ldt=ay;let lb=class extends Ni{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}};E([k({json:{write:!0}})],lb.prototype,"adminTokenServiceUrl",void 0),E([k({json:{write:!0}})],lb.prototype,"currentVersion",void 0),E([k({json:{write:!0}})],lb.prototype,"hasPortal",void 0),E([k({json:{write:!0}})],lb.prototype,"hasServer",void 0),E([k({json:{write:!0}})],lb.prototype,"owningSystemUrl",void 0),E([k({json:{write:!0}})],lb.prototype,"owningTenant",void 0),E([k({json:{write:!0}})],lb.prototype,"server",void 0),E([k({json:{write:!0}})],lb.prototype,"shortLivedTokenValidity",void 0),E([k({json:{write:!0}})],lb.prototype,"tokenServiceUrl",void 0),E([k({json:{write:!0}})],lb.prototype,"webTierAuth",void 0),lb=E([ht("esri.identity.ServerInfo")],lb);const W3e=lb,$he={},kdt=t=>{const e=new Ug(t.owningSystemUrl).host,i=new Ug(t.server).host,r=/.+\.arcgis\.com$/i;return r.test(e)&&r.test(i)},q3e=(t,e)=>!!(kdt(t)&&e&&e.some(i=>i.test(t.server)));let Bhe=null,Ghe=null;try{Bhe=window.localStorage,Ghe=window.sessionStorage}catch{}let Ndt=class extends cd{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.formConstructor=hEi,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin=window.origin!=="null"?window.origin:window.location.origin,this._appUrlObj=sa(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 i=this.serverInfos;i?(e=e.filter(r=>!this.findServerInfo(r.server)),this.serverInfos=i.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 i=this.oAuthInfos;if(i){for(const r of e){const n=this.findOAuthInfo(r.portalUrl);n&&i.splice(i.indexOf(n),1)}this.oAuthInfos=i.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const i=this._sanitizeUrl(e.server),r=this._isServerRsrc(i);let n,s=this.findServerInfo(i),o=!0;s||(s=new W3e,s.server=this._getServerInstanceRoot(i),r?s.hasServer=!0:(s.tokenServiceUrl=this._getTokenSvcUrl(i),s.hasPortal=!0),this.registerServers([s])),n=this._findCredential(i),n?(delete e.server,Object.assign(n,e),o=!1):(n=new Sd({userId:e.userId,server:s.server,token:e.token,expires:e.expires,ssl:e.ssl,scope:r?"server":"portal"}),n.resources=[i],this.credentials.push(n)),n.emitTokenChange(!1),o||n.refreshServerTokens()}toJSON(){return Tre({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 i=e.serverInfos,r=e.oAuthInfos,n=e.credentials;if(i){const s=[];i.forEach(o=>{o.server&&o.tokenServiceUrl&&s.push(o.declaredClass?o:new W3e(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 Sd(s)).emitTokenChange(),this.credentials.push(s))})}findServerInfo(e){let i;e=this._sanitizeUrl(e);for(const r of this.serverInfos)if(this._hasSameServerInstance(r.server,e)){i=r;break}return i}findOAuthInfo(e){let i;e=this._sanitizeUrl(e);for(const r of this.oAuthInfos)if(this._hasSameServerInstance(r.portalUrl,e)){i=r;break}return i}findCredential(e,i){if(!e)return;let r;e=this._sanitizeUrl(e);const n=this._isServerRsrc(e)?"server":"portal";if(i){for(const s of this.credentials)if(this._hasSameServerInstance(s.server,e)&&i===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,i){let r,n,s=!0;i&&(r=!!i.token,n=i.error,s=i.prompt!==!1),i={...i},e=this._sanitizeUrl(e);const o=new AbortController,a=Mf();if(i.signal&&ep(i.signal,()=>{o.abort()}),ep(o,()=>{a.reject(new st("identity-manager:user-aborted","ABORTED"))}),bm(o))return a.promise;i.signal=o.signal;const l=this._isAdminResource(e),c=r?this.findCredential(e):null;let d;if(c&&n&&n.details&&n.details.httpStatus===498)c.destroy();else if(c)return d=new st("identity-manager:not-authorized","You are currently signed in as: '"+c.userId+"'. You do not have access to this resource: "+e,{error:n}),a.reject(d),a.promise;const p=this._findCredential(e,i);if(p)return a.resolve(p),a.promise;let y=this.findServerInfo(e);if(y)!y.hasServer&&this._isServerRsrc(e)&&(y._restInfoPms=this._getTokenSvcUrl(e),y.hasServer=!0);else{const v=this._getTokenSvcUrl(e);if(!v)return d=new st("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),a.reject(d),a.promise;y=new W3e,y.server=this._getServerInstanceRoot(e),typeof v=="string"?(y.tokenServiceUrl=v,y.hasPortal=!0):(y._restInfoPms=v,y.hasServer=!0),this.registerServers([y])}return y.hasPortal&&y._selfReq===void 0&&(s||Gy(y.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(v=>v.tokenServiceUrl===y.tokenServiceUrl))&&(y._selfReq={owningTenant:i&&i.owningTenant,selfDfd:this._getPortalSelf(y.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,y,i,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,i,r){const n=this._rePortalTokenSvc.test(e.tokenServiceUrl),s=new Ug(this._appOrigin),o=e.shortLivedTokenValidity;let a,l,c,d,p,y,v,S;i&&(S=this.tokenValidity||o||this._defaultTokenValidity,S>o&&o>0&&(S=o)),r&&(a=r.isAdmin,l=r.serverUrl,c=r.token,y=r.signal,v=r.ssl,e.customParameters=r.customParameters),a?d=e.adminTokenServiceUrl:(d=e.tokenServiceUrl,p=new Ug(d.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!v&&s.scheme==="http"&&(Gy(s.uri,d,!0)||p.scheme==="https"&&s.host===p.host&&s.port==="7080"&&p.port==="7443")&&(d=d.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const I={query:{request:"getToken",username:i?.username,password:i?.password,serverUrl:l,token:c,expiration:S,referer:a||n?this._appOrigin:null,client:a?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,r),signal:y,...r?.ioArgs};return n||(I.withCredentials=!1),ir(d,I).then(O=>{const L=O.data;if(!L||!L.token)return new st("identity-manager:authentication-failed","Unable to generate token");const N=e.server;return $he[N]||($he[N]={}),i&&($he[N][i.username]=i.password),L.validity=S,L})}isBusy(){return!!this._busy}checkSignInStatus(e){return this.checkAppAccess(e,"").then(i=>i.credential)}checkAppAccess(e,i,r){let n=!1;return this.getCredential(e,{prompt:!1}).then(s=>{let o;const a={f:"json"};if(s.scope==="portal")if(i&&(this._doPortalSignIn(e)||r&&r.force))o=s.server+"/sharing/rest/oauth2/validateAppAccess",a.client_id=i;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),ir(o,{query:a,authMode:"anonymous"}).then(l=>{if(l.data.valid===!1)throw new st("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 c=l.details&&l.details.httpStatus;if(c===498)throw s.destroy(),new st("identity-manager:not-authenticated","User is not signed in.");if(c===400)throw new st("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(q3(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,i,r={}){const n=Mf(),s=()=>{l?.remove(),c?.remove(),d?.remove(),a?.destroy(),this.dialog?.destroy(),this.dialog=a=l=c=d=null},o=()=>{s(),this._oAuthDfd=null,n.reject(new st("identity-manager:user-aborted","ABORTED"))};r.signal&&ep(r.signal,()=>{o()});let a=new this.formConstructor;a.resource=this.getResourceName(e),a.server=i.server,this.dialog=new Fdt,this.dialog.content=a,this.dialog.open=!0,this.emit("dialog-create");let l=a.on("cancel",o),c=Qi(()=>this.dialog.open,o),d=a.on("submit",p=>{this.generateToken(i,p,{isAdmin:r.isAdmin,signal:r.signal}).then(y=>{s();const v=new Sd({userId:p.username,server:i.server,token:y.token,expires:y.expires!=null?Number(y.expires):null,ssl:!!y.ssl,isAdmin:r.isAdmin,validity:y.validity});n.resolve(v)}).catch(y=>{a.error=y,a.signingIn=!1})});return n.promise}oAuthSignIn(e,i,r,n){this._oAuthDfd=Mf();const s=this._oAuthDfd;let o;n?.signal&&ep(n.signal,()=>{const S=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;S&&!S.closed?S.close():this.dialog&&y()}),s.resUrl_=e,s.sinfo_=i,s.oinfo_=r;const a=r._oAuthCred;if(a.storage&&(r.flowType==="authorization-code"||r.flowType==="auto"&&!r.popup&&i.currentVersion>=8.4)){let S=crypto.getRandomValues(new Uint8Array(32));o=r1e(S),a.codeVerifier=o,S=crypto.getRandomValues(new Uint8Array(32)),a.stateUID=r1e(S),a.save()||(a.codeVerifier=o=null)}else a.codeVerifier=null;let l,c,d,p;this._getCodeChallenge(o).then(S=>{const I=!n||n.oAuthPopupConfirmation!==!1;r.popup&&I?(l=new this.formConstructor,l.oAuthPrompt=!0,l.server=i.server,this.dialog=new Fdt,this.dialog.content=l,this.dialog.open=!0,this.emit("dialog-create"),c=l.on("cancel",y),d=Qi(()=>this.dialog.open,y),p=l.on("submit",()=>{v(),this._doOAuthSignIn(e,i,r,S)})):this._doOAuthSignIn(e,i,r,S)});const y=()=>{v(),this._oAuthDfd=null,s.reject(new st("identity-manager:user-aborted","ABORTED"))},v=()=>{c?.remove(),d?.remove(),p?.remove(),l?.destroy(),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=QI(window,"message",i=>{if((i.origin===this._appOrigin||i.origin.endsWith(".arcgis.com"))&&i.data?.type==="arcgis:auth:requestCredential"){const r=i.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}},i.origin)}).catch(n=>{r.postMessage({type:"arcgis:auth:error",error:{name:n.name,message:n.message}},i.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=q3(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 i=window.location.search;if(i){i.charAt(0)==="?"&&(i=i.substring(1));const r=q3(i);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=Uv(s),a=window.location.pathname+(o?`?${o}`:"")+(r.state?.hash||"");window.history.replaceState(window.history.state,"",a)}}}_getOAuthToken(e,i,r,n,s){return e=e.replace(/^http:/i,"https:"),ir(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:n&&s?{grant_type:"authorization_code",code:i,redirect_uri:n,client_id:r,code_verifier:s}:{grant_type:"refresh_token",refresh_token:i,client_id:r}}).then(o=>o.data)}_getCodeChallenge(e){if(e&&globalThis.isSecureContext){const i=new TextEncoder().encode(e);return crypto.subtle.digest("SHA-256",i).then(r=>r1e(new Uint8Array(r)))}return Promise.resolve(null)}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const i=new st("identity-manager:user-aborted","ABORTED");this._errbackFunc(i)}}_findCredential(e,i){let r,n,s,o,a=-1;const l=i&&i.token,c=i&&i.resource,d=this._isServerRsrc(e)?"server":"portal",p=this.credentials.filter(y=>this._hasSameServerInstance(y.server,e)&&y.scope===d);if(e=c||e,p.length)if(p.length===1){if(r=p[0],s=this.findServerInfo(r.server),n=s&&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 y,v;if(p.some(S=>(v=this._getIdenticalSvcIdx(e,S),v!==-1&&(y=S,s=this.findServerInfo(y.server),n=s&&s.owningSystemUrl,o=n?this.findCredential(n,y.userId):void 0,a=v,!0))),l)y&&(y.resources.splice(a,1),this._removeResource(e,o));else if(y)return this._addResource(e,o),y}}_findOAuthInfo(e){let i=this.findOAuthInfo(e);if(!i){for(const r of this.oAuthInfos)if(this._isIdProvider(r.portalUrl,e)){i=r;break}}return i}_addResource(e,i){i&&this._getIdenticalSvcIdx(e,i)===-1&&i.resources.push(e)}_removeResource(e,i){let r=-1;i&&(r=this._getIdenticalSvcIdx(e,i),r>-1&&i.resources.splice(r,1))}_useProxy(e,i){return i&&i.isAdmin&&!Gy(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&String(e.currentVersion)==="10.1"&&!Gy(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const i=new Ug(e);return i.scheme+"://"+i.host+(i.port!=null?":"+i.port:"")}_getServerInstanceRoot(e){const i=e.toLowerCase();let r=i.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||OVe(i)||(r=i.indexOf("/sharing")),r===-1&&i.substr(-1)==="/"&&(r=i.length-1),r>-1?e.substring(0,r):e}_hasSameServerInstance(e,i){return e.substr(-1)==="/"&&(e=e.slice(0,-1)),e=e.toLowerCase(),i=this._getServerInstanceRoot(i).toLowerCase(),e=this._normalizeAGOLorgDomain(e),i=this._normalizeAGOLorgDomain(i),(e=e.substr(e.indexOf(":")))===(i=i.substr(i.indexOf(":")))}_normalizeAGOLorgDomain(e){const i=/^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 i.test(e)?e=e.replace(i,"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 i=(na.request.proxyUrl||"").toLowerCase(),r=i?e.toLowerCase().indexOf(i+"?"):-1;return r!==-1&&(e=e.substring(r+i.length+1)),e=Uy(e),sa(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,i){let r=!1;if(this._isRESTService(e)&&this._isRESTService(i)){const n=this._getSuffix(e).toLowerCase(),s=this._getSuffix(i).toLowerCase();if(r=n===s,!r){const o=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;r=n.replace(o,"$1")===s.replace(o,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(i)?r=!0:this._isServerRsrc(e)||this._isServerRsrc(i)||!this._isPortalDomain(e)||(r=!0);return r}_isPortalDomain(e){const i=new Ug(e.toLowerCase()),r=this._portalConfig;let n=this._gwDomains.some(s=>s.regex.test(i.uri));return!n&&r&&(n=this._hasSameServerInstance(this._getServerInstanceRoot(r.restBaseUrl),i.uri)),n||na.portalUrl&&(n=Gy(i,na.portalUrl,!0)),n||(n=this._portals.some(s=>this._hasSameServerInstance(s,i.uri))),n=n||this._agsPortal.test(i.path),n}_isIdProvider(e,i){let r=-1,n=-1;this._gwDomains.forEach((o,a)=>{r===-1&&o.regex.test(e)&&(r=a),n===-1&&o.regex.test(i)&&(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(i),a=o&&o.owningSystemUrl;a&&kdt(o)&&this._isPortalDomain(a)&&this._isIdProvider(e,a)&&(s=!0)}return s}_getIdenticalSvcIdx(e,i){let r=-1;for(let n=0;no.data),{adminUrl:i,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 Ug(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,i,r){const n=i._oAuthCred;if(e.code){const o=n.codeVerifier;return n.codeVerifier=null,n.stateUID=null,n.save(),this._getOAuthToken(r.server,e.code,i.appId,this._getRedirectURI(i,!0),o).then(a=>{const l=new Sd({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 i.userId=l.userId,n.storage=a.persist?Bhe:Ghe,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 Sd({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 i.userId=s.userId,n.storage=e.persist?Bhe:Ghe,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 i=this._oAuthDfd;if(this._oAuthDfd=null,i)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const r=e.error==="access_denied",n=new st(r?"identity-manager:user-aborted":"identity-manager:authentication-failed",r?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);i.reject(n)}else this._processOAuthResponseParams(e,i.oinfo_,i.sinfo_).then(r=>{i.resolve(r)}).catch(r=>{i.reject(r)})}_setOAuthResponseQueryString(e){e&&(e.charAt(0)==="?"&&(e=e.substring(1)),this._processOAuthPopupParams(q3(e)))}_exchangeToken(e,i,r){return ir(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:i,token:r}}).then(n=>n.data.token)}_getPlatformSelf(e,i){return e=e.replace(/^http:/i,"https:"),ir(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":i,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0}).then(r=>r.data)}_getPortalSelf(e,i){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(i)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),ir(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(n=>n.data))}_doPortalSignIn(e){const i=this._portalConfig,r=window.location.href,n=this.findServerInfo(e);return!(!i&&!this._isPortalDomain(r)||!(n?n.hasPortal||n.owningSystemUrl&&this._isPortalDomain(n.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(r,e)||i&&(this._hasSameServerInstance(this._getServerInstanceRoot(i.restBaseUrl),e)||this._isIdProvider(i.restBaseUrl,e))||Gy(r,e,!0)))}_checkProtocol(e,i,r,n){let s=!0;const o=n?i.adminTokenServiceUrl:i.tokenServiceUrl;return o.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&BH(o)&&(s=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:i}),!s)&&r(new st("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),s}_enqueue(e,i,r,n,s,o){return n||(n=Mf()),n.resUrl_=e,n.sinfo_=i,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 i=c=>{const d=e.options_&&e.options_.resource,p=e.resUrl_,y=e.refresh_;let v=!1;this.credentials.includes(c)||(y&&this.credentials.includes(y)?(y.userId=c.userId,y.token=c.token,y.expires=c.expires,y.validity=c.validity,y.ssl=c.ssl,y.creationTime=c.creationTime,v=!0,c=y):this.credentials.push(c)),c.resources||(c.resources=[]),c.resources.includes(d||p)||c.resources.push(d||p),c.scope=this._isServerRsrc(p)?"server":"portal",c.emitTokenChange();const S=this._soReqs,I={};this._soReqs=[],S.forEach(O=>{if(!this._isIdenticalService(p,O.resUrl_)){const L=this._getSuffix(O.resUrl_);I[L]||(I[L]=!0,c.resources.push(O.resUrl_))}}),e.resolve(c),S.forEach(O=>{this._hasSameServerInstance(this._getServerInstanceRoot(p),O.resUrl_)?O.resolve(c):this._soReqs.push(O)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,v||this.emit("credential-create",{credential:c}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=c=>{e.reject(c),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=(c,d,p,y)=>{const v=e.sinfo_,S=!e.options_||e.options_.prompt!==!1,I=v.hasPortal&&this._findOAuthInfo(e.resUrl_);let O,L;if(c)i(new Sd({userId:c,server:v.server,token:p||null,expires:y!=null?Number(y):null,ssl:!!d}));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 N=QI(window,"message",G=>{G.source===window.parent&&G.data&&(G.data.type==="arcgis:auth:credential"?(N.remove(),G.data.credential.expires{N.remove()})}else if(I){let N=I._oAuthCred;if(!N){const G=new z3e(I,Bhe),V=new z3e(I,Ghe);G.isValid()&&V.isValid()?G.expires>V.expires?(N=G,V.destroy()):(N=V,G.destroy()):N=G.isValid()?G:V,I._oAuthCred=N}if(N.isValid()){O=new Sd({userId:N.userId,server:v.server,token:N.token,expires:N.expires,ssl:N.ssl,_oAuthCred:N});const G=I.appId!==N.appId&&this._doPortalSignIn(e.resUrl_);G||N.refreshToken?(e._pendingDfd=N.refreshToken?this._getOAuthToken(v.server,N.refreshToken,N.appId).then(V=>(O.expires=Date.now()+1e3*V.expires_in,O.token=V.access_token,O)):Promise.resolve(O),e._pendingDfd.then(V=>G?this._exchangeToken(V.server,I.appId,V.token).then(Y=>(V.token=Y,V)).catch(()=>V):V).then(V=>{i(V)}).catch(()=>{N?.destroy(),n()})):i(O)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(I.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===N.stateUID&&N.codeVerifier)){const G=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(G,I,v).then(V=>{i(V)}).catch(r)}else{const G=()=>{S?e._pendingDfd=this.oAuthSignIn(e.resUrl_,v,I,e.options_).then(i,r):(L=new st("identity-manager:not-authenticated","User is not signed in."),r(L))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(v.server,I.appId).then(V=>{Gy(V.portalUrl,this._appOrigin,!0)?(O=new Sd({userId:V.username,server:v.server,expires:Date.now()+1e3*V.expires_in,token:V.token}),i(O)):G()}).catch(G):G()}}else if(S){if(this._checkProtocol(e.resUrl_,v,r,e.admin_)){let N=e.options_;e.admin_&&(N=N||{},N.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,v,N).then(i,r)}}else L=new st("identity-manager:not-authenticated","User is not signed in."),r(L)},s=()=>{const c=e.sinfo_,d=c.owningSystemUrl,p=e.options_;let y,v,S,I;if(p&&(y=p.token,v=p.error,S=p.prompt),I=this._findCredential(d,{token:y,resource:e.resUrl_}),!I){for(const O of this.credentials)if(this._isIdProvider(d,O.server)){I=O;break}}if(I){const O=this.findCredential(e.resUrl_,I.userId);if(O)i(O);else if(q3e(c,this._legacyFed)){const L=I.toJSON();L.server=c.server,L.resources=null,i(new Sd(L))}else(e._pendingDfd=this.generateToken(this.findServerInfo(I.server),null,{serverUrl:e.resUrl_,token:I.token,signal:e.options_.signal,ssl:I.ssl})).then(L=>{i(new Sd({userId:I?.userId,server:c.server,token:L.token,expires:L.expires!=null?Number(L.expires):null,ssl:!!L.ssl,isAdmin:e.admin_,validity:L.validity}))},r)}else this._busy=null,y&&(e.options_.token=null),(e._pendingDfd=this.getCredential(d.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:c.owningTenant,signal:e.options_.signal,token:y,error:v,prompt:S})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},O=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(O)})};this._errbackFunc=r;const o=e.sinfo_.owningSystemUrl,a=this._isServerRsrc(e.resUrl_),l=e.sinfo_._restInfoPms;l?l.promise.then(c=>{const d=e.sinfo_;if(d._restInfoPms){d.adminTokenServiceUrl=d._restInfoPms.adminUrl,d._restInfoPms=null,d.tokenServiceUrl=(Xx("authInfo.tokenServicesUrl",c)||Xx("authInfo.tokenServiceUrl",c)||Xx("tokenServiceUrl",c))??null,d.shortLivedTokenValidity=Xx("authInfo.shortLivedTokenValidity",c)??null,d.currentVersion=c.currentVersion,d.owningTenant=c.owningTenant;const p=d.owningSystemUrl=c.owningSystemUrl;p&&this._portals.push(p)}a&&d.owningSystemUrl?s():n()},()=>{e.sinfo_._restInfoPms=null;const c=new st("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");r(c)}):a&&o?s():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(c=>{const d={};let p,y,v,S;return c&&(p=c.user&&c.user.username,d.username=p,d.allSSL=c.allSSL,y=c.supportsOAuth,S=parseFloat(c.currentVersion),c.portalMode==="multitenant"&&(v=c.customBaseUrl),e.sinfo_.currentVersion=S),e.sinfo_.webTierAuth=!!p,p&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:d.allSSL}).catch(()=>null).then(I=>(d.portalToken=I&&I.token,d.tokenExpiration=I&&I.expires,d)):!p&&y&&S>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:v,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>d):d}).catch(()=>null).then(c=>{e.sinfo_._selfReq=null,c?n(c.username,c.allSSL,c.portalToken,c.tokenExpiration):n()}):n()}_generateOAuthInfo(e){let i,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,i=ir(r+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new Ldt({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})})):i=Promise.resolve(),i.then(()=>{if(this._defaultOAuthInfo)return n=n.replace(/^http:/i,"https:"),ir(n+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:o,client_id:this._defaultOAuthInfo.appId,redirect_uri:Vy(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(l=>{if(l.data.valid){const c=this._defaultOAuthInfo.clone();l.data.urlKey&&s?c.portalUrl="https://"+l.data.urlKey.toLowerCase()+"."+s:c.portalUrl=n,c.popup=window!==window.top||!(Gy(n,this._appOrigin)||this._gwDomains.some(d=>d.regex.test(n)&&d.regex.test(this._appOrigin))),this.oAuthInfos.push(c)}})})}_doOAuthSignIn(e,i,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",c=l+"?"+Uv(a);if(r.popup){const d=window.open(c,"esriJSAPIOAuth",r.popupWindowFeatures);if(d)d.focus(),this._oAuthDfd.oAuthWin_=d,this._oAuthIntervalId=setInterval(()=>{if(d.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const p=this._oAuthDfd;if(p){const y=new st("identity-manager:user-aborted","ABORTED");p.reject(y)}}},500),this._oAuthOnPopupHandle=QI(window,["arcgis:auth:hash","arcgis:auth:location:search"],p=>{p.type==="arcgis:auth:hash"?this.setOAuthResponseHash(p.detail):this._setOAuthResponseQueryString(p.detail)});else{const p=new st("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(p)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:a,authorizeUrl:l,resourceUrl:e,serverInfo:i,oAuthInfo:r}):window.location.href=c}_getRedirectURI(e,i){const r=window.location.href.replace(/#.*$/,"");if(e.popup)return Vy(e.popupCallbackUrl);if(i){const n=sa(r);return n.query&&["code","error","error_description","message_code","persist","state"].forEach(s=>{delete n.query[s]}),jy(n.path,n.query)}return r}};Ndt.prototype.declaredClass="esri.identity.IdentityManagerBase";let Sd=class extends cd.EventedAccessor{constructor(e){super(e),this._oAuthCred=null,this.tokenRefreshBuffer=2,e&&e._oAuthCred&&(this._oAuthCred=e._oAuthCred)}initialize(){this.resources=this.resources||[],this.creationTime==null&&(this.creationTime=Date.now())}refreshToken(){const e=Ro.findServerInfo(this.server),i=e&&e.owningSystemUrl,r=!!i&&this.scope==="server",n=r&&q3e(e,Ro._legacyFed),s=e.webTierAuth,o=s&&Ro.normalizeWebTierAuth,a=$he[this.server],l=a&&a[this.userId];let c,d=this.resources&&this.resources[0],p=r?Ro.findServerInfo(i):null,y={username:this.userId,password:l};if(s&&!o)return;r&&!p&&Ro.serverInfos.some(S=>(Ro._isIdProvider(i,S.server)&&(p=S),!!p));const v=p?Ro.findCredential(p.server,this.userId):null;if(!r||v){if(!n){if(r)c={serverUrl:d,token:v&&v.token,ssl:v&&v.ssl};else if(o)y=null,c={ssl:this.ssl};else{if(!l){let S;return d&&(d=Ro._sanitizeUrl(d),this._enqueued=1,S=Ro._enqueue(d,e,null,null,this.isAdmin,this),S.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),S}this.isAdmin&&(c={isAdmin:!0})}return Ro.generateToken(r?p:e,r?null:y,c).then(S=>{this.token=S.token,this.expires=S.expires!=null?Number(S.expires):null,this.creationTime=Date.now(),this.validity=S.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}v?.refreshToken()}}refreshServerTokens(){this.scope==="portal"&&Ro.credentials.forEach(e=>{const i=Ro.findServerInfo(e.server),r=i&&i.owningSystemUrl;e!==this&&e.userId===this.userId&&r&&e.scope==="server"&&(Ro._hasSameServerInstance(this.server,r)||Ro._isIdProvider(r,this.server))&&(q3e(i,Ro._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 i=this.server&&Ro.findServerInfo(this.server),r=i&&i.owningSystemUrl,n=r&&Ro.findServerInfo(r);e===!1||r&&this.scope!=="portal"&&(!n||!n.webTierAuth||Ro.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=Ro.credentials.indexOf(this);e>-1&&Ro.credentials.splice(e,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const e=Tre({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}),i=this.resources;return i&&i.length>0&&(e.resources=i.slice()),e}_startRefreshTimer(){clearTimeout(this._refreshTimer);const e=6e4*this.tokenRefreshBuffer,i=2**31-1;let r=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();r<0?r=0:r>i&&(r=i),this._refreshTimer=setTimeout(this.refreshToken.bind(this),r>e?r-e:r)}};E([k()],Sd.prototype,"creationTime",void 0),E([k()],Sd.prototype,"expires",void 0),E([k()],Sd.prototype,"isAdmin",void 0),E([k()],Sd.prototype,"oAuthState",void 0),E([k()],Sd.prototype,"resources",void 0),E([k()],Sd.prototype,"scope",void 0),E([k()],Sd.prototype,"server",void 0),E([k()],Sd.prototype,"ssl",void 0),E([k()],Sd.prototype,"token",void 0),E([k()],Sd.prototype,"tokenRefreshBuffer",void 0),E([k()],Sd.prototype,"userId",void 0),E([k()],Sd.prototype,"validity",void 0),Sd=E([ht("esri.identity.Credential")],Sd);let $dt=class extends Ndt{};$dt.prototype.declaredClass="esri.identity.IdentityManager";const Bdt=new $dt;_$t(Bdt);const NEi=Object.freeze(Object.defineProperty({__proto__:null,default:Bdt},Symbol.toStringTag,{value:"Module"}));let $Ei=class{constructor(e,i,r,n){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in e?(this.values=e.pixelData,this.width=e.width,this.height=e.height,this.noDataValue=e.noDataValue):(this.values=e,this.width=i,this.height=r,this.noDataValue=n)}get hasNoDataValues(){if(lt(this._hasNoDataValues)){const e=this.noDataValue;this._hasNoDataValues=this.values.includes(e)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}_ensureBounds(){if(ye(this._minValue))return;const{noDataValue:e,values:i}=this;let r=1/0,n=-1/0,s=!0;for(const o of i)o===e?this._hasNoDataValues=!0:(r=on?o:n,s=!1);s?(this._minValue=0,this._maxValue=0):(this._minValue=r,this._maxValue=n>-3e38?n:0)}},BEi=class{constructor(e,i,r,n,s={}){this._mainMethod=i,this._transferLists=r,this._listeners=[],this._promise=wA(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=>Ei.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${o}`))}on(e,i){const r={removed:!1,eventName:e,callback:i,threadHandle:null};return this._listeners.push(r),this._connectListener(r),KI(()=>{r.removed=!0,f_e(this._listeners,r),this._thread&&ye(r.threadHandle)&&r.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null}invoke(e,i){return this.invokeMethod(this._mainMethod,e,i)}invokeMethod(e,i,r){if(this._thread){const n=this._transferLists[e],s=n?n(i):[];return this._thread.invoke(e,i,{transferList:s,signal:r})}return this._promise?this._promise.then(()=>(sn(r),this.invokeMethod(e,i,r))):Promise.reject(null)}broadcast(e,i){return this._thread?Promise.all(this._thread.broadcast(i,e)).then(()=>{}):this._promise?this._promise.then(()=>this.broadcast(e,i)):Promise.reject()}get promise(){return this._promise}_connectListener(e){this._thread&&this._thread.on(e.eventName,e.callback).then(i=>{e.removed||(e.threadHandle=i)})}},Gdt=class extends BEi{constructor(e=null){super("LercWorker","_decode",{_decode:i=>[i.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,i,r){return e&&e.byteLength!==0?this.invoke({buffer:e,options:i},r):Promise.resolve(null)}release(){--this.ref<=0&&(jK.forEach((e,i)=>{e===this&&jK.delete(i)}),this.destroy())}};const jK=new Map;function GEi(t=null){let e=jK.get(t);return e||(ye(t)?(e=new Gdt(i=>t.immediate.schedule(i)),jK.set(t,e)):(e=new Gdt,jK.set(null,e))),++e.ref,e}let ly=class extends QTe(Qv(jc(_h($u(iu))))){constructor(...e){super(...e),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=GEi()}normalizeCtorArgs(e,i){return typeof e=="string"?{url:e,...i}:e}destroy(){this._lercDecoder=N3(this._lercDecoder)}readVersion(e,i){let r=i.currentVersion;return r||(r=9.3),r}load(e){const i=ye(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:r=>{for(let n=0;nthis._fetchImageService(i))),Promise.resolve(this)}fetchTile(e,i,r,n){const s=ye((n=n||{signal:null}).signal)?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,i,r,n)).then(()=>ir(this.getTileUrl(e,i,r),o)).then(l=>this._lercDecoder.decode(l.data,a,s)).then(l=>new $Ei(l))}getTileUrl(e,i,r){const n=!this.tilemapCache&&this.supportsBlankTile,s=Uv({...this.parsedUrl.query,blankTile:!n&&null});return`${this.parsedUrl.path}/tile/${e}/${i}/${r}${s?"?"+s:""}`}async queryElevation(e,i){const{ElevationQuery:r}=await Promise.resolve().then(()=>Ofe);return sn(i),new r().query(this,e,i)}async createElevationSampler(e,i){const{ElevationQuery:r}=await Promise.resolve().then(()=>Ofe);return sn(i),new r().createSampler(this,e,i)}_fetchTileAvailability(e,i,r,n){return this.tilemapCache?this.tilemapCache.fetchAvailability(e,i,r,n):Promise.resolve("unknown")}async _fetchImageService(e){if(this.sourceJSON)return this.sourceJSON;const i={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:e},r=await ir(this.parsedUrl.path,i);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.__isDefault__}};E([k({json:{read:{source:"copyrightText"}}})],ly.prototype,"copyright",void 0),E([k({readOnly:!0,type:V9})],ly.prototype,"heightModelInfo",void 0),E([k({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],ly.prototype,"path",void 0),E([k({type:["show","hide"]})],ly.prototype,"listMode",void 0),E([k({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})],ly.prototype,"minScale",void 0),E([k({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})],ly.prototype,"maxScale",void 0),E([k({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],ly.prototype,"opacity",void 0),E([k({type:["ArcGISTiledElevationServiceLayer"]})],ly.prototype,"operationalLayerType",void 0),E([k()],ly.prototype,"sourceJSON",void 0),E([k({json:{read:!1},value:"elevation",readOnly:!0})],ly.prototype,"type",void 0),E([k(Zy)],ly.prototype,"url",void 0),E([k()],ly.prototype,"version",void 0),E([Li("version",["currentVersion"])],ly.prototype,"readVersion",null),ly=E([ht("esri.layers.ElevationLayer")],ly),ly.prototype.fetchTile.__isDefault__=!0;const Vdt=Object.freeze(Object.defineProperty({__proto__:null,default:ly},Symbol.toStringTag,{value:"Module"}));async function VEi(t,e={},i){await t.load(i);const r=dd(t.itemUrl,"resources"),{start:n=1,num:s=10,sortOrder:o="asc",sortField:a="created"}=e,l={query:{start:n,num:s,sortOrder:o,sortField:a,token:t.apiKey},signal:qx(i,"signal")},c=await t.portal.request(r,l);return{total:c.total,nextStart:c.nextStart,resources:c.resources.map(({created:d,size:p,resource:y})=>({created:new Date(d),size:p,resource:t.resourceFromPath(y)}))}}async function UEi(t,e,i,r){if(!t.hasPath())throw new st(`portal-item-resource-${e}:invalid-path`,"Resource does not have a valid path");const n=t.portalItem;await n.load(r);const s=dd(n.userItemUrl,e==="add"?"addResources":"updateResources"),[o,a]=Udt(t.path),l=await jdt(i),c=new FormData;return o&&o!=="."&&c.append("resourcesPrefix",o),ye(r)&&r.compress&&c.append("compress","true"),c.append("fileName",a),c.append("file",l,a),c.append("f","json"),ye(r)&&r.access&&c.append("access",r.access),await n.portal.request(s,{method:"post",body:c,signal:qx(r,"signal")}),t}async function jEi(t,e,i){if(!e.hasPath())throw new st("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await t.load(i);const r=dd(t.userItemUrl,"removeResources");await t.portal.request(r,{method:"post",query:{resource:e.path},signal:qx(i,"signal")}),e.portalItem=null}async function zEi(t,e){await t.load(e);const i=dd(t.userItemUrl,"removeResources");return t.portal.request(i,{method:"post",query:{deleteAll:!0},signal:qx(e,"signal")})}function Udt(t){const e=t.lastIndexOf("/");return e===-1?[".",t]:[t.slice(0,e),t.slice(e+1)]}function Y3e(t){const[e,i]=HEi(t),[r,n]=Udt(e);return[r,n,i]}function HEi(t){const e=l1e(t);return lt(e)?[t,""]:[t.slice(0,t.length-e.length-1),`.${e}`]}async function jdt(t){return t instanceof Blob?t:(await ir(t.url,{responseType:"blob"})).data}function WEi(t,e){if(!t.hasPath())return null;const[i,,r]=Y3e(t.path);return t.portalItem.resourceFromPath(dd(i,e+r))}function zdt(t,e){if(!t.hasPath())return null;const[i,,r]=Y3e(t.path);return t.portalItem.resourceFromPath(dd(i,e+r))}const zK=Object.freeze(Object.defineProperty({__proto__:null,addOrUpdateResource:UEi,contentToBlob:jdt,fetchResources:VEi,getSiblingOfSameType:WEi,getSiblingOfSameTypeI:zdt,removeAllResources:zEi,removeResource:jEi,splitPrefixFileNameAndExtension:Y3e},Symbol.toStringTag,{value:"Module"})),jw={BingMapsLayer:async()=>(await Promise.resolve().then(()=>X1r)).default,BuildingSceneLayer:async()=>(await Promise.resolve().then(()=>mbr)).default,CSVLayer:async()=>(await Promise.resolve().then(()=>gbr)).default,DimensionLayer:async()=>(await Promise.resolve().then(()=>_br)).default,ElevationLayer:async()=>(await Promise.resolve().then(()=>Vdt)).default,FeatureLayer:async()=>(await Promise.resolve().then(()=>nCe)).default,GeoJSONLayer:async()=>(await Promise.resolve().then(()=>wbr)).default,GeoRSSLayer:async()=>(await Promise.resolve().then(()=>Ebr)).default,GroupLayer:async()=>(await Promise.resolve().then(()=>N3t)).default,ImageryLayer:async()=>(await Promise.resolve().then(()=>IZt)).default,ImageryTileLayer:async()=>(await Promise.resolve().then(()=>Bbr)).default,IntegratedMeshLayer:async()=>(await Promise.resolve().then(()=>Kbr)).default,KMLLayer:async()=>(await Promise.resolve().then(()=>Zbr)).default,LineOfSightLayer:async()=>(await Promise.resolve().then(()=>awr)).default,MapImageLayer:async()=>(await Promise.resolve().then(()=>VZt)).default,MapNotesLayer:async()=>(await Promise.resolve().then(()=>uwr)).default,MediaLayer:async()=>(await Promise.resolve().then(()=>bwr)).default,OGCFeatureLayer:async()=>(await Promise.resolve().then(()=>xwr)).default,OpenStreetMapLayer:async()=>(await Promise.resolve().then(()=>jZt)).default,OrientedImageryLayer:async()=>(await Promise.resolve().then(()=>Swr)).default,PointCloudLayer:async()=>(await Promise.resolve().then(()=>Iwr)).default,RouteLayer:async()=>(await Promise.resolve().then(()=>lxr)).default,SceneLayer:async()=>(await Promise.resolve().then(()=>dxr)).default,StreamLayer:async()=>(await Promise.resolve().then(()=>pxr)).default,SubtypeGroupLayer:async()=>(await Promise.resolve().then(()=>xxr)).default,TileLayer:async()=>(await Promise.resolve().then(()=>YZt)).default,UnknownLayer:async()=>(await Promise.resolve().then(()=>Sxr)).default,UnsupportedLayer:async()=>(await Promise.resolve().then(()=>Cxr)).default,VectorTileLayer:async()=>(await Promise.resolve().then(()=>$xr)).default,VoxelLayer:async()=>(await Promise.resolve().then(()=>Yxr)).default,WFSLayer:async()=>(await Promise.resolve().then(()=>Xxr)).default,WMSLayer:async()=>(await Promise.resolve().then(()=>lQt)).default,WMTSLayer:async()=>(await Promise.resolve().then(()=>g2r)).default,WebTileLayer:async()=>(await Promise.resolve().then(()=>UZt)).default};function qEi(t){return X3e(t,"notes")}function YEi(t){return X3e(t,"markup")}function XEi(t){return X3e(t,"route")}function X3e(t,e){return!(!t.layerType||t.layerType!=="ArcGISFeatureLayer")&&t.featureCollectionType===e}async function P_(t,e){const{data:i}=await ir(t,{responseType:"json",query:{f:"json",...e?.customParameters,token:e?.apiKey}});return i}async function K3e(t,e){const i=await P_(t,e);i.layers=i.layers.filter(Hdt);const r={serviceJSON:i};if((i.currentVersion??0)<10.5)return r;const n=await P_(t+"/layers",e);return r.layersJSON={layers:n.layers.filter(Hdt),tables:n.tables},r}function Hdt(t){return!t.type||t.type==="Feature Layer"}function Wdt(t){return{origin:"portal-item",url:sa(t.itemUrl),portal:t.portal||_c.getDefault(),portalItem:t,readResourcePaths:[]}}function J3e(t){return{origin:"portal-item",messages:[],writtenProperties:[],url:t.itemUrl?sa(t.itemUrl):null,portal:t.portal||_c.getDefault(),portalItem:t}}async function KEi(t,e){const i=t.instance.portalItem;if(i&&i.id)return await i.load(e),JEi(t),ZEi(t,e)}function JEi(t){const e=t.instance.portalItem;if(!e?.type||!t.supportedTypes.includes(e.type))throw new st("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:e?.type,expectedType:t.supportedTypes.join(", ")})}async function ZEi(t,e){const i=t.instance,r=i.portalItem;if(!r)return;const{url:n,title:s}=r,o=Wdt(r);if(i.type==="group")return i.read({title:s},o),QEi(i,t);n&&i.read({url:n},o);const a=await Xdt(t,e);return a&&i.read(a,o),i.resourceReferences={portalItem:r,paths:o.readResourcePaths??[]},i.type!=="subtype-group"&&i.read({title:s},o),Kq(i,o)}async function QEi(t,e){let i;const{portalItem:r}=t;if(!r)return;const n=r.type,s=e.layerModuleTypeMap,o=uB(r,"Oriented Imagery Layer")??!1;switch(n){case"Feature Service":i=o?s.OrientedImageryLayer:s.FeatureLayer;break;case"Stream Service":i=s.StreamLayer;break;case"Scene Service":i=s.SceneLayer;break;case"Feature Collection":i=s.FeatureLayer;break;default:throw new st("portal:unsupported-item-type-as-group",`The item type '${n}' is not supported as a 'IGroupLayer'`)}let[a,l]=await Promise.all([i(),Xdt(e)]),c=()=>a;if(n==="Feature Service"){if(l=r.url?await Q3e(l,r.url):{},Vhe(l).length){const d=s.SubtypeGroupLayer,p=await d();c=y=>y.layerType==="SubtypeGroupLayer"?p:a}return Z3e(t,c,l,await sIi(r.url))}return wN(l)>0?Z3e(t,c,l):eIi(t,c)}async function eIi(t,e){const{portalItem:i}=t;if(!i?.url)return;const r=await P_(i.url);r&&Z3e(t,e,{layers:r.layers?.map(qdt),tables:r.tables?.map(qdt)})}function qdt(t){return{id:t.id,name:t.name}}function Z3e(t,e,i,r){let n=i.layers||[];const s=i.tables||[];if(t.portalItem?.type==="Feature Collection"&&(n.forEach(o=>{o?.layerDefinition?.type==="Table"&&s.push(o)}),n=n.filter(o=>o?.layerDefinition?.type!=="Table")),"coverage"in i){const o=rIi(i);o&&t.add(o)}n.reverse().forEach(o=>{const a=Ydt(t,e(o),i,o,r?.(o));t.add(a)}),s.reverse().forEach(o=>{const a=Ydt(t,e(o),i,o,r?.(o));t.tables.add(a)})}function Ydt(t,e,i,r,n){const s=t.portalItem,o=new e({portalItem:s.clone(),layerId:r.id});if("sourceJSON"in o&&(o.sourceJSON=n),o.type!=="subtype-group"&&(o.sublayerTitleMode="service-name"),s.type==="Feature Collection"){const a={origin:"portal-item",portal:s.portal||_c.getDefault()};o.read(r,a);const l=i.showLegend;l!=null&&o.read({showLegend:l},a)}return o}async function Xdt(t,e){if(t.supportsData===!1)return;const i=t.instance,r=i.portalItem;if(!r)return;let n=null;try{n=await r.fetchData("json",e)}catch{}if(iIi(i)){let s=null,o=!0;if(n&&wN(n)>0){if(i.layerId==null){const a=Vhe(n);i.layerId=i.type==="subtype-group"?a?.[0]:eRe(n)}s=tIi(n,i),s&&(wN(n)===1&&(o=!1),n.showLegend!=null&&(s.showLegend=n.showLegend))}return o&&i.sublayerTitleMode!=="service-name"&&(i.sublayerTitleMode="item-title-and-service-name"),s}return n}async function Q3e(t,e){if(t?.layers==null||t?.tables==null){const i=await P_(e);(t=t||{}).layers=t.layers||i?.layers,t.tables=t.tables||i?.tables}return t}function eRe(t){const e=t.layers;if(e&&e.length)return e[0].id;const i=t.tables;return i&&i.length?i[0].id:null}function tIi(t,e){const{layerId:i}=e,r=t.layers?.find(n=>n.id===i)||t.tables?.find(n=>n.id===i);return r&&nIi(r,e)?r:null}function wN(t){return(t?.layers?.length??0)+(t?.tables?.length??0)}function iIi(t){return t.type!=="stream"&&t.type!=="oriented-imagery"&&"layerId"in t}function rIi(t){const{coverage:e}=t;if(!e)return null;const i=new URL(e);if(e.toLowerCase().includes("item.html")){const r=i.searchParams.get("id"),n=i.origin;return iu.fromPortalItem({portalItem:new X0({id:r,url:n})})}if(OHe(e))return iu.fromArcGISServerUrl({url:e});throw new st("portal:oriented-imagery-layer-coverage","the provided coverage url couldn't be loaded as a layer")}function Vhe(t){const e=[];return t?.layers?.forEach(i=>{i.layerType==="SubtypeGroupLayer"&&e.push(i.id)}),e}function nIi(t,e){return!(e.type==="feature"&&"layerType"in t&&t.layerType==="SubtypeGroupLayer"||e.type==="subtype-group"&&!("layerType"in t))}async function sIi(t){const{layersJSON:e}=await K3e(t);if(!e)return null;const i=[...e.layers,...e.tables];return r=>i.find(n=>n.id===r.id)}const oIi=Object.freeze(Object.defineProperty({__proto__:null,getFirstLayerOrTableId:eRe,getNumLayersAndTables:wN,getSubtypeGroupLayerIds:Vhe,load:KEi,preprocessFSItemData:Q3e},Symbol.toStringTag,{value:"Module"}));async function aIi(t){!t.portalItem||t.portalItem instanceof X0||(t={...t,portalItem:new X0(t.portalItem)});const e=await lIi(t.portalItem);return new e.constructor({portalItem:t.portalItem,...e.properties})}async function lIi(t){return await t.load(),uIi(await tRe(t))}async function tRe(t){switch(t.type){case"Map Service":return cIi(t);case"Feature Service":return hIi(t);case"Feature Collection":return pIi(t);case"Scene Service":return dIi(t);case"Image Service":return fIi(t);case"Stream Service":return mIi();case"Vector Tile Service":return gIi();case"GeoJson":return yIi();case"CSV":return vIi();case"KML":return _Ii();case"WFS":return bIi();case"WMTS":return xIi();case"WMS":return wIi();case"Feed":return SIi();default:throw new st("portal:unknown-item-type","Unknown item type '${type}'",{type:t.type})}}async function uIi(t){const e=jw[t.className];return{constructor:await e(),properties:t.properties}}async function cIi(t){return await TIi(t)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function hIi(t){if(uB(t,"Oriented Imagery Layer"))return CIi(t);const e=await Kdt(t);if(typeof e=="object"){const i={};return e.id!=null&&(i.layerId=e.id),{className:e.className||"FeatureLayer",properties:i}}return{className:"GroupLayer"}}async function dIi(t){const e=await Kdt(t);if(typeof e=="object"){const i={};let r;if(e.id!=null?(i.layerId=e.id,r=`${t.url}/layers/${e.id}`):r=t.url,t.typeKeywords?.length){for(const s of Object.keys(JH))if(t.typeKeywords.includes(s))return{className:JH[s]}}const n=await P_(r);return{className:JH[n?.layerType]||"SceneLayer",properties:i}}return e===!1?(await P_(t.url))?.layerType==="Voxel"?{className:"VoxelLayer"}:{className:"GroupLayer"}:{className:"GroupLayer"}}async function pIi(t){await t.load();const e=uB(t,"Map Notes"),i=uB(t,"Markup");if(e||i)return{className:"MapNotesLayer"};if(uB(t,"Route Layer"))return{className:"RouteLayer"};const r=await t.fetchData();return wN(r)===1?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function fIi(t){await t.load();const e=t.typeKeywords?.map(o=>o.toLowerCase())??[];if(e.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(e.includes("tiled imagery"))return{className:"ImageryTileLayer"};const i=(await t.fetchData())?.layerType;if(i==="ArcGISTiledImageServiceLayer")return{className:"ImageryTileLayer"};if(i==="ArcGISImageServiceLayer")return{className:"ImageryLayer"};const r=await P_(t.url),n=r.cacheType?.toLowerCase(),s=r.capabilities?.toLowerCase().includes("tilesonly");return n==="map"||s?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function mIi(){return{className:"StreamLayer"}}function gIi(){return{className:"VectorTileLayer"}}function yIi(){return{className:"GeoJSONLayer"}}function vIi(){return{className:"CSVLayer"}}function _Ii(){return{className:"KMLLayer"}}function bIi(){return{className:"WFSLayer"}}function wIi(){return{className:"WMSLayer"}}function xIi(){return{className:"WMTSLayer"}}function SIi(){return{className:"StreamLayer"}}async function CIi(t){await t.load();const e=await t.fetchData();return e.coverage?{className:"GroupLayer"}:{className:"OrientedImageryLayer",properties:e}}async function TIi(t){return(await P_(t.url)).tileInfo}async function Kdt(t){const e=t.url;if(!e||e.match(/\/\d+$/))return{};await t.load();const i=await t.fetchData();if(t.type==="Feature Service"){const r=iRe(await Q3e(i,e));if(typeof r=="object"){const n=Vhe(i);r.className=r.id!=null&&n.includes(r.id)?"SubtypeGroupLayer":"FeatureLayer"}return r}return wN(i)>0?iRe(i):iRe(await P_(e))}function iRe(t){return wN(t)===1&&{id:eRe(t)}}const EIi=Object.freeze(Object.defineProperty({__proto__:null,fromItem:aIi,selectLayerClassPath:tRe},Symbol.toStringTag,{value:"Module"}));async function Jdt(t,e,i){if(!e)return;const r=[];for(const s of e){const o=DIi(s,i);s.layerType==="GroupLayer"?r.push(NIi(o,s,i)):r.push(o)}const n=await bu(r);for(const s of n)s.value&&t.add(s.value)}const IIi={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",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer",LineOfSightLayer:"LineOfSightLayer"},AIi={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},PIi={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",DefaultTileLayer:"TileLayer"},OIi={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},RIi={ArcGISFeatureLayer:"FeatureLayer"},MIi={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"};async function DIi(t,e){return FIi(await LIi(t,e),t,e)}async function FIi(t,e,i){const r=new t;return r.read(e,i.context),r.type==="group"&&Zdt(e)&&await $Ii(r,e,i.context),await Kq(r,i.context),r}async function LIi(t,e){const i=e.context,r=kIi(i);let n=t.layerType||t.type;!n&&e&&e.defaultLayerType&&(n=e.defaultLayerType);const s=r[n];let o=s?jw[s]:jw.UnknownLayer;if(Qdt(t)){const a=i?.portal;if(t.itemId){const l=new X0({id:t.itemId,portal:a});await l.load();const c=(await tRe(l)).className||"UnknownLayer";o=jw[c]}}else n==="ArcGISFeatureLayer"?qEi(t)||YEi(t)?o=jw.MapNotesLayer:XEi(t)?o=jw.RouteLayer:Zdt(t)&&(o=jw.GroupLayer):t.wmtsInfo&&t.wmtsInfo.url&&t.wmtsInfo.layerIdentifier?o=jw.WMTSLayer:n==="WFS"&&t.wfsInfo?.version!=="2.0.0"&&(o=jw.UnsupportedLayer);return o()}function Zdt(t){return t.layerType!=="ArcGISFeatureLayer"||Qdt(t)?!1:(t.featureCollection?.layers?.length??0)>1}function Qdt(t){return t.type==="Feature Collection"}function kIi(t){let e;if(t.origin==="web-scene")switch(t.layerContainerType){case"basemap":e=PIi;break;case"ground":e=AIi;break;default:e=IIi}else switch(t.layerContainerType){case"basemap":e=MIi;break;case"tables":e=RIi;break;default:e=OIi}return e}async function NIi(t,e,i){const r=new fr,n=Jdt(r,Array.isArray(e.layers)?e.layers:[],i),s=await t;if(await n,s.type==="group")return s.layers.addMany(r),s}async function $Ii(t,e,i){const r=jw.FeatureLayer,n=await r(),s=e.featureCollection,o=s?.showLegend,a=s?.layers?.map((l,c)=>{const d=new n;d.read(l,i);const p={...i,ignoreDefaults:!0};return d.read({id:`${t.id}-sublayer-${c}`,visibility:e.visibleLayers?.includes(c)??!0},p),o!=null&&d.read({showLegend:o},p),d});t.layers.addMany(a??[])}const ept=Object.freeze(Object.defineProperty({__proto__:null,populateOperationalLayers:Jdt},Symbol.toStringTag,{value:"Module"}));var Et;(function(t){t.AsyncNotEnabled="AsyncNotEnabled",t.ModulesNotSupported="ModulesNotSupported",t.CircularModules="CircularModules",t.NeverReach="NeverReach",t.UnsupportedHashType="UnsupportedHashType",t.InvalidParameter="InvalidParameter",t.UnexpectedToken="UnexpectedToken",t.Unrecognised="Unrecognised",t.UnrecognisedType="UnrecognisedType",t.MaximumCallDepth="MaximumCallDepth",t.BooleanConditionRequired="BooleanConditionRequired",t.TypeNotAllowedInFeature="TypeNotAllowedInFeature",t.KeyMustBeString="KeyMustBeString",t.WrongNumberOfParameters="WrongNumberOfParameters",t.CallNonFunction="CallNonFunction",t.NoFunctionInTemplateLiteral="NoFunctionInTemplateLiteral",t.NoFunctionInDictionary="NoFunctionInDictionary",t.NoFunctionInArray="NoFunctionInArray",t.AssignModuleFunction="AssignModuleFunction",t.LogicExpressionOrAnd="LogicExpressionOrAnd",t.LogicalExpressionOnlyBoolean="LogicalExpressionOnlyBoolean",t.FuncionNotFound="FunctionNotFound",t.InvalidMemberAccessKey="InvalidMemberAccessKey",t.UnsupportedUnaryOperator="UnsupportUnaryOperator",t.InvalidIdentifier="InvalidIdentifier",t.MemberOfNull="MemberOfNull",t.UnsupportedOperator="UnsupportedOperator",t.Cancelled="Cancelled",t.ModuleAccessorMustBeString="ModuleAccessorMustBeString",t.ModuleExportNotFound="ModuleExportNotFound",t.Immutable="Immutable",t.OutOfBounds="OutOfBounds",t.IllegalResult="IllegalResult",t.FieldNotFound="FieldNotFound",t.PortalRequired="PortalRequired",t.LogicError="LogicError",t.ArrayAccessorMustBeNumber="ArrayAccessMustBeNumber",t.KeyAccessorMustBeString="KeyAccessorMustBeString",t.WrongSpatialReference="WrongSpatialReference"})(Et||(Et={}));const tpt={[Et.TypeNotAllowedInFeature]:"Feature attributes only support dates, numbers, strings, guids.",[Et.LogicError]:"Logic error - {reason}",[Et.NeverReach]:"Encountered unreachable logic",[Et.AsyncNotEnabled]:"Async Arcade must be enabled for this script",[Et.ModuleAccessorMustBeString]:"Module accessor must be a string",[Et.ModuleExportNotFound]:"Module has no export with provided identifier",[Et.ModulesNotSupported]:"Current profile does not support modules",[Et.ArrayAccessorMustBeNumber]:"Array accessor must be a number",[Et.FuncionNotFound]:"Function not found",[Et.FieldNotFound]:"Key not found - {key}",[Et.CircularModules]:"Circular module dependencies are not allowed",[Et.Cancelled]:"Execution cancelled",[Et.UnsupportedHashType]:"Type not supported in hash function",[Et.IllegalResult]:"Value is not a supported return type",[Et.PortalRequired]:"Portal is required",[Et.InvalidParameter]:"Invalid parameter",[Et.WrongNumberOfParameters]:"Call with wrong number of parameters",[Et.Unrecognised]:"Unrecognised code structure",[Et.UnrecognisedType]:"Unrecognised type",[Et.WrongSpatialReference]:"Cannot work with geometry in this spatial reference. It is different to the execution spatial reference",[Et.BooleanConditionRequired]:"Conditions must use booleans",[Et.NoFunctionInDictionary]:"Dictionaries cannot contain functions.",[Et.NoFunctionInArray]:"Arrays cannot contain functions.",[Et.NoFunctionInTemplateLiteral]:"Template Literals do not expect functions by value.",[Et.KeyAccessorMustBeString]:"Accessor must be a string",[Et.KeyMustBeString]:"Object keys must be a string",[Et.Immutable]:"Object is immutable",[Et.InvalidParameter]:"Invalid parameter",[Et.UnexpectedToken]:"Unexpected token",[Et.MemberOfNull]:"Cannot access property of null object",[Et.MaximumCallDepth]:"Exceeded maximum function depth",[Et.OutOfBounds]:"Out of bounds",[Et.InvalidIdentifier]:"Identifier not recognised",[Et.FuncionNotFound]:"Function not found",[Et.CallNonFunction]:"Expression is not a function",[Et.InvalidMemberAccessKey]:"Cannot access value using a key of this type",[Et.AssignModuleFunction]:"Cannot assign function to module variable",[Et.UnsupportedUnaryOperator]:"Unsupported unary operator",[Et.UnsupportedOperator]:"Unsupported operator",[Et.LogicalExpressionOnlyBoolean]:"Logical expressions must be boolean",[Et.LogicExpressionOrAnd]:"Logical expression can only be combined with || or &&"};let BIi=class extends Error{constructor(...e){super(...e)}},ipt=class MLt extends BIi{constructor(e,i){super(rRe(i)+e.message,{cause:e}),this.loc=null,Error.captureStackTrace&&Error.captureStackTrace(this,MLt),i&&i.loc&&(this.loc=i.loc)}},Nt=class DLt extends Error{constructor(e,i,r,n){super("Execution error - "+rRe(r)+CV(tpt[i],n)),this.loc=null,this.declaredRootClass="esri.arcade.arcadeexecutionerror",Error.captureStackTrace&&Error.captureStackTrace(this,DLt),r&&r.loc&&(this.loc=r.loc)}};function rRe(t){return t&&t.loc?`Line : ${t.loc.start?.line}, ${t.loc.start?.column}: `:""}let _0=class FLt extends Error{constructor(e,i,r,n){super("Compilation error - "+rRe(r)+CV(tpt[i],n)),this.loc=null,this.declaredRootClass="esri.arcade.arcadecompilationerror",Error.captureStackTrace&&Error.captureStackTrace(this,FLt),r&&r.loc&&(this.loc=r.loc)}},nRe=class LLt extends Error{constructor(){super("Uncompilable code structures"),this.declaredRootClass="esri.arcade.arcadeuncompilableerror",Error.captureStackTrace&&Error.captureStackTrace(this,LLt)}};function CV(t,e){try{if(!e)return t;for(const i in e){let r=e[i];r||(r=""),t=t.replace("{"+i+"}",e[i])}}catch{}return t}function rpt(t,e,i){return i.declaredRootClass==="esri.arcade.arcadeexecutionerror"||i.declaredRootClass==="esri.arcade.arcadecompilationerror"?i.loc===null&&e&&e.loc?new ipt(i,{cause:i}):i:(i.declaredRootClass==="esri.arcade.featureset.support.featureseterror"||i.declaredRootClass==="esri.arcade.featureset.support.sqlerror"||i.declaredRootClass,e&&e.loc?new ipt(i,{cause:i}):i)}var xN;(function(t){t.UnrecognisedUri="UnrecognisedUri",t.UnsupportedUriProtocol="UnsupportedUriProtocol"})(xN||(xN={}));const GIi={[xN.UnrecognisedUri]:"Unrecognised uri - {uri}",[xN.UnsupportedUriProtocol]:"Unrecognised uri protocol"};let sRe=class kLt extends Error{constructor(e,i){super(CV(GIi[e],i)),this.declaredRootClass="esri.arcade.arcademoduleerror",Error.captureStackTrace&&Error.captureStackTrace(this,kLt)}},gD=class{};var Uhe;gD.instance=new S2("Etc/UTC"),function(t){t.TimeZoneNotRecognised="TimeZoneNotRecognised"}(Uhe||(Uhe={}));const VIi={[Uhe.TimeZoneNotRecognised]:"Timezone identifier has not been recognised."};let UIi=class NLt extends Error{constructor(e,i){super(CV(VIi[e],i)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,NLt)}},ml=class tg{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,i=1,r=1,n=0,s=0,o=0,a=0,l){if(isNaN(e)||isNaN(i)||isNaN(r)||isNaN(n)||isNaN(s)||isNaN(o)||isNaN(a))return null;let c=0;const d=zs.local(e,i).daysInMonth;r<1&&(c=r-1,r=1),r>d&&(c=r-d,r=d);let p=0;i>12?(p=i-12,i=12):i<1&&(p=i-1,i=1);let y=0;s>59?(y=s-59,s=59):s<0&&(y=s,s=0);let v=0;o>59?(v=o-59,o=59):o<0&&(v=o,o=0);let S=0;a>999?(S=a-999,a=999):a<0&&(S=a,a=0);let I=zs.fromObject({day:r,year:e,month:i,hour:n,minute:s,second:o,millisecond:a},{zone:HK(l)});return p!==0&&(I=I.plus({months:p})),c!==0&&(I=I.plus({days:c})),y!==0&&(I=I.plus({minutes:y})),v!==0&&(I=I.plus({seconds:v})),S!==0&&(I=I.plus({milliseconds:S})),new tg(I)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,i){const r=HK(i);return e.isUnknownTimeZone||r===gD.instance?tg.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,r):new tg(e._date.setZone(i))}static dateJSToArcadeDate(e){return new tg(zs.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,i="system"){return new tg(zs.fromJSDate(e,{zone:i}))}static unknownEpochToArcadeDate(e){return new tg(zs.fromMillis(e,{zone:gD.instance}))}static unknownDateJSToArcadeDate(e){return new tg(zs.fromMillis(e.getTime(),{zone:gD.instance}))}static epochToArcadeDate(e,i="system"){return new tg(zs.fromMillis(e,{zone:i}))}static dateTimeToArcadeDate(e){return new tg(e)}changeTimeZone(e){const i=HK(e);return tg.dateTimeToArcadeDate(this._date.setZone(i))}static dateTimeAndZoneToArcadeDate(e,i){const r=HK(i);return e.zone===gD.instance||r===gD.instance?tg.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,r):new tg(e.setZone(r))}static nowToArcadeDate(e){return new tg(zs.fromJSDate(new Date,{zone:e}))}static nowUTCToArcadeDate(){return new tg(zs.utc())}get isSystem(){return this.timeZone==="system"||this.timeZone===tg.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===gD.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 tg(this._date.plus(e))}diff(e,i="milliseconds"){return this._date.diff(e._date,i)[i]}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toFormat(e,i){return this._date.toFormat(e,i)}toJSDate(){return this._date.toJSDate()}toSQLString(){return"timestamp '"+this._date.toFormat("yyyy-LL-dd HH:mm:ss")+"'"}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new tg(this._date.toUTC())}toLocal(){return new tg(this._date.toLocal())}toString(){return this.toISOString(!0)}};function HK(t){if(t instanceof H9)return t;if(t.toLowerCase()==="system")return"system";if(t.toLowerCase()==="utc")return"utc";if(t.toLowerCase()==="unknown")return gD.instance;if(/^[\+\-]?[0-9]{1,2}([:][0-9]{2})?$/.test(t)){const i=qg.parseSpecifier("UTC"+(t.startsWith("+")||t.startsWith("-")?"":"+")+t);if(i)return i}const e=S2.create(t);if(!e.isValid)throw new UIi(Uhe.TimeZoneNotRecognised);return e}let fg=class{constructor(e=[]){this._elements=e}length(){return this._elements.length}get(e){return this._elements[e]}toArray(){const e=[];for(let i=0;ithis.fn(e,{preparsed:!0,arguments:i})}call(e,i){return this.fn(e,i)}marshalledCall(e,i,r,n){return n(e,i,(s,o,a)=>{a=a.map(c=>c instanceof yD&&!(c instanceof zw)?vD(c,e,n):c);const l=this.call(r,{args:a});return Ip(l)?l.then(c=>vD(c,r,n)):l})}},zw=class extends yD{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(e){return this.fn.createFunction(this.context)}call(e,i){return this.fn.marshalledCall(e,i,this.context,this.parameterEvaluator)}marshalledCall(e,i,r){return this.fn.marshalledCall(e,i,this.context,this.parameterEvaluator)}},SN=class $Lt extends fg{constructor(e,i,r,n,s,o){super(e),this._lazyPt=[],this._hasZ=!1,this._hasM=!1,this._spRef=i,this._hasZ=r,this._hasM=n,this._cacheId=s,this._partId=o}get(e){if(this._lazyPt[e]===void 0){const i=this._elements[e];if(i===void 0)return;const r=this._hasZ,n=this._hasM;let s=null;s=r&&!n?new Yi(i[0],i[1],i[2],void 0,this._spRef):n&&!r?new Yi(i[0],i[1],void 0,i[2],this._spRef):r&&n?new Yi(i[0],i[1],i[2],i[3],this._spRef):new Yi(i[0],i[1],this._spRef),s.cache._arcadeCacheId=this._cacheId.toString()+"-"+this._partId.toString()+"-"+e.toString(),this._lazyPt[e]=s}return this._lazyPt[e]}equalityTest(e){return e===this||e!==null&&e instanceof $Lt&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()+"-"+this._partId.toString()}},oRe=class BLt extends fg{constructor(e,i,r,n,s){super(e),this._lazyPath=[],this._hasZ=!1,this._hasM=!1,this._hasZ=r,this._hasM=n,this._spRef=i,this._cacheId=s}get(e){if(this._lazyPath[e]===void 0){const i=this._elements[e];if(i===void 0)return;this._lazyPath[e]=new SN(i,this._spRef,this._hasZ,this._hasM,this._cacheId,e)}return this._lazyPath[e]}equalityTest(e){return e===this||e!==null&&e instanceof BLt&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()}};const aRe={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function npt(t=Y0()){let e=(t=t.toLowerCase())in aRe;if(!e){const s=t.split("-");s.length>1&&s[0]in aRe&&(t=s[0],e=!0),e||(t="en")}const[i,r,n="#,##0.###"]=aRe[t];return{decimal:i,group:r,pattern:n}}function jIi(t,e){const i=npt((e={...e}).locale);e.customs=i;const r=e.pattern||i.pattern;return isNaN(t)||Math.abs(t)===1/0?null:zIi(t,r,e)}const spt=/[#0,]*[#0](?:\.0*#*)?/;function zIi(t,e,i){const r=(i=i||{}).customs.group,n=i.customs.decimal,s=e.split(";"),o=s[0];if((e=s[t<0?1:0]||"-"+o).includes("%"))t*=100;else if(e.includes("‰"))t*=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=spt,l=o.match(a);if(!l)throw new Error("unable to find a number expression in pattern: "+e);return i.fractional===!1&&(i.places=0),e.replace(a,HIi(t,l[0],{decimal:n,group:r,places:i.places,round:i.round}))}function HIi(t,e,i){(i=i||{}).places===!0&&(i.places=0),i.places===1/0&&(i.places=6);const r=e.split("."),n=typeof i.places=="string"&&i.places.indexOf(",");let s=i.places;n?s=i.places.substring(n+1):s>=0||(s=(r[1]||[]).length),i.round<0||(t=Number(t.toFixed(Number(s))));const o=String(Math.abs(t)).split("."),a=o[1]||"";if(r[1]||i.places){n&&(i.places=i.places.substring(0,n));const S=i.places!==void 0?i.places:r[1]&&r[1].lastIndexOf("0")+1;S>a.length&&(o[1]=a.padEnd(Number(S),"0")),so[0].length&&(o[0]=o[0].padStart(c,"0")),l.includes("#")||(o[0]=o[0].substr(o[0].length-c)));let d,p,y=r[0].lastIndexOf(",");if(y!==-1){d=r[0].length-y-1;const S=r[0].substr(0,y);y=S.lastIndexOf(","),y!==-1&&(p=S.length-y-1)}const v=[];for(let S=o[0];S;){const I=S.length-d;v.push(I>0?S.substr(I):S),S=I>0?S.slice(0,I):"",p&&(d=p,p=void 0)}return o[0]=v.reverse().join(i.group||","),o.join(i.decimal||".")}function opt(t){const e=npt((t=t||{}).locale),i=t.pattern||e.pattern,r=e.group,n=e.decimal;let s=1;if(i.includes("%"))s/=100;else if(i.includes("‰"))s/=1e3;else if(i.includes("¤"))throw new Error("currency notation not supported");const o=i.split(";");return o.length===1&&o.push("-"+o[0]),{regexp:WK(o,l=>(l="(?:"+v_e(l,".")+")").replace(spt,c=>{const d={signed:!1,separator:t.strict?r:[r,""],fractional:t.fractional,decimal:n,exponent:!1},p=c.split(".");let y=t.places;p.length===1&&s!==1&&(p[1]="###"),p.length===1||y===0?d.fractional=!1:(y===void 0&&(y=t.pattern?p[1].lastIndexOf("0")+1:1/0),y&&t.fractional==null&&(d.fractional=!0),!t.places&&y1&&(d.groupSize=v.pop().length,v.length>1&&(d.groupSize2=v.pop().length)),"("+WIi(d)+")"}),!0).replace(/[\xa0 ]/g,"[\\s\\xa0]"),group:r,decimal:n,factor:s}}function apt(t,e){const i=opt(e),r=new RegExp("^"+i.regexp+"$").exec(t);if(!r)return NaN;let n=r[1];if(!r[1]){if(!r[2])return NaN;n=r[2],i.factor*=-1}return n=n.replace(new RegExp("["+i.group+"\\s\\xa0]","g"),"").replace(i.decimal,"."),Number(n)*i.factor}function WIi(t){"places"in(t=t||{})||(t.places=1/0),typeof t.decimal!="string"&&(t.decimal="."),"fractional"in t&&!/^0/.test(String(t.places))||(t.fractional=[!0,!1]),"exponent"in t||(t.exponent=[!0,!1]),"eSigned"in t||(t.eSigned=[!0,!1]);const e=lpt(t),i=WK(t.fractional,n=>{let s="";return n&&t.places!==0&&(s="\\"+t.decimal,t.places===1/0?s="(?:"+s+"\\d+)?":s+="\\d{"+t.places+"}"),s},!0);let r=e+i;return i&&(r="(?:(?:"+r+")|(?:"+i+"))"),r+WK(t.exponent,n=>n?"([eE]"+lpt({signed:t.eSigned})+")":"")}function lpt(t){return"signed"in(t=t||{})||(t.signed=[!0,!1]),"separator"in t?"groupSize"in t||(t.groupSize=3):t.separator="",WK(t.signed,e=>e?"[-+]":"",!0)+WK(t.separator,e=>{if(!e)return"(?:\\d+)";(e=v_e(e))===" "?e="\\s":e===" "&&(e="\\s\\xa0");const i=t.groupSize,r=t.groupSize2;if(r){const n="(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+e+"]\\d{"+r+"})*["+e+"]\\d{"+i+"})";return i-r>0?"(?:"+n+"|(?:0|[1-9]\\d{0,"+(i-1)+"}))":n}return"(?:0|[1-9]\\d{0,"+(i-1)+"}(?:["+e+"]\\d{"+i+"})*)"},!0)}const WK=(t,e,i)=>{if(!(t instanceof Array))return e(t);const r=[];for(let n=0;n"("+(e?"?:":"")+t+")";var fo,Xu;function jhe(t){return Bo.fromJSON(t.toJSON())}function lRe(t){return t.toJSON?t.toJSON():t}function YIi(t){return typeof t=="string"||t instanceof String}function XIi(t){return typeof t=="number"}function TV(t){return t instanceof Date}function qK(t){return t instanceof ml}function KIi(t,e){return t===e||!(!TV(t)&&!qK(t)||!TV(e)&&!qK(e))&&t.getTime()===e.getTime()}function JIi(t){if(t==null)return null;if(typeof t=="number")return t;switch(t.toLowerCase()){case"meters":case"meter":return 109404;case"miles":case"mile":return 109439;case"kilometers":case"kilometer":case"km":return 109414}return null}function upt(t){if(t==null)return null;switch(t.type){case"polygon":case"multipoint":case"polyline":return t.extent;case"point":return new vr({xmin:t.x,ymin:t.y,xmax:t.x,ymax:t.y,spatialReference:t.spatialReference});case"extent":return t}return null}function ZIi(t){if(t==null)return null;if(typeof t=="number"||typeof t=="number")return t;switch(t.toLowerCase()){case"meters":case"meter":return 9001;case"miles":case"mile":return 9093;case"kilometers":case"kilometer":case"km":return 9036}return null}(function(t){t[t.Standardised=0]="Standardised",t[t.StandardisedNoInterval=1]="StandardisedNoInterval",t[t.SqlServer=2]="SqlServer",t[t.Oracle=3]="Oracle",t[t.Postgres=4]="Postgres",t[t.PGDB=5]="PGDB",t[t.FILEGDB=6]="FILEGDB",t[t.NotEvaluated=7]="NotEvaluated"})(fo||(fo={})),function(t){t[t.InFeatureSet=0]="InFeatureSet",t[t.NotInFeatureSet=1]="NotInFeatureSet",t[t.Unknown=2]="Unknown"}(Xu||(Xu={}));const uRe=1e3,zhe={point:"point",polygon:"polygon",polyline:"polyline",multipoint:"multipoint",extent:"extent",esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint",esriGeometryEnvelope:"extent",envelope:"extent"},Hhe={point:"esriGeometryPoint",polygon:"esriGeometryPolygon",polyline:"esriGeometryPolyline",multipoint:"esriGeometryMultipoint",extent:"esriGeometryEnvelope",esriGeometryPoint:"esriGeometryPoint",esriGeometryPolygon:"esriGeometryPolygon",esriGeometryPolyline:"esriGeometryPolyline",esriGeometryMultipoint:"esriGeometryMultipoint",esriGeometryEnvelope:"esriGeometryEnvelope",envelope:"esriGeometryEnvelope"},Whe={"small-integer":"esriFieldTypeSmallInteger",integer:"esriFieldTypeInteger",long:"esriFieldTypeLong",single:"esriFieldTypeSingle",double:"esriFieldTypeDouble",string:"esriFieldTypeString",date:"esriFieldTypeDate",oid:"esriFieldTypeOID",geometry:"esriFieldTypeGeometry",blob:"esriFieldTypeBlob",raster:"esriFieldTypeRaster",guid:"esriFieldTypeGUID","global-id":"esriFieldTypeGlobalID",xml:"eesriFieldTypeXML",esriFieldTypeSmallInteger:"esriFieldTypeSmallInteger",esriFieldTypeInteger:"esriFieldTypeInteger",esriFieldTypeLong:"esriFieldTypeLong",esriFieldTypeSingle:"esriFieldTypeSingle",esriFieldTypeDouble:"esriFieldTypeDouble",esriFieldTypeString:"esriFieldTypeString",esriFieldTypeDate:"esriFieldTypeDate",esriFieldTypeOID:"esriFieldTypeOID",esriFieldTypeGeometry:"esriFieldTypeGeometry",esriFieldTypeBlob:"esriFieldTypeBlob",esriFieldTypeRaster:"esriFieldTypeRaster",esriFieldTypeGUID:"esriFieldTypeGUID",esriFieldTypeGlobalID:"esriFieldTypeGlobalID",esriFieldTypeXML:"eesriFieldTypeXML"};function cRe(t){return t===void 0?"":t=(t=(t=t.replace(/\/featureserver\/[0-9]*/i,"/FeatureServer")).replace(/\/mapserver\/[0-9]*/i,"/MapServer")).split("?")[0]}function QIi(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});const i=typeof e.cycles=="boolean"&&e.cycles,r=e.cmp&&(n=e.cmp,function(o){return function(a,l){const c={key:a,value:o[a]},d={key:l,value:o[l]};return n(c,d)}});var n;const s=[];return function o(a){if(a&&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,c;if(Array.isArray(a)){for(c="[",l=0;li)throw new Nt(r,Et.WrongNumberOfParameters,n)}function fRe(t){return t<0?-Math.round(-t):Math.round(t)}function EV(){let t=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),(e==="x"?i:3&i|8).toString(16)})}function mRe(t,e){return isNaN(t)||e==null||e===""?t.toString():(e=Hw(e,"‰",""),e=Hw(e,"¤",""),jIi(t,{pattern:e}))}function Xhe(t,e){return e==null||e===""?t.toISOString(!0):t.toFormat(gRe(e),{locale:Y0(),numberingSystem:"latn"})}function gRe(t){t=t.replace(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let e="";const i=/(\[[^\[]*\])|(\\)?([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 t.match(i)||[])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"Z":e+="ZZ";break;case"ZZ":e+="ZZZ";break;case"S":e+="'S'";break;case"SS":e+="'SS'";break;case"SSS":e+="u";break;case"A":case"a":e+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":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}function Dc(t,e,i){switch(i){case">":return t>e;case"<":return t=":return t>=e;case"<=":return t<=e}return!1}function Khe(t,e,i){if(t===null){if(e===null||e===Xr)return Dc(null,null,i);if(Ka(e))return Dc(0,e,i);if(vn(e)||La(e))return Dc(0,Mi(e),i);if(Tu(e))return Dc(0,e.toNumber(),i)}if(t===Xr){if(e===null||e===Xr)return Dc(null,null,i);if(Ka(e))return Dc(0,e,i);if(vn(e)||La(e))return Dc(0,Mi(e),i);if(Tu(e))return Dc(0,e.toNumber(),i)}else if(Ka(t)){if(Ka(e))return Dc(t,e,i);if(La(e))return Dc(t,Mi(e),i);if(e===null||e===Xr)return Dc(t,0,i);if(vn(e))return Dc(t,Mi(e),i);if(Tu(e))return Dc(t,e.toNumber(),i)}else if(vn(t)){if(vn(e))return Dc(rn(t),rn(e),i);if(Tu(e))return Dc(Mi(t),e.toNumber(),i);if(Ka(e))return Dc(Mi(t),e,i);if(e===null||e===Xr)return Dc(Mi(t),0,i);if(La(e))return Dc(Mi(t),Mi(e),i)}else if(Tu(t)){if(Tu(e))return Dc(t.toNumber(),e.toNumber(),i);if(e===null||e===Xr)return Dc(t.toNumber(),0,i);if(Ka(e))return Dc(t.toNumber(),e,i);if(La(e)||vn(e))return Dc(t.toNumber(),Mi(e),i)}else if(La(t)){if(La(e))return Dc(t,e,i);if(Ka(e))return Dc(Mi(t),Mi(e),i);if(Tu(e))return Dc(Mi(t),e.toNumber(),i);if(e===null||e===Xr)return Dc(Mi(t),0,i);if(vn(e))return Dc(Mi(t),Mi(e),i)}return!!yv(t,e)&&(i==="<="||i===">=")}function yv(t,e){if(t===e||t===null&&e===Xr||e===null&&t===Xr)return!0;if(Tu(t)&&Tu(e))return t.equals(e);if(t instanceof oRe||t instanceof SN)return t.equalityTest(e);if(t instanceof Yi&&e instanceof Yi){const i=t.cache._arcadeCacheId,r=e.cache._arcadeCacheId;if(i!=null)return i===r}return!!(pRe(t)&&pRe(e)&&(t._arcadeCacheId===e._arcadeCacheId&&t._arcadeCacheId!==void 0&&t._arcadeCacheId!==null||t._underlyingGraphic===e._underlyingGraphic&&t._underlyingGraphic!==void 0&&t._underlyingGraphic!==null))}function rn(t,e){if(vn(t))return t;if(t===null)return"";if(Ka(t))return mRe(t,e);if(La(t))return t.toString();if(Tu(t))return Xhe(t,e);if(t instanceof Jr)return JSON.stringify(t.toJSON());if(Tn(t)){const i=[];for(let r=0;rr.key===n.key?0:r.key==="spatialReference"?1:n.key==="spatialReference"||r.keyn.key?1:0);if(Tn(t)){const r=[];for(let n=0;n0)return t;return null}if(t instanceof va){if(t.paths.length===0)return null;for(const e of t.paths)if(e.length>0)return t;return null}return t instanceof fd?t.points.length===0?null:t:t instanceof vr?t.xmin==="NaN"||t.xmin===null||isNaN(t.xmin)?null:t:null}function yRe(t,e){if(!t||!t.domain)return e;let i=null;if(t.field.type==="string"||t.field.type==="esriFieldTypeString")e=rn(e);else{if(e==null)return null;if(e==="")return e;e=Mi(e)}for(let r=0;ra.id===r&&(n=a.domains&&a.domains[o.name],n&&n.type==="inherited"&&(n=dpt(o.name,e),s=!0),!0)),s||n||(n=dpt(t,e)),{field:o,domain:n}}function dpt(t,e){let i;return e.fields.some(r=>(r.name.toLowerCase()===t.toLowerCase()&&(i=r.domain),!!i)),i}function _Re(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});const i=typeof e.cycles=="boolean"&&e.cycles,r=e.cmp&&(n=e.cmp,function(o){return function(a,l){const c={key:a,value:o[a]},d={key:l,value:o[l]};return n(c,d)}});var n;const s=[];return function o(a){if(a&&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,c;if(Array.isArray(a)){for(c="[",l=0;l0&&(s=t[0].spatialReference,i=t[0].hasZ,r=t[0].hasM)}else if(t instanceof SN)n=t._elements,n.length>0&&(i=t._hasZ,r=t._hasM,s=t.get(0).spatialReference);else{if(!_s(t))throw new Nt(null,Et.InvalidParameter,null);for(const o of t.toArray())IV(n,o);n.length>0&&(s=t.get(0).spatialReference,i=t.get(0).hasZ===!0,r=t.get(0).hasM===!0)}return n.length===0?null:(iW(n,r,i)||(n=n.slice(0).reverse()),new po({rings:[n],spatialReference:s,hasZ:i,hasM:r}))}return t}function bD(t,e){if(Tn(t)||_s(t)){let i=!1,r=!1,n=[],s=e;if(Tn(t)){for(const o of t)IV(n,o);n.length>0&&(s=t[0].spatialReference,i=t[0].hasZ===!0,r=t[0].hasM===!0)}else if(t instanceof SN)n=t._elements,n.length>0&&(i=t._hasZ,r=t._hasM,s=t.get(0).spatialReference);else if(_s(t)){for(const o of t.toArray())IV(n,o);n.length>0&&(s=t.get(0).spatialReference,i=t.get(0).hasZ===!0,r=t.get(0).hasM===!0)}return n.length===0?null:new va({paths:[n],spatialReference:s,hasZ:i,hasM:r})}return t}function IN(t,e){if(Tn(t)||_s(t)){let i=!1,r=!1,n=[],s=e;if(Tn(t)){for(const o of t)IV(n,o);n.length>0&&(s=t[0].spatialReference,i=t[0].hasZ===!0,r=t[0].hasM===!0)}else if(t instanceof SN)n=t._elements,n.length>0&&(i=t._hasZ,r=t._hasM,s=t.get(0).spatialReference);else if(_s(t)){for(const o of t.toArray())IV(n,o);n.length>0&&(s=t.get(0).spatialReference,i=t.get(0).hasZ===!0,r=t.get(0).hasM===!0)}return n.length===0?null:new fd({points:n,spatialReference:s,hasZ:i,hasM:r})}return t}function ppt(t,e=!1){const i=[];if(t===null)return i;if(Tn(t)===!0){for(let r=0;r{setTimeout(()=>{e(t)},0)})):t}function Zhe(t,e,i){switch(i){case"&":return t&e;case"|":return t|e;case"^":return t^e;case"<<":return t<>":return t>>e;case">>>":return t>>>e}}function wD(t,e=null){return t==null?null:La(t)||Ka(t)||vn(t)?t:t instanceof Jr?e?.keepGeometryType===!0?t:t.toJSON():t instanceof fg?t.toArray().map(i=>wD(i,e)):t instanceof Array?t.map(i=>wD(i,e)):Yhe(t)?t:Tu(t)?t.toJSDate():t!==null&&typeof t=="object"&&t.castAsJson!==void 0?t.castAsJson(e):null}async function tAi(t,e,i,r,n){const s=await wRe(t,e,i);n[r]=s}async function wRe(t,e=null,i=null){if(t instanceof fg&&(t=t.toArray()),t==null)return null;if(_D(t)||t instanceof Jr||Yhe(t)||Tu(t))return wD(t,i);if(t instanceof Array){const r=[],n=[];for(const s of t)s===null||_D(s)||s instanceof Jr||Yhe(s)||Tu(s)?n.push(wD(s,i)):(n.push(null),r.push(tAi(s,e,i,n.length-1,n)));return r.length>0&&await Promise.all(r),n}return t!==null&&typeof t=="object"&&t.castAsJsonAsync!==void 0?t.castAsJsonAsync(e,i):null}function xRe(t,e,i){const r=t.fullSchema();return r===null||!r.fields?null:EN(e,r,t,i)}function JK(t){const e=t.fullSchema();return e===null?null:e.fields&&e.typeIdField?{subtypeField:e.typeIdField,subtypes:e.types?e.types.map(i=>({name:i.name,code:i.id})):[]}:null}function SRe(t,e,i,r){const n=t.fullSchema();if(n===null||!n.fields)return null;const s=EN(e,n,t,r);if(i===void 0)try{i=t.field(e)}catch{return null}return yRe(s,i)}function CRe(t,e,i,r){const n=t.fullSchema();if(n===null||!n.fields)return null;if(i===void 0){try{i=t.field(e)}catch{return null}return i}return vRe(EN(e,n,t,r),i)}function Wo(t){return t?.timeReference?.timeZone?t?.timeReference?.timeZone:"system"}function TRe(t){const e=t.fullSchema();if(e===null||!e.fields)return null;const i=[];for(const r of e.fields)i.push(lRe(r));return{objectIdField:e.objectIdField,globalIdField:e.globalIdField,geometryType:Hhe[e.geometryType]===void 0?"":Hhe[e.geometryType],fields:i,datesInUnknownTimezone:e.datesInUnknownTimezone===!0,preferredTimeReference:e.preferredTimeReference||null,editFieldsInfo:e.editFieldsInfo||null,timeInfo:e.timeInfo||null,dateFieldsTimeReference:e.dateFieldsTimeReference||null}}const fpt=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:iE,ImplicitResultE:hpt,ReturnResult:Kh,ReturnResultE:cpt,absRound:fRe,autoCastArrayOfPointsToMultiPoint:IN,autoCastArrayOfPointsToPolygon:XK,autoCastArrayOfPointsToPolyline:bD,autoCastFeatureToGeometry:Yn,binaryOperator:Zhe,breakResult:Wf,castAsJson:wD,castAsJsonAsync:wRe,continueResult:rE,defaultTimeZone:Wo,defaultUndefined:un,equalityTest:yv,featureDomainCodeLookup:CRe,featureDomainValueLookup:SRe,featureFullDomain:xRe,featureSchema:TRe,featureSubtypes:JK,fixNullGeometry:TN,fixSpatialReference:Zh,formatDate:Xhe,formatNumber:mRe,generateUUID:EV,getDomain:EN,getDomainCode:vRe,getDomainValue:yRe,getType:dRe,greaterThanLessThan:Khe,isArray:Tn,isBoolean:La,isDate:Tu,isFeature:du,isFeatureSet:Wl,isFeatureSetCollection:qhe,isFunctionParameter:au,isImmutableArray:_s,isInteger:NP,isJsDate:Yhe,isModule:hRe,isNumber:Ka,isObject:pRe,isSimpleType:_D,isString:vn,multiReplace:Hw,pcCheck:Zi,stableStringify:_Re,standardiseDateFormat:gRe,tick:KK,toBoolean:ub,toDate:Jh,toNumber:Mi,toNumberArray:CN,toString:rn,toStringArray:ppt,toStringExplicit:O_,voidOperation:Xr},Symbol.toStringTag,{value:"Module"}));function Qhe(t,e,i=!1){if(t==null)return null;if(Ka(t))return Mi(t);if(La(t))return ub(t);if(vn(t))return rn(t);if(Tu(t))return Jh(t,e);if(Tn(t)){const n=[];for(const s of t)n.push(Qhe(s,e,i));return n}const r=new es;r.immutable=!1;for(const n of Object.keys(t)){const s=t[n];s!==void 0&&r.setField(n,Qhe(s,e,i))}return r.immutable=i,r}let es=class F9e{constructor(e){this.declaredClass="esri.arcade.Dictionary",this.attributes=null,this.plain=!1,this.immutable=!0,this.attributes=e instanceof F9e?e.attributes:e??{}}field(e){const i=e.toLowerCase(),r=this.attributes[e];if(r!==void 0)return r;for(const n in this.attributes)if(n.toLowerCase()===i)return this.attributes[n];throw new Nt(null,Et.FieldNotFound,null,{key:e})}setField(e,i){if(this.immutable)throw new Nt(null,Et.Immutable,null);if(au(i))throw new Nt(null,Et.NoFunctionInDictionary,null);const r=e.toLowerCase();if(i instanceof Date&&(i=ml.dateJSToArcadeDate(i)),this.attributes[e]===void 0){for(const n in this.attributes)if(n.toLowerCase()===r)return void(this.attributes[n]=i);this.attributes[e]=i}else this.attributes[e]=i}hasField(e){const i=e.toLowerCase();if(this.attributes[e]!==void 0)return!0;for(const r in this.attributes)if(r.toLowerCase()===i)return!0;return!1}keys(){let e=[];for(const i in this.attributes)e.push(i);return e=e.sort(),e}castToText(e=!1){let i="";for(const r in this.attributes){i!==""&&(i+=",");const n=this.attributes[r];n==null?i+=JSON.stringify(r)+":null":La(n)||Ka(n)||vn(n)?i+=JSON.stringify(r)+":"+JSON.stringify(n):n instanceof Jr?i+=JSON.stringify(r)+":"+O_(n):n instanceof fg||n instanceof Array?i+=JSON.stringify(r)+":"+O_(n,null,e):n instanceof ml?i+=e?JSON.stringify(r)+":"+JSON.stringify(n.getTime()):JSON.stringify(r)+":"+n.stringify():n!==null&&typeof n=="object"&&n.castToText!==void 0&&(i+=JSON.stringify(r)+":"+n.castToText(e))}return"{"+i+"}"}static convertObjectToArcadeDictionary(e,i,r=!0){const n=new F9e;n.immutable=!1;for(const s in e){const o=e[s];o!==void 0&&n.setField(s.toString(),Qhe(o,i))}return n.immutable=r,n}static convertJsonToArcade(e,i,r=!1){return Qhe(e,i,r)}castAsJson(e=null){const i={};for(let r in this.attributes){const n=this.attributes[r];n!==void 0&&(e?.keyTranslate&&(r=e.keyTranslate(r)),i[r]=wD(n,e))}return i}async castDictionaryValueAsJsonAsync(e,i,r,n=null,s){const o=await wRe(r,n,s);return e[i]=o,o}async castAsJsonAsync(e=null,i=null){const r={},n=[];for(let s in this.attributes){const o=this.attributes[s];i?.keyTranslate&&(s=i.keyTranslate(s)),o!==void 0&&(_D(o)||o instanceof Jr||o instanceof ml?r[s]=wD(o,i):n.push(this.castDictionaryValueAsJsonAsync(r,s,o,e,i)))}return n.length>0&&await Promise.all(n),r}};function iAi(t){return t?.timeZoneIANA?t?.timeZoneIANA:t?.timeZone?Yqe(t,""):""}let ede=class Jve{constructor(){this.dateTimeReferenceMetaData=null,this._fieldTimeZoneIndex={},this._fieldIndex=null,this._ianaPreferred=null,this._ianaTimeInfo=null,this._ianaEditFields=null,this._ianaLayerDateFields=null}static create(e,i){const r=new Jve;return r.dateTimeReferenceMetaData=i,r._fieldIndex=e instanceof Am?e:new Am(e),r}static createFromLayer(e){if(!e)return null;if(!e.fieldsIndex)return!e.declaredClass&&e.fields?Jve.create(e.fields,e):null;const i=new Jve;return i._fieldIndex=e.fieldsIndex,i.dateTimeReferenceMetaData={timeInfo:e?.timeInfo?.toJSON()??null,editFieldsInfo:e?.editFieldsInfo?.toJSON()??null,dateFieldsTimeReference:e?.dateFieldsTimeReference?.toJSON()??null,preferredTimeReference:e?.preferredTimeReference?.toJSON()??null,datesInUnknownTimezone:e?.datesInUnknownTimezone===!0},i}fieldTimeZone(e){const i=this._fieldIndex?.get(e);if(!i||i.type!=="date"&&i.type!=="esriFieldTypeDate")return null;const r=this._fieldTimeZoneIndex[i.name];if(r!==void 0)return r;const n=[{field:this.dateTimeReferenceMetaData?.editFieldsInfo?.creationDateField,timeReference:this.dateTimeReferenceMetaData?.editFieldsInfo?.dateFieldsTimeReference,isunknown:this.dateTimeReferenceMetaData?.datesInUnknownTimezone===!0},{field:this.dateTimeReferenceMetaData?.editFieldsInfo?.editDateField,timeReference:this.dateTimeReferenceMetaData?.editFieldsInfo?.dateFieldsTimeReference,isunknown:this.dateTimeReferenceMetaData?.datesInUnknownTimezone===!0},{field:this.dateTimeReferenceMetaData?.timeInfo?.startTimeField,timeReference:this.dateTimeReferenceMetaData?.timeInfo?.timeReference,isunknown:this.dateTimeReferenceMetaData?.datesInUnknownTimezone===!0},{field:this.dateTimeReferenceMetaData?.timeInfo?.endTimeField,timeReference:this.dateTimeReferenceMetaData?.timeInfo?.timeReference,isunknown:this.dateTimeReferenceMetaData?.datesInUnknownTimezone===!0}];for(const o of n)if(o.field===i.name){const a=this.convertToIANA(o.timeReference,o.isunknown);return this._fieldTimeZoneIndex[i.name]=a,a}const s=this.convertToIANA(this.dateTimeReferenceMetaData?.dateFieldsTimeReference,this.dateTimeReferenceMetaData?.datesInUnknownTimezone);return this._fieldTimeZoneIndex[i.name]=s,s}convertToIANA(e,i){return i?"unknown":iAi(e)}get layerPreferredTimeZone(){if(this._ianaPreferred!==null)return this._ianaPreferred;this._ianaPreferred="";const e=this.dateTimeReferenceMetaData?.preferredTimeReference;return this._ianaPreferred=this.convertToIANA(e,this.dateTimeReferenceMetaData?.datesInUnknownTimezone===!0),this._ianaPreferred}get layerTimeInfoTimeZone(){if(this._ianaTimeInfo!==null)return this._ianaTimeInfo;this._ianaTimeInfo="";const e=this.dateTimeReferenceMetaData?.timeInfo?.timeReference;return this._ianaTimeInfo=this.convertToIANA(e,!1),this._ianaTimeInfo}get layerEditFieldsTimeZone(){if(this._ianaEditFields!==null)return this._ianaEditFields;this._ianaEditFields="";const e=this.dateTimeReferenceMetaData?.editFieldsInfo?.dateFieldsTimeReference;return this._ianaEditFields=this.convertToIANA(e,this.dateTimeReferenceMetaData?.datesInUnknownTimezone),this._ianaEditFields}get layerDateFieldsTimeZone(){if(this._ianaLayerDateFields!==null)return this._ianaLayerDateFields;this._ianaLayerDateFields="";const e=this.dateTimeReferenceMetaData?.dateFieldsTimeReference;return this._ianaLayerDateFields=this.convertToIANA(e,this.dateTimeReferenceMetaData?.datesInUnknownTimezone===!0),this._ianaLayerDateFields}},ah=class WI{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature",this._optimizedGeomDefinition=null,this._geometry=null,this.attributes=null,this._layer=null,this._datesfixed=!0,this.dateTimeReferenceFieldIndex=null,this.contextTimeReference=null,this.immutable=!0,this._datefields=null,this.immutable=!0}static createFromGraphic(e,i){const r=new WI;return r.contextTimeReference=i??null,r._geometry=ye(e.geometry)?e.geometry:null,e.attributes===void 0||e.attributes===null?r.attributes={}:r.attributes=e.attributes,e._sourceLayer?(r._layer=e._sourceLayer,r._datesfixed=!1):e._layer?(r._layer=e._layer,r._datesfixed=!1):e.layer&&"fields"in e.layer?(r._layer=e.layer,r._datesfixed=!1):e.sourceLayer&&"fields"in e.sourceLayer&&(r._layer=e.sourceLayer,r._datesfixed=!1),r._layer&&r._datesfixed===!1&&(r._layer.dateTimeReferenceFieldIndex!==void 0?r.dateTimeReferenceFieldIndex=r._layer.dateTimeReferenceFieldIndex:r.dateTimeReferenceFieldIndex=ede.createFromLayer(r._layer)),r}static createFromArcadeFeature(e){const i=new WI;return i._datesfixed=e._datesfixed,i.attributes=e.attributes,i._geometry=e._geometry,i._optimizedGeomDefinition=e._optimizedGeomDefinition,e._layer&&(i._layer=e._layer),i.dateTimeReferenceFieldIndex=e.dateTimeReferenceFieldIndex,i.contextTimeReference=e.contextTimeReference,i}static createFromOptimisedFeature(e,i,r){const n=new WI;return n._geometry=e.geometry?{geometry:e.geometry}:null,n._optimizedGeomDefinition=r,n.attributes=e.attributes||{},n._layer=i,n._datesfixed=!1,n}static createFromArcadeDictionary(e){const i=new WI;return i.attributes=e.field("attributes"),i.attributes!==null&&i.attributes instanceof es?(i.attributes=i.attributes.attributes,i.attributes===null&&(i.attributes={})):i.attributes={},i._geometry=e.field("geometry"),i._geometry!==null&&(i._geometry instanceof es?i._geometry=WI.parseGeometryFromDictionary(i._geometry):i._geometry instanceof Jr||(i._geometry=null)),i}static createFromGraphicLikeObject(e,i,r=null,n){const s=new WI;return s.contextTimeReference=n??null,i===null&&(i={}),s.attributes=i,s._geometry=ye(e)?e:null,s._layer=r,s._layer&&(s._datesfixed=!1,s._layer.dateTimeReferenceFieldIndex!==void 0?s.dateTimeReferenceFieldIndex=s._layer.dateTimeReferenceFieldIndex:s.dateTimeReferenceFieldIndex=ede.createFromLayer(s._layer)),s}repurposeFromGraphicLikeObject(e,i,r=null){i===null&&(i={}),this.attributes=i,this._geometry=e||null,this._layer=r,this._layer?this._datesfixed=!1:this._datesfixed=!0}get layerPreferredTimeZone(){return this.dateTimeReferenceFieldIndex?.layerPreferredTimeZone??""}fieldSourceTimeZone(e){return this.dateTimeReferenceFieldIndex?.fieldTimeZone(e)??""}castToText(e=!1){let i="";this._datesfixed===!1&&this._fixDates();for(const r in this.attributes){i!==""&&(i+=",");const n=this.attributes[r];n==null?i+=JSON.stringify(r)+":null":La(n)||Ka(n)||vn(n)?i+=JSON.stringify(r)+":"+JSON.stringify(n):n instanceof Jr?i+=JSON.stringify(r)+":"+O_(n):n instanceof fg||n instanceof Array?i+=JSON.stringify(r)+":"+O_(n,null,e):n instanceof ml?i+=e?JSON.stringify(r)+":"+JSON.stringify(n.getTime()):JSON.stringify(r)+":"+n.stringify():n!==null&&typeof n=="object"&&n.castToText!==void 0&&(i+=JSON.stringify(r)+":"+n.castToText(e))}return'{"geometry":'+(this.geometry()===null?"null":O_(this.geometry()))+',"attributes":{'+i+"}}"}_fixDates(){if(this._datefields!==null)return this._datefields.length>0&&this._fixDateFields(this._datefields),void(this._datesfixed=!0);const e=[],i=this._layer.fields;for(let r=0;r0&&this._fixDateFields(e),this._datesfixed=!0}isUnknownDateTimeField(e){return this.dateTimeReferenceFieldIndex?.fieldTimeZone(e)==="unknown"}_fixDateFields(e){this.attributes={...this.attributes};const i=this.contextTimeReference?.timeZone??"system";for(let r=0;r!i&&(n.type==="Identifier"&&n.name&&n.name.toLowerCase()===r&&(i=!0),!0)),i}function vpt(t){const e=[];return Gu(t,i=>(i.type==="ImportDeclaration"&&i.source&&i.source.value&&e.push({libname:i.specifiers[0].local.name.toLowerCase(),source:i.source.value}),!0)),e}function sAi(t,e){let i=!1;const r=e.toLowerCase();return Gu(t,n=>!i&&(n.type!=="CallExpression"||n.callee.type!=="Identifier"||!n.callee.name||n.callee.name.toLowerCase()!==r||(i=!0,!1))),i}function oAi(t){const e=[];return Gu(t,i=>i.type!=="MemberExpression"||i.object.type!=="Identifier"||(i.computed===!1&&i.object&&i.object.name&&i.property&&i.property.type==="Identifier"&&i.property.name?e.push(i.object.name.toLowerCase()+"."+i.property.name.toLowerCase()):i.object&&i.object.name&&i.property&&i.property.type==="Literal"&&typeof i.property.value=="string"&&e.push(i.object.name.toLowerCase()+"."+i.property.value?.toString().toLowerCase()),!1)),e}function aAi(t){const e=[];return Gu(t,i=>{if(i.type==="CallExpression"){if(i.callee.type==="Identifier"&&i.callee.name.toLowerCase()==="expects"){let r="";for(let n=0;n<(i.arguments||[]).length;n++)n===0?i.arguments[n].type==="Identifier"&&(r=i.arguments[n].name.toLowerCase()):r&&i.arguments[n].type==="Literal"&&gpt(i.arguments[n].value)&&e.push(r+"."+i.arguments[n].value.toLowerCase());return!1}if(i.callee.type==="Identifier"&&["domainname","domaincode","domain","haskey"].includes(i.callee.name.toLowerCase())&&i.arguments.length>=2){let r="";return i.arguments[0].type==="Identifier"&&(r=i.arguments[0].name.toLowerCase()),r&&i.arguments[1].type==="Literal"&&gpt(i.arguments[1].value)&&e.push(r+"."+i.arguments[1].value.toLowerCase()),!1}}return i.type!=="MemberExpression"||i.object.type!=="Identifier"||(i.computed===!1&&i.object&&i.object.name&&i.property&&i.property.type==="Identifier"&&i.property.name?e.push(i.object.name.toLowerCase()+"."+i.property.name.toLowerCase()):i.object&&i.object.name&&i.property&&i.property.type==="Literal"&&typeof i.property.value=="string"&&e.push(i.object.name.toLowerCase()+"."+i.property.value?.toString().toLowerCase()),!1)}),e}function ERe(t){const e=[];return Gu(t,i=>(i.type==="CallExpression"&&i.callee.type==="Identifier"&&e.push(i.callee.name.toLowerCase()),!0)),e}function ZK(t,e=[]){let i=null;if(t.usesFeatureSet===void 0){i===null&&(i=ERe(t)),t.usesFeatureSet=!1;for(let r=0;r0){for(const r of e)if(ypt(t,r)){t.usesFeatureSet=!0,t.isAsync=!0;break}}}if(t.usesModules===void 0&&(t.usesModules=!1,vpt(t).length>0&&(t.usesModules=!0)),t.usesGeometry===void 0){t.usesGeometry=!1,i===null&&(i=ERe(t));for(let r=0;r0||l.length>0;)if(a.length>0&&l.length>0){let p=c(a[0],l[0]);isNaN(p)&&(p=0),p<=0?(d.push(a[0]),a=a.slice(1)):(d.push(l[0]),l=l.slice(1))}else a.length>0?(d.push(a[0]),a=a.slice(1)):l.length>0&&(d.push(l[0]),l=l.slice(1));return d}async function n(a,l){const c=a.length,d=Math.floor(c/2);if(c===0)return[];if(c===1)return[a[0]];const p=[await n(a.slice(0,d),l),await n(a.slice(d,c),l)];return s(p[0],p[1],l,[])}async function s(a,l,c,d){const p=d;if(!(a.length>0||l.length>0))return d;if(a.length>0&&l.length>0){let y=await c(a[0],l[0]);return isNaN(y)&&(y=1),y<=0?(p.push(a[0]),a=a.slice(1)):(p.push(l[0]),l=l.slice(1)),s(a,l,c,d)}return a.length>0?(p.push(a[0]),s(a=a.slice(1),l,c,d)):l.length>0?(p.push(l[0]),s(a,l=l.slice(1),c,d)):void 0}function o(a,l,c,d){Zi(c,1,2,a,l);let p=c[0];if(_s(p)&&(p=p.toArray()),Tn(p)===!1)throw new Nt(a,Et.InvalidParameter,l);if(c.length>1){if(au(c[1])===!1)throw new Nt(a,Et.InvalidParameter,l);let O=p;const L=c[1].createFunction(a);return d?n(O,L):(O=i(O,(N,G)=>L(N,G)),O)}let y=p;if(y.length===0)return[];const v={};for(let O=0;O1||I==="String"?i(y,(O,L)=>{if(O==null||O===Xr)return L==null||L===Xr?0:1;if(L==null||L===Xr)return-1;const N=rn(O),G=rn(L);return NO-L):I==="Boolean"?i(y,(O,L)=>O===L?0:L?-1:1):I==="Date"?i(y,(O,L)=>L-O):y.slice(0),y}t.functions.array=function(a,l){return t.standardFunction(a,l,(c,d,p)=>{Zi(p,1,2,a,l);const y=Mi(p[0]);if(isNaN(y)||NP(y)===!1)throw new Nt(a,Et.InvalidParameter,l);const v=un(p[1],null),S=new Array(y);return S.fill(v),S})},t.functions.front=function(a,l){return t.standardFunction(a,l,(c,d,p)=>{if(Zi(p,1,1,a,l),_s(p[0])){if(p[0].length()<=0)throw new Nt(a,Et.OutOfBounds,l);return p[0].get(0)}if(Tn(p[0])){if(p[0].length<=0)throw new Nt(a,Et.OutOfBounds,l);return p[0][0]}throw new Nt(a,Et.InvalidParameter,l)})},t.functions.back=function(a,l){return t.standardFunction(a,l,(c,d,p)=>{if(Zi(p,1,1,a,l),_s(p[0])){if(p[0].length()<=0)throw new Nt(a,Et.OutOfBounds,l);return p[0].get(p[0].length()-1)}if(Tn(p[0])){if(p[0].length<=0)throw new Nt(a,Et.OutOfBounds,l);return p[0][p[0].length-1]}throw new Nt(a,Et.InvalidParameter,l)})},t.functions.push=function(a,l){return t.standardFunction(a,l,(c,d,p)=>{if(Zi(p,1,2,a,l),Tn(p[0]))return p[0][p[0].length]=p[1],p[0].length;throw new Nt(a,Et.InvalidParameter,l)})},t.functions.pop=function(a,l){return t.standardFunction(a,l,(c,d,p)=>{if(Zi(p,1,1,a,l),Tn(p[0])){if(p[0].length<=0)throw new Nt(a,Et.OutOfBounds,l);const y=p[0][p[0].length-1];return p[0].length=p[0].length-1,y}throw new Nt(a,Et.InvalidParameter,l)})},t.functions.erase=function(a,l){return t.standardFunction(a,l,(c,d,p)=>{if(Zi(p,2,2,a,l),Tn(p[0])){let y=Mi(p[1]);if(isNaN(y)||NP(y)===!1)throw new Nt(a,Et.InvalidParameter,l);const v=p[0];if(v.length<=0)throw new Nt(a,Et.OutOfBounds,l);if(y<0&&(y=v.length+y),y<0)throw new Nt(a,Et.OutOfBounds,l);if(y>=v.length)throw new Nt(a,Et.OutOfBounds,l);return v.splice(y,1),Xr}throw new Nt(a,Et.InvalidParameter,l)})},t.functions.insert=function(a,l){return t.standardFunction(a,l,(c,d,p)=>{if(Zi(p,3,3,a,l),Tn(p[0])){const y=Mi(p[1]);if(isNaN(y)||NP(y)===!1)throw new Nt(a,Et.InvalidParameter,l);const v=p[2],S=p[0];if(y>S.length)throw new Nt(a,Et.OutOfBounds,l);if(y<0&&y<-1*S.length)throw new Nt(a,Et.OutOfBounds,l);return y===S.length?(S[y]=v,Xr):(S.splice(y,0,v),Xr)}throw new Nt(a,Et.InvalidParameter,l)})},t.functions.resize=function(a,l){return t.standardFunction(a,l,(c,d,p)=>{if(Zi(p,2,3,a,l),Tn(p[0])){const y=Mi(p[1]);if(isNaN(y)||NP(y)===!1)throw new Nt(a,Et.InvalidParameter,l);if(y<0)throw new Nt(a,Et.InvalidParameter,l);const v=un(p[2],null),S=p[0];if(S.length>=y)return S.length=y,Xr;const I=S.length;S.length=y;for(let O=I;O{if(Zi(p,2,2,a,l),Tn(p[0])){const y=p[1];return p[0].findIndex(v=>yv(v,y))>-1}if(_s(p[0])){const y=p[1];return p[0].toArray().findIndex(v=>yv(v,y))>-1}throw new Nt(a,Et.InvalidParameter,l)})},t.functions.slice=function(a,l){return t.standardFunction(a,l,(c,d,p)=>{if(Zi(p,1,3,a,l),Tn(p[0])){const y=Mi(un(p[1],0)),v=Mi(un(p[2],p[0].length));if(isNaN(y)||NP(y)===!1)throw new Nt(a,Et.InvalidParameter,l);if(isNaN(v)||NP(v)===!1)throw new Nt(a,Et.InvalidParameter,l);return p[0].slice(y,v)}if(_s(p[0])){const y=p[0],v=Mi(un(p[1],0)),S=Mi(un(p[2],y.length()));if(isNaN(v)||NP(v)===!1)throw new Nt(a,Et.InvalidParameter,l);if(isNaN(S)||NP(S)===!1)throw new Nt(a,Et.InvalidParameter,l);return y.toArray().slice(v,S)}throw new Nt(a,Et.InvalidParameter,l)})},t.functions.splice=function(a,l){return t.standardFunction(a,l,(c,d,p)=>{const y=[];for(let v=0;v{if(Zi(p,2,2,a,l),Tn(p[0]))return Mi(p[1])>=p[0].length?p[0].slice(0):p[0].slice(0,Mi(p[1]));if(_s(p[0]))return Mi(p[1])>=p[0].length()?p[0].slice(0):p[0].slice(0,Mi(p[1]));throw new Nt(a,Et.InvalidParameter,l)})},t.functions.first=function(a,l){return t.standardFunction(a,l,(c,d,p)=>(Zi(p,1,1,a,l),Tn(p[0])?p[0].length===0?null:p[0][0]:_s(p[0])?p[0].length()===0?null:p[0].get(0):null))},t.mode==="sync"&&(t.functions.sort=function(a,l){return t.standardFunction(a,l,(c,d,p)=>o(a,l,p,!1))},t.functions.any=function(a,l){return t.standardFunction(a,l,(c,d,p)=>{Zi(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l);for(const S of v){const I=y(S);if(La(I)&&I===!0)return!0}return!1})},t.functions.all=function(a,l){return t.standardFunction(a,l,(c,d,p)=>{Zi(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l);for(const S of v)if(y(S)!==!0)return!1;return!0})},t.functions.none=function(a,l){return t.standardFunction(a,l,(c,d,p)=>{Zi(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l);for(const S of v)if(y(S)===!0)return!1;return!0})},t.functions.reduce=function(a,l){return t.standardFunction(a,l,(c,d,p)=>{Zi(p,2,3,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l);return p.length===2?v.length===0?null:v.reduce((S,I)=>{const O=y(S,I);return S=O!==void 0&&O!==Xr?O:null}):v.reduce((S,I)=>{const O=y(S,I);return S=O!==void 0&&O!==Xr?O:null},p[2])})},t.functions.map=function(a,l){return t.standardFunction(a,l,(c,d,p)=>{Zi(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l),S=[];for(const I of v){const O=y(I);O!==void 0&&O!==Xr?S.push(O):S.push(null)}return S})},t.functions.filter=function(a,l){return t.standardFunction(a,l,(c,d,p)=>{Zi(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l),S=[];for(const I of v)y(I)===!0&&S.push(I);return S})}),t.mode==="async"&&(t.functions.sort=function(a,l){return t.standardFunctionAsync(a,l,(c,d,p)=>o(a,l,p,!0))},t.functions.any=function(a,l){return t.standardFunctionAsync(a,l,async(c,d,p)=>{Zi(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l);for(const S of v){const I=await y(S);let O=null;if(O=Ip(O)?await I:I,La(O)&&O===!0)return!0}return!1})},t.functions.all=function(a,l){return t.standardFunctionAsync(a,l,async(c,d,p)=>{Zi(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l);for(const S of v){const I=await y(S);let O=null;if(O=Ip(O)?await I:I,O!==!0)return!1}return!0})},t.functions.none=function(a,l){return t.standardFunctionAsync(a,l,async(c,d,p)=>{Zi(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l);for(const S of v){const I=await y(S);let O=null;if(O=Ip(O)?await I:I,O===!0)return!1}return!0})},t.functions.filter=function(a,l){return t.standardFunctionAsync(a,l,async(c,d,p)=>{Zi(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l),S=[];for(const I of v){const O=await y(I);let L=null;L=Ip(L)?await O:O,L===!0&&S.push(I)}return S})},t.functions.reduce=function(a,l){return t.standardFunctionAsync(a,l,(c,d,p)=>{Zi(p,2,3,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l);let S=null;if(p.length>2){const I=un(p[2],null);S=v.reduce(async(O,L)=>{let N=await O;return N!==void 0&&N!==Xr||(N=null),y(N,L)},Promise.resolve(I))}else{if(v.length===0)return null;S=v.reduce(async(I,O,L)=>{if(L<=1)return y(I,O);let N=await I;return N!==void 0&&N!==Xr||(N=null),y(N,O)})}return S.then(I=>I!==void 0&&I!==Xr?I:null)})},t.functions.map=function(a,l){return t.standardFunctionAsync(a,l,async(c,d,p)=>{Zi(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l),S=[];for(const I of v){const O=await y(I);let L=null;L=Ip(L)?await O:O,L!==void 0&&L!==Xr?S.push(L):S.push(null)}return S})})}const nde=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:lAi},Symbol.toStringTag,{value:"Module"}));function uAi(t,e,i){return t+(cAi(i)?dAi:hAi)[e]}function cAi(t){return t%4==0&&(t%100!=0||t%400==0)}const hAi=[0,31,59,90,120,151,181,212,243,273,304,334],dAi=[0,31,60,91,121,152,182,213,244,274,305,335];function AV(t){return t===null?t:t.isValid===!1?null:t}function _pt(t,e){return t===""||t.toLowerCase().trim()==="default"?Wo(e):t}function IRe(t,e){t.today=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,0,0,i,r);const a=new Date;return a.setHours(0,0,0,0),ml.dateJSAndZoneToArcadeDate(a,Wo(i))})},t.changetimezone=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,2,2,i,r);const a=Jh(o[0],Wo(i));if(a===null)return null;const l=ml.arcadeDateAndZoneToArcadeDate(a,_pt(rn(o[1]),i));return l.isValid===!1?null:l})},t.timezone=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,2,i,r);const a=Jh(o[0],Wo(i));if(a===null)return null;const l=a.timeZone;return l==="system"?ml.systemTimeZoneCanonicalName:l})},t.timezoneoffset=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);const a=Jh(o[0],Wo(i));return a===null?null:a.timeZoneOffset})},t.now=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,0,0,i,r);const a=ml.nowToArcadeDate(Wo(i));return a.isValid===!1?null:a})},t.timestamp=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,0,0,i,r);const a=ml.nowUTCToArcadeDate();return a.isValid===!1?null:a})},t.toutc=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);const a=Jh(o[0],Wo(i));return a===null?null:a.toUTC()})},t.tolocal=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);const a=Jh(o[0],Wo(i));return a===null?null:a.toLocal()})},t.day=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);const a=Jh(o[0],Wo(i));return a===null?NaN:a.day})},t.month=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);const a=Jh(o[0],Wo(i));return a===null?NaN:a.monthJS})},t.year=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);const a=Jh(o[0],Wo(i));return a===null?NaN:a.year})},t.hour=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);const a=Jh(o[0],Wo(i));return a===null?NaN:a.hour})},t.second=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);const a=Jh(o[0],Wo(i));return a===null?NaN:a.second})},t.millisecond=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);const a=Jh(o[0],Wo(i));return a===null?NaN:a.millisecond})},t.minute=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);const a=Jh(o[0],Wo(i));return a===null?NaN:a.minute})},t.week=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,2,i,r);const a=Jh(o[0],Wo(i));if(a===null)return NaN;const l=Mi(un(o[1],0));if(l<0||l>6)throw new Nt(i,Et.InvalidParameter,r);const c=a.day,d=a.monthJS,p=a.year,y=a.dayOfWeekJS,v=uAi(c,d,p)-1,S=Math.floor(v/7);return y-l+(y-l<0?7:0){Zi(o,1,1,i,r);const a=Jh(o[0],Wo(i));return a===null?NaN:a.dayOfWeekJS})},t.isoweekday=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);const a=Jh(o[0],Wo(i));return a===null?NaN:a.dayOfWeekISO})},t.isomonth=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);const a=Jh(o[0],Wo(i));return a===null?NaN:a.monthISO})},t.isoweek=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);const a=Jh(o[0],Wo(i));return a===null?NaN:a.weekISO})},t.isoyear=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);const a=Jh(o[0],Wo(i));return a===null?NaN:a.yearISO})},t.date=function(i,r){return e(i,r,(n,s,o)=>{if(Zi(o,0,8,i,r),o.length===3)return AV(ml.fromParts(Mi(o[0]),Mi(o[1])+1,Mi(o[2]),0,0,0,0,Wo(i)));if(o.length===4)return AV(ml.fromParts(Mi(o[0]),Mi(o[1])+1,Mi(o[2]),Mi(o[3]),0,0,0,Wo(i)));if(o.length===5)return AV(ml.fromParts(Mi(o[0]),Mi(o[1])+1,Mi(o[2]),Mi(o[3]),Mi(o[4]),0,0,Wo(i)));if(o.length===6)return AV(ml.fromParts(Mi(o[0]),Mi(o[1])+1,Mi(o[2]),Mi(o[3]),Mi(o[4]),Mi(o[5]),0,Wo(i)));if(o.length===7)return AV(ml.fromParts(Mi(o[0]),Mi(o[1])+1,Mi(o[2]),Mi(o[3]),Mi(o[4]),Mi(o[5]),Mi(o[6]),Wo(i)));if(o.length===8)return AV(ml.fromParts(Mi(o[0]),Mi(o[1])+1,Mi(o[2]),Mi(o[3]),Mi(o[4]),Mi(o[5]),Mi(o[6]),_pt(rn(o[7]),i)));if(o.length===2){let a,l=rn(o[1]);return l===""?null:(l=gRe(l),a=l==="X"?zs.fromSeconds(Mi(o[0])):l==="x"?zs.fromMillis(Mi(o[0])):zs.fromFormat(rn(o[0]),l,{locale:Y0(),numberingSystem:"latn"}),a.isValid?ml.dateTimeToArcadeDate(a):null)}if(o.length===1){if(vn(o[0])){if(o[0].replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return Jh(o[0]+"-01-01",Wo(i))}const a=Mi(o[0]);if(isNaN(a)===!1){const l=zs.fromMillis(a);return l.isValid?ml.dateTimeAndZoneToArcadeDate(l,Wo(i)):null}return Jh(o[0],Wo(i))}return o.length===0?ml.nowToArcadeDate(Wo(i)):null})},t.datediff=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,2,4,i,r);let a=Jh(o[0],Wo(i)),l=Jh(o[1],Wo(i));if(a===null||l===null)return NaN;let c=un(o[3],"");switch(c!==""&&c!==null?(c=rn(c),a=ml.arcadeDateAndZoneToArcadeDate(a,c),l=ml.arcadeDateAndZoneToArcadeDate(l,c)):a.timeZone!==l.timeZone&&(a.isUnknownTimeZone?a=ml.arcadeDateAndZoneToArcadeDate(a,l.timeZone):l=(l.isUnknownTimeZone,ml.arcadeDateAndZoneToArcadeDate(l,a.timeZone))),rn(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")}})},t.dateadd=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,2,3,i,r);const a=Jh(o[0],Wo(i));if(a===null)return null;let l=Mi(o[1]);if(isNaN(l))return a;let c="milliseconds";switch(rn(o[2]).toLowerCase()){case"days":case"day":case"d":c="days",l=fRe(l);break;case"months":case"month":c="months",l=fRe(l);break;case"minutes":case"minute":case"m":c=o[2]==="M"?"months":"minutes";break;case"seconds":case"second":case"s":c="seconds";break;case"milliseconds":case"millisecond":case"ms":c="milliseconds";break;case"hours":case"hour":case"h":c="hours";break;case"years":case"year":case"y":c="years"}return a.plus({[c]:l})})}}function nE(t,e,i){return Math.sqrt((t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]!==void 0&&e[2]!==void 0?(t[2]*i-e[2]*i)**2:0))}const QK=[];for(const t of[[9002,56146130,6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const e=t[0];for(let i=1;i0?(r.x/=n,r.y/=n,e&&(r.z/=n),i&&(r.m/=n)):(r.x=t[0][0],r.y=t[0][1],e&&(r.z=t[0][2]),i&&e?r.m=t[0][3]:i&&(r.m=t[0][2])),r}function pAi(t,e,i,r){const n={x:(t[0]+e[0])/2,y:(t[1]+e[1])/2};return i&&(n.z=(t[2]+e[2])/2),i&&r?n.m=(t[3]+e[3])/2:r&&(n.m=(t[2]+e[2])/2),n}function fAi(t,e){if(t.length<=1)return 0;let i=0;for(let r=1;r0?(i.x/=n,i.y/=n,t.hasZ===!0&&(i.z/=n),t.hasM===!0&&(i.m/=n),new Yi(i)):r>0?(e.x/=r,e.y/=r,t.hasZ===!0&&(i.z/=r),t.hasM===!0&&(e.m/=r),new Yi(e)):null}function Cpt(t){if(t.points.length===0)return null;let e=0,i=0,r=0,n=0;for(let o=0;o=r;)t-=e;return t}function Tpt(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}function vAi(t,e){return sde(Tpt(t,e),2*Math.PI)*(180/Math.PI)}function _Ai(t,e){return sde(Math.PI/2-Tpt(t,e),2*Math.PI)*(180/Math.PI)}function Ept(t,e,i){const r={x:t.x-e.x,y:t.y-e.y},n={x:i.x-e.x,y:i.y-e.y};return Math.atan2(yAi(r,n),gAi(r,n))}function bAi(t,e,i){return sde(Ept(t,e,i),2*Math.PI)*(180/Math.PI)}function wAi(t,e,i){return sde(-1*Ept(t,e,i),2*Math.PI)*(180/Math.PI)}eJ[9002]=.3048,eJ[9003]=.3048006096012192,eJ[9095]=.3048007491;const mg=[0,0];function Ipt(t){for(let e=0;e{Zi(o,1,1,i,r);let a=[],l=!1,c=!1;if(o[0]===null)return!1;if(Tn(o[0])){for(const d of o[0]){if(!(d instanceof Yi))throw new Nt(i,Et.InvalidParameter,r);a.push(d.hasZ?d.hasM?[d.x,d.y,d.z,d.m]:[d.x,d.y,d.z]:[d.x,d.y])}a.length>0&&(l=o[0][0].hasZ,c=o[0][0].hasM)}else if(o[0]instanceof SN)a=o[0]._elements,a.length>0&&(l=o[0]._hasZ,c=o[0]._hasM);else{if(!_s(o[0]))throw new Nt(i,Et.InvalidParameter,r);for(const d of o[0].toArray()){if(!(d instanceof Yi))throw new Nt(i,Et.InvalidParameter,r);a.push(d.hasZ?d.hasM?[d.x,d.y,d.z,d.m]:[d.x,d.y,d.z]:[d.x,d.y])}a.length>0&&(l=o[0].get(0).hasZ,c=o[0].get(0).hasM)}return!(a.length<3)&&iW(a,c,l)})},t.polygon=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);let a=null;if(o[0]instanceof es){if(a=Zh(ah.parseGeometryFromDictionary(o[0]),i.spatialReference),!(a instanceof po))throw new Nt(i,Et.InvalidParameter,r)}else a=o[0]instanceof po?fl(o[0].toJSON()):Zh(new po(JSON.parse(o[0])),i.spatialReference);if(a!==null&&a.spatialReference.equals(i.spatialReference)===!1)throw new Nt(i,Et.WrongSpatialReference,r);return TN(a)})},t.polyline=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);let a=null;if(o[0]instanceof es){if(a=Zh(ah.parseGeometryFromDictionary(o[0]),i.spatialReference),!(a instanceof va))throw new Nt(i,Et.InvalidParameter,r)}else a=o[0]instanceof va?fl(o[0].toJSON()):Zh(new va(JSON.parse(o[0])),i.spatialReference);if(a!==null&&a.spatialReference.equals(i.spatialReference)===!1)throw new Nt(i,Et.WrongSpatialReference,r);return TN(a)})},t.point=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);let a=null;if(o[0]instanceof es){if(a=Zh(ah.parseGeometryFromDictionary(o[0]),i.spatialReference),!(a instanceof Yi))throw new Nt(i,Et.InvalidParameter,r)}else a=o[0]instanceof Yi?fl(o[0].toJSON()):Zh(new Yi(JSON.parse(o[0])),i.spatialReference);if(a!==null&&a.spatialReference.equals(i.spatialReference)===!1)throw new Nt(i,Et.WrongSpatialReference,r);return TN(a)})},t.multipoint=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);let a=null;if(o[0]instanceof es){if(a=Zh(ah.parseGeometryFromDictionary(o[0]),i.spatialReference),!(a instanceof fd))throw new Nt(i,Et.InvalidParameter,r)}else a=o[0]instanceof fd?fl(o[0].toJSON()):Zh(new fd(JSON.parse(o[0])),i.spatialReference);if(a!==null&&a.spatialReference.equals(i.spatialReference)===!1)throw new Nt(i,Et.WrongSpatialReference,r);return TN(a)})},t.extent=function(i,r){return e(i,r,(n,s,o)=>{o=Yn(o),Zi(o,1,1,i,r);let a=null;if(o[0]instanceof es)a=Zh(ah.parseGeometryFromDictionary(o[0]),i.spatialReference);else if(o[0]instanceof Yi){const l={xmin:o[0].x,ymin:o[0].y,xmax:o[0].x,ymax:o[0].y,spatialReference:o[0].spatialReference.toJSON()},c=o[0];c.hasZ?(l.zmin=c.z,l.zmax=c.z):c.hasM&&(l.mmin=c.m,l.mmax=c.m),a=fl(l)}else a=o[0]instanceof po||o[0]instanceof va||o[0]instanceof fd?fl(o[0].extent?.toJSON()):o[0]instanceof vr?fl(o[0].toJSON()):Zh(new vr(JSON.parse(o[0])),i.spatialReference);if(a!==null&&a.spatialReference.equals(i.spatialReference)===!1)throw new Nt(i,Et.WrongSpatialReference,r);return TN(a)})},t.geometry=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);let a=null;if(o[0]===null)return null;if(a=ode(o[0])?Zh(o[0].geometry(),i.spatialReference):o[0]instanceof es?Zh(ah.parseGeometryFromDictionary(o[0]),i.spatialReference):Zh(fl(JSON.parse(o[0])),i.spatialReference),a!==null&&a.spatialReference.equals(i.spatialReference)===!1)throw new Nt(i,Et.WrongSpatialReference,r);return TN(a)})},t.setgeometry=function(i,r){return e(i,r,(n,s,o)=>{if(Zi(o,2,2,i,r),!ode(o[0]))throw new Nt(i,Et.InvalidParameter,r);if(o[0].immutable===!0)throw new Nt(i,Et.Immutable,r);if(!(o[1]instanceof Jr||o[1]===null))throw new Nt(i,Et.InvalidParameter,r);return o[0]._geometry=o[1],Xr})},t.feature=function(i,r){return e(i,r,(n,s,o)=>{if(o.length===0)throw new Nt(i,Et.WrongNumberOfParameters,r);let a=null;if(o.length===1)if(vn(o[0]))a=ah.fromJson(JSON.parse(o[0]),i.timeReference);else if(ode(o[0]))a=ah.createFromArcadeFeature(o[0]);else if(o[0]instanceof Jr)a=ah.createFromGraphicLikeObject(o[0],null,null,i.timeReference);else{if(!(o[0]instanceof es))throw new Nt(i,Et.InvalidParameter,r);{let l=o[0].hasField("geometry")?o[0].field("geometry"):null,c=o[0].hasField("attributes")?o[0].field("attributes"):null;l!==null&&l instanceof es&&(l=ah.parseGeometryFromDictionary(l)),c!==null&&(c=ah.parseAttributesFromDictionary(c)),a=ah.createFromGraphicLikeObject(l,c,null,i.timeReference)}}else if(o.length===2){let l=null,c=null;if(o[0]!==null)if(o[0]instanceof Jr)l=o[0];else{if(!(l instanceof es))throw new Nt(i,Et.InvalidParameter,r);l=ah.parseGeometryFromDictionary(o[0])}if(o[1]!==null){if(!(o[1]instanceof es))throw new Nt(i,Et.InvalidParameter,r);c=ah.parseAttributesFromDictionary(o[1])}a=ah.createFromGraphicLikeObject(l,c,null,i.timeReference)}else{let l=null;const c={};if(o[0]!==null)if(o[0]instanceof Jr)l=o[0];else{if(!(l instanceof es))throw new Nt(i,Et.InvalidParameter,r);l=ah.parseGeometryFromDictionary(o[0])}for(let d=1;d{if(o.length===0){const c=new es;return c.immutable=!1,c}if(o.length===1&&vn(o[0]))try{const c=JSON.parse(o[0]),d=es.convertObjectToArcadeDictionary(c,Wo(i),!1);return d.immutable=!1,d}catch{throw new Nt(i,Et.InvalidParameter,r)}if(o.length%2!=0)throw new Nt(i,Et.WrongNumberOfParameters,r);const a={};for(let c=0;c{Zi(o,2,2,i,r);const a=rn(o[1]);if(ode(o[0])||o[0]instanceof es)return o[0].hasField(a);if(o[0]instanceof Jr){const l=AN(o[0],a,null,null,2);return!l||l.keystate!=="notfound"}throw new Nt(i,Et.InvalidParameter,r)})},t.hasvalue=function(i,r){return e(i,r,(n,s,o)=>{if(Zi(o,2,2,i,r),o[0]===null||o[1]===null)return!1;const a=rn(o[1]);return du(o[0])||o[0]instanceof es?!!o[0].hasField(a)&&o[0].field(a)!==null:o[0]instanceof Jr?AN(o[0],a,null,null,0)!==null:!1})},t.indexof=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,2,2,i,r);const a=o[1];if(Tn(o[0])){for(let l=0;l{if(o=Yn(o),Zi(o,2,3,i,r),!(o[0]instanceof Yi))throw new Nt(i,Et.InvalidParameter,r);if(!(o[1]instanceof Yi))throw new Nt(i,Et.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof Yi))throw new Nt(i,Et.InvalidParameter,r);return o.length===2?vAi(o[0],o[1]):bAi(o[0],o[1],o[2])})},t.bearing=function(i,r){return e(i,r,(n,s,o)=>{if(o=Yn(o),Zi(o,2,3,i,r),!(o[0]instanceof Yi))throw new Nt(i,Et.InvalidParameter,r);if(!(o[1]instanceof Yi))throw new Nt(i,Et.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof Yi))throw new Nt(i,Et.InvalidParameter,r);return o.length===2?_Ai(o[0],o[1]):wAi(o[0],o[1],o[2])})},t.isselfintersecting=function(i,r){return e(i,r,(n,s,o)=>{o=Yn(o),Zi(o,1,1,i,r);let a=o[0];if(a instanceof po)return a.isSelfIntersecting;if(a instanceof va)return a=a.paths,Ipt(a);if(a instanceof fd){const l=a.points;for(let c=0;c(a=Yn(a),i(r,n,a),a[0]===null||a[1]===null||Ja.disjoint(a[0],a[1])))},t.intersects=function(r,n){return e(r,n,(s,o,a)=>(a=Yn(a),i(r,n,a),a[0]!==null&&a[1]!==null&&Ja.intersects(a[0],a[1])))},t.touches=function(r,n){return e(r,n,(s,o,a)=>(a=Yn(a),i(r,n,a),a[0]!==null&&a[1]!==null&&Ja.touches(a[0],a[1])))},t.crosses=function(r,n){return e(r,n,(s,o,a)=>(a=Yn(a),i(r,n,a),a[0]!==null&&a[1]!==null&&Ja.crosses(a[0],a[1])))},t.within=function(r,n){return e(r,n,(s,o,a)=>(a=Yn(a),i(r,n,a),a[0]!==null&&a[1]!==null&&Ja.within(a[0],a[1])))},t.contains=function(r,n){return e(r,n,(s,o,a)=>(a=Yn(a),i(r,n,a),a[0]!==null&&a[1]!==null&&Ja.contains(a[0],a[1])))},t.overlaps=function(r,n){return e(r,n,(s,o,a)=>(a=Yn(a),i(r,n,a),a[0]!==null&&a[1]!==null&&Ja.overlaps(a[0],a[1])))},t.equals=function(r,n){return e(r,n,(s,o,a)=>(Zi(a,2,2,r,n),a[0]===a[1]||(a[0]instanceof Jr&&a[1]instanceof Jr?Ja.equals(a[0],a[1]):!(!Tu(a[0])||!Tu(a[1]))&&a[0].equals(a[1]))))},t.relate=function(r,n){return e(r,n,(s,o,a)=>{if(a=Yn(a),Zi(a,3,3,r,n),a[0]instanceof Jr&&a[1]instanceof Jr)return Ja.relate(a[0],a[1],rn(a[2]));if(a[0]instanceof Jr&&a[1]===null||a[1]instanceof Jr&&a[0]===null||a[0]===null&&a[1]===null)return!1;throw new Nt(r,Et.InvalidParameter,n)})},t.intersection=function(r,n){return e(r,n,(s,o,a)=>(a=Yn(a),i(r,n,a),a[0]===null||a[1]===null?null:Ja.intersect(a[0],a[1])))},t.union=function(r,n){return e(r,n,(s,o,a)=>{const l=[];if((a=Yn(a)).length===0)throw new Nt(r,Et.WrongNumberOfParameters,n);if(a.length===1)if(Tn(a[0])){const c=Yn(a[0]);for(let d=0;d(a=Yn(a),i(r,n,a),a[0]!==null&&a[1]===null?pp(a[0]):a[0]===null?null:Ja.difference(a[0],a[1])))},t.symmetricdifference=function(r,n){return e(r,n,(s,o,a)=>(a=Yn(a),i(r,n,a),a[0]===null&&a[1]===null?null:a[0]===null?pp(a[1]):a[1]===null?pp(a[0]):Ja.symmetricDifference(a[0],a[1])))},t.clip=function(r,n){return e(r,n,(s,o,a)=>{if(a=Yn(a),Zi(a,2,2,r,n),!(a[1]instanceof vr)&&a[1]!==null)throw new Nt(r,Et.InvalidParameter,n);if(a[0]===null)return null;if(!(a[0]instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);return a[1]===null?null:Ja.clip(a[0],a[1])})},t.cut=function(r,n){return e(r,n,(s,o,a)=>{if(a=Yn(a),Zi(a,2,2,r,n),!(a[1]instanceof va)&&a[1]!==null)throw new Nt(r,Et.InvalidParameter,n);if(a[0]===null)return[];if(!(a[0]instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);return a[1]===null?[pp(a[0])]:Ja.cut(a[0],a[1])})},t.area=function(r,n){return e(r,n,(s,o,a)=>{if(Zi(a,1,2,r,n),(a=Yn(a))[0]===null)return 0;if(Tn(a[0])||_s(a[0])){const l=XK(a[0],r.spatialReference);return l===null?0:Ja.planarArea(l,sE(un(a[1],-1)))}if(!(a[0]instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);return Ja.planarArea(a[0],sE(un(a[1],-1)))})},t.areageodetic=function(r,n){return e(r,n,(s,o,a)=>{if(Zi(a,1,2,r,n),(a=Yn(a))[0]===null)return 0;if(Tn(a[0])||_s(a[0])){const l=XK(a[0],r.spatialReference);return l===null?0:Ja.geodesicArea(l,sE(un(a[1],-1)))}if(!(a[0]instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);return Ja.geodesicArea(a[0],sE(un(a[1],-1)))})},t.length=function(r,n){return e(r,n,(s,o,a)=>{if(Zi(a,1,2,r,n),(a=Yn(a))[0]===null)return 0;if(Tn(a[0])||_s(a[0])){const l=bD(a[0],r.spatialReference);return l===null?0:Ja.planarLength(l,ql(un(a[1],-1)))}if(!(a[0]instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);return Ja.planarLength(a[0],ql(un(a[1],-1)))})},t.length3d=function(r,n){return e(r,n,(s,o,a)=>{if(Zi(a,1,2,r,n),(a=Yn(a))[0]===null)return 0;if(Tn(a[0])||_s(a[0])){const l=bD(a[0],r.spatialReference);return l===null?0:l.hasZ===!0?Opt(l,ql(un(a[1],-1))):Ja.planarLength(l,ql(un(a[1],-1)))}if(!(a[0]instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);return a[0].hasZ===!0?Opt(a[0],ql(un(a[1],-1))):Ja.planarLength(a[0],ql(un(a[1],-1)))})},t.lengthgeodetic=function(r,n){return e(r,n,(s,o,a)=>{if(Zi(a,1,2,r,n),(a=Yn(a))[0]===null)return 0;if(Tn(a[0])||_s(a[0])){const l=bD(a[0],r.spatialReference);return l===null?0:Ja.geodesicLength(l,ql(un(a[1],-1)))}if(!(a[0]instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);return Ja.geodesicLength(a[0],ql(un(a[1],-1)))})},t.distance=function(r,n){return e(r,n,(s,o,a)=>{a=Yn(a),Zi(a,2,3,r,n);let l=a[0];(Tn(a[0])||_s(a[0]))&&(l=IN(a[0],r.spatialReference));let c=a[1];if((Tn(a[1])||_s(a[1]))&&(c=IN(a[1],r.spatialReference)),!(l instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);if(!(c instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);return Ja.distance(l,c,ql(un(a[2],-1)))})},t.distancegeodetic=function(r,n){return e(r,n,(s,o,a)=>{a=Yn(a),Zi(a,2,3,r,n);const l=a[0],c=a[1];if(!(l instanceof Yi))throw new Nt(r,Et.InvalidParameter,n);if(!(c instanceof Yi))throw new Nt(r,Et.InvalidParameter,n);const d=new va({paths:[],spatialReference:l.spatialReference});return d.addPath([l,c]),Ja.geodesicLength(d,ql(un(a[2],-1)))})},t.densify=function(r,n){return e(r,n,(s,o,a)=>{if(a=Yn(a),Zi(a,2,3,r,n),a[0]===null)return null;if(!(a[0]instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);const l=Mi(a[1]);if(isNaN(l))throw new Nt(r,Et.InvalidParameter,n);if(l<=0)throw new Nt(r,Et.InvalidParameter,n);return a[0]instanceof po||a[0]instanceof va?Ja.densify(a[0],l,ql(un(a[2],-1))):a[0]instanceof vr?Ja.densify(Ppt(a[0]),l,ql(un(a[2],-1))):a[0]})},t.densifygeodetic=function(r,n){return e(r,n,(s,o,a)=>{if(a=Yn(a),Zi(a,2,3,r,n),a[0]===null)return null;if(!(a[0]instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);const l=Mi(a[1]);if(isNaN(l))throw new Nt(r,Et.InvalidParameter,n);if(l<=0)throw new Nt(r,Et.InvalidParameter,n);return a[0]instanceof po||a[0]instanceof va?Ja.geodesicDensify(a[0],l,ql(un(a[2],-1))):a[0]instanceof vr?Ja.geodesicDensify(Ppt(a[0]),l,ql(un(a[2],-1))):a[0]})},t.generalize=function(r,n){return e(r,n,(s,o,a)=>{if(a=Yn(a),Zi(a,2,4,r,n),a[0]===null)return null;if(!(a[0]instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);const l=Mi(a[1]);if(isNaN(l))throw new Nt(r,Et.InvalidParameter,n);return Ja.generalize(a[0],l,ub(un(a[2],!0)),ql(un(a[3],-1)))})},t.buffer=function(r,n){return e(r,n,(s,o,a)=>{if(a=Yn(a),Zi(a,2,3,r,n),a[0]===null)return null;if(!(a[0]instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);const l=Mi(a[1]);if(isNaN(l))throw new Nt(r,Et.InvalidParameter,n);return l===0?pp(a[0]):Ja.buffer(a[0],l,ql(un(a[2],-1)))})},t.buffergeodetic=function(r,n){return e(r,n,(s,o,a)=>{if(a=Yn(a),Zi(a,2,3,r,n),a[0]===null)return null;if(!(a[0]instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);const l=Mi(a[1]);if(isNaN(l))throw new Nt(r,Et.InvalidParameter,n);return l===0?pp(a[0]):Ja.geodesicBuffer(a[0],l,ql(un(a[2],-1)))})},t.offset=function(r,n){return e(r,n,(s,o,a)=>{if(a=Yn(a),Zi(a,2,6,r,n),a[0]===null)return null;if(!(a[0]instanceof po||a[0]instanceof va))throw new Nt(r,Et.InvalidParameter,n);const l=Mi(a[1]);if(isNaN(l))throw new Nt(r,Et.InvalidParameter,n);const c=Mi(un(a[4],10));if(isNaN(c))throw new Nt(r,Et.InvalidParameter,n);const d=Mi(un(a[5],0));if(isNaN(d))throw new Nt(r,Et.InvalidParameter,n);return Ja.offset(a[0],l,ql(un(a[2],-1)),rn(un(a[3],"round")).toLowerCase(),c,d)})},t.rotate=function(r,n){return e(r,n,(s,o,a)=>{a=Yn(a),Zi(a,2,3,r,n);let l=a[0];if(l===null)return null;if(!(l instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);l instanceof vr&&(l=po.fromExtent(l));const c=Mi(a[1]);if(isNaN(c))throw new Nt(r,Et.InvalidParameter,n);const d=un(a[2],null);if(d===null)return Ja.rotate(l,c);if(d instanceof Yi)return Ja.rotate(l,c,d);throw new Nt(r,Et.InvalidParameter,n)})},t.centroid=function(r,n){return e(r,n,(s,o,a)=>{if(a=Yn(a),Zi(a,1,1,r,n),a[0]===null)return null;let l=a[0];if((Tn(a[0])||_s(a[0]))&&(l=IN(a[0],r.spatialReference)),l===null)return null;if(!(l instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);return l instanceof Yi?Zh(pp(a[0]),r.spatialReference):l instanceof po?l.centroid:l instanceof va?Spt(l):l instanceof fd?Cpt(l):l instanceof vr?l.center:null})},t.multiparttosinglepart=function(r,n){return e(r,n,(s,o,a)=>{a=Yn(a),Zi(a,1,1,r,n);const l=[];if(a[0]===null)return null;if(!(a[0]instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);if(a[0]instanceof Yi)return[Zh(pp(a[0]),r.spatialReference)];if(a[0]instanceof vr)return[Zh(pp(a[0]),r.spatialReference)];const c=Ja.simplify(a[0]);if(c instanceof po){const d=[],p=[];for(let y=0;y{if(a=Yn(a),Zi(a,1,1,r,n),a[0]===null)return!0;if(!(a[0]instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);return Ja.isSimple(a[0])})},t.simplify=function(r,n){return e(r,n,(s,o,a)=>{if(a=Yn(a),Zi(a,1,1,r,n),a[0]===null)return null;if(!(a[0]instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);return Ja.simplify(a[0])})},t.convexhull=function(r,n){return e(r,n,(s,o,a)=>{if(a=Yn(a),Zi(a,1,1,r,n),a[0]===null)return null;if(!(a[0]instanceof Jr))throw new Nt(r,Et.InvalidParameter,n);return Ja.convexHull(a[0])})}}const SAi=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:PRe,setGeometryEngine:xAi},Symbol.toStringTag,{value:"Module"}));function ORe(t,e,i){return i===void 0||+i==0?Math[t](e):(e=+e,i=+i,isNaN(e)||typeof i!="number"||i%1!=0?NaN:(e=e.toString().split("e"),+((e=(e=Math[t](+(e[0]+"e"+(e[1]?+e[1]-i:-i)))).toString().split("e"))[0]+"e"+(e[1]?+e[1]+i:i))))}function RRe(t,e){function i(r,n,s){const o=Mi(r);return isNaN(o)?o:isNaN(n)||isNaN(s)||n>s?NaN:os?s:o}t.number=function(r,n){return e(r,n,(s,o,a)=>{Zi(a,1,2,r,n);const l=a[0];if(Ka(l))return l;if(l===null)return 0;if(Tu(l))return l.toNumber();if(La(l))return Number(l);if(Tn(l))return NaN;if(l===""||l===void 0)return Number(l);if(vn(l)){if(a[1]!==void 0){let c=Hw(a[1],"‰","");return c=Hw(c,"¤",""),apt(l,{pattern:c})}return Number(l.trim())}return Number(l)})},t.abs=function(r,n){return e(r,n,(s,o,a)=>(Zi(a,1,1,r,n),Math.abs(Mi(a[0]))))},t.acos=function(r,n){return e(r,n,(s,o,a)=>(Zi(a,1,1,r,n),Math.acos(Mi(a[0]))))},t.asin=function(r,n){return e(r,n,(s,o,a)=>(Zi(a,1,1,r,n),Math.asin(Mi(a[0]))))},t.atan=function(r,n){return e(r,n,(s,o,a)=>(Zi(a,1,1,r,n),Math.atan(Mi(a[0]))))},t.atan2=function(r,n){return e(r,n,(s,o,a)=>(Zi(a,2,2,r,n),Math.atan2(Mi(a[0]),Mi(a[1]))))},t.ceil=function(r,n){return e(r,n,(s,o,a)=>{if(Zi(a,1,2,r,n),a.length===2){let l=Mi(a[1]);return isNaN(l)&&(l=0),ORe("ceil",Mi(a[0]),-1*l)}return Math.ceil(Mi(a[0]))})},t.round=function(r,n){return e(r,n,(s,o,a)=>{if(Zi(a,1,2,r,n),a.length===2){let l=Mi(a[1]);return isNaN(l)&&(l=0),ORe("round",Mi(a[0]),-1*l)}return Math.round(Mi(a[0]))})},t.floor=function(r,n){return e(r,n,(s,o,a)=>{if(Zi(a,1,2,r,n),a.length===2){let l=Mi(a[1]);return isNaN(l)&&(l=0),ORe("floor",Mi(a[0]),-1*l)}return Math.floor(Mi(a[0]))})},t.cos=function(r,n){return e(r,n,(s,o,a)=>(Zi(a,1,1,r,n),Math.cos(Mi(a[0]))))},t.isnan=function(r,n){return e(r,n,(s,o,a)=>(Zi(a,1,1,r,n),typeof a[0]=="number"&&isNaN(a[0])))},t.exp=function(r,n){return e(r,n,(s,o,a)=>(Zi(a,1,1,r,n),Math.exp(Mi(a[0]))))},t.log=function(r,n){return e(r,n,(s,o,a)=>(Zi(a,1,1,r,n),Math.log(Mi(a[0]))))},t.pow=function(r,n){return e(r,n,(s,o,a)=>(Zi(a,2,2,r,n),Mi(a[0])**Mi(a[1])))},t.random=function(r,n){return e(r,n,(s,o,a)=>(Zi(a,0,0,r,n),Math.random()))},t.sin=function(r,n){return e(r,n,(s,o,a)=>(Zi(a,1,1,r,n),Math.sin(Mi(a[0]))))},t.sqrt=function(r,n){return e(r,n,(s,o,a)=>(Zi(a,1,1,r,n),Math.sqrt(Mi(a[0]))))},t.tan=function(r,n){return e(r,n,(s,o,a)=>(Zi(a,1,1,r,n),Math.tan(Mi(a[0]))))},t.defaultvalue=function(r,n){return e(r,n,(s,o,a)=>(Zi(a,2,2,r,n),a[0]===null||a[0]===""||a[0]===void 0?a[1]:a[0]))},t.isempty=function(r,n){return e(r,n,(s,o,a)=>(Zi(a,1,1,r,n),a[0]===null||a[0]===""||a[0]===void 0))},t.boolean=function(r,n){return e(r,n,(s,o,a)=>{Zi(a,1,1,r,n);const l=a[0];return ub(l)})},t.constrain=function(r,n){return e(r,n,(s,o,a)=>{Zi(a,3,3,r,n);const l=Mi(a[1]),c=Mi(a[2]);if(Tn(a[0])){const d=[];for(const p of a[0])d.push(i(p,l,c));return d}if(_s(a[0])){const d=[];for(let p=0;p=e&&e!==-1)return i}return i}function rS(t,e,i=1e3){switch(t.toLowerCase()){case"distinct":return TAi(e,i);case"avg":case"mean":return Rpt(CN(e));case"min":return Math.min.apply(Math,CN(e));case"sum":return CAi(CN(e));case"max":return Math.max.apply(Math,CN(e));case"stdev":case"stddev":return Math.sqrt(Mpt(CN(e)));case"var":case"variance":return Mpt(CN(e));case"count":return e.length}return 0}function xD(t,e,i,r){if(r.length===1){if(Tn(r[0]))return rS(t,r[0],-1);if(_s(r[0]))return rS(t,r[0].toArray(),-1)}return rS(t,r,-1)}function MRe(t,e){t.stdev=function(i,r){return e(i,r,(n,s,o)=>xD("stdev",n,s,o))},t.variance=function(i,r){return e(i,r,(n,s,o)=>xD("variance",n,s,o))},t.average=function(i,r){return e(i,r,(n,s,o)=>xD("mean",n,s,o))},t.mean=function(i,r){return e(i,r,(n,s,o)=>xD("mean",n,s,o))},t.sum=function(i,r){return e(i,r,(n,s,o)=>xD("sum",n,s,o))},t.min=function(i,r){return e(i,r,(n,s,o)=>xD("min",n,s,o))},t.max=function(i,r){return e(i,r,(n,s,o)=>xD("max",n,s,o))},t.distinct=function(i,r){return e(i,r,(n,s,o)=>xD("distinct",n,s,o))},t.count=function(i,r){return e(i,r,(n,s,o)=>{if(Zi(o,1,1,i,r),Tn(o[0])||vn(o[0]))return o[0].length;if(_s(o[0]))return o[0].length();throw new Nt(i,Et.InvalidParameter,r)})}}let PV=class extends es{constructor(e){super(),this.declaredClass="esri.arcade.Portal",this.immutable=!1,this.setField("url",e),this.immutable=!0}},Dpt=class extends es{constructor(e,i,r,n,s,o){super(),this.attachmentUrl=s,this.declaredClass="esri.arcade.Attachment",this.immutable=!1,this.setField("id",e),this.setField("name",i),this.setField("contenttype",r),this.setField("size",n),this.setField("exifinfo",o),this.immutable=!0}};const DRe=t=>(e,i,r)=>(r=r||14,+t(e,i).toFixed(r)),EAi=(t,e)=>t+e,IAi=(t,e)=>t*e,AAi=(t,e)=>t/e,Fpt=(t,e,i)=>DRe(EAi)(t,e,i),OV=(t,e,i)=>DRe(IAi)(t,e,i),ade=(t,e,i)=>DRe(AAi)(t,e,i),lde=360,PAi=400,OAi=2*Math.PI,nS=3600,Lpt=3240,tJ=60,SD=60,kpt=180*nS/Math.PI,iJ=lde*tJ*SD,FRe=90*nS,RV=180*nS,RAi=270*nS,Npt=String.fromCharCode(7501),rJ="°";function nJ(t){if(vn(t)===!1)throw new Nt(null,Et.InvalidParameter,null);return t}function LRe(t,e){const i=10**e;return Math.round(t*i)/i}function MAi(t,e){return t%e}function MV(t){const e=parseFloat(t.toString().replace(Math.trunc(t).toString(),"0"))*Math.sign(t);return t<0?{fraction:e,integer:Math.ceil(t)}:{fraction:e,integer:Math.floor(t)}}var hc,Mn,pu,kRe;function DV(t,e){switch(t){case hc.north:return e==="SHORT"?"N":"North";case hc.east:return e==="SHORT"?"E":"East";case hc.south:return e==="SHORT"?"S":"South";case hc.west:return e==="SHORT"?"W":"West"}}function NRe(t,e,i){for(;t.length=RAi?hc.north:hc.south,r=i===hc.north?Math.min(iJ-e,e):Math.abs(e-RV),n=e>RV?hc.west:hc.east;return new DAi(i,r,n)}static createFromAngleMeridianAndDirection(e,i,r){return new M3(new oE(M3.secondsQuadrantToNorthAzimuth(e.extractAngularUnits(Mn.seconds),i,r)))}static secondsQuadrantToNorthAzimuth(e,i,r){return i===hc.north?r===hc.east?e:iJ-e:r===hc.east?RV-e:RV+e}static _convertDirectionFormat(e,i,r){let n=0;switch(i){case pu.north_azimuth:n=e;break;case pu.polar:n=FRe-e;break;case pu.quadrant:throw new Nt(null,Et.LogicError,null,{reason:"unexpected evaluation"});case pu.south_azimuth:n=e+RV}let s=0;switch(r){case pu.north_azimuth:s=n;break;case pu.polar:s=FRe-n;break;case pu.quadrant:throw new Nt(null,Et.LogicError,null,{reason:"unexpected evaluation"});case pu.south_azimuth:s=n-RV}return s=MAi(s,iJ),s<0?iJ+s:s}};function Gpt(t,e,i){let r=null;switch(e){case Mn.decimal_degrees:r=OV(t,nS);break;case Mn.seconds:r=t;break;case Mn.gradians:r=OV(t,Lpt);break;case Mn.radians:r=OV(t,kpt);break;default:throw new Nt(null,Et.LogicError,null,{reason:"unexpected evaluation"})}switch(i){case Mn.decimal_degrees:return ade(r,nS);case Mn.seconds:return r;case Mn.gradians:return ade(r,Lpt);case Mn.radians:return r/kpt;default:throw new Nt(null,Et.LogicError,null,{reason:"unexpected evaluation"})}}let oE=class L9e{constructor(e){this._seconds=e}static createFromAngleAndUnits(e,i){return new L9e(Gpt(e,i,Mn.seconds))}extractAngularUnits(e){return Gpt(this._seconds,Mn.seconds,sJ(e))}static createFromDegreesMinutesSeconds(e,i,r){return new L9e(Fpt(Fpt(OV(e,nS),OV(i,SD)),r))}};function sJ(t){switch(ig(t),t){case Mn.decimal_degrees:case Mn.truncated_degrees:case Mn.degrees_minutes_seconds:return Mn.decimal_degrees;case Mn.gradians:return Mn.gradians;case Mn.fractional_degree_minutes:return Mn.fractional_degree_minutes;case Mn.radians:return Mn.radians;case Mn.seconds:case Mn.fractional_minute_seconds:return Mn.seconds}}let FAi=class GLt{constructor(e,i,r,n){this.view=e,this.angle=i,this.merdian=r,this.direction=n,this._dms=null,this._formattedDms=null}static createFromStringAndBearing(e,i,r){return new GLt(e,i.getAngle(r),i.getMeridian(r),i.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,i=Mn.truncated_degrees,r=0;for(let n=0;n0?1:0));case Mn.truncated_degrees:case Mn.fractional_degree_minutes:return s=$Re(n.fetchFormattedDms().getField(e),BRe(e)),NRe(s.toFixed(r),"0",i+r+(r>0?1:0));case Mn.fractional_minute_seconds:return s=$Re(LRe(n.fetchDms().getField(e),r),BRe(e)),NRe(s.toFixed(r),"0",i+r+(r>0?1:0));default:throw new Nt(null,Et.LogicError,null,{reason:"unexpected evaluation"})}}function kAi(t,e,i){if(i===pu.quadrant)throw new Nt(null,Et.LogicError,null,{reason:"conversion error"});if(e===Mn.degrees_minutes_seconds){const r=FV.numberToDms(t);return CD.createFromAngleAndDirection(oE.createFromDegreesMinutesSeconds(r.m_degrees,r.m_minutes,r.m_seconds),i)}return CD.createFromAngleAndDirection(oE.createFromAngleAndUnits(t,sJ(e)),i)}function NAi(t){switch(Mi(t)){case 1:return{first:hc.north,second:hc.east};case 2:return{first:hc.south,second:hc.east};case 3:return{first:hc.south,second:hc.west};case 4:return{first:hc.north,second:hc.west}}return null}function Vpt(t){switch(t.toUpperCase().trim()){case"N":case"NORTH":return hc.north;case"E":case"EAST":return hc.east;case"S":case"SOUTH":return hc.south;case"W":case"WEST":return hc.west}return null}function LV(t){const e=parseFloat(t);if(Ka(e)){if(isNaN(e))throw new Nt(null,Et.LogicError,null,{reason:"invalid conversion"});return e}throw new Nt(null,Et.LogicError,null,{reason:"invalid conversion"})}function GRe(t,e,i){const r=i===pu.quadrant;let n=null,s=null,o=0,a=0,l=0;if(r){if(t.length<2)throw new Nt(null,Et.LogicError,null,{reason:"conversion error"});l=1;const c=NAi(rn(t[t.length-1]));if(c?(n=c.first,s=c.second):(o=1,n=Vpt(rn(t[0])),s=Vpt(rn(t[t.length-1]))),n===null||s===null)throw new Nt(null,Et.LogicError,null,{reason:"invalid conversion"})}switch(e){case Mn.decimal_degrees:case Mn.radians:case Mn.gradians:if(t.length===0)throw new Nt(null,Et.LogicError,null,{reason:"invalid conversion"});return r?CD.createFromAngleMeridianAndDirection(oE.createFromAngleAndUnits(LV(t[o]),sJ(e)),n,s):CD.createFromAngleAndDirection(oE.createFromAngleAndUnits(LV(t[o]),sJ(e)),i);case Mn.degrees_minutes_seconds:if(a=t.length-l-o,a===3){const c=oE.createFromDegreesMinutesSeconds(LV(t[o]),LV(t[o+1]),LV(t[o+2]));return r?CD.createFromAngleMeridianAndDirection(c,n,s):CD.createFromAngleAndDirection(c,i)}if(a===1){const c=LV(t[o]),d=FV.numberToDms(c),p=oE.createFromDegreesMinutesSeconds(d.m_degrees,d.m_minutes,d.m_seconds);return r?CD.createFromAngleMeridianAndDirection(p,n,s):CD.createFromAngleAndDirection(p,i)}}throw new Nt(null,Et.LogicError,null,{reason:"invalid conversion"})}function $Ai(t){const e=[" ","-","/","'",'"',"\\","^",rJ,Npt," ","\r",` -`,"*"];let i="";for(let r=0;rr!=="")}function BAi(t,e,i){if(Ka(t))return kAi(Mi(t),e,i);if(vn(t))return GRe($Ai(t),e,i);if(Tn(t))return GRe(t,e,i);if(_s(t))return GRe(t.toArray(),e,i);throw new Nt(null,Et.LogicError,null,{reason:"conversion error"})}function GAi(t,e,i){const r=sJ(i);if(r&&i!==Mn.degrees_minutes_seconds)return t.getAngle(e).extractAngularUnits(r);throw new Nt(null,Et.LogicError,null,{reason:"conversion error"})}function VAi(t,e,i){const r=t.getAngle(e);if(e===pu.quadrant&&i===Mn.degrees_minutes_seconds){const n=FV.secondsToDMS(r.extractAngularUnits(Mn.seconds));return[DV(t.getMeridian(e),"SHORT"),n.m_degrees,n.m_minutes,n.m_seconds,DV(t.getDirection(e),"SHORT")]}if(i===Mn.degrees_minutes_seconds){const n=FV.secondsToDMS(r.extractAngularUnits(Mn.seconds));return[n.m_degrees,n.m_minutes,n.m_seconds]}return e===pu.quadrant?[DV(t.getMeridian(e),"SHORT"),r.extractAngularUnits(i),DV(t.getDirection(e),"SHORT")]:[r.extractAngularUnits(i)]}function UAi(t,e){let i="";switch(t){case Mn.decimal_degrees:i=e===pu.quadrant?"DD.DD"+rJ:"DDD.DD"+rJ;break;case Mn.degrees_minutes_seconds:i=e===pu.quadrant?"dd"+rJ+` mm' ss"`:"ddd"+rJ+` mm' ss.ss"`;break;case Mn.radians:i="R.RR";break;case Mn.gradians:i="GGG.GG"+Npt;break;default:throw new Nt(null,Et.LogicError,null,{reason:"conversion error"})}return e===pu.quadrant&&(i="p "+i+" b"),i}function VRe(t,e,i){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):(i++,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),e.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return new Uint8Array(e)}let WAi=class{constructor(e){this._seed=e,this._totallen=0,this._bufs=[],this.init()}init(){return this._bufs=[],this._totallen=0,this}updateFloatArray(e){const i=[];for(const r of e)isNaN(r)?i.push("NaN"):r===1/0?i.push("Infinity"):r===-1/0?i.push("-Infinity"):r===0?i.push("0"):i.push(r.toString(16));this.update(zpt(i.join("")))}updateIntArray(e){const i=Int32Array.from(e);this.update(new Uint8Array(i.buffer))}updateUint8Array(e){this.update(Uint8Array.from(e))}updateWithString(e){return this.update(zpt(e))}update(e){return this._bufs.push(e),this._totallen+=e.length,this}digest(){const e=new Uint8Array(this._totallen);let i=0;for(const r of this._bufs)e.set(r,i),i+=r.length;return this.init(),this._xxHash32(e,this._seed)}_xxHash32(e,i=0){const r=e;let n=i+jpt&4294967295,s=0;if(r.length>=16){const a=[i+kV+NV&4294967295,i+NV&4294967295,i+0&4294967295,i-kV&4294967295],l=e,c=l.length-16;let d=0;for(s=0;(4294967280&s)<=c;s+=4){const p=s,y=l[p+0]+(l[p+1]<<8),v=l[p+2]+(l[p+3]<<8),S=y*NV+(v*NV<<16);let I=a[d]+S&4294967295;I=I<<13|I>>>19;const O=65535&I,L=I>>>16;a[d]=O*kV+(L*kV<<16)&4294967295,d=d+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+0]+(r[a+1]<<8),c=r[a+2]+(r[a+3]<<8);n=n+(l*ude+(c*ude<<16))&4294967295,n=n<<17|n>>>15,n=(65535&n)*Upt+((n>>>16)*Upt<<16)&4294967295}for(;s>>21,n=(65535&n)*kV+((n>>>16)*kV<<16)&4294967295;return n^=n>>>15,n=((65535&n)*NV&4294967295)+((n>>>16)*NV<<16),n^=n>>>13,n=((65535&n)*ude&4294967295)+((n>>>16)*ude<<16),n^=n>>>16,n<0?n+4294967296:n}};function qAi(t){return t.loadStatus==="loaded"&&t.user&&t.user.sourceJSON?t.user.sourceJSON:null}function YAi(t,e){return!!t&&e1e(t,e?.restUrl||"")}function Hpt(t,e){if(!t||!e)return t===e;if(t.x===e.x&&t.y===e.y){if(t.hasZ){if(t.z!==e.z)return!1}else if(e.hasZ)return!1;if(t.hasM){if(t.m!==e.m)return!1}else if(e.hasM)return!1;return!0}return!1}function Ww(t,e,i){if(t!==null)if(Tn(t)){if(e.updateUint8Array([61]),i.map.has(t)){const r=i.map.get(t);e.updateIntArray([61237541^r])}else{i.map.set(t,i.currentLength++);for(const r of t)Ww(r,e,i);i.map.delete(t),i.currentLength--}e.updateUint8Array([199])}else if(_s(t)){if(e.updateUint8Array([61]),i.map.has(t)){const r=i.map.get(t);e.updateIntArray([61237541^r])}else{i.map.set(t,i.currentLength++);for(const r of t.toArray())Ww(r,e,i);i.map.delete(t),i.currentLength--}e.updateUint8Array([199])}else{if(Tu(t))return e.updateIntArray([t.toNumber()]),void e.updateUint8Array([241]);if(vn(t))return e.updateIntArray([t.length]),e.updateWithString(t),void e.updateUint8Array([41]);if(La(t))e.updateUint8Array([t===!0?1:0,113]);else{if(Ka(t))return e.updateFloatArray([t]),void e.updateUint8Array([173]);if(t instanceof Dpt)throw new Nt(i.context,Et.UnsupportedHashType,i.node);if(t instanceof PV)throw new Nt(i.context,Et.UnsupportedHashType,i.node);if(!(t instanceof es)){if(du(t))throw new Nt(i.context,Et.UnsupportedHashType,i.node);if(t instanceof Yi)return e.updateIntArray([3833836621]),e.updateIntArray([0]),e.updateFloatArray([t.x]),e.updateIntArray([1]),e.updateFloatArray([t.y]),t.hasZ&&(e.updateIntArray([2]),e.updateFloatArray([t.z])),t.hasM&&(e.updateIntArray([3]),e.updateFloatArray([t.m])),e.updateIntArray([3765347959]),void Ww(t.spatialReference.wkid,e,i);if(t instanceof po){e.updateIntArray([1266616829]);for(let r=0;r(Zi(o,1,1,i,r),new PV(rn(o[0]))))},t.typeof=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);const a=dRe(o[0]);if(a==="Unrecognised Type")throw new Nt(i,Et.UnrecognisedType,r);return a})},t.trim=function(i,r){return e(i,r,(n,s,o)=>(Zi(o,1,1,i,r),rn(o[0]).trim()))},t.tohex=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);const a=Mi(o[0]);return isNaN(a)?a:a.toString(16)})},t.upper=function(i,r){return e(i,r,(n,s,o)=>(Zi(o,1,1,i,r),rn(o[0]).toUpperCase()))},t.proper=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,2,i,r);let a=1;o.length===2&&rn(o[1]).toLowerCase()==="firstword"&&(a=2);const l=/\s/,c=rn(o[0]);let d="",p=!0;for(let y=0;y(Zi(o,1,1,i,r),rn(o[0]).toLowerCase()))},t.guid=function(i,r){return e(i,r,(n,s,o)=>{if(Zi(o,0,1,i,r),o.length>0)switch(rn(o[0]).toLowerCase()){case"digits":return EV().replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return EV();case"digits-hyphen-braces":return"{"+EV()+"}";case"digits-hyphen-parentheses":return"("+EV()+")"}return"{"+EV()+"}"})},t.standardizeguid=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,2,2,i,r);let a=rn(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 c=l.groups;switch(a=c.partA+"-"+c.partB+"-"+c.partC+"-"+c.partD+"-"+c.partE,rn(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+"}"})},t.console=function(i,r){return e(i,r,(n,s,o)=>(o.length===0||(o.length===1?i.console(rn(o[0])):i.console(rn(o))),Xr))},t.mid=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,2,3,i,r);let a=Mi(o[1]);if(isNaN(a))return"";if(a<0&&(a=0),o.length===2)return rn(o[0]).substr(a);let l=Mi(o[2]);return isNaN(l)?"":(l<0&&(l=0),rn(o[0]).substr(a,l))})},t.find=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,2,3,i,r);let a=0;if(o.length>2){if(a=Mi(un(o[2],0)),isNaN(a))return-1;a<0&&(a=0)}return rn(o[1]).indexOf(rn(o[0]),a)})},t.left=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,2,2,i,r);let a=Mi(o[1]);return isNaN(a)?"":(a<0&&(a=0),rn(o[0]).substr(0,a))})},t.right=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,2,2,i,r);let a=Mi(o[1]);return isNaN(a)?"":(a<0&&(a=0),rn(o[0]).substr(-1*a,a))})},t.split=function(i,r){return e(i,r,(n,s,o)=>{let a;Zi(o,2,4,i,r);let l=Mi(un(o[2],-1));const c=ub(un(o[3],!1));if(l===-1||l===null||c===!0?a=rn(o[0]).split(rn(o[1])):(isNaN(l)&&(l=-1),l<-1&&(l=-1),a=rn(o[0]).split(rn(o[1]),l)),c===!1)return a;const d=[];for(let p=0;p=l);p++)a[p]!==""&&a[p]!==void 0&&d.push(a[p]);return d})},t.text=function(i,r){return e(i,r,(n,s,o)=>(Zi(o,1,2,i,r),O_(o[0],o[1])))},t.concatenate=function(i,r){return e(i,r,(n,s,o)=>{const a=[];if(o.length<1)return"";if(Tn(o[0])){const l=un(o[2],"");for(let c=0;c1?a.join(o[1]):a.join("")}if(_s(o[0])){const l=un(o[2],"");for(let c=0;c1?a.join(o[1]):a.join("")}for(let l=0;l{if(Zi(o,1,1,i,r),Tn(o[0])){const a=o[0].slice(0);return a.reverse(),a}if(_s(o[0])){const a=o[0].toArray().slice(0);return a.reverse(),a}throw new Nt(i,Et.InvalidParameter,r)})},t.replace=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,3,4,i,r);const a=rn(o[0]),l=rn(o[1]),c=rn(o[2]);return o.length!==4||ub(o[3])?Hw(a,l,c):a.replace(l,c)})},t.schema=function(i,r){return e(i,r,(n,s,o)=>{if(du(o[0])){const a=TRe(o[0]);return a?es.convertObjectToArcadeDictionary(a,Wo(i)):null}throw new Nt(i,Et.InvalidParameter,r)})},t.subtypes=function(i,r){return e(i,r,(n,s,o)=>{if(Zi(o,1,1,i,r),du(o[0])){const a=JK(o[0]);return a?es.convertObjectToArcadeDictionary(a,Wo(i)):null}throw new Nt(i,Et.InvalidParameter,r)})},t.subtypecode=function(i,r){return e(i,r,(n,s,o)=>{if(Zi(o,1,1,i,r),du(o[0])){const a=JK(o[0]);if(!a)return null;if(a.subtypeField&&o[0].hasField(a.subtypeField)){const l=o[0].field(a.subtypeField);for(const c of a.subtypes)if(c.code===l)return c.code;return null}return null}throw new Nt(i,Et.InvalidParameter,r)})},t.subtypename=function(i,r){return e(i,r,(n,s,o)=>{if(Zi(o,1,1,i,r),du(o[0])){const a=JK(o[0]);if(!a)return"";if(a.subtypeField&&o[0].hasField(a.subtypeField)){const l=o[0].field(a.subtypeField);for(const c of a.subtypes)if(c.code===l)return c.name;return""}return""}throw new Nt(i,Et.InvalidParameter,r)})},t.gdbversion=function(i,r){return e(i,r,(n,s,o)=>{if(Zi(o,1,1,i,r),du(o[0]))return o[0].gdbVersion();throw new Nt(i,Et.InvalidParameter,r)})},t.domain=function(i,r){return e(i,r,(n,s,o)=>{if(Zi(o,2,3,i,r),du(o[0])){const a=xRe(o[0],rn(o[1]),o[2]===void 0?void 0:Mi(o[2]));return a&&a.domain?a.domain.type==="coded-value"||a.domain.type==="codedValue"?es.convertObjectToArcadeDictionary({type:"codedValue",name:a.domain.name,dataType:Whe[a.field.type],codedValues:a.domain.codedValues.map(l=>({name:l.name,code:l.code}))},Wo(i)):es.convertObjectToArcadeDictionary({type:"range",name:a.domain.name,dataType:Whe[a.field.type],min:a.domain.min,max:a.domain.max},Wo(i)):null}throw new Nt(i,Et.InvalidParameter,r)})},t.domainname=function(i,r){return e(i,r,(n,s,o)=>{if(Zi(o,2,4,i,r),du(o[0]))return SRe(o[0],rn(o[1]),o[2],o[3]===void 0?void 0:Mi(o[3]));throw new Nt(i,Et.InvalidParameter,r)})},t.domaincode=function(i,r){return e(i,r,(n,s,o)=>{if(Zi(o,2,4,i,r),du(o[0]))return CRe(o[0],rn(o[1]),o[2],o[3]===void 0?void 0:Mi(o[3]));throw new Nt(i,Et.InvalidParameter,r)})},t.urlencode=function(i,r){return e(i,r,(n,s,o)=>{if(Zi(o,1,1,i,r),o[0]===null)return"";if(o[0]instanceof es){let a="";for(const l of o[0].keys()){const c=o[0].field(l);a!==""&&(a+="&"),a+=c===null?encodeURIComponent(l)+"=":encodeURIComponent(l)+"="+encodeURIComponent(c)}return a}return encodeURIComponent(rn(o[0]))})},t.hash=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,1,i,r);const a=new WAi(0);return Ww(o[0],a,{context:i,node:r,map:new Map,currentLength:0}),a.digest()})},t.convertdirection=function(i,r){return e(i,r,(n,s,o)=>(Zi(o,3,3,i,r),HAi(o[0],o[1],o[2])))},t.fromjson=function(i,r){return e(i,r,(n,s,o)=>{if(Zi(o,1,1,i,r),vn(o[0])===!1)throw new Nt(i,Et.InvalidParameter,r);return es.convertJsonToArcade(JSON.parse(rn(o[0])),Wo(i))})},t.expects=function(i,r){return e(i,r,(n,s,o)=>{if(o.length<1)throw new Nt(i,Et.WrongNumberOfParameters,r);return Xr})},t.tocharcode=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,2,i,r);const a=Mi(un(o[1],0)),l=rn(o[0]);if(l.length===0&&o.length===1)return null;if(l.length<=a||a<0)throw new Nt(i,Et.OutOfBounds,r);return l.charCodeAt(a)})},t.tocodepoint=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,1,2,i,r);const a=Mi(un(o[1],0)),l=rn(o[0]);if(l.length===0&&o.length===1)return null;if(l.length<=a||a<0)throw new Nt(i,Et.OutOfBounds,r);return l.codePointAt(a)})},t.fromcharcode=function(i,r){return e(i,r,(n,s,o)=>{if(o.length<1)throw new Nt(i,Et.WrongNumberOfParameters,r);const a=o.map(l=>Math.trunc(Mi(l))).filter(l=>l>=0&&l<=65535);return a.length===0?null:String.fromCharCode.apply(null,a)})},t.fromcodepoint=function(i,r){return e(i,r,(n,s,o)=>{if(o.length<1)throw new Nt(i,Et.WrongNumberOfParameters,r);let a;try{a=o.map(l=>Math.trunc(Mi(l))).filter(l=>l<=1114111&&l>>>0===l)}catch{return null}return a.length===0?null:String.fromCodePoint.apply(null,a)})},t.getuser=function(i,r){return e(i,r,(n,s,o)=>{Zi(o,0,2,i,r);let a=un(o[1],"");if(a=a===!0||a===!1?"":rn(a),a!==null&&a!=="")return null;if(o.length===0||o[0]instanceof PV){let l=null;if(i.services&&i.services.portal&&(l=i.services.portal),o.length>0&&!YAi(o[0].field("url"),l)||!l)return null;if(a===""){const c=qAi(l);if(c){const d=JSON.parse(JSON.stringify(c));for(const p of["lastLogin","created","modified"])d[p]!==void 0&&d[p]!==null&&(d[p]=new Date(d[p]));return es.convertObjectToArcadeDictionary(d,Wo(i))}}return null}throw new Nt(i,Et.InvalidParameter,r)})}}let $V=class{constructor(e,i){this._moduleSingletons=e,this._syntaxModules=i}loadLibrary(e){if(this._syntaxModules==null)return null;const i=this._syntaxModules[e.toLowerCase()];return i?{syntax:i.script,uri:i.uri}:null}},XAi=class extends yD{constructor(e,i){super(),this.paramCount=i,this.fn=e}createFunction(e){return(...i)=>{if(i.length!==this.paramCount)throw new Nt(e,Et.WrongNumberOfParameters,null);return this.fn(...i)}}call(e,i){return this.fn(...i.arguments)}marshalledCall(e,i,r,n){return n(e,i,(s,o,a)=>{a=a.map(c=>!au(c)||c instanceof zw?c:vD(c,e,n));const l=this.call(r,{arguments:a});return Ip(l)?l.then(c=>vD(c,r,n)):l})}};function qw(t,e,i){try{return i(t,null,e.arguments)}catch(r){throw r}}function Ls(t,e){try{switch(e.type){case"EmptyStatement":return"lc.voidOperation";case"VariableDeclarator":return uPi(t,e);case"VariableDeclaration":return lPi(t,e);case"BlockStatement":case"Program":return jRe(t,e);case"FunctionDeclaration":return aPi(t,e);case"ImportDeclaration":return sPi(t,e);case"ExportNamedDeclaration":return oPi(t,e);case"ReturnStatement":return nPi(t,e);case"IfStatement":return qpt(t,e);case"ExpressionStatement":return rPi(t,e);case"AssignmentExpression":return iPi(t,e);case"UpdateExpression":return ePi(t,e);case"BreakStatement":return"break";case"ContinueStatement":return"continue";case"TemplateLiteral":return pPi(t,e);case"TemplateElement":return JSON.stringify(e.value?e.value.cooked:"");case"ForStatement":return QAi(t,e);case"ForInStatement":return ZAi(t,e);case"WhileStatement":return tPi(t,e);case"Identifier":return gPi(t,e);case"MemberExpression":return cPi(t,e);case"Literal":return e.value===null||e.value===void 0?"null":JSON.stringify(e.value);case"CallExpression":return yPi(t,e);case"UnaryExpression":return hPi(t,e);case"BinaryExpression":return fPi(t,e);case"LogicalExpression":return mPi(t,e);case"ArrayExpression":return dPi(t,e);case"ObjectExpression":return KAi(t,e);case"Property":return JAi(t,e);case"Array":throw new _0(t,Et.NeverReach,e);default:throw new _0(t,Et.Unrecognised,e)}}catch(i){throw i}}function KAi(t,e){let i="lang.dictionary([";for(let r=0;r0&&(i+=","),i+="lang.strCheck("+(n.key.type==="Identifier"?"'"+n.key.name+"'":Ls(t,n.key))+",'ObjectExpression'),lang.aCheck("+Ls(t,n.value)+", 'ObjectExpression')"}return i+="])",i}function JAi(t,e){throw new _0(t,Et.NeverReach,e)}function ZAi(t,e){const i=aE(t),r=aE(t),n=aE(t);let s="var "+i+" = "+Ls(t,e.right)+`; -`;e.left.type==="VariableDeclaration"&&(s+=Ls(t,e.left));let o=e.left.type==="VariableDeclaration"?e.left.declarations[0].id.name:e.left.name;o=o.toLowerCase(),cb(o);let a="";t.localScope!==null&&(t.localScope[o]!==void 0?a="lscope['"+o+"']":t.localScope._SymbolsMap[o]!==void 0&&(a="lscope['"+t.localScope._SymbolsMap[o]+"']"));let l="";if(a===""){if(t.globalScope[o]!==void 0)a="gscope['"+o+"']";else if(t.globalScope._SymbolsMap[o]!==void 0)a="gscope['"+t.globalScope._SymbolsMap[o]+"']";else if(t.localScope!==null)if(t.undeclaredGlobalsInFunctions.has(o))a="gscope['"+t.undeclaredGlobalsInFunctions.get(o).manglename+"']",l=t.undeclaredGlobalsInFunctions.get(o).manglename;else{const c={manglename:sS(t),node:e.left};t.undeclaredGlobalsInFunctions.set(o,c),a="gscope['"+c.manglename+"']",l=c.manglename}}return l&&(s+="lang.chkAssig('"+l+`',runtimeCtx); +*/function fpt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function mpt(t){for(var e=1;e0){var r=e[e.length-1];r!==i&&r.pause()}var n=e.indexOf(i);n===-1||e.splice(n,1),e.push(i)},deactivateTrap:function(e,i){var r=e.indexOf(i);r!==-1&&e.splice(r,1),e.length>0&&e[e.length-1].unpause()}},kIi=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},$Ii=function(e){return e.key==="Escape"||e.key==="Esc"||e.keyCode===27},WK=function(e){return e.key==="Tab"||e.keyCode===9},BIi=function(e){return WK(e)&&!e.shiftKey},VIi=function(e){return WK(e)&&e.shiftKey},ypt=function(e){return setTimeout(e,0)},vpt=function(e,i){var r=-1;return e.every(function(n,s){return i(n)?(r=s,!1):!0}),r},qK=function(e){for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n1?ce-1:0),_e=1;_e=0)Z=r.activeElement;else{var ie=o.tabbableGroups[0],ce=ie&&ie.firstTabbableNode;Z=ce||h("fallbackFocus")}if(!Z)throw new Error("Your focus-trap needs to have at least one focusable element");return Z},y=function(){if(o.containerGroups=o.containers.map(function(Z){var ie=RIi(Z,s.tabbableOptions),ce=MIi(Z,s.tabbableOptions);return{container:Z,tabbableNodes:ie,focusableNodes:ce,firstTabbableNode:ie.length>0?ie[0]:null,lastTabbableNode:ie.length>0?ie[ie.length-1]:null,nextTabbableNode:function(_e){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Pe=ce.findIndex(function(ke){return ke===_e});if(!(Pe<0))return xe?ce.slice(Pe+1).find(function(ke){return ade(ke,s.tabbableOptions)}):ce.slice(0,Pe).reverse().find(function(ke){return ade(ke,s.tabbableOptions)})}}}),o.tabbableGroups=o.containerGroups.filter(function(Z){return Z.tabbableNodes.length>0}),o.tabbableGroups.length<=0&&!h("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},v=function X(Z){if(Z!==!1&&Z!==r.activeElement){if(!Z||!Z.focus){X(p());return}Z.focus({preventScroll:!!s.preventScroll}),o.mostRecentlyFocusedNode=Z,kIi(Z)&&Z.select()}},x=function(Z){var ie=h("setReturnFocus",Z);return ie||(ie===!1?!1:Z)},I=function(Z){var ie=lde(Z);if(!(c(ie)>=0)){if(qK(s.clickOutsideDeactivates,Z)){a.deactivate({returnFocus:s.returnFocusOnDeactivate&&!dRe(ie,s.tabbableOptions)});return}qK(s.allowOutsideClick,Z)||Z.preventDefault()}},P=function(Z){var ie=lde(Z),ce=c(ie)>=0;ce||ie instanceof Document?ce&&(o.mostRecentlyFocusedNode=ie):(Z.stopImmediatePropagation(),v(o.mostRecentlyFocusedNode||p()))},F=function(Z){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=lde(Z);y();var he=null;if(o.tabbableGroups.length>0){var _e=c(ce),xe=_e>=0?o.containerGroups[_e]:void 0;if(_e<0)ie?he=o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:he=o.tabbableGroups[0].firstTabbableNode;else if(ie){var Pe=vpt(o.tabbableGroups,function(Re){var Oe=Re.firstTabbableNode;return ce===Oe});if(Pe<0&&(xe.container===ce||dRe(ce,s.tabbableOptions)&&!ade(ce,s.tabbableOptions)&&!xe.nextTabbableNode(ce,!1))&&(Pe=_e),Pe>=0){var ke=Pe===0?o.tabbableGroups.length-1:Pe-1,J=o.tabbableGroups[ke];he=J.lastTabbableNode}else WK(Z)||(he=xe.nextTabbableNode(ce,!1))}else{var de=vpt(o.tabbableGroups,function(Re){var Oe=Re.lastTabbableNode;return ce===Oe});if(de<0&&(xe.container===ce||dRe(ce,s.tabbableOptions)&&!ade(ce,s.tabbableOptions)&&!xe.nextTabbableNode(ce))&&(de=_e),de>=0){var Se=de===o.tabbableGroups.length-1?0:de+1,Ie=o.tabbableGroups[Se];he=Ie.firstTabbableNode}else WK(Z)||(he=xe.nextTabbableNode(ce))}}else he=h("fallbackFocus");he&&(WK(Z)&&Z.preventDefault(),v(he))},k=function(Z){if($Ii(Z)&&qK(s.escapeDeactivates,Z)!==!1){Z.preventDefault(),a.deactivate();return}(s.isKeyForward(Z)||s.isKeyBackward(Z))&&F(Z,s.isKeyBackward(Z))},j=function(Z){var ie=lde(Z);c(ie)>=0||qK(s.clickOutsideDeactivates,Z)||qK(s.allowOutsideClick,Z)||(Z.preventDefault(),Z.stopImmediatePropagation())},V=function(){if(o.active)return gpt.activateTrap(n,a),o.delayInitialFocusTimer=s.delayInitialFocus?ypt(function(){v(p())}):v(p()),r.addEventListener("focusin",P,!0),r.addEventListener("mousedown",I,{capture:!0,passive:!1}),r.addEventListener("touchstart",I,{capture:!0,passive:!1}),r.addEventListener("click",j,{capture:!0,passive:!1}),r.addEventListener("keydown",k,{capture:!0,passive:!1}),a},Y=function(){if(o.active)return r.removeEventListener("focusin",P,!0),r.removeEventListener("mousedown",I,!0),r.removeEventListener("touchstart",I,!0),r.removeEventListener("click",j,!0),r.removeEventListener("keydown",k,!0),a};return a={get active(){return o.active},get paused(){return o.paused},activate:function(Z){if(o.active)return this;var ie=l(Z,"onActivate"),ce=l(Z,"onPostActivate"),he=l(Z,"checkCanFocusTrap");he||y(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,ie&&ie();var _e=function(){he&&y(),V(),ce&&ce()};return he?(he(o.containers.concat()).then(_e,_e),this):(_e(),this)},deactivate:function(Z){if(!o.active)return this;var ie=mpt({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},Z);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,Y(),o.active=!1,o.paused=!1,gpt.deactivateTrap(n,a);var ce=l(ie,"onDeactivate"),he=l(ie,"onPostDeactivate"),_e=l(ie,"checkCanReturnFocus"),xe=l(ie,"returnFocus","returnFocusOnDeactivate");ce&&ce();var Pe=function(){ypt(function(){xe&&v(x(o.nodeFocusedBeforeActivation)),he&&he()})};return xe&&_e?(_e(x(o.nodeFocusedBeforeActivation)).then(Pe,Pe),this):(Pe(),this)},pause:function(){return o.paused||!o.active?this:(o.paused=!0,Y(),this)},unpause:function(){return!o.paused||!o.active?this:(o.paused=!1,y(),V(),this)},updateContainerElements:function(Z){var ie=[].concat(Z).filter(Boolean);return o.containers=ie.map(function(ce){return typeof ce=="string"?r.querySelector(ce):ce}),o.active&&y(),this}},a.updateContainerElements(e),a};const xk="esri-identity-modal",iE={base:xk,open:`${xk}--open`,closed:`${xk}--closed`,title:`${xk}__title`,dialog:`${xk}__dialog`,content:`${xk}__content`,closeButton:`${xk}__close-button`,iconClose:"esri-icon-close"};let vD=class extends Hf{constructor(e,i){super(e,i),this.container=document.createElement("div"),this.content=null,this.open=!1,this._focusTrap=null,this._close=()=>{this.open=!1},document.body.appendChild(this.container),this.addHandles(sr(()=>this.open,()=>this._toggleFocusTrap()))}destroy(){this._destroyFocusTrap()}get title(){return this.messages?.auth.signIn}render(){const e=this.id,{open:i,content:r,title:n,messages:s}=this,o=i&&!!r,a={[iE.open]:o,[iE.closed]:!o},l=Gi("button",{class:iE.closeButton,"aria-label":s.close,title:s.close,bind:this,onclick:this._close,type:"button"},Gi("span",{"aria-hidden":"true",class:iE.iconClose})),c=`${e}_title`,h=`${e}_content`,p=n?Gi("h1",{id:c,class:iE.title},n):null,y=o?Gi("div",{bind:this,class:iE.dialog,role:"dialog","aria-labelledby":c,"aria-describedby":h,afterCreate:this._createFocusTrap},l,p,this._renderContent(h)):null;return Gi("div",{tabIndex:-1,class:this.classes(iE.base,a)},y)}_destroyFocusTrap(){this._focusTrap?.deactivate({onDeactivate:()=>{}}),this._focusTrap=null}_toggleFocusTrap(){const{_focusTrap:e,open:i}=this;e&&(i?e.activate():e.deactivate())}_createFocusTrap(e){this._destroyFocusTrap();const i=requestAnimationFrame(()=>{this._focusTrap=GIi(e,{initialFocus:"input",onDeactivate:this._close}),this._toggleFocusTrap()});this.addHandles(XI(()=>cancelAnimationFrame(i)))}_renderContent(e){const i=this.content;return typeof i=="string"?Gi("div",{class:iE.content,id:e,innerHTML:i}):QEe(i)?Gi("div",{class:iE.content,id:e},i.render()):i instanceof HTMLElement?Gi("div",{class:iE.content,id:e,bind:i,afterCreate:this._attachToNode}):null}_attachToNode(e){const i=this;e.appendChild(i)}};E([N({readOnly:!0})],vD.prototype,"container",void 0),E([N()],vD.prototype,"content",void 0),E([N()],vD.prototype,"open",void 0),E([N(),Wf("esri/t9n/common")],vD.prototype,"messages",void 0),E([N()],vD.prototype,"title",null),vD=E([dt("esri.identity.IdentityModal")],vD);const _pt=vD,pRe="esriJSAPIOAuth";let fRe=class{constructor(e,i){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=i,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 i=Date.now();this.expires>i&&(this.expires-i)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}}return e}save(){if(!this.storage)return!1;const e=this._load(),i=this.oAuthInfo;if(i&&i.authNamespace&&i.portalUrl){let r=e[i.authNamespace];r||(r=e[i.authNamespace]={}),this.appId||(this.appId=i.appId),r[i.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(pRe,JSON.stringify(e))}catch(n){return console.warn(n),!1}return!0}return!1}destroy(){const e=this._load(),i=this.oAuthInfo;if(i&&i.appId&&i.portalUrl&&(this.expires==null||this.expires>Date.now())&&(this.refreshToken||this.token)){const r=i.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",i.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(i&&i.authNamespace&&i.portalUrl&&this.storage){const r=e[i.authNamespace];if(r){delete r[i.portalUrl];try{this.storage.setItem(pRe,JSON.stringify(e))}catch(n){console.log(n)}}}i&&(i._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),i=this.oAuthInfo;if(i&&i.authNamespace&&i.portalUrl){let r=e[i.authNamespace];r&&(r=r[i.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 i=this.storage.getItem(pRe);if(i)try{e=JSON.parse(i)}catch(r){console.warn(r)}}return e}};fRe.prototype.declaredClass="esri.identity.OAuthCredential";var mRe;let uy=mRe=class extends Ui{constructor(t){super(t),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 mRe.fromJSON(this.toJSON())}};E([N({json:{write:!0}})],uy.prototype,"appId",void 0),E([N({json:{write:!0}})],uy.prototype,"authNamespace",void 0),E([N({json:{write:!0}})],uy.prototype,"expiration",void 0),E([N({json:{write:!0}})],uy.prototype,"flowType",void 0),E([N({json:{write:!0}})],uy.prototype,"forceLogin",void 0),E([N({json:{write:!0}})],uy.prototype,"forceUserId",void 0),E([N({json:{write:!0}})],uy.prototype,"locale",void 0),E([N({json:{write:!0}})],uy.prototype,"minTimeUntilExpiration",void 0),E([N({json:{write:!0}})],uy.prototype,"popup",void 0),E([N({json:{write:!0}})],uy.prototype,"popupCallbackUrl",void 0),E([N({json:{write:!0}})],uy.prototype,"popupWindowFeatures",void 0),E([N({json:{write:!0}})],uy.prototype,"portalUrl",void 0),E([N({json:{write:!0}})],uy.prototype,"preserveUrlHash",void 0),E([N({json:{write:!0}})],uy.prototype,"userId",void 0),uy=mRe=E([dt("esri.identity.OAuthInfo")],uy);const bpt=uy;let db=class extends Ui{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}};E([N({json:{write:!0}})],db.prototype,"adminTokenServiceUrl",void 0),E([N({json:{write:!0}})],db.prototype,"currentVersion",void 0),E([N({json:{write:!0}})],db.prototype,"hasPortal",void 0),E([N({json:{write:!0}})],db.prototype,"hasServer",void 0),E([N({json:{write:!0}})],db.prototype,"owningSystemUrl",void 0),E([N({json:{write:!0}})],db.prototype,"owningTenant",void 0),E([N({json:{write:!0}})],db.prototype,"server",void 0),E([N({json:{write:!0}})],db.prototype,"shortLivedTokenValidity",void 0),E([N({json:{write:!0}})],db.prototype,"tokenServiceUrl",void 0),E([N({json:{write:!0}})],db.prototype,"webTierAuth",void 0),db=E([dt("esri.identity.ServerInfo")],db);const gRe=db,ude={},wpt=t=>{const e=new Hg(t.owningSystemUrl).host,i=new Hg(t.server).host,r=/.+\.arcgis\.com$/i;return r.test(e)&&r.test(i)},yRe=(t,e)=>!!(wpt(t)&&e&&e.some(i=>i.test(t.server)));let cde=null,hde=null;try{cde=window.localStorage,hde=window.sessionStorage}catch{}let xpt=class extends md{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.formConstructor=yIi,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin=window.origin!=="null"?window.origin:window.location.origin,this._appUrlObj=fa(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 i=this.serverInfos;i?(e=e.filter(r=>!this.findServerInfo(r.server)),this.serverInfos=i.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 i=this.oAuthInfos;if(i){for(const r of e){const n=this.findOAuthInfo(r.portalUrl);n&&i.splice(i.indexOf(n),1)}this.oAuthInfos=i.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const i=this._sanitizeUrl(e.server),r=this._isServerRsrc(i);let n,s=this.findServerInfo(i),o=!0;s||(s=new gRe,s.server=this._getServerInstanceRoot(i),r?s.hasServer=!0:(s.tokenServiceUrl=this._getTokenSvcUrl(i),s.hasPortal=!0),this.registerServers([s])),n=this._findCredential(i),n?(delete e.server,Object.assign(n,e),o=!1):(n=new Pd({userId:e.userId,server:s.server,token:e.token,expires:e.expires,ssl:e.ssl,scope:r?"server":"portal"}),n.resources=[i],this.credentials.push(n)),n.emitTokenChange(!1),o||n.refreshServerTokens()}toJSON(){return xre({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 i=e.serverInfos,r=e.oAuthInfos,n=e.credentials;if(i){const s=[];i.forEach(o=>{o.server&&o.tokenServiceUrl&&s.push(o.declaredClass?o:new gRe(o))}),s.length&&this.registerServers(s)}if(r){const s=[];r.forEach(o=>{o.appId&&s.push(o.declaredClass?o:new bpt(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 Pd(s)).emitTokenChange(),this.credentials.push(s))})}findServerInfo(e){let i;e=this._sanitizeUrl(e);for(const r of this.serverInfos)if(this._hasSameServerInstance(r.server,e)){i=r;break}return i}findOAuthInfo(e){let i;e=this._sanitizeUrl(e);for(const r of this.oAuthInfos)if(this._hasSameServerInstance(r.portalUrl,e)){i=r;break}return i}findCredential(e,i){if(!e)return;let r;e=this._sanitizeUrl(e);const n=this._isServerRsrc(e)?"server":"portal";if(i){for(const s of this.credentials)if(this._hasSameServerInstance(s.server,e)&&i===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,i){let r,n,s=!0;i&&(r=!!i.token,n=i.error,s=i.prompt!==!1),i={...i},e=this._sanitizeUrl(e);const o=new AbortController,a=kf();if(i.signal&&ap(i.signal,()=>{o.abort()}),ap(o,()=>{a.reject(new st("identity-manager:user-aborted","ABORTED"))}),Im(o))return a.promise;i.signal=o.signal;const l=this._isAdminResource(e),c=r?this.findCredential(e):null;let h;if(c&&n&&n.details&&n.details.httpStatus===498)c.destroy();else if(c)return h=new st("identity-manager:not-authorized","You are currently signed in as: '"+c.userId+"'. You do not have access to this resource: "+e,{error:n}),a.reject(h),a.promise;const p=this._findCredential(e,i);if(p)return a.resolve(p),a.promise;let y=this.findServerInfo(e);if(y)!y.hasServer&&this._isServerRsrc(e)&&(y._restInfoPms=this._getTokenSvcUrl(e),y.hasServer=!0);else{const v=this._getTokenSvcUrl(e);if(!v)return h=new st("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),a.reject(h),a.promise;y=new gRe,y.server=this._getServerInstanceRoot(e),typeof v=="string"?(y.tokenServiceUrl=v,y.hasPortal=!0):(y._restInfoPms=v,y.hasServer=!0),this.registerServers([y])}return y.hasPortal&&y._selfReq===void 0&&(s||jy(y.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(v=>v.tokenServiceUrl===y.tokenServiceUrl))&&(y._selfReq={owningTenant:i&&i.owningTenant,selfDfd:this._getPortalSelf(y.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,y,i,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,i,r){const n=this._rePortalTokenSvc.test(e.tokenServiceUrl),s=new Hg(this._appOrigin),o=e.shortLivedTokenValidity;let a,l,c,h,p,y,v,x;i&&(x=this.tokenValidity||o||this._defaultTokenValidity,x>o&&o>0&&(x=o)),r&&(a=r.isAdmin,l=r.serverUrl,c=r.token,y=r.signal,v=r.ssl,e.customParameters=r.customParameters),a?h=e.adminTokenServiceUrl:(h=e.tokenServiceUrl,p=new Hg(h.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!v&&s.scheme==="http"&&(jy(s.uri,h,!0)||p.scheme==="https"&&s.host===p.host&&s.port==="7080"&&p.port==="7443")&&(h=h.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const I={query:{request:"getToken",username:i?.username,password:i?.password,serverUrl:l,token:c,expiration:x,referer:a||n?this._appOrigin:null,client:a?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,r),signal:y,...r?.ioArgs};return n||(I.withCredentials=!1),ur(h,I).then(P=>{const F=P.data;if(!F||!F.token)return new st("identity-manager:authentication-failed","Unable to generate token");const k=e.server;return ude[k]||(ude[k]={}),i&&(ude[k][i.username]=i.password),F.validity=x,F})}isBusy(){return!!this._busy}checkSignInStatus(e){return this.checkAppAccess(e,"").then(i=>i.credential)}checkAppAccess(e,i,r){let n=!1;return this.getCredential(e,{prompt:!1}).then(s=>{let o;const a={f:"json"};if(s.scope==="portal")if(i&&(this._doPortalSignIn(e)||r&&r.force))o=s.server+"/sharing/rest/oauth2/validateAppAccess",a.client_id=i;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),ur(o,{query:a,authMode:"anonymous"}).then(l=>{if(l.data.valid===!1)throw new st("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 c=l.details&&l.details.httpStatus;if(c===498)throw s.destroy(),new st("identity-manager:not-authenticated","User is not signed in.");if(c===400)throw new st("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(q3(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,i,r={}){const n=kf(),s=()=>{l?.remove(),c?.remove(),h?.remove(),a?.destroy(),this.dialog?.destroy(),this.dialog=a=l=c=h=null},o=()=>{s(),this._oAuthDfd=null,n.reject(new st("identity-manager:user-aborted","ABORTED"))};r.signal&&ap(r.signal,()=>{o()});let a=new this.formConstructor;a.resource=this.getResourceName(e),a.server=i.server,this.dialog=new _pt,this.dialog.content=a,this.dialog.open=!0,this.emit("dialog-create");let l=a.on("cancel",o),c=sr(()=>this.dialog.open,o),h=a.on("submit",p=>{this.generateToken(i,p,{isAdmin:r.isAdmin,signal:r.signal}).then(y=>{s();const v=new Pd({userId:p.username,server:i.server,token:y.token,expires:y.expires!=null?Number(y.expires):null,ssl:!!y.ssl,isAdmin:r.isAdmin,validity:y.validity});n.resolve(v)}).catch(y=>{a.error=y,a.signingIn=!1})});return n.promise}oAuthSignIn(e,i,r,n){this._oAuthDfd=kf();const s=this._oAuthDfd;let o;n?.signal&&ap(n.signal,()=>{const x=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;x&&!x.closed?x.close():this.dialog&&y()}),s.resUrl_=e,s.sinfo_=i,s.oinfo_=r;const a=r._oAuthCred;if(a.storage&&(r.flowType==="authorization-code"||r.flowType==="auto"&&!r.popup&&i.currentVersion>=8.4)){let x=crypto.getRandomValues(new Uint8Array(32));o=a1e(x),a.codeVerifier=o,x=crypto.getRandomValues(new Uint8Array(32)),a.stateUID=a1e(x),a.save()||(a.codeVerifier=o=null)}else a.codeVerifier=null;let l,c,h,p;this._getCodeChallenge(o).then(x=>{const I=!n||n.oAuthPopupConfirmation!==!1;r.popup&&I?(l=new this.formConstructor,l.oAuthPrompt=!0,l.server=i.server,this.dialog=new _pt,this.dialog.content=l,this.dialog.open=!0,this.emit("dialog-create"),c=l.on("cancel",y),h=sr(()=>this.dialog.open,y),p=l.on("submit",()=>{v(),this._doOAuthSignIn(e,i,r,x)})):this._doOAuthSignIn(e,i,r,x)});const y=()=>{v(),this._oAuthDfd=null,s.reject(new st("identity-manager:user-aborted","ABORTED"))},v=()=>{c?.remove(),h?.remove(),p?.remove(),l?.destroy(),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=ZI(window,"message",i=>{if((i.origin===this._appOrigin||i.origin.endsWith(".arcgis.com"))&&i.data?.type==="arcgis:auth:requestCredential"){const r=i.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}},i.origin)}).catch(n=>{r.postMessage({type:"arcgis:auth:error",error:{name:n.name,message:n.message}},i.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=q3(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 i=window.location.search;if(i){i.charAt(0)==="?"&&(i=i.substring(1));const r=q3(i);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=Wv(s),a=window.location.pathname+(o?`?${o}`:"")+(r.state?.hash||"");window.history.replaceState(window.history.state,"",a)}}}_getOAuthToken(e,i,r,n,s){return e=e.replace(/^http:/i,"https:"),ur(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:n&&s?{grant_type:"authorization_code",code:i,redirect_uri:n,client_id:r,code_verifier:s}:{grant_type:"refresh_token",refresh_token:i,client_id:r}}).then(o=>o.data)}_getCodeChallenge(e){if(e&&globalThis.isSecureContext){const i=new TextEncoder().encode(e);return crypto.subtle.digest("SHA-256",i).then(r=>a1e(new Uint8Array(r)))}return Promise.resolve(null)}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const i=new st("identity-manager:user-aborted","ABORTED");this._errbackFunc(i)}}_findCredential(e,i){let r,n,s,o,a=-1;const l=i&&i.token,c=i&&i.resource,h=this._isServerRsrc(e)?"server":"portal",p=this.credentials.filter(y=>this._hasSameServerInstance(y.server,e)&&y.scope===h);if(e=c||e,p.length)if(p.length===1){if(r=p[0],s=this.findServerInfo(r.server),n=s&&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 y,v;if(p.some(x=>(v=this._getIdenticalSvcIdx(e,x),v!==-1&&(y=x,s=this.findServerInfo(y.server),n=s&&s.owningSystemUrl,o=n?this.findCredential(n,y.userId):void 0,a=v,!0))),l)y&&(y.resources.splice(a,1),this._removeResource(e,o));else if(y)return this._addResource(e,o),y}}_findOAuthInfo(e){let i=this.findOAuthInfo(e);if(!i){for(const r of this.oAuthInfos)if(this._isIdProvider(r.portalUrl,e)){i=r;break}}return i}_addResource(e,i){i&&this._getIdenticalSvcIdx(e,i)===-1&&i.resources.push(e)}_removeResource(e,i){let r=-1;i&&(r=this._getIdenticalSvcIdx(e,i),r>-1&&i.resources.splice(r,1))}_useProxy(e,i){return i&&i.isAdmin&&!jy(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&String(e.currentVersion)==="10.1"&&!jy(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const i=new Hg(e);return i.scheme+"://"+i.host+(i.port!=null?":"+i.port:"")}_getServerInstanceRoot(e){const i=e.toLowerCase();let r=i.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||Fje(i)||(r=i.indexOf("/sharing")),r===-1&&i.substr(-1)==="/"&&(r=i.length-1),r>-1?e.substring(0,r):e}_hasSameServerInstance(e,i){return e.substr(-1)==="/"&&(e=e.slice(0,-1)),e=e.toLowerCase(),i=this._getServerInstanceRoot(i).toLowerCase(),e=this._normalizeAGOLorgDomain(e),i=this._normalizeAGOLorgDomain(i),(e=e.substr(e.indexOf(":")))===(i=i.substr(i.indexOf(":")))}_normalizeAGOLorgDomain(e){const i=/^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 i.test(e)?e=e.replace(i,"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 i=(pa.request.proxyUrl||"").toLowerCase(),r=i?e.toLowerCase().indexOf(i+"?"):-1;return r!==-1&&(e=e.substring(r+i.length+1)),e=Uy(e),fa(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,i){let r=!1;if(this._isRESTService(e)&&this._isRESTService(i)){const n=this._getSuffix(e).toLowerCase(),s=this._getSuffix(i).toLowerCase();if(r=n===s,!r){const o=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;r=n.replace(o,"$1")===s.replace(o,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(i)?r=!0:this._isServerRsrc(e)||this._isServerRsrc(i)||!this._isPortalDomain(e)||(r=!0);return r}_isPortalDomain(e){const i=new Hg(e.toLowerCase()),r=this._portalConfig;let n=this._gwDomains.some(s=>s.regex.test(i.uri));return!n&&r&&(n=this._hasSameServerInstance(this._getServerInstanceRoot(r.restBaseUrl),i.uri)),n||pa.portalUrl&&(n=jy(i,pa.portalUrl,!0)),n||(n=this._portals.some(s=>this._hasSameServerInstance(s,i.uri))),n=n||this._agsPortal.test(i.path),n}_isIdProvider(e,i){let r=-1,n=-1;this._gwDomains.forEach((o,a)=>{r===-1&&o.regex.test(e)&&(r=a),n===-1&&o.regex.test(i)&&(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(i),a=o&&o.owningSystemUrl;a&&wpt(o)&&this._isPortalDomain(a)&&this._isIdProvider(e,a)&&(s=!0)}return s}_getIdenticalSvcIdx(e,i){let r=-1;for(let n=0;no.data),{adminUrl:i,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 Hg(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,i,r){const n=i._oAuthCred;if(e.code){const o=n.codeVerifier;return n.codeVerifier=null,n.stateUID=null,n.save(),this._getOAuthToken(r.server,e.code,i.appId,this._getRedirectURI(i,!0),o).then(a=>{const l=new Pd({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 i.userId=l.userId,n.storage=a.persist?cde:hde,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 Pd({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 i.userId=s.userId,n.storage=e.persist?cde:hde,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 i=this._oAuthDfd;if(this._oAuthDfd=null,i)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const r=e.error==="access_denied",n=new st(r?"identity-manager:user-aborted":"identity-manager:authentication-failed",r?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);i.reject(n)}else this._processOAuthResponseParams(e,i.oinfo_,i.sinfo_).then(r=>{i.resolve(r)}).catch(r=>{i.reject(r)})}_setOAuthResponseQueryString(e){e&&(e.charAt(0)==="?"&&(e=e.substring(1)),this._processOAuthPopupParams(q3(e)))}_exchangeToken(e,i,r){return ur(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:i,token:r}}).then(n=>n.data.token)}_getPlatformSelf(e,i){return e=e.replace(/^http:/i,"https:"),ur(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":i,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0}).then(r=>r.data)}_getPortalSelf(e,i){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(i)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),ur(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(n=>n.data))}_doPortalSignIn(e){const i=this._portalConfig,r=window.location.href,n=this.findServerInfo(e);return!(!i&&!this._isPortalDomain(r)||!(n?n.hasPortal||n.owningSystemUrl&&this._isPortalDomain(n.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(r,e)||i&&(this._hasSameServerInstance(this._getServerInstanceRoot(i.restBaseUrl),e)||this._isIdProvider(i.restBaseUrl,e))||jy(r,e,!0)))}_checkProtocol(e,i,r,n){let s=!0;const o=n?i.adminTokenServiceUrl:i.tokenServiceUrl;return o.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&BH(o)&&(s=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:i}),!s)&&r(new st("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),s}_enqueue(e,i,r,n,s,o){return n||(n=kf()),n.resUrl_=e,n.sinfo_=i,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 i=c=>{const h=e.options_&&e.options_.resource,p=e.resUrl_,y=e.refresh_;let v=!1;this.credentials.includes(c)||(y&&this.credentials.includes(y)?(y.userId=c.userId,y.token=c.token,y.expires=c.expires,y.validity=c.validity,y.ssl=c.ssl,y.creationTime=c.creationTime,v=!0,c=y):this.credentials.push(c)),c.resources||(c.resources=[]),c.resources.includes(h||p)||c.resources.push(h||p),c.scope=this._isServerRsrc(p)?"server":"portal",c.emitTokenChange();const x=this._soReqs,I={};this._soReqs=[],x.forEach(P=>{if(!this._isIdenticalService(p,P.resUrl_)){const F=this._getSuffix(P.resUrl_);I[F]||(I[F]=!0,c.resources.push(P.resUrl_))}}),e.resolve(c),x.forEach(P=>{this._hasSameServerInstance(this._getServerInstanceRoot(p),P.resUrl_)?P.resolve(c):this._soReqs.push(P)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,v||this.emit("credential-create",{credential:c}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=c=>{e.reject(c),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=(c,h,p,y)=>{const v=e.sinfo_,x=!e.options_||e.options_.prompt!==!1,I=v.hasPortal&&this._findOAuthInfo(e.resUrl_);let P,F;if(c)i(new Pd({userId:c,server:v.server,token:p||null,expires:y!=null?Number(y):null,ssl:!!h}));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 k=ZI(window,"message",j=>{j.source===window.parent&&j.data&&(j.data.type==="arcgis:auth:credential"?(k.remove(),j.data.credential.expires{k.remove()})}else if(I){let k=I._oAuthCred;if(!k){const j=new fRe(I,cde),V=new fRe(I,hde);j.isValid()&&V.isValid()?j.expires>V.expires?(k=j,V.destroy()):(k=V,j.destroy()):k=j.isValid()?j:V,I._oAuthCred=k}if(k.isValid()){P=new Pd({userId:k.userId,server:v.server,token:k.token,expires:k.expires,ssl:k.ssl,_oAuthCred:k});const j=I.appId!==k.appId&&this._doPortalSignIn(e.resUrl_);j||k.refreshToken?(e._pendingDfd=k.refreshToken?this._getOAuthToken(v.server,k.refreshToken,k.appId).then(V=>(P.expires=Date.now()+1e3*V.expires_in,P.token=V.access_token,P)):Promise.resolve(P),e._pendingDfd.then(V=>j?this._exchangeToken(V.server,I.appId,V.token).then(Y=>(V.token=Y,V)).catch(()=>V):V).then(V=>{i(V)}).catch(()=>{k?.destroy(),n()})):i(P)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(I.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===k.stateUID&&k.codeVerifier)){const j=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(j,I,v).then(V=>{i(V)}).catch(r)}else{const j=()=>{x?e._pendingDfd=this.oAuthSignIn(e.resUrl_,v,I,e.options_).then(i,r):(F=new st("identity-manager:not-authenticated","User is not signed in."),r(F))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(v.server,I.appId).then(V=>{jy(V.portalUrl,this._appOrigin,!0)?(P=new Pd({userId:V.username,server:v.server,expires:Date.now()+1e3*V.expires_in,token:V.token}),i(P)):j()}).catch(j):j()}}else if(x){if(this._checkProtocol(e.resUrl_,v,r,e.admin_)){let k=e.options_;e.admin_&&(k=k||{},k.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,v,k).then(i,r)}}else F=new st("identity-manager:not-authenticated","User is not signed in."),r(F)},s=()=>{const c=e.sinfo_,h=c.owningSystemUrl,p=e.options_;let y,v,x,I;if(p&&(y=p.token,v=p.error,x=p.prompt),I=this._findCredential(h,{token:y,resource:e.resUrl_}),!I){for(const P of this.credentials)if(this._isIdProvider(h,P.server)){I=P;break}}if(I){const P=this.findCredential(e.resUrl_,I.userId);if(P)i(P);else if(yRe(c,this._legacyFed)){const F=I.toJSON();F.server=c.server,F.resources=null,i(new Pd(F))}else(e._pendingDfd=this.generateToken(this.findServerInfo(I.server),null,{serverUrl:e.resUrl_,token:I.token,signal:e.options_.signal,ssl:I.ssl})).then(F=>{i(new Pd({userId:I?.userId,server:c.server,token:F.token,expires:F.expires!=null?Number(F.expires):null,ssl:!!F.ssl,isAdmin:e.admin_,validity:F.validity}))},r)}else this._busy=null,y&&(e.options_.token=null),(e._pendingDfd=this.getCredential(h.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:c.owningTenant,signal:e.options_.signal,token:y,error:v,prompt:x})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},P=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(P)})};this._errbackFunc=r;const o=e.sinfo_.owningSystemUrl,a=this._isServerRsrc(e.resUrl_),l=e.sinfo_._restInfoPms;l?l.promise.then(c=>{const h=e.sinfo_;if(h._restInfoPms){h.adminTokenServiceUrl=h._restInfoPms.adminUrl,h._restInfoPms=null,h.tokenServiceUrl=(Yx("authInfo.tokenServicesUrl",c)||Yx("authInfo.tokenServiceUrl",c)||Yx("tokenServiceUrl",c))??null,h.shortLivedTokenValidity=Yx("authInfo.shortLivedTokenValidity",c)??null,h.currentVersion=c.currentVersion,h.owningTenant=c.owningTenant;const p=h.owningSystemUrl=c.owningSystemUrl;p&&this._portals.push(p)}a&&h.owningSystemUrl?s():n()},()=>{e.sinfo_._restInfoPms=null;const c=new st("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");r(c)}):a&&o?s():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(c=>{const h={};let p,y,v,x;return c&&(p=c.user&&c.user.username,h.username=p,h.allSSL=c.allSSL,y=c.supportsOAuth,x=parseFloat(c.currentVersion),c.portalMode==="multitenant"&&(v=c.customBaseUrl),e.sinfo_.currentVersion=x),e.sinfo_.webTierAuth=!!p,p&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:h.allSSL}).catch(()=>null).then(I=>(h.portalToken=I&&I.token,h.tokenExpiration=I&&I.expires,h)):!p&&y&&x>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:v,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>h):h}).catch(()=>null).then(c=>{e.sinfo_._selfReq=null,c?n(c.username,c.allSSL,c.portalToken,c.tokenExpiration):n()}):n()}_generateOAuthInfo(e){let i,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,i=ur(r+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new bpt({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})})):i=Promise.resolve(),i.then(()=>{if(this._defaultOAuthInfo)return n=n.replace(/^http:/i,"https:"),ur(n+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:o,client_id:this._defaultOAuthInfo.appId,redirect_uri:Gy(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(l=>{if(l.data.valid){const c=this._defaultOAuthInfo.clone();l.data.urlKey&&s?c.portalUrl="https://"+l.data.urlKey.toLowerCase()+"."+s:c.portalUrl=n,c.popup=window!==window.top||!(jy(n,this._appOrigin)||this._gwDomains.some(h=>h.regex.test(n)&&h.regex.test(this._appOrigin))),this.oAuthInfos.push(c)}})})}_doOAuthSignIn(e,i,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",c=l+"?"+Wv(a);if(r.popup){const h=window.open(c,"esriJSAPIOAuth",r.popupWindowFeatures);if(h)h.focus(),this._oAuthDfd.oAuthWin_=h,this._oAuthIntervalId=setInterval(()=>{if(h.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const p=this._oAuthDfd;if(p){const y=new st("identity-manager:user-aborted","ABORTED");p.reject(y)}}},500),this._oAuthOnPopupHandle=ZI(window,["arcgis:auth:hash","arcgis:auth:location:search"],p=>{p.type==="arcgis:auth:hash"?this.setOAuthResponseHash(p.detail):this._setOAuthResponseQueryString(p.detail)});else{const p=new st("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(p)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:a,authorizeUrl:l,resourceUrl:e,serverInfo:i,oAuthInfo:r}):window.location.href=c}_getRedirectURI(e,i){const r=window.location.href.replace(/#.*$/,"");if(e.popup)return Gy(e.popupCallbackUrl);if(i){const n=fa(r);return n.query&&["code","error","error_description","message_code","persist","state"].forEach(s=>{delete n.query[s]}),zy(n.path,n.query)}return r}};xpt.prototype.declaredClass="esri.identity.IdentityManagerBase";let Pd=class extends md.EventedAccessor{constructor(e){super(e),this._oAuthCred=null,this.tokenRefreshBuffer=2,e&&e._oAuthCred&&(this._oAuthCred=e._oAuthCred)}initialize(){this.resources=this.resources||[],this.creationTime==null&&(this.creationTime=Date.now())}refreshToken(){const e=Ho.findServerInfo(this.server),i=e&&e.owningSystemUrl,r=!!i&&this.scope==="server",n=r&&yRe(e,Ho._legacyFed),s=e.webTierAuth,o=s&&Ho.normalizeWebTierAuth,a=ude[this.server],l=a&&a[this.userId];let c,h=this.resources&&this.resources[0],p=r?Ho.findServerInfo(i):null,y={username:this.userId,password:l};if(s&&!o)return;r&&!p&&Ho.serverInfos.some(x=>(Ho._isIdProvider(i,x.server)&&(p=x),!!p));const v=p?Ho.findCredential(p.server,this.userId):null;if(!r||v){if(!n){if(r)c={serverUrl:h,token:v&&v.token,ssl:v&&v.ssl};else if(o)y=null,c={ssl:this.ssl};else{if(!l){let x;return h&&(h=Ho._sanitizeUrl(h),this._enqueued=1,x=Ho._enqueue(h,e,null,null,this.isAdmin,this),x.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),x}this.isAdmin&&(c={isAdmin:!0})}return Ho.generateToken(r?p:e,r?null:y,c).then(x=>{this.token=x.token,this.expires=x.expires!=null?Number(x.expires):null,this.creationTime=Date.now(),this.validity=x.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}v?.refreshToken()}}refreshServerTokens(){this.scope==="portal"&&Ho.credentials.forEach(e=>{const i=Ho.findServerInfo(e.server),r=i&&i.owningSystemUrl;e!==this&&e.userId===this.userId&&r&&e.scope==="server"&&(Ho._hasSameServerInstance(this.server,r)||Ho._isIdProvider(r,this.server))&&(yRe(i,Ho._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 i=this.server&&Ho.findServerInfo(this.server),r=i&&i.owningSystemUrl,n=r&&Ho.findServerInfo(r);e===!1||r&&this.scope!=="portal"&&(!n||!n.webTierAuth||Ho.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=Ho.credentials.indexOf(this);e>-1&&Ho.credentials.splice(e,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const e=xre({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}),i=this.resources;return i&&i.length>0&&(e.resources=i.slice()),e}_startRefreshTimer(){clearTimeout(this._refreshTimer);const e=6e4*this.tokenRefreshBuffer,i=2**31-1;let r=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();r<0?r=0:r>i&&(r=i),this._refreshTimer=setTimeout(this.refreshToken.bind(this),r>e?r-e:r)}};E([N()],Pd.prototype,"creationTime",void 0),E([N()],Pd.prototype,"expires",void 0),E([N()],Pd.prototype,"isAdmin",void 0),E([N()],Pd.prototype,"oAuthState",void 0),E([N()],Pd.prototype,"resources",void 0),E([N()],Pd.prototype,"scope",void 0),E([N()],Pd.prototype,"server",void 0),E([N()],Pd.prototype,"ssl",void 0),E([N()],Pd.prototype,"token",void 0),E([N()],Pd.prototype,"tokenRefreshBuffer",void 0),E([N()],Pd.prototype,"userId",void 0),E([N()],Pd.prototype,"validity",void 0),Pd=E([dt("esri.identity.Credential")],Pd);let Spt=class extends xpt{};Spt.prototype.declaredClass="esri.identity.IdentityManager";const Cpt=new Spt;U$t(Cpt);const UIi=Object.freeze(Object.defineProperty({__proto__:null,default:Cpt},Symbol.toStringTag,{value:"Module"}));let zIi=class{constructor(e,i,r,n){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in e?(this.values=e.pixelData,this.width=e.width,this.height=e.height,this.noDataValue=e.noDataValue):(this.values=e,this.width=i,this.height=r,this.noDataValue=n)}get hasNoDataValues(){if(lt(this._hasNoDataValues)){const e=this.noDataValue;this._hasNoDataValues=this.values.includes(e)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}_ensureBounds(){if(ve(this._minValue))return;const{noDataValue:e,values:i}=this;let r=1/0,n=-1/0,s=!0;for(const o of i)o===e?this._hasNoDataValues=!0:(r=on?o:n,s=!1);s?(this._minValue=0,this._maxValue=0):(this._minValue=r,this._maxValue=n>-3e38?n:0)}},HIi=class{constructor(e,i,r,n,s={}){this._mainMethod=i,this._transferLists=r,this._listeners=[],this._promise=bA(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=>Oi.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${o}`))}on(e,i){const r={removed:!1,eventName:e,callback:i,threadHandle:null};return this._listeners.push(r),this._connectListener(r),XI(()=>{r.removed=!0,v_e(this._listeners,r),this._thread&&ve(r.threadHandle)&&r.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null}invoke(e,i){return this.invokeMethod(this._mainMethod,e,i)}invokeMethod(e,i,r){if(this._thread){const n=this._transferLists[e],s=n?n(i):[];return this._thread.invoke(e,i,{transferList:s,signal:r})}return this._promise?this._promise.then(()=>(yn(r),this.invokeMethod(e,i,r))):Promise.reject(null)}broadcast(e,i){return this._thread?Promise.all(this._thread.broadcast(i,e)).then(()=>{}):this._promise?this._promise.then(()=>this.broadcast(e,i)):Promise.reject()}get promise(){return this._promise}_connectListener(e){this._thread&&this._thread.on(e.eventName,e.callback).then(i=>{e.removed||(e.threadHandle=i)})}},Tpt=class extends HIi{constructor(e=null){super("LercWorker","_decode",{_decode:i=>[i.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,i,r){return e&&e.byteLength!==0?this.invoke({buffer:e,options:i},r):Promise.resolve(null)}release(){--this.ref<=0&&(YK.forEach((e,i)=>{e===this&&YK.delete(i)}),this.destroy())}};const YK=new Map;function WIi(t=null){let e=YK.get(t);return e||(ve(t)?(e=new Tpt(i=>t.immediate.schedule(i)),YK.set(t,e)):(e=new Tpt,YK.set(null,e))),++e.ref,e}let cy=class extends rEe(r_(qc(Sh(Yu(du))))){constructor(...e){super(...e),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=WIi()}normalizeCtorArgs(e,i){return typeof e=="string"?{url:e,...i}:e}destroy(){this._lercDecoder=k3(this._lercDecoder)}readVersion(e,i){let r=i.currentVersion;return r||(r=9.3),r}load(e){const i=ve(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:r=>{for(let n=0;nthis._fetchImageService(i))),Promise.resolve(this)}fetchTile(e,i,r,n){const s=ve((n=n||{signal:null}).signal)?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,i,r,n)).then(()=>ur(this.getTileUrl(e,i,r),o)).then(l=>this._lercDecoder.decode(l.data,a,s)).then(l=>new zIi(l))}getTileUrl(e,i,r){const n=!this.tilemapCache&&this.supportsBlankTile,s=Wv({...this.parsedUrl.query,blankTile:!n&&null});return`${this.parsedUrl.path}/tile/${e}/${i}/${r}${s?"?"+s:""}`}async queryElevation(e,i){const{ElevationQuery:r}=await Promise.resolve().then(()=>tme);return yn(i),new r().query(this,e,i)}async createElevationSampler(e,i){const{ElevationQuery:r}=await Promise.resolve().then(()=>tme);return yn(i),new r().createSampler(this,e,i)}_fetchTileAvailability(e,i,r,n){return this.tilemapCache?this.tilemapCache.fetchAvailability(e,i,r,n):Promise.resolve("unknown")}async _fetchImageService(e){if(this.sourceJSON)return this.sourceJSON;const i={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:e},r=await ur(this.parsedUrl.path,i);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.__isDefault__}};E([N({json:{read:{source:"copyrightText"}}})],cy.prototype,"copyright",void 0),E([N({readOnly:!0,type:B9})],cy.prototype,"heightModelInfo",void 0),E([N({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],cy.prototype,"path",void 0),E([N({type:["show","hide"]})],cy.prototype,"listMode",void 0),E([N({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})],cy.prototype,"minScale",void 0),E([N({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})],cy.prototype,"maxScale",void 0),E([N({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],cy.prototype,"opacity",void 0),E([N({type:["ArcGISTiledElevationServiceLayer"]})],cy.prototype,"operationalLayerType",void 0),E([N()],cy.prototype,"sourceJSON",void 0),E([N({json:{read:!1},value:"elevation",readOnly:!0})],cy.prototype,"type",void 0),E([N(Qy)],cy.prototype,"url",void 0),E([N()],cy.prototype,"version",void 0),E([Vi("version",["currentVersion"])],cy.prototype,"readVersion",null),cy=E([dt("esri.layers.ElevationLayer")],cy),cy.prototype.fetchTile.__isDefault__=!0;const Ept=Object.freeze(Object.defineProperty({__proto__:null,default:cy},Symbol.toStringTag,{value:"Module"}));async function qIi(t,e={},i){await t.load(i);const r=yd(t.itemUrl,"resources"),{start:n=1,num:s=10,sortOrder:o="asc",sortField:a="created"}=e,l={query:{start:n,num:s,sortOrder:o,sortField:a,token:t.apiKey},signal:Wx(i,"signal")},c=await t.portal.request(r,l);return{total:c.total,nextStart:c.nextStart,resources:c.resources.map(({created:h,size:p,resource:y})=>({created:new Date(h),size:p,resource:t.resourceFromPath(y)}))}}async function YIi(t,e,i,r){if(!t.hasPath())throw new st(`portal-item-resource-${e}:invalid-path`,"Resource does not have a valid path");const n=t.portalItem;await n.load(r);const s=yd(n.userItemUrl,e==="add"?"addResources":"updateResources"),[o,a]=Ipt(t.path),l=await Apt(i),c=new FormData;return o&&o!=="."&&c.append("resourcesPrefix",o),ve(r)&&r.compress&&c.append("compress","true"),c.append("fileName",a),c.append("file",l,a),c.append("f","json"),ve(r)&&r.access&&c.append("access",r.access),await n.portal.request(s,{method:"post",body:c,signal:Wx(r,"signal")}),t}async function XIi(t,e,i){if(!e.hasPath())throw new st("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await t.load(i);const r=yd(t.userItemUrl,"removeResources");await t.portal.request(r,{method:"post",query:{resource:e.path},signal:Wx(i,"signal")}),e.portalItem=null}async function KIi(t,e){await t.load(e);const i=yd(t.userItemUrl,"removeResources");return t.portal.request(i,{method:"post",query:{deleteAll:!0},signal:Wx(e,"signal")})}function Ipt(t){const e=t.lastIndexOf("/");return e===-1?[".",t]:[t.slice(0,e),t.slice(e+1)]}function vRe(t){const[e,i]=JIi(t),[r,n]=Ipt(e);return[r,n,i]}function JIi(t){const e=d1e(t);return lt(e)?[t,""]:[t.slice(0,t.length-e.length-1),`.${e}`]}async function Apt(t){return t instanceof Blob?t:(await ur(t.url,{responseType:"blob"})).data}function ZIi(t,e){if(!t.hasPath())return null;const[i,,r]=vRe(t.path);return t.portalItem.resourceFromPath(yd(i,e+r))}function Ppt(t,e){if(!t.hasPath())return null;const[i,,r]=vRe(t.path);return t.portalItem.resourceFromPath(yd(i,e+r))}const XK=Object.freeze(Object.defineProperty({__proto__:null,addOrUpdateResource:YIi,contentToBlob:Apt,fetchResources:qIi,getSiblingOfSameType:ZIi,getSiblingOfSameTypeI:Ppt,removeAllResources:KIi,removeResource:XIi,splitPrefixFileNameAndExtension:vRe},Symbol.toStringTag,{value:"Module"})),Hw={BingMapsLayer:async()=>(await Promise.resolve().then(()=>Lbr)).default,BuildingSceneLayer:async()=>(await Promise.resolve().then(()=>twr)).default,CSVLayer:async()=>(await Promise.resolve().then(()=>iwr)).default,DimensionLayer:async()=>(await Promise.resolve().then(()=>swr)).default,ElevationLayer:async()=>(await Promise.resolve().then(()=>Ept)).default,FeatureLayer:async()=>(await Promise.resolve().then(()=>lCe)).default,GeoJSONLayer:async()=>(await Promise.resolve().then(()=>awr)).default,GeoRSSLayer:async()=>(await Promise.resolve().then(()=>dwr)).default,GroupLayer:async()=>(await Promise.resolve().then(()=>aRt)).default,ImageryLayer:async()=>(await Promise.resolve().then(()=>KZt)).default,ImageryTileLayer:async()=>(await Promise.resolve().then(()=>Twr)).default,IntegratedMeshLayer:async()=>(await Promise.resolve().then(()=>Nwr)).default,KMLLayer:async()=>(await Promise.resolve().then(()=>$wr)).default,LineOfSightLayer:async()=>(await Promise.resolve().then(()=>qwr)).default,MapImageLayer:async()=>(await Promise.resolve().then(()=>cQt)).default,MapNotesLayer:async()=>(await Promise.resolve().then(()=>Xwr)).default,MediaLayer:async()=>(await Promise.resolve().then(()=>oxr)).default,OGCFeatureLayer:async()=>(await Promise.resolve().then(()=>lxr)).default,OpenStreetMapLayer:async()=>(await Promise.resolve().then(()=>dQt)).default,OrientedImageryLayer:async()=>(await Promise.resolve().then(()=>uxr)).default,PointCloudLayer:async()=>(await Promise.resolve().then(()=>pxr)).default,RouteLayer:async()=>(await Promise.resolve().then(()=>Yxr)).default,SceneLayer:async()=>(await Promise.resolve().then(()=>Zxr)).default,StreamLayer:async()=>(await Promise.resolve().then(()=>Qxr)).default,SubtypeGroupLayer:async()=>(await Promise.resolve().then(()=>l2r)).default,TileLayer:async()=>(await Promise.resolve().then(()=>yQt)).default,UnknownLayer:async()=>(await Promise.resolve().then(()=>u2r)).default,UnsupportedLayer:async()=>(await Promise.resolve().then(()=>c2r)).default,VectorTileLayer:async()=>(await Promise.resolve().then(()=>C2r)).default,VoxelLayer:async()=>(await Promise.resolve().then(()=>F2r)).default,WFSLayer:async()=>(await Promise.resolve().then(()=>L2r)).default,WMSLayer:async()=>(await Promise.resolve().then(()=>RQt)).default,WMTSLayer:async()=>(await Promise.resolve().then(()=>iSr)).default,WebTileLayer:async()=>(await Promise.resolve().then(()=>hQt)).default};function QIi(t){return _Re(t,"notes")}function eAi(t){return _Re(t,"markup")}function tAi(t){return _Re(t,"route")}function _Re(t,e){return!(!t.layerType||t.layerType!=="ArcGISFeatureLayer")&&t.featureCollectionType===e}async function D_(t,e){const{data:i}=await ur(t,{responseType:"json",query:{f:"json",...e?.customParameters,token:e?.apiKey}});return i}async function bRe(t,e){const i=await D_(t,e);i.layers=i.layers.filter(Opt);const r={serviceJSON:i};if((i.currentVersion??0)<10.5)return r;const n=await D_(t+"/layers",e);return r.layersJSON={layers:n.layers.filter(Opt),tables:n.tables},r}function Opt(t){return!t.type||t.type==="Feature Layer"}function Rpt(t){return{origin:"portal-item",url:fa(t.itemUrl),portal:t.portal||Cc.getDefault(),portalItem:t,readResourcePaths:[]}}function Mpt(t){return{origin:"portal-item",messages:[],writtenProperties:[],url:t.itemUrl?fa(t.itemUrl):null,portal:t.portal||Cc.getDefault(),portalItem:t}}async function iAi(t,e){const i=t.instance.portalItem;if(i&&i.id)return await i.load(e),rAi(t),nAi(t,e)}function rAi(t){const e=t.instance.portalItem;if(!e?.type||!t.supportedTypes.includes(e.type))throw new st("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:e?.type,expectedType:t.supportedTypes.join(", ")})}async function nAi(t,e){const i=t.instance,r=i.portalItem;if(!r)return;const{url:n,title:s}=r,o=Rpt(r);if(i.type==="group")return i.read({title:s},o),sAi(i,t);n&&i.read({url:n},o);const a=await Lpt(t,e);return a&&i.read(a,o),i.resourceReferences={portalItem:r,paths:o.readResourcePaths??[]},i.type!=="subtype-group"&&i.read({title:s},o),Kq(i,o)}async function sAi(t,e){let i;const{portalItem:r}=t;if(!r)return;const n=r.type,s=e.layerModuleTypeMap,o=aB(r,"Oriented Imagery Layer")??!1;switch(n){case"Feature Service":i=o?s.OrientedImageryLayer:s.FeatureLayer;break;case"Stream Service":i=s.StreamLayer;break;case"Scene Service":i=s.SceneLayer;break;case"Feature Collection":i=s.FeatureLayer;break;default:throw new st("portal:unsupported-item-type-as-group",`The item type '${n}' is not supported as a 'IGroupLayer'`)}let[a,l]=await Promise.all([i(),Lpt(e)]),c=()=>a;if(n==="Feature Service"){if(l=r.url?await xRe(l,r.url):{},dde(l).length){const h=s.SubtypeGroupLayer,p=await h();c=y=>y.layerType==="SubtypeGroupLayer"?p:a}return wRe(t,c,l,await hAi(r.url))}return Sk(l)>0?wRe(t,c,l):oAi(t,c)}async function oAi(t,e){const{portalItem:i}=t;if(!i?.url)return;const r=await D_(i.url);r&&wRe(t,e,{layers:r.layers?.map(Dpt),tables:r.tables?.map(Dpt)})}function Dpt(t){return{id:t.id,name:t.name}}function wRe(t,e,i,r){let n=i.layers||[];const s=i.tables||[];if(t.portalItem?.type==="Feature Collection"&&(n.forEach(o=>{o?.layerDefinition?.type==="Table"&&s.push(o)}),n=n.filter(o=>o?.layerDefinition?.type!=="Table")),"coverage"in i){const o=uAi(i);o&&t.add(o)}n.reverse().forEach(o=>{const a=Fpt(t,e(o),i,o,r?.(o));t.add(a)}),s.reverse().forEach(o=>{const a=Fpt(t,e(o),i,o,r?.(o));t.tables.add(a)})}function Fpt(t,e,i,r,n){const s=t.portalItem,o=new e({portalItem:s.clone(),layerId:r.id});if("sourceJSON"in o&&(o.sourceJSON=n),o.type!=="subtype-group"&&(o.sublayerTitleMode="service-name"),s.type==="Feature Collection"){const a={origin:"portal-item",portal:s.portal||Cc.getDefault()};o.read(r,a);const l=i.showLegend;l!=null&&o.read({showLegend:l},a)}return o}async function Lpt(t,e){if(t.supportsData===!1)return;const i=t.instance,r=i.portalItem;if(!r)return;let n=null;try{n=await r.fetchData("json",e)}catch{}if(lAi(i)){let s=null,o=!0;if(n&&Sk(n)>0){if(i.layerId==null){const a=dde(n);i.layerId=i.type==="subtype-group"?a?.[0]:SRe(n)}s=aAi(n,i),s&&(Sk(n)===1&&(o=!1),n.showLegend!=null&&(s.showLegend=n.showLegend))}return o&&i.sublayerTitleMode!=="service-name"&&(i.sublayerTitleMode="item-title-and-service-name"),s}return n}async function xRe(t,e){if(t?.layers==null||t?.tables==null){const i=await D_(e);(t=t||{}).layers=t.layers||i?.layers,t.tables=t.tables||i?.tables}return t}function SRe(t){const e=t.layers;if(e&&e.length)return e[0].id;const i=t.tables;return i&&i.length?i[0].id:null}function aAi(t,e){const{layerId:i}=e,r=t.layers?.find(n=>n.id===i)||t.tables?.find(n=>n.id===i);return r&&cAi(r,e)?r:null}function Sk(t){return(t?.layers?.length??0)+(t?.tables?.length??0)}function lAi(t){return t.type!=="stream"&&t.type!=="oriented-imagery"&&"layerId"in t}function uAi(t){const{coverage:e}=t;if(!e)return null;const i=new URL(e);if(e.toLowerCase().includes("item.html")){const r=i.searchParams.get("id"),n=i.origin;return du.fromPortalItem({portalItem:new Q0({id:r,url:n})})}if(FHe(e))return du.fromArcGISServerUrl({url:e});throw new st("portal:oriented-imagery-layer-coverage","the provided coverage url couldn't be loaded as a layer")}function dde(t){const e=[];return t?.layers?.forEach(i=>{i.layerType==="SubtypeGroupLayer"&&e.push(i.id)}),e}function cAi(t,e){return!(e.type==="feature"&&"layerType"in t&&t.layerType==="SubtypeGroupLayer"||e.type==="subtype-group"&&!("layerType"in t))}async function hAi(t){const{layersJSON:e}=await bRe(t);if(!e)return null;const i=[...e.layers,...e.tables];return r=>i.find(n=>n.id===r.id)}const dAi=Object.freeze(Object.defineProperty({__proto__:null,getFirstLayerOrTableId:SRe,getNumLayersAndTables:Sk,getSubtypeGroupLayerIds:dde,load:iAi,preprocessFSItemData:xRe},Symbol.toStringTag,{value:"Module"}));async function pAi(t){!t.portalItem||t.portalItem instanceof Q0||(t={...t,portalItem:new Q0(t.portalItem)});const e=await fAi(t.portalItem);return new e.constructor({portalItem:t.portalItem,...e.properties})}async function fAi(t){return await t.load(),mAi(await CRe(t))}async function CRe(t){switch(t.type){case"Map Service":return gAi(t);case"Feature Service":return yAi(t);case"Feature Collection":return _Ai(t);case"Scene Service":return vAi(t);case"Image Service":return bAi(t);case"Stream Service":return wAi();case"Vector Tile Service":return xAi();case"GeoJson":return SAi();case"CSV":return CAi();case"KML":return TAi();case"WFS":return EAi();case"WMTS":return AAi();case"WMS":return IAi();case"Feed":return PAi();default:throw new st("portal:unknown-item-type","Unknown item type '${type}'",{type:t.type})}}async function mAi(t){const e=Hw[t.className];return{constructor:await e(),properties:t.properties}}async function gAi(t){return await RAi(t)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function yAi(t){if(aB(t,"Oriented Imagery Layer"))return OAi(t);const e=await Npt(t);if(typeof e=="object"){const i={};return e.id!=null&&(i.layerId=e.id),{className:e.className||"FeatureLayer",properties:i}}return{className:"GroupLayer"}}async function vAi(t){const e=await Npt(t);if(typeof e=="object"){const i={};let r;if(e.id!=null?(i.layerId=e.id,r=`${t.url}/layers/${e.id}`):r=t.url,t.typeKeywords?.length){for(const s of Object.keys(JH))if(t.typeKeywords.includes(s))return{className:JH[s]}}const n=await D_(r);return{className:JH[n?.layerType]||"SceneLayer",properties:i}}return e===!1?(await D_(t.url))?.layerType==="Voxel"?{className:"VoxelLayer"}:{className:"GroupLayer"}:{className:"GroupLayer"}}async function _Ai(t){await t.load();const e=aB(t,"Map Notes"),i=aB(t,"Markup");if(e||i)return{className:"MapNotesLayer"};if(aB(t,"Route Layer"))return{className:"RouteLayer"};const r=await t.fetchData();return Sk(r)===1?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function bAi(t){await t.load();const e=t.typeKeywords?.map(o=>o.toLowerCase())??[];if(e.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(e.includes("tiled imagery"))return{className:"ImageryTileLayer"};const i=(await t.fetchData())?.layerType;if(i==="ArcGISTiledImageServiceLayer")return{className:"ImageryTileLayer"};if(i==="ArcGISImageServiceLayer")return{className:"ImageryLayer"};const r=await D_(t.url),n=r.cacheType?.toLowerCase(),s=r.capabilities?.toLowerCase().includes("tilesonly");return n==="map"||s?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function wAi(){return{className:"StreamLayer"}}function xAi(){return{className:"VectorTileLayer"}}function SAi(){return{className:"GeoJSONLayer"}}function CAi(){return{className:"CSVLayer"}}function TAi(){return{className:"KMLLayer"}}function EAi(){return{className:"WFSLayer"}}function IAi(){return{className:"WMSLayer"}}function AAi(){return{className:"WMTSLayer"}}function PAi(){return{className:"StreamLayer"}}async function OAi(t){await t.load();const e=await t.fetchData();return e.coverage?{className:"GroupLayer"}:{className:"OrientedImageryLayer",properties:e}}async function RAi(t){return(await D_(t.url)).tileInfo}async function Npt(t){const e=t.url;if(!e||e.match(/\/\d+$/))return{};await t.load();const i=await t.fetchData();if(t.type==="Feature Service"){const r=TRe(await xRe(i,e));if(typeof r=="object"){const n=dde(i);r.className=r.id!=null&&n.includes(r.id)?"SubtypeGroupLayer":"FeatureLayer"}return r}return Sk(i)>0?TRe(i):TRe(await D_(e))}function TRe(t){return Sk(t)===1&&{id:SRe(t)}}const MAi=Object.freeze(Object.defineProperty({__proto__:null,fromItem:pAi,selectLayerClassPath:CRe},Symbol.toStringTag,{value:"Module"}));async function kpt(t,e,i){if(!e)return;const r=[];for(const s of e){const o=BAi(s,i);s.layerType==="GroupLayer"?r.push(UAi(o,s,i)):r.push(o)}const n=await Ru(r);for(const s of n)s.value&&t.add(s.value)}const DAi={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",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer",LineOfSightLayer:"LineOfSightLayer"},FAi={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},LAi={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",DefaultTileLayer:"TileLayer"},NAi={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},kAi={ArcGISFeatureLayer:"FeatureLayer"},$Ai={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"};async function BAi(t,e){return VAi(await jAi(t,e),t,e)}async function VAi(t,e,i){const r=new t;return r.read(e,i.context),r.type==="group"&&$pt(e)&&await zAi(r,e,i.context),await Kq(r,i.context),r}async function jAi(t,e){const i=e.context,r=GAi(i);let n=t.layerType||t.type;!n&&e&&e.defaultLayerType&&(n=e.defaultLayerType);const s=r[n];let o=s?Hw[s]:Hw.UnknownLayer;if(Bpt(t)){const a=i?.portal;if(t.itemId){const l=new Q0({id:t.itemId,portal:a});await l.load();const c=(await CRe(l)).className||"UnknownLayer";o=Hw[c]}}else n==="ArcGISFeatureLayer"?QIi(t)||eAi(t)?o=Hw.MapNotesLayer:tAi(t)?o=Hw.RouteLayer:$pt(t)&&(o=Hw.GroupLayer):t.wmtsInfo&&t.wmtsInfo.url&&t.wmtsInfo.layerIdentifier?o=Hw.WMTSLayer:n==="WFS"&&t.wfsInfo?.version!=="2.0.0"&&(o=Hw.UnsupportedLayer);return o()}function $pt(t){return t.layerType!=="ArcGISFeatureLayer"||Bpt(t)?!1:(t.featureCollection?.layers?.length??0)>1}function Bpt(t){return t.type==="Feature Collection"}function GAi(t){let e;if(t.origin==="web-scene")switch(t.layerContainerType){case"basemap":e=LAi;break;case"ground":e=FAi;break;default:e=DAi}else switch(t.layerContainerType){case"basemap":e=$Ai;break;case"tables":e=kAi;break;default:e=NAi}return e}async function UAi(t,e,i){const r=new Sr,n=kpt(r,Array.isArray(e.layers)?e.layers:[],i),s=await t;if(await n,s.type==="group")return s.layers.addMany(r),s}async function zAi(t,e,i){const r=Hw.FeatureLayer,n=await r(),s=e.featureCollection,o=s?.showLegend,a=s?.layers?.map((l,c)=>{const h=new n;h.read(l,i);const p={...i,ignoreDefaults:!0};return h.read({id:`${t.id}-sublayer-${c}`,visibility:e.visibleLayers?.includes(c)??!0},p),o!=null&&h.read({showLegend:o},p),h});t.layers.addMany(a??[])}const Vpt=Object.freeze(Object.defineProperty({__proto__:null,populateOperationalLayers:kpt},Symbol.toStringTag,{value:"Module"}));var It;(function(t){t.AsyncNotEnabled="AsyncNotEnabled",t.ModulesNotSupported="ModulesNotSupported",t.CircularModules="CircularModules",t.NeverReach="NeverReach",t.UnsupportedHashType="UnsupportedHashType",t.InvalidParameter="InvalidParameter",t.UnexpectedToken="UnexpectedToken",t.Unrecognised="Unrecognised",t.UnrecognisedType="UnrecognisedType",t.MaximumCallDepth="MaximumCallDepth",t.BooleanConditionRequired="BooleanConditionRequired",t.TypeNotAllowedInFeature="TypeNotAllowedInFeature",t.KeyMustBeString="KeyMustBeString",t.WrongNumberOfParameters="WrongNumberOfParameters",t.CallNonFunction="CallNonFunction",t.NoFunctionInTemplateLiteral="NoFunctionInTemplateLiteral",t.NoFunctionInDictionary="NoFunctionInDictionary",t.NoFunctionInArray="NoFunctionInArray",t.AssignModuleFunction="AssignModuleFunction",t.LogicExpressionOrAnd="LogicExpressionOrAnd",t.LogicalExpressionOnlyBoolean="LogicalExpressionOnlyBoolean",t.FuncionNotFound="FunctionNotFound",t.InvalidMemberAccessKey="InvalidMemberAccessKey",t.UnsupportedUnaryOperator="UnsupportUnaryOperator",t.InvalidIdentifier="InvalidIdentifier",t.MemberOfNull="MemberOfNull",t.UnsupportedOperator="UnsupportedOperator",t.Cancelled="Cancelled",t.ModuleAccessorMustBeString="ModuleAccessorMustBeString",t.ModuleExportNotFound="ModuleExportNotFound",t.Immutable="Immutable",t.OutOfBounds="OutOfBounds",t.IllegalResult="IllegalResult",t.FieldNotFound="FieldNotFound",t.PortalRequired="PortalRequired",t.LogicError="LogicError",t.ArrayAccessorMustBeNumber="ArrayAccessMustBeNumber",t.KeyAccessorMustBeString="KeyAccessorMustBeString",t.WrongSpatialReference="WrongSpatialReference"})(It||(It={}));const jpt={[It.TypeNotAllowedInFeature]:"Feature attributes only support dates, numbers, strings, guids.",[It.LogicError]:"Logic error - {reason}",[It.NeverReach]:"Encountered unreachable logic",[It.AsyncNotEnabled]:"Async Arcade must be enabled for this script",[It.ModuleAccessorMustBeString]:"Module accessor must be a string",[It.ModuleExportNotFound]:"Module has no export with provided identifier",[It.ModulesNotSupported]:"Current profile does not support modules",[It.ArrayAccessorMustBeNumber]:"Array accessor must be a number",[It.FuncionNotFound]:"Function not found",[It.FieldNotFound]:"Key not found - {key}",[It.CircularModules]:"Circular module dependencies are not allowed",[It.Cancelled]:"Execution cancelled",[It.UnsupportedHashType]:"Type not supported in hash function",[It.IllegalResult]:"Value is not a supported return type",[It.PortalRequired]:"Portal is required",[It.InvalidParameter]:"Invalid parameter",[It.WrongNumberOfParameters]:"Call with wrong number of parameters",[It.Unrecognised]:"Unrecognised code structure",[It.UnrecognisedType]:"Unrecognised type",[It.WrongSpatialReference]:"Cannot work with geometry in this spatial reference. It is different to the execution spatial reference",[It.BooleanConditionRequired]:"Conditions must use booleans",[It.NoFunctionInDictionary]:"Dictionaries cannot contain functions.",[It.NoFunctionInArray]:"Arrays cannot contain functions.",[It.NoFunctionInTemplateLiteral]:"Template Literals do not expect functions by value.",[It.KeyAccessorMustBeString]:"Accessor must be a string",[It.KeyMustBeString]:"Object keys must be a string",[It.Immutable]:"Object is immutable",[It.InvalidParameter]:"Invalid parameter",[It.UnexpectedToken]:"Unexpected token",[It.MemberOfNull]:"Cannot access property of null object",[It.MaximumCallDepth]:"Exceeded maximum function depth",[It.OutOfBounds]:"Out of bounds",[It.InvalidIdentifier]:"Identifier not recognised",[It.FuncionNotFound]:"Function not found",[It.CallNonFunction]:"Expression is not a function",[It.InvalidMemberAccessKey]:"Cannot access value using a key of this type",[It.AssignModuleFunction]:"Cannot assign function to module variable",[It.UnsupportedUnaryOperator]:"Unsupported unary operator",[It.UnsupportedOperator]:"Unsupported operator",[It.LogicalExpressionOnlyBoolean]:"Logical expressions must be boolean",[It.LogicExpressionOrAnd]:"Logical expression can only be combined with || or &&"};let HAi=class extends Error{constructor(...e){super(...e)}},Gpt=class i5t extends HAi{constructor(e,i){super(ERe(i)+e.message,{cause:e}),this.loc=null,Error.captureStackTrace&&Error.captureStackTrace(this,i5t),i&&i.loc&&(this.loc=i.loc)}},Vt=class r5t extends Error{constructor(e,i,r,n){super("Execution error - "+ERe(r)+Mj(jpt[i],n)),this.loc=null,this.declaredRootClass="esri.arcade.arcadeexecutionerror",Error.captureStackTrace&&Error.captureStackTrace(this,r5t),r&&r.loc&&(this.loc=r.loc)}};function ERe(t){return t&&t.loc?`Line : ${t.loc.start?.line}, ${t.loc.start?.column}: `:""}let x0=class n5t extends Error{constructor(e,i,r,n){super("Compilation error - "+ERe(r)+Mj(jpt[i],n)),this.loc=null,this.declaredRootClass="esri.arcade.arcadecompilationerror",Error.captureStackTrace&&Error.captureStackTrace(this,n5t),r&&r.loc&&(this.loc=r.loc)}},IRe=class s5t extends Error{constructor(){super("Uncompilable code structures"),this.declaredRootClass="esri.arcade.arcadeuncompilableerror",Error.captureStackTrace&&Error.captureStackTrace(this,s5t)}};function Mj(t,e){try{if(!e)return t;for(const i in e){let r=e[i];r||(r=""),t=t.replace("{"+i+"}",e[i])}}catch{}return t}function Upt(t,e,i){return i.declaredRootClass==="esri.arcade.arcadeexecutionerror"||i.declaredRootClass==="esri.arcade.arcadecompilationerror"?i.loc===null&&e&&e.loc?new Gpt(i,{cause:i}):i:(i.declaredRootClass==="esri.arcade.featureset.support.featureseterror"||i.declaredRootClass==="esri.arcade.featureset.support.sqlerror"||i.declaredRootClass,e&&e.loc?new Gpt(i,{cause:i}):i)}var Ck;(function(t){t.UnrecognisedUri="UnrecognisedUri",t.UnsupportedUriProtocol="UnsupportedUriProtocol"})(Ck||(Ck={}));const WAi={[Ck.UnrecognisedUri]:"Unrecognised uri - {uri}",[Ck.UnsupportedUriProtocol]:"Unrecognised uri protocol"};let ARe=class o5t extends Error{constructor(e,i){super(Mj(WAi[e],i)),this.declaredRootClass="esri.arcade.arcademoduleerror",Error.captureStackTrace&&Error.captureStackTrace(this,o5t)}},_D=class{};var pde;_D.instance=new x2("Etc/UTC"),function(t){t.TimeZoneNotRecognised="TimeZoneNotRecognised"}(pde||(pde={}));const qAi={[pde.TimeZoneNotRecognised]:"Timezone identifier has not been recognised."};let YAi=class a5t extends Error{constructor(e,i){super(Mj(qAi[e],i)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,a5t)}},Cl=class ng{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,i=1,r=1,n=0,s=0,o=0,a=0,l){if(isNaN(e)||isNaN(i)||isNaN(r)||isNaN(n)||isNaN(s)||isNaN(o)||isNaN(a))return null;let c=0;const h=ro.local(e,i).daysInMonth;r<1&&(c=r-1,r=1),r>h&&(c=r-h,r=h);let p=0;i>12?(p=i-12,i=12):i<1&&(p=i-1,i=1);let y=0;s>59?(y=s-59,s=59):s<0&&(y=s,s=0);let v=0;o>59?(v=o-59,o=59):o<0&&(v=o,o=0);let x=0;a>999?(x=a-999,a=999):a<0&&(x=a,a=0);let I=ro.fromObject({day:r,year:e,month:i,hour:n,minute:s,second:o,millisecond:a},{zone:KK(l)});return p!==0&&(I=I.plus({months:p})),c!==0&&(I=I.plus({days:c})),y!==0&&(I=I.plus({minutes:y})),v!==0&&(I=I.plus({seconds:v})),x!==0&&(I=I.plus({milliseconds:x})),new ng(I)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,i){const r=KK(i);return e.isUnknownTimeZone||r===_D.instance?ng.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,r):new ng(e._date.setZone(i))}static dateJSToArcadeDate(e){return new ng(ro.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,i="system"){return new ng(ro.fromJSDate(e,{zone:i}))}static unknownEpochToArcadeDate(e){return new ng(ro.fromMillis(e,{zone:_D.instance}))}static unknownDateJSToArcadeDate(e){return new ng(ro.fromMillis(e.getTime(),{zone:_D.instance}))}static epochToArcadeDate(e,i="system"){return new ng(ro.fromMillis(e,{zone:i}))}static dateTimeToArcadeDate(e){return new ng(e)}changeTimeZone(e){const i=KK(e);return ng.dateTimeToArcadeDate(this._date.setZone(i))}static dateTimeAndZoneToArcadeDate(e,i){const r=KK(i);return e.zone===_D.instance||r===_D.instance?ng.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,r):new ng(e.setZone(r))}static nowToArcadeDate(e){return new ng(ro.fromJSDate(new Date,{zone:e}))}static nowUTCToArcadeDate(){return new ng(ro.utc())}get isSystem(){return this.timeZone==="system"||this.timeZone===ng.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===_D.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 ng(this._date.plus(e))}diff(e,i="milliseconds"){return this._date.diff(e._date,i)[i]}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toFormat(e,i){return this._date.toFormat(e,i)}toJSDate(){return this._date.toJSDate()}toSQLString(){return"timestamp '"+this._date.toFormat("yyyy-LL-dd HH:mm:ss")+"'"}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new ng(this._date.toUTC())}toLocal(){return new ng(this._date.toLocal())}toString(){return this.toISOString(!0)}};function KK(t){if(t instanceof U9)return t;if(t.toLowerCase()==="system")return"system";if(t.toLowerCase()==="utc")return"utc";if(t.toLowerCase()==="unknown")return _D.instance;if(/^[\+\-]?[0-9]{1,2}([:][0-9]{2})?$/.test(t)){const i=Kg.parseSpecifier("UTC"+(t.startsWith("+")||t.startsWith("-")?"":"+")+t);if(i)return i}const e=x2.create(t);if(!e.isValid)throw new YAi(pde.TimeZoneNotRecognised);return e}let bg=class{constructor(e=[]){this._elements=e}length(){return this._elements.length}get(e){return this._elements[e]}toArray(){const e=[];for(let i=0;ithis.fn(e,{preparsed:!0,arguments:i})}call(e,i){return this.fn(e,i)}marshalledCall(e,i,r,n){return n(e,i,(s,o,a)=>{a=a.map(c=>c instanceof bD&&!(c instanceof Ww)?wD(c,e,n):c);const l=this.call(r,{args:a});return Fp(l)?l.then(c=>wD(c,r,n)):l})}},Ww=class extends bD{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(e){return this.fn.createFunction(this.context)}call(e,i){return this.fn.marshalledCall(e,i,this.context,this.parameterEvaluator)}marshalledCall(e,i,r){return this.fn.marshalledCall(e,i,this.context,this.parameterEvaluator)}},Tk=class l5t extends bg{constructor(e,i,r,n,s,o){super(e),this._lazyPt=[],this._hasZ=!1,this._hasM=!1,this._spRef=i,this._hasZ=r,this._hasM=n,this._cacheId=s,this._partId=o}get(e){if(this._lazyPt[e]===void 0){const i=this._elements[e];if(i===void 0)return;const r=this._hasZ,n=this._hasM;let s=null;s=r&&!n?new er(i[0],i[1],i[2],void 0,this._spRef):n&&!r?new er(i[0],i[1],void 0,i[2],this._spRef):r&&n?new er(i[0],i[1],i[2],i[3],this._spRef):new er(i[0],i[1],this._spRef),s.cache._arcadeCacheId=this._cacheId.toString()+"-"+this._partId.toString()+"-"+e.toString(),this._lazyPt[e]=s}return this._lazyPt[e]}equalityTest(e){return e===this||e!==null&&e instanceof l5t&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()+"-"+this._partId.toString()}},PRe=class u5t extends bg{constructor(e,i,r,n,s){super(e),this._lazyPath=[],this._hasZ=!1,this._hasM=!1,this._hasZ=r,this._hasM=n,this._spRef=i,this._cacheId=s}get(e){if(this._lazyPath[e]===void 0){const i=this._elements[e];if(i===void 0)return;this._lazyPath[e]=new Tk(i,this._spRef,this._hasZ,this._hasM,this._cacheId,e)}return this._lazyPath[e]}equalityTest(e){return e===this||e!==null&&e instanceof u5t&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()}};const ORe={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function zpt(t=Z0()){let e=(t=t.toLowerCase())in ORe;if(!e){const s=t.split("-");s.length>1&&s[0]in ORe&&(t=s[0],e=!0),e||(t="en")}const[i,r,n="#,##0.###"]=ORe[t];return{decimal:i,group:r,pattern:n}}function XAi(t,e){const i=zpt((e={...e}).locale);e.customs=i;const r=e.pattern||i.pattern;return isNaN(t)||Math.abs(t)===1/0?null:KAi(t,r,e)}const Hpt=/[#0,]*[#0](?:\.0*#*)?/;function KAi(t,e,i){const r=(i=i||{}).customs.group,n=i.customs.decimal,s=e.split(";"),o=s[0];if((e=s[t<0?1:0]||"-"+o).includes("%"))t*=100;else if(e.includes("‰"))t*=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=Hpt,l=o.match(a);if(!l)throw new Error("unable to find a number expression in pattern: "+e);return i.fractional===!1&&(i.places=0),e.replace(a,JAi(t,l[0],{decimal:n,group:r,places:i.places,round:i.round}))}function JAi(t,e,i){(i=i||{}).places===!0&&(i.places=0),i.places===1/0&&(i.places=6);const r=e.split("."),n=typeof i.places=="string"&&i.places.indexOf(",");let s=i.places;n?s=i.places.substring(n+1):s>=0||(s=(r[1]||[]).length),i.round<0||(t=Number(t.toFixed(Number(s))));const o=String(Math.abs(t)).split("."),a=o[1]||"";if(r[1]||i.places){n&&(i.places=i.places.substring(0,n));const x=i.places!==void 0?i.places:r[1]&&r[1].lastIndexOf("0")+1;x>a.length&&(o[1]=a.padEnd(Number(x),"0")),so[0].length&&(o[0]=o[0].padStart(c,"0")),l.includes("#")||(o[0]=o[0].substr(o[0].length-c)));let h,p,y=r[0].lastIndexOf(",");if(y!==-1){h=r[0].length-y-1;const x=r[0].substr(0,y);y=x.lastIndexOf(","),y!==-1&&(p=x.length-y-1)}const v=[];for(let x=o[0];x;){const I=x.length-h;v.push(I>0?x.substr(I):x),x=I>0?x.slice(0,I):"",p&&(h=p,p=void 0)}return o[0]=v.reverse().join(i.group||","),o.join(i.decimal||".")}function Wpt(t){const e=zpt((t=t||{}).locale),i=t.pattern||e.pattern,r=e.group,n=e.decimal;let s=1;if(i.includes("%"))s/=100;else if(i.includes("‰"))s/=1e3;else if(i.includes("¤"))throw new Error("currency notation not supported");const o=i.split(";");return o.length===1&&o.push("-"+o[0]),{regexp:JK(o,l=>(l="(?:"+x_e(l,".")+")").replace(Hpt,c=>{const h={signed:!1,separator:t.strict?r:[r,""],fractional:t.fractional,decimal:n,exponent:!1},p=c.split(".");let y=t.places;p.length===1&&s!==1&&(p[1]="###"),p.length===1||y===0?h.fractional=!1:(y===void 0&&(y=t.pattern?p[1].lastIndexOf("0")+1:1/0),y&&t.fractional==null&&(h.fractional=!0),!t.places&&y1&&(h.groupSize=v.pop().length,v.length>1&&(h.groupSize2=v.pop().length)),"("+ZAi(h)+")"}),!0).replace(/[\xa0 ]/g,"[\\s\\xa0]"),group:r,decimal:n,factor:s}}function qpt(t,e){const i=Wpt(e),r=new RegExp("^"+i.regexp+"$").exec(t);if(!r)return NaN;let n=r[1];if(!r[1]){if(!r[2])return NaN;n=r[2],i.factor*=-1}return n=n.replace(new RegExp("["+i.group+"\\s\\xa0]","g"),"").replace(i.decimal,"."),Number(n)*i.factor}function ZAi(t){"places"in(t=t||{})||(t.places=1/0),typeof t.decimal!="string"&&(t.decimal="."),"fractional"in t&&!/^0/.test(String(t.places))||(t.fractional=[!0,!1]),"exponent"in t||(t.exponent=[!0,!1]),"eSigned"in t||(t.eSigned=[!0,!1]);const e=Ypt(t),i=JK(t.fractional,n=>{let s="";return n&&t.places!==0&&(s="\\"+t.decimal,t.places===1/0?s="(?:"+s+"\\d+)?":s+="\\d{"+t.places+"}"),s},!0);let r=e+i;return i&&(r="(?:(?:"+r+")|(?:"+i+"))"),r+JK(t.exponent,n=>n?"([eE]"+Ypt({signed:t.eSigned})+")":"")}function Ypt(t){return"signed"in(t=t||{})||(t.signed=[!0,!1]),"separator"in t?"groupSize"in t||(t.groupSize=3):t.separator="",JK(t.signed,e=>e?"[-+]":"",!0)+JK(t.separator,e=>{if(!e)return"(?:\\d+)";(e=x_e(e))===" "?e="\\s":e===" "&&(e="\\s\\xa0");const i=t.groupSize,r=t.groupSize2;if(r){const n="(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+e+"]\\d{"+r+"})*["+e+"]\\d{"+i+"})";return i-r>0?"(?:"+n+"|(?:0|[1-9]\\d{0,"+(i-1)+"}))":n}return"(?:0|[1-9]\\d{0,"+(i-1)+"}(?:["+e+"]\\d{"+i+"})*)"},!0)}const JK=(t,e,i)=>{if(!(t instanceof Array))return e(t);const r=[];for(let n=0;n"("+(e?"?:":"")+t+")";var Eo,nc;function fde(t){return Jo.fromJSON(t.toJSON())}function RRe(t){return t.toJSON?t.toJSON():t}function ePi(t){return typeof t=="string"||t instanceof String}function tPi(t){return typeof t=="number"}function Dj(t){return t instanceof Date}function ZK(t){return t instanceof Cl}function iPi(t,e){return t===e||!(!Dj(t)&&!ZK(t)||!Dj(e)&&!ZK(e))&&t.getTime()===e.getTime()}function rPi(t){if(t==null)return null;if(typeof t=="number")return t;switch(t.toLowerCase()){case"meters":case"meter":return 109404;case"miles":case"mile":return 109439;case"kilometers":case"kilometer":case"km":return 109414}return null}function Xpt(t){if(t==null)return null;switch(t.type){case"polygon":case"multipoint":case"polyline":return t.extent;case"point":return new Ar({xmin:t.x,ymin:t.y,xmax:t.x,ymax:t.y,spatialReference:t.spatialReference});case"extent":return t}return null}function nPi(t){if(t==null)return null;if(typeof t=="number"||typeof t=="number")return t;switch(t.toLowerCase()){case"meters":case"meter":return 9001;case"miles":case"mile":return 9093;case"kilometers":case"kilometer":case"km":return 9036}return null}(function(t){t[t.Standardised=0]="Standardised",t[t.StandardisedNoInterval=1]="StandardisedNoInterval",t[t.SqlServer=2]="SqlServer",t[t.Oracle=3]="Oracle",t[t.Postgres=4]="Postgres",t[t.PGDB=5]="PGDB",t[t.FILEGDB=6]="FILEGDB",t[t.NotEvaluated=7]="NotEvaluated"})(Eo||(Eo={})),function(t){t[t.InFeatureSet=0]="InFeatureSet",t[t.NotInFeatureSet=1]="NotInFeatureSet",t[t.Unknown=2]="Unknown"}(nc||(nc={}));const MRe=1e3,mde={point:"point",polygon:"polygon",polyline:"polyline",multipoint:"multipoint",extent:"extent",esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint",esriGeometryEnvelope:"extent",envelope:"extent"},gde={point:"esriGeometryPoint",polygon:"esriGeometryPolygon",polyline:"esriGeometryPolyline",multipoint:"esriGeometryMultipoint",extent:"esriGeometryEnvelope",esriGeometryPoint:"esriGeometryPoint",esriGeometryPolygon:"esriGeometryPolygon",esriGeometryPolyline:"esriGeometryPolyline",esriGeometryMultipoint:"esriGeometryMultipoint",esriGeometryEnvelope:"esriGeometryEnvelope",envelope:"esriGeometryEnvelope"},yde={"small-integer":"esriFieldTypeSmallInteger",integer:"esriFieldTypeInteger",long:"esriFieldTypeLong",single:"esriFieldTypeSingle",double:"esriFieldTypeDouble",string:"esriFieldTypeString",date:"esriFieldTypeDate",oid:"esriFieldTypeOID",geometry:"esriFieldTypeGeometry",blob:"esriFieldTypeBlob",raster:"esriFieldTypeRaster",guid:"esriFieldTypeGUID","global-id":"esriFieldTypeGlobalID",xml:"eesriFieldTypeXML",esriFieldTypeSmallInteger:"esriFieldTypeSmallInteger",esriFieldTypeInteger:"esriFieldTypeInteger",esriFieldTypeLong:"esriFieldTypeLong",esriFieldTypeSingle:"esriFieldTypeSingle",esriFieldTypeDouble:"esriFieldTypeDouble",esriFieldTypeString:"esriFieldTypeString",esriFieldTypeDate:"esriFieldTypeDate",esriFieldTypeOID:"esriFieldTypeOID",esriFieldTypeGeometry:"esriFieldTypeGeometry",esriFieldTypeBlob:"esriFieldTypeBlob",esriFieldTypeRaster:"esriFieldTypeRaster",esriFieldTypeGUID:"esriFieldTypeGUID",esriFieldTypeGlobalID:"esriFieldTypeGlobalID",esriFieldTypeXML:"eesriFieldTypeXML"};function DRe(t){return t===void 0?"":t=(t=(t=t.replace(/\/featureserver\/[0-9]*/i,"/FeatureServer")).replace(/\/mapserver\/[0-9]*/i,"/MapServer")).split("?")[0]}function sPi(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});const i=typeof e.cycles=="boolean"&&e.cycles,r=e.cmp&&(n=e.cmp,function(o){return function(a,l){const c={key:a,value:o[a]},h={key:l,value:o[l]};return n(c,h)}});var n;const s=[];return function o(a){if(a&&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,c;if(Array.isArray(a)){for(c="[",l=0;li)throw new Vt(r,It.WrongNumberOfParameters,n)}function kRe(t){return t<0?-Math.round(-t):Math.round(t)}function Fj(){let t=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),(e==="x"?i:3&i|8).toString(16)})}function $Re(t,e){return isNaN(t)||e==null||e===""?t.toString():(e=qw(e,"‰",""),e=qw(e,"¤",""),XAi(t,{pattern:e}))}function bde(t,e){return e==null||e===""?t.toISOString(!0):t.toFormat(BRe(e),{locale:Z0(),numberingSystem:"latn"})}function BRe(t){t=t.replace(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let e="";const i=/(\[[^\[]*\])|(\\)?([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 t.match(i)||[])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"Z":e+="ZZ";break;case"ZZ":e+="ZZZ";break;case"S":e+="'S'";break;case"SS":e+="'SS'";break;case"SSS":e+="u";break;case"A":case"a":e+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":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}function Nc(t,e,i){switch(i){case">":return t>e;case"<":return t=":return t>=e;case"<=":return t<=e}return!1}function wde(t,e,i){if(t===null){if(e===null||e===ln)return Nc(null,null,i);if(nl(e))return Nc(0,e,i);if(On(e)||Ua(e))return Nc(0,$i(e),i);if(ku(e))return Nc(0,e.toNumber(),i)}if(t===ln){if(e===null||e===ln)return Nc(null,null,i);if(nl(e))return Nc(0,e,i);if(On(e)||Ua(e))return Nc(0,$i(e),i);if(ku(e))return Nc(0,e.toNumber(),i)}else if(nl(t)){if(nl(e))return Nc(t,e,i);if(Ua(e))return Nc(t,$i(e),i);if(e===null||e===ln)return Nc(t,0,i);if(On(e))return Nc(t,$i(e),i);if(ku(e))return Nc(t,e.toNumber(),i)}else if(On(t)){if(On(e))return Nc(mn(t),mn(e),i);if(ku(e))return Nc($i(t),e.toNumber(),i);if(nl(e))return Nc($i(t),e,i);if(e===null||e===ln)return Nc($i(t),0,i);if(Ua(e))return Nc($i(t),$i(e),i)}else if(ku(t)){if(ku(e))return Nc(t.toNumber(),e.toNumber(),i);if(e===null||e===ln)return Nc(t.toNumber(),0,i);if(nl(e))return Nc(t.toNumber(),e,i);if(Ua(e)||On(e))return Nc(t.toNumber(),$i(e),i)}else if(Ua(t)){if(Ua(e))return Nc(t,e,i);if(nl(e))return Nc($i(t),$i(e),i);if(ku(e))return Nc($i(t),e.toNumber(),i);if(e===null||e===ln)return Nc($i(t),0,i);if(On(e))return Nc($i(t),$i(e),i)}return!!bv(t,e)&&(i==="<="||i===">=")}function bv(t,e){if(t===e||t===null&&e===ln||e===null&&t===ln)return!0;if(ku(t)&&ku(e))return t.equals(e);if(t instanceof PRe||t instanceof Tk)return t.equalityTest(e);if(t instanceof er&&e instanceof er){const i=t.cache._arcadeCacheId,r=e.cache._arcadeCacheId;if(i!=null)return i===r}return!!(NRe(t)&&NRe(e)&&(t._arcadeCacheId===e._arcadeCacheId&&t._arcadeCacheId!==void 0&&t._arcadeCacheId!==null||t._underlyingGraphic===e._underlyingGraphic&&t._underlyingGraphic!==void 0&&t._underlyingGraphic!==null))}function mn(t,e){if(On(t))return t;if(t===null)return"";if(nl(t))return $Re(t,e);if(Ua(t))return t.toString();if(ku(t))return bde(t,e);if(t instanceof un)return JSON.stringify(t.toJSON());if(Vn(t)){const i=[];for(let r=0;rr.key===n.key?0:r.key==="spatialReference"?1:n.key==="spatialReference"||r.keyn.key?1:0);if(Vn(t)){const r=[];for(let n=0;n0)return t;return null}if(t instanceof Oa){if(t.paths.length===0)return null;for(const e of t.paths)if(e.length>0)return t;return null}return t instanceof _d?t.points.length===0?null:t:t instanceof Ar?t.xmin==="NaN"||t.xmin===null||isNaN(t.xmin)?null:t:null}function VRe(t,e){if(!t||!t.domain)return e;let i=null;if(t.field.type==="string"||t.field.type==="esriFieldTypeString")e=mn(e);else{if(e==null)return null;if(e==="")return e;e=$i(e)}for(let r=0;ra.id===r&&(n=a.domains&&a.domains[o.name],n&&n.type==="inherited"&&(n=Zpt(o.name,e),s=!0),!0)),s||n||(n=Zpt(t,e)),{field:o,domain:n}}function Zpt(t,e){let i;return e.fields.some(r=>(r.name.toLowerCase()===t.toLowerCase()&&(i=r.domain),!!i)),i}function GRe(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});const i=typeof e.cycles=="boolean"&&e.cycles,r=e.cmp&&(n=e.cmp,function(o){return function(a,l){const c={key:a,value:o[a]},h={key:l,value:o[l]};return n(c,h)}});var n;const s=[];return function o(a){if(a&&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,c;if(Array.isArray(a)){for(c="[",l=0;l0&&(s=t[0].spatialReference,i=t[0].hasZ,r=t[0].hasM)}else if(t instanceof Tk)n=t._elements,n.length>0&&(i=t._hasZ,r=t._hasM,s=t.get(0).spatialReference);else{if(!Ds(t))throw new Vt(null,It.InvalidParameter,null);for(const o of t.toArray())Lj(n,o);n.length>0&&(s=t.get(0).spatialReference,i=t.get(0).hasZ===!0,r=t.get(0).hasM===!0)}return n.length===0?null:(iW(n,r,i)||(n=n.slice(0).reverse()),new To({rings:[n],spatialReference:s,hasZ:i,hasM:r}))}return t}function SD(t,e){if(Vn(t)||Ds(t)){let i=!1,r=!1,n=[],s=e;if(Vn(t)){for(const o of t)Lj(n,o);n.length>0&&(s=t[0].spatialReference,i=t[0].hasZ===!0,r=t[0].hasM===!0)}else if(t instanceof Tk)n=t._elements,n.length>0&&(i=t._hasZ,r=t._hasM,s=t.get(0).spatialReference);else if(Ds(t)){for(const o of t.toArray())Lj(n,o);n.length>0&&(s=t.get(0).spatialReference,i=t.get(0).hasZ===!0,r=t.get(0).hasM===!0)}return n.length===0?null:new Oa({paths:[n],spatialReference:s,hasZ:i,hasM:r})}return t}function Pk(t,e){if(Vn(t)||Ds(t)){let i=!1,r=!1,n=[],s=e;if(Vn(t)){for(const o of t)Lj(n,o);n.length>0&&(s=t[0].spatialReference,i=t[0].hasZ===!0,r=t[0].hasM===!0)}else if(t instanceof Tk)n=t._elements,n.length>0&&(i=t._hasZ,r=t._hasM,s=t.get(0).spatialReference);else if(Ds(t)){for(const o of t.toArray())Lj(n,o);n.length>0&&(s=t.get(0).spatialReference,i=t.get(0).hasZ===!0,r=t.get(0).hasM===!0)}return n.length===0?null:new _d({points:n,spatialReference:s,hasZ:i,hasM:r})}return t}function Qpt(t,e=!1){const i=[];if(t===null)return i;if(Vn(t)===!0){for(let r=0;r{setTimeout(()=>{e(t)},0)})):t}function Sde(t,e,i){switch(i){case"&":return t&e;case"|":return t|e;case"^":return t^e;case"<<":return t<>":return t>>e;case">>>":return t>>>e}}function CD(t,e=null){return t==null?null:Ua(t)||nl(t)||On(t)?t:t instanceof un?e?.keepGeometryType===!0?t:t.toJSON():t instanceof bg?t.toArray().map(i=>CD(i,e)):t instanceof Array?t.map(i=>CD(i,e)):_de(t)?t:ku(t)?t.toJSDate():t!==null&&typeof t=="object"&&t.castAsJson!==void 0?t.castAsJson(e):null}async function aPi(t,e,i,r,n){const s=await zRe(t,e,i);n[r]=s}async function zRe(t,e=null,i=null){if(t instanceof bg&&(t=t.toArray()),t==null)return null;if(xD(t)||t instanceof un||_de(t)||ku(t))return CD(t,i);if(t instanceof Array){const r=[],n=[];for(const s of t)s===null||xD(s)||s instanceof un||_de(s)||ku(s)?n.push(CD(s,i)):(n.push(null),r.push(aPi(s,e,i,n.length-1,n)));return r.length>0&&await Promise.all(r),n}return t!==null&&typeof t=="object"&&t.castAsJsonAsync!==void 0?t.castAsJsonAsync(e,i):null}function HRe(t,e,i){const r=t.fullSchema();return r===null||!r.fields?null:Ak(e,r,t,i)}function iJ(t){const e=t.fullSchema();return e===null?null:e.fields&&e.typeIdField?{subtypeField:e.typeIdField,subtypes:e.types?e.types.map(i=>({name:i.name,code:i.id})):[]}:null}function WRe(t,e,i,r){const n=t.fullSchema();if(n===null||!n.fields)return null;const s=Ak(e,n,t,r);if(i===void 0)try{i=t.field(e)}catch{return null}return VRe(s,i)}function qRe(t,e,i,r){const n=t.fullSchema();if(n===null||!n.fields)return null;if(i===void 0){try{i=t.field(e)}catch{return null}return i}return jRe(Ak(e,n,t,r),i)}function ra(t){return t?.timeReference?.timeZone?t?.timeReference?.timeZone:"system"}function YRe(t){const e=t.fullSchema();if(e===null||!e.fields)return null;const i=[];for(const r of e.fields)i.push(RRe(r));return{objectIdField:e.objectIdField,globalIdField:e.globalIdField,geometryType:gde[e.geometryType]===void 0?"":gde[e.geometryType],fields:i,datesInUnknownTimezone:e.datesInUnknownTimezone===!0,preferredTimeReference:e.preferredTimeReference||null,editFieldsInfo:e.editFieldsInfo||null,timeInfo:e.timeInfo||null,dateFieldsTimeReference:e.dateFieldsTimeReference||null}}const eft=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:nE,ImplicitResultE:Jpt,ReturnResult:td,ReturnResultE:Kpt,absRound:kRe,autoCastArrayOfPointsToMultiPoint:Pk,autoCastArrayOfPointsToPolygon:eJ,autoCastArrayOfPointsToPolyline:SD,autoCastFeatureToGeometry:ls,binaryOperator:Sde,breakResult:Qf,castAsJson:CD,castAsJsonAsync:zRe,continueResult:sE,defaultTimeZone:ra,defaultUndefined:xn,equalityTest:bv,featureDomainCodeLookup:qRe,featureDomainValueLookup:WRe,featureFullDomain:HRe,featureSchema:YRe,featureSubtypes:iJ,fixNullGeometry:Ik,fixSpatialReference:rd,formatDate:bde,formatNumber:$Re,generateUUID:Fj,getDomain:Ak,getDomainCode:jRe,getDomainValue:VRe,getType:LRe,greaterThanLessThan:wde,isArray:Vn,isBoolean:Ua,isDate:ku,isFeature:wu,isFeatureSet:iu,isFeatureSetCollection:vde,isFunctionParameter:mu,isImmutableArray:Ds,isInteger:VP,isJsDate:_de,isModule:FRe,isNumber:nl,isObject:NRe,isSimpleType:xD,isString:On,multiReplace:qw,pcCheck:nr,stableStringify:GRe,standardiseDateFormat:BRe,tick:tJ,toBoolean:pb,toDate:id,toNumber:$i,toNumberArray:Ek,toString:mn,toStringArray:Qpt,toStringExplicit:F_,voidOperation:ln},Symbol.toStringTag,{value:"Module"}));function Cde(t,e,i=!1){if(t==null)return null;if(nl(t))return $i(t);if(Ua(t))return pb(t);if(On(t))return mn(t);if(ku(t))return id(t,e);if(Vn(t)){const n=[];for(const s of t)n.push(Cde(s,e,i));return n}const r=new hs;r.immutable=!1;for(const n of Object.keys(t)){const s=t[n];s!==void 0&&r.setField(n,Cde(s,e,i))}return r.immutable=i,r}let hs=class $9e{constructor(e){this.declaredClass="esri.arcade.Dictionary",this.attributes=null,this.plain=!1,this.immutable=!0,this.attributes=e instanceof $9e?e.attributes:e??{}}field(e){const i=e.toLowerCase(),r=this.attributes[e];if(r!==void 0)return r;for(const n in this.attributes)if(n.toLowerCase()===i)return this.attributes[n];throw new Vt(null,It.FieldNotFound,null,{key:e})}setField(e,i){if(this.immutable)throw new Vt(null,It.Immutable,null);if(mu(i))throw new Vt(null,It.NoFunctionInDictionary,null);const r=e.toLowerCase();if(i instanceof Date&&(i=Cl.dateJSToArcadeDate(i)),this.attributes[e]===void 0){for(const n in this.attributes)if(n.toLowerCase()===r)return void(this.attributes[n]=i);this.attributes[e]=i}else this.attributes[e]=i}hasField(e){const i=e.toLowerCase();if(this.attributes[e]!==void 0)return!0;for(const r in this.attributes)if(r.toLowerCase()===i)return!0;return!1}keys(){let e=[];for(const i in this.attributes)e.push(i);return e=e.sort(),e}castToText(e=!1){let i="";for(const r in this.attributes){i!==""&&(i+=",");const n=this.attributes[r];n==null?i+=JSON.stringify(r)+":null":Ua(n)||nl(n)||On(n)?i+=JSON.stringify(r)+":"+JSON.stringify(n):n instanceof un?i+=JSON.stringify(r)+":"+F_(n):n instanceof bg||n instanceof Array?i+=JSON.stringify(r)+":"+F_(n,null,e):n instanceof Cl?i+=e?JSON.stringify(r)+":"+JSON.stringify(n.getTime()):JSON.stringify(r)+":"+n.stringify():n!==null&&typeof n=="object"&&n.castToText!==void 0&&(i+=JSON.stringify(r)+":"+n.castToText(e))}return"{"+i+"}"}static convertObjectToArcadeDictionary(e,i,r=!0){const n=new $9e;n.immutable=!1;for(const s in e){const o=e[s];o!==void 0&&n.setField(s.toString(),Cde(o,i))}return n.immutable=r,n}static convertJsonToArcade(e,i,r=!1){return Cde(e,i,r)}castAsJson(e=null){const i={};for(let r in this.attributes){const n=this.attributes[r];n!==void 0&&(e?.keyTranslate&&(r=e.keyTranslate(r)),i[r]=CD(n,e))}return i}async castDictionaryValueAsJsonAsync(e,i,r,n=null,s){const o=await zRe(r,n,s);return e[i]=o,o}async castAsJsonAsync(e=null,i=null){const r={},n=[];for(let s in this.attributes){const o=this.attributes[s];i?.keyTranslate&&(s=i.keyTranslate(s)),o!==void 0&&(xD(o)||o instanceof un||o instanceof Cl?r[s]=CD(o,i):n.push(this.castDictionaryValueAsJsonAsync(r,s,o,e,i)))}return n.length>0&&await Promise.all(n),r}};function lPi(t){return t?.timeZoneIANA?t?.timeZoneIANA:t?.timeZone?Zqe(t,""):""}let Tde=class t_e{constructor(){this.dateTimeReferenceMetaData=null,this._fieldTimeZoneIndex={},this._fieldIndex=null,this._ianaPreferred=null,this._ianaTimeInfo=null,this._ianaEditFields=null,this._ianaLayerDateFields=null}static create(e,i){const r=new t_e;return r.dateTimeReferenceMetaData=i,r._fieldIndex=e instanceof Lm?e:new Lm(e),r}static createFromLayer(e){if(!e)return null;if(!e.fieldsIndex)return!e.declaredClass&&e.fields?t_e.create(e.fields,e):null;const i=new t_e;return i._fieldIndex=e.fieldsIndex,i.dateTimeReferenceMetaData={timeInfo:e?.timeInfo?.toJSON()??null,editFieldsInfo:e?.editFieldsInfo?.toJSON()??null,dateFieldsTimeReference:e?.dateFieldsTimeReference?.toJSON()??null,preferredTimeReference:e?.preferredTimeReference?.toJSON()??null,datesInUnknownTimezone:e?.datesInUnknownTimezone===!0},i}fieldTimeZone(e){const i=this._fieldIndex?.get(e);if(!i||i.type!=="date"&&i.type!=="esriFieldTypeDate")return null;const r=this._fieldTimeZoneIndex[i.name];if(r!==void 0)return r;const n=[{field:this.dateTimeReferenceMetaData?.editFieldsInfo?.creationDateField,timeReference:this.dateTimeReferenceMetaData?.editFieldsInfo?.dateFieldsTimeReference,isunknown:this.dateTimeReferenceMetaData?.datesInUnknownTimezone===!0},{field:this.dateTimeReferenceMetaData?.editFieldsInfo?.editDateField,timeReference:this.dateTimeReferenceMetaData?.editFieldsInfo?.dateFieldsTimeReference,isunknown:this.dateTimeReferenceMetaData?.datesInUnknownTimezone===!0},{field:this.dateTimeReferenceMetaData?.timeInfo?.startTimeField,timeReference:this.dateTimeReferenceMetaData?.timeInfo?.timeReference,isunknown:this.dateTimeReferenceMetaData?.datesInUnknownTimezone===!0},{field:this.dateTimeReferenceMetaData?.timeInfo?.endTimeField,timeReference:this.dateTimeReferenceMetaData?.timeInfo?.timeReference,isunknown:this.dateTimeReferenceMetaData?.datesInUnknownTimezone===!0}];for(const o of n)if(o.field===i.name){const a=this.convertToIANA(o.timeReference,o.isunknown);return this._fieldTimeZoneIndex[i.name]=a,a}const s=this.convertToIANA(this.dateTimeReferenceMetaData?.dateFieldsTimeReference,this.dateTimeReferenceMetaData?.datesInUnknownTimezone);return this._fieldTimeZoneIndex[i.name]=s,s}convertToIANA(e,i){return i?"unknown":lPi(e)}get layerPreferredTimeZone(){if(this._ianaPreferred!==null)return this._ianaPreferred;this._ianaPreferred="";const e=this.dateTimeReferenceMetaData?.preferredTimeReference;return this._ianaPreferred=this.convertToIANA(e,this.dateTimeReferenceMetaData?.datesInUnknownTimezone===!0),this._ianaPreferred}get layerTimeInfoTimeZone(){if(this._ianaTimeInfo!==null)return this._ianaTimeInfo;this._ianaTimeInfo="";const e=this.dateTimeReferenceMetaData?.timeInfo?.timeReference;return this._ianaTimeInfo=this.convertToIANA(e,!1),this._ianaTimeInfo}get layerEditFieldsTimeZone(){if(this._ianaEditFields!==null)return this._ianaEditFields;this._ianaEditFields="";const e=this.dateTimeReferenceMetaData?.editFieldsInfo?.dateFieldsTimeReference;return this._ianaEditFields=this.convertToIANA(e,this.dateTimeReferenceMetaData?.datesInUnknownTimezone),this._ianaEditFields}get layerDateFieldsTimeZone(){if(this._ianaLayerDateFields!==null)return this._ianaLayerDateFields;this._ianaLayerDateFields="";const e=this.dateTimeReferenceMetaData?.dateFieldsTimeReference;return this._ianaLayerDateFields=this.convertToIANA(e,this.dateTimeReferenceMetaData?.datesInUnknownTimezone===!0),this._ianaLayerDateFields}},dh=class WI{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature",this._optimizedGeomDefinition=null,this._geometry=null,this.attributes=null,this._layer=null,this._datesfixed=!0,this.dateTimeReferenceFieldIndex=null,this.contextTimeReference=null,this.immutable=!0,this._datefields=null,this.immutable=!0}static createFromGraphic(e,i){const r=new WI;return r.contextTimeReference=i??null,r._geometry=ve(e.geometry)?e.geometry:null,e.attributes===void 0||e.attributes===null?r.attributes={}:r.attributes=e.attributes,e._sourceLayer?(r._layer=e._sourceLayer,r._datesfixed=!1):e._layer?(r._layer=e._layer,r._datesfixed=!1):e.layer&&"fields"in e.layer?(r._layer=e.layer,r._datesfixed=!1):e.sourceLayer&&"fields"in e.sourceLayer&&(r._layer=e.sourceLayer,r._datesfixed=!1),r._layer&&r._datesfixed===!1&&(r._layer.dateTimeReferenceFieldIndex!==void 0?r.dateTimeReferenceFieldIndex=r._layer.dateTimeReferenceFieldIndex:r.dateTimeReferenceFieldIndex=Tde.createFromLayer(r._layer)),r}static createFromArcadeFeature(e){const i=new WI;return i._datesfixed=e._datesfixed,i.attributes=e.attributes,i._geometry=e._geometry,i._optimizedGeomDefinition=e._optimizedGeomDefinition,e._layer&&(i._layer=e._layer),i.dateTimeReferenceFieldIndex=e.dateTimeReferenceFieldIndex,i.contextTimeReference=e.contextTimeReference,i}static createFromOptimisedFeature(e,i,r){const n=new WI;return n._geometry=e.geometry?{geometry:e.geometry}:null,n._optimizedGeomDefinition=r,n.attributes=e.attributes||{},n._layer=i,n._datesfixed=!1,n}static createFromArcadeDictionary(e){const i=new WI;return i.attributes=e.field("attributes"),i.attributes!==null&&i.attributes instanceof hs?(i.attributes=i.attributes.attributes,i.attributes===null&&(i.attributes={})):i.attributes={},i._geometry=e.field("geometry"),i._geometry!==null&&(i._geometry instanceof hs?i._geometry=WI.parseGeometryFromDictionary(i._geometry):i._geometry instanceof un||(i._geometry=null)),i}static createFromGraphicLikeObject(e,i,r=null,n){const s=new WI;return s.contextTimeReference=n??null,i===null&&(i={}),s.attributes=i,s._geometry=ve(e)?e:null,s._layer=r,s._layer&&(s._datesfixed=!1,s._layer.dateTimeReferenceFieldIndex!==void 0?s.dateTimeReferenceFieldIndex=s._layer.dateTimeReferenceFieldIndex:s.dateTimeReferenceFieldIndex=Tde.createFromLayer(s._layer)),s}repurposeFromGraphicLikeObject(e,i,r=null){i===null&&(i={}),this.attributes=i,this._geometry=e||null,this._layer=r,this._layer?this._datesfixed=!1:this._datesfixed=!0}get layerPreferredTimeZone(){return this.dateTimeReferenceFieldIndex?.layerPreferredTimeZone??""}fieldSourceTimeZone(e){return this.dateTimeReferenceFieldIndex?.fieldTimeZone(e)??""}castToText(e=!1){let i="";this._datesfixed===!1&&this._fixDates();for(const r in this.attributes){i!==""&&(i+=",");const n=this.attributes[r];n==null?i+=JSON.stringify(r)+":null":Ua(n)||nl(n)||On(n)?i+=JSON.stringify(r)+":"+JSON.stringify(n):n instanceof un?i+=JSON.stringify(r)+":"+F_(n):n instanceof bg||n instanceof Array?i+=JSON.stringify(r)+":"+F_(n,null,e):n instanceof Cl?i+=e?JSON.stringify(r)+":"+JSON.stringify(n.getTime()):JSON.stringify(r)+":"+n.stringify():n!==null&&typeof n=="object"&&n.castToText!==void 0&&(i+=JSON.stringify(r)+":"+n.castToText(e))}return'{"geometry":'+(this.geometry()===null?"null":F_(this.geometry()))+',"attributes":{'+i+"}}"}_fixDates(){if(this._datefields!==null)return this._datefields.length>0&&this._fixDateFields(this._datefields),void(this._datesfixed=!0);const e=[],i=this._layer.fields;for(let r=0;r0&&this._fixDateFields(e),this._datesfixed=!0}isUnknownDateTimeField(e){return this.dateTimeReferenceFieldIndex?.fieldTimeZone(e)==="unknown"}_fixDateFields(e){this.attributes={...this.attributes};const i=this.contextTimeReference?.timeZone??"system";for(let r=0;r!i&&(n.type==="Identifier"&&n.name&&n.name.toLowerCase()===r&&(i=!0),!0)),i}function nft(t){const e=[];return Ku(t,i=>(i.type==="ImportDeclaration"&&i.source&&i.source.value&&e.push({libname:i.specifiers[0].local.name.toLowerCase(),source:i.source.value}),!0)),e}function hPi(t,e){let i=!1;const r=e.toLowerCase();return Ku(t,n=>!i&&(n.type!=="CallExpression"||n.callee.type!=="Identifier"||!n.callee.name||n.callee.name.toLowerCase()!==r||(i=!0,!1))),i}function dPi(t){const e=[];return Ku(t,i=>i.type!=="MemberExpression"||i.object.type!=="Identifier"||(i.computed===!1&&i.object&&i.object.name&&i.property&&i.property.type==="Identifier"&&i.property.name?e.push(i.object.name.toLowerCase()+"."+i.property.name.toLowerCase()):i.object&&i.object.name&&i.property&&i.property.type==="Literal"&&typeof i.property.value=="string"&&e.push(i.object.name.toLowerCase()+"."+i.property.value?.toString().toLowerCase()),!1)),e}function pPi(t){const e=[];return Ku(t,i=>{if(i.type==="CallExpression"){if(i.callee.type==="Identifier"&&i.callee.name.toLowerCase()==="expects"){let r="";for(let n=0;n<(i.arguments||[]).length;n++)n===0?i.arguments[n].type==="Identifier"&&(r=i.arguments[n].name.toLowerCase()):r&&i.arguments[n].type==="Literal"&&ift(i.arguments[n].value)&&e.push(r+"."+i.arguments[n].value.toLowerCase());return!1}if(i.callee.type==="Identifier"&&["domainname","domaincode","domain","haskey"].includes(i.callee.name.toLowerCase())&&i.arguments.length>=2){let r="";return i.arguments[0].type==="Identifier"&&(r=i.arguments[0].name.toLowerCase()),r&&i.arguments[1].type==="Literal"&&ift(i.arguments[1].value)&&e.push(r+"."+i.arguments[1].value.toLowerCase()),!1}}return i.type!=="MemberExpression"||i.object.type!=="Identifier"||(i.computed===!1&&i.object&&i.object.name&&i.property&&i.property.type==="Identifier"&&i.property.name?e.push(i.object.name.toLowerCase()+"."+i.property.name.toLowerCase()):i.object&&i.object.name&&i.property&&i.property.type==="Literal"&&typeof i.property.value=="string"&&e.push(i.object.name.toLowerCase()+"."+i.property.value?.toString().toLowerCase()),!1)}),e}function XRe(t){const e=[];return Ku(t,i=>(i.type==="CallExpression"&&i.callee.type==="Identifier"&&e.push(i.callee.name.toLowerCase()),!0)),e}function rJ(t,e=[]){let i=null;if(t.usesFeatureSet===void 0){i===null&&(i=XRe(t)),t.usesFeatureSet=!1;for(let r=0;r0){for(const r of e)if(rft(t,r)){t.usesFeatureSet=!0,t.isAsync=!0;break}}}if(t.usesModules===void 0&&(t.usesModules=!1,nft(t).length>0&&(t.usesModules=!0)),t.usesGeometry===void 0){t.usesGeometry=!1,i===null&&(i=XRe(t));for(let r=0;r0||l.length>0;)if(a.length>0&&l.length>0){let p=c(a[0],l[0]);isNaN(p)&&(p=0),p<=0?(h.push(a[0]),a=a.slice(1)):(h.push(l[0]),l=l.slice(1))}else a.length>0?(h.push(a[0]),a=a.slice(1)):l.length>0&&(h.push(l[0]),l=l.slice(1));return h}async function n(a,l){const c=a.length,h=Math.floor(c/2);if(c===0)return[];if(c===1)return[a[0]];const p=[await n(a.slice(0,h),l),await n(a.slice(h,c),l)];return s(p[0],p[1],l,[])}async function s(a,l,c,h){const p=h;if(!(a.length>0||l.length>0))return h;if(a.length>0&&l.length>0){let y=await c(a[0],l[0]);return isNaN(y)&&(y=1),y<=0?(p.push(a[0]),a=a.slice(1)):(p.push(l[0]),l=l.slice(1)),s(a,l,c,h)}return a.length>0?(p.push(a[0]),s(a=a.slice(1),l,c,h)):l.length>0?(p.push(l[0]),s(a,l=l.slice(1),c,h)):void 0}function o(a,l,c,h){nr(c,1,2,a,l);let p=c[0];if(Ds(p)&&(p=p.toArray()),Vn(p)===!1)throw new Vt(a,It.InvalidParameter,l);if(c.length>1){if(mu(c[1])===!1)throw new Vt(a,It.InvalidParameter,l);let P=p;const F=c[1].createFunction(a);return h?n(P,F):(P=i(P,(k,j)=>F(k,j)),P)}let y=p;if(y.length===0)return[];const v={};for(let P=0;P1||I==="String"?i(y,(P,F)=>{if(P==null||P===ln)return F==null||F===ln?0:1;if(F==null||F===ln)return-1;const k=mn(P),j=mn(F);return kP-F):I==="Boolean"?i(y,(P,F)=>P===F?0:F?-1:1):I==="Date"?i(y,(P,F)=>F-P):y.slice(0),y}t.functions.array=function(a,l){return t.standardFunction(a,l,(c,h,p)=>{nr(p,1,2,a,l);const y=$i(p[0]);if(isNaN(y)||VP(y)===!1)throw new Vt(a,It.InvalidParameter,l);const v=xn(p[1],null),x=new Array(y);return x.fill(v),x})},t.functions.front=function(a,l){return t.standardFunction(a,l,(c,h,p)=>{if(nr(p,1,1,a,l),Ds(p[0])){if(p[0].length()<=0)throw new Vt(a,It.OutOfBounds,l);return p[0].get(0)}if(Vn(p[0])){if(p[0].length<=0)throw new Vt(a,It.OutOfBounds,l);return p[0][0]}throw new Vt(a,It.InvalidParameter,l)})},t.functions.back=function(a,l){return t.standardFunction(a,l,(c,h,p)=>{if(nr(p,1,1,a,l),Ds(p[0])){if(p[0].length()<=0)throw new Vt(a,It.OutOfBounds,l);return p[0].get(p[0].length()-1)}if(Vn(p[0])){if(p[0].length<=0)throw new Vt(a,It.OutOfBounds,l);return p[0][p[0].length-1]}throw new Vt(a,It.InvalidParameter,l)})},t.functions.push=function(a,l){return t.standardFunction(a,l,(c,h,p)=>{if(nr(p,1,2,a,l),Vn(p[0]))return p[0][p[0].length]=p[1],p[0].length;throw new Vt(a,It.InvalidParameter,l)})},t.functions.pop=function(a,l){return t.standardFunction(a,l,(c,h,p)=>{if(nr(p,1,1,a,l),Vn(p[0])){if(p[0].length<=0)throw new Vt(a,It.OutOfBounds,l);const y=p[0][p[0].length-1];return p[0].length=p[0].length-1,y}throw new Vt(a,It.InvalidParameter,l)})},t.functions.erase=function(a,l){return t.standardFunction(a,l,(c,h,p)=>{if(nr(p,2,2,a,l),Vn(p[0])){let y=$i(p[1]);if(isNaN(y)||VP(y)===!1)throw new Vt(a,It.InvalidParameter,l);const v=p[0];if(v.length<=0)throw new Vt(a,It.OutOfBounds,l);if(y<0&&(y=v.length+y),y<0)throw new Vt(a,It.OutOfBounds,l);if(y>=v.length)throw new Vt(a,It.OutOfBounds,l);return v.splice(y,1),ln}throw new Vt(a,It.InvalidParameter,l)})},t.functions.insert=function(a,l){return t.standardFunction(a,l,(c,h,p)=>{if(nr(p,3,3,a,l),Vn(p[0])){const y=$i(p[1]);if(isNaN(y)||VP(y)===!1)throw new Vt(a,It.InvalidParameter,l);const v=p[2],x=p[0];if(y>x.length)throw new Vt(a,It.OutOfBounds,l);if(y<0&&y<-1*x.length)throw new Vt(a,It.OutOfBounds,l);return y===x.length?(x[y]=v,ln):(x.splice(y,0,v),ln)}throw new Vt(a,It.InvalidParameter,l)})},t.functions.resize=function(a,l){return t.standardFunction(a,l,(c,h,p)=>{if(nr(p,2,3,a,l),Vn(p[0])){const y=$i(p[1]);if(isNaN(y)||VP(y)===!1)throw new Vt(a,It.InvalidParameter,l);if(y<0)throw new Vt(a,It.InvalidParameter,l);const v=xn(p[2],null),x=p[0];if(x.length>=y)return x.length=y,ln;const I=x.length;x.length=y;for(let P=I;P{if(nr(p,2,2,a,l),Vn(p[0])){const y=p[1];return p[0].findIndex(v=>bv(v,y))>-1}if(Ds(p[0])){const y=p[1];return p[0].toArray().findIndex(v=>bv(v,y))>-1}throw new Vt(a,It.InvalidParameter,l)})},t.functions.slice=function(a,l){return t.standardFunction(a,l,(c,h,p)=>{if(nr(p,1,3,a,l),Vn(p[0])){const y=$i(xn(p[1],0)),v=$i(xn(p[2],p[0].length));if(isNaN(y)||VP(y)===!1)throw new Vt(a,It.InvalidParameter,l);if(isNaN(v)||VP(v)===!1)throw new Vt(a,It.InvalidParameter,l);return p[0].slice(y,v)}if(Ds(p[0])){const y=p[0],v=$i(xn(p[1],0)),x=$i(xn(p[2],y.length()));if(isNaN(v)||VP(v)===!1)throw new Vt(a,It.InvalidParameter,l);if(isNaN(x)||VP(x)===!1)throw new Vt(a,It.InvalidParameter,l);return y.toArray().slice(v,x)}throw new Vt(a,It.InvalidParameter,l)})},t.functions.splice=function(a,l){return t.standardFunction(a,l,(c,h,p)=>{const y=[];for(let v=0;v{if(nr(p,2,2,a,l),Vn(p[0]))return $i(p[1])>=p[0].length?p[0].slice(0):p[0].slice(0,$i(p[1]));if(Ds(p[0]))return $i(p[1])>=p[0].length()?p[0].slice(0):p[0].slice(0,$i(p[1]));throw new Vt(a,It.InvalidParameter,l)})},t.functions.first=function(a,l){return t.standardFunction(a,l,(c,h,p)=>(nr(p,1,1,a,l),Vn(p[0])?p[0].length===0?null:p[0][0]:Ds(p[0])?p[0].length()===0?null:p[0].get(0):null))},t.mode==="sync"&&(t.functions.sort=function(a,l){return t.standardFunction(a,l,(c,h,p)=>o(a,l,p,!1))},t.functions.any=function(a,l){return t.standardFunction(a,l,(c,h,p)=>{nr(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l);for(const x of v){const I=y(x);if(Ua(I)&&I===!0)return!0}return!1})},t.functions.all=function(a,l){return t.standardFunction(a,l,(c,h,p)=>{nr(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l);for(const x of v)if(y(x)!==!0)return!1;return!0})},t.functions.none=function(a,l){return t.standardFunction(a,l,(c,h,p)=>{nr(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l);for(const x of v)if(y(x)===!0)return!1;return!0})},t.functions.reduce=function(a,l){return t.standardFunction(a,l,(c,h,p)=>{nr(p,2,3,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l);return p.length===2?v.length===0?null:v.reduce((x,I)=>{const P=y(x,I);return x=P!==void 0&&P!==ln?P:null}):v.reduce((x,I)=>{const P=y(x,I);return x=P!==void 0&&P!==ln?P:null},p[2])})},t.functions.map=function(a,l){return t.standardFunction(a,l,(c,h,p)=>{nr(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l),x=[];for(const I of v){const P=y(I);P!==void 0&&P!==ln?x.push(P):x.push(null)}return x})},t.functions.filter=function(a,l){return t.standardFunction(a,l,(c,h,p)=>{nr(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l),x=[];for(const I of v)y(I)===!0&&x.push(I);return x})}),t.mode==="async"&&(t.functions.sort=function(a,l){return t.standardFunctionAsync(a,l,(c,h,p)=>o(a,l,p,!0))},t.functions.any=function(a,l){return t.standardFunctionAsync(a,l,async(c,h,p)=>{nr(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l);for(const x of v){const I=await y(x);let P=null;if(P=Fp(P)?await I:I,Ua(P)&&P===!0)return!0}return!1})},t.functions.all=function(a,l){return t.standardFunctionAsync(a,l,async(c,h,p)=>{nr(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l);for(const x of v){const I=await y(x);let P=null;if(P=Fp(P)?await I:I,P!==!0)return!1}return!0})},t.functions.none=function(a,l){return t.standardFunctionAsync(a,l,async(c,h,p)=>{nr(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l);for(const x of v){const I=await y(x);let P=null;if(P=Fp(P)?await I:I,P===!0)return!1}return!0})},t.functions.filter=function(a,l){return t.standardFunctionAsync(a,l,async(c,h,p)=>{nr(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l),x=[];for(const I of v){const P=await y(I);let F=null;F=Fp(F)?await P:P,F===!0&&x.push(I)}return x})},t.functions.reduce=function(a,l){return t.standardFunctionAsync(a,l,(c,h,p)=>{nr(p,2,3,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l);let x=null;if(p.length>2){const I=xn(p[2],null);x=v.reduce(async(P,F)=>{let k=await P;return k!==void 0&&k!==ln||(k=null),y(k,F)},Promise.resolve(I))}else{if(v.length===0)return null;x=v.reduce(async(I,P,F)=>{if(F<=1)return y(I,P);let k=await I;return k!==void 0&&k!==ln||(k=null),y(k,P)})}return x.then(I=>I!==void 0&&I!==ln?I:null)})},t.functions.map=function(a,l){return t.standardFunctionAsync(a,l,async(c,h,p)=>{nr(p,2,2,a,l);const y=p[1].createFunction(a),v=e(p[0],a,l),x=[];for(const I of v){const P=await y(I);let F=null;F=Fp(F)?await P:P,F!==void 0&&F!==ln?x.push(F):x.push(null)}return x})})}const Pde=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:fPi},Symbol.toStringTag,{value:"Module"}));function mPi(t,e,i){return t+(gPi(i)?vPi:yPi)[e]}function gPi(t){return t%4==0&&(t%100!=0||t%400==0)}const yPi=[0,31,59,90,120,151,181,212,243,273,304,334],vPi=[0,31,60,91,121,152,182,213,244,274,305,335];function Nj(t){return t===null?t:t.isValid===!1?null:t}function sft(t,e){return t===""||t.toLowerCase().trim()==="default"?ra(e):t}function KRe(t,e){t.today=function(i,r){return e(i,r,(n,s,o)=>{nr(o,0,0,i,r);const a=new Date;return a.setHours(0,0,0,0),Cl.dateJSAndZoneToArcadeDate(a,ra(i))})},t.changetimezone=function(i,r){return e(i,r,(n,s,o)=>{nr(o,2,2,i,r);const a=id(o[0],ra(i));if(a===null)return null;const l=Cl.arcadeDateAndZoneToArcadeDate(a,sft(mn(o[1]),i));return l.isValid===!1?null:l})},t.timezone=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,2,i,r);const a=id(o[0],ra(i));if(a===null)return null;const l=a.timeZone;return l==="system"?Cl.systemTimeZoneCanonicalName:l})},t.timezoneoffset=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);const a=id(o[0],ra(i));return a===null?null:a.timeZoneOffset})},t.now=function(i,r){return e(i,r,(n,s,o)=>{nr(o,0,0,i,r);const a=Cl.nowToArcadeDate(ra(i));return a.isValid===!1?null:a})},t.timestamp=function(i,r){return e(i,r,(n,s,o)=>{nr(o,0,0,i,r);const a=Cl.nowUTCToArcadeDate();return a.isValid===!1?null:a})},t.toutc=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);const a=id(o[0],ra(i));return a===null?null:a.toUTC()})},t.tolocal=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);const a=id(o[0],ra(i));return a===null?null:a.toLocal()})},t.day=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);const a=id(o[0],ra(i));return a===null?NaN:a.day})},t.month=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);const a=id(o[0],ra(i));return a===null?NaN:a.monthJS})},t.year=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);const a=id(o[0],ra(i));return a===null?NaN:a.year})},t.hour=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);const a=id(o[0],ra(i));return a===null?NaN:a.hour})},t.second=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);const a=id(o[0],ra(i));return a===null?NaN:a.second})},t.millisecond=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);const a=id(o[0],ra(i));return a===null?NaN:a.millisecond})},t.minute=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);const a=id(o[0],ra(i));return a===null?NaN:a.minute})},t.week=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,2,i,r);const a=id(o[0],ra(i));if(a===null)return NaN;const l=$i(xn(o[1],0));if(l<0||l>6)throw new Vt(i,It.InvalidParameter,r);const c=a.day,h=a.monthJS,p=a.year,y=a.dayOfWeekJS,v=mPi(c,h,p)-1,x=Math.floor(v/7);return y-l+(y-l<0?7:0){nr(o,1,1,i,r);const a=id(o[0],ra(i));return a===null?NaN:a.dayOfWeekJS})},t.isoweekday=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);const a=id(o[0],ra(i));return a===null?NaN:a.dayOfWeekISO})},t.isomonth=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);const a=id(o[0],ra(i));return a===null?NaN:a.monthISO})},t.isoweek=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);const a=id(o[0],ra(i));return a===null?NaN:a.weekISO})},t.isoyear=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);const a=id(o[0],ra(i));return a===null?NaN:a.yearISO})},t.date=function(i,r){return e(i,r,(n,s,o)=>{if(nr(o,0,8,i,r),o.length===3)return Nj(Cl.fromParts($i(o[0]),$i(o[1])+1,$i(o[2]),0,0,0,0,ra(i)));if(o.length===4)return Nj(Cl.fromParts($i(o[0]),$i(o[1])+1,$i(o[2]),$i(o[3]),0,0,0,ra(i)));if(o.length===5)return Nj(Cl.fromParts($i(o[0]),$i(o[1])+1,$i(o[2]),$i(o[3]),$i(o[4]),0,0,ra(i)));if(o.length===6)return Nj(Cl.fromParts($i(o[0]),$i(o[1])+1,$i(o[2]),$i(o[3]),$i(o[4]),$i(o[5]),0,ra(i)));if(o.length===7)return Nj(Cl.fromParts($i(o[0]),$i(o[1])+1,$i(o[2]),$i(o[3]),$i(o[4]),$i(o[5]),$i(o[6]),ra(i)));if(o.length===8)return Nj(Cl.fromParts($i(o[0]),$i(o[1])+1,$i(o[2]),$i(o[3]),$i(o[4]),$i(o[5]),$i(o[6]),sft(mn(o[7]),i)));if(o.length===2){let a,l=mn(o[1]);return l===""?null:(l=BRe(l),a=l==="X"?ro.fromSeconds($i(o[0])):l==="x"?ro.fromMillis($i(o[0])):ro.fromFormat(mn(o[0]),l,{locale:Z0(),numberingSystem:"latn"}),a.isValid?Cl.dateTimeToArcadeDate(a):null)}if(o.length===1){if(On(o[0])){if(o[0].replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return id(o[0]+"-01-01",ra(i))}const a=$i(o[0]);if(isNaN(a)===!1){const l=ro.fromMillis(a);return l.isValid?Cl.dateTimeAndZoneToArcadeDate(l,ra(i)):null}return id(o[0],ra(i))}return o.length===0?Cl.nowToArcadeDate(ra(i)):null})},t.datediff=function(i,r){return e(i,r,(n,s,o)=>{nr(o,2,4,i,r);let a=id(o[0],ra(i)),l=id(o[1],ra(i));if(a===null||l===null)return NaN;let c=xn(o[3],"");switch(c!==""&&c!==null?(c=mn(c),a=Cl.arcadeDateAndZoneToArcadeDate(a,c),l=Cl.arcadeDateAndZoneToArcadeDate(l,c)):a.timeZone!==l.timeZone&&(a.isUnknownTimeZone?a=Cl.arcadeDateAndZoneToArcadeDate(a,l.timeZone):l=(l.isUnknownTimeZone,Cl.arcadeDateAndZoneToArcadeDate(l,a.timeZone))),mn(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")}})},t.dateadd=function(i,r){return e(i,r,(n,s,o)=>{nr(o,2,3,i,r);const a=id(o[0],ra(i));if(a===null)return null;let l=$i(o[1]);if(isNaN(l))return a;let c="milliseconds";switch(mn(o[2]).toLowerCase()){case"days":case"day":case"d":c="days",l=kRe(l);break;case"months":case"month":c="months",l=kRe(l);break;case"minutes":case"minute":case"m":c=o[2]==="M"?"months":"minutes";break;case"seconds":case"second":case"s":c="seconds";break;case"milliseconds":case"millisecond":case"ms":c="milliseconds";break;case"hours":case"hour":case"h":c="hours";break;case"years":case"year":case"y":c="years"}return a.plus({[c]:l})})}}function oE(t,e,i){return Math.sqrt((t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]!==void 0&&e[2]!==void 0?(t[2]*i-e[2]*i)**2:0))}const nJ=[];for(const t of[[9002,56146130,6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const e=t[0];for(let i=1;i0?(r.x/=n,r.y/=n,e&&(r.z/=n),i&&(r.m/=n)):(r.x=t[0][0],r.y=t[0][1],e&&(r.z=t[0][2]),i&&e?r.m=t[0][3]:i&&(r.m=t[0][2])),r}function _Pi(t,e,i,r){const n={x:(t[0]+e[0])/2,y:(t[1]+e[1])/2};return i&&(n.z=(t[2]+e[2])/2),i&&r?n.m=(t[3]+e[3])/2:r&&(n.m=(t[2]+e[2])/2),n}function bPi(t,e){if(t.length<=1)return 0;let i=0;for(let r=1;r0?(i.x/=n,i.y/=n,t.hasZ===!0&&(i.z/=n),t.hasM===!0&&(i.m/=n),new er(i)):r>0?(e.x/=r,e.y/=r,t.hasZ===!0&&(i.z/=r),t.hasM===!0&&(e.m/=r),new er(e)):null}function cft(t){if(t.points.length===0)return null;let e=0,i=0,r=0,n=0;for(let o=0;o=r;)t-=e;return t}function hft(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}function CPi(t,e){return Ode(hft(t,e),2*Math.PI)*(180/Math.PI)}function TPi(t,e){return Ode(Math.PI/2-hft(t,e),2*Math.PI)*(180/Math.PI)}function dft(t,e,i){const r={x:t.x-e.x,y:t.y-e.y},n={x:i.x-e.x,y:i.y-e.y};return Math.atan2(SPi(r,n),xPi(r,n))}function EPi(t,e,i){return Ode(dft(t,e,i),2*Math.PI)*(180/Math.PI)}function IPi(t,e,i){return Ode(-1*dft(t,e,i),2*Math.PI)*(180/Math.PI)}sJ[9002]=.3048,sJ[9003]=.3048006096012192,sJ[9095]=.3048007491;const wg=[0,0];function pft(t){for(let e=0;e{nr(o,1,1,i,r);let a=[],l=!1,c=!1;if(o[0]===null)return!1;if(Vn(o[0])){for(const h of o[0]){if(!(h instanceof er))throw new Vt(i,It.InvalidParameter,r);a.push(h.hasZ?h.hasM?[h.x,h.y,h.z,h.m]:[h.x,h.y,h.z]:[h.x,h.y])}a.length>0&&(l=o[0][0].hasZ,c=o[0][0].hasM)}else if(o[0]instanceof Tk)a=o[0]._elements,a.length>0&&(l=o[0]._hasZ,c=o[0]._hasM);else{if(!Ds(o[0]))throw new Vt(i,It.InvalidParameter,r);for(const h of o[0].toArray()){if(!(h instanceof er))throw new Vt(i,It.InvalidParameter,r);a.push(h.hasZ?h.hasM?[h.x,h.y,h.z,h.m]:[h.x,h.y,h.z]:[h.x,h.y])}a.length>0&&(l=o[0].get(0).hasZ,c=o[0].get(0).hasM)}return!(a.length<3)&&iW(a,c,l)})},t.polygon=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);let a=null;if(o[0]instanceof hs){if(a=rd(dh.parseGeometryFromDictionary(o[0]),i.spatialReference),!(a instanceof To))throw new Vt(i,It.InvalidParameter,r)}else a=o[0]instanceof To?Sl(o[0].toJSON()):rd(new To(JSON.parse(o[0])),i.spatialReference);if(a!==null&&a.spatialReference.equals(i.spatialReference)===!1)throw new Vt(i,It.WrongSpatialReference,r);return Ik(a)})},t.polyline=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);let a=null;if(o[0]instanceof hs){if(a=rd(dh.parseGeometryFromDictionary(o[0]),i.spatialReference),!(a instanceof Oa))throw new Vt(i,It.InvalidParameter,r)}else a=o[0]instanceof Oa?Sl(o[0].toJSON()):rd(new Oa(JSON.parse(o[0])),i.spatialReference);if(a!==null&&a.spatialReference.equals(i.spatialReference)===!1)throw new Vt(i,It.WrongSpatialReference,r);return Ik(a)})},t.point=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);let a=null;if(o[0]instanceof hs){if(a=rd(dh.parseGeometryFromDictionary(o[0]),i.spatialReference),!(a instanceof er))throw new Vt(i,It.InvalidParameter,r)}else a=o[0]instanceof er?Sl(o[0].toJSON()):rd(new er(JSON.parse(o[0])),i.spatialReference);if(a!==null&&a.spatialReference.equals(i.spatialReference)===!1)throw new Vt(i,It.WrongSpatialReference,r);return Ik(a)})},t.multipoint=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);let a=null;if(o[0]instanceof hs){if(a=rd(dh.parseGeometryFromDictionary(o[0]),i.spatialReference),!(a instanceof _d))throw new Vt(i,It.InvalidParameter,r)}else a=o[0]instanceof _d?Sl(o[0].toJSON()):rd(new _d(JSON.parse(o[0])),i.spatialReference);if(a!==null&&a.spatialReference.equals(i.spatialReference)===!1)throw new Vt(i,It.WrongSpatialReference,r);return Ik(a)})},t.extent=function(i,r){return e(i,r,(n,s,o)=>{o=ls(o),nr(o,1,1,i,r);let a=null;if(o[0]instanceof hs)a=rd(dh.parseGeometryFromDictionary(o[0]),i.spatialReference);else if(o[0]instanceof er){const l={xmin:o[0].x,ymin:o[0].y,xmax:o[0].x,ymax:o[0].y,spatialReference:o[0].spatialReference.toJSON()},c=o[0];c.hasZ?(l.zmin=c.z,l.zmax=c.z):c.hasM&&(l.mmin=c.m,l.mmax=c.m),a=Sl(l)}else a=o[0]instanceof To||o[0]instanceof Oa||o[0]instanceof _d?Sl(o[0].extent?.toJSON()):o[0]instanceof Ar?Sl(o[0].toJSON()):rd(new Ar(JSON.parse(o[0])),i.spatialReference);if(a!==null&&a.spatialReference.equals(i.spatialReference)===!1)throw new Vt(i,It.WrongSpatialReference,r);return Ik(a)})},t.geometry=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);let a=null;if(o[0]===null)return null;if(a=Rde(o[0])?rd(o[0].geometry(),i.spatialReference):o[0]instanceof hs?rd(dh.parseGeometryFromDictionary(o[0]),i.spatialReference):rd(Sl(JSON.parse(o[0])),i.spatialReference),a!==null&&a.spatialReference.equals(i.spatialReference)===!1)throw new Vt(i,It.WrongSpatialReference,r);return Ik(a)})},t.setgeometry=function(i,r){return e(i,r,(n,s,o)=>{if(nr(o,2,2,i,r),!Rde(o[0]))throw new Vt(i,It.InvalidParameter,r);if(o[0].immutable===!0)throw new Vt(i,It.Immutable,r);if(!(o[1]instanceof un||o[1]===null))throw new Vt(i,It.InvalidParameter,r);return o[0]._geometry=o[1],ln})},t.feature=function(i,r){return e(i,r,(n,s,o)=>{if(o.length===0)throw new Vt(i,It.WrongNumberOfParameters,r);let a=null;if(o.length===1)if(On(o[0]))a=dh.fromJson(JSON.parse(o[0]),i.timeReference);else if(Rde(o[0]))a=dh.createFromArcadeFeature(o[0]);else if(o[0]instanceof un)a=dh.createFromGraphicLikeObject(o[0],null,null,i.timeReference);else{if(!(o[0]instanceof hs))throw new Vt(i,It.InvalidParameter,r);{let l=o[0].hasField("geometry")?o[0].field("geometry"):null,c=o[0].hasField("attributes")?o[0].field("attributes"):null;l!==null&&l instanceof hs&&(l=dh.parseGeometryFromDictionary(l)),c!==null&&(c=dh.parseAttributesFromDictionary(c)),a=dh.createFromGraphicLikeObject(l,c,null,i.timeReference)}}else if(o.length===2){let l=null,c=null;if(o[0]!==null)if(o[0]instanceof un)l=o[0];else{if(!(l instanceof hs))throw new Vt(i,It.InvalidParameter,r);l=dh.parseGeometryFromDictionary(o[0])}if(o[1]!==null){if(!(o[1]instanceof hs))throw new Vt(i,It.InvalidParameter,r);c=dh.parseAttributesFromDictionary(o[1])}a=dh.createFromGraphicLikeObject(l,c,null,i.timeReference)}else{let l=null;const c={};if(o[0]!==null)if(o[0]instanceof un)l=o[0];else{if(!(l instanceof hs))throw new Vt(i,It.InvalidParameter,r);l=dh.parseGeometryFromDictionary(o[0])}for(let h=1;h{if(o.length===0){const c=new hs;return c.immutable=!1,c}if(o.length===1&&On(o[0]))try{const c=JSON.parse(o[0]),h=hs.convertObjectToArcadeDictionary(c,ra(i),!1);return h.immutable=!1,h}catch{throw new Vt(i,It.InvalidParameter,r)}if(o.length%2!=0)throw new Vt(i,It.WrongNumberOfParameters,r);const a={};for(let c=0;c{nr(o,2,2,i,r);const a=mn(o[1]);if(Rde(o[0])||o[0]instanceof hs)return o[0].hasField(a);if(o[0]instanceof un){const l=Ok(o[0],a,null,null,2);return!l||l.keystate!=="notfound"}throw new Vt(i,It.InvalidParameter,r)})},t.hasvalue=function(i,r){return e(i,r,(n,s,o)=>{if(nr(o,2,2,i,r),o[0]===null||o[1]===null)return!1;const a=mn(o[1]);return wu(o[0])||o[0]instanceof hs?!!o[0].hasField(a)&&o[0].field(a)!==null:o[0]instanceof un?Ok(o[0],a,null,null,0)!==null:!1})},t.indexof=function(i,r){return e(i,r,(n,s,o)=>{nr(o,2,2,i,r);const a=o[1];if(Vn(o[0])){for(let l=0;l{if(o=ls(o),nr(o,2,3,i,r),!(o[0]instanceof er))throw new Vt(i,It.InvalidParameter,r);if(!(o[1]instanceof er))throw new Vt(i,It.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof er))throw new Vt(i,It.InvalidParameter,r);return o.length===2?CPi(o[0],o[1]):EPi(o[0],o[1],o[2])})},t.bearing=function(i,r){return e(i,r,(n,s,o)=>{if(o=ls(o),nr(o,2,3,i,r),!(o[0]instanceof er))throw new Vt(i,It.InvalidParameter,r);if(!(o[1]instanceof er))throw new Vt(i,It.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof er))throw new Vt(i,It.InvalidParameter,r);return o.length===2?TPi(o[0],o[1]):IPi(o[0],o[1],o[2])})},t.isselfintersecting=function(i,r){return e(i,r,(n,s,o)=>{o=ls(o),nr(o,1,1,i,r);let a=o[0];if(a instanceof To)return a.isSelfIntersecting;if(a instanceof Oa)return a=a.paths,pft(a);if(a instanceof _d){const l=a.points;for(let c=0;c(a=ls(a),i(r,n,a),a[0]===null||a[1]===null||sl.disjoint(a[0],a[1])))},t.intersects=function(r,n){return e(r,n,(s,o,a)=>(a=ls(a),i(r,n,a),a[0]!==null&&a[1]!==null&&sl.intersects(a[0],a[1])))},t.touches=function(r,n){return e(r,n,(s,o,a)=>(a=ls(a),i(r,n,a),a[0]!==null&&a[1]!==null&&sl.touches(a[0],a[1])))},t.crosses=function(r,n){return e(r,n,(s,o,a)=>(a=ls(a),i(r,n,a),a[0]!==null&&a[1]!==null&&sl.crosses(a[0],a[1])))},t.within=function(r,n){return e(r,n,(s,o,a)=>(a=ls(a),i(r,n,a),a[0]!==null&&a[1]!==null&&sl.within(a[0],a[1])))},t.contains=function(r,n){return e(r,n,(s,o,a)=>(a=ls(a),i(r,n,a),a[0]!==null&&a[1]!==null&&sl.contains(a[0],a[1])))},t.overlaps=function(r,n){return e(r,n,(s,o,a)=>(a=ls(a),i(r,n,a),a[0]!==null&&a[1]!==null&&sl.overlaps(a[0],a[1])))},t.equals=function(r,n){return e(r,n,(s,o,a)=>(nr(a,2,2,r,n),a[0]===a[1]||(a[0]instanceof un&&a[1]instanceof un?sl.equals(a[0],a[1]):!(!ku(a[0])||!ku(a[1]))&&a[0].equals(a[1]))))},t.relate=function(r,n){return e(r,n,(s,o,a)=>{if(a=ls(a),nr(a,3,3,r,n),a[0]instanceof un&&a[1]instanceof un)return sl.relate(a[0],a[1],mn(a[2]));if(a[0]instanceof un&&a[1]===null||a[1]instanceof un&&a[0]===null||a[0]===null&&a[1]===null)return!1;throw new Vt(r,It.InvalidParameter,n)})},t.intersection=function(r,n){return e(r,n,(s,o,a)=>(a=ls(a),i(r,n,a),a[0]===null||a[1]===null?null:sl.intersect(a[0],a[1])))},t.union=function(r,n){return e(r,n,(s,o,a)=>{const l=[];if((a=ls(a)).length===0)throw new Vt(r,It.WrongNumberOfParameters,n);if(a.length===1)if(Vn(a[0])){const c=ls(a[0]);for(let h=0;h(a=ls(a),i(r,n,a),a[0]!==null&&a[1]===null?bp(a[0]):a[0]===null?null:sl.difference(a[0],a[1])))},t.symmetricdifference=function(r,n){return e(r,n,(s,o,a)=>(a=ls(a),i(r,n,a),a[0]===null&&a[1]===null?null:a[0]===null?bp(a[1]):a[1]===null?bp(a[0]):sl.symmetricDifference(a[0],a[1])))},t.clip=function(r,n){return e(r,n,(s,o,a)=>{if(a=ls(a),nr(a,2,2,r,n),!(a[1]instanceof Ar)&&a[1]!==null)throw new Vt(r,It.InvalidParameter,n);if(a[0]===null)return null;if(!(a[0]instanceof un))throw new Vt(r,It.InvalidParameter,n);return a[1]===null?null:sl.clip(a[0],a[1])})},t.cut=function(r,n){return e(r,n,(s,o,a)=>{if(a=ls(a),nr(a,2,2,r,n),!(a[1]instanceof Oa)&&a[1]!==null)throw new Vt(r,It.InvalidParameter,n);if(a[0]===null)return[];if(!(a[0]instanceof un))throw new Vt(r,It.InvalidParameter,n);return a[1]===null?[bp(a[0])]:sl.cut(a[0],a[1])})},t.area=function(r,n){return e(r,n,(s,o,a)=>{if(nr(a,1,2,r,n),(a=ls(a))[0]===null)return 0;if(Vn(a[0])||Ds(a[0])){const l=eJ(a[0],r.spatialReference);return l===null?0:sl.planarArea(l,aE(xn(a[1],-1)))}if(!(a[0]instanceof un))throw new Vt(r,It.InvalidParameter,n);return sl.planarArea(a[0],aE(xn(a[1],-1)))})},t.areageodetic=function(r,n){return e(r,n,(s,o,a)=>{if(nr(a,1,2,r,n),(a=ls(a))[0]===null)return 0;if(Vn(a[0])||Ds(a[0])){const l=eJ(a[0],r.spatialReference);return l===null?0:sl.geodesicArea(l,aE(xn(a[1],-1)))}if(!(a[0]instanceof un))throw new Vt(r,It.InvalidParameter,n);return sl.geodesicArea(a[0],aE(xn(a[1],-1)))})},t.length=function(r,n){return e(r,n,(s,o,a)=>{if(nr(a,1,2,r,n),(a=ls(a))[0]===null)return 0;if(Vn(a[0])||Ds(a[0])){const l=SD(a[0],r.spatialReference);return l===null?0:sl.planarLength(l,ru(xn(a[1],-1)))}if(!(a[0]instanceof un))throw new Vt(r,It.InvalidParameter,n);return sl.planarLength(a[0],ru(xn(a[1],-1)))})},t.length3d=function(r,n){return e(r,n,(s,o,a)=>{if(nr(a,1,2,r,n),(a=ls(a))[0]===null)return 0;if(Vn(a[0])||Ds(a[0])){const l=SD(a[0],r.spatialReference);return l===null?0:l.hasZ===!0?gft(l,ru(xn(a[1],-1))):sl.planarLength(l,ru(xn(a[1],-1)))}if(!(a[0]instanceof un))throw new Vt(r,It.InvalidParameter,n);return a[0].hasZ===!0?gft(a[0],ru(xn(a[1],-1))):sl.planarLength(a[0],ru(xn(a[1],-1)))})},t.lengthgeodetic=function(r,n){return e(r,n,(s,o,a)=>{if(nr(a,1,2,r,n),(a=ls(a))[0]===null)return 0;if(Vn(a[0])||Ds(a[0])){const l=SD(a[0],r.spatialReference);return l===null?0:sl.geodesicLength(l,ru(xn(a[1],-1)))}if(!(a[0]instanceof un))throw new Vt(r,It.InvalidParameter,n);return sl.geodesicLength(a[0],ru(xn(a[1],-1)))})},t.distance=function(r,n){return e(r,n,(s,o,a)=>{a=ls(a),nr(a,2,3,r,n);let l=a[0];(Vn(a[0])||Ds(a[0]))&&(l=Pk(a[0],r.spatialReference));let c=a[1];if((Vn(a[1])||Ds(a[1]))&&(c=Pk(a[1],r.spatialReference)),!(l instanceof un))throw new Vt(r,It.InvalidParameter,n);if(!(c instanceof un))throw new Vt(r,It.InvalidParameter,n);return sl.distance(l,c,ru(xn(a[2],-1)))})},t.distancegeodetic=function(r,n){return e(r,n,(s,o,a)=>{a=ls(a),nr(a,2,3,r,n);const l=a[0],c=a[1];if(!(l instanceof er))throw new Vt(r,It.InvalidParameter,n);if(!(c instanceof er))throw new Vt(r,It.InvalidParameter,n);const h=new Oa({paths:[],spatialReference:l.spatialReference});return h.addPath([l,c]),sl.geodesicLength(h,ru(xn(a[2],-1)))})},t.densify=function(r,n){return e(r,n,(s,o,a)=>{if(a=ls(a),nr(a,2,3,r,n),a[0]===null)return null;if(!(a[0]instanceof un))throw new Vt(r,It.InvalidParameter,n);const l=$i(a[1]);if(isNaN(l))throw new Vt(r,It.InvalidParameter,n);if(l<=0)throw new Vt(r,It.InvalidParameter,n);return a[0]instanceof To||a[0]instanceof Oa?sl.densify(a[0],l,ru(xn(a[2],-1))):a[0]instanceof Ar?sl.densify(mft(a[0]),l,ru(xn(a[2],-1))):a[0]})},t.densifygeodetic=function(r,n){return e(r,n,(s,o,a)=>{if(a=ls(a),nr(a,2,3,r,n),a[0]===null)return null;if(!(a[0]instanceof un))throw new Vt(r,It.InvalidParameter,n);const l=$i(a[1]);if(isNaN(l))throw new Vt(r,It.InvalidParameter,n);if(l<=0)throw new Vt(r,It.InvalidParameter,n);return a[0]instanceof To||a[0]instanceof Oa?sl.geodesicDensify(a[0],l,ru(xn(a[2],-1))):a[0]instanceof Ar?sl.geodesicDensify(mft(a[0]),l,ru(xn(a[2],-1))):a[0]})},t.generalize=function(r,n){return e(r,n,(s,o,a)=>{if(a=ls(a),nr(a,2,4,r,n),a[0]===null)return null;if(!(a[0]instanceof un))throw new Vt(r,It.InvalidParameter,n);const l=$i(a[1]);if(isNaN(l))throw new Vt(r,It.InvalidParameter,n);return sl.generalize(a[0],l,pb(xn(a[2],!0)),ru(xn(a[3],-1)))})},t.buffer=function(r,n){return e(r,n,(s,o,a)=>{if(a=ls(a),nr(a,2,3,r,n),a[0]===null)return null;if(!(a[0]instanceof un))throw new Vt(r,It.InvalidParameter,n);const l=$i(a[1]);if(isNaN(l))throw new Vt(r,It.InvalidParameter,n);return l===0?bp(a[0]):sl.buffer(a[0],l,ru(xn(a[2],-1)))})},t.buffergeodetic=function(r,n){return e(r,n,(s,o,a)=>{if(a=ls(a),nr(a,2,3,r,n),a[0]===null)return null;if(!(a[0]instanceof un))throw new Vt(r,It.InvalidParameter,n);const l=$i(a[1]);if(isNaN(l))throw new Vt(r,It.InvalidParameter,n);return l===0?bp(a[0]):sl.geodesicBuffer(a[0],l,ru(xn(a[2],-1)))})},t.offset=function(r,n){return e(r,n,(s,o,a)=>{if(a=ls(a),nr(a,2,6,r,n),a[0]===null)return null;if(!(a[0]instanceof To||a[0]instanceof Oa))throw new Vt(r,It.InvalidParameter,n);const l=$i(a[1]);if(isNaN(l))throw new Vt(r,It.InvalidParameter,n);const c=$i(xn(a[4],10));if(isNaN(c))throw new Vt(r,It.InvalidParameter,n);const h=$i(xn(a[5],0));if(isNaN(h))throw new Vt(r,It.InvalidParameter,n);return sl.offset(a[0],l,ru(xn(a[2],-1)),mn(xn(a[3],"round")).toLowerCase(),c,h)})},t.rotate=function(r,n){return e(r,n,(s,o,a)=>{a=ls(a),nr(a,2,3,r,n);let l=a[0];if(l===null)return null;if(!(l instanceof un))throw new Vt(r,It.InvalidParameter,n);l instanceof Ar&&(l=To.fromExtent(l));const c=$i(a[1]);if(isNaN(c))throw new Vt(r,It.InvalidParameter,n);const h=xn(a[2],null);if(h===null)return sl.rotate(l,c);if(h instanceof er)return sl.rotate(l,c,h);throw new Vt(r,It.InvalidParameter,n)})},t.centroid=function(r,n){return e(r,n,(s,o,a)=>{if(a=ls(a),nr(a,1,1,r,n),a[0]===null)return null;let l=a[0];if((Vn(a[0])||Ds(a[0]))&&(l=Pk(a[0],r.spatialReference)),l===null)return null;if(!(l instanceof un))throw new Vt(r,It.InvalidParameter,n);return l instanceof er?rd(bp(a[0]),r.spatialReference):l instanceof To?l.centroid:l instanceof Oa?uft(l):l instanceof _d?cft(l):l instanceof Ar?l.center:null})},t.multiparttosinglepart=function(r,n){return e(r,n,(s,o,a)=>{a=ls(a),nr(a,1,1,r,n);const l=[];if(a[0]===null)return null;if(!(a[0]instanceof un))throw new Vt(r,It.InvalidParameter,n);if(a[0]instanceof er)return[rd(bp(a[0]),r.spatialReference)];if(a[0]instanceof Ar)return[rd(bp(a[0]),r.spatialReference)];const c=sl.simplify(a[0]);if(c instanceof To){const h=[],p=[];for(let y=0;y{if(a=ls(a),nr(a,1,1,r,n),a[0]===null)return!0;if(!(a[0]instanceof un))throw new Vt(r,It.InvalidParameter,n);return sl.isSimple(a[0])})},t.simplify=function(r,n){return e(r,n,(s,o,a)=>{if(a=ls(a),nr(a,1,1,r,n),a[0]===null)return null;if(!(a[0]instanceof un))throw new Vt(r,It.InvalidParameter,n);return sl.simplify(a[0])})},t.convexhull=function(r,n){return e(r,n,(s,o,a)=>{if(a=ls(a),nr(a,1,1,r,n),a[0]===null)return null;if(!(a[0]instanceof un))throw new Vt(r,It.InvalidParameter,n);return sl.convexHull(a[0])})}}const PPi=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:ZRe,setGeometryEngine:APi},Symbol.toStringTag,{value:"Module"}));function QRe(t,e,i){return i===void 0||+i==0?Math[t](e):(e=+e,i=+i,isNaN(e)||typeof i!="number"||i%1!=0?NaN:(e=e.toString().split("e"),+((e=(e=Math[t](+(e[0]+"e"+(e[1]?+e[1]-i:-i)))).toString().split("e"))[0]+"e"+(e[1]?+e[1]+i:i))))}function eMe(t,e){function i(r,n,s){const o=$i(r);return isNaN(o)?o:isNaN(n)||isNaN(s)||n>s?NaN:os?s:o}t.number=function(r,n){return e(r,n,(s,o,a)=>{nr(a,1,2,r,n);const l=a[0];if(nl(l))return l;if(l===null)return 0;if(ku(l))return l.toNumber();if(Ua(l))return Number(l);if(Vn(l))return NaN;if(l===""||l===void 0)return Number(l);if(On(l)){if(a[1]!==void 0){let c=qw(a[1],"‰","");return c=qw(c,"¤",""),qpt(l,{pattern:c})}return Number(l.trim())}return Number(l)})},t.abs=function(r,n){return e(r,n,(s,o,a)=>(nr(a,1,1,r,n),Math.abs($i(a[0]))))},t.acos=function(r,n){return e(r,n,(s,o,a)=>(nr(a,1,1,r,n),Math.acos($i(a[0]))))},t.asin=function(r,n){return e(r,n,(s,o,a)=>(nr(a,1,1,r,n),Math.asin($i(a[0]))))},t.atan=function(r,n){return e(r,n,(s,o,a)=>(nr(a,1,1,r,n),Math.atan($i(a[0]))))},t.atan2=function(r,n){return e(r,n,(s,o,a)=>(nr(a,2,2,r,n),Math.atan2($i(a[0]),$i(a[1]))))},t.ceil=function(r,n){return e(r,n,(s,o,a)=>{if(nr(a,1,2,r,n),a.length===2){let l=$i(a[1]);return isNaN(l)&&(l=0),QRe("ceil",$i(a[0]),-1*l)}return Math.ceil($i(a[0]))})},t.round=function(r,n){return e(r,n,(s,o,a)=>{if(nr(a,1,2,r,n),a.length===2){let l=$i(a[1]);return isNaN(l)&&(l=0),QRe("round",$i(a[0]),-1*l)}return Math.round($i(a[0]))})},t.floor=function(r,n){return e(r,n,(s,o,a)=>{if(nr(a,1,2,r,n),a.length===2){let l=$i(a[1]);return isNaN(l)&&(l=0),QRe("floor",$i(a[0]),-1*l)}return Math.floor($i(a[0]))})},t.cos=function(r,n){return e(r,n,(s,o,a)=>(nr(a,1,1,r,n),Math.cos($i(a[0]))))},t.isnan=function(r,n){return e(r,n,(s,o,a)=>(nr(a,1,1,r,n),typeof a[0]=="number"&&isNaN(a[0])))},t.exp=function(r,n){return e(r,n,(s,o,a)=>(nr(a,1,1,r,n),Math.exp($i(a[0]))))},t.log=function(r,n){return e(r,n,(s,o,a)=>(nr(a,1,1,r,n),Math.log($i(a[0]))))},t.pow=function(r,n){return e(r,n,(s,o,a)=>(nr(a,2,2,r,n),$i(a[0])**$i(a[1])))},t.random=function(r,n){return e(r,n,(s,o,a)=>(nr(a,0,0,r,n),Math.random()))},t.sin=function(r,n){return e(r,n,(s,o,a)=>(nr(a,1,1,r,n),Math.sin($i(a[0]))))},t.sqrt=function(r,n){return e(r,n,(s,o,a)=>(nr(a,1,1,r,n),Math.sqrt($i(a[0]))))},t.tan=function(r,n){return e(r,n,(s,o,a)=>(nr(a,1,1,r,n),Math.tan($i(a[0]))))},t.defaultvalue=function(r,n){return e(r,n,(s,o,a)=>(nr(a,2,2,r,n),a[0]===null||a[0]===""||a[0]===void 0?a[1]:a[0]))},t.isempty=function(r,n){return e(r,n,(s,o,a)=>(nr(a,1,1,r,n),a[0]===null||a[0]===""||a[0]===void 0))},t.boolean=function(r,n){return e(r,n,(s,o,a)=>{nr(a,1,1,r,n);const l=a[0];return pb(l)})},t.constrain=function(r,n){return e(r,n,(s,o,a)=>{nr(a,3,3,r,n);const l=$i(a[1]),c=$i(a[2]);if(Vn(a[0])){const h=[];for(const p of a[0])h.push(i(p,l,c));return h}if(Ds(a[0])){const h=[];for(let p=0;p=e&&e!==-1)return i}return i}function rS(t,e,i=1e3){switch(t.toLowerCase()){case"distinct":return RPi(e,i);case"avg":case"mean":return yft(Ek(e));case"min":return Math.min.apply(Math,Ek(e));case"sum":return OPi(Ek(e));case"max":return Math.max.apply(Math,Ek(e));case"stdev":case"stddev":return Math.sqrt(vft(Ek(e)));case"var":case"variance":return vft(Ek(e));case"count":return e.length}return 0}function TD(t,e,i,r){if(r.length===1){if(Vn(r[0]))return rS(t,r[0],-1);if(Ds(r[0]))return rS(t,r[0].toArray(),-1)}return rS(t,r,-1)}function tMe(t,e){t.stdev=function(i,r){return e(i,r,(n,s,o)=>TD("stdev",n,s,o))},t.variance=function(i,r){return e(i,r,(n,s,o)=>TD("variance",n,s,o))},t.average=function(i,r){return e(i,r,(n,s,o)=>TD("mean",n,s,o))},t.mean=function(i,r){return e(i,r,(n,s,o)=>TD("mean",n,s,o))},t.sum=function(i,r){return e(i,r,(n,s,o)=>TD("sum",n,s,o))},t.min=function(i,r){return e(i,r,(n,s,o)=>TD("min",n,s,o))},t.max=function(i,r){return e(i,r,(n,s,o)=>TD("max",n,s,o))},t.distinct=function(i,r){return e(i,r,(n,s,o)=>TD("distinct",n,s,o))},t.count=function(i,r){return e(i,r,(n,s,o)=>{if(nr(o,1,1,i,r),Vn(o[0])||On(o[0]))return o[0].length;if(Ds(o[0]))return o[0].length();throw new Vt(i,It.InvalidParameter,r)})}}let kj=class extends hs{constructor(e){super(),this.declaredClass="esri.arcade.Portal",this.immutable=!1,this.setField("url",e),this.immutable=!0}},_ft=class extends hs{constructor(e,i,r,n,s,o){super(),this.attachmentUrl=s,this.declaredClass="esri.arcade.Attachment",this.immutable=!1,this.setField("id",e),this.setField("name",i),this.setField("contenttype",r),this.setField("size",n),this.setField("exifinfo",o),this.immutable=!0}};const iMe=t=>(e,i,r)=>(r=r||14,+t(e,i).toFixed(r)),MPi=(t,e)=>t+e,DPi=(t,e)=>t*e,FPi=(t,e)=>t/e,bft=(t,e,i)=>iMe(MPi)(t,e,i),$j=(t,e,i)=>iMe(DPi)(t,e,i),Mde=(t,e,i)=>iMe(FPi)(t,e,i),Dde=360,LPi=400,NPi=2*Math.PI,nS=3600,wft=3240,oJ=60,ED=60,xft=180*nS/Math.PI,aJ=Dde*oJ*ED,rMe=90*nS,Bj=180*nS,kPi=270*nS,Sft=String.fromCharCode(7501),lJ="°";function uJ(t){if(On(t)===!1)throw new Vt(null,It.InvalidParameter,null);return t}function nMe(t,e){const i=10**e;return Math.round(t*i)/i}function $Pi(t,e){return t%e}function Vj(t){const e=parseFloat(t.toString().replace(Math.trunc(t).toString(),"0"))*Math.sign(t);return t<0?{fraction:e,integer:Math.ceil(t)}:{fraction:e,integer:Math.floor(t)}}var yc,Hn,xu,sMe;function jj(t,e){switch(t){case yc.north:return e==="SHORT"?"N":"North";case yc.east:return e==="SHORT"?"E":"East";case yc.south:return e==="SHORT"?"S":"South";case yc.west:return e==="SHORT"?"W":"West"}}function oMe(t,e,i){for(;t.length=kPi?yc.north:yc.south,r=i===yc.north?Math.min(aJ-e,e):Math.abs(e-Bj),n=e>Bj?yc.west:yc.east;return new BPi(i,r,n)}static createFromAngleMeridianAndDirection(e,i,r){return new R3(new lE(R3.secondsQuadrantToNorthAzimuth(e.extractAngularUnits(Hn.seconds),i,r)))}static secondsQuadrantToNorthAzimuth(e,i,r){return i===yc.north?r===yc.east?e:aJ-e:r===yc.east?Bj-e:Bj+e}static _convertDirectionFormat(e,i,r){let n=0;switch(i){case xu.north_azimuth:n=e;break;case xu.polar:n=rMe-e;break;case xu.quadrant:throw new Vt(null,It.LogicError,null,{reason:"unexpected evaluation"});case xu.south_azimuth:n=e+Bj}let s=0;switch(r){case xu.north_azimuth:s=n;break;case xu.polar:s=rMe-n;break;case xu.quadrant:throw new Vt(null,It.LogicError,null,{reason:"unexpected evaluation"});case xu.south_azimuth:s=n-Bj}return s=$Pi(s,aJ),s<0?aJ+s:s}};function Eft(t,e,i){let r=null;switch(e){case Hn.decimal_degrees:r=$j(t,nS);break;case Hn.seconds:r=t;break;case Hn.gradians:r=$j(t,wft);break;case Hn.radians:r=$j(t,xft);break;default:throw new Vt(null,It.LogicError,null,{reason:"unexpected evaluation"})}switch(i){case Hn.decimal_degrees:return Mde(r,nS);case Hn.seconds:return r;case Hn.gradians:return Mde(r,wft);case Hn.radians:return r/xft;default:throw new Vt(null,It.LogicError,null,{reason:"unexpected evaluation"})}}let lE=class B9e{constructor(e){this._seconds=e}static createFromAngleAndUnits(e,i){return new B9e(Eft(e,i,Hn.seconds))}extractAngularUnits(e){return Eft(this._seconds,Hn.seconds,cJ(e))}static createFromDegreesMinutesSeconds(e,i,r){return new B9e(bft(bft($j(e,nS),$j(i,ED)),r))}};function cJ(t){switch(sg(t),t){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 VPi=class c5t{constructor(e,i,r,n){this.view=e,this.angle=i,this.merdian=r,this.direction=n,this._dms=null,this._formattedDms=null}static createFromStringAndBearing(e,i,r){return new c5t(e,i.getAngle(r),i.getMeridian(r),i.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,i=Hn.truncated_degrees,r=0;for(let n=0;n0?1:0));case Hn.truncated_degrees:case Hn.fractional_degree_minutes:return s=aMe(n.fetchFormattedDms().getField(e),lMe(e)),oMe(s.toFixed(r),"0",i+r+(r>0?1:0));case Hn.fractional_minute_seconds:return s=aMe(nMe(n.fetchDms().getField(e),r),lMe(e)),oMe(s.toFixed(r),"0",i+r+(r>0?1:0));default:throw new Vt(null,It.LogicError,null,{reason:"unexpected evaluation"})}}function GPi(t,e,i){if(i===xu.quadrant)throw new Vt(null,It.LogicError,null,{reason:"conversion error"});if(e===Hn.degrees_minutes_seconds){const r=Gj.numberToDms(t);return ID.createFromAngleAndDirection(lE.createFromDegreesMinutesSeconds(r.m_degrees,r.m_minutes,r.m_seconds),i)}return ID.createFromAngleAndDirection(lE.createFromAngleAndUnits(t,cJ(e)),i)}function UPi(t){switch($i(t)){case 1:return{first:yc.north,second:yc.east};case 2:return{first:yc.south,second:yc.east};case 3:return{first:yc.south,second:yc.west};case 4:return{first:yc.north,second:yc.west}}return null}function Ift(t){switch(t.toUpperCase().trim()){case"N":case"NORTH":return yc.north;case"E":case"EAST":return yc.east;case"S":case"SOUTH":return yc.south;case"W":case"WEST":return yc.west}return null}function Uj(t){const e=parseFloat(t);if(nl(e)){if(isNaN(e))throw new Vt(null,It.LogicError,null,{reason:"invalid conversion"});return e}throw new Vt(null,It.LogicError,null,{reason:"invalid conversion"})}function uMe(t,e,i){const r=i===xu.quadrant;let n=null,s=null,o=0,a=0,l=0;if(r){if(t.length<2)throw new Vt(null,It.LogicError,null,{reason:"conversion error"});l=1;const c=UPi(mn(t[t.length-1]));if(c?(n=c.first,s=c.second):(o=1,n=Ift(mn(t[0])),s=Ift(mn(t[t.length-1]))),n===null||s===null)throw new Vt(null,It.LogicError,null,{reason:"invalid conversion"})}switch(e){case Hn.decimal_degrees:case Hn.radians:case Hn.gradians:if(t.length===0)throw new Vt(null,It.LogicError,null,{reason:"invalid conversion"});return r?ID.createFromAngleMeridianAndDirection(lE.createFromAngleAndUnits(Uj(t[o]),cJ(e)),n,s):ID.createFromAngleAndDirection(lE.createFromAngleAndUnits(Uj(t[o]),cJ(e)),i);case Hn.degrees_minutes_seconds:if(a=t.length-l-o,a===3){const c=lE.createFromDegreesMinutesSeconds(Uj(t[o]),Uj(t[o+1]),Uj(t[o+2]));return r?ID.createFromAngleMeridianAndDirection(c,n,s):ID.createFromAngleAndDirection(c,i)}if(a===1){const c=Uj(t[o]),h=Gj.numberToDms(c),p=lE.createFromDegreesMinutesSeconds(h.m_degrees,h.m_minutes,h.m_seconds);return r?ID.createFromAngleMeridianAndDirection(p,n,s):ID.createFromAngleAndDirection(p,i)}}throw new Vt(null,It.LogicError,null,{reason:"invalid conversion"})}function zPi(t){const e=[" ","-","/","'",'"',"\\","^",lJ,Sft," ","\r",` +`,"*"];let i="";for(let r=0;rr!=="")}function HPi(t,e,i){if(nl(t))return GPi($i(t),e,i);if(On(t))return uMe(zPi(t),e,i);if(Vn(t))return uMe(t,e,i);if(Ds(t))return uMe(t.toArray(),e,i);throw new Vt(null,It.LogicError,null,{reason:"conversion error"})}function WPi(t,e,i){const r=cJ(i);if(r&&i!==Hn.degrees_minutes_seconds)return t.getAngle(e).extractAngularUnits(r);throw new Vt(null,It.LogicError,null,{reason:"conversion error"})}function qPi(t,e,i){const r=t.getAngle(e);if(e===xu.quadrant&&i===Hn.degrees_minutes_seconds){const n=Gj.secondsToDMS(r.extractAngularUnits(Hn.seconds));return[jj(t.getMeridian(e),"SHORT"),n.m_degrees,n.m_minutes,n.m_seconds,jj(t.getDirection(e),"SHORT")]}if(i===Hn.degrees_minutes_seconds){const n=Gj.secondsToDMS(r.extractAngularUnits(Hn.seconds));return[n.m_degrees,n.m_minutes,n.m_seconds]}return e===xu.quadrant?[jj(t.getMeridian(e),"SHORT"),r.extractAngularUnits(i),jj(t.getDirection(e),"SHORT")]:[r.extractAngularUnits(i)]}function YPi(t,e){let i="";switch(t){case Hn.decimal_degrees:i=e===xu.quadrant?"DD.DD"+lJ:"DDD.DD"+lJ;break;case Hn.degrees_minutes_seconds:i=e===xu.quadrant?"dd"+lJ+` mm' ss"`:"ddd"+lJ+` mm' ss.ss"`;break;case Hn.radians:i="R.RR";break;case Hn.gradians:i="GGG.GG"+Sft;break;default:throw new Vt(null,It.LogicError,null,{reason:"conversion error"})}return e===xu.quadrant&&(i="p "+i+" b"),i}function cMe(t,e,i){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):(i++,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),e.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return new Uint8Array(e)}let ZPi=class{constructor(e){this._seed=e,this._totallen=0,this._bufs=[],this.init()}init(){return this._bufs=[],this._totallen=0,this}updateFloatArray(e){const i=[];for(const r of e)isNaN(r)?i.push("NaN"):r===1/0?i.push("Infinity"):r===-1/0?i.push("-Infinity"):r===0?i.push("0"):i.push(r.toString(16));this.update(Oft(i.join("")))}updateIntArray(e){const i=Int32Array.from(e);this.update(new Uint8Array(i.buffer))}updateUint8Array(e){this.update(Uint8Array.from(e))}updateWithString(e){return this.update(Oft(e))}update(e){return this._bufs.push(e),this._totallen+=e.length,this}digest(){const e=new Uint8Array(this._totallen);let i=0;for(const r of this._bufs)e.set(r,i),i+=r.length;return this.init(),this._xxHash32(e,this._seed)}_xxHash32(e,i=0){const r=e;let n=i+Pft&4294967295,s=0;if(r.length>=16){const a=[i+zj+Hj&4294967295,i+Hj&4294967295,i+0&4294967295,i-zj&4294967295],l=e,c=l.length-16;let h=0;for(s=0;(4294967280&s)<=c;s+=4){const p=s,y=l[p+0]+(l[p+1]<<8),v=l[p+2]+(l[p+3]<<8),x=y*Hj+(v*Hj<<16);let I=a[h]+x&4294967295;I=I<<13|I>>>19;const P=65535&I,F=I>>>16;a[h]=P*zj+(F*zj<<16)&4294967295,h=h+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+0]+(r[a+1]<<8),c=r[a+2]+(r[a+3]<<8);n=n+(l*Fde+(c*Fde<<16))&4294967295,n=n<<17|n>>>15,n=(65535&n)*Aft+((n>>>16)*Aft<<16)&4294967295}for(;s>>21,n=(65535&n)*zj+((n>>>16)*zj<<16)&4294967295;return n^=n>>>15,n=((65535&n)*Hj&4294967295)+((n>>>16)*Hj<<16),n^=n>>>13,n=((65535&n)*Fde&4294967295)+((n>>>16)*Fde<<16),n^=n>>>16,n<0?n+4294967296:n}};function QPi(t){return t.loadStatus==="loaded"&&t.user&&t.user.sourceJSON?t.user.sourceJSON:null}function eOi(t,e){return!!t&&n1e(t,e?.restUrl||"")}function Rft(t,e){if(!t||!e)return t===e;if(t.x===e.x&&t.y===e.y){if(t.hasZ){if(t.z!==e.z)return!1}else if(e.hasZ)return!1;if(t.hasM){if(t.m!==e.m)return!1}else if(e.hasM)return!1;return!0}return!1}function Yw(t,e,i){if(t!==null)if(Vn(t)){if(e.updateUint8Array([61]),i.map.has(t)){const r=i.map.get(t);e.updateIntArray([61237541^r])}else{i.map.set(t,i.currentLength++);for(const r of t)Yw(r,e,i);i.map.delete(t),i.currentLength--}e.updateUint8Array([199])}else if(Ds(t)){if(e.updateUint8Array([61]),i.map.has(t)){const r=i.map.get(t);e.updateIntArray([61237541^r])}else{i.map.set(t,i.currentLength++);for(const r of t.toArray())Yw(r,e,i);i.map.delete(t),i.currentLength--}e.updateUint8Array([199])}else{if(ku(t))return e.updateIntArray([t.toNumber()]),void e.updateUint8Array([241]);if(On(t))return e.updateIntArray([t.length]),e.updateWithString(t),void e.updateUint8Array([41]);if(Ua(t))e.updateUint8Array([t===!0?1:0,113]);else{if(nl(t))return e.updateFloatArray([t]),void e.updateUint8Array([173]);if(t instanceof _ft)throw new Vt(i.context,It.UnsupportedHashType,i.node);if(t instanceof kj)throw new Vt(i.context,It.UnsupportedHashType,i.node);if(!(t instanceof hs)){if(wu(t))throw new Vt(i.context,It.UnsupportedHashType,i.node);if(t instanceof er)return e.updateIntArray([3833836621]),e.updateIntArray([0]),e.updateFloatArray([t.x]),e.updateIntArray([1]),e.updateFloatArray([t.y]),t.hasZ&&(e.updateIntArray([2]),e.updateFloatArray([t.z])),t.hasM&&(e.updateIntArray([3]),e.updateFloatArray([t.m])),e.updateIntArray([3765347959]),void Yw(t.spatialReference.wkid,e,i);if(t instanceof To){e.updateIntArray([1266616829]);for(let r=0;r(nr(o,1,1,i,r),new kj(mn(o[0]))))},t.typeof=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);const a=LRe(o[0]);if(a==="Unrecognised Type")throw new Vt(i,It.UnrecognisedType,r);return a})},t.trim=function(i,r){return e(i,r,(n,s,o)=>(nr(o,1,1,i,r),mn(o[0]).trim()))},t.tohex=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);const a=$i(o[0]);return isNaN(a)?a:a.toString(16)})},t.upper=function(i,r){return e(i,r,(n,s,o)=>(nr(o,1,1,i,r),mn(o[0]).toUpperCase()))},t.proper=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,2,i,r);let a=1;o.length===2&&mn(o[1]).toLowerCase()==="firstword"&&(a=2);const l=/\s/,c=mn(o[0]);let h="",p=!0;for(let y=0;y(nr(o,1,1,i,r),mn(o[0]).toLowerCase()))},t.guid=function(i,r){return e(i,r,(n,s,o)=>{if(nr(o,0,1,i,r),o.length>0)switch(mn(o[0]).toLowerCase()){case"digits":return Fj().replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return Fj();case"digits-hyphen-braces":return"{"+Fj()+"}";case"digits-hyphen-parentheses":return"("+Fj()+")"}return"{"+Fj()+"}"})},t.standardizeguid=function(i,r){return e(i,r,(n,s,o)=>{nr(o,2,2,i,r);let a=mn(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 c=l.groups;switch(a=c.partA+"-"+c.partB+"-"+c.partC+"-"+c.partD+"-"+c.partE,mn(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+"}"})},t.console=function(i,r){return e(i,r,(n,s,o)=>(o.length===0||(o.length===1?i.console(mn(o[0])):i.console(mn(o))),ln))},t.mid=function(i,r){return e(i,r,(n,s,o)=>{nr(o,2,3,i,r);let a=$i(o[1]);if(isNaN(a))return"";if(a<0&&(a=0),o.length===2)return mn(o[0]).substr(a);let l=$i(o[2]);return isNaN(l)?"":(l<0&&(l=0),mn(o[0]).substr(a,l))})},t.find=function(i,r){return e(i,r,(n,s,o)=>{nr(o,2,3,i,r);let a=0;if(o.length>2){if(a=$i(xn(o[2],0)),isNaN(a))return-1;a<0&&(a=0)}return mn(o[1]).indexOf(mn(o[0]),a)})},t.left=function(i,r){return e(i,r,(n,s,o)=>{nr(o,2,2,i,r);let a=$i(o[1]);return isNaN(a)?"":(a<0&&(a=0),mn(o[0]).substr(0,a))})},t.right=function(i,r){return e(i,r,(n,s,o)=>{nr(o,2,2,i,r);let a=$i(o[1]);return isNaN(a)?"":(a<0&&(a=0),mn(o[0]).substr(-1*a,a))})},t.split=function(i,r){return e(i,r,(n,s,o)=>{let a;nr(o,2,4,i,r);let l=$i(xn(o[2],-1));const c=pb(xn(o[3],!1));if(l===-1||l===null||c===!0?a=mn(o[0]).split(mn(o[1])):(isNaN(l)&&(l=-1),l<-1&&(l=-1),a=mn(o[0]).split(mn(o[1]),l)),c===!1)return a;const h=[];for(let p=0;p=l);p++)a[p]!==""&&a[p]!==void 0&&h.push(a[p]);return h})},t.text=function(i,r){return e(i,r,(n,s,o)=>(nr(o,1,2,i,r),F_(o[0],o[1])))},t.concatenate=function(i,r){return e(i,r,(n,s,o)=>{const a=[];if(o.length<1)return"";if(Vn(o[0])){const l=xn(o[2],"");for(let c=0;c1?a.join(o[1]):a.join("")}if(Ds(o[0])){const l=xn(o[2],"");for(let c=0;c1?a.join(o[1]):a.join("")}for(let l=0;l{if(nr(o,1,1,i,r),Vn(o[0])){const a=o[0].slice(0);return a.reverse(),a}if(Ds(o[0])){const a=o[0].toArray().slice(0);return a.reverse(),a}throw new Vt(i,It.InvalidParameter,r)})},t.replace=function(i,r){return e(i,r,(n,s,o)=>{nr(o,3,4,i,r);const a=mn(o[0]),l=mn(o[1]),c=mn(o[2]);return o.length!==4||pb(o[3])?qw(a,l,c):a.replace(l,c)})},t.schema=function(i,r){return e(i,r,(n,s,o)=>{if(wu(o[0])){const a=YRe(o[0]);return a?hs.convertObjectToArcadeDictionary(a,ra(i)):null}throw new Vt(i,It.InvalidParameter,r)})},t.subtypes=function(i,r){return e(i,r,(n,s,o)=>{if(nr(o,1,1,i,r),wu(o[0])){const a=iJ(o[0]);return a?hs.convertObjectToArcadeDictionary(a,ra(i)):null}throw new Vt(i,It.InvalidParameter,r)})},t.subtypecode=function(i,r){return e(i,r,(n,s,o)=>{if(nr(o,1,1,i,r),wu(o[0])){const a=iJ(o[0]);if(!a)return null;if(a.subtypeField&&o[0].hasField(a.subtypeField)){const l=o[0].field(a.subtypeField);for(const c of a.subtypes)if(c.code===l)return c.code;return null}return null}throw new Vt(i,It.InvalidParameter,r)})},t.subtypename=function(i,r){return e(i,r,(n,s,o)=>{if(nr(o,1,1,i,r),wu(o[0])){const a=iJ(o[0]);if(!a)return"";if(a.subtypeField&&o[0].hasField(a.subtypeField)){const l=o[0].field(a.subtypeField);for(const c of a.subtypes)if(c.code===l)return c.name;return""}return""}throw new Vt(i,It.InvalidParameter,r)})},t.gdbversion=function(i,r){return e(i,r,(n,s,o)=>{if(nr(o,1,1,i,r),wu(o[0]))return o[0].gdbVersion();throw new Vt(i,It.InvalidParameter,r)})},t.domain=function(i,r){return e(i,r,(n,s,o)=>{if(nr(o,2,3,i,r),wu(o[0])){const a=HRe(o[0],mn(o[1]),o[2]===void 0?void 0:$i(o[2]));return a&&a.domain?a.domain.type==="coded-value"||a.domain.type==="codedValue"?hs.convertObjectToArcadeDictionary({type:"codedValue",name:a.domain.name,dataType:yde[a.field.type],codedValues:a.domain.codedValues.map(l=>({name:l.name,code:l.code}))},ra(i)):hs.convertObjectToArcadeDictionary({type:"range",name:a.domain.name,dataType:yde[a.field.type],min:a.domain.min,max:a.domain.max},ra(i)):null}throw new Vt(i,It.InvalidParameter,r)})},t.domainname=function(i,r){return e(i,r,(n,s,o)=>{if(nr(o,2,4,i,r),wu(o[0]))return WRe(o[0],mn(o[1]),o[2],o[3]===void 0?void 0:$i(o[3]));throw new Vt(i,It.InvalidParameter,r)})},t.domaincode=function(i,r){return e(i,r,(n,s,o)=>{if(nr(o,2,4,i,r),wu(o[0]))return qRe(o[0],mn(o[1]),o[2],o[3]===void 0?void 0:$i(o[3]));throw new Vt(i,It.InvalidParameter,r)})},t.urlencode=function(i,r){return e(i,r,(n,s,o)=>{if(nr(o,1,1,i,r),o[0]===null)return"";if(o[0]instanceof hs){let a="";for(const l of o[0].keys()){const c=o[0].field(l);a!==""&&(a+="&"),a+=c===null?encodeURIComponent(l)+"=":encodeURIComponent(l)+"="+encodeURIComponent(c)}return a}return encodeURIComponent(mn(o[0]))})},t.hash=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,1,i,r);const a=new ZPi(0);return Yw(o[0],a,{context:i,node:r,map:new Map,currentLength:0}),a.digest()})},t.convertdirection=function(i,r){return e(i,r,(n,s,o)=>(nr(o,3,3,i,r),JPi(o[0],o[1],o[2])))},t.fromjson=function(i,r){return e(i,r,(n,s,o)=>{if(nr(o,1,1,i,r),On(o[0])===!1)throw new Vt(i,It.InvalidParameter,r);return hs.convertJsonToArcade(JSON.parse(mn(o[0])),ra(i))})},t.expects=function(i,r){return e(i,r,(n,s,o)=>{if(o.length<1)throw new Vt(i,It.WrongNumberOfParameters,r);return ln})},t.tocharcode=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,2,i,r);const a=$i(xn(o[1],0)),l=mn(o[0]);if(l.length===0&&o.length===1)return null;if(l.length<=a||a<0)throw new Vt(i,It.OutOfBounds,r);return l.charCodeAt(a)})},t.tocodepoint=function(i,r){return e(i,r,(n,s,o)=>{nr(o,1,2,i,r);const a=$i(xn(o[1],0)),l=mn(o[0]);if(l.length===0&&o.length===1)return null;if(l.length<=a||a<0)throw new Vt(i,It.OutOfBounds,r);return l.codePointAt(a)})},t.fromcharcode=function(i,r){return e(i,r,(n,s,o)=>{if(o.length<1)throw new Vt(i,It.WrongNumberOfParameters,r);const a=o.map(l=>Math.trunc($i(l))).filter(l=>l>=0&&l<=65535);return a.length===0?null:String.fromCharCode.apply(null,a)})},t.fromcodepoint=function(i,r){return e(i,r,(n,s,o)=>{if(o.length<1)throw new Vt(i,It.WrongNumberOfParameters,r);let a;try{a=o.map(l=>Math.trunc($i(l))).filter(l=>l<=1114111&&l>>>0===l)}catch{return null}return a.length===0?null:String.fromCodePoint.apply(null,a)})},t.getuser=function(i,r){return e(i,r,(n,s,o)=>{nr(o,0,2,i,r);let a=xn(o[1],"");if(a=a===!0||a===!1?"":mn(a),a!==null&&a!=="")return null;if(o.length===0||o[0]instanceof kj){let l=null;if(i.services&&i.services.portal&&(l=i.services.portal),o.length>0&&!eOi(o[0].field("url"),l)||!l)return null;if(a===""){const c=QPi(l);if(c){const h=JSON.parse(JSON.stringify(c));for(const p of["lastLogin","created","modified"])h[p]!==void 0&&h[p]!==null&&(h[p]=new Date(h[p]));return hs.convertObjectToArcadeDictionary(h,ra(i))}}return null}throw new Vt(i,It.InvalidParameter,r)})}}let Wj=class{constructor(e,i){this._moduleSingletons=e,this._syntaxModules=i}loadLibrary(e){if(this._syntaxModules==null)return null;const i=this._syntaxModules[e.toLowerCase()];return i?{syntax:i.script,uri:i.uri}:null}},tOi=class extends bD{constructor(e,i){super(),this.paramCount=i,this.fn=e}createFunction(e){return(...i)=>{if(i.length!==this.paramCount)throw new Vt(e,It.WrongNumberOfParameters,null);return this.fn(...i)}}call(e,i){return this.fn(...i.arguments)}marshalledCall(e,i,r,n){return n(e,i,(s,o,a)=>{a=a.map(c=>!mu(c)||c instanceof Ww?c:wD(c,e,n));const l=this.call(r,{arguments:a});return Fp(l)?l.then(c=>wD(c,r,n)):l})}};function Xw(t,e,i){try{return i(t,null,e.arguments)}catch(r){throw r}}function Ws(t,e){try{switch(e.type){case"EmptyStatement":return"lc.voidOperation";case"VariableDeclarator":return mOi(t,e);case"VariableDeclaration":return fOi(t,e);case"BlockStatement":case"Program":return dMe(t,e);case"FunctionDeclaration":return pOi(t,e);case"ImportDeclaration":return hOi(t,e);case"ExportNamedDeclaration":return dOi(t,e);case"ReturnStatement":return cOi(t,e);case"IfStatement":return Dft(t,e);case"ExpressionStatement":return uOi(t,e);case"AssignmentExpression":return lOi(t,e);case"UpdateExpression":return oOi(t,e);case"BreakStatement":return"break";case"ContinueStatement":return"continue";case"TemplateLiteral":return _Oi(t,e);case"TemplateElement":return JSON.stringify(e.value?e.value.cooked:"");case"ForStatement":return sOi(t,e);case"ForInStatement":return nOi(t,e);case"WhileStatement":return aOi(t,e);case"Identifier":return xOi(t,e);case"MemberExpression":return gOi(t,e);case"Literal":return e.value===null||e.value===void 0?"null":JSON.stringify(e.value);case"CallExpression":return SOi(t,e);case"UnaryExpression":return yOi(t,e);case"BinaryExpression":return bOi(t,e);case"LogicalExpression":return wOi(t,e);case"ArrayExpression":return vOi(t,e);case"ObjectExpression":return iOi(t,e);case"Property":return rOi(t,e);case"Array":throw new x0(t,It.NeverReach,e);default:throw new x0(t,It.Unrecognised,e)}}catch(i){throw i}}function iOi(t,e){let i="lang.dictionary([";for(let r=0;r0&&(i+=","),i+="lang.strCheck("+(n.key.type==="Identifier"?"'"+n.key.name+"'":Ws(t,n.key))+",'ObjectExpression'),lang.aCheck("+Ws(t,n.value)+", 'ObjectExpression')"}return i+="])",i}function rOi(t,e){throw new x0(t,It.NeverReach,e)}function nOi(t,e){const i=uE(t),r=uE(t),n=uE(t);let s="var "+i+" = "+Ws(t,e.right)+`; +`;e.left.type==="VariableDeclaration"&&(s+=Ws(t,e.left));let o=e.left.type==="VariableDeclaration"?e.left.declarations[0].id.name:e.left.name;o=o.toLowerCase(),fb(o);let a="";t.localScope!==null&&(t.localScope[o]!==void 0?a="lscope['"+o+"']":t.localScope._SymbolsMap[o]!==void 0&&(a="lscope['"+t.localScope._SymbolsMap[o]+"']"));let l="";if(a===""){if(t.globalScope[o]!==void 0)a="gscope['"+o+"']";else if(t.globalScope._SymbolsMap[o]!==void 0)a="gscope['"+t.globalScope._SymbolsMap[o]+"']";else if(t.localScope!==null)if(t.undeclaredGlobalsInFunctions.has(o))a="gscope['"+t.undeclaredGlobalsInFunctions.get(o).manglename+"']",l=t.undeclaredGlobalsInFunctions.get(o).manglename;else{const c={manglename:sS(t),node:e.left};t.undeclaredGlobalsInFunctions.set(o,c),a="gscope['"+c.manglename+"']",l=c.manglename}}return l&&(s+="lang.chkAssig('"+l+`',runtimeCtx); `),s+="if ("+i+`===null) { lastStatement = lc.voidOperation; } `,s+="else if (lc.isArray("+i+") || lc.isString("+i+")) {",s+="var "+r+"="+i+`.length; `,s+="for(var "+n+"=0; "+n+"<"+r+"; "+n+`++) { `,s+=a+"="+n+`; -`,s+=Ls(t,e.body),s+=` +`,s+=Ws(t,e.body),s+=` } `,s+=` lastStatement = lc.voidOperation; `,s+=` @@ -166,7 +170,7 @@ northing meters`+pe;var Ct=ot/2,Wt=0,pi=0,di,Oi,zi,sr,tr;return 00&&(s+=", "),s+=Ls(t,e.arguments[o]);return s+="]",t.isAsync?"(yield lang.callModuleFunction("+Ls(t,e.callee.object)+","+s+","+n+",runtimeCtx))":"lang.callModuleFunction("+Ls(t,e.callee.object)+","+s+","+n+",runtimeCtx)"}if(e.callee.type!=="Identifier")throw new _0(t,Et.FuncionNotFound,e);const i=e.callee.name.toLowerCase();if(i==="iif")return vPi(t,e);if(i==="when")return _Pi(t,e);if(i==="decode")return bPi(t,e);let r="";if(t.localScope!==null&&(t.localScope[i]!==void 0?r="lscope['"+i+"']":t.localScope._SymbolsMap[i]!==void 0&&(r="lscope['"+t.localScope._SymbolsMap[i]+"']")),r===""){if(t.globalScope[i]!==void 0)r="gscope['"+i+"']";else if(t.globalScope._SymbolsMap[i]!==void 0)r="gscope['"+t.globalScope._SymbolsMap[i]+"']";else if(t.localScope!==null)if(t.undeclaredGlobalsInFunctions.has(i))r="gscope[lang.chkAssig('"+t.undeclaredGlobalsInFunctions.get(i).manglename+"',runtimeCtx)]";else{const n={manglename:sS(t),node:e.argument};t.undeclaredGlobalsInFunctions.set(i,n),r="gscope[lang.chkAssig('"+n.manglename+"',runtimeCtx)]"}}if(r!==""){let n="[";for(let s=0;s0&&(n+=", "),n+=Ls(t,e.arguments[s]);return n+="]",t.isAsync?"(yield lang.callfunc("+r+","+n+",runtimeCtx) )":"lang.callfunc("+r+","+n+",runtimeCtx)"}throw new _0(t,Et.FuncionNotFound,e)}catch(i){throw i}}function vPi(t,e){try{if(e.arguments.length!==3)throw new _0(t,Et.WrongNumberOfParameters,e);const i=aE(t);return`${t.isAsync?`(yield (function() { +`}function mOi(t,e){let i=e.init===null?null:Ws(t,e.init);i===ln&&(i=null);const r=e.id.name.toLowerCase();if(fb(r),t.localScope!==null){if(t.localScope[r]!==void 0)return"lscope['"+r+"']="+i+"; ";if(t.localScope._SymbolsMap[r]!==void 0)return"lscope['"+t.localScope._SymbolsMap[r]+"']="+i+"; ";{const s=sS(t);return t.localScope._SymbolsMap[r]=s,t.mangleMap[r]=s,"lscope['"+s+"']="+i+"; "}}if(t.globalScope[r]!==void 0)return"gscope['"+r+"']="+i+"; ";if(t.globalScope._SymbolsMap[r]!==void 0)return"gscope['"+t.globalScope._SymbolsMap[r]+"']="+i+"; ";if(t.undeclaredGlobalsInFunctions.has(r)){const s=t.undeclaredGlobalsInFunctions.get(r).manglename;return t.globalScope._SymbolsMap[r]=s,t.mangleMap[r]=s,t.undeclaredGlobalsInFunctions.delete(r),"gscope[lang.setAssig('"+s+"', runtimeCtx)]="+i+"; "}const n=sS(t);return t.globalScope._SymbolsMap[r]=n,t.mangleMap[r]=n,"gscope['"+n+"']="+i+"; "}function gOi(t,e){try{let i;return e.computed===!0?i=Ws(t,e.property):(i="'"+e.property.name+"'",fb(e.property.name)),"lang.member("+Ws(t,e.object)+","+i+")"}catch(i){throw i}}function yOi(t,e){try{return"lang.unary("+Ws(t,e.argument)+",'"+e.operator+"')"}catch(i){throw i}}function vOi(t,e){try{const i=[];for(let r=0;r0&&(s+=", "),s+=Ws(t,e.arguments[o]);return s+="]",t.isAsync?"(yield lang.callModuleFunction("+Ws(t,e.callee.object)+","+s+","+n+",runtimeCtx))":"lang.callModuleFunction("+Ws(t,e.callee.object)+","+s+","+n+",runtimeCtx)"}if(e.callee.type!=="Identifier")throw new x0(t,It.FuncionNotFound,e);const i=e.callee.name.toLowerCase();if(i==="iif")return COi(t,e);if(i==="when")return TOi(t,e);if(i==="decode")return EOi(t,e);let r="";if(t.localScope!==null&&(t.localScope[i]!==void 0?r="lscope['"+i+"']":t.localScope._SymbolsMap[i]!==void 0&&(r="lscope['"+t.localScope._SymbolsMap[i]+"']")),r===""){if(t.globalScope[i]!==void 0)r="gscope['"+i+"']";else if(t.globalScope._SymbolsMap[i]!==void 0)r="gscope['"+t.globalScope._SymbolsMap[i]+"']";else if(t.localScope!==null)if(t.undeclaredGlobalsInFunctions.has(i))r="gscope[lang.chkAssig('"+t.undeclaredGlobalsInFunctions.get(i).manglename+"',runtimeCtx)]";else{const n={manglename:sS(t),node:e.argument};t.undeclaredGlobalsInFunctions.set(i,n),r="gscope[lang.chkAssig('"+n.manglename+"',runtimeCtx)]"}}if(r!==""){let n="[";for(let s=0;s0&&(n+=", "),n+=Ws(t,e.arguments[s]);return n+="]",t.isAsync?"(yield lang.callfunc("+r+","+n+",runtimeCtx) )":"lang.callfunc("+r+","+n+",runtimeCtx)"}throw new x0(t,It.FuncionNotFound,e)}catch(i){throw i}}function COi(t,e){try{if(e.arguments.length!==3)throw new x0(t,It.WrongNumberOfParameters,e);const i=uE(t);return`${t.isAsync?`(yield (function() { return lang.__awaiter(this, void 0, void 0, function* () {`:"function() {"} - var ${i} = ${Ls(t,e.arguments[0])}; + var ${i} = ${Ws(t,e.arguments[0])}; if (${i} === true) { - return ${Ls(t,e.arguments[1])}; + return ${Ws(t,e.arguments[1])}; } else if (${i} === false) { - return ${Ls(t,e.arguments[2])}; + return ${Ws(t,e.arguments[2])}; } else { lang.error('ExecutionErrorCodes.BooleanConditionRequired'); } - ${t.isAsync?"})}()))":"}()"}`}catch(i){throw i}}function _Pi(t,e){try{if(e.arguments.length<3)throw new _0(t,Et.WrongNumberOfParameters,e);if(e.arguments.length%2==0)throw new _0(t,Et.WrongNumberOfParameters,e);const i=aE(t);let r="var ";for(let n=0;n{throw new Nt(t,Et.Unrecognised,e)})}catch(i){throw i}},Gm.decode=function(t,e){try{return qw(t,e,(i,r,n)=>{throw new Nt(t,Et.Unrecognised,e)})}catch(i){throw i}},Gm.when=function(t,e){try{return qw(t,e,(i,r,n)=>{throw new Nt(t,Et.Unrecognised,e)})}catch(i){throw i}};const BV={};for(const t in Gm)BV[t]=new tE(Gm[t]);PRe(Gm,qw);for(const t in Gm)Gm[t]=new tE(Gm[t]);const zRe=function(){};zRe.prototype=Gm;const HRe=function(){};function Ypt(t,e,i){const r={};t||(t={}),i||(i={}),r._SymbolsMap={},r.textformatting=1,r.infinity=1,r.pi=1;for(const n in e)r[n]=1;for(const n in i)r[n]=1;for(const n in t)r[n]=1;return r}function Xpt(t,e,i,r){const n=i?new HRe:new zRe;t||(t={}),e||(e={});const s=new es({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 t)n._SymbolsMap[o]=1,t[o]&&t[o].declaredClass==="esri.Graphic"?n[o]=ah.createFromGraphic(t[o],r??null):n[o]=t[o];return n}HRe.prototype=BV;function PN(t,e){const i={mode:e,compiled:!0,functions:{},signatures:[],standardFunction:qw,standardFunctionAsync:qw,evaluateIdentifier:wPi};for(let r=0;r0){if(i.substr(0,2).toLowerCase()!=="_t"&&t.localStack[t.localStack.length-1][i]!==void 0)return t.localStack[t.localStack.length-1][i];const n=t.mangleMap[i];if(n!==void 0&&t.localStack[t.localStack.length-1][n]!==void 0)return t.localStack[t.localStack.length-1][n]}if(i.substr(0,2).toLowerCase()!=="_t"&&t.globalScope[i]!==void 0||t.globalScope._SymbolsMap[i]===1)return t.globalScope[i];const r=t.mangleMap[i];return r!==void 0?t.globalScope[r]:void 0}PN([nde],"sync"),PN([nde],"async");let WRe=0;const Kpt={error(t){throw new Nt(null,t,null)},__awaiter:(t,e,i,r)=>new Promise((n,s)=>{function o(c){try{l(r.next(c))}catch(d){s(d)}}function a(c){try{l(r.throw(c))}catch(d){s(d)}}function l(c){c.done?n(c.value):c.value&&c.value.then?c.value.then(o,a):(WRe++,WRe%100==0?setTimeout(()=>{WRe=0,o(c.value)},0):o(c.value))}l((r=r.apply(t,e||[])).next())}),functionDepthchecker:(t,e)=>function(){if(e.depthCounter.depth++,e.localStack.push([]),e.depthCounter.depth>64)throw new Nt(null,Et.MaximumCallDepth,null);const i=t.apply(this,arguments);return Ip(i)?i.then(r=>(e.depthCounter.depth--,e.localStack.length=e.localStack.length-1,r)):(e.depthCounter.depth--,e.localStack.length=e.localStack.length-1,i)},chkAssig(t,e){if(e.gdefs[t]===void 0)throw new Nt(e,Et.InvalidIdentifier,null);return t},mustBoolean(t,e){if(t===!0||t===!1)return t;throw new Nt(e,Et.BooleanConditionRequired,null)},setAssig:(t,e)=>(e.gdefs[t]=1,t),castString:t=>rn(t),aCheck(t,e){if(au(t))throw e==="ArrayExpression"?new Nt(null,Et.NoFunctionInArray,null):e==="ObjectExpression"?new Nt(null,Et.NoFunctionInDictionary,null):new Nt(null,Et.NoFunctionInTemplateLiteral,null);return t===Xr?null:t},Dictionary:es,Feature:ah,UserDefinedCompiledFunction:XAi,dictionary(t){const e={},i=new Map;for(let n=0;n>":case">>>":case"^":case"&":return Zhe(Mi(t),Mi(e),i);case"==":case"=":return yv(t,e);case"!=":return!yv(t,e);case"<":case">":case"<=":case">=":return Khe(t,e,i);case"+":return vn(t)||vn(e)?rn(t)+rn(e):Mi(t)+Mi(e);case"-":return Mi(t)-Mi(e);case"*":return Mi(t)*Mi(e);case"/":return Mi(t)/Mi(e);case"%":return Mi(t)%Mi(e);default:throw new Nt(null,Et.UnsupportedOperator,null)}},assign(t,e,i){switch(e){case"=":return t===Xr?null:t;case"/=":return Mi(i)/Mi(t);case"*=":return Mi(i)*Mi(t);case"-=":return Mi(i)-Mi(t);case"+=":return vn(i)||vn(t)?rn(i)+rn(t):Mi(i)+Mi(t);case"%=":return Mi(i)%Mi(t);default:throw new Nt(null,Et.UnsupportedOperator,null)}},update(t,e,i,r){const n=Mi(t[e]);return t[e]=i==="++"?n+1:n-1,r===!1?n:i==="++"?n+1:n-1},graphicToFeature:(t,e,i)=>t===null?null:ah.createFromGraphicLikeObject(t.geometry,t.attributes,e,i.timeReference),memberupdate(t,e,i,r){let n;if(Tn(t)){if(!Ka(e))throw new Nt(null,Et.ArrayAccessorMustBeNumber,null);if(e<0&&(e=t.length+e),e<0||e>=t.length)throw new Nt(null,Et.OutOfBounds,null);n=Mi(t[e]),t[e]=i==="++"?n+1:n-1}else if(t instanceof es){if(vn(e)===!1)throw new Nt(null,Et.KeyAccessorMustBeString,null);if(t.hasField(e)!==!0)throw new Nt(null,Et.FieldNotFound,null,{key:e});n=Mi(t.field(e)),t.setField(e,i==="++"?n+1:n-1)}else if(du(t)){if(vn(e)===!1)throw new Nt(null,Et.KeyAccessorMustBeString,null);if(t.hasField(e)!==!0)throw new Nt(null,Et.FieldNotFound,null);n=Mi(t.field(e)),t.setField(e,i==="++"?n+1:n-1)}else{if(_s(t))throw new Nt(null,Et.Immutable,null);if(!(t instanceof oJ))throw new Nt(null,Et.InvalidIdentifier,null);if(vn(e)===!1)throw new Nt(null,Et.ModuleAccessorMustBeString,null);if(t.hasGlobal(e)!==!0)throw new Nt(null,Et.ModuleExportNotFound,null);n=Mi(t.global(e)),t.setGlobal(e,i==="++"?n+1:n-1)}return r===!1?n:i==="++"?n+1:n-1},assignmember(t,e,i,r){if(Tn(t)){if(!Ka(e))throw new Nt(null,Et.ArrayAccessorMustBeNumber,null);if(e<0&&(e=t.length+e),e<0||e>t.length)throw new Nt(null,Et.OutOfBounds,null);if(e===t.length){if(i!=="=")throw new Nt(null,Et.OutOfBounds,null);t[e]=this.assign(r,i,t[e])}else t[e]=this.assign(r,i,t[e])}else if(t instanceof es){if(vn(e)===!1)throw new Nt(null,Et.KeyAccessorMustBeString,null);if(t.hasField(e)===!0)t.setField(e,this.assign(r,i,t.field(e)));else{if(i!=="=")throw new Nt(null,Et.FieldNotFound,null);t.setField(e,this.assign(r,i,null))}}else if(du(t)){if(vn(e)===!1)throw new Nt(null,Et.KeyAccessorMustBeString,null);if(t.hasField(e)===!0)t.setField(e,this.assign(r,i,t.field(e)));else{if(i!=="=")throw new Nt(null,Et.FieldNotFound,null);t.setField(e,this.assign(r,i,null))}}else{if(_s(t))throw new Nt(null,Et.Immutable,null);if(!(t instanceof oJ))throw new Nt(null,Et.InvalidIdentifier,null);if(vn(e)===!1)throw new Nt(null,Et.ModuleAccessorMustBeString,null);if(!t.hasGlobal(e))throw new Nt(null,Et.ModuleExportNotFound,null);t.setGlobal(e,this.assign(r,i,t.global(e)))}},member(t,e){if(t===null)throw new Nt(null,Et.MemberOfNull,null);if(t instanceof es||du(t)){if(vn(e))return t.field(e);throw new Nt(null,Et.InvalidMemberAccessKey,null)}if(t instanceof Jr){if(vn(e))return AN(t,e,null,null);throw new Nt(null,Et.InvalidMemberAccessKey,null)}if(Tn(t)){if(Ka(e)&&isFinite(e)&&Math.floor(e)===e){if(e<0&&(e=t.length+e),e>=t.length||e<0)throw new Nt(null,Et.OutOfBounds,null);return t[e]}throw new Nt(null,Et.InvalidMemberAccessKey,null)}if(vn(t)){if(Ka(e)&&isFinite(e)&&Math.floor(e)===e){if(e<0&&(e=t.length+e),e>=t.length||e<0)throw new Nt(null,Et.OutOfBounds,null);return t[e]}throw new Nt(null,Et.InvalidMemberAccessKey,null)}if(_s(t)){if(Ka(e)&&isFinite(e)&&Math.floor(e)===e){if(e<0&&(e=t.length()+e),e>=t.length()||e<0)throw new Nt(null,Et.OutOfBounds,null);return t.get(e)}throw new Nt(null,Et.InvalidMemberAccessKey,null)}if(t instanceof oJ){if(vn(e))return t.global(e);throw new Nt(null,Et.InvalidMemberAccessKey,null)}throw new Nt(null,Et.InvalidMemberAccessKey,null)},callfunc:(t,e,i)=>t.call(i,{arguments:e,preparsed:!0}),loadModule(t,e){const i=e.moduleFactoryMap[t];if(e.moduleSingletons[i])return e.moduleSingletons[i];const r=e.moduleFactory[i]({vars:{},moduleSingletons:e.moduleSingletons,depthCounter:e.depthCounter,console:e.console,abortSignal:e.abortSignal,isAsync:e.isAsync,services:e.services,lrucache:e.lrucache,timeReference:e.timeReference?e.timeReference:null,interceptor:e.interceptor},e.spatialReference);return e.moduleSingletons[i]=r,r},callModuleFunction(t,e,i,r){if(!(t instanceof oJ))throw new Nt(null,Et.FuncionNotFound,null);const n=t.global(i);if(au(n)===!1)throw new Nt(null,Et.CallNonFunction,null);return n.call(r,{preparsed:!0,arguments:e})}};function cde(t){console.log(t)}function Jpt(t,e,i=!1){e===null&&(e={vars:{},customfunctions:{}});let r=null;t.usesModules&&(r=new $V(null,t.loadedModules));const n={isAsync:i,globalScope:Ypt(e.vars,i?BV:Gm,e.customfunctions),moduleFactory:{},moduleFactoryMap:{},undeclaredGlobalsInFunctions:new Map,customfunctions:e.customfunctions,libraryResolver:r,localScope:null,mangleMap:{},depthCounter:{depth:1},exports:{},console:cde,lrucache:e.lrucache,timeReference:e.timeReference??null,interceptor:e.interceptor,services:e.services,symbols:{symbolCounter:0}};let s=Ls(n,t);s===""&&(s="lc.voidOperation; "),n.undeclaredGlobalsInFunctions.size>0&&n.undeclaredGlobalsInFunctions.forEach(y=>{throw new _0(e,Et.InvalidIdentifier,y.node)});let o="";o=i?`var runtimeCtx=this.prepare(context, true); + return ${Ws(t,e.arguments[e.arguments.length-1])} + ${t.isAsync?"})}()))":"}()"}`}catch(i){throw i}}const zm={};function sS(t){return t.symbols.symbolCounter++,"_T"+t.symbols.symbolCounter.toString()}function uE(t){return t.symbols.symbolCounter++,"_Tvar"+t.symbols.symbolCounter.toString()}KRe(zm,Xw),hMe(zm,Xw),eMe(zm,Xw),JRe(zm,Xw),tMe(zm,Xw),zm.iif=function(t,e){try{return Xw(t,e,(i,r,n)=>{throw new Vt(t,It.Unrecognised,e)})}catch(i){throw i}},zm.decode=function(t,e){try{return Xw(t,e,(i,r,n)=>{throw new Vt(t,It.Unrecognised,e)})}catch(i){throw i}},zm.when=function(t,e){try{return Xw(t,e,(i,r,n)=>{throw new Vt(t,It.Unrecognised,e)})}catch(i){throw i}};const qj={};for(const t in zm)qj[t]=new rE(zm[t]);ZRe(zm,Xw);for(const t in zm)zm[t]=new rE(zm[t]);const pMe=function(){};pMe.prototype=zm;const fMe=function(){};function Fft(t,e,i){const r={};t||(t={}),i||(i={}),r._SymbolsMap={},r.textformatting=1,r.infinity=1,r.pi=1;for(const n in e)r[n]=1;for(const n in i)r[n]=1;for(const n in t)r[n]=1;return r}function Lft(t,e,i,r){const n=i?new fMe:new pMe;t||(t={}),e||(e={});const s=new hs({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 t)n._SymbolsMap[o]=1,t[o]&&t[o].declaredClass==="esri.Graphic"?n[o]=dh.createFromGraphic(t[o],r??null):n[o]=t[o];return n}fMe.prototype=qj;function Rk(t,e){const i={mode:e,compiled:!0,functions:{},signatures:[],standardFunction:Xw,standardFunctionAsync:Xw,evaluateIdentifier:IOi};for(let r=0;r0){if(i.substr(0,2).toLowerCase()!=="_t"&&t.localStack[t.localStack.length-1][i]!==void 0)return t.localStack[t.localStack.length-1][i];const n=t.mangleMap[i];if(n!==void 0&&t.localStack[t.localStack.length-1][n]!==void 0)return t.localStack[t.localStack.length-1][n]}if(i.substr(0,2).toLowerCase()!=="_t"&&t.globalScope[i]!==void 0||t.globalScope._SymbolsMap[i]===1)return t.globalScope[i];const r=t.mangleMap[i];return r!==void 0?t.globalScope[r]:void 0}Rk([Pde],"sync"),Rk([Pde],"async");let mMe=0;const Nft={error(t){throw new Vt(null,t,null)},__awaiter:(t,e,i,r)=>new Promise((n,s)=>{function o(c){try{l(r.next(c))}catch(h){s(h)}}function a(c){try{l(r.throw(c))}catch(h){s(h)}}function l(c){c.done?n(c.value):c.value&&c.value.then?c.value.then(o,a):(mMe++,mMe%100==0?setTimeout(()=>{mMe=0,o(c.value)},0):o(c.value))}l((r=r.apply(t,e||[])).next())}),functionDepthchecker:(t,e)=>function(){if(e.depthCounter.depth++,e.localStack.push([]),e.depthCounter.depth>64)throw new Vt(null,It.MaximumCallDepth,null);const i=t.apply(this,arguments);return Fp(i)?i.then(r=>(e.depthCounter.depth--,e.localStack.length=e.localStack.length-1,r)):(e.depthCounter.depth--,e.localStack.length=e.localStack.length-1,i)},chkAssig(t,e){if(e.gdefs[t]===void 0)throw new Vt(e,It.InvalidIdentifier,null);return t},mustBoolean(t,e){if(t===!0||t===!1)return t;throw new Vt(e,It.BooleanConditionRequired,null)},setAssig:(t,e)=>(e.gdefs[t]=1,t),castString:t=>mn(t),aCheck(t,e){if(mu(t))throw e==="ArrayExpression"?new Vt(null,It.NoFunctionInArray,null):e==="ObjectExpression"?new Vt(null,It.NoFunctionInDictionary,null):new Vt(null,It.NoFunctionInTemplateLiteral,null);return t===ln?null:t},Dictionary:hs,Feature:dh,UserDefinedCompiledFunction:tOi,dictionary(t){const e={},i=new Map;for(let n=0;n>":case">>>":case"^":case"&":return Sde($i(t),$i(e),i);case"==":case"=":return bv(t,e);case"!=":return!bv(t,e);case"<":case">":case"<=":case">=":return wde(t,e,i);case"+":return On(t)||On(e)?mn(t)+mn(e):$i(t)+$i(e);case"-":return $i(t)-$i(e);case"*":return $i(t)*$i(e);case"/":return $i(t)/$i(e);case"%":return $i(t)%$i(e);default:throw new Vt(null,It.UnsupportedOperator,null)}},assign(t,e,i){switch(e){case"=":return t===ln?null:t;case"/=":return $i(i)/$i(t);case"*=":return $i(i)*$i(t);case"-=":return $i(i)-$i(t);case"+=":return On(i)||On(t)?mn(i)+mn(t):$i(i)+$i(t);case"%=":return $i(i)%$i(t);default:throw new Vt(null,It.UnsupportedOperator,null)}},update(t,e,i,r){const n=$i(t[e]);return t[e]=i==="++"?n+1:n-1,r===!1?n:i==="++"?n+1:n-1},graphicToFeature:(t,e,i)=>t===null?null:dh.createFromGraphicLikeObject(t.geometry,t.attributes,e,i.timeReference),memberupdate(t,e,i,r){let n;if(Vn(t)){if(!nl(e))throw new Vt(null,It.ArrayAccessorMustBeNumber,null);if(e<0&&(e=t.length+e),e<0||e>=t.length)throw new Vt(null,It.OutOfBounds,null);n=$i(t[e]),t[e]=i==="++"?n+1:n-1}else if(t instanceof hs){if(On(e)===!1)throw new Vt(null,It.KeyAccessorMustBeString,null);if(t.hasField(e)!==!0)throw new Vt(null,It.FieldNotFound,null,{key:e});n=$i(t.field(e)),t.setField(e,i==="++"?n+1:n-1)}else if(wu(t)){if(On(e)===!1)throw new Vt(null,It.KeyAccessorMustBeString,null);if(t.hasField(e)!==!0)throw new Vt(null,It.FieldNotFound,null);n=$i(t.field(e)),t.setField(e,i==="++"?n+1:n-1)}else{if(Ds(t))throw new Vt(null,It.Immutable,null);if(!(t instanceof hJ))throw new Vt(null,It.InvalidIdentifier,null);if(On(e)===!1)throw new Vt(null,It.ModuleAccessorMustBeString,null);if(t.hasGlobal(e)!==!0)throw new Vt(null,It.ModuleExportNotFound,null);n=$i(t.global(e)),t.setGlobal(e,i==="++"?n+1:n-1)}return r===!1?n:i==="++"?n+1:n-1},assignmember(t,e,i,r){if(Vn(t)){if(!nl(e))throw new Vt(null,It.ArrayAccessorMustBeNumber,null);if(e<0&&(e=t.length+e),e<0||e>t.length)throw new Vt(null,It.OutOfBounds,null);if(e===t.length){if(i!=="=")throw new Vt(null,It.OutOfBounds,null);t[e]=this.assign(r,i,t[e])}else t[e]=this.assign(r,i,t[e])}else if(t instanceof hs){if(On(e)===!1)throw new Vt(null,It.KeyAccessorMustBeString,null);if(t.hasField(e)===!0)t.setField(e,this.assign(r,i,t.field(e)));else{if(i!=="=")throw new Vt(null,It.FieldNotFound,null);t.setField(e,this.assign(r,i,null))}}else if(wu(t)){if(On(e)===!1)throw new Vt(null,It.KeyAccessorMustBeString,null);if(t.hasField(e)===!0)t.setField(e,this.assign(r,i,t.field(e)));else{if(i!=="=")throw new Vt(null,It.FieldNotFound,null);t.setField(e,this.assign(r,i,null))}}else{if(Ds(t))throw new Vt(null,It.Immutable,null);if(!(t instanceof hJ))throw new Vt(null,It.InvalidIdentifier,null);if(On(e)===!1)throw new Vt(null,It.ModuleAccessorMustBeString,null);if(!t.hasGlobal(e))throw new Vt(null,It.ModuleExportNotFound,null);t.setGlobal(e,this.assign(r,i,t.global(e)))}},member(t,e){if(t===null)throw new Vt(null,It.MemberOfNull,null);if(t instanceof hs||wu(t)){if(On(e))return t.field(e);throw new Vt(null,It.InvalidMemberAccessKey,null)}if(t instanceof un){if(On(e))return Ok(t,e,null,null);throw new Vt(null,It.InvalidMemberAccessKey,null)}if(Vn(t)){if(nl(e)&&isFinite(e)&&Math.floor(e)===e){if(e<0&&(e=t.length+e),e>=t.length||e<0)throw new Vt(null,It.OutOfBounds,null);return t[e]}throw new Vt(null,It.InvalidMemberAccessKey,null)}if(On(t)){if(nl(e)&&isFinite(e)&&Math.floor(e)===e){if(e<0&&(e=t.length+e),e>=t.length||e<0)throw new Vt(null,It.OutOfBounds,null);return t[e]}throw new Vt(null,It.InvalidMemberAccessKey,null)}if(Ds(t)){if(nl(e)&&isFinite(e)&&Math.floor(e)===e){if(e<0&&(e=t.length()+e),e>=t.length()||e<0)throw new Vt(null,It.OutOfBounds,null);return t.get(e)}throw new Vt(null,It.InvalidMemberAccessKey,null)}if(t instanceof hJ){if(On(e))return t.global(e);throw new Vt(null,It.InvalidMemberAccessKey,null)}throw new Vt(null,It.InvalidMemberAccessKey,null)},callfunc:(t,e,i)=>t.call(i,{arguments:e,preparsed:!0}),loadModule(t,e){const i=e.moduleFactoryMap[t];if(e.moduleSingletons[i])return e.moduleSingletons[i];const r=e.moduleFactory[i]({vars:{},moduleSingletons:e.moduleSingletons,depthCounter:e.depthCounter,console:e.console,abortSignal:e.abortSignal,isAsync:e.isAsync,services:e.services,lrucache:e.lrucache,timeReference:e.timeReference?e.timeReference:null,interceptor:e.interceptor},e.spatialReference);return e.moduleSingletons[i]=r,r},callModuleFunction(t,e,i,r){if(!(t instanceof hJ))throw new Vt(null,It.FuncionNotFound,null);const n=t.global(i);if(mu(n)===!1)throw new Vt(null,It.CallNonFunction,null);return n.call(r,{preparsed:!0,arguments:e})}};function Lde(t){console.log(t)}function kft(t,e,i=!1){e===null&&(e={vars:{},customfunctions:{}});let r=null;t.usesModules&&(r=new Wj(null,t.loadedModules));const n={isAsync:i,globalScope:Fft(e.vars,i?qj:zm,e.customfunctions),moduleFactory:{},moduleFactoryMap:{},undeclaredGlobalsInFunctions:new Map,customfunctions:e.customfunctions,libraryResolver:r,localScope:null,mangleMap:{},depthCounter:{depth:1},exports:{},console:Lde,lrucache:e.lrucache,timeReference:e.timeReference??null,interceptor:e.interceptor,services:e.services,symbols:{symbolCounter:0}};let s=Ws(n,t);s===""&&(s="lc.voidOperation; "),n.undeclaredGlobalsInFunctions.size>0&&n.undeclaredGlobalsInFunctions.forEach(y=>{throw new x0(e,It.InvalidIdentifier,y.node)});let o="";o=i?`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* () { @@ -284,7 +288,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,c=n.exports,d={};for(const y in c)d[y]=n.mangleMap[y]!==void 0?n.mangleMap[y]:y;const p={lc:fpt,lang:Kpt,mangles:n.mangleMap,postProcess(y){if(y instanceof Kh&&(y=y.value),y instanceof iE&&(y=y.value),y===Xr&&(y=null),y===Wf)throw new Nt(null,Et.IllegalResult,null);if(y===rE)throw new Nt(null,Et.IllegalResult,null);if(au(y))throw new Nt(null,Et.IllegalResult,null);return y},prepare(y,v){let S=y.spatialReference;S==null&&(S=rr.WebMercator);const I=Xpt(y.vars,y.customfunctions,v,y.timeReference);return{localStack:[],isAsync:v,moduleFactory:a,moduleFactoryMap:l,mangleMap:this.mangles,moduleSingletons:{},exports:c,gdefs:{},exportmangle:d,spatialReference:S,globalScope:I,abortSignal:y.abortSignal===void 0||y.abortSignal===null?{aborted:!1}:y.abortSignal,localScope:null,services:y.services,console:y.console?y.console:cde,lrucache:y.lrucache,timeReference:y.timeReference??null,interceptor:y.interceptor,symbols:{symbolCounter:0},depthCounter:{depth:1}}}};return new Function("context","spatialReference",o).bind(p)}async function xPi(){return PN([await Promise.resolve().then(()=>F2r)],"async"),!0}let oJ=class extends YK{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,i){const r=this.moduleContext.globalScope,n=e.toLowerCase();if(au(i))throw new Nt(null,Et.AssignModuleFunction,null);r[this.moduleContext.exportmangle[n]]=i}global(e){const i=this.moduleContext.globalScope;e=e.toLowerCase();const r=i[this.moduleContext.exportmangle[e]];if(r===void 0)throw new Nt(null,Et.InvalidIdentifier,null);if(au(r)&&!(r instanceof zw)){const n=new zw;return n.fn=r,n.parameterEvaluator=qw,n.context=this.moduleContext,i[this.moduleContext.exportmangle[e]]=n,n}return r}};function SPi(t,e,i=!1){const r={isAsync:i,moduleFactory:e.moduleFactory,moduleFactoryMap:{},libraryResolver:new $V(null,t.loadedModules),globalScope:Ypt(e.vars,i?BV:Gm,e.customfunctions),customfunctions:e.customfunctions,localScope:null,mangleMap:{},undeclaredGlobalsInFunctions:new Map,depthCounter:{depth:1},exports:{},console:cde,lrucache:e.lrucache,timeReference:e.timeReference??null,interceptor:e.interceptor,services:e.services,symbols:{symbolCounter:0}};let n=Ls(r,t);n===""&&(n="lc.voidOperation; ");let s="";s=i?`var runtimeCtx=this.prepare(context, true); + return this.postProcess(mainBody()); `;const a=n.moduleFactory,l=n.moduleFactoryMap,c=n.exports,h={};for(const y in c)h[y]=n.mangleMap[y]!==void 0?n.mangleMap[y]:y;const p={lc:eft,lang:Nft,mangles:n.mangleMap,postProcess(y){if(y instanceof td&&(y=y.value),y instanceof nE&&(y=y.value),y===ln&&(y=null),y===Qf)throw new Vt(null,It.IllegalResult,null);if(y===sE)throw new Vt(null,It.IllegalResult,null);if(mu(y))throw new Vt(null,It.IllegalResult,null);return y},prepare(y,v){let x=y.spatialReference;x==null&&(x=hr.WebMercator);const I=Lft(y.vars,y.customfunctions,v,y.timeReference);return{localStack:[],isAsync:v,moduleFactory:a,moduleFactoryMap:l,mangleMap:this.mangles,moduleSingletons:{},exports:c,gdefs:{},exportmangle:h,spatialReference:x,globalScope:I,abortSignal:y.abortSignal===void 0||y.abortSignal===null?{aborted:!1}:y.abortSignal,localScope:null,services:y.services,console:y.console?y.console:Lde,lrucache:y.lrucache,timeReference:y.timeReference??null,interceptor:y.interceptor,symbols:{symbolCounter:0},depthCounter:{depth:1}}}};return new Function("context","spatialReference",o).bind(p)}async function AOi(){return Rk([await Promise.resolve().then(()=>bSr)],"async"),!0}let hJ=class extends QK{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,i){const r=this.moduleContext.globalScope,n=e.toLowerCase();if(mu(i))throw new Vt(null,It.AssignModuleFunction,null);r[this.moduleContext.exportmangle[n]]=i}global(e){const i=this.moduleContext.globalScope;e=e.toLowerCase();const r=i[this.moduleContext.exportmangle[e]];if(r===void 0)throw new Vt(null,It.InvalidIdentifier,null);if(mu(r)&&!(r instanceof Ww)){const n=new Ww;return n.fn=r,n.parameterEvaluator=Xw,n.context=this.moduleContext,i[this.moduleContext.exportmangle[e]]=n,n}return r}};function POi(t,e,i=!1){const r={isAsync:i,moduleFactory:e.moduleFactory,moduleFactoryMap:{},libraryResolver:new Wj(null,t.loadedModules),globalScope:Fft(e.vars,i?qj:zm,e.customfunctions),customfunctions:e.customfunctions,localScope:null,mangleMap:{},undeclaredGlobalsInFunctions:new Map,depthCounter:{depth:1},exports:{},console:Lde,lrucache:e.lrucache,timeReference:e.timeReference??null,interceptor:e.interceptor,services:e.services,symbols:{symbolCounter:0}};let n=Ws(r,t);n===""&&(n="lc.voidOperation; ");let s="";s=i?`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* () { @@ -301,246 +305,246 @@ 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,c={};for(const p in l)c[p]=r.mangleMap[p]!==void 0?r.mangleMap[p]:p;const d={lc:fpt,lang:Kpt,mangles:r.mangleMap,prepareModule:p=>new oJ(p),prepare(p,y){let v=p.spatialReference;v==null&&(v=new rr({wkid:102100}));const S=Xpt(p.vars,p.customfunctions,y,p.timeReference);return{localStack:[],isAsync:y,exports:l,exportmangle:c,gdefs:{},moduleFactory:o,moduleFactoryMap:a,moduleSingletons:p.moduleSingletons,mangleMap:this.mangles,spatialReference:v,globalScope:S,abortSignal:p.abortSignal===void 0||p.abortSignal===null?{aborted:!1}:p.abortSignal,localScope:null,services:p.services,console:p.console?p.console:cde,lrucache:p.lrucache,timeReference:p.timeReference??null,interceptor:p.interceptor,symbols:{symbolCounter:0},depthCounter:p.depthCounter}}};return new Function("context","spatialReference",s).bind(d)}var Pa,as;(function(t){t.Break="break",t.Continue="continue",t.Else="else",t.False="false",t.For="for",t.From="from",t.Function="function",t.If="if",t.Import="import",t.Export="export",t.In="in",t.Null="null",t.Return="return",t.True="true",t.Var="var",t.While="while"})(Pa||(Pa={})),function(t){t.AssignmentExpression="AssignmentExpression",t.ArrayExpression="ArrayExpression",t.BlockComment="BlockComment",t.BlockStatement="BlockStatement",t.BinaryExpression="BinaryExpression",t.BreakStatement="BreakStatement",t.CallExpression="CallExpression",t.ContinueStatement="ContinueStatement",t.EmptyStatement="EmptyStatement",t.ExpressionStatement="ExpressionStatement",t.ExportNamedDeclaration="ExportNamedDeclaration",t.ExportSpecifier="ExportSpecifier",t.ForStatement="ForStatement",t.ForInStatement="ForInStatement",t.FunctionDeclaration="FunctionDeclaration",t.Identifier="Identifier",t.IfStatement="IfStatement",t.ImportDeclaration="ImportDeclaration",t.ImportDefaultSpecifier="ImportDefaultSpecifier",t.LineComment="LineComment",t.Literal="Literal",t.LogicalExpression="LogicalExpression",t.MemberExpression="MemberExpression",t.ObjectExpression="ObjectExpression",t.Program="Program",t.Property="Property",t.ReturnStatement="ReturnStatement",t.TemplateElement="TemplateElement",t.TemplateLiteral="TemplateLiteral",t.UnaryExpression="UnaryExpression",t.UpdateExpression="UpdateExpression",t.VariableDeclaration="VariableDeclaration",t.VariableDeclarator="VariableDeclarator",t.WhileStatement="WhileStatement"}(as||(as={}));const qRe=["++","--"],Zpt=["-","+","!","~"],Qpt=["=","/=","*=","%=","+=","-="],eft=["||","&&"],CPi=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"],TPi={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10};var ps;(function(t){t[t.Unknown=0]="Unknown",t[t.BooleanLiteral=1]="BooleanLiteral",t[t.EOF=2]="EOF",t[t.Identifier=3]="Identifier",t[t.Keyword=4]="Keyword",t[t.NullLiteral=5]="NullLiteral",t[t.NumericLiteral=6]="NumericLiteral",t[t.Punctuator=7]="Punctuator",t[t.StringLiteral=8]="StringLiteral",t[t.Template=10]="Template"})(ps||(ps={}));const EPi=["Unknown","Boolean","","Identifier","Keyword","Null","Numeric","Punctuator","String","RegularExpression","Template"];var Xn;(function(t){t.InvalidModuleUri="InvalidModuleUri",t.ForInOfLoopInitializer="ForInOfLoopInitializer",t.IdentiferExpected="IdentiferExpected",t.InvalidEscapedReservedWord="InvalidEscapedReservedWord",t.InvalidExpression="InvalidExpression",t.InvalidFunctionIdentifier="InvalidFunctionIdentifier",t.InvalidHexEscapeSequence="InvalidHexEscapeSequence",t.InvalidLeftHandSideInAssignment="InvalidLeftHandSideInAssignment",t.InvalidLeftHandSideInForIn="InvalidLeftHandSideInForIn",t.InvalidTemplateHead="InvalidTemplateHead",t.InvalidVariableAssignment="InvalidVariableAssignment",t.KeyMustBeString="KeyMustBeString",t.NoFunctionInsideBlock="NoFunctionInsideBlock",t.NoFunctionInsideFunction="NoFunctionInsideFunction",t.ModuleExportRootOnly="ModuleExportRootOnly",t.ModuleImportRootOnly="ModuleImportRootOnly",t.PunctuatorExpected="PunctuatorExpected",t.TemplateOctalLiteral="TemplateOctalLiteral",t.UnexpectedBoolean="UnexpectedBoolean",t.UnexpectedEndOfScript="UnexpectedEndOfScript",t.UnexpectedIdentifier="UnexpectedIdentifier",t.UnexpectedKeyword="UnexpectedKeyword",t.UnexpectedNull="UnexpectedNull",t.UnexpectedNumber="UnexpectedNumber",t.UnexpectedPunctuator="UnexpectedPunctuator",t.UnexpectedString="UnexpectedString",t.UnexpectedTemplate="UnexpectedTemplate",t.UnexpectedToken="UnexpectedToken"})(Xn||(Xn={}));const IPi={[Xn.InvalidModuleUri]:"Module uri must be a text literal.",[Xn.ForInOfLoopInitializer]:"for-in loop variable declaration may not have an initializer.",[Xn.IdentiferExpected]:"'${value}' is an invalid identifier.",[Xn.InvalidEscapedReservedWord]:"Keyword cannot contain escaped characters.",[Xn.InvalidExpression]:"Invalid expression.",[Xn.InvalidFunctionIdentifier]:"'${value}' is an invalid function identifier.",[Xn.InvalidHexEscapeSequence]:"Invalid hexadecimal escape sequence.",[Xn.InvalidLeftHandSideInAssignment]:"Invalid left-hand side in assignment.",[Xn.InvalidLeftHandSideInForIn]:"Invalid left-hand side in for-in.",[Xn.InvalidTemplateHead]:"Invalid template structure.",[Xn.InvalidVariableAssignment]:"Invalid variable assignment.",[Xn.KeyMustBeString]:"Object property keys must be a word starting with a letter.",[Xn.NoFunctionInsideBlock]:"Functions cannot be declared inside of code blocks.",[Xn.NoFunctionInsideFunction]:"Functions cannot be declared inside another function.",[Xn.ModuleExportRootOnly]:"Module exports cannot be declared inside of code blocks.",[Xn.ModuleImportRootOnly]:"Module import cannot be declared inside of code blocks.",[Xn.PunctuatorExpected]:"'${value}' expected.",[Xn.TemplateOctalLiteral]:"Octal literals are not allowed in template literals.",[Xn.UnexpectedBoolean]:"Unexpected boolean literal.",[Xn.UnexpectedEndOfScript]:"Unexpected end of Arcade expression.",[Xn.UnexpectedIdentifier]:"Unexpected identifier.",[Xn.UnexpectedKeyword]:"Unexpected keyword.",[Xn.UnexpectedNull]:"Unexpected null literal.",[Xn.UnexpectedNumber]:"Unexpected number.",[Xn.UnexpectedPunctuator]:"Unexpected ponctuator.",[Xn.UnexpectedString]:"Unexpected text literal.",[Xn.UnexpectedTemplate]:"Unexpected quasi '${value}'.",[Xn.UnexpectedToken]:"Unexpected token '${value}'."};let ON=class VLt extends Error{constructor({code:e,index:i,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=i,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,VLt)}};function APi(t){return t?.type===as.Program}function tft(t){return t?.type===as.BlockStatement}function PPi(t){return t?.type===as.BlockComment}function OPi(t){return t?.type===as.EmptyStatement}function RPi(t){return t?.type===as.VariableDeclarator}function YRe(t,e){return!!e&&e.loc.end.line===t.loc.start.line&&e.loc.end.column<=t.loc.start.column}function ift(t,e){return t.range[0]>=e.range[0]&&t.range[1]<=e.range[1]}let MPi=class{constructor(){this.comments=[],this._nodeStack=[],this._newComments=[]}insertInnerComments(e){if(!tft(e)||e.body.length!==0)return;const i=[];for(let r=this._newComments.length-1;r>=0;--r){const n=this._newComments[r];e.range[1]>=n.range[0]&&(i.unshift(n),this._newComments.splice(r,1))}i.length&&(e.innerComments=i)}attachTrailingComments(e){if(!e)return;const i=this._nodeStack[this._nodeStack.length-1];if(tft(e)&&ift(i,e))for(let n=this._newComments.length-1;n>=0;--n){const s=this._newComments[n];ift(s,e)&&(i.trailingComments=[...i.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];YRe(s,i)?(i.trailingComments=[...i.trailingComments??[],s],this._newComments.splice(n,1)):YRe(s,e)&&(r.unshift(s),this._newComments.splice(n,1))}i?.trailingComments&&YRe(i.trailingComments[0],e)&&(r=[...r,...i.trailingComments],delete i.trailingComments),r.length>0&&(e.trailingComments=r)}attachLeadingComments(e){if(!e)return;let i;for(;this._nodeStack.length>0;){const s=this._nodeStack[this._nodeStack.length-1];if(!(e.range[0]<=s.range[0]))break;i=s,this._nodeStack.pop()}const r=[],n=[];if(i){for(let s=(i.leadingComments?.length??0)-1;s>=0;--s){const o=i.leadingComments[s];e.range[0]>=o.range[1]?(r.unshift(o),i.leadingComments.splice(s,1)):RPi(e)&&!PPi(o)&&(n.unshift(o),i.leadingComments.splice(s,1))}return i.leadingComments?.length===0&&delete i.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(APi(e)&&e.body.length>0){const i=this._nodeStack[this._nodeStack.length-1];return i?(i.trailingComments=[...i.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 XRe(t,e){const i=IPi[t];return e?i.replace(/\${(.*?)}/g,(r,n)=>e[n]?.toString()??""):i}let DPi=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??XRe(e.code,e.data),new ON(e)}tolerateError(e){e.description=e.description??XRe(e.code,e.data);const i=new ON(e);if(!this.tolerant)throw i;this.recordError(i)}};function rft(t,e){if(!t)throw new Error("ASSERT: "+e)}const nft={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]/},ll={fromCodePoint:t=>t<65536?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10))+String.fromCharCode(56320+(t-65536&1023)),isWhiteSpace:t=>t===32||t===9||t===11||t===12||t===160||t>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t),isLineTerminator:t=>t===10||t===13||t===8232||t===8233,isIdentifierStart:t=>t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t===92||t>=128&&nft.NonAsciiIdentifierStart.test(ll.fromCodePoint(t)),isIdentifierPart:t=>t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t===92||t>=128&&nft.NonAsciiIdentifierPart.test(ll.fromCodePoint(t)),isDecimalDigit:t=>t>=48&&t<=57,isHexDigit:t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102,isOctalDigit:t=>t>=48&&t<=55};function sft(t){return"0123456789abcdef".indexOf(t.toLowerCase())}function KRe(t){return"01234567".indexOf(t)}const RN=[[],[],[]];qRe.forEach(t=>RN[t.length-1].push(t)),Zpt.forEach(t=>RN[t.length-1].push(t)),eft.forEach(t=>RN[t.length-1].push(t)),Qpt.forEach(t=>RN[t.length-1].push(t)),CPi.forEach(t=>RN[t.length-1].push(t));let FPi=class{constructor(e,i){this.source=e,this.errorHandler=i,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=Xn.UnexpectedToken){this.errorHandler.throwError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}tolerateUnexpectedToken(e=Xn.UnexpectedToken){this.errorHandler.tolerateError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}skipSingleLineComment(e){const i=[],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,ll.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};i.push(o)}return s===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,i}}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};i.push(s)}return i}skipMultiLineComment(){const e=[],i=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(ll.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:i+2,end:this.index-2,range:[i,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:i+2,end:this.index,range:[i,this.index],loc:r};e.push(n)}return this.tolerateUnexpectedToken(),e}scanComments(){let e=[];for(;!this.eof();){let i=this.source.charCodeAt(this.index);if(ll.isWhiteSpace(i))++this.index;else if(ll.isLineTerminator(i))++this.index,i===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index;else{if(i!==47)break;if(i=this.source.charCodeAt(this.index+1),i===47){this.index+=2;const r=this.skipSingleLineComment(2);e=[...e,...r]}else{if(i!==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===Pa.If||e===Pa.In;case 3:return e===Pa.Var||e===Pa.For;case 4:return e===Pa.Else;case 5:return e===Pa.Break||e===Pa.While;case 6:return e===Pa.Return||e===Pa.Import||e===Pa.Export;case 8:return e===Pa.Function||e===Pa.Continue;default:return!1}}codePointAt(e){let i=this.source.charCodeAt(e);if(i>=55296&&i<=56319){const r=this.source.charCodeAt(e+1);r>=56320&&r<=57343&&(i=1024*(i-55296)+r-56320+65536)}return i}scanHexEscape(e){const i=e==="u"?4:2;let r=0;for(let n=0;n1114111||e!=="}")&&this.throwUnexpectedToken(),ll.fromCodePoint(i)}getIdentifier(){const e=this.index++;for(;!this.eof();){const i=this.source.charCodeAt(this.index);if(i===92)return this.index=e,this.getComplexIdentifier();if(i>=55296&&i<57343)return this.index=e,this.getComplexIdentifier();if(!ll.isIdentifierPart(i))break;++this.index}return this.source.slice(e,this.index)}getComplexIdentifier(){let e,i=this.codePointAt(this.index),r=ll.fromCodePoint(i);for(this.index+=r.length,i===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!=="\\"&&ll.isIdentifierStart(e.charCodeAt(0))||this.throwUnexpectedToken()),r=e);!this.eof()&&(i=this.codePointAt(this.index),ll.isIdentifierPart(i));)e=ll.fromCodePoint(i),r+=e,this.index+=e.length,i===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!=="\\"&&ll.isIdentifierPart(e.charCodeAt(0))||this.throwUnexpectedToken()),r+=e);return r}octalToDecimal(e){let i=e!=="0",r=KRe(e);return!this.eof()&&ll.isOctalDigit(this.source.charCodeAt(this.index))&&(i=!0,r=8*r+KRe(this.source[this.index++]),"0123".includes(e)&&!this.eof()&&ll.isOctalDigit(this.source.charCodeAt(this.index))&&(r=8*r+KRe(this.source[this.index++]))),{code:r,octal:i}}scanIdentifier(){let e;const i=this.index,r=this.source.charCodeAt(i)===92?this.getComplexIdentifier():this.getIdentifier();if(e=r.length===1?ps.Identifier:this.isKeyword(r)?ps.Keyword:r.toLowerCase()===Pa.Null?ps.NullLiteral:r.toLowerCase()===Pa.True||r.toLowerCase()===Pa.False?ps.BooleanLiteral:ps.Identifier,e!==ps.Identifier&&i+r.length!==this.index){const n=this.index;this.index=i,this.tolerateUnexpectedToken(Xn.InvalidEscapedReservedWord),this.index=n}return{type:e,value:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:i,end:this.index}}scanPunctuator(){const e=this.index;let i=this.source[this.index];switch(i){case"(":case"{":i==="{"&&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=RN.length;r>0;r--)if(i=this.source.substring(this.index,this.index+r),RN[r-1].includes(i)){this.index+=r;break}}return this.index===e&&this.throwUnexpectedToken(),{type:ps.Punctuator,value:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanHexLiteral(e){let i="";for(;!this.eof()&&ll.isHexDigit(this.source.charCodeAt(this.index));)i+=this.source[this.index++];return i.length===0&&this.throwUnexpectedToken(),ll.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:ps.NumericLiteral,value:parseInt("0x"+i,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanBinaryLiteral(e){let i="";for(;!this.eof();){const r=this.source[this.index];if(r!=="0"&&r!=="1")break;i+=this.source[this.index++]}if(i.length===0&&this.throwUnexpectedToken(),!this.eof()){const r=this.source.charCodeAt(this.index);(ll.isIdentifierStart(r)||ll.isDecimalDigit(r))&&this.throwUnexpectedToken()}return{type:ps.NumericLiteral,value:parseInt(i,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanOctalLiteral(e,i){let r="",n=!1;for(ll.isOctalDigit(e.charCodeAt(0))?(n=!0,r="0"+this.source[this.index++]):++this.index;!this.eof()&&ll.isOctalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];return n||r.length!==0||this.throwUnexpectedToken(),(ll.isIdentifierStart(this.source.charCodeAt(this.index))||ll.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:ps.NumericLiteral,value:parseInt(r,8),lineNumber:this.lineNumber,lineStart:this.lineStart,start:i,end:this.index}}scanNumericLiteral(){const e=this.index;let i=this.source[e];rft(ll.isDecimalDigit(i.charCodeAt(0))||i===".","Numeric literal must start with a decimal digit or a decimal point");let r="";if(i!=="."){if(r=this.source[this.index++],i=this.source[this.index],r==="0"){if(i==="x"||i==="X")return++this.index,this.scanHexLiteral(e);if(i==="b"||i==="B")return++this.index,this.scanBinaryLiteral(e);if(i==="o"||i==="O")return this.scanOctalLiteral(i,e)}for(;ll.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];i=this.source[this.index]}if(i==="."){for(r+=this.source[this.index++];ll.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];i=this.source[this.index]}if(i==="e"||i==="E")if(r+=this.source[this.index++],i=this.source[this.index],i!=="+"&&i!=="-"||(r+=this.source[this.index++]),ll.isDecimalDigit(this.source.charCodeAt(this.index)))for(;ll.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];else this.throwUnexpectedToken();return ll.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:ps.NumericLiteral,value:parseFloat(r),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanStringLiteral(){const e=this.index;let i=this.source[e];rft(i==="'"||i==='"',"String literal must starts with a quote"),++this.index;let r=!1,n="";for(;!this.eof();){let s=this.source[this.index++];if(s===i){i="";break}if(s==="\\")if(s=this.source[this.index++],s&&ll.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(Xn.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&&ll.isOctalDigit(s.charCodeAt(0))){const o=this.octalToDecimal(s);r=o.octal||r,n+=String.fromCharCode(o.code)}else n+=s}else{if(ll.isLineTerminator(s.charCodeAt(0)))break;n+=s}}return i!==""&&(this.index=e,this.throwUnexpectedToken()),{type:ps.StringLiteral,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanTemplate(){let e="",i=!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,i=!0;break}if(a!=="$")if(a!=="\\")ll.isLineTerminator(a.charCodeAt(0))?(++this.lineNumber,a==="\r"&&this.source[this.index]===` + return this.prepareModule(runtimeCtx); `;const o=r.moduleFactory,a=r.moduleFactoryMap,l=r.exports,c={};for(const p in l)c[p]=r.mangleMap[p]!==void 0?r.mangleMap[p]:p;const h={lc:eft,lang:Nft,mangles:r.mangleMap,prepareModule:p=>new hJ(p),prepare(p,y){let v=p.spatialReference;v==null&&(v=new hr({wkid:102100}));const x=Lft(p.vars,p.customfunctions,y,p.timeReference);return{localStack:[],isAsync:y,exports:l,exportmangle:c,gdefs:{},moduleFactory:o,moduleFactoryMap:a,moduleSingletons:p.moduleSingletons,mangleMap:this.mangles,spatialReference:v,globalScope:x,abortSignal:p.abortSignal===void 0||p.abortSignal===null?{aborted:!1}:p.abortSignal,localScope:null,services:p.services,console:p.console?p.console:Lde,lrucache:p.lrucache,timeReference:p.timeReference??null,interceptor:p.interceptor,symbols:{symbolCounter:0},depthCounter:p.depthCounter}}};return new Function("context","spatialReference",s).bind(h)}var $a,_s;(function(t){t.Break="break",t.Continue="continue",t.Else="else",t.False="false",t.For="for",t.From="from",t.Function="function",t.If="if",t.Import="import",t.Export="export",t.In="in",t.Null="null",t.Return="return",t.True="true",t.Var="var",t.While="while"})($a||($a={})),function(t){t.AssignmentExpression="AssignmentExpression",t.ArrayExpression="ArrayExpression",t.BlockComment="BlockComment",t.BlockStatement="BlockStatement",t.BinaryExpression="BinaryExpression",t.BreakStatement="BreakStatement",t.CallExpression="CallExpression",t.ContinueStatement="ContinueStatement",t.EmptyStatement="EmptyStatement",t.ExpressionStatement="ExpressionStatement",t.ExportNamedDeclaration="ExportNamedDeclaration",t.ExportSpecifier="ExportSpecifier",t.ForStatement="ForStatement",t.ForInStatement="ForInStatement",t.FunctionDeclaration="FunctionDeclaration",t.Identifier="Identifier",t.IfStatement="IfStatement",t.ImportDeclaration="ImportDeclaration",t.ImportDefaultSpecifier="ImportDefaultSpecifier",t.LineComment="LineComment",t.Literal="Literal",t.LogicalExpression="LogicalExpression",t.MemberExpression="MemberExpression",t.ObjectExpression="ObjectExpression",t.Program="Program",t.Property="Property",t.ReturnStatement="ReturnStatement",t.TemplateElement="TemplateElement",t.TemplateLiteral="TemplateLiteral",t.UnaryExpression="UnaryExpression",t.UpdateExpression="UpdateExpression",t.VariableDeclaration="VariableDeclaration",t.VariableDeclarator="VariableDeclarator",t.WhileStatement="WhileStatement"}(_s||(_s={}));const gMe=["++","--"],$ft=["-","+","!","~"],Bft=["=","/=","*=","%=","+=","-="],Vft=["||","&&"],OOi=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"],ROi={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10};var Ps;(function(t){t[t.Unknown=0]="Unknown",t[t.BooleanLiteral=1]="BooleanLiteral",t[t.EOF=2]="EOF",t[t.Identifier=3]="Identifier",t[t.Keyword=4]="Keyword",t[t.NullLiteral=5]="NullLiteral",t[t.NumericLiteral=6]="NumericLiteral",t[t.Punctuator=7]="Punctuator",t[t.StringLiteral=8]="StringLiteral",t[t.Template=10]="Template"})(Ps||(Ps={}));const MOi=["Unknown","Boolean","","Identifier","Keyword","Null","Numeric","Punctuator","String","RegularExpression","Template"];var us;(function(t){t.InvalidModuleUri="InvalidModuleUri",t.ForInOfLoopInitializer="ForInOfLoopInitializer",t.IdentiferExpected="IdentiferExpected",t.InvalidEscapedReservedWord="InvalidEscapedReservedWord",t.InvalidExpression="InvalidExpression",t.InvalidFunctionIdentifier="InvalidFunctionIdentifier",t.InvalidHexEscapeSequence="InvalidHexEscapeSequence",t.InvalidLeftHandSideInAssignment="InvalidLeftHandSideInAssignment",t.InvalidLeftHandSideInForIn="InvalidLeftHandSideInForIn",t.InvalidTemplateHead="InvalidTemplateHead",t.InvalidVariableAssignment="InvalidVariableAssignment",t.KeyMustBeString="KeyMustBeString",t.NoFunctionInsideBlock="NoFunctionInsideBlock",t.NoFunctionInsideFunction="NoFunctionInsideFunction",t.ModuleExportRootOnly="ModuleExportRootOnly",t.ModuleImportRootOnly="ModuleImportRootOnly",t.PunctuatorExpected="PunctuatorExpected",t.TemplateOctalLiteral="TemplateOctalLiteral",t.UnexpectedBoolean="UnexpectedBoolean",t.UnexpectedEndOfScript="UnexpectedEndOfScript",t.UnexpectedIdentifier="UnexpectedIdentifier",t.UnexpectedKeyword="UnexpectedKeyword",t.UnexpectedNull="UnexpectedNull",t.UnexpectedNumber="UnexpectedNumber",t.UnexpectedPunctuator="UnexpectedPunctuator",t.UnexpectedString="UnexpectedString",t.UnexpectedTemplate="UnexpectedTemplate",t.UnexpectedToken="UnexpectedToken"})(us||(us={}));const DOi={[us.InvalidModuleUri]:"Module uri must be a text literal.",[us.ForInOfLoopInitializer]:"for-in loop variable declaration may not have an initializer.",[us.IdentiferExpected]:"'${value}' is an invalid identifier.",[us.InvalidEscapedReservedWord]:"Keyword cannot contain escaped characters.",[us.InvalidExpression]:"Invalid expression.",[us.InvalidFunctionIdentifier]:"'${value}' is an invalid function identifier.",[us.InvalidHexEscapeSequence]:"Invalid hexadecimal escape sequence.",[us.InvalidLeftHandSideInAssignment]:"Invalid left-hand side in assignment.",[us.InvalidLeftHandSideInForIn]:"Invalid left-hand side in for-in.",[us.InvalidTemplateHead]:"Invalid template structure.",[us.InvalidVariableAssignment]:"Invalid variable assignment.",[us.KeyMustBeString]:"Object property keys must be a word starting with a letter.",[us.NoFunctionInsideBlock]:"Functions cannot be declared inside of code blocks.",[us.NoFunctionInsideFunction]:"Functions cannot be declared inside another function.",[us.ModuleExportRootOnly]:"Module exports cannot be declared inside of code blocks.",[us.ModuleImportRootOnly]:"Module import cannot be declared inside of code blocks.",[us.PunctuatorExpected]:"'${value}' expected.",[us.TemplateOctalLiteral]:"Octal literals are not allowed in template literals.",[us.UnexpectedBoolean]:"Unexpected boolean literal.",[us.UnexpectedEndOfScript]:"Unexpected end of Arcade expression.",[us.UnexpectedIdentifier]:"Unexpected identifier.",[us.UnexpectedKeyword]:"Unexpected keyword.",[us.UnexpectedNull]:"Unexpected null literal.",[us.UnexpectedNumber]:"Unexpected number.",[us.UnexpectedPunctuator]:"Unexpected ponctuator.",[us.UnexpectedString]:"Unexpected text literal.",[us.UnexpectedTemplate]:"Unexpected quasi '${value}'.",[us.UnexpectedToken]:"Unexpected token '${value}'."};let Mk=class h5t extends Error{constructor({code:e,index:i,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=i,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,h5t)}};function FOi(t){return t?.type===_s.Program}function jft(t){return t?.type===_s.BlockStatement}function LOi(t){return t?.type===_s.BlockComment}function NOi(t){return t?.type===_s.EmptyStatement}function kOi(t){return t?.type===_s.VariableDeclarator}function yMe(t,e){return!!e&&e.loc.end.line===t.loc.start.line&&e.loc.end.column<=t.loc.start.column}function Gft(t,e){return t.range[0]>=e.range[0]&&t.range[1]<=e.range[1]}let $Oi=class{constructor(){this.comments=[],this._nodeStack=[],this._newComments=[]}insertInnerComments(e){if(!jft(e)||e.body.length!==0)return;const i=[];for(let r=this._newComments.length-1;r>=0;--r){const n=this._newComments[r];e.range[1]>=n.range[0]&&(i.unshift(n),this._newComments.splice(r,1))}i.length&&(e.innerComments=i)}attachTrailingComments(e){if(!e)return;const i=this._nodeStack[this._nodeStack.length-1];if(jft(e)&&Gft(i,e))for(let n=this._newComments.length-1;n>=0;--n){const s=this._newComments[n];Gft(s,e)&&(i.trailingComments=[...i.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];yMe(s,i)?(i.trailingComments=[...i.trailingComments??[],s],this._newComments.splice(n,1)):yMe(s,e)&&(r.unshift(s),this._newComments.splice(n,1))}i?.trailingComments&&yMe(i.trailingComments[0],e)&&(r=[...r,...i.trailingComments],delete i.trailingComments),r.length>0&&(e.trailingComments=r)}attachLeadingComments(e){if(!e)return;let i;for(;this._nodeStack.length>0;){const s=this._nodeStack[this._nodeStack.length-1];if(!(e.range[0]<=s.range[0]))break;i=s,this._nodeStack.pop()}const r=[],n=[];if(i){for(let s=(i.leadingComments?.length??0)-1;s>=0;--s){const o=i.leadingComments[s];e.range[0]>=o.range[1]?(r.unshift(o),i.leadingComments.splice(s,1)):kOi(e)&&!LOi(o)&&(n.unshift(o),i.leadingComments.splice(s,1))}return i.leadingComments?.length===0&&delete i.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(FOi(e)&&e.body.length>0){const i=this._nodeStack[this._nodeStack.length-1];return i?(i.trailingComments=[...i.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 vMe(t,e){const i=DOi[t];return e?i.replace(/\${(.*?)}/g,(r,n)=>e[n]?.toString()??""):i}let BOi=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??vMe(e.code,e.data),new Mk(e)}tolerateError(e){e.description=e.description??vMe(e.code,e.data);const i=new Mk(e);if(!this.tolerant)throw i;this.recordError(i)}};function Uft(t,e){if(!t)throw new Error("ASSERT: "+e)}const zft={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:t=>t<65536?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10))+String.fromCharCode(56320+(t-65536&1023)),isWhiteSpace:t=>t===32||t===9||t===11||t===12||t===160||t>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t),isLineTerminator:t=>t===10||t===13||t===8232||t===8233,isIdentifierStart:t=>t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t===92||t>=128&&zft.NonAsciiIdentifierStart.test(yl.fromCodePoint(t)),isIdentifierPart:t=>t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t===92||t>=128&&zft.NonAsciiIdentifierPart.test(yl.fromCodePoint(t)),isDecimalDigit:t=>t>=48&&t<=57,isHexDigit:t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102,isOctalDigit:t=>t>=48&&t<=55};function Hft(t){return"0123456789abcdef".indexOf(t.toLowerCase())}function _Me(t){return"01234567".indexOf(t)}const Dk=[[],[],[]];gMe.forEach(t=>Dk[t.length-1].push(t)),$ft.forEach(t=>Dk[t.length-1].push(t)),Vft.forEach(t=>Dk[t.length-1].push(t)),Bft.forEach(t=>Dk[t.length-1].push(t)),OOi.forEach(t=>Dk[t.length-1].push(t));let VOi=class{constructor(e,i){this.source=e,this.errorHandler=i,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=us.UnexpectedToken){this.errorHandler.throwError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}tolerateUnexpectedToken(e=us.UnexpectedToken){this.errorHandler.tolerateError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}skipSingleLineComment(e){const i=[],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};i.push(o)}return s===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,i}}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};i.push(s)}return i}skipMultiLineComment(){const e=[],i=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:i+2,end:this.index-2,range:[i,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:i+2,end:this.index,range:[i,this.index],loc:r};e.push(n)}return this.tolerateUnexpectedToken(),e}scanComments(){let e=[];for(;!this.eof();){let i=this.source.charCodeAt(this.index);if(yl.isWhiteSpace(i))++this.index;else if(yl.isLineTerminator(i))++this.index,i===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index;else{if(i!==47)break;if(i=this.source.charCodeAt(this.index+1),i===47){this.index+=2;const r=this.skipSingleLineComment(2);e=[...e,...r]}else{if(i!==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===$a.If||e===$a.In;case 3:return e===$a.Var||e===$a.For;case 4:return e===$a.Else;case 5:return e===$a.Break||e===$a.While;case 6:return e===$a.Return||e===$a.Import||e===$a.Export;case 8:return e===$a.Function||e===$a.Continue;default:return!1}}codePointAt(e){let i=this.source.charCodeAt(e);if(i>=55296&&i<=56319){const r=this.source.charCodeAt(e+1);r>=56320&&r<=57343&&(i=1024*(i-55296)+r-56320+65536)}return i}scanHexEscape(e){const i=e==="u"?4:2;let r=0;for(let n=0;n1114111||e!=="}")&&this.throwUnexpectedToken(),yl.fromCodePoint(i)}getIdentifier(){const e=this.index++;for(;!this.eof();){const i=this.source.charCodeAt(this.index);if(i===92)return this.index=e,this.getComplexIdentifier();if(i>=55296&&i<57343)return this.index=e,this.getComplexIdentifier();if(!yl.isIdentifierPart(i))break;++this.index}return this.source.slice(e,this.index)}getComplexIdentifier(){let e,i=this.codePointAt(this.index),r=yl.fromCodePoint(i);for(this.index+=r.length,i===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()&&(i=this.codePointAt(this.index),yl.isIdentifierPart(i));)e=yl.fromCodePoint(i),r+=e,this.index+=e.length,i===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 i=e!=="0",r=_Me(e);return!this.eof()&&yl.isOctalDigit(this.source.charCodeAt(this.index))&&(i=!0,r=8*r+_Me(this.source[this.index++]),"0123".includes(e)&&!this.eof()&&yl.isOctalDigit(this.source.charCodeAt(this.index))&&(r=8*r+_Me(this.source[this.index++]))),{code:r,octal:i}}scanIdentifier(){let e;const i=this.index,r=this.source.charCodeAt(i)===92?this.getComplexIdentifier():this.getIdentifier();if(e=r.length===1?Ps.Identifier:this.isKeyword(r)?Ps.Keyword:r.toLowerCase()===$a.Null?Ps.NullLiteral:r.toLowerCase()===$a.True||r.toLowerCase()===$a.False?Ps.BooleanLiteral:Ps.Identifier,e!==Ps.Identifier&&i+r.length!==this.index){const n=this.index;this.index=i,this.tolerateUnexpectedToken(us.InvalidEscapedReservedWord),this.index=n}return{type:e,value:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:i,end:this.index}}scanPunctuator(){const e=this.index;let i=this.source[this.index];switch(i){case"(":case"{":i==="{"&&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=Dk.length;r>0;r--)if(i=this.source.substring(this.index,this.index+r),Dk[r-1].includes(i)){this.index+=r;break}}return this.index===e&&this.throwUnexpectedToken(),{type:Ps.Punctuator,value:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanHexLiteral(e){let i="";for(;!this.eof()&&yl.isHexDigit(this.source.charCodeAt(this.index));)i+=this.source[this.index++];return i.length===0&&this.throwUnexpectedToken(),yl.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:Ps.NumericLiteral,value:parseInt("0x"+i,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanBinaryLiteral(e){let i="";for(;!this.eof();){const r=this.source[this.index];if(r!=="0"&&r!=="1")break;i+=this.source[this.index++]}if(i.length===0&&this.throwUnexpectedToken(),!this.eof()){const r=this.source.charCodeAt(this.index);(yl.isIdentifierStart(r)||yl.isDecimalDigit(r))&&this.throwUnexpectedToken()}return{type:Ps.NumericLiteral,value:parseInt(i,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanOctalLiteral(e,i){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:Ps.NumericLiteral,value:parseInt(r,8),lineNumber:this.lineNumber,lineStart:this.lineStart,start:i,end:this.index}}scanNumericLiteral(){const e=this.index;let i=this.source[e];Uft(yl.isDecimalDigit(i.charCodeAt(0))||i===".","Numeric literal must start with a decimal digit or a decimal point");let r="";if(i!=="."){if(r=this.source[this.index++],i=this.source[this.index],r==="0"){if(i==="x"||i==="X")return++this.index,this.scanHexLiteral(e);if(i==="b"||i==="B")return++this.index,this.scanBinaryLiteral(e);if(i==="o"||i==="O")return this.scanOctalLiteral(i,e)}for(;yl.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];i=this.source[this.index]}if(i==="."){for(r+=this.source[this.index++];yl.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];i=this.source[this.index]}if(i==="e"||i==="E")if(r+=this.source[this.index++],i=this.source[this.index],i!=="+"&&i!=="-"||(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:Ps.NumericLiteral,value:parseFloat(r),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanStringLiteral(){const e=this.index;let i=this.source[e];Uft(i==="'"||i==='"',"String literal must starts with a quote"),++this.index;let r=!1,n="";for(;!this.eof();){let s=this.source[this.index++];if(s===i){i="";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(us.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 i!==""&&(this.index=e,this.throwUnexpectedToken()),{type:Ps.StringLiteral,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanTemplate(){let e="",i=!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,i=!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++],ll.isLineTerminator(a.charCodeAt(0)))++this.lineNumber,a==="\r"&&this.source[this.index]===` +`):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,c=this.scanHexEscape(a);c!==null?e+=c:(this.index=l,e+=a)}break;case"x":{const l=this.scanHexEscape(a);l===null&&this.throwUnexpectedToken(Xn.InvalidHexEscapeSequence),e+=l;break}case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:a==="0"?(ll.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(Xn.TemplateOctalLiteral),e+="\0"):ll.isOctalDigit(a.charCodeAt(0))?this.throwUnexpectedToken(Xn.TemplateOctalLiteral):e+=a}else{if(this.source[this.index]==="{"){this.curlyStack.push("${"),++this.index,i=!0;break}e+=a}}return i||this.throwUnexpectedToken(),n||this.curlyStack.pop(),{type:ps.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:ps.EOF,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};const e=this.source.charCodeAt(this.index);return ll.isIdentifierStart(e)?this.scanIdentifier():e===40||e===41||e===59?this.scanPunctuator():e===39||e===34?this.scanStringLiteral():e===46?ll.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():ll.isDecimalDigit(e)?this.scanNumericLiteral():e===96||e===125&&this.curlyStack[this.curlyStack.length-1]==="${"?this.scanTemplate():e>=55296&&e<57343&&ll.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()}};var vv,aJ;function oft(t,e=0){let i=t.start-t.lineStart,r=t.lineNumber;return i<0&&(i+=e,r--),{index:t.start,line:r,column:i}}function aft(t){return[{index:t.range[0],...t.loc.start},{index:t.range[1],...t.loc.end}]}function lft(t){return TPi[t]??0}(function(t){t[t.None=0]="None",t[t.Function=1]="Function",t[t.IfClause=2]="IfClause",t[t.ForLoop=4]="ForLoop",t[t.WhileLoop=8]="WhileLoop"})(vv||(vv={})),function(t){t[t.AsObject=0]="AsObject",t[t.Automatic=1]="Automatic"}(aJ||(aJ={}));let LPi=class{constructor(e,i={},r){this.delegate=r,this.hasLineTerminator=!1,this.options={tokens:typeof i.tokens=="boolean"&&i.tokens,comments:typeof i.comments=="boolean"&&i.comments,tolerant:typeof i.tolerant=="boolean"&&i.tolerant},this.options.comments&&(this.commentHandler=new MPi),this.errorHandler=new DPi(this.options.tolerant),this.scanner=new FPi(e,this.errorHandler),this.context={isAssignmentTarget:!1,blockContext:vv.None,curlyParsingType:aJ.AsObject},this.rawToken={type:ps.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,i,{validTypes:r,invalidTypes:n}){r?.some(s=>e.type===s)||n?.some(s=>e.type===s)&&this.throwError(Xn.InvalidExpression,i)}throwError(e,i,r=this.endMarker){const{index:n,line:s,column:o}=i,a=r.index-n-1;this.errorHandler.throwError({code:e,index:n,line:s,column:o+1,len:a})}tolerateError(e,i){throw new Error("######################################### !!!")}unexpectedTokenError(e={}){const{rawToken:i}=e;let r,{code:n,data:s}=e;if(i){if(!n)switch(i.type){case ps.EOF:n=Xn.UnexpectedEndOfScript;break;case ps.Identifier:n=Xn.UnexpectedIdentifier;break;case ps.NumericLiteral:n=Xn.UnexpectedNumber;break;case ps.StringLiteral:n=Xn.UnexpectedString;break;case ps.Template:n=Xn.UnexpectedTemplate}r=i.value.toString()}else r="ILLEGAL";n=n??Xn.UnexpectedToken,s||(s={value:r});const o=XRe(n,s);if(i){const c=i.start,d=i.lineNumber,p=i.start-i.lineStart+1;return new ON({code:n,index:c,line:d,column:p,len:i.end-i.start-1,data:s,description:o})}const{index:a,line:l}=this.endMarker;return new ON({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:i}=this;i&&e.length&&e.forEach(r=>{const n={type:r.multiLine?as.BlockComment:as.LineComment,value:this.getSourceValue(r),range:r.range,loc:r.loc};i.collectComment(n)})}peekAhead(e){const i=()=>(this.scanner.scanComments(),this.scanner.lex()),r=this.scanner.saveState(),n=e.call(this,i);return this.scanner.restoreState(r),n}getSourceValue(e){return this.scanner.source.slice(e.start,e.end)}convertToToken(e){return{type:EPi[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!==ps.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 i=this.rawToken;this.matchPunctuator(e)?this.readNextRawToken():this.throwUnexpectedToken({rawToken:i,code:Xn.PunctuatorExpected,data:{value:e}})}expectKeyword(e){this.rawToken.type!==ps.Keyword||this.rawToken.value.toLowerCase()!==e?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}expectContextualKeyword(e){this.rawToken.type!==ps.Identifier||this.rawToken.value.toLowerCase()!==e?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}matchKeyword(e){return this.rawToken.type===ps.Keyword&&this.rawToken.value.toLowerCase()===e}matchContextualKeyword(e){return this.rawToken.type===ps.Identifier&&this.rawToken.value===e}matchPunctuator(e){return this.rawToken.type===ps.Punctuator&&this.rawToken.value===e}getMatchingPunctuator(e){if(typeof e=="string"&&(e=e.split("")),this.rawToken.type===ps.Punctuator&&e?.length)return e.find(this.matchPunctuator,this)}isolateCoverGrammar(e){const i=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;const r=e.call(this);return this.context.isAssignmentTarget=i,r}inheritCoverGrammar(e){const i=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;const r=e.call(this);return this.context.isAssignmentTarget=this.context.isAssignmentTarget&&i,r}withBlockContext(e,i){const r=this.context.blockContext;this.context.blockContext=this.context.blockContext|e;const n=this.context.curlyParsingType;this.context.curlyParsingType=aJ.Automatic;const s=i.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===ps.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(),i=this.rawToken;switch(i.type){case ps.Identifier:return this.readNextRawToken(),this.finalize({type:as.Identifier,name:i.value,...this.getItemLocation(e)});case ps.NumericLiteral:case ps.StringLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:as.Literal,value:i.value,raw:this.getSourceValue(i),isString:typeof i.value=="string",...this.getItemLocation(e)});case ps.BooleanLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:as.Literal,value:i.value.toLowerCase()===Pa.True,raw:this.getSourceValue(i),isString:!1,...this.getItemLocation(e)});case ps.NullLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:as.Literal,value:null,raw:this.getSourceValue(i),isString:!1,...this.getItemLocation(e)});case ps.Template:return this.parseTemplateLiteral();case ps.Punctuator:switch(i.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 ps.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 i=[];for(;!this.matchPunctuator("]");){const r=this.captureStartMarker();this.matchPunctuator(",")?(this.readNextRawToken(),this.throwError(Xn.InvalidExpression,r)):(i.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.matchPunctuator("]")||this.expectPunctuator(","))}return this.expectPunctuator("]"),this.finalize({type:as.ArrayExpression,elements:i,...this.getItemLocation(e)})}parseObjectPropertyKey(){const e=this.captureStartMarker(),i=this.rawToken;switch(i.type){case ps.StringLiteral:return this.readNextRawToken(),this.finalize({type:as.Literal,value:i.value,raw:this.getSourceValue(i),isString:!0,...this.getItemLocation(e)});case ps.Identifier:case ps.BooleanLiteral:case ps.NullLiteral:case ps.Keyword:return this.readNextRawToken(),this.finalize({type:as.Identifier,name:i.value,...this.getItemLocation(e)});default:this.throwError(Xn.KeyMustBeString,e)}}parseObjectProperty(){const e=this.rawToken,i=this.captureStartMarker(),r=this.parseObjectPropertyKey();let n=!1,s=null;return this.matchPunctuator(":")?(this.readNextRawToken(),s=this.inheritCoverGrammar(this.parseAssignmentExpression)):e.type===ps.Identifier?(n=!0,s=this.finalize({type:as.Identifier,name:e.value,...this.getItemLocation(i)})):this.throwUnexpectedToken({rawToken:this.rawToken}),this.finalize({type:as.Property,kind:"init",key:r,value:s,shorthand:n,...this.getItemLocation(i)})}parseObjectExpression(){const e=this.captureStartMarker();this.expectPunctuator("{");const i=[];for(;!this.matchPunctuator("}");)i.push(this.parseObjectProperty()),this.matchPunctuator("}")||this.expectPunctuator(",");return this.expectPunctuator("}"),this.finalize({type:as.ObjectExpression,properties:i,...this.getItemLocation(e)})}parseTemplateElement(e=!1){const i=this.rawToken;i.type!==ps.Template&&this.throwUnexpectedToken({rawToken:i}),e&&!i.head&&this.throwUnexpectedToken({code:Xn.InvalidTemplateHead,rawToken:i});const r=this.captureStartMarker();this.readNextRawToken();const{value:n,cooked:s,tail:o}=i,a=this.finalize({type:as.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(),i=[],r=[];let n=this.parseTemplateElement(!0);for(r.push(n);!n.tail;)i.push(this.parseExpression()),n=this.parseTemplateElement(),r.push(n);return this.finalize({type:as.TemplateLiteral,quasis:r,expressions:i,...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 i=this.isolateCoverGrammar(this.parseAssignmentExpression);if(e.push(i),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseMemberName(){const e=this.rawToken,i=this.captureStartMarker();return this.readNextRawToken(),e.type!==ps.NullLiteral&&e.type!==ps.Identifier&&e.type!==ps.Keyword&&e.type!==ps.BooleanLiteral&&this.throwUnexpectedToken({rawToken:e}),this.finalize({type:as.Identifier,name:e.value,...this.getItemLocation(i)})}parseLeftHandSideExpression(){const e=this.captureStartMarker();let i=this.inheritCoverGrammar(this.parsePrimaryExpression);const r=this.captureStartMarker();let n;for(;n=this.getMatchingPunctuator("([.");)switch(n){case"(":{this.context.isAssignmentTarget=!1,i.type!==as.Identifier&&i.type!==as.MemberExpression&&this.throwError(Xn.IdentiferExpected,e,r);const s=this.parseArguments();i=this.finalize({type:as.CallExpression,callee:i,arguments:s,...this.getItemLocation(e)});continue}case"[":{this.context.isAssignmentTarget=!0,this.expectPunctuator("[");const s=this.isolateCoverGrammar(this.parseExpression);this.expectPunctuator("]"),i=this.finalize({type:as.MemberExpression,computed:!0,object:i,property:s,...this.getItemLocation(e)});continue}case".":{this.context.isAssignmentTarget=!0,this.expectPunctuator(".");const s=this.parseMemberName();i=this.finalize({type:as.MemberExpression,computed:!1,object:i,property:s,...this.getItemLocation(e)});continue}}return i}parseUpdateExpression(){const e=this.captureStartMarker();let i=this.getMatchingPunctuator(qRe);if(i){this.readNextRawToken();const o=this.captureStartMarker(),a=this.inheritCoverGrammar(this.parseUnaryExpression);return a.type!==as.Identifier&&a.type!==as.MemberExpression&&a.type!==as.CallExpression&&this.throwError(Xn.InvalidExpression,o),this.context.isAssignmentTarget||this.tolerateError(Xn.InvalidLeftHandSideInAssignment,e),this.context.isAssignmentTarget=!1,this.finalize({type:as.UpdateExpression,operator:i,argument:a,prefix:!0,...this.getItemLocation(e)})}const r=this.captureStartMarker(),n=this.inheritCoverGrammar(this.parseLeftHandSideExpression),s=this.captureStartMarker();return this.hasLineTerminator?n:(i=this.getMatchingPunctuator(qRe),i?(n.type!==as.Identifier&&n.type!==as.MemberExpression&&this.throwError(Xn.InvalidExpression,r,s),this.context.isAssignmentTarget||this.tolerateError(Xn.InvalidLeftHandSideInAssignment,e),this.readNextRawToken(),this.context.isAssignmentTarget=!1,this.finalize({type:as.UpdateExpression,operator:i,argument:n,prefix:!1,...this.getItemLocation(e)})):n)}parseUnaryExpression(){const e=this.getMatchingPunctuator(Zpt);if(e){const i=this.captureStartMarker();this.readNextRawToken();const r=this.inheritCoverGrammar(this.parseUnaryExpression);return this.context.isAssignmentTarget=!1,this.finalize({type:as.UnaryExpression,operator:e,argument:r,prefix:!0,...this.getItemLocation(i)})}return this.parseUpdateExpression()}parseBinaryExpression(){const e=this.rawToken;let i=this.inheritCoverGrammar(this.parseUnaryExpression);if(this.rawToken.type!==ps.Punctuator)return i;const r=this.rawToken.value;let n=lft(r);if(n===0)return i;this.readNextRawToken(),this.context.isAssignmentTarget=!1;const s=[e,this.rawToken];let o=i,a=this.inheritCoverGrammar(this.parseUnaryExpression);const l=[o,r,a],c=[n];for(;this.rawToken.type===ps.Punctuator&&(n=lft(this.rawToken.value))>0;){for(;l.length>2&&n<=c[c.length-1];){a=l.pop();const y=l.pop();c.pop(),o=l.pop(),s.pop();const v=s[s.length-1],S=oft(v,v.lineStart);l.push(this.finalize(this.createBinaryOrLogicalExpression(S,y,o,a)))}l.push(this.rawToken.value),c.push(n),s.push(this.rawToken),this.readNextRawToken(),l.push(this.inheritCoverGrammar(this.parseUnaryExpression))}let d=l.length-1;i=l[d];let p=s.pop();for(;d>1;){const y=s.pop();if(!y)break;const v=p?.lineStart,S=oft(y,v),I=l[d-1];i=this.finalize(this.createBinaryOrLogicalExpression(S,I,l[d-2],i)),d-=2,p=y}return i}createBinaryOrLogicalExpression(e,i,r,n){const s=eft.includes(i)?as.LogicalExpression:as.BinaryExpression;return s===as.BinaryExpression||(r.type!==as.AssignmentExpression&&r.type!==as.UpdateExpression||this.throwError(Xn.InvalidExpression,...aft(r)),n.type!==as.AssignmentExpression&&n.type!==as.UpdateExpression||this.throwError(Xn.InvalidExpression,...aft(r))),{type:s,operator:i,left:r,right:n,...this.getItemLocation(e)}}parseAssignmentExpression(){const e=this.captureStartMarker(),i=this.inheritCoverGrammar(this.parseBinaryExpression),r=this.captureStartMarker(),n=this.getMatchingPunctuator(Qpt);if(!n)return i;i.type!==as.Identifier&&i.type!==as.MemberExpression&&this.throwError(Xn.InvalidExpression,e,r),this.context.isAssignmentTarget||this.tolerateError(Xn.InvalidLeftHandSideInAssignment,e),this.matchPunctuator("=")||(this.context.isAssignmentTarget=!1),this.readNextRawToken();const s=this.isolateCoverGrammar(this.parseAssignmentExpression);return this.finalize({type:as.AssignmentExpression,left:i,operator:n,right:s,...this.getItemLocation(e)})}parseExpression(){return this.isolateCoverGrammar(this.parseAssignmentExpression)}parseStatements(e){const i=[];for(;this.rawToken.type!==ps.EOF&&!this.matchPunctuator(e);){const r=this.parseStatementListItem();OPi(r)||i.push(r)}return i}parseStatementListItem(){return this.context.isAssignmentTarget=!0,this.matchKeyword(Pa.Function)?this.parseFunctionDeclaration():this.matchKeyword(Pa.Export)?this.parseExportDeclaration():this.matchKeyword(Pa.Import)?this.parseImportDeclaration():this.parseStatement()}parseBlock(){const e=this.captureStartMarker();this.expectPunctuator("{");const i=this.parseStatements("}");return this.expectPunctuator("}"),this.finalize({type:as.BlockStatement,body:i,...this.getItemLocation(e)})}parseObjectStatement(){const e=this.captureStartMarker(),i=this.parseObjectExpression();return this.finalize({type:as.ExpressionStatement,expression:i,...this.getItemLocation(e)})}parseBlockOrObjectStatement(){return this.context.curlyParsingType===aJ.AsObject?this.parseObjectStatement():this.peekAhead(e=>{let i=e();return(i.type===ps.Identifier||i.type===ps.StringLiteral)&&(i=e(),i.type===ps.Punctuator&&i.value===":")})?this.parseObjectStatement():this.parseBlock()}parseIdentifier(){const e=this.rawToken;if(e.type!==ps.Identifier)return null;const i=this.captureStartMarker();return this.readNextRawToken(),this.finalize({type:as.Identifier,name:e.value,...this.getItemLocation(i)})}parseVariableDeclarator(){const e=this.captureStartMarker(),i=this.parseIdentifier();i||this.throwUnexpectedToken({code:Xn.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:Xn.InvalidVariableAssignment})}}return this.finalize({type:as.VariableDeclarator,id:i,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(Pa.Var);const i=this.parseVariableDeclarationList();return this.consumeSemicolon(),this.finalize({type:as.VariableDeclaration,declarations:i,kind:"var",...this.getItemLocation(e)})}parseEmptyStatement(){const e=this.captureStartMarker();return this.expectPunctuator(";"),this.finalize({type:as.EmptyStatement,...this.getItemLocation(e)})}parseExpressionStatement(){const e=this.captureStartMarker(),i=this.parseExpression();return this.consumeSemicolon(),this.finalize({type:as.ExpressionStatement,expression:i,...this.getItemLocation(e)})}parseIfClause(){return this.withBlockContext(vv.IfClause,this.parseStatement)}parseIfStatement(){const e=this.captureStartMarker();this.expectKeyword(Pa.If),this.expectPunctuator("(");const i=this.captureStartMarker(),r=this.parseExpression(),n=this.captureStartMarker();this.expectPunctuator(")"),r.type!==as.AssignmentExpression&&r.type!==as.UpdateExpression||this.throwError(Xn.InvalidExpression,i,n);const s=this.parseIfClause();let o=null;return this.matchKeyword(Pa.Else)&&(this.readNextRawToken(),o=this.parseIfClause()),this.finalize({type:as.IfStatement,test:r,consequent:s,alternate:o,...this.getItemLocation(e)})}parseWhileStatement(){const e=this.captureStartMarker();this.expectKeyword(Pa.While),this.expectPunctuator("(");const i=this.captureStartMarker(),r=this.parseExpression(),n=this.captureStartMarker();this.expectPunctuator(")"),r.type!==as.AssignmentExpression&&r.type!==as.UpdateExpression||this.throwError(Xn.InvalidExpression,i,n);const s=this.withBlockContext(vv.WhileLoop,this.parseStatement);return this.finalize({type:as.WhileStatement,test:r,body:s,...this.getItemLocation(e)})}parseForStatement(){let e=null,i=null,r=null,n=null,s=null;const o=this.captureStartMarker();if(this.expectKeyword(Pa.For),this.expectPunctuator("("),this.matchPunctuator(";"))this.readNextRawToken();else if(this.matchKeyword(Pa.Var)){const l=this.captureStartMarker();this.readNextRawToken();const c=this.parseVariableDeclarationList();c.length===1&&this.matchKeyword(Pa.In)?(c[0].init&&this.throwError(Xn.ForInOfLoopInitializer,l),n=this.finalize({type:as.VariableDeclaration,declarations:c,kind:"var",...this.getItemLocation(l)}),this.readNextRawToken(),s=this.parseExpression()):(this.matchKeyword(Pa.In)&&this.throwError(Xn.InvalidLeftHandSideInForIn,l),e=this.finalize({type:as.VariableDeclaration,declarations:c,kind:"var",...this.getItemLocation(l)}),this.expectPunctuator(";"))}else{const l=this.context.isAssignmentTarget,c=this.captureStartMarker();e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.matchKeyword(Pa.In)?(this.context.isAssignmentTarget||this.tolerateError(Xn.InvalidLeftHandSideInForIn,c),e.type!==as.Identifier&&this.throwError(Xn.InvalidLeftHandSideInForIn,c),this.readNextRawToken(),n=e,s=this.parseExpression(),e=null):(this.context.isAssignmentTarget=l,this.expectPunctuator(";"))}n||(this.matchPunctuator(";")||(i=this.isolateCoverGrammar(this.parseExpression)),this.expectPunctuator(";"),this.matchPunctuator(")")||(r=this.isolateCoverGrammar(this.parseExpression))),this.expectPunctuator(")");const a=this.withBlockContext(vv.ForLoop,()=>this.isolateCoverGrammar(this.parseStatement));return n&&s?this.finalize({type:as.ForInStatement,left:n,right:s,body:a,...this.getItemLocation(o)}):this.finalize({type:as.ForStatement,init:e,test:i,update:r,body:a,...this.getItemLocation(o)})}parseContinueStatement(){const e=this.captureStartMarker();return this.expectKeyword(Pa.Continue),this.consumeSemicolon(),this.finalize({type:as.ContinueStatement,...this.getItemLocation(e)})}parseBreakStatement(){const e=this.captureStartMarker();return this.expectKeyword(Pa.Break),this.consumeSemicolon(),this.finalize({type:as.BreakStatement,...this.getItemLocation(e)})}parseReturnStatement(){const e=this.captureStartMarker();this.expectKeyword(Pa.Return);const i=!this.matchPunctuator(";")&&!this.matchPunctuator("}")&&!this.hasLineTerminator&&this.rawToken.type!==ps.EOF||this.rawToken.type===ps.StringLiteral||this.rawToken.type===ps.Template?this.parseExpression():null;return this.consumeSemicolon(),this.finalize({type:as.ReturnStatement,argument:i,...this.getItemLocation(e)})}parseStatement(){switch(this.rawToken.type){case ps.BooleanLiteral:case ps.NullLiteral:case ps.NumericLiteral:case ps.StringLiteral:case ps.Template:case ps.Identifier:return this.parseExpressionStatement();case ps.Punctuator:return this.rawToken.value==="{"?this.parseBlockOrObjectStatement():this.rawToken.value==="("?this.parseExpressionStatement():this.rawToken.value===";"?this.parseEmptyStatement():this.parseExpressionStatement();case ps.Keyword:switch(this.rawToken.value.toLowerCase()){case Pa.Break:return this.parseBreakStatement();case Pa.Continue:return this.parseContinueStatement();case Pa.For:return this.parseForStatement();case Pa.Function:return this.parseFunctionDeclaration();case Pa.If:return this.parseIfStatement();case Pa.Return:return this.parseReturnStatement();case Pa.Var:return this.parseVariableDeclaration();case Pa.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!==ps.EOF;){const i=this.parseIdentifier();if(i||this.throwUnexpectedToken({rawToken:this.rawToken,code:Xn.IdentiferExpected}),e.push(i),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseFunctionDeclaration(){(this.context.blockContext&vv.Function)===vv.Function&&this.throwUnexpectedToken({code:Xn.NoFunctionInsideFunction}),(this.context.blockContext&vv.WhileLoop)!==vv.WhileLoop&&(this.context.blockContext&vv.IfClause)!==vv.IfClause||this.throwUnexpectedToken({code:Xn.NoFunctionInsideBlock});const e=this.captureStartMarker();this.expectKeyword(Pa.Function);const i=this.parseIdentifier();i||this.throwUnexpectedToken({code:Xn.InvalidFunctionIdentifier});const r=this.parseFormalParameters(),n=this.context.blockContext;this.context.blockContext=this.context.blockContext|vv.Function;const s=this.parseBlock();return this.context.blockContext=n,this.finalize({type:as.FunctionDeclaration,id:i,params:r,body:s,...this.getItemLocation(e)})}parseScript(){const e=this.captureStartMarker(),i=this.parseStatements(),r=this.finalize({type:as.Program,body:i,...this.getItemLocation(e)});return this.options.tokens&&(r.tokens=this.tokens),this.options.tolerant&&(r.errors=this.errorHandler.errors),r}parseExportDeclaration(){this.context.blockContext!==vv.None&&this.throwUnexpectedToken({code:Xn.ModuleExportRootOnly});let e=null;const i=this.captureStartMarker();return this.expectKeyword(Pa.Export),this.matchKeyword(Pa.Var)?e=this.parseVariableDeclaration():this.matchKeyword("function")?e=this.parseFunctionDeclaration():this.throwUnexpectedToken({code:Xn.InvalidExpression}),this.finalize({type:as.ExportNamedDeclaration,declaration:e,specifiers:[],source:null,...this.getItemLocation(i)})}parseModuleSpecifier(){const e=this.captureStartMarker(),i=this.rawToken;if(i.type===ps.StringLiteral)return this.readNextRawToken(),this.finalize({type:as.Literal,value:i.value,raw:this.getSourceValue(i),isString:!0,...this.getItemLocation(e)});this.throwError(Xn.InvalidModuleUri,e)}parseDefaultSpecifier(){const e=this.captureStartMarker(),i=this.parseIdentifier();return i||this.throwUnexpectedToken({code:Xn.IdentiferExpected}),this.finalize({type:as.ImportDefaultSpecifier,local:i,...this.getItemLocation(e)})}parseImportDeclaration(){this.context.blockContext!==vv.None&&this.throwUnexpectedToken({code:Xn.ModuleImportRootOnly});const e=this.captureStartMarker();this.expectKeyword(Pa.Import);const i=this.parseDefaultSpecifier();this.expectContextualKeyword(Pa.From);const r=this.parseModuleSpecifier();return this.finalize({type:as.ImportDeclaration,specifiers:[i],source:r,...this.getItemLocation(e)})}};function kPi(t,e,i){return new LPi(t,e,i).parseScript()}function hde(t,e=[]){const i=kPi(t);if(i.body===null||i.body===void 0)throw new ON({index:0,line:0,column:0,data:null,description:"",code:Xn.InvalidExpression});if(i.body.length===0)throw new ON({index:0,line:0,column:0,data:null,description:"",code:Xn.InvalidExpression});if(i.body.length===0)throw new ON({index:0,line:0,column:0,data:null,description:"",code:Xn.InvalidExpression});return i.loadedModules={},ZK(i,e),i}let NPi=class k9e{constructor(e){const i=this;i._keys=[],i._values=[],i.length=0,e&&e.forEach(r=>{i.set(r[0],r[1])})}entries(){return[].slice.call(this.keys().map((e,i)=>[e,this._values[i]]))}keys(){return[].slice.call(this._keys)}values(){return[].slice.call(this._values)}has(e){return this._keys.includes(e)}get(e){const i=this._keys.indexOf(e);return i>-1?this._values[i]:null}deepGet(e){if(!e||!e.length)return null;const i=(r,n)=>r==null?null:n.length?i(r instanceof k9e?r.get(n[0]):r[n[0]],n.slice(1)):r;return i(this.get(e[0]),e.slice(1))}set(e,i){const r=this,n=this._keys.indexOf(e);return n>-1?r._values[n]=i:(r._keys.push(e),r._values.push(i),r.length=r._values.length),this}sortedSet(e,i,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(i),s;if(e===this._keys[a])return this._values.splice(a,0,i),this;if(e===this._keys[l])return this._values.splice(l,0,i),this;if(e>this._keys[l])return this._keys.splice(l+1,0,e),this._values.splice(l+1,0,i),this;if(e=l)return this;const c=a+Math.floor((l-a)/2);return ethis._keys[c]?this.sortedSet(e,i,c+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 i=this,r=i._keys.indexOf(e);return r>-1&&(i._keys.splice(r,1),i._values.splice(r,1),i.length=i._keys.length,!0)}forEach(e){this._keys.forEach((i,r)=>{e(this._values[r],i,r)})}map(e){return this.keys().map((i,r)=>e(this._values[r],i,r))}filter(e){const i=this;return i._keys.forEach((r,n)=>{e(i._values[n],r,n)===!1&&i.delete(r)}),this}clone(){return new k9e(this.entries())}},uft=class{constructor(e=20){this._maxEntries=e,this._values=new NPi}delete(e){this._values.has(e)&&this._values.delete(e)}get(e){let i=null;return this._values.has(e)&&(i=this._values.get(e),this._values.delete(e),this._values.set(e,i)),i}put(e,i){if(this._values.size()>=this._maxEntries){const r=this._values.keys()[0];this._values.delete(r)}this._values.set(e,i)}},$Pi=class{constructor(e=20){this._maxEntries=e,this._cache=new uft(this._maxEntries)}clear(){this._cache=new uft(this._maxEntries)}addToCache(e,i){this._cache.put(e,i)}removeFromCache(e){this._cache.delete(e)}getFromCache(e){return this._cache.get(e)}},GV=class D3{constructor(e){this.portalUri=e}normalizeModuleUri(e){const i=/^[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="",c=a,d=!1;for(const v of[r,s,n]){const S=v.exec(a);if(S!==null){const I=S.groups;c=I.itemid,l=I.portalurl,d=!0;break}}if(d===!1){if(!i.test(a))throw new sRe(xN.UnsupportedUriProtocol,{uri:e});c=a,l=this.portalUri}c.includes("/")&&(c=c.split("/")[0]),c.includes("?")&&(c=c.split("?")[0]);let p="current";const y=o.exec(c);if(y!==null){const v=y.groups;c=v.itemid,p=v.versionstring}return a=new _c({url:l}).restUrl+"/content/items/"+c+"/resources/"+p+".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,c=this.scanHexEscape(a);c!==null?e+=c:(this.index=l,e+=a)}break;case"x":{const l=this.scanHexEscape(a);l===null&&this.throwUnexpectedToken(us.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(us.TemplateOctalLiteral),e+="\0"):yl.isOctalDigit(a.charCodeAt(0))?this.throwUnexpectedToken(us.TemplateOctalLiteral):e+=a}else{if(this.source[this.index]==="{"){this.curlyStack.push("${"),++this.index,i=!0;break}e+=a}}return i||this.throwUnexpectedToken(),n||this.curlyStack.pop(),{type:Ps.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:Ps.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 wv,dJ;function Wft(t,e=0){let i=t.start-t.lineStart,r=t.lineNumber;return i<0&&(i+=e,r--),{index:t.start,line:r,column:i}}function qft(t){return[{index:t.range[0],...t.loc.start},{index:t.range[1],...t.loc.end}]}function Yft(t){return ROi[t]??0}(function(t){t[t.None=0]="None",t[t.Function=1]="Function",t[t.IfClause=2]="IfClause",t[t.ForLoop=4]="ForLoop",t[t.WhileLoop=8]="WhileLoop"})(wv||(wv={})),function(t){t[t.AsObject=0]="AsObject",t[t.Automatic=1]="Automatic"}(dJ||(dJ={}));let jOi=class{constructor(e,i={},r){this.delegate=r,this.hasLineTerminator=!1,this.options={tokens:typeof i.tokens=="boolean"&&i.tokens,comments:typeof i.comments=="boolean"&&i.comments,tolerant:typeof i.tolerant=="boolean"&&i.tolerant},this.options.comments&&(this.commentHandler=new $Oi),this.errorHandler=new BOi(this.options.tolerant),this.scanner=new VOi(e,this.errorHandler),this.context={isAssignmentTarget:!1,blockContext:wv.None,curlyParsingType:dJ.AsObject},this.rawToken={type:Ps.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,i,{validTypes:r,invalidTypes:n}){r?.some(s=>e.type===s)||n?.some(s=>e.type===s)&&this.throwError(us.InvalidExpression,i)}throwError(e,i,r=this.endMarker){const{index:n,line:s,column:o}=i,a=r.index-n-1;this.errorHandler.throwError({code:e,index:n,line:s,column:o+1,len:a})}tolerateError(e,i){throw new Error("######################################### !!!")}unexpectedTokenError(e={}){const{rawToken:i}=e;let r,{code:n,data:s}=e;if(i){if(!n)switch(i.type){case Ps.EOF:n=us.UnexpectedEndOfScript;break;case Ps.Identifier:n=us.UnexpectedIdentifier;break;case Ps.NumericLiteral:n=us.UnexpectedNumber;break;case Ps.StringLiteral:n=us.UnexpectedString;break;case Ps.Template:n=us.UnexpectedTemplate}r=i.value.toString()}else r="ILLEGAL";n=n??us.UnexpectedToken,s||(s={value:r});const o=vMe(n,s);if(i){const c=i.start,h=i.lineNumber,p=i.start-i.lineStart+1;return new Mk({code:n,index:c,line:h,column:p,len:i.end-i.start-1,data:s,description:o})}const{index:a,line:l}=this.endMarker;return new Mk({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:i}=this;i&&e.length&&e.forEach(r=>{const n={type:r.multiLine?_s.BlockComment:_s.LineComment,value:this.getSourceValue(r),range:r.range,loc:r.loc};i.collectComment(n)})}peekAhead(e){const i=()=>(this.scanner.scanComments(),this.scanner.lex()),r=this.scanner.saveState(),n=e.call(this,i);return this.scanner.restoreState(r),n}getSourceValue(e){return this.scanner.source.slice(e.start,e.end)}convertToToken(e){return{type:MOi[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!==Ps.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 i=this.rawToken;this.matchPunctuator(e)?this.readNextRawToken():this.throwUnexpectedToken({rawToken:i,code:us.PunctuatorExpected,data:{value:e}})}expectKeyword(e){this.rawToken.type!==Ps.Keyword||this.rawToken.value.toLowerCase()!==e?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}expectContextualKeyword(e){this.rawToken.type!==Ps.Identifier||this.rawToken.value.toLowerCase()!==e?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}matchKeyword(e){return this.rawToken.type===Ps.Keyword&&this.rawToken.value.toLowerCase()===e}matchContextualKeyword(e){return this.rawToken.type===Ps.Identifier&&this.rawToken.value===e}matchPunctuator(e){return this.rawToken.type===Ps.Punctuator&&this.rawToken.value===e}getMatchingPunctuator(e){if(typeof e=="string"&&(e=e.split("")),this.rawToken.type===Ps.Punctuator&&e?.length)return e.find(this.matchPunctuator,this)}isolateCoverGrammar(e){const i=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;const r=e.call(this);return this.context.isAssignmentTarget=i,r}inheritCoverGrammar(e){const i=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;const r=e.call(this);return this.context.isAssignmentTarget=this.context.isAssignmentTarget&&i,r}withBlockContext(e,i){const r=this.context.blockContext;this.context.blockContext=this.context.blockContext|e;const n=this.context.curlyParsingType;this.context.curlyParsingType=dJ.Automatic;const s=i.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===Ps.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(),i=this.rawToken;switch(i.type){case Ps.Identifier:return this.readNextRawToken(),this.finalize({type:_s.Identifier,name:i.value,...this.getItemLocation(e)});case Ps.NumericLiteral:case Ps.StringLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:_s.Literal,value:i.value,raw:this.getSourceValue(i),isString:typeof i.value=="string",...this.getItemLocation(e)});case Ps.BooleanLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:_s.Literal,value:i.value.toLowerCase()===$a.True,raw:this.getSourceValue(i),isString:!1,...this.getItemLocation(e)});case Ps.NullLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:_s.Literal,value:null,raw:this.getSourceValue(i),isString:!1,...this.getItemLocation(e)});case Ps.Template:return this.parseTemplateLiteral();case Ps.Punctuator:switch(i.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 Ps.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 i=[];for(;!this.matchPunctuator("]");){const r=this.captureStartMarker();this.matchPunctuator(",")?(this.readNextRawToken(),this.throwError(us.InvalidExpression,r)):(i.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.matchPunctuator("]")||this.expectPunctuator(","))}return this.expectPunctuator("]"),this.finalize({type:_s.ArrayExpression,elements:i,...this.getItemLocation(e)})}parseObjectPropertyKey(){const e=this.captureStartMarker(),i=this.rawToken;switch(i.type){case Ps.StringLiteral:return this.readNextRawToken(),this.finalize({type:_s.Literal,value:i.value,raw:this.getSourceValue(i),isString:!0,...this.getItemLocation(e)});case Ps.Identifier:case Ps.BooleanLiteral:case Ps.NullLiteral:case Ps.Keyword:return this.readNextRawToken(),this.finalize({type:_s.Identifier,name:i.value,...this.getItemLocation(e)});default:this.throwError(us.KeyMustBeString,e)}}parseObjectProperty(){const e=this.rawToken,i=this.captureStartMarker(),r=this.parseObjectPropertyKey();let n=!1,s=null;return this.matchPunctuator(":")?(this.readNextRawToken(),s=this.inheritCoverGrammar(this.parseAssignmentExpression)):e.type===Ps.Identifier?(n=!0,s=this.finalize({type:_s.Identifier,name:e.value,...this.getItemLocation(i)})):this.throwUnexpectedToken({rawToken:this.rawToken}),this.finalize({type:_s.Property,kind:"init",key:r,value:s,shorthand:n,...this.getItemLocation(i)})}parseObjectExpression(){const e=this.captureStartMarker();this.expectPunctuator("{");const i=[];for(;!this.matchPunctuator("}");)i.push(this.parseObjectProperty()),this.matchPunctuator("}")||this.expectPunctuator(",");return this.expectPunctuator("}"),this.finalize({type:_s.ObjectExpression,properties:i,...this.getItemLocation(e)})}parseTemplateElement(e=!1){const i=this.rawToken;i.type!==Ps.Template&&this.throwUnexpectedToken({rawToken:i}),e&&!i.head&&this.throwUnexpectedToken({code:us.InvalidTemplateHead,rawToken:i});const r=this.captureStartMarker();this.readNextRawToken();const{value:n,cooked:s,tail:o}=i,a=this.finalize({type:_s.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(),i=[],r=[];let n=this.parseTemplateElement(!0);for(r.push(n);!n.tail;)i.push(this.parseExpression()),n=this.parseTemplateElement(),r.push(n);return this.finalize({type:_s.TemplateLiteral,quasis:r,expressions:i,...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 i=this.isolateCoverGrammar(this.parseAssignmentExpression);if(e.push(i),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseMemberName(){const e=this.rawToken,i=this.captureStartMarker();return this.readNextRawToken(),e.type!==Ps.NullLiteral&&e.type!==Ps.Identifier&&e.type!==Ps.Keyword&&e.type!==Ps.BooleanLiteral&&this.throwUnexpectedToken({rawToken:e}),this.finalize({type:_s.Identifier,name:e.value,...this.getItemLocation(i)})}parseLeftHandSideExpression(){const e=this.captureStartMarker();let i=this.inheritCoverGrammar(this.parsePrimaryExpression);const r=this.captureStartMarker();let n;for(;n=this.getMatchingPunctuator("([.");)switch(n){case"(":{this.context.isAssignmentTarget=!1,i.type!==_s.Identifier&&i.type!==_s.MemberExpression&&this.throwError(us.IdentiferExpected,e,r);const s=this.parseArguments();i=this.finalize({type:_s.CallExpression,callee:i,arguments:s,...this.getItemLocation(e)});continue}case"[":{this.context.isAssignmentTarget=!0,this.expectPunctuator("[");const s=this.isolateCoverGrammar(this.parseExpression);this.expectPunctuator("]"),i=this.finalize({type:_s.MemberExpression,computed:!0,object:i,property:s,...this.getItemLocation(e)});continue}case".":{this.context.isAssignmentTarget=!0,this.expectPunctuator(".");const s=this.parseMemberName();i=this.finalize({type:_s.MemberExpression,computed:!1,object:i,property:s,...this.getItemLocation(e)});continue}}return i}parseUpdateExpression(){const e=this.captureStartMarker();let i=this.getMatchingPunctuator(gMe);if(i){this.readNextRawToken();const o=this.captureStartMarker(),a=this.inheritCoverGrammar(this.parseUnaryExpression);return a.type!==_s.Identifier&&a.type!==_s.MemberExpression&&a.type!==_s.CallExpression&&this.throwError(us.InvalidExpression,o),this.context.isAssignmentTarget||this.tolerateError(us.InvalidLeftHandSideInAssignment,e),this.context.isAssignmentTarget=!1,this.finalize({type:_s.UpdateExpression,operator:i,argument:a,prefix:!0,...this.getItemLocation(e)})}const r=this.captureStartMarker(),n=this.inheritCoverGrammar(this.parseLeftHandSideExpression),s=this.captureStartMarker();return this.hasLineTerminator?n:(i=this.getMatchingPunctuator(gMe),i?(n.type!==_s.Identifier&&n.type!==_s.MemberExpression&&this.throwError(us.InvalidExpression,r,s),this.context.isAssignmentTarget||this.tolerateError(us.InvalidLeftHandSideInAssignment,e),this.readNextRawToken(),this.context.isAssignmentTarget=!1,this.finalize({type:_s.UpdateExpression,operator:i,argument:n,prefix:!1,...this.getItemLocation(e)})):n)}parseUnaryExpression(){const e=this.getMatchingPunctuator($ft);if(e){const i=this.captureStartMarker();this.readNextRawToken();const r=this.inheritCoverGrammar(this.parseUnaryExpression);return this.context.isAssignmentTarget=!1,this.finalize({type:_s.UnaryExpression,operator:e,argument:r,prefix:!0,...this.getItemLocation(i)})}return this.parseUpdateExpression()}parseBinaryExpression(){const e=this.rawToken;let i=this.inheritCoverGrammar(this.parseUnaryExpression);if(this.rawToken.type!==Ps.Punctuator)return i;const r=this.rawToken.value;let n=Yft(r);if(n===0)return i;this.readNextRawToken(),this.context.isAssignmentTarget=!1;const s=[e,this.rawToken];let o=i,a=this.inheritCoverGrammar(this.parseUnaryExpression);const l=[o,r,a],c=[n];for(;this.rawToken.type===Ps.Punctuator&&(n=Yft(this.rawToken.value))>0;){for(;l.length>2&&n<=c[c.length-1];){a=l.pop();const y=l.pop();c.pop(),o=l.pop(),s.pop();const v=s[s.length-1],x=Wft(v,v.lineStart);l.push(this.finalize(this.createBinaryOrLogicalExpression(x,y,o,a)))}l.push(this.rawToken.value),c.push(n),s.push(this.rawToken),this.readNextRawToken(),l.push(this.inheritCoverGrammar(this.parseUnaryExpression))}let h=l.length-1;i=l[h];let p=s.pop();for(;h>1;){const y=s.pop();if(!y)break;const v=p?.lineStart,x=Wft(y,v),I=l[h-1];i=this.finalize(this.createBinaryOrLogicalExpression(x,I,l[h-2],i)),h-=2,p=y}return i}createBinaryOrLogicalExpression(e,i,r,n){const s=Vft.includes(i)?_s.LogicalExpression:_s.BinaryExpression;return s===_s.BinaryExpression||(r.type!==_s.AssignmentExpression&&r.type!==_s.UpdateExpression||this.throwError(us.InvalidExpression,...qft(r)),n.type!==_s.AssignmentExpression&&n.type!==_s.UpdateExpression||this.throwError(us.InvalidExpression,...qft(r))),{type:s,operator:i,left:r,right:n,...this.getItemLocation(e)}}parseAssignmentExpression(){const e=this.captureStartMarker(),i=this.inheritCoverGrammar(this.parseBinaryExpression),r=this.captureStartMarker(),n=this.getMatchingPunctuator(Bft);if(!n)return i;i.type!==_s.Identifier&&i.type!==_s.MemberExpression&&this.throwError(us.InvalidExpression,e,r),this.context.isAssignmentTarget||this.tolerateError(us.InvalidLeftHandSideInAssignment,e),this.matchPunctuator("=")||(this.context.isAssignmentTarget=!1),this.readNextRawToken();const s=this.isolateCoverGrammar(this.parseAssignmentExpression);return this.finalize({type:_s.AssignmentExpression,left:i,operator:n,right:s,...this.getItemLocation(e)})}parseExpression(){return this.isolateCoverGrammar(this.parseAssignmentExpression)}parseStatements(e){const i=[];for(;this.rawToken.type!==Ps.EOF&&!this.matchPunctuator(e);){const r=this.parseStatementListItem();NOi(r)||i.push(r)}return i}parseStatementListItem(){return this.context.isAssignmentTarget=!0,this.matchKeyword($a.Function)?this.parseFunctionDeclaration():this.matchKeyword($a.Export)?this.parseExportDeclaration():this.matchKeyword($a.Import)?this.parseImportDeclaration():this.parseStatement()}parseBlock(){const e=this.captureStartMarker();this.expectPunctuator("{");const i=this.parseStatements("}");return this.expectPunctuator("}"),this.finalize({type:_s.BlockStatement,body:i,...this.getItemLocation(e)})}parseObjectStatement(){const e=this.captureStartMarker(),i=this.parseObjectExpression();return this.finalize({type:_s.ExpressionStatement,expression:i,...this.getItemLocation(e)})}parseBlockOrObjectStatement(){return this.context.curlyParsingType===dJ.AsObject?this.parseObjectStatement():this.peekAhead(e=>{let i=e();return(i.type===Ps.Identifier||i.type===Ps.StringLiteral)&&(i=e(),i.type===Ps.Punctuator&&i.value===":")})?this.parseObjectStatement():this.parseBlock()}parseIdentifier(){const e=this.rawToken;if(e.type!==Ps.Identifier)return null;const i=this.captureStartMarker();return this.readNextRawToken(),this.finalize({type:_s.Identifier,name:e.value,...this.getItemLocation(i)})}parseVariableDeclarator(){const e=this.captureStartMarker(),i=this.parseIdentifier();i||this.throwUnexpectedToken({code:us.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:us.InvalidVariableAssignment})}}return this.finalize({type:_s.VariableDeclarator,id:i,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($a.Var);const i=this.parseVariableDeclarationList();return this.consumeSemicolon(),this.finalize({type:_s.VariableDeclaration,declarations:i,kind:"var",...this.getItemLocation(e)})}parseEmptyStatement(){const e=this.captureStartMarker();return this.expectPunctuator(";"),this.finalize({type:_s.EmptyStatement,...this.getItemLocation(e)})}parseExpressionStatement(){const e=this.captureStartMarker(),i=this.parseExpression();return this.consumeSemicolon(),this.finalize({type:_s.ExpressionStatement,expression:i,...this.getItemLocation(e)})}parseIfClause(){return this.withBlockContext(wv.IfClause,this.parseStatement)}parseIfStatement(){const e=this.captureStartMarker();this.expectKeyword($a.If),this.expectPunctuator("(");const i=this.captureStartMarker(),r=this.parseExpression(),n=this.captureStartMarker();this.expectPunctuator(")"),r.type!==_s.AssignmentExpression&&r.type!==_s.UpdateExpression||this.throwError(us.InvalidExpression,i,n);const s=this.parseIfClause();let o=null;return this.matchKeyword($a.Else)&&(this.readNextRawToken(),o=this.parseIfClause()),this.finalize({type:_s.IfStatement,test:r,consequent:s,alternate:o,...this.getItemLocation(e)})}parseWhileStatement(){const e=this.captureStartMarker();this.expectKeyword($a.While),this.expectPunctuator("(");const i=this.captureStartMarker(),r=this.parseExpression(),n=this.captureStartMarker();this.expectPunctuator(")"),r.type!==_s.AssignmentExpression&&r.type!==_s.UpdateExpression||this.throwError(us.InvalidExpression,i,n);const s=this.withBlockContext(wv.WhileLoop,this.parseStatement);return this.finalize({type:_s.WhileStatement,test:r,body:s,...this.getItemLocation(e)})}parseForStatement(){let e=null,i=null,r=null,n=null,s=null;const o=this.captureStartMarker();if(this.expectKeyword($a.For),this.expectPunctuator("("),this.matchPunctuator(";"))this.readNextRawToken();else if(this.matchKeyword($a.Var)){const l=this.captureStartMarker();this.readNextRawToken();const c=this.parseVariableDeclarationList();c.length===1&&this.matchKeyword($a.In)?(c[0].init&&this.throwError(us.ForInOfLoopInitializer,l),n=this.finalize({type:_s.VariableDeclaration,declarations:c,kind:"var",...this.getItemLocation(l)}),this.readNextRawToken(),s=this.parseExpression()):(this.matchKeyword($a.In)&&this.throwError(us.InvalidLeftHandSideInForIn,l),e=this.finalize({type:_s.VariableDeclaration,declarations:c,kind:"var",...this.getItemLocation(l)}),this.expectPunctuator(";"))}else{const l=this.context.isAssignmentTarget,c=this.captureStartMarker();e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.matchKeyword($a.In)?(this.context.isAssignmentTarget||this.tolerateError(us.InvalidLeftHandSideInForIn,c),e.type!==_s.Identifier&&this.throwError(us.InvalidLeftHandSideInForIn,c),this.readNextRawToken(),n=e,s=this.parseExpression(),e=null):(this.context.isAssignmentTarget=l,this.expectPunctuator(";"))}n||(this.matchPunctuator(";")||(i=this.isolateCoverGrammar(this.parseExpression)),this.expectPunctuator(";"),this.matchPunctuator(")")||(r=this.isolateCoverGrammar(this.parseExpression))),this.expectPunctuator(")");const a=this.withBlockContext(wv.ForLoop,()=>this.isolateCoverGrammar(this.parseStatement));return n&&s?this.finalize({type:_s.ForInStatement,left:n,right:s,body:a,...this.getItemLocation(o)}):this.finalize({type:_s.ForStatement,init:e,test:i,update:r,body:a,...this.getItemLocation(o)})}parseContinueStatement(){const e=this.captureStartMarker();return this.expectKeyword($a.Continue),this.consumeSemicolon(),this.finalize({type:_s.ContinueStatement,...this.getItemLocation(e)})}parseBreakStatement(){const e=this.captureStartMarker();return this.expectKeyword($a.Break),this.consumeSemicolon(),this.finalize({type:_s.BreakStatement,...this.getItemLocation(e)})}parseReturnStatement(){const e=this.captureStartMarker();this.expectKeyword($a.Return);const i=!this.matchPunctuator(";")&&!this.matchPunctuator("}")&&!this.hasLineTerminator&&this.rawToken.type!==Ps.EOF||this.rawToken.type===Ps.StringLiteral||this.rawToken.type===Ps.Template?this.parseExpression():null;return this.consumeSemicolon(),this.finalize({type:_s.ReturnStatement,argument:i,...this.getItemLocation(e)})}parseStatement(){switch(this.rawToken.type){case Ps.BooleanLiteral:case Ps.NullLiteral:case Ps.NumericLiteral:case Ps.StringLiteral:case Ps.Template:case Ps.Identifier:return this.parseExpressionStatement();case Ps.Punctuator:return this.rawToken.value==="{"?this.parseBlockOrObjectStatement():this.rawToken.value==="("?this.parseExpressionStatement():this.rawToken.value===";"?this.parseEmptyStatement():this.parseExpressionStatement();case Ps.Keyword:switch(this.rawToken.value.toLowerCase()){case $a.Break:return this.parseBreakStatement();case $a.Continue:return this.parseContinueStatement();case $a.For:return this.parseForStatement();case $a.Function:return this.parseFunctionDeclaration();case $a.If:return this.parseIfStatement();case $a.Return:return this.parseReturnStatement();case $a.Var:return this.parseVariableDeclaration();case $a.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!==Ps.EOF;){const i=this.parseIdentifier();if(i||this.throwUnexpectedToken({rawToken:this.rawToken,code:us.IdentiferExpected}),e.push(i),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseFunctionDeclaration(){(this.context.blockContext&wv.Function)===wv.Function&&this.throwUnexpectedToken({code:us.NoFunctionInsideFunction}),(this.context.blockContext&wv.WhileLoop)!==wv.WhileLoop&&(this.context.blockContext&wv.IfClause)!==wv.IfClause||this.throwUnexpectedToken({code:us.NoFunctionInsideBlock});const e=this.captureStartMarker();this.expectKeyword($a.Function);const i=this.parseIdentifier();i||this.throwUnexpectedToken({code:us.InvalidFunctionIdentifier});const r=this.parseFormalParameters(),n=this.context.blockContext;this.context.blockContext=this.context.blockContext|wv.Function;const s=this.parseBlock();return this.context.blockContext=n,this.finalize({type:_s.FunctionDeclaration,id:i,params:r,body:s,...this.getItemLocation(e)})}parseScript(){const e=this.captureStartMarker(),i=this.parseStatements(),r=this.finalize({type:_s.Program,body:i,...this.getItemLocation(e)});return this.options.tokens&&(r.tokens=this.tokens),this.options.tolerant&&(r.errors=this.errorHandler.errors),r}parseExportDeclaration(){this.context.blockContext!==wv.None&&this.throwUnexpectedToken({code:us.ModuleExportRootOnly});let e=null;const i=this.captureStartMarker();return this.expectKeyword($a.Export),this.matchKeyword($a.Var)?e=this.parseVariableDeclaration():this.matchKeyword("function")?e=this.parseFunctionDeclaration():this.throwUnexpectedToken({code:us.InvalidExpression}),this.finalize({type:_s.ExportNamedDeclaration,declaration:e,specifiers:[],source:null,...this.getItemLocation(i)})}parseModuleSpecifier(){const e=this.captureStartMarker(),i=this.rawToken;if(i.type===Ps.StringLiteral)return this.readNextRawToken(),this.finalize({type:_s.Literal,value:i.value,raw:this.getSourceValue(i),isString:!0,...this.getItemLocation(e)});this.throwError(us.InvalidModuleUri,e)}parseDefaultSpecifier(){const e=this.captureStartMarker(),i=this.parseIdentifier();return i||this.throwUnexpectedToken({code:us.IdentiferExpected}),this.finalize({type:_s.ImportDefaultSpecifier,local:i,...this.getItemLocation(e)})}parseImportDeclaration(){this.context.blockContext!==wv.None&&this.throwUnexpectedToken({code:us.ModuleImportRootOnly});const e=this.captureStartMarker();this.expectKeyword($a.Import);const i=this.parseDefaultSpecifier();this.expectContextualKeyword($a.From);const r=this.parseModuleSpecifier();return this.finalize({type:_s.ImportDeclaration,specifiers:[i],source:r,...this.getItemLocation(e)})}};function GOi(t,e,i){return new jOi(t,e,i).parseScript()}function Nde(t,e=[]){const i=GOi(t);if(i.body===null||i.body===void 0)throw new Mk({index:0,line:0,column:0,data:null,description:"",code:us.InvalidExpression});if(i.body.length===0)throw new Mk({index:0,line:0,column:0,data:null,description:"",code:us.InvalidExpression});if(i.body.length===0)throw new Mk({index:0,line:0,column:0,data:null,description:"",code:us.InvalidExpression});return i.loadedModules={},rJ(i,e),i}let UOi=class V9e{constructor(e){const i=this;i._keys=[],i._values=[],i.length=0,e&&e.forEach(r=>{i.set(r[0],r[1])})}entries(){return[].slice.call(this.keys().map((e,i)=>[e,this._values[i]]))}keys(){return[].slice.call(this._keys)}values(){return[].slice.call(this._values)}has(e){return this._keys.includes(e)}get(e){const i=this._keys.indexOf(e);return i>-1?this._values[i]:null}deepGet(e){if(!e||!e.length)return null;const i=(r,n)=>r==null?null:n.length?i(r instanceof V9e?r.get(n[0]):r[n[0]],n.slice(1)):r;return i(this.get(e[0]),e.slice(1))}set(e,i){const r=this,n=this._keys.indexOf(e);return n>-1?r._values[n]=i:(r._keys.push(e),r._values.push(i),r.length=r._values.length),this}sortedSet(e,i,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(i),s;if(e===this._keys[a])return this._values.splice(a,0,i),this;if(e===this._keys[l])return this._values.splice(l,0,i),this;if(e>this._keys[l])return this._keys.splice(l+1,0,e),this._values.splice(l+1,0,i),this;if(e=l)return this;const c=a+Math.floor((l-a)/2);return ethis._keys[c]?this.sortedSet(e,i,c+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 i=this,r=i._keys.indexOf(e);return r>-1&&(i._keys.splice(r,1),i._values.splice(r,1),i.length=i._keys.length,!0)}forEach(e){this._keys.forEach((i,r)=>{e(this._values[r],i,r)})}map(e){return this.keys().map((i,r)=>e(this._values[r],i,r))}filter(e){const i=this;return i._keys.forEach((r,n)=>{e(i._values[n],r,n)===!1&&i.delete(r)}),this}clone(){return new V9e(this.entries())}},Xft=class{constructor(e=20){this._maxEntries=e,this._values=new UOi}delete(e){this._values.has(e)&&this._values.delete(e)}get(e){let i=null;return this._values.has(e)&&(i=this._values.get(e),this._values.delete(e),this._values.set(e,i)),i}put(e,i){if(this._values.size()>=this._maxEntries){const r=this._values.keys()[0];this._values.delete(r)}this._values.set(e,i)}},zOi=class{constructor(e=20){this._maxEntries=e,this._cache=new Xft(this._maxEntries)}clear(){this._cache=new Xft(this._maxEntries)}addToCache(e,i){this._cache.put(e,i)}removeFromCache(e){this._cache.delete(e)}getFromCache(e){return this._cache.get(e)}},Yj=class M3{constructor(e){this.portalUri=e}normalizeModuleUri(e){const i=/^[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="",c=a,h=!1;for(const v of[r,s,n]){const x=v.exec(a);if(x!==null){const I=x.groups;c=I.itemid,l=I.portalurl,h=!0;break}}if(h===!1){if(!i.test(a))throw new ARe(Ck.UnsupportedUriProtocol,{uri:e});c=a,l=this.portalUri}c.includes("/")&&(c=c.split("/")[0]),c.includes("?")&&(c=c.split("?")[0]);let p="current";const y=o.exec(c);if(y!==null){const v=y.groups;c=v.itemid,p=v.versionstring}return a=new Cc({url:l}).restUrl+"/content/items/"+c+"/resources/"+p+".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(D3.mocks[a]!==void 0)return{url:"",scheme:"mock",data:D3.mocks[a],uri:e}}throw new sRe(xN.UnrecognisedUri,{uri:e})}async fetchModule(e){const i=D3.cachedModules.getFromCache(e.uri);if(i)return i;const r=this.fetchSource(e);D3.cachedModules.addToCache(e.uri,r);let n=null;try{n=await r}catch(s){throw D3.cachedModules.removeFromCache(e.uri),s}return n}async fetchSource(e){if(e.scheme==="portal"){const i=await ir(e.url,{responseType:"text",query:{}});if(i.data)return hde(i.data,[])}if(e.scheme==="mock")return hde(e.data??"",[]);throw new sRe(xN.UnsupportedUriProtocol)}static create(e){return new D3(e)}static getDefault(){return this._default??(D3._default=D3._moduleResolverFactory())}static set moduleResolverClass(e){this._moduleResolverFactory=e,this._default=null}};GV.mocks={},GV.cachedModules=new $Pi(30),GV._default=null,GV._moduleResolverFactory=()=>{const t=_c.getDefault();return new GV(t.url)};let BPi=class extends yD{constructor(e,i){super(),this.definition=null,this.context=null,this.definition=e,this.context=i}createFunction(e){return(...i)=>{const r={spatialReference:this.context.spatialReference,console:this.context.console,timeReference:this.context.timeReference?this.context.timeReference: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 Nt(e,Et.MaximumCallDepth,null);return JRe(this.definition,r,i,null)}}call(e,i){return GP(e,i,(r,n,s)=>{const o={spatialReference:e.spatialReference,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,timeReference:e.timeReference??null,console:e.console,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};if(o.depthCounter.depth>64)throw new Nt(e,Et.MaximumCallDepth,i);return JRe(this.definition,o,s,i)})}marshalledCall(e,i,r,n){return n(e,i,(s,o,a)=>{const l={spatialReference:e.spatialReference,globalScope:r.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,timeReference:e.timeReference??null,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};return a=a.map(c=>!au(c)||c instanceof zw?c:vD(c,e,n)),vD(JRe(this.definition,l,a,i),r,n)})}},VV=class extends YK{constructor(e){super(e)}global(e){const i=this.executingContext.globalScope[e.toLowerCase()];if(i.valueset||(i.value=Gs(this.executingContext,i.node),i.valueset=!0),au(i.value)&&!(i.value instanceof zw)){const r=new zw;r.fn=i.value,r.parameterEvaluator=GP,r.context=this.executingContext,i.value=r}return i.value}setGlobal(e,i){if(au(i))throw new Nt(null,Et.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:i,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 i=e.spatialReference;i==null&&(i=new rr({wkid:102100})),this.moduleScope=pft({},e.customfunctions,e.timeReference),this.executingContext={spatialReference:i,globalScope:this.moduleScope,localScope:null,libraryResolver:new $V(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},console:e.console?e.console:fft,timeReference:e.timeReference??null,lrucache:e.lrucache,interceptor:e.interceptor,depthCounter:{depth:1}},Gs(this.executingContext,this.source.syntax)}};function GPi(t,e){const i=[];for(let r=0;r=r.length)throw new Nt(t,Et.OutOfBounds,e);i=Mi(r[n]),r[n]=e.operator==="++"?i+1:i-1}else if(r instanceof es){if(vn(n)===!1)throw new Nt(t,Et.KeyAccessorMustBeString,e);if(r.hasField(n)!==!0)throw new Nt(t,Et.FieldNotFound,e);i=Mi(r.field(n)),r.setField(n,e.operator==="++"?i+1:i-1)}else if(du(r)){if(vn(n)===!1)throw new Nt(t,Et.KeyAccessorMustBeString,e);if(r.hasField(n)!==!0)throw new Nt(t,Et.FieldNotFound,e);i=Mi(r.field(n)),r.setField(n,e.operator==="++"?i+1:i-1)}else{if(_s(r))throw new Nt(t,Et.Immutable,e);if(!(r instanceof VV))throw new Nt(t,Et.InvalidParameter,e);if(vn(n)===!1)throw new Nt(t,Et.ModuleAccessorMustBeString,e);if(r.hasGlobal(n)!==!0)throw new Nt(t,Et.ModuleExportNotFound,e);i=Mi(r.global(n)),r.setGlobal(n,e.operator==="++"?i+1:i-1)}return e.prefix===!1?i:e.operator==="++"?i+1:i-1}if(r=e.argument.type==="Identifier"?e.argument.name.toLowerCase():"",!r)throw new Nt(t,Et.InvalidIdentifier,e);if(t.localScope!=null&&t.localScope[r]!==void 0)return i=Mi(t.localScope[r].value),t.localScope[r]={value:e.operator==="++"?i+1:i-1,valueset:!0,node:e},e.prefix===!1?i:e.operator==="++"?i+1:i-1;if(t.globalScope[r]!==void 0)return i=Mi(t.globalScope[r].value),t.globalScope[r]={value:e.operator==="++"?i+1:i-1,valueset:!0,node:e},e.prefix===!1?i:e.operator==="++"?i+1:i-1;throw new Nt(t,Et.InvalidIdentifier,e)}function VP(t,e,i,r,n){switch(e){case"=":return t===Xr?null:t;case"/=":return Mi(i)/Mi(t);case"*=":return Mi(i)*Mi(t);case"-=":return Mi(i)-Mi(t);case"+=":return vn(i)||vn(t)?rn(i)+rn(t):Mi(i)+Mi(t);case"%=":return Mi(i)%Mi(t);default:throw new Nt(n,Et.UnsupportedOperator,r)}}function YPi(t,e){let i=null,r="";if(e.left.type==="MemberExpression"){if(i=Gs(t,e.left.object),e.left.computed===!0)r=Gs(t,e.left.property);else{if(e.left.property.type!=="Identifier")throw new Nt(t,Et.InvalidIdentifier,e);r=e.left.property.name}const s=Gs(t,e.right);if(Tn(i)){if(!Ka(r))throw new Nt(t,Et.ArrayAccessorMustBeNumber,e);if(r<0&&(r=i.length+r),r<0||r>i.length)throw new Nt(t,Et.OutOfBounds,e);if(r===i.length){if(e.operator!=="=")throw new Nt(t,Et.OutOfBounds,e);i[r]=VP(s,e.operator,i[r],e,t)}else i[r]=VP(s,e.operator,i[r],e,t)}else if(i instanceof es){if(vn(r)===!1)throw new Nt(t,Et.KeyAccessorMustBeString,e);if(i.hasField(r)===!0)i.setField(r,VP(s,e.operator,i.field(r),e,t));else{if(e.operator!=="=")throw new Nt(t,Et.FieldNotFound,e,{key:r});i.setField(r,VP(s,e.operator,null,e,t))}}else if(du(i)){if(vn(r)===!1)throw new Nt(t,Et.KeyAccessorMustBeString,e);if(i.hasField(r)===!0)i.setField(r,VP(s,e.operator,i.field(r),e,t));else{if(e.operator!=="=")throw new Nt(t,Et.FieldNotFound,e,{key:r});i.setField(r,VP(s,e.operator,null,e,t))}}else{if(_s(i))throw new Nt(t,Et.Immutable,e);if(!(i instanceof VV))throw new Nt(t,Et.InvalidIdentifier,e);if(vn(r)===!1)throw new Nt(t,Et.ModuleAccessorMustBeString,e);if(i.hasGlobal(r)!==!0)throw new Nt(t,Et.ModuleExportNotFound,e);i.setGlobal(r,VP(s,e.operator,i.global(r),e,t))}return Xr}i=e.left.name.toLowerCase();const n=Gs(t,e.right);if(t.localScope!=null&&t.localScope[i]!==void 0)return t.localScope[i]={value:VP(n,e.operator,t.localScope[i].value,e,t),valueset:!0,node:e.right},Xr;if(t.globalScope[i]!==void 0)return t.globalScope[i]={value:VP(n,e.operator,t.globalScope[i].value,e,t),valueset:!0,node:e.right},Xr;throw new Nt(t,Et.InvalidIdentifier,e)}function XPi(t,e){if(e.expression.type==="AssignmentExpression"||e.expression.type==="UpdateExpression")return Gs(t,e.expression);if(e.expression.type==="CallExpression"){const i=Gs(t,e.expression);return i===Xr?Xr:new iE(i)}{const i=Gs(t,e.expression);return i===Xr?Xr:new iE(i)}}function KPi(t,e){const i=Gs(t,e.test);if(i===!0)return Gs(t,e.consequent);if(i===!1)return e.alternate!==null?Gs(t,e.alternate):Xr;throw new Nt(t,Et.BooleanConditionRequired,e)}function JPi(t,e){let i=Xr;for(let r=0;r=i.length||r<0)throw new Nt(t,Et.OutOfBounds,e);return i[r]}throw new Nt(t,Et.InvalidMemberAccessKey,e)}if(vn(i)){if(Ka(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=i.length+r),r>=i.length||r<0)throw new Nt(t,Et.OutOfBounds,e);return i[r]}throw new Nt(t,Et.InvalidMemberAccessKey,e)}if(_s(i)){if(Ka(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=i.length()+r),r>=i.length()||r<0)throw new Nt(t,Et.OutOfBounds,e);return i.get(r)}throw new Nt(t,Et.InvalidMemberAccessKey,e)}throw new Nt(t,Et.InvalidMemberAccessKey,e)}}catch(i){throw i}}function sOi(t,e){try{const i=Gs(t,e.argument);if(La(i)){if(e.operator==="!")return!i;if(e.operator==="-")return-1*Mi(i);if(e.operator==="+")return 1*Mi(i);if(e.operator==="~")return~Mi(i);throw new Nt(t,Et.UnsupportedUnaryOperator,e)}if(e.operator==="~")return~Mi(i);if(e.operator==="-")return-1*Mi(i);if(e.operator==="+")return 1*Mi(i);throw new Nt(t,Et.UnsupportedUnaryOperator,e)}catch(i){throw i}}function oOi(t,e){try{const i=[];for(let r=0;r>":case">>>":case"^":case"&":return Zhe(Mi(r),Mi(n),e.operator);case"==":return yv(r,n);case"!=":return!yv(r,n);case"<":case">":case"<=":case">=":return Khe(r,n,e.operator);case"+":return vn(r)||vn(n)?rn(r)+rn(n):Mi(r)+Mi(n);case"-":return Mi(r)-Mi(n);case"*":return Mi(r)*Mi(n);case"/":return Mi(r)/Mi(n);case"%":return Mi(r)%Mi(n);default:throw new Nt(t,Et.UnsupportedOperator,e)}}catch(i){throw i}}function lOi(t,e){try{const i=Gs(t,e.left);if(La(i))switch(e.operator){case"||":if(i===!0)return i;{const r=Gs(t,e.right);if(La(r))return r;throw new Nt(t,Et.LogicExpressionOrAnd,e)}case"&&":if(i===!1)return i;{const r=Gs(t,e.right);if(La(r))return r;throw new Nt(t,Et.LogicExpressionOrAnd,e)}default:throw new Nt(t,Et.LogicExpressionOrAnd,e)}throw new Nt(t,Et.LogicalExpressionOnlyBoolean,e)}catch(i){throw i}}function uOi(t,e){return e.value?e.value.cooked:""}function cOi(t,e,i){if(au(t))throw new Nt(e,Et.NoFunctionInTemplateLiteral,i);return t}function hOi(t,e){let i="",r=0;for(const n of e.quasis)i+=n.value?n.value.cooked:"",n.tail===!1&&(i+=e.expressions[r]?rn(cOi(Gs(t,e.expressions[r]),t,e)):"",r++);return i}function cft(t,e){let i;try{const r=e.name.toLowerCase();if(t.localScope!=null&&t.localScope[r]!==void 0)return i=t.localScope[r],i.valueset===!0||(i.value=Gs(t,i.node),i.valueset=!0),i.value;if(t.globalScope[r]!==void 0)return i=t.globalScope[r],i.valueset===!0||(i.value=Gs(t,i.node),i.valueset=!0),i.value;throw new Nt(t,Et.InvalidIdentifier,e)}catch(r){throw r}}function dOi(t,e){try{if(e.callee.type==="MemberExpression"){const i=Gs(t,e.callee.object);if(!(i instanceof VV))throw new Nt(t,Et.FuncionNotFound,e);const r=e.callee.computed===!1?e.callee.property.name:Gs(t,e.callee.property);if(!i.hasGlobal(r))throw new Nt(t,Et.FuncionNotFound,e);const n=i.global(r);if(!au(n))throw new Nt(t,Et.CallNonFunction,e);return n.call(t,e)}if(e.callee.type!=="Identifier")throw new Nt(t,Et.FuncionNotFound,e);if(t.localScope!=null&&t.localScope[e.callee.name.toLowerCase()]!==void 0){const i=t.localScope[e.callee.name.toLowerCase()];if(au(i.value))return i.value.call(t,e);throw new Nt(t,Et.CallNonFunction,e)}if(t.globalScope[e.callee.name.toLowerCase()]!==void 0){const i=t.globalScope[e.callee.name.toLowerCase()];if(au(i.value))return i.value.call(t,e);throw new Nt(t,Et.CallNonFunction,e)}throw new Nt(t,Et.FuncionNotFound,e)}catch(i){throw i}}const _v={};function hft(t,e,i,r){try{const n=Gs(t,e.arguments[i]);if(yv(n,r))return Gs(t,e.arguments[i+1]);{const s=e.arguments.length-i;return s===1?Gs(t,e.arguments[i]):s===2?null:s===3?Gs(t,e.arguments[i+2]):hft(t,e,i+2,r)}}catch(n){throw n}}function dft(t,e,i,r){try{if(r===!0)return Gs(t,e.arguments[i+1]);if(e.arguments.length-i===3)return Gs(t,e.arguments[i+2]);{const n=Gs(t,e.arguments[i+2]);if(La(n)===!1)throw new Nt(t,Et.BooleanConditionRequired,e.arguments[i+2]);return dft(t,e,i+2,n)}}catch(n){throw n}}function JRe(t,e,i,r){try{const n=t.body;if(i.length!==t.params.length)throw new Nt(e,Et.WrongNumberOfParameters,r);if(e.localScope!=null)for(let o=0;obSr),Promise.resolve().then(()=>SAi)]);return yft=!0,e.setGeometryEngine(t),!0}let nMe=null;function sMe(){return nMe!==null||(nMe=wft()),nMe}async function wft(){await xPi(),oS=await Promise.resolve().then(()=>ZSr);for(const t of QRe)oS.extend(t),PN(t,"async");return QRe=null,!0}function xft(){return gft}function Sft(){return!!oS}function Cft(){return yft}let oMe=null;function aMe(){return oMe||(oMe=Tft(),oMe)}async function Tft(){await sMe();const[t,e,i,r,n]=await Promise.all([Promise.resolve().then(()=>CCr),Promise.resolve().then(()=>PCr),Promise.resolve().then(()=>RCr),Promise.resolve().then(()=>DCr),Promise.resolve().then(()=>LCr)]);return Oft=t,oS.extend([e,i,r,n]),PN([e,i,r,n],"async"),gft=!0,!0}function Eft(t,e=[]){return t.usesFeatureSet===void 0&&ZK(t,e),t.usesFeatureSet===!0}function wOi(t,e=[]){return t.isAsync===void 0&&ZK(t,e),t.isAsync===!0}function xOi(t,e){if(e){for(const i of e)if(dde(t,i))return!0;return!1}return!1}async function Ift(t,e,i=[],r=!1,n=null){return lMe(new Set,t,e,i,r,n)}async function lMe(t,e,i,r=[],n=!1,s=null){const o=typeof e=="string"?eMe(e):e,a=[];return o&&(Cft()===!1&&(pde(o)||n)&&a.push(rMe()),Sft()===!1&&(o.isAsync===!0||i)&&a.push(sMe()),xft()===!1&&(Eft(o)||xOi(o,r))&&a.push(aMe())),a.length&&await Promise.all(a),await Aft(t,o,s,i,n),!0}function SOi(t,e=[]){return t.usesModules===void 0&&ZK(t,e),t.usesModules===!0}async function Aft(t,e,i=null,r=!1,n=!1){const s=vpt(e);i===null&&s.length>0&&(i=GV.getDefault()),e.loadedModules={};for(const o of s){ig(i);const a=i.normalizeModuleUri(o.source);if(t.has(a.uri))throw new Nt(null,Et.CircularModules,null);t.add(a.uri);const l=await i.fetchModule(a);await lMe(t,l,r,[],n,i),t.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 Pft(t){if(pde(t))return!0;const e=ERe(t);let i=!1;for(let r=0;r{Rft.test(o)&&(o=o.replace(Rft,""),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(EOi).join(".*")}$`,"i");e.forEach(l=>a.test(l)?n.push(l):null)}),[...new Set(n.sort())]}function kOi(t){return dde(t,"$view")}function NOi(t,e){return!!t&&dde(t,e)}function $Oi(t){if(!(!t||t.spatialReference==null&&(t.scale==null||t.viewingMode==null)))return{view:t.viewingMode&&t.scale!=null?new es({viewingMode:t.viewingMode,scale:t.scale}):null,sr:t.spatialReference}}function BOi({url:t,spatialReference:e,lrucache:i,interceptor:r}){const n=fde();return n?n.createFeatureSetCollectionFromService(t,e,i,r):null}function GOi({layer:t,spatialReference:e,outFields:i,returnGeometry:r,lrucache:n,interceptor:s}){if(t===null)return null;const o=fde();return o?o.constructFeatureSet(t,e,i,r??!0,n,s):null}function VOi(t){if(t?.map===null)return null;const e=fde();return e?e.createFeatureSetCollectionFromMap(t.map,t.spatialReference,t.lrucache,t.interceptor):null}function UOi(t,e){return es.convertJsonToArcade(t,e)}function jOi(t,e,i=[]){return Ift(t,e,i)}function zOi(){return rMe()}function HOi(){return aMe()}function WOi(t){return t.type==="simple"||t.type==="class-breaks"||t.type==="unique-value"||t.type==="dot-density"||t.type==="dictionary"||t.type==="pie-chart"}function qOi(t){return t.declaredClass==="esri.layers.support.LabelClass"}function YOi(t){return t.declaredClass==="esri.PopupTemplate"}function Mft(t,e){if(!t)return!1;if(typeof t=="string")return e(t);const i=t;if(WOi(i)){if(i.type==="dot-density"){const s=i.attributes?.some(o=>e(o.valueExpression));if(s)return s}const r=i.visualVariables,n=!!r&&r.some(s=>{let o=e(s.valueExpression);return s.type==="size"&&(qC(s.minSize)&&(o=o||e(s.minSize.valueExpression)),qC(s.maxSize)&&(o=o||e(s.maxSize.valueExpression))),o});return!(!("valueExpression"in i)||!e(i.valueExpression))||n}if(qOi(i)){const r=i.labelExpressionInfo&&i.labelExpressionInfo.expression;return!(!r||!e(r))||!1}return!!YOi(i)&&(!!i.expressionInfos&&i.expressionInfos.some(r=>e(r.expression))||Array.isArray(i.content)&&i.content.some(r=>r.type==="expression"&&e(r.expressionInfo?.expression)))}function XOi(t){const e=uJ(t);return!!e&&Pft(e)}function KOi(t){return Mft(t,XOi)}function JOi(t){const e=uJ(t);return!!e&&pde(e)}function ZOi(t){return Mft(t,JOi)}const Dft=Object.freeze(Object.defineProperty({__proto__:null,Dictionary:es,arcade:COi,arcadeFeature:ah,convertFeatureLayerToFeatureSet:GOi,convertJsonToArcade:UOi,convertMapToFeatureSetCollection:VOi,convertServiceUrlToWorkspace:BOi,createExecContext:POi,createFeature:OOi,createFunction:AOi,createSyntaxTree:uJ,dependsOnView:kOi,enableFeatureSetOperations:HOi,enableGeometryOperations:zOi,evalSyntaxTree:MOi,executeAsyncFunction:FOi,executeFunction:DOi,extractFieldNames:LOi,getArcadeType:IOi,getViewInfo:$Oi,hasGeometryFunctions:KOi,hasGeometryOperations:ZOi,hasVariable:NOi,loadScriptDependencies:jOi,updateExecContext:ROi},Symbol.toStringTag,{value:"Module"}));function QOi(t,e){const i=Fft[t.toLowerCase()];if(i==null)throw new Error("Function Not Recognised");if(e.lengthi.maxParams)throw new Error(`Invalid Parameter count for call to ${t.toUpperCase()}`);return i.evaluate(e)}function e3i(t,e){const i=Fft[t.toLowerCase()];return i!=null&&e>=i.minParams&&e<=i.maxParams}const Fft={min:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.min.apply(Math,t[0])},max:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.max.apply(Math,t[0])},avg:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Lft(t[0])},sum:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:t3i(t[0])},stddev:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.sqrt(kft(t[0]))},count:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:t[0].length},var:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:kft(t[0])}};function Lft(t){let e=0;for(let i=0;i1?r/(i-1):0}var ba;(function(t){t.InvalidFunctionParameters="InvalidFunctionParameters",t.UnsupportedSqlFunction="UnsupportedSqlFunction",t.UnsupportedOperator="UnsupportedOperator",t.UnsupportedSyntax="UnsupportedSyntax",t.UnsupportedIsRhs="UnsupportedIsRhs",t.UnsupportedIsLhs="UnsupportedIsLhs",t.InvalidDataType="InvalidDataType",t.CannotCastValue="CannotCastValue",t.MissingStatisticParameters="MissingStatisticParameters"})(ba||(ba={}));const i3i={[ba.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[ba.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[ba.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[ba.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[ba.UnsupportedOperator]:"Unsupported operator - {operator}",[ba.UnsupportedSyntax]:"Unsupported syntax - {node}",[ba.UnsupportedSqlFunction]:"Sql function not found = {function}",[ba.InvalidDataType]:"Invalid sql data type",[ba.CannotCastValue]:"Cannot cast value to the required data type"};let lu=class ULt extends Error{constructor(e,i){super(CV(i3i[e],i)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,ULt)}};var Za;(function(t){t.NeverReach="NeverReach",t.NotImplemented="NotImplemented",t.Cancelled="Cancelled",t.InvalidStatResponse="InvalidStatResponse",t.InvalidRequest="InvalidRequest",t.RequestFailed="RequestFailed",t.MissingFeatures="MissingFeatures",t.AggregationFieldNotFound="AggregationFieldNotFound",t.DataElementsNotFound="DataElementsNotFound"})(Za||(Za={}));const r3i={[Za.Cancelled]:"Cancelled",[Za.InvalidStatResponse]:"Invalid statistics response from service",[Za.InvalidRequest]:"Invalid request",[Za.RequestFailed]:"Request failed - {reason}",[Za.MissingFeatures]:"Missing features",[Za.AggregationFieldNotFound]:"Aggregation field not found",[Za.DataElementsNotFound]:"Data elements not found on service",[Za.NeverReach]:"Encountered unreachable logic",[Za.NotImplemented]:"Not implemented"};let dc=class jLt extends Error{constructor(e,i){super(CV(r3i[e],i)),this.declaredRootClass="esri.arcade.featureset.support.featureseterror",Error.captureStackTrace&&Error.captureStackTrace(this,jLt)}},UP=class qI{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 Error("Primary and Secondary SqlInterval qualifiers not supported")}static _parseSecondsComponent(e,i){if(i.includes(".")){const r=i.split(".");e.second=parseFloat(r[0]),e.millis=parseInt(r[1],10)}else e.second=parseFloat(i)}static createFromMilliseconds(e){const i=new qI;return i.second=e/1e3,i}static createFromValueAndQualifer(e,i,r){let n=null;const s=new qI;if(s.op=r==="-"?"-":"+",i.type==="interval-period"){qI._fixDefaults(i);const o=new RegExp("^[0-9]{1,}$");if(i.period==="year"||i.period==="month")throw new Error("Year-Month Intervals not supported");if(i.period==="second"){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(e))throw new Error("Illegal Interval");qI._parseSecondsComponent(s,e)}else{if(!o.test(e))throw new Error("Illegal Interval");s[i.period]=parseFloat(e)}}else{if(qI._fixDefaults(i.start),qI._fixDefaults(i.end),i.start.period==="year"||i.start.period==="month")throw new Error("Year-Month Intervals not supported");if(i.end.period==="year"||i.end.period==="month")throw new Error("Year-Month Intervals not supported");switch(i.start.period){case"day":switch(i.end.period){case"hour":if(n=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!n.test(e))throw new Error("Illegal Interval");s[i.start.period]=parseFloat(e.split(" ")[0]),s[i.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 Error("Illegal Interval");{s[i.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 Error("Illegal Interval");{s[i.start.period]=parseFloat(e.split(" ")[0]);const o=e.split(" ")[1].split(":");s.hour=parseFloat(o[0]),s.minute=parseFloat(o[1]),qI._parseSecondsComponent(s,o[2])}break;default:throw new Error("Invalid Interval.")}break;case"hour":switch(i.end.period){case"minute":if(n=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!n.test(e))throw new Error("Illegal Interval");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 Error("Illegal Interval");{const o=e.split(":");s.hour=parseFloat(o[0]),s.minute=parseFloat(o[1]),qI._parseSecondsComponent(s,o[2])}break;default:throw new Error("Invalid Interval.")}break;case"minute":if(i.end.period!=="second")throw new Error("Invalid Interval.");if(n=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!n.test(e))throw new Error("Illegal Interval");{const o=e.split(":");s.minute=parseFloat(o[0]),qI._parseSecondsComponent(s,o[1])}break;default:throw new Error("Invalid Interval.")}}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)}};function uMe(t,e){const i=Bft[t.toLowerCase()];if(i==null)throw new Error("Function Not Recognised");if(e.lengthi.maxParams)throw new Error(`Invalid Parameter count for call to ${t.toUpperCase()}`);return i.evaluate(e)}function n3i(t,e){const i=Bft[t.toLowerCase()];return i!=null&&e>=i.minParams&&e<=i.maxParams}function s3i(t){return typeof t=="string"||t instanceof String}function o3i(t){return t instanceof Date}function Nft(t){const e=new Date(t.getTime());return e.setHours(0,0,0,0),e}function $ft(t,e){if(o3i(t))return e?Nft(t):t;if(s3i(t)){const i=zs.fromSQL(t);if(i.isValid)return e?Nft(i.toJSDate()):i.toJSDate()}throw new lu(ba.CannotCastValue)}const Bft={extract:{minParams:2,maxParams:2,evaluate:([t,e])=>{if(e==null)return null;if(e instanceof Date)switch(t.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()}throw new Error("Invalid Parameter for call to EXTRACT")}},substring:{minParams:2,maxParams:3,evaluate:t=>{if(t.length===2){const[e,i]=t;return e==null||i==null?null:e.toString().substring(i-1)}if(t.length===3){const[e,i,r]=t;return e==null||i==null||r==null?null:r<=0?"":e.toString().substring(i-1,i+r-1)}}},position:{minParams:2,maxParams:2,evaluate:([t,e])=>t==null||e==null?null:e.indexOf(t)+1},trim:{minParams:2,maxParams:3,evaluate:t=>{const e=t.length===3,i=e?t[1]:" ",r=e?t[2]:t[1];if(i==null||r==null)return null;const n=`(${v_e(i)})`;switch(t[0]){case"BOTH":return r.replace(new RegExp(`^${n}*|${n}*$`,"g"),"");case"LEADING":return r.replace(new RegExp(`^${n}*`,"g"),"");case"TRAILING":return r.replace(new RegExp(`${n}*$`,"g"),"")}throw new Error("Invalid Parameter for call to TRIM")}},abs:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.abs(t[0])},ceiling:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.ceil(t[0])},floor:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.floor(t[0])},log:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.log(t[0])},log10:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.log(t[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.sin(t[0])},cos:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.cos(t[0])},tan:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.tan(t[0])},asin:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.asin(t[0])},acos:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.acos(t[0])},atan:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.atan(t[0])},sign:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:t[0]>0?1:t[1]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:t=>t[0]==null||t[1]==null?null:t[0]**t[1]},mod:{minParams:2,maxParams:2,evaluate:t=>t[0]==null||t[1]==null?null:t[0]%t[1]},round:{minParams:1,maxParams:2,evaluate:t=>{const e=t[0],i=t.length===2?10**t[1]:1;return e==null?null:Math.round(e*i)/i}},truncate:{minParams:1,maxParams:2,evaluate:t=>t[0]==null?null:t.length===1?parseInt(t[0].toFixed(0),10):parseFloat(t[0].toFixed(t[1]))},char_length:{minParams:1,maxParams:1,evaluate:t=>typeof t[0]=="string"||t[0]instanceof String?t[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:t=>{let e="";for(let i=0;it[0]==null?null:t[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:t[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:t=>{for(const e of t)if(e!==null)return e;return null}},cosh:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.cosh(t[0])},sinh:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.sinh(t[0])},tanh:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.tanh(t[0])},nullif:{minParams:2,maxParams:2,evaluate:t=>{const e=t[0],i=t[1];return(e instanceof Date?e.valueOf():e)===(i instanceof Date?i.valueOf():i)?null:e}},cast:{minParams:2,maxParams:2,evaluate:t=>{const e=t[0],i=t[1];if(e===null)return null;switch(i.type){case"integer":{const r=parseInt(e,10);if(isNaN(r))throw new lu(ba.CannotCastValue);return r}case"smallint":{const r=parseInt(e,10);if(isNaN(r))throw new lu(ba.CannotCastValue);if(r>32767||r<-32767)throw new lu(ba.CannotCastValue);return r}case"float":case"real":{const r=parseFloat(e);if(isNaN(r))throw new lu(ba.CannotCastValue);return r}case"date":return $ft(e,!0);case"timestamp":return $ft(e,!1);case"varchar":{const r=e.toString();if(r.length>i.size)throw new lu(ba.CannotCastValue);return r}default:throw new lu(ba.InvalidDataType)}}}};var Gft,Vft,cMe={};Vft=function(){function t(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 i(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,c={start:d3},d=d3,p="!",y="=",v=">=",S=">",I="<=",O="<>",L="<",N="!=",G="+",V="-",Y="||",X="*",te="/",re="@",fe="'",ge="N'",_e="''",Ie=".",ke="null",Ne="true",J="false",he="in",xe="is",Pe="like",Oe="escape",Ae="not",ze="and",Ge="or",Je="between",et="from",tt="for",ft="substring",Pt="extract",$t="trim",St="position",Tt="timestamp",Lt="date",at="leading",Ee="trailing",Be="both",mt="cast",kt="as",ct="integer",le="smallint",it="float",pt="real",Le="varchar",ce="to",Ce="interval",Ze="year",yt="month",Ve="day",At="hour",ii="minute",gt="second",Ue="case",ni="end",A="when",ve="then",W="else",T=",",b="(",m=")",_="`",C=/^[A-Za-z_\x80-\uFFFF]/,D=/^[A-Za-z0-9_]/,F=/^[A-Za-z0-9_.\x80-\uFFFF]/,B=/^[^']/,q=/^[0-9]/,Z=/^[eE]/,oe=/^[+\-]/,ue=/^[ \t\n\r]/,be=/^[^`]/,De=ds("!",!1),qe=ds("=",!1),rt=ds(">=",!1),Dt=ds(">",!1),Vt=ds("<=",!1),Ke=ds("<>",!1),Ot=ds("<",!1),ei=ds("!=",!1),Jt=ds("+",!1),Xt=ds("-",!1),ti=ds("||",!1),bi=ds("*",!1),Fi=ds("/",!1),Ri=Ry([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),er=Ry([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),ar=Ry([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),mi=ds("@",!1),dn=ds("'",!1),Lr=ds("N'",!1),xo=ds("''",!1),kr=Ry(["'"],!0,!1),is=ds(".",!1),Hn=Ry([["0","9"]],!1,!1),En=Ry(["e","E"],!1,!1),Kn=Ry(["+","-"],!1,!1),$i=ds("NULL",!0),Ur=ds("TRUE",!0),Qo=ds("FALSE",!0),In=ds("IN",!0),Xi=ds("IS",!0),li=ds("LIKE",!0),H=ds("ESCAPE",!0),xr=ds("NOT",!0),Ta=ds("AND",!0),ea=ds("OR",!0),zt=ds("BETWEEN",!0),Ha=ds("FROM",!0),wi=ds("FOR",!0),_t=ds("SUBSTRING",!0),Mr=ds("EXTRACT",!0),jr=ds("TRIM",!0),Nn=ds("POSITION",!0),Jn=ds("TIMESTAMP",!0),ws=ds("DATE",!0),wa=ds("LEADING",!0),Bt=ds("TRAILING",!0),Ft=ds("BOTH",!0),yi=ds("CAST",!0),Ti=ds("AS",!0),xi=ds("INTEGER",!0),Ki=ds("SMALLINT",!0),ur=ds("FLOAT",!0),pn=ds("REAL",!0),$n=ds("VARCHAR",!0),ko=ds("TO",!0),An=ds("INTERVAL",!0),No=ds("YEAR",!0),Ts=ds("MONTH",!0),xa=ds("DAY",!0),Pu=ds("HOUR",!0),$o=ds("MINUTE",!0),mc=ds("SECOND",!0),ju=ds("CASE",!0),fi=ds("END",!0),_i=ds("WHEN",!0),gi=ds("THEN",!0),_r=ds("ELSE",!0),Wr=ds(",",!1),Gr=ds("(",!1),Kr=ds(")",!1),Cr=Ry([" "," ",` -`,"\r"],!1,!1),Wn=ds("`",!1),Rs=Ry(["`"],!0,!1),Ms=function(Se){return Se},Vo=function(Se,xt){var jt={type:"expression-list"},si=F4(Se,xt);return jt.value=si,jt},Pc=function(Se,xt){return Lx(Se,xt)},Ea=function(Se,xt){return Lx(Se,xt)},Na=function(Se){return v1("NOT",Se)},pr=function(Se,xt){return xt==""||xt==null||xt==null?Se:xt.type=="arithmetic"?Lx(Se,xt.tail):x3(xt.op,Se,xt.right,xt.escape)},Uo=function(Se){return{type:"arithmetic",tail:Se}},uh=function(Se,xt){return{op:Se+"NOT",right:xt}},Nc=function(Se,xt){return{op:Se,right:xt}},Cf=function(Se,xt,jt){return{op:"NOT"+Se,right:{type:"expression-list",value:[xt,jt]}}},Jp=function(Se,xt,jt){return{op:Se,right:{type:"expression-list",value:[xt,jt]}}},ch=function(Se){return Se[0]+" "+Se[2]},Ig=function(Se){return Se[0]+" "+Se[2]},qm=function(Se,xt,jt){return{op:Se,right:xt,escape:jt.value}},ec=function(Se,xt){return{op:Se,right:xt,escape:""}},_p=function(Se,xt){return{op:Se,right:xt}},nd=function(Se){return{op:Se,right:{type:"expression-list",value:[]}}},Zp=function(Se,xt){return{op:Se,right:xt}},$l=function(Se,xt){return Lx(Se,xt)},hh=function(Se,xt){return Lx(Se,xt)},sd=function(Se){return Se.paren=!0,Se},cu=function(Se){return/^CURRENT_DATE$/i.test(Se)?{type:"current-time",mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(Se)?{type:"current-time",mode:"timestamp"}:{type:"column-reference",table:"",column:Se}},Qp=function(Se){return Se},Ph=function(Se,xt){return Se+xt.join("")},Ag=function(Se,xt){return Se+xt.join("")},Pg=function(Se){return{type:"parameter",value:Se[1]}},Yd=function(Se,xt){return{type:"function",name:"extract",args:{type:"expression-list",value:[{type:"string",value:Se},xt]}}},fa=function(Se,xt,jt){return{type:"function",name:"substring",args:{type:"expression-list",value:jt?[Se,xt,jt[2]]:[Se,xt]}}},cm=function(Se,xt){return{type:"function",name:"cast",args:{type:"expression-list",value:[Se,xt]}}},dl=function(){return{type:"data-type",value:{type:"integer"}}},ef=function(){return{type:"data-type",value:{type:"smallint"}}},dh=function(){return{type:"data-type",value:{type:"float"}}},ui=function(){return{type:"data-type",value:{type:"real"}}},pl=function(){return{type:"data-type",value:{type:"date"}}},tf=function(){return{type:"data-type",value:{type:"timestamp"}}},Og=function(Se){return{type:"data-type",value:{type:"varchar",size:parseInt(Se)}}},ta=function(Se,xt,jt){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:Se??"BOTH"},xt,jt]}}},bp=function(Se,xt){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:Se??"BOTH"},xt]}}},Us=function(Se,xt){return{type:"function",name:"position",args:{type:"expression-list",value:[Se,xt]}}},Xs=function(Se,xt){return{type:"function",name:Se,args:xt||{type:"expression-list",value:[]}}},Ql=function(Se){return{type:"timestamp",value:Se.value}},Ou=function(Se,xt,jt){return{type:"interval",value:xt,qualifier:jt,op:Se}},Ym=function(Se,xt){return{type:"interval",value:Se,qualifier:xt,op:""}},th=function(Se,xt){return{type:"interval-qualifier",start:Se,end:xt}},ih=function(Se,xt){return{type:"interval-period",period:Se.value,precision:xt,secondary:null}},yu=function(Se){return{type:"interval-period",period:Se.value,precision:null,secondary:null}},eu=function(Se){return{type:"interval-period",period:Se.value,precision:null,secondary:null}},Wa=function(Se,xt){return{type:"interval-period",period:"second",precision:Se,secondary:xt}},Oh=function(Se){return{type:"interval-period",period:"second",precision:Se,secondary:null}},tc=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},Bl=function(Se,xt){return{type:"interval-period",period:Se.value,precision:xt,secondary:null}},Oc=function(Se){return{type:"interval-period",period:Se.value,precision:null,secondary:null}},Xm=function(Se,xt){return{type:"interval-period",period:"second",precision:Se,secondary:xt}},Xd=function(Se){return{type:"interval-period",period:"second",precision:Se,secondary:null}},Tf=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},Py=function(){return{type:"string",value:"day"}},Rg=function(){return{type:"string",value:"hour"}},Ht=function(){return{type:"string",value:"minute"}},qt=function(){return{type:"string",value:"month"}},Ai=function(){return{type:"string",value:"year"}},ji=function(Se){return parseFloat(Se)},pe=function(Se){return parseFloat(Se)},Fe=function(Se){return{type:"date",value:Se.value}},We=function(){return{type:"null",value:null}},bt=function(){return{type:"boolean",value:!0}},ne=function(){return{type:"boolean",value:!1}},Q=function(){return"'"},se=function(Se){return{type:"string",value:Se.join("")}},me=function(Se,xt){return{type:"case-expression",format:"simple",operand:Se,clauses:xt,else:null}},Te=function(Se,xt,jt){return{type:"case-expression",format:"simple",operand:Se,clauses:xt,else:jt.value}},He=function(Se){return{type:"case-expression",format:"searched",clauses:Se,else:null}},Ye=function(Se,xt){return{type:"case-expression",format:"searched",clauses:Se,else:xt.value}},ot=function(Se,xt){return{type:"when-clause",operand:Se,value:xt}},Ct=function(Se,xt){return{type:"when-clause",operand:Se,value:xt}},Wt=function(Se){return{type:"else-clause",value:Se}},pi=function(Se){return{type:"number",value:Se}},di=function(Se,xt,jt){return parseFloat(Se+xt+jt)},Oi=function(Se,xt){return parseFloat(Se+xt)},zi=function(Se,xt){return parseFloat(Se+xt)},sr=function(Se){return parseFloat(Se)},tr=function(Se,xt){return Se[0]+xt},Sr=function(Se){return"."+(Se??"")},lr=function(Se,xt){return Se+xt},qr=function(Se){return Se.join("")},tn=function(Se,xt){return"e"+(xt===null?"":xt)},kn=function(){return"IN"},Ds=function(){return"IS"},Po=function(){return"LIKE"},tl=function(){return"ESCAPE"},Ks=function(){return"NOT"},hs=function(){return"AND"},yo=function(){return"OR"},rh=function(){return"BETWEEN"},Er=function(){return"FROM"},Rh=function(){return"FOR"},ic=function(){return"SUBSTRING"},Ru=function(){return"EXTRACT"},Gl=function(){return"TRIM"},Mh=function(){return"POSITION"},Rd=function(){return"TIMESTAMP"},Ef=function(){return"DATE"},Dh=function(){return"LEADING"},Md=function(){return"TRAILING"},vl=function(){return"BOTH"},$c=function(){return"CAST"},Vl=function(){return"AS"},uo=function(){return"INTEGER"},Fh=function(){return"SMALLINT"},vu=function(){return"FLOAT"},Lh=function(){return"REAL"},Kd=function(){return"VARCHAR"},Oy=function(){return"TO"},It=function(){return"INTERVAL"},Bi=function(){return"YEAR"},Pr=function(){return"MONTH"},Vn=function(){return"DAY"},ms=function(){return"HOUR"},gs=function(){return"MINUTE"},ma=function(){return"SECOND"},il=function(){return"CASE"},Mg=function(){return"END"},F0=function(){return"WHEN"},If=function(){return"THEN"},hm=function(){return"ELSE"},wp=function(Se){return Se},h3=function(Se){return Se.join("")},nt=0,tu=[{line:1,column:1}],L0=0,Mb=[],cr=0;if("startRule"in s){if(!(s.startRule in c))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');d=c[s.startRule]}function ds(Se,xt){return{type:"literal",text:Se,ignoreCase:xt}}function Ry(Se,xt,jt){return{type:"class",parts:Se,inverted:xt,ignoreCase:jt}}function k$(){return{type:"end"}}function Q7(Se){var xt,jt=tu[Se];if(jt)return jt;for(xt=Se-1;!tu[xt];)xt--;for(jt={line:(jt=tu[xt]).line,column:jt.column};xtL0&&(L0=nt,Mb=[]),Mb.push(Se))}function ez(Se,xt,jt){return new e(e.buildMessage(Se,xt),Se,xt,jt)}function d3(){var Se,xt;return Se=nt,wr(),(xt=ph())!==a?(wr(),Se=Ms(xt)):(nt=Se,Se=a),Se}function ZS(){var Se,xt,jt,si,Un,bl,rc,nh;if(Se=nt,(xt=ph())!==a){for(jt=[],si=nt,Un=wr(),(bl=Fy())!==a?(rc=wr(),(nh=ph())!==a?si=Un=[Un,bl,rc,nh]:(nt=si,si=a)):(nt=si,si=a);si!==a;)jt.push(si),si=nt,Un=wr(),(bl=Fy())!==a?(rc=wr(),(nh=ph())!==a?si=Un=[Un,bl,rc,nh]:(nt=si,si=a)):(nt=si,si=a);Se=Vo(xt,jt)}else nt=Se,Se=a;return Se}function ph(){var Se,xt,jt,si,Un,bl,rc,nh;if(Se=nt,(xt=fI())!==a){for(jt=[],si=nt,Un=wr(),(bl=H$())!==a?(rc=wr(),(nh=fI())!==a?si=Un=[Un,bl,rc,nh]:(nt=si,si=a)):(nt=si,si=a);si!==a;)jt.push(si),si=nt,Un=wr(),(bl=H$())!==a?(rc=wr(),(nh=fI())!==a?si=Un=[Un,bl,rc,nh]:(nt=si,si=a)):(nt=si,si=a);Se=Pc(xt,jt)}else nt=Se,Se=a;return Se}function fI(){var Se,xt,jt,si,Un,bl,rc,nh;if(Se=nt,(xt=p3())!==a){for(jt=[],si=nt,Un=wr(),(bl=b3())!==a?(rc=wr(),(nh=p3())!==a?si=Un=[Un,bl,rc,nh]:(nt=si,si=a)):(nt=si,si=a);si!==a;)jt.push(si),si=nt,Un=wr(),(bl=b3())!==a?(rc=wr(),(nh=p3())!==a?si=Un=[Un,bl,rc,nh]:(nt=si,si=a)):(nt=si,si=a);Se=Ea(xt,jt)}else nt=Se,Se=a;return Se}function p3(){var Se,xt,jt,si,Un;return Se=nt,(xt=Dx())===a&&(xt=nt,n.charCodeAt(nt)===33?(jt=p,nt++):(jt=a,cr===0&&bn(De)),jt!==a?(si=nt,cr++,n.charCodeAt(nt)===61?(Un=y,nt++):(Un=a,cr===0&&bn(qe)),cr--,Un===a?si=void 0:(nt=si,si=a),si!==a?xt=jt=[jt,si]:(nt=xt,xt=a)):(nt=xt,xt=a)),xt!==a?(jt=wr(),(si=p3())!==a?Se=Na(si):(nt=Se,Se=a)):(nt=Se,Se=a),Se===a&&(Se=kh()),Se}function kh(){var Se,xt,jt;return Se=nt,(xt=My())!==a?(wr(),(jt=N$())===a&&(jt=null),Se=pr(xt,jt)):(nt=Se,Se=a),Se}function N$(){var Se;return(Se=co())===a&&(Se=k0())===a&&(Se=y4())===a&&(Se=Km())===a&&(Se=gI()),Se}function co(){var Se,xt,jt,si,Un,bl;if(Se=[],xt=nt,jt=wr(),(si=f1())!==a?(Un=wr(),(bl=My())!==a?xt=jt=[jt,si,Un,bl]:(nt=xt,xt=a)):(nt=xt,xt=a),xt!==a)for(;xt!==a;)Se.push(xt),xt=nt,jt=wr(),(si=f1())!==a?(Un=wr(),(bl=My())!==a?xt=jt=[jt,si,Un,bl]:(nt=xt,xt=a)):(nt=xt,xt=a);else Se=a;return Se!==a&&(Se=Uo(Se)),Se}function f1(){var Se;return n.substr(nt,2)===v?(Se=v,nt+=2):(Se=a,cr===0&&bn(rt)),Se===a&&(n.charCodeAt(nt)===62?(Se=S,nt++):(Se=a,cr===0&&bn(Dt)),Se===a&&(n.substr(nt,2)===I?(Se=I,nt+=2):(Se=a,cr===0&&bn(Vt)),Se===a&&(n.substr(nt,2)===O?(Se=O,nt+=2):(Se=a,cr===0&&bn(Ke)),Se===a&&(n.charCodeAt(nt)===60?(Se=L,nt++):(Se=a,cr===0&&bn(Ot)),Se===a&&(n.charCodeAt(nt)===61?(Se=y,nt++):(Se=a,cr===0&&bn(qe)),Se===a&&(n.substr(nt,2)===N?(Se=N,nt+=2):(Se=a,cr===0&&bn(ei)))))))),Se}function Km(){var Se,xt,jt,si;return Se=nt,(xt=CI())!==a?(wr(),(jt=Dx())!==a?(wr(),(si=My())!==a?Se=uh(xt,si):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se===a&&(Se=nt,(xt=CI())!==a?(wr(),(jt=My())!==a?Se=Nc(xt,jt):(nt=Se,Se=a)):(nt=Se,Se=a)),Se}function y4(){var Se,xt,jt,si,Un,bl;return Se=nt,(xt=Dx())!==a?(wr(),(jt=W$())!==a?(wr(),(si=My())!==a?(wr(),(Un=b3())!==a?(wr(),(bl=My())!==a?Se=Cf(jt,si,bl):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se===a&&(Se=nt,(xt=W$())!==a?(wr(),(jt=My())!==a?(wr(),(si=b3())!==a?(wr(),(Un=My())!==a?Se=Jp(xt,jt,Un):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)),Se}function $$(){var Se,xt,jt,si,Un;return Se=nt,xt=nt,(jt=Dx())!==a?(si=wr(),(Un=T4())!==a?xt=jt=[jt,si,Un]:(nt=xt,xt=a)):(nt=xt,xt=a),xt!==a&&(xt=ch(xt)),(Se=xt)===a&&(Se=T4()),Se}function mI(){var Se,xt,jt,si,Un;return Se=nt,xt=nt,(jt=Dx())!==a?(si=wr(),(Un=tC())!==a?xt=jt=[jt,si,Un]:(nt=xt,xt=a)):(nt=xt,xt=a),xt!==a&&(xt=Ig(xt)),(Se=xt)===a&&(Se=tC()),Se}function gI(){var Se,xt,jt,si;return Se=nt,(xt=$$())!==a?(wr(),(jt=Fb())!==a?(wr(),$a()!==a?(wr(),(si=QS())!==a?Se=qm(xt,jt,si):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se===a&&(Se=nt,(xt=$$())!==a?(wr(),(jt=Fb())!==a?Se=ec(xt,jt):(nt=Se,Se=a)):(nt=Se,Se=a)),Se}function k0(){var Se,xt,jt,si;return Se=nt,(xt=mI())!==a?(wr(),(jt=_l())!==a?(wr(),(si=ZS())!==a?(wr(),nf()!==a?Se=_p(xt,si):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se===a&&(Se=nt,(xt=mI())!==a?(wr(),(jt=_l())!==a?(wr(),(si=nf())!==a?Se=nd(xt):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se===a&&(Se=nt,(xt=mI())!==a?(wr(),(jt=f3())!==a?Se=Zp(xt,jt):(nt=Se,Se=a)):(nt=Se,Se=a))),Se}function My(){var Se,xt,jt,si,Un,bl,rc,nh;if(Se=nt,(xt=yI())!==a){for(jt=[],si=nt,Un=wr(),(bl=v4())!==a?(rc=wr(),(nh=yI())!==a?si=Un=[Un,bl,rc,nh]:(nt=si,si=a)):(nt=si,si=a);si!==a;)jt.push(si),si=nt,Un=wr(),(bl=v4())!==a?(rc=wr(),(nh=yI())!==a?si=Un=[Un,bl,rc,nh]:(nt=si,si=a)):(nt=si,si=a);Se=$l(xt,jt)}else nt=Se,Se=a;return Se}function v4(){var Se;return n.charCodeAt(nt)===43?(Se=G,nt++):(Se=a,cr===0&&bn(Jt)),Se===a&&(n.charCodeAt(nt)===45?(Se=V,nt++):(Se=a,cr===0&&bn(Xt)),Se===a&&(n.substr(nt,2)===Y?(Se=Y,nt+=2):(Se=a,cr===0&&bn(ti)))),Se}function yI(){var Se,xt,jt,si,Un,bl,rc,nh;if(Se=nt,(xt=kv())!==a){for(jt=[],si=nt,Un=wr(),(bl=_4())!==a?(rc=wr(),(nh=kv())!==a?si=Un=[Un,bl,rc,nh]:(nt=si,si=a)):(nt=si,si=a);si!==a;)jt.push(si),si=nt,Un=wr(),(bl=_4())!==a?(rc=wr(),(nh=kv())!==a?si=Un=[Un,bl,rc,nh]:(nt=si,si=a)):(nt=si,si=a);Se=hh(xt,jt)}else nt=Se,Se=a;return Se}function _4(){var Se;return n.charCodeAt(nt)===42?(Se=X,nt++):(Se=a,cr===0&&bn(bi)),Se===a&&(n.charCodeAt(nt)===47?(Se=te,nt++):(Se=a,cr===0&&bn(Fi))),Se}function kv(){var Se,xt;return(Se=Db())===a&&(Se=m3())===a&&(Se=g3())===a&&(Se=iz())===a&&(Se=rz())===a&&(Se=w4())===a&&(Se=x4())===a&&(Se=oz())===a&&(Se=Sa())===a&&(Se=f3())===a&&(Se=nt,_l()!==a?(wr(),(xt=ph())!==a?(wr(),nf()!==a?Se=sd(xt):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)),Se}function Sa(){var Se;return(Se=tz())!==a&&(Se=cu(Se)),Se}function tz(){var Se;return(Se=zr())!==a&&(Se=Qp(Se)),Se}function zr(){var Se,xt,jt,si;if(Se=nt,(xt=vI())!==a){for(jt=[],si=_I();si!==a;)jt.push(si),si=_I();Se=Ph(xt,jt)}else nt=Se,Se=a;return Se}function b4(){var Se,xt,jt,si;if(Se=nt,(xt=vI())!==a){for(jt=[],si=ga();si!==a;)jt.push(si),si=ga();Se=Ag(xt,jt)}else nt=Se,Se=a;return Se}function vI(){var Se;return C.test(n.charAt(nt))?(Se=n.charAt(nt),nt++):(Se=a,cr===0&&bn(Ri)),Se}function ga(){var Se;return D.test(n.charAt(nt))?(Se=n.charAt(nt),nt++):(Se=a,cr===0&&bn(er)),Se}function _I(){var Se;return F.test(n.charAt(nt))?(Se=n.charAt(nt),nt++):(Se=a,cr===0&&bn(ar)),Se}function f3(){var Se,xt,jt;return Se=nt,n.charCodeAt(nt)===64?(xt=re,nt++):(xt=a,cr===0&&bn(mi)),xt!==a&&(jt=b4())!==a?Se=xt=[xt,jt]:(nt=Se,Se=a),Se!==a&&(Se=Pg(Se)),Se}function m3(){var Se,xt,jt;return Se=nt,I4()!==a?(wr(),_l()!==a?(wr(),(xt=no())!==a?(wr(),E4()!==a?(wr(),(jt=ph())!==a?(wr(),nf()!==a?Se=Yd(xt,jt):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se}function g3(){var Se,xt,jt,si,Un,bl,rc;return Se=nt,Dg()!==a?(wr(),_l()!==a?(wr(),(xt=ph())!==a?(wr(),E4()!==a?(wr(),(jt=ph())!==a?(wr(),si=nt,(Un=uz())!==a?(bl=wr(),(rc=ph())!==a?si=Un=[Un,bl,rc,wr()]:(nt=si,si=a)):(nt=si,si=a),si===a&&(si=null),(Un=nf())!==a?Se=fa(xt,jt,si):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se}function w4(){var Se,xt,jt;return Se=nt,od()!==a?(wr(),_l()!==a?(wr(),(xt=ph())!==a?(wr(),w3()!==a?(wr(),(jt=B$())!==a?(wr(),nf()!==a?Se=cm(xt,jt):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se}function B$(){var Se,xt,jt;return Se=nt,(xt=cz())!==a&&(xt=dl()),(Se=xt)===a&&(Se=nt,(xt=q$())!==a&&(xt=ef()),(Se=xt)===a&&(Se=nt,(xt=Fg())!==a&&(xt=dh()),(Se=xt)===a&&(Se=nt,(xt=Vs())!==a&&(xt=ui()),(Se=xt)===a&&(Se=nt,(xt=Jm())!==a&&(xt=pl()),(Se=xt)===a&&(Se=nt,(xt=TI())!==a&&(xt=tf()),(Se=xt)===a&&(Se=nt,(xt=N0())!==a?(wr(),_l()!==a?(wr(),(jt=Ns())!==a?(wr(),nf()!==a?Se=Og(jt):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a))))))),Se}function iz(){var Se,xt,jt,si;return Se=nt,A4()!==a?(wr(),_l()!==a?(wr(),(xt=Nr())===a&&(xt=null),wr(),(jt=ph())!==a?(wr(),E4()!==a?(wr(),(si=ph())!==a?(wr(),nf()!==a?Se=ta(xt,jt,si):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se===a&&(Se=nt,A4()!==a?(wr(),_l()!==a?(wr(),(xt=Nr())===a&&(xt=null),wr(),(jt=ph())!==a?(wr(),nf()!==a?Se=bp(xt,jt):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)),Se}function Nr(){var Se;return(Se=iC())===a&&(Se=EI())===a&&(Se=xp()),Se}function rz(){var Se,xt,jt;return Se=nt,Du()!==a?(wr(),_l()!==a?(wr(),(xt=ph())!==a?(wr(),tC()!==a?(wr(),(jt=ph())!==a?(wr(),nf()!==a?Se=Us(xt,jt):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se}function x4(){var Se,xt,jt;return Se=nt,(xt=D4())!==a?(wr(),_l()!==a?(wr(),(jt=ZS())===a&&(jt=null),wr(),nf()!==a?Se=Xs(xt,jt):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se}function no(){var Se;return(Se=O4())===a&&(Se=hz())===a&&(Se=R4())===a&&(Se=rC())===a&&(Se=M4())===a&&(Se=kb()),Se}function Db(){var Se;return(Se=QS())===a&&(Se=az())===a&&(Se=U$())===a&&(Se=Mu())===a&&(Se=wI())===a&&(Se=nz())===a&&(Se=G$()),Se}function nz(){var Se,xt;return Se=nt,TI()!==a?(wr(),(xt=Fb())!==a?Se=Ql(xt):(nt=Se,Se=a)):(nt=Se,Se=a),Se}function G$(){var Se,xt,jt,si;return Se=nt,P4()!==a?(wr(),n.charCodeAt(nt)===45?(xt=V,nt++):(xt=a,cr===0&&bn(Xt)),xt===a&&(n.charCodeAt(nt)===43?(xt=G,nt++):(xt=a,cr===0&&bn(Jt))),xt!==a?(wr(),(jt=Fb())!==a?(wr(),(si=bI())!==a?Se=Ou(xt,jt,si):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se===a&&(Se=nt,P4()!==a?(wr(),(xt=Fb())!==a?(wr(),(jt=bI())!==a?Se=Ym(xt,jt):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)),Se}function bI(){var Se,xt,jt;return Se=nt,(xt=sz())!==a?(wr(),Y$()!==a?(wr(),(jt=V$())!==a?Se=th(xt,jt):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se===a&&(Se=Mx()),Se}function sz(){var Se,xt,jt;return Se=nt,(xt=dm())!==a?(wr(),_l()!==a?(wr(),(jt=y3())!==a?(wr(),nf()!==a?Se=ih(xt,jt):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se===a&&(Se=nt,(xt=dm())!==a&&(xt=yu(xt)),Se=xt),Se}function V$(){var Se,xt,jt,si;return Se=nt,(xt=dm())!==a&&(xt=eu(xt)),(Se=xt)===a&&(Se=nt,(xt=kb())!==a?(wr(),_l()!==a?(wr(),(jt=y3())!==a?(wr(),Fy()!==a?(wr(),(si=rf())!==a?(wr(),nf()!==a?Se=Wa(jt,si):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se===a&&(Se=nt,(xt=kb())!==a?(wr(),_l()!==a?(wr(),(jt=y3())!==a?(wr(),nf()!==a?Se=Oh(jt):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se===a&&(Se=nt,(xt=kb())!==a&&(xt=tc()),Se=xt))),Se}function Mx(){var Se,xt,jt,si;return Se=nt,(xt=dm())!==a?(wr(),_l()!==a?(wr(),(jt=rf())!==a?(wr(),nf()!==a?Se=Bl(xt,jt):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se===a&&(Se=nt,(xt=dm())!==a&&(xt=Oc(xt)),(Se=xt)===a&&(Se=nt,(xt=kb())!==a?(wr(),_l()!==a?(wr(),(jt=y3())!==a?(wr(),Fy()!==a?(wr(),(si=rf())!==a?(wr(),nf()!==a?Se=Xm(jt,si):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se===a&&(Se=nt,(xt=kb())!==a?(wr(),_l()!==a?(wr(),(jt=rf())!==a?(wr(),nf()!==a?Se=Xd(jt):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se===a&&(Se=nt,(xt=kb())!==a&&(xt=Tf()),Se=xt)))),Se}function dm(){var Se,xt;return Se=nt,(xt=R4())!==a&&(xt=Py()),(Se=xt)===a&&(Se=nt,(xt=rC())!==a&&(xt=Rg()),(Se=xt)===a&&(Se=nt,(xt=M4())!==a&&(xt=Ht()),(Se=xt)===a&&(Se=nt,(xt=hz())!==a&&(xt=qt()),(Se=xt)===a&&(Se=nt,(xt=O4())!==a&&(xt=Ai()),Se=xt)))),Se}function rf(){var Se;return(Se=Ns())!==a&&(Se=ji(Se)),Se}function y3(){var Se;return(Se=Ns())!==a&&(Se=pe(Se)),Se}function wI(){var Se,xt;return Se=nt,Jm()!==a?(wr(),(xt=Fb())!==a?Se=Fe(xt):(nt=Se,Se=a)):(nt=Se,Se=a),Se}function Mu(){var Se;return(Se=SI())!==a&&(Se=We()),Se}function U$(){var Se,xt;return Se=nt,(xt=v3())!==a&&(xt=bt()),(Se=xt)===a&&(Se=nt,(xt=_3())!==a&&(xt=ne()),Se=xt),Se}function Fb(){var Se;return(Se=QS())===a&&(Se=f3()),Se}function QS(){var Se,xt,jt,si,Un;if(Se=nt,n.charCodeAt(nt)===39?(xt=fe,nt++):(xt=a,cr===0&&bn(dn)),xt===a&&(n.substr(nt,2)===ge?(xt=ge,nt+=2):(xt=a,cr===0&&bn(Lr))),xt!==a){for(jt=[],si=nt,n.substr(nt,2)===_e?(Un=_e,nt+=2):(Un=a,cr===0&&bn(xo)),Un!==a&&(Un=Q()),(si=Un)===a&&(B.test(n.charAt(nt))?(si=n.charAt(nt),nt++):(si=a,cr===0&&bn(kr)));si!==a;)jt.push(si),si=nt,n.substr(nt,2)===_e?(Un=_e,nt+=2):(Un=a,cr===0&&bn(xo)),Un!==a&&(Un=Q()),(si=Un)===a&&(B.test(n.charAt(nt))?(si=n.charAt(nt),nt++):(si=a,cr===0&&bn(kr)));n.charCodeAt(nt)===39?(si=fe,nt++):(si=a,cr===0&&bn(dn)),si!==a?Se=se(jt):(nt=Se,Se=a)}else nt=Se,Se=a;return Se}function oz(){var Se;return(Se=S4())===a&&(Se=eC()),Se}function S4(){var Se,xt,jt,si,Un;if(Se=nt,nC()!==a)if(wr(),(xt=ph())!==a){for(wr(),jt=[],si=xI();si!==a;)jt.push(si),si=xI();si=wr(),(Un=II())!==a?Se=me(xt,jt):(nt=Se,Se=a)}else nt=Se,Se=a;else nt=Se,Se=a;if(Se===a)if(Se=nt,nC()!==a)if(wr(),(xt=ph())!==a){for(wr(),jt=[],si=xI();si!==a;)jt.push(si),si=xI();si=wr(),(Un=m1())!==a?(wr(),II()!==a?Se=Te(xt,jt,Un):(nt=Se,Se=a)):(nt=Se,Se=a)}else nt=Se,Se=a;else nt=Se,Se=a;return Se}function eC(){var Se,xt,jt,si;if(Se=nt,nC()!==a){for(wr(),xt=[],jt=C4();jt!==a;)xt.push(jt),jt=C4();jt=wr(),(si=II())!==a?Se=He(xt):(nt=Se,Se=a)}else nt=Se,Se=a;if(Se===a)if(Se=nt,nC()!==a){for(wr(),xt=[],jt=C4();jt!==a;)xt.push(jt),jt=C4();jt=wr(),(si=m1())!==a?(wr(),II()!==a?Se=Ye(xt,si):(nt=Se,Se=a)):(nt=Se,Se=a)}else nt=Se,Se=a;return Se}function C4(){var Se,xt,jt;return Se=nt,Fx()!==a?(wr(),(xt=ph())!==a?(wr(),g1()!==a?(wr(),(jt=ph())!==a?Se=ot(xt,jt):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se}function xI(){var Se,xt,jt;return Se=nt,Fx()!==a?(wr(),(xt=ph())!==a?(wr(),g1()!==a?(wr(),(jt=ph())!==a?Se=Ct(xt,jt):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a)):(nt=Se,Se=a),Se}function m1(){var Se,xt;return Se=nt,Dy()!==a?(wr(),(xt=ph())!==a?Se=Wt(xt):(nt=Se,Se=a)):(nt=Se,Se=a),Se}function az(){var Se,xt,jt,si;return Se=nt,(xt=Lb())!==a?(jt=nt,cr++,si=vI(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=pi(xt):(nt=Se,Se=a)):(nt=Se,Se=a),Se}function Lb(){var Se,xt,jt,si;return Se=nt,(xt=Jd())!==a&&(jt=Nh())!==a&&(si=j$())!==a?Se=di(xt,jt,si):(nt=Se,Se=a),Se===a&&(Se=nt,(xt=Jd())!==a&&(jt=Nh())!==a?Se=Oi(xt,jt):(nt=Se,Se=a),Se===a&&(Se=nt,(xt=Jd())!==a&&(jt=j$())!==a?Se=zi(xt,jt):(nt=Se,Se=a),Se===a&&(Se=nt,(xt=Jd())!==a&&(xt=sr(xt)),Se=xt))),Se}function Jd(){var Se,xt,jt;return(Se=Ns())===a&&(Se=nt,n.charCodeAt(nt)===45?(xt=V,nt++):(xt=a,cr===0&&bn(Xt)),xt===a&&(n.charCodeAt(nt)===43?(xt=G,nt++):(xt=a,cr===0&&bn(Jt))),xt!==a&&(jt=Ns())!==a?Se=tr(xt,jt):(nt=Se,Se=a)),Se}function Nh(){var Se,xt,jt;return Se=nt,n.charCodeAt(nt)===46?(xt=Ie,nt++):(xt=a,cr===0&&bn(is)),xt!==a?((jt=Ns())===a&&(jt=null),Se=Sr(jt)):(nt=Se,Se=a),Se}function j$(){var Se,xt,jt;return Se=nt,(xt=z$())!==a&&(jt=Ns())!==a?Se=lr(xt,jt):(nt=Se,Se=a),Se}function Ns(){var Se,xt;if(Se=[],(xt=lz())!==a)for(;xt!==a;)Se.push(xt),xt=lz();else Se=a;return Se!==a&&(Se=qr(Se)),Se}function lz(){var Se;return q.test(n.charAt(nt))?(Se=n.charAt(nt),nt++):(Se=a,cr===0&&bn(Hn)),Se}function z$(){var Se,xt,jt;return Se=nt,Z.test(n.charAt(nt))?(xt=n.charAt(nt),nt++):(xt=a,cr===0&&bn(En)),xt!==a?(oe.test(n.charAt(nt))?(jt=n.charAt(nt),nt++):(jt=a,cr===0&&bn(Kn)),jt===a&&(jt=null),Se=tn(xt,jt)):(nt=Se,Se=a),Se}function SI(){var Se,xt,jt,si;return Se=nt,n.substr(nt,4).toLowerCase()===ke?(xt=n.substr(nt,4),nt+=4):(xt=a,cr===0&&bn($i)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=xt=[xt,jt]:(nt=Se,Se=a)):(nt=Se,Se=a),Se}function v3(){var Se,xt,jt,si;return Se=nt,n.substr(nt,4).toLowerCase()===Ne?(xt=n.substr(nt,4),nt+=4):(xt=a,cr===0&&bn(Ur)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=xt=[xt,jt]:(nt=Se,Se=a)):(nt=Se,Se=a),Se}function _3(){var Se,xt,jt,si;return Se=nt,n.substr(nt,5).toLowerCase()===J?(xt=n.substr(nt,5),nt+=5):(xt=a,cr===0&&bn(Qo)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=xt=[xt,jt]:(nt=Se,Se=a)):(nt=Se,Se=a),Se}function tC(){var Se,xt,jt,si;return Se=nt,n.substr(nt,2).toLowerCase()===he?(xt=n.substr(nt,2),nt+=2):(xt=a,cr===0&&bn(In)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=kn():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function CI(){var Se,xt,jt,si;return Se=nt,n.substr(nt,2).toLowerCase()===xe?(xt=n.substr(nt,2),nt+=2):(xt=a,cr===0&&bn(Xi)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Ds():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function T4(){var Se,xt,jt,si;return Se=nt,n.substr(nt,4).toLowerCase()===Pe?(xt=n.substr(nt,4),nt+=4):(xt=a,cr===0&&bn(li)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Po():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function $a(){var Se,xt,jt,si;return Se=nt,n.substr(nt,6).toLowerCase()===Oe?(xt=n.substr(nt,6),nt+=6):(xt=a,cr===0&&bn(H)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=tl():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function Dx(){var Se,xt,jt,si;return Se=nt,n.substr(nt,3).toLowerCase()===Ae?(xt=n.substr(nt,3),nt+=3):(xt=a,cr===0&&bn(xr)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Ks():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function b3(){var Se,xt,jt,si;return Se=nt,n.substr(nt,3).toLowerCase()===ze?(xt=n.substr(nt,3),nt+=3):(xt=a,cr===0&&bn(Ta)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=hs():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function H$(){var Se,xt,jt,si;return Se=nt,n.substr(nt,2).toLowerCase()===Ge?(xt=n.substr(nt,2),nt+=2):(xt=a,cr===0&&bn(ea)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=yo():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function W$(){var Se,xt,jt,si;return Se=nt,n.substr(nt,7).toLowerCase()===Je?(xt=n.substr(nt,7),nt+=7):(xt=a,cr===0&&bn(zt)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=rh():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function E4(){var Se,xt,jt,si;return Se=nt,n.substr(nt,4).toLowerCase()===et?(xt=n.substr(nt,4),nt+=4):(xt=a,cr===0&&bn(Ha)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Er():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function uz(){var Se,xt,jt,si;return Se=nt,n.substr(nt,3).toLowerCase()===tt?(xt=n.substr(nt,3),nt+=3):(xt=a,cr===0&&bn(wi)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Rh():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function Dg(){var Se,xt,jt,si;return Se=nt,n.substr(nt,9).toLowerCase()===ft?(xt=n.substr(nt,9),nt+=9):(xt=a,cr===0&&bn(_t)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=ic():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function I4(){var Se,xt,jt,si;return Se=nt,n.substr(nt,7).toLowerCase()===Pt?(xt=n.substr(nt,7),nt+=7):(xt=a,cr===0&&bn(Mr)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Ru():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function A4(){var Se,xt,jt,si;return Se=nt,n.substr(nt,4).toLowerCase()===$t?(xt=n.substr(nt,4),nt+=4):(xt=a,cr===0&&bn(jr)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Gl():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function Du(){var Se,xt,jt,si;return Se=nt,n.substr(nt,8).toLowerCase()===St?(xt=n.substr(nt,8),nt+=8):(xt=a,cr===0&&bn(Nn)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Mh():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function TI(){var Se,xt,jt,si;return Se=nt,n.substr(nt,9).toLowerCase()===Tt?(xt=n.substr(nt,9),nt+=9):(xt=a,cr===0&&bn(Jn)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Rd():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function Jm(){var Se,xt,jt,si;return Se=nt,n.substr(nt,4).toLowerCase()===Lt?(xt=n.substr(nt,4),nt+=4):(xt=a,cr===0&&bn(ws)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Ef():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function iC(){var Se,xt,jt,si;return Se=nt,n.substr(nt,7).toLowerCase()===at?(xt=n.substr(nt,7),nt+=7):(xt=a,cr===0&&bn(wa)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Dh():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function EI(){var Se,xt,jt,si;return Se=nt,n.substr(nt,8).toLowerCase()===Ee?(xt=n.substr(nt,8),nt+=8):(xt=a,cr===0&&bn(Bt)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Md():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function xp(){var Se,xt,jt,si;return Se=nt,n.substr(nt,4).toLowerCase()===Be?(xt=n.substr(nt,4),nt+=4):(xt=a,cr===0&&bn(Ft)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=vl():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function od(){var Se,xt,jt,si;return Se=nt,n.substr(nt,4).toLowerCase()===mt?(xt=n.substr(nt,4),nt+=4):(xt=a,cr===0&&bn(yi)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=$c():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function w3(){var Se,xt,jt,si;return Se=nt,n.substr(nt,2).toLowerCase()===kt?(xt=n.substr(nt,2),nt+=2):(xt=a,cr===0&&bn(Ti)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Vl():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function cz(){var Se,xt,jt,si;return Se=nt,n.substr(nt,7).toLowerCase()===ct?(xt=n.substr(nt,7),nt+=7):(xt=a,cr===0&&bn(xi)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=uo():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function q$(){var Se,xt,jt,si;return Se=nt,n.substr(nt,8).toLowerCase()===le?(xt=n.substr(nt,8),nt+=8):(xt=a,cr===0&&bn(Ki)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Fh():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function Fg(){var Se,xt,jt,si;return Se=nt,n.substr(nt,5).toLowerCase()===it?(xt=n.substr(nt,5),nt+=5):(xt=a,cr===0&&bn(ur)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=vu():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function Vs(){var Se,xt,jt,si;return Se=nt,n.substr(nt,4).toLowerCase()===pt?(xt=n.substr(nt,4),nt+=4):(xt=a,cr===0&&bn(pn)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Lh():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function N0(){var Se,xt,jt,si;return Se=nt,n.substr(nt,7).toLowerCase()===Le?(xt=n.substr(nt,7),nt+=7):(xt=a,cr===0&&bn($n)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Kd():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function Y$(){var Se,xt,jt,si;return Se=nt,n.substr(nt,2).toLowerCase()===ce?(xt=n.substr(nt,2),nt+=2):(xt=a,cr===0&&bn(ko)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Oy():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function P4(){var Se,xt,jt,si;return Se=nt,n.substr(nt,8).toLowerCase()===Ce?(xt=n.substr(nt,8),nt+=8):(xt=a,cr===0&&bn(An)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=It():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function O4(){var Se,xt,jt,si;return Se=nt,n.substr(nt,4).toLowerCase()===Ze?(xt=n.substr(nt,4),nt+=4):(xt=a,cr===0&&bn(No)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Bi():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function hz(){var Se,xt,jt,si;return Se=nt,n.substr(nt,5).toLowerCase()===yt?(xt=n.substr(nt,5),nt+=5):(xt=a,cr===0&&bn(Ts)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Pr():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function R4(){var Se,xt,jt,si;return Se=nt,n.substr(nt,3).toLowerCase()===Ve?(xt=n.substr(nt,3),nt+=3):(xt=a,cr===0&&bn(xa)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Vn():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function rC(){var Se,xt,jt,si;return Se=nt,n.substr(nt,4).toLowerCase()===At?(xt=n.substr(nt,4),nt+=4):(xt=a,cr===0&&bn(Pu)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=ms():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function M4(){var Se,xt,jt,si;return Se=nt,n.substr(nt,6).toLowerCase()===ii?(xt=n.substr(nt,6),nt+=6):(xt=a,cr===0&&bn($o)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=gs():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function kb(){var Se,xt,jt,si;return Se=nt,n.substr(nt,6).toLowerCase()===gt?(xt=n.substr(nt,6),nt+=6):(xt=a,cr===0&&bn(mc)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=ma():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function nC(){var Se,xt,jt,si;return Se=nt,n.substr(nt,4).toLowerCase()===Ue?(xt=n.substr(nt,4),nt+=4):(xt=a,cr===0&&bn(ju)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=il():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function II(){var Se,xt,jt,si;return Se=nt,n.substr(nt,3).toLowerCase()===ni?(xt=n.substr(nt,3),nt+=3):(xt=a,cr===0&&bn(fi)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=Mg():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function Fx(){var Se,xt,jt,si;return Se=nt,n.substr(nt,4).toLowerCase()===A?(xt=n.substr(nt,4),nt+=4):(xt=a,cr===0&&bn(_i)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=F0():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function g1(){var Se,xt,jt,si;return Se=nt,n.substr(nt,4).toLowerCase()===ve?(xt=n.substr(nt,4),nt+=4):(xt=a,cr===0&&bn(gi)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=If():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function Dy(){var Se,xt,jt,si;return Se=nt,n.substr(nt,4).toLowerCase()===W?(xt=n.substr(nt,4),nt+=4):(xt=a,cr===0&&bn(_r)),xt!==a?(jt=nt,cr++,si=ga(),cr--,si===a?jt=void 0:(nt=jt,jt=a),jt!==a?Se=hm():(nt=Se,Se=a)):(nt=Se,Se=a),Se}function Fy(){var Se;return n.charCodeAt(nt)===44?(Se=T,nt++):(Se=a,cr===0&&bn(Wr)),Se}function _l(){var Se;return n.charCodeAt(nt)===40?(Se=b,nt++):(Se=a,cr===0&&bn(Gr)),Se}function nf(){var Se;return n.charCodeAt(nt)===41?(Se=m,nt++):(Se=a,cr===0&&bn(Kr)),Se}function wr(){var Se,xt;for(Se=[],xt=y1();xt!==a;)Se.push(xt),xt=y1();return Se}function y1(){var Se;return ue.test(n.charAt(nt))?(Se=n.charAt(nt),nt++):(Se=a,cr===0&&bn(Cr)),Se}function D4(){var Se,xt,jt,si;if(Se=nt,(xt=b4())!==a&&(xt=wp(xt)),(Se=xt)===a)if(Se=nt,n.charCodeAt(nt)===96?(xt=_,nt++):(xt=a,cr===0&&bn(Wn)),xt!==a){if(jt=[],be.test(n.charAt(nt))?(si=n.charAt(nt),nt++):(si=a,cr===0&&bn(Rs)),si!==a)for(;si!==a;)jt.push(si),be.test(n.charAt(nt))?(si=n.charAt(nt),nt++):(si=a,cr===0&&bn(Rs));else jt=a;jt!==a?(n.charCodeAt(nt)===96?(si=_,nt++):(si=a,cr===0&&bn(Wn)),si!==a?Se=h3(jt):(nt=Se,Se=a)):(nt=Se,Se=a)}else nt=Se,Se=a;return Se}function v1(Se,xt){return{type:"unary-expression",operator:Se,expr:xt}}function x3(Se,xt,jt,si){var Un={type:"binary-expression",operator:Se,left:xt,right:jt};return si!==void 0&&(Un.escape=si),Un}function AI(Se,xt){for(var jt=[Se],si=0;si{const t=Cc.getDefault();return new Yj(t.url)};let HOi=class extends bD{constructor(e,i){super(),this.definition=null,this.context=null,this.definition=e,this.context=i}createFunction(e){return(...i)=>{const r={spatialReference:this.context.spatialReference,console:this.context.console,timeReference:this.context.timeReference?this.context.timeReference: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 Vt(e,It.MaximumCallDepth,null);return bMe(this.definition,r,i,null)}}call(e,i){return UP(e,i,(r,n,s)=>{const o={spatialReference:e.spatialReference,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,timeReference:e.timeReference??null,console:e.console,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};if(o.depthCounter.depth>64)throw new Vt(e,It.MaximumCallDepth,i);return bMe(this.definition,o,s,i)})}marshalledCall(e,i,r,n){return n(e,i,(s,o,a)=>{const l={spatialReference:e.spatialReference,globalScope:r.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,timeReference:e.timeReference??null,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};return a=a.map(c=>!mu(c)||c instanceof Ww?c:wD(c,e,n)),wD(bMe(this.definition,l,a,i),r,n)})}},Xj=class extends QK{constructor(e){super(e)}global(e){const i=this.executingContext.globalScope[e.toLowerCase()];if(i.valueset||(i.value=Js(this.executingContext,i.node),i.valueset=!0),mu(i.value)&&!(i.value instanceof Ww)){const r=new Ww;r.fn=i.value,r.parameterEvaluator=UP,r.context=this.executingContext,i.value=r}return i.value}setGlobal(e,i){if(mu(i))throw new Vt(null,It.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:i,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 i=e.spatialReference;i==null&&(i=new hr({wkid:102100})),this.moduleScope=Qft({},e.customfunctions,e.timeReference),this.executingContext={spatialReference:i,globalScope:this.moduleScope,localScope:null,libraryResolver:new Wj(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},console:e.console?e.console:emt,timeReference:e.timeReference??null,lrucache:e.lrucache,interceptor:e.interceptor,depthCounter:{depth:1}},Js(this.executingContext,this.source.syntax)}};function WOi(t,e){const i=[];for(let r=0;r=r.length)throw new Vt(t,It.OutOfBounds,e);i=$i(r[n]),r[n]=e.operator==="++"?i+1:i-1}else if(r instanceof hs){if(On(n)===!1)throw new Vt(t,It.KeyAccessorMustBeString,e);if(r.hasField(n)!==!0)throw new Vt(t,It.FieldNotFound,e);i=$i(r.field(n)),r.setField(n,e.operator==="++"?i+1:i-1)}else if(wu(r)){if(On(n)===!1)throw new Vt(t,It.KeyAccessorMustBeString,e);if(r.hasField(n)!==!0)throw new Vt(t,It.FieldNotFound,e);i=$i(r.field(n)),r.setField(n,e.operator==="++"?i+1:i-1)}else{if(Ds(r))throw new Vt(t,It.Immutable,e);if(!(r instanceof Xj))throw new Vt(t,It.InvalidParameter,e);if(On(n)===!1)throw new Vt(t,It.ModuleAccessorMustBeString,e);if(r.hasGlobal(n)!==!0)throw new Vt(t,It.ModuleExportNotFound,e);i=$i(r.global(n)),r.setGlobal(n,e.operator==="++"?i+1:i-1)}return e.prefix===!1?i:e.operator==="++"?i+1:i-1}if(r=e.argument.type==="Identifier"?e.argument.name.toLowerCase():"",!r)throw new Vt(t,It.InvalidIdentifier,e);if(t.localScope!=null&&t.localScope[r]!==void 0)return i=$i(t.localScope[r].value),t.localScope[r]={value:e.operator==="++"?i+1:i-1,valueset:!0,node:e},e.prefix===!1?i:e.operator==="++"?i+1:i-1;if(t.globalScope[r]!==void 0)return i=$i(t.globalScope[r].value),t.globalScope[r]={value:e.operator==="++"?i+1:i-1,valueset:!0,node:e},e.prefix===!1?i:e.operator==="++"?i+1:i-1;throw new Vt(t,It.InvalidIdentifier,e)}function zP(t,e,i,r,n){switch(e){case"=":return t===ln?null:t;case"/=":return $i(i)/$i(t);case"*=":return $i(i)*$i(t);case"-=":return $i(i)-$i(t);case"+=":return On(i)||On(t)?mn(i)+mn(t):$i(i)+$i(t);case"%=":return $i(i)%$i(t);default:throw new Vt(n,It.UnsupportedOperator,r)}}function e3i(t,e){let i=null,r="";if(e.left.type==="MemberExpression"){if(i=Js(t,e.left.object),e.left.computed===!0)r=Js(t,e.left.property);else{if(e.left.property.type!=="Identifier")throw new Vt(t,It.InvalidIdentifier,e);r=e.left.property.name}const s=Js(t,e.right);if(Vn(i)){if(!nl(r))throw new Vt(t,It.ArrayAccessorMustBeNumber,e);if(r<0&&(r=i.length+r),r<0||r>i.length)throw new Vt(t,It.OutOfBounds,e);if(r===i.length){if(e.operator!=="=")throw new Vt(t,It.OutOfBounds,e);i[r]=zP(s,e.operator,i[r],e,t)}else i[r]=zP(s,e.operator,i[r],e,t)}else if(i instanceof hs){if(On(r)===!1)throw new Vt(t,It.KeyAccessorMustBeString,e);if(i.hasField(r)===!0)i.setField(r,zP(s,e.operator,i.field(r),e,t));else{if(e.operator!=="=")throw new Vt(t,It.FieldNotFound,e,{key:r});i.setField(r,zP(s,e.operator,null,e,t))}}else if(wu(i)){if(On(r)===!1)throw new Vt(t,It.KeyAccessorMustBeString,e);if(i.hasField(r)===!0)i.setField(r,zP(s,e.operator,i.field(r),e,t));else{if(e.operator!=="=")throw new Vt(t,It.FieldNotFound,e,{key:r});i.setField(r,zP(s,e.operator,null,e,t))}}else{if(Ds(i))throw new Vt(t,It.Immutable,e);if(!(i instanceof Xj))throw new Vt(t,It.InvalidIdentifier,e);if(On(r)===!1)throw new Vt(t,It.ModuleAccessorMustBeString,e);if(i.hasGlobal(r)!==!0)throw new Vt(t,It.ModuleExportNotFound,e);i.setGlobal(r,zP(s,e.operator,i.global(r),e,t))}return ln}i=e.left.name.toLowerCase();const n=Js(t,e.right);if(t.localScope!=null&&t.localScope[i]!==void 0)return t.localScope[i]={value:zP(n,e.operator,t.localScope[i].value,e,t),valueset:!0,node:e.right},ln;if(t.globalScope[i]!==void 0)return t.globalScope[i]={value:zP(n,e.operator,t.globalScope[i].value,e,t),valueset:!0,node:e.right},ln;throw new Vt(t,It.InvalidIdentifier,e)}function t3i(t,e){if(e.expression.type==="AssignmentExpression"||e.expression.type==="UpdateExpression")return Js(t,e.expression);if(e.expression.type==="CallExpression"){const i=Js(t,e.expression);return i===ln?ln:new nE(i)}{const i=Js(t,e.expression);return i===ln?ln:new nE(i)}}function i3i(t,e){const i=Js(t,e.test);if(i===!0)return Js(t,e.consequent);if(i===!1)return e.alternate!==null?Js(t,e.alternate):ln;throw new Vt(t,It.BooleanConditionRequired,e)}function r3i(t,e){let i=ln;for(let r=0;r=i.length||r<0)throw new Vt(t,It.OutOfBounds,e);return i[r]}throw new Vt(t,It.InvalidMemberAccessKey,e)}if(On(i)){if(nl(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=i.length+r),r>=i.length||r<0)throw new Vt(t,It.OutOfBounds,e);return i[r]}throw new Vt(t,It.InvalidMemberAccessKey,e)}if(Ds(i)){if(nl(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=i.length()+r),r>=i.length()||r<0)throw new Vt(t,It.OutOfBounds,e);return i.get(r)}throw new Vt(t,It.InvalidMemberAccessKey,e)}throw new Vt(t,It.InvalidMemberAccessKey,e)}}catch(i){throw i}}function h3i(t,e){try{const i=Js(t,e.argument);if(Ua(i)){if(e.operator==="!")return!i;if(e.operator==="-")return-1*$i(i);if(e.operator==="+")return 1*$i(i);if(e.operator==="~")return~$i(i);throw new Vt(t,It.UnsupportedUnaryOperator,e)}if(e.operator==="~")return~$i(i);if(e.operator==="-")return-1*$i(i);if(e.operator==="+")return 1*$i(i);throw new Vt(t,It.UnsupportedUnaryOperator,e)}catch(i){throw i}}function d3i(t,e){try{const i=[];for(let r=0;r>":case">>>":case"^":case"&":return Sde($i(r),$i(n),e.operator);case"==":return bv(r,n);case"!=":return!bv(r,n);case"<":case">":case"<=":case">=":return wde(r,n,e.operator);case"+":return On(r)||On(n)?mn(r)+mn(n):$i(r)+$i(n);case"-":return $i(r)-$i(n);case"*":return $i(r)*$i(n);case"/":return $i(r)/$i(n);case"%":return $i(r)%$i(n);default:throw new Vt(t,It.UnsupportedOperator,e)}}catch(i){throw i}}function f3i(t,e){try{const i=Js(t,e.left);if(Ua(i))switch(e.operator){case"||":if(i===!0)return i;{const r=Js(t,e.right);if(Ua(r))return r;throw new Vt(t,It.LogicExpressionOrAnd,e)}case"&&":if(i===!1)return i;{const r=Js(t,e.right);if(Ua(r))return r;throw new Vt(t,It.LogicExpressionOrAnd,e)}default:throw new Vt(t,It.LogicExpressionOrAnd,e)}throw new Vt(t,It.LogicalExpressionOnlyBoolean,e)}catch(i){throw i}}function m3i(t,e){return e.value?e.value.cooked:""}function g3i(t,e,i){if(mu(t))throw new Vt(e,It.NoFunctionInTemplateLiteral,i);return t}function y3i(t,e){let i="",r=0;for(const n of e.quasis)i+=n.value?n.value.cooked:"",n.tail===!1&&(i+=e.expressions[r]?mn(g3i(Js(t,e.expressions[r]),t,e)):"",r++);return i}function Kft(t,e){let i;try{const r=e.name.toLowerCase();if(t.localScope!=null&&t.localScope[r]!==void 0)return i=t.localScope[r],i.valueset===!0||(i.value=Js(t,i.node),i.valueset=!0),i.value;if(t.globalScope[r]!==void 0)return i=t.globalScope[r],i.valueset===!0||(i.value=Js(t,i.node),i.valueset=!0),i.value;throw new Vt(t,It.InvalidIdentifier,e)}catch(r){throw r}}function v3i(t,e){try{if(e.callee.type==="MemberExpression"){const i=Js(t,e.callee.object);if(!(i instanceof Xj))throw new Vt(t,It.FuncionNotFound,e);const r=e.callee.computed===!1?e.callee.property.name:Js(t,e.callee.property);if(!i.hasGlobal(r))throw new Vt(t,It.FuncionNotFound,e);const n=i.global(r);if(!mu(n))throw new Vt(t,It.CallNonFunction,e);return n.call(t,e)}if(e.callee.type!=="Identifier")throw new Vt(t,It.FuncionNotFound,e);if(t.localScope!=null&&t.localScope[e.callee.name.toLowerCase()]!==void 0){const i=t.localScope[e.callee.name.toLowerCase()];if(mu(i.value))return i.value.call(t,e);throw new Vt(t,It.CallNonFunction,e)}if(t.globalScope[e.callee.name.toLowerCase()]!==void 0){const i=t.globalScope[e.callee.name.toLowerCase()];if(mu(i.value))return i.value.call(t,e);throw new Vt(t,It.CallNonFunction,e)}throw new Vt(t,It.FuncionNotFound,e)}catch(i){throw i}}const xv={};function Jft(t,e,i,r){try{const n=Js(t,e.arguments[i]);if(bv(n,r))return Js(t,e.arguments[i+1]);{const s=e.arguments.length-i;return s===1?Js(t,e.arguments[i]):s===2?null:s===3?Js(t,e.arguments[i+2]):Jft(t,e,i+2,r)}}catch(n){throw n}}function Zft(t,e,i,r){try{if(r===!0)return Js(t,e.arguments[i+1]);if(e.arguments.length-i===3)return Js(t,e.arguments[i+2]);{const n=Js(t,e.arguments[i+2]);if(Ua(n)===!1)throw new Vt(t,It.BooleanConditionRequired,e.arguments[i+2]);return Zft(t,e,i+2,n)}}catch(n){throw n}}function bMe(t,e,i,r){try{const n=t.body;if(i.length!==t.params.length)throw new Vt(e,It.WrongNumberOfParameters,r);if(e.localScope!=null)for(let o=0;ooCr),Promise.resolve().then(()=>PPi)]);return rmt=!0,e.setGeometryEngine(t),!0}let IMe=null;function AMe(){return IMe!==null||(IMe=amt()),IMe}async function amt(){await AOi(),oS=await Promise.resolve().then(()=>$Cr);for(const t of xMe)oS.extend(t),Rk(t,"async");return xMe=null,!0}function lmt(){return imt}function umt(){return!!oS}function cmt(){return rmt}let PMe=null;function OMe(){return PMe||(PMe=hmt(),PMe)}async function hmt(){await AMe();const[t,e,i,r,n]=await Promise.all([Promise.resolve().then(()=>cTr),Promise.resolve().then(()=>mTr),Promise.resolve().then(()=>yTr),Promise.resolve().then(()=>_Tr),Promise.resolve().then(()=>wTr)]);return gmt=t,oS.extend([e,i,r,n]),Rk([e,i,r,n],"async"),imt=!0,!0}function dmt(t,e=[]){return t.usesFeatureSet===void 0&&rJ(t,e),t.usesFeatureSet===!0}function I3i(t,e=[]){return t.isAsync===void 0&&rJ(t,e),t.isAsync===!0}function A3i(t,e){if(e){for(const i of e)if(kde(t,i))return!0;return!1}return!1}async function pmt(t,e,i=[],r=!1,n=null){return RMe(new Set,t,e,i,r,n)}async function RMe(t,e,i,r=[],n=!1,s=null){const o=typeof e=="string"?SMe(e):e,a=[];return o&&(cmt()===!1&&($de(o)||n)&&a.push(EMe()),umt()===!1&&(o.isAsync===!0||i)&&a.push(AMe()),lmt()===!1&&(dmt(o)||A3i(o,r))&&a.push(OMe())),a.length&&await Promise.all(a),await fmt(t,o,s,i,n),!0}function P3i(t,e=[]){return t.usesModules===void 0&&rJ(t,e),t.usesModules===!0}async function fmt(t,e,i=null,r=!1,n=!1){const s=nft(e);i===null&&s.length>0&&(i=Yj.getDefault()),e.loadedModules={};for(const o of s){sg(i);const a=i.normalizeModuleUri(o.source);if(t.has(a.uri))throw new Vt(null,It.CircularModules,null);t.add(a.uri);const l=await i.fetchModule(a);await RMe(t,l,r,[],n,i),t.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 mmt(t){if($de(t))return!0;const e=XRe(t);let i=!1;for(let r=0;r{ymt.test(o)&&(o=o.replace(ymt,""),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(M3i).join(".*")}$`,"i");e.forEach(l=>a.test(l)?n.push(l):null)}),[...new Set(n.sort())]}function G3i(t){return kde(t,"$view")}function U3i(t,e){return!!t&&kde(t,e)}function z3i(t){if(!(!t||t.spatialReference==null&&(t.scale==null||t.viewingMode==null)))return{view:t.viewingMode&&t.scale!=null?new hs({viewingMode:t.viewingMode,scale:t.scale}):null,sr:t.spatialReference}}function H3i({url:t,spatialReference:e,lrucache:i,interceptor:r}){const n=Bde();return n?n.createFeatureSetCollectionFromService(t,e,i,r):null}function W3i({layer:t,spatialReference:e,outFields:i,returnGeometry:r,lrucache:n,interceptor:s}){if(t===null)return null;const o=Bde();return o?o.constructFeatureSet(t,e,i,r??!0,n,s):null}function q3i(t){if(t?.map===null)return null;const e=Bde();return e?e.createFeatureSetCollectionFromMap(t.map,t.spatialReference,t.lrucache,t.interceptor):null}function Y3i(t,e){return hs.convertJsonToArcade(t,e)}function X3i(t,e,i=[]){return pmt(t,e,i)}function K3i(){return EMe()}function J3i(){return OMe()}function Z3i(t){return t.type==="simple"||t.type==="class-breaks"||t.type==="unique-value"||t.type==="dot-density"||t.type==="dictionary"||t.type==="pie-chart"}function Q3i(t){return t.declaredClass==="esri.layers.support.LabelClass"}function eRi(t){return t.declaredClass==="esri.PopupTemplate"}function vmt(t,e){if(!t)return!1;if(typeof t=="string")return e(t);const i=t;if(Z3i(i)){if(i.type==="dot-density"){const s=i.attributes?.some(o=>e(o.valueExpression));if(s)return s}const r=i.visualVariables,n=!!r&&r.some(s=>{let o=e(s.valueExpression);return s.type==="size"&&(HC(s.minSize)&&(o=o||e(s.minSize.valueExpression)),HC(s.maxSize)&&(o=o||e(s.maxSize.valueExpression))),o});return!(!("valueExpression"in i)||!e(i.valueExpression))||n}if(Q3i(i)){const r=i.labelExpressionInfo&&i.labelExpressionInfo.expression;return!(!r||!e(r))||!1}return!!eRi(i)&&(!!i.expressionInfos&&i.expressionInfos.some(r=>e(r.expression))||Array.isArray(i.content)&&i.content.some(r=>r.type==="expression"&&e(r.expressionInfo?.expression)))}function tRi(t){const e=fJ(t);return!!e&&mmt(e)}function iRi(t){return vmt(t,tRi)}function rRi(t){const e=fJ(t);return!!e&&$de(e)}function nRi(t){return vmt(t,rRi)}const _mt=Object.freeze(Object.defineProperty({__proto__:null,Dictionary:hs,arcade:O3i,arcadeFeature:dh,convertFeatureLayerToFeatureSet:W3i,convertJsonToArcade:Y3i,convertMapToFeatureSetCollection:q3i,convertServiceUrlToWorkspace:H3i,createExecContext:L3i,createFeature:N3i,createFunction:F3i,createSyntaxTree:fJ,dependsOnView:G3i,enableFeatureSetOperations:J3i,enableGeometryOperations:K3i,evalSyntaxTree:$3i,executeAsyncFunction:V3i,executeFunction:B3i,extractFieldNames:j3i,getArcadeType:D3i,getViewInfo:z3i,hasGeometryFunctions:iRi,hasGeometryOperations:nRi,hasVariable:U3i,loadScriptDependencies:X3i,updateExecContext:k3i},Symbol.toStringTag,{value:"Module"}));function sRi(t,e){const i=bmt[t.toLowerCase()];if(i==null)throw new Error("Function Not Recognised");if(e.lengthi.maxParams)throw new Error(`Invalid Parameter count for call to ${t.toUpperCase()}`);return i.evaluate(e)}function oRi(t,e){const i=bmt[t.toLowerCase()];return i!=null&&e>=i.minParams&&e<=i.maxParams}const bmt={min:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.min.apply(Math,t[0])},max:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.max.apply(Math,t[0])},avg:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:wmt(t[0])},sum:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:aRi(t[0])},stddev:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.sqrt(xmt(t[0]))},count:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:t[0].length},var:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:xmt(t[0])}};function wmt(t){let e=0;for(let i=0;i1?r/(i-1):0}var Ra;(function(t){t.InvalidFunctionParameters="InvalidFunctionParameters",t.UnsupportedSqlFunction="UnsupportedSqlFunction",t.UnsupportedOperator="UnsupportedOperator",t.UnsupportedSyntax="UnsupportedSyntax",t.UnsupportedIsRhs="UnsupportedIsRhs",t.UnsupportedIsLhs="UnsupportedIsLhs",t.InvalidDataType="InvalidDataType",t.CannotCastValue="CannotCastValue",t.MissingStatisticParameters="MissingStatisticParameters"})(Ra||(Ra={}));const lRi={[Ra.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[Ra.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[Ra.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[Ra.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[Ra.UnsupportedOperator]:"Unsupported operator - {operator}",[Ra.UnsupportedSyntax]:"Unsupported syntax - {node}",[Ra.UnsupportedSqlFunction]:"Sql function not found = {function}",[Ra.InvalidDataType]:"Invalid sql data type",[Ra.CannotCastValue]:"Cannot cast value to the required data type"};let gu=class d5t extends Error{constructor(e,i){super(Mj(lRi[e],i)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,d5t)}};var ol;(function(t){t.NeverReach="NeverReach",t.NotImplemented="NotImplemented",t.Cancelled="Cancelled",t.InvalidStatResponse="InvalidStatResponse",t.InvalidRequest="InvalidRequest",t.RequestFailed="RequestFailed",t.MissingFeatures="MissingFeatures",t.AggregationFieldNotFound="AggregationFieldNotFound",t.DataElementsNotFound="DataElementsNotFound"})(ol||(ol={}));const uRi={[ol.Cancelled]:"Cancelled",[ol.InvalidStatResponse]:"Invalid statistics response from service",[ol.InvalidRequest]:"Invalid request",[ol.RequestFailed]:"Request failed - {reason}",[ol.MissingFeatures]:"Missing features",[ol.AggregationFieldNotFound]:"Aggregation field not found",[ol.DataElementsNotFound]:"Data elements not found on service",[ol.NeverReach]:"Encountered unreachable logic",[ol.NotImplemented]:"Not implemented"};let vc=class p5t extends Error{constructor(e,i){super(Mj(uRi[e],i)),this.declaredRootClass="esri.arcade.featureset.support.featureseterror",Error.captureStackTrace&&Error.captureStackTrace(this,p5t)}},HP=class qI{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 Error("Primary and Secondary SqlInterval qualifiers not supported")}static _parseSecondsComponent(e,i){if(i.includes(".")){const r=i.split(".");e.second=parseFloat(r[0]),e.millis=parseInt(r[1],10)}else e.second=parseFloat(i)}static createFromMilliseconds(e){const i=new qI;return i.second=e/1e3,i}static createFromValueAndQualifer(e,i,r){let n=null;const s=new qI;if(s.op=r==="-"?"-":"+",i.type==="interval-period"){qI._fixDefaults(i);const o=new RegExp("^[0-9]{1,}$");if(i.period==="year"||i.period==="month")throw new Error("Year-Month Intervals not supported");if(i.period==="second"){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(e))throw new Error("Illegal Interval");qI._parseSecondsComponent(s,e)}else{if(!o.test(e))throw new Error("Illegal Interval");s[i.period]=parseFloat(e)}}else{if(qI._fixDefaults(i.start),qI._fixDefaults(i.end),i.start.period==="year"||i.start.period==="month")throw new Error("Year-Month Intervals not supported");if(i.end.period==="year"||i.end.period==="month")throw new Error("Year-Month Intervals not supported");switch(i.start.period){case"day":switch(i.end.period){case"hour":if(n=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!n.test(e))throw new Error("Illegal Interval");s[i.start.period]=parseFloat(e.split(" ")[0]),s[i.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 Error("Illegal Interval");{s[i.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 Error("Illegal Interval");{s[i.start.period]=parseFloat(e.split(" ")[0]);const o=e.split(" ")[1].split(":");s.hour=parseFloat(o[0]),s.minute=parseFloat(o[1]),qI._parseSecondsComponent(s,o[2])}break;default:throw new Error("Invalid Interval.")}break;case"hour":switch(i.end.period){case"minute":if(n=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!n.test(e))throw new Error("Illegal Interval");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 Error("Illegal Interval");{const o=e.split(":");s.hour=parseFloat(o[0]),s.minute=parseFloat(o[1]),qI._parseSecondsComponent(s,o[2])}break;default:throw new Error("Invalid Interval.")}break;case"minute":if(i.end.period!=="second")throw new Error("Invalid Interval.");if(n=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!n.test(e))throw new Error("Illegal Interval");{const o=e.split(":");s.minute=parseFloat(o[0]),qI._parseSecondsComponent(s,o[1])}break;default:throw new Error("Invalid Interval.")}}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)}};function MMe(t,e){const i=Tmt[t.toLowerCase()];if(i==null)throw new Error("Function Not Recognised");if(e.lengthi.maxParams)throw new Error(`Invalid Parameter count for call to ${t.toUpperCase()}`);return i.evaluate(e)}function cRi(t,e){const i=Tmt[t.toLowerCase()];return i!=null&&e>=i.minParams&&e<=i.maxParams}function hRi(t){return typeof t=="string"||t instanceof String}function dRi(t){return t instanceof Date}function Smt(t){const e=new Date(t.getTime());return e.setHours(0,0,0,0),e}function Cmt(t,e){if(dRi(t))return e?Smt(t):t;if(hRi(t)){const i=ro.fromSQL(t);if(i.isValid)return e?Smt(i.toJSDate()):i.toJSDate()}throw new gu(Ra.CannotCastValue)}const Tmt={extract:{minParams:2,maxParams:2,evaluate:([t,e])=>{if(e==null)return null;if(e instanceof Date)switch(t.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()}throw new Error("Invalid Parameter for call to EXTRACT")}},substring:{minParams:2,maxParams:3,evaluate:t=>{if(t.length===2){const[e,i]=t;return e==null||i==null?null:e.toString().substring(i-1)}if(t.length===3){const[e,i,r]=t;return e==null||i==null||r==null?null:r<=0?"":e.toString().substring(i-1,i+r-1)}}},position:{minParams:2,maxParams:2,evaluate:([t,e])=>t==null||e==null?null:e.indexOf(t)+1},trim:{minParams:2,maxParams:3,evaluate:t=>{const e=t.length===3,i=e?t[1]:" ",r=e?t[2]:t[1];if(i==null||r==null)return null;const n=`(${x_e(i)})`;switch(t[0]){case"BOTH":return r.replace(new RegExp(`^${n}*|${n}*$`,"g"),"");case"LEADING":return r.replace(new RegExp(`^${n}*`,"g"),"");case"TRAILING":return r.replace(new RegExp(`${n}*$`,"g"),"")}throw new Error("Invalid Parameter for call to TRIM")}},abs:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.abs(t[0])},ceiling:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.ceil(t[0])},floor:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.floor(t[0])},log:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.log(t[0])},log10:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.log(t[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.sin(t[0])},cos:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.cos(t[0])},tan:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.tan(t[0])},asin:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.asin(t[0])},acos:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.acos(t[0])},atan:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.atan(t[0])},sign:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:t[0]>0?1:t[1]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:t=>t[0]==null||t[1]==null?null:t[0]**t[1]},mod:{minParams:2,maxParams:2,evaluate:t=>t[0]==null||t[1]==null?null:t[0]%t[1]},round:{minParams:1,maxParams:2,evaluate:t=>{const e=t[0],i=t.length===2?10**t[1]:1;return e==null?null:Math.round(e*i)/i}},truncate:{minParams:1,maxParams:2,evaluate:t=>t[0]==null?null:t.length===1?parseInt(t[0].toFixed(0),10):parseFloat(t[0].toFixed(t[1]))},char_length:{minParams:1,maxParams:1,evaluate:t=>typeof t[0]=="string"||t[0]instanceof String?t[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:t=>{let e="";for(let i=0;it[0]==null?null:t[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:t[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:t=>{for(const e of t)if(e!==null)return e;return null}},cosh:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.cosh(t[0])},sinh:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.sinh(t[0])},tanh:{minParams:1,maxParams:1,evaluate:t=>t[0]==null?null:Math.tanh(t[0])},nullif:{minParams:2,maxParams:2,evaluate:t=>{const e=t[0],i=t[1];return(e instanceof Date?e.valueOf():e)===(i instanceof Date?i.valueOf():i)?null:e}},cast:{minParams:2,maxParams:2,evaluate:t=>{const e=t[0],i=t[1];if(e===null)return null;switch(i.type){case"integer":{const r=parseInt(e,10);if(isNaN(r))throw new gu(Ra.CannotCastValue);return r}case"smallint":{const r=parseInt(e,10);if(isNaN(r))throw new gu(Ra.CannotCastValue);if(r>32767||r<-32767)throw new gu(Ra.CannotCastValue);return r}case"float":case"real":{const r=parseFloat(e);if(isNaN(r))throw new gu(Ra.CannotCastValue);return r}case"date":return Cmt(e,!0);case"timestamp":return Cmt(e,!1);case"varchar":{const r=e.toString();if(r.length>i.size)throw new gu(Ra.CannotCastValue);return r}default:throw new gu(Ra.InvalidDataType)}}}};var Emt,Imt,DMe={};Imt=function(){function t(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 i(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,c={start:d3},h=d3,p="!",y="=",v=">=",x=">",I="<=",P="<>",F="<",k="!=",j="+",V="-",Y="||",X="*",Z="/",ie="@",ce="'",he="N'",_e="''",xe=".",Pe="null",ke="true",J="false",de="in",Se="is",Ie="like",Re="escape",Oe="not",Ge="and",Be="or",qe="between",et="from",Ze="for",mt="substring",Pt="extract",$t="trim",Ct="position",Et="timestamp",Ft="date",ot="leading",Te="trailing",je="both",pt="cast",kt="as",ct="integer",ae="smallint",ht="float",wt="real",Ne="varchar",pe="to",Ae="interval",tt="year",gt="month",ze="day",Ot="hour",jt="minute",nt="second",$e="case",Xt="end",A="when",ye="then",H="else",T=",",b="(",m=")",_="`",C=/^[A-Za-z_\x80-\uFFFF]/,D=/^[A-Za-z0-9_]/,L=/^[A-Za-z0-9_.\x80-\uFFFF]/,B=/^[^']/,q=/^[0-9]/,Q=/^[eE]/,oe=/^[+\-]/,le=/^[ \t\n\r]/,be=/^[^`]/,Me=As("!",!1),Ye=As("=",!1),it=As(">=",!1),Lt=As(">",!1),Ut=As("<=",!1),Je=As("<>",!1),Rt=As("<",!1),ri=As("!=",!1),ti=As("+",!1),Zt=As("-",!1),ii=As("||",!1),Ci=As("*",!1),ki=As("/",!1),Ni=My([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),tr=My([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),cr=My([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),wi=As("@",!1),bn=As("'",!1),qr=As("N'",!1),eo=As("''",!1),Ur=My(["'"],!0,!1),os=As(".",!1),Wn=My([["0","9"]],!1,!1),Mn=My(["e","E"],!1,!1),es=My(["+","-"],!1,!1),ji=As("NULL",!0),Xr=As("TRUE",!0),wo=As("FALSE",!0),An=As("IN",!0),Zi=As("IS",!0),ui=As("LIKE",!0),W=As("ESCAPE",!0),Mr=As("NOT",!0),Qo=As("AND",!0),Go=As("OR",!0),Wt=As("BETWEEN",!0),Ta=As("FROM",!0),Ti=As("FOR",!0),_t=As("SUBSTRING",!0),Br=As("EXTRACT",!0),Kr=As("TRIM",!0),jn=As("POSITION",!0),Kn=As("TIMESTAMP",!0),Cs=As("DATE",!0),ea=As("LEADING",!0),Bt=As("TRAILING",!0),Nt=As("BOTH",!0),xi=As("CAST",!0),Ai=As("AS",!0),Ei=As("INTEGER",!0),ir=As("SMALLINT",!0),or=As("FLOAT",!0),Cn=As("REAL",!0),Gn=As("VARCHAR",!0),Po=As("TO",!0),Dn=As("INTERVAL",!0),Lo=As("YEAR",!0),si=As("MONTH",!0),vt=As("DAY",!0),Kt=As("HOUR",!0),Di=As("MINUTE",!0),Tr=As("SECOND",!0),Pr=As("CASE",!0),oi=As("END",!0),mi=As("WHEN",!0),yi=As("THEN",!0),vr=As("ELSE",!0),Gr=As(",",!1),Or=As("(",!1),zr=As(")",!1),Ir=My([" "," ",` +`,"\r"],!1,!1),Fn=As("`",!1),gs=My(["`"],!0,!1),Ts=function(Ce){return Ce},fi=function(Ce,St){var Ht={type:"expression-list"},li=k4(Ce,St);return Ht.value=li,Ht},dr=function(Ce,St){return Nx(Ce,St)},wr=function(Ce,St){return Nx(Ce,St)},on=function(Ce){return x1("NOT",Ce)},ar=function(Ce,St){return St==""||St==null||St==null?Ce:St.type=="arithmetic"?Nx(Ce,St.tail):x3(St.op,Ce,St.right,St.escape)},Es=function(Ce){return{type:"arithmetic",tail:Ce}},Ha=function(Ce,St){return{op:Ce+"NOT",right:St}},La=function(Ce,St){return{op:Ce,right:St}},zs=function(Ce,St,Ht){return{op:"NOT"+Ce,right:{type:"expression-list",value:[St,Ht]}}},Eu=function(Ce,St,Ht){return{op:Ce,right:{type:"expression-list",value:[St,Ht]}}},Iu=function(Ce){return Ce[0]+" "+Ce[2]},Vc=function(Ce){return Ce[0]+" "+Ce[2]},jc=function(Ce,St,Ht){return{op:Ce,right:St,escape:Ht.value}},Vl=function(Ce,St){return{op:Ce,right:St,escape:""}},fh=function(Ce,St){return{op:Ce,right:St}},ud=function(Ce){return{op:Ce,right:{type:"expression-list",value:[]}}},rf=function(Ce,St){return{op:Ce,right:St}},Yl=function(Ce,St){return Nx(Ce,St)},mh=function(Ce,St){return Nx(Ce,St)},cd=function(Ce){return Ce.paren=!0,Ce},vu=function(Ce){return/^CURRENT_DATE$/i.test(Ce)?{type:"current-time",mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(Ce)?{type:"current-time",mode:"timestamp"}:{type:"column-reference",table:"",column:Ce}},nf=function(Ce){return Ce},Mh=function(Ce,St){return Ce+St.join("")},Mg=function(Ce,St){return Ce+St.join("")},Dg=function(Ce){return{type:"parameter",value:Ce[1]}},ep=function(Ce,St){return{type:"function",name:"extract",args:{type:"expression-list",value:[{type:"string",value:Ce},St]}}},Ea=function(Ce,St,Ht){return{type:"function",name:"substring",args:{type:"expression-list",value:Ht?[Ce,St,Ht[2]]:[Ce,St]}}},ym=function(Ce,St){return{type:"function",name:"cast",args:{type:"expression-list",value:[Ce,St]}}},wl=function(){return{type:"data-type",value:{type:"integer"}}},sf=function(){return{type:"data-type",value:{type:"smallint"}}},gh=function(){return{type:"data-type",value:{type:"float"}}},pi=function(){return{type:"data-type",value:{type:"real"}}},xl=function(){return{type:"data-type",value:{type:"date"}}},of=function(){return{type:"data-type",value:{type:"timestamp"}}},Fg=function(Ce){return{type:"data-type",value:{type:"varchar",size:parseInt(Ce)}}},ua=function(Ce,St,Ht){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:Ce??"BOTH"},St,Ht]}}},Ep=function(Ce,St){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:Ce??"BOTH"},St]}}},to=function(Ce,St){return{type:"function",name:"position",args:{type:"expression-list",value:[Ce,St]}}},lo=function(Ce,St){return{type:"function",name:Ce,args:St||{type:"expression-list",value:[]}}},uu=function(Ce){return{type:"timestamp",value:Ce.value}},ju=function(Ce,St,Ht){return{type:"interval",value:St,qualifier:Ht,op:Ce}},Jm=function(Ce,St){return{type:"interval",value:Ce,qualifier:St,op:""}},oh=function(Ce,St){return{type:"interval-qualifier",start:Ce,end:St}},ah=function(Ce,St){return{type:"interval-period",period:Ce.value,precision:St,secondary:null}},Au=function(Ce){return{type:"interval-period",period:Ce.value,precision:null,secondary:null}},cu=function(Ce){return{type:"interval-period",period:Ce.value,precision:null,secondary:null}},el=function(Ce,St){return{type:"interval-period",period:"second",precision:Ce,secondary:St}},Dh=function(Ce){return{type:"interval-period",period:"second",precision:Ce,secondary:null}},uc=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},Xl=function(Ce,St){return{type:"interval-period",period:Ce.value,precision:St,secondary:null}},Dc=function(Ce){return{type:"interval-period",period:Ce.value,precision:null,secondary:null}},Zm=function(Ce,St){return{type:"interval-period",period:"second",precision:Ce,secondary:St}},tp=function(Ce){return{type:"interval-period",period:"second",precision:Ce,secondary:null}},Af=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},Oy=function(){return{type:"string",value:"day"}},Lg=function(){return{type:"string",value:"hour"}},qt=function(){return{type:"string",value:"minute"}},Jt=function(){return{type:"string",value:"month"}},Fi=function(){return{type:"string",value:"year"}},Yi=function(Ce){return parseFloat(Ce)},me=function(Ce){return parseFloat(Ce)},Le=function(Ce){return{type:"date",value:Ce.value}},We=function(){return{type:"null",value:null}},bt=function(){return{type:"boolean",value:!0}},ne=function(){return{type:"boolean",value:!1}},ee=function(){return"'"},se=function(Ce){return{type:"string",value:Ce.join("")}},ge=function(Ce,St){return{type:"case-expression",format:"simple",operand:Ce,clauses:St,else:null}},Ee=function(Ce,St,Ht){return{type:"case-expression",format:"simple",operand:Ce,clauses:St,else:Ht.value}},He=function(Ce){return{type:"case-expression",format:"searched",clauses:Ce,else:null}},Xe=function(Ce,St){return{type:"case-expression",format:"searched",clauses:Ce,else:St.value}},at=function(Ce,St){return{type:"when-clause",operand:Ce,value:St}},Tt=function(Ce,St){return{type:"when-clause",operand:Ce,value:St}},Yt=function(Ce){return{type:"else-clause",value:Ce}},bi=function(Ce){return{type:"number",value:Ce}},_i=function(Ce,St,Ht){return parseFloat(Ce+St+Ht)},Li=function(Ce,St){return parseFloat(Ce+St)},Xi=function(Ce,St){return parseFloat(Ce+St)},fr=function(Ce){return parseFloat(Ce)},lr=function(Ce,St){return Ce[0]+St},Fr=function(Ce){return"."+(Ce??"")},gr=function(Ce,St){return Ce+St},nn=function(Ce){return Ce.join("")},pn=function(Ce,St){return"e"+(St===null?"":St)},Jn=function(){return"IN"},Hs=function(){return"IS"},Uo=function(){return"LIKE"},ul=function(){return"ESCAPE"},uo=function(){return"NOT"},Is=function(){return"AND"},Oo=function(){return"OR"},lh=function(){return"BETWEEN"},Nr=function(){return"FROM"},Fh=function(){return"FOR"},cc=function(){return"SUBSTRING"},Gu=function(){return"EXTRACT"},Kl=function(){return"TRIM"},Lh=function(){return"POSITION"},kd=function(){return"TIMESTAMP"},Pf=function(){return"DATE"},Nh=function(){return"LEADING"},$d=function(){return"TRAILING"},Il=function(){return"BOTH"},Gc=function(){return"CAST"},Jl=function(){return"AS"},xo=function(){return"INTEGER"},kh=function(){return"SMALLINT"},Pu=function(){return"FLOAT"},$h=function(){return"REAL"},ip=function(){return"VARCHAR"},Ry=function(){return"TO"},At=function(){return"INTERVAL"},zi=function(){return"YEAR"},Vr=function(){return"MONTH"},ts=function(){return"DAY"},Os=function(){return"HOUR"},Rs=function(){return"MINUTE"},Ia=function(){return"SECOND"},cl=function(){return"CASE"},Ng=function(){return"END"},k0=function(){return"WHEN"},Of=function(){return"THEN"},vm=function(){return"ELSE"},Ip=function(Ce){return Ce},h3=function(Ce){return Ce.join("")},rt=0,hu=[{line:1,column:1}],$0=0,Lb=[],yr=0;if("startRule"in s){if(!(s.startRule in c))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');h=c[s.startRule]}function As(Ce,St){return{type:"literal",text:Ce,ignoreCase:St}}function My(Ce,St,Ht){return{type:"class",parts:Ce,inverted:St,ignoreCase:Ht}}function F$(){return{type:"end"}}function Q7(Ce){var St,Ht=hu[Ce];if(Ht)return Ht;for(St=Ce-1;!hu[St];)St--;for(Ht={line:(Ht=hu[St]).line,column:Ht.column};St$0&&($0=rt,Lb=[]),Lb.push(Ce))}function ez(Ce,St,Ht){return new e(e.buildMessage(Ce,St),Ce,St,Ht)}function d3(){var Ce,St;return Ce=rt,Dr(),(St=yh())!==a?(Dr(),Ce=Ts(St)):(rt=Ce,Ce=a),Ce}function JS(){var Ce,St,Ht,li,is,Pl,hc,ch;if(Ce=rt,(St=yh())!==a){for(Ht=[],li=rt,is=Dr(),(Pl=Ly())!==a?(hc=Dr(),(ch=yh())!==a?li=is=[is,Pl,hc,ch]:(rt=li,li=a)):(rt=li,li=a);li!==a;)Ht.push(li),li=rt,is=Dr(),(Pl=Ly())!==a?(hc=Dr(),(ch=yh())!==a?li=is=[is,Pl,hc,ch]:(rt=li,li=a)):(rt=li,li=a);Ce=fi(St,Ht)}else rt=Ce,Ce=a;return Ce}function yh(){var Ce,St,Ht,li,is,Pl,hc,ch;if(Ce=rt,(St=pI())!==a){for(Ht=[],li=rt,is=Dr(),(Pl=U$())!==a?(hc=Dr(),(ch=pI())!==a?li=is=[is,Pl,hc,ch]:(rt=li,li=a)):(rt=li,li=a);li!==a;)Ht.push(li),li=rt,is=Dr(),(Pl=U$())!==a?(hc=Dr(),(ch=pI())!==a?li=is=[is,Pl,hc,ch]:(rt=li,li=a)):(rt=li,li=a);Ce=dr(St,Ht)}else rt=Ce,Ce=a;return Ce}function pI(){var Ce,St,Ht,li,is,Pl,hc,ch;if(Ce=rt,(St=p3())!==a){for(Ht=[],li=rt,is=Dr(),(Pl=b3())!==a?(hc=Dr(),(ch=p3())!==a?li=is=[is,Pl,hc,ch]:(rt=li,li=a)):(rt=li,li=a);li!==a;)Ht.push(li),li=rt,is=Dr(),(Pl=b3())!==a?(hc=Dr(),(ch=p3())!==a?li=is=[is,Pl,hc,ch]:(rt=li,li=a)):(rt=li,li=a);Ce=wr(St,Ht)}else rt=Ce,Ce=a;return Ce}function p3(){var Ce,St,Ht,li,is;return Ce=rt,(St=Fx())===a&&(St=rt,n.charCodeAt(rt)===33?(Ht=p,rt++):(Ht=a,yr===0&&Rn(Me)),Ht!==a?(li=rt,yr++,n.charCodeAt(rt)===61?(is=y,rt++):(is=a,yr===0&&Rn(Ye)),yr--,is===a?li=void 0:(rt=li,li=a),li!==a?St=Ht=[Ht,li]:(rt=St,St=a)):(rt=St,St=a)),St!==a?(Ht=Dr(),(li=p3())!==a?Ce=on(li):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce===a&&(Ce=Bh()),Ce}function Bh(){var Ce,St,Ht;return Ce=rt,(St=Dy())!==a?(Dr(),(Ht=L$())===a&&(Ht=null),Ce=ar(St,Ht)):(rt=Ce,Ce=a),Ce}function L$(){var Ce;return(Ce=So())===a&&(Ce=B0())===a&&(Ce=b4())===a&&(Ce=Qm())===a&&(Ce=mI()),Ce}function So(){var Ce,St,Ht,li,is,Pl;if(Ce=[],St=rt,Ht=Dr(),(li=v1())!==a?(is=Dr(),(Pl=Dy())!==a?St=Ht=[Ht,li,is,Pl]:(rt=St,St=a)):(rt=St,St=a),St!==a)for(;St!==a;)Ce.push(St),St=rt,Ht=Dr(),(li=v1())!==a?(is=Dr(),(Pl=Dy())!==a?St=Ht=[Ht,li,is,Pl]:(rt=St,St=a)):(rt=St,St=a);else Ce=a;return Ce!==a&&(Ce=Es(Ce)),Ce}function v1(){var Ce;return n.substr(rt,2)===v?(Ce=v,rt+=2):(Ce=a,yr===0&&Rn(it)),Ce===a&&(n.charCodeAt(rt)===62?(Ce=x,rt++):(Ce=a,yr===0&&Rn(Lt)),Ce===a&&(n.substr(rt,2)===I?(Ce=I,rt+=2):(Ce=a,yr===0&&Rn(Ut)),Ce===a&&(n.substr(rt,2)===P?(Ce=P,rt+=2):(Ce=a,yr===0&&Rn(Je)),Ce===a&&(n.charCodeAt(rt)===60?(Ce=F,rt++):(Ce=a,yr===0&&Rn(Rt)),Ce===a&&(n.charCodeAt(rt)===61?(Ce=y,rt++):(Ce=a,yr===0&&Rn(Ye)),Ce===a&&(n.substr(rt,2)===k?(Ce=k,rt+=2):(Ce=a,yr===0&&Rn(ri)))))))),Ce}function Qm(){var Ce,St,Ht,li;return Ce=rt,(St=CI())!==a?(Dr(),(Ht=Fx())!==a?(Dr(),(li=Dy())!==a?Ce=Ha(St,li):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce===a&&(Ce=rt,(St=CI())!==a?(Dr(),(Ht=Dy())!==a?Ce=La(St,Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)),Ce}function b4(){var Ce,St,Ht,li,is,Pl;return Ce=rt,(St=Fx())!==a?(Dr(),(Ht=z$())!==a?(Dr(),(li=Dy())!==a?(Dr(),(is=b3())!==a?(Dr(),(Pl=Dy())!==a?Ce=zs(Ht,li,Pl):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce===a&&(Ce=rt,(St=z$())!==a?(Dr(),(Ht=Dy())!==a?(Dr(),(li=b3())!==a?(Dr(),(is=Dy())!==a?Ce=Eu(St,Ht,is):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)),Ce}function N$(){var Ce,St,Ht,li,is;return Ce=rt,St=rt,(Ht=Fx())!==a?(li=Dr(),(is=A4())!==a?St=Ht=[Ht,li,is]:(rt=St,St=a)):(rt=St,St=a),St!==a&&(St=Iu(St)),(Ce=St)===a&&(Ce=A4()),Ce}function fI(){var Ce,St,Ht,li,is;return Ce=rt,St=rt,(Ht=Fx())!==a?(li=Dr(),(is=SI())!==a?St=Ht=[Ht,li,is]:(rt=St,St=a)):(rt=St,St=a),St!==a&&(St=Vc(St)),(Ce=St)===a&&(Ce=SI()),Ce}function mI(){var Ce,St,Ht,li;return Ce=rt,(St=N$())!==a?(Dr(),(Ht=kb())!==a?(Dr(),Wa()!==a?(Dr(),(li=ZS())!==a?Ce=jc(St,Ht,li):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce===a&&(Ce=rt,(St=N$())!==a?(Dr(),(Ht=kb())!==a?Ce=Vl(St,Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)),Ce}function B0(){var Ce,St,Ht,li;return Ce=rt,(St=fI())!==a?(Dr(),(Ht=Al())!==a?(Dr(),(li=JS())!==a?(Dr(),af()!==a?Ce=fh(St,li):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce===a&&(Ce=rt,(St=fI())!==a?(Dr(),(Ht=Al())!==a?(Dr(),(li=af())!==a?Ce=ud(St):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce===a&&(Ce=rt,(St=fI())!==a?(Dr(),(Ht=f3())!==a?Ce=rf(St,Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a))),Ce}function Dy(){var Ce,St,Ht,li,is,Pl,hc,ch;if(Ce=rt,(St=gI())!==a){for(Ht=[],li=rt,is=Dr(),(Pl=w4())!==a?(hc=Dr(),(ch=gI())!==a?li=is=[is,Pl,hc,ch]:(rt=li,li=a)):(rt=li,li=a);li!==a;)Ht.push(li),li=rt,is=Dr(),(Pl=w4())!==a?(hc=Dr(),(ch=gI())!==a?li=is=[is,Pl,hc,ch]:(rt=li,li=a)):(rt=li,li=a);Ce=Yl(St,Ht)}else rt=Ce,Ce=a;return Ce}function w4(){var Ce;return n.charCodeAt(rt)===43?(Ce=j,rt++):(Ce=a,yr===0&&Rn(ti)),Ce===a&&(n.charCodeAt(rt)===45?(Ce=V,rt++):(Ce=a,yr===0&&Rn(Zt)),Ce===a&&(n.substr(rt,2)===Y?(Ce=Y,rt+=2):(Ce=a,yr===0&&Rn(ii)))),Ce}function gI(){var Ce,St,Ht,li,is,Pl,hc,ch;if(Ce=rt,(St=$v())!==a){for(Ht=[],li=rt,is=Dr(),(Pl=x4())!==a?(hc=Dr(),(ch=$v())!==a?li=is=[is,Pl,hc,ch]:(rt=li,li=a)):(rt=li,li=a);li!==a;)Ht.push(li),li=rt,is=Dr(),(Pl=x4())!==a?(hc=Dr(),(ch=$v())!==a?li=is=[is,Pl,hc,ch]:(rt=li,li=a)):(rt=li,li=a);Ce=mh(St,Ht)}else rt=Ce,Ce=a;return Ce}function x4(){var Ce;return n.charCodeAt(rt)===42?(Ce=X,rt++):(Ce=a,yr===0&&Rn(Ci)),Ce===a&&(n.charCodeAt(rt)===47?(Ce=Z,rt++):(Ce=a,yr===0&&Rn(ki))),Ce}function $v(){var Ce,St;return(Ce=Nb())===a&&(Ce=m3())===a&&(Ce=g3())===a&&(Ce=iz())===a&&(Ce=rz())===a&&(Ce=C4())===a&&(Ce=T4())===a&&(Ce=oz())===a&&(Ce=Ma())===a&&(Ce=f3())===a&&(Ce=rt,Al()!==a?(Dr(),(St=yh())!==a?(Dr(),af()!==a?Ce=cd(St):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)),Ce}function Ma(){var Ce;return(Ce=tz())!==a&&(Ce=vu(Ce)),Ce}function tz(){var Ce;return(Ce=tn())!==a&&(Ce=nf(Ce)),Ce}function tn(){var Ce,St,Ht,li;if(Ce=rt,(St=yI())!==a){for(Ht=[],li=vI();li!==a;)Ht.push(li),li=vI();Ce=Mh(St,Ht)}else rt=Ce,Ce=a;return Ce}function S4(){var Ce,St,Ht,li;if(Ce=rt,(St=yI())!==a){for(Ht=[],li=Aa();li!==a;)Ht.push(li),li=Aa();Ce=Mg(St,Ht)}else rt=Ce,Ce=a;return Ce}function yI(){var Ce;return C.test(n.charAt(rt))?(Ce=n.charAt(rt),rt++):(Ce=a,yr===0&&Rn(Ni)),Ce}function Aa(){var Ce;return D.test(n.charAt(rt))?(Ce=n.charAt(rt),rt++):(Ce=a,yr===0&&Rn(tr)),Ce}function vI(){var Ce;return L.test(n.charAt(rt))?(Ce=n.charAt(rt),rt++):(Ce=a,yr===0&&Rn(cr)),Ce}function f3(){var Ce,St,Ht;return Ce=rt,n.charCodeAt(rt)===64?(St=ie,rt++):(St=a,yr===0&&Rn(wi)),St!==a&&(Ht=S4())!==a?Ce=St=[St,Ht]:(rt=Ce,Ce=a),Ce!==a&&(Ce=Dg(Ce)),Ce}function m3(){var Ce,St,Ht;return Ce=rt,O4()!==a?(Dr(),Al()!==a?(Dr(),(St=rp())!==a?(Dr(),P4()!==a?(Dr(),(Ht=yh())!==a?(Dr(),af()!==a?Ce=ep(St,Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function g3(){var Ce,St,Ht,li,is,Pl,hc;return Ce=rt,kg()!==a?(Dr(),Al()!==a?(Dr(),(St=yh())!==a?(Dr(),P4()!==a?(Dr(),(Ht=yh())!==a?(Dr(),li=rt,(is=uz())!==a?(Pl=Dr(),(hc=yh())!==a?li=is=[is,Pl,hc,Dr()]:(rt=li,li=a)):(rt=li,li=a),li===a&&(li=null),(is=af())!==a?Ce=Ea(St,Ht,li):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function C4(){var Ce,St,Ht;return Ce=rt,hd()!==a?(Dr(),Al()!==a?(Dr(),(St=yh())!==a?(Dr(),w3()!==a?(Dr(),(Ht=k$())!==a?(Dr(),af()!==a?Ce=ym(St,Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function k$(){var Ce,St,Ht;return Ce=rt,(St=cz())!==a&&(St=wl()),(Ce=St)===a&&(Ce=rt,(St=H$())!==a&&(St=sf()),(Ce=St)===a&&(Ce=rt,(St=$g())!==a&&(St=gh()),(Ce=St)===a&&(Ce=rt,(St=Zs())!==a&&(St=pi()),(Ce=St)===a&&(Ce=rt,(St=eg())!==a&&(St=xl()),(Ce=St)===a&&(Ce=rt,(St=TI())!==a&&(St=of()),(Ce=St)===a&&(Ce=rt,(St=V0())!==a?(Dr(),Al()!==a?(Dr(),(Ht=Ys())!==a?(Dr(),af()!==a?Ce=Fg(Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a))))))),Ce}function iz(){var Ce,St,Ht,li;return Ce=rt,R4()!==a?(Dr(),Al()!==a?(Dr(),(St=Qr())===a&&(St=null),Dr(),(Ht=yh())!==a?(Dr(),P4()!==a?(Dr(),(li=yh())!==a?(Dr(),af()!==a?Ce=ua(St,Ht,li):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce===a&&(Ce=rt,R4()!==a?(Dr(),Al()!==a?(Dr(),(St=Qr())===a&&(St=null),Dr(),(Ht=yh())!==a?(Dr(),af()!==a?Ce=Ep(St,Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)),Ce}function Qr(){var Ce;return(Ce=eC())===a&&(Ce=EI())===a&&(Ce=Ap()),Ce}function rz(){var Ce,St,Ht;return Ce=rt,Uu()!==a?(Dr(),Al()!==a?(Dr(),(St=yh())!==a?(Dr(),SI()!==a?(Dr(),(Ht=yh())!==a?(Dr(),af()!==a?Ce=to(St,Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function T4(){var Ce,St,Ht;return Ce=rt,(St=N4())!==a?(Dr(),Al()!==a?(Dr(),(Ht=JS())===a&&(Ht=null),Dr(),af()!==a?Ce=lo(St,Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function rp(){var Ce;return(Ce=D4())===a&&(Ce=hz())===a&&(Ce=F4())===a&&(Ce=tC())===a&&(Ce=L4())===a&&(Ce=Bb()),Ce}function Nb(){var Ce;return(Ce=ZS())===a&&(Ce=az())===a&&(Ce=V$())===a&&(Ce=uh())===a&&(Ce=bI())===a&&(Ce=nz())===a&&(Ce=$$()),Ce}function nz(){var Ce,St;return Ce=rt,TI()!==a?(Dr(),(St=kb())!==a?Ce=uu(St):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function $$(){var Ce,St,Ht,li;return Ce=rt,M4()!==a?(Dr(),n.charCodeAt(rt)===45?(St=V,rt++):(St=a,yr===0&&Rn(Zt)),St===a&&(n.charCodeAt(rt)===43?(St=j,rt++):(St=a,yr===0&&Rn(ti))),St!==a?(Dr(),(Ht=kb())!==a?(Dr(),(li=_I())!==a?Ce=ju(St,Ht,li):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce===a&&(Ce=rt,M4()!==a?(Dr(),(St=kb())!==a?(Dr(),(Ht=_I())!==a?Ce=Jm(St,Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)),Ce}function _I(){var Ce,St,Ht;return Ce=rt,(St=sz())!==a?(Dr(),W$()!==a?(Dr(),(Ht=B$())!==a?Ce=oh(St,Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce===a&&(Ce=Dx()),Ce}function sz(){var Ce,St,Ht;return Ce=rt,(St=_m())!==a?(Dr(),Al()!==a?(Dr(),(Ht=y3())!==a?(Dr(),af()!==a?Ce=ah(St,Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce===a&&(Ce=rt,(St=_m())!==a&&(St=Au(St)),Ce=St),Ce}function B$(){var Ce,St,Ht,li;return Ce=rt,(St=_m())!==a&&(St=cu(St)),(Ce=St)===a&&(Ce=rt,(St=Bb())!==a?(Dr(),Al()!==a?(Dr(),(Ht=y3())!==a?(Dr(),Ly()!==a?(Dr(),(li=Rf())!==a?(Dr(),af()!==a?Ce=el(Ht,li):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce===a&&(Ce=rt,(St=Bb())!==a?(Dr(),Al()!==a?(Dr(),(Ht=y3())!==a?(Dr(),af()!==a?Ce=Dh(Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce===a&&(Ce=rt,(St=Bb())!==a&&(St=uc()),Ce=St))),Ce}function Dx(){var Ce,St,Ht,li;return Ce=rt,(St=_m())!==a?(Dr(),Al()!==a?(Dr(),(Ht=Rf())!==a?(Dr(),af()!==a?Ce=Xl(St,Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce===a&&(Ce=rt,(St=_m())!==a&&(St=Dc(St)),(Ce=St)===a&&(Ce=rt,(St=Bb())!==a?(Dr(),Al()!==a?(Dr(),(Ht=y3())!==a?(Dr(),Ly()!==a?(Dr(),(li=Rf())!==a?(Dr(),af()!==a?Ce=Zm(Ht,li):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce===a&&(Ce=rt,(St=Bb())!==a?(Dr(),Al()!==a?(Dr(),(Ht=Rf())!==a?(Dr(),af()!==a?Ce=tp(Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce===a&&(Ce=rt,(St=Bb())!==a&&(St=Af()),Ce=St)))),Ce}function _m(){var Ce,St;return Ce=rt,(St=F4())!==a&&(St=Oy()),(Ce=St)===a&&(Ce=rt,(St=tC())!==a&&(St=Lg()),(Ce=St)===a&&(Ce=rt,(St=L4())!==a&&(St=qt()),(Ce=St)===a&&(Ce=rt,(St=hz())!==a&&(St=Jt()),(Ce=St)===a&&(Ce=rt,(St=D4())!==a&&(St=Fi()),Ce=St)))),Ce}function Rf(){var Ce;return(Ce=Ys())!==a&&(Ce=Yi(Ce)),Ce}function y3(){var Ce;return(Ce=Ys())!==a&&(Ce=me(Ce)),Ce}function bI(){var Ce,St;return Ce=rt,eg()!==a?(Dr(),(St=kb())!==a?Ce=Le(St):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function uh(){var Ce;return(Ce=xI())!==a&&(Ce=We()),Ce}function V$(){var Ce,St;return Ce=rt,(St=v3())!==a&&(St=bt()),(Ce=St)===a&&(Ce=rt,(St=_3())!==a&&(St=ne()),Ce=St),Ce}function kb(){var Ce;return(Ce=ZS())===a&&(Ce=f3()),Ce}function ZS(){var Ce,St,Ht,li,is;if(Ce=rt,n.charCodeAt(rt)===39?(St=ce,rt++):(St=a,yr===0&&Rn(bn)),St===a&&(n.substr(rt,2)===he?(St=he,rt+=2):(St=a,yr===0&&Rn(qr))),St!==a){for(Ht=[],li=rt,n.substr(rt,2)===_e?(is=_e,rt+=2):(is=a,yr===0&&Rn(eo)),is!==a&&(is=ee()),(li=is)===a&&(B.test(n.charAt(rt))?(li=n.charAt(rt),rt++):(li=a,yr===0&&Rn(Ur)));li!==a;)Ht.push(li),li=rt,n.substr(rt,2)===_e?(is=_e,rt+=2):(is=a,yr===0&&Rn(eo)),is!==a&&(is=ee()),(li=is)===a&&(B.test(n.charAt(rt))?(li=n.charAt(rt),rt++):(li=a,yr===0&&Rn(Ur)));n.charCodeAt(rt)===39?(li=ce,rt++):(li=a,yr===0&&Rn(bn)),li!==a?Ce=se(Ht):(rt=Ce,Ce=a)}else rt=Ce,Ce=a;return Ce}function oz(){var Ce;return(Ce=E4())===a&&(Ce=QS()),Ce}function E4(){var Ce,St,Ht,li,is;if(Ce=rt,iC()!==a)if(Dr(),(St=yh())!==a){for(Dr(),Ht=[],li=wI();li!==a;)Ht.push(li),li=wI();li=Dr(),(is=II())!==a?Ce=ge(St,Ht):(rt=Ce,Ce=a)}else rt=Ce,Ce=a;else rt=Ce,Ce=a;if(Ce===a)if(Ce=rt,iC()!==a)if(Dr(),(St=yh())!==a){for(Dr(),Ht=[],li=wI();li!==a;)Ht.push(li),li=wI();li=Dr(),(is=_1())!==a?(Dr(),II()!==a?Ce=Ee(St,Ht,is):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)}else rt=Ce,Ce=a;else rt=Ce,Ce=a;return Ce}function QS(){var Ce,St,Ht,li;if(Ce=rt,iC()!==a){for(Dr(),St=[],Ht=I4();Ht!==a;)St.push(Ht),Ht=I4();Ht=Dr(),(li=II())!==a?Ce=He(St):(rt=Ce,Ce=a)}else rt=Ce,Ce=a;if(Ce===a)if(Ce=rt,iC()!==a){for(Dr(),St=[],Ht=I4();Ht!==a;)St.push(Ht),Ht=I4();Ht=Dr(),(li=_1())!==a?(Dr(),II()!==a?Ce=Xe(St,li):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)}else rt=Ce,Ce=a;return Ce}function I4(){var Ce,St,Ht;return Ce=rt,Lx()!==a?(Dr(),(St=yh())!==a?(Dr(),b1()!==a?(Dr(),(Ht=yh())!==a?Ce=at(St,Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function wI(){var Ce,St,Ht;return Ce=rt,Lx()!==a?(Dr(),(St=yh())!==a?(Dr(),b1()!==a?(Dr(),(Ht=yh())!==a?Ce=Tt(St,Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function _1(){var Ce,St;return Ce=rt,Fy()!==a?(Dr(),(St=yh())!==a?Ce=Yt(St):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function az(){var Ce,St,Ht,li;return Ce=rt,(St=$b())!==a?(Ht=rt,yr++,li=yI(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=bi(St):(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function $b(){var Ce,St,Ht,li;return Ce=rt,(St=np())!==a&&(Ht=Vh())!==a&&(li=j$())!==a?Ce=_i(St,Ht,li):(rt=Ce,Ce=a),Ce===a&&(Ce=rt,(St=np())!==a&&(Ht=Vh())!==a?Ce=Li(St,Ht):(rt=Ce,Ce=a),Ce===a&&(Ce=rt,(St=np())!==a&&(Ht=j$())!==a?Ce=Xi(St,Ht):(rt=Ce,Ce=a),Ce===a&&(Ce=rt,(St=np())!==a&&(St=fr(St)),Ce=St))),Ce}function np(){var Ce,St,Ht;return(Ce=Ys())===a&&(Ce=rt,n.charCodeAt(rt)===45?(St=V,rt++):(St=a,yr===0&&Rn(Zt)),St===a&&(n.charCodeAt(rt)===43?(St=j,rt++):(St=a,yr===0&&Rn(ti))),St!==a&&(Ht=Ys())!==a?Ce=lr(St,Ht):(rt=Ce,Ce=a)),Ce}function Vh(){var Ce,St,Ht;return Ce=rt,n.charCodeAt(rt)===46?(St=xe,rt++):(St=a,yr===0&&Rn(os)),St!==a?((Ht=Ys())===a&&(Ht=null),Ce=Fr(Ht)):(rt=Ce,Ce=a),Ce}function j$(){var Ce,St,Ht;return Ce=rt,(St=G$())!==a&&(Ht=Ys())!==a?Ce=gr(St,Ht):(rt=Ce,Ce=a),Ce}function Ys(){var Ce,St;if(Ce=[],(St=lz())!==a)for(;St!==a;)Ce.push(St),St=lz();else Ce=a;return Ce!==a&&(Ce=nn(Ce)),Ce}function lz(){var Ce;return q.test(n.charAt(rt))?(Ce=n.charAt(rt),rt++):(Ce=a,yr===0&&Rn(Wn)),Ce}function G$(){var Ce,St,Ht;return Ce=rt,Q.test(n.charAt(rt))?(St=n.charAt(rt),rt++):(St=a,yr===0&&Rn(Mn)),St!==a?(oe.test(n.charAt(rt))?(Ht=n.charAt(rt),rt++):(Ht=a,yr===0&&Rn(es)),Ht===a&&(Ht=null),Ce=pn(St,Ht)):(rt=Ce,Ce=a),Ce}function xI(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,4).toLowerCase()===Pe?(St=n.substr(rt,4),rt+=4):(St=a,yr===0&&Rn(ji)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=St=[St,Ht]:(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function v3(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,4).toLowerCase()===ke?(St=n.substr(rt,4),rt+=4):(St=a,yr===0&&Rn(Xr)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=St=[St,Ht]:(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function _3(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,5).toLowerCase()===J?(St=n.substr(rt,5),rt+=5):(St=a,yr===0&&Rn(wo)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=St=[St,Ht]:(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function SI(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,2).toLowerCase()===de?(St=n.substr(rt,2),rt+=2):(St=a,yr===0&&Rn(An)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Jn():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function CI(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,2).toLowerCase()===Se?(St=n.substr(rt,2),rt+=2):(St=a,yr===0&&Rn(Zi)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Hs():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function A4(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,4).toLowerCase()===Ie?(St=n.substr(rt,4),rt+=4):(St=a,yr===0&&Rn(ui)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Uo():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function Wa(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,6).toLowerCase()===Re?(St=n.substr(rt,6),rt+=6):(St=a,yr===0&&Rn(W)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=ul():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function Fx(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,3).toLowerCase()===Oe?(St=n.substr(rt,3),rt+=3):(St=a,yr===0&&Rn(Mr)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=uo():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function b3(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,3).toLowerCase()===Ge?(St=n.substr(rt,3),rt+=3):(St=a,yr===0&&Rn(Qo)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Is():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function U$(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,2).toLowerCase()===Be?(St=n.substr(rt,2),rt+=2):(St=a,yr===0&&Rn(Go)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Oo():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function z$(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,7).toLowerCase()===qe?(St=n.substr(rt,7),rt+=7):(St=a,yr===0&&Rn(Wt)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=lh():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function P4(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,4).toLowerCase()===et?(St=n.substr(rt,4),rt+=4):(St=a,yr===0&&Rn(Ta)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Nr():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function uz(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,3).toLowerCase()===Ze?(St=n.substr(rt,3),rt+=3):(St=a,yr===0&&Rn(Ti)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Fh():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function kg(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,9).toLowerCase()===mt?(St=n.substr(rt,9),rt+=9):(St=a,yr===0&&Rn(_t)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=cc():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function O4(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,7).toLowerCase()===Pt?(St=n.substr(rt,7),rt+=7):(St=a,yr===0&&Rn(Br)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Gu():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function R4(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,4).toLowerCase()===$t?(St=n.substr(rt,4),rt+=4):(St=a,yr===0&&Rn(Kr)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Kl():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function Uu(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,8).toLowerCase()===Ct?(St=n.substr(rt,8),rt+=8):(St=a,yr===0&&Rn(jn)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Lh():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function TI(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,9).toLowerCase()===Et?(St=n.substr(rt,9),rt+=9):(St=a,yr===0&&Rn(Kn)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=kd():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function eg(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,4).toLowerCase()===Ft?(St=n.substr(rt,4),rt+=4):(St=a,yr===0&&Rn(Cs)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Pf():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function eC(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,7).toLowerCase()===ot?(St=n.substr(rt,7),rt+=7):(St=a,yr===0&&Rn(ea)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Nh():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function EI(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,8).toLowerCase()===Te?(St=n.substr(rt,8),rt+=8):(St=a,yr===0&&Rn(Bt)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=$d():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function Ap(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,4).toLowerCase()===je?(St=n.substr(rt,4),rt+=4):(St=a,yr===0&&Rn(Nt)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Il():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function hd(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,4).toLowerCase()===pt?(St=n.substr(rt,4),rt+=4):(St=a,yr===0&&Rn(xi)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Gc():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function w3(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,2).toLowerCase()===kt?(St=n.substr(rt,2),rt+=2):(St=a,yr===0&&Rn(Ai)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Jl():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function cz(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,7).toLowerCase()===ct?(St=n.substr(rt,7),rt+=7):(St=a,yr===0&&Rn(Ei)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=xo():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function H$(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,8).toLowerCase()===ae?(St=n.substr(rt,8),rt+=8):(St=a,yr===0&&Rn(ir)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=kh():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function $g(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,5).toLowerCase()===ht?(St=n.substr(rt,5),rt+=5):(St=a,yr===0&&Rn(or)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Pu():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function Zs(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,4).toLowerCase()===wt?(St=n.substr(rt,4),rt+=4):(St=a,yr===0&&Rn(Cn)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=$h():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function V0(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,7).toLowerCase()===Ne?(St=n.substr(rt,7),rt+=7):(St=a,yr===0&&Rn(Gn)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=ip():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function W$(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,2).toLowerCase()===pe?(St=n.substr(rt,2),rt+=2):(St=a,yr===0&&Rn(Po)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Ry():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function M4(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,8).toLowerCase()===Ae?(St=n.substr(rt,8),rt+=8):(St=a,yr===0&&Rn(Dn)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=At():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function D4(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,4).toLowerCase()===tt?(St=n.substr(rt,4),rt+=4):(St=a,yr===0&&Rn(Lo)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=zi():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function hz(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,5).toLowerCase()===gt?(St=n.substr(rt,5),rt+=5):(St=a,yr===0&&Rn(si)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Vr():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function F4(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,3).toLowerCase()===ze?(St=n.substr(rt,3),rt+=3):(St=a,yr===0&&Rn(vt)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=ts():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function tC(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,4).toLowerCase()===Ot?(St=n.substr(rt,4),rt+=4):(St=a,yr===0&&Rn(Kt)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Os():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function L4(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,6).toLowerCase()===jt?(St=n.substr(rt,6),rt+=6):(St=a,yr===0&&Rn(Di)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Rs():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function Bb(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,6).toLowerCase()===nt?(St=n.substr(rt,6),rt+=6):(St=a,yr===0&&Rn(Tr)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Ia():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function iC(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,4).toLowerCase()===$e?(St=n.substr(rt,4),rt+=4):(St=a,yr===0&&Rn(Pr)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=cl():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function II(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,3).toLowerCase()===Xt?(St=n.substr(rt,3),rt+=3):(St=a,yr===0&&Rn(oi)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Ng():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function Lx(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,4).toLowerCase()===A?(St=n.substr(rt,4),rt+=4):(St=a,yr===0&&Rn(mi)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=k0():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function b1(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,4).toLowerCase()===ye?(St=n.substr(rt,4),rt+=4):(St=a,yr===0&&Rn(yi)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=Of():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function Fy(){var Ce,St,Ht,li;return Ce=rt,n.substr(rt,4).toLowerCase()===H?(St=n.substr(rt,4),rt+=4):(St=a,yr===0&&Rn(vr)),St!==a?(Ht=rt,yr++,li=Aa(),yr--,li===a?Ht=void 0:(rt=Ht,Ht=a),Ht!==a?Ce=vm():(rt=Ce,Ce=a)):(rt=Ce,Ce=a),Ce}function Ly(){var Ce;return n.charCodeAt(rt)===44?(Ce=T,rt++):(Ce=a,yr===0&&Rn(Gr)),Ce}function Al(){var Ce;return n.charCodeAt(rt)===40?(Ce=b,rt++):(Ce=a,yr===0&&Rn(Or)),Ce}function af(){var Ce;return n.charCodeAt(rt)===41?(Ce=m,rt++):(Ce=a,yr===0&&Rn(zr)),Ce}function Dr(){var Ce,St;for(Ce=[],St=w1();St!==a;)Ce.push(St),St=w1();return Ce}function w1(){var Ce;return le.test(n.charAt(rt))?(Ce=n.charAt(rt),rt++):(Ce=a,yr===0&&Rn(Ir)),Ce}function N4(){var Ce,St,Ht,li;if(Ce=rt,(St=S4())!==a&&(St=Ip(St)),(Ce=St)===a)if(Ce=rt,n.charCodeAt(rt)===96?(St=_,rt++):(St=a,yr===0&&Rn(Fn)),St!==a){if(Ht=[],be.test(n.charAt(rt))?(li=n.charAt(rt),rt++):(li=a,yr===0&&Rn(gs)),li!==a)for(;li!==a;)Ht.push(li),be.test(n.charAt(rt))?(li=n.charAt(rt),rt++):(li=a,yr===0&&Rn(gs));else Ht=a;Ht!==a?(n.charCodeAt(rt)===96?(li=_,rt++):(li=a,yr===0&&Rn(Fn)),li!==a?Ce=h3(Ht):(rt=Ce,Ce=a)):(rt=Ce,Ce=a)}else rt=Ce,Ce=a;return Ce}function x1(Ce,St){return{type:"unary-expression",operator:Ce,expr:St}}function x3(Ce,St,Ht,li){var is={type:"binary-expression",operator:Ce,left:St,right:Ht};return li!==void 0&&(is.escape=li),is}function AI(Ce,St){for(var Ht=[Ce],li=0;li `+c+` `+p+` | `+l.line+" | "+y+` `+p+" | "+i("",l.column-1," ")+i("",v,"^")}else s+=` - at `+c}return s},e.buildMessage=function(n,s){var o={literal:function(v){return'"'+l(v.text)+'"'},class:function(v){var S=v.parts.map(function(I){return Array.isArray(I)?c(I[0])+"-"+c(I[1]):c(I)});return"["+(v.inverted?"^":"")+S.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(v){return v.description}};function a(v){return v.charCodeAt(0).toString(16).toUpperCase()}function l(v){return v.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(S){return"\\x0"+a(S)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(S){return"\\x"+a(S)})}function c(v){return v.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(S){return"\\x0"+a(S)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(S){return"\\x"+a(S)})}function d(v){return o[v.type](v)}function p(v){var S,I,O=v.map(d);if(O.sort(),O.length>0){for(S=1,I=1;S=e?t:new Array(e-t.length+1).join("0")+t}function cJ(t,e,i="0",r="0",n="0",s="0",o="",a="0",l="0"){if(o==="+"||o==="-"){const c=`${MN(parseInt(t,10),4)}-${MN(parseInt(e,10),2)}-${MN(parseInt(i,10),2)}`;let d="";parseFloat(s)<10&&(d="0");const p=`${MN(parseInt(r,10),2)}:${MN(parseInt(n,10),2)}:${d+parseFloat(s).toString()}`,y=`${o}${MN(parseInt(a,10),2)}:${MN(parseInt(l,10),2)}`;return new Date(c+"T"+p+y)}return new Date(parseInt(t,10),parseInt(e,10)-1,parseInt(i,10),parseInt(r,10),parseInt(n,10),parseFloat(s))}let p3i=class{static makeBool(e){return zft(e)}static featureValue(e,i,r,n){return Kft(e,i,r,n)}static equalsNull(e){return e===null}static applyLike(e,i,r){return fMe(e,i,r)}static ensureArray(e){return dMe(e)}static applyIn(e,i){return pMe(e,i)}static currentDate(){const e=new Date;return e.setHours(0,0,0,0),e}static makeSqlInterval(e,i,r){return UP.createFromValueAndQualifer(e,i,r)}static convertInterval(e){return e instanceof UP?e.valueInMilliseconds():e}static currentTimestamp(){return new Date}static compare(e,i,r){return Yft(e,i,r)}static calculate(e,i,r){return Xft(e,i,r)}static makeComparable(e){return jP(e)}static evaluateFunction(e,i){return uMe(e,i)}static lookup(e,i){const r=i[e];return r===void 0?null:r}static between(e,i){return e==null||i[0]==null||i[1]==null?null:e>=i[0]&&e<=i[1]}static notbetween(e,i){return e==null||i[0]==null||i[1]==null?null:ei[1]}static ternaryNot(e){return mde(e)}static ternaryAnd(e,i){return Hft(e,i)}static ternaryOr(e,i){return Wft(e,i)}},Oa=class zLt{constructor(e,i){this.fieldsIndex=i,this._datefields={},this.parameters={},this._hasDateFunctions=void 0,this.parseTree=a3i.parse(e);const{isStandardized:r,isAggregate:n,referencedFieldNames:s}=this._extractExpressionInfo(i);this._referencedFieldNames=s,this.isStandardized=r,this.isAggregate=n}static create(e,i){return new zLt(e,i)}get fieldNames(){return this._referencedFieldNames}testSet(e,i=FN){const r={};for(const n of this.fieldNames)r[n]=e.map(s=>i.getAttribute(s,n));return!!this._evaluateNode(this.parseTree,{attributes:r},FN)}calculateValue(e,i=FN){const r=this._evaluateNode(this.parseTree,e,i);return r instanceof UP?r.valueInMilliseconds()/864e5:r}calculateValueCompiled(e,i=FN){return this.parseTree._compiledVersion!=null?this.parseTree._compiledVersion(e,this.parameters,i,this._datefields):Gi("esri-csp-restrictions")?this.calculateValue(e,i):(this._compileMe(),this.parseTree._compiledVersion(e,this.parameters,i,this._datefields))}testFeature(e,i=FN){return!!this._evaluateNode(this.parseTree,e,i)}testFeatureCompiled(e,i=FN){return this.parseTree._compiledVersion!=null?!!this.parseTree._compiledVersion(e,this.parameters,i,this._datefields):Gi("esri-csp-restrictions")?this.testFeature(e,i):(this._compileMe(),!!this.parseTree._compiledVersion(e,this.parameters,i,this._datefields))}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||d3i.has(e.name.toLowerCase()))})),this._hasDateFunctions}getFunctions(){const e=new Set;return this._visitAll(this.parseTree,i=>{i.type==="function"&&e.add(i.name.toLowerCase())}),Array.from(e)}getExpressions(){const e=new Map;return this._visitAll(this.parseTree,i=>{if(i.type==="function"){const r=i.name.toLowerCase(),n=i.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,i=>{i.type==="parameter"&&e.add(i.value.toLowerCase())}),Array.from(e)}_compileMe(){const e="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=new Function("feature","lookups","attributeAdapter","datefields",e).bind(p3i)}_extractExpressionInfo(e){const i=[],r=new Set;let n=!0,s=!0;return this._visitAll(this.parseTree,o=>{switch(o.type){case"column-reference":{const a=e?.get(o.column);let l,c;a?l=c=a.name??"":(c=o.column,l=c.toLowerCase()),a&&a.name&&(a.type==="date"||a.type==="esriFieldTypeDate")&&(this._datefields[a.name]=1),r.has(l)||(r.add(l),i.push(c)),o.column=c;break}case"function":{const{name:a,args:l}=o,c=l.value.length;n&&(n=n3i(a,c)),s&&(s=e3i(a,c));break}}}),{referencedFieldNames:Array.from(i),isStandardized:n,isAggregate:s}}_visitAll(e,i){if(e!=null)switch(i(e),e.type){case"when-clause":this._visitAll(e.operand,i),this._visitAll(e.value,i);break;case"case-expression":for(const r of e.clauses)this._visitAll(r,i);e.format==="simple"&&this._visitAll(e.operand,i),e.else!==null&&this._visitAll(e.else,i);break;case"expression-list":for(const r of e.value)this._visitAll(r,i);break;case"unary-expression":this._visitAll(e.expr,i);break;case"binary-expression":this._visitAll(e.left,i),this._visitAll(e.right,i);break;case"function":this._visitAll(e.args,i)}}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 i="";if(e.format==="simple"){const r="this.makeComparable("+this.evaluateNodeToJavaScript(e.operand)+")";i="( ";for(let n=0;n":case"<":case">":case">=":case"<=":case"=":return"this.compare("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+")";case"*":case"-":case"+":case"/":case"||":return"this.calculate("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+")"}throw new Error("Not Supported Operator "+e.operator);case"null":case"boolean":case"string":case"number":return JSON.stringify(e.value);case"date":return"(new Date("+jft(e.value).getTime().toString()+"))";case"timestamp":return"(new Date("+hMe(e.value).getTime().toString()+"))";case"current-time":return e.mode==="date"?"this.currentDate()":"this.currentTimestamp()";case"column-reference":return"this.featureValue(feature,"+JSON.stringify(e.column)+",datefields,attributeAdapter)";case"function":return"this.evaluateFunction("+JSON.stringify(e.name)+","+this.evaluateNodeToJavaScript(e.args)+")"}throw new Error("Unsupported sql syntax "+e.type)}_evaluateNode(e,i,r){switch(e.type){case"interval":{const n=this._evaluateNode(e.value,i,r);return UP.createFromValueAndQualifer(n,e.qualifier,e.op)}case"case-expression":if(e.format==="simple"){const n=jP(this._evaluateNode(e.operand,i,r));for(let s=0;s=jP(s[0])&&n<=jP(s[1])}case"NOTBETWEEN":{const n=this._evaluateNode(e.left,i,r),s=this._evaluateNode(e.right,i,r);return n==null||s[0]==null||s[1]==null?null:njP(s[1])}case"LIKE":return fMe(this._evaluateNode(e.left,i,r),this._evaluateNode(e.right,i,r),e.escape);case"NOT LIKE":return mde(fMe(this._evaluateNode(e.left,i,r),this._evaluateNode(e.right,i,r),e.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return Yft(e.operator,this._evaluateNode(e.left,i,r),this._evaluateNode(e.right,i,r));case"-":case"+":case"*":case"/":case"||":return Xft(e.operator,this._evaluateNode(e.left,i,r),this._evaluateNode(e.right,i,r))}case"null":case"boolean":case"string":case"number":return e.value;case"date":return jft(e.value);case"timestamp":return hMe(e.value);case"current-time":{const n=new Date;return e.mode==="date"&&n.setHours(0,0,0,0),n}case"column-reference":return Kft(i,e.column,this._datefields,r);case"data-type":return e.value;case"function":{const n=this._evaluateNode(e.args,i,r);return this.isAggregate?QOi(e.name,n):uMe(e.name,n)}}throw new Error("Unsupported sql syntax "+e.type)}};function hMe(t){let e=l3i.exec(t);if(e!==null){const[,i,r,n,s,o,a]=e;return cJ(i,r,n,s,o,a)}if(e=u3i.exec(t),e!==null){const[,i,r,n,s,o,a,l,c,d]=e;return cJ(i,r,n,s,o,a,l,c,d)}if(e=c3i.exec(t),e!==null){const[,i,r,n,s,o,a,l,c]=e;return cJ(i,r,n,s,o,"0",a,l,c)}if(e=h3i.exec(t),e!==null){const[,i,r,n,s,o]=e;return cJ(i,r,n,s,o)}if(e=Uft.exec(t),e!==null){const[,i,r,n]=e;return cJ(i,r,n)}throw new Error("SQL Invalid Timestamp")}function jft(t){const e=Uft.exec(t);if(e===null)try{return hMe(t)}catch{throw new Error("SQL Invalid Date")}const[,i,r,n]=e;return new Date(parseInt(i,10),parseInt(r,10)-1,parseInt(n,10))}function zft(t){return t===!0}function dMe(t){return Array.isArray(t)?t:[t]}function mde(t){return t!==null?t!==!0:null}function Hft(t,e){return t!=null&&e!=null?t===!0&&e===!0:t!==!1&&e!==!1&&null}function Wft(t,e){return t!=null&&e!=null?t===!0||e===!0:t===!0||e===!0||null}function pMe(t,e){if(t==null)return null;let i=!1;for(const r of e)if(r==null)i=null;else if(t===r){i=!0;break}return i}const qft="-[]/{}()*+?.\\^$|";var DN;function f3i(t,e){const i=e;let r="",n=DN.Normal;for(let s=0;s":return r!==n;case"=":return r===n;case">":return r>n;case"<":return r=":return r>=n;case"<=":return r<=n}}function Xft(t,e,i){if(t==="||")return uMe("concat",[e,i]);if(e instanceof UP)if(i instanceof Date)switch(t){case"+":return new Date(e.valueInMilliseconds()+i.getTime());case"-":return e.valueInMilliseconds()-i.getTime();case"*":return e.valueInMilliseconds()*i.getTime();case"/":return e.valueInMilliseconds()/i.getTime()}else if(i instanceof UP)switch(t){case"+":return UP.createFromMilliseconds(e.valueInMilliseconds()+i.valueInMilliseconds());case"-":return UP.createFromMilliseconds(e.valueInMilliseconds()-i.valueInMilliseconds());case"*":return e.valueInMilliseconds()*i.valueInMilliseconds();case"/":return e.valueInMilliseconds()/i.valueInMilliseconds()}else e=e.valueInMilliseconds();else if(i instanceof UP)if(e instanceof Date)switch(t){case"+":return new Date(i.valueInMilliseconds()+e.getTime());case"-":return new Date(e.getTime()-i.valueInMilliseconds());case"*":return e.getTime()*i.valueInMilliseconds();case"/":return e.getTime()/i.valueInMilliseconds()}else i=i.valueInMilliseconds();else if(e instanceof Date&&typeof i=="number")switch(i=24*i*60*60*1e3,e=e.getTime(),t){case"+":return new Date(e+i);case"-":return new Date(e-i);case"*":return new Date(e*i);case"/":return new Date(e/i)}else if(i instanceof Date&&typeof e=="number")switch(e=24*e*60*60*1e3,i=i.getTime(),t){case"+":return new Date(e+i);case"-":return new Date(e-i);case"*":return new Date(e*i);case"/":return new Date(e/i)}switch(t){case"+":return e+i;case"-":return e-i;case"*":return e*i;case"/":return e/i}}function m3i(t){return t&&typeof t.attributes=="object"}function Kft(t,e,i,r){const n=r.getAttribute(t,e);return n!=null&&i[e]===1?new Date(n):n}(function(t){t[t.Normal=0]="Normal",t[t.Escaped=1]="Escaped"})(DN||(DN={}));const FN={getAttribute:(t,e)=>(m3i(t)?t.attributes:t)[e]},gde=Object.freeze(Object.defineProperty({__proto__:null,WhereClause:Oa,defaultAttributeAdapter:FN},Symbol.toStringTag,{value:"Module"})),g3i={FeatureLayer:!0,SceneLayer:!0};async function y3i(t){const e=t.properties?.customParameters,i=await _3i(t.url,e),r={...t.properties,url:t.url};if(!i.sublayerIds)return i.layerOrTableId!=null&&(r.layerId=i.layerOrTableId,r.sourceJSON=i.sourceJSON),new i.Constructor(r);const n=new(await Promise.resolve().then(()=>N3t)).default({title:i.parsedUrl.title});return v3i(n,i,r),n}function Jft(t,e){return t?t.find(i=>i.id===e):null}function v3i(t,e,i){function r(n,s){const o={...i,layerId:n,sublayerTitleMode:"service-name"};return ye(s)&&(o.sourceJSON=s),new e.Constructor(o)}e.sublayerIds.forEach(n=>{const s=r(n,Jft(e.sublayerInfos,n));t.add(s)}),e.tableIds.forEach(n=>{const s=r(n,Jft(e.tableInfos,n));t.tables.add(s)})}async function _3i(t,e){let i=JC(t);if(lt(i)&&(i=await b3i(t,e)),lt(i))throw new st("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:t});const{serverType:r,sublayer:n}=i;let s;const o={FeatureServer:"FeatureLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer"};switch(r){case"MapServer":n!=null?s="FeatureLayer":s=await S3i(t,e)?"TileLayer":"MapImageLayer";break;case"ImageServer":{const c=await P_(t,{customParameters:e}),{tileInfo:d,cacheType:p}=c;s=d?d?.format?.toUpperCase()!=="LERC"||p&&p.toLowerCase()!=="elevation"?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const c=await P_(i.url.path,{customParameters:e});if(s="SceneLayer",c){const d=c?.layers;if(c?.layerType==="Voxel")s="VoxelLayer";else if(d?.length){const p=d[0]?.layerType;p!=null&&JH[p]!=null&&(s=JH[p])}}break}default:s=o[r]}const a=r==="FeatureServer",l={parsedUrl:i,Constructor:null,layerOrTableId:a?n:void 0,sublayerIds:null,tableIds:null};if(g3i[s]&&n==null){const c=await w3i(t,r,e);a&&(l.sublayerInfos=c.layerInfos,l.tableInfos=c.tableInfos),c.layerIds.length+c.tableIds.length!==1?(l.sublayerIds=c.layerIds,l.tableIds=c.tableIds):a&&(l.layerOrTableId=c.layerIds[0]??c.tableIds[0],l.sourceJSON=c.layerInfos?.[0]??c.tableInfos?.[0])}return l.Constructor=await x3i(s),l}async function b3i(t,e){const i=await P_(t,{customParameters:e});let r=null,n=null;const s=i.type;if(s==="Feature Layer"||s==="Table"?(r="FeatureServer",n=i.id??null):s==="indexedVector"?r="VectorTileServer":i.hasOwnProperty("mapName")?r="MapServer":i.hasOwnProperty("bandCount")&&i.hasOwnProperty("pixelSizeX")?r="ImageServer":i.hasOwnProperty("maxRecordCount")&&i.hasOwnProperty("allowGeometryUpdates")?r="FeatureServer":i.hasOwnProperty("streamUrls")?r="StreamServer":Zft(i)?(r="SceneServer",n=i.id):i.hasOwnProperty("layers")&&Zft(i.layers?.[0])&&(r="SceneServer"),!r)return null;const o=n!=null?RHe(t):null;return{title:ye(o)&&i.name||nne(t),serverType:r,sublayer:n,url:{path:ye(o)?o.serviceUrl:sa(t).path}}}function Zft(t){return t!=null&&t.hasOwnProperty("store")&&t.hasOwnProperty("id")&&typeof t.id=="number"}async function w3i(t,e,i){let r,n=!1;if(e==="FeatureServer"){const a=await K3e(t,{customParameters:i});n=!!a.layersJSON,r=a.layersJSON||a.serviceJSON}else r=await P_(t,{customParameters:i});const s=r?.layers,o=r?.tables;return{layerIds:s?.map(a=>a.id).reverse()||[],tableIds:o?.map(a=>a.id).reverse()||[],layerInfos:n?s:[],tableInfos:n?o:[]}}async function x3i(t){return(0,jw[t])()}async function S3i(t,e){return(await P_(t,{customParameters:e})).tileInfo}const C3i=Object.freeze(Object.defineProperty({__proto__:null,fromUrl:y3i},Symbol.toStringTag,{value:"Module"})),UV=(t,e,i)=>[e,i],Yw=(t,e,i)=>[e,i,t[2]],jV=(t,e,i)=>[e,i,t[2],t[3]];function yde(t){return t?{originPosition:t.originPosition==="upper-left"?"upperLeft":t.originPosition==="lower-left"?"lowerLeft":t.originPosition,scale:t.tolerance?[t.tolerance,t.tolerance]:[1,1],translate:ye(t.extent)?[t.extent.xmin,t.extent.ymax]:[0,0]}:null}function hJ({scale:t,translate:e},i){return Math.round((i-e[0])/t[0])}function dJ({scale:t,translate:e},i){return Math.round((e[1]-i)/t[1])}function mMe(t,e,i){const r=[];let n,s,o,a;for(let l=0;l0?(o=hJ(t,c[0]),a=dJ(t,c[1]),o===n&&a===s||(r.push(e(c,o-n,a-s)),n=o,s=a)):(n=hJ(t,c[0]),s=dJ(t,c[1]),r.push(e(c,n,s)))}return r.length>0?r:null}function T3i(t,e,i,r){return mMe(t,i?r?jV:Yw:r?Yw:UV,e)}function E3i(t,e,i,r){const n=[],s=i?r?jV:Yw:r?Yw:UV;for(let o=0;o=3&&n.push(a)}return n.length?n:null}function I3i(t,e,i,r){const n=[],s=i?r?jV:Yw:r?Yw:UV;for(let o=0;o=2&&n.push(a)}return n.length?n:null}function Qft({scale:t,translate:e},i){return i*t[0]+e[0]}function emt({scale:t,translate:e},i){return e[1]-i*t[1]}function tmt(t,e,i){const r=new Array(i.length);if(!i.length)return r;const[n,s]=t.scale;let o=Qft(t,i[0][0]),a=emt(t,i[0][1]);r[0]=e(i[0],o,a);for(let l=1;ln!=null).length,r={count:i};return t.supportsNullCount&&(r.nullcount=e.length-i),t.percentileParams&&(r.median=_Me(e,t.percentileParams)),r}function vde(t){const{values:e,useSampleStdDev:i,supportsNullCount:r}=t;let n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=null,a=null,l=null,c=null,d=0;const p=t.minValue==null?-1/0:t.minValue,y=t.maxValue==null?1/0:t.maxValue;for(const S of e)Number.isFinite(S)?S>=p&&S<=y&&(o=o===null?S:o+S,n=Math.min(n,S),s=Math.max(s,S),d++):typeof S=="string"&&d++;if(d&&o!=null){a=o/d;let S=0;for(const I of e)Number.isFinite(I)&&I>=p&&I<=y&&(S+=(I-a)**2);c=i?d>1?S/(d-1):0:d>0?S/d:0,l=Math.sqrt(c)}else n=null,s=null;const v={avg:a,count:d,max:s,min:n,stddev:l,sum:o,variance:c};return r&&(v.nullcount=e.length-d),t.percentileParams&&(v.median=_Me(e,t.percentileParams)),v}function _Me(t,e){const{fieldType:i,value:r,orderBy:n,isDiscrete:s}=e,o=nmt(i,n==="desc");if((t=[...t].filter(v=>v!=null).sort((v,S)=>o(v,S))).length===0)return null;if(r<=0)return t[0];if(r>=1)return t[t.length-1];const a=(t.length-1)*r,l=Math.floor(a),c=l+1,d=a%1,p=t[l],y=t[c];return c>=t.length||s||typeof p=="string"||typeof y=="string"?p:p*(1-d)+y*d}function nmt(t,e){const i=e?1:-1,r=W3i(e),n=smt(e);if(!(t&&["esriFieldTypeDate","esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...rmt].includes(t)))return(s,o)=>typeof s=="number"&&typeof o=="number"?r(s,o):typeof s=="string"&&typeof o=="string"?n(s,o):i;if(t==="esriFieldTypeDate")return(s,o)=>{const a=new Date(s).getTime(),l=new Date(o).getTime();return isNaN(a)||isNaN(l)?i:r(a,l)};if(rmt.has(t))return(s,o)=>r(s,o);if(t==="esriFieldTypeString")return(s,o)=>n(s,o);if(t==="esriFieldTypeGUID"||t==="esriFieldTypeGlobalID"){const s=smt(e);return(o,a)=>s(omt(o),omt(a))}return e?(s,o)=>1:(s,o)=>-1}function _de(t,e,i){if(i){if(t==null)return e==null?0:1;if(e==null)return-1}else{if(t==null)return e==null?0:-1;if(e==null)return 1}return null}function smt(t){return t?(e,i)=>{const r=_de(e,i,!0);return r??((e=e.toUpperCase())>(i=i.toUpperCase())?-1:e{const r=_de(e,i,!1);return r??((e=e.toUpperCase())<(i=i.toUpperCase())?-1:e>i?1:0)}}function W3i(t){return t?(e,i)=>{const r=_de(e,i,!0);return r??i-e}:(e,i)=>{const r=_de(e,i,!1);return r??e-i}}function omt(t){return t.substr(24,12)+t.substr(19,4)+t.substr(16,2)+t.substr(14,2)+t.substr(11,2)+t.substr(9,2)+t.substr(6,2)+t.substr(4,2)+t.substr(2,2)+t.substr(0,2)}function amt(t,e){let i;for(i in t)H3i.includes(i)&&(Number.isFinite(t[i])||(t[i]=null));return e&&["avg","stddev","variance"].forEach(r=>{t[r]!=null&&(t[r]=Math.ceil(t[r]))}),t}function lmt(t){const e={};for(let i of t)(i==null||typeof i=="string"&&i.trim()==="")&&(i=null),e[i]==null?e[i]={count:1,data:i}:e[i].count++;return{count:e}}function bMe(t){return t?.type!=="coded-value"?[]:t.codedValues.map(e=>e.code)}function umt(t,e,i,r){const n=t.count,s=[];if(i&&e){const o=[],a=bMe(e[0]);for(const l of a)if(e[1]){const c=bMe(e[1]);for(const d of c)if(e[2]){const p=bMe(e[2]);for(const y of p)o.push(`${aS(l)}${r}${aS(d)}${r}${aS(y)}`)}else o.push(`${aS(l)}${r}${aS(d)}`)}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 cmt(t,e,i,r){let n=null;switch(e){case"log":t!==0&&(n=Math.log(t)*Math.LOG10E);break;case"percent-of-total":Number.isFinite(r)&&r!==0&&(n=t/r*100);break;case"field":Number.isFinite(i)&&i!==0&&(n=t/i);break;case"natural-log":t>0&&(n=Math.log(t));break;case"square-root":t>0&&(n=t**.5)}return n}function wMe(t,e){const i=Y3i({field:e.field,normalizationType:e.normalizationType,normalizationField:e.normalizationField,classificationMethod:e.classificationMethod,standardDeviationInterval:e.standardDeviationInterval,breakCount:e.numClasses||U3i});return t=q3i(t,e.minValue,e.maxValue),gKt({definition:i,values:t,normalizationTotal:e.normalizationTotal})}function q3i(t,e,i){const r=e??-1/0,n=i??1/0;return t.filter(s=>Number.isFinite(s)&&s>=r&&s<=n)}function Y3i(t){const{breakCount:e,field:i,normalizationField:r,normalizationType:n}=t,s=t.classificationMethod||G3i,o=s==="standard-deviation"?t.standardDeviationInterval||V3i:void 0;return new fKt({breakCount:e,classificationField:i,classificationMethod:s,normalizationField:n==="field"?r:void 0,normalizationType:n,standardDeviationInterval:o})}function hmt(t,e){let i=t.classBreaks;const r=i.length,n=i[0].minValue,s=i[r-1].maxValue,o=e==="standard-deviation",a=z3i;return i=i.map(l=>{const c=l.label,d={minValue:l.minValue,maxValue:l.maxValue,label:c};if(o&&c){const p=c.match(a)?.map(y=>+y.trim())??[];p.length===2?(d.minStdDev=p[0],d.maxStdDev=p[1],p[0]<0&&p[1]>0&&(d.hasAvg=!0)):p.length===1&&(c.includes("<")?(d.minStdDev=null,d.maxStdDev=p[0]):c.includes(">")&&(d.minStdDev=p[0],d.maxStdDev=null))}return d}),{minValue:n,maxValue:s,classBreakInfos:i,normalizationTotal:t.normalizationTotal}}function dmt(t,e){const i=X3i(t,e),r=i.intervals,n=i.min??0,s=i.max??0,o=r.map((a,l)=>({minValue:r[l][0],maxValue:r[l][1],count:0}));for(const a of t)if(a!=null&&a>=n&&a<=s){const l=K3i(r,a);l>-1&&o[l].count++}return{bins:o,minValue:n,maxValue:s,normalizationTotal:e.normalizationTotal}}function X3i(t,e){const{field:i,classificationMethod:r,standardDeviationInterval:n,normalizationType:s,normalizationField:o,normalizationTotal:a,minValue:l,maxValue:c}=e,d=e.numBins||j3i;let p=null,y=null,v=null;if((!r||r==="equal-interval")&&!s){if(l!=null&&c!=null)p=l,y=c;else{const S=vde({values:t,minValue:l,maxValue:c,useSampleStdDev:!s,supportsNullCount:yMe({normalizationType:s,normalizationField:o,minValue:l,maxValue:c})});p=S.min??null,y=S.max??null}v=J3i(p??0,y??0,d)}else{const{classBreaks:S}=wMe(t,{field:i,normalizationType:s,normalizationField:o,normalizationTotal:a,classificationMethod:r,standardDeviationInterval:n,minValue:l,maxValue:c,numClasses:d});p=S[0].minValue,y=S[S.length-1].maxValue,v=S.map(I=>[I.minValue,I.maxValue])}return{min:p,max:y,intervals:v}}function K3i(t,e){let i=-1;for(let r=t.length-1;r>=0;r--)if(e>=t[r][0]){i=r;break}return i}function J3i(t,e,i){const r=(e-t)/i,n=[];let s,o=t;for(let a=1;a<=i;a++)s=o+r,s=Number(s.toFixed(16)),n.push([o,a===i?e:s]),o=s;return n}let zV=null;function Z3i(t,e,i){return t.x<0?t.x+=e:t.x>i&&(t.x-=e),t}function Q3i(t,e,i,r){const n=qVe(i)?pd(i):null,s=n?Math.round((n.valid[1]-n.valid[0])/e.scale[0]):null;return t.map(o=>{const a=new Yi(o.geometry);return gMe(e,a,a,a.hasZ,a.hasM),o.geometry=n?Z3i(a,s,r[0]):a,o})}function eRi(t,e=18,i,r,n,s){const o=new Float64Array(n*s);e=Math.round(on(e));let a=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=0,d=0,p=0,y=0;const v=WVt(r,i);for(const{geometry:I,attributes:O}of t){const{x:L,y:N}=I,G=Math.max(0,L-e),V=Math.max(0,N-e),Y=Math.min(s,N+e),X=Math.min(n,L+e),te=+v(O);for(let re=V;rel&&(l=c),y++}}if(!y)return{mean:0,stddev:0,min:0,max:0,mid:0,count:0};const S=(l-a)/2;return{mean:d/y,stdDev:Math.sqrt((p-d*d/y)/y),min:a,max:l,mid:S,count:y}}async function bde(t,e){if(!e)return[];const{field:i,field2:r,field3:n,fieldDelimiter:s}=t,o=t.valueExpression,a=t.normalizationType,l=t.normalizationField,c=t.normalizationTotal,d=[],p=t.viewInfoParams;let y=null,v=null;if(o){if(!zV){const{arcadeUtils:O}=await Wv();zV=O}y=zV.createFunction(o),v=p&&zV.getViewInfo({viewingMode:p.viewingMode,scale:p.scale,spatialReference:new rr(p.spatialReference)})}const S=t.fieldInfos,I=!(e[0]&&"declaredClass"in e[0]&&e[0].declaredClass==="esri.Graphic")&&S?{fields:S}:null;return e.forEach(O=>{const L=O.attributes;let N;if(o){const G=I?{...O,layer:I}:O,V=zV.createExecContext(G,v);N=zV.executeFunction(y,V)}else L&&(N=L[i],r&&(N=`${aS(N)}${s}${aS(L[r])}`,n&&(N=`${N}${s}${aS(L[n])}`)));if(a&&typeof N=="number"&&isFinite(N)){const G=L&&parseFloat(L[l]);N=cmt(N,a,G,c)}d.push(N)}),d}async function tRi(t){const{attribute:e,features:i}=t,{normalizationType:r,normalizationField:n,minValue:s,maxValue:o,fieldType:a}=e,l=await bde({field:e.field,valueExpression:e.valueExpression,normalizationType:r,normalizationField:n,normalizationTotal:e.normalizationTotal,viewInfoParams:e.viewInfoParams,fieldInfos:e.fieldInfos},i),c=yMe({normalizationType:r,normalizationField:n,minValue:s,maxValue:o}),d={value:.5,fieldType:a},p=a==="esriFieldTypeString"?vMe({values:l,supportsNullCount:c,percentileParams:d}):vde({values:l,minValue:s,maxValue:o,useSampleStdDev:!r,supportsNullCount:c,percentileParams:d});return amt(p,a==="esriFieldTypeDate")}async function iRi(t){const{attribute:e,features:i}=t,r=await bde({field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:e.valueExpression,viewInfoParams:e.viewInfoParams,fieldInfos:e.fieldInfos},i),n=lmt(r);return umt(n,e.domains,e.returnAllCodedValues,e.fieldDelimiter)}async function rRi(t){const{attribute:e,features:i}=t,{field:r,normalizationType:n,normalizationField:s,normalizationTotal:o,classificationMethod:a}=e,l=await bde({field:r,valueExpression:e.valueExpression,normalizationType:n,normalizationField:s,normalizationTotal:o,viewInfoParams:e.viewInfoParams,fieldInfos:e.fieldInfos},i),c=wMe(l,{field:r,normalizationType:n,normalizationField:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:e.standardDeviationInterval,numClasses:e.numClasses,minValue:e.minValue,maxValue:e.maxValue});return hmt(c,a)}async function nRi(t){const{attribute:e,features:i}=t,{field:r,normalizationType:n,normalizationField:s,normalizationTotal:o,classificationMethod:a}=e,l=await bde({field:r,valueExpression:e.valueExpression,normalizationType:n,normalizationField:s,normalizationTotal:o,viewInfoParams:e.viewInfoParams,fieldInfos:e.fieldInfos},i);return dmt(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 sRi(t){const{attribute:e,features:i}=t,{field:r,radius:n,fieldOffset:s,transform:o,spatialReference:a,size:l}=e,c=Q3i(i,o,a,l),{count:d,min:p,max:y,mean:v,stdDev:S}=eRi(c,n,s,r,l[0],l[1]);return{count:d,min:p,max:y,avg:v,stddev:S}}const oRi=Object.freeze(Object.defineProperty({__proto__:null,classBreaks:rRi,heatmapStatistics:sRi,histogram:nRi,summaryStatistics:tRi,uniqueValues:iRi},Symbol.toStringTag,{value:"Module"}));function aRi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var wde={};(function(t,e){function i(){function n(A){if(typeof A=="number")return le.Uc.ah(A);if(A==null)return null;if(At[A]!=null)return le.Uc.ah(At[A]);throw Error("Unrecognised Unit Type")}function s(A){if(typeof A=="number")return le.Uc.ah(A);if(A==null)return null;if(ii[A]!=null)return le.Uc.ah(ii[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,ve,W,T){if(W==null||W.B())return null;switch(W.K()){case le.sn.Point:return A.exportPoint(ve,W,T);case le.sn.Polygon:return A.exportPolygon(ve,W,T);case le.sn.Polyline:return A.exportPolyline(ve,W,T);case le.sn.MultiPoint:return A.exportMultipoint(ve,W,T);case le.sn.Envelope:return A.exportExtent(ve,W,T)}return null}function l(A,ve,W,T){if(W.K()!==le.sn.Point)throw Error("Geometry not Point");return A.exportPoint(ve,W,T)}function c(A,ve,W){return A.convertToGEGeometry(ve,W)}function d(A){var ve=A.wkid;A=A.wkt;var W=gt.get(ve||A);return W==null&&(ve!==-1&&ve!=null?(W=le.Gg.create(ve),gt.set(ve,W)):A&&(W=le.Gg.lP(A),gt.set(A,W)),ni.has(ve||A)&&W.QW(ni.get(ve||A))),W}function p(A){var ve;if(A==null)return null;var W=d(A);return A=W.Id(),W=W.Mn(),(ve={}).tolerance=W,ve.unitType=A==null?-1:A.pd,ve.unitID=A==null?-1:A.Fc(),ve.unitBaseFactor=A==null?0:A.ci,ve.unitSquareDerivative=A==null?0:le.Uc.WF(A).Fc(),ve}function y(A,ve,W,T){return W==null?null:(W=le.ac.clip(c(A,Ue,W),c(A,Ue,T),d(ve)),a(A,Ue,W,ve))}function v(A,ve,W,T){W=le.ac.fl(c(A,Ue,W),c(A,Ue,T),d(ve)),T=[];for(var b=0;b>6)>>1},T.Tn=function(b){return(32&b)!=0},T.PS=function(b){return(128&b)!=0},T.zd=function(b){return(256&b)!=0},T.zj=function(b){return(512&b)!=0},T.Ic=function(b){return(1024&b)!=0},T.prototype.Qf=function(){var b=this.Ja();return this.copyTo(b),b},T.prototype.ng=function(){return null},T.kg=function(b){var m=b.Ja();return b.copyTo(m),m},T.prototype.wc=function(){0<=this.QA&&(this.QA+=2147483649)},T.zx=function(b){var m=b.K();if(T.zj(m))return b.I();if(b.B())return 0;if(m==197)return 4;if(m==33)return 1;if(T.zd(m))return 2;throw A.i.ga("missing type")},T}();A.ba=W})(le||(le={})),it=le||(le={}),pt=function(){function A(){this.y=this.x=0}return A.construct=function(ve,W){var T=new A;return T.x=ve,T.y=W,T},A.cl=function(ve){var W=new A;return W.x=ve.x,W.y=ve.y,W},A.prototype.na=function(ve,W){this.x=ve,this.y=W},A.prototype.N=function(ve){this.x=ve.x,this.y=ve.y},A.prototype.hq=function(ve,W){return this.x===ve&&this.y===W},A.prototype.Mz=function(ve){return 2220446049250313e-31>=Math.abs(this.x-ve.x)&&2220446049250313e-31>=Math.abs(this.y-ve.y)},A.prototype.rb=function(ve){return this.x===ve.x&&this.y===ve.y},A.prototype.Nb=function(ve){return ve==this||ve instanceof A&&this.x==ve.x&&this.y==ve.y},A.prototype.sub=function(ve){this.x-=ve.x,this.y-=ve.y},A.prototype.vc=function(ve,W){this.x=ve.x-W.x,this.y=ve.y-W.y},A.prototype.add=function(ve,W){W!==void 0?(this.x=ve.x+W.x,this.y=ve.y+W.y):(this.x+=ve.x,this.y+=ve.y)},A.prototype.Uq=function(){this.x=-this.x,this.y=-this.y},A.prototype.nt=function(ve){this.x=-ve.x,this.y=-ve.y},A.prototype.IS=function(ve,W,T){this.x=ve.x*(1-T)+W.x*T,this.y=ve.y*(1-T)+W.y*T},A.prototype.Dt=function(ve,W){this.x=this.x*ve+W.x,this.y=this.y*ve+W.y},A.prototype.BW=function(ve,W,T){this.x=W.x*ve+T.x,this.y=W.y*ve+T.y},A.prototype.scale=function(ve){this.x*=ve,this.y*=ve},A.prototype.compare=function(ve){return this.yve.y?1:this.xve.x?1:0},A.prototype.normalize=function(){var ve=this.length();ve==0&&(this.x=1,this.y=0),this.x/=ve,this.y/=ve},A.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},A.prototype.Uk=function(){return this.x*this.x+this.y*this.y},A.ub=function(ve,W){return Math.sqrt(this.zc(ve,W))},A.Jy=function(ve,W,T,b){return ve-=T,W-=b,Math.sqrt(ve*ve+W*W)},A.prototype.Sh=function(ve){return this.x*ve.x+this.y*ve.y},A.prototype.aD=function(ve){return Math.abs(this.x*ve.x)+Math.abs(this.y*ve.y)},A.prototype.yi=function(ve){return this.x*ve.y-this.y*ve.x},A.prototype.Ct=function(ve,W){var T=-this.x*W+this.y*ve;this.x=this.x*ve+this.y*W,this.y=T},A.prototype.Jv=function(){var ve=this.x;this.x=-this.y,this.y=ve},A.prototype.HG=function(ve){this.x=-ve.y,this.y=ve.x},A.prototype.cr=function(){var ve=this.x;this.x=this.y,this.y=-ve},A.prototype.su=function(){return 0(ve=ve.yi(W))?1:0(T=b.value())?-1:0T?-1:0=m?T+(b-T)*m:b-(b-T)*(1-m)},W.JG=function(T,b,m,_){.5>=m?(_.x=T.x+(b.x-T.x)*m,_.y=T.y+(b.y-T.y)*m):(_.x=b.x-(b.x-T.x)*(1-m),_.y=b.y-(b.y-T.y)*(1-m))},W.gT=function(T,b,m,_,C,D){.5>=C?(D.x=T+(m-T)*C,D.y=b+(_-b)*C):(D.x=m-(m-T)*(1-C),D.y=_-(_-b)*(1-C))},W}()}(le||(le={})),function(A){var ve=function(W){function T(){var b=W.call(this)||this;return b.ta=0,b.oa=0,b.qa=0,b.ma=0,b.la=null,b}return Le(T,W),T.prototype.bc=function(){return A.h.construct(this.ta,this.oa)},T.prototype.$p=function(b){b.x=this.ta,b.y=this.oa},T.prototype.Ec=function(b){this.gm(0,b)},T.prototype.UB=function(b,m){this.gm(0,A.h.construct(b,m))},T.prototype.Vo=function(b){this.cD(0,b)},T.prototype.setStart=function(b){this.pD(0,b)},T.prototype.yv=function(b,m){return this.Pd(0,b,m)},T.prototype.TB=function(b,m,_){this.vn(0,b,m,_)},T.prototype.xc=function(){return A.h.construct(this.qa,this.ma)},T.prototype.Vr=function(b){b.x=this.qa,b.y=this.ma},T.prototype.Rc=function(b){this.gm(1,b)},T.prototype.Sl=function(b,m){this.gm(1,A.h.construct(b,m))},T.prototype.Ro=function(b){this.cD(1,b)},T.prototype.setEnd=function(b){this.pD(1,b)},T.prototype.jv=function(b,m){return this.Pd(1,b,m)},T.prototype.JB=function(b,m,_){this.vn(1,b,m,_)},T.prototype.Eb=function(){return 1},T.prototype.B=function(){return this.Bc()},T.prototype.Pa=function(){},T.prototype.He=function(){return 0},T.prototype.Fa=function(b,m,_,C,D){return this.FM(b,m,_,C,D)},T.prototype.isIntersecting=function(b,m){return this.Br(b,m,!1)!=0},T.prototype.ss=function(b,m){return this.tu(b,m,!1)},T.prototype.tu=function(){return null},T.prototype.Bc=function(){return!1},T.prototype.$x=function(b){if(this.wc(),this.la==null&&0=A.sa.Wa(m))throw A.i.de();var C=this.description.Rf(m);return 0<=C?(this.la!=null&&this.$x(this.description.Be.length-2),this.la[T.Ig(this.description,b)+this.description.bk(C)-2+_]):A.sa.te(m)},T.prototype.vn=function(b,m,_,C){if(this.wc(),_>=A.sa.Wa(m))throw A.i.de();var D=this.description.Rf(m);0>D&&(this.se(m),D=this.description.Rf(m)),m==0?b!=0?_!=0?this.ma=C:this.qa=C:_!=0?this.oa=C:this.ta=C:(this.la==null&&this.$x(this.description.Be.length-2),this.la[T.Ig(this.description,b)+this.description.bk(D)-2+_]=C)},T.prototype.copyTo=function(b){if(b.K()!=this.K())throw A.i.O();b.description=this.description,b.$x(this.description.Be.length-2),T.bM(this.la,b.la,2*(this.description.Be.length-2)),b.ta=this.ta,b.oa=this.oa,b.qa=this.qa,b.ma=this.ma,b.wc(),this.qp(b)},T.prototype.Vg=function(b,m){var _=new A.Oc;return this.Bc()?(_.Pa(),_):(_.pa=this.Pd(0,b,m),_.wa=_.pa,_.Nk(this.Pd(1,b,m)),_)},T.prototype.UI=function(b){this.Bc()?b.Pa():(b.pa=this.Pd(0,0,0),b.wa=b.pa,b.Nk(this.Pd(1,0,0)))},T.prototype.Vw=function(b,m){m.Pf(this.description),m.Db(this.ic(b));for(var _=1,C=this.description.Ba;_m||m>=this.xa)throw A.i.ga("index out of bounds");this.oc(),_.Pf(this.description),_.B()&&_.wn();for(var C=0;Cm||m>=this.I())throw A.i.de();this.oc(),this.Aa[0].uc(2*m,_)},b.prototype.Oa=function(m){var _=new A.h;return this.D(m,_),_},b.prototype.Hc=function(m,_){this.Aa[0].uc(2*m,_)},b.prototype.Db=function(m,_,C){if(0>m||m>=this.xa)throw A.i.de();this.oc();var D=this.Aa[0];C!==void 0?(D.write(2*m,_),D.write(2*m+1,C)):D.Vt(2*m,_),this.Qc(1993)},b.prototype.xz=function(){if(void 0>=this.I())throw A.i.de();this.oc();var m=this.Aa[0],_=new A.Od;return _.x=m.read(NaN),_.y=m.read(NaN),_.z=this.hasAttribute(1)?this.Aa[1].gg(void 0):A.sa.te(1),_},b.prototype.ZB=function(m){if(0>m||m>=this.I())throw A.i.de();this.se(1),this.oc(),this.Qc(1993);var _=this.Aa[0];_.write(2*m,(void 0).x),_.write(2*m+1,(void 0).y),this.Aa[1].rr(m,(void 0).z)},b.prototype.Vc=function(m,_,C){if(0>_||_>=this.xa)throw A.i.de();var D=A.sa.Wa(m);if(C>=D)throw A.i.de();this.oc();var F=this.description.Rf(m);return 0<=F?this.Aa[F].gg(_*D+C):A.sa.te(m)},b.prototype.tF=function(m,_){return this.Vc(m,_,void 0)},b.prototype.setAttribute=function(m,_,C,D){if(0>_||_>=this.xa)throw A.i.de();var F=A.sa.Wa(m);if(C>=F)throw A.i.de();this.se(m),this.oc(),m=this.description.Rf(m),this.Qc(1993),this.Aa[m].rr(_*F+C,D)},b.prototype.vb=function(m){return this.vx(),this.se(m),this.oc(),this.Aa[this.description.Rf(m)]},b.prototype.kn=function(m,_){if(_!=null&&A.sa.Vp(m)!=_.Vp())throw A.i.O();this.se(m),m=this.description.Rf(m),this.Aa==null&&(this.Aa=A.Zc.lI(this.description.Ba)),this.Aa[m]=_,this.Qc(16777215)},b.prototype.un=function(m){var _=null;if(this.Aa!=null){var C=A.fe.Kw(m,this.description);_=[];for(var D=0,F=m.Ba;Dthis.xa+5?(5*this.xa+3)/4:this.xa),this.Aa[m].resize(D*C,A.sa.te(_))),Dm)throw A.i.O();m!=this.xa&&(this.xa=m,this.Qc(65535))},b.prototype.qm=function(m){if(!this.ck(1)){if(!this.ck(2))return 0;if(this.LT>=m)return this.ck(8)?1:2}return-1},b.prototype.Eh=function(m,_){if(this.LT=_,m==-1)this.Nf(1,!0),this.Nf(8,!0);else if(this.Nf(1,!1),this.Nf(8,!0),m==0)this.Nf(2,!1),this.Nf(4,!1);else if(m==1)this.Nf(2,!0),this.Nf(4,!1);else{if(m!=2)throw A.i.ga("internal error.");this.Nf(2,!0),this.Nf(4,!0)}},b.prototype.gM=function(){this.Cb!=null&&(this.Cb=null)},b.prototype.fD=function(m,_,C,D){if(0>m||m>=this.xa||0>_||_>=this.xa)throw A.i.ga("index out of bounds");this.oc(),D.Pf(this.description),D.B()&&D.wn();for(var F=0;Fm||m>=this.xa)throw A.i.de();this.oc();var _=new A.Ta;_.Pf(this.description),_.B()&&_.wn();for(var C=0;Cm||m>=this.xa)throw A.i.de();if(_.B())throw A.i.O();this.oc();for(var C=_.description,D=0;DA.P.XA(this.Vm)>>1:b!=-1)?T=b:_=F,b=!0;;){if(0>_){if((F=D[7*T])==-1){_=T,m=this.ob.Nl([-1,-1,T,m,this.il(),-1,-1]),(D=this.ob.o)[7*T]=m;break}T=F}else{if((F=D[7*T+1])==-1){_=D[7*T+6],m=this.ob.Nl([-1,-1,T,m,this.il(),-1,-1]),(D=this.ob.o)[7*T+1]=m;break}T=F}b&&(_*=-1,b=!1)}return this.ky(m,D),D[7*m+2]===-1&&(D[7*C]=m),this.xp(_,m,C,D),m},W.prototype.AF=function(){return this.dR(this.Ne)},W.prototype.wd=function(T,b){b=b==-1?this.Ne:b,this.Tv?this.GP(T,b):this.eY(T,b)},W.prototype.search=function(T,b){for(b=this.uv(b);b!=-1;){var m=this.ao.compare(this,T,b);if(m==0)return b;b=0>m?this.nl(b):this.Zp(b)}return-1},W.prototype.DW=function(T){for(var b=this.uv(-1),m=-1;b!=-1;){var _=T.compare(this,b);if(_==0)return b;0>_?b=this.nl(b):(m=b,b=this.Zp(b))}return m},W.prototype.pJ=function(T){for(var b=this.uv(-1),m=-1;b!=-1;){var _=T.compare(this,b);if(_==0)return b;0>_?(m=b,b=this.nl(b)):b=this.Zp(b)}return m},W.prototype.ka=function(T){return this.ob.U(T,3)},W.prototype.nl=function(T){return this.ob.U(T,0)},W.prototype.Zp=function(T){return this.ob.U(T,1)},W.prototype.getParent=function(T){return this.ob.U(T,2)},W.prototype.lb=function(T){return this.ob.U(T,6)},W.prototype.xe=function(T){return this.ob.U(T,5)},W.prototype.sc=function(T){return T==-1?this.ml(this.Ne):this.ml(T)},W.prototype.Gc=function(T){return T==-1?this.bs(this.Ne):this.bs(T)},W.prototype.UR=function(T){return T==-1?this.XF(this.Ne):this.XF(T)},W.prototype.Uj=function(T,b){this.IB(T,b)},W.prototype.uv=function(T){return T==-1?this.TF(this.Ne):this.TF(T)},W.prototype.clear=function(){this.ob.oj(!1),this.Ne=-1},W.prototype.size=function(T){return T==-1?this.VF(this.Ne):this.VF(T)},W.prototype.FN=function(T,b){for(var m=b[7*T],_=b[7*T+1],C=b[7*T+4];m!=-1||_!=-1;){var D=m!=-1?b[7*m+4]:2147483647;if(_=_!=-1?b[7*_+4]:2147483647,C<=Math.min(D,_))break;D<=_?this.nJ(m,b):this.mJ(T,b),m=b[7*T],_=b[7*T+1]}},W.prototype.ky=function(T,b){if(this.Tv)for(var m=b[7*T+4],_=b[7*T+2];_!=-1&&b[7*_+4]>m;)b[7*_]==T?this.nJ(T,b):this.mJ(_,b),_=b[7*T+2]},W.prototype.mJ=function(T,b){var m=b[7*T+1];b[7*m+2]=b[7*T+2],b[7*T+2]=m;var _=b[7*m];b[7*T+1]=_,_!=-1&&(b[7*_+2]=T),b[7*m]=T,(_=b[7*m+2])!=-1&&(b[7*_]==T?b[7*_]=m:b[7*_+1]=m)},W.prototype.nJ=function(T,b){var m=b[7*T+2];b[7*T+2]=b[7*m+2],b[7*m+2]=T;var _=b[7*T+1];b[7*m]=_,_!=-1&&(b[7*_+2]=m),b[7*T+1]=m,(_=b[7*T+2])!=-1&&(b[7*_]===m?b[7*_]=T:b[7*_+1]=T)},W.prototype.Rk=function(T,b){this.ob.T(T,2,b)},W.prototype.OB=function(T,b){this.ob.T(T,0,b)},W.prototype.SB=function(T,b){this.ob.T(T,1,b)},W.prototype.RB=function(T,b){this.ob.T(T,5,b)},W.prototype.fx=function(T,b){this.ob.T(T,6,b)},W.prototype.SJ=function(T,b){this.ob.T(b,0,T)},W.prototype.nX=function(T){this.ob.T(T,4,0)},W.prototype.qX=function(T,b){this.ob.T(b,5,T)},W.prototype.TF=function(T){return T==-1?-1:this.ob.U(T,0)},W.prototype.ml=function(T){return T==-1?-1:this.ob.U(T,1)},W.prototype.bs=function(T){return T==-1?-1:this.ob.U(T,2)},W.prototype.dR=function(T){return T==-1?-1:this.ob.U(T,3)},W.prototype.VF=function(T){return T==-1?0:this.ob.U(T,4)},W.prototype.XF=function(T){return this.ob.U(T,5)},W.prototype.Rw=function(){return this.ob.Nl([-1,-1,-1,void 0,this.il(),-1,-1])},W.prototype.hl=function(T){T!=-1&&this.ob.kd(T)},W.prototype.il=function(){return this.Vm=A.P.XA(this.Vm),1073741823&this.Vm},W.prototype.AD=function(T,b,m){var _=this.ob.o;if(m==-1||_[7*m]==-1)return T=this.ob.Nl([-1,-1,-1,T,this.il(),-1,-1]),(_=this.ob.o)[7*m]=T,this.xp(-1,T,m,_),T;for(var C=m==-1?-1:_[7*m];;){var D=b==-1?1:this.ao.compare(this,T,C);if(0>D){if((D=this.nl(C))==-1){b=C,T=this.ob.Nl([-1,-1,C,T,this.il(),-1,-1]),(_=this.ob.o)[7*C]=T;break}C=D}else{if(b==1&&D==0)return _[7*m+3]=C,-1;if((D=_[7*C+1])==-1){b=_[7*C+6],T=this.ob.Nl([-1,-1,C,T,this.il(),-1,-1]),(_=this.ob.o)[7*C+1]=T;break}C=D}}return this.ky(T,_),_[7*T+2]===-1&&(_[7*m]=T),this.xp(b,T,m,_),T},W.prototype.xp=function(T,b,m,_){if(T!=-1){var C=_[7*T+5];_[7*T+5]=b}else C=m==-1?-1:_[7*m+2];_[7*b+5]=C,C!=-1&&(_[7*C+6]=b),_[7*b+6]=T,T==(m==-1?-1:_[7*m+1])&&(_[7*m+1]=b),T==-1&&(_[7*m+2]=b),_[7*m+4]=(m==-1?0:_[7*m+4])+1},W.prototype.vB=function(T,b){var m=this.ob.o,_=m[7*T+5];T=m[7*T+6],_!=-1?m[7*_+6]=T:m[7*b+1]=T,T!=-1?m[7*T+5]=_:m[7*b+2]=_,m[7*b+4]=b===-1?-1:m[7*b+4]-1},W.prototype.eY=function(T,b){this.vB(T,b);var m=this.nl(T),_=this.Zp(T),C=this.getParent(T),D=T;if(m!=-1&&_!=-1){this.Vm=A.P.XA(this.Vm);var F=1073741823=T.pa:T.wa>=this.pa},W.prototype.move=function(T){this.B()||(this.pa+=T,this.wa+=T)},W.prototype.normalize=function(){if(!isNaN(this.pa)){if(this.pa>this.wa){var T=this.pa;this.pa=this.wa,this.wa=T}isNaN(this.wa)&&this.Pa()}},W.prototype.Pa=function(){this.wa=this.pa=NaN},W.prototype.B=function(){return isNaN(this.pa)},W.prototype.$b=function(T){typeof T=="number"?this.B()?this.wa=this.pa=T:this.Nk(T):T.B()||(this.B()?(this.pa=T.pa,this.wa=T.wa):(this.pa>T.pa&&(this.pa=T.pa),this.wathis.wa&&this.Pa()))},W.prototype.Nk=function(T){Tthis.wa&&(this.wa=T)},W.prototype.contains=function(T){return typeof T=="number"?T>=this.pa&&T<=this.wa:T.pa>=this.pa&&T.wa<=this.wa},W.prototype.Fa=function(T){this.B()||T.B()?this.Pa():(this.paT.wa&&(this.wa=T.wa),this.pa>this.wa&&this.Pa())},W.prototype.X=function(T){this.B()||(this.pa-=T,this.wa+=T,this.wab?(this.pa=b,this.wa=T):(this.pa=T,this.wa=b)},W.prototype.Kt=function(T){return A.P.Tk(T,this.pa,this.wa)},W.prototype.S=function(){return this.wa-this.pa},W.prototype.tf=function(){return .5*(this.pa+this.wa)},W.prototype.Nb=function(T){return T==this||T instanceof W&&(!(!this.B()||!T.B())||this.pa==T.pa&&this.wa==T.wa)},W.prototype.dc=function(){return A.P.wj(A.P.wj())},W}();A.Oc=ve}(le||(le={})),function(A){var ve=new A.Oc,W=new A.Oc,T=function(){this.oe=null,this.pb=-1,this.tb=new A.zb,this.lA=55555555,this.Vv=this.Xv=!1,this.Wf=new A.Oc,this.Wf.FB(0,0)};A.EY=T;var b=function(){function m(_,C,D){this.g=_,this.Jk=NaN,this.IH=this.Mq=0,this.JH=NaN,this.ra=C,this.Pq=10*C,this.KH=this.LH=NaN,this.sg=!1,this.Fm=this.ht=this.No=this.Zs=this.Ys=-1,this.bA=D,this.OA=new T,this.TH=new T,A.P.truncate(3*_.gd/2)}return m.prototype.hG=function(_,C,D,F){_.oe=F===null?null:F[D[5*C]],_.Vv=_.oe!=null,_.Vv||((F=D[5*C+2])!==-1&&this.g.hW(D[5*C],D[5*F],_.tb),_.oe=_.tb,_.Wf.FB(_.tb.ta,_.tb.qa),_.Wf.wa+=this.ra,_.tb.mI(),_.Xv=_.tb.ma==_.tb.oa,_.Xv||(_.lA=(_.tb.qa-_.tb.ta)/(_.tb.ma-_.tb.oa)))},m.prototype.JO=function(_,C){var D=_.Br(C,this.ra,!0);return D!=0?D==2?this.Ly():this.zi():(_.$p(Ce),_.Vr(Ze),C.$p(yt),C.Vr(Ve),ce.na(this.Mq,this.Jk),Ce.rb(yt)&&this.Jk==Ce.y?0>Ze.compare(Ve)?ce.N(Ze):ce.N(Ve):Ce.rb(Ve)&&this.Jk==Ce.y?0>Ze.compare(yt)?ce.N(Ze):ce.N(yt):yt.rb(Ze)&&this.Jk==yt.y?0>Ce.compare(Ve)?ce.N(Ce):ce.N(Ve):Ze.rb(Ve)&&this.Jk==Ze.y&&(0>Ce.compare(yt)?ce.N(Ce):ce.N(yt)),_.Me(ce.y,ce.x)D&&0>_?-1:0C.qa){if(C.qa>C.ta&&C.ma-C.oa<2*this.ra&&_.xi(C.qa,C.ma,this.ra))return this.zi()}else if((C.ma-C.oa)/(C.qa-C.ta)*(_.qa-_.ta)C.ta&&C.ma-C.oa<2*this.ra&&_.xi(C.qa,C.ma,this.ra))return this.zi()}else if((C.ma-C.oa)/(C.qa-C.ta)*(_.ta-_.qa)F&&0>D?-1:0C+q?D:F.xi(_.ta,_.oa,this.ra)?this.zi():BC+q?D:F.xi(_.qa,_.ma,this.ra)?this.zi():BB?1:0)},m.prototype.Mr=function(){this.sg=!1},m.prototype.tm=function(){return this.Pi},m.prototype.VJ=function(_,C){this.Jk=_,this.Mq=C,this.ht=this.No=this.Zs=this.Ys=-1},m.prototype.compare=function(_,C,D){return this.sg?-1:(_=_.ka(D),this.Fm=D,this.ME(C,C,_,_))},m.prototype.ME=function(_,C,D,F){if(this.No==C)var B=this.OA;else this.No=C,B=this.OA,this.OA.pb=_,this.hG(B,C,this.g.ud.o,this.g.Te);if(q==null){this.ht=F;var q=this.TH;this.TH.pb=D,this.hG(q,F,this.g.ud.o,this.g.Te)}return B.Vv||q.Vv?this.IO(C,F,B,q):B.Wf.wathis.Wf.wa)return 1;if(this.je.oa==this.je.ma)return this.Fm=T,this.sg=!0,0;this.je.mI(),m=this.je.bc(),(b=new A.h).vc(this.je.xc(),m),b.cr();var _=new A.h;return _.vc(this.Iq,m),m=b.Sh(_),(m/=b.length())<10*-this.ra?-1:m>10*this.ra?1:this.je.ss(this.Iq,this.ra)&&((b=Math.abs(m))m?-1:1},W}();A.WL=ve}(le||(le={})),function(A){function ve(T,b,m,_){m=new Float64Array(T.subarray(m,_)),T.set(m,b)}var W=function(){function T(b){this.Pb=this.rk=!1,this.o=null;var m=b;2>m&&(m=2),this.o=new Float64Array(m),this.size=b}return T.prototype.rotate=function(b,m,_){if(this.Pb)throw A.i.ga("invalid_call");if(m_||b>_)throw A.i.O();b!=m&&_!=m&&(this.pi(b,m-b,1),this.pi(m,_-m,1),this.pi(b,_-b,1))},T.rf=function(b,m){var _=new T(b),C=_.o;if(2>b&&(b=2),m!==0)for(var D=0;Dm&&(_.size=m),2>(m=_.size)&&(m=2),_.o=new Float64Array(m),_.o.set(b.o.length<=m?b.o:b.o.subarray(0,m),0),_},T.prototype.Jb=function(b){0>=b||(this.o==null?this.o=new Float64Array(b):b<=this.o.length||(0this.o.length&&(_=A.P.truncate(64>b?Math.max(2*b,4):5*b/4),(_=new Float64Array(_)).set(this.o),this.o=_),_=this.o;for(var C=this.size;Cthis.o.length)&&this.resize(b),this.rk)throw A.i.ga("invalid call. Attribute Stream is locked and cannot be resized.");this.size=b},T.prototype.rr=function(b,m){this.write(b,m)},T.prototype.Cn=function(b,m,_){for(var C=this.size;mC||_>D&&C!=D)return!1;for(_>C&&(_=C);m<_;m++)if(this.read(m)!=b.read(m))return!1;return!0},T.prototype.addRange=function(b,m,_,C,D){if(this.Pb)throw A.i.Hb();if(!C&&(1>D||_%D!=0))throw A.i.O();var F=this.size;if(this.resize(F+_),C)this.o.set(b.o.subarray(m,m+_),F);else{C=_;for(var B=0;B<_;B+=D){C-=D;for(var q=0;qF||C%F!=0))throw A.i.O();var q=this.size-B;if(qF&&(F=this.size),this.size+2*C>this.o.length?this.resize(this.size+2*C):this.size+=2*C,ve(this.o,b+2*C,b,b+(F-b)),D)for(D=0;Db||0>m||0>C||!D&&(0>=F||m%F!=0)||_.sizethis.size)throw A.i.Hb();0<_-(b+m)&&ve(this.o,b,b+m,b+(_-(b+m))+m),this.size-=m},T.prototype.pi=function(b,m,_){if(this.Pb||1>_||m%_!=0)throw A.i.Hb();for(var C=m>>1,D=0;Dm||0>_||0>m||_+m>this.size)throw A.i.O();for(var C=m;Cb||0>m||0>C)throw A.i.O();if(m!=0)for(this.size<(m<<1)+b&&this.resize((m<<1)+b),D||(b+=m-1<<1),D=D?2:-2,m+=C;Cb||0>m)throw A.i.O();if(m!=0){this.size<(m<<1)+b&&this.resize((m<<1)+b),m+=0;for(var C=0;Cb||0>m||0>C||this.sizeb||0>m||this.size<(m>>1)+b)throw A.i.O();if(m!=0){m=0+m;for(var C=0;Cm&&(m=2),this.o=new Int32Array(m),this.size=b}return T.prototype.rotate=function(b,m,_){if(this.Pb)throw A.i.ga("invalid_call");if(m_||b>_)throw A.i.O();b!=m&&_!=m&&(this.pi(b,m-b,1),this.pi(m,_-m,1),this.pi(b,_-b,1))},T.rf=function(b,m){var _=new T(b),C=_.o;if(2>b&&(b=2),m!==0)for(var D=0;Dm&&(_.size=m),2>(m=_.size)&&(m=2),_.o=new Int32Array(m),_.o.set(b.o.length<=m?b.o:b.o.subarray(0,m),0),_},T.prototype.Jb=function(b){0>=b||(this.o==null?this.o=new Int32Array(b):b<=this.o.length||(0this.o.length&&(_=A.P.truncate(64>b?Math.max(2*b,4):5*b/4),(_=new Int32Array(_)).set(this.o),this.o=_),_=this.o;for(var C=this.size;Cthis.o.length)&&this.resize(b),this.rk)throw A.i.ga("invalid call. Attribute Stream is locked and cannot be resized.");this.size=b},T.prototype.rr=function(b,m){this.write(b,m)},T.prototype.Cn=function(b,m,_){for(var C=this.size;mC||_>D&&C!=D)return!1;for(_>C&&(_=C);m<_;m++)if(this.read(m)!=b.read(m))return!1;return!0},T.prototype.addRange=function(b,m,_,C,D){if(this.Pb)throw A.i.Hb();if(!C&&(1>D||_%D!=0))throw A.i.O();var F=this.size;if(this.resize(F+_),C)this.o.set(b.o.subarray(m,m+_),F);else{C=_;for(var B=0;B<_;B+=D){C-=D;for(var q=0;qF||C%F!=0))throw A.i.O();if(ve(this.o,b+C,b,b+(B-b)),this.o==m.o&&b<_&&(_+=C),D)this.o.set(m.o.subarray(_,_+C),b);else for(D=C,B=0;BF&&(F=this.size),this.size+2*C>this.o.length?this.resize(this.size+2*C):this.size+=2*C,ve(this.o,b+2*C,b,b+(F-b)),D)for(D=0;Db||0>m||0>C||!D&&(0>=F||m%F!=0)||_.sizethis.size)throw A.i.Hb();0<_-(b+m)&&ve(this.o,b,b+m,b+(_-(b+m))+m),this.size-=m},T.prototype.pi=function(b,m,_){if(this.Pb||1>_||m%_!=0)throw A.i.Hb();for(var C=m>>1,D=0;Dm||0>_||0>m||_+m>this.size)throw A.i.O();for(var C=m;Cb||0>m||0>C)throw A.i.O();if(m!=0)for(this.size<(m<<1)+b&&this.resize((m<<1)+b),D||(b+=m-1<<1),D=D?2:-2,m+=C;Cb||0>m||0>C||this.sizem-b?T.mG(this.o,b,m,_):T.lB(this.o,b,m-1,_)},T.prototype.Vp=function(){return 2},T.prototype.Gc=function(){return this.o[this.size-1]},T.prototype.Jf=function(){this.resize(this.size-1)},T.prototype.XW=function(b){this.o[this.size-1]=b},T.prototype.NV=function(b){b=m&&0=_))for(;;){if(9>_-m){T.mG(b,m,_+1,C);break}var D=b[m];T.sx(b,m,_);for(var F=m,B=m;B<_;B++)0>=C(b[B],D)&&(T.sx(b,F,B),F+=1);T.sx(b,F,_),F-m<_-F?(T.lB(b,m,F-1,C),m=F+1):(T.lB(b,F+1,_,C),_=F-1)}},T}();A.ja=W}(le||(le={})),function(A){function ve(T,b,m,_){m=new Int8Array(T.subarray(m,_)),T.set(m,b)}var W=function(){function T(b){this.o=null;var m=b;2>m&&(m=2),this.o=new Int8Array(m),this.size=b}return T.prototype.rotate=function(b,m,_){if(this.Pb)throw A.i.ga("invalid_call");if(m_||b>_)throw A.i.O();b!=m&&_!=m&&(this.pi(b,m-b,1),this.pi(m,_-m,1),this.pi(b,_-b,1))},T.rf=function(b,m){var _=new T(b),C=_.o;if(2>b&&(b=2),m!==0)for(var D=0;Dm&&(_.size=m),2>(m=_.size)&&(m=2),_.o=new Int8Array(m),_.o.set(b.o.length<=m?b.o:b.o.subarray(0,m),0),_},T.prototype.Jb=function(b){0>=b||(this.o==null?this.o=new Int8Array(b):b<=this.o.length||(0this.o.length&&(_=A.P.truncate(64>b?Math.max(2*b,4):5*b/4),(_=new Int8Array(_)).set(this.o),this.o=_),_=this.o;for(var C=this.size;Cthis.o.length)&&this.resize(b),this.rk)throw A.i.ga("invalid call. Attribute Stream is locked and cannot be resized.");this.size=b},T.prototype.rr=function(b,m){this.write(b,m)},T.prototype.Cn=function(b,m,_){for(var C=this.size;mC||_>D&&C!=D)return!1;for(_>C&&(_=C);m<_;m++)if(this.read(m)!=b.read(m))return!1;return!0},T.prototype.addRange=function(b,m,_,C,D){if(this.Pb)throw A.i.Hb();if(!C&&(1>D||_%D!=0))throw A.i.O();var F=this.size;if(this.resize(F+_),C)this.o.set(b.o.subarray(m,m+_),F);else{C=_;for(var B=0;B<_;B+=D){C-=D;for(var q=0;qF||C%F!=0))throw A.i.O();if(ve(this.o,b+C,b,b+(B-b)),this.o==m.o&&b<_&&(_+=C),D)this.o.set(m.o.subarray(_,_+C),b);else for(D=C,B=0;BF&&(F=this.size),this.size+2*C>this.o.length?this.resize(this.size+2*C):this.size+=2*C,ve(this.o,b+2*C,b,b+(F-b)),D)for(D=0;Db||0>m||0>C||!D&&(0>=F||m%F!=0)||_.sizethis.size)throw A.i.Hb();0<_-(b+m)&&ve(this.o,b,b+m,b+(_-(b+m))+m),this.size-=m},T.prototype.pi=function(b,m,_){if(this.Pb||1>_||m%_!=0)throw A.i.Hb();for(var C=m>>1,D=0;Dm||0>_||0>m||_+m>this.size)throw A.i.O();for(var C=m;Cb||0>m||0>C)throw A.i.O();if(m!=0)for(this.size<(m<<1)+b&&this.resize((m<<1)+b),D||(b+=m-1<<1),D=D?2:-2,m+=C;Cb||0>m||0>C||this.sizeT?-T:T},W.vi=function(T){return 3552713678800501e-30>T},W.FC=function(T,b,m){return W.R(T-b)<=m*(1+(W.R(T)+W.R(b))/2)},W.$=function(T,b){return W.FC(T,b,3552713678800501e-30)},W.AL=function(T){return 3552713678800501e-30>=W.R(T)},W.Dd=function(T){return W.AL(T)},W}();A.s=ve,A.F=function(){function W(){}return W.ip=function(T,b){var m=0;return(T=ve.R(T))+(b=ve.R(b))!=0&&(T>b?(m=b/T,m=T*Math.sqrt(1+m*m)):(m=T/b,m=b*Math.sqrt(1+m*m))),m},W.Yq=function(T,b,m,_,C){for(var D=[0,0,0],F=[0,0,0],B=0;2>=B;B++)b[B]-=T[B],m[B]-=b[B];m=D[1]*F[2]-D[2]*F[1],b=D[2]*F[0]-D[0]*F[2],D=D[0]*F[1]-D[1]*F[0],T=-1*(m*T[0]+b*T[1]+D*T[2]),_[0]=m,_[1]=b,_[2]=D,_[3]=T,F=W.qn(_),_[0]/=F,_[1]/=F,_[2]/=F,_[3]/=F,C!=0&&(F=ve.Dd(D)?ve.Dd(T)?ve.Mb(1,b):-ve.Mb(1,T):ve.Mb(1,D),F*=ve.Mb(1,C),_[0]*=F,_[1]*=F,_[2]*=F,_[3]*=F)},W.yx=function(T,b,m){m[0]=T[1]*b[2]-b[1]*T[2],m[1]=T[2]*b[0]-b[2]*T[0],m[2]=T[0]*b[1]-b[0]*T[1]},W.Ut=function(T,b){return T[0]*b[0]+T[1]*b[1]+T[2]*b[2]},W.qn=function(T){return W.ip(W.ip(T[0],T[1]),T[2])},W.el=function(T,b,m,_,C,D,F,B){T=W.n(T,b,m);var q=Math.cos(m);D.u=(T+C)*q*Math.cos(_),F.u=(T+C)*q*Math.sin(_),B.u=(T*(1-b)+C)*Math.sin(m)},W.eO=function(T,b,m,_,C,D,F){var B=W.ip(b,m),q=1*Math.sqrt(1-T),Z=q/1;if(ve.$(B,0))D.u=0,C.u=ve.Mb(1.570796326794897,_),F.u=ve.R(_)-q;else{D.u=Math.atan2(m,b),m=Math.atan2(1*_,q*B),D=Math.cos(m);var oe=Math.sin(m);b=q*T/(1-T),T*=1,m=Math.atan2(_+b*oe*oe*oe,B-T*D*D*D),3.141592653589793T){var m=Math.sqrt(1-T),_=(1-m)/(1+m),C=_*_,D=_*C,F=_*D,B=_*F,q=_*B,Z=_*q,oe=1.572916666666667*D-3.2578125*B+4.295068359375*Z;T=2.142578125*F-6.071484375*q,m=3.129296875*B-11.249837239583334*Z;var ue=4.775276692708333*q,be=7.958636765252976*Z,De=Math.cos(2*b);return b+Math.sin(2*b)*(1.5*_-.84375*D+.525390625*B-.2688395182291667*Z-oe+m-be+De*(2*(1.3125*C-1.71875*F+1.650146484375*q)-4*T+6*ue+De*(4*oe-12*m+24*be+De*(8*T-32*ue+De*(16*m-80*be+De*(32*ue+64*De*be))))))}for(m=1-T,_=T/2,D=(C=ve.R(b))*W.av(T)/(1.570796326794897*m),F=9999,q=C,C=0;1e-16C;C++)Z=W.w(T,q),B=q-(oe=(B=(W.fG(q,T)-_*Math.sin(2*q)/Z)/m-D)/(Z=1/(Z*Z*Z))),F=ve.R(oe),q=B;return 0<=b?q:-q},W.lW=function(T,b){return ve.vi(b)?T:T*W.av(b)/1.570796326794897},W.ca=function(T){return 0>(T=W.kF(T,6.283185307179586))?T+6.283185307179586:3.141592653589793>ve.R(T)||ve.$(ve.R(T),3.141592653589793)?T:T-6.283185307179586},W.kF=function(T,b){return T-Math.floor(T/b)*b},W.Ch=function(T,b){if(.006884661117170036>b){var m=(b=(1-(b=Math.sqrt(1-b)))/(1+b))*b,_=m*m;return T/(1+b)*(1+.25*m+.015625*_+.00390625*m*_)*1.570796326794897}return T*W.av(b)},W.Xq=function(T,b){var m=ve.Mb(1,Math.sin(b));return b=1.570796326794897>=(b=ve.R(W.kF(b,3.141592653589793)))?b:3.141592653589793-b,(ve.$(b,1.570796326794897)?b:Math.atan(Math.sqrt(1-T)*Math.tan(b)))*m},W.q=function(T,b,m){if(.006884661117170036>b){var _=(b=(1-(b=Math.sqrt(1-b)))/(1+b))*b,C=b*_,D=b*C,F=b*D,B=b*F,q=b*B,Z=-.7291666666666666*C+.2278645833333333*F+.03987630208333334*q,oe=.615234375*D-.21533203125*B,ue=-.54140625*F+.20302734375*q,be=.48876953125*B,De=-.4488699776785715*q,qe=Math.cos(2*m);return T/(1+b)*((1+.25*_+.015625*D+.00390625*B)*m+Math.sin(2*m)*(-1.5*b+.1875*C+.0234375*F+.00732421875*q-Z+ue-De+qe*(2*(.9375*_-.234375*D-.03662109375*B)-4*oe+6*be+qe*(4*Z-12*ue+24*De+qe*(8*oe-32*be+qe*(16*ue-80*De+qe*(32*be+64*qe*De)))))))}return T*(W.fG(m,b)-.5*b*Math.sin(2*m)/W.w(b,m))},W.w=function(T,b){return b=Math.sin(b),Math.sqrt(1-T*b*b)},W.av=function(T){return ve.FC(T,1,2220446049250313e-31)?1:1>T?W.Zw(0,1-T)-T/3*W.Ww(0,1-T):NaN},W.fG=function(T,b){var m=ve.Mb(1,T);T=ve.R(T);var _=Math.floor(T/1.570796326794897);if(1ve.R(_)&&1e-4>ve.R(C)&&1e-4>ve.R(D));)D=Math.sqrt(B),b+=T/((m=Math.sqrt(q))*(q+(D=Math.sqrt(F)*(D+m)+D*m))),T*=.25,F=.25*(F+D),B=.25*(B+D),q=.25*(q+D);return B=(F=_*C)-(q=D*D),3*b+T*(1+(q=F-6*q)*(.10227272727272728*q-.2142857142857143-.1730769230769231*D*(_=q+B+B))+D*(.1666666666666667*_+D*(-.4090909090909091*B+.1153846153846154*D*F)))/(m*Math.sqrt(m))},W.Zw=function(T,b){for(var m,_,C,D,F=1;_=2-((m=(T+b+F)/3)+T)/m,C=2-(m+b)/m,D=2-(m+F)/m,!(1e-4>ve.R(_)&&1e-4>ve.R(C)&&1e-4>ve.R(D));F=.25*(F+m))m=Math.sqrt(b),_=Math.sqrt(F),T=.25*(T+(m=Math.sqrt(T)*(m+_)+m*_)),b=.25*(b+m);return(1+(.04166666666666666*(T=_*C-D*D)-.1-.06818181818181818*(b=_*C*D))*T+.07142857142857142*b)/Math.sqrt(m)},W.Sw=function(T,b){if(ve.vi(T)||b==0||ve.$(ve.R(b),1.570796326794897))return b;if(.006884661117170036>T){var m=T*T,_=T*m,C=T*_,D=T*C,F=T*D,B=T*F,q=-(.02708333333333333*_+.03430059523809524*C+.03149181547619048*D+.02634359154541446*F+.02156896735835538*B),Z=.007669890873015873*C+.01299603174603175*D+.0148051353064374*F+.01454454953803912*B,oe=-(.002275545634920635*D+.004830845032667949*F+.006558395368616723*B),ue=.0006957236677288761*F+.001775193002406544*B,be=-.000217324089394402*B,De=Math.cos(2*b);return b+Math.sin(2*b)*(-(.5*T+.2083333333333333*m+.09375*_+.04878472222222222*C+.02916666666666667*D+.01938905423280423*F+.01388255931712963*B)-q+oe-be+De*(2*(.1041666666666667*m+.0875*_+.06050347222222222*C+.04151785714285714*D+.02958958540013228*F+.02203667534722222*B)-4*Z+6*ue+De*(4*q-12*oe+24*be+De*(8*Z-32*ue+De*(16*oe-80*be+De*(32*ue+64*De*be))))))}return b==0||ve.$(ve.R(b),1.570796326794897)?m=b:(C=(_=Math.sqrt(T))*Math.sin(b),m=Math.tan(.7853981633974483+b/2)*Math.pow((1-C)/(1+C),_/2),m=2*Math.atan(m)-1.570796326794897),m},W.tO=function(T,b){if(ve.vi(T)||b==0||ve.$(ve.R(b),1.570796326794897))return b;if(.006884661117170036>T){var m=T*(ue=T*(oe=T*(De=T*T))),_=T*(be=T*m),C=.05833333333333333*oe+.07232142857142858*ue+.05634300595238095*m+.0355325796406526*be+.020235546186067*_,D=.02653149801587302*ue+.04379960317460317*m+.0429211791776896*be+.03255384637546096*_,F=.01294022817460318*m+.02668104344536636*be+.03155651254609588*_,B=.00659454790965208*be+.0163075268674227*_,q=.003463473736911237*_,Z=Math.cos(2*b);return b+Math.sin(2*b)*(.5*T+.2083333333333333*De+.08333333333333333*oe+.03611111111111111*ue+.01875*m+.01195601851851852*be+.008863673941798942*_-C+F-q+Z*(2*(.1458333333333333*De+.1208333333333333*oe+.07039930555555556*ue+.03616071428571429*m+.01839451058201058*be+.01017113095238095*_)-4*D+6*B+Z*(4*C-12*F+24*q+Z*(8*D-32*B+Z*(16*F-80*q+Z*(32*B+64*Z*q))))))}var oe=Math.sqrt(T),ue=oe/2,be=Math.tan(.7853981633974483+b/2);T=0,C=1;for(var De=b;C!=0;De=_)m=oe*Math.sin(De),_=be*Math.pow((1+m)/(1-m),ue),_=2*Math.atan(_)-1.570796326794897,T++,(ve.$(_,De)||3e4this.Mk&&(this.Mk=0);var m=this.Re.getType();if(this.eH=m==A.Tc.PE_TYPE_PROJCS?2:1,m==A.Tc.PE_TYPE_PROJCS&&!T.loadConstants())throw A.i.O("PeProjcs.loadConstants failed");b=m==A.Tc.PE_TYPE_GEOGCS?this.Re:this.Re.getGeogcs(),m!=A.Tc.PE_TYPE_GEOGCS&&A.qf.getCode(b),this.Go=T.getUnit(),this.MH=b.getPrimem().getLongitude(),this.rH=T=b.getUnit().getUnitFactor(),T=Math.PI/(180*T),1e-10>Math.abs(T-1)&&(T=1),this.BA=T,m&A.Tc.PE_TYPE_PROJCS?(b=this.Re,this.CA=1/b.getUnit().getUnitFactor(),this.uw=.001/this.Re.getUnit().getUnitFactor(),this.vw=A.Eg.generate(b,A.Eg.PE_PCSINFO_OPTION_NONE),this.Bl=this.vw.isPannableRectangle(),this.Xz=A.Ab.lN(this.vw.getCentralMeridian(),this.BA)):(this.FA=this.Bl=!0,this.CA=0,m=1/b.getUnit().getUnitFactor(),this.uw=.001/b.getDatum().getSpheroid().getAxis()*m,this.Xz=0),this.Bl&&(this.wx(),this.yK(),this.jY(),this.xK(),this.hY(),this.iY())}return W.prototype.cs=function(){return this.Mk},W.prototype.mk=function(){return this.vw},W.Ky=function(T,b){return T==b||T!=null&&b!=null&&T.Mk==0&&b.Mk==0&&T.Cs===b.Cs},W.prototype.Xc=function(){return this.Bl},W.prototype.ih=function(T){T.L(this.uo)},W.prototype.rv=function(){return this.uo.v},W.prototype.qv=function(){return this.uo.C},W.prototype.BR=function(T){T.L(this.ww)},W.prototype.hY=function(){var T=this.Re.getType();if(T==A.Tc.PE_TYPE_PROJCS){T=this.Re;var b=this.mk().getCentralMeridian(),m=T.getGeogcs();if(m==null)throw A.i.ga("internal error");b=[[b+(m=1/m.getUnit().getUnitFactor()*Math.PI),0]],A.gj.geogToProj(T,1,b),b=b[0][0],m=T.getParameters()[A.Tc.PE_PARM_X0].getValue();var _=this.ol();T=new A.l,_.A(T),b=(_=Math.abs(b-m))+m,m=-1*_+m,_=T.H,T=T.G;var C=new A.l;C.L(m,T,b,_),this.uo==null&&(this.uo=C)}else{if(T!=A.Tc.PE_TYPE_GEOGCS)throw A.i.ga("internal error");m=1/this.Re.getUnit().getUnitFactor()*Math.PI,(T=new A.l).L(-m,-m/2,m,m/2),this.uo==null&&(this.uo=T)}},W.prototype.iY=function(){var T=this.Re.getType();if(T==A.Tc.PE_TYPE_PROJCS){var b=this.Re;if(T=this.mk().getCentralMeridian(),(b=b.getGeogcs())==null)throw A.i.ga("internal error");b=1/b.getUnit().getUnitFactor()*Math.PI;var m=this.Xr(),_=new A.l;m.A(_),(m=new A.l).L(T-b,_.G,T+b,_.H),this.ww==null&&(this.ww=m)}else{if(T!=A.Tc.PE_TYPE_GEOGCS)throw A.i.ga("internal error");b=1/this.Re.getUnit().getUnitFactor()*Math.PI,(T=new A.l).L(-b,-b/2,b,b/2),this.ww==null&&(this.ww=T)}},W.prototype.bf=function(){return this.BA},W.prototype.rm=function(){return this.CA},W.prototype.Xr=function(){if(this.Bl)return this.wl;var T=this.wl;return T??(this.wx(),this.wl)},W.prototype.Yr=function(){return this.Bl?null:(this.wl!=null||this.wx(),this.TG)},W.prototype.wx=function(){if(this.Re.getType()==A.Tc.PE_TYPE_PROJCS){var T=this.Re,b=T.getGeogcs(),m=T.horizonGcsGenerate();if(m!=null){var _=m[0].getNump(),C=m[0].getKind();T=0q&&(m=-400*D,oe.L(m,oe.G,m+5*B,oe.H)),m=new A.Hh(oe),this.wl==null&&(this.wl=m,this.Kv=T);else{if(q=new A.Ea,B=this.mk().isGcsHorizonMultiOverlap(),oe=A.iu.XE(b,A.ju.Integer64),B){for(q=new A.bL,Z=A.Ih.local().W(q,oe,null),be=0;be<_;be++)if(m[be].getKind()==A.Tc.PE_HORIZON_POLY){for(b=m[be].getSize(),D=m[be].getCoord(),C=[],F=0;Fthis.us&&(this.us=0),this.Go=b=this.FT.getUnit(),this.DH=1/b.getUnitFactor(),A.qf.getCode(T)}return W.Ky=function(T,b){return T==b||T!=null&&b!=null&&T.us==0&&b.us==0&&T.Cs===b.Cs},W.prototype.cs=function(){return this.us},W}();A.KL=ve}(le||(le={})),function(A){A.$g=function(){function ve(){}return ve.ub=function(W,T,b,m,_,C,D,F){if(C!=null||D!=null||F!=null){m=A.F.ca(m),T=A.F.ca(T),b=A.F.ca(b),_=A.F.ca(_),1.570796326794897b?m:A.F.ca(3.141592653589793-m):Math.atan2(oe*De,q*ue-Z*oe*be)),F!=null&&(A.s.$(A.s.R(_),1.570796326794897)?F.u=0>_?T:A.F.ca(3.141592653589793-T):(F.u=Math.atan2(q*De,ue*q*be-oe*Z),F.u=A.F.ca(F.u+3.141592653589793)))}}},ve.sf=function(W,T,b,m,_,C,D){if(C!=null||D!=null){T=A.F.ca(T),b=A.F.ca(b),1.570796326794897ue?_:A.F.ca(3.141592653589793-_):T:A.s.$(A.s.R(b),1.570796326794897)&&A.s.$(W,3.141592653589793)?0>b?_:A.F.ca(3.141592653589793-_):A.F.ca(T+Math.atan2(oe*B,q*m-Z*oe*F)))}},ve}()}(le||(le={})),function(A){A.Yk=function(){function ve(){}return ve.ub=function(W,T,b,m,_,C,D,F,B){var q=new A.ha(0),Z=new A.ha(0),oe=[0,0,0],ue=[0,0,0],be=[0,0,0],De=new A.ha(0),qe=new A.ha(0),rt=new A.ha(0),Dt=new A.ha(0),Vt=new A.ha(0);if(D!=null||F!=null||B!=null)if(A.s.vi(T))A.$g.ub(W,b,m,_,C,D,F,B);else{_=A.F.ca(_),b=A.F.ca(b);var Ke=A.F.ca(_-b);if(A.s.$(m,C)&&(A.s.$(b,_)||A.s.$(A.s.R(m),1.570796326794897)))D!=null&&(D.u=0),F!=null&&(F.u=0),B!=null&&(B.u=0);else{if(A.s.$(m,-C)){if(A.s.$(A.s.R(m),1.570796326794897))return D!=null&&(D.u=2*A.F.Ch(W,T)),F!=null&&(F.u=0Ke){Ot=1;var ei=b;b=_,_=ei,ei=m,m=C,C=ei}Ke=A.F.pt(T,m);var Jt=A.F.pt(T,C);F==null&&B==null||(A.$g.ub(W,b,Ke,_,Jt,null,q,Z),q=Math.atan2(Math.sin(q.u)*Math.cos(m-Ke),Math.cos(q.u)),Z=Math.atan2(Math.sin(Z.u)*Math.cos(C-Jt),Math.cos(Z.u)),Ot!=0&&(ei=q,q=Z,Z=ei),F!=null&&(F.u=q),B!=null&&(B.u=Z)),D!=null&&(A.F.el(1,T,m,b,0,rt,Dt,Vt),oe[0]=rt.u,oe[1]=Dt.u,oe[2]=Vt.u,A.F.el(1,T,C,_,0,rt,Dt,Vt),ue[0]=rt.u,ue[1]=Dt.u,ue[2]=Vt.u,be[0]=oe[1]*ue[2]-ue[1]*oe[2],be[1]=-(oe[0]*ue[2]-ue[0]*oe[2]),be[2]=oe[0]*ue[1]-ue[0]*oe[1],T=1-A.F.w(T,A.F.Xq(T,A.F.Sj(T,Math.acos(be[2]/Math.sqrt(be[0]*be[0]+be[1]*be[1]+be[2]*be[2]))))),T*=2-T,F=Math.atan2(-be[1],-be[0]),be=A.F.ca(F-1.570796326794897),F=A.F.ca(F+1.570796326794897),be=A.s.R(A.F.ca(b-be))<=A.s.R(A.F.ca(b-F))?be:F,A.$g.ub(1,be,0,b,Ke,De,null,null),A.$g.ub(1,be,0,_,Jt,qe,null,null),3.141592653589793_&&(_=A.s.R(_),C=A.F.ca(C+3.141592653589793)),b=A.F.ca(b),m=A.F.ca(m),1.570796326794897=A.s.R(C)?1:-1);C=A.F.ca(b+Math.atan(Math.tan(C)*-Math.sin(rt))),A.$g.ub(W,C,0,b,rt,null,Z,null),rt=A.s.R(1.570796326794897-A.s.R(Z.u)),rt=A.F.Sj(T,rt),rt=1-A.F.w(T,A.F.Xq(T,rt)),rt*=2-rt,A.F.el(1,T,0,C,0,be,De,qe),oe[0]=be.u,oe[1]=De.u,oe[2]=qe.u,A.F.el(1,T,m,b,0,be,De,qe),ue[0]=be.u,ue[1]=De.u,ue[2]=qe.u,m=Math.acos((oe[0]*ue[0]+oe[1]*ue[1]+oe[2]*ue[2])/Math.sqrt(ue[0]*ue[0]+ue[1]*ue[1]+ue[2]*ue[2])),m=A.F.Sj(rt,m),_=0<(m=A.F.q(W,rt,m)+_*Dt)?Z.u:A.F.ca(Z.u+3.141592653589793),W=A.s.R(m)/A.F.Ch(W,rt)*1.570796326794897,W=A.F.Tq(rt,W),W=A.F.pt(rt,W),A.$g.sf(1,C,0,W,_,D,q),F!=null&&(B=q.u),F!=null&&(F.u=A.F.Sj(T,B))}},ve}()}(le||(le={})),function(A){A.eu=function(){function ve(){}return ve.ub=function(W,T,b,m,_,C,D,F,B){var q=0,Z=0,oe=0;if(D!=null||F!=null||B!=null)if(A.s.vi(T))A.$g.ub(W,b,m,_,C,D,F,B);else{var ue=A.F.ca(_-b);if(A.s.$(m,C)&&(A.s.Dd(ue)||A.s.$(A.s.R(m),1.570796326794897)))D!=null&&(D.u=0),F!=null&&(F.u=0),B!=null&&(B.u=0);else{if(A.s.$(m,-C)){if(A.s.$(A.s.R(m),1.570796326794897))return D!=null&&(D.u=2*A.F.Ch(W,T)),F!=null&&(F.u=0=ti&&!A.s.$(bi,Ot));if(Xt!=0)be=(De*=q)*(256+De*(De*(74-47*De)-128))/1024,D!=null&&(D.u=qe*(1+De*(4096+De*(De*(320-175*De)-768))/16384)*(er-be*Fi*(Z+be/4*(Ri*(2*oe-1)-be/6*Z*(4*Fi*Fi-3)*(4*oe-3))))),F!=null&&(F.u=A.s.$(A.s.R(m),1.570796326794897)?0>m?_:A.F.ca(3.141592653589793-_):Math.atan2(Vt*Jt,T*Ke-Dt*Vt*ei)),B!=null&&(A.s.$(A.s.R(C),1.570796326794897)?B.u=0>C?b:A.F.ca(3.141592653589793-b):(B.u=Math.atan2(T*Jt,T*Ke*ei-Dt*Vt),B.u=A.F.ca(B.u+3.141592653589793)));else{Ot=A.s.Mb(3.141592653589793,ue),Ri=Dt*Ke-T*Vt,er=Math.acos(Ri),Fi=Math.sin(er),q=1,ti=ar=0;do oe=ar,ei=1-.25*(ar=be*(q*=q)*(1+be+be*be))+.1875*(Z=be*be*(ei=q*q)*(1+2.25*be))-.1953125*(Xt=be*be*be*ei*q),ar=.25*ar-.25*Z+.29296875*Xt,Jt=.03125*Z-.05859375*Xt,Xt*=.00651041666666667,Z=Ri-2*Dt*Ke/q,1=ti&&!A.s.$(oe,ar));D!=null&&(ei=1+(De*=q*=q)*(4096+De*(De*(320-175*De)-768))/16384,A.s.$(m,-C)?D.u=3.141592653589793*qe*ei:(Z=Ri-2*Dt*Ke/q,q=Math.acos(Z),Ri=Math.cos(2*q),bi=Math.cos(3*q),D.u=qe*(ei*er+De*(De*(128+De*(35*De-60))-512)/2048*Fi*Z+De*(5*De-4)/6144*De*De*Math.sin(2*er)*Ri+Xt*Math.sin(3*er)*bi+-762939453125e-16*De*De*De*De*Math.sin(4*er)*Math.cos(4*q)))),F!=null&&(A.s.Dd(m)&&A.s.Dd(C)?(q=Math.sqrt(1-ar*ar),F.u=Math.acos(q),0>ue&&(F.u*=-1)):A.s.$(A.s.R(m),1.570796326794897)?F.u=0>m?_:A.F.ca(3.141592653589793-_):(D=ar/T,qe=Math.sqrt(1-D*D),0>T*Ke-Dt*Vt*Math.cos(Ot)&&(qe*=-1),F.u=Math.atan2(D,qe),A.s.$(m,-C)&&A.s.R(A.F.ca(b-_))>3.141592653589793*(1-be*Math.cos(m))&&(0A.s.R(F.u)||0>m&&1.570796326794897C?b:A.F.ca(3.141592653589793-b):(ue=ar/Vt,D=Math.sqrt(1-ue*ue),qe=Math.sin(Ot/2),0>Math.sin(rt-W)-2*T*Ke*qe*qe&&(D*=-1),B.u=Math.atan2(ue,D),B.u=A.F.ca(B.u+3.141592653589793),A.s.$(m,-C)&&!A.s.Dd(m)&&!A.s.$(A.s.R(m),1.570796326794897)&&A.s.R(A.F.ca(b-_))>3.141592653589793*(1-be*Math.cos(m))&&(F!=null?qe=F.u:(D=ar/T,qe=Math.sqrt(1-D*D),0>T*Ke-Dt*Vt*Math.cos(Ot)&&(qe*=-1),qe=Math.atan2(D,qe),A.s.$(m,-C)&&A.s.R(A.F.ca(b-_))>3.141592653589793*(1-be*Math.cos(m))&&(0A.s.R(qe)||0>m&&1.570796326794897=A.s.R(qe)&&1.570796326794897A.s.R(B.u))&&(B.u=-1*A.F.ca(B.u+3.141592653589793))))}}}},ve.sf=function(W,T,b,m,_,C,D,F){if(D!=null||F!=null)if(A.s.vi(T))A.$g.sf(W,b,m,_,C,D,F);else if(C=A.F.ca(C),A.s.$(A.s.R(m),1.570796326794897)||A.s.Dd(C)||A.s.$(A.s.R(C),3.141592653589793))A.Yk.sf(W,T,b,m,_,C,D,F);else{var B=A.s.R(C)==1.570796326794897?0:Math.cos(C),q=A.s.R(C)==3.141592653589793?0:Math.sin(C);A.s.$(A.s.R(m),1.570796326794897)&&(b=0),C=1-Math.sqrt(1-T);var Z=A.F.Xq(T,m);m=A.s.R(Z)==1.570796326794897?0:Math.cos(Z);var oe=Math.sin(Z);Z=Math.atan2(Math.tan(Z),B);var ue=m*q,be=ue*ue,De=1-be,qe=T/(1-T)*De,rt=(T=qe*(256+qe*(qe*(74-47*qe)-128))/1024)/4,Dt=T/6,Vt=_/(W*(1-C)*(1+qe*(4096+qe*(qe*(320-175*qe)-768))/16384)),Ke=Vt;do{var Ot=Ke;_=A.s.R(Ke)==1.570796326794897?0:Math.cos(Ke);var ei=(qe=A.s.R(Ke)==3.141592653589793?0:Math.sin(Ke))*qe;Ke=T*qe*((W=Math.cos(2*Z+Ke))+rt*(_*(2*(Ke=W*W)-1)-Dt*W*(4*ei-3)*(4*Ke-3)))+Vt}while(!A.s.$(Ot,Ke));_=A.s.R(Ke)==1.570796326794897?0:Math.cos(Ke),qe=A.s.R(Ke)==3.141592653589793?0:Math.sin(Ke),D!=null&&(q=Math.atan2(qe*q,m*_-oe*qe*B),De=C/16*De*(4+C*(4-3*De)),W=Math.cos(2*Z+Ke),D.u=A.F.ca(b+(q-(1-De)*C*ue*(Ke+De*qe*(W+De*_*(2*W*W-1)))))),F!=null&&(De=oe*qe-m*_*B,De=(1-C)*Math.sqrt(be+De*De),F.u=Math.atan2(oe*_+m*qe*B,De))}},ve}()}(le||(le={})),function(A){A.KC=function(){function ve(){}return ve.ub=function(W,T,b,m,_,C,D,F,B){var q=A.F.ca(_-b),Z=A.s.$(A.s.R(m),1.570796326794897),oe=A.s.$(A.s.R(C),1.570796326794897);if(A.s.$(m,C)&&(A.s.Dd(q)||Z))D!=null&&(D.u=0),F!=null&&(F.u=0),B!=null&&(B.u=0);else{if(A.s.vi(T)){var ue=Math.sin(m),be=Math.sin(C);ue=Math.sqrt((1+ue)/(1-ue)),be=Math.sqrt((1+be)/(1-be)),ue=Math.log(be)-Math.log(ue),ue=Math.atan2(q,ue),D!=null&&(D.u=A.s.$(m,C)?A.s.R(W*Math.cos(m)*q):A.s.R((W*C-W*m)/Math.cos(ue)))}else be=A.F.Sw(T,C),ue=Math.sin(A.F.Sw(T,m)),be=Math.sin(be),ue=Math.sqrt((1+ue)/(1-ue)),be=Math.sqrt((1+be)/(1-be)),ue=Math.log(be)-Math.log(ue),ue=Math.atan2(q,ue),D!=null&&(A.s.$(m,C)?D.u=A.s.R(W*q*Math.cos(m)/A.F.w(T,m)):(q=A.F.q(W,T,m),W=A.F.q(W,T,C),D.u=A.s.R((W-q)/Math.cos(ue))));F==null&&B==null||(D=A.F.ca(ue+3.141592653589793),Z&&oe||!Z&&!oe||(Z?ue=0>m?_:A.F.ca(3.141592653589793-_):oe&&(D=0>C?b:A.F.ca(3.141592653589793-b))),F!=null&&(F.u=ue),B!=null&&(B.u=D))}},ve.sf=function(W,T,b,m,_,C,D,F){C=A.F.ca(C),0>_&&(_=A.s.R(_),C=A.F.ca(C+3.141592653589793)),A.s.vi(T)?A.s.$(A.s.R(m),1.570796326794897)?(b=0>m?C:A.F.ca(3.141592653589793-C),3.141592653589793>=(C=_/W%6.283185307179586)?W=m-A.s.Mb(C,m):(b=A.F.ca(b+3.141592653589793),W=-m+A.s.Mb(C-3.141592653589793,m))):A.s.$(A.s.R(C),1.570796326794897)?(b=A.F.ca(b+A.s.Mb(_,C)/(W*Math.cos(m))),W=m):(W=m+_*Math.cos(C)/W,1.570796326794897m?C:A.F.ca(3.141592653589793-C),C=_/A.F.lW(W,T),3.141592653589793>=(C%=6.283185307179586)?W=m-A.s.Mb(C,m):(b=A.F.ca(b+3.141592653589793),W=-m+A.s.Mb(C-3.141592653589793,m)),W=A.F.Tq(T,W)):A.s.$(A.s.R(C),1.570796326794897)?(b=A.F.ca(b+A.s.Mb(_,C)*A.F.w(T,m)/(W*Math.cos(m))),W=m):(W=1.570796326794897*(_*Math.cos(C)+A.F.q(W,T,m))/A.F.Ch(W,T),1.570796326794897Math.PI||Math.abs(m.y)>.5*Math.PI||Math.abs(_.y)>.5*Math.PI||(Math.abs(m.y)==.5*Math.PI||Math.abs(_.y)==.5*Math.PI)&&m.x!=_.x)return NaN;if(C=T.YA(C,Math.min(m.x,_.x),Math.max(m.x,_.x)),!new A.Oc(m.x,_.x).contains(C))return NaN;var D=ve.construct(m);if(_=ve.construct(_),D=T.$u(b,D),_=T.$u(b,_),(_=D.YE(_)).z.rg())return m.y;var F=new A.Xb;F.set(_.x),F.lm(_.z),F.Po(-1);var B=new A.Xb;B.set(_.y),B.lm(_.z),B.Po(-1);var q=new A.Xb;return q.set(B),q.Bg(B),(D=new A.Xb).set(F),D.Bg(F),D.add(q),D.sqrt(),D.rg()||F.rg()&&B.rg()?m.y:(m=Math.atan2(B.value(),F.value()),m=Math.atan2(D.value()*Math.cos(m-C),1-b),C=T.yP(b,A.h.construct(C,m)),b=new A.Od(C.x,C.y,-C.z),C=_.value().Sh(C),b=_.value().Sh(b),Math.abs(b)Math.PI||Math.abs(m.y)>.5*Math.PI||Math.abs(_.y)>.5*Math.PI||(Math.abs(m.y)==.5*Math.PI||Math.abs(_.y)==.5*Math.PI)&&m.x!=_.x||Math.abs(C)>=.5*Math.PI||0C&&_.y>C||0>m.y&&0>_.y&&m.yMath.abs(D[1]-m.x)&&(m=D[0],D[0]=D[1],D[1]=m)),C))},T.YA=function(b,m,_){return b>_?b-=2*(m=Math.ceil((b-_)/(2*Math.PI)))*Math.PI:b_.x?(_.x-=_.x%360,-180>_.x&&(_.x+=360)):180<_.x&&(_.x-=_.x%360,180<_.x&&(_.x-=360)),90<_.y&&(_.y=90),-90>_.y&&(_.y=-90);for(var C=-180,D=180,F=(W=5*b)-1,B=(T=(W+31)/32)-1;0<=B;B--)for(var q=F-32*B,Z=Math.min(32,W-32*B),oe=1;oe=ue?(m[B]|=1<=ue?(m[B]|=1<>C&31;if(31<(C+=5)){var B=37-C;F&=(1<T)for(D=0;D=T[0]?T:'"'+T.trim()+'"'}var W=[];A.SC=function(){function T(){}return T.zQ=function(b){try{for(var m=0;mb||b>this.Ba)throw A.i.O();return this.dg[b]},T.prototype.Rf=function(b){return this.wh[b]},T.gz=function(b){return T.EM[b]},T.Vp=function(b){return T.NM[b]},T.Wa=function(b){return T.mM[b]},T.prototype.hasAttribute=function(b){return 0<=this.wh[b]},T.prototype.dG=function(){return this.hasAttribute(1)},T.te=function(b){return T.$C[b]},T.prototype.GR=function(b){return this.Xs[b]},T.yG=function(b,m){return T.$C[b]===m},T.prototype.Nb=function(b){return this===b},T.prototype.Cn=function(){for(var b=A.P.Vh(this.dg[0]),m=1;m++F&&W(D,q,C.gu),Z[0]?B?q=F:(Z=D.c,q=D.e+q+1):++q;Z.lengthD.Cd&&Z[0]?"-":"")+(1q?"e":"e+")+q:D.toString()}function W(D,F,B,q){var Z=D.c,oe=D.e+F+1;if(B===1?q=5<=Z[oe]:B===2?q=5oe||Z[oe+1]!==void 0||1&Z[oe-1]):B===3?q=q||Z[oe]!==void 0||0>oe:(q=!1,B!==0&&T("!Big.RM!")),1>oe||!Z[0])q?(D.e=-F,D.c=[1]):D.c=[D.e=0];else{if(Z.length=oe--,q)for(;9<++Z[oe];)Z[oe]=0,oe--||(++D.e,Z.unshift(1));for(oe=Z.length;!Z[--oe];Z.pop());}return D}function T(D){throw(D=Error(D)).name="BigError",D}var b=-7,m=21,_=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,C=function(){function D(F){if(F instanceof D)this.Cd=F.Cd,this.e=F.e,this.c=F.c.slice();else{var B,q,Z;for(F===0&&0>1/F?F="-0":_.test(F+="")||T(NaN),this.Cd=F.charAt(0)=="-"?(F=F.slice(1),-1):1,-1<(B=F.indexOf("."))&&(F=F.replace(".","")),0<(q=F.search(/e/i))?(0>B&&(B=q),B+=+F.slice(q+1),F=F.substring(0,q)):0>B&&(B=F.length),q=0;F.charAt(q)=="0";q++);if(q==(Z=F.length))this.c=[this.e=0];else{for(;F.charAt(--Z)=="0";);for(this.e=B-q-1,this.c=[],B=0;q<=Z;this.c[B++]=+F.charAt(q++));}}}return D.prototype.abs=function(){var F=new D(this);return F.Cd=1,F},D.prototype.cmp=function(F){var B=this.c,q=(F=new D(F)).c,Z=this.Cd,oe=F.Cd,ue=this.e,be=F.e;if(!B[0]||!q[0])return B[0]?Z:q[0]?-oe:0;if(Z!=oe)return Z;if(F=0>Z,ue!=be)return ue>(be^F)?1:-1;for(Z=-1,oe=(ue=B.length)<(be=q.length)?ue:be;++Z(q[Z]^F)?1:-1;return ue==be?0:ue>(be^F)?1:-1},D.prototype.lm=function(F){var B=this.c,q=(F=new D(F)).c,Z=this.Cd==F.Cd?1:-1,oe=D.tr;if((oe!==~~oe||0>oe||1e6Jt?0:Jt,De.unshift(0);Vt++be;be++){if(ue!=(Vt=Dt.length))var Xt=ue>Vt?1:-1;else{var ti=-1;for(Xt=0;++tiDt[ti]?1:-1;break}}if(!(0>Xt))break;for(F=Vt==ue?q:De;Vt;){if(Dt[--Vt]Jt&&W(Ke,oe,D.gu,Dt[0]!==void 0),Ke},D.prototype.aS=function(){return 0this.cmp(0)},D.prototype.kt=function(F){var B,q=this.Cd,Z=(F=new D(F)).Cd;if(q!=Z)return F.Cd=-Z,this.oI(F);var oe=this.c.slice(),ue=this.e,be=F.c,De=F.e;if(!oe[0]||!be[0])return be[0]?(F.Cd=-Z,F):new D(oe[0]?this:0);if(q=ue-De){for((B=0>q)?(q=-q,ue=oe):(De=ue,ue=be),ue.reverse(),Z=q;Z--;ue.push(0));ue.reverse()}else for(ue=((B=oe.lengthq;){if(oe[--ue]Z.length-ue.length&&(q=ue,ue=Z,Z=q),B=ue.length,q=0;B;)q=(Z[--B]=Z[B]+ue[B]+q)/10|0,Z[B]%=10;for(q&&(Z.unshift(q),++oe),B=Z.length;Z[--B]==0;Z.pop());return F.c=Z,F.e=oe,F},D.prototype.pow=function(F){var B=this,q=new D(1),Z=q,oe=0>F;for((F!==~~F||-1e6>F||1e6>=1;)B=B.nr(B);return oe?q.lm(Z):Z},D.prototype.round=function(F,B){var q=this;return F==null?F=0:(F!==~~F||0>F||1e6B&&T(NaN),(B=Math.sqrt(this.toString()))==0||B==1/0?((B=F.join("")).length+q&1||(B+="0"),(F=new D(Math.sqrt(B).toString())).e=((q+1)/2|0)-(0>q||1&q)):F=new D(B.toString()),B=F.e+(D.tr+=4);do q=F,F=Z.nr(q.oI(this.lm(q)));while(q.c.slice(0,B).join("")!==F.c.slice(0,B).join(""));return W(F,D.tr-=4,D.gu),F},D.prototype.nr=function(F){var B=this.c,q=(F=new D(F)).c,Z=B.length,oe=q.length,ue=this.e,be=F.e;if(F.Cd=this.Cd==F.Cd?1:-1,!B[0]||!q[0])return new D(0*F.Cd);if(F.e=ue+be,Zue;)oe=De[be]+q[ue]*B[be-ue-1]+oe,De[be--]=oe%10,oe=oe/10|0;De[be]=(De[be]+oe)%10}for(oe&&++F.e,De[0]||De.shift(),ue=De.length;!De[--ue];De.pop());return F.c=De,F},D.prototype.toString=function(){var F=this.e,B=this.c.join(""),q=B.length;if(F<=b||F>=m)B=B.charAt(0)+(1F?"e":"e+")+F;else if(0>F){for(;++F;B="0"+B);B="0."+B}else if(0q)for(F-=q;F--;B+="0");else Fthis.Cd&&this.c[0]?"-"+B:B},D.prototype.toExponential=function(F){return F==null?F=this.c.length-1:(F!==~~F||0>F||1e6=F&&(Z=ve(this,this.e+F),0>this.Cd&&this.c[0]&&0>Z.indexOf("-")&&(Z="-"+Z));return b=B,m=q,Z||T("!toFix!"),Z},D.prototype.toPrecision=function(F){return F==null?this.toString():((F!==~~F||1>F||1e6C.get(ue)?(C.set(B,2147483647),B=ue):C.set(ue,2147483647),q++;else{if(!(1&q))C.set(B,2147483647);else if(b)return m!=null&&(m[0]=!0),null;F.N(oe),B=ue,q=1}if(!(1&q))C.set(B,2147483647);else if(b)return m!=null&&(m[0]=!0),null;if(!b)for(C.Wd(0,C.size,function(De,qe){return De-qe}),ue=0,be=C.size;uem-b)_.qr(b,m,T);else{var C=!0;try{for(var D=1/0,F=-1/0,B=b;BF&&(F=q)}if(this.reset(m-b,D,F,m-b)){for(B=b;BC&&_.qr(b+C,b+m,T);100T||m==b)&&(T=Math.min(W.cL,T),this.zf.Jb(T),this.zf.resize(T),this.zf.Yj(0,0,this.zf.size),this.zH=b,this.As.resize(_),this.Gs=(m-b)/(T-1),!0)},W.prototype.uF=function(T){return A.P.truncate((T-this.zH)/this.Gs)},W.cL=65536,W}();A.Zt=ve}(le||(le={})),function(A){var ve,W;(W=ve||(ve={}))[W.enum_line=1]="enum_line",W[W.enum_arc=2]="enum_arc",W[W.enum_dummy=4]="enum_dummy",W[W.enum_concave_dip=8]="enum_concave_dip",W[W.enum_connection=3]="enum_connection";var T=function(){function D(){}return D.Su=function(F,B,q,Z,oe,ue){var be=new D;return be.Km=new A.h,be.Xm=new A.h,be.cw=new A.h,be.Km.N(F),be.Xm.N(B),be.cw.N(q),be.Eo=Z,be.sh=oe,be.uh=ue,be},D.construct=function(F,B,q,Z){var oe=new D;return oe.Km=new A.h,oe.Xm=new A.h,oe.cw=new A.h,oe.Km.N(F),oe.Xm.N(B),oe.cw.Sc(),oe.Eo=4,oe.sh=q,oe.uh=Z,oe},D}(),b=function(){function D(F,B,q,Z,oe,ue){this.$v=null,this.za=0,this.zA=F,this.XH=this.VH=0,this.La=B,this.Oj=q,this.xk=Z,this.Fq=oe,this.Vb=ue}return D.prototype.next=function(){for(var F=new A.Ta;;){if(this.za==this.zA.I())return null;if(this.zA.we(this.za,F),this.za++,!F.B())break}var B=!1;if(this.$v==null&&(this.VH=F.Ng(),this.XH=F.kh(),this.$v=C.buffer(F,this.La,this.Oj,this.xk,this.Fq,this.Vb),B=!0),this.zaZ)throw A.i.O();if(F.B())return new A.Ea(F.description);var be=new A.l;return F.yc(be),0=oe&&(oe=96),ue.sb=Math.abs(ue.La),ue.Mv=ue.sb!=0?1/ue.sb:0,isNaN(Z)||Z==0?Z=1e-5*ue.sb:Z>.5*ue.sb&&(Z=.5*ue.sb),12>oe&&(oe=12),(F=Math.abs(B)*(1-Math.cos(Math.PI/oe)))>Z?Z=F:(F=Math.PI/Math.acos(1-Z/Math.abs(B)))(oe=A.P.truncate(F))&&(oe=12,Z=Math.abs(B)*(1-Math.cos(Math.PI/oe))),ue.xk=Z,ue.Fq=oe,ue.oA=Math.min(ue.dt,.25*Z),ue.gE()},D.prototype.ev=function(){if(this.Jd==null)this.Jd=[];else if(this.Jd.length!==0)return;var F=this.lE();F=A.P.truncate((F+3)/4);var B=.5*Math.PI/F;this.jA=B;for(var q=0;q<4*F;q++)this.Jd.push(null);var Z=Math.cos(B);B=Math.sin(B);var oe=A.h.construct(0,1);for(q=0;q=this.La&&(F=new A.l,this.Y.A(F),F.S()<=2*-this.La||F.da()<=2*this.La))return new A.Ea(this.Y.description)}switch(this.Y.K()){case 33:return this.KN();case 550:return this.JN();case 1607:return this.MN();case 1736:return this.LN();case 197:return this.GN();default:throw A.i.Ra()}},D.prototype.MN=function(){if(this.zG(this.Y)){var F=new A.Ta;this.Y.we(0,F);var B=new A.l;return this.Y.A(B),F.Db(B.tf()),this.Iu(F)}return this.Y=this.RV(this.Y),F=new m(this,this.qq),A.Ih.local().W(F,this.Oj,this.Vb).next()},D.prototype.LN=function(){if(this.La==0)return this.Y;var F=A.$l.local();if(this.ev(),this.Y=F.W(this.Y,null,!1,this.Vb),0>this.La){var B=this.Y;return B=this.ly(B,0,B.ea()),F.W(B,this.Oj,!1,this.Vb)}return this.zG(this.Y)?(F=new A.Ta,this.Y.we(0,F),B=new A.l,this.Y.A(B),F.Db(B.tf()),this.Iu(F)):(F=new _(this),A.Ih.local().W(F,this.Oj,this.Vb).next())},D.prototype.ly=function(F,B,q){for(var Z=new A.Ea(F.description);BF.Ka(B))){var oe=F.Kr(B),ue=new A.l;if(F.Tj(B,ue),0=this.La){if(this.La==0)F.bd(this.Y,!1);else{var B=new A.Hh;this.Y.dn(B),B.X(this.La,this.La),F.bd(B,!1)}return F}return F.bd(this.Y,!1),this.Y=F,this.eE(F,0)},D.prototype.eE=function(F,B){this.ev();var q=new A.Ea(F.description),Z=new A.h,oe=new A.h,ue=new A.h,be=new A.h,De=new A.h,qe=new A.h,rt=new A.h,Dt=new A.h,Vt=F.Ka(B),Ke=F.Ca(B),Ot=0;for(B=F.Ka(B);OtF.Ka(B))return null;if(this.AG(F,B)&&0(F=-1>F?4:2*Math.PI/Math.acos(F)+.5)?F=4:F>this.Fq&&(F=this.Fq),A.P.truncate(F)},D.prototype.BD=function(F,B,q,Z,oe){this.ev();var ue=new A.h;ue.vc(q,B),ue.scale(this.Mv);var be=new A.h;be.vc(Z,B),be.scale(this.Mv),0>(ue=Math.atan2(ue.y,ue.x)/this.jA)&&(ue=this.Jd.length+ue),ue=this.Jd.length-ue,0>(be=Math.atan2(be.y,be.x)/this.jA)&&(be=this.Jd.length+be),(be=this.Jd.length-be)ue.I(be))return 0>oe||(oe=F,ue=new A.Ta,oe.we(oe.Ca(B),ue),this.Au(q,ue)),1;var De=ue.Oa(ue.Ya(ue.Ob(be))),qe=new A.Ed;if(qe.ig(-De.x,-De.y),ue.Pc(qe),Z&&(this.oQ(ue,be,oe),2>ue.I(be)))return 0>oe||(oe=F,ue=new A.Ta,oe.we(oe.Ca(B),ue),this.Au(q,ue)),1;this.$d.length=0;var rt=ue.Ob(be);B=ue.Ya(rt);var Dt=oe==1?ue.Na(B):ue.V(B);F=oe==1?ue.V(B):ue.Na(B);var Vt=!0;Z=new A.h,be=new A.h;var Ke=new A.h,Ot=new A.h,ei=new A.h,Jt=new A.h,Xt=new A.h,ti=new A.h,bi=new A.h,Fi=new A.h,Ri=this.sb;rt=ue.Ka(rt);for(var er=0;erDt||0>Vt&&Dt==0?this.$d.push(T.Su(Ot,ei,Z,2,this.$d.length+1,this.$d.length-1)):Ot.rb(ei)||(this.$d.push(T.construct(Ot,Z,this.$d.length+1,this.$d.length-1,"dummy")),this.$d.push(T.construct(Z,ei,this.$d.length+1,this.$d.length-1,"dummy"))),Jt.add(be,bi),this.$d.push(T.Su(ei,Jt,Z,1,this.$d.length+1,this.$d.length-1)),Ot.N(Jt),Fi.N(bi),Ke.N(Z),Z.N(be),ti.N(Xt),Dt=B,B=F,Vt=!1,F=oe==1?ue.V(B):ue.Na(B);return this.$d[this.$d.length-1].sh=0,this.$d[0].uh=this.$d.length-1,this.TV(q),qe.ig(De.x,De.y),q.TD(qe,q.ea()-1),1},D.prototype.TV=function(F){for(var B=this.uO(),q=!0,Z=B+1,oe=B;Z!=B;oe=Z){var ue=this.$d[oe];Z=ue.sh!=-1?ue.sh:(oe+1)%this.$d.length,ue.Eo!=0&&(q&&F.Nt(ue.Km),ue.Eo==2?this.BD(F,ue.cw,ue.Km,ue.Xm,!0):F.Ei(ue.Xm),q=!1)}},D.prototype.uO=function(){this.Ms==null&&(this.Ms=[null,null,null,null,null,null,null,null,null]);for(var F=0,B=0,q=this.$d.length;B=this.sb)return!0}return!1},D.prototype.oQ=function(F,B,q){for(var Z=0;1>Z;Z++){var oe=!1,ue=F.Ob(B),be=F.Ka(ue);if(be==0)break;var De=be;if(3>be)break;!F.ec(ue)&&(De=be-1),ue=F.Ya(ue),be=0dn||0>Lr&&dn==0||!this.Hv(Ot,Vt,Ke)||(Xt.N(Ke),xo=!1,++ar,oe=!0),xo){if(0.5*this.xk?(Jt.add(Ot,Vt),Jt.scale(.5),Fi.normalize(),Fi.cr(),Ri.N(Fi),Ri.scale(er-ar),Jt.add(Ri),F.mf(be,Jt)):F.qd(be,!0),ar=0}Ot.N(Vt),rt=ue}Vt.N(Ke),be=ue,ue=qe,qe=0B?(this.qq=!1,F):(this.qq=!0,A.Hg.Ok(F,this.dt,!1,!0,this.Vb))},D.prototype.Au=function(F,B){if(B=B.D(),this.Jd!=null&&this.Jd.length!==0){var q=new A.h;q.N(this.Jd[0]),q.Dt(this.sb,B),F.Nt(q);for(var Z=1,oe=this.Jd.length;Z=m?1:-1;case 1:if(T.G=m?1:-1;case 2:if(T.v>=m&&T.C>m)break;return T.C<=m?1:-1;case 3:if(!(T.G>=m&&T.H>m))return T.H<=m?1:-1}return 0},W.prototype.vy=function(T,b){return T.K()==1736?this.xy(T,b):this.yy(T)},W.prototype.xy=function(T,b){if(this.Da.S()==0||this.Da.da()==0)return T.Ja();var m=new A.l;T.yc(m),this.Y=this.g.Ib(T);var _=new A.l,C=new A.l,D=new A.h,F=new A.h,B=[0,0,0,0,0,0,0,0,0],q=[0,0,0,0,0,0,0,0,0];new A.jg;var Z=new A.zb,oe=new A.ja(0);oe.Jb(Math.min(100,T.I()));for(var ue=!1,be=0;!ue&&4>be;be++){var De=!1,qe=(1&be)!=0,rt=0;switch(be){case 0:rt=this.Da.v,De=m.v<=rt&&m.C>=rt;break;case 1:rt=this.Da.G,De=m.G<=rt&&m.H>=rt;break;case 2:rt=this.Da.C,De=m.v<=rt&&m.C>=rt;break;case 3:rt=this.Da.H,De=m.G<=rt&&m.H>=rt}if(De)for(ue=!0,De=this.g.Ob(this.Y);De!=-1;){var Dt=-1,Vt=-1,Ke=this.g.Ya(De),Ot=Ke;do{var ei=this.g.cc(Ot);ei==null&&(ei=Z,this.g.D(Ot,D),ei.Ec(D),this.g.D(this.g.V(Ot),F),ei.Rc(F)),ei.A(_);var Jt=this.Nh(_,be,rt),Xt=0,ti=-1;if(Jt==-1){Xt=0<(ei=ei.fq(qe,rt,B,q))?this.g.Wl(Ot,q,ei):0,Xt+=1;var bi=Ot,Fi=this.g.V(bi);for(ei=0;eithis.g.Ka(De)?this.g.ar(De):this.g.Sb(De)}}return ue?T.Ja():(this.AB(),0q;q++){var Z=!1,oe=(1&q)!=0,ue=0;switch(q){case 0:ue=this.Da.v,Z=B.v<=ue&&B.C>=ue;break;case 1:ue=this.Da.G,Z=B.G<=ue&&B.H>=ue;break;case 2:ue=this.Da.C,Z=B.v<=ue&&B.C>=ue;break;case 3:ue=this.Da.H,Z=B.G<=ue&&B.H>=ue}if(Z){Z=F,F=T.Ja(),(Z=Z.Ha()).aj();for(var be,De=new A.h;Z.ab();)for(var qe,rt=!0;Z.Ia();){var Dt=Z.ia();Dt.A(b);var Vt=this.Nh(b,q,ue);if(Vt==-1){if(0<(Vt=Dt.fq(oe,ue,_,C))){var Ke=0;be=Dt.bc();for(var Ot=0;Ot<=Vt;Ot++)if(Ke!=(qe=Ot=(q=A.P.truncate(Math.min(Math.ceil(q/T),2048)))))){for(var Z=1;ZC.size)){var oe=this;C.Wd(0,C.size,function(Jt,Xt){return oe.Oh(Jt,Xt)}),m=new A.h,D=new A.h,F=new A.h,D.Sc();var ue=-1;B=new A.ja(0),q=new A.ja(0),Z=this.g.Hd();for(var be=this.g.Hd(),De=0,qe=C.size;Dethis.Oh(ue,Vt)&&(this.g.D(Vt,m),T?m.y==b:m.x==b)&&(B.add(ue),Ke=!0,this.g.Sa(ue,be,1)),0>this.Oh(ue,rt)&&(this.g.D(rt,m),T?m.y==b:m.x==b)&&(Ke||B.add(ue),this.g.Sa(ue,Z,1))}for(Dt=0,Ke=B.size;Dtthis.Oh(qe,Dt)&&(this.g.D(Dt,B),T?B.y==b:B.x==b)&&(rt=Dt),Dt=-1;var Vt=this.g.Na(qe);if(0>this.Oh(qe,Vt)&&(this.g.D(Vt,B),T?B.y==b:B.x==b)&&(Dt=Vt),rt!=-1&&Dt!=-1)this.Mh(qe,_,C),this.g.qd(qe,!1),this.Mh(rt,_,C),this.g.qd(rt,!1),oe=!0;else if(rt!=-1||Dt!=-1){for(Vt=De+1;Vtthis.Oh(Ke,Ot)&&(this.g.D(Ot,B),T?B.y==b:B.x==b)&&(ei=Ot),Ot=this.g.Na(Ke);var Jt=-1;if(0>this.Oh(Ke,Ot)&&(this.g.D(Ot,B),T?B.y==b:B.x==b)&&(Jt=Ot),ei!=-1&&Jt!=-1){this.Mh(Ke,_,C),this.g.qd(Ke,!1),this.Mh(ei,_,C),this.g.qd(ei,!1),oe=!0;break}if(rt!=-1&&Jt!=-1){this.At(_,qe,rt,Ke,Jt,C),oe=!0;break}if(Dt!=-1&&ei!=-1){this.At(_,Ke,ei,qe,Dt,C),oe=!0;break}}}if(oe)break}}}if(!oe)break}ue=D,q.N(m)}}this.g.Ud(C)},W.prototype.Mh=function(T,b,m){m=this.g.Qa(T,m),b.set(m,-1),m=this.g.Qa(T,this.li),this.ed.set(m,-1),(b=this.g.cd(T))!=-1&&this.g.Ya(b)==T&&(this.g.Kf(b,-1),this.g.Yg(b,-1))},W.prototype.At=function(T,b,m,_,C,D){this.g.Cc(b,_),this.g.Dc(_,b),this.g.Dc(m,C),this.g.Cc(C,m),this.Mh(_,T,D),this.g.oi(_,!1),this.Mh(C,T,D),this.g.oi(C,!0)},W.prototype.Oy=function(){for(var T=0,b=this.ed.size;T=B?(m=this.g.Qa(F,this.li),this.ed.set(m,-1),F=this.g.qd(F,!1),B==2&&(m=this.g.Qa(F,this.li),this.ed.set(m,-1),this.g.qd(F,!1)),B=D,D=this.g.Sb(D),this.g.Kf(B,-1),this.g.br(B)):(this.g.fp(D,!1),this.g.Yg(D,this.g.Na(F)),this.g.Xj(D,B),C+=B,_++,D=this.g.Sb(D))}}for(T=0,b=this.ed.size;T=B?(m=this.g.Qa(F,this.li),this.ed.set(m,-1),F=this.g.qd(F,!1),B==2&&(0<=(m=this.g.Qa(F,this.li))&&this.ed.set(m,-1),this.g.qd(F,!1)),B=D,this.g.Kf(B,-1),this.g.br(B)):(this.g.mn(D,!0),this.g.Xj(D,B),this.g.Kf(D,F),this.g.Yg(D,this.g.Na(F)),this.g.fp(D,!1),C+=B,_++)}for(this.g.Tl(this.Y,_),this.g.Vj(this.Y,C),T=0,b=this.g.md;b!=-1;b=this.g.ve(b))T+=this.g.I(b);this.g.XB(T)},W.wy=function(T,b,m){return new W(b).vy(T,m)},W.clip=function(T,b,m,_){if(T.B())return T;if(b.B())return T.Ja();if((m=T.K())==33)return _=T.D(),b.contains(_)?T:T.Ja();if(m==197)return _=new A.l,T.A(_),_.Fa(b)?(b=new A.Hh,T.copyTo(b),b.Zo(_),b):T.Ja();var C=new A.l;if(T.yc(C),b.contains(C))return T;if(!b.isIntersecting(C))return T.Ja();if((C=T.Cb)!=null&&(C=C.Hk)!=null){if((C=C.To(b))==1){if(m!=1736)throw A.i.Ra();return(T=new A.Ea(T.description)).vp(b),T}if(C==0)return T.Ja()}switch(m){case 550:m=null,C=T.I();for(var D=T.vb(0),F=0,B=0;B=m?1:-1;case 1:if(T.G=m?1:-1;case 2:if(T.v>=m&&T.C>m)break;return T.C<=m?1:-1;case 3:if(!(T.G>=m&&T.H>m))return T.H<=m?1:-1}return 0},W.prototype.vy=function(T,b){return T.K()==1736?this.xy(T,b):this.yy(T)},W.prototype.xy=function(T,b){if(this.Da.S()==0||this.Da.da()==0)return T.Ja();var m=new A.l;T.yc(m),this.Y=this.g.Ib(T);var _=new A.l,C=new A.l,D=new A.h,F=new A.h,B=[0,0,0,0,0,0,0,0,0],q=[0,0,0,0,0,0,0,0,0],Z=new A.zb,oe=new A.ja(0);oe.Jb(256);for(var ue=!1,be=0;!ue&&4>be;be++){var De=!1,qe=(1&be)!=0,rt=0;switch(be){case 0:rt=this.Da.v,De=m.v<=rt&&m.C>=rt;break;case 1:rt=this.Da.G,De=m.G<=rt&&m.H>=rt;break;case 2:rt=this.Da.C,De=m.v<=rt&&m.C>=rt;break;case 3:rt=this.Da.H,De=m.G<=rt&&m.H>=rt}if(De)for(ue=!0,De=this.g.Ob(this.Y);De!=-1;){var Dt=!0,Vt=-1,Ke=-1,Ot=this.g.Ya(De),ei=Ot;do{var Jt=this.g.cc(ei);Jt==null&&(Jt=Z,this.g.D(ei,D),Jt.Ec(D),this.g.D(this.g.V(ei),F),Jt.Rc(F)),Jt.A(_);var Xt=this.Nh(_,be,rt),ti=0,bi=-1;if(Xt==-1){ti=0<(Jt=Jt.fq(qe,rt,B,q))?this.g.HX(ei,q,Jt):0,ti+=1;var Fi=ei,Ri=this.g.V(Fi);for(Jt=0;Jtbe;be++){var De=!1,qe=(1&be)!=0,rt=0;switch(be){case 0:rt=this.Da.v,De=B.v<=rt&&B.C>=rt;break;case 1:rt=this.Da.G,De=B.G<=rt&&B.H>=rt;break;case 2:rt=this.Da.C,De=B.v<=rt&&B.C>=rt;break;case 3:rt=this.Da.H,De=B.G<=rt&&B.H>=rt}if(De)for(De=F,F=T.Ja(),(De=De.Ha()).aj();De.ab();)for(var Dt,Vt=!0;De.Ia();){var Ke=De.ia();Ke.A(b);var Ot=this.Nh(b,be,rt);if(Ot==-1){if(0<(Ot=Ke.fq(qe,rt,_,C))){var ei=0;Ke.$p(q);for(var Jt=0;Jt<=Ot;Jt++)if(ei!=(Dt=Jt_.x&&(_.x+=T)}else ue=b.y-this.Da.G,C.y=A.mc.sign(m.y-b.y),_.y=T*A.mc.En(Math.floor(Math.abs(ue/T)),ue)+this.Da.G,0>_.y&&(_.y+=T);ue=oe!=0?m.y-b.y:m.x-b.x;var be=Math.abs(ue);if(65536=qe||(D[be]=qe,be++)}be!=0&&this.g.Wl(q,D,be)}}q=Z}while(q!=B)}},W.prototype.Xl=function(T,b){for(var m=-1,_=new A.h,C=null,D=this.g.Ob(this.Y);D!=-1;D=this.g.Sb(D))for(var F=this.g.Ya(D),B=0,q=this.g.Ka(D);BC.size)){var oe=this;C.Wd(0,C.size,function(Jt,Xt){return oe.Oh(Jt,Xt)}),m=new A.h,D=new A.h,F=new A.h,D.Sc();var ue=-1;B=new A.ja(0),q=new A.ja(0),Z=null;for(var be=this.g.Hd(),De=this.g.Hd(),qe=0,rt=C.size;qeD.compare(m)&&(T?m.y==b:m.x==b)&&(B.add(ue),Ot=!0,this.g.Sa(ue,De,1)),this.g.D(Dt,m),0>D.compare(m)&&(T?m.y==b:m.x==b)&&(Ot||B.add(ue),this.g.Sa(ue,be,1))}for(Vt=0,Ot=B.size;Vtq.compare(B)&&(T?B.y==b:B.x==b)&&(rt=Dt),Dt=-1;var Vt=this.g.Na(qe);if(this.g.D(Vt,B),0>q.compare(B)&&(T?B.y==b:B.x==b)&&(Dt=Vt),rt!=-1&&Dt!=-1)this.Mh(qe,_,C),this.g.qd(qe,!1),this.Mh(rt,_,C),this.g.qd(rt,!1),oe=!0;else if(rt!=-1||Dt!=-1){for(Vt=De+1;Vtq.compare(B)&&(T?B.y==b:B.x==b)&&(ei=Ot),Ot=this.g.Na(Ke);var Jt=-1;if(this.g.D(Ot,B),0>q.compare(B)&&(T?B.y==b:B.x==b)&&(Jt=Ot),ei!=-1&&Jt!=-1){this.Mh(Ke,_,C),this.g.qd(Ke,!1),this.Mh(ei,_,C),this.g.qd(ei,!1),oe=!0;break}if(rt!=-1&&Jt!=-1){this.At(_,qe,rt,Ke,Jt,C),oe=!0;break}if(Dt!=-1&&ei!=-1){this.At(_,Ke,ei,qe,Dt,C),oe=!0;break}}}if(oe)break}}}if(!oe)break}ue=D,q.N(m)}this.g.Ud(C)}},W.prototype.Mh=function(T,b,m){m=this.g.Qa(T,m),b.set(m,-1),m=this.g.Qa(T,this.li),this.ed.set(m,-1),(b=this.g.cd(T))!=-1&&this.g.Ya(b)==T&&(this.g.Kf(b,-1),this.g.Yg(b,-1))},W.prototype.At=function(T,b,m,_,C,D){this.g.Cc(b,_),this.g.Dc(_,b),this.g.Dc(m,C),this.g.Cc(C,m),this.Mh(_,T,D),this.g.oi(_,!1),this.Mh(C,T,D),this.g.oi(C,!0)},W.prototype.Oy=function(){for(var T=0,b=this.ed.size;T=B?(m=this.g.Qa(F,this.li),this.ed.set(m,-1),F=this.g.qd(F,!1),B==2&&(0<=(m=this.g.Qa(F,this.li))&&this.ed.set(m,-1),this.g.qd(F,!1)),B=D,this.g.Kf(B,-1),this.g.br(B)):(this.g.mn(D,!0),this.g.Xj(D,B),this.g.Kf(D,F),this.g.Yg(D,this.g.Na(F)),this.g.fp(D,!1),C+=B,_++)}for(this.g.Tl(this.Y,_),this.g.Vj(this.Y,C),T=0,b=this.g.md;b!=-1;b=this.g.ve(b))T+=this.g.I(b);this.g.XB(T)},W.wy=function(T,b,m,_){return new W(b,_).vy(T,m)},W.clip=function(T,b,m,_,C){return W.Pu(T,b,null,m,_,C)},W.Pu=function(T,b,m,_,C,D){var F=T.K();if(F==33)return C=T.D(),b.contains(C)?T:T.Ja();if(F==197)return C=new A.l,T.A(C),C.Fa(b)?(b=new A.Hh,T.copyTo(b),b.Zo(C),b):T.Ja();if(T.B())return T;if(b.B())return T.Ja();var B=new A.l;if(T.yc(B),b.contains(B))return T;if(!b.isIntersecting(B))return T.Ja();if((m!=null||isNaN(_))&&A.ua.oy(m,b,!1),!A.ba.zj(F))throw A.i.O();if((m=T.Cb)!=null&&(m=m.Hk)!=null){if((m=m.To(b))==1){if(F!=1736)throw A.i.ga("internal error");return(T=new A.Ea(T.description)).vp(b),T}if(m==0)return T.Ja()}switch(F){case 550:for(D=null,F=T.I(),m=T.vb(0),_=0,C=new A.h,B=0;B=B;B+=1)for(var q=0;1>=q;q+=1){var Z=b.eG(D+B,F+q),oe=this.zl.lR(Z);oe!=-1&&(this.rq[C]=oe,this.zs[C]=Z,C++)}for(D=C-1;1<=D;D--)for(oe=this.rq[D],F=D-1;0<=F;F--)if(oe==this.rq[F]){this.zs[F]=-1,D!=--C&&(this.zs[D]=this.zs[C],this.rq[D]=this.rq[C]);break}for(F=0;FF.Eb())throw A.i.O();return B==0||F.B()?F:((ue=new D(ue)).mo=F,ue.La=B,ue.ra=oe,ue.Mi=q,ue.xA=Z,ue.Qx())},D.prototype.$L=function(){var F=this.mo,B=F.bc(),q=F.xc(),Z=new A.h;return Z.vc(q,B),Z.normalize(),Z.Jv(),Z.scale(this.La),B.add(Z),q.add(Z),Z=F.Ja(),F.Ec(B),F.Rc(q),Z},D.prototype.ZL=function(){var F=this.mo;if(0ue&&(0this.La?-W:W,-1qe&&(.017453292519943295>(rt=2*Math.acos(qe))&&(rt=.017453292519943295),1<(be=A.P.truncate(W/rt+1.5))&&(De/=be)),rt=Ke+b,Ke=m.Qd(ue,this.La,rt),F==0&&(Ke.type|=1024),this.hc(Ke,F),qe=this.La/Math.cos(De/2),rt+=De/2,(Ke=m.Qd(ue,qe,rt)).type|=1024,this.hc(Ke);0<--be;)rt+=De,(Ke=m.Qd(ue,qe,rt)).type|=1024,this.hc(Ke);(Ke=m.Qd(ue,this.La,Ot-b)).type|=1024,this.hc(Ke)}else if(this.Mi==1)Ke=m.Qd(ue,this.La,Ke+b),this.hc(Ke,F),Ke=m.Qd(ue,this.La,Ot-b),this.hc(Ke);else if(this.Mi==0)for(qe=1-q/Math.abs(this.La),be=1,De=Ot-b-(Ke+b),-1qe&&(.017453292519943295>(rt=2*Math.acos(qe))&&(rt=.017453292519943295),1<(be=A.P.truncate(Math.abs(De)/rt+1.5))&&(De/=be)),qe=this.La/Math.cos(.5*De),rt=Ke+b+.5*De,Ke=m.Qd(ue,qe,rt),this.hc(Ke,F);0<--be;)rt+=De,Ke=m.Qd(ue,qe,rt),this.hc(Ke);else this.Mi==2?(qe=be.x-ue.x,rt=be.y-ue.y,.99999999<(be=(qe*(Dt=De.x-ue.x)+rt*(Vt=De.y-ue.y))/Math.sqrt(qe*qe+rt*rt)/Math.sqrt(Dt*Dt+Vt*Vt))?(Ke=m.Qd(ue,1.4142135623730951*this.La,Ot-.25*W),this.hc(Ke,F),Ke=m.Qd(ue,1.4142135623730951*this.La,Ot+.25*W),this.hc(Ke)):(be=Math.abs(this.La/Math.sin(.5*Math.acos(be))))>(De=Math.abs(this.xA*this.La))?(qe=.5*(Ot-Ke),qe=this.La/Math.abs(Math.sin(qe)),Ke=m.Qd(ue,qe,.5*(Ke+Ot)),Ot=A.h.construct(Ke.x,Ke.y),Ke=A.h.construct(ue.x,ue.y),(ue=new A.h).vc(Ot,Ke),(Ot=new A.h).BW(De/ue.length(),ue,Ke),Ke=(be-De)*Math.abs(this.La)/Math.sqrt(be*be-this.La*this.La),0Ke&&(Ot-=T),be=Ke-Ot(qe=1.4142135623730951*this.La)?Ke+.25*W:Ke+.75*W,Ke=m.Qd(ue,qe,rt),this.hc(Ke,F),rt=0>qe?Ot-.25*W:Ot-.75*W,Ke=m.Qd(ue,qe,rt),this.hc(Ke)):(qe=.5*(Ot-Ke),qe=this.La/Math.abs(Math.sin(qe)),OtB))for(var q=0;q=Z+1;B--)(q=m.cl(F.Oa(B))).type|=1024,this.xg.push(q);if(this.hE())if(2<=this.Zb.length){for(F=-1,(oe=(1024&this.Zb[this.gf-1].type)!=0)||(F=0),B=1;B=Math.min(q.x,Z.x)&&Math.max(q.x,Z.x)>=Math.min(F.x,B.x)&&Math.max(F.y,B.y)>=Math.min(q.y,Z.y)&&Math.max(q.y,Z.y)>=Math.min(F.y,B.y)},D.prototype.sQ=function(F,B,q,Z,oe){oe.XD=!1;var ue=(B.y-F.y)*(Z.x-q.x)-(B.x-F.x)*(Z.y-q.y),be=(q.y-F.y)*(B.x-F.x)-(q.x-F.x)*(B.y-F.y);if(0<=(ue=ue==0?2:be/ue)&&1>=ue){var De=ue;if(ue=(Z.y-q.y)*(B.x-F.x)-(Z.x-q.x)*(B.y-F.y),be=(F.y-q.y)*(Z.x-q.x)-(F.x-q.x)*(Z.y-q.y),0<=(ue=ue==0?2:be/ue)&&1>=ue)return oe.cn=m.OO(F.x+ue*(B.x-F.x),F.y+ue*(B.y-F.y)),oe.cn.Wh=q.Wh+De*(Z.Wh-q.Wh),De!=0&&De!=1||ue!=0&&ue!=1||(oe.XD=!0),oe.RY=ue,oe.SY=De,!((De==0||De==1)&&0ue||(ue==0||ue==1)&&0De)}return!1},D.prototype.LO=function(F){for(;this.Zb[F].uhF-(D*=2))return!0;C=new A.h;var B=new A.h,q=new A.h;_.uc(D,C),_.uc(D+2,B),_.uc(D+4,q);var Z=m.Yu(B,q,C);if(Z.rs()||!m.wm(Z.value()))return!1;var oe=A.h.construct(B.x,B.y),ue=new A.h;for(D+=6;DF;F++){_.hB(F,D);var B=this.Er(D);if(B!=-1){_.If(F,C);var q=this.g.hc(this.Us,C);this.Ga.Uj(B,q)}}},m.prototype.jN=function(_){var C=new A.Ta,D=_.bc();if((D=this.Er(D))!=-1){_.Vo(C);var F=this.g.hc(this.Us,C);this.Ga.Uj(D,F)}D=_.xc(),(D=this.Er(D))!=-1&&(_.Ro(C),_=this.g.hc(this.Us,C),this.Ga.Uj(D,_))},m.prototype.iN=function(_){var C=_.D();(C=this.Er(C))!=-1&&(_=this.g.hc(this.Us,_),this.Ga.Uj(C,_))},m.prototype.Er=function(_){var C=-1;if(this.Ga.size(-1)==0)return this.Ga.addElement(-4,-1);if(this.Ga.size(-1)==1){var D=this.g.Oa(this.Ga.ka(this.Ga.sc(-1)));return _.Mz(D)||(C=this.Ga.zn(-5)),C}return this.kC(_)},m.prototype.kC=function(_){var C=-1;do{var D=this.Ga.sc(-1),F=this.Ga.Gc(-1),B=this.Ga.ka(D),q=this.Ga.ka(F),Z=new A.h,oe=new A.h;if(this.Zh.D(B,Z),this.Zh.D(q,oe),B=A.h.Wq(oe,_,Z),m.wm(B))C=this.Ga.zn(-1),(Z=this.iC(_,F,D))!=D&&this.jC(_,D,this.Ga.xe(Z));else if(m.xG(B)){oe=this.Ga.uv(-1);var ue=this.Ga.sc(-1),be=this.Ga.Gc(-1);for(B=new A.h,q=new A.h;ue!=this.Ga.xe(be);){var De=this.Ga.ka(oe);this.Zh.D(De,B),De=A.h.Wq(B,_,Z),m.xG(De)?(be=oe,oe=this.Ga.nl(oe)):(ue=oe,oe=this.Ga.Zp(oe))}if(oe=be,Z=ue,De=this.Ga.ka(oe),ue=this.Ga.ka(Z),this.Zh.D(De,B),this.Zh.D(ue,q),Z!=D&&(B=A.h.Wq(q,_,B),!m.wm(B)))continue;C=this.Ga.Bu(Z,oe,-2,!1),this.jC(_,oe,F),this.iC(_,Z,D)}else this.tb==null&&(this.tb=new A.zb),this.tb.Ec(oe),this.tb.Rc(Z),0>(Z=this.tb.ge(_,!0))?(Z=this.Ga.xe(F),this.Ga.wd(F,-1),C=this.Ga.zn(-3),this.iC(_,Z,D)):1_},m.xG=function(_){return 0<_},m}();A.au=b}(le||(le={})),function(A){var ve=function(){function W(T){this.g=null,this.oH=!0,this.od=T}return W.uU=function(T,b,m){return T=A.ua.Gr(T),A.$t.Ev(b.Ng(),b.kh(),m.Ng(),m.kh(),A.mc.ox(T))},W.xO=function(T,b){var m=new A.Ta;return A.$t.RT(T,b,m),m},W.W=function(T,b,m,_){return(m=new W(m)).g=T,m.ra=b,m.oH=_,m.zM()},W.prototype.iM=function(T){return A.$t.dQ(this.g,T)},W.prototype.nM=function(T){return A.bu.W(this.g,T,this.od)},W.prototype.zM=function(){var T=this.ra,b=A.ua.Gr(T),m=1.00001*(T=A.ua.mN(T));T*=1.000001;for(var _=!1,C=30C)throw A.i.ga("Internal Error: max number of iterations exceeded");var B=this.iM(b);if(_=_||B,this.oH&&(B=this.g.Ip(b,!0,!1)!=0,_=_||B),B=!1,(D==0||F||A.bu.fI(!0,this.g,T,null,this.od))&&(B=this.nM(m),_=_||B),!B)break;A.op.Bp(this.od)}return _},W}();A.Vk=ve}(le||(le={})),function(A){var ve=function(){function T(b){this.ae=this.Nc=null,this.$s=0,this.Vb=b,this.Yz=!0}return T.prototype.wv=function(b,m){var _=this.g.cc(b);if(_==null){if(!this.g.fd(b,m))return null;_=m}return _},T.prototype.Zq=function(){var b;b===void 0&&(b=!1),this.$s++,(b||!(4095&this.$s))&&(this.$s=0,A.op.Bp(this.Vb))},T.prototype.iP=function(){var b=this.g.$q(!1),m=!1,_=new A.zb,C=new A.zb,D=new A.l;D.Pa();var F=new A.l;F.Pa();for(var B=new A.Ta,q=new A.OC,Z=b.next();Z!=-1;Z=b.next()){A.op.Bp(this.Vb);var oe=null,ue=!1;if(!A.ba.Tn(this.g.jc(b.ek))){if((oe=this.wv(Z,_))==null)continue;if(oe.A(D),D.X(this.ra,this.ra),oe.Di(this.ra)){if(!oe.Di(0))continue;ue=!0,oe=null}}var be=this.g.$q(b),De=be.next();for(De!=-1&&(De=be.next());De!=-1;De=be.next()){var qe=null,rt=!1;if(!A.ba.Tn(this.g.jc(be.ek))){if((qe=this.wv(De,C))==null)continue;if(qe.A(F),qe.Di(this.ra)){if(!qe.Di(0))continue;rt=!0,qe=null}}var Dt=0,Vt=0;if(oe!=null&&qe!=null)D.CG(F)&&(q.Qo(oe),q.Qo(qe),q.Fa(this.ra,!1),0<(Dt=q.ql(0))+(Vt=q.ql(1))&&(this.g.lr(Z,q,0,!0),this.g.lr(De,q,1,!0)),q.clear());else if(oe!=null){var Ke=new A.h;if(this.g.D(De,Ke),D.contains(Ke)){if(q.Qo(oe),this.g.Xi(De,B),q.Fz(this.ra,B,!1),0<(Dt=q.ql(0)))if(this.g.lr(Z,q,0,!0),rt){for(rt=-1,Ke=this.g.V(De);Ke!=-1&&Ke!=De&&(rt=Ke,(qe=this.wv(Ke,C))!=null&&qe.Di(0));Ke=this.g.V(Ke));for(Ke=De;Ke!=-1&&(this.g.Fh(Ke,q.Cf),Ke!=rt);Ke=this.g.V(Ke));}else this.g.Fh(De,q.Cf);q.clear()}}else{if(qe==null)continue;if(Ke=new A.h,this.g.D(Z,Ke),F.X(this.ra,this.ra),F.contains(Ke)){if(q.Qo(qe),this.g.Xi(Z,B),q.Fz(this.ra,B,!1),0<(Vt=q.ql(0)))if(this.g.lr(De,q,0,!0),ue){for(rt=-1,Ke=this.g.V(Z);Ke!=-1&&Ke!=Z&&(rt=Ke,(qe=this.wv(Ke,C))!=null&&qe.Di(0));Ke=this.g.V(Ke));for(Ke=Z;Ke!=-1&&(this.g.Fh(Ke,q.Cf),Ke!=rt);Ke=this.g.V(Ke));}else this.g.Fh(Z,q.Cf);q.clear()}}if(Dt+Vt!=0){if(Dt!=0){if((oe=this.g.cc(Z))==null){if(!this.g.fd(Z,_))continue;oe=_,_.A(D)}else oe.A(D);if(oe.Di(this.ra))break}m=!0}}}return m},T.prototype.jP=function(){return this.LU()},T.prototype.LU=function(){return new A.MC().LX(this.g,this.ra)},T.prototype.gI=function(){var b=!1;this.Nc==null&&(this.Nc=new A.$j);var m=new A.ja(0);m.Jb(this.g.gd+1);for(var _=this.g.$q(),C=_.next();C!=-1;C=_.next())m.add(C);this.g.nx(m,m.size),m.add(-1),_=this.g.Hd(),C=this.g.Hd(),this.ae=new A.PC(this.g,this.ra,!this.Yz),this.Nc.Xo(this.ae);var D=new A.ja(0),F=new A.ja(0),B=0;new A.h;var q=this.g.ud;this.g.wb.oc();for(var Z,oe,ue=this.g.wb.Aa[0].o,be=m.get(B++);be!=-1;){var De=Z=ue[2*(oe=q.U(be,0))],qe=oe=ue[2*oe+1];do{var rt=q.U(be,2),Dt=q.U(be,1);if(rt!=-1){var Vt=q.U(rt,0),Ke=ue[2*Vt];0>(qe<(Vt=ue[2*Vt+1])?-1:qe>Vt?1:DeKe?1:0)&&(F.add(be),F.add(rt))}Dt!=-1&&(Ke=ue[2*(Vt=q.U(Dt,0))],0>(qe<(Vt=ue[2*Vt+1])?-1:qe>Vt?1:DeKe?1:0)&&(F.add(Dt),F.add(Dt))),(Ke=this.g.Qa(be,_))!=-1&&(D.add(Ke),this.g.Sa(be,_,-1)),(Ke=this.g.Qa(be,C))!=-1&&(D.add(Ke),this.g.Sa(be,C,-1)),(be=m.get(B++))!==-1&&(De=ue[2*(qe=q.U(be,0))],qe=ue[2*qe+1])}while(be!=-1&&De===Z&&qe===oe);for(De=D.size==1&&F.size==2,Ke=qe=-1,rt=0,Dt=D.size;rtb.gd?b=m.iP():m.jP())},T.W=function(b,m,_){return T.aQ(b,b.DF(),m,_)},T.fI=function(b,m,_,C,D){if(!T.tE(m))return!1;var F=new T(D);if(F.g=m,F.ra=_,F.Yz=b,F.gI())return C?.Yt(F.Pi),!0;var B=new A.Ed;return B.VB(),m.Pc(B),(F=new T(D)).g=m,F.ra=_,F.Yz=b,b=F.gI(),B.VB(),m.Pc(B),!!b&&(C?.Yt(F.Pi),!0)},T.Ol=function(b,m){return!(16>(b=b.I()))&&2*b+Math.log(b)*Math.LOG10E/Math.log(2)*m<1*b*m},T.gP=function(b,m,_,C){if(A.ba.Ic(m.K()))return new T(C).hP(b,m,_);throw A.i.ga("crack_A_with_B")},T.prototype.hP=function(b,m,_){var C=new A.l;b.yc(C);var D=new A.l;if(m.yc(D),D.X(_,_),!D.isIntersecting(C))return b;var F=b.Cb,B=null;F!=null&&(B=F.Gb),T.Ol(b,b.I())&&(B=A.ua.lj(b,D));var q=B!=null?B.getIterator():null,Z=m.Ha();m=b.Ha();var oe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(D=[];Z.ab();)for(;Z.Ia();){var ue=Z.ia();if(B!=null){for(q.Wo(ue,_),F=q.next();F!=-1;F=q.next())if(this.Zq(),m.Wb(B.ka(F),-1),m.Ia()){var be=(F=m.ia()).Fa(ue,null,oe,null,_);for(F=0;Fm.t?1:b.tm.index?1:-1},T}()}(le||(le={})),function(A){var ve;(ve=A.FK||(A.FK={}))[ve.Left=0]="Left",ve[ve.Right=1]="Right",ve[ve.Coincident=2]="Coincident",ve[ve.Undefined=3]="Undefined",ve[ve.Uncut=4]="Uncut";var W=function(m,_,C,D,F,B,q,Z,oe,ue,be){this.Y=m,this.ct=_,this.Ps=C,this.ug=D,this.Nm=ue,this.Cl=be};A.qY=W;var T=function(){function m(_,C){this.EH=_,this.Ji=C}return m.prototype.lM=function(_,C){var D=new A.h;this.Ji.D(_,D);var F=new A.h;return this.Ji.D(C,F),(D=D.compare(F))!=0?D:(_=this.Ji.Qa(_,this.EH))<(C=this.Ji.Qa(C,this.EH))?-1:_==C?0:1},m}(),b=function(m,_,C,D,F,B,q,Z,oe){this.ug=m,this.Ps=_,this.JA=C,this.PH=D,this.Gi=F,this.Cl=B,this.Nm=q,this.QH=Z,this.JT=oe};A.pY=b,A.GK=function(){function m(){}return m.EK=function(_,C,D,F,B,q){if(C.B())_=new W(C,4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),B.push(_);else if(D.B())_=new W(C,4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),B.push(_);else{var Z=new A.hd;if(Z.Ib(C),Z.Ib(D),A.Vk.W(Z,F,q,!0),Z.gd==0)_=new W(C.Ja(),4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),B.push(_);else{for(C=0,D=Z.Hd(),F=Z.md;F!=-1;F=Z.ve(F))for(q=Z.Ob(F);q!=-1;q=Z.Sb(q))for(var oe=Z.Ya(q),ue=0,be=Z.Ka(q);ue(qe=qe.Fa(oe,null,be,De,0))&&(F=new b(B,F,be[0],NaN,qe,Z,q,De[0],NaN),D.push(F),0>(F=C.Qa(B,_))&&C.Sa(B,_,D.length-1)),!0},m.rM=function(_,C,D,F,B,q,Z){var oe=new A.zb,ue=new A.zb,be=[0,0],De=[0,0],qe=C.cc(B);return qe==null&&(C.fd(B,oe),qe=oe),(oe=C.cc(Z))==null&&(C.fd(Z,ue),oe=ue),2>(qe=qe.Fa(oe,null,be,De,0))&&(F=new b(B,F,be[0],NaN,qe,Z,q,De[0],NaN),D.push(F),0>(F=C.Qa(B,_))&&C.Sa(B,_,D.length-1),!0)},m.sM=function(_,C,D,F,B,q,Z,oe){var ue=new A.zb,be=new A.zb,De=[0,0],qe=[0,0],rt=C.cc(B);return rt==null&&(C.fd(B,ue),rt=ue),(ue=C.cc(Z))==null&&(C.fd(Z,be),ue=be),(rt=rt.Fa(ue,null,De,qe,0))==2?(F=new b(B,F,De[0],De[1],rt,Z,q,qe[0],qe[1]),D.push(F),0>(F=C.Qa(B,_))&&C.Sa(B,_,D.length-1),!0):(be=!1,B==oe&&(F=new b(B,F,De[0],NaN,rt,Z,q,qe[0],NaN),D.push(F),0>(F=C.Qa(B,_))&&C.Sa(B,_,D.length-1),be=!0),be)},m.tM=function(_,C,D,F,B,q,Z,oe){var ue=new A.zb,be=new A.zb,De=[0,0],qe=[0,0],rt=C.cc(B);return rt==null&&(C.fd(B,ue),rt=ue),(ue=C.cc(Z))==null&&(C.fd(Z,be),ue=be),(rt=rt.Fa(ue,null,De,qe,0))==2?(F=new b(B,F,De[0],De[1],rt,Z,q,qe[0],qe[1]),D.push(F),0>(F=C.Qa(B,_))&&C.Sa(B,_,D.length-1),!0):(be=!1,B==oe&&(F=new b(B,F,De[0],NaN,rt,Z,q,qe[0],NaN),D.push(F),0>(F=C.Qa(B,_))&&C.Sa(B,_,D.length-1),be=!0),be)},m.YL=function(_,C,D,F){var B=[];B[0]=new A.h,B[1]=new A.h,B[2]=new A.h,B[3]=new A.h;var q=new A.h,Z=new A.h,oe=new A.h,ue=new A.h,be=null;F!=null&&(be=new A.jg).Qr();var De=0,qe=null,rt=new A.zb;new A.zb;for(var Dt=D.Ob(D.md);Dt!=-1;Dt=D.Sb(Dt)){for(var Vt=4,Ke=-1,Ot=-1,ei=-1,Jt=-1,Xt=NaN,ti=!0,bi=!1,Fi=!0,Ri=!0,er=!0,ar=0,mi=Dt,dn=0,Lr=D.Ya(Dt),xo=D.Ka(Dt),kr=0;kr=C.length-2||C[De+2].Ps!=Ke)&&(Vt=0):Vt=1):((Kn!=Hn||li&&Hn==0)&&(F!=null?(In=new W(qe,3,Ke,En,Kn,Vt,mi,Ot,dn,$i,Ur),F.push(In)):null.add(ar)),Vt=1):Vt!=0?((Kn!=Hn||li&&Hn==0)&&(F!=null?(In=new W(qe,0,Ke,En,Kn,Vt,mi,Ot,dn,$i,Ur),F.push(In)):null.add(ar)),Xi?(De>=C.length-2||C[De+2].Ps!=Ke)&&(Vt=1):Vt=0):((Kn!=Hn||li&&Hn==0)&&(F!=null?(In=new W(qe,3,Ke,En,Kn,Vt,mi,Ot,dn,$i,Ur),F.push(In)):null.add(ar)),Vt=0),(Kn!=Hn||li&&Hn==0)&&(Hn=Kn,mi=Ke,Ot=En,dn=Kn,ei=$i,Jt=Ur,Xt=Qo,ti=Fi=!1,Ri=er=!0))}}De++}Hn!=1&&(er&&(F!=null?qe=new A.Ua:ar=0),F!=null?(is.dh(Hn,1,be),qe.pc(be.get(),Ri)):ar++,Ri=er=!1,Fi=!0)}Fi&&(Kn=1,En=D.tj(Dt),En=D.Na(En),Ur=$i=-1,Qo=NaN,ti?F!=null?(In=new W(qe,4,Ke,En,Kn,Vt,mi,Ot,dn,$i,Ur),F.push(In)):null.add(ar):(ti=Vt==1?0:Vt==0?1:3,F!=null?(In=new W(qe,ti,Ke,En,Kn,Vt,mi,Ot,dn,$i,Ur),F.push(In)):null.add(ar)))}},m.xM=function(_,C,D,F,B,q){var Z=D[F].QH;if(Z==1)return m.vM(_,C,D,F,B,q);if(Z==0)return m.wM(_,C,D,F,B,q);throw A.i.Ra()},m.vM=function(_,C,D,F,B,q){var Z=new A.zb,oe=D[F].ug,ue=D[F].Nm,be=D[F].Cl,De=-1,qe=-1,rt=-1,Dt=-1;if(!_&&0.01*b&&(_*=1+(1+(T=T.yb/b))*T),this.pb=m,this.yb=_+2220446049250313e-31*Math.abs(m)},W.prototype.sqrt=function(){if(0<=this.pb){var T=Math.sqrt(this.pb),b=this.pb>10*this.yb?.5*this.yb/T:this.pb>this.yb?T-Math.sqrt(this.pb-this.yb):Math.max(T,Math.sqrt(this.pb+this.yb)-T);b+=2220446049250313e-31*Math.abs(T)}else this.pb<-1*this.yb?b=T=NaN:(T=0,b=Math.sqrt(this.yb));this.pb=T,this.yb=b},W.prototype.sin=function(T){var b=Math.sin(T.pb),m=Math.cos(T.pb);this.pb=b,b=Math.abs(b),this.yb=(Math.abs(m)+.5*b*T.yb)*T.yb+2220446049250313e-31*b},W.prototype.cos=function(T){var b=Math.sin(T.pb),m=Math.cos(T.pb);this.pb=m,m=Math.abs(m),this.yb=(Math.abs(b)+.5*m*T.yb)*T.yb+2220446049250313e-31*m},W.prototype.rg=function(){return Math.abs(this.pb)<=this.yb},W.prototype.rs=function(){return this.rg()&&this.yb!=0},W}();A.Xb=ve}(le||(le={}));var ce=new le.h,Ce=new le.h,Ze=new le.h,yt=new le.h,Ve=new le.h;(function(A){var ve,W;(W=ve||(ve={}))[W.closedPath=1]="closedPath",W[W.exteriorPath=2]="exteriorPath",W[W.ringAreaValid=4]="ringAreaValid";var T=function(){function b(m,_,C,D,F,B,q){_!==void 0?(this.ib=m,this.ek=_,this.dl=C,this.ki=D,this.za=B,this.cA=q,this.gw=F):(this.ib=m.ib,this.ek=m.ek,this.dl=m.dl,this.ki=m.ki,this.za=m.za,this.cA=m.cA,this.gw=m.gw),this.XG=!0}return b.prototype.next=function(){return this.XG?(this.XG=!1,this.ki):this.ki!=-1?(this.ki=this.ib.V(this.ki),this.za++,this.ki!=-1&&this.ki!=this.gw?this.ki:this.VT()):-1},b.prototype.VT=function(){for(this.dl=this.ib.Sb(this.dl),this.za=0;this.ek!=-1;){for(;this.dl!=-1;this.dl=this.ib.Sb(this.dl))if(this.gw=this.ki=this.ib.Ya(this.dl),this.ki!=-1)return this.ki;if(this.ek=this.ib.ve(this.ek),this.ek==-1)break;this.cA&&!A.ba.Ic(this.ib.jc(this.ek))||(this.dl=this.ib.Ob(this.ek))}return-1},b.vP=function(m,_,C,D,F,B,q){return new b(m,_,C,D,F,B,q)},b}();A.vY=T,ve=function(){function b(){this.lo=this.Cm=this.yk=this.dd=this.Ek=this.xo=this.Qi=this.nd=this.di=this.Ug=this.Te=this.Kl=null,this.sw=this.md=-1,this.gd=0,this.aA=!1,this.it=this.jt=this.wb=null}return b.prototype.Uh=function(m){return this.Te!=null?this.Te[m]:null},b.prototype.Zg=function(m,_){if(this.Te==null){if(_==null)return;this.Te=[];for(var C=0,D=this.wb.I();C=this.Qi.size&&(m=16>_?16:A.P.truncate(3*_/2),this.Qi.resize(m),this.xo.resize(m)),this.Qi.set(_,0),this.xo.set(_,0),_},b.prototype.nF=function(m){this.nd.kd(m)},b.prototype.Qy=function(m){this.ud.kd(m),this.gd--},b.prototype.jI=function(m){this.nd==null&&(this.nd=new A.ad(8),this.ud=new A.ad(5),this.Qi=new A.ce(0),this.xo=new A.ce(0));var _=this.ud.De(),C=0<=m?m:_;if(this.ud.T(_,0,C),0>m){if(C>=this.wb.I()){if(m=16>C?16:A.P.truncate(3*C/2),this.wb.resize(m),this.Te!=null)for(var D=0;D_.Ka(D))){var B=this.wf(m,-1);this.mn(B,_.ec(D));for(var q=_.Ca(D),Z=_.Wc(D);qm.Ka(_))return C;this.Kl.Gd(m,m.Ca(_),m.Wc(_)),this.jt=this.wb.vb(0);var D=this.wf(C,-1);this.mn(D,m.ec(_)||!0);var F=this.Te!=null&&m.Se!=null,B=m.Ca(_);for(_=m.Wc(_);B<_;B++){var q=this.yj(D,-1,null);if(F)if(q=this.Va(q),(1&m.UF(B))!=0)this.Zg(q,null);else{var Z=new A.jg;m.cc(B,Z,!0),this.Zg(q,Z.get())}}return C},b.prototype.Ke=function(m){var _=this.jc(m),C=A.UK.Kg(_,this.Kl.description),D=this.I(m);if(D==0)return C;if(A.ba.Ic(_)){_=this.ea(m);for(var F=A.Zc.Qh(_+1),B=A.Zc.Or(_+1,0),q=C.description,Z=0,oe=q.Ba;Z=_.size&&_.resize(Math.max(A.P.truncate(1.25*m),16),-1),_.write(m,C)},b.prototype.FF=function(m,_){return(m=this.EF(m))<(_=this.yk[_]).size?_.read(m):-1},b.prototype.WE=function(){this.yk==null&&(this.yk=[]);for(var m=0;moe:2>oe)?(q=this.ar(q),D=0be){var De=be;Z!=null&&(De=0De){var qe=De;if(Z!=null&&(qe=0D||F>this.gd-1)throw A.i.O("invalid call");if(D>F&&!this.ec(m))throw A.i.O("cannot iterate across an open path");for(m=0;_!=C;_=this.V(_))D=this.Va(_),(F=this.Uh(D))!=null?m+=F.Rb():(F=this.Va(this.V(_)),m+=this.wb.Ar(D,F));return m},b.prototype.Fh=function(m,_){var C=this.Va(m);this.wb.It(C,_),(C=this.Uh(C))!=null&&C.setStart(_),(m=this.Na(m))!=-1&&(m=this.Va(m),this.Uh(m)!=null&&C.setEnd(_))},b.prototype.Xi=function(m,_){m=this.Va(m),this.wb.we(m,_)},b.prototype.mf=function(m,_){this.Db(m,_.x,_.y)},b.prototype.Db=function(m,_,C){var D=this.Va(m);this.wb.Db(D,_,C),(D=this.Uh(D))!=null&&D.UB(_,C),(m=this.Na(m))!=-1&&(m=this.Va(m),this.Uh(m)!=null&&D.Sl(_,C))},b.prototype.D=function(m,_){this.wb.D(this.ud.U(m,0),_)},b.prototype.Hc=function(m,_){this.wb.Aa[0].uc(2*this.ud.U(m,0),_)},b.prototype.Oa=function(m){var _=new A.h;return this.wb.D(this.ud.U(m,0),_),_},b.prototype.ZF=function(m,_){this.jt.uc(2*m,_)},b.prototype.Vc=function(m,_,C){return this.wb.Vc(m,this.Va(_),C)},b.prototype.setAttribute=function(m,_,C,D){this.wb.setAttribute(m,this.Va(_),C,D)},b.prototype.Va=function(m){return this.ud.U(m,0)},b.prototype.kh=function(){var m=new A.h;return this.D(void 0,m),m.y},b.prototype.hq=function(m,_){m=this.Va(m),_=this.Va(_);var C=this.wb.Aa[0].o;return C[2*m]===C[2*_]&&C[2*m+1]===C[2*_+1]},b.prototype.Fv=function(m,_){m=this.Va(m);var C=this.wb.Aa[0].o;return C[2*m]===_.x&&C[2*m+1]===_.y},b.prototype.rX=function(m,_){if(1>_&&(_=1),this.Ug==null){if(_==1)return;this.Ug=A.Zc.Fn(this.wb.I(),1)}(m=this.Va(m))>=this.Ug.size&&this.Ug.resize(m+1,1),this.Ug.write(m,_)},b.prototype.YF=function(m){return m=this.Va(m),this.Ug==null||m>=this.Ug.size?1:this.Ug.read(m)},b.prototype.Sa=function(m,_,C){_=this.di[_],m=this.Va(m),_.sizeF?1:BZ?1:0})},b.prototype.eS=function(){for(var m=this.md;m!=-1;m=this.ve(m))if(!A.ba.Ic(this.jc(m)))return!0;return!1},b.prototype.cC=function(m,_){for(var C=this.Ob(m),D=this.Ob(_),F=this.mv(m),B=this.mv(_),q=this.Ob(m);q!=-1;q=this.Sb(q))this.gx(q,_);for(q=this.Ob(_);q!=-1;q=this.Sb(q))this.gx(q,m);this.ap(m,D),this.ap(_,C),this.bp(m,B),this.bp(_,F),C=this.I(m),D=this.ea(m),F=this.ea(_),this.Vj(m,this.I(_)),this.Vj(_,C),this.Tl(m,F),this.Tl(_,D),C=this.dd.U(m,2),this.dd.T(m,2,this.dd.U(_,2)),this.dd.T(_,2,C)},b}(),A.hd=ve})(le||(le={})),function(A){var ve=function(W){function T(b,m,_,C){var D=W.call(this)||this;return D.aa=new A.l,b===void 0?D.PE():typeof b=="number"?D.QO(b,m,_,C):b instanceof A.Ta?m!==void 0?D.Su(b,m,_):D.RO(b):b instanceof A.sa?m!==void 0?D.TO(b,m):D.SO(b):b instanceof A.l?D.PO(b):D.PE(),D}return Le(T,W),T.prototype.Su=function(b,m,_){this.description=A.fe.pg(),this.aa.Pa(),b.B()||this.vu(b,m,_)},T.prototype.PO=function(b){this.description=A.fe.pg(),this.aa.L(b),this.aa.normalize()},T.prototype.SO=function(b){if(b==null)throw A.i.O();this.description=b,this.aa.Pa()},T.prototype.TO=function(b,m){if(b==null)throw A.i.O();this.description=b,this.aa.L(m),this.aa.normalize()},T.prototype.PE=function(){this.description=A.fe.pg(),this.aa.Pa()},T.prototype.RO=function(b){this.description=A.fe.pg(),this.aa.Pa(),b.B()||this.vu(b)},T.prototype.QO=function(b,m,_,C){this.description=A.fe.pg(),this.L(b,m,_,C)},T.prototype.L=function(b,m,_,C){if(this.wc(),typeof b=="number")this.aa.L(b,m,_,C);else for(this.Pa(),m=0,_=b.length;m<_;m++)this.$b(b[m])},T.prototype.Zo=function(b){if(this.wc(),!b.aT())throw A.i.O();this.aa.L(b)},T.prototype.Pa=function(){this.wc(),this.aa.Pa()},T.prototype.B=function(){return this.aa.B()},T.prototype.S=function(){return this.aa.S()},T.prototype.da=function(){return this.aa.da()},T.prototype.ik=function(){return this.aa.ik()},T.prototype.Lp=function(){return this.aa.Lp()},T.prototype.Kp=function(){return this.aa.tf()},T.prototype.$b=function(b){if(b instanceof A.h)this.wc(),this.aa.$b(b);else if(b instanceof A.l)this.wc(),this.aa.$b(b);else if(b instanceof A.Ta){if(this.wc(),!b.Bc()){var m=b.description;if(this.description!=m&&this.Ll(m),this.B())this.vu(b);else{this.aa.$b(b.D());for(var _=1,C=m.Ba;_=A.sa.Wa(m))throw A.i.O();var C=this.description.Rf(m);return this.qu(),0<=C?this.la[this.fR(this.description,b)+this.description.GR(C)-2+_]:A.sa.te(m)},T.prototype.qu=function(){if(this.wc(),this.la==null&&2=A.sa.Wa(m))throw A.i.de();var C=this.description.Rf(m);return 0<=C?(this.qu(),this.la[T.Ig(this.description,b)+this.description.bk(C)-2+_]):A.sa.te(m)},T.prototype.qD=function(b,m,_,C){if(this.wc(),m==0)b!=0?_!=0?this.aa.H=C:this.aa.C=C:_!=0?this.aa.G=C:this.aa.v=C;else{if(_>=A.sa.Wa(m))throw A.i.de();if(!this.hasAttribute(m)){if(A.sa.yG(m,C))return;this.se(m)}m=this.description.Rf(m),this.qu(),this.la[T.Ig(this.description,b)+this.description.bk(m)-2+_]=C}},T.Ig=function(b,m){return m*(b.Be.length-2)},T.prototype.Fa=function(b){this.wc();var m=new A.l;return b.A(m),this.aa.Fa(m)},T.prototype.isIntersecting=function(b){return b instanceof A.l?this.aa.isIntersecting(b):this.aa.isIntersecting(b.aa)},T.prototype.Lu=function(b,m){this.wc(),b.B()?this.Pa():m!==void 0?this.vu(b,m,void 0):this.aa.Lu(b.Ng(),b.kh())},T.prototype.offset=function(b,m){this.wc(),this.aa.offset(b,m)},T.prototype.normalize=function(){this.wc(),this.aa.normalize()},T.prototype.tf=function(b){if(b===void 0){if(b=new A.Ta(this.description),this.B())return b;for(m=this.description.Ba,_=1;_this.C&&(this.C=_.x),_.ythis.H&&(this.H=_.y)}}else if(T==null||T.length==0)this.Pa();else for(_=T[0],this.L(_.x,_.y),m=1;mT?this.v=T:this.Cb?this.G=b:this.HT?this.v=T:this.Cb?this.G=b:this.Hthis.C||this.G>this.H)&&this.Pa())},W.prototype.scale=function(T){0>T&&this.Pa(),this.B()||(this.v*=T,this.C*=T,this.G*=T,this.H*=T)},W.prototype.zoom=function(T,b){this.B()||this.L(this.tf(),T*this.S(),b*this.da())},W.prototype.isIntersecting=function(T){return!this.B()&&!T.B()&&(this.v<=T.v?this.C>=T.v:T.C>=this.v)&&(this.G<=T.G?this.H>=T.G:T.H>=this.G)},W.prototype.CG=function(T){return(this.v<=T.v?this.C>=T.v:T.C>=this.v)&&(this.G<=T.G?this.H>=T.G:T.H>=this.G)},W.prototype.Fa=function(T){return!this.B()&&!T.B()&&(T.v>this.v&&(this.v=T.v),T.Cthis.G&&(this.G=T.G),T.HT.length)throw A.i.O();T[0]!=null?T[0].na(this.v,this.G):T[0]=A.h.construct(this.v,this.G),T[1]!=null?T[1].na(this.v,this.H):T[1]=A.h.construct(this.v,this.H),T[2]!=null?T[2].na(this.C,this.H):T[2]=A.h.construct(this.C,this.H),T[3]!=null?T[3].na(this.C,this.G):T[3]=A.h.construct(this.C,this.G)},W.prototype.rF=function(){return this.B()?0:this.S()*this.da()},W.prototype.tR=function(){return this.B()?0:2*(this.S()+this.da())},W.prototype.ik=function(){return(this.C+this.v)/2},W.prototype.Lp=function(){return(this.H+this.G)/2},W.prototype.S=function(){return this.C-this.v},W.prototype.da=function(){return this.H-this.G},W.prototype.move=function(T,b){this.B()||(this.v+=T,this.G+=b,this.C+=T,this.H+=b)},W.prototype.Lu=function(T,b){if(b!==void 0)this.move(T-this.ik(),b-this.Lp());else if(T instanceof A.h)this.Lu(T.x,T.y);else{if(!(T instanceof A.Ta))throw A.i.O();b=(this.C-this.v)/2;var m=(this.H-this.G)/2;this.v=T.Ng()-b,this.C=T.Ng()+b,this.G=T.kh()-m,this.H=T.kh()+m}},W.prototype.offset=function(T,b){this.v+=T,this.C+=T,this.G+=b,this.H+=b},W.prototype.normalize=function(){if(!this.B()){var T=Math.min(this.v,this.C),b=Math.max(this.v,this.C);this.v=T,this.C=b,T=Math.min(this.G,this.H),b=Math.max(this.G,this.H),this.G=T,this.H=b}},W.prototype.fn=function(T){T.na(this.v,this.G)},W.prototype.VI=function(T){T.na(this.C,this.G)},W.prototype.YI=function(T){T.na(this.v,this.H)},W.prototype.gn=function(T){T.na(this.C,this.H)},W.prototype.aT=function(){return this.B()||this.v<=this.C&&this.G<=this.H},W.prototype.tf=function(){return A.h.construct((this.C+this.v)/2,(this.H+this.G)/2)},W.prototype.hz=function(){return A.h.construct(this.v,this.G)},W.prototype.contains=function(T,b){if(b!==void 0)return T>=this.v&&T<=this.C&&b>=this.G&&b<=this.H;if(T instanceof A.Ta)return this.contains(T.Ng(),T.kh());if(T instanceof A.h)return this.contains(T.x,T.y);if(T instanceof W)return T.v>=this.v&&T.C<=this.C&&T.G>=this.G&&T.H<=this.H;throw A.i.O()},W.prototype.jm=function(T,b){if(b!==void 0)return T>this.v&&Tthis.G&&bthis.v&&T.Cthis.G&&T.H>>32);var b=A.P.Vh(T);return T=this.C,T=A.P.truncate(T^T>>>32),b=A.P.Vh(T,b),T=this.G,T=A.P.truncate(T^T>>>32),b=A.P.Vh(T,b),T=this.H,T=A.P.truncate(T^T>>>32),A.P.Vh(T,b)},W.prototype.zr=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)},W.prototype.uy=function(T,b){var m=this.ak(T),_=this.ak(b);if(m&_)return 0;if(!(m|_))return 4;var C=(m!=0?1:0)|(_!=0?2:0);do{var D=b.x-T.x,F=b.y-T.y;if(D>F?m&W.TC?(m&W.lu?(T.y+=F*(this.v-T.x)/D,T.x=this.v):(T.y+=F*(this.C-T.x)/D,T.x=this.C),m=this.ak(T)):_&W.TC?(_&W.lu?(b.y+=F*(this.v-b.x)/D,b.x=this.v):(b.y+=F*(this.C-b.x)/D,b.x=this.C),_=this.ak(b)):m!=0?(m&W.mu?(T.x+=D*(this.G-T.y)/F,T.y=this.G):(T.x+=D*(this.H-T.y)/F,T.y=this.H),m=this.ak(T)):(_&W.mu?(b.x+=D*(this.G-b.y)/F,b.y=this.G):(b.x+=D*(this.H-b.y)/F,b.y=this.H),_=this.ak(b)):m&W.UC?(m&W.mu?(T.x+=D*(this.G-T.y)/F,T.y=this.G):(T.x+=D*(this.H-T.y)/F,T.y=this.H),m=this.ak(T)):_&W.UC?(_&W.mu?(b.x+=D*(this.G-b.y)/F,b.y=this.G):(b.x+=D*(this.H-b.y)/F,b.y=this.H),_=this.ak(b)):m!=0?(m&W.lu?(T.y+=F*(this.v-T.x)/D,T.x=this.v):(T.y+=F*(this.C-T.x)/D,T.x=this.C),m=this.ak(T)):(_&W.lu?(b.y+=F*(this.v-b.x)/D,b.x=this.v):(b.y+=F*(this.C-b.x)/D,b.x=this.C),_=this.ak(b)),(m&_)!=0)return 0}while(m|_);return C},W.prototype.ak=function(T){return(T.xthis.C?1:0)<<1|(T.ythis.H?1:0)<<3},W.prototype.Di=function(T){return!this.B()&&(this.S()<=T||this.da()<=T)},W.prototype.ub=function(T){return T instanceof A.h?Math.sqrt(this.dK(T)):Math.sqrt(this.px(T))},W.prototype.px=function(T){var b=0,m=0,_=this.v-T.C;return _>b&&(b=_),(_=this.G-T.H)>m&&(m=_),(_=T.v-this.C)>b&&(b=_),(_=T.G-this.H)>m&&(m=_),b*b+m*m},W.prototype.dK=function(T){var b=0,m=0,_=this.v-T.x;return _>b&&(b=_),(_=this.G-T.y)>m&&(m=_),(_=T.x-this.C)>b&&(b=_),(_=T.y-this.H)>m&&(m=_),b*b+m*m},W.prototype.en=function(T){this.B()?T.Pa():T.L(this.v,this.C)},W.lu=1,W.mu=4,W.TC=3,W.UC=12,W}();A.l=ve}(le||(le={})),function(A){var ve,W;(W=ve||(ve={}))[W.initialize=0]="initialize",W[W.initializeRed=1]="initializeRed",W[W.initializeBlue=2]="initializeBlue",W[W.initializeRedBlue=3]="initializeRedBlue",W[W.sweep=4]="sweep",W[W.sweepBruteForce=5]="sweepBruteForce",W[W.sweepRedBlueBruteForce=6]="sweepRedBlueBruteForce",W[W.sweepRedBlue=7]="sweepRedBlue",W[W.sweepRed=8]="sweepRed",W[W.sweepBlue=9]="sweepBlue",W[W.iterate=10]="iterate",W[W.iterateRed=11]="iterateRed",W[W.iterateBlue=12]="iterateBlue",W[W.iterateBruteForce=13]="iterateBruteForce",W[W.iterateRedBlueBruteForce=14]="iterateRedBlueBruteForce",W[W.resetRed=15]="resetRed",W[W.resetBlue=16]="resetBlue";var T=function(){function b(m,_){this.ei=m,this.ZG=_}return b.prototype.qr=function(m,_,C){this.ei.FX(C,m,_,this.ZG)},b.prototype.bq=function(m){return this.ei.Tr(m,this.ZG)},b}();ve=function(){function b(){this.qw=this.qo=this.ff=this.sd=null,this.yq=new A.l,this.Cm=this.Jj=this.Kj=this.Bd=this.Ff=this.Md=this.ew=this.io=this.rd=this.Fb=null,this.Yb=-1,this.ra=0,this.Pk()}return b.prototype.mr=function(){this.Pk(),this.Rv=!0,this.Fb==null?(this.io=new A.ja(0),this.Fb=[]):(this.io.Dh(0),this.Fb.length=0)},b.prototype.bd=function(m,_){if(!this.Rv)throw A.i.Hb();var C=new A.l;C.L(_),this.io.add(m),this.Fb.push(C)},b.prototype.Hp=function(){if(!this.Rv)throw A.i.Hb();this.Rv=!1,this.Fb!=null&&0this.Fb.length)return this.qe=this.Fb.length,this.Yb=5,!0;this.sd==null&&(this.sd=new A.ur(!0),this.qo=this.sd.getIterator(),this.Md=new A.ja(0)),this.sd.mr();for(var m=0;mthis.Fb.length||10>this.rd.length)return this.qe=this.Fb.length,this.Yb=6,!0;this.sd==null&&(this.sd=new A.ur(!0),this.qo=this.sd.getIterator(),this.Md=new A.ja(0)),this.sd.mr();for(var m=0;mthis.Fb.length||10>this.rd.length)return this.qe=this.Fb.length,this.Yb=6,!0;this.ff==null&&(this.ff=new A.ur(!0),this.qw=this.ff.getIterator(),this.Ff=new A.ja(0)),this.ff.mr();for(var m=0;mthis.Fb.length||10>this.rd.length)return this.qe=this.Fb.length,this.Yb=6,!0;this.sd==null&&(this.sd=new A.ur(!0),this.qo=this.sd.getIterator(),this.Md=new A.ja(0)),this.ff==null&&(this.ff=new A.ur(!0),this.qw=this.ff.getIterator(),this.Ff=new A.ja(0)),this.sd.mr();for(var m=0;m>1;return b.gq(m)?(this.sd.remove(_),this.qe!=0||(this.Bf=this.Xf=-1,this.Jc=!0,!1)):(this.qo.zB(this.Fb[_].v,this.Fb[_].C,this.ra),this.Xf=_,this.Yb=10,!0)},b.prototype.MX=function(){return--this.qe==-1?(this.Bf=this.Xf=-1,this.Jc=!0,!1):(this.Tg=this.Xf=this.qe,this.Yb=13,!0)},b.prototype.NX=function(){return--this.qe==-1?(this.Bf=this.Xf=-1,this.Jc=!0,!1):(this.Xf=this.qe,this.Tg=this.rd.length,this.Yb=14,!0)},b.prototype.OX=function(){var m=this.Md.get(this.qe-1),_=this.Ff.get(this.Tg-1),C=this.Tr(m,!0),D=this.Tr(_,!1);return C>D?this.tx():C>1;if(b.gq(m))return this.Ef!=-1&&this.Kj.get(_)!=-1?(this.Bd.kd(this.Ef,this.Kj.get(_)),this.Kj.set(_,-1)):this.sd.remove(_),this.qe!=0||(this.Bf=this.Xf=-1,this.Jc=!0,!1);if(this.Df!=-1&&0>1;if(b.gq(m))return this.Df!=-1&&this.Jj.get(_)!=-1?(this.Bd.kd(this.Df,this.Jj.get(_)),this.Jj.set(_,-1)):this.ff.remove(_),this.Tg!=0||(this.Bf=this.Xf=-1,this.Jc=!0,!1);if(this.Ef!=-1&&0>1;return this.sd.xj(m),this.Yb=4,!0},b.prototype.eT=function(){if(this.Xf=this.qo.next(),this.Xf!=-1)return!1;this.Bf=this.Xf=-1;var m=this.Ff.get(this.Tg)>>1;return this.ff.xj(m),this.Yb=7,!0},b.prototype.bT=function(){if(this.Bf=this.qw.next(),this.Bf!=-1)return!1;var m=this.Md.get(this.qe)>>1;return this.sd.xj(m),this.Yb=7,!0},b.prototype.cT=function(){if(--this.Tg==-1)return this.Yb=5,!0;this.yq.L(this.Fb[this.qe]);var m=this.Fb[this.Tg];return this.yq.X(this.ra,this.ra),!this.yq.isIntersecting(m)||(this.Bf=this.Tg,!1)},b.prototype.dT=function(){if(--this.Tg==-1)return this.Yb=6,!0;this.yq.L(this.Fb[this.qe]);var m=this.rd[this.Tg];return this.yq.X(this.ra,this.ra),!this.yq.isIntersecting(m)||(this.Bf=this.Tg,!1)},b.prototype.fJ=function(){return this.sd==null?(this.Jc=!0,!1):(this.qe=this.Md.size,0>1],b.gq(m)?_.G-C:_.H+C):(_=this.rd[m>>1],b.gq(m)?_.G-C:_.H+C)},b}(),A.sC=ve}(le||(le={})),function(A){var ve=function(){function W(){}return W.construct=function(T,b,m,_,C,D){var F=new W;return F.v=T,F.G=b,F.Xe=m,F.C=_,F.H=C,F.Dg=D,F},W.prototype.Pa=function(){this.Xe=this.v=NaN},W.prototype.B=function(){return isNaN(this.v)},W.prototype.SS=function(){return isNaN(this.Xe)},W.prototype.L=function(T,b,m,_,C,D){_!==void 0?typeof T=="number"?(this.v=T,this.G=b,this.Xe=m,this.C=_,this.H=C,this.Dg=D):(this.v=T.x-.5*b,this.C=this.v+b,this.G=T.y-.5*m,this.H=this.G+m,this.Xe=T.z-.5*_,this.Dg=this.Xe+_):(this.v=T,this.G=b,this.Xe=m,this.C=T,this.H=b,this.Dg=m)},W.prototype.move=function(T){this.v+=T.x,this.G+=T.y,this.Xe+=T.z,this.C+=T.x,this.H+=T.y,this.Dg+=T.z},W.prototype.copyTo=function(T){T.v=this.v,T.G=this.G,T.C=this.C,T.H=this.H},W.prototype.Nk=function(T,b,m){this.v>T?this.v=T:this.Cb?this.G=b:this.Hm?this.Xe=m:this.DgT.length)throw A.i.O();T[0]=new A.Od(this.v,this.G,this.Xe),T[1]=new A.Od(this.v,this.H,this.Xe),T[2]=new A.Od(this.C,this.H,this.Xe),T[3]=new A.Od(this.C,this.G,this.Xe),T[4]=new A.Od(this.v,this.G,this.Dg),T[5]=new A.Od(this.v,this.H,this.Dg),T[6]=new A.Od(this.C,this.H,this.Dg),T[7]=new A.Od(this.C,this.G,this.Dg)},W.prototype.bx=function(T){if(T==null||T.length==0)this.Pa();else{var b=T[0];for(this.L(b.x,b.y,b.z),b=1;bthis.AA;){var B=this.td.ia();if(C.N(B.bc()),D.N(B.xc()),C.scale(this.Xa.fc),D.scale(this.Xa.fc),A.ej.Ou(C,D)?C.x=D.x:A.ej.Mu(C,D)&&(D.x=C.x),this.wk.length=0,A.ej.oF(this.Xa.Ub,this.Xa.lc,this.Xa.Ae,C,D,this.Xa.LA,this.Xa.at,F,this.Pj,this.Is,this.wk,this.dw),this.fo!=null&&(B=this.wk.slice(0),this.fo.lG(this.fo.ea()-1,B,B.length-1)),A.ej.Nu(C,D)?(this.sq.Pa(),this.Xa.ny(C,this.ul,this.sq),this.Zn=!0):(this.sq.Pa(),this.Zn=this.sy(F[0],this.sq)),this.Zn){if(this.td.ni(),this.td.zz()){this.td.ni(),this.td.ia();break}this.td.xW();break}m==null&&(m=new A.Ea).$k(null,0),this.JD(m),_++}if(this.dw[0]=0,0<_){for(F=this.td.xb();0<_;)this.td.ni(),C.N(this.tw.Oa(this.td.xb())),D.N(this.tw.Oa(this.td.kk())),C.scale(this.Xa.fc),D.scale(this.Xa.fc),this.ul&&(A.ej.Ou(C,D)?C.x=D.x:A.ej.Mu(C,D)&&(D.x=C.x)),this.wk.length=0,A.ej.oF(this.Xa.Ub,this.Xa.lc,this.Xa.Ae,D,C,this.Xa.LA,this.Xa.at,null,this.Pj,this.Is,this.wk,this.dw),this.JD(m),_--;return C.N(this.tw.Oa(this.td.xb())),C.scale(this.Xa.fc),T.Jr(this.Xa.Ub,this.Xa.lc,this.Xa.fc,this.Xa.sb,C,this.fi+1.570796326794897,this.fi+4.71238898038469,this.Xa.co,this.ul,this.uk,m,NaN,NaN),this.td.Wb(F),this.td.ia(),_=A.ua.mj(null,m,!0),A.Hg.Ok(m,_,!0,!0,this.Xa.Vb)}return this.Zn=!1,this.td.ia(),m=A.ba.kg(this.sq),A.Hg.Ok(m,this.Xa.Cq,!0,!0,this.Xa.Vb)},b.prototype.JD=function(m){var _=this.wk[0],C=this.Pj[0]-1.570796326794897,D=this.Is[0]+1.570796326794897;if(!isNaN(this.fi)){if(this.fi>=this.Pj[0]){var F=this.fi+1.570796326794897;C=F+3.141592653589793-(this.fi-this.Pj[0])}else C=(F=this.fi+1.570796326794897)+3.141592653589793-(6.283185307179586-(this.Pj[0]-this.fi));var B=!(this.fi>=this.Pj[0]&&3.141592653589793>=this.fi-this.Pj[0])&&!(this.fiF;)Z-=6.283185307179586;Z_.x-this.uk[0]?this.uk[0]-=6.283185307179586:3.141592653589793<_.x-this.uk[0]&&(this.uk[0]+=6.283185307179586)),B||(C=.5*(C+F))):(B?((F=new A.h).N(_),F.scale(1/this.Xa.fc),m.xf(0,-1,F)):T.Jr(this.Xa.Ub,this.Xa.lc,this.Xa.fc,this.Xa.sb,this.wk[0],F,C,this.Xa.co,this.ul,this.uk,m,NaN,NaN),this.AA+=1)}T.my(this.Xa.Ub,this.Xa.lc,this.Xa.fc,this.Xa.sb,this.Xa.Ae,this.wk,C,D,this.ul,this.uk,m),this.fi=this.Is[0]},b.prototype.sy=function(m,_){return this.Xa.sy(this.wk,m,this.Pj[0],this.Is[0],this.ul,_)},b.prototype.Ma=function(){return 0},b}(),T=function(){function b(){}return b.buffer=function(m,_,C,D,F,B){if(m==null)throw A.i.O("Geometry::Geodesic_bufferer::buffer");if(m.B())return new A.Ea(m.description);var q=new b;q.Sg=_,q.Kc=A.cb.tc(_);var Z=A.cb.xv(q.Kc);if(q.Vb=B,q.Ub=A.cb.gv(q.Kc),q.lc=Z*(2-Z),q.fc=q.Kc.Id().ci,q.ra=q.Sg.Mn(),q.Cq=q.Kc.Mn(),q.at=q.Cq*q.fc,q.Bq=1.570796326794897/q.fc,q.KY=3.141592653589793/q.fc,q.Ls=6.283185307179586/q.fc,q.LY=q.Ls/6,q.GA=0,q.JY=1.5707963267948966*q.Ub/q.GA,C==4?(q.Ae=2,q.Yv=!0):(q.Ae=C,q.Yv=!1),q.La=D,q.sb=Math.abs(D),isNaN(F)||.001>F?q.tX():q.bo=F,C=m.K(),A.ba.zd(C)?((C=new A.Ua(m.description)).pc(m,!0),m=C,C=1607):C==197&&(C=new A.l,m.A(C),C.S()<=q.ra||C.da()<=q.ra?((C=new A.Ua(m.description)).bd(m,!1),m=C,C=1607):((C=new A.Ea(m.description)).bd(m,!1),m=C,C=1736)),q.uX(),A.ba.Tn(C)||q.vX(),q.sb<=.5*q.bo)return C!=1736?new A.Ea(m.description):q.Yv?m:A.ej.Sr(m,q.Sg,q.Ae,q.LA,-1,B);if(0>q.La&&C!=1736)return new A.Ea(m.description);if(q.Yv&&A.ba.Ic(C)?(_=A.ej.Sr(m,_,4,NaN,q.bo,B),m=A.cb.Bh(_,q.Sg,q.Kc)):m=A.cb.Bh(m,q.Sg,q.Kc),(m=A.Jh.nj(m,q.Kc)).B())return new A.Ea(m.description);switch(!q.Yv&&A.ba.Ic(C)&&(m=A.ej.kI(q.fc,m)),m=b.GX(m,q.Kc),C){case 1736:_=q.PN(m);break;case 1607:_=q.QN(m);break;case 550:_=q.NN(m);break;case 33:_=q.ON(m);break;default:throw A.i.ga("corrupted_geometry")}return(q=A.cb.Bh(_,q.Kc,q.Sg)).Ll(m.description),q},b.prototype.PN=function(m){var _=new A.Ea;m=new W(this,m,_),m=A.Ih.local().W(m,this.Kc,this.Vb).next(),m=A.kp.pj(m,this.Kc,2);var C=new A.Ed;return C.scale(1/this.fc,1/this.fc),_.Pc(C),_=A.kp.pj(_,this.Kc,2),0<=this.La?A.Ih.local().W(_,m,this.Kc,this.Vb):A.mp.local().W(_,m,this.Kc,this.Vb)},b.prototype.QN=function(m){return m=new W(this,m,null),m=A.Ih.local().W(m,this.Kc,this.Vb).next(),A.kp.pj(m,this.Kc,2)},b.prototype.NN=function(m){return m=new ve(this,m),m=A.Ih.local().W(m,this.Kc,this.Vb).next(),A.kp.pj(m,this.Kc,2)},b.prototype.ON=function(m){(m=m.D()).scale(this.fc);var _=new A.Ea;return this.ny(m,!1,_),A.kp.pj(_,this.Kc,2)},b.prototype.sy=function(m,_,C,D,F,B){var q=m[0],Z=m[m.length-1],oe=q.y>Z.y?q.y:Z.y,ue=A.F.q(this.Ub,this.lc,q.ym.He()&&(this.PV(m),!0)},b.prototype.JI=function(m,_,C){var D=C.I(),F=0<_?_-1:D-1;if(D=C.Oa(_B.x?(B=this.Bq,D.ig(-this.Ls,0)):(B=-this.Bq,D.ig(this.Ls,0)),_.add(m,!1),m.Pa(),C.add(_,!1),C.Pc(D),F=new A.l,C.A(F),F.X((this.Ls-F.S())/2,0),F.G=-this.Bq,F.H=this.Bq;for(var Z=0;Z=q));)A.kb.Ai(m,_,F.x,F.y,D,Jt,rt,Dt),oe?Ke.na(rt.u,Dt.u):(Vt.na(rt.u,Dt.u),b.bJ(F.x,Vt.x,Ot.x,ue),Ke.na(ue[0]+Vt.x,Vt.y),Ot.N(Ke)),Ke.scale(C),be.xf(0,-1,Ke),B=Jt,Jt=ei++*Z}},b.ZI=function(m,_,C,D,F,B,q,Z,oe,ue){var be=new A.h,De=new A.h,qe=new A.ha(0),rt=new A.ha(0);for(A.kb.Ai(m,_,D.x,D.y,C,F,qe,rt),be.na(qe.u,rt.u),A.kb.Ai(m,_,D.x,D.y,C,B,qe,rt),De.na(qe.u,rt.u),C=new A.ha(0),A.kb.Sy(m,_,q.x,q.y,be.x,be.y,C),oe[0]=C.u,A.kb.Sy(m,_,q.x,q.y,De.x,De.y,C),ue[0]=C.u;oe[0]<=ue[0];)oe[0]+=6.283185307179586;for(;oe[0]>ue[0];)oe[0]-=6.283185307179586;for(;oe[0]>=Z;)oe[0]-=6.283185307179586,ue[0]-=6.283185307179586;for(;oe[0]B[be]?1:0}),_=m.Ja(),Z=0;Zthis.sb/m&&(m=this.sb/500),.01>m&&(m=.01),this.bo=m},b}();A.QK=T}(le||(le={})),function(A){var ve=function(){function W(){}return W.Of=function(T,b){var m=new A.h;m.N(b),T.push(m)},W.wp=function(T,b){T.add(b.x),T.add(b.y)},W.cB=function(T){T.Dh(T.size-2)},W.jB=function(T,b){b.na(T.get(T.size-2),T.get(T.size-1))},W.Sr=function(T,b,m,_,C,D){if(T==null)throw A.i.O();var F=T.K();if(T.B()||A.ba.Tn(F))return T;var B=new W;B.Sg=b,B.Kc=A.cb.tc(b);var q=A.cb.xv(B.Kc);if(B.Vb=D,B.Ub=A.cb.gv(B.Kc),B.lc=q*(2-q),B.fc=B.Kc.Id().ci,B.Cq=B.Kc.Mn(),B.at=B.Cq*B.fc,B.vA=_,B.uA=C,B.Ae=m,F==197?(m=new A.Ea(T.description)).bd(T,!1):A.ba.zd(F)?(m=new A.Ua(T.description)).pc(T,!0):m=T,B.Ae!=4){if((b=B.Sg.Nb(B.Kc)==0?A.cb.Bh(m,B.Sg,B.Kc):A.Jh.nj(m,B.Kc)).B())return b;b=W.kI(B.fc,b),b=B.Uy(b),b=A.kp.pj(b,B.Kc,B.Ae),B=A.cb.Bh(b,B.Kc,B.Sg)}else{if(A.Gg.Tb(b)==2?(T=A.cb.ol(),(b=A.Zj.local().W(m,T,b,D))==T&&(b=new A.Ea,T.copyTo(b))):b=A.Jh.nj(m,B.Kc),b.B())return b;B=B.yX(b)}return B},W.kI=function(T,b){var m=new A.l;if(b.yc(m),3.141592653589793>m.S()*T)return b;var _=!1;m=b.Ha();for(var C=new A.h,D=new A.h;m.ab();)for(;m.Ia();){var F=m.ia();if(C.N(F.bc()),D.N(F.xc()),C.scale(T),D.scale(T),3.141592653589793D.x-C.x)for(;-6.283185307179586>D.x-C.x;)D.x+=6.283185307179586;W.Yi(D.x,NaN,rt),ue.N(D)}else Z.N(D),W.vU(Z),W.Yi(Z.x,qe,rt),ue.na(rt[0]+Z.x,Z.y);.5>Math.abs(ue.x-D.x)&&ue.N(D),q?(F.Vw(0,De),be.N(oe),be.scale(1/T),De.Db(be),(B=m.xm())?_.nf(De):_.lineTo(De),m.Sn()&&!b.ec(m.gb)&&(F.Vw(1,De),be.N(ue),be.scale(1/T),De.Db(be),_.lineTo(De))):((B=m.xm())&&_.Cz(null,0),F=_.ea()-1,be.N(oe),be.scale(1/T),_.xf(F,-1,be),m.Sn()&&!b.ec(m.gb)&&(be.N(ue),be.scale(1/T),_.xf(F,-1,be)))}return _},W.oF=function(T,b,m,_,C,D,F,B,q,Z,oe,ue){var be=new A.h,De=new A.h,qe=0<_.compare(C);W.aJ(qe,_,C,be,De),W.pF(T,b,m,be,De,D,NaN,F,B,q,Z,null,oe,ue),qe&&W.aC(q,Z,null,oe)},W.prototype.Uy=function(T){var b=T.Ja(),m=T.Ha(),_=[],C=null,D=null,F=1Vt&&(Vt+=6.283185307179586),0>(rt=rt.u)&&(rt+=6.283185307179586),q!=null&&(q[0]=Dt),Z!=null&&(Z[0]=Vt),oe!=null&&(oe[0]=rt),Z=q=NaN,ue!=null&&(q=((Z=A.F.Ch(T,b))-(oe=A.F.q(T,b,_.y)))/Dt,Z=(Z+oe)/Dt),oe=W.Ou(_,C),rt=W.Mu(_,C),Vt=oe||rt;var Ke=W.AE(_,C,B),Ot=new A.ha(0),ei=new A.ha(0),Jt=new A.h,Xt=new A.h,ti=new A.h;W.Yi(_.x,NaN,De);var bi=[De[0]];if(Dt<=D)W.Of(be,_),W.Yi(C.x,NaN,De),ue?.add(0),Vt?(oe&&W.fB(_,C,ue,be),rt&&W.dB(_,C,ue,be)):Ke?W.eB(_,C,qe,q,Z,ue,be):0ti.x&&(De[0]+=6.283185307179586,ti.na(De[0]+Jt.x,Jt.y)):Ri.xF.x?F.x+=6.283185307179586:3.141592653589793mi;mi++)if(Ri=Fi[mi]*Z+(1-Fi[mi])*q,A.kb.qj(T,b,_.x,_.y,Ri*C,D,Dt,Vt,m),Jt.na(Dt.u,Vt.u),mi==0&&(ar=Ri,Xt.N(Jt)),W.RW(Ot,Jt,ei,bi),bi.ic(bi.ge(Jt,!0),ti),A.kb.xd(T,b,Jt.x,Jt.y,ti.x,ti.y,Ke,null,null,2),Ke.u>oe){er=!0;break}er?(ei.N(Xt),Z=ar,W.wp(F,ei),B.add(Z)):(W.cB(F),B.Gn(B.size-1,1,B.size-1),0=F&&is.u<=D&&3.141592653589793>Math.abs(qe.x-rt.x)||_.Tx(er,ar)<=C));bi++){var li=xo[bi]*ar+(1-xo[bi])*er;if(_.ic(li,ue),ti?Dt.na(ue.x*m,ue.y*m):(Xt[0][0]=ue.x,Xt[0][1]=ue.y,A.cb.wt(),Dt.x=Xt[0][0]*m,Dt.y=Xt[0][1]*m),bi==0&&(Xi=li,De.N(ue),Ke.N(Dt),0D||3.141592653589793<=Math.abs(qe.x-rt.x)))){In=!0;break}if(mi&&0D||3.141592653589793<=Math.abs(qe.x-Dt.x)){In=!0;break}}else if(0F){In=!0;break}if(mi){if(A.kb.xd(T,b,Jt.x,Jt.y,Vt.x,Vt.y,Ur,null,null,2),Ur.u>F){In=!0;break}if(A.kb.xd(T,b,Vt.x,Vt.y,Dt.x,Dt.y,Qo,null,null,2),Qo.u>F){In=!0;break}}}}In?(oe.N(De),rt.N(Ke),ar=Xi,W.wp(Fi,oe),W.wp(dn,rt),Lr.add(ar)):(W.cB(Fi),W.cB(dn),Lr.Gn(Lr.size-1,1,Lr.size-1),W.Of(q,oe),Ri+=is.u,B?.add(Ri),0Math.abs(b.x-T.x)?(_.Ec(T),3.141592653589793<=m.x-T.x?_.Sl(m.x-6.283185307179586,m.y):3.141592653589793<=T.x-m.x?_.Sl(m.x+6.283185307179586,m.y):_.Sl(m.x,m.y)):(_.Ec(m),3.141592653589793<=T.x-m.x?_.Sl(T.x-6.283185307179586,T.y):3.141592653589793<=m.x-T.x?_.Sl(T.x+6.283185307179586,T.y):_.Sl(T.x,T.y))},W.TJ=function(T,b){for(var m=0;mT.x)for(;-3.141592653589793>T.x;)T.x+=6.283185307179586;if(3.141592653589793W.v+_&&DW?-W:W},ve.Mb=function(W,T){return 0<=T?ve.R(W):-ve.R(W)},ve.$=function(W,T){return W==T||ve.R(W-T)<=ve.EC*(1+(ve.R(W)+ve.R(T))/2)},ve.Dd=function(W){return W==0||ve.R(W)<=ve.EC},ve.Ch=function(W,T){var b=(T=(1-(T=Math.sqrt(1-T)))/(1+T))*T;return W/(1+T)*(1+b*(.25+b*(.015625+.00390625*b)))*ve.zL},ve.zL=1.5707963267948966,ve.EC=3552713678800501e-30,ve}()}(le||(le={})),function(A){var ve=function(T){this.Yf=T,this.Mk=this.Yf.getCode(),0>this.Mk&&(this.Mk=0)};A.zY=ve;var W=function(){function T(b){b===void 0&&(b=null),this.Ej=null,this.Wn=!1,b!==null&&(this.Ej=new ve(b))}return T.prototype.Fc=function(){return this.Ej!=null?this.Ej.Mk:0},T.prototype.Qf=function(){var b=new T;return this.copyTo(b),b},T.prototype.copyTo=function(b){b.Ej=this.Ej,b.Wn=this.Wn},T.prototype.Lz=function(){this.Wn=!this.Wn},T.prototype.sm=function(){return this.Ej!=null?this.Ej.Yf:null},T.prototype.GJ=function(b){if(0>=b)throw A.i.O();if(b!=this.Fc()){if((b=A.qf.geogtran(b))==null)throw A.i.O("Geogtran not found.");this.Ej=new ve(b)}},T.prototype.wz=function(){return this.Ej==null?null:this.Ej.Yf.toString()},T.prototype.pX=function(b){if(b==null)throw A.i.O();var m=null;try{m=A.qf.fromString(A.Tc.PE_TYPE_GEOGTRAN,b)}catch{throw A.i.O()}this.Ej=new ve(m)},T.prototype.Nb=function(b){return b==this||!(!(b instanceof T)||(0>=this.Fc()||this.Fc()!=b.Fc())&&!this.sm().isEqual(b.sm()))&&this.Wn==b.Wn},T.prototype.toString=function(){var b="GeographicTransformation: "+this.wz();return 200T.I())},W.wE=function(T){return!(T.B()||T.K()!=1607&&T.K()!=1736||20>T.I())},W}();A.Wk=ve}(le||(le={})),function(A){A.ac=function(){function ve(){}return ve.OT=function(W){var T=new A.Ea;return T.rx(W.gs(),W.js()),T.Aj(W.gs(),W.hs()),T.Aj(W.fs(),W.hs()),T.Aj(W.fs(),W.js()),T},ve.Bh=function(W,T){return W===null?null:A.Gx.local().W(W,T,null)},ve.fY=function(W,T){var b=A.Ih.local();return W=new A.$c(W),b.W(W,T,null).next()},ve.km=function(W,T,b){return A.mp.local().W(W,T,b,null)},ve.gp=function(W,T,b){return A.Jx.local().W(W,T,b,null)},ve.RX=function(W,T,b){var m=A.Jx.local();for(W=new A.$c(W),T=new A.$c(T),b=m.W(W,T,b,null),m=[];(T=b.next())!=null;)m.push(T);return m},ve.Nb=function(W,T,b){return A.fj.local().W(3,W,T,b,null)},ve.OP=function(W,T,b){return A.fj.local().W(4,W,T,b,null)},ve.MS=function(W,T,b){var m=A.Zj.local();for(W=new A.$c(W),T=new A.$c(T),b=m.W(W,T,b,null),m=[];(T=b.next())!=null;)m.push(T);return m},ve.LP=function(W,T,b){var m=A.mp.local();for(W=new A.$c(W),T=new A.$c(T),b=m.W(W,T,b,null),m=[];(T=b.next())!=null;)m.push(T);return m},ve.Fa=function(W,T,b){return A.Zj.local().W(W,T,b,null)},ve.LS=function(W,T,b){if((W=A.Zj.local().W(W,T,b,null,1))===null)return[];if(W.K()===550){for(T=[],b=0;bW.Eb())return 0;var m=null;if(T!=null){if(m=T.Id(),b!=null&&m.Fc()!=b.Fc()&&m.pd!=b.pd)throw A.i.Zk()}else if(b!=null)throw A.i.O();W.K()==1736||W.K()==197?T=W.ng():A.ba.zd(W.K())?(T=new A.Ua(W.description)).pc(W,!0):T=W,W=0,T=T.Ha();for(var _=new A.h,C=new A.h;T.ab();)for(;T.Ia();){var D=T.ia();D.$p(_),D.Vr(C),W+=A.h.ub(_,C)}return m!==null&&b!==null&&(W=A.Uc.Ph(W,m,b)),W},ve.aP=function(W){return W.points!==void 0?ve.hS(W,W.hasZ!==void 0&&W.hasZ,W.hasM!==void 0&&W.hasM):W.rings!==void 0?ve.gG(W.rings,W.hasZ!==void 0&&W.hasZ,W.hasM!==void 0&&W.hasM,"P"):W.paths!==void 0?ve.gG(W.paths,W.hasZ!==void 0&&W.hasZ,W.hasM!==void 0&&W.hasM,"L"):W.x!==void 0?ve.iS(W):W.xmin!==void 0?ve.gS(W):null},ve.iS=function(W){if(W.x==null||W.x=="NaN")return new A.Ta;var T=new A.Ta(W.x,W.y);return W.z!==void 0&&W.z!==null&&T.sX(W.z),W.m!==void 0&&W.m!==null&&T.cX(W.m),T},ve.gS=function(W){if(W.xmin==null||W.xmin=="NaN")return new A.Hh;var T=new A.Hh(W.xmin,W.ymin,W.xmax,W.ymax);return W.zmin!==void 0&&W.zmin!==null&&T.setInterval(1,0,W.zmin,W.zmax),W.mmin!==void 0&&W.mmin!==null&&T.setInterval(2,0,W.mmin,W.mmax),T},ve.hS=function(W,T,b){var m=0,_=new A.ee,C=3*W.points.length;C%2!=0&&C++,2>C&&(C=2);var D=A.P.truncate(3*W.points.length/2);4>D?D=4:16>D&&(D=16),C=A.Zc.Fn(C,0);var F=A.Zc.Fn(D);D=A.Zc.Fn(D);for(var B=0;B=C?(ue[be]=!1,Z+=1,F.add(q),B.add(_),q+=De):ue[be]=!0}for((m=3*q)%2!=0&&m++,2>m&&(m=2),4>(be=A.P.truncate(3*q/2))?be=4:16>be&&(be=16),m=A.Zc.Fn(m,0),_=A.Zc.Fn(be),C=A.Zc.Fn(be),be=De=0;beF)throw A.i.O();this.Si.pa=D-B,this.Si.wa=F+B,this.ji.resize(0),this.ie=0,this.tg[0]=0},C.prototype.Wo=function(D,F){this.Si.pa=D-F,this.Si.wa=D+F,this.ji.resize(0),this.ie=0,this.tg[0]=0},C.prototype.next=function(){if(!this.Za.nq)throw A.i.Hb();if(0>this.ie)return-1;for(var D=!0;D;)switch(this.tg[this.ie]){case 1:D=this.AU();break;case 2:D=this.BU();break;case 3:D=this.CU();break;case 4:D=this.DU();break;case 5:D=this.AW();break;case 6:D=this.fT();break;case 7:D=this.oN();break;case 0:D=this.Bz();break;default:throw A.i.Ra()}return this.Qg!=-1?this.Op()>>1:-1},C.construct=function(D){var F=new C;return F.Za=D,F.ji.Jb(20),F.ie=-1,F},C.prototype.Bz=function(){return this.Qg=this.qH=this.Oi=this.Mc=-1,this.Za.ne!=null&&0=this.Si.pa?(this.gi=this.LR(),!1):(this.ie--,!0)},C.prototype.oN=function(){return this.Qg=this.gi,this.Qg!=-1&&_.iq(this.Op())?(this.gi=this.NF(),!1):(this.ie--,!0)},C.prototype.NF=function(){return this.Za.Uf?this.Za.bg.lb(this.Qg):this.Za.Vi.lb(this.Qg)},C.prototype.LR=function(){return this.Za.Uf?this.Za.bg.xe(this.Qg):this.Za.Vi.xe(this.Qg)},C.prototype.Op=function(){return this.Za.Uf?this.Za.bg.ka(this.Qg):this.Za.Vi.getData(this.Qg)},C}();A.AY=m;var _=function(){function C(D){this.Cm=this.bi=this.bg=this.Vi=this.Mm=this.Gj=this.ne=this.Hj=null,this.Uf=D,this.nq=this.Uv=!1}return C.prototype.mr=function(){this.Pk(!0)},C.prototype.Dr=function(D,F){if(!this.Uv)throw A.i.Hb();this.Hj.push(new A.Oc(D,F))},C.prototype.Hp=function(){if(!this.Uv)throw A.i.ga("invalid call");this.Uv=!1,this.nq=!0,this.Uf||(this.qS(),this.aw=this.Hj.length)},C.prototype.xj=function(D){if(!this.Uf||!this.nq)throw A.i.O("invalid call");if(this.kf==-1){var F=this.Hj.length;if(this.dA){var B=new A.ja(0);B.Jb(2*F),this.XI(B),this.bi.Jb(2*F),this.bi.resize(0),this.WI(B),this.Mm.resize(F,-1),this.Mm.Yj(-1,0,F),this.dA=!1}else this.Mm.Yj(-1,0,F);this.kf=this.Vu()}F=this.kG(D<<1,this.kf),B=this.bg.addElement(1+(D<<1),this.rz(F)),this.QJ(F,B),this.Mm.set(D,F),this.aw++},C.prototype.remove=function(D){if(!this.Uf||!this.nq)throw A.i.ga("invalid call");var F=this.Mm.get(D);if(F==-1)throw A.i.O("the interval does not exist in the interval tree");this.Mm.set(D,-1),this.aw--;var B=this.rz(F),q=this.bg.UR(B);this.bg.wd(this.rR(F),B),this.bg.wd(this.OR(F),B),(D=this.bg.size(B))==0&&(this.bg.HP(B),this.UJ(q,-1)),this.Gj.kd(F),B=this.PF(q);var Z=this.sj(q),oe=this.nk(q);for(F=0;!(0>1);Z!=-1?this.QJ(Z,this.Vi.addElement(this.rz(Z),q)):(Z=this.kG(q,this.kf),B.set(q>>1,Z))}},C.prototype.kG=function(D,F){var B=F,q=F,Z=-1,oe=0,ue=this.bi.size-1,be=0,De=D>>1,qe=NaN,rt=NaN,Dt=!0,Vt=this.yR(De);for(De=this.vR(De);Dt;){oeKe&&(KeKe)F!=-1&&(F==B?(q=B,qe=Ke,rt=(F=this.nk(B))!=-1?this.Pp(F):NaN):rt>1];return C.iq(D)?F.pa:F.wa},C}();A.ur=_}(le||(le={})),function(A){var ve=function(){function W(T){if(T==null)throw A.i.ga("Invalid arguement");this.hf=T;var b=T.iR();b.cS()?T.ef.DG()?this.no=A.ui.PannableFold:this.no=A.ui.Clip:this.no=A.ui.DontClip,b.dS()?T.$f.DG()?this.Sm=A.ui.PannableFold:this.Sm=A.ui.Clip:this.Sm=A.ui.DontClip,this.Dm=b.Lr,this.hH=b.Xu,T=this.hf.nH,this.WG=T.ks(2147483648),this.Wv=T.ks(1073741824)}return W.Bh=function(T,b,m){return b.yw.Bh(T,m)},W.Tt=function(T,b,m,_){return T.yw.Tt(b,m,_)},W.St=function(T,b,m,_){if(m=0>m?b.length:m,(T=T.yw.Tt(b,m,_))==m)return T;for(var C=b=0;CC.H){var De=A.l.construct(B.v-1,C.G,B.C+1,C.H);if((be=A.ti.Pu(be,De,m,NaN,0,b)).B())return be}B.S()>2*C.S()&&(be=A.Ab.Jp(be,-2*C.S(),2*C.S(),m,!0,0,!0,b))}B=this.hH,(C=!isNaN(B))&&(be=A.Zl.local().W(be,B,b)),De=Z?_.mk():null;var qe=NaN;q&&(qe=m.Bi());var rt=_.Yr()!=null;if(this.WG)q&&(A.Ab.wr(m,qe,be,F),C&&(q=m.jh(),B*=(qe=m.tc().jh())/q)),A.Ab.vr(this.hf,be,ue,F),C&&(q=m.tc().jh(),B*=(qe=_.tc().jh())/q),m=be;else{var Dt=new A.Ua(be.description);Dt.yD(be),q&&(A.Ab.wr(m,qe,Dt,F),C&&(q=m.jh(),B*=(qe=m.tc().jh())/q)),A.Ab.vr(this.hf,Dt,ue,F),C&&(q=m.tc().rm(),B*=(qe=_.tc().rm())/q),ue=NaN,Z?(De=_.mk(),ue=_.Bi()):isNaN(this.Dm)||(ue=this.Dm),q=W.vv(m)|W.vv(_),qe=10*oe.Yd(0),this.Wv&&(q=3,qe=0),m=A.Ab.PQ(be,m,Dt,oe,ue,b,q,qe)}return rt&&(m=A.Ab.SD(m,_,b)),Z&&(D||(Z=oe.Le().S(),m.Vg(0,0).S()>=Z-oe.Yd(0)&&(oe=De.getNorthPoleLocation(),Z=De.getSouthPoleLocation(),be=De.getNorthPoleGeometry(),De=De.getSouthPoleGeometry(),ue=0,be==A.Eg.PE_POLE_POINT&&oe!=A.Eg.PE_POLE_OUTSIDE_BOUNDARY&&(ue=1),De==A.Eg.PE_POLE_POINT&&Z!=A.Eg.PE_POLE_OUTSIDE_BOUNDARY&&(ue|=2),ue!==0&&(D=!0))),m=A.Ab.Hz(m,_,this.Sm,b),C&&(m=A.Zl.local().W(m,B,b)),A.Ab.Kx(_,m,F)),m.B()||(D&&(m=A.$l.local().W(m,_,!1,b)),T!=null&&(m=T.al(m,!1),this.yp(T,A.dm.reverse,m),m=T.bl(m,!1))),m},W.vv=function(T){if(T.Tb()!=2)return 0;var b=0,m=T.mk();T=m.getNorthPoleLocation();var _=m.getSouthPoleLocation(),C=m.getNorthPoleGeometry();return m=m.getSouthPoleGeometry(),C==A.Eg.PE_POLE_POINT&&T!=A.Eg.PE_POLE_OUTSIDE_BOUNDARY&&(b=1),m==A.Eg.PE_POLE_POINT&&_!=A.Eg.PE_POLE_OUTSIDE_BOUNDARY&&(b|=2),b},W.prototype.cW=function(T,b){var m=this.hf.ef,_=this.hf.$f,C=m.Tb(),D=_.Tb(),F=A.P.Hu(Math.min(T.I(),64)),B=A.Ua.kg(T);C==3&&(C=(m=(T=m.Li).hk()).Tb(),B=T.bl(B,!0),this.yp(T,A.dm.forward,B),B=T.al(B,!0)),T=null,D==3&&(D=(_=(T=_.Li).hk()).Tb());var q=C==2;C=(D=D==2)?_.tc():_;var Z=!D&&!this.Wv;if(q){if((B=A.Ab.OI(B,m,this.no,b)).B())return B}else{var oe=new A.l;B.yc(oe);var ue=m.Le();if((oe.Gue.H)&&(oe=A.l.construct(oe.v-1,ue.G,oe.C+1,ue.H),(B=A.ti.Pu(B,oe,m,NaN,0,b)).B()))return B}var be=NaN;q&&(be=m.Bi()),oe=_.Yr()!=null,ue=this.hH;var De=!isNaN(ue);if(De&&(B=A.Zl.local().W(B,ue,b)),this.WG)q&&A.Ab.wr(m,be,B,F),De&&(q=m.jh(),ue*=(be=m.tc().jh())/q),A.Ab.vr(this.hf,B,Z,F),De&&(q=m.tc().jh(),ue*=(be=_.tc().jh())/q),m=B;else{var qe=new A.Ua(B.description);qe.yD(B),q&&(A.Ab.wr(m,be,qe,F),De&&(q=m.jh(),ue*=(be=m.tc().jh())/q)),A.Ab.vr(this.hf,qe,Z,F),De&&(q=m.tc().jh(),ue*=(be=_.tc().jh())/q),Z=NaN,D?Z=_.Bi():isNaN(this.Dm)||(Z=this.Dm),q=W.vv(m)|W.vv(_),be=10*C.Yd(0),this.Wv&&(q=3,be=0),m=A.Ab.QQ(B,m,qe,C,Z,b,q,be)}return oe&&(m=A.Ab.SD(m,_,b)),D&&(m=A.Ab.Hz(m,_,this.Sm,b),De&&(m=A.Zl.local().W(m,ue,b)),A.Ab.Kx(_,m,F)),m.B()||T!=null&&(m=T.al(m,!1),this.yp(T,A.dm.reverse,m),m=T.bl(m,!1)),m},W.prototype.$V=function(T,b){var m=(T.da()+T.S())/400;return m!=0?(m=A.Zl.local().W(T,m,b),m=this.QI(m,b),b=T.Ja(),m.dn(b)):(b=new A.Ta(T.Kp()),m=this.SI(b),b=T.Ja(),m.B()?b.Pa():(T.copyTo(b),T=m.D(),b.L(T.x,T.y,T.x,T.y))),b},W.prototype.aW=function(T,b){T=A.ba.kg(T);var m=this.hf.ef,_=this.hf.$f,C=m.Tb(),D=_.Tb(),F=A.P.Hu(Math.min(T.I(),64));if(C==3){var B=m.Li;C=(m=B.hk()).Tb(),T=B.al(T,!0),this.yp(B,A.dm.forward,T),T=B.bl(T,!0)}if(C==2){if(this.no==A.ui.Clip?T=A.Zj.local().W(T,m.ol(),m,b):m.Xc()&&(C=new A.l,T.yc(C),m.Le().contains(C)||(this.no==A.ui.PannableFold&&(T=A.Ab.nj(T,m)),A.Ab.Lt(T,m.Le(),m.Yd(0),!0),T=A.Ab.Hn(T,m,0,!0,0,b))),T.B())return T;A.Ab.wr(m,0,T,F)}else A.Ab.Lt(T,m.Le(),m.Yd(0),!0);return A.Ab.vr(this.hf,T,!1,F),m=0,C=!1,B=null,D==3&&(C=!0,D=(_=(B=_.Li).hk()).Tb()),(D=D==2)?m=_.Bi():isNaN(this.Dm)||(m=this.Dm),D&&this.Sm!=A.ui.Clip||(T=A.Ab.Hn(T,_.tc(),m,!1,0,b)),D&&(T=A.Ab.Hz(T,_,this.Sm,b),A.Ab.Kx(_,T,F),T.B())||C&&(T=B.al(T,!0),this.yp(B,A.dm.reverse,T),T=B.bl(T,!0)),T},W.prototype.yp=function(T,b,m){var _=m.I();if(_!=0){for(var C=m.vb(0),D=A.P.mg(200,0),F=[],B=0;B<_;){var q=Math.min(100,_-B);C.Xw(2*B,2*q,D,2,!0);for(var Z=0;ZC.v+D&&Bb?this.yv(m,_):this.jv(m,_);case 1:var C=this.yv(m,_);return m=this.jv(m,_),A.mc.jq(C,m,b);case 2:throw A.i.ga("not implemented")}throw A.i.Ra()},T.prototype.ge=function(b,m){var _=this.qa-this.ta,C=this.ma-this.oa,D=_*_+C*C;return D==0?.5:(b=((b.x-this.ta)*_+(b.y-this.oa)*C)/D,m||(0>b?b=0:1(m=(m-this.oa)/b)||1(m=(m-this.ta)/b)||1(m=8881784197001252e-31*(Math.abs(_.x*m.y)+Math.abs(_.y*m.x)))?-1:b<-m?1:0},T.prototype.tp=function(b,m,_,C){var D=this.ta,F=this.oa,B=b-D,q=m-F;if((B=Math.sqrt(B*B+q*q))<=Math.max(_,6661338147750939e-31*B))return C&&B==0?NaN:0;if(B=b-this.qa,q=m-this.ma,(B=Math.sqrt(B*B+q*q))<=Math.max(_,6661338147750939e-31*B))return C&&B==0?NaN:1;if(B=this.qa-this.ta,q=this.ma-this.oa,0<(C=Math.sqrt(B*B+q*q))){var Z=1/C,oe=b-D,ue=m-F,be=oe*(B*=Z)+ue*(q*=Z),De=17763568394002505e-31*(Math.abs(oe*B)+Math.abs(ue*q)),qe=B;if(B=-q,q=qe,be<-(De=Math.max(_,De))||be>C+De)return NaN;if(Math.abs(oe*B+ue*q)<=Math.max(_,17763568394002505e-31*(Math.abs(oe*B)+Math.abs(ue*q)))&&(.5>=(B=A.P.Tk(be*Z,0,1))?(q=this.ta+(this.qa-this.ta)*B,C=this.oa+(this.ma-this.oa)*B):(q=this.qa-(this.qa-this.ta)*(1-B),C=this.ma-(this.ma-this.oa)*(1-B)),A.h.Jy(q,C,b,m)<=_)){if(.5>B){if(A.h.Jy(q,C,D,F)<=_)return 0}else if(A.h.Jy(q,C,this.qa,this.ma)<=_)return 1;return B}}return NaN},T.prototype.Nb=function(b){return b!=null&&(b==this||b.constructor===this.constructor&&this.AM(b))},T.prototype.mD=function(b,m,_){var C=_?this.ta:this.qa;_=_?this.oa:this.ma;var D=new A.h;return D.x=b.qa-C,D.y=b.ma-_,!(m.Sh(D)>6661338147750939e-31*m.aD(D))||(D.x=b.ta-C,D.y=b.oa-_,m.Sh(D)<=6661338147750939e-31*m.aD(D))},T.prototype.lD=function(b){var m=new A.h;return m.x=this.qa-this.ta,m.y=this.ma-this.oa,!!this.mD(b,m,!1)&&(m.Uq(),!!this.mD(b,m,!0))},T.IM=function(b,m){var _=b.wu(m.ta,m.oa),C=b.wu(m.qa,m.ma);return!(0>_&&0>C||0<_&&0_&&0>C||0<_&&0(C=m.Rb())?b.lD(m):m.lD(b)))},T.GM=function(b,m,_){var C=A.h.construct(NaN,NaN),D=b.qa-b.ta,F=b.ma-b.oa,B=m.qa-m.ta,q=m.ma-m.oa,Z=B*F-D*q;if(Z==0)return C;var oe=8881784197001252e-31*(Math.abs(B*F)+Math.abs(D*q)),ue=m.ta-b.ta,be=m.oa-b.oa,De=B*be-ue*q,qe=De/Z,rt=Math.abs(Z);return qe<-(B=(8881784197001252e-31*(Math.abs(B*be)+Math.abs(ue*q))*rt+oe*Math.abs(De))/(Z*Z)+2220446049250313e-31*Math.abs(qe))||qe>1+B||(B=(q=D*be-ue*F)/Z)<-(D=(8881784197001252e-31*(Math.abs(D*be)+Math.abs(ue*F))*rt+oe*Math.abs(q))/(Z*Z)+2220446049250313e-31*Math.abs(B))||B>1+D||(qe=A.P.Tk(qe,0,1),D=A.P.Tk(B,0,1),F=b.ic(qe),Z=m.ic(D),(oe=new A.h).vc(F,Z),oe.length()>_&&(oe.add(F,Z),oe.scale(.5),qe=b.ge(oe,!1),D=m.ge(oe,!1),b=b.ic(qe),m=m.ic(D),b.sub(m),b.length()>_)||C.na(qe,D)),C},T.JM=function(b,m,_,C){var D=0;if((b.ta==m.ta&&b.oa==m.oa||b.ta==m.qa&&b.oa==m.ma)&&(D++,!C))return 1;if(b.qa==m.ta&&b.ma==m.oa||b.qa==m.qa&&b.ma==m.ma){if(++D==2)return 2;if(!C)return 1}return m.xi(b.ta,b.oa,_)||m.xi(b.qa,b.ma,_)||b.xi(m.ta,m.oa,_)||b.xi(m.qa,m.ma,_)?1:C&&D!=0||T.IM(b,m)==0?0:1},T.Yx=function(b,m,_,C,D,F){var B=0,q=b.tp(m.ta,m.oa,F,!1),Z=b.tp(m.qa,m.ma,F,!1),oe=m.tp(b.ta,b.oa,F,!1),ue=m.tp(b.qa,b.ma,F,!1);return isNaN(q)||(C!=null&&(C[B]=q),D!=null&&(D[B]=0),_!=null&&(_[B]=A.h.construct(m.ta,m.oa)),B++),isNaN(Z)||(C!=null&&(C[B]=Z),D!=null&&(D[B]=1),_!=null&&(_[B]=A.h.construct(m.qa,m.ma)),B++),B==2||isNaN(oe)||q==0&&oe==0||Z==0&&oe==1||(C!=null&&(C[B]=0),D!=null&&(D[B]=oe),_!=null&&(_[B]=A.h.construct(b.ta,b.oa)),B++),B==2||isNaN(ue)||q==1&&ue==0||Z==1&&ue==1||(C!=null&&(C[B]=1),D!=null&&(D[B]=ue),_!=null&&(_[B]=A.h.construct(m.qa,m.ma)),B++),0C[1]&&(b=C[0],C[0]=C[1],C[1]=b,D!=null&&(C=D[0],D[0]=D[1],D[1]=C),_!=null&&(D=A.h.construct(_[0].x,_[0].y),_[0]=_[1],_[1]=D)),B):(B=T.GM(b,m,F),isNaN(B.x)?0:(_!=null&&(_[0]=b.ic(B.x)),C!=null&&(C[0]=B.x),D!=null&&(D[0]=B.y),1))},T.prototype.$F=function(){return 0},T.prototype.qp=function(){},T.prototype.toString=function(){return"Line: ["+this.ta.toString()+", "+this.oa.toString()+", "+this.qa.toString()+", "+this.ma.toString()+"]"},T}(A.NC);A.zb=ve}(le||(le={})),function(A){var ve=function(){function W(){this.Lm=[],this.za=-1}return W.prototype.Ma=function(){return this.za},W.prototype.next=function(){if(this.Lm!=null&&this.Lm.length!=0){this.za++;var T=this.Lm[0];return this.Lm=1>=this.Lm.length?[]:this.Lm.slice(1),T}return this.Lm=null},W.prototype.VX=function(T){this.Lm.push(T)},W.prototype.re=function(){},W}();A.bL=ve}(le||(le={})),function(A){var ve;(ve=A.NL||(A.NL={}))[ve.enumFillRuleOddEven=0]="enumFillRuleOddEven",ve[ve.enumFillRuleWinding=1]="enumFillRuleWinding";var W=function(T){function b(m,_){var C=T.call(this)||this;if(C.yf=!1,C.Gq=null,C.uq=0,C.tq=0,C.Cj=null,C.Og=!1,C.nb=null,C.mb=null,C.Se=null,C.Nj=null,C.Td=null,C.vq=0,C.gb=0,C.zq=0,_===void 0)C.yf=m,C.Og=!1,C.vq=0,C.uq=0,C.tq=0,C.xa=0,C.description=A.fe.pg();else{if(_==null)throw A.i.O();C.yf=m,C.Og=!1,C.vq=0,C.uq=0,C.tq=0,C.xa=0,C.description=_}return C.Cj=null,C.gb=0,C}return Le(b,T),b.prototype.vm=function(){return 0_)throw A.i.Ra();if(this.ec(m)){if(this.mb==null)throw A.i.Ra();var C=this.xa,D=this.Ca(m),F=this.Wc(m);this.fm(this.xa+1),this.oc();for(var B=0,q=this.description.Ba;Bm;_--)C=this.nb.read(_),this.nb.write(_,C+1);this.mb.FE(m,1)}},b.prototype.Cp=function(){if(this.vx(),m===void 0){this.Og=!1;var m=this.ea()-1}var _=this.mb.read(m);this.mb.write(m,1|_),this.Se!=null&&(m=this.Wc(m)-1,this.Se.write(m,1),this.Nj.write(m,-1))},b.prototype.ec=function(m){return(1&this.mb.read(m))!=0},b.prototype.Pn=function(m){if(this.ec(m))return!0;var _=this.Ca(m);return!(_>(m=this.Wc(m)-1))&&(_=this.Oa(_),m=this.Oa(m),_.rb(m))},b.prototype.Av=function(m){return(2&this.mb.read(m))!=0},b.prototype.pc=function(m,_){if(this.Ll(m.description),m.K()!=322)throw A.i.Ra();var C=new A.Ta;(_||this.B())&&(m.Vo(C),this.nf(C)),m.Ro(C),this.lineTo(C)},b.prototype.vp=function(m){var _=this.xa==0;this.rx(m.v,m.G),this.Aj(m.v,m.H),this.Aj(m.C,m.H),this.Aj(m.C,m.G),this.Cp(),this.Og=!1,_&&this.Nf(256,!1)},b.prototype.bd=function(m,_){if(!m.B()){for(var C=this.xa==0,D=new A.Ta(this.description),F=0;4>F;F++)m.If(_?4-F-1:F,D),F==0?this.nf(D):this.lineTo(D);this.Cp(),this.Og=!1,C&&!_&&this.Nf(256,!1)}},b.prototype.add=function(m,_){for(var C=0;C_&&(_=m.ea()-1),_>=m.ea()||0>C||0>D||D>m.tv(_))throw A.i.ga("index out of bounds");if(D!=0){var B=m.ec(_)&&C+D==m.tv(_);if(!B||D!=1){if(this.Og=!1,this.Ll(m.description),C=m.Ca(_)+C+1,F&&(D++,C--),B&&D--,B=this.xa,this.fm(this.xa+D),this.oc(),F){if(D==0)return;this.nb.add(this.xa),F=m.mb.read(_),F&=-5,this.yf&&(F|=1),this.mb.write(this.mb.size-1,F),this.mb.add(0)}else this.nb.write(this.mb.size-1,this.xa);F=0;for(var q=this.description.Ba;Fue||m.Aa[ue]==null?this.Aa[F].Nn(oe*B,A.sa.te(Z),D*oe,oe*B):this.Aa[F].On(oe*B,m.Aa[ue],oe*C,D*oe,!0,oe,oe*B)}if(this.vm()||m.Av(_))throw A.i.Ra();this.Qc(1993)}}},b.prototype.jJ=function(){for(var m=0,_=this.ea();m<_;m++)this.zW(m)},b.prototype.zW=function(m){if(this.oc(),m>=this.ea())throw A.i.O();var _=this.Ca(m),C=this.Ka(m);m=this.ec(m)?1:0;for(var D=0,F=this.description.Ba;Dm&&(m=_-1),m>=_)throw A.i.O();for(var C=this.Ca(m),D=this.Ka(m),F=0,B=this.description.Ba;F=_.ea())throw A.i.O();var F=this.ea();if(m>F)throw A.i.O();0>m&&(m=F),0>C&&(C=_.ea()-1),this.Og=!1,this.Ll(_.description),_.oc();var B=_.Ca(C),q=_.Ka(C),Z=this.xa,oe=_.ec(C)&&!D?1:0;this.fm(this.xa+q),this.oc();for(var ue=m=m+1;D--)B=this.nb.read(D-1),this.nb.write(D,B+q);for(_.Av(C),this.mb.add(0),D=F-1;D>=m+1;D--)F=this.mb.read(D),F&=-5,this.mb.write(D+1,F);F=_.ER().read(C),F&=-5,this.yf&&(F|=1),this.mb.write(m,F)},b.prototype.Cz=function(m,_){var C=-1,D=this.ea();if(C>D)throw A.i.O();0>C&&(C=D),this.Og=!1;var F=this.xa;this.fm(this.xa+_),this.oc();var B=C=C+1;F--)B=this.nb.read(F-1),this.nb.write(F,B+_);for(this.mb.add(0),F=D-1;F>=C+1;F--)_=this.mb.read(F),_&=-5,this.mb.write(F+1,_);this.yf&&this.mb.write(C,1)},b.prototype.lG=function(m,_,C){var D=-1;if(0>m&&(m=this.ea()),m>this.ea()||D>this.Ka(m)||C>_.length)throw A.i.ga("index out of bounds");if(C!=0){m==this.ea()&&(this.nb.add(this.xa),this.yf?this.mb.add(1):this.mb.add(0)),0>D&&(D=this.Ka(m)),this.oc();var F=this.xa;this.fm(this.xa+C),this.oc();for(var B=0,q=this.description.Ba;Bm&&(m=this.ea()),m>=D||_>this.Ka(m))throw A.i.ga("index out of bounds");m==this.ea()&&(this.nb.add(this.xa),this.yf?this.mb.add(1):this.mb.add(0)),0>_&&(_=this.Ka(m));var F=this.xa;this.fm(this.xa+1),this.oc();var B=this.Ca(m);this.Aa[0].xj(2*(B+_),C,2*F),C=1;for(var q=this.description.Ba;Cm&&(m=C-1),m>=C||_>=this.Ka(m))throw A.i.ga("index out of bounds");this.oc();var D=this.Ca(m);0>_&&(_=this.Ka(m)-1),_=D+_,D=0;for(var F=this.description.Ba;D=m+1;C--)_=this.nb.read(C),this.nb.write(C,_-1);this.xa--,this.Rg--,this.Qc(1993)},b.prototype.pE=function(m,_,C,D){if(m=this.Ca(m)+_,(C=this.Ca(C)+D)m||C>this.I()-1)throw A.i.O();_=0,(D=this.Ha()).Wb(m);do{for(;D.Ia()&&(m=D.ia(),D.xb()!=C);)_+=m=m.Rb();if(D.xb()==C)break}while(D.ab());return _},b.prototype.aO=function(m,_,C){if(_=this.Ca(m)+_,C=this.Ca(m)+C,0>_||C>this.I()-1)throw A.i.O();var D=this.Ha();if(_>C){if(!this.ec(m))throw A.i.O("cannot iterate across an open path");D.EB()}var F=m=0;D.Wb(_);do F+=m,m=D.ia().Rb();while(D.xb()!=C);return F},b.prototype.ng=function(){return A.si.im(this,null)},b.prototype.FS=function(m,_,C){for(var D=m;D_){var B=this.vm(),q=0;_=this.xa}else B=this.Av(_),q=this.Ca(_),_=this.Wc(_);for(;q<_;q++){if(D.x=C.read(2*q),D.y=C.read(2*q+1),B){var Z=this.Nj.read(q);if(0<=Z)switch(7&this.Se.read(q)){case 2:F.x=this.Td.read(Z),F.y=this.Td.read(Z+1),m.Gh(F,F),this.Td.write(Z,F.x),this.Td.write(Z+1,F.y),F.x=this.Td.read(Z+3),F.y=this.Td.read(Z+4),m.Gh(F,F),this.Td.write(Z+3,F.x),this.Td.write(Z+4,F.y);break;case 4:throw A.i.Ra()}}m.Gh(D,D),C.write(2*q,D.x),C.write(2*q+1,D.y)}this.Qc(1993)}},b.prototype.rN=function(m){if(!this.B()){this.se(1),this.oc();for(var _=this.Aa[0],C=this.Aa[1],D=new A.Od,F=new A.Od,B=this.vm(),q=0;q=this.Ca(_))return _;_--}else _++;if(0<=_&&_=this.Ca(_)&&mC){for(_=0;__;){var D=_+(C-_>>1);if(m=(_=this.Wc(D))))return this.gb=D;_=D+1}}return this.gb=_},b.prototype.sz=function(){var m=this.I();if(!this.yf){m-=this.ea();for(var _=0,C=this.ea();_C.MR()))return!0;this.Cb.tD(null)}return C=A.Mx.create(this,m,_),this.Cb.tD(C),!0},b.prototype.dc=function(){var m=T.prototype.dc.call(this);if(!this.Bc()){var _=this.ea();this.nb!=null&&this.nb.Cn(m,0,_+1),this.mb!=null&&this.mb.Cn(m,0,_)}return m},b.prototype.UF=function(m){return this.Se!=null?this.Se.read(m):1},b.prototype.cc=function(m,_,C){var D=this.nz(m);if(m==this.Wc(D)-1&&!this.ec(D))throw A.i.ga("index out of bounds");this.oc();var F=this.Se,B=1;if(F!=null&&(B=7&F.read(m)),B!==1)throw A.i.Ra();if(_.Qr(),_=_.get(),C?_.Pf(A.fe.pg()):_.Pf(this.description),D=m==this.Wc(D)-1&&this.ec(D)?this.Ca(D):m+1,F=new A.h,this.D(m,F),_.Ec(F),this.D(D,F),_.Rc(F),!C)for(C=1,F=this.description.Ba;C=this.ea())throw A.i.O();if(this.B())_.Pa();else{if(this.Av(m))throw A.i.ga("not implemented");var C=this.vb(0),D=new A.h,F=new A.l;F.Pa();var B=this.Ca(m);for(m=this.Wc(m);Bthis.I())&&(m=A.ua.iE(this),this.Cb.RM(m),!0)},b.prototype.cM=function(){if(this.Cb==null&&(this.Cb=new A.Wk),this.Cb.Bo==null){this.Cb.sD(null);var m=A.ua.TN(this);this.Cb.sD(m)}},b.prototype.$o=function(m){this.zq=m},b.prototype.Kn=function(){return this.zq},b.prototype.yD=function(m){if(this==m)throw A.i.ga("MultiPathImpl.add");for(var _=this.ea(),C=0;C=(_=this.Wc(_))||m_?b.I():_,0>m||m>b.I()||_m?_:m,0>_||0>m)throw A.i.O();if(m!=0){_=m-0,m=this.xa,this.resize(this.xa+_);for(var C=0;C<_;C++)this.Db(m+C,b[0+C])}},T.prototype.yB=function(b){if(0>b||b>=this.I())throw A.i.ga("index out of bounds");this.oc();for(var m=0,_=this.description.Ba;m<_;m++)if(this.Aa[m]!=null){var C=A.sa.Wa(this.description.Fd(m));this.Aa[m].Gn(C*b,C,C*this.xa)}this.xa--,this.Rg--,this.Qc(1993)},T.prototype.resize=function(b){this.fm(b)},T.prototype.qp=function(){},T.prototype.Pa=function(){W.prototype.rD.call(this)},T.prototype.Pc=function(b){if(b instanceof A.Ed){if(this.B())return;this.oc();for(var m=this.Aa[0],_=new A.h,C=0;Cm||m>=this.xa||_b?b:W},ve.Vh=function(W,T){var b=5381;return((b=((b=((b=T!==void 0?(T<<5)+T+(255&W):(b<<5)+b+(255&W))<<5)+b+(W>>8&255))<<5)+b+(W>>16&255))<<5)+b+(W>>24&255)&2147483647},ve.wj=function(){throw Error("Not Implemented")},ve.XA=function(W){return ve.WT(W)+12345&2147483647},ve.SG=function(W){var T=32,b=W%ve.Px|0,m=W/ve.Px|0;return(T&=63)==0?W:(32>T?(W=b>>>T|m<<32-T,T=m>>T):(W=m>>T-32,T=0<=m?0:-1),T*ve.Px+(W>>>0))},ve.WT=function(W){var T=1103515245,b=65535&T;return((T-b)*(W|=0)|0)+(b*W|0)|0},ve.truncate=function(W){return 0>W?-1*Math.floor(Math.abs(W)):Math.floor(W)},ve.MAX_SAFE_INTEGER=Math.pow(2,53)-1,ve.MIN_SAFE_INTEGER=-ve.MAX_SAFE_INTEGER,ve.QC=65536,ve.Px=ve.QC*ve.QC,ve}()}(le||(le={})),function(A){var ve;(ve=A.xL||(A.xL={}))[ve.Project=0]="Project",ve[ve.Union=1]="Union",ve[ve.Difference=2]="Difference",ve[ve.Proximity2D=3]="Proximity2D",ve[ve.Relate=4]="Relate",ve[ve.Equals=5]="Equals",ve[ve.Disjoint=6]="Disjoint",ve[ve.Intersects=7]="Intersects",ve[ve.Within=8]="Within",ve[ve.Contains=9]="Contains",ve[ve.Crosses=10]="Crosses",ve[ve.Touches=11]="Touches",ve[ve.Overlaps=12]="Overlaps",ve[ve.Buffer=13]="Buffer",ve[ve.Distance=14]="Distance",ve[ve.Intersection=15]="Intersection",ve[ve.Clip=16]="Clip",ve[ve.Cut=17]="Cut",ve[ve.DensifyByLength=18]="DensifyByLength",ve[ve.DensifyByAngle=19]="DensifyByAngle",ve[ve.LabelPoint=20]="LabelPoint",ve[ve.GeodesicBuffer=21]="GeodesicBuffer",ve[ve.GeodeticDensifyByLength=22]="GeodeticDensifyByLength",ve[ve.ShapePreservingDensify=23]="ShapePreservingDensify",ve[ve.GeodeticLength=24]="GeodeticLength",ve[ve.GeodeticArea=25]="GeodeticArea",ve[ve.Simplify=26]="Simplify",ve[ve.SimplifyOGC=27]="SimplifyOGC",ve[ve.Offset=28]="Offset",ve[ve.Generalize=29]="Generalize",ve[ve.SymmetricDifference=30]="SymmetricDifference",ve[ve.ConvexHull=31]="ConvexHull",ve[ve.Boundary=32]="Boundary",ve[ve.SimpleRelation=33]="SimpleRelation";var W=function(){function T(){}return T.prototype.K=function(){return null},T.prototype.yn=function(){},T.prototype.Ku=function(){return!1},T}();A.Ge=W}(le||(le={})),function(A){var ve=function(W){function T(){return W!==null&&W.apply(this,arguments)||this}return Le(T,W),T.prototype.K=function(){return 13},T.local=function(){return T.instance===null&&(T.instance=new T),T.instance},T.prototype.W=function(b,m,_,C,D){return b instanceof A.ba?(D=new A.$c(b),this.W(D,m,[_],!1,C).next()):C===!0?(_=new A.wC(b,m,_,!1,D),A.Ih.local().W(_,m,D)):new A.wC(b,m,_,!1,D)},T.instance=null,T}(A.Ge);A.vC=ve}(le||(le={})),function(A){var ve=function(){function W(T,b,m,_,C){this.za=-1,this.Sd=T,this.Vz=b,this.Es=m,this.nT=new A.l,this.nT.Pa(),this.ho=-1,this.Vb=C}return W.prototype.next=function(){for(var T;(T=this.Sd.next())!=null;)return this.za=this.Sd.Ma(),this.ho+1=T.I():T.ea()==1&&(2>=T.I()||A.au.EG(T,0)))},W}();A.yC=ve}(le||(le={})),function(A){var ve=function(W){function T(){return W!==null&&W.apply(this,arguments)||this}return Le(T,W),T.prototype.K=function(){return 17},T.local=function(){return T.instance===null&&(T.instance=new T),T.instance},T.prototype.W=function(b,m,_,C,D){return new A.iL(b,m,_,C,D)},T.instance=null,T}(A.Ge);A.hL=ve}(le||(le={})),function(A){var ve=function(){function W(T,b,m,_,C){if(this.Vf=null,b==null||m==null)throw A.i.ga("invalid argument");this.kT=T,this.iA=b,this.gH=m,T=A.ua.ov(b,m),this.ra=A.ua.Xd(_,T,!0),this.fH=-1,this.od=C}return W.prototype.Ma=function(){return 0},W.prototype.next=function(){return this.MQ(),++this.fHthis.Vf.length&&(this.Vf.length=0)},W.prototype.NQ=function(){var T=new A.ja(0),b=new A.hd,m=b.WE(),_=b.Ib(this.iA),C=b.Ib(this.gH),D=new A.Hg;try{D.Gt(b,this.ra,this.od),D.fl(m,_,C,T);var F=b.Ke(_),B=new A.Ea,q=new A.Ea;for(this.Vf.length=0,this.Vf.push(B),this.Vf.push(q),_=0;_=m)throw A.i.O();return new A.jL(b,m,_)},T.instance=null,T}(A.Ge);A.Zl=ve}(le||(le={})),function(A){var ve=function(){function W(T,b){this.za=-1,this.Sd=T,this.Rs=b}return W.prototype.Ma=function(){return this.za},W.prototype.next=function(){var T;return(T=this.Sd.next())!=null?(this.za=this.Sd.Ma(),this.IP(T)):null},W.prototype.IP=function(T){if(T.B()||1>T.Eb())return T;var b=T.K();if(b==1736||b==1607)return this.Iy(T);if(A.ba.zd(b))return this.KP(T);if(b==197)return this.JP(T);throw A.i.Ra()},W.prototype.KP=function(T){if(T.Rb()<=this.Rs)return T;var b=new A.Ua(T.description);return b.pc(T,!0),this.Iy(b)},W.prototype.JP=function(T){var b=new A.Ea(T.description);b.bd(T,!1);var m=new A.l;return T.A(m),T=m.da(),m.S()<=this.Rs&&T<=this.Rs?b:this.Iy(b)},W.prototype.Iy=function(T){for(var b=T.Ja(),m=T.Ha();m.ab();)for(var _=!0;m.Ia();){var C=m.ia();if(C.K()!=322)throw A.i.ga("not implemented");var D=m.Qn(),F=C.Rb();if(F>this.Rs){var B=Math.ceil(F/this.Rs);F=new A.Ta(T.description),_&&(C.Vo(F),b.nf(F));var q=_=1/B,Z=0;for(--B;ZF)return b;var B=b.K(),q=m.K(),Z=new A.l,oe=new A.l,ue=new A.l;b.A(Z),m.A(oe),ue.L(Z),ue.$b(oe);var be=(ue=A.ua.Xd(_,ue,!0))*Math.sqrt(2)*1.00001,De=new A.l;if(De.L(Z),De.X(be,be),!De.isIntersecting(oe))return b;if(D==1&&F==2)return T.FV(b,m,q,_,C);if(B==33)switch(A.Xk.zd(q)?(_=new A.Ua(m.description),_.pc(m,!0)):_=m,q){case 1736:return T.SU(b,_,ue);case 1607:return T.TU(b,_,ue);case 550:return T.QU(b,_,ue);case 197:return T.PU(b,_,ue);case 33:return T.RU(b,_,ue);default:throw A.i.O()}else if(B==550)switch(q){case 1736:return T.iU(b,m,ue);case 197:return T.gU(b,m,ue);case 33:return T.hU(b,m,ue)}return A.Hg.km(b,m,_,C)},T.SU=function(b,m,_){return A.jd.FG(m,b,_)==0?b:b.Ja()},T.TU=function(b,m,_){var C=b.D();m=m.Ha();for(var D=_*Math.sqrt(2)*1.00001,F=D*D,B=new A.l;m.ab();)for(;m.Ia();){var q=m.ia();if(q.A(B),B.X(D,D),B.contains(C)){if(q.ss(C,_))return b.Ja();var Z=q.bc();if(A.h.zc(C,Z)<=F||(Z=q.xc(),A.h.zc(C,Z)<=F))return b.Ja()}}return b},T.QU=function(b,m,_){var C=m.vb(0);m=m.I();var D=b.D(),F=new A.h;_=_*Math.sqrt(2)*1.00001,_*=_;for(var B=0;Bm.I()?this.bE(b,m,_):(this.Pt(),b=this.bE(m,b,_),this.Pt(),b):b.K()==550&&A.ba.Ic(m.K())?(b=this.cE(m,b,_),this.Pt(),b):m.K()==550&&A.ba.Ic(b.K())?this.cE(b,m,_):b.K()==550&&m.K()==550?b.I()>m.I()?this.dE(b,m):(this.Pt(),b=this.dE(m,b),this.Pt(),b):0},T.prototype.bE=function(b,m,_){var C=b.Ha(),D=m.Ha(),F=new A.l,B=new A.l,q=17976931348623157e292;if(!_&&this.lY(b,m,C,D))return 0;for(;C.ab();)for(;C.Ia();)if((b=C.ia()).A(F),!(F.px(this.qh)>q)){for(;D.ab();)for(;D.Ia();)if((m=D.ia()).A(B),F.px(B)F)){for(var oe=0;oeC)){for(var oe=0;oeT.Ka(b))){var C=T.Ca(b),D=T.Wc(b)-1,F=T.vb(0),B=T.ec(b),q=new A.ja(0);q.Jb(T.Ka(b)+1);var Z=new A.ja(0);for(Z.Jb(T.Ka(b)+1),q.add(B?C:D),q.add(C),C=new A.h;1this.yH&&B>D&&(C=_,D=B)}return C},W.prototype.re=function(){},W}();A.mL=ve}(le||(le={})),function(A){var ve=function(W){function T(){return W!==null&&W.apply(this,arguments)||this}return Le(T,W),T.prototype.K=function(){return 29},T.prototype.W=function(b,m,_,C){return b instanceof A.ba?(b=new A.$c(b),this.W(b,m,_,C).next()):new A.mL(b,m,_,C)},T.local=function(){return T.instance===null&&(T.instance=new T),T.instance},T.instance=null,T}(A.Ge);A.zC=ve}(le||(le={})),function(A){var ve=function(W){function T(){return W!==null&&W.apply(this,arguments)||this}return Le(T,W),T.prototype.K=function(){return 21},T.local=function(){return T.instance===null&&(T.instance=new T),T.instance},T.prototype.W=function(b,m,_,C,D,F,B,q){return b instanceof A.ba?(q=new A.$c(b),this.W(q,m,_,[C],D,F,!1,B).next()):B===!0?(_=new A.BC(b,m,_,C,D,!1,!1,q),A.Ih.local().W(_,m,q)):new A.BC(b,m,_,C,D,!1,!1,q)},T.instance=null,T}(A.Ge);A.AC=ve}(le||(le={})),function(A){var ve=function(){function W(T,b,m,_,C,D,F,B){if(D)throw A.i.Fe();if(b==null)throw A.i.O();this.za=-1,this.Os=T,this.wg=b,this.Ae=m,this.Es=_,this.bo=C,this.ho=-1,this.Vb=B,this.oT=new A.l,this.oT.Pa()}return W.prototype.next=function(){for(var T;(T=this.Os.next())!=null;)return this.za=this.Os.Ma(),this.ho+1b.Eb())return 0;if(_==4)throw A.i.Fe();var C=A.cb.tc(m),D=A.cb.xv(C),F=A.cb.gv(C);D*=2-D;var B=C.Id().ci,q=b.K();if(q==1736||q==197)var Z=b.ng();else A.ba.zd(q)?(Z=new A.Ua(b.description)).pc(b,!0):Z=b;if(C.Nb(m)==0){if(A.cb.Xc(m)){Z=A.Jh.nj(Z,m),q==1607&&Z==b&&(Z=A.ba.kg(b)),b=new A.Oc,A.cb.ih(m).en(b),q=0;for(var oe=Z.I();q=this.Hi||7C||m==0&&b==550&&this.Fj==33?this.iJ():W.CB(T,_);if((this.Hi==-1||this.Hi==4)&&b==197&&this.Fj==197)return m=this.Pe,b=new A.l,T.A(b),_=new A.l,m.A(_),b.Fa(_),m=new A.Hh,T.copyTo(m),m.Zo(b),m;if(b==197&&A.ba.uf(this.Fj)==0||this.Fj==197&&A.ba.uf(b)==0)return _=b==197?T:this.Pe,T=b==197?this.Pe:T,b=new A.l,_.A(b),A.Vd.clip(T,b,m,0);if(A.ba.uf(b)==0&&0B&&(B=m.sz()),D=m.I()+_.I(),B*_.I()>Math.log(D)*D*4)return null;D=null,B=_.Ha(),q!=null&&q.Gb!=null&&(D=q.Gb),D==null&&20<_.I()&&(D=A.ua.iE(_)),T=T.Ja(),_=null,q=m.Ha(),Z=[0,0,0,0,0,0,0,0,0],oe=new A.ce(0),ue=new A.jg,be=-1;for(var De=0,qe=0,rt=0Ke){if(D!=null)for(_==null?_=D.qR(Ot,C):_.Wo(Ot,C),Ke=_.next();Ke!=-1;Ke=_.next()){B.Wb(D.ka(Ke)),Ke=B.ia();var ei=Ot.Fa(Ke,null,Z,null,C);for(Ke=0;KeVt?(be=q.xb()-m.Ca(Dt),De=1,Vt=Vt==0?3:2):De++:(T.pc(Jt,Vt==0),Vt=1);break;case 0:Vt=0,be=-1,De=0;break;default:return null}Jt=ti}}}else{if(0>(Ke=this.LD(b,Ot.bc(),C)))return null;Ke==1?(2>Vt&&(be=q.xb()-m.Ca(Dt),Vt=Vt==0?3:2),De++):(be=-1,De=0)}oe.clear(!1)}else Ke!=0&&Ke==1&&(Vt==0?(Vt=3,be=q.xb()-m.Ca(Dt)):Vt==1?(Vt=2,be=q.xb()-m.Ca(Dt)):De++)}2<=Vt&&(T.Fr(m,Dt,be,De,Vt==3),be=-1)}return T},W.prototype.LD=function(T,b,m){return A.Fg.ym(T,b,m)},W.prototype.MD=function(T,b,m){var _=b.bc();b=b.xc();var C=A.Fg.ym(T,_,m),D=A.Fg.ym(T,b,m);return C==1&&D==0||C==0&&D==1?-1:C==0||D==0?0:C==1||D==1?1:((C=new A.h).add(_,b),C.scale(.5),(T=A.Fg.ym(T,C,m))==0?0:T==1?1:-1)},W.CB=function(T,b){return b?T:T.Ja()},W.prototype.iJ=function(){return this.tH==null&&(this.tH=this.Pe.Ja()),this.tH},W.prototype.re=function(){},W}();A.CC=ve}(le||(le={})),function(A){var ve=function(W){function T(){return W!==null&&W.apply(this,arguments)||this}return Le(T,W),T.prototype.K=function(){return 28},T.local=function(){return T.instance===null&&(T.instance=new T),T.instance},T.prototype.W=function(b,m,_,C,D,F,B){return b instanceof A.ba?(b=new A.$c(b),this.W(b,m,_,C,D,F,B).next()):new A.sL(b,m,_,C,D,F,B)},T.instance=null,T}(A.Ge);A.DC=ve}(le||(le={})),function(A){var ve=function(){function W(T,b,m,_,C,D,F){this.za=-1,this.Sd=T,this.Oj=b,this.La=m,this.Mi=_,this.xA=C,this.pH=D,this.od=F}return W.prototype.next=function(){var T=this.Sd.next();return T!=null?(this.za=this.Sd.Ma(),this.eL(T)):null},W.prototype.Ma=function(){return this.za},W.prototype.eL=function(T){var b=0>=this.pH?A.ua.mj(this.Oj,T,!1):this.pH;return A.DK.W(T,this.La,this.Mi,this.xA,b,this.od)},W.prototype.re=function(){},W}();A.sL=ve}(le||(le={})),function(A){var ve;(ve=A.IK||(A.IK={}))[ve.clipToDomainOnly=1]="clipToDomainOnly",ve[ve.clipWithHorizon=2]="clipWithHorizon",ve[ve.foldAndClipWithHorizon=3]="foldAndClipWithHorizon";var W=function(T){function b(){return T!==null&&T.apply(this,arguments)||this}return Le(b,T),b.prototype.K=function(){return 0},b.local=function(){return b.instance===null&&(b.instance=new b),b.instance},b.prototype.W=function(m,_,C){return m instanceof A.ba?(m=new A.$c(m),this.W(m,_,C).next()):new A.tL(m,_,C)},b.prototype.transform=function(m,_,C,D){return A.du.transform(m,_,C,D,!0)},b.prototype.St=function(m,_,C,D){return A.du.St(m,_,C,D)},b.instance=null,b}(A.Ge);A.Gx=W}(le||(le={})),function(A){var ve=function(){function W(T,b,m){this.za=-1,this.Sd=T,this.HT=b,this.od=m}return W.prototype.next=function(){var T=this.Sd.next();return T!=null?(this.za=this.Sd.Ma(),A.du.Bh(T,this.HT,this.od)):null},W.prototype.Ma=function(){return this.za},W.prototype.re=function(){},W}();A.tL=ve}(le||(le={})),function(A){var ve=function(){function T(){}return T.prototype.reset=function(){this.rh=this.zk=-1,this.ws=this.mq=!1},T.prototype.vQ=function(b,m,_){for(b.Wb(m,_);b.Ia();){var C=b.ia();if((C=C.Rb())!=0)return b.xb()}for(b.Wb(m,_);b.zz();)if((C=(C=b.ni()).Rb())!=0)return b.xb();return-1},T.prototype.wQ=function(b,m){for(b.Wb(m,-1);b.zz();)if(b.ni().Rb()!=0)return b.xb();return-1},T.prototype.uQ=function(b,m){for(b.Wb(m,-1),b.ia();b.Ia();)if(b.ia().Rb()!=0)return b.xb();return-1},T.prototype.tQ=function(b,m,_,C){if(this.zk=this.vQ(m,_,C),this.zk!=-1){m.Wb(this.zk,-1);var D=m.ia(),F=D.ic(D.ge(b,!1));if(_=A.h.zc(F,b),(C=new A.h).N(F),C.sub(D.bc()),(F=new A.h).N(b),F.sub(D.bc()),this.mq=0>C.yi(F),this.rh=this.uQ(m,this.zk),this.rh!=-1){m.Wb(this.rh,-1);var B=(D=m.ia()).ge(b,!1);B=D.ic(B);var q=A.h.zc(B,b);q>_?this.rh=-1:(C.N(B),C.sub(D.bc()),F.N(b),F.sub(D.bc()),this.ws=0>C.yi(F))}this.rh==-1&&(this.rh=this.wQ(m,this.zk),this.rh!=-1&&(m.Wb(this.rh,-1),B=(D=m.ia()).ge(b,!1),B=D.ic(B),(q=A.h.zc(B,b))>_?this.rh=-1:(C.N(B),C.sub(D.bc()),F.N(b),F.sub(D.bc()),this.ws=0>C.yi(F),b=this.zk,this.zk=this.rh,this.rh=b,b=this.mq,this.mq=this.ws,this.ws=b)))}},T.prototype.YN=function(b,m,_,C,D){return _=_.Ha(),this.tQ(b,_,C,D),this.zk!=-1&&this.rh==-1?this.mq:this.zk!=-1&&this.rh!=-1?this.mq==this.ws?this.mq:(_.Wb(this.zk,-1),b=_.ia().lg(),_.Wb(this.rh,-1),m=_.ia().lg(),0<=b.yi(m)):m},T}(),W=function(T){function b(){return T!==null&&T.apply(this,arguments)||this}return Le(b,T),b.local=function(){return b.instance===null&&(b.instance=new b),b.instance},b.prototype.K=function(){return 3},b.prototype.iz=function(m,_,C){var D;if(D===void 0&&(D=!1),m.B())return new A.bm;_=_.D();var F=m,B=m.K();switch(B==197&&((F=new A.Ea).bd(m,!1),B=1736),B){case 33:return this.sI(F,_);case 550:return this.eI(F,_);case 1607:case 1736:return this.XT(F,_,C,D);default:throw A.i.ga("not implemented")}},b.prototype.jz=function(m,_){if(m.B())return new A.bm;_=_.D();var C=m,D=m.K();switch(D==197&&((C=new A.Ea).bd(m,!1),D=1736),D){case 33:return this.sI(C,_);case 550:case 1607:case 1736:return this.eI(C,_);default:throw A.i.ga("not implemented")}},b.prototype.kz=function(m,_,C,D){if(0>D)throw A.i.O();if(m.B())return[];_=_.D();var F=m,B=m.K();switch(B==197&&((F=new A.Ea).bd(m,!1),B=1736),B){case 33:return this.OU(F,_,C,D);case 550:case 1607:case 1736:return this.oU(F,_,C,D);default:throw A.i.ga("not implemented")}},b.prototype.XT=function(m,_,C,D){if(m.K()==1736&&C&&(C=new A.l,m.A(C),C=A.ua.Xd(null,C,!1),(D?A.jd.Zd(m,_,0):A.jd.Zd(m,_,C))!=0)){var F=new A.bm(_,0,0);return D&&F.RJ(!0),F}var B=m.Ha();F=new A.h;for(var q=C=-1,Z=17976931348623157e292,oe=0;B.ab();)for(;B.Ia();){var ue=B.ia();ue=ue.ic(ue.ge(_,!1));var be=A.h.zc(ue,_);beA.h.Wq(_,ue.bc(),ue.xc()),1=_||(m.length=D),m.slice(0)},b.instance=null,b}(A.Ge);A.Hx=W}(le||(le={})),function(A){var ve=function(W){function T(){return W!==null&&W.apply(this,arguments)||this}return Le(T,W),T.prototype.K=function(){return 4},T.prototype.W=function(b,m,_,C,D){return A.cm.tB(b,m,_,C,D)},T.local=function(){return T.instance===null&&(T.instance=new T),T.instance},T.prototype.Ku=function(b){return A.Xt.ry(b)},T.prototype.yn=function(b,m,_){A.Xt.xD(b,m,_)},T.instance=null,T}(A.Ge);A.uL=ve}(le||(le={})),function(A){var ve=function(W){function T(){return W!==null&&W.apply(this,arguments)||this}return Le(T,W),T.prototype.K=function(){return 33},T.prototype.W=function(b,m,_,C,D){return b===1073741824?!A.vd.uB(m,_,C,4,D):A.vd.uB(m,_,C,b,D)},T.local=function(){return T.instance===null&&(T.instance=new T),T.instance},T.prototype.Ku=function(b){return A.Xt.ry(b)},T.prototype.yn=function(b,m,_){A.Xt.xD(b,m,_)},T.instance=null,T}(A.Ge);A.fj=ve}(le||(le={})),function(A){var ve=function(){function W(T,b,m,_){if(this.od=_,this.lT=m,this.za=-1,T==null)throw A.i.O();this.Ak=T,this.Oj=b}return W.prototype.next=function(){var T;if((T=this.Ak.next())!=null){if(this.za=this.Ak.Ma(),this.od!=null&&!this.od.progress(-1,-1))throw A.i.hu("user_canceled");return this.$B(T)}return null},W.prototype.Ma=function(){return this.za},W.prototype.$B=function(T){if(T==null)throw A.i.O();return A.Ix.YJ(T,this.Oj,this.lT,this.od)},W.prototype.re=function(){},W}();A.vL=ve}(le||(le={})),function(A){var ve=function(W){function T(){return W!==null&&W.apply(this,arguments)||this}return Le(T,W),T.prototype.K=function(){return 26},T.prototype.W=function(b,m,_,C){return b instanceof A.ba?(b=new A.$c(b),this.W(b,m,_,C).next()):new A.vL(b,m,_,C)},T.prototype.ts=function(b,m,_,C,D){return 0<(C!==void 0?A.Ix.ts(b,m,_,C,D):A.Ix.ts(b,m,!1,null,_))},T.local=function(){return T.instance===null&&(T.instance=new T),T.instance},T.instance=null,T}(A.Ge);A.$l=ve}(le||(le={})),function(A){var ve=function(){function D(){this.Aq=0}return D.prototype.iX=function(F){this.Aq&=-2,this.Aq|=F?1:0},D.prototype.Yp=function(){return(1&this.Aq)!=0},D.prototype.SF=function(){return this.Yp()?0:1},D}();A.tY=ve;var W=function(){},T=function(D,F,B,q){this.x=D,this.y=F,this.Ci=B,this.zm=q},b=function(){function D(F){this.Ce=F}return D.prototype.compare=function(F,B,q){return F=F.ka(q),B=this.Ce.lf.read(2*B),0>(B-=F=this.Ce.lf.read(2*F))?-1:0ue?1:0},D}(),_=function(){function D(F,B){this.TI=new A.h,this.parent=F,this.ZR=B}return D.prototype.qr=function(F,B,q){var Z=this.parent,oe=this.ZR;q.Wd(F,B,function(ue,be){return Z.Oh(ue,be,oe)})},D.prototype.bq=function(F){return F=this.parent.ii.get(F),this.parent.lf.uc(2*(F>>1),this.TI),this.TI.y+(1&F?this.parent.Qj:-this.parent.Qj)},D}(),C=function(){function D(F,B,q,Z,oe){this.iH=F.description,this.Y=F,this.Sg=B,this.Qj=A.ua.mj(this.Sg,F,!1),this.Do=A.ua.mj(this.Sg,F,!0),this.sA=q,this.jT=this.iH.Ba,this.hb=[],this.ro=[],this.oh=new A.lp,this.fb=new A.$j,this.le=new A.Nd,this.UG=this.sl=oe}return D.prototype.$S=function(){return this.UG=!0,(!A.ba.Ic(this.Y.K())||this.BE()&&this.yE(!1))&&this.hO()?A.ba.Ic(this.Y.K())?this.kO()?this.Y.K()==1607?this.mO()?2:0:this.nO()?this.oO():0:0:2:0},D.prototype.fC=function(F,B){var q=this.lf.read(2*F);F=this.lf.read(2*F+1);var Z=this.lf.read(2*B);B=this.lf.read(2*B+1);var oe=!A.$t.Ev(q,F,Z,B,this.Qj*this.Qj);return oe||this.Y.Eb()!=0&&q==Z&&F==B},D.prototype.BE=function(){for(var F=this.Y,B=F.yf?3:2,q=0,Z=F.ea();qthis.Qj)){if(F&&Z){var ue=oe.yv(1,0);if(oe=oe.yv(1,0),Math.abs(oe-ue)>B)continue}return this.le=new A.Nd(2,q.xb(),-1),!1}}return!0},D.prototype.hO=function(){var F=this.Y,B=null;A.ba.Ic(this.Y.K())&&(B=this.Y);var q=(this.UG||this.sl)&&B!=null,Z=F.I();this.lf=F.vb(0),this.ii=new A.ja(0),this.ii.Jb(2*Z),this.hi=new A.ja(0),this.hi.Jb(2*Z),q&&(this.Hl==null&&(this.Hl=new A.ja(0)),this.Hl.Jb(Z));for(var oe=F=0;oe=B.Wc(F);)F++;this.Hl.add(F)}for(new A.Zt().sort(this.hi,0,2*Z,new _(this,q)),this.fb.clear(),this.fb.Xo(new b(this)),this.fb.Ee(Z),B=0,Z*=2;B>1,(1&F)==0){if(F=this.fb.addElement(q,-1),(oe=this.fb.xe(F))!=-1&&!this.fC(this.fb.ka(oe),q))return this.le=new A.Nd(3,q,this.fb.ka(oe)),!1;var ue=this.fb.lb(F);if(ue!=-1&&!this.fC(this.fb.ka(ue),q))return this.le=new A.Nd(3,q,this.fb.ka(ue)),!1}else if(F=this.fb.search(q,-1),oe=this.fb.xe(F),ue=this.fb.lb(F),this.fb.wd(F,-1),oe!=-1&&ue!=-1&&!this.fC(this.fb.ka(oe),this.fb.ka(ue)))return this.le=new A.Nd(3,this.fb.ka(oe),this.fb.ka(ue)),!1;return!0},D.prototype.kO=function(){return 10>this.Y.I()?this.iO():this.jO()},D.prototype.jO=function(){var F=new A.hd;F.Ib(this.Y);var B=new A.Nd;return!A.bu.fI(!1,F,this.Qj,B,this.od)||(B.Lo=F.Va(B.Lo),B.Mo=F.Va(B.Mo),this.le.Yt(B),!1)},D.prototype.iO=function(){var F=this.Y,B=F.Ha();for(F=F.Ha();B.ab();)for(;B.Ia();){var q=B.ia();if(!B.Sn()||!B.VS()){F.wW(B);do for(;F.Ia();){var Z=F.ia();if((Z=q.Br(Z,this.Qj,!0))!=0)return this.le=new A.Nd(Z==2?5:4,B.xb(),F.xb()),!1}while(F.ab())}}return!0},D.prototype.nO=function(){var F=this.Y;this.hb.length=0,this.ro.length=0,this.ag=F.Ha(),this.ag.EB();var B=new A.ja(0);B.Jb(10);var q=NaN,Z=0,oe=0;for(F=2*F.I();oe>=1;var be=this.lf.read(2*ue),De=this.lf.read(2*ue+1);if(B.size!=0&&(be!=q||De!=Z)){if(!this.LI(B))return!1;B?.clear(!1)}B.add(ue),q=be,Z=De}}return!!this.LI(B)},D.prototype.mO=function(){for(var F=this.Y,B=Array(F.ea()),q=0,Z=F.ea();q>1;this.lf.uc(2*ue,oe);var be=B[q=this.Hl.get(ue)],De=F.Ca(q),qe=F.Wc(q)-1;Z.gl=ue==De||ue==qe,Z.jy=this.sl?!be&&Z.gl:Z.gl,Z.Ci=q,Z.x=oe.x,Z.y=oe.y,Z.zm=ue;for(var rt=new W,Dt=1,Vt=this.hi.size;Dt>1,this.lf.uc(2*ue,oe),(q=this.Hl.get(ue))!=Z.Ci&&(be=B[q],De=F.Ca(q),qe=F.Wc(q)-1);var Ke=ue==De||ue==qe,Ot=this.sl?!be&&Z.gl:Z.gl;if(rt.x=oe.x,rt.y=oe.y,rt.Ci=q,rt.zm=ue,rt.jy=Ot,rt.gl=Ke,rt.x==Z.x&&rt.y==Z.y){if(this.sl){if(!(rt.jy&&Z.jy||rt.Ci==Z.Ci&&(rt.gl||Z.gl)))return this.le=new A.Nd(8,rt.zm,Z.zm),!1}else if(!rt.gl||!Z.gl)return this.le=new A.Nd(5,rt.zm,Z.zm),!1}q=Z,Z=rt,rt=q}return!0},D.prototype.EE=function(){for(var F=this.Y,B=[],q=-1,Z=!1,oe=0,ue=F.ea();oe>1;this.lf.uc(2*be,Z),oe=this.Hl.get(be),q=new T(Z.x,Z.y,oe,be,B[oe]),F=[];var De=1;for(ue=this.hi.size;De>1,this.lf.uc(2*be,Z),oe=this.Hl.get(be),(oe=new T(Z.x,Z.y,oe,be,B[oe])).x==q.x&&oe.y==q.y){if(oe.Ci==q.Ci)return this.le=new A.Nd(9,oe.zm,q.zm),!1;0<=B[oe.Ci]&&B[oe.Ci]==B[q.Ci]&&(F.length!=0&&F[F.length-1]==q||F.push(q),F.push(oe))}q=oe}if(F.length==0)return!0;for(oe=new A.lp(!0),A.P.bv(B,-1),Z=-1,(De=new A.h).Sc(),q=0,ue=F.length;q=F.He())return this.le=new A.Nd(6,F.ea()==1?1:-1,-1),0;if(F.ea()==1)return this.sl&&!this.EE()?0:2;this.vo=A.ja.rf(F.ea(),0),this.EA=A.ja.rf(F.ea(),-1);for(var B=-1,q=0,Z=0,oe=F.ea();Zue?0:256),0B||q>=1,(Z=this.lf.read(2*q+1))!=this.Oo&&F.size!=0){if(!this.vt(F))return 0;F?.clear(!1)}F.add(q),this.Oo=Z}return 0oe.ma){var be=this.ag.xb(),De=this.Uu(oe,Z,this.ag.gb,!0);0F.Ka(B.gb))){q.yW();for(var rt,Dt,Vt=!0;B.Ia();){var Ke=B.ia(),Ot=q.ni();if(B.xb()>q.xb())break;Vt&&(De.add(B.xb()),qe.add(q.kk()),Vt=!1),Dt=De.Gc();var ei=B.kk();if(1this.Do?De.add(B.kk()):ue&&(rt=F.Vc(1,De.Gc(),0),Ke=Ke.jv(1,0),Math.abs(Ke-rt)>be&&De.add(B.kk())),Dt>this.Do?qe.add(q.xb()):ue&&(rt=F.Vc(1,qe.Gc(),0),Ke=Ot.jv(1,0),Math.abs(Ke-rt)>be&&qe.add(q.xb()))}if(De.Gc()qe.size?De.Jf():qe.Jf():(De.Gc()!=qe.Gc()&&qe.Jf(),qe.Jf()),2<=qe.size+De.size){for(Vt=new A.Ta,Ot=0,Ke=De.size;Ot>1;var oe=Z>>1,ue=new A.h,be=new A.h;return this.lf.uc(2*B,ue),ue.y+=1&F?this.Qj:-this.Qj,this.lf.uc(2*oe,be),be.y+=1&Z?this.Qj:-this.Qj,(F=ue.compare(be))==0&&q?0>(q=this.Hl.get(B)-this.Hl.get(oe))?-1:0oe.x)return 1;if(Z.yoe.y)return 1;for(Z=1;Zqe)return 1}}return 0},D.prototype.KO=function(F,B){var q=this.Qu(F,B);return q==0?FB?1:0F?b:m;if(b.B())return m;if(m.B())return b;var B=new A.l,q=new A.l,Z=new A.l;return b.A(B),m.A(q),Z.L(B),Z.$b(q),B=A.ua.Xd(_,Z,!0),q=b.K(),Z=m.K(),q==33&&Z==33?T.WU(b,m,B):q!=Z?0F?b:m:q==550?T.dI(b,m,B):T.dI(m,b,B):A.Hg.gp(b,m,_,C)},T.WU=function(b,m,_){_=_*Math.sqrt(2)*1.00001,_*=_;var C=b.D(),D=m.D(),F=new A.ee(b.description);return A.h.zc(C,D)>_&&(F.add(b),F.add(m)),F},T.dI=function(b,m,_){var C=b.vb(0),D=b.I(),F=m.D(),B=b.Ja();_=_*Math.sqrt(2)*1.00001;var q=new A.l;if(b.A(q),q.X(_,_),q.contains(F)){_*=_,q=!1;for(var Z=[],oe=0;oethis.Bk||0>this.eo)throw A.i.Ra();if(this.vH[this.eo])break}return this.za++,this.aG(this.eo)}return this.za=0,this.eo=this.Bk,this.aG(this.Bk)},b.prototype.Ma=function(){return this.za},b.prototype.lK=function(){if(this.Jc)return!0;var m=null;if(this.Sd!=null&&(m=this.Sd.next())==null&&(this.Jc=!0,this.Sd=null),A.op.Bp(this.Vb),m!=null){var _=m.Eb();this.vH[_]=!0,_>=this.Bk&&!this.eA&&(this.HD(_,!1,m),_>this.Bk&&!this.eA&&this.uW(_))}if(0this.Fo.length)for(var F=0,B=Math.max(2,m+1);F_?A.F.Yq(oe,Z,q,ue,0):A.F.Yq(oe,q,Z,ue,0),De=[0,0,0],qe=[0,0,0];var Vt=[0,0,0];q=[0,0,0],be=[0,0,0];var Ke=Math.acos(ue[2]/1),Ot=1-T,ei=Math.tan(Ke),Jt=1+ei*ei/Ot,Xt=2*oe[2]*ei/Ot;for(Ot=(-Xt+(ei=Math.sqrt(Xt*Xt-4*Jt*(oe[2]*oe[2]/Ot-1))))/(Jt*=2),Xt=(-Xt-ei)/Jt,ei=Math.tan(Ke),Ke=(Ot+Xt)/2,oe=((Jt=ei*Ot+oe[2])+(ei*Xt+oe[2]))/2,ei=A.F.ip(Ot-Ke,Jt-oe),Ot=oe/Dt*1.570796326794897,Xt=0;100>Xt&&(Jt=(Jt=A.F.w(T,Ot))*Jt/Math.cos(Ot)*(Math.sin(Ot)-oe*Jt/(1-T)),!A.s.Dd(Jt));Xt++)Ot-=Jt;oe=A.F.n(1,T,Ot)*Math.cos(Ot),ei=1-ei/(oe=Math.sqrt((oe-Ke)*(oe+Ke))),ei*=2-ei,Jt=A.F.qn(De),Ke=A.F.qn(qe),Ot=A.F.qn(Vt);var ti=A.F.Ut(Vt,De);Xt=A.F.Ut(Vt,qe),A.F.yx(Vt,De,q),A.F.yx(Vt,qe,be),De=Math.acos(ti/(Ot*Jt)),qe=Math.acos(Xt/(Ot*Ke)),qe*=A.s.Mb(1,A.F.Ut(q,be)),(1.570796326794897<=A.s.R(De)&&1.570796326794897<=A.s.R(qe)||3.141592653589793be&&0>_)&&(_=A.F.ca(_+3.141592653589793)),D!=null&&(D.u=q),F!=null&&(F.u=be),B!=null&&(B.u=_)}}},ve.sf=function(W,T,b,m,_,C,D,F){var B=[0,0,0],q=[0,0,0],Z=[0,0,0],oe=[0,0,0],ue=[0,0,0],be=[0,0,0],De=[0,0,0],qe=[0,0,0,0],rt=new A.ha(0),Dt=new A.ha(0),Vt=new A.ha(0),Ke=new A.ha(0),Ot=new A.ha(0),ei=new A.ha(0);if(D!=null&&F!=null)if(A.s.vi(T))A.$g.sf(W,b,m,_,C,D,F);else if(A.s.Dd(_))D!=null&&(D.u=b),F!=null&&(F.u=m);else if(C=A.F.ca(C),0>_&&(_=A.s.R(_),C=A.F.ca(C+3.141592653589793)),b=A.F.ca(b),m=A.F.ca(m),1.570796326794897C?A.F.Yq(De,ue,B,qe,0):A.F.Yq(De,B,ue,qe,0),B=Math.acos(qe[2]/1),qe=Math.atan2(-qe[1],-qe[0]),m=1-T,Ot=1+(ue=Math.tan(B))*ue/m,m=(-(Ke=2*De[2]*ue/m)+(ue=Math.sqrt(Ke*Ke-4*Ot*(De[2]*De[2]/m-1))))/(Ot*=2),Ke=(-Ke-ue)/Ot,ue=Math.tan(B),B=(m+Ke)/2,De=((Ot=ue*m+De[2])+(ue*Ke+De[2]))/2,ue=A.F.ip(m-B,Ot-De),Jt=De/Jt*1.570796326794897,m=0;100>m&&(Ke=(Ke=A.F.w(T,Jt))*Ke/Math.cos(Jt)*(Math.sin(Jt)-De*Ke/(1-T)),!A.s.Dd(Ke));m++)Jt-=Ke;Jt=A.F.n(1,T,Jt)*Math.cos(Jt),De=1-ue/(Jt=Math.sqrt((Jt-B)*(Jt+B))),De*=2-De,be=Math.acos(A.F.Ut(be,q)/(A.F.qn(be)*A.F.qn(q))),be*=A.s.Mb(1,q[0]),C=(A.F.q(Jt,De,A.F.Sj(De,be))+W*A.s.Mb(1,C))/A.F.Ch(Jt,De),C=A.F.ca(1.570796326794897*C),C=A.F.Tq(De,C),A.F.n(Jt,De,C),ue=A.F.ca(qe+b),b=Math.cos(ue),C=Math.sin(ue),Z[0]=oe[0]*b+oe[1]*-C,Z[1]=oe[0]*C+oe[1]*b,Z[2]=oe[2],A.F.eO(T,Z[0],Z[1],Z[2],Vt,Dt,rt),D!=null&&(D.u=Dt.u),F!=null&&(F.u=Vt.u)}},ve}()}(le||(le={})),function(A){var ve=function(){function _(C){this.Za=null,this.xt=new A.h,this.yt=new A.h,this.g=C}return _.prototype.compare=function(C,D,F){return this.g.Hc(D,this.xt),this.g.Hc(C.ka(F),this.yt),this.xt.compare(this.yt)},_}(),W=function(){function _(C){this.Cf=new A.h,this.Fk=new A.h,this.g=C}return _.prototype.Fh=function(C){this.Cf.N(C)},_.prototype.compare=function(C,D){return this.g.Hc(C.ka(D),this.Fk),this.Cf.compare(this.Fk)},_}(),T=function(_){function C(D){var F=_.call(this,D.g,D.ra,!1)||this;return F.ib=D,F}return Le(C,_),C.prototype.compare=function(D,F,B){if(this.sg)return-1;var q=this.ib.Rd.Ln(this.ib.Th(F));D=D.ka(B);var Z=this.ib.Rd.Ln(this.ib.Th(D));return this.Fm=B,this.ME(F,q,D,Z)},C}(A.PC),b=function(_){function C(D){var F=_.call(this,D.g,D.ra)||this;return F.ib=D,F}return Le(C,_),C.prototype.compare=function(D,F){return this.sg?-1:(D=this.ib.Rd.Ln(this.ib.Th(D.ka(F))),this.Fm=F,this.NE(F,D))},C}(A.WL),m=function(){function _(){this.Nc=this.df=this.lo=this.Rd=this.nh=this.Ad=this.hb=this.g=null,this.Pg=!1,this.xh=this.Pm=this.je=this.Ik=this.ph=this.Ck=this.Gf=this.ae=null,this.zh=this.Lq=this.PA=this.ra=0,this.Zv=this.Yn=!1,this.Ao=new A.h,this.Ri=new A.h,this.hb=new A.ad(8),this.Ad=new A.ad(5),this.nh=new A.cu,this.Rd=new A.cu,this.Pg=!1,this.xh=new A.h,this.xh.na(0,0),this.ra=0,this.zh=-1,this.Yn=!1,this.g=null,this.df=new A.$j,this.Nc=new A.$j,this.ph=new A.ja(0),this.Ik=new A.OC,this.Gf=new A.ja(0),this.Ck=new A.ja(0),this.lo=new A.Ta}return _.prototype.LX=function(C,D){var F=new A.Ed;return F.VB(),C.Pc(F),this.gr(C),this.Yn=!1,this.ra=D,this.PA=D*D,D=this.eC(),C.Pc(F),D||(this.lQ(),D||this.eC()),this.zh!=-1&&(this.g.Ud(this.zh),this.zh=-1),this.g=null,this.Yn},_.prototype.PX=function(C,D){this.gr(C),this.Yn=!1,this.ra=D,this.PA=D*D,this.Pg=!1,this.eC(),this.Pg||(this.Pg=C.Ip(D,!0,!1)==1),this.zh!=-1&&(this.g.Ud(this.zh),this.zh=-1),this.g=null},_.prototype.qg=function(C,D){return this.hb.U(C,0+D)},_.prototype.GB=function(C,D,F){this.hb.T(C,0+D,F)},_.prototype.Th=function(C){return this.hb.U(C,2)},_.prototype.UW=function(C,D){this.hb.T(C,2,D)},_.prototype.MF=function(C,D){return this.hb.U(C,3+D)},_.prototype.Rp=function(C){return this.hb.U(C,7)},_.prototype.Rl=function(C,D){this.hb.T(C,7,D)},_.prototype.Tp=function(C,D){return this.hb.U(C,3+this.Qp(C,D))},_.prototype.hr=function(C,D,F){this.hb.T(C,3+this.Qp(C,D),F)},_.prototype.IR=function(C,D){return this.hb.U(C,5+this.Qp(C,D))},_.prototype.jr=function(C,D,F){this.hb.T(C,5+this.Qp(C,D),F)},_.prototype.Ur=function(C){return this.Ad.U(C,0)},_.prototype.PW=function(C,D){this.Ad.T(C,0,D)},_.prototype.$y=function(C){return this.Ad.U(C,4)},_.prototype.er=function(C,D){this.Ad.T(C,4,D)},_.prototype.kl=function(C){return this.Ad.U(C,1)},_.prototype.nn=function(C,D){this.Ad.T(C,1,D)},_.prototype.Zy=function(C){return this.Ad.U(C,3)},_.prototype.Ft=function(C,D){this.Ad.T(C,3,D)},_.prototype.$m=function(C){var D=this.Ad.De(),F=this.nh.Rh();return this.PW(D,F),C!=-1?(this.nh.addElement(F,C),this.g.Sa(C,this.zh,D),this.er(D,this.g.Va(C))):this.er(D,-1),D},_.prototype.CP=function(C){this.Ad.kd(C)},_.prototype.FD=function(C,D){this.nh.addElement(this.Ur(C),D),this.g.Sa(D,this.zh,C)},_.prototype.ot=function(C){var D=this.hb.De(),F=this.Rd.Rh();return this.UW(D,F),C!=-1&&this.Rd.addElement(F,C),D},_.prototype.GD=function(C,D){this.Rd.addElement(this.Th(C),D)},_.prototype.Wu=function(C){this.hb.kd(C),0<=(C=this.ph.gF(C))&&this.ph.NV(C)},_.prototype.jj=function(C,D){if(this.qg(C,0)==-1)this.GB(C,0,D);else{if(this.qg(C,1)!=-1)throw A.i.Ra();this.GB(C,1,D)}this.gy(C,D)},_.prototype.gy=function(C,D){var F=this.kl(D);if(F!=-1){var B=this.Tp(F,D);this.jr(B,D,C),this.hr(C,D,B),this.hr(F,D,C),this.jr(C,D,F)}else this.jr(C,D,C),this.hr(C,D,C),this.nn(D,C)},_.prototype.Qp=function(C,D){return this.qg(C,0)==D?0:1},_.prototype.Zm=function(C,D){var F,B=this.Zy(D);if(B!=-1&&(this.df.wd(B,-1),this.Ft(D,-1)),(B=this.kl(D))!=-1){var q=F=B;do{var Z=!1,oe=this.Qp(F,D),ue=this.MF(F,oe);if(this.qg(F,oe+1&1)==C){if(this.Zu(F),this.Rd.eh(this.Th(F)),this.Wu(F),F==ue){B=-1;break}B==F&&(B=this.kl(D),q=ue,Z=!0)}F=ue}while(F!=q||Z);if(B!=-1){do oe=this.Qp(F,D),ue=this.MF(F,oe),this.GB(F,oe,C),F=ue;while(F!=q);(F=this.kl(C))!=-1?(q=this.Tp(F,C),Z=this.Tp(B,C),q==F?(this.nn(C,B),this.gy(F,C),this.nn(C,F)):Z==B&&this.gy(B,C),this.hr(B,C,q),this.jr(q,C,B),this.hr(F,C,Z),this.jr(Z,C,F)):this.nn(C,B)}}for(B=this.Ur(C),F=this.Ur(D),q=this.nh.sc(F);q!=-1;q=this.nh.lb(q))this.g.Sa(this.nh.ka(q),this.zh,C);this.nh.Cy(B,F),this.CP(D)},_.prototype.PT=function(C,D){var F=this.qg(C,0),B=this.qg(C,1),q=this.qg(D,0),Z=this.qg(D,1);this.Rd.Cy(this.Th(C),this.Th(D)),D==this.kl(F)&&this.nn(F,C),D==this.kl(B)&&this.nn(B,C),this.Zu(D),this.Wu(D),F==q&&B==Z||B==q&&F==Z||(this.Jn(F,this.Ao),this.Jn(q,this.Ri),this.Ao.rb(this.Ri)?(F!=q&&this.Zm(F,q),B!=Z&&this.Zm(B,Z)):(B!=q&&this.Zm(B,q),F!=Z&&this.Zm(F,Z)))},_.prototype.Zu=function(C){var D=this.qg(C,1);this.ZE(C,this.qg(C,0)),this.ZE(C,D)},_.prototype.ZE=function(C,D){var F=this.Tp(C,D),B=this.IR(C,D),q=this.kl(D);F!=C?(this.hr(B,D,F),this.jr(F,D,B),q==C&&this.nn(D,F)):this.nn(D,-1)},_.prototype.RD=function(C,D,F){var B=this.Rd.sc(C),q=this.Rd.ka(B);C=this.Ie(q);var Z=this.Ie(this.g.V(q));for(this.g.lr(q,D,F,!0),B=this.Rd.lb(B);B!=-1;B=this.Rd.lb(B)){q=this.Rd.ka(B);var oe=this.Ie(q)==C;this.g.lr(q,D,F,oe)}B=D.Xp(F,0).bc(),D=D.Xp(F,D.ql(F)-1).xc(),this.wK(C,B),this.wK(Z,D)},_.prototype.UE=function(C,D,F){var B=this.Th(C),q=this.qg(C,0),Z=this.qg(C,1),oe=this.ot(-1);for(this.ph.add(oe),this.Rl(oe,-3),this.Gf.add(oe),this.jj(oe,q),C=1,D=D.ql(F);Cthis.$y(oe)&&this.er(oe,this.g.Va(Z))),oe=this.Gf.get(C),C-=2,this.GD(oe,Z),Z=this.g.V(Z);while(0<=C)}this.Gf.clear(!1)},_.prototype.Ie=function(C){return this.g.Qa(C,this.zh)},_.prototype.NI=function(C,D,F){var B=this.qg(D,0),q=new A.h;this.Jn(B,q);var Z=new A.h,oe=this.qg(D,1);this.Jn(oe,Z);var ue=F.ql(C),be=F.Xp(C,0),De=new A.h;if(be.$p(De),!q.rb(De)){if(!this.Pg){var qe=q.compare(this.xh);0>qe*(De=De.compare(this.xh))&&(this.Pg=!0)}this.qF(B,this.Gf),this.Ck.add(B)}for(!this.Pg&&1be.compare(this.xh))&&(this.Pg=!0)),C=(be=F.Xp(C,ue-1)).xc(),Z.rb(C)||(this.Pg||0>(qe=Z.compare(this.xh))*(De=C.compare(this.xh))&&(this.Pg=!0),this.qF(oe,this.Gf),this.Ck.add(oe)),this.Gf.add(D),Z=0,oe=this.Gf.size;ZMath.max(100,this.g.gd)){this.ph.clear(!1),this.Pg=!0;break}var C=this.ph.Gc();this.ph.Jf(),this.Rl(C,-1),this.RS(C)!=-1&&this.rS(C),this.Xn=!1}},_.prototype.rS=function(C){if(this.Xn){var D=this.Nc.Bu(this.HH,this.BH,C,!0);this.Xn=!1}else D=this.Nc.ED(C);D==-1?this.PT(this.Nc.ka(this.Nc.AF()),C):(this.Rl(C,D),this.ae.sg&&(this.ae.Mr(),this.jF(this.ae.Fm,D)))},_.prototype.RS=function(C){var D=this.qg(C,0);if(C=this.qg(C,1),this.Jn(D,this.Ao),this.Jn(C,this.Ri),A.h.zc(this.Ao,this.Ri)<=this.PA)return this.Pg=!0,-1;var F=this.Ao.compare(this.xh),B=this.Ri.compare(this.xh);return 0>=F&&0=B&&0C&&(this.se(b),C=this.description.Rf(b)),this.la==null&&this.wn(),this.la[this.description.bk(C)+m]=_},T.prototype.K=function(){return 33},T.prototype.Eb=function(){return 0},T.prototype.Pa=function(){this.wc(),this.la!=null&&(this.la[0]=NaN,this.la[1]=NaN)},T.prototype.un=function(b){if(this.la!=null){for(var m=A.fe.Kw(b,this.description),_=[],C=0,D=0,F=b.Ba;D>>32),b=A.P.Vh(C,b)}return b},T.prototype.ng=function(){return null},T}(A.ba);A.Ta=ve}(le||(le={})),function(A){var ve=function(){function W(T,b,m){T!==void 0&&(this.x=T,this.y=b,this.z=m)}return W.construct=function(T,b,m){var _=new W;return _.x=T,_.y=b,_.z=m,_},W.prototype.L=function(T,b,m){this.x=T,this.y=b,this.z=m},W.prototype.lx=function(){this.z=this.y=this.x=0},W.prototype.normalize=function(){var T=this.length();T==0&&(this.x/=T,this.y/=T,this.z/=T)},W.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},W.prototype.sub=function(T){return new W(this.x-T.x,this.y-T.y,this.z-T.z)},W.prototype.Bg=function(T){new W(this.x*T,this.y*T,this.z*T)},W.prototype.Sh=function(T){return this.x*T.x+this.y*T.y+this.z*T.z},W}();A.Od=ve}(le||(le={})),function(A){var ve=function(){function W(T,b,m){this.Iw=this.yA=null,this.Zf=b,this.AT=b.y-m,this.zT=b.y+m,this.Gw=0,this.Zz=T,this.ra=m,this.MT=m*m,this.$z=m!=0,this.Nv=!1}return W.prototype.result=function(){return this.Gw!=0?1:0},W.prototype.UM=function(T){return T=T.ic(T.ge(this.Zf,!1)),A.h.zc(T,this.Zf)<=this.MT},W.prototype.aF=function(T){if(!this.$z&&(this.Zz&&this.Zf.rb(T.bc())||this.Zf.rb(T.xc())))this.Nv=!0;else if(T.oa==this.Zf.y&&T.oa==T.ma){if(this.Zz&&!this.$z){var b=Math.max(T.ta,T.qa);this.Zf.x>Math.min(T.ta,T.qa)&&this.Zf.xb?m=!0:this.Zf.x>=Math.min(T.ta,T.qa)&&(m=0T.xc().y?1:-1)}}},W.prototype.MI=function(T){var b=T.Vg(0,1);if(b.pa>this.zT||b.wathis.Zf.y||b.wa(T=T.I()))&&2*T+Math.log(T)/Math.log(2)*b<1*T*b},W}();A.Fg=ve}(le||(le={})),function(A){var ve=function(W){function T(b){return W.call(this,!0,b)||this}return Le(T,W),T.prototype.Ja=function(){return new T(this.description)},T.prototype.Eb=function(){return 2},T.prototype.K=function(){return 1736},T.prototype.sG=function(b,m,_){this.ES(b,m,_)},T.prototype.kR=function(){this.AR()},T}(A.Xk);A.Ea=ve}(le||(le={})),function(A){(function(ve){ve[ve.PiPOutside=0]="PiPOutside",ve[ve.PiPInside=1]="PiPInside",ve[ve.PiPBoundary=2]="PiPBoundary"})(A.ML||(A.ML={})),A.jd=function(){function ve(){}return ve.FG=function(W,T,b){return(W=A.Fg.XS(W,T,b))==0?0:W==1?1:2},ve.Zd=function(W,T,b){return(W=A.Fg.ym(W,T,b))==0?0:W==1?1:2},ve.SX=function(W,T,b,m,_){if(T.lengthT?(0>T?T+=360:360<=T&&(T-=360),T):(0>(T=A.mc.MK(T))&&(T+=360),T)},W.bP=function(T){return 180<(T=W.cP(T))&&(T-=360),T},W.jW=57.29577951308232,W}();A.sr=ve,A.Jh=function(){function W(){}return W.nj=function(T,b){var m=new A.l;T.A(m);var _=A.cb.ih(b),C=new A.l;return C.L(_),C.v=m.v,C.C=m.C,C.X(.01*C.da(),0),b=A.ua.Xd(b,m,!1),C.contains(m)?T:A.Vd.clip(T,C,b,0)},W.ms=function(T,b,m,_,C){if(!A.cb.Xc(b))throw A.i.O();var D=A.ua.mj(b,T,!1),F=A.cb.ih(b),B=A.cb.tc(b),q=B.Id().ci,Z=A.cb.xv(B);B=A.cb.gv(B),Z*=2-Z;var oe=new A.Oc;F.en(oe);var ue=[[0,0],[0,0]];if(A.Gg.Tb(b)==2?_?(ue[0][0]=W.an(C,oe),ue[0][1]=F.Lp(),A.cb.wt(),F=ue[0][0]*q):(ue[0][0]=F.ik(),ue[0][1]=C,A.cb.wt(),F=ue[0][1]*q):F=C*q,!_&&F!=0)throw A.i.O();var be=new A.ha,De=new A.hd;T=De.Ib(T);for(var qe=[0],rt=new A.h,Dt=new A.h,Vt=new A.h,Ke=new A.h,Ot=new A.h,ei=new A.h,Jt=De.Ob(T);Jt!=-1;Jt=De.Sb(Jt)){var Xt=De.Ya(Jt);De.D(Xt,Vt);for(var ti=!1,bi=Xt=De.V(Xt);bi!=-1;bi=De.V(bi)){if(bi==Xt){if(ti)break;ti=!0}if(De.D(bi,Ke),_&&DD||DD||!_&&D<-Vt.y&&Ke.y>D||D<-Ke.y&&Vt.y>D)do if(!(Math.abs(Vt.x-Ke.x)>=.5*oe.S())){if(A.Gg.Tb(b)==2?(ue[0][0]=W.an(Vt.x,oe),ue[0][1]=Vt.y,ue[1][0]=W.an(Ke.x,oe),ue[1][1]=Ke.y,A.cb.ZV(),Ot.x=ue[0][0]*q,Ot.y=ue[0][1]*q,ei.x=ue[1][0]*q,ei.y=ue[1][1]*q):(Ot.x=Vt.x*q,Ot.y=Vt.y*q,ei.x=Ke.x*q,ei.y=Ke.y*q),ei.x=6.283185307179586*(Ke.x-Vt.x)/oe.S()+Ot.x,_){if(Dt.x=F,Dt.y=W.Iz(B,Z,Ot,ei,F,m),isNaN(Dt.y))break}else{if(Dt.x=W.Gz(B,Z,Ot,ei,m),isNaN(Dt.x))break;Dt.y=0}A.kb.xd(B,Z,Ot.x,Ot.y,ei.x,ei.y,be,null,null,m);var Fi=be.u;A.kb.xd(B,Z,Ot.x,Ot.y,Dt.x,Dt.y,be,null,null,m);var Ri=be.u;A.Gg.Tb(b)==2?(ue[0][0]=Dt.x/q,ue[0][1]=Dt.y/q,A.cb.XQ(),_?(rt.y=ue[0][1],rt.x=C):(rt.x=W.qs(ue[0][0],Vt.x,Ke.x,oe),rt.y=C)):_?(rt.x=C,rt.y=Dt.y/q):(rt.x=W.qs(Dt.x/q,Vt.x,Ke.x,oe),rt.y=C),qe[0]=0_.x)var F=_;else F=m,m=_;_=new A.ha(0);var B=new A.ha(0),q=new A.ha(0);A.kb.xd(T,b,F.x,F.y,m.x,m.y,B,_,null,D);var Z=B.u,oe=0,ue=1,be=new A.h;for(be.N(F);Z*(ue-oe)>1e-12*T;){var De=.5*(oe+ue);if(A.kb.qj(T,b,F.x,F.y,Z*De,_.u,B,q,D),be.x=B.u,be.y=q.u,be.x==C)break;if(W.Un(F.x,be.x,C))ue=De;else{if(!W.Un(m.x,be.x,C))return NaN;oe=De}}return be.y},W.Un=function(T,b,m){return T=ve.Ep(T),b=ve.mx(T,ve.Ep(b)),(m=ve.mx(T,ve.Ep(m)))==0||0b&&0>m&&m>=b},W.an=function(T,b){var m=b.wa-b.pa;return b.Kt(T-Math.floor((T-b.pa)/m)*m)},W.qs=function(T,b,m,_){var C=new A.Oc;for(C.L(b,m),m=_.S(),T=Math.floor((T-b)/m)*m+T,C=C.tf();Math.abs(T-C)>Math.abs(T+m-C);)T+=m;return T},W.Gz=function(T,b,m,_,C){if(m.y>_.y)var D=_;else D=m,m=_;if((_=new A.Oc).L(D.y,m.y),!_.contains(0)||3.141592653589793<=Math.abs(D.x-m.x))return NaN;if(D.x==m.x)return D.x;var F=new A.ha(0),B=new A.ha(0),q=new A.ha(0);A.kb.xd(T,b,D.x,D.y,m.x,m.y,B,F,null,C);var Z=B.u,oe=0,ue=1,be=new A.h;for(be.N(D);Z*(ue-oe)>1e-12*T;){var De=.5*(oe+ue);if(A.kb.qj(T,b,D.x,D.y,Z*De,F.u,B,q,C),be.x=B.u,be.y=q.u,_.L(D.y,be.y),be.y==0)break;if(_.contains(0))ue=De;else{if(_.L(m.y,be.y),!_.contains(0))return NaN;oe=De}}return be.x},W.Jp=function(T,b,m,_,C,D,F){var B=new A.l;if(T.A(B),B.B())return T;var q=new A.Oc;B.en(q);var Z=new A.Oc;if(Z.L(b,b+m),Z.contains(q)&&Z.wa!=q.wa)return T;var oe=new A.l;oe.L(B);var ue=T.K();if(ue==33)return((B=(oe=C?T:T.Qf()).Ng())=Z.wa||F&&B==Z.wa)&&(B+=Math.ceil((Z.pa-B)/m)*m,B=Z.Kt(B),oe.YB(B)),oe;if(ue==550){for(_=(oe=C?T:T.Qf()).vb(0),ue=2*oe.I(),T=!1,C=0;C=Z.wa||F&&B==Z.wa)&&(T=!0,B+=Math.ceil((Z.pa-B)/m)*m,B=Z.Kt(B),_.write(C,B));return T&&oe.Qc(1993),oe}if(Z.contains(q))return T;if(ue==197)return m=C?T:T.Qf(),B.Fa(oe),m.Zo(B),m;var be=.1*Math.max(B.da(),B.S());for(oe.X(0,be),F=T,Z=_.Yd(0),T=A.Ih.local(),C=new A.Ed;;){var De=Math.floor((q.pa-b)/m),qe=Math.ceil((q.wa-b)/m);if(!(3oe.v;)(be=A.Vd.clip(F,oe,Z,0)).A(q),(ue==1607?!be.B()&&(q.S()>Z||q.da()>Z):!be.B()&&(ue!=1736||q.S()>Z))&&(be.Pc(C),be.A(q),b.A(D),D.X(Z,Z),D.isIntersecting(q)&&ue==1736?b=T.W(b,be,_,null):b.add(be,!1)),oe.move(m,0),C.shift(-m,0);return b},W.RI=function(T,b,m,_){var C=new A.ee(m.description);C.Gd(m,0,-1),C=A.cb.Bh(C,T,b);var D=m.I();if(_.Pa(),!A.cb.Xc(T)||D!=C.I())return!1;var F=new A.l;m.A(F);var B=new A.l;if(C.A(B),F=F.S(),B=B.S(),F!=0&&B!=0){if(B/=F,T=A.cb.ih(b).S()/A.cb.ih(T).S(),1e-10=m[C]?_[C]=m[C].toUpperCase():m[C];return _.join()}return m.toString(A.Tc.PE_STR_AUTH_TOP)},b.wr=function(m,_,C,D){var F=D.length,B=C.I();if(B!=0){var q=C.vb(0),Z=Math.min(B,F),oe=0,ue=m.gh();isNaN(_)&&(_=0);for(var be=m.Xc(),De=179*(m=be?m.tc().Le().S():0)/360;0Dt*A.mc.sign(Vt)&&Math.abs(rt)>De&&(D[qe][0]+=-Dt*m)}q.pC(oe<<1,Z,D),oe+=Z,B-=Z,Z=Math.min(B,F)}C.Qc(1993)}},b.DL=function(m,_,C,D){var F=0,B=m.gh();isNaN(F)&&(F=0);var q=m.Xc(),Z=m.bf();m=360*Z,Z*=179;for(var oe=D.length,ue=0;ueVt*A.mc.sign(rt)&&Math.abs(Dt)>Z&&(D[be][0]-=Vt*m)}A.ua.Dy(_,ue,D,De),ue+=De}}},b.Kx=function(m,_,C){var D=C.length,F=_.I();if(!(1>F)){var B=_.vb(0),q=Math.min(F,D),Z=0,oe=m.gh(),ue=m.Xc(),be=ue?m.Le().S():0,De=179*be/360,qe=0;for(ue&&(qe=m.Bi());0Dt*A.mc.sign(Vt)&&Math.abs(rt)>De&&(C[m][0]+=-Dt*be)}B.pC(Z<<1,q,C),Z+=q,F-=q,q=Math.min(F,D)}_.Qc(1993)}},b.CL=function(m,_,C,D){if(C!=0){var F=m.gh(),B=m.Xc(),q=B?m.Le().S():0,Z=179*q/360,oe=0;for(B&&(oe=m.Bi()),m=0;mrt*A.mc.sign(_[De].x-oe)&&Math.abs(qe)>Z&&(D[ue][0]-=rt*q)}A.ua.Dy(_,m,D,be),m+=be}}}},b.vr=function(m,_,C,D){var F=_.I();if(F!=0){var B=_.vb(0),q=m.ef,Z=m.$f,oe=q.tc().Sp(),ue=Z.tc().Sp(),be=q.bf(),De=Z.bf();if((m=m.Yf)==null||m.count()==0){for(C=oe/ue,D=(q.Wp()-Z.Wp())*De,ue=-90*be,m=90*be,oe=!1,De=1,q=2*F;DeKe?D[De][1]=Ke:D[De][1]<-Ke&&(D[De][1]=-Ke));for(be=0;beDe){if(Jt){var Ur=bi+(is+11*be&&(Jt=!1)}Jt||(Kn=En+(er-=A.mc.En(ue,Kn-ar)),++mi,kr=er!=0,Hn.x=Kn)}else dn||A.ua.vG(xo,Lr,Hn,ti)&&(dn=!0);kr&&Fi.write(2*is,Kn),ar=Kn,xo.N(Lr),Lr.N(Hn)}0m?q=1:0>=Z&&0.99*Z&&(q=-1)):q=-1),q!=0&&((_=new A.Ea(F.description)).vp(oe),(_=A.Zl.local().W(_,C,B)).add(F,!1),Ke=!0,F=_),Ke&&(F=A.$l.local().W(F,D,!1,B)),F},b.qQ=function(m,_,C,D,F){var B=C.I(),q=C.Oa(0),Z=C.Oa(B-1);F=(D=b.fv(D,F)).S(),q=A.mc.sign(Z.x-q.x);var oe=new A.l;C.yc(oe);var ue=D.ik();if(Z=ue-F,ue+=F,0<=q){var be=Math.ceil((Z-oe.v)/F);for(be*=F;Z>oe.v+be;)be+=F;for(;Zoe.v+be;)be+=F;De=be,720Z;)1024<=Vt&&(Vt=0),qe.move(be,0),rt.Lb=be,C.Pc(rt),Dt+=be,D.v<=Dt&&D.C>=Dt&&(F=oe.I()-1),C.Db(0,De),De=C.Oa(B-1),oe.Fr(C,0,0,B-1,!1);return C=new A.Ea(oe.description),B=0q?B:!B)?(q=A.h.construct(Z.x,D.H),C.Ei(q),q=A.h.construct(D.ik(),D.H),C.Ei(q),D=A.h.construct(m.x,D.H)):(q=A.h.construct(Z.x,D.G),C.Ei(q),q=A.h.construct(D.ik(),D.G),C.Ei(q),D=A.h.construct(m.x,D.G)),C.Ei(D),C.sG(0,_,0),C.fO(F),C},b.pQ=function(m,_,C,D,F){var B=new A.Ea(m.description);B.add(m,!1),B.yB(0,B.I()-1);var q=new A.l;B.yc(q);var Z=(C=b.fv(_,C)).S(),oe=Math.ceil((C.v-q.v)/Z);for(oe*=Z;C.v>q.v+oe;)oe+=Z;for(;C.vq.C)return F&&(F=B.He(),_=(B=A.$l.local().W(B,_,!0,D)).He(),(_=A.mc.sign(F)!=A.mc.sign(_))&&B.jJ()),B;for((m=new A.Ea(m.description)).add(B,!1),F=F||q.S()>Z-_.Yd(0);q.v=C){Z=!0;break}if(2&F&&ue.y<=-C){Z=!0;break}}if(!Z)return!1;B=!1,m&&(B=_.Pn(0)),q=(m=new A.hd).Ib(_),Z=m.Ob(q);var be=-1,De=!0,qe=new A.h;qe.Sc(),oe=new A.Ta;for(var rt=-1,Dt=m.Ya(Z);Dt!=-1;Dt=m.V(Dt)){ue=m.Oa(Dt);var Vt=1&F&&90<=ue.y?1:0;if(Vt|=2&F&&ue.y<=-C?2:0,0Z){if(new A.l().L(qe.v-q,-Z,qe.C+q,Z),(F=A.ti.Pu(F,_,m,NaN,0,D)).B())return F;F.A(qe)}if(Dt&&(_.Hqe.H))return F.Ja();if(qe.S()>ue&&(F=b.Jp(F,be-oe,ue,m,!0,0,!0,D)).A(qe),(Z=b.$N(qe.v,qe.C,_.v,_.C,ue))!=0&&qe.move(Z,0),qe.C>_.C||qe.v<_.v){if(qe.C>_.C)for(;qe.v>=_.C;)qe.move(-ue,0),Z-=ue;for(;qe.v<_.C-ue;)qe.move(ue,0),Z+=ue}if(C=A.ua.Ju(m,rt),Z!=0&&((q=new A.Ed).ig(Z,0),F.Pc(q)),Dt){if(Vt&&_.contains(qe))return F;for(Dt=[null,null],Z=0;2>Z;Z++){if(Vt?q=A.ba.Ic(B)?A.ti.clip(F,_,C,De,D):A.ti.clip(F,_,C,0,D):(q=A.Zj.local().W(F,rt,m,D))==rt&&(q=A.ba.kg(q)),_.v<=qe.v&&_.C>=qe.C||_.v>=qe.v&&_.C<=qe.C)return q;Dt[Z]=q,Z==0&&(qe.move(-ue,0),(q=new A.Ed).ig(-ue,0),F.Pc(q))}if(B==550)Dt[0].Gd(Dt[1],0,-1);else if(A.ba.Ic(B))Dt[0].add(Dt[1],!1);else{if(B!=33)throw A.i.ga("intersect_with_GCS_horizon: unexpected geometry type");Dt[0].B()&&(Dt[0]=Dt[1])}return Dt[0]}if(_.Hqe.H)return F;for(B=0;!F.B()&&qe.C>_.v;)B!=0&&((q=new A.Ed).ig(B,0),F.Pc(q)),A.fj.local().W(4,F,rt,m,D)||rt==(F=A.mp.local().W(F,rt,m,D))&&(F=A.ba.kg(F)),B!=0&&((De=new A.Ed).ig(-B,0),F.Pc(De)),B-=ue,qe.move(-ue,0);return F},b.tG=function(m,_,C,D){if(_!=0&&D!=ve.DontClip)if(D==ve.PannableFold){D=C.CR();for(var F=_,B=0;B<_;B++)(m[B].y>D.H||m[B].yq||m[B].y<-q)&&(m[B].Sc(),F--);if(F!=0){(F=new A.l).bx(m,_),q=C.Xr();var oe=C.kv();B=q.K()==197;var ue=new A.l;if(q.A(ue),!oe||!(ue.HF.H))if(oe)if(b.cv(m,_,ue.ik()-Z,D),F=_,B)for(B=0;B<_;B++)ue.contains(m[B])||(m[B].Sc(),F--);else for(C=A.ua.Ju(C.tc(),q),B=0;B<_;B++)(Z=A.jd.Zd(q,m[B],C)!=0)||(m[B].Sc(),F--);else for(b.cv(m,_,-Z,D),F=_,C=A.ua.Ju(C.tc(),q),B=0;B<_;B++)(Z=m[B]).isNaN()&&F--,oe=b.oE(Z.x,ue.v,ue.C,D),Z.x+=oe,(Z=A.jd.Zd(q,Z,C)!=0)&&(m[B].Sc(),F--)}}},b.Jp=function(m,_,C,D,F,B,q,Z){var oe=m.K(),ue=_+C;if(oe===33){var be=(D=F?m:m.Qf()).Ng();return(be<_||be>=ue||q&&be==ue)&&(be+=Math.ceil((_-be)/C)*C,be=A.P.Tk(be,_,ue),D.YB(be)),D}if(m.B()||(be=new A.l,m.A(be),be.B()))return m;var De=new A.Oc;be.en(De);var qe=new A.Oc;if(qe.L(_,ue),qe.contains(De))return m;if((ue=new A.l).L(be),oe===550){for(Z=(D=F?m:m.Qf()).vb(0),oe=2*D.I(),ue=!1,_=0;_=qe.wa||q&&be==qe.wa)&&(ue=!0,be+=Math.ceil((qe.pa-be)/C)*C,be=qe.Kt(be),Z.write(_,be));return ue&&D.Qc(1993),D}if(oe==197)return C=F?m:m.Qf(),be.Fa(ue),C.Zo(be),C;var rt=.1*Math.max(be.da(),be.S());for(ue.X(0,rt),q=m,qe=D.Yd(0),m=A.Ih.local(),F=new A.Ed;;){var Dt=Math.floor((De.pa-_)/C),Vt=Math.ceil((De.wa-_)/C);if(!(3ue.v;)(rt=A.ti.clip(q,ue,qe,0,Z)).A(De),(oe==1607?!rt.B()&&(De.S()>qe||De.da()>qe):!rt.B()&&(oe!=1736||De.S()>qe))&&(rt.Pc(F),rt.A(De),_.A(B),B.X(qe,qe),B.isIntersecting(De)&&oe==1736?_=m.W(_,rt,D,null):_.add(rt,!1)),ue.move(C,0),F.shift(-C,0);return _},b.cv=function(m,_,C,D){for(var F=C+D,B=0;B<_;B++){var q=m[B].x;C<=q&&qF||q==F)||(q+=Math.ceil((C-q)/D)*D,q=A.P.Tk(q,C,F),m[B].x=q)}},b.Hn=function(m,_,C,D,F,B){if(!_.Xc())throw A.i.ga("fold_into_360_degree_range");if(m.B())return m;if(_.Tb()==2){C=_.rv();var q=_.qv()-C}else{var Z=_.bf();q=360*Z,C-=180*Z}return b.Jp(m,C,q,_,D,F,!0,B)},b.lF=function(m,_,C,D){if(C.Tb()==2)D=C.rv(),C=C.qv()-D;else{var F=C.bf();C=360*F,D-=180*F}b.cv(m,_,D,C)},b.nj=function(m,_){var C=_.Le();if(m.K()==33){var D=m.kh();return C.G<=D&&D<=C.H?m:m.Ja()}D=new A.l,m.A(D);var F=new A.l;return F.L(C),F.v=D.v,F.C=D.C,F.X(.01*F.da(),0),C=A.ua.py(_,D),F.contains(D)?m:A.ti.clip(m,F,C,0,null)},b.kr=function(m,_,C){return m>_.C&&m-_.CC.H?m[F].Sc():m[F].x=b.kr(m[F].x,C,D)},b.Lt=function(m,_,C,D){if(!m.B()){var F=m.K();if(!D||F!=1736)if(A.ba.zj(F)){D=m.vb(0),F=0;for(var B=m.I();FD||DD)||!B&&(q!=0||D<-Xt.y&&ti.y>D||D<-ti.y&&Xt.y>D))do if(!(Math.abs(Xt.x-ti.x)>=.5*De.S())){if(C.Tb()==2?(rt[0][0]=b.an(Xt.x,De),rt[0][1]=Xt.y,rt[1][0]=b.an(ti.x,De),rt[1][1]=ti.y,A.gj.projToGeogCenter(qe,2,rt,0),bi.x=rt[0][0]*oe,bi.y=rt[0][1]*oe,Fi.y=rt[1][1]*oe):(bi.x=Xt.x*oe,bi.y=Xt.y*oe,Fi.y=ti.y*oe),Fi.x=2*(ti.x-Xt.x)*Math.PI/De.S()+bi.x,B){if(Ot.x=Z,Ot.y=b.Iz(ue,be,bi,Fi,Z,F),isNaN(Ot.y))break;Jt[0]=Ot;var mi=1}else if(F==T.GreatElliptic){var dn=[0,0];if((mi=A.Nx.Jz(be,bi,Fi,Z,dn))==0)break;Ot.x=dn[0],Ot.y=Z,Jt[0]=Ot,mi==2&&(ei.x=dn[1],ei.y=Z,Jt[1]=ei)}else{if(Ot.x=b.Gz(ue,be,bi,Fi,F),isNaN(Ot.x))break;Ot.y=0,Jt[0]=Ot,mi=1}var Lr=-1;for(dn=0;dnVt[0]||(Lr=m.Na(ar),m.Wl(Lr,Vt,1),m.Db(m.V(Lr),Ke.x,Ke.y),Lr=Vt[0])}}while(0);Xt.N(ti)}}},b.an=function(m,_){var C=_.wa-_.pa;return _.Kt(m-Math.floor((m-_.pa)/C)*C)},b.qs=function(m,_,C,D){var F=new A.Oc;for(F.L(_,C),C=D.S(),m=Math.floor((m-_)/C)*C+m,F=F.tf();Math.abs(m-F)>Math.abs(m+C-F);)m+=C;return m},b.Un=function(m,_,C){return m=A.sr.Ep(m),_=A.sr.mx(m,A.sr.Ep(_)),(C=A.sr.mx(m,A.sr.Ep(C)))==0||0<_&&0_&&0>C&&C>=_},b.Iz=function(m,_,C,D,F,B){if(B==T.GreatElliptic)return A.Nx.NS(_,C,D,F);if(Math.abs(C.x-D.x)>=Math.PI||!b.Un(C.x,D.x,F))return NaN;if(C.x>D.x)var q=D;else q=C,C=D;D=new A.ha;var Z=new A.ha,oe=new A.ha;A.kb.xd(m,_,q.x,q.y,C.x,C.y,Z,D,null,B);var ue=Z.u,be=0,De=1,qe=new A.h;for(qe.N(q);ue*(De-be)>1e-12*m;){var rt=.5*(be+De);if(A.kb.qj(m,_,q.x,q.y,ue*rt,D.u,Z,oe,B),qe.x=Z.u,qe.y=oe.u,qe.x==F)break;if(b.Un(q.x,qe.x,F))De=rt;else{if(!b.Un(C.x,qe.x,F))return NaN;be=rt}}return qe.y},b.Gz=function(m,_,C,D,F){if(F==T.GreatElliptic)return m=[0,0],A.Nx.Jz(_,C,D,0,m),m[0];if(C.y>D.y)var B=D;else B=C,C=D;if((D=new A.Oc).L(B.y,C.y),!D.contains(0)||Math.abs(B.x-C.x)>=Math.PI)return NaN;if(B.x==C.x)return B.x;var q=new A.ha,Z=new A.ha,oe=new A.ha;A.kb.xd(m,_,B.x,B.y,C.x,C.y,Z,q,null,F);var ue=Z.u,be=0,De=1,qe=new A.h;for(qe.N(B);ue*(De-be)>1e-12*m;){var rt=.5*(be+De);if(A.kb.qj(m,_,B.x,B.y,ue*rt,q.u,Z,oe,F),qe.x=Z.u,qe.y=oe.u,D.L(B.y,qe.y),qe.y==0)break;if(D.contains(0))De=rt;else{if(D.L(C.y,qe.y),!D.contains(0))return NaN;be=rt}}return qe.x},b.RI=function(m,_,C,D){if(!m.ef.Xc())return!1;var F=new A.ee(_.description);if(F.Gd(_,0,-1),D=A.Gx.local().W(F,m,D),F=_.I(),C.Pa(),F!=D.I())return!1;var B=new A.l;_.A(B);var q=new A.l;if(D.A(q),B=B.S(),q=q.S(),B!=0&&q!=0){if(q/=B,m=m.$f.ih().S()/m.ef.ih().S(),1e-10=180*_&&(m-=360*_),m},b.OI=function(m,_,C,D){if(C==ve.Clip){var F=_.ol();F.K()==197?(C=new A.l,F.A(C),F=A.ua.py(_,C),m=A.ti.clip(m,C,F,5e4*_.rm(),D)):A.fj.local().W(1,F,m,_,D)||(m=A.Zj.local().W(m,F,_,D))==F&&(m=A.Xk.kg(m))}else _.Xc()&&(D=new A.l,m.yc(D),_.Le().contains(D)||(b.Lt(m,_.Le(),_.Yd(0),!0),C==ve.PannableFold&&(m=b.nj(m,_)),m=b.Hn(m,_,0,!0,1e5*_.rm(),null)));return m},b.SD=function(m,_,C){var D=_.Yr();if(D==null)return m;var F=(_=_.tc()).Le().S(),B=new A.l;m.yc(B);var q=new A.Oc;B.en(q),B=D.Ha(),D=null;for(var Z=new A.Ed;B.ab();)for(;B.Ia();){var oe=B.ia(),ue=oe.Vg(0,0),be=new A.Oc;for(be.L(ue.pa,ue.wa),ue=0;be.wa>q.pa;)be.move(-F),--ue;for(;be.pa<=q.wa;){if(be.isIntersecting(q)){D==null&&(D=new A.Ua);var De=A.zb.YO(oe.bc(),oe.xc());ue!=0&&(Z.ig(ue*F,0),De.Pc(Z)),D.pc(De,!0)}be.move(F),++ue}}return D!=null?(_=A.ua.bO(_,D),_=A.ua.Gr(_),A.bu.gP(m,D,_,C)):m},b.$N=function(m,_,C,D,F){return m>=C&&_<=D?0:b.oE(.5*(_+m),C,D,F)},b.oE=function(m,_,C,D){return A.mc.round((.5*(C+_)-m)/D)*D},b.QQ=function(m,_,C,D,F,B,q,Z){var oe=b.fv(D,F),ue=oe.S(),be=ue/360,De=b.kE*be,qe=m.vb(0),rt=_.Xc(),Dt=rt?ue/_.Le().S():0;_=m.Ja();for(var Vt=0,Ke=C.ea();VtDe){if(Ot){var $i=Xt+kr-1,Ur=Xt;(!ti||kr+11*be&&(rt=!1)}Ot||(En=Hn+(Fi-=A.mc.En(ue,En-Ri)),++er,xo=Fi!=0,is.x=En)}else mi||A.ua.vG(dn,Lr,is,ar)&&(mi=!0);xo&&bi.write(2*kr,En),Ri=En,dn.N(Lr),Lr.N(is)}er!=0&&ei.Qc(1993),Ot=ei.Oa(0),Jt=ei.Oa(Jt-1),A.h.ub(Ot,Jt),ei=b.rQ(ei,D,isNaN(F)?0:F,B),_.add(ei,!1)}return m=D.Yd(0),C=oe.S()/180,b.Lt(_,oe,.1*m,!1),A.ti.clip(_,oe,m,C,B)},b.rQ=function(m,_,C,D){return b.Hn(m,_,C,!0,0,D)},b.JS=function(m,_,C,D){var F=m.K();if(F==1736)for(_=_!=null?_.Yd(0):0,F=0;FC)for(var F=new A.Ta,B=0;BC)for(var F=new A.Ta,B=0;Bthis.Ko},T.prototype.az=function(){if(this.B())throw A.i.ga("invalid call");return new A.Ta(this.Ds.x,this.Ds.y)},T.prototype.Va=function(){if(this.B())throw A.i.ga("invalid call");return this.Ko},T.prototype.cz=function(){if(this.B())throw A.i.ga("invalid call");return this.La},T.prototype.Nz=function(){return(1&this.pw)!=0},T.prototype.by=function(b,m,_,C){this.Ds.x=b,this.Ds.y=m,this.Ko=_,this.La=C},T}();A.bm=W}(le||(le={})),function(A){var ve=function(){function T(){}return T.prototype.Wo=function(b,m){this.vh.resize(0),this.Ki.length=0,this.vk=-1,b.yc(this.Gk),this.Gk.X(m,m),this.Gk.isIntersecting(this.Gb.Da)?((this.xs=A.ba.zd(b.K()))?(this.OH=b.bc(),this.NH=b.xc(),this.ra=m):this.ra=NaN,this.vh.add(this.Gb.kf),this.Ki.push(this.Gb.Da),this.Ss=this.Gb.Wr(this.Gb.kf)):this.Ss=-1},T.prototype.Zi=function(b,m){this.vh.resize(0),this.Ki.length=0,this.vk=-1,this.Gk.L(b),this.Gk.X(m,m),this.ra=NaN,this.Gk.isIntersecting(this.Gb.Da)?(this.vh.add(this.Gb.kf),this.Ki.push(this.Gb.Da),this.Ss=this.Gb.Wr(this.Gb.kf),this.xs=!1):this.Ss=-1},T.prototype.next=function(){if(this.vh.size==0)return-1;this.vk=this.Ss;var b=null,m=null,_=null,C=null;this.xs&&(b=new A.h,m=new A.h,_=new A.l);for(var D=!1;!D;){for(;this.vk!=-1;){var F=this.Gb.Xy(this.Gb.hv(this.vk));if(F.isIntersecting(this.Gk)){if(!this.xs){D=!0;break}if(b.N(this.OH),m.N(this.NH),_.L(F),_.X(this.ra,this.ra),0<_.uy(b,m)){D=!0;break}}this.vk=this.Gb.pv(this.vk)}if(this.vk==-1){F=this.vh.Gc();var B=this.Ki[this.Ki.length-1];for(C==null&&((C=[])[0]=new A.l,C[1]=new A.l,C[2]=new A.l,C[3]=new A.l),W.zJ(B,C),this.vh.Jf(),--this.Ki.length,B=0;4>B;B++){var q=this.Gb.Np(F,B);if(q!=-1&&0>C);D==0?(m.v=.5*(m.v+m.C),m.G=.5*(m.G+m.H)):D==1?(m.C=.5*(m.v+m.C),m.G=.5*(m.G+m.H)):(D==2?m.C=.5*(m.v+m.C):m.v=.5*(m.v+m.C),m.H=.5*(m.G+m.H))}return m},T.prototype.RR=function(b){return this.vz(b)},T.prototype.qR=function(b,m){return ve.XO(this,b,m)},T.prototype.HF=function(b,m){return ve.WO(this,b,m)},T.prototype.getIterator=function(){return ve.VO(this)},T.prototype.Pk=function(b,m){if(0>m||32<2*m)throw A.i.O("invalid height");this.wT=m,this.Da.L(b),this.kf=this.jf.De(),this.jx(this.kf,0),this.dx(this.kf,0),this.IJ(this.kf,0),this.FJ(this.kf,0)},T.prototype.Bv=function(b,m,_,C,D,F,B){if(!C.contains(m))return _==0?-1:this.Bv(b,m,0,this.Da,this.kf,F,B);if(!F)for(var q=D;q!=-1;q=this.DR(q))this.jx(q,this.vz(q)+1);(q=new A.l).L(C),C=D;var Z=[];for(Z[0]=new A.l,Z[1]=new A.l,Z[2]=new A.l,Z[3]=new A.l;_ue;ue++)if(Z[ue].contains(m)){oe=!0;var be=this.Np(C,ue);be==-1&&(be=this.mP(C,ue)),this.jx(be,this.vz(be)+1),C=be,q.L(Z[ue]);break}if(!oe)break}return this.nS(b,m,_,q,C,F,D,B)},T.prototype.nS=function(b,m,_,C,D,F,B,q){var Z=this.IF(D);if(F){if(D==B)return q;this.NP(q),F=q}else F=this.oP(),this.IB(F,b),this.FW(this.hv(F),m);return this.hX(F,D),Z!=-1?(this.hx(F,Z),this.ex(Z,F)):this.BJ(D,F),this.NB(D,F),this.dx(D,this.nv(D)+1),this.cO(D)&&this.HQ(_,C,D),F},T.prototype.NP=function(b){var m=this.RF(b),_=this.IF(m),C=this.JR(b),D=this.pv(b);this.Wr(m)==b?(D!=-1?this.hx(D,-1):this.NB(m,-1),this.BJ(m,D)):_==b?(this.ex(C,-1),this.NB(m,C)):(this.hx(D,C),this.ex(C,D)),this.hx(b,-1),this.ex(b,-1),this.dx(m,this.nv(m)-1)},T.zJ=function(b,m){var _=.5*(b.v+b.C),C=.5*(b.G+b.H);m[0].L(_,C,b.C,b.H),m[1].L(b.v,C,_,b.H),m[2].L(b.v,b.G,_,C),m[3].L(_,b.G,b.C,C)},T.prototype.cO=function(b){return this.nv(b)==8&&!this.bG(b)},T.prototype.HQ=function(b,m,_){var C=this.Wr(_);do{var D=this.hv(C),F=this.ai.U(C,0);D=this.Xy(D),this.Bv(F,D,b,m,_,!0,C),C=F=this.pv(C)}while(C!=-1)},T.prototype.dO=function(b){return 8<=this.nv(b)||this.bG(b)},T.prototype.bG=function(b){return this.Np(b,0)!=-1||this.Np(b,1)!=-1||this.Np(b,2)!=-1||this.Np(b,3)!=-1},T.prototype.mP=function(b,m){var _=this.jf.De();return this.JW(b,m,_),this.jx(_,0),this.dx(_,0),this.Rk(_,b),this.FJ(_,this.lv(b)+1),this.IJ(_,m<<2*this.lv(b)|this.LF(b)),_},T.prototype.oP=function(){var b=this.ai.De();if(0>4)]|=this.dH<<2*(15&D)},b}();A.DY=W;var T=function(){function b(m,_,C){this.Xh=null,this.NA=this.Kk=this.YH=this.WH=this.Gs=this.lH=this.Hf=this.Wm=0,this.Ti=this.Lk=this.xl=null,this.Az(m,_,C)}return b.create=function(m,_,C){if(!b.uE(m))throw A.i.O();return b.rP(m,_,C)},b.kW=function(m){switch(m){case 0:m=1024;break;case 1:m=16384;break;case 2:m=262144;break;default:throw A.i.ga("Internal Error")}return m},b.uE=function(m){return!(m.B()||m.K()!=1607&&m.K()!=1736)},b.prototype.mQ=function(m,_){_=_.Ha();for(var C=new A.h,D=new A.h;_.ab();)for(;_.Ia();){var F=_.ia();if(F.K()!=322)throw A.i.ga("Internal Error");m.Gh(F.bc(),C),m.Gh(F.xc(),D),this.Ti.fy(C.x,C.y,D.x,D.y)}this.Ti.dJ(A.Ox.Bx)},b.prototype.nQ=function(){throw A.i.ga("Internal Error")},b.prototype.My=function(m,_){for(var C=1;4>C;C++)m.fy(_[C-1].x,_[C-1].y,_[C].x,_[C].y);m.fy(_[3].x,_[3].y,_[0].x,_[0].y),this.Ti.dJ(A.Ox.Bx)},b.prototype.mK=function(m,_,C){for(var D=[null,null,null,null],F=0;F(rt=F.length());rt==0?F.na(1,0):(Dt||be.N(oe),F.scale(C/rt),B.na(-F.y,F.x),q.na(F.y,-F.x),Z.sub(F),oe.add(F),D[0].add(Z,B),D[1].add(Z,q),D[2].add(oe,q),D[3].add(oe,B),Dt?De=!0:this.My(m,D))}else De&&(this.My(m,D),De=!1),qe=!0}De&&this.My(m,D)}},b.prototype.nC=function(m){return A.P.truncate(m*this.lH+this.WH)},b.prototype.oC=function(m){return A.P.truncate(m*this.Gs+this.YH)},b.rP=function(m,_,C){return new b(m,_,C)},b.prototype.Az=function(m,_,C){this.Hf=Math.max(A.P.truncate(2*Math.sqrt(C)+.5),64),this.Wm=A.P.truncate((2*this.Hf+31)/32),this.xl=new A.l,this.Kk=_,C=0;for(var D=this.Hf,F=this.Wm;8<=D;)C+=D*F,D=A.P.truncate(D/2),F=A.P.truncate((2*D+31)/32);this.Xh=A.P.mg(C,0),this.Ti=new A.Ox,C=new W(this.Xh,this.Wm,this),this.Ti.wX(this.Hf,this.Hf,C),m.A(this.xl),this.xl.X(_,_),D=new A.l;var B=_*(F=A.l.construct(1,1,this.Hf-2,this.Hf-2)).S();switch(_*=F.da(),D.L(this.xl.tf(),Math.max(B,this.xl.S()),Math.max(_,this.xl.da())),this.NA=this.Kk,this.Lk=new A.Ed,this.Lk.kS(D,F),new A.Ed,m.K()){case 550:C.ax(this.Ti,2),this.nQ();break;case 1607:C.ax(this.Ti,2),this.mK(this.Ti,m,this.NA);break;case 1736:C.ax(this.Ti,1),this.mQ(this.Lk,m),C.ax(this.Ti,2),this.mK(this.Ti,m,this.NA)}this.lH=this.Lk.eb,this.Gs=this.Lk.bb,this.WH=this.Lk.Lb,this.YH=this.Lk.Qb,this.SN()},b.prototype.SN=function(){this.Ti.flush();for(var m=0,_=this.Hf*this.Wm,C=this.Hf,D=A.P.truncate(this.Hf/2),F=this.Wm,B=A.P.truncate((2*D+31)/32);8>4;ue=2*(15&ue);var qe=be>>4;be=2*(15&be);var rt=this.Xh[m+F*q+De]>>ue&3;rt|=this.Xh[m+F*q+qe]>>be&3,rt|=this.Xh[m+F*Z+De]>>ue&3,rt|=this.Xh[m+F*Z+qe]>>be&3,this.Xh[_+B*C+(oe>>4)]|=rt<<2*(15&oe)}C=D,F=B,m=_,D=A.P.truncate(C/2),B=A.P.truncate((2*D+31)/32),_=m+F*C}},b.prototype.Uo=function(m,_){return this.xl.contains(m,_)?(m=this.nC(m),_=this.oC(_),0>m||m>=this.Hf||0>_||_>=this.Hf||(_=this.Xh[this.Wm*_+(m>>4)]>>2*(15&m)&3)==0?0:_==1?1:2):0},b.prototype.To=function(m){if(!m.Fa(this.xl))return 0;var _=this.nC(m.v),C=this.nC(m.C),D=this.oC(m.G);if(m=this.oC(m.H),0>_&&(_=0),0>D&&(D=0),C>=this.Hf&&(C=this.Hf-1),m>=this.Hf&&(m=this.Hf-1),_>C||D>m)return 0;for(var F=Math.max(C-_,1)*Math.max(m-D,1),B=0,q=this.Wm,Z=this.Hf,oe=0;;){if(32>F||16>Z){for(F=D;F<=m;F++)for(var ue=_;ue<=C;ue++)if(1<(oe=this.Xh[B+q*F+(ue>>4)]>>2*(15&ue)&3))return 2;if(oe==0)return 0;if(oe==1)return 1}B+=q*Z,Z=A.P.truncate(Z/2),q=A.P.truncate((2*Z+31)/32),_=A.P.truncate(_/2),D=A.P.truncate(D/2),C=A.P.truncate(C/2),m=A.P.truncate(m/2),F=Math.max(C-_,1)*Math.max(m-D,1)}},b.prototype.MR=function(){return this.Hf*this.Wm},b}();A.Mx=T}(le||(le={})),function(A){var ve;(ve=A.QL||(A.QL={}))[ve.contains=1]="contains",ve[ve.within=2]="within",ve[ve.equals=3]="equals",ve[ve.disjoint=4]="disjoint",ve[ve.touches=8]="touches",ve[ve.crosses=16]="crosses",ve[ve.overlaps=32]="overlaps",ve[ve.unknown=0]="unknown",ve[ve.intersects=1073741824]="intersects";var W=function(){function b(){}return b.construct=function(m,_,C,D,F,B,q,Z){var oe=new b;return oe.rw=m,oe.Om=_,oe.Mj=C,oe.Ui=D,oe.wH=F,oe.OY=B,oe.PY=q,oe.QY=Z,oe},b}();A.Xt=function(){function b(){}return b.xD=function(m,_,C){if(b.ry(m)){var D=A.ua.mj(_,m,!1);_=!1,A.Wk.xE(m)&&(_=_||m.nu(D,C)),(D=m.K())!=1736&&D!=1607||!A.Wk.vE(m)||C==0||(_=_||m.hj(C)),D!=1736&&D!=1607||!A.Wk.wE(m)||C==0||_||m.cM()}},b.ry=function(m){return A.Wk.xE(m)||A.Wk.vE(m)||A.Wk.wE(m)},b}();var T=function(){function b(){this.th=[]}return b.uB=function(m,_,C,D,F){var B=m.K(),q=_.K();if(B==197){if(q==197)return b.oW(m,_,C,D);if(q==33)return D==2?D=1:D==1&&(D=2),b.cJ(_,m,C,D)}else if(B==33){if(q==197)return b.cJ(m,_,C,D);if(q==33)return b.qW(m,_,C,D)}if(m.B()||_.B())return D==4;var Z=new A.l;m.A(Z);var oe=new A.l;_.A(oe);var ue=new A.l;if(ue.L(Z),ue.$b(oe),C=A.ua.Xd(C,ue,!1),b.fk(Z,oe,C))return D==4;switch(Z=!1,A.Xk.zd(B)&&((B=new A.Ua(m.description)).pc(m,!0),m=B,B=1607),A.Xk.zd(q)&&((q=new A.Ua(_.description)).pc(_,!0),_=q,q=1607),B!=197&&q!=197?(m.Eb()<_.Eb()||B==33&&q==550)&&(D==2?D=1:D==1&&(D=2)):B!=1736&&q!=197&&(D==2?D=1:D==1&&(D=2)),B){case 1736:switch(q){case 1736:Z=b.st(m,_,C,D,F);break;case 1607:Z=b.bn(m,_,C,D,F);break;case 33:Z=b.rt(m,_,C,D);break;case 550:Z=b.qt(m,_,C,D,F);break;case 197:Z=b.BI(m,_,C,D,F)}break;case 1607:switch(q){case 1736:Z=b.bn(_,m,C,D,F);break;case 1607:Z=b.bB(m,_,C,D,F);break;case 33:Z=b.ut(m,_,C,D,F);break;case 550:Z=b.tt(m,_,C,D,F);break;case 197:Z=b.HI(m,_,C,D)}break;case 33:switch(q){case 1736:Z=b.rt(_,m,C,D);break;case 1607:Z=b.ut(_,m,C,D,F);break;case 550:Z=b.mt(_,m,C,D)}break;case 550:switch(q){case 1736:Z=b.qt(_,m,C,D,F);break;case 1607:Z=b.tt(_,m,C,D,F);break;case 550:Z=b.UA(m,_,C,D,F);break;case 33:Z=b.mt(m,_,C,D);break;case 197:Z=b.cI(m,_,C,D)}break;case 197:switch(q){case 1736:Z=b.BI(_,m,C,D,F);break;case 1607:Z=b.HI(_,m,C,D);break;case 550:Z=b.cI(_,m,C,D)}}return Z},b.oW=function(m,_,C,D){if(m.B()||_.B())return D==4;var F=new A.l,B=new A.l,q=new A.l;switch(m.A(F),_.A(B),q.L(F),q.$b(B),m=A.ua.Xd(C,q,!1),D){case 4:return b.fk(F,B,m);case 2:return b.eF(B,F,m);case 1:return b.eF(F,B,m);case 3:return b.gk(F,B,m);case 8:return b.YP(F,B,m);case 32:return b.XP(F,B,m);case 16:return b.WP(F,B,m)}return!1},b.cJ=function(m,_,C,D){if(m.B()||_.B())return D==4;m=m.D();var F=new A.l,B=new A.l;switch(_.A(F),B.L(m),B.$b(F),_=A.ua.Xd(C,B,!1),D){case 4:return b.Tw(m,F,_);case 2:return b.$A(m,F,_);case 1:return b.MU(m,F,_);case 3:return b.qI(m,F,_);case 8:return b.ZA(m,F,_)}return!1},b.qW=function(m,_,C,D){if(m.B()||_.B())return D==4;m=m.D(),_=_.D();var F=new A.l;switch(F.L(m),F.$b(_),C=A.ua.Xd(C,F,!1),D){case 4:return b.NU(m,_,C);case 2:return b.pI(_,m,C);case 1:return b.pI(m,_,C);case 3:return b.rI(m,_,C)}return!1},b.st=function(m,_,C,D,F){switch(D){case 4:return b.fV(m,_,C);case 2:return b.Uw(_,m,C,F);case 1:return b.Uw(m,_,C,F);case 3:return b.iV(m,_,C);case 8:return b.qV(m,_,C);case 32:return b.lV(m,_,C,F)}return!1},b.bn=function(m,_,C,D,F){switch(D){case 4:return b.gV(m,_,C);case 1:return b.aB(m,_,C,F);case 8:return b.rV(m,_,C,F);case 16:return b.bV(m,_,C)}return!1},b.rt=function(m,_,C,D){switch(D){case 4:return b.eV(m,_,C);case 1:return b.ZU(m,_,C);case 8:return b.pV(m,_,C)}return!1},b.qt=function(m,_,C,D){switch(D){case 4:return b.dV(m,_,C);case 1:return b.YU(m,_,C);case 8:return b.oV(m,_,C);case 16:return b.aV(m,_,C)}return!1},b.BI=function(m,_,C,D,F){if(b.cV(m,_,C))return D==4;if(D==4)return!1;switch(D){case 2:return b.sV(m,_,C);case 1:return b.XU(m,_,C);case 3:return b.hV(m,_,C);case 8:return b.nV(m,_,C,F);case 32:return b.kV(m,_,C,F);case 16:return b.$U(m,_,C,F)}return!1},b.bB=function(m,_,C,D){switch(D){case 4:return b.BV(m,_,C);case 2:return b.FI(_,m,C);case 1:return b.FI(m,_,C);case 3:return b.DV(m,_,C);case 8:return b.II(m,_,C);case 32:return b.HV(m,_,C);case 16:return b.GI(m,_,C)}return!1},b.ut=function(m,_,C,D){switch(D){case 4:return b.AV(m,_,C);case 1:return b.vV(m,_,C);case 8:return b.LV(m,_,C)}return!1},b.tt=function(m,_,C,D){switch(D){case 4:return b.zV(m,_,C);case 1:return b.uV(m,_,C);case 8:return b.KV(m,_,C);case 16:return b.xV(m,_,C)}return!1},b.HI=function(m,_,C,D){if(b.yV(m,_,C))return D==4;if(D==4)return!1;switch(D){case 2:return b.MV(m,_,C);case 1:return b.tV(m,_,C);case 3:return b.CV(m,_,C);case 8:return b.JV(m,_,C);case 32:return b.GV(m,_,C);case 16:return b.wV(m,_,C)}return!1},b.UA=function(m,_,C,D){switch(D){case 4:return b.bU(m,_,C);case 2:return b.$H(_,m,C);case 1:return b.$H(m,_,C);case 3:return b.dU(m,_,C);case 32:return b.jU(m,_,C)}return!1},b.mt=function(m,_,C,D){switch(D){case 4:return b.aI(m,_,C);case 2:return b.nU(m,_,C);case 1:return b.ZT(m,_,C);case 3:return b.Pw(m,_,C)}return!1},b.cI=function(m,_,C,D){switch(D){case 4:return b.aU(m,_,C);case 2:return b.mU(m,_,C);case 1:return b.YT(m,_,C);case 3:return b.cU(m,_,C);case 8:return b.lU(m,_,C);case 16:return b.$T(m,_,C)}return!1},b.iV=function(m,_,C){var D=new A.l,F=new A.l;return m.A(D),_.A(F),!!b.gk(D,F,C)&&(D=b.rc(m,_,!1))!=4&&D!=1&&D!=2&&(!!b.ZH(m,_,C)||(D=m.Rb(),F=_.Rb(),!(Math.abs(D-F)>4*Math.max(m.I(),_.I())*C)&&b.Rz(m,_,C,!0)))},b.fV=function(m,_,C){var D=b.rc(m,_,!0);return D==4||D!=1&&D!=2&&D!=1073741824&&b.zI(m,_,C)},b.qV=function(m,_,C){var D=b.rc(m,_,!1);return D!=4&&D!=1&&D!=2&&b.DI(m,_,C,null)},b.lV=function(m,_,C,D){var F=b.rc(m,_,!1);return F!=4&&F!=1&&F!=2&&b.AI(m,_,C,D)},b.Uw=function(m,_,C,D){var F=new A.l,B=new A.l;return m.A(F),_.A(B),!!b.Ac(F,B,C)&&(F=b.rc(m,_,!1))!=4&&F!=2&&(F==1||b.wI(m,_,C,D))},b.gV=function(m,_,C){var D=b.rc(m,_,!0);return D==4||D!=1&&D!=1073741824&&b.zI(m,_,C)},b.rV=function(m,_,C,D){var F=b.rc(m,_,!1);return F!=4&&F!=1&&b.EI(m,_,C,D)},b.bV=function(m,_,C){var D=b.rc(m,_,!1);return D!=4&&D!=1&&b.yI(m,_,C,null)},b.aB=function(m,_,C,D){var F=new A.l,B=new A.l;return m.A(F),_.A(B),!!b.Ac(F,B,C)&&(F=b.rc(m,_,!1))!=4&&(F==1||b.xI(m,_,C,D))},b.eV=function(m,_,C){return A.jd.FG(m,_,C)==0},b.pV=function(m,_,C){return _=_.D(),b.CI(m,_,C)},b.ZU=function(m,_,C){return _=_.D(),b.vI(m,_,C)},b.dV=function(m,_,C){var D=b.rc(m,_,!1);if(D==4)return!0;if(D==1)return!1;D=new A.l,m.A(D),D.X(C,C);for(var F=new A.h,B=0;B<_.I();B++)if(_.D(B,F),D.contains(F)){var q=A.jd.Zd(m,F,C);if(q==1||q==2)return!1}return!0},b.oV=function(m,_,C){var D=this.rc(m,_,!1);if(D==4||D==1)return!1;D=new A.l,m.A(D),D.X(C,C);for(var F=!1,B=m,q=!1,Z=0;Z<_.I();Z++){var oe=_.Oa(Z);if(D.contains(oe)){if((oe=A.jd.Zd(B,oe,C))==2)F=!0;else if(oe==1)return!1}q||(!A.Fg.Ol(m,_.I()-1)||m.Cb!=null&&m.Cb.Gb!=null?B=m:(B=new A.Ea,m.copyTo(B),B.hj(1)),q=!0)}return!!F},b.aV=function(m,_,C){var D=this.rc(m,_,!1);if(D==4||D==1)return!1;var F=new A.l;D=new A.l;var B=new A.l;m.A(F),_.A(B),D.L(F),D.X(C,C),B=F=!1;for(var q=m,Z=!1,oe=0;oe<_.I();oe++){var ue=_.Oa(oe);if(D.contains(ue)?(ue=A.jd.Zd(q,ue,C))==0?B=!0:ue==1&&(F=!0):B=!0,F&&B)return!0;Z||(!A.Fg.Ol(m,_.I()-1)||m.Cb!=null&&m.Cb.Gb!=null?q=m:(q=new A.Ea,m.copyTo(q),q.hj(1)),Z=!0)}return!1},b.YU=function(m,_,C){var D=new A.l,F=new A.l;if(m.A(D),_.A(F),!this.Ac(D,F,C)||(F=this.rc(m,_,!1))==4)return!1;if(F==1)return!0;F=!1;for(var B=m,q=!1,Z=0;Z<_.I();Z++){var oe=_.Oa(Z);if(!D.contains(oe))return!1;if((oe=A.jd.Zd(B,oe,C))==1)F=!0;else if(oe==0)return!1;q||(!A.Fg.Ol(m,_.I()-1)||m.Cb!=null&&m.Cb.Gb!=null?B=m:(B=new A.Ea,m.copyTo(B),B.hj(1)),q=!0)}return F},b.hV=function(m,_,C){var D=new A.l,F=new A.l;return m.A(D),_.A(F),!!b.gk(D,F,C)&&((D=new A.Ea).bd(_,!1),b.Rz(m,D,C,!0))},b.cV=function(m,_,C){var D=b.rc(m,_,!1);if(D==4)return!0;if(D==1||D==2)return!1;var F=new A.l;if(D=new A.l,m.A(F),_.A(D),b.Ac(D,F,C)||(F=new A.h,D.fn(F),(_=A.jd.Zd(m,F,C))!=0)||(D.VI(F),(_=A.jd.Zd(m,F,C))!=0)||(D.gn(F),(_=A.jd.Zd(m,F,C))!=0)||(D.YI(F),(_=A.jd.Zd(m,F,C))!=0))return!1;_=m.vb(0),(F=new A.l).L(D),F.X(C,C);for(var B=0,q=m.I();BC&&B.S()>C||B.da()<=C&&B.S()<=C)&&(F=new A.Ua,B=new A.Ta,_.If(0,B),F.nf(B),_.If(2,B),F.lineTo(B),b.yI(m,F,C,D))},b.DV=function(m,_,C){var D=new A.l,F=new A.l;return m.A(D),_.A(F),!(!b.gk(D,F,C)||b.rc(m,_,!1)==4)&&(!!b.ZH(m,_,C)||b.Rz(m,_,C,!1))},b.BV=function(m,_,C){return this.rc(m,_,!1)==4||!!new A.am(m,_,C,!0).next()&&!this.OG(m,_,C)},b.II=function(m,_,C){if(b.rc(m,_,!1)==4)return!1;var D=new A.ce(0);if(b.Sz(m,_,C,D)!=0)return!1;for(var F=new A.ee,B=0;BC&&F.S()>C)&&b.gk(D,F,C)},b.yV=function(m,_,C){var D=new A.l,F=new A.l;return m.A(D),_.A(F),!b.Ac(F,D,C)&&!b.NG(m,F,C)},b.JV=function(m,_,C){var D=new A.l,F=new A.l;if(m.A(D),_.A(F),F.da()<=C&&F.S()<=C)return F=_.Kp(),b.Uz(m,F,C);if(F.da()<=C||F.S()<=C)return F=new A.Ua,D=new A.Ta,_.If(0,D),F.nf(D),_.If(2,D),F.lineTo(D),b.II(m,F,C);m=m.Ha(),_=new A.l,D=new A.l,_.L(F),D.L(F),_.X(-C,-C),D.X(C,C),F=!1;for(var B=new A.l,q=new A.l;m.ab();)for(;m.Ia();){if(m.ia().A(B),q.L(_),q.Fa(B),!q.B()&&(q.da()>C||q.S()>C))return!1;q.L(D),q.Fa(B),q.B()||(F=!0)}return F},b.GV=function(m,_,C){var D=new A.l,F=new A.l;return m.A(D),_.A(F),!(b.Ac(D,F,C)||b.Ac(F,D,C)||b.Ac(F,D,C)||F.da()>C&&F.S()>C||F.da()<=C&&F.S()<=C)&&(D=new A.Ua,F=new A.Ta,_.If(0,F),D.nf(F),_.If(2,F),D.lineTo(F),b.QG(m,D,C))},b.MV=function(m,_,C){var D=new A.l,F=new A.l;if(m.A(D),_.A(F),!b.Ac(F,D,C)||F.da()<=C&&F.S()<=C)return!1;if(F.da()<=C||F.S()<=C)return b.Ac(F,D,C);m=m.Ha(),(_=new A.l).L(F),_.X(-C,-C),F=!1,D=new A.l;for(var B=new A.l;m.ab();)for(;m.Ia();)m.ia().A(D),_.jm(D)?F=!0:(B.L(_),B.Fa(D),!B.B()&&(B.da()>C||B.S()>C)&&(F=!0));return F},b.tV=function(m,_,C){var D=new A.l,F=new A.l;return _.A(F),m.A(D),!(!b.Ac(D,F,C)||F.da()>C&&F.S()>C)&&(F.da()<=C&&F.S()<=C?(_=_.Kp(),b.MG(m,_,C)):(D=new A.Ua,F=new A.Ta,_.If(0,F),D.nf(F),_.If(2,F),D.lineTo(F),b.Am(D,m,C,!1)))},b.wV=function(m,_,C){var D=new A.l,F=new A.l;if(m.A(D),_.A(F),b.Ac(F,D,C)||F.da()<=C&&F.S()<=C)return!1;if(F.da()<=C||F.S()<=C)return D=new A.Ua,F=new A.Ta,_.If(0,F),D.nf(F),_.If(2,F),D.lineTo(F),b.GI(m,D,C);m=m.Ha(),_=new A.l,(D=new A.l).L(F),_.L(F),D.X(-C,-C),_.X(C,C);for(var B=F=!1,q=new A.l,Z=new A.l;m.ab();)for(;m.Ia();)if(m.ia().A(q),B||_.contains(q)||(B=!0),F||(Z.L(D),Z.Fa(q),!Z.B()&&(Z.da()>C||Z.S()>C)&&(F=!0)),F&&B)return!0;return!1},b.dU=function(m,_,C){var D=new A.l,F=new A.l;return m.A(D),_.A(F),!!b.gk(D,F,C)&&(!!b.eU(m,_,C)||b.TA(m,_,C,!1,!0,!1))},b.bU=function(m,_,C){return!b.bI(m,_,C)},b.jU=function(m,_,C){return b.TA(m,_,C,!1,!1,!0)},b.$H=function(m,_,C){var D=new A.l,F=new A.l;return m.A(D),_.A(F),!!b.Ac(D,F,C)&&b.TA(_,m,C,!0,!1,!1)},b.Ow=function(m,_,C){C*=C;for(var D=new A.h,F=new A.h,B=0;B<_.I();B++){_.D(B,F);for(var q=!1,Z=0;ZC||F.S()>C)&&b.gk(D,F,C)},b.aU=function(m,_,C){var D=new A.l,F=new A.l;if(m.A(D),_.A(F),b.Ac(F,D,C))return!1;for((_=new A.l).L(F),_.X(C,C),C=new A.h,F=0;FC?B.X(0,-C):B.X(-C,0);for(var Z=0;ZC){if(_.y>B.G&&_.yB.v&&_.xC?D.X(0,-C):D.X(-C,0),B.X(C,C);for(var q=new A.h,Z=0;ZC?q.y>D.G&&q.yD.v&&q.xC||F.S()>C)&&(_=_.Kp(),!b.lt(m,_,C))},b.$T=function(m,_,C){var D=new A.l,F=new A.l;if(m.A(D),_.A(F),b.Ac(F,D,C)||F.da()<=C&&F.S()<=C)return!1;if(F.da()<=C||F.S()<=C){_=new A.l,D=new A.l,_.L(F),F.da()>C?_.X(0,-C):_.X(-C,0),D.L(F),D.X(C,C);for(var B=new A.h,q=!1,Z=!1,oe=0;oeC?B.y>_.G&&B.y<_.H&&(q=!0):B.x>_.v&&B.x<_.C&&(q=!0)),Z||D.contains(B)||(Z=!0),q&&Z)return!0;return!1}for(_=new A.l,D=new A.l,_.L(F),_.X(-C,-C),D.L(F),D.X(C,C),B=new A.h,Z=q=!1,oe=0;oeC*C},b.pI=function(m,_,C){return b.rI(m,_,C)},b.qI=function(m,_,C){var D=new A.l;return D.L(m),b.gk(D,_,C)},b.Tw=function(m,_,C){var D=new A.l;return D.L(_),D.X(C,C),!D.contains(m)},b.ZA=function(m,_,C){if(_.da()<=C&&_.S()<=C)return!1;var D=new A.l,F=new A.l;if(D.L(_),D.X(C,C),!D.contains(m))return!1;if(_.da()<=C||_.S()<=C){if(F.L(_),_.da()>C?F.X(0,-C):F.X(-C,0),_.da()>C){if(m.y>F.G&&m.yF.v&&m.xC?D.X(0,-C):D.X(-C,0);var F=!1;return _.da()>C?m.y>D.G&&m.yD.v&&m.xC&&m.S()>C&&(_.da()<=C||_.S()<=C)?D=_:(D=m,m=_),D.da()<=C||D.S()<=C){if(m.da()<=C||m.S()<=C){_=new A.zb;var F=new A.zb,B=[0,0],q=[0,0],Z=new A.h;return D.fn(Z),_.Ec(Z),D.gn(Z),_.Rc(Z),m.fn(Z),F.Ec(Z),m.gn(Z),F.Rc(Z),_.Fa(F,null,B,q,C),_.Fa(F,null,null,null,C)==1&&(B[0]==0||B[1]==1||q[0]==0||q[1]==1)}return _=new A.l,F=new A.l,_.L(m),_.X(-C,-C),F.L(_),F.Fa(D),!(!F.B()&&(F.da()>C||F.S()>C))}return m.X(C,C),(F=new A.l).L(D),F.Fa(m),!(F.B()||!F.B()&&F.da()>C&&F.S()>C)},b.XP=function(m,_,C){if(b.Ac(m,_,C)||b.Ac(_,m,C)||m.da()<=C&&m.S()<=C||_.da()<=C&&_.S()<=C)return!1;if(m.da()<=C||m.S()<=C){if(_.da()>C&&_.S()>C)return!1;var D=new A.zb,F=new A.zb,B=[0,0],q=[0,0],Z=new A.h;return m.fn(Z),D.Ec(Z),m.gn(Z),D.Rc(Z),_.fn(Z),F.Ec(Z),_.gn(Z),F.Rc(Z),D.Fa(F,null,B,q,C),D.Fa(F,null,null,null,C)==2&&(0B[1])&&(0q[1])}return!(_.da()<=C||_.S()<=C)&&((D=new A.l).L(m),D.Fa(_),!(D.B()||D.da()<=C||D.S()<=C))},b.eF=function(m,_,C){if(!b.Ac(m,_,C))return!1;if(m.da()<=C&&m.S()<=C)return m=m.tf(),b.$A(m,_,C);if(_.da()<=C&&_.S()<=C)return _=_.tf(),b.$A(_,m,C);if(m.da()<=C||m.S()<=C)return b.Ac(m,_,C);if(_.da()<=C||_.S()<=C){var D=new A.l;return D.L(m),D.X(-C,-C),D.jm(_)?!0:((m=new A.l).L(D),m.Fa(_),!(m.B()||m.da()<=C&&m.S()<=C))}return b.Ac(m,_,C)},b.WP=function(m,_,C){if(b.Ac(m,_,C)||b.Ac(_,m,C)||m.da()<=C&&m.S()<=C||_.da()<=C&&_.S()<=C||_.da()>C&&_.S()>C&&m.da()>C&&m.S()>C)return!1;if(m.da()>C&&m.S()>C)var D=_;else D=m,m=_;if(m.da()>C&&m.S()>C){_=new A.l;var F=new A.l;return F.L(m),F.X(-C,-C),_.L(F),_.Fa(D),!(_.B()||_.da()<=C&&_.S()<=C)}_=new A.zb,F=new A.zb;var B=[0,0],q=[0,0],Z=new A.h;return D.fn(Z),_.Ec(Z),D.gn(Z),_.Rc(Z),m.fn(Z),F.Ec(Z),m.gn(Z),F.Rc(Z),_.Fa(F,null,B,q,C),_.Fa(F,null,null,null,C)==1&&0B[1]&&0q[1]},b.zI=function(m,_,C){var D=new A.l,F=new A.l,B=new A.am(m,_,C,!0);if(!B.next())return!0;if(this.OG(m,_,C))return!1;var q=m,Z=null;_.K()==1736&&(Z=_);var oe=!1,ue=!1;do{var be=B.pl(),De=B.jl();if(De=_.Oa(_.Ca(De)),D.L(B.oz()),D.X(C,C),D.contains(De)&&(De=A.jd.Zd(q,De,0))!=0||_.K()==1736&&(be=m.Oa(m.Ca(be)),F.L(B.Wy()),F.X(C,C),F.contains(be)&&(De=A.jd.Zd(Z,be,0))!=0))return!1;oe||(!A.Fg.Ol(m,_.ea()-1)||m.Cb!=null&&m.Cb.Gb!=null?q=m:(q=new A.Ea,m.copyTo(q),q.hj(1)),oe=!0),_.K()!=1736||ue||(ue=_,!A.Fg.Ol(ue,m.ea()-1)||_.Cb!=null&&_.Cb.Gb!=null?Z=_:(Z=new A.Ea,ue.copyTo(Z),Z.hj(1)),ue=!0)}while(B.next());return!0},b.Ac=function(m,_,C){var D=new A.l;return D.L(m),D.X(C,C),D.contains(_)},b.ns=function(m,_,C){var D=new A.l;return D.L(_),D.X(C,C),_=new A.h,m.fn(_),!D.contains(_)||(m.VI(_),!D.contains(_)||(m.YI(_),!D.contains(_)||(m.gn(_),!D.contains(_))))},b.ZH=function(m,_,C){if(m.ea()!=_.ea()||m.I()!=_.I())return!1;var D=new A.h,F=new A.h,B=!0;C*=C;for(var q=0;qC){B=!1;break}if(!B)break}return!!B},b.eU=function(m,_,C){if(m.I()!=_.I())return!1;var D=new A.h,F=new A.h,B=!0;C*=C;for(var q=0;qC){B=!1;break}return!!B},b.TA=function(m,_,C,D,F,B){var q=!1;if(m.I()>_.I()){D&&(D=!1,q=!0);var Z=_}else Z=m,m=_;if(_=null,F||B||q){_=new A.rn(m.I());for(var oe=0;oe_.I())var D=_;else D=m,m=_;_=new A.l;var F=new A.l,B=new A.l;D.A(_),m.A(F),_.X(C,C),F.X(C,C),B.L(_),B.Fa(F),F=new A.h;for(var q=new A.h,Z=C*C,oe=A.ua.jE(m,B),ue=oe.getIterator(),be=0;beC)return!1;if(Ke*(1-(ei=B.Ui))<=C||ei==1)break}if(Ke*(1-ei)>C)return!1;ue=0,be.resize(0),De.th.length=0}}return q},b.QG=function(m,_,C){if(1>b.Sz(m,_,C,null))return!1;var D=new A.l,F=new A.l;m.A(D),_.A(F);var B=b.ns(D,F,C);return D=b.ns(F,D,C),!(!B||!D)||(B&&!D?!b.Am(_,m,C,!1):D&&!B?!b.Am(m,_,C,!1):!b.Am(m,_,C,!1)&&!b.Am(_,m,C,!1))},b.Sz=function(m,_,C,D){function F(Lr,xo){return qe.LE(Lr,xo)}if(m.sz()>_.sz())var B=_,q=m;else B=m,q=_;m=B.Ha(),_=q.Ha();var Z=[0,0],oe=[0,0],ue=-1,be=0,De=new A.ja(0),qe=new b,rt=new A.l,Dt=new A.l,Vt=new A.l;B.A(rt),q.A(Dt),rt.X(C,C),Dt.X(C,C),Vt.L(rt),Vt.Fa(Dt),B=null,D!=null&&(B=new A.h);var Ke=Dt=Dt=null,Ot=q.Cb;for(Ot!=null?(Dt=Ot.Gb,Ke=Ot.Bo,Dt==null&&(Dt=A.ua.lj(q,Vt))):Dt=A.ua.lj(q,Vt),q=Dt.getIterator(),Ot=null,Ke!=null&&(Ot=Ke.getIterator());m.ab();)for(Ke=0;m.Ia();){var ei=m.ia();if(ei.A(rt),rt.isIntersecting(Vt)){if(Ot!=null&&(Ot.Zi(rt,C),Ot.next()==-1))continue;var Jt=ei.Rb();q.Wo(ei,C);for(var Xt=q.next();Xt!=-1;Xt=q.next()){var ti=Dt.ka(Xt);_.Wb(ti);var bi=_.ia(),Fi=bi.Rb(),Ri=ei.Fa(bi,null,Z,oe,C);if(0C)return 1;var mi=Jt*(er-Xt);if(_.Ia()){if(bi=_.ia(),(Ri=ei.Fa(bi,null,Z,null,C))==2){Ri=Z[0];var dn=Z[1];if(mi+(Ri=Jt*(dn-Ri))>C)return 1}_.Wb(ti),_.ia()}if(!_.xm()){if(_.ni(),bi=_.ni(),(Ri=ei.Fa(bi,null,Z,null,C))==2&&(Ri=Z[0],mi+(Ri=Jt*((dn=Z[1])-Ri))>C))return 1;_.Wb(ti),_.ia()}if(m.Ia()){if(ti=m.xb(),(Ri=(ei=m.ia()).Fa(bi,null,Z,null,C))==2&&(Ri=Z[0],mi+(Ri=Jt*((dn=Z[1])-Ri))>C))return 1;m.Wb(ti),m.ia()}if(!m.xm()){if(ti=m.xb(),m.ni(),(Ri=(ei=m.ni()).Fa(bi,null,Z,null,C))==2&&(Ri=Z[0],mi+(Ri=Fi*((dn=Z[1])-Ri))>C))return 1;m.Wb(ti),m.ia()}bi=W.construct(m.xb(),m.gb,Xt,er,_.xb(),_.gb,ue,ar),qe.th.push(bi),De.add(De.size)}ue=0,D!=null&&(ei.ic(Xt,B),D.add(B.x),D.add(B.y))}}if(beC)Ke=Jt*(bi.Ui-bi.Mj),ei=bi.Ui,Xt=bi.Om;else{if(bi.Om!=Xt?(Ke=Jt*(bi.Ui-bi.Mj),Xt=bi.Om):Ke+=Jt*(bi.Ui-bi.Mj),Ke>C)return 1;if((ei=bi.Ui)==1)break}Jt*(1-ei)>C&&(Ke=0),be=0,De.resize(0),qe.th.length=0}}}return ue},b.OG=function(m,_,C){var D=m.Ha(),F=_.Ha();for(m=new A.am(m,_,C,!1);m.next();){_=m.pl();var B=m.jl();if(D.Wb(_),F.Wb(B),_=D.ia(),0C)return!1;be=!0}else if(qe!=0){if(be=Z[0],De=oe[0],0be&&0De)return!1;be=!0}}return!!be&&(B=new A.l,q=new A.l,F=new A.l,m.A(B),_.A(q),B.X(1e3*C,1e3*C),q.X(1e3*C,1e3*C),F.L(B),F.Fa(q),!(10C&&(oe=!0,ue&&be))return!0}else if(Ke!=0&&(Ke=rt[0],Ot=Dt[0],0Ke&&0Ot))return!0}if(F=new A.l,De=new A.l,F.L(B),F.X(1e3*C,1e3*C),De.L(q),De.X(1e3*C,1e3*C),Z.L(F),Z.Fa(De),B="",B=oe?B+"**":B+"T*",ue){if(10<_.I()&&(_=A.Vd.clip(_,Z,C,0)).B())return!1;B+="****"}else B+="T***";if(be){if(10be&&0De)))return D[0]=!0,!1}if(!ue){for(D[0]=!0,q=new A.l,m.A(q),q.X(C,C),oe=m,ue=!1,Z=new A.l,D=0,F=_.ea();Due&&0be)return!1;ue=!0}}return!!ue&&(B=new A.l,q=new A.l,F=new A.l,m.A(B),_.A(q),B.X(1e3*C,1e3*C),q.X(1e3*C,1e3*C),F.L(B),F.Fa(q),!(10ue&&0be)return!0;ue=!0}}return!!ue&&(B=new A.l,q=new A.l,Z=new A.l,oe=new A.l,F=new A.l,m.A(B),_.A(q),b.ns(q,B,C)?(Z.L(B),Z.X(1e3*C,1e3*C),oe.L(q),oe.X(1e3*C,1e3*C),F.L(Z),F.Fa(oe),!(10B;B++){var q=D.charAt(B);if(q!="*"&&q!="T"&&q!="F"&&q!="0"&&q!="1"&&q!="2")throw A.i.ga("relation string")}if((B=this.HR(D,m.Eb(),_.Eb()))!=0)return A.vd.uB(m,_,C,B,F);B=new A.l,m.A(B),q=new A.l,_.A(q);var Z=new A.l;if(Z.L(B),Z.$b(q),C=A.ua.Xd(C,Z,!1),m=this.RE(m,C),_=this.RE(_,C),m.B()||_.B())return this.pW(m,_,D);switch(B=_.K(),q=!1,m.K()){case 1736:switch(B){case 1736:q=this.st(m,_,C,D,F);break;case 1607:q=this.bn(m,_,C,D,F);break;case 33:q=this.rt(m,_,C,D);break;case 550:q=this.qt(m,_,C,D,F)}break;case 1607:switch(B){case 1736:q=this.bn(_,m,C,this.aq(D),F);break;case 1607:q=this.bB(m,_,C,D,F);break;case 33:q=this.ut(m,_,C,D,F);break;case 550:q=this.tt(m,_,C,D,F)}break;case 33:switch(B){case 1736:q=this.rt(_,m,C,this.aq(D));break;case 1607:q=this.ut(_,m,C,this.aq(D),F);break;case 33:q=this.VU(m,_,C,D);break;case 550:q=this.mt(_,m,C,this.aq(D))}break;case 550:switch(B){case 1736:q=this.qt(_,m,C,this.aq(D),F);break;case 1607:q=this.tt(_,m,C,this.aq(D),F);break;case 550:q=this.UA(m,_,C,D,F);break;case 33:q=this.mt(m,_,C,D)}break;default:q=!1}return q},b.st=function(m,_,C,D,F){var B=new b;B.$i(),B.dj(D),B.sJ();var q=new A.l,Z=new A.l;return m.A(q),_.A(Z),D=!1,A.vd.fk(q,Z,C)&&(B.Eu(m,_),D=!0),D||((q=A.vd.rc(m,_,!1))==4?(B.Eu(m,_),D=!0):q==1?(B.hy(_),D=!0):q==2&&(B.UD(m),D=!0)),D||(m=(D=new A.hd).Ib(m),_=D.Ib(_),B.Yo(D,C,F),B.Dp(m,_),B.j.Wg()),b.hg(B.J,B.Yc)},b.Uw=function(m,_,C,D){var F=new b;F.$i(),F.dj("T*****F**"),F.sJ();var B=new A.l,q=new A.l;m.A(B),_.A(q);var Z=!1;return A.vd.fk(B,q,C)&&(F.Eu(m,_),Z=!0),Z||((B=A.vd.rc(m,_,!1))==4?(F.Eu(m,_),Z=!0):B==1?(F.hy(_),Z=!0):B==2&&(F.UD(m),Z=!0)),Z?this.hg(F.J,F.Yc):(m=(Z=new A.hd).Ib(m),B=Z.Ib(_),A.Vk.W(Z,C,D,!1),C=Z.Ke(B).ng(),Z.Ip(0,!0,!0),A.tn.W(Z,m,-1,!1,D),Z.I(m)!=0&&(A.tn.W(Z,B,-1,!1,D),F.gr(Z,D),(_=Z.I(B)==0)||(F.Dp(m,B),F.j.Wg(),B=this.hg(F.J,F.Yc))?(m=Z.Ke(m),m=(Z=new A.hd).Ib(m),B=Z.Ib(C),F.gr(Z,D),F.me=0,F.$i(),F.dj(_?"T*****F**":"******F**"),F.DB(),F.Dp(m,B),F.j.Wg(),this.hg(F.J,F.Yc)):B))},b.bn=function(m,_,C,D,F){var B=new b;B.$i(),B.dj(D),B.DB();var q=new A.l,Z=new A.l;return m.A(q),_.A(Z),D=!1,A.vd.fk(q,Z,C)&&(B.Fu(m,_),D=!0),D||((q=A.vd.rc(m,_,!1))==4?(B.Fu(m,_),D=!0):q==1&&(B.VD(_),D=!0)),D||(m=(D=new A.hd).Ib(m),_=D.Ib(_),B.Yo(D,C,F),B.mh=B.j.Fp(),b.Lw(_,B.j,B.mh),B.Dp(m,_),B.j.Gp(B.mh),B.j.Wg()),b.hg(B.J,B.Yc)},b.aB=function(m,_,C,D){var F=new b;F.$i(),F.dj("T*****F**"),F.DB();var B=new A.l,q=new A.l;m.A(B),_.A(q);var Z=!1;return A.vd.fk(B,q,C)&&(F.Fu(m,_),Z=!0),Z||((B=A.vd.rc(m,_,!1))==4?(F.Fu(m,_),Z=!0):B==1&&(F.VD(_),Z=!0)),Z?this.hg(F.J,F.Yc):(m=(Z=new A.hd).Ib(m),_=Z.Ib(_),F.Yo(Z,C,D),Z.I(m)!=0&&(F.Dp(m,_),F.j.Wg(),this.hg(F.J,F.Yc)))},b.qt=function(m,_,C,D,F){var B=new b;B.$i(),B.dj(D),B.tJ();var q=new A.l,Z=new A.l;return m.A(q),_.A(Z),D=!1,A.vd.fk(q,Z,C)&&(B.Gu(m),D=!0),D||((q=A.vd.rc(m,_,!1))==4?(B.Gu(m),D=!0):q==1&&(B.uN(),D=!0)),D||(m=(D=new A.hd).Ib(m),_=D.Ib(_),B.Yo(D,C,F),B.By(m,_),B.j.Wg()),b.hg(B.J,B.Yc)},b.bB=function(m,_,C,D,F){var B=new b;B.$i(),B.dj(D),B.$W(),D=new A.l;var q=new A.l;m.A(D),_.A(q);var Z=!1;return A.vd.fk(D,q,C)&&(B.KG(m,_),Z=!0),Z||A.vd.rc(m,_,!1)!=4||(B.KG(m,_),Z=!0),Z||(m=(D=new A.hd).Ib(m),_=D.Ib(_),B.Yo(D,C,F),B.$h=B.j.Fp(),B.mh=B.j.Fp(),b.Lw(m,B.j,B.$h),b.Lw(_,B.j,B.mh),B.Dp(m,_),B.j.Gp(B.$h),B.j.Gp(B.mh),B.j.Wg()),b.hg(B.J,B.Yc)},b.tt=function(m,_,C,D,F){var B=new b;B.$i(),B.dj(D),B.HJ(),D=new A.l;var q=new A.l;m.A(D),_.A(q);var Z=!1;return A.vd.fk(D,q,C)&&(B.Qz(m),Z=!0),Z||A.vd.rc(m,_,!1)!=4||(B.Qz(m),Z=!0),Z||(m=(D=new A.hd).Ib(m),_=D.Ib(_),B.Yo(D,C,F),B.$h=B.j.Fp(),b.Lw(m,B.j,B.$h),B.By(m,_),B.j.Gp(B.$h),B.j.Wg()),b.hg(B.J,B.Yc)},b.UA=function(m,_,C,D,F){var B=new b;B.$i(),B.dj(D),B.MJ(),D=new A.l;var q=new A.l;m.A(D),_.A(q);var Z=!1;return A.vd.fk(D,q,C)&&(B.tI(),Z=!0),Z||(m=(D=new A.hd).Ib(m),_=D.Ib(_),B.Yo(D,C,F),B.By(m,_),B.j.Wg()),b.hg(B.J,B.Yc)},b.rt=function(m,_,C,D){var F=new b;F.$i(),F.dj(D),F.tJ();var B=new A.l;m.A(B),_=_.D();var q=!1;return A.vd.Tw(_,B,C)&&(F.Gu(m),q=!0),q||((C=A.jd.Zd(m,_,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,m.He()!=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,m.A(C),F.J[2]=C.da()==0&&C.S()==0?-1:1)):F.Gu(m)),this.hg(F.J,D)},b.ut=function(m,_,C,D,F){var B=new b;B.$i(),B.dj(D),B.HJ();var q=new A.l;m.A(q),D=_.D();var Z=!1;if(A.vd.Tw(D,q,C)&&(B.Qz(m),Z=!0),!Z){q=null;var oe=Z=!1;(B.fa[0]||B.fa[6])&&(A.vd.Tz(m,D,C)?(B.fa[0]&&(q=A.si.im(m,F),oe=!A.vd.lt(q,D,C),Z=!0,B.J[0]=oe?-1:0),B.J[6]=-1):(B.J[0]=-1,B.J[6]=0)),B.fa[3]&&(q!=null&&q.B()?B.J[3]=-1:(Z||(q==null&&(q=A.si.im(m,F)),oe=!A.vd.lt(q,D,C),Z=!0),B.J[3]=oe?0:-1)),B.fa[5]&&(q!=null&&q.B()?B.J[5]=-1:Z&&!oe?B.J[5]=0:(q==null&&(q=A.si.im(m,F)),F=A.vd.Pw(q,_,C),B.J[5]=F?-1:0)),B.fa[2]&&(m.Rb()!=0?B.J[2]=1:((F=new A.ee(m.description)).Gd(m,0,m.I()),m=A.vd.Pw(F,_,C),B.J[2]=m?-1:0))}return this.hg(B.J,B.Yc)},b.mt=function(m,_,C,D){var F=new b;F.$i(),F.dj(D),F.MJ();var B=new A.l;m.A(B),_=_.D();var q=!1;if(A.vd.Tw(_,B,C)&&(F.tI(),q=!0),!q){B=!1,q=!0,C*=C;for(var Z=0;ZB;B++)F[B]=-1;return A.h.zc(m,_)<=C*C?F[0]=0:(F[2]=0,F[6]=0),F[8]=2,b.hg(F,D)},b.hg=function(m,_){for(var C=0;9>C;C++)switch(_.charAt(C)){case"T":if(m[C]==-1)return!1;break;case"F":if(m[C]!=-1)return!1;break;case"0":if(m[C]!=0)return!1;break;case"1":if(m[C]!=1)return!1;break;case"2":if(m[C]!=2)return!1}return!0},b.pW=function(m,_,C){var D=[-1,-1,-1,-1,-1,-1,-1,-1,-1];if(m.B()&&_.B()){for(var F=0;9>F;F++)D[F]=-1;return this.hg(D,C)}return F=!1,m.B()&&(m=_,F=!0),D[0]=-1,D[1]=-1,D[3]=-1,D[4]=-1,D[6]=-1,D[7]=-1,D[8]=2,_=m.K(),A.ba.Ic(_)?_==1736?m.He()!=0?(D[2]=2,D[5]=1):(D[5]=-1,_=new A.l,m.A(_),D[2]=_.da()==0&&_.S()==0?0:1):(_=m.Rb()!=0,D[2]=_?1:0,D[5]=A.si.cq(m)?0:-1):(D[2]=0,D[5]=-1),F&&this.qK(D),this.hg(D,C)},b.HR=function(m,_,C){return b.ZP(m)?3:b.PP(m)?4:b.ZX(m,_,C)?8:b.xP(m,_,C)?16:b.$O(m)?1:b.zU(m,_,C)?32:0},b.ZP=function(m){return m.charAt(0)=="T"&&m.charAt(1)=="*"&&m.charAt(2)=="F"&&m.charAt(3)=="*"&&m.charAt(4)=="*"&&m.charAt(5)=="F"&&m.charAt(6)=="F"&&m.charAt(7)=="F"&&m.charAt(8)=="*"},b.PP=function(m){return m.charAt(0)=="F"&&m.charAt(1)=="F"&&m.charAt(2)=="*"&&m.charAt(3)=="F"&&m.charAt(4)=="F"&&m.charAt(5)=="*"&&m.charAt(6)=="*"&&m.charAt(7)=="*"&&m.charAt(8)=="*"},b.ZX=function(m,_,C){return(_!=0||C!=0)&&((_!=2||C!=2)&&(m.charAt(0)=="F"&&m.charAt(1)=="*"&&m.charAt(2)=="*"&&m.charAt(3)=="T"&&m.charAt(4)=="*"&&m.charAt(5)=="*"&&m.charAt(6)=="*"&&m.charAt(7)=="*"&&m.charAt(8)=="*"||_==1&&C==1&&m.charAt(0)=="F"&&m.charAt(1)=="T"&&m.charAt(2)=="*"&&m.charAt(3)=="*"&&m.charAt(4)=="*"&&m.charAt(5)=="*"&&m.charAt(6)=="*"&&m.charAt(7)=="*"&&m.charAt(8)=="*")||C!=0&&m.charAt(0)=="F"&&m.charAt(1)=="*"&&m.charAt(2)=="*"&&m.charAt(3)=="*"&&m.charAt(4)=="T"&&m.charAt(5)=="*"&&m.charAt(6)=="*"&&m.charAt(7)=="*"&&m.charAt(8)=="*")},b.xP=function(m,_,C){return _>C?m.charAt(0)=="T"&&m.charAt(1)=="*"&&m.charAt(2)=="*"&&m.charAt(3)=="*"&&m.charAt(4)=="*"&&m.charAt(5)=="*"&&m.charAt(6)=="T"&&m.charAt(7)=="*"&&m.charAt(8)=="*":_==1&&C==1&&m.charAt(0)=="0"&&m.charAt(1)=="*"&&m.charAt(2)=="*"&&m.charAt(3)=="*"&&m.charAt(4)=="*"&&m.charAt(5)=="*"&&m.charAt(6)=="*"&&m.charAt(7)=="*"&&m.charAt(8)=="*"},b.$O=function(m){return m.charAt(0)=="T"&&m.charAt(1)=="*"&&m.charAt(2)=="*"&&m.charAt(3)=="*"&&m.charAt(4)=="*"&&m.charAt(5)=="*"&&m.charAt(6)=="F"&&m.charAt(7)=="F"&&m.charAt(8)=="*"},b.zU=function(m,_,C){if(_==C){if(_!=1)return m.charAt(0)=="T"&&m.charAt(1)=="*"&&m.charAt(2)=="T"&&m.charAt(3)=="*"&&m.charAt(4)=="*"&&m.charAt(5)=="*"&&m.charAt(6)=="T"&&m.charAt(7)=="*"&&m.charAt(8)=="*";if(m.charAt(0)=="1"&&m.charAt(1)=="*"&&m.charAt(2)=="T"&&m.charAt(3)=="*"&&m.charAt(4)=="*"&&m.charAt(5)=="*"&&m.charAt(6)=="T"&&m.charAt(7)=="*"&&m.charAt(8)=="*")return!0}return!1},b.Lw=function(m,_,C){m=_.Ma(m);for(var D=_.Oe;D!=-1;D=_.Tf(D))if(_.yd(D)&m){var F=_.Je(D);if(F==-1)_.pn(D,C,0);else{var B=F,q=0;do _.fh(B)&m&&q++,B=_.kc(_.ya(B));while(B!=F);_.pn(D,C,q)}}},b.aq=function(m){var _=""+m.charAt(0);return _+=m.charAt(3),_+=m.charAt(6),_+=m.charAt(1),_+=m.charAt(4),_+=m.charAt(7),_+=m.charAt(2),(_+=m.charAt(5))+m.charAt(8)},b.prototype.$i=function(){for(var m=0;9>m;m++)this.J[m]=-2,this.$a[m]=-2},b.qK=function(m){var _=m[1],C=m[2],D=m[5];m[1]=m[3],m[2]=m[6],m[5]=m[7],m[3]=_,m[6]=C,m[7]=D},b.prototype.dj=function(m){for(this.Yc=m,m=0;9>m;m++)this.Yc.charAt(m)!="*"?(this.fa[m]=!0,this.me++):this.fa[m]=!1},b.prototype.PJ=function(){for(var m=0;9>m;m++)this.fa[m]&&this.J[m]==-2&&(this.J[m]=-1,this.fa[m]=!1)},b.prototype.qc=function(m){return this.J[m]!=-2&&(this.J[m]==-1?(this.fa[m]=!1,this.me--,!0):this.Yc.charAt(m)!="T"&&this.Yc.charAt(m)!="F"?!(this.J[m]B?1:0},b.prototype.reset=function(){this.tA=-1},b}(),T=function(){function b(){this.Ym=this.Il=null,this.fb=new A.$j,this.fb.MP(),this.ae=new W(this),this.fb.Xo(this.ae)}return b.prototype.CQ=function(){var m=!1;if(this.hw&&(m=this.DQ()),this.g.ea(this.Y)==1){var _=this.g.Ob(this.Y);return m=this.g.qz(_),this.g.KB(_,!0),0>m&&(m=this.g.Ya(_),this.g.kJ(m),this.g.Yg(_,this.g.Na(m)),!0)}for(this.Gl=this.g.Fy(),this.yo=this.g.Fy(),_=this.g.Ob(this.Y);_!=-1;_=this.g.Sb(_))this.g.ir(_,this.Gl,0),this.g.ir(_,this.yo,-1);_=new A.ja(0),this.Ah=NaN;var C=new A.h;this.ft=this.g.ea(this.Y),this.to=this.g.Hd(),this.Ts=this.g.Hd();for(var D=this.Il.sc(this.Il.ke);D!=-1;D=this.Il.lb(D)){var F=this.Il.getData(D);if(this.g.Hc(F,C),C.y!=this.Ah&&_.size!=0&&(m=this.vt(_)||m,this.ae.reset(),_.clear(!1)),_.add(F),this.Ah=C.y,this.ft==0)break}for(0=this.HA.length&&this.HA.push(new A.jg);var b=this.HA[this.Ew];return this.Ew++,b},T.prototype.clear=function(){this.rB(this.oo),this.rB(this.bt),this.rB(this.Aw),this.Ew=0},T.prototype.Qo=function(b){this.oo.push(this.Qw(b))},T.prototype.ql=function(b){return b==0?this.bt.length:this.Aw.length},T.prototype.Xp=function(b,m){return this.NR(b,m).bj},T.prototype.Fa=function(b,m){if(this.oo.length!=2)throw A.i.Ra();this.ra=b;var _=A.mc.ox(.01*b),C=!1,D=this.oo[0],F=this.oo[1];if(m||5&D.bj.Br(F.bj,b,!0)){if(D.bj.K()==322){var B=D.bj;if(F.bj.K()==322){m=F.bj;var q=A.zb.Yx(B,m,null,this.Hq,this.Dk,b);if(q==0)throw A.zb.Yx(B,m,null,this.Hq,this.Dk,b),A.i.Ra();b=Array(9),A.P.bv(b,null);for(var Z=0;Z_&&(C=!0)):be>qe?(B.ic(oe,Dt),oe=new A.h,m.ic(ue,oe),A.h.zc(Dt,oe)>_&&(C=!0)):(m.ic(ue,Dt),be=new A.h,B.ic(oe,be),A.h.zc(Dt,be)>_&&(C=!0)),b[Z]=Dt}for(D=0,F=-1,Z=0;Z<=q;Z++)(rt=Zthis.Dk[1]&&(rt=this.Dk[0],this.Dk[0]=this.Dk[1],this.Dk[1]=rt,Z=B[0],B[0]=B[1],B[1]=Z),D=0,F=-1,Z=0;Z<=q;Z++)(rt=Z=F;F++){if((m=1>F?this.Hq[F]:1)!=_){var B=this.WA();b.dh(_,m,B),D!=-1&&B.get().Ec(C),F!=1&&B.get().Rc(C),_=m,this.bt.push(this.Qw(B.get()))}D=F}this.Cf.Db(C)}},T}();A.OC=W}(le||(le={})),function(A){var ve=function(){function W(T){this.Fs=this.tk=this.tb=null,this.cg=0,this.Bm=!1,this.Af=-1,this.El=this.Kd=0,this.gb=-1,this.ib=T,this.cg=this.Vx(this.El),this.Bm=!1,this.tk=null,this.Fs=new A.h}return W.prototype.wW=function(T){if(this.ib!=T.ib)throw A.i.Hb();this.Af=T.Af,this.Kd=T.Kd,this.gb=T.gb,this.El=T.El,this.cg=T.cg,this.Bm=T.Bm,this.tk=null},W.prototype.ia=function(){if(this.Af!=this.Kd&&this.wD(),this.Bm)this.Kd=(this.Kd+1)%this.cg;else{if(this.Kd==this.cg)throw A.i.de();this.Kd++}return this.tk},W.prototype.ni=function(){if(this.Bm)this.Kd=(this.cg+this.Kd-1)%this.cg;else{if(this.Kd==0)throw A.i.de();this.Kd--}return this.Kd!=this.Af&&this.wD(),this.tk},W.prototype.xW=function(){this.Af=-1,this.Kd=0},W.prototype.yW=function(){this.Kd=this.cg,this.Af=-1},W.prototype.Wb=function(T,b){if(b===void 0&&(b=-1),0<=this.gb&&this.gb=m&&T=this.ib.Ca(b)&&T=this.ib.ea())&&(this.Af=-1,this.Kd=0,this.cg=this.Vx(this.gb),this.ib.Ca(this.gb),this.ib.ec(this.gb),this.El++,!0)},W.prototype.aj=function(){this.cg=this.Kd=this.Af=-1,this.El=0,this.gb=-1},W.prototype.Vx=function(T){if(this.ib.Bc())return 0;var b=1;return this.ib.ec(T)&&(b=0),this.ib.Ka(T)-b},W.prototype.Qn=function(){return this.Af==this.cg-1&&this.ib.ec(this.gb)},W.prototype.EB=function(){this.Bm=!0},W.prototype.xb=function(){return this.ib.nb.o[this.gb]+this.Af},W.prototype.DM=function(){return this.ib.Ca(this.gb)},W.prototype.kk=function(){return this.Qn()?this.ib.Ca(this.gb):this.xb()+1},W.prototype.xm=function(){return this.Af==0},W.prototype.Sn=function(){return this.Af==this.cg-1},W.prototype.Ia=function(){return this.Kdthis.Kd||this.Kd>=this.cg)throw A.i.de();this.Af=this.Kd;var T=this.xb();this.ib.oc();var b=this.ib.Se,m=1;switch(b!=null&&(m=7&b.read(T)),b=this.ib.description,m){case 1:this.tb==null&&(this.tb=new A.zb),this.tk=this.tb;break;case 2:throw A.i.ga("internal error");default:throw A.i.Ra()}this.tk.Pf(b),m=this.kk(),this.ib.Hc(T,this.Fs),this.tk.Ec(this.Fs),this.ib.Hc(m,this.Fs),this.tk.Rc(this.Fs);for(var _=1,C=b.Ba;_C&&(D=b,b=_,_=D,D=m,m=C,C=D,D=-1),!(0>C||m>=this.rl)){0>b&&0>_?_=b=-1:b>=this.ri&&_>=this.ri&&(_=b=this.ri);var F=(_-b)/(C-m);C>this.rl&&(_=F*((C=this.rl)-m)+b),0>m&&(b=F*(0-m)+b,m=0);var B=Math.max(this.ri+1,8388607);-8388607>b?(m=(0-b)/F+m,b=0):b>B&&(m=(this.ri-b)/F+m,b=this.ri),-8388607>_?C=(0-b)/F+m:_>B&&(C=(this.ri-b)/F+m),(m=A.P.truncate(m))!=(C=A.P.truncate(C))&&((_=new ve).x=A.P.truncate(4294967296*b),_.y=m,_.H=C,_.RP=A.P.truncate(4294967296*F),_.dir=D,this.Yl==null&&(this.Yl=A.P.mg(this.rl,null)),_.next=this.Yl[_.y],this.Yl[_.y]=_,_.ythis.Mw&&(this.Mw=_.H),this.Vq++)}}},T.prototype.nN=function(){if(this.Lh!=null){for(var b=!1,m=null,_=this.Lh;_!=null;)if(_.y++,_.y==_.H){var C=_;_=_.next,m!=null?m.next=_:this.Lh=_,C.next=null}else _.x+=_.RP,m!=null&&m.x>_.x&&(b=!0),m=_,_=_.next;b&&(this.Lh=this.aK(this.Lh))}},T.prototype.gN=function(b){if(!(b>=this.rl)){var m=this.Yl[b];if(m!=null){this.Yl[b]=null,m=this.aK(m),this.Vq-=this.bK,b=this.Lh;for(var _=!0,C=m,D=null;b!=null&&C!=null;)b.x>C.x?(_&&(this.Lh=C),_=C.next,C.next=b,D!=null&&(D.next=C),D=C,C=_):(_=b.next,b.next=C,D!=null&&(D.next=b),D=b,b=_),_=!1;this.Lh==null&&(this.Lh=m)}}},T.$J=function(b,m){return 0>b?0:b>m?m:b},T.prototype.UP=function(){if(this.Lh!=null){for(var b=0,m=this.Lh,_=A.P.truncate(A.P.SG(m.x)),C=m.next;C!=null;C=C.next)if(b=this.fF?1^b:b+C.dir,C.x>m.x){var D=A.P.truncate(A.P.SG(C.x));b!=0&&(m=T.$J(_,this.ri),(_=T.$J(D,this.ri))>m&&mthis.Lf[1].x&&(b=this.Lf[0],this.Lf[0]=this.Lf[1],this.Lf[1]=b):T.vN(this.Lf,m,function(D,F){return D==F?0:D.xF.x?1:0}),b=this.Lf[0],this.Lf[0]=null,_=b,C=1;Cthis.Yh.size)break;var q=this;for(this.ye.Wd(0,this.ye.size,function(Z,oe){return q.kM(Z,oe)}),m=0,_=this.ye.size;m<_;m++)C=this.ye.get(m),C=this.Yh.get(C),this.g.Sa(C,this.Ag,m),F=new A.h,this.g.Hc(C,F);for(F=this.OM(b),m=0,_=this.ye.size;m<_;m++)(C=this.ye.get(m))!=-1&&(C=this.Yh.get(C),this.g.Sa(C,this.Ag,-1));if(!F)break;T=!0}return T},W.prototype.OM=function(T){for(var b=!1,m=!0;m;){m=!1;var _=0;this.ye.get(_)==-1&&(_=this.em(_));for(var C=this.em(_),D=0,F=this.ye.size;Drt?1:DtVt?1:0)==0&&(Dt=(be=q[Z*be+3])<(De=q[Z*De+3])?-1:be==De?0:1),Dt}),this.Rq=this.g.Hd(),this.pe=new A.lp,this.MA=this.pe.Rh(0),this.pe.hn(m),C=0;Cq;q++){for(Z=be[q],oe=m[q],ue=q-1;0<=ue&&be[ue]>Z;)be[ue+1]=be[ue],m[ue+1]=m[ue],ue--;be[ue+1]=Z,m[ue+1]=oe}return be=0,m[0]!=0&&(be|=1),m[1]!=0&&(be|=2),m[2]!=0&&(be|=4),m[3]!=0&&(be|=8),(be==5||be==10)&&(T==b?T?(this.g.Cc(B,_),this.g.Dc(_,B),this.g.Cc(C,F),this.g.Dc(F,C)):(this.g.Dc(B,_),this.g.Cc(_,B),this.g.Dc(C,F),this.g.Cc(F,C)):T?(this.g.Dc(_,D),this.g.Cc(D,_),this.g.Dc(F,C),this.g.Cc(C,F)):(this.g.Cc(_,D),this.g.Dc(D,_),this.g.Cc(F,C),this.g.Dc(C,F)),!0)},W.prototype.oD=function(T,b,m,_,C,D){this.IY?this.QM():this.PM(T,b,m,_,C,D)},W.prototype.QM=function(){throw A.i.ga("not implemented.")},W.prototype.PM=function(T,b,m,_,C,D){if(T!=b)T?(this.g.Cc(m,C),this.g.Dc(C,m),this.g.Cc(D,_),this.g.Dc(_,D),this.xn(C,m),this.wi(C,!0),this.g.oi(C,!0),this.dk(m),this.xn(D,_),this.wi(D,!0),this.g.oi(D,!1)):(this.g.Cc(C,m),this.g.Dc(m,C),this.g.Cc(_,D),this.g.Dc(D,_),this.xn(C,m),this.wi(C,!0),this.g.oi(C,!1),this.dk(m),this.xn(D,_),this.wi(D,!0),this.g.oi(D,!0)),this.dk(_);else{var F=T?m:_,B=b?C:D;for(T=T?_:m,b=b?D:C,C=!1,this.g.Cc(F,B),this.g.Cc(B,F),this.g.Dc(T,b),this.g.Dc(b,T),D=b;D!=B;)m=this.g.Na(D),_=this.g.V(D),this.g.Dc(D,_),this.g.Cc(D,m),C=C||D==F,D=_;C||(m=this.g.Na(B),_=this.g.V(B),this.g.Dc(B,_),this.g.Cc(B,m)),this.xn(B,F),this.wi(B,!0),this.g.oi(B,!1),this.dk(F),this.xn(b,T),this.wi(b,!0),this.g.oi(b,!1),this.dk(T)}},W.prototype.YC=function(){for(var T=!1,b=this.g.Ob(this.Y);b!=-1;){for(var m=this.g.Ya(b),_=0,C=this.g.Ka(b);_this.g.Ka(b)){for(T=this.g.Ya(b),_=0,C=this.g.Ka(b);_=b)throw A.i.O("Invalid or unsupported wkid: "+b);var m=new T;return m.fg=b,m},T.lP=function(b){if(b==null||b.length==0)throw A.i.O("Cannot create SpatialReference from null or empty text.");var m=new T;return m.yh=b,m},T.prototype.Nb=function(b){return this==b||b!=null&&this.constructor==b.constructor&&this.fg==b.fg&&(this.fg!=0||this.yh===b.yh)},T.prototype.toString=function(){return"[ tol: "+this.Mn()+"; wkid: "+this.Fc()+"; wkt: "+this.wz()+"]"},T.prototype.dc=function(){if(this.rp!=="")return this.rp;var b=this.toString();if(Array.prototype.reduce)return this.rp="S"+b.split("").reduce(function(C,D){return(C=(C<<5)-C+D.charCodeAt(0))&C},0);var m=0;if(b.length===0)return"";for(var _=0;_=b.length)throw A.i.O();var m=null;try{m=A.IC.fromString(b)}catch{m=null}return m==null?null:T.XC(m,!0)},T.prototype.ay=function(b){this.Ld=b,this.Go=this.Ld.Id()},T.prototype.cy=function(b){this.FH=b,this.NT=this.FH!=null?this.FH.Go:null},T.prototype.Xc=function(){return this.Tb()!=0&&this.Tb()!=3&&this.Ld.Xc()},T.prototype.DG=function(){return this.Tb()!=0&&(this.Tb()==3?this.Li.hk().Xc():this.Ld.Xc())},T.prototype.gh=function(){return this.Ld!=null?this.Ld.Re:null},T.prototype.rm=function(){return this.Ld.rm()},T.prototype.bf=function(){return this.Ld.bf()},T.prototype.jh=function(){return this.Ld!=null?this.Ld.uw:NaN},T.prototype.Wp=function(){return this.Ld.Wp()},T.prototype.Yr=function(){return this.Ld.Yr()},T.prototype.mk=function(){return this.Ld.mk()},T.prototype.fS=function(b){return A.JC.Ky(this.Ld,b.Ld)},T.prototype.ol=function(){return this.Ld.ol()},T.prototype.Xr=function(){return this.Ld.Xr()},T.prototype.Bi=function(){return this.Tb()==3?this.Li.hk().Bi():this.Ld.Bi()},T.prototype.ih=function(){if(!this.Xc())throw A.i.O("!isPannable()");var b=new A.l;return this.Ld.ih(b),b},T.prototype.Le=function(){if(!this.Xc())throw A.i.O("!isPannable()");return this.Ld.uo},T.prototype.CR=function(){if(!this.Xc())throw A.i.O("!isPannable()");var b=new A.l;return this.Ld.BR(b),b},T.prototype.rv=function(){if(!this.Xc())throw A.i.O("!isPannable()");return this.Ld.rv()},T.prototype.qv=function(){if(!this.Xc())throw A.i.O("!isPannable()");return this.Ld.qv()},T.prototype.Zr=function(){return this.Li!=null?this.Li.hk().Zr():this.Ld.Zr()},T.prototype.KQ=function(){return this.Ld.kv()},T.prototype.Sp=function(){return this.Go.getUnitFactor()},T.prototype.pz=function(b){return this.Jq.pz(b)},T.prototype.tc=function(){var b=this.Tb();if(b==1)return this;if(b==3)return this.Li.hk().tc();if(b==0||b===4)throw A.i.ga("invalid call");if(this.lw!==null)return this.lw;if((b=this.gh().getGeogcs())==null)throw A.i.Ra();return this.lw=T.XE(b,this.Jq.QF())},T.XE=function(b,m){if(b==null)throw A.i.O("null pointer.");var _=new T;return b=T.ou(b,!0),_.Jq.Wx(b,null,m),_.ay(b),_.cy(null),_.fg=b.cs(),_},T.prototype.Tb=function(){var b=this.gh();if(b!=null)switch(b.getType()){case A.Tc.PE_TYPE_GEOGCS:return 1;case A.Tc.PE_TYPE_PROJCS:return 2}return 4},T.prototype.kv=function(){return this.Ld.kv()},T.ou=function(b,m){var _=b.getCode();if(0>=_&&0<(_=A.qf.getCode(b))){if((b=A.qf.coordsys(_))==null)throw A.i.O("Text to wkid mapping had failed: "+_);return T.ou(b,m)}if(m&&0<_&&(m=T.qx[_]))return m;m=A.Ab.zv(b,_,!1);var C=T.gK[m];return C||(b=0>=_?b:A.qf.coordsys(_),b=new A.JC(b),T.gK[m]=b,0<_&&(T.qx[_]=b),b)},T.eM=function(b){if(0>=b)throw A.i.O("Invalid or unsupported wkid: "+b);var m=T.qx[b];if(m!=null)return m;if((m=A.qf.coordsys(b))==null)throw A.i.O("Invalid or unsupported wkid: "+b);return(m=T.ou(m,!1)).cs()!=b&&(T.qx[b]=m),m},T.fM=function(b){if(b==null||b===void 0||b.length==0)throw A.i.O("Cannot create SpatialReference from null or empty text.");var m=null;try{m=A.qf.fromString(A.Tc.PE_TYPE_COORDSYS,b)}catch(_){throw A.i.O("Cannot create SpatialReference from text. "+_.message)}if(m===null)throw A.i.O("Cannot create SpatialReference from text. ");return T.ou(m,!0)},T.XC=function(b,m){var _,C=b.getCode();if(0>=C&&0<(C=A.qf.getCode(b))){if((C=A.qf.vertcs(C))===null)throw A.i.O();return T.XC(C,m)}if(m&&0=C||(_=A.qf.vertcs(C)),_===null)throw A.i.O();return _=new A.KL(_),T.hK[b]=_,0m&&(this.Rj=m/(C-this.Hm)),_=this.Im+_,(D=A.P.truncate((_-this.Im)*this.Rj))>m&&(this.Rj=m/(_-this.Im))}},b.prototype.WB=function(m){switch(m){case 0:this.Kk=void 0;case 1:this.Oq=void 0;case 2:this.Nq=void 0}},b.prototype.Mn=function(m){switch(m){case 0:return this.Kk;case 1:return this.Oq;case 2:return this.Nq}return 0},b.prototype.pz=function(m){if(this.Tm==ve.FloatingPoint)return 0;switch(m){case 0:return 1/this.Rj;case 1:case 2:return 1/this.Ho;default:return 0}},b.prototype.toString=function(){var m="SRPD [m_toleranceXY: "+this.Kk.toString();return(m=(m=(m=(m=(m=(m=(m=(m=(m=m+";m_falseX: "+this.Hm.toString())+";m_falseY: "+this.Im.toString())+";m_unitsXY: "+this.Rj.toString())+";m_falseZ: "+this.nA.toString())+";m_unitsZ: "+this.Ho.toString())+";m_falseM: "+this.mA.toString())+";m_toleranceZ: "+this.Oq.toString())+";m_toleranceM: "+this.Nq.toString())+";m_precision: "+this.Tm.toString())+"] "},b}();A.UL=T}(le||(le={})),function(A){function ve(C,D){return 89.99999D&&(D=-89.99999),D*=.017453292519943,[111319.49079327169*C,31890685e-1*Math.log((1+Math.sin(D))/(1-Math.sin(D)))]}function W(C,D,F){return C=C/6378137*57.29577951308232,F?[C,57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*D/6378137)))]:[C-360*Math.floor((C+180)/360),57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*D/6378137)))]}function T(C,D,F){var B=C.Qf();if(C.K()===33)D=D(B.Ng(),B.kh()),B.Db(D[0],D[1]);else if(C.K()===197){var q=D(C.gs(),C.js(),F);D=D(C.fs(),C.hs(),F),B.L(q[0],q[1],D[0],D[1])}else for(q=new A.h,C=0;CF&&(F=637.100877141506);for(var B,q=[],Z=0;Zthis.Jg&&this.yz(T)},W.prototype.sx=function(T,b){T*=this.Mf,b*=this.Mf;for(var m=0;mthis.ps.wa)return 1;D=C.oa==C.ma;var F=_.oa==_.ma;if(D||F){if(D&&F)return 0;if(C.oa==_.oa&&C.ta==_.ta)return D?1:-1;if(C.ma==_.ma&&C.qa==_.qa)return D?-1:1}return(D=C.Me(this.Ah,this.os.pa))==(F=_.Me(this.Ah,this.ps.pa))&&((F=.5*((D=Math.min(C.ma,_.ma))+this.Ah))==this.Ah&&(F=D),D=C.Me(F,this.os.pa),F=_.Me(F,this.ps.pa)),DF?1:0},m.prototype.WJ=function(_){this.Ah=_},m}(),b=function(){function m(_){this.ib=_,this.RH=new A.jg,this.Cf=new A.h,this.rA=new A.Oc}return m.prototype.fX=function(_){this.Cf.N(_)},m.prototype.compare=function(_,C){return this.ib.kB(_.ka(C),this.RH),_=this.RH.get(),this.rA.L(_.ta,_.qa),this.Cf.xthis.rA.wa?1:(_=_.Me(this.Cf.y,this.Cf.x),this.Cf.x<_?-1:this.Cf.x>_?1:0)},m}();ve=function(){function m(){this.cH=this.Fi=this.Ii=this.fA=this.$n=this.ze=this.Lc=this.lh=this.he=null,this.Io=this.yg=-1,this.bH=!0,this.kA=!1,this.gA=NaN,this.Pi=new A.Nd,this.XN=2147483647,this.WN=A.P.truncate(-2147483648),this.eg=this.be=this.Jl=this.Eq=this.Em=this.Dq=this.Qs=this.Oe=-1,this.xa=0}return m.prototype.ty=function(_){this.gA=_},m.prototype.$m=function(){this.he==null&&(this.he=new A.ad(8));var _=this.he.De();return this.he.T(_,1,0),_},m.prototype.qU=function(){this.Lc==null&&(this.Lc=new A.ad(8));var _=this.Lc.De();this.Lc.T(_,2,0),this.Lc.T(_,3,0);var C=this.Lc.De();return this.Lc.T(C,2,0),this.Lc.T(C,3,0),this.EJ(_,C),this.EJ(C,_),_},m.prototype.hI=function(){this.ze==null&&(this.ze=new A.ad(8));var _=this.ze.De();return this.ze.T(_,2,0),_},m.prototype.OW=function(_,C){this.he.T(_,7,C)},m.prototype.on=function(_,C){this.he.T(_,2,C)},m.prototype.NW=function(_,C){this.he.T(_,1,C)},m.prototype.gX=function(_,C){this.he.T(_,3,C)},m.prototype.dX=function(_,C){this.he.T(_,4,C)},m.prototype.er=function(_,C){this.he.T(_,5,C)},m.prototype.$Q=function(_){return this.he.U(_,5)},m.prototype.MW=function(_,C){this.he.T(_,6,C)},m.prototype.YM=function(_,C){this.MW(C,_)},m.prototype.DJ=function(_,C){this.Lc.T(_,1,C)},m.prototype.EJ=function(_,C){this.Lc.T(_,4,C)},m.prototype.Vl=function(_,C){this.Lc.T(_,5,C)},m.prototype.Ul=function(_,C){this.Lc.T(_,6,C)},m.prototype.VW=function(_,C){this.Lc.T(_,2,C)},m.prototype.cx=function(_,C){this.Lc.T(_,3,C)},m.prototype.GF=function(_){return this.Lc.U(_,3)},m.prototype.Ht=function(_,C){this.Lc.T(_,7,C)},m.prototype.zK=function(_,C){if(this.om(_)!=-1)for(C=C?-1:_,_=this.om(_);_!=-1;_=this.ls(_))this.g.Sa(this.vj(_),this.Eq,C)},m.prototype.xx=function(_,C){_!=-1&&(this.zK(_,C),this.zK(this.ya(_),C))},m.prototype.Et=function(_,C){this.ze.T(_,1,C)},m.prototype.Xg=function(_,C){this.ze.T(_,2,C)},m.prototype.ln=function(_,C){this.ze.T(_,3,C),this.IW(_,this.ZQ(C)),this.HW(C,_)},m.prototype.HW=function(_,C){this.ze.T(_,4,C)},m.prototype.IW=function(_,C){this.ze.T(_,5,C)},m.prototype.yJ=function(_,C){this.ze.T(_,6,C)},m.prototype.wJ=function(_,C){this.ze.T(_,7,C)},m.prototype.vJ=function(_,C){this.$n.write(_,C)},m.prototype.xJ=function(_,C){this.fA.write(_,C)},m.prototype.gY=function(_){var C=0,D=0,F=this.vF(_),B=new A.h,q=new A.h,Z=new A.h;this.$r(F,B),q.N(B);var oe=F;do this.nm(oe,Z),D+=A.h.ub(q,Z),this.$e(this.ya(oe))!=_&&(C+=(Z.x-B.x-(q.x-B.x))*(Z.y-B.y+(q.y-B.y))*.5),q.N(Z),oe=this.kc(oe);while(oe!=F);this.$n.write(_,C),this.fA.write(_,D)},m.prototype.KU=function(_,C){var D=new T(this),F=new A.$j;F.Ee(A.P.truncate(this.xa/2)),F.Xo(D);for(var B=new A.ja(0),q=this.bh(),Z=null,oe=0,ue=new A.h,be=this.Oe;be!=-1;be=this.Tf(be)){if(!(255&++oe)&&C!=null&&!C.progress(-1,-1))throw A.i.RC();var De=this.Je(be);if(De!=-1){if(B.Dh(0),!this.cY(F,q,B,De)){this.D(be,ue),D.WJ(ue.y);var qe=De;do{var rt=this.Bb(qe,q);rt!=-1&&(F.wd(rt,-1),this.Kb(qe,q,-2)),qe=this.kc(this.ya(qe))}while(De!=qe);qe=De;do(rt=this.Bb(qe,q))==-1&&(rt=F.addElement(qe,-1),B.add(rt)),qe=this.kc(this.ya(qe));while(De!=qe)}for(De=B.size-1;0<=De;De--)rt=B.get(De),qe=F.ka(rt),this.Kb(this.ya(qe),q,rt),this.JU(F,rt,_)}else this.Yy(be)==-1&&(Z==null&&(Z=new b(this)),this.D(be,ue),Z.fX(ue),qe=F.DW(Z),De=this.Jl,qe!=-1&&(rt=F.ka(qe),this.$e(rt)==this.$e(this.ya(rt))&&(rt=this.JF(F,qe)),rt!=-1&&(De=this.$e(rt))),this.YM(De,be))}this.Lg(q)},m.prototype.JU=function(_,C,D){var F=_.ka(C),B=this.$e(F);if(this.In(B)==-1){var q=this.JF(_,C),Z=this.ya(F),oe=this.$e(Z);this.Mp(B),this.Mp(oe);var ue=this.In(B),be=this.In(oe);if(q==-1&&ue==-1&&(oe==B?(this.ln(oe,this.Jl),ue=be=this.Jl):(be==-1&&(this.ln(oe,this.Jl),be=this.Jl),this.ln(B,oe),ue=oe)),q!=-1){var De=this.$e(q);be==-1&&(0>=this.Mp(De)?(be=this.In(De),this.ln(oe,be)):(this.ln(oe,De),be=De),oe==B&&(ue=be))}ue==-1&&this.dY(B,oe),D==0?this.eW(_,C,F,q,B,oe):D==5?this.fW(_,C,F,Z,B,oe):D==4&&this.dW(F,q,B,oe)}},m.prototype.eW=function(_,C,D,F,B,q){var Z=this.jk(B);if(F!=-1){var oe=this.jk(q),ue=this.jk(this.$e(F));F=Z&oe&ue,ue^=ue&this.fh(D),(ue|=F)!=0&&(this.Xg(q,oe|ue),this.Xg(B,ue|Z),Z=Z||ue)}for(C=_.lb(C);C!=-1&&(F=_.ka(C),D=this.$e(this.ya(F)),B=this.jk(D),q=this.fh(F),oe=this.$e(F),F=B&(ue=this.jk(oe))&Z,Z^=Z&q,(Z|=F)!=0);C=_.lb(C))this.Xg(D,B|Z),this.Xg(oe,ue|Z)},m.prototype.fW=function(_,C,D,F,B,q){if(B!=q){D=this.Bb(D,this.eg),D+=this.Bb(F,this.eg),F=0;var Z=new A.ja(0),oe=new A.ja(0);oe.add(0);for(var ue=_.sc(-1);ue!=C;ue=_.lb(ue)){var be=_.ka(ue),De=this.ya(be),qe=this.$e(be),rt=this.$e(De);if(qe!=rt){if(be=this.Bb(be,this.eg),F+=be+=this.Bb(De,this.eg),De=!1,Z.size!=0&&Z.Gc()==rt&&(oe.Jf(),Z.Jf(),De=!0),this.In(rt)==-1)throw A.i.Ra();De&&this.In(rt)==qe||(oe.add(F),Z.add(qe))}}F+=D,Z.size!=0&&Z.Gc()==q&&(oe.Jf(),Z.Jf()),F!=0?oe.Gc()==0&&(_=this.g.md,_=this.Ma(_),this.Xg(B,_)):oe.Gc()!=0&&(_=this.g.md,_=this.Ma(_),this.Xg(B,_))}},m.prototype.dW=function(_,C,D,F){var B=this.Ma(this.g.md);if(C==-1)this.Xg(F,this.Io),1&(_=this.Bb(_,this.yg))?this.Xg(D,B):this.Xg(D,this.Io);else{var q=this.jk(F);q==0?(q=this.jk(this.$e(C)),this.Xg(F,q),1&(_=this.Bb(_,this.yg))?this.Xg(D,q==B?this.Io:B):this.Xg(D,q)):1&(_=this.Bb(_,this.yg))?this.Xg(D,q==B?this.Io:B):this.Xg(D,q)}},m.prototype.cY=function(_,C,D,F){var B=F,q=-1,Z=-1,oe=0;do{if(oe==2)return!1;var ue=this.Bb(B,C);if(ue!=-1){if(q!=-1)return!1;q=ue}else{if(Z!=-1)return!1;Z=B}oe++,B=this.kc(this.ya(B))}while(F!=B);return Z!=-1&&q!=-1&&(this.Kb(_.ka(q),C,-2),_.Uj(q,Z),D.add(q),!0)},m.prototype.dY=function(_,C){var D=this.Mp(_);if(D!=0){var F=this.Mp(C);0F||0>D&&0be.compare(B)?ue=1:q=-1,this.Kb(qe,this.be,0),this.Kb(De,this.be,0),this.Kb(De,this.eg,ue),this.Kb(qe,this.eg,q)):_==7?(this.Kb(qe,this.be,this.Io),this.Kb(De,this.be,oe==1736?Z:0)):_==4&&(this.Kb(qe,this.be,0),this.Kb(De,this.be,0),this.Kb(De,this.yg,1),this.Kb(qe,this.yg,1)),oe=oe==1736?this.WN:0,this.cx(De,Z|oe),this.cx(qe,Z|oe)}}}}},m.prototype.QT=function(_,C){var D=this.om(C);if(D!=-1){var F=this.om(_);this.lh.T(D,1,F),this.Ht(_,D),this.Ht(C,-1)}_=this.ya(_),C=this.ya(C),(D=this.om(C))!=-1&&(F=this.om(_),this.lh.T(D,1,F),this.Ht(_,D),this.Ht(C,-1))},m.prototype.EX=function(_){function C(ei,Jt){return F.CO(ei,Jt)}var D=new A.ja(0);D.Jb(10);for(var F=this,B=this.Oe;B!=-1;B=this.Tf(B)){D.clear(!1);var q=this.Je(B);if(q!=-1){var Z=q;do D.add(Z),Z=this.kc(this.ya(Z));while(Z!=q);if(1b.Eb())return W.mi(W.Ue(b.Ja()),T,"&")}return D=new W,F=(C=new A.hd).Ib(W.Ue(T)),b=C.Ib(W.Ue(b)),D.Gt(C,m,_),_=D.Cv(F,b),T=W.mi(C.Ke(_),T,"&"),A.ba.Ic(T.K())&&(T.Eh(2,m),T.K()==1736&&T.hm()),T},W.XV=function(T,b,m){if(T.B()||b.B())return T.Ja();var _=[null],C=[0],D=b.Eb()==2;if(b.Eb()!=1&&b.Eb()!=2)throw A.i.Ra();return _[0]=T.D(),D?A.jd.nK(b,_,1,m,C):A.jd.oK(b,_,1,m,C),C[0]==0?T.Ja():T},W.prototype.GU=function(T,b,m,_,C){if(T.B())return T;var D=new A.hd;return T=D.Ib(T),this.Ok(D,T,b,m,_,C)},W.prototype.IU=function(T,b,m,_,C,D){if(C&&T.jc(b)!=550){var F=new A.MC;F.PX(T,m),F.Pg?(A.Vk.W(T,m,D,!0),C=!1):this.j.ty(m)}else A.Vk.W(T,m,D,!0),C=!1;if(_&&T.jc(b)!=550?this.j.rJ(T,b,D):this.j.qJ(T,b,D),this.j.kA)return this.j.Wg(),this.j=null,this.Ok(T,b,m,_,!1,D);if(this.j.ty(NaN),D=this.j.Ma(b),this.eq(D+1),this.Ij[D]=!0,T.jc(b)==1736||_&&T.jc(b)!=550)return T.$o(b,0),b=this.Qt(b,-1,-1),(T=T.Ke(b)).$o(0),C?T.Eh(1,0):(T.Eh(2,m),T.hm()),T;if(T.jc(b)==1607)return b=this.Rt(-1),T=T.Ke(b),C||T.Eh(2,m),T;if(T.jc(b)==550)return b=this.pr(),T=T.Ke(b),C||T.Eh(2,m),T;throw A.i.Ra()},W.prototype.Ok=function(T,b,m,_,C,D){this.j=new A.ku;try{return this.IU(T,b,m,_,C,D)}finally{this.j.Wg()}},W.Ok=function(T,b,m,_,C){return new W().GU(T,b,m,_,C)},W.prototype.HU=function(T,b,m,_){this.Ov=T,this.j=new A.ku,T=b.Kn(m);var C=b.jc(m);if(T!=1||C==550?this.j.qJ(b,m,_):this.j.rJ(b,m,_),!this.j.kA)if(this.j.ty(NaN),_=this.j.Ma(m),this.eq(_+1),this.Ij[_]=!0,b.jc(m)==1736||T==1&&b.jc(m)!=550)b.$o(m,0),_=this.Qt(m,-1,-1),b.cC(_,m),b.wB(_);else if(b.jc(m)==1607)_=this.Rt(-1),b.cC(_,m),b.wB(_);else{if(b.jc(m)!=550)throw A.i.ga("internal error");_=this.pr(),b.cC(_,m),b.wB(_)}},W.prototype.km=function(T,b){var m=A.ba.uf(this.j.g.jc(T)),_=A.ba.uf(this.j.g.jc(b));if(m>_)return T;var C=this.j.Ma(T),D=this.j.Ma(b);if(this.eq(1+(C|D)),this.Ij[this.j.Ma(T)]=!0,m==2&&_==2)return this.Qt(T,b,-1);if(m==1&&_==2||m==1&&_==1)return this.Rt(-1);if(m==0)return this.pr();throw A.i.Ra()},W.prototype.Cv=function(T,b){var m=A.ba.uf(this.j.g.jc(T)),_=A.ba.uf(this.j.g.jc(b)),C=this.j.Ma(T),D=this.j.Ma(b);if(this.eq(1+(C|D)),this.Ij[this.j.Ma(T)|this.j.Ma(b)]=!0,C=-1,1b.Eb())return W.mi(W.Ue(T),T,"-");var C=new A.l;T.A(C);var D=new A.l;if(b.A(D),!C.isIntersecting(D))return W.mi(W.Ue(T),T,"-");var F=new A.l;return F.L(C),F.$b(D),m=A.ua.Xd(m,F,!0),D=new W,F=(C=new A.hd).Ib(W.Ue(T)),b=C.Ib(W.Ue(b)),D.Gt(C,m,_),_=D.km(F,b),_=C.Ke(_),T=W.mi(_,T,"-"),A.ba.Ic(T.K())&&(T.Eh(2,m),T.K()==1736&&T.hm()),T},W.QP=function(T,b,m){if(2>T.length)throw A.i.O("not enough geometries to dissolve");for(var _=0,C=0,D=T.length;CZ?W.Ue(T[oe]):(T=_==2,b=A.ua.Xd(_==0?b:null,F,!0),new W().Ok(B,q,b,T,!0,m))},W.Kz=function(T,b,m,_){var C=[null,null,null],D=new A.l;T.A(D);var F=new A.l;b.A(F);var B=new A.l;if(B.L(D),B.$b(F),m=A.ua.Xd(m,B,!0),(B=new A.l).L(F),F=A.ua.Gr(m),B.X(F,F),!D.isIntersecting(B)){if(T.Eb()<=b.Eb())return C[(T=W.mi(W.Ue(T.Ja()),T,"&")).Eb()]=T,C;if(T.Eb()>b.Eb())return C[(T=W.mi(W.Ue(b.Ja()),T,"&")).Eb()]=T,C}for(F=new W,B=(D=new A.hd).Ib(W.Ue(T)),b=D.Ib(W.Ue(b)),F.Gt(D,m,_),_=F.Kz(B,b),b=0;b<_.length;b++)F=W.mi(D.Ke(_[b]),T,"&"),A.ba.Ic(F.K())&&(F.Eh(2,m),F.K()==1736&&F.hm()),C[F.Eb()]=F;return C},W.gp=function(T,b,m,_){if(T.Eb()>b.Eb())return W.mi(W.Ue(T),T,"^");if(T.Eb()m;m++)b[m]=new A.h;T.iB(b),this.bY(b,b),T.bx(b,4)}},W.prototype.bY=function(T,b){for(var m=0;m(b=.5*b.Uk())?Math.sqrt(_):Math.sqrt(b))},W.prototype.MB=function(){this.eb=1,this.qb=this.Lb=this.jb=0,this.bb=1,this.Qb=0},W.prototype.isIdentity=function(T){if(T!==void 0){var b=A.h.construct(0,1);return this.Gh(b,b),b.sub(A.h.construct(0,1)),b.Uk()>T*T?!1:(b.na(0,0),this.Gh(b,b),!(b.Uk()>T*T)&&(b.na(1,0),this.Gh(b,b),b.sub(A.h.construct(1,0)),b.Uk()<=T*T))}return this.eb==1&&this.bb==1&&this.jb==0&&this.Lb==0&&this.qb==0&&this.Qb==0},W.prototype.Di=function(T){return Math.abs(this.eb*this.bb-this.qb*this.jb)<=2*T*(Math.abs(this.eb*this.bb)+Math.abs(this.qb*this.jb))},W.prototype.ig=function(T,b){this.eb=1,this.jb=0,this.Lb=T,this.qb=0,this.bb=1,this.Qb=b},W.prototype.Jt=function(T,b){b!==void 0?(this.eb=T,this.qb=this.Lb=this.jb=0,this.bb=b,this.Qb=0):this.Jt(T,T)},W.prototype.VB=function(){this.eb=0,this.jb=1,this.Lb=0,this.qb=1,this.Qb=this.bb=0},W.prototype.kX=function(T){this.lX(Math.cos(T),Math.sin(T))},W.prototype.lX=function(T,b){this.eb=T,this.jb=-b,this.Lb=0,this.qb=b,this.bb=T,this.Qb=0},W.prototype.shift=function(T,b){this.Lb+=T,this.Qb+=b},W.prototype.scale=function(T,b){this.eb*=T,this.jb*=T,this.Lb*=T,this.qb*=b,this.bb*=b,this.Qb*=b},W.prototype.flipX=function(T,b){this.eb=-this.eb,this.jb=-this.jb,this.Lb=T+b-this.Lb},W.prototype.flipY=function(T,b){this.qb=-this.qb,this.bb=-this.bb,this.Qb=T+b-this.Qb},W.prototype.rotate=function(T){var b=new W;b.kX(T),this.multiply(b)},W.prototype.inverse=function(T){if(T!==void 0){var b=this.eb*this.bb-this.jb*this.qb;b==0?T.lx():(b=1/b,T.Lb=(this.jb*this.Qb-this.Lb*this.bb)*b,T.Qb=(this.Lb*this.qb-this.eb*this.Qb)*b,T.eb=this.bb*b,T.jb=-this.jb*b,T.qb=-this.qb*b,T.bb=this.eb*b)}else this.inverse(this)},W}();A.Ed=ve}(le||(le={})),function(A){var ve=function(){function W(){}return W.prototype.lx=function(){this.Cg=this.Qb=this.Lb=this.Ze=this.We=this.Ve=this.Ye=this.bb=this.jb=this.pf=this.qb=this.eb=0},W.prototype.Jt=function(T,b){this.eb=T,this.jb=this.pf=this.qb=0,this.bb=b,this.We=this.Ve=this.Ye=0,this.Ze=void 0,this.Cg=this.Qb=this.Lb=0},W.prototype.translate=function(T,b,m){this.Lb+=T,this.Qb+=b,this.Cg+=m},W.prototype.hC=function(T){if(!T.B()){for(var b=new A.Od[8],m=0;8>m;m++)b[m]=new A.Od;T.iB(b),this.transform(b,8,b),T.bx(b)}},W.prototype.transform=function(T,b,m){for(var _=0;__;_++)m.wh[_]=-1;m.wh[m.dg[0]]=0}return m.lq=!0,m}return Le(b,T),b.prototype.se=function(m){this.hasAttribute(m)||(this.wh[m]=0,this.eD())},b.prototype.removeAttribute=function(m){if(m==0)throw A.i.O("Position attribue cannot be removed");this.hasAttribute(m)&&(this.wh[m]=-1,this.eD())},b.prototype.reset=function(){this.dg[0]=0,this.Ba=1;for(var m=0;mm;m++)0<=this.wh[m]&&(this.dg[_]=m,this.wh[m]=_,_++,this.Ba++);this.lq=!0},b.prototype.dc=function(){return this.lq&&(this.yl=this.Cn(),this.lq=!1),this.yl},b.prototype.Nb=function(m){if(m==null)return!1;if(m==this)return!0;if(!(m instanceof b)||m.Ba!=this.Ba)return!1;for(var _=0;_D;D++)!m.hasAttribute(D)&&_.hasAttribute(D)&&(C==null&&(C=new b(m)),C.se(D));return C!=null?C.zF():m},b}(A.sa);A.fe=ve;var W=function(){function T(){this.map=[];var b=new ve;this.add(b),(b=new ve).se(1),this.add(b)}return T.fz=function(){return T.XK},T.prototype.VR=function(){return T.gt},T.prototype.add=function(b){var m=b.dc();if(T.gt!=null&&T.gt.dc()==m&&b.BG(T.gt))return T.gt;if(T.Fw!=null&&T.Fw.dc()==m&&b.BG(T.Fw))return T.Fw;var _=null;return this.map[m]!==void 0&&(_=this.map[m]),_==null&&((_=b.oM()).Ba==1?T.gt=_:_.Ba==2&&_.ld(1)==1?T.Fw=_:this.map[m]=_),_},T.XK=new T,T}()}(le||(le={}));var At={feet:9002,kilometers:9036,meters:9001,miles:9093,"nautical-miles":9030,yards:9096},ii={acres:109402,ares:109463,hectares:109401,"square-feet":109405,"square-kilometers":109414,"square-meters":109404,"square-miles":109439,"square-yards":109442},gt=new(function(){function A(){this.MM=50,this.pp=new Map,this.ij=[]}return A.prototype.clear=function(){this.ij.length=0,this.pp.clear()},A.prototype.delete=function(ve){return!!this.pp.delete(ve)&&(this.ij.splice(this.ij.indexOf(ve),1),!0)},A.prototype.get=function(ve){var W=this.pp.get(ve);if(W!==void 0)return this.ij[0]!==ve&&(this.ij.splice(this.ij.indexOf(ve),1),this.ij.unshift(ve)),W},A.prototype.has=function(ve){return this.pp.has(ve)},A.prototype.set=function(ve,W){return this.get(ve)!==void 0&&this.delete(ve),this.ij.unshift(ve),this.pp.set(ve,W),this.jM(),this},A.prototype.jM=function(){for(;this.ij.length&&this.ij.length>this.MM;){var ve=this.ij.pop();this.pp.delete(ve)}},A}()),Ue=((ct={}).convertJSONToGeometry=function(A){return le.ac.aP(A)},ct.hasM=function(A){return A.hasAttribute(le.Kh.M)},ct.hasZ=function(A){return A.hasAttribute(le.Kh.Z)},ct.getPointX=function(A){return A.Ng()},ct.getPointY=function(A){return A.kh()},ct.getPointZ=function(A){return A.XR()},ct.getPointM=function(A){return A.uR()},ct.getXMin=function(A){return A.gs()},ct.getYMin=function(A){return A.js()},ct.getXMax=function(A){return A.fs()},ct.getYMax=function(A){return A.hs()},ct.getZExtent=function(A){return A.Vg(le.Kh.Z,0)},ct.getMExtent=function(A){return A.Vg(le.Kh.M,0)},ct.exportPaths=function(A){var ve=[],W=A.ea(),T=null,b=null,m=A.hasAttribute(le.Kh.Z),_=A.hasAttribute(le.Kh.M);m&&(T=A.vb(le.Kh.Z)),_&&(b=A.vb(le.Kh.M));for(var C=new le.h,D=0;Dr,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),i&&(typeof i=="function"?this._toBBox=i:this._initFormat(i)),this.clear()}destroy(){this.clear(),LN.prune(),Cde.prune(),R_.prune(),Tde.prune()}all(e){this._all(this._data,e)}search(e,i){let r=this._data;const n=this._toBBox;if(Sde(e,r))for(LN.clear();r;){for(let s=0,o=r.children.length;s0;){if(r||(r=R_.pop(),n=R_.data[R_.length-1],s=Tde.pop()??0,o=!0),r.leaf&&(i=F8(r.children,e,r.children.length,r.indexHint),i!==-1))return r.children.splice(i,1),R_.push(r),this._condense(R_),this;o||r.leaf||!CMe(r,a)?n?(s++,r=n.children[s],o=!1):r=null:(R_.push(r),Tde.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,i){let r=e;for(Cde.clear();r;){if(r.leaf===!0)for(const n of r.children)i(n);else Cde.pushArray(r.children);r=Cde.pop()??null}}_build(e,i,r,n){const s=r-i+1;let o=this._maxEntries;if(s<=o){const d=new Ede(e.slice(i,r+1));return HV(d,this._toBBox),d}n||(n=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/o**(n-1)));const a=new TMe([]);a.height=n;const l=Math.ceil(s/o),c=l*Math.ceil(Math.sqrt(o));egt(e,i,r,c,this._compareMinX);for(let d=i;d<=r;d+=c){const p=Math.min(d+c-1,r);egt(e,d,p,l,this._compareMinY);for(let y=d;y<=p;y+=l){const v=Math.min(y+l-1,p);a.children.push(this._build(e,y,v,n-1))}}return HV(a,this._toBBox),a}_chooseSubtree(e,i,r,n){for(;n.push(i),i.leaf!==!0&&n.length-1!==r;){let s,o=1/0,a=1/0;for(let l=0,c=i.children.length;l=0&&R_.data[i].children.length>this._maxEntries;)this._split(R_,i),i--;this._adjustParentBBoxes(s,R_,i)}_split(e,i){const r=e.data[i],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 Ede(a):new TMe(a);l.height=r.height,HV(r,this._toBBox),HV(l,this._toBBox),i?e.data[i-1].children.push(l):this._splitRoot(r,l)}_splitRoot(e,i){this._data=new TMe([e,i]),this._data.height=e.height+1,HV(this._data,this._toBBox)}_chooseSplitIndex(e,i,r){let n,s,o;n=s=1/0;for(let a=i;a<=r-i;a++){const l=fJ(e,0,a,this._toBBox),c=fJ(e,a,r,this._toBBox),d=TRi(l,c),p=SMe(l)+SMe(c);d=i;c--){const d=e.children[c];mJ(a,e.leaf?s(d):d),l+=xde(a)}return l}_adjustParentBBoxes(e,i,r){for(let n=r;n>=0;n--)mJ(i.data[n],e)}_condense(e){for(let i=e.length-1;i>=0;i--){const r=e.data[i];if(r.children.length===0)if(i>0){const n=e.data[i-1],s=n.children;s.splice(F8(s,r,s.length,n.indexHint),1)}else this.clear();else HV(r,this._toBBox)}}_initFormat(e){const i=["return a"," - b",";"];this._compareMinX=new Function("a","b",i.join(e[0])),this._compareMinY=new Function("a","b",i.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 HV(t,e){fJ(t,0,t.children.length,e,t)}function fJ(t,e,i,r,n){n||(n=new Ede([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let s,o=e;o=t.minX&&e.maxY>=t.minY}function egt(t,e,i,r,n){const s=[e,i];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;xrt(t,l,a,o,n),s.push(a,l,l,o)}}const LN=new _m,Cde=new _m,R_=new _m,Tde=new _m({deallocator:void 0});let ERi=class{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}},tgt=class extends ERi{constructor(){super(...arguments),this.height=1,this.indexHint=new Cre}},Ede=class extends tgt{constructor(e){super(),this.children=e,this.leaf=!0}},TMe=class extends tgt{constructor(e){super(),this.children=e,this.leaf=!1}};const IRi=5e4,gJ={minX:0,minY:0,maxX:0,maxY:0};function ARi(t){gJ.minX=t[0],gJ.minY=t[1],gJ.maxX=t[2],gJ.maxY=t[3]}function PRi(t,e,i){ARi(e),t.search(gJ,i)}let EMe=class{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new xMe(9,Gi("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 i=0;this._idByBounds.forEach((r,n)=>{e[i++]=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=twe();for(const i of this._boundsById.values())i&&(e[0]=Math.min(i[0],e[0]),e[1]=Math.min(i[1],e[1]),e[2]=Math.max(i[2],e[2]),e[3]=Math.max(i[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 i=this._boundsById.get(e);this._boundsById.delete(e),i&&(this._idByBounds.delete(i),this._indexInvalid||this._index.remove(i))}forEachInBounds(e,i){this._loadIndex(),PRi(this._index,e,r=>i(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,i){if(!this._indexInvalid){const r=this._boundsById.get(e);r&&(this._index.remove(r),this._idByBounds.delete(r))}this._boundsById.set(e,i),i&&(this._idByBounds.set(i,e),this._indexInvalid||(this._boundsToLoad.push(i),this._boundsToLoad.length>IRi&&this._loadIndex()))}};function IMe(t,e){return t?e?4:3:e?3:2}function igt(t,e,i,r,n){if(lt(e)||!e.lengths.length)return null;const s=n?.originPosition==="upperLeft"?-1:1;t.lengths.length&&(t.lengths.length=0),t.coords.length&&(t.coords.length=0);const o=t.coords,a=[],l=i?[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:c,coords:d}=e,p=IMe(i,r);let y=0;for(const v of c){const S=ORi(l,d,y,v,i,r,s);S&&a.push(S),y+=v*p}if(a.sort((v,S)=>{let I=s*v[2]-s*S[2];return I===0&&i&&(I=v[4]-S[4]),I}),a.length){let v=6*a[0][2];o[0]=a[0][0]/v,o[1]=a[0][1]/v,i&&(v=6*a[0][4],o[2]=v!==0?a[0][3]/v:0),(o[0]l[1]||o[1]l[3]||i&&(o[2]l[5]))&&(o.length=0)}if(!o.length){const v=e.lengths[0]?RRi(d,0,c[0],i,r):null;if(!v)return null;o[0]=v[0],o[1]=v[1],i&&v.length>2&&(o[2]=v[2])}return t}function ORi(t,e,i,r,n,s,o=1){const a=IMe(n,s);let l=i,c=i+a,d=0,p=0,y=0,v=0,S=0;for(let O=0,L=r-1;Ot[1]&&(t[1]=N),Gt[3]&&(t[3]=G),n&&(Vt[5]&&(t[5]=V))}if(v*o>0&&(v*=-1),S*o>0&&(S*=-1),!v)return null;const I=[d,p,.5*v];return n&&(I[3]=y,I[4]=.5*S),I}function RRi(t,e,i,r,n){const s=IMe(r,n);let o=e,a=e+s,l=0,c=0,d=0,p=0;for(let y=0,v=i-1;y0?r?[c/l,d/l,p/l]:[c/l,d/l]:i>0?r?[t[e],t[e+1],t[e+2]]:[t[e],t[e+1]]:null}function MRi(t,e,i,r){const n=i-t,s=r-e;return Math.sqrt(n*n+s*s)}function DRi(t,e,i,r,n,s){const o=r-t,a=n-e,l=s-i;return Math.sqrt(o*o+a*a+l*l)}function FRi(t,e,i,r){return[t+.5*(i-t),e+.5*(r-e)]}function LRi(t,e,i,r,n,s){return[t+.5*(r-t),e+.5*(n-e),i+.5*(s-i)]}const kRi={getObjectId:t=>t.objectId,getAttributes:t=>t.attributes,getAttribute:(t,e)=>t.attributes[e],cloneWithGeometry:(t,e)=>new o_(e,t.attributes,null,t.objectId),getGeometry:t=>t.geometry,getCentroid:(t,e)=>(lt(t.centroid)&&(t.centroid=igt(new Sl,t.geometry,e.hasZ,e.hasM)),t.centroid)},AMe=[0,0];function rgt(t,e){if(!e)return null;if("x"in e){const i={x:0,y:0};return[i.x,i.y]=t(e.x,e.y,AMe),e.z!=null&&(i.z=e.z),e.m!=null&&(i.m=e.m),i}if("xmin"in e){const i={xmin:0,ymin:0,xmax:0,ymax:0};return[i.xmin,i.ymin]=t(e.xmin,e.ymin,AMe),[i.xmax,i.ymax]=t(e.xmax,e.ymax,AMe),e.hasZ&&(i.zmin=e.zmin,i.zmax=e.zmax,i.hasZ=!0),e.hasM&&(i.mmin=e.mmin,i.mmax=e.mmax,i.hasM=!0),i}return"rings"in e?{rings:ngt(e.rings,t),hasM:e.hasM,hasZ:e.hasZ}:"paths"in e?{paths:ngt(e.paths,t),hasM:e.hasM,hasZ:e.hasZ}:"points"in e?{points:sgt(e.points,t),hasM:e.hasM,hasZ:e.hasZ}:null}function ngt(t,e){const i=[];for(const r of t)i.push(sgt(r,e));return i}function sgt(t,e){const i=[];for(const r of t){const n=e(r[0],r[1],[0,0]);i.push(n),r.length>2&&n.push(r[2]),r.length>3&&n.push(r[3])}return i}async function uy(t,e){if(!t||!e)return;const i=Array.isArray(t)?t.map(r=>ye(r.geometry)?r.geometry.spatialReference:null).filter(ye):[t];await YR(i.map(r=>({source:r,dest:e})))}const ogt=rgt.bind(null,Z3),agt=rgt.bind(null,j8);function fp(t,e,i,r){if(!t||(i||(i=e,e=t.spatialReference),!gh(e)||!gh(i)||Ca(e,i)))return t;if(U8(e,i)){const n=Wb(i)?ogt(t):agt(t);return n.spatialReference=i,n}return jq(fu,[t],e,i,null,r)[0]}let NRi=class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,i,r){if(!e||!e.length||!i||!r||Ca(i,r))return e;const n={geometries:e,inSpatialReference:i,outSpatialReference:r,resolve:null};return this._jobs.push(n),new Promise(s=>{n.resolve=s,this._timer===null&&(this._timer=setTimeout(this._process,10))})}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:i,inSpatialReference:r,outSpatialReference:n,resolve:s}=e;U8(r,n)?Wb(n)?s(i.map(ogt)):s(i.map(agt)):s(jq(fu,i,r,n,null,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};const $Ri=new NRi;function BRi(t,e,i){return $Ri.push(t,e,i)}const GRi=new Bs({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),TD=Object.freeze({}),lgt=new Sl,VRi=new Sl,PMe=new Sl,OMe={esriGeometryPoint:gTe,esriGeometryPolyline:kae,esriGeometryPolygon:STe,esriGeometryMultipoint:wTe};function ugt(t,e,i,r=t.hasZ,n=t.hasM){if(lt(e))return null;const s=t.hasZ&&r,o=t.hasM&&n;if(i){const a=UA(PMe,e,t.hasZ,t.hasM,"esriGeometryPoint",i,r,n);return gTe(a,s,o)}return gTe(e,s,o)}function ED(t,e,i,r,n,s,o=e,a=i){const l=e&&o,c=i&&a,d=ye(r)?"coords"in r?r:r.geometry:null;if(lt(d))return null;if(n){let p=UJe(VRi,d,e,i,t,n,o,a);return s&&(p=UA(PMe,p,l,c,t,s)),OMe[t]?.(p,l,c)??null}if(s){const p=UA(PMe,d,e,i,t,s,o,a);return OMe[t]?.(p,l,c)??null}return QJt(lgt,d,e,i,o,a),OMe[t]?.(lgt,l,c)??null}async function cgt(t,e,i){const{outFields:r,orderByFields:n,groupByFieldsForStatistics:s,outStatistics:o}=t;if(r)for(let a=0;afp(r,Df));return(await zRi())(o.spatialReference,o,e,s)}async function zRi(){return(await Promise.resolve().then(()=>lZ)).geodesicBuffer}function WV(t){return t&&pgt in t?JSON.parse(JSON.stringify(t,HRi)):t}const pgt="_geVersion",HRi=(t,e)=>t!==pgt?e:void 0,WRi=Qb();let yJ=class{constructor(e){this.geometryInfo=e,this._boundsStore=new EMe,this._featuresById=new Map,this._markedIds=new Set,this.events=new cd,this.featureAdapter=kRi}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(i=>{ye(i.geometry)&&i.geometry.coords&&(e+=i.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(lt(this.fullBounds))return null;const[i,r,n,s]=this.fullBounds;return{xmin:i,ymin:r,xmax:n,ymax:s,spatialReference:WV(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const i of e)this._add(i);this._emitChanged()}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const i=this._featuresById.get(e);return i?(this._remove(i),this._emitChanged(),i):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const i of e){const r=this._featuresById.get(i);r&&this._remove(r)}this._emitChanged()}forEachBounds(e,i){for(const r of e){const n=this._boundsStore.get(r.objectId);n&&i(yGt(WRi,n))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(i=>e(i))}forEachInBounds(e,i){this._boundsStore.forEachInBounds(e,r=>{i(this._featuresById.get(r))})}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach((i,r)=>{this._markedIds.has(r)||(e=!0,this._remove(i))}),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const i=e.objectId;if(i==null)return void Ei.getLogger("esri.layers.graphics.data.FeatureStore").error(new st("featurestore:invalid-feature","feature id is missing",{feature:e}));const r=this._featuresById.get(i);let n;if(this._markedIds.add(i),r?(e.displayId=r.displayId,n=this._boundsStore.get(i),this._boundsStore.delete(i)):ye(this.onFeatureAdd)&&this.onFeatureAdd(e),lt(e.geometry)||!e.geometry.coords||!e.geometry.coords.length)return this._boundsStore.set(i,null),void this._featuresById.set(i,e);n=Nae(ye(n)?n:_o(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),ye(n)&&this._boundsStore.set(i,n),this._featuresById.set(i,e)}_remove(e){ye(this.onFeatureRemove)&&this.onFeatureRemove(e);const i=e.objectId;return this._markedIds.delete(i),this._boundsStore.delete(i),this._featuresById.delete(i),e}},qRi=class{constructor(e,i){this._cache=new hae(e),this._invalidCache=new hae(i)}get(e,i){const r=`${i.uid}:${e}`,n=this._cache.get(r);if(n)return n;if(this._invalidCache.get(r)!==void 0)return null;try{const s=Oa.create(e,i);return this._cache.put(r,s),s}catch{return this._invalidCache.put(r,null),null}}};const RMe=new qRi(50,500),ID="feature-store:unsupported-query",fgt=" as ",YRi=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeDate"]);function XRi(t,e){if(!e)return!0;const i=RMe.get(e,t);if(!i)throw new st(ID,"invalid SQL expression",{where:e});if(!i.isStandardized)throw new st(ID,"where clause is not standard",{where:e});return AD(t,i.fieldNames,"where clause contains missing fields"),!0}function KRi(t,e,i){if(!e)return!0;const r=RMe.get(e,t);if(!r)throw new st(ID,"invalid SQL expression",{having:e});if(!r.isAggregate)throw new st(ID,"having does not contain a valid aggregate function",{having:e});const n=r.fieldNames;if(AD(t,n,"having contains missing fields"),!r.getExpressions().every(s=>{const{aggregateType:o,field:a}=s,l=t.get(a)?.name;return i.some(c=>{const{onStatisticField:d,statisticType:p}=c;return t.get(d)?.name===l&&p.toLowerCase().trim()===o})}))throw new st(ID,"expressions in having should also exist in outStatistics",{having:e});return!0}function qV(t,e){return t?RMe.get(t,e):null}function AD(t,e,i,r=!0){const n=[];for(const s of e)if(s!=="*"&&!t.has(s))if(r){const o=mgt(s);try{const a=qV(o,t);if(!a)throw new st(ID,"invalid SQL expression",{where:o});if(!a.isStandardized)throw new st(ID,"expression is not standard",{clause:a});AD(t,a.fieldNames,"expression contains missing fields")}catch(a){const l=a&&a.details;if(l&&(l.clause||l.where))throw a;l&&l.missingFields?n.push(...l.missingFields):n.push(s)}}else n.push(s);if(n.length)throw new st(ID,i,{missingFields:n})}function mgt(t){return t.split(fgt)[0]}function JRi(t){return t.split(fgt)[1]}function ZRi(t,e){const i=e.get(t);return!!i&&!YRi.has(i.type)}const ggt={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,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 Ide=class{constructor(e,i,r){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=r,this.featureAdapter=i;const n=e.outFields;if(n&&!n.includes("*")){this.outFields=n;let s=0;for(const o of n){const a=mgt(o),l=this.fieldsIndex.get(a),c=l?null:qV(a,r),d=l?l.name:JRi(o)||"FIELD_EXP_"+s++;this._fieldDataCache.set(o,{alias:d,clause:c})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach(i=>this.getAttributes(i)),this._returnDistinctMap.size):e.length}getAttributes(e){const i=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(i)}getFieldValue(e,i,r){const n=r?r.name:i;let s=null;return this._fieldDataCache.has(n)?s=this._fieldDataCache.get(n)?.clause:r||(s=qV(i,this.fieldsIndex),this._fieldDataCache.set(n,{alias:n,clause:s})),r?this.featureAdapter.getAttribute(e,n):s?.calculateValue(e,this.featureAdapter)}getDataValue(e,i){const r=i.normalizationType,n=i.normalizationTotal;let s=i.field&&this.getFieldValue(e,i.field,this.fieldsIndex.get(i.field));if(i.field2&&(s=`${aS(s)}${i.fieldDelimiter}${aS(this.getFieldValue(e,i.field2,this.fieldsIndex.get(i.field2)))}`,i.field3&&(s=`${s}${i.fieldDelimiter}${aS(this.getFieldValue(e,i.field3,this.fieldsIndex.get(i.field3)))}`)),r&&Number.isFinite(s)){const o=r==="field"&&i.normalizationField?this.getFieldValue(e,i.normalizationField,this.fieldsIndex.get(i.normalizationField)):null;s=cmt(s,r,o,n)}return s}getExpressionValue(e,i,r,n){const s={attributes:this.featureAdapter.getAttributes(e),layer:{fields:this.fieldsIndex.fields}},o=n.createExecContext(s,r);return n.executeFunction(i,o)}getExpressionValues(e,i,r,n){const s={fields:this.fieldsIndex.fields};return e.map(o=>{const a={attributes:this.featureAdapter.getAttributes(o),layer:s},l=n.createExecContext(a,r);return n.executeFunction(i,l)})}validateItem(e,i){return this._fieldDataCache.has(i)||this._fieldDataCache.set(i,{alias:i,clause:qV(i,this.fieldsIndex)}),this._fieldDataCache.get(i)?.clause?.testFeature(e,this.featureAdapter)??!1}validateItems(e,i){return this._fieldDataCache.has(i)||this._fieldDataCache.set(i,{alias:i,clause:qV(i,this.fieldsIndex)}),this._fieldDataCache.get(i)?.clause?.testSet(e,this.featureAdapter)??!1}_processAttributesForOutFields(e){const i=this.outFields;if(!i||!i.length)return this.featureAdapter.getAttributes(e);const r={};for(const n of i){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(lt(e)||!this.returnDistinctValues)return e;const i=this.outFields,r=[];if(i)for(const o of i){const{alias:a}=this._fieldDataCache.get(o);r.push(e[a])}else for(const o in e)r.push(e[o]);const n=`${(i||["*"]).join(",")}=${r.join(",")}`;let s=this._returnDistinctMap.get(n)||0;return this._returnDistinctMap.set(n,++s),s>1?null:e}};function QRi(t,e,i){return{objectId:t,target:e,distance:i,type:"vertex"}}function eMi(t,e,i,r,n,s=!1){return{objectId:t,target:e,distance:i,type:"edge",start:r,end:n,draped:s}}let M_=class{constructor(e,i,r){this.items=e,this.query=i,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 Ide(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:i,having:r,outStatistics:n}=this.query;if(!i?.length)return 1;const o=new Map,a=new Map,l=new Set;for(const c of n){const{statisticType:d}=c,p=d!=="exceedslimit"?c.onStatisticField:void 0;if(!a.has(p)){const v=[];for(const S of i){const I=this._getAttributeValues(e,S,o);v.push(I)}a.set(p,this._calculateUniqueValues(v,e.returnDistinctValues))}const y=a.get(p);for(const v in y){const{data:S,items:I}=y[v],O=S.join(",");r&&!e.validateItems(I,r)||l.add(O)}}return l.size}async createQueryResponse(){let e;if(this.query.outStatistics?e=this.query.outStatistics.some(i=>i.statisticType==="exceedslimit")?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):e=this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const i=this.query.geometry;gh(this.query.outSR)&&!Ca(i.spatialReference,this.query.outSR)?e.queryGeometry=WV({spatialReference:this.query.outSR,...fp(i,i.spatialReference,this.query.outSR)}):e.queryGeometry=WV({spatialReference:this.query.outSR,...i})}return e}createSnappingResponse(e,i){const r=this.featureAdapter,n=ygt(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,c={candidates:[]},d=this.geometryType==="esriGeometryPolygon",p=this._getPointCreator(o,this.spatialReference,i),y=new vgt(null,0),v=new vgt(null,0),S={x:0,y:0,z:0};for(const I of this.items){const O=r.getGeometry(I);if(lt(O))continue;const{coords:L,lengths:N}=O;if(y.coords=L,v.coords=L,e.types&kN.EDGE){let G=0;for(let V=0;VI.distance-O.distance),c}_getPointCreator(e,i,r){const n=ye(r)&&!Ca(i,r)?a=>fp(a,i,r):a=>a,{hasZ:s}=this,o=0;return e==="3d"?s?({x:a,y:l,z:c})=>n({x:a,y:l,z:c}):({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:i,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,minValue:a,maxValue:l,scale:c}=e,d=this.fieldsIndex.isDateField(i),p=await this._getDataValues({field:i,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,scale:c}),y=yMe({normalizationType:s,normalizationField:n,minValue:a,maxValue:l}),v=this.fieldsIndex.get(i),S={value:.5,fieldType:v?.type},I=ube(v)?vMe({values:p,supportsNullCount:y,percentileParams:S}):vde({values:p,minValue:a,maxValue:l,useSampleStdDev:!s,supportsNullCount:y,percentileParams:S});return amt(I,d)}async createUniqueValuesResponse(e){const{field:i,valueExpression:r,domains:n,returnAllCodedValues:s,scale:o}=e,a=await this._getDataValues({field:i,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:r,scale:o}),l=lmt(a);return umt(l,n,s,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:i,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:l,minValue:c,maxValue:d,numClasses:p,scale:y}=e,v=await this._getDataValues({field:i,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,scale:y}),S=wMe(v,{field:i,normalizationField:n,normalizationType:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:l,minValue:c,maxValue:d,numClasses:p});return hmt(S,a)}async createHistogramResponse(e){const{field:i,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:l,minValue:c,maxValue:d,numBins:p,scale:y}=e,v=await this._getDataValues({field:i,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,scale:y});return dmt(v,{field:i,normalizationField:n,normalizationType:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:l,minValue:c,maxValue:d,numBins:p})}_sortFeatures(e,i,r){if(e.length>1&&i&&i.length)for(const n of i.reverse()){const s=n.split(" "),o=s[0],a=this.fieldsIndex.get(o),l=!!s[1]&&s[1].toLowerCase()==="desc",c=nmt(a?.type,l);e.sort((d,p)=>{const y=r(d,o,a),v=r(p,o,a);return c(y,v)})}}_createFeatureQueryResponse(e){const i=this.items,{geometryType:r,hasM:n,hasZ:s,objectIdField:o,spatialReference:a}=this,{outFields:l,outSR:c,quantizationParameters:d,resultRecordCount:p,resultOffset:y,returnZ:v,returnM:S}=e,I=p!=null&&i.length>(y||0)+p,O=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(L=>this.fieldsIndex.get(L)));return{exceededTransferLimit:I,features:this._createFeatures(e,i),fields:O,geometryType:r,hasM:n&&S,hasZ:s&&v,objectIdFieldName:o,spatialReference:WV(c||a),transform:d&&yde(d)||null}}_createFeatures(e,i){const r=new Ide(e,this.featureAdapter,this.fieldsIndex),{hasM:n,hasZ:s}=this,{orderByFields:o,quantizationParameters:a,returnGeometry:l,returnCentroid:c,maxAllowableOffset:d,resultOffset:p,resultRecordCount:y,returnZ:v=!1,returnM:S=!1}=e,I=s&&v,O=n&&S;let L=[],N=0;const G=[...i];if(this._sortFeatures(G,o,(Y,X,te)=>r.getFieldValue(Y,X,te)),l||c){const Y=yde(a)??void 0;if(l&&!c)for(const X of G)L[N++]={attributes:r.getAttributes(X),geometry:ED(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(X),d,Y,I,O)};else if(!l&&c)for(const X of G)L[N++]={attributes:r.getAttributes(X),centroid:ugt(this,this.featureAdapter.getCentroid(X,this),Y)};else for(const X of G)L[N++]={attributes:r.getAttributes(X),centroid:ugt(this,this.featureAdapter.getCentroid(X,this),Y),geometry:ED(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(X),d,Y,I,O)}}else for(const Y of G){const X=r.getAttributes(Y);X&&(L[N++]={attributes:X})}const V=p||0;if(y!=null){const Y=V+y;L=L.slice(V,Math.min(L.length,Y))}return L}_createExceedsLimitQueryResponse(e){let i=!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")i=this.items.length>r;else if(this.items.length>n)i=!0;else{const o=ygt(this.hasZ,this.hasM),a=this.featureAdapter;i=this.items.reduce((l,c)=>{const d=a.getGeometry(c);return l+(ye(d)&&d.coords.length||0)},0)/o>s}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(i)}}]}}async _createStatisticsQueryResponse(e){const i={attributes:{}},r=[],n=new Map,s=new Map,o=new Map,a=new Map,l=new Ide(e,this.featureAdapter,this.fieldsIndex),c=e.outStatistics,{groupByFieldsForStatistics:d,having:p,orderByFields:y}=e,v=d&&d.length,S=!!v,I=S?d[0]:null,O=S&&!this.fieldsIndex.get(I);for(const N of c??[]){const{outStatisticFieldName:G,statisticType:V}=N,Y=N,X=V!=="exceedslimit"?N.onStatisticField:void 0,te=V==="percentile_disc"||V==="percentile_cont",re=V==="EnvelopeAggregate"||V==="CentroidAggregate"||V==="ConvexHullAggregate",fe=S&&v===1&&(X===I||O)&&V==="count";if(S){if(!o.has(X)){const _e=[];for(const Ie of d){const ke=this._getAttributeValues(l,Ie,n);_e.push(ke)}o.set(X,this._calculateUniqueValues(_e,!re&&l.returnDistinctValues))}const ge=o.get(X);for(const _e in ge){const{count:Ie,data:ke,items:Ne,itemPositions:J}=ge[_e],he=ke.join(",");if(!p||l.validateItems(Ne,p)){const xe=a.get(he)||{attributes:{}};if(re){xe.aggregateGeometries||(xe.aggregateGeometries={});const{aggregateGeometries:Oe,outStatisticFieldName:Ae}=await this._getAggregateGeometry(Y,Ne);xe.aggregateGeometries[Ae]=Oe}else{let Oe=null;if(fe)Oe=Ie;else{const Ae=this._getAttributeValues(l,X,n),ze=J.map(Ge=>Ae[Ge]);Oe=te&&"statisticParameters"in Y?this._getPercentileValue(Y,ze):this._getStatisticValue(Y,ze,null,l.returnDistinctValues)}xe.attributes[G]=Oe}let Pe=0;d.forEach((Oe,Ae)=>xe.attributes[this.fieldsIndex.get(Oe)?Oe:"EXPR_"+ ++Pe]=ke[Ae]),a.set(he,xe)}}}else if(re){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:ge,outStatisticFieldName:_e}=await this._getAggregateGeometry(Y,this.items);i.aggregateGeometries[_e]=ge}else{const ge=this._getAttributeValues(l,X,n);i.attributes[G]=te&&"statisticParameters"in Y?this._getPercentileValue(Y,ge):this._getStatisticValue(Y,ge,s,l.returnDistinctValues)}r.push({name:G,alias:G,type:"esriFieldTypeDouble"})}const L=S?Array.from(a.values()):[i];return this._sortFeatures(L,y,(N,G)=>N.attributes[G]),{fields:r,features:L}}async _getAggregateGeometry(e,i){const r=await Promise.resolve().then(()=>lZ),{statisticType:n,outStatisticFieldName:s}=e,{featureAdapter:o,spatialReference:a,geometryType:l,hasZ:c,hasM:d}=this,p=i.map(S=>ED(l,c,d,o.getGeometry(S))),y=r.convexHull(a,p,!0)[0],v={aggregateGeometries:null,outStatisticFieldName:null};if(n==="EnvelopeAggregate"){const S=y?rbe(y):ibe(r.union(a,p));v.aggregateGeometries={...S,spatialReference:a},v.outStatisticFieldName=s||"extent"}else if(n==="CentroidAggregate"){const S=y?Ine(y):M9t(ibe(r.union(a,p)));v.aggregateGeometries={x:S[0],y:S[1],spatialReference:a},v.outStatisticFieldName=s||"centroid"}else n==="ConvexHullAggregate"&&(v.aggregateGeometries=y,v.outStatisticFieldName=s||"convexHull");return v}_getStatisticValue(e,i,r,n){const{onStatisticField:s,statisticType:o}=e;let a=null;return a=r?.has(s)?r.get(s):ube(this.fieldsIndex.get(s))?vMe({values:i,returnDistinct:n}):vde({values:n?[...new Set(i)]:i,minValue:null,maxValue:null,useSampleStdDev:!0}),r&&r.set(s,a),a[o==="var"?"variance":o]}_getPercentileValue(e,i){const{onStatisticField:r,statisticParameters:n,statisticType:s}=e,{value:o,orderBy:a}=n,l=this.fieldsIndex.get(r);return _Me(i,{value:o,orderBy:a,fieldType:l?.type,isDiscrete:s==="percentile_disc"})}_getAttributeValues(e,i,r){if(r.has(i))return r.get(i);const n=this.fieldsIndex.get(i),s=this.items.map(o=>e.getFieldValue(o,i,n));return r.set(i,s),s}_getAttributeDataValues(e,i){return this.items.map(r=>e.getDataValue(r,{field:i.field,field2:i.field2,field3:i.field3,fieldDelimiter:i.fieldDelimiter,normalizationField:i.normalizationField,normalizationType:i.normalizationType,normalizationTotal:i.normalizationTotal}))}async _getAttributeExpressionValues(e,i,r){const{arcadeUtils:n}=await Wv(),s=n.createFunction(i),o=r&&n.getViewInfo(r);return e.getExpressionValues(this.items,s,o,n)}_calculateUniqueValues(e,i){const r={},n=this.items,s=n.length;for(let o=0;o=o||S=o)&&p+(o-y)/(S-y)*(v-p)lZ)}function vJ(t,e,i,r,n){if(Va(e)&&i==="esriGeometryPoint"&&(t==="esriSpatialRelIntersects"||t==="esriSpatialRelContains")){const s=cM(new Sl,e,!1,!1);return Promise.resolve(o=>rMi(s,!1,!1,o))}if(Va(e)&&i==="esriGeometryMultipoint"){const s=cM(new Sl,e,!1,!1);if(t==="esriSpatialRelContains")return Promise.resolve(o=>nMi(s,!1,!1,o,r,n))}if(ac(e)&&i==="esriGeometryPoint"&&(t==="esriSpatialRelIntersects"||t==="esriSpatialRelContains"))return Promise.resolve(s=>WH(e,ED(i,r,n,s)));if(ac(e)&&i==="esriGeometryMultipoint"&&t==="esriSpatialRelContains")return Promise.resolve(s=>j$t(e,ED(i,r,n,s)));if(ac(e)&&t==="esriSpatialRelIntersects"){const s=iMi(i);return Promise.resolve(o=>s(e,ED(i,r,n,o)))}return cMi().then(s=>{const o=s[oMi[t]].bind(null,e.spatialReference,e);return a=>o(ED(i,r,n,a))})}async function wgt(t,e,i){const{spatialRel:r,geometry:n}=t;if(n){if(!aMi(r))throw new st(MMe,"Unsupported query spatial relationship",{query:t});if(gh(n.spatialReference)&&gh(i)){if(!lMi(n))throw new st(MMe,"Unsupported query geometry type",{query:t});if(!uMi(e))throw new st(MMe,"Unsupported layer geometry type",{query:t});if(t.outSR)return uy(t.geometry&&t.geometry.spatialReference,t.outSR)}}}function xgt(t){if(ac(t))return!0;if(Va(t)){for(const e of t.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}async function hMi(t,e){if(!t)return null;const i=e.featureAdapter,{startTimeField:r,endTimeField:n}=t;let s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;if(r&&n)await e.forEach(a=>{const l=i.getAttribute(a,r),c=i.getAttribute(a,n);l==null||isNaN(l)||(s=Math.min(s,l)),c==null||isNaN(c)||(o=Math.max(o,c))});else{const a=r||n;await e.forEach(l=>{const c=i.getAttribute(l,a);c==null||isNaN(c)||(s=Math.min(s,c),o=Math.max(o,c))})}return{start:s,end:o}}function Sgt(t,e,i){if(!e||!t)return null;const{startTimeField:r,endTimeField:n}=t;if(!r&&!n)return null;const{start:s,end:o}=e;return s===null&&o===null?null:s===void 0&&o===void 0?fMi():r&&n?dMi(i,r,n,s,o):pMi(i,r||n,s,o)}function dMi(t,e,i,r,n){return r!=null&&n!=null?s=>{const o=t.getAttribute(s,e),a=t.getAttribute(s,i);return(o==null||o<=n)&&(a==null||a>=r)}:r!=null?s=>{const o=t.getAttribute(s,i);return o==null||o>=r}:n!=null?s=>{const o=t.getAttribute(s,e);return o==null||o<=n}:void 0}function pMi(t,e,i,r){return i!=null&&r!=null&&i===r?n=>t.getAttribute(n,e)===i:i!=null&&r!=null?n=>{const s=t.getAttribute(n,e);return s>=i&&s<=r}:i!=null?n=>t.getAttribute(n,e)>=i:r!=null?n=>t.getAttribute(n,e)<=r:void 0}function fMi(){return()=>!1}function mMi(t){return t!=null&&t.every(e=>e.statisticType!=="exceedslimit")}const PD="feature-store:unsupported-query",gMi=new uxe(2e6);let yMi=0,NN=class{constructor(e){this._geometryQueryCache=null,this._changeHandle=null,this.capabilities={query:ggt},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 TVt(yMi+++"$$",gMi)),this.fieldsIndex=new Am(e.fields),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=Bc(this._frameTask),this.clearCache(),ra(this._geometryQueryCache),this._changeHandle=Bc(this._changeHandle),ra(this.fieldsIndex)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._geometryQueryCache?.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null}async executeQuery(e,i){try{return(await this._executeQuery(e,{},i)).createQueryResponse()}catch(r){if(r!==TD)throw r;return new M_([],e,this).createQueryResponse()}}async executeQueryForCount(e={},i){try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},i)).createQueryResponseForCount()}catch(r){if(r!==TD)throw r;return 0}}async executeQueryForExtent(e,i){const r=e.outSR;try{const n=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},i),s=n.size;return s?{count:s,extent:await this._getBounds(n.items,n.spatialReference,r||this.spatialReference)}:{count:0,extent:null}}catch(n){if(n===TD)return{count:0,extent:null};throw n}}async executeQueryForIds(e,i){return this.executeQueryForIdSet(e,i).then(r=>Array.from(r))}async executeQueryForIdSet(e,i){try{const r=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},i),n=r.items,s=new Set;return await this._reschedule(()=>{for(const o of n)s.add(r.featureAdapter.getObjectId(o))},i),s}catch(r){if(r===TD)return new Set;throw r}}async executeQueryForSnapping(e,i){const{point:r,distance:n,types:s}=e;if(s===kN.NONE)return{candidates:[]};const o=await this._reschedule(()=>this._checkQuerySupport(e.query),i),a=!Ca(r.spatialReference,this.spatialReference);a&&await uy(r.spatialReference,this.spatialReference);const l=typeof n=="number"?n:n.x,c=typeof n=="number"?n:n.y,d={xmin:r.x-l,xmax:r.x+l,ymin:r.y-c,ymax:r.y+c,spatialReference:r.spatialReference},p=a?fp(d,this.spatialReference):d;if(!p)return{candidates:[]};const y=(await iv(fl(r),null,{signal:i}))[0],v=(await iv(fl(p),null,{signal:i}))[0];if(lt(y)||lt(v))return{candidates:[]};const S=new M_(await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(v.toJSON())),i),o,this);await this._reschedule(()=>this._executeObjectIdsQuery(S),i),await this._reschedule(()=>this._executeTimeQuery(S),i),await this._reschedule(()=>this._executeAttributesQuery(S),i);const I=y.toJSON(),O=a?fp(I,this.spatialReference):I,L=a?Math.max(p.xmax-p.xmin,p.ymax-p.ymin)/2:n;return S.createSnappingResponse({...e,point:O,distance:L},r.spatialReference)}async executeQueryForLatestObservations(e,i){if(!this.timeInfo||!this.timeInfo.trackIdField)throw new st(PD,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const r=await this._executeQuery(e,{},i);return await this._reschedule(()=>this._filterLatest(r),i),r.createQueryResponse()}catch(r){if(r!==TD)throw r;return new M_([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},i,r){const{field:n,normalizationField:s,valueExpression:o}=i;return(await this._getQueryEngineResultForStats(e,{field:n,normalizationField:s,valueExpression:o},r)).createSummaryStatisticsResponse(i)}async executeQueryForUniqueValues(e={},i,r){const{field:n,field2:s,field3:o,valueExpression:a}=i;return(await this._getQueryEngineResultForStats(e,{field:n,field2:s,field3:o,valueExpression:a},r)).createUniqueValuesResponse(i)}async executeQueryForClassBreaks(e={},i,r){const{field:n,normalizationField:s,valueExpression:o}=i;return(await this._getQueryEngineResultForStats(e,{field:n,normalizationField:s,valueExpression:o},r)).createClassBreaksResponse(i)}async executeQueryForHistogram(e={},i,r){const{field:n,normalizationField:s,valueExpression:o}=i;return(await this._getQueryEngineResultForStats(e,{field:n,normalizationField:s,valueExpression:o},r)).createHistogramResponse(i)}async fetchRecomputedExtents(e){const[i,r]=await Promise.all(["getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getBounds(await this._getAllFeatures(),this.spatialReference,this.spatialReference),ye(this._timeExtentPromise)?this._timeExtentPromise:this._timeExtentPromise=hMi(this.timeInfo,this.featureStore)]);return sn(e),{fullExtent:i,timeExtent:r}}async _getBounds(e,i,r){const n=m7e(Qb(),f9);await this.featureStore.forEachBounds(e,a=>AW(n,a));const s={xmin:n[0],ymin:n[1],xmax:n[3],ymax:n[4],spatialReference:WV(this.spatialReference)};this.hasZ&&isFinite(n[2])&&isFinite(n[5])&&(s.zmin=n[2],s.zmax=n[5]);const o=fp(s,i,r);if(o.spatialReference=WV(r),o.xmax-o.xmin==0){const a=Vc(o.spatialReference);o.xmin-=a,o.xmax+=a}if(o.ymax-o.ymin==0){const a=Vc(o.spatialReference);o.ymin-=a,o.ymax+=a}if(this.hasZ&&o.zmin!=null&&o.zmax!=null&&o.zmax-o.zmin==0){const a=Vc(o.spatialReference);o.zmin-=a,o.zmax+=a}return o}async _schedule(e,i){return ye(this._frameTask)?this._frameTask.schedule(e,i):e($le)}async _reschedule(e,i){return ye(this._frameTask)?this._frameTask.reschedule(e,i):e($le)}async _getAllFeaturesQueryEngineResult(e){return new M_(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(lt(this._allFeaturesPromise)){const r=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach(n=>r.push(n))})().then(()=>r)}const e=this._allFeaturesPromise,i=await e;return e===this._allFeaturesPromise?i.slice():this._getAllFeatures()}async _executeQuery(e,i,r){e=hi(e),e=await this._schedule(()=>cgt(e,this.definitionExpression,this.spatialReference),r),e=await this._reschedule(()=>this._checkQuerySupport(e),r),e={...e,...i};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,i){if(lt(e.sceneFilter))return null;const{outSR:r,returnGeometry:n,returnCentroid:s}=e,o=this.featureStore.featureSpatialReference,a=e.sceneFilter.geometry,l=lt(o)||Ca(o,a.spatialReference)?a:fp(a,o);if(!l)return null;const c=n||s,d=gh(r)&&!Ca(this.spatialReference,r)&&c?async I=>this._project(I,r):I=>I,p=this.featureAdapter,y=await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(l)),i);if(e.sceneFilter.spatialRelationship==="disjoint"){if(!y.length)return null;const I=new Set;for(const N of y)I.add(p.getObjectId(N));const O=await this._reschedule(()=>this._getAllFeatures(),i),L=await this._reschedule(async()=>{const N=await vJ("esriSpatialRelDisjoint",l,this.geometryType,this.hasZ,this.hasM),G=Y=>!I.has(p.getObjectId(Y))||N(p.getGeometry(Y)),V=await this._runSpatialFilter(O,G,i);return new M_(V,e,this)},i);return d(L)}if(!y.length)return new M_([],e,this);if(this._canExecuteSinglePass(l,e))return d(new M_(y,e,this));const v=await vJ("esriSpatialRelContains",l,this.geometryType,this.hasZ,this.hasM),S=await this._runSpatialFilter(y,I=>v(p.getGeometry(I)),i);return d(new M_(S,e,this))}async _executeGeometryQuery(e,i,r){if(ye(i)&&i.items.length===0)return i;e=ye(i)?i.query:e;const{geometry:n,outSR:s,spatialRel:o,returnGeometry:a,returnCentroid:l}=e,c=this.featureStore.featureSpatialReference,d=!n||lt(c)||Ca(c,n.spatialReference)?n:fp(n,c),p=a||l,y=gh(s)&&!Ca(this.spatialReference,s),v=this._geometryQueryCache&<(i)?JSON.stringify(y&&p?{originalFilterGeometry:n,spatialRelationship:o,outSpatialReference:s}:{originalFilterGeometry:n,spatialRelationship:o}):null,S=v?this._geometryQueryCache.get(v):null;if(ye(S))return new M_(S,e,this);const I=async V=>(y&&p&&await this._project(V,s),v&&this._geometryQueryCache.put(v,V.items,V.items.length+1),V);if(!d)return I(ye(i)?i:await this._getAllFeaturesQueryEngineResult(e));const O=this.featureAdapter;let L=await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(n)),r);if(o==="esriSpatialRelDisjoint"){if(!L.length)return I(ye(i)?i:await this._getAllFeaturesQueryEngineResult(e));const V=new Set;for(const te of L)V.add(O.getObjectId(te));const Y=ye(i)?i.items:await this._reschedule(()=>this._getAllFeatures(),r),X=await this._reschedule(async()=>{const te=await vJ(o,d,this.geometryType,this.hasZ,this.hasM),re=ge=>!V.has(O.getObjectId(ge))||te(O.getGeometry(ge)),fe=await this._runSpatialFilter(Y,re,r);return new M_(fe,e,this)},r);return I(X)}if(ye(i)){const V=new Cre;L=L.filter(Y=>F8(i.items,Y,i.items.length,V)>=0)}if(!L.length){const V=new M_([],e,this);return v&&this._geometryQueryCache.put(v,V.items,1),V}if(this._canExecuteSinglePass(d,e))return I(new M_(L,e,this));const N=await vJ(o,d,this.geometryType,this.hasZ,this.hasM),G=await this._runSpatialFilter(L,V=>N(O.getGeometry(V)),r);return I(new M_(G,e,this))}_executeAggregateIdsQuery(e){if(e.items.length===0||!e.query.aggregateIds||!e.query.aggregateIds.length||lt(this.aggregateAdapter))return;const i=new Set;for(const n of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(n).forEach(s=>i.add(s));const r=this.featureAdapter.getObjectId;e.items=e.items.filter(n=>i.has(r(n)))}_executeObjectIdsQuery(e){if(e.items.length===0||!e.query.objectIds||!e.query.objectIds.length)return;const i=new Set(e.query.objectIds),r=this.featureAdapter.getObjectId;e.items=e.items.filter(n=>i.has(r(n)))}_executeTimeQuery(e){if(e.items.length===0)return;const i=Sgt(this.timeInfo,e.query.timeExtent,this.featureAdapter);lt(i)||(e.items=e.items.filter(i))}_executeAttributesQuery(e){if(e.items.length===0)return;const i=qV(e.query.where,this.fieldsIndex);if(i){if(!i.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(r=>i.testFeature(r,this.featureAdapter))}}async _runSpatialFilter(e,i,r){if(!i)return e;if(lt(this._frameTask))return e.filter(a=>i(a));let n=0;const s=new Array,o=async a=>{for(;no(c),r)}};return this._reschedule(a=>o(a),r).then(()=>s)}_filterLatest(e){const{trackIdField:i,startTimeField:r,endTimeField:n}=this.timeInfo,s=n||r,o=new Map,a=this.featureAdapter.getAttribute;for(const l of e.items){const c=a(l,i),d=a(l,s),p=o.get(c);(!p||d>a(p,s))&&o.set(c,l)}e.items=Array.from(o.values())}_canExecuteSinglePass(e,i){const{spatialRel:r}=i;return xgt(e)&&(r==="esriSpatialRelEnvelopeIntersects"||this.geometryType==="esriGeometryPoint"&&(r==="esriSpatialRelIntersects"||r==="esriSpatialRelContains"||r==="esriSpatialRelWithin"))}async _project(e,i){if(!i||Ca(this.spatialReference,i))return e;const r=this.featureAdapter,n=await BRi(e.items.map(s=>ED(this.geometryType,this.hasZ,this.hasM,r.getGeometry(s))),this.spatialReference,i);return e.items=n.map((s,o)=>r.cloneWithGeometry(e.items[o],H5(s,this.hasZ,this.hasM))),e}_getQueryBBoxes(e){if(xgt(e)){if(ac(e))return[tse(e.xmin,e.ymin,e.xmax,e.ymax)];if(Va(e))return e.rings.map(i=>tse(Math.min(i[0][0],i[2][0]),Math.min(i[0][1],i[2][1]),Math.max(i[0][0],i[2][0]),Math.max(i[0][1],i[2][1])))}return[DC(_o(),e)]}async _searchFeatures(e){const i=new Set;await Promise.all(e.map(n=>this.featureStore.forEachInBounds(n,s=>i.add(s))));const r=Array.from(i.values());return i.clear(),r}async _checkStatisticsSupport(e,i){if((e.distance??0)<0||e.geometryPrecision!=null||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new st(PD,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),Promise.all([this._checkStatisticsParamsSupport(i),wgt(e,this.geometryType,this.spatialReference),uy(this.spatialReference,e.outSR)]).then(()=>e)}async _checkStatisticsParamsSupport(e){let i=[];if(e.valueExpression){const{arcadeUtils:r}=await Wv();i=r.extractFieldNames(e.valueExpression)}if(e.field&&i.push(e.field),e.field2&&i.push(e.field2),e.field3&&i.push(e.field3),e.normalizationField&&i.push(e.normalizationField),!i.length)throw new st(PD,"params should have at least a field or valueExpression",{params:e});AD(this.fieldsIndex,i,"params contains missing fields")}async _checkQuerySupport(e){if((e.distance??0)<0||e.geometryPrecision!=null||e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new st(PD,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),this._checkStatisticsQuerySupport(e),Promise.all([wgt(e,this.geometryType,this.spatialReference),uy(this.spatialReference,e.outSR)]).then(()=>e)}_checkAttributesQuerySupport(e){const{outFields:i,orderByFields:r,returnDistinctValues:n,outStatistics:s}=e,o=s?s.map(a=>a.outStatisticFieldName&&a.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(r&&r.length>0){const a=" asc",l=" desc",c=r.map(d=>{const p=d.toLowerCase();return p.includes(a)?p.split(a)[0]:p.includes(l)?p.split(l)[0]:d}).filter(d=>!o.includes(d));AD(this.fieldsIndex,c,"orderByFields contains missing fields")}if(i&&i.length>0)AD(this.fieldsIndex,i,"outFields contains missing fields");else if(n)throw new st(PD,"outFields should be specified for returnDistinctValues",{query:e});XRi(this.fieldsIndex,e.where)}_checkStatisticsQuerySupport(e){const{outStatistics:i,groupByFieldsForStatistics:r,having:n}=e,s=r&&r.length,o=i&&i.length;if(n){if(!s||!o)throw new st(PD,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:e});KRi(this.fieldsIndex,n,i)}if(o){if(!mMi(i))return;const a=i.map(l=>l.onStatisticField).filter(Boolean);AD(this.fieldsIndex,a,"onStatisticFields contains missing fields"),s&&AD(this.fieldsIndex,r,"groupByFieldsForStatistics contains missing fields");for(const l of i){const{onStatisticField:c,statisticType:d}=l;if((d==="percentile_disc"||d==="percentile_cont")&&"statisticParameters"in l){const{statisticParameters:p}=l;if(!p)throw new st(PD,"statisticParamters should be set for percentile type",{definition:l,query:e})}else if(d!=="count"&&c&&ZRi(c,this.fieldsIndex))throw new st(PD,"outStatistics contains non-numeric fields",{definition:l,query:e})}}}async _getQueryEngineResultForStats(e,i,r){e=hi(e);try{e=await this._schedule(()=>cgt(e,this.definitionExpression,this.spatialReference),r),e=await this._reschedule(()=>this._checkStatisticsSupport(e,i),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!==TD)throw n;return new M_([],e,this)}}};const Cgt=/^\s*"([\S\s]*)"\s*$/,Tgt=/""/g,Egt=` -`,vMi=[","," ",";","|"," "];function*Igt(t,e,i){let r=0;for(;r<=t.length;){const n=t.indexOf(e,r),s=t.substring(r,n>-1?n:void 0);r+=s.length+e.length,i&&!s.trim()||(yield s)}}function Agt(t){const e=t.includes(`\r + at `+c}return s},e.buildMessage=function(n,s){var o={literal:function(v){return'"'+l(v.text)+'"'},class:function(v){var x=v.parts.map(function(I){return Array.isArray(I)?c(I[0])+"-"+c(I[1]):c(I)});return"["+(v.inverted?"^":"")+x.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(v){return v.description}};function a(v){return v.charCodeAt(0).toString(16).toUpperCase()}function l(v){return v.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(x){return"\\x0"+a(x)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(x){return"\\x"+a(x)})}function c(v){return v.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(x){return"\\x0"+a(x)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(x){return"\\x"+a(x)})}function h(v){return o[v.type](v)}function p(v){var x,I,P=v.map(h);if(P.sort(),P.length>0){for(x=1,I=1;x=e?t:new Array(e-t.length+1).join("0")+t}function mJ(t,e,i="0",r="0",n="0",s="0",o="",a="0",l="0"){if(o==="+"||o==="-"){const c=`${Fk(parseInt(t,10),4)}-${Fk(parseInt(e,10),2)}-${Fk(parseInt(i,10),2)}`;let h="";parseFloat(s)<10&&(h="0");const p=`${Fk(parseInt(r,10),2)}:${Fk(parseInt(n,10),2)}:${h+parseFloat(s).toString()}`,y=`${o}${Fk(parseInt(a,10),2)}:${Fk(parseInt(l,10),2)}`;return new Date(c+"T"+p+y)}return new Date(parseInt(t,10),parseInt(e,10)-1,parseInt(i,10),parseInt(r,10),parseInt(n,10),parseFloat(s))}let _Ri=class{static makeBool(e){return Omt(e)}static featureValue(e,i,r,n){return Nmt(e,i,r,n)}static equalsNull(e){return e===null}static applyLike(e,i,r){return kMe(e,i,r)}static ensureArray(e){return LMe(e)}static applyIn(e,i){return NMe(e,i)}static currentDate(){const e=new Date;return e.setHours(0,0,0,0),e}static makeSqlInterval(e,i,r){return HP.createFromValueAndQualifer(e,i,r)}static convertInterval(e){return e instanceof HP?e.valueInMilliseconds():e}static currentTimestamp(){return new Date}static compare(e,i,r){return Fmt(e,i,r)}static calculate(e,i,r){return Lmt(e,i,r)}static makeComparable(e){return WP(e)}static evaluateFunction(e,i){return MMe(e,i)}static lookup(e,i){const r=i[e];return r===void 0?null:r}static between(e,i){return e==null||i[0]==null||i[1]==null?null:e>=i[0]&&e<=i[1]}static notbetween(e,i){return e==null||i[0]==null||i[1]==null?null:ei[1]}static ternaryNot(e){return Vde(e)}static ternaryAnd(e,i){return Rmt(e,i)}static ternaryOr(e,i){return Mmt(e,i)}},Ba=class f5t{constructor(e,i){this.fieldsIndex=i,this._datefields={},this.parameters={},this._hasDateFunctions=void 0,this.parseTree=pRi.parse(e);const{isStandardized:r,isAggregate:n,referencedFieldNames:s}=this._extractExpressionInfo(i);this._referencedFieldNames=s,this.isStandardized=r,this.isAggregate=n}static create(e,i){return new f5t(e,i)}get fieldNames(){return this._referencedFieldNames}testSet(e,i=Nk){const r={};for(const n of this.fieldNames)r[n]=e.map(s=>i.getAttribute(s,n));return!!this._evaluateNode(this.parseTree,{attributes:r},Nk)}calculateValue(e,i=Nk){const r=this._evaluateNode(this.parseTree,e,i);return r instanceof HP?r.valueInMilliseconds()/864e5:r}calculateValueCompiled(e,i=Nk){return this.parseTree._compiledVersion!=null?this.parseTree._compiledVersion(e,this.parameters,i,this._datefields):Hi("esri-csp-restrictions")?this.calculateValue(e,i):(this._compileMe(),this.parseTree._compiledVersion(e,this.parameters,i,this._datefields))}testFeature(e,i=Nk){return!!this._evaluateNode(this.parseTree,e,i)}testFeatureCompiled(e,i=Nk){return this.parseTree._compiledVersion!=null?!!this.parseTree._compiledVersion(e,this.parameters,i,this._datefields):Hi("esri-csp-restrictions")?this.testFeature(e,i):(this._compileMe(),!!this.parseTree._compiledVersion(e,this.parameters,i,this._datefields))}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||vRi.has(e.name.toLowerCase()))})),this._hasDateFunctions}getFunctions(){const e=new Set;return this._visitAll(this.parseTree,i=>{i.type==="function"&&e.add(i.name.toLowerCase())}),Array.from(e)}getExpressions(){const e=new Map;return this._visitAll(this.parseTree,i=>{if(i.type==="function"){const r=i.name.toLowerCase(),n=i.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,i=>{i.type==="parameter"&&e.add(i.value.toLowerCase())}),Array.from(e)}_compileMe(){const e="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=new Function("feature","lookups","attributeAdapter","datefields",e).bind(_Ri)}_extractExpressionInfo(e){const i=[],r=new Set;let n=!0,s=!0;return this._visitAll(this.parseTree,o=>{switch(o.type){case"column-reference":{const a=e?.get(o.column);let l,c;a?l=c=a.name??"":(c=o.column,l=c.toLowerCase()),a&&a.name&&(a.type==="date"||a.type==="esriFieldTypeDate")&&(this._datefields[a.name]=1),r.has(l)||(r.add(l),i.push(c)),o.column=c;break}case"function":{const{name:a,args:l}=o,c=l.value.length;n&&(n=cRi(a,c)),s&&(s=oRi(a,c));break}}}),{referencedFieldNames:Array.from(i),isStandardized:n,isAggregate:s}}_visitAll(e,i){if(e!=null)switch(i(e),e.type){case"when-clause":this._visitAll(e.operand,i),this._visitAll(e.value,i);break;case"case-expression":for(const r of e.clauses)this._visitAll(r,i);e.format==="simple"&&this._visitAll(e.operand,i),e.else!==null&&this._visitAll(e.else,i);break;case"expression-list":for(const r of e.value)this._visitAll(r,i);break;case"unary-expression":this._visitAll(e.expr,i);break;case"binary-expression":this._visitAll(e.left,i),this._visitAll(e.right,i);break;case"function":this._visitAll(e.args,i)}}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 i="";if(e.format==="simple"){const r="this.makeComparable("+this.evaluateNodeToJavaScript(e.operand)+")";i="( ";for(let n=0;n":case"<":case">":case">=":case"<=":case"=":return"this.compare("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+")";case"*":case"-":case"+":case"/":case"||":return"this.calculate("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+")"}throw new Error("Not Supported Operator "+e.operator);case"null":case"boolean":case"string":case"number":return JSON.stringify(e.value);case"date":return"(new Date("+Pmt(e.value).getTime().toString()+"))";case"timestamp":return"(new Date("+FMe(e.value).getTime().toString()+"))";case"current-time":return e.mode==="date"?"this.currentDate()":"this.currentTimestamp()";case"column-reference":return"this.featureValue(feature,"+JSON.stringify(e.column)+",datefields,attributeAdapter)";case"function":return"this.evaluateFunction("+JSON.stringify(e.name)+","+this.evaluateNodeToJavaScript(e.args)+")"}throw new Error("Unsupported sql syntax "+e.type)}_evaluateNode(e,i,r){switch(e.type){case"interval":{const n=this._evaluateNode(e.value,i,r);return HP.createFromValueAndQualifer(n,e.qualifier,e.op)}case"case-expression":if(e.format==="simple"){const n=WP(this._evaluateNode(e.operand,i,r));for(let s=0;s=WP(s[0])&&n<=WP(s[1])}case"NOTBETWEEN":{const n=this._evaluateNode(e.left,i,r),s=this._evaluateNode(e.right,i,r);return n==null||s[0]==null||s[1]==null?null:nWP(s[1])}case"LIKE":return kMe(this._evaluateNode(e.left,i,r),this._evaluateNode(e.right,i,r),e.escape);case"NOT LIKE":return Vde(kMe(this._evaluateNode(e.left,i,r),this._evaluateNode(e.right,i,r),e.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return Fmt(e.operator,this._evaluateNode(e.left,i,r),this._evaluateNode(e.right,i,r));case"-":case"+":case"*":case"/":case"||":return Lmt(e.operator,this._evaluateNode(e.left,i,r),this._evaluateNode(e.right,i,r))}case"null":case"boolean":case"string":case"number":return e.value;case"date":return Pmt(e.value);case"timestamp":return FMe(e.value);case"current-time":{const n=new Date;return e.mode==="date"&&n.setHours(0,0,0,0),n}case"column-reference":return Nmt(i,e.column,this._datefields,r);case"data-type":return e.value;case"function":{const n=this._evaluateNode(e.args,i,r);return this.isAggregate?sRi(e.name,n):MMe(e.name,n)}}throw new Error("Unsupported sql syntax "+e.type)}};function FMe(t){let e=fRi.exec(t);if(e!==null){const[,i,r,n,s,o,a]=e;return mJ(i,r,n,s,o,a)}if(e=mRi.exec(t),e!==null){const[,i,r,n,s,o,a,l,c,h]=e;return mJ(i,r,n,s,o,a,l,c,h)}if(e=gRi.exec(t),e!==null){const[,i,r,n,s,o,a,l,c]=e;return mJ(i,r,n,s,o,"0",a,l,c)}if(e=yRi.exec(t),e!==null){const[,i,r,n,s,o]=e;return mJ(i,r,n,s,o)}if(e=Amt.exec(t),e!==null){const[,i,r,n]=e;return mJ(i,r,n)}throw new Error("SQL Invalid Timestamp")}function Pmt(t){const e=Amt.exec(t);if(e===null)try{return FMe(t)}catch{throw new Error("SQL Invalid Date")}const[,i,r,n]=e;return new Date(parseInt(i,10),parseInt(r,10)-1,parseInt(n,10))}function Omt(t){return t===!0}function LMe(t){return Array.isArray(t)?t:[t]}function Vde(t){return t!==null?t!==!0:null}function Rmt(t,e){return t!=null&&e!=null?t===!0&&e===!0:t!==!1&&e!==!1&&null}function Mmt(t,e){return t!=null&&e!=null?t===!0||e===!0:t===!0||e===!0||null}function NMe(t,e){if(t==null)return null;let i=!1;for(const r of e)if(r==null)i=null;else if(t===r){i=!0;break}return i}const Dmt="-[]/{}()*+?.\\^$|";var Lk;function bRi(t,e){const i=e;let r="",n=Lk.Normal;for(let s=0;s":return r!==n;case"=":return r===n;case">":return r>n;case"<":return r=":return r>=n;case"<=":return r<=n}}function Lmt(t,e,i){if(t==="||")return MMe("concat",[e,i]);if(e instanceof HP)if(i instanceof Date)switch(t){case"+":return new Date(e.valueInMilliseconds()+i.getTime());case"-":return e.valueInMilliseconds()-i.getTime();case"*":return e.valueInMilliseconds()*i.getTime();case"/":return e.valueInMilliseconds()/i.getTime()}else if(i instanceof HP)switch(t){case"+":return HP.createFromMilliseconds(e.valueInMilliseconds()+i.valueInMilliseconds());case"-":return HP.createFromMilliseconds(e.valueInMilliseconds()-i.valueInMilliseconds());case"*":return e.valueInMilliseconds()*i.valueInMilliseconds();case"/":return e.valueInMilliseconds()/i.valueInMilliseconds()}else e=e.valueInMilliseconds();else if(i instanceof HP)if(e instanceof Date)switch(t){case"+":return new Date(i.valueInMilliseconds()+e.getTime());case"-":return new Date(e.getTime()-i.valueInMilliseconds());case"*":return e.getTime()*i.valueInMilliseconds();case"/":return e.getTime()/i.valueInMilliseconds()}else i=i.valueInMilliseconds();else if(e instanceof Date&&typeof i=="number")switch(i=24*i*60*60*1e3,e=e.getTime(),t){case"+":return new Date(e+i);case"-":return new Date(e-i);case"*":return new Date(e*i);case"/":return new Date(e/i)}else if(i instanceof Date&&typeof e=="number")switch(e=24*e*60*60*1e3,i=i.getTime(),t){case"+":return new Date(e+i);case"-":return new Date(e-i);case"*":return new Date(e*i);case"/":return new Date(e/i)}switch(t){case"+":return e+i;case"-":return e-i;case"*":return e*i;case"/":return e/i}}function wRi(t){return t&&typeof t.attributes=="object"}function Nmt(t,e,i,r){const n=r.getAttribute(t,e);return n!=null&&i[e]===1?new Date(n):n}(function(t){t[t.Normal=0]="Normal",t[t.Escaped=1]="Escaped"})(Lk||(Lk={}));const Nk={getAttribute:(t,e)=>(wRi(t)?t.attributes:t)[e]},jde=Object.freeze(Object.defineProperty({__proto__:null,WhereClause:Ba,defaultAttributeAdapter:Nk},Symbol.toStringTag,{value:"Module"})),xRi={FeatureLayer:!0,SceneLayer:!0};async function SRi(t){const e=t.properties?.customParameters,i=await TRi(t.url,e),r={...t.properties,url:t.url};if(!i.sublayerIds)return i.layerOrTableId!=null&&(r.layerId=i.layerOrTableId,r.sourceJSON=i.sourceJSON),new i.Constructor(r);const n=new(await Promise.resolve().then(()=>aRt)).default({title:i.parsedUrl.title});return CRi(n,i,r),n}function kmt(t,e){return t?t.find(i=>i.id===e):null}function CRi(t,e,i){function r(n,s){const o={...i,layerId:n,sublayerTitleMode:"service-name"};return ve(s)&&(o.sourceJSON=s),new e.Constructor(o)}e.sublayerIds.forEach(n=>{const s=r(n,kmt(e.sublayerInfos,n));t.add(s)}),e.tableIds.forEach(n=>{const s=r(n,kmt(e.tableInfos,n));t.tables.add(s)})}async function TRi(t,e){let i=XC(t);if(lt(i)&&(i=await ERi(t,e)),lt(i))throw new st("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:t});const{serverType:r,sublayer:n}=i;let s;const o={FeatureServer:"FeatureLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer"};switch(r){case"MapServer":n!=null?s="FeatureLayer":s=await PRi(t,e)?"TileLayer":"MapImageLayer";break;case"ImageServer":{const c=await D_(t,{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 D_(i.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&&JH[p]!=null&&(s=JH[p])}}break}default:s=o[r]}const a=r==="FeatureServer",l={parsedUrl:i,Constructor:null,layerOrTableId:a?n:void 0,sublayerIds:null,tableIds:null};if(xRi[s]&&n==null){const c=await IRi(t,r,e);a&&(l.sublayerInfos=c.layerInfos,l.tableInfos=c.tableInfos),c.layerIds.length+c.tableIds.length!==1?(l.sublayerIds=c.layerIds,l.tableIds=c.tableIds):a&&(l.layerOrTableId=c.layerIds[0]??c.tableIds[0],l.sourceJSON=c.layerInfos?.[0]??c.tableInfos?.[0])}return l.Constructor=await ARi(s),l}async function ERi(t,e){const i=await D_(t,{customParameters:e});let r=null,n=null;const s=i.type;if(s==="Feature Layer"||s==="Table"?(r="FeatureServer",n=i.id??null):s==="indexedVector"?r="VectorTileServer":i.hasOwnProperty("mapName")?r="MapServer":i.hasOwnProperty("bandCount")&&i.hasOwnProperty("pixelSizeX")?r="ImageServer":i.hasOwnProperty("maxRecordCount")&&i.hasOwnProperty("allowGeometryUpdates")?r="FeatureServer":i.hasOwnProperty("streamUrls")?r="StreamServer":$mt(i)?(r="SceneServer",n=i.id):i.hasOwnProperty("layers")&&$mt(i.layers?.[0])&&(r="SceneServer"),!r)return null;const o=n!=null?LHe(t):null;return{title:ve(o)&&i.name||tne(t),serverType:r,sublayer:n,url:{path:ve(o)?o.serviceUrl:fa(t).path}}}function $mt(t){return t!=null&&t.hasOwnProperty("store")&&t.hasOwnProperty("id")&&typeof t.id=="number"}async function IRi(t,e,i){let r,n=!1;if(e==="FeatureServer"){const a=await bRe(t,{customParameters:i});n=!!a.layersJSON,r=a.layersJSON||a.serviceJSON}else r=await D_(t,{customParameters:i});const s=r?.layers,o=r?.tables;return{layerIds:s?.map(a=>a.id).reverse()||[],tableIds:o?.map(a=>a.id).reverse()||[],layerInfos:n?s:[],tableInfos:n?o:[]}}async function ARi(t){return(0,Hw[t])()}async function PRi(t,e){return(await D_(t,{customParameters:e})).tileInfo}const ORi=Object.freeze(Object.defineProperty({__proto__:null,fromUrl:SRi},Symbol.toStringTag,{value:"Module"})),Kj=(t,e,i)=>[e,i],Kw=(t,e,i)=>[e,i,t[2]],Jj=(t,e,i)=>[e,i,t[2],t[3]];function Gde(t){return t?{originPosition:t.originPosition==="upper-left"?"upperLeft":t.originPosition==="lower-left"?"lowerLeft":t.originPosition,scale:t.tolerance?[t.tolerance,t.tolerance]:[1,1],translate:ve(t.extent)?[t.extent.xmin,t.extent.ymax]:[0,0]}:null}function gJ({scale:t,translate:e},i){return Math.round((i-e[0])/t[0])}function yJ({scale:t,translate:e},i){return Math.round((e[1]-i)/t[1])}function $Me(t,e,i){const r=[];let n,s,o,a;for(let l=0;l0?(o=gJ(t,c[0]),a=yJ(t,c[1]),o===n&&a===s||(r.push(e(c,o-n,a-s)),n=o,s=a)):(n=gJ(t,c[0]),s=yJ(t,c[1]),r.push(e(c,n,s)))}return r.length>0?r:null}function RRi(t,e,i,r){return $Me(t,i?r?Jj:Kw:r?Kw:Kj,e)}function MRi(t,e,i,r){const n=[],s=i?r?Jj:Kw:r?Kw:Kj;for(let o=0;o=3&&n.push(a)}return n.length?n:null}function DRi(t,e,i,r){const n=[],s=i?r?Jj:Kw:r?Kw:Kj;for(let o=0;o=2&&n.push(a)}return n.length?n:null}function Bmt({scale:t,translate:e},i){return i*t[0]+e[0]}function Vmt({scale:t,translate:e},i){return e[1]-i*t[1]}function jmt(t,e,i){const r=new Array(i.length);if(!i.length)return r;const[n,s]=t.scale;let o=Bmt(t,i[0][0]),a=Vmt(t,i[0][1]);r[0]=e(i[0],o,a);for(let l=1;ln!=null).length,r={count:i};return t.supportsNullCount&&(r.nullcount=e.length-i),t.percentileParams&&(r.median=GMe(e,t.percentileParams)),r}function Ude(t){const{values:e,useSampleStdDev:i,supportsNullCount:r}=t;let n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=null,a=null,l=null,c=null,h=0;const p=t.minValue==null?-1/0:t.minValue,y=t.maxValue==null?1/0:t.maxValue;for(const x of e)Number.isFinite(x)?x>=p&&x<=y&&(o=o===null?x:o+x,n=Math.min(n,x),s=Math.max(s,x),h++):typeof x=="string"&&h++;if(h&&o!=null){a=o/h;let x=0;for(const I of e)Number.isFinite(I)&&I>=p&&I<=y&&(x+=(I-a)**2);c=i?h>1?x/(h-1):0:h>0?x/h:0,l=Math.sqrt(c)}else n=null,s=null;const v={avg:a,count:h,max:s,min:n,stddev:l,sum:o,variance:c};return r&&(v.nullcount=e.length-h),t.percentileParams&&(v.median=GMe(e,t.percentileParams)),v}function GMe(t,e){const{fieldType:i,value:r,orderBy:n,isDiscrete:s}=e,o=zmt(i,n==="desc");if((t=[...t].filter(v=>v!=null).sort((v,x)=>o(v,x))).length===0)return null;if(r<=0)return t[0];if(r>=1)return t[t.length-1];const a=(t.length-1)*r,l=Math.floor(a),c=l+1,h=a%1,p=t[l],y=t[c];return c>=t.length||s||typeof p=="string"||typeof y=="string"?p:p*(1-h)+y*h}function zmt(t,e){const i=e?1:-1,r=ZRi(e),n=Hmt(e);if(!(t&&["esriFieldTypeDate","esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...Umt].includes(t)))return(s,o)=>typeof s=="number"&&typeof o=="number"?r(s,o):typeof s=="string"&&typeof o=="string"?n(s,o):i;if(t==="esriFieldTypeDate")return(s,o)=>{const a=new Date(s).getTime(),l=new Date(o).getTime();return isNaN(a)||isNaN(l)?i:r(a,l)};if(Umt.has(t))return(s,o)=>r(s,o);if(t==="esriFieldTypeString")return(s,o)=>n(s,o);if(t==="esriFieldTypeGUID"||t==="esriFieldTypeGlobalID"){const s=Hmt(e);return(o,a)=>s(Wmt(o),Wmt(a))}return e?(s,o)=>1:(s,o)=>-1}function zde(t,e,i){if(i){if(t==null)return e==null?0:1;if(e==null)return-1}else{if(t==null)return e==null?0:-1;if(e==null)return 1}return null}function Hmt(t){return t?(e,i)=>{const r=zde(e,i,!0);return r??((e=e.toUpperCase())>(i=i.toUpperCase())?-1:e{const r=zde(e,i,!1);return r??((e=e.toUpperCase())<(i=i.toUpperCase())?-1:e>i?1:0)}}function ZRi(t){return t?(e,i)=>{const r=zde(e,i,!0);return r??i-e}:(e,i)=>{const r=zde(e,i,!1);return r??e-i}}function Wmt(t){return t.substr(24,12)+t.substr(19,4)+t.substr(16,2)+t.substr(14,2)+t.substr(11,2)+t.substr(9,2)+t.substr(6,2)+t.substr(4,2)+t.substr(2,2)+t.substr(0,2)}function qmt(t,e){let i;for(i in t)JRi.includes(i)&&(Number.isFinite(t[i])||(t[i]=null));return e&&["avg","stddev","variance"].forEach(r=>{t[r]!=null&&(t[r]=Math.ceil(t[r]))}),t}function Ymt(t){const e={};for(let i of t)(i==null||typeof i=="string"&&i.trim()==="")&&(i=null),e[i]==null?e[i]={count:1,data:i}:e[i].count++;return{count:e}}function UMe(t){return t?.type!=="coded-value"?[]:t.codedValues.map(e=>e.code)}function Xmt(t,e,i,r){const n=t.count,s=[];if(i&&e){const o=[],a=UMe(e[0]);for(const l of a)if(e[1]){const c=UMe(e[1]);for(const h of c)if(e[2]){const p=UMe(e[2]);for(const y of p)o.push(`${aS(l)}${r}${aS(h)}${r}${aS(y)}`)}else o.push(`${aS(l)}${r}${aS(h)}`)}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 Kmt(t,e,i,r){let n=null;switch(e){case"log":t!==0&&(n=Math.log(t)*Math.LOG10E);break;case"percent-of-total":Number.isFinite(r)&&r!==0&&(n=t/r*100);break;case"field":Number.isFinite(i)&&i!==0&&(n=t/i);break;case"natural-log":t>0&&(n=Math.log(t));break;case"square-root":t>0&&(n=t**.5)}return n}function zMe(t,e){const i=eMi({field:e.field,normalizationType:e.normalizationType,normalizationField:e.normalizationField,classificationMethod:e.classificationMethod,standardDeviationInterval:e.standardDeviationInterval,breakCount:e.numClasses||YRi});return t=QRi(t,e.minValue,e.maxValue),BKt({definition:i,values:t,normalizationTotal:e.normalizationTotal})}function QRi(t,e,i){const r=e??-1/0,n=i??1/0;return t.filter(s=>Number.isFinite(s)&&s>=r&&s<=n)}function eMi(t){const{breakCount:e,field:i,normalizationField:r,normalizationType:n}=t,s=t.classificationMethod||WRi,o=s==="standard-deviation"?t.standardDeviationInterval||qRi:void 0;return new kKt({breakCount:e,classificationField:i,classificationMethod:s,normalizationField:n==="field"?r:void 0,normalizationType:n,standardDeviationInterval:o})}function Jmt(t,e){let i=t.classBreaks;const r=i.length,n=i[0].minValue,s=i[r-1].maxValue,o=e==="standard-deviation",a=KRi;return i=i.map(l=>{const c=l.label,h={minValue:l.minValue,maxValue:l.maxValue,label:c};if(o&&c){const p=c.match(a)?.map(y=>+y.trim())??[];p.length===2?(h.minStdDev=p[0],h.maxStdDev=p[1],p[0]<0&&p[1]>0&&(h.hasAvg=!0)):p.length===1&&(c.includes("<")?(h.minStdDev=null,h.maxStdDev=p[0]):c.includes(">")&&(h.minStdDev=p[0],h.maxStdDev=null))}return h}),{minValue:n,maxValue:s,classBreakInfos:i,normalizationTotal:t.normalizationTotal}}function Zmt(t,e){const i=tMi(t,e),r=i.intervals,n=i.min??0,s=i.max??0,o=r.map((a,l)=>({minValue:r[l][0],maxValue:r[l][1],count:0}));for(const a of t)if(a!=null&&a>=n&&a<=s){const l=iMi(r,a);l>-1&&o[l].count++}return{bins:o,minValue:n,maxValue:s,normalizationTotal:e.normalizationTotal}}function tMi(t,e){const{field:i,classificationMethod:r,standardDeviationInterval:n,normalizationType:s,normalizationField:o,normalizationTotal:a,minValue:l,maxValue:c}=e,h=e.numBins||XRi;let p=null,y=null,v=null;if((!r||r==="equal-interval")&&!s){if(l!=null&&c!=null)p=l,y=c;else{const x=Ude({values:t,minValue:l,maxValue:c,useSampleStdDev:!s,supportsNullCount:VMe({normalizationType:s,normalizationField:o,minValue:l,maxValue:c})});p=x.min??null,y=x.max??null}v=rMi(p??0,y??0,h)}else{const{classBreaks:x}=zMe(t,{field:i,normalizationType:s,normalizationField:o,normalizationTotal:a,classificationMethod:r,standardDeviationInterval:n,minValue:l,maxValue:c,numClasses:h});p=x[0].minValue,y=x[x.length-1].maxValue,v=x.map(I=>[I.minValue,I.maxValue])}return{min:p,max:y,intervals:v}}function iMi(t,e){let i=-1;for(let r=t.length-1;r>=0;r--)if(e>=t[r][0]){i=r;break}return i}function rMi(t,e,i){const r=(e-t)/i,n=[];let s,o=t;for(let a=1;a<=i;a++)s=o+r,s=Number(s.toFixed(16)),n.push([o,a===i?e:s]),o=s;return n}let Zj=null;function nMi(t,e,i){return t.x<0?t.x+=e:t.x>i&&(t.x-=e),t}function sMi(t,e,i,r){const n=Jje(i)?vd(i):null,s=n?Math.round((n.valid[1]-n.valid[0])/e.scale[0]):null;return t.map(o=>{const a=new er(o.geometry);return BMe(e,a,a,a.hasZ,a.hasM),o.geometry=n?nMi(a,s,r[0]):a,o})}function oMi(t,e=18,i,r,n,s){const o=new Float64Array(n*s);e=Math.round(vn(e));let a=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=0,h=0,p=0,y=0;const v=mGt(r,i);for(const{geometry:I,attributes:P}of t){const{x:F,y:k}=I,j=Math.max(0,F-e),V=Math.max(0,k-e),Y=Math.min(s,k+e),X=Math.min(n,F+e),Z=+v(P);for(let ie=V;iel&&(l=c),y++}}if(!y)return{mean:0,stddev:0,min:0,max:0,mid:0,count:0};const x=(l-a)/2;return{mean:h/y,stdDev:Math.sqrt((p-h*h/y)/y),min:a,max:l,mid:x,count:y}}async function Hde(t,e){if(!e)return[];const{field:i,field2:r,field3:n,fieldDelimiter:s}=t,o=t.valueExpression,a=t.normalizationType,l=t.normalizationField,c=t.normalizationTotal,h=[],p=t.viewInfoParams;let y=null,v=null;if(o){if(!Zj){const{arcadeUtils:P}=await Kv();Zj=P}y=Zj.createFunction(o),v=p&&Zj.getViewInfo({viewingMode:p.viewingMode,scale:p.scale,spatialReference:new hr(p.spatialReference)})}const x=t.fieldInfos,I=!(e[0]&&"declaredClass"in e[0]&&e[0].declaredClass==="esri.Graphic")&&x?{fields:x}:null;return e.forEach(P=>{const F=P.attributes;let k;if(o){const j=I?{...P,layer:I}:P,V=Zj.createExecContext(j,v);k=Zj.executeFunction(y,V)}else F&&(k=F[i],r&&(k=`${aS(k)}${s}${aS(F[r])}`,n&&(k=`${k}${s}${aS(F[n])}`)));if(a&&typeof k=="number"&&isFinite(k)){const j=F&&parseFloat(F[l]);k=Kmt(k,a,j,c)}h.push(k)}),h}async function aMi(t){const{attribute:e,features:i}=t,{normalizationType:r,normalizationField:n,minValue:s,maxValue:o,fieldType:a}=e,l=await Hde({field:e.field,valueExpression:e.valueExpression,normalizationType:r,normalizationField:n,normalizationTotal:e.normalizationTotal,viewInfoParams:e.viewInfoParams,fieldInfos:e.fieldInfos},i),c=VMe({normalizationType:r,normalizationField:n,minValue:s,maxValue:o}),h={value:.5,fieldType:a},p=a==="esriFieldTypeString"?jMe({values:l,supportsNullCount:c,percentileParams:h}):Ude({values:l,minValue:s,maxValue:o,useSampleStdDev:!r,supportsNullCount:c,percentileParams:h});return qmt(p,a==="esriFieldTypeDate")}async function lMi(t){const{attribute:e,features:i}=t,r=await Hde({field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:e.valueExpression,viewInfoParams:e.viewInfoParams,fieldInfos:e.fieldInfos},i),n=Ymt(r);return Xmt(n,e.domains,e.returnAllCodedValues,e.fieldDelimiter)}async function uMi(t){const{attribute:e,features:i}=t,{field:r,normalizationType:n,normalizationField:s,normalizationTotal:o,classificationMethod:a}=e,l=await Hde({field:r,valueExpression:e.valueExpression,normalizationType:n,normalizationField:s,normalizationTotal:o,viewInfoParams:e.viewInfoParams,fieldInfos:e.fieldInfos},i),c=zMe(l,{field:r,normalizationType:n,normalizationField:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:e.standardDeviationInterval,numClasses:e.numClasses,minValue:e.minValue,maxValue:e.maxValue});return Jmt(c,a)}async function cMi(t){const{attribute:e,features:i}=t,{field:r,normalizationType:n,normalizationField:s,normalizationTotal:o,classificationMethod:a}=e,l=await Hde({field:r,valueExpression:e.valueExpression,normalizationType:n,normalizationField:s,normalizationTotal:o,viewInfoParams:e.viewInfoParams,fieldInfos:e.fieldInfos},i);return Zmt(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 hMi(t){const{attribute:e,features:i}=t,{field:r,radius:n,fieldOffset:s,transform:o,spatialReference:a,size:l}=e,c=sMi(i,o,a,l),{count:h,min:p,max:y,mean:v,stdDev:x}=oMi(c,n,s,r,l[0],l[1]);return{count:h,min:p,max:y,avg:v,stddev:x}}const dMi=Object.freeze(Object.defineProperty({__proto__:null,classBreaks:uMi,heatmapStatistics:hMi,histogram:cMi,summaryStatistics:aMi,uniqueValues:lMi},Symbol.toStringTag,{value:"Module"}));function pMi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Wde={};(function(t,e){function i(){function n(A){if(typeof A=="number")return ae.Uc.ah(A);if(A==null)return null;if(Ot[A]!=null)return ae.Uc.ah(Ot[A]);throw Error("Unrecognised Unit Type")}function s(A){if(typeof A=="number")return ae.Uc.ah(A);if(A==null)return null;if(jt[A]!=null)return ae.Uc.ah(jt[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,ye,H,T){if(H==null||H.B())return null;switch(H.K()){case ae.sn.Point:return A.exportPoint(ye,H,T);case ae.sn.Polygon:return A.exportPolygon(ye,H,T);case ae.sn.Polyline:return A.exportPolyline(ye,H,T);case ae.sn.MultiPoint:return A.exportMultipoint(ye,H,T);case ae.sn.Envelope:return A.exportExtent(ye,H,T)}return null}function l(A,ye,H,T){if(H.K()!==ae.sn.Point)throw Error("Geometry not Point");return A.exportPoint(ye,H,T)}function c(A,ye,H){return A.convertToGEGeometry(ye,H)}function h(A){var ye=A.wkid;A=A.wkt;var H=nt.get(ye||A);return H==null&&(ye!==-1&&ye!=null?(H=ae.Gg.create(ye),nt.set(ye,H)):A&&(H=ae.Gg.lP(A),nt.set(A,H)),Xt.has(ye||A)&&H.QW(Xt.get(ye||A))),H}function p(A){var ye;if(A==null)return null;var H=h(A);return A=H.Id(),H=H.Mn(),(ye={}).tolerance=H,ye.unitType=A==null?-1:A.pd,ye.unitID=A==null?-1:A.Fc(),ye.unitBaseFactor=A==null?0:A.ci,ye.unitSquareDerivative=A==null?0:ae.Uc.WF(A).Fc(),ye}function y(A,ye,H,T){return H==null?null:(H=ae.ac.clip(c(A,$e,H),c(A,$e,T),h(ye)),a(A,$e,H,ye))}function v(A,ye,H,T){H=ae.ac.fl(c(A,$e,H),c(A,$e,T),h(ye)),T=[];for(var b=0;b>6)>>1},T.Tn=function(b){return(32&b)!=0},T.PS=function(b){return(128&b)!=0},T.zd=function(b){return(256&b)!=0},T.zj=function(b){return(512&b)!=0},T.Ic=function(b){return(1024&b)!=0},T.prototype.Qf=function(){var b=this.Ja();return this.copyTo(b),b},T.prototype.ng=function(){return null},T.kg=function(b){var m=b.Ja();return b.copyTo(m),m},T.prototype.wc=function(){0<=this.QA&&(this.QA+=2147483649)},T.zx=function(b){var m=b.K();if(T.zj(m))return b.I();if(b.B())return 0;if(m==197)return 4;if(m==33)return 1;if(T.zd(m))return 2;throw A.i.ga("missing type")},T}();A.ba=H})(ae||(ae={})),ht=ae||(ae={}),wt=function(){function A(){this.y=this.x=0}return A.construct=function(ye,H){var T=new A;return T.x=ye,T.y=H,T},A.cl=function(ye){var H=new A;return H.x=ye.x,H.y=ye.y,H},A.prototype.na=function(ye,H){this.x=ye,this.y=H},A.prototype.N=function(ye){this.x=ye.x,this.y=ye.y},A.prototype.hq=function(ye,H){return this.x===ye&&this.y===H},A.prototype.Mz=function(ye){return 2220446049250313e-31>=Math.abs(this.x-ye.x)&&2220446049250313e-31>=Math.abs(this.y-ye.y)},A.prototype.rb=function(ye){return this.x===ye.x&&this.y===ye.y},A.prototype.Nb=function(ye){return ye==this||ye instanceof A&&this.x==ye.x&&this.y==ye.y},A.prototype.sub=function(ye){this.x-=ye.x,this.y-=ye.y},A.prototype.vc=function(ye,H){this.x=ye.x-H.x,this.y=ye.y-H.y},A.prototype.add=function(ye,H){H!==void 0?(this.x=ye.x+H.x,this.y=ye.y+H.y):(this.x+=ye.x,this.y+=ye.y)},A.prototype.Uq=function(){this.x=-this.x,this.y=-this.y},A.prototype.nt=function(ye){this.x=-ye.x,this.y=-ye.y},A.prototype.IS=function(ye,H,T){this.x=ye.x*(1-T)+H.x*T,this.y=ye.y*(1-T)+H.y*T},A.prototype.Dt=function(ye,H){this.x=this.x*ye+H.x,this.y=this.y*ye+H.y},A.prototype.BW=function(ye,H,T){this.x=H.x*ye+T.x,this.y=H.y*ye+T.y},A.prototype.scale=function(ye){this.x*=ye,this.y*=ye},A.prototype.compare=function(ye){return this.yye.y?1:this.xye.x?1:0},A.prototype.normalize=function(){var ye=this.length();ye==0&&(this.x=1,this.y=0),this.x/=ye,this.y/=ye},A.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},A.prototype.Uk=function(){return this.x*this.x+this.y*this.y},A.ub=function(ye,H){return Math.sqrt(this.zc(ye,H))},A.Jy=function(ye,H,T,b){return ye-=T,H-=b,Math.sqrt(ye*ye+H*H)},A.prototype.Sh=function(ye){return this.x*ye.x+this.y*ye.y},A.prototype.aD=function(ye){return Math.abs(this.x*ye.x)+Math.abs(this.y*ye.y)},A.prototype.yi=function(ye){return this.x*ye.y-this.y*ye.x},A.prototype.Ct=function(ye,H){var T=-this.x*H+this.y*ye;this.x=this.x*ye+this.y*H,this.y=T},A.prototype.Jv=function(){var ye=this.x;this.x=-this.y,this.y=ye},A.prototype.HG=function(ye){this.x=-ye.y,this.y=ye.x},A.prototype.cr=function(){var ye=this.x;this.x=this.y,this.y=-ye},A.prototype.su=function(){return 0(ye=ye.yi(H))?1:0(T=b.value())?-1:0T?-1:0=m?T+(b-T)*m:b-(b-T)*(1-m)},H.JG=function(T,b,m,_){.5>=m?(_.x=T.x+(b.x-T.x)*m,_.y=T.y+(b.y-T.y)*m):(_.x=b.x-(b.x-T.x)*(1-m),_.y=b.y-(b.y-T.y)*(1-m))},H.gT=function(T,b,m,_,C,D){.5>=C?(D.x=T+(m-T)*C,D.y=b+(_-b)*C):(D.x=m-(m-T)*(1-C),D.y=_-(_-b)*(1-C))},H}()}(ae||(ae={})),function(A){var ye=function(H){function T(){var b=H.call(this)||this;return b.ta=0,b.oa=0,b.qa=0,b.ma=0,b.la=null,b}return Ne(T,H),T.prototype.bc=function(){return A.h.construct(this.ta,this.oa)},T.prototype.$p=function(b){b.x=this.ta,b.y=this.oa},T.prototype.Ec=function(b){this.gm(0,b)},T.prototype.UB=function(b,m){this.gm(0,A.h.construct(b,m))},T.prototype.Vo=function(b){this.cD(0,b)},T.prototype.setStart=function(b){this.pD(0,b)},T.prototype.yv=function(b,m){return this.Pd(0,b,m)},T.prototype.TB=function(b,m,_){this.vn(0,b,m,_)},T.prototype.xc=function(){return A.h.construct(this.qa,this.ma)},T.prototype.Vr=function(b){b.x=this.qa,b.y=this.ma},T.prototype.Rc=function(b){this.gm(1,b)},T.prototype.Sl=function(b,m){this.gm(1,A.h.construct(b,m))},T.prototype.Ro=function(b){this.cD(1,b)},T.prototype.setEnd=function(b){this.pD(1,b)},T.prototype.jv=function(b,m){return this.Pd(1,b,m)},T.prototype.JB=function(b,m,_){this.vn(1,b,m,_)},T.prototype.Eb=function(){return 1},T.prototype.B=function(){return this.Bc()},T.prototype.Pa=function(){},T.prototype.He=function(){return 0},T.prototype.Fa=function(b,m,_,C,D){return this.FM(b,m,_,C,D)},T.prototype.isIntersecting=function(b,m){return this.Br(b,m,!1)!=0},T.prototype.ss=function(b,m){return this.tu(b,m,!1)},T.prototype.tu=function(){return null},T.prototype.Bc=function(){return!1},T.prototype.$x=function(b){if(this.wc(),this.la==null&&0=A.sa.Wa(m))throw A.i.de();var C=this.description.Rf(m);return 0<=C?(this.la!=null&&this.$x(this.description.Be.length-2),this.la[T.Ig(this.description,b)+this.description.bk(C)-2+_]):A.sa.te(m)},T.prototype.vn=function(b,m,_,C){if(this.wc(),_>=A.sa.Wa(m))throw A.i.de();var D=this.description.Rf(m);0>D&&(this.se(m),D=this.description.Rf(m)),m==0?b!=0?_!=0?this.ma=C:this.qa=C:_!=0?this.oa=C:this.ta=C:(this.la==null&&this.$x(this.description.Be.length-2),this.la[T.Ig(this.description,b)+this.description.bk(D)-2+_]=C)},T.prototype.copyTo=function(b){if(b.K()!=this.K())throw A.i.O();b.description=this.description,b.$x(this.description.Be.length-2),T.bM(this.la,b.la,2*(this.description.Be.length-2)),b.ta=this.ta,b.oa=this.oa,b.qa=this.qa,b.ma=this.ma,b.wc(),this.qp(b)},T.prototype.Vg=function(b,m){var _=new A.Oc;return this.Bc()?(_.Pa(),_):(_.pa=this.Pd(0,b,m),_.wa=_.pa,_.Nk(this.Pd(1,b,m)),_)},T.prototype.UI=function(b){this.Bc()?b.Pa():(b.pa=this.Pd(0,0,0),b.wa=b.pa,b.Nk(this.Pd(1,0,0)))},T.prototype.Vw=function(b,m){m.Pf(this.description),m.Db(this.ic(b));for(var _=1,C=this.description.Ba;_m||m>=this.xa)throw A.i.ga("index out of bounds");this.oc(),_.Pf(this.description),_.B()&&_.wn();for(var C=0;Cm||m>=this.I())throw A.i.de();this.oc(),this.Aa[0].uc(2*m,_)},b.prototype.Oa=function(m){var _=new A.h;return this.D(m,_),_},b.prototype.Hc=function(m,_){this.Aa[0].uc(2*m,_)},b.prototype.Db=function(m,_,C){if(0>m||m>=this.xa)throw A.i.de();this.oc();var D=this.Aa[0];C!==void 0?(D.write(2*m,_),D.write(2*m+1,C)):D.Vt(2*m,_),this.Qc(1993)},b.prototype.xz=function(){if(void 0>=this.I())throw A.i.de();this.oc();var m=this.Aa[0],_=new A.Od;return _.x=m.read(NaN),_.y=m.read(NaN),_.z=this.hasAttribute(1)?this.Aa[1].gg(void 0):A.sa.te(1),_},b.prototype.ZB=function(m){if(0>m||m>=this.I())throw A.i.de();this.se(1),this.oc(),this.Qc(1993);var _=this.Aa[0];_.write(2*m,(void 0).x),_.write(2*m+1,(void 0).y),this.Aa[1].rr(m,(void 0).z)},b.prototype.Vc=function(m,_,C){if(0>_||_>=this.xa)throw A.i.de();var D=A.sa.Wa(m);if(C>=D)throw A.i.de();this.oc();var L=this.description.Rf(m);return 0<=L?this.Aa[L].gg(_*D+C):A.sa.te(m)},b.prototype.tF=function(m,_){return this.Vc(m,_,void 0)},b.prototype.setAttribute=function(m,_,C,D){if(0>_||_>=this.xa)throw A.i.de();var L=A.sa.Wa(m);if(C>=L)throw A.i.de();this.se(m),this.oc(),m=this.description.Rf(m),this.Qc(1993),this.Aa[m].rr(_*L+C,D)},b.prototype.vb=function(m){return this.vx(),this.se(m),this.oc(),this.Aa[this.description.Rf(m)]},b.prototype.kn=function(m,_){if(_!=null&&A.sa.Vp(m)!=_.Vp())throw A.i.O();this.se(m),m=this.description.Rf(m),this.Aa==null&&(this.Aa=A.Zc.lI(this.description.Ba)),this.Aa[m]=_,this.Qc(16777215)},b.prototype.un=function(m){var _=null;if(this.Aa!=null){var C=A.fe.Kw(m,this.description);_=[];for(var D=0,L=m.Ba;Dthis.xa+5?(5*this.xa+3)/4:this.xa),this.Aa[m].resize(D*C,A.sa.te(_))),Dm)throw A.i.O();m!=this.xa&&(this.xa=m,this.Qc(65535))},b.prototype.qm=function(m){if(!this.ck(1)){if(!this.ck(2))return 0;if(this.LT>=m)return this.ck(8)?1:2}return-1},b.prototype.Eh=function(m,_){if(this.LT=_,m==-1)this.Nf(1,!0),this.Nf(8,!0);else if(this.Nf(1,!1),this.Nf(8,!0),m==0)this.Nf(2,!1),this.Nf(4,!1);else if(m==1)this.Nf(2,!0),this.Nf(4,!1);else{if(m!=2)throw A.i.ga("internal error.");this.Nf(2,!0),this.Nf(4,!0)}},b.prototype.gM=function(){this.Cb!=null&&(this.Cb=null)},b.prototype.fD=function(m,_,C,D){if(0>m||m>=this.xa||0>_||_>=this.xa)throw A.i.ga("index out of bounds");this.oc(),D.Pf(this.description),D.B()&&D.wn();for(var L=0;Lm||m>=this.xa)throw A.i.de();this.oc();var _=new A.Ta;_.Pf(this.description),_.B()&&_.wn();for(var C=0;Cm||m>=this.xa)throw A.i.de();if(_.B())throw A.i.O();this.oc();for(var C=_.description,D=0;DA.P.XA(this.Vm)>>1:b!=-1)?T=b:_=L,b=!0;;){if(0>_){if((L=D[7*T])==-1){_=T,m=this.ob.Nl([-1,-1,T,m,this.il(),-1,-1]),(D=this.ob.o)[7*T]=m;break}T=L}else{if((L=D[7*T+1])==-1){_=D[7*T+6],m=this.ob.Nl([-1,-1,T,m,this.il(),-1,-1]),(D=this.ob.o)[7*T+1]=m;break}T=L}b&&(_*=-1,b=!1)}return this.ky(m,D),D[7*m+2]===-1&&(D[7*C]=m),this.xp(_,m,C,D),m},H.prototype.AF=function(){return this.dR(this.Ne)},H.prototype.wd=function(T,b){b=b==-1?this.Ne:b,this.Tv?this.GP(T,b):this.eY(T,b)},H.prototype.search=function(T,b){for(b=this.uv(b);b!=-1;){var m=this.ao.compare(this,T,b);if(m==0)return b;b=0>m?this.nl(b):this.Zp(b)}return-1},H.prototype.DW=function(T){for(var b=this.uv(-1),m=-1;b!=-1;){var _=T.compare(this,b);if(_==0)return b;0>_?b=this.nl(b):(m=b,b=this.Zp(b))}return m},H.prototype.pJ=function(T){for(var b=this.uv(-1),m=-1;b!=-1;){var _=T.compare(this,b);if(_==0)return b;0>_?(m=b,b=this.nl(b)):b=this.Zp(b)}return m},H.prototype.ka=function(T){return this.ob.U(T,3)},H.prototype.nl=function(T){return this.ob.U(T,0)},H.prototype.Zp=function(T){return this.ob.U(T,1)},H.prototype.getParent=function(T){return this.ob.U(T,2)},H.prototype.lb=function(T){return this.ob.U(T,6)},H.prototype.xe=function(T){return this.ob.U(T,5)},H.prototype.sc=function(T){return T==-1?this.ml(this.Ne):this.ml(T)},H.prototype.Gc=function(T){return T==-1?this.bs(this.Ne):this.bs(T)},H.prototype.UR=function(T){return T==-1?this.XF(this.Ne):this.XF(T)},H.prototype.Uj=function(T,b){this.IB(T,b)},H.prototype.uv=function(T){return T==-1?this.TF(this.Ne):this.TF(T)},H.prototype.clear=function(){this.ob.oj(!1),this.Ne=-1},H.prototype.size=function(T){return T==-1?this.VF(this.Ne):this.VF(T)},H.prototype.FN=function(T,b){for(var m=b[7*T],_=b[7*T+1],C=b[7*T+4];m!=-1||_!=-1;){var D=m!=-1?b[7*m+4]:2147483647;if(_=_!=-1?b[7*_+4]:2147483647,C<=Math.min(D,_))break;D<=_?this.nJ(m,b):this.mJ(T,b),m=b[7*T],_=b[7*T+1]}},H.prototype.ky=function(T,b){if(this.Tv)for(var m=b[7*T+4],_=b[7*T+2];_!=-1&&b[7*_+4]>m;)b[7*_]==T?this.nJ(T,b):this.mJ(_,b),_=b[7*T+2]},H.prototype.mJ=function(T,b){var m=b[7*T+1];b[7*m+2]=b[7*T+2],b[7*T+2]=m;var _=b[7*m];b[7*T+1]=_,_!=-1&&(b[7*_+2]=T),b[7*m]=T,(_=b[7*m+2])!=-1&&(b[7*_]==T?b[7*_]=m:b[7*_+1]=m)},H.prototype.nJ=function(T,b){var m=b[7*T+2];b[7*T+2]=b[7*m+2],b[7*m+2]=T;var _=b[7*T+1];b[7*m]=_,_!=-1&&(b[7*_+2]=m),b[7*T+1]=m,(_=b[7*T+2])!=-1&&(b[7*_]===m?b[7*_]=T:b[7*_+1]=T)},H.prototype.Rk=function(T,b){this.ob.T(T,2,b)},H.prototype.OB=function(T,b){this.ob.T(T,0,b)},H.prototype.SB=function(T,b){this.ob.T(T,1,b)},H.prototype.RB=function(T,b){this.ob.T(T,5,b)},H.prototype.fx=function(T,b){this.ob.T(T,6,b)},H.prototype.SJ=function(T,b){this.ob.T(b,0,T)},H.prototype.nX=function(T){this.ob.T(T,4,0)},H.prototype.qX=function(T,b){this.ob.T(b,5,T)},H.prototype.TF=function(T){return T==-1?-1:this.ob.U(T,0)},H.prototype.ml=function(T){return T==-1?-1:this.ob.U(T,1)},H.prototype.bs=function(T){return T==-1?-1:this.ob.U(T,2)},H.prototype.dR=function(T){return T==-1?-1:this.ob.U(T,3)},H.prototype.VF=function(T){return T==-1?0:this.ob.U(T,4)},H.prototype.XF=function(T){return this.ob.U(T,5)},H.prototype.Rw=function(){return this.ob.Nl([-1,-1,-1,void 0,this.il(),-1,-1])},H.prototype.hl=function(T){T!=-1&&this.ob.kd(T)},H.prototype.il=function(){return this.Vm=A.P.XA(this.Vm),1073741823&this.Vm},H.prototype.AD=function(T,b,m){var _=this.ob.o;if(m==-1||_[7*m]==-1)return T=this.ob.Nl([-1,-1,-1,T,this.il(),-1,-1]),(_=this.ob.o)[7*m]=T,this.xp(-1,T,m,_),T;for(var C=m==-1?-1:_[7*m];;){var D=b==-1?1:this.ao.compare(this,T,C);if(0>D){if((D=this.nl(C))==-1){b=C,T=this.ob.Nl([-1,-1,C,T,this.il(),-1,-1]),(_=this.ob.o)[7*C]=T;break}C=D}else{if(b==1&&D==0)return _[7*m+3]=C,-1;if((D=_[7*C+1])==-1){b=_[7*C+6],T=this.ob.Nl([-1,-1,C,T,this.il(),-1,-1]),(_=this.ob.o)[7*C+1]=T;break}C=D}}return this.ky(T,_),_[7*T+2]===-1&&(_[7*m]=T),this.xp(b,T,m,_),T},H.prototype.xp=function(T,b,m,_){if(T!=-1){var C=_[7*T+5];_[7*T+5]=b}else C=m==-1?-1:_[7*m+2];_[7*b+5]=C,C!=-1&&(_[7*C+6]=b),_[7*b+6]=T,T==(m==-1?-1:_[7*m+1])&&(_[7*m+1]=b),T==-1&&(_[7*m+2]=b),_[7*m+4]=(m==-1?0:_[7*m+4])+1},H.prototype.vB=function(T,b){var m=this.ob.o,_=m[7*T+5];T=m[7*T+6],_!=-1?m[7*_+6]=T:m[7*b+1]=T,T!=-1?m[7*T+5]=_:m[7*b+2]=_,m[7*b+4]=b===-1?-1:m[7*b+4]-1},H.prototype.eY=function(T,b){this.vB(T,b);var m=this.nl(T),_=this.Zp(T),C=this.getParent(T),D=T;if(m!=-1&&_!=-1){this.Vm=A.P.XA(this.Vm);var L=1073741823=T.pa:T.wa>=this.pa},H.prototype.move=function(T){this.B()||(this.pa+=T,this.wa+=T)},H.prototype.normalize=function(){if(!isNaN(this.pa)){if(this.pa>this.wa){var T=this.pa;this.pa=this.wa,this.wa=T}isNaN(this.wa)&&this.Pa()}},H.prototype.Pa=function(){this.wa=this.pa=NaN},H.prototype.B=function(){return isNaN(this.pa)},H.prototype.$b=function(T){typeof T=="number"?this.B()?this.wa=this.pa=T:this.Nk(T):T.B()||(this.B()?(this.pa=T.pa,this.wa=T.wa):(this.pa>T.pa&&(this.pa=T.pa),this.wathis.wa&&this.Pa()))},H.prototype.Nk=function(T){Tthis.wa&&(this.wa=T)},H.prototype.contains=function(T){return typeof T=="number"?T>=this.pa&&T<=this.wa:T.pa>=this.pa&&T.wa<=this.wa},H.prototype.Fa=function(T){this.B()||T.B()?this.Pa():(this.paT.wa&&(this.wa=T.wa),this.pa>this.wa&&this.Pa())},H.prototype.X=function(T){this.B()||(this.pa-=T,this.wa+=T,this.wab?(this.pa=b,this.wa=T):(this.pa=T,this.wa=b)},H.prototype.Kt=function(T){return A.P.Tk(T,this.pa,this.wa)},H.prototype.S=function(){return this.wa-this.pa},H.prototype.tf=function(){return .5*(this.pa+this.wa)},H.prototype.Nb=function(T){return T==this||T instanceof H&&(!(!this.B()||!T.B())||this.pa==T.pa&&this.wa==T.wa)},H.prototype.dc=function(){return A.P.wj(A.P.wj())},H}();A.Oc=ye}(ae||(ae={})),function(A){var ye=new A.Oc,H=new A.Oc,T=function(){this.oe=null,this.pb=-1,this.tb=new A.zb,this.lA=55555555,this.Vv=this.Xv=!1,this.Wf=new A.Oc,this.Wf.FB(0,0)};A.EY=T;var b=function(){function m(_,C,D){this.g=_,this.Jk=NaN,this.IH=this.Mq=0,this.JH=NaN,this.ra=C,this.Pq=10*C,this.KH=this.LH=NaN,this.sg=!1,this.Fm=this.ht=this.No=this.Zs=this.Ys=-1,this.bA=D,this.OA=new T,this.TH=new T,A.P.truncate(3*_.gd/2)}return m.prototype.hG=function(_,C,D,L){_.oe=L===null?null:L[D[5*C]],_.Vv=_.oe!=null,_.Vv||((L=D[5*C+2])!==-1&&this.g.hW(D[5*C],D[5*L],_.tb),_.oe=_.tb,_.Wf.FB(_.tb.ta,_.tb.qa),_.Wf.wa+=this.ra,_.tb.mI(),_.Xv=_.tb.ma==_.tb.oa,_.Xv||(_.lA=(_.tb.qa-_.tb.ta)/(_.tb.ma-_.tb.oa)))},m.prototype.JO=function(_,C){var D=_.Br(C,this.ra,!0);return D!=0?D==2?this.Ly():this.zi():(_.$p(Ae),_.Vr(tt),C.$p(gt),C.Vr(ze),pe.na(this.Mq,this.Jk),Ae.rb(gt)&&this.Jk==Ae.y?0>tt.compare(ze)?pe.N(tt):pe.N(ze):Ae.rb(ze)&&this.Jk==Ae.y?0>tt.compare(gt)?pe.N(tt):pe.N(gt):gt.rb(tt)&&this.Jk==gt.y?0>Ae.compare(ze)?pe.N(Ae):pe.N(ze):tt.rb(ze)&&this.Jk==tt.y&&(0>Ae.compare(gt)?pe.N(Ae):pe.N(gt)),_.Me(pe.y,pe.x)D&&0>_?-1:0C.qa){if(C.qa>C.ta&&C.ma-C.oa<2*this.ra&&_.xi(C.qa,C.ma,this.ra))return this.zi()}else if((C.ma-C.oa)/(C.qa-C.ta)*(_.qa-_.ta)C.ta&&C.ma-C.oa<2*this.ra&&_.xi(C.qa,C.ma,this.ra))return this.zi()}else if((C.ma-C.oa)/(C.qa-C.ta)*(_.ta-_.qa)L&&0>D?-1:0C+q?D:L.xi(_.ta,_.oa,this.ra)?this.zi():BC+q?D:L.xi(_.qa,_.ma,this.ra)?this.zi():BB?1:0)},m.prototype.Mr=function(){this.sg=!1},m.prototype.tm=function(){return this.Pi},m.prototype.VJ=function(_,C){this.Jk=_,this.Mq=C,this.ht=this.No=this.Zs=this.Ys=-1},m.prototype.compare=function(_,C,D){return this.sg?-1:(_=_.ka(D),this.Fm=D,this.ME(C,C,_,_))},m.prototype.ME=function(_,C,D,L){if(this.No==C)var B=this.OA;else this.No=C,B=this.OA,this.OA.pb=_,this.hG(B,C,this.g.ud.o,this.g.Te);if(q==null){this.ht=L;var q=this.TH;this.TH.pb=D,this.hG(q,L,this.g.ud.o,this.g.Te)}return B.Vv||q.Vv?this.IO(C,L,B,q):B.Wf.wathis.Wf.wa)return 1;if(this.je.oa==this.je.ma)return this.Fm=T,this.sg=!0,0;this.je.mI(),m=this.je.bc(),(b=new A.h).vc(this.je.xc(),m),b.cr();var _=new A.h;return _.vc(this.Iq,m),m=b.Sh(_),(m/=b.length())<10*-this.ra?-1:m>10*this.ra?1:this.je.ss(this.Iq,this.ra)&&((b=Math.abs(m))m?-1:1},H}();A.WL=ye}(ae||(ae={})),function(A){function ye(T,b,m,_){m=new Float64Array(T.subarray(m,_)),T.set(m,b)}var H=function(){function T(b){this.Pb=this.rk=!1,this.o=null;var m=b;2>m&&(m=2),this.o=new Float64Array(m),this.size=b}return T.prototype.rotate=function(b,m,_){if(this.Pb)throw A.i.ga("invalid_call");if(m_||b>_)throw A.i.O();b!=m&&_!=m&&(this.pi(b,m-b,1),this.pi(m,_-m,1),this.pi(b,_-b,1))},T.rf=function(b,m){var _=new T(b),C=_.o;if(2>b&&(b=2),m!==0)for(var D=0;Dm&&(_.size=m),2>(m=_.size)&&(m=2),_.o=new Float64Array(m),_.o.set(b.o.length<=m?b.o:b.o.subarray(0,m),0),_},T.prototype.Jb=function(b){0>=b||(this.o==null?this.o=new Float64Array(b):b<=this.o.length||(0this.o.length&&(_=A.P.truncate(64>b?Math.max(2*b,4):5*b/4),(_=new Float64Array(_)).set(this.o),this.o=_),_=this.o;for(var C=this.size;Cthis.o.length)&&this.resize(b),this.rk)throw A.i.ga("invalid call. Attribute Stream is locked and cannot be resized.");this.size=b},T.prototype.rr=function(b,m){this.write(b,m)},T.prototype.Cn=function(b,m,_){for(var C=this.size;mC||_>D&&C!=D)return!1;for(_>C&&(_=C);m<_;m++)if(this.read(m)!=b.read(m))return!1;return!0},T.prototype.addRange=function(b,m,_,C,D){if(this.Pb)throw A.i.Hb();if(!C&&(1>D||_%D!=0))throw A.i.O();var L=this.size;if(this.resize(L+_),C)this.o.set(b.o.subarray(m,m+_),L);else{C=_;for(var B=0;B<_;B+=D){C-=D;for(var q=0;qL||C%L!=0))throw A.i.O();var q=this.size-B;if(qL&&(L=this.size),this.size+2*C>this.o.length?this.resize(this.size+2*C):this.size+=2*C,ye(this.o,b+2*C,b,b+(L-b)),D)for(D=0;Db||0>m||0>C||!D&&(0>=L||m%L!=0)||_.sizethis.size)throw A.i.Hb();0<_-(b+m)&&ye(this.o,b,b+m,b+(_-(b+m))+m),this.size-=m},T.prototype.pi=function(b,m,_){if(this.Pb||1>_||m%_!=0)throw A.i.Hb();for(var C=m>>1,D=0;Dm||0>_||0>m||_+m>this.size)throw A.i.O();for(var C=m;Cb||0>m||0>C)throw A.i.O();if(m!=0)for(this.size<(m<<1)+b&&this.resize((m<<1)+b),D||(b+=m-1<<1),D=D?2:-2,m+=C;Cb||0>m)throw A.i.O();if(m!=0){this.size<(m<<1)+b&&this.resize((m<<1)+b),m+=0;for(var C=0;Cb||0>m||0>C||this.sizeb||0>m||this.size<(m>>1)+b)throw A.i.O();if(m!=0){m=0+m;for(var C=0;Cm&&(m=2),this.o=new Int32Array(m),this.size=b}return T.prototype.rotate=function(b,m,_){if(this.Pb)throw A.i.ga("invalid_call");if(m_||b>_)throw A.i.O();b!=m&&_!=m&&(this.pi(b,m-b,1),this.pi(m,_-m,1),this.pi(b,_-b,1))},T.rf=function(b,m){var _=new T(b),C=_.o;if(2>b&&(b=2),m!==0)for(var D=0;Dm&&(_.size=m),2>(m=_.size)&&(m=2),_.o=new Int32Array(m),_.o.set(b.o.length<=m?b.o:b.o.subarray(0,m),0),_},T.prototype.Jb=function(b){0>=b||(this.o==null?this.o=new Int32Array(b):b<=this.o.length||(0this.o.length&&(_=A.P.truncate(64>b?Math.max(2*b,4):5*b/4),(_=new Int32Array(_)).set(this.o),this.o=_),_=this.o;for(var C=this.size;Cthis.o.length)&&this.resize(b),this.rk)throw A.i.ga("invalid call. Attribute Stream is locked and cannot be resized.");this.size=b},T.prototype.rr=function(b,m){this.write(b,m)},T.prototype.Cn=function(b,m,_){for(var C=this.size;mC||_>D&&C!=D)return!1;for(_>C&&(_=C);m<_;m++)if(this.read(m)!=b.read(m))return!1;return!0},T.prototype.addRange=function(b,m,_,C,D){if(this.Pb)throw A.i.Hb();if(!C&&(1>D||_%D!=0))throw A.i.O();var L=this.size;if(this.resize(L+_),C)this.o.set(b.o.subarray(m,m+_),L);else{C=_;for(var B=0;B<_;B+=D){C-=D;for(var q=0;qL||C%L!=0))throw A.i.O();if(ye(this.o,b+C,b,b+(B-b)),this.o==m.o&&b<_&&(_+=C),D)this.o.set(m.o.subarray(_,_+C),b);else for(D=C,B=0;BL&&(L=this.size),this.size+2*C>this.o.length?this.resize(this.size+2*C):this.size+=2*C,ye(this.o,b+2*C,b,b+(L-b)),D)for(D=0;Db||0>m||0>C||!D&&(0>=L||m%L!=0)||_.sizethis.size)throw A.i.Hb();0<_-(b+m)&&ye(this.o,b,b+m,b+(_-(b+m))+m),this.size-=m},T.prototype.pi=function(b,m,_){if(this.Pb||1>_||m%_!=0)throw A.i.Hb();for(var C=m>>1,D=0;Dm||0>_||0>m||_+m>this.size)throw A.i.O();for(var C=m;Cb||0>m||0>C)throw A.i.O();if(m!=0)for(this.size<(m<<1)+b&&this.resize((m<<1)+b),D||(b+=m-1<<1),D=D?2:-2,m+=C;Cb||0>m||0>C||this.sizem-b?T.mG(this.o,b,m,_):T.lB(this.o,b,m-1,_)},T.prototype.Vp=function(){return 2},T.prototype.Gc=function(){return this.o[this.size-1]},T.prototype.Jf=function(){this.resize(this.size-1)},T.prototype.XW=function(b){this.o[this.size-1]=b},T.prototype.NV=function(b){b=m&&0=_))for(;;){if(9>_-m){T.mG(b,m,_+1,C);break}var D=b[m];T.sx(b,m,_);for(var L=m,B=m;B<_;B++)0>=C(b[B],D)&&(T.sx(b,L,B),L+=1);T.sx(b,L,_),L-m<_-L?(T.lB(b,m,L-1,C),m=L+1):(T.lB(b,L+1,_,C),_=L-1)}},T}();A.ja=H}(ae||(ae={})),function(A){function ye(T,b,m,_){m=new Int8Array(T.subarray(m,_)),T.set(m,b)}var H=function(){function T(b){this.o=null;var m=b;2>m&&(m=2),this.o=new Int8Array(m),this.size=b}return T.prototype.rotate=function(b,m,_){if(this.Pb)throw A.i.ga("invalid_call");if(m_||b>_)throw A.i.O();b!=m&&_!=m&&(this.pi(b,m-b,1),this.pi(m,_-m,1),this.pi(b,_-b,1))},T.rf=function(b,m){var _=new T(b),C=_.o;if(2>b&&(b=2),m!==0)for(var D=0;Dm&&(_.size=m),2>(m=_.size)&&(m=2),_.o=new Int8Array(m),_.o.set(b.o.length<=m?b.o:b.o.subarray(0,m),0),_},T.prototype.Jb=function(b){0>=b||(this.o==null?this.o=new Int8Array(b):b<=this.o.length||(0this.o.length&&(_=A.P.truncate(64>b?Math.max(2*b,4):5*b/4),(_=new Int8Array(_)).set(this.o),this.o=_),_=this.o;for(var C=this.size;Cthis.o.length)&&this.resize(b),this.rk)throw A.i.ga("invalid call. Attribute Stream is locked and cannot be resized.");this.size=b},T.prototype.rr=function(b,m){this.write(b,m)},T.prototype.Cn=function(b,m,_){for(var C=this.size;mC||_>D&&C!=D)return!1;for(_>C&&(_=C);m<_;m++)if(this.read(m)!=b.read(m))return!1;return!0},T.prototype.addRange=function(b,m,_,C,D){if(this.Pb)throw A.i.Hb();if(!C&&(1>D||_%D!=0))throw A.i.O();var L=this.size;if(this.resize(L+_),C)this.o.set(b.o.subarray(m,m+_),L);else{C=_;for(var B=0;B<_;B+=D){C-=D;for(var q=0;qL||C%L!=0))throw A.i.O();if(ye(this.o,b+C,b,b+(B-b)),this.o==m.o&&b<_&&(_+=C),D)this.o.set(m.o.subarray(_,_+C),b);else for(D=C,B=0;BL&&(L=this.size),this.size+2*C>this.o.length?this.resize(this.size+2*C):this.size+=2*C,ye(this.o,b+2*C,b,b+(L-b)),D)for(D=0;Db||0>m||0>C||!D&&(0>=L||m%L!=0)||_.sizethis.size)throw A.i.Hb();0<_-(b+m)&&ye(this.o,b,b+m,b+(_-(b+m))+m),this.size-=m},T.prototype.pi=function(b,m,_){if(this.Pb||1>_||m%_!=0)throw A.i.Hb();for(var C=m>>1,D=0;Dm||0>_||0>m||_+m>this.size)throw A.i.O();for(var C=m;Cb||0>m||0>C)throw A.i.O();if(m!=0)for(this.size<(m<<1)+b&&this.resize((m<<1)+b),D||(b+=m-1<<1),D=D?2:-2,m+=C;Cb||0>m||0>C||this.sizeT?-T:T},H.vi=function(T){return 3552713678800501e-30>T},H.FC=function(T,b,m){return H.R(T-b)<=m*(1+(H.R(T)+H.R(b))/2)},H.$=function(T,b){return H.FC(T,b,3552713678800501e-30)},H.AL=function(T){return 3552713678800501e-30>=H.R(T)},H.Dd=function(T){return H.AL(T)},H}();A.s=ye,A.F=function(){function H(){}return H.ip=function(T,b){var m=0;return(T=ye.R(T))+(b=ye.R(b))!=0&&(T>b?(m=b/T,m=T*Math.sqrt(1+m*m)):(m=T/b,m=b*Math.sqrt(1+m*m))),m},H.Yq=function(T,b,m,_,C){for(var D=[0,0,0],L=[0,0,0],B=0;2>=B;B++)b[B]-=T[B],m[B]-=b[B];m=D[1]*L[2]-D[2]*L[1],b=D[2]*L[0]-D[0]*L[2],D=D[0]*L[1]-D[1]*L[0],T=-1*(m*T[0]+b*T[1]+D*T[2]),_[0]=m,_[1]=b,_[2]=D,_[3]=T,L=H.qn(_),_[0]/=L,_[1]/=L,_[2]/=L,_[3]/=L,C!=0&&(L=ye.Dd(D)?ye.Dd(T)?ye.Mb(1,b):-ye.Mb(1,T):ye.Mb(1,D),L*=ye.Mb(1,C),_[0]*=L,_[1]*=L,_[2]*=L,_[3]*=L)},H.yx=function(T,b,m){m[0]=T[1]*b[2]-b[1]*T[2],m[1]=T[2]*b[0]-b[2]*T[0],m[2]=T[0]*b[1]-b[0]*T[1]},H.Ut=function(T,b){return T[0]*b[0]+T[1]*b[1]+T[2]*b[2]},H.qn=function(T){return H.ip(H.ip(T[0],T[1]),T[2])},H.el=function(T,b,m,_,C,D,L,B){T=H.n(T,b,m);var q=Math.cos(m);D.u=(T+C)*q*Math.cos(_),L.u=(T+C)*q*Math.sin(_),B.u=(T*(1-b)+C)*Math.sin(m)},H.eO=function(T,b,m,_,C,D,L){var B=H.ip(b,m),q=1*Math.sqrt(1-T),Q=q/1;if(ye.$(B,0))D.u=0,C.u=ye.Mb(1.570796326794897,_),L.u=ye.R(_)-q;else{D.u=Math.atan2(m,b),m=Math.atan2(1*_,q*B),D=Math.cos(m);var oe=Math.sin(m);b=q*T/(1-T),T*=1,m=Math.atan2(_+b*oe*oe*oe,B-T*D*D*D),3.141592653589793T){var m=Math.sqrt(1-T),_=(1-m)/(1+m),C=_*_,D=_*C,L=_*D,B=_*L,q=_*B,Q=_*q,oe=1.572916666666667*D-3.2578125*B+4.295068359375*Q;T=2.142578125*L-6.071484375*q,m=3.129296875*B-11.249837239583334*Q;var le=4.775276692708333*q,be=7.958636765252976*Q,Me=Math.cos(2*b);return b+Math.sin(2*b)*(1.5*_-.84375*D+.525390625*B-.2688395182291667*Q-oe+m-be+Me*(2*(1.3125*C-1.71875*L+1.650146484375*q)-4*T+6*le+Me*(4*oe-12*m+24*be+Me*(8*T-32*le+Me*(16*m-80*be+Me*(32*le+64*Me*be))))))}for(m=1-T,_=T/2,D=(C=ye.R(b))*H.av(T)/(1.570796326794897*m),L=9999,q=C,C=0;1e-16C;C++)Q=H.w(T,q),B=q-(oe=(B=(H.fG(q,T)-_*Math.sin(2*q)/Q)/m-D)/(Q=1/(Q*Q*Q))),L=ye.R(oe),q=B;return 0<=b?q:-q},H.lW=function(T,b){return ye.vi(b)?T:T*H.av(b)/1.570796326794897},H.ca=function(T){return 0>(T=H.kF(T,6.283185307179586))?T+6.283185307179586:3.141592653589793>ye.R(T)||ye.$(ye.R(T),3.141592653589793)?T:T-6.283185307179586},H.kF=function(T,b){return T-Math.floor(T/b)*b},H.Ch=function(T,b){if(.006884661117170036>b){var m=(b=(1-(b=Math.sqrt(1-b)))/(1+b))*b,_=m*m;return T/(1+b)*(1+.25*m+.015625*_+.00390625*m*_)*1.570796326794897}return T*H.av(b)},H.Xq=function(T,b){var m=ye.Mb(1,Math.sin(b));return b=1.570796326794897>=(b=ye.R(H.kF(b,3.141592653589793)))?b:3.141592653589793-b,(ye.$(b,1.570796326794897)?b:Math.atan(Math.sqrt(1-T)*Math.tan(b)))*m},H.q=function(T,b,m){if(.006884661117170036>b){var _=(b=(1-(b=Math.sqrt(1-b)))/(1+b))*b,C=b*_,D=b*C,L=b*D,B=b*L,q=b*B,Q=-.7291666666666666*C+.2278645833333333*L+.03987630208333334*q,oe=.615234375*D-.21533203125*B,le=-.54140625*L+.20302734375*q,be=.48876953125*B,Me=-.4488699776785715*q,Ye=Math.cos(2*m);return T/(1+b)*((1+.25*_+.015625*D+.00390625*B)*m+Math.sin(2*m)*(-1.5*b+.1875*C+.0234375*L+.00732421875*q-Q+le-Me+Ye*(2*(.9375*_-.234375*D-.03662109375*B)-4*oe+6*be+Ye*(4*Q-12*le+24*Me+Ye*(8*oe-32*be+Ye*(16*le-80*Me+Ye*(32*be+64*Ye*Me)))))))}return T*(H.fG(m,b)-.5*b*Math.sin(2*m)/H.w(b,m))},H.w=function(T,b){return b=Math.sin(b),Math.sqrt(1-T*b*b)},H.av=function(T){return ye.FC(T,1,2220446049250313e-31)?1:1>T?H.Zw(0,1-T)-T/3*H.Ww(0,1-T):NaN},H.fG=function(T,b){var m=ye.Mb(1,T);T=ye.R(T);var _=Math.floor(T/1.570796326794897);if(1ye.R(_)&&1e-4>ye.R(C)&&1e-4>ye.R(D));)D=Math.sqrt(B),b+=T/((m=Math.sqrt(q))*(q+(D=Math.sqrt(L)*(D+m)+D*m))),T*=.25,L=.25*(L+D),B=.25*(B+D),q=.25*(q+D);return B=(L=_*C)-(q=D*D),3*b+T*(1+(q=L-6*q)*(.10227272727272728*q-.2142857142857143-.1730769230769231*D*(_=q+B+B))+D*(.1666666666666667*_+D*(-.4090909090909091*B+.1153846153846154*D*L)))/(m*Math.sqrt(m))},H.Zw=function(T,b){for(var m,_,C,D,L=1;_=2-((m=(T+b+L)/3)+T)/m,C=2-(m+b)/m,D=2-(m+L)/m,!(1e-4>ye.R(_)&&1e-4>ye.R(C)&&1e-4>ye.R(D));L=.25*(L+m))m=Math.sqrt(b),_=Math.sqrt(L),T=.25*(T+(m=Math.sqrt(T)*(m+_)+m*_)),b=.25*(b+m);return(1+(.04166666666666666*(T=_*C-D*D)-.1-.06818181818181818*(b=_*C*D))*T+.07142857142857142*b)/Math.sqrt(m)},H.Sw=function(T,b){if(ye.vi(T)||b==0||ye.$(ye.R(b),1.570796326794897))return b;if(.006884661117170036>T){var m=T*T,_=T*m,C=T*_,D=T*C,L=T*D,B=T*L,q=-(.02708333333333333*_+.03430059523809524*C+.03149181547619048*D+.02634359154541446*L+.02156896735835538*B),Q=.007669890873015873*C+.01299603174603175*D+.0148051353064374*L+.01454454953803912*B,oe=-(.002275545634920635*D+.004830845032667949*L+.006558395368616723*B),le=.0006957236677288761*L+.001775193002406544*B,be=-.000217324089394402*B,Me=Math.cos(2*b);return b+Math.sin(2*b)*(-(.5*T+.2083333333333333*m+.09375*_+.04878472222222222*C+.02916666666666667*D+.01938905423280423*L+.01388255931712963*B)-q+oe-be+Me*(2*(.1041666666666667*m+.0875*_+.06050347222222222*C+.04151785714285714*D+.02958958540013228*L+.02203667534722222*B)-4*Q+6*le+Me*(4*q-12*oe+24*be+Me*(8*Q-32*le+Me*(16*oe-80*be+Me*(32*le+64*Me*be))))))}return b==0||ye.$(ye.R(b),1.570796326794897)?m=b:(C=(_=Math.sqrt(T))*Math.sin(b),m=Math.tan(.7853981633974483+b/2)*Math.pow((1-C)/(1+C),_/2),m=2*Math.atan(m)-1.570796326794897),m},H.tO=function(T,b){if(ye.vi(T)||b==0||ye.$(ye.R(b),1.570796326794897))return b;if(.006884661117170036>T){var m=T*(le=T*(oe=T*(Me=T*T))),_=T*(be=T*m),C=.05833333333333333*oe+.07232142857142858*le+.05634300595238095*m+.0355325796406526*be+.020235546186067*_,D=.02653149801587302*le+.04379960317460317*m+.0429211791776896*be+.03255384637546096*_,L=.01294022817460318*m+.02668104344536636*be+.03155651254609588*_,B=.00659454790965208*be+.0163075268674227*_,q=.003463473736911237*_,Q=Math.cos(2*b);return b+Math.sin(2*b)*(.5*T+.2083333333333333*Me+.08333333333333333*oe+.03611111111111111*le+.01875*m+.01195601851851852*be+.008863673941798942*_-C+L-q+Q*(2*(.1458333333333333*Me+.1208333333333333*oe+.07039930555555556*le+.03616071428571429*m+.01839451058201058*be+.01017113095238095*_)-4*D+6*B+Q*(4*C-12*L+24*q+Q*(8*D-32*B+Q*(16*L-80*q+Q*(32*B+64*Q*q))))))}var oe=Math.sqrt(T),le=oe/2,be=Math.tan(.7853981633974483+b/2);T=0,C=1;for(var Me=b;C!=0;Me=_)m=oe*Math.sin(Me),_=be*Math.pow((1+m)/(1-m),le),_=2*Math.atan(_)-1.570796326794897,T++,(ye.$(_,Me)||3e4this.Mk&&(this.Mk=0);var m=this.Re.getType();if(this.eH=m==A.Tc.PE_TYPE_PROJCS?2:1,m==A.Tc.PE_TYPE_PROJCS&&!T.loadConstants())throw A.i.O("PeProjcs.loadConstants failed");b=m==A.Tc.PE_TYPE_GEOGCS?this.Re:this.Re.getGeogcs(),m!=A.Tc.PE_TYPE_GEOGCS&&A.qf.getCode(b),this.Go=T.getUnit(),this.MH=b.getPrimem().getLongitude(),this.rH=T=b.getUnit().getUnitFactor(),T=Math.PI/(180*T),1e-10>Math.abs(T-1)&&(T=1),this.BA=T,m&A.Tc.PE_TYPE_PROJCS?(b=this.Re,this.CA=1/b.getUnit().getUnitFactor(),this.uw=.001/this.Re.getUnit().getUnitFactor(),this.vw=A.Eg.generate(b,A.Eg.PE_PCSINFO_OPTION_NONE),this.Bl=this.vw.isPannableRectangle(),this.Xz=A.Ab.lN(this.vw.getCentralMeridian(),this.BA)):(this.FA=this.Bl=!0,this.CA=0,m=1/b.getUnit().getUnitFactor(),this.uw=.001/b.getDatum().getSpheroid().getAxis()*m,this.Xz=0),this.Bl&&(this.wx(),this.yK(),this.jY(),this.xK(),this.hY(),this.iY())}return H.prototype.cs=function(){return this.Mk},H.prototype.mk=function(){return this.vw},H.Ky=function(T,b){return T==b||T!=null&&b!=null&&T.Mk==0&&b.Mk==0&&T.Cs===b.Cs},H.prototype.Xc=function(){return this.Bl},H.prototype.ih=function(T){T.L(this.uo)},H.prototype.rv=function(){return this.uo.v},H.prototype.qv=function(){return this.uo.C},H.prototype.BR=function(T){T.L(this.ww)},H.prototype.hY=function(){var T=this.Re.getType();if(T==A.Tc.PE_TYPE_PROJCS){T=this.Re;var b=this.mk().getCentralMeridian(),m=T.getGeogcs();if(m==null)throw A.i.ga("internal error");b=[[b+(m=1/m.getUnit().getUnitFactor()*Math.PI),0]],A.gj.geogToProj(T,1,b),b=b[0][0],m=T.getParameters()[A.Tc.PE_PARM_X0].getValue();var _=this.ol();T=new A.l,_.A(T),b=(_=Math.abs(b-m))+m,m=-1*_+m,_=T.H,T=T.G;var C=new A.l;C.L(m,T,b,_),this.uo==null&&(this.uo=C)}else{if(T!=A.Tc.PE_TYPE_GEOGCS)throw A.i.ga("internal error");m=1/this.Re.getUnit().getUnitFactor()*Math.PI,(T=new A.l).L(-m,-m/2,m,m/2),this.uo==null&&(this.uo=T)}},H.prototype.iY=function(){var T=this.Re.getType();if(T==A.Tc.PE_TYPE_PROJCS){var b=this.Re;if(T=this.mk().getCentralMeridian(),(b=b.getGeogcs())==null)throw A.i.ga("internal error");b=1/b.getUnit().getUnitFactor()*Math.PI;var m=this.Xr(),_=new A.l;m.A(_),(m=new A.l).L(T-b,_.G,T+b,_.H),this.ww==null&&(this.ww=m)}else{if(T!=A.Tc.PE_TYPE_GEOGCS)throw A.i.ga("internal error");b=1/this.Re.getUnit().getUnitFactor()*Math.PI,(T=new A.l).L(-b,-b/2,b,b/2),this.ww==null&&(this.ww=T)}},H.prototype.bf=function(){return this.BA},H.prototype.rm=function(){return this.CA},H.prototype.Xr=function(){if(this.Bl)return this.wl;var T=this.wl;return T??(this.wx(),this.wl)},H.prototype.Yr=function(){return this.Bl?null:(this.wl!=null||this.wx(),this.TG)},H.prototype.wx=function(){if(this.Re.getType()==A.Tc.PE_TYPE_PROJCS){var T=this.Re,b=T.getGeogcs(),m=T.horizonGcsGenerate();if(m!=null){var _=m[0].getNump(),C=m[0].getKind();T=0q&&(m=-400*D,oe.L(m,oe.G,m+5*B,oe.H)),m=new A.Hh(oe),this.wl==null&&(this.wl=m,this.Kv=T);else{if(q=new A.Ea,B=this.mk().isGcsHorizonMultiOverlap(),oe=A.iu.XE(b,A.ju.Integer64),B){for(q=new A.bL,Q=A.Ih.local().W(q,oe,null),be=0;be<_;be++)if(m[be].getKind()==A.Tc.PE_HORIZON_POLY){for(b=m[be].getSize(),D=m[be].getCoord(),C=[],L=0;Lthis.us&&(this.us=0),this.Go=b=this.FT.getUnit(),this.DH=1/b.getUnitFactor(),A.qf.getCode(T)}return H.Ky=function(T,b){return T==b||T!=null&&b!=null&&T.us==0&&b.us==0&&T.Cs===b.Cs},H.prototype.cs=function(){return this.us},H}();A.KL=ye}(ae||(ae={})),function(A){A.$g=function(){function ye(){}return ye.ub=function(H,T,b,m,_,C,D,L){if(C!=null||D!=null||L!=null){m=A.F.ca(m),T=A.F.ca(T),b=A.F.ca(b),_=A.F.ca(_),1.570796326794897b?m:A.F.ca(3.141592653589793-m):Math.atan2(oe*Me,q*le-Q*oe*be)),L!=null&&(A.s.$(A.s.R(_),1.570796326794897)?L.u=0>_?T:A.F.ca(3.141592653589793-T):(L.u=Math.atan2(q*Me,le*q*be-oe*Q),L.u=A.F.ca(L.u+3.141592653589793)))}}},ye.sf=function(H,T,b,m,_,C,D){if(C!=null||D!=null){T=A.F.ca(T),b=A.F.ca(b),1.570796326794897le?_:A.F.ca(3.141592653589793-_):T:A.s.$(A.s.R(b),1.570796326794897)&&A.s.$(H,3.141592653589793)?0>b?_:A.F.ca(3.141592653589793-_):A.F.ca(T+Math.atan2(oe*B,q*m-Q*oe*L)))}},ye}()}(ae||(ae={})),function(A){A.Yk=function(){function ye(){}return ye.ub=function(H,T,b,m,_,C,D,L,B){var q=new A.ha(0),Q=new A.ha(0),oe=[0,0,0],le=[0,0,0],be=[0,0,0],Me=new A.ha(0),Ye=new A.ha(0),it=new A.ha(0),Lt=new A.ha(0),Ut=new A.ha(0);if(D!=null||L!=null||B!=null)if(A.s.vi(T))A.$g.ub(H,b,m,_,C,D,L,B);else{_=A.F.ca(_),b=A.F.ca(b);var Je=A.F.ca(_-b);if(A.s.$(m,C)&&(A.s.$(b,_)||A.s.$(A.s.R(m),1.570796326794897)))D!=null&&(D.u=0),L!=null&&(L.u=0),B!=null&&(B.u=0);else{if(A.s.$(m,-C)){if(A.s.$(A.s.R(m),1.570796326794897))return D!=null&&(D.u=2*A.F.Ch(H,T)),L!=null&&(L.u=0Je){Rt=1;var ri=b;b=_,_=ri,ri=m,m=C,C=ri}Je=A.F.pt(T,m);var ti=A.F.pt(T,C);L==null&&B==null||(A.$g.ub(H,b,Je,_,ti,null,q,Q),q=Math.atan2(Math.sin(q.u)*Math.cos(m-Je),Math.cos(q.u)),Q=Math.atan2(Math.sin(Q.u)*Math.cos(C-ti),Math.cos(Q.u)),Rt!=0&&(ri=q,q=Q,Q=ri),L!=null&&(L.u=q),B!=null&&(B.u=Q)),D!=null&&(A.F.el(1,T,m,b,0,it,Lt,Ut),oe[0]=it.u,oe[1]=Lt.u,oe[2]=Ut.u,A.F.el(1,T,C,_,0,it,Lt,Ut),le[0]=it.u,le[1]=Lt.u,le[2]=Ut.u,be[0]=oe[1]*le[2]-le[1]*oe[2],be[1]=-(oe[0]*le[2]-le[0]*oe[2]),be[2]=oe[0]*le[1]-le[0]*oe[1],T=1-A.F.w(T,A.F.Xq(T,A.F.Sj(T,Math.acos(be[2]/Math.sqrt(be[0]*be[0]+be[1]*be[1]+be[2]*be[2]))))),T*=2-T,L=Math.atan2(-be[1],-be[0]),be=A.F.ca(L-1.570796326794897),L=A.F.ca(L+1.570796326794897),be=A.s.R(A.F.ca(b-be))<=A.s.R(A.F.ca(b-L))?be:L,A.$g.ub(1,be,0,b,Je,Me,null,null),A.$g.ub(1,be,0,_,ti,Ye,null,null),3.141592653589793_&&(_=A.s.R(_),C=A.F.ca(C+3.141592653589793)),b=A.F.ca(b),m=A.F.ca(m),1.570796326794897=A.s.R(C)?1:-1);C=A.F.ca(b+Math.atan(Math.tan(C)*-Math.sin(it))),A.$g.ub(H,C,0,b,it,null,Q,null),it=A.s.R(1.570796326794897-A.s.R(Q.u)),it=A.F.Sj(T,it),it=1-A.F.w(T,A.F.Xq(T,it)),it*=2-it,A.F.el(1,T,0,C,0,be,Me,Ye),oe[0]=be.u,oe[1]=Me.u,oe[2]=Ye.u,A.F.el(1,T,m,b,0,be,Me,Ye),le[0]=be.u,le[1]=Me.u,le[2]=Ye.u,m=Math.acos((oe[0]*le[0]+oe[1]*le[1]+oe[2]*le[2])/Math.sqrt(le[0]*le[0]+le[1]*le[1]+le[2]*le[2])),m=A.F.Sj(it,m),_=0<(m=A.F.q(H,it,m)+_*Lt)?Q.u:A.F.ca(Q.u+3.141592653589793),H=A.s.R(m)/A.F.Ch(H,it)*1.570796326794897,H=A.F.Tq(it,H),H=A.F.pt(it,H),A.$g.sf(1,C,0,H,_,D,q),L!=null&&(B=q.u),L!=null&&(L.u=A.F.Sj(T,B))}},ye}()}(ae||(ae={})),function(A){A.eu=function(){function ye(){}return ye.ub=function(H,T,b,m,_,C,D,L,B){var q=0,Q=0,oe=0;if(D!=null||L!=null||B!=null)if(A.s.vi(T))A.$g.ub(H,b,m,_,C,D,L,B);else{var le=A.F.ca(_-b);if(A.s.$(m,C)&&(A.s.Dd(le)||A.s.$(A.s.R(m),1.570796326794897)))D!=null&&(D.u=0),L!=null&&(L.u=0),B!=null&&(B.u=0);else{if(A.s.$(m,-C)){if(A.s.$(A.s.R(m),1.570796326794897))return D!=null&&(D.u=2*A.F.Ch(H,T)),L!=null&&(L.u=0=ii&&!A.s.$(Ci,Rt));if(Zt!=0)be=(Me*=q)*(256+Me*(Me*(74-47*Me)-128))/1024,D!=null&&(D.u=Ye*(1+Me*(4096+Me*(Me*(320-175*Me)-768))/16384)*(tr-be*ki*(Q+be/4*(Ni*(2*oe-1)-be/6*Q*(4*ki*ki-3)*(4*oe-3))))),L!=null&&(L.u=A.s.$(A.s.R(m),1.570796326794897)?0>m?_:A.F.ca(3.141592653589793-_):Math.atan2(Ut*ti,T*Je-Lt*Ut*ri)),B!=null&&(A.s.$(A.s.R(C),1.570796326794897)?B.u=0>C?b:A.F.ca(3.141592653589793-b):(B.u=Math.atan2(T*ti,T*Je*ri-Lt*Ut),B.u=A.F.ca(B.u+3.141592653589793)));else{Rt=A.s.Mb(3.141592653589793,le),Ni=Lt*Je-T*Ut,tr=Math.acos(Ni),ki=Math.sin(tr),q=1,ii=cr=0;do oe=cr,ri=1-.25*(cr=be*(q*=q)*(1+be+be*be))+.1875*(Q=be*be*(ri=q*q)*(1+2.25*be))-.1953125*(Zt=be*be*be*ri*q),cr=.25*cr-.25*Q+.29296875*Zt,ti=.03125*Q-.05859375*Zt,Zt*=.00651041666666667,Q=Ni-2*Lt*Je/q,1=ii&&!A.s.$(oe,cr));D!=null&&(ri=1+(Me*=q*=q)*(4096+Me*(Me*(320-175*Me)-768))/16384,A.s.$(m,-C)?D.u=3.141592653589793*Ye*ri:(Q=Ni-2*Lt*Je/q,q=Math.acos(Q),Ni=Math.cos(2*q),Ci=Math.cos(3*q),D.u=Ye*(ri*tr+Me*(Me*(128+Me*(35*Me-60))-512)/2048*ki*Q+Me*(5*Me-4)/6144*Me*Me*Math.sin(2*tr)*Ni+Zt*Math.sin(3*tr)*Ci+-762939453125e-16*Me*Me*Me*Me*Math.sin(4*tr)*Math.cos(4*q)))),L!=null&&(A.s.Dd(m)&&A.s.Dd(C)?(q=Math.sqrt(1-cr*cr),L.u=Math.acos(q),0>le&&(L.u*=-1)):A.s.$(A.s.R(m),1.570796326794897)?L.u=0>m?_:A.F.ca(3.141592653589793-_):(D=cr/T,Ye=Math.sqrt(1-D*D),0>T*Je-Lt*Ut*Math.cos(Rt)&&(Ye*=-1),L.u=Math.atan2(D,Ye),A.s.$(m,-C)&&A.s.R(A.F.ca(b-_))>3.141592653589793*(1-be*Math.cos(m))&&(0A.s.R(L.u)||0>m&&1.570796326794897C?b:A.F.ca(3.141592653589793-b):(le=cr/Ut,D=Math.sqrt(1-le*le),Ye=Math.sin(Rt/2),0>Math.sin(it-H)-2*T*Je*Ye*Ye&&(D*=-1),B.u=Math.atan2(le,D),B.u=A.F.ca(B.u+3.141592653589793),A.s.$(m,-C)&&!A.s.Dd(m)&&!A.s.$(A.s.R(m),1.570796326794897)&&A.s.R(A.F.ca(b-_))>3.141592653589793*(1-be*Math.cos(m))&&(L!=null?Ye=L.u:(D=cr/T,Ye=Math.sqrt(1-D*D),0>T*Je-Lt*Ut*Math.cos(Rt)&&(Ye*=-1),Ye=Math.atan2(D,Ye),A.s.$(m,-C)&&A.s.R(A.F.ca(b-_))>3.141592653589793*(1-be*Math.cos(m))&&(0A.s.R(Ye)||0>m&&1.570796326794897=A.s.R(Ye)&&1.570796326794897A.s.R(B.u))&&(B.u=-1*A.F.ca(B.u+3.141592653589793))))}}}},ye.sf=function(H,T,b,m,_,C,D,L){if(D!=null||L!=null)if(A.s.vi(T))A.$g.sf(H,b,m,_,C,D,L);else if(C=A.F.ca(C),A.s.$(A.s.R(m),1.570796326794897)||A.s.Dd(C)||A.s.$(A.s.R(C),3.141592653589793))A.Yk.sf(H,T,b,m,_,C,D,L);else{var B=A.s.R(C)==1.570796326794897?0:Math.cos(C),q=A.s.R(C)==3.141592653589793?0:Math.sin(C);A.s.$(A.s.R(m),1.570796326794897)&&(b=0),C=1-Math.sqrt(1-T);var Q=A.F.Xq(T,m);m=A.s.R(Q)==1.570796326794897?0:Math.cos(Q);var oe=Math.sin(Q);Q=Math.atan2(Math.tan(Q),B);var le=m*q,be=le*le,Me=1-be,Ye=T/(1-T)*Me,it=(T=Ye*(256+Ye*(Ye*(74-47*Ye)-128))/1024)/4,Lt=T/6,Ut=_/(H*(1-C)*(1+Ye*(4096+Ye*(Ye*(320-175*Ye)-768))/16384)),Je=Ut;do{var Rt=Je;_=A.s.R(Je)==1.570796326794897?0:Math.cos(Je);var ri=(Ye=A.s.R(Je)==3.141592653589793?0:Math.sin(Je))*Ye;Je=T*Ye*((H=Math.cos(2*Q+Je))+it*(_*(2*(Je=H*H)-1)-Lt*H*(4*ri-3)*(4*Je-3)))+Ut}while(!A.s.$(Rt,Je));_=A.s.R(Je)==1.570796326794897?0:Math.cos(Je),Ye=A.s.R(Je)==3.141592653589793?0:Math.sin(Je),D!=null&&(q=Math.atan2(Ye*q,m*_-oe*Ye*B),Me=C/16*Me*(4+C*(4-3*Me)),H=Math.cos(2*Q+Je),D.u=A.F.ca(b+(q-(1-Me)*C*le*(Je+Me*Ye*(H+Me*_*(2*H*H-1)))))),L!=null&&(Me=oe*Ye-m*_*B,Me=(1-C)*Math.sqrt(be+Me*Me),L.u=Math.atan2(oe*_+m*Ye*B,Me))}},ye}()}(ae||(ae={})),function(A){A.KC=function(){function ye(){}return ye.ub=function(H,T,b,m,_,C,D,L,B){var q=A.F.ca(_-b),Q=A.s.$(A.s.R(m),1.570796326794897),oe=A.s.$(A.s.R(C),1.570796326794897);if(A.s.$(m,C)&&(A.s.Dd(q)||Q))D!=null&&(D.u=0),L!=null&&(L.u=0),B!=null&&(B.u=0);else{if(A.s.vi(T)){var le=Math.sin(m),be=Math.sin(C);le=Math.sqrt((1+le)/(1-le)),be=Math.sqrt((1+be)/(1-be)),le=Math.log(be)-Math.log(le),le=Math.atan2(q,le),D!=null&&(D.u=A.s.$(m,C)?A.s.R(H*Math.cos(m)*q):A.s.R((H*C-H*m)/Math.cos(le)))}else be=A.F.Sw(T,C),le=Math.sin(A.F.Sw(T,m)),be=Math.sin(be),le=Math.sqrt((1+le)/(1-le)),be=Math.sqrt((1+be)/(1-be)),le=Math.log(be)-Math.log(le),le=Math.atan2(q,le),D!=null&&(A.s.$(m,C)?D.u=A.s.R(H*q*Math.cos(m)/A.F.w(T,m)):(q=A.F.q(H,T,m),H=A.F.q(H,T,C),D.u=A.s.R((H-q)/Math.cos(le))));L==null&&B==null||(D=A.F.ca(le+3.141592653589793),Q&&oe||!Q&&!oe||(Q?le=0>m?_:A.F.ca(3.141592653589793-_):oe&&(D=0>C?b:A.F.ca(3.141592653589793-b))),L!=null&&(L.u=le),B!=null&&(B.u=D))}},ye.sf=function(H,T,b,m,_,C,D,L){C=A.F.ca(C),0>_&&(_=A.s.R(_),C=A.F.ca(C+3.141592653589793)),A.s.vi(T)?A.s.$(A.s.R(m),1.570796326794897)?(b=0>m?C:A.F.ca(3.141592653589793-C),3.141592653589793>=(C=_/H%6.283185307179586)?H=m-A.s.Mb(C,m):(b=A.F.ca(b+3.141592653589793),H=-m+A.s.Mb(C-3.141592653589793,m))):A.s.$(A.s.R(C),1.570796326794897)?(b=A.F.ca(b+A.s.Mb(_,C)/(H*Math.cos(m))),H=m):(H=m+_*Math.cos(C)/H,1.570796326794897m?C:A.F.ca(3.141592653589793-C),C=_/A.F.lW(H,T),3.141592653589793>=(C%=6.283185307179586)?H=m-A.s.Mb(C,m):(b=A.F.ca(b+3.141592653589793),H=-m+A.s.Mb(C-3.141592653589793,m)),H=A.F.Tq(T,H)):A.s.$(A.s.R(C),1.570796326794897)?(b=A.F.ca(b+A.s.Mb(_,C)*A.F.w(T,m)/(H*Math.cos(m))),H=m):(H=1.570796326794897*(_*Math.cos(C)+A.F.q(H,T,m))/A.F.Ch(H,T),1.570796326794897Math.PI||Math.abs(m.y)>.5*Math.PI||Math.abs(_.y)>.5*Math.PI||(Math.abs(m.y)==.5*Math.PI||Math.abs(_.y)==.5*Math.PI)&&m.x!=_.x)return NaN;if(C=T.YA(C,Math.min(m.x,_.x),Math.max(m.x,_.x)),!new A.Oc(m.x,_.x).contains(C))return NaN;var D=ye.construct(m);if(_=ye.construct(_),D=T.$u(b,D),_=T.$u(b,_),(_=D.YE(_)).z.rg())return m.y;var L=new A.Xb;L.set(_.x),L.lm(_.z),L.Po(-1);var B=new A.Xb;B.set(_.y),B.lm(_.z),B.Po(-1);var q=new A.Xb;return q.set(B),q.Bg(B),(D=new A.Xb).set(L),D.Bg(L),D.add(q),D.sqrt(),D.rg()||L.rg()&&B.rg()?m.y:(m=Math.atan2(B.value(),L.value()),m=Math.atan2(D.value()*Math.cos(m-C),1-b),C=T.yP(b,A.h.construct(C,m)),b=new A.Od(C.x,C.y,-C.z),C=_.value().Sh(C),b=_.value().Sh(b),Math.abs(b)Math.PI||Math.abs(m.y)>.5*Math.PI||Math.abs(_.y)>.5*Math.PI||(Math.abs(m.y)==.5*Math.PI||Math.abs(_.y)==.5*Math.PI)&&m.x!=_.x||Math.abs(C)>=.5*Math.PI||0C&&_.y>C||0>m.y&&0>_.y&&m.yMath.abs(D[1]-m.x)&&(m=D[0],D[0]=D[1],D[1]=m)),C))},T.YA=function(b,m,_){return b>_?b-=2*(m=Math.ceil((b-_)/(2*Math.PI)))*Math.PI:b_.x?(_.x-=_.x%360,-180>_.x&&(_.x+=360)):180<_.x&&(_.x-=_.x%360,180<_.x&&(_.x-=360)),90<_.y&&(_.y=90),-90>_.y&&(_.y=-90);for(var C=-180,D=180,L=(H=5*b)-1,B=(T=(H+31)/32)-1;0<=B;B--)for(var q=L-32*B,Q=Math.min(32,H-32*B),oe=1;oe=le?(m[B]|=1<=le?(m[B]|=1<>C&31;if(31<(C+=5)){var B=37-C;L&=(1<T)for(D=0;D=T[0]?T:'"'+T.trim()+'"'}var H=[];A.SC=function(){function T(){}return T.zQ=function(b){try{for(var m=0;mb||b>this.Ba)throw A.i.O();return this.dg[b]},T.prototype.Rf=function(b){return this.wh[b]},T.gz=function(b){return T.EM[b]},T.Vp=function(b){return T.NM[b]},T.Wa=function(b){return T.mM[b]},T.prototype.hasAttribute=function(b){return 0<=this.wh[b]},T.prototype.dG=function(){return this.hasAttribute(1)},T.te=function(b){return T.$C[b]},T.prototype.GR=function(b){return this.Xs[b]},T.yG=function(b,m){return T.$C[b]===m},T.prototype.Nb=function(b){return this===b},T.prototype.Cn=function(){for(var b=A.P.Vh(this.dg[0]),m=1;m++L&&H(D,q,C.gu),Q[0]?B?q=L:(Q=D.c,q=D.e+q+1):++q;Q.lengthD.Cd&&Q[0]?"-":"")+(1q?"e":"e+")+q:D.toString()}function H(D,L,B,q){var Q=D.c,oe=D.e+L+1;if(B===1?q=5<=Q[oe]:B===2?q=5oe||Q[oe+1]!==void 0||1&Q[oe-1]):B===3?q=q||Q[oe]!==void 0||0>oe:(q=!1,B!==0&&T("!Big.RM!")),1>oe||!Q[0])q?(D.e=-L,D.c=[1]):D.c=[D.e=0];else{if(Q.length=oe--,q)for(;9<++Q[oe];)Q[oe]=0,oe--||(++D.e,Q.unshift(1));for(oe=Q.length;!Q[--oe];Q.pop());}return D}function T(D){throw(D=Error(D)).name="BigError",D}var b=-7,m=21,_=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,C=function(){function D(L){if(L instanceof D)this.Cd=L.Cd,this.e=L.e,this.c=L.c.slice();else{var B,q,Q;for(L===0&&0>1/L?L="-0":_.test(L+="")||T(NaN),this.Cd=L.charAt(0)=="-"?(L=L.slice(1),-1):1,-1<(B=L.indexOf("."))&&(L=L.replace(".","")),0<(q=L.search(/e/i))?(0>B&&(B=q),B+=+L.slice(q+1),L=L.substring(0,q)):0>B&&(B=L.length),q=0;L.charAt(q)=="0";q++);if(q==(Q=L.length))this.c=[this.e=0];else{for(;L.charAt(--Q)=="0";);for(this.e=B-q-1,this.c=[],B=0;q<=Q;this.c[B++]=+L.charAt(q++));}}}return D.prototype.abs=function(){var L=new D(this);return L.Cd=1,L},D.prototype.cmp=function(L){var B=this.c,q=(L=new D(L)).c,Q=this.Cd,oe=L.Cd,le=this.e,be=L.e;if(!B[0]||!q[0])return B[0]?Q:q[0]?-oe:0;if(Q!=oe)return Q;if(L=0>Q,le!=be)return le>(be^L)?1:-1;for(Q=-1,oe=(le=B.length)<(be=q.length)?le:be;++Q(q[Q]^L)?1:-1;return le==be?0:le>(be^L)?1:-1},D.prototype.lm=function(L){var B=this.c,q=(L=new D(L)).c,Q=this.Cd==L.Cd?1:-1,oe=D.tr;if((oe!==~~oe||0>oe||1e6ti?0:ti,Me.unshift(0);Ut++be;be++){if(le!=(Ut=Lt.length))var Zt=le>Ut?1:-1;else{var ii=-1;for(Zt=0;++iiLt[ii]?1:-1;break}}if(!(0>Zt))break;for(L=Ut==le?q:Me;Ut;){if(Lt[--Ut]ti&&H(Je,oe,D.gu,Lt[0]!==void 0),Je},D.prototype.aS=function(){return 0this.cmp(0)},D.prototype.kt=function(L){var B,q=this.Cd,Q=(L=new D(L)).Cd;if(q!=Q)return L.Cd=-Q,this.oI(L);var oe=this.c.slice(),le=this.e,be=L.c,Me=L.e;if(!oe[0]||!be[0])return be[0]?(L.Cd=-Q,L):new D(oe[0]?this:0);if(q=le-Me){for((B=0>q)?(q=-q,le=oe):(Me=le,le=be),le.reverse(),Q=q;Q--;le.push(0));le.reverse()}else for(le=((B=oe.lengthq;){if(oe[--le]Q.length-le.length&&(q=le,le=Q,Q=q),B=le.length,q=0;B;)q=(Q[--B]=Q[B]+le[B]+q)/10|0,Q[B]%=10;for(q&&(Q.unshift(q),++oe),B=Q.length;Q[--B]==0;Q.pop());return L.c=Q,L.e=oe,L},D.prototype.pow=function(L){var B=this,q=new D(1),Q=q,oe=0>L;for((L!==~~L||-1e6>L||1e6>=1;)B=B.nr(B);return oe?q.lm(Q):Q},D.prototype.round=function(L,B){var q=this;return L==null?L=0:(L!==~~L||0>L||1e6B&&T(NaN),(B=Math.sqrt(this.toString()))==0||B==1/0?((B=L.join("")).length+q&1||(B+="0"),(L=new D(Math.sqrt(B).toString())).e=((q+1)/2|0)-(0>q||1&q)):L=new D(B.toString()),B=L.e+(D.tr+=4);do q=L,L=Q.nr(q.oI(this.lm(q)));while(q.c.slice(0,B).join("")!==L.c.slice(0,B).join(""));return H(L,D.tr-=4,D.gu),L},D.prototype.nr=function(L){var B=this.c,q=(L=new D(L)).c,Q=B.length,oe=q.length,le=this.e,be=L.e;if(L.Cd=this.Cd==L.Cd?1:-1,!B[0]||!q[0])return new D(0*L.Cd);if(L.e=le+be,Qle;)oe=Me[be]+q[le]*B[be-le-1]+oe,Me[be--]=oe%10,oe=oe/10|0;Me[be]=(Me[be]+oe)%10}for(oe&&++L.e,Me[0]||Me.shift(),le=Me.length;!Me[--le];Me.pop());return L.c=Me,L},D.prototype.toString=function(){var L=this.e,B=this.c.join(""),q=B.length;if(L<=b||L>=m)B=B.charAt(0)+(1L?"e":"e+")+L;else if(0>L){for(;++L;B="0"+B);B="0."+B}else if(0q)for(L-=q;L--;B+="0");else Lthis.Cd&&this.c[0]?"-"+B:B},D.prototype.toExponential=function(L){return L==null?L=this.c.length-1:(L!==~~L||0>L||1e6=L&&(Q=ye(this,this.e+L),0>this.Cd&&this.c[0]&&0>Q.indexOf("-")&&(Q="-"+Q));return b=B,m=q,Q||T("!toFix!"),Q},D.prototype.toPrecision=function(L){return L==null?this.toString():((L!==~~L||1>L||1e6C.get(le)?(C.set(B,2147483647),B=le):C.set(le,2147483647),q++;else{if(!(1&q))C.set(B,2147483647);else if(b)return m!=null&&(m[0]=!0),null;L.N(oe),B=le,q=1}if(!(1&q))C.set(B,2147483647);else if(b)return m!=null&&(m[0]=!0),null;if(!b)for(C.Wd(0,C.size,function(Me,Ye){return Me-Ye}),le=0,be=C.size;lem-b)_.qr(b,m,T);else{var C=!0;try{for(var D=1/0,L=-1/0,B=b;BL&&(L=q)}if(this.reset(m-b,D,L,m-b)){for(B=b;BC&&_.qr(b+C,b+m,T);100T||m==b)&&(T=Math.min(H.cL,T),this.zf.Jb(T),this.zf.resize(T),this.zf.Yj(0,0,this.zf.size),this.zH=b,this.As.resize(_),this.Gs=(m-b)/(T-1),!0)},H.prototype.uF=function(T){return A.P.truncate((T-this.zH)/this.Gs)},H.cL=65536,H}();A.Zt=ye}(ae||(ae={})),function(A){var ye,H;(H=ye||(ye={}))[H.enum_line=1]="enum_line",H[H.enum_arc=2]="enum_arc",H[H.enum_dummy=4]="enum_dummy",H[H.enum_concave_dip=8]="enum_concave_dip",H[H.enum_connection=3]="enum_connection";var T=function(){function D(){}return D.Su=function(L,B,q,Q,oe,le){var be=new D;return be.Km=new A.h,be.Xm=new A.h,be.cw=new A.h,be.Km.N(L),be.Xm.N(B),be.cw.N(q),be.Eo=Q,be.sh=oe,be.uh=le,be},D.construct=function(L,B,q,Q){var oe=new D;return oe.Km=new A.h,oe.Xm=new A.h,oe.cw=new A.h,oe.Km.N(L),oe.Xm.N(B),oe.cw.Sc(),oe.Eo=4,oe.sh=q,oe.uh=Q,oe},D}(),b=function(){function D(L,B,q,Q,oe,le){this.$v=null,this.za=0,this.zA=L,this.XH=this.VH=0,this.La=B,this.Oj=q,this.xk=Q,this.Fq=oe,this.Vb=le}return D.prototype.next=function(){for(var L=new A.Ta;;){if(this.za==this.zA.I())return null;if(this.zA.we(this.za,L),this.za++,!L.B())break}var B=!1;if(this.$v==null&&(this.VH=L.Ng(),this.XH=L.kh(),this.$v=C.buffer(L,this.La,this.Oj,this.xk,this.Fq,this.Vb),B=!0),this.zaQ)throw A.i.O();if(L.B())return new A.Ea(L.description);var be=new A.l;return L.yc(be),0=oe&&(oe=96),le.sb=Math.abs(le.La),le.Mv=le.sb!=0?1/le.sb:0,isNaN(Q)||Q==0?Q=1e-5*le.sb:Q>.5*le.sb&&(Q=.5*le.sb),12>oe&&(oe=12),(L=Math.abs(B)*(1-Math.cos(Math.PI/oe)))>Q?Q=L:(L=Math.PI/Math.acos(1-Q/Math.abs(B)))(oe=A.P.truncate(L))&&(oe=12,Q=Math.abs(B)*(1-Math.cos(Math.PI/oe))),le.xk=Q,le.Fq=oe,le.oA=Math.min(le.dt,.25*Q),le.gE()},D.prototype.ev=function(){if(this.Jd==null)this.Jd=[];else if(this.Jd.length!==0)return;var L=this.lE();L=A.P.truncate((L+3)/4);var B=.5*Math.PI/L;this.jA=B;for(var q=0;q<4*L;q++)this.Jd.push(null);var Q=Math.cos(B);B=Math.sin(B);var oe=A.h.construct(0,1);for(q=0;q=this.La&&(L=new A.l,this.Y.A(L),L.S()<=2*-this.La||L.da()<=2*this.La))return new A.Ea(this.Y.description)}switch(this.Y.K()){case 33:return this.KN();case 550:return this.JN();case 1607:return this.MN();case 1736:return this.LN();case 197:return this.GN();default:throw A.i.Ra()}},D.prototype.MN=function(){if(this.zG(this.Y)){var L=new A.Ta;this.Y.we(0,L);var B=new A.l;return this.Y.A(B),L.Db(B.tf()),this.Iu(L)}return this.Y=this.RV(this.Y),L=new m(this,this.qq),A.Ih.local().W(L,this.Oj,this.Vb).next()},D.prototype.LN=function(){if(this.La==0)return this.Y;var L=A.$l.local();if(this.ev(),this.Y=L.W(this.Y,null,!1,this.Vb),0>this.La){var B=this.Y;return B=this.ly(B,0,B.ea()),L.W(B,this.Oj,!1,this.Vb)}return this.zG(this.Y)?(L=new A.Ta,this.Y.we(0,L),B=new A.l,this.Y.A(B),L.Db(B.tf()),this.Iu(L)):(L=new _(this),A.Ih.local().W(L,this.Oj,this.Vb).next())},D.prototype.ly=function(L,B,q){for(var Q=new A.Ea(L.description);BL.Ka(B))){var oe=L.Kr(B),le=new A.l;if(L.Tj(B,le),0=this.La){if(this.La==0)L.bd(this.Y,!1);else{var B=new A.Hh;this.Y.dn(B),B.X(this.La,this.La),L.bd(B,!1)}return L}return L.bd(this.Y,!1),this.Y=L,this.eE(L,0)},D.prototype.eE=function(L,B){this.ev();var q=new A.Ea(L.description),Q=new A.h,oe=new A.h,le=new A.h,be=new A.h,Me=new A.h,Ye=new A.h,it=new A.h,Lt=new A.h,Ut=L.Ka(B),Je=L.Ca(B),Rt=0;for(B=L.Ka(B);RtL.Ka(B))return null;if(this.AG(L,B)&&0(L=-1>L?4:2*Math.PI/Math.acos(L)+.5)?L=4:L>this.Fq&&(L=this.Fq),A.P.truncate(L)},D.prototype.BD=function(L,B,q,Q,oe){this.ev();var le=new A.h;le.vc(q,B),le.scale(this.Mv);var be=new A.h;be.vc(Q,B),be.scale(this.Mv),0>(le=Math.atan2(le.y,le.x)/this.jA)&&(le=this.Jd.length+le),le=this.Jd.length-le,0>(be=Math.atan2(be.y,be.x)/this.jA)&&(be=this.Jd.length+be),(be=this.Jd.length-be)le.I(be))return 0>oe||(oe=L,le=new A.Ta,oe.we(oe.Ca(B),le),this.Au(q,le)),1;var Me=le.Oa(le.Ya(le.Ob(be))),Ye=new A.Ed;if(Ye.ig(-Me.x,-Me.y),le.Pc(Ye),Q&&(this.oQ(le,be,oe),2>le.I(be)))return 0>oe||(oe=L,le=new A.Ta,oe.we(oe.Ca(B),le),this.Au(q,le)),1;this.$d.length=0;var it=le.Ob(be);B=le.Ya(it);var Lt=oe==1?le.Na(B):le.V(B);L=oe==1?le.V(B):le.Na(B);var Ut=!0;Q=new A.h,be=new A.h;var Je=new A.h,Rt=new A.h,ri=new A.h,ti=new A.h,Zt=new A.h,ii=new A.h,Ci=new A.h,ki=new A.h,Ni=this.sb;it=le.Ka(it);for(var tr=0;trLt||0>Ut&&Lt==0?this.$d.push(T.Su(Rt,ri,Q,2,this.$d.length+1,this.$d.length-1)):Rt.rb(ri)||(this.$d.push(T.construct(Rt,Q,this.$d.length+1,this.$d.length-1,"dummy")),this.$d.push(T.construct(Q,ri,this.$d.length+1,this.$d.length-1,"dummy"))),ti.add(be,Ci),this.$d.push(T.Su(ri,ti,Q,1,this.$d.length+1,this.$d.length-1)),Rt.N(ti),ki.N(Ci),Je.N(Q),Q.N(be),ii.N(Zt),Lt=B,B=L,Ut=!1,L=oe==1?le.V(B):le.Na(B);return this.$d[this.$d.length-1].sh=0,this.$d[0].uh=this.$d.length-1,this.TV(q),Ye.ig(Me.x,Me.y),q.TD(Ye,q.ea()-1),1},D.prototype.TV=function(L){for(var B=this.uO(),q=!0,Q=B+1,oe=B;Q!=B;oe=Q){var le=this.$d[oe];Q=le.sh!=-1?le.sh:(oe+1)%this.$d.length,le.Eo!=0&&(q&&L.Nt(le.Km),le.Eo==2?this.BD(L,le.cw,le.Km,le.Xm,!0):L.Ei(le.Xm),q=!1)}},D.prototype.uO=function(){this.Ms==null&&(this.Ms=[null,null,null,null,null,null,null,null,null]);for(var L=0,B=0,q=this.$d.length;B=this.sb)return!0}return!1},D.prototype.oQ=function(L,B,q){for(var Q=0;1>Q;Q++){var oe=!1,le=L.Ob(B),be=L.Ka(le);if(be==0)break;var Me=be;if(3>be)break;!L.ec(le)&&(Me=be-1),le=L.Ya(le),be=0bn||0>qr&&bn==0||!this.Hv(Rt,Ut,Je)||(Zt.N(Je),eo=!1,++cr,oe=!0),eo){if(0.5*this.xk?(ti.add(Rt,Ut),ti.scale(.5),ki.normalize(),ki.cr(),Ni.N(ki),Ni.scale(tr-cr),ti.add(Ni),L.mf(be,ti)):L.qd(be,!0),cr=0}Rt.N(Ut),it=le}Ut.N(Je),be=le,le=Ye,Ye=0B?(this.qq=!1,L):(this.qq=!0,A.Hg.Ok(L,this.dt,!1,!0,this.Vb))},D.prototype.Au=function(L,B){if(B=B.D(),this.Jd!=null&&this.Jd.length!==0){var q=new A.h;q.N(this.Jd[0]),q.Dt(this.sb,B),L.Nt(q);for(var Q=1,oe=this.Jd.length;Q=m?1:-1;case 1:if(T.G=m?1:-1;case 2:if(T.v>=m&&T.C>m)break;return T.C<=m?1:-1;case 3:if(!(T.G>=m&&T.H>m))return T.H<=m?1:-1}return 0},H.prototype.vy=function(T,b){return T.K()==1736?this.xy(T,b):this.yy(T)},H.prototype.xy=function(T,b){if(this.Da.S()==0||this.Da.da()==0)return T.Ja();var m=new A.l;T.yc(m),this.Y=this.g.Ib(T);var _=new A.l,C=new A.l,D=new A.h,L=new A.h,B=[0,0,0,0,0,0,0,0,0],q=[0,0,0,0,0,0,0,0,0];new A.jg;var Q=new A.zb,oe=new A.ja(0);oe.Jb(Math.min(100,T.I()));for(var le=!1,be=0;!le&&4>be;be++){var Me=!1,Ye=(1&be)!=0,it=0;switch(be){case 0:it=this.Da.v,Me=m.v<=it&&m.C>=it;break;case 1:it=this.Da.G,Me=m.G<=it&&m.H>=it;break;case 2:it=this.Da.C,Me=m.v<=it&&m.C>=it;break;case 3:it=this.Da.H,Me=m.G<=it&&m.H>=it}if(Me)for(le=!0,Me=this.g.Ob(this.Y);Me!=-1;){var Lt=-1,Ut=-1,Je=this.g.Ya(Me),Rt=Je;do{var ri=this.g.cc(Rt);ri==null&&(ri=Q,this.g.D(Rt,D),ri.Ec(D),this.g.D(this.g.V(Rt),L),ri.Rc(L)),ri.A(_);var ti=this.Nh(_,be,it),Zt=0,ii=-1;if(ti==-1){Zt=0<(ri=ri.fq(Ye,it,B,q))?this.g.Wl(Rt,q,ri):0,Zt+=1;var Ci=Rt,ki=this.g.V(Ci);for(ri=0;rithis.g.Ka(Me)?this.g.ar(Me):this.g.Sb(Me)}}return le?T.Ja():(this.AB(),0q;q++){var Q=!1,oe=(1&q)!=0,le=0;switch(q){case 0:le=this.Da.v,Q=B.v<=le&&B.C>=le;break;case 1:le=this.Da.G,Q=B.G<=le&&B.H>=le;break;case 2:le=this.Da.C,Q=B.v<=le&&B.C>=le;break;case 3:le=this.Da.H,Q=B.G<=le&&B.H>=le}if(Q){Q=L,L=T.Ja(),(Q=Q.Ha()).aj();for(var be,Me=new A.h;Q.ab();)for(var Ye,it=!0;Q.Ia();){var Lt=Q.ia();Lt.A(b);var Ut=this.Nh(b,q,le);if(Ut==-1){if(0<(Ut=Lt.fq(oe,le,_,C))){var Je=0;be=Lt.bc();for(var Rt=0;Rt<=Ut;Rt++)if(Je!=(Ye=Rt=(q=A.P.truncate(Math.min(Math.ceil(q/T),2048)))))){for(var Q=1;QC.size)){var oe=this;C.Wd(0,C.size,function(ti,Zt){return oe.Oh(ti,Zt)}),m=new A.h,D=new A.h,L=new A.h,D.Sc();var le=-1;B=new A.ja(0),q=new A.ja(0),Q=this.g.Hd();for(var be=this.g.Hd(),Me=0,Ye=C.size;Methis.Oh(le,Ut)&&(this.g.D(Ut,m),T?m.y==b:m.x==b)&&(B.add(le),Je=!0,this.g.Sa(le,be,1)),0>this.Oh(le,it)&&(this.g.D(it,m),T?m.y==b:m.x==b)&&(Je||B.add(le),this.g.Sa(le,Q,1))}for(Lt=0,Je=B.size;Ltthis.Oh(Ye,Lt)&&(this.g.D(Lt,B),T?B.y==b:B.x==b)&&(it=Lt),Lt=-1;var Ut=this.g.Na(Ye);if(0>this.Oh(Ye,Ut)&&(this.g.D(Ut,B),T?B.y==b:B.x==b)&&(Lt=Ut),it!=-1&&Lt!=-1)this.Mh(Ye,_,C),this.g.qd(Ye,!1),this.Mh(it,_,C),this.g.qd(it,!1),oe=!0;else if(it!=-1||Lt!=-1){for(Ut=Me+1;Utthis.Oh(Je,Rt)&&(this.g.D(Rt,B),T?B.y==b:B.x==b)&&(ri=Rt),Rt=this.g.Na(Je);var ti=-1;if(0>this.Oh(Je,Rt)&&(this.g.D(Rt,B),T?B.y==b:B.x==b)&&(ti=Rt),ri!=-1&&ti!=-1){this.Mh(Je,_,C),this.g.qd(Je,!1),this.Mh(ri,_,C),this.g.qd(ri,!1),oe=!0;break}if(it!=-1&&ti!=-1){this.At(_,Ye,it,Je,ti,C),oe=!0;break}if(Lt!=-1&&ri!=-1){this.At(_,Je,ri,Ye,Lt,C),oe=!0;break}}}if(oe)break}}}if(!oe)break}le=D,q.N(m)}}this.g.Ud(C)},H.prototype.Mh=function(T,b,m){m=this.g.Qa(T,m),b.set(m,-1),m=this.g.Qa(T,this.li),this.ed.set(m,-1),(b=this.g.cd(T))!=-1&&this.g.Ya(b)==T&&(this.g.Kf(b,-1),this.g.Yg(b,-1))},H.prototype.At=function(T,b,m,_,C,D){this.g.Cc(b,_),this.g.Dc(_,b),this.g.Dc(m,C),this.g.Cc(C,m),this.Mh(_,T,D),this.g.oi(_,!1),this.Mh(C,T,D),this.g.oi(C,!0)},H.prototype.Oy=function(){for(var T=0,b=this.ed.size;T=B?(m=this.g.Qa(L,this.li),this.ed.set(m,-1),L=this.g.qd(L,!1),B==2&&(m=this.g.Qa(L,this.li),this.ed.set(m,-1),this.g.qd(L,!1)),B=D,D=this.g.Sb(D),this.g.Kf(B,-1),this.g.br(B)):(this.g.fp(D,!1),this.g.Yg(D,this.g.Na(L)),this.g.Xj(D,B),C+=B,_++,D=this.g.Sb(D))}}for(T=0,b=this.ed.size;T=B?(m=this.g.Qa(L,this.li),this.ed.set(m,-1),L=this.g.qd(L,!1),B==2&&(0<=(m=this.g.Qa(L,this.li))&&this.ed.set(m,-1),this.g.qd(L,!1)),B=D,this.g.Kf(B,-1),this.g.br(B)):(this.g.mn(D,!0),this.g.Xj(D,B),this.g.Kf(D,L),this.g.Yg(D,this.g.Na(L)),this.g.fp(D,!1),C+=B,_++)}for(this.g.Tl(this.Y,_),this.g.Vj(this.Y,C),T=0,b=this.g.md;b!=-1;b=this.g.ve(b))T+=this.g.I(b);this.g.XB(T)},H.wy=function(T,b,m){return new H(b).vy(T,m)},H.clip=function(T,b,m,_){if(T.B())return T;if(b.B())return T.Ja();if((m=T.K())==33)return _=T.D(),b.contains(_)?T:T.Ja();if(m==197)return _=new A.l,T.A(_),_.Fa(b)?(b=new A.Hh,T.copyTo(b),b.Zo(_),b):T.Ja();var C=new A.l;if(T.yc(C),b.contains(C))return T;if(!b.isIntersecting(C))return T.Ja();if((C=T.Cb)!=null&&(C=C.Hk)!=null){if((C=C.To(b))==1){if(m!=1736)throw A.i.Ra();return(T=new A.Ea(T.description)).vp(b),T}if(C==0)return T.Ja()}switch(m){case 550:m=null,C=T.I();for(var D=T.vb(0),L=0,B=0;B=m?1:-1;case 1:if(T.G=m?1:-1;case 2:if(T.v>=m&&T.C>m)break;return T.C<=m?1:-1;case 3:if(!(T.G>=m&&T.H>m))return T.H<=m?1:-1}return 0},H.prototype.vy=function(T,b){return T.K()==1736?this.xy(T,b):this.yy(T)},H.prototype.xy=function(T,b){if(this.Da.S()==0||this.Da.da()==0)return T.Ja();var m=new A.l;T.yc(m),this.Y=this.g.Ib(T);var _=new A.l,C=new A.l,D=new A.h,L=new A.h,B=[0,0,0,0,0,0,0,0,0],q=[0,0,0,0,0,0,0,0,0],Q=new A.zb,oe=new A.ja(0);oe.Jb(256);for(var le=!1,be=0;!le&&4>be;be++){var Me=!1,Ye=(1&be)!=0,it=0;switch(be){case 0:it=this.Da.v,Me=m.v<=it&&m.C>=it;break;case 1:it=this.Da.G,Me=m.G<=it&&m.H>=it;break;case 2:it=this.Da.C,Me=m.v<=it&&m.C>=it;break;case 3:it=this.Da.H,Me=m.G<=it&&m.H>=it}if(Me)for(le=!0,Me=this.g.Ob(this.Y);Me!=-1;){var Lt=!0,Ut=-1,Je=-1,Rt=this.g.Ya(Me),ri=Rt;do{var ti=this.g.cc(ri);ti==null&&(ti=Q,this.g.D(ri,D),ti.Ec(D),this.g.D(this.g.V(ri),L),ti.Rc(L)),ti.A(_);var Zt=this.Nh(_,be,it),ii=0,Ci=-1;if(Zt==-1){ii=0<(ti=ti.fq(Ye,it,B,q))?this.g.HX(ri,q,ti):0,ii+=1;var ki=ri,Ni=this.g.V(ki);for(ti=0;tibe;be++){var Me=!1,Ye=(1&be)!=0,it=0;switch(be){case 0:it=this.Da.v,Me=B.v<=it&&B.C>=it;break;case 1:it=this.Da.G,Me=B.G<=it&&B.H>=it;break;case 2:it=this.Da.C,Me=B.v<=it&&B.C>=it;break;case 3:it=this.Da.H,Me=B.G<=it&&B.H>=it}if(Me)for(Me=L,L=T.Ja(),(Me=Me.Ha()).aj();Me.ab();)for(var Lt,Ut=!0;Me.Ia();){var Je=Me.ia();Je.A(b);var Rt=this.Nh(b,be,it);if(Rt==-1){if(0<(Rt=Je.fq(Ye,it,_,C))){var ri=0;Je.$p(q);for(var ti=0;ti<=Rt;ti++)if(ri!=(Lt=ti_.x&&(_.x+=T)}else le=b.y-this.Da.G,C.y=A.mc.sign(m.y-b.y),_.y=T*A.mc.En(Math.floor(Math.abs(le/T)),le)+this.Da.G,0>_.y&&(_.y+=T);le=oe!=0?m.y-b.y:m.x-b.x;var be=Math.abs(le);if(65536=Ye||(D[be]=Ye,be++)}be!=0&&this.g.Wl(q,D,be)}}q=Q}while(q!=B)}},H.prototype.Xl=function(T,b){for(var m=-1,_=new A.h,C=null,D=this.g.Ob(this.Y);D!=-1;D=this.g.Sb(D))for(var L=this.g.Ya(D),B=0,q=this.g.Ka(D);BC.size)){var oe=this;C.Wd(0,C.size,function(ti,Zt){return oe.Oh(ti,Zt)}),m=new A.h,D=new A.h,L=new A.h,D.Sc();var le=-1;B=new A.ja(0),q=new A.ja(0),Q=null;for(var be=this.g.Hd(),Me=this.g.Hd(),Ye=0,it=C.size;YeD.compare(m)&&(T?m.y==b:m.x==b)&&(B.add(le),Rt=!0,this.g.Sa(le,Me,1)),this.g.D(Lt,m),0>D.compare(m)&&(T?m.y==b:m.x==b)&&(Rt||B.add(le),this.g.Sa(le,be,1))}for(Ut=0,Rt=B.size;Utq.compare(B)&&(T?B.y==b:B.x==b)&&(it=Lt),Lt=-1;var Ut=this.g.Na(Ye);if(this.g.D(Ut,B),0>q.compare(B)&&(T?B.y==b:B.x==b)&&(Lt=Ut),it!=-1&&Lt!=-1)this.Mh(Ye,_,C),this.g.qd(Ye,!1),this.Mh(it,_,C),this.g.qd(it,!1),oe=!0;else if(it!=-1||Lt!=-1){for(Ut=Me+1;Utq.compare(B)&&(T?B.y==b:B.x==b)&&(ri=Rt),Rt=this.g.Na(Je);var ti=-1;if(this.g.D(Rt,B),0>q.compare(B)&&(T?B.y==b:B.x==b)&&(ti=Rt),ri!=-1&&ti!=-1){this.Mh(Je,_,C),this.g.qd(Je,!1),this.Mh(ri,_,C),this.g.qd(ri,!1),oe=!0;break}if(it!=-1&&ti!=-1){this.At(_,Ye,it,Je,ti,C),oe=!0;break}if(Lt!=-1&&ri!=-1){this.At(_,Je,ri,Ye,Lt,C),oe=!0;break}}}if(oe)break}}}if(!oe)break}le=D,q.N(m)}this.g.Ud(C)}},H.prototype.Mh=function(T,b,m){m=this.g.Qa(T,m),b.set(m,-1),m=this.g.Qa(T,this.li),this.ed.set(m,-1),(b=this.g.cd(T))!=-1&&this.g.Ya(b)==T&&(this.g.Kf(b,-1),this.g.Yg(b,-1))},H.prototype.At=function(T,b,m,_,C,D){this.g.Cc(b,_),this.g.Dc(_,b),this.g.Dc(m,C),this.g.Cc(C,m),this.Mh(_,T,D),this.g.oi(_,!1),this.Mh(C,T,D),this.g.oi(C,!0)},H.prototype.Oy=function(){for(var T=0,b=this.ed.size;T=B?(m=this.g.Qa(L,this.li),this.ed.set(m,-1),L=this.g.qd(L,!1),B==2&&(0<=(m=this.g.Qa(L,this.li))&&this.ed.set(m,-1),this.g.qd(L,!1)),B=D,this.g.Kf(B,-1),this.g.br(B)):(this.g.mn(D,!0),this.g.Xj(D,B),this.g.Kf(D,L),this.g.Yg(D,this.g.Na(L)),this.g.fp(D,!1),C+=B,_++)}for(this.g.Tl(this.Y,_),this.g.Vj(this.Y,C),T=0,b=this.g.md;b!=-1;b=this.g.ve(b))T+=this.g.I(b);this.g.XB(T)},H.wy=function(T,b,m,_){return new H(b,_).vy(T,m)},H.clip=function(T,b,m,_,C){return H.Pu(T,b,null,m,_,C)},H.Pu=function(T,b,m,_,C,D){var L=T.K();if(L==33)return C=T.D(),b.contains(C)?T:T.Ja();if(L==197)return C=new A.l,T.A(C),C.Fa(b)?(b=new A.Hh,T.copyTo(b),b.Zo(C),b):T.Ja();if(T.B())return T;if(b.B())return T.Ja();var B=new A.l;if(T.yc(B),b.contains(B))return T;if(!b.isIntersecting(B))return T.Ja();if((m!=null||isNaN(_))&&A.ua.oy(m,b,!1),!A.ba.zj(L))throw A.i.O();if((m=T.Cb)!=null&&(m=m.Hk)!=null){if((m=m.To(b))==1){if(L!=1736)throw A.i.ga("internal error");return(T=new A.Ea(T.description)).vp(b),T}if(m==0)return T.Ja()}switch(L){case 550:for(D=null,L=T.I(),m=T.vb(0),_=0,C=new A.h,B=0;B=B;B+=1)for(var q=0;1>=q;q+=1){var Q=b.eG(D+B,L+q),oe=this.zl.lR(Q);oe!=-1&&(this.rq[C]=oe,this.zs[C]=Q,C++)}for(D=C-1;1<=D;D--)for(oe=this.rq[D],L=D-1;0<=L;L--)if(oe==this.rq[L]){this.zs[L]=-1,D!=--C&&(this.zs[D]=this.zs[C],this.rq[D]=this.rq[C]);break}for(L=0;LL.Eb())throw A.i.O();return B==0||L.B()?L:((le=new D(le)).mo=L,le.La=B,le.ra=oe,le.Mi=q,le.xA=Q,le.Qx())},D.prototype.$L=function(){var L=this.mo,B=L.bc(),q=L.xc(),Q=new A.h;return Q.vc(q,B),Q.normalize(),Q.Jv(),Q.scale(this.La),B.add(Q),q.add(Q),Q=L.Ja(),L.Ec(B),L.Rc(q),Q},D.prototype.ZL=function(){var L=this.mo;if(0le&&(0this.La?-H:H,-1Ye&&(.017453292519943295>(it=2*Math.acos(Ye))&&(it=.017453292519943295),1<(be=A.P.truncate(H/it+1.5))&&(Me/=be)),it=Je+b,Je=m.Qd(le,this.La,it),L==0&&(Je.type|=1024),this.hc(Je,L),Ye=this.La/Math.cos(Me/2),it+=Me/2,(Je=m.Qd(le,Ye,it)).type|=1024,this.hc(Je);0<--be;)it+=Me,(Je=m.Qd(le,Ye,it)).type|=1024,this.hc(Je);(Je=m.Qd(le,this.La,Rt-b)).type|=1024,this.hc(Je)}else if(this.Mi==1)Je=m.Qd(le,this.La,Je+b),this.hc(Je,L),Je=m.Qd(le,this.La,Rt-b),this.hc(Je);else if(this.Mi==0)for(Ye=1-q/Math.abs(this.La),be=1,Me=Rt-b-(Je+b),-1Ye&&(.017453292519943295>(it=2*Math.acos(Ye))&&(it=.017453292519943295),1<(be=A.P.truncate(Math.abs(Me)/it+1.5))&&(Me/=be)),Ye=this.La/Math.cos(.5*Me),it=Je+b+.5*Me,Je=m.Qd(le,Ye,it),this.hc(Je,L);0<--be;)it+=Me,Je=m.Qd(le,Ye,it),this.hc(Je);else this.Mi==2?(Ye=be.x-le.x,it=be.y-le.y,.99999999<(be=(Ye*(Lt=Me.x-le.x)+it*(Ut=Me.y-le.y))/Math.sqrt(Ye*Ye+it*it)/Math.sqrt(Lt*Lt+Ut*Ut))?(Je=m.Qd(le,1.4142135623730951*this.La,Rt-.25*H),this.hc(Je,L),Je=m.Qd(le,1.4142135623730951*this.La,Rt+.25*H),this.hc(Je)):(be=Math.abs(this.La/Math.sin(.5*Math.acos(be))))>(Me=Math.abs(this.xA*this.La))?(Ye=.5*(Rt-Je),Ye=this.La/Math.abs(Math.sin(Ye)),Je=m.Qd(le,Ye,.5*(Je+Rt)),Rt=A.h.construct(Je.x,Je.y),Je=A.h.construct(le.x,le.y),(le=new A.h).vc(Rt,Je),(Rt=new A.h).BW(Me/le.length(),le,Je),Je=(be-Me)*Math.abs(this.La)/Math.sqrt(be*be-this.La*this.La),0Je&&(Rt-=T),be=Je-Rt(Ye=1.4142135623730951*this.La)?Je+.25*H:Je+.75*H,Je=m.Qd(le,Ye,it),this.hc(Je,L),it=0>Ye?Rt-.25*H:Rt-.75*H,Je=m.Qd(le,Ye,it),this.hc(Je)):(Ye=.5*(Rt-Je),Ye=this.La/Math.abs(Math.sin(Ye)),RtB))for(var q=0;q=Q+1;B--)(q=m.cl(L.Oa(B))).type|=1024,this.xg.push(q);if(this.hE())if(2<=this.Zb.length){for(L=-1,(oe=(1024&this.Zb[this.gf-1].type)!=0)||(L=0),B=1;B=Math.min(q.x,Q.x)&&Math.max(q.x,Q.x)>=Math.min(L.x,B.x)&&Math.max(L.y,B.y)>=Math.min(q.y,Q.y)&&Math.max(q.y,Q.y)>=Math.min(L.y,B.y)},D.prototype.sQ=function(L,B,q,Q,oe){oe.XD=!1;var le=(B.y-L.y)*(Q.x-q.x)-(B.x-L.x)*(Q.y-q.y),be=(q.y-L.y)*(B.x-L.x)-(q.x-L.x)*(B.y-L.y);if(0<=(le=le==0?2:be/le)&&1>=le){var Me=le;if(le=(Q.y-q.y)*(B.x-L.x)-(Q.x-q.x)*(B.y-L.y),be=(L.y-q.y)*(Q.x-q.x)-(L.x-q.x)*(Q.y-q.y),0<=(le=le==0?2:be/le)&&1>=le)return oe.cn=m.OO(L.x+le*(B.x-L.x),L.y+le*(B.y-L.y)),oe.cn.Wh=q.Wh+Me*(Q.Wh-q.Wh),Me!=0&&Me!=1||le!=0&&le!=1||(oe.XD=!0),oe.RY=le,oe.SY=Me,!((Me==0||Me==1)&&0le||(le==0||le==1)&&0Me)}return!1},D.prototype.LO=function(L){for(;this.Zb[L].uhL-(D*=2))return!0;C=new A.h;var B=new A.h,q=new A.h;_.uc(D,C),_.uc(D+2,B),_.uc(D+4,q);var Q=m.Yu(B,q,C);if(Q.rs()||!m.wm(Q.value()))return!1;var oe=A.h.construct(B.x,B.y),le=new A.h;for(D+=6;DL;L++){_.hB(L,D);var B=this.Er(D);if(B!=-1){_.If(L,C);var q=this.g.hc(this.Us,C);this.Ga.Uj(B,q)}}},m.prototype.jN=function(_){var C=new A.Ta,D=_.bc();if((D=this.Er(D))!=-1){_.Vo(C);var L=this.g.hc(this.Us,C);this.Ga.Uj(D,L)}D=_.xc(),(D=this.Er(D))!=-1&&(_.Ro(C),_=this.g.hc(this.Us,C),this.Ga.Uj(D,_))},m.prototype.iN=function(_){var C=_.D();(C=this.Er(C))!=-1&&(_=this.g.hc(this.Us,_),this.Ga.Uj(C,_))},m.prototype.Er=function(_){var C=-1;if(this.Ga.size(-1)==0)return this.Ga.addElement(-4,-1);if(this.Ga.size(-1)==1){var D=this.g.Oa(this.Ga.ka(this.Ga.sc(-1)));return _.Mz(D)||(C=this.Ga.zn(-5)),C}return this.kC(_)},m.prototype.kC=function(_){var C=-1;do{var D=this.Ga.sc(-1),L=this.Ga.Gc(-1),B=this.Ga.ka(D),q=this.Ga.ka(L),Q=new A.h,oe=new A.h;if(this.Zh.D(B,Q),this.Zh.D(q,oe),B=A.h.Wq(oe,_,Q),m.wm(B))C=this.Ga.zn(-1),(Q=this.iC(_,L,D))!=D&&this.jC(_,D,this.Ga.xe(Q));else if(m.xG(B)){oe=this.Ga.uv(-1);var le=this.Ga.sc(-1),be=this.Ga.Gc(-1);for(B=new A.h,q=new A.h;le!=this.Ga.xe(be);){var Me=this.Ga.ka(oe);this.Zh.D(Me,B),Me=A.h.Wq(B,_,Q),m.xG(Me)?(be=oe,oe=this.Ga.nl(oe)):(le=oe,oe=this.Ga.Zp(oe))}if(oe=be,Q=le,Me=this.Ga.ka(oe),le=this.Ga.ka(Q),this.Zh.D(Me,B),this.Zh.D(le,q),Q!=D&&(B=A.h.Wq(q,_,B),!m.wm(B)))continue;C=this.Ga.Bu(Q,oe,-2,!1),this.jC(_,oe,L),this.iC(_,Q,D)}else this.tb==null&&(this.tb=new A.zb),this.tb.Ec(oe),this.tb.Rc(Q),0>(Q=this.tb.ge(_,!0))?(Q=this.Ga.xe(L),this.Ga.wd(L,-1),C=this.Ga.zn(-3),this.iC(_,Q,D)):1_},m.xG=function(_){return 0<_},m}();A.au=b}(ae||(ae={})),function(A){var ye=function(){function H(T){this.g=null,this.oH=!0,this.od=T}return H.uU=function(T,b,m){return T=A.ua.Gr(T),A.$t.Ev(b.Ng(),b.kh(),m.Ng(),m.kh(),A.mc.ox(T))},H.xO=function(T,b){var m=new A.Ta;return A.$t.RT(T,b,m),m},H.W=function(T,b,m,_){return(m=new H(m)).g=T,m.ra=b,m.oH=_,m.zM()},H.prototype.iM=function(T){return A.$t.dQ(this.g,T)},H.prototype.nM=function(T){return A.bu.W(this.g,T,this.od)},H.prototype.zM=function(){var T=this.ra,b=A.ua.Gr(T),m=1.00001*(T=A.ua.mN(T));T*=1.000001;for(var _=!1,C=30C)throw A.i.ga("Internal Error: max number of iterations exceeded");var B=this.iM(b);if(_=_||B,this.oH&&(B=this.g.Ip(b,!0,!1)!=0,_=_||B),B=!1,(D==0||L||A.bu.fI(!0,this.g,T,null,this.od))&&(B=this.nM(m),_=_||B),!B)break;A.op.Bp(this.od)}return _},H}();A.Vk=ye}(ae||(ae={})),function(A){var ye=function(){function T(b){this.ae=this.Nc=null,this.$s=0,this.Vb=b,this.Yz=!0}return T.prototype.wv=function(b,m){var _=this.g.cc(b);if(_==null){if(!this.g.fd(b,m))return null;_=m}return _},T.prototype.Zq=function(){var b;b===void 0&&(b=!1),this.$s++,(b||!(4095&this.$s))&&(this.$s=0,A.op.Bp(this.Vb))},T.prototype.iP=function(){var b=this.g.$q(!1),m=!1,_=new A.zb,C=new A.zb,D=new A.l;D.Pa();var L=new A.l;L.Pa();for(var B=new A.Ta,q=new A.OC,Q=b.next();Q!=-1;Q=b.next()){A.op.Bp(this.Vb);var oe=null,le=!1;if(!A.ba.Tn(this.g.jc(b.ek))){if((oe=this.wv(Q,_))==null)continue;if(oe.A(D),D.X(this.ra,this.ra),oe.Di(this.ra)){if(!oe.Di(0))continue;le=!0,oe=null}}var be=this.g.$q(b),Me=be.next();for(Me!=-1&&(Me=be.next());Me!=-1;Me=be.next()){var Ye=null,it=!1;if(!A.ba.Tn(this.g.jc(be.ek))){if((Ye=this.wv(Me,C))==null)continue;if(Ye.A(L),Ye.Di(this.ra)){if(!Ye.Di(0))continue;it=!0,Ye=null}}var Lt=0,Ut=0;if(oe!=null&&Ye!=null)D.CG(L)&&(q.Qo(oe),q.Qo(Ye),q.Fa(this.ra,!1),0<(Lt=q.ql(0))+(Ut=q.ql(1))&&(this.g.lr(Q,q,0,!0),this.g.lr(Me,q,1,!0)),q.clear());else if(oe!=null){var Je=new A.h;if(this.g.D(Me,Je),D.contains(Je)){if(q.Qo(oe),this.g.Xi(Me,B),q.Fz(this.ra,B,!1),0<(Lt=q.ql(0)))if(this.g.lr(Q,q,0,!0),it){for(it=-1,Je=this.g.V(Me);Je!=-1&&Je!=Me&&(it=Je,(Ye=this.wv(Je,C))!=null&&Ye.Di(0));Je=this.g.V(Je));for(Je=Me;Je!=-1&&(this.g.Fh(Je,q.Cf),Je!=it);Je=this.g.V(Je));}else this.g.Fh(Me,q.Cf);q.clear()}}else{if(Ye==null)continue;if(Je=new A.h,this.g.D(Q,Je),L.X(this.ra,this.ra),L.contains(Je)){if(q.Qo(Ye),this.g.Xi(Q,B),q.Fz(this.ra,B,!1),0<(Ut=q.ql(0)))if(this.g.lr(Me,q,0,!0),le){for(it=-1,Je=this.g.V(Q);Je!=-1&&Je!=Q&&(it=Je,(Ye=this.wv(Je,C))!=null&&Ye.Di(0));Je=this.g.V(Je));for(Je=Q;Je!=-1&&(this.g.Fh(Je,q.Cf),Je!=it);Je=this.g.V(Je));}else this.g.Fh(Q,q.Cf);q.clear()}}if(Lt+Ut!=0){if(Lt!=0){if((oe=this.g.cc(Q))==null){if(!this.g.fd(Q,_))continue;oe=_,_.A(D)}else oe.A(D);if(oe.Di(this.ra))break}m=!0}}}return m},T.prototype.jP=function(){return this.LU()},T.prototype.LU=function(){return new A.MC().LX(this.g,this.ra)},T.prototype.gI=function(){var b=!1;this.Nc==null&&(this.Nc=new A.$j);var m=new A.ja(0);m.Jb(this.g.gd+1);for(var _=this.g.$q(),C=_.next();C!=-1;C=_.next())m.add(C);this.g.nx(m,m.size),m.add(-1),_=this.g.Hd(),C=this.g.Hd(),this.ae=new A.PC(this.g,this.ra,!this.Yz),this.Nc.Xo(this.ae);var D=new A.ja(0),L=new A.ja(0),B=0;new A.h;var q=this.g.ud;this.g.wb.oc();for(var Q,oe,le=this.g.wb.Aa[0].o,be=m.get(B++);be!=-1;){var Me=Q=le[2*(oe=q.U(be,0))],Ye=oe=le[2*oe+1];do{var it=q.U(be,2),Lt=q.U(be,1);if(it!=-1){var Ut=q.U(it,0),Je=le[2*Ut];0>(Ye<(Ut=le[2*Ut+1])?-1:Ye>Ut?1:MeJe?1:0)&&(L.add(be),L.add(it))}Lt!=-1&&(Je=le[2*(Ut=q.U(Lt,0))],0>(Ye<(Ut=le[2*Ut+1])?-1:Ye>Ut?1:MeJe?1:0)&&(L.add(Lt),L.add(Lt))),(Je=this.g.Qa(be,_))!=-1&&(D.add(Je),this.g.Sa(be,_,-1)),(Je=this.g.Qa(be,C))!=-1&&(D.add(Je),this.g.Sa(be,C,-1)),(be=m.get(B++))!==-1&&(Me=le[2*(Ye=q.U(be,0))],Ye=le[2*Ye+1])}while(be!=-1&&Me===Q&&Ye===oe);for(Me=D.size==1&&L.size==2,Je=Ye=-1,it=0,Lt=D.size;itb.gd?b=m.iP():m.jP())},T.W=function(b,m,_){return T.aQ(b,b.DF(),m,_)},T.fI=function(b,m,_,C,D){if(!T.tE(m))return!1;var L=new T(D);if(L.g=m,L.ra=_,L.Yz=b,L.gI())return C?.Yt(L.Pi),!0;var B=new A.Ed;return B.VB(),m.Pc(B),(L=new T(D)).g=m,L.ra=_,L.Yz=b,b=L.gI(),B.VB(),m.Pc(B),!!b&&(C?.Yt(L.Pi),!0)},T.Ol=function(b,m){return!(16>(b=b.I()))&&2*b+Math.log(b)*Math.LOG10E/Math.log(2)*m<1*b*m},T.gP=function(b,m,_,C){if(A.ba.Ic(m.K()))return new T(C).hP(b,m,_);throw A.i.ga("crack_A_with_B")},T.prototype.hP=function(b,m,_){var C=new A.l;b.yc(C);var D=new A.l;if(m.yc(D),D.X(_,_),!D.isIntersecting(C))return b;var L=b.Cb,B=null;L!=null&&(B=L.Gb),T.Ol(b,b.I())&&(B=A.ua.lj(b,D));var q=B!=null?B.getIterator():null,Q=m.Ha();m=b.Ha();var oe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(D=[];Q.ab();)for(;Q.Ia();){var le=Q.ia();if(B!=null){for(q.Wo(le,_),L=q.next();L!=-1;L=q.next())if(this.Zq(),m.Wb(B.ka(L),-1),m.Ia()){var be=(L=m.ia()).Fa(le,null,oe,null,_);for(L=0;Lm.t?1:b.tm.index?1:-1},T}()}(ae||(ae={})),function(A){var ye;(ye=A.FK||(A.FK={}))[ye.Left=0]="Left",ye[ye.Right=1]="Right",ye[ye.Coincident=2]="Coincident",ye[ye.Undefined=3]="Undefined",ye[ye.Uncut=4]="Uncut";var H=function(m,_,C,D,L,B,q,Q,oe,le,be){this.Y=m,this.ct=_,this.Ps=C,this.ug=D,this.Nm=le,this.Cl=be};A.qY=H;var T=function(){function m(_,C){this.EH=_,this.Ji=C}return m.prototype.lM=function(_,C){var D=new A.h;this.Ji.D(_,D);var L=new A.h;return this.Ji.D(C,L),(D=D.compare(L))!=0?D:(_=this.Ji.Qa(_,this.EH))<(C=this.Ji.Qa(C,this.EH))?-1:_==C?0:1},m}(),b=function(m,_,C,D,L,B,q,Q,oe){this.ug=m,this.Ps=_,this.JA=C,this.PH=D,this.Gi=L,this.Cl=B,this.Nm=q,this.QH=Q,this.JT=oe};A.pY=b,A.GK=function(){function m(){}return m.EK=function(_,C,D,L,B,q){if(C.B())_=new H(C,4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),B.push(_);else if(D.B())_=new H(C,4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),B.push(_);else{var Q=new A.hd;if(Q.Ib(C),Q.Ib(D),A.Vk.W(Q,L,q,!0),Q.gd==0)_=new H(C.Ja(),4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),B.push(_);else{for(C=0,D=Q.Hd(),L=Q.md;L!=-1;L=Q.ve(L))for(q=Q.Ob(L);q!=-1;q=Q.Sb(q))for(var oe=Q.Ya(q),le=0,be=Q.Ka(q);le(Ye=Ye.Fa(oe,null,be,Me,0))&&(L=new b(B,L,be[0],NaN,Ye,Q,q,Me[0],NaN),D.push(L),0>(L=C.Qa(B,_))&&C.Sa(B,_,D.length-1)),!0},m.rM=function(_,C,D,L,B,q,Q){var oe=new A.zb,le=new A.zb,be=[0,0],Me=[0,0],Ye=C.cc(B);return Ye==null&&(C.fd(B,oe),Ye=oe),(oe=C.cc(Q))==null&&(C.fd(Q,le),oe=le),2>(Ye=Ye.Fa(oe,null,be,Me,0))&&(L=new b(B,L,be[0],NaN,Ye,Q,q,Me[0],NaN),D.push(L),0>(L=C.Qa(B,_))&&C.Sa(B,_,D.length-1),!0)},m.sM=function(_,C,D,L,B,q,Q,oe){var le=new A.zb,be=new A.zb,Me=[0,0],Ye=[0,0],it=C.cc(B);return it==null&&(C.fd(B,le),it=le),(le=C.cc(Q))==null&&(C.fd(Q,be),le=be),(it=it.Fa(le,null,Me,Ye,0))==2?(L=new b(B,L,Me[0],Me[1],it,Q,q,Ye[0],Ye[1]),D.push(L),0>(L=C.Qa(B,_))&&C.Sa(B,_,D.length-1),!0):(be=!1,B==oe&&(L=new b(B,L,Me[0],NaN,it,Q,q,Ye[0],NaN),D.push(L),0>(L=C.Qa(B,_))&&C.Sa(B,_,D.length-1),be=!0),be)},m.tM=function(_,C,D,L,B,q,Q,oe){var le=new A.zb,be=new A.zb,Me=[0,0],Ye=[0,0],it=C.cc(B);return it==null&&(C.fd(B,le),it=le),(le=C.cc(Q))==null&&(C.fd(Q,be),le=be),(it=it.Fa(le,null,Me,Ye,0))==2?(L=new b(B,L,Me[0],Me[1],it,Q,q,Ye[0],Ye[1]),D.push(L),0>(L=C.Qa(B,_))&&C.Sa(B,_,D.length-1),!0):(be=!1,B==oe&&(L=new b(B,L,Me[0],NaN,it,Q,q,Ye[0],NaN),D.push(L),0>(L=C.Qa(B,_))&&C.Sa(B,_,D.length-1),be=!0),be)},m.YL=function(_,C,D,L){var B=[];B[0]=new A.h,B[1]=new A.h,B[2]=new A.h,B[3]=new A.h;var q=new A.h,Q=new A.h,oe=new A.h,le=new A.h,be=null;L!=null&&(be=new A.jg).Qr();var Me=0,Ye=null,it=new A.zb;new A.zb;for(var Lt=D.Ob(D.md);Lt!=-1;Lt=D.Sb(Lt)){for(var Ut=4,Je=-1,Rt=-1,ri=-1,ti=-1,Zt=NaN,ii=!0,Ci=!1,ki=!0,Ni=!0,tr=!0,cr=0,wi=Lt,bn=0,qr=D.Ya(Lt),eo=D.Ka(Lt),Ur=0;Ur=C.length-2||C[Me+2].Ps!=Je)&&(Ut=0):Ut=1):((es!=Wn||ui&&Wn==0)&&(L!=null?(An=new H(Ye,3,Je,Mn,es,Ut,wi,Rt,bn,ji,Xr),L.push(An)):null.add(cr)),Ut=1):Ut!=0?((es!=Wn||ui&&Wn==0)&&(L!=null?(An=new H(Ye,0,Je,Mn,es,Ut,wi,Rt,bn,ji,Xr),L.push(An)):null.add(cr)),Zi?(Me>=C.length-2||C[Me+2].Ps!=Je)&&(Ut=1):Ut=0):((es!=Wn||ui&&Wn==0)&&(L!=null?(An=new H(Ye,3,Je,Mn,es,Ut,wi,Rt,bn,ji,Xr),L.push(An)):null.add(cr)),Ut=0),(es!=Wn||ui&&Wn==0)&&(Wn=es,wi=Je,Rt=Mn,bn=es,ri=ji,ti=Xr,Zt=wo,ii=ki=!1,Ni=tr=!0))}}Me++}Wn!=1&&(tr&&(L!=null?Ye=new A.Ua:cr=0),L!=null?(os.dh(Wn,1,be),Ye.pc(be.get(),Ni)):cr++,Ni=tr=!1,ki=!0)}ki&&(es=1,Mn=D.tj(Lt),Mn=D.Na(Mn),Xr=ji=-1,wo=NaN,ii?L!=null?(An=new H(Ye,4,Je,Mn,es,Ut,wi,Rt,bn,ji,Xr),L.push(An)):null.add(cr):(ii=Ut==1?0:Ut==0?1:3,L!=null?(An=new H(Ye,ii,Je,Mn,es,Ut,wi,Rt,bn,ji,Xr),L.push(An)):null.add(cr)))}},m.xM=function(_,C,D,L,B,q){var Q=D[L].QH;if(Q==1)return m.vM(_,C,D,L,B,q);if(Q==0)return m.wM(_,C,D,L,B,q);throw A.i.Ra()},m.vM=function(_,C,D,L,B,q){var Q=new A.zb,oe=D[L].ug,le=D[L].Nm,be=D[L].Cl,Me=-1,Ye=-1,it=-1,Lt=-1;if(!_&&0.01*b&&(_*=1+(1+(T=T.yb/b))*T),this.pb=m,this.yb=_+2220446049250313e-31*Math.abs(m)},H.prototype.sqrt=function(){if(0<=this.pb){var T=Math.sqrt(this.pb),b=this.pb>10*this.yb?.5*this.yb/T:this.pb>this.yb?T-Math.sqrt(this.pb-this.yb):Math.max(T,Math.sqrt(this.pb+this.yb)-T);b+=2220446049250313e-31*Math.abs(T)}else this.pb<-1*this.yb?b=T=NaN:(T=0,b=Math.sqrt(this.yb));this.pb=T,this.yb=b},H.prototype.sin=function(T){var b=Math.sin(T.pb),m=Math.cos(T.pb);this.pb=b,b=Math.abs(b),this.yb=(Math.abs(m)+.5*b*T.yb)*T.yb+2220446049250313e-31*b},H.prototype.cos=function(T){var b=Math.sin(T.pb),m=Math.cos(T.pb);this.pb=m,m=Math.abs(m),this.yb=(Math.abs(b)+.5*m*T.yb)*T.yb+2220446049250313e-31*m},H.prototype.rg=function(){return Math.abs(this.pb)<=this.yb},H.prototype.rs=function(){return this.rg()&&this.yb!=0},H}();A.Xb=ye}(ae||(ae={}));var pe=new ae.h,Ae=new ae.h,tt=new ae.h,gt=new ae.h,ze=new ae.h;(function(A){var ye,H;(H=ye||(ye={}))[H.closedPath=1]="closedPath",H[H.exteriorPath=2]="exteriorPath",H[H.ringAreaValid=4]="ringAreaValid";var T=function(){function b(m,_,C,D,L,B,q){_!==void 0?(this.ib=m,this.ek=_,this.dl=C,this.ki=D,this.za=B,this.cA=q,this.gw=L):(this.ib=m.ib,this.ek=m.ek,this.dl=m.dl,this.ki=m.ki,this.za=m.za,this.cA=m.cA,this.gw=m.gw),this.XG=!0}return b.prototype.next=function(){return this.XG?(this.XG=!1,this.ki):this.ki!=-1?(this.ki=this.ib.V(this.ki),this.za++,this.ki!=-1&&this.ki!=this.gw?this.ki:this.VT()):-1},b.prototype.VT=function(){for(this.dl=this.ib.Sb(this.dl),this.za=0;this.ek!=-1;){for(;this.dl!=-1;this.dl=this.ib.Sb(this.dl))if(this.gw=this.ki=this.ib.Ya(this.dl),this.ki!=-1)return this.ki;if(this.ek=this.ib.ve(this.ek),this.ek==-1)break;this.cA&&!A.ba.Ic(this.ib.jc(this.ek))||(this.dl=this.ib.Ob(this.ek))}return-1},b.vP=function(m,_,C,D,L,B,q){return new b(m,_,C,D,L,B,q)},b}();A.vY=T,ye=function(){function b(){this.lo=this.Cm=this.yk=this.dd=this.Ek=this.xo=this.Qi=this.nd=this.di=this.Ug=this.Te=this.Kl=null,this.sw=this.md=-1,this.gd=0,this.aA=!1,this.it=this.jt=this.wb=null}return b.prototype.Uh=function(m){return this.Te!=null?this.Te[m]:null},b.prototype.Zg=function(m,_){if(this.Te==null){if(_==null)return;this.Te=[];for(var C=0,D=this.wb.I();C=this.Qi.size&&(m=16>_?16:A.P.truncate(3*_/2),this.Qi.resize(m),this.xo.resize(m)),this.Qi.set(_,0),this.xo.set(_,0),_},b.prototype.nF=function(m){this.nd.kd(m)},b.prototype.Qy=function(m){this.ud.kd(m),this.gd--},b.prototype.jI=function(m){this.nd==null&&(this.nd=new A.ad(8),this.ud=new A.ad(5),this.Qi=new A.ce(0),this.xo=new A.ce(0));var _=this.ud.De(),C=0<=m?m:_;if(this.ud.T(_,0,C),0>m){if(C>=this.wb.I()){if(m=16>C?16:A.P.truncate(3*C/2),this.wb.resize(m),this.Te!=null)for(var D=0;D_.Ka(D))){var B=this.wf(m,-1);this.mn(B,_.ec(D));for(var q=_.Ca(D),Q=_.Wc(D);qm.Ka(_))return C;this.Kl.Gd(m,m.Ca(_),m.Wc(_)),this.jt=this.wb.vb(0);var D=this.wf(C,-1);this.mn(D,m.ec(_)||!0);var L=this.Te!=null&&m.Se!=null,B=m.Ca(_);for(_=m.Wc(_);B<_;B++){var q=this.yj(D,-1,null);if(L)if(q=this.Va(q),(1&m.UF(B))!=0)this.Zg(q,null);else{var Q=new A.jg;m.cc(B,Q,!0),this.Zg(q,Q.get())}}return C},b.prototype.Ke=function(m){var _=this.jc(m),C=A.UK.Kg(_,this.Kl.description),D=this.I(m);if(D==0)return C;if(A.ba.Ic(_)){_=this.ea(m);for(var L=A.Zc.Qh(_+1),B=A.Zc.Or(_+1,0),q=C.description,Q=0,oe=q.Ba;Q=_.size&&_.resize(Math.max(A.P.truncate(1.25*m),16),-1),_.write(m,C)},b.prototype.FF=function(m,_){return(m=this.EF(m))<(_=this.yk[_]).size?_.read(m):-1},b.prototype.WE=function(){this.yk==null&&(this.yk=[]);for(var m=0;moe:2>oe)?(q=this.ar(q),D=0be){var Me=be;Q!=null&&(Me=0Me){var Ye=Me;if(Q!=null&&(Ye=0D||L>this.gd-1)throw A.i.O("invalid call");if(D>L&&!this.ec(m))throw A.i.O("cannot iterate across an open path");for(m=0;_!=C;_=this.V(_))D=this.Va(_),(L=this.Uh(D))!=null?m+=L.Rb():(L=this.Va(this.V(_)),m+=this.wb.Ar(D,L));return m},b.prototype.Fh=function(m,_){var C=this.Va(m);this.wb.It(C,_),(C=this.Uh(C))!=null&&C.setStart(_),(m=this.Na(m))!=-1&&(m=this.Va(m),this.Uh(m)!=null&&C.setEnd(_))},b.prototype.Xi=function(m,_){m=this.Va(m),this.wb.we(m,_)},b.prototype.mf=function(m,_){this.Db(m,_.x,_.y)},b.prototype.Db=function(m,_,C){var D=this.Va(m);this.wb.Db(D,_,C),(D=this.Uh(D))!=null&&D.UB(_,C),(m=this.Na(m))!=-1&&(m=this.Va(m),this.Uh(m)!=null&&D.Sl(_,C))},b.prototype.D=function(m,_){this.wb.D(this.ud.U(m,0),_)},b.prototype.Hc=function(m,_){this.wb.Aa[0].uc(2*this.ud.U(m,0),_)},b.prototype.Oa=function(m){var _=new A.h;return this.wb.D(this.ud.U(m,0),_),_},b.prototype.ZF=function(m,_){this.jt.uc(2*m,_)},b.prototype.Vc=function(m,_,C){return this.wb.Vc(m,this.Va(_),C)},b.prototype.setAttribute=function(m,_,C,D){this.wb.setAttribute(m,this.Va(_),C,D)},b.prototype.Va=function(m){return this.ud.U(m,0)},b.prototype.kh=function(){var m=new A.h;return this.D(void 0,m),m.y},b.prototype.hq=function(m,_){m=this.Va(m),_=this.Va(_);var C=this.wb.Aa[0].o;return C[2*m]===C[2*_]&&C[2*m+1]===C[2*_+1]},b.prototype.Fv=function(m,_){m=this.Va(m);var C=this.wb.Aa[0].o;return C[2*m]===_.x&&C[2*m+1]===_.y},b.prototype.rX=function(m,_){if(1>_&&(_=1),this.Ug==null){if(_==1)return;this.Ug=A.Zc.Fn(this.wb.I(),1)}(m=this.Va(m))>=this.Ug.size&&this.Ug.resize(m+1,1),this.Ug.write(m,_)},b.prototype.YF=function(m){return m=this.Va(m),this.Ug==null||m>=this.Ug.size?1:this.Ug.read(m)},b.prototype.Sa=function(m,_,C){_=this.di[_],m=this.Va(m),_.sizeL?1:BQ?1:0})},b.prototype.eS=function(){for(var m=this.md;m!=-1;m=this.ve(m))if(!A.ba.Ic(this.jc(m)))return!0;return!1},b.prototype.cC=function(m,_){for(var C=this.Ob(m),D=this.Ob(_),L=this.mv(m),B=this.mv(_),q=this.Ob(m);q!=-1;q=this.Sb(q))this.gx(q,_);for(q=this.Ob(_);q!=-1;q=this.Sb(q))this.gx(q,m);this.ap(m,D),this.ap(_,C),this.bp(m,B),this.bp(_,L),C=this.I(m),D=this.ea(m),L=this.ea(_),this.Vj(m,this.I(_)),this.Vj(_,C),this.Tl(m,L),this.Tl(_,D),C=this.dd.U(m,2),this.dd.T(m,2,this.dd.U(_,2)),this.dd.T(_,2,C)},b}(),A.hd=ye})(ae||(ae={})),function(A){var ye=function(H){function T(b,m,_,C){var D=H.call(this)||this;return D.aa=new A.l,b===void 0?D.PE():typeof b=="number"?D.QO(b,m,_,C):b instanceof A.Ta?m!==void 0?D.Su(b,m,_):D.RO(b):b instanceof A.sa?m!==void 0?D.TO(b,m):D.SO(b):b instanceof A.l?D.PO(b):D.PE(),D}return Ne(T,H),T.prototype.Su=function(b,m,_){this.description=A.fe.pg(),this.aa.Pa(),b.B()||this.vu(b,m,_)},T.prototype.PO=function(b){this.description=A.fe.pg(),this.aa.L(b),this.aa.normalize()},T.prototype.SO=function(b){if(b==null)throw A.i.O();this.description=b,this.aa.Pa()},T.prototype.TO=function(b,m){if(b==null)throw A.i.O();this.description=b,this.aa.L(m),this.aa.normalize()},T.prototype.PE=function(){this.description=A.fe.pg(),this.aa.Pa()},T.prototype.RO=function(b){this.description=A.fe.pg(),this.aa.Pa(),b.B()||this.vu(b)},T.prototype.QO=function(b,m,_,C){this.description=A.fe.pg(),this.L(b,m,_,C)},T.prototype.L=function(b,m,_,C){if(this.wc(),typeof b=="number")this.aa.L(b,m,_,C);else for(this.Pa(),m=0,_=b.length;m<_;m++)this.$b(b[m])},T.prototype.Zo=function(b){if(this.wc(),!b.aT())throw A.i.O();this.aa.L(b)},T.prototype.Pa=function(){this.wc(),this.aa.Pa()},T.prototype.B=function(){return this.aa.B()},T.prototype.S=function(){return this.aa.S()},T.prototype.da=function(){return this.aa.da()},T.prototype.ik=function(){return this.aa.ik()},T.prototype.Lp=function(){return this.aa.Lp()},T.prototype.Kp=function(){return this.aa.tf()},T.prototype.$b=function(b){if(b instanceof A.h)this.wc(),this.aa.$b(b);else if(b instanceof A.l)this.wc(),this.aa.$b(b);else if(b instanceof A.Ta){if(this.wc(),!b.Bc()){var m=b.description;if(this.description!=m&&this.Ll(m),this.B())this.vu(b);else{this.aa.$b(b.D());for(var _=1,C=m.Ba;_=A.sa.Wa(m))throw A.i.O();var C=this.description.Rf(m);return this.qu(),0<=C?this.la[this.fR(this.description,b)+this.description.GR(C)-2+_]:A.sa.te(m)},T.prototype.qu=function(){if(this.wc(),this.la==null&&2=A.sa.Wa(m))throw A.i.de();var C=this.description.Rf(m);return 0<=C?(this.qu(),this.la[T.Ig(this.description,b)+this.description.bk(C)-2+_]):A.sa.te(m)},T.prototype.qD=function(b,m,_,C){if(this.wc(),m==0)b!=0?_!=0?this.aa.H=C:this.aa.C=C:_!=0?this.aa.G=C:this.aa.v=C;else{if(_>=A.sa.Wa(m))throw A.i.de();if(!this.hasAttribute(m)){if(A.sa.yG(m,C))return;this.se(m)}m=this.description.Rf(m),this.qu(),this.la[T.Ig(this.description,b)+this.description.bk(m)-2+_]=C}},T.Ig=function(b,m){return m*(b.Be.length-2)},T.prototype.Fa=function(b){this.wc();var m=new A.l;return b.A(m),this.aa.Fa(m)},T.prototype.isIntersecting=function(b){return b instanceof A.l?this.aa.isIntersecting(b):this.aa.isIntersecting(b.aa)},T.prototype.Lu=function(b,m){this.wc(),b.B()?this.Pa():m!==void 0?this.vu(b,m,void 0):this.aa.Lu(b.Ng(),b.kh())},T.prototype.offset=function(b,m){this.wc(),this.aa.offset(b,m)},T.prototype.normalize=function(){this.wc(),this.aa.normalize()},T.prototype.tf=function(b){if(b===void 0){if(b=new A.Ta(this.description),this.B())return b;for(m=this.description.Ba,_=1;_this.C&&(this.C=_.x),_.ythis.H&&(this.H=_.y)}}else if(T==null||T.length==0)this.Pa();else for(_=T[0],this.L(_.x,_.y),m=1;mT?this.v=T:this.Cb?this.G=b:this.HT?this.v=T:this.Cb?this.G=b:this.Hthis.C||this.G>this.H)&&this.Pa())},H.prototype.scale=function(T){0>T&&this.Pa(),this.B()||(this.v*=T,this.C*=T,this.G*=T,this.H*=T)},H.prototype.zoom=function(T,b){this.B()||this.L(this.tf(),T*this.S(),b*this.da())},H.prototype.isIntersecting=function(T){return!this.B()&&!T.B()&&(this.v<=T.v?this.C>=T.v:T.C>=this.v)&&(this.G<=T.G?this.H>=T.G:T.H>=this.G)},H.prototype.CG=function(T){return(this.v<=T.v?this.C>=T.v:T.C>=this.v)&&(this.G<=T.G?this.H>=T.G:T.H>=this.G)},H.prototype.Fa=function(T){return!this.B()&&!T.B()&&(T.v>this.v&&(this.v=T.v),T.Cthis.G&&(this.G=T.G),T.HT.length)throw A.i.O();T[0]!=null?T[0].na(this.v,this.G):T[0]=A.h.construct(this.v,this.G),T[1]!=null?T[1].na(this.v,this.H):T[1]=A.h.construct(this.v,this.H),T[2]!=null?T[2].na(this.C,this.H):T[2]=A.h.construct(this.C,this.H),T[3]!=null?T[3].na(this.C,this.G):T[3]=A.h.construct(this.C,this.G)},H.prototype.rF=function(){return this.B()?0:this.S()*this.da()},H.prototype.tR=function(){return this.B()?0:2*(this.S()+this.da())},H.prototype.ik=function(){return(this.C+this.v)/2},H.prototype.Lp=function(){return(this.H+this.G)/2},H.prototype.S=function(){return this.C-this.v},H.prototype.da=function(){return this.H-this.G},H.prototype.move=function(T,b){this.B()||(this.v+=T,this.G+=b,this.C+=T,this.H+=b)},H.prototype.Lu=function(T,b){if(b!==void 0)this.move(T-this.ik(),b-this.Lp());else if(T instanceof A.h)this.Lu(T.x,T.y);else{if(!(T instanceof A.Ta))throw A.i.O();b=(this.C-this.v)/2;var m=(this.H-this.G)/2;this.v=T.Ng()-b,this.C=T.Ng()+b,this.G=T.kh()-m,this.H=T.kh()+m}},H.prototype.offset=function(T,b){this.v+=T,this.C+=T,this.G+=b,this.H+=b},H.prototype.normalize=function(){if(!this.B()){var T=Math.min(this.v,this.C),b=Math.max(this.v,this.C);this.v=T,this.C=b,T=Math.min(this.G,this.H),b=Math.max(this.G,this.H),this.G=T,this.H=b}},H.prototype.fn=function(T){T.na(this.v,this.G)},H.prototype.VI=function(T){T.na(this.C,this.G)},H.prototype.YI=function(T){T.na(this.v,this.H)},H.prototype.gn=function(T){T.na(this.C,this.H)},H.prototype.aT=function(){return this.B()||this.v<=this.C&&this.G<=this.H},H.prototype.tf=function(){return A.h.construct((this.C+this.v)/2,(this.H+this.G)/2)},H.prototype.hz=function(){return A.h.construct(this.v,this.G)},H.prototype.contains=function(T,b){if(b!==void 0)return T>=this.v&&T<=this.C&&b>=this.G&&b<=this.H;if(T instanceof A.Ta)return this.contains(T.Ng(),T.kh());if(T instanceof A.h)return this.contains(T.x,T.y);if(T instanceof H)return T.v>=this.v&&T.C<=this.C&&T.G>=this.G&&T.H<=this.H;throw A.i.O()},H.prototype.jm=function(T,b){if(b!==void 0)return T>this.v&&Tthis.G&&bthis.v&&T.Cthis.G&&T.H>>32);var b=A.P.Vh(T);return T=this.C,T=A.P.truncate(T^T>>>32),b=A.P.Vh(T,b),T=this.G,T=A.P.truncate(T^T>>>32),b=A.P.Vh(T,b),T=this.H,T=A.P.truncate(T^T>>>32),A.P.Vh(T,b)},H.prototype.zr=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)},H.prototype.uy=function(T,b){var m=this.ak(T),_=this.ak(b);if(m&_)return 0;if(!(m|_))return 4;var C=(m!=0?1:0)|(_!=0?2:0);do{var D=b.x-T.x,L=b.y-T.y;if(D>L?m&H.TC?(m&H.lu?(T.y+=L*(this.v-T.x)/D,T.x=this.v):(T.y+=L*(this.C-T.x)/D,T.x=this.C),m=this.ak(T)):_&H.TC?(_&H.lu?(b.y+=L*(this.v-b.x)/D,b.x=this.v):(b.y+=L*(this.C-b.x)/D,b.x=this.C),_=this.ak(b)):m!=0?(m&H.mu?(T.x+=D*(this.G-T.y)/L,T.y=this.G):(T.x+=D*(this.H-T.y)/L,T.y=this.H),m=this.ak(T)):(_&H.mu?(b.x+=D*(this.G-b.y)/L,b.y=this.G):(b.x+=D*(this.H-b.y)/L,b.y=this.H),_=this.ak(b)):m&H.UC?(m&H.mu?(T.x+=D*(this.G-T.y)/L,T.y=this.G):(T.x+=D*(this.H-T.y)/L,T.y=this.H),m=this.ak(T)):_&H.UC?(_&H.mu?(b.x+=D*(this.G-b.y)/L,b.y=this.G):(b.x+=D*(this.H-b.y)/L,b.y=this.H),_=this.ak(b)):m!=0?(m&H.lu?(T.y+=L*(this.v-T.x)/D,T.x=this.v):(T.y+=L*(this.C-T.x)/D,T.x=this.C),m=this.ak(T)):(_&H.lu?(b.y+=L*(this.v-b.x)/D,b.x=this.v):(b.y+=L*(this.C-b.x)/D,b.x=this.C),_=this.ak(b)),(m&_)!=0)return 0}while(m|_);return C},H.prototype.ak=function(T){return(T.xthis.C?1:0)<<1|(T.ythis.H?1:0)<<3},H.prototype.Di=function(T){return!this.B()&&(this.S()<=T||this.da()<=T)},H.prototype.ub=function(T){return T instanceof A.h?Math.sqrt(this.dK(T)):Math.sqrt(this.px(T))},H.prototype.px=function(T){var b=0,m=0,_=this.v-T.C;return _>b&&(b=_),(_=this.G-T.H)>m&&(m=_),(_=T.v-this.C)>b&&(b=_),(_=T.G-this.H)>m&&(m=_),b*b+m*m},H.prototype.dK=function(T){var b=0,m=0,_=this.v-T.x;return _>b&&(b=_),(_=this.G-T.y)>m&&(m=_),(_=T.x-this.C)>b&&(b=_),(_=T.y-this.H)>m&&(m=_),b*b+m*m},H.prototype.en=function(T){this.B()?T.Pa():T.L(this.v,this.C)},H.lu=1,H.mu=4,H.TC=3,H.UC=12,H}();A.l=ye}(ae||(ae={})),function(A){var ye,H;(H=ye||(ye={}))[H.initialize=0]="initialize",H[H.initializeRed=1]="initializeRed",H[H.initializeBlue=2]="initializeBlue",H[H.initializeRedBlue=3]="initializeRedBlue",H[H.sweep=4]="sweep",H[H.sweepBruteForce=5]="sweepBruteForce",H[H.sweepRedBlueBruteForce=6]="sweepRedBlueBruteForce",H[H.sweepRedBlue=7]="sweepRedBlue",H[H.sweepRed=8]="sweepRed",H[H.sweepBlue=9]="sweepBlue",H[H.iterate=10]="iterate",H[H.iterateRed=11]="iterateRed",H[H.iterateBlue=12]="iterateBlue",H[H.iterateBruteForce=13]="iterateBruteForce",H[H.iterateRedBlueBruteForce=14]="iterateRedBlueBruteForce",H[H.resetRed=15]="resetRed",H[H.resetBlue=16]="resetBlue";var T=function(){function b(m,_){this.ei=m,this.ZG=_}return b.prototype.qr=function(m,_,C){this.ei.FX(C,m,_,this.ZG)},b.prototype.bq=function(m){return this.ei.Tr(m,this.ZG)},b}();ye=function(){function b(){this.qw=this.qo=this.ff=this.sd=null,this.yq=new A.l,this.Cm=this.Jj=this.Kj=this.Bd=this.Ff=this.Md=this.ew=this.io=this.rd=this.Fb=null,this.Yb=-1,this.ra=0,this.Pk()}return b.prototype.mr=function(){this.Pk(),this.Rv=!0,this.Fb==null?(this.io=new A.ja(0),this.Fb=[]):(this.io.Dh(0),this.Fb.length=0)},b.prototype.bd=function(m,_){if(!this.Rv)throw A.i.Hb();var C=new A.l;C.L(_),this.io.add(m),this.Fb.push(C)},b.prototype.Hp=function(){if(!this.Rv)throw A.i.Hb();this.Rv=!1,this.Fb!=null&&0this.Fb.length)return this.qe=this.Fb.length,this.Yb=5,!0;this.sd==null&&(this.sd=new A.ur(!0),this.qo=this.sd.getIterator(),this.Md=new A.ja(0)),this.sd.mr();for(var m=0;mthis.Fb.length||10>this.rd.length)return this.qe=this.Fb.length,this.Yb=6,!0;this.sd==null&&(this.sd=new A.ur(!0),this.qo=this.sd.getIterator(),this.Md=new A.ja(0)),this.sd.mr();for(var m=0;mthis.Fb.length||10>this.rd.length)return this.qe=this.Fb.length,this.Yb=6,!0;this.ff==null&&(this.ff=new A.ur(!0),this.qw=this.ff.getIterator(),this.Ff=new A.ja(0)),this.ff.mr();for(var m=0;mthis.Fb.length||10>this.rd.length)return this.qe=this.Fb.length,this.Yb=6,!0;this.sd==null&&(this.sd=new A.ur(!0),this.qo=this.sd.getIterator(),this.Md=new A.ja(0)),this.ff==null&&(this.ff=new A.ur(!0),this.qw=this.ff.getIterator(),this.Ff=new A.ja(0)),this.sd.mr();for(var m=0;m>1;return b.gq(m)?(this.sd.remove(_),this.qe!=0||(this.Bf=this.Xf=-1,this.Jc=!0,!1)):(this.qo.zB(this.Fb[_].v,this.Fb[_].C,this.ra),this.Xf=_,this.Yb=10,!0)},b.prototype.MX=function(){return--this.qe==-1?(this.Bf=this.Xf=-1,this.Jc=!0,!1):(this.Tg=this.Xf=this.qe,this.Yb=13,!0)},b.prototype.NX=function(){return--this.qe==-1?(this.Bf=this.Xf=-1,this.Jc=!0,!1):(this.Xf=this.qe,this.Tg=this.rd.length,this.Yb=14,!0)},b.prototype.OX=function(){var m=this.Md.get(this.qe-1),_=this.Ff.get(this.Tg-1),C=this.Tr(m,!0),D=this.Tr(_,!1);return C>D?this.tx():C>1;if(b.gq(m))return this.Ef!=-1&&this.Kj.get(_)!=-1?(this.Bd.kd(this.Ef,this.Kj.get(_)),this.Kj.set(_,-1)):this.sd.remove(_),this.qe!=0||(this.Bf=this.Xf=-1,this.Jc=!0,!1);if(this.Df!=-1&&0>1;if(b.gq(m))return this.Df!=-1&&this.Jj.get(_)!=-1?(this.Bd.kd(this.Df,this.Jj.get(_)),this.Jj.set(_,-1)):this.ff.remove(_),this.Tg!=0||(this.Bf=this.Xf=-1,this.Jc=!0,!1);if(this.Ef!=-1&&0>1;return this.sd.xj(m),this.Yb=4,!0},b.prototype.eT=function(){if(this.Xf=this.qo.next(),this.Xf!=-1)return!1;this.Bf=this.Xf=-1;var m=this.Ff.get(this.Tg)>>1;return this.ff.xj(m),this.Yb=7,!0},b.prototype.bT=function(){if(this.Bf=this.qw.next(),this.Bf!=-1)return!1;var m=this.Md.get(this.qe)>>1;return this.sd.xj(m),this.Yb=7,!0},b.prototype.cT=function(){if(--this.Tg==-1)return this.Yb=5,!0;this.yq.L(this.Fb[this.qe]);var m=this.Fb[this.Tg];return this.yq.X(this.ra,this.ra),!this.yq.isIntersecting(m)||(this.Bf=this.Tg,!1)},b.prototype.dT=function(){if(--this.Tg==-1)return this.Yb=6,!0;this.yq.L(this.Fb[this.qe]);var m=this.rd[this.Tg];return this.yq.X(this.ra,this.ra),!this.yq.isIntersecting(m)||(this.Bf=this.Tg,!1)},b.prototype.fJ=function(){return this.sd==null?(this.Jc=!0,!1):(this.qe=this.Md.size,0>1],b.gq(m)?_.G-C:_.H+C):(_=this.rd[m>>1],b.gq(m)?_.G-C:_.H+C)},b}(),A.sC=ye}(ae||(ae={})),function(A){var ye=function(){function H(){}return H.construct=function(T,b,m,_,C,D){var L=new H;return L.v=T,L.G=b,L.Xe=m,L.C=_,L.H=C,L.Dg=D,L},H.prototype.Pa=function(){this.Xe=this.v=NaN},H.prototype.B=function(){return isNaN(this.v)},H.prototype.SS=function(){return isNaN(this.Xe)},H.prototype.L=function(T,b,m,_,C,D){_!==void 0?typeof T=="number"?(this.v=T,this.G=b,this.Xe=m,this.C=_,this.H=C,this.Dg=D):(this.v=T.x-.5*b,this.C=this.v+b,this.G=T.y-.5*m,this.H=this.G+m,this.Xe=T.z-.5*_,this.Dg=this.Xe+_):(this.v=T,this.G=b,this.Xe=m,this.C=T,this.H=b,this.Dg=m)},H.prototype.move=function(T){this.v+=T.x,this.G+=T.y,this.Xe+=T.z,this.C+=T.x,this.H+=T.y,this.Dg+=T.z},H.prototype.copyTo=function(T){T.v=this.v,T.G=this.G,T.C=this.C,T.H=this.H},H.prototype.Nk=function(T,b,m){this.v>T?this.v=T:this.Cb?this.G=b:this.Hm?this.Xe=m:this.DgT.length)throw A.i.O();T[0]=new A.Od(this.v,this.G,this.Xe),T[1]=new A.Od(this.v,this.H,this.Xe),T[2]=new A.Od(this.C,this.H,this.Xe),T[3]=new A.Od(this.C,this.G,this.Xe),T[4]=new A.Od(this.v,this.G,this.Dg),T[5]=new A.Od(this.v,this.H,this.Dg),T[6]=new A.Od(this.C,this.H,this.Dg),T[7]=new A.Od(this.C,this.G,this.Dg)},H.prototype.bx=function(T){if(T==null||T.length==0)this.Pa();else{var b=T[0];for(this.L(b.x,b.y,b.z),b=1;bthis.AA;){var B=this.td.ia();if(C.N(B.bc()),D.N(B.xc()),C.scale(this.Xa.fc),D.scale(this.Xa.fc),A.ej.Ou(C,D)?C.x=D.x:A.ej.Mu(C,D)&&(D.x=C.x),this.wk.length=0,A.ej.oF(this.Xa.Ub,this.Xa.lc,this.Xa.Ae,C,D,this.Xa.LA,this.Xa.at,L,this.Pj,this.Is,this.wk,this.dw),this.fo!=null&&(B=this.wk.slice(0),this.fo.lG(this.fo.ea()-1,B,B.length-1)),A.ej.Nu(C,D)?(this.sq.Pa(),this.Xa.ny(C,this.ul,this.sq),this.Zn=!0):(this.sq.Pa(),this.Zn=this.sy(L[0],this.sq)),this.Zn){if(this.td.ni(),this.td.zz()){this.td.ni(),this.td.ia();break}this.td.xW();break}m==null&&(m=new A.Ea).$k(null,0),this.JD(m),_++}if(this.dw[0]=0,0<_){for(L=this.td.xb();0<_;)this.td.ni(),C.N(this.tw.Oa(this.td.xb())),D.N(this.tw.Oa(this.td.kk())),C.scale(this.Xa.fc),D.scale(this.Xa.fc),this.ul&&(A.ej.Ou(C,D)?C.x=D.x:A.ej.Mu(C,D)&&(D.x=C.x)),this.wk.length=0,A.ej.oF(this.Xa.Ub,this.Xa.lc,this.Xa.Ae,D,C,this.Xa.LA,this.Xa.at,null,this.Pj,this.Is,this.wk,this.dw),this.JD(m),_--;return C.N(this.tw.Oa(this.td.xb())),C.scale(this.Xa.fc),T.Jr(this.Xa.Ub,this.Xa.lc,this.Xa.fc,this.Xa.sb,C,this.fi+1.570796326794897,this.fi+4.71238898038469,this.Xa.co,this.ul,this.uk,m,NaN,NaN),this.td.Wb(L),this.td.ia(),_=A.ua.mj(null,m,!0),A.Hg.Ok(m,_,!0,!0,this.Xa.Vb)}return this.Zn=!1,this.td.ia(),m=A.ba.kg(this.sq),A.Hg.Ok(m,this.Xa.Cq,!0,!0,this.Xa.Vb)},b.prototype.JD=function(m){var _=this.wk[0],C=this.Pj[0]-1.570796326794897,D=this.Is[0]+1.570796326794897;if(!isNaN(this.fi)){if(this.fi>=this.Pj[0]){var L=this.fi+1.570796326794897;C=L+3.141592653589793-(this.fi-this.Pj[0])}else C=(L=this.fi+1.570796326794897)+3.141592653589793-(6.283185307179586-(this.Pj[0]-this.fi));var B=!(this.fi>=this.Pj[0]&&3.141592653589793>=this.fi-this.Pj[0])&&!(this.fiL;)Q-=6.283185307179586;Q_.x-this.uk[0]?this.uk[0]-=6.283185307179586:3.141592653589793<_.x-this.uk[0]&&(this.uk[0]+=6.283185307179586)),B||(C=.5*(C+L))):(B?((L=new A.h).N(_),L.scale(1/this.Xa.fc),m.xf(0,-1,L)):T.Jr(this.Xa.Ub,this.Xa.lc,this.Xa.fc,this.Xa.sb,this.wk[0],L,C,this.Xa.co,this.ul,this.uk,m,NaN,NaN),this.AA+=1)}T.my(this.Xa.Ub,this.Xa.lc,this.Xa.fc,this.Xa.sb,this.Xa.Ae,this.wk,C,D,this.ul,this.uk,m),this.fi=this.Is[0]},b.prototype.sy=function(m,_){return this.Xa.sy(this.wk,m,this.Pj[0],this.Is[0],this.ul,_)},b.prototype.Ma=function(){return 0},b}(),T=function(){function b(){}return b.buffer=function(m,_,C,D,L,B){if(m==null)throw A.i.O("Geometry::Geodesic_bufferer::buffer");if(m.B())return new A.Ea(m.description);var q=new b;q.Sg=_,q.Kc=A.cb.tc(_);var Q=A.cb.xv(q.Kc);if(q.Vb=B,q.Ub=A.cb.gv(q.Kc),q.lc=Q*(2-Q),q.fc=q.Kc.Id().ci,q.ra=q.Sg.Mn(),q.Cq=q.Kc.Mn(),q.at=q.Cq*q.fc,q.Bq=1.570796326794897/q.fc,q.KY=3.141592653589793/q.fc,q.Ls=6.283185307179586/q.fc,q.LY=q.Ls/6,q.GA=0,q.JY=1.5707963267948966*q.Ub/q.GA,C==4?(q.Ae=2,q.Yv=!0):(q.Ae=C,q.Yv=!1),q.La=D,q.sb=Math.abs(D),isNaN(L)||.001>L?q.tX():q.bo=L,C=m.K(),A.ba.zd(C)?((C=new A.Ua(m.description)).pc(m,!0),m=C,C=1607):C==197&&(C=new A.l,m.A(C),C.S()<=q.ra||C.da()<=q.ra?((C=new A.Ua(m.description)).bd(m,!1),m=C,C=1607):((C=new A.Ea(m.description)).bd(m,!1),m=C,C=1736)),q.uX(),A.ba.Tn(C)||q.vX(),q.sb<=.5*q.bo)return C!=1736?new A.Ea(m.description):q.Yv?m:A.ej.Sr(m,q.Sg,q.Ae,q.LA,-1,B);if(0>q.La&&C!=1736)return new A.Ea(m.description);if(q.Yv&&A.ba.Ic(C)?(_=A.ej.Sr(m,_,4,NaN,q.bo,B),m=A.cb.Bh(_,q.Sg,q.Kc)):m=A.cb.Bh(m,q.Sg,q.Kc),(m=A.Jh.nj(m,q.Kc)).B())return new A.Ea(m.description);switch(!q.Yv&&A.ba.Ic(C)&&(m=A.ej.kI(q.fc,m)),m=b.GX(m,q.Kc),C){case 1736:_=q.PN(m);break;case 1607:_=q.QN(m);break;case 550:_=q.NN(m);break;case 33:_=q.ON(m);break;default:throw A.i.ga("corrupted_geometry")}return(q=A.cb.Bh(_,q.Kc,q.Sg)).Ll(m.description),q},b.prototype.PN=function(m){var _=new A.Ea;m=new H(this,m,_),m=A.Ih.local().W(m,this.Kc,this.Vb).next(),m=A.kp.pj(m,this.Kc,2);var C=new A.Ed;return C.scale(1/this.fc,1/this.fc),_.Pc(C),_=A.kp.pj(_,this.Kc,2),0<=this.La?A.Ih.local().W(_,m,this.Kc,this.Vb):A.mp.local().W(_,m,this.Kc,this.Vb)},b.prototype.QN=function(m){return m=new H(this,m,null),m=A.Ih.local().W(m,this.Kc,this.Vb).next(),A.kp.pj(m,this.Kc,2)},b.prototype.NN=function(m){return m=new ye(this,m),m=A.Ih.local().W(m,this.Kc,this.Vb).next(),A.kp.pj(m,this.Kc,2)},b.prototype.ON=function(m){(m=m.D()).scale(this.fc);var _=new A.Ea;return this.ny(m,!1,_),A.kp.pj(_,this.Kc,2)},b.prototype.sy=function(m,_,C,D,L,B){var q=m[0],Q=m[m.length-1],oe=q.y>Q.y?q.y:Q.y,le=A.F.q(this.Ub,this.lc,q.ym.He()&&(this.PV(m),!0)},b.prototype.JI=function(m,_,C){var D=C.I(),L=0<_?_-1:D-1;if(D=C.Oa(_B.x?(B=this.Bq,D.ig(-this.Ls,0)):(B=-this.Bq,D.ig(this.Ls,0)),_.add(m,!1),m.Pa(),C.add(_,!1),C.Pc(D),L=new A.l,C.A(L),L.X((this.Ls-L.S())/2,0),L.G=-this.Bq,L.H=this.Bq;for(var Q=0;Q=q));)A.kb.Ai(m,_,L.x,L.y,D,ti,it,Lt),oe?Je.na(it.u,Lt.u):(Ut.na(it.u,Lt.u),b.bJ(L.x,Ut.x,Rt.x,le),Je.na(le[0]+Ut.x,Ut.y),Rt.N(Je)),Je.scale(C),be.xf(0,-1,Je),B=ti,ti=ri++*Q}},b.ZI=function(m,_,C,D,L,B,q,Q,oe,le){var be=new A.h,Me=new A.h,Ye=new A.ha(0),it=new A.ha(0);for(A.kb.Ai(m,_,D.x,D.y,C,L,Ye,it),be.na(Ye.u,it.u),A.kb.Ai(m,_,D.x,D.y,C,B,Ye,it),Me.na(Ye.u,it.u),C=new A.ha(0),A.kb.Sy(m,_,q.x,q.y,be.x,be.y,C),oe[0]=C.u,A.kb.Sy(m,_,q.x,q.y,Me.x,Me.y,C),le[0]=C.u;oe[0]<=le[0];)oe[0]+=6.283185307179586;for(;oe[0]>le[0];)oe[0]-=6.283185307179586;for(;oe[0]>=Q;)oe[0]-=6.283185307179586,le[0]-=6.283185307179586;for(;oe[0]B[be]?1:0}),_=m.Ja(),Q=0;Qthis.sb/m&&(m=this.sb/500),.01>m&&(m=.01),this.bo=m},b}();A.QK=T}(ae||(ae={})),function(A){var ye=function(){function H(){}return H.Of=function(T,b){var m=new A.h;m.N(b),T.push(m)},H.wp=function(T,b){T.add(b.x),T.add(b.y)},H.cB=function(T){T.Dh(T.size-2)},H.jB=function(T,b){b.na(T.get(T.size-2),T.get(T.size-1))},H.Sr=function(T,b,m,_,C,D){if(T==null)throw A.i.O();var L=T.K();if(T.B()||A.ba.Tn(L))return T;var B=new H;B.Sg=b,B.Kc=A.cb.tc(b);var q=A.cb.xv(B.Kc);if(B.Vb=D,B.Ub=A.cb.gv(B.Kc),B.lc=q*(2-q),B.fc=B.Kc.Id().ci,B.Cq=B.Kc.Mn(),B.at=B.Cq*B.fc,B.vA=_,B.uA=C,B.Ae=m,L==197?(m=new A.Ea(T.description)).bd(T,!1):A.ba.zd(L)?(m=new A.Ua(T.description)).pc(T,!0):m=T,B.Ae!=4){if((b=B.Sg.Nb(B.Kc)==0?A.cb.Bh(m,B.Sg,B.Kc):A.Jh.nj(m,B.Kc)).B())return b;b=H.kI(B.fc,b),b=B.Uy(b),b=A.kp.pj(b,B.Kc,B.Ae),B=A.cb.Bh(b,B.Kc,B.Sg)}else{if(A.Gg.Tb(b)==2?(T=A.cb.ol(),(b=A.Zj.local().W(m,T,b,D))==T&&(b=new A.Ea,T.copyTo(b))):b=A.Jh.nj(m,B.Kc),b.B())return b;B=B.yX(b)}return B},H.kI=function(T,b){var m=new A.l;if(b.yc(m),3.141592653589793>m.S()*T)return b;var _=!1;m=b.Ha();for(var C=new A.h,D=new A.h;m.ab();)for(;m.Ia();){var L=m.ia();if(C.N(L.bc()),D.N(L.xc()),C.scale(T),D.scale(T),3.141592653589793D.x-C.x)for(;-6.283185307179586>D.x-C.x;)D.x+=6.283185307179586;H.Yi(D.x,NaN,it),le.N(D)}else Q.N(D),H.vU(Q),H.Yi(Q.x,Ye,it),le.na(it[0]+Q.x,Q.y);.5>Math.abs(le.x-D.x)&&le.N(D),q?(L.Vw(0,Me),be.N(oe),be.scale(1/T),Me.Db(be),(B=m.xm())?_.nf(Me):_.lineTo(Me),m.Sn()&&!b.ec(m.gb)&&(L.Vw(1,Me),be.N(le),be.scale(1/T),Me.Db(be),_.lineTo(Me))):((B=m.xm())&&_.Cz(null,0),L=_.ea()-1,be.N(oe),be.scale(1/T),_.xf(L,-1,be),m.Sn()&&!b.ec(m.gb)&&(be.N(le),be.scale(1/T),_.xf(L,-1,be)))}return _},H.oF=function(T,b,m,_,C,D,L,B,q,Q,oe,le){var be=new A.h,Me=new A.h,Ye=0<_.compare(C);H.aJ(Ye,_,C,be,Me),H.pF(T,b,m,be,Me,D,NaN,L,B,q,Q,null,oe,le),Ye&&H.aC(q,Q,null,oe)},H.prototype.Uy=function(T){var b=T.Ja(),m=T.Ha(),_=[],C=null,D=null,L=1Ut&&(Ut+=6.283185307179586),0>(it=it.u)&&(it+=6.283185307179586),q!=null&&(q[0]=Lt),Q!=null&&(Q[0]=Ut),oe!=null&&(oe[0]=it),Q=q=NaN,le!=null&&(q=((Q=A.F.Ch(T,b))-(oe=A.F.q(T,b,_.y)))/Lt,Q=(Q+oe)/Lt),oe=H.Ou(_,C),it=H.Mu(_,C),Ut=oe||it;var Je=H.AE(_,C,B),Rt=new A.ha(0),ri=new A.ha(0),ti=new A.h,Zt=new A.h,ii=new A.h;H.Yi(_.x,NaN,Me);var Ci=[Me[0]];if(Lt<=D)H.Of(be,_),H.Yi(C.x,NaN,Me),le?.add(0),Ut?(oe&&H.fB(_,C,le,be),it&&H.dB(_,C,le,be)):Je?H.eB(_,C,Ye,q,Q,le,be):0ii.x&&(Me[0]+=6.283185307179586,ii.na(Me[0]+ti.x,ti.y)):Ni.xL.x?L.x+=6.283185307179586:3.141592653589793wi;wi++)if(Ni=ki[wi]*Q+(1-ki[wi])*q,A.kb.qj(T,b,_.x,_.y,Ni*C,D,Lt,Ut,m),ti.na(Lt.u,Ut.u),wi==0&&(cr=Ni,Zt.N(ti)),H.RW(Rt,ti,ri,Ci),Ci.ic(Ci.ge(ti,!0),ii),A.kb.xd(T,b,ti.x,ti.y,ii.x,ii.y,Je,null,null,2),Je.u>oe){tr=!0;break}tr?(ri.N(Zt),Q=cr,H.wp(L,ri),B.add(Q)):(H.cB(L),B.Gn(B.size-1,1,B.size-1),0=L&&os.u<=D&&3.141592653589793>Math.abs(Ye.x-it.x)||_.Tx(tr,cr)<=C));Ci++){var ui=eo[Ci]*cr+(1-eo[Ci])*tr;if(_.ic(ui,le),ii?Lt.na(le.x*m,le.y*m):(Zt[0][0]=le.x,Zt[0][1]=le.y,A.cb.wt(),Lt.x=Zt[0][0]*m,Lt.y=Zt[0][1]*m),Ci==0&&(Zi=ui,Me.N(le),Je.N(Lt),0D||3.141592653589793<=Math.abs(Ye.x-it.x)))){An=!0;break}if(wi&&0D||3.141592653589793<=Math.abs(Ye.x-Lt.x)){An=!0;break}}else if(0L){An=!0;break}if(wi){if(A.kb.xd(T,b,ti.x,ti.y,Ut.x,Ut.y,Xr,null,null,2),Xr.u>L){An=!0;break}if(A.kb.xd(T,b,Ut.x,Ut.y,Lt.x,Lt.y,wo,null,null,2),wo.u>L){An=!0;break}}}}An?(oe.N(Me),it.N(Je),cr=Zi,H.wp(ki,oe),H.wp(bn,it),qr.add(cr)):(H.cB(ki),H.cB(bn),qr.Gn(qr.size-1,1,qr.size-1),H.Of(q,oe),Ni+=os.u,B?.add(Ni),0Math.abs(b.x-T.x)?(_.Ec(T),3.141592653589793<=m.x-T.x?_.Sl(m.x-6.283185307179586,m.y):3.141592653589793<=T.x-m.x?_.Sl(m.x+6.283185307179586,m.y):_.Sl(m.x,m.y)):(_.Ec(m),3.141592653589793<=T.x-m.x?_.Sl(T.x-6.283185307179586,T.y):3.141592653589793<=m.x-T.x?_.Sl(T.x+6.283185307179586,T.y):_.Sl(T.x,T.y))},H.TJ=function(T,b){for(var m=0;mT.x)for(;-3.141592653589793>T.x;)T.x+=6.283185307179586;if(3.141592653589793H.v+_&&DH?-H:H},ye.Mb=function(H,T){return 0<=T?ye.R(H):-ye.R(H)},ye.$=function(H,T){return H==T||ye.R(H-T)<=ye.EC*(1+(ye.R(H)+ye.R(T))/2)},ye.Dd=function(H){return H==0||ye.R(H)<=ye.EC},ye.Ch=function(H,T){var b=(T=(1-(T=Math.sqrt(1-T)))/(1+T))*T;return H/(1+T)*(1+b*(.25+b*(.015625+.00390625*b)))*ye.zL},ye.zL=1.5707963267948966,ye.EC=3552713678800501e-30,ye}()}(ae||(ae={})),function(A){var ye=function(T){this.Yf=T,this.Mk=this.Yf.getCode(),0>this.Mk&&(this.Mk=0)};A.zY=ye;var H=function(){function T(b){b===void 0&&(b=null),this.Ej=null,this.Wn=!1,b!==null&&(this.Ej=new ye(b))}return T.prototype.Fc=function(){return this.Ej!=null?this.Ej.Mk:0},T.prototype.Qf=function(){var b=new T;return this.copyTo(b),b},T.prototype.copyTo=function(b){b.Ej=this.Ej,b.Wn=this.Wn},T.prototype.Lz=function(){this.Wn=!this.Wn},T.prototype.sm=function(){return this.Ej!=null?this.Ej.Yf:null},T.prototype.GJ=function(b){if(0>=b)throw A.i.O();if(b!=this.Fc()){if((b=A.qf.geogtran(b))==null)throw A.i.O("Geogtran not found.");this.Ej=new ye(b)}},T.prototype.wz=function(){return this.Ej==null?null:this.Ej.Yf.toString()},T.prototype.pX=function(b){if(b==null)throw A.i.O();var m=null;try{m=A.qf.fromString(A.Tc.PE_TYPE_GEOGTRAN,b)}catch{throw A.i.O()}this.Ej=new ye(m)},T.prototype.Nb=function(b){return b==this||!(!(b instanceof T)||(0>=this.Fc()||this.Fc()!=b.Fc())&&!this.sm().isEqual(b.sm()))&&this.Wn==b.Wn},T.prototype.toString=function(){var b="GeographicTransformation: "+this.wz();return 200T.I())},H.wE=function(T){return!(T.B()||T.K()!=1607&&T.K()!=1736||20>T.I())},H}();A.Wk=ye}(ae||(ae={})),function(A){A.ac=function(){function ye(){}return ye.OT=function(H){var T=new A.Ea;return T.rx(H.gs(),H.js()),T.Aj(H.gs(),H.hs()),T.Aj(H.fs(),H.hs()),T.Aj(H.fs(),H.js()),T},ye.Bh=function(H,T){return H===null?null:A.Gx.local().W(H,T,null)},ye.fY=function(H,T){var b=A.Ih.local();return H=new A.$c(H),b.W(H,T,null).next()},ye.km=function(H,T,b){return A.mp.local().W(H,T,b,null)},ye.gp=function(H,T,b){return A.Jx.local().W(H,T,b,null)},ye.RX=function(H,T,b){var m=A.Jx.local();for(H=new A.$c(H),T=new A.$c(T),b=m.W(H,T,b,null),m=[];(T=b.next())!=null;)m.push(T);return m},ye.Nb=function(H,T,b){return A.fj.local().W(3,H,T,b,null)},ye.OP=function(H,T,b){return A.fj.local().W(4,H,T,b,null)},ye.MS=function(H,T,b){var m=A.Zj.local();for(H=new A.$c(H),T=new A.$c(T),b=m.W(H,T,b,null),m=[];(T=b.next())!=null;)m.push(T);return m},ye.LP=function(H,T,b){var m=A.mp.local();for(H=new A.$c(H),T=new A.$c(T),b=m.W(H,T,b,null),m=[];(T=b.next())!=null;)m.push(T);return m},ye.Fa=function(H,T,b){return A.Zj.local().W(H,T,b,null)},ye.LS=function(H,T,b){if((H=A.Zj.local().W(H,T,b,null,1))===null)return[];if(H.K()===550){for(T=[],b=0;bH.Eb())return 0;var m=null;if(T!=null){if(m=T.Id(),b!=null&&m.Fc()!=b.Fc()&&m.pd!=b.pd)throw A.i.Zk()}else if(b!=null)throw A.i.O();H.K()==1736||H.K()==197?T=H.ng():A.ba.zd(H.K())?(T=new A.Ua(H.description)).pc(H,!0):T=H,H=0,T=T.Ha();for(var _=new A.h,C=new A.h;T.ab();)for(;T.Ia();){var D=T.ia();D.$p(_),D.Vr(C),H+=A.h.ub(_,C)}return m!==null&&b!==null&&(H=A.Uc.Ph(H,m,b)),H},ye.aP=function(H){return H.points!==void 0?ye.hS(H,H.hasZ!==void 0&&H.hasZ,H.hasM!==void 0&&H.hasM):H.rings!==void 0?ye.gG(H.rings,H.hasZ!==void 0&&H.hasZ,H.hasM!==void 0&&H.hasM,"P"):H.paths!==void 0?ye.gG(H.paths,H.hasZ!==void 0&&H.hasZ,H.hasM!==void 0&&H.hasM,"L"):H.x!==void 0?ye.iS(H):H.xmin!==void 0?ye.gS(H):null},ye.iS=function(H){if(H.x==null||H.x=="NaN")return new A.Ta;var T=new A.Ta(H.x,H.y);return H.z!==void 0&&H.z!==null&&T.sX(H.z),H.m!==void 0&&H.m!==null&&T.cX(H.m),T},ye.gS=function(H){if(H.xmin==null||H.xmin=="NaN")return new A.Hh;var T=new A.Hh(H.xmin,H.ymin,H.xmax,H.ymax);return H.zmin!==void 0&&H.zmin!==null&&T.setInterval(1,0,H.zmin,H.zmax),H.mmin!==void 0&&H.mmin!==null&&T.setInterval(2,0,H.mmin,H.mmax),T},ye.hS=function(H,T,b){var m=0,_=new A.ee,C=3*H.points.length;C%2!=0&&C++,2>C&&(C=2);var D=A.P.truncate(3*H.points.length/2);4>D?D=4:16>D&&(D=16),C=A.Zc.Fn(C,0);var L=A.Zc.Fn(D);D=A.Zc.Fn(D);for(var B=0;B=C?(le[be]=!1,Q+=1,L.add(q),B.add(_),q+=Me):le[be]=!0}for((m=3*q)%2!=0&&m++,2>m&&(m=2),4>(be=A.P.truncate(3*q/2))?be=4:16>be&&(be=16),m=A.Zc.Fn(m,0),_=A.Zc.Fn(be),C=A.Zc.Fn(be),be=Me=0;beL)throw A.i.O();this.Si.pa=D-B,this.Si.wa=L+B,this.ji.resize(0),this.ie=0,this.tg[0]=0},C.prototype.Wo=function(D,L){this.Si.pa=D-L,this.Si.wa=D+L,this.ji.resize(0),this.ie=0,this.tg[0]=0},C.prototype.next=function(){if(!this.Za.nq)throw A.i.Hb();if(0>this.ie)return-1;for(var D=!0;D;)switch(this.tg[this.ie]){case 1:D=this.AU();break;case 2:D=this.BU();break;case 3:D=this.CU();break;case 4:D=this.DU();break;case 5:D=this.AW();break;case 6:D=this.fT();break;case 7:D=this.oN();break;case 0:D=this.Bz();break;default:throw A.i.Ra()}return this.Qg!=-1?this.Op()>>1:-1},C.construct=function(D){var L=new C;return L.Za=D,L.ji.Jb(20),L.ie=-1,L},C.prototype.Bz=function(){return this.Qg=this.qH=this.Oi=this.Mc=-1,this.Za.ne!=null&&0=this.Si.pa?(this.gi=this.LR(),!1):(this.ie--,!0)},C.prototype.oN=function(){return this.Qg=this.gi,this.Qg!=-1&&_.iq(this.Op())?(this.gi=this.NF(),!1):(this.ie--,!0)},C.prototype.NF=function(){return this.Za.Uf?this.Za.bg.lb(this.Qg):this.Za.Vi.lb(this.Qg)},C.prototype.LR=function(){return this.Za.Uf?this.Za.bg.xe(this.Qg):this.Za.Vi.xe(this.Qg)},C.prototype.Op=function(){return this.Za.Uf?this.Za.bg.ka(this.Qg):this.Za.Vi.getData(this.Qg)},C}();A.AY=m;var _=function(){function C(D){this.Cm=this.bi=this.bg=this.Vi=this.Mm=this.Gj=this.ne=this.Hj=null,this.Uf=D,this.nq=this.Uv=!1}return C.prototype.mr=function(){this.Pk(!0)},C.prototype.Dr=function(D,L){if(!this.Uv)throw A.i.Hb();this.Hj.push(new A.Oc(D,L))},C.prototype.Hp=function(){if(!this.Uv)throw A.i.ga("invalid call");this.Uv=!1,this.nq=!0,this.Uf||(this.qS(),this.aw=this.Hj.length)},C.prototype.xj=function(D){if(!this.Uf||!this.nq)throw A.i.O("invalid call");if(this.kf==-1){var L=this.Hj.length;if(this.dA){var B=new A.ja(0);B.Jb(2*L),this.XI(B),this.bi.Jb(2*L),this.bi.resize(0),this.WI(B),this.Mm.resize(L,-1),this.Mm.Yj(-1,0,L),this.dA=!1}else this.Mm.Yj(-1,0,L);this.kf=this.Vu()}L=this.kG(D<<1,this.kf),B=this.bg.addElement(1+(D<<1),this.rz(L)),this.QJ(L,B),this.Mm.set(D,L),this.aw++},C.prototype.remove=function(D){if(!this.Uf||!this.nq)throw A.i.ga("invalid call");var L=this.Mm.get(D);if(L==-1)throw A.i.O("the interval does not exist in the interval tree");this.Mm.set(D,-1),this.aw--;var B=this.rz(L),q=this.bg.UR(B);this.bg.wd(this.rR(L),B),this.bg.wd(this.OR(L),B),(D=this.bg.size(B))==0&&(this.bg.HP(B),this.UJ(q,-1)),this.Gj.kd(L),B=this.PF(q);var Q=this.sj(q),oe=this.nk(q);for(L=0;!(0>1);Q!=-1?this.QJ(Q,this.Vi.addElement(this.rz(Q),q)):(Q=this.kG(q,this.kf),B.set(q>>1,Q))}},C.prototype.kG=function(D,L){var B=L,q=L,Q=-1,oe=0,le=this.bi.size-1,be=0,Me=D>>1,Ye=NaN,it=NaN,Lt=!0,Ut=this.yR(Me);for(Me=this.vR(Me);Lt;){oeJe&&(JeJe)L!=-1&&(L==B?(q=B,Ye=Je,it=(L=this.nk(B))!=-1?this.Pp(L):NaN):it>1];return C.iq(D)?L.pa:L.wa},C}();A.ur=_}(ae||(ae={})),function(A){var ye=function(){function H(T){if(T==null)throw A.i.ga("Invalid arguement");this.hf=T;var b=T.iR();b.cS()?T.ef.DG()?this.no=A.ui.PannableFold:this.no=A.ui.Clip:this.no=A.ui.DontClip,b.dS()?T.$f.DG()?this.Sm=A.ui.PannableFold:this.Sm=A.ui.Clip:this.Sm=A.ui.DontClip,this.Dm=b.Lr,this.hH=b.Xu,T=this.hf.nH,this.WG=T.ks(2147483648),this.Wv=T.ks(1073741824)}return H.Bh=function(T,b,m){return b.yw.Bh(T,m)},H.Tt=function(T,b,m,_){return T.yw.Tt(b,m,_)},H.St=function(T,b,m,_){if(m=0>m?b.length:m,(T=T.yw.Tt(b,m,_))==m)return T;for(var C=b=0;CC.H){var Me=A.l.construct(B.v-1,C.G,B.C+1,C.H);if((be=A.ti.Pu(be,Me,m,NaN,0,b)).B())return be}B.S()>2*C.S()&&(be=A.Ab.Jp(be,-2*C.S(),2*C.S(),m,!0,0,!0,b))}B=this.hH,(C=!isNaN(B))&&(be=A.Zl.local().W(be,B,b)),Me=Q?_.mk():null;var Ye=NaN;q&&(Ye=m.Bi());var it=_.Yr()!=null;if(this.WG)q&&(A.Ab.wr(m,Ye,be,L),C&&(q=m.jh(),B*=(Ye=m.tc().jh())/q)),A.Ab.vr(this.hf,be,le,L),C&&(q=m.tc().jh(),B*=(Ye=_.tc().jh())/q),m=be;else{var Lt=new A.Ua(be.description);Lt.yD(be),q&&(A.Ab.wr(m,Ye,Lt,L),C&&(q=m.jh(),B*=(Ye=m.tc().jh())/q)),A.Ab.vr(this.hf,Lt,le,L),C&&(q=m.tc().rm(),B*=(Ye=_.tc().rm())/q),le=NaN,Q?(Me=_.mk(),le=_.Bi()):isNaN(this.Dm)||(le=this.Dm),q=H.vv(m)|H.vv(_),Ye=10*oe.Yd(0),this.Wv&&(q=3,Ye=0),m=A.Ab.PQ(be,m,Lt,oe,le,b,q,Ye)}return it&&(m=A.Ab.SD(m,_,b)),Q&&(D||(Q=oe.Le().S(),m.Vg(0,0).S()>=Q-oe.Yd(0)&&(oe=Me.getNorthPoleLocation(),Q=Me.getSouthPoleLocation(),be=Me.getNorthPoleGeometry(),Me=Me.getSouthPoleGeometry(),le=0,be==A.Eg.PE_POLE_POINT&&oe!=A.Eg.PE_POLE_OUTSIDE_BOUNDARY&&(le=1),Me==A.Eg.PE_POLE_POINT&&Q!=A.Eg.PE_POLE_OUTSIDE_BOUNDARY&&(le|=2),le!==0&&(D=!0))),m=A.Ab.Hz(m,_,this.Sm,b),C&&(m=A.Zl.local().W(m,B,b)),A.Ab.Kx(_,m,L)),m.B()||(D&&(m=A.$l.local().W(m,_,!1,b)),T!=null&&(m=T.al(m,!1),this.yp(T,A.dm.reverse,m),m=T.bl(m,!1))),m},H.vv=function(T){if(T.Tb()!=2)return 0;var b=0,m=T.mk();T=m.getNorthPoleLocation();var _=m.getSouthPoleLocation(),C=m.getNorthPoleGeometry();return m=m.getSouthPoleGeometry(),C==A.Eg.PE_POLE_POINT&&T!=A.Eg.PE_POLE_OUTSIDE_BOUNDARY&&(b=1),m==A.Eg.PE_POLE_POINT&&_!=A.Eg.PE_POLE_OUTSIDE_BOUNDARY&&(b|=2),b},H.prototype.cW=function(T,b){var m=this.hf.ef,_=this.hf.$f,C=m.Tb(),D=_.Tb(),L=A.P.Hu(Math.min(T.I(),64)),B=A.Ua.kg(T);C==3&&(C=(m=(T=m.Li).hk()).Tb(),B=T.bl(B,!0),this.yp(T,A.dm.forward,B),B=T.al(B,!0)),T=null,D==3&&(D=(_=(T=_.Li).hk()).Tb());var q=C==2;C=(D=D==2)?_.tc():_;var Q=!D&&!this.Wv;if(q){if((B=A.Ab.OI(B,m,this.no,b)).B())return B}else{var oe=new A.l;B.yc(oe);var le=m.Le();if((oe.Gle.H)&&(oe=A.l.construct(oe.v-1,le.G,oe.C+1,le.H),(B=A.ti.Pu(B,oe,m,NaN,0,b)).B()))return B}var be=NaN;q&&(be=m.Bi()),oe=_.Yr()!=null,le=this.hH;var Me=!isNaN(le);if(Me&&(B=A.Zl.local().W(B,le,b)),this.WG)q&&A.Ab.wr(m,be,B,L),Me&&(q=m.jh(),le*=(be=m.tc().jh())/q),A.Ab.vr(this.hf,B,Q,L),Me&&(q=m.tc().jh(),le*=(be=_.tc().jh())/q),m=B;else{var Ye=new A.Ua(B.description);Ye.yD(B),q&&(A.Ab.wr(m,be,Ye,L),Me&&(q=m.jh(),le*=(be=m.tc().jh())/q)),A.Ab.vr(this.hf,Ye,Q,L),Me&&(q=m.tc().jh(),le*=(be=_.tc().jh())/q),Q=NaN,D?Q=_.Bi():isNaN(this.Dm)||(Q=this.Dm),q=H.vv(m)|H.vv(_),be=10*C.Yd(0),this.Wv&&(q=3,be=0),m=A.Ab.QQ(B,m,Ye,C,Q,b,q,be)}return oe&&(m=A.Ab.SD(m,_,b)),D&&(m=A.Ab.Hz(m,_,this.Sm,b),Me&&(m=A.Zl.local().W(m,le,b)),A.Ab.Kx(_,m,L)),m.B()||T!=null&&(m=T.al(m,!1),this.yp(T,A.dm.reverse,m),m=T.bl(m,!1)),m},H.prototype.$V=function(T,b){var m=(T.da()+T.S())/400;return m!=0?(m=A.Zl.local().W(T,m,b),m=this.QI(m,b),b=T.Ja(),m.dn(b)):(b=new A.Ta(T.Kp()),m=this.SI(b),b=T.Ja(),m.B()?b.Pa():(T.copyTo(b),T=m.D(),b.L(T.x,T.y,T.x,T.y))),b},H.prototype.aW=function(T,b){T=A.ba.kg(T);var m=this.hf.ef,_=this.hf.$f,C=m.Tb(),D=_.Tb(),L=A.P.Hu(Math.min(T.I(),64));if(C==3){var B=m.Li;C=(m=B.hk()).Tb(),T=B.al(T,!0),this.yp(B,A.dm.forward,T),T=B.bl(T,!0)}if(C==2){if(this.no==A.ui.Clip?T=A.Zj.local().W(T,m.ol(),m,b):m.Xc()&&(C=new A.l,T.yc(C),m.Le().contains(C)||(this.no==A.ui.PannableFold&&(T=A.Ab.nj(T,m)),A.Ab.Lt(T,m.Le(),m.Yd(0),!0),T=A.Ab.Hn(T,m,0,!0,0,b))),T.B())return T;A.Ab.wr(m,0,T,L)}else A.Ab.Lt(T,m.Le(),m.Yd(0),!0);return A.Ab.vr(this.hf,T,!1,L),m=0,C=!1,B=null,D==3&&(C=!0,D=(_=(B=_.Li).hk()).Tb()),(D=D==2)?m=_.Bi():isNaN(this.Dm)||(m=this.Dm),D&&this.Sm!=A.ui.Clip||(T=A.Ab.Hn(T,_.tc(),m,!1,0,b)),D&&(T=A.Ab.Hz(T,_,this.Sm,b),A.Ab.Kx(_,T,L),T.B())||C&&(T=B.al(T,!0),this.yp(B,A.dm.reverse,T),T=B.bl(T,!0)),T},H.prototype.yp=function(T,b,m){var _=m.I();if(_!=0){for(var C=m.vb(0),D=A.P.mg(200,0),L=[],B=0;B<_;){var q=Math.min(100,_-B);C.Xw(2*B,2*q,D,2,!0);for(var Q=0;QC.v+D&&Bb?this.yv(m,_):this.jv(m,_);case 1:var C=this.yv(m,_);return m=this.jv(m,_),A.mc.jq(C,m,b);case 2:throw A.i.ga("not implemented")}throw A.i.Ra()},T.prototype.ge=function(b,m){var _=this.qa-this.ta,C=this.ma-this.oa,D=_*_+C*C;return D==0?.5:(b=((b.x-this.ta)*_+(b.y-this.oa)*C)/D,m||(0>b?b=0:1(m=(m-this.oa)/b)||1(m=(m-this.ta)/b)||1(m=8881784197001252e-31*(Math.abs(_.x*m.y)+Math.abs(_.y*m.x)))?-1:b<-m?1:0},T.prototype.tp=function(b,m,_,C){var D=this.ta,L=this.oa,B=b-D,q=m-L;if((B=Math.sqrt(B*B+q*q))<=Math.max(_,6661338147750939e-31*B))return C&&B==0?NaN:0;if(B=b-this.qa,q=m-this.ma,(B=Math.sqrt(B*B+q*q))<=Math.max(_,6661338147750939e-31*B))return C&&B==0?NaN:1;if(B=this.qa-this.ta,q=this.ma-this.oa,0<(C=Math.sqrt(B*B+q*q))){var Q=1/C,oe=b-D,le=m-L,be=oe*(B*=Q)+le*(q*=Q),Me=17763568394002505e-31*(Math.abs(oe*B)+Math.abs(le*q)),Ye=B;if(B=-q,q=Ye,be<-(Me=Math.max(_,Me))||be>C+Me)return NaN;if(Math.abs(oe*B+le*q)<=Math.max(_,17763568394002505e-31*(Math.abs(oe*B)+Math.abs(le*q)))&&(.5>=(B=A.P.Tk(be*Q,0,1))?(q=this.ta+(this.qa-this.ta)*B,C=this.oa+(this.ma-this.oa)*B):(q=this.qa-(this.qa-this.ta)*(1-B),C=this.ma-(this.ma-this.oa)*(1-B)),A.h.Jy(q,C,b,m)<=_)){if(.5>B){if(A.h.Jy(q,C,D,L)<=_)return 0}else if(A.h.Jy(q,C,this.qa,this.ma)<=_)return 1;return B}}return NaN},T.prototype.Nb=function(b){return b!=null&&(b==this||b.constructor===this.constructor&&this.AM(b))},T.prototype.mD=function(b,m,_){var C=_?this.ta:this.qa;_=_?this.oa:this.ma;var D=new A.h;return D.x=b.qa-C,D.y=b.ma-_,!(m.Sh(D)>6661338147750939e-31*m.aD(D))||(D.x=b.ta-C,D.y=b.oa-_,m.Sh(D)<=6661338147750939e-31*m.aD(D))},T.prototype.lD=function(b){var m=new A.h;return m.x=this.qa-this.ta,m.y=this.ma-this.oa,!!this.mD(b,m,!1)&&(m.Uq(),!!this.mD(b,m,!0))},T.IM=function(b,m){var _=b.wu(m.ta,m.oa),C=b.wu(m.qa,m.ma);return!(0>_&&0>C||0<_&&0_&&0>C||0<_&&0(C=m.Rb())?b.lD(m):m.lD(b)))},T.GM=function(b,m,_){var C=A.h.construct(NaN,NaN),D=b.qa-b.ta,L=b.ma-b.oa,B=m.qa-m.ta,q=m.ma-m.oa,Q=B*L-D*q;if(Q==0)return C;var oe=8881784197001252e-31*(Math.abs(B*L)+Math.abs(D*q)),le=m.ta-b.ta,be=m.oa-b.oa,Me=B*be-le*q,Ye=Me/Q,it=Math.abs(Q);return Ye<-(B=(8881784197001252e-31*(Math.abs(B*be)+Math.abs(le*q))*it+oe*Math.abs(Me))/(Q*Q)+2220446049250313e-31*Math.abs(Ye))||Ye>1+B||(B=(q=D*be-le*L)/Q)<-(D=(8881784197001252e-31*(Math.abs(D*be)+Math.abs(le*L))*it+oe*Math.abs(q))/(Q*Q)+2220446049250313e-31*Math.abs(B))||B>1+D||(Ye=A.P.Tk(Ye,0,1),D=A.P.Tk(B,0,1),L=b.ic(Ye),Q=m.ic(D),(oe=new A.h).vc(L,Q),oe.length()>_&&(oe.add(L,Q),oe.scale(.5),Ye=b.ge(oe,!1),D=m.ge(oe,!1),b=b.ic(Ye),m=m.ic(D),b.sub(m),b.length()>_)||C.na(Ye,D)),C},T.JM=function(b,m,_,C){var D=0;if((b.ta==m.ta&&b.oa==m.oa||b.ta==m.qa&&b.oa==m.ma)&&(D++,!C))return 1;if(b.qa==m.ta&&b.ma==m.oa||b.qa==m.qa&&b.ma==m.ma){if(++D==2)return 2;if(!C)return 1}return m.xi(b.ta,b.oa,_)||m.xi(b.qa,b.ma,_)||b.xi(m.ta,m.oa,_)||b.xi(m.qa,m.ma,_)?1:C&&D!=0||T.IM(b,m)==0?0:1},T.Yx=function(b,m,_,C,D,L){var B=0,q=b.tp(m.ta,m.oa,L,!1),Q=b.tp(m.qa,m.ma,L,!1),oe=m.tp(b.ta,b.oa,L,!1),le=m.tp(b.qa,b.ma,L,!1);return isNaN(q)||(C!=null&&(C[B]=q),D!=null&&(D[B]=0),_!=null&&(_[B]=A.h.construct(m.ta,m.oa)),B++),isNaN(Q)||(C!=null&&(C[B]=Q),D!=null&&(D[B]=1),_!=null&&(_[B]=A.h.construct(m.qa,m.ma)),B++),B==2||isNaN(oe)||q==0&&oe==0||Q==0&&oe==1||(C!=null&&(C[B]=0),D!=null&&(D[B]=oe),_!=null&&(_[B]=A.h.construct(b.ta,b.oa)),B++),B==2||isNaN(le)||q==1&&le==0||Q==1&&le==1||(C!=null&&(C[B]=1),D!=null&&(D[B]=le),_!=null&&(_[B]=A.h.construct(m.qa,m.ma)),B++),0C[1]&&(b=C[0],C[0]=C[1],C[1]=b,D!=null&&(C=D[0],D[0]=D[1],D[1]=C),_!=null&&(D=A.h.construct(_[0].x,_[0].y),_[0]=_[1],_[1]=D)),B):(B=T.GM(b,m,L),isNaN(B.x)?0:(_!=null&&(_[0]=b.ic(B.x)),C!=null&&(C[0]=B.x),D!=null&&(D[0]=B.y),1))},T.prototype.$F=function(){return 0},T.prototype.qp=function(){},T.prototype.toString=function(){return"Line: ["+this.ta.toString()+", "+this.oa.toString()+", "+this.qa.toString()+", "+this.ma.toString()+"]"},T}(A.NC);A.zb=ye}(ae||(ae={})),function(A){var ye=function(){function H(){this.Lm=[],this.za=-1}return H.prototype.Ma=function(){return this.za},H.prototype.next=function(){if(this.Lm!=null&&this.Lm.length!=0){this.za++;var T=this.Lm[0];return this.Lm=1>=this.Lm.length?[]:this.Lm.slice(1),T}return this.Lm=null},H.prototype.VX=function(T){this.Lm.push(T)},H.prototype.re=function(){},H}();A.bL=ye}(ae||(ae={})),function(A){var ye;(ye=A.NL||(A.NL={}))[ye.enumFillRuleOddEven=0]="enumFillRuleOddEven",ye[ye.enumFillRuleWinding=1]="enumFillRuleWinding";var H=function(T){function b(m,_){var C=T.call(this)||this;if(C.yf=!1,C.Gq=null,C.uq=0,C.tq=0,C.Cj=null,C.Og=!1,C.nb=null,C.mb=null,C.Se=null,C.Nj=null,C.Td=null,C.vq=0,C.gb=0,C.zq=0,_===void 0)C.yf=m,C.Og=!1,C.vq=0,C.uq=0,C.tq=0,C.xa=0,C.description=A.fe.pg();else{if(_==null)throw A.i.O();C.yf=m,C.Og=!1,C.vq=0,C.uq=0,C.tq=0,C.xa=0,C.description=_}return C.Cj=null,C.gb=0,C}return Ne(b,T),b.prototype.vm=function(){return 0_)throw A.i.Ra();if(this.ec(m)){if(this.mb==null)throw A.i.Ra();var C=this.xa,D=this.Ca(m),L=this.Wc(m);this.fm(this.xa+1),this.oc();for(var B=0,q=this.description.Ba;Bm;_--)C=this.nb.read(_),this.nb.write(_,C+1);this.mb.FE(m,1)}},b.prototype.Cp=function(){if(this.vx(),m===void 0){this.Og=!1;var m=this.ea()-1}var _=this.mb.read(m);this.mb.write(m,1|_),this.Se!=null&&(m=this.Wc(m)-1,this.Se.write(m,1),this.Nj.write(m,-1))},b.prototype.ec=function(m){return(1&this.mb.read(m))!=0},b.prototype.Pn=function(m){if(this.ec(m))return!0;var _=this.Ca(m);return!(_>(m=this.Wc(m)-1))&&(_=this.Oa(_),m=this.Oa(m),_.rb(m))},b.prototype.Av=function(m){return(2&this.mb.read(m))!=0},b.prototype.pc=function(m,_){if(this.Ll(m.description),m.K()!=322)throw A.i.Ra();var C=new A.Ta;(_||this.B())&&(m.Vo(C),this.nf(C)),m.Ro(C),this.lineTo(C)},b.prototype.vp=function(m){var _=this.xa==0;this.rx(m.v,m.G),this.Aj(m.v,m.H),this.Aj(m.C,m.H),this.Aj(m.C,m.G),this.Cp(),this.Og=!1,_&&this.Nf(256,!1)},b.prototype.bd=function(m,_){if(!m.B()){for(var C=this.xa==0,D=new A.Ta(this.description),L=0;4>L;L++)m.If(_?4-L-1:L,D),L==0?this.nf(D):this.lineTo(D);this.Cp(),this.Og=!1,C&&!_&&this.Nf(256,!1)}},b.prototype.add=function(m,_){for(var C=0;C_&&(_=m.ea()-1),_>=m.ea()||0>C||0>D||D>m.tv(_))throw A.i.ga("index out of bounds");if(D!=0){var B=m.ec(_)&&C+D==m.tv(_);if(!B||D!=1){if(this.Og=!1,this.Ll(m.description),C=m.Ca(_)+C+1,L&&(D++,C--),B&&D--,B=this.xa,this.fm(this.xa+D),this.oc(),L){if(D==0)return;this.nb.add(this.xa),L=m.mb.read(_),L&=-5,this.yf&&(L|=1),this.mb.write(this.mb.size-1,L),this.mb.add(0)}else this.nb.write(this.mb.size-1,this.xa);L=0;for(var q=this.description.Ba;Lle||m.Aa[le]==null?this.Aa[L].Nn(oe*B,A.sa.te(Q),D*oe,oe*B):this.Aa[L].On(oe*B,m.Aa[le],oe*C,D*oe,!0,oe,oe*B)}if(this.vm()||m.Av(_))throw A.i.Ra();this.Qc(1993)}}},b.prototype.jJ=function(){for(var m=0,_=this.ea();m<_;m++)this.zW(m)},b.prototype.zW=function(m){if(this.oc(),m>=this.ea())throw A.i.O();var _=this.Ca(m),C=this.Ka(m);m=this.ec(m)?1:0;for(var D=0,L=this.description.Ba;Dm&&(m=_-1),m>=_)throw A.i.O();for(var C=this.Ca(m),D=this.Ka(m),L=0,B=this.description.Ba;L=_.ea())throw A.i.O();var L=this.ea();if(m>L)throw A.i.O();0>m&&(m=L),0>C&&(C=_.ea()-1),this.Og=!1,this.Ll(_.description),_.oc();var B=_.Ca(C),q=_.Ka(C),Q=this.xa,oe=_.ec(C)&&!D?1:0;this.fm(this.xa+q),this.oc();for(var le=m=m+1;D--)B=this.nb.read(D-1),this.nb.write(D,B+q);for(_.Av(C),this.mb.add(0),D=L-1;D>=m+1;D--)L=this.mb.read(D),L&=-5,this.mb.write(D+1,L);L=_.ER().read(C),L&=-5,this.yf&&(L|=1),this.mb.write(m,L)},b.prototype.Cz=function(m,_){var C=-1,D=this.ea();if(C>D)throw A.i.O();0>C&&(C=D),this.Og=!1;var L=this.xa;this.fm(this.xa+_),this.oc();var B=C=C+1;L--)B=this.nb.read(L-1),this.nb.write(L,B+_);for(this.mb.add(0),L=D-1;L>=C+1;L--)_=this.mb.read(L),_&=-5,this.mb.write(L+1,_);this.yf&&this.mb.write(C,1)},b.prototype.lG=function(m,_,C){var D=-1;if(0>m&&(m=this.ea()),m>this.ea()||D>this.Ka(m)||C>_.length)throw A.i.ga("index out of bounds");if(C!=0){m==this.ea()&&(this.nb.add(this.xa),this.yf?this.mb.add(1):this.mb.add(0)),0>D&&(D=this.Ka(m)),this.oc();var L=this.xa;this.fm(this.xa+C),this.oc();for(var B=0,q=this.description.Ba;Bm&&(m=this.ea()),m>=D||_>this.Ka(m))throw A.i.ga("index out of bounds");m==this.ea()&&(this.nb.add(this.xa),this.yf?this.mb.add(1):this.mb.add(0)),0>_&&(_=this.Ka(m));var L=this.xa;this.fm(this.xa+1),this.oc();var B=this.Ca(m);this.Aa[0].xj(2*(B+_),C,2*L),C=1;for(var q=this.description.Ba;Cm&&(m=C-1),m>=C||_>=this.Ka(m))throw A.i.ga("index out of bounds");this.oc();var D=this.Ca(m);0>_&&(_=this.Ka(m)-1),_=D+_,D=0;for(var L=this.description.Ba;D=m+1;C--)_=this.nb.read(C),this.nb.write(C,_-1);this.xa--,this.Rg--,this.Qc(1993)},b.prototype.pE=function(m,_,C,D){if(m=this.Ca(m)+_,(C=this.Ca(C)+D)m||C>this.I()-1)throw A.i.O();_=0,(D=this.Ha()).Wb(m);do{for(;D.Ia()&&(m=D.ia(),D.xb()!=C);)_+=m=m.Rb();if(D.xb()==C)break}while(D.ab());return _},b.prototype.aO=function(m,_,C){if(_=this.Ca(m)+_,C=this.Ca(m)+C,0>_||C>this.I()-1)throw A.i.O();var D=this.Ha();if(_>C){if(!this.ec(m))throw A.i.O("cannot iterate across an open path");D.EB()}var L=m=0;D.Wb(_);do L+=m,m=D.ia().Rb();while(D.xb()!=C);return L},b.prototype.ng=function(){return A.si.im(this,null)},b.prototype.FS=function(m,_,C){for(var D=m;D_){var B=this.vm(),q=0;_=this.xa}else B=this.Av(_),q=this.Ca(_),_=this.Wc(_);for(;q<_;q++){if(D.x=C.read(2*q),D.y=C.read(2*q+1),B){var Q=this.Nj.read(q);if(0<=Q)switch(7&this.Se.read(q)){case 2:L.x=this.Td.read(Q),L.y=this.Td.read(Q+1),m.Gh(L,L),this.Td.write(Q,L.x),this.Td.write(Q+1,L.y),L.x=this.Td.read(Q+3),L.y=this.Td.read(Q+4),m.Gh(L,L),this.Td.write(Q+3,L.x),this.Td.write(Q+4,L.y);break;case 4:throw A.i.Ra()}}m.Gh(D,D),C.write(2*q,D.x),C.write(2*q+1,D.y)}this.Qc(1993)}},b.prototype.rN=function(m){if(!this.B()){this.se(1),this.oc();for(var _=this.Aa[0],C=this.Aa[1],D=new A.Od,L=new A.Od,B=this.vm(),q=0;q=this.Ca(_))return _;_--}else _++;if(0<=_&&_=this.Ca(_)&&mC){for(_=0;__;){var D=_+(C-_>>1);if(m=(_=this.Wc(D))))return this.gb=D;_=D+1}}return this.gb=_},b.prototype.sz=function(){var m=this.I();if(!this.yf){m-=this.ea();for(var _=0,C=this.ea();_C.MR()))return!0;this.Cb.tD(null)}return C=A.Mx.create(this,m,_),this.Cb.tD(C),!0},b.prototype.dc=function(){var m=T.prototype.dc.call(this);if(!this.Bc()){var _=this.ea();this.nb!=null&&this.nb.Cn(m,0,_+1),this.mb!=null&&this.mb.Cn(m,0,_)}return m},b.prototype.UF=function(m){return this.Se!=null?this.Se.read(m):1},b.prototype.cc=function(m,_,C){var D=this.nz(m);if(m==this.Wc(D)-1&&!this.ec(D))throw A.i.ga("index out of bounds");this.oc();var L=this.Se,B=1;if(L!=null&&(B=7&L.read(m)),B!==1)throw A.i.Ra();if(_.Qr(),_=_.get(),C?_.Pf(A.fe.pg()):_.Pf(this.description),D=m==this.Wc(D)-1&&this.ec(D)?this.Ca(D):m+1,L=new A.h,this.D(m,L),_.Ec(L),this.D(D,L),_.Rc(L),!C)for(C=1,L=this.description.Ba;C=this.ea())throw A.i.O();if(this.B())_.Pa();else{if(this.Av(m))throw A.i.ga("not implemented");var C=this.vb(0),D=new A.h,L=new A.l;L.Pa();var B=this.Ca(m);for(m=this.Wc(m);Bthis.I())&&(m=A.ua.iE(this),this.Cb.RM(m),!0)},b.prototype.cM=function(){if(this.Cb==null&&(this.Cb=new A.Wk),this.Cb.Bo==null){this.Cb.sD(null);var m=A.ua.TN(this);this.Cb.sD(m)}},b.prototype.$o=function(m){this.zq=m},b.prototype.Kn=function(){return this.zq},b.prototype.yD=function(m){if(this==m)throw A.i.ga("MultiPathImpl.add");for(var _=this.ea(),C=0;C=(_=this.Wc(_))||m_?b.I():_,0>m||m>b.I()||_m?_:m,0>_||0>m)throw A.i.O();if(m!=0){_=m-0,m=this.xa,this.resize(this.xa+_);for(var C=0;C<_;C++)this.Db(m+C,b[0+C])}},T.prototype.yB=function(b){if(0>b||b>=this.I())throw A.i.ga("index out of bounds");this.oc();for(var m=0,_=this.description.Ba;m<_;m++)if(this.Aa[m]!=null){var C=A.sa.Wa(this.description.Fd(m));this.Aa[m].Gn(C*b,C,C*this.xa)}this.xa--,this.Rg--,this.Qc(1993)},T.prototype.resize=function(b){this.fm(b)},T.prototype.qp=function(){},T.prototype.Pa=function(){H.prototype.rD.call(this)},T.prototype.Pc=function(b){if(b instanceof A.Ed){if(this.B())return;this.oc();for(var m=this.Aa[0],_=new A.h,C=0;Cm||m>=this.xa||_b?b:H},ye.Vh=function(H,T){var b=5381;return((b=((b=((b=T!==void 0?(T<<5)+T+(255&H):(b<<5)+b+(255&H))<<5)+b+(H>>8&255))<<5)+b+(H>>16&255))<<5)+b+(H>>24&255)&2147483647},ye.wj=function(){throw Error("Not Implemented")},ye.XA=function(H){return ye.WT(H)+12345&2147483647},ye.SG=function(H){var T=32,b=H%ye.Px|0,m=H/ye.Px|0;return(T&=63)==0?H:(32>T?(H=b>>>T|m<<32-T,T=m>>T):(H=m>>T-32,T=0<=m?0:-1),T*ye.Px+(H>>>0))},ye.WT=function(H){var T=1103515245,b=65535&T;return((T-b)*(H|=0)|0)+(b*H|0)|0},ye.truncate=function(H){return 0>H?-1*Math.floor(Math.abs(H)):Math.floor(H)},ye.MAX_SAFE_INTEGER=Math.pow(2,53)-1,ye.MIN_SAFE_INTEGER=-ye.MAX_SAFE_INTEGER,ye.QC=65536,ye.Px=ye.QC*ye.QC,ye}()}(ae||(ae={})),function(A){var ye;(ye=A.xL||(A.xL={}))[ye.Project=0]="Project",ye[ye.Union=1]="Union",ye[ye.Difference=2]="Difference",ye[ye.Proximity2D=3]="Proximity2D",ye[ye.Relate=4]="Relate",ye[ye.Equals=5]="Equals",ye[ye.Disjoint=6]="Disjoint",ye[ye.Intersects=7]="Intersects",ye[ye.Within=8]="Within",ye[ye.Contains=9]="Contains",ye[ye.Crosses=10]="Crosses",ye[ye.Touches=11]="Touches",ye[ye.Overlaps=12]="Overlaps",ye[ye.Buffer=13]="Buffer",ye[ye.Distance=14]="Distance",ye[ye.Intersection=15]="Intersection",ye[ye.Clip=16]="Clip",ye[ye.Cut=17]="Cut",ye[ye.DensifyByLength=18]="DensifyByLength",ye[ye.DensifyByAngle=19]="DensifyByAngle",ye[ye.LabelPoint=20]="LabelPoint",ye[ye.GeodesicBuffer=21]="GeodesicBuffer",ye[ye.GeodeticDensifyByLength=22]="GeodeticDensifyByLength",ye[ye.ShapePreservingDensify=23]="ShapePreservingDensify",ye[ye.GeodeticLength=24]="GeodeticLength",ye[ye.GeodeticArea=25]="GeodeticArea",ye[ye.Simplify=26]="Simplify",ye[ye.SimplifyOGC=27]="SimplifyOGC",ye[ye.Offset=28]="Offset",ye[ye.Generalize=29]="Generalize",ye[ye.SymmetricDifference=30]="SymmetricDifference",ye[ye.ConvexHull=31]="ConvexHull",ye[ye.Boundary=32]="Boundary",ye[ye.SimpleRelation=33]="SimpleRelation";var H=function(){function T(){}return T.prototype.K=function(){return null},T.prototype.yn=function(){},T.prototype.Ku=function(){return!1},T}();A.Ge=H}(ae||(ae={})),function(A){var ye=function(H){function T(){return H!==null&&H.apply(this,arguments)||this}return Ne(T,H),T.prototype.K=function(){return 13},T.local=function(){return T.instance===null&&(T.instance=new T),T.instance},T.prototype.W=function(b,m,_,C,D){return b instanceof A.ba?(D=new A.$c(b),this.W(D,m,[_],!1,C).next()):C===!0?(_=new A.wC(b,m,_,!1,D),A.Ih.local().W(_,m,D)):new A.wC(b,m,_,!1,D)},T.instance=null,T}(A.Ge);A.vC=ye}(ae||(ae={})),function(A){var ye=function(){function H(T,b,m,_,C){this.za=-1,this.Sd=T,this.Vz=b,this.Es=m,this.nT=new A.l,this.nT.Pa(),this.ho=-1,this.Vb=C}return H.prototype.next=function(){for(var T;(T=this.Sd.next())!=null;)return this.za=this.Sd.Ma(),this.ho+1=T.I():T.ea()==1&&(2>=T.I()||A.au.EG(T,0)))},H}();A.yC=ye}(ae||(ae={})),function(A){var ye=function(H){function T(){return H!==null&&H.apply(this,arguments)||this}return Ne(T,H),T.prototype.K=function(){return 17},T.local=function(){return T.instance===null&&(T.instance=new T),T.instance},T.prototype.W=function(b,m,_,C,D){return new A.iL(b,m,_,C,D)},T.instance=null,T}(A.Ge);A.hL=ye}(ae||(ae={})),function(A){var ye=function(){function H(T,b,m,_,C){if(this.Vf=null,b==null||m==null)throw A.i.ga("invalid argument");this.kT=T,this.iA=b,this.gH=m,T=A.ua.ov(b,m),this.ra=A.ua.Xd(_,T,!0),this.fH=-1,this.od=C}return H.prototype.Ma=function(){return 0},H.prototype.next=function(){return this.MQ(),++this.fHthis.Vf.length&&(this.Vf.length=0)},H.prototype.NQ=function(){var T=new A.ja(0),b=new A.hd,m=b.WE(),_=b.Ib(this.iA),C=b.Ib(this.gH),D=new A.Hg;try{D.Gt(b,this.ra,this.od),D.fl(m,_,C,T);var L=b.Ke(_),B=new A.Ea,q=new A.Ea;for(this.Vf.length=0,this.Vf.push(B),this.Vf.push(q),_=0;_=m)throw A.i.O();return new A.jL(b,m,_)},T.instance=null,T}(A.Ge);A.Zl=ye}(ae||(ae={})),function(A){var ye=function(){function H(T,b){this.za=-1,this.Sd=T,this.Rs=b}return H.prototype.Ma=function(){return this.za},H.prototype.next=function(){var T;return(T=this.Sd.next())!=null?(this.za=this.Sd.Ma(),this.IP(T)):null},H.prototype.IP=function(T){if(T.B()||1>T.Eb())return T;var b=T.K();if(b==1736||b==1607)return this.Iy(T);if(A.ba.zd(b))return this.KP(T);if(b==197)return this.JP(T);throw A.i.Ra()},H.prototype.KP=function(T){if(T.Rb()<=this.Rs)return T;var b=new A.Ua(T.description);return b.pc(T,!0),this.Iy(b)},H.prototype.JP=function(T){var b=new A.Ea(T.description);b.bd(T,!1);var m=new A.l;return T.A(m),T=m.da(),m.S()<=this.Rs&&T<=this.Rs?b:this.Iy(b)},H.prototype.Iy=function(T){for(var b=T.Ja(),m=T.Ha();m.ab();)for(var _=!0;m.Ia();){var C=m.ia();if(C.K()!=322)throw A.i.ga("not implemented");var D=m.Qn(),L=C.Rb();if(L>this.Rs){var B=Math.ceil(L/this.Rs);L=new A.Ta(T.description),_&&(C.Vo(L),b.nf(L));var q=_=1/B,Q=0;for(--B;QL)return b;var B=b.K(),q=m.K(),Q=new A.l,oe=new A.l,le=new A.l;b.A(Q),m.A(oe),le.L(Q),le.$b(oe);var be=(le=A.ua.Xd(_,le,!0))*Math.sqrt(2)*1.00001,Me=new A.l;if(Me.L(Q),Me.X(be,be),!Me.isIntersecting(oe))return b;if(D==1&&L==2)return T.FV(b,m,q,_,C);if(B==33)switch(A.Xk.zd(q)?(_=new A.Ua(m.description),_.pc(m,!0)):_=m,q){case 1736:return T.SU(b,_,le);case 1607:return T.TU(b,_,le);case 550:return T.QU(b,_,le);case 197:return T.PU(b,_,le);case 33:return T.RU(b,_,le);default:throw A.i.O()}else if(B==550)switch(q){case 1736:return T.iU(b,m,le);case 197:return T.gU(b,m,le);case 33:return T.hU(b,m,le)}return A.Hg.km(b,m,_,C)},T.SU=function(b,m,_){return A.jd.FG(m,b,_)==0?b:b.Ja()},T.TU=function(b,m,_){var C=b.D();m=m.Ha();for(var D=_*Math.sqrt(2)*1.00001,L=D*D,B=new A.l;m.ab();)for(;m.Ia();){var q=m.ia();if(q.A(B),B.X(D,D),B.contains(C)){if(q.ss(C,_))return b.Ja();var Q=q.bc();if(A.h.zc(C,Q)<=L||(Q=q.xc(),A.h.zc(C,Q)<=L))return b.Ja()}}return b},T.QU=function(b,m,_){var C=m.vb(0);m=m.I();var D=b.D(),L=new A.h;_=_*Math.sqrt(2)*1.00001,_*=_;for(var B=0;Bm.I()?this.bE(b,m,_):(this.Pt(),b=this.bE(m,b,_),this.Pt(),b):b.K()==550&&A.ba.Ic(m.K())?(b=this.cE(m,b,_),this.Pt(),b):m.K()==550&&A.ba.Ic(b.K())?this.cE(b,m,_):b.K()==550&&m.K()==550?b.I()>m.I()?this.dE(b,m):(this.Pt(),b=this.dE(m,b),this.Pt(),b):0},T.prototype.bE=function(b,m,_){var C=b.Ha(),D=m.Ha(),L=new A.l,B=new A.l,q=17976931348623157e292;if(!_&&this.lY(b,m,C,D))return 0;for(;C.ab();)for(;C.Ia();)if((b=C.ia()).A(L),!(L.px(this.qh)>q)){for(;D.ab();)for(;D.Ia();)if((m=D.ia()).A(B),L.px(B)L)){for(var oe=0;oeC)){for(var oe=0;oeT.Ka(b))){var C=T.Ca(b),D=T.Wc(b)-1,L=T.vb(0),B=T.ec(b),q=new A.ja(0);q.Jb(T.Ka(b)+1);var Q=new A.ja(0);for(Q.Jb(T.Ka(b)+1),q.add(B?C:D),q.add(C),C=new A.h;1this.yH&&B>D&&(C=_,D=B)}return C},H.prototype.re=function(){},H}();A.mL=ye}(ae||(ae={})),function(A){var ye=function(H){function T(){return H!==null&&H.apply(this,arguments)||this}return Ne(T,H),T.prototype.K=function(){return 29},T.prototype.W=function(b,m,_,C){return b instanceof A.ba?(b=new A.$c(b),this.W(b,m,_,C).next()):new A.mL(b,m,_,C)},T.local=function(){return T.instance===null&&(T.instance=new T),T.instance},T.instance=null,T}(A.Ge);A.zC=ye}(ae||(ae={})),function(A){var ye=function(H){function T(){return H!==null&&H.apply(this,arguments)||this}return Ne(T,H),T.prototype.K=function(){return 21},T.local=function(){return T.instance===null&&(T.instance=new T),T.instance},T.prototype.W=function(b,m,_,C,D,L,B,q){return b instanceof A.ba?(q=new A.$c(b),this.W(q,m,_,[C],D,L,!1,B).next()):B===!0?(_=new A.BC(b,m,_,C,D,!1,!1,q),A.Ih.local().W(_,m,q)):new A.BC(b,m,_,C,D,!1,!1,q)},T.instance=null,T}(A.Ge);A.AC=ye}(ae||(ae={})),function(A){var ye=function(){function H(T,b,m,_,C,D,L,B){if(D)throw A.i.Fe();if(b==null)throw A.i.O();this.za=-1,this.Os=T,this.wg=b,this.Ae=m,this.Es=_,this.bo=C,this.ho=-1,this.Vb=B,this.oT=new A.l,this.oT.Pa()}return H.prototype.next=function(){for(var T;(T=this.Os.next())!=null;)return this.za=this.Os.Ma(),this.ho+1b.Eb())return 0;if(_==4)throw A.i.Fe();var C=A.cb.tc(m),D=A.cb.xv(C),L=A.cb.gv(C);D*=2-D;var B=C.Id().ci,q=b.K();if(q==1736||q==197)var Q=b.ng();else A.ba.zd(q)?(Q=new A.Ua(b.description)).pc(b,!0):Q=b;if(C.Nb(m)==0){if(A.cb.Xc(m)){Q=A.Jh.nj(Q,m),q==1607&&Q==b&&(Q=A.ba.kg(b)),b=new A.Oc,A.cb.ih(m).en(b),q=0;for(var oe=Q.I();q=this.Hi||7C||m==0&&b==550&&this.Fj==33?this.iJ():H.CB(T,_);if((this.Hi==-1||this.Hi==4)&&b==197&&this.Fj==197)return m=this.Pe,b=new A.l,T.A(b),_=new A.l,m.A(_),b.Fa(_),m=new A.Hh,T.copyTo(m),m.Zo(b),m;if(b==197&&A.ba.uf(this.Fj)==0||this.Fj==197&&A.ba.uf(b)==0)return _=b==197?T:this.Pe,T=b==197?this.Pe:T,b=new A.l,_.A(b),A.Vd.clip(T,b,m,0);if(A.ba.uf(b)==0&&0B&&(B=m.sz()),D=m.I()+_.I(),B*_.I()>Math.log(D)*D*4)return null;D=null,B=_.Ha(),q!=null&&q.Gb!=null&&(D=q.Gb),D==null&&20<_.I()&&(D=A.ua.iE(_)),T=T.Ja(),_=null,q=m.Ha(),Q=[0,0,0,0,0,0,0,0,0],oe=new A.ce(0),le=new A.jg,be=-1;for(var Me=0,Ye=0,it=0Je){if(D!=null)for(_==null?_=D.qR(Rt,C):_.Wo(Rt,C),Je=_.next();Je!=-1;Je=_.next()){B.Wb(D.ka(Je)),Je=B.ia();var ri=Rt.Fa(Je,null,Q,null,C);for(Je=0;JeUt?(be=q.xb()-m.Ca(Lt),Me=1,Ut=Ut==0?3:2):Me++:(T.pc(ti,Ut==0),Ut=1);break;case 0:Ut=0,be=-1,Me=0;break;default:return null}ti=ii}}}else{if(0>(Je=this.LD(b,Rt.bc(),C)))return null;Je==1?(2>Ut&&(be=q.xb()-m.Ca(Lt),Ut=Ut==0?3:2),Me++):(be=-1,Me=0)}oe.clear(!1)}else Je!=0&&Je==1&&(Ut==0?(Ut=3,be=q.xb()-m.Ca(Lt)):Ut==1?(Ut=2,be=q.xb()-m.Ca(Lt)):Me++)}2<=Ut&&(T.Fr(m,Lt,be,Me,Ut==3),be=-1)}return T},H.prototype.LD=function(T,b,m){return A.Fg.ym(T,b,m)},H.prototype.MD=function(T,b,m){var _=b.bc();b=b.xc();var C=A.Fg.ym(T,_,m),D=A.Fg.ym(T,b,m);return C==1&&D==0||C==0&&D==1?-1:C==0||D==0?0:C==1||D==1?1:((C=new A.h).add(_,b),C.scale(.5),(T=A.Fg.ym(T,C,m))==0?0:T==1?1:-1)},H.CB=function(T,b){return b?T:T.Ja()},H.prototype.iJ=function(){return this.tH==null&&(this.tH=this.Pe.Ja()),this.tH},H.prototype.re=function(){},H}();A.CC=ye}(ae||(ae={})),function(A){var ye=function(H){function T(){return H!==null&&H.apply(this,arguments)||this}return Ne(T,H),T.prototype.K=function(){return 28},T.local=function(){return T.instance===null&&(T.instance=new T),T.instance},T.prototype.W=function(b,m,_,C,D,L,B){return b instanceof A.ba?(b=new A.$c(b),this.W(b,m,_,C,D,L,B).next()):new A.sL(b,m,_,C,D,L,B)},T.instance=null,T}(A.Ge);A.DC=ye}(ae||(ae={})),function(A){var ye=function(){function H(T,b,m,_,C,D,L){this.za=-1,this.Sd=T,this.Oj=b,this.La=m,this.Mi=_,this.xA=C,this.pH=D,this.od=L}return H.prototype.next=function(){var T=this.Sd.next();return T!=null?(this.za=this.Sd.Ma(),this.eL(T)):null},H.prototype.Ma=function(){return this.za},H.prototype.eL=function(T){var b=0>=this.pH?A.ua.mj(this.Oj,T,!1):this.pH;return A.DK.W(T,this.La,this.Mi,this.xA,b,this.od)},H.prototype.re=function(){},H}();A.sL=ye}(ae||(ae={})),function(A){var ye;(ye=A.IK||(A.IK={}))[ye.clipToDomainOnly=1]="clipToDomainOnly",ye[ye.clipWithHorizon=2]="clipWithHorizon",ye[ye.foldAndClipWithHorizon=3]="foldAndClipWithHorizon";var H=function(T){function b(){return T!==null&&T.apply(this,arguments)||this}return Ne(b,T),b.prototype.K=function(){return 0},b.local=function(){return b.instance===null&&(b.instance=new b),b.instance},b.prototype.W=function(m,_,C){return m instanceof A.ba?(m=new A.$c(m),this.W(m,_,C).next()):new A.tL(m,_,C)},b.prototype.transform=function(m,_,C,D){return A.du.transform(m,_,C,D,!0)},b.prototype.St=function(m,_,C,D){return A.du.St(m,_,C,D)},b.instance=null,b}(A.Ge);A.Gx=H}(ae||(ae={})),function(A){var ye=function(){function H(T,b,m){this.za=-1,this.Sd=T,this.HT=b,this.od=m}return H.prototype.next=function(){var T=this.Sd.next();return T!=null?(this.za=this.Sd.Ma(),A.du.Bh(T,this.HT,this.od)):null},H.prototype.Ma=function(){return this.za},H.prototype.re=function(){},H}();A.tL=ye}(ae||(ae={})),function(A){var ye=function(){function T(){}return T.prototype.reset=function(){this.rh=this.zk=-1,this.ws=this.mq=!1},T.prototype.vQ=function(b,m,_){for(b.Wb(m,_);b.Ia();){var C=b.ia();if((C=C.Rb())!=0)return b.xb()}for(b.Wb(m,_);b.zz();)if((C=(C=b.ni()).Rb())!=0)return b.xb();return-1},T.prototype.wQ=function(b,m){for(b.Wb(m,-1);b.zz();)if(b.ni().Rb()!=0)return b.xb();return-1},T.prototype.uQ=function(b,m){for(b.Wb(m,-1),b.ia();b.Ia();)if(b.ia().Rb()!=0)return b.xb();return-1},T.prototype.tQ=function(b,m,_,C){if(this.zk=this.vQ(m,_,C),this.zk!=-1){m.Wb(this.zk,-1);var D=m.ia(),L=D.ic(D.ge(b,!1));if(_=A.h.zc(L,b),(C=new A.h).N(L),C.sub(D.bc()),(L=new A.h).N(b),L.sub(D.bc()),this.mq=0>C.yi(L),this.rh=this.uQ(m,this.zk),this.rh!=-1){m.Wb(this.rh,-1);var B=(D=m.ia()).ge(b,!1);B=D.ic(B);var q=A.h.zc(B,b);q>_?this.rh=-1:(C.N(B),C.sub(D.bc()),L.N(b),L.sub(D.bc()),this.ws=0>C.yi(L))}this.rh==-1&&(this.rh=this.wQ(m,this.zk),this.rh!=-1&&(m.Wb(this.rh,-1),B=(D=m.ia()).ge(b,!1),B=D.ic(B),(q=A.h.zc(B,b))>_?this.rh=-1:(C.N(B),C.sub(D.bc()),L.N(b),L.sub(D.bc()),this.ws=0>C.yi(L),b=this.zk,this.zk=this.rh,this.rh=b,b=this.mq,this.mq=this.ws,this.ws=b)))}},T.prototype.YN=function(b,m,_,C,D){return _=_.Ha(),this.tQ(b,_,C,D),this.zk!=-1&&this.rh==-1?this.mq:this.zk!=-1&&this.rh!=-1?this.mq==this.ws?this.mq:(_.Wb(this.zk,-1),b=_.ia().lg(),_.Wb(this.rh,-1),m=_.ia().lg(),0<=b.yi(m)):m},T}(),H=function(T){function b(){return T!==null&&T.apply(this,arguments)||this}return Ne(b,T),b.local=function(){return b.instance===null&&(b.instance=new b),b.instance},b.prototype.K=function(){return 3},b.prototype.iz=function(m,_,C){var D;if(D===void 0&&(D=!1),m.B())return new A.bm;_=_.D();var L=m,B=m.K();switch(B==197&&((L=new A.Ea).bd(m,!1),B=1736),B){case 33:return this.sI(L,_);case 550:return this.eI(L,_);case 1607:case 1736:return this.XT(L,_,C,D);default:throw A.i.ga("not implemented")}},b.prototype.jz=function(m,_){if(m.B())return new A.bm;_=_.D();var C=m,D=m.K();switch(D==197&&((C=new A.Ea).bd(m,!1),D=1736),D){case 33:return this.sI(C,_);case 550:case 1607:case 1736:return this.eI(C,_);default:throw A.i.ga("not implemented")}},b.prototype.kz=function(m,_,C,D){if(0>D)throw A.i.O();if(m.B())return[];_=_.D();var L=m,B=m.K();switch(B==197&&((L=new A.Ea).bd(m,!1),B=1736),B){case 33:return this.OU(L,_,C,D);case 550:case 1607:case 1736:return this.oU(L,_,C,D);default:throw A.i.ga("not implemented")}},b.prototype.XT=function(m,_,C,D){if(m.K()==1736&&C&&(C=new A.l,m.A(C),C=A.ua.Xd(null,C,!1),(D?A.jd.Zd(m,_,0):A.jd.Zd(m,_,C))!=0)){var L=new A.bm(_,0,0);return D&&L.RJ(!0),L}var B=m.Ha();L=new A.h;for(var q=C=-1,Q=17976931348623157e292,oe=0;B.ab();)for(;B.Ia();){var le=B.ia();le=le.ic(le.ge(_,!1));var be=A.h.zc(le,_);beA.h.Wq(_,le.bc(),le.xc()),1=_||(m.length=D),m.slice(0)},b.instance=null,b}(A.Ge);A.Hx=H}(ae||(ae={})),function(A){var ye=function(H){function T(){return H!==null&&H.apply(this,arguments)||this}return Ne(T,H),T.prototype.K=function(){return 4},T.prototype.W=function(b,m,_,C,D){return A.cm.tB(b,m,_,C,D)},T.local=function(){return T.instance===null&&(T.instance=new T),T.instance},T.prototype.Ku=function(b){return A.Xt.ry(b)},T.prototype.yn=function(b,m,_){A.Xt.xD(b,m,_)},T.instance=null,T}(A.Ge);A.uL=ye}(ae||(ae={})),function(A){var ye=function(H){function T(){return H!==null&&H.apply(this,arguments)||this}return Ne(T,H),T.prototype.K=function(){return 33},T.prototype.W=function(b,m,_,C,D){return b===1073741824?!A.vd.uB(m,_,C,4,D):A.vd.uB(m,_,C,b,D)},T.local=function(){return T.instance===null&&(T.instance=new T),T.instance},T.prototype.Ku=function(b){return A.Xt.ry(b)},T.prototype.yn=function(b,m,_){A.Xt.xD(b,m,_)},T.instance=null,T}(A.Ge);A.fj=ye}(ae||(ae={})),function(A){var ye=function(){function H(T,b,m,_){if(this.od=_,this.lT=m,this.za=-1,T==null)throw A.i.O();this.Ak=T,this.Oj=b}return H.prototype.next=function(){var T;if((T=this.Ak.next())!=null){if(this.za=this.Ak.Ma(),this.od!=null&&!this.od.progress(-1,-1))throw A.i.hu("user_canceled");return this.$B(T)}return null},H.prototype.Ma=function(){return this.za},H.prototype.$B=function(T){if(T==null)throw A.i.O();return A.Ix.YJ(T,this.Oj,this.lT,this.od)},H.prototype.re=function(){},H}();A.vL=ye}(ae||(ae={})),function(A){var ye=function(H){function T(){return H!==null&&H.apply(this,arguments)||this}return Ne(T,H),T.prototype.K=function(){return 26},T.prototype.W=function(b,m,_,C){return b instanceof A.ba?(b=new A.$c(b),this.W(b,m,_,C).next()):new A.vL(b,m,_,C)},T.prototype.ts=function(b,m,_,C,D){return 0<(C!==void 0?A.Ix.ts(b,m,_,C,D):A.Ix.ts(b,m,!1,null,_))},T.local=function(){return T.instance===null&&(T.instance=new T),T.instance},T.instance=null,T}(A.Ge);A.$l=ye}(ae||(ae={})),function(A){var ye=function(){function D(){this.Aq=0}return D.prototype.iX=function(L){this.Aq&=-2,this.Aq|=L?1:0},D.prototype.Yp=function(){return(1&this.Aq)!=0},D.prototype.SF=function(){return this.Yp()?0:1},D}();A.tY=ye;var H=function(){},T=function(D,L,B,q){this.x=D,this.y=L,this.Ci=B,this.zm=q},b=function(){function D(L){this.Ce=L}return D.prototype.compare=function(L,B,q){return L=L.ka(q),B=this.Ce.lf.read(2*B),0>(B-=L=this.Ce.lf.read(2*L))?-1:0le?1:0},D}(),_=function(){function D(L,B){this.TI=new A.h,this.parent=L,this.ZR=B}return D.prototype.qr=function(L,B,q){var Q=this.parent,oe=this.ZR;q.Wd(L,B,function(le,be){return Q.Oh(le,be,oe)})},D.prototype.bq=function(L){return L=this.parent.ii.get(L),this.parent.lf.uc(2*(L>>1),this.TI),this.TI.y+(1&L?this.parent.Qj:-this.parent.Qj)},D}(),C=function(){function D(L,B,q,Q,oe){this.iH=L.description,this.Y=L,this.Sg=B,this.Qj=A.ua.mj(this.Sg,L,!1),this.Do=A.ua.mj(this.Sg,L,!0),this.sA=q,this.jT=this.iH.Ba,this.hb=[],this.ro=[],this.oh=new A.lp,this.fb=new A.$j,this.le=new A.Nd,this.UG=this.sl=oe}return D.prototype.$S=function(){return this.UG=!0,(!A.ba.Ic(this.Y.K())||this.BE()&&this.yE(!1))&&this.hO()?A.ba.Ic(this.Y.K())?this.kO()?this.Y.K()==1607?this.mO()?2:0:this.nO()?this.oO():0:0:2:0},D.prototype.fC=function(L,B){var q=this.lf.read(2*L);L=this.lf.read(2*L+1);var Q=this.lf.read(2*B);B=this.lf.read(2*B+1);var oe=!A.$t.Ev(q,L,Q,B,this.Qj*this.Qj);return oe||this.Y.Eb()!=0&&q==Q&&L==B},D.prototype.BE=function(){for(var L=this.Y,B=L.yf?3:2,q=0,Q=L.ea();qthis.Qj)){if(L&&Q){var le=oe.yv(1,0);if(oe=oe.yv(1,0),Math.abs(oe-le)>B)continue}return this.le=new A.Nd(2,q.xb(),-1),!1}}return!0},D.prototype.hO=function(){var L=this.Y,B=null;A.ba.Ic(this.Y.K())&&(B=this.Y);var q=(this.UG||this.sl)&&B!=null,Q=L.I();this.lf=L.vb(0),this.ii=new A.ja(0),this.ii.Jb(2*Q),this.hi=new A.ja(0),this.hi.Jb(2*Q),q&&(this.Hl==null&&(this.Hl=new A.ja(0)),this.Hl.Jb(Q));for(var oe=L=0;oe=B.Wc(L);)L++;this.Hl.add(L)}for(new A.Zt().sort(this.hi,0,2*Q,new _(this,q)),this.fb.clear(),this.fb.Xo(new b(this)),this.fb.Ee(Q),B=0,Q*=2;B>1,(1&L)==0){if(L=this.fb.addElement(q,-1),(oe=this.fb.xe(L))!=-1&&!this.fC(this.fb.ka(oe),q))return this.le=new A.Nd(3,q,this.fb.ka(oe)),!1;var le=this.fb.lb(L);if(le!=-1&&!this.fC(this.fb.ka(le),q))return this.le=new A.Nd(3,q,this.fb.ka(le)),!1}else if(L=this.fb.search(q,-1),oe=this.fb.xe(L),le=this.fb.lb(L),this.fb.wd(L,-1),oe!=-1&&le!=-1&&!this.fC(this.fb.ka(oe),this.fb.ka(le)))return this.le=new A.Nd(3,this.fb.ka(oe),this.fb.ka(le)),!1;return!0},D.prototype.kO=function(){return 10>this.Y.I()?this.iO():this.jO()},D.prototype.jO=function(){var L=new A.hd;L.Ib(this.Y);var B=new A.Nd;return!A.bu.fI(!1,L,this.Qj,B,this.od)||(B.Lo=L.Va(B.Lo),B.Mo=L.Va(B.Mo),this.le.Yt(B),!1)},D.prototype.iO=function(){var L=this.Y,B=L.Ha();for(L=L.Ha();B.ab();)for(;B.Ia();){var q=B.ia();if(!B.Sn()||!B.VS()){L.wW(B);do for(;L.Ia();){var Q=L.ia();if((Q=q.Br(Q,this.Qj,!0))!=0)return this.le=new A.Nd(Q==2?5:4,B.xb(),L.xb()),!1}while(L.ab())}}return!0},D.prototype.nO=function(){var L=this.Y;this.hb.length=0,this.ro.length=0,this.ag=L.Ha(),this.ag.EB();var B=new A.ja(0);B.Jb(10);var q=NaN,Q=0,oe=0;for(L=2*L.I();oe>=1;var be=this.lf.read(2*le),Me=this.lf.read(2*le+1);if(B.size!=0&&(be!=q||Me!=Q)){if(!this.LI(B))return!1;B?.clear(!1)}B.add(le),q=be,Q=Me}}return!!this.LI(B)},D.prototype.mO=function(){for(var L=this.Y,B=Array(L.ea()),q=0,Q=L.ea();q>1;this.lf.uc(2*le,oe);var be=B[q=this.Hl.get(le)],Me=L.Ca(q),Ye=L.Wc(q)-1;Q.gl=le==Me||le==Ye,Q.jy=this.sl?!be&&Q.gl:Q.gl,Q.Ci=q,Q.x=oe.x,Q.y=oe.y,Q.zm=le;for(var it=new H,Lt=1,Ut=this.hi.size;Lt>1,this.lf.uc(2*le,oe),(q=this.Hl.get(le))!=Q.Ci&&(be=B[q],Me=L.Ca(q),Ye=L.Wc(q)-1);var Je=le==Me||le==Ye,Rt=this.sl?!be&&Q.gl:Q.gl;if(it.x=oe.x,it.y=oe.y,it.Ci=q,it.zm=le,it.jy=Rt,it.gl=Je,it.x==Q.x&&it.y==Q.y){if(this.sl){if(!(it.jy&&Q.jy||it.Ci==Q.Ci&&(it.gl||Q.gl)))return this.le=new A.Nd(8,it.zm,Q.zm),!1}else if(!it.gl||!Q.gl)return this.le=new A.Nd(5,it.zm,Q.zm),!1}q=Q,Q=it,it=q}return!0},D.prototype.EE=function(){for(var L=this.Y,B=[],q=-1,Q=!1,oe=0,le=L.ea();oe>1;this.lf.uc(2*be,Q),oe=this.Hl.get(be),q=new T(Q.x,Q.y,oe,be,B[oe]),L=[];var Me=1;for(le=this.hi.size;Me>1,this.lf.uc(2*be,Q),oe=this.Hl.get(be),(oe=new T(Q.x,Q.y,oe,be,B[oe])).x==q.x&&oe.y==q.y){if(oe.Ci==q.Ci)return this.le=new A.Nd(9,oe.zm,q.zm),!1;0<=B[oe.Ci]&&B[oe.Ci]==B[q.Ci]&&(L.length!=0&&L[L.length-1]==q||L.push(q),L.push(oe))}q=oe}if(L.length==0)return!0;for(oe=new A.lp(!0),A.P.bv(B,-1),Q=-1,(Me=new A.h).Sc(),q=0,le=L.length;q=L.He())return this.le=new A.Nd(6,L.ea()==1?1:-1,-1),0;if(L.ea()==1)return this.sl&&!this.EE()?0:2;this.vo=A.ja.rf(L.ea(),0),this.EA=A.ja.rf(L.ea(),-1);for(var B=-1,q=0,Q=0,oe=L.ea();Qle?0:256),0B||q>=1,(Q=this.lf.read(2*q+1))!=this.Oo&&L.size!=0){if(!this.vt(L))return 0;L?.clear(!1)}L.add(q),this.Oo=Q}return 0oe.ma){var be=this.ag.xb(),Me=this.Uu(oe,Q,this.ag.gb,!0);0L.Ka(B.gb))){q.yW();for(var it,Lt,Ut=!0;B.Ia();){var Je=B.ia(),Rt=q.ni();if(B.xb()>q.xb())break;Ut&&(Me.add(B.xb()),Ye.add(q.kk()),Ut=!1),Lt=Me.Gc();var ri=B.kk();if(1this.Do?Me.add(B.kk()):le&&(it=L.Vc(1,Me.Gc(),0),Je=Je.jv(1,0),Math.abs(Je-it)>be&&Me.add(B.kk())),Lt>this.Do?Ye.add(q.xb()):le&&(it=L.Vc(1,Ye.Gc(),0),Je=Rt.jv(1,0),Math.abs(Je-it)>be&&Ye.add(q.xb()))}if(Me.Gc()Ye.size?Me.Jf():Ye.Jf():(Me.Gc()!=Ye.Gc()&&Ye.Jf(),Ye.Jf()),2<=Ye.size+Me.size){for(Ut=new A.Ta,Rt=0,Je=Me.size;Rt>1;var oe=Q>>1,le=new A.h,be=new A.h;return this.lf.uc(2*B,le),le.y+=1&L?this.Qj:-this.Qj,this.lf.uc(2*oe,be),be.y+=1&Q?this.Qj:-this.Qj,(L=le.compare(be))==0&&q?0>(q=this.Hl.get(B)-this.Hl.get(oe))?-1:0oe.x)return 1;if(Q.yoe.y)return 1;for(Q=1;QYe)return 1}}return 0},D.prototype.KO=function(L,B){var q=this.Qu(L,B);return q==0?LB?1:0L?b:m;if(b.B())return m;if(m.B())return b;var B=new A.l,q=new A.l,Q=new A.l;return b.A(B),m.A(q),Q.L(B),Q.$b(q),B=A.ua.Xd(_,Q,!0),q=b.K(),Q=m.K(),q==33&&Q==33?T.WU(b,m,B):q!=Q?0L?b:m:q==550?T.dI(b,m,B):T.dI(m,b,B):A.Hg.gp(b,m,_,C)},T.WU=function(b,m,_){_=_*Math.sqrt(2)*1.00001,_*=_;var C=b.D(),D=m.D(),L=new A.ee(b.description);return A.h.zc(C,D)>_&&(L.add(b),L.add(m)),L},T.dI=function(b,m,_){var C=b.vb(0),D=b.I(),L=m.D(),B=b.Ja();_=_*Math.sqrt(2)*1.00001;var q=new A.l;if(b.A(q),q.X(_,_),q.contains(L)){_*=_,q=!1;for(var Q=[],oe=0;oethis.Bk||0>this.eo)throw A.i.Ra();if(this.vH[this.eo])break}return this.za++,this.aG(this.eo)}return this.za=0,this.eo=this.Bk,this.aG(this.Bk)},b.prototype.Ma=function(){return this.za},b.prototype.lK=function(){if(this.Jc)return!0;var m=null;if(this.Sd!=null&&(m=this.Sd.next())==null&&(this.Jc=!0,this.Sd=null),A.op.Bp(this.Vb),m!=null){var _=m.Eb();this.vH[_]=!0,_>=this.Bk&&!this.eA&&(this.HD(_,!1,m),_>this.Bk&&!this.eA&&this.uW(_))}if(0this.Fo.length)for(var L=0,B=Math.max(2,m+1);L_?A.F.Yq(oe,Q,q,le,0):A.F.Yq(oe,q,Q,le,0),Me=[0,0,0],Ye=[0,0,0];var Ut=[0,0,0];q=[0,0,0],be=[0,0,0];var Je=Math.acos(le[2]/1),Rt=1-T,ri=Math.tan(Je),ti=1+ri*ri/Rt,Zt=2*oe[2]*ri/Rt;for(Rt=(-Zt+(ri=Math.sqrt(Zt*Zt-4*ti*(oe[2]*oe[2]/Rt-1))))/(ti*=2),Zt=(-Zt-ri)/ti,ri=Math.tan(Je),Je=(Rt+Zt)/2,oe=((ti=ri*Rt+oe[2])+(ri*Zt+oe[2]))/2,ri=A.F.ip(Rt-Je,ti-oe),Rt=oe/Lt*1.570796326794897,Zt=0;100>Zt&&(ti=(ti=A.F.w(T,Rt))*ti/Math.cos(Rt)*(Math.sin(Rt)-oe*ti/(1-T)),!A.s.Dd(ti));Zt++)Rt-=ti;oe=A.F.n(1,T,Rt)*Math.cos(Rt),ri=1-ri/(oe=Math.sqrt((oe-Je)*(oe+Je))),ri*=2-ri,ti=A.F.qn(Me),Je=A.F.qn(Ye),Rt=A.F.qn(Ut);var ii=A.F.Ut(Ut,Me);Zt=A.F.Ut(Ut,Ye),A.F.yx(Ut,Me,q),A.F.yx(Ut,Ye,be),Me=Math.acos(ii/(Rt*ti)),Ye=Math.acos(Zt/(Rt*Je)),Ye*=A.s.Mb(1,A.F.Ut(q,be)),(1.570796326794897<=A.s.R(Me)&&1.570796326794897<=A.s.R(Ye)||3.141592653589793be&&0>_)&&(_=A.F.ca(_+3.141592653589793)),D!=null&&(D.u=q),L!=null&&(L.u=be),B!=null&&(B.u=_)}}},ye.sf=function(H,T,b,m,_,C,D,L){var B=[0,0,0],q=[0,0,0],Q=[0,0,0],oe=[0,0,0],le=[0,0,0],be=[0,0,0],Me=[0,0,0],Ye=[0,0,0,0],it=new A.ha(0),Lt=new A.ha(0),Ut=new A.ha(0),Je=new A.ha(0),Rt=new A.ha(0),ri=new A.ha(0);if(D!=null&&L!=null)if(A.s.vi(T))A.$g.sf(H,b,m,_,C,D,L);else if(A.s.Dd(_))D!=null&&(D.u=b),L!=null&&(L.u=m);else if(C=A.F.ca(C),0>_&&(_=A.s.R(_),C=A.F.ca(C+3.141592653589793)),b=A.F.ca(b),m=A.F.ca(m),1.570796326794897C?A.F.Yq(Me,le,B,Ye,0):A.F.Yq(Me,B,le,Ye,0),B=Math.acos(Ye[2]/1),Ye=Math.atan2(-Ye[1],-Ye[0]),m=1-T,Rt=1+(le=Math.tan(B))*le/m,m=(-(Je=2*Me[2]*le/m)+(le=Math.sqrt(Je*Je-4*Rt*(Me[2]*Me[2]/m-1))))/(Rt*=2),Je=(-Je-le)/Rt,le=Math.tan(B),B=(m+Je)/2,Me=((Rt=le*m+Me[2])+(le*Je+Me[2]))/2,le=A.F.ip(m-B,Rt-Me),ti=Me/ti*1.570796326794897,m=0;100>m&&(Je=(Je=A.F.w(T,ti))*Je/Math.cos(ti)*(Math.sin(ti)-Me*Je/(1-T)),!A.s.Dd(Je));m++)ti-=Je;ti=A.F.n(1,T,ti)*Math.cos(ti),Me=1-le/(ti=Math.sqrt((ti-B)*(ti+B))),Me*=2-Me,be=Math.acos(A.F.Ut(be,q)/(A.F.qn(be)*A.F.qn(q))),be*=A.s.Mb(1,q[0]),C=(A.F.q(ti,Me,A.F.Sj(Me,be))+H*A.s.Mb(1,C))/A.F.Ch(ti,Me),C=A.F.ca(1.570796326794897*C),C=A.F.Tq(Me,C),A.F.n(ti,Me,C),le=A.F.ca(Ye+b),b=Math.cos(le),C=Math.sin(le),Q[0]=oe[0]*b+oe[1]*-C,Q[1]=oe[0]*C+oe[1]*b,Q[2]=oe[2],A.F.eO(T,Q[0],Q[1],Q[2],Ut,Lt,it),D!=null&&(D.u=Lt.u),L!=null&&(L.u=Ut.u)}},ye}()}(ae||(ae={})),function(A){var ye=function(){function _(C){this.Za=null,this.xt=new A.h,this.yt=new A.h,this.g=C}return _.prototype.compare=function(C,D,L){return this.g.Hc(D,this.xt),this.g.Hc(C.ka(L),this.yt),this.xt.compare(this.yt)},_}(),H=function(){function _(C){this.Cf=new A.h,this.Fk=new A.h,this.g=C}return _.prototype.Fh=function(C){this.Cf.N(C)},_.prototype.compare=function(C,D){return this.g.Hc(C.ka(D),this.Fk),this.Cf.compare(this.Fk)},_}(),T=function(_){function C(D){var L=_.call(this,D.g,D.ra,!1)||this;return L.ib=D,L}return Ne(C,_),C.prototype.compare=function(D,L,B){if(this.sg)return-1;var q=this.ib.Rd.Ln(this.ib.Th(L));D=D.ka(B);var Q=this.ib.Rd.Ln(this.ib.Th(D));return this.Fm=B,this.ME(L,q,D,Q)},C}(A.PC),b=function(_){function C(D){var L=_.call(this,D.g,D.ra)||this;return L.ib=D,L}return Ne(C,_),C.prototype.compare=function(D,L){return this.sg?-1:(D=this.ib.Rd.Ln(this.ib.Th(D.ka(L))),this.Fm=L,this.NE(L,D))},C}(A.WL),m=function(){function _(){this.Nc=this.df=this.lo=this.Rd=this.nh=this.Ad=this.hb=this.g=null,this.Pg=!1,this.xh=this.Pm=this.je=this.Ik=this.ph=this.Ck=this.Gf=this.ae=null,this.zh=this.Lq=this.PA=this.ra=0,this.Zv=this.Yn=!1,this.Ao=new A.h,this.Ri=new A.h,this.hb=new A.ad(8),this.Ad=new A.ad(5),this.nh=new A.cu,this.Rd=new A.cu,this.Pg=!1,this.xh=new A.h,this.xh.na(0,0),this.ra=0,this.zh=-1,this.Yn=!1,this.g=null,this.df=new A.$j,this.Nc=new A.$j,this.ph=new A.ja(0),this.Ik=new A.OC,this.Gf=new A.ja(0),this.Ck=new A.ja(0),this.lo=new A.Ta}return _.prototype.LX=function(C,D){var L=new A.Ed;return L.VB(),C.Pc(L),this.gr(C),this.Yn=!1,this.ra=D,this.PA=D*D,D=this.eC(),C.Pc(L),D||(this.lQ(),D||this.eC()),this.zh!=-1&&(this.g.Ud(this.zh),this.zh=-1),this.g=null,this.Yn},_.prototype.PX=function(C,D){this.gr(C),this.Yn=!1,this.ra=D,this.PA=D*D,this.Pg=!1,this.eC(),this.Pg||(this.Pg=C.Ip(D,!0,!1)==1),this.zh!=-1&&(this.g.Ud(this.zh),this.zh=-1),this.g=null},_.prototype.qg=function(C,D){return this.hb.U(C,0+D)},_.prototype.GB=function(C,D,L){this.hb.T(C,0+D,L)},_.prototype.Th=function(C){return this.hb.U(C,2)},_.prototype.UW=function(C,D){this.hb.T(C,2,D)},_.prototype.MF=function(C,D){return this.hb.U(C,3+D)},_.prototype.Rp=function(C){return this.hb.U(C,7)},_.prototype.Rl=function(C,D){this.hb.T(C,7,D)},_.prototype.Tp=function(C,D){return this.hb.U(C,3+this.Qp(C,D))},_.prototype.hr=function(C,D,L){this.hb.T(C,3+this.Qp(C,D),L)},_.prototype.IR=function(C,D){return this.hb.U(C,5+this.Qp(C,D))},_.prototype.jr=function(C,D,L){this.hb.T(C,5+this.Qp(C,D),L)},_.prototype.Ur=function(C){return this.Ad.U(C,0)},_.prototype.PW=function(C,D){this.Ad.T(C,0,D)},_.prototype.$y=function(C){return this.Ad.U(C,4)},_.prototype.er=function(C,D){this.Ad.T(C,4,D)},_.prototype.kl=function(C){return this.Ad.U(C,1)},_.prototype.nn=function(C,D){this.Ad.T(C,1,D)},_.prototype.Zy=function(C){return this.Ad.U(C,3)},_.prototype.Ft=function(C,D){this.Ad.T(C,3,D)},_.prototype.$m=function(C){var D=this.Ad.De(),L=this.nh.Rh();return this.PW(D,L),C!=-1?(this.nh.addElement(L,C),this.g.Sa(C,this.zh,D),this.er(D,this.g.Va(C))):this.er(D,-1),D},_.prototype.CP=function(C){this.Ad.kd(C)},_.prototype.FD=function(C,D){this.nh.addElement(this.Ur(C),D),this.g.Sa(D,this.zh,C)},_.prototype.ot=function(C){var D=this.hb.De(),L=this.Rd.Rh();return this.UW(D,L),C!=-1&&this.Rd.addElement(L,C),D},_.prototype.GD=function(C,D){this.Rd.addElement(this.Th(C),D)},_.prototype.Wu=function(C){this.hb.kd(C),0<=(C=this.ph.gF(C))&&this.ph.NV(C)},_.prototype.jj=function(C,D){if(this.qg(C,0)==-1)this.GB(C,0,D);else{if(this.qg(C,1)!=-1)throw A.i.Ra();this.GB(C,1,D)}this.gy(C,D)},_.prototype.gy=function(C,D){var L=this.kl(D);if(L!=-1){var B=this.Tp(L,D);this.jr(B,D,C),this.hr(C,D,B),this.hr(L,D,C),this.jr(C,D,L)}else this.jr(C,D,C),this.hr(C,D,C),this.nn(D,C)},_.prototype.Qp=function(C,D){return this.qg(C,0)==D?0:1},_.prototype.Zm=function(C,D){var L,B=this.Zy(D);if(B!=-1&&(this.df.wd(B,-1),this.Ft(D,-1)),(B=this.kl(D))!=-1){var q=L=B;do{var Q=!1,oe=this.Qp(L,D),le=this.MF(L,oe);if(this.qg(L,oe+1&1)==C){if(this.Zu(L),this.Rd.eh(this.Th(L)),this.Wu(L),L==le){B=-1;break}B==L&&(B=this.kl(D),q=le,Q=!0)}L=le}while(L!=q||Q);if(B!=-1){do oe=this.Qp(L,D),le=this.MF(L,oe),this.GB(L,oe,C),L=le;while(L!=q);(L=this.kl(C))!=-1?(q=this.Tp(L,C),Q=this.Tp(B,C),q==L?(this.nn(C,B),this.gy(L,C),this.nn(C,L)):Q==B&&this.gy(B,C),this.hr(B,C,q),this.jr(q,C,B),this.hr(L,C,Q),this.jr(Q,C,L)):this.nn(C,B)}}for(B=this.Ur(C),L=this.Ur(D),q=this.nh.sc(L);q!=-1;q=this.nh.lb(q))this.g.Sa(this.nh.ka(q),this.zh,C);this.nh.Cy(B,L),this.CP(D)},_.prototype.PT=function(C,D){var L=this.qg(C,0),B=this.qg(C,1),q=this.qg(D,0),Q=this.qg(D,1);this.Rd.Cy(this.Th(C),this.Th(D)),D==this.kl(L)&&this.nn(L,C),D==this.kl(B)&&this.nn(B,C),this.Zu(D),this.Wu(D),L==q&&B==Q||B==q&&L==Q||(this.Jn(L,this.Ao),this.Jn(q,this.Ri),this.Ao.rb(this.Ri)?(L!=q&&this.Zm(L,q),B!=Q&&this.Zm(B,Q)):(B!=q&&this.Zm(B,q),L!=Q&&this.Zm(L,Q)))},_.prototype.Zu=function(C){var D=this.qg(C,1);this.ZE(C,this.qg(C,0)),this.ZE(C,D)},_.prototype.ZE=function(C,D){var L=this.Tp(C,D),B=this.IR(C,D),q=this.kl(D);L!=C?(this.hr(B,D,L),this.jr(L,D,B),q==C&&this.nn(D,L)):this.nn(D,-1)},_.prototype.RD=function(C,D,L){var B=this.Rd.sc(C),q=this.Rd.ka(B);C=this.Ie(q);var Q=this.Ie(this.g.V(q));for(this.g.lr(q,D,L,!0),B=this.Rd.lb(B);B!=-1;B=this.Rd.lb(B)){q=this.Rd.ka(B);var oe=this.Ie(q)==C;this.g.lr(q,D,L,oe)}B=D.Xp(L,0).bc(),D=D.Xp(L,D.ql(L)-1).xc(),this.wK(C,B),this.wK(Q,D)},_.prototype.UE=function(C,D,L){var B=this.Th(C),q=this.qg(C,0),Q=this.qg(C,1),oe=this.ot(-1);for(this.ph.add(oe),this.Rl(oe,-3),this.Gf.add(oe),this.jj(oe,q),C=1,D=D.ql(L);Cthis.$y(oe)&&this.er(oe,this.g.Va(Q))),oe=this.Gf.get(C),C-=2,this.GD(oe,Q),Q=this.g.V(Q);while(0<=C)}this.Gf.clear(!1)},_.prototype.Ie=function(C){return this.g.Qa(C,this.zh)},_.prototype.NI=function(C,D,L){var B=this.qg(D,0),q=new A.h;this.Jn(B,q);var Q=new A.h,oe=this.qg(D,1);this.Jn(oe,Q);var le=L.ql(C),be=L.Xp(C,0),Me=new A.h;if(be.$p(Me),!q.rb(Me)){if(!this.Pg){var Ye=q.compare(this.xh);0>Ye*(Me=Me.compare(this.xh))&&(this.Pg=!0)}this.qF(B,this.Gf),this.Ck.add(B)}for(!this.Pg&&1be.compare(this.xh))&&(this.Pg=!0)),C=(be=L.Xp(C,le-1)).xc(),Q.rb(C)||(this.Pg||0>(Ye=Q.compare(this.xh))*(Me=C.compare(this.xh))&&(this.Pg=!0),this.qF(oe,this.Gf),this.Ck.add(oe)),this.Gf.add(D),Q=0,oe=this.Gf.size;QMath.max(100,this.g.gd)){this.ph.clear(!1),this.Pg=!0;break}var C=this.ph.Gc();this.ph.Jf(),this.Rl(C,-1),this.RS(C)!=-1&&this.rS(C),this.Xn=!1}},_.prototype.rS=function(C){if(this.Xn){var D=this.Nc.Bu(this.HH,this.BH,C,!0);this.Xn=!1}else D=this.Nc.ED(C);D==-1?this.PT(this.Nc.ka(this.Nc.AF()),C):(this.Rl(C,D),this.ae.sg&&(this.ae.Mr(),this.jF(this.ae.Fm,D)))},_.prototype.RS=function(C){var D=this.qg(C,0);if(C=this.qg(C,1),this.Jn(D,this.Ao),this.Jn(C,this.Ri),A.h.zc(this.Ao,this.Ri)<=this.PA)return this.Pg=!0,-1;var L=this.Ao.compare(this.xh),B=this.Ri.compare(this.xh);return 0>=L&&0=B&&0C&&(this.se(b),C=this.description.Rf(b)),this.la==null&&this.wn(),this.la[this.description.bk(C)+m]=_},T.prototype.K=function(){return 33},T.prototype.Eb=function(){return 0},T.prototype.Pa=function(){this.wc(),this.la!=null&&(this.la[0]=NaN,this.la[1]=NaN)},T.prototype.un=function(b){if(this.la!=null){for(var m=A.fe.Kw(b,this.description),_=[],C=0,D=0,L=b.Ba;D>>32),b=A.P.Vh(C,b)}return b},T.prototype.ng=function(){return null},T}(A.ba);A.Ta=ye}(ae||(ae={})),function(A){var ye=function(){function H(T,b,m){T!==void 0&&(this.x=T,this.y=b,this.z=m)}return H.construct=function(T,b,m){var _=new H;return _.x=T,_.y=b,_.z=m,_},H.prototype.L=function(T,b,m){this.x=T,this.y=b,this.z=m},H.prototype.lx=function(){this.z=this.y=this.x=0},H.prototype.normalize=function(){var T=this.length();T==0&&(this.x/=T,this.y/=T,this.z/=T)},H.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},H.prototype.sub=function(T){return new H(this.x-T.x,this.y-T.y,this.z-T.z)},H.prototype.Bg=function(T){new H(this.x*T,this.y*T,this.z*T)},H.prototype.Sh=function(T){return this.x*T.x+this.y*T.y+this.z*T.z},H}();A.Od=ye}(ae||(ae={})),function(A){var ye=function(){function H(T,b,m){this.Iw=this.yA=null,this.Zf=b,this.AT=b.y-m,this.zT=b.y+m,this.Gw=0,this.Zz=T,this.ra=m,this.MT=m*m,this.$z=m!=0,this.Nv=!1}return H.prototype.result=function(){return this.Gw!=0?1:0},H.prototype.UM=function(T){return T=T.ic(T.ge(this.Zf,!1)),A.h.zc(T,this.Zf)<=this.MT},H.prototype.aF=function(T){if(!this.$z&&(this.Zz&&this.Zf.rb(T.bc())||this.Zf.rb(T.xc())))this.Nv=!0;else if(T.oa==this.Zf.y&&T.oa==T.ma){if(this.Zz&&!this.$z){var b=Math.max(T.ta,T.qa);this.Zf.x>Math.min(T.ta,T.qa)&&this.Zf.xb?m=!0:this.Zf.x>=Math.min(T.ta,T.qa)&&(m=0T.xc().y?1:-1)}}},H.prototype.MI=function(T){var b=T.Vg(0,1);if(b.pa>this.zT||b.wathis.Zf.y||b.wa(T=T.I()))&&2*T+Math.log(T)/Math.log(2)*b<1*T*b},H}();A.Fg=ye}(ae||(ae={})),function(A){var ye=function(H){function T(b){return H.call(this,!0,b)||this}return Ne(T,H),T.prototype.Ja=function(){return new T(this.description)},T.prototype.Eb=function(){return 2},T.prototype.K=function(){return 1736},T.prototype.sG=function(b,m,_){this.ES(b,m,_)},T.prototype.kR=function(){this.AR()},T}(A.Xk);A.Ea=ye}(ae||(ae={})),function(A){(function(ye){ye[ye.PiPOutside=0]="PiPOutside",ye[ye.PiPInside=1]="PiPInside",ye[ye.PiPBoundary=2]="PiPBoundary"})(A.ML||(A.ML={})),A.jd=function(){function ye(){}return ye.FG=function(H,T,b){return(H=A.Fg.XS(H,T,b))==0?0:H==1?1:2},ye.Zd=function(H,T,b){return(H=A.Fg.ym(H,T,b))==0?0:H==1?1:2},ye.SX=function(H,T,b,m,_){if(T.lengthT?(0>T?T+=360:360<=T&&(T-=360),T):(0>(T=A.mc.MK(T))&&(T+=360),T)},H.bP=function(T){return 180<(T=H.cP(T))&&(T-=360),T},H.jW=57.29577951308232,H}();A.sr=ye,A.Jh=function(){function H(){}return H.nj=function(T,b){var m=new A.l;T.A(m);var _=A.cb.ih(b),C=new A.l;return C.L(_),C.v=m.v,C.C=m.C,C.X(.01*C.da(),0),b=A.ua.Xd(b,m,!1),C.contains(m)?T:A.Vd.clip(T,C,b,0)},H.ms=function(T,b,m,_,C){if(!A.cb.Xc(b))throw A.i.O();var D=A.ua.mj(b,T,!1),L=A.cb.ih(b),B=A.cb.tc(b),q=B.Id().ci,Q=A.cb.xv(B);B=A.cb.gv(B),Q*=2-Q;var oe=new A.Oc;L.en(oe);var le=[[0,0],[0,0]];if(A.Gg.Tb(b)==2?_?(le[0][0]=H.an(C,oe),le[0][1]=L.Lp(),A.cb.wt(),L=le[0][0]*q):(le[0][0]=L.ik(),le[0][1]=C,A.cb.wt(),L=le[0][1]*q):L=C*q,!_&&L!=0)throw A.i.O();var be=new A.ha,Me=new A.hd;T=Me.Ib(T);for(var Ye=[0],it=new A.h,Lt=new A.h,Ut=new A.h,Je=new A.h,Rt=new A.h,ri=new A.h,ti=Me.Ob(T);ti!=-1;ti=Me.Sb(ti)){var Zt=Me.Ya(ti);Me.D(Zt,Ut);for(var ii=!1,Ci=Zt=Me.V(Zt);Ci!=-1;Ci=Me.V(Ci)){if(Ci==Zt){if(ii)break;ii=!0}if(Me.D(Ci,Je),_&&DD||DD||!_&&D<-Ut.y&&Je.y>D||D<-Je.y&&Ut.y>D)do if(!(Math.abs(Ut.x-Je.x)>=.5*oe.S())){if(A.Gg.Tb(b)==2?(le[0][0]=H.an(Ut.x,oe),le[0][1]=Ut.y,le[1][0]=H.an(Je.x,oe),le[1][1]=Je.y,A.cb.ZV(),Rt.x=le[0][0]*q,Rt.y=le[0][1]*q,ri.x=le[1][0]*q,ri.y=le[1][1]*q):(Rt.x=Ut.x*q,Rt.y=Ut.y*q,ri.x=Je.x*q,ri.y=Je.y*q),ri.x=6.283185307179586*(Je.x-Ut.x)/oe.S()+Rt.x,_){if(Lt.x=L,Lt.y=H.Iz(B,Q,Rt,ri,L,m),isNaN(Lt.y))break}else{if(Lt.x=H.Gz(B,Q,Rt,ri,m),isNaN(Lt.x))break;Lt.y=0}A.kb.xd(B,Q,Rt.x,Rt.y,ri.x,ri.y,be,null,null,m);var ki=be.u;A.kb.xd(B,Q,Rt.x,Rt.y,Lt.x,Lt.y,be,null,null,m);var Ni=be.u;A.Gg.Tb(b)==2?(le[0][0]=Lt.x/q,le[0][1]=Lt.y/q,A.cb.XQ(),_?(it.y=le[0][1],it.x=C):(it.x=H.qs(le[0][0],Ut.x,Je.x,oe),it.y=C)):_?(it.x=C,it.y=Lt.y/q):(it.x=H.qs(Lt.x/q,Ut.x,Je.x,oe),it.y=C),Ye[0]=0_.x)var L=_;else L=m,m=_;_=new A.ha(0);var B=new A.ha(0),q=new A.ha(0);A.kb.xd(T,b,L.x,L.y,m.x,m.y,B,_,null,D);var Q=B.u,oe=0,le=1,be=new A.h;for(be.N(L);Q*(le-oe)>1e-12*T;){var Me=.5*(oe+le);if(A.kb.qj(T,b,L.x,L.y,Q*Me,_.u,B,q,D),be.x=B.u,be.y=q.u,be.x==C)break;if(H.Un(L.x,be.x,C))le=Me;else{if(!H.Un(m.x,be.x,C))return NaN;oe=Me}}return be.y},H.Un=function(T,b,m){return T=ye.Ep(T),b=ye.mx(T,ye.Ep(b)),(m=ye.mx(T,ye.Ep(m)))==0||0b&&0>m&&m>=b},H.an=function(T,b){var m=b.wa-b.pa;return b.Kt(T-Math.floor((T-b.pa)/m)*m)},H.qs=function(T,b,m,_){var C=new A.Oc;for(C.L(b,m),m=_.S(),T=Math.floor((T-b)/m)*m+T,C=C.tf();Math.abs(T-C)>Math.abs(T+m-C);)T+=m;return T},H.Gz=function(T,b,m,_,C){if(m.y>_.y)var D=_;else D=m,m=_;if((_=new A.Oc).L(D.y,m.y),!_.contains(0)||3.141592653589793<=Math.abs(D.x-m.x))return NaN;if(D.x==m.x)return D.x;var L=new A.ha(0),B=new A.ha(0),q=new A.ha(0);A.kb.xd(T,b,D.x,D.y,m.x,m.y,B,L,null,C);var Q=B.u,oe=0,le=1,be=new A.h;for(be.N(D);Q*(le-oe)>1e-12*T;){var Me=.5*(oe+le);if(A.kb.qj(T,b,D.x,D.y,Q*Me,L.u,B,q,C),be.x=B.u,be.y=q.u,_.L(D.y,be.y),be.y==0)break;if(_.contains(0))le=Me;else{if(_.L(m.y,be.y),!_.contains(0))return NaN;oe=Me}}return be.x},H.Jp=function(T,b,m,_,C,D,L){var B=new A.l;if(T.A(B),B.B())return T;var q=new A.Oc;B.en(q);var Q=new A.Oc;if(Q.L(b,b+m),Q.contains(q)&&Q.wa!=q.wa)return T;var oe=new A.l;oe.L(B);var le=T.K();if(le==33)return((B=(oe=C?T:T.Qf()).Ng())=Q.wa||L&&B==Q.wa)&&(B+=Math.ceil((Q.pa-B)/m)*m,B=Q.Kt(B),oe.YB(B)),oe;if(le==550){for(_=(oe=C?T:T.Qf()).vb(0),le=2*oe.I(),T=!1,C=0;C=Q.wa||L&&B==Q.wa)&&(T=!0,B+=Math.ceil((Q.pa-B)/m)*m,B=Q.Kt(B),_.write(C,B));return T&&oe.Qc(1993),oe}if(Q.contains(q))return T;if(le==197)return m=C?T:T.Qf(),B.Fa(oe),m.Zo(B),m;var be=.1*Math.max(B.da(),B.S());for(oe.X(0,be),L=T,Q=_.Yd(0),T=A.Ih.local(),C=new A.Ed;;){var Me=Math.floor((q.pa-b)/m),Ye=Math.ceil((q.wa-b)/m);if(!(3oe.v;)(be=A.Vd.clip(L,oe,Q,0)).A(q),(le==1607?!be.B()&&(q.S()>Q||q.da()>Q):!be.B()&&(le!=1736||q.S()>Q))&&(be.Pc(C),be.A(q),b.A(D),D.X(Q,Q),D.isIntersecting(q)&&le==1736?b=T.W(b,be,_,null):b.add(be,!1)),oe.move(m,0),C.shift(-m,0);return b},H.RI=function(T,b,m,_){var C=new A.ee(m.description);C.Gd(m,0,-1),C=A.cb.Bh(C,T,b);var D=m.I();if(_.Pa(),!A.cb.Xc(T)||D!=C.I())return!1;var L=new A.l;m.A(L);var B=new A.l;if(C.A(B),L=L.S(),B=B.S(),L!=0&&B!=0){if(B/=L,T=A.cb.ih(b).S()/A.cb.ih(T).S(),1e-10=m[C]?_[C]=m[C].toUpperCase():m[C];return _.join()}return m.toString(A.Tc.PE_STR_AUTH_TOP)},b.wr=function(m,_,C,D){var L=D.length,B=C.I();if(B!=0){var q=C.vb(0),Q=Math.min(B,L),oe=0,le=m.gh();isNaN(_)&&(_=0);for(var be=m.Xc(),Me=179*(m=be?m.tc().Le().S():0)/360;0Lt*A.mc.sign(Ut)&&Math.abs(it)>Me&&(D[Ye][0]+=-Lt*m)}q.pC(oe<<1,Q,D),oe+=Q,B-=Q,Q=Math.min(B,L)}C.Qc(1993)}},b.DL=function(m,_,C,D){var L=0,B=m.gh();isNaN(L)&&(L=0);var q=m.Xc(),Q=m.bf();m=360*Q,Q*=179;for(var oe=D.length,le=0;leUt*A.mc.sign(it)&&Math.abs(Lt)>Q&&(D[be][0]-=Ut*m)}A.ua.Dy(_,le,D,Me),le+=Me}}},b.Kx=function(m,_,C){var D=C.length,L=_.I();if(!(1>L)){var B=_.vb(0),q=Math.min(L,D),Q=0,oe=m.gh(),le=m.Xc(),be=le?m.Le().S():0,Me=179*be/360,Ye=0;for(le&&(Ye=m.Bi());0Lt*A.mc.sign(Ut)&&Math.abs(it)>Me&&(C[m][0]+=-Lt*be)}B.pC(Q<<1,q,C),Q+=q,L-=q,q=Math.min(L,D)}_.Qc(1993)}},b.CL=function(m,_,C,D){if(C!=0){var L=m.gh(),B=m.Xc(),q=B?m.Le().S():0,Q=179*q/360,oe=0;for(B&&(oe=m.Bi()),m=0;mit*A.mc.sign(_[Me].x-oe)&&Math.abs(Ye)>Q&&(D[le][0]-=it*q)}A.ua.Dy(_,m,D,be),m+=be}}}},b.vr=function(m,_,C,D){var L=_.I();if(L!=0){var B=_.vb(0),q=m.ef,Q=m.$f,oe=q.tc().Sp(),le=Q.tc().Sp(),be=q.bf(),Me=Q.bf();if((m=m.Yf)==null||m.count()==0){for(C=oe/le,D=(q.Wp()-Q.Wp())*Me,le=-90*be,m=90*be,oe=!1,Me=1,q=2*L;MeJe?D[Me][1]=Je:D[Me][1]<-Je&&(D[Me][1]=-Je));for(be=0;beMe){if(ti){var Xr=Ci+(os+11*be&&(ti=!1)}ti||(es=Mn+(tr-=A.mc.En(le,es-cr)),++wi,Ur=tr!=0,Wn.x=es)}else bn||A.ua.vG(eo,qr,Wn,ii)&&(bn=!0);Ur&&ki.write(2*os,es),cr=es,eo.N(qr),qr.N(Wn)}0m?q=1:0>=Q&&0.99*Q&&(q=-1)):q=-1),q!=0&&((_=new A.Ea(L.description)).vp(oe),(_=A.Zl.local().W(_,C,B)).add(L,!1),Je=!0,L=_),Je&&(L=A.$l.local().W(L,D,!1,B)),L},b.qQ=function(m,_,C,D,L){var B=C.I(),q=C.Oa(0),Q=C.Oa(B-1);L=(D=b.fv(D,L)).S(),q=A.mc.sign(Q.x-q.x);var oe=new A.l;C.yc(oe);var le=D.ik();if(Q=le-L,le+=L,0<=q){var be=Math.ceil((Q-oe.v)/L);for(be*=L;Q>oe.v+be;)be+=L;for(;Qoe.v+be;)be+=L;Me=be,720Q;)1024<=Ut&&(Ut=0),Ye.move(be,0),it.Lb=be,C.Pc(it),Lt+=be,D.v<=Lt&&D.C>=Lt&&(L=oe.I()-1),C.Db(0,Me),Me=C.Oa(B-1),oe.Fr(C,0,0,B-1,!1);return C=new A.Ea(oe.description),B=0q?B:!B)?(q=A.h.construct(Q.x,D.H),C.Ei(q),q=A.h.construct(D.ik(),D.H),C.Ei(q),D=A.h.construct(m.x,D.H)):(q=A.h.construct(Q.x,D.G),C.Ei(q),q=A.h.construct(D.ik(),D.G),C.Ei(q),D=A.h.construct(m.x,D.G)),C.Ei(D),C.sG(0,_,0),C.fO(L),C},b.pQ=function(m,_,C,D,L){var B=new A.Ea(m.description);B.add(m,!1),B.yB(0,B.I()-1);var q=new A.l;B.yc(q);var Q=(C=b.fv(_,C)).S(),oe=Math.ceil((C.v-q.v)/Q);for(oe*=Q;C.v>q.v+oe;)oe+=Q;for(;C.vq.C)return L&&(L=B.He(),_=(B=A.$l.local().W(B,_,!0,D)).He(),(_=A.mc.sign(L)!=A.mc.sign(_))&&B.jJ()),B;for((m=new A.Ea(m.description)).add(B,!1),L=L||q.S()>Q-_.Yd(0);q.v=C){Q=!0;break}if(2&L&&le.y<=-C){Q=!0;break}}if(!Q)return!1;B=!1,m&&(B=_.Pn(0)),q=(m=new A.hd).Ib(_),Q=m.Ob(q);var be=-1,Me=!0,Ye=new A.h;Ye.Sc(),oe=new A.Ta;for(var it=-1,Lt=m.Ya(Q);Lt!=-1;Lt=m.V(Lt)){le=m.Oa(Lt);var Ut=1&L&&90<=le.y?1:0;if(Ut|=2&L&&le.y<=-C?2:0,0Q){if(new A.l().L(Ye.v-q,-Q,Ye.C+q,Q),(L=A.ti.Pu(L,_,m,NaN,0,D)).B())return L;L.A(Ye)}if(Lt&&(_.HYe.H))return L.Ja();if(Ye.S()>le&&(L=b.Jp(L,be-oe,le,m,!0,0,!0,D)).A(Ye),(Q=b.$N(Ye.v,Ye.C,_.v,_.C,le))!=0&&Ye.move(Q,0),Ye.C>_.C||Ye.v<_.v){if(Ye.C>_.C)for(;Ye.v>=_.C;)Ye.move(-le,0),Q-=le;for(;Ye.v<_.C-le;)Ye.move(le,0),Q+=le}if(C=A.ua.Ju(m,it),Q!=0&&((q=new A.Ed).ig(Q,0),L.Pc(q)),Lt){if(Ut&&_.contains(Ye))return L;for(Lt=[null,null],Q=0;2>Q;Q++){if(Ut?q=A.ba.Ic(B)?A.ti.clip(L,_,C,Me,D):A.ti.clip(L,_,C,0,D):(q=A.Zj.local().W(L,it,m,D))==it&&(q=A.ba.kg(q)),_.v<=Ye.v&&_.C>=Ye.C||_.v>=Ye.v&&_.C<=Ye.C)return q;Lt[Q]=q,Q==0&&(Ye.move(-le,0),(q=new A.Ed).ig(-le,0),L.Pc(q))}if(B==550)Lt[0].Gd(Lt[1],0,-1);else if(A.ba.Ic(B))Lt[0].add(Lt[1],!1);else{if(B!=33)throw A.i.ga("intersect_with_GCS_horizon: unexpected geometry type");Lt[0].B()&&(Lt[0]=Lt[1])}return Lt[0]}if(_.HYe.H)return L;for(B=0;!L.B()&&Ye.C>_.v;)B!=0&&((q=new A.Ed).ig(B,0),L.Pc(q)),A.fj.local().W(4,L,it,m,D)||it==(L=A.mp.local().W(L,it,m,D))&&(L=A.ba.kg(L)),B!=0&&((Me=new A.Ed).ig(-B,0),L.Pc(Me)),B-=le,Ye.move(-le,0);return L},b.tG=function(m,_,C,D){if(_!=0&&D!=ye.DontClip)if(D==ye.PannableFold){D=C.CR();for(var L=_,B=0;B<_;B++)(m[B].y>D.H||m[B].yq||m[B].y<-q)&&(m[B].Sc(),L--);if(L!=0){(L=new A.l).bx(m,_),q=C.Xr();var oe=C.kv();B=q.K()==197;var le=new A.l;if(q.A(le),!oe||!(le.HL.H))if(oe)if(b.cv(m,_,le.ik()-Q,D),L=_,B)for(B=0;B<_;B++)le.contains(m[B])||(m[B].Sc(),L--);else for(C=A.ua.Ju(C.tc(),q),B=0;B<_;B++)(Q=A.jd.Zd(q,m[B],C)!=0)||(m[B].Sc(),L--);else for(b.cv(m,_,-Q,D),L=_,C=A.ua.Ju(C.tc(),q),B=0;B<_;B++)(Q=m[B]).isNaN()&&L--,oe=b.oE(Q.x,le.v,le.C,D),Q.x+=oe,(Q=A.jd.Zd(q,Q,C)!=0)&&(m[B].Sc(),L--)}}},b.Jp=function(m,_,C,D,L,B,q,Q){var oe=m.K(),le=_+C;if(oe===33){var be=(D=L?m:m.Qf()).Ng();return(be<_||be>=le||q&&be==le)&&(be+=Math.ceil((_-be)/C)*C,be=A.P.Tk(be,_,le),D.YB(be)),D}if(m.B()||(be=new A.l,m.A(be),be.B()))return m;var Me=new A.Oc;be.en(Me);var Ye=new A.Oc;if(Ye.L(_,le),Ye.contains(Me))return m;if((le=new A.l).L(be),oe===550){for(Q=(D=L?m:m.Qf()).vb(0),oe=2*D.I(),le=!1,_=0;_=Ye.wa||q&&be==Ye.wa)&&(le=!0,be+=Math.ceil((Ye.pa-be)/C)*C,be=Ye.Kt(be),Q.write(_,be));return le&&D.Qc(1993),D}if(oe==197)return C=L?m:m.Qf(),be.Fa(le),C.Zo(be),C;var it=.1*Math.max(be.da(),be.S());for(le.X(0,it),q=m,Ye=D.Yd(0),m=A.Ih.local(),L=new A.Ed;;){var Lt=Math.floor((Me.pa-_)/C),Ut=Math.ceil((Me.wa-_)/C);if(!(3le.v;)(it=A.ti.clip(q,le,Ye,0,Q)).A(Me),(oe==1607?!it.B()&&(Me.S()>Ye||Me.da()>Ye):!it.B()&&(oe!=1736||Me.S()>Ye))&&(it.Pc(L),it.A(Me),_.A(B),B.X(Ye,Ye),B.isIntersecting(Me)&&oe==1736?_=m.W(_,it,D,null):_.add(it,!1)),le.move(C,0),L.shift(-C,0);return _},b.cv=function(m,_,C,D){for(var L=C+D,B=0;B<_;B++){var q=m[B].x;C<=q&&qL||q==L)||(q+=Math.ceil((C-q)/D)*D,q=A.P.Tk(q,C,L),m[B].x=q)}},b.Hn=function(m,_,C,D,L,B){if(!_.Xc())throw A.i.ga("fold_into_360_degree_range");if(m.B())return m;if(_.Tb()==2){C=_.rv();var q=_.qv()-C}else{var Q=_.bf();q=360*Q,C-=180*Q}return b.Jp(m,C,q,_,D,L,!0,B)},b.lF=function(m,_,C,D){if(C.Tb()==2)D=C.rv(),C=C.qv()-D;else{var L=C.bf();C=360*L,D-=180*L}b.cv(m,_,D,C)},b.nj=function(m,_){var C=_.Le();if(m.K()==33){var D=m.kh();return C.G<=D&&D<=C.H?m:m.Ja()}D=new A.l,m.A(D);var L=new A.l;return L.L(C),L.v=D.v,L.C=D.C,L.X(.01*L.da(),0),C=A.ua.py(_,D),L.contains(D)?m:A.ti.clip(m,L,C,0,null)},b.kr=function(m,_,C){return m>_.C&&m-_.CC.H?m[L].Sc():m[L].x=b.kr(m[L].x,C,D)},b.Lt=function(m,_,C,D){if(!m.B()){var L=m.K();if(!D||L!=1736)if(A.ba.zj(L)){D=m.vb(0),L=0;for(var B=m.I();LD||DD)||!B&&(q!=0||D<-Zt.y&&ii.y>D||D<-ii.y&&Zt.y>D))do if(!(Math.abs(Zt.x-ii.x)>=.5*Me.S())){if(C.Tb()==2?(it[0][0]=b.an(Zt.x,Me),it[0][1]=Zt.y,it[1][0]=b.an(ii.x,Me),it[1][1]=ii.y,A.gj.projToGeogCenter(Ye,2,it,0),Ci.x=it[0][0]*oe,Ci.y=it[0][1]*oe,ki.y=it[1][1]*oe):(Ci.x=Zt.x*oe,Ci.y=Zt.y*oe,ki.y=ii.y*oe),ki.x=2*(ii.x-Zt.x)*Math.PI/Me.S()+Ci.x,B){if(Rt.x=Q,Rt.y=b.Iz(le,be,Ci,ki,Q,L),isNaN(Rt.y))break;ti[0]=Rt;var wi=1}else if(L==T.GreatElliptic){var bn=[0,0];if((wi=A.Nx.Jz(be,Ci,ki,Q,bn))==0)break;Rt.x=bn[0],Rt.y=Q,ti[0]=Rt,wi==2&&(ri.x=bn[1],ri.y=Q,ti[1]=ri)}else{if(Rt.x=b.Gz(le,be,Ci,ki,L),isNaN(Rt.x))break;Rt.y=0,ti[0]=Rt,wi=1}var qr=-1;for(bn=0;bnUt[0]||(qr=m.Na(cr),m.Wl(qr,Ut,1),m.Db(m.V(qr),Je.x,Je.y),qr=Ut[0])}}while(0);Zt.N(ii)}}},b.an=function(m,_){var C=_.wa-_.pa;return _.Kt(m-Math.floor((m-_.pa)/C)*C)},b.qs=function(m,_,C,D){var L=new A.Oc;for(L.L(_,C),C=D.S(),m=Math.floor((m-_)/C)*C+m,L=L.tf();Math.abs(m-L)>Math.abs(m+C-L);)m+=C;return m},b.Un=function(m,_,C){return m=A.sr.Ep(m),_=A.sr.mx(m,A.sr.Ep(_)),(C=A.sr.mx(m,A.sr.Ep(C)))==0||0<_&&0_&&0>C&&C>=_},b.Iz=function(m,_,C,D,L,B){if(B==T.GreatElliptic)return A.Nx.NS(_,C,D,L);if(Math.abs(C.x-D.x)>=Math.PI||!b.Un(C.x,D.x,L))return NaN;if(C.x>D.x)var q=D;else q=C,C=D;D=new A.ha;var Q=new A.ha,oe=new A.ha;A.kb.xd(m,_,q.x,q.y,C.x,C.y,Q,D,null,B);var le=Q.u,be=0,Me=1,Ye=new A.h;for(Ye.N(q);le*(Me-be)>1e-12*m;){var it=.5*(be+Me);if(A.kb.qj(m,_,q.x,q.y,le*it,D.u,Q,oe,B),Ye.x=Q.u,Ye.y=oe.u,Ye.x==L)break;if(b.Un(q.x,Ye.x,L))Me=it;else{if(!b.Un(C.x,Ye.x,L))return NaN;be=it}}return Ye.y},b.Gz=function(m,_,C,D,L){if(L==T.GreatElliptic)return m=[0,0],A.Nx.Jz(_,C,D,0,m),m[0];if(C.y>D.y)var B=D;else B=C,C=D;if((D=new A.Oc).L(B.y,C.y),!D.contains(0)||Math.abs(B.x-C.x)>=Math.PI)return NaN;if(B.x==C.x)return B.x;var q=new A.ha,Q=new A.ha,oe=new A.ha;A.kb.xd(m,_,B.x,B.y,C.x,C.y,Q,q,null,L);var le=Q.u,be=0,Me=1,Ye=new A.h;for(Ye.N(B);le*(Me-be)>1e-12*m;){var it=.5*(be+Me);if(A.kb.qj(m,_,B.x,B.y,le*it,q.u,Q,oe,L),Ye.x=Q.u,Ye.y=oe.u,D.L(B.y,Ye.y),Ye.y==0)break;if(D.contains(0))Me=it;else{if(D.L(C.y,Ye.y),!D.contains(0))return NaN;be=it}}return Ye.x},b.RI=function(m,_,C,D){if(!m.ef.Xc())return!1;var L=new A.ee(_.description);if(L.Gd(_,0,-1),D=A.Gx.local().W(L,m,D),L=_.I(),C.Pa(),L!=D.I())return!1;var B=new A.l;_.A(B);var q=new A.l;if(D.A(q),B=B.S(),q=q.S(),B!=0&&q!=0){if(q/=B,m=m.$f.ih().S()/m.ef.ih().S(),1e-10=180*_&&(m-=360*_),m},b.OI=function(m,_,C,D){if(C==ye.Clip){var L=_.ol();L.K()==197?(C=new A.l,L.A(C),L=A.ua.py(_,C),m=A.ti.clip(m,C,L,5e4*_.rm(),D)):A.fj.local().W(1,L,m,_,D)||(m=A.Zj.local().W(m,L,_,D))==L&&(m=A.Xk.kg(m))}else _.Xc()&&(D=new A.l,m.yc(D),_.Le().contains(D)||(b.Lt(m,_.Le(),_.Yd(0),!0),C==ye.PannableFold&&(m=b.nj(m,_)),m=b.Hn(m,_,0,!0,1e5*_.rm(),null)));return m},b.SD=function(m,_,C){var D=_.Yr();if(D==null)return m;var L=(_=_.tc()).Le().S(),B=new A.l;m.yc(B);var q=new A.Oc;B.en(q),B=D.Ha(),D=null;for(var Q=new A.Ed;B.ab();)for(;B.Ia();){var oe=B.ia(),le=oe.Vg(0,0),be=new A.Oc;for(be.L(le.pa,le.wa),le=0;be.wa>q.pa;)be.move(-L),--le;for(;be.pa<=q.wa;){if(be.isIntersecting(q)){D==null&&(D=new A.Ua);var Me=A.zb.YO(oe.bc(),oe.xc());le!=0&&(Q.ig(le*L,0),Me.Pc(Q)),D.pc(Me,!0)}be.move(L),++le}}return D!=null?(_=A.ua.bO(_,D),_=A.ua.Gr(_),A.bu.gP(m,D,_,C)):m},b.$N=function(m,_,C,D,L){return m>=C&&_<=D?0:b.oE(.5*(_+m),C,D,L)},b.oE=function(m,_,C,D){return A.mc.round((.5*(C+_)-m)/D)*D},b.QQ=function(m,_,C,D,L,B,q,Q){var oe=b.fv(D,L),le=oe.S(),be=le/360,Me=b.kE*be,Ye=m.vb(0),it=_.Xc(),Lt=it?le/_.Le().S():0;_=m.Ja();for(var Ut=0,Je=C.ea();UtMe){if(Rt){var ji=Zt+Ur-1,Xr=Zt;(!ii||Ur+11*be&&(it=!1)}Rt||(Mn=Wn+(ki-=A.mc.En(le,Mn-Ni)),++tr,eo=ki!=0,os.x=Mn)}else wi||A.ua.vG(bn,qr,os,cr)&&(wi=!0);eo&&Ci.write(2*Ur,Mn),Ni=Mn,bn.N(qr),qr.N(os)}tr!=0&&ri.Qc(1993),Rt=ri.Oa(0),ti=ri.Oa(ti-1),A.h.ub(Rt,ti),ri=b.rQ(ri,D,isNaN(L)?0:L,B),_.add(ri,!1)}return m=D.Yd(0),C=oe.S()/180,b.Lt(_,oe,.1*m,!1),A.ti.clip(_,oe,m,C,B)},b.rQ=function(m,_,C,D){return b.Hn(m,_,C,!0,0,D)},b.JS=function(m,_,C,D){var L=m.K();if(L==1736)for(_=_!=null?_.Yd(0):0,L=0;LC)for(var L=new A.Ta,B=0;BC)for(var L=new A.Ta,B=0;Bthis.Ko},T.prototype.az=function(){if(this.B())throw A.i.ga("invalid call");return new A.Ta(this.Ds.x,this.Ds.y)},T.prototype.Va=function(){if(this.B())throw A.i.ga("invalid call");return this.Ko},T.prototype.cz=function(){if(this.B())throw A.i.ga("invalid call");return this.La},T.prototype.Nz=function(){return(1&this.pw)!=0},T.prototype.by=function(b,m,_,C){this.Ds.x=b,this.Ds.y=m,this.Ko=_,this.La=C},T}();A.bm=H}(ae||(ae={})),function(A){var ye=function(){function T(){}return T.prototype.Wo=function(b,m){this.vh.resize(0),this.Ki.length=0,this.vk=-1,b.yc(this.Gk),this.Gk.X(m,m),this.Gk.isIntersecting(this.Gb.Da)?((this.xs=A.ba.zd(b.K()))?(this.OH=b.bc(),this.NH=b.xc(),this.ra=m):this.ra=NaN,this.vh.add(this.Gb.kf),this.Ki.push(this.Gb.Da),this.Ss=this.Gb.Wr(this.Gb.kf)):this.Ss=-1},T.prototype.Zi=function(b,m){this.vh.resize(0),this.Ki.length=0,this.vk=-1,this.Gk.L(b),this.Gk.X(m,m),this.ra=NaN,this.Gk.isIntersecting(this.Gb.Da)?(this.vh.add(this.Gb.kf),this.Ki.push(this.Gb.Da),this.Ss=this.Gb.Wr(this.Gb.kf),this.xs=!1):this.Ss=-1},T.prototype.next=function(){if(this.vh.size==0)return-1;this.vk=this.Ss;var b=null,m=null,_=null,C=null;this.xs&&(b=new A.h,m=new A.h,_=new A.l);for(var D=!1;!D;){for(;this.vk!=-1;){var L=this.Gb.Xy(this.Gb.hv(this.vk));if(L.isIntersecting(this.Gk)){if(!this.xs){D=!0;break}if(b.N(this.OH),m.N(this.NH),_.L(L),_.X(this.ra,this.ra),0<_.uy(b,m)){D=!0;break}}this.vk=this.Gb.pv(this.vk)}if(this.vk==-1){L=this.vh.Gc();var B=this.Ki[this.Ki.length-1];for(C==null&&((C=[])[0]=new A.l,C[1]=new A.l,C[2]=new A.l,C[3]=new A.l),H.zJ(B,C),this.vh.Jf(),--this.Ki.length,B=0;4>B;B++){var q=this.Gb.Np(L,B);if(q!=-1&&0>C);D==0?(m.v=.5*(m.v+m.C),m.G=.5*(m.G+m.H)):D==1?(m.C=.5*(m.v+m.C),m.G=.5*(m.G+m.H)):(D==2?m.C=.5*(m.v+m.C):m.v=.5*(m.v+m.C),m.H=.5*(m.G+m.H))}return m},T.prototype.RR=function(b){return this.vz(b)},T.prototype.qR=function(b,m){return ye.XO(this,b,m)},T.prototype.HF=function(b,m){return ye.WO(this,b,m)},T.prototype.getIterator=function(){return ye.VO(this)},T.prototype.Pk=function(b,m){if(0>m||32<2*m)throw A.i.O("invalid height");this.wT=m,this.Da.L(b),this.kf=this.jf.De(),this.jx(this.kf,0),this.dx(this.kf,0),this.IJ(this.kf,0),this.FJ(this.kf,0)},T.prototype.Bv=function(b,m,_,C,D,L,B){if(!C.contains(m))return _==0?-1:this.Bv(b,m,0,this.Da,this.kf,L,B);if(!L)for(var q=D;q!=-1;q=this.DR(q))this.jx(q,this.vz(q)+1);(q=new A.l).L(C),C=D;var Q=[];for(Q[0]=new A.l,Q[1]=new A.l,Q[2]=new A.l,Q[3]=new A.l;_le;le++)if(Q[le].contains(m)){oe=!0;var be=this.Np(C,le);be==-1&&(be=this.mP(C,le)),this.jx(be,this.vz(be)+1),C=be,q.L(Q[le]);break}if(!oe)break}return this.nS(b,m,_,q,C,L,D,B)},T.prototype.nS=function(b,m,_,C,D,L,B,q){var Q=this.IF(D);if(L){if(D==B)return q;this.NP(q),L=q}else L=this.oP(),this.IB(L,b),this.FW(this.hv(L),m);return this.hX(L,D),Q!=-1?(this.hx(L,Q),this.ex(Q,L)):this.BJ(D,L),this.NB(D,L),this.dx(D,this.nv(D)+1),this.cO(D)&&this.HQ(_,C,D),L},T.prototype.NP=function(b){var m=this.RF(b),_=this.IF(m),C=this.JR(b),D=this.pv(b);this.Wr(m)==b?(D!=-1?this.hx(D,-1):this.NB(m,-1),this.BJ(m,D)):_==b?(this.ex(C,-1),this.NB(m,C)):(this.hx(D,C),this.ex(C,D)),this.hx(b,-1),this.ex(b,-1),this.dx(m,this.nv(m)-1)},T.zJ=function(b,m){var _=.5*(b.v+b.C),C=.5*(b.G+b.H);m[0].L(_,C,b.C,b.H),m[1].L(b.v,C,_,b.H),m[2].L(b.v,b.G,_,C),m[3].L(_,b.G,b.C,C)},T.prototype.cO=function(b){return this.nv(b)==8&&!this.bG(b)},T.prototype.HQ=function(b,m,_){var C=this.Wr(_);do{var D=this.hv(C),L=this.ai.U(C,0);D=this.Xy(D),this.Bv(L,D,b,m,_,!0,C),C=L=this.pv(C)}while(C!=-1)},T.prototype.dO=function(b){return 8<=this.nv(b)||this.bG(b)},T.prototype.bG=function(b){return this.Np(b,0)!=-1||this.Np(b,1)!=-1||this.Np(b,2)!=-1||this.Np(b,3)!=-1},T.prototype.mP=function(b,m){var _=this.jf.De();return this.JW(b,m,_),this.jx(_,0),this.dx(_,0),this.Rk(_,b),this.FJ(_,this.lv(b)+1),this.IJ(_,m<<2*this.lv(b)|this.LF(b)),_},T.prototype.oP=function(){var b=this.ai.De();if(0>4)]|=this.dH<<2*(15&D)},b}();A.DY=H;var T=function(){function b(m,_,C){this.Xh=null,this.NA=this.Kk=this.YH=this.WH=this.Gs=this.lH=this.Hf=this.Wm=0,this.Ti=this.Lk=this.xl=null,this.Az(m,_,C)}return b.create=function(m,_,C){if(!b.uE(m))throw A.i.O();return b.rP(m,_,C)},b.kW=function(m){switch(m){case 0:m=1024;break;case 1:m=16384;break;case 2:m=262144;break;default:throw A.i.ga("Internal Error")}return m},b.uE=function(m){return!(m.B()||m.K()!=1607&&m.K()!=1736)},b.prototype.mQ=function(m,_){_=_.Ha();for(var C=new A.h,D=new A.h;_.ab();)for(;_.Ia();){var L=_.ia();if(L.K()!=322)throw A.i.ga("Internal Error");m.Gh(L.bc(),C),m.Gh(L.xc(),D),this.Ti.fy(C.x,C.y,D.x,D.y)}this.Ti.dJ(A.Ox.Bx)},b.prototype.nQ=function(){throw A.i.ga("Internal Error")},b.prototype.My=function(m,_){for(var C=1;4>C;C++)m.fy(_[C-1].x,_[C-1].y,_[C].x,_[C].y);m.fy(_[3].x,_[3].y,_[0].x,_[0].y),this.Ti.dJ(A.Ox.Bx)},b.prototype.mK=function(m,_,C){for(var D=[null,null,null,null],L=0;L(it=L.length());it==0?L.na(1,0):(Lt||be.N(oe),L.scale(C/it),B.na(-L.y,L.x),q.na(L.y,-L.x),Q.sub(L),oe.add(L),D[0].add(Q,B),D[1].add(Q,q),D[2].add(oe,q),D[3].add(oe,B),Lt?Me=!0:this.My(m,D))}else Me&&(this.My(m,D),Me=!1),Ye=!0}Me&&this.My(m,D)}},b.prototype.nC=function(m){return A.P.truncate(m*this.lH+this.WH)},b.prototype.oC=function(m){return A.P.truncate(m*this.Gs+this.YH)},b.rP=function(m,_,C){return new b(m,_,C)},b.prototype.Az=function(m,_,C){this.Hf=Math.max(A.P.truncate(2*Math.sqrt(C)+.5),64),this.Wm=A.P.truncate((2*this.Hf+31)/32),this.xl=new A.l,this.Kk=_,C=0;for(var D=this.Hf,L=this.Wm;8<=D;)C+=D*L,D=A.P.truncate(D/2),L=A.P.truncate((2*D+31)/32);this.Xh=A.P.mg(C,0),this.Ti=new A.Ox,C=new H(this.Xh,this.Wm,this),this.Ti.wX(this.Hf,this.Hf,C),m.A(this.xl),this.xl.X(_,_),D=new A.l;var B=_*(L=A.l.construct(1,1,this.Hf-2,this.Hf-2)).S();switch(_*=L.da(),D.L(this.xl.tf(),Math.max(B,this.xl.S()),Math.max(_,this.xl.da())),this.NA=this.Kk,this.Lk=new A.Ed,this.Lk.kS(D,L),new A.Ed,m.K()){case 550:C.ax(this.Ti,2),this.nQ();break;case 1607:C.ax(this.Ti,2),this.mK(this.Ti,m,this.NA);break;case 1736:C.ax(this.Ti,1),this.mQ(this.Lk,m),C.ax(this.Ti,2),this.mK(this.Ti,m,this.NA)}this.lH=this.Lk.eb,this.Gs=this.Lk.bb,this.WH=this.Lk.Lb,this.YH=this.Lk.Qb,this.SN()},b.prototype.SN=function(){this.Ti.flush();for(var m=0,_=this.Hf*this.Wm,C=this.Hf,D=A.P.truncate(this.Hf/2),L=this.Wm,B=A.P.truncate((2*D+31)/32);8>4;le=2*(15&le);var Ye=be>>4;be=2*(15&be);var it=this.Xh[m+L*q+Me]>>le&3;it|=this.Xh[m+L*q+Ye]>>be&3,it|=this.Xh[m+L*Q+Me]>>le&3,it|=this.Xh[m+L*Q+Ye]>>be&3,this.Xh[_+B*C+(oe>>4)]|=it<<2*(15&oe)}C=D,L=B,m=_,D=A.P.truncate(C/2),B=A.P.truncate((2*D+31)/32),_=m+L*C}},b.prototype.Uo=function(m,_){return this.xl.contains(m,_)?(m=this.nC(m),_=this.oC(_),0>m||m>=this.Hf||0>_||_>=this.Hf||(_=this.Xh[this.Wm*_+(m>>4)]>>2*(15&m)&3)==0?0:_==1?1:2):0},b.prototype.To=function(m){if(!m.Fa(this.xl))return 0;var _=this.nC(m.v),C=this.nC(m.C),D=this.oC(m.G);if(m=this.oC(m.H),0>_&&(_=0),0>D&&(D=0),C>=this.Hf&&(C=this.Hf-1),m>=this.Hf&&(m=this.Hf-1),_>C||D>m)return 0;for(var L=Math.max(C-_,1)*Math.max(m-D,1),B=0,q=this.Wm,Q=this.Hf,oe=0;;){if(32>L||16>Q){for(L=D;L<=m;L++)for(var le=_;le<=C;le++)if(1<(oe=this.Xh[B+q*L+(le>>4)]>>2*(15&le)&3))return 2;if(oe==0)return 0;if(oe==1)return 1}B+=q*Q,Q=A.P.truncate(Q/2),q=A.P.truncate((2*Q+31)/32),_=A.P.truncate(_/2),D=A.P.truncate(D/2),C=A.P.truncate(C/2),m=A.P.truncate(m/2),L=Math.max(C-_,1)*Math.max(m-D,1)}},b.prototype.MR=function(){return this.Hf*this.Wm},b}();A.Mx=T}(ae||(ae={})),function(A){var ye;(ye=A.QL||(A.QL={}))[ye.contains=1]="contains",ye[ye.within=2]="within",ye[ye.equals=3]="equals",ye[ye.disjoint=4]="disjoint",ye[ye.touches=8]="touches",ye[ye.crosses=16]="crosses",ye[ye.overlaps=32]="overlaps",ye[ye.unknown=0]="unknown",ye[ye.intersects=1073741824]="intersects";var H=function(){function b(){}return b.construct=function(m,_,C,D,L,B,q,Q){var oe=new b;return oe.rw=m,oe.Om=_,oe.Mj=C,oe.Ui=D,oe.wH=L,oe.OY=B,oe.PY=q,oe.QY=Q,oe},b}();A.Xt=function(){function b(){}return b.xD=function(m,_,C){if(b.ry(m)){var D=A.ua.mj(_,m,!1);_=!1,A.Wk.xE(m)&&(_=_||m.nu(D,C)),(D=m.K())!=1736&&D!=1607||!A.Wk.vE(m)||C==0||(_=_||m.hj(C)),D!=1736&&D!=1607||!A.Wk.wE(m)||C==0||_||m.cM()}},b.ry=function(m){return A.Wk.xE(m)||A.Wk.vE(m)||A.Wk.wE(m)},b}();var T=function(){function b(){this.th=[]}return b.uB=function(m,_,C,D,L){var B=m.K(),q=_.K();if(B==197){if(q==197)return b.oW(m,_,C,D);if(q==33)return D==2?D=1:D==1&&(D=2),b.cJ(_,m,C,D)}else if(B==33){if(q==197)return b.cJ(m,_,C,D);if(q==33)return b.qW(m,_,C,D)}if(m.B()||_.B())return D==4;var Q=new A.l;m.A(Q);var oe=new A.l;_.A(oe);var le=new A.l;if(le.L(Q),le.$b(oe),C=A.ua.Xd(C,le,!1),b.fk(Q,oe,C))return D==4;switch(Q=!1,A.Xk.zd(B)&&((B=new A.Ua(m.description)).pc(m,!0),m=B,B=1607),A.Xk.zd(q)&&((q=new A.Ua(_.description)).pc(_,!0),_=q,q=1607),B!=197&&q!=197?(m.Eb()<_.Eb()||B==33&&q==550)&&(D==2?D=1:D==1&&(D=2)):B!=1736&&q!=197&&(D==2?D=1:D==1&&(D=2)),B){case 1736:switch(q){case 1736:Q=b.st(m,_,C,D,L);break;case 1607:Q=b.bn(m,_,C,D,L);break;case 33:Q=b.rt(m,_,C,D);break;case 550:Q=b.qt(m,_,C,D,L);break;case 197:Q=b.BI(m,_,C,D,L)}break;case 1607:switch(q){case 1736:Q=b.bn(_,m,C,D,L);break;case 1607:Q=b.bB(m,_,C,D,L);break;case 33:Q=b.ut(m,_,C,D,L);break;case 550:Q=b.tt(m,_,C,D,L);break;case 197:Q=b.HI(m,_,C,D)}break;case 33:switch(q){case 1736:Q=b.rt(_,m,C,D);break;case 1607:Q=b.ut(_,m,C,D,L);break;case 550:Q=b.mt(_,m,C,D)}break;case 550:switch(q){case 1736:Q=b.qt(_,m,C,D,L);break;case 1607:Q=b.tt(_,m,C,D,L);break;case 550:Q=b.UA(m,_,C,D,L);break;case 33:Q=b.mt(m,_,C,D);break;case 197:Q=b.cI(m,_,C,D)}break;case 197:switch(q){case 1736:Q=b.BI(_,m,C,D,L);break;case 1607:Q=b.HI(_,m,C,D);break;case 550:Q=b.cI(_,m,C,D)}}return Q},b.oW=function(m,_,C,D){if(m.B()||_.B())return D==4;var L=new A.l,B=new A.l,q=new A.l;switch(m.A(L),_.A(B),q.L(L),q.$b(B),m=A.ua.Xd(C,q,!1),D){case 4:return b.fk(L,B,m);case 2:return b.eF(B,L,m);case 1:return b.eF(L,B,m);case 3:return b.gk(L,B,m);case 8:return b.YP(L,B,m);case 32:return b.XP(L,B,m);case 16:return b.WP(L,B,m)}return!1},b.cJ=function(m,_,C,D){if(m.B()||_.B())return D==4;m=m.D();var L=new A.l,B=new A.l;switch(_.A(L),B.L(m),B.$b(L),_=A.ua.Xd(C,B,!1),D){case 4:return b.Tw(m,L,_);case 2:return b.$A(m,L,_);case 1:return b.MU(m,L,_);case 3:return b.qI(m,L,_);case 8:return b.ZA(m,L,_)}return!1},b.qW=function(m,_,C,D){if(m.B()||_.B())return D==4;m=m.D(),_=_.D();var L=new A.l;switch(L.L(m),L.$b(_),C=A.ua.Xd(C,L,!1),D){case 4:return b.NU(m,_,C);case 2:return b.pI(_,m,C);case 1:return b.pI(m,_,C);case 3:return b.rI(m,_,C)}return!1},b.st=function(m,_,C,D,L){switch(D){case 4:return b.fV(m,_,C);case 2:return b.Uw(_,m,C,L);case 1:return b.Uw(m,_,C,L);case 3:return b.iV(m,_,C);case 8:return b.qV(m,_,C);case 32:return b.lV(m,_,C,L)}return!1},b.bn=function(m,_,C,D,L){switch(D){case 4:return b.gV(m,_,C);case 1:return b.aB(m,_,C,L);case 8:return b.rV(m,_,C,L);case 16:return b.bV(m,_,C)}return!1},b.rt=function(m,_,C,D){switch(D){case 4:return b.eV(m,_,C);case 1:return b.ZU(m,_,C);case 8:return b.pV(m,_,C)}return!1},b.qt=function(m,_,C,D){switch(D){case 4:return b.dV(m,_,C);case 1:return b.YU(m,_,C);case 8:return b.oV(m,_,C);case 16:return b.aV(m,_,C)}return!1},b.BI=function(m,_,C,D,L){if(b.cV(m,_,C))return D==4;if(D==4)return!1;switch(D){case 2:return b.sV(m,_,C);case 1:return b.XU(m,_,C);case 3:return b.hV(m,_,C);case 8:return b.nV(m,_,C,L);case 32:return b.kV(m,_,C,L);case 16:return b.$U(m,_,C,L)}return!1},b.bB=function(m,_,C,D){switch(D){case 4:return b.BV(m,_,C);case 2:return b.FI(_,m,C);case 1:return b.FI(m,_,C);case 3:return b.DV(m,_,C);case 8:return b.II(m,_,C);case 32:return b.HV(m,_,C);case 16:return b.GI(m,_,C)}return!1},b.ut=function(m,_,C,D){switch(D){case 4:return b.AV(m,_,C);case 1:return b.vV(m,_,C);case 8:return b.LV(m,_,C)}return!1},b.tt=function(m,_,C,D){switch(D){case 4:return b.zV(m,_,C);case 1:return b.uV(m,_,C);case 8:return b.KV(m,_,C);case 16:return b.xV(m,_,C)}return!1},b.HI=function(m,_,C,D){if(b.yV(m,_,C))return D==4;if(D==4)return!1;switch(D){case 2:return b.MV(m,_,C);case 1:return b.tV(m,_,C);case 3:return b.CV(m,_,C);case 8:return b.JV(m,_,C);case 32:return b.GV(m,_,C);case 16:return b.wV(m,_,C)}return!1},b.UA=function(m,_,C,D){switch(D){case 4:return b.bU(m,_,C);case 2:return b.$H(_,m,C);case 1:return b.$H(m,_,C);case 3:return b.dU(m,_,C);case 32:return b.jU(m,_,C)}return!1},b.mt=function(m,_,C,D){switch(D){case 4:return b.aI(m,_,C);case 2:return b.nU(m,_,C);case 1:return b.ZT(m,_,C);case 3:return b.Pw(m,_,C)}return!1},b.cI=function(m,_,C,D){switch(D){case 4:return b.aU(m,_,C);case 2:return b.mU(m,_,C);case 1:return b.YT(m,_,C);case 3:return b.cU(m,_,C);case 8:return b.lU(m,_,C);case 16:return b.$T(m,_,C)}return!1},b.iV=function(m,_,C){var D=new A.l,L=new A.l;return m.A(D),_.A(L),!!b.gk(D,L,C)&&(D=b.rc(m,_,!1))!=4&&D!=1&&D!=2&&(!!b.ZH(m,_,C)||(D=m.Rb(),L=_.Rb(),!(Math.abs(D-L)>4*Math.max(m.I(),_.I())*C)&&b.Rz(m,_,C,!0)))},b.fV=function(m,_,C){var D=b.rc(m,_,!0);return D==4||D!=1&&D!=2&&D!=1073741824&&b.zI(m,_,C)},b.qV=function(m,_,C){var D=b.rc(m,_,!1);return D!=4&&D!=1&&D!=2&&b.DI(m,_,C,null)},b.lV=function(m,_,C,D){var L=b.rc(m,_,!1);return L!=4&&L!=1&&L!=2&&b.AI(m,_,C,D)},b.Uw=function(m,_,C,D){var L=new A.l,B=new A.l;return m.A(L),_.A(B),!!b.Ac(L,B,C)&&(L=b.rc(m,_,!1))!=4&&L!=2&&(L==1||b.wI(m,_,C,D))},b.gV=function(m,_,C){var D=b.rc(m,_,!0);return D==4||D!=1&&D!=1073741824&&b.zI(m,_,C)},b.rV=function(m,_,C,D){var L=b.rc(m,_,!1);return L!=4&&L!=1&&b.EI(m,_,C,D)},b.bV=function(m,_,C){var D=b.rc(m,_,!1);return D!=4&&D!=1&&b.yI(m,_,C,null)},b.aB=function(m,_,C,D){var L=new A.l,B=new A.l;return m.A(L),_.A(B),!!b.Ac(L,B,C)&&(L=b.rc(m,_,!1))!=4&&(L==1||b.xI(m,_,C,D))},b.eV=function(m,_,C){return A.jd.FG(m,_,C)==0},b.pV=function(m,_,C){return _=_.D(),b.CI(m,_,C)},b.ZU=function(m,_,C){return _=_.D(),b.vI(m,_,C)},b.dV=function(m,_,C){var D=b.rc(m,_,!1);if(D==4)return!0;if(D==1)return!1;D=new A.l,m.A(D),D.X(C,C);for(var L=new A.h,B=0;B<_.I();B++)if(_.D(B,L),D.contains(L)){var q=A.jd.Zd(m,L,C);if(q==1||q==2)return!1}return!0},b.oV=function(m,_,C){var D=this.rc(m,_,!1);if(D==4||D==1)return!1;D=new A.l,m.A(D),D.X(C,C);for(var L=!1,B=m,q=!1,Q=0;Q<_.I();Q++){var oe=_.Oa(Q);if(D.contains(oe)){if((oe=A.jd.Zd(B,oe,C))==2)L=!0;else if(oe==1)return!1}q||(!A.Fg.Ol(m,_.I()-1)||m.Cb!=null&&m.Cb.Gb!=null?B=m:(B=new A.Ea,m.copyTo(B),B.hj(1)),q=!0)}return!!L},b.aV=function(m,_,C){var D=this.rc(m,_,!1);if(D==4||D==1)return!1;var L=new A.l;D=new A.l;var B=new A.l;m.A(L),_.A(B),D.L(L),D.X(C,C),B=L=!1;for(var q=m,Q=!1,oe=0;oe<_.I();oe++){var le=_.Oa(oe);if(D.contains(le)?(le=A.jd.Zd(q,le,C))==0?B=!0:le==1&&(L=!0):B=!0,L&&B)return!0;Q||(!A.Fg.Ol(m,_.I()-1)||m.Cb!=null&&m.Cb.Gb!=null?q=m:(q=new A.Ea,m.copyTo(q),q.hj(1)),Q=!0)}return!1},b.YU=function(m,_,C){var D=new A.l,L=new A.l;if(m.A(D),_.A(L),!this.Ac(D,L,C)||(L=this.rc(m,_,!1))==4)return!1;if(L==1)return!0;L=!1;for(var B=m,q=!1,Q=0;Q<_.I();Q++){var oe=_.Oa(Q);if(!D.contains(oe))return!1;if((oe=A.jd.Zd(B,oe,C))==1)L=!0;else if(oe==0)return!1;q||(!A.Fg.Ol(m,_.I()-1)||m.Cb!=null&&m.Cb.Gb!=null?B=m:(B=new A.Ea,m.copyTo(B),B.hj(1)),q=!0)}return L},b.hV=function(m,_,C){var D=new A.l,L=new A.l;return m.A(D),_.A(L),!!b.gk(D,L,C)&&((D=new A.Ea).bd(_,!1),b.Rz(m,D,C,!0))},b.cV=function(m,_,C){var D=b.rc(m,_,!1);if(D==4)return!0;if(D==1||D==2)return!1;var L=new A.l;if(D=new A.l,m.A(L),_.A(D),b.Ac(D,L,C)||(L=new A.h,D.fn(L),(_=A.jd.Zd(m,L,C))!=0)||(D.VI(L),(_=A.jd.Zd(m,L,C))!=0)||(D.gn(L),(_=A.jd.Zd(m,L,C))!=0)||(D.YI(L),(_=A.jd.Zd(m,L,C))!=0))return!1;_=m.vb(0),(L=new A.l).L(D),L.X(C,C);for(var B=0,q=m.I();BC&&B.S()>C||B.da()<=C&&B.S()<=C)&&(L=new A.Ua,B=new A.Ta,_.If(0,B),L.nf(B),_.If(2,B),L.lineTo(B),b.yI(m,L,C,D))},b.DV=function(m,_,C){var D=new A.l,L=new A.l;return m.A(D),_.A(L),!(!b.gk(D,L,C)||b.rc(m,_,!1)==4)&&(!!b.ZH(m,_,C)||b.Rz(m,_,C,!1))},b.BV=function(m,_,C){return this.rc(m,_,!1)==4||!!new A.am(m,_,C,!0).next()&&!this.OG(m,_,C)},b.II=function(m,_,C){if(b.rc(m,_,!1)==4)return!1;var D=new A.ce(0);if(b.Sz(m,_,C,D)!=0)return!1;for(var L=new A.ee,B=0;BC&&L.S()>C)&&b.gk(D,L,C)},b.yV=function(m,_,C){var D=new A.l,L=new A.l;return m.A(D),_.A(L),!b.Ac(L,D,C)&&!b.NG(m,L,C)},b.JV=function(m,_,C){var D=new A.l,L=new A.l;if(m.A(D),_.A(L),L.da()<=C&&L.S()<=C)return L=_.Kp(),b.Uz(m,L,C);if(L.da()<=C||L.S()<=C)return L=new A.Ua,D=new A.Ta,_.If(0,D),L.nf(D),_.If(2,D),L.lineTo(D),b.II(m,L,C);m=m.Ha(),_=new A.l,D=new A.l,_.L(L),D.L(L),_.X(-C,-C),D.X(C,C),L=!1;for(var B=new A.l,q=new A.l;m.ab();)for(;m.Ia();){if(m.ia().A(B),q.L(_),q.Fa(B),!q.B()&&(q.da()>C||q.S()>C))return!1;q.L(D),q.Fa(B),q.B()||(L=!0)}return L},b.GV=function(m,_,C){var D=new A.l,L=new A.l;return m.A(D),_.A(L),!(b.Ac(D,L,C)||b.Ac(L,D,C)||b.Ac(L,D,C)||L.da()>C&&L.S()>C||L.da()<=C&&L.S()<=C)&&(D=new A.Ua,L=new A.Ta,_.If(0,L),D.nf(L),_.If(2,L),D.lineTo(L),b.QG(m,D,C))},b.MV=function(m,_,C){var D=new A.l,L=new A.l;if(m.A(D),_.A(L),!b.Ac(L,D,C)||L.da()<=C&&L.S()<=C)return!1;if(L.da()<=C||L.S()<=C)return b.Ac(L,D,C);m=m.Ha(),(_=new A.l).L(L),_.X(-C,-C),L=!1,D=new A.l;for(var B=new A.l;m.ab();)for(;m.Ia();)m.ia().A(D),_.jm(D)?L=!0:(B.L(_),B.Fa(D),!B.B()&&(B.da()>C||B.S()>C)&&(L=!0));return L},b.tV=function(m,_,C){var D=new A.l,L=new A.l;return _.A(L),m.A(D),!(!b.Ac(D,L,C)||L.da()>C&&L.S()>C)&&(L.da()<=C&&L.S()<=C?(_=_.Kp(),b.MG(m,_,C)):(D=new A.Ua,L=new A.Ta,_.If(0,L),D.nf(L),_.If(2,L),D.lineTo(L),b.Am(D,m,C,!1)))},b.wV=function(m,_,C){var D=new A.l,L=new A.l;if(m.A(D),_.A(L),b.Ac(L,D,C)||L.da()<=C&&L.S()<=C)return!1;if(L.da()<=C||L.S()<=C)return D=new A.Ua,L=new A.Ta,_.If(0,L),D.nf(L),_.If(2,L),D.lineTo(L),b.GI(m,D,C);m=m.Ha(),_=new A.l,(D=new A.l).L(L),_.L(L),D.X(-C,-C),_.X(C,C);for(var B=L=!1,q=new A.l,Q=new A.l;m.ab();)for(;m.Ia();)if(m.ia().A(q),B||_.contains(q)||(B=!0),L||(Q.L(D),Q.Fa(q),!Q.B()&&(Q.da()>C||Q.S()>C)&&(L=!0)),L&&B)return!0;return!1},b.dU=function(m,_,C){var D=new A.l,L=new A.l;return m.A(D),_.A(L),!!b.gk(D,L,C)&&(!!b.eU(m,_,C)||b.TA(m,_,C,!1,!0,!1))},b.bU=function(m,_,C){return!b.bI(m,_,C)},b.jU=function(m,_,C){return b.TA(m,_,C,!1,!1,!0)},b.$H=function(m,_,C){var D=new A.l,L=new A.l;return m.A(D),_.A(L),!!b.Ac(D,L,C)&&b.TA(_,m,C,!0,!1,!1)},b.Ow=function(m,_,C){C*=C;for(var D=new A.h,L=new A.h,B=0;B<_.I();B++){_.D(B,L);for(var q=!1,Q=0;QC||L.S()>C)&&b.gk(D,L,C)},b.aU=function(m,_,C){var D=new A.l,L=new A.l;if(m.A(D),_.A(L),b.Ac(L,D,C))return!1;for((_=new A.l).L(L),_.X(C,C),C=new A.h,L=0;LC?B.X(0,-C):B.X(-C,0);for(var Q=0;QC){if(_.y>B.G&&_.yB.v&&_.xC?D.X(0,-C):D.X(-C,0),B.X(C,C);for(var q=new A.h,Q=0;QC?q.y>D.G&&q.yD.v&&q.xC||L.S()>C)&&(_=_.Kp(),!b.lt(m,_,C))},b.$T=function(m,_,C){var D=new A.l,L=new A.l;if(m.A(D),_.A(L),b.Ac(L,D,C)||L.da()<=C&&L.S()<=C)return!1;if(L.da()<=C||L.S()<=C){_=new A.l,D=new A.l,_.L(L),L.da()>C?_.X(0,-C):_.X(-C,0),D.L(L),D.X(C,C);for(var B=new A.h,q=!1,Q=!1,oe=0;oeC?B.y>_.G&&B.y<_.H&&(q=!0):B.x>_.v&&B.x<_.C&&(q=!0)),Q||D.contains(B)||(Q=!0),q&&Q)return!0;return!1}for(_=new A.l,D=new A.l,_.L(L),_.X(-C,-C),D.L(L),D.X(C,C),B=new A.h,Q=q=!1,oe=0;oeC*C},b.pI=function(m,_,C){return b.rI(m,_,C)},b.qI=function(m,_,C){var D=new A.l;return D.L(m),b.gk(D,_,C)},b.Tw=function(m,_,C){var D=new A.l;return D.L(_),D.X(C,C),!D.contains(m)},b.ZA=function(m,_,C){if(_.da()<=C&&_.S()<=C)return!1;var D=new A.l,L=new A.l;if(D.L(_),D.X(C,C),!D.contains(m))return!1;if(_.da()<=C||_.S()<=C){if(L.L(_),_.da()>C?L.X(0,-C):L.X(-C,0),_.da()>C){if(m.y>L.G&&m.yL.v&&m.xC?D.X(0,-C):D.X(-C,0);var L=!1;return _.da()>C?m.y>D.G&&m.yD.v&&m.xC&&m.S()>C&&(_.da()<=C||_.S()<=C)?D=_:(D=m,m=_),D.da()<=C||D.S()<=C){if(m.da()<=C||m.S()<=C){_=new A.zb;var L=new A.zb,B=[0,0],q=[0,0],Q=new A.h;return D.fn(Q),_.Ec(Q),D.gn(Q),_.Rc(Q),m.fn(Q),L.Ec(Q),m.gn(Q),L.Rc(Q),_.Fa(L,null,B,q,C),_.Fa(L,null,null,null,C)==1&&(B[0]==0||B[1]==1||q[0]==0||q[1]==1)}return _=new A.l,L=new A.l,_.L(m),_.X(-C,-C),L.L(_),L.Fa(D),!(!L.B()&&(L.da()>C||L.S()>C))}return m.X(C,C),(L=new A.l).L(D),L.Fa(m),!(L.B()||!L.B()&&L.da()>C&&L.S()>C)},b.XP=function(m,_,C){if(b.Ac(m,_,C)||b.Ac(_,m,C)||m.da()<=C&&m.S()<=C||_.da()<=C&&_.S()<=C)return!1;if(m.da()<=C||m.S()<=C){if(_.da()>C&&_.S()>C)return!1;var D=new A.zb,L=new A.zb,B=[0,0],q=[0,0],Q=new A.h;return m.fn(Q),D.Ec(Q),m.gn(Q),D.Rc(Q),_.fn(Q),L.Ec(Q),_.gn(Q),L.Rc(Q),D.Fa(L,null,B,q,C),D.Fa(L,null,null,null,C)==2&&(0B[1])&&(0q[1])}return!(_.da()<=C||_.S()<=C)&&((D=new A.l).L(m),D.Fa(_),!(D.B()||D.da()<=C||D.S()<=C))},b.eF=function(m,_,C){if(!b.Ac(m,_,C))return!1;if(m.da()<=C&&m.S()<=C)return m=m.tf(),b.$A(m,_,C);if(_.da()<=C&&_.S()<=C)return _=_.tf(),b.$A(_,m,C);if(m.da()<=C||m.S()<=C)return b.Ac(m,_,C);if(_.da()<=C||_.S()<=C){var D=new A.l;return D.L(m),D.X(-C,-C),D.jm(_)?!0:((m=new A.l).L(D),m.Fa(_),!(m.B()||m.da()<=C&&m.S()<=C))}return b.Ac(m,_,C)},b.WP=function(m,_,C){if(b.Ac(m,_,C)||b.Ac(_,m,C)||m.da()<=C&&m.S()<=C||_.da()<=C&&_.S()<=C||_.da()>C&&_.S()>C&&m.da()>C&&m.S()>C)return!1;if(m.da()>C&&m.S()>C)var D=_;else D=m,m=_;if(m.da()>C&&m.S()>C){_=new A.l;var L=new A.l;return L.L(m),L.X(-C,-C),_.L(L),_.Fa(D),!(_.B()||_.da()<=C&&_.S()<=C)}_=new A.zb,L=new A.zb;var B=[0,0],q=[0,0],Q=new A.h;return D.fn(Q),_.Ec(Q),D.gn(Q),_.Rc(Q),m.fn(Q),L.Ec(Q),m.gn(Q),L.Rc(Q),_.Fa(L,null,B,q,C),_.Fa(L,null,null,null,C)==1&&0B[1]&&0q[1]},b.zI=function(m,_,C){var D=new A.l,L=new A.l,B=new A.am(m,_,C,!0);if(!B.next())return!0;if(this.OG(m,_,C))return!1;var q=m,Q=null;_.K()==1736&&(Q=_);var oe=!1,le=!1;do{var be=B.pl(),Me=B.jl();if(Me=_.Oa(_.Ca(Me)),D.L(B.oz()),D.X(C,C),D.contains(Me)&&(Me=A.jd.Zd(q,Me,0))!=0||_.K()==1736&&(be=m.Oa(m.Ca(be)),L.L(B.Wy()),L.X(C,C),L.contains(be)&&(Me=A.jd.Zd(Q,be,0))!=0))return!1;oe||(!A.Fg.Ol(m,_.ea()-1)||m.Cb!=null&&m.Cb.Gb!=null?q=m:(q=new A.Ea,m.copyTo(q),q.hj(1)),oe=!0),_.K()!=1736||le||(le=_,!A.Fg.Ol(le,m.ea()-1)||_.Cb!=null&&_.Cb.Gb!=null?Q=_:(Q=new A.Ea,le.copyTo(Q),Q.hj(1)),le=!0)}while(B.next());return!0},b.Ac=function(m,_,C){var D=new A.l;return D.L(m),D.X(C,C),D.contains(_)},b.ns=function(m,_,C){var D=new A.l;return D.L(_),D.X(C,C),_=new A.h,m.fn(_),!D.contains(_)||(m.VI(_),!D.contains(_)||(m.YI(_),!D.contains(_)||(m.gn(_),!D.contains(_))))},b.ZH=function(m,_,C){if(m.ea()!=_.ea()||m.I()!=_.I())return!1;var D=new A.h,L=new A.h,B=!0;C*=C;for(var q=0;qC){B=!1;break}if(!B)break}return!!B},b.eU=function(m,_,C){if(m.I()!=_.I())return!1;var D=new A.h,L=new A.h,B=!0;C*=C;for(var q=0;qC){B=!1;break}return!!B},b.TA=function(m,_,C,D,L,B){var q=!1;if(m.I()>_.I()){D&&(D=!1,q=!0);var Q=_}else Q=m,m=_;if(_=null,L||B||q){_=new A.rn(m.I());for(var oe=0;oe_.I())var D=_;else D=m,m=_;_=new A.l;var L=new A.l,B=new A.l;D.A(_),m.A(L),_.X(C,C),L.X(C,C),B.L(_),B.Fa(L),L=new A.h;for(var q=new A.h,Q=C*C,oe=A.ua.jE(m,B),le=oe.getIterator(),be=0;beC)return!1;if(Je*(1-(ri=B.Ui))<=C||ri==1)break}if(Je*(1-ri)>C)return!1;le=0,be.resize(0),Me.th.length=0}}return q},b.QG=function(m,_,C){if(1>b.Sz(m,_,C,null))return!1;var D=new A.l,L=new A.l;m.A(D),_.A(L);var B=b.ns(D,L,C);return D=b.ns(L,D,C),!(!B||!D)||(B&&!D?!b.Am(_,m,C,!1):D&&!B?!b.Am(m,_,C,!1):!b.Am(m,_,C,!1)&&!b.Am(_,m,C,!1))},b.Sz=function(m,_,C,D){function L(qr,eo){return Ye.LE(qr,eo)}if(m.sz()>_.sz())var B=_,q=m;else B=m,q=_;m=B.Ha(),_=q.Ha();var Q=[0,0],oe=[0,0],le=-1,be=0,Me=new A.ja(0),Ye=new b,it=new A.l,Lt=new A.l,Ut=new A.l;B.A(it),q.A(Lt),it.X(C,C),Lt.X(C,C),Ut.L(it),Ut.Fa(Lt),B=null,D!=null&&(B=new A.h);var Je=Lt=Lt=null,Rt=q.Cb;for(Rt!=null?(Lt=Rt.Gb,Je=Rt.Bo,Lt==null&&(Lt=A.ua.lj(q,Ut))):Lt=A.ua.lj(q,Ut),q=Lt.getIterator(),Rt=null,Je!=null&&(Rt=Je.getIterator());m.ab();)for(Je=0;m.Ia();){var ri=m.ia();if(ri.A(it),it.isIntersecting(Ut)){if(Rt!=null&&(Rt.Zi(it,C),Rt.next()==-1))continue;var ti=ri.Rb();q.Wo(ri,C);for(var Zt=q.next();Zt!=-1;Zt=q.next()){var ii=Lt.ka(Zt);_.Wb(ii);var Ci=_.ia(),ki=Ci.Rb(),Ni=ri.Fa(Ci,null,Q,oe,C);if(0C)return 1;var wi=ti*(tr-Zt);if(_.Ia()){if(Ci=_.ia(),(Ni=ri.Fa(Ci,null,Q,null,C))==2){Ni=Q[0];var bn=Q[1];if(wi+(Ni=ti*(bn-Ni))>C)return 1}_.Wb(ii),_.ia()}if(!_.xm()){if(_.ni(),Ci=_.ni(),(Ni=ri.Fa(Ci,null,Q,null,C))==2&&(Ni=Q[0],wi+(Ni=ti*((bn=Q[1])-Ni))>C))return 1;_.Wb(ii),_.ia()}if(m.Ia()){if(ii=m.xb(),(Ni=(ri=m.ia()).Fa(Ci,null,Q,null,C))==2&&(Ni=Q[0],wi+(Ni=ti*((bn=Q[1])-Ni))>C))return 1;m.Wb(ii),m.ia()}if(!m.xm()){if(ii=m.xb(),m.ni(),(Ni=(ri=m.ni()).Fa(Ci,null,Q,null,C))==2&&(Ni=Q[0],wi+(Ni=ki*((bn=Q[1])-Ni))>C))return 1;m.Wb(ii),m.ia()}Ci=H.construct(m.xb(),m.gb,Zt,tr,_.xb(),_.gb,le,cr),Ye.th.push(Ci),Me.add(Me.size)}le=0,D!=null&&(ri.ic(Zt,B),D.add(B.x),D.add(B.y))}}if(beC)Je=ti*(Ci.Ui-Ci.Mj),ri=Ci.Ui,Zt=Ci.Om;else{if(Ci.Om!=Zt?(Je=ti*(Ci.Ui-Ci.Mj),Zt=Ci.Om):Je+=ti*(Ci.Ui-Ci.Mj),Je>C)return 1;if((ri=Ci.Ui)==1)break}ti*(1-ri)>C&&(Je=0),be=0,Me.resize(0),Ye.th.length=0}}}return le},b.OG=function(m,_,C){var D=m.Ha(),L=_.Ha();for(m=new A.am(m,_,C,!1);m.next();){_=m.pl();var B=m.jl();if(D.Wb(_),L.Wb(B),_=D.ia(),0C)return!1;be=!0}else if(Ye!=0){if(be=Q[0],Me=oe[0],0be&&0Me)return!1;be=!0}}return!!be&&(B=new A.l,q=new A.l,L=new A.l,m.A(B),_.A(q),B.X(1e3*C,1e3*C),q.X(1e3*C,1e3*C),L.L(B),L.Fa(q),!(10C&&(oe=!0,le&&be))return!0}else if(Je!=0&&(Je=it[0],Rt=Lt[0],0Je&&0Rt))return!0}if(L=new A.l,Me=new A.l,L.L(B),L.X(1e3*C,1e3*C),Me.L(q),Me.X(1e3*C,1e3*C),Q.L(L),Q.Fa(Me),B="",B=oe?B+"**":B+"T*",le){if(10<_.I()&&(_=A.Vd.clip(_,Q,C,0)).B())return!1;B+="****"}else B+="T***";if(be){if(10be&&0Me)))return D[0]=!0,!1}if(!le){for(D[0]=!0,q=new A.l,m.A(q),q.X(C,C),oe=m,le=!1,Q=new A.l,D=0,L=_.ea();Dle&&0be)return!1;le=!0}}return!!le&&(B=new A.l,q=new A.l,L=new A.l,m.A(B),_.A(q),B.X(1e3*C,1e3*C),q.X(1e3*C,1e3*C),L.L(B),L.Fa(q),!(10le&&0be)return!0;le=!0}}return!!le&&(B=new A.l,q=new A.l,Q=new A.l,oe=new A.l,L=new A.l,m.A(B),_.A(q),b.ns(q,B,C)?(Q.L(B),Q.X(1e3*C,1e3*C),oe.L(q),oe.X(1e3*C,1e3*C),L.L(Q),L.Fa(oe),!(10B;B++){var q=D.charAt(B);if(q!="*"&&q!="T"&&q!="F"&&q!="0"&&q!="1"&&q!="2")throw A.i.ga("relation string")}if((B=this.HR(D,m.Eb(),_.Eb()))!=0)return A.vd.uB(m,_,C,B,L);B=new A.l,m.A(B),q=new A.l,_.A(q);var Q=new A.l;if(Q.L(B),Q.$b(q),C=A.ua.Xd(C,Q,!1),m=this.RE(m,C),_=this.RE(_,C),m.B()||_.B())return this.pW(m,_,D);switch(B=_.K(),q=!1,m.K()){case 1736:switch(B){case 1736:q=this.st(m,_,C,D,L);break;case 1607:q=this.bn(m,_,C,D,L);break;case 33:q=this.rt(m,_,C,D);break;case 550:q=this.qt(m,_,C,D,L)}break;case 1607:switch(B){case 1736:q=this.bn(_,m,C,this.aq(D),L);break;case 1607:q=this.bB(m,_,C,D,L);break;case 33:q=this.ut(m,_,C,D,L);break;case 550:q=this.tt(m,_,C,D,L)}break;case 33:switch(B){case 1736:q=this.rt(_,m,C,this.aq(D));break;case 1607:q=this.ut(_,m,C,this.aq(D),L);break;case 33:q=this.VU(m,_,C,D);break;case 550:q=this.mt(_,m,C,this.aq(D))}break;case 550:switch(B){case 1736:q=this.qt(_,m,C,this.aq(D),L);break;case 1607:q=this.tt(_,m,C,this.aq(D),L);break;case 550:q=this.UA(m,_,C,D,L);break;case 33:q=this.mt(m,_,C,D)}break;default:q=!1}return q},b.st=function(m,_,C,D,L){var B=new b;B.$i(),B.dj(D),B.sJ();var q=new A.l,Q=new A.l;return m.A(q),_.A(Q),D=!1,A.vd.fk(q,Q,C)&&(B.Eu(m,_),D=!0),D||((q=A.vd.rc(m,_,!1))==4?(B.Eu(m,_),D=!0):q==1?(B.hy(_),D=!0):q==2&&(B.UD(m),D=!0)),D||(m=(D=new A.hd).Ib(m),_=D.Ib(_),B.Yo(D,C,L),B.Dp(m,_),B.j.Wg()),b.hg(B.J,B.Yc)},b.Uw=function(m,_,C,D){var L=new b;L.$i(),L.dj("T*****F**"),L.sJ();var B=new A.l,q=new A.l;m.A(B),_.A(q);var Q=!1;return A.vd.fk(B,q,C)&&(L.Eu(m,_),Q=!0),Q||((B=A.vd.rc(m,_,!1))==4?(L.Eu(m,_),Q=!0):B==1?(L.hy(_),Q=!0):B==2&&(L.UD(m),Q=!0)),Q?this.hg(L.J,L.Yc):(m=(Q=new A.hd).Ib(m),B=Q.Ib(_),A.Vk.W(Q,C,D,!1),C=Q.Ke(B).ng(),Q.Ip(0,!0,!0),A.tn.W(Q,m,-1,!1,D),Q.I(m)!=0&&(A.tn.W(Q,B,-1,!1,D),L.gr(Q,D),(_=Q.I(B)==0)||(L.Dp(m,B),L.j.Wg(),B=this.hg(L.J,L.Yc))?(m=Q.Ke(m),m=(Q=new A.hd).Ib(m),B=Q.Ib(C),L.gr(Q,D),L.me=0,L.$i(),L.dj(_?"T*****F**":"******F**"),L.DB(),L.Dp(m,B),L.j.Wg(),this.hg(L.J,L.Yc)):B))},b.bn=function(m,_,C,D,L){var B=new b;B.$i(),B.dj(D),B.DB();var q=new A.l,Q=new A.l;return m.A(q),_.A(Q),D=!1,A.vd.fk(q,Q,C)&&(B.Fu(m,_),D=!0),D||((q=A.vd.rc(m,_,!1))==4?(B.Fu(m,_),D=!0):q==1&&(B.VD(_),D=!0)),D||(m=(D=new A.hd).Ib(m),_=D.Ib(_),B.Yo(D,C,L),B.mh=B.j.Fp(),b.Lw(_,B.j,B.mh),B.Dp(m,_),B.j.Gp(B.mh),B.j.Wg()),b.hg(B.J,B.Yc)},b.aB=function(m,_,C,D){var L=new b;L.$i(),L.dj("T*****F**"),L.DB();var B=new A.l,q=new A.l;m.A(B),_.A(q);var Q=!1;return A.vd.fk(B,q,C)&&(L.Fu(m,_),Q=!0),Q||((B=A.vd.rc(m,_,!1))==4?(L.Fu(m,_),Q=!0):B==1&&(L.VD(_),Q=!0)),Q?this.hg(L.J,L.Yc):(m=(Q=new A.hd).Ib(m),_=Q.Ib(_),L.Yo(Q,C,D),Q.I(m)!=0&&(L.Dp(m,_),L.j.Wg(),this.hg(L.J,L.Yc)))},b.qt=function(m,_,C,D,L){var B=new b;B.$i(),B.dj(D),B.tJ();var q=new A.l,Q=new A.l;return m.A(q),_.A(Q),D=!1,A.vd.fk(q,Q,C)&&(B.Gu(m),D=!0),D||((q=A.vd.rc(m,_,!1))==4?(B.Gu(m),D=!0):q==1&&(B.uN(),D=!0)),D||(m=(D=new A.hd).Ib(m),_=D.Ib(_),B.Yo(D,C,L),B.By(m,_),B.j.Wg()),b.hg(B.J,B.Yc)},b.bB=function(m,_,C,D,L){var B=new b;B.$i(),B.dj(D),B.$W(),D=new A.l;var q=new A.l;m.A(D),_.A(q);var Q=!1;return A.vd.fk(D,q,C)&&(B.KG(m,_),Q=!0),Q||A.vd.rc(m,_,!1)!=4||(B.KG(m,_),Q=!0),Q||(m=(D=new A.hd).Ib(m),_=D.Ib(_),B.Yo(D,C,L),B.$h=B.j.Fp(),B.mh=B.j.Fp(),b.Lw(m,B.j,B.$h),b.Lw(_,B.j,B.mh),B.Dp(m,_),B.j.Gp(B.$h),B.j.Gp(B.mh),B.j.Wg()),b.hg(B.J,B.Yc)},b.tt=function(m,_,C,D,L){var B=new b;B.$i(),B.dj(D),B.HJ(),D=new A.l;var q=new A.l;m.A(D),_.A(q);var Q=!1;return A.vd.fk(D,q,C)&&(B.Qz(m),Q=!0),Q||A.vd.rc(m,_,!1)!=4||(B.Qz(m),Q=!0),Q||(m=(D=new A.hd).Ib(m),_=D.Ib(_),B.Yo(D,C,L),B.$h=B.j.Fp(),b.Lw(m,B.j,B.$h),B.By(m,_),B.j.Gp(B.$h),B.j.Wg()),b.hg(B.J,B.Yc)},b.UA=function(m,_,C,D,L){var B=new b;B.$i(),B.dj(D),B.MJ(),D=new A.l;var q=new A.l;m.A(D),_.A(q);var Q=!1;return A.vd.fk(D,q,C)&&(B.tI(),Q=!0),Q||(m=(D=new A.hd).Ib(m),_=D.Ib(_),B.Yo(D,C,L),B.By(m,_),B.j.Wg()),b.hg(B.J,B.Yc)},b.rt=function(m,_,C,D){var L=new b;L.$i(),L.dj(D),L.tJ();var B=new A.l;m.A(B),_=_.D();var q=!1;return A.vd.Tw(_,B,C)&&(L.Gu(m),q=!0),q||((C=A.jd.Zd(m,_,C))==1?(L.J[0]=0,L.J[2]=2,L.J[3]=-1,L.J[5]=1,L.J[6]=-1):C==2?(L.J[6]=-1,m.He()!=0?(L.J[0]=-1,L.J[3]=0,L.J[2]=2,L.J[5]=1):(L.J[0]=0,L.J[3]=-1,L.J[5]=-1,C=new A.l,m.A(C),L.J[2]=C.da()==0&&C.S()==0?-1:1)):L.Gu(m)),this.hg(L.J,D)},b.ut=function(m,_,C,D,L){var B=new b;B.$i(),B.dj(D),B.HJ();var q=new A.l;m.A(q),D=_.D();var Q=!1;if(A.vd.Tw(D,q,C)&&(B.Qz(m),Q=!0),!Q){q=null;var oe=Q=!1;(B.fa[0]||B.fa[6])&&(A.vd.Tz(m,D,C)?(B.fa[0]&&(q=A.si.im(m,L),oe=!A.vd.lt(q,D,C),Q=!0,B.J[0]=oe?-1:0),B.J[6]=-1):(B.J[0]=-1,B.J[6]=0)),B.fa[3]&&(q!=null&&q.B()?B.J[3]=-1:(Q||(q==null&&(q=A.si.im(m,L)),oe=!A.vd.lt(q,D,C),Q=!0),B.J[3]=oe?0:-1)),B.fa[5]&&(q!=null&&q.B()?B.J[5]=-1:Q&&!oe?B.J[5]=0:(q==null&&(q=A.si.im(m,L)),L=A.vd.Pw(q,_,C),B.J[5]=L?-1:0)),B.fa[2]&&(m.Rb()!=0?B.J[2]=1:((L=new A.ee(m.description)).Gd(m,0,m.I()),m=A.vd.Pw(L,_,C),B.J[2]=m?-1:0))}return this.hg(B.J,B.Yc)},b.mt=function(m,_,C,D){var L=new b;L.$i(),L.dj(D),L.MJ();var B=new A.l;m.A(B),_=_.D();var q=!1;if(A.vd.Tw(_,B,C)&&(L.tI(),q=!0),!q){B=!1,q=!0,C*=C;for(var Q=0;QB;B++)L[B]=-1;return A.h.zc(m,_)<=C*C?L[0]=0:(L[2]=0,L[6]=0),L[8]=2,b.hg(L,D)},b.hg=function(m,_){for(var C=0;9>C;C++)switch(_.charAt(C)){case"T":if(m[C]==-1)return!1;break;case"F":if(m[C]!=-1)return!1;break;case"0":if(m[C]!=0)return!1;break;case"1":if(m[C]!=1)return!1;break;case"2":if(m[C]!=2)return!1}return!0},b.pW=function(m,_,C){var D=[-1,-1,-1,-1,-1,-1,-1,-1,-1];if(m.B()&&_.B()){for(var L=0;9>L;L++)D[L]=-1;return this.hg(D,C)}return L=!1,m.B()&&(m=_,L=!0),D[0]=-1,D[1]=-1,D[3]=-1,D[4]=-1,D[6]=-1,D[7]=-1,D[8]=2,_=m.K(),A.ba.Ic(_)?_==1736?m.He()!=0?(D[2]=2,D[5]=1):(D[5]=-1,_=new A.l,m.A(_),D[2]=_.da()==0&&_.S()==0?0:1):(_=m.Rb()!=0,D[2]=_?1:0,D[5]=A.si.cq(m)?0:-1):(D[2]=0,D[5]=-1),L&&this.qK(D),this.hg(D,C)},b.HR=function(m,_,C){return b.ZP(m)?3:b.PP(m)?4:b.ZX(m,_,C)?8:b.xP(m,_,C)?16:b.$O(m)?1:b.zU(m,_,C)?32:0},b.ZP=function(m){return m.charAt(0)=="T"&&m.charAt(1)=="*"&&m.charAt(2)=="F"&&m.charAt(3)=="*"&&m.charAt(4)=="*"&&m.charAt(5)=="F"&&m.charAt(6)=="F"&&m.charAt(7)=="F"&&m.charAt(8)=="*"},b.PP=function(m){return m.charAt(0)=="F"&&m.charAt(1)=="F"&&m.charAt(2)=="*"&&m.charAt(3)=="F"&&m.charAt(4)=="F"&&m.charAt(5)=="*"&&m.charAt(6)=="*"&&m.charAt(7)=="*"&&m.charAt(8)=="*"},b.ZX=function(m,_,C){return(_!=0||C!=0)&&((_!=2||C!=2)&&(m.charAt(0)=="F"&&m.charAt(1)=="*"&&m.charAt(2)=="*"&&m.charAt(3)=="T"&&m.charAt(4)=="*"&&m.charAt(5)=="*"&&m.charAt(6)=="*"&&m.charAt(7)=="*"&&m.charAt(8)=="*"||_==1&&C==1&&m.charAt(0)=="F"&&m.charAt(1)=="T"&&m.charAt(2)=="*"&&m.charAt(3)=="*"&&m.charAt(4)=="*"&&m.charAt(5)=="*"&&m.charAt(6)=="*"&&m.charAt(7)=="*"&&m.charAt(8)=="*")||C!=0&&m.charAt(0)=="F"&&m.charAt(1)=="*"&&m.charAt(2)=="*"&&m.charAt(3)=="*"&&m.charAt(4)=="T"&&m.charAt(5)=="*"&&m.charAt(6)=="*"&&m.charAt(7)=="*"&&m.charAt(8)=="*")},b.xP=function(m,_,C){return _>C?m.charAt(0)=="T"&&m.charAt(1)=="*"&&m.charAt(2)=="*"&&m.charAt(3)=="*"&&m.charAt(4)=="*"&&m.charAt(5)=="*"&&m.charAt(6)=="T"&&m.charAt(7)=="*"&&m.charAt(8)=="*":_==1&&C==1&&m.charAt(0)=="0"&&m.charAt(1)=="*"&&m.charAt(2)=="*"&&m.charAt(3)=="*"&&m.charAt(4)=="*"&&m.charAt(5)=="*"&&m.charAt(6)=="*"&&m.charAt(7)=="*"&&m.charAt(8)=="*"},b.$O=function(m){return m.charAt(0)=="T"&&m.charAt(1)=="*"&&m.charAt(2)=="*"&&m.charAt(3)=="*"&&m.charAt(4)=="*"&&m.charAt(5)=="*"&&m.charAt(6)=="F"&&m.charAt(7)=="F"&&m.charAt(8)=="*"},b.zU=function(m,_,C){if(_==C){if(_!=1)return m.charAt(0)=="T"&&m.charAt(1)=="*"&&m.charAt(2)=="T"&&m.charAt(3)=="*"&&m.charAt(4)=="*"&&m.charAt(5)=="*"&&m.charAt(6)=="T"&&m.charAt(7)=="*"&&m.charAt(8)=="*";if(m.charAt(0)=="1"&&m.charAt(1)=="*"&&m.charAt(2)=="T"&&m.charAt(3)=="*"&&m.charAt(4)=="*"&&m.charAt(5)=="*"&&m.charAt(6)=="T"&&m.charAt(7)=="*"&&m.charAt(8)=="*")return!0}return!1},b.Lw=function(m,_,C){m=_.Ma(m);for(var D=_.Oe;D!=-1;D=_.Tf(D))if(_.yd(D)&m){var L=_.Je(D);if(L==-1)_.pn(D,C,0);else{var B=L,q=0;do _.fh(B)&m&&q++,B=_.kc(_.ya(B));while(B!=L);_.pn(D,C,q)}}},b.aq=function(m){var _=""+m.charAt(0);return _+=m.charAt(3),_+=m.charAt(6),_+=m.charAt(1),_+=m.charAt(4),_+=m.charAt(7),_+=m.charAt(2),(_+=m.charAt(5))+m.charAt(8)},b.prototype.$i=function(){for(var m=0;9>m;m++)this.J[m]=-2,this.$a[m]=-2},b.qK=function(m){var _=m[1],C=m[2],D=m[5];m[1]=m[3],m[2]=m[6],m[5]=m[7],m[3]=_,m[6]=C,m[7]=D},b.prototype.dj=function(m){for(this.Yc=m,m=0;9>m;m++)this.Yc.charAt(m)!="*"?(this.fa[m]=!0,this.me++):this.fa[m]=!1},b.prototype.PJ=function(){for(var m=0;9>m;m++)this.fa[m]&&this.J[m]==-2&&(this.J[m]=-1,this.fa[m]=!1)},b.prototype.qc=function(m){return this.J[m]!=-2&&(this.J[m]==-1?(this.fa[m]=!1,this.me--,!0):this.Yc.charAt(m)!="T"&&this.Yc.charAt(m)!="F"?!(this.J[m]B?1:0},b.prototype.reset=function(){this.tA=-1},b}(),T=function(){function b(){this.Ym=this.Il=null,this.fb=new A.$j,this.fb.MP(),this.ae=new H(this),this.fb.Xo(this.ae)}return b.prototype.CQ=function(){var m=!1;if(this.hw&&(m=this.DQ()),this.g.ea(this.Y)==1){var _=this.g.Ob(this.Y);return m=this.g.qz(_),this.g.KB(_,!0),0>m&&(m=this.g.Ya(_),this.g.kJ(m),this.g.Yg(_,this.g.Na(m)),!0)}for(this.Gl=this.g.Fy(),this.yo=this.g.Fy(),_=this.g.Ob(this.Y);_!=-1;_=this.g.Sb(_))this.g.ir(_,this.Gl,0),this.g.ir(_,this.yo,-1);_=new A.ja(0),this.Ah=NaN;var C=new A.h;this.ft=this.g.ea(this.Y),this.to=this.g.Hd(),this.Ts=this.g.Hd();for(var D=this.Il.sc(this.Il.ke);D!=-1;D=this.Il.lb(D)){var L=this.Il.getData(D);if(this.g.Hc(L,C),C.y!=this.Ah&&_.size!=0&&(m=this.vt(_)||m,this.ae.reset(),_.clear(!1)),_.add(L),this.Ah=C.y,this.ft==0)break}for(0=this.HA.length&&this.HA.push(new A.jg);var b=this.HA[this.Ew];return this.Ew++,b},T.prototype.clear=function(){this.rB(this.oo),this.rB(this.bt),this.rB(this.Aw),this.Ew=0},T.prototype.Qo=function(b){this.oo.push(this.Qw(b))},T.prototype.ql=function(b){return b==0?this.bt.length:this.Aw.length},T.prototype.Xp=function(b,m){return this.NR(b,m).bj},T.prototype.Fa=function(b,m){if(this.oo.length!=2)throw A.i.Ra();this.ra=b;var _=A.mc.ox(.01*b),C=!1,D=this.oo[0],L=this.oo[1];if(m||5&D.bj.Br(L.bj,b,!0)){if(D.bj.K()==322){var B=D.bj;if(L.bj.K()==322){m=L.bj;var q=A.zb.Yx(B,m,null,this.Hq,this.Dk,b);if(q==0)throw A.zb.Yx(B,m,null,this.Hq,this.Dk,b),A.i.Ra();b=Array(9),A.P.bv(b,null);for(var Q=0;Q_&&(C=!0)):be>Ye?(B.ic(oe,Lt),oe=new A.h,m.ic(le,oe),A.h.zc(Lt,oe)>_&&(C=!0)):(m.ic(le,Lt),be=new A.h,B.ic(oe,be),A.h.zc(Lt,be)>_&&(C=!0)),b[Q]=Lt}for(D=0,L=-1,Q=0;Q<=q;Q++)(it=Qthis.Dk[1]&&(it=this.Dk[0],this.Dk[0]=this.Dk[1],this.Dk[1]=it,Q=B[0],B[0]=B[1],B[1]=Q),D=0,L=-1,Q=0;Q<=q;Q++)(it=Q=L;L++){if((m=1>L?this.Hq[L]:1)!=_){var B=this.WA();b.dh(_,m,B),D!=-1&&B.get().Ec(C),L!=1&&B.get().Rc(C),_=m,this.bt.push(this.Qw(B.get()))}D=L}this.Cf.Db(C)}},T}();A.OC=H}(ae||(ae={})),function(A){var ye=function(){function H(T){this.Fs=this.tk=this.tb=null,this.cg=0,this.Bm=!1,this.Af=-1,this.El=this.Kd=0,this.gb=-1,this.ib=T,this.cg=this.Vx(this.El),this.Bm=!1,this.tk=null,this.Fs=new A.h}return H.prototype.wW=function(T){if(this.ib!=T.ib)throw A.i.Hb();this.Af=T.Af,this.Kd=T.Kd,this.gb=T.gb,this.El=T.El,this.cg=T.cg,this.Bm=T.Bm,this.tk=null},H.prototype.ia=function(){if(this.Af!=this.Kd&&this.wD(),this.Bm)this.Kd=(this.Kd+1)%this.cg;else{if(this.Kd==this.cg)throw A.i.de();this.Kd++}return this.tk},H.prototype.ni=function(){if(this.Bm)this.Kd=(this.cg+this.Kd-1)%this.cg;else{if(this.Kd==0)throw A.i.de();this.Kd--}return this.Kd!=this.Af&&this.wD(),this.tk},H.prototype.xW=function(){this.Af=-1,this.Kd=0},H.prototype.yW=function(){this.Kd=this.cg,this.Af=-1},H.prototype.Wb=function(T,b){if(b===void 0&&(b=-1),0<=this.gb&&this.gb=m&&T=this.ib.Ca(b)&&T=this.ib.ea())&&(this.Af=-1,this.Kd=0,this.cg=this.Vx(this.gb),this.ib.Ca(this.gb),this.ib.ec(this.gb),this.El++,!0)},H.prototype.aj=function(){this.cg=this.Kd=this.Af=-1,this.El=0,this.gb=-1},H.prototype.Vx=function(T){if(this.ib.Bc())return 0;var b=1;return this.ib.ec(T)&&(b=0),this.ib.Ka(T)-b},H.prototype.Qn=function(){return this.Af==this.cg-1&&this.ib.ec(this.gb)},H.prototype.EB=function(){this.Bm=!0},H.prototype.xb=function(){return this.ib.nb.o[this.gb]+this.Af},H.prototype.DM=function(){return this.ib.Ca(this.gb)},H.prototype.kk=function(){return this.Qn()?this.ib.Ca(this.gb):this.xb()+1},H.prototype.xm=function(){return this.Af==0},H.prototype.Sn=function(){return this.Af==this.cg-1},H.prototype.Ia=function(){return this.Kdthis.Kd||this.Kd>=this.cg)throw A.i.de();this.Af=this.Kd;var T=this.xb();this.ib.oc();var b=this.ib.Se,m=1;switch(b!=null&&(m=7&b.read(T)),b=this.ib.description,m){case 1:this.tb==null&&(this.tb=new A.zb),this.tk=this.tb;break;case 2:throw A.i.ga("internal error");default:throw A.i.Ra()}this.tk.Pf(b),m=this.kk(),this.ib.Hc(T,this.Fs),this.tk.Ec(this.Fs),this.ib.Hc(m,this.Fs),this.tk.Rc(this.Fs);for(var _=1,C=b.Ba;_C&&(D=b,b=_,_=D,D=m,m=C,C=D,D=-1),!(0>C||m>=this.rl)){0>b&&0>_?_=b=-1:b>=this.ri&&_>=this.ri&&(_=b=this.ri);var L=(_-b)/(C-m);C>this.rl&&(_=L*((C=this.rl)-m)+b),0>m&&(b=L*(0-m)+b,m=0);var B=Math.max(this.ri+1,8388607);-8388607>b?(m=(0-b)/L+m,b=0):b>B&&(m=(this.ri-b)/L+m,b=this.ri),-8388607>_?C=(0-b)/L+m:_>B&&(C=(this.ri-b)/L+m),(m=A.P.truncate(m))!=(C=A.P.truncate(C))&&((_=new ye).x=A.P.truncate(4294967296*b),_.y=m,_.H=C,_.RP=A.P.truncate(4294967296*L),_.dir=D,this.Yl==null&&(this.Yl=A.P.mg(this.rl,null)),_.next=this.Yl[_.y],this.Yl[_.y]=_,_.ythis.Mw&&(this.Mw=_.H),this.Vq++)}}},T.prototype.nN=function(){if(this.Lh!=null){for(var b=!1,m=null,_=this.Lh;_!=null;)if(_.y++,_.y==_.H){var C=_;_=_.next,m!=null?m.next=_:this.Lh=_,C.next=null}else _.x+=_.RP,m!=null&&m.x>_.x&&(b=!0),m=_,_=_.next;b&&(this.Lh=this.aK(this.Lh))}},T.prototype.gN=function(b){if(!(b>=this.rl)){var m=this.Yl[b];if(m!=null){this.Yl[b]=null,m=this.aK(m),this.Vq-=this.bK,b=this.Lh;for(var _=!0,C=m,D=null;b!=null&&C!=null;)b.x>C.x?(_&&(this.Lh=C),_=C.next,C.next=b,D!=null&&(D.next=C),D=C,C=_):(_=b.next,b.next=C,D!=null&&(D.next=b),D=b,b=_),_=!1;this.Lh==null&&(this.Lh=m)}}},T.$J=function(b,m){return 0>b?0:b>m?m:b},T.prototype.UP=function(){if(this.Lh!=null){for(var b=0,m=this.Lh,_=A.P.truncate(A.P.SG(m.x)),C=m.next;C!=null;C=C.next)if(b=this.fF?1^b:b+C.dir,C.x>m.x){var D=A.P.truncate(A.P.SG(C.x));b!=0&&(m=T.$J(_,this.ri),(_=T.$J(D,this.ri))>m&&mthis.Lf[1].x&&(b=this.Lf[0],this.Lf[0]=this.Lf[1],this.Lf[1]=b):T.vN(this.Lf,m,function(D,L){return D==L?0:D.xL.x?1:0}),b=this.Lf[0],this.Lf[0]=null,_=b,C=1;Cthis.Yh.size)break;var q=this;for(this.ye.Wd(0,this.ye.size,function(Q,oe){return q.kM(Q,oe)}),m=0,_=this.ye.size;m<_;m++)C=this.ye.get(m),C=this.Yh.get(C),this.g.Sa(C,this.Ag,m),L=new A.h,this.g.Hc(C,L);for(L=this.OM(b),m=0,_=this.ye.size;m<_;m++)(C=this.ye.get(m))!=-1&&(C=this.Yh.get(C),this.g.Sa(C,this.Ag,-1));if(!L)break;T=!0}return T},H.prototype.OM=function(T){for(var b=!1,m=!0;m;){m=!1;var _=0;this.ye.get(_)==-1&&(_=this.em(_));for(var C=this.em(_),D=0,L=this.ye.size;Dit?1:LtUt?1:0)==0&&(Lt=(be=q[Q*be+3])<(Me=q[Q*Me+3])?-1:be==Me?0:1),Lt}),this.Rq=this.g.Hd(),this.pe=new A.lp,this.MA=this.pe.Rh(0),this.pe.hn(m),C=0;Cq;q++){for(Q=be[q],oe=m[q],le=q-1;0<=le&&be[le]>Q;)be[le+1]=be[le],m[le+1]=m[le],le--;be[le+1]=Q,m[le+1]=oe}return be=0,m[0]!=0&&(be|=1),m[1]!=0&&(be|=2),m[2]!=0&&(be|=4),m[3]!=0&&(be|=8),(be==5||be==10)&&(T==b?T?(this.g.Cc(B,_),this.g.Dc(_,B),this.g.Cc(C,L),this.g.Dc(L,C)):(this.g.Dc(B,_),this.g.Cc(_,B),this.g.Dc(C,L),this.g.Cc(L,C)):T?(this.g.Dc(_,D),this.g.Cc(D,_),this.g.Dc(L,C),this.g.Cc(C,L)):(this.g.Cc(_,D),this.g.Dc(D,_),this.g.Cc(L,C),this.g.Dc(C,L)),!0)},H.prototype.oD=function(T,b,m,_,C,D){this.IY?this.QM():this.PM(T,b,m,_,C,D)},H.prototype.QM=function(){throw A.i.ga("not implemented.")},H.prototype.PM=function(T,b,m,_,C,D){if(T!=b)T?(this.g.Cc(m,C),this.g.Dc(C,m),this.g.Cc(D,_),this.g.Dc(_,D),this.xn(C,m),this.wi(C,!0),this.g.oi(C,!0),this.dk(m),this.xn(D,_),this.wi(D,!0),this.g.oi(D,!1)):(this.g.Cc(C,m),this.g.Dc(m,C),this.g.Cc(_,D),this.g.Dc(D,_),this.xn(C,m),this.wi(C,!0),this.g.oi(C,!1),this.dk(m),this.xn(D,_),this.wi(D,!0),this.g.oi(D,!0)),this.dk(_);else{var L=T?m:_,B=b?C:D;for(T=T?_:m,b=b?D:C,C=!1,this.g.Cc(L,B),this.g.Cc(B,L),this.g.Dc(T,b),this.g.Dc(b,T),D=b;D!=B;)m=this.g.Na(D),_=this.g.V(D),this.g.Dc(D,_),this.g.Cc(D,m),C=C||D==L,D=_;C||(m=this.g.Na(B),_=this.g.V(B),this.g.Dc(B,_),this.g.Cc(B,m)),this.xn(B,L),this.wi(B,!0),this.g.oi(B,!1),this.dk(L),this.xn(b,T),this.wi(b,!0),this.g.oi(b,!1),this.dk(T)}},H.prototype.YC=function(){for(var T=!1,b=this.g.Ob(this.Y);b!=-1;){for(var m=this.g.Ya(b),_=0,C=this.g.Ka(b);_this.g.Ka(b)){for(T=this.g.Ya(b),_=0,C=this.g.Ka(b);_=b)throw A.i.O("Invalid or unsupported wkid: "+b);var m=new T;return m.fg=b,m},T.lP=function(b){if(b==null||b.length==0)throw A.i.O("Cannot create SpatialReference from null or empty text.");var m=new T;return m.yh=b,m},T.prototype.Nb=function(b){return this==b||b!=null&&this.constructor==b.constructor&&this.fg==b.fg&&(this.fg!=0||this.yh===b.yh)},T.prototype.toString=function(){return"[ tol: "+this.Mn()+"; wkid: "+this.Fc()+"; wkt: "+this.wz()+"]"},T.prototype.dc=function(){if(this.rp!=="")return this.rp;var b=this.toString();if(Array.prototype.reduce)return this.rp="S"+b.split("").reduce(function(C,D){return(C=(C<<5)-C+D.charCodeAt(0))&C},0);var m=0;if(b.length===0)return"";for(var _=0;_=b.length)throw A.i.O();var m=null;try{m=A.IC.fromString(b)}catch{m=null}return m==null?null:T.XC(m,!0)},T.prototype.ay=function(b){this.Ld=b,this.Go=this.Ld.Id()},T.prototype.cy=function(b){this.FH=b,this.NT=this.FH!=null?this.FH.Go:null},T.prototype.Xc=function(){return this.Tb()!=0&&this.Tb()!=3&&this.Ld.Xc()},T.prototype.DG=function(){return this.Tb()!=0&&(this.Tb()==3?this.Li.hk().Xc():this.Ld.Xc())},T.prototype.gh=function(){return this.Ld!=null?this.Ld.Re:null},T.prototype.rm=function(){return this.Ld.rm()},T.prototype.bf=function(){return this.Ld.bf()},T.prototype.jh=function(){return this.Ld!=null?this.Ld.uw:NaN},T.prototype.Wp=function(){return this.Ld.Wp()},T.prototype.Yr=function(){return this.Ld.Yr()},T.prototype.mk=function(){return this.Ld.mk()},T.prototype.fS=function(b){return A.JC.Ky(this.Ld,b.Ld)},T.prototype.ol=function(){return this.Ld.ol()},T.prototype.Xr=function(){return this.Ld.Xr()},T.prototype.Bi=function(){return this.Tb()==3?this.Li.hk().Bi():this.Ld.Bi()},T.prototype.ih=function(){if(!this.Xc())throw A.i.O("!isPannable()");var b=new A.l;return this.Ld.ih(b),b},T.prototype.Le=function(){if(!this.Xc())throw A.i.O("!isPannable()");return this.Ld.uo},T.prototype.CR=function(){if(!this.Xc())throw A.i.O("!isPannable()");var b=new A.l;return this.Ld.BR(b),b},T.prototype.rv=function(){if(!this.Xc())throw A.i.O("!isPannable()");return this.Ld.rv()},T.prototype.qv=function(){if(!this.Xc())throw A.i.O("!isPannable()");return this.Ld.qv()},T.prototype.Zr=function(){return this.Li!=null?this.Li.hk().Zr():this.Ld.Zr()},T.prototype.KQ=function(){return this.Ld.kv()},T.prototype.Sp=function(){return this.Go.getUnitFactor()},T.prototype.pz=function(b){return this.Jq.pz(b)},T.prototype.tc=function(){var b=this.Tb();if(b==1)return this;if(b==3)return this.Li.hk().tc();if(b==0||b===4)throw A.i.ga("invalid call");if(this.lw!==null)return this.lw;if((b=this.gh().getGeogcs())==null)throw A.i.Ra();return this.lw=T.XE(b,this.Jq.QF())},T.XE=function(b,m){if(b==null)throw A.i.O("null pointer.");var _=new T;return b=T.ou(b,!0),_.Jq.Wx(b,null,m),_.ay(b),_.cy(null),_.fg=b.cs(),_},T.prototype.Tb=function(){var b=this.gh();if(b!=null)switch(b.getType()){case A.Tc.PE_TYPE_GEOGCS:return 1;case A.Tc.PE_TYPE_PROJCS:return 2}return 4},T.prototype.kv=function(){return this.Ld.kv()},T.ou=function(b,m){var _=b.getCode();if(0>=_&&0<(_=A.qf.getCode(b))){if((b=A.qf.coordsys(_))==null)throw A.i.O("Text to wkid mapping had failed: "+_);return T.ou(b,m)}if(m&&0<_&&(m=T.qx[_]))return m;m=A.Ab.zv(b,_,!1);var C=T.gK[m];return C||(b=0>=_?b:A.qf.coordsys(_),b=new A.JC(b),T.gK[m]=b,0<_&&(T.qx[_]=b),b)},T.eM=function(b){if(0>=b)throw A.i.O("Invalid or unsupported wkid: "+b);var m=T.qx[b];if(m!=null)return m;if((m=A.qf.coordsys(b))==null)throw A.i.O("Invalid or unsupported wkid: "+b);return(m=T.ou(m,!1)).cs()!=b&&(T.qx[b]=m),m},T.fM=function(b){if(b==null||b===void 0||b.length==0)throw A.i.O("Cannot create SpatialReference from null or empty text.");var m=null;try{m=A.qf.fromString(A.Tc.PE_TYPE_COORDSYS,b)}catch(_){throw A.i.O("Cannot create SpatialReference from text. "+_.message)}if(m===null)throw A.i.O("Cannot create SpatialReference from text. ");return T.ou(m,!0)},T.XC=function(b,m){var _,C=b.getCode();if(0>=C&&0<(C=A.qf.getCode(b))){if((C=A.qf.vertcs(C))===null)throw A.i.O();return T.XC(C,m)}if(m&&0=C||(_=A.qf.vertcs(C)),_===null)throw A.i.O();return _=new A.KL(_),T.hK[b]=_,0m&&(this.Rj=m/(C-this.Hm)),_=this.Im+_,(D=A.P.truncate((_-this.Im)*this.Rj))>m&&(this.Rj=m/(_-this.Im))}},b.prototype.WB=function(m){switch(m){case 0:this.Kk=void 0;case 1:this.Oq=void 0;case 2:this.Nq=void 0}},b.prototype.Mn=function(m){switch(m){case 0:return this.Kk;case 1:return this.Oq;case 2:return this.Nq}return 0},b.prototype.pz=function(m){if(this.Tm==ye.FloatingPoint)return 0;switch(m){case 0:return 1/this.Rj;case 1:case 2:return 1/this.Ho;default:return 0}},b.prototype.toString=function(){var m="SRPD [m_toleranceXY: "+this.Kk.toString();return(m=(m=(m=(m=(m=(m=(m=(m=(m=m+";m_falseX: "+this.Hm.toString())+";m_falseY: "+this.Im.toString())+";m_unitsXY: "+this.Rj.toString())+";m_falseZ: "+this.nA.toString())+";m_unitsZ: "+this.Ho.toString())+";m_falseM: "+this.mA.toString())+";m_toleranceZ: "+this.Oq.toString())+";m_toleranceM: "+this.Nq.toString())+";m_precision: "+this.Tm.toString())+"] "},b}();A.UL=T}(ae||(ae={})),function(A){function ye(C,D){return 89.99999D&&(D=-89.99999),D*=.017453292519943,[111319.49079327169*C,31890685e-1*Math.log((1+Math.sin(D))/(1-Math.sin(D)))]}function H(C,D,L){return C=C/6378137*57.29577951308232,L?[C,57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*D/6378137)))]:[C-360*Math.floor((C+180)/360),57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*D/6378137)))]}function T(C,D,L){var B=C.Qf();if(C.K()===33)D=D(B.Ng(),B.kh()),B.Db(D[0],D[1]);else if(C.K()===197){var q=D(C.gs(),C.js(),L);D=D(C.fs(),C.hs(),L),B.L(q[0],q[1],D[0],D[1])}else for(q=new A.h,C=0;CL&&(L=637.100877141506);for(var B,q=[],Q=0;Qthis.Jg&&this.yz(T)},H.prototype.sx=function(T,b){T*=this.Mf,b*=this.Mf;for(var m=0;mthis.ps.wa)return 1;D=C.oa==C.ma;var L=_.oa==_.ma;if(D||L){if(D&&L)return 0;if(C.oa==_.oa&&C.ta==_.ta)return D?1:-1;if(C.ma==_.ma&&C.qa==_.qa)return D?-1:1}return(D=C.Me(this.Ah,this.os.pa))==(L=_.Me(this.Ah,this.ps.pa))&&((L=.5*((D=Math.min(C.ma,_.ma))+this.Ah))==this.Ah&&(L=D),D=C.Me(L,this.os.pa),L=_.Me(L,this.ps.pa)),DL?1:0},m.prototype.WJ=function(_){this.Ah=_},m}(),b=function(){function m(_){this.ib=_,this.RH=new A.jg,this.Cf=new A.h,this.rA=new A.Oc}return m.prototype.fX=function(_){this.Cf.N(_)},m.prototype.compare=function(_,C){return this.ib.kB(_.ka(C),this.RH),_=this.RH.get(),this.rA.L(_.ta,_.qa),this.Cf.xthis.rA.wa?1:(_=_.Me(this.Cf.y,this.Cf.x),this.Cf.x<_?-1:this.Cf.x>_?1:0)},m}();ye=function(){function m(){this.cH=this.Fi=this.Ii=this.fA=this.$n=this.ze=this.Lc=this.lh=this.he=null,this.Io=this.yg=-1,this.bH=!0,this.kA=!1,this.gA=NaN,this.Pi=new A.Nd,this.XN=2147483647,this.WN=A.P.truncate(-2147483648),this.eg=this.be=this.Jl=this.Eq=this.Em=this.Dq=this.Qs=this.Oe=-1,this.xa=0}return m.prototype.ty=function(_){this.gA=_},m.prototype.$m=function(){this.he==null&&(this.he=new A.ad(8));var _=this.he.De();return this.he.T(_,1,0),_},m.prototype.qU=function(){this.Lc==null&&(this.Lc=new A.ad(8));var _=this.Lc.De();this.Lc.T(_,2,0),this.Lc.T(_,3,0);var C=this.Lc.De();return this.Lc.T(C,2,0),this.Lc.T(C,3,0),this.EJ(_,C),this.EJ(C,_),_},m.prototype.hI=function(){this.ze==null&&(this.ze=new A.ad(8));var _=this.ze.De();return this.ze.T(_,2,0),_},m.prototype.OW=function(_,C){this.he.T(_,7,C)},m.prototype.on=function(_,C){this.he.T(_,2,C)},m.prototype.NW=function(_,C){this.he.T(_,1,C)},m.prototype.gX=function(_,C){this.he.T(_,3,C)},m.prototype.dX=function(_,C){this.he.T(_,4,C)},m.prototype.er=function(_,C){this.he.T(_,5,C)},m.prototype.$Q=function(_){return this.he.U(_,5)},m.prototype.MW=function(_,C){this.he.T(_,6,C)},m.prototype.YM=function(_,C){this.MW(C,_)},m.prototype.DJ=function(_,C){this.Lc.T(_,1,C)},m.prototype.EJ=function(_,C){this.Lc.T(_,4,C)},m.prototype.Vl=function(_,C){this.Lc.T(_,5,C)},m.prototype.Ul=function(_,C){this.Lc.T(_,6,C)},m.prototype.VW=function(_,C){this.Lc.T(_,2,C)},m.prototype.cx=function(_,C){this.Lc.T(_,3,C)},m.prototype.GF=function(_){return this.Lc.U(_,3)},m.prototype.Ht=function(_,C){this.Lc.T(_,7,C)},m.prototype.zK=function(_,C){if(this.om(_)!=-1)for(C=C?-1:_,_=this.om(_);_!=-1;_=this.ls(_))this.g.Sa(this.vj(_),this.Eq,C)},m.prototype.xx=function(_,C){_!=-1&&(this.zK(_,C),this.zK(this.ya(_),C))},m.prototype.Et=function(_,C){this.ze.T(_,1,C)},m.prototype.Xg=function(_,C){this.ze.T(_,2,C)},m.prototype.ln=function(_,C){this.ze.T(_,3,C),this.IW(_,this.ZQ(C)),this.HW(C,_)},m.prototype.HW=function(_,C){this.ze.T(_,4,C)},m.prototype.IW=function(_,C){this.ze.T(_,5,C)},m.prototype.yJ=function(_,C){this.ze.T(_,6,C)},m.prototype.wJ=function(_,C){this.ze.T(_,7,C)},m.prototype.vJ=function(_,C){this.$n.write(_,C)},m.prototype.xJ=function(_,C){this.fA.write(_,C)},m.prototype.gY=function(_){var C=0,D=0,L=this.vF(_),B=new A.h,q=new A.h,Q=new A.h;this.$r(L,B),q.N(B);var oe=L;do this.nm(oe,Q),D+=A.h.ub(q,Q),this.$e(this.ya(oe))!=_&&(C+=(Q.x-B.x-(q.x-B.x))*(Q.y-B.y+(q.y-B.y))*.5),q.N(Q),oe=this.kc(oe);while(oe!=L);this.$n.write(_,C),this.fA.write(_,D)},m.prototype.KU=function(_,C){var D=new T(this),L=new A.$j;L.Ee(A.P.truncate(this.xa/2)),L.Xo(D);for(var B=new A.ja(0),q=this.bh(),Q=null,oe=0,le=new A.h,be=this.Oe;be!=-1;be=this.Tf(be)){if(!(255&++oe)&&C!=null&&!C.progress(-1,-1))throw A.i.RC();var Me=this.Je(be);if(Me!=-1){if(B.Dh(0),!this.cY(L,q,B,Me)){this.D(be,le),D.WJ(le.y);var Ye=Me;do{var it=this.Bb(Ye,q);it!=-1&&(L.wd(it,-1),this.Kb(Ye,q,-2)),Ye=this.kc(this.ya(Ye))}while(Me!=Ye);Ye=Me;do(it=this.Bb(Ye,q))==-1&&(it=L.addElement(Ye,-1),B.add(it)),Ye=this.kc(this.ya(Ye));while(Me!=Ye)}for(Me=B.size-1;0<=Me;Me--)it=B.get(Me),Ye=L.ka(it),this.Kb(this.ya(Ye),q,it),this.JU(L,it,_)}else this.Yy(be)==-1&&(Q==null&&(Q=new b(this)),this.D(be,le),Q.fX(le),Ye=L.DW(Q),Me=this.Jl,Ye!=-1&&(it=L.ka(Ye),this.$e(it)==this.$e(this.ya(it))&&(it=this.JF(L,Ye)),it!=-1&&(Me=this.$e(it))),this.YM(Me,be))}this.Lg(q)},m.prototype.JU=function(_,C,D){var L=_.ka(C),B=this.$e(L);if(this.In(B)==-1){var q=this.JF(_,C),Q=this.ya(L),oe=this.$e(Q);this.Mp(B),this.Mp(oe);var le=this.In(B),be=this.In(oe);if(q==-1&&le==-1&&(oe==B?(this.ln(oe,this.Jl),le=be=this.Jl):(be==-1&&(this.ln(oe,this.Jl),be=this.Jl),this.ln(B,oe),le=oe)),q!=-1){var Me=this.$e(q);be==-1&&(0>=this.Mp(Me)?(be=this.In(Me),this.ln(oe,be)):(this.ln(oe,Me),be=Me),oe==B&&(le=be))}le==-1&&this.dY(B,oe),D==0?this.eW(_,C,L,q,B,oe):D==5?this.fW(_,C,L,Q,B,oe):D==4&&this.dW(L,q,B,oe)}},m.prototype.eW=function(_,C,D,L,B,q){var Q=this.jk(B);if(L!=-1){var oe=this.jk(q),le=this.jk(this.$e(L));L=Q&oe&le,le^=le&this.fh(D),(le|=L)!=0&&(this.Xg(q,oe|le),this.Xg(B,le|Q),Q=Q||le)}for(C=_.lb(C);C!=-1&&(L=_.ka(C),D=this.$e(this.ya(L)),B=this.jk(D),q=this.fh(L),oe=this.$e(L),L=B&(le=this.jk(oe))&Q,Q^=Q&q,(Q|=L)!=0);C=_.lb(C))this.Xg(D,B|Q),this.Xg(oe,le|Q)},m.prototype.fW=function(_,C,D,L,B,q){if(B!=q){D=this.Bb(D,this.eg),D+=this.Bb(L,this.eg),L=0;var Q=new A.ja(0),oe=new A.ja(0);oe.add(0);for(var le=_.sc(-1);le!=C;le=_.lb(le)){var be=_.ka(le),Me=this.ya(be),Ye=this.$e(be),it=this.$e(Me);if(Ye!=it){if(be=this.Bb(be,this.eg),L+=be+=this.Bb(Me,this.eg),Me=!1,Q.size!=0&&Q.Gc()==it&&(oe.Jf(),Q.Jf(),Me=!0),this.In(it)==-1)throw A.i.Ra();Me&&this.In(it)==Ye||(oe.add(L),Q.add(Ye))}}L+=D,Q.size!=0&&Q.Gc()==q&&(oe.Jf(),Q.Jf()),L!=0?oe.Gc()==0&&(_=this.g.md,_=this.Ma(_),this.Xg(B,_)):oe.Gc()!=0&&(_=this.g.md,_=this.Ma(_),this.Xg(B,_))}},m.prototype.dW=function(_,C,D,L){var B=this.Ma(this.g.md);if(C==-1)this.Xg(L,this.Io),1&(_=this.Bb(_,this.yg))?this.Xg(D,B):this.Xg(D,this.Io);else{var q=this.jk(L);q==0?(q=this.jk(this.$e(C)),this.Xg(L,q),1&(_=this.Bb(_,this.yg))?this.Xg(D,q==B?this.Io:B):this.Xg(D,q)):1&(_=this.Bb(_,this.yg))?this.Xg(D,q==B?this.Io:B):this.Xg(D,q)}},m.prototype.cY=function(_,C,D,L){var B=L,q=-1,Q=-1,oe=0;do{if(oe==2)return!1;var le=this.Bb(B,C);if(le!=-1){if(q!=-1)return!1;q=le}else{if(Q!=-1)return!1;Q=B}oe++,B=this.kc(this.ya(B))}while(L!=B);return Q!=-1&&q!=-1&&(this.Kb(_.ka(q),C,-2),_.Uj(q,Q),D.add(q),!0)},m.prototype.dY=function(_,C){var D=this.Mp(_);if(D!=0){var L=this.Mp(C);0L||0>D&&0be.compare(B)?le=1:q=-1,this.Kb(Ye,this.be,0),this.Kb(Me,this.be,0),this.Kb(Me,this.eg,le),this.Kb(Ye,this.eg,q)):_==7?(this.Kb(Ye,this.be,this.Io),this.Kb(Me,this.be,oe==1736?Q:0)):_==4&&(this.Kb(Ye,this.be,0),this.Kb(Me,this.be,0),this.Kb(Me,this.yg,1),this.Kb(Ye,this.yg,1)),oe=oe==1736?this.WN:0,this.cx(Me,Q|oe),this.cx(Ye,Q|oe)}}}}},m.prototype.QT=function(_,C){var D=this.om(C);if(D!=-1){var L=this.om(_);this.lh.T(D,1,L),this.Ht(_,D),this.Ht(C,-1)}_=this.ya(_),C=this.ya(C),(D=this.om(C))!=-1&&(L=this.om(_),this.lh.T(D,1,L),this.Ht(_,D),this.Ht(C,-1))},m.prototype.EX=function(_){function C(ri,ti){return L.CO(ri,ti)}var D=new A.ja(0);D.Jb(10);for(var L=this,B=this.Oe;B!=-1;B=this.Tf(B)){D.clear(!1);var q=this.Je(B);if(q!=-1){var Q=q;do D.add(Q),Q=this.kc(this.ya(Q));while(Q!=q);if(1b.Eb())return H.mi(H.Ue(b.Ja()),T,"&")}return D=new H,L=(C=new A.hd).Ib(H.Ue(T)),b=C.Ib(H.Ue(b)),D.Gt(C,m,_),_=D.Cv(L,b),T=H.mi(C.Ke(_),T,"&"),A.ba.Ic(T.K())&&(T.Eh(2,m),T.K()==1736&&T.hm()),T},H.XV=function(T,b,m){if(T.B()||b.B())return T.Ja();var _=[null],C=[0],D=b.Eb()==2;if(b.Eb()!=1&&b.Eb()!=2)throw A.i.Ra();return _[0]=T.D(),D?A.jd.nK(b,_,1,m,C):A.jd.oK(b,_,1,m,C),C[0]==0?T.Ja():T},H.prototype.GU=function(T,b,m,_,C){if(T.B())return T;var D=new A.hd;return T=D.Ib(T),this.Ok(D,T,b,m,_,C)},H.prototype.IU=function(T,b,m,_,C,D){if(C&&T.jc(b)!=550){var L=new A.MC;L.PX(T,m),L.Pg?(A.Vk.W(T,m,D,!0),C=!1):this.j.ty(m)}else A.Vk.W(T,m,D,!0),C=!1;if(_&&T.jc(b)!=550?this.j.rJ(T,b,D):this.j.qJ(T,b,D),this.j.kA)return this.j.Wg(),this.j=null,this.Ok(T,b,m,_,!1,D);if(this.j.ty(NaN),D=this.j.Ma(b),this.eq(D+1),this.Ij[D]=!0,T.jc(b)==1736||_&&T.jc(b)!=550)return T.$o(b,0),b=this.Qt(b,-1,-1),(T=T.Ke(b)).$o(0),C?T.Eh(1,0):(T.Eh(2,m),T.hm()),T;if(T.jc(b)==1607)return b=this.Rt(-1),T=T.Ke(b),C||T.Eh(2,m),T;if(T.jc(b)==550)return b=this.pr(),T=T.Ke(b),C||T.Eh(2,m),T;throw A.i.Ra()},H.prototype.Ok=function(T,b,m,_,C,D){this.j=new A.ku;try{return this.IU(T,b,m,_,C,D)}finally{this.j.Wg()}},H.Ok=function(T,b,m,_,C){return new H().GU(T,b,m,_,C)},H.prototype.HU=function(T,b,m,_){this.Ov=T,this.j=new A.ku,T=b.Kn(m);var C=b.jc(m);if(T!=1||C==550?this.j.qJ(b,m,_):this.j.rJ(b,m,_),!this.j.kA)if(this.j.ty(NaN),_=this.j.Ma(m),this.eq(_+1),this.Ij[_]=!0,b.jc(m)==1736||T==1&&b.jc(m)!=550)b.$o(m,0),_=this.Qt(m,-1,-1),b.cC(_,m),b.wB(_);else if(b.jc(m)==1607)_=this.Rt(-1),b.cC(_,m),b.wB(_);else{if(b.jc(m)!=550)throw A.i.ga("internal error");_=this.pr(),b.cC(_,m),b.wB(_)}},H.prototype.km=function(T,b){var m=A.ba.uf(this.j.g.jc(T)),_=A.ba.uf(this.j.g.jc(b));if(m>_)return T;var C=this.j.Ma(T),D=this.j.Ma(b);if(this.eq(1+(C|D)),this.Ij[this.j.Ma(T)]=!0,m==2&&_==2)return this.Qt(T,b,-1);if(m==1&&_==2||m==1&&_==1)return this.Rt(-1);if(m==0)return this.pr();throw A.i.Ra()},H.prototype.Cv=function(T,b){var m=A.ba.uf(this.j.g.jc(T)),_=A.ba.uf(this.j.g.jc(b)),C=this.j.Ma(T),D=this.j.Ma(b);if(this.eq(1+(C|D)),this.Ij[this.j.Ma(T)|this.j.Ma(b)]=!0,C=-1,1b.Eb())return H.mi(H.Ue(T),T,"-");var C=new A.l;T.A(C);var D=new A.l;if(b.A(D),!C.isIntersecting(D))return H.mi(H.Ue(T),T,"-");var L=new A.l;return L.L(C),L.$b(D),m=A.ua.Xd(m,L,!0),D=new H,L=(C=new A.hd).Ib(H.Ue(T)),b=C.Ib(H.Ue(b)),D.Gt(C,m,_),_=D.km(L,b),_=C.Ke(_),T=H.mi(_,T,"-"),A.ba.Ic(T.K())&&(T.Eh(2,m),T.K()==1736&&T.hm()),T},H.QP=function(T,b,m){if(2>T.length)throw A.i.O("not enough geometries to dissolve");for(var _=0,C=0,D=T.length;CQ?H.Ue(T[oe]):(T=_==2,b=A.ua.Xd(_==0?b:null,L,!0),new H().Ok(B,q,b,T,!0,m))},H.Kz=function(T,b,m,_){var C=[null,null,null],D=new A.l;T.A(D);var L=new A.l;b.A(L);var B=new A.l;if(B.L(D),B.$b(L),m=A.ua.Xd(m,B,!0),(B=new A.l).L(L),L=A.ua.Gr(m),B.X(L,L),!D.isIntersecting(B)){if(T.Eb()<=b.Eb())return C[(T=H.mi(H.Ue(T.Ja()),T,"&")).Eb()]=T,C;if(T.Eb()>b.Eb())return C[(T=H.mi(H.Ue(b.Ja()),T,"&")).Eb()]=T,C}for(L=new H,B=(D=new A.hd).Ib(H.Ue(T)),b=D.Ib(H.Ue(b)),L.Gt(D,m,_),_=L.Kz(B,b),b=0;b<_.length;b++)L=H.mi(D.Ke(_[b]),T,"&"),A.ba.Ic(L.K())&&(L.Eh(2,m),L.K()==1736&&L.hm()),C[L.Eb()]=L;return C},H.gp=function(T,b,m,_){if(T.Eb()>b.Eb())return H.mi(H.Ue(T),T,"^");if(T.Eb()m;m++)b[m]=new A.h;T.iB(b),this.bY(b,b),T.bx(b,4)}},H.prototype.bY=function(T,b){for(var m=0;m(b=.5*b.Uk())?Math.sqrt(_):Math.sqrt(b))},H.prototype.MB=function(){this.eb=1,this.qb=this.Lb=this.jb=0,this.bb=1,this.Qb=0},H.prototype.isIdentity=function(T){if(T!==void 0){var b=A.h.construct(0,1);return this.Gh(b,b),b.sub(A.h.construct(0,1)),b.Uk()>T*T?!1:(b.na(0,0),this.Gh(b,b),!(b.Uk()>T*T)&&(b.na(1,0),this.Gh(b,b),b.sub(A.h.construct(1,0)),b.Uk()<=T*T))}return this.eb==1&&this.bb==1&&this.jb==0&&this.Lb==0&&this.qb==0&&this.Qb==0},H.prototype.Di=function(T){return Math.abs(this.eb*this.bb-this.qb*this.jb)<=2*T*(Math.abs(this.eb*this.bb)+Math.abs(this.qb*this.jb))},H.prototype.ig=function(T,b){this.eb=1,this.jb=0,this.Lb=T,this.qb=0,this.bb=1,this.Qb=b},H.prototype.Jt=function(T,b){b!==void 0?(this.eb=T,this.qb=this.Lb=this.jb=0,this.bb=b,this.Qb=0):this.Jt(T,T)},H.prototype.VB=function(){this.eb=0,this.jb=1,this.Lb=0,this.qb=1,this.Qb=this.bb=0},H.prototype.kX=function(T){this.lX(Math.cos(T),Math.sin(T))},H.prototype.lX=function(T,b){this.eb=T,this.jb=-b,this.Lb=0,this.qb=b,this.bb=T,this.Qb=0},H.prototype.shift=function(T,b){this.Lb+=T,this.Qb+=b},H.prototype.scale=function(T,b){this.eb*=T,this.jb*=T,this.Lb*=T,this.qb*=b,this.bb*=b,this.Qb*=b},H.prototype.flipX=function(T,b){this.eb=-this.eb,this.jb=-this.jb,this.Lb=T+b-this.Lb},H.prototype.flipY=function(T,b){this.qb=-this.qb,this.bb=-this.bb,this.Qb=T+b-this.Qb},H.prototype.rotate=function(T){var b=new H;b.kX(T),this.multiply(b)},H.prototype.inverse=function(T){if(T!==void 0){var b=this.eb*this.bb-this.jb*this.qb;b==0?T.lx():(b=1/b,T.Lb=(this.jb*this.Qb-this.Lb*this.bb)*b,T.Qb=(this.Lb*this.qb-this.eb*this.Qb)*b,T.eb=this.bb*b,T.jb=-this.jb*b,T.qb=-this.qb*b,T.bb=this.eb*b)}else this.inverse(this)},H}();A.Ed=ye}(ae||(ae={})),function(A){var ye=function(){function H(){}return H.prototype.lx=function(){this.Cg=this.Qb=this.Lb=this.Ze=this.We=this.Ve=this.Ye=this.bb=this.jb=this.pf=this.qb=this.eb=0},H.prototype.Jt=function(T,b){this.eb=T,this.jb=this.pf=this.qb=0,this.bb=b,this.We=this.Ve=this.Ye=0,this.Ze=void 0,this.Cg=this.Qb=this.Lb=0},H.prototype.translate=function(T,b,m){this.Lb+=T,this.Qb+=b,this.Cg+=m},H.prototype.hC=function(T){if(!T.B()){for(var b=new A.Od[8],m=0;8>m;m++)b[m]=new A.Od;T.iB(b),this.transform(b,8,b),T.bx(b)}},H.prototype.transform=function(T,b,m){for(var _=0;__;_++)m.wh[_]=-1;m.wh[m.dg[0]]=0}return m.lq=!0,m}return Ne(b,T),b.prototype.se=function(m){this.hasAttribute(m)||(this.wh[m]=0,this.eD())},b.prototype.removeAttribute=function(m){if(m==0)throw A.i.O("Position attribue cannot be removed");this.hasAttribute(m)&&(this.wh[m]=-1,this.eD())},b.prototype.reset=function(){this.dg[0]=0,this.Ba=1;for(var m=0;mm;m++)0<=this.wh[m]&&(this.dg[_]=m,this.wh[m]=_,_++,this.Ba++);this.lq=!0},b.prototype.dc=function(){return this.lq&&(this.yl=this.Cn(),this.lq=!1),this.yl},b.prototype.Nb=function(m){if(m==null)return!1;if(m==this)return!0;if(!(m instanceof b)||m.Ba!=this.Ba)return!1;for(var _=0;_D;D++)!m.hasAttribute(D)&&_.hasAttribute(D)&&(C==null&&(C=new b(m)),C.se(D));return C!=null?C.zF():m},b}(A.sa);A.fe=ye;var H=function(){function T(){this.map=[];var b=new ye;this.add(b),(b=new ye).se(1),this.add(b)}return T.fz=function(){return T.XK},T.prototype.VR=function(){return T.gt},T.prototype.add=function(b){var m=b.dc();if(T.gt!=null&&T.gt.dc()==m&&b.BG(T.gt))return T.gt;if(T.Fw!=null&&T.Fw.dc()==m&&b.BG(T.Fw))return T.Fw;var _=null;return this.map[m]!==void 0&&(_=this.map[m]),_==null&&((_=b.oM()).Ba==1?T.gt=_:_.Ba==2&&_.ld(1)==1?T.Fw=_:this.map[m]=_),_},T.XK=new T,T}()}(ae||(ae={}));var Ot={feet:9002,kilometers:9036,meters:9001,miles:9093,"nautical-miles":9030,yards:9096},jt={acres:109402,ares:109463,hectares:109401,"square-feet":109405,"square-kilometers":109414,"square-meters":109404,"square-miles":109439,"square-yards":109442},nt=new(function(){function A(){this.MM=50,this.pp=new Map,this.ij=[]}return A.prototype.clear=function(){this.ij.length=0,this.pp.clear()},A.prototype.delete=function(ye){return!!this.pp.delete(ye)&&(this.ij.splice(this.ij.indexOf(ye),1),!0)},A.prototype.get=function(ye){var H=this.pp.get(ye);if(H!==void 0)return this.ij[0]!==ye&&(this.ij.splice(this.ij.indexOf(ye),1),this.ij.unshift(ye)),H},A.prototype.has=function(ye){return this.pp.has(ye)},A.prototype.set=function(ye,H){return this.get(ye)!==void 0&&this.delete(ye),this.ij.unshift(ye),this.pp.set(ye,H),this.jM(),this},A.prototype.jM=function(){for(;this.ij.length&&this.ij.length>this.MM;){var ye=this.ij.pop();this.pp.delete(ye)}},A}()),$e=((ct={}).convertJSONToGeometry=function(A){return ae.ac.aP(A)},ct.hasM=function(A){return A.hasAttribute(ae.Kh.M)},ct.hasZ=function(A){return A.hasAttribute(ae.Kh.Z)},ct.getPointX=function(A){return A.Ng()},ct.getPointY=function(A){return A.kh()},ct.getPointZ=function(A){return A.XR()},ct.getPointM=function(A){return A.uR()},ct.getXMin=function(A){return A.gs()},ct.getYMin=function(A){return A.js()},ct.getXMax=function(A){return A.fs()},ct.getYMax=function(A){return A.hs()},ct.getZExtent=function(A){return A.Vg(ae.Kh.Z,0)},ct.getMExtent=function(A){return A.Vg(ae.Kh.M,0)},ct.exportPaths=function(A){var ye=[],H=A.ea(),T=null,b=null,m=A.hasAttribute(ae.Kh.Z),_=A.hasAttribute(ae.Kh.M);m&&(T=A.vb(ae.Kh.Z)),_&&(b=A.vb(ae.Kh.M));for(var C=new ae.h,D=0;Dr,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),i&&(typeof i=="function"?this._toBBox=i:this._initFormat(i)),this.clear()}destroy(){this.clear(),kk.prune(),Xde.prune(),L_.prune(),Kde.prune()}all(e){this._all(this._data,e)}search(e,i){let r=this._data;const n=this._toBBox;if(Yde(e,r))for(kk.clear();r;){for(let s=0,o=r.children.length;s0;){if(r||(r=L_.pop(),n=L_.data[L_.length-1],s=Kde.pop()??0,o=!0),r.leaf&&(i=M8(r.children,e,r.children.length,r.indexHint),i!==-1))return r.children.splice(i,1),L_.push(r),this._condense(L_),this;o||r.leaf||!qMe(r,a)?n?(s++,r=n.children[s],o=!1):r=null:(L_.push(r),Kde.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,i){let r=e;for(Xde.clear();r;){if(r.leaf===!0)for(const n of r.children)i(n);else Xde.pushArray(r.children);r=Xde.pop()??null}}_build(e,i,r,n){const s=r-i+1;let o=this._maxEntries;if(s<=o){const h=new Jde(e.slice(i,r+1));return Qj(h,this._toBBox),h}n||(n=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/o**(n-1)));const a=new YMe([]);a.height=n;const l=Math.ceil(s/o),c=l*Math.ceil(Math.sqrt(o));Vgt(e,i,r,c,this._compareMinX);for(let h=i;h<=r;h+=c){const p=Math.min(h+c-1,r);Vgt(e,h,p,l,this._compareMinY);for(let y=h;y<=p;y+=l){const v=Math.min(y+l-1,p);a.children.push(this._build(e,y,v,n-1))}}return Qj(a,this._toBBox),a}_chooseSubtree(e,i,r,n){for(;n.push(i),i.leaf!==!0&&n.length-1!==r;){let s,o=1/0,a=1/0;for(let l=0,c=i.children.length;l=0&&L_.data[i].children.length>this._maxEntries;)this._split(L_,i),i--;this._adjustParentBBoxes(s,L_,i)}_split(e,i){const r=e.data[i],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 Jde(a):new YMe(a);l.height=r.height,Qj(r,this._toBBox),Qj(l,this._toBBox),i?e.data[i-1].children.push(l):this._splitRoot(r,l)}_splitRoot(e,i){this._data=new YMe([e,i]),this._data.height=e.height+1,Qj(this._data,this._toBBox)}_chooseSplitIndex(e,i,r){let n,s,o;n=s=1/0;for(let a=i;a<=r-i;a++){const l=_J(e,0,a,this._toBBox),c=_J(e,a,r,this._toBBox),h=RMi(l,c),p=WMe(l)+WMe(c);h=i;c--){const h=e.children[c];bJ(a,e.leaf?s(h):h),l+=qde(a)}return l}_adjustParentBBoxes(e,i,r){for(let n=r;n>=0;n--)bJ(i.data[n],e)}_condense(e){for(let i=e.length-1;i>=0;i--){const r=e.data[i];if(r.children.length===0)if(i>0){const n=e.data[i-1],s=n.children;s.splice(M8(s,r,s.length,n.indexHint),1)}else this.clear();else Qj(r,this._toBBox)}}_initFormat(e){const i=["return a"," - b",";"];this._compareMinX=new Function("a","b",i.join(e[0])),this._compareMinY=new Function("a","b",i.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 Qj(t,e){_J(t,0,t.children.length,e,t)}function _J(t,e,i,r,n){n||(n=new Jde([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let s,o=e;o=t.minX&&e.maxY>=t.minY}function Vgt(t,e,i,r,n){const s=[e,i];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;Trt(t,l,a,o,n),s.push(a,l,l,o)}}const kk=new Em,Xde=new Em,L_=new Em,Kde=new Em({deallocator:void 0});let MMi=class{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}},jgt=class extends MMi{constructor(){super(...arguments),this.height=1,this.indexHint=new wre}},Jde=class extends jgt{constructor(e){super(),this.children=e,this.leaf=!0}},YMe=class extends jgt{constructor(e){super(),this.children=e,this.leaf=!1}};const DMi=5e4,wJ={minX:0,minY:0,maxX:0,maxY:0};function FMi(t){wJ.minX=t[0],wJ.minY=t[1],wJ.maxX=t[2],wJ.maxY=t[3]}function LMi(t,e,i){FMi(e),t.search(wJ,i)}let XMe=class{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new HMe(9,Hi("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 i=0;this._idByBounds.forEach((r,n)=>{e[i++]=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=swe();for(const i of this._boundsById.values())i&&(e[0]=Math.min(i[0],e[0]),e[1]=Math.min(i[1],e[1]),e[2]=Math.max(i[2],e[2]),e[3]=Math.max(i[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 i=this._boundsById.get(e);this._boundsById.delete(e),i&&(this._idByBounds.delete(i),this._indexInvalid||this._index.remove(i))}forEachInBounds(e,i){this._loadIndex(),LMi(this._index,e,r=>i(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,i){if(!this._indexInvalid){const r=this._boundsById.get(e);r&&(this._index.remove(r),this._idByBounds.delete(r))}this._boundsById.set(e,i),i&&(this._idByBounds.set(i,e),this._indexInvalid||(this._boundsToLoad.push(i),this._boundsToLoad.length>DMi&&this._loadIndex()))}};function KMe(t,e){return t?e?4:3:e?3:2}function Ggt(t,e,i,r,n){if(lt(e)||!e.lengths.length)return null;const s=n?.originPosition==="upperLeft"?-1:1;t.lengths.length&&(t.lengths.length=0),t.coords.length&&(t.coords.length=0);const o=t.coords,a=[],l=i?[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:c,coords:h}=e,p=KMe(i,r);let y=0;for(const v of c){const x=NMi(l,h,y,v,i,r,s);x&&a.push(x),y+=v*p}if(a.sort((v,x)=>{let I=s*v[2]-s*x[2];return I===0&&i&&(I=v[4]-x[4]),I}),a.length){let v=6*a[0][2];o[0]=a[0][0]/v,o[1]=a[0][1]/v,i&&(v=6*a[0][4],o[2]=v!==0?a[0][3]/v:0),(o[0]l[1]||o[1]l[3]||i&&(o[2]l[5]))&&(o.length=0)}if(!o.length){const v=e.lengths[0]?kMi(h,0,c[0],i,r):null;if(!v)return null;o[0]=v[0],o[1]=v[1],i&&v.length>2&&(o[2]=v[2])}return t}function NMi(t,e,i,r,n,s,o=1){const a=KMe(n,s);let l=i,c=i+a,h=0,p=0,y=0,v=0,x=0;for(let P=0,F=r-1;Pt[1]&&(t[1]=k),jt[3]&&(t[3]=j),n&&(Vt[5]&&(t[5]=V))}if(v*o>0&&(v*=-1),x*o>0&&(x*=-1),!v)return null;const I=[h,p,.5*v];return n&&(I[3]=y,I[4]=.5*x),I}function kMi(t,e,i,r,n){const s=KMe(r,n);let o=e,a=e+s,l=0,c=0,h=0,p=0;for(let y=0,v=i-1;y0?r?[c/l,h/l,p/l]:[c/l,h/l]:i>0?r?[t[e],t[e+1],t[e+2]]:[t[e],t[e+1]]:null}function $Mi(t,e,i,r){const n=i-t,s=r-e;return Math.sqrt(n*n+s*s)}function BMi(t,e,i,r,n,s){const o=r-t,a=n-e,l=s-i;return Math.sqrt(o*o+a*a+l*l)}function VMi(t,e,i,r){return[t+.5*(i-t),e+.5*(r-e)]}function jMi(t,e,i,r,n,s){return[t+.5*(r-t),e+.5*(n-e),i+.5*(s-i)]}const GMi={getObjectId:t=>t.objectId,getAttributes:t=>t.attributes,getAttribute:(t,e)=>t.attributes[e],cloneWithGeometry:(t,e)=>new c_(e,t.attributes,null,t.objectId),getGeometry:t=>t.geometry,getCentroid:(t,e)=>(lt(t.centroid)&&(t.centroid=Ggt(new Ml,t.geometry,e.hasZ,e.hasM)),t.centroid)},JMe=[0,0];function Ugt(t,e){if(!e)return null;if("x"in e){const i={x:0,y:0};return[i.x,i.y]=t(e.x,e.y,JMe),e.z!=null&&(i.z=e.z),e.m!=null&&(i.m=e.m),i}if("xmin"in e){const i={xmin:0,ymin:0,xmax:0,ymax:0};return[i.xmin,i.ymin]=t(e.xmin,e.ymin,JMe),[i.xmax,i.ymax]=t(e.xmax,e.ymax,JMe),e.hasZ&&(i.zmin=e.zmin,i.zmax=e.zmax,i.hasZ=!0),e.hasM&&(i.mmin=e.mmin,i.mmax=e.mmax,i.hasM=!0),i}return"rings"in e?{rings:zgt(e.rings,t),hasM:e.hasM,hasZ:e.hasZ}:"paths"in e?{paths:zgt(e.paths,t),hasM:e.hasM,hasZ:e.hasZ}:"points"in e?{points:Hgt(e.points,t),hasM:e.hasM,hasZ:e.hasZ}:null}function zgt(t,e){const i=[];for(const r of t)i.push(Hgt(r,e));return i}function Hgt(t,e){const i=[];for(const r of t){const n=e(r[0],r[1],[0,0]);i.push(n),r.length>2&&n.push(r[2]),r.length>3&&n.push(r[3])}return i}async function hy(t,e){if(!t||!e)return;const i=Array.isArray(t)?t.map(r=>ve(r.geometry)?r.geometry.spatialReference:null).filter(ve):[t];await YR(i.map(r=>({source:r,dest:e})))}const Wgt=Ugt.bind(null,Z3),qgt=Ugt.bind(null,j8);function wp(t,e,i,r){if(!t||(i||(i=e,e=t.spatialReference),!bh(e)||!bh(i)||Da(e,i)))return t;if(V8(e,i)){const n=Xb(i)?Wgt(t):qgt(t);return n.spatialReference=i,n}return Uq(Su,[t],e,i,null,r)[0]}let UMi=class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,i,r){if(!e||!e.length||!i||!r||Da(i,r))return e;const n={geometries:e,inSpatialReference:i,outSpatialReference:r,resolve:null};return this._jobs.push(n),new Promise(s=>{n.resolve=s,this._timer===null&&(this._timer=setTimeout(this._process,10))})}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:i,inSpatialReference:r,outSpatialReference:n,resolve:s}=e;V8(r,n)?Xb(n)?s(i.map(Wgt)):s(i.map(qgt)):s(Uq(Su,i,r,n,null,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};const zMi=new UMi;function HMi(t,e,i){return zMi.push(t,e,i)}const WMi=new Ks({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),AD=Object.freeze({}),Ygt=new Ml,qMi=new Ml,ZMe=new Ml,QMe={esriGeometryPoint:bTe,esriGeometryPolyline:Dae,esriGeometryPolygon:ITe,esriGeometryMultipoint:TTe};function Xgt(t,e,i,r=t.hasZ,n=t.hasM){if(lt(e))return null;const s=t.hasZ&&r,o=t.hasM&&n;if(i){const a=jA(ZMe,e,t.hasZ,t.hasM,"esriGeometryPoint",i,r,n);return bTe(a,s,o)}return bTe(e,s,o)}function PD(t,e,i,r,n,s,o=e,a=i){const l=e&&o,c=i&&a,h=ve(r)?"coords"in r?r:r.geometry:null;if(lt(h))return null;if(n){let p=WJe(qMi,h,e,i,t,n,o,a);return s&&(p=jA(ZMe,p,l,c,t,s)),QMe[t]?.(p,l,c)??null}if(s){const p=jA(ZMe,h,e,i,t,s,o,a);return QMe[t]?.(p,l,c)??null}return xZt(Ygt,h,e,i,o,a),QMe[t]?.(Ygt,l,c)??null}async function Kgt(t,e,i){const{outFields:r,orderByFields:n,groupByFieldsForStatistics:s,outStatistics:o}=t;if(r)for(let a=0;awp(r,$f));return(await KMi())(o.spatialReference,o,e,s)}async function KMi(){return(await Promise.resolve().then(()=>pZ)).geodesicBuffer}function eG(t){return t&&Qgt in t?JSON.parse(JSON.stringify(t,JMi)):t}const Qgt="_geVersion",JMi=(t,e)=>t!==Qgt?e:void 0,ZMi=iw();let xJ=class{constructor(e){this.geometryInfo=e,this._boundsStore=new XMe,this._featuresById=new Map,this._markedIds=new Set,this.events=new md,this.featureAdapter=GMi}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(i=>{ve(i.geometry)&&i.geometry.coords&&(e+=i.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(lt(this.fullBounds))return null;const[i,r,n,s]=this.fullBounds;return{xmin:i,ymin:r,xmax:n,ymax:s,spatialReference:eG(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const i of e)this._add(i);this._emitChanged()}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const i=this._featuresById.get(e);return i?(this._remove(i),this._emitChanged(),i):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const i of e){const r=this._featuresById.get(i);r&&this._remove(r)}this._emitChanged()}forEachBounds(e,i){for(const r of e){const n=this._boundsStore.get(r.objectId);n&&i(VVt(ZMi,n))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(i=>e(i))}forEachInBounds(e,i){this._boundsStore.forEachInBounds(e,r=>{i(this._featuresById.get(r))})}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach((i,r)=>{this._markedIds.has(r)||(e=!0,this._remove(i))}),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const i=e.objectId;if(i==null)return void Oi.getLogger("esri.layers.graphics.data.FeatureStore").error(new st("featurestore:invalid-feature","feature id is missing",{feature:e}));const r=this._featuresById.get(i);let n;if(this._markedIds.add(i),r?(e.displayId=r.displayId,n=this._boundsStore.get(i),this._boundsStore.delete(i)):ve(this.onFeatureAdd)&&this.onFeatureAdd(e),lt(e.geometry)||!e.geometry.coords||!e.geometry.coords.length)return this._boundsStore.set(i,null),void this._featuresById.set(i,e);n=Fae(ve(n)?n:Mo(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),ve(n)&&this._boundsStore.set(i,n),this._featuresById.set(i,e)}_remove(e){ve(this.onFeatureRemove)&&this.onFeatureRemove(e);const i=e.objectId;return this._markedIds.delete(i),this._boundsStore.delete(i),this._featuresById.delete(i),e}},QMi=class{constructor(e,i){this._cache=new lae(e),this._invalidCache=new lae(i)}get(e,i){const r=`${i.uid}:${e}`,n=this._cache.get(r);if(n)return n;if(this._invalidCache.get(r)!==void 0)return null;try{const s=Ba.create(e,i);return this._cache.put(r,s),s}catch{return this._invalidCache.put(r,null),null}}};const eDe=new QMi(50,500),OD="feature-store:unsupported-query",eyt=" as ",eDi=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeDate"]);function tDi(t,e){if(!e)return!0;const i=eDe.get(e,t);if(!i)throw new st(OD,"invalid SQL expression",{where:e});if(!i.isStandardized)throw new st(OD,"where clause is not standard",{where:e});return RD(t,i.fieldNames,"where clause contains missing fields"),!0}function iDi(t,e,i){if(!e)return!0;const r=eDe.get(e,t);if(!r)throw new st(OD,"invalid SQL expression",{having:e});if(!r.isAggregate)throw new st(OD,"having does not contain a valid aggregate function",{having:e});const n=r.fieldNames;if(RD(t,n,"having contains missing fields"),!r.getExpressions().every(s=>{const{aggregateType:o,field:a}=s,l=t.get(a)?.name;return i.some(c=>{const{onStatisticField:h,statisticType:p}=c;return t.get(h)?.name===l&&p.toLowerCase().trim()===o})}))throw new st(OD,"expressions in having should also exist in outStatistics",{having:e});return!0}function tG(t,e){return t?eDe.get(t,e):null}function RD(t,e,i,r=!0){const n=[];for(const s of e)if(s!=="*"&&!t.has(s))if(r){const o=tyt(s);try{const a=tG(o,t);if(!a)throw new st(OD,"invalid SQL expression",{where:o});if(!a.isStandardized)throw new st(OD,"expression is not standard",{clause:a});RD(t,a.fieldNames,"expression contains missing fields")}catch(a){const l=a&&a.details;if(l&&(l.clause||l.where))throw a;l&&l.missingFields?n.push(...l.missingFields):n.push(s)}}else n.push(s);if(n.length)throw new st(OD,i,{missingFields:n})}function tyt(t){return t.split(eyt)[0]}function rDi(t){return t.split(eyt)[1]}function nDi(t,e){const i=e.get(t);return!!i&&!eDi.has(i.type)}const iyt={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,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 Zde=class{constructor(e,i,r){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=r,this.featureAdapter=i;const n=e.outFields;if(n&&!n.includes("*")){this.outFields=n;let s=0;for(const o of n){const a=tyt(o),l=this.fieldsIndex.get(a),c=l?null:tG(a,r),h=l?l.name:rDi(o)||"FIELD_EXP_"+s++;this._fieldDataCache.set(o,{alias:h,clause:c})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach(i=>this.getAttributes(i)),this._returnDistinctMap.size):e.length}getAttributes(e){const i=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(i)}getFieldValue(e,i,r){const n=r?r.name:i;let s=null;return this._fieldDataCache.has(n)?s=this._fieldDataCache.get(n)?.clause:r||(s=tG(i,this.fieldsIndex),this._fieldDataCache.set(n,{alias:n,clause:s})),r?this.featureAdapter.getAttribute(e,n):s?.calculateValue(e,this.featureAdapter)}getDataValue(e,i){const r=i.normalizationType,n=i.normalizationTotal;let s=i.field&&this.getFieldValue(e,i.field,this.fieldsIndex.get(i.field));if(i.field2&&(s=`${aS(s)}${i.fieldDelimiter}${aS(this.getFieldValue(e,i.field2,this.fieldsIndex.get(i.field2)))}`,i.field3&&(s=`${s}${i.fieldDelimiter}${aS(this.getFieldValue(e,i.field3,this.fieldsIndex.get(i.field3)))}`)),r&&Number.isFinite(s)){const o=r==="field"&&i.normalizationField?this.getFieldValue(e,i.normalizationField,this.fieldsIndex.get(i.normalizationField)):null;s=Kmt(s,r,o,n)}return s}getExpressionValue(e,i,r,n){const s={attributes:this.featureAdapter.getAttributes(e),layer:{fields:this.fieldsIndex.fields}},o=n.createExecContext(s,r);return n.executeFunction(i,o)}getExpressionValues(e,i,r,n){const s={fields:this.fieldsIndex.fields};return e.map(o=>{const a={attributes:this.featureAdapter.getAttributes(o),layer:s},l=n.createExecContext(a,r);return n.executeFunction(i,l)})}validateItem(e,i){return this._fieldDataCache.has(i)||this._fieldDataCache.set(i,{alias:i,clause:tG(i,this.fieldsIndex)}),this._fieldDataCache.get(i)?.clause?.testFeature(e,this.featureAdapter)??!1}validateItems(e,i){return this._fieldDataCache.has(i)||this._fieldDataCache.set(i,{alias:i,clause:tG(i,this.fieldsIndex)}),this._fieldDataCache.get(i)?.clause?.testSet(e,this.featureAdapter)??!1}_processAttributesForOutFields(e){const i=this.outFields;if(!i||!i.length)return this.featureAdapter.getAttributes(e);const r={};for(const n of i){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(lt(e)||!this.returnDistinctValues)return e;const i=this.outFields,r=[];if(i)for(const o of i){const{alias:a}=this._fieldDataCache.get(o);r.push(e[a])}else for(const o in e)r.push(e[o]);const n=`${(i||["*"]).join(",")}=${r.join(",")}`;let s=this._returnDistinctMap.get(n)||0;return this._returnDistinctMap.set(n,++s),s>1?null:e}};function sDi(t,e,i){return{objectId:t,target:e,distance:i,type:"vertex"}}function oDi(t,e,i,r,n,s=!1){return{objectId:t,target:e,distance:i,type:"edge",start:r,end:n,draped:s}}let N_=class{constructor(e,i,r){this.items=e,this.query=i,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 Zde(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:i,having:r,outStatistics:n}=this.query;if(!i?.length)return 1;const o=new Map,a=new Map,l=new Set;for(const c of n){const{statisticType:h}=c,p=h!=="exceedslimit"?c.onStatisticField:void 0;if(!a.has(p)){const v=[];for(const x of i){const I=this._getAttributeValues(e,x,o);v.push(I)}a.set(p,this._calculateUniqueValues(v,e.returnDistinctValues))}const y=a.get(p);for(const v in y){const{data:x,items:I}=y[v],P=x.join(",");r&&!e.validateItems(I,r)||l.add(P)}}return l.size}async createQueryResponse(){let e;if(this.query.outStatistics?e=this.query.outStatistics.some(i=>i.statisticType==="exceedslimit")?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):e=this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const i=this.query.geometry;bh(this.query.outSR)&&!Da(i.spatialReference,this.query.outSR)?e.queryGeometry=eG({spatialReference:this.query.outSR,...wp(i,i.spatialReference,this.query.outSR)}):e.queryGeometry=eG({spatialReference:this.query.outSR,...i})}return e}createSnappingResponse(e,i){const r=this.featureAdapter,n=ryt(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,c={candidates:[]},h=this.geometryType==="esriGeometryPolygon",p=this._getPointCreator(o,this.spatialReference,i),y=new nyt(null,0),v=new nyt(null,0),x={x:0,y:0,z:0};for(const I of this.items){const P=r.getGeometry(I);if(lt(P))continue;const{coords:F,lengths:k}=P;if(y.coords=F,v.coords=F,e.types&$k.EDGE){let j=0;for(let V=0;VI.distance-P.distance),c}_getPointCreator(e,i,r){const n=ve(r)&&!Da(i,r)?a=>wp(a,i,r):a=>a,{hasZ:s}=this,o=0;return e==="3d"?s?({x:a,y:l,z:c})=>n({x:a,y:l,z:c}):({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:i,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,minValue:a,maxValue:l,scale:c}=e,h=this.fieldsIndex.isDateField(i),p=await this._getDataValues({field:i,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,scale:c}),y=VMe({normalizationType:s,normalizationField:n,minValue:a,maxValue:l}),v=this.fieldsIndex.get(i),x={value:.5,fieldType:v?.type},I=pbe(v)?jMe({values:p,supportsNullCount:y,percentileParams:x}):Ude({values:p,minValue:a,maxValue:l,useSampleStdDev:!s,supportsNullCount:y,percentileParams:x});return qmt(I,h)}async createUniqueValuesResponse(e){const{field:i,valueExpression:r,domains:n,returnAllCodedValues:s,scale:o}=e,a=await this._getDataValues({field:i,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:r,scale:o}),l=Ymt(a);return Xmt(l,n,s,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:i,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:l,minValue:c,maxValue:h,numClasses:p,scale:y}=e,v=await this._getDataValues({field:i,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,scale:y}),x=zMe(v,{field:i,normalizationField:n,normalizationType:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:l,minValue:c,maxValue:h,numClasses:p});return Jmt(x,a)}async createHistogramResponse(e){const{field:i,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:l,minValue:c,maxValue:h,numBins:p,scale:y}=e,v=await this._getDataValues({field:i,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,scale:y});return Zmt(v,{field:i,normalizationField:n,normalizationType:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:l,minValue:c,maxValue:h,numBins:p})}_sortFeatures(e,i,r){if(e.length>1&&i&&i.length)for(const n of i.reverse()){const s=n.split(" "),o=s[0],a=this.fieldsIndex.get(o),l=!!s[1]&&s[1].toLowerCase()==="desc",c=zmt(a?.type,l);e.sort((h,p)=>{const y=r(h,o,a),v=r(p,o,a);return c(y,v)})}}_createFeatureQueryResponse(e){const i=this.items,{geometryType:r,hasM:n,hasZ:s,objectIdField:o,spatialReference:a}=this,{outFields:l,outSR:c,quantizationParameters:h,resultRecordCount:p,resultOffset:y,returnZ:v,returnM:x}=e,I=p!=null&&i.length>(y||0)+p,P=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(F=>this.fieldsIndex.get(F)));return{exceededTransferLimit:I,features:this._createFeatures(e,i),fields:P,geometryType:r,hasM:n&&x,hasZ:s&&v,objectIdFieldName:o,spatialReference:eG(c||a),transform:h&&Gde(h)||null}}_createFeatures(e,i){const r=new Zde(e,this.featureAdapter,this.fieldsIndex),{hasM:n,hasZ:s}=this,{orderByFields:o,quantizationParameters:a,returnGeometry:l,returnCentroid:c,maxAllowableOffset:h,resultOffset:p,resultRecordCount:y,returnZ:v=!1,returnM:x=!1}=e,I=s&&v,P=n&&x;let F=[],k=0;const j=[...i];if(this._sortFeatures(j,o,(Y,X,Z)=>r.getFieldValue(Y,X,Z)),l||c){const Y=Gde(a)??void 0;if(l&&!c)for(const X of j)F[k++]={attributes:r.getAttributes(X),geometry:PD(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(X),h,Y,I,P)};else if(!l&&c)for(const X of j)F[k++]={attributes:r.getAttributes(X),centroid:Xgt(this,this.featureAdapter.getCentroid(X,this),Y)};else for(const X of j)F[k++]={attributes:r.getAttributes(X),centroid:Xgt(this,this.featureAdapter.getCentroid(X,this),Y),geometry:PD(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(X),h,Y,I,P)}}else for(const Y of j){const X=r.getAttributes(Y);X&&(F[k++]={attributes:X})}const V=p||0;if(y!=null){const Y=V+y;F=F.slice(V,Math.min(F.length,Y))}return F}_createExceedsLimitQueryResponse(e){let i=!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")i=this.items.length>r;else if(this.items.length>n)i=!0;else{const o=ryt(this.hasZ,this.hasM),a=this.featureAdapter;i=this.items.reduce((l,c)=>{const h=a.getGeometry(c);return l+(ve(h)&&h.coords.length||0)},0)/o>s}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(i)}}]}}async _createStatisticsQueryResponse(e){const i={attributes:{}},r=[],n=new Map,s=new Map,o=new Map,a=new Map,l=new Zde(e,this.featureAdapter,this.fieldsIndex),c=e.outStatistics,{groupByFieldsForStatistics:h,having:p,orderByFields:y}=e,v=h&&h.length,x=!!v,I=x?h[0]:null,P=x&&!this.fieldsIndex.get(I);for(const k of c??[]){const{outStatisticFieldName:j,statisticType:V}=k,Y=k,X=V!=="exceedslimit"?k.onStatisticField:void 0,Z=V==="percentile_disc"||V==="percentile_cont",ie=V==="EnvelopeAggregate"||V==="CentroidAggregate"||V==="ConvexHullAggregate",ce=x&&v===1&&(X===I||P)&&V==="count";if(x){if(!o.has(X)){const _e=[];for(const xe of h){const Pe=this._getAttributeValues(l,xe,n);_e.push(Pe)}o.set(X,this._calculateUniqueValues(_e,!ie&&l.returnDistinctValues))}const he=o.get(X);for(const _e in he){const{count:xe,data:Pe,items:ke,itemPositions:J}=he[_e],de=Pe.join(",");if(!p||l.validateItems(ke,p)){const Se=a.get(de)||{attributes:{}};if(ie){Se.aggregateGeometries||(Se.aggregateGeometries={});const{aggregateGeometries:Re,outStatisticFieldName:Oe}=await this._getAggregateGeometry(Y,ke);Se.aggregateGeometries[Oe]=Re}else{let Re=null;if(ce)Re=xe;else{const Oe=this._getAttributeValues(l,X,n),Ge=J.map(Be=>Oe[Be]);Re=Z&&"statisticParameters"in Y?this._getPercentileValue(Y,Ge):this._getStatisticValue(Y,Ge,null,l.returnDistinctValues)}Se.attributes[j]=Re}let Ie=0;h.forEach((Re,Oe)=>Se.attributes[this.fieldsIndex.get(Re)?Re:"EXPR_"+ ++Ie]=Pe[Oe]),a.set(de,Se)}}}else if(ie){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:he,outStatisticFieldName:_e}=await this._getAggregateGeometry(Y,this.items);i.aggregateGeometries[_e]=he}else{const he=this._getAttributeValues(l,X,n);i.attributes[j]=Z&&"statisticParameters"in Y?this._getPercentileValue(Y,he):this._getStatisticValue(Y,he,s,l.returnDistinctValues)}r.push({name:j,alias:j,type:"esriFieldTypeDouble"})}const F=x?Array.from(a.values()):[i];return this._sortFeatures(F,y,(k,j)=>k.attributes[j]),{fields:r,features:F}}async _getAggregateGeometry(e,i){const r=await Promise.resolve().then(()=>pZ),{statisticType:n,outStatisticFieldName:s}=e,{featureAdapter:o,spatialReference:a,geometryType:l,hasZ:c,hasM:h}=this,p=i.map(x=>PD(l,c,h,o.getGeometry(x))),y=r.convexHull(a,p,!0)[0],v={aggregateGeometries:null,outStatisticFieldName:null};if(n==="EnvelopeAggregate"){const x=y?abe(y):obe(r.union(a,p));v.aggregateGeometries={...x,spatialReference:a},v.outStatisticFieldName=s||"extent"}else if(n==="CentroidAggregate"){const x=y?Cne(y):tBt(obe(r.union(a,p)));v.aggregateGeometries={x:x[0],y:x[1],spatialReference:a},v.outStatisticFieldName=s||"centroid"}else n==="ConvexHullAggregate"&&(v.aggregateGeometries=y,v.outStatisticFieldName=s||"convexHull");return v}_getStatisticValue(e,i,r,n){const{onStatisticField:s,statisticType:o}=e;let a=null;return a=r?.has(s)?r.get(s):pbe(this.fieldsIndex.get(s))?jMe({values:i,returnDistinct:n}):Ude({values:n?[...new Set(i)]:i,minValue:null,maxValue:null,useSampleStdDev:!0}),r&&r.set(s,a),a[o==="var"?"variance":o]}_getPercentileValue(e,i){const{onStatisticField:r,statisticParameters:n,statisticType:s}=e,{value:o,orderBy:a}=n,l=this.fieldsIndex.get(r);return GMe(i,{value:o,orderBy:a,fieldType:l?.type,isDiscrete:s==="percentile_disc"})}_getAttributeValues(e,i,r){if(r.has(i))return r.get(i);const n=this.fieldsIndex.get(i),s=this.items.map(o=>e.getFieldValue(o,i,n));return r.set(i,s),s}_getAttributeDataValues(e,i){return this.items.map(r=>e.getDataValue(r,{field:i.field,field2:i.field2,field3:i.field3,fieldDelimiter:i.fieldDelimiter,normalizationField:i.normalizationField,normalizationType:i.normalizationType,normalizationTotal:i.normalizationTotal}))}async _getAttributeExpressionValues(e,i,r){const{arcadeUtils:n}=await Kv(),s=n.createFunction(i),o=r&&n.getViewInfo(r);return e.getExpressionValues(this.items,s,o,n)}_calculateUniqueValues(e,i){const r={},n=this.items,s=n.length;for(let o=0;o=o||x=o)&&p+(o-y)/(x-y)*(v-p)pZ)}function SJ(t,e,i,r,n){if(Xa(e)&&i==="esriGeometryPoint"&&(t==="esriSpatialRelIntersects"||t==="esriSpatialRelContains")){const s=cM(new Ml,e,!1,!1);return Promise.resolve(o=>uDi(s,!1,!1,o))}if(Xa(e)&&i==="esriGeometryMultipoint"){const s=cM(new Ml,e,!1,!1);if(t==="esriSpatialRelContains")return Promise.resolve(o=>cDi(s,!1,!1,o,r,n))}if(mc(e)&&i==="esriGeometryPoint"&&(t==="esriSpatialRelIntersects"||t==="esriSpatialRelContains"))return Promise.resolve(s=>WH(e,PD(i,r,n,s)));if(mc(e)&&i==="esriGeometryMultipoint"&&t==="esriSpatialRelContains")return Promise.resolve(s=>p8t(e,PD(i,r,n,s)));if(mc(e)&&t==="esriSpatialRelIntersects"){const s=lDi(i);return Promise.resolve(o=>s(e,PD(i,r,n,o)))}return gDi().then(s=>{const o=s[dDi[t]].bind(null,e.spatialReference,e);return a=>o(PD(i,r,n,a))})}async function ayt(t,e,i){const{spatialRel:r,geometry:n}=t;if(n){if(!pDi(r))throw new st(tDe,"Unsupported query spatial relationship",{query:t});if(bh(n.spatialReference)&&bh(i)){if(!fDi(n))throw new st(tDe,"Unsupported query geometry type",{query:t});if(!mDi(e))throw new st(tDe,"Unsupported layer geometry type",{query:t});if(t.outSR)return hy(t.geometry&&t.geometry.spatialReference,t.outSR)}}}function lyt(t){if(mc(t))return!0;if(Xa(t)){for(const e of t.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}async function yDi(t,e){if(!t)return null;const i=e.featureAdapter,{startTimeField:r,endTimeField:n}=t;let s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;if(r&&n)await e.forEach(a=>{const l=i.getAttribute(a,r),c=i.getAttribute(a,n);l==null||isNaN(l)||(s=Math.min(s,l)),c==null||isNaN(c)||(o=Math.max(o,c))});else{const a=r||n;await e.forEach(l=>{const c=i.getAttribute(l,a);c==null||isNaN(c)||(s=Math.min(s,c),o=Math.max(o,c))})}return{start:s,end:o}}function uyt(t,e,i){if(!e||!t)return null;const{startTimeField:r,endTimeField:n}=t;if(!r&&!n)return null;const{start:s,end:o}=e;return s===null&&o===null?null:s===void 0&&o===void 0?bDi():r&&n?vDi(i,r,n,s,o):_Di(i,r||n,s,o)}function vDi(t,e,i,r,n){return r!=null&&n!=null?s=>{const o=t.getAttribute(s,e),a=t.getAttribute(s,i);return(o==null||o<=n)&&(a==null||a>=r)}:r!=null?s=>{const o=t.getAttribute(s,i);return o==null||o>=r}:n!=null?s=>{const o=t.getAttribute(s,e);return o==null||o<=n}:void 0}function _Di(t,e,i,r){return i!=null&&r!=null&&i===r?n=>t.getAttribute(n,e)===i:i!=null&&r!=null?n=>{const s=t.getAttribute(n,e);return s>=i&&s<=r}:i!=null?n=>t.getAttribute(n,e)>=i:r!=null?n=>t.getAttribute(n,e)<=r:void 0}function bDi(){return()=>!1}function wDi(t){return t!=null&&t.every(e=>e.statisticType!=="exceedslimit")}const MD="feature-store:unsupported-query",xDi=new pxe(2e6);let SDi=0,Bk=class{constructor(e){this._geometryQueryCache=null,this._changeHandle=null,this.capabilities={query:iyt},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 Yjt(SDi+++"$$",xDi)),this.fieldsIndex=new Lm(e.fields),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=Uc(this._frameTask),this.clearCache(),da(this._geometryQueryCache),this._changeHandle=Uc(this._changeHandle),da(this.fieldsIndex)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._geometryQueryCache?.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null}async executeQuery(e,i){try{return(await this._executeQuery(e,{},i)).createQueryResponse()}catch(r){if(r!==AD)throw r;return new N_([],e,this).createQueryResponse()}}async executeQueryForCount(e={},i){try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},i)).createQueryResponseForCount()}catch(r){if(r!==AD)throw r;return 0}}async executeQueryForExtent(e,i){const r=e.outSR;try{const n=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},i),s=n.size;return s?{count:s,extent:await this._getBounds(n.items,n.spatialReference,r||this.spatialReference)}:{count:0,extent:null}}catch(n){if(n===AD)return{count:0,extent:null};throw n}}async executeQueryForIds(e,i){return this.executeQueryForIdSet(e,i).then(r=>Array.from(r))}async executeQueryForIdSet(e,i){try{const r=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},i),n=r.items,s=new Set;return await this._reschedule(()=>{for(const o of n)s.add(r.featureAdapter.getObjectId(o))},i),s}catch(r){if(r===AD)return new Set;throw r}}async executeQueryForSnapping(e,i){const{point:r,distance:n,types:s}=e;if(s===$k.NONE)return{candidates:[]};const o=await this._reschedule(()=>this._checkQuerySupport(e.query),i),a=!Da(r.spatialReference,this.spatialReference);a&&await hy(r.spatialReference,this.spatialReference);const l=typeof n=="number"?n:n.x,c=typeof n=="number"?n:n.y,h={xmin:r.x-l,xmax:r.x+l,ymin:r.y-c,ymax:r.y+c,spatialReference:r.spatialReference},p=a?wp(h,this.spatialReference):h;if(!p)return{candidates:[]};const y=(await ov(Sl(r),null,{signal:i}))[0],v=(await ov(Sl(p),null,{signal:i}))[0];if(lt(y)||lt(v))return{candidates:[]};const x=new N_(await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(v.toJSON())),i),o,this);await this._reschedule(()=>this._executeObjectIdsQuery(x),i),await this._reschedule(()=>this._executeTimeQuery(x),i),await this._reschedule(()=>this._executeAttributesQuery(x),i);const I=y.toJSON(),P=a?wp(I,this.spatialReference):I,F=a?Math.max(p.xmax-p.xmin,p.ymax-p.ymin)/2:n;return x.createSnappingResponse({...e,point:P,distance:F},r.spatialReference)}async executeQueryForLatestObservations(e,i){if(!this.timeInfo||!this.timeInfo.trackIdField)throw new st(MD,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const r=await this._executeQuery(e,{},i);return await this._reschedule(()=>this._filterLatest(r),i),r.createQueryResponse()}catch(r){if(r!==AD)throw r;return new N_([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},i,r){const{field:n,normalizationField:s,valueExpression:o}=i;return(await this._getQueryEngineResultForStats(e,{field:n,normalizationField:s,valueExpression:o},r)).createSummaryStatisticsResponse(i)}async executeQueryForUniqueValues(e={},i,r){const{field:n,field2:s,field3:o,valueExpression:a}=i;return(await this._getQueryEngineResultForStats(e,{field:n,field2:s,field3:o,valueExpression:a},r)).createUniqueValuesResponse(i)}async executeQueryForClassBreaks(e={},i,r){const{field:n,normalizationField:s,valueExpression:o}=i;return(await this._getQueryEngineResultForStats(e,{field:n,normalizationField:s,valueExpression:o},r)).createClassBreaksResponse(i)}async executeQueryForHistogram(e={},i,r){const{field:n,normalizationField:s,valueExpression:o}=i;return(await this._getQueryEngineResultForStats(e,{field:n,normalizationField:s,valueExpression:o},r)).createHistogramResponse(i)}async fetchRecomputedExtents(e){const[i,r]=await Promise.all(["getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getBounds(await this._getAllFeatures(),this.spatialReference,this.spatialReference),ve(this._timeExtentPromise)?this._timeExtentPromise:this._timeExtentPromise=yDi(this.timeInfo,this.featureStore)]);return yn(e),{fullExtent:i,timeExtent:r}}async _getBounds(e,i,r){const n=_7e(iw(),d9);await this.featureStore.forEachBounds(e,a=>AW(n,a));const s={xmin:n[0],ymin:n[1],xmax:n[3],ymax:n[4],spatialReference:eG(this.spatialReference)};this.hasZ&&isFinite(n[2])&&isFinite(n[5])&&(s.zmin=n[2],s.zmax=n[5]);const o=wp(s,i,r);if(o.spatialReference=eG(r),o.xmax-o.xmin==0){const a=Hc(o.spatialReference);o.xmin-=a,o.xmax+=a}if(o.ymax-o.ymin==0){const a=Hc(o.spatialReference);o.ymin-=a,o.ymax+=a}if(this.hasZ&&o.zmin!=null&&o.zmax!=null&&o.zmax-o.zmin==0){const a=Hc(o.spatialReference);o.zmin-=a,o.zmax+=a}return o}async _schedule(e,i){return ve(this._frameTask)?this._frameTask.schedule(e,i):e(Lle)}async _reschedule(e,i){return ve(this._frameTask)?this._frameTask.reschedule(e,i):e(Lle)}async _getAllFeaturesQueryEngineResult(e){return new N_(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(lt(this._allFeaturesPromise)){const r=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach(n=>r.push(n))})().then(()=>r)}const e=this._allFeaturesPromise,i=await e;return e===this._allFeaturesPromise?i.slice():this._getAllFeatures()}async _executeQuery(e,i,r){e=gi(e),e=await this._schedule(()=>Kgt(e,this.definitionExpression,this.spatialReference),r),e=await this._reschedule(()=>this._checkQuerySupport(e),r),e={...e,...i};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,i){if(lt(e.sceneFilter))return null;const{outSR:r,returnGeometry:n,returnCentroid:s}=e,o=this.featureStore.featureSpatialReference,a=e.sceneFilter.geometry,l=lt(o)||Da(o,a.spatialReference)?a:wp(a,o);if(!l)return null;const c=n||s,h=bh(r)&&!Da(this.spatialReference,r)&&c?async I=>this._project(I,r):I=>I,p=this.featureAdapter,y=await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(l)),i);if(e.sceneFilter.spatialRelationship==="disjoint"){if(!y.length)return null;const I=new Set;for(const k of y)I.add(p.getObjectId(k));const P=await this._reschedule(()=>this._getAllFeatures(),i),F=await this._reschedule(async()=>{const k=await SJ("esriSpatialRelDisjoint",l,this.geometryType,this.hasZ,this.hasM),j=Y=>!I.has(p.getObjectId(Y))||k(p.getGeometry(Y)),V=await this._runSpatialFilter(P,j,i);return new N_(V,e,this)},i);return h(F)}if(!y.length)return new N_([],e,this);if(this._canExecuteSinglePass(l,e))return h(new N_(y,e,this));const v=await SJ("esriSpatialRelContains",l,this.geometryType,this.hasZ,this.hasM),x=await this._runSpatialFilter(y,I=>v(p.getGeometry(I)),i);return h(new N_(x,e,this))}async _executeGeometryQuery(e,i,r){if(ve(i)&&i.items.length===0)return i;e=ve(i)?i.query:e;const{geometry:n,outSR:s,spatialRel:o,returnGeometry:a,returnCentroid:l}=e,c=this.featureStore.featureSpatialReference,h=!n||lt(c)||Da(c,n.spatialReference)?n:wp(n,c),p=a||l,y=bh(s)&&!Da(this.spatialReference,s),v=this._geometryQueryCache&<(i)?JSON.stringify(y&&p?{originalFilterGeometry:n,spatialRelationship:o,outSpatialReference:s}:{originalFilterGeometry:n,spatialRelationship:o}):null,x=v?this._geometryQueryCache.get(v):null;if(ve(x))return new N_(x,e,this);const I=async V=>(y&&p&&await this._project(V,s),v&&this._geometryQueryCache.put(v,V.items,V.items.length+1),V);if(!h)return I(ve(i)?i:await this._getAllFeaturesQueryEngineResult(e));const P=this.featureAdapter;let F=await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(n)),r);if(o==="esriSpatialRelDisjoint"){if(!F.length)return I(ve(i)?i:await this._getAllFeaturesQueryEngineResult(e));const V=new Set;for(const Z of F)V.add(P.getObjectId(Z));const Y=ve(i)?i.items:await this._reschedule(()=>this._getAllFeatures(),r),X=await this._reschedule(async()=>{const Z=await SJ(o,h,this.geometryType,this.hasZ,this.hasM),ie=he=>!V.has(P.getObjectId(he))||Z(P.getGeometry(he)),ce=await this._runSpatialFilter(Y,ie,r);return new N_(ce,e,this)},r);return I(X)}if(ve(i)){const V=new wre;F=F.filter(Y=>M8(i.items,Y,i.items.length,V)>=0)}if(!F.length){const V=new N_([],e,this);return v&&this._geometryQueryCache.put(v,V.items,1),V}if(this._canExecuteSinglePass(h,e))return I(new N_(F,e,this));const k=await SJ(o,h,this.geometryType,this.hasZ,this.hasM),j=await this._runSpatialFilter(F,V=>k(P.getGeometry(V)),r);return I(new N_(j,e,this))}_executeAggregateIdsQuery(e){if(e.items.length===0||!e.query.aggregateIds||!e.query.aggregateIds.length||lt(this.aggregateAdapter))return;const i=new Set;for(const n of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(n).forEach(s=>i.add(s));const r=this.featureAdapter.getObjectId;e.items=e.items.filter(n=>i.has(r(n)))}_executeObjectIdsQuery(e){if(e.items.length===0||!e.query.objectIds||!e.query.objectIds.length)return;const i=new Set(e.query.objectIds),r=this.featureAdapter.getObjectId;e.items=e.items.filter(n=>i.has(r(n)))}_executeTimeQuery(e){if(e.items.length===0)return;const i=uyt(this.timeInfo,e.query.timeExtent,this.featureAdapter);lt(i)||(e.items=e.items.filter(i))}_executeAttributesQuery(e){if(e.items.length===0)return;const i=tG(e.query.where,this.fieldsIndex);if(i){if(!i.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(r=>i.testFeature(r,this.featureAdapter))}}async _runSpatialFilter(e,i,r){if(!i)return e;if(lt(this._frameTask))return e.filter(a=>i(a));let n=0;const s=new Array,o=async a=>{for(;no(c),r)}};return this._reschedule(a=>o(a),r).then(()=>s)}_filterLatest(e){const{trackIdField:i,startTimeField:r,endTimeField:n}=this.timeInfo,s=n||r,o=new Map,a=this.featureAdapter.getAttribute;for(const l of e.items){const c=a(l,i),h=a(l,s),p=o.get(c);(!p||h>a(p,s))&&o.set(c,l)}e.items=Array.from(o.values())}_canExecuteSinglePass(e,i){const{spatialRel:r}=i;return lyt(e)&&(r==="esriSpatialRelEnvelopeIntersects"||this.geometryType==="esriGeometryPoint"&&(r==="esriSpatialRelIntersects"||r==="esriSpatialRelContains"||r==="esriSpatialRelWithin"))}async _project(e,i){if(!i||Da(this.spatialReference,i))return e;const r=this.featureAdapter,n=await HMi(e.items.map(s=>PD(this.geometryType,this.hasZ,this.hasM,r.getGeometry(s))),this.spatialReference,i);return e.items=n.map((s,o)=>r.cloneWithGeometry(e.items[o],Y5(s,this.hasZ,this.hasM))),e}_getQueryBBoxes(e){if(lyt(e)){if(mc(e))return[Zne(e.xmin,e.ymin,e.xmax,e.ymax)];if(Xa(e))return e.rings.map(i=>Zne(Math.min(i[0][0],i[2][0]),Math.min(i[0][1],i[2][1]),Math.max(i[0][0],i[2][0]),Math.max(i[0][1],i[2][1])))}return[RC(Mo(),e)]}async _searchFeatures(e){const i=new Set;await Promise.all(e.map(n=>this.featureStore.forEachInBounds(n,s=>i.add(s))));const r=Array.from(i.values());return i.clear(),r}async _checkStatisticsSupport(e,i){if((e.distance??0)<0||e.geometryPrecision!=null||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new st(MD,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),Promise.all([this._checkStatisticsParamsSupport(i),ayt(e,this.geometryType,this.spatialReference),hy(this.spatialReference,e.outSR)]).then(()=>e)}async _checkStatisticsParamsSupport(e){let i=[];if(e.valueExpression){const{arcadeUtils:r}=await Kv();i=r.extractFieldNames(e.valueExpression)}if(e.field&&i.push(e.field),e.field2&&i.push(e.field2),e.field3&&i.push(e.field3),e.normalizationField&&i.push(e.normalizationField),!i.length)throw new st(MD,"params should have at least a field or valueExpression",{params:e});RD(this.fieldsIndex,i,"params contains missing fields")}async _checkQuerySupport(e){if((e.distance??0)<0||e.geometryPrecision!=null||e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new st(MD,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),this._checkStatisticsQuerySupport(e),Promise.all([ayt(e,this.geometryType,this.spatialReference),hy(this.spatialReference,e.outSR)]).then(()=>e)}_checkAttributesQuerySupport(e){const{outFields:i,orderByFields:r,returnDistinctValues:n,outStatistics:s}=e,o=s?s.map(a=>a.outStatisticFieldName&&a.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(r&&r.length>0){const a=" asc",l=" desc",c=r.map(h=>{const p=h.toLowerCase();return p.includes(a)?p.split(a)[0]:p.includes(l)?p.split(l)[0]:h}).filter(h=>!o.includes(h));RD(this.fieldsIndex,c,"orderByFields contains missing fields")}if(i&&i.length>0)RD(this.fieldsIndex,i,"outFields contains missing fields");else if(n)throw new st(MD,"outFields should be specified for returnDistinctValues",{query:e});tDi(this.fieldsIndex,e.where)}_checkStatisticsQuerySupport(e){const{outStatistics:i,groupByFieldsForStatistics:r,having:n}=e,s=r&&r.length,o=i&&i.length;if(n){if(!s||!o)throw new st(MD,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:e});iDi(this.fieldsIndex,n,i)}if(o){if(!wDi(i))return;const a=i.map(l=>l.onStatisticField).filter(Boolean);RD(this.fieldsIndex,a,"onStatisticFields contains missing fields"),s&&RD(this.fieldsIndex,r,"groupByFieldsForStatistics contains missing fields");for(const l of i){const{onStatisticField:c,statisticType:h}=l;if((h==="percentile_disc"||h==="percentile_cont")&&"statisticParameters"in l){const{statisticParameters:p}=l;if(!p)throw new st(MD,"statisticParamters should be set for percentile type",{definition:l,query:e})}else if(h!=="count"&&c&&nDi(c,this.fieldsIndex))throw new st(MD,"outStatistics contains non-numeric fields",{definition:l,query:e})}}}async _getQueryEngineResultForStats(e,i,r){e=gi(e);try{e=await this._schedule(()=>Kgt(e,this.definitionExpression,this.spatialReference),r),e=await this._reschedule(()=>this._checkStatisticsSupport(e,i),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!==AD)throw n;return new N_([],e,this)}}};const cyt=/^\s*"([\S\s]*)"\s*$/,hyt=/""/g,dyt=` +`,CDi=[","," ",";","|"," "];function*pyt(t,e,i){let r=0;for(;r<=t.length;){const n=t.indexOf(e,r),s=t.substring(r,n>-1?n:void 0);r+=s.length+e.length,i&&!s.trim()||(yield s)}}function fyt(t){const e=t.includes(`\r `)?`\r -`:Egt;return Igt(t,e,!0)}function Pgt(t,e){return Igt(t,e,!1)}function _Mi(t,e,i){t=t.trim(),e=e?.trim();const r=[],n=Array.from(new Set([i?.delimiter,...vMi])).filter(o=>o!=null);for(const o of n){const a=FMe(t,o).length,l=FMe(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=bMi(Rgt(t,o).names,i?.longitudeField,i?.latitudeField);if(a.longitudeFieldName&&a.latitudeFieldName)return{delimiter:o,locationInfo:a}}return{delimiter:s[0],locationInfo:null}}function*Ogt(t,e,i,r=()=>Object.create(null)){const n=Agt(t);n.next();let s="",o="",a=0,l=r(),c=0;e:for(const d of n){const p=Pgt(d,i);for(const y of p)if(s+=o+y,o="",a+=Mgt(y),a%2==0){if(a>0){const v=Cgt.exec(s);if(!v){l=r(),c=0,s="",a=0;continue e}l[e[c]]=v[1].replace(Tgt,'"'),c++}else l[e[c]]=s,c++;s="",a=0}else o=i;a===0?(yield l,l=r(),c=0):o=Egt}}function Rgt(t,e){const i=FMe(t,e).filter(n=>n!=null),r=i.map(n=>i9(n));for(let n=r.length-1;n>=0;n--)r[n]||(r.splice(n,1),i.splice(n,1));return{names:r,aliases:i}}function FMe(t,e){if(!t?.length)return[];const i=[];let r="",n="",s=0;const o=Pgt(t,e);for(const a of o)if(r+=n+a,n="",s+=Mgt(a),s%2==0){if(s>0){const l=Cgt.exec(r);l&&i.push(l[1].replace(Tgt,'"'))}else i.push(r);r="",s=0}else n=e;return i}function Mgt(t){let e=0,i=0;for(i=t.indexOf('"',i);i>=0;)e++,i=t.indexOf('"',i+1);return e}function bMi(t,e,i){e=i9(e)?.toLowerCase(),i=i9(i)?.toLowerCase();const r=t.map(o=>o.toLowerCase()),n=e?t[r.indexOf(e)]:null,s=i?t[r.indexOf(i)]:null;return{longitudeFieldName:n||t[r.indexOf(EMi.find(o=>r.includes(o)))],latitudeFieldName:s||t[r.indexOf(TMi.find(o=>r.includes(o)))]}}function wMi(t,e,i,r,n){const s=[],o=Ogt(t,i,e),a=[];for(const l of o){if(a.length===10)break;a.push(l)}for(let l=0;lv[c]))){case"integer":p="esriFieldTypeInteger";break;case"double":p="esriFieldTypeDouble";break;case"date":p="esriFieldTypeDate",y=36;break;default:p="esriFieldTypeString",y=255}s.push({name:c,type:p,alias:d,length:y})}}return s}function xMi(t){if(!t.length)return"string";const e=/[^+-.,0-9]/;return t.map(i=>{let r=!1;if(i!==""){if(e.test(i))r=!0;else{let n=LMe(i);if(!isNaN(n))return/[.,]/.test(i)||!Number.isInteger(n)||n>214783647||n<-214783648?"double":"integer";if(i.includes("E")){if(n=Number(i),!isNaN(n))return"double";if(i.includes(",")){if(i=i.replace(",","."),n=Number(i),!isNaN(n))return"double";r=!0}else r=!0}else r=!0}return r?/^[-]?\d*[.,]?\d*$/.test(i)?"string":Dgt(new Date(i),i)?"date":"string":"string"}}).reduce((i,r)=>i===void 0?r:r===void 0?i:i===r?r:i==="string"||r==="string"?"string":i==="double"||r==="double"?"double":void 0)}function Dgt(t,e){if(!t||Object.prototype.toString.call(t)!=="[object Date]"||isNaN(t.getTime()))return!1;let i=!0;if(!CMi&&/\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=!SMi.test(r[s]),s++;i=!n}}return i}const LMe=function(){const t=opt(),e=new RegExp("^"+t.regexp+"$"),i=new RegExp("["+t.group+"\\s\\xa0]","g"),r=t.factor;return n=>{const s=e.exec(n);if(t.factor=r,!s)return NaN;let o=s[1];if(!s[1]){if(!s[2])return NaN;o=s[2],t.factor*=-1}return o=o.replace(i,"").replace(t.decimal,"."),+o*t.factor}}(),SMi=/^((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,CMi=Number.isNaN(new Date("technology 10").getTime()),TMi=["lat","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],EMi=["lon","lng","long","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"];function YV(t){return{renderer:{type:"simple",symbol:t==="esriGeometryPoint"||t==="esriGeometryMultipoint"?_Ye:t==="esriGeometryPolyline"?bYe:wYe}}}const IMi=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let AMi=1;function kMe(t,e){if(Gi("esri-csp-restrictions"))return()=>({[e]:null,...t});try{let i=`this.${e} = null;`;for(const n in t)i+=`this${IMi.test(n)?`.${n}`:`["${n}"]`} = ${JSON.stringify(t[n])};`;const r=new Function(` - return class AttributesClass$${AMi++} { +`:dyt;return pyt(t,e,!0)}function myt(t,e){return pyt(t,e,!1)}function TDi(t,e,i){t=t.trim(),e=e?.trim();const r=[],n=Array.from(new Set([i?.delimiter,...CDi])).filter(o=>o!=null);for(const o of n){const a=rDe(t,o).length,l=rDe(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=EDi(yyt(t,o).names,i?.longitudeField,i?.latitudeField);if(a.longitudeFieldName&&a.latitudeFieldName)return{delimiter:o,locationInfo:a}}return{delimiter:s[0],locationInfo:null}}function*gyt(t,e,i,r=()=>Object.create(null)){const n=fyt(t);n.next();let s="",o="",a=0,l=r(),c=0;e:for(const h of n){const p=myt(h,i);for(const y of p)if(s+=o+y,o="",a+=vyt(y),a%2==0){if(a>0){const v=cyt.exec(s);if(!v){l=r(),c=0,s="",a=0;continue e}l[e[c]]=v[1].replace(hyt,'"'),c++}else l[e[c]]=s,c++;s="",a=0}else o=i;a===0?(yield l,l=r(),c=0):o=dyt}}function yyt(t,e){const i=rDe(t,e).filter(n=>n!=null),r=i.map(n=>e9(n));for(let n=r.length-1;n>=0;n--)r[n]||(r.splice(n,1),i.splice(n,1));return{names:r,aliases:i}}function rDe(t,e){if(!t?.length)return[];const i=[];let r="",n="",s=0;const o=myt(t,e);for(const a of o)if(r+=n+a,n="",s+=vyt(a),s%2==0){if(s>0){const l=cyt.exec(r);l&&i.push(l[1].replace(hyt,'"'))}else i.push(r);r="",s=0}else n=e;return i}function vyt(t){let e=0,i=0;for(i=t.indexOf('"',i);i>=0;)e++,i=t.indexOf('"',i+1);return e}function EDi(t,e,i){e=e9(e)?.toLowerCase(),i=e9(i)?.toLowerCase();const r=t.map(o=>o.toLowerCase()),n=e?t[r.indexOf(e)]:null,s=i?t[r.indexOf(i)]:null;return{longitudeFieldName:n||t[r.indexOf(MDi.find(o=>r.includes(o)))],latitudeFieldName:s||t[r.indexOf(RDi.find(o=>r.includes(o)))]}}function IDi(t,e,i,r,n){const s=[],o=gyt(t,i,e),a=[];for(const l of o){if(a.length===10)break;a.push(l)}for(let l=0;lv[c]))){case"integer":p="esriFieldTypeInteger";break;case"double":p="esriFieldTypeDouble";break;case"date":p="esriFieldTypeDate",y=36;break;default:p="esriFieldTypeString",y=255}s.push({name:c,type:p,alias:h,length:y})}}return s}function ADi(t){if(!t.length)return"string";const e=/[^+-.,0-9]/;return t.map(i=>{let r=!1;if(i!==""){if(e.test(i))r=!0;else{let n=nDe(i);if(!isNaN(n))return/[.,]/.test(i)||!Number.isInteger(n)||n>214783647||n<-214783648?"double":"integer";if(i.includes("E")){if(n=Number(i),!isNaN(n))return"double";if(i.includes(",")){if(i=i.replace(",","."),n=Number(i),!isNaN(n))return"double";r=!0}else r=!0}else r=!0}return r?/^[-]?\d*[.,]?\d*$/.test(i)?"string":_yt(new Date(i),i)?"date":"string":"string"}}).reduce((i,r)=>i===void 0?r:r===void 0?i:i===r?r:i==="string"||r==="string"?"string":i==="double"||r==="double"?"double":void 0)}function _yt(t,e){if(!t||Object.prototype.toString.call(t)!=="[object Date]"||isNaN(t.getTime()))return!1;let i=!0;if(!ODi&&/\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=!PDi.test(r[s]),s++;i=!n}}return i}const nDe=function(){const t=Wpt(),e=new RegExp("^"+t.regexp+"$"),i=new RegExp("["+t.group+"\\s\\xa0]","g"),r=t.factor;return n=>{const s=e.exec(n);if(t.factor=r,!s)return NaN;let o=s[1];if(!s[1]){if(!s[2])return NaN;o=s[2],t.factor*=-1}return o=o.replace(i,"").replace(t.decimal,"."),+o*t.factor}}(),PDi=/^((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,ODi=Number.isNaN(new Date("technology 10").getTime()),RDi=["lat","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],MDi=["lon","lng","long","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"];function iG(t){return{renderer:{type:"simple",symbol:t==="esriGeometryPoint"||t==="esriGeometryMultipoint"?SYe:t==="esriGeometryPolyline"?CYe:TYe}}}const DDi=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let FDi=1;function sDe(t,e){if(Hi("esri-csp-restrictions"))return()=>({[e]:null,...t});try{let i=`this.${e} = null;`;for(const n in t)i+=`this${DDi.test(n)?`.${n}`:`["${n}"]`} = ${JSON.stringify(t[n])};`;const r=new Function(` + return class AttributesClass$${FDi++} { constructor() { ${i}; } } - `)();return()=>new r}catch{return()=>({[e]:null,...t})}}function Fgt(t={}){return[{name:"New Feature",description:"",prototype:{attributes:hi(t)}}]}function NMe(t,e){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:t},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},query:ggt,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}}}const PMi=YV("esriGeometryPoint"),OMi=["csv"],RMi=[0,0];let MMi=class{constructor(e,i){this.x=e,this.y=i}},DMi=class{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const i=await this._fetch(e);return this._createFeatures(i)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,i={}){this._loadOptions=e;const[r]=await Promise.all([this._fetch(i.signal),this._checkProjection(e?.parsingOptions?.spatialReference)]),n=FMi(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:c}=a;n.layerDefinition.timeInfo.timeExtent=[l,c]}return n}async applyEdits(){throw new st("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,i.signal)}async queryFeatureCount(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,i.signal)}async queryObjectIds(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,i.signal)}async queryExtent(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,i.signal)}async querySnapping(e,i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,i.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=EC(this._snapshotFeatures),this._snapshotTask.promise.then(n=>{this._queryEngine.featureStore.clear(),n&&this._queryEngine.featureStore.addMany(n)},n=>{this._queryEngine.featureStore.clear(),ss(n)||Ei.getLogger("esri.layers.CSVLayer").error(new st("csv-layer:refresh","An error occurred during refresh",{error:n}))}),await this._waitSnapshotComplete();const{fullExtent:i,timeExtent:r}=await this._queryEngine.fetchRecomputedExtents();return{extent:i,timeExtent:r}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:i,customParameters:r}=this._loadOptions;if(!i)throw new st("csv-layer:invalid-source","url not defined");const n=sa(i);return(await ir(n.path,{query:{...n.query,...r},responseType:"text",signal:e})).data}_createQueryEngine(e){const{objectIdField:i,fields:r,extent:n,timeInfo:s}=e.layerDefinition,o=new yJ({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new NN({fields:r,geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:s,objectIdField:i,spatialReference:n.spatialReference||{wkid:4326},cacheSpatialQueries:!0,featureStore:o})}async _createFeatures(e){const{latitudeFieldName:i,longitudeFieldName:r}=this._locationInfo,{objectIdField:n,fieldsIndex:s,spatialReference:o}=this._queryEngine;let a=[];const l=[],c=s.fields.filter(S=>S.name!==n).map(S=>S.name);let d=0;const p={};for(const S of s.fields)if(S.type!=="esriFieldTypeOID"&&S.type!=="esriFieldTypeGlobalID"){const I=Dne(S);I!==void 0&&(p[S.name]=I)}const y=Ogt(e,c,this._delimiter,kMe(p,n));for(const S of y){const I=this._parseCoordinateValue(S[i]),O=this._parseCoordinateValue(S[r]);if(O!=null&&I!=null&&!isNaN(I)&&!isNaN(O)){S[i]=I,S[r]=O;for(const L in S)if(L!==i&&L!==r){if(s.isDateField(L)){const N=new Date(S[L]);S[L]=Dgt(N,S[L])?N.getTime():null}else if(s.isNumericField(L)){const N=LMe(S[L]);isNaN(N)?S[L]=null:S[L]=N}}S[n]=d,d++,a.push(new MMi(O,I)),l.push(S)}}if(!Ca({wkid:4326},o))if(Wb(o))for(const S of a)[S.x,S.y]=Z3(S.x,S.y,RMi);else a=jq(fu,a,rr.WGS84,o,null,null);const v=[];for(let S=0;S181)&&(i=parseFloat(e)),i}async _checkProjection(e){try{await uy(Df,e)}catch{throw new st("csv-layer:projection-not-supported","Projection not supported")}}};function FMi(t,e){const i=e.parsingOptions||{},r={delimiter:i.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:i.latitudeField,longitudeFieldName:i.longitudeField}},n=r.layerDefinition={name:nne(e.url,OMi)||"csv",drawingInfo:PMi,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:i.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:i.spatialReference||{wkid:4326}}},s=Agt(t),o=s.next().value?.trim(),a=s.next().value?.trim();if(!o)throw new st("csv-layer:empty-csv","CSV is empty",{csv:t});const{delimiter:l,locationInfo:c}=_Mi(o,a,i);if(!l)throw new st("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV",{firstLine:o,secondLine:a,parsingOptions:i});if(!c)throw new st("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file",{firstLine:o,secondLine:a,parsingOptions:i});r.locationInfo=c,r.delimiter=l;const{names:d,aliases:p}=Rgt(o,l),y=wMi(t,r.delimiter,d,p,r.locationInfo);if(i.fields?.length){const S=new Am(i.fields);for(const I of y){const O=S.get(I.name);O&&Object.assign(I,O)}}if(!y.some(S=>S.type==="esriFieldTypeOID"&&(n.objectIdField=S.name,!0))){const S={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};n.objectIdField=S.name,y.unshift(S)}n.fields=y;const v=new Am(n.fields);if(r.locationInfo&&(r.locationInfo.latitudeFieldName=v.get(r.locationInfo.latitudeFieldName).name,r.locationInfo.longitudeFieldName=v.get(r.locationInfo.longitudeFieldName).name),n.timeInfo){const S=n.timeInfo;if(S.startTimeField){const I=v.get(S.startTimeField);I?(S.startTimeField=I.name,I.type="esriFieldTypeDate"):S.startTimeField=null}if(S.endTimeField){const I=v.get(S.endTimeField);I?(S.endTimeField=I.name,I.type="esriFieldTypeDate"):S.endTimeField=null}if(S.trackIdField){const I=v.get(S.trackIdField);S.trackIdField=I?I.name:null}S.startTimeField||S.endTimeField||(n.timeInfo=null)}return r}const LMi=Object.freeze(Object.defineProperty({__proto__:null,default:DMi},Symbol.toStringTag,{value:"Module"}));let $Me=class{constructor(e,i,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=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,a):new o(i,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,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getMat(e,i){let r=e*this.typedBufferStride;for(let n=0;n<9;n++)i[n]=this.typedBuffer[r++];return i}setMat(e,i){let r=e*this.typedBufferStride;for(let n=0;n<9;n++)this.typedBuffer[r++]=i[n]}get(e,i){return this.typedBuffer[e*this.typedBufferStride+i]}set(e,i,r){this.typedBuffer[e*this.typedBufferStride+i]=r}copyFrom(e,i,r){const n=this.typedBuffer,s=i.typedBuffer;let o=e*this.typedBufferStride,a=r*i.typedBufferStride;for(let l=0;l<9;++l)n[o++]=s[a++]}get buffer(){return this.typedBuffer.buffer}};$Me.ElementCount=9;let BMe=class{constructor(e,i,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=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,a):new o(i,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,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getMat(e,i){let r=e*this.typedBufferStride;for(let n=0;n<16;n++)i[n]=this.typedBuffer[r++];return i}setMat(e,i){let r=e*this.typedBufferStride;for(let n=0;n<16;n++)this.typedBuffer[r++]=i[n]}get(e,i){return this.typedBuffer[e*this.typedBufferStride+i]}set(e,i,r){this.typedBuffer[e*this.typedBufferStride+i]=r}copyFrom(e,i,r){const n=this.typedBuffer,s=i.typedBuffer;let o=e*this.typedBufferStride,a=r*i.typedBufferStride;for(let l=0;l<16;++l)n[o++]=s[a++]}get buffer(){return this.typedBuffer.buffer}};BMe.ElementCount=16;let zP=class{constructor(e,i,r=0,n,s){this.TypedArrayConstructor=e,this.elementCount=1;const o=this.TypedArrayConstructor;n===void 0&&(n=o.BYTES_PER_ELEMENT);const a=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,a):new o(i,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,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,i){this.typedBuffer[e*this.typedBufferStride]=i}get buffer(){return this.typedBuffer.buffer}};zP.ElementCount=1;let HP=class{constructor(e,i,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=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,a):new o(i,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,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getVec(e,i){return e*=this.typedBufferStride,aa(i,this.typedBuffer[e],this.typedBuffer[e+1])}setVec(e,i){e*=this.typedBufferStride,this.typedBuffer[e++]=i[0],this.typedBuffer[e]=i[1]}get(e,i){return this.typedBuffer[e*this.typedBufferStride+i]}set(e,i,r){this.typedBuffer[e*this.typedBufferStride+i]=r}setValues(e,i,r){e*=this.typedBufferStride,this.typedBuffer[e++]=i,this.typedBuffer[e]=r}copyFrom(e,i,r){const n=this.typedBuffer,s=i.typedBuffer;let o=e*this.typedBufferStride,a=r*i.typedBufferStride;n[o++]=s[a++],n[o]=s[a]}get buffer(){return this.typedBuffer.buffer}};HP.ElementCount=2;let WP=class{constructor(e,i,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=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,a):new o(i,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,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getVec(e,i){return e*=this.typedBufferStride,xl(i,this.typedBuffer[e],this.typedBuffer[e+1],this.typedBuffer[e+2])}setVec(e,i){e*=this.typedBufferStride,this.typedBuffer[e++]=i[0],this.typedBuffer[e++]=i[1],this.typedBuffer[e]=i[2]}get(e,i){return this.typedBuffer[e*this.typedBufferStride+i]}set(e,i,r){this.typedBuffer[e*this.typedBufferStride+i]=r}setValues(e,i,r,n){e*=this.typedBufferStride,this.typedBuffer[e++]=i,this.typedBuffer[e++]=r,this.typedBuffer[e]=n}copyFrom(e,i,r){const n=this.typedBuffer,s=i.typedBuffer;let o=e*this.typedBufferStride,a=r*i.typedBufferStride;n[o++]=s[a++],n[o++]=s[a++],n[o]=s[a]}get buffer(){return this.typedBuffer.buffer}};WP.ElementCount=3;let qP=class{constructor(e,i,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=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,a):new o(i,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,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getVec(e,i){return e*=this.typedBufferStride,Hy(i,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,i){e*=this.typedBufferStride,this.typedBuffer[e++]=i[0],this.typedBuffer[e++]=i[1],this.typedBuffer[e++]=i[2],this.typedBuffer[e]=i[3]}get(e,i){return this.typedBuffer[e*this.typedBufferStride+i]}set(e,i,r){this.typedBuffer[e*this.typedBufferStride+i]=r}setValues(e,i,r,n,s){e*=this.typedBufferStride,this.typedBuffer[e++]=i,this.typedBuffer[e++]=r,this.typedBuffer[e++]=n,this.typedBuffer[e]=s}copyFrom(e,i,r){const n=this.typedBuffer,s=i.typedBuffer;let o=e*this.typedBufferStride,a=r*i.typedBufferStride;n[o++]=s[a++],n[o++]=s[a++],n[o++]=s[a++],n[o]=s[a]}get buffer(){return this.typedBuffer.buffer}};qP.ElementCount=4;let GMe=class HLt extends zP{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}static fromTypedArray(e,i){return new HLt(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};GMe.ElementType="f32";let OD=class N9e extends HP{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}slice(e,i){return this.sliceBuffer(N9e,e,i)}static fromTypedArray(e,i){return new N9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};OD.ElementType="f32";let pc=class $9e extends WP{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}slice(e,i){return this.sliceBuffer($9e,e,i)}static fromTypedArray(e,i){return new $9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};pc.ElementType="f32";let lS=class B9e extends qP{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}slice(e,i){return this.sliceBuffer(B9e,e,i)}static fromTypedArray(e,i){return new B9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};lS.ElementType="f32";let VMe=class G9e extends $Me{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}slice(e,i){return this.sliceBuffer(G9e,e,i)}static fromTypedArray(e,i){return new G9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};VMe.ElementType="f32";let UMe=class V9e extends $Me{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(V9e,e,i)}static fromTypedArray(e,i){return new V9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};UMe.ElementType="f64";let jMe=class U9e extends BMe{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}slice(e,i){return this.sliceBuffer(U9e,e,i)}static fromTypedArray(e,i){return new U9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};jMe.ElementType="f32";let zMe=class j9e extends BMe{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(j9e,e,i)}static fromTypedArray(e,i){return new j9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};zMe.ElementType="f64";let HMe=class z9e extends zP{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(z9e,e,i)}static fromTypedArray(e,i){return new z9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};HMe.ElementType="f64";let WMe=class H9e extends HP{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(H9e,e,i)}static fromTypedArray(e,i){return new H9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};WMe.ElementType="f64";let qf=class W9e extends WP{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(W9e,e,i)}static fromTypedArray(e,i){return new W9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};qf.ElementType="f64";let qMe=class q9e extends qP{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(q9e,e,i)}static fromTypedArray(e,i){return new q9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};qMe.ElementType="f64";let Ade=class Y9e extends zP{constructor(e,i=0,r,n){super(Uint8Array,e,i,r,n),this.elementType="u8"}slice(e,i){return this.sliceBuffer(Y9e,e,i)}static fromTypedArray(e,i){return new Y9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Ade.ElementType="u8";let Pde=class X9e extends HP{constructor(e,i=0,r,n){super(Uint8Array,e,i,r,n),this.elementType="u8"}slice(e,i){return this.sliceBuffer(X9e,e,i)}static fromTypedArray(e,i){return new X9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Pde.ElementType="u8";let $N=class K9e extends WP{constructor(e,i=0,r,n){super(Uint8Array,e,i,r,n),this.elementType="u8"}slice(e,i){return this.sliceBuffer(K9e,e,i)}static fromTypedArray(e,i){return new K9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};$N.ElementType="u8";let uS=class J9e extends qP{constructor(e,i=0,r,n){super(Uint8Array,e,i,r,n),this.elementType="u8"}slice(e,i){return this.sliceBuffer(J9e,e,i)}static fromTypedArray(e,i){return new J9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};uS.ElementType="u8";let Ode=class Z9e extends zP{constructor(e,i=0,r,n){super(Uint16Array,e,i,r,n),this.elementType="u16"}slice(e,i){return this.sliceBuffer(Z9e,e,i)}static fromTypedArray(e,i){return new Z9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Ode.ElementType="u16";let YMe=class Q9e extends HP{constructor(e,i=0,r,n){super(Uint16Array,e,i,r,n),this.elementType="u16"}slice(e,i){return this.sliceBuffer(Q9e,e,i)}static fromTypedArray(e,i){return new Q9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};YMe.ElementType="u16";let _J=class eBe extends WP{constructor(e,i=0,r,n){super(Uint16Array,e,i,r,n),this.elementType="u16"}slice(e,i){return this.sliceBuffer(eBe,e,i)}static fromTypedArray(e,i){return new eBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};_J.ElementType="u16";let XV=class tBe extends qP{constructor(e,i=0,r,n){super(Uint16Array,e,i,r,n),this.elementType="u16"}slice(e,i){return this.sliceBuffer(tBe,e,i)}static fromTypedArray(e,i){return new tBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};XV.ElementType="u16";let Rde=class iBe extends zP{constructor(e,i=0,r,n){super(Uint32Array,e,i,r,n),this.elementType="u32"}slice(e,i){return this.sliceBuffer(iBe,e,i)}static fromTypedArray(e,i){return new iBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Rde.ElementType="u32";let XMe=class rBe extends HP{constructor(e,i=0,r,n){super(Uint32Array,e,i,r,n),this.elementType="u32"}slice(e,i){return this.sliceBuffer(rBe,e,i)}static fromTypedArray(e,i){return new rBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};XMe.ElementType="u32";let Lgt=class nBe extends WP{constructor(e,i=0,r,n){super(Uint32Array,e,i,r,n),this.elementType="u32"}slice(e,i){return this.sliceBuffer(nBe,e,i)}static fromTypedArray(e,i){return new nBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Lgt.ElementType="u32";let kgt=class sBe extends qP{constructor(e,i=0,r,n){super(Uint32Array,e,i,r,n),this.elementType="u32"}slice(e,i){return this.sliceBuffer(sBe,e,i)}static fromTypedArray(e,i){return new sBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};kgt.ElementType="u32";let KMe=class oBe extends zP{constructor(e,i=0,r,n){super(Int8Array,e,i,r,n),this.elementType="i8"}slice(e,i){return this.sliceBuffer(oBe,e,i)}static fromTypedArray(e,i){return new oBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};KMe.ElementType="i8";let Mde=class aBe extends HP{constructor(e,i=0,r,n){super(Int8Array,e,i,r,n),this.elementType="i8"}slice(e,i){return this.sliceBuffer(aBe,e,i)}static fromTypedArray(e,i){return new aBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Mde.ElementType="i8";let Ngt=class lBe extends WP{constructor(e,i=0,r,n){super(Int8Array,e,i,r,n),this.elementType="i8"}slice(e,i){return this.sliceBuffer(lBe,e,i)}static fromTypedArray(e,i){return new lBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Ngt.ElementType="i8";let $gt=class uBe extends qP{constructor(e,i=0,r,n){super(Int8Array,e,i,r,n),this.elementType="i8"}slice(e,i){return this.sliceBuffer(uBe,e,i)}static fromTypedArray(e,i){return new uBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};$gt.ElementType="i8";let Bgt=class cBe extends zP{constructor(e,i=0,r,n){super(Int16Array,e,i,r,n),this.elementType="i16"}slice(e,i){return this.sliceBuffer(cBe,e,i)}static fromTypedArray(e,i){return new cBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Bgt.ElementType="i16";let Dde=class hBe extends HP{constructor(e,i=0,r,n){super(Int16Array,e,i,r,n),this.elementType="i16"}slice(e,i){return this.sliceBuffer(hBe,e,i)}static fromTypedArray(e,i){return new hBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Dde.ElementType="i16";let Ggt=class dBe extends WP{constructor(e,i=0,r,n){super(Int16Array,e,i,r,n),this.elementType="i16"}slice(e,i){return this.sliceBuffer(dBe,e,i)}static fromTypedArray(e,i){return new dBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Ggt.ElementType="i16";let Vgt=class pBe extends qP{constructor(e,i=0,r,n){super(Int16Array,e,i,r,n),this.elementType="i16"}slice(e,i){return this.sliceBuffer(pBe,e,i)}static fromTypedArray(e,i){return new pBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Vgt.ElementType="i16";let Ugt=class fBe extends zP{constructor(e,i=0,r,n){super(Int32Array,e,i,r,n),this.elementType="i32"}slice(e,i){return this.sliceBuffer(fBe,e,i)}static fromTypedArray(e,i){return new fBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Ugt.ElementType="i32";let jgt=class mBe extends HP{constructor(e,i=0,r,n){super(Int32Array,e,i,r,n),this.elementType="i32"}slice(e,i){return this.sliceBuffer(mBe,e,i)}static fromTypedArray(e,i){return new mBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};jgt.ElementType="i32";let zgt=class gBe extends WP{constructor(e,i=0,r,n){super(Int32Array,e,i,r,n),this.elementType="i32"}slice(e,i){return this.sliceBuffer(gBe,e,i)}static fromTypedArray(e,i){return new gBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};zgt.ElementType="i32";let Hgt=class yBe extends qP{constructor(e,i=0,r,n){super(Int32Array,e,i,r,n),this.elementType="i32"}slice(e,i){return this.sliceBuffer(yBe,e,i)}static fromTypedArray(e,i){return new yBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Hgt.ElementType="i32";function Wgt(t){switch(t){case"u8":case"i8":return 1;case"u16":case"i16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}function kMi(t){switch(t){case"u8":case"u16":case"u32":return!1;case"i8":case"i16":case"i32":case"f32":case"f64":return!0}}function NMi(t){switch(t){case"u8":case"u16":case"u32":case"i8":case"i16":case"i32":return!0;case"f32":case"f64":return!1}}function $Mi(t){switch(t){case"u8":return 255;case"u16":return 65535;case"u32":return 4294967295;case"i8":return 127;case"i16":return 32767;case"i32":return 2147483647;case"f32":return 3402823e32;case"f64":return 179769e303}}let qgt=class WLt{constructor(e,i){this.layout=e,this.buffer=typeof i=="number"?new ArrayBuffer(i*e.stride):i;for(const r of e.fieldNames){const n=e.fields.get(r);this[r]=new n.constructor(this.buffer,n.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,i){const r=this[e];return r&&r.elementCount===i.ElementCount&&r.elementType===i.ElementType?r:null}slice(e,i){return new WLt(this.layout,this.buffer.slice(e*this.stride,i*this.stride))}copyFrom(e,i,r,n){const s=this.stride;if(s%4==0){const o=new Uint32Array(e.buffer,i*s,n*s/4);new Uint32Array(this.buffer,r*s,n*s/4).set(o)}else{const o=new Uint8Array(e.buffer,i*s,n*s);new Uint8Array(this.buffer,r*s,n*s).set(o)}}},BMi=class qLt{constructor(){this.stride=0,this.fields=new Map,this.fieldNames=[]}vec2f(e,i){return this._appendField(e,OD,i),this}vec2f64(e,i){return this._appendField(e,WMe,i),this}vec3f(e,i){return this._appendField(e,pc,i),this}vec3f64(e,i){return this._appendField(e,qf,i),this}vec4f(e,i){return this._appendField(e,lS,i),this}vec4f64(e,i){return this._appendField(e,qMe,i),this}mat3f(e,i){return this._appendField(e,VMe,i),this}mat3f64(e,i){return this._appendField(e,UMe,i),this}mat4f(e,i){return this._appendField(e,jMe,i),this}mat4f64(e,i){return this._appendField(e,zMe,i),this}vec4u8(e,i){return this._appendField(e,uS,i),this}f32(e,i){return this._appendField(e,GMe,i),this}f64(e,i){return this._appendField(e,HMe,i),this}u8(e,i){return this._appendField(e,Ade,i),this}u16(e,i){return this._appendField(e,Ode,i),this}i8(e,i){return this._appendField(e,KMe,i),this}vec2i8(e,i){return this._appendField(e,Mde,i),this}vec2i16(e,i){return this._appendField(e,Dde,i),this}vec2u8(e,i){return this._appendField(e,Pde,i),this}vec4u16(e,i){return this._appendField(e,XV,i),this}u32(e,i){return this._appendField(e,Rde,i),this}_appendField(e,i,r){const n=i.ElementCount*Wgt(i.ElementType),s=this.stride;this.fields.set(e,{size:n,constructor:i,offset:s,optional:r}),this.stride+=n,this.fieldNames.push(e)}alignTo(e){return this.stride=Math.floor((this.stride+e-1)/e)*e,this}hasField(e){return this.fieldNames.includes(e)}createBuffer(e){return new qgt(this,e)}createView(e){return new qgt(this,e)}clone(){const e=new qLt;return e.stride=this.stride,e.fields=new Map,this.fields.forEach((i,r)=>e.fields.set(r,i)),e.fieldNames=this.fieldNames.slice(),e.BufferType=this.BufferType,e}};function KV(){return new BMi}function Fde(t,e){return e.push(t.buffer),{buffer:t.buffer,layout:GMi(t.layout)}}function GMi(t){const e=new Array;return t.fields.forEach((i,r)=>{const n={...i,constructor:Ygt(i.constructor)};e.push([r,n])}),{stride:t.stride,fields:e,fieldNames:t.fieldNames}}const VMi=[GMe,OD,pc,lS,VMe,jMe,HMe,WMe,qf,qMe,UMe,zMe,Ade,Pde,$N,uS,Ode,YMe,_J,XV,Rde,XMe,Lgt,kgt,KMe,Mde,Ngt,$gt,Bgt,Dde,Ggt,Vgt,Ugt,jgt,zgt,Hgt];function Ygt(t){return`${t.ElementType}_${t.ElementCount}`}const UMi=new Map;VMi.forEach(t=>UMi.set(Ygt(t),t));var lE,ls,cn,RD,to,Xw,JV,Di,El,Yl,mn,us,Ws,nn,ks,ts,gg,Lo,hb,Yf,Th,gl;(function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT"})(lE||(lE={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(ls||(ls={})),function(t){t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"}(cn||(cn={})),function(t){t[t.ADD=32774]="ADD",t[t.SUBTRACT=32778]="SUBTRACT",t[t.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"}(RD||(RD={})),function(t){t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER"}(to||(to={})),function(t){t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(Xw||(Xw={})),function(t){t[t.CW=2304]="CW",t[t.CCW=2305]="CCW"}(JV||(JV={})),function(t){t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT"}(Di||(Di={})),function(t){t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS"}(El||(El={})),function(t){t[t.ZERO=0]="ZERO",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP"}(Yl||(Yl={})),function(t){t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(mn||(mn={})),function(t){t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(us||(us={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"}(Ws||(Ws={})),function(t){t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.RED=6403]="RED",t[t.RG=33319]="RG",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER"}(nn||(nn={})),function(t){t[t.RGBA4=32854]="RGBA4",t[t.R16F=33325]="R16F",t[t.RG16F=33327]="RG16F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.R32F=33326]="R32F",t[t.RG32F=33328]="RG32F",t[t.RGBA32F=34836]="RGBA32F",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB5_A1=32855]="RGB5_A1",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.RGB16F=34843]="RGB16F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.RGB565=36194]="RGB565",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2=32857]="RGB10_A2",t[t.RGB10_A2UI=36975]="RGB10_A2UI"}(ks||(ks={})),function(t){t[t.FLOAT=5126]="FLOAT",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.INT=5124]="INT",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"}(ts||(ts={})),function(t){t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"}(gg||(gg={})),function(t){t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_READ=35045]="STATIC_READ",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.STREAM_COPY=35042]="STREAM_COPY"}(Lo||(Lo={})),function(t){t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER"}(hb||(hb={})),function(t){t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"}(Yf||(Yf={})),function(t){t[t.TEXTURE=0]="TEXTURE",t[t.RENDER_BUFFER=1]="RENDER_BUFFER",t[t.CUBEMAP=2]="CUBEMAP"}(Th||(Th={})),function(t){t[t.NONE=0]="NONE",t[t.DEPTH_RENDER_BUFFER=1]="DEPTH_RENDER_BUFFER",t[t.STENCIL_RENDER_BUFFER=2]="STENCIL_RENDER_BUFFER",t[t.DEPTH_STENCIL_RENDER_BUFFER=3]="DEPTH_STENCIL_RENDER_BUFFER",t[t.DEPTH_STENCIL_TEXTURE=4]="DEPTH_STENCIL_TEXTURE"}(gl||(gl={}));const JMe=33984;var gf,bv;(function(t){t[t.Texture=0]="Texture",t[t.BufferObject=1]="BufferObject",t[t.VertexArrayObject=2]="VertexArrayObject",t[t.Shader=3]="Shader",t[t.Program=4]="Program",t[t.FramebufferObject=5]="FramebufferObject",t[t.Renderbuffer=6]="Renderbuffer",t[t.Sync=7]="Sync",t[t.COUNT=8]="COUNT"})(gf||(gf={})),function(t){t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15"}(bv||(bv={}));const Xgt=33306;var Qh,b0,Kgt,Jgt,Lde,ZMe,Zgt;(function(t){t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"})(Qh||(Qh={})),function(t){t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT=5124]="INT",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"}(b0||(b0={})),function(t){t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS"}(Kgt||(Kgt={})),function(t){t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED"}(Jgt||(Jgt={})),function(t){t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED"}(Lde||(Lde={})),function(t){t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"}(ZMe||(ZMe={})),function(t){t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"}(Zgt||(Zgt={}));let qo=class{constructor(e,i,r,n,s,o=!1,a=0){this.name=e,this.count=i,this.type=r,this.offset=n,this.stride=s,this.normalized=o,this.divisor=a}};function QMe(t,e=0){const i=t.stride;return t.fieldNames.filter(r=>{const n=t.fields.get(r).optional;return!(n&&n.glPadding)}).map(r=>{const n=t.fields.get(r),s=n.constructor.ElementCount,o=jMi(n.constructor.ElementType),a=n.offset,l=!(!n.optional||!n.optional.glNormalized);return new qo(r,s,o,a,i,l,e)})}function jMi(t){const e=zMi[t];if(e)return e;throw new Error("BufferType not supported in WebGL")}const zMi={u8:Di.UNSIGNED_BYTE,u16:Di.UNSIGNED_SHORT,u32:Di.UNSIGNED_INT,i8:Di.BYTE,i16:Di.SHORT,i32:Di.INT,f32:Di.FLOAT};var Dr;(function(t){t.POSITION="position",t.NORMAL="normal",t.UV0="uv0",t.AUXPOS1="auxpos1",t.AUXPOS2="auxpos2",t.COLOR="color",t.SYMBOLCOLOR="symbolColor",t.SIZE="size",t.TANGENT="tangent",t.OFFSET="offset",t.SUBDIVISIONFACTOR="subdivisionFactor",t.COLORFEATUREATTRIBUTE="colorFeatureAttribute",t.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",t.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",t.DISTANCETOSTART="distanceToStart",t.UVMAPSPACE="uvMapSpace",t.BOUNDINGRECT="boundingRect",t.UVREGION="uvRegion",t.NORMALCOMPRESSED="normalCompressed",t.PROFILERIGHT="profileRight",t.PROFILEUP="profileUp",t.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",t.FEATUREVALUE="featureValue",t.MODELORIGINHI="modelOriginHi",t.MODELORIGINLO="modelOriginLo",t.MODEL="model",t.MODELNORMAL="modelNormal",t.INSTANCECOLOR="instanceColor",t.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",t.LOCALTRANSFORM="localTransform",t.GLOBALTRANSFORM="globalTransform",t.BOUNDINGSPHERE="boundingSphere",t.MODELORIGIN="modelOrigin",t.MODELSCALEFACTORS="modelScaleFactors",t.FEATUREATTRIBUTE="featureAttribute",t.STATE="state",t.LODLEVEL="lodLevel",t.POSITION0="position0",t.POSITION1="position1",t.NORMALA="normalA",t.NORMALB="normalB",t.COMPONENTINDEX="componentIndex",t.VARIANTOFFSET="variantOffset",t.VARIANTSTROKE="variantStroke",t.VARIANTEXTENSION="variantExtension",t.U8PADDING="u8padding",t.U16PADDING="u16padding",t.SIDENESS="sideness",t.START="start",t.END="end",t.UP="up",t.EXTRUDE="extrude",t.OBJECTANDLAYERIDCOLOR="objectAndLayerIdColor",t.OBJECTANDLAYERIDCOLOR_INSTANCED="objectAndLayerIdColor_instanced"})(Dr||(Dr={}));const Qgt=KV().vec3f(Dr.POSITION).u16(Dr.COMPONENTINDEX).u16(Dr.U16PADDING),HMi=KV().vec2u8(Dr.SIDENESS);QMe(HMi);const eyt=KV().vec3f(Dr.POSITION0).vec3f(Dr.POSITION1).u16(Dr.COMPONENTINDEX).u8(Dr.VARIANTOFFSET,{glNormalized:!0}).u8(Dr.VARIANTSTROKE).u8(Dr.VARIANTEXTENSION,{glNormalized:!0}).u8(Dr.U8PADDING,{glPadding:!0}).u16(Dr.U16PADDING,{glPadding:!0}),eDe=eyt.clone().vec3f(Dr.NORMAL),tDe=eyt.clone().vec3f(Dr.NORMALA).vec3f(Dr.NORMALB);Dr.POSITION0,Dr.POSITION1,Dr.COMPONENTINDEX,Dr.VARIANTOFFSET,Dr.VARIANTSTROKE,Dr.VARIANTEXTENSION,Dr.NORMAL,Dr.NORMALA,Dr.NORMALB,Dr.SIDENESS;const BN=-1;var tyt;function iDe(t,e,i,r=JMi){const n=t.vertices.position,s=t.vertices.componentIndex,o=Jb(r.anglePlanar),a=Jb(r.angleSignificantEdge),l=Math.cos(a),c=Math.cos(o),d=rDe.edge,p=d.position0,y=d.position1,v=d.faceNormal0,S=d.faceNormal1,I=KMi(t),O=XMi(t),L=O.length/4,N=e.allocate(L);let G=0;const V=L,Y=i.allocate(V);let X=0,te=0,re=0;const fe=vkt(0,L),ge=new Float32Array(L);ge.forEach((J,he,xe)=>{n.getVec(O[4*he+0],p),n.getVec(O[4*he+1],y),xe[he]=rR(p,y)}),fe.sort((J,he)=>ge[he]-ge[J]);const _e=new Array,Ie=new Array;for(let J=0;Je}function YMi(t,e){const i=Y1e(t.cosAngle),r=rDe.fwd,n=rDe.ortho;return qUe(r,t.position1,t.position0),i*(Kb(t2(n,t.faceNormal0,t.faceNormal1),r)>0?-1:1)>e}function XMi(t){const e=t.faces.length/3,i=t.faces,r=t.neighbors;let n=0;for(let a=0;a=65536)return new Uint32Array(t);return new Uint16Array(t)}if(t.length=65536)return t;return new Uint16Array(t)}function iyt(t){const e=3*t;return e<=oL?new Array(e):e<=65536?new Uint16Array(e):new Uint32Array(e)}let MD=(()=>{const t=new Uint32Array(131072);for(let e=0;e{const t=new Uint16Array(65536);for(let e=0;eMD.length){const e=Math.max(2*MD.length,t);MD=new Uint32Array(e);for(let i=0;iMD.length){const e=new Uint32Array(t);for(let i=0;id&&(d=te)}else d=n;const p=Math.floor(1.1*d)+1;(uE==null||uE.length<2*p)&&(uE=new Uint32Array(q1e(2*p)));for(let X=0;X<2*p;X++)uE[X]=0;let y=0;const v=!!c&&!!a,S=v?l:n;let I=iyt(n/3);const O=new Uint32Array(l),L=1.96;let N=o!==0?Math.ceil(4*L*L/(o*o)*o*(1-o)):S,G=1,V=c?c[1]:S;for(let X=0;X=p&&(ge-=p)}_e===y&&(uE[2*ge]=fe,uE[2*ge+1]=te+1,y++),I[te]=_e}if(o!==0&&1-y/n>>2)|0;return r>>>0}let uE=null;function nyt(t,e,i){const r=e/3,n=new Uint32Array(i+1),s=new Uint32Array(i+1),o=(L,N)=>{L{if(L{const G=2*L,V=N-L;for(let Y=1;Y=0&&c[G+2*re]>X;re--)c[G+2*re+2]=c[G+2*re],c[G+2*re+3]=c[G+2*re+1];c[G+2*re+2]=X,c[G+2*re+3]=te}};for(let L=0;LL===t[3*N]?0:L===t[3*N+1]?1:L===t[3*N+2]?2:-1,I=(L,N)=>{const G=S(L,N);v[3*N+G]=-1},O=(L,N,G,V)=>{const Y=S(L,N);v[3*N+Y]=V;const X=S(G,V);v[3*V+X]=N};for(let L=0;Lnull,write:()=>{},trim:()=>null},fDi=Object.freeze(Object.defineProperty({__proto__:null,default:lDi},Symbol.toStringTag,{value:"Module"}));function Xf(){return[1,0,0,0,1,0,0,0,1]}function mDi(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]}function hyt(t,e,i,r,n,s,o,a,l){return[t,e,i,r,n,s,o,a,l]}function dyt(t,e){return new Float64Array(t,e,9)}Object.freeze(Object.defineProperty({__proto__:null,clone:mDi,create:Xf,createView:dyt,fromValues:hyt},Symbol.toStringTag,{value:"Module"}));function wv(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function bJ(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}function gDi(t,e,i,r,n,s,o,a,l,c,d,p,y,v,S,I){return[t,e,i,r,n,s,o,a,l,c,d,p,y,v,S,I]}function pyt(t,e){return new Float64Array(t,e,16)}const eU=wv();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:eU,clone:bJ,create:wv,createView:pyt,fromValues:gDi},Symbol.toStringTag,{value:"Module"}));const yDi=new rr(YVe),fyt=new rr(p1e),myt=new rr(f1e);new rr(XVe);function FD(t){return t&&(fL(t)||Ca(t,fyt))?fyt:t&&(mL(t)||Ca(t,myt))?myt:yDi}function xv(){return[0,0,0,1]}function gyt(t){return[t[0],t[1],t[2],t[3]]}function vDi(t,e,i,r){return[t,e,i,r]}function yyt(t,e){return new Float64Array(t,e,4)}const vyt=xv();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:vyt,clone:gyt,create:xv,createView:yyt,fromValues:vDi},Symbol.toStringTag,{value:"Module"}));function _Di(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function LD(t,e,i){i*=.5;const r=Math.sin(i);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(i),t}function pDe(t,e){const i=2*Math.acos(e[3]),r=Math.sin(i/2);return r>jv()?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),i}function Bde(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3],a=i[0],l=i[1],c=i[2],d=i[3];return t[0]=r*d+o*a+n*c-s*l,t[1]=n*d+o*l+s*a-r*c,t[2]=s*d+o*c+r*l-n*a,t[3]=o*d-r*a-n*l-s*c,t}function bDi(t,e,i){i*=.5;const r=e[0],n=e[1],s=e[2],o=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=r*l+o*a,t[1]=n*l+s*a,t[2]=s*l-n*a,t[3]=o*l-r*a,t}function wDi(t,e,i){i*=.5;const r=e[0],n=e[1],s=e[2],o=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=r*l-s*a,t[1]=n*l+o*a,t[2]=s*l+r*a,t[3]=o*l-n*a,t}function xDi(t,e,i){i*=.5;const r=e[0],n=e[1],s=e[2],o=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=r*l+n*a,t[1]=n*l-r*a,t[2]=s*l+o*a,t[3]=o*l-s*a,t}function SDi(t,e){const i=e[0],r=e[1],n=e[2];return t[0]=i,t[1]=r,t[2]=n,t[3]=Math.sqrt(Math.abs(1-i*i-r*r-n*n)),t}function Gde(t,e,i,r){const n=e[0],s=e[1],o=e[2],a=e[3];let l,c,d,p,y,v=i[0],S=i[1],I=i[2],O=i[3];return c=n*v+s*S+o*I+a*O,c<0&&(c=-c,v=-v,S=-S,I=-I,O=-O),1-c>jv()?(l=Math.acos(c),d=Math.sin(l),p=Math.sin((1-r)*l)/d,y=Math.sin(r*l)/d):(p=1-r,y=r),t[0]=p*n+y*v,t[1]=p*s+y*S,t[2]=p*o+y*I,t[3]=p*a+y*O,t}function CDi(t){const e=ZH,i=e(),r=e(),n=e(),s=Math.sqrt(1-i),o=Math.sqrt(i);return t[0]=s*Math.sin(2*Math.PI*r),t[1]=s*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*n),t[3]=o*Math.cos(2*Math.PI*n),t}function TDi(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=i*i+r*r+n*n+s*s,a=o?1/o:0;return t[0]=-i*a,t[1]=-r*a,t[2]=-n*a,t[3]=s*a,t}function fDe(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function _yt(t,e){const i=e[0]+e[4]+e[8];let r;if(i>0)r=Math.sqrt(i+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[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),t[n]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+n]+e[3*n+s])*r,t[o]=(e[3*o+n]+e[3*n+o])*r}return t}function byt(t,e,i,r){const n=.5*Math.PI/180;e*=n,i*=n,r*=n;const s=Math.sin(e),o=Math.cos(e),a=Math.sin(i),l=Math.cos(i),c=Math.sin(r),d=Math.cos(r);return t[0]=s*l*d-o*a*c,t[1]=o*a*d+s*l*c,t[2]=o*l*c-s*a*d,t[3]=o*l*d+s*a*c,t}function EDi(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}const IDi=j1e,ADi=Hy,PDi=KUe,ODi=Bde,RDi=eje,MDi=nje,DDi=W1e,wyt=z1e,FDi=wyt,xyt=H1e,LDi=xyt,mDe=rje,Syt=sje,kDi=oje;function NDi(t,e,i){const r=Kb(e,i);return r<-.999999?(t2(cE,$Di,e),XUe(cE)<1e-6&&t2(cE,BDi,e),zy(cE,cE),LD(t,cE,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(t2(cE,e,i),t[0]=cE[0],t[1]=cE[1],t[2]=cE[2],t[3]=1+r,mDe(t,t))}const cE=Qr(),$Di=Ma(1,0,0),BDi=Ma(0,1,0);function GDi(t,e,i,r,n,s){return Gde(Cyt,e,n,s),Gde(Tyt,i,r,s),Gde(t,Cyt,Tyt,2*s*(1-s)),t}const Cyt=xv(),Tyt=xv();function VDi(t,e,i,r){const n=UDi;return n[0]=i[0],n[3]=i[1],n[6]=i[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],mDe(t,_yt(t,n))}const UDi=Xf();Object.freeze(Object.defineProperty({__proto__:null,add:PDi,calculateW:SDi,conjugate:fDe,copy:IDi,dot:MDi,equals:kDi,exactEquals:Syt,fromEuler:byt,fromMat3:_yt,getAxisAngle:pDe,identity:_Di,invert:TDi,len:FDi,length:wyt,lerp:DDi,mul:ODi,multiply:Bde,normalize:mDe,random:CDi,rotateX:bDi,rotateY:wDi,rotateZ:xDi,rotationTo:NDi,scale:RDi,set:ADi,setAxes:VDi,setAxisAngle:LD,slerp:Gde,sqlerp:GDi,sqrLen:LDi,squaredLength:xyt,str:EDi},Symbol.toStringTag,{value:"Module"}));function hE(t=zDi){return[t[0],t[1],t[2],t[3]]}function Vde(t,e,i=hE()){return Hv(i,t),i[3]=e,i}function gDe(t,e,i=hE()){return LD(jde,t,Ude(t)),LD(Eyt,e,Ude(e)),Bde(jde,Eyt,jde),jDi(i,xne(pDe(i,jde)))}function PFr(t){return t}function Ude(t){return Jb(t[3])}function jDi(t,e){return t[3]=e,t}const zDi=[0,0,1,0],jde=xv(),Eyt=xv();hE();const zde=Ei.getLogger("esri.views.3d.support.buffer.math");function kD(t,e,i){if(t.count!==e.count)return void zde.error("source and destination buffers need to have the same number of elements");const r=t.count,n=i[0],s=i[1],o=i[2],a=i[4],l=i[5],c=i[6],d=i[8],p=i[9],y=i[10],v=i[12],S=i[13],I=i[14],O=t.typedBuffer,L=t.typedBufferStride,N=e.typedBuffer,G=e.typedBufferStride;for(let V=0;V0){const S=1/Math.sqrt(v);r[l]=S*d,r[l+1]=S*p,r[l+2]=S*y}}}function Iyt(t,e,i){const r=Math.min(t.count,e.count),n=t.typedBuffer,s=t.typedBufferStride,o=e.typedBuffer,a=e.typedBufferStride;for(let l=0;l>i,n[c+1]=o[d+1]>>i,n[c+2]=o[d+2]>>i}}Object.freeze(Object.defineProperty({__proto__:null,normalize:Wde,scale:Hde,shiftRight:Iyt,transformMat3:YP,transformMat4:kD},Symbol.toStringTag,{value:"Module"}));function qde(t,e,i){const r=t.typedBuffer,n=t.typedBufferStride,s=e.typedBuffer,o=e.typedBufferStride,a=i?i.count:e.count;let l=(i&&i.dstIndex?i.dstIndex:0)*n,c=(i&&i.srcIndex?i.srcIndex:0)*o;for(let d=0;dnew Uint32Array(n))):this._createIndexAllThread(r,i)}_createIndexAllThread(e,i){const r=new Array(i.length/9);let n=0;for(let s=0;s!r.faces)?{position:i}:{position:i,components:e.components.map(r=>r.faces)}}_createPooledRBush(){return new xMe(9,Gi("esri-csp-restrictions")?e=>e:[".minX",".minY",".maxX",".maxY"])}};function kyt(t,e,i,r){return{minX:Math.min(t[e+0],t[i+0],t[r+0]),maxX:Math.max(t[e+0],t[i+0],t[r+0]),minY:Math.min(t[e+1],t[i+1],t[r+1]),maxY:Math.max(t[e+1],t[i+1],t[r+1]),p0:[t[e+0],t[e+1],t[e+2]],p1:[t[i+0],t[i+1],t[i+2]],p2:[t[r+0],t[r+1],t[r+2]]}}const lFi=Object.freeze(Object.defineProperty({__proto__:null,default:aFi},Symbol.toStringTag,{value:"Module"}));function Nyt(t=!1,e){if(t){const{elevationInfo:i,alignPointsInFeatures:r,spatialReference:n}=e;return new hFi(i,r,n)}return new uFi}let uFi=class{async alignCandidates(e,i){return e}notifyElevationSourceChange(){}};const cFi=1024;let hFi=class{constructor(e,i,r){this._elevationInfo=e,this._alignPointsInFeatures=i,this.spatialReference=r,this._alignmentsCache=new E9(cFi),this._cacheVersion=0,this._metersPerVerticalUnit=J3(r)}async alignCandidates(e,i){const r=this._elevationInfo;return ye(r)&&r.mode==="absolute-height"&&!r.featureExpressionInfo?(this._alignAbsoluteElevationCandidates(e,r),e):this._alignComputedElevationCandidates(e,i)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}_alignAbsoluteElevationCandidates(e,i){const{offset:r,unit:n}=i;if(lt(r))return;const s=r*(O7t(n??"meters")/this._metersPerVerticalUnit);for(const o of e)switch(o.type){case"edge":o.start.z+=s,o.end.z+=s;continue;case"vertex":o.target.z+=s;continue}}async _alignComputedElevationCandidates(e,i){const r=new Map;for(const p of e)xC(r,p.objectId,pFi).push(p);const[n,s,o]=this._prepareQuery(r),a=await this._alignPointsInFeatures(n,i);if(sn(i),o!==this._cacheVersion)return this._alignComputedElevationCandidates(e,i);this._applyCacheAndResponse(n,a,s);const{drapedObjectIds:l,failedObjectIds:c}=a,d=[];for(const p of e){const{objectId:y}=p;l.has(y)&&p.type==="edge"&&(p.draped=!0),c.has(y)||d.push(p)}return d}_prepareQuery(e){const i=[],r=[];for(const[n,s]of e){const o=[];for(const a of s)this._addToQueriesOrCachedResult(n,a.target,o,r),a.type==="edge"&&(this._addToQueriesOrCachedResult(n,a.start,o,r),this._addToQueriesOrCachedResult(n,a.end,o,r));o.length!==0&&i.push({objectId:n,points:o})}return[i,r,this._cacheVersion]}_addToQueriesOrCachedResult(e,i,r,n){const s=$yt(e,i),o=this._alignmentsCache.get(s);ye(o)?n.push(new dFi(i,o)):r.push(i)}_applyCacheAndResponse(e,{elevations:i,drapedObjectIds:r,failedObjectIds:n},s){for(const l of s)l.apply();let o=0;const a=this._alignmentsCache;for(const{objectId:l,points:c}of e){if(n.has(l)){o+=c.length;continue}const d=!r.has(l);for(const p of c){const y=$yt(l,p),v=i[o++];p.z=v,d&&a.put(y,v,1)}}}},dFi=class{constructor(e,i){this.point=e,this.z=i}apply(){this.point.z=this.z}};function $yt(t,{x:e,y:i,z:r}){return`${t}-${e}-${i}-${r??0}}`}function pFi(){return[]}let fFi=class{filter(e,i){return i}notifyElevationSourceChange(){}},mFi=class{filter(e,i){const{point:r,distance:n}=e,{z:s}=r;if(s==null||i.length===0)return i;const o=bFi(n),a=this._updateCandidatesTo3D(i,r,o).filter(gFi);return a.sort(wFi),a}_updateCandidatesTo3D(e,i,r){for(const n of e)switch(n.type){case"edge":yFi(n,i,r);continue;case"vertex":_Fi(n,i,r);continue}return e}};function gFi(t){return t.distance<=1}function Byt(t=!1){return t?new mFi:new fFi}function yFi(t,e,{x:i,y:r,z:n}){const{start:s,end:o,target:a}=t;t.draped||vFi(a,e,s,o);const l=(e.x-a.x)/i,c=(e.y-a.y)/r,d=(e.z-a.z)/n;t.distance=Math.sqrt(l*l+c*c+d*d)}function vFi(t,e,i,r){const n=r.x-i.x,s=r.y-i.y,o=r.z-i.z,a=n*n+s*s+o*o,l=(e.x-i.x)*n+(e.y-i.y)*s+o*(e.z-i.z),c=Math.min(1,Math.max(0,l/a)),d=i.x+n*c,p=i.y+s*c,y=i.z+o*c;t.x=d,t.y=p,t.z=y}function _Fi(t,e,{x:i,y:r,z:n}){const{target:s}=t,o=(e.x-s.x)/i,a=(e.y-s.y)/r,l=(e.z-s.z)/n,c=Math.sqrt(o*o+a*a+l*l);t.distance=c}function bFi(t){return typeof t=="number"?{x:t,y:t,z:t}:t}function wFi(t,e){return t.distance-e.distance}function Gyt(t=!1,e){return t?new CFi(e):new xFi}let xFi=class{async fetch(){return[]}notifySymbologyChange(){}};const SFi=1024;let CFi=class{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new E9(SFi),this._cacheVersion=0}async fetch(e,i){if(e.length===0)return[];const r=[],n=[],s=this._candidatesCache;for(const p of e){const y=Vyt(p),v=s.get(y);if(v)for(const S of v)n.push(hi(S));else r.push(p),s.put(y,[],1)}if(r.length===0)return n;const o=this._cacheVersion,{candidates:a,sourceCandidateIndices:l}=await this._getSymbologyCandidates(r,i);if(sn(i),o!==this._cacheVersion)return this.fetch(e,i);const c=[],{length:d}=a;for(let p=0;pe.callback(i)).catch(()=>{}).then(()=>{this._pending.shift(),this._process()})}};E([k()],spe.prototype,"updating",void 0),spe=E([ht("esri.core.AsyncSequence")],spe);let TFi=class{constructor(e,i){this.data=e,this.resolution=i,this.state={type:uu.CREATED},this.alive=!0}process(e){switch(this.state.type){case uu.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case uu.FETCH_COUNT:break;case uu.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case uu.FETCH_FEATURES:break;case uu.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case uu.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case uu.CREATED:case uu.FETCH_COUNT:return 0;case uu.FETCHED_COUNT:return this.state.featureCount;case uu.FETCH_FEATURES:return this.state.previous.featureCount;case uu.FETCHED_FEATURES:return this.state.features.length;case uu.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case uu.CREATED:return"created";case uu.FETCH_COUNT:return"fetch-count";case uu.FETCHED_COUNT:return"fetched-count";case uu.FETCH_FEATURES:return"fetch-features";case uu.FETCHED_FEATURES:return"fetched-features";case uu.DONE:return"done"}}_gotoFetchCount(e,i){return{type:uu.FETCH_COUNT,previous:e,task:EC(async r=>{const n=await AVe(i.fetchCount(this,r));this.state.type===uu.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,n.ok?n.value:1/0))})}}_gotoFetchedCount(e,i){return{type:uu.FETCHED_COUNT,featureCount:i,previous:e}}_gotoFetchFeatures(e,i){return{type:uu.FETCH_FEATURES,previous:e,task:EC(async r=>{const n=await AVe(i.fetchFeatures(this,e.featureCount,r));this.state.type===uu.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,n.ok?n.value:[]))})}}_gotoFetchedFeatures(e,i){return{type:uu.FETCHED_FEATURES,previous:e,features:i}}_goToDone(e,i){return i.finish(this,e.features),{type:uu.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:uu.CREATED},e.type){case uu.CREATED:case uu.FETCHED_COUNT:case uu.FETCHED_FEATURES:case uu.DONE:break;case uu.FETCH_COUNT:case uu.FETCH_FEATURES:e.task.abort()}}intersects(e){return!(!lt(e)&&this.data.extent)||(fR(e,Uyt),nse(this.data.extent,Uyt))}};var uu;(function(t){t[t.CREATED=0]="CREATED",t[t.FETCH_COUNT=1]="FETCH_COUNT",t[t.FETCHED_COUNT=2]="FETCHED_COUNT",t[t.FETCH_FEATURES=3]="FETCH_FEATURES",t[t.FETCHED_FEATURES=4]="FETCHED_FEATURES",t[t.DONE=5]="DONE"})(uu||(uu={}));const Uyt=_o();let yf=class extends KC{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}set filter(e){const i=this._get("filter"),r=this._filterProperties(e);JSON.stringify(i)!==JSON.stringify(r)&&this._set("filter",r)}set customParameters(e){const i=this._get("customParameters");JSON.stringify(i)!==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 i=this._get("tileInfo");i!==e&&(ye(e)&&ye(i)&&JSON.stringify(e)===JSON.stringify(i)||(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.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._pendingEdits=new spe,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this.updatingHandles.add(()=>this._configuration,()=>this.refresh()),this.updatingHandles.add(()=>this.tilesOfInterest,(e,i)=>{_H(e,i,({id:r},{id:n})=>r===n)||this._process()},Nu)}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}applyEdits(e){this._pendingEdits.push(e,async i=>{if(i.addedFeatures.length===0&&i.updatedFeatures.length===0&&i.deletedFeatures.length===0)return;for(const[,n]of this._pendingTiles)n.reset();const r={...i,deletedFeatures:i.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||!N9(this.url))return;const e=EC(async i=>{try{const r=await AJe(this.url,new Ss({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:!!this.capabilities.query.supportsCacheHint||void 0}),{query:this._configuration.customParameters,signal:i});this.store.extent=vr.fromJSON(r.data?.extent)}catch(r){Ga(r),Ei.getLogger(this.declaredClass).warn("Failed to fetch data extent",r)}});this.updatingHandles.addPromise(e.promise.then(()=>this._process())),this.handles.add(KI(()=>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(){const e=this._collectMissingTilesInfo();if(this._setAvailability(lt(e)?1:e.coveredArea/e.fullArea),!lt(e))for(const{data:i,resolution:r}of e.missingTiles){const n=this._pendingTiles.get(i.id);n?(n.resolution=r,n.alive=!0):this._createPendingTile(i,r)}}_collectMissingTilesInfo(){let e=null;for(let i=this.tilesOfInterest.length-1;i>=0;i--){const r=this.tilesOfInterest[i],n=this.store.process(r,(s,o)=>this._verifyTileComplexity(s,o));lt(e)?e=n:e.prepend(n)}return e}_deletePendingTiles(){for(const[,e]of this._pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(i,r)=>this._fetchCount(i,r),fetchFeatures:(i,r,n)=>this._fetchFeatures(i,r,n),finish:(i,r)=>this._finishPendingTile(i,r),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,i]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(i.data),i.resolution)&&this.updatingHandles.addPromise(i.process(e))}_verifyTileComplexity(e,i){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,i)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature{e===s.attributes[i]&&(n=s.objectId??s.attributes[r])}),lt(n))throw new Error(`Expected to find a feature with globalId ${e}`);return n}_queryFeaturesById(e,i){const r=this._createFeaturesQuery();return r.objectIds=e,this._queryFeatures(r,i)}_queryFeatures(e,i){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,i):this._queryFeaturesJSON(e,i)}async _queryFeaturesPBF(e,i){const{sourceSpatialReference:r}=this,{data:n}=await pTe(this.url,e,new yJe({sourceSpatialReference:r}),{query:this._configuration.customParameters,timeout:xDe,signal:i});return JJt(n)}async _queryFeaturesJSON(e,i){const{sourceSpatialReference:r}=this,{data:n}=await AB(this.url,e,r,{query:this._configuration.customParameters,timeout:xDe,signal:i});return ETe(n,this.objectIdField)}_createCountQuery(e){const i=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(i.cacheHint=!0),i}_createFeaturesQuery(e=null){const i=this._createBaseQuery(e);return i.outFields=this.globalIdField?[this.globalIdField,this.objectIdField]:[this.objectIdField],i.returnGeometry=!0,ye(e)&&(this.capabilities.query.supportsResultType?i.resultType="tile":this.capabilities.query.supportsCacheHint&&(i.cacheHint=!0)),i}_createBaseQuery(e){const i=new Ss({returnZ:this.hasZ,returnM:!1,geometry:ye(this.tileInfo)&&ye(e)?kL(e.data.extent,this.tileInfo.spatialReference):void 0}),r=this._configuration.filter;return ye(r)&&(i.where=r.where,i.gdbVersion=r.gdbVersion,i.timeExtent=r.timeExtent),i.outSpatialReference=this.spatialReference,i}_setPagingParameters(e,i,r){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:n,supportsCacheHint:s,tileMaxRecordCount:o,maxRecordCount:a,supportsResultType:l}=this.capabilities.query,c=n?Ss.MAX_MAX_RECORD_COUNT_FACTOR:1,d=c*((l||s)&&o?o:a||EFi);return e.start=i,n?(e.maxRecordCountFactor=Math.min(c,Math.ceil(r/d)),e.num=Math.min(r,e.maxRecordCountFactor*d)):e.num=Math.min(r,d),!0}};E([k({constructOnly:!0})],yf.prototype,"url",void 0),E([k({constructOnly:!0})],yf.prototype,"objectIdField",void 0),E([k({constructOnly:!0})],yf.prototype,"globalIdField",void 0),E([k({constructOnly:!0})],yf.prototype,"capabilities",void 0),E([k({constructOnly:!0})],yf.prototype,"sourceSpatialReference",void 0),E([k({constructOnly:!0})],yf.prototype,"spatialReference",void 0),E([k({constructOnly:!0})],yf.prototype,"store",void 0),E([k({readOnly:!0})],yf.prototype,"_minimumVerticesPerFeature",null),E([k()],yf.prototype,"filter",null),E([k()],yf.prototype,"customParameters",null),E([k({readOnly:!0})],yf.prototype,"_configuration",null),E([k()],yf.prototype,"tileInfo",null),E([k()],yf.prototype,"tileSize",null),E([k()],yf.prototype,"tilesOfInterest",void 0),E([k({readOnly:!0})],yf.prototype,"updating",null),E([k({readOnly:!0})],yf.prototype,"updatingExcludingEdits",null),E([k({readOnly:!0})],yf.prototype,"availability",void 0),E([k()],yf.prototype,"hasZ",null),yf=E([ht("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],yf);const EFi=2e3,xDe=6e5,IFi=1e6,AFi=25,PFi=1;let OFi=class{constructor(){this._store=new Map,this._byteSize=0}set(e,i){this.delete(e),this._store.set(e,i),this._byteSize+=i.byteSize}delete(e){const i=this._store.get(e);return!!this._store.delete(e)&&(i!=null&&(this._byteSize-=i.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,i){for(const[r,n]of this._store){if(this._byteSize<=e)break;this.delete(r),i(n)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const i=this._store.get(e);i&&(this._store.delete(e),this._store.set(e,i))}},VN=class extends fn{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*K5.MEGABYTES,this._tileBounds=new EMe,this._tiles=new OFi,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=_o()}add(e,i){const r=[];for(const n of i)this._referenceFeature(n.objectId)===ND.ADDED&&r.push(n);this._addTileStorage(e,new Set(i.map(n=>n.objectId)),RFi(i)),this.featureStore.addMany(r),this._tiles.applyByteSizeLimit(this.maximumByteSize,n=>this._removeTileStorage(n))}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,i,r){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),i,r)}_addTileStorage(e,i,r){const n=e.id;this._tiles.set(n,new FFi(e,i,r)),this._tileBounds.set(n,e.extent),this._tileFeatureCounts.set(n,i.size)}_remove({id:e}){const i=this._tiles.get(e);i&&this._removeTileStorage(i)}_removeTileStorage(e){const i=[];for(const n of e.objectIds)this._unreferenceFeature(n)===ND.REMOVED&&i.push(n);this.featureStore.removeManyById(i);const r=e.data.id;this._tiles.delete(r),this._tileBounds.delete(r)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const[,i]of this._tiles){for(const r of e)i.objectIds.delete(r);this._tileFeatureCounts.set(i.data.id,i.objectIds.size)}for(const i of e)this._refCounts.delete(i)}async _processEditsRefetch(e,i,r){const n=(await i(e,r)).features,{hasZ:s,hasM:o}=this.featureStore;for(const a of n){const l=Nae(this._tmpBoundingRect,a.geometry,s,o);lt(l)||this._tileBounds.forEachInBounds(l,c=>{const d=this._tiles.get(c);this.featureStore.add(a);const p=a.objectId;d.objectIds.has(p)||(d.objectIds.add(p),this._referenceFeature(p),this._tileFeatureCounts.set(d.data.id,d.objectIds.size))})}}process(e,i=()=>!0){if(lt(this.tileInfo)||!e.extent||ye(this.extent)&&!nse(fR(this.extent,this._tmpBoundingRect),e.extent))return new SDe(e);if(this._tiles.has(e.id))return new SDe(e);const r=this._createTileTree(e,this.tileInfo);return this._simplify(r,i,null,0,1),this._collectMissingTiles(e,r,this.tileInfo)}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,i,r,n){const s=this._tileFeatureCounts.get(e.id);if(s!=null)return s;const o=await IJe(i,r,n);return this._tileFeatureCounts.set(e.id,o.data.count),o.data.count}_createTileTree(e,i){const r=new jyt(e.level,e.row,e.col);return i.updateTileInfo(r,Ml.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,i,this._tileFeatureCounts.get(s.id)||0)}),r}_tilesAreRelated(e,i){if(!e||!i)return!1;if(e.level===i.level)return e.row===i.row&&e.col===i.col;const r=e.level>s,a=i.col>>s,l=e.row<<1,c=a-(e.col<<1)+(o-l<<1),d=e.children[c];if(ye(d))this._populateChildren(d,i,r,n);else{const p=new jyt(e.level+1,o,a);r.updateTileInfo(p,Ml.ExtrapolateOptions.POWER_OF_TWO),e.children[c]=p,this._populateChildren(p,i,r,n)}}_simplify(e,i,r,n,s){const o=s*s;if(e.isLeaf)return i(this.getFeatureCount(e),s)?0:(this._remove(e),ye(r)&&(r.children[n]=null),o);const a=s/2,l=a*a;let c=0;for(let d=0;d{const s=this._tiles.get(n.id);if(s){r+=s.byteSize;for(const o of s.objectIds)i.has(o)||(i.add(o),this._referenceFeature(o));this._remove(n)}}),this._addTileStorage(e,i,r),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,i.size)}_forEachLeaf(e,i){for(const r of e.children)lt(r)||(r.isLeaf?i(r):this._forEachLeaf(r,i))}_purge(e){if(!lt(e))if(e.isLeaf)this._remove(e);else for(let i=0;i>1),(e.col<<1)+(1&s),n):this._collectMissingTilesRecurse(o,i,n)}}_referenceFeature(e){const i=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,i),i===1?ND.ADDED:ND.UNCHANGED}_unreferenceFeature(e){const i=(this._refCounts.get(e)||0)-1;return i===0?(this._refCounts.delete(e),ND.REMOVED):(i>0&&this._refCounts.set(e,i),ND.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 RFi(t){return t.reduce((e,i)=>e+MFi(i),0)}function MFi(t){return 32+DFi(t.geometry)+HZt(t.attributes)}function DFi(t){if(lt(t))return 0;const e=fZe(t.lengths,4);return 32+fZe(t.coords,8)+e}E([k({constructOnly:!0})],VN.prototype,"featureStore",void 0),E([k()],VN.prototype,"tileInfo",void 0),E([k()],VN.prototype,"extent",void 0),E([k()],VN.prototype,"maximumByteSize",void 0),VN=E([ht("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],VN);let FFi=class{constructor(e,i,r){this.data=e,this.objectIds=i,this.byteSize=r}},jyt=class{constructor(e,i,r){this.level=e,this.row=i,this.col=r,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(ye(this.children[0])||ye(this.children[1])||ye(this.children[2])||ye(this.children[3]))}},SDe=class{constructor(e,i=[]){this.missingTiles=i,this.fullArea=0,this.coveredArea=0,this.fullArea=d7e(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}},LFi=class{constructor(e,i,r){this._tileInfo=e,this._extent=null,this.info=new SDe(i),ye(r)&&(this._extent=fR(r))}addMissing(e,i,r,n){const s=new kB(null,e,i,r);this._tileInfo.updateTileInfo(s,Ml.ExtrapolateOptions.POWER_OF_TWO),lt(s.extent)||ye(this._extent)&&!nse(this._extent,s.extent)||(this.info.missingTiles.push({data:s,resolution:n}),this.info.coveredArea-=d7e(s.extent))}};const kFi=.18751;var ND;(function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.UNCHANGED=2]="UNCHANGED"})(ND||(ND={}));let iU=class extends cd.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=Jx(),this._elevationAligner=Nyt(),this._elevationFilter=Byt(),this._symbologyCandidatesFetcher=Gyt(),this._handles=new uf,this._updatingHandles=new RR,this._editsUpdatingHandles=new RR,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(e,i)=>{const r={points:e},n=await this.remoteClient.invoke("alignElevation",r,{signal:i});return sn(i),n},this._getSymbologyCandidates=async(e,i)=>{const r={candidates:e,spatialReference:this._spatialReference.toJSON()},n=await this.remoteClient.invoke("getSymbologyCandidates",r,{signal:i});return sn(i),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(),this._handles?.destroy()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:i,objectIdField:r,timeInfo:n,fields:s}=e.serviceInfo,{hasZ:o}=e,a=rr.fromJSON(e.spatialReference);this._spatialReference=a,this._featureStore=new yJ({...e.serviceInfo,hasZ:o,hasM:!1}),this._queryEngine=new NN({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:i,fields:s,hasZ:o,hasM:!1,objectIdField:r,timeInfo:n}),this._featureFetcher=new yf({store:new VN({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:rr.fromJSON(e.serviceInfo.spatialReference)});const l=e.configuration.viewType==="3d";return this._elevationAligner=Nyt(l,{elevationInfo:ye(e.elevationInfo)?v5.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures,spatialReference:a}),this._elevationFilter=Byt(l),this._handles.add([Qi(()=>this._featureFetcher.availability,c=>this.emit("notify-availability",{availability:c}),Nu),Qi(()=>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),{result:{}}}async fetchCandidates(e,i){await this._whenSetup.promise,sn(i);const r=$Fi(e),n=ye(i)?i.signal:null,s=await this._queryEngine.executeQueryForSnapping(r,n);sn(n);const o=await this._elevationAligner.alignCandidates(s.candidates,n);sn(n);const a=await this._symbologyCandidatesFetcher.fetch(o,n);sn(n);const l=a.length===0?o:o.concat(a);return{result:{candidates:this._elevationFilter.filter(r,l)}}}async updateTiles(e,i){return await this._updatingHandles.addPromise(this._whenSetup.promise),sn(i),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=ye(e.tileInfo)?Ml.fromJSON(e.tileInfo):null,$D}async refresh(e,i){return await this._updatingHandles.addPromise(this._whenSetup.promise),sn(i),this._featureFetcher.refresh(),$D}async whenNotUpdating(e,i){return await this._updatingHandles.addPromise(this._whenSetup.promise),sn(i),await F1(()=>!this.updatingExcludingEdits,i),sn(i),$D}async getDebugInfo(e,i){return sn(i),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(e,i){this._updatingHandles.addPromise(this._whenSetup.promise),sn(i);const r=Jx();return this._pendingApplyEdits.set(e.id,r),this._featureFetcher.applyEdits(r.promise),this._editsUpdatingHandles.addPromise(r.promise),$D}async endApplyEdits(e,i){const r=this._pendingApplyEdits.get(e.id);return r&&r.resolve(e.edits),sn(i),$D}async notifyElevationSourceChange(e,i){return this._elevationAligner.notifyElevationSourceChange(),$D}async notifySymbologyChange(e,i){return this._symbologyCandidatesFetcher.notifySymbologyChange(),$D}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=Gyt(e,this._getSymbologyCandidates),$D}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=ye(e.filter)?Ss.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};E([k({readOnly:!0})],iU.prototype,"updating",null),E([k({readOnly:!0})],iU.prototype,"updatingExcludingEdits",null),E([k()],iU.prototype,"_isInitializing",void 0),iU=E([ht("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],iU);const NFi=iU;function $Fi(t){return{point:t.point,mode:t.mode,distance:t.distance,types:t.types,query:ye(t.filter)?t.filter:{where:"1=1"}}}const $D={result:{}},BFi=Object.freeze(Object.defineProperty({__proto__:null,default:NFi},Symbol.toStringTag,{value:"Module"})),GFi={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function ope(t){return GFi[t]}function*zyt(t){switch(t.type){case"Feature":yield t;break;case"FeatureCollection":for(const e of t.features)e&&(yield e)}}function*VFi(t){if(t)switch(t.type){case"Point":yield t.coordinates;break;case"LineString":case"MultiPoint":yield*t.coordinates;break;case"MultiLineString":case"Polygon":for(const e of t.coordinates)yield*e;break;case"MultiPolygon":for(const e of t.coordinates)for(const i of e)yield*i}}function*UFi(t,e={}){const{geometryType:i,objectIdField:r}=e;for(const n of t){const{geometry:s,properties:o,id:a}=n;if(s&&ope(s.type)!==i)continue;const l=o||{};let c;r&&(c=l[r],a==null||c||(l[r]=c=a)),yield new o_(s?WFi(new Sl,s,e):null,l,null,c??void 0)}}function jFi(t){for(const e of t)if(e.length>2)return!0;return!1}function zFi(t){return!Hyt(t)}function HFi(t){return Hyt(t)}function Hyt(t){let e=0;for(let i=0;i=0;r--)CDe(t,e[r],i);t.lengths.push(e.length)}function CDe(t,e,i){const[r,n,s]=e;t.coords.push(r,n),i.hasZ&&t.coords.push(s||0)}function QFi(t){switch(typeof t){case"string":return"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function TDe(t){if(!t)throw new st("geojson-layer:empty","GeoJSON data is empty");if(t.type!=="Feature"&&t.type!=="FeatureCollection")throw new st("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:t});const{crs:e}=t;if(!e)return;const i=typeof e=="string"?e:e.type==="name"?e.properties.name:e.type==="EPSG"?e.properties.code:null,r=new RegExp(".*(CRS84H?|4326)$","i");if(!i||!r.test(i))throw new st("geojson-layer:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:e})}function Kyt(t,e={}){const i=[],r=new Set,n=new Set;let s,o=!1,a=null,l=!1,{geometryType:c=null}=e,d=!1;for(const y of zyt(t)){const{geometry:v,properties:S,id:I}=y;if((!v||(c||(c=ope(v.type)),ope(v.type)===c))&&(o||(o=jFi(VFi(v))),l||(l=I!=null,l&&(s=typeof I,S&&(a=Object.keys(S).filter(O=>S[O]===I)))),S&&a&&l&&I!=null&&(a.length>1?a=a.filter(O=>S[O]===I):a.length===1&&(a=S[a[0]]===I?a:[])),!d&&S)){let O=!0;for(const L in S){if(r.has(L))continue;const N=S[L];if(N==null){O=!1,n.add(L);continue}const G=QFi(N);if(G==="unknown"){n.add(L);continue}n.delete(L),r.add(L);const V=i9(L);V&&i.push({name:V,alias:L,type:G})}d=O}}const p=i9(a?.length===1&&a[0]||null)??void 0;if(p){for(const y of i)if(y.name===p&&r9(y)){y.type="esriFieldTypeOID";break}}return{fields:i,geometryType:c,hasZ:o,objectIdFieldName:p,objectIdFieldType:s,unknownFields:Array.from(n)}}function EDe(t,e){return Array.from(UFi(zyt(t),e))}let e4i=class{constructor(){this.code=null,this.description=null}},t4i=class{constructor(e){this.error=new e4i,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=e}};function cS(t){return new t4i(t)}let i4i=class{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}};function rU(t){return new i4i(t)}const IDe=new Set;function UN(t,e,i,r=!1,n){IDe.clear();for(const s in i){const o=t.get(s);if(!o)continue;const a=i[s],l=r4i(o,a);if(l!==a&&n&&n.push({name:"invalid-value-type",message:"attribute value was converted to match the field type",details:{field:o,originalValue:a,sanitizedValue:l}}),IDe.add(o.name),o&&(r||o.editable)){const c=xBt(o,l);if(c)return cS(ABt(c,o,l));e[o.name]=l}}for(const s of t?.requiredFields??[])if(!IDe.has(s.name))return cS(`missing required field "${s.name}"`);return null}function r4i(t,e){let i=e;return typeof e=="string"&&r9(t)?i=parseFloat(e):e!=null&&ube(t)&&typeof e!="string"&&(i=String(e)),wBt(i)}let xJ;function ape(t,e){if(!t||!gh(e))return t;if("rings"in t||"paths"in t){if(lt(xJ))throw new TypeError("geometry engine not loaded");return xJ.simplify(e,t)}return t}async function n4i(){return lt(xJ)&&(xJ=await Promise.resolve().then(()=>lZ)),xJ}async function Jyt(t,e){!gh(t)||e!=="esriGeometryPolygon"&&e!=="esriGeometryPolyline"||await n4i()}const s4i={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}},o4i=Object.freeze(Object.defineProperty({__proto__:null,default:class{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const i=await this._fetch(e);return this._createFeatures(i)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._fieldsIndex=this._createDefaultAttributes=null}async load(e,i={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const r=[];await this._checkProjection(e.spatialReference);let n=null;e.url&&(n=await this._fetch(i?.signal));const s=Kyt(n,{geometryType:e.geometryType}),o=e.fields||s.fields||[],a=e.hasZ!=null?e.hasZ:s.hasZ,l=s.geometryType;let c=e.objectIdField||s.objectIdFieldName||"__OBJECTID";const d=e.spatialReference||Df;let p=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}});let y=new Am(o).get(c);y?(y.type!=="esriFieldTypeString"&&(y.type="esriFieldTypeOID"),y.editable=!1,y.nullable=!1,c=y.name):(y={alias:c,name:c,type:s.objectIdFieldType==="string"?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(y));const v={};for(const Y of o){if(Y.name==null&&(Y.name=Y.alias),Y.alias==null&&(Y.alias=Y.name),!Y.name)throw new st("geojson-layer:invalid-field-name","field name is missing",{field:Y});if(!ooe.jsonValues.includes(Y.type))throw new st("geojson-layer:invalid-field-type",`invalid type for field "${Y.name}"`,{field:Y});if(Y.name!==y.name){const X=Dne(Y);X!==void 0&&(v[Y.name]=X)}}this._fieldsIndex=new Am(o);const S=this._fieldsIndex.requiredFields.indexOf(y);if(S>-1&&this._fieldsIndex.requiredFields.splice(S,1),p){if(p.startTimeField){const Y=this._fieldsIndex.get(p.startTimeField);Y?(p.startTimeField=Y.name,Y.type="esriFieldTypeDate"):p.startTimeField=null}if(p.endTimeField){const Y=this._fieldsIndex.get(p.endTimeField);Y?(p.endTimeField=Y.name,Y.type="esriFieldTypeDate"):p.endTimeField=null}if(p.trackIdField){const Y=this._fieldsIndex.get(p.trackIdField);Y?p.trackIdField=Y.name:(p.trackIdField=null,r.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:p}}))}p.startTimeField||p.endTimeField||(r.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:p}}),p=null)}const I=l?YV(l):void 0,O={warnings:r,featureErrors:[],layerDefinition:{...s4i,drawingInfo:I??void 0,templates:Fgt(v),extent:void 0,geometryType:l,objectIdField:c,fields:o,hasZ:!!a,timeInfo:p}};this._queryEngine=new NN({fields:o,geometryType:l,hasM:!1,hasZ:a,objectIdField:c,spatialReference:d,timeInfo:p,featureStore:new yJ({geometryType:l,hasM:!1,hasZ:a}),cacheSpatialQueries:!0}),this._createDefaultAttributes=kMe(v,c);const L=await this._createFeatures(n);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,L);const N=this._normalizeFeatures(L,O.warnings,O.featureErrors);this._queryEngine.featureStore.addMany(N);const{fullExtent:G,timeExtent:V}=await this._queryEngine.fetchRecomputedExtents();if(O.layerDefinition.extent=G,V){const{start:Y,end:X}=V;O.layerDefinition.timeInfo.timeExtent=[Y,X]}return O}async applyEdits(e){const{spatialReference:i,geometryType:r}=this._queryEngine;return await Promise.all([Jyt(i,r),uy(e.adds,i),uy(e.updates,i)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,i.signal)}async queryFeatureCount(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,i.signal)}async queryObjectIds(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,i.signal)}async queryExtent(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,i.signal)}async querySnapping(e,i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,i.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=EC(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(),ss(n)||Ei.getLogger("esri.layers.GeoJSONLayer").error(new st("geojson-layer:refresh","An error occurred during refresh",{error:n}))}),await this._waitSnapshotComplete();const{fullExtent:i,timeExtent:r}=await this._queryEngine.fetchRecomputedExtents();return{extent:i,timeExtent:r}}async _createFeatures(e){if(e==null)return[];const{geometryType:i,hasZ:r,objectIdField:n}=this._queryEngine,s=EDe(e,{geometryType:i,hasZ:r,objectIdField:n});if(!Ca(this._queryEngine.spatialReference,Df))for(const o of s)ye(o.geometry)&&(o.geometry=H5(fp(cw(o.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),Df,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:i,customParameters:r}=this._loadOptions,n=(await ir(i,{responseType:"json",query:{...r},signal:e})).data;return await TDe(n),n}_normalizeFeatures(e,i,r){const{objectIdField:n}=this._queryEngine,s=[];for(const o of e){const a=this._createDefaultAttributes(),l=UN(this._fieldsIndex,a,o.attributes,!0,i);l?r?.push(l):(this._assignObjectId(a,o.attributes,!0),o.attributes=a,o.objectId=a[n],s.push(o))}return s}async _applyEdits(e){const{adds:i,updates:r,deletes:n}=e,s={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(i&&i.length&&this._applyAddEdits(s,i),r&&r.length&&this._applyUpdateEdits(s,r),n&&n.length){for(const l of n)s.deleteResults.push(rU(l));this._queryEngine.featureStore.removeManyById(n)}const{fullExtent:o,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:o,timeExtent:a,featureEditResults:s}}_applyAddEdits(e,i){const{addResults:r}=e,{geometryType:n,hasM:s,hasZ:o,objectIdField:a,spatialReference:l,featureStore:c}=this._queryEngine,d=[];for(const p of i){if(p.geometry&&n!==md(p.geometry)){r.push(cS("Incorrect geometry type."));continue}const y=this._createDefaultAttributes(),v=UN(this._fieldsIndex,y,p.attributes);if(v)r.push(v);else{if(this._assignObjectId(y,p.attributes),p.attributes=y,p.uid!=null){const S=p.attributes[a];e.uidToObjectId[p.uid]=S}if(ye(p.geometry)){const S=p.geometry.spatialReference??l;p.geometry=fp(ape(p.geometry,S),S,l)}d.push(p),r.push(rU(p.attributes[a]))}}c.addMany(MB([],d,n,o,s,a))}_applyUpdateEdits({updateResults:e},i){const{geometryType:r,hasM:n,hasZ:s,objectIdField:o,spatialReference:a,featureStore:l}=this._queryEngine;for(const c of i){const{attributes:d,geometry:p}=c,y=d&&d[o];if(y==null){e.push(cS(`Identifier field ${o} missing`));continue}if(!l.has(y)){e.push(cS(`Feature with object id ${y} missing`));continue}const v=TTe(l.getFeature(y),r,s,n);if(ye(p)){if(r!==md(p)){e.push(cS("Incorrect geometry type."));continue}const S=p.spatialReference??a;v.geometry=fp(ape(p,S),S,a)}if(d){const S=UN(this._fieldsIndex,v.attributes,d);if(S){e.push(S);continue}}l.add(CTe(v,r,s,n,o)),e.push(rU(y))}}_createObjectIdGenerator(e,i){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 i)s.objectId&&(n=Math.max(n,s.objectId));return n=Math.max(0,n)+1,()=>n++}_assignObjectId(e,i,r=!1){const n=this._queryEngine.objectIdField;e[n]=r&&n in i?i[n]:this._objectIdGenerator()}async _checkProjection(e){try{await uy(Df,e)}catch{throw new st("geojson-layer","Projection not supported")}}}},Symbol.toStringTag,{value:"Module"}));var lpe={};lpe.defaultNoDataValue=K1e(-1/0),lpe.decode=function(t,e){var i=(e=e||{}).encodedMaskData||e.encodedMaskData===null,r=c4i(t,e.inputOffset||0,i),n=e.noDataValue!=null?K1e(e.noDataValue):lpe.defaultNoDataValue,s=a4i(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=l4i(r,n),e.computeUsedBitDepths&&(o.fileInfo.bitDepths=u4i(r))),o};var a4i=function(t,e,i,r,n){var s,o,a=0,l=t.pixels.numBlocksX,c=t.pixels.numBlocksY,d=Math.floor(t.width/l),p=Math.floor(t.height/c),y=2*t.maxZError;i=i||(t.mask?t.mask.bitset:null),s=new e(t.width*t.height),n&&i&&(o=new Uint8Array(t.width*t.height));for(var v,S,I=new Float32Array(d*p),O=0;O<=c;O++){var L=O!==c?p:t.height%c;if(L!==0)for(var N=0;N<=l;N++){var G=N!==l?d:t.width%l;if(G!==0){var V,Y,X,te,re=O*t.width*p+N*d,fe=t.width-G,ge=t.pixels.blocks[a];if(ge.encoding<2?(ge.encoding===0?V=ge.rawData:(h4i(ge.stuffedData,ge.bitsPerPixel,ge.numValidPixels,ge.offset,y,I,t.pixels.maxValue),V=I),Y=0):X=ge.encoding===2?0:ge.offset,i)for(S=0;S>3],te<<=7&re),v=0;v>3]),128&te?(o&&(o[re]=1),s[re++]=ge.encoding<2?V[Y++]:X):(o&&(o[re]=0),s[re++]=r),te<<=1;re+=fe}else if(ge.encoding<2)for(S=0;S0){var o=new Uint8Array(Math.ceil(r.width*r.height/8)),a=(s=new DataView(t,e,r.mask.numBytes)).getInt16(0,!0),l=2,c=0;do{if(a>0)for(;a--;)o[c++]=s.getUint8(l++);else{var d=s.getUint8(l++);for(a=-a;a--;)o[c++]=d}a=s.getInt16(l,!0),l+=2}while(l0?1:0),S=y+(r.height%y>0?1:0);r.pixels.blocks=new Array(v*S);for(var I=1e9,O=0,L=0;L3)throw"Invalid block encoding ("+Y.encoding+")";if(Y.encoding!==2){if(X!==0&&X!==2){if(X>>=6,Y.offsetType=X,X===2)Y.offset=s.getInt8(1),G++;else if(X===1)Y.offset=s.getInt16(1,!0),G+=2;else{if(X!==0)throw"Invalid block offset type";Y.offset=s.getFloat32(1,!0),G+=4}if(I=Math.min(Y.offset,I),Y.encoding===1)if(X=s.getUint8(G),G++,Y.bitsPerPixel=63&X,X>>=6,Y.numValidPixelsType=X,X===2)Y.numValidPixels=s.getUint8(G),G++;else if(X===1)Y.numValidPixels=s.getUint16(G,!0),G+=2;else{if(X!==0)throw"Invalid valid pixel count type";Y.numValidPixels=s.getUint32(G,!0),G+=4}}var te;if(e+=G,Y.encoding!=3){if(Y.encoding===0){var re=(r.pixels.numBytes-1)/4;if(re!==Math.floor(re))throw"uncompressed block has invalid length";te=new ArrayBuffer(4*re),new Uint8Array(te).set(new Uint8Array(t,e,4*re));for(var fe=new Float32Array(te),ge=0;ge=e)l=c>>>y-e&d,y-=e;else{var I=e-y;l=(c&d)<>>(y=32-I)}s[a]=lG.name===v&&(N=G,!0))?(N.type="esriFieldTypeOID",N.editable=!1,N.nullable=!1):s.unshift({alias:v,name:v,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const N of s){if(N.name==null&&(N.name=N.alias),N.alias==null&&(N.alias=N.name),!N.name)throw new st("feature-layer:invalid-field-name","field name is missing",{field:N});if(N.name===v&&(N.type="esriFieldTypeOID"),!ooe.jsonValues.includes(N.type))throw new st("feature-layer:invalid-field-type",`invalid type for field "${N.name}"`,{field:N})}const I={};for(const N of s)if(N.type!=="esriFieldTypeOID"&&N.type!=="esriFieldTypeGlobalID"){const G=Dne(N);G!==void 0&&(I[N.name]=G)}if(this._fieldsIndex=new Am(s),this._createDefaultAttributes=kMe(I,v),S){if(S.startTimeField){const N=this._fieldsIndex.get(S.startTimeField);N?(S.startTimeField=N.name,N.type="esriFieldTypeDate"):S.startTimeField=null}if(S.endTimeField){const N=this._fieldsIndex.get(S.endTimeField);N?(S.endTimeField=N.name,N.type="esriFieldTypeDate"):S.endTimeField=null}if(S.trackIdField){const N=this._fieldsIndex.get(S.trackIdField);N?S.trackIdField=N.name:(S.trackIdField=null,i.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:S}}))}S.startTimeField||S.endTimeField||(i.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:S}}),S=null)}const O={warnings:i,featureErrors:[],layerDefinition:{..._4i,drawingInfo:YV(p),templates:Fgt(I),extent:d,geometryType:p,objectIdField:v,fields:s,hasZ:a,hasM:o,timeInfo:S},assignedObjectIds:{}};if(this._queryEngine=new NN({fields:s,geometryType:p,hasM:o,hasZ:a,objectIdField:v,spatialReference:c,featureStore:new yJ({geometryType:p,hasM:o,hasZ:a}),timeInfo:S,cacheSpatialQueries:!0}),!r||!r.length)return this._nextObjectId=g4i,O;const L=Zyt(v,r);return this._nextObjectId=L+1,await uy(r,c),this._loadInitialFeatures(O,r)}async applyEdits(e){const{spatialReference:i,geometryType:r}=this._queryEngine;return await Promise.all([Jyt(i,r),uy(e.adds,i),uy(e.updates,i)]),this._applyEdits(e)}queryFeatures(e,i={}){return this._queryEngine.executeQuery(e,i.signal)}queryFeatureCount(e,i={}){return this._queryEngine.executeQueryForCount(e,i.signal)}queryObjectIds(e,i={}){return this._queryEngine.executeQueryForIds(e,i.signal)}queryExtent(e,i={}){return this._queryEngine.executeQueryForExtent(e,i.signal)}querySnapping(e,i={}){return this._queryEngine.executeQueryForSnapping(e,i.signal)}_inferLayerProperties(e,i){let r,n,s=null,o=null,a=null;for(const l of e){const c=l.geometry;if(!lt(c)&&(s||(s=md(c)),o||(o=c.spatialReference),r==null&&(r=b4i(c)),n==null&&(n=w4i(c)),s&&o&&r!=null&&n!=null))break}if(i&&i.length){let l=null;i.some(c=>{const d=c.type==="esriFieldTypeOID",p=!c.type&&c.name&&c.name.toLowerCase()==="objectid";return l=c,d||p})&&(a=l.name)}return{geometryType:s,spatialReference:o,objectIdField:a,hasM:n,hasZ:r}}async _loadInitialFeatures(e,i){const{geometryType:r,hasM:n,hasZ:s,objectIdField:o,spatialReference:a,featureStore:l}=this._queryEngine,c=[];for(const y of i){if(y.uid!=null&&(e.assignedObjectIds[y.uid]=-1),y.geometry&&r!==md(y.geometry)){e.featureErrors.push(cS("Incorrect geometry type."));continue}const v=this._createDefaultAttributes(),S=UN(this._fieldsIndex,v,y.attributes,!0,e.warnings);S?e.featureErrors.push(S):(this._assignObjectId(v,y.attributes,!0),y.attributes=v,y.uid!=null&&(e.assignedObjectIds[y.uid]=y.attributes[o]),ye(y.geometry)&&(y.geometry=fp(y.geometry,y.geometry.spatialReference,a)),c.push(y))}l.addMany(MB([],c,r,s,n,o));const{fullExtent:d,timeExtent:p}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=d,p){const{start:y,end:v}=p;e.layerDefinition.timeInfo.timeExtent=[y,v]}return e}async _applyEdits(e){const{adds:i,updates:r,deletes:n}=e,s={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(i&&i.length&&this._applyAddEdits(s,i),r&&r.length&&this._applyUpdateEdits(s,r),n&&n.length){for(const l of n)s.deleteResults.push(rU(l));this._queryEngine.featureStore.removeManyById(n)}const{fullExtent:o,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:o,timeExtent:a,featureEditResults:s}}_applyAddEdits(e,i){const{addResults:r}=e,{geometryType:n,hasM:s,hasZ:o,objectIdField:a,spatialReference:l,featureStore:c}=this._queryEngine,d=[];for(const p of i){if(p.geometry&&n!==md(p.geometry)){r.push(cS("Incorrect geometry type."));continue}const y=this._createDefaultAttributes(),v=UN(this._fieldsIndex,y,p.attributes);if(v)r.push(v);else{if(this._assignObjectId(y,p.attributes),p.attributes=y,p.uid!=null){const S=p.attributes[a];e.uidToObjectId[p.uid]=S}if(ye(p.geometry)){const S=p.geometry.spatialReference??l;p.geometry=fp(ape(p.geometry,S),S,l)}d.push(p),r.push(rU(p.attributes[a]))}}c.addMany(MB([],d,n,o,s,a))}_applyUpdateEdits({updateResults:e},i){const{geometryType:r,hasM:n,hasZ:s,objectIdField:o,spatialReference:a,featureStore:l}=this._queryEngine;for(const c of i){const{attributes:d,geometry:p}=c,y=d&&d[o];if(y==null){e.push(cS(`Identifier field ${o} missing`));continue}if(!l.has(y)){e.push(cS(`Feature with object id ${y} missing`));continue}const v=TTe(l.getFeature(y),r,s,n);if(ye(p)){if(r!==md(p)){e.push(cS("Incorrect geometry type."));continue}const S=p.spatialReference??a;v.geometry=fp(ape(p,S),S,a)}if(d){const S=UN(this._fieldsIndex,v.attributes,d);if(S){e.push(S);continue}}l.add(CTe(v,r,s,n,o)),e.push(rU(y))}}_assignObjectId(e,i,r=!1){const n=this._queryEngine.objectIdField;r&&i&&isFinite(i[n])?e[n]=i[n]:e[n]=this._nextObjectId++}}},Symbol.toStringTag,{value:"Module"}));let S4i=class{constructor(e,i,r){this.uid=e,this.geometry=i,this.attributes=r,this.visible=!0,this.objectId=null,this.centroid=null}},C4i=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 T4i(t,e){return e}function ADe(t,e,i,r){switch(i){case 0:return SJ(t,e+r,0);case 1:return t.originPosition==="lowerLeft"?SJ(t,e+r,1):A4i(t,e+r,1)}}function Qyt(t,e,i,r){return i===2?SJ(t,e,2):ADe(t,e,i,r)}function E4i(t,e,i,r){return i===2?SJ(t,e,3):ADe(t,e,i,r)}function I4i(t,e,i,r){return i===3?SJ(t,e,3):Qyt(t,e,i,r)}function SJ({translate:t,scale:e},i,r){return t[r]+i*e[r]}function A4i({translate:t,scale:e},i,r){return t[r]-i*e[r]}let P4i=class{constructor(e){this._options=e,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=T4i,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return new C4i}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const i=k9(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(!lt(i))for(const r of e.features)i(r.geometry)}createSpatialReference(){return new rr}addField(e,i){e.fields.push(Bo.fromJSON(i));const r=e.fields.map(n=>n.name);this._attributesConstructor=function(){for(const n of r)this[n]=null}}addFeature(e,i){const r=this._options.maxStringAttributeLength?this._options.maxStringAttributeLength:0;if(r>0)for(const n in i.attributes){const s=i.attributes[n];typeof s=="string"&&s.length>r&&(i.attributes[n]="")}e.features.push(i)}addQueryGeometry(e,i){const{queryGeometry:r,queryGeometryType:n}=i,s=DB(r.clone(),r,!1,!1,this._transform),o=cw(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=(i,r,n)=>this.addCoordinatePoint(i,r,n),this.createGeometry=i=>this.createPointGeometry(i);break;case"polygon":this.addCoordinate=(i,r,n)=>this._addCoordinatePolygon(i,r,n),this.createGeometry=i=>this._createPolygonGeometry(i);break;case"polyline":this.addCoordinate=(i,r,n)=>this._addCoordinatePolyline(i,r,n),this.createGeometry=i=>this._createPolylineGeometry(i);break;case"multipoint":this.addCoordinate=(i,r,n)=>this._addCoordinateMultipoint(i,r,n),this.createGeometry=i=>this._createMultipointGeometry(i);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 S4i(V3(),null,new this._attributesConstructor)}allocateCoordinates(){const e=this._lengths.reduce((i,r)=>i+r,0);this._coordinateBuffer=new Float64Array(e*this._vertexDimension),this._coordinateBufferPtr=0}addLength(e,i){this._lengths.length===0&&(this._toAddInCurrentPath=i),this._lengths.push(i)}createPointGeometry(e){const i={type:"point",x:0,y:0,spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM};return i.hasZ&&(i.z=0),i.hasM&&(i.m=0),i}addCoordinatePoint(e,i,r){const n=this._transform?this._applyTransform(this._transform,i,r,0):i;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,i){let r=0;return i<=1&&(r=this._previousCoordinate[i],this._previousCoordinate[i]+=e),this._transform?this._applyTransform(this._transform,e,i,r):e}_addCoordinatePolyline(e,i,r){this._dehydratedAddPointsCoordinate(e.paths,i,r)}_addCoordinatePolygon(e,i,r){this._dehydratedAddPointsCoordinate(e.rings,i,r)}_addCoordinateMultipoint(e,i,r){r===0&&e.points.push([]);const n=this._transformPathLikeValue(i,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,i,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(i,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:i,hasM:r}=e;return i&&r?I4i:i?Qyt:r?E4i:ADe}},O4i=class{_parseFeatureQuery(e){const i=CJe(e.buffer,new P4i(e.options)),r={...i,spatialReference:i.spatialReference?.toJSON(),fields:i.fields?i.fields.map(n=>n.toJSON()):void 0};return Promise.resolve(r)}};function R4i(){return new O4i}const M4i=Object.freeze(Object.defineProperty({__proto__:null,default:R4i},Symbol.toStringTag,{value:"Module"}));function D4i(t){return t==="heatmap"?Promise.resolve().then(()=>NCr):Promise.resolve().then(()=>BCr)}let BD=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 i=this._buffer[this._start];return this._buffer[this._start]=e,this._start=(this._start+1)%this.maxSize,i}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 i of this._buffer)if(ye(i)&&e(i))return i;return null}clear(e){let i=this.dequeue();for(;ye(i);)e&&e(i),i=this.dequeue()}};function F4i(t,e,i){if(lt(t))return null;const r=e.readArcadeFeature();try{return t.evaluate({...i,$feature:r})}catch(n){return Ei.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",n),null}}const L4i=Promise.resolve().then(()=>UCr);let PDe=class{constructor(e,i){this._canCacheExpressionValue=!1,this._sourceInfo=e,this._storage=i,this._bitsets={computed:i.getBitset(i.createBitset())}}get storage(){return this._storage}invalidate(){this._bitsets.computed.clear()}async updateSchema(e,i){const r=d2(this._schema,i);if(this._schema=i,!i||lt(r)||!vA(r,"attributes"))return;Gi("esri-2d-update-debug")&&console.debug("Applying Update - Store:",r),this._bitsets.computed.clear(),e.targets[i.name]=!0;const n=i.attributes,s=[],o=[];for(const a in n){const l=n[a];switch(l.type){case"field":break;case"expression":s.push(this._createArcadeComputedField(l));break;case"label-expression":s.push(this._createLabelArcadeComputedField(l));break;case"statistic":o.push(l)}}this._computedFields=await Promise.all(s),this._canCacheExpressionValue=!this._computedFields.some(a=>a.type==="expression"&&ye(a.expression)&&a.expression.referencesScale()),this._statisticFields=o}setComputedAttributes(e,i,r,n){const s=this._bitsets.computed;if(!this._canCacheExpressionValue||!s.has(r)){s.set(r);for(const o of this._computedFields){const a=this._evaluateField(i,o,n);switch(o.resultType){case"numeric":e.setComputedNumericAtIndex(r,o.fieldIndex,a);break;case"string":e.setComputedStringAtIndex(r,o.fieldIndex,a)}}}}async _createArcadeComputedField(e){const i=this._sourceInfo.spatialReference,r=this._sourceInfo.fieldsIndex;return{...e,expression:await Rne(e.valueExpression,i,r)}}async _createLabelArcadeComputedField(e){const i=this._sourceInfo.spatialReference,r=this._sourceInfo.fieldsIndex,{createLabelFunction:n}=await L4i,s=await n(e.label,r,i);return{...e,builder:s}}_evaluateField(e,i,r){switch(i.type){case"label-expression":{const n=e.readArcadeFeature();return i.builder.evaluate(n)||""}case"expression":{const{expression:n}=i;return F4i(n,e,{$view:{scale:r}})}}}},ODe=class Qve{static fromBuffer(e,i){return new Qve(e,i)}static create(e,i=4294967295){const r=new Uint32Array(Math.ceil(e/32));return new Qve(r,i)}constructor(e,i){this._mask=0,this._buf=e,this._mask=i}_getIndex(e){return Math.floor(e/32)}has(e){const i=this._mask&e;return!!(this._buf[this._getIndex(i)]&1<>>=1,n++}}countSet(){let e=0;return this.forEachSet(i=>{e++}),e}},CJ=0;const upe=Gi("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],k4i=upe[0],N4i=upe[1],$4i=upe[2],B4i=upe[3],RDe=Gi("featurelayer-simplify-payload-size-factors")??[1,2,4],G4i=RDe[0],V4i=RDe[1],U4i=RDe[2],j4i=Gi("featurelayer-simplify-mobile-factor")??2,z4i=Gi("esri-mobile");let jN=class{constructor(e,i){this.type="FeatureSetReader",this.arcadeDeclaredClass="esri.arcade.Feature",this.seen=!1,this.instance=0,this._tx=0,this._ty=0,this._sx=1,this._sy=1,this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._level=0,this._datetimeMetadata=null,this.contextTimeReference=null,this.instance=e,this._layerSchema=i}static createInstance(){return CJ++,CJ=CJ>65535?0:CJ,CJ}get isEmpty(){return ye(this._deleted)&&this._deleted.countSet()===this.getSize()}set level(e){this._level=e}getAreaSimplificationThreshold(e,i){let r=1;const n=z4i?j4i:1;i>4e6?r=U4i*n:i>1e6?r=V4i*n:i>5e5?r=G4i*n:i>1e5&&(r=n);let s=0;e>4e3?s=B4i*r:e>2e3?s=$4i*r:e>100?s=N4i:e>15&&(s=k4i);let o=8;return this._level<4?o=1:this._level<5?o=2:this._level<6&&(o=4),s*o}createQuantizedExtrudedQuad(e,i){return new Sl([5],[e-1,i,1,-1,1,1,-1,1,-1,-1])}setArcadeSpatialReference(e){this._arcadeSpatialReference=e}attachStorage(e){this._storage=e}getQuantizationTransform(){throw new Error("Unable to find transform for featureSet")}getStorage(){return this._storage}getComputedNumeric(e){return this.getComputedNumericAtIndex(0)}setComputedNumeric(e,i){return this.setComputedNumericAtIndex(i,0)}getComputedString(e){return this.getComputedStringAtIndex(0)}setComputedString(e,i){return this.setComputedStringAtIndex(0,i)}getComputedNumericAtIndex(e){return this._storage.getComputedNumericAtIndex(this.getDisplayId(),e)}setComputedNumericAtIndex(e,i){this._storage.setComputedNumericAtIndex(this.getDisplayId(),e,i)}getComputedStringAtIndex(e){return this._storage.getComputedStringAtIndex(this.getDisplayId(),e)}setComputedStringAtIndex(e,i){return this._storage.setComputedStringAtIndex(this.getDisplayId(),e,i)}transform(e,i,r,n){const s=this.copy();return s._tx+=e,s._ty+=i,s._sx*=r,s._sy*=n,s}readAttribute(e,i=!1){const r=this._readAttribute(e,i);if(r!==void 0)return r;for(const n of this._joined){n.setIndex(this.getIndex());const s=n._readAttribute(e,i);if(s!==void 0)return s}}readAttributes(){const e=this._readAttributes();for(const i of this._joined){i.setIndex(this.getIndex());const r=i._readAttributes();for(const n of Object.keys(r))e[n]=r[n]}return e}joinAttributes(e){this._joined.push(e)}readArcadeFeature(){return this}geometry(){const e=this.readHydratedGeometry(),i=cw(e,this.geometryType,this.hasZ,this.hasM),r=fl(i);return r&&(r.spatialReference=this._arcadeSpatialReference),r}get dateTimeReferenceFieldIndex(){return this._datetimeMetadata||(this._datetimeMetadata=ede.create(this._layerSchema.fields,this._layerSchema)),this._datetimeMetadata}autocastArcadeDate(e,i){return i&&i instanceof Date?this.isUnknownDateTimeField(e)?ml.unknownDateJSToArcadeDate(i):ml.dateJSAndZoneToArcadeDate(i,this.contextTimeReference?.timeZone??"system"):i}isUnknownDateTimeField(e){return this.dateTimeReferenceFieldIndex?.fieldTimeZone(e)==="unknown"}fieldSourceTimeZone(e){return this.dateTimeReferenceFieldIndex?.fieldTimeZone(e)??""}get layerPreferredTimeZone(){return this.dateTimeReferenceFieldIndex?.layerPreferredTimeZone??""}field(e){if(this.hasField(e))return this.autocastArcadeDate(e,this.readAttribute(e,!0));for(const i of this._joined)if(i.setIndex(this.getIndex()),i.hasField(e)){const r=i._readAttribute(e,!0);return this.autocastArcadeDate(e,r)}throw new Error(`Field ${e} does not exist`)}setField(e,i){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.getFieldNames()}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeature());const i=this.readLegacyFeature();if(!i)return JSON.stringify(null);const r={geometry:i.geometry,attributes:{...i.attributes?i.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._layerSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:e?.keepGeometryType===!0?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,i=null){return Promise.resolve(this.castAsJson(i))}removeIds(e){if(lt(this._objectIdToIndex)){const r=new Map,n=this.getCursor();for(;n.next();){const s=_u(n.getObjectId());r.set(s,n.getIndex())}this._objectIdToIndex=r}const i=this._objectIdToIndex;for(const r of e)i.has(r)&&this.removeAtIndex(i.get(r))}removeAtIndex(e){lt(this._deleted)&&(this._deleted=ODe.create(this.getSize())),this._deleted.set(e)}readGeometryForDisplay(){return this.readUnquantizedGeometry(!0)}readLegacyGeometryForDisplay(){return this.readLegacyGeometry(!0)}*features(){const e=this.getCursor();for(;e.next();)yield e.readOptimizedFeature()}_getExists(){return lt(this._deleted)||!this._deleted.has(this.getIndex())}_computeCentroid(){if(this.geometryType!=="esriGeometryPolygon")return null;const e=this.readUnquantizedGeometry();if(!e||e.hasIndeterminateRingOrder)return null;const i=Fu(this.getQuantizationTransform(),null);return igt(new Sl,e,this.hasM,this.hasZ,i)}copyInto(e){e.seen=this.seen,e._storage=this._storage,e._arcadeSpatialReference=this._arcadeSpatialReference,e._joined=this._joined,e._tx=this._tx,e._ty=this._ty,e._sx=this._sx,e._sy=this._sy,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex}},e0t=class vBe extends jN{static from(e,i){return new vBe(e.copy(),i)}constructor(e,i){super(jN.createInstance(),e.fullSchema()),this._currentIndex=-1,this._reader=e,this._indices=i}get hasNext(){return this._currentIndex+1>>16}function EJ(t){return 65535&t}const cpe={getObjectId:t=>t.getObjectId(),getAttributes:t=>t.readAttributes(),getAttribute:(t,e)=>t.readAttribute(e),cloneWithGeometry:(t,e)=>t,getGeometry:t=>t.readHydratedGeometry(),getCentroid:(t,e)=>t.readCentroid()};let H4i=class extends PDe{constructor(e,i,r){super(e,i),this.featureAdapter=cpe,this.events=new cd,this._featureSetsByInstance=new Map,this._objectIdToDisplayId=new Map,this._spatialIndexInvalid=!0,this._indexSearchCache=new BD(50),this._index=Tk(9,n=>({minX:this._storage.getXMin(n),minY:this._storage.getYMin(n),maxX:this._storage.getXMax(n),maxY:this._storage.getYMax(n)})),this.mode=r}get storeStatistics(){let e=0,i=0,r=0;return this.forEach(n=>{const s=n.readGeometry();s&&(i+=s.isPoint?1:s.lengths.reduce((o,a)=>o+a,0),r+=s.isPoint?1:s.lengths.length,e+=1)}),{featureCount:e,vertexCount:i,ringCount:r}}hasInstance(e){return this._featureSetsByInstance.has(e)}onTileData(e,i){if(lt(i.addOrUpdate))return i;if(i.addOrUpdate.attachStorage(this._storage),this.mode==="snapshot"){const n=i.addOrUpdate.getCursor();for(;n.next();){const s=n.getDisplayId();this.setComputedAttributes(this._storage,n,s,e.scale)}return i}this._featureSetsByInstance.set(i.addOrUpdate.instance,i.addOrUpdate);const r=i.addOrUpdate.getCursor();for(;r.next();)this._insertFeature(r,e.scale);return this._spatialIndexInvalid=!0,this.events.emit("changed"),i}search(e){this._rebuildIndex();const i=e.id,r=this._indexSearchCache.find(a=>a.tileId===i);if(ye(r))return r.readers;const n=new Map,s=this._searchIndex(e.bounds),o=[];for(const a of s){const l=this._storage.getInstanceId(a),c=TJ(l),d=EJ(l);n.has(c)||n.set(c,[]),n.get(c).push(d)}return n.forEach((a,l)=>{const c=this._featureSetsByInstance.get(l);o.push(e0t.from(c,a))}),this._indexSearchCache.enqueue({tileId:i,readers:o}),o}insert(e){const i=e.getCursor(),r=this._storage;for(;i.next();){const n=i0t(i.instance,i.getIndex()),s=i.getObjectId(),o=this._objectIdToDisplayId.get(s)??this._storage.createDisplayId();i.setDisplayId(o),r.setInstanceId(o,n),this._objectIdToDisplayId.set(s,o)}this._featureSetsByInstance.set(e.instance,e),this._spatialIndexInvalid=!0}remove(e){const i=this._objectIdToDisplayId.get(e);if(!i)return;const r=this._storage.getInstanceId(i),n=EJ(r),s=TJ(r),o=this._featureSetsByInstance.get(s);this._objectIdToDisplayId.delete(e),this._storage.releaseDisplayId(i),o.removeAtIndex(n),o.isEmpty&&this._featureSetsByInstance.delete(s),this._spatialIndexInvalid=!0}forEach(e){this._objectIdToDisplayId.forEach(i=>{const r=this._storage.getInstanceId(i),n=this._lookupFeature(r);e(n)})}forEachUnsafe(e){this._objectIdToDisplayId.forEach(i=>{const r=this._storage.getInstanceId(i),n=TJ(r),s=EJ(r),o=this._getFeatureSet(n);o.setIndex(s),e(o)})}forEachInBounds(e,i){const r=this._searchIndex(e);for(const n of r){const s=this.lookupFeatureByDisplayId(n,this._storage);i(s)}}forEachBounds(e,i){this._rebuildIndex();for(const r of e){if(!r.readGeometry())continue;const n=r.getDisplayId();y7e(t0t,this._storage.getXMin(n),this._storage.getYMin(n),this._storage.getXMax(n),this._storage.getYMax(n)),i(t0t)}}sweepFeatures(e,i,r){this._spatialIndexInvalid=!0,this._objectIdToDisplayId.forEach((n,s)=>{e.has(n)||(i.releaseDisplayId(n),r&&r.unsetAttributeData(n),this._objectIdToDisplayId.delete(s))}),this.events.emit("changed")}sweepFeatureSets(e){this._spatialIndexInvalid=!0,this._featureSetsByInstance.forEach((i,r)=>{e.has(r)||this._featureSetsByInstance.delete(r)})}lookupObjectId(e,i){const r=this.lookupFeatureByDisplayId(e,i);return lt(r)?null:r.getObjectId()}lookupDisplayId(e){return this._objectIdToDisplayId.get(e)}lookupFeatureByDisplayId(e,i){const r=i.getInstanceId(e);return this._lookupFeature(r)}lookupByDisplayIdUnsafe(e){const i=this._storage.getInstanceId(e),r=TJ(i),n=EJ(i),s=this._getFeatureSet(r);return s?(s.setIndex(n),s):null}_insertFeature(e,i){const r=this._storage,n=e.getObjectId(),s=i0t(e.instance,e.getIndex());r.getInstanceId(e.getDisplayId());let o=this._objectIdToDisplayId.get(n);o||(o=r.createDisplayId(),this._objectIdToDisplayId.set(n,o),this._spatialIndexInvalid=!0),e.setDisplayId(o),r.setInstanceId(o,s),this.setComputedAttributes(r,e,o,i)}_searchIndex(e){this._rebuildIndex();const i={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(i)}_rebuildIndex(){if(!this._spatialIndexInvalid)return;const e=[];this.mode==="snapshot"?this._featureSetsByInstance.forEach(i=>{const r=i.getCursor();for(;r.next();){const n=r.getDisplayId();this._storage.setBounds(n,r)&&e.push(n)}}):this._objectIdToDisplayId.forEach(i=>{const r=this._storage.getInstanceId(i);this._storage.setBounds(i,this._lookupFeature(r))&&e.push(i)}),this._index.clear(),this._index.load(e),this._indexSearchCache.clear(),this._spatialIndexInvalid=!1}_lookupFeature(e){const i=TJ(e),r=this._getFeatureSet(i);if(!r)return;const n=r.getCursor(),s=EJ(e);return n.setIndex(s),n}_getFeatureSet(e){return this._featureSetsByInstance.get(e)}};const hpe=Ei.getLogger("esri.layers.graphics.sources.ogcfeature"),MDe="http://www.opengis.net/def/crs/",r0t=`${MDe}OGC/1.3/CRS84`;async function W4i(t,e,i={},r=5){const{links:n}=t,s=KP(n,"items","application/geo+json")||KP(n,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(lt(s))throw new st("ogc-feature-layer:missing-items-page","Missing items url");const{data:o}=await ir(s.href,{signal:i.signal,query:{limit:r,...i.customParameters,token:i.apiKey},headers:{accept:"application/geo+json"}});await TDe(o);const a=Kyt(o,{geometryType:e.geometryType}),l=e.fields||a.fields||[],c=e.hasZ!=null?e.hasZ:a.hasZ,d=a.geometryType,p=e.objectIdField||a.objectIdFieldName||"OBJECTID";let y=e.timeInfo;const v=l.find(({name:S})=>S===p);if(v)v.editable=!1,v.nullable=!1;else{if(!a.objectIdFieldType)throw new st("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");l.unshift({name:p,alias:p,type:a.objectIdFieldType==="number"?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(p!==a.objectIdFieldName){const S=l.find(({name:I})=>I===a.objectIdFieldName);S&&(S.type="esriFieldTypeInteger")}l===a.fields&&a.unknownFields.length>0&&hpe.warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:a.unknownFields}});for(const S of l){if(S.name==null&&(S.name=S.alias),S.alias==null&&(S.alias=S.name),S.type!=="esriFieldTypeOID"&&S.type!=="esriFieldTypeGlobalID"&&(S.editable=S.editable==null||!!S.editable,S.nullable=S.nullable==null||!!S.nullable),!S.name)throw new st("ogc-feature-layer:invalid-field-name","field name is missing",{field:S});if(!ooe.jsonValues.includes(S.type))throw new st("ogc-feature-layer:invalid-field-type",`invalid type for field "${S.name}"`,{field:S})}if(y){const S=new Am(l);if(y.startTimeField){const I=S.get(y.startTimeField);I?(y.startTimeField=I.name,I.type="esriFieldTypeDate"):y.startTimeField=null}if(y.endTimeField){const I=S.get(y.endTimeField);I?(y.endTimeField=I.name,I.type="esriFieldTypeDate"):y.endTimeField=null}if(y.trackIdField){const I=S.get(y.trackIdField);I?y.trackIdField=I.name:(y.trackIdField=null,hpe.warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:y}}))}y.startTimeField||y.endTimeField||(hpe.warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:y}}),y=null)}return{drawingInfo:d?YV(d):null,extent:iLi(t),geometryType:d,fields:l,hasZ:!!c,objectIdField:p,timeInfo:y}}async function q4i(t,e={}){const{links:i}=t,r=KP(i,"data","application/json")||KP(i,"http://www.opengis.net/def/rel/ogc/1.0/data","application/json");if(lt(r))throw new st("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:n,customParameters:s,signal:o}=e,{data:a}=await ir(r.href,{signal:o,headers:{accept:"application/json"},query:{...s,token:n}});return a}async function Y4i(t,e={}){const{links:i}=t,r=KP(i,"conformance","application/json")||KP(i,"http://www.opengis.net/def/rel/ogc/1.0/conformance","application/json");if(lt(r))throw new st("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:n,customParameters:s,signal:o}=e,{data:a}=await ir(r.href,{signal:o,headers:{accept:"application/json"},query:{...s,token:n}});return a}async function X4i(t,e={}){const{apiKey:i,customParameters:r,signal:n}=e,{data:s}=await ir(t,{signal:n,headers:{accept:"application/json"},query:{...r,token:i}});return s}async function K4i(t,e={}){const i="application/vnd.oai.openapi+json;version=3.0",r=KP(t.links,"service-desc",i);if(lt(r))return hpe.warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:n,customParameters:s,signal:o}=e,{data:a}=await ir(r.href,{signal:o,headers:{accept:i},query:{...s,token:n}});return a}function n0t(t){const e=/^http:\/\/www\.opengis.net\/def\/crs\/(?.*)\/(?.*)\/(?.*)$/i.exec(t)?.groups;if(!e)return null;const{authority:i,code:r}=e;switch(i.toLowerCase()){case"ogc":switch(r.toLowerCase()){case"crs27":return rr.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return rr.WGS84.wkid;default:return null}case"esri":case"epsg":{const n=Number.parseInt(r,10);return Number.isNaN(n)?null:n}default:return null}}async function J4i(t,e,i){const r=await DDe(t,e,i);return GJe(r)}async function DDe(t,e,i){const{collection:r,layerDefinition:n,maxRecordCount:s,queryParameters:{apiKey:o,customParameters:a},spatialReference:l,supportedCrs:c}=t,{links:d}=r,p=KP(d,"items","application/geo+json")||KP(d,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(lt(p))throw new st("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:y,num:v,start:S,timeExtent:I,where:O}=e;if(e.objectIds)throw new st("ogc-feature-layer:query-by-objectids-not-supported","Queries with objectids are not supported");const L=rr.fromJSON(l),N=Fu(e.outSpatialReference,L),G=N.isWGS84?null:s0t(N,c),V=tLi(y,c),Y=Q4i(I),X=eLi(O),te=v??(S!=null&&S!==void 0?10:s),{data:re}=await ir(p.href,{...i,query:{...a,...V,crs:G,datetime:Y,query:X,limit:te,startindex:S,token:o},headers:{accept:"application/geo+json"}});let fe=!1;re.links&&(fe=!!re.links.find(Pe=>Pe.rel==="next")),!fe&&Number.isInteger(re.numberMatched)&&Number.isInteger(re.numberReturned)&&(fe=re.numberReturnedr.rel===e&&r.type===i)||t.find(r=>r.rel===e&&!r.type)}function rLi({coords:t,lengths:e}){let i=0;for(const r of e){for(let n=1;n!(r.objectId&&i.has(r.objectId)))}append(e){for(const i of e)this._features.push(i)}getSize(){return this._features.length}getCursor(){return this.copy()}getQuantizationTransform(){return this._transform}getAttributeHash(){let e="";for(const i in this._current.attributes)e+=this._current.attributes[i];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}getGroupId(){return this._current.groupId}setGroupId(e){this._current.groupId=e}copy(){const e=new lH(this.instance,this._features,this.fullSchema());return this.copyInto(e),e}next(){for(;++this._featureIndexi.toLowerCase()).includes(e.toLowerCase())}getFieldNames(){return Object.keys(this._current.attributes)}_readAttribute(e,i){const r=this._current.attributes[e];if(r!==void 0)return r!=null&&i&&this._dateFields.has(e)?new Date(r):r;const n=this.readAttributes(),s=e?.toLocaleLowerCase().trim();for(const o in n)if(o.toLocaleLowerCase().trim()===s){const a=this._current.attributes[o];return a!=null&&i&&this._dateFields.has(o)?new Date(a):a}}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._transform=this._transform,e._dateFields=this._dateFields}_readAttributes(){return this._current.attributes}};const LDe=268435455;let nLi=class{constructor(){this.fieldMap=new Map,this.fields=[],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}hasField(e){return this.fieldMap.has(e)}isDateField(e){return(e!=null&&this.fieldMap.get(e)?.isDate)??!1}getFieldIndex(e){return e!=null?this.fieldMap.get(e)?.index:void 0}};function sLi(t){const r=t.asUnsafe(),n=r.getLength(),s=r.pos()+n,o={name:"",isDate:!1};for(;r.pos()0}let pLi=class _Be extends jN{static fromBuffer(e,i,r=!1){const n=i.geometryType,s=uLi(e),o=aLi(s,n==="esriGeometryPoint",r),a=jN.createInstance();return new _Be(a,s,o,i)}constructor(e,i,r,n){super(e,n),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._geometryType=n.geometryType,this._reader=i,this._header=r,this._hasNext=r.hasFeatures,this._isPoints=n.geometryType==="esriGeometryPoint"}get geometryType(){return this._geometryType}get _size(){return this._header.featureCount}get hasZ(){return!1}get hasM(){return!1}get stride(){return 2+(this.hasZ?1:0)+(this.hasM?1:0)}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}hasField(e){return this._header.hasField(e)||this._header.hasField(u0t(e))}getFieldNames(){return this._header.fields.map(e=>e.fieldName)}getSize(){return this._size}getQuantizationTransform(){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="";return this._header.fields.forEach(({index:i})=>{e+=this._readAttributeAtIndex(i)+"."}),e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}getGroupId(){return this._header.groupIds[this._featureIndex]}setGroupId(e){this._header.groupIds[this._featureIndex]=e}readLegacyFeature(){if(this._cache.legacyFeature===void 0){const e=this.readCentroid(),i={attributes:this.readAttributes(),geometry:this._isPoints?this.readLegacyPointGeometry():this.readLegacyGeometry(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null};return this._cache.legacyFeature=i,i}return this._cache.legacyFeature}readOptimizedFeature(){if(this._cache.optFeature===void 0){const e=new o_(this.readGeometry(),this.readAttributes(),this.readCentroid());return e.objectId=this.getObjectId(),e.displayId=this.getDisplayId(),this._cache.optFeature=e,e}return this._cache.optFeature}getXHydrated(){const e=this._header.centroid[2*this._featureIndex],i=this.getQuantizationTransform();return lt(i)?e:e*i.scale[0]+i.translate[0]}getYHydrated(){const e=this._header.centroid[2*this._featureIndex+1],i=this.getQuantizationTransform();return lt(i)?e:i.translate[1]-e*i.scale[1]}getX(){return this._header.centroid[2*this._featureIndex]*this._sx+this._tx}getY(){return this._header.centroid[2*this._featureIndex+1]*this._sy+this._ty}readLegacyPointGeometry(){return{x:this.getX(),y:this.getY()}}readLegacyGeometry(e){const i=this.readGeometry(e);return cw(i,this.geometryType,!1,!1)}readLegacyCentroid(){const e=this.readCentroid();if(!e)return null;const[i,r]=e.coords;return{x:i,y:r}}readGeometryArea(){return this._cache.area||this.readGeometry(!0),this._cache.area}readUnquantizedGeometry(e=!1){if(this._cache.unquantGeometry===void 0){const i=this.readGeometry(e);if(!i)return this._cache.unquantGeometry=void 0,null;const r=l0t(i.coords.length).decoded,n=i.clone(r),s=n.coords;let o=0;for(const a of n.lengths){for(let l=1;l{e[i]=this._readAttributeAtIndex(r)}),e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext}_readAttributeAtIndex(e){const i=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],r=this._reader;return r.move(i),hLi(r)}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex]+this._tx,i=this._header.centroid[2*this._featureIndex+1]+this._ty;return e===kDe?null:new Sl([],[e,i])}_parseGeometry(e){const n=e.asUnsafe(),s=n.getLength(),o=n.pos()+s,a=[],l=[];for(;n.pos()p.length)for(let O=0;O=O?(y+=-.5*(ge-V)*(_e+Y),N>1&&NDe(p[d-2],p[d-1],X,te)?(p[d-2]+=X,p[d-1]+=te):(p[d++]=X,p[d++]=te,N++),V=ge,Y=_e):(re+=X,fe+=te),X=re,te=fe,L++}N<3||G?d-=2*N:(y+=-.5*(V+X-V)*(Y+te+Y),NDe(p[d-2],p[d-1],X,te)?(p[d-2]+=X,p[d-1]+=te,l.push(N)):(p[d++]=X,p[d++]=te,l.push(++N)))}else{let O=0,L=n.getSInt32(),N=n.getSInt32();this.hasZ&&n.getSInt32(),this.hasM&&n.getSInt32(),p[d++]=L,p[d++]=N,O+=1;for(let G=1;G2&&NDe(p[d-2],p[d-1],V,Y)?(p[d-2]+=V,p[d-1]+=Y):(p[d++]=V,p[d++]=Y,O+=1),L=X,N=te}l.push(O)}break}default:n.skip()}if(this._cache.area=y,!l.length)return null;if(this._tx||this._ty){let S=0;ig(p);for(const I of l)p[2*S]+=this._tx,p[2*S+1]+=this._ty,S+=I}return new Sl(l,p)}},dpe=class{constructor(e){this.service=e}destroy(){}};function fLi(t){return Array.isArray(t.source)}function mLi(t){return t?.type==="ogc-source"}function gLi(t){const{capabilities:e}=t;return mLi(t.source)?new wLi(t):fLi(t)?new vLi(t):e.query.supportsFormatPBF&&Gi("featurelayer-pbf")?new _Li(t):new bLi(t)}async function yLi(t){const e=new fHe;return await e.open(t,{}),e}let vLi=class extends dpe{constructor(e){super(e),this._portsOpen=yLi(e.source).then(i=>this.client=i)}destroy(){this.client.close(),this.client=null}async executeQuery(e,i){await this._portsOpen;const r=await this.client.invoke("queryFeatures",e.toJSON(),i);return Sv.fromFeatureSet(r,this.service)}},_Li=class extends dpe{async executeQuery(e,i){const{data:r}=await EJe(this.service.source,e,i),n=!e.quantizationParameters;return pLi.fromBuffer(r,this.service,n)}},bLi=class extends dpe{async executeQuery(e,i){const{source:r,capabilities:n,spatialReference:s,objectIdField:o,geometryType:a}=this.service;if(ye(e.quantizationParameters)&&!n.query.supportsQuantization){const c=e.clone(),d=yde(c.quantizationParameters);c.quantizationParameters=null;const{data:p}=await AB(r,c,s,i),y=ETe(p,o);return VJe(d,y),Sv.fromOptimizedFeatureSet(y,this.service)}const{data:l}=await AB(r,e,this.service.spatialReference,i);return a==="esriGeometryPoint"&&(l.features=l.features?.filter(c=>{if(ye(c.geometry)){const d=c.geometry;return Number.isFinite(d.x)&&Number.isFinite(d.y)}return!0})),Sv.fromFeatureSet(l,this.service)}},wLi=class extends dpe{async executeQuery(e,i){const{capabilities:r}=this.service;if(e.quantizationParameters&&!r.query.supportsQuantization){const s=e.clone(),o=yde(s.quantizationParameters);s.quantizationParameters=null;const a=await DDe(this.service.source,e,i);return VJe(o,a),Sv.fromOptimizedFeatureSet(a,this.service)}const n=await DDe(this.service.source,e,i);return Sv.fromOptimizedFeatureSet(n,this.service)}},D_=class e_e{constructor(){this.version=0,this.source=!1,this.targets={feature:!1,aggregate:!1},this.storage={filters:!1,data:!1},this.mesh=!1,this.queryFilter=!1,this.why={mesh:[],source:[]}}static create(e){const i=new e_e;for(const r in e){const n=e[r];if(typeof n=="object")for(const s in n){const o=n[s];i[r][s]=o}i[r]=n}return i}static empty(){return e_e.create({})}static all(){return e_e.create({source:!0,targets:{feature:!0,aggregate:!0},storage:{filters:!0,data:!0},mesh:!0})}unset(e){this.version=e.version,e.source&&(this.source=!1),e.targets.feature&&(this.targets.feature=!1),e.targets.aggregate&&(this.targets.aggregate=!1),e.storage.filters&&(this.storage.filters=!1),e.storage.data&&(this.storage.data=!1),e.mesh&&(this.mesh=!1),e.queryFilter&&(this.queryFilter=!1)}any(){return this.source||this.mesh||this.storage.filters||this.storage.data||this.targets.feature||this.targets.aggregate||this.queryFilter}describe(){let e=0,i="";if(this.mesh){e+=20,i+=`-> (20) Mesh needs update + `)();return()=>new r}catch{return()=>({[e]:null,...t})}}function byt(t={}){return[{name:"New Feature",description:"",prototype:{attributes:gi(t)}}]}function oDe(t,e){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:t},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},query:iyt,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}}}const LDi=iG("esriGeometryPoint"),NDi=["csv"],kDi=[0,0];let $Di=class{constructor(e,i){this.x=e,this.y=i}},BDi=class{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const i=await this._fetch(e);return this._createFeatures(i)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,i={}){this._loadOptions=e;const[r]=await Promise.all([this._fetch(i.signal),this._checkProjection(e?.parsingOptions?.spatialReference)]),n=VDi(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:c}=a;n.layerDefinition.timeInfo.timeExtent=[l,c]}return n}async applyEdits(){throw new st("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,i.signal)}async queryFeatureCount(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,i.signal)}async queryObjectIds(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,i.signal)}async queryExtent(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,i.signal)}async querySnapping(e,i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,i.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=CC(this._snapshotFeatures),this._snapshotTask.promise.then(n=>{this._queryEngine.featureStore.clear(),n&&this._queryEngine.featureStore.addMany(n)},n=>{this._queryEngine.featureStore.clear(),ys(n)||Oi.getLogger("esri.layers.CSVLayer").error(new st("csv-layer:refresh","An error occurred during refresh",{error:n}))}),await this._waitSnapshotComplete();const{fullExtent:i,timeExtent:r}=await this._queryEngine.fetchRecomputedExtents();return{extent:i,timeExtent:r}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:i,customParameters:r}=this._loadOptions;if(!i)throw new st("csv-layer:invalid-source","url not defined");const n=fa(i);return(await ur(n.path,{query:{...n.query,...r},responseType:"text",signal:e})).data}_createQueryEngine(e){const{objectIdField:i,fields:r,extent:n,timeInfo:s}=e.layerDefinition,o=new xJ({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new Bk({fields:r,geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:s,objectIdField:i,spatialReference:n.spatialReference||{wkid:4326},cacheSpatialQueries:!0,featureStore:o})}async _createFeatures(e){const{latitudeFieldName:i,longitudeFieldName:r}=this._locationInfo,{objectIdField:n,fieldsIndex:s,spatialReference:o}=this._queryEngine;let a=[];const l=[],c=s.fields.filter(x=>x.name!==n).map(x=>x.name);let h=0;const p={};for(const x of s.fields)if(x.type!=="esriFieldTypeOID"&&x.type!=="esriFieldTypeGlobalID"){const I=One(x);I!==void 0&&(p[x.name]=I)}const y=gyt(e,c,this._delimiter,sDe(p,n));for(const x of y){const I=this._parseCoordinateValue(x[i]),P=this._parseCoordinateValue(x[r]);if(P!=null&&I!=null&&!isNaN(I)&&!isNaN(P)){x[i]=I,x[r]=P;for(const F in x)if(F!==i&&F!==r){if(s.isDateField(F)){const k=new Date(x[F]);x[F]=_yt(k,x[F])?k.getTime():null}else if(s.isNumericField(F)){const k=nDe(x[F]);isNaN(k)?x[F]=null:x[F]=k}}x[n]=h,h++,a.push(new $Di(P,I)),l.push(x)}}if(!Da({wkid:4326},o))if(Xb(o))for(const x of a)[x.x,x.y]=Z3(x.x,x.y,kDi);else a=Uq(Su,a,hr.WGS84,o,null,null);const v=[];for(let x=0;x181)&&(i=parseFloat(e)),i}async _checkProjection(e){try{await hy($f,e)}catch{throw new st("csv-layer:projection-not-supported","Projection not supported")}}};function VDi(t,e){const i=e.parsingOptions||{},r={delimiter:i.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:i.latitudeField,longitudeFieldName:i.longitudeField}},n=r.layerDefinition={name:tne(e.url,NDi)||"csv",drawingInfo:LDi,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:i.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:i.spatialReference||{wkid:4326}}},s=fyt(t),o=s.next().value?.trim(),a=s.next().value?.trim();if(!o)throw new st("csv-layer:empty-csv","CSV is empty",{csv:t});const{delimiter:l,locationInfo:c}=TDi(o,a,i);if(!l)throw new st("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV",{firstLine:o,secondLine:a,parsingOptions:i});if(!c)throw new st("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file",{firstLine:o,secondLine:a,parsingOptions:i});r.locationInfo=c,r.delimiter=l;const{names:h,aliases:p}=yyt(o,l),y=IDi(t,r.delimiter,h,p,r.locationInfo);if(i.fields?.length){const x=new Lm(i.fields);for(const I of y){const P=x.get(I.name);P&&Object.assign(I,P)}}if(!y.some(x=>x.type==="esriFieldTypeOID"&&(n.objectIdField=x.name,!0))){const x={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};n.objectIdField=x.name,y.unshift(x)}n.fields=y;const v=new Lm(n.fields);if(r.locationInfo&&(r.locationInfo.latitudeFieldName=v.get(r.locationInfo.latitudeFieldName).name,r.locationInfo.longitudeFieldName=v.get(r.locationInfo.longitudeFieldName).name),n.timeInfo){const x=n.timeInfo;if(x.startTimeField){const I=v.get(x.startTimeField);I?(x.startTimeField=I.name,I.type="esriFieldTypeDate"):x.startTimeField=null}if(x.endTimeField){const I=v.get(x.endTimeField);I?(x.endTimeField=I.name,I.type="esriFieldTypeDate"):x.endTimeField=null}if(x.trackIdField){const I=v.get(x.trackIdField);x.trackIdField=I?I.name:null}x.startTimeField||x.endTimeField||(n.timeInfo=null)}return r}const jDi=Object.freeze(Object.defineProperty({__proto__:null,default:BDi},Symbol.toStringTag,{value:"Module"}));let aDe=class{constructor(e,i,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=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,a):new o(i,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,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getMat(e,i){let r=e*this.typedBufferStride;for(let n=0;n<9;n++)i[n]=this.typedBuffer[r++];return i}setMat(e,i){let r=e*this.typedBufferStride;for(let n=0;n<9;n++)this.typedBuffer[r++]=i[n]}get(e,i){return this.typedBuffer[e*this.typedBufferStride+i]}set(e,i,r){this.typedBuffer[e*this.typedBufferStride+i]=r}copyFrom(e,i,r){const n=this.typedBuffer,s=i.typedBuffer;let o=e*this.typedBufferStride,a=r*i.typedBufferStride;for(let l=0;l<9;++l)n[o++]=s[a++]}get buffer(){return this.typedBuffer.buffer}};aDe.ElementCount=9;let lDe=class{constructor(e,i,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=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,a):new o(i,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,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getMat(e,i){let r=e*this.typedBufferStride;for(let n=0;n<16;n++)i[n]=this.typedBuffer[r++];return i}setMat(e,i){let r=e*this.typedBufferStride;for(let n=0;n<16;n++)this.typedBuffer[r++]=i[n]}get(e,i){return this.typedBuffer[e*this.typedBufferStride+i]}set(e,i,r){this.typedBuffer[e*this.typedBufferStride+i]=r}copyFrom(e,i,r){const n=this.typedBuffer,s=i.typedBuffer;let o=e*this.typedBufferStride,a=r*i.typedBufferStride;for(let l=0;l<16;++l)n[o++]=s[a++]}get buffer(){return this.typedBuffer.buffer}};lDe.ElementCount=16;let qP=class{constructor(e,i,r=0,n,s){this.TypedArrayConstructor=e,this.elementCount=1;const o=this.TypedArrayConstructor;n===void 0&&(n=o.BYTES_PER_ELEMENT);const a=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,a):new o(i,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,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,i){this.typedBuffer[e*this.typedBufferStride]=i}get buffer(){return this.typedBuffer.buffer}};qP.ElementCount=1;let YP=class{constructor(e,i,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=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,a):new o(i,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,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getVec(e,i){return e*=this.typedBufferStride,ga(i,this.typedBuffer[e],this.typedBuffer[e+1])}setVec(e,i){e*=this.typedBufferStride,this.typedBuffer[e++]=i[0],this.typedBuffer[e]=i[1]}get(e,i){return this.typedBuffer[e*this.typedBufferStride+i]}set(e,i,r){this.typedBuffer[e*this.typedBufferStride+i]=r}setValues(e,i,r){e*=this.typedBufferStride,this.typedBuffer[e++]=i,this.typedBuffer[e]=r}copyFrom(e,i,r){const n=this.typedBuffer,s=i.typedBuffer;let o=e*this.typedBufferStride,a=r*i.typedBufferStride;n[o++]=s[a++],n[o]=s[a]}get buffer(){return this.typedBuffer.buffer}};YP.ElementCount=2;let XP=class{constructor(e,i,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=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,a):new o(i,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,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getVec(e,i){return e*=this.typedBufferStride,Rl(i,this.typedBuffer[e],this.typedBuffer[e+1],this.typedBuffer[e+2])}setVec(e,i){e*=this.typedBufferStride,this.typedBuffer[e++]=i[0],this.typedBuffer[e++]=i[1],this.typedBuffer[e]=i[2]}get(e,i){return this.typedBuffer[e*this.typedBufferStride+i]}set(e,i,r){this.typedBuffer[e*this.typedBufferStride+i]=r}setValues(e,i,r,n){e*=this.typedBufferStride,this.typedBuffer[e++]=i,this.typedBuffer[e++]=r,this.typedBuffer[e]=n}copyFrom(e,i,r){const n=this.typedBuffer,s=i.typedBuffer;let o=e*this.typedBufferStride,a=r*i.typedBufferStride;n[o++]=s[a++],n[o++]=s[a++],n[o]=s[a]}get buffer(){return this.typedBuffer.buffer}};XP.ElementCount=3;let KP=class{constructor(e,i,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=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,a):new o(i,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,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getVec(e,i){return e*=this.typedBufferStride,Wy(i,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,i){e*=this.typedBufferStride,this.typedBuffer[e++]=i[0],this.typedBuffer[e++]=i[1],this.typedBuffer[e++]=i[2],this.typedBuffer[e]=i[3]}get(e,i){return this.typedBuffer[e*this.typedBufferStride+i]}set(e,i,r){this.typedBuffer[e*this.typedBufferStride+i]=r}setValues(e,i,r,n,s){e*=this.typedBufferStride,this.typedBuffer[e++]=i,this.typedBuffer[e++]=r,this.typedBuffer[e++]=n,this.typedBuffer[e]=s}copyFrom(e,i,r){const n=this.typedBuffer,s=i.typedBuffer;let o=e*this.typedBufferStride,a=r*i.typedBufferStride;n[o++]=s[a++],n[o++]=s[a++],n[o++]=s[a++],n[o]=s[a]}get buffer(){return this.typedBuffer.buffer}};KP.ElementCount=4;let uDe=class m5t extends qP{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}static fromTypedArray(e,i){return new m5t(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};uDe.ElementType="f32";let DD=class j9e extends YP{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}slice(e,i){return this.sliceBuffer(j9e,e,i)}static fromTypedArray(e,i){return new j9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};DD.ElementType="f32";let _c=class G9e extends XP{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}slice(e,i){return this.sliceBuffer(G9e,e,i)}static fromTypedArray(e,i){return new G9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};_c.ElementType="f32";let lS=class U9e extends KP{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}slice(e,i){return this.sliceBuffer(U9e,e,i)}static fromTypedArray(e,i){return new U9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};lS.ElementType="f32";let cDe=class z9e extends aDe{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}slice(e,i){return this.sliceBuffer(z9e,e,i)}static fromTypedArray(e,i){return new z9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};cDe.ElementType="f32";let hDe=class H9e extends aDe{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(H9e,e,i)}static fromTypedArray(e,i){return new H9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};hDe.ElementType="f64";let dDe=class W9e extends lDe{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}slice(e,i){return this.sliceBuffer(W9e,e,i)}static fromTypedArray(e,i){return new W9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};dDe.ElementType="f32";let pDe=class q9e extends lDe{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(q9e,e,i)}static fromTypedArray(e,i){return new q9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};pDe.ElementType="f64";let fDe=class Y9e extends qP{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(Y9e,e,i)}static fromTypedArray(e,i){return new Y9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};fDe.ElementType="f64";let mDe=class X9e extends YP{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(X9e,e,i)}static fromTypedArray(e,i){return new X9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};mDe.ElementType="f64";let em=class K9e extends XP{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(K9e,e,i)}static fromTypedArray(e,i){return new K9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};em.ElementType="f64";let gDe=class J9e extends KP{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(J9e,e,i)}static fromTypedArray(e,i){return new J9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};gDe.ElementType="f64";let Qde=class Z9e extends qP{constructor(e,i=0,r,n){super(Uint8Array,e,i,r,n),this.elementType="u8"}slice(e,i){return this.sliceBuffer(Z9e,e,i)}static fromTypedArray(e,i){return new Z9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Qde.ElementType="u8";let epe=class Q9e extends YP{constructor(e,i=0,r,n){super(Uint8Array,e,i,r,n),this.elementType="u8"}slice(e,i){return this.sliceBuffer(Q9e,e,i)}static fromTypedArray(e,i){return new Q9e(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};epe.ElementType="u8";let Vk=class eBe extends XP{constructor(e,i=0,r,n){super(Uint8Array,e,i,r,n),this.elementType="u8"}slice(e,i){return this.sliceBuffer(eBe,e,i)}static fromTypedArray(e,i){return new eBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Vk.ElementType="u8";let uS=class tBe extends KP{constructor(e,i=0,r,n){super(Uint8Array,e,i,r,n),this.elementType="u8"}slice(e,i){return this.sliceBuffer(tBe,e,i)}static fromTypedArray(e,i){return new tBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};uS.ElementType="u8";let tpe=class iBe extends qP{constructor(e,i=0,r,n){super(Uint16Array,e,i,r,n),this.elementType="u16"}slice(e,i){return this.sliceBuffer(iBe,e,i)}static fromTypedArray(e,i){return new iBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};tpe.ElementType="u16";let yDe=class rBe extends YP{constructor(e,i=0,r,n){super(Uint16Array,e,i,r,n),this.elementType="u16"}slice(e,i){return this.sliceBuffer(rBe,e,i)}static fromTypedArray(e,i){return new rBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};yDe.ElementType="u16";let CJ=class nBe extends XP{constructor(e,i=0,r,n){super(Uint16Array,e,i,r,n),this.elementType="u16"}slice(e,i){return this.sliceBuffer(nBe,e,i)}static fromTypedArray(e,i){return new nBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};CJ.ElementType="u16";let rG=class sBe extends KP{constructor(e,i=0,r,n){super(Uint16Array,e,i,r,n),this.elementType="u16"}slice(e,i){return this.sliceBuffer(sBe,e,i)}static fromTypedArray(e,i){return new sBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};rG.ElementType="u16";let ipe=class oBe extends qP{constructor(e,i=0,r,n){super(Uint32Array,e,i,r,n),this.elementType="u32"}slice(e,i){return this.sliceBuffer(oBe,e,i)}static fromTypedArray(e,i){return new oBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};ipe.ElementType="u32";let vDe=class aBe extends YP{constructor(e,i=0,r,n){super(Uint32Array,e,i,r,n),this.elementType="u32"}slice(e,i){return this.sliceBuffer(aBe,e,i)}static fromTypedArray(e,i){return new aBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};vDe.ElementType="u32";let wyt=class lBe extends XP{constructor(e,i=0,r,n){super(Uint32Array,e,i,r,n),this.elementType="u32"}slice(e,i){return this.sliceBuffer(lBe,e,i)}static fromTypedArray(e,i){return new lBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};wyt.ElementType="u32";let xyt=class uBe extends KP{constructor(e,i=0,r,n){super(Uint32Array,e,i,r,n),this.elementType="u32"}slice(e,i){return this.sliceBuffer(uBe,e,i)}static fromTypedArray(e,i){return new uBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};xyt.ElementType="u32";let _De=class cBe extends qP{constructor(e,i=0,r,n){super(Int8Array,e,i,r,n),this.elementType="i8"}slice(e,i){return this.sliceBuffer(cBe,e,i)}static fromTypedArray(e,i){return new cBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};_De.ElementType="i8";let rpe=class hBe extends YP{constructor(e,i=0,r,n){super(Int8Array,e,i,r,n),this.elementType="i8"}slice(e,i){return this.sliceBuffer(hBe,e,i)}static fromTypedArray(e,i){return new hBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};rpe.ElementType="i8";let Syt=class dBe extends XP{constructor(e,i=0,r,n){super(Int8Array,e,i,r,n),this.elementType="i8"}slice(e,i){return this.sliceBuffer(dBe,e,i)}static fromTypedArray(e,i){return new dBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Syt.ElementType="i8";let Cyt=class pBe extends KP{constructor(e,i=0,r,n){super(Int8Array,e,i,r,n),this.elementType="i8"}slice(e,i){return this.sliceBuffer(pBe,e,i)}static fromTypedArray(e,i){return new pBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Cyt.ElementType="i8";let Tyt=class fBe extends qP{constructor(e,i=0,r,n){super(Int16Array,e,i,r,n),this.elementType="i16"}slice(e,i){return this.sliceBuffer(fBe,e,i)}static fromTypedArray(e,i){return new fBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Tyt.ElementType="i16";let npe=class mBe extends YP{constructor(e,i=0,r,n){super(Int16Array,e,i,r,n),this.elementType="i16"}slice(e,i){return this.sliceBuffer(mBe,e,i)}static fromTypedArray(e,i){return new mBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};npe.ElementType="i16";let Eyt=class gBe extends XP{constructor(e,i=0,r,n){super(Int16Array,e,i,r,n),this.elementType="i16"}slice(e,i){return this.sliceBuffer(gBe,e,i)}static fromTypedArray(e,i){return new gBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Eyt.ElementType="i16";let Iyt=class yBe extends KP{constructor(e,i=0,r,n){super(Int16Array,e,i,r,n),this.elementType="i16"}slice(e,i){return this.sliceBuffer(yBe,e,i)}static fromTypedArray(e,i){return new yBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Iyt.ElementType="i16";let Ayt=class vBe extends qP{constructor(e,i=0,r,n){super(Int32Array,e,i,r,n),this.elementType="i32"}slice(e,i){return this.sliceBuffer(vBe,e,i)}static fromTypedArray(e,i){return new vBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Ayt.ElementType="i32";let Pyt=class _Be extends YP{constructor(e,i=0,r,n){super(Int32Array,e,i,r,n),this.elementType="i32"}slice(e,i){return this.sliceBuffer(_Be,e,i)}static fromTypedArray(e,i){return new _Be(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Pyt.ElementType="i32";let Oyt=class bBe extends XP{constructor(e,i=0,r,n){super(Int32Array,e,i,r,n),this.elementType="i32"}slice(e,i){return this.sliceBuffer(bBe,e,i)}static fromTypedArray(e,i){return new bBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Oyt.ElementType="i32";let Ryt=class wBe extends KP{constructor(e,i=0,r,n){super(Int32Array,e,i,r,n),this.elementType="i32"}slice(e,i){return this.sliceBuffer(wBe,e,i)}static fromTypedArray(e,i){return new wBe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Ryt.ElementType="i32";function Myt(t){switch(t){case"u8":case"i8":return 1;case"u16":case"i16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}function GDi(t){switch(t){case"u8":case"u16":case"u32":return!1;case"i8":case"i16":case"i32":case"f32":case"f64":return!0}}function UDi(t){switch(t){case"u8":case"u16":case"u32":case"i8":case"i16":case"i32":return!0;case"f32":case"f64":return!1}}function zDi(t){switch(t){case"u8":return 255;case"u16":return 65535;case"u32":return 4294967295;case"i8":return 127;case"i16":return 32767;case"i32":return 2147483647;case"f32":return 3402823e32;case"f64":return 179769e303}}let Dyt=class g5t{constructor(e,i){this.layout=e,this.buffer=typeof i=="number"?new ArrayBuffer(i*e.stride):i;for(const r of e.fieldNames){const n=e.fields.get(r);this[r]=new n.constructor(this.buffer,n.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,i){const r=this[e];return r&&r.elementCount===i.ElementCount&&r.elementType===i.ElementType?r:null}slice(e,i){return new g5t(this.layout,this.buffer.slice(e*this.stride,i*this.stride))}copyFrom(e,i,r,n){const s=this.stride;if(s%4==0){const o=new Uint32Array(e.buffer,i*s,n*s/4);new Uint32Array(this.buffer,r*s,n*s/4).set(o)}else{const o=new Uint8Array(e.buffer,i*s,n*s);new Uint8Array(this.buffer,r*s,n*s).set(o)}}},HDi=class y5t{constructor(){this.stride=0,this.fields=new Map,this.fieldNames=[]}vec2f(e,i){return this._appendField(e,DD,i),this}vec2f64(e,i){return this._appendField(e,mDe,i),this}vec3f(e,i){return this._appendField(e,_c,i),this}vec3f64(e,i){return this._appendField(e,em,i),this}vec4f(e,i){return this._appendField(e,lS,i),this}vec4f64(e,i){return this._appendField(e,gDe,i),this}mat3f(e,i){return this._appendField(e,cDe,i),this}mat3f64(e,i){return this._appendField(e,hDe,i),this}mat4f(e,i){return this._appendField(e,dDe,i),this}mat4f64(e,i){return this._appendField(e,pDe,i),this}vec4u8(e,i){return this._appendField(e,uS,i),this}f32(e,i){return this._appendField(e,uDe,i),this}f64(e,i){return this._appendField(e,fDe,i),this}u8(e,i){return this._appendField(e,Qde,i),this}u16(e,i){return this._appendField(e,tpe,i),this}i8(e,i){return this._appendField(e,_De,i),this}vec2i8(e,i){return this._appendField(e,rpe,i),this}vec2i16(e,i){return this._appendField(e,npe,i),this}vec2u8(e,i){return this._appendField(e,epe,i),this}vec4u16(e,i){return this._appendField(e,rG,i),this}u32(e,i){return this._appendField(e,ipe,i),this}_appendField(e,i,r){const n=i.ElementCount*Myt(i.ElementType),s=this.stride;this.fields.set(e,{size:n,constructor:i,offset:s,optional:r}),this.stride+=n,this.fieldNames.push(e)}alignTo(e){return this.stride=Math.floor((this.stride+e-1)/e)*e,this}hasField(e){return this.fieldNames.includes(e)}createBuffer(e){return new Dyt(this,e)}createView(e){return new Dyt(this,e)}clone(){const e=new y5t;return e.stride=this.stride,e.fields=new Map,this.fields.forEach((i,r)=>e.fields.set(r,i)),e.fieldNames=this.fieldNames.slice(),e.BufferType=this.BufferType,e}};function nG(){return new HDi}function spe(t,e){return e.push(t.buffer),{buffer:t.buffer,layout:WDi(t.layout)}}function WDi(t){const e=new Array;return t.fields.forEach((i,r)=>{const n={...i,constructor:Fyt(i.constructor)};e.push([r,n])}),{stride:t.stride,fields:e,fieldNames:t.fieldNames}}const qDi=[uDe,DD,_c,lS,cDe,dDe,fDe,mDe,em,gDe,hDe,pDe,Qde,epe,Vk,uS,tpe,yDe,CJ,rG,ipe,vDe,wyt,xyt,_De,rpe,Syt,Cyt,Tyt,npe,Eyt,Iyt,Ayt,Pyt,Oyt,Ryt];function Fyt(t){return`${t.ElementType}_${t.ElementCount}`}const YDi=new Map;qDi.forEach(t=>YDi.set(Fyt(t),t));var cE,bs,Sn,FD,fo,Jw,sG,Bi,kl,nu,In,ws,so,gn,qs,ds,xg,Xo,mb,tm,Ah,Tl;(function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT"})(cE||(cE={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(bs||(bs={})),function(t){t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"}(Sn||(Sn={})),function(t){t[t.ADD=32774]="ADD",t[t.SUBTRACT=32778]="SUBTRACT",t[t.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"}(FD||(FD={})),function(t){t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER"}(fo||(fo={})),function(t){t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(Jw||(Jw={})),function(t){t[t.CW=2304]="CW",t[t.CCW=2305]="CCW"}(sG||(sG={})),function(t){t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT"}(Bi||(Bi={})),function(t){t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS"}(kl||(kl={})),function(t){t[t.ZERO=0]="ZERO",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP"}(nu||(nu={})),function(t){t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(In||(In={})),function(t){t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(ws||(ws={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"}(so||(so={})),function(t){t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.RED=6403]="RED",t[t.RG=33319]="RG",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER"}(gn||(gn={})),function(t){t[t.RGBA4=32854]="RGBA4",t[t.R16F=33325]="R16F",t[t.RG16F=33327]="RG16F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.R32F=33326]="R32F",t[t.RG32F=33328]="RG32F",t[t.RGBA32F=34836]="RGBA32F",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB5_A1=32855]="RGB5_A1",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.RGB16F=34843]="RGB16F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.RGB565=36194]="RGB565",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2=32857]="RGB10_A2",t[t.RGB10_A2UI=36975]="RGB10_A2UI"}(qs||(qs={})),function(t){t[t.FLOAT=5126]="FLOAT",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.INT=5124]="INT",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"}(ds||(ds={})),function(t){t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"}(xg||(xg={})),function(t){t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_READ=35045]="STATIC_READ",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.STREAM_COPY=35042]="STREAM_COPY"}(Xo||(Xo={})),function(t){t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER"}(mb||(mb={})),function(t){t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"}(tm||(tm={})),function(t){t[t.TEXTURE=0]="TEXTURE",t[t.RENDER_BUFFER=1]="RENDER_BUFFER",t[t.CUBEMAP=2]="CUBEMAP"}(Ah||(Ah={})),function(t){t[t.NONE=0]="NONE",t[t.DEPTH_RENDER_BUFFER=1]="DEPTH_RENDER_BUFFER",t[t.STENCIL_RENDER_BUFFER=2]="STENCIL_RENDER_BUFFER",t[t.DEPTH_STENCIL_RENDER_BUFFER=3]="DEPTH_STENCIL_RENDER_BUFFER",t[t.DEPTH_STENCIL_TEXTURE=4]="DEPTH_STENCIL_TEXTURE"}(Tl||(Tl={}));const bDe=33984;var bf,Sv;(function(t){t[t.Texture=0]="Texture",t[t.BufferObject=1]="BufferObject",t[t.VertexArrayObject=2]="VertexArrayObject",t[t.Shader=3]="Shader",t[t.Program=4]="Program",t[t.FramebufferObject=5]="FramebufferObject",t[t.Renderbuffer=6]="Renderbuffer",t[t.Sync=7]="Sync",t[t.COUNT=8]="COUNT"})(bf||(bf={})),function(t){t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15"}(Sv||(Sv={}));const Lyt=33306;var nd,S0,Nyt,kyt,ope,wDe,$yt;(function(t){t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"})(nd||(nd={})),function(t){t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT=5124]="INT",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"}(S0||(S0={})),function(t){t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS"}(Nyt||(Nyt={})),function(t){t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED"}(kyt||(kyt={})),function(t){t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED"}(ope||(ope={})),function(t){t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"}(wDe||(wDe={})),function(t){t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"}($yt||($yt={}));let na=class{constructor(e,i,r,n,s,o=!1,a=0){this.name=e,this.count=i,this.type=r,this.offset=n,this.stride=s,this.normalized=o,this.divisor=a}};function xDe(t,e=0){const i=t.stride;return t.fieldNames.filter(r=>{const n=t.fields.get(r).optional;return!(n&&n.glPadding)}).map(r=>{const n=t.fields.get(r),s=n.constructor.ElementCount,o=XDi(n.constructor.ElementType),a=n.offset,l=!(!n.optional||!n.optional.glNormalized);return new na(r,s,o,a,i,l,e)})}function XDi(t){const e=KDi[t];if(e)return e;throw new Error("BufferType not supported in WebGL")}const KDi={u8:Bi.UNSIGNED_BYTE,u16:Bi.UNSIGNED_SHORT,u32:Bi.UNSIGNED_INT,i8:Bi.BYTE,i16:Bi.SHORT,i32:Bi.INT,f32:Bi.FLOAT};var Wr;(function(t){t.POSITION="position",t.NORMAL="normal",t.UV0="uv0",t.AUXPOS1="auxpos1",t.AUXPOS2="auxpos2",t.COLOR="color",t.SYMBOLCOLOR="symbolColor",t.SIZE="size",t.TANGENT="tangent",t.OFFSET="offset",t.SUBDIVISIONFACTOR="subdivisionFactor",t.COLORFEATUREATTRIBUTE="colorFeatureAttribute",t.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",t.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",t.DISTANCETOSTART="distanceToStart",t.UVMAPSPACE="uvMapSpace",t.BOUNDINGRECT="boundingRect",t.UVREGION="uvRegion",t.NORMALCOMPRESSED="normalCompressed",t.PROFILERIGHT="profileRight",t.PROFILEUP="profileUp",t.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",t.FEATUREVALUE="featureValue",t.MODELORIGINHI="modelOriginHi",t.MODELORIGINLO="modelOriginLo",t.MODEL="model",t.MODELNORMAL="modelNormal",t.INSTANCECOLOR="instanceColor",t.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",t.LOCALTRANSFORM="localTransform",t.GLOBALTRANSFORM="globalTransform",t.BOUNDINGSPHERE="boundingSphere",t.MODELORIGIN="modelOrigin",t.MODELSCALEFACTORS="modelScaleFactors",t.FEATUREATTRIBUTE="featureAttribute",t.STATE="state",t.LODLEVEL="lodLevel",t.POSITION0="position0",t.POSITION1="position1",t.NORMALA="normalA",t.NORMALB="normalB",t.COMPONENTINDEX="componentIndex",t.VARIANTOFFSET="variantOffset",t.VARIANTSTROKE="variantStroke",t.VARIANTEXTENSION="variantExtension",t.U8PADDING="u8padding",t.U16PADDING="u16padding",t.SIDENESS="sideness",t.START="start",t.END="end",t.UP="up",t.EXTRUDE="extrude",t.OBJECTANDLAYERIDCOLOR="objectAndLayerIdColor",t.OBJECTANDLAYERIDCOLOR_INSTANCED="objectAndLayerIdColor_instanced"})(Wr||(Wr={}));const Byt=nG().vec3f(Wr.POSITION).u16(Wr.COMPONENTINDEX).u16(Wr.U16PADDING),JDi=nG().vec2u8(Wr.SIDENESS);xDe(JDi);const Vyt=nG().vec3f(Wr.POSITION0).vec3f(Wr.POSITION1).u16(Wr.COMPONENTINDEX).u8(Wr.VARIANTOFFSET,{glNormalized:!0}).u8(Wr.VARIANTSTROKE).u8(Wr.VARIANTEXTENSION,{glNormalized:!0}).u8(Wr.U8PADDING,{glPadding:!0}).u16(Wr.U16PADDING,{glPadding:!0}),SDe=Vyt.clone().vec3f(Wr.NORMAL),CDe=Vyt.clone().vec3f(Wr.NORMALA).vec3f(Wr.NORMALB);Wr.POSITION0,Wr.POSITION1,Wr.COMPONENTINDEX,Wr.VARIANTOFFSET,Wr.VARIANTSTROKE,Wr.VARIANTEXTENSION,Wr.NORMAL,Wr.NORMALA,Wr.NORMALB,Wr.SIDENESS;const jk=-1;var jyt;function TDe(t,e,i,r=rFi){const n=t.vertices.position,s=t.vertices.componentIndex,o=ew(r.anglePlanar),a=ew(r.angleSignificantEdge),l=Math.cos(a),c=Math.cos(o),h=EDe.edge,p=h.position0,y=h.position1,v=h.faceNormal0,x=h.faceNormal1,I=iFi(t),P=tFi(t),F=P.length/4,k=e.allocate(F);let j=0;const V=F,Y=i.allocate(V);let X=0,Z=0,ie=0;const ce=GNt(0,F),he=new Float32Array(F);he.forEach((J,de,Se)=>{n.getVec(P[4*de+0],p),n.getVec(P[4*de+1],y),Se[de]=rR(p,y)}),ce.sort((J,de)=>he[de]-he[J]);const _e=new Array,xe=new Array;for(let J=0;Je}function eFi(t,e){const i=Z1e(t.cosAngle),r=EDe.fwd,n=EDe.ortho;return JGe(r,t.position1,t.position0),i*(Qb(e2(n,t.faceNormal0,t.faceNormal1),r)>0?-1:1)>e}function tFi(t){const e=t.faces.length/3,i=t.faces,r=t.neighbors;let n=0;for(let a=0;a=65536)return new Uint32Array(t);return new Uint16Array(t)}if(t.length=65536)return t;return new Uint16Array(t)}function Gyt(t){const e=3*t;return e<=uL?new Array(e):e<=65536?new Uint16Array(e):new Uint32Array(e)}let LD=(()=>{const t=new Uint32Array(131072);for(let e=0;e{const t=new Uint16Array(65536);for(let e=0;eLD.length){const e=Math.max(2*LD.length,t);LD=new Uint32Array(e);for(let i=0;iLD.length){const e=new Uint32Array(t);for(let i=0;ih&&(h=Z)}else h=n;const p=Math.floor(1.1*h)+1;(hE==null||hE.length<2*p)&&(hE=new Uint32Array(J1e(2*p)));for(let X=0;X<2*p;X++)hE[X]=0;let y=0;const v=!!c&&!!a,x=v?l:n;let I=Gyt(n/3);const P=new Uint32Array(l),F=1.96;let k=o!==0?Math.ceil(4*F*F/(o*o)*o*(1-o)):x,j=1,V=c?c[1]:x;for(let X=0;X=p&&(he-=p)}_e===y&&(hE[2*he]=ce,hE[2*he+1]=Z+1,y++),I[Z]=_e}if(o!==0&&1-y/n>>2)|0;return r>>>0}let hE=null;function zyt(t,e,i){const r=e/3,n=new Uint32Array(i+1),s=new Uint32Array(i+1),o=(F,k)=>{F{if(F{const j=2*F,V=k-F;for(let Y=1;Y=0&&c[j+2*ie]>X;ie--)c[j+2*ie+2]=c[j+2*ie],c[j+2*ie+3]=c[j+2*ie+1];c[j+2*ie+2]=X,c[j+2*ie+3]=Z}};for(let F=0;FF===t[3*k]?0:F===t[3*k+1]?1:F===t[3*k+2]?2:-1,I=(F,k)=>{const j=x(F,k);v[3*k+j]=-1},P=(F,k,j,V)=>{const Y=x(F,k);v[3*k+Y]=V;const X=x(j,V);v[3*V+X]=k};for(let F=0;Fnull,write:()=>{},trim:()=>null},bFi=Object.freeze(Object.defineProperty({__proto__:null,default:fFi},Symbol.toStringTag,{value:"Module"}));function im(){return[1,0,0,0,1,0,0,0,1]}function wFi(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]}function Jyt(t,e,i,r,n,s,o,a,l){return[t,e,i,r,n,s,o,a,l]}function Zyt(t,e){return new Float64Array(t,e,9)}Object.freeze(Object.defineProperty({__proto__:null,clone:wFi,create:im,createView:Zyt,fromValues:Jyt},Symbol.toStringTag,{value:"Module"}));function Cv(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function TJ(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}function xFi(t,e,i,r,n,s,o,a,l,c,h,p,y,v,x,I){return[t,e,i,r,n,s,o,a,l,c,h,p,y,v,x,I]}function Qyt(t,e){return new Float64Array(t,e,16)}const lG=Cv();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:lG,clone:TJ,create:Cv,createView:Qyt,fromValues:xFi},Symbol.toStringTag,{value:"Module"}));const SFi=new hr(Zje),e0t=new hr(y1e),t0t=new hr(v1e);new hr(Qje);function kD(t){return t&&(yL(t)||Da(t,e0t))?e0t:t&&(vL(t)||Da(t,t0t))?t0t:SFi}function Tv(){return[0,0,0,1]}function i0t(t){return[t[0],t[1],t[2],t[3]]}function CFi(t,e,i,r){return[t,e,i,r]}function r0t(t,e){return new Float64Array(t,e,4)}const n0t=Tv();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:n0t,clone:i0t,create:Tv,createView:r0t,fromValues:CFi},Symbol.toStringTag,{value:"Module"}));function TFi(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function $D(t,e,i){i*=.5;const r=Math.sin(i);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(i),t}function NDe(t,e){const i=2*Math.acos(e[3]),r=Math.sin(i/2);return r>qv()?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),i}function cpe(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3],a=i[0],l=i[1],c=i[2],h=i[3];return t[0]=r*h+o*a+n*c-s*l,t[1]=n*h+o*l+s*a-r*c,t[2]=s*h+o*c+r*l-n*a,t[3]=o*h-r*a-n*l-s*c,t}function EFi(t,e,i){i*=.5;const r=e[0],n=e[1],s=e[2],o=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=r*l+o*a,t[1]=n*l+s*a,t[2]=s*l-n*a,t[3]=o*l-r*a,t}function IFi(t,e,i){i*=.5;const r=e[0],n=e[1],s=e[2],o=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=r*l-s*a,t[1]=n*l+o*a,t[2]=s*l+r*a,t[3]=o*l-n*a,t}function AFi(t,e,i){i*=.5;const r=e[0],n=e[1],s=e[2],o=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=r*l+n*a,t[1]=n*l-r*a,t[2]=s*l+o*a,t[3]=o*l-s*a,t}function PFi(t,e){const i=e[0],r=e[1],n=e[2];return t[0]=i,t[1]=r,t[2]=n,t[3]=Math.sqrt(Math.abs(1-i*i-r*r-n*n)),t}function hpe(t,e,i,r){const n=e[0],s=e[1],o=e[2],a=e[3];let l,c,h,p,y,v=i[0],x=i[1],I=i[2],P=i[3];return c=n*v+s*x+o*I+a*P,c<0&&(c=-c,v=-v,x=-x,I=-I,P=-P),1-c>qv()?(l=Math.acos(c),h=Math.sin(l),p=Math.sin((1-r)*l)/h,y=Math.sin(r*l)/h):(p=1-r,y=r),t[0]=p*n+y*v,t[1]=p*s+y*x,t[2]=p*o+y*I,t[3]=p*a+y*P,t}function OFi(t){const e=ZH,i=e(),r=e(),n=e(),s=Math.sqrt(1-i),o=Math.sqrt(i);return t[0]=s*Math.sin(2*Math.PI*r),t[1]=s*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*n),t[3]=o*Math.cos(2*Math.PI*n),t}function RFi(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=i*i+r*r+n*n+s*s,a=o?1/o:0;return t[0]=-i*a,t[1]=-r*a,t[2]=-n*a,t[3]=s*a,t}function kDe(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function s0t(t,e){const i=e[0]+e[4]+e[8];let r;if(i>0)r=Math.sqrt(i+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[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),t[n]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+n]+e[3*n+s])*r,t[o]=(e[3*o+n]+e[3*n+o])*r}return t}function o0t(t,e,i,r){const n=.5*Math.PI/180;e*=n,i*=n,r*=n;const s=Math.sin(e),o=Math.cos(e),a=Math.sin(i),l=Math.cos(i),c=Math.sin(r),h=Math.cos(r);return t[0]=s*l*h-o*a*c,t[1]=o*a*h+s*l*c,t[2]=o*l*c-s*a*h,t[3]=o*l*h+s*a*c,t}function MFi(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}const DFi=q1e,FFi=Wy,LFi=eUe,NFi=cpe,kFi=nUe,$Fi=lUe,BFi=K1e,a0t=Y1e,VFi=a0t,l0t=X1e,jFi=l0t,$De=aUe,u0t=uUe,GFi=cUe;function UFi(t,e,i){const r=Qb(e,i);return r<-.999999?(e2(dE,zFi,e),QGe(dE)<1e-6&&e2(dE,HFi,e),Hy(dE,dE),$D(t,dE,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(e2(dE,e,i),t[0]=dE[0],t[1]=dE[1],t[2]=dE[2],t[3]=1+r,$De(t,t))}const dE=hn(),zFi=ja(1,0,0),HFi=ja(0,1,0);function WFi(t,e,i,r,n,s){return hpe(c0t,e,n,s),hpe(h0t,i,r,s),hpe(t,c0t,h0t,2*s*(1-s)),t}const c0t=Tv(),h0t=Tv();function qFi(t,e,i,r){const n=YFi;return n[0]=i[0],n[3]=i[1],n[6]=i[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],$De(t,s0t(t,n))}const YFi=im();Object.freeze(Object.defineProperty({__proto__:null,add:LFi,calculateW:PFi,conjugate:kDe,copy:DFi,dot:$Fi,equals:GFi,exactEquals:u0t,fromEuler:o0t,fromMat3:s0t,getAxisAngle:NDe,identity:TFi,invert:RFi,len:VFi,length:a0t,lerp:BFi,mul:NFi,multiply:cpe,normalize:$De,random:OFi,rotateX:EFi,rotateY:IFi,rotateZ:AFi,rotationTo:UFi,scale:kFi,set:FFi,setAxes:qFi,setAxisAngle:$D,slerp:hpe,sqlerp:WFi,sqrLen:jFi,squaredLength:l0t,str:MFi},Symbol.toStringTag,{value:"Module"}));function pE(t=KFi){return[t[0],t[1],t[2],t[3]]}function dpe(t,e,i=pE()){return Xv(i,t),i[3]=e,i}function BDe(t,e,i=pE()){return $D(fpe,t,ppe(t)),$D(d0t,e,ppe(e)),cpe(fpe,d0t,fpe),XFi(i,_ne(NDe(i,fpe)))}function w4r(t){return t}function ppe(t){return ew(t[3])}function XFi(t,e){return t[3]=e,t}const KFi=[0,0,1,0],fpe=Tv(),d0t=Tv();pE();const mpe=Oi.getLogger("esri.views.3d.support.buffer.math");function BD(t,e,i){if(t.count!==e.count)return void mpe.error("source and destination buffers need to have the same number of elements");const r=t.count,n=i[0],s=i[1],o=i[2],a=i[4],l=i[5],c=i[6],h=i[8],p=i[9],y=i[10],v=i[12],x=i[13],I=i[14],P=t.typedBuffer,F=t.typedBufferStride,k=e.typedBuffer,j=e.typedBufferStride;for(let V=0;V0){const x=1/Math.sqrt(v);r[l]=x*h,r[l+1]=x*p,r[l+2]=x*y}}}function p0t(t,e,i){const r=Math.min(t.count,e.count),n=t.typedBuffer,s=t.typedBufferStride,o=e.typedBuffer,a=e.typedBufferStride;for(let l=0;l>i,n[c+1]=o[h+1]>>i,n[c+2]=o[h+2]>>i}}Object.freeze(Object.defineProperty({__proto__:null,normalize:ype,scale:gpe,shiftRight:p0t,transformMat3:JP,transformMat4:BD},Symbol.toStringTag,{value:"Module"}));function vpe(t,e,i){const r=t.typedBuffer,n=t.typedBufferStride,s=e.typedBuffer,o=e.typedBufferStride,a=i?i.count:e.count;let l=(i&&i.dstIndex?i.dstIndex:0)*n,c=(i&&i.srcIndex?i.srcIndex:0)*o;for(let h=0;hnew Uint32Array(n))):this._createIndexAllThread(r,i)}_createIndexAllThread(e,i){const r=new Array(i.length/9);let n=0;for(let s=0;s!r.faces)?{position:i}:{position:i,components:e.components.map(r=>r.faces)}}_createPooledRBush(){return new HMe(9,Hi("esri-csp-restrictions")?e=>e:[".minX",".minY",".maxX",".maxY"])}};function x0t(t,e,i,r){return{minX:Math.min(t[e+0],t[i+0],t[r+0]),maxX:Math.max(t[e+0],t[i+0],t[r+0]),minY:Math.min(t[e+1],t[i+1],t[r+1]),maxY:Math.max(t[e+1],t[i+1],t[r+1]),p0:[t[e+0],t[e+1],t[e+2]],p1:[t[i+0],t[i+1],t[i+2]],p2:[t[r+0],t[r+1],t[r+2]]}}const f4i=Object.freeze(Object.defineProperty({__proto__:null,default:p4i},Symbol.toStringTag,{value:"Module"}));function S0t(t=!1,e){if(t){const{elevationInfo:i,alignPointsInFeatures:r,spatialReference:n}=e;return new y4i(i,r,n)}return new m4i}let m4i=class{async alignCandidates(e,i){return e}notifyElevationSourceChange(){}};const g4i=1024;let y4i=class{constructor(e,i,r){this._elevationInfo=e,this._alignPointsInFeatures=i,this.spatialReference=r,this._alignmentsCache=new C9(g4i),this._cacheVersion=0,this._metersPerVerticalUnit=J3(r)}async alignCandidates(e,i){const r=this._elevationInfo;return ve(r)&&r.mode==="absolute-height"&&!r.featureExpressionInfo?(this._alignAbsoluteElevationCandidates(e,r),e):this._alignComputedElevationCandidates(e,i)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}_alignAbsoluteElevationCandidates(e,i){const{offset:r,unit:n}=i;if(lt(r))return;const s=r*(Q7t(n??"meters")/this._metersPerVerticalUnit);for(const o of e)switch(o.type){case"edge":o.start.z+=s,o.end.z+=s;continue;case"vertex":o.target.z+=s;continue}}async _alignComputedElevationCandidates(e,i){const r=new Map;for(const p of e)bC(r,p.objectId,_4i).push(p);const[n,s,o]=this._prepareQuery(r),a=await this._alignPointsInFeatures(n,i);if(yn(i),o!==this._cacheVersion)return this._alignComputedElevationCandidates(e,i);this._applyCacheAndResponse(n,a,s);const{drapedObjectIds:l,failedObjectIds:c}=a,h=[];for(const p of e){const{objectId:y}=p;l.has(y)&&p.type==="edge"&&(p.draped=!0),c.has(y)||h.push(p)}return h}_prepareQuery(e){const i=[],r=[];for(const[n,s]of e){const o=[];for(const a of s)this._addToQueriesOrCachedResult(n,a.target,o,r),a.type==="edge"&&(this._addToQueriesOrCachedResult(n,a.start,o,r),this._addToQueriesOrCachedResult(n,a.end,o,r));o.length!==0&&i.push({objectId:n,points:o})}return[i,r,this._cacheVersion]}_addToQueriesOrCachedResult(e,i,r,n){const s=C0t(e,i),o=this._alignmentsCache.get(s);ve(o)?n.push(new v4i(i,o)):r.push(i)}_applyCacheAndResponse(e,{elevations:i,drapedObjectIds:r,failedObjectIds:n},s){for(const l of s)l.apply();let o=0;const a=this._alignmentsCache;for(const{objectId:l,points:c}of e){if(n.has(l)){o+=c.length;continue}const h=!r.has(l);for(const p of c){const y=C0t(l,p),v=i[o++];p.z=v,h&&a.put(y,v,1)}}}},v4i=class{constructor(e,i){this.point=e,this.z=i}apply(){this.point.z=this.z}};function C0t(t,{x:e,y:i,z:r}){return`${t}-${e}-${i}-${r??0}}`}function _4i(){return[]}let b4i=class{filter(e,i){return i}notifyElevationSourceChange(){}},w4i=class{filter(e,i){const{point:r,distance:n}=e,{z:s}=r;if(s==null||i.length===0)return i;const o=E4i(n),a=this._updateCandidatesTo3D(i,r,o).filter(x4i);return a.sort(I4i),a}_updateCandidatesTo3D(e,i,r){for(const n of e)switch(n.type){case"edge":S4i(n,i,r);continue;case"vertex":T4i(n,i,r);continue}return e}};function x4i(t){return t.distance<=1}function T0t(t=!1){return t?new w4i:new b4i}function S4i(t,e,{x:i,y:r,z:n}){const{start:s,end:o,target:a}=t;t.draped||C4i(a,e,s,o);const l=(e.x-a.x)/i,c=(e.y-a.y)/r,h=(e.z-a.z)/n;t.distance=Math.sqrt(l*l+c*c+h*h)}function C4i(t,e,i,r){const n=r.x-i.x,s=r.y-i.y,o=r.z-i.z,a=n*n+s*s+o*o,l=(e.x-i.x)*n+(e.y-i.y)*s+o*(e.z-i.z),c=Math.min(1,Math.max(0,l/a)),h=i.x+n*c,p=i.y+s*c,y=i.z+o*c;t.x=h,t.y=p,t.z=y}function T4i(t,e,{x:i,y:r,z:n}){const{target:s}=t,o=(e.x-s.x)/i,a=(e.y-s.y)/r,l=(e.z-s.z)/n,c=Math.sqrt(o*o+a*a+l*l);t.distance=c}function E4i(t){return typeof t=="number"?{x:t,y:t,z:t}:t}function I4i(t,e){return t.distance-e.distance}function E0t(t=!1,e){return t?new O4i(e):new A4i}let A4i=class{async fetch(){return[]}notifySymbologyChange(){}};const P4i=1024;let O4i=class{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new C9(P4i),this._cacheVersion=0}async fetch(e,i){if(e.length===0)return[];const r=[],n=[],s=this._candidatesCache;for(const p of e){const y=I0t(p),v=s.get(y);if(v)for(const x of v)n.push(gi(x));else r.push(p),s.put(y,[],1)}if(r.length===0)return n;const o=this._cacheVersion,{candidates:a,sourceCandidateIndices:l}=await this._getSymbologyCandidates(r,i);if(yn(i),o!==this._cacheVersion)return this.fetch(e,i);const c=[],{length:h}=a;for(let p=0;pe.callback(i)).catch(()=>{}).then(()=>{this._pending.shift(),this._process()})}};E([N()],Ope.prototype,"updating",void 0),Ope=E([dt("esri.core.AsyncSequence")],Ope);let R4i=class{constructor(e,i){this.data=e,this.resolution=i,this.state={type:yu.CREATED},this.alive=!0}process(e){switch(this.state.type){case yu.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case yu.FETCH_COUNT:break;case yu.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case yu.FETCH_FEATURES:break;case yu.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case yu.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case yu.CREATED:case yu.FETCH_COUNT:return 0;case yu.FETCHED_COUNT:return this.state.featureCount;case yu.FETCH_FEATURES:return this.state.previous.featureCount;case yu.FETCHED_FEATURES:return this.state.features.length;case yu.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case yu.CREATED:return"created";case yu.FETCH_COUNT:return"fetch-count";case yu.FETCHED_COUNT:return"fetched-count";case yu.FETCH_FEATURES:return"fetch-features";case yu.FETCHED_FEATURES:return"fetched-features";case yu.DONE:return"done"}}_gotoFetchCount(e,i){return{type:yu.FETCH_COUNT,previous:e,task:CC(async r=>{const n=await Mje(i.fetchCount(this,r));this.state.type===yu.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,n.ok?n.value:1/0))})}}_gotoFetchedCount(e,i){return{type:yu.FETCHED_COUNT,featureCount:i,previous:e}}_gotoFetchFeatures(e,i){return{type:yu.FETCH_FEATURES,previous:e,task:CC(async r=>{const n=await Mje(i.fetchFeatures(this,e.featureCount,r));this.state.type===yu.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,n.ok?n.value:[]))})}}_gotoFetchedFeatures(e,i){return{type:yu.FETCHED_FEATURES,previous:e,features:i}}_goToDone(e,i){return i.finish(this,e.features),{type:yu.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:yu.CREATED},e.type){case yu.CREATED:case yu.FETCHED_COUNT:case yu.FETCHED_FEATURES:case yu.DONE:break;case yu.FETCH_COUNT:case yu.FETCH_FEATURES:e.task.abort()}}intersects(e){return!(!lt(e)&&this.data.extent)||(fR(e,A0t),tse(this.data.extent,A0t))}};var yu;(function(t){t[t.CREATED=0]="CREATED",t[t.FETCH_COUNT=1]="FETCH_COUNT",t[t.FETCHED_COUNT=2]="FETCHED_COUNT",t[t.FETCH_FEATURES=3]="FETCH_FEATURES",t[t.FETCHED_FEATURES=4]="FETCHED_FEATURES",t[t.DONE=5]="DONE"})(yu||(yu={}));const A0t=Mo();let wf=class extends YC{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}set filter(e){const i=this._get("filter"),r=this._filterProperties(e);JSON.stringify(i)!==JSON.stringify(r)&&this._set("filter",r)}set customParameters(e){const i=this._get("customParameters");JSON.stringify(i)!==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 i=this._get("tileInfo");i!==e&&(ve(e)&&ve(i)&&JSON.stringify(e)===JSON.stringify(i)||(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.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._pendingEdits=new Ope,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this.updatingHandles.add(()=>this._configuration,()=>this.refresh()),this.updatingHandles.add(()=>this.tilesOfInterest,(e,i)=>{_H(e,i,({id:r},{id:n})=>r===n)||this._process()},qu)}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}applyEdits(e){this._pendingEdits.push(e,async i=>{if(i.addedFeatures.length===0&&i.updatedFeatures.length===0&&i.deletedFeatures.length===0)return;for(const[,n]of this._pendingTiles)n.reset();const r={...i,deletedFeatures:i.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||!L9(this.url))return;const e=CC(async i=>{try{const r=await MJe(this.url,new Ns({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:!!this.capabilities.query.supportsCacheHint||void 0}),{query:this._configuration.customParameters,signal:i});this.store.extent=Ar.fromJSON(r.data?.extent)}catch(r){Ya(r),Oi.getLogger(this.declaredClass).warn("Failed to fetch data extent",r)}});this.updatingHandles.addPromise(e.promise.then(()=>this._process())),this.handles.add(XI(()=>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(){const e=this._collectMissingTilesInfo();if(this._setAvailability(lt(e)?1:e.coveredArea/e.fullArea),!lt(e))for(const{data:i,resolution:r}of e.missingTiles){const n=this._pendingTiles.get(i.id);n?(n.resolution=r,n.alive=!0):this._createPendingTile(i,r)}}_collectMissingTilesInfo(){let e=null;for(let i=this.tilesOfInterest.length-1;i>=0;i--){const r=this.tilesOfInterest[i],n=this.store.process(r,(s,o)=>this._verifyTileComplexity(s,o));lt(e)?e=n:e.prepend(n)}return e}_deletePendingTiles(){for(const[,e]of this._pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(i,r)=>this._fetchCount(i,r),fetchFeatures:(i,r,n)=>this._fetchFeatures(i,r,n),finish:(i,r)=>this._finishPendingTile(i,r),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,i]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(i.data),i.resolution)&&this.updatingHandles.addPromise(i.process(e))}_verifyTileComplexity(e,i){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,i)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature{e===s.attributes[i]&&(n=s.objectId??s.attributes[r])}),lt(n))throw new Error(`Expected to find a feature with globalId ${e}`);return n}_queryFeaturesById(e,i){const r=this._createFeaturesQuery();return r.objectIds=e,this._queryFeatures(r,i)}_queryFeatures(e,i){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,i):this._queryFeaturesJSON(e,i)}async _queryFeaturesPBF(e,i){const{sourceSpatialReference:r}=this,{data:n}=await yTe(this.url,e,new wJe({sourceSpatialReference:r}),{query:this._configuration.customParameters,timeout:HDe,signal:i});return bZt(n)}async _queryFeaturesJSON(e,i){const{sourceSpatialReference:r}=this,{data:n}=await EB(this.url,e,r,{query:this._configuration.customParameters,timeout:HDe,signal:i});return OTe(n,this.objectIdField)}_createCountQuery(e){const i=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(i.cacheHint=!0),i}_createFeaturesQuery(e=null){const i=this._createBaseQuery(e);return i.outFields=this.globalIdField?[this.globalIdField,this.objectIdField]:[this.objectIdField],i.returnGeometry=!0,ve(e)&&(this.capabilities.query.supportsResultType?i.resultType="tile":this.capabilities.query.supportsCacheHint&&(i.cacheHint=!0)),i}_createBaseQuery(e){const i=new Ns({returnZ:this.hasZ,returnM:!1,geometry:ve(this.tileInfo)&&ve(e)?BL(e.data.extent,this.tileInfo.spatialReference):void 0}),r=this._configuration.filter;return ve(r)&&(i.where=r.where,i.gdbVersion=r.gdbVersion,i.timeExtent=r.timeExtent),i.outSpatialReference=this.spatialReference,i}_setPagingParameters(e,i,r){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:n,supportsCacheHint:s,tileMaxRecordCount:o,maxRecordCount:a,supportsResultType:l}=this.capabilities.query,c=n?Ns.MAX_MAX_RECORD_COUNT_FACTOR:1,h=c*((l||s)&&o?o:a||M4i);return e.start=i,n?(e.maxRecordCountFactor=Math.min(c,Math.ceil(r/h)),e.num=Math.min(r,e.maxRecordCountFactor*h)):e.num=Math.min(r,h),!0}};E([N({constructOnly:!0})],wf.prototype,"url",void 0),E([N({constructOnly:!0})],wf.prototype,"objectIdField",void 0),E([N({constructOnly:!0})],wf.prototype,"globalIdField",void 0),E([N({constructOnly:!0})],wf.prototype,"capabilities",void 0),E([N({constructOnly:!0})],wf.prototype,"sourceSpatialReference",void 0),E([N({constructOnly:!0})],wf.prototype,"spatialReference",void 0),E([N({constructOnly:!0})],wf.prototype,"store",void 0),E([N({readOnly:!0})],wf.prototype,"_minimumVerticesPerFeature",null),E([N()],wf.prototype,"filter",null),E([N()],wf.prototype,"customParameters",null),E([N({readOnly:!0})],wf.prototype,"_configuration",null),E([N()],wf.prototype,"tileInfo",null),E([N()],wf.prototype,"tileSize",null),E([N()],wf.prototype,"tilesOfInterest",void 0),E([N({readOnly:!0})],wf.prototype,"updating",null),E([N({readOnly:!0})],wf.prototype,"updatingExcludingEdits",null),E([N({readOnly:!0})],wf.prototype,"availability",void 0),E([N()],wf.prototype,"hasZ",null),wf=E([dt("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],wf);const M4i=2e3,HDe=6e5,D4i=1e6,F4i=25,L4i=1;let N4i=class{constructor(){this._store=new Map,this._byteSize=0}set(e,i){this.delete(e),this._store.set(e,i),this._byteSize+=i.byteSize}delete(e){const i=this._store.get(e);return!!this._store.delete(e)&&(i!=null&&(this._byteSize-=i.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,i){for(const[r,n]of this._store){if(this._byteSize<=e)break;this.delete(r),i(n)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const i=this._store.get(e);i&&(this._store.delete(e),this._store.set(e,i))}},Uk=class extends Tn{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*Q5.MEGABYTES,this._tileBounds=new XMe,this._tiles=new N4i,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=Mo()}add(e,i){const r=[];for(const n of i)this._referenceFeature(n.objectId)===VD.ADDED&&r.push(n);this._addTileStorage(e,new Set(i.map(n=>n.objectId)),k4i(i)),this.featureStore.addMany(r),this._tiles.applyByteSizeLimit(this.maximumByteSize,n=>this._removeTileStorage(n))}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,i,r){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),i,r)}_addTileStorage(e,i,r){const n=e.id;this._tiles.set(n,new V4i(e,i,r)),this._tileBounds.set(n,e.extent),this._tileFeatureCounts.set(n,i.size)}_remove({id:e}){const i=this._tiles.get(e);i&&this._removeTileStorage(i)}_removeTileStorage(e){const i=[];for(const n of e.objectIds)this._unreferenceFeature(n)===VD.REMOVED&&i.push(n);this.featureStore.removeManyById(i);const r=e.data.id;this._tiles.delete(r),this._tileBounds.delete(r)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const[,i]of this._tiles){for(const r of e)i.objectIds.delete(r);this._tileFeatureCounts.set(i.data.id,i.objectIds.size)}for(const i of e)this._refCounts.delete(i)}async _processEditsRefetch(e,i,r){const n=(await i(e,r)).features,{hasZ:s,hasM:o}=this.featureStore;for(const a of n){const l=Fae(this._tmpBoundingRect,a.geometry,s,o);lt(l)||this._tileBounds.forEachInBounds(l,c=>{const h=this._tiles.get(c);this.featureStore.add(a);const p=a.objectId;h.objectIds.has(p)||(h.objectIds.add(p),this._referenceFeature(p),this._tileFeatureCounts.set(h.data.id,h.objectIds.size))})}}process(e,i=()=>!0){if(lt(this.tileInfo)||!e.extent||ve(this.extent)&&!tse(fR(this.extent,this._tmpBoundingRect),e.extent))return new WDe(e);if(this._tiles.has(e.id))return new WDe(e);const r=this._createTileTree(e,this.tileInfo);return this._simplify(r,i,null,0,1),this._collectMissingTiles(e,r,this.tileInfo)}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,i,r,n){const s=this._tileFeatureCounts.get(e.id);if(s!=null)return s;const o=await RJe(i,r,n);return this._tileFeatureCounts.set(e.id,o.data.count),o.data.count}_createTileTree(e,i){const r=new P0t(e.level,e.row,e.col);return i.updateTileInfo(r,Ul.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,i,this._tileFeatureCounts.get(s.id)||0)}),r}_tilesAreRelated(e,i){if(!e||!i)return!1;if(e.level===i.level)return e.row===i.row&&e.col===i.col;const r=e.level>s,a=i.col>>s,l=e.row<<1,c=a-(e.col<<1)+(o-l<<1),h=e.children[c];if(ve(h))this._populateChildren(h,i,r,n);else{const p=new P0t(e.level+1,o,a);r.updateTileInfo(p,Ul.ExtrapolateOptions.POWER_OF_TWO),e.children[c]=p,this._populateChildren(p,i,r,n)}}_simplify(e,i,r,n,s){const o=s*s;if(e.isLeaf)return i(this.getFeatureCount(e),s)?0:(this._remove(e),ve(r)&&(r.children[n]=null),o);const a=s/2,l=a*a;let c=0;for(let h=0;h{const s=this._tiles.get(n.id);if(s){r+=s.byteSize;for(const o of s.objectIds)i.has(o)||(i.add(o),this._referenceFeature(o));this._remove(n)}}),this._addTileStorage(e,i,r),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,i.size)}_forEachLeaf(e,i){for(const r of e.children)lt(r)||(r.isLeaf?i(r):this._forEachLeaf(r,i))}_purge(e){if(!lt(e))if(e.isLeaf)this._remove(e);else for(let i=0;i>1),(e.col<<1)+(1&s),n):this._collectMissingTilesRecurse(o,i,n)}}_referenceFeature(e){const i=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,i),i===1?VD.ADDED:VD.UNCHANGED}_unreferenceFeature(e){const i=(this._refCounts.get(e)||0)-1;return i===0?(this._refCounts.delete(e),VD.REMOVED):(i>0&&this._refCounts.set(e,i),VD.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 k4i(t){return t.reduce((e,i)=>e+$4i(i),0)}function $4i(t){return 32+B4i(t.geometry)+fQt(t.attributes)}function B4i(t){if(lt(t))return 0;const e=vZe(t.lengths,4);return 32+vZe(t.coords,8)+e}E([N({constructOnly:!0})],Uk.prototype,"featureStore",void 0),E([N()],Uk.prototype,"tileInfo",void 0),E([N()],Uk.prototype,"extent",void 0),E([N()],Uk.prototype,"maximumByteSize",void 0),Uk=E([dt("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],Uk);let V4i=class{constructor(e,i,r){this.data=e,this.objectIds=i,this.byteSize=r}},P0t=class{constructor(e,i,r){this.level=e,this.row=i,this.col=r,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(ve(this.children[0])||ve(this.children[1])||ve(this.children[2])||ve(this.children[3]))}},WDe=class{constructor(e,i=[]){this.missingTiles=i,this.fullArea=0,this.coveredArea=0,this.fullArea=g7e(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}},j4i=class{constructor(e,i,r){this._tileInfo=e,this._extent=null,this.info=new WDe(i),ve(r)&&(this._extent=fR(r))}addMissing(e,i,r,n){const s=new FB(null,e,i,r);this._tileInfo.updateTileInfo(s,Ul.ExtrapolateOptions.POWER_OF_TWO),lt(s.extent)||ve(this._extent)&&!tse(this._extent,s.extent)||(this.info.missingTiles.push({data:s,resolution:n}),this.info.coveredArea-=g7e(s.extent))}};const G4i=.18751;var VD;(function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.UNCHANGED=2]="UNCHANGED"})(VD||(VD={}));let cG=class extends md.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=Kx(),this._elevationAligner=S0t(),this._elevationFilter=T0t(),this._symbologyCandidatesFetcher=E0t(),this._handles=new df,this._updatingHandles=new RR,this._editsUpdatingHandles=new RR,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(e,i)=>{const r={points:e},n=await this.remoteClient.invoke("alignElevation",r,{signal:i});return yn(i),n},this._getSymbologyCandidates=async(e,i)=>{const r={candidates:e,spatialReference:this._spatialReference.toJSON()},n=await this.remoteClient.invoke("getSymbologyCandidates",r,{signal:i});return yn(i),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(),this._handles?.destroy()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:i,objectIdField:r,timeInfo:n,fields:s}=e.serviceInfo,{hasZ:o}=e,a=hr.fromJSON(e.spatialReference);this._spatialReference=a,this._featureStore=new xJ({...e.serviceInfo,hasZ:o,hasM:!1}),this._queryEngine=new Bk({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:i,fields:s,hasZ:o,hasM:!1,objectIdField:r,timeInfo:n}),this._featureFetcher=new wf({store:new Uk({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:hr.fromJSON(e.serviceInfo.spatialReference)});const l=e.configuration.viewType==="3d";return this._elevationAligner=S0t(l,{elevationInfo:ve(e.elevationInfo)?w5.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures,spatialReference:a}),this._elevationFilter=T0t(l),this._handles.add([sr(()=>this._featureFetcher.availability,c=>this.emit("notify-availability",{availability:c}),qu),sr(()=>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),{result:{}}}async fetchCandidates(e,i){await this._whenSetup.promise,yn(i);const r=z4i(e),n=ve(i)?i.signal:null,s=await this._queryEngine.executeQueryForSnapping(r,n);yn(n);const o=await this._elevationAligner.alignCandidates(s.candidates,n);yn(n);const a=await this._symbologyCandidatesFetcher.fetch(o,n);yn(n);const l=a.length===0?o:o.concat(a);return{result:{candidates:this._elevationFilter.filter(r,l)}}}async updateTiles(e,i){return await this._updatingHandles.addPromise(this._whenSetup.promise),yn(i),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=ve(e.tileInfo)?Ul.fromJSON(e.tileInfo):null,jD}async refresh(e,i){return await this._updatingHandles.addPromise(this._whenSetup.promise),yn(i),this._featureFetcher.refresh(),jD}async whenNotUpdating(e,i){return await this._updatingHandles.addPromise(this._whenSetup.promise),yn(i),await N1(()=>!this.updatingExcludingEdits,i),yn(i),jD}async getDebugInfo(e,i){return yn(i),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(e,i){this._updatingHandles.addPromise(this._whenSetup.promise),yn(i);const r=Kx();return this._pendingApplyEdits.set(e.id,r),this._featureFetcher.applyEdits(r.promise),this._editsUpdatingHandles.addPromise(r.promise),jD}async endApplyEdits(e,i){const r=this._pendingApplyEdits.get(e.id);return r&&r.resolve(e.edits),yn(i),jD}async notifyElevationSourceChange(e,i){return this._elevationAligner.notifyElevationSourceChange(),jD}async notifySymbologyChange(e,i){return this._symbologyCandidatesFetcher.notifySymbologyChange(),jD}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=E0t(e,this._getSymbologyCandidates),jD}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=ve(e.filter)?Ns.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};E([N({readOnly:!0})],cG.prototype,"updating",null),E([N({readOnly:!0})],cG.prototype,"updatingExcludingEdits",null),E([N()],cG.prototype,"_isInitializing",void 0),cG=E([dt("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],cG);const U4i=cG;function z4i(t){return{point:t.point,mode:t.mode,distance:t.distance,types:t.types,query:ve(t.filter)?t.filter:{where:"1=1"}}}const jD={result:{}},H4i=Object.freeze(Object.defineProperty({__proto__:null,default:U4i},Symbol.toStringTag,{value:"Module"})),W4i={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function Rpe(t){return W4i[t]}function*O0t(t){switch(t.type){case"Feature":yield t;break;case"FeatureCollection":for(const e of t.features)e&&(yield e)}}function*q4i(t){if(t)switch(t.type){case"Point":yield t.coordinates;break;case"LineString":case"MultiPoint":yield*t.coordinates;break;case"MultiLineString":case"Polygon":for(const e of t.coordinates)yield*e;break;case"MultiPolygon":for(const e of t.coordinates)for(const i of e)yield*i}}function*Y4i(t,e={}){const{geometryType:i,objectIdField:r}=e;for(const n of t){const{geometry:s,properties:o,id:a}=n;if(s&&Rpe(s.type)!==i)continue;const l=o||{};let c;r&&(c=l[r],a==null||c||(l[r]=c=a)),yield new c_(s?Z4i(new Ml,s,e):null,l,null,c??void 0)}}function X4i(t){for(const e of t)if(e.length>2)return!0;return!1}function K4i(t){return!R0t(t)}function J4i(t){return R0t(t)}function R0t(t){let e=0;for(let i=0;i=0;r--)qDe(t,e[r],i);t.lengths.push(e.length)}function qDe(t,e,i){const[r,n,s]=e;t.coords.push(r,n),i.hasZ&&t.coords.push(s||0)}function sLi(t){switch(typeof t){case"string":return"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function YDe(t){if(!t)throw new st("geojson-layer:empty","GeoJSON data is empty");if(t.type!=="Feature"&&t.type!=="FeatureCollection")throw new st("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:t});const{crs:e}=t;if(!e)return;const i=typeof e=="string"?e:e.type==="name"?e.properties.name:e.type==="EPSG"?e.properties.code:null,r=new RegExp(".*(CRS84H?|4326)$","i");if(!i||!r.test(i))throw new st("geojson-layer:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:e})}function N0t(t,e={}){const i=[],r=new Set,n=new Set;let s,o=!1,a=null,l=!1,{geometryType:c=null}=e,h=!1;for(const y of O0t(t)){const{geometry:v,properties:x,id:I}=y;if((!v||(c||(c=Rpe(v.type)),Rpe(v.type)===c))&&(o||(o=X4i(q4i(v))),l||(l=I!=null,l&&(s=typeof I,x&&(a=Object.keys(x).filter(P=>x[P]===I)))),x&&a&&l&&I!=null&&(a.length>1?a=a.filter(P=>x[P]===I):a.length===1&&(a=x[a[0]]===I?a:[])),!h&&x)){let P=!0;for(const F in x){if(r.has(F))continue;const k=x[F];if(k==null){P=!1,n.add(F);continue}const j=sLi(k);if(j==="unknown"){n.add(F);continue}n.delete(F),r.add(F);const V=e9(F);V&&i.push({name:V,alias:F,type:j})}h=P}}const p=e9(a?.length===1&&a[0]||null)??void 0;if(p){for(const y of i)if(y.name===p&&t9(y)){y.type="esriFieldTypeOID";break}}return{fields:i,geometryType:c,hasZ:o,objectIdFieldName:p,objectIdFieldType:s,unknownFields:Array.from(n)}}function XDe(t,e){return Array.from(Y4i(O0t(t),e))}let oLi=class{constructor(){this.code=null,this.description=null}},aLi=class{constructor(e){this.error=new oLi,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=e}};function cS(t){return new aLi(t)}let lLi=class{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}};function hG(t){return new lLi(t)}const KDe=new Set;function zk(t,e,i,r=!1,n){KDe.clear();for(const s in i){const o=t.get(s);if(!o)continue;const a=i[s],l=uLi(o,a);if(l!==a&&n&&n.push({name:"invalid-value-type",message:"attribute value was converted to match the field type",details:{field:o,originalValue:a,sanitizedValue:l}}),KDe.add(o.name),o&&(r||o.editable)){const c=HBt(o,l);if(c)return cS(JBt(c,o,l));e[o.name]=l}}for(const s of t?.requiredFields??[])if(!KDe.has(s.name))return cS(`missing required field "${s.name}"`);return null}function uLi(t,e){let i=e;return typeof e=="string"&&t9(t)?i=parseFloat(e):e!=null&&pbe(t)&&typeof e!="string"&&(i=String(e)),zBt(i)}let IJ;function Mpe(t,e){if(!t||!bh(e))return t;if("rings"in t||"paths"in t){if(lt(IJ))throw new TypeError("geometry engine not loaded");return IJ.simplify(e,t)}return t}async function cLi(){return lt(IJ)&&(IJ=await Promise.resolve().then(()=>pZ)),IJ}async function k0t(t,e){!bh(t)||e!=="esriGeometryPolygon"&&e!=="esriGeometryPolyline"||await cLi()}const hLi={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}},dLi=Object.freeze(Object.defineProperty({__proto__:null,default:class{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const i=await this._fetch(e);return this._createFeatures(i)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._fieldsIndex=this._createDefaultAttributes=null}async load(e,i={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const r=[];await this._checkProjection(e.spatialReference);let n=null;e.url&&(n=await this._fetch(i?.signal));const s=N0t(n,{geometryType:e.geometryType}),o=e.fields||s.fields||[],a=e.hasZ!=null?e.hasZ:s.hasZ,l=s.geometryType;let c=e.objectIdField||s.objectIdFieldName||"__OBJECTID";const h=e.spatialReference||$f;let p=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}});let y=new Lm(o).get(c);y?(y.type!=="esriFieldTypeString"&&(y.type="esriFieldTypeOID"),y.editable=!1,y.nullable=!1,c=y.name):(y={alias:c,name:c,type:s.objectIdFieldType==="string"?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(y));const v={};for(const Y of o){if(Y.name==null&&(Y.name=Y.alias),Y.alias==null&&(Y.alias=Y.name),!Y.name)throw new st("geojson-layer:invalid-field-name","field name is missing",{field:Y});if(!roe.jsonValues.includes(Y.type))throw new st("geojson-layer:invalid-field-type",`invalid type for field "${Y.name}"`,{field:Y});if(Y.name!==y.name){const X=One(Y);X!==void 0&&(v[Y.name]=X)}}this._fieldsIndex=new Lm(o);const x=this._fieldsIndex.requiredFields.indexOf(y);if(x>-1&&this._fieldsIndex.requiredFields.splice(x,1),p){if(p.startTimeField){const Y=this._fieldsIndex.get(p.startTimeField);Y?(p.startTimeField=Y.name,Y.type="esriFieldTypeDate"):p.startTimeField=null}if(p.endTimeField){const Y=this._fieldsIndex.get(p.endTimeField);Y?(p.endTimeField=Y.name,Y.type="esriFieldTypeDate"):p.endTimeField=null}if(p.trackIdField){const Y=this._fieldsIndex.get(p.trackIdField);Y?p.trackIdField=Y.name:(p.trackIdField=null,r.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:p}}))}p.startTimeField||p.endTimeField||(r.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:p}}),p=null)}const I=l?iG(l):void 0,P={warnings:r,featureErrors:[],layerDefinition:{...hLi,drawingInfo:I??void 0,templates:byt(v),extent:void 0,geometryType:l,objectIdField:c,fields:o,hasZ:!!a,timeInfo:p}};this._queryEngine=new Bk({fields:o,geometryType:l,hasM:!1,hasZ:a,objectIdField:c,spatialReference:h,timeInfo:p,featureStore:new xJ({geometryType:l,hasM:!1,hasZ:a}),cacheSpatialQueries:!0}),this._createDefaultAttributes=sDe(v,c);const F=await this._createFeatures(n);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,F);const k=this._normalizeFeatures(F,P.warnings,P.featureErrors);this._queryEngine.featureStore.addMany(k);const{fullExtent:j,timeExtent:V}=await this._queryEngine.fetchRecomputedExtents();if(P.layerDefinition.extent=j,V){const{start:Y,end:X}=V;P.layerDefinition.timeInfo.timeExtent=[Y,X]}return P}async applyEdits(e){const{spatialReference:i,geometryType:r}=this._queryEngine;return await Promise.all([k0t(i,r),hy(e.adds,i),hy(e.updates,i)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,i.signal)}async queryFeatureCount(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,i.signal)}async queryObjectIds(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,i.signal)}async queryExtent(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,i.signal)}async querySnapping(e,i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,i.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=CC(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(),ys(n)||Oi.getLogger("esri.layers.GeoJSONLayer").error(new st("geojson-layer:refresh","An error occurred during refresh",{error:n}))}),await this._waitSnapshotComplete();const{fullExtent:i,timeExtent:r}=await this._queryEngine.fetchRecomputedExtents();return{extent:i,timeExtent:r}}async _createFeatures(e){if(e==null)return[];const{geometryType:i,hasZ:r,objectIdField:n}=this._queryEngine,s=XDe(e,{geometryType:i,hasZ:r,objectIdField:n});if(!Da(this._queryEngine.spatialReference,$f))for(const o of s)ve(o.geometry)&&(o.geometry=Y5(wp(pw(o.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),$f,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:i,customParameters:r}=this._loadOptions,n=(await ur(i,{responseType:"json",query:{...r},signal:e})).data;return await YDe(n),n}_normalizeFeatures(e,i,r){const{objectIdField:n}=this._queryEngine,s=[];for(const o of e){const a=this._createDefaultAttributes(),l=zk(this._fieldsIndex,a,o.attributes,!0,i);l?r?.push(l):(this._assignObjectId(a,o.attributes,!0),o.attributes=a,o.objectId=a[n],s.push(o))}return s}async _applyEdits(e){const{adds:i,updates:r,deletes:n}=e,s={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(i&&i.length&&this._applyAddEdits(s,i),r&&r.length&&this._applyUpdateEdits(s,r),n&&n.length){for(const l of n)s.deleteResults.push(hG(l));this._queryEngine.featureStore.removeManyById(n)}const{fullExtent:o,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:o,timeExtent:a,featureEditResults:s}}_applyAddEdits(e,i){const{addResults:r}=e,{geometryType:n,hasM:s,hasZ:o,objectIdField:a,spatialReference:l,featureStore:c}=this._queryEngine,h=[];for(const p of i){if(p.geometry&&n!==bd(p.geometry)){r.push(cS("Incorrect geometry type."));continue}const y=this._createDefaultAttributes(),v=zk(this._fieldsIndex,y,p.attributes);if(v)r.push(v);else{if(this._assignObjectId(y,p.attributes),p.attributes=y,p.uid!=null){const x=p.attributes[a];e.uidToObjectId[p.uid]=x}if(ve(p.geometry)){const x=p.geometry.spatialReference??l;p.geometry=wp(Mpe(p.geometry,x),x,l)}h.push(p),r.push(hG(p.attributes[a]))}}c.addMany(OB([],h,n,o,s,a))}_applyUpdateEdits({updateResults:e},i){const{geometryType:r,hasM:n,hasZ:s,objectIdField:o,spatialReference:a,featureStore:l}=this._queryEngine;for(const c of i){const{attributes:h,geometry:p}=c,y=h&&h[o];if(y==null){e.push(cS(`Identifier field ${o} missing`));continue}if(!l.has(y)){e.push(cS(`Feature with object id ${y} missing`));continue}const v=PTe(l.getFeature(y),r,s,n);if(ve(p)){if(r!==bd(p)){e.push(cS("Incorrect geometry type."));continue}const x=p.spatialReference??a;v.geometry=wp(Mpe(p,x),x,a)}if(h){const x=zk(this._fieldsIndex,v.attributes,h);if(x){e.push(x);continue}}l.add(ATe(v,r,s,n,o)),e.push(hG(y))}}_createObjectIdGenerator(e,i){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 i)s.objectId&&(n=Math.max(n,s.objectId));return n=Math.max(0,n)+1,()=>n++}_assignObjectId(e,i,r=!1){const n=this._queryEngine.objectIdField;e[n]=r&&n in i?i[n]:this._objectIdGenerator()}async _checkProjection(e){try{await hy($f,e)}catch{throw new st("geojson-layer","Projection not supported")}}}},Symbol.toStringTag,{value:"Module"}));var Dpe={};Dpe.defaultNoDataValue=ebe(-1/0),Dpe.decode=function(t,e){var i=(e=e||{}).encodedMaskData||e.encodedMaskData===null,r=gLi(t,e.inputOffset||0,i),n=e.noDataValue!=null?ebe(e.noDataValue):Dpe.defaultNoDataValue,s=pLi(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=fLi(r,n),e.computeUsedBitDepths&&(o.fileInfo.bitDepths=mLi(r))),o};var pLi=function(t,e,i,r,n){var s,o,a=0,l=t.pixels.numBlocksX,c=t.pixels.numBlocksY,h=Math.floor(t.width/l),p=Math.floor(t.height/c),y=2*t.maxZError;i=i||(t.mask?t.mask.bitset:null),s=new e(t.width*t.height),n&&i&&(o=new Uint8Array(t.width*t.height));for(var v,x,I=new Float32Array(h*p),P=0;P<=c;P++){var F=P!==c?p:t.height%c;if(F!==0)for(var k=0;k<=l;k++){var j=k!==l?h:t.width%l;if(j!==0){var V,Y,X,Z,ie=P*t.width*p+k*h,ce=t.width-j,he=t.pixels.blocks[a];if(he.encoding<2?(he.encoding===0?V=he.rawData:(yLi(he.stuffedData,he.bitsPerPixel,he.numValidPixels,he.offset,y,I,t.pixels.maxValue),V=I),Y=0):X=he.encoding===2?0:he.offset,i)for(x=0;x>3],Z<<=7&ie),v=0;v>3]),128&Z?(o&&(o[ie]=1),s[ie++]=he.encoding<2?V[Y++]:X):(o&&(o[ie]=0),s[ie++]=r),Z<<=1;ie+=ce}else if(he.encoding<2)for(x=0;x0){var o=new Uint8Array(Math.ceil(r.width*r.height/8)),a=(s=new DataView(t,e,r.mask.numBytes)).getInt16(0,!0),l=2,c=0;do{if(a>0)for(;a--;)o[c++]=s.getUint8(l++);else{var h=s.getUint8(l++);for(a=-a;a--;)o[c++]=h}a=s.getInt16(l,!0),l+=2}while(l0?1:0),x=y+(r.height%y>0?1:0);r.pixels.blocks=new Array(v*x);for(var I=1e9,P=0,F=0;F3)throw"Invalid block encoding ("+Y.encoding+")";if(Y.encoding!==2){if(X!==0&&X!==2){if(X>>=6,Y.offsetType=X,X===2)Y.offset=s.getInt8(1),j++;else if(X===1)Y.offset=s.getInt16(1,!0),j+=2;else{if(X!==0)throw"Invalid block offset type";Y.offset=s.getFloat32(1,!0),j+=4}if(I=Math.min(Y.offset,I),Y.encoding===1)if(X=s.getUint8(j),j++,Y.bitsPerPixel=63&X,X>>=6,Y.numValidPixelsType=X,X===2)Y.numValidPixels=s.getUint8(j),j++;else if(X===1)Y.numValidPixels=s.getUint16(j,!0),j+=2;else{if(X!==0)throw"Invalid valid pixel count type";Y.numValidPixels=s.getUint32(j,!0),j+=4}}var Z;if(e+=j,Y.encoding!=3){if(Y.encoding===0){var ie=(r.pixels.numBytes-1)/4;if(ie!==Math.floor(ie))throw"uncompressed block has invalid length";Z=new ArrayBuffer(4*ie),new Uint8Array(Z).set(new Uint8Array(t,e,4*ie));for(var ce=new Float32Array(Z),he=0;he=e)l=c>>>y-e&h,y-=e;else{var I=e-y;l=(c&h)<>>(y=32-I)}s[a]=lj.name===v&&(k=j,!0))?(k.type="esriFieldTypeOID",k.editable=!1,k.nullable=!1):s.unshift({alias:v,name:v,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const k of s){if(k.name==null&&(k.name=k.alias),k.alias==null&&(k.alias=k.name),!k.name)throw new st("feature-layer:invalid-field-name","field name is missing",{field:k});if(k.name===v&&(k.type="esriFieldTypeOID"),!roe.jsonValues.includes(k.type))throw new st("feature-layer:invalid-field-type",`invalid type for field "${k.name}"`,{field:k})}const I={};for(const k of s)if(k.type!=="esriFieldTypeOID"&&k.type!=="esriFieldTypeGlobalID"){const j=One(k);j!==void 0&&(I[k.name]=j)}if(this._fieldsIndex=new Lm(s),this._createDefaultAttributes=sDe(I,v),x){if(x.startTimeField){const k=this._fieldsIndex.get(x.startTimeField);k?(x.startTimeField=k.name,k.type="esriFieldTypeDate"):x.startTimeField=null}if(x.endTimeField){const k=this._fieldsIndex.get(x.endTimeField);k?(x.endTimeField=k.name,k.type="esriFieldTypeDate"):x.endTimeField=null}if(x.trackIdField){const k=this._fieldsIndex.get(x.trackIdField);k?x.trackIdField=k.name:(x.trackIdField=null,i.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:x}}))}x.startTimeField||x.endTimeField||(i.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:x}}),x=null)}const P={warnings:i,featureErrors:[],layerDefinition:{...TLi,drawingInfo:iG(p),templates:byt(I),extent:h,geometryType:p,objectIdField:v,fields:s,hasZ:a,hasM:o,timeInfo:x},assignedObjectIds:{}};if(this._queryEngine=new Bk({fields:s,geometryType:p,hasM:o,hasZ:a,objectIdField:v,spatialReference:c,featureStore:new xJ({geometryType:p,hasM:o,hasZ:a}),timeInfo:x,cacheSpatialQueries:!0}),!r||!r.length)return this._nextObjectId=xLi,P;const F=$0t(v,r);return this._nextObjectId=F+1,await hy(r,c),this._loadInitialFeatures(P,r)}async applyEdits(e){const{spatialReference:i,geometryType:r}=this._queryEngine;return await Promise.all([k0t(i,r),hy(e.adds,i),hy(e.updates,i)]),this._applyEdits(e)}queryFeatures(e,i={}){return this._queryEngine.executeQuery(e,i.signal)}queryFeatureCount(e,i={}){return this._queryEngine.executeQueryForCount(e,i.signal)}queryObjectIds(e,i={}){return this._queryEngine.executeQueryForIds(e,i.signal)}queryExtent(e,i={}){return this._queryEngine.executeQueryForExtent(e,i.signal)}querySnapping(e,i={}){return this._queryEngine.executeQueryForSnapping(e,i.signal)}_inferLayerProperties(e,i){let r,n,s=null,o=null,a=null;for(const l of e){const c=l.geometry;if(!lt(c)&&(s||(s=bd(c)),o||(o=c.spatialReference),r==null&&(r=ELi(c)),n==null&&(n=ILi(c)),s&&o&&r!=null&&n!=null))break}if(i&&i.length){let l=null;i.some(c=>{const h=c.type==="esriFieldTypeOID",p=!c.type&&c.name&&c.name.toLowerCase()==="objectid";return l=c,h||p})&&(a=l.name)}return{geometryType:s,spatialReference:o,objectIdField:a,hasM:n,hasZ:r}}async _loadInitialFeatures(e,i){const{geometryType:r,hasM:n,hasZ:s,objectIdField:o,spatialReference:a,featureStore:l}=this._queryEngine,c=[];for(const y of i){if(y.uid!=null&&(e.assignedObjectIds[y.uid]=-1),y.geometry&&r!==bd(y.geometry)){e.featureErrors.push(cS("Incorrect geometry type."));continue}const v=this._createDefaultAttributes(),x=zk(this._fieldsIndex,v,y.attributes,!0,e.warnings);x?e.featureErrors.push(x):(this._assignObjectId(v,y.attributes,!0),y.attributes=v,y.uid!=null&&(e.assignedObjectIds[y.uid]=y.attributes[o]),ve(y.geometry)&&(y.geometry=wp(y.geometry,y.geometry.spatialReference,a)),c.push(y))}l.addMany(OB([],c,r,s,n,o));const{fullExtent:h,timeExtent:p}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=h,p){const{start:y,end:v}=p;e.layerDefinition.timeInfo.timeExtent=[y,v]}return e}async _applyEdits(e){const{adds:i,updates:r,deletes:n}=e,s={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(i&&i.length&&this._applyAddEdits(s,i),r&&r.length&&this._applyUpdateEdits(s,r),n&&n.length){for(const l of n)s.deleteResults.push(hG(l));this._queryEngine.featureStore.removeManyById(n)}const{fullExtent:o,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:o,timeExtent:a,featureEditResults:s}}_applyAddEdits(e,i){const{addResults:r}=e,{geometryType:n,hasM:s,hasZ:o,objectIdField:a,spatialReference:l,featureStore:c}=this._queryEngine,h=[];for(const p of i){if(p.geometry&&n!==bd(p.geometry)){r.push(cS("Incorrect geometry type."));continue}const y=this._createDefaultAttributes(),v=zk(this._fieldsIndex,y,p.attributes);if(v)r.push(v);else{if(this._assignObjectId(y,p.attributes),p.attributes=y,p.uid!=null){const x=p.attributes[a];e.uidToObjectId[p.uid]=x}if(ve(p.geometry)){const x=p.geometry.spatialReference??l;p.geometry=wp(Mpe(p.geometry,x),x,l)}h.push(p),r.push(hG(p.attributes[a]))}}c.addMany(OB([],h,n,o,s,a))}_applyUpdateEdits({updateResults:e},i){const{geometryType:r,hasM:n,hasZ:s,objectIdField:o,spatialReference:a,featureStore:l}=this._queryEngine;for(const c of i){const{attributes:h,geometry:p}=c,y=h&&h[o];if(y==null){e.push(cS(`Identifier field ${o} missing`));continue}if(!l.has(y)){e.push(cS(`Feature with object id ${y} missing`));continue}const v=PTe(l.getFeature(y),r,s,n);if(ve(p)){if(r!==bd(p)){e.push(cS("Incorrect geometry type."));continue}const x=p.spatialReference??a;v.geometry=wp(Mpe(p,x),x,a)}if(h){const x=zk(this._fieldsIndex,v.attributes,h);if(x){e.push(x);continue}}l.add(ATe(v,r,s,n,o)),e.push(hG(y))}}_assignObjectId(e,i,r=!1){const n=this._queryEngine.objectIdField;r&&i&&isFinite(i[n])?e[n]=i[n]:e[n]=this._nextObjectId++}}},Symbol.toStringTag,{value:"Module"}));let PLi=class{constructor(e,i,r){this.uid=e,this.geometry=i,this.attributes=r,this.visible=!0,this.objectId=null,this.centroid=null}},OLi=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 RLi(t,e){return e}function JDe(t,e,i,r){switch(i){case 0:return AJ(t,e+r,0);case 1:return t.originPosition==="lowerLeft"?AJ(t,e+r,1):FLi(t,e+r,1)}}function B0t(t,e,i,r){return i===2?AJ(t,e,2):JDe(t,e,i,r)}function MLi(t,e,i,r){return i===2?AJ(t,e,3):JDe(t,e,i,r)}function DLi(t,e,i,r){return i===3?AJ(t,e,3):B0t(t,e,i,r)}function AJ({translate:t,scale:e},i,r){return t[r]+i*e[r]}function FLi({translate:t,scale:e},i,r){return t[r]-i*e[r]}let LLi=class{constructor(e){this._options=e,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=RLi,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return new OLi}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const i=F9(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(!lt(i))for(const r of e.features)i(r.geometry)}createSpatialReference(){return new hr}addField(e,i){e.fields.push(Jo.fromJSON(i));const r=e.fields.map(n=>n.name);this._attributesConstructor=function(){for(const n of r)this[n]=null}}addFeature(e,i){const r=this._options.maxStringAttributeLength?this._options.maxStringAttributeLength:0;if(r>0)for(const n in i.attributes){const s=i.attributes[n];typeof s=="string"&&s.length>r&&(i.attributes[n]="")}e.features.push(i)}addQueryGeometry(e,i){const{queryGeometry:r,queryGeometryType:n}=i,s=RB(r.clone(),r,!1,!1,this._transform),o=pw(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=(i,r,n)=>this.addCoordinatePoint(i,r,n),this.createGeometry=i=>this.createPointGeometry(i);break;case"polygon":this.addCoordinate=(i,r,n)=>this._addCoordinatePolygon(i,r,n),this.createGeometry=i=>this._createPolygonGeometry(i);break;case"polyline":this.addCoordinate=(i,r,n)=>this._addCoordinatePolyline(i,r,n),this.createGeometry=i=>this._createPolylineGeometry(i);break;case"multipoint":this.addCoordinate=(i,r,n)=>this._addCoordinateMultipoint(i,r,n),this.createGeometry=i=>this._createMultipointGeometry(i);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 PLi(j3(),null,new this._attributesConstructor)}allocateCoordinates(){const e=this._lengths.reduce((i,r)=>i+r,0);this._coordinateBuffer=new Float64Array(e*this._vertexDimension),this._coordinateBufferPtr=0}addLength(e,i){this._lengths.length===0&&(this._toAddInCurrentPath=i),this._lengths.push(i)}createPointGeometry(e){const i={type:"point",x:0,y:0,spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM};return i.hasZ&&(i.z=0),i.hasM&&(i.m=0),i}addCoordinatePoint(e,i,r){const n=this._transform?this._applyTransform(this._transform,i,r,0):i;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,i){let r=0;return i<=1&&(r=this._previousCoordinate[i],this._previousCoordinate[i]+=e),this._transform?this._applyTransform(this._transform,e,i,r):e}_addCoordinatePolyline(e,i,r){this._dehydratedAddPointsCoordinate(e.paths,i,r)}_addCoordinatePolygon(e,i,r){this._dehydratedAddPointsCoordinate(e.rings,i,r)}_addCoordinateMultipoint(e,i,r){r===0&&e.points.push([]);const n=this._transformPathLikeValue(i,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,i,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(i,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:i,hasM:r}=e;return i&&r?DLi:i?B0t:r?MLi:JDe}},NLi=class{_parseFeatureQuery(e){const i=AJe(e.buffer,new LLi(e.options)),r={...i,spatialReference:i.spatialReference?.toJSON(),fields:i.fields?i.fields.map(n=>n.toJSON()):void 0};return Promise.resolve(r)}};function kLi(){return new NLi}const $Li=Object.freeze(Object.defineProperty({__proto__:null,default:kLi},Symbol.toStringTag,{value:"Module"}));function BLi(t){return t==="heatmap"?Promise.resolve().then(()=>STr):Promise.resolve().then(()=>TTr)}let GD=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 i=this._buffer[this._start];return this._buffer[this._start]=e,this._start=(this._start+1)%this.maxSize,i}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 i of this._buffer)if(ve(i)&&e(i))return i;return null}clear(e){let i=this.dequeue();for(;ve(i);)e&&e(i),i=this.dequeue()}};function VLi(t,e,i){if(lt(t))return null;const r=e.readArcadeFeature();try{return t.evaluate({...i,$feature:r})}catch(n){return Oi.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",n),null}}const jLi=Promise.resolve().then(()=>ATr);let ZDe=class{constructor(e,i){this._canCacheExpressionValue=!1,this._sourceInfo=e,this._storage=i,this._bitsets={computed:i.getBitset(i.createBitset())}}get storage(){return this._storage}invalidate(){this._bitsets.computed.clear()}async updateSchema(e,i){const r=h2(this._schema,i);if(this._schema=i,!i||lt(r)||!yA(r,"attributes"))return;Hi("esri-2d-update-debug")&&console.debug("Applying Update - Store:",r),this._bitsets.computed.clear(),e.targets[i.name]=!0;const n=i.attributes,s=[],o=[];for(const a in n){const l=n[a];switch(l.type){case"field":break;case"expression":s.push(this._createArcadeComputedField(l));break;case"label-expression":s.push(this._createLabelArcadeComputedField(l));break;case"statistic":o.push(l)}}this._computedFields=await Promise.all(s),this._canCacheExpressionValue=!this._computedFields.some(a=>a.type==="expression"&&ve(a.expression)&&a.expression.referencesScale()),this._statisticFields=o}setComputedAttributes(e,i,r,n){const s=this._bitsets.computed;if(!this._canCacheExpressionValue||!s.has(r)){s.set(r);for(const o of this._computedFields){const a=this._evaluateField(i,o,n);switch(o.resultType){case"numeric":e.setComputedNumericAtIndex(r,o.fieldIndex,a);break;case"string":e.setComputedStringAtIndex(r,o.fieldIndex,a)}}}}async _createArcadeComputedField(e){const i=this._sourceInfo.spatialReference,r=this._sourceInfo.fieldsIndex;return{...e,expression:await Ane(e.valueExpression,i,r)}}async _createLabelArcadeComputedField(e){const i=this._sourceInfo.spatialReference,r=this._sourceInfo.fieldsIndex,{createLabelFunction:n}=await jLi,s=await n(e.label,r,i);return{...e,builder:s}}_evaluateField(e,i,r){switch(i.type){case"label-expression":{const n=e.readArcadeFeature();return i.builder.evaluate(n)||""}case"expression":{const{expression:n}=i;return VLi(n,e,{$view:{scale:r}})}}}},QDe=class r_e{static fromBuffer(e,i){return new r_e(e,i)}static create(e,i=4294967295){const r=new Uint32Array(Math.ceil(e/32));return new r_e(r,i)}constructor(e,i){this._mask=0,this._buf=e,this._mask=i}_getIndex(e){return Math.floor(e/32)}has(e){const i=this._mask&e;return!!(this._buf[this._getIndex(i)]&1<>>=1,n++}}countSet(){let e=0;return this.forEachSet(i=>{e++}),e}},PJ=0;const Fpe=Hi("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],GLi=Fpe[0],ULi=Fpe[1],zLi=Fpe[2],HLi=Fpe[3],eFe=Hi("featurelayer-simplify-payload-size-factors")??[1,2,4],WLi=eFe[0],qLi=eFe[1],YLi=eFe[2],XLi=Hi("featurelayer-simplify-mobile-factor")??2,KLi=Hi("esri-mobile");let Hk=class{constructor(e,i){this.type="FeatureSetReader",this.arcadeDeclaredClass="esri.arcade.Feature",this.seen=!1,this.instance=0,this._tx=0,this._ty=0,this._sx=1,this._sy=1,this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._level=0,this._datetimeMetadata=null,this.contextTimeReference=null,this.instance=e,this._layerSchema=i}static createInstance(){return PJ++,PJ=PJ>65535?0:PJ,PJ}get isEmpty(){return ve(this._deleted)&&this._deleted.countSet()===this.getSize()}set level(e){this._level=e}getAreaSimplificationThreshold(e,i){let r=1;const n=KLi?XLi:1;i>4e6?r=YLi*n:i>1e6?r=qLi*n:i>5e5?r=WLi*n:i>1e5&&(r=n);let s=0;e>4e3?s=HLi*r:e>2e3?s=zLi*r:e>100?s=ULi:e>15&&(s=GLi);let o=8;return this._level<4?o=1:this._level<5?o=2:this._level<6&&(o=4),s*o}createQuantizedExtrudedQuad(e,i){return new Ml([5],[e-1,i,1,-1,1,1,-1,1,-1,-1])}setArcadeSpatialReference(e){this._arcadeSpatialReference=e}attachStorage(e){this._storage=e}getQuantizationTransform(){throw new Error("Unable to find transform for featureSet")}getStorage(){return this._storage}getComputedNumeric(e){return this.getComputedNumericAtIndex(0)}setComputedNumeric(e,i){return this.setComputedNumericAtIndex(i,0)}getComputedString(e){return this.getComputedStringAtIndex(0)}setComputedString(e,i){return this.setComputedStringAtIndex(0,i)}getComputedNumericAtIndex(e){return this._storage.getComputedNumericAtIndex(this.getDisplayId(),e)}setComputedNumericAtIndex(e,i){this._storage.setComputedNumericAtIndex(this.getDisplayId(),e,i)}getComputedStringAtIndex(e){return this._storage.getComputedStringAtIndex(this.getDisplayId(),e)}setComputedStringAtIndex(e,i){return this._storage.setComputedStringAtIndex(this.getDisplayId(),e,i)}transform(e,i,r,n){const s=this.copy();return s._tx+=e,s._ty+=i,s._sx*=r,s._sy*=n,s}readAttribute(e,i=!1){const r=this._readAttribute(e,i);if(r!==void 0)return r;for(const n of this._joined){n.setIndex(this.getIndex());const s=n._readAttribute(e,i);if(s!==void 0)return s}}readAttributes(){const e=this._readAttributes();for(const i of this._joined){i.setIndex(this.getIndex());const r=i._readAttributes();for(const n of Object.keys(r))e[n]=r[n]}return e}joinAttributes(e){this._joined.push(e)}readArcadeFeature(){return this}geometry(){const e=this.readHydratedGeometry(),i=pw(e,this.geometryType,this.hasZ,this.hasM),r=Sl(i);return r&&(r.spatialReference=this._arcadeSpatialReference),r}get dateTimeReferenceFieldIndex(){return this._datetimeMetadata||(this._datetimeMetadata=Tde.create(this._layerSchema.fields,this._layerSchema)),this._datetimeMetadata}autocastArcadeDate(e,i){return i&&i instanceof Date?this.isUnknownDateTimeField(e)?Cl.unknownDateJSToArcadeDate(i):Cl.dateJSAndZoneToArcadeDate(i,this.contextTimeReference?.timeZone??"system"):i}isUnknownDateTimeField(e){return this.dateTimeReferenceFieldIndex?.fieldTimeZone(e)==="unknown"}fieldSourceTimeZone(e){return this.dateTimeReferenceFieldIndex?.fieldTimeZone(e)??""}get layerPreferredTimeZone(){return this.dateTimeReferenceFieldIndex?.layerPreferredTimeZone??""}field(e){if(this.hasField(e))return this.autocastArcadeDate(e,this.readAttribute(e,!0));for(const i of this._joined)if(i.setIndex(this.getIndex()),i.hasField(e)){const r=i._readAttribute(e,!0);return this.autocastArcadeDate(e,r)}throw new Error(`Field ${e} does not exist`)}setField(e,i){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.getFieldNames()}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeature());const i=this.readLegacyFeature();if(!i)return JSON.stringify(null);const r={geometry:i.geometry,attributes:{...i.attributes?i.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._layerSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:e?.keepGeometryType===!0?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,i=null){return Promise.resolve(this.castAsJson(i))}removeIds(e){if(lt(this._objectIdToIndex)){const r=new Map,n=this.getCursor();for(;n.next();){const s=Ou(n.getObjectId());r.set(s,n.getIndex())}this._objectIdToIndex=r}const i=this._objectIdToIndex;for(const r of e)i.has(r)&&this.removeAtIndex(i.get(r))}removeAtIndex(e){lt(this._deleted)&&(this._deleted=QDe.create(this.getSize())),this._deleted.set(e)}readGeometryForDisplay(){return this.readUnquantizedGeometry(!0)}readLegacyGeometryForDisplay(){return this.readLegacyGeometry(!0)}*features(){const e=this.getCursor();for(;e.next();)yield e.readOptimizedFeature()}_getExists(){return lt(this._deleted)||!this._deleted.has(this.getIndex())}_computeCentroid(){if(this.geometryType!=="esriGeometryPolygon")return null;const e=this.readUnquantizedGeometry();if(!e||e.hasIndeterminateRingOrder)return null;const i=zu(this.getQuantizationTransform(),null);return Ggt(new Ml,e,this.hasM,this.hasZ,i)}copyInto(e){e.seen=this.seen,e._storage=this._storage,e._arcadeSpatialReference=this._arcadeSpatialReference,e._joined=this._joined,e._tx=this._tx,e._ty=this._ty,e._sx=this._sx,e._sy=this._sy,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex}},V0t=class xBe extends Hk{static from(e,i){return new xBe(e.copy(),i)}constructor(e,i){super(Hk.createInstance(),e.fullSchema()),this._currentIndex=-1,this._reader=e,this._indices=i}get hasNext(){return this._currentIndex+1>>16}function RJ(t){return 65535&t}const Lpe={getObjectId:t=>t.getObjectId(),getAttributes:t=>t.readAttributes(),getAttribute:(t,e)=>t.readAttribute(e),cloneWithGeometry:(t,e)=>t,getGeometry:t=>t.readHydratedGeometry(),getCentroid:(t,e)=>t.readCentroid()};let JLi=class extends ZDe{constructor(e,i,r){super(e,i),this.featureAdapter=Lpe,this.events=new md,this._featureSetsByInstance=new Map,this._objectIdToDisplayId=new Map,this._spatialIndexInvalid=!0,this._indexSearchCache=new GD(50),this._index=AN(9,n=>({minX:this._storage.getXMin(n),minY:this._storage.getYMin(n),maxX:this._storage.getXMax(n),maxY:this._storage.getYMax(n)})),this.mode=r}get storeStatistics(){let e=0,i=0,r=0;return this.forEach(n=>{const s=n.readGeometry();s&&(i+=s.isPoint?1:s.lengths.reduce((o,a)=>o+a,0),r+=s.isPoint?1:s.lengths.length,e+=1)}),{featureCount:e,vertexCount:i,ringCount:r}}hasInstance(e){return this._featureSetsByInstance.has(e)}onTileData(e,i){if(lt(i.addOrUpdate))return i;if(i.addOrUpdate.attachStorage(this._storage),this.mode==="snapshot"){const n=i.addOrUpdate.getCursor();for(;n.next();){const s=n.getDisplayId();this.setComputedAttributes(this._storage,n,s,e.scale)}return i}this._featureSetsByInstance.set(i.addOrUpdate.instance,i.addOrUpdate);const r=i.addOrUpdate.getCursor();for(;r.next();)this._insertFeature(r,e.scale);return this._spatialIndexInvalid=!0,this.events.emit("changed"),i}search(e){this._rebuildIndex();const i=e.id,r=this._indexSearchCache.find(a=>a.tileId===i);if(ve(r))return r.readers;const n=new Map,s=this._searchIndex(e.bounds),o=[];for(const a of s){const l=this._storage.getInstanceId(a),c=OJ(l),h=RJ(l);n.has(c)||n.set(c,[]),n.get(c).push(h)}return n.forEach((a,l)=>{const c=this._featureSetsByInstance.get(l);o.push(V0t.from(c,a))}),this._indexSearchCache.enqueue({tileId:i,readers:o}),o}insert(e){const i=e.getCursor(),r=this._storage;for(;i.next();){const n=G0t(i.instance,i.getIndex()),s=i.getObjectId(),o=this._objectIdToDisplayId.get(s)??this._storage.createDisplayId();i.setDisplayId(o),r.setInstanceId(o,n),this._objectIdToDisplayId.set(s,o)}this._featureSetsByInstance.set(e.instance,e),this._spatialIndexInvalid=!0}remove(e){const i=this._objectIdToDisplayId.get(e);if(!i)return;const r=this._storage.getInstanceId(i),n=RJ(r),s=OJ(r),o=this._featureSetsByInstance.get(s);this._objectIdToDisplayId.delete(e),this._storage.releaseDisplayId(i),o.removeAtIndex(n),o.isEmpty&&this._featureSetsByInstance.delete(s),this._spatialIndexInvalid=!0}forEach(e){this._objectIdToDisplayId.forEach(i=>{const r=this._storage.getInstanceId(i),n=this._lookupFeature(r);e(n)})}forEachUnsafe(e){this._objectIdToDisplayId.forEach(i=>{const r=this._storage.getInstanceId(i),n=OJ(r),s=RJ(r),o=this._getFeatureSet(n);o.setIndex(s),e(o)})}forEachInBounds(e,i){const r=this._searchIndex(e);for(const n of r){const s=this.lookupFeatureByDisplayId(n,this._storage);i(s)}}forEachBounds(e,i){this._rebuildIndex();for(const r of e){if(!r.readGeometry())continue;const n=r.getDisplayId();w7e(j0t,this._storage.getXMin(n),this._storage.getYMin(n),this._storage.getXMax(n),this._storage.getYMax(n)),i(j0t)}}sweepFeatures(e,i,r){this._spatialIndexInvalid=!0,this._objectIdToDisplayId.forEach((n,s)=>{e.has(n)||(i.releaseDisplayId(n),r&&r.unsetAttributeData(n),this._objectIdToDisplayId.delete(s))}),this.events.emit("changed")}sweepFeatureSets(e){this._spatialIndexInvalid=!0,this._featureSetsByInstance.forEach((i,r)=>{e.has(r)||this._featureSetsByInstance.delete(r)})}lookupObjectId(e,i){const r=this.lookupFeatureByDisplayId(e,i);return lt(r)?null:r.getObjectId()}lookupDisplayId(e){return this._objectIdToDisplayId.get(e)}lookupFeatureByDisplayId(e,i){const r=i.getInstanceId(e);return this._lookupFeature(r)}lookupByDisplayIdUnsafe(e){const i=this._storage.getInstanceId(e),r=OJ(i),n=RJ(i),s=this._getFeatureSet(r);return s?(s.setIndex(n),s):null}_insertFeature(e,i){const r=this._storage,n=e.getObjectId(),s=G0t(e.instance,e.getIndex());r.getInstanceId(e.getDisplayId());let o=this._objectIdToDisplayId.get(n);o||(o=r.createDisplayId(),this._objectIdToDisplayId.set(n,o),this._spatialIndexInvalid=!0),e.setDisplayId(o),r.setInstanceId(o,s),this.setComputedAttributes(r,e,o,i)}_searchIndex(e){this._rebuildIndex();const i={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(i)}_rebuildIndex(){if(!this._spatialIndexInvalid)return;const e=[];this.mode==="snapshot"?this._featureSetsByInstance.forEach(i=>{const r=i.getCursor();for(;r.next();){const n=r.getDisplayId();this._storage.setBounds(n,r)&&e.push(n)}}):this._objectIdToDisplayId.forEach(i=>{const r=this._storage.getInstanceId(i);this._storage.setBounds(i,this._lookupFeature(r))&&e.push(i)}),this._index.clear(),this._index.load(e),this._indexSearchCache.clear(),this._spatialIndexInvalid=!1}_lookupFeature(e){const i=OJ(e),r=this._getFeatureSet(i);if(!r)return;const n=r.getCursor(),s=RJ(e);return n.setIndex(s),n}_getFeatureSet(e){return this._featureSetsByInstance.get(e)}};const Npe=Oi.getLogger("esri.layers.graphics.sources.ogcfeature"),tFe="http://www.opengis.net/def/crs/",U0t=`${tFe}OGC/1.3/CRS84`;async function ZLi(t,e,i={},r=5){const{links:n}=t,s=QP(n,"items","application/geo+json")||QP(n,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(lt(s))throw new st("ogc-feature-layer:missing-items-page","Missing items url");const{data:o}=await ur(s.href,{signal:i.signal,query:{limit:r,...i.customParameters,token:i.apiKey},headers:{accept:"application/geo+json"}});await YDe(o);const a=N0t(o,{geometryType:e.geometryType}),l=e.fields||a.fields||[],c=e.hasZ!=null?e.hasZ:a.hasZ,h=a.geometryType,p=e.objectIdField||a.objectIdFieldName||"OBJECTID";let y=e.timeInfo;const v=l.find(({name:x})=>x===p);if(v)v.editable=!1,v.nullable=!1;else{if(!a.objectIdFieldType)throw new st("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");l.unshift({name:p,alias:p,type:a.objectIdFieldType==="number"?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(p!==a.objectIdFieldName){const x=l.find(({name:I})=>I===a.objectIdFieldName);x&&(x.type="esriFieldTypeInteger")}l===a.fields&&a.unknownFields.length>0&&Npe.warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:a.unknownFields}});for(const x of l){if(x.name==null&&(x.name=x.alias),x.alias==null&&(x.alias=x.name),x.type!=="esriFieldTypeOID"&&x.type!=="esriFieldTypeGlobalID"&&(x.editable=x.editable==null||!!x.editable,x.nullable=x.nullable==null||!!x.nullable),!x.name)throw new st("ogc-feature-layer:invalid-field-name","field name is missing",{field:x});if(!roe.jsonValues.includes(x.type))throw new st("ogc-feature-layer:invalid-field-type",`invalid type for field "${x.name}"`,{field:x})}if(y){const x=new Lm(l);if(y.startTimeField){const I=x.get(y.startTimeField);I?(y.startTimeField=I.name,I.type="esriFieldTypeDate"):y.startTimeField=null}if(y.endTimeField){const I=x.get(y.endTimeField);I?(y.endTimeField=I.name,I.type="esriFieldTypeDate"):y.endTimeField=null}if(y.trackIdField){const I=x.get(y.trackIdField);I?y.trackIdField=I.name:(y.trackIdField=null,Npe.warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:y}}))}y.startTimeField||y.endTimeField||(Npe.warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:y}}),y=null)}return{drawingInfo:h?iG(h):null,extent:l5i(t),geometryType:h,fields:l,hasZ:!!c,objectIdField:p,timeInfo:y}}async function QLi(t,e={}){const{links:i}=t,r=QP(i,"data","application/json")||QP(i,"http://www.opengis.net/def/rel/ogc/1.0/data","application/json");if(lt(r))throw new st("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:n,customParameters:s,signal:o}=e,{data:a}=await ur(r.href,{signal:o,headers:{accept:"application/json"},query:{...s,token:n}});return a}async function e5i(t,e={}){const{links:i}=t,r=QP(i,"conformance","application/json")||QP(i,"http://www.opengis.net/def/rel/ogc/1.0/conformance","application/json");if(lt(r))throw new st("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:n,customParameters:s,signal:o}=e,{data:a}=await ur(r.href,{signal:o,headers:{accept:"application/json"},query:{...s,token:n}});return a}async function t5i(t,e={}){const{apiKey:i,customParameters:r,signal:n}=e,{data:s}=await ur(t,{signal:n,headers:{accept:"application/json"},query:{...r,token:i}});return s}async function i5i(t,e={}){const i="application/vnd.oai.openapi+json;version=3.0",r=QP(t.links,"service-desc",i);if(lt(r))return Npe.warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:n,customParameters:s,signal:o}=e,{data:a}=await ur(r.href,{signal:o,headers:{accept:i},query:{...s,token:n}});return a}function z0t(t){const e=/^http:\/\/www\.opengis.net\/def\/crs\/(?.*)\/(?.*)\/(?.*)$/i.exec(t)?.groups;if(!e)return null;const{authority:i,code:r}=e;switch(i.toLowerCase()){case"ogc":switch(r.toLowerCase()){case"crs27":return hr.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return hr.WGS84.wkid;default:return null}case"esri":case"epsg":{const n=Number.parseInt(r,10);return Number.isNaN(n)?null:n}default:return null}}async function r5i(t,e,i){const r=await iFe(t,e,i);return zJe(r)}async function iFe(t,e,i){const{collection:r,layerDefinition:n,maxRecordCount:s,queryParameters:{apiKey:o,customParameters:a},spatialReference:l,supportedCrs:c}=t,{links:h}=r,p=QP(h,"items","application/geo+json")||QP(h,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(lt(p))throw new st("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:y,num:v,start:x,timeExtent:I,where:P}=e;if(e.objectIds)throw new st("ogc-feature-layer:query-by-objectids-not-supported","Queries with objectids are not supported");const F=hr.fromJSON(l),k=zu(e.outSpatialReference,F),j=k.isWGS84?null:H0t(k,c),V=a5i(y,c),Y=s5i(I),X=o5i(P),Z=v??(x!=null&&x!==void 0?10:s),{data:ie}=await ur(p.href,{...i,query:{...a,...V,crs:j,datetime:Y,query:X,limit:Z,startindex:x,token:o},headers:{accept:"application/geo+json"}});let ce=!1;ie.links&&(ce=!!ie.links.find(Ie=>Ie.rel==="next")),!ce&&Number.isInteger(ie.numberMatched)&&Number.isInteger(ie.numberReturned)&&(ce=ie.numberReturnedr.rel===e&&r.type===i)||t.find(r=>r.rel===e&&!r.type)}function u5i({coords:t,lengths:e}){let i=0;for(const r of e){for(let n=1;n!(r.objectId&&i.has(r.objectId)))}append(e){for(const i of e)this._features.push(i)}getSize(){return this._features.length}getCursor(){return this.copy()}getQuantizationTransform(){return this._transform}getAttributeHash(){let e="";for(const i in this._current.attributes)e+=this._current.attributes[i];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}getGroupId(){return this._current.groupId}setGroupId(e){this._current.groupId=e}copy(){const e=new lH(this.instance,this._features,this.fullSchema());return this.copyInto(e),e}next(){for(;++this._featureIndexi.toLowerCase()).includes(e.toLowerCase())}getFieldNames(){return Object.keys(this._current.attributes)}_readAttribute(e,i){const r=this._current.attributes[e];if(r!==void 0)return r!=null&&i&&this._dateFields.has(e)?new Date(r):r;const n=this.readAttributes(),s=e?.toLocaleLowerCase().trim();for(const o in n)if(o.toLocaleLowerCase().trim()===s){const a=this._current.attributes[o];return a!=null&&i&&this._dateFields.has(o)?new Date(a):a}}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._transform=this._transform,e._dateFields=this._dateFields}_readAttributes(){return this._current.attributes}};const nFe=268435455;let c5i=class{constructor(){this.fieldMap=new Map,this.fields=[],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}hasField(e){return this.fieldMap.has(e)}isDateField(e){return(e!=null&&this.fieldMap.get(e)?.isDate)??!1}getFieldIndex(e){return e!=null?this.fieldMap.get(e)?.index:void 0}};function h5i(t){const r=t.asUnsafe(),n=r.getLength(),s=r.pos()+n,o={name:"",isDate:!1};for(;r.pos()0}let _5i=class SBe extends Hk{static fromBuffer(e,i,r=!1){const n=i.geometryType,s=m5i(e),o=p5i(s,n==="esriGeometryPoint",r),a=Hk.createInstance();return new SBe(a,s,o,i)}constructor(e,i,r,n){super(e,n),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._geometryType=n.geometryType,this._reader=i,this._header=r,this._hasNext=r.hasFeatures,this._isPoints=n.geometryType==="esriGeometryPoint"}get geometryType(){return this._geometryType}get _size(){return this._header.featureCount}get hasZ(){return!1}get hasM(){return!1}get stride(){return 2+(this.hasZ?1:0)+(this.hasM?1:0)}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}hasField(e){return this._header.hasField(e)||this._header.hasField(X0t(e))}getFieldNames(){return this._header.fields.map(e=>e.fieldName)}getSize(){return this._size}getQuantizationTransform(){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="";return this._header.fields.forEach(({index:i})=>{e+=this._readAttributeAtIndex(i)+"."}),e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}getGroupId(){return this._header.groupIds[this._featureIndex]}setGroupId(e){this._header.groupIds[this._featureIndex]=e}readLegacyFeature(){if(this._cache.legacyFeature===void 0){const e=this.readCentroid(),i={attributes:this.readAttributes(),geometry:this._isPoints?this.readLegacyPointGeometry():this.readLegacyGeometry(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null};return this._cache.legacyFeature=i,i}return this._cache.legacyFeature}readOptimizedFeature(){if(this._cache.optFeature===void 0){const e=new c_(this.readGeometry(),this.readAttributes(),this.readCentroid());return e.objectId=this.getObjectId(),e.displayId=this.getDisplayId(),this._cache.optFeature=e,e}return this._cache.optFeature}getXHydrated(){const e=this._header.centroid[2*this._featureIndex],i=this.getQuantizationTransform();return lt(i)?e:e*i.scale[0]+i.translate[0]}getYHydrated(){const e=this._header.centroid[2*this._featureIndex+1],i=this.getQuantizationTransform();return lt(i)?e:i.translate[1]-e*i.scale[1]}getX(){return this._header.centroid[2*this._featureIndex]*this._sx+this._tx}getY(){return this._header.centroid[2*this._featureIndex+1]*this._sy+this._ty}readLegacyPointGeometry(){return{x:this.getX(),y:this.getY()}}readLegacyGeometry(e){const i=this.readGeometry(e);return pw(i,this.geometryType,!1,!1)}readLegacyCentroid(){const e=this.readCentroid();if(!e)return null;const[i,r]=e.coords;return{x:i,y:r}}readGeometryArea(){return this._cache.area||this.readGeometry(!0),this._cache.area}readUnquantizedGeometry(e=!1){if(this._cache.unquantGeometry===void 0){const i=this.readGeometry(e);if(!i)return this._cache.unquantGeometry=void 0,null;const r=Y0t(i.coords.length).decoded,n=i.clone(r),s=n.coords;let o=0;for(const a of n.lengths){for(let l=1;l{e[i]=this._readAttributeAtIndex(r)}),e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext}_readAttributeAtIndex(e){const i=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],r=this._reader;return r.move(i),y5i(r)}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex]+this._tx,i=this._header.centroid[2*this._featureIndex+1]+this._ty;return e===sFe?null:new Ml([],[e,i])}_parseGeometry(e){const n=e.asUnsafe(),s=n.getLength(),o=n.pos()+s,a=[],l=[];for(;n.pos()p.length)for(let P=0;P=P?(y+=-.5*(he-V)*(_e+Y),k>1&&oFe(p[h-2],p[h-1],X,Z)?(p[h-2]+=X,p[h-1]+=Z):(p[h++]=X,p[h++]=Z,k++),V=he,Y=_e):(ie+=X,ce+=Z),X=ie,Z=ce,F++}k<3||j?h-=2*k:(y+=-.5*(V+X-V)*(Y+Z+Y),oFe(p[h-2],p[h-1],X,Z)?(p[h-2]+=X,p[h-1]+=Z,l.push(k)):(p[h++]=X,p[h++]=Z,l.push(++k)))}else{let P=0,F=n.getSInt32(),k=n.getSInt32();this.hasZ&&n.getSInt32(),this.hasM&&n.getSInt32(),p[h++]=F,p[h++]=k,P+=1;for(let j=1;j2&&oFe(p[h-2],p[h-1],V,Y)?(p[h-2]+=V,p[h-1]+=Y):(p[h++]=V,p[h++]=Y,P+=1),F=X,k=Z}l.push(P)}break}default:n.skip()}if(this._cache.area=y,!l.length)return null;if(this._tx||this._ty){let x=0;sg(p);for(const I of l)p[2*x]+=this._tx,p[2*x+1]+=this._ty,x+=I}return new Ml(l,p)}},kpe=class{constructor(e){this.service=e}destroy(){}};function b5i(t){return Array.isArray(t.source)}function w5i(t){return t?.type==="ogc-source"}function x5i(t){const{capabilities:e}=t;return w5i(t.source)?new I5i(t):b5i(t)?new C5i(t):e.query.supportsFormatPBF&&Hi("featurelayer-pbf")?new T5i(t):new E5i(t)}async function S5i(t){const e=new vHe;return await e.open(t,{}),e}let C5i=class extends kpe{constructor(e){super(e),this._portsOpen=S5i(e.source).then(i=>this.client=i)}destroy(){this.client.close(),this.client=null}async executeQuery(e,i){await this._portsOpen;const r=await this.client.invoke("queryFeatures",e.toJSON(),i);return Ev.fromFeatureSet(r,this.service)}},T5i=class extends kpe{async executeQuery(e,i){const{data:r}=await OJe(this.service.source,e,i),n=!e.quantizationParameters;return _5i.fromBuffer(r,this.service,n)}},E5i=class extends kpe{async executeQuery(e,i){const{source:r,capabilities:n,spatialReference:s,objectIdField:o,geometryType:a}=this.service;if(ve(e.quantizationParameters)&&!n.query.supportsQuantization){const c=e.clone(),h=Gde(c.quantizationParameters);c.quantizationParameters=null;const{data:p}=await EB(r,c,s,i),y=OTe(p,o);return HJe(h,y),Ev.fromOptimizedFeatureSet(y,this.service)}const{data:l}=await EB(r,e,this.service.spatialReference,i);return a==="esriGeometryPoint"&&(l.features=l.features?.filter(c=>{if(ve(c.geometry)){const h=c.geometry;return Number.isFinite(h.x)&&Number.isFinite(h.y)}return!0})),Ev.fromFeatureSet(l,this.service)}},I5i=class extends kpe{async executeQuery(e,i){const{capabilities:r}=this.service;if(e.quantizationParameters&&!r.query.supportsQuantization){const s=e.clone(),o=Gde(s.quantizationParameters);s.quantizationParameters=null;const a=await iFe(this.service.source,e,i);return HJe(o,a),Ev.fromOptimizedFeatureSet(a,this.service)}const n=await iFe(this.service.source,e,i);return Ev.fromOptimizedFeatureSet(n,this.service)}},k_=class n_e{constructor(){this.version=0,this.source=!1,this.targets={feature:!1,aggregate:!1},this.storage={filters:!1,data:!1},this.mesh=!1,this.queryFilter=!1,this.why={mesh:[],source:[]}}static create(e){const i=new n_e;for(const r in e){const n=e[r];if(typeof n=="object")for(const s in n){const o=n[s];i[r][s]=o}i[r]=n}return i}static empty(){return n_e.create({})}static all(){return n_e.create({source:!0,targets:{feature:!0,aggregate:!0},storage:{filters:!0,data:!0},mesh:!0})}unset(e){this.version=e.version,e.source&&(this.source=!1),e.targets.feature&&(this.targets.feature=!1),e.targets.aggregate&&(this.targets.aggregate=!1),e.storage.filters&&(this.storage.filters=!1),e.storage.data&&(this.storage.data=!1),e.mesh&&(this.mesh=!1),e.queryFilter&&(this.queryFilter=!1)}any(){return this.source||this.mesh||this.storage.filters||this.storage.data||this.targets.feature||this.targets.aggregate||this.queryFilter}describe(){let e=0,i="";if(this.mesh){e+=20,i+=`-> (20) Mesh needs update `;for(const n of this.why.mesh)i+=` + ${n} `}if(this.source){e+=10,i+=`-> (10) The source needs update `;for(const n of this.why.source)i+=` + ${n} `}this.targets.feature&&(e+=5,i+=`-> (5) Feature target parameters changed `),this.storage.filters&&(e+=5,i+=`-> (5) Feature filter parameters changed `),this.targets.aggregate&&(e+=4,i+=`-> (4) Aggregate target parameters changed -`),this.storage.data&&(e+=1,i+="-> (1) Texture storage parameters changed");const r=e<5?"Fastest":e<10?"Fast":e<15?"Moderate":e<20?"Slow":"Very Slow";console.debug(`Applying ${r} update of cost ${e}/45 `),console.debug(i)}toJSON(){return{queryFilter:this.queryFilter,source:this.source,targets:this.targets,storage:this.storage,mesh:this.mesh}}},xLi=class{constructor(e,i){this.requests={done:new Array,stream:new BD(10)},this._edits=null,this._abortController=new AbortController,this._version=0,this._done=!1,this.didSend=!1,this.tile=e,this._version=i}get signal(){return this._abortController.signal}get options(){return{signal:this._abortController.signal}}get empty(){return!this.requests.done.length&<(this.edits)}get edits(){return this._edits}get done(){return this._done}end(){this._done=!0}clear(){this.requests.done=[]}applyUpdate(e){this.requests.done.forEach(i=>i.message.status.unset(e)),this._version=e.version,ye(this._edits)&&this._edits.status.unset(e)}add(e){e.message.status=e.message.status??D_.empty(),e.message.status.version=this._version,Gi("esri-2d-update-debug")&&console.debug(this.tile.id,"DataTileSubscription:add",this._version),e.message.end&&this.requests.done.forEach(i=>{ye(i.message)&&i.message.end&&(i.message.end=!1)}),this.requests.done.push(e)}edit(e,i){const r=e.getQuantizationTransform(),n=e.fullSchema(),s=Array.from(e.features()).filter(ye),o=[...i,...s.map(a=>a.objectId)];if(this.removeIds(o),this._invalidate(),lt(this._edits))return void(this._edits={type:"append",addOrUpdate:Sv.fromOptimizedFeatures(s,n,r),id:this.tile.id,status:D_.empty(),end:!0});this.requests.done.forEach(a=>a.message.end=!1),this._edits.addOrUpdate.append(e.features())}*readers(){for(const{message:e}of this.requests.done)ye(e.addOrUpdate)&&(yield e.addOrUpdate);ye(this._edits)&&ye(this._edits.addOrUpdate)&&(yield this._edits.addOrUpdate)}_invalidate(){for(const e of this.requests.done)e.message.status=D_.empty();ye(this._edits)&&(this._edits.status=D_.empty())}removeIds(e){this._invalidate();for(const{message:i}of this.requests.done){const r=i.addOrUpdate;ye(r)&&(r.removeIds(e),r.isEmpty&&(Gi("esri-2d-update-debug")&&console.debug("Removing FeatureSetReader"),i.addOrUpdate=null))}ye(this._edits)&&ye(this._edits.addOrUpdate)&&this._edits.addOrUpdate.removeIds(e),this.requests.done=this.requests.done.filter(i=>i.message.addOrUpdate||i.message.end)}abort(){this._abortController.abort()}};function SLi(t,e){const i=new Set;return t&&t.forEach(r=>i.add(r)),e&&e.forEach(r=>i.add(r)),i.has("*")?["*"]:Array.from(i)}let c0t=class extends fn{constructor(e){super(),this.events=new cd,this._resolver=Mf(),this._didEdit=!1,this._subscriptions=new Map,this._outSR=e.outSR,this._serviceInfo=e.serviceInfo,this._onTileUpdateMessage=e.onMessage}async _onMessage(e){const i=this._subscriptions.get(e.id);if(!i)return;const r={...e,remove:e.remove??[],status:e.status??D_.empty()};return cf(this._onTileUpdateMessage(r,i.options))}update(e,i){const r=i.fields.length;i.outFields=SLi(this._schema?.outFields,i.outFields),i.outFields=i.outFields.length>=.75*r?["*"]:i.outFields,i.outFields.sort();const n=d2(this._schema,i);if(!n)return;Gi("esri-2d-update-debug")&&console.debug("Applying Update - Source:",n);const s="orderByFields"in this._serviceInfo&&this._serviceInfo.orderByFields?this._serviceInfo.orderByFields:this._serviceInfo.objectIdField+" ASC",o={returnCentroid:this._serviceInfo.geometryType==="esriGeometryPolygon",returnGeometry:!0,timeReferenceUnknownClient:this._serviceInfo.type!=="stream"&&this._serviceInfo.timeReferenceUnknownClient,outFields:i.outFields,outSpatialReference:this._outSR,orderByFields:[s],where:i.definitionExpression||"1=1",gdbVersion:i.gdbVersion,historicMoment:i.historicMoment,timeExtent:i.timeExtent?Wg.fromJSON(i.timeExtent):null},a=this._schema&&vA(n,"outFields");this._schema&&QVt(n,["timeExtent","definitionExpression","gdbVersion","historicMoment","customParameters"])&&(e.why.mesh.push("Layer filter and/or custom parameters changed"),e.why.source.push("Layer filter and/or custom parameters changed"),e.mesh=!0,e.source=!0,e.queryFilter=!0),a&&(e.why.source.push("Layer required fields changed"),e.source=!0),d2(o,this._queryInfo)&&(this._queryInfo=o),this._schema=i,this._resolver.resolve()}whenInitialized(){return this._resolver.promise}async applyUpdate(e){if(e.queryFilter||e.source&&this._didEdit)return this.refresh(e.version),void(this._didEdit=!1);this._subscriptions.forEach(i=>i.applyUpdate(e)),await this.resend()}refresh(e,i){for(const r of this._tiles())this.unsubscribe(r),this.subscribe(r,e)}subscribe(e,i){const r=new xLi(e,i);this._subscriptions.set(e.id,r)}unsubscribe(e){const i=this.getSubscription(e.id);ye(i)&&i.abort(),this._subscriptions.delete(e.id)}createQuery(e={}){const i=this._queryInfo.historicMoment?new Date(this._queryInfo.historicMoment):null;return new Ss({...this._queryInfo,historicMoment:i,...e})}getSubscription(e){return this._subscriptions.has(e)?this._subscriptions.get(e):null}async queryLastEditDate(){throw new Error("Service does not support query type")}async query(e,i){throw new Error("Service does not support query")}*_tiles(){const e=Array.from(this._subscriptions.values());for(const i of e)yield i.tile}async edit(e,i){const r=Array.from(this._subscriptions.values()),n=r.map(({tile:s})=>s);for(const s of r)s.removeIds(i);if(e.length){const s=n.map(a=>{const l=this.createTileQuery(a);return l.objectIds=e,{tile:a,query:l}}).map(async({tile:a,query:l})=>({tile:a,result:await this.query(l,{query:{tile:Gi("esri-tiles-debug")?a.id.replace(/\//g,"."):void 0}}),query:l})),o=(await AH(s)).map(async({tile:a,result:l})=>{if(!l.hasFeatures&&!i.length&&!e.length)return;const c=this._subscriptions.get(a.key.id);c&&c.edit(l,e)});await bu(o)}this._didEdit=!0}};const CLi=4;let $De=class extends c0t{constructor(e){super(e),this.type="feature",this.mode="on-demand",this._adapter=gLi(e.serviceInfo),this._queue=new _k({concurrency:8,process:async i=>{if(sn(i),ye(i.tile)){const r=i.tile.key.id,{signal:n}=i,s=Gi("esri-tiles-debug")?{tile:r.replace(/\//g,"."),depth:i.depth}:void 0,o=await this._adapter.executeQuery(i.query,{signal:n,query:{...s,...this._schema?.customParameters}});return o.level=i.tile.key.level,o}return this._adapter.executeQuery(i.query,{...i,query:this._schema?.customParameters})}}),this._patchQueue=new _k({concurrency:8,process:async i=>{if(sn(i),ye(i.tile)){const r=i.tile.key.id,{signal:n}=i,s=Gi("esri-tiles-debug")?{tile:r.replace(/\//g,"."),depth:i.depth}:void 0,o=await this._adapter.executeQuery(i.query,{signal:n,query:{...s,...this._schema?.customParameters}});return o.level=i.tile.key.level,o}return this._adapter.executeQuery(i.query,{...i,query:this._schema?.customParameters})}})}destroy(){super.destroy(),this._adapter.destroy(),this._queue.destroy(),this._patchQueue.destroy()}get updating(){return!!this._queue.length||Array.from(this._subscriptions.values()).some(e=>!e.done)}get maxRecordCountFactor(){const{query:e}=this._serviceInfo.capabilities;return e.supportsMaxRecordCountFactor?CLi:null}get maxPageSize(){const{query:e}=this._serviceInfo.capabilities;return(e.maxRecordCount??8e3)*Fu(this.maxRecordCountFactor,1)}get pageSize(){return Math.min(8e3,this.maxPageSize)}enableEvent(e,i){}subscribe(e,i){super.subscribe(e,i);const r=this._subscriptions.get(e.id);this._fetchDataTile(e).catch(n=>{ss(n)||Ei.getLogger("esri.views.2d.layers.features.sources.BaseFeatureSource").error(new st("mapview-query-error","Encountered error when fetching tile",{tile:e,error:n}))}).then(()=>r.end())}unsubscribe(e){super.unsubscribe(e)}readers(e){return this._subscriptions.get(e).readers()}async query(e,i={}){const r=i.query??{};return this._adapter.executeQuery(e,{...i,query:{...r,...this._schema?.customParameters}})}async queryLastEditDate(){const e=this._serviceInfo.source,i={...e.query,f:"json"};return(await ir(e.path,{query:i,responseType:"json"})).data.editingInfo.lastEditDate}createTileQuery(e,i={}){const r=this._serviceInfo.geometryType,n=this.createQuery(i);n.quantizationParameters=i.quantizationParameters??e.getQuantizationParameters(),n.resultType="tile",n.geometry=e.extent,this._serviceInfo.capabilities.query.supportsQuantization?r==="esriGeometryPolyline"&&(n.maxAllowableOffset=e.resolution*Gi("feature-polyline-generalization-factor")):r!=="esriGeometryPolyline"&&r!=="esriGeometryPolygon"||(n.maxAllowableOffset=e.resolution,r==="esriGeometryPolyline"&&(n.maxAllowableOffset*=Gi("feature-polyline-generalization-factor")));const s=this._serviceInfo.capabilities.query;return n.defaultSpatialReferenceEnabled=s.supportsDefaultSpatialReference,n.compactGeometryEnabled=s.supportsCompactGeometry,n}async _executePatchQuery(e,i,r,n){const s=i.clone();s.outFields=[this._serviceInfo.objectIdField,...r],s.returnCentroid=!1,s.returnGeometry=!1;const o=ye(s.start)?s.start/8e3:0,a=n.signal;return this._patchQueue.push({tile:e,query:s,signal:a,depth:o})}async _resend(e,i){const{query:r,message:n}=e,s=ye(r.outFields)?r.outFields:[],o=this._queryInfo.outFields,a=o.filter(l=>!s.includes(l));if(lt(n.addOrUpdate))this._onMessage({...n,type:"append"});else if(a.length)try{const l=this._subscriptions.get(n.id).tile,c=await this._executePatchQuery(l,r,a,i);sn(i),r.outFields=o,n.addOrUpdate.joinAttributes(c),this._onMessage({...n,end:n.end,type:"append"})}catch{}else this._onMessage({...n,type:"append"})}async _resendSubscription(e){if(Gi("esri-2d-update-debug")&&console.debug(e.tile.id,"Resend Subscription"),e.empty)return this._onMessage({id:e.tile.id,addOrUpdate:null,end:!1,type:"append"});const i=e.signal;for(const r of e.requests.done)await this._resend(r,{signal:i});return ye(e.edits)?this._onMessage(e.edits):void 0}async resend(){const e=Array.from(this._subscriptions.values());await Promise.all(e.map(i=>this._resendSubscription(i)))}};const h0t=Gi("esri-mobile"),d0t={maxDrillLevel:h0t?1:4,maxRecordCountFactor:h0t?1:3};let TLi=class extends $De{constructor(e){super(e)}async _fetchDataTile(e){const i=this._serviceInfo.capabilities.query.supportsMaxRecordCountFactor,r=this._subscriptions.get(e.key.id),n=r.signal,s=e.getQuantizationParameters();let o=0;const a=async(l,c)=>{const d=this._queryInfo,p=this.createTileQuery(l,{maxRecordCountFactor:i?d0t.maxRecordCountFactor:void 0,returnExceededLimitFeatures:!1,quantizationParameters:s});o++;try{const y=await this._queue.push({tile:e,query:p,signal:n,depth:c});if(o--,sn(n),!y)return;if(d!==this._queryInfo)return void a(l,c);if(y.exceededTransferLimit&&c{a--,sn(n);const v=e.id,S=p.reader,I=p.query;if(!S.exceededTransferLimit){if(s=!0,y!==0&&!S.hasFeatures){const N={id:v,addOrUpdate:S,end:a===0,type:"append"};return n.add({message:N,query:I}),void this._onMessage(N)}const L={id:v,addOrUpdate:S,end:a===0,type:"append"};return n.add({message:L,query:I}),void this._onMessage(L)}const O={id:v,addOrUpdate:S,end:s&&a===0,type:"append"};n.add({message:O,query:I}),this._onMessage(O)};let c=0,d=0;for(;!s&&d++<20;){let p;for(let y=0;yS&&l(S,v)).catch(S=>{s=!0,ss(S)||(Ei.getLogger("esri.views.2d.layers.features.sources.PagedFeatureSource").error(new st("mapview-query-error","Encountered error when fetching tile",{tile:e,error:S})),this._onMessage({id:e.id,addOrUpdate:null,end:s,type:"append"}))})}await p,sn(n),c=Math.min(c+2,6)}}async _fetchDataTilePage(e,i,r){sn(r);const n=this._queryInfo,s={start:this.pageSize*i,num:this.pageSize,returnExceededLimitFeatures:!0,quantizationParameters:e.getQuantizationParameters()};ye(this.maxRecordCountFactor)&&(s.maxRecordCountFactor=this.maxRecordCountFactor);const o=this.createTileQuery(e,s);try{const a=r.signal,l=await this._queue.push({tile:e,query:o,signal:a,depth:i});return sn(r),l?n!==this._queryInfo?this._fetchDataTilePage(e,i,r):{reader:l,query:o}:null}catch(a){return wC(a),null}}};function ILi(t,e,i){const r=t.getXHydrated(),n=t.getYHydrated(),s=e.getColumnForX(r),o=Math.floor(e.normalizeCol(s));return`${i}/${Math.floor(e.getRowForY(n))}/${o}`}function BDe(t,e){if(lt(t))return null;const i=e.transform,r=t.getQuantizationTransform();if(lt(r)){const[O,L]=i.scale,[N,G]=i.translate,V=-N/O,Y=1/O,X=G/L,te=1/-L;return t.transform(V,X,Y,te)}const[n,s]=r.scale,[o,a]=r.translate,[l,c]=i.scale,[d,p]=i.translate,y=n/l,v=(o-d)/l,S=s/c,I=(-a+p)/c;return t.transform(v,I,y,S)}let ALi=class extends $De{constructor(e){super(e),this.mode="snapshot",this._loading=!0,this._controller=new AbortController,this._downloadPromise=null,this._didSendEnd=!1,this._queries=new Array,this._invalidated=!1,this._hasAggregates=!1,this._random=new bC(1e3),this._store=e.store,this._markedIdsBufId=this._store.storage.createBitset()}destroy(){super.destroy(),this._controller.abort()}get loading(){return this._loading}get _signal(){return this._controller.signal}update(e,i){super.update(e,i),this._featureCount==null&&(this._featureCount=i.initialFeatureCount),ye(i.changedFeatureCount)&&(this._featureCount=i.changedFeatureCount),this._hasAggregates=!!e.targets?.aggregate}async resend(e=!1){if(await this._downloadPromise,this._invalidated||e){const r=_u(this._featureCount,"Expected featureCount to be defined");return this._invalidated=!1,this._subscriptions.forEach(n=>n.clear()),this._downloadPromise=this._download(r),void await this._downloadPromise}const i=this._queries.map(({query:r,reader:n})=>this._sendPatchQuery(r,n));await Promise.all(i),this._subscriptions.forEach(r=>{r.requests.done.forEach(n=>this._onMessage(n.message))})}async refresh(e,i){i&&(this._featureCount=i.featureCount),await this.resend(!0)}async _sendPatchQuery(e,i){const r=ye(e.outFields)?e.outFields:[],n=this._queryInfo.outFields,s=n.filter(c=>!r.includes(c));if(!s.length)return;const o=e.clone(),a=this._signal;o.returnGeometry=!1,o.returnCentroid=!1,o.outFields=s,e.outFields=n;const l=await this._queue.push({query:o,depth:0,signal:a});sn({signal:a}),i.joinAttributes(l)}async _fetchDataTile(e){if(!this._downloadPromise){const l=_u(this._featureCount,"Expected featureCount to be defined");this._downloadPromise=this._download(l)}const i=this._store.search(e),r=this._subscriptions.get(e.key.id),n=i.length-1;for(let l=0;l=0?i[n]:null,e),o=this._didSendEnd,a={type:"append",id:e.id,addOrUpdate:s,end:o,status:D_.empty()};r.add({query:null,message:a}),this._onMessage(a)}async _download(e){try{await this.whenInitialized();const i=this._store.storage.getBitset(this._markedIdsBufId),r=new Set;i.clear();const n=Math.ceil(e/this.pageSize),s=Array.from({length:n},(o,a)=>a).sort((o,a)=>this._random.getInt()-this._random.getInt()).map(o=>this._downloadPage(o,i,r));await Promise.all(s),this._store.sweepFeatures(i,this._store.storage),this._store.sweepFeatureSets(r)}catch(i){Ei.getLogger("esri.views.2d.layers.features.sources.SnapshotFeatureSource").error("mapview-snapshot-source","Encountered and error when downloading feature snapshot",i)}this._sendEnd(),this._loading=!1}async _downloadPage(e,i,r){const n=this.pageSize,s={start:e*n,num:n,cacheHint:!0};ye(this.maxRecordCountFactor)&&(s.maxRecordCountFactor=this.maxRecordCountFactor);const o=this.createQuery(s),a=this._signal,l=await this._queue.push({query:o,depth:e,signal:a});sn({signal:a}),this._queries.push({query:o,reader:l}),this._store.insert(l),r.add(l.instance);const c=l.getCursor();for(;c.next();)i.set(c.getDisplayId());this._send(l)}_send(e){if(!this._subscriptions.size)return;let i=null;const r=new Map,n=new Set,s=new Map;this._subscriptions.forEach(o=>{const a=o.tile;r.set(a.key.id,null),i=a.tileInfoView,n.add(a.level);const{row:l,col:c}=a.key,d=`${a.level}/${l}/${c}`,p=s.get(d)??[];p.push(o),s.set(d,p)});for(const o of n){const a=i.getLODInfoAt(o),l=e.getCursor();for(;l.next();){const c=ILi(l,a,o),d=l.getIndex();if(s.has(c))for(const p of s.get(c)){const y=p.tile.id;let v=r.get(y);lt(v)&&(v=[],r.set(y,v)),v.push(d)}}}r.forEach((o,a)=>{if(ye(o)){const l=this._subscriptions.get(a),c={type:"append",id:a,addOrUpdate:BDe(e0t.from(e,o),l.tile),end:!1,status:D_.empty()};l.add({query:null,message:c}),this._onMessage(c)}})}_sendEnd(){this._subscriptions.forEach(e=>{const i={type:"append",id:e.tile.id,addOrUpdate:null,end:!0,status:D_.empty()};e.add({query:null,message:i}),this._onMessage(i)}),this._didSendEnd=!0}};const PLi="__esri_stream_id__",p0t="__esri_timestamp__",f0t=1e3;let OLi=class{constructor(e,i,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=i,this.purgeInterval=s,this._useGeneratedIds=this.objectIdField===PLi}removeById(e){this._removed.push(e)}removeByTrackId(e){const i=this._trackIdToObservations.get(e);if(i)for(const r of i.entries)this._removed.push(r)}add(e){if(this._useGeneratedIds){const s=this._nextId();e.attributes[this.objectIdField]=s,e.objectId=s}else e.objectId=e.attributes[this.objectIdField];const i=e.objectId;if(this._addOrUpdated.set(i,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return lt(this._trackIdLessObservations)&&(this._trackIdLessObservations=new BD(1e5)),void this._trackIdLessObservations.enqueue(i);const r=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(r)){const s=ye(this._purgeOptions)&&this._purgeOptions.maxObservations!=null?this._purgeOptions.maxObservations:f0t,o=Hl(s,0,f0t);this._trackIdToObservations.set(r,new BD(o))}const n=this._trackIdToObservations.get(r)?.enqueue(i);ye(n)&&(this._addOrUpdated.has(n)?this._addOrUpdated.delete(n):this._removed.push(n))}checkForUpdates(){const e=this._getToAdd(),i=this._getToRemove(),r=performance.now();r-this._lastPurge>=this.purgeInterval&&(this._purge(r),this._lastPurge=r);const n=[];if(ye(i))for(const o of i){const a=this.store.removeById(o);ye(a)&&n.push(a)}const s=[];if(ye(e)){const o=new Set(Fu(i,[]));for(const a of e)o.has(a.objectId)||(a.attributes[p0t]=r,this.store.add(a),s.push(a))}(s.length||n?.length)&&this.store.update(s,n)}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let i=0;return this._addOrUpdated.forEach(r=>e[i++]=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 i=this._purgeOptions;ye(i)&&(this._purgeSomeByDisplayCount(i),this._purgeByAge(i),this._purgeByAgeReceived(e,i),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let i=this.store.size;if(i>e.displayCount){if(this._timeInfo.trackIdField){for(const r of this._trackIdToObservations.values())if(i>e.displayCount&&r.size){const n=r.dequeue();this._removed.push(n),i--}}if(ye(this._trackIdLessObservations)){let r=i-e.displayCount;for(;r-- >0;){const n=this._trackIdLessObservations.dequeue();ye(n)&&this._removed.push(n)}}}}_purgeByAge(e){const i=this._timeInfo?.startTimeField;if(!e.age||!i)return;const r=60*e.age*1e3,n=this._maxAge-r;this.store.forEach(s=>{s.attributes[i]{n.attributes[p0t]{e.size===0&&this._trackIdToObservations.delete(i)})}},ppe=class extends cd.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new st("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};E([k({readOnly:!0})],ppe.prototype,"connectionError",null),ppe=E([ht("esri.layers.support.StreamConnection")],ppe);const m0t=ppe;var sU;(function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSING=2]="CLOSING",t[t.CLOSED=3]="CLOSED"})(sU||(sU={}));let oU=class extends m0t{constructor(e){super(),this._outstandingMessages=[],this.errorString=null;const{geometryType:i,spatialReference:r,sourceSpatialReference:n}=e;this._config=e,this._featureZScaler=k9(i,n,r),this._open()}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),ye(this._websocket)&&(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(lt(this._websocket))return"disconnected";switch(this._websocket.readyState){case sU.CONNECTING:case sU.OPEN:return"connected";case sU.CLOSING:case sU.CLOSED:return"disconnected"}}sendMessageToSocket(e){lt(this._websocket)?this._outstandingMessages.push(e):this._websocket.send(JSON.stringify(e))}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,ye(this._websocket)&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,i=1e3,r=0){try{if(this.destroyed)return;const n=jy(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(n),this.notifyChange("connectionStatus")}catch(n){const s=i/1e3;return this._config.maxReconnectionAttempts&&r>=this._config.maxReconnectionAttempts?(Ei.getLogger(this.declaredClass).error(new st("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(Ei.getLogger(this.declaredClass).error(new st("websocket-connection",`Failed to connect. Attempting to reconnect in ${s}s`,n)),await B3(i),this._tryCreateWebSocket(e,Math.min(1.5*i,1e3*this._config.maxReconnectionInterval),r+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=i=>{try{const r=JSON.parse(i.data);this._onMessage(r)}catch(r){return void Ei.getLogger(this.declaredClass).error(new st("websocket-connection","Failed to parse message, invalid JSON",{error:r}))}}}_createWebSocket(e){return new Promise((i,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),i(n)},n.onclose=s=>{n.onopen=n.onclose=null,r(s)}})}async _handshake(e=1e4){const i=this._websocket;if(lt(i))return;const r=Mf(),n=i.onmessage,{filter:s,outFields:o,spatialReference:a}=this._config;return r.timeout(e),i.onmessage=l=>{let c=null;try{c=JSON.parse(l.data)}catch{}c&&typeof c=="object"||(Ei.getLogger(this.declaredClass).error(new st("websocket-connection","Protocol violation. Handshake failed - malformed message",l.data)),r.reject(),this.destroy()),c.spatialReference?.wkid!==a?.wkid&&(Ei.getLogger(this.declaredClass).error(new st("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${a.wkid}`,l.data)),r.reject(),this.destroy()),c.format!=="json"&&(Ei.getLogger(this.declaredClass).error(new st("websocket-connection","Protocol violation. Handshake failed - format is not set",l.data)),r.reject(),this.destroy()),s&&c.filter!==s&&Ei.getLogger(this.declaredClass).error(new st("websocket-connection","Tried to set filter, but server doesn't support it")),o&&c.outFields!==o&&Ei.getLogger(this.declaredClass).error(new st("websocket-connection","Tried to set outFields, but server doesn't support it")),i.onmessage=n;for(const d of this._outstandingMessages)i.send(JSON.stringify(d));this._outstandingMessages=[],r.resolve()},i.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 i of e.features)ye(this._featureZScaler)&&this._featureZScaler(i.geometry),this.onFeature(i)}}_onError(e){const i="Encountered an error over WebSocket connection";this._set("errorString",i),Ei.getLogger(this.declaredClass).error("websocket-connection",i)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),e.code!==1e3&&Ei.getLogger(this.declaredClass).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};E([k()],oU.prototype,"connectionStatus",null),E([k()],oU.prototype,"errorString",void 0),oU=E([ht("esri.layers.graphics.sources.connections.WebSocketConnection")],oU);const RLi=1e4,MLi={maxQueryDepth:5,maxRecordCountFactor:3};let GDe=class extends oU{constructor(e){super({...MLi,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||Ei.getLogger(this.declaredClass).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 i=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(i);const{filter:r,outFields:n}=this._config;this.destroyed||this._setFilter(r,n)}_onMessage(e){if("attributes"in e){let i;try{i=this._enrich(e),ye(this._featureZScaler)&&this._featureZScaler(i.geometry)}catch(r){return void Ei.getLogger(this.declaredClass).error(new st("geoevent-connection","Failed to parse message",r))}this.onFeature(i)}else this.onMessage(e)}async _fetchServiceDefinition(e){const i={f:"json",...this._config.customParameters},r=ir(e.path,{query:i,responseType:"json"}),n=(await r).data;return this._serviceDefinition=n,n}_fetchWebSocketUrl(e,i){const r=e[0],{urls:n,token:s}=r,o=this._inferWebSocketBaseUrl(n);return jy(`${o}/subscribe`,{outSR:""+i.wkid,token:s})}_inferWebSocketBaseUrl(e){if(e.length===1)return e[0];for(const i of e)if(i.includes("wss"))return i;return Ei.getLogger(this.declaredClass).error(new st("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,i){const r=this._websocket;if(lt(r)||lt(e)&<(i))return;const n=JSON.stringify({filter:this._serializeFilter(e,i)});let s=!1;const o=Mf(),a=()=>{s||(this.destroyed||this._websocket!==r||Ei.getLogger(this.declaredClass).error(new st("geoevent-connection","Server timed out when setting filter")),o.reject())},l=c=>{const d=JSON.parse(c.data);d.filter&&(d.error&&(Ei.getLogger(this.declaredClass).error(new st("geoevent-connection","Failed to set service filter",d.error)),this._set("errorString",`Could not set service filter - ${d.error}`),o.reject(d.error)),this._setWebSocketJSONParseHandler(r),s=!0,o.resolve())};return r.onmessage=l,r.send(n),setTimeout(a,RLi),o.promise}_serializeFilter(e,i){const r={};if(lt(e)&<(i))return r;if(ye(e)&&e.geometry)try{const n=fl(e.geometry);if(n.type!=="extent")throw new st(`Expected extent but found type ${n.type}`);r.geometry=JSON.stringify(n.shiftCentralMeridian())}catch(n){Ei.getLogger(this.declaredClass).error(new st("geoevent-connection","Encountered an error when setting connection geometryDefinition",n))}return ye(e)&&e.where&&e.where!=="1 = 1"&&e.where!=="1=1"&&(r.where=e.where),ye(i)&&(r.outFields=i.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const i=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[i],n=this._relatedFeatures.get(r);if(!n)return Ei.getLogger(this.declaredClass).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||Ei.getLogger(this.declaredClass).error(new st("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:i}=this._serviceDefinition,r=this._queryRelatedFeatures(e),n=this._queryArchive(i);await r;const s=await n;if(!s)return;for(const o of s.features)this.onFeature(this._enrich(o))}catch(e){Ei.getLogger(this.declaredClass).error(new st("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const i=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(i)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const i=new(await Promise.resolve().then(()=>nCe)).default({url:e}),{capabilities:r}=await i.load(),n=r.query.supportsMaxRecordCountFactor,s=r.query.supportsPagination,o=r.query.supportsCentroid,a=this._config.maxRecordCountFactor,l=i.capabilities.query.maxRecordCount,c=n?l*a:l,d=new Ss;if(d.outFields=Fu(this._config.outFields,["*"]),d.where=Fu(qx(this._config.filter,"where"),"1=1"),d.returnGeometry=!0,d.returnExceededLimitFeatures=!0,d.outSpatialReference=rr.fromJSON(this._config.spatialReference),o&&(d.returnCentroid=!0),n&&(d.maxRecordCountFactor=a),s)return d.num=c,i.destroy(),this._queryPages(e,d);const p=await AB(e,d,this._config.sourceSpatialReference);return i.destroy(),p.data}async _queryPages(e,i,r=[],n=0){i.start=ye(i.num)?n*i.num:null;const{data:s}=await AB(e,i,this._config.sourceSpatialReference);return s.exceededTransferLimit&&n<(this._config.maxQueryDepth??0)?(s.features.forEach(o=>r.push(o)),this._queryPages(e,i,r,n+1)):(r.forEach(o=>s.features.push(o)),s)}_addRelatedFeatures(e){const i=new Map,r=e.features,n=this._serviceDefinition.relatedFeatures.joinField;for(const s of r){const o=s.attributes[n];i.set(o,s)}this._relatedFeatures=i}};GDe=E([ht("esri.layers.graphics.sources.connections.GeoEventConnection")],GDe);const DLi=GDe;let IJ=class extends m0t{constructor(e){super(),this.connectionStatus="connected",this.errorString=null;const{geometryType:i,spatialReference:r,sourceSpatialReference:n}=e;this._featureZScaler=k9(i,n,r)}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const i of e.features)ye(this._featureZScaler)&&this._featureZScaler(i.geometry),this.onFeature(i)}this.onMessage(e)}};E([k()],IJ.prototype,"connectionStatus",void 0),E([k()],IJ.prototype,"errorString",void 0),IJ=E([ht("esri.layers.support.ClientSideConnection")],IJ);function g0t(t,e,i,r,n,s,o,a){const l={source:t,sourceSpatialReference:e,spatialReference:i,geometryType:r,filter:n,maxReconnectionAttempts:s,maxReconnectionInterval:o,customParameters:a};return t?t.path.startsWith("wss://")||t.path.startsWith("ws://")?new oU(l):new DLi(l):new IJ(l)}const FLi=Object.freeze(Object.defineProperty({__proto__:null,createConnection:g0t},Symbol.toStringTag,{value:"Module"})),LLi=2500;function kLi(t,e){const i=t.weakClone();if(ye(t.geometry)){const r=vY(e,t.geometry.coords[0]),n=_Y(e,t.geometry.coords[1]);i.geometry=new Sl([],[r,n])}return i}function NLi(t){return t==="esriGeometryPoint"?kLi:(e,i)=>{const r=e.weakClone(),n=new Sl,s=!1,o=!1,a=UA(n,e.geometry,s,o,t,i,!1,!1);return r.geometry=a,r}}function $Li(t){return t==="esriGeometryPoint"?e=>ye(e.geometry)?{minX:e.geometry.coords[0],minY:e.geometry.coords[1],maxX:e.geometry.coords[0],maxY:e.geometry.coords[1]}:{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}:e=>{let i=1/0,r=1/0,n=-1/0,s=-1/0;return ye(e.geometry)&&e.geometry.forEachVertex((o,a)=>{i=Math.min(i,o),r=Math.min(r,a),n=Math.max(n,o),s=Math.max(s,a)}),{minX:i,minY:r,maxX:n,maxY:s}}}function BLi(t,e){const i=Tk(9,$Li(e));return i.load(t),i}function GLi(t,e){return t.search({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]})}let VLi=class{constructor(e,i){this.onUpdate=e,this._geometryType=i,this._objectIdToFeature=new Map,this._index=null}get _features(){const e=[];return this._objectIdToFeature.forEach(i=>e.push(i)),e}add(e){this._objectIdToFeature.set(e.objectId,e),this._index=null}get(e){return this._objectIdToFeature.has(e)?this._objectIdToFeature.get(e):null}forEach(e){this._objectIdToFeature.forEach(e)}search(e){return this._index||(this._index=BLi(this._features,this._geometryType)),GLi(this._index,e)}clear(){this._index=null,this._objectIdToFeature.clear()}removeById(e){const i=this._objectIdToFeature.get(e);return i?(this._objectIdToFeature.delete(e),this._index=null,i):null}update(e,i){this.onUpdate(e,i)}get size(){return this._objectIdToFeature.size}},aU=class extends c0t{constructor(e){super(e),this.type="stream",this._updateIntervalId=0,this._level=0,this._updateInfo={websocket:0,client:0},this._isPaused=!1,this._inUpdate=!1;const{outSR:i}=e,{geometryType:r,objectIdField:n,timeInfo:s,purgeOptions:o,source:a,spatialReference:l,serviceFilter:c,maxReconnectionAttempts:d,maxReconnectionInterval:p,updateInterval:y,customParameters:v,enabledEventTypes:S}=e.serviceInfo,I=new VLi(this._onUpdate.bind(this),r),O=new OLi(I,n,s,o),L=g0t(a,l,i,r,c,d,p,v??{});this._store=I,this._manager=O,this._connection=L,this._quantize=NLi(r),this._enabledEventTypes=new Set(S),this._handles=[this._connection.on("data-received",N=>this._onFeature(N)),this._connection.on("message-received",N=>this._onWebSocketMessage(N))],this._initUpdateInterval=()=>{let N=performance.now();this._updateIntervalId=setInterval(()=>{const G=performance.now(),V=G-N;if(V>LLi){N=G;const Y=Math.round(this._updateInfo.client/(V/1e3)),X=Math.round(this._updateInfo.websocket/(V/1e3));this._updateInfo.client=0,this._updateInfo.websocket=0,this.events.emit("updateRate",{client:Y,websocket:X})}e.canAcceptRequest()&&!this._inUpdate&&this._manager.checkForUpdates()},y)},this._initUpdateInterval()}destroy(){super.destroy(),this._clearUpdateInterval(),this._handles.forEach(e=>e.remove()),this._connection.destroy()}_fetchDataTile(){}get connectionStatus(){return this._isPaused?"paused":this._connection?.connectionStatus}get errorString(){return this._connection?.errorString}updateCustomParameters(e){this._connection.updateCustomParameters(e)}pauseStream(){this._isPaused||(this._isPaused=!0,this._clearUpdateInterval())}resumeStream(){this._isPaused&&(this._isPaused=!1,this._initUpdateInterval())}sendMessageToSocket(e){this._connection.sendMessageToSocket(e)}sendMessageToClient(e){this._connection.sendMessageToClient(e)}enableEvent(e,i){i?this._enabledEventTypes.add(e):this._enabledEventTypes.delete(e)}get updating(){return!1}subscribe(e,i){super.subscribe(e,i);const r=this._subscriptions.get(e.id);this._level=e.level;const n=this._getTileFeatures(e);this._onMessage({type:"append",id:e.key.id,addOrUpdate:n,end:!0}),r.didSend=!0}unsubscribe(e){super.unsubscribe(e)}*readers(e){const i=this._subscriptions.get(e),{tile:r}=i;yield this._getTileFeatures(r)}createTileQuery(e){throw new Error("Service does not support tile queries")}async resend(){this._subscriptions.forEach(e=>{const{tile:i}=e,r={type:"append",id:i.id,addOrUpdate:this._getTileFeatures(i),end:!0};this._onMessage(r)})}_getTileFeatures(e){const i=this._store.search(e).map(r=>this._quantize(r,e.transform));return Sv.fromOptimizedFeatures(i,this._serviceInfo,e.transform)}_onWebSocketMessage(e){if(this._enabledEventTypes.has("message-received")&&this.events.emit("message-received",e),"type"in e)switch(e.type){case"delete":if(e.objectIds)for(const i of e.objectIds)this._manager.removeById(i);if(e.trackIds)for(const i of e.trackIds)this._manager.removeByTrackId(i);break;case"clear":this._store.forEach(i=>this._manager.removeById(i.objectId))}}_onFeature(e){this._updateInfo.websocket++;try{this._enabledEventTypes.has("data-received")&&this.events.emit("data-received",e);const i=CTe(e,this._serviceInfo.geometryType,!1,!1,this._serviceInfo.objectIdField);this._manager.add(i)}catch{}}_clearUpdateInterval(){clearInterval(this._updateIntervalId),this._updateIntervalId=0}async _onUpdate(e,i){this._inUpdate=!0;try{ye(e)&&(this._updateInfo.client+=e.length),this._subscriptions.forEach((n,s)=>{n.didSend&&n.tile.level===this._level&&this._onMessage({type:"append",id:s,addOrUpdate:null,clear:!0,end:!1})});const r=[];this._subscriptions.forEach((n,s)=>{if(!n.didSend||n.tile.level!==this._level)return;const o=n.tile,a={type:"append",id:s,addOrUpdate:this._getTileFeatures(o),remove:[],end:!1,status:D_.empty()};n.requests.stream.enqueue(a),r.push(this._onMessage(a))}),await Promise.all(r),this._subscriptions.forEach((n,s)=>{n.didSend&&n.tile.level===this._level&&this._onMessage({type:"append",id:s,addOrUpdate:null,end:!0})})}catch{}this._inUpdate=!1}};E([k()],aU.prototype,"_isPaused",void 0),E([k()],aU.prototype,"connectionStatus",null),E([k()],aU.prototype,"errorString",null),aU=E([ht("esri.views.2d.layers.features.sources")],aU);function ULi(t,e,i,r,n,s){const o=jLi(t,e,i,r,n,s);switch(o.type){case"feature":switch(o.origin){case"hosted":case"local":return new ELi(o);case"snapshot":return new ALi(o);default:return new TLi(o)}case"stream":return new aU(o)}}function jLi(t,e,i,r,n,s){switch(t.type){case"snapshot":return{type:"feature",origin:"snapshot",featureCount:Fu(t.featureCount,0),serviceInfo:t,onMessage:r,outSR:e,tileInfoView:i,canAcceptRequest:n,store:s};case"stream":return{type:"stream",serviceInfo:t,onMessage:r,outSR:e,canAcceptRequest:n};case"memory":case"on-demand":return{type:"feature",serviceInfo:t,onMessage:r,outSR:e,origin:o(t.source),tileInfoView:i,canAcceptRequest:n}}function o(a){return Array.isArray(a)?"local":"path"in a&&N9(a.path)?"hosted":"unknown"}}const VDe=1e-30,y0t=4294967295,Tc=512,zLi=8,v0t=10,UDe=29,fpe=24,HLi=8,_0t=0,b0t=0,mpe=0,gpe=1,ype=2,jDe=3,zDe=4,vpe=5,_pe=6,w0t=12,AJ=5,x0t=6,WLi=5,qLi=6,YLi=0,HDe=1,bpe=2,WDe=3,XLi=4,S0t=2,KLi=1,C0t=2,JLi=4,qDe=1.05,T0t=3,Kw=5,E0t=6,I0t=1.15,Ec=2,PJ=8,ZLi=500,cy=10,A0t=1024,zN=2,QLi=0,e5i=1,t5i=4,i5i=8,wpe=16,P0t=4,r5i=1,O0t=4,R0t=8,n5i=128,s5i=4,o5i=2,Jf=8388607,M0t=8388608,a5i=254,l5i=255,u5i=0,YDe=1,XDe=t=>(t&M0t)>>>23,JP=t=>t&Jf,c5i=t=>XDe(t)===YDe?a5i:l5i;function D0t(t){return XDe(t)===YDe}function KDe(t,e){return((e?M0t:0)|t)>>>0}var vf,Zf,hy,F0t,F_,L0t,JDe,ZDe,QDe,k0t,hS,N0t,$0t,B0t,G0t,eFe,tFe,V0t,U0t,lU,Il,HN,j0t,z0t,ZP,H0t,W0t,uU,iFe,q0t,Y0t,X0t,K0t,J0t,Z0t,dS,L_,Q0t,evt,pS,tvt,ivt,rvt,nvt,fS,OJ,GD,cU,svt,ovt,avt,lvt,uvt,cvt,hvt,xpe,Spe,dvt,rFe,pvt,fvt;(function(t){t[t.BUTT=0]="BUTT",t[t.ROUND=1]="ROUND",t[t.SQUARE=2]="SQUARE",t[t.UNKNOWN=4]="UNKNOWN"})(vf||(vf={})),function(t){t[t.BEVEL=0]="BEVEL",t[t.ROUND=1]="ROUND",t[t.MITER=2]="MITER",t[t.UNKNOWN=4]="UNKNOWN"}(Zf||(Zf={})),function(t){t[t.SCREEN=0]="SCREEN",t[t.MAP=1]="MAP"}(hy||(hy={})),function(t){t[t.Tint=0]="Tint",t[t.Ignore=1]="Ignore",t[t.Multiply=99]="Multiply"}(F0t||(F0t={})),function(t){t.Both="Both",t.JustBegin="JustBegin",t.JustEnd="JustEnd",t.None="None"}(F_||(F_={})),function(t){t[t.Mosaic=0]="Mosaic",t[t.Centered=1]="Centered"}(L0t||(L0t={})),function(t){t[t.Normal=0]="Normal",t[t.Superscript=1]="Superscript",t[t.Subscript=2]="Subscript"}(JDe||(JDe={})),function(t){t[t.MSSymbol=0]="MSSymbol",t[t.Unicode=1]="Unicode"}(ZDe||(ZDe={})),function(t){t[t.Unspecified=0]="Unspecified",t[t.TrueType=1]="TrueType",t[t.PSOpenType=2]="PSOpenType",t[t.TTOpenType=3]="TTOpenType",t[t.Type1=4]="Type1"}(QDe||(QDe={})),function(t){t[t.Display=0]="Display",t[t.Map=1]="Map"}(k0t||(k0t={})),function(t){t.None="None",t.Loop="Loop",t.Oscillate="Oscillate"}(hS||(hS={})),function(t){t[t.Z=0]="Z",t[t.X=1]="X",t[t.Y=2]="Y"}(N0t||(N0t={})),function(t){t[t.XYZ=0]="XYZ",t[t.ZXY=1]="ZXY",t[t.YXZ=2]="YXZ"}($0t||($0t={})),function(t){t[t.Rectangle=0]="Rectangle",t[t.RoundedRectangle=1]="RoundedRectangle",t[t.Oval=2]="Oval"}(B0t||(B0t={})),function(t){t[t.None=0]="None",t[t.Alpha=1]="Alpha",t[t.Screen=2]="Screen",t[t.Multiply=3]="Multiply",t[t.Add=4]="Add"}(G0t||(G0t={})),function(t){t[t.TTB=0]="TTB",t[t.RTL=1]="RTL",t[t.BTT=2]="BTT"}(eFe||(eFe={})),function(t){t[t.None=0]="None",t[t.SignPost=1]="SignPost",t[t.FaceNearPlane=2]="FaceNearPlane"}(tFe||(tFe={})),function(t){t[t.Float=0]="Float",t[t.String=1]="String",t[t.Boolean=2]="Boolean"}(V0t||(V0t={})),function(t){t[t.Intersect=0]="Intersect",t[t.Subtract=1]="Subtract"}(U0t||(U0t={})),function(t){t.OpenEnded="OpenEnded",t.Block="Block",t.Crossed="Crossed"}(lU||(lU={})),function(t){t.FullGeometry="FullGeometry",t.PerpendicularFromFirstSegment="PerpendicularFromFirstSegment",t.ReversedFirstSegment="ReversedFirstSegment",t.PerpendicularToSecondSegment="PerpendicularToSecondSegment",t.SecondSegmentWithTicks="SecondSegmentWithTicks",t.DoublePerpendicular="DoublePerpendicular",t.OppositeToFirstSegment="OppositeToFirstSegment",t.TriplePerpendicular="TriplePerpendicular",t.HalfCircleFirstSegment="HalfCircleFirstSegment",t.HalfCircleSecondSegment="HalfCircleSecondSegment",t.HalfCircleExtended="HalfCircleExtended",t.OpenCircle="OpenCircle",t.CoverageEdgesWithTicks="CoverageEdgesWithTicks",t.GapExtentWithDoubleTicks="GapExtentWithDoubleTicks",t.GapExtentMidline="GapExtentMidline",t.Chevron="Chevron",t.PerpendicularWithArc="PerpendicularWithArc",t.ClosedHalfCircle="ClosedHalfCircle",t.TripleParallelExtended="TripleParallelExtended",t.ParallelWithTicks="ParallelWithTicks",t.Parallel="Parallel",t.PerpendicularToFirstSegment="PerpendicularToFirstSegment",t.ParallelOffset="ParallelOffset",t.OffsetOpposite="OffsetOpposite",t.OffsetSame="OffsetSame",t.CircleWithArc="CircleWithArc",t.DoubleJog="DoubleJog",t.PerpendicularOffset="PerpendicularOffset",t.LineExcludingLastSegment="LineExcludingLastSegment",t.MultivertexArrow="MultivertexArrow",t.CrossedArrow="CrossedArrow",t.ChevronArrow="ChevronArrow",t.ChevronArrowOffset="ChevronArrowOffset",t.PartialFirstSegment="PartialFirstSegment",t.Arch="Arch",t.CurvedParallelTicks="CurvedParallelTicks",t.Arc90Degrees="Arc90Degrees"}(Il||(Il={})),function(t){t.Mitered="Mitered",t.Bevelled="Bevelled",t.Rounded="Rounded",t.Square="Square",t.TrueBuffer="TrueBuffer"}(HN||(HN={})),function(t){t.ClosePath="ClosePath",t.ConvexHull="ConvexHull",t.RectangularBox="RectangularBox"}(j0t||(j0t={})),function(t){t.BeginningOfLine="BeginningOfLine",t.EndOfLine="EndOfLine"}(z0t||(z0t={})),function(t){t.Mitered="Mitered",t.Bevelled="Bevelled",t.Rounded="Rounded",t.Square="Square"}(ZP||(ZP={})),function(t){t.Fast="Fast",t.Accurate="Accurate"}(H0t||(H0t={})),function(t){t.BeginningOfLine="BeginningOfLine",t.EndOfLine="EndOfLine"}(W0t||(W0t={})),function(t){t.Sinus="Sinus",t.Square="Square",t.Triangle="Triangle",t.Random="Random"}(uU||(uU={})),function(t){t[t.None=0]="None",t[t.Default=1]="Default",t[t.Force=2]="Force"}(iFe||(iFe={})),function(t){t[t.Buffered=0]="Buffered",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.AlongLine=3]="AlongLine"}(q0t||(q0t={})),function(t){t[t.Linear=0]="Linear",t[t.Rectangular=1]="Rectangular",t[t.Circular=2]="Circular",t[t.Buffered=3]="Buffered"}(Y0t||(Y0t={})),function(t){t[t.Discrete=0]="Discrete",t[t.Continuous=1]="Continuous"}(X0t||(X0t={})),function(t){t[t.AcrossLine=0]="AcrossLine",t[t.AloneLine=1]="AloneLine"}(K0t||(K0t={})),function(t){t[t.Left=0]="Left",t[t.Right=1]="Right",t[t.Center=2]="Center",t[t.Justify=3]="Justify"}(J0t||(J0t={})),function(t){t[t.Base=0]="Base",t[t.MidPoint=1]="MidPoint",t[t.ThreePoint=2]="ThreePoint",t[t.FourPoint=3]="FourPoint",t[t.Underline=4]="Underline",t[t.CircularCW=5]="CircularCW",t[t.CircularCCW=6]="CircularCCW"}(Z0t||(Z0t={})),function(t){t.Butt="Butt",t.Round="Round",t.Square="Square"}(dS||(dS={})),function(t){t.NoConstraint="NoConstraint",t.HalfPattern="HalfPattern",t.HalfGap="HalfGap",t.FullPattern="FullPattern",t.FullGap="FullGap",t.Custom="Custom"}(L_||(L_={})),function(t){t[t.None=-1]="None",t[t.Custom=0]="Custom",t[t.Circle=1]="Circle",t[t.OpenArrow=2]="OpenArrow",t[t.ClosedArrow=3]="ClosedArrow",t[t.Diamond=4]="Diamond"}(Q0t||(Q0t={})),function(t){t[t.ExtraLeading=0]="ExtraLeading",t[t.Multiple=1]="Multiple",t[t.Exact=2]="Exact"}(evt||(evt={})),function(t){t.Bevel="Bevel",t.Round="Round",t.Miter="Miter"}(pS||(pS={})),function(t){t[t.Default=0]="Default",t[t.String=1]="String",t[t.Numeric=2]="Numeric"}(tvt||(tvt={})),function(t){t[t.InsidePolygon=0]="InsidePolygon",t[t.PolygonCenter=1]="PolygonCenter",t[t.RandomlyInsidePolygon=2]="RandomlyInsidePolygon"}(ivt||(ivt={})),function(t){t[t.Tint=0]="Tint",t[t.Replace=1]="Replace",t[t.Multiply=2]="Multiply"}(rvt||(rvt={})),function(t){t[t.ClipAtBoundary=0]="ClipAtBoundary",t[t.RemoveIfCenterOutsideBoundary=1]="RemoveIfCenterOutsideBoundary",t[t.DoNotTouchBoundary=2]="DoNotTouchBoundary",t[t.DoNotClip=3]="DoNotClip"}(nvt||(nvt={})),function(t){t.NoConstraint="NoConstraint",t.WithMarkers="WithMarkers",t.WithFullGap="WithFullGap",t.WithHalfGap="WithHalfGap",t.Custom="Custom"}(fS||(fS={})),function(t){t.Fixed="Fixed",t.Random="Random",t.RandomFixedQuantity="RandomFixedQuantity"}(OJ||(OJ={})),function(t){t.LineMiddle="LineMiddle",t.LineBeginning="LineBeginning",t.LineEnd="LineEnd",t.SegmentMidpoint="SegmentMidpoint"}(GD||(GD={})),function(t){t.OnPolygon="OnPolygon",t.CenterOfMass="CenterOfMass",t.BoundingBoxCenter="BoundingBoxCenter"}(cU||(cU={})),function(t){t[t.Low=0]="Low",t[t.Medium=1]="Medium",t[t.High=2]="High"}(svt||(svt={})),function(t){t[t.MarkerCenter=0]="MarkerCenter",t[t.MarkerBounds=1]="MarkerBounds"}(ovt||(ovt={})),function(t){t[t.None=0]="None",t[t.PropUniform=1]="PropUniform",t[t.PropNonuniform=2]="PropNonuniform",t[t.DifUniform=3]="DifUniform",t[t.DifNonuniform=4]="DifNonuniform"}(avt||(avt={})),function(t){t.Tube="Tube",t.Strip="Strip",t.Wall="Wall"}(lvt||(lvt={})),function(t){t[t.Random=0]="Random",t[t.Increasing=1]="Increasing",t[t.Decreasing=2]="Decreasing",t[t.IncreasingThenDecreasing=3]="IncreasingThenDecreasing"}(uvt||(uvt={})),function(t){t[t.Relative=0]="Relative",t[t.Absolute=1]="Absolute"}(cvt||(cvt={})),function(t){t[t.Normal=0]="Normal",t[t.LowerCase=1]="LowerCase",t[t.Allcaps=2]="Allcaps"}(hvt||(hvt={})),function(t){t[t.LTR=0]="LTR",t[t.RTL=1]="RTL"}(xpe||(xpe={})),function(t){t.Draft="Draft",t.Picture="Picture",t.Text="Text"}(Spe||(Spe={})),function(t){t[t.Top=0]="Top",t[t.Center=1]="Center",t[t.Baseline=2]="Baseline",t[t.Bottom=3]="Bottom"}(dvt||(dvt={})),function(t){t[t.Right=0]="Right",t[t.Upright=1]="Upright"}(rFe||(rFe={})),function(t){t[t.Small=0]="Small",t[t.Medium=1]="Medium",t[t.Large=2]="Large"}(pvt||(pvt={})),function(t){t[t.Calm=0]="Calm",t[t.Rippled=1]="Rippled",t[t.Slight=2]="Slight",t[t.Moderate=3]="Moderate"}(fvt||(fvt={}));var wn,io,hU,ed,dU,pU,Yo;(function(t){t[t.FILL=0]="FILL",t[t.LINE=1]="LINE",t[t.MARKER=2]="MARKER",t[t.TEXT=3]="TEXT",t[t.LABEL=4]="LABEL"})(wn||(wn={})),function(t){t[t.NONE=0]="NONE",t[t.MAP=1]="MAP",t[t.LABEL=2]="LABEL",t[t.LABEL_ALPHA=4]="LABEL_ALPHA",t[t.HITTEST=8]="HITTEST",t[t.HIGHLIGHT=16]="HIGHLIGHT",t[t.CLIP=32]="CLIP",t[t.DEBUG=64]="DEBUG",t[t.NUM_DRAW_PHASES=9]="NUM_DRAW_PHASES"}(io||(io={})),function(t){t[t.SIZE=0]="SIZE",t[t.COLOR=1]="COLOR",t[t.OPACITY=2]="OPACITY",t[t.ROTATION=3]="ROTATION"}(hU||(hU={})),function(t){t[t.NONE=0]="NONE",t[t.OPACITY=1]="OPACITY",t[t.COLOR=2]="COLOR",t[t.ROTATION=4]="ROTATION",t[t.SIZE_MINMAX_VALUE=8]="SIZE_MINMAX_VALUE",t[t.SIZE_SCALE_STOPS=16]="SIZE_SCALE_STOPS",t[t.SIZE_FIELD_STOPS=32]="SIZE_FIELD_STOPS",t[t.SIZE_UNIT_VALUE=64]="SIZE_UNIT_VALUE"}(ed||(ed={})),function(t){t[t.MINMAX_TARGETS_OUTLINE=128]="MINMAX_TARGETS_OUTLINE",t[t.SCALE_TARGETS_OUTLINE=256]="SCALE_TARGETS_OUTLINE",t[t.FIELD_TARGETS_OUTLINE=512]="FIELD_TARGETS_OUTLINE",t[t.UNIT_TARGETS_OUTLINE=1024]="UNIT_TARGETS_OUTLINE"}(dU||(dU={})),function(t){t[t.SPRITE=0]="SPRITE",t[t.GLYPH=1]="GLYPH"}(pU||(pU={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.SIMPLE=1]="SIMPLE",t[t.DOT_DENSITY=2]="DOT_DENSITY",t[t.OUTLINE_FILL=3]="OUTLINE_FILL",t[t.OUTLINE_FILL_SIMPLE=4]="OUTLINE_FILL_SIMPLE",t[t.HEATMAP=5]="HEATMAP",t[t.PIE_CHART=6]="PIE_CHART"}(Yo||(Yo={}));const RJ=Ei.getLogger("esri.views.2d.engine.webgl.Utils"),k_="geometry",h5i=[{name:k_,strideInBytes:12}],d5i=[{name:k_,strideInBytes:36}],p5i=[{name:k_,strideInBytes:24}],f5i=[{name:k_,strideInBytes:12}],m5i=[{name:k_,strideInBytes:40}],g5i=[{name:k_,strideInBytes:36}],y5i=[{name:k_,strideInBytes:36}];function VD(t){const e={};for(const i of t)e[i.name]=i.strideInBytes;return e}const v5i=VD([{name:k_,strideInBytes:36}]),_5i=VD(h5i),b5i=VD(d5i),w5i=VD(p5i),x5i=VD(f5i),S5i=VD(m5i),C5i=VD(g5i),T5i=VD(y5i);function Cpe(t,e){switch(t){case wn.MARKER:return e===Yo.HEATMAP?_5i:v5i;case wn.FILL:switch(e){case Yo.DOT_DENSITY:return x5i;case Yo.SIMPLE:case Yo.OUTLINE_FILL_SIMPLE:return w5i;default:return b5i}case wn.LINE:return S5i;case wn.TEXT:return C5i;case wn.LABEL:return T5i}}const E5i=[k_],I5i=[k_],A5i=[k_],P5i=[k_],O5i=[k_];function R5i(t){switch(t){case wn.MARKER:return E5i;case wn.FILL:return I5i;case wn.LINE:return A5i;case wn.TEXT:return P5i;case wn.LABEL:return O5i}}function MJ(t){switch(t%4){case 0:case 2:return 4;case 1:case 3:return 1}}function nFe(t,e){switch(e%4){case 0:case 2:return new Uint32Array(Math.floor(t*e/4));case 1:case 3:return new Uint8Array(t*e)}}function Tpe(t,e){switch(e%4){case 0:case 2:return new Uint32Array(t);case 1:case 3:return new Uint8Array(t)}}function mvt(t){return t!=null}function Epe(t){return typeof t=="number"}function M5i(t){switch(t){case"butt":return vf.BUTT;case"round":return vf.ROUND;case"square":return vf.SQUARE;default:return RJ.error(new st("mapview-invalid-type",`Cap type ${t} is not a valid option. Defaulting to round`)),vf.ROUND}}function D5i(t){switch(t){case"miter":return Zf.MITER;case"bevel":return Zf.BEVEL;case"round":return Zf.ROUND;default:return RJ.error(new st("mapview-invalid-type",`Join type ${t} is not a valid option. Defaulting to round`)),Zf.ROUND}}function F5i(t){switch(t){case"opacity":return hU.OPACITY;case"color":return hU.COLOR;case"rotation":return hU.ROTATION;case"size":return hU.SIZE;default:return RJ.error(`Cannot interpret unknown vv: ${t}`),null}}function sFe(t,e,i,r,n,s,o){for(const a in s){const l=s[a].stride,c=MJ(l),d=s[a].data,p=i[a].data;if(d==null||p==null)continue;const y=l*n.vertexCount/c,v=l*t/c,S=l*n.vertexFrom/c;for(let I=0;I{const o=new qo(s.name,s.count,s.type,n,0,s.normalized||!1);return n+=s.count*N5i(s.type),o}),e[i]?.forEach(s=>s.stride=n)}return e}const G5i=t=>{const e=new Map;for(const i in t)for(const r of t[i])e.set(r.name,r.location);return e},V5i=t=>{const e={};for(const i in t){const r=t[i];e[i]=r?.length?r[0].stride:0}return e},oFe=new Map,QP=(t,e)=>{if(!oFe.has(t)){const i=B5i(e),r={strides:V5i(i),bufferLayouts:i,attributes:G5i(e)};oFe.set(t,r)}return oFe.get(t)};function aFe(t){t(wn.FILL),t(wn.LINE),t(wn.MARKER),t(wn.TEXT),t(wn.LABEL)}const gvt=t=>"path"in t&&X5i(t.path),U5i=t=>"url"in t&&t.url||"imageData"in t&&t.imageData,yvt=t=>"imageData"in t&&t.imageData&&"contentType"in t&&t.contentType?`data:${t.contentType};base64,${t.imageData}`:"url"in t?t.url:null,vvt=t=>t!=null&&t.startsWith("data:image/gif"),j5i=t=>"url"in t&&t.url&&(t.url.includes(".gif")||vvt(t.url))||"contentType"in t&&t.contentType==="image/gif"||"imageData"in t&&vvt(t.imageData),_vt=t=>t!=null&&t.startsWith("data:image/png"),z5i=t=>"url"in t&&t.url&&(t.url.includes(".png")||_vt(t.url))||"contentType"in t&&t.contentType==="image/png"||"imageData"in t&&_vt(t.imageData),H5i=t=>t.type&&t.type.toLowerCase().includes("3d");function W5i(t){switch(t.type){case"line":{const e=t;return e.cim.type==="CIMSolidStroke"&&!e.dashTemplate}case"fill":return t.cim.type==="CIMSolidFill";case"esriSFS":return t.style==="esriSFSSolid"||t.style==="esriSFSNull";case"esriSLS":return t.style==="esriSLSSolid"||t.style==="esriSLSNull";default:return!1}}const q5i=t=>t.includes("data:image/svg+xml");function Ipe(t){switch("cim"in t?t.cim.type:t.type){case"esriSMS":case"esriPMS":case"CIMPointSymbol":return!1;case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":return wvt(t);default:return!0}}function bvt(t){const e="maxVVSize"in t&&t.maxVVSize,i="width"in t&&t.width||"size"in t&&t.size||0;return e||i}function Y5i(t){const e=[];for(let i=0;i!!t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4)),wvt=t=>t.type==="fill"&&t?.cim?.markerPlacement?.type==="CIMMarkerPlacementInsidePolygon",xvt=(t,e)=>t&&((...i)=>e.warn("DEBUG:",...i))||(()=>null),Svt=!1,K5i=new Float32Array(1);new Uint32Array(K5i.buffer);function FJ(t){return[255&t,(65280&t)>>>8,(16711680&t)>>>16,(4278190080&t)>>>24]}function Ln(t,e){return 65535&t|e<<16}function Up(t,e,i,r){return 255&t|(255&e)<<8|(255&i)<<16|r<<24}function J5i(t,e=0,i=!1){const r=t[e+3];return t[e+0]*=r,t[e+1]*=r,t[e+2]*=r,i||(t[e+3]*=255),t}function jp(t){if(!t)return 0;const{r:e,g:i,b:r,a:n}=t;return Up(e*n,i*n,r*n,255*n)}function db(t){if(!t)return 0;const[e,i,r,n]=t;return Up(e*(n/255),i*(n/255),r*(n/255),n)}function fU(t,e,i=0){if(lt(e))return t[i+0]=0,t[i+1]=0,t[i+2]=0,void(t[i+3]=0);const{r,g:n,b:s,a:o}=e;t[i+0]=r*o/255,t[i+1]=n*o/255,t[i+2]=s*o/255,t[i+3]=o}function Cvt(t){return Epe(t.minDataValue)&&Epe(t.maxDataValue)&&t.minSize!=null&&t.maxSize!=null?ed.SIZE_MINMAX_VALUE:(t.expression&&t.expression==="view.scale"||t.valueExpression&&t.valueExpression==="$view.scale")&&Array.isArray(t.stops)?ed.SIZE_SCALE_STOPS:(t.field!=null||t.expression&&t.expression!=="view.scale"||t.valueExpression&&t.valueExpression!=="$view.scale")&&(Array.isArray(t.stops)||"levels"in t&&t.levels)?ed.SIZE_FIELD_STOPS:(t.field!=null||t.expression&&t.expression!=="view.scale"||t.valueExpression&&t.valueExpression!=="$view.scale")&&t.valueUnit!=null?ed.SIZE_UNIT_VALUE:(Ei.getLogger("esri.views.2d.engine.webgl").error(new st("mapview-bad-type","Found invalid size VisualVariable",t)),ed.NONE)}function Z5i(t,e){if(!t||!e)return t;switch(e){case"radius":case"distance":return 2*t;case"diameter":case"width":return t;case"area":return Math.sqrt(t)}return t}function Q5i(t){return{value:t.value,size:Da(t.size)}}function lFe(t){return(t??[]).map(e=>Q5i(e))}function Tvt(t){if(typeof t=="string"||typeof t=="number")return Da(t);const e=t;return{type:"size",expression:e.expression,stops:lFe(e.stops)}}const Evt=t=>{const e=[],i=[],r=lFe(t),n=r.length;for(let s=0;s<6;s++){const o=r[Math.min(s,n-1)];e.push(o.value),i.push(o.size==null?VDe:on(o.size))}return{values:new Float32Array(e),sizes:new Float32Array(i)}};function eki(t){const e=t&&t.length>0?{}:null,i=e?{}:null;if(!e||!i)return{vvFields:e,vvRanges:i};for(const r of t)if(r.field&&(e[r.type]=r.field),r.type==="size"){i.size||(i.size={});const n=r;switch(Cvt(n)){case ed.SIZE_MINMAX_VALUE:i.size.minMaxValue={minDataValue:n.minDataValue,maxDataValue:n.maxDataValue,minSize:Tvt(n.minSize),maxSize:Tvt(n.maxSize)};break;case ed.SIZE_SCALE_STOPS:i.size.scaleStops={stops:lFe(n.stops)};break;case ed.SIZE_FIELD_STOPS:if(n.levels){const s={};for(const o in n.levels)s[o]=Evt(n.levels[o]);i.size.fieldStops={type:"level-dependent",levels:s}}else i.size.fieldStops={type:"static",...Evt(n.stops)};break;case ed.SIZE_UNIT_VALUE:i.size.unitValue={unit:n.valueUnit,valueRepresentation:n.valueRepresentation??void 0}}}else if(r.type==="color")i.color=iki(r);else if(r.type==="opacity")i.opacity=tki(r);else if(r.type==="rotation"){const n=r;i.rotation={type:n.rotationType}}return{vvFields:e,vvRanges:i}}function tki(t){const e={values:[0,0,0,0,0,0,0,0],opacities:[0,0,0,0,0,0,0,0]};if(typeof t.field=="string"){if(!t.stops)return null;{if(t.stops.length>8)return null;const i=t.stops;for(let r=0;r<8;++r){const n=i[Math.min(r,i.length-1)];e.values[r]=n.value,e.opacities[r]=n.opacity}}}else{if(!(t.stops&&t.stops.length>=0))return null;{const i=t.stops&&t.stops.length>=0?t.stops[0].opacity:0;for(let r=0;r<8;r++)e.values[r]=1/0,e.opacities[r]=i}}return e}function Ivt(t,e,i){t[4*e+0]=i.r/255,t[4*e+1]=i.g/255,t[4*e+2]=i.b/255,t[4*e+3]=i.a}function iki(t){if(lt(t)||t.normalizationField)return null;const e={field:null,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};if(typeof t.field=="string"){if(!t.stops)return null;{if(t.stops.length>8)return null;e.field=t.field;const i=t.stops;for(let r=0;r<8;++r){const n=i[Math.min(r,i.length-1)];e.values[r]=n.value,Ivt(e.colors,r,n.color)}}}else{if(!(t.stops&&t.stops.length>=0))return null;{const i=t.stops&&t.stops.length>=0&&t.stops[0].color;for(let r=0;r<8;r++)e.values[r]=1/0,Ivt(e.colors,r,i)}}for(let i=0;i<32;i+=4)J5i(e.colors,i,!0);return e}const mU=Ei.getLogger("esri.views.layers.2d.features.support.AttributeStore"),Ape=xvt(Svt,mU),LJ={sharedArrayBuffer:Gi("esri-shared-array-buffer"),atomics:Gi("esri-atomics")};function uFe(t,e){return i=>e(t(i))}let rki=class{constructor(e,i,r,n){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:o,textureOnly:a}=n;this.textureOnly=a||!1,this.pixelType=s,this._ctype=i,this.layout=o,this._resetRange(),this._shared=e,this.size=r,a||(this.data=this._initData(s,r,e,i))}get buffer(){return ya(this.data,e=>e.buffer)}unsetComponentAllTexels(e,i){const r=this.data;for(let n=0;ni)return null;this._resetRange();const n=!(this._shared||this._ctype==="local"),s=this.pixelType,o=this.layout,a=this.data;return{start:e,end:i,data:n&&a.slice(e*r,(i+1)*r)||null,pixelType:s,layout:o}}_initData(e,i,r,n){const s=r&&n!=="local"?SharedArrayBuffer:ArrayBuffer,o=DJ(e),a=new o(new s(i*i*4*o.BYTES_PER_ELEMENT));for(let l=0;l{}){this._client=e,this.config=i,this._notifyChange=r,this._blocks=new Array,this._filters=new Array(S0t),this._attributeComputeInfo=null,this._targetType=0,this._abortController=new AbortController,this._hasScaleExpr=!1,this._size=32,this._nextUpdate=null,this._currUpdate=null,this._idsToHighlight=new Set;const n=i.supportsTextureFloat?ts.FLOAT:ts.UNSIGNED_BYTE;Ape(`Creating AttributeStore ${LJ.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:ts.UNSIGNED_BYTE,layout:1},{pixelType:ts.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:ts.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:n,layout:15},{pixelType:n,layout:15},{pixelType:n,layout:15},{pixelType:n,layout:15}],this._blocks=this._blockDescriptors.map(()=>null)}destroy(){this._abortController.abort()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}isUpdating(){return!!this._currUpdate||!!this._nextUpdate}update(e,i){this.config=i;const r=i.schema.processors[0].storage,n=d2(this._schema,r);if((e.targets.feature||e.targets.aggregate)&&(e.storage.data=!0),n&&(Gi("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",n),e.storage.data=!0,this._schema=r,this._attributeComputeInfo=null,!lt(r))){switch(r.target){case"feature":this._targetType=u5i;break;case"aggregate":this._targetType=YDe}if(r.type==="subtype"){this._attributeComputeInfo={isSubtype:!0,subtypeField:r.subtypeField,map:new Map};for(const s in r.mapping){const o=r.mapping[s];if(ye(o)&&ye(o.vvMapping))for(const a of o.vvMapping)this._bindAttribute(a,parseInt(s,10))}}else{if(this._attributeComputeInfo={isSubtype:!1,map:new Map},ye(r.vvMapping))for(const s of r.vvMapping)this._bindAttribute(s);if(ye(r.attributeMapping))for(const s of r.attributeMapping)this._bindAttribute(s)}}}onTileData(e,i){if(lt(i.addOrUpdate))return;const r=i.addOrUpdate.getCursor();for(;r.next();){const n=r.getDisplayId();this.setAttributeData(n,r)}}async setHighlight(e,i){const n=this._getBlock(0),s=i.map(o=>JP(o));n.lock(),n.unsetComponentAllTexels(0,1),n.setComponent(0,1,s),n.unlock(),this._idsToHighlight.clear();for(const o of e)this._idsToHighlight.add(o);await this.sendUpdates()}async updateFilters(e,i,r){const{service:n,spatialReference:s}=r,{filters:o}=i,a=o.map((l,c)=>this._updateFilter(l,c,n,s));(await Promise.all(a)).some(l=>l)&&(e.storage.filters=!0,Gi("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(e,i,r,n){const s=JP(e);this._ensureSizeForTexel(s),this._getBlock(i).setData(e,r,n)}getData(e,i,r){return this._getBlock(i).getData(e,r)}getHighlightFlag(e){return this._idsToHighlight.has(e)?KLi:0}unsetAttributeData(e){const i=JP(e);this._getBlock(0).setData(i,0,0)}setAttributeData(e,i){const r=JP(e);if(this._ensureSizeForTexel(r),this._getBlock(0).setData(r,0,this.getFilterFlags(i)),this._targetType!==XDe(e))return;const n=this._attributeComputeInfo,s=this.config.supportsTextureFloat?1:2,o=4;let a=null;n&&(a=n.isSubtype?n.map.get(i.readAttribute(n.subtypeField)):n.map,a&&a.size&&a.forEach((l,c)=>{const d=c*s%o,p=Math.floor(c*s/o),y=this._getBlock(p+WDe),v=l(i);if(this.config.supportsTextureFloat)y.setData(r,d,v);else if(v===VDe)y.setData(r,d,255),y.setData(r,d+1,255);else{const S=Hl(Math.round(v),-32767,32766)+32768,I=255&S,O=(65280&S)>>8;y.setData(r,d,I),y.setData(r,d+1,O)}}))}sendUpdates(){if(Gi("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate"),this._notifyChange(),this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=Mf(),this._nextUpdate.promise;const e={blocks:this._blocks.map(i=>ye(i)?i.toMessage():null)};return this._currUpdate=this._createResources().then(()=>{const i=()=>{if(this._currUpdate=null,this._nextUpdate){const n=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then(()=>n.resolve())}else Gi("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::No additional updates queued");this._notifyChange()};Gi("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::client.update");const r=this._client.update(e,this._signal).then(i).catch(i);return this._client.render(this._signal),r}).catch(i=>{if(ss(i))return this._createResourcesPromise=null,this._createResources();this._notifyChange(),mU.error(new st("mapview-attribute-store","Encountered an error during client update",i))}),this._currUpdate}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}_bindAttribute(e,i){function r(){const{normalizationField:c}=e;return c?d=>{const p=d.readAttribute(c);return p?d.readAttribute(e.field)/p:null}:d=>d.readAttribute(e.field)}function n(){return e.normalizationField&&mU.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),c=>c.getComputedNumericAtIndex(e.fieldIndex)}let s;if(e.fieldIndex!=null)s=n();else{if(!e.field)return;s=r()}const{valueRepresentation:o}=e;o&&(s=uFe(s,c=>Z5i(c,o)));const a=c=>c===null||isNaN(c)||c===1/0||c===-1/0?VDe:c,l=this._attributeComputeInfo;if(l.isSubtype){const c=l.map.get(i)??new Map;c.set(e.binding,uFe(s,a)),l.map.set(i,c)}else l.map.set(e.binding,uFe(s,a))}_createResources(){if(ye(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(HDe),this._getBlock(bpe),Ape("Initializing AttributeStore");const e={shared:LJ.sharedArrayBuffer&&this._client.type!=="local",size:this._size,blocks:p_e(this._blocks,r=>({textureOnly:r.textureOnly,buffer:r.buffer,pixelType:r.pixelType}))},i=this._client.initialize(e,this._signal).catch(r=>{ss(r)?this._createResourcesPromise=null:mU.error(new st("mapview-attribute-store","Encountered an error during client initialization",r))});return this._createResourcesPromise=i,i.then(()=>lt(this._createResourcesPromise)?this._createResources():void 0),i}_getBlock(e){const i=this._blocks[e];if(ye(i))return i;Ape(`Initializing AttributeBlock at index ${e}`);const r=LJ.sharedArrayBuffer,n=this._client.type,s=new rki(r,n,this._size,this._blockDescriptors[e]);return this._blocks[e]=s,this._createResourcesPromise=null,s}_expand(){if(this._sizei.expand(e)),this._createResourcesPromise=null,this._size=e,0}return mU.error(new st("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(e,i,r,n){const s=this._filters[i],o=ye(s)&&s.hash;if(!s&&!e||o===JSON.stringify(e))return!1;if(lt(e)){if(!s)return!1;const l=1<WCr),s=new n({geometryType:i.geometryType,hasM:!1,hasZ:!1,timeInfo:i.timeInfo,fieldsIndex:new Am(i.fields)});return this._filters[e]=s,s}isVisible(e){return!!(2&this._getBlock(0).getData(e,0))}getFilterFlags(e){let i=0;const r=c5i(e.getDisplayId());for(let s=0;s>d,O=(S&t.geohashY)>>p;for(let L=y-1;L>=0;L--){const N=(n+s)/2,G=I&1<=0;L--){const N=(i+r)/2,G=O&1<y?1:0;n|=v<<29-(p+5*d),l=(1-v)*l+v*y,c=(1-v)*y+v*c}for(let p=0;p<5;p++){const y=(o+a)/2,v=e>y?1:0;s|=v<<29-(p+5*d),o=(1-v)*o+v*y,a=(1-v)*y+v*a}}t.geohashX=n,t.geohashY=s}function Ope(t,e,i,r,n){n%2&&(n+=1);let s=0,o=0,a=-90,l=90,c=-180,d=180;for(let p=0;pv?1:0;s|=S<<29-(y+5*p),c=(1-S)*c+S*v,d=(1-S)*v+S*d}for(let y=0;y<5;y++){const v=(a+l)/2,S=i>v?1:0;o|=S<<29-(y+5*p),a=(1-S)*a+S*v,l=(1-S)*v+S*l}}t[2*e]=s,t[2*e+1]=o}let Pvt=class{constructor(e=[],i,r=8096){this.onRelease=n=>{},this._nodes=0,this._root=new cFe(this,0,0,0),this._statisticFields=e,this._pool=r?new BD(8096):null,this._serviceInfo=i}destroy(){this.clear()}_acquire(e,i,r){this._nodes++;let n=null;return ye(this._pool)&&(n=this._pool.dequeue()),ye(n)?n.realloc(e,i,r):n=new cFe(this,e,i,r),n}_release(e){this.onRelease(e),this._nodes--,ye(this._pool)&&this._pool.enqueue(e)}get count(){return this._root.count}get size(){return this._nodes}get poolSize(){return Vv(this._pool,0,e=>e.size)}get depth(){let e=0;return this.forEach(i=>e=Math.max(e,i.depth)),e}dropLevels(e){this.forEach(i=>{if(i.depth>=e)for(let r=0;r{if(i.depth>=e)for(let r=0;rthis._release(e)),this._root=new cFe(this,0,0,0)}insert(e,i,r=0){const n=Sv.fromOptimizedFeatures([e],this._serviceInfo).getCursor();n.next();const s=n.readGeometry();if(!s)return;const[o,a]=s.coords,l=e.geohashX,c=e.geohashY;this.insertCursor(n,e.displayId,o,a,l,c,i,r)}insertCursor(e,i,r,n,s,o,a,l=0){let c=this._root,d=0,p=0,y=0;for(;c!==null;){if(c.depth>=l&&(c.count+=1,c.xTotal+=r,c.yTotal+=n,c.xGeohashTotal+=s,c.yGeohashTotal+=o,c.referenceId=i,this._updateStatisticsCursor(e,c,1)),d>=a)return void c.add(i);const v=Math.ceil((d+1)/2),S=Math.floor((d+1)/2),I=1-d%2,O=30-(3*v+2*S),L=30-(2*v+3*S),N=(s&7*I+3*(1-I)<>O,G=(o&3*I+7*(1-I)<>L,V=N+G*(8*I+4*(1-I));p=p<<3*I+2*(1-I)|N,y=y<<2*I+3*(1-I)|G,c.children[V]==null&&(c.children[V]=this._acquire(p,y,d+1)),d+=1,c=c.children[V]}}remove(e,i){const r=Sv.fromOptimizedFeatures([e],this._serviceInfo).getCursor();r.next();const n=r.readGeometry();if(!n)return;const[s,o]=n.coords,a=e.geohashX,l=e.geohashY;this.removeCursor(r,s,o,a,l,i)}removeCursor(e,i,r,n,s,o){let a=this._root,l=0;for(;a!==null;){if(a.count-=1,a.xTotal-=i,a.yTotal-=r,a.xGeohashTotal-=n,a.yGeohashTotal-=s,this._updateStatisticsCursor(e,a,-1),l>=o)return void a.remove(e.getDisplayId());const c=Math.ceil((l+1)/2),d=Math.floor((l+1)/2),p=1-l%2,y=30-(3*c+2*d),v=30-(2*c+3*d),S=((n&7*p+3*(1-p)<>y)+((s&3*p+7*(1-p)<>v)*(8*p+4*(1-p)),I=a.children[S];I?.count===1&&(this._release(I),a.children[S]=null),l+=1,a=I}}forEach(e){let i=this._root;for(;i!==null;){const r=this._linkChildren(i)||i.next;e(i),i=r}}find(e,i,r){return this._root.find(e,i,r,0,0,0)}findIf(e){let i=null;return this.forEach(r=>{e(r)&&(i=r)}),i}findAllIf(e){const i=[];return this.forEach(r=>{e(r)&&i.push(r)}),i}findSingleOccupancyNode(e,i,r,n,s){let o=this._root;for(;o!==null;){const a=o.depth,l=o.xNode,c=o.yNode,d=1-a%2,p=o.xGeohashTotal/o.count,y=o.yGeohashTotal/o.count;if(o.count===1&&e=s){o=o.next;continue}const v=Math.ceil((a+1)/2),S=Math.floor((a+1)/2),I=30-(3*v+2*S),O=30-(2*v+3*S),L=~((1<>I,V=(i&N)>>O,Y=(r&L)>>I,X=(n&N)>>O,te=l<<3*d+2*(1-d),re=c<<2*d+3*(1-d),fe=te+8*d+4*(1-d),ge=re+4*d+8*(1-d),_e=Math.max(te,G),Ie=Math.max(re,V),ke=Math.min(fe,Y),Ne=Math.min(ge,X);let J=null,he=null;for(let xe=Ie;xe<=Ne;xe++)for(let Pe=_e;Pe<=ke;Pe++){const Oe=Pe-te+(xe-re)*(8*d+4*(1-d)),Ae=o.children[Oe];Ae&&(J||(J=Ae,J.next=o.next),he&&(he.next=Ae),he=Ae,Ae.next=o.next)}o=J||o.next}return null}getRegionDisplayIds(e){let i=this._root;const{bounds:r,geohashBounds:n,level:s}=e,[o,a,l,c]=r,d=[];for(;i!==null;){const p=i.depth,y=i.xNode,v=i.yNode;if(p>=s){const Oe=i.xTotal/i.count,Ae=i.yTotal/i.count;Oe>=o&&Oe<=l&&Ae>=a&&Ae<=c&&i.displayIds.forEach(ze=>d.push(ze)),i=i.next;continue}const S=Math.ceil((p+1)/2),I=Math.floor((p+1)/2),O=1-p%2,L=30-(3*S+2*I),N=30-(2*S+3*I),G=~((1<>L,X=(n.yLL&V)>>N,te=(n.xTR&G)>>L,re=(n.yTR&V)>>N,fe=y<<3*O+2*(1-O),ge=v<<2*O+3*(1-O),_e=fe+8*O+4*(1-O),Ie=ge+4*O+8*(1-O),ke=Math.max(fe,Y),Ne=Math.max(ge,X),J=Math.min(_e,te),he=Math.min(Ie,re);let xe=null,Pe=null;for(let Oe=Ne;Oe<=he;Oe++)for(let Ae=ke;Ae<=J;Ae++){const ze=Ae-fe+(Oe-ge)*(8*O+4*(1-O)),Ge=i.children[ze];Ge&&(xe||(xe=Ge,xe.next=i.next),Pe&&(Pe.next=Ge),Pe=Ge,Ge.next=i.next)}i=xe||i.next}return d}getRegionStatistics(e){let i=this._root,r=0,n=0,s=0;const o={},{bounds:a,geohashBounds:l,level:c}=e,[d,p,y,v]=a;let S=0;for(;i!==null;){const I=i.depth,O=i.xNode,L=i.yNode;if(I>=c){const Je=i.xTotal/i.count,et=i.yTotal/i.count;Je>d&&Je<=y&&et>p&&et<=v&&(r+=i.count,n+=i.xTotal,s+=i.yTotal,i.count===1&&(S=i.referenceId),this._aggregateStatistics(o,i.statistics)),i=i.next;continue}const N=Math.ceil((I+1)/2),G=Math.floor((I+1)/2),V=1-I%2,Y=30-(3*N+2*G),X=30-(2*N+3*G),te=~((1<>Y,ge=(l.yLL&re)>>X,_e=(l.xTR&te)>>Y,Ie=(l.yTR&re)>>X,ke=O<<3*V+2*(1-V),Ne=L<<2*V+3*(1-V),J=ke+8*V+4*(1-V),he=Ne+4*V+8*(1-V),xe=Math.max(ke,fe),Pe=Math.max(Ne,ge),Oe=Math.min(J,_e),Ae=Math.min(he,Ie);let ze=null,Ge=null;for(let Je=Pe;Je<=Ae;Je++)for(let et=xe;et<=Oe;et++){const tt=et-ke+(Je-Ne)*(8*V+4*(1-V)),ft=i.children[tt];if(ft){if(Je!==Pe&&Je!==Ae&&et!==xe&&et!==Oe){const Pt=ft.xTotal/ft.count,$t=ft.yTotal/ft.count;Pt>d&&Pt<=y&&$t>p&&$t<=v&&(r+=ft.count,n+=ft.xTotal,s+=ft.yTotal,ft.count===1&&(S=ft.referenceId),this._aggregateStatistics(o,ft.statistics));continue}ze||(ze=ft,ze.next=i.next),Ge&&(Ge.next=ft),Ge=ft,ft.next=i.next}}i=ze||i.next}return{count:r,attributes:this.normalizeStatistics(o,r),xTotal:n,yTotal:s,referenceId:S}}getBins(e){const i=[],{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){i.push(s),s=s.next;continue}const c=Math.ceil((o+1)/2),d=Math.floor((o+1)/2),p=1-o%2,y=30-(3*c+2*d),v=30-(2*c+3*d),S=~((1<>y,L=(r.yLL&I)>>v,N=(r.xTR&S)>>y,G=(r.yTR&I)>>v,V=a<<3*p+2*(1-p),Y=l<<2*p+3*(1-p),X=V+8*p+4*(1-p),te=Y+4*p+8*(1-p),re=Math.max(V,O),fe=Math.max(Y,L),ge=Math.min(X,N),_e=Math.min(te,G);let Ie=null,ke=null;for(let Ne=fe;Ne<=_e;Ne++)for(let J=re;J<=ge;J++){const he=J-V+(Ne-Y)*(8*p+4*(1-p)),xe=s.children[he];xe&&(Ie||(Ie=xe,Ie.next=s.next),ke&&(ke.next=xe),ke=xe,xe.next=s.next)}s=Ie||s.next}return i}_linkChildren(e){let i=null,r=null;for(let n=0;n<=e.children.length;n++){const s=e.children[n];s&&(i||(i=s,i.next=e.next),r&&(r.next=s),r=s,s.next=e.next)}return i}_updateStatisticsCursor(e,i,r){for(const n of this._statisticFields){const s=n.name,o=n.inField?e.readAttribute(n.inField):e.getComputedNumericAtIndex(n.inFieldIndex);switch(n.statisticType){case"min":{if(isNaN(o))break;if(!i.statistics[s]){i.statistics[s]={value:o};break}const a=i.statistics[s].value;i.statistics[s].value=Math.min(a,o);break}case"max":{if(isNaN(o))break;if(!i.statistics[s]){i.statistics[s]={value:o};break}const a=i.statistics[s].value;i.statistics[s].value=Math.max(a,o);break}case"count":break;case"sum":case"avg":{i.statistics[s]||(i.statistics[s]={value:0,nanCount:0});const a=i.statistics[s].value,l=i.statistics[s].nanCount??0;o==null||isNaN(o)?i.statistics[s].nanCount=l+r:i.statistics[s].value=a+r*o;break}case"avg_angle":{i.statistics[s]||(i.statistics[s]={x:0,y:0,nanCount:0});const a=i.statistics[s].x,l=i.statistics[s].y,c=i.statistics[s].nanCount??0,d=Math.PI/180;o==null||isNaN(o)?i.statistics[s].nanCount=c+r:(i.statistics[s].x=a+r*Math.cos(o*d),i.statistics[s].y=l+r*Math.sin(o*d));break}case"mode":{i.statistics[s]||(i.statistics[s]={});const a=i.statistics[s][o]||0;i.statistics[s][o]=a+r;break}}}}_aggregateStatistics(e,i){for(const r of this._statisticFields){const n=r.name;switch(r.statisticType){case"min":{if(!e[n]){e[n]={value:i[n].value};break}const s=e[n].value;e[n].value=Math.min(s,i[n].value);break}case"max":{if(!e[n]){e[n]={value:i[n].value};break}const s=e[n].value;e[n].value=Math.max(s,i[n].value);break}case"count":break;case"sum":case"avg":case"avg_angle":case"mode":e[n]||(e[n]={});for(const s in i[n]){const o=e[n][s]||0;e[n][s]=o+i[n][s]}}}}normalizeStatistics(e,i){const r={};for(const n of this._statisticFields){const s=n.name;switch(n.statisticType){case"min":case"max":{const o=e[s];if(!i||!o)break;r[s]=o.value;break}case"count":if(!i)break;r[s]=i;break;case"sum":{if(!i)break;const{value:o,nanCount:a}=e[s];if(!(i-a))break;r[s]=o;break}case"avg":{if(!i)break;const{value:o,nanCount:a}=e[s];if(!(i-a))break;r[s]=o/(i-a);break}case"avg_angle":{if(!i)break;const{x:o,y:a,nanCount:l}=e[s];if(!(i-l))break;const c=o/(i-l),d=a/(i-l),p=180/Math.PI,y=Math.atan2(d,c)*p;r[s]=y;break}case"mode":{const o=e[s];let a=0,l=0,c=null;for(const d in o){const p=o[d];p===a?l+=1:p>a&&(a=p,l=1,c=d)}r[s]=c==="null"||l>1?null:c;break}}}return r}},cFe=class{constructor(e,i,r,n){this.count=0,this.xTotal=0,this.yTotal=0,this.statistics={},this.displayId=0,this.referenceId=0,this.displayIds=new Set,this.next=null,this.depth=0,this.xNode=0,this.yNode=0,this.xGeohashTotal=0,this.yGeohashTotal=0,this._tree=e,this.children=new Array(32);for(let s=0;s=r)return this;const a=1-n%2,l=3*a+2*(1-a),c=2*a+3*(1-a),d=30-s-l,p=30-o-c,y=((e&7*a+3*(1-a)<>d)+((i&3*a+7*(1-a)<>p)*(8*a+4*(1-a)),v=this.children[y];return v==null?null:v.find(e,i,r,n+1,s+l,o+c)}};const hFe=Ei.getLogger("esri.view.2d.layers.features.support.BinStore"),Ovt=12,ski=64,oki=Qb(),aki=5;function Rvt(t){return 57.29577951308232*t}let lki=class extends PDe{constructor(e,i,r,n){super(e,r),this.type="bin",this.events=new cd,this.objectIdField="aggregateId",this.featureAdapter=cpe,this._geohashLevel=aki,this._geohashBuf=[],this._serviceInfo=n,this.geometryInfo=e.geometryInfo,this._spatialReference=i,this._projectionSupportCheck=uy(i,rr.WGS84),this._bitsets.geohash=r.getBitset(r.createBitset()),this._bitsets.inserted=r.getBitset(r.createBitset())}destroy(){this._tree&&this._tree.destroy()}get featureSpatialReference(){return this._spatialReference}get fields(){return this._fields}async updateSchema(e,i){const r=this._schema;try{await super.updateSchema(e,i),await this._projectionSupportCheck}catch{}this._fields=this._schema.params.fields;const n=d2(r,i);i&&(!lt(n)||e.source||e.storage.filters)?((vA(n,"params.fields")||vA(n,"params")||!this._tree||e.source)&&(this._tree&&this._tree.destroy(),this._tree=new Pvt(this._statisticFields,this._serviceInfo),this._tree.onRelease=s=>s.displayId&&this._storage.releaseDisplayId(s.displayId),this._geohashLevel=this._schema.params.fixedBinLevel,this._rebuildTree(),Gi("esri-2d-update-debug")&&hFe.info("Aggregate mesh needs update due to tree changing")),Gi("esri-2d-update-debug")&&hFe.info("Aggregate mesh needs update due to tree changing"),e.targets[i.name]=!0,e.mesh=!1):r&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,i){this._bitsets.inserted.forEachSet(r=>{if(!e.has(r)){const n=i.lookupByDisplayIdUnsafe(r);this._remove(n)}})}sweepAggregates(e,i,r){}onTileData(e,i,r,n,s=!0){if(!this._schema||lt(i.addOrUpdate))return i;this.events.emit("changed");const o=this._getTransforms(e,this._spatialReference);{const l=i.addOrUpdate.getCursor();for(;l.next();)this._update(l,n)}if(i.status.mesh||!s)return i;const a=new Array;this._getBinsForTile(a,e,o,r),i.addOrUpdate=Sv.fromOptimizedFeatures(a,{...this._serviceInfo,geometryType:"esriGeometryPolygon"}),i.addOrUpdate.attachStorage(r),i.end=!0,i.isRepush||(i.clear=!0);{const l=i.addOrUpdate.getCursor();for(;l.next();){const c=l.getDisplayId();this._bitsets.computed.unset(c),this.setComputedAttributes(r,l,c,e.scale)}}return i}forEachBin(e){this._tree.forEach(e)}forEach(e){this._tree.forEach(i=>{if(i.depth!==this._geohashLevel)return;const r=this._toFeatureJSON(i),n=Sv.fromFeatures([r],{objectIdField:this.objectIdField,globalIdField:null,geometryType:this.geometryInfo.geometryType,fields:this.fields}).getCursor();n.next(),e(n)})}forEachInBounds(e,i){}forEachBounds(e,i){const{hasM:r,hasZ:n}=this.geometryInfo;for(const s of e){const o=Nae(oki,s.readGeometry(),n,r);lt(o)||i(o)}}onTileUpdate(e){}getAggregate(e){const i=KDe(e,!0),r=this._tree.findIf(n=>n.displayId===i);return ya(r,n=>this._toFeatureJSON(n))}getAggregates(){return this._tree.findAllIf(e=>e.depth===this._geohashLevel).map(this._toFeatureJSON.bind(this))}getDisplayId(e){const i=this._tree.findIf(r=>r.id===e);return ya(i,r=>r.displayId)}getFeatureDisplayIdsForAggregate(e){const i=this._tree.findIf(r=>r.id===e);return Vv(i,[],r=>Array.from(r.displayIds))}getDisplayIdForReferenceId(e){const i=this._tree.findIf(r=>r.displayIds.size===1&&r.displayIds.has(e));return ya(i,r=>r.displayId)}_toFeatureJSON(e){const i=this._spatialReference;return{displayId:e.displayId,attributes:e.getAttributes(),geometry:cw(e.getGeometry(i),"esriGeometryPolygon",!1,!1),centroid:null}}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const i=e.getDisplayId(),r=e.getXHydrated(),n=e.getYHydrated(),s=this._geohashBuf[2*i],o=this._geohashBuf[2*i+1];this._bitsets.inserted.has(i)&&(this._bitsets.inserted.unset(i),this._tree.removeCursor(e,r,n,s,o,this._geohashLevel))}_update(e,i){const r=e.getDisplayId(),n=this._bitsets.inserted,s=i.isVisible(r);if(s===n.has(r))return;if(!s)return void this._remove(e);const o=e.getXHydrated(),a=e.getYHydrated();if(!this._setGeohash(r,o,a))return;const l=this._geohashBuf[2*r],c=this._geohashBuf[2*r+1];this._tree.insertCursor(e,r,o,a,l,c,this._geohashLevel),n.set(r)}_setGeohash(e,i,r){if(this._bitsets.geohash.has(e))return!0;const n=this._geohashBuf;if(this._spatialReference.isWebMercator){const s=Rvt(i/wu.radius),o=s-360*Math.floor((s+180)/360),a=Rvt(Math.PI/2-2*Math.atan(Math.exp(-r/wu.radius)));Ope(n,e,a,o,Ovt)}else{const s=fp({x:i,y:r},this._spatialReference,rr.WGS84);if(!s)return!1;Ope(n,e,s.y,s.x,Ovt)}return this._bitsets.geohash.set(e),!0}_getBinsForTile(e,i,r,n){try{const s=this._getGeohashBounds(i),o=this._tree.getBins(s);for(const a of o){a.displayId||(a.displayId=n.createDisplayId(!0));let l=null;const c=a.getGeometry(this._spatialReference,r.tile);c||(l=a.getGeometryCentroid(this._spatialReference,r.tile));const d=new o_(c,a.getAttributes(),l);d.objectId=a.id,d.displayId=a.displayId,e.push(d)}}catch{return void hFe.error("Unable to get bins for tile",i.key.id)}}_getGeohash(e,i,r){const n={geohashX:0,geohashY:0};return Ppe(n,i,e,r),n}_getGeohashBounds(e){const i=this._getGeohashLevel(e.key.level),r=[e.extent.xmin,e.extent.ymin,e.extent.xmax,e.extent.ymax],n=po.fromExtent(vr.fromBounds(r,this._spatialReference)),s=fp(n,this._spatialReference,rr.WGS84,{densificationStep:e.resolution*ski}),o=cM(new Sl,s,!1,!1),a=o.coords.filter((I,O)=>!(O%2)),l=o.coords.filter((I,O)=>O%2),c=Math.min(...a),d=Math.min(...l),p=Math.max(...a),y=Math.max(...l),v=this._getGeohash(c,d,i),S=this._getGeohash(p,y,i);return{bounds:r,geohashBounds:{xLL:v.geohashX,yLL:v.geohashY,xTR:S.geohashX,yTR:S.geohashY},level:i}}_getGeohashLevel(e){return this._schema.params.fixedBinLevel}_getTransforms(e,i){const r={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},n=pd(i);if(!n)return{tile:r,left:null,right:null};const[s,o]=n.valid;return{tile:r,left:{...r,translate:[o,e.bounds[3]]},right:{...r,translate:[s-o+e.bounds[0],e.bounds[3]]}}}};const dFe=12,uki=64,Mvt=1,cki=Qb();let hki=class YLt extends _Jt{constructor(e,i,r,n,s){super(new Sl([],[i,r]),n,null,e),this.geohashBoundsInfo=s}get count(){return this.attributes.cluster_count}static create(e,i,r,n,s,o,a,l){const c=new YLt(i,r,n,o,a);return c.displayId=e.createDisplayId(!0),c.referenceId=l,c.tileLevel=s,c}update(e,i,r,n,s,o){return this.geometry.coords[0]=e,this.geometry.coords[1]=i,this.tileLevel=r,this.attributes=n,this.geohashBoundsInfo=s,this.referenceId=null,this.referenceId=o,this}toJSON(){return{attributes:{...this.attributes,aggregateId:this.objectId,referenceId:this.attributes.cluster_count===1?this.referenceId:null},geometry:{x:this.geometry.coords[0],y:this.geometry.coords[1]}}}};function gU(t){return 57.29577951308232*t}let dki=class extends PDe{constructor(e,i,r,n){super(e,r),this.type="cluster",this.events=new cd,this.objectIdField="aggregateId",this.featureAdapter=cpe,this._geohashLevel=0,this._tileLevel=0,this._aggregateValueRanges={},this._aggregateValueRangesChanged=!1,this._geohashBuf=[],this._clusters=new Map,this._tiles=new Map,this._serviceInfo=n,this.geometryInfo=e.geometryInfo,this._spatialReference=i,this._projectionSupportCheck=uy(i,rr.WGS84),this._bitsets.geohash=r.getBitset(r.createBitset()),this._bitsets.inserted=r.getBitset(r.createBitset())}destroy(){this._tree.destroy()}get featureSpatialReference(){return this._spatialReference}get fields(){return this._fields}async updateSchema(e,i){const r=this._schema;try{await super.updateSchema(e,i),await this._projectionSupportCheck}catch{}this._fields=this._schema.params.fields;const n=d2(r,i);i&&(!lt(n)||e.source||e.storage.filters)?((vA(n,"params.fields")||!this._tree||e.source)&&(this._tree&&this._tree.destroy(),this._tree=new Pvt(this._statisticFields,this._serviceInfo),this._rebuildTree(),Gi("esri-2d-update-debug")&&console.debug("Aggregate mesh needs update due to tree changing")),Gi("esri-2d-update-debug")&&console.debug("Applying Update - ClusterStore:",n),e.targets[i.name]=!0,e.mesh=!1,this._aggregateValueRanges={}):r&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,i){this._bitsets.inserted.forEachSet(r=>{if(!e.has(r)){const n=i.lookupByDisplayIdUnsafe(r);this._remove(n)}})}sweepAggregates(e,i,r){this._clusters.forEach((n,s)=>{n&&n.tileLevel!==r&&(e.releaseDisplayId(n.displayId),i.unsetAttributeData(n.displayId),this._clusters.delete(s))})}onTileData(e,i,r,n,s=!0){if(!this._schema||lt(i.addOrUpdate))return i;this.events.emit("changed");const o=this._getTransforms(e,this._spatialReference);{const c=i.addOrUpdate.getCursor();for(;c.next();)this._update(c,n)}if(i.status.mesh||!s)return i;const a=new Array,l=this._schema.params.clusterRadius;this._getClustersForTile(a,e,l,r,o),i.addOrUpdate=Sv.fromOptimizedFeatures(a,this._serviceInfo),i.addOrUpdate.attachStorage(r),i.clear=!0,i.end=!0;{const c=i.addOrUpdate.getCursor();for(;c.next();){const d=c.getDisplayId();this._bitsets.computed.unset(d),this.setComputedAttributes(r,c,d,e.scale)}}return this._aggregateValueRangesChanged&&i.end&&(this.events.emit("valueRangesChanged",{valueRanges:this._aggregateValueRanges}),this._aggregateValueRangesChanged=!1),i}onTileUpdate({added:e,removed:i}){if(e.length){const n=e[0].level;this._tileLevel=n,this._setGeohashLevel(n)}if(!this._schema)return;const r=this._schema.params.clusterRadius;i.forEach(n=>{this._tiles.delete(n.key.id),this._markTileClustersForDeletion(n,r)})}getAggregate(e){for(const i of this._clusters.values())if((i?.displayId&Jf)==(e&Jf))return i.toJSON();return null}getAggregates(){const e=[];for(const i of this._clusters.values())i?.tileLevel===this._tileLevel&&e.push(i.toJSON());return e}getDisplayId(e){const i=this._clusters.get(e);return i?i.displayId:null}getFeatureDisplayIdsForAggregate(e){const i=this._clusters.get(e);return i?this._tree.getRegionDisplayIds(i.geohashBoundsInfo):[]}getDisplayIdForReferenceId(e){for(const i of this._clusters.values())if(i?.referenceId===e)return i.displayId;return null}getAggregateValueRanges(){return this._aggregateValueRanges}forEach(e){this._clusters.forEach(i=>{if(!i)return;const r=i.toJSON(),n=Sv.fromFeatures([r],{objectIdField:this.objectIdField,globalIdField:null,geometryType:this.geometryInfo.geometryType,fields:this.fields}).getCursor();n.next(),e(n)})}forEachInBounds(e,i){}forEachBounds(e,i){const{hasM:r,hasZ:n}=this.geometryInfo;for(const s of e){const o=Nae(cki,s.readGeometry(),n,r);lt(o)||i(o)}}size(){let e=0;return this.forEach(i=>e++),e}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const i=e.getDisplayId(),r=e.getXHydrated(),n=e.getYHydrated(),s=this._geohashBuf[2*i],o=this._geohashBuf[2*i+1];this._bitsets.inserted.has(i)&&(this._bitsets.inserted.unset(i),this._tree.removeCursor(e,r,n,s,o,this._geohashLevel))}_update(e,i){const r=e.getDisplayId(),n=this._bitsets.inserted,s=i.isVisible(r);if(s===n.has(r))return;if(!s)return void this._remove(e);const o=e.getXHydrated(),a=e.getYHydrated();if(!this._setGeohash(r,o,a))return;const l=this._geohashBuf[2*r],c=this._geohashBuf[2*r+1];this._tree.insertCursor(e,r,o,a,l,c,this._geohashLevel),n.set(r)}_setGeohash(e,i,r){if(this._bitsets.geohash.has(e))return!0;const n=this._geohashBuf;if(this._spatialReference.isWebMercator){const s=gU(i/wu.radius),o=s-360*Math.floor((s+180)/360),a=gU(Math.PI/2-2*Math.atan(Math.exp(-r/wu.radius)));Ope(n,e,a,o,dFe)}else{const s=fp({x:i,y:r},this._spatialReference,rr.WGS84);if(!s)return!1;Ope(n,e,s.y,s.x,dFe)}return this._bitsets.geohash.set(e),!0}_getClustersForTile(e,i,r,n,s,o=!0){const a=this._schema.params.clusterPixelBuffer,l=2*r,c=Math.ceil(2**i.key.level*Tc/l)+1,d=Math.ceil(a/l)+0,p=Math.ceil(Tc/l),{row:y,col:v}=i.key,S=v*Tc,I=y*Tc,O=Math.floor(S/l)-d,L=Math.floor(I/l)-d,N=O+p+2*d,G=L+p+2*d,V=i.tileInfoView.getLODInfoAt(i.key.level);for(let Y=O;Y<=N;Y++)for(let X=L;X<=G;X++){let te=Y;V.wrap&&(te=Y<0?Y+c:Y%c);const re=V.wrap&&Y<0,fe=V.wrap&&Y%c!==Y,ge=this._lookupCluster(n,V,i.key.level,te,X,i);if(ye(ge)){const _e=ya(s,Ie=>re?Ie.left:fe?Ie.right:Ie.tile);if(o&<(_e)||!ge.count)continue;if(ye(_e)&&o){const Ie=ge.geometry.clone();let ke=ge.attributes;Ie.coords[0]=vY(_e,Ie.coords[0]),Ie.coords[1]=_Y(_e,Ie.coords[1]),ge.count===1&&ye(ge.referenceId)&&(ke={...ge.attributes,referenceId:ge.referenceId});const Ne=new o_(Ie,ke);Ne.displayId=ge.displayId,e.push(Ne)}}}}_getGeohashLevel(e){return Math.min(Math.ceil(e/2+2),dFe)}_setGeohashLevel(e){const i=this._getGeohashLevel(e),r=(Math.floor(i/Mvt)+1)*Mvt-1;if(this._geohashLevel!==r)return this._geohashLevel=r,this._rebuildTree(),void this._bitsets.geohash.clear()}_getTransforms(e,i){const r={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},n=pd(i);if(!n)return{tile:r,left:null,right:null};const[s,o]=n.valid;return{tile:r,left:{...r,translate:[o,e.bounds[3]]},right:{...r,translate:[s-o+e.bounds[0],e.bounds[3]]}}}_getClusterId(e,i,r){return(15&e)<<28|(16383&i)<<14|16383&r}_markForDeletion(e,i,r){const n=this._getClusterId(e,i,r);this._clusters.delete(n)}_getClusterBounds(e,i,r){const n=this._schema.params.clusterRadius,s=2*n;let o=r%2?i*s:i*s-n;const a=r*s;let l=o+s;const c=a-s,d=2**e.level*Tc;e.wrap&&o<0&&(o=0),e.wrap&&l>d&&(l=d);const p=o/Tc,y=a/Tc,v=l/Tc,S=c/Tc;return[e.getXForColumn(p),e.getYForRow(y),e.getXForColumn(v),e.getYForRow(S)]}_getGeohash(e,i,r){const n={geohashX:0,geohashY:0};return Ppe(n,i,e,r),n}_getGeohashBounds(e,i){const r=this._getGeohashLevel(e.key.level);if(this._spatialReference.isWebMercator){const[I,O,L,N]=i,G={x:I,y:O},V={x:L,y:N};let Y=0,X=0,te=0,re=0;{const _e=gU(G.x/wu.radius);Y=_e-360*Math.floor((_e+180)/360),X=gU(Math.PI/2-2*Math.atan(Math.exp(-G.y/wu.radius)))}{const _e=gU(V.x/wu.radius);te=_e-360*Math.floor((_e+180)/360),re=gU(Math.PI/2-2*Math.atan(Math.exp(-V.y/wu.radius)))}const fe={geohashX:0,geohashY:0},ge={geohashX:0,geohashY:0};return Ppe(fe,X,Y,r),Ppe(ge,re,te,r),{bounds:[I,O,L,N],geohashBounds:{xLL:fe.geohashX,yLL:fe.geohashY,xTR:ge.geohashX,yTR:ge.geohashY},level:r}}const n=po.fromExtent(vr.fromBounds(i,this._spatialReference)),s=fp(n,this._spatialReference,rr.WGS84,{densificationStep:e.resolution*uki});if(!s)return null;const o=cM(new Sl,s,!1,!1),a=o.coords.filter((I,O)=>!(O%2)),l=o.coords.filter((I,O)=>O%2),c=Math.min(...a),d=Math.min(...l),p=Math.max(...a),y=Math.max(...l),v=this._getGeohash(c,d,r),S=this._getGeohash(p,y,r);return{bounds:i,geohashBounds:{xLL:v.geohashX,yLL:v.geohashY,xTR:S.geohashX,yTR:S.geohashY},level:r}}_lookupCluster(e,i,r,n,s,o){const a=this._getClusterId(r,n,s),l=this._clusters.get(a),c=this._getClusterBounds(i,n,s),d=this._getGeohashBounds(o,c);if(lt(d))return null;const p=this._tree.getRegionStatistics(d),{count:y,xTotal:v,yTotal:S,referenceId:I}=p,O=y?v/y:0,L=y?S/y:0;if(y===0)return this._clusters.set(a,null),null;const N={cluster_count:y,...p.attributes},G=ye(l)?l.update(O,L,r,N,d,I):hki.create(e,a,O,L,r,N,d,I);if(y===0){const[V,Y,X,te]=c;G.geometry.coords[0]=(V+X)/2,G.geometry.coords[1]=(Y+te)/2}return this._clusters.set(a,G),this._updateAggregateValueRangeForCluster(G,G.tileLevel),G}_updateAggregateValueRangeForCluster(e,i){const r=this._aggregateValueRanges[i]||{minValue:1/0,maxValue:0},n=r.minValue,s=r.maxValue;r.minValue=Math.min(n,e.count),r.maxValue=Math.max(s,e.count),this._aggregateValueRanges[i]=r,n===r.minValue&&s===r.maxValue||(this._aggregateValueRangesChanged=!0)}_markTileClustersForDeletion(e,i){const r=2*i,n=Math.ceil(Tc/r),{row:s,col:o}=e.key,a=o*Tc,l=s*Tc,c=Math.floor(a/r),d=Math.floor(l/r);for(let p=c;pe))for(;t.length<=e;)t.push(i)}let Dvt=class{constructor(){this._numerics=[],this._strings=[],this._idGenerator=new pki,this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[]}createBitset(){const e=this._bitsets.length;return this._bitsets.push(ODe.create(this._allocatedSize,Jf)),e+1}getBitset(e){return this._bitsets[e-1]}_expand(){this._allocatedSize<<=1;for(const e of this._bitsets)e.resize(this._allocatedSize)}_ensureNumeric(e,i){this._numerics[e]||(this._numerics[e]=[]),Rpe(this._numerics[e],i,0)}_ensureInstanceId(e){Rpe(this._instanceIds,e,0)}_ensureString(e,i){this._strings[e]||(this._strings[e]=[]),Rpe(this._strings[e],i,null)}createDisplayId(e=!1){const i=this._idGenerator.createId();return i>this._allocatedSize&&this._expand(),KDe(i,e)}releaseDisplayId(e){for(const i of this._bitsets)i.unset(e);return this._idGenerator.releaseId(e&Jf)}getComputedNumeric(e,i){return this.getComputedNumericAtIndex(e&Jf,0)}setComputedNumeric(e,i,r){return this.setComputedNumericAtIndex(e&Jf,r,0)}getComputedString(e,i){return this.getComputedStringAtIndex(e&Jf,0)}setComputedString(e,i,r){return this.setComputedStringAtIndex(e&Jf,0,r)}getComputedNumericAtIndex(e,i){const r=e&Jf;return this._ensureNumeric(i,r),this._numerics[i][r]}setComputedNumericAtIndex(e,i,r){const n=e&Jf;this._ensureNumeric(i,n),this._numerics[i][n]=r}getInstanceId(e){const i=e&Jf;return this._ensureInstanceId(i),this._instanceIds[i]}setInstanceId(e,i){const r=e&Jf;this._ensureInstanceId(r),this._instanceIds[r]=i}getComputedStringAtIndex(e,i){const r=e&Jf;return this._ensureString(i,r),this._strings[i][r]}setComputedStringAtIndex(e,i,r){const n=e&Jf;this._ensureString(i,n),this._strings[i][n]=r}getXMin(e){return this._bounds[4*(e&Jf)]}getYMin(e){return this._bounds[4*(e&Jf)+1]}getXMax(e){return this._bounds[4*(e&Jf)+2]}getYMax(e){return this._bounds[4*(e&Jf)+3]}setBounds(e,i){const r=i.readHydratedGeometry();if(!r||!r.coords.length)return!1;let n=1/0,s=1/0,o=-1/0,a=-1/0;r.forEachVertex((c,d)=>{n=Math.min(n,c),s=Math.min(s,d),o=Math.max(o,c),a=Math.max(a,d)});const l=e&Jf;return Rpe(this._bounds,4*l+4,0),this._bounds[4*l]=n,this._bounds[4*l+1]=s,this._bounds[4*l+2]=o,this._bounds[4*l+3]=a,!0}};const fki=5e3,mki="tileRenderer.featuresView.attributeView.initialize",gki="tileRenderer.featuresView.attributeView.requestUpdate",yki="tileRenderer.featuresView.requestRender";function vki(t){return t.name==="worker:port-closed"}function eO(t){if(!ss(t)&&!vki(t))throw t}function Fvt(t){return t.type==="feature"&&t.mode==="snapshot"}let mS=class extends fn{constructor(){super(...arguments),this._storage=new Dvt,this._markedIdsBufId=this._storage.createBitset(),this._lastCleanup=performance.now(),this._cleanupNeeded=!1,this._invalidated=!1,this._tileToResolver=new Map,this._didEdit=!1,this._updateVersion=1,this.tileStore=null,this.config=null,this.processor=null,this.remoteClient=null,this.service=null}initialize(){this._initStores(),this._initSource(),this._updateQueue=new _k({concurrency:this._source.type==="stream"?1:4,process:(e,i)=>this._onTileMessage(e,{signal:i})}),this.addHandles([this.tileStore.on("update",this.onTileUpdate.bind(this)),Hg(()=>!this.updating,()=>this.onIdle())]),this._checkUpdating=setInterval(()=>this.notifyChange("updating"),300)}_initSource(){const e=this.tileStore.tileScheme,i=()=>this._updateQueue&&this._updateQueue.length<50,r=(n,s)=>(this._invalidated=!0,this._patchTile(n,s));this._source=ULi(this.service,this.spatialReference,e,r,i,this.featureStore),this._proxyEvents()}_proxyEvents(){if(this._source.type==="stream"){const e=this._source.events,i=this._source;this.addHandles([Qi(()=>i.connectionStatus,r=>this.remoteClient.invoke("setProperty",{propertyName:"connectionStatus",value:r}).catch(eO),{initial:!0}),Qi(()=>i.errorString,r=>this.remoteClient.invoke("setProperty",{propertyName:"errorString",value:r}).catch(eO),{initial:!0}),e.on("data-received",r=>this.remoteClient.invoke("emitEvent",{name:"data-received",event:{attributes:r.attributes,centroid:r.centroid,geometry:r.geometry}}).catch(eO)),e.on("message-received",r=>this.remoteClient.invoke("emitEvent",{name:"message-received",event:r}).catch(eO)),e.on("updateRate",r=>this.remoteClient.invoke("emitEvent",{name:"update-rate",event:{...r}}).catch(eO))])}}_initAttributeStore(e){this.attributeStore||(this.attributeStore=new Avt({type:"remote",initialize:(i,r)=>cf(this.remoteClient.invoke(mki,i,{signal:r}).catch(eO)),update:(i,r)=>cf(this.remoteClient.invoke(gki,i,{signal:r}).catch(eO)),render:i=>cf(this.remoteClient.invoke(yki,void 0,{signal:i}).catch(eO))},e,()=>this.notifyChange("updating")))}_initStores(){const e=this.service.type==="snapshot"?"snapshot":"on-demand",i={geometryInfo:{geometryType:this.service.geometryType,hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.featureStore=new H4i(i,this._storage,e)}_initQueryEngine(e){const i=this;this.featureQueryEngine?.destroy(),this.featureQueryEngine=new NN({definitionExpression:e.schema.source.definitionExpression??void 0,fields:this.service.fields,geometryType:this.service.geometryType,objectIdField:this.service.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!0,featureStore:this.featureStore,aggregateAdapter:{getFeatureObjectIds(r){return lt(i.aggregateStore)?[]:i.aggregateStore.getFeatureDisplayIdsForAggregate(r).map(n=>i.getObjectId(n))}},timeInfo:this.service.timeInfo})}_initAggregateQueryEngine(e,i){if(this.aggregateQueryEngine?.destroy(),lt(e))return;const r=i.targets.aggregate.params.fields.slice();this.aggregateQueryEngine=new NN({definitionExpression:void 0,fields:r,geometryType:e.geometryInfo.geometryType,objectIdField:e.objectIdField,hasM:e.geometryInfo.hasM,hasZ:e.geometryInfo.hasZ,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!1,featureStore:e,aggregateAdapter:{getFeatureObjectIds:n=>[]}})}destroy(){this._updateQueue.destroy(),this._source.destroy(),this.featureQueryEngine?.destroy(),this.aggregateQueryEngine?.destroy(),this.attributeStore?.destroy();for(const e of this.tileStore.tiles)this._source.unsubscribe(e);clearInterval(this._checkUpdating)}get fieldsIndex(){return new Am(this.service.fields)}get spatialReference(){return this.tileStore.tileScheme.spatialReference}get updating(){return this.isUpdating()}isUpdating(){const e=this._source.updating,i=!!this._updateQueue.length,r=!this.attributeStore||this.attributeStore.isUpdating(),n=e||i||r;return Gi("esri-2d-log-updating")&&console.log(`Updating FeatureController2D: ${n} +`),this.storage.data&&(e+=1,i+="-> (1) Texture storage parameters changed");const r=e<5?"Fastest":e<10?"Fast":e<15?"Moderate":e<20?"Slow":"Very Slow";console.debug(`Applying ${r} update of cost ${e}/45 `),console.debug(i)}toJSON(){return{queryFilter:this.queryFilter,source:this.source,targets:this.targets,storage:this.storage,mesh:this.mesh}}},A5i=class{constructor(e,i){this.requests={done:new Array,stream:new GD(10)},this._edits=null,this._abortController=new AbortController,this._version=0,this._done=!1,this.didSend=!1,this.tile=e,this._version=i}get signal(){return this._abortController.signal}get options(){return{signal:this._abortController.signal}}get empty(){return!this.requests.done.length&<(this.edits)}get edits(){return this._edits}get done(){return this._done}end(){this._done=!0}clear(){this.requests.done=[]}applyUpdate(e){this.requests.done.forEach(i=>i.message.status.unset(e)),this._version=e.version,ve(this._edits)&&this._edits.status.unset(e)}add(e){e.message.status=e.message.status??k_.empty(),e.message.status.version=this._version,Hi("esri-2d-update-debug")&&console.debug(this.tile.id,"DataTileSubscription:add",this._version),e.message.end&&this.requests.done.forEach(i=>{ve(i.message)&&i.message.end&&(i.message.end=!1)}),this.requests.done.push(e)}edit(e,i){const r=e.getQuantizationTransform(),n=e.fullSchema(),s=Array.from(e.features()).filter(ve),o=[...i,...s.map(a=>a.objectId)];if(this.removeIds(o),this._invalidate(),lt(this._edits))return void(this._edits={type:"append",addOrUpdate:Ev.fromOptimizedFeatures(s,n,r),id:this.tile.id,status:k_.empty(),end:!0});this.requests.done.forEach(a=>a.message.end=!1),this._edits.addOrUpdate.append(e.features())}*readers(){for(const{message:e}of this.requests.done)ve(e.addOrUpdate)&&(yield e.addOrUpdate);ve(this._edits)&&ve(this._edits.addOrUpdate)&&(yield this._edits.addOrUpdate)}_invalidate(){for(const e of this.requests.done)e.message.status=k_.empty();ve(this._edits)&&(this._edits.status=k_.empty())}removeIds(e){this._invalidate();for(const{message:i}of this.requests.done){const r=i.addOrUpdate;ve(r)&&(r.removeIds(e),r.isEmpty&&(Hi("esri-2d-update-debug")&&console.debug("Removing FeatureSetReader"),i.addOrUpdate=null))}ve(this._edits)&&ve(this._edits.addOrUpdate)&&this._edits.addOrUpdate.removeIds(e),this.requests.done=this.requests.done.filter(i=>i.message.addOrUpdate||i.message.end)}abort(){this._abortController.abort()}};function P5i(t,e){const i=new Set;return t&&t.forEach(r=>i.add(r)),e&&e.forEach(r=>i.add(r)),i.has("*")?["*"]:Array.from(i)}let K0t=class extends Tn{constructor(e){super(),this.events=new md,this._resolver=kf(),this._didEdit=!1,this._subscriptions=new Map,this._outSR=e.outSR,this._serviceInfo=e.serviceInfo,this._onTileUpdateMessage=e.onMessage}async _onMessage(e){const i=this._subscriptions.get(e.id);if(!i)return;const r={...e,remove:e.remove??[],status:e.status??k_.empty()};return pf(this._onTileUpdateMessage(r,i.options))}update(e,i){const r=i.fields.length;i.outFields=P5i(this._schema?.outFields,i.outFields),i.outFields=i.outFields.length>=.75*r?["*"]:i.outFields,i.outFields.sort();const n=h2(this._schema,i);if(!n)return;Hi("esri-2d-update-debug")&&console.debug("Applying Update - Source:",n);const s="orderByFields"in this._serviceInfo&&this._serviceInfo.orderByFields?this._serviceInfo.orderByFields:this._serviceInfo.objectIdField+" ASC",o={returnCentroid:this._serviceInfo.geometryType==="esriGeometryPolygon",returnGeometry:!0,timeReferenceUnknownClient:this._serviceInfo.type!=="stream"&&this._serviceInfo.timeReferenceUnknownClient,outFields:i.outFields,outSpatialReference:this._outSR,orderByFields:[s],where:i.definitionExpression||"1=1",gdbVersion:i.gdbVersion,historicMoment:i.historicMoment,timeExtent:i.timeExtent?Xg.fromJSON(i.timeExtent):null},a=this._schema&&yA(n,"outFields");this._schema&&xGt(n,["timeExtent","definitionExpression","gdbVersion","historicMoment","customParameters"])&&(e.why.mesh.push("Layer filter and/or custom parameters changed"),e.why.source.push("Layer filter and/or custom parameters changed"),e.mesh=!0,e.source=!0,e.queryFilter=!0),a&&(e.why.source.push("Layer required fields changed"),e.source=!0),h2(o,this._queryInfo)&&(this._queryInfo=o),this._schema=i,this._resolver.resolve()}whenInitialized(){return this._resolver.promise}async applyUpdate(e){if(e.queryFilter||e.source&&this._didEdit)return this.refresh(e.version),void(this._didEdit=!1);this._subscriptions.forEach(i=>i.applyUpdate(e)),await this.resend()}refresh(e,i){for(const r of this._tiles())this.unsubscribe(r),this.subscribe(r,e)}subscribe(e,i){const r=new A5i(e,i);this._subscriptions.set(e.id,r)}unsubscribe(e){const i=this.getSubscription(e.id);ve(i)&&i.abort(),this._subscriptions.delete(e.id)}createQuery(e={}){const i=this._queryInfo.historicMoment?new Date(this._queryInfo.historicMoment):null;return new Ns({...this._queryInfo,historicMoment:i,...e})}getSubscription(e){return this._subscriptions.has(e)?this._subscriptions.get(e):null}async queryLastEditDate(){throw new Error("Service does not support query type")}async query(e,i){throw new Error("Service does not support query")}*_tiles(){const e=Array.from(this._subscriptions.values());for(const i of e)yield i.tile}async edit(e,i){const r=Array.from(this._subscriptions.values()),n=r.map(({tile:s})=>s);for(const s of r)s.removeIds(i);if(e.length){const s=n.map(a=>{const l=this.createTileQuery(a);return l.objectIds=e,{tile:a,query:l}}).map(async({tile:a,query:l})=>({tile:a,result:await this.query(l,{query:{tile:Hi("esri-tiles-debug")?a.id.replace(/\//g,"."):void 0}}),query:l})),o=(await AH(s)).map(async({tile:a,result:l})=>{if(!l.hasFeatures&&!i.length&&!e.length)return;const c=this._subscriptions.get(a.key.id);c&&c.edit(l,e)});await Ru(o)}this._didEdit=!0}};const O5i=4;let aFe=class extends K0t{constructor(e){super(e),this.type="feature",this.mode="on-demand",this._adapter=x5i(e.serviceInfo),this._queue=new xN({concurrency:8,process:async i=>{if(yn(i),ve(i.tile)){const r=i.tile.key.id,{signal:n}=i,s=Hi("esri-tiles-debug")?{tile:r.replace(/\//g,"."),depth:i.depth}:void 0,o=await this._adapter.executeQuery(i.query,{signal:n,query:{...s,...this._schema?.customParameters}});return o.level=i.tile.key.level,o}return this._adapter.executeQuery(i.query,{...i,query:this._schema?.customParameters})}}),this._patchQueue=new xN({concurrency:8,process:async i=>{if(yn(i),ve(i.tile)){const r=i.tile.key.id,{signal:n}=i,s=Hi("esri-tiles-debug")?{tile:r.replace(/\//g,"."),depth:i.depth}:void 0,o=await this._adapter.executeQuery(i.query,{signal:n,query:{...s,...this._schema?.customParameters}});return o.level=i.tile.key.level,o}return this._adapter.executeQuery(i.query,{...i,query:this._schema?.customParameters})}})}destroy(){super.destroy(),this._adapter.destroy(),this._queue.destroy(),this._patchQueue.destroy()}get updating(){return!!this._queue.length||Array.from(this._subscriptions.values()).some(e=>!e.done)}get maxRecordCountFactor(){const{query:e}=this._serviceInfo.capabilities;return e.supportsMaxRecordCountFactor?O5i:null}get maxPageSize(){const{query:e}=this._serviceInfo.capabilities;return(e.maxRecordCount??8e3)*zu(this.maxRecordCountFactor,1)}get pageSize(){return Math.min(8e3,this.maxPageSize)}enableEvent(e,i){}subscribe(e,i){super.subscribe(e,i);const r=this._subscriptions.get(e.id);this._fetchDataTile(e).catch(n=>{ys(n)||Oi.getLogger("esri.views.2d.layers.features.sources.BaseFeatureSource").error(new st("mapview-query-error","Encountered error when fetching tile",{tile:e,error:n}))}).then(()=>r.end())}unsubscribe(e){super.unsubscribe(e)}readers(e){return this._subscriptions.get(e).readers()}async query(e,i={}){const r=i.query??{};return this._adapter.executeQuery(e,{...i,query:{...r,...this._schema?.customParameters}})}async queryLastEditDate(){const e=this._serviceInfo.source,i={...e.query,f:"json"};return(await ur(e.path,{query:i,responseType:"json"})).data.editingInfo.lastEditDate}createTileQuery(e,i={}){const r=this._serviceInfo.geometryType,n=this.createQuery(i);n.quantizationParameters=i.quantizationParameters??e.getQuantizationParameters(),n.resultType="tile",n.geometry=e.extent,this._serviceInfo.capabilities.query.supportsQuantization?r==="esriGeometryPolyline"&&(n.maxAllowableOffset=e.resolution*Hi("feature-polyline-generalization-factor")):r!=="esriGeometryPolyline"&&r!=="esriGeometryPolygon"||(n.maxAllowableOffset=e.resolution,r==="esriGeometryPolyline"&&(n.maxAllowableOffset*=Hi("feature-polyline-generalization-factor")));const s=this._serviceInfo.capabilities.query;return n.defaultSpatialReferenceEnabled=s.supportsDefaultSpatialReference,n.compactGeometryEnabled=s.supportsCompactGeometry,n}async _executePatchQuery(e,i,r,n){const s=i.clone();s.outFields=[this._serviceInfo.objectIdField,...r],s.returnCentroid=!1,s.returnGeometry=!1;const o=ve(s.start)?s.start/8e3:0,a=n.signal;return this._patchQueue.push({tile:e,query:s,signal:a,depth:o})}async _resend(e,i){const{query:r,message:n}=e,s=ve(r.outFields)?r.outFields:[],o=this._queryInfo.outFields,a=o.filter(l=>!s.includes(l));if(lt(n.addOrUpdate))this._onMessage({...n,type:"append"});else if(a.length)try{const l=this._subscriptions.get(n.id).tile,c=await this._executePatchQuery(l,r,a,i);yn(i),r.outFields=o,n.addOrUpdate.joinAttributes(c),this._onMessage({...n,end:n.end,type:"append"})}catch{}else this._onMessage({...n,type:"append"})}async _resendSubscription(e){if(Hi("esri-2d-update-debug")&&console.debug(e.tile.id,"Resend Subscription"),e.empty)return this._onMessage({id:e.tile.id,addOrUpdate:null,end:!1,type:"append"});const i=e.signal;for(const r of e.requests.done)await this._resend(r,{signal:i});return ve(e.edits)?this._onMessage(e.edits):void 0}async resend(){const e=Array.from(this._subscriptions.values());await Promise.all(e.map(i=>this._resendSubscription(i)))}};const J0t=Hi("esri-mobile"),Z0t={maxDrillLevel:J0t?1:4,maxRecordCountFactor:J0t?1:3};let R5i=class extends aFe{constructor(e){super(e)}async _fetchDataTile(e){const i=this._serviceInfo.capabilities.query.supportsMaxRecordCountFactor,r=this._subscriptions.get(e.key.id),n=r.signal,s=e.getQuantizationParameters();let o=0;const a=async(l,c)=>{const h=this._queryInfo,p=this.createTileQuery(l,{maxRecordCountFactor:i?Z0t.maxRecordCountFactor:void 0,returnExceededLimitFeatures:!1,quantizationParameters:s});o++;try{const y=await this._queue.push({tile:e,query:p,signal:n,depth:c});if(o--,yn(n),!y)return;if(h!==this._queryInfo)return void a(l,c);if(y.exceededTransferLimit&&c{a--,yn(n);const v=e.id,x=p.reader,I=p.query;if(!x.exceededTransferLimit){if(s=!0,y!==0&&!x.hasFeatures){const k={id:v,addOrUpdate:x,end:a===0,type:"append"};return n.add({message:k,query:I}),void this._onMessage(k)}const F={id:v,addOrUpdate:x,end:a===0,type:"append"};return n.add({message:F,query:I}),void this._onMessage(F)}const P={id:v,addOrUpdate:x,end:s&&a===0,type:"append"};n.add({message:P,query:I}),this._onMessage(P)};let c=0,h=0;for(;!s&&h++<20;){let p;for(let y=0;yx&&l(x,v)).catch(x=>{s=!0,ys(x)||(Oi.getLogger("esri.views.2d.layers.features.sources.PagedFeatureSource").error(new st("mapview-query-error","Encountered error when fetching tile",{tile:e,error:x})),this._onMessage({id:e.id,addOrUpdate:null,end:s,type:"append"}))})}await p,yn(n),c=Math.min(c+2,6)}}async _fetchDataTilePage(e,i,r){yn(r);const n=this._queryInfo,s={start:this.pageSize*i,num:this.pageSize,returnExceededLimitFeatures:!0,quantizationParameters:e.getQuantizationParameters()};ve(this.maxRecordCountFactor)&&(s.maxRecordCountFactor=this.maxRecordCountFactor);const o=this.createTileQuery(e,s);try{const a=r.signal,l=await this._queue.push({tile:e,query:o,signal:a,depth:i});return yn(r),l?n!==this._queryInfo?this._fetchDataTilePage(e,i,r):{reader:l,query:o}:null}catch(a){return _C(a),null}}};function D5i(t,e,i){const r=t.getXHydrated(),n=t.getYHydrated(),s=e.getColumnForX(r),o=Math.floor(e.normalizeCol(s));return`${i}/${Math.floor(e.getRowForY(n))}/${o}`}function lFe(t,e){if(lt(t))return null;const i=e.transform,r=t.getQuantizationTransform();if(lt(r)){const[P,F]=i.scale,[k,j]=i.translate,V=-k/P,Y=1/P,X=j/F,Z=1/-F;return t.transform(V,X,Y,Z)}const[n,s]=r.scale,[o,a]=r.translate,[l,c]=i.scale,[h,p]=i.translate,y=n/l,v=(o-h)/l,x=s/c,I=(-a+p)/c;return t.transform(v,I,y,x)}let F5i=class extends aFe{constructor(e){super(e),this.mode="snapshot",this._loading=!0,this._controller=new AbortController,this._downloadPromise=null,this._didSendEnd=!1,this._queries=new Array,this._invalidated=!1,this._hasAggregates=!1,this._random=new vC(1e3),this._store=e.store,this._markedIdsBufId=this._store.storage.createBitset()}destroy(){super.destroy(),this._controller.abort()}get loading(){return this._loading}get _signal(){return this._controller.signal}update(e,i){super.update(e,i),this._featureCount==null&&(this._featureCount=i.initialFeatureCount),ve(i.changedFeatureCount)&&(this._featureCount=i.changedFeatureCount),this._hasAggregates=!!e.targets?.aggregate}async resend(e=!1){if(await this._downloadPromise,this._invalidated||e){const r=Ou(this._featureCount,"Expected featureCount to be defined");return this._invalidated=!1,this._subscriptions.forEach(n=>n.clear()),this._downloadPromise=this._download(r),void await this._downloadPromise}const i=this._queries.map(({query:r,reader:n})=>this._sendPatchQuery(r,n));await Promise.all(i),this._subscriptions.forEach(r=>{r.requests.done.forEach(n=>this._onMessage(n.message))})}async refresh(e,i){i&&(this._featureCount=i.featureCount),await this.resend(!0)}async _sendPatchQuery(e,i){const r=ve(e.outFields)?e.outFields:[],n=this._queryInfo.outFields,s=n.filter(c=>!r.includes(c));if(!s.length)return;const o=e.clone(),a=this._signal;o.returnGeometry=!1,o.returnCentroid=!1,o.outFields=s,e.outFields=n;const l=await this._queue.push({query:o,depth:0,signal:a});yn({signal:a}),i.joinAttributes(l)}async _fetchDataTile(e){if(!this._downloadPromise){const l=Ou(this._featureCount,"Expected featureCount to be defined");this._downloadPromise=this._download(l)}const i=this._store.search(e),r=this._subscriptions.get(e.key.id),n=i.length-1;for(let l=0;l=0?i[n]:null,e),o=this._didSendEnd,a={type:"append",id:e.id,addOrUpdate:s,end:o,status:k_.empty()};r.add({query:null,message:a}),this._onMessage(a)}async _download(e){try{await this.whenInitialized();const i=this._store.storage.getBitset(this._markedIdsBufId),r=new Set;i.clear();const n=Math.ceil(e/this.pageSize),s=Array.from({length:n},(o,a)=>a).sort((o,a)=>this._random.getInt()-this._random.getInt()).map(o=>this._downloadPage(o,i,r));await Promise.all(s),this._store.sweepFeatures(i,this._store.storage),this._store.sweepFeatureSets(r)}catch(i){Oi.getLogger("esri.views.2d.layers.features.sources.SnapshotFeatureSource").error("mapview-snapshot-source","Encountered and error when downloading feature snapshot",i)}this._sendEnd(),this._loading=!1}async _downloadPage(e,i,r){const n=this.pageSize,s={start:e*n,num:n,cacheHint:!0};ve(this.maxRecordCountFactor)&&(s.maxRecordCountFactor=this.maxRecordCountFactor);const o=this.createQuery(s),a=this._signal,l=await this._queue.push({query:o,depth:e,signal:a});yn({signal:a}),this._queries.push({query:o,reader:l}),this._store.insert(l),r.add(l.instance);const c=l.getCursor();for(;c.next();)i.set(c.getDisplayId());this._send(l)}_send(e){if(!this._subscriptions.size)return;let i=null;const r=new Map,n=new Set,s=new Map;this._subscriptions.forEach(o=>{const a=o.tile;r.set(a.key.id,null),i=a.tileInfoView,n.add(a.level);const{row:l,col:c}=a.key,h=`${a.level}/${l}/${c}`,p=s.get(h)??[];p.push(o),s.set(h,p)});for(const o of n){const a=i.getLODInfoAt(o),l=e.getCursor();for(;l.next();){const c=D5i(l,a,o),h=l.getIndex();if(s.has(c))for(const p of s.get(c)){const y=p.tile.id;let v=r.get(y);lt(v)&&(v=[],r.set(y,v)),v.push(h)}}}r.forEach((o,a)=>{if(ve(o)){const l=this._subscriptions.get(a),c={type:"append",id:a,addOrUpdate:lFe(V0t.from(e,o),l.tile),end:!1,status:k_.empty()};l.add({query:null,message:c}),this._onMessage(c)}})}_sendEnd(){this._subscriptions.forEach(e=>{const i={type:"append",id:e.tile.id,addOrUpdate:null,end:!0,status:k_.empty()};e.add({query:null,message:i}),this._onMessage(i)}),this._didSendEnd=!0}};const L5i="__esri_stream_id__",Q0t="__esri_timestamp__",evt=1e3;let N5i=class{constructor(e,i,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=i,this.purgeInterval=s,this._useGeneratedIds=this.objectIdField===L5i}removeById(e){this._removed.push(e)}removeByTrackId(e){const i=this._trackIdToObservations.get(e);if(i)for(const r of i.entries)this._removed.push(r)}add(e){if(this._useGeneratedIds){const s=this._nextId();e.attributes[this.objectIdField]=s,e.objectId=s}else e.objectId=e.attributes[this.objectIdField];const i=e.objectId;if(this._addOrUpdated.set(i,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return lt(this._trackIdLessObservations)&&(this._trackIdLessObservations=new GD(1e5)),void this._trackIdLessObservations.enqueue(i);const r=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(r)){const s=ve(this._purgeOptions)&&this._purgeOptions.maxObservations!=null?this._purgeOptions.maxObservations:evt,o=eu(s,0,evt);this._trackIdToObservations.set(r,new GD(o))}const n=this._trackIdToObservations.get(r)?.enqueue(i);ve(n)&&(this._addOrUpdated.has(n)?this._addOrUpdated.delete(n):this._removed.push(n))}checkForUpdates(){const e=this._getToAdd(),i=this._getToRemove(),r=performance.now();r-this._lastPurge>=this.purgeInterval&&(this._purge(r),this._lastPurge=r);const n=[];if(ve(i))for(const o of i){const a=this.store.removeById(o);ve(a)&&n.push(a)}const s=[];if(ve(e)){const o=new Set(zu(i,[]));for(const a of e)o.has(a.objectId)||(a.attributes[Q0t]=r,this.store.add(a),s.push(a))}(s.length||n?.length)&&this.store.update(s,n)}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let i=0;return this._addOrUpdated.forEach(r=>e[i++]=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 i=this._purgeOptions;ve(i)&&(this._purgeSomeByDisplayCount(i),this._purgeByAge(i),this._purgeByAgeReceived(e,i),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let i=this.store.size;if(i>e.displayCount){if(this._timeInfo.trackIdField){for(const r of this._trackIdToObservations.values())if(i>e.displayCount&&r.size){const n=r.dequeue();this._removed.push(n),i--}}if(ve(this._trackIdLessObservations)){let r=i-e.displayCount;for(;r-- >0;){const n=this._trackIdLessObservations.dequeue();ve(n)&&this._removed.push(n)}}}}_purgeByAge(e){const i=this._timeInfo?.startTimeField;if(!e.age||!i)return;const r=60*e.age*1e3,n=this._maxAge-r;this.store.forEach(s=>{s.attributes[i]{n.attributes[Q0t]{e.size===0&&this._trackIdToObservations.delete(i)})}},$pe=class extends md.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new st("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};E([N({readOnly:!0})],$pe.prototype,"connectionError",null),$pe=E([dt("esri.layers.support.StreamConnection")],$pe);const tvt=$pe;var pG;(function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSING=2]="CLOSING",t[t.CLOSED=3]="CLOSED"})(pG||(pG={}));let fG=class extends tvt{constructor(e){super(),this._outstandingMessages=[],this.errorString=null;const{geometryType:i,spatialReference:r,sourceSpatialReference:n}=e;this._config=e,this._featureZScaler=F9(i,n,r),this._open()}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),ve(this._websocket)&&(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(lt(this._websocket))return"disconnected";switch(this._websocket.readyState){case pG.CONNECTING:case pG.OPEN:return"connected";case pG.CLOSING:case pG.CLOSED:return"disconnected"}}sendMessageToSocket(e){lt(this._websocket)?this._outstandingMessages.push(e):this._websocket.send(JSON.stringify(e))}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,ve(this._websocket)&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,i=1e3,r=0){try{if(this.destroyed)return;const n=zy(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(n),this.notifyChange("connectionStatus")}catch(n){const s=i/1e3;return this._config.maxReconnectionAttempts&&r>=this._config.maxReconnectionAttempts?(Oi.getLogger(this.declaredClass).error(new st("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(Oi.getLogger(this.declaredClass).error(new st("websocket-connection",`Failed to connect. Attempting to reconnect in ${s}s`,n)),await B3(i),this._tryCreateWebSocket(e,Math.min(1.5*i,1e3*this._config.maxReconnectionInterval),r+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=i=>{try{const r=JSON.parse(i.data);this._onMessage(r)}catch(r){return void Oi.getLogger(this.declaredClass).error(new st("websocket-connection","Failed to parse message, invalid JSON",{error:r}))}}}_createWebSocket(e){return new Promise((i,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),i(n)},n.onclose=s=>{n.onopen=n.onclose=null,r(s)}})}async _handshake(e=1e4){const i=this._websocket;if(lt(i))return;const r=kf(),n=i.onmessage,{filter:s,outFields:o,spatialReference:a}=this._config;return r.timeout(e),i.onmessage=l=>{let c=null;try{c=JSON.parse(l.data)}catch{}c&&typeof c=="object"||(Oi.getLogger(this.declaredClass).error(new st("websocket-connection","Protocol violation. Handshake failed - malformed message",l.data)),r.reject(),this.destroy()),c.spatialReference?.wkid!==a?.wkid&&(Oi.getLogger(this.declaredClass).error(new st("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${a.wkid}`,l.data)),r.reject(),this.destroy()),c.format!=="json"&&(Oi.getLogger(this.declaredClass).error(new st("websocket-connection","Protocol violation. Handshake failed - format is not set",l.data)),r.reject(),this.destroy()),s&&c.filter!==s&&Oi.getLogger(this.declaredClass).error(new st("websocket-connection","Tried to set filter, but server doesn't support it")),o&&c.outFields!==o&&Oi.getLogger(this.declaredClass).error(new st("websocket-connection","Tried to set outFields, but server doesn't support it")),i.onmessage=n;for(const h of this._outstandingMessages)i.send(JSON.stringify(h));this._outstandingMessages=[],r.resolve()},i.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 i of e.features)ve(this._featureZScaler)&&this._featureZScaler(i.geometry),this.onFeature(i)}}_onError(e){const i="Encountered an error over WebSocket connection";this._set("errorString",i),Oi.getLogger(this.declaredClass).error("websocket-connection",i)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),e.code!==1e3&&Oi.getLogger(this.declaredClass).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};E([N()],fG.prototype,"connectionStatus",null),E([N()],fG.prototype,"errorString",void 0),fG=E([dt("esri.layers.graphics.sources.connections.WebSocketConnection")],fG);const k5i=1e4,$5i={maxQueryDepth:5,maxRecordCountFactor:3};let uFe=class extends fG{constructor(e){super({...$5i,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||Oi.getLogger(this.declaredClass).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 i=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(i);const{filter:r,outFields:n}=this._config;this.destroyed||this._setFilter(r,n)}_onMessage(e){if("attributes"in e){let i;try{i=this._enrich(e),ve(this._featureZScaler)&&this._featureZScaler(i.geometry)}catch(r){return void Oi.getLogger(this.declaredClass).error(new st("geoevent-connection","Failed to parse message",r))}this.onFeature(i)}else this.onMessage(e)}async _fetchServiceDefinition(e){const i={f:"json",...this._config.customParameters},r=ur(e.path,{query:i,responseType:"json"}),n=(await r).data;return this._serviceDefinition=n,n}_fetchWebSocketUrl(e,i){const r=e[0],{urls:n,token:s}=r,o=this._inferWebSocketBaseUrl(n);return zy(`${o}/subscribe`,{outSR:""+i.wkid,token:s})}_inferWebSocketBaseUrl(e){if(e.length===1)return e[0];for(const i of e)if(i.includes("wss"))return i;return Oi.getLogger(this.declaredClass).error(new st("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,i){const r=this._websocket;if(lt(r)||lt(e)&<(i))return;const n=JSON.stringify({filter:this._serializeFilter(e,i)});let s=!1;const o=kf(),a=()=>{s||(this.destroyed||this._websocket!==r||Oi.getLogger(this.declaredClass).error(new st("geoevent-connection","Server timed out when setting filter")),o.reject())},l=c=>{const h=JSON.parse(c.data);h.filter&&(h.error&&(Oi.getLogger(this.declaredClass).error(new st("geoevent-connection","Failed to set service filter",h.error)),this._set("errorString",`Could not set service filter - ${h.error}`),o.reject(h.error)),this._setWebSocketJSONParseHandler(r),s=!0,o.resolve())};return r.onmessage=l,r.send(n),setTimeout(a,k5i),o.promise}_serializeFilter(e,i){const r={};if(lt(e)&<(i))return r;if(ve(e)&&e.geometry)try{const n=Sl(e.geometry);if(n.type!=="extent")throw new st(`Expected extent but found type ${n.type}`);r.geometry=JSON.stringify(n.shiftCentralMeridian())}catch(n){Oi.getLogger(this.declaredClass).error(new st("geoevent-connection","Encountered an error when setting connection geometryDefinition",n))}return ve(e)&&e.where&&e.where!=="1 = 1"&&e.where!=="1=1"&&(r.where=e.where),ve(i)&&(r.outFields=i.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const i=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[i],n=this._relatedFeatures.get(r);if(!n)return Oi.getLogger(this.declaredClass).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||Oi.getLogger(this.declaredClass).error(new st("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:i}=this._serviceDefinition,r=this._queryRelatedFeatures(e),n=this._queryArchive(i);await r;const s=await n;if(!s)return;for(const o of s.features)this.onFeature(this._enrich(o))}catch(e){Oi.getLogger(this.declaredClass).error(new st("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const i=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(i)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const i=new(await Promise.resolve().then(()=>lCe)).default({url:e}),{capabilities:r}=await i.load(),n=r.query.supportsMaxRecordCountFactor,s=r.query.supportsPagination,o=r.query.supportsCentroid,a=this._config.maxRecordCountFactor,l=i.capabilities.query.maxRecordCount,c=n?l*a:l,h=new Ns;if(h.outFields=zu(this._config.outFields,["*"]),h.where=zu(Wx(this._config.filter,"where"),"1=1"),h.returnGeometry=!0,h.returnExceededLimitFeatures=!0,h.outSpatialReference=hr.fromJSON(this._config.spatialReference),o&&(h.returnCentroid=!0),n&&(h.maxRecordCountFactor=a),s)return h.num=c,i.destroy(),this._queryPages(e,h);const p=await EB(e,h,this._config.sourceSpatialReference);return i.destroy(),p.data}async _queryPages(e,i,r=[],n=0){i.start=ve(i.num)?n*i.num:null;const{data:s}=await EB(e,i,this._config.sourceSpatialReference);return s.exceededTransferLimit&&n<(this._config.maxQueryDepth??0)?(s.features.forEach(o=>r.push(o)),this._queryPages(e,i,r,n+1)):(r.forEach(o=>s.features.push(o)),s)}_addRelatedFeatures(e){const i=new Map,r=e.features,n=this._serviceDefinition.relatedFeatures.joinField;for(const s of r){const o=s.attributes[n];i.set(o,s)}this._relatedFeatures=i}};uFe=E([dt("esri.layers.graphics.sources.connections.GeoEventConnection")],uFe);const B5i=uFe;let MJ=class extends tvt{constructor(e){super(),this.connectionStatus="connected",this.errorString=null;const{geometryType:i,spatialReference:r,sourceSpatialReference:n}=e;this._featureZScaler=F9(i,n,r)}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const i of e.features)ve(this._featureZScaler)&&this._featureZScaler(i.geometry),this.onFeature(i)}this.onMessage(e)}};E([N()],MJ.prototype,"connectionStatus",void 0),E([N()],MJ.prototype,"errorString",void 0),MJ=E([dt("esri.layers.support.ClientSideConnection")],MJ);function ivt(t,e,i,r,n,s,o,a){const l={source:t,sourceSpatialReference:e,spatialReference:i,geometryType:r,filter:n,maxReconnectionAttempts:s,maxReconnectionInterval:o,customParameters:a};return t?t.path.startsWith("wss://")||t.path.startsWith("ws://")?new fG(l):new B5i(l):new MJ(l)}const V5i=Object.freeze(Object.defineProperty({__proto__:null,createConnection:ivt},Symbol.toStringTag,{value:"Module"})),j5i=2500;function G5i(t,e){const i=t.weakClone();if(ve(t.geometry)){const r=vY(e,t.geometry.coords[0]),n=_Y(e,t.geometry.coords[1]);i.geometry=new Ml([],[r,n])}return i}function U5i(t){return t==="esriGeometryPoint"?G5i:(e,i)=>{const r=e.weakClone(),n=new Ml,s=!1,o=!1,a=jA(n,e.geometry,s,o,t,i,!1,!1);return r.geometry=a,r}}function z5i(t){return t==="esriGeometryPoint"?e=>ve(e.geometry)?{minX:e.geometry.coords[0],minY:e.geometry.coords[1],maxX:e.geometry.coords[0],maxY:e.geometry.coords[1]}:{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}:e=>{let i=1/0,r=1/0,n=-1/0,s=-1/0;return ve(e.geometry)&&e.geometry.forEachVertex((o,a)=>{i=Math.min(i,o),r=Math.min(r,a),n=Math.max(n,o),s=Math.max(s,a)}),{minX:i,minY:r,maxX:n,maxY:s}}}function H5i(t,e){const i=AN(9,z5i(e));return i.load(t),i}function W5i(t,e){return t.search({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]})}let q5i=class{constructor(e,i){this.onUpdate=e,this._geometryType=i,this._objectIdToFeature=new Map,this._index=null}get _features(){const e=[];return this._objectIdToFeature.forEach(i=>e.push(i)),e}add(e){this._objectIdToFeature.set(e.objectId,e),this._index=null}get(e){return this._objectIdToFeature.has(e)?this._objectIdToFeature.get(e):null}forEach(e){this._objectIdToFeature.forEach(e)}search(e){return this._index||(this._index=H5i(this._features,this._geometryType)),W5i(this._index,e)}clear(){this._index=null,this._objectIdToFeature.clear()}removeById(e){const i=this._objectIdToFeature.get(e);return i?(this._objectIdToFeature.delete(e),this._index=null,i):null}update(e,i){this.onUpdate(e,i)}get size(){return this._objectIdToFeature.size}},mG=class extends K0t{constructor(e){super(e),this.type="stream",this._updateIntervalId=0,this._level=0,this._updateInfo={websocket:0,client:0},this._isPaused=!1,this._inUpdate=!1;const{outSR:i}=e,{geometryType:r,objectIdField:n,timeInfo:s,purgeOptions:o,source:a,spatialReference:l,serviceFilter:c,maxReconnectionAttempts:h,maxReconnectionInterval:p,updateInterval:y,customParameters:v,enabledEventTypes:x}=e.serviceInfo,I=new q5i(this._onUpdate.bind(this),r),P=new N5i(I,n,s,o),F=ivt(a,l,i,r,c,h,p,v??{});this._store=I,this._manager=P,this._connection=F,this._quantize=U5i(r),this._enabledEventTypes=new Set(x),this._handles=[this._connection.on("data-received",k=>this._onFeature(k)),this._connection.on("message-received",k=>this._onWebSocketMessage(k))],this._initUpdateInterval=()=>{let k=performance.now();this._updateIntervalId=setInterval(()=>{const j=performance.now(),V=j-k;if(V>j5i){k=j;const Y=Math.round(this._updateInfo.client/(V/1e3)),X=Math.round(this._updateInfo.websocket/(V/1e3));this._updateInfo.client=0,this._updateInfo.websocket=0,this.events.emit("updateRate",{client:Y,websocket:X})}e.canAcceptRequest()&&!this._inUpdate&&this._manager.checkForUpdates()},y)},this._initUpdateInterval()}destroy(){super.destroy(),this._clearUpdateInterval(),this._handles.forEach(e=>e.remove()),this._connection.destroy()}_fetchDataTile(){}get connectionStatus(){return this._isPaused?"paused":this._connection?.connectionStatus}get errorString(){return this._connection?.errorString}updateCustomParameters(e){this._connection.updateCustomParameters(e)}pauseStream(){this._isPaused||(this._isPaused=!0,this._clearUpdateInterval())}resumeStream(){this._isPaused&&(this._isPaused=!1,this._initUpdateInterval())}sendMessageToSocket(e){this._connection.sendMessageToSocket(e)}sendMessageToClient(e){this._connection.sendMessageToClient(e)}enableEvent(e,i){i?this._enabledEventTypes.add(e):this._enabledEventTypes.delete(e)}get updating(){return!1}subscribe(e,i){super.subscribe(e,i);const r=this._subscriptions.get(e.id);this._level=e.level;const n=this._getTileFeatures(e);this._onMessage({type:"append",id:e.key.id,addOrUpdate:n,end:!0}),r.didSend=!0}unsubscribe(e){super.unsubscribe(e)}*readers(e){const i=this._subscriptions.get(e),{tile:r}=i;yield this._getTileFeatures(r)}createTileQuery(e){throw new Error("Service does not support tile queries")}async resend(){this._subscriptions.forEach(e=>{const{tile:i}=e,r={type:"append",id:i.id,addOrUpdate:this._getTileFeatures(i),end:!0};this._onMessage(r)})}_getTileFeatures(e){const i=this._store.search(e).map(r=>this._quantize(r,e.transform));return Ev.fromOptimizedFeatures(i,this._serviceInfo,e.transform)}_onWebSocketMessage(e){if(this._enabledEventTypes.has("message-received")&&this.events.emit("message-received",e),"type"in e)switch(e.type){case"delete":if(e.objectIds)for(const i of e.objectIds)this._manager.removeById(i);if(e.trackIds)for(const i of e.trackIds)this._manager.removeByTrackId(i);break;case"clear":this._store.forEach(i=>this._manager.removeById(i.objectId))}}_onFeature(e){this._updateInfo.websocket++;try{this._enabledEventTypes.has("data-received")&&this.events.emit("data-received",e);const i=ATe(e,this._serviceInfo.geometryType,!1,!1,this._serviceInfo.objectIdField);this._manager.add(i)}catch{}}_clearUpdateInterval(){clearInterval(this._updateIntervalId),this._updateIntervalId=0}async _onUpdate(e,i){this._inUpdate=!0;try{ve(e)&&(this._updateInfo.client+=e.length),this._subscriptions.forEach((n,s)=>{n.didSend&&n.tile.level===this._level&&this._onMessage({type:"append",id:s,addOrUpdate:null,clear:!0,end:!1})});const r=[];this._subscriptions.forEach((n,s)=>{if(!n.didSend||n.tile.level!==this._level)return;const o=n.tile,a={type:"append",id:s,addOrUpdate:this._getTileFeatures(o),remove:[],end:!1,status:k_.empty()};n.requests.stream.enqueue(a),r.push(this._onMessage(a))}),await Promise.all(r),this._subscriptions.forEach((n,s)=>{n.didSend&&n.tile.level===this._level&&this._onMessage({type:"append",id:s,addOrUpdate:null,end:!0})})}catch{}this._inUpdate=!1}};E([N()],mG.prototype,"_isPaused",void 0),E([N()],mG.prototype,"connectionStatus",null),E([N()],mG.prototype,"errorString",null),mG=E([dt("esri.views.2d.layers.features.sources")],mG);function Y5i(t,e,i,r,n,s){const o=X5i(t,e,i,r,n,s);switch(o.type){case"feature":switch(o.origin){case"hosted":case"local":return new M5i(o);case"snapshot":return new F5i(o);default:return new R5i(o)}case"stream":return new mG(o)}}function X5i(t,e,i,r,n,s){switch(t.type){case"snapshot":return{type:"feature",origin:"snapshot",featureCount:zu(t.featureCount,0),serviceInfo:t,onMessage:r,outSR:e,tileInfoView:i,canAcceptRequest:n,store:s};case"stream":return{type:"stream",serviceInfo:t,onMessage:r,outSR:e,canAcceptRequest:n};case"memory":case"on-demand":return{type:"feature",serviceInfo:t,onMessage:r,outSR:e,origin:o(t.source),tileInfoView:i,canAcceptRequest:n}}function o(a){return Array.isArray(a)?"local":"path"in a&&L9(a.path)?"hosted":"unknown"}}const cFe=1e-30,rvt=4294967295,Pc=512,K5i=8,nvt=10,hFe=29,Bpe=24,J5i=8,svt=0,ovt=0,Vpe=0,jpe=1,Gpe=2,dFe=3,pFe=4,Upe=5,zpe=6,avt=12,DJ=5,lvt=6,Z5i=5,Q5i=6,eNi=0,fFe=1,Hpe=2,mFe=3,tNi=4,uvt=2,iNi=1,cvt=2,rNi=4,gFe=1.05,hvt=3,Zw=5,dvt=6,pvt=1.15,Oc=2,FJ=8,nNi=500,dy=10,fvt=1024,Wk=2,sNi=0,oNi=1,aNi=4,lNi=8,Wpe=16,mvt=4,uNi=1,gvt=4,yvt=8,cNi=128,hNi=4,dNi=2,nm=8388607,vvt=8388608,pNi=254,fNi=255,mNi=0,yFe=1,vFe=t=>(t&vvt)>>>23,eO=t=>t&nm,gNi=t=>vFe(t)===yFe?pNi:fNi;function _vt(t){return vFe(t)===yFe}function _Fe(t,e){return((e?vvt:0)|t)>>>0}var xf,sm,py,bvt,$_,wvt,bFe,wFe,xFe,xvt,hS,Svt,Cvt,Tvt,Evt,SFe,CFe,Ivt,Avt,gG,$l,qk,Pvt,Ovt,tO,Rvt,Mvt,yG,TFe,Dvt,Fvt,Lvt,Nvt,kvt,$vt,dS,B_,Bvt,Vvt,pS,jvt,Gvt,Uvt,zvt,fS,LJ,UD,vG,Hvt,Wvt,qvt,Yvt,Xvt,Kvt,Jvt,qpe,Ype,Zvt,EFe,Qvt,e_t;(function(t){t[t.BUTT=0]="BUTT",t[t.ROUND=1]="ROUND",t[t.SQUARE=2]="SQUARE",t[t.UNKNOWN=4]="UNKNOWN"})(xf||(xf={})),function(t){t[t.BEVEL=0]="BEVEL",t[t.ROUND=1]="ROUND",t[t.MITER=2]="MITER",t[t.UNKNOWN=4]="UNKNOWN"}(sm||(sm={})),function(t){t[t.SCREEN=0]="SCREEN",t[t.MAP=1]="MAP"}(py||(py={})),function(t){t[t.Tint=0]="Tint",t[t.Ignore=1]="Ignore",t[t.Multiply=99]="Multiply"}(bvt||(bvt={})),function(t){t.Both="Both",t.JustBegin="JustBegin",t.JustEnd="JustEnd",t.None="None"}($_||($_={})),function(t){t[t.Mosaic=0]="Mosaic",t[t.Centered=1]="Centered"}(wvt||(wvt={})),function(t){t[t.Normal=0]="Normal",t[t.Superscript=1]="Superscript",t[t.Subscript=2]="Subscript"}(bFe||(bFe={})),function(t){t[t.MSSymbol=0]="MSSymbol",t[t.Unicode=1]="Unicode"}(wFe||(wFe={})),function(t){t[t.Unspecified=0]="Unspecified",t[t.TrueType=1]="TrueType",t[t.PSOpenType=2]="PSOpenType",t[t.TTOpenType=3]="TTOpenType",t[t.Type1=4]="Type1"}(xFe||(xFe={})),function(t){t[t.Display=0]="Display",t[t.Map=1]="Map"}(xvt||(xvt={})),function(t){t.None="None",t.Loop="Loop",t.Oscillate="Oscillate"}(hS||(hS={})),function(t){t[t.Z=0]="Z",t[t.X=1]="X",t[t.Y=2]="Y"}(Svt||(Svt={})),function(t){t[t.XYZ=0]="XYZ",t[t.ZXY=1]="ZXY",t[t.YXZ=2]="YXZ"}(Cvt||(Cvt={})),function(t){t[t.Rectangle=0]="Rectangle",t[t.RoundedRectangle=1]="RoundedRectangle",t[t.Oval=2]="Oval"}(Tvt||(Tvt={})),function(t){t[t.None=0]="None",t[t.Alpha=1]="Alpha",t[t.Screen=2]="Screen",t[t.Multiply=3]="Multiply",t[t.Add=4]="Add"}(Evt||(Evt={})),function(t){t[t.TTB=0]="TTB",t[t.RTL=1]="RTL",t[t.BTT=2]="BTT"}(SFe||(SFe={})),function(t){t[t.None=0]="None",t[t.SignPost=1]="SignPost",t[t.FaceNearPlane=2]="FaceNearPlane"}(CFe||(CFe={})),function(t){t[t.Float=0]="Float",t[t.String=1]="String",t[t.Boolean=2]="Boolean"}(Ivt||(Ivt={})),function(t){t[t.Intersect=0]="Intersect",t[t.Subtract=1]="Subtract"}(Avt||(Avt={})),function(t){t.OpenEnded="OpenEnded",t.Block="Block",t.Crossed="Crossed"}(gG||(gG={})),function(t){t.FullGeometry="FullGeometry",t.PerpendicularFromFirstSegment="PerpendicularFromFirstSegment",t.ReversedFirstSegment="ReversedFirstSegment",t.PerpendicularToSecondSegment="PerpendicularToSecondSegment",t.SecondSegmentWithTicks="SecondSegmentWithTicks",t.DoublePerpendicular="DoublePerpendicular",t.OppositeToFirstSegment="OppositeToFirstSegment",t.TriplePerpendicular="TriplePerpendicular",t.HalfCircleFirstSegment="HalfCircleFirstSegment",t.HalfCircleSecondSegment="HalfCircleSecondSegment",t.HalfCircleExtended="HalfCircleExtended",t.OpenCircle="OpenCircle",t.CoverageEdgesWithTicks="CoverageEdgesWithTicks",t.GapExtentWithDoubleTicks="GapExtentWithDoubleTicks",t.GapExtentMidline="GapExtentMidline",t.Chevron="Chevron",t.PerpendicularWithArc="PerpendicularWithArc",t.ClosedHalfCircle="ClosedHalfCircle",t.TripleParallelExtended="TripleParallelExtended",t.ParallelWithTicks="ParallelWithTicks",t.Parallel="Parallel",t.PerpendicularToFirstSegment="PerpendicularToFirstSegment",t.ParallelOffset="ParallelOffset",t.OffsetOpposite="OffsetOpposite",t.OffsetSame="OffsetSame",t.CircleWithArc="CircleWithArc",t.DoubleJog="DoubleJog",t.PerpendicularOffset="PerpendicularOffset",t.LineExcludingLastSegment="LineExcludingLastSegment",t.MultivertexArrow="MultivertexArrow",t.CrossedArrow="CrossedArrow",t.ChevronArrow="ChevronArrow",t.ChevronArrowOffset="ChevronArrowOffset",t.PartialFirstSegment="PartialFirstSegment",t.Arch="Arch",t.CurvedParallelTicks="CurvedParallelTicks",t.Arc90Degrees="Arc90Degrees"}($l||($l={})),function(t){t.Mitered="Mitered",t.Bevelled="Bevelled",t.Rounded="Rounded",t.Square="Square",t.TrueBuffer="TrueBuffer"}(qk||(qk={})),function(t){t.ClosePath="ClosePath",t.ConvexHull="ConvexHull",t.RectangularBox="RectangularBox"}(Pvt||(Pvt={})),function(t){t.BeginningOfLine="BeginningOfLine",t.EndOfLine="EndOfLine"}(Ovt||(Ovt={})),function(t){t.Mitered="Mitered",t.Bevelled="Bevelled",t.Rounded="Rounded",t.Square="Square"}(tO||(tO={})),function(t){t.Fast="Fast",t.Accurate="Accurate"}(Rvt||(Rvt={})),function(t){t.BeginningOfLine="BeginningOfLine",t.EndOfLine="EndOfLine"}(Mvt||(Mvt={})),function(t){t.Sinus="Sinus",t.Square="Square",t.Triangle="Triangle",t.Random="Random"}(yG||(yG={})),function(t){t[t.None=0]="None",t[t.Default=1]="Default",t[t.Force=2]="Force"}(TFe||(TFe={})),function(t){t[t.Buffered=0]="Buffered",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.AlongLine=3]="AlongLine"}(Dvt||(Dvt={})),function(t){t[t.Linear=0]="Linear",t[t.Rectangular=1]="Rectangular",t[t.Circular=2]="Circular",t[t.Buffered=3]="Buffered"}(Fvt||(Fvt={})),function(t){t[t.Discrete=0]="Discrete",t[t.Continuous=1]="Continuous"}(Lvt||(Lvt={})),function(t){t[t.AcrossLine=0]="AcrossLine",t[t.AloneLine=1]="AloneLine"}(Nvt||(Nvt={})),function(t){t[t.Left=0]="Left",t[t.Right=1]="Right",t[t.Center=2]="Center",t[t.Justify=3]="Justify"}(kvt||(kvt={})),function(t){t[t.Base=0]="Base",t[t.MidPoint=1]="MidPoint",t[t.ThreePoint=2]="ThreePoint",t[t.FourPoint=3]="FourPoint",t[t.Underline=4]="Underline",t[t.CircularCW=5]="CircularCW",t[t.CircularCCW=6]="CircularCCW"}($vt||($vt={})),function(t){t.Butt="Butt",t.Round="Round",t.Square="Square"}(dS||(dS={})),function(t){t.NoConstraint="NoConstraint",t.HalfPattern="HalfPattern",t.HalfGap="HalfGap",t.FullPattern="FullPattern",t.FullGap="FullGap",t.Custom="Custom"}(B_||(B_={})),function(t){t[t.None=-1]="None",t[t.Custom=0]="Custom",t[t.Circle=1]="Circle",t[t.OpenArrow=2]="OpenArrow",t[t.ClosedArrow=3]="ClosedArrow",t[t.Diamond=4]="Diamond"}(Bvt||(Bvt={})),function(t){t[t.ExtraLeading=0]="ExtraLeading",t[t.Multiple=1]="Multiple",t[t.Exact=2]="Exact"}(Vvt||(Vvt={})),function(t){t.Bevel="Bevel",t.Round="Round",t.Miter="Miter"}(pS||(pS={})),function(t){t[t.Default=0]="Default",t[t.String=1]="String",t[t.Numeric=2]="Numeric"}(jvt||(jvt={})),function(t){t[t.InsidePolygon=0]="InsidePolygon",t[t.PolygonCenter=1]="PolygonCenter",t[t.RandomlyInsidePolygon=2]="RandomlyInsidePolygon"}(Gvt||(Gvt={})),function(t){t[t.Tint=0]="Tint",t[t.Replace=1]="Replace",t[t.Multiply=2]="Multiply"}(Uvt||(Uvt={})),function(t){t[t.ClipAtBoundary=0]="ClipAtBoundary",t[t.RemoveIfCenterOutsideBoundary=1]="RemoveIfCenterOutsideBoundary",t[t.DoNotTouchBoundary=2]="DoNotTouchBoundary",t[t.DoNotClip=3]="DoNotClip"}(zvt||(zvt={})),function(t){t.NoConstraint="NoConstraint",t.WithMarkers="WithMarkers",t.WithFullGap="WithFullGap",t.WithHalfGap="WithHalfGap",t.Custom="Custom"}(fS||(fS={})),function(t){t.Fixed="Fixed",t.Random="Random",t.RandomFixedQuantity="RandomFixedQuantity"}(LJ||(LJ={})),function(t){t.LineMiddle="LineMiddle",t.LineBeginning="LineBeginning",t.LineEnd="LineEnd",t.SegmentMidpoint="SegmentMidpoint"}(UD||(UD={})),function(t){t.OnPolygon="OnPolygon",t.CenterOfMass="CenterOfMass",t.BoundingBoxCenter="BoundingBoxCenter"}(vG||(vG={})),function(t){t[t.Low=0]="Low",t[t.Medium=1]="Medium",t[t.High=2]="High"}(Hvt||(Hvt={})),function(t){t[t.MarkerCenter=0]="MarkerCenter",t[t.MarkerBounds=1]="MarkerBounds"}(Wvt||(Wvt={})),function(t){t[t.None=0]="None",t[t.PropUniform=1]="PropUniform",t[t.PropNonuniform=2]="PropNonuniform",t[t.DifUniform=3]="DifUniform",t[t.DifNonuniform=4]="DifNonuniform"}(qvt||(qvt={})),function(t){t.Tube="Tube",t.Strip="Strip",t.Wall="Wall"}(Yvt||(Yvt={})),function(t){t[t.Random=0]="Random",t[t.Increasing=1]="Increasing",t[t.Decreasing=2]="Decreasing",t[t.IncreasingThenDecreasing=3]="IncreasingThenDecreasing"}(Xvt||(Xvt={})),function(t){t[t.Relative=0]="Relative",t[t.Absolute=1]="Absolute"}(Kvt||(Kvt={})),function(t){t[t.Normal=0]="Normal",t[t.LowerCase=1]="LowerCase",t[t.Allcaps=2]="Allcaps"}(Jvt||(Jvt={})),function(t){t[t.LTR=0]="LTR",t[t.RTL=1]="RTL"}(qpe||(qpe={})),function(t){t.Draft="Draft",t.Picture="Picture",t.Text="Text"}(Ype||(Ype={})),function(t){t[t.Top=0]="Top",t[t.Center=1]="Center",t[t.Baseline=2]="Baseline",t[t.Bottom=3]="Bottom"}(Zvt||(Zvt={})),function(t){t[t.Right=0]="Right",t[t.Upright=1]="Upright"}(EFe||(EFe={})),function(t){t[t.Small=0]="Small",t[t.Medium=1]="Medium",t[t.Large=2]="Large"}(Qvt||(Qvt={})),function(t){t[t.Calm=0]="Calm",t[t.Rippled=1]="Rippled",t[t.Slight=2]="Slight",t[t.Moderate=3]="Moderate"}(e_t||(e_t={}));var Ln,mo,_G,sd,bG,wG,sa;(function(t){t[t.FILL=0]="FILL",t[t.LINE=1]="LINE",t[t.MARKER=2]="MARKER",t[t.TEXT=3]="TEXT",t[t.LABEL=4]="LABEL"})(Ln||(Ln={})),function(t){t[t.NONE=0]="NONE",t[t.MAP=1]="MAP",t[t.LABEL=2]="LABEL",t[t.LABEL_ALPHA=4]="LABEL_ALPHA",t[t.HITTEST=8]="HITTEST",t[t.HIGHLIGHT=16]="HIGHLIGHT",t[t.CLIP=32]="CLIP",t[t.DEBUG=64]="DEBUG",t[t.NUM_DRAW_PHASES=9]="NUM_DRAW_PHASES"}(mo||(mo={})),function(t){t[t.SIZE=0]="SIZE",t[t.COLOR=1]="COLOR",t[t.OPACITY=2]="OPACITY",t[t.ROTATION=3]="ROTATION"}(_G||(_G={})),function(t){t[t.NONE=0]="NONE",t[t.OPACITY=1]="OPACITY",t[t.COLOR=2]="COLOR",t[t.ROTATION=4]="ROTATION",t[t.SIZE_MINMAX_VALUE=8]="SIZE_MINMAX_VALUE",t[t.SIZE_SCALE_STOPS=16]="SIZE_SCALE_STOPS",t[t.SIZE_FIELD_STOPS=32]="SIZE_FIELD_STOPS",t[t.SIZE_UNIT_VALUE=64]="SIZE_UNIT_VALUE"}(sd||(sd={})),function(t){t[t.MINMAX_TARGETS_OUTLINE=128]="MINMAX_TARGETS_OUTLINE",t[t.SCALE_TARGETS_OUTLINE=256]="SCALE_TARGETS_OUTLINE",t[t.FIELD_TARGETS_OUTLINE=512]="FIELD_TARGETS_OUTLINE",t[t.UNIT_TARGETS_OUTLINE=1024]="UNIT_TARGETS_OUTLINE"}(bG||(bG={})),function(t){t[t.SPRITE=0]="SPRITE",t[t.GLYPH=1]="GLYPH"}(wG||(wG={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.SIMPLE=1]="SIMPLE",t[t.DOT_DENSITY=2]="DOT_DENSITY",t[t.OUTLINE_FILL=3]="OUTLINE_FILL",t[t.OUTLINE_FILL_SIMPLE=4]="OUTLINE_FILL_SIMPLE",t[t.HEATMAP=5]="HEATMAP",t[t.PIE_CHART=6]="PIE_CHART"}(sa||(sa={}));const NJ=Oi.getLogger("esri.views.2d.engine.webgl.Utils"),V_="geometry",yNi=[{name:V_,strideInBytes:12}],vNi=[{name:V_,strideInBytes:36}],_Ni=[{name:V_,strideInBytes:24}],bNi=[{name:V_,strideInBytes:12}],wNi=[{name:V_,strideInBytes:40}],xNi=[{name:V_,strideInBytes:36}],SNi=[{name:V_,strideInBytes:36}];function zD(t){const e={};for(const i of t)e[i.name]=i.strideInBytes;return e}const CNi=zD([{name:V_,strideInBytes:36}]),TNi=zD(yNi),ENi=zD(vNi),INi=zD(_Ni),ANi=zD(bNi),PNi=zD(wNi),ONi=zD(xNi),RNi=zD(SNi);function Xpe(t,e){switch(t){case Ln.MARKER:return e===sa.HEATMAP?TNi:CNi;case Ln.FILL:switch(e){case sa.DOT_DENSITY:return ANi;case sa.SIMPLE:case sa.OUTLINE_FILL_SIMPLE:return INi;default:return ENi}case Ln.LINE:return PNi;case Ln.TEXT:return ONi;case Ln.LABEL:return RNi}}const MNi=[V_],DNi=[V_],FNi=[V_],LNi=[V_],NNi=[V_];function kNi(t){switch(t){case Ln.MARKER:return MNi;case Ln.FILL:return DNi;case Ln.LINE:return FNi;case Ln.TEXT:return LNi;case Ln.LABEL:return NNi}}function kJ(t){switch(t%4){case 0:case 2:return 4;case 1:case 3:return 1}}function IFe(t,e){switch(e%4){case 0:case 2:return new Uint32Array(Math.floor(t*e/4));case 1:case 3:return new Uint8Array(t*e)}}function Kpe(t,e){switch(e%4){case 0:case 2:return new Uint32Array(t);case 1:case 3:return new Uint8Array(t)}}function t_t(t){return t!=null}function Jpe(t){return typeof t=="number"}function $Ni(t){switch(t){case"butt":return xf.BUTT;case"round":return xf.ROUND;case"square":return xf.SQUARE;default:return NJ.error(new st("mapview-invalid-type",`Cap type ${t} is not a valid option. Defaulting to round`)),xf.ROUND}}function BNi(t){switch(t){case"miter":return sm.MITER;case"bevel":return sm.BEVEL;case"round":return sm.ROUND;default:return NJ.error(new st("mapview-invalid-type",`Join type ${t} is not a valid option. Defaulting to round`)),sm.ROUND}}function VNi(t){switch(t){case"opacity":return _G.OPACITY;case"color":return _G.COLOR;case"rotation":return _G.ROTATION;case"size":return _G.SIZE;default:return NJ.error(`Cannot interpret unknown vv: ${t}`),null}}function AFe(t,e,i,r,n,s,o){for(const a in s){const l=s[a].stride,c=kJ(l),h=s[a].data,p=i[a].data;if(h==null||p==null)continue;const y=l*n.vertexCount/c,v=l*t/c,x=l*n.vertexFrom/c;for(let I=0;I{const o=new na(s.name,s.count,s.type,n,0,s.normalized||!1);return n+=s.count*UNi(s.type),o}),e[i]?.forEach(s=>s.stride=n)}return e}const WNi=t=>{const e=new Map;for(const i in t)for(const r of t[i])e.set(r.name,r.location);return e},qNi=t=>{const e={};for(const i in t){const r=t[i];e[i]=r?.length?r[0].stride:0}return e},PFe=new Map,iO=(t,e)=>{if(!PFe.has(t)){const i=HNi(e),r={strides:qNi(i),bufferLayouts:i,attributes:WNi(e)};PFe.set(t,r)}return PFe.get(t)};function OFe(t){t(Ln.FILL),t(Ln.LINE),t(Ln.MARKER),t(Ln.TEXT),t(Ln.LABEL)}const i_t=t=>"path"in t&&tki(t.path),YNi=t=>"url"in t&&t.url||"imageData"in t&&t.imageData,r_t=t=>"imageData"in t&&t.imageData&&"contentType"in t&&t.contentType?`data:${t.contentType};base64,${t.imageData}`:"url"in t?t.url:null,n_t=t=>t!=null&&t.startsWith("data:image/gif"),XNi=t=>"url"in t&&t.url&&(t.url.includes(".gif")||n_t(t.url))||"contentType"in t&&t.contentType==="image/gif"||"imageData"in t&&n_t(t.imageData),s_t=t=>t!=null&&t.startsWith("data:image/png"),KNi=t=>"url"in t&&t.url&&(t.url.includes(".png")||s_t(t.url))||"contentType"in t&&t.contentType==="image/png"||"imageData"in t&&s_t(t.imageData),JNi=t=>t.type&&t.type.toLowerCase().includes("3d");function ZNi(t){switch(t.type){case"line":{const e=t;return e.cim.type==="CIMSolidStroke"&&!e.dashTemplate}case"fill":return t.cim.type==="CIMSolidFill";case"esriSFS":return t.style==="esriSFSSolid"||t.style==="esriSFSNull";case"esriSLS":return t.style==="esriSLSSolid"||t.style==="esriSLSNull";default:return!1}}const QNi=t=>t.includes("data:image/svg+xml");function Zpe(t){switch("cim"in t?t.cim.type:t.type){case"esriSMS":case"esriPMS":case"CIMPointSymbol":return!1;case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":return a_t(t);default:return!0}}function o_t(t){const e="maxVVSize"in t&&t.maxVVSize,i="width"in t&&t.width||"size"in t&&t.size||0;return e||i}function eki(t){const e=[];for(let i=0;i!!t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4)),a_t=t=>t.type==="fill"&&t?.cim?.markerPlacement?.type==="CIMMarkerPlacementInsidePolygon",l_t=(t,e)=>t&&((...i)=>e.warn("DEBUG:",...i))||(()=>null),u_t=!1,iki=new Float32Array(1);new Uint32Array(iki.buffer);function BJ(t){return[255&t,(65280&t)>>>8,(16711680&t)>>>16,(4278190080&t)>>>24]}function Xn(t,e){return 65535&t|e<<16}function qp(t,e,i,r){return 255&t|(255&e)<<8|(255&i)<<16|r<<24}function rki(t,e=0,i=!1){const r=t[e+3];return t[e+0]*=r,t[e+1]*=r,t[e+2]*=r,i||(t[e+3]*=255),t}function Yp(t){if(!t)return 0;const{r:e,g:i,b:r,a:n}=t;return qp(e*n,i*n,r*n,255*n)}function gb(t){if(!t)return 0;const[e,i,r,n]=t;return qp(e*(n/255),i*(n/255),r*(n/255),n)}function xG(t,e,i=0){if(lt(e))return t[i+0]=0,t[i+1]=0,t[i+2]=0,void(t[i+3]=0);const{r,g:n,b:s,a:o}=e;t[i+0]=r*o/255,t[i+1]=n*o/255,t[i+2]=s*o/255,t[i+3]=o}function c_t(t){return Jpe(t.minDataValue)&&Jpe(t.maxDataValue)&&t.minSize!=null&&t.maxSize!=null?sd.SIZE_MINMAX_VALUE:(t.expression&&t.expression==="view.scale"||t.valueExpression&&t.valueExpression==="$view.scale")&&Array.isArray(t.stops)?sd.SIZE_SCALE_STOPS:(t.field!=null||t.expression&&t.expression!=="view.scale"||t.valueExpression&&t.valueExpression!=="$view.scale")&&(Array.isArray(t.stops)||"levels"in t&&t.levels)?sd.SIZE_FIELD_STOPS:(t.field!=null||t.expression&&t.expression!=="view.scale"||t.valueExpression&&t.valueExpression!=="$view.scale")&&t.valueUnit!=null?sd.SIZE_UNIT_VALUE:(Oi.getLogger("esri.views.2d.engine.webgl").error(new st("mapview-bad-type","Found invalid size VisualVariable",t)),sd.NONE)}function nki(t,e){if(!t||!e)return t;switch(e){case"radius":case"distance":return 2*t;case"diameter":case"width":return t;case"area":return Math.sqrt(t)}return t}function ski(t){return{value:t.value,size:Ga(t.size)}}function RFe(t){return(t??[]).map(e=>ski(e))}function h_t(t){if(typeof t=="string"||typeof t=="number")return Ga(t);const e=t;return{type:"size",expression:e.expression,stops:RFe(e.stops)}}const d_t=t=>{const e=[],i=[],r=RFe(t),n=r.length;for(let s=0;s<6;s++){const o=r[Math.min(s,n-1)];e.push(o.value),i.push(o.size==null?cFe:vn(o.size))}return{values:new Float32Array(e),sizes:new Float32Array(i)}};function oki(t){const e=t&&t.length>0?{}:null,i=e?{}:null;if(!e||!i)return{vvFields:e,vvRanges:i};for(const r of t)if(r.field&&(e[r.type]=r.field),r.type==="size"){i.size||(i.size={});const n=r;switch(c_t(n)){case sd.SIZE_MINMAX_VALUE:i.size.minMaxValue={minDataValue:n.minDataValue,maxDataValue:n.maxDataValue,minSize:h_t(n.minSize),maxSize:h_t(n.maxSize)};break;case sd.SIZE_SCALE_STOPS:i.size.scaleStops={stops:RFe(n.stops)};break;case sd.SIZE_FIELD_STOPS:if(n.levels){const s={};for(const o in n.levels)s[o]=d_t(n.levels[o]);i.size.fieldStops={type:"level-dependent",levels:s}}else i.size.fieldStops={type:"static",...d_t(n.stops)};break;case sd.SIZE_UNIT_VALUE:i.size.unitValue={unit:n.valueUnit,valueRepresentation:n.valueRepresentation??void 0}}}else if(r.type==="color")i.color=lki(r);else if(r.type==="opacity")i.opacity=aki(r);else if(r.type==="rotation"){const n=r;i.rotation={type:n.rotationType}}return{vvFields:e,vvRanges:i}}function aki(t){const e={values:[0,0,0,0,0,0,0,0],opacities:[0,0,0,0,0,0,0,0]};if(typeof t.field=="string"){if(!t.stops)return null;{if(t.stops.length>8)return null;const i=t.stops;for(let r=0;r<8;++r){const n=i[Math.min(r,i.length-1)];e.values[r]=n.value,e.opacities[r]=n.opacity}}}else{if(!(t.stops&&t.stops.length>=0))return null;{const i=t.stops&&t.stops.length>=0?t.stops[0].opacity:0;for(let r=0;r<8;r++)e.values[r]=1/0,e.opacities[r]=i}}return e}function p_t(t,e,i){t[4*e+0]=i.r/255,t[4*e+1]=i.g/255,t[4*e+2]=i.b/255,t[4*e+3]=i.a}function lki(t){if(lt(t)||t.normalizationField)return null;const e={field:null,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};if(typeof t.field=="string"){if(!t.stops)return null;{if(t.stops.length>8)return null;e.field=t.field;const i=t.stops;for(let r=0;r<8;++r){const n=i[Math.min(r,i.length-1)];e.values[r]=n.value,p_t(e.colors,r,n.color)}}}else{if(!(t.stops&&t.stops.length>=0))return null;{const i=t.stops&&t.stops.length>=0&&t.stops[0].color;for(let r=0;r<8;r++)e.values[r]=1/0,p_t(e.colors,r,i)}}for(let i=0;i<32;i+=4)rki(e.colors,i,!0);return e}const SG=Oi.getLogger("esri.views.layers.2d.features.support.AttributeStore"),Qpe=l_t(u_t,SG),VJ={sharedArrayBuffer:Hi("esri-shared-array-buffer"),atomics:Hi("esri-atomics")};function MFe(t,e){return i=>e(t(i))}let uki=class{constructor(e,i,r,n){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:o,textureOnly:a}=n;this.textureOnly=a||!1,this.pixelType=s,this._ctype=i,this.layout=o,this._resetRange(),this._shared=e,this.size=r,a||(this.data=this._initData(s,r,e,i))}get buffer(){return Pa(this.data,e=>e.buffer)}unsetComponentAllTexels(e,i){const r=this.data;for(let n=0;ni)return null;this._resetRange();const n=!(this._shared||this._ctype==="local"),s=this.pixelType,o=this.layout,a=this.data;return{start:e,end:i,data:n&&a.slice(e*r,(i+1)*r)||null,pixelType:s,layout:o}}_initData(e,i,r,n){const s=r&&n!=="local"?SharedArrayBuffer:ArrayBuffer,o=$J(e),a=new o(new s(i*i*4*o.BYTES_PER_ELEMENT));for(let l=0;l{}){this._client=e,this.config=i,this._notifyChange=r,this._blocks=new Array,this._filters=new Array(uvt),this._attributeComputeInfo=null,this._targetType=0,this._abortController=new AbortController,this._hasScaleExpr=!1,this._size=32,this._nextUpdate=null,this._currUpdate=null,this._idsToHighlight=new Set;const n=i.supportsTextureFloat?ds.FLOAT:ds.UNSIGNED_BYTE;Qpe(`Creating AttributeStore ${VJ.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:ds.UNSIGNED_BYTE,layout:1},{pixelType:ds.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:ds.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:n,layout:15},{pixelType:n,layout:15},{pixelType:n,layout:15},{pixelType:n,layout:15}],this._blocks=this._blockDescriptors.map(()=>null)}destroy(){this._abortController.abort()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}isUpdating(){return!!this._currUpdate||!!this._nextUpdate}update(e,i){this.config=i;const r=i.schema.processors[0].storage,n=h2(this._schema,r);if((e.targets.feature||e.targets.aggregate)&&(e.storage.data=!0),n&&(Hi("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",n),e.storage.data=!0,this._schema=r,this._attributeComputeInfo=null,!lt(r))){switch(r.target){case"feature":this._targetType=mNi;break;case"aggregate":this._targetType=yFe}if(r.type==="subtype"){this._attributeComputeInfo={isSubtype:!0,subtypeField:r.subtypeField,map:new Map};for(const s in r.mapping){const o=r.mapping[s];if(ve(o)&&ve(o.vvMapping))for(const a of o.vvMapping)this._bindAttribute(a,parseInt(s,10))}}else{if(this._attributeComputeInfo={isSubtype:!1,map:new Map},ve(r.vvMapping))for(const s of r.vvMapping)this._bindAttribute(s);if(ve(r.attributeMapping))for(const s of r.attributeMapping)this._bindAttribute(s)}}}onTileData(e,i){if(lt(i.addOrUpdate))return;const r=i.addOrUpdate.getCursor();for(;r.next();){const n=r.getDisplayId();this.setAttributeData(n,r)}}async setHighlight(e,i){const n=this._getBlock(0),s=i.map(o=>eO(o));n.lock(),n.unsetComponentAllTexels(0,1),n.setComponent(0,1,s),n.unlock(),this._idsToHighlight.clear();for(const o of e)this._idsToHighlight.add(o);await this.sendUpdates()}async updateFilters(e,i,r){const{service:n,spatialReference:s}=r,{filters:o}=i,a=o.map((l,c)=>this._updateFilter(l,c,n,s));(await Promise.all(a)).some(l=>l)&&(e.storage.filters=!0,Hi("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(e,i,r,n){const s=eO(e);this._ensureSizeForTexel(s),this._getBlock(i).setData(e,r,n)}getData(e,i,r){return this._getBlock(i).getData(e,r)}getHighlightFlag(e){return this._idsToHighlight.has(e)?iNi:0}unsetAttributeData(e){const i=eO(e);this._getBlock(0).setData(i,0,0)}setAttributeData(e,i){const r=eO(e);if(this._ensureSizeForTexel(r),this._getBlock(0).setData(r,0,this.getFilterFlags(i)),this._targetType!==vFe(e))return;const n=this._attributeComputeInfo,s=this.config.supportsTextureFloat?1:2,o=4;let a=null;n&&(a=n.isSubtype?n.map.get(i.readAttribute(n.subtypeField)):n.map,a&&a.size&&a.forEach((l,c)=>{const h=c*s%o,p=Math.floor(c*s/o),y=this._getBlock(p+mFe),v=l(i);if(this.config.supportsTextureFloat)y.setData(r,h,v);else if(v===cFe)y.setData(r,h,255),y.setData(r,h+1,255);else{const x=eu(Math.round(v),-32767,32766)+32768,I=255&x,P=(65280&x)>>8;y.setData(r,h,I),y.setData(r,h+1,P)}}))}sendUpdates(){if(Hi("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate"),this._notifyChange(),this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=kf(),this._nextUpdate.promise;const e={blocks:this._blocks.map(i=>ve(i)?i.toMessage():null)};return this._currUpdate=this._createResources().then(()=>{const i=()=>{if(this._currUpdate=null,this._nextUpdate){const n=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then(()=>n.resolve())}else Hi("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::No additional updates queued");this._notifyChange()};Hi("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::client.update");const r=this._client.update(e,this._signal).then(i).catch(i);return this._client.render(this._signal),r}).catch(i=>{if(ys(i))return this._createResourcesPromise=null,this._createResources();this._notifyChange(),SG.error(new st("mapview-attribute-store","Encountered an error during client update",i))}),this._currUpdate}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}_bindAttribute(e,i){function r(){const{normalizationField:c}=e;return c?h=>{const p=h.readAttribute(c);return p?h.readAttribute(e.field)/p:null}:h=>h.readAttribute(e.field)}function n(){return e.normalizationField&&SG.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),c=>c.getComputedNumericAtIndex(e.fieldIndex)}let s;if(e.fieldIndex!=null)s=n();else{if(!e.field)return;s=r()}const{valueRepresentation:o}=e;o&&(s=MFe(s,c=>nki(c,o)));const a=c=>c===null||isNaN(c)||c===1/0||c===-1/0?cFe:c,l=this._attributeComputeInfo;if(l.isSubtype){const c=l.map.get(i)??new Map;c.set(e.binding,MFe(s,a)),l.map.set(i,c)}else l.map.set(e.binding,MFe(s,a))}_createResources(){if(ve(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(fFe),this._getBlock(Hpe),Qpe("Initializing AttributeStore");const e={shared:VJ.sharedArrayBuffer&&this._client.type!=="local",size:this._size,blocks:y_e(this._blocks,r=>({textureOnly:r.textureOnly,buffer:r.buffer,pixelType:r.pixelType}))},i=this._client.initialize(e,this._signal).catch(r=>{ys(r)?this._createResourcesPromise=null:SG.error(new st("mapview-attribute-store","Encountered an error during client initialization",r))});return this._createResourcesPromise=i,i.then(()=>lt(this._createResourcesPromise)?this._createResources():void 0),i}_getBlock(e){const i=this._blocks[e];if(ve(i))return i;Qpe(`Initializing AttributeBlock at index ${e}`);const r=VJ.sharedArrayBuffer,n=this._client.type,s=new uki(r,n,this._size,this._blockDescriptors[e]);return this._blocks[e]=s,this._createResourcesPromise=null,s}_expand(){if(this._sizei.expand(e)),this._createResourcesPromise=null,this._size=e,0}return SG.error(new st("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(e,i,r,n){const s=this._filters[i],o=ve(s)&&s.hash;if(!s&&!e||o===JSON.stringify(e))return!1;if(lt(e)){if(!s)return!1;const l=1<MTr),s=new n({geometryType:i.geometryType,hasM:!1,hasZ:!1,timeInfo:i.timeInfo,fieldsIndex:new Lm(i.fields)});return this._filters[e]=s,s}isVisible(e){return!!(2&this._getBlock(0).getData(e,0))}getFilterFlags(e){let i=0;const r=gNi(e.getDisplayId());for(let s=0;s>h,P=(x&t.geohashY)>>p;for(let F=y-1;F>=0;F--){const k=(n+s)/2,j=I&1<=0;F--){const k=(i+r)/2,j=P&1<y?1:0;n|=v<<29-(p+5*h),l=(1-v)*l+v*y,c=(1-v)*y+v*c}for(let p=0;p<5;p++){const y=(o+a)/2,v=e>y?1:0;s|=v<<29-(p+5*h),o=(1-v)*o+v*y,a=(1-v)*y+v*a}}t.geohashX=n,t.geohashY=s}function tfe(t,e,i,r,n){n%2&&(n+=1);let s=0,o=0,a=-90,l=90,c=-180,h=180;for(let p=0;pv?1:0;s|=x<<29-(y+5*p),c=(1-x)*c+x*v,h=(1-x)*v+x*h}for(let y=0;y<5;y++){const v=(a+l)/2,x=i>v?1:0;o|=x<<29-(y+5*p),a=(1-x)*a+x*v,l=(1-x)*v+x*l}}t[2*e]=s,t[2*e+1]=o}let m_t=class{constructor(e=[],i,r=8096){this.onRelease=n=>{},this._nodes=0,this._root=new DFe(this,0,0,0),this._statisticFields=e,this._pool=r?new GD(8096):null,this._serviceInfo=i}destroy(){this.clear()}_acquire(e,i,r){this._nodes++;let n=null;return ve(this._pool)&&(n=this._pool.dequeue()),ve(n)?n.realloc(e,i,r):n=new DFe(this,e,i,r),n}_release(e){this.onRelease(e),this._nodes--,ve(this._pool)&&this._pool.enqueue(e)}get count(){return this._root.count}get size(){return this._nodes}get poolSize(){return Hv(this._pool,0,e=>e.size)}get depth(){let e=0;return this.forEach(i=>e=Math.max(e,i.depth)),e}dropLevels(e){this.forEach(i=>{if(i.depth>=e)for(let r=0;r{if(i.depth>=e)for(let r=0;rthis._release(e)),this._root=new DFe(this,0,0,0)}insert(e,i,r=0){const n=Ev.fromOptimizedFeatures([e],this._serviceInfo).getCursor();n.next();const s=n.readGeometry();if(!s)return;const[o,a]=s.coords,l=e.geohashX,c=e.geohashY;this.insertCursor(n,e.displayId,o,a,l,c,i,r)}insertCursor(e,i,r,n,s,o,a,l=0){let c=this._root,h=0,p=0,y=0;for(;c!==null;){if(c.depth>=l&&(c.count+=1,c.xTotal+=r,c.yTotal+=n,c.xGeohashTotal+=s,c.yGeohashTotal+=o,c.referenceId=i,this._updateStatisticsCursor(e,c,1)),h>=a)return void c.add(i);const v=Math.ceil((h+1)/2),x=Math.floor((h+1)/2),I=1-h%2,P=30-(3*v+2*x),F=30-(2*v+3*x),k=(s&7*I+3*(1-I)<>P,j=(o&3*I+7*(1-I)<>F,V=k+j*(8*I+4*(1-I));p=p<<3*I+2*(1-I)|k,y=y<<2*I+3*(1-I)|j,c.children[V]==null&&(c.children[V]=this._acquire(p,y,h+1)),h+=1,c=c.children[V]}}remove(e,i){const r=Ev.fromOptimizedFeatures([e],this._serviceInfo).getCursor();r.next();const n=r.readGeometry();if(!n)return;const[s,o]=n.coords,a=e.geohashX,l=e.geohashY;this.removeCursor(r,s,o,a,l,i)}removeCursor(e,i,r,n,s,o){let a=this._root,l=0;for(;a!==null;){if(a.count-=1,a.xTotal-=i,a.yTotal-=r,a.xGeohashTotal-=n,a.yGeohashTotal-=s,this._updateStatisticsCursor(e,a,-1),l>=o)return void a.remove(e.getDisplayId());const c=Math.ceil((l+1)/2),h=Math.floor((l+1)/2),p=1-l%2,y=30-(3*c+2*h),v=30-(2*c+3*h),x=((n&7*p+3*(1-p)<>y)+((s&3*p+7*(1-p)<>v)*(8*p+4*(1-p)),I=a.children[x];I?.count===1&&(this._release(I),a.children[x]=null),l+=1,a=I}}forEach(e){let i=this._root;for(;i!==null;){const r=this._linkChildren(i)||i.next;e(i),i=r}}find(e,i,r){return this._root.find(e,i,r,0,0,0)}findIf(e){let i=null;return this.forEach(r=>{e(r)&&(i=r)}),i}findAllIf(e){const i=[];return this.forEach(r=>{e(r)&&i.push(r)}),i}findSingleOccupancyNode(e,i,r,n,s){let o=this._root;for(;o!==null;){const a=o.depth,l=o.xNode,c=o.yNode,h=1-a%2,p=o.xGeohashTotal/o.count,y=o.yGeohashTotal/o.count;if(o.count===1&&e=s){o=o.next;continue}const v=Math.ceil((a+1)/2),x=Math.floor((a+1)/2),I=30-(3*v+2*x),P=30-(2*v+3*x),F=~((1<>I,V=(i&k)>>P,Y=(r&F)>>I,X=(n&k)>>P,Z=l<<3*h+2*(1-h),ie=c<<2*h+3*(1-h),ce=Z+8*h+4*(1-h),he=ie+4*h+8*(1-h),_e=Math.max(Z,j),xe=Math.max(ie,V),Pe=Math.min(ce,Y),ke=Math.min(he,X);let J=null,de=null;for(let Se=xe;Se<=ke;Se++)for(let Ie=_e;Ie<=Pe;Ie++){const Re=Ie-Z+(Se-ie)*(8*h+4*(1-h)),Oe=o.children[Re];Oe&&(J||(J=Oe,J.next=o.next),de&&(de.next=Oe),de=Oe,Oe.next=o.next)}o=J||o.next}return null}getRegionDisplayIds(e){let i=this._root;const{bounds:r,geohashBounds:n,level:s}=e,[o,a,l,c]=r,h=[];for(;i!==null;){const p=i.depth,y=i.xNode,v=i.yNode;if(p>=s){const Re=i.xTotal/i.count,Oe=i.yTotal/i.count;Re>=o&&Re<=l&&Oe>=a&&Oe<=c&&i.displayIds.forEach(Ge=>h.push(Ge)),i=i.next;continue}const x=Math.ceil((p+1)/2),I=Math.floor((p+1)/2),P=1-p%2,F=30-(3*x+2*I),k=30-(2*x+3*I),j=~((1<>F,X=(n.yLL&V)>>k,Z=(n.xTR&j)>>F,ie=(n.yTR&V)>>k,ce=y<<3*P+2*(1-P),he=v<<2*P+3*(1-P),_e=ce+8*P+4*(1-P),xe=he+4*P+8*(1-P),Pe=Math.max(ce,Y),ke=Math.max(he,X),J=Math.min(_e,Z),de=Math.min(xe,ie);let Se=null,Ie=null;for(let Re=ke;Re<=de;Re++)for(let Oe=Pe;Oe<=J;Oe++){const Ge=Oe-ce+(Re-he)*(8*P+4*(1-P)),Be=i.children[Ge];Be&&(Se||(Se=Be,Se.next=i.next),Ie&&(Ie.next=Be),Ie=Be,Be.next=i.next)}i=Se||i.next}return h}getRegionStatistics(e){let i=this._root,r=0,n=0,s=0;const o={},{bounds:a,geohashBounds:l,level:c}=e,[h,p,y,v]=a;let x=0;for(;i!==null;){const I=i.depth,P=i.xNode,F=i.yNode;if(I>=c){const qe=i.xTotal/i.count,et=i.yTotal/i.count;qe>h&&qe<=y&&et>p&&et<=v&&(r+=i.count,n+=i.xTotal,s+=i.yTotal,i.count===1&&(x=i.referenceId),this._aggregateStatistics(o,i.statistics)),i=i.next;continue}const k=Math.ceil((I+1)/2),j=Math.floor((I+1)/2),V=1-I%2,Y=30-(3*k+2*j),X=30-(2*k+3*j),Z=~((1<>Y,he=(l.yLL&ie)>>X,_e=(l.xTR&Z)>>Y,xe=(l.yTR&ie)>>X,Pe=P<<3*V+2*(1-V),ke=F<<2*V+3*(1-V),J=Pe+8*V+4*(1-V),de=ke+4*V+8*(1-V),Se=Math.max(Pe,ce),Ie=Math.max(ke,he),Re=Math.min(J,_e),Oe=Math.min(de,xe);let Ge=null,Be=null;for(let qe=Ie;qe<=Oe;qe++)for(let et=Se;et<=Re;et++){const Ze=et-Pe+(qe-ke)*(8*V+4*(1-V)),mt=i.children[Ze];if(mt){if(qe!==Ie&&qe!==Oe&&et!==Se&&et!==Re){const Pt=mt.xTotal/mt.count,$t=mt.yTotal/mt.count;Pt>h&&Pt<=y&&$t>p&&$t<=v&&(r+=mt.count,n+=mt.xTotal,s+=mt.yTotal,mt.count===1&&(x=mt.referenceId),this._aggregateStatistics(o,mt.statistics));continue}Ge||(Ge=mt,Ge.next=i.next),Be&&(Be.next=mt),Be=mt,mt.next=i.next}}i=Ge||i.next}return{count:r,attributes:this.normalizeStatistics(o,r),xTotal:n,yTotal:s,referenceId:x}}getBins(e){const i=[],{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){i.push(s),s=s.next;continue}const c=Math.ceil((o+1)/2),h=Math.floor((o+1)/2),p=1-o%2,y=30-(3*c+2*h),v=30-(2*c+3*h),x=~((1<>y,F=(r.yLL&I)>>v,k=(r.xTR&x)>>y,j=(r.yTR&I)>>v,V=a<<3*p+2*(1-p),Y=l<<2*p+3*(1-p),X=V+8*p+4*(1-p),Z=Y+4*p+8*(1-p),ie=Math.max(V,P),ce=Math.max(Y,F),he=Math.min(X,k),_e=Math.min(Z,j);let xe=null,Pe=null;for(let ke=ce;ke<=_e;ke++)for(let J=ie;J<=he;J++){const de=J-V+(ke-Y)*(8*p+4*(1-p)),Se=s.children[de];Se&&(xe||(xe=Se,xe.next=s.next),Pe&&(Pe.next=Se),Pe=Se,Se.next=s.next)}s=xe||s.next}return i}_linkChildren(e){let i=null,r=null;for(let n=0;n<=e.children.length;n++){const s=e.children[n];s&&(i||(i=s,i.next=e.next),r&&(r.next=s),r=s,s.next=e.next)}return i}_updateStatisticsCursor(e,i,r){for(const n of this._statisticFields){const s=n.name,o=n.inField?e.readAttribute(n.inField):e.getComputedNumericAtIndex(n.inFieldIndex);switch(n.statisticType){case"min":{if(isNaN(o))break;if(!i.statistics[s]){i.statistics[s]={value:o};break}const a=i.statistics[s].value;i.statistics[s].value=Math.min(a,o);break}case"max":{if(isNaN(o))break;if(!i.statistics[s]){i.statistics[s]={value:o};break}const a=i.statistics[s].value;i.statistics[s].value=Math.max(a,o);break}case"count":break;case"sum":case"avg":{i.statistics[s]||(i.statistics[s]={value:0,nanCount:0});const a=i.statistics[s].value,l=i.statistics[s].nanCount??0;o==null||isNaN(o)?i.statistics[s].nanCount=l+r:i.statistics[s].value=a+r*o;break}case"avg_angle":{i.statistics[s]||(i.statistics[s]={x:0,y:0,nanCount:0});const a=i.statistics[s].x,l=i.statistics[s].y,c=i.statistics[s].nanCount??0,h=Math.PI/180;o==null||isNaN(o)?i.statistics[s].nanCount=c+r:(i.statistics[s].x=a+r*Math.cos(o*h),i.statistics[s].y=l+r*Math.sin(o*h));break}case"mode":{i.statistics[s]||(i.statistics[s]={});const a=i.statistics[s][o]||0;i.statistics[s][o]=a+r;break}}}}_aggregateStatistics(e,i){for(const r of this._statisticFields){const n=r.name;switch(r.statisticType){case"min":{if(!e[n]){e[n]={value:i[n].value};break}const s=e[n].value;e[n].value=Math.min(s,i[n].value);break}case"max":{if(!e[n]){e[n]={value:i[n].value};break}const s=e[n].value;e[n].value=Math.max(s,i[n].value);break}case"count":break;case"sum":case"avg":case"avg_angle":case"mode":e[n]||(e[n]={});for(const s in i[n]){const o=e[n][s]||0;e[n][s]=o+i[n][s]}}}}normalizeStatistics(e,i){const r={};for(const n of this._statisticFields){const s=n.name;switch(n.statisticType){case"min":case"max":{const o=e[s];if(!i||!o)break;r[s]=o.value;break}case"count":if(!i)break;r[s]=i;break;case"sum":{if(!i)break;const{value:o,nanCount:a}=e[s];if(!(i-a))break;r[s]=o;break}case"avg":{if(!i)break;const{value:o,nanCount:a}=e[s];if(!(i-a))break;r[s]=o/(i-a);break}case"avg_angle":{if(!i)break;const{x:o,y:a,nanCount:l}=e[s];if(!(i-l))break;const c=o/(i-l),h=a/(i-l),p=180/Math.PI,y=Math.atan2(h,c)*p;r[s]=y;break}case"mode":{const o=e[s];let a=0,l=0,c=null;for(const h in o){const p=o[h];p===a?l+=1:p>a&&(a=p,l=1,c=h)}r[s]=c==="null"||l>1?null:c;break}}}return r}},DFe=class{constructor(e,i,r,n){this.count=0,this.xTotal=0,this.yTotal=0,this.statistics={},this.displayId=0,this.referenceId=0,this.displayIds=new Set,this.next=null,this.depth=0,this.xNode=0,this.yNode=0,this.xGeohashTotal=0,this.yGeohashTotal=0,this._tree=e,this.children=new Array(32);for(let s=0;s=r)return this;const a=1-n%2,l=3*a+2*(1-a),c=2*a+3*(1-a),h=30-s-l,p=30-o-c,y=((e&7*a+3*(1-a)<>h)+((i&3*a+7*(1-a)<>p)*(8*a+4*(1-a)),v=this.children[y];return v==null?null:v.find(e,i,r,n+1,s+l,o+c)}};const FFe=Oi.getLogger("esri.view.2d.layers.features.support.BinStore"),g_t=12,hki=64,dki=iw(),pki=5;function y_t(t){return 57.29577951308232*t}let fki=class extends ZDe{constructor(e,i,r,n){super(e,r),this.type="bin",this.events=new md,this.objectIdField="aggregateId",this.featureAdapter=Lpe,this._geohashLevel=pki,this._geohashBuf=[],this._serviceInfo=n,this.geometryInfo=e.geometryInfo,this._spatialReference=i,this._projectionSupportCheck=hy(i,hr.WGS84),this._bitsets.geohash=r.getBitset(r.createBitset()),this._bitsets.inserted=r.getBitset(r.createBitset())}destroy(){this._tree&&this._tree.destroy()}get featureSpatialReference(){return this._spatialReference}get fields(){return this._fields}async updateSchema(e,i){const r=this._schema;try{await super.updateSchema(e,i),await this._projectionSupportCheck}catch{}this._fields=this._schema.params.fields;const n=h2(r,i);i&&(!lt(n)||e.source||e.storage.filters)?((yA(n,"params.fields")||yA(n,"params")||!this._tree||e.source)&&(this._tree&&this._tree.destroy(),this._tree=new m_t(this._statisticFields,this._serviceInfo),this._tree.onRelease=s=>s.displayId&&this._storage.releaseDisplayId(s.displayId),this._geohashLevel=this._schema.params.fixedBinLevel,this._rebuildTree(),Hi("esri-2d-update-debug")&&FFe.info("Aggregate mesh needs update due to tree changing")),Hi("esri-2d-update-debug")&&FFe.info("Aggregate mesh needs update due to tree changing"),e.targets[i.name]=!0,e.mesh=!1):r&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,i){this._bitsets.inserted.forEachSet(r=>{if(!e.has(r)){const n=i.lookupByDisplayIdUnsafe(r);this._remove(n)}})}sweepAggregates(e,i,r){}onTileData(e,i,r,n,s=!0){if(!this._schema||lt(i.addOrUpdate))return i;this.events.emit("changed");const o=this._getTransforms(e,this._spatialReference);{const l=i.addOrUpdate.getCursor();for(;l.next();)this._update(l,n)}if(i.status.mesh||!s)return i;const a=new Array;this._getBinsForTile(a,e,o,r),i.addOrUpdate=Ev.fromOptimizedFeatures(a,{...this._serviceInfo,geometryType:"esriGeometryPolygon"}),i.addOrUpdate.attachStorage(r),i.end=!0,i.isRepush||(i.clear=!0);{const l=i.addOrUpdate.getCursor();for(;l.next();){const c=l.getDisplayId();this._bitsets.computed.unset(c),this.setComputedAttributes(r,l,c,e.scale)}}return i}forEachBin(e){this._tree.forEach(e)}forEach(e){this._tree.forEach(i=>{if(i.depth!==this._geohashLevel)return;const r=this._toFeatureJSON(i),n=Ev.fromFeatures([r],{objectIdField:this.objectIdField,globalIdField:null,geometryType:this.geometryInfo.geometryType,fields:this.fields}).getCursor();n.next(),e(n)})}forEachInBounds(e,i){}forEachBounds(e,i){const{hasM:r,hasZ:n}=this.geometryInfo;for(const s of e){const o=Fae(dki,s.readGeometry(),n,r);lt(o)||i(o)}}onTileUpdate(e){}getAggregate(e){const i=_Fe(e,!0),r=this._tree.findIf(n=>n.displayId===i);return Pa(r,n=>this._toFeatureJSON(n))}getAggregates(){return this._tree.findAllIf(e=>e.depth===this._geohashLevel).map(this._toFeatureJSON.bind(this))}getDisplayId(e){const i=this._tree.findIf(r=>r.id===e);return Pa(i,r=>r.displayId)}getFeatureDisplayIdsForAggregate(e){const i=this._tree.findIf(r=>r.id===e);return Hv(i,[],r=>Array.from(r.displayIds))}getDisplayIdForReferenceId(e){const i=this._tree.findIf(r=>r.displayIds.size===1&&r.displayIds.has(e));return Pa(i,r=>r.displayId)}_toFeatureJSON(e){const i=this._spatialReference;return{displayId:e.displayId,attributes:e.getAttributes(),geometry:pw(e.getGeometry(i),"esriGeometryPolygon",!1,!1),centroid:null}}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const i=e.getDisplayId(),r=e.getXHydrated(),n=e.getYHydrated(),s=this._geohashBuf[2*i],o=this._geohashBuf[2*i+1];this._bitsets.inserted.has(i)&&(this._bitsets.inserted.unset(i),this._tree.removeCursor(e,r,n,s,o,this._geohashLevel))}_update(e,i){const r=e.getDisplayId(),n=this._bitsets.inserted,s=i.isVisible(r);if(s===n.has(r))return;if(!s)return void this._remove(e);const o=e.getXHydrated(),a=e.getYHydrated();if(!this._setGeohash(r,o,a))return;const l=this._geohashBuf[2*r],c=this._geohashBuf[2*r+1];this._tree.insertCursor(e,r,o,a,l,c,this._geohashLevel),n.set(r)}_setGeohash(e,i,r){if(this._bitsets.geohash.has(e))return!0;const n=this._geohashBuf;if(this._spatialReference.isWebMercator){const s=y_t(i/Mu.radius),o=s-360*Math.floor((s+180)/360),a=y_t(Math.PI/2-2*Math.atan(Math.exp(-r/Mu.radius)));tfe(n,e,a,o,g_t)}else{const s=wp({x:i,y:r},this._spatialReference,hr.WGS84);if(!s)return!1;tfe(n,e,s.y,s.x,g_t)}return this._bitsets.geohash.set(e),!0}_getBinsForTile(e,i,r,n){try{const s=this._getGeohashBounds(i),o=this._tree.getBins(s);for(const a of o){a.displayId||(a.displayId=n.createDisplayId(!0));let l=null;const c=a.getGeometry(this._spatialReference,r.tile);c||(l=a.getGeometryCentroid(this._spatialReference,r.tile));const h=new c_(c,a.getAttributes(),l);h.objectId=a.id,h.displayId=a.displayId,e.push(h)}}catch{return void FFe.error("Unable to get bins for tile",i.key.id)}}_getGeohash(e,i,r){const n={geohashX:0,geohashY:0};return efe(n,i,e,r),n}_getGeohashBounds(e){const i=this._getGeohashLevel(e.key.level),r=[e.extent.xmin,e.extent.ymin,e.extent.xmax,e.extent.ymax],n=To.fromExtent(Ar.fromBounds(r,this._spatialReference)),s=wp(n,this._spatialReference,hr.WGS84,{densificationStep:e.resolution*hki}),o=cM(new Ml,s,!1,!1),a=o.coords.filter((I,P)=>!(P%2)),l=o.coords.filter((I,P)=>P%2),c=Math.min(...a),h=Math.min(...l),p=Math.max(...a),y=Math.max(...l),v=this._getGeohash(c,h,i),x=this._getGeohash(p,y,i);return{bounds:r,geohashBounds:{xLL:v.geohashX,yLL:v.geohashY,xTR:x.geohashX,yTR:x.geohashY},level:i}}_getGeohashLevel(e){return this._schema.params.fixedBinLevel}_getTransforms(e,i){const r={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},n=vd(i);if(!n)return{tile:r,left:null,right:null};const[s,o]=n.valid;return{tile:r,left:{...r,translate:[o,e.bounds[3]]},right:{...r,translate:[s-o+e.bounds[0],e.bounds[3]]}}}};const LFe=12,mki=64,v_t=1,gki=iw();let yki=class v5t extends GJt{constructor(e,i,r,n,s){super(new Ml([],[i,r]),n,null,e),this.geohashBoundsInfo=s}get count(){return this.attributes.cluster_count}static create(e,i,r,n,s,o,a,l){const c=new v5t(i,r,n,o,a);return c.displayId=e.createDisplayId(!0),c.referenceId=l,c.tileLevel=s,c}update(e,i,r,n,s,o){return this.geometry.coords[0]=e,this.geometry.coords[1]=i,this.tileLevel=r,this.attributes=n,this.geohashBoundsInfo=s,this.referenceId=null,this.referenceId=o,this}toJSON(){return{attributes:{...this.attributes,aggregateId:this.objectId,referenceId:this.attributes.cluster_count===1?this.referenceId:null},geometry:{x:this.geometry.coords[0],y:this.geometry.coords[1]}}}};function CG(t){return 57.29577951308232*t}let vki=class extends ZDe{constructor(e,i,r,n){super(e,r),this.type="cluster",this.events=new md,this.objectIdField="aggregateId",this.featureAdapter=Lpe,this._geohashLevel=0,this._tileLevel=0,this._aggregateValueRanges={},this._aggregateValueRangesChanged=!1,this._geohashBuf=[],this._clusters=new Map,this._tiles=new Map,this._serviceInfo=n,this.geometryInfo=e.geometryInfo,this._spatialReference=i,this._projectionSupportCheck=hy(i,hr.WGS84),this._bitsets.geohash=r.getBitset(r.createBitset()),this._bitsets.inserted=r.getBitset(r.createBitset())}destroy(){this._tree.destroy()}get featureSpatialReference(){return this._spatialReference}get fields(){return this._fields}async updateSchema(e,i){const r=this._schema;try{await super.updateSchema(e,i),await this._projectionSupportCheck}catch{}this._fields=this._schema.params.fields;const n=h2(r,i);i&&(!lt(n)||e.source||e.storage.filters)?((yA(n,"params.fields")||!this._tree||e.source)&&(this._tree&&this._tree.destroy(),this._tree=new m_t(this._statisticFields,this._serviceInfo),this._rebuildTree(),Hi("esri-2d-update-debug")&&console.debug("Aggregate mesh needs update due to tree changing")),Hi("esri-2d-update-debug")&&console.debug("Applying Update - ClusterStore:",n),e.targets[i.name]=!0,e.mesh=!1,this._aggregateValueRanges={}):r&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,i){this._bitsets.inserted.forEachSet(r=>{if(!e.has(r)){const n=i.lookupByDisplayIdUnsafe(r);this._remove(n)}})}sweepAggregates(e,i,r){this._clusters.forEach((n,s)=>{n&&n.tileLevel!==r&&(e.releaseDisplayId(n.displayId),i.unsetAttributeData(n.displayId),this._clusters.delete(s))})}onTileData(e,i,r,n,s=!0){if(!this._schema||lt(i.addOrUpdate))return i;this.events.emit("changed");const o=this._getTransforms(e,this._spatialReference);{const c=i.addOrUpdate.getCursor();for(;c.next();)this._update(c,n)}if(i.status.mesh||!s)return i;const a=new Array,l=this._schema.params.clusterRadius;this._getClustersForTile(a,e,l,r,o),i.addOrUpdate=Ev.fromOptimizedFeatures(a,this._serviceInfo),i.addOrUpdate.attachStorage(r),i.clear=!0,i.end=!0;{const c=i.addOrUpdate.getCursor();for(;c.next();){const h=c.getDisplayId();this._bitsets.computed.unset(h),this.setComputedAttributes(r,c,h,e.scale)}}return this._aggregateValueRangesChanged&&i.end&&(this.events.emit("valueRangesChanged",{valueRanges:this._aggregateValueRanges}),this._aggregateValueRangesChanged=!1),i}onTileUpdate({added:e,removed:i}){if(e.length){const n=e[0].level;this._tileLevel=n,this._setGeohashLevel(n)}if(!this._schema)return;const r=this._schema.params.clusterRadius;i.forEach(n=>{this._tiles.delete(n.key.id),this._markTileClustersForDeletion(n,r)})}getAggregate(e){for(const i of this._clusters.values())if((i?.displayId&nm)==(e&nm))return i.toJSON();return null}getAggregates(){const e=[];for(const i of this._clusters.values())i?.tileLevel===this._tileLevel&&e.push(i.toJSON());return e}getDisplayId(e){const i=this._clusters.get(e);return i?i.displayId:null}getFeatureDisplayIdsForAggregate(e){const i=this._clusters.get(e);return i?this._tree.getRegionDisplayIds(i.geohashBoundsInfo):[]}getDisplayIdForReferenceId(e){for(const i of this._clusters.values())if(i?.referenceId===e)return i.displayId;return null}getAggregateValueRanges(){return this._aggregateValueRanges}forEach(e){this._clusters.forEach(i=>{if(!i)return;const r=i.toJSON(),n=Ev.fromFeatures([r],{objectIdField:this.objectIdField,globalIdField:null,geometryType:this.geometryInfo.geometryType,fields:this.fields}).getCursor();n.next(),e(n)})}forEachInBounds(e,i){}forEachBounds(e,i){const{hasM:r,hasZ:n}=this.geometryInfo;for(const s of e){const o=Fae(gki,s.readGeometry(),n,r);lt(o)||i(o)}}size(){let e=0;return this.forEach(i=>e++),e}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const i=e.getDisplayId(),r=e.getXHydrated(),n=e.getYHydrated(),s=this._geohashBuf[2*i],o=this._geohashBuf[2*i+1];this._bitsets.inserted.has(i)&&(this._bitsets.inserted.unset(i),this._tree.removeCursor(e,r,n,s,o,this._geohashLevel))}_update(e,i){const r=e.getDisplayId(),n=this._bitsets.inserted,s=i.isVisible(r);if(s===n.has(r))return;if(!s)return void this._remove(e);const o=e.getXHydrated(),a=e.getYHydrated();if(!this._setGeohash(r,o,a))return;const l=this._geohashBuf[2*r],c=this._geohashBuf[2*r+1];this._tree.insertCursor(e,r,o,a,l,c,this._geohashLevel),n.set(r)}_setGeohash(e,i,r){if(this._bitsets.geohash.has(e))return!0;const n=this._geohashBuf;if(this._spatialReference.isWebMercator){const s=CG(i/Mu.radius),o=s-360*Math.floor((s+180)/360),a=CG(Math.PI/2-2*Math.atan(Math.exp(-r/Mu.radius)));tfe(n,e,a,o,LFe)}else{const s=wp({x:i,y:r},this._spatialReference,hr.WGS84);if(!s)return!1;tfe(n,e,s.y,s.x,LFe)}return this._bitsets.geohash.set(e),!0}_getClustersForTile(e,i,r,n,s,o=!0){const a=this._schema.params.clusterPixelBuffer,l=2*r,c=Math.ceil(2**i.key.level*Pc/l)+1,h=Math.ceil(a/l)+0,p=Math.ceil(Pc/l),{row:y,col:v}=i.key,x=v*Pc,I=y*Pc,P=Math.floor(x/l)-h,F=Math.floor(I/l)-h,k=P+p+2*h,j=F+p+2*h,V=i.tileInfoView.getLODInfoAt(i.key.level);for(let Y=P;Y<=k;Y++)for(let X=F;X<=j;X++){let Z=Y;V.wrap&&(Z=Y<0?Y+c:Y%c);const ie=V.wrap&&Y<0,ce=V.wrap&&Y%c!==Y,he=this._lookupCluster(n,V,i.key.level,Z,X,i);if(ve(he)){const _e=Pa(s,xe=>ie?xe.left:ce?xe.right:xe.tile);if(o&<(_e)||!he.count)continue;if(ve(_e)&&o){const xe=he.geometry.clone();let Pe=he.attributes;xe.coords[0]=vY(_e,xe.coords[0]),xe.coords[1]=_Y(_e,xe.coords[1]),he.count===1&&ve(he.referenceId)&&(Pe={...he.attributes,referenceId:he.referenceId});const ke=new c_(xe,Pe);ke.displayId=he.displayId,e.push(ke)}}}}_getGeohashLevel(e){return Math.min(Math.ceil(e/2+2),LFe)}_setGeohashLevel(e){const i=this._getGeohashLevel(e),r=(Math.floor(i/v_t)+1)*v_t-1;if(this._geohashLevel!==r)return this._geohashLevel=r,this._rebuildTree(),void this._bitsets.geohash.clear()}_getTransforms(e,i){const r={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},n=vd(i);if(!n)return{tile:r,left:null,right:null};const[s,o]=n.valid;return{tile:r,left:{...r,translate:[o,e.bounds[3]]},right:{...r,translate:[s-o+e.bounds[0],e.bounds[3]]}}}_getClusterId(e,i,r){return(15&e)<<28|(16383&i)<<14|16383&r}_markForDeletion(e,i,r){const n=this._getClusterId(e,i,r);this._clusters.delete(n)}_getClusterBounds(e,i,r){const n=this._schema.params.clusterRadius,s=2*n;let o=r%2?i*s:i*s-n;const a=r*s;let l=o+s;const c=a-s,h=2**e.level*Pc;e.wrap&&o<0&&(o=0),e.wrap&&l>h&&(l=h);const p=o/Pc,y=a/Pc,v=l/Pc,x=c/Pc;return[e.getXForColumn(p),e.getYForRow(y),e.getXForColumn(v),e.getYForRow(x)]}_getGeohash(e,i,r){const n={geohashX:0,geohashY:0};return efe(n,i,e,r),n}_getGeohashBounds(e,i){const r=this._getGeohashLevel(e.key.level);if(this._spatialReference.isWebMercator){const[I,P,F,k]=i,j={x:I,y:P},V={x:F,y:k};let Y=0,X=0,Z=0,ie=0;{const _e=CG(j.x/Mu.radius);Y=_e-360*Math.floor((_e+180)/360),X=CG(Math.PI/2-2*Math.atan(Math.exp(-j.y/Mu.radius)))}{const _e=CG(V.x/Mu.radius);Z=_e-360*Math.floor((_e+180)/360),ie=CG(Math.PI/2-2*Math.atan(Math.exp(-V.y/Mu.radius)))}const ce={geohashX:0,geohashY:0},he={geohashX:0,geohashY:0};return efe(ce,X,Y,r),efe(he,ie,Z,r),{bounds:[I,P,F,k],geohashBounds:{xLL:ce.geohashX,yLL:ce.geohashY,xTR:he.geohashX,yTR:he.geohashY},level:r}}const n=To.fromExtent(Ar.fromBounds(i,this._spatialReference)),s=wp(n,this._spatialReference,hr.WGS84,{densificationStep:e.resolution*mki});if(!s)return null;const o=cM(new Ml,s,!1,!1),a=o.coords.filter((I,P)=>!(P%2)),l=o.coords.filter((I,P)=>P%2),c=Math.min(...a),h=Math.min(...l),p=Math.max(...a),y=Math.max(...l),v=this._getGeohash(c,h,r),x=this._getGeohash(p,y,r);return{bounds:i,geohashBounds:{xLL:v.geohashX,yLL:v.geohashY,xTR:x.geohashX,yTR:x.geohashY},level:r}}_lookupCluster(e,i,r,n,s,o){const a=this._getClusterId(r,n,s),l=this._clusters.get(a),c=this._getClusterBounds(i,n,s),h=this._getGeohashBounds(o,c);if(lt(h))return null;const p=this._tree.getRegionStatistics(h),{count:y,xTotal:v,yTotal:x,referenceId:I}=p,P=y?v/y:0,F=y?x/y:0;if(y===0)return this._clusters.set(a,null),null;const k={cluster_count:y,...p.attributes},j=ve(l)?l.update(P,F,r,k,h,I):yki.create(e,a,P,F,r,k,h,I);if(y===0){const[V,Y,X,Z]=c;j.geometry.coords[0]=(V+X)/2,j.geometry.coords[1]=(Y+Z)/2}return this._clusters.set(a,j),this._updateAggregateValueRangeForCluster(j,j.tileLevel),j}_updateAggregateValueRangeForCluster(e,i){const r=this._aggregateValueRanges[i]||{minValue:1/0,maxValue:0},n=r.minValue,s=r.maxValue;r.minValue=Math.min(n,e.count),r.maxValue=Math.max(s,e.count),this._aggregateValueRanges[i]=r,n===r.minValue&&s===r.maxValue||(this._aggregateValueRangesChanged=!0)}_markTileClustersForDeletion(e,i){const r=2*i,n=Math.ceil(Pc/r),{row:s,col:o}=e.key,a=o*Pc,l=s*Pc,c=Math.floor(a/r),h=Math.floor(l/r);for(let p=c;pe))for(;t.length<=e;)t.push(i)}let __t=class{constructor(){this._numerics=[],this._strings=[],this._idGenerator=new _ki,this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[]}createBitset(){const e=this._bitsets.length;return this._bitsets.push(QDe.create(this._allocatedSize,nm)),e+1}getBitset(e){return this._bitsets[e-1]}_expand(){this._allocatedSize<<=1;for(const e of this._bitsets)e.resize(this._allocatedSize)}_ensureNumeric(e,i){this._numerics[e]||(this._numerics[e]=[]),ife(this._numerics[e],i,0)}_ensureInstanceId(e){ife(this._instanceIds,e,0)}_ensureString(e,i){this._strings[e]||(this._strings[e]=[]),ife(this._strings[e],i,null)}createDisplayId(e=!1){const i=this._idGenerator.createId();return i>this._allocatedSize&&this._expand(),_Fe(i,e)}releaseDisplayId(e){for(const i of this._bitsets)i.unset(e);return this._idGenerator.releaseId(e&nm)}getComputedNumeric(e,i){return this.getComputedNumericAtIndex(e&nm,0)}setComputedNumeric(e,i,r){return this.setComputedNumericAtIndex(e&nm,r,0)}getComputedString(e,i){return this.getComputedStringAtIndex(e&nm,0)}setComputedString(e,i,r){return this.setComputedStringAtIndex(e&nm,0,r)}getComputedNumericAtIndex(e,i){const r=e&nm;return this._ensureNumeric(i,r),this._numerics[i][r]}setComputedNumericAtIndex(e,i,r){const n=e&nm;this._ensureNumeric(i,n),this._numerics[i][n]=r}getInstanceId(e){const i=e&nm;return this._ensureInstanceId(i),this._instanceIds[i]}setInstanceId(e,i){const r=e&nm;this._ensureInstanceId(r),this._instanceIds[r]=i}getComputedStringAtIndex(e,i){const r=e&nm;return this._ensureString(i,r),this._strings[i][r]}setComputedStringAtIndex(e,i,r){const n=e&nm;this._ensureString(i,n),this._strings[i][n]=r}getXMin(e){return this._bounds[4*(e&nm)]}getYMin(e){return this._bounds[4*(e&nm)+1]}getXMax(e){return this._bounds[4*(e&nm)+2]}getYMax(e){return this._bounds[4*(e&nm)+3]}setBounds(e,i){const r=i.readHydratedGeometry();if(!r||!r.coords.length)return!1;let n=1/0,s=1/0,o=-1/0,a=-1/0;r.forEachVertex((c,h)=>{n=Math.min(n,c),s=Math.min(s,h),o=Math.max(o,c),a=Math.max(a,h)});const l=e&nm;return ife(this._bounds,4*l+4,0),this._bounds[4*l]=n,this._bounds[4*l+1]=s,this._bounds[4*l+2]=o,this._bounds[4*l+3]=a,!0}};const bki=5e3,wki="tileRenderer.featuresView.attributeView.initialize",xki="tileRenderer.featuresView.attributeView.requestUpdate",Ski="tileRenderer.featuresView.requestRender";function Cki(t){return t.name==="worker:port-closed"}function rO(t){if(!ys(t)&&!Cki(t))throw t}function b_t(t){return t.type==="feature"&&t.mode==="snapshot"}let mS=class extends Tn{constructor(){super(...arguments),this._storage=new __t,this._markedIdsBufId=this._storage.createBitset(),this._lastCleanup=performance.now(),this._cleanupNeeded=!1,this._invalidated=!1,this._tileToResolver=new Map,this._didEdit=!1,this._updateVersion=1,this.tileStore=null,this.config=null,this.processor=null,this.remoteClient=null,this.service=null}initialize(){this._initStores(),this._initSource(),this._updateQueue=new xN({concurrency:this._source.type==="stream"?1:4,process:(e,i)=>this._onTileMessage(e,{signal:i})}),this.addHandles([this.tileStore.on("update",this.onTileUpdate.bind(this)),Yg(()=>!this.updating,()=>this.onIdle())]),this._checkUpdating=setInterval(()=>this.notifyChange("updating"),300)}_initSource(){const e=this.tileStore.tileScheme,i=()=>this._updateQueue&&this._updateQueue.length<50,r=(n,s)=>(this._invalidated=!0,this._patchTile(n,s));this._source=Y5i(this.service,this.spatialReference,e,r,i,this.featureStore),this._proxyEvents()}_proxyEvents(){if(this._source.type==="stream"){const e=this._source.events,i=this._source;this.addHandles([sr(()=>i.connectionStatus,r=>this.remoteClient.invoke("setProperty",{propertyName:"connectionStatus",value:r}).catch(rO),{initial:!0}),sr(()=>i.errorString,r=>this.remoteClient.invoke("setProperty",{propertyName:"errorString",value:r}).catch(rO),{initial:!0}),e.on("data-received",r=>this.remoteClient.invoke("emitEvent",{name:"data-received",event:{attributes:r.attributes,centroid:r.centroid,geometry:r.geometry}}).catch(rO)),e.on("message-received",r=>this.remoteClient.invoke("emitEvent",{name:"message-received",event:r}).catch(rO)),e.on("updateRate",r=>this.remoteClient.invoke("emitEvent",{name:"update-rate",event:{...r}}).catch(rO))])}}_initAttributeStore(e){this.attributeStore||(this.attributeStore=new f_t({type:"remote",initialize:(i,r)=>pf(this.remoteClient.invoke(wki,i,{signal:r}).catch(rO)),update:(i,r)=>pf(this.remoteClient.invoke(xki,i,{signal:r}).catch(rO)),render:i=>pf(this.remoteClient.invoke(Ski,void 0,{signal:i}).catch(rO))},e,()=>this.notifyChange("updating")))}_initStores(){const e=this.service.type==="snapshot"?"snapshot":"on-demand",i={geometryInfo:{geometryType:this.service.geometryType,hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.featureStore=new JLi(i,this._storage,e)}_initQueryEngine(e){const i=this;this.featureQueryEngine?.destroy(),this.featureQueryEngine=new Bk({definitionExpression:e.schema.source.definitionExpression??void 0,fields:this.service.fields,geometryType:this.service.geometryType,objectIdField:this.service.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!0,featureStore:this.featureStore,aggregateAdapter:{getFeatureObjectIds(r){return lt(i.aggregateStore)?[]:i.aggregateStore.getFeatureDisplayIdsForAggregate(r).map(n=>i.getObjectId(n))}},timeInfo:this.service.timeInfo})}_initAggregateQueryEngine(e,i){if(this.aggregateQueryEngine?.destroy(),lt(e))return;const r=i.targets.aggregate.params.fields.slice();this.aggregateQueryEngine=new Bk({definitionExpression:void 0,fields:r,geometryType:e.geometryInfo.geometryType,objectIdField:e.objectIdField,hasM:e.geometryInfo.hasM,hasZ:e.geometryInfo.hasZ,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!1,featureStore:e,aggregateAdapter:{getFeatureObjectIds:n=>[]}})}destroy(){this._updateQueue.destroy(),this._source.destroy(),this.featureQueryEngine?.destroy(),this.aggregateQueryEngine?.destroy(),this.attributeStore?.destroy();for(const e of this.tileStore.tiles)this._source.unsubscribe(e);clearInterval(this._checkUpdating)}get fieldsIndex(){return new Lm(this.service.fields)}get spatialReference(){return this.tileStore.tileScheme.spatialReference}get updating(){return this.isUpdating()}isUpdating(){const e=this._source.updating,i=!!this._updateQueue.length,r=!this.attributeStore||this.attributeStore.isUpdating(),n=e||i||r;return Hi("esri-2d-log-updating")&&console.log(`Updating FeatureController2D: ${n} -> updatingSource ${e} -> updateQueue ${i} -> updatingAttributeStore ${r} -`),n}updateCustomParameters(e){this._source.type==="stream"&&this._source.updateCustomParameters(e)}enableEvent(e){this._source.enableEvent(e.name,e.value)}pause(){this._updateQueue.pause(),this._updateQueue.clear()}resume(){this._updateQueue.resume()}pauseStream(){this._source.type==="stream"&&this._source.pauseStream()}resumeStream(){this._source.type==="stream"&&this._source.resumeStream()}sendMessageToSocket(e){this._source.type==="stream"&&this._source.sendMessageToSocket(e)}sendMessageToClient(e){this._source.type==="stream"&&this._source.sendMessageToClient(e)}_initAggregateStore(e){const i=e.schema.targets?.aggregate?.type;if(ya(this.config,n=>n.schema.targets?.aggregate?.type)!==i&&(ye(this.aggregateStore)&&(this.removeHandles("valueRangesChanged"),this.aggregateStore.destroy(),this.aggregateStore=null),i)){switch(i){case"cluster":{const n={geometryInfo:{geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.aggregateStore=new dki(n,this.spatialReference,this._storage,this.service),this.addHandles(this.aggregateStore.events.on("valueRangesChanged",s=>{this.remoteClient.invoke("emitEvent",{name:"valueRangesChanged",event:{valueRanges:s.valueRanges}}).catch(eO)}),"valueRangesChanged");break}case"bin":{const n={geometryInfo:{geometryType:"esriGeometryPolygon",hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.aggregateStore=new lki(n,this.spatialReference,this._storage,this.service);break}}this.aggregateStore.onTileUpdate({added:this.tileStore.tiles,removed:[]})}}async update(e,i){this._updateVersion++,this._initQueryEngine(i),this._initAttributeStore(i),this.pause(),await Promise.all([this._source.update(e,i.schema.source),this.featureStore.updateSchema(e,i.schema.targets.feature),this.attributeStore.update(e,i),this.attributeStore.updateFilters(e,i,this)]),this._initAggregateStore(i),ye(this.aggregateStore)&&await this.aggregateStore.updateSchema(e,i.schema.targets.aggregate),this._initAggregateQueryEngine(this.aggregateStore,i.schema),Gi("esri-2d-update-debug")&&e.describe(),this._set("config",i)}async applyUpdate(e){e.version=this._updateVersion,Gi("esri-2d-update-debug")&&console.debug(`Applying update ${e.version}`),e.mesh&&this.clearTiles(),this._updateQueue.resume(),await this._source.applyUpdate(e),this.notifyChange("updating"),await F1(()=>!this.updating),ye(this.aggregateStore)&&(await B3(10),await F1(()=>!this.updating))}async onEdits({edits:e}){Gi("esri-2d-update-debug")&&console.debug("Applying Edit:",e),this._didEdit=!0;try{const i=e.removed.map(n=>n.objectId&&n.objectId!==-1?n.objectId:this._lookupObjectIdByGlobalId(n.globalId)),r=e.addOrModified.map(({objectId:n})=>n);this.featureStore.invalidate(),await this._source.edit(r,i),this.clearTiles(),this.notifyChange("updating"),ye(this.aggregateStore)&&this.aggregateStore.clear(),await this._source.resend(),await F1(()=>!this.updating)}catch{}}async refresh(e){if(!e.dataChanged){const i=D_.empty();return i.storage.filters=!0,this.applyUpdate(i)}this.featureStore.invalidate(),this.clearTiles(),this._source.refresh(this._updateVersion,e),this._cleanupNeeded=!0,this.notifyChange("updating"),await F1(()=>!this.updating)}clearTiles(){for(const e of this.tileStore.tiles)this.processor.onTileClear(e)}onTileUpdate(e){ye(this.aggregateStore)&&this.aggregateStore.onTileUpdate(e);for(const i of e.added)this._source.subscribe(i,this._updateVersion),this._level=i.level;for(const i of e.removed)this._source.unsubscribe(i),this._cleanupNeeded=!0,this._tileToResolver.has(i.id)&&(this._tileToResolver.get(i.id).resolve(),this._tileToResolver.delete(i.id));this.notifyChange("updating")}async onIdle(){this._invalidated&&(this._invalidated=!1,(ye(this.aggregateStore)||this.processor.type==="heatmap")&&await this._repushCurrentLevelTiles()),this._markAndSweep()}async querySummaryStatistics({query:e,params:i}){return this.featureQueryEngine.executeQueryForSummaryStatistics(e,i)}async queryAggregateSummaryStatistics({query:e,params:i}){return this.aggregateQueryEngine.executeQueryForSummaryStatistics(e,i)}async queryUniqueValues({query:e,params:i}){return this.featureQueryEngine.executeQueryForUniqueValues(e,i)}async queryAggregateUniqueValues({query:e,params:i}){return this.aggregateQueryEngine.executeQueryForUniqueValues(e,i)}async queryClassBreaks({query:e,params:i}){return this.featureQueryEngine.executeQueryForClassBreaks(e,i)}async queryAggregateClassBreaks({query:e,params:i}){return this.aggregateQueryEngine.executeQueryForClassBreaks(e,i)}async queryHistogram({query:e,params:i}){return this.featureQueryEngine.executeQueryForHistogram(e,i)}async queryAggregateHistogram({query:e,params:i}){return this.aggregateQueryEngine.executeQueryForHistogram(e,i)}queryExtent(e){return this.featureQueryEngine.executeQueryForExtent(e)}queryAggregates(e){return this.aggregateQueryEngine.executeQuery(e)}queryAggregateCount(e){return this.aggregateQueryEngine.executeQueryForCount(e)}queryAggregateIds(e){return this.aggregateQueryEngine.executeQueryForIds(e)}queryFeatures(e){return this.featureQueryEngine.executeQuery(e)}async queryVisibleFeatures(e){const i=await this.featureQueryEngine.executeQuery(e),r=i.objectIdFieldName;return i.features=i.features.filter(n=>{const s=n.attributes[r],o=this.getDisplayId(s);return ya(o,a=>this.attributeStore.isVisible(a))}),i}queryFeatureCount(e){return this.featureQueryEngine.executeQueryForCount(e)}queryLatestObservations(e){return this.featureQueryEngine.executeQueryForLatestObservations(e)}queryObjectIds(e){return this.featureQueryEngine.executeQueryForIds(e)}async queryStatistics(){return this.featureStore.storeStatistics}getObjectId(e){return this.featureStore.lookupObjectId(e,this._storage)}getDisplayId(e){if(ye(this.aggregateStore)){const i=this.aggregateStore.getDisplayId(e);if(lt(i)){const r=this.featureStore.lookupDisplayId(e);return this.aggregateStore.getDisplayIdForReferenceId(r)}return i}return this.featureStore.lookupDisplayId(e)}getFeatures(e){const i=[],r=[];for(const n of e){const s=ye(this.aggregateStore)?this.getAggregate(n):null;if(ye(s))if(ye(s.attributes.referenceId)){const o=this.getFeature(s.attributes.referenceId);ye(o)&&i.push(o)}else r.push(s);else{const o=this.getFeature(n);ye(o)&&i.push(o)}}return{features:i,aggregates:r}}getFeature(e){const i=this.featureStore.lookupFeatureByDisplayId(e,this._storage);if(lt(i))return null;const r=i.readHydratedGeometry(),n=cw(r,i.geometryType,i.hasZ,i.hasM);return{attributes:i.readAttributes(),geometry:n}}getAggregate(e){return lt(this.aggregateStore)?null:this.aggregateStore.getAggregate(e)}getAggregates(){return lt(this.aggregateStore)?[]:this.aggregateStore.getAggregates()}async setHighlight(e){const i=pkt(e.map(r=>this.getDisplayId(r)));return this.attributeStore.setHighlight(e,i)}_lookupObjectIdByGlobalId(e){const i=this.service.globalIdField;if(lt(i))throw new Error("Expected globalIdField to be defined");let r=null;if(this.featureStore.forEach(n=>{e===n.readAttribute(i)&&(r=n.getObjectId())}),lt(r))throw new Error(`Expected to find a feature with globalId ${e}`);return r}async _repushCurrentLevelTiles(){const e=this.tileStore.tiles.filter(r=>r.level===this._level);e.map(async r=>this._patchTile({type:"append",id:r.key.id,clear:!0,addOrUpdate:null,end:!1}));const i=e.map(async r=>this._patchTile({type:"append",id:r.key.id,addOrUpdate:Sv.fromOptimizedFeatures([],this.service),remove:[],end:!0,isRepush:!0,status:D_.empty()}));await Promise.all(i)}_maybeForceCleanup(){performance.now()-this._lastCleanup>fki&&this._markAndSweep()}_patchTile(e,i){const r=this._updateQueue.push(e,i).then(()=>{this.notifyChange("updating")}).catch(n=>{this.notifyChange("updating")});return this.notifyChange("updating"),r}async _onTileMessage(e,i){if(sn(i),Gi("esri-2d-update-debug")){const o=ya(e.addOrUpdate,a=>a.hasFeatures);console.debug(e.id,`FeatureController:onTileMessage: [clear:${e.clear}, end:${e.end}, features: ${o}]`)}const r=this.tileStore.get(e.id);if(!r)return;if(e.clear)return this.processor.onTileClear(r);const n=e.status;this._cleanupNeeded=!0;const s=[];for(const o of e.remove??[]){const a=this.featureStore.lookupDisplayId(o);a&&s.push(a)}e.remove=s;try{if(lt(e.addOrUpdate))return void this.processor.onTileMessage(r,{...e,addOrUpdate:null},ye(this.aggregateStore),i).catch(wC);if(e.addOrUpdate.setArcadeSpatialReference(this.spatialReference),this.featureStore.hasInstance(e.addOrUpdate.instance)&&n.targets.feature||(n.targets.feature=!0,this.featureStore.onTileData(r,e)),(!n.storage.data||!n.storage.filters)&&(n.storage.data=!0,n.storage.filters=!0,this.attributeStore.onTileData(r,e),this._source.type==="stream"||this._didEdit?(await this.attributeStore.sendUpdates(),sn(i)):this.attributeStore.sendUpdates()),ye(this.aggregateStore)&&!n.targets.aggregate){n.targets.aggregate=!0;const o=Fvt(this._source)&&this._source.loading,a=!Fvt(this._source)||o||e.end;if(this.aggregateStore.onTileData(r,e,this._storage,this.attributeStore,a),!a)return;n.mesh||(this.attributeStore.onTileData(r,e),await this.attributeStore.sendUpdates())}if(!n.mesh){n.mesh=!0;const o=ye(this.aggregateStore)&&this.aggregateStore.type==="cluster";await this.processor.onTileMessage(r,e,o,i),sn(i)}this._maybeForceCleanup()}catch(o){wC(o)}}_mark(e,i,r){const n=(4294901760&this._storage.getInstanceId(e))>>>16;e&&(i.add(n),r.set(e))}_markAndSweep(){if(this._lastCleanup=performance.now(),!(!(this._source.type==="feature"&&this._source.mode==="snapshot")&&(this._source.type==="stream"||this._cleanupNeeded)))return;this._cleanupNeeded=!1;const e=this._storage.getBitset(this._markedIdsBufId),i=new Set;e.clear();for(const r of this.tileStore.tiles)for(const n of this._source.readers(r.id)){const s=n.getCursor();for(;s.next();){let o=s.getDisplayId();if(!o){const a=s.getObjectId();o=this.featureStore.lookupDisplayId(a)}this._mark(o,i,e)}}this.processor.type==="symbol"&&this.processor.forEachBufferId(r=>{this._mark(r,i,e)}),this._updateQueue.forEach(r=>{for(const n of r.remove??[]){const s=this.featureStore.lookupDisplayId(n);this._mark(s,i,e)}}),ye(this.aggregateStore)&&(this.aggregateStore.sweepFeatures(e,this.featureStore),"sweepAggregates"in this.aggregateStore&&this.aggregateStore.sweepAggregates(this._storage,this.attributeStore,this._level)),this.featureStore.sweepFeatures(e,this._storage,this.attributeStore),this.featureStore.sweepFeatureSets(i)}};E([k({constructOnly:!0})],mS.prototype,"tileStore",void 0),E([k()],mS.prototype,"config",void 0),E([k({readOnly:!0})],mS.prototype,"fieldsIndex",null),E([k()],mS.prototype,"processor",void 0),E([k({constructOnly:!0})],mS.prototype,"remoteClient",void 0),E([k({constructOnly:!0})],mS.prototype,"service",void 0),E([k()],mS.prototype,"spatialReference",null),E([k()],mS.prototype,"updating",null),mS=E([ht("esri.views.2d.layers.features.controllers.FeatureController2D")],mS);const _ki=mS;let WN=class extends KC{constructor(){super(...arguments),this.controller=null,this.processor=null,this.remoteClient=null,this.tileStore=null,this.service=null,this.viewState=null,this._paused=!1,this._pendingTileUpdates=[]}initialize(){this.handles.add(Qi(()=>this.updating,e=>{this.remoteClient.invoke("setUpdating",e).catch(i=>{})}))}destroy(){this.stop(),this.controller?.destroy(),this.processor?.destroy(),this.controller=this.processor=this.tileStore=this.remoteClient=null}get updating(){return!this.controller||this.controller.updating}stop(){this._paused=!0,Array.isArray(this.service?.source)&&(this.service.source.forEach(e=>e.close()),this.service.source.length=0),this.tileStore?.updateTiles({added:[],removed:this.tileStore.tiles.map(e=>e.id)}),this.tileStore?.destroy(),this.tileStore=null,this._pendingTileUpdates.length=0}async startup({service:e,config:i,tileInfo:r,tiles:n}){if(this._paused=!0,Array.isArray(this.service?.source)&&(this.service.source.forEach(s=>s.close()),this.service.source.length=0),this.service=e,!this.tileStore||!Ca(this.tileStore.tileScheme.spatialReference,r.spatialReference)){const s=new wk(Ml.fromJSON(r));n.added.length=n.removed.length=0,this.tileStore?.updateTiles({added:[],removed:this.tileStore.tiles.map(o=>o.id)}),this.tileStore?.destroy(),this.tileStore=new Irt(s),this._pendingTileUpdates.length=0}for(await this._createProcessorAndController(i),await this.update({config:i}),this.controller.resume(),this.tileStore.clear(),this.tileStore.updateTiles(n),this._paused=!1;this._pendingTileUpdates.length;)this.tileStore.updateTiles(this._pendingTileUpdates.pop())}async updateTiles(e){this._paused?this._pendingTileUpdates.push(e):this.tileStore?.updateTiles(e)}async update({config:e}){const i=D_.empty();return await Promise.all([this.processor.update(i,e),this.controller.update(i,e)]),i.toJSON()}async applyUpdate(e){return this.controller.applyUpdate(D_.create(e))}async _createProcessorAndController(e){await Promise.all([this._handleControllerConfig(e),this._handleProcessorConfig(e)]),this.controller.processor=this.processor}async _handleControllerConfig(e){return this._createController(this.service,e)}async _handleProcessorConfig(e){return this._createProcessor(this.service,e)}async _createController(e,i){this.controller&&this.controller.destroy();const{tileStore:r,remoteClient:n}=this,s=new _ki({service:e,tileStore:r,remoteClient:n});return this.controller=s,s}async _createProcessor(e,i){const r=i.schema.processors[0].type,n=(await D4i(r)).default,{remoteClient:s,tileStore:o}=this,a=new n({service:e,config:i,tileStore:o,remoteClient:s});return this.processor&&this.processor.destroy(),this.processor=a,a}};E([k()],WN.prototype,"controller",void 0),E([k()],WN.prototype,"processor",void 0),E([k()],WN.prototype,"updating",null),E([k()],WN.prototype,"viewState",void 0),WN=E([ht("esri.views.2d.layers.features.Pipeline")],WN);const bki=Object.freeze(Object.defineProperty({__proto__:null,default:WN},Symbol.toStringTag,{value:"Module"}));function pFe(){const t=new Float32Array(4);return t[3]=1,t}function Lvt(t){const e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function wki(t,e,i,r){const n=new Float32Array(4);return n[0]=t,n[1]=e,n[2]=i,n[3]=r,n}function xki(t,e){return new Float32Array(t,e,4)}Object.freeze(Object.defineProperty({__proto__:null,clone:Lvt,create:pFe,createView:xki,fromValues:wki},Symbol.toStringTag,{value:"Module"}));function kJ(){return new Float32Array(3)}function kvt(t){const e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function tO(t,e,i){const r=new Float32Array(3);return r[0]=t,r[1]=e,r[2]=i,r}function Ski(t,e){return new Float32Array(t,e,3)}function Nvt(){return kJ()}function $vt(){return tO(1,1,1)}function Bvt(){return tO(1,0,0)}function Gvt(){return tO(0,1,0)}function Vvt(){return tO(0,0,1)}const Cki=Nvt(),Tki=$vt(),Eki=Bvt(),Iki=Gvt(),Aki=Vvt();Object.freeze(Object.defineProperty({__proto__:null,ONES:Tki,UNIT_X:Eki,UNIT_Y:Iki,UNIT_Z:Aki,ZEROS:Cki,clone:kvt,create:kJ,createView:Ski,fromValues:tO,ones:$vt,unitX:Bvt,unitY:Gvt,unitZ:Vvt,zeros:Nvt},Symbol.toStringTag,{value:"Module"}));var fFe;let yU=fFe=class extends Ni{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new fFe({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};E([k({type:String,json:{write:!0}})],yU.prototype,"field",void 0),E([k({type:Number,nonNullable:!0,json:{write:!0}})],yU.prototype,"minValue",void 0),E([k({type:Number,nonNullable:!0,json:{write:!0}})],yU.prototype,"maxValue",void 0),yU=fFe=E([ht("esri.renderers.support.pointCloud.ColorModulation")],yU);const Pki=yU,mFe=new Bs({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let Mpe=class extends Ni{};E([k({type:mFe.apiValues,readOnly:!0,nonNullable:!0,json:{type:mFe.jsonValues,read:!1,write:mFe.write}})],Mpe.prototype,"type",void 0),Mpe=E([ht("esri.renderers.support.pointCloud.PointSizeAlgorithm")],Mpe);const gFe=Mpe;var yFe;let vU=yFe=class extends gFe{constructor(){super(...arguments),this.type="fixed-size",this.size=0,this.useRealWorldSymbolSizes=null}clone(){return new yFe({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};E([Hr({pointCloudFixedSizeAlgorithm:"fixed-size"})],vU.prototype,"type",void 0),E([k({type:Number,nonNullable:!0,json:{write:!0}})],vU.prototype,"size",void 0),E([k({type:Boolean,json:{write:!0}})],vU.prototype,"useRealWorldSymbolSizes",void 0),vU=yFe=E([ht("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],vU);const Oki=vU;var vFe;let NJ=vFe=class extends gFe{constructor(){super(...arguments),this.type="splat",this.scaleFactor=1}clone(){return new vFe({scaleFactor:this.scaleFactor})}};E([Hr({pointCloudSplatAlgorithm:"splat"})],NJ.prototype,"type",void 0),E([k({type:Number,value:1,nonNullable:!0,json:{write:!0}})],NJ.prototype,"scaleFactor",void 0),NJ=vFe=E([ht("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],NJ);const Rki={key:"type",base:gFe,typeMap:{"fixed-size":Oki,splat:NJ}},_Fe=jo()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let iO=class extends Ni{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:hi(this.pointSizeAlgorithm),colorModulation:hi(this.colorModulation),pointsPerInch:hi(this.pointsPerInch)}}};E([k({type:_Fe.apiValues,readOnly:!0,nonNullable:!0,json:{type:_Fe.jsonValues,read:!1,write:_Fe.write}})],iO.prototype,"type",void 0),E([k({types:Rki,json:{write:!0}})],iO.prototype,"pointSizeAlgorithm",void 0),E([k({type:Pki,json:{write:!0}})],iO.prototype,"colorModulation",void 0),E([k({json:{write:!0},nonNullable:!0,type:Number})],iO.prototype,"pointsPerInch",void 0),iO=E([ht("esri.renderers.PointCloudRenderer")],iO),function(t){t.fieldTransformTypeKebabDict=new Bs({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})}(iO||(iO={}));const dy=iO;var bFe;let UD=bFe=class extends Ni{constructor(){super(...arguments),this.description=null,this.label=null,this.minValue=0,this.maxValue=0,this.color=null}clone(){return new bFe({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:hi(this.color)})}};E([k({type:String,json:{write:!0}})],UD.prototype,"description",void 0),E([k({type:String,json:{write:!0}})],UD.prototype,"label",void 0),E([k({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],UD.prototype,"minValue",void 0),E([k({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],UD.prototype,"maxValue",void 0),E([k({type:$r,json:{type:[xs],write:!0}})],UD.prototype,"color",void 0),UD=bFe=E([ht("esri.renderers.support.pointCloud.ColorClassBreakInfo")],UD);const Mki=UD;var wFe;let jD=wFe=class extends dy{constructor(t){super(t),this.type="point-cloud-class-breaks",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.colorClassBreakInfos=null}clone(){return new wFe({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:hi(this.colorClassBreakInfos),legendOptions:hi(this.legendOptions)})}};E([Hr({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],jD.prototype,"type",void 0),E([k({json:{write:!0},type:String})],jD.prototype,"field",void 0),E([k({type:WC,json:{write:!0}})],jD.prototype,"legendOptions",void 0),E([k({type:dy.fieldTransformTypeKebabDict.apiValues,json:{type:dy.fieldTransformTypeKebabDict.jsonValues,read:dy.fieldTransformTypeKebabDict.read,write:dy.fieldTransformTypeKebabDict.write}})],jD.prototype,"fieldTransformType",void 0),E([k({type:[Mki],json:{write:!0}})],jD.prototype,"colorClassBreakInfos",void 0),jD=wFe=E([ht("esri.renderers.PointCloudClassBreaksRenderer")],jD);const Uvt=jD;var xFe;let zD=xFe=class extends dy{constructor(t){super(t),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new xFe({...this.cloneProperties(),field:hi(this.field),fieldTransformType:hi(this.fieldTransformType),stops:hi(this.stops),legendOptions:hi(this.legendOptions)})}};E([Hr({pointCloudStretchRenderer:"point-cloud-stretch"})],zD.prototype,"type",void 0),E([k({json:{write:!0},type:String})],zD.prototype,"field",void 0),E([k({type:WC,json:{write:!0}})],zD.prototype,"legendOptions",void 0),E([k({type:dy.fieldTransformTypeKebabDict.apiValues,json:{type:dy.fieldTransformTypeKebabDict.jsonValues,read:dy.fieldTransformTypeKebabDict.read,write:dy.fieldTransformTypeKebabDict.write}})],zD.prototype,"fieldTransformType",void 0),E([k({type:[Q7e],json:{write:!0}})],zD.prototype,"stops",void 0),zD=xFe=E([ht("esri.renderers.PointCloudStretchRenderer")],zD);const jvt=zD;var SFe;let qN=SFe=class extends Ni{constructor(){super(...arguments),this.description=null,this.label=null,this.values=null,this.color=null}clone(){return new SFe({description:this.description,label:this.label,values:hi(this.values),color:hi(this.color)})}};E([k({type:String,json:{write:!0}})],qN.prototype,"description",void 0),E([k({type:String,json:{write:!0}})],qN.prototype,"label",void 0),E([k({type:[String],json:{write:!0}})],qN.prototype,"values",void 0),E([k({type:$r,json:{type:[xs],write:!0}})],qN.prototype,"color",void 0),qN=SFe=E([ht("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],qN);const Dki=qN;var CFe;let HD=CFe=class extends dy{constructor(t){super(t),this.type="point-cloud-unique-value",this.field=null,this.fieldTransformType=null,this.colorUniqueValueInfos=null,this.legendOptions=null}clone(){return new CFe({...this.cloneProperties(),field:hi(this.field),fieldTransformType:hi(this.fieldTransformType),colorUniqueValueInfos:hi(this.colorUniqueValueInfos),legendOptions:hi(this.legendOptions)})}};E([Hr({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],HD.prototype,"type",void 0),E([k({json:{write:!0},type:String})],HD.prototype,"field",void 0),E([k({type:dy.fieldTransformTypeKebabDict.apiValues,json:{type:dy.fieldTransformTypeKebabDict.jsonValues,read:dy.fieldTransformTypeKebabDict.read,write:dy.fieldTransformTypeKebabDict.write}})],HD.prototype,"fieldTransformType",void 0),E([k({type:[Dki],json:{write:!0}})],HD.prototype,"colorUniqueValueInfos",void 0),E([k({type:WC,json:{write:!0}})],HD.prototype,"legendOptions",void 0),HD=CFe=E([ht("esri.renderers.PointCloudUniqueValueRenderer")],HD);const zvt=HD,Cd=!0,YN={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function TFe(t,e,i){return{identifier:String.fromCharCode.apply(null,new Uint8Array(t,i+YN.identifierOffset,YN.identifierLength)),version:e.getUint16(i+YN.versionOffset,Cd),checksum:e.getUint32(i+YN.checksumOffset,Cd)}}const N_={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 Fki(t,e){return{sizeLo:t.getUint32(e+N_.sizeLo,Cd),sizeHi:t.getUint32(e+N_.sizeHi,Cd),minX:t.getFloat64(e+N_.minX,Cd),minY:t.getFloat64(e+N_.minY,Cd),minZ:t.getFloat64(e+N_.minZ,Cd),maxX:t.getFloat64(e+N_.maxX,Cd),maxY:t.getFloat64(e+N_.maxY,Cd),maxZ:t.getFloat64(e+N_.maxZ,Cd),errorX:t.getFloat64(e+N_.errorX,Cd),errorY:t.getFloat64(e+N_.errorY,Cd),errorZ:t.getFloat64(e+N_.errorZ,Cd),count:t.getUint32(e+N_.count,Cd),reserved:t.getUint32(e+N_.reserved,Cd)}}function Lki(t){const e=new DataView(t,0);let i=0;const{identifier:r,version:n}=TFe(t,e,i);if(i+=YN.byteCount,r!=="LEPCC ")throw new st("lepcc-decode-error","Bad identifier");if(n>1)throw new st("lepcc-decode-error","Unknown version");const s=Fki(e,i);if(i+=N_.byteCount,s.sizeHi*4294967296+s.sizeLo!==t.byteLength)throw new st("lepcc-decode-error","Bad size");const o=new Float64Array(3*s.count),a=[],l=[],c=[],d=[];if(i=Dpe(t,i,a),i=Dpe(t,i,l),i=Dpe(t,i,c),i=Dpe(t,i,d),i!==t.byteLength)throw new st("lepcc-decode-error","Bad length");let p=0,y=0;for(let v=0;v>6;let l=0;if(a===0)l=r.getUint32(1,Cd),e+=5;else if(a===1)l=r.getUint16(1,Cd),e+=3;else{if(a!==2)throw new st("lepcc-decode-error","Bad count type");l=r.getUint8(1),e+=2}if(o)throw new st("lepcc-decode-error","LUT not implemented");const c=Math.ceil(l*s/8),d=new Uint8Array(t,e,c);let p=0,y=0,v=0;const S=-1>>>32-s;for(let I=0;I>>=s,y-=s,y+s>32&&(p|=d[v-1]>>8-y)}return e+v}const XN={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function kki(t,e){return{sizeLo:t.getUint32(e+XN.sizeLo,Cd),sizeHi:t.getUint32(e+XN.sizeHi,Cd),count:t.getUint32(e+XN.count,Cd),colorMapCount:t.getUint16(e+XN.colorMapCount,Cd),lookupMethod:t.getUint8(e+XN.lookupMethod),compressionMethod:t.getUint8(e+XN.compressionMethod)}}function Nki(t){const e=new DataView(t,0);let i=0;const{identifier:r,version:n}=TFe(t,e,i);if(i+=YN.byteCount,r!=="ClusterRGB")throw new st("lepcc-decode-error","Bad identifier");if(n>1)throw new st("lepcc-decode-error","Unknown version");const s=kki(e,i);if(i+=XN.byteCount,s.sizeHi*4294967296+s.sizeLo!==t.byteLength)throw new st("lepcc-decode-error","Bad size");if((s.lookupMethod===2||s.lookupMethod===1)&&s.compressionMethod===0){if(3*s.colorMapCount+s.count+i!==t.byteLength||s.colorMapCount>256)throw new st("lepcc-decode-error","Bad count");const o=new Uint8Array(t,i,3*s.colorMapCount),a=new Uint8Array(t,i+3*s.colorMapCount,s.count),l=new Uint8Array(3*s.count);for(let c=0;c1)throw new st("lepcc-decode-error","Unknown version");const s=$ki(e,i);if(i+=KN.byteCount,s.sizeHi*4294967296+s.sizeLo!==t.byteLength)throw new st("lepcc-decode-error","Bad size");const o=new Uint16Array(s.count);if(s.bitsPerPoint===8){if(s.count+i!==t.byteLength)throw new st("lepcc-decode-error","Bad size");const a=new Uint8Array(t,i,s.count);for(let l=0;l=192&&s<224){if(n+1>=i)throw new st("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const o=(31&s)<<6|63&t[e+n+1];r+=String.fromCharCode(o),n+=2}else if(s>=224&&s<240){if(n+2>=i)throw new st("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const o=(15&s)<<12|(63&t[e+n+1])<<6|63&t[e+n+2];r+=String.fromCharCode(o),n+=3}else{if(!(s>=240&&s<248))throw new st("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(n+3>=i)throw new st("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const o=(7&s)<<18|(63&t[e+n+1])<<12|(63&t[e+n+2])<<6|63&t[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 Hvt(t,e){const i={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 Wvt(t,e,i){const r=[];let n,s,o=0;for(s=0;s0){if(r.push(Gki(i,o,n-1)),i[o+n-1]!==0)throw new st("string-array-error","Invalid string array: missing null termination.")}else r.push(null);o+=n}return r}function AFe(t,e){return new Fpe[e.valueType](t,e.byteOffset,e.count*e.valuesPerElement)}function Uki(t,e){return new Uint8Array(t,e.byteOffset,e.byteCount)}function jki(t,e,i){const r=e.header!=null?Hvt(t,e.header):{byteOffset:0,byteCount:0,fields:{count:i}},n={header:r,byteOffset:r.byteCount,byteCount:0,entries:Object.create(null)};let s=r.byteCount;for(let o=0;onew DataView(t,0).getFloat32(e,!0),Float64:(t,e)=>new DataView(t,0).getFloat64(e,!0),UInt8:(t,e)=>new DataView(t,0).getUint8(e),Int8:(t,e)=>new DataView(t,0).getInt8(e),UInt16:(t,e)=>new DataView(t,0).getUint16(e,!0),Int16:(t,e)=>new DataView(t,0).getInt16(e,!0),UInt32:(t,e)=>new DataView(t,0).getUint32(e,!0),Int32:(t,e)=>new DataView(t,0).getInt32(e,!0)};function Kvt(t){return Fpe.hasOwnProperty(t)}function Lpe(t){return Kvt(t)?Fpe[t].BYTES_PER_ELEMENT:0}function Wki(t,e,i,r){const{rendererJSON:n,isRGBRenderer:s}=t;let o=null,a=null;if(e&&s)o=e;else if(e&&n?.type==="pointCloudUniqueValueRenderer"){a=zvt.fromJSON(n);const l=a.colorUniqueValueInfos;o=new Uint8Array(3*r);const c=PFe(a.fieldTransformType);for(let d=0;d=l[y].value)o[3*d]=l[y].color.r,o[3*d+1]=l[y].color.g,o[3*d+2]=l[y].color.b;else for(let v=1;v=l[y].minValue&&p<=l[y].maxValue){o[3*d]=l[y].color.r,o[3*d+1]=l[y].color.g,o[3*d+2]=l[y].color.b;break}}}else{o=new Uint8Array(3*r);for(let l=0;l=c?1:y<=l?d:d+(1-d)*(y-l)/(c-l);o[3*p]=v*o[3*p],o[3*p+1]=v*o[3*p+1],o[3*p+2]=v*o[3*p+2]}}return o}function qki(t,e){if(t.encoding==null||t.encoding===""){const i=zki(e,t);if(lt(i.vertexAttributes.position))return;const r=AFe(e,i.vertexAttributes.position),n=i.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 c=0;c>>4&15,S=v>1,I=y===1,O=y===v;let L=!1;for(const N of d.includedReturns)if(N==="last"&&O||N==="firstOfMany"&&I&&S||N==="lastOfMany"&&O&&S||N==="single"&&!S){L=!0;break}L||(l=!1);break}}}l&&(i[o]=a,t[3*o]=t[3*a],t[3*o+1]=t[3*a+1],t[3*o+2]=t[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 PFe(t){return t==null||t==="none"?null:t==="low-four-bit"?e=>15&e:t==="high-four-bit"?e=>(240&e)>>4:t==="absolute-value"?e=>Math.abs(e):t==="modulo-ten"?e=>e%10:null}function Jvt(t){let e=0;for(const i of t||[])e|=1<0&&ye(e.filterAttributesData)){const d=e.filterAttributesData.filter(ye).map(p=>{const y=kpe(p,i,r),v={attributeInfo:p.attributeInfo,values:y};return s.push(v),v});n=new Uint32Array(r),r=Xki(i,l,n,e.filterInfo,d)}for(const d of e.userAttributesData){const p=kpe(d,i,r);s.push({attributeInfo:d.attributeInfo,values:p})}3*rthis._readRasterValue(n,e));return this._processPixels({...e,pixelBlocks:r})}processInputBandIds(){const e=this._getRasterValues().filter(this._isRasterFunctionValue);let i;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(i=r.processInputBandIds(),r.isInputBandIdsSwizzled)return this.rawInputBandIds=i,i}else{i=[];const{bandCount:s}=this.sourceRasterInfos[0];for(let o=0;os!==o),this.rawInputBandIds=n,this.rawInputBandIds}getPrimaryRasters(){const e=[],i=[];return this._getPrimaryRasters(this,e,i),{rasters:e,rasterIds:i}}getWebGLProcessorDefinition(){const e=this._getWebGLParameters(),{raster:i,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(i)&&(e.raster=i.getWebGLProcessorDefinition()),{name:this.functionName,parameters:e,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getFlatWebGLFunctionChain(){const e=this.getWebGLProcessorDefinition();if(!e)return null;const i=[e],{parameters:r}=e;let n=r.rasters||r.raster&&[r.raster];for(;n?.length;){i.unshift(...n);const o=[];for(let a=0;a=0;o--)i[o].isNoopProcess&&i.splice(o,1);let s=!1;for(let o=0;o1}return{hasBranches:s,functions:i}}_getOutputPixelType(e){return this.outputPixelType==="unknown"?e:this.outputPixelType??e}_getWebGLParameters(){return{}}_getInputBandIds(e){return e}_isOutputRoundingNeeded(){const{outputPixelType:e}=this;return(e?.startsWith("u")||e?.startsWith("s"))??!1}_getRasterValues(){const{rasterArgumentNames:e}=this;return e[0]==="rasters"?this.functionArguments.rasters??[]:e.map(i=>this.functionArguments[i])}_getSourceRasterInfos(e){const i=this._getRasterValues(),{rasterInfos:r,rasterIds:n}=e;if(i.length===0)return r;const s=i.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?.url}_getPrimaryRasters(e,i=[],r=[]){for(let n=0;nt?.toLowerCase())],Qf.prototype,"outputPixelType",void 0),E([k({json:{write:!0}})],Qf.prototype,"mainPrimaryRasterId",void 0),E([k()],Qf.prototype,"sourceRasters",void 0),E([k({type:[R2],json:{write:!0}})],Qf.prototype,"sourceRasterInfos",void 0),E([k({json:{write:!0}})],Qf.prototype,"rasterInfo",void 0),E([k({json:{write:!0}})],Qf.prototype,"readingBufferSize",void 0),E([k({json:{write:!0}})],Qf.prototype,"id",void 0),E([k()],Qf.prototype,"isNoopProcess",void 0),E([k()],Qf.prototype,"supportsGPU",null),E([k()],Qf.prototype,"rawInputBandIds",void 0),E([k()],Qf.prototype,"isInputBandIdsSwizzled",void 0),E([k()],Qf.prototype,"swizzledBandSelection",void 0),E([k()],Qf.prototype,"isBranch",void 0),E([k()],Qf.prototype,"_bindingResult",void 0),Qf=E([ht("esri.layers.support.rasterFunctions.BaseRasterFunction")],Qf);const fb=Qf;let JN=class extends fb{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 i=e.clone();return i.pixelType=this.outputPixelType,i.statistics=[{min:0,max:360,avg:180,stddev:30}],i.histograms=null,i.colormap=null,i.attributeTable=null,i.bandCount=1,this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(e){const i=e.pixelBlocks?.[0];if(lt(i))return null;const{extent:r}=e,n=r?{x:r.width/i.width,y:r.height/i.height}:{x:1,y:1};return XKt(i,{resolution:n})}};E([k({json:{write:!0,name:"rasterFunction"}})],JN.prototype,"functionName",void 0),E([k({type:Qki,json:{write:!0,name:"rasterFunctionArguments"}})],JN.prototype,"functionArguments",void 0),E([k()],JN.prototype,"rasterArgumentNames",void 0),E([k({json:{write:!0}})],JN.prototype,"isGCS",void 0),JN=E([ht("esri.layers.support.rasterFunctions.AspectFunction")],JN);const eNi=JN,tNi=new Set(["+","-","*","/","(",")"]);function iNi(t,e){(t=t.replace(/ /g,"")).startsWith("-")&&(t="0"+t),t.startsWith("+")&&(t=t.slice(1,t.length));const i=t.split(""),r=[],n=[];let s="";for(let o=0;o-1)i>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}=sNi(n);if(r=rNi(t,n[a],s[o],s[o+1]),n.length===1)break;n=nNi(n,a),s.splice(o,2,r)}return[r]}const aNi=new Bs({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 lNi(t,e){if(!wh(t))return t;const{equation:i,method:r}=e,n=e.bandIndexes.map(d=>d-1),{pixels:s,mask:o}=t;let a;switch(r){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":a=Qvt(o,s[n[0]],s[n[1]]);break;case"ndwi":a=Qvt(o,s[n[1]],s[n[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":a=cNi(o,s[n[0]],s[n[1]]);break;case"ci-g":case"ci-re":a=hNi(o,s[n[0]],s[n[1]]);break;case"savi":a=dNi(o,s[n[0]],s[n[1]],n[2]+1);break;case"tsavi":a=pNi(o,s[n[0]],s[n[1]],n[2]+1,n[3]+1,n[4]+1);break;case"msavi":a=fNi(o,s[n[0]],s[n[1]]);break;case"gemi":a=mNi(o,s[n[0]],s[n[1]]);break;case"pvi":a=gNi(o,s[n[0]],s[n[1]],n[2]+1,n[3]+1);break;case"gvitm":a=yNi(o,[s[n[0]],s[n[1]],s[n[2]],s[n[3]],s[n[4]],s[n[5]]]);break;case"sultan":a=vNi(o,[s[n[0]],s[n[1]],s[n[2]],s[n[3]],s[n[4]],s[n[5]]]);break;case"vari":a=_Ni(o,[s[n[0]],s[n[1]],s[n[2]]]);break;case"mtvi2":a=bNi(o,[s[n[0]],s[n[1]],s[n[2]]]);break;case"rtvi-core":a=wNi(o,[s[n[0]],s[n[1]],s[n[2]]]);break;case"evi":a=xNi(o,[s[n[0]],s[n[1]],s[n[2]]]);break;case"wndwi":a=SNi(o,[s[n[0]],s[n[1]],s[n[2]]],n[3]?n[3]+1:.5);break;case"bai":a=CNi(o,s[n[0]],s[n[1]]);break;case"custom":a=oNi(o,s,i);break;default:return t}const l=ye(o)?new Uint8Array(o.length):null;ye(o)&&ye(l)&&l.set(o);const c=new en({width:t.width,height:t.height,pixelType:"f32",pixels:a,mask:l});return c.updateStatistics(),c}function uNi(t,e,i,r){const{mask:n,pixels:s,width:o,height:a}=t,l=s[i],c=s[e],d=c.length,p=r?new Uint8Array(d):new Float32Array(d),y=r?100:1,v=r?100.5:0;for(let I=0;IparseFloat(o));return lNi(i,{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 i=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=yg([i[0],i[1],0]),n="ndxi";break;case"ndwi":r=yg([i[1],i[0],0]),n="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":r=yg([i[0],i[1],0]),n="sr";break;case"ci-g":case"ci-re":r=yg([i[0],i[1],0]),n="ci";break;case"savi":r=yg([i[0],i[1],0]),n="savi",s[0]=e[2]+1;break;case"tsavi":r=yg([i[0],i[1],0]),n="tsavi",s[0]=e[2]+1,s[1]=e[3]+1,s[2]=e[4]+1;break;case"msavi":r=yg([i[0],i[1],0]),n="msavi";break;case"gemi":r=yg([i[0],i[1],0]),n="gemi";break;case"pvi":r=yg([i[0],i[1],0]),n="tsavi",s[0]=e[2]+1,s[1]=e[3]+1;break;case"vari":r=yg([i[0],i[1],i[2]]),n="vari";break;case"mtvi2":r=yg([i[0],i[1],i[2]]),n="mtvi2";break;case"rtvi-core":r=yg([i[0],i[1],i[2]]),n="rtvicore";break;case"evi":r=yg([i[0],i[1],i[2]]),n="evi";break;case"wndwi":r=yg([i[0],i[1],0]),n="wndwi",s[0]=e[3]?e[3]+1:.5;break;case"bai":r=yg([i[1],i[0],0]),n="bai";break;default:r=yg([0,1,2]),n="custom"}return{bandIndexMat3:r,indexType:n,adjustments:s}}_getInputBandIds(e){if(this.functionArguments.method==="custom")return e;const i=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1),r=e.length,n=i.map(a=>a>=r?r-1:a),s=ENi.has(this.functionArguments.method)?3:2,o=n.slice(0,s).map(a=>e[a]);return o.length===2&&o.push(0),o}};E([k({json:{write:!0,name:"rasterFunction"}})],_U.prototype,"functionName",void 0),E([k({type:TNi,json:{write:!0,name:"rasterFunctionArguments"}})],_U.prototype,"functionArguments",void 0),E([k()],_U.prototype,"rasterArgumentNames",void 0),_U=E([ht("esri.layers.support.rasterFunctions.BandArithmeticFunction")],_U);const INi=_U;var DFe;let fE=DFe=class extends pb{castColormapName(t){if(!t)return null;const e=t.toLowerCase();return Xqt.includes(e)?e:null}readColorRamp(t){return Cse(t)}readColorRampName(t,e){if(!t)return null;const i=mB.jsonValues.find(r=>r.toLowerCase()===t.toLowerCase());return i?mB.fromJSON(i):null}clone(){return new DFe({colormap:hi(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};E([k({type:[[Number]],json:{write:!0}})],fE.prototype,"colormap",void 0),E([k({type:String,json:{write:!0}})],fE.prototype,"colormapName",void 0),E([Zs("colormapName")],fE.prototype,"castColormapName",null),E([k({types:Sse,json:{write:!0}})],fE.prototype,"colorRamp",void 0),E([Li("colorRamp")],fE.prototype,"readColorRamp",null),E([k({type:mB.apiValues,json:{type:mB.jsonValues,write:mB.write}})],fE.prototype,"colorRampName",void 0),E([Li("colorRampName")],fE.prototype,"readColorRampName",null),fE=DFe=E([ht("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],fE);const ANi=fE,PNi=[[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]],ONi=[[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 FFe(t,e){const i=[],r=[];for(let s=0;s[r,...i]),e):null}let WD=class extends fb{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:i,colormapName:r,colorRamp:n,colorRampName:s}=this.functionArguments;if(!i?.length)if(n)i=BA(n,{interpolateAlpha:!0});else if(s){const a=Jqt(s);a&&(i=BA(a))}else r&&(i=kNi(r));if(!i?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};this.outputPixelType=this._getOutputPixelType("u8");const o=e.clone();return o.pixelType=this.outputPixelType,o.colormap=i,o.bandCount=1,this.rasterInfo=o,{success:!0,supportsGPU:!0}}_processPixels(e){return e.pixelBlocks?.[0]}};E([k({json:{write:!0,name:"rasterFunction"}})],WD.prototype,"functionName",void 0),E([k({type:ANi,json:{write:!0,name:"rasterFunctionArguments"}})],WD.prototype,"functionArguments",void 0),E([k()],WD.prototype,"rasterArgumentNames",void 0),E([k()],WD.prototype,"isNoopProcess",void 0),E([k({json:{write:!0}})],WD.prototype,"indexedColormap",void 0),WD=E([ht("esri.layers.support.rasterFunctions.ColormapFunction")],WD);const NNi=WD;var LFe;let BJ=LFe=class extends pb{constructor(){super(...arguments),this.rasters=[]}writeRasters(t,e){e.rasters=t.map(i=>typeof i=="number"||typeof i=="string"?i:i.toJSON())}clone(){return new LFe({rasters:hi(this.rasters)})}};E([k({json:{write:!0}})],BJ.prototype,"rasters",void 0),E([mr("rasters")],BJ.prototype,"writeRasters",null),BJ=LFe=E([ht("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],BJ);const $Ni=BJ;let bU=class extends fb{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:e}=this,i=e[0];this.outputPixelType=this._getOutputPixelType(i.pixelType);const r=i.clone();if(r.attributeTable=null,r.colormap=null,r.pixelType=this.outputPixelType,r.bandCount=e.map(({bandCount:n})=>n).reduce((n,s)=>n+s),e.every(({statistics:n})=>ye(n)&&n.length)){const n=[];e.forEach(({statistics:s})=>ye(s)&&n.push(...s)),r.statistics=n}if(e.every(({histograms:n})=>ye(n)&&n.length)){const n=[];e.forEach(({histograms:s})=>ye(s)&&n.push(...s)),r.histograms=n}return r.bandCount>1&&(r.colormap=null,r.attributeTable=null),this.rasterInfo=r,{success:!0,supportsGPU:r.bandCount<=3}}_processPixels(e){const{pixelBlocks:i}=e;if(!i)return null;const r=i?.[0];return lt(r)?null:pYt(i)}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};E([k({json:{write:!0,name:"rasterFunction"}})],bU.prototype,"functionName",void 0),E([k({type:$Ni,json:{write:!0,name:"rasterFunctionArguments"}})],bU.prototype,"functionArguments",void 0),E([k()],bU.prototype,"rasterArgumentNames",void 0),bU=E([ht("esri.layers.support.rasterFunctions.CompositeBandFunction")],bU);const BNi=bU,Ku={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},GNi={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},$_={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},gS={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},VNi={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},e_t={setNull:50,conditional:78},t_t={...GNi,...$_,...gS,...VNi,...e_t},Vd=new Map;function UNi(t){const e=Math.sqrt(t.length),i=t.slice(0,e),r=[1];for(let n=1;na+l);return o!==0&&o!==1&&(r=r.map(a=>a/o)),WNi(i,{kernel:r,rows:n,cols:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){let{kernel:e}=this.functionArguments;const i=e.reduce((n,s)=>n+s);i!==0&&i!==1&&(e=e.map(n=>n/i));const r=new Float32Array(n_t);return r.set(e),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:r,clampRange:sT(this.outputPixelType)}}};E([k({json:{write:!0,name:"rasterFunction"}})],wU.prototype,"functionName",void 0),E([k({type:qNi,json:{write:!0,name:"rasterFunctionArguments"}})],wU.prototype,"functionArguments",void 0),E([k()],wU.prototype,"rasterArgumentNames",void 0),wU=E([ht("esri.layers.support.rasterFunctions.ConvolutionFunction")],wU);const YNi=wU;var NFe;let GJ=NFe=class extends pb{constructor(){super(...arguments),this.bandIds=[],this.missingBandAction=nae.bestMatch}clone(){return new NFe({bandIds:[...this.bandIds],missingBandAction:this.missingBandAction})}};E([k({json:{write:!0}})],GJ.prototype,"bandIds",void 0),E([k({json:{write:!0}})],GJ.prototype,"missingBandAction",void 0),GJ=NFe=E([ht("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],GJ);const XNi=GJ;let xU=class extends fb{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{sourceRasterInfos:e}=this,i=e[0],{bandCount:r}=i,{bandIds:n,missingBandAction:s}=this.functionArguments;if(s===nae.fail&&n.some(c=>c<0||c>=r))return{success:!1,supportsGPU:!1,error:"extract-band-function: invalid bandIds"};this.outputPixelType=this._getOutputPixelType("f32");const o=i.clone();o.pixelType=this.outputPixelType,o.bandCount=n.length;const{statistics:a,histograms:l}=o;return ye(a)&&a.length&&(o.statistics=n.map(c=>a[c]||a[a.length-1])),ye(l)&&l.length&&(o.histograms=n.map(c=>l[c]||l[l.length-1])),this.rasterInfo=o,{success:!0,supportsGPU:o.bandCount<=3}}_processPixels(e){const i=e.pixelBlocks?.[0];if(lt(i))return null;const r=i.pixels.length,n=this.functionArguments.bandIds.map(s=>s>=r?r-1:s);return i.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 i=0;i<3;i++)e[i]=Math.min(e[i],2)}return{bandIndexMat3:yg(e)}}_getInputBandIds(e){const i=e.length;return this.functionArguments.bandIds.map(r=>r>=i?i-1:r).map(r=>e[r])}};E([k({json:{write:!0,name:"rasterFunction"}})],xU.prototype,"functionName",void 0),E([k({type:XNi,json:{write:!0,name:"rasterFunctionArguments"}})],xU.prototype,"functionArguments",void 0),E([k()],xU.prototype,"rasterArgumentNames",void 0),xU=E([ht("esri.layers.support.rasterFunctions.ExtractBandFunction")],xU);const KNi=xU;var $Fe;let QN=$Fe=class extends pb{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(t,e){e.rasters=t.map(i=>typeof i=="number"||typeof i=="string"?i:i.toJSON())}clone(){return new $Fe({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:hi(this.rasters)})}};E([k({json:{write:!0}})],QN.prototype,"operation",void 0),E([k({json:{write:!0}})],QN.prototype,"rasters",void 0),E([mr("rasters")],QN.prototype,"writeRasters",null),E([k({json:{write:!0}})],QN.prototype,"processAsMultiband",void 0),QN=$Fe=E([ht("esri.layers.support.rasterFunctions.LocalFunctionArguments")],QN);const JNi=QN,vg=new Map;function ZNi(t){return vg.get(t)}vg.set(gS.acos,[0,Math.PI]),vg.set(gS.asin,[-Math.PI/2,Math.PI/2]),vg.set(gS.atan,[-Math.PI/2,Math.PI/2]),vg.set(gS.cos,[-1,1]),vg.set(gS.sin,[-1,1]),vg.set($_.booleanAnd,[0,1]),vg.set($_.booleanNot,[0,1]),vg.set($_.booleanOr,[0,1]),vg.set($_.booleanXOr,[0,1]),vg.set($_.equalTo,[0,1]),vg.set($_.notEqual,[0,1]),vg.set($_.greaterThan,[0,1]),vg.set($_.greaterThanEqual,[0,1]),vg.set($_.lessThan,[0,1]),vg.set($_.lessThanEqual,[0,1]),vg.set($_.isNull,[0,1]);const s_t=[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 QNi(t,e=!1){const i=t.map(a=>a.mask),r=i.filter(a=>ye(a)),n=t[0].pixels[0].length;if(r.length===0)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(c)}return o}const a=r===gS.asin?Math.asin:Math.acos;for(let l=0;l1?e[l]=0:o[l]=a(c)}return o}function l6i(t,e,i,r){const[n]=t,s=n.length,o=en.createEmptyBand(i,s);for(let a=0;a>n[a]);return o}function f6i(t,e,i){const[r,n]=t,s=r.length,o=en.createEmptyBand(i,s);for(let a=0;an[a]?1:0);return o}function I6i(t,e,i){const[r,n]=t,s=r.length,o=en.createEmptyBand(i,s);for(let a=0;a=n[a]?1:0);return o}function A6i(t,e,i){const[r,n]=t,s=r.length,o=en.createEmptyBand(i,s);for(let a=0;ad&&(l=d)}o[a]=l}return o}function h_t(t,e,i){const r=t.length;if(r<2)return t[0];const[n]=t,s=n.length,o=en.createEmptyBand(i,s);for(let a=0;ap&&(l=p)}o[a]=c-l}return o}function d_t(t,e,i){const r=t.length;if(r<2)return t[0];const[n]=t,s=n.length,o=en.createEmptyBand(i,s);for(let a=0;ad&&(d=c,l=p);s[a]=l}return s}function v_t(t,e,i){const r=t.length;if(r<=2)return g_t(t,e,i);const n=t[0].length,s=en.createEmptyBand(i,n),o=new Map;for(let a=0;as?e[a]=0:r[a]=o?Math.round(l):l}}function N6i(t,e,i={}){L6i();let r=QNi(t,e>=66&&e<=75);const{outputPixelType:n="f32"}=i,s=!Ud.has(e)||i.processAsMultiband,o=s?t[0].pixels.length:1,a=[];for(let c=0;cv.pixels):t.map(v=>v.pixels[c]);let p,y=!0;if(e===e_t.setNull){const v=F6i(d,r,n);p=v.band,r=v.mask,y=!1}else Xl.has(e)?p=Xl.get(e)(d,r,"f64"):em.has(e)?p=e===gS.asin||e===gS.acos||e===gS.atanh?a6i(d,r,"f64",e):l6i(d,r,"f64",em.get(e)):$pe.has(e)?p=u6i(d,r,"f64",$pe.get(e)):Ud.has(e)?p=Ud.get(e)(d,r,"f64"):(p=d[0],y=!1);if(y&&e!==$_.isNull&&!vg.has(e)){const v=en.createEmptyBand(n,p.length);r||(r=new Uint8Array(p.length).fill(255)),k6i(p,r,n,v),p=v}a.push(p)}const l=t[0];return new en({width:l.width,height:l.height,pixelType:n,mask:e===$_.isNull?null:r,pixels:a})}let SU=class extends fb{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:e}=this,i=e[0],{bandCount:r}=i,{processAsMultiband:n}=this.functionArguments;if(e.some(d=>d.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=s_t[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}`};this.outputPixelType=this._getOutputPixelType("f32");const l=i.clone();l.pixelType=this.outputPixelType,l.statistics=null,l.histograms=null,l.colormap=null,l.attributeTable=null,l.bandCount=a!==999||n?r:1;const c=ZNi(s);if(c){l.statistics=[];for(let d=0;d16)}}_processPixels(e){const{pixelBlocks:i}=e;return lt(i)||i.some(r=>lt(r))?null:N6i(i,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:e}=this.functionArguments,i=s_t[e],r=Object.keys(t_t).find(l=>t_t[l]===e)?.toLowerCase()??"undefined",n=this.outputPixelType??"f32";let[s,o]=sT(n);const a=n.startsWith("u")||n.startsWith("s");return a&&(s-=1e-4,o+=1e-4),{imageCount:i,operationName:r,domainRange:[s,o],isOutputRounded:a}}};E([k({json:{write:!0,name:"rasterFunction"}})],SU.prototype,"functionName",void 0),E([k({type:JNi,json:{write:!0,name:"rasterFunctionArguments"}})],SU.prototype,"functionArguments",void 0),E([k()],SU.prototype,"rasterArgumentNames",void 0),SU=E([ht("esri.layers.support.rasterFunctions.LocalFunction")],SU);const $6i=SU;var VFe;let e6=VFe=class extends pb{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=rae.matchAny}get normalizedNoDataValues(){const{noDataValues:t}=this;if(!t?.length)return null;let e=!1;const i=t.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?i:null}clone(){return new VFe({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};E([k({json:{write:!0}})],e6.prototype,"includedRanges",void 0),E([k({json:{write:!0}})],e6.prototype,"noDataValues",void 0),E([k()],e6.prototype,"normalizedNoDataValues",null),E([k({json:{write:!0}})],e6.prototype,"noDataInterpretation",void 0),e6=VFe=E([ht("esri.layers.support.rasterFunctions.MaskFunctionArguments")],e6);const B6i=e6;let t6=class extends fb{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const e=this.sourceRasterInfos[0].clone(),{pixelType:i}=e;this.outputPixelType=this._getOutputPixelType(i),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*tM)&&(!n||o&&n[0].length<=tM)}}_processPixels(e){const i=e.pixelBlocks?.[0];if(lt(i))return null;const{outputPixelType:r,lookups:n}=this,{includedRanges:s,noDataInterpretation:o,normalizedNoDataValues:a}=this.functionArguments,l=o===rae.matchAll;return gYt(i,{includedRanges:s,noDataValues:a,outputPixelType:r,matchAll:l,lookups:n})}_getWebGLParameters(){const{includedRanges:e,normalizedNoDataValues:i}=this.functionArguments,r=new Float32Array(tM);r.fill(oA),i?.[0]?.length&&r.set(i[0]);const n=new Float32Array(tM);for(let s=0;se[n])}};E([k({json:{write:!0,name:"rasterFunction"}})],TU.prototype,"functionName",void 0),E([k({type:V6i,json:{write:!0,name:"rasterFunctionArguments"}})],TU.prototype,"functionArguments",void 0),E([k()],TU.prototype,"rasterArgumentNames",void 0),TU=E([ht("esri.layers.support.rasterFunctions.NDVIFunction")],TU);const U6i=TU;var jFe;let qD=jFe=class extends pb{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new jFe({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};E([k({json:{write:!0}})],qD.prototype,"inputRanges",void 0),E([k({json:{write:!0}})],qD.prototype,"outputValues",void 0),E([k({json:{write:!0}})],qD.prototype,"noDataRanges",void 0),E([k({json:{write:!0}})],qD.prototype,"allowUnmatched",void 0),E([k({json:{write:!0}})],qD.prototype,"isLastInputRangeInclusive",void 0),qD=jFe=E([ht("esri.layers.support.rasterFunctions.RemapFunctionArguments")],qD);const j6i=qD;let i6=class extends fb{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const e=this.sourceRasterInfos[0].clone(),{pixelType:i}=e;this.outputPixelType=this._getOutputPixelType(i),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(ye(r)&&r.length&&s?.length)if(n){const c=Math.min.apply(null,[...s,r[0].min]),d=Math.max.apply(null,[...s,r[0].max]);e.statistics=[{...r[0],min:c,max:d}]}else{let c=s[0],d=c;for(let p=0;ps[p]?s[p]:c,d=d>s[p]?d:s[p];e.statistics=[{...r[0],min:c,max:d}]}return this.rasterInfo=e,this.lookup=n?null:yYt({srcPixelType:i,inputRanges:o,outputValues:s,noDataRanges:a,allowUnmatched:n,isLastInputRangeInclusive:l,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!s||s.length<=tM)&&(!a||a.length<=tM)}}_processPixels(e){const i=e.pixelBlocks?.[0];if(lt(i))return null;const{lookup:r,outputPixelType:n}=this;if(r){const d=oae(i,{lut:[r.lut],offset:r.offset,outputPixelType:n});return ye(d)&&r.mask&&(d.mask=yCe(i.pixels[0],i.mask,r.mask,r.offset,"u8")),d}const{inputRanges:s,outputValues:o,noDataRanges:a,allowUnmatched:l,isLastInputRangeInclusive:c}=this.functionArguments;return mYt(i,{inputRanges:s,outputValues:o,noDataRanges:a,outputPixelType:n,allowUnmatched:l,isLastInputRangeInclusive:c})}_getWebGLParameters(){const{allowUnmatched:e,inputRanges:i,outputValues:r,noDataRanges:n,isLastInputRangeInclusive:s}=this.functionArguments,o=new Float32Array(3*tM),a=1e-5,l=r.length;if(i?.length){let d=0,p=0;for(let y=0;y0&&(o[y]-=a),(p=1?e*q6i:e,slopeType:i,pixelSizeFactor:r??0,pixelSizePower:n??0}}};E([k({json:{write:!0,name:"rasterFunction"}})],r6.prototype,"functionName",void 0),E([k({type:W6i,json:{write:!0,name:"rasterFunctionArguments"}})],r6.prototype,"functionArguments",void 0),E([k()],r6.prototype,"rasterArgumentNames",void 0),E([k({json:{write:!0}})],r6.prototype,"isGCS",void 0),r6=E([ht("esri.layers.support.rasterFunctions.SlopeFunction")],r6);const Y6i=r6;var HFe;let n6=HFe=class extends pb{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(t,e){if(!t?.length)return null;const i=[];return t.forEach(r=>{const n={min:r.min,max:r.max,avg:r.avg??r.mean,stddev:r.stddev??r.standardDeviation};i.push(n)}),i}writeStatistics(t,e,i){if(!t?.length)return;const r=[];t.forEach(n=>{const s={...n,mean:n.avg,standardDeviation:n.stddev};delete s.avg,delete s.stddev,r.push(s)}),e[i]=r}clone(){return new HFe({statistics:hi(this.statistics),histograms:hi(this.histograms)})}};E([k({json:{write:!0}})],n6.prototype,"statistics",void 0),E([Li("statistics")],n6.prototype,"readStatistics",null),E([mr("statistics")],n6.prototype,"writeStatistics",null),E([k({json:{write:!0}})],n6.prototype,"histograms",void 0),n6=HFe=E([ht("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],n6);const X6i=n6;let XD=class extends fb{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 i=e.clone(),{statistics:r,histograms:n}=this.functionArguments;return n&&(i.histograms=n),r&&(i.statistics=r),this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(e){return e.pixelBlocks?.[0]}};E([k({json:{write:!0,name:"rasterFunction"}})],XD.prototype,"functionName",void 0),E([k({type:X6i,json:{write:!0,name:"rasterFunctionArguments"}})],XD.prototype,"functionArguments",void 0),E([k()],XD.prototype,"rasterArgumentNames",void 0),E([k({json:{write:!0}})],XD.prototype,"indexedColormap",void 0),E([k()],XD.prototype,"isNoopProcess",void 0),XD=E([ht("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],XD);const K6i=XD;var WFe;const J6i=new Bs({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let py=WFe=class extends pb{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(t,e,i){t?.length&&(Array.isArray(t[0])||(t=t.map(r=>[r.min,r.max,r.avg,r.stddev])),e[i]=t)}clone(){return new WFe({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:hi(this.statistics),gamma:hi(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:hi(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};E([k({type:Boolean,json:{write:!0}})],py.prototype,"computeGamma",void 0),E([k({type:Boolean,json:{name:"dra",write:!0}})],py.prototype,"dynamicRangeAdjustment",void 0),E([k({type:[Number],json:{write:!0}})],py.prototype,"gamma",void 0),E([k()],py.prototype,"histograms",void 0),E([k({type:Number,json:{write:!0}})],py.prototype,"maxPercent",void 0),E([k({type:Number,json:{write:!0}})],py.prototype,"minPercent",void 0),E([k({type:Number,json:{write:!0}})],py.prototype,"numberOfStandardDeviations",void 0),E([k({type:Number,json:{name:"max",write:!0}})],py.prototype,"outputMax",void 0),E([k({type:Number,json:{name:"min",write:!0}})],py.prototype,"outputMin",void 0),E([k({type:Number,json:{write:!0}})],py.prototype,"sigmoidStrengthLevel",void 0),E([k({json:{type:[[Number]],write:!0}})],py.prototype,"statistics",void 0),E([mr("statistics")],py.prototype,"writeStatistics",null),E([Hr(J6i)],py.prototype,"stretchType",void 0),E([k({type:Boolean,json:{write:!0}})],py.prototype,"useGamma",void 0),py=WFe=E([ht("esri.layers.support.rasterFunctions.StretchFunctionArguments")],py);const Z6i=py;let KD=class extends fb{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:i}=e,{functionArguments:r}=this,{dynamicRangeAdjustment:n,gamma:s,useGamma:o}=r;if(!n&&["u8","u16","s8","s16"].includes(i)){const l=sM(r.toJSON(),{rasterInfo:e}),c=this._isOutputRoundingNeeded()?"round":"float";this.lookup=oTe({pixelType:i,...l,gamma:o?s:null,rounding:c}),this.cutOffs=l}else n||(this.cutOffs=sM(r.toJSON(),{rasterInfo:e}));this.outputPixelType=this._getOutputPixelType(i);const a=e.clone();return a.pixelType=this.outputPixelType,a.statistics=null,a.histograms=null,a.colormap=null,a.attributeTable=null,this.outputPixelType==="u8"&&(a.keyProperties.DataType="processed"),this.rasterInfo=a,{success:!0,supportsGPU:!n}}_processPixels(e){const i=e.pixelBlocks?.[0];if(lt(i))return i;const{lookup:r}=this;if(r)return oae(i,{...r,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:n}=this,s=this.cutOffs||sM(n.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:i}),o=n.useGamma?n.gamma:null;return Iae(i,{...s,gamma:o,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const{outputMin:e=0,outputMax:i=255,gamma:r,useGamma:n}=this.functionArguments,s=this.rasterInfo.bandCount>=2?3:1,o=n&&r&&r.length?uTe(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 c=new Float32Array(s);let d;for(d=0;d{r&&typeof r!="number"&&(typeof r=="string"?r.startsWith("http")&&(e.includes(r)||e.push(r)):"rasterFunctionArguments"in r&&b_t(r,e))})}function Bpe(t,e){if(e=e??{},"function"in(t=hi(t))&&"arguments"in t&&t.arguments&&(t=t$i(t,e)),"rasterFunction"in t)return x_t(t=qFe(t),e);throw new st("raster-function-helper","unsupported raster function json.")}function e$i(t,e){return e[0]==="rasters"&&Array.isArray(t.rasters)?t.rasters:e.map(i=>t[i])}function w_t(t){return!!(t&&typeof t=="object"&&t.rasterFunction&&t.rasterFunctionArguments)}function qFe(t){const{rasterFunction:e,rasterFunctionArguments:i}=t,r={};for(const n in i){let s=i[n];const o=n.toLowerCase();if(o==="rasters"&&Array.isArray(s))r.rasters=s.map(a=>w_t(a)?qFe(a):a);else switch(w_t(s)&&(s=qFe(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=["$$"]),{...t,rasterFunctionArguments:r}}function x_t(t,e){const{rasterFunction:i,rasterFunctionArguments:r}=t,n=t.outputPixelType?.toLowerCase();if(i==null||!Cv.has(i))throw new st("raster-function-helper",`unsupported raster function: ${i}`);const s=Cv.get(i),o=(typeof s.ctor=="function"?s.ctor:s.ctor.default).fromJSON({...t,outputPixelType:n}),{rasterArgumentNames:a}=o,l=[],c=e$i(r,a),d=a[0]==="rasters",p=[];for(let y=0;yYFe(e));if("value"in t&&["number","string","boolean"].includes(typeof t.value))return t.value;if(!("type"in t))return t;switch(t.type){case"Scalar":return t.value;case"AlgorithmicColorRamp":return C_t(t);case"MultiPartColorRamp":return{type:"multipart",colorRamps:t.ArrayOfColorRamp.map(C_t)};case"ArgumentArray":return t.elements?.length?t.elements[0].type==="RasterStatistics"?t.elements:t.elements[0].type==="RasterFunctionVariable"?t.elements.map(e=>e.value!=null?YFe(e.value):e.name.toLowerCase().includes("raster")?"$$":null):t:t.elements;default:return t}}function C_t(t){const e=t.algorithm??"esriHSVAlgorithm";let{FromColor:i,ToColor:r}=t;if(!Array.isArray(i)){const{r:n,g:s,b:o}=eM({h:i.Hue,s:i.Saturation,v:i.Value});i=[n,s,o,i.AlphaValue]}if(!Array.isArray(r)){const{r:n,g:s,b:o}=eM({h:r.Hue,s:r.Saturation,v:r.Value});r=[n,s,o,r.AlphaValue]}return{type:"algorithmic",algorithm:e,fromColor:i,toColor:r}}function t$i(t,e){e&&S_t(t,e);const i={};return T_t(t,i),i}function T_t(t,e){if(!t||!e)return;const{function:i,arguments:r}=t;if(!i||!r)return;e.rasterFunction=i.type.replace("Function",""),e.outputPixelType=i.pixelType;const n={};e.rasterFunctionArguments=n;for(const s in r){const o=r[s];typeof o=="object"&&("function"in o&&o.function&&o.arguments?(e.rasterFunctionArguments[s]={},T_t(o,e.rasterFunctionArguments[s])):"value"in o&&(n[s]=YFe(o.value)))}switch(n.DEM&&!n.Raster&&(n.Raster=n.DEM,delete n.DEM),e.rasterFunction){case"Stretch":i$i(n);break;case"Colormap":r$i(n);break;case"Convolution":n$i(n);break;case"Mask":s$i(n)}}function i$i(t){t.Statistics?.length&&typeof t.Statistics=="object"&&(t.Statistics=t.Statistics.map(e=>[e.min,e.max,e.mean,e.standardDeviation])),t.NumberOfStandardDeviation!=null&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}function r$i(t){t.ColorRamp?.type?.toLowerCase()==="randomcolorramp"&&(delete t.ColorRamp,t.ColormapName="Random"),t.ColorSchemeType===0&&delete t.ColorRamp}function n$i(t){t.ConvolutionType!=null&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}function s$i(t){t.NoDataValues?.length&&typeof t.NoDataValues[0]=="string"&&(t.NoDataValues=t.NoDataValues.filter(e=>e!=="").map(e=>Number(e)))}Cv.set("Aspect",{desc:"Aspect Function",ctor:eNi,rasterArgumentNames:["raster"]}),Cv.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:INi,rasterArgumentNames:["raster"]}),Cv.set("Colormap",{desc:"Colormap Function",ctor:NNi,rasterArgumentNames:["raster"]}),Cv.set("CompositeBand",{desc:"CompositeBand Function",ctor:BNi,rasterArgumentNames:["rasters"]}),Cv.set("Convolution",{desc:"Convolution Function",ctor:YNi,rasterArgumentNames:["raster"]}),Cv.set("ExtractBand",{desc:"ExtractBand Function",ctor:KNi,rasterArgumentNames:["raster"]}),Cv.set("Local",{desc:"Local Function",ctor:$6i,rasterArgumentNames:["rasters"]}),Cv.set("Mask",{desc:"Mask Function",ctor:G6i,rasterArgumentNames:["raster"]}),Cv.set("NDVI",{desc:"NDVI Function",ctor:U6i,rasterArgumentNames:["raster"]}),Cv.set("Remap",{desc:"Remap Function",ctor:z6i,rasterArgumentNames:["raster"]}),Cv.set("Slope",{desc:"Slope Function",ctor:Y6i,rasterArgumentNames:["raster"]}),Cv.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:K6i,rasterArgumentNames:["raster"]}),Cv.set("Stretch",{desc:"Stretch Function",ctor:Q6i,rasterArgumentNames:["raster"]});var XFe;function KFe(t,e,i){return!i_(t,e,i)}function EU(t,e,i){const r=KFe(t,e,i);if(r&&!lw())throw new st("rasterprojectionhelper-project","projection engine is not loaded");return r}(function(t){t[t.None=0]="None",t[t.North=1]="North",t[t.South=2]="South",t[t.Both=3]="Both"})(XFe||(XFe={}));const E_t=(t,e,i,r=0)=>{if(i[0]===1)return[0,0];let n=1,s=-1,o=1,a=-1;for(let O=0;Ot[O]?t[O]:n,s=s>t[O]?s:t[O],o=o>t[O+1]?t[O+1]:o,a=a>t[O+1]?a:t[O+1]);const{cols:l,rows:c}=e,d=(s-n)/l/i[0],p=(a-o)/c/i[1],y=2*r;let v=0,S=!1,I=[0,0];for(let O=0;Ov&&(v=Y+X,I=[Y,X]),y&&v>y){S=!0;break}}if(S)break}return I},o$i={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},Gpe=32,Vpe=4,JFe=Vpe,ZFe=new Map,QFe=new Map,Upe=500;async function e4e(){lw()||await P2()}function I_t(t,e,i){return EU(t.spatialReference,e)?i?USe(e,t.spatialReference,t):USe(t.spatialReference,e,t):null}function VJ(t,e,i,r=null){const n=t.spatialReference;if(n.equals(e))return t;EU(n,e,r);const s=i.center,o=new vr({xmin:s.x-t.x/2,xmax:s.x+t.x/2,ymin:s.y-t.y/2,ymax:s.y+t.y/2,spatialReference:n}),a=rp(o,e,r),l=Tv(e);let c;if(lt(a)||ye(l)&&a.width>=l){const d=Vc(n)/Vc(e);c={x:t.x*d,y:t.y*d}}else c={x:a.width,y:a.height};return c}function Jw(t,e=.01){return Vc(t)?e/Vc(t):0}function jpe(t,e,i=null,r=!0){const n=t.spatialReference;if(n.equals(e))return t;EU(n,e,i);const s=rp(t,e,i);return r&&s&&A_t([t],[s],n,e),s}function A_t(t,e,i,r){const n=zpe(i,!0),s=zpe(r,!0),o=Jw(i,Upe),a=Jw(r,Upe);if(o&&ye(n)&&ye(s))for(let l=0;l=s[1]-a&&Math.abs(d-n[0])new Yi(a[0],a[1],i)),o=rp(s,r,n);return n&&A_t(s,o,i,r),o.map(a=>a?[a.x,a.y]:[NaN,NaN])}function P_t(t){const{inSR:e,outSR:i,datumTransformation:r}=t,n=s6(e),{points:s,mask:o}=t4e(t,n);if(!e.isGeographic){const l=e.wkid?B1.coordsys(e.wkid):B1.fromString(e.isGeographic?xu.PE_TYPE_GEOGCS:xu.PE_TYPE_PROJCS,e.wkt);Gq.projToGeog(l,s.length,s)}if(ye(r)&&r.steps.length){let l;if(i.isGeographic&&(l=s.map(([d])=>d>179.9955?1:d<-179.9955?-1:0)),r.steps.forEach(d=>{const p=d.wkid?B1.geogtran(d.wkid):B1.fromString(xu.PE_TYPE_GEOGTRAN,d.wkt);Boe.geogToGeog(p,s.length,s,null,d.isInverse?xu.PE_TRANSFORM_2_TO_1:xu.PE_TRANSFORM_1_TO_2)}),l)for(let d=0;d179.9955?1:y<-179.9955?-1:0;p&&v&&p!==v&&(s[d][0]=p>0?y+360:y-360)}}if(!i.isGeographic){const l=s6(i,!0),c=ye(l)&&l.isEnvelope?[l.bbox[1],l.bbox[3]]:[-90,90];c$i(s,c);const d=i.wkid?B1.coordsys(i.wkid):B1.fromString(i.isGeographic?xu.PE_TYPE_GEOGCS:xu.PE_TYPE_PROJCS,i.wkt);Gq.geogToProj(d,s.length,s)}let a=s;if(o&&s.length!==o.length){a=[];for(let l=0,c=0;lO.getInclusive()===1&&O.getKind()===1);if(!o){if(o=n.find(O=>O.getInclusive()===1&&O.getKind()===0),!o)return null;s=!0}const a=i?0:(r.getNorthPoleLocation()===2?1:0)|(r.getSouthPoleLocation()===2?2:0),l=r.isPannableRectangle(),c=o.getCoord();if(s)return{isEnvelope:s,isPannable:l,vertices:c,coef:null,bbox:[c[0][0]-e,c[0][1]-e,c[1][0]+e,c[1][1]+e],poleLocation:a};let d=0;const p=[];let[y,v]=c[0],[S,I]=c[0];for(let O=0,L=c.length;ON?S:N,I=I>G?I:G}return{isEnvelope:!1,isPannable:l,vertices:c,coef:p,bbox:[y,v,S,I],poleLocation:a}}function t4e(t,e){const i=[],{cols:r,rows:n,xres:s,yres:o,usePixelCenter:a}=t;let{xmin:l,ymax:c}=t;if(a&&(l+=s/2,c-=o/2),lt(e)){for(let v=0;v=v&&G<=I;for(let Y=0;Y=S&&X<=O&&(i.push([G,X]),d[N]=1)}}return{points:i,mask:d}}const p=e.coef,y=[];for(let v=0;v=Y&&S<=X){const re=G*S+V;I.push(re),O.push(te)}}let L=I;if(I.length>2){let N=O[0]===2?0:O[0],G=I[0];L=[];for(let V=1;VV-Y)}else I[0]>I[1]&&(L=[I[1],I[0]]);y.push(L)}for(let v=0,S=0;v=N[0]&&I<=N[1]&&(i.push([I,L]),d[S]=1);else if(N.length>2){let G=!1;for(let V=0;V=N[V]&&I<=N[V+1]){G=!0;break}G&&(i.push([I,L]),d[S]=1)}}}return{points:i,mask:d}}function c$i(t,e){const[i,r]=e;for(let n=0;nr)&&(t[n]=[NaN,NaN])}}function R_t(t){const e=Tv(t[0].spatialReference);if(t.length<2||lt(e))return t[0];let{xmin:i,xmax:r,ymin:n,ymax:s}=t[0];for(let o=1;oJw(n)){const{xmin:c,xmax:d}=t;for(let p=0;p<=s;p++){const y=p===0?c:-o/2,v=p===s?d-o*p:o/2;l[p]=new vr({xmin:y,xmax:v,ymin:t.ymin,ymax:t.ymax,spatialReference:n})}}return R_t(l.map(c=>M_t(c,e,i,r)).filter(ye))}function h$i(t,e){const i=Tv(e);if(lt(i))return null;let{xmin:r,ymin:n,xmax:s,ymax:o}=t;const a=t.spatialReference,l=new po({spatialReference:a,rings:[[[r,n],[s,n],[s,o],[r,o],[r,n]]]}),c=rp(l,e);if(c.rings.length!==2||!c.rings[0].length||!c.rings[1].length)return null;const{rings:d}=c,p=Jw(a),y=new vr({spatialReference:e});for(let v=0;v<2;v++){r=s=d[v][0][0],n=o=d[v][0][1];for(let S=0;Sd[v][S][0]?d[v][S][0]:r,s=sd[v][S][1]?d[v][S][1]:n,o=o=o.ymax))return null;if(!r||!o)return o;const a=zpe(s,!0),l=zpe(e,!0);if(lt(a)||lt(l))return o;const c=Jw(s,.001),d=Jw(s,Upe),p=Jw(e,.001);if(Math.abs(o.xmin-l[0])d){o.xmin=l[0];const S=[];S.push(new Yi(t.xmax,t.ymin,s)),S.push(new Yi(t.xmax,(t.ymin+t.ymax)/2,s)),S.push(new Yi(t.xmax,t.ymax,s));const I=S.map(O=>jpe(O,e,i)).filter(O=>!isNaN(O?.x)).map(O=>O.x);o.xmax=Math.max.apply(null,I)}if(vd){o.xmax=l[1];const S=[];S.push(new Yi(t.xmin,t.ymin,s)),S.push(new Yi(t.xmin,(t.ymin+t.ymax)/2,s)),S.push(new Yi(t.xmin,t.ymax,s));const I=S.map(O=>jpe(O,e,i)).filter(O=>!isNaN(O?.x)).map(O=>O.x);o.xmin=Math.min.apply(null,I)}}else{const y=Jw(e,.001);Math.abs(o.xmin-l[0])0&&r.outofBoundPointCountJFe)&&(KFe(l,c,t.datumTransformation)&&(l.isGeographic||ye(s6(l))),i=[Vpe,Vpe],r=r4e({...t,spacing:i}),n={cols:r.size[0]+1,rows:r.size[1]+1},o=E_t(r.offsets,n,i,JFe)),r.error=o,i[0]>1&&(r.coefficients=F_t(r.offsets,n,s)),t.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(c.isGeographic)r.gcsGrid={offsets:r.offsets,coefficients:r.coefficients,spacing:i};else{const d=s6(l);if(ye(d)&&!d.isEnvelope){const p=p$i(l),y=JD(t.projectedExtent,p),{offsets:v}=r4e({...t,srcBufferExtent:y,spacing:i}),S=F_t(v,n,s);r.gcsGrid={offsets:v,coefficients:S,spacing:i}}}return r}function r4e(t){const{projectedExtent:e,srcBufferExtent:i,pixelSize:r,datumTransformation:n,rasterTransform:s}=t,o=e.spatialReference,a=i.spatialReference,l=EU(o,a),{xmin:c,ymin:d,xmax:p,ymax:y}=e,v=Tv(a),S=ye(v)&&(t.hasWrapAround||s?.type==="gcs-shift"),I=t.spacing||[Gpe,Gpe],O=I[0]*r.x,L=I[1]*r.y,N=I[0]===1,G=Math.ceil((p-c)/O-.1/I[0])+(N?0:1),V=Math.ceil((y-d)/L-.1/I[1])+(N?0:1),Y=a$i({cols:G,rows:V,xmin:c,ymax:y,xres:O,yres:L,inSR:o,outSR:a,datumTransformation:n,preferPE:I[0]<=Vpe,usePixelCenter:N}),X=[];let te,re=0;const fe=N?-1:NaN,{xmin:ge,xmax:_e,ymax:Ie,width:ke,height:Ne}=i,J=Jw(a,Upe),he=ye(v)&&ge>0&&_e>v/2;let xe=!1;if(l){const Pe=s6(o);xe=ye(Pe)&&Pe.poleLocation>0}for(let Pe=0;Pe_e&&ze[0]>v/2-J?ze[0]-=v:S&&Pe===0&&ze[0]<0&&he&&!s&&(ze[0]+=v),!ze||isNaN(ze[0])||isNaN(ze[1]))X.push(fe),X.push(fe),Oe.push(null),re++;else{if(s){const Ge=s.inverseTransform(new Yi({x:ze[0],y:ze[1],spatialReference:a}));ze=[Ge.x,Ge.y]}Oe.push(ze),Pe>0&&S&&te[Ae]&&ze[0]_e&&ze[0]>v&&(ze[0]-=v)),X.push((ze[0]-ge)/ke),X.push((Ie-ze[1])/Ne)}}te=Oe}return{offsets:X,error:null,coefficients:null,outofBoundPointCount:re,spacing:I,size:N?[G,V]:[G-1,V-1]}}function F_t(t,e,i){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;l=S)s=a.length,o=y/S>8;else{let L,N=I;for(let G=1;G<=a.length;G++){if(L=(a[G-1].x+a[G-1].y)/2,y<=L){y===L?s=G:i==="down"?(s=G-1,o=y/N>8):s=i==="up"||y-N>L-y||y/N>2?G:G-1;break}N=L}}const O=s===0?n:a[s-1];return o&&Math.min(O.x,O.y)*Vc(e.spatialReference)>19567&&(o=!1),{pyramidLevel:s,pyramidResolution:new Yi({x:O.x,y:O.y,spatialReference:e.spatialReference}),excessiveReading:o}}const l=Math.log(t.x/n.x)/Math.LN2,c=Math.log(t.y/n.y)/Math.LN2,d=e.storageInfo.maximumPyramidLevel||0;s=i==="down"?Math.floor(Math.min(l,c)):i==="up"?Math.ceil(Math.max(l,c)):Math.round((l+c)/2),s<0?s=0:s>d&&(o=s>d+3,s=d);const p=2**s;return{pyramidLevel:s,pyramidResolution:new Yi({x:p*e.nativePixelSize.x,y:p*e.nativePixelSize.y,spatialReference:e.spatialReference}),excessiveReading:o}}function m$i(t,e,i=512,r=!0){const{extent:n,spatialReference:s,pixelSize:o}=t,a=VJ(new Yi({x:o.x,y:o.y,spatialReference:s}),e,n);if(a==null)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const l=(a.x+a.y)/2,c=Vc(e),d=l*c*96*39.37,p=e.isGeographic?256/i*2958287637958547e-7:256/i*591657527591555e-6;let y=t.dataType==="vector-magdir"||t.dataType==="vector-uv";const v=JD(n,e),S=Math.min(Math.ceil(Math.log(Math.min(t.width,t.height)/32)/Math.LN2),Math.ceil(Math.log(p/2/d)/Math.LN2));if(!y&&r&&(e.isGeographic||e.isWebMercator)&&(y=v.xmin*v.xmax<0,!y&&S<3)){const te=Tv(e);if(ye(te)){const re=2**S*l*i,fe=Math.ceil(te/re);y=fe===1||fe===2&&te/2-v.xmax=X;)O/=N,I.x/=N,I.y/=N,G.push(O),V.push({x:I.x,y:I.y});return{projectedPixelSize:a,scales:G,srcResolutions:V,isCustomTilingScheme:!y}}let UJ=class extends Ni{get affectsPixelSize(){return!1}forwardTransform(e){return e}inverseTransform(e){return e}};E([k()],UJ.prototype,"affectsPixelSize",null),E([k({json:{write:!0}})],UJ.prototype,"spatialReference",void 0),UJ=E([ht("esri.layers.support.rasterTransforms.BaseRasterTransform")],UJ);const s4e=UJ;let jJ=class extends s4e{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(e){return(e=e.clone()).type==="point"?(e.x>180+this.tolerance&&(e.x-=360),e):(e.xmin>=180-this.tolerance?(e.xmax-=360,e.xmin-=360):e.xmax>180+this.tolerance&&(e.xmin=-180,e.xmax=180),e)}inverseTransform(e){return(e=e.clone()).type==="point"?(e.x<-this.tolerance&&(e.x+=360),e):(e.xmin<-this.tolerance&&(e.xmin+=360,e.xmax+=360),e)}};E([Hr({GCSShiftXform:"gcs-shift"})],jJ.prototype,"type",void 0),E([k()],jJ.prototype,"tolerance",void 0),jJ=E([ht("esri.layers.support.rasterTransforms.GCSShiftTransform")],jJ);const L_t=jJ;let Wpe=class extends s4e{constructor(){super(...arguments),this.type="identity"}};E([Hr({IdentityXform:"identity"})],Wpe.prototype,"type",void 0),Wpe=E([ht("esri.layers.support.rasterTransforms.IdentityTransform")],Wpe);const g$i=Wpe;function o4e(t,e,i){const{x:r,y:n}=e;if(i<2)return{x:t[0]+r*t[2]+n*t[4],y:t[1]+r*t[3]+n*t[5]};if(i===2){const y=r*r,v=n*n,S=r*n;return{x:t[0]+r*t[2]+n*t[4]+y*t[6]+S*t[8]+v*t[10],y:t[1]+r*t[3]+n*t[5]+y*t[7]+S*t[9]+v*t[11]}}const s=r*r,o=n*n,a=r*n,l=s*r,c=s*n,d=r*o,p=n*o;return{x:t[0]+r*t[2]+n*t[4]+s*t[6]+a*t[8]+o*t[10]+l*t[12]+c*t[14]+d*t[16]+p*t[18],y:t[1]+r*t[3]+n*t[5]+s*t[7]+a*t[9]+o*t[11]+l*t[13]+c*t[15]+d*t[17]+p*t[19]}}function k_t(t,e,i){const{xmin:r,ymin:n,xmax:s,ymax:o,spatialReference:a}=e;let l=[];if(i<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 p=10;for(let y=0;yo4e(t,p,i));const c=l.map(p=>p.x),d=l.map(p=>p.y);return new vr({xmin:Math.min.apply(null,c),xmax:Math.max.apply(null,c),ymin:Math.min.apply(null,d),ymax:Math.max.apply(null,d),spatialReference:a})}function y$i(t){const[e,i,r,n,s,o]=t,a=r*o-s*n,l=s*n-r*o;return[(s*i-e*o)/a,(r*i-e*n)/l,o/a,n/l,-s/a,-r/l]}let Zw=class extends s4e{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(e,i){const{coeffX:r,coeffY:n}=i;if(!r?.length||!n?.length||r.length!==n.length)return null;const s=[];for(let o=0;o0}forwardTransform(e){if(e.type==="point"){const i=o4e(this.forwardCoefficients,e,this.polynomialOrder);return new Yi({x:i.x,y:i.y,spatialReference:e.spatialReference})}return k_t(this.forwardCoefficients,e,this.polynomialOrder)}inverseTransform(e){if(e.type==="point"){const i=o4e(this.inverseCoefficients,e,this.polynomialOrder);return new Yi({x:i.x,y:i.y,spatialReference:e.spatialReference})}return k_t(this.inverseCoefficients,e,this.polynomialOrder)}};E([k({json:{write:!0}})],Zw.prototype,"polynomialOrder",void 0),E([k()],Zw.prototype,"forwardCoefficients",void 0),E([Li("forwardCoefficients",["coeffX","coeffY"])],Zw.prototype,"readForwardCoefficients",null),E([mr("forwardCoefficients")],Zw.prototype,"writeForwardCoefficients",null),E([k({json:{write:!0}})],Zw.prototype,"inverseCoefficients",null),E([Li("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],Zw.prototype,"readInverseCoefficients",null),E([mr("inverseCoefficients")],Zw.prototype,"writeInverseCoefficients",null),E([k()],Zw.prototype,"affectsPixelSize",null),E([Hr({PolynomialXform:"polynomial"})],Zw.prototype,"type",void 0),Zw=E([ht("esri.layers.support.rasterTransforms.PolynomialTransform")],Zw);const qpe=Zw,N_t={GCSShiftXform:L_t,IdentityXform:g$i,PolynomialXform:qpe},v$i=Object.keys(N_t);function _$i(t){const e=t?.type;return!t||v$i.includes(e)}function $_t(t){if(!t?.type)return null;const i=N_t[t?.type];if(i){const r=new i;return r.read(t),r}return null}const b$i=Object.freeze(Object.defineProperty({__proto__:null,default:class{convertVectorFieldData(e){const i=en.fromJSON(e.pixelBlock),r=yB(i,e.type);return Promise.resolve(ye(r)?r.toJSON():null)}async decode(e){const i=await Eae(e.data,e.options);return i&&i.toJSON()}symbolize(e){e.pixelBlock=en.fromJSON(e.pixelBlock),e.extent=e.extent?vr.fromJSON(e.extent):null;const i=this.symbolizer.symbolize(e);return Promise.resolve(ye(i)?i.toJSON():null)}async updateSymbolizer(e){this.symbolizer=cTe.fromJSON(e.symbolizerJSON),e.histograms&&this.symbolizer?.rendererJSON.type==="rasterStretch"&&(this.symbolizer.rendererJSON.histograms=e.histograms)}async updateRasterFunction(e){this.rasterFunction=Bpe(e.rasterFunctionJSON)}async process(e){const i=this.rasterFunction.process({extent:vr.fromJSON(e.extent),primaryPixelBlocks:e.primaryPixelBlocks.map(r=>ye(r)?en.fromJSON(r):null),primaryRasterIds:e.primaryRasterIds});return ye(i)?i.toJSON():null}stretch(e){const i=this.symbolizer.simpleStretch(en.fromJSON(e.srcPixelBlock),e.stretchParams);return Promise.resolve(ye(i)&&i.toJSON())}estimateStatisticsHistograms(e){const i=aTe(en.fromJSON(e.srcPixelBlock));return Promise.resolve(i)}split(e){const i=WXe(en.fromJSON(e.srcPixelBlock),e.tileSize,e.maximumPyramidLevel);return i&&i.forEach((r,n)=>{i.set(n,r?.toJSON())}),Promise.resolve(i)}async mosaicAndTransform(e){const i=e.srcPixelBlocks.map(o=>o?new en(o):null),r=rY(i,e.srcMosaicSize,{blockWidths:e.blockWidths,alignmentInfo:e.alignmentInfo,clipOffset:e.clipOffset,clipSize:e.clipSize});let n,s=r;return e.coefs&&(s=XXe(r,e.destDimension,e.coefs,e.sampleSpacing,e.interpolation)),e.projectDirections&&e.gcsGrid&&(n=YXe(e.destDimension,e.gcsGrid),s=ZXe(s,e.isUV?"vector-uv":"vector-magdir",n)),{pixelBlock:s?.toJSON(),localNorthDirections:n}}async createFlowMesh(e,i){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 GTe(e.meshType,e.simulationSettings,r,i.signal);return{result:{vertexBuffer:n.buffer,indexBuffer:s.buffer},transferList:[n.buffer,s.buffer]}}async getProjectionOffsetGrid(e){const i=vr.fromJSON(e.projectedExtent),r=vr.fromJSON(e.srcBufferExtent);let n=null;e.datumTransformationSteps&&(n=new zoe({steps:e.datumTransformationSteps})),(e.includeGCSGrid||KFe(i.spatialReference,r.spatialReference,n))&&await e4e();const s=e.rasterTransform?$_t(e.rasterTransform):null;return i4e({...e,projectedExtent:i,srcBufferExtent:r,datumTransformation:n,rasterTransform:s})}}},Symbol.toStringTag,{value:"Module"}));let IU=class{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return this._itemsPtr===0&&L8(()=>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*B_t);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;ethis._reset());const e=Math.floor(this._itemsPtr/this._itemsPerBuffer);for(;this._buffers.length<=e;){const i=new ArrayBuffer(this._itemsPerBuffer*this._itemByteSize);for(let r=0;re;)this._buffers.pop(),this._items.length=this._buffers.length*this._itemsPerBuffer;this._itemsPtr=0}static createVec2f64(e=PU){return new O8(16,Dit,e)}static createVec3f64(e=PU){return new O8(24,VUe,e)}static createVec4f64(e=PU){return new O8(32,bze,e)}static createMat3f64(e=PU){return new O8(72,dyt,e)}static createMat4f64(e=PU){return new O8(128,pyt,e)}static createQuatf64(e=PU){return new O8(32,yyt,e)}get test(){return{size:this._buffers.length*this._itemsPerBuffer*this._itemByteSize}}};const PU=4*K5.KILOBYTES;AU.createVec2f64();const ZD=AU.createVec3f64();AU.createVec4f64(),AU.createMat3f64();const w$i=AU.createMat4f64();AU.createQuatf64();function Ype(t){return t?{origin:Ff(t.origin),vector:Ff(t.vector)}:{origin:Qr(),vector:Qr()}}function x$i(t,e,i=Ype()){return Hv(i.origin,t),bc(i.vector,e,t),i}function S$i(t,e,i){return C$i(t,e,0,1,i)}function C$i(t,e,i,r,n){const{vector:s,origin:o}=t,a=bc(ZD.get(),e,o),l=Kb(s,a)/vne(s);return Gh(n,s,Hl(l,i,r)),Uc(n,n,t.origin)}new IU(()=>Ype());var OU;(function(t){t[t.X=0]="X",t[t.Y=1]="Y",t[t.Z=2]="Z"})(OU||(OU={}));function a4e(t){return t?G_t(Ff(t.origin),Ff(t.direction)):G_t(Qr(),Qr())}function G_t(t,e){return{origin:t,direction:e}}function V_t(t,e){const i=E$i.get();return i.origin=t,i.direction=e,i}function T$i(t,e,i){const r=Kb(t.direction,bc(i,e,t.origin));return Uc(i,t.origin,Gh(i,t.direction,r)),i}const E$i=new IU(()=>a4e());function I$i(t,e){const i=Kb(t,e)/(zv(t)*zv(e));return-Y1e(i)}function Qw(){return yA()}function RU(t,e=Qw()){return j1e(e,t)}function A$i(t,e){return Z0(t[0],t[1],t[2],e)}function P$i(t){return t}function O$i(t){t[0]=t[1]=t[2]=t[3]=0}function R$i(t,e){return t[0]=t[1]=t[2]=0,t[3]=e,t}function o6(t){return t[3]}function M$i(t){return t}function D$i(t,e,i,r){return Z0(t,e,i,r)}function F$i(t,e,i){return t!==i&&Hv(i,t),i[3]=t[3]+e,i}function L$i(t,e,i){return Ei.getLogger("esri.geometry.support.sphere").error("sphere.setExtent is not yet supported"),t===i?i:RU(t,i)}function Xpe(t,e,i){if(lt(e))return!1;const{origin:r,direction:n}=e,s=k$i;s[0]=r[0]-t[0],s[1]=r[1]-t[1],s[2]=r[2]-t[2];const o=n[0]*n[0]+n[1]*n[1]+n[2]*n[2];if(o===0)return!1;const a=2*(n[0]*s[0]+n[1]*s[1]+n[2]*s[2]),l=a*a-4*o*(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]-t[3]*t[3]);if(l<0)return!1;const c=Math.sqrt(l);let d=(-a-c)/(2*o);const p=(-a+c)/(2*o);return(d<0||p0)&&(d=p),!(d<0)&&(i&&(i[0]=r[0]+n[0]*d,i[1]=r[1]+n[1]*d,i[2]=r[2]+n[2]*d),!0)}const k$i=Qr();function l4e(t,e){return Xpe(t,e,null)}function N$i(t,e,i){if(Xpe(t,e,i))return i;const r=U_t(t,e,ZD.get());return Uc(i,e.origin,Gh(ZD.get(),e.direction,rR(e.origin,r)/zv(e.direction))),i}function U_t(t,e,i){const r=ZD.get(),n=w$i.get();t2(r,e.origin,e.direction);const s=o6(t);t2(i,r,e.origin),Gh(i,i,1/zv(i)*s);const o=z_t(t,e.origin),a=I$i(e.origin,i);return r2e(n,a+o,r),i2(i,i,n),i}function $$i(t,e,i){return Xpe(t,e,i)?i:(T$i(e,t,i),j_t(t,i,i))}function j_t(t,e,i){const r=bc(ZD.get(),e,t),n=Gh(ZD.get(),r,t[3]/zv(r));return Uc(i,n,t)}function B$i(t,e){const i=bc(ZD.get(),e,t),r=vne(i),n=t[3]*t[3];return Math.sqrt(Math.abs(r-n))}function z_t(t,e){const i=bc(ZD.get(),e,t),r=zv(i),n=o6(t),s=n+Math.abs(n-r);return Y1e(n/s)}const u4e=Qr();function H_t(t,e,i,r){const n=bc(u4e,e,t);switch(i){case OU.X:{const s=cje(n,u4e)[2];return xl(r,-Math.sin(s),Math.cos(s),0)}case OU.Y:{const s=cje(n,u4e),o=s[1],a=s[2],l=Math.sin(o);return xl(r,-l*Math.cos(a),-l*Math.sin(a),Math.cos(o))}case OU.Z:return zy(r,n);default:return}}function W_t(t,e){const i=bc(h4e,e,t);return zv(i)-t[3]}function G$i(t,e,i,r){const n=W_t(t,e),s=H_t(t,e,OU.Z,h4e),o=Gh(h4e,s,i-n);return Uc(r,e,o)}function c4e(t,e){const i=q8(t,e),r=o6(t);return i<=r*r}const h4e=Qr(),V$i=Qw();Object.freeze(Object.defineProperty({__proto__:null,altitudeAt:W_t,angleToSilhouette:z_t,axisAt:H_t,clear:O$i,closestPoint:$$i,closestPointOnSilhouette:U_t,containsPoint:c4e,copy:RU,create:Qw,distanceToSilhouette:B$i,elevate:F$i,fromCenterAndRadius:A$i,fromRadius:R$i,fromValues:D$i,getCenter:M$i,getRadius:o6,intersectRay:Xpe,intersectRayClosestSilhouette:N$i,intersectsRay:l4e,projectPoint:j_t,setAltitudeAt:G$i,setExtent:L$i,tmpSphere:V$i,wrap:P$i},Symbol.toStringTag,{value:"Module"}));function q_t(t){return t?{ray:a4e(t.ray),c0:t.c0,c1:t.c1}:{ray:a4e(),c0:0,c1:Number.MAX_VALUE}}new IU(()=>q_t());var zJ;(function(t){t[t.NONE=0]="NONE",t[t.CLAMP=1]="CLAMP",t[t.INFINITE_MIN=4]="INFINITE_MIN",t[t.INFINITE_MAX=8]="INFINITE_MAX"})(zJ||(zJ={})),zJ.INFINITE_MIN|zJ.INFINITE_MAX,zJ.INFINITE_MAX;function Kpe(t,e){for(let i=0;i=e[3])return!1}return!0}var Y_t,td;(function(t){t[t.LEFT=0]="LEFT",t[t.RIGHT=1]="RIGHT",t[t.BOTTOM=2]="BOTTOM",t[t.TOP=3]="TOP",t[t.NEAR=4]="NEAR",t[t.FAR=5]="FAR"})(Y_t||(Y_t={})),function(t){t[t.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",t[t.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",t[t.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",t[t.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",t[t.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",t[t.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",t[t.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",t[t.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(td||(td={})),td.FAR_BOTTOM_RIGHT,td.NEAR_BOTTOM_RIGHT,td.NEAR_BOTTOM_LEFT,td.FAR_BOTTOM_LEFT,td.NEAR_BOTTOM_LEFT,td.NEAR_BOTTOM_RIGHT,td.NEAR_TOP_RIGHT,td.NEAR_TOP_LEFT,td.FAR_BOTTOM_RIGHT,td.FAR_BOTTOM_LEFT,td.FAR_TOP_LEFT,td.FAR_TOP_RIGHT,td.NEAR_BOTTOM_RIGHT,td.FAR_BOTTOM_RIGHT,td.FAR_TOP_RIGHT,td.NEAR_TOP_RIGHT,td.FAR_BOTTOM_LEFT,td.NEAR_BOTTOM_LEFT,td.NEAR_TOP_LEFT,td.FAR_TOP_LEFT,td.FAR_TOP_LEFT,td.NEAR_TOP_LEFT,td.NEAR_TOP_RIGHT,td.FAR_TOP_RIGHT;var d4e,X_t;(function(t){t[t.NUM=6]="NUM"})(d4e||(d4e={})),function(t){t[t.NUM=8]="NUM"}(X_t||(X_t={})),new IU(q_t);let p4e=class bBe{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,i){this._objectToBoundingSphere=e,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new tm,this._objectCount=0,i&&(i.maximumObjectsPerNode!==void 0&&(this._maximumObjectsPerNode=i.maximumObjectsPerNode),i.maximumDepth!==void 0&&(this._maximumDepth=i.maximumDepth))}destroy(){this._degenerateObjects.clear(),tm.clearPool(),m4e[0]=null,a6.prune(),l6.prune()}add(e,i=e.length){this._objectCount+=i,this._grow(e,i);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,i,r,n){const s=V_t(e,i);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,i=>{const r=i.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,i,r,n=()=>!0,s=1/0){let o=1/0,a=1/0,l=null;const c=f4e(e,i),d=p=>{if(--s,!n(p))return;const y=this._objectToBoundingSphere(p);if(!Kpe(r,y))return;const v=QD(e,i,y),S=v-y[3],I=v+y[3];S{if(s<=0||!Kpe(r,p.bounds)||(Gh(ex,c,p.halfSize),Uc(ex,ex,p.bounds),QD(e,i,ex)>a))return!1;const y=p.node;return y.terminals.forAll(v=>d(v)),y.residents!==null&&y.residents.forAll(v=>d(v)),!0},e,i),l}forEachInDepthRange(e,i,r,n,s,o,a){let l=-1/0,c=1/0;const d={setRange:I=>{r===bBe.DepthOrder.FRONT_TO_BACK?(l=Math.max(l,I.near),c=Math.min(c,I.far)):(l=Math.max(l,-I.far),c=Math.min(c,-I.near))}};d.setRange(n);const p=QD(i,r,e),y=f4e(i,r),v=f4e(i,-r),S=I=>{if(!a(I))return;const O=this._objectToBoundingSphere(I),L=O,N=QD(i,r,L)-p,G=N-O[3],V=N+O[3];G>c||V{if(!Kpe(o,I.bounds)||(Gh(ex,y,I.halfSize),Uc(ex,ex,I.bounds),QD(i,r,ex)-p>c)||(Gh(ex,v,I.halfSize),Uc(ex,ex,I.bounds),QD(i,r,ex)-pS(L)),O.residents!==null&&O.residents.forAll(L=>S(L)),!0},i,r)}forEachNode(e){this._forEachNode(this._root,i=>e(i.node,i.bounds,i.halfSize))}forEachNeighbor(e,i){const r=o6(i),n=i,s=l=>{const c=this._objectToBoundingSphere(l),d=o6(c),p=r+d;return!(q8(c,n)-p*p<=0)||e(l)};let o=!0;const a=l=>{o&&(o=s(l))};this._forEachNode(this._root,l=>{const c=o6(l.bounds),d=r+c;if(q8(l.bounds,n)-d*d>0)return!1;const p=l.node;return p.terminals.forAll(a),o&&p.residents!==null&&p.residents.forAll(a),o}),o&&this.forEachDegenerateObject(a)}_intersectsNode(e,i){return Jpe(i.bounds,2*-i.halfSize,mb),Jpe(i.bounds,2*i.halfSize,gb),rnt(e.origin,e.direction,mb,gb)}_intersectsNodeWithOffset(e,i,r){return Jpe(i.bounds,2*-i.halfSize,mb),Jpe(i.bounds,2*i.halfSize,gb),r.applyToMinMax(mb,gb),rnt(e.origin,e.direction,mb,gb)}_intersectsObject(e,i){const r=this._objectToBoundingSphere(i);return!(r[3]>0)||l4e(r,e)}_intersectsObjectWithOffset(e,i,r){const n=this._objectToBoundingSphere(i);return!(n[3]>0)||l4e(r.applyToBoundingSphere(n),e)}_forEachNode(e,i){let r=tm.acquire().init(e);const n=[r];for(;n.length!==0;){if(r=n.pop(),i(r)&&!r.isLeaf())for(let s=0;s=0;--a){const l=e1t[a];s.node.children[l]&&o.push(tm.acquire().init(s).advance(l))}tm.release(s)}}_remove(e,i,r){a6.clear();const n=r.advanceTo(i,(s,o)=>{a6.push(s.node),a6.push(o)})?r.node.terminals:r.node.residents;if(n.removeUnordered(e),n.length===0)for(let s=a6.length-2;s>=0;s-=2){const o=a6.data[s],a=a6.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 i=0;i=0&&(e.children[i]=null),!!this._nodeIsEmpty(e)&&(e.residents===null&&(e.residents=new _m({shrink:!0})),!0)}_add(e,i){i.advanceTo(this._objectToBoundingSphere(e))?i.node.terminals.push(e):(i.node.residents.push(e),i.node.residents.length>this._maximumObjectsPerNode&&i.depththis._objectToBoundingSphere(r),rO),HJ(rO[3])&&!this._fitsInsideTree(rO)))if(this._nodeIsEmpty(this._root.node))RU(rO,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const r=this._rootBoundsForRootAsSubNode(rO);this._placingRootViolatesMaxDepth(r)?this._rebuildTree(rO,r):this._growRootAsSubNode(r),tm.release(r)}}_rebuildTree(e,i){Hv(y4e,i.bounds),y4e[3]=i.halfSize,K_t([e,y4e],2,n=>n,v4e);const r=tm.acquire().init(this._root);this._root.initFrom(null,v4e,v4e[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 i=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+i<=this._maximumDepth)),r+i>this._maximumDepth}_rootBoundsForRootAsSubNode(e){const i=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 c=s[l]-o-(r[l]-i),d=r[l]+i-(s[l]+o),p=Math.max(0,Math.ceil(c/(2*o))),y=Math.max(0,Math.ceil(d/(2*o)))+1,v=2**Math.ceil(Math.log(p+y)*Math.LOG2E);n=Math.max(n,v),Zpe[l].min=p,Zpe[l].max=y}for(let l=0;l<3;l++){let c=Zpe[l].min,d=Zpe[l].max;const p=(n-(c+d))/2;c+=Math.ceil(p),d+=Math.floor(p);const y=s[l]-o-c*o*2;g4e[l]=y+(d+c)*o}const a=n*o;return g4e[3]=a*Q_t,tm.acquire().initFrom(null,g4e,a,0)}_growRootAsSubNode(e){const i=this._root.node;Hv(rO,this._root.bounds),rO[3]=this._root.halfSize,this._root.init(e),e.advanceTo(rO,null,!0),e.node.children=i.children,e.node.residents=i.residents,e.node.terminals=i.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 i=this._root.node.children;let r=0,n=0;for(;n=i[0]-r&&e[0]<=i[0]+r&&e[1]>=i[1]-r&&e[1]<=i[1]+r&&e[2]>=i[2]-r&&e[2]<=i[2]+r}},tm=class uH{constructor(){this.bounds=Qw(),this.halfSize=0,this.initFrom(null,null,0,0)}init(e){return this.initFrom(e.node,e.bounds,e.halfSize,e.depth)}initFrom(e,i,r,n=this.depth){return this.node=ye(e)?e:uH.createEmptyNode(),ye(i)&&RU(i,this.bounds),this.halfSize=r,this.depth=n,this}increaseHalfSize(e){this.halfSize*=e,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*Q_t}advance(e){let i=this.node.children[e];i||(i=uH.createEmptyNode(),this.node.children[e]=i),this.node=i,this.halfSize/=2,this.depth++;const r=J_t[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,i,r=!1){for(;;){if(this.isTerminalFor(e))return i&&i(this,-1),!0;if(this.isLeaf()){if(!r)return i&&i(this,-1),!1;this.node.residents=null}const n=this._childIndex(e);i&&i(this,n),this.advance(n)}}isLeaf(){return this.node.residents!=null}isTerminalFor(e){return e[3]>this.halfSize/2}_childIndex(e){const i=this.bounds;return(i[0]r.distance-n.distance);for(let r=0;r<8;++r)i[r]=l6.data[r].index}function f4e(t,e){let i,r=1/0;for(let n=0;n<8;++n){const s=QD(t,e,Z_t[n]);s0}tm._pool=new _C(tm),function(t){var e;(e=t.DepthOrder||(t.DepthOrder={}))[e.FRONT_TO_BACK=1]="FRONT_TO_BACK",e[e.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(p4e||(p4e={}));const J_t=[Ma(-1,-1,-1),Ma(1,-1,-1),Ma(-1,1,-1),Ma(1,1,-1),Ma(-1,-1,1),Ma(1,-1,1),Ma(-1,1,1),Ma(1,1,1)],Z_t=[Ma(-1,-1,-1),Ma(-1,-1,1),Ma(-1,1,-1),Ma(-1,1,1),Ma(1,-1,-1),Ma(1,-1,1),Ma(1,1,-1),Ma(1,1,1)],Q_t=Math.sqrt(3),m4e=[null];function H$i(t){return m4e[0]=t,m4e}const g4e=Qw(),ex=Qr(),mb=Qr(),gb=Qr(),a6=new _m,W$i=Qw(),rO=Qw(),y4e=Qw(),v4e=Qw(),Zpe=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],l6=new _m,e1t=[0,0,0,0,0,0,0,0],t1t=p4e,q$i=1e3;function Y$i(t,e,i){const r=Qw(),n=r;return U1e(n,n,t,.5),U1e(n,n,e,.5),r[3]=rR(n,t),Uc(n,n,i),r}let _4e=class{constructor(){this._idToComponent=new Map,this._components=new t1t(e=>e.bounds),this._edges=new t1t(e=>e.bounds),this._tmpLineSegment=Ype(),this._tmpP1=Qr(),this._tmpP2=Qr(),this._tmpP3=Qr(),this.remoteClient=null}async fetchCandidates(e,i){await Promise.resolve(),sn(i),await this._ensureEdgeLocations(e,i);const r=[];return this._edges.forEachNeighbor(n=>(this._addCandidates(e,n,r),r.length{if(lt(o.info)){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,Fu(i,{}));for(const o of s.components)this._setFetchEdgeLocations(o)}async add(e){const i=new i1t(e.id,e.bounds);return this._idToComponent.set(i.id,i),this._components.add([i]),{result:{}}}async remove(e){const i=this._idToComponent.get(e.id);if(i){const r=[];this._edges.forEachNeighbor(n=>(n.component===i&&r.push(n),!0),i.bounds),this._edges.remove(r),this._components.remove([i]),this._idToComponent.delete(i.id)}return{result:{}}}_setFetchEdgeLocations(e){const i=this._idToComponent.get(e.id);if(lt(i)||e.uid!==i.uid)return;const r=uyt.createView(e.locations),n=new Array(r.count),s=Qr(),o=Qr();for(let c=0;cPromise.resolve().then(()=>XCr).then(e=>e.i).then(({default:e})=>{const i=e({locateFile:Q$i,onRuntimeInitialized:()=>t(i)});delete i.then})).catch(t=>{throw t})),b4e}function Q$i(t){return zl(`esri/libs/i3s/${t}`)}let b4e;var n1t,MU,s1t,o1t,a1t;(function(t){t[t.Unmodified=0]="Unmodified",t[t.Culled=1]="Culled",t[t.NotChecked=2]="NotChecked"})(n1t||(n1t={})),function(t){t[t.Unmodified=0]="Unmodified",t[t.PotentiallyModified=1]="PotentiallyModified",t[t.Culled=2]="Culled",t[t.Unknown=3]="Unknown",t[t.NotChecked=4]="NotChecked"}(MU||(MU={})),function(t){t[t.Unknown=0]="Unknown",t[t.Uncached=1]="Uncached",t[t.Cached=2]="Cached"}(s1t||(s1t={})),function(t){t[t.None=0]="None",t[t.MaxScreenThreshold=1]="MaxScreenThreshold",t[t.ScreenSpaceRelative=2]="ScreenSpaceRelative",t[t.RemovedFeatureDiameter=3]="RemovedFeatureDiameter",t[t.DistanceRangeFromDefaultCamera=4]="DistanceRangeFromDefaultCamera"}(o1t||(o1t={})),function(t){t[t.Hole=0]="Hole",t[t.Leaf=1]="Leaf"}(a1t||(a1t={}));async function e8i(t){await FU();const e=[t.geometryBuffer];return{result:u1t(t,e),transferList:e}}async function t8i(t){await FU();const e=[t.geometryBuffer],{geometryBuffer:i}=t,r=i.byteLength,n=Td._malloc(r),s=new Uint8Array(Td.HEAPU8.buffer,n,r);s.set(new Uint8Array(i));const o=Td.dracoDecompressPointCloudData(n,s.byteLength);if(Td._free(n),o.error.length>0)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 i8i(t){await FU(),c1t(t);const e={buffer:t.buffer};return{result:e,transferList:[e.buffer]}}async function r8i(t){await FU(),l1t(t)}async function n8i(t){await FU(),Td.setLegacySchema(t.context,t.jsonSchema)}function s8i(t){h1t(t)}let efe,Td;function l1t(t){const e=t.modifications,i=Td._malloc(8*e.length),r=new Float64Array(Td.HEAPU8.buffer,i,e.length);for(let n=0;nke.some(Ne=>Ne.name==="color")),normal:t.needNormals&&t.layouts.some(ke=>ke.some(Ne=>Ne.name==="normalCompressed")),uv0:t.layouts.some(ke=>ke.some(Ne=>Ne.name==="uv0")),uvRegion:t.layouts.some(ke=>ke.some(Ne=>Ne.name==="uvRegion")),featureIndex:G.featureIndex},Y=Td.process(i,!!t.obb,y,I.byteLength,G,V,S,a,d,p,t.normalReferenceFrame);if(Td._free(S),Td._free(y),Y.error.length>0)throw new Error(`i3s.wasm: ${Y.error}`);if(Y.discarded)return null;const X=Y.componentOffsets.length>0?Y.componentOffsets.slice():null,te=Y.featureIds.length>0?Y.featureIds.slice():null,re=Y.interleavedVertedData.slice().buffer,fe=Y.indicesType===Qpe.Int16?new Uint16Array(Y.indices.buffer,Y.indices.byteOffset,Y.indices.byteLength/2).slice():new Uint32Array(Y.indices.buffer,Y.indices.byteOffset,Y.indices.byteLength/4).slice(),ge=Y.positions.slice(),_e=Y.positionIndicesType===Qpe.Int16?new Uint16Array(Y.positionIndices.buffer,Y.positionIndices.byteOffset,Y.positionIndices.byteLength/2).slice():new Uint32Array(Y.positionIndices.buffer,Y.positionIndices.byteOffset,Y.positionIndices.byteLength/4).slice(),Ie={layout:t.layouts[0],interleavedVertexData:re,indices:fe,hasColors:Y.hasColors,hasModifications:Y.hasModifications,positionData:{data:ge,indices:_e}};return te&&e.push(te.buffer),X&&e.push(X.buffer),e.push(re),e.push(fe.buffer),e.push(ge.buffer),e.push(_e.buffer),{componentOffsets:X,featureIds:te,transformedGeometry:Ie,obb:Y.obb}}function o8i(t){return t===0?MU.Unmodified:t===1?MU.PotentiallyModified:t===2?MU.Culled:MU.Unknown}function c1t(t){const{context:e,buffer:i}=t,r=Td._malloc(i.byteLength),n=i.byteLength/Float64Array.BYTES_PER_ELEMENT,s=new Float64Array(Td.HEAPU8.buffer,r,n),o=new Float64Array(i);s.set(o),Td.filterOBBs(e,r,n),o.set(s),Td._free(r)}function h1t(t){Td&&Td.destroy(t)}function DU(t,e){for(let i=0;i{Td=t,efe=null})),efe)}const a8i=Object.freeze(Object.defineProperty({__proto__:null,destroyContext:s8i,dracoDecompressPointCloudData:t8i,filterObbsForModifications:i8i,filterObbsForModificationsSync:c1t,initialize:FU,interpretObbModificationResults:o8i,process:e8i,setLegacySchema:n8i,setModifications:r8i,setModificationsSync:l1t,test:{transform:u1t,destroy:h1t}},Symbol.toStringTag,{value:"Module"}));function l8i(t){return c8i(t)??u8i(t)}function u8i(t){const e=new Date(t).getTime();return Number.isNaN(e)?null:e}function c8i(t){const e=h8i.exec(t);if(!e?.groups)return null;const i=e.groups,r=+i.year,n=+i.month-1,s=+i.day,o=+(i.hours??"0"),a=+(i.minutes??"0"),l=+(i.seconds??"0");if(o>23||a>59||l>59)return null;const c=i.ms??"0",d=c?+c.padEnd(3,"0").substring(0,3):0;let p;if(i.isUTC)p=Date.UTC(r,n,s,o,a,l,d);else if(i.offsetSign){const y=+i.offsetHours,v=+i.offsetMinutes;p=6e4*(i.offsetSign==="+"?-1:1)*(60*y+v)+Date.UTC(r,n,s,o,a,l,d)}else p=new Date(r,n,s,o,a,l,d).getTime();return Number.isNaN(p)?null:p}const h8i=/^(?:(?-?\d{4,})-(?\d{2})-(?\d{2}))(?:T(?\d{2}):(?\d{2}):(?\d{2})(?:\.(?\d+))?)?(?:(?Z)|(?:(?\+|-)(?\d{2}):(?\d{2})))?$/;function eF(t,e){if(t&&e){for(const i of t.children)if(i.localName in e){const r=e[i.localName];if(typeof r=="function"){const n=r(i);n&&eF(i,n)}else eF(i,r)}}}function*WJ(t,e){for(const i of t.children)if(i.localName in e){const r=e[i.localName];typeof r=="function"?yield r(i):yield*WJ(i,r)}}const w4e="xlink:href",qJ="2.0.0",x4e="__esri_wfs_id__",d8i="wfs-layer:getWFSLayerTypeInfo-error",p8i="wfs-layer:empty-service",d1t="wfs-layer:feature-type-not-found",f8i="wfs-layer:geojson-not-supported",m8i="wfs-layer:kvp-encoding-not-supported",g8i="wfs-layer:malformed-json",p1t="wfs-layer:unknown-geometry-type",y8i="wfs-layer:unknown-field-type",v8i="wfs-layer:unsupported-spatial-reference",_8i="wfs-layer:unsupported-wfs-version";async function b8i(t,e){const i=w8i((await ir(t,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:qJ,...e?.customParameters},signal:e?.signal})).data);return C8i(t,i),i}function w8i(t){const e=v1t(t);L8i(e),_1t(e);const i=e.firstElementChild,r=hkt(T8i(i));return{operations:S8i(i),get featureTypes(){return Array.from(r())},readFeatureTypes:r}}const x8i=new Set(["json","application/json","geojson","application/json; subtype=geojson"]);function S8i(t){let e=!1;const i={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}};if(eF(t,{OperationsMetadata:{Operation:r=>{switch(r.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:n=>{i.GetCapabilities.url=n.getAttribute(w4e)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:n=>{i.DescribeFeatureType.url=n.getAttribute(w4e)}}}};case"GetFeature":return{DCP:{HTTP:{Get:n=>{i.GetFeature.url=n.getAttribute(w4e)}}},Parameter:n=>{if(n.getAttribute("name")==="outputFormat")return{AllowedValues:{Value:s=>{const o=s.textContent;o&&x8i.has(o.toLowerCase())&&(i.GetFeature.outputFormat=o)}}}}}}},Constraint:r=>{switch(r.getAttribute("name")){case"KVPEncoding":return{DefaultValue:n=>{e=n.textContent.toLowerCase()==="true"}};case"ImplementsResultPaging":return{DefaultValue:n=>{i.GetFeature.supportsPagination=n.textContent.toLowerCase()==="true"}}}}}}),!e)throw new st(m8i,"WFS service doesn't support key/value pair (KVP) encoding");if(lt(i.GetFeature.outputFormat))throw new st(f8i,"WFS service doesn't support GeoJSON output format");return i}function C8i(t,e){GVe(t)&&(Gy(t,e.operations.DescribeFeatureType.url,!0)&&(e.operations.DescribeFeatureType.url=GH(e.operations.DescribeFeatureType.url)),Gy(t,e.operations.GetFeature.url,!0)&&(e.operations.GetFeature.url=GH(e.operations.GetFeature.url)))}function T8i(t){return WJ(t,{FeatureTypeList:{FeatureType:e=>{const i={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",supportedSpatialReferences:[]},r=new Set([4326]),n=s=>{const o=parseInt(s.textContent?.match(/(?\d+$)/i)?.groups?.wkid??"",10);Number.isNaN(o)||r.add(o)};return eF(e,{Name:s=>{const{name:o,prefix:a}=YJ(s.textContent);i.typeName=`${a}:${o}`,i.name=o,i.namespacePrefix=a,i.namespaceUri=s.lookupNamespaceURI(a)},Abstract:s=>{i.description=s.textContent},Title:s=>{i.title=s.textContent},WGS84BoundingBox:s=>{i.extent=E8i(s)},DefaultSRS:n,DefaultCRS:n,OtherSRS:n,OtherCRS:n}),i.title||(i.title=i.name),i.supportedSpatialReferences.push(...r),i}}})}function E8i(t){let e,i,r,n;for(const s of t.children)switch(s.localName){case"LowerCorner":[e,i]=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:i,xmax:r,ymax:n,spatialReference:Df}}function f1t(t,e,i){return xre(t,r=>i?r.name===e&&r.namespaceUri===i:r.typeName===e||r.name===e)}async function I8i(t,e,i,r={}){const{featureType:n,extent:s}=await A8i(t,e,i,r),{fields:o,geometryType:a,swapXY:l,objectIdField:c,geometryField:d}=await P8i(t,n.typeName,r);return{url:t.operations.GetCapabilities.url,name:n.name,namespaceUri:n.namespaceUri,fields:o,geometryField:d,geometryType:a,objectIdField:c,spatialReference:r.spatialReference??rr.WGS84,extent:s,swapXY:l,wfsCapabilities:t,customParameters:r.customParameters}}async function A8i(t,e,i,r={}){const{spatialReference:n=rr.WGS84}=r,s=t.readFeatureTypes(),o=e?f1t(s,e,i):s.next().value;if(lt(o))throw e?new st(d1t,`The type '${e}' could not be found in the service`):new st(p8i,"The service is empty");let a=new vr({...o.extent,spatialReference:n});if(!Ca(n,Df))try{await YR(Df,n,void 0,r),a=rp(a,Df)}catch{throw new st(v8i,"Projection not supported")}return{extent:a,spatialReference:n,featureType:o}}async function P8i(t,e,i={}){const[r,n]=await bu([R8i(t.operations.DescribeFeatureType.url,e,i),O8i(t,e,i)]);if(r.error||n.error)throw new st(d8i,`An error occurred while getting info about the feature type '${e}'`,{error:r.error||n.error});const{fields:s,errors:o}=r.value??{},a=r.value?.geometryType||n.value?.geometryType,l=n.value?.swapXY??!1;if(lt(a))throw new st(p1t,`The geometry type could not be determined for type '${e}`,{typeName:e,geometryType:a,fields:s,errors:o});return{...m1t(s??[]),geometryType:a,swapXY:l}}function m1t(t){const e=t.find(r=>r.type==="geometry");let i=t.find(r=>r.type==="oid");return t=t.filter(r=>r.type!=="geometry"),i||(i=new Bo({name:x4e,type:"oid",alias:x4e}),t.unshift(i)),{geometryField:e?.name??null,objectIdField:i.name,fields:t}}async function O8i(t,e,i={}){let r,n=!1;const[s,o]=await Promise.all([g1t(t.operations.GetFeature.url,e,t.operations.GetFeature.outputFormat,{...i,count:1}),ir(t.operations.GetFeature.url,{responseType:"text",query:y1t(e,void 0,{...i,count:1}),signal:i?.signal})]),a=s.type==="FeatureCollection"&&s.features[0]?.geometry;if(a){let l;switch(r=qy.fromJSON(ope(a.type)),a.type){case"Point":l=a.coordinates;break;case"LineString":case"MultiPoint":l=a.coordinates[0];break;case"MultiLineString":case"Polygon":l=a.coordinates[0][0];break;case"MultiPolygon":l=a.coordinates[0][0][0]}const c=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(o.data);if(c){const d=l[0].toFixed(3),p=l[1].toFixed(3),y=parseFloat(c[1]).toFixed(3);d===parseFloat(c[2]).toFixed(3)&&p===y&&(n=!0)}}return{geometryType:r,swapXY:n}}async function R8i(t,e,i){return M8i(e,(await ir(t,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:qJ,TYPENAME:e,...i?.customParameters},signal:i?.signal})).data)}function M8i(t,e){const{name:i}=YJ(t),r=v1t(e);_1t(r);const n=xre(WJ(r.firstElementChild,{element:s=>({name:s.getAttribute("name"),typeName:YJ(s.getAttribute("type")).name})}),({name:s})=>s===i);if(ye(n)){const s=xre(WJ(r.firstElementChild,{complexType:o=>o}),o=>o.getAttribute("name")===n.typeName);if(ye(s))return F8i(s)}throw new st(d1t,`Type '${t}' not found in document`,{document:new XMLSerializer().serializeToString(r)})}const D8i=new Set(["objectid","fid"]);function F8i(t){const e=[],i=[];let r;const n=WJ(t,{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=YJ(s.getAttribute("type")).name:eF(s,{simpleType:{restriction:p=>(a=YJ(p.getAttribute("base")).name,{maxLength:y=>{l=+y.getAttribute("value")}})}}),!a)continue;const c=s.getAttribute("nillable")==="true";let d=!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":i.push(new Bo({name:o,alias:o,type:"integer",nullable:c}));break;case"float":case"double":case"decimal":i.push(new Bo({name:o,alias:o,type:"double",nullable:c}));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":i.push(new Bo({name:o,alias:o,type:"string",nullable:c,length:l??255}));break;case"datetime":case"date":i.push(new Bo({name:o,alias:o,type:"date",nullable:c,length:l??36}));break;case"pointpropertytype":r="point",d=!0;break;case"multipointpropertytype":r="multipoint",d=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":r="polyline",d=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":r="polygon",d=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":d=!0,e.push(new st(p1t,`geometry type '${a}' is not supported`,{type:new XMLSerializer().serializeToString(t)}));break;default:e.push(new st(y8i,`Unknown field type '${a}'`,{type:new XMLSerializer().serializeToString(t)}))}d&&i.push(new Bo({name:o,alias:o,type:"geometry",nullable:c}))}for(const s of i)if(s.type==="integer"&&!s.nullable&&D8i.has(s.name.toLowerCase())){s.type="oid";break}return{geometryType:r,fields:i,errors:e}}async function g1t(t,e,i,r){let{data:n}=await ir(t,{responseType:"text",query:y1t(e,i,r),signal:r?.signal});n=n.replace(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{if(r?.dateFields?.length){const s=new Set(r.dateFields);return JSON.parse(n,(o,a)=>s.has(o)?l8i(a):a)}return JSON.parse(n)}catch(s){throw new st(g8i,"Error while parsing the response",{response:n,error:s})}}function y1t(t,e,i){return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:qJ,TYPENAMES:t,OUTPUTFORMAT:e,SRSNAME:"EPSG:4326",STARTINDEX:i?.startIndex,COUNT:i?.count,...i?.customParameters}}function v1t(t){return new DOMParser().parseFromString(t.trim(),"text/xml")}function YJ(t){const[e,i]=t.split(":");return{prefix:i?e:"",name:i??e}}function L8i(t){const e=t.firstElementChild?.getAttribute("version");if(e&&e!==qJ)throw new st(_8i,`Unsupported WFS version ${e}. Supported version: ${qJ}`)}function _1t(t){let e="",i="";if(eF(t.firstElementChild,{Exception:r=>(e=r.getAttribute("exceptionCode"),{ExceptionText:n=>{i=n.textContent}})}),e)throw new st(`wfs-layer:${e}`,i)}const k8i=Object.freeze(Object.defineProperty({__proto__:null,default:class{constructor(){this._queryEngine=null,this._customParameters=null,this._snapshotFeatures=async e=>{const{objectIdField:i}=this._queryEngine,r=await g1t(this._getFeatureUrl??"",this._featureType.typeName,this._getFeatureOutputFormat,{customParameters:this._customParameters,dateFields:this._queryEngine.fieldsIndex.dateFields.map(o=>o.name),signal:e});await TDe(r),sn(e);const n=EDe(r,{geometryType:this._queryEngine.geometryType,hasZ:!1,objectIdField:i});if(!Ca(this._queryEngine.spatialReference,Df))for(const o of n)ye(o.geometry)&&(o.geometry=H5(fp(cw(o.geometry,this._queryEngine.geometryType,!1,!1),Df,this._queryEngine.spatialReference)));let s=1;for(const o of n){const a={};UN(this._fieldsIndex,a,o.attributes,!0),o.attributes=a,o.attributes[i]==null&&(o.objectId=o.attributes[i]=s++)}return n}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,i){const{getFeatureUrl:r,getFeatureOutputFormat:n,spatialReference:s,fields:o,geometryType:a,featureType:l,objectIdField:c,customParameters:d}=e;this._featureType=l,this._customParameters=d,this._getFeatureUrl=r,this._getFeatureOutputFormat=n,this._fieldsIndex=new Am(o),await this._checkProjection(s),sn(i),this._queryEngine=new NN({fields:o,geometryType:a,hasM:!1,hasZ:!1,objectIdField:c,spatialReference:s,timeInfo:null,featureStore:new yJ({geometryType:a,hasM:!1,hasZ:!1})});const p=await this._snapshotFeatures(i.signal);return this._queryEngine.featureStore.addMany(p),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new st("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}async queryFeatures(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,i.signal)}async queryFeatureCount(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,i.signal)}async queryObjectIds(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,i.signal)}async queryExtent(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,i.signal)}async querySnapping(e,i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,i.signal)}async refresh(e){return this._customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=EC(this._snapshotFeatures),this._snapshotTask.promise.then(i=>{this._queryEngine.featureStore.clear(),i&&this._queryEngine.featureStore.addMany(i)},i=>{this._queryEngine.featureStore.clear(),ss(i)||Ei.getLogger("esri.layers.WFSLayer").error(new st("wfs-layer:getfeature-error","An error occurred during the GetFeature request",{error:i}))}),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 _checkProjection(e){try{await uy(Df,e)}catch{throw new st("unsupported-projection","Projection not supported",{spatialReference:e})}}}},Symbol.toStringTag,{value:"Module"}));var _g,mp,_f;(function(t){t[t.FILL=1]="FILL",t[t.LINE=2]="LINE",t[t.SYMBOL=3]="SYMBOL",t[t.CIRCLE=4]="CIRCLE"})(_g||(_g={})),function(t){t[t.BACKGROUND=0]="BACKGROUND",t[t.FILL=1]="FILL",t[t.OUTLINE=2]="OUTLINE",t[t.LINE=3]="LINE",t[t.ICON=4]="ICON",t[t.CIRCLE=5]="CIRCLE",t[t.TEXT=6]="TEXT",t[t.TILEINFO=7]="TILEINFO"}(mp||(mp={})),function(t){t[t.PAINTER_CHANGED=0]="PAINTER_CHANGED",t[t.LAYOUT_CHANGED=1]="LAYOUT_CHANGED",t[t.LAYER_CHANGED=2]="LAYER_CHANGED",t[t.LAYER_REMOVED=3]="LAYER_REMOVED",t[t.SPRITES_CHANGED=4]="SPRITES_CHANGED"}(_f||(_f={}));const N8i=512;var fy,bg;(function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon"})(fy||(fy={}));let Xo=class t_e{constructor(e,i){this.x=e,this.y=i}clone(){return new t_e(this.x,this.y)}equals(e,i){return e===this.x&&i===this.y}isEqual(e){return e.x===this.x&&e.y===this.y}setCoords(e,i){this.x=e,this.y=i}normalize(){const e=this.x,i=this.y,r=Math.sqrt(e*e+i*i);this.x/=r,this.y/=r}rightPerpendicular(){const e=this.x;this.x=this.y,this.y=-e}move(e,i){this.x+=e,this.y+=i}assign(e){this.x=e.x,this.y=e.y}assignAdd(e,i){this.x=e.x+i.x,this.y=e.y+i.y}assignSub(e,i){this.x=e.x-i.x,this.y=e.y-i.y}rotate(e,i){const r=this.x,n=this.y;this.x=r*e-n*i,this.y=r*i+n*e}scale(e){this.x*=e,this.y*=e}length(){const e=this.x,i=this.y;return Math.sqrt(e*e+i*i)}static distance(e,i){const r=i.x-e.x,n=i.y-e.y;return Math.sqrt(r*r+n*n)}static add(e,i){return new t_e(e.x+i.x,e.y+i.y)}static sub(e,i){return new t_e(e.x-i.x,e.y-i.y)}},tfe=class{constructor(e,i,r){this.ratio=e,this.x=i,this.y=r}},XJ=class{constructor(e,i,r,n=8,s=8){this._lines=[],this._starts=[],this.validateTessellation=!0,this._pixelRatio=n,this._pixelMargin=s,this._tileSize=N8i*n,this._dz=e,this._yPos=i,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;i>r&&(i=r),this._margin=i,this._xmin=r*this._xPos-i,this._ymin=r*this._yPos-i,this._xmax=this._xmin+r+2*i,this._ymax=this._ymin+r+2*i}reset(e){this._type=e,this._lines=[],this._starts=[],this._line=null,this._start=0}moveTo(e,i){this._pushLine(),this._prevIsIn=this._isIn(e,i),this._moveTo(e,i,this._prevIsIn),this._prevPt=new Xo(e,i),this._firstPt=new Xo(e,i),this._dist=0}lineTo(e,i){const r=this._isIn(e,i),n=new Xo(e,i),s=Xo.distance(this._prevPt,n);let o,a,l,c,d,p,y,v;if(r)this._prevIsIn?this._lineTo(e,i,!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 S=this._prevPt,I=n;if(S.x<=this._xmin&&I.x<=this._xmin||S.x>=this._xmax&&I.x>=this._xmax||S.y<=this._ymin&&I.y<=this._ymin||S.y>=this._ymax&&I.y>=this._ymax)this._lineTo(I.x,I.y,!1);else{const O=[];if((S.xthis._xmin||S.x>this._xmin&&I.x=this._ymax?p=!0:O.push(new tfe(c,this._xmin,v))),(S.xthis._xmax||S.x>this._xmax&&I.x=this._ymax?p=!0:O.push(new tfe(c,this._xmax,v))),(S.ythis._ymin||S.y>this._ymin&&I.y=this._xmax?d=!0:O.push(new tfe(c,y,this._ymin))),(S.ythis._ymax||S.y>this._ymax&&I.y=this._xmax?d=!0:O.push(new tfe(c,y,this._ymax))),O.length===0)d?p?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):p?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,!0);else if(O.length>1&&O[0].ratio>O[1].ratio)this._start=this._dist+s*O[1].ratio,this._lineTo(O[1].x,O[1].y,!0),this._lineTo(O[0].x,O[0].y,!0);else{this._start=this._dist+s*O[0].ratio;for(let L=0;L2){const e=this._firstPt,i=this._prevPt;e.x===i.x&&e.y===i.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===fy.Polygon&&e&&B8i.simplify(this._tileSize,this._margin*this._finalRatio,this._lines),this._lines)}resultWithStarts(){if(this._type!==fy.LineString)throw new Error("Only valid for lines");this._pushLine();const e=this._lines,i=e.length;if(i===0)return null;const r=[];for(let n=0;n=this._xmin&&e<=this._xmax&&i>=this._ymin&&i<=this._ymax}_intersect(e,i){let r,n,s;if(i.x>=this._xmin&&i.x<=this._xmax)n=i.y<=this._ymin?this._ymin:this._ymax,s=(n-e.y)/(i.y-e.y),r=e.x+s*(i.x-e.x);else if(i.y>=this._ymin&&i.y<=this._ymax)r=i.x<=this._xmin?this._xmin:this._xmax,s=(r-e.x)/(i.x-e.x),n=e.y+s*(i.y-e.y);else{n=i.y<=this._ymin?this._ymin:this._ymax,r=i.x<=this._xmin?this._xmin:this._xmax;const o=(r-e.x)/(i.x-e.x),a=(n-e.y)/(i.y-e.y);o0&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===fy.LineString?this._line.length>1&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===fy.Polygon&&this._line.length>3&&(this._lines.push(this._line),this._starts.push(this._start))),this._line=[],this._start=0}_moveTo(e,i,r){this._type!==fy.Polygon?r&&(e=Math.round((e-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new Xo(e,i))):(r||(ethis._xmax&&(e=this._xmax),ithis._ymax&&(i=this._ymax)),e=Math.round((e-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new Xo(e,i)),this._isH=!1,this._isV=!1)}_lineTo(e,i,r){let n,s;if(this._type!==fy.Polygon)if(r){if(e=Math.round((e-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.length>0&&(n=this._line[this._line.length-1],n.equals(e,i)))return;this._line.push(new Xo(e,i))}else this._line&&this._line.length>0&&this._pushLine();else if(r||(ethis._xmax&&(e=this._xmax),ithis._ymax&&(i=this._ymax)),e=Math.round((e-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(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===i;if(o&&a)return;this._isH&&o||this._isV&&a?(n.x=e,n.y=i,s=this._line[this._line.length-2],s.x===e&&s.y===i?(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===i)):(this._isH=s.x===e,this._isV=s.y===i)):(this._line.push(new Xo(e,i)),this._isH=o,this._isV=a)}else this._line.push(new Xo(e,i))}},$8i=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,i){this._line&&this._lines.push(this._line),this._line=[];const r=this._ratio;this._line.push(new Xo(e*r,i*r))}lineTo(e,i){const r=this._ratio;this._line.push(new Xo(e*r,i*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(t){t[t.sideLeft=0]="sideLeft",t[t.sideRight=1]="sideRight",t[t.sideTop=2]="sideTop",t[t.sideBottom=3]="sideBottom"})(bg||(bg={}));let B8i=class eL{static simplify(e,i,r){if(!r)return;const n=-i,s=e+i,o=-i,a=e+i,l=[],c=[],d=r.length;for(let y=0;yS.y?(l.push(y),l.push(L),l.push(bg.sideLeft),l.push(-1)):(c.push(y),c.push(L),c.push(bg.sideLeft),c.push(-1))),I.x>=s&&(I.y=a&&(I.x>S.x?(l.push(y),l.push(L),l.push(bg.sideBottom),l.push(-1)):(c.push(y),c.push(L),c.push(bg.sideBottom),c.push(-1)))),I=S}if(l.length===0||c.length===0)return;eL.fillParent(r,c,l),eL.fillParent(r,l,c);const p=[];eL.calcDeltas(p,c,l),eL.calcDeltas(p,l,c),eL.addDeltas(p,r)}static fillParent(e,i,r){const n=r.length,s=i.length;for(let o=0;o1&&n[o-2]===s?0:(n.push(s),eL.calcDelta(s,r,i,n)+1)}static addDeltas(e,i){const r=e.length;let n=0;for(let s=0;sn&&(n=o)}for(let s=0;st>=e&&t<=i||t>=i&&t<=e,mE=Number.POSITIVE_INFINITY,tF=Math.PI,b1t=2*tF,G8i=128/tF,S4e=tF/180,V8i=1/Math.LN2;function C4e(t,e){return(t%=e)>=0?t:t+e}function w1t(t){return C4e(t*G8i,256)}function iF(t){return Math.log(t)*V8i}function Vm(t,e,i){return t*(1-i)+e*i}function U8i(t){return t===746||t===747||!(t<4352)&&(t>=12704&&t<=12735||t>=12544&&t<=12591||t>=65072&&t<=65103&&!(t>=65097&&t<=65103)||t>=63744&&t<=64255||t>=13056&&t<=13311||t>=11904&&t<=12031||t>=12736&&t<=12783||t>=12288&&t<=12351&&!(t>=12296&&t<=12305||t>=12308&&t<=12319||t===12336)||t>=13312&&t<=19903||t>=19968&&t<=40959||t>=12800&&t<=13055||t>=12592&&t<=12687||t>=43360&&t<=43391||t>=55216&&t<=55295||t>=4352&&t<=4607||t>=44032&&t<=55215||t>=12352&&t<=12447||t>=12272&&t<=12287||t>=12688&&t<=12703||t>=12032&&t<=12255||t>=12784&&t<=12799||t>=12448&&t<=12543&&t!==12540||t>=65280&&t<=65519&&!(t===65288||t===65289||t===65293||t>=65306&&t<=65310||t===65339||t===65341||t===65343||t>=65371&&t<=65503||t===65507||t>=65512&&t<=65519)||t>=65104&&t<=65135&&!(t>=65112&&t<=65118||t>=65123&&t<=65126)||t>=5120&&t<=5759||t>=6320&&t<=6399||t>=65040&&t<=65055||t>=19904&&t<=19967||t>=40960&&t<=42127||t>=42128&&t<=42191)}function j8i(t){return!(t<11904)&&(t>=12704&&t<=12735||t>=12544&&t<=12591||t>=65072&&t<=65103||t>=63744&&t<=64255||t>=13056&&t<=13311||t>=11904&&t<=12031||t>=12736&&t<=12783||t>=12288&&t<=12351||t>=13312&&t<=19903||t>=19968&&t<=40959||t>=12800&&t<=13055||t>=65280&&t<=65519||t>=12352&&t<=12447||t>=12272&&t<=12287||t>=12032&&t<=12255||t>=12784&&t<=12799||t>=12448&&t<=12543||t>=65040&&t<=65055||t>=42128&&t<=42191||t>=40960&&t<=42127)}function z8i(t){switch(t){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 x1t(t){switch(t){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}let Ed=class{constructor(e=0,i=0,r=0,n=0){this.x=e,this.y=i,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)}};const gE=24,S1t=17;let C1t=class{constructor(e,i,r,n,s,o,a){this._glyphItems=e,this._maxWidth=i,this._lineHeight=r,this._letterSpacing=n,this._hAnchor=s,this._vAnchor=o,this._justify=a}getShaping(e,i,r){const n=this._letterSpacing,s=this._lineHeight,o=this._justify,a=this._maxWidth,l=[];let c=0,d=0;const p=e.length;for(let G=0;G0&&(y=c/Math.max(1,Math.ceil(c/a)));const v=e.includes("​"),S=[];for(let G=0;GY&&x1t(l[X].codePoint);)l[X].glyphMosaicItem=null,--X;if(Y<=X){const te=l[Y].x;for(let fe=Y;fe<=X;fe++)l[fe].x-=te,l[fe].y=d;let re=l[X].x;l[X].glyphMosaicItem&&(re+=l[X].glyphMosaicItem.metrics.advance),O=Math.max(re,O),o&&this._applyJustification(l,Y,X)}N=V,d+=L}if(l.length>0){const G=I.length-1,V=(o-this._hAnchor)*O;let Y=(-this._vAnchor*(G+1)+.5)*s;i&&G&&(Y+=G*s);for(const X of l)X.x+=V,X.y+=Y}return l.filter(G=>G.glyphMosaicItem)}static getTextBox(e,i){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,c=a.x,d=a.y-S1t,p=c+l,y=d+i;r=Math.min(r,c),s=Math.max(s,p),n=Math.min(n,d),o=Math.max(o,y)}return{x:r,y:n,width:s-r,height:o-n}}static getBox(e){if(!e.length)return null;let i=1/0,r=1/0,n=0,s=0;for(const o of e){const{height:a,left:l,top:c,width:d}=o.glyphMosaicItem.metrics,p=o.x,y=o.y-(a-Math.abs(c)),v=p+d+l,S=y+a;i=Math.min(i,p),n=Math.max(n,v),r=Math.min(r,y),s=Math.max(s,S)}return{x:i,y:r,width:n-i,height:s-r}}static addDecoration(e,i){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,v=n.allowOverlap&&n.ignorePlacement?null:[],S=[],I=4,O=!y;let L=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY,G=L,V=N;const Y=(y||a)&&l,X=n.size/gE;let te=!1;for(const Ie of i)if(Ie.vertical){te=!0;break}let re,fe=0,ge=0;if(!y&&te){const Ie=C1t.getTextBox(i,n.lineHeight*gE);switch(n.anchor){case Zu.LEFT:fe=Ie.height/2,ge=-Ie.width/2;break;case Zu.RIGHT:fe=-Ie.height/2,ge=Ie.width/2;break;case Zu.TOP:fe=Ie.height/2,ge=Ie.width/2;break;case Zu.BOTTOM:fe=-Ie.height/2,ge=-Ie.width/2;break;case Zu.TOP_LEFT:fe=Ie.height;break;case Zu.BOTTOM_LEFT:ge=-Ie.width;break;case Zu.TOP_RIGHT:ge=Ie.width;break;case Zu.BOTTOM_RIGHT:fe=-Ie.height}}fe+=n.offset[0]*gE,ge+=n.offset[1]*gE;for(const Ie of i){const ke=Ie.glyphMosaicItem;if(!ke||ke.rect.isEmpty)continue;const Ne=ke.rect,J=ke.metrics,he=ke.page;if(v&&O){if(re!==void 0&&re!==Ie.y){let Tt,Lt,at,Ee;te?(Tt=-V+fe,Lt=L+ge,at=V-G,Ee=N-L):(Tt=L+fe,Lt=G+ge,at=N-L,Ee=V-G);const Be={xTile:e.x,yTile:e.y,dxPixels:Tt*X-c,dyPixels:Lt*X-c,hard:!n.optional,partIndex:1,width:at*X+2*c,height:Ee*X+2*c,angle:o,minLod:u6,maxLod:mE};v.push(Be),L=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY,G=L,V=N}re=Ie.y}const xe=[];if(y){const Tt=.5*ke.metrics.width,Lt=(Ie.x+J.left-I+Tt)*X*JJ;if(d=this._placeGlyph(e,d,Lt,r,e.segment,1,Ie.vertical,he,xe),l&&(d=this._placeGlyph(e,d,Lt,r,e.segment,-1,Ie.vertical,he,xe)),d>=T4e)break}else xe.push(new sfe(s,p,p,he,!1)),a&&l&&xe.push(new sfe(s,p+tF,p+tF,he,!1));const Pe=Ie.x+J.left,Oe=Ie.y-S1t-J.top,Ae=Pe+J.width,ze=Oe+J.height;let Ge,Je,et,tt,ft,Pt,$t,St;if(!y&&te)if(Ie.vertical){const Tt=(Pe+Ae)/2-J.height/2,Lt=(Oe+ze)/2+J.width/2;Ge=new Xo(-Lt-I+fe,Tt-I+ge),Je=new Xo(Ge.x+Ne.width,Ge.y+Ne.height),et=new Xo(Ge.x,Je.y),tt=new Xo(Je.x,Ge.y)}else Ge=new Xo(-Oe+I+fe,Pe-I+ge),Je=new Xo(Ge.x-Ne.height,Ge.y+Ne.width),et=new Xo(Je.x,Ge.y),tt=new Xo(Ge.x,Je.y);else Ge=new Xo(Pe-I+fe,Oe-I+ge),Je=new Xo(Ge.x+Ne.width,Ge.y+Ne.height),et=new Xo(Ge.x,Je.y),tt=new Xo(Je.x,Ge.y);for(const Tt of xe){let Lt,at,Ee,Be;if(Tt.alternateVerticalGlyph){if(!ft){const pt=(Oe+ze)/2+ge;ft=new Xo((Pe+Ae)/2+fe-J.height/2-I,pt+J.width/2+I),Pt=new Xo(ft.x+Ne.height,ft.y-Ne.width),$t=new Xo(Pt.x,ft.y),St=new Xo(ft.x,Pt.y)}Lt=ft,at=$t,Ee=St,Be=Pt}else Lt=Ge,at=et,Ee=tt,Be=Je;const mt=Oe,kt=ze,ct=Tt.glyphAngle+o;if(ct!==0){const pt=Math.cos(ct),Le=Math.sin(ct);Lt=Lt.clone(),at=at?.clone(),Ee=Ee?.clone(),Be=Be?.clone(),Lt.rotate(pt,Le),Be?.rotate(pt,Le),at?.rotate(pt,Le),Ee?.rotate(pt,Le)}let le=0,it=256;if(y&&te?Ie.vertical?Tt.alternateVerticalGlyph?(le=32,it=96):(le=224,it=32):(le=224,it=96):(le=192,it=64),S.push(new I1t(Lt,Ee,at,Be,Ne,Tt.labelAngle,le,it,Tt.anchor,Tt.minzoom,Tt.maxzoom,Tt.page)),v&&(!Y||this._legible(Tt.labelAngle))){if(O)PeN&&(N=Ae),kt>V&&(V=kt);else if(Tt.minzoom=T4e)return null;if(v&&O){let Ie,ke,Ne,J;te?(Ie=-V+fe,ke=L+ge,Ne=V-G,J=N-L):(Ie=L+fe,ke=G+ge,Ne=N-L,J=V-G);const he={xTile:e.x,yTile:e.y,dxPixels:Ie*X-c,dyPixels:ke*X-c,hard:!n.optional,partIndex:1,width:Ne*X+2*c,height:J*X+2*c,angle:o,minLod:u6,maxLod:mE};v.push(he)}const _e=new A1t(S);return v&&v.length>0&&(_e.textColliders=v),_e}_legible(e){const i=w1t(e);return i<65||i>=193}_placeGlyph(e,i,r,n,s,o,a,l,c){let d=o;const p=d<0?C4e(e.angle+tF,b1t):e.angle;let y=0;r<0&&(d*=-1,r*=-1,y=tF),d>0&&++s;let v=new Xo(e.x,e.y),S=n[s],I=mE;if(n.length<=s)return I;for(;;){const O=S.x-v.x,L=S.y-v.y,N=Math.sqrt(O*O+L*L),G=Math.max(r/N,i),V=O/N,Y=L/N,X=C4e(Math.atan2(Y,V)+y,b1t);if(c.push(new sfe(v,p,X,l,!1,G,I)),a&&c.push(new sfe(v,p,X,l,!0,G,I)),G<=i)return G;v=S.clone();do{if(s+=d,n.length<=s||s<0)return G;S=n[s]}while(v.isEqual(S));let te=S.x-v.x,re=S.y-v.y;const fe=Math.sqrt(te*te+re*re);te*=N/fe,re*=N/fe,v.x-=te,v.y-=re,I=G}}};const Y8i=128e3;let E4e=null,P1t=null;async function O1t(){return E4e||(E4e=X8i()),E4e}async function X8i(){P1t=await(Gi("esri-csp-restrictions")?await Promise.resolve().then(()=>QCr).then(e=>e.l):await Promise.resolve().then(()=>rTr).then(e=>e.l)).load({locateFile:e=>zl(`esri/core/libs/libtess/${e}`)})}function R1t(t,e){const i=Math.max(t.length,Y8i);return P1t.triangulate(t,e,i)}var NU;(function(t){t[t.moveTo=1]="moveTo",t[t.lineTo=2]="lineTo",t[t.close=7]="close"})(NU||(NU={}));let K8i=class{constructor(e,i){this.values={},this._geometry=void 0,this._pbfGeometry=null;const r=i.keys,n=i.values,s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:this.id=s.getUInt64();break;case 2:{const o=s.getMessage().asUnsafe(),a=this.values;for(;!o.empty();){const l=o.getUInt32(),c=o.getUInt32();a[r[l]]=n[c]}o.release();break}case 3:this.type=s.getUInt32();break;case 4:this._pbfGeometry=s.getMessage();break;default:s.skip()}}getGeometry(e){if(this._geometry!==void 0)return this._geometry;if(!this._pbfGeometry)return null;const i=this._pbfGeometry.asUnsafe();let r,n;this._pbfGeometry=null,e?e.reset(this.type):r=[];let s,o=NU.moveTo,a=0,l=0,c=0;for(;!i.empty();){if(a===0){const d=i.getUInt32();o=7&d,a=d>>3}switch(a--,o){case NU.moveTo:l+=i.getSInt32(),c+=i.getSInt32(),e?e.moveTo(l,c):r&&(n&&r.push(n),n=[],n.push(new Xo(l,c)));break;case NU.lineTo:l+=i.getSInt32(),c+=i.getSInt32(),e?e.lineTo(l,c):n&&n.push(new Xo(l,c));break;case NU.close:e?e.close():n&&!n[0].equals(l,c)&&n.push(n[0].clone());break;default:throw i.release(),new Error("Invalid path operation")}}return e?s=e.result():r&&(n&&r.push(n),s=r),i.release(),this._geometry=s,s}},Um=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,i){return 65535&e|i<<16}static i8888to32(e,i,r,n){return 255&e|(255&i)<<8|(255&r)<<16|n<<24}static i8816to32(e,i,r){return 255&e|(255&i)<<8|r<<16}},$U=class extends Um{constructor(){super(12)}add(e,i,r){const n=this.array;n.push(e),n.push(i),n.push(r)}},J8i=class KLt{constructor(e){this.extent=4096,this.keys=[],this.values=[],this._pbfLayer=e.clone();const i=e.asUnsafe();for(;i.next();)switch(i.tag()){case 1:this.name=i.getString();break;case 3:this.keys.push(i.getString());break;case 4:this.values.push(i.processMessage(KLt._parseValue));break;case 5:this.extent=i.getUInt32();break;default:i.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}},Z8i=class extends Um{constructor(e){super(e)}add(e,i,r,n,s,o,a,l,c,d,p,y){const v=this.array;let S=Um.i1616to32(e,i);v.push(S);const I=31;S=Um.i8888to32(Math.round(I*r),Math.round(I*n),Math.round(I*s),Math.round(I*o)),v.push(S),S=Um.i8888to32(Math.round(I*a),Math.round(I*l),Math.round(I*c),Math.round(I*d)),v.push(S),S=Um.i1616to32(p,0),v.push(S),y&&v.push(...y)}},Q8i=class extends Um{constructor(e){super(e)}add(e,i,r){const n=this.array;n.push(Um.i1616to32(e,i)),r&&n.push(...r)}},e9i=class extends Um{constructor(e){super(e)}add(e,i,r,n,s,o,a){const l=this.array,c=this.index;let d=Um.i1616to32(e,i);l.push(d);const p=15;return d=Um.i8888to32(Math.round(p*r),Math.round(p*n),s,o),l.push(d),a&&l.push(...a),c}},M1t=class extends Um{constructor(e){super(e)}add(e,i,r,n,s,o,a,l,c,d,p,y){const v=this.array;let S=Um.i1616to32(e,i);v.push(S),S=Um.i1616to32(Math.round(8*r),Math.round(8*n)),v.push(S),S=Um.i8888to32(s/4,o/4,l,c),v.push(S),S=Um.i8888to32(0,w1t(a),10*d,Math.min(10*p,255)),v.push(S),y&&v.push(...y)}},t9i=class extends Um{constructor(e){super(e)}add(e,i,r,n,s){const o=this.array,a=Um.i1616to32(2*e+r,2*i+n);o.push(a),s&&o.push(...s)}},ofe=class{constructor(e,i,r){this.layerExtent=4096,this._features=[],this.layer=e,this.zoom=i,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,i,r){}},i9i=class extends ofe{constructor(e,i,r,n,s){super(e,i,r),this.type=_g.CIRCLE,this._circleVertexBuffer=n,this._circleIndexBuffer=s}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(e){const i=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 c of a)if(c)for(const d of c){const p=i.index;i.add(d.x,d.y,0,0,l),i.add(d.x,d.y,0,1,l),i.add(d.x,d.y,1,0,l),i.add(d.x,d.y,1,1,l),r.add(p+0,p+1,p+2),r.add(p+1,p+2,p+3),this._circleIndexCount+=6}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this._circleVertexBuffer.array.length,e+=this._circleIndexBuffer.array.length;const i=new Uint32Array(e),r=new Int32Array(i.buffer);let n=0;i[n++]=this.type,i[n++]=this.layerUIDs.length;for(let s=0;s80*Oe){Ae=Ge=xe[0],ze=Je=xe[1];for(var Lt=Oe;Lt<$t;Lt+=Oe)(et=xe[Lt])Ge&&(Ge=et),tt>Je&&(Je=tt);ft=(ft=Math.max(Ge-Ae,Je-ze))!==0?1/ft:0}return r(St,Tt,Oe,Ae,ze,ft),Tt}function e(xe,Pe,Oe,Ae,ze){var Ge,Je;if(ze===he(xe,Pe,Oe,Ae)>0)for(Ge=Pe;Ge=Pe;Ge-=Ae)Je=ke(Ge,xe[Ge],xe[Ge+1],Je);if(Je&&Y(Je,Je.next)){var et=Je.next;Ne(Je),Je=et}return Je}function i(xe,Pe){if(!xe)return xe;Pe||(Pe=xe);var Oe,Ae=xe;do if(Oe=!1,Ae.steiner||!Y(Ae,Ae.next)&&V(Ae.prev,Ae,Ae.next)!==0)Ae=Ae.next;else{var ze=Ae.prev;if(Ne(Ae),(Ae=Pe=ze)===Ae.next)break;Oe=!0}while(Oe||Ae!==Pe);return Pe}function r(xe,Pe,Oe,Ae,ze,Ge,Je){if(xe){!Je&&Ge&&S(xe,Ae,ze,Ge);for(var et,tt,ft=xe;xe.prev!==xe.next;)if(et=xe.prev,tt=xe.next,Ge?s(xe,Ae,ze,Ge):n(xe))Pe.push(et.i/Oe),Pe.push(xe.i/Oe),Pe.push(tt.i/Oe),Ne(xe),xe=tt.next,ft=tt.next;else if((xe=tt)===ft){Je?Je===1?r(xe=o(i(xe),Pe,Oe),Pe,Oe,Ae,ze,Ge,2):Je===2&&a(xe,Pe,Oe,Ae,ze,Ge):r(i(xe),Pe,Oe,Ae,ze,Ge,1);break}}}function n(xe){var Pe=xe.prev,Oe=xe,Ae=xe.next;if(V(Pe,Oe,Ae)>=0)return!1;for(var ze=xe.next.next;ze!==xe.prev;){if(N(Pe.x,Pe.y,Oe.x,Oe.y,Ae.x,Ae.y,ze.x,ze.y)&&V(ze.prev,ze,ze.next)>=0)return!1;ze=ze.next}return!0}function s(xe,Pe,Oe,Ae){var ze=xe.prev,Ge=xe,Je=xe.next;if(V(ze,Ge,Je)>=0)return!1;for(var et=ze.xGe.x?ze.x>Je.x?ze.x:Je.x:Ge.x>Je.x?Ge.x:Je.x,Pt=ze.y>Ge.y?ze.y>Je.y?ze.y:Je.y:Ge.y>Je.y?Ge.y:Je.y,$t=O(et,tt,Pe,Oe,Ae),St=O(ft,Pt,Pe,Oe,Ae),Tt=xe.prevZ,Lt=xe.nextZ;Tt&&Tt.z>=$t&&Lt&&Lt.z<=St;){if(Tt!==xe.prev&&Tt!==xe.next&&N(ze.x,ze.y,Ge.x,Ge.y,Je.x,Je.y,Tt.x,Tt.y)&&V(Tt.prev,Tt,Tt.next)>=0||(Tt=Tt.prevZ,Lt!==xe.prev&&Lt!==xe.next&&N(ze.x,ze.y,Ge.x,Ge.y,Je.x,Je.y,Lt.x,Lt.y)&&V(Lt.prev,Lt,Lt.next)>=0))return!1;Lt=Lt.nextZ}for(;Tt&&Tt.z>=$t;){if(Tt!==xe.prev&&Tt!==xe.next&&N(ze.x,ze.y,Ge.x,Ge.y,Je.x,Je.y,Tt.x,Tt.y)&&V(Tt.prev,Tt,Tt.next)>=0)return!1;Tt=Tt.prevZ}for(;Lt&&Lt.z<=St;){if(Lt!==xe.prev&&Lt!==xe.next&&N(ze.x,ze.y,Ge.x,Ge.y,Je.x,Je.y,Lt.x,Lt.y)&&V(Lt.prev,Lt,Lt.next)>=0)return!1;Lt=Lt.nextZ}return!0}function o(xe,Pe,Oe){var Ae=xe;do{var ze=Ae.prev,Ge=Ae.next.next;!Y(ze,Ge)&&X(ze,Ae,Ae.next,Ge)&&ge(ze,Ge)&&ge(Ge,ze)&&(Pe.push(ze.i/Oe),Pe.push(Ae.i/Oe),Pe.push(Ge.i/Oe),Ne(Ae),Ne(Ae.next),Ae=xe=Ge),Ae=Ae.next}while(Ae!==xe);return i(Ae)}function a(xe,Pe,Oe,Ae,ze,Ge){var Je=xe;do{for(var et=Je.next.next;et!==Je.prev;){if(Je.i!==et.i&&G(Je,et)){var tt=Ie(Je,et);return Je=i(Je,Je.next),tt=i(tt,tt.next),r(Je,Pe,Oe,Ae,ze,Ge),void r(tt,Pe,Oe,Ae,ze,Ge)}et=et.next}Je=Je.next}while(Je!==xe)}function l(xe,Pe,Oe,Ae){var ze,Ge,Je,et=[];for(ze=0,Ge=Pe.length;ze=Ae.next.y&&Ae.next.y!==Ae.y){var et=Ae.x+(Ge-Ae.y)*(Ae.next.x-Ae.x)/(Ae.next.y-Ae.y);if(et<=ze&&et>Je){if(Je=et,et===ze){if(Ge===Ae.y)return Ae;if(Ge===Ae.next.y)return Ae.next}Oe=Ae.x=Ae.x&&Ae.x>=Pt&&ze!==Ae.x&&N(Ge<$t?ze:Je,Ge,Pt,$t,Ge<$t?Je:ze,Ge,Ae.x,Ae.y)&&(tt=Math.abs(Ge-Ae.y)/(ze-Ae.x),ge(Ae,xe)&&(ttOe.x||Ae.x===Oe.x&&v(Oe,Ae)))&&(Oe=Ae,St=tt)),Ae=Ae.next;while(Ae!==ft);return Oe}function v(xe,Pe){return V(xe.prev,xe,Pe.prev)<0&&V(Pe.next,xe,xe.next)<0}function S(xe,Pe,Oe,Ae){var ze=xe;do ze.z===null&&(ze.z=O(ze.x,ze.y,Pe,Oe,Ae)),ze.prevZ=ze.prev,ze.nextZ=ze.next,ze=ze.next;while(ze!==xe);ze.prevZ.nextZ=null,ze.prevZ=null,I(ze)}function I(xe){var Pe,Oe,Ae,ze,Ge,Je,et,tt,ft=1;do{for(Oe=xe,xe=null,Ge=null,Je=0;Oe;){for(Je++,Ae=Oe,et=0,Pe=0;Pe0||tt>0&&Ae;)et!==0&&(tt===0||!Ae||Oe.z<=Ae.z)?(ze=Oe,Oe=Oe.nextZ,et--):(ze=Ae,Ae=Ae.nextZ,tt--),Ge?Ge.nextZ=ze:xe=ze,ze.prevZ=Ge,Ge=ze;Oe=Ae}Ge.nextZ=null,ft*=2}while(Je>1);return xe}function O(xe,Pe,Oe,Ae,ze){return(xe=1431655765&((xe=858993459&((xe=252645135&((xe=16711935&((xe=32767*(xe-Oe)*ze)|xe<<8))|xe<<4))|xe<<2))|xe<<1))|(Pe=1431655765&((Pe=858993459&((Pe=252645135&((Pe=16711935&((Pe=32767*(Pe-Ae)*ze)|Pe<<8))|Pe<<4))|Pe<<2))|Pe<<1))<<1}function L(xe){var Pe=xe,Oe=xe;do(Pe.x=0&&(xe-Je)*(Ae-et)-(Oe-Je)*(Pe-et)>=0&&(Oe-Je)*(Ge-et)-(ze-Je)*(Ae-et)>=0}function G(xe,Pe){return xe.next.i!==Pe.i&&xe.prev.i!==Pe.i&&!fe(xe,Pe)&&(ge(xe,Pe)&&ge(Pe,xe)&&_e(xe,Pe)&&(V(xe.prev,xe,Pe.prev)||V(xe,Pe.prev,Pe))||Y(xe,Pe)&&V(xe.prev,xe,xe.next)>0&&V(Pe.prev,Pe,Pe.next)>0)}function V(xe,Pe,Oe){return(Pe.y-xe.y)*(Oe.x-Pe.x)-(Pe.x-xe.x)*(Oe.y-Pe.y)}function Y(xe,Pe){return xe.x===Pe.x&&xe.y===Pe.y}function X(xe,Pe,Oe,Ae){var ze=re(V(xe,Pe,Oe)),Ge=re(V(xe,Pe,Ae)),Je=re(V(Oe,Ae,xe)),et=re(V(Oe,Ae,Pe));return ze!==Ge&&Je!==et||!(ze!==0||!te(xe,Oe,Pe))||!(Ge!==0||!te(xe,Ae,Pe))||!(Je!==0||!te(Oe,xe,Ae))||!(et!==0||!te(Oe,Pe,Ae))}function te(xe,Pe,Oe){return Pe.x<=Math.max(xe.x,Oe.x)&&Pe.x>=Math.min(xe.x,Oe.x)&&Pe.y<=Math.max(xe.y,Oe.y)&&Pe.y>=Math.min(xe.y,Oe.y)}function re(xe){return xe>0?1:xe<0?-1:0}function fe(xe,Pe){var Oe=xe;do{if(Oe.i!==xe.i&&Oe.next.i!==xe.i&&Oe.i!==Pe.i&&Oe.next.i!==Pe.i&&X(Oe,Oe.next,xe,Pe))return!0;Oe=Oe.next}while(Oe!==xe);return!1}function ge(xe,Pe){return V(xe.prev,xe,xe.next)<0?V(xe,Pe,xe.next)>=0&&V(xe,xe.prev,Pe)>=0:V(xe,Pe,xe.prev)<0||V(xe,xe.next,Pe)<0}function _e(xe,Pe){var Oe=xe,Ae=!1,ze=(xe.x+Pe.x)/2,Ge=(xe.y+Pe.y)/2;do Oe.y>Ge!=Oe.next.y>Ge&&Oe.next.y!==Oe.y&&ze<(Oe.next.x-Oe.x)*(Ge-Oe.y)/(Oe.next.y-Oe.y)+Oe.x&&(Ae=!Ae),Oe=Oe.next;while(Oe!==xe);return Ae}function Ie(xe,Pe){var Oe=new J(xe.i,xe.x,xe.y),Ae=new J(Pe.i,Pe.x,Pe.y),ze=xe.next,Ge=Pe.prev;return xe.next=Pe,Pe.prev=xe,Oe.next=ze,ze.prev=Oe,Ae.next=Oe,Oe.prev=Ae,Ge.next=Ae,Ae.prev=Ge,Ae}function ke(xe,Pe,Oe,Ae){var ze=new J(xe,Pe,Oe);return Ae?(ze.next=Ae.next,ze.prev=Ae,Ae.next.prev=ze,Ae.next=ze):(ze.prev=ze,ze.next=ze),ze}function Ne(xe){xe.next.prev=xe.prev,xe.prev.next=xe.next,xe.prevZ&&(xe.prevZ.nextZ=xe.nextZ),xe.nextZ&&(xe.nextZ.prevZ=xe.prevZ)}function J(xe,Pe,Oe){this.i=xe,this.x=Pe,this.y=Oe,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function he(xe,Pe,Oe,Ae){for(var ze=0,Ge=Pe,Je=Oe-Ae;Ge0&&(Ae+=xe[ze-1].length,Oe.holes.push(Ae))}return Oe},t},(L1t=F1t())!==void 0&&(D1t.exports=L1t);let n9i=class JLt extends ofe{constructor(e,i,r,n,s,o,a){super(e,i,r),this.type=_g.FILL,this._patternMap=new Map,this._fillVertexBuffer=n,this._fillIndexBuffer=s,this._outlineVertexBuffer=o,this._outlineIndexBuffer=a}get fillIndexStart(){return this._fillIndexStart}get fillIndexCount(){return this._fillIndexCount}get outlineIndexStart(){return this._outlineIndexStart}get outlineIndexCount(){return this._outlineIndexCount}getResources(e,i,r){const n=this.layer,s=this.zoom,o=n.getPaintProperty("fill-pattern");if(o)if(o.isDataDriven)for(const a of this._features)i(o.getValue(s,a),!0);else i(o.getValue(s),!0)}processFeatures(e){this._fillIndexStart=3*this._fillIndexBuffer.index,this._fillIndexCount=0,this._outlineIndexStart=3*this._outlineIndexBuffer.index,this._outlineIndexCount=0;const i=this.layer,r=this.zoom,{fillMaterial:n,outlineMaterial:s,hasDataDrivenFill:o,hasDataDrivenOutline:a}=i;e&&e.setExtent(this.layerExtent);const l=i.getPaintProperty("fill-pattern"),c=l?.isDataDriven;let d=!l&&i.getPaintValue("fill-antialias",r);if(i.outlineUsesFillColor){if(d&&!i.hasDataDrivenOpacity){const v=i.getPaintValue("fill-opacity",r),S=i.getPaintValue("fill-opacity",r+1);v<1&&S<1&&(d=!1)}if(d&&!i.hasDataDrivenColor){const v=i.getPaintValue("fill-color",r),S=i.getPaintValue("fill-color",r+1);v[3]<1&&S[3]<1&&(d=!1)}}const p=this._features,y=e?.validateTessellation;if(c){const v=[];for(const S of p){const I=l.getValue(r,S),O=this._spriteInfo[I];if(!O||!O.rect)continue;const L=n.encodeAttributes(S,r,i,O),N=d&&a?s.encodeAttributes(S,r,i):[],G=S.getGeometry(e);v.push({ddFillAttributes:L,ddOutlineAttributes:N,page:O.page,geometry:G}),v.sort((V,Y)=>V.page-Y.page);for(const{ddFillAttributes:V,ddOutlineAttributes:Y,page:X,geometry:te}of v)this._processFeature(te,d,i.outlineUsesFillColor,V,Y,y,X)}}else for(const v of p){const S=o?n.encodeAttributes(v,r,i):null,I=d&&a?s.encodeAttributes(v,r,i):null,O=v.getGeometry(e);this._processFeature(O,d,i.outlineUsesFillColor,S,I,y)}}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 i=new Uint32Array(e),r=new Int32Array(i.buffer);let n=0;i[n++]=this.type,i[n++]=this.layerUIDs.length;for(let a=0;a0)for(const[a,[l,c]]of s)i[n++]=a,i[n++]=l,i[n++]=c;i[n++]=this._fillVertexBuffer.array.length;for(let a=0;ad?(p!==void 0&&this._processFill(e,p,n,o,a),p=[y]):v<-d&&p!==void 0&&p.push(y)}p!==void 0&&this._processFill(e,p,n,o,a)}_processOutline(e,i){const r=this._outlineVertexBuffer,n=this._outlineIndexBuffer,s=n.index;let o,a,l;const c=new Xo(0,0),d=new Xo(0,0),p=new Xo(0,0);let y=-1,v=-1,S=-1,I=-1,O=-1,L=!1;const N=0;let G=e.length;if(G<2)return;const V=e[N];let Y=e[G-1];for(;G&&Y.isEqual(V);)--G,Y=e[G-1];if(!(G-N<2)){for(let X=N;X8&&(ge=8),re>=0?(S=r.add(a.x,a.y,c.x,c.y,0,1,i),I===-1&&(I=S),y>=0&&v>=0&&S>=0&&!te&&n.add(y,v,S),v=r.add(a.x,a.y,ge*-p.x,ge*-p.y,0,-1,i),O===-1&&(O=v),y>=0&&v>=0&&S>=0&&!te&&n.add(y,v,S),y=v,v=S,S=r.add(a.x,a.y,p.x,p.y,0,1,i),y>=0&&v>=0&&S>=0&&!te&&n.add(y,v,S),v=r.add(a.x,a.y,d.x,d.y,0,1,i),y>=0&&v>=0&&S>=0&&!te&&n.add(y,v,S)):(S=r.add(a.x,a.y,ge*p.x,ge*p.y,0,1,i),I===-1&&(I=S),y>=0&&v>=0&&S>=0&&!te&&n.add(y,v,S),v=r.add(a.x,a.y,-c.x,-c.y,0,-1,i),O===-1&&(O=v),y>=0&&v>=0&&S>=0&&!te&&n.add(y,v,S),y=v,v=S,S=r.add(a.x,a.y,-p.x,-p.y,0,-1,i),y>=0&&v>=0&&S>=0&&!te&&n.add(y,v,S),y=r.add(a.x,a.y,-d.x,-d.y,0,-1,i),y>=0&&v>=0&&S>=0&&!te&&n.add(y,v,S))}y>=0&&v>=0&&I>=0&&!L&&n.add(y,v,I),y>=0&&I>=0&&O>=0&&!L&&n.add(y,O,I),this._outlineIndexCount+=3*(n.index-s)}}_processFill(e,i,r,n,s){n=!0;let o;i.length>1&&(o=[]);let a=0;for(const p of i)a!==0&&o.push(a),a+=e[p].length;const l=2*a,c=Bg.acquire();for(const p of i){const y=e[p],v=y.length;for(let S=0;S0){const p=i.map(S=>e[S].length),{buffer:y,vertexCount:v}=R1t(c,p);if(v>0){const S=this._fillVertexBuffer.index;for(let I=0;I0){const y=this._fillVertexBuffer.index;let v=0;for(;v=4160:e.y===i.y&&(e.y<=-64||e.y>=4160)}static _area(e){let i=0;const r=e.length-1;for(let n=0;nr){s=!0;const G=(r-n)/S;S=r-n,d=(1-G)*o+G*d,p=(1-G)*a+G*p,--c}const I=this._writeVertex(o,a,0,0,y,v,v,-y,0,-1,n),O=this._writeVertex(o,a,0,0,y,v,-v,y,0,1,n);n+=S;const L=this._writeVertex(d,p,0,0,y,v,v,-y,0,-1,n),N=this._writeVertex(d,p,0,0,y,v,-v,y,0,1,n);this._writeTriangle(I,O,L),this._writeTriangle(O,L,N),o=d,a=p}}_tessellate(e,i){const r=e[0],n=e[e.length-1],s=k1t(r,n),o=s?3:2;if(e.length{const ft=he(I,O,te,re,Ge,Je,Ae,ze,et,tt,J);return Ie>=0&&ke>=0&&ft>=0&&xe(Ie,ke,ft),Ie=ke,ke=ft,ft};s&&(S=e[e.length-2],G.x=n.x-S.x,G.y=n.y-S.y,Y=A4e(G),G.x/=Y,G.y/=Y);let Oe=!1;for(let Ae=0;AeNe&&(Oe=!0)),Oe){const Pt=(Ne-J)/V;V=Ne-J,S={x:(1-Pt)*S.x+Pt*e[Ae].x,y:(1-Pt)*S.y+Pt*e[Ae].y},--Ae}else S=e[Ae];I=S.x,O=S.y;const ze=Ae<=0&&!Oe,Ge=Ae===e.length-1;if(ze||(J+=V),L=Ge?s?e[1]:null:e[Ae+1],L?(G.x=L.x-I,G.y=L.y-O,Y=A4e(G),G.x/=Y,G.y/=Y):(G.x=void 0,G.y=void 0),!s){if(ze){tx(X,G),te=X.x,re=X.y,l===vf.SQUARE&&(Pe(-G.y-G.x,G.x-G.y,G.x,G.y,0,-1),Pe(G.y-G.x,-G.x-G.y,G.x,G.y,0,1)),l===vf.ROUND&&(Pe(-G.y-G.x,G.x-G.y,G.x,G.y,-1,-1),Pe(G.y-G.x,-G.x-G.y,G.x,G.y,-1,1)),l!==vf.ROUND&&l!==vf.BUTT||(Pe(-G.y,G.x,G.x,G.y,0,-1),Pe(G.y,-G.x,G.x,G.y,0,1));continue}if(Ge){yS(X,N),te=X.x,re=X.y,l!==vf.ROUND&&l!==vf.BUTT||(Pe(N.y,-N.x,-N.x,-N.y,0,-1),Pe(-N.y,N.x,-N.x,-N.y,0,1)),l===vf.SQUARE&&(Pe(N.y-N.x,-N.x-N.y,-N.x,-N.y,0,-1),Pe(-N.y-N.x,N.x-N.y,-N.x,-N.y,0,1)),l===vf.ROUND&&(Pe(N.y-N.x,-N.x-N.y,-N.x,-N.y,1,-1),Pe(-N.y-N.x,N.x-N.y,-N.x,-N.y,1,1));continue}}let Je,et,tt=-o9i(N,G);if(Math.abs(tt)<.01)$1t(N,G)>0?(X.x=N.x,X.y=N.y,tt=1,Je=Number.MAX_VALUE,et=!0):(tx(X,G),tt=1,Je=1,et=!1);else{X.x=(N.x+G.x)/tt,X.y=(N.y+G.y)/tt,Je=A4e(X);const Pt=(Je-1)*y*a;et=Je>4||Pt>V&&Pt>Y}te=X.x,re=X.y;let ft=c;switch(c){case Zf.BEVEL:Je<1.05&&(ft=Zf.MITER);break;case Zf.ROUND:Jed&&(ft=Zf.BEVEL)}switch(ft){case Zf.MITER:if(Pe(X.x,X.y,-N.x,-N.y,0,-1),Pe(-X.x,-X.y,-N.x,-N.y,0,1),Ge)break;if(v){const Pt=Oe?0:J;Ie=this._writeVertex(I,O,te,re,G.x,G.y,X.x,X.y,0,-1,Pt),ke=this._writeVertex(I,O,te,re,G.x,G.y,-X.x,-X.y,0,1,Pt)}break;case Zf.BEVEL:{const Pt=tt<0;let $t,St,Tt,Lt;if(Pt){const mt=Ie;Ie=ke,ke=mt,$t=fe,St=ge}else $t=ge,St=fe;if(et)Tt=Pt?tx(this._innerPrev,N):yS(this._innerPrev,N),Lt=Pt?yS(this._innerNext,G):tx(this._innerNext,G);else{const mt=Pt?I4e(this._inner,X):N1t(this._inner,X);Tt=mt,Lt=mt}const at=Pt?yS(this._bevelStart,N):tx(this._bevelStart,N);Pe(Tt.x,Tt.y,-N.x,-N.y,$t.x,$t.y);const Ee=Pe(at.x,at.y,-N.x,-N.y,St.x,St.y);if(Ge)break;const Be=Pt?tx(this._bevelEnd,G):yS(this._bevelEnd,G);if(et){const mt=this._writeVertex(I,O,te,re,-N.x,-N.y,0,0,0,0,J);Ie=this._writeVertex(I,O,te,re,G.x,G.y,Lt.x,Lt.y,$t.x,$t.y,J),ke=this._writeVertex(I,O,te,re,G.x,G.y,Be.x,Be.y,St.x,St.y,J),this._writeTriangle(Ee,mt,ke)}else{if(v){const mt=this._bevelMiddle;mt.x=(at.x+Be.x)/2,mt.y=(at.y+Be.y)/2,GU(_e,mt,-N.x,-N.y),Pe(mt.x,mt.y,-N.x,-N.y,_e.x,_e.y),GU(_e,mt,G.x,G.y),Ie=this._writeVertex(I,O,te,re,G.x,G.y,mt.x,mt.y,_e.x,_e.y,J),ke=this._writeVertex(I,O,te,re,G.x,G.y,Lt.x,Lt.y,$t.x,$t.y,J)}else{const mt=Ie;Ie=ke,ke=mt}Pe(Be.x,Be.y,G.x,G.y,St.x,St.y)}if(Pt){const mt=Ie;Ie=ke,ke=mt}break}case Zf.ROUND:{const Pt=tt<0;let $t,St;if(Pt){const gt=Ie;Ie=ke,ke=gt,$t=fe,St=ge}else $t=ge,St=fe;const Tt=Pt?I4e(this._inner,X):N1t(this._inner,X);let Lt,at;et?(Lt=Pt?tx(this._innerPrev,N):yS(this._innerPrev,N),at=Pt?yS(this._innerNext,G):tx(this._innerNext,G)):(Lt=Tt,at=Tt);const Ee=Pt?yS(this._roundStart,N):tx(this._roundStart,N),Be=Pt?tx(this._roundEnd,G):yS(this._roundEnd,G),mt=Pe(Lt.x,Lt.y,-N.x,-N.y,$t.x,$t.y),kt=Pe(Ee.x,Ee.y,-N.x,-N.y,St.x,St.y);if(Ge)break;const ct=this._writeVertex(I,O,te,re,-N.x,-N.y,0,0,0,0,J);et||this._writeTriangle(Ie,ke,ct);const le=I4e(this._outer,Tt),it=this._writeVertex(I,O,te,re,G.x,G.y,Be.x,Be.y,St.x,St.y,J);let pt,Le;const ce=Je>2;if(ce){let gt;Je!==Number.MAX_VALUE?(le.x/=Je,le.y/=Je,gt=$1t(N,le),gt=(Je*(gt*gt-1)+1)/gt):gt=-1,pt=Pt?yS(this._startBreak,N):tx(this._startBreak,N),pt.x+=N.x*gt,pt.y+=N.y*gt,Le=Pt?tx(this._endBreak,G):yS(this._endBreak,G),Le.x+=G.x*gt,Le.y+=G.y*gt}GU(_e,le,-N.x,-N.y);const Ce=this._writeVertex(I,O,te,re,-N.x,-N.y,le.x,le.y,_e.x,_e.y,J);GU(_e,le,G.x,G.y);const Ze=v?this._writeVertex(I,O,te,re,G.x,G.y,le.x,le.y,_e.x,_e.y,J):Ce,yt=ct,Ve=v?this._writeVertex(I,O,te,re,G.x,G.y,0,0,0,0,J):ct;let At=-1,ii=-1;if(ce&&(GU(_e,pt,-N.x,-N.y),At=this._writeVertex(I,O,te,re,-N.x,-N.y,pt.x,pt.y,_e.x,_e.y,J),GU(_e,Le,G.x,G.y),ii=this._writeVertex(I,O,te,re,G.x,G.y,Le.x,Le.y,_e.x,_e.y,J)),v?ce?(this._writeTriangle(yt,kt,At),this._writeTriangle(yt,At,Ce),this._writeTriangle(Ve,Ze,ii),this._writeTriangle(Ve,ii,it)):(this._writeTriangle(yt,kt,Ce),this._writeTriangle(Ve,Ze,it)):ce?(this._writeTriangle(ct,kt,At),this._writeTriangle(ct,At,ii),this._writeTriangle(ct,ii,it)):(this._writeTriangle(ct,kt,Ce),this._writeTriangle(ct,Ze,it)),et?(Ie=this._writeVertex(I,O,te,re,G.x,G.y,at.x,at.y,$t.x,$t.y,J),ke=it):(Ie=v?this._writeVertex(I,O,te,re,G.x,G.y,at.x,at.y,$t.x,$t.y,J):mt,this._writeTriangle(Ie,Ve,it),ke=it),Pt){const gt=Ie;Ie=ke,ke=gt}break}}}}};const a9i=65535;let l9i=class extends ofe{constructor(e,i,r,n,s){super(e,i,r),this.type=_g.LINE,this._tessellationOptions={pixelCoordRatio:8,halfWidth:0,offset:0},this._patternMap=new Map,this.tessellationProperties={_lineVertexBuffer:null,_lineIndexBuffer:null,_ddValues:null},this.tessellationProperties._lineVertexBuffer=n,this.tessellationProperties._lineIndexBuffer=s,this._lineTessellator=new B1t(u9i(this.tessellationProperties),c9i(this.tessellationProperties),e.canUseThinTessellation)}get lineIndexStart(){return this._lineIndexStart}get lineIndexCount(){return this._lineIndexCount}getResources(e,i,r){const n=this.layer,s=this.zoom,o=n.getPaintProperty("line-pattern"),a=n.getPaintProperty("line-dasharray"),l=n.getLayoutProperty("line-cap");if(!o&&!a)return;const c=l?.getValue(s)||0,d=l?.isDataDriven,p=o?.isDataDriven,y=a?.isDataDriven;if(p||y)for(const v of this._features)i(p?o.getValue(s,v):this._getDashArrayKey(v,s,n,a,d,l,c));else if(o)i(o.getValue(s));else if(a){const v=a.getValue(s);i(n.getDashKey(v,c))}}processFeatures(e){this._lineIndexStart=3*this.tessellationProperties._lineIndexBuffer.index,this._lineIndexCount=0;const i=this.layer,r=this.zoom,n=this._features,s=this._tessellationOptions,{hasDataDrivenLine:o,lineMaterial:a}=i;e&&e.setExtent(this.layerExtent);const l=i.getPaintProperty("line-pattern"),c=i.getPaintProperty("line-dasharray"),d=l?.isDataDriven,p=c?.isDataDriven;let y;y=i.getLayoutProperty("line-cap");const v=y?.isDataDriven?y:null,S=v?null:i.getLayoutValue("line-cap",r),I=S||0,O=!!v;y=i.getLayoutProperty("line-join");const L=y?.isDataDriven?y:null,N=L?null:i.getLayoutValue("line-join",r);y=i.getLayoutProperty("line-miter-limit");const G=y?.isDataDriven?y:null,V=G?null:i.getLayoutValue("line-miter-limit",r);y=i.getLayoutProperty("line-round-limit");const Y=y?.isDataDriven?y:null,X=Y?null:i.getLayoutValue("line-round-limit",r);y=i.getPaintProperty("line-width");const te=y?.isDataDriven?y:null,re=te?null:i.getPaintValue("line-width",r);y=i.getPaintProperty("line-offset");const fe=y?.isDataDriven?y:null,ge=fe?null:i.getPaintValue("line-offset",r);if(d||p){const _e=[];for(const Ie of n){const ke=d?l.getValue(r,Ie):this._getDashArrayKey(Ie,r,i,c,O,v,I),Ne=this._spriteInfo[ke];if(!Ne||!Ne.rect)continue;const J=a.encodeAttributes(Ie,r,i,Ne),he=Ie.getGeometry(e);_e.push({ddAttributes:J,page:Ne.page,cap:v?v.getValue(r,Ie):S,join:L?L.getValue(r,Ie):N,miterLimit:G?G.getValue(r,Ie):V,roundLimit:Y?Y.getValue(r,Ie):X,halfWidth:.5*(te?te.getValue(r,Ie):re),offset:fe?fe.getValue(r,Ie):ge,geometry:he})}_e.sort((Ie,ke)=>Ie.page-ke.page),s.textured=!0;for(const{ddAttributes:Ie,page:ke,cap:Ne,join:J,miterLimit:he,roundLimit:xe,halfWidth:Pe,offset:Oe,geometry:Ae}of _e)s.capType=Ne,s.joinType=J,s.miterLimit=he,s.roundLimit=xe,s.halfWidth=Pe,s.offset=Oe,this._processFeature(Ae,Ie,ke)}else{if(l){const _e=l.getValue(r),Ie=this._spriteInfo[_e];if(!Ie||!Ie.rect)return}s.textured=!(!l&&!c),s.capType=S,s.joinType=N,s.miterLimit=V,s.roundLimit=X,s.halfWidth=.5*re,s.offset=ge;for(const _e of n){const Ie=o?a.encodeAttributes(_e,r,i):null;v&&(s.capType=v.getValue(r,_e)),L&&(s.joinType=L.getValue(r,_e)),G&&(s.miterLimit=G.getValue(r,_e)),Y&&(s.roundLimit=Y.getValue(r,_e)),te&&(s.halfWidth=.5*te.getValue(r,_e)),fe&&(s.offset=fe.getValue(r,_e));const ke=_e.getGeometry(e);this._processFeature(ke,Ie)}}}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 i=new Uint32Array(e),r=new Int32Array(i.buffer);let n=0;i[n++]=this.type,i[n++]=this.layerUIDs.length;for(let a=0;a0)for(const[a,[l,c]]of s)i[n++]=a,i[n++]=l,i[n++]=c;i[n++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let a=0;a(e,i,r,n,s,o,a,l,c,d,p)=>(t._lineVertexBuffer.add(e,i,a,l,r,n,s,o,c,d,p,t._ddValues),t._lineVertexBuffer.index-1),c9i=t=>(e,i,r)=>{t._lineIndexBuffer.add(e,i,r)},afe=[["(",")"],[")","("],["<",">"],[">","<"],["[","]"],["]","["],["{","}"],["}","{"],["«","»"],["»","«"],["‹","›"],["›","‹"],["⁽","⁾"],["⁾","⁽"],["₍","₎"],["₎","₍"],["≤","≥"],["≥","≤"],["〈","〉"],["〉","〈"],["﹙","﹚"],["﹚","﹙"],["﹛","﹜"],["﹜","﹛"],["﹝","﹞"],["﹞","﹝"],["﹤","﹥"],["﹥","﹤"]],VU=["آ","أ","إ","ا"],h9i=["ﻵ","ﻷ","ﻹ","ﻻ"],d9i=["ﻶ","ﻸ","ﻺ","ﻼ"],lfe=["ا","ب","ت","ث","ج","ح","خ","د","ذ","ر","ز","س","ش","ص","ض","ط","ظ","ع","غ","ف","ق","ك","ل","م","ن","ه","و","ي","إ","أ","آ","ة","ى","ل","م","ن","ه","و","ي","إ","أ","آ","ة","ى","ی","ئ","ؤ"],p9i=["ﺍ","ﺏ","ﺕ","ﺙ","ﺝ","ﺡ","ﺥ","ﺩ","ﺫ","ﺭ","ﺯ","ﺱ","ﺵ","ﺹ","ﺽ","ﻁ","ﻅ","ﻉ","ﻍ","ﻑ","ﻕ","ﻙ","ﻝ","ﻡ","ﻥ","ﻩ","ﻭ","ﻱ","ﺇ","ﺃ","ﺁ","ﺓ","ﻯ","ﯼ","ﺉ","ﺅ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺉ","ﺅ"],f9i=["ﺎ","ﺐ","ﺖ","ﺚ","ﺞ","ﺢ","ﺦ","ﺪ","ﺬ","ﺮ","ﺰ","ﺲ","ﺶ","ﺺ","ﺾ","ﻂ","ﻆ","ﻊ","ﻎ","ﻒ","ﻖ","ﻚ","ﻞ","ﻢ","ﻦ","ﻪ","ﻮ","ﻲ","ﺈ","ﺄ","ﺂ","ﺔ","ﻰ","ﯽ","ﺊ","ﺆ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺊ","ﺆ"],m9i=["ﺎ","ﺒ","ﺘ","ﺜ","ﺠ","ﺤ","ﺨ","ﺪ","ﺬ","ﺮ","ﺰ","ﺴ","ﺸ","ﺼ","ﻀ","ﻄ","ﻈ","ﻌ","ﻐ","ﻔ","ﻘ","ﻜ","ﻠ","ﻤ","ﻨ","ﻬ","ﻮ","ﻴ","ﺈ","ﺄ","ﺂ","ﺔ","ﻰ","ﯿ","ﺌ","ﺆ","ﹱ","ﹲ","ﹴ","ﹷ","ﹹ","ﹻ","ﹽ","ﹿ","ﺀ","ﺌ","ﺆ"],g9i=["ﺍ","ﺑ","ﺗ","ﺛ","ﺟ","ﺣ","ﺧ","ﺩ","ﺫ","ﺭ","ﺯ","ﺳ","ﺷ","ﺻ","ﺿ","ﻃ","ﻇ","ﻋ","ﻏ","ﻓ","ﻗ","ﻛ","ﻟ","ﻣ","ﻧ","ﻫ","ﻭ","ﻳ","ﺇ","ﺃ","ﺁ","ﺓ","ﻯ","ﯾ","ﺋ","ﺅ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺋ","ﺅ"],G1t=["ء","آ","أ","ؤ","إ","ا","ة","د","ذ","ر","ز","و","ى"],y9i=["ً","ً","ٌ","؟","ٍ","؟","َ","َ","ُ","ُ","ِ","ِ","ّ","ّ","ْ","ْ","ء","آ","آ","أ","أ","ؤ","ؤ","إ","إ","ئ","ئ","ئ","ئ","ا","ا","ب","ب","ب","ب","ة","ة","ت","ت","ت","ت","ث","ث","ث","ث","ج","ج","ج","ج","ح","ح","ح","ح","خ","خ","خ","خ","د","د","ذ","ذ","ر","ر","ز","ز","س","س","س","س","ش","ش","ش","ش","ص","ص","ص","ص","ض","ض","ض","ض","ط","ط","ط","ط","ظ","ظ","ظ","ظ","ع","ع","ع","ع","غ","غ","غ","غ","ف","ف","ف","ف","ق","ق","ق","ق","ك","ك","ك","ك","ل","ل","ل","ل","م","م","م","م","ن","ن","ن","ن","ه","ه","ه","ه","و","و","ى","ى","ي","ي","ي","ي","ﻵ","ﻶ","ﻷ","ﻸ","ﻹ","ﻺ","ﻻ","ﻼ","؟","؟","؟"],V1t=["ء","ف"],v9i=["غ","ي"],_9i=[[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]],b9i=[[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]],Ut=0,Or=1,ro=2,zp=3,vt=4,vE=5,ufe=6,wt=7,w0=8,Ev=9,vS=10,Mo=11,Wi=12,w9i=13,x9i=14,S9i=15,C9i=16,T9i=17,cs=18,E9i=["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"],_E=100,I9i=[_E+0,Ut,Ut,Ut,Ut,_E+1,_E+2,_E+3,Or,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,_E+4,vt,vt,vt,Ut,vt,Ut,vt,Ut,vt,vt,vt,Ut,Ut,vt,vt,Ut,Ut,Ut,Ut,Ut,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,Ut,Ut,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,Ut,Ut,vt,vt,Ut,Ut,vt,vt,Ut,Ut,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,Ut,Ut,Ut,_E+5,wt,wt,_E+6,_E+7],A9i=[[cs,cs,cs,cs,cs,cs,cs,cs,cs,ufe,vE,ufe,w0,vE,cs,cs,cs,cs,cs,cs,cs,cs,cs,cs,cs,cs,cs,cs,vE,vE,vE,ufe,w0,vt,vt,Mo,Mo,Mo,vt,vt,vt,vt,vt,vS,Ev,vS,Ev,Ev,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,Ev,vt,vt,vt,vt,vt,vt,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,vt,vt,vt,vt,vt,vt,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,vt,vt,vt,vt,cs,cs,cs,cs,cs,cs,vE,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,Ev,vt,Mo,Mo,Mo,Mo,vt,vt,vt,vt,Ut,vt,vt,cs,vt,vt,Mo,Mo,ro,ro,vt,Ut,vt,vt,vt,ro,Ut,vt,vt,vt,vt,vt,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,vt,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,vt,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut],[Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,vt,vt,vt,vt,vt,vt,vt,vt,vt,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,vt,vt,Ut,Ut,Ut,Ut,Ut,Ut,Ut,vt,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,vt,Ut,vt,vt,vt,vt,vt,vt,vt,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Or,Wi,Or,Wi,Wi,Or,Wi,Wi,Or,Wi,vt,vt,vt,vt,vt,vt,vt,vt,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,vt,vt,vt,vt,vt,Or,Or,Or,Or,Or,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt],[zp,zp,zp,zp,vt,vt,vt,vt,wt,Mo,Mo,wt,Ev,wt,vt,vt,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,wt,vt,vt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,zp,zp,zp,zp,zp,zp,zp,zp,zp,zp,Mo,zp,zp,wt,wt,wt,Wi,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,Wi,Wi,Wi,Wi,Wi,Wi,Wi,zp,vt,Wi,Wi,Wi,Wi,Wi,Wi,wt,wt,Wi,Wi,vt,Wi,Wi,Wi,Wi,wt,wt,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,wt,wt,wt,wt,wt,wt],[wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,vt,wt,wt,Wi,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,vt,vt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,wt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Or,Or,vt,vt,vt,vt,Or,vt,vt,vt,vt,vt],[w0,w0,w0,w0,w0,w0,w0,w0,w0,w0,w0,cs,cs,cs,Ut,Or,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,w0,vE,w9i,x9i,S9i,C9i,T9i,Ev,Mo,Mo,Mo,Mo,Mo,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,Ev,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,w0,cs,cs,cs,cs,cs,vt,vt,vt,vt,vt,cs,cs,cs,cs,cs,cs,ro,Ut,vt,vt,ro,ro,ro,ro,ro,ro,vS,vS,vt,vt,vt,Ut,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,vS,vS,vt,vt,vt,vt,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,vt,vt,vt,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,Mo,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt],[Ut,Ut,Ut,Ut,Ut,Ut,Ut,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,Ut,Ut,Ut,Ut,Ut,vt,vt,vt,vt,vt,Or,Wi,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,vS,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,vt,Or,Or,Or,Or,Or,vt,Or,vt,Or,Or,vt,Or,Or,vt,Or,Or,Or,Or,Or,Or,Or,Or,Or,Or,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt],[Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,Wi,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,Wi,Wi,Wi,Wi,Wi,Wi,Wi,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,Ev,vt,Ev,vt,vt,Ev,vt,vt,vt,vt,vt,vt,vt,vt,vt,Mo,vt,vt,vS,vS,vt,vt,vt,vt,vt,Mo,Mo,vt,vt,vt,vt,vt,wt,wt,wt,wt,wt,vt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,wt,vt,vt,cs],[vt,vt,vt,Mo,Mo,Mo,vt,vt,vt,vt,vt,vS,Ev,vS,Ev,Ev,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,Ev,vt,vt,vt,vt,vt,vt,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,vt,vt,vt,vt,vt,vt,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,Ut,vt,vt,vt,Ut,Ut,Ut,Ut,Ut,Ut,vt,vt,Ut,Ut,Ut,Ut,Ut,Ut,vt,vt,Ut,Ut,Ut,Ut,Ut,Ut,vt,vt,Ut,Ut,Ut,vt,vt,vt,Mo,Mo,vt,vt,vt,Mo,Mo,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt,vt]];let U1t=class{constructor(){this.inputFormat="ILYNN",this.outputFormat="VLNNN",this.sourceToTarget=[],this.targetToSource=[],this.levels=[]}bidiTransform(e,i,r){if(this.sourceToTarget=[],this.targetToSource=[],!e)return"";if(H9i(this.sourceToTarget,this.targetToSource,e.length),!this.checkParameters(i,r))return e;i=this.inputFormat,r=this.outputFormat;let n=e;const s=q9i,o=q1t(i.charAt(1)),a=q1t(r.charAt(1)),l=(i.charAt(0)==="I"?"L":i.charAt(0))+o,c=(r.charAt(0)==="I"?"L":r.charAt(0))+a,d=i.charAt(2)+r.charAt(2);s.defInFormat=l,s.defOutFormat=c,s.defSwap=d;const p=ZJ(e,l,c,d,s);let y=!1;return r.charAt(1)==="R"?y=!0:r.charAt(1)!=="C"&&r.charAt(1)!=="D"||(y=this.checkContextual(p)==="rtl"),this.sourceToTarget=yb,this.targetToSource=W9i(this.sourceToTarget),hfe=this.targetToSource,n=i.charAt(3)===r.charAt(3)?p:r.charAt(3)==="S"?O9i(y,p,!0):D9i(p,y,!0),this.sourceToTarget=yb,this.targetToSource=hfe,this.levels=dfe,n}_inputFormatSetter(e){if(!X1t.test(e))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.inputFormat=e}_outputFormatSetter(e){if(!X1t.test(e))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.outputFormat=e}checkParameters(e,i){return e?this._inputFormatSetter(e):e=this.inputFormat,i?this._outputFormatSetter(i):i=this.outputFormat,e!==i}checkContextual(e){let i=cfe(e);if(i!=="ltr"&&i!=="rtl"){try{i=document.dir.toLowerCase()}catch{}i!=="ltr"&&i!=="rtl"&&(i="ltr")}return i}hasBidiChar(e){return K9i.test(e)}};function ZJ(t,e,i,r,n){const s=P9i(t,{inFormat:e,outFormat:i,swap:r},n);if(s.inFormat===s.outFormat)return t;e=s.inFormat,i=s.outFormat,r=s.swap;const o=e.substring(0,1),a=e.substring(1,4),l=i.substring(0,1),c=i.substring(1,4);if(n.inFormat=e,n.outFormat=i,n.swap=r,o==="L"&&i==="VLTR"){if(a==="LTR")return n.dir=UU,rF(t,n);if(a==="RTL")return n.dir=eZ,rF(t,n)}if(o==="V"&&l==="V")return n.dir=a==="RTL"?eZ:UU,P4e(t,n);if(o==="L"&&i==="VRTL")return a==="LTR"?(n.dir=UU,t=rF(t,n)):(n.dir=eZ,t=rF(t,n)),P4e(t);if(e==="VLTR"&&i==="LLTR")return n.dir=UU,rF(t,n);if(o==="V"&&l==="L"&&a!==c)return t=P4e(t),a==="RTL"?ZJ(t,"LLTR","VLTR",r,n):ZJ(t,"LRTL","VRTL",r,n);if(e==="VRTL"&&i==="LRTL")return ZJ(t,"LRTL","VRTL",r,n);if(o==="L"&&l==="L"){const d=n.swap;return n.swap=d.substr(0,1)+"N",a==="RTL"?(n.dir=eZ,t=rF(t,n),n.swap="N"+d.substr(1,2),n.dir=UU,t=rF(t,n)):(n.dir=UU,t=rF(t,n),n.swap="N"+d.substr(1,2),t=ZJ(t,"VLTR","LRTL",n.swap,n)),t}return t}function P9i(t,e,i){if(e.inFormat===void 0&&(e.inFormat=i.defInFormat),e.outFormat===void 0&&(e.outFormat=i.defOutFormat),e.swap===void 0&&(e.swap=i.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=cfe(t),o=s==="ltr"||s==="rtl"?s.toUpperCase():e.inFormat.charAt(2)==="L"?"LTR":"RTL",e.inFormat=r+o),a.charAt(0)==="C"&&(s=cfe(t),s==="rtl"?a="RTL":s==="ltr"?(s=M9i(t),a=s.toUpperCase()):a=e.outFormat.charAt(2)==="L"?"LTR":"RTL",e.outFormat=n+a),e}function O9i(t,e,i){if(e.length===0)return"";t===void 0&&(t=!0),i===void 0&&(i=!0);const r=(e=String(e)).split("");let n=0,s=1,o=r.length;t||(n=r.length-1,s=-1,o=1);const a=R9i(r,n,s,o,i);let l="";for(let c=0;c-1?(Y1t(hfe,c,!t,-1),yb.splice(c,1)):l+=r[c];return l}function R9i(t,e,i,r,n){let s=0;const o=[];let a=0;for(let l=e;l*i="ﹰ"&&n[s]<"\uFEFF"){const a=t.charCodeAt(s);n[s]>="ﻵ"&&n[s]<="ﻼ"?(e?(s>0&&i&&n[s-1]===" "?r=r.substring(0,r.length-1)+"ل":(r+="ل",o=!0),r+=VU[(a-65269)/2]):(r+=VU[(a-65269)/2],r+="ل",s+10)if(y===16){for(let S=o;S-1){for(let S=o;S=0&&t[s]===w0;s--)e[s]=r.dir}}function L9i(t,e,i){if(i.hiLevel!==0&&i.swap.substr(0,1)!==i.swap.substr(1,2))for(let r=0;r>8];return i<_E?i:A9i[i-_E][255&e]}function P4e(t,e){const i=t.split("");if(e){const r=[];j1t(i,r,e),dfe=r}return i.reverse(),yb.reverse(),i.join("")}function N9i(t,e,i){for(let r=0;r=V1t[e]&&t<=v9i[e])return!0;return!1}function H1t(t,e,i,r){for(;e*i=t){for(s=d+1;s=t;)s++;for(o=d,a=s-1;o(n.lastArabic=!1,Ut),UBAT_R:()=>(n.lastArabic=!1,Or),UBAT_ON:()=>vt,UBAT_AN:()=>zp,UBAT_EN:()=>n.lastArabic?zp:ro,UBAT_AL:()=>(n.lastArabic=!0,n.hasUbatAl=!0,Or),UBAT_WS:()=>vt,UBAT_CS:()=>{let o,a;return r<1||r+1>=e.length||(o=i[r-1])!==ro&&o!==zp||(a=e[r+1])!==ro&&a!==zp?vt:(n.lastArabic&&(a=zp),a===o?a:vt)},UBAT_ES:()=>(r>0?i[r-1]:vE)===ro&&r+1{if(r>0&&i[r-1]===ro)return ro;if(n.lastArabic)return vt;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,d=e[a];if(c&&(d===Or||d===wt))return Or}}return r<1||e[r-1]===vE?vt:i[r-1]},UBAT_B:()=>(n.lastArabic=!0,n.hasUbatB=!0,n.dir),UBAT_S:()=>(n.hasUbatS=!0,vt),UBAT_LRE:()=>(n.lastArabic=!1,vt),UBAT_RLE:()=>(n.lastArabic=!1,vt),UBAT_LRO:()=>(n.lastArabic=!1,vt),UBAT_RLO:()=>(n.lastArabic=!1,vt),UBAT_PDF:()=>(n.lastArabic=!1,vt),UBAT_BN:()=>vt}[E9i[s]]()}function G9i(t){let e,i=0,r=afe.length-1;for(;i<=r;)if(e=Math.floor((i+r)/2),tafe[e][0]))return afe[e][1];i=e+1}return t}function V9i(t){for(let e=0;e="ً"&&t<="ٕ"}function q1t(t){return t==="L"?"LTR":t==="R"?"RTL":t==="C"?"CLR":t==="D"?"CRL":""}function j9i(t,e,i,r){for(;e*ie||!i&&t[n]===e)&&(t[n]+=r)}let yb=[],hfe=[],dfe=[];const q9i={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:""},Y9i=5,X9i=6,UU=0,eZ=1,X1t=/^[(I|V)][(L|R|C|D)][(Y|N)][(S|N)][N]$/,K9i=/[\u0591-\u06ff\ufb1d-\ufefc]/;var Ps,c6;(function(t){t[t.R8_SIGNED=0]="R8_SIGNED",t[t.R8_UNSIGNED=1]="R8_UNSIGNED",t[t.R16_SIGNED=2]="R16_SIGNED",t[t.R16_UNSIGNED=3]="R16_UNSIGNED",t[t.R8G8_SIGNED=4]="R8G8_SIGNED",t[t.R8G8_UNSIGNED=5]="R8G8_UNSIGNED",t[t.R16G16_SIGNED=6]="R16G16_SIGNED",t[t.R16G16_UNSIGNED=7]="R16G16_UNSIGNED",t[t.R8G8B8A8_SIGNED=8]="R8G8B8A8_SIGNED",t[t.R8G8B8A8_UNSIGNED=9]="R8G8B8A8_UNSIGNED",t[t.R8G8B8A8_COLOR=10]="R8G8B8A8_COLOR",t[t.R16G16B16A16_DASHARRAY=11]="R16G16B16A16_DASHARRAY",t[t.R16G16B16A16_PATTERN=12]="R16G16B16A16_PATTERN"})(Ps||(Ps={})),function(t){t[t.UNIFORM=0]="UNIFORM",t[t.DATA_DRIVEN=1]="DATA_DRIVEN",t[t.INTERPOLATED_DATA_DRIVEN=2]="INTERPOLATED_DATA_DRIVEN",t[t.UNUSED=3]="UNUSED"}(c6||(c6={}));let nF=class wBe{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,i,r,n,s){const o=this.getUniforms();for(const a of o){const{name:l,type:c,getValue:d}=a,p=d(r,i,n,s);if(p!==null)switch(c){case"float":e.setUniform1f(l,p);break;case"vec2":e.setUniform2fv(l,p);break;case"vec4":e.setUniform4fv(l,p)}}}encodeAttributes(e,i,r,n){const s=this.attributesInfo(),o=this.getEncodingInfos(),a=[];let l=0,c=0;for(const d of Object.keys(o)){const p=o[d],{type:y,precisionFactor:v,isLayout:S}=s[d],I=S?r.getLayoutProperty(d):r.getPaintProperty(d),O=I.interpolator?.getInterpolationRange(i);let L=0;for(const N of p){const{offset:G,bufferElementsToAdd:V}=N;if(V>0){for(let X=0;X4)n++,te={dataIndex:n,count:0,offset:0},G!==4&&(r[X]=te),e.push({location:-1,name:"a_data_"+n,count:G,type:L,normalized:V}),re=Math.ceil(Math.max(Y/4,1));else{const fe=e[te.dataIndex];fe.count+=G,re=Math.ceil(Math.max(fe.count*N/4,1))-Math.ceil(Math.max(te.offset/4,1))}S.push({dataIndex:te.dataIndex,offset:te.offset,bufferElementsToAdd:re}),te.offset+=Y,te.count+=G}}for(const p of e)switch(p.type){case Di.BYTE:case Di.UNSIGNED_BYTE:p.count=4;break;case Di.SHORT:case Di.UNSIGNED_SHORT:p.count+=p.count%2}this._buildVertexBufferLayout(e);let l=0;const c=this._layoutInfo.geometry;for(const p of c)this._locations.set(p.name,l++);const d=this._layoutInfo.opacity;if(d)for(const p of d)this._locations.set(p.name,l++);this._buildShaderInfo(e,i),this._propertyEncodingInfo=i}_buildVertexBufferLayout(e){const i={},r=this.geometryInfo();let n=r[0].stride;if(e.length===0)i.geometry=r;else{const s=[];let o=n;for(const a of e)n+=K1t(a.type)*a.count;for(const a of r)s.push(new qo(a.name,a.count,a.type,a.offset,n,a.normalized));for(const a of e)s.push(new qo(a.name,a.count,a.type,o,n,a.normalized)),o+=K1t(a.type)*a.count;i.geometry=s}this.opacityInfo()&&(i.opacity=this.opacityInfo()),this._layoutInfo=i,this._stride=n}_buildShaderInfo(e,i){let r=` +`),n}updateCustomParameters(e){this._source.type==="stream"&&this._source.updateCustomParameters(e)}enableEvent(e){this._source.enableEvent(e.name,e.value)}pause(){this._updateQueue.pause(),this._updateQueue.clear()}resume(){this._updateQueue.resume()}pauseStream(){this._source.type==="stream"&&this._source.pauseStream()}resumeStream(){this._source.type==="stream"&&this._source.resumeStream()}sendMessageToSocket(e){this._source.type==="stream"&&this._source.sendMessageToSocket(e)}sendMessageToClient(e){this._source.type==="stream"&&this._source.sendMessageToClient(e)}_initAggregateStore(e){const i=e.schema.targets?.aggregate?.type;if(Pa(this.config,n=>n.schema.targets?.aggregate?.type)!==i&&(ve(this.aggregateStore)&&(this.removeHandles("valueRangesChanged"),this.aggregateStore.destroy(),this.aggregateStore=null),i)){switch(i){case"cluster":{const n={geometryInfo:{geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.aggregateStore=new vki(n,this.spatialReference,this._storage,this.service),this.addHandles(this.aggregateStore.events.on("valueRangesChanged",s=>{this.remoteClient.invoke("emitEvent",{name:"valueRangesChanged",event:{valueRanges:s.valueRanges}}).catch(rO)}),"valueRangesChanged");break}case"bin":{const n={geometryInfo:{geometryType:"esriGeometryPolygon",hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.aggregateStore=new fki(n,this.spatialReference,this._storage,this.service);break}}this.aggregateStore.onTileUpdate({added:this.tileStore.tiles,removed:[]})}}async update(e,i){this._updateVersion++,this._initQueryEngine(i),this._initAttributeStore(i),this.pause(),await Promise.all([this._source.update(e,i.schema.source),this.featureStore.updateSchema(e,i.schema.targets.feature),this.attributeStore.update(e,i),this.attributeStore.updateFilters(e,i,this)]),this._initAggregateStore(i),ve(this.aggregateStore)&&await this.aggregateStore.updateSchema(e,i.schema.targets.aggregate),this._initAggregateQueryEngine(this.aggregateStore,i.schema),Hi("esri-2d-update-debug")&&e.describe(),this._set("config",i)}async applyUpdate(e){e.version=this._updateVersion,Hi("esri-2d-update-debug")&&console.debug(`Applying update ${e.version}`),e.mesh&&this.clearTiles(),this._updateQueue.resume(),await this._source.applyUpdate(e),this.notifyChange("updating"),await N1(()=>!this.updating),ve(this.aggregateStore)&&(await B3(10),await N1(()=>!this.updating))}async onEdits({edits:e}){Hi("esri-2d-update-debug")&&console.debug("Applying Edit:",e),this._didEdit=!0;try{const i=e.removed.map(n=>n.objectId&&n.objectId!==-1?n.objectId:this._lookupObjectIdByGlobalId(n.globalId)),r=e.addOrModified.map(({objectId:n})=>n);this.featureStore.invalidate(),await this._source.edit(r,i),this.clearTiles(),this.notifyChange("updating"),ve(this.aggregateStore)&&this.aggregateStore.clear(),await this._source.resend(),await N1(()=>!this.updating)}catch{}}async refresh(e){if(!e.dataChanged){const i=k_.empty();return i.storage.filters=!0,this.applyUpdate(i)}this.featureStore.invalidate(),this.clearTiles(),this._source.refresh(this._updateVersion,e),this._cleanupNeeded=!0,this.notifyChange("updating"),await N1(()=>!this.updating)}clearTiles(){for(const e of this.tileStore.tiles)this.processor.onTileClear(e)}onTileUpdate(e){ve(this.aggregateStore)&&this.aggregateStore.onTileUpdate(e);for(const i of e.added)this._source.subscribe(i,this._updateVersion),this._level=i.level;for(const i of e.removed)this._source.unsubscribe(i),this._cleanupNeeded=!0,this._tileToResolver.has(i.id)&&(this._tileToResolver.get(i.id).resolve(),this._tileToResolver.delete(i.id));this.notifyChange("updating")}async onIdle(){this._invalidated&&(this._invalidated=!1,(ve(this.aggregateStore)||this.processor.type==="heatmap")&&await this._repushCurrentLevelTiles()),this._markAndSweep()}async querySummaryStatistics({query:e,params:i}){return this.featureQueryEngine.executeQueryForSummaryStatistics(e,i)}async queryAggregateSummaryStatistics({query:e,params:i}){return this.aggregateQueryEngine.executeQueryForSummaryStatistics(e,i)}async queryUniqueValues({query:e,params:i}){return this.featureQueryEngine.executeQueryForUniqueValues(e,i)}async queryAggregateUniqueValues({query:e,params:i}){return this.aggregateQueryEngine.executeQueryForUniqueValues(e,i)}async queryClassBreaks({query:e,params:i}){return this.featureQueryEngine.executeQueryForClassBreaks(e,i)}async queryAggregateClassBreaks({query:e,params:i}){return this.aggregateQueryEngine.executeQueryForClassBreaks(e,i)}async queryHistogram({query:e,params:i}){return this.featureQueryEngine.executeQueryForHistogram(e,i)}async queryAggregateHistogram({query:e,params:i}){return this.aggregateQueryEngine.executeQueryForHistogram(e,i)}queryExtent(e){return this.featureQueryEngine.executeQueryForExtent(e)}queryAggregates(e){return this.aggregateQueryEngine.executeQuery(e)}queryAggregateCount(e){return this.aggregateQueryEngine.executeQueryForCount(e)}queryAggregateIds(e){return this.aggregateQueryEngine.executeQueryForIds(e)}queryFeatures(e){return this.featureQueryEngine.executeQuery(e)}async queryVisibleFeatures(e){const i=await this.featureQueryEngine.executeQuery(e),r=i.objectIdFieldName;return i.features=i.features.filter(n=>{const s=n.attributes[r],o=this.getDisplayId(s);return Pa(o,a=>this.attributeStore.isVisible(a))}),i}queryFeatureCount(e){return this.featureQueryEngine.executeQueryForCount(e)}queryLatestObservations(e){return this.featureQueryEngine.executeQueryForLatestObservations(e)}queryObjectIds(e){return this.featureQueryEngine.executeQueryForIds(e)}async queryStatistics(){return this.featureStore.storeStatistics}getObjectId(e){return this.featureStore.lookupObjectId(e,this._storage)}getDisplayId(e){if(ve(this.aggregateStore)){const i=this.aggregateStore.getDisplayId(e);if(lt(i)){const r=this.featureStore.lookupDisplayId(e);return this.aggregateStore.getDisplayIdForReferenceId(r)}return i}return this.featureStore.lookupDisplayId(e)}getFeatures(e){const i=[],r=[];for(const n of e){const s=ve(this.aggregateStore)?this.getAggregate(n):null;if(ve(s))if(ve(s.attributes.referenceId)){const o=this.getFeature(s.attributes.referenceId);ve(o)&&i.push(o)}else r.push(s);else{const o=this.getFeature(n);ve(o)&&i.push(o)}}return{features:i,aggregates:r}}getFeature(e){const i=this.featureStore.lookupFeatureByDisplayId(e,this._storage);if(lt(i))return null;const r=i.readHydratedGeometry(),n=pw(r,i.geometryType,i.hasZ,i.hasM);return{attributes:i.readAttributes(),geometry:n}}getAggregate(e){return lt(this.aggregateStore)?null:this.aggregateStore.getAggregate(e)}getAggregates(){return lt(this.aggregateStore)?[]:this.aggregateStore.getAggregates()}async setHighlight(e){const i=kNt(e.map(r=>this.getDisplayId(r)));return this.attributeStore.setHighlight(e,i)}_lookupObjectIdByGlobalId(e){const i=this.service.globalIdField;if(lt(i))throw new Error("Expected globalIdField to be defined");let r=null;if(this.featureStore.forEach(n=>{e===n.readAttribute(i)&&(r=n.getObjectId())}),lt(r))throw new Error(`Expected to find a feature with globalId ${e}`);return r}async _repushCurrentLevelTiles(){const e=this.tileStore.tiles.filter(r=>r.level===this._level);e.map(async r=>this._patchTile({type:"append",id:r.key.id,clear:!0,addOrUpdate:null,end:!1}));const i=e.map(async r=>this._patchTile({type:"append",id:r.key.id,addOrUpdate:Ev.fromOptimizedFeatures([],this.service),remove:[],end:!0,isRepush:!0,status:k_.empty()}));await Promise.all(i)}_maybeForceCleanup(){performance.now()-this._lastCleanup>bki&&this._markAndSweep()}_patchTile(e,i){const r=this._updateQueue.push(e,i).then(()=>{this.notifyChange("updating")}).catch(n=>{this.notifyChange("updating")});return this.notifyChange("updating"),r}async _onTileMessage(e,i){if(yn(i),Hi("esri-2d-update-debug")){const o=Pa(e.addOrUpdate,a=>a.hasFeatures);console.debug(e.id,`FeatureController:onTileMessage: [clear:${e.clear}, end:${e.end}, features: ${o}]`)}const r=this.tileStore.get(e.id);if(!r)return;if(e.clear)return this.processor.onTileClear(r);const n=e.status;this._cleanupNeeded=!0;const s=[];for(const o of e.remove??[]){const a=this.featureStore.lookupDisplayId(o);a&&s.push(a)}e.remove=s;try{if(lt(e.addOrUpdate))return void this.processor.onTileMessage(r,{...e,addOrUpdate:null},ve(this.aggregateStore),i).catch(_C);if(e.addOrUpdate.setArcadeSpatialReference(this.spatialReference),this.featureStore.hasInstance(e.addOrUpdate.instance)&&n.targets.feature||(n.targets.feature=!0,this.featureStore.onTileData(r,e)),(!n.storage.data||!n.storage.filters)&&(n.storage.data=!0,n.storage.filters=!0,this.attributeStore.onTileData(r,e),this._source.type==="stream"||this._didEdit?(await this.attributeStore.sendUpdates(),yn(i)):this.attributeStore.sendUpdates()),ve(this.aggregateStore)&&!n.targets.aggregate){n.targets.aggregate=!0;const o=b_t(this._source)&&this._source.loading,a=!b_t(this._source)||o||e.end;if(this.aggregateStore.onTileData(r,e,this._storage,this.attributeStore,a),!a)return;n.mesh||(this.attributeStore.onTileData(r,e),await this.attributeStore.sendUpdates())}if(!n.mesh){n.mesh=!0;const o=ve(this.aggregateStore)&&this.aggregateStore.type==="cluster";await this.processor.onTileMessage(r,e,o,i),yn(i)}this._maybeForceCleanup()}catch(o){_C(o)}}_mark(e,i,r){const n=(4294901760&this._storage.getInstanceId(e))>>>16;e&&(i.add(n),r.set(e))}_markAndSweep(){if(this._lastCleanup=performance.now(),!(!(this._source.type==="feature"&&this._source.mode==="snapshot")&&(this._source.type==="stream"||this._cleanupNeeded)))return;this._cleanupNeeded=!1;const e=this._storage.getBitset(this._markedIdsBufId),i=new Set;e.clear();for(const r of this.tileStore.tiles)for(const n of this._source.readers(r.id)){const s=n.getCursor();for(;s.next();){let o=s.getDisplayId();if(!o){const a=s.getObjectId();o=this.featureStore.lookupDisplayId(a)}this._mark(o,i,e)}}this.processor.type==="symbol"&&this.processor.forEachBufferId(r=>{this._mark(r,i,e)}),this._updateQueue.forEach(r=>{for(const n of r.remove??[]){const s=this.featureStore.lookupDisplayId(n);this._mark(s,i,e)}}),ve(this.aggregateStore)&&(this.aggregateStore.sweepFeatures(e,this.featureStore),"sweepAggregates"in this.aggregateStore&&this.aggregateStore.sweepAggregates(this._storage,this.attributeStore,this._level)),this.featureStore.sweepFeatures(e,this._storage,this.attributeStore),this.featureStore.sweepFeatureSets(i)}};E([N({constructOnly:!0})],mS.prototype,"tileStore",void 0),E([N()],mS.prototype,"config",void 0),E([N({readOnly:!0})],mS.prototype,"fieldsIndex",null),E([N()],mS.prototype,"processor",void 0),E([N({constructOnly:!0})],mS.prototype,"remoteClient",void 0),E([N({constructOnly:!0})],mS.prototype,"service",void 0),E([N()],mS.prototype,"spatialReference",null),E([N()],mS.prototype,"updating",null),mS=E([dt("esri.views.2d.layers.features.controllers.FeatureController2D")],mS);const Tki=mS;let Yk=class extends YC{constructor(){super(...arguments),this.controller=null,this.processor=null,this.remoteClient=null,this.tileStore=null,this.service=null,this.viewState=null,this._paused=!1,this._pendingTileUpdates=[]}initialize(){this.handles.add(sr(()=>this.updating,e=>{this.remoteClient.invoke("setUpdating",e).catch(i=>{})}))}destroy(){this.stop(),this.controller?.destroy(),this.processor?.destroy(),this.controller=this.processor=this.tileStore=this.remoteClient=null}get updating(){return!this.controller||this.controller.updating}stop(){this._paused=!0,Array.isArray(this.service?.source)&&(this.service.source.forEach(e=>e.close()),this.service.source.length=0),this.tileStore?.updateTiles({added:[],removed:this.tileStore.tiles.map(e=>e.id)}),this.tileStore?.destroy(),this.tileStore=null,this._pendingTileUpdates.length=0}async startup({service:e,config:i,tileInfo:r,tiles:n}){if(this._paused=!0,Array.isArray(this.service?.source)&&(this.service.source.forEach(s=>s.close()),this.service.source.length=0),this.service=e,!this.tileStore||!Da(this.tileStore.tileScheme.spatialReference,r.spatialReference)){const s=new CN(Ul.fromJSON(r));n.added.length=n.removed.length=0,this.tileStore?.updateTiles({added:[],removed:this.tileStore.tiles.map(o=>o.id)}),this.tileStore?.destroy(),this.tileStore=new Ort(s),this._pendingTileUpdates.length=0}for(await this._createProcessorAndController(i),await this.update({config:i}),this.controller.resume(),this.tileStore.clear(),this.tileStore.updateTiles(n),this._paused=!1;this._pendingTileUpdates.length;)this.tileStore.updateTiles(this._pendingTileUpdates.pop())}async updateTiles(e){this._paused?this._pendingTileUpdates.push(e):this.tileStore?.updateTiles(e)}async update({config:e}){const i=k_.empty();return await Promise.all([this.processor.update(i,e),this.controller.update(i,e)]),i.toJSON()}async applyUpdate(e){return this.controller.applyUpdate(k_.create(e))}async _createProcessorAndController(e){await Promise.all([this._handleControllerConfig(e),this._handleProcessorConfig(e)]),this.controller.processor=this.processor}async _handleControllerConfig(e){return this._createController(this.service,e)}async _handleProcessorConfig(e){return this._createProcessor(this.service,e)}async _createController(e,i){this.controller&&this.controller.destroy();const{tileStore:r,remoteClient:n}=this,s=new Tki({service:e,tileStore:r,remoteClient:n});return this.controller=s,s}async _createProcessor(e,i){const r=i.schema.processors[0].type,n=(await BLi(r)).default,{remoteClient:s,tileStore:o}=this,a=new n({service:e,config:i,tileStore:o,remoteClient:s});return this.processor&&this.processor.destroy(),this.processor=a,a}};E([N()],Yk.prototype,"controller",void 0),E([N()],Yk.prototype,"processor",void 0),E([N()],Yk.prototype,"updating",null),E([N()],Yk.prototype,"viewState",void 0),Yk=E([dt("esri.views.2d.layers.features.Pipeline")],Yk);const Eki=Object.freeze(Object.defineProperty({__proto__:null,default:Yk},Symbol.toStringTag,{value:"Module"}));function NFe(){const t=new Float32Array(4);return t[3]=1,t}function w_t(t){const e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function Iki(t,e,i,r){const n=new Float32Array(4);return n[0]=t,n[1]=e,n[2]=i,n[3]=r,n}function Aki(t,e){return new Float32Array(t,e,4)}Object.freeze(Object.defineProperty({__proto__:null,clone:w_t,create:NFe,createView:Aki,fromValues:Iki},Symbol.toStringTag,{value:"Module"}));function jJ(){return new Float32Array(3)}function x_t(t){const e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function nO(t,e,i){const r=new Float32Array(3);return r[0]=t,r[1]=e,r[2]=i,r}function Pki(t,e){return new Float32Array(t,e,3)}function S_t(){return jJ()}function C_t(){return nO(1,1,1)}function T_t(){return nO(1,0,0)}function E_t(){return nO(0,1,0)}function I_t(){return nO(0,0,1)}const Oki=S_t(),Rki=C_t(),Mki=T_t(),Dki=E_t(),Fki=I_t();Object.freeze(Object.defineProperty({__proto__:null,ONES:Rki,UNIT_X:Mki,UNIT_Y:Dki,UNIT_Z:Fki,ZEROS:Oki,clone:x_t,create:jJ,createView:Pki,fromValues:nO,ones:C_t,unitX:T_t,unitY:E_t,unitZ:I_t,zeros:S_t},Symbol.toStringTag,{value:"Module"}));var kFe;let TG=kFe=class extends Ui{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new kFe({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};E([N({type:String,json:{write:!0}})],TG.prototype,"field",void 0),E([N({type:Number,nonNullable:!0,json:{write:!0}})],TG.prototype,"minValue",void 0),E([N({type:Number,nonNullable:!0,json:{write:!0}})],TG.prototype,"maxValue",void 0),TG=kFe=E([dt("esri.renderers.support.pointCloud.ColorModulation")],TG);const Lki=TG,$Fe=new Ks({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let rfe=class extends Ui{};E([N({type:$Fe.apiValues,readOnly:!0,nonNullable:!0,json:{type:$Fe.jsonValues,read:!1,write:$Fe.write}})],rfe.prototype,"type",void 0),rfe=E([dt("esri.renderers.support.pointCloud.PointSizeAlgorithm")],rfe);const BFe=rfe;var VFe;let EG=VFe=class extends BFe{constructor(){super(...arguments),this.type="fixed-size",this.size=0,this.useRealWorldSymbolSizes=null}clone(){return new VFe({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};E([rn({pointCloudFixedSizeAlgorithm:"fixed-size"})],EG.prototype,"type",void 0),E([N({type:Number,nonNullable:!0,json:{write:!0}})],EG.prototype,"size",void 0),E([N({type:Boolean,json:{write:!0}})],EG.prototype,"useRealWorldSymbolSizes",void 0),EG=VFe=E([dt("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],EG);const Nki=EG;var jFe;let GJ=jFe=class extends BFe{constructor(){super(...arguments),this.type="splat",this.scaleFactor=1}clone(){return new jFe({scaleFactor:this.scaleFactor})}};E([rn({pointCloudSplatAlgorithm:"splat"})],GJ.prototype,"type",void 0),E([N({type:Number,value:1,nonNullable:!0,json:{write:!0}})],GJ.prototype,"scaleFactor",void 0),GJ=jFe=E([dt("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],GJ);const kki={key:"type",base:BFe,typeMap:{"fixed-size":Nki,splat:GJ}},GFe=ta()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let sO=class extends Ui{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:gi(this.pointSizeAlgorithm),colorModulation:gi(this.colorModulation),pointsPerInch:gi(this.pointsPerInch)}}};E([N({type:GFe.apiValues,readOnly:!0,nonNullable:!0,json:{type:GFe.jsonValues,read:!1,write:GFe.write}})],sO.prototype,"type",void 0),E([N({types:kki,json:{write:!0}})],sO.prototype,"pointSizeAlgorithm",void 0),E([N({type:Lki,json:{write:!0}})],sO.prototype,"colorModulation",void 0),E([N({json:{write:!0},nonNullable:!0,type:Number})],sO.prototype,"pointsPerInch",void 0),sO=E([dt("esri.renderers.PointCloudRenderer")],sO),function(t){t.fieldTransformTypeKebabDict=new Ks({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})}(sO||(sO={}));const fy=sO;var UFe;let HD=UFe=class extends Ui{constructor(){super(...arguments),this.description=null,this.label=null,this.minValue=0,this.maxValue=0,this.color=null}clone(){return new UFe({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:gi(this.color)})}};E([N({type:String,json:{write:!0}})],HD.prototype,"description",void 0),E([N({type:String,json:{write:!0}})],HD.prototype,"label",void 0),E([N({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],HD.prototype,"minValue",void 0),E([N({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],HD.prototype,"maxValue",void 0),E([N({type:en,json:{type:[Ls],write:!0}})],HD.prototype,"color",void 0),HD=UFe=E([dt("esri.renderers.support.pointCloud.ColorClassBreakInfo")],HD);const $ki=HD;var zFe;let WD=zFe=class extends fy{constructor(t){super(t),this.type="point-cloud-class-breaks",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.colorClassBreakInfos=null}clone(){return new zFe({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:gi(this.colorClassBreakInfos),legendOptions:gi(this.legendOptions)})}};E([rn({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],WD.prototype,"type",void 0),E([N({json:{write:!0},type:String})],WD.prototype,"field",void 0),E([N({type:zC,json:{write:!0}})],WD.prototype,"legendOptions",void 0),E([N({type:fy.fieldTransformTypeKebabDict.apiValues,json:{type:fy.fieldTransformTypeKebabDict.jsonValues,read:fy.fieldTransformTypeKebabDict.read,write:fy.fieldTransformTypeKebabDict.write}})],WD.prototype,"fieldTransformType",void 0),E([N({type:[$ki],json:{write:!0}})],WD.prototype,"colorClassBreakInfos",void 0),WD=zFe=E([dt("esri.renderers.PointCloudClassBreaksRenderer")],WD);const A_t=WD;var HFe;let qD=HFe=class extends fy{constructor(t){super(t),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new HFe({...this.cloneProperties(),field:gi(this.field),fieldTransformType:gi(this.fieldTransformType),stops:gi(this.stops),legendOptions:gi(this.legendOptions)})}};E([rn({pointCloudStretchRenderer:"point-cloud-stretch"})],qD.prototype,"type",void 0),E([N({json:{write:!0},type:String})],qD.prototype,"field",void 0),E([N({type:zC,json:{write:!0}})],qD.prototype,"legendOptions",void 0),E([N({type:fy.fieldTransformTypeKebabDict.apiValues,json:{type:fy.fieldTransformTypeKebabDict.jsonValues,read:fy.fieldTransformTypeKebabDict.read,write:fy.fieldTransformTypeKebabDict.write}})],qD.prototype,"fieldTransformType",void 0),E([N({type:[rze],json:{write:!0}})],qD.prototype,"stops",void 0),qD=HFe=E([dt("esri.renderers.PointCloudStretchRenderer")],qD);const P_t=qD;var WFe;let Xk=WFe=class extends Ui{constructor(){super(...arguments),this.description=null,this.label=null,this.values=null,this.color=null}clone(){return new WFe({description:this.description,label:this.label,values:gi(this.values),color:gi(this.color)})}};E([N({type:String,json:{write:!0}})],Xk.prototype,"description",void 0),E([N({type:String,json:{write:!0}})],Xk.prototype,"label",void 0),E([N({type:[String],json:{write:!0}})],Xk.prototype,"values",void 0),E([N({type:en,json:{type:[Ls],write:!0}})],Xk.prototype,"color",void 0),Xk=WFe=E([dt("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],Xk);const Bki=Xk;var qFe;let YD=qFe=class extends fy{constructor(t){super(t),this.type="point-cloud-unique-value",this.field=null,this.fieldTransformType=null,this.colorUniqueValueInfos=null,this.legendOptions=null}clone(){return new qFe({...this.cloneProperties(),field:gi(this.field),fieldTransformType:gi(this.fieldTransformType),colorUniqueValueInfos:gi(this.colorUniqueValueInfos),legendOptions:gi(this.legendOptions)})}};E([rn({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],YD.prototype,"type",void 0),E([N({json:{write:!0},type:String})],YD.prototype,"field",void 0),E([N({type:fy.fieldTransformTypeKebabDict.apiValues,json:{type:fy.fieldTransformTypeKebabDict.jsonValues,read:fy.fieldTransformTypeKebabDict.read,write:fy.fieldTransformTypeKebabDict.write}})],YD.prototype,"fieldTransformType",void 0),E([N({type:[Bki],json:{write:!0}})],YD.prototype,"colorUniqueValueInfos",void 0),E([N({type:zC,json:{write:!0}})],YD.prototype,"legendOptions",void 0),YD=qFe=E([dt("esri.renderers.PointCloudUniqueValueRenderer")],YD);const O_t=YD,Od=!0,Kk={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function YFe(t,e,i){return{identifier:String.fromCharCode.apply(null,new Uint8Array(t,i+Kk.identifierOffset,Kk.identifierLength)),version:e.getUint16(i+Kk.versionOffset,Od),checksum:e.getUint32(i+Kk.checksumOffset,Od)}}const j_={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 Vki(t,e){return{sizeLo:t.getUint32(e+j_.sizeLo,Od),sizeHi:t.getUint32(e+j_.sizeHi,Od),minX:t.getFloat64(e+j_.minX,Od),minY:t.getFloat64(e+j_.minY,Od),minZ:t.getFloat64(e+j_.minZ,Od),maxX:t.getFloat64(e+j_.maxX,Od),maxY:t.getFloat64(e+j_.maxY,Od),maxZ:t.getFloat64(e+j_.maxZ,Od),errorX:t.getFloat64(e+j_.errorX,Od),errorY:t.getFloat64(e+j_.errorY,Od),errorZ:t.getFloat64(e+j_.errorZ,Od),count:t.getUint32(e+j_.count,Od),reserved:t.getUint32(e+j_.reserved,Od)}}function jki(t){const e=new DataView(t,0);let i=0;const{identifier:r,version:n}=YFe(t,e,i);if(i+=Kk.byteCount,r!=="LEPCC ")throw new st("lepcc-decode-error","Bad identifier");if(n>1)throw new st("lepcc-decode-error","Unknown version");const s=Vki(e,i);if(i+=j_.byteCount,s.sizeHi*4294967296+s.sizeLo!==t.byteLength)throw new st("lepcc-decode-error","Bad size");const o=new Float64Array(3*s.count),a=[],l=[],c=[],h=[];if(i=nfe(t,i,a),i=nfe(t,i,l),i=nfe(t,i,c),i=nfe(t,i,h),i!==t.byteLength)throw new st("lepcc-decode-error","Bad length");let p=0,y=0;for(let v=0;v>6;let l=0;if(a===0)l=r.getUint32(1,Od),e+=5;else if(a===1)l=r.getUint16(1,Od),e+=3;else{if(a!==2)throw new st("lepcc-decode-error","Bad count type");l=r.getUint8(1),e+=2}if(o)throw new st("lepcc-decode-error","LUT not implemented");const c=Math.ceil(l*s/8),h=new Uint8Array(t,e,c);let p=0,y=0,v=0;const x=-1>>>32-s;for(let I=0;I>>=s,y-=s,y+s>32&&(p|=h[v-1]>>8-y)}return e+v}const Jk={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function Gki(t,e){return{sizeLo:t.getUint32(e+Jk.sizeLo,Od),sizeHi:t.getUint32(e+Jk.sizeHi,Od),count:t.getUint32(e+Jk.count,Od),colorMapCount:t.getUint16(e+Jk.colorMapCount,Od),lookupMethod:t.getUint8(e+Jk.lookupMethod),compressionMethod:t.getUint8(e+Jk.compressionMethod)}}function Uki(t){const e=new DataView(t,0);let i=0;const{identifier:r,version:n}=YFe(t,e,i);if(i+=Kk.byteCount,r!=="ClusterRGB")throw new st("lepcc-decode-error","Bad identifier");if(n>1)throw new st("lepcc-decode-error","Unknown version");const s=Gki(e,i);if(i+=Jk.byteCount,s.sizeHi*4294967296+s.sizeLo!==t.byteLength)throw new st("lepcc-decode-error","Bad size");if((s.lookupMethod===2||s.lookupMethod===1)&&s.compressionMethod===0){if(3*s.colorMapCount+s.count+i!==t.byteLength||s.colorMapCount>256)throw new st("lepcc-decode-error","Bad count");const o=new Uint8Array(t,i,3*s.colorMapCount),a=new Uint8Array(t,i+3*s.colorMapCount,s.count),l=new Uint8Array(3*s.count);for(let c=0;c1)throw new st("lepcc-decode-error","Unknown version");const s=zki(e,i);if(i+=Zk.byteCount,s.sizeHi*4294967296+s.sizeLo!==t.byteLength)throw new st("lepcc-decode-error","Bad size");const o=new Uint16Array(s.count);if(s.bitsPerPoint===8){if(s.count+i!==t.byteLength)throw new st("lepcc-decode-error","Bad size");const a=new Uint8Array(t,i,s.count);for(let l=0;l=192&&s<224){if(n+1>=i)throw new st("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const o=(31&s)<<6|63&t[e+n+1];r+=String.fromCharCode(o),n+=2}else if(s>=224&&s<240){if(n+2>=i)throw new st("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const o=(15&s)<<12|(63&t[e+n+1])<<6|63&t[e+n+2];r+=String.fromCharCode(o),n+=3}else{if(!(s>=240&&s<248))throw new st("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(n+3>=i)throw new st("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const o=(7&s)<<18|(63&t[e+n+1])<<12|(63&t[e+n+2])<<6|63&t[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 R_t(t,e){const i={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 M_t(t,e,i){const r=[];let n,s,o=0;for(s=0;s0){if(r.push(Wki(i,o,n-1)),i[o+n-1]!==0)throw new st("string-array-error","Invalid string array: missing null termination.")}else r.push(null);o+=n}return r}function JFe(t,e){return new sfe[e.valueType](t,e.byteOffset,e.count*e.valuesPerElement)}function Yki(t,e){return new Uint8Array(t,e.byteOffset,e.byteCount)}function Xki(t,e,i){const r=e.header!=null?R_t(t,e.header):{byteOffset:0,byteCount:0,fields:{count:i}},n={header:r,byteOffset:r.byteCount,byteCount:0,entries:Object.create(null)};let s=r.byteCount;for(let o=0;onew DataView(t,0).getFloat32(e,!0),Float64:(t,e)=>new DataView(t,0).getFloat64(e,!0),UInt8:(t,e)=>new DataView(t,0).getUint8(e),Int8:(t,e)=>new DataView(t,0).getInt8(e),UInt16:(t,e)=>new DataView(t,0).getUint16(e,!0),Int16:(t,e)=>new DataView(t,0).getInt16(e,!0),UInt32:(t,e)=>new DataView(t,0).getUint32(e,!0),Int32:(t,e)=>new DataView(t,0).getInt32(e,!0)};function N_t(t){return sfe.hasOwnProperty(t)}function ofe(t){return N_t(t)?sfe[t].BYTES_PER_ELEMENT:0}function Zki(t,e,i,r){const{rendererJSON:n,isRGBRenderer:s}=t;let o=null,a=null;if(e&&s)o=e;else if(e&&n?.type==="pointCloudUniqueValueRenderer"){a=O_t.fromJSON(n);const l=a.colorUniqueValueInfos;o=new Uint8Array(3*r);const c=ZFe(a.fieldTransformType);for(let h=0;h=l[y].value)o[3*h]=l[y].color.r,o[3*h+1]=l[y].color.g,o[3*h+2]=l[y].color.b;else for(let v=1;v=l[y].minValue&&p<=l[y].maxValue){o[3*h]=l[y].color.r,o[3*h+1]=l[y].color.g,o[3*h+2]=l[y].color.b;break}}}else{o=new Uint8Array(3*r);for(let l=0;l=c?1:y<=l?h:h+(1-h)*(y-l)/(c-l);o[3*p]=v*o[3*p],o[3*p+1]=v*o[3*p+1],o[3*p+2]=v*o[3*p+2]}}return o}function Qki(t,e){if(t.encoding==null||t.encoding===""){const i=Kki(e,t);if(lt(i.vertexAttributes.position))return;const r=JFe(e,i.vertexAttributes.position),n=i.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 c=0;c>>4&15,x=v>1,I=y===1,P=y===v;let F=!1;for(const k of h.includedReturns)if(k==="last"&&P||k==="firstOfMany"&&I&&x||k==="lastOfMany"&&P&&x||k==="single"&&!x){F=!0;break}F||(l=!1);break}}}l&&(i[o]=a,t[3*o]=t[3*a],t[3*o+1]=t[3*a+1],t[3*o+2]=t[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 ZFe(t){return t==null||t==="none"?null:t==="low-four-bit"?e=>15&e:t==="high-four-bit"?e=>(240&e)>>4:t==="absolute-value"?e=>Math.abs(e):t==="modulo-ten"?e=>e%10:null}function k_t(t){let e=0;for(const i of t||[])e|=1<0&&ve(e.filterAttributesData)){const h=e.filterAttributesData.filter(ve).map(p=>{const y=afe(p,i,r),v={attributeInfo:p.attributeInfo,values:y};return s.push(v),v});n=new Uint32Array(r),r=t6i(i,l,n,e.filterInfo,h)}for(const h of e.userAttributesData){const p=afe(h,i,r);s.push({attributeInfo:h.attributeInfo,values:p})}3*rthis._readRasterValue(n,e));return this._processPixels({...e,pixelBlocks:r})}processInputBandIds(){const e=this._getRasterValues().filter(this._isRasterFunctionValue);let i;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(i=r.processInputBandIds(),r.isInputBandIdsSwizzled)return this.rawInputBandIds=i,i}else{i=[];const{bandCount:s}=this.sourceRasterInfos[0];for(let o=0;os!==o),this.rawInputBandIds=n,this.rawInputBandIds}getPrimaryRasters(){const e=[],i=[];return this._getPrimaryRasters(this,e,i),{rasters:e,rasterIds:i}}getWebGLProcessorDefinition(){const e=this._getWebGLParameters(),{raster:i,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(i)&&(e.raster=i.getWebGLProcessorDefinition()),{name:this.functionName,parameters:e,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getFlatWebGLFunctionChain(){const e=this.getWebGLProcessorDefinition();if(!e)return null;const i=[e],{parameters:r}=e;let n=r.rasters||r.raster&&[r.raster];for(;n?.length;){i.unshift(...n);const o=[];for(let a=0;a=0;o--)i[o].isNoopProcess&&i.splice(o,1);let s=!1;for(let o=0;o1}return{hasBranches:s,functions:i}}_getOutputPixelType(e){return this.outputPixelType==="unknown"?e:this.outputPixelType??e}_getWebGLParameters(){return{}}_getInputBandIds(e){return e}_isOutputRoundingNeeded(){const{outputPixelType:e}=this;return(e?.startsWith("u")||e?.startsWith("s"))??!1}_getRasterValues(){const{rasterArgumentNames:e}=this;return e[0]==="rasters"?this.functionArguments.rasters??[]:e.map(i=>this.functionArguments[i])}_getSourceRasterInfos(e){const i=this._getRasterValues(),{rasterInfos:r,rasterIds:n}=e;if(i.length===0)return r;const s=i.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?.url}_getPrimaryRasters(e,i=[],r=[]){for(let n=0;nt?.toLowerCase())],om.prototype,"outputPixelType",void 0),E([N({json:{write:!0}})],om.prototype,"mainPrimaryRasterId",void 0),E([N()],om.prototype,"sourceRasters",void 0),E([N({type:[O2],json:{write:!0}})],om.prototype,"sourceRasterInfos",void 0),E([N({json:{write:!0}})],om.prototype,"rasterInfo",void 0),E([N({json:{write:!0}})],om.prototype,"readingBufferSize",void 0),E([N({json:{write:!0}})],om.prototype,"id",void 0),E([N()],om.prototype,"isNoopProcess",void 0),E([N()],om.prototype,"supportsGPU",null),E([N()],om.prototype,"rawInputBandIds",void 0),E([N()],om.prototype,"isInputBandIdsSwizzled",void 0),E([N()],om.prototype,"swizzledBandSelection",void 0),E([N()],om.prototype,"isBranch",void 0),E([N()],om.prototype,"_bindingResult",void 0),om=E([dt("esri.layers.support.rasterFunctions.BaseRasterFunction")],om);const vb=om;let Qk=class extends vb{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 i=e.clone();return i.pixelType=this.outputPixelType,i.statistics=[{min:0,max:360,avg:180,stddev:30}],i.histograms=null,i.colormap=null,i.attributeTable=null,i.bandCount=1,this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(e){const i=e.pixelBlocks?.[0];if(lt(i))return null;const{extent:r}=e,n=r?{x:r.width/i.width,y:r.height/i.height}:{x:1,y:1};return vJt(i,{resolution:n})}};E([N({json:{write:!0,name:"rasterFunction"}})],Qk.prototype,"functionName",void 0),E([N({type:s6i,json:{write:!0,name:"rasterFunctionArguments"}})],Qk.prototype,"functionArguments",void 0),E([N()],Qk.prototype,"rasterArgumentNames",void 0),E([N({json:{write:!0}})],Qk.prototype,"isGCS",void 0),Qk=E([dt("esri.layers.support.rasterFunctions.AspectFunction")],Qk);const o6i=Qk,a6i=new Set(["+","-","*","/","(",")"]);function l6i(t,e){(t=t.replace(/ /g,"")).startsWith("-")&&(t="0"+t),t.startsWith("+")&&(t=t.slice(1,t.length));const i=t.split(""),r=[],n=[];let s="";for(let o=0;o-1)i>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}=h6i(n);if(r=u6i(t,n[a],s[o],s[o+1]),n.length===1)break;n=c6i(n,a),s.splice(o,2,r)}return[r]}const p6i=new Ks({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 f6i(t,e){if(!Th(t))return t;const{equation:i,method:r}=e,n=e.bandIndexes.map(h=>h-1),{pixels:s,mask:o}=t;let a;switch(r){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":a=B_t(o,s[n[0]],s[n[1]]);break;case"ndwi":a=B_t(o,s[n[1]],s[n[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":a=g6i(o,s[n[0]],s[n[1]]);break;case"ci-g":case"ci-re":a=y6i(o,s[n[0]],s[n[1]]);break;case"savi":a=v6i(o,s[n[0]],s[n[1]],n[2]+1);break;case"tsavi":a=_6i(o,s[n[0]],s[n[1]],n[2]+1,n[3]+1,n[4]+1);break;case"msavi":a=b6i(o,s[n[0]],s[n[1]]);break;case"gemi":a=w6i(o,s[n[0]],s[n[1]]);break;case"pvi":a=x6i(o,s[n[0]],s[n[1]],n[2]+1,n[3]+1);break;case"gvitm":a=S6i(o,[s[n[0]],s[n[1]],s[n[2]],s[n[3]],s[n[4]],s[n[5]]]);break;case"sultan":a=C6i(o,[s[n[0]],s[n[1]],s[n[2]],s[n[3]],s[n[4]],s[n[5]]]);break;case"vari":a=T6i(o,[s[n[0]],s[n[1]],s[n[2]]]);break;case"mtvi2":a=E6i(o,[s[n[0]],s[n[1]],s[n[2]]]);break;case"rtvi-core":a=I6i(o,[s[n[0]],s[n[1]],s[n[2]]]);break;case"evi":a=A6i(o,[s[n[0]],s[n[1]],s[n[2]]]);break;case"wndwi":a=P6i(o,[s[n[0]],s[n[1]],s[n[2]]],n[3]?n[3]+1:.5);break;case"bai":a=O6i(o,s[n[0]],s[n[1]]);break;case"custom":a=d6i(o,s,i);break;default:return t}const l=ve(o)?new Uint8Array(o.length):null;ve(o)&&ve(l)&&l.set(o);const c=new dn({width:t.width,height:t.height,pixelType:"f32",pixels:a,mask:l});return c.updateStatistics(),c}function m6i(t,e,i,r){const{mask:n,pixels:s,width:o,height:a}=t,l=s[i],c=s[e],h=c.length,p=r?new Uint8Array(h):new Float32Array(h),y=r?100:1,v=r?100.5:0;for(let I=0;IparseFloat(o));return f6i(i,{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 i=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=Sg([i[0],i[1],0]),n="ndxi";break;case"ndwi":r=Sg([i[1],i[0],0]),n="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":r=Sg([i[0],i[1],0]),n="sr";break;case"ci-g":case"ci-re":r=Sg([i[0],i[1],0]),n="ci";break;case"savi":r=Sg([i[0],i[1],0]),n="savi",s[0]=e[2]+1;break;case"tsavi":r=Sg([i[0],i[1],0]),n="tsavi",s[0]=e[2]+1,s[1]=e[3]+1,s[2]=e[4]+1;break;case"msavi":r=Sg([i[0],i[1],0]),n="msavi";break;case"gemi":r=Sg([i[0],i[1],0]),n="gemi";break;case"pvi":r=Sg([i[0],i[1],0]),n="tsavi",s[0]=e[2]+1,s[1]=e[3]+1;break;case"vari":r=Sg([i[0],i[1],i[2]]),n="vari";break;case"mtvi2":r=Sg([i[0],i[1],i[2]]),n="mtvi2";break;case"rtvi-core":r=Sg([i[0],i[1],i[2]]),n="rtvicore";break;case"evi":r=Sg([i[0],i[1],i[2]]),n="evi";break;case"wndwi":r=Sg([i[0],i[1],0]),n="wndwi",s[0]=e[3]?e[3]+1:.5;break;case"bai":r=Sg([i[1],i[0],0]),n="bai";break;default:r=Sg([0,1,2]),n="custom"}return{bandIndexMat3:r,indexType:n,adjustments:s}}_getInputBandIds(e){if(this.functionArguments.method==="custom")return e;const i=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1),r=e.length,n=i.map(a=>a>=r?r-1:a),s=M6i.has(this.functionArguments.method)?3:2,o=n.slice(0,s).map(a=>e[a]);return o.length===2&&o.push(0),o}};E([N({json:{write:!0,name:"rasterFunction"}})],IG.prototype,"functionName",void 0),E([N({type:R6i,json:{write:!0,name:"rasterFunctionArguments"}})],IG.prototype,"functionArguments",void 0),E([N()],IG.prototype,"rasterArgumentNames",void 0),IG=E([dt("esri.layers.support.rasterFunctions.BandArithmeticFunction")],IG);const D6i=IG;var i4e;let gE=i4e=class extends yb{castColormapName(t){if(!t)return null;const e=t.toLowerCase();return vYt.includes(e)?e:null}readColorRamp(t){return wse(t)}readColorRampName(t,e){if(!t)return null;const i=pB.jsonValues.find(r=>r.toLowerCase()===t.toLowerCase());return i?pB.fromJSON(i):null}clone(){return new i4e({colormap:gi(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};E([N({type:[[Number]],json:{write:!0}})],gE.prototype,"colormap",void 0),E([N({type:String,json:{write:!0}})],gE.prototype,"colormapName",void 0),E([ho("colormapName")],gE.prototype,"castColormapName",null),E([N({types:bse,json:{write:!0}})],gE.prototype,"colorRamp",void 0),E([Vi("colorRamp")],gE.prototype,"readColorRamp",null),E([N({type:pB.apiValues,json:{type:pB.jsonValues,write:pB.write}})],gE.prototype,"colorRampName",void 0),E([Vi("colorRampName")],gE.prototype,"readColorRampName",null),gE=i4e=E([dt("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],gE);const F6i=gE,L6i=[[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]],N6i=[[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 r4e(t,e){const i=[],r=[];for(let s=0;s[r,...i]),e):null}let XD=class extends vb{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:i,colormapName:r,colorRamp:n,colorRampName:s}=this.functionArguments;if(!i?.length)if(n)i=$A(n,{interpolateAlpha:!0});else if(s){const a=bYt(s);a&&(i=$A(a))}else r&&(i=G6i(r));if(!i?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};this.outputPixelType=this._getOutputPixelType("u8");const o=e.clone();return o.pixelType=this.outputPixelType,o.colormap=i,o.bandCount=1,this.rasterInfo=o,{success:!0,supportsGPU:!0}}_processPixels(e){return e.pixelBlocks?.[0]}};E([N({json:{write:!0,name:"rasterFunction"}})],XD.prototype,"functionName",void 0),E([N({type:F6i,json:{write:!0,name:"rasterFunctionArguments"}})],XD.prototype,"functionArguments",void 0),E([N()],XD.prototype,"rasterArgumentNames",void 0),E([N()],XD.prototype,"isNoopProcess",void 0),E([N({json:{write:!0}})],XD.prototype,"indexedColormap",void 0),XD=E([dt("esri.layers.support.rasterFunctions.ColormapFunction")],XD);const U6i=XD;var n4e;let zJ=n4e=class extends yb{constructor(){super(...arguments),this.rasters=[]}writeRasters(t,e){e.rasters=t.map(i=>typeof i=="number"||typeof i=="string"?i:i.toJSON())}clone(){return new n4e({rasters:gi(this.rasters)})}};E([N({json:{write:!0}})],zJ.prototype,"rasters",void 0),E([Cr("rasters")],zJ.prototype,"writeRasters",null),zJ=n4e=E([dt("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],zJ);const z6i=zJ;let AG=class extends vb{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:e}=this,i=e[0];this.outputPixelType=this._getOutputPixelType(i.pixelType);const r=i.clone();if(r.attributeTable=null,r.colormap=null,r.pixelType=this.outputPixelType,r.bandCount=e.map(({bandCount:n})=>n).reduce((n,s)=>n+s),e.every(({statistics:n})=>ve(n)&&n.length)){const n=[];e.forEach(({statistics:s})=>ve(s)&&n.push(...s)),r.statistics=n}if(e.every(({histograms:n})=>ve(n)&&n.length)){const n=[];e.forEach(({histograms:s})=>ve(s)&&n.push(...s)),r.histograms=n}return r.bandCount>1&&(r.colormap=null,r.attributeTable=null),this.rasterInfo=r,{success:!0,supportsGPU:r.bandCount<=3}}_processPixels(e){const{pixelBlocks:i}=e;if(!i)return null;const r=i?.[0];return lt(r)?null:NYt(i)}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};E([N({json:{write:!0,name:"rasterFunction"}})],AG.prototype,"functionName",void 0),E([N({type:z6i,json:{write:!0,name:"rasterFunctionArguments"}})],AG.prototype,"functionArguments",void 0),E([N()],AG.prototype,"rasterArgumentNames",void 0),AG=E([dt("esri.layers.support.rasterFunctions.CompositeBandFunction")],AG);const H6i=AG,sc={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},W6i={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},G_={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},gS={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},q6i={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},V_t={setNull:50,conditional:78},j_t={...W6i,...G_,...gS,...q6i,...V_t},qd=new Map;function Y6i(t){const e=Math.sqrt(t.length),i=t.slice(0,e),r=[1];for(let n=1;na+l);return o!==0&&o!==1&&(r=r.map(a=>a/o)),Z6i(i,{kernel:r,rows:n,cols:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){let{kernel:e}=this.functionArguments;const i=e.reduce((n,s)=>n+s);i!==0&&i!==1&&(e=e.map(n=>n/i));const r=new Float32Array(z_t);return r.set(e),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:r,clampRange:rT(this.outputPixelType)}}};E([N({json:{write:!0,name:"rasterFunction"}})],PG.prototype,"functionName",void 0),E([N({type:Q6i,json:{write:!0,name:"rasterFunctionArguments"}})],PG.prototype,"functionArguments",void 0),E([N()],PG.prototype,"rasterArgumentNames",void 0),PG=E([dt("esri.layers.support.rasterFunctions.ConvolutionFunction")],PG);const e$i=PG;var o4e;let HJ=o4e=class extends yb{constructor(){super(...arguments),this.bandIds=[],this.missingBandAction=tae.bestMatch}clone(){return new o4e({bandIds:[...this.bandIds],missingBandAction:this.missingBandAction})}};E([N({json:{write:!0}})],HJ.prototype,"bandIds",void 0),E([N({json:{write:!0}})],HJ.prototype,"missingBandAction",void 0),HJ=o4e=E([dt("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],HJ);const t$i=HJ;let OG=class extends vb{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{sourceRasterInfos:e}=this,i=e[0],{bandCount:r}=i,{bandIds:n,missingBandAction:s}=this.functionArguments;if(s===tae.fail&&n.some(c=>c<0||c>=r))return{success:!1,supportsGPU:!1,error:"extract-band-function: invalid bandIds"};this.outputPixelType=this._getOutputPixelType("f32");const o=i.clone();o.pixelType=this.outputPixelType,o.bandCount=n.length;const{statistics:a,histograms:l}=o;return ve(a)&&a.length&&(o.statistics=n.map(c=>a[c]||a[a.length-1])),ve(l)&&l.length&&(o.histograms=n.map(c=>l[c]||l[l.length-1])),this.rasterInfo=o,{success:!0,supportsGPU:o.bandCount<=3}}_processPixels(e){const i=e.pixelBlocks?.[0];if(lt(i))return null;const r=i.pixels.length,n=this.functionArguments.bandIds.map(s=>s>=r?r-1:s);return i.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 i=0;i<3;i++)e[i]=Math.min(e[i],2)}return{bandIndexMat3:Sg(e)}}_getInputBandIds(e){const i=e.length;return this.functionArguments.bandIds.map(r=>r>=i?i-1:r).map(r=>e[r])}};E([N({json:{write:!0,name:"rasterFunction"}})],OG.prototype,"functionName",void 0),E([N({type:t$i,json:{write:!0,name:"rasterFunctionArguments"}})],OG.prototype,"functionArguments",void 0),E([N()],OG.prototype,"rasterArgumentNames",void 0),OG=E([dt("esri.layers.support.rasterFunctions.ExtractBandFunction")],OG);const i$i=OG;var a4e;let t6=a4e=class extends yb{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(t,e){e.rasters=t.map(i=>typeof i=="number"||typeof i=="string"?i:i.toJSON())}clone(){return new a4e({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:gi(this.rasters)})}};E([N({json:{write:!0}})],t6.prototype,"operation",void 0),E([N({json:{write:!0}})],t6.prototype,"rasters",void 0),E([Cr("rasters")],t6.prototype,"writeRasters",null),E([N({json:{write:!0}})],t6.prototype,"processAsMultiband",void 0),t6=a4e=E([dt("esri.layers.support.rasterFunctions.LocalFunctionArguments")],t6);const r$i=t6,Cg=new Map;function n$i(t){return Cg.get(t)}Cg.set(gS.acos,[0,Math.PI]),Cg.set(gS.asin,[-Math.PI/2,Math.PI/2]),Cg.set(gS.atan,[-Math.PI/2,Math.PI/2]),Cg.set(gS.cos,[-1,1]),Cg.set(gS.sin,[-1,1]),Cg.set(G_.booleanAnd,[0,1]),Cg.set(G_.booleanNot,[0,1]),Cg.set(G_.booleanOr,[0,1]),Cg.set(G_.booleanXOr,[0,1]),Cg.set(G_.equalTo,[0,1]),Cg.set(G_.notEqual,[0,1]),Cg.set(G_.greaterThan,[0,1]),Cg.set(G_.greaterThanEqual,[0,1]),Cg.set(G_.lessThan,[0,1]),Cg.set(G_.lessThanEqual,[0,1]),Cg.set(G_.isNull,[0,1]);const H_t=[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 s$i(t,e=!1){const i=t.map(a=>a.mask),r=i.filter(a=>ve(a)),n=t[0].pixels[0].length;if(r.length===0)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(c)}return o}const a=r===gS.asin?Math.asin:Math.acos;for(let l=0;l1?e[l]=0:o[l]=a(c)}return o}function f$i(t,e,i,r){const[n]=t,s=n.length,o=dn.createEmptyBand(i,s);for(let a=0;a>n[a]);return o}function b$i(t,e,i){const[r,n]=t,s=r.length,o=dn.createEmptyBand(i,s);for(let a=0;an[a]?1:0);return o}function D$i(t,e,i){const[r,n]=t,s=r.length,o=dn.createEmptyBand(i,s);for(let a=0;a=n[a]?1:0);return o}function F$i(t,e,i){const[r,n]=t,s=r.length,o=dn.createEmptyBand(i,s);for(let a=0;ah&&(l=h)}o[a]=l}return o}function J_t(t,e,i){const r=t.length;if(r<2)return t[0];const[n]=t,s=n.length,o=dn.createEmptyBand(i,s);for(let a=0;ap&&(l=p)}o[a]=c-l}return o}function Z_t(t,e,i){const r=t.length;if(r<2)return t[0];const[n]=t,s=n.length,o=dn.createEmptyBand(i,s);for(let a=0;ah&&(h=c,l=p);s[a]=l}return s}function n1t(t,e,i){const r=t.length;if(r<=2)return i1t(t,e,i);const n=t[0].length,s=dn.createEmptyBand(i,n),o=new Map;for(let a=0;as?e[a]=0:r[a]=o?Math.round(l):l}}function U$i(t,e,i={}){j$i();let r=s$i(t,e>=66&&e<=75);const{outputPixelType:n="f32"}=i,s=!Yd.has(e)||i.processAsMultiband,o=s?t[0].pixels.length:1,a=[];for(let c=0;cv.pixels):t.map(v=>v.pixels[c]);let p,y=!0;if(e===V_t.setNull){const v=V$i(h,r,n);p=v.band,r=v.mask,y=!1}else su.has(e)?p=su.get(e)(h,r,"f64"):am.has(e)?p=e===gS.asin||e===gS.acos||e===gS.atanh?p$i(h,r,"f64",e):f$i(h,r,"f64",am.get(e)):ufe.has(e)?p=m$i(h,r,"f64",ufe.get(e)):Yd.has(e)?p=Yd.get(e)(h,r,"f64"):(p=h[0],y=!1);if(y&&e!==G_.isNull&&!Cg.has(e)){const v=dn.createEmptyBand(n,p.length);r||(r=new Uint8Array(p.length).fill(255)),G$i(p,r,n,v),p=v}a.push(p)}const l=t[0];return new dn({width:l.width,height:l.height,pixelType:n,mask:e===G_.isNull?null:r,pixels:a})}let RG=class extends vb{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:e}=this,i=e[0],{bandCount:r}=i,{processAsMultiband:n}=this.functionArguments;if(e.some(h=>h.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=H_t[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}`};this.outputPixelType=this._getOutputPixelType("f32");const l=i.clone();l.pixelType=this.outputPixelType,l.statistics=null,l.histograms=null,l.colormap=null,l.attributeTable=null,l.bandCount=a!==999||n?r:1;const c=n$i(s);if(c){l.statistics=[];for(let h=0;h16)}}_processPixels(e){const{pixelBlocks:i}=e;return lt(i)||i.some(r=>lt(r))?null:U$i(i,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:e}=this.functionArguments,i=H_t[e],r=Object.keys(j_t).find(l=>j_t[l]===e)?.toLowerCase()??"undefined",n=this.outputPixelType??"f32";let[s,o]=rT(n);const a=n.startsWith("u")||n.startsWith("s");return a&&(s-=1e-4,o+=1e-4),{imageCount:i,operationName:r,domainRange:[s,o],isOutputRounded:a}}};E([N({json:{write:!0,name:"rasterFunction"}})],RG.prototype,"functionName",void 0),E([N({type:r$i,json:{write:!0,name:"rasterFunctionArguments"}})],RG.prototype,"functionArguments",void 0),E([N()],RG.prototype,"rasterArgumentNames",void 0),RG=E([dt("esri.layers.support.rasterFunctions.LocalFunction")],RG);const z$i=RG;var c4e;let i6=c4e=class extends yb{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=eae.matchAny}get normalizedNoDataValues(){const{noDataValues:t}=this;if(!t?.length)return null;let e=!1;const i=t.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?i:null}clone(){return new c4e({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};E([N({json:{write:!0}})],i6.prototype,"includedRanges",void 0),E([N({json:{write:!0}})],i6.prototype,"noDataValues",void 0),E([N()],i6.prototype,"normalizedNoDataValues",null),E([N({json:{write:!0}})],i6.prototype,"noDataInterpretation",void 0),i6=c4e=E([dt("esri.layers.support.rasterFunctions.MaskFunctionArguments")],i6);const H$i=i6;let r6=class extends vb{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const e=this.sourceRasterInfos[0].clone(),{pixelType:i}=e;this.outputPixelType=this._getOutputPixelType(i),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*tM)&&(!n||o&&n[0].length<=tM)}}_processPixels(e){const i=e.pixelBlocks?.[0];if(lt(i))return null;const{outputPixelType:r,lookups:n}=this,{includedRanges:s,noDataInterpretation:o,normalizedNoDataValues:a}=this.functionArguments,l=o===eae.matchAll;return BYt(i,{includedRanges:s,noDataValues:a,outputPixelType:r,matchAll:l,lookups:n})}_getWebGLParameters(){const{includedRanges:e,normalizedNoDataValues:i}=this.functionArguments,r=new Float32Array(tM);r.fill(sA),i?.[0]?.length&&r.set(i[0]);const n=new Float32Array(tM);for(let s=0;se[n])}};E([N({json:{write:!0,name:"rasterFunction"}})],DG.prototype,"functionName",void 0),E([N({type:q$i,json:{write:!0,name:"rasterFunctionArguments"}})],DG.prototype,"functionArguments",void 0),E([N()],DG.prototype,"rasterArgumentNames",void 0),DG=E([dt("esri.layers.support.rasterFunctions.NDVIFunction")],DG);const Y$i=DG;var d4e;let KD=d4e=class extends yb{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new d4e({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};E([N({json:{write:!0}})],KD.prototype,"inputRanges",void 0),E([N({json:{write:!0}})],KD.prototype,"outputValues",void 0),E([N({json:{write:!0}})],KD.prototype,"noDataRanges",void 0),E([N({json:{write:!0}})],KD.prototype,"allowUnmatched",void 0),E([N({json:{write:!0}})],KD.prototype,"isLastInputRangeInclusive",void 0),KD=d4e=E([dt("esri.layers.support.rasterFunctions.RemapFunctionArguments")],KD);const X$i=KD;let n6=class extends vb{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const e=this.sourceRasterInfos[0].clone(),{pixelType:i}=e;this.outputPixelType=this._getOutputPixelType(i),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(ve(r)&&r.length&&s?.length)if(n){const c=Math.min.apply(null,[...s,r[0].min]),h=Math.max.apply(null,[...s,r[0].max]);e.statistics=[{...r[0],min:c,max:h}]}else{let c=s[0],h=c;for(let p=0;ps[p]?s[p]:c,h=h>s[p]?h:s[p];e.statistics=[{...r[0],min:c,max:h}]}return this.rasterInfo=e,this.lookup=n?null:VYt({srcPixelType:i,inputRanges:o,outputValues:s,noDataRanges:a,allowUnmatched:n,isLastInputRangeInclusive:l,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!s||s.length<=tM)&&(!a||a.length<=tM)}}_processPixels(e){const i=e.pixelBlocks?.[0];if(lt(i))return null;const{lookup:r,outputPixelType:n}=this;if(r){const h=rae(i,{lut:[r.lut],offset:r.offset,outputPixelType:n});return ve(h)&&r.mask&&(h.mask=wCe(i.pixels[0],i.mask,r.mask,r.offset,"u8")),h}const{inputRanges:s,outputValues:o,noDataRanges:a,allowUnmatched:l,isLastInputRangeInclusive:c}=this.functionArguments;return $Yt(i,{inputRanges:s,outputValues:o,noDataRanges:a,outputPixelType:n,allowUnmatched:l,isLastInputRangeInclusive:c})}_getWebGLParameters(){const{allowUnmatched:e,inputRanges:i,outputValues:r,noDataRanges:n,isLastInputRangeInclusive:s}=this.functionArguments,o=new Float32Array(3*tM),a=1e-5,l=r.length;if(i?.length){let h=0,p=0;for(let y=0;y0&&(o[y]-=a),(p=1?e*Q$i:e,slopeType:i,pixelSizeFactor:r??0,pixelSizePower:n??0}}};E([N({json:{write:!0,name:"rasterFunction"}})],s6.prototype,"functionName",void 0),E([N({type:Z$i,json:{write:!0,name:"rasterFunctionArguments"}})],s6.prototype,"functionArguments",void 0),E([N()],s6.prototype,"rasterArgumentNames",void 0),E([N({json:{write:!0}})],s6.prototype,"isGCS",void 0),s6=E([dt("esri.layers.support.rasterFunctions.SlopeFunction")],s6);const e8i=s6;var f4e;let o6=f4e=class extends yb{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(t,e){if(!t?.length)return null;const i=[];return t.forEach(r=>{const n={min:r.min,max:r.max,avg:r.avg??r.mean,stddev:r.stddev??r.standardDeviation};i.push(n)}),i}writeStatistics(t,e,i){if(!t?.length)return;const r=[];t.forEach(n=>{const s={...n,mean:n.avg,standardDeviation:n.stddev};delete s.avg,delete s.stddev,r.push(s)}),e[i]=r}clone(){return new f4e({statistics:gi(this.statistics),histograms:gi(this.histograms)})}};E([N({json:{write:!0}})],o6.prototype,"statistics",void 0),E([Vi("statistics")],o6.prototype,"readStatistics",null),E([Cr("statistics")],o6.prototype,"writeStatistics",null),E([N({json:{write:!0}})],o6.prototype,"histograms",void 0),o6=f4e=E([dt("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],o6);const t8i=o6;let ZD=class extends vb{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 i=e.clone(),{statistics:r,histograms:n}=this.functionArguments;return n&&(i.histograms=n),r&&(i.statistics=r),this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(e){return e.pixelBlocks?.[0]}};E([N({json:{write:!0,name:"rasterFunction"}})],ZD.prototype,"functionName",void 0),E([N({type:t8i,json:{write:!0,name:"rasterFunctionArguments"}})],ZD.prototype,"functionArguments",void 0),E([N()],ZD.prototype,"rasterArgumentNames",void 0),E([N({json:{write:!0}})],ZD.prototype,"indexedColormap",void 0),E([N()],ZD.prototype,"isNoopProcess",void 0),ZD=E([dt("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],ZD);const i8i=ZD;var m4e;const r8i=new Ks({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let my=m4e=class extends yb{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(t,e,i){t?.length&&(Array.isArray(t[0])||(t=t.map(r=>[r.min,r.max,r.avg,r.stddev])),e[i]=t)}clone(){return new m4e({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:gi(this.statistics),gamma:gi(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:gi(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};E([N({type:Boolean,json:{write:!0}})],my.prototype,"computeGamma",void 0),E([N({type:Boolean,json:{name:"dra",write:!0}})],my.prototype,"dynamicRangeAdjustment",void 0),E([N({type:[Number],json:{write:!0}})],my.prototype,"gamma",void 0),E([N()],my.prototype,"histograms",void 0),E([N({type:Number,json:{write:!0}})],my.prototype,"maxPercent",void 0),E([N({type:Number,json:{write:!0}})],my.prototype,"minPercent",void 0),E([N({type:Number,json:{write:!0}})],my.prototype,"numberOfStandardDeviations",void 0),E([N({type:Number,json:{name:"max",write:!0}})],my.prototype,"outputMax",void 0),E([N({type:Number,json:{name:"min",write:!0}})],my.prototype,"outputMin",void 0),E([N({type:Number,json:{write:!0}})],my.prototype,"sigmoidStrengthLevel",void 0),E([N({json:{type:[[Number]],write:!0}})],my.prototype,"statistics",void 0),E([Cr("statistics")],my.prototype,"writeStatistics",null),E([rn(r8i)],my.prototype,"stretchType",void 0),E([N({type:Boolean,json:{write:!0}})],my.prototype,"useGamma",void 0),my=m4e=E([dt("esri.layers.support.rasterFunctions.StretchFunctionArguments")],my);const n8i=my;let QD=class extends vb{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:i}=e,{functionArguments:r}=this,{dynamicRangeAdjustment:n,gamma:s,useGamma:o}=r;if(!n&&["u8","u16","s8","s16"].includes(i)){const l=sM(r.toJSON(),{rasterInfo:e}),c=this._isOutputRoundingNeeded()?"round":"float";this.lookup=cTe({pixelType:i,...l,gamma:o?s:null,rounding:c}),this.cutOffs=l}else n||(this.cutOffs=sM(r.toJSON(),{rasterInfo:e}));this.outputPixelType=this._getOutputPixelType(i);const a=e.clone();return a.pixelType=this.outputPixelType,a.statistics=null,a.histograms=null,a.colormap=null,a.attributeTable=null,this.outputPixelType==="u8"&&(a.keyProperties.DataType="processed"),this.rasterInfo=a,{success:!0,supportsGPU:!n}}_processPixels(e){const i=e.pixelBlocks?.[0];if(lt(i))return i;const{lookup:r}=this;if(r)return rae(i,{...r,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:n}=this,s=this.cutOffs||sM(n.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:i}),o=n.useGamma?n.gamma:null;return Cae(i,{...s,gamma:o,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const{outputMin:e=0,outputMax:i=255,gamma:r,useGamma:n}=this.functionArguments,s=this.rasterInfo.bandCount>=2?3:1,o=n&&r&&r.length?pTe(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 c=new Float32Array(s);let h;for(h=0;h{r&&typeof r!="number"&&(typeof r=="string"?r.startsWith("http")&&(e.includes(r)||e.push(r)):"rasterFunctionArguments"in r&&o1t(r,e))})}function cfe(t,e){if(e=e??{},"function"in(t=gi(t))&&"arguments"in t&&t.arguments&&(t=a8i(t,e)),"rasterFunction"in t)return l1t(t=g4e(t),e);throw new st("raster-function-helper","unsupported raster function json.")}function o8i(t,e){return e[0]==="rasters"&&Array.isArray(t.rasters)?t.rasters:e.map(i=>t[i])}function a1t(t){return!!(t&&typeof t=="object"&&t.rasterFunction&&t.rasterFunctionArguments)}function g4e(t){const{rasterFunction:e,rasterFunctionArguments:i}=t,r={};for(const n in i){let s=i[n];const o=n.toLowerCase();if(o==="rasters"&&Array.isArray(s))r.rasters=s.map(a=>a1t(a)?g4e(a):a);else switch(a1t(s)&&(s=g4e(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=["$$"]),{...t,rasterFunctionArguments:r}}function l1t(t,e){const{rasterFunction:i,rasterFunctionArguments:r}=t,n=t.outputPixelType?.toLowerCase();if(i==null||!Iv.has(i))throw new st("raster-function-helper",`unsupported raster function: ${i}`);const s=Iv.get(i),o=(typeof s.ctor=="function"?s.ctor:s.ctor.default).fromJSON({...t,outputPixelType:n}),{rasterArgumentNames:a}=o,l=[],c=o8i(r,a),h=a[0]==="rasters",p=[];for(let y=0;yy4e(e));if("value"in t&&["number","string","boolean"].includes(typeof t.value))return t.value;if(!("type"in t))return t;switch(t.type){case"Scalar":return t.value;case"AlgorithmicColorRamp":return c1t(t);case"MultiPartColorRamp":return{type:"multipart",colorRamps:t.ArrayOfColorRamp.map(c1t)};case"ArgumentArray":return t.elements?.length?t.elements[0].type==="RasterStatistics"?t.elements:t.elements[0].type==="RasterFunctionVariable"?t.elements.map(e=>e.value!=null?y4e(e.value):e.name.toLowerCase().includes("raster")?"$$":null):t:t.elements;default:return t}}function c1t(t){const e=t.algorithm??"esriHSVAlgorithm";let{FromColor:i,ToColor:r}=t;if(!Array.isArray(i)){const{r:n,g:s,b:o}=eM({h:i.Hue,s:i.Saturation,v:i.Value});i=[n,s,o,i.AlphaValue]}if(!Array.isArray(r)){const{r:n,g:s,b:o}=eM({h:r.Hue,s:r.Saturation,v:r.Value});r=[n,s,o,r.AlphaValue]}return{type:"algorithmic",algorithm:e,fromColor:i,toColor:r}}function a8i(t,e){e&&u1t(t,e);const i={};return h1t(t,i),i}function h1t(t,e){if(!t||!e)return;const{function:i,arguments:r}=t;if(!i||!r)return;e.rasterFunction=i.type.replace("Function",""),e.outputPixelType=i.pixelType;const n={};e.rasterFunctionArguments=n;for(const s in r){const o=r[s];typeof o=="object"&&("function"in o&&o.function&&o.arguments?(e.rasterFunctionArguments[s]={},h1t(o,e.rasterFunctionArguments[s])):"value"in o&&(n[s]=y4e(o.value)))}switch(n.DEM&&!n.Raster&&(n.Raster=n.DEM,delete n.DEM),e.rasterFunction){case"Stretch":l8i(n);break;case"Colormap":u8i(n);break;case"Convolution":c8i(n);break;case"Mask":h8i(n)}}function l8i(t){t.Statistics?.length&&typeof t.Statistics=="object"&&(t.Statistics=t.Statistics.map(e=>[e.min,e.max,e.mean,e.standardDeviation])),t.NumberOfStandardDeviation!=null&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}function u8i(t){t.ColorRamp?.type?.toLowerCase()==="randomcolorramp"&&(delete t.ColorRamp,t.ColormapName="Random"),t.ColorSchemeType===0&&delete t.ColorRamp}function c8i(t){t.ConvolutionType!=null&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}function h8i(t){t.NoDataValues?.length&&typeof t.NoDataValues[0]=="string"&&(t.NoDataValues=t.NoDataValues.filter(e=>e!=="").map(e=>Number(e)))}Iv.set("Aspect",{desc:"Aspect Function",ctor:o6i,rasterArgumentNames:["raster"]}),Iv.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:D6i,rasterArgumentNames:["raster"]}),Iv.set("Colormap",{desc:"Colormap Function",ctor:U6i,rasterArgumentNames:["raster"]}),Iv.set("CompositeBand",{desc:"CompositeBand Function",ctor:H6i,rasterArgumentNames:["rasters"]}),Iv.set("Convolution",{desc:"Convolution Function",ctor:e$i,rasterArgumentNames:["raster"]}),Iv.set("ExtractBand",{desc:"ExtractBand Function",ctor:i$i,rasterArgumentNames:["raster"]}),Iv.set("Local",{desc:"Local Function",ctor:z$i,rasterArgumentNames:["rasters"]}),Iv.set("Mask",{desc:"Mask Function",ctor:W$i,rasterArgumentNames:["raster"]}),Iv.set("NDVI",{desc:"NDVI Function",ctor:Y$i,rasterArgumentNames:["raster"]}),Iv.set("Remap",{desc:"Remap Function",ctor:K$i,rasterArgumentNames:["raster"]}),Iv.set("Slope",{desc:"Slope Function",ctor:e8i,rasterArgumentNames:["raster"]}),Iv.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:i8i,rasterArgumentNames:["raster"]}),Iv.set("Stretch",{desc:"Stretch Function",ctor:s8i,rasterArgumentNames:["raster"]});var v4e;function _4e(t,e,i){return!o_(t,e,i)}function FG(t,e,i){const r=_4e(t,e,i);if(r&&!hw())throw new st("rasterprojectionhelper-project","projection engine is not loaded");return r}(function(t){t[t.None=0]="None",t[t.North=1]="North",t[t.South=2]="South",t[t.Both=3]="Both"})(v4e||(v4e={}));const d1t=(t,e,i,r=0)=>{if(i[0]===1)return[0,0];let n=1,s=-1,o=1,a=-1;for(let P=0;Pt[P]?t[P]:n,s=s>t[P]?s:t[P],o=o>t[P+1]?t[P+1]:o,a=a>t[P+1]?a:t[P+1]);const{cols:l,rows:c}=e,h=(s-n)/l/i[0],p=(a-o)/c/i[1],y=2*r;let v=0,x=!1,I=[0,0];for(let P=0;Pv&&(v=Y+X,I=[Y,X]),y&&v>y){x=!0;break}}if(x)break}return I},d8i={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},hfe=32,dfe=4,b4e=dfe,w4e=new Map,x4e=new Map,pfe=500;async function S4e(){hw()||await A2()}function p1t(t,e,i){return FG(t.spatialReference,e)?i?WSe(e,t.spatialReference,t):WSe(t.spatialReference,e,t):null}function WJ(t,e,i,r=null){const n=t.spatialReference;if(n.equals(e))return t;FG(n,e,r);const s=i.center,o=new Ar({xmin:s.x-t.x/2,xmax:s.x+t.x/2,ymin:s.y-t.y/2,ymax:s.y+t.y/2,spatialReference:n}),a=cp(o,e,r),l=Av(e);let c;if(lt(a)||ve(l)&&a.width>=l){const h=Hc(n)/Hc(e);c={x:t.x*h,y:t.y*h}}else c={x:a.width,y:a.height};return c}function Qw(t,e=.01){return Hc(t)?e/Hc(t):0}function ffe(t,e,i=null,r=!0){const n=t.spatialReference;if(n.equals(e))return t;FG(n,e,i);const s=cp(t,e,i);return r&&s&&f1t([t],[s],n,e),s}function f1t(t,e,i,r){const n=mfe(i,!0),s=mfe(r,!0),o=Qw(i,pfe),a=Qw(r,pfe);if(o&&ve(n)&&ve(s))for(let l=0;l=s[1]-a&&Math.abs(h-n[0])new er(a[0],a[1],i)),o=cp(s,r,n);return n&&f1t(s,o,i,r),o.map(a=>a?[a.x,a.y]:[NaN,NaN])}function m1t(t){const{inSR:e,outSR:i,datumTransformation:r}=t,n=a6(e),{points:s,mask:o}=C4e(t,n);if(!e.isGeographic){const l=e.wkid?j1.coordsys(e.wkid):j1.fromString(e.isGeographic?Du.PE_TYPE_GEOGCS:Du.PE_TYPE_PROJCS,e.wkt);Vq.projToGeog(l,s.length,s)}if(ve(r)&&r.steps.length){let l;if(i.isGeographic&&(l=s.map(([h])=>h>179.9955?1:h<-179.9955?-1:0)),r.steps.forEach(h=>{const p=h.wkid?j1.geogtran(h.wkid):j1.fromString(Du.PE_TYPE_GEOGTRAN,h.wkt);Noe.geogToGeog(p,s.length,s,null,h.isInverse?Du.PE_TRANSFORM_2_TO_1:Du.PE_TRANSFORM_1_TO_2)}),l)for(let h=0;h179.9955?1:y<-179.9955?-1:0;p&&v&&p!==v&&(s[h][0]=p>0?y+360:y-360)}}if(!i.isGeographic){const l=a6(i,!0),c=ve(l)&&l.isEnvelope?[l.bbox[1],l.bbox[3]]:[-90,90];g8i(s,c);const h=i.wkid?j1.coordsys(i.wkid):j1.fromString(i.isGeographic?Du.PE_TYPE_GEOGCS:Du.PE_TYPE_PROJCS,i.wkt);Vq.geogToProj(h,s.length,s)}let a=s;if(o&&s.length!==o.length){a=[];for(let l=0,c=0;lP.getInclusive()===1&&P.getKind()===1);if(!o){if(o=n.find(P=>P.getInclusive()===1&&P.getKind()===0),!o)return null;s=!0}const a=i?0:(r.getNorthPoleLocation()===2?1:0)|(r.getSouthPoleLocation()===2?2:0),l=r.isPannableRectangle(),c=o.getCoord();if(s)return{isEnvelope:s,isPannable:l,vertices:c,coef:null,bbox:[c[0][0]-e,c[0][1]-e,c[1][0]+e,c[1][1]+e],poleLocation:a};let h=0;const p=[];let[y,v]=c[0],[x,I]=c[0];for(let P=0,F=c.length;Pk?x:k,I=I>j?I:j}return{isEnvelope:!1,isPannable:l,vertices:c,coef:p,bbox:[y,v,x,I],poleLocation:a}}function C4e(t,e){const i=[],{cols:r,rows:n,xres:s,yres:o,usePixelCenter:a}=t;let{xmin:l,ymax:c}=t;if(a&&(l+=s/2,c-=o/2),lt(e)){for(let v=0;v=v&&j<=I;for(let Y=0;Y=x&&X<=P&&(i.push([j,X]),h[k]=1)}}return{points:i,mask:h}}const p=e.coef,y=[];for(let v=0;v=Y&&x<=X){const ie=j*x+V;I.push(ie),P.push(Z)}}let F=I;if(I.length>2){let k=P[0]===2?0:P[0],j=I[0];F=[];for(let V=1;VV-Y)}else I[0]>I[1]&&(F=[I[1],I[0]]);y.push(F)}for(let v=0,x=0;v=k[0]&&I<=k[1]&&(i.push([I,F]),h[x]=1);else if(k.length>2){let j=!1;for(let V=0;V=k[V]&&I<=k[V+1]){j=!0;break}j&&(i.push([I,F]),h[x]=1)}}}return{points:i,mask:h}}function g8i(t,e){const[i,r]=e;for(let n=0;nr)&&(t[n]=[NaN,NaN])}}function y1t(t){const e=Av(t[0].spatialReference);if(t.length<2||lt(e))return t[0];let{xmin:i,xmax:r,ymin:n,ymax:s}=t[0];for(let o=1;oQw(n)){const{xmin:c,xmax:h}=t;for(let p=0;p<=s;p++){const y=p===0?c:-o/2,v=p===s?h-o*p:o/2;l[p]=new Ar({xmin:y,xmax:v,ymin:t.ymin,ymax:t.ymax,spatialReference:n})}}return y1t(l.map(c=>v1t(c,e,i,r)).filter(ve))}function y8i(t,e){const i=Av(e);if(lt(i))return null;let{xmin:r,ymin:n,xmax:s,ymax:o}=t;const a=t.spatialReference,l=new To({spatialReference:a,rings:[[[r,n],[s,n],[s,o],[r,o],[r,n]]]}),c=cp(l,e);if(c.rings.length!==2||!c.rings[0].length||!c.rings[1].length)return null;const{rings:h}=c,p=Qw(a),y=new Ar({spatialReference:e});for(let v=0;v<2;v++){r=s=h[v][0][0],n=o=h[v][0][1];for(let x=0;xh[v][x][0]?h[v][x][0]:r,s=sh[v][x][1]?h[v][x][1]:n,o=o=o.ymax))return null;if(!r||!o)return o;const a=mfe(s,!0),l=mfe(e,!0);if(lt(a)||lt(l))return o;const c=Qw(s,.001),h=Qw(s,pfe),p=Qw(e,.001);if(Math.abs(o.xmin-l[0])h){o.xmin=l[0];const x=[];x.push(new er(t.xmax,t.ymin,s)),x.push(new er(t.xmax,(t.ymin+t.ymax)/2,s)),x.push(new er(t.xmax,t.ymax,s));const I=x.map(P=>ffe(P,e,i)).filter(P=>!isNaN(P?.x)).map(P=>P.x);o.xmax=Math.max.apply(null,I)}if(vh){o.xmax=l[1];const x=[];x.push(new er(t.xmin,t.ymin,s)),x.push(new er(t.xmin,(t.ymin+t.ymax)/2,s)),x.push(new er(t.xmin,t.ymax,s));const I=x.map(P=>ffe(P,e,i)).filter(P=>!isNaN(P?.x)).map(P=>P.x);o.xmin=Math.min.apply(null,I)}}else{const y=Qw(e,.001);Math.abs(o.xmin-l[0])0&&r.outofBoundPointCountb4e)&&(_4e(l,c,t.datumTransformation)&&(l.isGeographic||ve(a6(l))),i=[dfe,dfe],r=E4e({...t,spacing:i}),n={cols:r.size[0]+1,rows:r.size[1]+1},o=d1t(r.offsets,n,i,b4e)),r.error=o,i[0]>1&&(r.coefficients=b1t(r.offsets,n,s)),t.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(c.isGeographic)r.gcsGrid={offsets:r.offsets,coefficients:r.coefficients,spacing:i};else{const h=a6(l);if(ve(h)&&!h.isEnvelope){const p=_8i(l),y=eF(t.projectedExtent,p),{offsets:v}=E4e({...t,srcBufferExtent:y,spacing:i}),x=b1t(v,n,s);r.gcsGrid={offsets:v,coefficients:x,spacing:i}}}return r}function E4e(t){const{projectedExtent:e,srcBufferExtent:i,pixelSize:r,datumTransformation:n,rasterTransform:s}=t,o=e.spatialReference,a=i.spatialReference,l=FG(o,a),{xmin:c,ymin:h,xmax:p,ymax:y}=e,v=Av(a),x=ve(v)&&(t.hasWrapAround||s?.type==="gcs-shift"),I=t.spacing||[hfe,hfe],P=I[0]*r.x,F=I[1]*r.y,k=I[0]===1,j=Math.ceil((p-c)/P-.1/I[0])+(k?0:1),V=Math.ceil((y-h)/F-.1/I[1])+(k?0:1),Y=p8i({cols:j,rows:V,xmin:c,ymax:y,xres:P,yres:F,inSR:o,outSR:a,datumTransformation:n,preferPE:I[0]<=dfe,usePixelCenter:k}),X=[];let Z,ie=0;const ce=k?-1:NaN,{xmin:he,xmax:_e,ymax:xe,width:Pe,height:ke}=i,J=Qw(a,pfe),de=ve(v)&&he>0&&_e>v/2;let Se=!1;if(l){const Ie=a6(o);Se=ve(Ie)&&Ie.poleLocation>0}for(let Ie=0;Ie_e&&Ge[0]>v/2-J?Ge[0]-=v:x&&Ie===0&&Ge[0]<0&&de&&!s&&(Ge[0]+=v),!Ge||isNaN(Ge[0])||isNaN(Ge[1]))X.push(ce),X.push(ce),Re.push(null),ie++;else{if(s){const Be=s.inverseTransform(new er({x:Ge[0],y:Ge[1],spatialReference:a}));Ge=[Be.x,Be.y]}Re.push(Ge),Ie>0&&x&&Z[Oe]&&Ge[0]_e&&Ge[0]>v&&(Ge[0]-=v)),X.push((Ge[0]-he)/Pe),X.push((xe-Ge[1])/ke)}}Z=Re}return{offsets:X,error:null,coefficients:null,outofBoundPointCount:ie,spacing:I,size:k?[j,V]:[j-1,V-1]}}function b1t(t,e,i){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;l=x)s=a.length,o=y/x>8;else{let F,k=I;for(let j=1;j<=a.length;j++){if(F=(a[j-1].x+a[j-1].y)/2,y<=F){y===F?s=j:i==="down"?(s=j-1,o=y/k>8):s=i==="up"||y-k>F-y||y/k>2?j:j-1;break}k=F}}const P=s===0?n:a[s-1];return o&&Math.min(P.x,P.y)*Hc(e.spatialReference)>19567&&(o=!1),{pyramidLevel:s,pyramidResolution:new er({x:P.x,y:P.y,spatialReference:e.spatialReference}),excessiveReading:o}}const l=Math.log(t.x/n.x)/Math.LN2,c=Math.log(t.y/n.y)/Math.LN2,h=e.storageInfo.maximumPyramidLevel||0;s=i==="down"?Math.floor(Math.min(l,c)):i==="up"?Math.ceil(Math.max(l,c)):Math.round((l+c)/2),s<0?s=0:s>h&&(o=s>h+3,s=h);const p=2**s;return{pyramidLevel:s,pyramidResolution:new er({x:p*e.nativePixelSize.x,y:p*e.nativePixelSize.y,spatialReference:e.spatialReference}),excessiveReading:o}}function w8i(t,e,i=512,r=!0){const{extent:n,spatialReference:s,pixelSize:o}=t,a=WJ(new er({x:o.x,y:o.y,spatialReference:s}),e,n);if(a==null)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const l=(a.x+a.y)/2,c=Hc(e),h=l*c*96*39.37,p=e.isGeographic?256/i*2958287637958547e-7:256/i*591657527591555e-6;let y=t.dataType==="vector-magdir"||t.dataType==="vector-uv";const v=eF(n,e),x=Math.min(Math.ceil(Math.log(Math.min(t.width,t.height)/32)/Math.LN2),Math.ceil(Math.log(p/2/h)/Math.LN2));if(!y&&r&&(e.isGeographic||e.isWebMercator)&&(y=v.xmin*v.xmax<0,!y&&x<3)){const Z=Av(e);if(ve(Z)){const ie=2**x*l*i,ce=Math.ceil(Z/ie);y=ce===1||ce===2&&Z/2-v.xmax=X;)P/=k,I.x/=k,I.y/=k,j.push(P),V.push({x:I.x,y:I.y});return{projectedPixelSize:a,scales:j,srcResolutions:V,isCustomTilingScheme:!y}}let qJ=class extends Ui{get affectsPixelSize(){return!1}forwardTransform(e){return e}inverseTransform(e){return e}};E([N()],qJ.prototype,"affectsPixelSize",null),E([N({json:{write:!0}})],qJ.prototype,"spatialReference",void 0),qJ=E([dt("esri.layers.support.rasterTransforms.BaseRasterTransform")],qJ);const A4e=qJ;let YJ=class extends A4e{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(e){return(e=e.clone()).type==="point"?(e.x>180+this.tolerance&&(e.x-=360),e):(e.xmin>=180-this.tolerance?(e.xmax-=360,e.xmin-=360):e.xmax>180+this.tolerance&&(e.xmin=-180,e.xmax=180),e)}inverseTransform(e){return(e=e.clone()).type==="point"?(e.x<-this.tolerance&&(e.x+=360),e):(e.xmin<-this.tolerance&&(e.xmin+=360,e.xmax+=360),e)}};E([rn({GCSShiftXform:"gcs-shift"})],YJ.prototype,"type",void 0),E([N()],YJ.prototype,"tolerance",void 0),YJ=E([dt("esri.layers.support.rasterTransforms.GCSShiftTransform")],YJ);const w1t=YJ;let yfe=class extends A4e{constructor(){super(...arguments),this.type="identity"}};E([rn({IdentityXform:"identity"})],yfe.prototype,"type",void 0),yfe=E([dt("esri.layers.support.rasterTransforms.IdentityTransform")],yfe);const x8i=yfe;function P4e(t,e,i){const{x:r,y:n}=e;if(i<2)return{x:t[0]+r*t[2]+n*t[4],y:t[1]+r*t[3]+n*t[5]};if(i===2){const y=r*r,v=n*n,x=r*n;return{x:t[0]+r*t[2]+n*t[4]+y*t[6]+x*t[8]+v*t[10],y:t[1]+r*t[3]+n*t[5]+y*t[7]+x*t[9]+v*t[11]}}const s=r*r,o=n*n,a=r*n,l=s*r,c=s*n,h=r*o,p=n*o;return{x:t[0]+r*t[2]+n*t[4]+s*t[6]+a*t[8]+o*t[10]+l*t[12]+c*t[14]+h*t[16]+p*t[18],y:t[1]+r*t[3]+n*t[5]+s*t[7]+a*t[9]+o*t[11]+l*t[13]+c*t[15]+h*t[17]+p*t[19]}}function x1t(t,e,i){const{xmin:r,ymin:n,xmax:s,ymax:o,spatialReference:a}=e;let l=[];if(i<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 p=10;for(let y=0;yP4e(t,p,i));const c=l.map(p=>p.x),h=l.map(p=>p.y);return new Ar({xmin:Math.min.apply(null,c),xmax:Math.max.apply(null,c),ymin:Math.min.apply(null,h),ymax:Math.max.apply(null,h),spatialReference:a})}function S8i(t){const[e,i,r,n,s,o]=t,a=r*o-s*n,l=s*n-r*o;return[(s*i-e*o)/a,(r*i-e*n)/l,o/a,n/l,-s/a,-r/l]}let ex=class extends A4e{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(e,i){const{coeffX:r,coeffY:n}=i;if(!r?.length||!n?.length||r.length!==n.length)return null;const s=[];for(let o=0;o0}forwardTransform(e){if(e.type==="point"){const i=P4e(this.forwardCoefficients,e,this.polynomialOrder);return new er({x:i.x,y:i.y,spatialReference:e.spatialReference})}return x1t(this.forwardCoefficients,e,this.polynomialOrder)}inverseTransform(e){if(e.type==="point"){const i=P4e(this.inverseCoefficients,e,this.polynomialOrder);return new er({x:i.x,y:i.y,spatialReference:e.spatialReference})}return x1t(this.inverseCoefficients,e,this.polynomialOrder)}};E([N({json:{write:!0}})],ex.prototype,"polynomialOrder",void 0),E([N()],ex.prototype,"forwardCoefficients",void 0),E([Vi("forwardCoefficients",["coeffX","coeffY"])],ex.prototype,"readForwardCoefficients",null),E([Cr("forwardCoefficients")],ex.prototype,"writeForwardCoefficients",null),E([N({json:{write:!0}})],ex.prototype,"inverseCoefficients",null),E([Vi("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],ex.prototype,"readInverseCoefficients",null),E([Cr("inverseCoefficients")],ex.prototype,"writeInverseCoefficients",null),E([N()],ex.prototype,"affectsPixelSize",null),E([rn({PolynomialXform:"polynomial"})],ex.prototype,"type",void 0),ex=E([dt("esri.layers.support.rasterTransforms.PolynomialTransform")],ex);const vfe=ex,S1t={GCSShiftXform:w1t,IdentityXform:x8i,PolynomialXform:vfe},C8i=Object.keys(S1t);function T8i(t){const e=t?.type;return!t||C8i.includes(e)}function C1t(t){if(!t?.type)return null;const i=S1t[t?.type];if(i){const r=new i;return r.read(t),r}return null}const E8i=Object.freeze(Object.defineProperty({__proto__:null,default:class{convertVectorFieldData(e){const i=dn.fromJSON(e.pixelBlock),r=mB(i,e.type);return Promise.resolve(ve(r)?r.toJSON():null)}async decode(e){const i=await Sae(e.data,e.options);return i&&i.toJSON()}symbolize(e){e.pixelBlock=dn.fromJSON(e.pixelBlock),e.extent=e.extent?Ar.fromJSON(e.extent):null;const i=this.symbolizer.symbolize(e);return Promise.resolve(ve(i)?i.toJSON():null)}async updateSymbolizer(e){this.symbolizer=fTe.fromJSON(e.symbolizerJSON),e.histograms&&this.symbolizer?.rendererJSON.type==="rasterStretch"&&(this.symbolizer.rendererJSON.histograms=e.histograms)}async updateRasterFunction(e){this.rasterFunction=cfe(e.rasterFunctionJSON)}async process(e){const i=this.rasterFunction.process({extent:Ar.fromJSON(e.extent),primaryPixelBlocks:e.primaryPixelBlocks.map(r=>ve(r)?dn.fromJSON(r):null),primaryRasterIds:e.primaryRasterIds});return ve(i)?i.toJSON():null}stretch(e){const i=this.symbolizer.simpleStretch(dn.fromJSON(e.srcPixelBlock),e.stretchParams);return Promise.resolve(ve(i)&&i.toJSON())}estimateStatisticsHistograms(e){const i=hTe(dn.fromJSON(e.srcPixelBlock));return Promise.resolve(i)}split(e){const i=KXe(dn.fromJSON(e.srcPixelBlock),e.tileSize,e.maximumPyramidLevel);return i&&i.forEach((r,n)=>{i.set(n,r?.toJSON())}),Promise.resolve(i)}async mosaicAndTransform(e){const i=e.srcPixelBlocks.map(o=>o?new dn(o):null),r=rY(i,e.srcMosaicSize,{blockWidths:e.blockWidths,alignmentInfo:e.alignmentInfo,clipOffset:e.clipOffset,clipSize:e.clipSize});let n,s=r;return e.coefs&&(s=QXe(r,e.destDimension,e.coefs,e.sampleSpacing,e.interpolation)),e.projectDirections&&e.gcsGrid&&(n=ZXe(e.destDimension,e.gcsGrid),s=iKe(s,e.isUV?"vector-uv":"vector-magdir",n)),{pixelBlock:s?.toJSON(),localNorthDirections:n}}async createFlowMesh(e,i){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 zTe(e.meshType,e.simulationSettings,r,i.signal);return{result:{vertexBuffer:n.buffer,indexBuffer:s.buffer},transferList:[n.buffer,s.buffer]}}async getProjectionOffsetGrid(e){const i=Ar.fromJSON(e.projectedExtent),r=Ar.fromJSON(e.srcBufferExtent);let n=null;e.datumTransformationSteps&&(n=new joe({steps:e.datumTransformationSteps})),(e.includeGCSGrid||_4e(i.spatialReference,r.spatialReference,n))&&await S4e();const s=e.rasterTransform?C1t(e.rasterTransform):null;return T4e({...e,projectedExtent:i,srcBufferExtent:r,datumTransformation:n,rasterTransform:s})}}},Symbol.toStringTag,{value:"Module"}));let LG=class{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return this._itemsPtr===0&&D8(()=>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*T1t);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;ethis._reset());const e=Math.floor(this._itemsPtr/this._itemsPerBuffer);for(;this._buffers.length<=e;){const i=new ArrayBuffer(this._itemsPerBuffer*this._itemByteSize);for(let r=0;re;)this._buffers.pop(),this._items.length=this._buffers.length*this._itemsPerBuffer;this._itemsPtr=0}static createVec2f64(e=kG){return new A8(16,Nit,e)}static createVec3f64(e=kG){return new A8(24,HGe,e)}static createVec4f64(e=kG){return new A8(32,Cze,e)}static createMat3f64(e=kG){return new A8(72,Zyt,e)}static createMat4f64(e=kG){return new A8(128,Qyt,e)}static createQuatf64(e=kG){return new A8(32,r0t,e)}get test(){return{size:this._buffers.length*this._itemsPerBuffer*this._itemByteSize}}};const kG=4*Q5.KILOBYTES;NG.createVec2f64();const tF=NG.createVec3f64();NG.createVec4f64(),NG.createMat3f64();const I8i=NG.createMat4f64();NG.createQuatf64();function _fe(t){return t?{origin:Bf(t.origin),vector:Bf(t.vector)}:{origin:hn(),vector:hn()}}function A8i(t,e,i=_fe()){return Xv(i.origin,t),Tc(i.vector,e,t),i}function P8i(t,e,i){return O8i(t,e,0,1,i)}function O8i(t,e,i,r,n){const{vector:s,origin:o}=t,a=Tc(tF.get(),e,o),l=Qb(s,a)/mne(s);return Uh(n,s,eu(l,i,r)),Wc(n,n,t.origin)}new LG(()=>_fe());var $G;(function(t){t[t.X=0]="X",t[t.Y=1]="Y",t[t.Z=2]="Z"})($G||($G={}));function O4e(t){return t?E1t(Bf(t.origin),Bf(t.direction)):E1t(hn(),hn())}function E1t(t,e){return{origin:t,direction:e}}function I1t(t,e){const i=M8i.get();return i.origin=t,i.direction=e,i}function R8i(t,e,i){const r=Qb(t.direction,Tc(i,e,t.origin));return Wc(i,t.origin,Uh(i,t.direction,r)),i}const M8i=new LG(()=>O4e());function D8i(t,e){const i=Qb(t,e)/(Yv(t)*Yv(e));return-Z1e(i)}function tx(){return gA()}function BG(t,e=tx()){return q1e(e,t)}function F8i(t,e){return iv(t[0],t[1],t[2],e)}function L8i(t){return t}function N8i(t){t[0]=t[1]=t[2]=t[3]=0}function k8i(t,e){return t[0]=t[1]=t[2]=0,t[3]=e,t}function l6(t){return t[3]}function $8i(t){return t}function B8i(t,e,i,r){return iv(t,e,i,r)}function V8i(t,e,i){return t!==i&&Xv(i,t),i[3]=t[3]+e,i}function j8i(t,e,i){return Oi.getLogger("esri.geometry.support.sphere").error("sphere.setExtent is not yet supported"),t===i?i:BG(t,i)}function bfe(t,e,i){if(lt(e))return!1;const{origin:r,direction:n}=e,s=G8i;s[0]=r[0]-t[0],s[1]=r[1]-t[1],s[2]=r[2]-t[2];const o=n[0]*n[0]+n[1]*n[1]+n[2]*n[2];if(o===0)return!1;const a=2*(n[0]*s[0]+n[1]*s[1]+n[2]*s[2]),l=a*a-4*o*(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]-t[3]*t[3]);if(l<0)return!1;const c=Math.sqrt(l);let h=(-a-c)/(2*o);const p=(-a+c)/(2*o);return(h<0||p0)&&(h=p),!(h<0)&&(i&&(i[0]=r[0]+n[0]*h,i[1]=r[1]+n[1]*h,i[2]=r[2]+n[2]*h),!0)}const G8i=hn();function R4e(t,e){return bfe(t,e,null)}function U8i(t,e,i){if(bfe(t,e,i))return i;const r=A1t(t,e,tF.get());return Wc(i,e.origin,Uh(tF.get(),e.direction,rR(e.origin,r)/Yv(e.direction))),i}function A1t(t,e,i){const r=tF.get(),n=I8i.get();e2(r,e.origin,e.direction);const s=l6(t);e2(i,r,e.origin),Uh(i,i,1/Yv(i)*s);const o=O1t(t,e.origin),a=D8i(e.origin,i);return a2e(n,a+o,r),t2(i,i,n),i}function z8i(t,e,i){return bfe(t,e,i)?i:(R8i(e,t,i),P1t(t,i,i))}function P1t(t,e,i){const r=Tc(tF.get(),e,t),n=Uh(tF.get(),r,t[3]/Yv(r));return Wc(i,n,t)}function H8i(t,e){const i=Tc(tF.get(),e,t),r=mne(i),n=t[3]*t[3];return Math.sqrt(Math.abs(r-n))}function O1t(t,e){const i=Tc(tF.get(),e,t),r=Yv(i),n=l6(t),s=n+Math.abs(n-r);return Z1e(n/s)}const M4e=hn();function R1t(t,e,i,r){const n=Tc(M4e,e,t);switch(i){case $G.X:{const s=fUe(n,M4e)[2];return Rl(r,-Math.sin(s),Math.cos(s),0)}case $G.Y:{const s=fUe(n,M4e),o=s[1],a=s[2],l=Math.sin(o);return Rl(r,-l*Math.cos(a),-l*Math.sin(a),Math.cos(o))}case $G.Z:return Hy(r,n);default:return}}function M1t(t,e){const i=Tc(F4e,e,t);return Yv(i)-t[3]}function W8i(t,e,i,r){const n=M1t(t,e),s=R1t(t,e,$G.Z,F4e),o=Uh(F4e,s,i-n);return Wc(r,e,o)}function D4e(t,e){const i=H8(t,e),r=l6(t);return i<=r*r}const F4e=hn(),q8i=tx();Object.freeze(Object.defineProperty({__proto__:null,altitudeAt:M1t,angleToSilhouette:O1t,axisAt:R1t,clear:N8i,closestPoint:z8i,closestPointOnSilhouette:A1t,containsPoint:D4e,copy:BG,create:tx,distanceToSilhouette:H8i,elevate:V8i,fromCenterAndRadius:F8i,fromRadius:k8i,fromValues:B8i,getCenter:$8i,getRadius:l6,intersectRay:bfe,intersectRayClosestSilhouette:U8i,intersectsRay:R4e,projectPoint:P1t,setAltitudeAt:W8i,setExtent:j8i,tmpSphere:q8i,wrap:L8i},Symbol.toStringTag,{value:"Module"}));function D1t(t){return t?{ray:O4e(t.ray),c0:t.c0,c1:t.c1}:{ray:O4e(),c0:0,c1:Number.MAX_VALUE}}new LG(()=>D1t());var XJ;(function(t){t[t.NONE=0]="NONE",t[t.CLAMP=1]="CLAMP",t[t.INFINITE_MIN=4]="INFINITE_MIN",t[t.INFINITE_MAX=8]="INFINITE_MAX"})(XJ||(XJ={})),XJ.INFINITE_MIN|XJ.INFINITE_MAX,XJ.INFINITE_MAX;function wfe(t,e){for(let i=0;i=e[3])return!1}return!0}var F1t,od;(function(t){t[t.LEFT=0]="LEFT",t[t.RIGHT=1]="RIGHT",t[t.BOTTOM=2]="BOTTOM",t[t.TOP=3]="TOP",t[t.NEAR=4]="NEAR",t[t.FAR=5]="FAR"})(F1t||(F1t={})),function(t){t[t.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",t[t.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",t[t.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",t[t.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",t[t.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",t[t.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",t[t.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",t[t.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(od||(od={})),od.FAR_BOTTOM_RIGHT,od.NEAR_BOTTOM_RIGHT,od.NEAR_BOTTOM_LEFT,od.FAR_BOTTOM_LEFT,od.NEAR_BOTTOM_LEFT,od.NEAR_BOTTOM_RIGHT,od.NEAR_TOP_RIGHT,od.NEAR_TOP_LEFT,od.FAR_BOTTOM_RIGHT,od.FAR_BOTTOM_LEFT,od.FAR_TOP_LEFT,od.FAR_TOP_RIGHT,od.NEAR_BOTTOM_RIGHT,od.FAR_BOTTOM_RIGHT,od.FAR_TOP_RIGHT,od.NEAR_TOP_RIGHT,od.FAR_BOTTOM_LEFT,od.NEAR_BOTTOM_LEFT,od.NEAR_TOP_LEFT,od.FAR_TOP_LEFT,od.FAR_TOP_LEFT,od.NEAR_TOP_LEFT,od.NEAR_TOP_RIGHT,od.FAR_TOP_RIGHT;var L4e,L1t;(function(t){t[t.NUM=6]="NUM"})(L4e||(L4e={})),function(t){t[t.NUM=8]="NUM"}(L1t||(L1t={})),new LG(D1t);let N4e=class CBe{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,i){this._objectToBoundingSphere=e,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new lm,this._objectCount=0,i&&(i.maximumObjectsPerNode!==void 0&&(this._maximumObjectsPerNode=i.maximumObjectsPerNode),i.maximumDepth!==void 0&&(this._maximumDepth=i.maximumDepth))}destroy(){this._degenerateObjects.clear(),lm.clearPool(),$4e[0]=null,u6.prune(),c6.prune()}add(e,i=e.length){this._objectCount+=i,this._grow(e,i);const r=lm.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,i,r,n){const s=I1t(e,i);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,i=>{const r=i.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,i,r,n=()=>!0,s=1/0){let o=1/0,a=1/0,l=null;const c=k4e(e,i),h=p=>{if(--s,!n(p))return;const y=this._objectToBoundingSphere(p);if(!wfe(r,y))return;const v=iF(e,i,y),x=v-y[3],I=v+y[3];x{if(s<=0||!wfe(r,p.bounds)||(Uh(ix,c,p.halfSize),Wc(ix,ix,p.bounds),iF(e,i,ix)>a))return!1;const y=p.node;return y.terminals.forAll(v=>h(v)),y.residents!==null&&y.residents.forAll(v=>h(v)),!0},e,i),l}forEachInDepthRange(e,i,r,n,s,o,a){let l=-1/0,c=1/0;const h={setRange:I=>{r===CBe.DepthOrder.FRONT_TO_BACK?(l=Math.max(l,I.near),c=Math.min(c,I.far)):(l=Math.max(l,-I.far),c=Math.min(c,-I.near))}};h.setRange(n);const p=iF(i,r,e),y=k4e(i,r),v=k4e(i,-r),x=I=>{if(!a(I))return;const P=this._objectToBoundingSphere(I),F=P,k=iF(i,r,F)-p,j=k-P[3],V=k+P[3];j>c||V{if(!wfe(o,I.bounds)||(Uh(ix,y,I.halfSize),Wc(ix,ix,I.bounds),iF(i,r,ix)-p>c)||(Uh(ix,v,I.halfSize),Wc(ix,ix,I.bounds),iF(i,r,ix)-px(F)),P.residents!==null&&P.residents.forAll(F=>x(F)),!0},i,r)}forEachNode(e){this._forEachNode(this._root,i=>e(i.node,i.bounds,i.halfSize))}forEachNeighbor(e,i){const r=l6(i),n=i,s=l=>{const c=this._objectToBoundingSphere(l),h=l6(c),p=r+h;return!(H8(c,n)-p*p<=0)||e(l)};let o=!0;const a=l=>{o&&(o=s(l))};this._forEachNode(this._root,l=>{const c=l6(l.bounds),h=r+c;if(H8(l.bounds,n)-h*h>0)return!1;const p=l.node;return p.terminals.forAll(a),o&&p.residents!==null&&p.residents.forAll(a),o}),o&&this.forEachDegenerateObject(a)}_intersectsNode(e,i){return xfe(i.bounds,2*-i.halfSize,_b),xfe(i.bounds,2*i.halfSize,bb),ont(e.origin,e.direction,_b,bb)}_intersectsNodeWithOffset(e,i,r){return xfe(i.bounds,2*-i.halfSize,_b),xfe(i.bounds,2*i.halfSize,bb),r.applyToMinMax(_b,bb),ont(e.origin,e.direction,_b,bb)}_intersectsObject(e,i){const r=this._objectToBoundingSphere(i);return!(r[3]>0)||R4e(r,e)}_intersectsObjectWithOffset(e,i,r){const n=this._objectToBoundingSphere(i);return!(n[3]>0)||R4e(r.applyToBoundingSphere(n),e)}_forEachNode(e,i){let r=lm.acquire().init(e);const n=[r];for(;n.length!==0;){if(r=n.pop(),i(r)&&!r.isLeaf())for(let s=0;s=0;--a){const l=V1t[a];s.node.children[l]&&o.push(lm.acquire().init(s).advance(l))}lm.release(s)}}_remove(e,i,r){u6.clear();const n=r.advanceTo(i,(s,o)=>{u6.push(s.node),u6.push(o)})?r.node.terminals:r.node.residents;if(n.removeUnordered(e),n.length===0)for(let s=u6.length-2;s>=0;s-=2){const o=u6.data[s],a=u6.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 i=0;i=0&&(e.children[i]=null),!!this._nodeIsEmpty(e)&&(e.residents===null&&(e.residents=new Em({shrink:!0})),!0)}_add(e,i){i.advanceTo(this._objectToBoundingSphere(e))?i.node.terminals.push(e):(i.node.residents.push(e),i.node.residents.length>this._maximumObjectsPerNode&&i.depththis._objectToBoundingSphere(r),oO),KJ(oO[3])&&!this._fitsInsideTree(oO)))if(this._nodeIsEmpty(this._root.node))BG(oO,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const r=this._rootBoundsForRootAsSubNode(oO);this._placingRootViolatesMaxDepth(r)?this._rebuildTree(oO,r):this._growRootAsSubNode(r),lm.release(r)}}_rebuildTree(e,i){Xv(V4e,i.bounds),V4e[3]=i.halfSize,N1t([e,V4e],2,n=>n,j4e);const r=lm.acquire().init(this._root);this._root.initFrom(null,j4e,j4e[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)),lm.release(r)}_placingRootViolatesMaxDepth(e){const i=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+i<=this._maximumDepth)),r+i>this._maximumDepth}_rootBoundsForRootAsSubNode(e){const i=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 c=s[l]-o-(r[l]-i),h=r[l]+i-(s[l]+o),p=Math.max(0,Math.ceil(c/(2*o))),y=Math.max(0,Math.ceil(h/(2*o)))+1,v=2**Math.ceil(Math.log(p+y)*Math.LOG2E);n=Math.max(n,v),Sfe[l].min=p,Sfe[l].max=y}for(let l=0;l<3;l++){let c=Sfe[l].min,h=Sfe[l].max;const p=(n-(c+h))/2;c+=Math.ceil(p),h+=Math.floor(p);const y=s[l]-o-c*o*2;B4e[l]=y+(h+c)*o}const a=n*o;return B4e[3]=a*B1t,lm.acquire().initFrom(null,B4e,a,0)}_growRootAsSubNode(e){const i=this._root.node;Xv(oO,this._root.bounds),oO[3]=this._root.halfSize,this._root.init(e),e.advanceTo(oO,null,!0),e.node.children=i.children,e.node.residents=i.residents,e.node.terminals=i.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 i=this._root.node.children;let r=0,n=0;for(;n=i[0]-r&&e[0]<=i[0]+r&&e[1]>=i[1]-r&&e[1]<=i[1]+r&&e[2]>=i[2]-r&&e[2]<=i[2]+r}},lm=class uH{constructor(){this.bounds=tx(),this.halfSize=0,this.initFrom(null,null,0,0)}init(e){return this.initFrom(e.node,e.bounds,e.halfSize,e.depth)}initFrom(e,i,r,n=this.depth){return this.node=ve(e)?e:uH.createEmptyNode(),ve(i)&&BG(i,this.bounds),this.halfSize=r,this.depth=n,this}increaseHalfSize(e){this.halfSize*=e,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*B1t}advance(e){let i=this.node.children[e];i||(i=uH.createEmptyNode(),this.node.children[e]=i),this.node=i,this.halfSize/=2,this.depth++;const r=k1t[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,i,r=!1){for(;;){if(this.isTerminalFor(e))return i&&i(this,-1),!0;if(this.isLeaf()){if(!r)return i&&i(this,-1),!1;this.node.residents=null}const n=this._childIndex(e);i&&i(this,n),this.advance(n)}}isLeaf(){return this.node.residents!=null}isTerminalFor(e){return e[3]>this.halfSize/2}_childIndex(e){const i=this.bounds;return(i[0]r.distance-n.distance);for(let r=0;r<8;++r)i[r]=c6.data[r].index}function k4e(t,e){let i,r=1/0;for(let n=0;n<8;++n){const s=iF(t,e,$1t[n]);s0}lm._pool=new yC(lm),function(t){var e;(e=t.DepthOrder||(t.DepthOrder={}))[e.FRONT_TO_BACK=1]="FRONT_TO_BACK",e[e.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(N4e||(N4e={}));const k1t=[ja(-1,-1,-1),ja(1,-1,-1),ja(-1,1,-1),ja(1,1,-1),ja(-1,-1,1),ja(1,-1,1),ja(-1,1,1),ja(1,1,1)],$1t=[ja(-1,-1,-1),ja(-1,-1,1),ja(-1,1,-1),ja(-1,1,1),ja(1,-1,-1),ja(1,-1,1),ja(1,1,-1),ja(1,1,1)],B1t=Math.sqrt(3),$4e=[null];function J8i(t){return $4e[0]=t,$4e}const B4e=tx(),ix=hn(),_b=hn(),bb=hn(),u6=new Em,Z8i=tx(),oO=tx(),V4e=tx(),j4e=tx(),Sfe=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],c6=new Em,V1t=[0,0,0,0,0,0,0,0],j1t=N4e,Q8i=1e3;function e9i(t,e,i){const r=tx(),n=r;return W1e(n,n,t,.5),W1e(n,n,e,.5),r[3]=rR(n,t),Wc(n,n,i),r}let G4e=class{constructor(){this._idToComponent=new Map,this._components=new j1t(e=>e.bounds),this._edges=new j1t(e=>e.bounds),this._tmpLineSegment=_fe(),this._tmpP1=hn(),this._tmpP2=hn(),this._tmpP3=hn(),this.remoteClient=null}async fetchCandidates(e,i){await Promise.resolve(),yn(i),await this._ensureEdgeLocations(e,i);const r=[];return this._edges.forEachNeighbor(n=>(this._addCandidates(e,n,r),r.length{if(lt(o.info)){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,zu(i,{}));for(const o of s.components)this._setFetchEdgeLocations(o)}async add(e){const i=new G1t(e.id,e.bounds);return this._idToComponent.set(i.id,i),this._components.add([i]),{result:{}}}async remove(e){const i=this._idToComponent.get(e.id);if(i){const r=[];this._edges.forEachNeighbor(n=>(n.component===i&&r.push(n),!0),i.bounds),this._edges.remove(r),this._components.remove([i]),this._idToComponent.delete(i.id)}return{result:{}}}_setFetchEdgeLocations(e){const i=this._idToComponent.get(e.id);if(lt(i)||e.uid!==i.uid)return;const r=Xyt.createView(e.locations),n=new Array(r.count),s=hn(),o=hn();for(let c=0;cPromise.resolve().then(()=>LTr).then(e=>e.i).then(({default:e})=>{const i=e({locateFile:s9i,onRuntimeInitialized:()=>t(i)});delete i.then})).catch(t=>{throw t})),U4e}function s9i(t){return Ql(`esri/libs/i3s/${t}`)}let U4e;var z1t,VG,H1t,W1t,q1t;(function(t){t[t.Unmodified=0]="Unmodified",t[t.Culled=1]="Culled",t[t.NotChecked=2]="NotChecked"})(z1t||(z1t={})),function(t){t[t.Unmodified=0]="Unmodified",t[t.PotentiallyModified=1]="PotentiallyModified",t[t.Culled=2]="Culled",t[t.Unknown=3]="Unknown",t[t.NotChecked=4]="NotChecked"}(VG||(VG={})),function(t){t[t.Unknown=0]="Unknown",t[t.Uncached=1]="Uncached",t[t.Cached=2]="Cached"}(H1t||(H1t={})),function(t){t[t.None=0]="None",t[t.MaxScreenThreshold=1]="MaxScreenThreshold",t[t.ScreenSpaceRelative=2]="ScreenSpaceRelative",t[t.RemovedFeatureDiameter=3]="RemovedFeatureDiameter",t[t.DistanceRangeFromDefaultCamera=4]="DistanceRangeFromDefaultCamera"}(W1t||(W1t={})),function(t){t[t.Hole=0]="Hole",t[t.Leaf=1]="Leaf"}(q1t||(q1t={}));async function o9i(t){await GG();const e=[t.geometryBuffer];return{result:X1t(t,e),transferList:e}}async function a9i(t){await GG();const e=[t.geometryBuffer],{geometryBuffer:i}=t,r=i.byteLength,n=Rd._malloc(r),s=new Uint8Array(Rd.HEAPU8.buffer,n,r);s.set(new Uint8Array(i));const o=Rd.dracoDecompressPointCloudData(n,s.byteLength);if(Rd._free(n),o.error.length>0)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 l9i(t){await GG(),K1t(t);const e={buffer:t.buffer};return{result:e,transferList:[e.buffer]}}async function u9i(t){await GG(),Y1t(t)}async function c9i(t){await GG(),Rd.setLegacySchema(t.context,t.jsonSchema)}function h9i(t){J1t(t)}let Tfe,Rd;function Y1t(t){const e=t.modifications,i=Rd._malloc(8*e.length),r=new Float64Array(Rd.HEAPU8.buffer,i,e.length);for(let n=0;nPe.some(ke=>ke.name==="color")),normal:t.needNormals&&t.layouts.some(Pe=>Pe.some(ke=>ke.name==="normalCompressed")),uv0:t.layouts.some(Pe=>Pe.some(ke=>ke.name==="uv0")),uvRegion:t.layouts.some(Pe=>Pe.some(ke=>ke.name==="uvRegion")),featureIndex:j.featureIndex},Y=Rd.process(i,!!t.obb,y,I.byteLength,j,V,x,a,h,p,t.normalReferenceFrame);if(Rd._free(x),Rd._free(y),Y.error.length>0)throw new Error(`i3s.wasm: ${Y.error}`);if(Y.discarded)return null;const X=Y.componentOffsets.length>0?Y.componentOffsets.slice():null,Z=Y.featureIds.length>0?Y.featureIds.slice():null,ie=Y.interleavedVertedData.slice().buffer,ce=Y.indicesType===Cfe.Int16?new Uint16Array(Y.indices.buffer,Y.indices.byteOffset,Y.indices.byteLength/2).slice():new Uint32Array(Y.indices.buffer,Y.indices.byteOffset,Y.indices.byteLength/4).slice(),he=Y.positions.slice(),_e=Y.positionIndicesType===Cfe.Int16?new Uint16Array(Y.positionIndices.buffer,Y.positionIndices.byteOffset,Y.positionIndices.byteLength/2).slice():new Uint32Array(Y.positionIndices.buffer,Y.positionIndices.byteOffset,Y.positionIndices.byteLength/4).slice(),xe={layout:t.layouts[0],interleavedVertexData:ie,indices:ce,hasColors:Y.hasColors,hasModifications:Y.hasModifications,positionData:{data:he,indices:_e}};return Z&&e.push(Z.buffer),X&&e.push(X.buffer),e.push(ie),e.push(ce.buffer),e.push(he.buffer),e.push(_e.buffer),{componentOffsets:X,featureIds:Z,transformedGeometry:xe,obb:Y.obb}}function d9i(t){return t===0?VG.Unmodified:t===1?VG.PotentiallyModified:t===2?VG.Culled:VG.Unknown}function K1t(t){const{context:e,buffer:i}=t,r=Rd._malloc(i.byteLength),n=i.byteLength/Float64Array.BYTES_PER_ELEMENT,s=new Float64Array(Rd.HEAPU8.buffer,r,n),o=new Float64Array(i);s.set(o),Rd.filterOBBs(e,r,n),o.set(s),Rd._free(r)}function J1t(t){Rd&&Rd.destroy(t)}function jG(t,e){for(let i=0;i{Rd=t,Tfe=null})),Tfe)}const p9i=Object.freeze(Object.defineProperty({__proto__:null,destroyContext:h9i,dracoDecompressPointCloudData:a9i,filterObbsForModifications:l9i,filterObbsForModificationsSync:K1t,initialize:GG,interpretObbModificationResults:d9i,process:o9i,setLegacySchema:c9i,setModifications:u9i,setModificationsSync:Y1t,test:{transform:X1t,destroy:J1t}},Symbol.toStringTag,{value:"Module"}));function f9i(t){return g9i(t)??m9i(t)}function m9i(t){const e=new Date(t).getTime();return Number.isNaN(e)?null:e}function g9i(t){const e=y9i.exec(t);if(!e?.groups)return null;const i=e.groups,r=+i.year,n=+i.month-1,s=+i.day,o=+(i.hours??"0"),a=+(i.minutes??"0"),l=+(i.seconds??"0");if(o>23||a>59||l>59)return null;const c=i.ms??"0",h=c?+c.padEnd(3,"0").substring(0,3):0;let p;if(i.isUTC)p=Date.UTC(r,n,s,o,a,l,h);else if(i.offsetSign){const y=+i.offsetHours,v=+i.offsetMinutes;p=6e4*(i.offsetSign==="+"?-1:1)*(60*y+v)+Date.UTC(r,n,s,o,a,l,h)}else p=new Date(r,n,s,o,a,l,h).getTime();return Number.isNaN(p)?null:p}const y9i=/^(?:(?-?\d{4,})-(?\d{2})-(?\d{2}))(?:T(?\d{2}):(?\d{2}):(?\d{2})(?:\.(?\d+))?)?(?:(?Z)|(?:(?\+|-)(?\d{2}):(?\d{2})))?$/;function rF(t,e){if(t&&e){for(const i of t.children)if(i.localName in e){const r=e[i.localName];if(typeof r=="function"){const n=r(i);n&&rF(i,n)}else rF(i,r)}}}function*JJ(t,e){for(const i of t.children)if(i.localName in e){const r=e[i.localName];typeof r=="function"?yield r(i):yield*JJ(i,r)}}const z4e="xlink:href",ZJ="2.0.0",H4e="__esri_wfs_id__",v9i="wfs-layer:getWFSLayerTypeInfo-error",_9i="wfs-layer:empty-service",Z1t="wfs-layer:feature-type-not-found",b9i="wfs-layer:geojson-not-supported",w9i="wfs-layer:kvp-encoding-not-supported",x9i="wfs-layer:malformed-json",Q1t="wfs-layer:unknown-geometry-type",S9i="wfs-layer:unknown-field-type",C9i="wfs-layer:unsupported-spatial-reference",T9i="wfs-layer:unsupported-wfs-version";async function E9i(t,e){const i=I9i((await ur(t,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:ZJ,...e?.customParameters},signal:e?.signal})).data);return O9i(t,i),i}function I9i(t){const e=nbt(t);j9i(e),sbt(e);const i=e.firstElementChild,r=LNt(R9i(i));return{operations:P9i(i),get featureTypes(){return Array.from(r())},readFeatureTypes:r}}const A9i=new Set(["json","application/json","geojson","application/json; subtype=geojson"]);function P9i(t){let e=!1;const i={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}};if(rF(t,{OperationsMetadata:{Operation:r=>{switch(r.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:n=>{i.GetCapabilities.url=n.getAttribute(z4e)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:n=>{i.DescribeFeatureType.url=n.getAttribute(z4e)}}}};case"GetFeature":return{DCP:{HTTP:{Get:n=>{i.GetFeature.url=n.getAttribute(z4e)}}},Parameter:n=>{if(n.getAttribute("name")==="outputFormat")return{AllowedValues:{Value:s=>{const o=s.textContent;o&&A9i.has(o.toLowerCase())&&(i.GetFeature.outputFormat=o)}}}}}}},Constraint:r=>{switch(r.getAttribute("name")){case"KVPEncoding":return{DefaultValue:n=>{e=n.textContent.toLowerCase()==="true"}};case"ImplementsResultPaging":return{DefaultValue:n=>{i.GetFeature.supportsPagination=n.textContent.toLowerCase()==="true"}}}}}}),!e)throw new st(w9i,"WFS service doesn't support key/value pair (KVP) encoding");if(lt(i.GetFeature.outputFormat))throw new st(b9i,"WFS service doesn't support GeoJSON output format");return i}function O9i(t,e){zje(t)&&(jy(t,e.operations.DescribeFeatureType.url,!0)&&(e.operations.DescribeFeatureType.url=VH(e.operations.DescribeFeatureType.url)),jy(t,e.operations.GetFeature.url,!0)&&(e.operations.GetFeature.url=VH(e.operations.GetFeature.url)))}function R9i(t){return JJ(t,{FeatureTypeList:{FeatureType:e=>{const i={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",supportedSpatialReferences:[]},r=new Set([4326]),n=s=>{const o=parseInt(s.textContent?.match(/(?\d+$)/i)?.groups?.wkid??"",10);Number.isNaN(o)||r.add(o)};return rF(e,{Name:s=>{const{name:o,prefix:a}=QJ(s.textContent);i.typeName=`${a}:${o}`,i.name=o,i.namespacePrefix=a,i.namespaceUri=s.lookupNamespaceURI(a)},Abstract:s=>{i.description=s.textContent},Title:s=>{i.title=s.textContent},WGS84BoundingBox:s=>{i.extent=M9i(s)},DefaultSRS:n,DefaultCRS:n,OtherSRS:n,OtherCRS:n}),i.title||(i.title=i.name),i.supportedSpatialReferences.push(...r),i}}})}function M9i(t){let e,i,r,n;for(const s of t.children)switch(s.localName){case"LowerCorner":[e,i]=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:i,xmax:r,ymax:n,spatialReference:$f}}function ebt(t,e,i){return _re(t,r=>i?r.name===e&&r.namespaceUri===i:r.typeName===e||r.name===e)}async function D9i(t,e,i,r={}){const{featureType:n,extent:s}=await F9i(t,e,i,r),{fields:o,geometryType:a,swapXY:l,objectIdField:c,geometryField:h}=await L9i(t,n.typeName,r);return{url:t.operations.GetCapabilities.url,name:n.name,namespaceUri:n.namespaceUri,fields:o,geometryField:h,geometryType:a,objectIdField:c,spatialReference:r.spatialReference??hr.WGS84,extent:s,swapXY:l,wfsCapabilities:t,customParameters:r.customParameters}}async function F9i(t,e,i,r={}){const{spatialReference:n=hr.WGS84}=r,s=t.readFeatureTypes(),o=e?ebt(s,e,i):s.next().value;if(lt(o))throw e?new st(Z1t,`The type '${e}' could not be found in the service`):new st(_9i,"The service is empty");let a=new Ar({...o.extent,spatialReference:n});if(!Da(n,$f))try{await YR($f,n,void 0,r),a=cp(a,$f)}catch{throw new st(C9i,"Projection not supported")}return{extent:a,spatialReference:n,featureType:o}}async function L9i(t,e,i={}){const[r,n]=await Ru([k9i(t.operations.DescribeFeatureType.url,e,i),N9i(t,e,i)]);if(r.error||n.error)throw new st(v9i,`An error occurred while getting info about the feature type '${e}'`,{error:r.error||n.error});const{fields:s,errors:o}=r.value??{},a=r.value?.geometryType||n.value?.geometryType,l=n.value?.swapXY??!1;if(lt(a))throw new st(Q1t,`The geometry type could not be determined for type '${e}`,{typeName:e,geometryType:a,fields:s,errors:o});return{...tbt(s??[]),geometryType:a,swapXY:l}}function tbt(t){const e=t.find(r=>r.type==="geometry");let i=t.find(r=>r.type==="oid");return t=t.filter(r=>r.type!=="geometry"),i||(i=new Jo({name:H4e,type:"oid",alias:H4e}),t.unshift(i)),{geometryField:e?.name??null,objectIdField:i.name,fields:t}}async function N9i(t,e,i={}){let r,n=!1;const[s,o]=await Promise.all([ibt(t.operations.GetFeature.url,e,t.operations.GetFeature.outputFormat,{...i,count:1}),ur(t.operations.GetFeature.url,{responseType:"text",query:rbt(e,void 0,{...i,count:1}),signal:i?.signal})]),a=s.type==="FeatureCollection"&&s.features[0]?.geometry;if(a){let l;switch(r=Yy.fromJSON(Rpe(a.type)),a.type){case"Point":l=a.coordinates;break;case"LineString":case"MultiPoint":l=a.coordinates[0];break;case"MultiLineString":case"Polygon":l=a.coordinates[0][0];break;case"MultiPolygon":l=a.coordinates[0][0][0]}const c=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(o.data);if(c){const h=l[0].toFixed(3),p=l[1].toFixed(3),y=parseFloat(c[1]).toFixed(3);h===parseFloat(c[2]).toFixed(3)&&p===y&&(n=!0)}}return{geometryType:r,swapXY:n}}async function k9i(t,e,i){return $9i(e,(await ur(t,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:ZJ,TYPENAME:e,...i?.customParameters},signal:i?.signal})).data)}function $9i(t,e){const{name:i}=QJ(t),r=nbt(e);sbt(r);const n=_re(JJ(r.firstElementChild,{element:s=>({name:s.getAttribute("name"),typeName:QJ(s.getAttribute("type")).name})}),({name:s})=>s===i);if(ve(n)){const s=_re(JJ(r.firstElementChild,{complexType:o=>o}),o=>o.getAttribute("name")===n.typeName);if(ve(s))return V9i(s)}throw new st(Z1t,`Type '${t}' not found in document`,{document:new XMLSerializer().serializeToString(r)})}const B9i=new Set(["objectid","fid"]);function V9i(t){const e=[],i=[];let r;const n=JJ(t,{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=QJ(s.getAttribute("type")).name:rF(s,{simpleType:{restriction:p=>(a=QJ(p.getAttribute("base")).name,{maxLength:y=>{l=+y.getAttribute("value")}})}}),!a)continue;const c=s.getAttribute("nillable")==="true";let h=!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":i.push(new Jo({name:o,alias:o,type:"integer",nullable:c}));break;case"float":case"double":case"decimal":i.push(new Jo({name:o,alias:o,type:"double",nullable:c}));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":i.push(new Jo({name:o,alias:o,type:"string",nullable:c,length:l??255}));break;case"datetime":case"date":i.push(new Jo({name:o,alias:o,type:"date",nullable:c,length:l??36}));break;case"pointpropertytype":r="point",h=!0;break;case"multipointpropertytype":r="multipoint",h=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":r="polyline",h=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":r="polygon",h=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":h=!0,e.push(new st(Q1t,`geometry type '${a}' is not supported`,{type:new XMLSerializer().serializeToString(t)}));break;default:e.push(new st(S9i,`Unknown field type '${a}'`,{type:new XMLSerializer().serializeToString(t)}))}h&&i.push(new Jo({name:o,alias:o,type:"geometry",nullable:c}))}for(const s of i)if(s.type==="integer"&&!s.nullable&&B9i.has(s.name.toLowerCase())){s.type="oid";break}return{geometryType:r,fields:i,errors:e}}async function ibt(t,e,i,r){let{data:n}=await ur(t,{responseType:"text",query:rbt(e,i,r),signal:r?.signal});n=n.replace(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{if(r?.dateFields?.length){const s=new Set(r.dateFields);return JSON.parse(n,(o,a)=>s.has(o)?f9i(a):a)}return JSON.parse(n)}catch(s){throw new st(x9i,"Error while parsing the response",{response:n,error:s})}}function rbt(t,e,i){return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:ZJ,TYPENAMES:t,OUTPUTFORMAT:e,SRSNAME:"EPSG:4326",STARTINDEX:i?.startIndex,COUNT:i?.count,...i?.customParameters}}function nbt(t){return new DOMParser().parseFromString(t.trim(),"text/xml")}function QJ(t){const[e,i]=t.split(":");return{prefix:i?e:"",name:i??e}}function j9i(t){const e=t.firstElementChild?.getAttribute("version");if(e&&e!==ZJ)throw new st(T9i,`Unsupported WFS version ${e}. Supported version: ${ZJ}`)}function sbt(t){let e="",i="";if(rF(t.firstElementChild,{Exception:r=>(e=r.getAttribute("exceptionCode"),{ExceptionText:n=>{i=n.textContent}})}),e)throw new st(`wfs-layer:${e}`,i)}const G9i=Object.freeze(Object.defineProperty({__proto__:null,default:class{constructor(){this._queryEngine=null,this._customParameters=null,this._snapshotFeatures=async e=>{const{objectIdField:i}=this._queryEngine,r=await ibt(this._getFeatureUrl??"",this._featureType.typeName,this._getFeatureOutputFormat,{customParameters:this._customParameters,dateFields:this._queryEngine.fieldsIndex.dateFields.map(o=>o.name),signal:e});await YDe(r),yn(e);const n=XDe(r,{geometryType:this._queryEngine.geometryType,hasZ:!1,objectIdField:i});if(!Da(this._queryEngine.spatialReference,$f))for(const o of n)ve(o.geometry)&&(o.geometry=Y5(wp(pw(o.geometry,this._queryEngine.geometryType,!1,!1),$f,this._queryEngine.spatialReference)));let s=1;for(const o of n){const a={};zk(this._fieldsIndex,a,o.attributes,!0),o.attributes=a,o.attributes[i]==null&&(o.objectId=o.attributes[i]=s++)}return n}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,i){const{getFeatureUrl:r,getFeatureOutputFormat:n,spatialReference:s,fields:o,geometryType:a,featureType:l,objectIdField:c,customParameters:h}=e;this._featureType=l,this._customParameters=h,this._getFeatureUrl=r,this._getFeatureOutputFormat=n,this._fieldsIndex=new Lm(o),await this._checkProjection(s),yn(i),this._queryEngine=new Bk({fields:o,geometryType:a,hasM:!1,hasZ:!1,objectIdField:c,spatialReference:s,timeInfo:null,featureStore:new xJ({geometryType:a,hasM:!1,hasZ:!1})});const p=await this._snapshotFeatures(i.signal);return this._queryEngine.featureStore.addMany(p),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new st("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}async queryFeatures(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,i.signal)}async queryFeatureCount(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,i.signal)}async queryObjectIds(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,i.signal)}async queryExtent(e={},i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,i.signal)}async querySnapping(e,i={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,i.signal)}async refresh(e){return this._customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=CC(this._snapshotFeatures),this._snapshotTask.promise.then(i=>{this._queryEngine.featureStore.clear(),i&&this._queryEngine.featureStore.addMany(i)},i=>{this._queryEngine.featureStore.clear(),ys(i)||Oi.getLogger("esri.layers.WFSLayer").error(new st("wfs-layer:getfeature-error","An error occurred during the GetFeature request",{error:i}))}),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 _checkProjection(e){try{await hy($f,e)}catch{throw new st("unsupported-projection","Projection not supported",{spatialReference:e})}}}},Symbol.toStringTag,{value:"Module"}));var Tg,xp,Sf;(function(t){t[t.FILL=1]="FILL",t[t.LINE=2]="LINE",t[t.SYMBOL=3]="SYMBOL",t[t.CIRCLE=4]="CIRCLE"})(Tg||(Tg={})),function(t){t[t.BACKGROUND=0]="BACKGROUND",t[t.FILL=1]="FILL",t[t.OUTLINE=2]="OUTLINE",t[t.LINE=3]="LINE",t[t.ICON=4]="ICON",t[t.CIRCLE=5]="CIRCLE",t[t.TEXT=6]="TEXT",t[t.TILEINFO=7]="TILEINFO"}(xp||(xp={})),function(t){t[t.PAINTER_CHANGED=0]="PAINTER_CHANGED",t[t.LAYOUT_CHANGED=1]="LAYOUT_CHANGED",t[t.LAYER_CHANGED=2]="LAYER_CHANGED",t[t.LAYER_REMOVED=3]="LAYER_REMOVED",t[t.SPRITES_CHANGED=4]="SPRITES_CHANGED"}(Sf||(Sf={}));const U9i=512;var gy,Eg;(function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon"})(gy||(gy={}));let oa=class s_e{constructor(e,i){this.x=e,this.y=i}clone(){return new s_e(this.x,this.y)}equals(e,i){return e===this.x&&i===this.y}isEqual(e){return e.x===this.x&&e.y===this.y}setCoords(e,i){this.x=e,this.y=i}normalize(){const e=this.x,i=this.y,r=Math.sqrt(e*e+i*i);this.x/=r,this.y/=r}rightPerpendicular(){const e=this.x;this.x=this.y,this.y=-e}move(e,i){this.x+=e,this.y+=i}assign(e){this.x=e.x,this.y=e.y}assignAdd(e,i){this.x=e.x+i.x,this.y=e.y+i.y}assignSub(e,i){this.x=e.x-i.x,this.y=e.y-i.y}rotate(e,i){const r=this.x,n=this.y;this.x=r*e-n*i,this.y=r*i+n*e}scale(e){this.x*=e,this.y*=e}length(){const e=this.x,i=this.y;return Math.sqrt(e*e+i*i)}static distance(e,i){const r=i.x-e.x,n=i.y-e.y;return Math.sqrt(r*r+n*n)}static add(e,i){return new s_e(e.x+i.x,e.y+i.y)}static sub(e,i){return new s_e(e.x-i.x,e.y-i.y)}},Efe=class{constructor(e,i,r){this.ratio=e,this.x=i,this.y=r}},eZ=class{constructor(e,i,r,n=8,s=8){this._lines=[],this._starts=[],this.validateTessellation=!0,this._pixelRatio=n,this._pixelMargin=s,this._tileSize=U9i*n,this._dz=e,this._yPos=i,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;i>r&&(i=r),this._margin=i,this._xmin=r*this._xPos-i,this._ymin=r*this._yPos-i,this._xmax=this._xmin+r+2*i,this._ymax=this._ymin+r+2*i}reset(e){this._type=e,this._lines=[],this._starts=[],this._line=null,this._start=0}moveTo(e,i){this._pushLine(),this._prevIsIn=this._isIn(e,i),this._moveTo(e,i,this._prevIsIn),this._prevPt=new oa(e,i),this._firstPt=new oa(e,i),this._dist=0}lineTo(e,i){const r=this._isIn(e,i),n=new oa(e,i),s=oa.distance(this._prevPt,n);let o,a,l,c,h,p,y,v;if(r)this._prevIsIn?this._lineTo(e,i,!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 x=this._prevPt,I=n;if(x.x<=this._xmin&&I.x<=this._xmin||x.x>=this._xmax&&I.x>=this._xmax||x.y<=this._ymin&&I.y<=this._ymin||x.y>=this._ymax&&I.y>=this._ymax)this._lineTo(I.x,I.y,!1);else{const P=[];if((x.xthis._xmin||x.x>this._xmin&&I.x=this._ymax?p=!0:P.push(new Efe(c,this._xmin,v))),(x.xthis._xmax||x.x>this._xmax&&I.x=this._ymax?p=!0:P.push(new Efe(c,this._xmax,v))),(x.ythis._ymin||x.y>this._ymin&&I.y=this._xmax?h=!0:P.push(new Efe(c,y,this._ymin))),(x.ythis._ymax||x.y>this._ymax&&I.y=this._xmax?h=!0:P.push(new Efe(c,y,this._ymax))),P.length===0)h?p?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):p?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,!0);else if(P.length>1&&P[0].ratio>P[1].ratio)this._start=this._dist+s*P[1].ratio,this._lineTo(P[1].x,P[1].y,!0),this._lineTo(P[0].x,P[0].y,!0);else{this._start=this._dist+s*P[0].ratio;for(let F=0;F2){const e=this._firstPt,i=this._prevPt;e.x===i.x&&e.y===i.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===gy.Polygon&&e&&H9i.simplify(this._tileSize,this._margin*this._finalRatio,this._lines),this._lines)}resultWithStarts(){if(this._type!==gy.LineString)throw new Error("Only valid for lines");this._pushLine();const e=this._lines,i=e.length;if(i===0)return null;const r=[];for(let n=0;n=this._xmin&&e<=this._xmax&&i>=this._ymin&&i<=this._ymax}_intersect(e,i){let r,n,s;if(i.x>=this._xmin&&i.x<=this._xmax)n=i.y<=this._ymin?this._ymin:this._ymax,s=(n-e.y)/(i.y-e.y),r=e.x+s*(i.x-e.x);else if(i.y>=this._ymin&&i.y<=this._ymax)r=i.x<=this._xmin?this._xmin:this._xmax,s=(r-e.x)/(i.x-e.x),n=e.y+s*(i.y-e.y);else{n=i.y<=this._ymin?this._ymin:this._ymax,r=i.x<=this._xmin?this._xmin:this._xmax;const o=(r-e.x)/(i.x-e.x),a=(n-e.y)/(i.y-e.y);o0&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===gy.LineString?this._line.length>1&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===gy.Polygon&&this._line.length>3&&(this._lines.push(this._line),this._starts.push(this._start))),this._line=[],this._start=0}_moveTo(e,i,r){this._type!==gy.Polygon?r&&(e=Math.round((e-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new oa(e,i))):(r||(ethis._xmax&&(e=this._xmax),ithis._ymax&&(i=this._ymax)),e=Math.round((e-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new oa(e,i)),this._isH=!1,this._isV=!1)}_lineTo(e,i,r){let n,s;if(this._type!==gy.Polygon)if(r){if(e=Math.round((e-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.length>0&&(n=this._line[this._line.length-1],n.equals(e,i)))return;this._line.push(new oa(e,i))}else this._line&&this._line.length>0&&this._pushLine();else if(r||(ethis._xmax&&(e=this._xmax),ithis._ymax&&(i=this._ymax)),e=Math.round((e-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(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===i;if(o&&a)return;this._isH&&o||this._isV&&a?(n.x=e,n.y=i,s=this._line[this._line.length-2],s.x===e&&s.y===i?(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===i)):(this._isH=s.x===e,this._isV=s.y===i)):(this._line.push(new oa(e,i)),this._isH=o,this._isV=a)}else this._line.push(new oa(e,i))}},z9i=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,i){this._line&&this._lines.push(this._line),this._line=[];const r=this._ratio;this._line.push(new oa(e*r,i*r))}lineTo(e,i){const r=this._ratio;this._line.push(new oa(e*r,i*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(t){t[t.sideLeft=0]="sideLeft",t[t.sideRight=1]="sideRight",t[t.sideTop=2]="sideTop",t[t.sideBottom=3]="sideBottom"})(Eg||(Eg={}));let H9i=class rL{static simplify(e,i,r){if(!r)return;const n=-i,s=e+i,o=-i,a=e+i,l=[],c=[],h=r.length;for(let y=0;yx.y?(l.push(y),l.push(F),l.push(Eg.sideLeft),l.push(-1)):(c.push(y),c.push(F),c.push(Eg.sideLeft),c.push(-1))),I.x>=s&&(I.y=a&&(I.x>x.x?(l.push(y),l.push(F),l.push(Eg.sideBottom),l.push(-1)):(c.push(y),c.push(F),c.push(Eg.sideBottom),c.push(-1)))),I=x}if(l.length===0||c.length===0)return;rL.fillParent(r,c,l),rL.fillParent(r,l,c);const p=[];rL.calcDeltas(p,c,l),rL.calcDeltas(p,l,c),rL.addDeltas(p,r)}static fillParent(e,i,r){const n=r.length,s=i.length;for(let o=0;o1&&n[o-2]===s?0:(n.push(s),rL.calcDelta(s,r,i,n)+1)}static addDeltas(e,i){const r=e.length;let n=0;for(let s=0;sn&&(n=o)}for(let s=0;st>=e&&t<=i||t>=i&&t<=e,yE=Number.POSITIVE_INFINITY,nF=Math.PI,obt=2*nF,W9i=128/nF,W4e=nF/180,q9i=1/Math.LN2;function q4e(t,e){return(t%=e)>=0?t:t+e}function abt(t){return q4e(t*W9i,256)}function sF(t){return Math.log(t)*q9i}function Hm(t,e,i){return t*(1-i)+e*i}function Y9i(t){return t===746||t===747||!(t<4352)&&(t>=12704&&t<=12735||t>=12544&&t<=12591||t>=65072&&t<=65103&&!(t>=65097&&t<=65103)||t>=63744&&t<=64255||t>=13056&&t<=13311||t>=11904&&t<=12031||t>=12736&&t<=12783||t>=12288&&t<=12351&&!(t>=12296&&t<=12305||t>=12308&&t<=12319||t===12336)||t>=13312&&t<=19903||t>=19968&&t<=40959||t>=12800&&t<=13055||t>=12592&&t<=12687||t>=43360&&t<=43391||t>=55216&&t<=55295||t>=4352&&t<=4607||t>=44032&&t<=55215||t>=12352&&t<=12447||t>=12272&&t<=12287||t>=12688&&t<=12703||t>=12032&&t<=12255||t>=12784&&t<=12799||t>=12448&&t<=12543&&t!==12540||t>=65280&&t<=65519&&!(t===65288||t===65289||t===65293||t>=65306&&t<=65310||t===65339||t===65341||t===65343||t>=65371&&t<=65503||t===65507||t>=65512&&t<=65519)||t>=65104&&t<=65135&&!(t>=65112&&t<=65118||t>=65123&&t<=65126)||t>=5120&&t<=5759||t>=6320&&t<=6399||t>=65040&&t<=65055||t>=19904&&t<=19967||t>=40960&&t<=42127||t>=42128&&t<=42191)}function X9i(t){return!(t<11904)&&(t>=12704&&t<=12735||t>=12544&&t<=12591||t>=65072&&t<=65103||t>=63744&&t<=64255||t>=13056&&t<=13311||t>=11904&&t<=12031||t>=12736&&t<=12783||t>=12288&&t<=12351||t>=13312&&t<=19903||t>=19968&&t<=40959||t>=12800&&t<=13055||t>=65280&&t<=65519||t>=12352&&t<=12447||t>=12272&&t<=12287||t>=12032&&t<=12255||t>=12784&&t<=12799||t>=12448&&t<=12543||t>=65040&&t<=65055||t>=42128&&t<=42191||t>=40960&&t<=42127)}function K9i(t){switch(t){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 lbt(t){switch(t){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}let Md=class{constructor(e=0,i=0,r=0,n=0){this.x=e,this.y=i,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)}};const vE=24,ubt=17;let cbt=class{constructor(e,i,r,n,s,o,a){this._glyphItems=e,this._maxWidth=i,this._lineHeight=r,this._letterSpacing=n,this._hAnchor=s,this._vAnchor=o,this._justify=a}getShaping(e,i,r){const n=this._letterSpacing,s=this._lineHeight,o=this._justify,a=this._maxWidth,l=[];let c=0,h=0;const p=e.length;for(let j=0;j0&&(y=c/Math.max(1,Math.ceil(c/a)));const v=e.includes("​"),x=[];for(let j=0;jY&&lbt(l[X].codePoint);)l[X].glyphMosaicItem=null,--X;if(Y<=X){const Z=l[Y].x;for(let ce=Y;ce<=X;ce++)l[ce].x-=Z,l[ce].y=h;let ie=l[X].x;l[X].glyphMosaicItem&&(ie+=l[X].glyphMosaicItem.metrics.advance),P=Math.max(ie,P),o&&this._applyJustification(l,Y,X)}k=V,h+=F}if(l.length>0){const j=I.length-1,V=(o-this._hAnchor)*P;let Y=(-this._vAnchor*(j+1)+.5)*s;i&&j&&(Y+=j*s);for(const X of l)X.x+=V,X.y+=Y}return l.filter(j=>j.glyphMosaicItem)}static getTextBox(e,i){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,c=a.x,h=a.y-ubt,p=c+l,y=h+i;r=Math.min(r,c),s=Math.max(s,p),n=Math.min(n,h),o=Math.max(o,y)}return{x:r,y:n,width:s-r,height:o-n}}static getBox(e){if(!e.length)return null;let i=1/0,r=1/0,n=0,s=0;for(const o of e){const{height:a,left:l,top:c,width:h}=o.glyphMosaicItem.metrics,p=o.x,y=o.y-(a-Math.abs(c)),v=p+h+l,x=y+a;i=Math.min(i,p),n=Math.max(n,v),r=Math.min(r,y),s=Math.max(s,x)}return{x:i,y:r,width:n-i,height:s-r}}static addDecoration(e,i){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,v=n.allowOverlap&&n.ignorePlacement?null:[],x=[],I=4,P=!y;let F=Number.POSITIVE_INFINITY,k=Number.NEGATIVE_INFINITY,j=F,V=k;const Y=(y||a)&&l,X=n.size/vE;let Z=!1;for(const xe of i)if(xe.vertical){Z=!0;break}let ie,ce=0,he=0;if(!y&&Z){const xe=cbt.getTextBox(i,n.lineHeight*vE);switch(n.anchor){case ac.LEFT:ce=xe.height/2,he=-xe.width/2;break;case ac.RIGHT:ce=-xe.height/2,he=xe.width/2;break;case ac.TOP:ce=xe.height/2,he=xe.width/2;break;case ac.BOTTOM:ce=-xe.height/2,he=-xe.width/2;break;case ac.TOP_LEFT:ce=xe.height;break;case ac.BOTTOM_LEFT:he=-xe.width;break;case ac.TOP_RIGHT:he=xe.width;break;case ac.BOTTOM_RIGHT:ce=-xe.height}}ce+=n.offset[0]*vE,he+=n.offset[1]*vE;for(const xe of i){const Pe=xe.glyphMosaicItem;if(!Pe||Pe.rect.isEmpty)continue;const ke=Pe.rect,J=Pe.metrics,de=Pe.page;if(v&&P){if(ie!==void 0&&ie!==xe.y){let Et,Ft,ot,Te;Z?(Et=-V+ce,Ft=F+he,ot=V-j,Te=k-F):(Et=F+ce,Ft=j+he,ot=k-F,Te=V-j);const je={xTile:e.x,yTile:e.y,dxPixels:Et*X-c,dyPixels:Ft*X-c,hard:!n.optional,partIndex:1,width:ot*X+2*c,height:Te*X+2*c,angle:o,minLod:h6,maxLod:yE};v.push(je),F=Number.POSITIVE_INFINITY,k=Number.NEGATIVE_INFINITY,j=F,V=k}ie=xe.y}const Se=[];if(y){const Et=.5*Pe.metrics.width,Ft=(xe.x+J.left-I+Et)*X*iZ;if(h=this._placeGlyph(e,h,Ft,r,e.segment,1,xe.vertical,de,Se),l&&(h=this._placeGlyph(e,h,Ft,r,e.segment,-1,xe.vertical,de,Se)),h>=Y4e)break}else Se.push(new Ofe(s,p,p,de,!1)),a&&l&&Se.push(new Ofe(s,p+nF,p+nF,de,!1));const Ie=xe.x+J.left,Re=xe.y-ubt-J.top,Oe=Ie+J.width,Ge=Re+J.height;let Be,qe,et,Ze,mt,Pt,$t,Ct;if(!y&&Z)if(xe.vertical){const Et=(Ie+Oe)/2-J.height/2,Ft=(Re+Ge)/2+J.width/2;Be=new oa(-Ft-I+ce,Et-I+he),qe=new oa(Be.x+ke.width,Be.y+ke.height),et=new oa(Be.x,qe.y),Ze=new oa(qe.x,Be.y)}else Be=new oa(-Re+I+ce,Ie-I+he),qe=new oa(Be.x-ke.height,Be.y+ke.width),et=new oa(qe.x,Be.y),Ze=new oa(Be.x,qe.y);else Be=new oa(Ie-I+ce,Re-I+he),qe=new oa(Be.x+ke.width,Be.y+ke.height),et=new oa(Be.x,qe.y),Ze=new oa(qe.x,Be.y);for(const Et of Se){let Ft,ot,Te,je;if(Et.alternateVerticalGlyph){if(!mt){const wt=(Re+Ge)/2+he;mt=new oa((Ie+Oe)/2+ce-J.height/2-I,wt+J.width/2+I),Pt=new oa(mt.x+ke.height,mt.y-ke.width),$t=new oa(Pt.x,mt.y),Ct=new oa(mt.x,Pt.y)}Ft=mt,ot=$t,Te=Ct,je=Pt}else Ft=Be,ot=et,Te=Ze,je=qe;const pt=Re,kt=Ge,ct=Et.glyphAngle+o;if(ct!==0){const wt=Math.cos(ct),Ne=Math.sin(ct);Ft=Ft.clone(),ot=ot?.clone(),Te=Te?.clone(),je=je?.clone(),Ft.rotate(wt,Ne),je?.rotate(wt,Ne),ot?.rotate(wt,Ne),Te?.rotate(wt,Ne)}let ae=0,ht=256;if(y&&Z?xe.vertical?Et.alternateVerticalGlyph?(ae=32,ht=96):(ae=224,ht=32):(ae=224,ht=96):(ae=192,ht=64),x.push(new pbt(Ft,Te,ot,je,ke,Et.labelAngle,ae,ht,Et.anchor,Et.minzoom,Et.maxzoom,Et.page)),v&&(!Y||this._legible(Et.labelAngle))){if(P)Iek&&(k=Oe),kt>V&&(V=kt);else if(Et.minzoom=Y4e)return null;if(v&&P){let xe,Pe,ke,J;Z?(xe=-V+ce,Pe=F+he,ke=V-j,J=k-F):(xe=F+ce,Pe=j+he,ke=k-F,J=V-j);const de={xTile:e.x,yTile:e.y,dxPixels:xe*X-c,dyPixels:Pe*X-c,hard:!n.optional,partIndex:1,width:ke*X+2*c,height:J*X+2*c,angle:o,minLod:h6,maxLod:yE};v.push(de)}const _e=new fbt(x);return v&&v.length>0&&(_e.textColliders=v),_e}_legible(e){const i=abt(e);return i<65||i>=193}_placeGlyph(e,i,r,n,s,o,a,l,c){let h=o;const p=h<0?q4e(e.angle+nF,obt):e.angle;let y=0;r<0&&(h*=-1,r*=-1,y=nF),h>0&&++s;let v=new oa(e.x,e.y),x=n[s],I=yE;if(n.length<=s)return I;for(;;){const P=x.x-v.x,F=x.y-v.y,k=Math.sqrt(P*P+F*F),j=Math.max(r/k,i),V=P/k,Y=F/k,X=q4e(Math.atan2(Y,V)+y,obt);if(c.push(new Ofe(v,p,X,l,!1,j,I)),a&&c.push(new Ofe(v,p,X,l,!0,j,I)),j<=i)return j;v=x.clone();do{if(s+=h,n.length<=s||s<0)return j;x=n[s]}while(v.isEqual(x));let Z=x.x-v.x,ie=x.y-v.y;const ce=Math.sqrt(Z*Z+ie*ie);Z*=k/ce,ie*=k/ce,v.x-=Z,v.y-=ie,I=j}}};const eBi=128e3;let X4e=null,mbt=null;async function gbt(){return X4e||(X4e=tBi()),X4e}async function tBi(){mbt=await(Hi("esri-csp-restrictions")?await Promise.resolve().then(()=>BTr).then(e=>e.l):await Promise.resolve().then(()=>UTr).then(e=>e.l)).load({locateFile:e=>Ql(`esri/core/libs/libtess/${e}`)})}function ybt(t,e){const i=Math.max(t.length,eBi);return mbt.triangulate(t,e,i)}var HG;(function(t){t[t.moveTo=1]="moveTo",t[t.lineTo=2]="lineTo",t[t.close=7]="close"})(HG||(HG={}));let iBi=class{constructor(e,i){this.values={},this._geometry=void 0,this._pbfGeometry=null;const r=i.keys,n=i.values,s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:this.id=s.getUInt64();break;case 2:{const o=s.getMessage().asUnsafe(),a=this.values;for(;!o.empty();){const l=o.getUInt32(),c=o.getUInt32();a[r[l]]=n[c]}o.release();break}case 3:this.type=s.getUInt32();break;case 4:this._pbfGeometry=s.getMessage();break;default:s.skip()}}getGeometry(e){if(this._geometry!==void 0)return this._geometry;if(!this._pbfGeometry)return null;const i=this._pbfGeometry.asUnsafe();let r,n;this._pbfGeometry=null,e?e.reset(this.type):r=[];let s,o=HG.moveTo,a=0,l=0,c=0;for(;!i.empty();){if(a===0){const h=i.getUInt32();o=7&h,a=h>>3}switch(a--,o){case HG.moveTo:l+=i.getSInt32(),c+=i.getSInt32(),e?e.moveTo(l,c):r&&(n&&r.push(n),n=[],n.push(new oa(l,c)));break;case HG.lineTo:l+=i.getSInt32(),c+=i.getSInt32(),e?e.lineTo(l,c):n&&n.push(new oa(l,c));break;case HG.close:e?e.close():n&&!n[0].equals(l,c)&&n.push(n[0].clone());break;default:throw i.release(),new Error("Invalid path operation")}}return e?s=e.result():r&&(n&&r.push(n),s=r),i.release(),this._geometry=s,s}},Wm=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,i){return 65535&e|i<<16}static i8888to32(e,i,r,n){return 255&e|(255&i)<<8|(255&r)<<16|n<<24}static i8816to32(e,i,r){return 255&e|(255&i)<<8|r<<16}},WG=class extends Wm{constructor(){super(12)}add(e,i,r){const n=this.array;n.push(e),n.push(i),n.push(r)}},rBi=class b5t{constructor(e){this.extent=4096,this.keys=[],this.values=[],this._pbfLayer=e.clone();const i=e.asUnsafe();for(;i.next();)switch(i.tag()){case 1:this.name=i.getString();break;case 3:this.keys.push(i.getString());break;case 4:this.values.push(i.processMessage(b5t._parseValue));break;case 5:this.extent=i.getUInt32();break;default:i.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}},nBi=class extends Wm{constructor(e){super(e)}add(e,i,r,n,s,o,a,l,c,h,p,y){const v=this.array;let x=Wm.i1616to32(e,i);v.push(x);const I=31;x=Wm.i8888to32(Math.round(I*r),Math.round(I*n),Math.round(I*s),Math.round(I*o)),v.push(x),x=Wm.i8888to32(Math.round(I*a),Math.round(I*l),Math.round(I*c),Math.round(I*h)),v.push(x),x=Wm.i1616to32(p,0),v.push(x),y&&v.push(...y)}},sBi=class extends Wm{constructor(e){super(e)}add(e,i,r){const n=this.array;n.push(Wm.i1616to32(e,i)),r&&n.push(...r)}},oBi=class extends Wm{constructor(e){super(e)}add(e,i,r,n,s,o,a){const l=this.array,c=this.index;let h=Wm.i1616to32(e,i);l.push(h);const p=15;return h=Wm.i8888to32(Math.round(p*r),Math.round(p*n),s,o),l.push(h),a&&l.push(...a),c}},vbt=class extends Wm{constructor(e){super(e)}add(e,i,r,n,s,o,a,l,c,h,p,y){const v=this.array;let x=Wm.i1616to32(e,i);v.push(x),x=Wm.i1616to32(Math.round(8*r),Math.round(8*n)),v.push(x),x=Wm.i8888to32(s/4,o/4,l,c),v.push(x),x=Wm.i8888to32(0,abt(a),10*h,Math.min(10*p,255)),v.push(x),y&&v.push(...y)}},aBi=class extends Wm{constructor(e){super(e)}add(e,i,r,n,s){const o=this.array,a=Wm.i1616to32(2*e+r,2*i+n);o.push(a),s&&o.push(...s)}},Rfe=class{constructor(e,i,r){this.layerExtent=4096,this._features=[],this.layer=e,this.zoom=i,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,i,r){}},lBi=class extends Rfe{constructor(e,i,r,n,s){super(e,i,r),this.type=Tg.CIRCLE,this._circleVertexBuffer=n,this._circleIndexBuffer=s}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(e){const i=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 c of a)if(c)for(const h of c){const p=i.index;i.add(h.x,h.y,0,0,l),i.add(h.x,h.y,0,1,l),i.add(h.x,h.y,1,0,l),i.add(h.x,h.y,1,1,l),r.add(p+0,p+1,p+2),r.add(p+1,p+2,p+3),this._circleIndexCount+=6}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this._circleVertexBuffer.array.length,e+=this._circleIndexBuffer.array.length;const i=new Uint32Array(e),r=new Int32Array(i.buffer);let n=0;i[n++]=this.type,i[n++]=this.layerUIDs.length;for(let s=0;s80*Re){Oe=Be=Se[0],Ge=qe=Se[1];for(var Ft=Re;Ft<$t;Ft+=Re)(et=Se[Ft])Be&&(Be=et),Ze>qe&&(qe=Ze);mt=(mt=Math.max(Be-Oe,qe-Ge))!==0?1/mt:0}return r(Ct,Et,Re,Oe,Ge,mt),Et}function e(Se,Ie,Re,Oe,Ge){var Be,qe;if(Ge===de(Se,Ie,Re,Oe)>0)for(Be=Ie;Be=Ie;Be-=Oe)qe=Pe(Be,Se[Be],Se[Be+1],qe);if(qe&&Y(qe,qe.next)){var et=qe.next;ke(qe),qe=et}return qe}function i(Se,Ie){if(!Se)return Se;Ie||(Ie=Se);var Re,Oe=Se;do if(Re=!1,Oe.steiner||!Y(Oe,Oe.next)&&V(Oe.prev,Oe,Oe.next)!==0)Oe=Oe.next;else{var Ge=Oe.prev;if(ke(Oe),(Oe=Ie=Ge)===Oe.next)break;Re=!0}while(Re||Oe!==Ie);return Ie}function r(Se,Ie,Re,Oe,Ge,Be,qe){if(Se){!qe&&Be&&x(Se,Oe,Ge,Be);for(var et,Ze,mt=Se;Se.prev!==Se.next;)if(et=Se.prev,Ze=Se.next,Be?s(Se,Oe,Ge,Be):n(Se))Ie.push(et.i/Re),Ie.push(Se.i/Re),Ie.push(Ze.i/Re),ke(Se),Se=Ze.next,mt=Ze.next;else if((Se=Ze)===mt){qe?qe===1?r(Se=o(i(Se),Ie,Re),Ie,Re,Oe,Ge,Be,2):qe===2&&a(Se,Ie,Re,Oe,Ge,Be):r(i(Se),Ie,Re,Oe,Ge,Be,1);break}}}function n(Se){var Ie=Se.prev,Re=Se,Oe=Se.next;if(V(Ie,Re,Oe)>=0)return!1;for(var Ge=Se.next.next;Ge!==Se.prev;){if(k(Ie.x,Ie.y,Re.x,Re.y,Oe.x,Oe.y,Ge.x,Ge.y)&&V(Ge.prev,Ge,Ge.next)>=0)return!1;Ge=Ge.next}return!0}function s(Se,Ie,Re,Oe){var Ge=Se.prev,Be=Se,qe=Se.next;if(V(Ge,Be,qe)>=0)return!1;for(var et=Ge.xBe.x?Ge.x>qe.x?Ge.x:qe.x:Be.x>qe.x?Be.x:qe.x,Pt=Ge.y>Be.y?Ge.y>qe.y?Ge.y:qe.y:Be.y>qe.y?Be.y:qe.y,$t=P(et,Ze,Ie,Re,Oe),Ct=P(mt,Pt,Ie,Re,Oe),Et=Se.prevZ,Ft=Se.nextZ;Et&&Et.z>=$t&&Ft&&Ft.z<=Ct;){if(Et!==Se.prev&&Et!==Se.next&&k(Ge.x,Ge.y,Be.x,Be.y,qe.x,qe.y,Et.x,Et.y)&&V(Et.prev,Et,Et.next)>=0||(Et=Et.prevZ,Ft!==Se.prev&&Ft!==Se.next&&k(Ge.x,Ge.y,Be.x,Be.y,qe.x,qe.y,Ft.x,Ft.y)&&V(Ft.prev,Ft,Ft.next)>=0))return!1;Ft=Ft.nextZ}for(;Et&&Et.z>=$t;){if(Et!==Se.prev&&Et!==Se.next&&k(Ge.x,Ge.y,Be.x,Be.y,qe.x,qe.y,Et.x,Et.y)&&V(Et.prev,Et,Et.next)>=0)return!1;Et=Et.prevZ}for(;Ft&&Ft.z<=Ct;){if(Ft!==Se.prev&&Ft!==Se.next&&k(Ge.x,Ge.y,Be.x,Be.y,qe.x,qe.y,Ft.x,Ft.y)&&V(Ft.prev,Ft,Ft.next)>=0)return!1;Ft=Ft.nextZ}return!0}function o(Se,Ie,Re){var Oe=Se;do{var Ge=Oe.prev,Be=Oe.next.next;!Y(Ge,Be)&&X(Ge,Oe,Oe.next,Be)&&he(Ge,Be)&&he(Be,Ge)&&(Ie.push(Ge.i/Re),Ie.push(Oe.i/Re),Ie.push(Be.i/Re),ke(Oe),ke(Oe.next),Oe=Se=Be),Oe=Oe.next}while(Oe!==Se);return i(Oe)}function a(Se,Ie,Re,Oe,Ge,Be){var qe=Se;do{for(var et=qe.next.next;et!==qe.prev;){if(qe.i!==et.i&&j(qe,et)){var Ze=xe(qe,et);return qe=i(qe,qe.next),Ze=i(Ze,Ze.next),r(qe,Ie,Re,Oe,Ge,Be),void r(Ze,Ie,Re,Oe,Ge,Be)}et=et.next}qe=qe.next}while(qe!==Se)}function l(Se,Ie,Re,Oe){var Ge,Be,qe,et=[];for(Ge=0,Be=Ie.length;Ge=Oe.next.y&&Oe.next.y!==Oe.y){var et=Oe.x+(Be-Oe.y)*(Oe.next.x-Oe.x)/(Oe.next.y-Oe.y);if(et<=Ge&&et>qe){if(qe=et,et===Ge){if(Be===Oe.y)return Oe;if(Be===Oe.next.y)return Oe.next}Re=Oe.x=Oe.x&&Oe.x>=Pt&&Ge!==Oe.x&&k(Be<$t?Ge:qe,Be,Pt,$t,Be<$t?qe:Ge,Be,Oe.x,Oe.y)&&(Ze=Math.abs(Be-Oe.y)/(Ge-Oe.x),he(Oe,Se)&&(ZeRe.x||Oe.x===Re.x&&v(Re,Oe)))&&(Re=Oe,Ct=Ze)),Oe=Oe.next;while(Oe!==mt);return Re}function v(Se,Ie){return V(Se.prev,Se,Ie.prev)<0&&V(Ie.next,Se,Se.next)<0}function x(Se,Ie,Re,Oe){var Ge=Se;do Ge.z===null&&(Ge.z=P(Ge.x,Ge.y,Ie,Re,Oe)),Ge.prevZ=Ge.prev,Ge.nextZ=Ge.next,Ge=Ge.next;while(Ge!==Se);Ge.prevZ.nextZ=null,Ge.prevZ=null,I(Ge)}function I(Se){var Ie,Re,Oe,Ge,Be,qe,et,Ze,mt=1;do{for(Re=Se,Se=null,Be=null,qe=0;Re;){for(qe++,Oe=Re,et=0,Ie=0;Ie0||Ze>0&&Oe;)et!==0&&(Ze===0||!Oe||Re.z<=Oe.z)?(Ge=Re,Re=Re.nextZ,et--):(Ge=Oe,Oe=Oe.nextZ,Ze--),Be?Be.nextZ=Ge:Se=Ge,Ge.prevZ=Be,Be=Ge;Re=Oe}Be.nextZ=null,mt*=2}while(qe>1);return Se}function P(Se,Ie,Re,Oe,Ge){return(Se=1431655765&((Se=858993459&((Se=252645135&((Se=16711935&((Se=32767*(Se-Re)*Ge)|Se<<8))|Se<<4))|Se<<2))|Se<<1))|(Ie=1431655765&((Ie=858993459&((Ie=252645135&((Ie=16711935&((Ie=32767*(Ie-Oe)*Ge)|Ie<<8))|Ie<<4))|Ie<<2))|Ie<<1))<<1}function F(Se){var Ie=Se,Re=Se;do(Ie.x=0&&(Se-qe)*(Oe-et)-(Re-qe)*(Ie-et)>=0&&(Re-qe)*(Be-et)-(Ge-qe)*(Oe-et)>=0}function j(Se,Ie){return Se.next.i!==Ie.i&&Se.prev.i!==Ie.i&&!ce(Se,Ie)&&(he(Se,Ie)&&he(Ie,Se)&&_e(Se,Ie)&&(V(Se.prev,Se,Ie.prev)||V(Se,Ie.prev,Ie))||Y(Se,Ie)&&V(Se.prev,Se,Se.next)>0&&V(Ie.prev,Ie,Ie.next)>0)}function V(Se,Ie,Re){return(Ie.y-Se.y)*(Re.x-Ie.x)-(Ie.x-Se.x)*(Re.y-Ie.y)}function Y(Se,Ie){return Se.x===Ie.x&&Se.y===Ie.y}function X(Se,Ie,Re,Oe){var Ge=ie(V(Se,Ie,Re)),Be=ie(V(Se,Ie,Oe)),qe=ie(V(Re,Oe,Se)),et=ie(V(Re,Oe,Ie));return Ge!==Be&&qe!==et||!(Ge!==0||!Z(Se,Re,Ie))||!(Be!==0||!Z(Se,Oe,Ie))||!(qe!==0||!Z(Re,Se,Oe))||!(et!==0||!Z(Re,Ie,Oe))}function Z(Se,Ie,Re){return Ie.x<=Math.max(Se.x,Re.x)&&Ie.x>=Math.min(Se.x,Re.x)&&Ie.y<=Math.max(Se.y,Re.y)&&Ie.y>=Math.min(Se.y,Re.y)}function ie(Se){return Se>0?1:Se<0?-1:0}function ce(Se,Ie){var Re=Se;do{if(Re.i!==Se.i&&Re.next.i!==Se.i&&Re.i!==Ie.i&&Re.next.i!==Ie.i&&X(Re,Re.next,Se,Ie))return!0;Re=Re.next}while(Re!==Se);return!1}function he(Se,Ie){return V(Se.prev,Se,Se.next)<0?V(Se,Ie,Se.next)>=0&&V(Se,Se.prev,Ie)>=0:V(Se,Ie,Se.prev)<0||V(Se,Se.next,Ie)<0}function _e(Se,Ie){var Re=Se,Oe=!1,Ge=(Se.x+Ie.x)/2,Be=(Se.y+Ie.y)/2;do Re.y>Be!=Re.next.y>Be&&Re.next.y!==Re.y&&Ge<(Re.next.x-Re.x)*(Be-Re.y)/(Re.next.y-Re.y)+Re.x&&(Oe=!Oe),Re=Re.next;while(Re!==Se);return Oe}function xe(Se,Ie){var Re=new J(Se.i,Se.x,Se.y),Oe=new J(Ie.i,Ie.x,Ie.y),Ge=Se.next,Be=Ie.prev;return Se.next=Ie,Ie.prev=Se,Re.next=Ge,Ge.prev=Re,Oe.next=Re,Re.prev=Oe,Be.next=Oe,Oe.prev=Be,Oe}function Pe(Se,Ie,Re,Oe){var Ge=new J(Se,Ie,Re);return Oe?(Ge.next=Oe.next,Ge.prev=Oe,Oe.next.prev=Ge,Oe.next=Ge):(Ge.prev=Ge,Ge.next=Ge),Ge}function ke(Se){Se.next.prev=Se.prev,Se.prev.next=Se.next,Se.prevZ&&(Se.prevZ.nextZ=Se.nextZ),Se.nextZ&&(Se.nextZ.prevZ=Se.prevZ)}function J(Se,Ie,Re){this.i=Se,this.x=Ie,this.y=Re,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function de(Se,Ie,Re,Oe){for(var Ge=0,Be=Ie,qe=Re-Oe;Be0&&(Oe+=Se[Ge-1].length,Re.holes.push(Oe))}return Re},t},(wbt=bbt())!==void 0&&(_bt.exports=wbt);let cBi=class w5t extends Rfe{constructor(e,i,r,n,s,o,a){super(e,i,r),this.type=Tg.FILL,this._patternMap=new Map,this._fillVertexBuffer=n,this._fillIndexBuffer=s,this._outlineVertexBuffer=o,this._outlineIndexBuffer=a}get fillIndexStart(){return this._fillIndexStart}get fillIndexCount(){return this._fillIndexCount}get outlineIndexStart(){return this._outlineIndexStart}get outlineIndexCount(){return this._outlineIndexCount}getResources(e,i,r){const n=this.layer,s=this.zoom,o=n.getPaintProperty("fill-pattern");if(o)if(o.isDataDriven)for(const a of this._features)i(o.getValue(s,a),!0);else i(o.getValue(s),!0)}processFeatures(e){this._fillIndexStart=3*this._fillIndexBuffer.index,this._fillIndexCount=0,this._outlineIndexStart=3*this._outlineIndexBuffer.index,this._outlineIndexCount=0;const i=this.layer,r=this.zoom,{fillMaterial:n,outlineMaterial:s,hasDataDrivenFill:o,hasDataDrivenOutline:a}=i;e&&e.setExtent(this.layerExtent);const l=i.getPaintProperty("fill-pattern"),c=l?.isDataDriven;let h=!l&&i.getPaintValue("fill-antialias",r);if(i.outlineUsesFillColor){if(h&&!i.hasDataDrivenOpacity){const v=i.getPaintValue("fill-opacity",r),x=i.getPaintValue("fill-opacity",r+1);v<1&&x<1&&(h=!1)}if(h&&!i.hasDataDrivenColor){const v=i.getPaintValue("fill-color",r),x=i.getPaintValue("fill-color",r+1);v[3]<1&&x[3]<1&&(h=!1)}}const p=this._features,y=e?.validateTessellation;if(c){const v=[];for(const x of p){const I=l.getValue(r,x),P=this._spriteInfo[I];if(!P||!P.rect)continue;const F=n.encodeAttributes(x,r,i,P),k=h&&a?s.encodeAttributes(x,r,i):[],j=x.getGeometry(e);v.push({ddFillAttributes:F,ddOutlineAttributes:k,page:P.page,geometry:j}),v.sort((V,Y)=>V.page-Y.page);for(const{ddFillAttributes:V,ddOutlineAttributes:Y,page:X,geometry:Z}of v)this._processFeature(Z,h,i.outlineUsesFillColor,V,Y,y,X)}}else for(const v of p){const x=o?n.encodeAttributes(v,r,i):null,I=h&&a?s.encodeAttributes(v,r,i):null,P=v.getGeometry(e);this._processFeature(P,h,i.outlineUsesFillColor,x,I,y)}}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 i=new Uint32Array(e),r=new Int32Array(i.buffer);let n=0;i[n++]=this.type,i[n++]=this.layerUIDs.length;for(let a=0;a0)for(const[a,[l,c]]of s)i[n++]=a,i[n++]=l,i[n++]=c;i[n++]=this._fillVertexBuffer.array.length;for(let a=0;ah?(p!==void 0&&this._processFill(e,p,n,o,a),p=[y]):v<-h&&p!==void 0&&p.push(y)}p!==void 0&&this._processFill(e,p,n,o,a)}_processOutline(e,i){const r=this._outlineVertexBuffer,n=this._outlineIndexBuffer,s=n.index;let o,a,l;const c=new oa(0,0),h=new oa(0,0),p=new oa(0,0);let y=-1,v=-1,x=-1,I=-1,P=-1,F=!1;const k=0;let j=e.length;if(j<2)return;const V=e[k];let Y=e[j-1];for(;j&&Y.isEqual(V);)--j,Y=e[j-1];if(!(j-k<2)){for(let X=k;X8&&(he=8),ie>=0?(x=r.add(a.x,a.y,c.x,c.y,0,1,i),I===-1&&(I=x),y>=0&&v>=0&&x>=0&&!Z&&n.add(y,v,x),v=r.add(a.x,a.y,he*-p.x,he*-p.y,0,-1,i),P===-1&&(P=v),y>=0&&v>=0&&x>=0&&!Z&&n.add(y,v,x),y=v,v=x,x=r.add(a.x,a.y,p.x,p.y,0,1,i),y>=0&&v>=0&&x>=0&&!Z&&n.add(y,v,x),v=r.add(a.x,a.y,h.x,h.y,0,1,i),y>=0&&v>=0&&x>=0&&!Z&&n.add(y,v,x)):(x=r.add(a.x,a.y,he*p.x,he*p.y,0,1,i),I===-1&&(I=x),y>=0&&v>=0&&x>=0&&!Z&&n.add(y,v,x),v=r.add(a.x,a.y,-c.x,-c.y,0,-1,i),P===-1&&(P=v),y>=0&&v>=0&&x>=0&&!Z&&n.add(y,v,x),y=v,v=x,x=r.add(a.x,a.y,-p.x,-p.y,0,-1,i),y>=0&&v>=0&&x>=0&&!Z&&n.add(y,v,x),y=r.add(a.x,a.y,-h.x,-h.y,0,-1,i),y>=0&&v>=0&&x>=0&&!Z&&n.add(y,v,x))}y>=0&&v>=0&&I>=0&&!F&&n.add(y,v,I),y>=0&&I>=0&&P>=0&&!F&&n.add(y,P,I),this._outlineIndexCount+=3*(n.index-s)}}_processFill(e,i,r,n,s){n=!0;let o;i.length>1&&(o=[]);let a=0;for(const p of i)a!==0&&o.push(a),a+=e[p].length;const l=2*a,c=Gg.acquire();for(const p of i){const y=e[p],v=y.length;for(let x=0;x0){const p=i.map(x=>e[x].length),{buffer:y,vertexCount:v}=ybt(c,p);if(v>0){const x=this._fillVertexBuffer.index;for(let I=0;I0){const y=this._fillVertexBuffer.index;let v=0;for(;v=4160:e.y===i.y&&(e.y<=-64||e.y>=4160)}static _area(e){let i=0;const r=e.length-1;for(let n=0;nr){s=!0;const j=(r-n)/x;x=r-n,h=(1-j)*o+j*h,p=(1-j)*a+j*p,--c}const I=this._writeVertex(o,a,0,0,y,v,v,-y,0,-1,n),P=this._writeVertex(o,a,0,0,y,v,-v,y,0,1,n);n+=x;const F=this._writeVertex(h,p,0,0,y,v,v,-y,0,-1,n),k=this._writeVertex(h,p,0,0,y,v,-v,y,0,1,n);this._writeTriangle(I,P,F),this._writeTriangle(P,F,k),o=h,a=p}}_tessellate(e,i){const r=e[0],n=e[e.length-1],s=xbt(r,n),o=s?3:2;if(e.length{const mt=de(I,P,Z,ie,Be,qe,Oe,Ge,et,Ze,J);return xe>=0&&Pe>=0&&mt>=0&&Se(xe,Pe,mt),xe=Pe,Pe=mt,mt};s&&(x=e[e.length-2],j.x=n.x-x.x,j.y=n.y-x.y,Y=J4e(j),j.x/=Y,j.y/=Y);let Re=!1;for(let Oe=0;Oeke&&(Re=!0)),Re){const Pt=(ke-J)/V;V=ke-J,x={x:(1-Pt)*x.x+Pt*e[Oe].x,y:(1-Pt)*x.y+Pt*e[Oe].y},--Oe}else x=e[Oe];I=x.x,P=x.y;const Ge=Oe<=0&&!Re,Be=Oe===e.length-1;if(Ge||(J+=V),F=Be?s?e[1]:null:e[Oe+1],F?(j.x=F.x-I,j.y=F.y-P,Y=J4e(j),j.x/=Y,j.y/=Y):(j.x=void 0,j.y=void 0),!s){if(Ge){rx(X,j),Z=X.x,ie=X.y,l===xf.SQUARE&&(Ie(-j.y-j.x,j.x-j.y,j.x,j.y,0,-1),Ie(j.y-j.x,-j.x-j.y,j.x,j.y,0,1)),l===xf.ROUND&&(Ie(-j.y-j.x,j.x-j.y,j.x,j.y,-1,-1),Ie(j.y-j.x,-j.x-j.y,j.x,j.y,-1,1)),l!==xf.ROUND&&l!==xf.BUTT||(Ie(-j.y,j.x,j.x,j.y,0,-1),Ie(j.y,-j.x,j.x,j.y,0,1));continue}if(Be){yS(X,k),Z=X.x,ie=X.y,l!==xf.ROUND&&l!==xf.BUTT||(Ie(k.y,-k.x,-k.x,-k.y,0,-1),Ie(-k.y,k.x,-k.x,-k.y,0,1)),l===xf.SQUARE&&(Ie(k.y-k.x,-k.x-k.y,-k.x,-k.y,0,-1),Ie(-k.y-k.x,k.x-k.y,-k.x,-k.y,0,1)),l===xf.ROUND&&(Ie(k.y-k.x,-k.x-k.y,-k.x,-k.y,1,-1),Ie(-k.y-k.x,k.x-k.y,-k.x,-k.y,1,1));continue}}let qe,et,Ze=-dBi(k,j);if(Math.abs(Ze)<.01)Cbt(k,j)>0?(X.x=k.x,X.y=k.y,Ze=1,qe=Number.MAX_VALUE,et=!0):(rx(X,j),Ze=1,qe=1,et=!1);else{X.x=(k.x+j.x)/Ze,X.y=(k.y+j.y)/Ze,qe=J4e(X);const Pt=(qe-1)*y*a;et=qe>4||Pt>V&&Pt>Y}Z=X.x,ie=X.y;let mt=c;switch(c){case sm.BEVEL:qe<1.05&&(mt=sm.MITER);break;case sm.ROUND:qeh&&(mt=sm.BEVEL)}switch(mt){case sm.MITER:if(Ie(X.x,X.y,-k.x,-k.y,0,-1),Ie(-X.x,-X.y,-k.x,-k.y,0,1),Be)break;if(v){const Pt=Re?0:J;xe=this._writeVertex(I,P,Z,ie,j.x,j.y,X.x,X.y,0,-1,Pt),Pe=this._writeVertex(I,P,Z,ie,j.x,j.y,-X.x,-X.y,0,1,Pt)}break;case sm.BEVEL:{const Pt=Ze<0;let $t,Ct,Et,Ft;if(Pt){const pt=xe;xe=Pe,Pe=pt,$t=ce,Ct=he}else $t=he,Ct=ce;if(et)Et=Pt?rx(this._innerPrev,k):yS(this._innerPrev,k),Ft=Pt?yS(this._innerNext,j):rx(this._innerNext,j);else{const pt=Pt?K4e(this._inner,X):Sbt(this._inner,X);Et=pt,Ft=pt}const ot=Pt?yS(this._bevelStart,k):rx(this._bevelStart,k);Ie(Et.x,Et.y,-k.x,-k.y,$t.x,$t.y);const Te=Ie(ot.x,ot.y,-k.x,-k.y,Ct.x,Ct.y);if(Be)break;const je=Pt?rx(this._bevelEnd,j):yS(this._bevelEnd,j);if(et){const pt=this._writeVertex(I,P,Z,ie,-k.x,-k.y,0,0,0,0,J);xe=this._writeVertex(I,P,Z,ie,j.x,j.y,Ft.x,Ft.y,$t.x,$t.y,J),Pe=this._writeVertex(I,P,Z,ie,j.x,j.y,je.x,je.y,Ct.x,Ct.y,J),this._writeTriangle(Te,pt,Pe)}else{if(v){const pt=this._bevelMiddle;pt.x=(ot.x+je.x)/2,pt.y=(ot.y+je.y)/2,YG(_e,pt,-k.x,-k.y),Ie(pt.x,pt.y,-k.x,-k.y,_e.x,_e.y),YG(_e,pt,j.x,j.y),xe=this._writeVertex(I,P,Z,ie,j.x,j.y,pt.x,pt.y,_e.x,_e.y,J),Pe=this._writeVertex(I,P,Z,ie,j.x,j.y,Ft.x,Ft.y,$t.x,$t.y,J)}else{const pt=xe;xe=Pe,Pe=pt}Ie(je.x,je.y,j.x,j.y,Ct.x,Ct.y)}if(Pt){const pt=xe;xe=Pe,Pe=pt}break}case sm.ROUND:{const Pt=Ze<0;let $t,Ct;if(Pt){const nt=xe;xe=Pe,Pe=nt,$t=ce,Ct=he}else $t=he,Ct=ce;const Et=Pt?K4e(this._inner,X):Sbt(this._inner,X);let Ft,ot;et?(Ft=Pt?rx(this._innerPrev,k):yS(this._innerPrev,k),ot=Pt?yS(this._innerNext,j):rx(this._innerNext,j)):(Ft=Et,ot=Et);const Te=Pt?yS(this._roundStart,k):rx(this._roundStart,k),je=Pt?rx(this._roundEnd,j):yS(this._roundEnd,j),pt=Ie(Ft.x,Ft.y,-k.x,-k.y,$t.x,$t.y),kt=Ie(Te.x,Te.y,-k.x,-k.y,Ct.x,Ct.y);if(Be)break;const ct=this._writeVertex(I,P,Z,ie,-k.x,-k.y,0,0,0,0,J);et||this._writeTriangle(xe,Pe,ct);const ae=K4e(this._outer,Et),ht=this._writeVertex(I,P,Z,ie,j.x,j.y,je.x,je.y,Ct.x,Ct.y,J);let wt,Ne;const pe=qe>2;if(pe){let nt;qe!==Number.MAX_VALUE?(ae.x/=qe,ae.y/=qe,nt=Cbt(k,ae),nt=(qe*(nt*nt-1)+1)/nt):nt=-1,wt=Pt?yS(this._startBreak,k):rx(this._startBreak,k),wt.x+=k.x*nt,wt.y+=k.y*nt,Ne=Pt?rx(this._endBreak,j):yS(this._endBreak,j),Ne.x+=j.x*nt,Ne.y+=j.y*nt}YG(_e,ae,-k.x,-k.y);const Ae=this._writeVertex(I,P,Z,ie,-k.x,-k.y,ae.x,ae.y,_e.x,_e.y,J);YG(_e,ae,j.x,j.y);const tt=v?this._writeVertex(I,P,Z,ie,j.x,j.y,ae.x,ae.y,_e.x,_e.y,J):Ae,gt=ct,ze=v?this._writeVertex(I,P,Z,ie,j.x,j.y,0,0,0,0,J):ct;let Ot=-1,jt=-1;if(pe&&(YG(_e,wt,-k.x,-k.y),Ot=this._writeVertex(I,P,Z,ie,-k.x,-k.y,wt.x,wt.y,_e.x,_e.y,J),YG(_e,Ne,j.x,j.y),jt=this._writeVertex(I,P,Z,ie,j.x,j.y,Ne.x,Ne.y,_e.x,_e.y,J)),v?pe?(this._writeTriangle(gt,kt,Ot),this._writeTriangle(gt,Ot,Ae),this._writeTriangle(ze,tt,jt),this._writeTriangle(ze,jt,ht)):(this._writeTriangle(gt,kt,Ae),this._writeTriangle(ze,tt,ht)):pe?(this._writeTriangle(ct,kt,Ot),this._writeTriangle(ct,Ot,jt),this._writeTriangle(ct,jt,ht)):(this._writeTriangle(ct,kt,Ae),this._writeTriangle(ct,tt,ht)),et?(xe=this._writeVertex(I,P,Z,ie,j.x,j.y,ot.x,ot.y,$t.x,$t.y,J),Pe=ht):(xe=v?this._writeVertex(I,P,Z,ie,j.x,j.y,ot.x,ot.y,$t.x,$t.y,J):pt,this._writeTriangle(xe,ze,ht),Pe=ht),Pt){const nt=xe;xe=Pe,Pe=nt}break}}}}};const pBi=65535;let fBi=class extends Rfe{constructor(e,i,r,n,s){super(e,i,r),this.type=Tg.LINE,this._tessellationOptions={pixelCoordRatio:8,halfWidth:0,offset:0},this._patternMap=new Map,this.tessellationProperties={_lineVertexBuffer:null,_lineIndexBuffer:null,_ddValues:null},this.tessellationProperties._lineVertexBuffer=n,this.tessellationProperties._lineIndexBuffer=s,this._lineTessellator=new Tbt(mBi(this.tessellationProperties),gBi(this.tessellationProperties),e.canUseThinTessellation)}get lineIndexStart(){return this._lineIndexStart}get lineIndexCount(){return this._lineIndexCount}getResources(e,i,r){const n=this.layer,s=this.zoom,o=n.getPaintProperty("line-pattern"),a=n.getPaintProperty("line-dasharray"),l=n.getLayoutProperty("line-cap");if(!o&&!a)return;const c=l?.getValue(s)||0,h=l?.isDataDriven,p=o?.isDataDriven,y=a?.isDataDriven;if(p||y)for(const v of this._features)i(p?o.getValue(s,v):this._getDashArrayKey(v,s,n,a,h,l,c));else if(o)i(o.getValue(s));else if(a){const v=a.getValue(s);i(n.getDashKey(v,c))}}processFeatures(e){this._lineIndexStart=3*this.tessellationProperties._lineIndexBuffer.index,this._lineIndexCount=0;const i=this.layer,r=this.zoom,n=this._features,s=this._tessellationOptions,{hasDataDrivenLine:o,lineMaterial:a}=i;e&&e.setExtent(this.layerExtent);const l=i.getPaintProperty("line-pattern"),c=i.getPaintProperty("line-dasharray"),h=l?.isDataDriven,p=c?.isDataDriven;let y;y=i.getLayoutProperty("line-cap");const v=y?.isDataDriven?y:null,x=v?null:i.getLayoutValue("line-cap",r),I=x||0,P=!!v;y=i.getLayoutProperty("line-join");const F=y?.isDataDriven?y:null,k=F?null:i.getLayoutValue("line-join",r);y=i.getLayoutProperty("line-miter-limit");const j=y?.isDataDriven?y:null,V=j?null:i.getLayoutValue("line-miter-limit",r);y=i.getLayoutProperty("line-round-limit");const Y=y?.isDataDriven?y:null,X=Y?null:i.getLayoutValue("line-round-limit",r);y=i.getPaintProperty("line-width");const Z=y?.isDataDriven?y:null,ie=Z?null:i.getPaintValue("line-width",r);y=i.getPaintProperty("line-offset");const ce=y?.isDataDriven?y:null,he=ce?null:i.getPaintValue("line-offset",r);if(h||p){const _e=[];for(const xe of n){const Pe=h?l.getValue(r,xe):this._getDashArrayKey(xe,r,i,c,P,v,I),ke=this._spriteInfo[Pe];if(!ke||!ke.rect)continue;const J=a.encodeAttributes(xe,r,i,ke),de=xe.getGeometry(e);_e.push({ddAttributes:J,page:ke.page,cap:v?v.getValue(r,xe):x,join:F?F.getValue(r,xe):k,miterLimit:j?j.getValue(r,xe):V,roundLimit:Y?Y.getValue(r,xe):X,halfWidth:.5*(Z?Z.getValue(r,xe):ie),offset:ce?ce.getValue(r,xe):he,geometry:de})}_e.sort((xe,Pe)=>xe.page-Pe.page),s.textured=!0;for(const{ddAttributes:xe,page:Pe,cap:ke,join:J,miterLimit:de,roundLimit:Se,halfWidth:Ie,offset:Re,geometry:Oe}of _e)s.capType=ke,s.joinType=J,s.miterLimit=de,s.roundLimit=Se,s.halfWidth=Ie,s.offset=Re,this._processFeature(Oe,xe,Pe)}else{if(l){const _e=l.getValue(r),xe=this._spriteInfo[_e];if(!xe||!xe.rect)return}s.textured=!(!l&&!c),s.capType=x,s.joinType=k,s.miterLimit=V,s.roundLimit=X,s.halfWidth=.5*ie,s.offset=he;for(const _e of n){const xe=o?a.encodeAttributes(_e,r,i):null;v&&(s.capType=v.getValue(r,_e)),F&&(s.joinType=F.getValue(r,_e)),j&&(s.miterLimit=j.getValue(r,_e)),Y&&(s.roundLimit=Y.getValue(r,_e)),Z&&(s.halfWidth=.5*Z.getValue(r,_e)),ce&&(s.offset=ce.getValue(r,_e));const Pe=_e.getGeometry(e);this._processFeature(Pe,xe)}}}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 i=new Uint32Array(e),r=new Int32Array(i.buffer);let n=0;i[n++]=this.type,i[n++]=this.layerUIDs.length;for(let a=0;a0)for(const[a,[l,c]]of s)i[n++]=a,i[n++]=l,i[n++]=c;i[n++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let a=0;a(e,i,r,n,s,o,a,l,c,h,p)=>(t._lineVertexBuffer.add(e,i,a,l,r,n,s,o,c,h,p,t._ddValues),t._lineVertexBuffer.index-1),gBi=t=>(e,i,r)=>{t._lineIndexBuffer.add(e,i,r)},Mfe=[["(",")"],[")","("],["<",">"],[">","<"],["[","]"],["]","["],["{","}"],["}","{"],["«","»"],["»","«"],["‹","›"],["›","‹"],["⁽","⁾"],["⁾","⁽"],["₍","₎"],["₎","₍"],["≤","≥"],["≥","≤"],["〈","〉"],["〉","〈"],["﹙","﹚"],["﹚","﹙"],["﹛","﹜"],["﹜","﹛"],["﹝","﹞"],["﹞","﹝"],["﹤","﹥"],["﹥","﹤"]],XG=["آ","أ","إ","ا"],yBi=["ﻵ","ﻷ","ﻹ","ﻻ"],vBi=["ﻶ","ﻸ","ﻺ","ﻼ"],Dfe=["ا","ب","ت","ث","ج","ح","خ","د","ذ","ر","ز","س","ش","ص","ض","ط","ظ","ع","غ","ف","ق","ك","ل","م","ن","ه","و","ي","إ","أ","آ","ة","ى","ل","م","ن","ه","و","ي","إ","أ","آ","ة","ى","ی","ئ","ؤ"],_Bi=["ﺍ","ﺏ","ﺕ","ﺙ","ﺝ","ﺡ","ﺥ","ﺩ","ﺫ","ﺭ","ﺯ","ﺱ","ﺵ","ﺹ","ﺽ","ﻁ","ﻅ","ﻉ","ﻍ","ﻑ","ﻕ","ﻙ","ﻝ","ﻡ","ﻥ","ﻩ","ﻭ","ﻱ","ﺇ","ﺃ","ﺁ","ﺓ","ﻯ","ﯼ","ﺉ","ﺅ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺉ","ﺅ"],bBi=["ﺎ","ﺐ","ﺖ","ﺚ","ﺞ","ﺢ","ﺦ","ﺪ","ﺬ","ﺮ","ﺰ","ﺲ","ﺶ","ﺺ","ﺾ","ﻂ","ﻆ","ﻊ","ﻎ","ﻒ","ﻖ","ﻚ","ﻞ","ﻢ","ﻦ","ﻪ","ﻮ","ﻲ","ﺈ","ﺄ","ﺂ","ﺔ","ﻰ","ﯽ","ﺊ","ﺆ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺊ","ﺆ"],wBi=["ﺎ","ﺒ","ﺘ","ﺜ","ﺠ","ﺤ","ﺨ","ﺪ","ﺬ","ﺮ","ﺰ","ﺴ","ﺸ","ﺼ","ﻀ","ﻄ","ﻈ","ﻌ","ﻐ","ﻔ","ﻘ","ﻜ","ﻠ","ﻤ","ﻨ","ﻬ","ﻮ","ﻴ","ﺈ","ﺄ","ﺂ","ﺔ","ﻰ","ﯿ","ﺌ","ﺆ","ﹱ","ﹲ","ﹴ","ﹷ","ﹹ","ﹻ","ﹽ","ﹿ","ﺀ","ﺌ","ﺆ"],xBi=["ﺍ","ﺑ","ﺗ","ﺛ","ﺟ","ﺣ","ﺧ","ﺩ","ﺫ","ﺭ","ﺯ","ﺳ","ﺷ","ﺻ","ﺿ","ﻃ","ﻇ","ﻋ","ﻏ","ﻓ","ﻗ","ﻛ","ﻟ","ﻣ","ﻧ","ﻫ","ﻭ","ﻳ","ﺇ","ﺃ","ﺁ","ﺓ","ﻯ","ﯾ","ﺋ","ﺅ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺋ","ﺅ"],Ebt=["ء","آ","أ","ؤ","إ","ا","ة","د","ذ","ر","ز","و","ى"],SBi=["ً","ً","ٌ","؟","ٍ","؟","َ","َ","ُ","ُ","ِ","ِ","ّ","ّ","ْ","ْ","ء","آ","آ","أ","أ","ؤ","ؤ","إ","إ","ئ","ئ","ئ","ئ","ا","ا","ب","ب","ب","ب","ة","ة","ت","ت","ت","ت","ث","ث","ث","ث","ج","ج","ج","ج","ح","ح","ح","ح","خ","خ","خ","خ","د","د","ذ","ذ","ر","ر","ز","ز","س","س","س","س","ش","ش","ش","ش","ص","ص","ص","ص","ض","ض","ض","ض","ط","ط","ط","ط","ظ","ظ","ظ","ظ","ع","ع","ع","ع","غ","غ","غ","غ","ف","ف","ف","ف","ق","ق","ق","ق","ك","ك","ك","ك","ل","ل","ل","ل","م","م","م","م","ن","ن","ن","ن","ه","ه","ه","ه","و","و","ى","ى","ي","ي","ي","ي","ﻵ","ﻶ","ﻷ","ﻸ","ﻹ","ﻺ","ﻻ","ﻼ","؟","؟","؟"],Ibt=["ء","ف"],CBi=["غ","ي"],TBi=[[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]],EBi=[[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]],zt=0,jr=1,go=2,Xp=3,yt=4,bE=5,Ffe=6,xt=7,C0=8,Pv=9,vS=10,Wo=11,Ji=12,IBi=13,ABi=14,PBi=15,OBi=16,RBi=17,Ss=18,MBi=["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"],wE=100,DBi=[wE+0,zt,zt,zt,zt,wE+1,wE+2,wE+3,jr,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,wE+4,yt,yt,yt,zt,yt,zt,yt,zt,yt,yt,yt,zt,zt,yt,yt,zt,zt,zt,zt,zt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,zt,zt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,zt,zt,yt,yt,zt,zt,yt,yt,zt,zt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,zt,zt,zt,wE+5,xt,xt,wE+6,wE+7],FBi=[[Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ffe,bE,Ffe,C0,bE,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,bE,bE,bE,Ffe,C0,yt,yt,Wo,Wo,Wo,yt,yt,yt,yt,yt,vS,Pv,vS,Pv,Pv,go,go,go,go,go,go,go,go,go,go,Pv,yt,yt,yt,yt,yt,yt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,yt,yt,yt,yt,yt,yt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,yt,yt,yt,yt,Ss,Ss,Ss,Ss,Ss,Ss,bE,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Ss,Pv,yt,Wo,Wo,Wo,Wo,yt,yt,yt,yt,zt,yt,yt,Ss,yt,yt,Wo,Wo,go,go,yt,zt,yt,yt,yt,go,zt,yt,yt,yt,yt,yt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,yt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,yt,zt,zt,zt,zt,zt,zt,zt,zt],[zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,yt,yt,yt,yt,yt,yt,yt,yt,yt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,yt,yt,zt,zt,zt,zt,zt,zt,zt,yt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,yt,zt,yt,yt,yt,yt,yt,yt,yt,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,jr,Ji,jr,Ji,Ji,jr,Ji,Ji,jr,Ji,yt,yt,yt,yt,yt,yt,yt,yt,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,yt,yt,yt,yt,yt,jr,jr,jr,jr,jr,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt],[Xp,Xp,Xp,Xp,yt,yt,yt,yt,xt,Wo,Wo,xt,Pv,xt,yt,yt,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,xt,yt,yt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Xp,Xp,Xp,Xp,Xp,Xp,Xp,Xp,Xp,Xp,Wo,Xp,Xp,xt,xt,xt,Ji,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Xp,yt,Ji,Ji,Ji,Ji,Ji,Ji,xt,xt,Ji,Ji,yt,Ji,Ji,Ji,Ji,xt,xt,go,go,go,go,go,go,go,go,go,go,xt,xt,xt,xt,xt,xt],[xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,yt,xt,xt,Ji,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,yt,yt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,xt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,jr,jr,yt,yt,yt,yt,jr,yt,yt,yt,yt,yt],[C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,C0,Ss,Ss,Ss,zt,jr,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,C0,bE,IBi,ABi,PBi,OBi,RBi,Pv,Wo,Wo,Wo,Wo,Wo,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,Pv,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,C0,Ss,Ss,Ss,Ss,Ss,yt,yt,yt,yt,yt,Ss,Ss,Ss,Ss,Ss,Ss,go,zt,yt,yt,go,go,go,go,go,go,vS,vS,yt,yt,yt,zt,go,go,go,go,go,go,go,go,go,go,vS,vS,yt,yt,yt,yt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,yt,yt,yt,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,Wo,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt],[zt,zt,zt,zt,zt,zt,zt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,zt,zt,zt,zt,zt,yt,yt,yt,yt,yt,jr,Ji,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,vS,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,yt,jr,jr,jr,jr,jr,yt,jr,yt,jr,jr,yt,jr,jr,yt,jr,jr,jr,jr,jr,jr,jr,jr,jr,jr,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt],[Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,Ji,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,Ji,Ji,Ji,Ji,Ji,Ji,Ji,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,Pv,yt,Pv,yt,yt,Pv,yt,yt,yt,yt,yt,yt,yt,yt,yt,Wo,yt,yt,vS,vS,yt,yt,yt,yt,yt,Wo,Wo,yt,yt,yt,yt,yt,xt,xt,xt,xt,xt,yt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,xt,yt,yt,Ss],[yt,yt,yt,Wo,Wo,Wo,yt,yt,yt,yt,yt,vS,Pv,vS,Pv,Pv,go,go,go,go,go,go,go,go,go,go,Pv,yt,yt,yt,yt,yt,yt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,yt,yt,yt,yt,yt,yt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,zt,yt,yt,yt,zt,zt,zt,zt,zt,zt,yt,yt,zt,zt,zt,zt,zt,zt,yt,yt,zt,zt,zt,zt,zt,zt,yt,yt,zt,zt,zt,yt,yt,yt,Wo,Wo,yt,yt,yt,Wo,Wo,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt,yt]];let Abt=class{constructor(){this.inputFormat="ILYNN",this.outputFormat="VLNNN",this.sourceToTarget=[],this.targetToSource=[],this.levels=[]}bidiTransform(e,i,r){if(this.sourceToTarget=[],this.targetToSource=[],!e)return"";if(JBi(this.sourceToTarget,this.targetToSource,e.length),!this.checkParameters(i,r))return e;i=this.inputFormat,r=this.outputFormat;let n=e;const s=QBi,o=Dbt(i.charAt(1)),a=Dbt(r.charAt(1)),l=(i.charAt(0)==="I"?"L":i.charAt(0))+o,c=(r.charAt(0)==="I"?"L":r.charAt(0))+a,h=i.charAt(2)+r.charAt(2);s.defInFormat=l,s.defOutFormat=c,s.defSwap=h;const p=rZ(e,l,c,h,s);let y=!1;return r.charAt(1)==="R"?y=!0:r.charAt(1)!=="C"&&r.charAt(1)!=="D"||(y=this.checkContextual(p)==="rtl"),this.sourceToTarget=wb,this.targetToSource=ZBi(this.sourceToTarget),Nfe=this.targetToSource,n=i.charAt(3)===r.charAt(3)?p:r.charAt(3)==="S"?NBi(y,p,!0):BBi(p,y,!0),this.sourceToTarget=wb,this.targetToSource=Nfe,this.levels=kfe,n}_inputFormatSetter(e){if(!Lbt.test(e))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.inputFormat=e}_outputFormatSetter(e){if(!Lbt.test(e))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.outputFormat=e}checkParameters(e,i){return e?this._inputFormatSetter(e):e=this.inputFormat,i?this._outputFormatSetter(i):i=this.outputFormat,e!==i}checkContextual(e){let i=Lfe(e);if(i!=="ltr"&&i!=="rtl"){try{i=document.dir.toLowerCase()}catch{}i!=="ltr"&&i!=="rtl"&&(i="ltr")}return i}hasBidiChar(e){return iVi.test(e)}};function rZ(t,e,i,r,n){const s=LBi(t,{inFormat:e,outFormat:i,swap:r},n);if(s.inFormat===s.outFormat)return t;e=s.inFormat,i=s.outFormat,r=s.swap;const o=e.substring(0,1),a=e.substring(1,4),l=i.substring(0,1),c=i.substring(1,4);if(n.inFormat=e,n.outFormat=i,n.swap=r,o==="L"&&i==="VLTR"){if(a==="LTR")return n.dir=KG,oF(t,n);if(a==="RTL")return n.dir=sZ,oF(t,n)}if(o==="V"&&l==="V")return n.dir=a==="RTL"?sZ:KG,Z4e(t,n);if(o==="L"&&i==="VRTL")return a==="LTR"?(n.dir=KG,t=oF(t,n)):(n.dir=sZ,t=oF(t,n)),Z4e(t);if(e==="VLTR"&&i==="LLTR")return n.dir=KG,oF(t,n);if(o==="V"&&l==="L"&&a!==c)return t=Z4e(t),a==="RTL"?rZ(t,"LLTR","VLTR",r,n):rZ(t,"LRTL","VRTL",r,n);if(e==="VRTL"&&i==="LRTL")return rZ(t,"LRTL","VRTL",r,n);if(o==="L"&&l==="L"){const h=n.swap;return n.swap=h.substr(0,1)+"N",a==="RTL"?(n.dir=sZ,t=oF(t,n),n.swap="N"+h.substr(1,2),n.dir=KG,t=oF(t,n)):(n.dir=KG,t=oF(t,n),n.swap="N"+h.substr(1,2),t=rZ(t,"VLTR","LRTL",n.swap,n)),t}return t}function LBi(t,e,i){if(e.inFormat===void 0&&(e.inFormat=i.defInFormat),e.outFormat===void 0&&(e.outFormat=i.defOutFormat),e.swap===void 0&&(e.swap=i.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=Lfe(t),o=s==="ltr"||s==="rtl"?s.toUpperCase():e.inFormat.charAt(2)==="L"?"LTR":"RTL",e.inFormat=r+o),a.charAt(0)==="C"&&(s=Lfe(t),s==="rtl"?a="RTL":s==="ltr"?(s=$Bi(t),a=s.toUpperCase()):a=e.outFormat.charAt(2)==="L"?"LTR":"RTL",e.outFormat=n+a),e}function NBi(t,e,i){if(e.length===0)return"";t===void 0&&(t=!0),i===void 0&&(i=!0);const r=(e=String(e)).split("");let n=0,s=1,o=r.length;t||(n=r.length-1,s=-1,o=1);const a=kBi(r,n,s,o,i);let l="";for(let c=0;c-1?(Fbt(Nfe,c,!t,-1),wb.splice(c,1)):l+=r[c];return l}function kBi(t,e,i,r,n){let s=0;const o=[];let a=0;for(let l=e;l*i="ﹰ"&&n[s]<"\uFEFF"){const a=t.charCodeAt(s);n[s]>="ﻵ"&&n[s]<="ﻼ"?(e?(s>0&&i&&n[s-1]===" "?r=r.substring(0,r.length-1)+"ل":(r+="ل",o=!0),r+=XG[(a-65269)/2]):(r+=XG[(a-65269)/2],r+="ل",s+10)if(y===16){for(let x=o;x-1){for(let x=o;x=0&&t[s]===C0;s--)e[s]=r.dir}}function jBi(t,e,i){if(i.hiLevel!==0&&i.swap.substr(0,1)!==i.swap.substr(1,2))for(let r=0;r>8];return i=Ibt[e]&&t<=CBi[e])return!0;return!1}function Rbt(t,e,i,r){for(;e*i=t){for(s=h+1;s=t;)s++;for(o=h,a=s-1;o(n.lastArabic=!1,zt),UBAT_R:()=>(n.lastArabic=!1,jr),UBAT_ON:()=>yt,UBAT_AN:()=>Xp,UBAT_EN:()=>n.lastArabic?Xp:go,UBAT_AL:()=>(n.lastArabic=!0,n.hasUbatAl=!0,jr),UBAT_WS:()=>yt,UBAT_CS:()=>{let o,a;return r<1||r+1>=e.length||(o=i[r-1])!==go&&o!==Xp||(a=e[r+1])!==go&&a!==Xp?yt:(n.lastArabic&&(a=Xp),a===o?a:yt)},UBAT_ES:()=>(r>0?i[r-1]:bE)===go&&r+1{if(r>0&&i[r-1]===go)return go;if(n.lastArabic)return yt;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,h=e[a];if(c&&(h===jr||h===xt))return jr}}return r<1||e[r-1]===bE?yt:i[r-1]},UBAT_B:()=>(n.lastArabic=!0,n.hasUbatB=!0,n.dir),UBAT_S:()=>(n.hasUbatS=!0,yt),UBAT_LRE:()=>(n.lastArabic=!1,yt),UBAT_RLE:()=>(n.lastArabic=!1,yt),UBAT_LRO:()=>(n.lastArabic=!1,yt),UBAT_RLO:()=>(n.lastArabic=!1,yt),UBAT_PDF:()=>(n.lastArabic=!1,yt),UBAT_BN:()=>yt}[MBi[s]]()}function WBi(t){let e,i=0,r=Mfe.length-1;for(;i<=r;)if(e=Math.floor((i+r)/2),tMfe[e][0]))return Mfe[e][1];i=e+1}return t}function qBi(t){for(let e=0;e="ً"&&t<="ٕ"}function Dbt(t){return t==="L"?"LTR":t==="R"?"RTL":t==="C"?"CLR":t==="D"?"CRL":""}function XBi(t,e,i,r){for(;e*ie||!i&&t[n]===e)&&(t[n]+=r)}let wb=[],Nfe=[],kfe=[];const QBi={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:""},eVi=5,tVi=6,KG=0,sZ=1,Lbt=/^[(I|V)][(L|R|C|D)][(Y|N)][(S|N)][N]$/,iVi=/[\u0591-\u06ff\ufb1d-\ufefc]/;var Gs,d6;(function(t){t[t.R8_SIGNED=0]="R8_SIGNED",t[t.R8_UNSIGNED=1]="R8_UNSIGNED",t[t.R16_SIGNED=2]="R16_SIGNED",t[t.R16_UNSIGNED=3]="R16_UNSIGNED",t[t.R8G8_SIGNED=4]="R8G8_SIGNED",t[t.R8G8_UNSIGNED=5]="R8G8_UNSIGNED",t[t.R16G16_SIGNED=6]="R16G16_SIGNED",t[t.R16G16_UNSIGNED=7]="R16G16_UNSIGNED",t[t.R8G8B8A8_SIGNED=8]="R8G8B8A8_SIGNED",t[t.R8G8B8A8_UNSIGNED=9]="R8G8B8A8_UNSIGNED",t[t.R8G8B8A8_COLOR=10]="R8G8B8A8_COLOR",t[t.R16G16B16A16_DASHARRAY=11]="R16G16B16A16_DASHARRAY",t[t.R16G16B16A16_PATTERN=12]="R16G16B16A16_PATTERN"})(Gs||(Gs={})),function(t){t[t.UNIFORM=0]="UNIFORM",t[t.DATA_DRIVEN=1]="DATA_DRIVEN",t[t.INTERPOLATED_DATA_DRIVEN=2]="INTERPOLATED_DATA_DRIVEN",t[t.UNUSED=3]="UNUSED"}(d6||(d6={}));let aF=class TBe{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,i,r,n,s){const o=this.getUniforms();for(const a of o){const{name:l,type:c,getValue:h}=a,p=h(r,i,n,s);if(p!==null)switch(c){case"float":e.setUniform1f(l,p);break;case"vec2":e.setUniform2fv(l,p);break;case"vec4":e.setUniform4fv(l,p)}}}encodeAttributes(e,i,r,n){const s=this.attributesInfo(),o=this.getEncodingInfos(),a=[];let l=0,c=0;for(const h of Object.keys(o)){const p=o[h],{type:y,precisionFactor:v,isLayout:x}=s[h],I=x?r.getLayoutProperty(h):r.getPaintProperty(h),P=I.interpolator?.getInterpolationRange(i);let F=0;for(const k of p){const{offset:j,bufferElementsToAdd:V}=k;if(V>0){for(let X=0;X4)n++,Z={dataIndex:n,count:0,offset:0},j!==4&&(r[X]=Z),e.push({location:-1,name:"a_data_"+n,count:j,type:F,normalized:V}),ie=Math.ceil(Math.max(Y/4,1));else{const ce=e[Z.dataIndex];ce.count+=j,ie=Math.ceil(Math.max(ce.count*k/4,1))-Math.ceil(Math.max(Z.offset/4,1))}x.push({dataIndex:Z.dataIndex,offset:Z.offset,bufferElementsToAdd:ie}),Z.offset+=Y,Z.count+=j}}for(const p of e)switch(p.type){case Bi.BYTE:case Bi.UNSIGNED_BYTE:p.count=4;break;case Bi.SHORT:case Bi.UNSIGNED_SHORT:p.count+=p.count%2}this._buildVertexBufferLayout(e);let l=0;const c=this._layoutInfo.geometry;for(const p of c)this._locations.set(p.name,l++);const h=this._layoutInfo.opacity;if(h)for(const p of h)this._locations.set(p.name,l++);this._buildShaderInfo(e,i),this._propertyEncodingInfo=i}_buildVertexBufferLayout(e){const i={},r=this.geometryInfo();let n=r[0].stride;if(e.length===0)i.geometry=r;else{const s=[];let o=n;for(const a of e)n+=Nbt(a.type)*a.count;for(const a of r)s.push(new na(a.name,a.count,a.type,a.offset,n,a.normalized));for(const a of e)s.push(new na(a.name,a.count,a.type,o,n,a.normalized)),o+=Nbt(a.type)*a.count;i.geometry=s}this.opacityInfo()&&(i.opacity=this.opacityInfo()),this._layoutInfo=i,this._stride=n}_buildShaderInfo(e,i){let r=` `,n=` `;const s=[];for(const c of e)r+=`attribute ${this._getType(c.count)} ${c.name}; -`;const o=this.attributes(),a=this.attributesInfo();let l=-1;for(const c of o){l++;const{name:d,type:p,precisionFactor:y,isLayout:v}=a[c],S=y&&y!==1?" * "+1/y:"",{bytesPerElement:I,count:O}=wBe._encodingInfo[p],L=N=>`a_data_${N.dataIndex}${J9i(O,N.offset,I)}`;switch(this.getAtributeState(l)){case c6.UNIFORM:{const N=this._getType(O),G=`u_${d}`;s.push({name:G,type:N,getValue:(V,Y,X,te)=>{const re=v?V.getLayoutValue(c,Y):V.getPaintValue(c,Y);if(p===Ps.R16G16B16A16_DASHARRAY){const fe=V.getDashKey(re,V.getLayoutValue("line-cap",Y)),ge=te.getMosaicItemPosition(fe,!1);if(lt(ge))return null;const{tl:_e,br:Ie}=ge;return[_e[0],Ie[1],Ie[0],_e[1]]}if(p===Ps.R16G16B16A16_PATTERN){const fe=te.getMosaicItemPosition(re,!c.includes("line-"));if(lt(fe))return null;const{tl:ge,br:_e}=fe;return[ge[0],_e[1],_e[0],ge[1]]}if(p===Ps.R8G8B8A8_COLOR){const fe=re[3];return[fe*re[0],fe*re[1],fe*re[2],fe]}return re}}),r+=`uniform ${N} ${G}; -`,n+=`${N} ${d} = ${G}; -`}break;case c6.DATA_DRIVEN:{const N=L(i[c][0]);n+=`${this._getType(O)} ${d} = ${N}${S}; -`}break;case c6.INTERPOLATED_DATA_DRIVEN:{const N=`u_t_${d}`;s.push({name:N,type:"float",getValue:(Y,X,te,re)=>(v?Y.getLayoutProperty(c):Y.getPaintProperty(c)).interpolator.interpolationUniformValue(te,X)}),r+=`uniform float ${N}; -`;const G=L(i[c][0]),V=L(i[c][1]);n+=`${this._getType(O)} ${d} = mix(${G}${S}, ${V}${S}, ${N}); -`}}}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 i=255*e[3];return Um.i8888to32(e[0]*i,e[1]*i,e[2]*i,i)}_encodePattern(e,i,r){if(!r||!r.rect)return;const n=2,s=r.rect,o=r.width,a=r.height;i[e]=this._encodeShort(s.x+n,0),i[e]|=this._encodeShort(s.y+n+a,16),i[e+1]=this._encodeShort(s.x+n+o,0),i[e+1]|=this._encodeShort(s.y+n,16)}_encodeByte(e,i){return(255&e)<{switch(t){case Di.FLOAT:case Di.INT:case Di.UNSIGNED_INT:return 4;case Di.SHORT:case Di.UNSIGNED_SHORT:return 2;case Di.BYTE:case Di.UNSIGNED_BYTE:return 1}},J9i=(t,e,i)=>{const r=e/i;if(t===1)switch(r){case 0:return".x";case 1:return".y";case 2:return".z";case 3:return".w"}else if(t===2)switch(r){case 0:return".xy";case 1:return".yz";case 2:return".zw"}else if(t===3)switch(r){case 0:return".xyz";case 1:return".yzw"}return""};let jU=class i_e extends nF{constructor(e){super(e)}geometryInfo(){return i_e.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return i_e.ATTRIBUTES}attributesInfo(){return i_e.ATTRIBUTES_INFO}};jU.ATTRIBUTES=[],jU.GEOMETRY_LAYOUT=[new qo("a_pos",2,Di.BYTE,0,2)],jU.ATTRIBUTES_INFO={};let zU=class r_e extends nF{constructor(e){super(e)}geometryInfo(){return r_e.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return r_e.ATTRIBUTES}attributesInfo(){return r_e.ATTRIBUTES_INFO}};zU.ATTRIBUTES=["circle-radius","circle-color","circle-opacity","circle-stroke-width","circle-stroke-color","circle-stroke-opacity","circle-blur"],zU.GEOMETRY_LAYOUT=[new qo("a_pos",2,Di.SHORT,0,4)],zU.ATTRIBUTES_INFO={"circle-radius":{name:"radius",type:Ps.R8_UNSIGNED},"circle-color":{name:"color",type:Ps.R8G8B8A8_COLOR},"circle-opacity":{name:"opacity",type:Ps.R8_UNSIGNED,precisionFactor:100},"circle-stroke-width":{name:"stroke_width",type:Ps.R8_UNSIGNED,precisionFactor:4},"circle-stroke-color":{name:"stroke_color",type:Ps.R8G8B8A8_COLOR},"circle-stroke-opacity":{name:"stroke_opacity",type:Ps.R8_UNSIGNED,precisionFactor:100},"circle-blur":{name:"blur",type:Ps.R8_UNSIGNED,precisionFactor:32}};let HU=class n_e extends nF{constructor(e){super(e)}geometryInfo(){return n_e.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return n_e.ATTRIBUTES}attributesInfo(){return n_e.ATTRIBUTES_INFO}};HU.ATTRIBUTES=["fill-color","fill-opacity","fill-pattern"],HU.GEOMETRY_LAYOUT=[new qo("a_pos",2,Di.SHORT,0,4)],HU.ATTRIBUTES_INFO={"fill-color":{name:"color",type:Ps.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:Ps.R8_UNSIGNED,precisionFactor:100},"fill-pattern":{name:"tlbr",type:Ps.R16G16B16A16_PATTERN,isOptional:!0}};let bE=class cH extends nF{constructor(e,i){super(e),this._usefillColor=i}geometryInfo(){return cH.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return this._usefillColor?cH.ATTRIBUTES_FILL:cH.ATTRIBUTES_OUTLINE}attributesInfo(){return this._usefillColor?cH.ATTRIBUTES_INFO_FILL:cH.ATTRIBUTES_INFO_OUTLINE}};bE.ATTRIBUTES_OUTLINE=["fill-outline-color","fill-opacity"],bE.ATTRIBUTES_FILL=["fill-color","fill-opacity"],bE.GEOMETRY_LAYOUT=[new qo("a_pos",2,Di.SHORT,0,8),new qo("a_offset",2,Di.BYTE,4,8),new qo("a_xnormal",2,Di.BYTE,6,8)],bE.ATTRIBUTES_INFO_OUTLINE={"fill-outline-color":{name:"color",type:Ps.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:Ps.R8_UNSIGNED,precisionFactor:100}},bE.ATTRIBUTES_INFO_FILL={"fill-color":{name:"color",type:Ps.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:Ps.R8_UNSIGNED,precisionFactor:100}};let WU=class s_e extends nF{constructor(e){super(e)}geometryInfo(){return s_e.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return s_e.ATTRIBUTES}attributesInfo(){return s_e.ATTRIBUTES_INFO}};WU.ATTRIBUTES=["line-blur","line-color","line-gap-width","line-offset","line-opacity","line-width","line-pattern","line-dasharray"],WU.GEOMETRY_LAYOUT=[new qo("a_pos",2,Di.SHORT,0,16),new qo("a_extrude_offset",4,Di.BYTE,4,16),new qo("a_dir_normal",4,Di.BYTE,8,16),new qo("a_accumulatedDistance",2,Di.UNSIGNED_SHORT,12,16)],WU.ATTRIBUTES_INFO={"line-width":{name:"width",type:Ps.R8_UNSIGNED,precisionFactor:2},"line-gap-width":{name:"gap_width",type:Ps.R8_UNSIGNED,precisionFactor:2},"line-offset":{name:"offset",type:Ps.R8_SIGNED,precisionFactor:2},"line-color":{name:"color",type:Ps.R8G8B8A8_COLOR},"line-opacity":{name:"opacity",type:Ps.R8_UNSIGNED,precisionFactor:100},"line-blur":{name:"blur",type:Ps.R8_UNSIGNED,precisionFactor:4},"line-pattern":{name:"tlbr",type:Ps.R16G16B16A16_PATTERN,isOptional:!0},"line-dasharray":{name:"tlbr",type:Ps.R16G16B16A16_DASHARRAY,isOptional:!0}};const J1t=[new qo("a_pos",2,Di.SHORT,0,16),new qo("a_vertexOffset",2,Di.SHORT,4,16),new qo("a_texAngleRange",4,Di.UNSIGNED_BYTE,8,16),new qo("a_levelInfo",4,Di.UNSIGNED_BYTE,12,16)],Z1t=[new qo("a_opacityInfo",1,Di.UNSIGNED_BYTE,0,1)];let tZ=class xBe extends nF{constructor(e){super(e)}geometryInfo(){return J1t}opacityInfo(){return Z1t}attributes(){return xBe.ATTRIBUTES}attributesInfo(){return xBe.ATTRIBUTES_INFO}};tZ.ATTRIBUTES=["icon-color","icon-opacity","icon-halo-blur","icon-halo-color","icon-halo-width","icon-size"],tZ.ATTRIBUTES_INFO={"icon-color":{name:"color",type:Ps.R8G8B8A8_COLOR},"icon-opacity":{name:"opacity",type:Ps.R8_UNSIGNED,precisionFactor:100},"icon-halo-color":{name:"halo_color",type:Ps.R8G8B8A8_COLOR},"icon-halo-width":{name:"halo_width",type:Ps.R8_UNSIGNED,precisionFactor:4},"icon-halo-blur":{name:"halo_blur",type:Ps.R8_UNSIGNED,precisionFactor:4},"icon-size":{name:"size",type:Ps.R8_UNSIGNED,precisionFactor:32,isLayout:!0}};let iZ=class SBe extends nF{constructor(e){super(e)}geometryInfo(){return J1t}opacityInfo(){return Z1t}attributes(){return SBe.ATTRIBUTES}attributesInfo(){return SBe.ATTRIBUTES_INFO}};iZ.ATTRIBUTES=["text-color","text-opacity","text-halo-blur","text-halo-color","text-halo-width","text-size"],iZ.ATTRIBUTES_INFO={"text-color":{name:"color",type:Ps.R8G8B8A8_COLOR},"text-opacity":{name:"opacity",type:Ps.R8_UNSIGNED,precisionFactor:100},"text-halo-color":{name:"halo_color",type:Ps.R8G8B8A8_COLOR},"text-halo-width":{name:"halo_width",type:Ps.R8_UNSIGNED,precisionFactor:4},"text-halo-blur":{name:"halo_blur",type:Ps.R8_UNSIGNED,precisionFactor:4},"text-size":{name:"size",type:Ps.R8_UNSIGNED,isLayout:!0}};const Q1t={kind:"null"},gp={kind:"number"},vb={kind:"string"},my={kind:"boolean"},sO={kind:"color"},pfe={kind:"object"},oO={kind:"value"};function rZ(t,e){return{kind:"array",itemType:t,n:e}}const Z9i=[Q1t,gp,vb,my,sO,pfe,rZ(oO)];function qU(t){if(t.kind==="array"){const e=qU(t.itemType);return typeof t.n=="number"?`array<${e}, ${t.n}>`:t.itemType.kind==="value"?"array":`array<${e}>`}return t.kind}function ffe(t){if(t===null)return Q1t;if(typeof t=="string")return vb;if(typeof t=="boolean")return my;if(typeof t=="number")return gp;if(t instanceof $r)return sO;if(Array.isArray(t)){let e;for(const i of t){const r=ffe(i);if(e){if(e!==r){e=oO;break}}else e=r}return rZ(e||oO,t.length)}return typeof t=="object"?pfe:oO}function R4e(t,e){if(e.kind==="array")return t.kind==="array"&&(t.n===0&&t.itemType.kind==="value"||R4e(t.itemType,e.itemType))&&(typeof e.n!="number"||e.n===t.n);if(e.kind==="value"){for(const i of Z9i)if(R4e(t,i))return!0}return e.kind===t.kind}function M4e(t){if(t===null)return"";const e=typeof t;return e==="string"?t:e==="number"||e==="boolean"?String(t):t instanceof $r?t.toString():JSON.stringify(t)}let Q9i=class{constructor(e){this._parent=e,this._vars={}}add(e,i){this._vars[e]=i}get(e){return this._vars[e]?this._vars[e]:this._parent?this._parent.get(e):null}},eBi=class ZLt{constructor(){this.type=oO}static parse(e){if(e.length>1)throw new Error('"id" does not expect arguments');return new ZLt}evaluate(e,i){return e?.id}},tBi=class QLt{constructor(){this.type=vb}static parse(e){if(e.length>1)throw new Error('"geometry-type" does not expect arguments');return new QLt}evaluate(e,i){if(!e)return null;switch(e.type){case fy.Point:return"Point";case fy.LineString:return"LineString";case fy.Polygon:return"Polygon";default:return null}}},iBi=class e5t{constructor(){this.type=pfe}static parse(e){if(e.length>1)throw new Error('"properties" does not expect arguments');return new e5t}evaluate(e,i){return e?.values}},ebt=class t5t{constructor(){this.type=gp}static parse(e){if(e.length>1)throw new Error('"zoom" does not expect arguments');return new t5t}evaluate(e,i){return i}},ix=class i5t{constructor(e,i,r){this._lhs=e,this._rhs=i,this._compare=r,this.type=my}static parse(e,i,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 i5t(ha(e[1],i),ha(e[2],i),r)}evaluate(e,i){return this._compare(this._lhs.evaluate(e,i),this._rhs.evaluate(e,i))}},rBi=class extends ix{static parse(e,i){return ix.parse(e,i,(r,n)=>r===n)}},nBi=class extends ix{static parse(e,i){return ix.parse(e,i,(r,n)=>r!==n)}},sBi=class extends ix{static parse(e,i){return ix.parse(e,i,(r,n)=>rr<=n)}},aBi=class extends ix{static parse(e,i){return ix.parse(e,i,(r,n)=>r>n)}},lBi=class extends ix{static parse(e,i){return ix.parse(e,i,(r,n)=>r>=n)}},uBi=class r5t{constructor(e){this._arg=e,this.type=my}static parse(e,i){if(e.length!==2)throw new Error('"!" expects 1 argument');return new r5t(ha(e[1],i))}evaluate(e,i){return!this._arg.evaluate(e,i)}},cBi=class n5t{constructor(e){this._args=e,this.type=my}static parse(e,i){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=ha(e[2],i,gp);let a;n==="interpolate-hcl"||n==="interpolate-lab"?a=sO:r&&r.kind!=="value"&&(a=r);const l=[];for(let c=3;c=d)throw new Error(`"${n}" requires strictly ascending stop inputs`);const p=ha(e[c+1],i,a);a||(a=p.type),l.push([d,p])}if(a&&a!==sO&&a!==gp&&(a.kind!=="array"||a.itemType!==gp))throw new Error(`"${n}" cannot interpolate type ${qU(a)}`);return new R8(n,a,s,o,l)}evaluate(e,i){const r=this._stops;if(r.length===1)return r[0][1].evaluate(e,i);const n=this.input.evaluate(e,i);if(n<=r[0][0])return r[0][1].evaluate(e,i);if(n>=r[r.length-1][0])return r[r.length-1][1].evaluate(e,i);let s=0;for(;++sVm(p,d[y],l));if(this.type.kind==="color"&&c instanceof $r&&d instanceof $r){const p=new $r(c),y=new $r(d);return new $r([Vm(p.r,y.r,l),Vm(p.g,y.g,l),Vm(p.b,y.b,l),Vm(p.a,y.a,l)])}if(this.type.kind==="number"&&typeof c=="number"&&typeof d=="number")return Vm(c,d,l);throw new Error(`"${this._operator}" cannot interpolate type ${qU(this.type)}`)}if(this._operator==="interpolate-hcl"){const p=eae(c),y=eae(d),v=y.h-p.h,S=eM({h:p.h+l*(v>180||v<-180?v-360*Math.round(v/360):v),c:Vm(p.c,y.c,l),l:Vm(p.l,y.l,l)});return new $r({a:Vm(c.a,d.a,l),...S})}if(this._operator==="interpolate-lab"){const p=Qoe(c),y=Qoe(d),v=eM({l:Vm(p.l,y.l,l),a:Vm(p.a,y.a,l),b:Vm(p.b,y.b,l)});return new $r({a:Vm(c.a,d.a,l),...v})}throw new Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(e,i){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,i,r,n){const s=n-r;if(s===0)return 0;const o=e-r;return i===1?o/s:(i**o-1)/(i**s-1)}},gBi=class c5t{constructor(e,i,r){this.type=e,this._input=i,this._stops=r}static parse(e,i){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=ha(e[1],i,gp);let n;const s=[];s.push([-1/0,ha(e[2],i)]);for(let o=3;o=a)throw new Error('"step" requires strictly ascending stop inputs');const l=ha(e[o+1],i);n||(n=l.type),s.push([a,l])}return new c5t(n,r,s)}evaluate(e,i){const r=this._stops;if(r.length===1)return r[0][1].evaluate(e,i);const n=this._input.evaluate(e,i);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]}},bBi=class CBe{constructor(e,i){this._key=e,this._obj=i,this.type=oO}static parse(e,i){let r,n;switch(e.length){case 2:return r=ha(e[1],i),new CBe(r);case 3:return r=ha(e[1],i),n=ha(e[2],i),new CBe(r,n);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(e,i){const r=this._key.evaluate(e,i);return this._obj?this._obj.evaluate(e,i)[r]:e?.values[r]}},wBi=class TBe{constructor(e,i){this._key=e,this._obj=i,this.type=my}static parse(e,i){let r,n;switch(e.length){case 2:return r=ha(e[1],i),new TBe(r);case 3:return r=ha(e[1],i),n=ha(e[2],i),new TBe(r,n);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(e,i){const r=this._key.evaluate(e,i);return this._obj?r in this._obj.evaluate(e,i):!!e?.values[r]}},xBi=class f5t{constructor(e,i){this._key=e,this._vals=i,this.type=my}static parse(e,i){if(e.length!==3)throw new Error('"in" expects 2 arguments');return new f5t(ha(e[1],i),ha(e[2],i))}evaluate(e,i){const r=this._key.evaluate(e,i);return this._vals.evaluate(e,i).includes(r)}},SBi=class EBe{constructor(e,i,r){this._item=e,this._array=i,this._from=r,this.type=gp}static parse(e,i){if(e.length<3||e.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=ha(e[1],i),n=ha(e[2],i);if(e.length===4){const s=ha(e[3],i,gp);return new EBe(r,n,s)}return new EBe(r,n)}evaluate(e,i){const r=this._item.evaluate(e,i),n=this._array.evaluate(e,i);if(this._from){const s=this._from.evaluate(e,i);if(s!==Math.floor(s))throw new Error('"index-of" index must be an integer');return n.indexOf(r,s)}return n.indexOf(r)}},CBi=class m5t{constructor(e){this._arg=e,this.type=gp}static parse(e,i){if(e.length!==2)throw new Error('"length" expects 2 arguments');const r=ha(e[1],i);return new m5t(r)}evaluate(e,i){const r=this._arg.evaluate(e,i);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}},TBi=class IBe{constructor(e,i,r,n){this.type=e,this._array=i,this._from=r,this._to=n}static parse(e,i){if(e.length<3||e.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=ha(e[1],i),n=ha(e[2],i,gp);if(n.type!==gp)throw new Error('"slice" index must return a number');if(e.length===4){const s=ha(e[3],i,gp);if(s.type!==gp)throw new Error('"slice" index must return a number');return new IBe(r.type,r,n,s)}return new IBe(r.type,r,n)}evaluate(e,i){const r=this._array.evaluate(e,i);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,i);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,i);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)}},EBi=class g5t{constructor(){this.type=my}static parse(e){if(e.length!==1)throw new Error('"has-id" expects no arguments');return new g5t}evaluate(e,i){return e&&e.id!==void 0}},_b=class y5t{constructor(e,i){this._args=e,this._calculate=i,this.type=gp}static parse(e,i,r){const n=e.slice(1).map(s=>ha(s,i));return new y5t(n,r)}evaluate(e,i){let r;return this._args&&(r=this._args.map(n=>n.evaluate(e,i))),this._calculate(r)}},IBi=class extends _b{static parse(e,i){switch(e.length){case 2:return _b.parse(e,i,r=>-r[0]);case 3:return _b.parse(e,i,r=>r[0]-r[1]);default:throw new Error('"-" expects 1 or 2 arguments')}}},ABi=class extends _b{static parse(e,i){return _b.parse(e,i,r=>{let n=1;for(const s of r)n*=s;return n})}},PBi=class extends _b{static parse(e,i){if(e.length===3)return _b.parse(e,i,r=>r[0]/r[1]);throw new Error('"/" expects 2 arguments')}},OBi=class extends _b{static parse(e,i){if(e.length===3)return _b.parse(e,i,r=>r[0]%r[1]);throw new Error('"%" expects 2 arguments')}},RBi=class extends _b{static parse(e,i){if(e.length===3)return _b.parse(e,i,r=>r[0]**r[1]);throw new Error('"^" expects 1 or 2 arguments')}},MBi=class extends _b{static parse(e,i){return _b.parse(e,i,r=>{let n=0;for(const s of r)n+=s;return n})}},im=class ABe{constructor(e,i){this._args=e,this._calculate=i,this.type=gp}static parse(e,i){const r=e.slice(1).map(n=>ha(n,i));return new ABe(r,ABe.ops[e[0]])}evaluate(e,i){let r;return this._args&&(r=this._args.map(n=>n.evaluate(e,i))),this._calculate(r)}};im.ops={abs:t=>Math.abs(t[0]),acos:t=>Math.acos(t[0]),asin:t=>Math.asin(t[0]),atan:t=>Math.atan(t[0]),ceil:t=>Math.ceil(t[0]),cos:t=>Math.cos(t[0]),e:()=>Math.E,floor:t=>Math.floor(t[0]),ln:t=>Math.log(t[0]),ln2:()=>Math.LN2,log10:t=>Math.log(t[0])/Math.LN10,log2:t=>Math.log(t[0])/Math.LN2,max:t=>Math.max(...t),min:t=>Math.min(...t),pi:()=>Math.PI,round:t=>Math.round(t[0]),sin:t=>Math.sin(t[0]),sqrt:t=>Math.sqrt(t[0]),tan:t=>Math.tan(t[0])};class D4e{constructor(e){this._args=e,this.type=vb}static parse(e,i){return new D4e(e.slice(1).map(r=>ha(r,i)))}evaluate(e,i){return this._args.map(r=>r.evaluate(e,i)).join("")}}class YU{constructor(e,i){this._arg=e,this._calculate=i,this.type=vb}static parse(e,i){if(e.length!==2)throw new Error(`${e[0]} expects 1 argument`);const r=ha(e[1],i);return new YU(r,YU.ops[e[0]])}evaluate(e,i){return this._calculate(this._arg.evaluate(e,i))}}YU.ops={downcase:t=>t.toLowerCase(),upcase:t=>t.toUpperCase()};class F4e{constructor(e){this._args=e,this.type=sO}static parse(e,i){if(e.length!==4)throw new Error('"rgb" expects 3 arguments');const r=e.slice(1).map(n=>ha(n,i));return new F4e(r)}evaluate(e,i){const r=this._validate(this._args[0].evaluate(e,i)),n=this._validate(this._args[1].evaluate(e,i)),s=this._validate(this._args[2].evaluate(e,i));return new $r({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)}}class L4e{constructor(e){this._args=e,this.type=sO}static parse(e,i){if(e.length!==5)throw new Error('"rgba" expects 4 arguments');const r=e.slice(1).map(n=>ha(n,i));return new L4e(r)}evaluate(e,i){const r=this._validate(this._args[0].evaluate(e,i)),n=this._validate(this._args[1].evaluate(e,i)),s=this._validate(this._args[2].evaluate(e,i)),o=this._validateAlpha(this._args[3].evaluate(e,i));return new $r({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}}let DBi=class v5t{constructor(e){this._color=e,this.type=rZ(gp,4)}static parse(e,i){if(e.length!==2)throw new Error('"to-rgba" expects 1 argument');const r=ha(e[1],i);return new v5t(r)}evaluate(e,i){return new $r(this._color.evaluate(e,i)).toRgba()}};class h6{constructor(e,i){this.type=e,this._args=i}static parse(e,i){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=vb;break;case"number":n=gp;break;case"boolean":n=my;break;default:throw new Error('"array" type argument must be string, number or boolean')}s++}else n=oO;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=rZ(n,a)}else switch(r){case"string":n=vb;break;case"number":n=gp;break;case"boolean":n=my;break;case"object":n=pfe}const o=[];for(;s":aBi,">=":lBi,all:cBi,any:hBi,case:pBi,coalesce:fBi,match:mBi,within:null,interpolate:mfe,"interpolate-hcl":mfe,"interpolate-lab":mfe,step:gBi,let:yBi,var:vBi,concat:D4e,downcase:YU,"is-supported-script":null,"resolved-locale":null,upcase:YU,rgb:F4e,rgba:L4e,"to-rgba":DBi,"-":IBi,"*":ABi,"/":PBi,"%":OBi,"^":RBi,"+":MBi,abs:im,acos:im,asin:im,atan:im,ceil:im,cos:im,e:im,floor:im,ln:im,ln2:im,log10:im,log2:im,max:im,min:im,pi:im,round:im,sin:im,sqrt:im,tan:im,zoom:ebt,"heatmap-density":null,"has-id":EBi,none:dBi};let FBi=class Vb{constructor(e){this._expression=e}filter(e,i){if(!this._expression)return!0;try{return this._expression.evaluate(e,i)}catch(r){return console.log(r.message),!0}}static createFilter(e){if(!e)return null;this.isLegacyFilter(e)&&(e=this.convertLegacyFilter(e));try{const i=ha(e,null,my);return new Vb(i)}catch(i){return console.log(i.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 i=1;i":case"<":case">=":case"<=":return Vb.convertComparison(i,e[1],e[2]);case"in":return Vb.convertIn(e[1],e.slice(2));case"!in":return Vb.negate(Vb.convertIn(e[1],e.slice(2)));case"any":case"all":case"none":return Vb.convertCombining(i,e.slice(1));case"has":return Vb.convertHas(e[1]);case"!has":return Vb.negate(Vb.convertHas(e[1]));default:throw new Error("Unexpected legacy filter.")}}static convertComparison(e,i,r){switch(i){case"$type":return[e,["geometry-type"],r];case"$id":return[e,["id"],r];default:return[e,["get",i],r]}}static convertIn(e,i){switch(e){case"$type":return["in",["geometry-type"],["literal",i]];case"$id":return["in",["id"],["literal",i]];default:return["in",["get",e],["literal",i]]}}static convertHas(e){switch(e){case"$type":return!0;case"$id":return["has-id"];default:return["has",e]}}static convertCombining(e,i){return[e].concat(i.map(this.convertLegacyFilter))}static negate(e){return["!",e]}},ibt=class _5t{constructor(e,i){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(i==null&&(i=e.default),Array.isArray(i)&&i.length>0&&tbt[i[0]]){const s={number:gp,color:sO,string:vb,boolean:my,enum:vb};try{const o=e.type==="array"?rZ(s[e.value]||oO,e.length):s[e.type],a=ha(i,null,o);this.getValue=this._buildExpression(a,e),this.isDataDriven=!0,a instanceof mfe&&a.input instanceof ebt&&(this.interpolator=a)}catch(o){console.log(o.message),this.getValue=this._buildSimple(e.default)}return}r&&i.type==="interval"&&(r=!1);const n=i&&i.stops&&i.stops.length>0;if(n)for(const s of i.stops)s[1]=this._validate(s[1],e);if(this.isDataDriven=!!i&&!!i.property,this.isDataDriven)if(i.default!==void 0&&(i.default=this._validate(i.default,e)),n)switch(i.type){case"identity":this.getValue=this._buildIdentity(i,e);break;case"categorical":this.getValue=this._buildCategorical(i,e);break;default:this.getValue=r?this._buildInterpolate(i,e):this._buildInterval(i,e)}else this.getValue=this._buildIdentity(i,e);else n?this.getValue=r?this._buildZoomInterpolate(i):this._buildZoomInterval(i):(i=this._validate(i,e),this.getValue=this._buildSimple(i))}_validate(e,i){if(i.type==="number"){if(ei.maximum)return i.maximum}else i.type==="color"?e=_5t._parseColor(e):i.type==="enum"?typeof e=="string"&&(e=i.values.indexOf(e)):i.type==="array"&&i.value==="enum"?e=e.map(r=>typeof r=="string"?i.values.indexOf(r):r):i.type==="string"&&(e=M4e(e));return e}_buildSimple(e){return()=>e}_buildExpression(e,i){return(r,n)=>{try{const s=e.evaluate(n,r);return s===void 0?i.default:this._validate(s,i)}catch(s){return console.log(s.message),i.default}}}_buildIdentity(e,i){return(r,n)=>{let s;return n&&(s=n.values[e.property]),s!==void 0&&(s=this._validate(s,i)),s??(e.default!==void 0?e.default:i.default)}}_buildCategorical(e,i){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:i.default}}_buildInterval(e,i){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:i.default}}_buildInterpolate(e,i){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:i.default}}_buildZoomInterpolate(e){return i=>this._interpolate(i,e.stops,e.base||1)}_buildZoomInterval(e){return i=>this._interval(i,e.stops)}_categorical(e,i){const r=i.length;for(let n=0;n0){c&&(S=c.getValue(s,I));for(const te of S){let re=r[te];re||(re=r[te]=new Set);for(let fe=0;fep.getGlyphItems(Ne));if(G=new C1t(ke,_e,Ie,ge,te,re,fe).getShaping(Y,L.rtl,X),G&&G.length>0){let Ne=1e30,J=-1e30;for(const he of G)Ne=Math.min(Ne,he.x),J=Math.max(J,he.x);V=(J-Ne+2*gE)*S*JJ}}for(let X of L.geometry){const te=[];if(n===nO.LINE){if(G?.length&&d?.size){const re=d.size*JJ*(2+Math.min(2,4*Math.abs(d.offset[1])));X=yC._smoothVertices(X,re)}yC._pushAnchors(te,X,o,V)}else n===nO.LINE_CENTER?yC._pushCenterAnchor(te,X):L.feature.type===fy.Polygon?yC._pushCentroid(te,X):te.push(new nfe(X[0].x,X[0].y));for(const re of te){if(re.x<0||re.x>E1t||re.y<0||re.y>E1t||s&&V>0&&d?.rotationAlignment===Ju.MAP&&!yC._honorsTextMaxAngle(X,re,V,I,O))continue;const fe={shaping:G,line:X,iconMosaicItem:N,anchor:re,symbolFeature:L,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};v.push(fe),this._processFeature(fe,c,d)}}}v.sort(NBi),this._addPlacedGlyphs(),this._symbolInstances=v}serialize(){let e=11;e+=this.layerUIDs.length,e+=3*this.markerPageMap.size,e+=3*this.glyphsPageMap.size,e+=yC._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;const i=new Uint32Array(e),r=new Int32Array(i.buffer),n=new Float32Array(i.buffer);let s=0;i[s++]=this.type,i[s++]=this.layerUIDs.length;for(let o=0;on in i?i[n]:"")}_processFeature(e,i,r){const{line:n,iconMosaicItem:s,shaping:o,anchor:a}=e,l=this.zoom,c=this.layer,d=!!s;let p=!0;d&&(p=i?.optional||!s);const y=o&&o.length>0,v=!y||r?.optional;let S,I;if(d&&(S=this._placementEngine.getIconPlacement(a,s,i)),(S||p)&&(y&&(I=this._placementEngine.getTextPlacement(a,o,n,r)),I||v)){if(S&&I||(v||p?v||I?p||S||(I=null):S=null:(S=null,I=null)),I){const O=c.hasDataDrivenText?c.textMaterial.encodeAttributes(e.symbolFeature.feature,l,c):null;if(this._storePlacedGlyphs(e,I.shapes,l,r.rotationAlignment,O),I.textColliders){e.textColliders=I.textColliders;for(const L of I.textColliders){L.minLod=Math.max(l+iF(L.minLod),0),L.maxLod=Math.min(l+iF(L.maxLod),25);const N=L.angle;if(N){const G=Math.cos(N),V=Math.sin(N),Y=L.dxPixels*G-L.dyPixels*V,X=L.dxPixels*V+L.dyPixels*G,te=(L.dxPixels+L.width)*G-L.dyPixels*V,re=(L.dxPixels+L.width)*V+L.dyPixels*G,fe=L.dxPixels*G-(L.dyPixels+L.height)*V,ge=L.dxPixels*V+(L.dyPixels+L.height)*G,_e=(L.dxPixels+L.width)*G-(L.dyPixels+L.height)*V,Ie=(L.dxPixels+L.width)*V+(L.dyPixels+L.height)*G,ke=Math.min(Y,te,fe,_e),Ne=Math.max(Y,te,fe,_e),J=Math.min(X,re,ge,Ie),he=Math.max(X,re,ge,Ie);L.dxPixels=ke,L.dyPixels=J,L.width=Ne-ke,L.height=he-J}}}}if(S){const O=c.hasDataDrivenIcon?c.iconMaterial.encodeAttributes(e.symbolFeature.feature,l,c):null;if(this._addPlacedIcons(e,S.shapes,l,s.page,i.rotationAlignment===Ju.VIEWPORT,O),S.iconColliders){e.iconColliders=S.iconColliders;for(const L of S.iconColliders){L.minLod=Math.max(l+iF(L.minLod),0),L.maxLod=Math.min(l+iF(L.maxLod),25);const N=L.angle;if(N){const G=Math.cos(N),V=Math.sin(N),Y=L.dxPixels*G-L.dyPixels*V,X=L.dxPixels*V+L.dyPixels*G,te=(L.dxPixels+L.width)*G-L.dyPixels*V,re=(L.dxPixels+L.width)*V+L.dyPixels*G,fe=L.dxPixels*G-(L.dyPixels+L.height)*V,ge=L.dxPixels*V+(L.dyPixels+L.height)*G,_e=(L.dxPixels+L.width)*G-(L.dyPixels+L.height)*V,Ie=(L.dxPixels+L.width)*V+(L.dyPixels+L.height)*G,ke=Math.min(Y,te,fe,_e),Ne=Math.max(Y,te,fe,_e),J=Math.min(X,re,ge,Ie),he=Math.max(X,re,ge,Ie);L.dxPixels=ke,L.dyPixels=J,L.width=Ne-ke,L.height=he-J}}}}}}_addPlacedIcons(e,i,r,n,s,o){const a=Math.max(r-1,0),l=this._iconVertexBuffer,c=this._iconIndexBuffer,d=this._markerMap;for(const p of i){const y=s?0:Math.max(r+iF(p.minzoom),a),v=s?25:Math.min(r+iF(p.maxzoom),25);if(v<=y)continue;const S=p.tl,I=p.tr,O=p.bl,L=p.br,N=p.mosaicRect,G=p.labelAngle,V=p.minAngle,Y=p.maxAngle,X=p.anchor,te=l.index,re=N.x,fe=N.y,ge=re+N.width,_e=fe+N.height,Ie=l.index;l.add(X.x,X.y,S.x,S.y,re,fe,G,V,Y,y,v,o),l.add(X.x,X.y,I.x,I.y,ge,fe,G,V,Y,y,v,o),l.add(X.x,X.y,O.x,O.y,re,_e,G,V,Y,y,v,o),l.add(X.x,X.y,L.x,L.y,ge,_e,G,V,Y,y,v,o),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===Ie?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([Ie,4]),c.add(te+0,te+1,te+2),c.add(te+1,te+2,te+3),d.has(n)?d.get(n)[1]+=6:d.set(n,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const e=this._textVertexBuffer,i=this._textIndexBuffer,r=this._glyphMap;for(const[n,s]of this._glyphBufferDataStorage)for(const o of s){const a=e.index,l=o.symbolInstance,c=o.ddAttributes,d=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,c),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,c),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,c),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,c),l.textVertexRanges.length>0&&l.textVertexRanges[0][0]+l.textVertexRanges[0][1]===d?l.textVertexRanges[0][1]+=4:l.textVertexRanges.push([d,4]),i.add(a+0,a+1,a+2),i.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,i,r,n,s){const o=Math.max(r-1,0),a=n===Ju.VIEWPORT;let l,c,d,p,y,v,S,I,O,L,N;for(const G of i)l=a?0:Math.max(r+iF(G.minzoom),o),c=a?25:Math.min(r+iF(G.maxzoom),25),!(c<=l)&&(d=G.tl,p=G.tr,y=G.bl,v=G.br,S=G.labelAngle,I=G.minAngle,O=G.maxAngle,L=G.anchor,N=G.mosaicRect,this._glyphBufferDataStorage.has(G.page)||this._glyphBufferDataStorage.set(G.page,[]),this._glyphBufferDataStorage.get(G.page).push({glyphAnchor:[L.x,L.y],tl:[d.x,d.y],tr:[p.x,p.y],bl:[y.x,y.y],br:[v.x,v.y],xmin:N.x,ymin:N.y,xmax:N.x+N.width,ymax:N.y+N.height,labelAngle:S,minAngle:I,maxAngle:O,minLod:l,maxLod:c,placementLod:o,symbolInstance:e,ddAttributes:s}))}static _pushAnchors(e,i,r,n){r+=n;let s=0;const o=i.length-1;for(let y=0;y-a;){if(--c,c<0)return!1;o-=Xo.distance(e[c],l),l=e[c]}o+=Xo.distance(e[c],e[c+1]);const d=[];let p=0;const y=e.length;for(;os;)p-=d.shift().deviation;if(Math.abs(p)>n)return!1;o+=Xo.distance(S,O),c=I}return!0}static _smoothVertices(e,i){if(i<=0)return e;let r=e.length;if(r<3)return e;const n=[];let s=0,o=0;n.push(0);for(let I=1;I0&&(s+=O,n.push(s),o++,o!==I&&(e[o]=e[I]))}if(r=o+1,r<3)return e;i=Math.min(i,.2*s);const a=e[0].x,l=e[0].y,c=e[r-1].x,d=e[r-1].y,p=Xo.sub(e[0],e[1]);p.normalize(),e[0].x+=i*p.x,e[0].y+=i*p.y,p.assignSub(e[r-1],e[r-2]),p.normalize(),e[r-1].x+=i*p.x,e[r-1].y+=i*p.y,n[0]-=i,n[r-1]+=i;const y=[];y.push(new Xo(a,l));const v=1e-6,S=.5*i;for(let I=1;I=0;G--){const V=S+n[G+1]-n[I];if(V<0)break;const Y=n[G+1]-n[G],X=n[I]-n[G]4096&&(p=4096),p<0&&(p=0),y>4096&&(y=4096),y<0&&(y=0);for(let v=1;v4096&&(S=4096),S<0&&(S=0),I>4096&&(I=4096),I<0&&(I=0),O>4096&&(O=4096),O<0&&(O=0),L>4096&&(L=4096),L<0&&(L=0);const N=(S-p)*(L-y)-(O-p)*(I-y);l+=N*(p+S+O),c+=N*(y+I+L),d+=N}l/=3*d,c/=3*d,isNaN(l)||isNaN(c)||e.push(new nfe(l,c))}};ubt._bidiEngine=new U1t;var aO;(function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.NO_DATA=1]="NO_DATA",t[t.READY=2]="READY",t[t.MODIFIED=3]="MODIFIED",t[t.INVALID=4]="INVALID"})(aO||(aO={}));const $Bi=8,BBi=14,GBi=5;let VBi=class{constructor(e,i,r,n,s){if(this._pbfTiles={},this._tileClippers={},this._client=r,this._tile=i,s){this._styleLayerUIDs=new Set;for(const d of s)this._styleLayerUIDs.add(d)}this._styleRepository=n,this._layers=this._styleRepository?.layers??[];const[o,a,l]=i.tileKey.split("/").map(parseFloat);this._level=o;const c=$Bi+Math.max((this._level-BBi)*GBi,0);for(const d of Object.keys(e)){const p=e[d];if(this._pbfTiles[d]=new z5(new Uint8Array(p.protobuff),new DataView(p.protobuff)),p.refKey){const[y]=p.refKey.split("/").map(parseFloat),v=o-y;if(v>0){const S=(1<{o.has(d)||(s.push({name:d,repeat:p}),o.add(d))},l={};for(const d of n)d.getResources(d.tileClipper,a,l);if(this._tile.status===aO.INVALID)return[];const c=this._fetchResources(s,l,e);return Promise.all([...c,i]).then(()=>this._processFeatures(r.returnedBuckets))}_initialize(e){return{signal:e&&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:i,layers:r,zoom:n,sourceNameToTileClipper:s,sourceNameToUniqueSourceLayerBuckets:o,sourceNameToUniqueSourceLayers:a,returnedBuckets:l,layerIdToBucket:c,referencerUIDToReferencedId:d}=e;for(let p=r.length-1;p>=0;p--){const y=r[p];if(!this._canParseStyleLayer(y.uid)||y.minzoom&&n=y.maxzoom||y.type===ul.BACKGROUND||!i[y.source]||!s[y.source])continue;const v=i[y.source],S=s[y.source],I=y.sourceLayer,O=v[I];if(O){let L=a[y.source];if(L||(L=a[y.source]=new Set),L.add(y.sourceLayer),y.refLayerId)d.set(y.uid,y.refLayerId);else{const N=this._createBucket(y);if(N){N.layerUIDs=[y.uid],N.layerExtent=O.extent,N.tileClipper=S;let G=o[y.source];G||(G=o[y.source]={});let V=G[I];V||(V=G[I]=[]),V.push(N),l.push(N),c[y.id]=N}}}}}_linkReferences(e){const{layerIdToBucket:i,referencerUIDToReferencedId:r}=e;r.forEach((n,s)=>{i[n]&&i[n].layerUIDs.push(s)})}_filterFeatures(e){const{signal:i,sourceNameToTileData:r,sourceNameToUniqueSourceLayerBuckets:n,sourceNameToUniqueSourceLayers:s}=e,o=10*this._level,a=10*(this._level+1),l=[],c=[];for(const d of Object.keys(s))s[d].forEach(p=>{l.push(p),c.push(d)});for(let d=0;d=a)continue;const V=N._maxzoom;if(V&&V<=o)continue}for(const G of S)G.pushFeature(L)}}}_fetchResources(e,i,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 i){const c=i[l];c.size>0&&(a=s.fetchGlyphs(this._tile.tileKey,l,c,this._client,r),n.push(a))}return n}_processFeatures(e){const i=e.filter(r=>r.hasFeatures()||this._canParseStyleLayer(r.layer.uid));for(const r of i)r.processFeatures(r.tileClipper);return i}_parseTileData(e){const i={};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 J8i(o);o.release(),s[a.name]=a;break}default:n.skip()}i[r]=s}return i}_createBucket(e){switch(e.type){case ul.BACKGROUND:return null;case ul.FILL:return this._createFillBucket(e);case ul.LINE:return this._createLineBucket(e);case ul.CIRCLE:return this._createCircleBucket(e);case ul.SYMBOL:return this._createSymbolBucket(e)}}_createFillBucket(e){return new n9i(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new Q8i(e.fillMaterial.getStride()),new $U,new e9i(e.outlineMaterial.getStride()),new $U)}_createLineBucket(e){return new l9i(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new Z8i(e.lineMaterial.getStride()),new $U)}_createCircleBucket(e){return new i9i(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new t9i(e.circleMaterial.getStride()),new $U)}_createSymbolBucket(e){const i=this._tile;return new ubt(e,this._level,new M1t(e.iconMaterial.getStride()),new $U,new M1t(e.textMaterial.getStride()),new $U,i.placementEngine,i.getWorkerTileHandler())}},UBi=class{constructor(e,i,r,n){this.status=aO.INITIALIZED,this.placementEngine=new q8i,this.tileKey=e,this.refKeys=i,this._workerTileHandler=r,this._styleRepository=n}release(){this.tileKey="",this.refKeys=null,this.status=aO.INITIALIZED,this._workerTileHandler=null}async parse(e,i){const r=i&&i.signal;if(ye(r)){const d=()=>{r.removeEventListener("abort",d),this.status=aO.INVALID};r.addEventListener("abort",d)}let n;const s={bucketsWithData:[],emptyBuckets:null};try{n=await this._parse(e,i)}catch(d){if(ss(d))throw d;return{result:s,transferList:[]}}this.status=aO.READY;const o=s.bucketsWithData,a=[];for(const d of n)if(d.hasFeatures()){const p=d.serialize();o.push(p)}else a.push(d.layer.uid);const l=[...o];let c=null;return a.length>0&&(c=Uint32Array.from(a),l.push(c.buffer)),s.emptyBuckets=c,{result:s,transferList:l}}setObsolete(){this.status=aO.INVALID}getLayers(){return this._workerTileHandler.getLayers()}getWorkerTileHandler(){return this._workerTileHandler}async _parse(e,i){const r=e.sourceName2DataAndRefKey;return Object.keys(r).length===0?[]:(this.status=aO.MODIFIED,new VBi(r,this,i.client,this._styleRepository,e.styleLayerUIDs).parse(i))}},gfe=class Zie{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((i,r,n)=>this._create(i,r,n)).filter(i=>!!i),this.layers){let i;for(let r=0;r=this.layers.length?null:this.layers[e].id}getStyleLayerByUID(e){return this._uidToLayer.get(e)??null}getStyleLayerIndex(e){const i=this._layerByName[e];return i?this.layers.indexOf(i):-1}setStyleLayer(e,i){if(!e||!e.id)return;const r=this._style;i!=null&&i>=this.layers.length&&(i=this.layers.length-1);let n,s=!0;const o=this._layerByName[e.id];if(o){const a=this.layers.indexOf(o);i||(i=a),i===a?(s=!1,n=Zie._recreateLayer(e,o),this.layers[i]=n,r.layers[i]=e):(this.layers.splice(a,1),r.layers.splice(a,1),n=this._create(e,i,this.layers),this.layers.splice(i,0,n),r.layers.splice(i,0,e))}else n=this._create(e,i,this.layers),!i||i>=this.layers.length?(this.layers.push(n),r.layers.push(e)):(this.layers.splice(i,0,n),r.layers.splice(i,0,e));this._layerByName[e.id]=n,this._uidToLayer.set(n.uid,n),s&&this._recomputeZValues(),this._identifyRefLayers()}getStyleLayer(e){const i=this._layerByName[e];return i?{type:i.typeName,id:i.id,source:i.source,"source-layer":i.sourceLayer,minzoom:i.minzoom,maxzoom:i.maxzoom,filter:i.filter,layout:i.layout,paint:i.paint}:null}deleteStyleLayer(e){const i=this._layerByName[e];if(i){delete this._layerByName[e],this._uidToLayer.delete(i.uid);const r=this.layers.indexOf(i);this.layers.splice(r,1),this._style.layers.splice(r,1),this._recomputeZValues(),this._identifyRefLayers()}}getLayerById(e){return this._layerByName[e]}getLayoutProperties(e){const i=this._layerByName[e];return i?i.layout:null}getPaintProperties(e){const i=this._layerByName[e];return i?i.paint:null}setPaintProperties(e,i){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:i},s=Zie._recreateLayer(n,r),o=this.layers.indexOf(r);this.layers[o]=s,this._style.layers[o].paint=i,this._layerByName[r.id]=s,this._uidToLayer.set(r.uid,s)}setLayoutProperties(e,i){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:i,paint:r.paint},s=Zie._recreateLayer(n,r),o=this.layers.indexOf(r);this.layers[o]=s,this._style.layers[o].layout=i,this._layerByName[r.id]=s,this._uidToLayer.set(r.uid,s)}setStyleLayerVisibility(e,i){const r=this._layerByName[e];if(!r)return;const n=r.layout||{};n.visibility=i;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=Zie._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 i=this._layerByName[e];return i?i.layout?.visibility??"visible":"none"}_recomputeZValues(){const e=this.layers,i=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,i,r,n,s){const o=[];let a=this._glyphInfo[i];return a?r.forEach(l=>{a[l]||o.push(l)}):(a=this._glyphInfo[i]=[],r.forEach(l=>o.push(l))),o.length===0?Promise.resolve():n.invoke("getGlyphs",{tileID:e,font:i,codePoints:o},s).then(l=>{for(let c=0;c{n=a,s=l})};t.emit("apply-edits",o);try{const{results:a,edits:l}=await WBi(t,e,i,r),c=p=>p.filter(y=>!y.error).map(hi),d={edits:l,addedFeatures:c(a.addFeatureResults),updatedFeatures:c(a.updateFeatureResults),deletedFeatures:c(a.deleteFeatureResults),addedAttachments:c(a.addAttachmentResults),updatedAttachments:c(a.updateAttachmentResults),deletedAttachments:c(a.deleteAttachmentResults),exceededTransferLimit:!1};return a.editedFeatureResults?.length&&(d.editedFeatures=a.editedFeatureResults),(d.addedFeatures.length||d.updatedFeatures.length||d.deletedFeatures.length||d.addedAttachments.length||d.updatedAttachments.length||d.deletedAttachments.length)&&(t.emit("edits",d),y7t(t)&&tWe.emit("edits",{layer:t,event:d})),n(d),a}catch(a){throw s(a),a}}async function WBi(t,e,i,r){if(await t.load(),!zBi(e))throw new st(`${t.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:t});if(!NUe(t))throw new st(`${t.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:t});const{edits:n,options:s}=await qBi(t,i,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 qBi(t,e,i){const r=e&&(e.addFeatures||e.updateFeatures||e.deleteFeatures),n=e&&(e.addAttachments||e.updateAttachments||e.deleteAttachments),s=ye(t.infoFor3D);if(!e||!r&&!n)throw new st(`${t.type}-layer:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");const o=TL(t);if(!o.data.isVersioned&&i?.gdbVersion)throw new st(`${t.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!o.editing.supportsRollbackOnFailure&&i?.rollbackOnFailureEnabled)throw new st(`${t.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");if(!o.editing.supportsGlobalId&&i?.globalIdUsed)throw new st(`${t.type}-layer:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!o.editing.supportsGlobalId&&n)throw new st(`${t.type}-layer:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!i?.globalIdUsed&&n)throw new st(`${t.type}-layer:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true");const a={...i};if(a.rollbackOnFailureEnabled!=null||o.editing.supportsRollbackOnFailure||(a.rollbackOnFailureEnabled=!0),a.rollbackOnFailureEnabled===!1&&a.returnServiceEditsOption==="original-and-current-features")throw new st(`${t.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true.");if(!o.editing.supportsReturnServiceEditsInSourceSpatialReference&&a.returnServiceEditsInSourceSR)throw new st(`${t.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 st(`${t.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const l={...e};if(l.addFeatures=e&&fr.isCollection(e.addFeatures)?e.addFeatures.toArray():l.addFeatures||[],l.updateFeatures=e&&fr.isCollection(e.updateFeatures)?e.updateFeatures.toArray():l.updateFeatures||[],l.deleteFeatures=e&&fr.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():l.deleteFeatures||[],l.addFeatures.length&&!o.operations.supportsAdd)throw new st(`${t.type}-layer:unsupported-operation`,"Layer does not support adding features.");if(l.updateFeatures.length&&!o.operations.supportsUpdate)throw new st(`${t.type}-layer:unsupported-operation`,"Layer does not support updating features.");if(l.deleteFeatures.length&&!o.operations.supportsDelete)throw new st(`${t.type}-layer:unsupported-operation`,"Layer does not support deleting features.");l.addAttachments=l.addAttachments||[],l.updateAttachments=l.updateAttachments||[],l.deleteAttachments=l.deleteAttachments||[],l.addFeatures=l.addFeatures.map(hbt),l.updateFeatures=l.updateFeatures.map(hbt),l.addAssets=[];const c=i?.globalIdUsed||s;return l.addFeatures.forEach(d=>YBi(d,t,c)),l.updateFeatures.forEach(d=>KBi(d,t,c)),l.deleteFeatures.forEach(d=>XBi(d,t,c)),l.addAttachments.forEach(d=>cbt(d,t)),l.updateAttachments.forEach(d=>cbt(d,t)),s&&await ZBi(l,t),{edits:await JBi(l),options:a}}function $4e(t,e,i){if(i){if("attributes"in t&&!t.attributes[e.globalIdField])throw new st(`${e.type}-layer:invalid-parameter`,"Feature should have 'globalId' when 'globalIdUsed' is true");if(!("attributes"in t)&&!t.globalId)throw new st(`${e.type}-layer:invalid-parameter`,"'globalId' of the feature should be passed when 'globalIdUsed' is true")}if("geometry"in t&&ye(t.geometry)){if(t.geometry.hasZ&&e.capabilities?.data.supportsZ===!1)throw new st(`${e.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(t.geometry.hasM&&e.capabilities?.data.supportsM===!1)throw new st(`${e.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function YBi(t,e,i){$4e(t,e,i)}function XBi(t,e,i){$4e(t,e,i)}function KBi(t,e,i){$4e(t,e,i);const r=TL(e);if("geometry"in t&&ye(t.geometry)&&!r?.editing.supportsGeometryUpdate)throw new st(`${e.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function cbt(t,e){const{feature:i,attachment:r}=t;if(!i||"attributes"in i&&!i.attributes[e.globalIdField])throw new st(`${e.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in i)&&!i.globalId)throw new st(`${e.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!r.globalId)throw new st(`${e.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!r.data&&!r.uploadId)throw new st(`${e.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(r.data instanceof File&&r.data.name)&&!r.name)throw new st(`${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 st(`${e.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if(typeof r.data=="string"){const n=Y3(r.data);if(n&&!n.isBase64)throw new st(`${e.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}async function JBi(t){const e=t.addFeatures??[],i=t.updateFeatures??[],r=e.concat(i).map(a=>a.geometry),n=await iv(r),s=e.length,o=i.length;return n.slice(0,s).forEach((a,l)=>e[l].geometry=a),n.slice(s,s+o).forEach((a,l)=>i[l].geometry=a),t}function hbt(t){const e=new js;return t.attributes||(t.attributes={}),e.geometry=t.geometry,e.attributes=t.attributes,e}async function ZBi(t,e){if(lt(e.infoFor3D))return;const{infoFor3D:i}=e;let r=!1;for(const o of i.editFormats)if(o===vfe.GLTF_BINARY){r=!0;break}const n=[];for(const o of t.addFeatures??[])n.push(dbt(o,t,e,r));for(const o of t.updateFeatures??[])n.push(dbt(o,t,e,r));const s=await Promise.allSettled(n);for(const o of s)if(o.status==="rejected")throw o.reason}async function dbt(t,e,i,r){if(lt(t.geometry)||t.geometry.type!=="mesh")return;const n=t.geometry,s=i.globalIdField;if(ye(i.parsedUrl)&&ye(n.external)&&Array.isArray(n.external.source)&&n.external.source.length===1&&"source"in n.external.source[0]&&typeof n.external.source[0].source=="string"&&n.external.source[0].source.startsWith(i.parsedUrl.path))return;if(!r)throw new st(`${i.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");const o=await n.toBinaryGLTF({ignoreLocalTransform:!0}),a=await o.buffer(),l=`{${zB()}}`,c=`${l}.glb`;e.addAssets?.push({featureGlobalId:t.getAttribute(s),assetMapGlobalId:l,assetName:c,flags:ye(n.transform)&&n.transform.geographic?yfe.PROJECT_VERTICES:0,data:a.data,mimeType:a.type,assetType:vfe.GLTF_BINARY,feature:t})}const B4e=Object.freeze(Object.defineProperty({__proto__:null,applyEdits:HBi},Symbol.toStringTag,{value:"Module"}));function QBi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var pbt,oZ,fbt,_fe={};pbt={get exports(){return _fe},set exports(t){_fe=t}},oZ=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(oZ=oZ||__filename),fbt=function(t){var e,i;(t=(t=t||{})!==void 0?t:{}).ready=new Promise(function(It,Bi){e=It,i=Bi});var r,n,s,o=Object.assign({},t),a="./this.program",l=typeof window=="object",c=typeof importScripts=="function",d=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",p="";function y(It){return t.locateFile?t.locateFile(It,p):p+It}if(d){var v=require("fs"),S=require("path");p=c?S.dirname(p)+"/":__dirname+"/",r=(It,Bi)=>(It=kt(It)?new URL(It):S.normalize(It),v.readFileSync(It,Bi?void 0:"utf8")),s=It=>{var Bi=r(It,!0);return Bi.buffer||(Bi=new Uint8Array(Bi)),Bi},n=(It,Bi,Pr)=>{It=kt(It)?new URL(It):S.normalize(It),v.readFile(It,function(Vn,ms){Vn?Pr(Vn):Bi(ms.buffer)})},process.argv.length>1&&(a=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(It){if(!(It instanceof pt))throw It}),process.on("unhandledRejection",function(It){throw It}),t.inspect=function(){return"[Emscripten Module object]"}}else(l||c)&&(c?p=self.location.href:typeof document<"u"&&document.currentScript&&(p=document.currentScript.src),oZ&&(p=oZ),p=p.indexOf("blob:")!==0?p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1):"",r=It=>{var Bi=new XMLHttpRequest;return Bi.open("GET",It,!1),Bi.send(null),Bi.responseText},c&&(s=It=>{var Bi=new XMLHttpRequest;return Bi.open("GET",It,!1),Bi.responseType="arraybuffer",Bi.send(null),new Uint8Array(Bi.response)}),n=(It,Bi,Pr)=>{var Vn=new XMLHttpRequest;Vn.open("GET",It,!0),Vn.responseType="arraybuffer",Vn.onload=()=>{Vn.status==200||Vn.status==0&&Vn.response?Bi(Vn.response):Pr()},Vn.onerror=Pr,Vn.send(null)});var I,O,L=t.print||console.log.bind(console),N=t.printErr||console.warn.bind(console);Object.assign(t,o),o=null,t.arguments&&t.arguments,t.thisProgram&&(a=t.thisProgram),t.quit&&t.quit,t.wasmBinary&&(I=t.wasmBinary),t.noExitRuntime,typeof WebAssembly!="object"&&at("no native wasm support detected");var G=!1;function V(It,Bi){It||at(Bi)}var Y,X,te,re,fe,ge,_e,Ie,ke=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function Ne(It,Bi,Pr){for(var Vn=Bi+Pr,ms=Bi;It[ms]&&!(ms>=Vn);)++ms;if(ms-Bi>16&&It.buffer&&ke)return ke.decode(It.subarray(Bi,ms));for(var gs="";Bi>10,56320|1023&F0)}}else gs+=String.fromCharCode((31&ma)<<6|il)}else gs+=String.fromCharCode(ma)}return gs}function J(It,Bi){return It?Ne(te,It,Bi):""}function he(It,Bi,Pr,Vn){if(!(Vn>0))return 0;for(var ms=Pr,gs=Pr+Vn-1,ma=0;ma=55296&&il<=57343&&(il=65536+((1023&il)<<10)|1023&It.charCodeAt(++ma)),il<=127){if(Pr>=gs)break;Bi[Pr++]=il}else if(il<=2047){if(Pr+1>=gs)break;Bi[Pr++]=192|il>>6,Bi[Pr++]=128|63&il}else if(il<=65535){if(Pr+2>=gs)break;Bi[Pr++]=224|il>>12,Bi[Pr++]=128|il>>6&63,Bi[Pr++]=128|63&il}else{if(Pr+3>=gs)break;Bi[Pr++]=240|il>>18,Bi[Pr++]=128|il>>12&63,Bi[Pr++]=128|il>>6&63,Bi[Pr++]=128|63&il}}return Bi[Pr]=0,Pr-ms}function xe(It){for(var Bi=0,Pr=0;Pr=55296&&Vn<=57343?(Bi+=4,++Pr):Bi+=3}return Bi}function Pe(It){Y=It,t.HEAP8=X=new Int8Array(It),t.HEAP16=re=new Int16Array(It),t.HEAP32=fe=new Int32Array(It),t.HEAPU8=te=new Uint8Array(It),t.HEAPU16=new Uint16Array(It),t.HEAPU32=ge=new Uint32Array(It),t.HEAPF32=_e=new Float32Array(It),t.HEAPF64=Ie=new Float64Array(It)}t.INITIAL_MEMORY;var Oe=[],Ae=[],ze=[];function Ge(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)tt(t.preRun.shift());Le(Oe)}function Je(){Le(Ae)}function et(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)Pt(t.postRun.shift());Le(ze)}function tt(It){Oe.unshift(It)}function ft(It){Ae.unshift(It)}function Pt(It){ze.unshift(It)}var $t=0,St=null;function Tt(It){$t++,t.monitorRunDependencies&&t.monitorRunDependencies($t)}function Lt(It){if($t--,t.monitorRunDependencies&&t.monitorRunDependencies($t),$t==0&&St){var Bi=St;St=null,Bi()}}function at(It){t.onAbort&&t.onAbort(It),N(It="Aborted("+It+")"),G=!0,It+=". Build with -sASSERTIONS for more info.";var Bi=new WebAssembly.RuntimeError(It);throw i(Bi),Bi}var Ee,Be="data:application/octet-stream;base64,";function mt(It){return It.startsWith(Be)}function kt(It){return It.startsWith("file://")}function ct(It){try{if(It==Ee&&I)return new Uint8Array(I);if(s)return s(It);throw"both async and sync fetching of the wasm failed"}catch(Bi){at(Bi)}}function le(){if(!I&&(l||c)){if(typeof fetch=="function"&&!kt(Ee))return fetch(Ee,{credentials:"same-origin"}).then(function(It){if(!It.ok)throw"failed to load wasm binary file at '"+Ee+"'";return It.arrayBuffer()}).catch(function(){return ct(Ee)});if(n)return new Promise(function(It,Bi){n(Ee,function(Pr){It(new Uint8Array(Pr))},Bi)})}return Promise.resolve().then(function(){return ct(Ee)})}function it(){var It={a:Xt};function Bi(gs,ma){var il=gs.exports;t.asm=il,Pe((O=t.asm.t).buffer),t.asm.Yb,ft(t.asm.u),Lt()}function Pr(gs){Bi(gs.instance)}function Vn(gs){return le().then(function(ma){return WebAssembly.instantiate(ma,It)}).then(function(ma){return ma}).then(gs,function(ma){N("failed to asynchronously prepare wasm: "+ma),at(ma)})}function ms(){return I||typeof WebAssembly.instantiateStreaming!="function"||mt(Ee)||kt(Ee)||d||typeof fetch!="function"?Vn(Pr):fetch(Ee,{credentials:"same-origin"}).then(function(gs){return WebAssembly.instantiateStreaming(gs,It).then(Pr,function(ma){return N("wasm streaming compile failed: "+ma),N("falling back to ArrayBuffer instantiation"),Vn(Pr)})})}if(Tt(),t.instantiateWasm)try{return t.instantiateWasm(It,Bi)}catch(gs){N("Module.instantiateWasm callback failed with error: "+gs),i(gs)}return ms().catch(i),{}}function pt(It){this.name="ExitStatus",this.message="Program terminated with exit("+It+")",this.status=It}function Le(It){for(;It.length>0;)It.shift()(t)}function ce(It,Bi="i8"){switch(Bi.endsWith("*")&&(Bi="*"),Bi){case"i1":case"i8":return X[It>>0];case"i16":return re[It>>1];case"i32":case"i64":return fe[It>>2];case"float":return _e[It>>2];case"double":return Ie[It>>3];case"*":return ge[It>>2];default:at("invalid type for getValue: "+Bi)}return null}function Ce(It,Bi,Pr){return 0}function Ze(It,Bi,Pr){}function yt(It,Bi,Pr){return 0}function Ve(It,Bi,Pr,Vn){}function At(It){}function ii(It,Bi){}function gt(It,Bi,Pr){}function Ue(It){return ge[It>>2]+4294967296*fe[It+4>>2]}function ni(It){return It%4==0&&(It%100!=0||It%400==0)}mt(Ee="pe-wasm.wasm")||(Ee=y(Ee));var A=[0,31,60,91,121,152,182,213,244,274,305,335],ve=[0,31,59,90,120,151,181,212,243,273,304,334];function W(It){return(ni(It.getFullYear())?A:ve)[It.getMonth()]+It.getDate()-1}function T(It,Bi){var Pr=new Date(1e3*Ue(It));fe[Bi>>2]=Pr.getSeconds(),fe[Bi+4>>2]=Pr.getMinutes(),fe[Bi+8>>2]=Pr.getHours(),fe[Bi+12>>2]=Pr.getDate(),fe[Bi+16>>2]=Pr.getMonth(),fe[Bi+20>>2]=Pr.getFullYear()-1900,fe[Bi+24>>2]=Pr.getDay();var Vn=0|W(Pr);fe[Bi+28>>2]=Vn,fe[Bi+36>>2]=-60*Pr.getTimezoneOffset();var ms=new Date(Pr.getFullYear(),0,1),gs=new Date(Pr.getFullYear(),6,1).getTimezoneOffset(),ma=ms.getTimezoneOffset(),il=0|(gs!=ma&&Pr.getTimezoneOffset()==Math.min(ma,gs));fe[Bi+32>>2]=il}function b(It){var Bi=xe(It)+1,Pr=ot(Bi);return Pr&&he(It,X,Pr,Bi),Pr}function m(It,Bi,Pr){var Vn=new Date().getFullYear(),ms=new Date(Vn,0,1),gs=new Date(Vn,6,1),ma=ms.getTimezoneOffset(),il=gs.getTimezoneOffset(),Mg=Math.max(ma,il);function F0(nt){var tu=nt.toTimeString().match(/\(([A-Za-z ]+)\)$/);return tu?tu[1]:"GMT"}ge[It>>2]=60*Mg,fe[Bi>>2]=Number(ma!=il);var If=F0(ms),hm=F0(gs),wp=b(If),h3=b(hm);il>2]=wp,ge[Pr+4>>2]=h3):(ge[Pr>>2]=h3,ge[Pr+4>>2]=wp)}function _(){at("")}function C(){return Date.now()}function D(It,Bi,Pr){te.copyWithin(It,Bi,Bi+Pr)}function F(){return 2147483648}function B(It){try{return O.grow(It-Y.byteLength+65535>>>16),Pe(O.buffer),1}catch{}}function q(It){var Bi=te.length;It>>>=0;var Pr=F();if(It>Pr)return!1;let Vn=(ma,il)=>ma+(il-ma%il)%il;for(var ms=1;ms<=4;ms*=2){var gs=Bi*(1+.2/ms);if(gs=Math.min(gs,It+100663296),B(Math.min(Pr,Vn(Math.max(It,gs),65536))))return!0}return!1}var Z={};function oe(){return a||"./this.program"}function ue(){if(!ue.strings){var It={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",_:oe()};for(var Bi in Z)Z[Bi]===void 0?delete It[Bi]:It[Bi]=Z[Bi];var Pr=[];for(var Bi in It)Pr.push(Bi+"="+It[Bi]);ue.strings=Pr}return ue.strings}function be(It,Bi,Pr){for(var Vn=0;Vn>0]=It.charCodeAt(Vn);Pr||(X[Bi>>0]=0)}function De(It,Bi){var Pr=0;return ue().forEach(function(Vn,ms){var gs=Bi+Pr;ge[It+4*ms>>2]=gs,be(Vn,gs),Pr+=Vn.length+1}),0}function qe(It,Bi){var Pr=ue();ge[It>>2]=Pr.length;var Vn=0;return Pr.forEach(function(ms){Vn+=ms.length+1}),ge[Bi>>2]=Vn,0}function rt(It){return 52}function Dt(It,Bi,Pr,Vn){return 52}function Vt(It,Bi,Pr,Vn,ms){return 70}var Ke=[null,[],[]];function Ot(It,Bi){var Pr=Ke[It];Bi===0||Bi===10?((It===1?L:N)(Ne(Pr,0)),Pr.length=0):Pr.push(Bi)}function ei(It,Bi,Pr,Vn){for(var ms=0,gs=0;gs>2],il=ge[Bi+4>>2];Bi+=8;for(var Mg=0;Mg>2]=ms,0}function Jt(It,Bi,Pr){var Vn=Pr>0?Pr:xe(It)+1,ms=new Array(Vn),gs=he(It,ms,0,ms.length);return Bi&&(ms.length=gs),ms}var Xt={c:Ce,p:Ze,f:yt,d:Ve,n:At,m:ii,o:gt,h:T,i:m,k:_,g:C,s:D,l:q,q:De,r:qe,a:rt,e:Dt,j:Vt,b:ei};it(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.u).apply(null,arguments)};var ti=t._emscripten_bind_PeObject_getCode_0=function(){return(ti=t._emscripten_bind_PeObject_getCode_0=t.asm.v).apply(null,arguments)},bi=t._emscripten_bind_PeObject_getName_1=function(){return(bi=t._emscripten_bind_PeObject_getName_1=t.asm.w).apply(null,arguments)},Fi=t._emscripten_bind_PeObject_getType_0=function(){return(Fi=t._emscripten_bind_PeObject_getType_0=t.asm.x).apply(null,arguments)},Ri=t._emscripten_bind_PeCoordsys_getCode_0=function(){return(Ri=t._emscripten_bind_PeCoordsys_getCode_0=t.asm.y).apply(null,arguments)},er=t._emscripten_bind_PeCoordsys_getName_1=function(){return(er=t._emscripten_bind_PeCoordsys_getName_1=t.asm.z).apply(null,arguments)},ar=t._emscripten_bind_PeCoordsys_getType_0=function(){return(ar=t._emscripten_bind_PeCoordsys_getType_0=t.asm.A).apply(null,arguments)},mi=t._emscripten_bind_VoidPtr___destroy___0=function(){return(mi=t._emscripten_bind_VoidPtr___destroy___0=t.asm.B).apply(null,arguments)},dn=t._emscripten_bind_PeDatum_getSpheroid_0=function(){return(dn=t._emscripten_bind_PeDatum_getSpheroid_0=t.asm.C).apply(null,arguments)},Lr=t._emscripten_bind_PeDatum_getCode_0=function(){return(Lr=t._emscripten_bind_PeDatum_getCode_0=t.asm.D).apply(null,arguments)},xo=t._emscripten_bind_PeDatum_getName_1=function(){return(xo=t._emscripten_bind_PeDatum_getName_1=t.asm.E).apply(null,arguments)},kr=t._emscripten_bind_PeDatum_getType_0=function(){return(kr=t._emscripten_bind_PeDatum_getType_0=t.asm.F).apply(null,arguments)},is=t._emscripten_bind_PeDefs_get_PE_BUFFER_MAX_0=function(){return(is=t._emscripten_bind_PeDefs_get_PE_BUFFER_MAX_0=t.asm.G).apply(null,arguments)},Hn=t._emscripten_bind_PeDefs_get_PE_NAME_MAX_0=function(){return(Hn=t._emscripten_bind_PeDefs_get_PE_NAME_MAX_0=t.asm.H).apply(null,arguments)},En=t._emscripten_bind_PeDefs_get_PE_MGRS_MAX_0=function(){return(En=t._emscripten_bind_PeDefs_get_PE_MGRS_MAX_0=t.asm.I).apply(null,arguments)},Kn=t._emscripten_bind_PeDefs_get_PE_USNG_MAX_0=function(){return(Kn=t._emscripten_bind_PeDefs_get_PE_USNG_MAX_0=t.asm.J).apply(null,arguments)},$i=t._emscripten_bind_PeDefs_get_PE_DD_MAX_0=function(){return($i=t._emscripten_bind_PeDefs_get_PE_DD_MAX_0=t.asm.K).apply(null,arguments)},Ur=t._emscripten_bind_PeDefs_get_PE_DMS_MAX_0=function(){return(Ur=t._emscripten_bind_PeDefs_get_PE_DMS_MAX_0=t.asm.L).apply(null,arguments)},Qo=t._emscripten_bind_PeDefs_get_PE_DDM_MAX_0=function(){return(Qo=t._emscripten_bind_PeDefs_get_PE_DDM_MAX_0=t.asm.M).apply(null,arguments)},In=t._emscripten_bind_PeDefs_get_PE_UTM_MAX_0=function(){return(In=t._emscripten_bind_PeDefs_get_PE_UTM_MAX_0=t.asm.N).apply(null,arguments)},Xi=t._emscripten_bind_PeDefs_get_PE_PARM_MAX_0=function(){return(Xi=t._emscripten_bind_PeDefs_get_PE_PARM_MAX_0=t.asm.O).apply(null,arguments)},li=t._emscripten_bind_PeDefs_get_PE_TYPE_NONE_0=function(){return(li=t._emscripten_bind_PeDefs_get_PE_TYPE_NONE_0=t.asm.P).apply(null,arguments)},H=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGCS_0=function(){return(H=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGCS_0=t.asm.Q).apply(null,arguments)},xr=t._emscripten_bind_PeDefs_get_PE_TYPE_PROJCS_0=function(){return(xr=t._emscripten_bind_PeDefs_get_PE_TYPE_PROJCS_0=t.asm.R).apply(null,arguments)},Ta=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGTRAN_0=function(){return(Ta=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGTRAN_0=t.asm.S).apply(null,arguments)},ea=t._emscripten_bind_PeDefs_get_PE_TYPE_COORDSYS_0=function(){return(ea=t._emscripten_bind_PeDefs_get_PE_TYPE_COORDSYS_0=t.asm.T).apply(null,arguments)},zt=t._emscripten_bind_PeDefs_get_PE_TYPE_UNIT_0=function(){return(zt=t._emscripten_bind_PeDefs_get_PE_TYPE_UNIT_0=t.asm.U).apply(null,arguments)},Ha=t._emscripten_bind_PeDefs_get_PE_TYPE_LINUNIT_0=function(){return(Ha=t._emscripten_bind_PeDefs_get_PE_TYPE_LINUNIT_0=t.asm.V).apply(null,arguments)},wi=t._emscripten_bind_PeDefs_get_PE_STR_OPTS_NONE_0=function(){return(wi=t._emscripten_bind_PeDefs_get_PE_STR_OPTS_NONE_0=t.asm.W).apply(null,arguments)},_t=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_NONE_0=function(){return(_t=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_NONE_0=t.asm.X).apply(null,arguments)},Mr=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_TOP_0=function(){return(Mr=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_TOP_0=t.asm.Y).apply(null,arguments)},jr=t._emscripten_bind_PeDefs_get_PE_STR_NAME_CANON_0=function(){return(jr=t._emscripten_bind_PeDefs_get_PE_STR_NAME_CANON_0=t.asm.Z).apply(null,arguments)},Nn=t._emscripten_bind_PeDefs_get_PE_PARM_X0_0=function(){return(Nn=t._emscripten_bind_PeDefs_get_PE_PARM_X0_0=t.asm._).apply(null,arguments)},Jn=t._emscripten_bind_PeDefs_get_PE_PARM_ND_0=function(){return(Jn=t._emscripten_bind_PeDefs_get_PE_PARM_ND_0=t.asm.$).apply(null,arguments)},ws=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_1_TO_2_0=function(){return(ws=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_1_TO_2_0=t.asm.aa).apply(null,arguments)},wa=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_2_TO_1_0=function(){return(wa=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_2_TO_1_0=t.asm.ba).apply(null,arguments)},Bt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_P_TO_G_0=function(){return(Bt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_P_TO_G_0=t.asm.ca).apply(null,arguments)},Ft=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_G_TO_P_0=function(){return(Ft=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_G_TO_P_0=t.asm.da).apply(null,arguments)},yi=t._emscripten_bind_PeDefs_get_PE_HORIZON_RECT_0=function(){return(yi=t._emscripten_bind_PeDefs_get_PE_HORIZON_RECT_0=t.asm.ea).apply(null,arguments)},Ti=t._emscripten_bind_PeDefs_get_PE_HORIZON_POLY_0=function(){return(Ti=t._emscripten_bind_PeDefs_get_PE_HORIZON_POLY_0=t.asm.fa).apply(null,arguments)},xi=t._emscripten_bind_PeDefs_get_PE_HORIZON_LINE_0=function(){return(xi=t._emscripten_bind_PeDefs_get_PE_HORIZON_LINE_0=t.asm.ga).apply(null,arguments)},Ki=t._emscripten_bind_PeDefs_get_PE_HORIZON_DELTA_0=function(){return(Ki=t._emscripten_bind_PeDefs_get_PE_HORIZON_DELTA_0=t.asm.ha).apply(null,arguments)},ur=t._emscripten_bind_PeFactory_initialize_1=function(){return(ur=t._emscripten_bind_PeFactory_initialize_1=t.asm.ia).apply(null,arguments)},pn=t._emscripten_bind_PeFactory_factoryByType_2=function(){return(pn=t._emscripten_bind_PeFactory_factoryByType_2=t.asm.ja).apply(null,arguments)},$n=t._emscripten_bind_PeFactory_fromString_2=function(){return($n=t._emscripten_bind_PeFactory_fromString_2=t.asm.ka).apply(null,arguments)},ko=t._emscripten_bind_PeFactory_getCode_1=function(){return(ko=t._emscripten_bind_PeFactory_getCode_1=t.asm.la).apply(null,arguments)},An=t._emscripten_bind_PeGCSExtent_PeGCSExtent_6=function(){return(An=t._emscripten_bind_PeGCSExtent_PeGCSExtent_6=t.asm.ma).apply(null,arguments)},No=t._emscripten_bind_PeGCSExtent_getLLon_0=function(){return(No=t._emscripten_bind_PeGCSExtent_getLLon_0=t.asm.na).apply(null,arguments)},Ts=t._emscripten_bind_PeGCSExtent_getSLat_0=function(){return(Ts=t._emscripten_bind_PeGCSExtent_getSLat_0=t.asm.oa).apply(null,arguments)},xa=t._emscripten_bind_PeGCSExtent_getRLon_0=function(){return(xa=t._emscripten_bind_PeGCSExtent_getRLon_0=t.asm.pa).apply(null,arguments)},Pu=t._emscripten_bind_PeGCSExtent_getNLat_0=function(){return(Pu=t._emscripten_bind_PeGCSExtent_getNLat_0=t.asm.qa).apply(null,arguments)},$o=t._emscripten_bind_PeGCSExtent___destroy___0=function(){return($o=t._emscripten_bind_PeGCSExtent___destroy___0=t.asm.ra).apply(null,arguments)},mc=t._emscripten_bind_PeGeogcs_getDatum_0=function(){return(mc=t._emscripten_bind_PeGeogcs_getDatum_0=t.asm.sa).apply(null,arguments)},ju=t._emscripten_bind_PeGeogcs_getPrimem_0=function(){return(ju=t._emscripten_bind_PeGeogcs_getPrimem_0=t.asm.ta).apply(null,arguments)},fi=t._emscripten_bind_PeGeogcs_getUnit_0=function(){return(fi=t._emscripten_bind_PeGeogcs_getUnit_0=t.asm.ua).apply(null,arguments)},_i=t._emscripten_bind_PeGeogcs_getCode_0=function(){return(_i=t._emscripten_bind_PeGeogcs_getCode_0=t.asm.va).apply(null,arguments)},gi=t._emscripten_bind_PeGeogcs_getName_1=function(){return(gi=t._emscripten_bind_PeGeogcs_getName_1=t.asm.wa).apply(null,arguments)},_r=t._emscripten_bind_PeGeogcs_getType_0=function(){return(_r=t._emscripten_bind_PeGeogcs_getType_0=t.asm.xa).apply(null,arguments)},Wr=t._emscripten_bind_PeGeogtran_isEqual_1=function(){return(Wr=t._emscripten_bind_PeGeogtran_isEqual_1=t.asm.ya).apply(null,arguments)},Gr=t._emscripten_bind_PeGeogtran_getGeogcs1_0=function(){return(Gr=t._emscripten_bind_PeGeogtran_getGeogcs1_0=t.asm.za).apply(null,arguments)},Kr=t._emscripten_bind_PeGeogtran_getGeogcs2_0=function(){return(Kr=t._emscripten_bind_PeGeogtran_getGeogcs2_0=t.asm.Aa).apply(null,arguments)},Cr=t._emscripten_bind_PeGeogtran_getParameters_0=function(){return(Cr=t._emscripten_bind_PeGeogtran_getParameters_0=t.asm.Ba).apply(null,arguments)},Wn=t._emscripten_bind_PeGeogtran_loadConstants_0=function(){return(Wn=t._emscripten_bind_PeGeogtran_loadConstants_0=t.asm.Ca).apply(null,arguments)},Rs=t._emscripten_bind_PeGeogtran_getCode_0=function(){return(Rs=t._emscripten_bind_PeGeogtran_getCode_0=t.asm.Da).apply(null,arguments)},Ms=t._emscripten_bind_PeGeogtran_getName_1=function(){return(Ms=t._emscripten_bind_PeGeogtran_getName_1=t.asm.Ea).apply(null,arguments)},Vo=t._emscripten_bind_PeGeogtran_getType_0=function(){return(Vo=t._emscripten_bind_PeGeogtran_getType_0=t.asm.Fa).apply(null,arguments)},Pc=t._emscripten_bind_PeGTlistExtended_getGTlist_6=function(){return(Pc=t._emscripten_bind_PeGTlistExtended_getGTlist_6=t.asm.Ga).apply(null,arguments)},Ea=t._emscripten_bind_PeGTlistExtended_get_PE_GTLIST_OPTS_COMMON_0=function(){return(Ea=t._emscripten_bind_PeGTlistExtended_get_PE_GTLIST_OPTS_COMMON_0=t.asm.Ha).apply(null,arguments)},Na=t._emscripten_bind_PeGTlistExtendedEntry_getEntries_0=function(){return(Na=t._emscripten_bind_PeGTlistExtendedEntry_getEntries_0=t.asm.Ia).apply(null,arguments)},pr=t._emscripten_bind_PeGTlistExtendedEntry_getSteps_0=function(){return(pr=t._emscripten_bind_PeGTlistExtendedEntry_getSteps_0=t.asm.Ja).apply(null,arguments)},Uo=t._emscripten_bind_PeGTlistExtendedEntry_Delete_1=function(){return(Uo=t._emscripten_bind_PeGTlistExtendedEntry_Delete_1=t.asm.Ka).apply(null,arguments)},uh=t._emscripten_bind_PeGTlistExtendedGTs_getDirection_0=function(){return(uh=t._emscripten_bind_PeGTlistExtendedGTs_getDirection_0=t.asm.La).apply(null,arguments)},Nc=t._emscripten_bind_PeGTlistExtendedGTs_getGeogtran_0=function(){return(Nc=t._emscripten_bind_PeGTlistExtendedGTs_getGeogtran_0=t.asm.Ma).apply(null,arguments)},Cf=t._emscripten_bind_PeHorizon_getNump_0=function(){return(Cf=t._emscripten_bind_PeHorizon_getNump_0=t.asm.Na).apply(null,arguments)},Jp=t._emscripten_bind_PeHorizon_getKind_0=function(){return(Jp=t._emscripten_bind_PeHorizon_getKind_0=t.asm.Oa).apply(null,arguments)},ch=t._emscripten_bind_PeHorizon_getInclusive_0=function(){return(ch=t._emscripten_bind_PeHorizon_getInclusive_0=t.asm.Pa).apply(null,arguments)},Ig=t._emscripten_bind_PeHorizon_getSize_0=function(){return(Ig=t._emscripten_bind_PeHorizon_getSize_0=t.asm.Qa).apply(null,arguments)},qm=t._emscripten_bind_PeHorizon_getCoord_0=function(){return(qm=t._emscripten_bind_PeHorizon_getCoord_0=t.asm.Ra).apply(null,arguments)},ec=t._emscripten_bind_PeInteger_PeInteger_1=function(){return(ec=t._emscripten_bind_PeInteger_PeInteger_1=t.asm.Sa).apply(null,arguments)},_p=t._emscripten_bind_PeInteger_get_val_0=function(){return(_p=t._emscripten_bind_PeInteger_get_val_0=t.asm.Ta).apply(null,arguments)},nd=t._emscripten_bind_PeInteger_set_val_1=function(){return(nd=t._emscripten_bind_PeInteger_set_val_1=t.asm.Ua).apply(null,arguments)},Zp=t._emscripten_bind_PeInteger___destroy___0=function(){return(Zp=t._emscripten_bind_PeInteger___destroy___0=t.asm.Va).apply(null,arguments)},$l=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_NEW_0=function(){return($l=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_NEW_0=t.asm.Wa).apply(null,arguments)},hh=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_OLD_0=function(){return(hh=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_OLD_0=t.asm.Xa).apply(null,arguments)},sd=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_AUTO_0=function(){return(sd=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_AUTO_0=t.asm.Ya).apply(null,arguments)},cu=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_180_ZONE_1_PLUS_0=function(){return(cu=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_180_ZONE_1_PLUS_0=t.asm.Za).apply(null,arguments)},Qp=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_ADD_SPACES_0=function(){return(Qp=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_ADD_SPACES_0=t.asm._a).apply(null,arguments)},Ph=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NONE_0=function(){return(Ph=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NONE_0=t.asm.$a).apply(null,arguments)},Ag=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_0=function(){return(Ag=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_0=t.asm.ab).apply(null,arguments)},Pg=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_STRICT_0=function(){return(Pg=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_STRICT_0=t.asm.bb).apply(null,arguments)},Yd=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_ADD_SPACES_0=function(){return(Yd=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_ADD_SPACES_0=t.asm.cb).apply(null,arguments)},fa=t._emscripten_bind_PeParameter_getValue_0=function(){return(fa=t._emscripten_bind_PeParameter_getValue_0=t.asm.db).apply(null,arguments)},cm=t._emscripten_bind_PeParameter_getCode_0=function(){return(cm=t._emscripten_bind_PeParameter_getCode_0=t.asm.eb).apply(null,arguments)},dl=t._emscripten_bind_PeParameter_getName_1=function(){return(dl=t._emscripten_bind_PeParameter_getName_1=t.asm.fb).apply(null,arguments)},ef=t._emscripten_bind_PeParameter_getType_0=function(){return(ef=t._emscripten_bind_PeParameter_getType_0=t.asm.gb).apply(null,arguments)},dh=t._emscripten_bind_PePCSInfo_getCentralMeridian_0=function(){return(dh=t._emscripten_bind_PePCSInfo_getCentralMeridian_0=t.asm.hb).apply(null,arguments)},ui=t._emscripten_bind_PePCSInfo_getDomainMinx_0=function(){return(ui=t._emscripten_bind_PePCSInfo_getDomainMinx_0=t.asm.ib).apply(null,arguments)},pl=t._emscripten_bind_PePCSInfo_getDomainMiny_0=function(){return(pl=t._emscripten_bind_PePCSInfo_getDomainMiny_0=t.asm.jb).apply(null,arguments)},tf=t._emscripten_bind_PePCSInfo_getDomainMaxx_0=function(){return(tf=t._emscripten_bind_PePCSInfo_getDomainMaxx_0=t.asm.kb).apply(null,arguments)},Og=t._emscripten_bind_PePCSInfo_getDomainMaxy_0=function(){return(Og=t._emscripten_bind_PePCSInfo_getDomainMaxy_0=t.asm.lb).apply(null,arguments)},ta=t._emscripten_bind_PePCSInfo_getNorthPoleLocation_0=function(){return(ta=t._emscripten_bind_PePCSInfo_getNorthPoleLocation_0=t.asm.mb).apply(null,arguments)},bp=t._emscripten_bind_PePCSInfo_getNorthPoleGeometry_0=function(){return(bp=t._emscripten_bind_PePCSInfo_getNorthPoleGeometry_0=t.asm.nb).apply(null,arguments)},Us=t._emscripten_bind_PePCSInfo_getSouthPoleLocation_0=function(){return(Us=t._emscripten_bind_PePCSInfo_getSouthPoleLocation_0=t.asm.ob).apply(null,arguments)},Xs=t._emscripten_bind_PePCSInfo_getSouthPoleGeometry_0=function(){return(Xs=t._emscripten_bind_PePCSInfo_getSouthPoleGeometry_0=t.asm.pb).apply(null,arguments)},Ql=t._emscripten_bind_PePCSInfo_isDensificationNeeded_0=function(){return(Ql=t._emscripten_bind_PePCSInfo_isDensificationNeeded_0=t.asm.qb).apply(null,arguments)},Ou=t._emscripten_bind_PePCSInfo_isGcsHorizonMultiOverlap_0=function(){return(Ou=t._emscripten_bind_PePCSInfo_isGcsHorizonMultiOverlap_0=t.asm.rb).apply(null,arguments)},Ym=t._emscripten_bind_PePCSInfo_isPannableRectangle_0=function(){return(Ym=t._emscripten_bind_PePCSInfo_isPannableRectangle_0=t.asm.sb).apply(null,arguments)},th=t._emscripten_bind_PePCSInfo_generate_2=function(){return(th=t._emscripten_bind_PePCSInfo_generate_2=t.asm.tb).apply(null,arguments)},ih=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_NONE_0=function(){return(ih=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_NONE_0=t.asm.ub).apply(null,arguments)},yu=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_DOMAIN_0=function(){return(yu=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_DOMAIN_0=t.asm.vb).apply(null,arguments)},eu=t._emscripten_bind_PePCSInfo_get_PE_POLE_OUTSIDE_BOUNDARY_0=function(){return(eu=t._emscripten_bind_PePCSInfo_get_PE_POLE_OUTSIDE_BOUNDARY_0=t.asm.wb).apply(null,arguments)},Wa=t._emscripten_bind_PePCSInfo_get_PE_POLE_POINT_0=function(){return(Wa=t._emscripten_bind_PePCSInfo_get_PE_POLE_POINT_0=t.asm.xb).apply(null,arguments)},Oh=t._emscripten_bind_PePrimem_getLongitude_0=function(){return(Oh=t._emscripten_bind_PePrimem_getLongitude_0=t.asm.yb).apply(null,arguments)},tc=t._emscripten_bind_PePrimem_getCode_0=function(){return(tc=t._emscripten_bind_PePrimem_getCode_0=t.asm.zb).apply(null,arguments)},Bl=t._emscripten_bind_PePrimem_getName_1=function(){return(Bl=t._emscripten_bind_PePrimem_getName_1=t.asm.Ab).apply(null,arguments)},Oc=t._emscripten_bind_PePrimem_getType_0=function(){return(Oc=t._emscripten_bind_PePrimem_getType_0=t.asm.Bb).apply(null,arguments)},Xm=t._emscripten_bind_PeProjcs_getGeogcs_0=function(){return(Xm=t._emscripten_bind_PeProjcs_getGeogcs_0=t.asm.Cb).apply(null,arguments)},Xd=t._emscripten_bind_PeProjcs_getParameters_0=function(){return(Xd=t._emscripten_bind_PeProjcs_getParameters_0=t.asm.Db).apply(null,arguments)},Tf=t._emscripten_bind_PeProjcs_getUnit_0=function(){return(Tf=t._emscripten_bind_PeProjcs_getUnit_0=t.asm.Eb).apply(null,arguments)},Py=t._emscripten_bind_PeProjcs_loadConstants_0=function(){return(Py=t._emscripten_bind_PeProjcs_loadConstants_0=t.asm.Fb).apply(null,arguments)},Rg=t._emscripten_bind_PeProjcs_horizonGcsGenerate_0=function(){return(Rg=t._emscripten_bind_PeProjcs_horizonGcsGenerate_0=t.asm.Gb).apply(null,arguments)},Ht=t._emscripten_bind_PeProjcs_horizonPcsGenerate_0=function(){return(Ht=t._emscripten_bind_PeProjcs_horizonPcsGenerate_0=t.asm.Hb).apply(null,arguments)},qt=t._emscripten_bind_PeProjcs_getCode_0=function(){return(qt=t._emscripten_bind_PeProjcs_getCode_0=t.asm.Ib).apply(null,arguments)},Ai=t._emscripten_bind_PeProjcs_getName_1=function(){return(Ai=t._emscripten_bind_PeProjcs_getName_1=t.asm.Jb).apply(null,arguments)},ji=t._emscripten_bind_PeProjcs_getType_0=function(){return(ji=t._emscripten_bind_PeProjcs_getType_0=t.asm.Kb).apply(null,arguments)},pe=t._emscripten_bind_PeSpheroid_getAxis_0=function(){return(pe=t._emscripten_bind_PeSpheroid_getAxis_0=t.asm.Lb).apply(null,arguments)},Fe=t._emscripten_bind_PeSpheroid_getFlattening_0=function(){return(Fe=t._emscripten_bind_PeSpheroid_getFlattening_0=t.asm.Mb).apply(null,arguments)},We=t._emscripten_bind_PeSpheroid_getCode_0=function(){return(We=t._emscripten_bind_PeSpheroid_getCode_0=t.asm.Nb).apply(null,arguments)},bt=t._emscripten_bind_PeSpheroid_getName_1=function(){return(bt=t._emscripten_bind_PeSpheroid_getName_1=t.asm.Ob).apply(null,arguments)},ne=t._emscripten_bind_PeSpheroid_getType_0=function(){return(ne=t._emscripten_bind_PeSpheroid_getType_0=t.asm.Pb).apply(null,arguments)},Q=t._emscripten_bind_PeUnit_getUnitFactor_0=function(){return(Q=t._emscripten_bind_PeUnit_getUnitFactor_0=t.asm.Qb).apply(null,arguments)},se=t._emscripten_bind_PeUnit_getCode_0=function(){return(se=t._emscripten_bind_PeUnit_getCode_0=t.asm.Rb).apply(null,arguments)},me=t._emscripten_bind_PeUnit_getName_1=function(){return(me=t._emscripten_bind_PeUnit_getName_1=t.asm.Sb).apply(null,arguments)},Te=t._emscripten_bind_PeUnit_getType_0=function(){return(Te=t._emscripten_bind_PeUnit_getType_0=t.asm.Tb).apply(null,arguments)},He=t._emscripten_bind_PeVersion_version_string_0=function(){return(He=t._emscripten_bind_PeVersion_version_string_0=t.asm.Ub).apply(null,arguments)};t._pe_getPeGTlistExtendedEntrySize=function(){return(t._pe_getPeGTlistExtendedEntrySize=t.asm.Vb).apply(null,arguments)},t._pe_getPeGTlistExtendedGTsSize=function(){return(t._pe_getPeGTlistExtendedGTsSize=t.asm.Wb).apply(null,arguments)},t._pe_getPeHorizonSize=function(){return(t._pe_getPeHorizonSize=t.asm.Xb).apply(null,arguments)},t._pe_geog_to_geog=function(){return(t._pe_geog_to_geog=t.asm.Zb).apply(null,arguments)},t._pe_geog_to_proj=function(){return(t._pe_geog_to_proj=t.asm._b).apply(null,arguments)},t._pe_geog_to_dd=function(){return(t._pe_geog_to_dd=t.asm.$b).apply(null,arguments)},t._pe_dd_to_geog=function(){return(t._pe_dd_to_geog=t.asm.ac).apply(null,arguments)},t._pe_geog_to_ddm=function(){return(t._pe_geog_to_ddm=t.asm.bc).apply(null,arguments)},t._pe_ddm_to_geog=function(){return(t._pe_ddm_to_geog=t.asm.cc).apply(null,arguments)},t._pe_geog_to_dms=function(){return(t._pe_geog_to_dms=t.asm.dc).apply(null,arguments)},t._pe_dms_to_geog=function(){return(t._pe_dms_to_geog=t.asm.ec).apply(null,arguments)},t._pe_geog_to_mgrs_extended=function(){return(t._pe_geog_to_mgrs_extended=t.asm.fc).apply(null,arguments)},t._pe_mgrs_to_geog_extended=function(){return(t._pe_mgrs_to_geog_extended=t.asm.gc).apply(null,arguments)},t._pe_geog_to_usng=function(){return(t._pe_geog_to_usng=t.asm.hc).apply(null,arguments)},t._pe_usng_to_geog=function(){return(t._pe_usng_to_geog=t.asm.ic).apply(null,arguments)},t._pe_geog_to_utm=function(){return(t._pe_geog_to_utm=t.asm.jc).apply(null,arguments)},t._pe_utm_to_geog=function(){return(t._pe_utm_to_geog=t.asm.kc).apply(null,arguments)},t._pe_object_to_string_ext=function(){return(t._pe_object_to_string_ext=t.asm.lc).apply(null,arguments)},t._pe_proj_to_geog_center=function(){return(t._pe_proj_to_geog_center=t.asm.mc).apply(null,arguments)};var Ye,ot=t._malloc=function(){return(ot=t._malloc=t.asm.nc).apply(null,arguments)};function Ct(It){function Bi(){Ye||(Ye=!0,t.calledRun=!0,G||(Je(),e(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),et()))}$t>0||(Ge(),$t>0||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),Bi()},1)):Bi()))}if(t._free=function(){return(t._free=t.asm.oc).apply(null,arguments)},t.___start_em_js=1970140,t.___stop_em_js=1970238,t.UTF8ToString=J,t.getValue=ce,St=function It(){Ye||Ct(),Ye||(St=It)},t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();function Wt(){}function pi(It){return(It||Wt).__cache__}function di(It,Bi){var Pr=pi(Bi),Vn=Pr[It];return Vn||((Vn=Object.create((Bi||Wt).prototype)).ptr=It,Pr[It]=Vn)}function Oi(It,Bi){return di(It.ptr,Bi)}function zi(It){if(!It.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";It.__destroy__(),delete pi(It.__class__)[It.ptr]}function sr(It,Bi){return It.ptr===Bi.ptr}function tr(It){return It.ptr}function Sr(It){return It.__class__}Ct(),Wt.prototype=Object.create(Wt.prototype),Wt.prototype.constructor=Wt,Wt.prototype.__class__=Wt,Wt.__cache__={},t.WrapperObject=Wt,t.getCache=pi,t.wrapPointer=di,t.castObject=Oi,t.NULL=di(0),t.destroy=zi,t.compare=sr,t.getPointer=tr,t.getClass=Sr;var lr={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(lr.needed){for(var It=0;It=lr.size?(V(ms>0),lr.needed+=ms,Pr=t._malloc(ms),lr.temps.push(Pr)):(Pr=lr.buffer+lr.pos,lr.pos+=ms),Pr},copy:function(It,Bi,Pr){switch(Pr>>>=0,Bi.BYTES_PER_ELEMENT){case 2:Pr>>>=1;break;case 4:Pr>>>=2;break;case 8:Pr>>>=3}for(var Vn=0;Vn{const r=new FileReader;r.readAsDataURL(t),r.onload=()=>e(Y3(r.result)),r.onerror=n=>i(n)})}const cGi=new Set(["Feature Layer","Table"]),hGi=new Bs({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let XU=class extends hd{constructor(){super(...arguments),this.type="feature-layer",this.refresh=$y(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 i=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:i,updates:i?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}})}load(e){const i=ye(e)?e.signal:null,r=this.layer.sourceJSON;return this.addResolvingPromise(this._fetchService(r,i)),Promise.resolve(this)}get queryTask(){const{capabilities:e,parsedUrl:i,dynamicDataSource:r,infoFor3D:n,gdbVersion:s,spatialReference:o,fieldsIndex:a}=this.layer,l=Gi("featurelayer-pbf")&&e?.query.supportsFormatPBF&<(n),c=e?.operations?.supportsQueryAttachments??!1;return new eZe({url:i.path,pbfSupported:l,fieldsIndex:a,infoFor3D:n,dynamicDataSource:r,gdbVersion:s,sourceSpatialReference:o,queryAttachmentsSupported:c})}async addAttachment(e,i){await this.load();const r=e.attributes[this.layer.objectIdField],n=this.layer.parsedUrl.path+"/"+r+"/addAttachment",s=this._getLayerRequestOptions(),o=this._getFormDataForAttachment(i,s.query);try{const a=await ir(n,{body:o});return this._createFeatureEditResult(a.data.addAttachmentResult)}catch(a){throw this._createAttachmentErrorResult(r,a)}}async updateAttachment(e,i,r){await this.load();const n=e.attributes[this.layer.objectIdField],s=this.layer.parsedUrl.path+"/"+n+"/updateAttachment",o=this._getLayerRequestOptions({query:{attachmentId:i}}),a=this._getFormDataForAttachment(r,o.query);try{const l=await ir(s,{body:a});return this._createFeatureEditResult(l.data.updateAttachmentResult)}catch(l){throw this._createAttachmentErrorResult(n,l)}}async applyEdits(e,i){await this.load();const r=this.layer.infoFor3D,n=ye(r),s=n||(i?.globalIdUsed??!1),o=e.addFeatures?.map(G=>this._serializeFeature(G,r)).filter(ye)??[],a=e.updateFeatures?.map(G=>this._serializeFeature(G,r)).filter(ye)??[],l=this._getFeatureIds(e.deleteFeatures,s);CHe(o,a,this.layer.spatialReference);const c=[],d=[],p=[...e.deleteAttachments??[]];for(const G of e.addAttachments??[])c.push(await this._serializeAttachment(G));for(const G of e.updateAttachments??[])d.push(await this._serializeAttachment(G));const y=c.length||d.length||p.length?{adds:c,updates:d,deletes:p}:null;let v,S=null;if(n){S=new Map;const G=[];for(const Y of e.addAssets??[])G.push(this._serializeAssetMapEditAndUploadAssets(Y,S));const V=await Promise.all(G);v=V.length?{adds:V,updates:[],deletes:[]}:void 0}const I={gdbVersion:i?.gdbVersion||this.layer.gdbVersion,rollbackOnFailure:i?.rollbackOnFailureEnabled,useGlobalIds:s,returnEditMoment:i?.returnEditMoment,usePreviousEditMoment:i?.usePreviousEditMoment,sessionId:i?.sessionId};i?.returnServiceEditsOption?(I.edits=JSON.stringify([{id:this.layer.layerId,adds:o,updates:a,deletes:l,attachments:y,assetMaps:v}]),I.returnServiceEditsOption=uGi.toJSON(i?.returnServiceEditsOption),I.returnServiceEditsInSourceSR=i?.returnServiceEditsInSourceSR):(I.adds=o.length?JSON.stringify(o):null,I.updates=a.length?JSON.stringify(a):null,I.deletes=l.length?s?JSON.stringify(l):l.join(","):null,I.attachments=y&&JSON.stringify(y),I.assetMaps=ye(v)?JSON.stringify(v):void 0);const O=this._getLayerRequestOptions({method:"post",query:I}),L=i?.returnServiceEditsOption?this.layer.url:this.layer.parsedUrl.path,N=await ir(L+"/applyEdits",O);if(!this.layer.capabilities.operations?.supportsEditing&&this.layer.effectiveCapabilities?.operations?.supportsEditing&&await Ro?.findCredential(this.layer.url)?.refreshToken(),n&&N.data!=null&&N.data.assetMaps!=null){const G=N.data,V=this.layer.objectIdField,Y=[];for(const re of G.addResults)re.success&&Y.push(re.objectId);for(const re of G.updateResults)re.success&&Y.push(re.objectId);const X=this._createRequestQueryOptions(),te=await ir(L+"/query",{...X,query:{f:"json",formatOf3DObjects:"3D_glb",where:`OBJECTID IN (${Y.join(",")})`,outFields:`${V}`}});if(te&&te.data&&te.data.assetMaps&&ye(S)){const re=te.data.assetMaps;for(const fe of re){const ge=S.get(fe.parentGlobalId).geometry;ye(ge)&&ge.type==="mesh"&&ge.updateExternalSource({source:[{name:fe.assetName,source:fe.assetName}],extent:ge.extent})}}}return this._createEditsResult(N)}async deleteAttachments(e,i){await this.load();const r=e.attributes[this.layer.objectIdField],n=this.layer.parsedUrl.path+"/"+r+"/deleteAttachments";try{return(await ir(n,this._getLayerRequestOptions({query:{attachmentIds:i.join(",")},method:"post"}))).data.deleteAttachmentResults.map(this._createFeatureEditResult)}catch(s){throw this._createAttachmentErrorResult(r,s)}}fetchRecomputedExtents(e={}){const i=e.signal;return this.load({signal:i}).then(async()=>{const r=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:n,url:s}=this.layer,{data:o}=await ir(`${s}/${n}`,r),{id:a,extent:l,fullExtent:c,timeExtent:d}=o,p=l||c;return{id:a,fullExtent:p&&vr.fromJSON(p),timeExtent:d&&Wg.fromJSON({start:d[0],end:d[1]})}})}async queryAttachments(e,i={}){await this.load();const r=this._getLayerRequestOptions(i);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,i){return await this.load(),this.queryTask.execute(e,{...i,query:this._createRequestQueryOptions(i)})}async queryFeaturesJSON(e,i){return await this.load(),this.queryTask.executeJSON(e,{...i,query:this._createRequestQueryOptions(i)})}async queryObjectIds(e,i){return await this.load(),this.queryTask.executeForIds(e,{...i,query:this._createRequestQueryOptions(i)})}async queryFeatureCount(e,i){return await this.load(),this.queryTask.executeForCount(e,{...i,query:this._createRequestQueryOptions(i)})}async queryExtent(e,i){return await this.load(),this.queryTask.executeForExtent(e,{...i,query:this._createRequestQueryOptions(i)})}async queryRelatedFeatures(e,i){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...i,query:this._createRequestQueryOptions(i)})}async queryRelatedFeaturesCount(e,i){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...i,query:this._createRequestQueryOptions(i)})}async queryTopFeatures(e,i){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...i,query:this._createRequestQueryOptions(i)})}async queryTopObjectIds(e,i){return await this.load(),this.queryTask.executeForTopIds(e,{...i,query:this._createRequestQueryOptions(i)})}async queryTopExtents(e,i){return await this.load(),this.queryTask.executeForTopExtents(e,{...i,query:this._createRequestQueryOptions(i)})}async queryTopCount(e,i){return await this.load(),this.queryTask.executeForTopCount(e,{...i,query:this._createRequestQueryOptions(i)})}async fetchPublishingStatus(){if(!N9(this.layer.url))return"unavailable";const e=dd(this.layer.url,"status"),i=await ir(e,{query:{f:"json"}});return hGi.fromJSON(i.data.status)}_createRequestQueryOptions(e){const i={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(i.timeReferenceUnknownClient=!0),i}async _fetchService(e,i){if(!e){const{data:n}=await ir(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:Gi("featurelayer-advanced-symbols")?{returnAdvancedSymbols:!0}:{},signal:i}));e=n}this.sourceJSON=this._patchServiceJSON(e);const r=e.type;if(!cGi.has(r))throw new st("feature-layer-source:unsupported-type",`Source type "${r}" is not supported`)}_patchServiceJSON(e){if(e.type!=="Table"&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const i=YV(e.geometryType).renderer;Ep("drawingInfo.renderer",i,e)}return e.geometryType==="esriGeometryMultiPatch"&&e.infoFor3D&&(e.geometryType="mesh"),e}_serializeFeature(e,i){const{geometry:r,attributes:n}=e;if(ye(i)&&ye(e.geometry)&&e.geometry.type==="mesh"){const s={...n},o=e.geometry,a=o.origin,l=o.transform;if(s[i.transformFieldRoles.originX]=a.x,s[i.transformFieldRoles.originY]=a.y,s[i.transformFieldRoles.originZ]=a.z,ye(l)){const c=l.translation,d=l.scale,p=l.rotation;s[i.transformFieldRoles.translationX]=c[0],s[i.transformFieldRoles.translationY]=-c[2],s[i.transformFieldRoles.translationZ]=c[1],s[i.transformFieldRoles.scaleX]=d[0],s[i.transformFieldRoles.scaleY]=d[1],s[i.transformFieldRoles.scaleZ]=d[2],s[i.transformFieldRoles.rotationX]=p[0],s[i.transformFieldRoles.rotationY]=p[2],s[i.transformFieldRoles.rotationZ]=p[1],s[i.transformFieldRoles.rotationDeg]=p[3]}return{geometry:null,attributes:s}}return lt(r)?{attributes:n}:r.type==="mesh"||r.type==="extent"?null:{geometry:r.toJSON(),attributes:n}}async _serializeAttachment(e){const{feature:i,attachment:r}=e,{globalId:n,name:s,contentType:o,data:a,uploadId:l}=r,c={globalId:n,parentGlobalId:null,contentType:null,name:null,uploadId:null,data:null};if(i&&(c.parentGlobalId="attributes"in i?i.attributes&&i.attributes[this.layer.globalIdField]:i.globalId),l)c.uploadId=l;else if(a){const d=await mbt(a);d&&(c.contentType=d.mediaType,c.data=d.data),a instanceof File&&(c.name=a.name)}return s&&(c.name=s),o&&(c.contentType=o),c}async _serializeAssetMapEditAndUploadAssets(e,i){const r=this.layer.url;let n=null;try{const d=new Blob([e.data],{type:e.mimeType}),p=new FormData;p.append("f","json"),p.append("file",d,`${e.assetName}`);const y={body:p,method:"post",responseType:"json"},{data:v}=await ir(`${r}/uploads/upload`,y);if(!v.success)throw new st("feature-layer-source:upload-failure","Expected upload to be successfull.");n={assetType:e.assetType,assetUploadId:v.item.itemID}}catch{n=null}if(lt(n)){const d=await mbt(new Blob([e.data]));if(!d.isBase64)throw new st("feature-layer-source:uploadAssets-failure","Expected gltf data in base64 format after conversion.");n={assetType:e.assetType,assetData:d.data}}if(lt(n))throw new st("feature-layer-source:uploadAssets-failure","Unable to prepare uploadAsset request options.");const s={method:"post",query:{f:"json",assets:JSON.stringify([n])},responseType:"json"},o=await ir(dd(this.layer.parsedUrl.path,"uploadAssets"),s);if(o.data.uploadResults.length!==1||!o.data.uploadResults[0].success)throw new st("feature-layer-source:uploadAssets-failure","Bad response.");const a=o.data.uploadResults[0].assetHash,l=[];e.flags&yfe.PROJECT_VERTICES&&l.push("PROJECT_VERTICES");const c={globalId:e.assetMapGlobalId,parentGlobalId:e.featureGlobalId,assetName:e.assetName,assetHash:a,flags:l};return i.set(e.featureGlobalId,e.feature),c}_getFeatureIds(e,i){const r=e?.[0];return r?this._canUseGlobalIds(i,e)?this._getGlobalIdsFromFeatureIdentifier(e):"objectId"in r?this._getObjectIdsFromFeatureIdentifier(e):this._getIdsFromFeatures(e):[]}_getIdsFromFeatures(e){const i=this.layer.objectIdField;return e.map(r=>r.attributes&&r.attributes[i])}_canUseGlobalIds(e,i){return e&&"globalId"in i[0]}_getObjectIdsFromFeatureIdentifier(e){return e.map(i=>i.objectId)}_getGlobalIdsFromFeatureIdentifier(e){return e.map(i=>i.globalId)}_createEditsResult(e){const i=e.data,{layerId:r}=this.layer,n=[];let s=null;if(Array.isArray(i))for(const l of i)n.push({id:l.id,editedFeatures:l.editedFeatures}),l.id===r&&(s={addResults:l.addResults??[],updateResults:l.updateResults??[],deleteResults:l.deleteResults??[],attachments:l.attachments,editMoment:l.editMoment});else s=i;const o=s?.attachments,a={addFeatureResults:s?.addResults?.map(this._createFeatureEditResult,this)??[],updateFeatureResults:s?.updateResults?.map(this._createFeatureEditResult,this)??[],deleteFeatureResults:s?.deleteResults?.map(this._createFeatureEditResult,this)??[],addAttachmentResults:o&&o.addResults?o.addResults.map(this._createFeatureEditResult,this):[],updateAttachmentResults:o&&o.updateResults?o.updateResults.map(this._createFeatureEditResult,this):[],deleteAttachmentResults:o&&o.deleteResults?o.deleteResults.map(this._createFeatureEditResult,this):[]};if(s?.editMoment&&(a.editMoment=s.editMoment),n.length>0){a.editedFeatureResults=[];for(const l of n){const{editedFeatures:c}=l,d=c?.spatialReference?new rr(c.spatialReference):null;a.editedFeatureResults.push({layerId:l.id,editedFeatures:{adds:c?.adds?.map(p=>this._createEditedFeature(p,d))||[],updates:c?.updates?.map(p=>({original:this._createEditedFeature(p[0],d),current:this._createEditedFeature(p[1],d)}))||[],deletes:c?.deletes?.map(p=>this._createEditedFeature(p,d))||[],spatialReference:d}})}}return a}_createEditedFeature(e,i){return new js({attributes:e.attributes,geometry:fl({...e.geometry,spatialReference:i})})}_createFeatureEditResult(e){const i=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:i?new st("feature-layer-source:edit-failure",i.description,{code:i.code}):null}}_createAttachmentErrorResult(e,i){const r=i.details.messages&&i.details.messages[0]||i.message,n=i.details.httpStatus||i.details.messageCode;return{objectId:e,globalId:null,error:new st("feature-layer-source:attachment-failure",r,{code:n})}}_getFormDataForAttachment(e,i){const r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(const n in i){const s=i[n];s!=null&&(r.set?r.set(n,s):r.append(n,s))}return r}_getLayerRequestOptions(e={}){const{parsedUrl:i,gdbVersion:r,dynamicDataSource:n}=this.layer;return{...e,query:{gdbVersion:r,layer:n?JSON.stringify({source:n}):void 0,...i.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}};E([k()],XU.prototype,"type",void 0),E([k({constructOnly:!0})],XU.prototype,"layer",void 0),E([k({readOnly:!0})],XU.prototype,"queryTask",null),XU=E([ht("esri.layers.graphics.sources.FeatureLayerSource")],XU);const gbt=Object.freeze(Object.defineProperty({__proto__:null,default:XU},Symbol.toStringTag,{value:"Module"}));function ybt(t){return t&&"getAtOrigin"in t&&"originOf"in t}function KU(t){t&&t.writtenProperties&&t.writtenProperties.forEach(({target:e,propName:i,newOrigin:r})=>{ybt(e)&&r&&e.originOf(i)!==r&&e.updateOrigin(i,r)})}const dGi=Ei.getLogger("esri.layers.FeatureLayer"),bfe="Feature Service";function aZ(t,e){return`Layer (title: ${t.title}, id: ${t.id}) of type '${t.declaredClass}' ${e}`}function vbt(t,e){if(e.type!==bfe)throw new st("feature-layer:portal-item-wrong-type",aZ(t,`should have portal item of type "${bfe}"`))}async function _bt(t){if(await t.load(),pne(t))throw new st("feature-layer:save",aZ(t,"using an in-memory source cannot be saved to a portal item"))}function pGi(t,e){let i=(t.messages??[]).filter(({type:r})=>r==="error").map(({name:r,message:n,details:s})=>new st(r,n,s));if(e?.ignoreUnsupported&&(i=i.filter(({name:r})=>r!=="layer:unsupported"&&r!=="symbol:unsupported"&&r!=="symbol-layer:unsupported"&&r!=="property:unsupported"&&r!=="url:unsupported")),i.length>0)throw new st("feature-layer:save","Failed to save feature layer due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:i})}async function G4e(t,e,i){"beforeSave"in t&&typeof t.beforeSave=="function"&&await t.beforeSave();const r=t.write({},e);return pGi(e,i),r}function bbt(t){const{layer:e,layerJSON:i}=t;return e.isTable?{layers:[],tables:[i]}:{layers:[i],tables:[]}}function V4e(t){YSe(t,cB.JSAPI),t.typeKeywords&&(t.typeKeywords=t.typeKeywords.filter((e,i,r)=>r.indexOf(e)===i))}function fGi(t){const e=t.portalItem;if(!e)throw dGi.error("save: requires the portalItem property to be set"),new st("feature-layer:portal-item-not-set",aZ(t,"requires the portalItem property to be set"));if(!e.loaded)throw new st("feature-layer:portal-item-not-loaded",aZ(t,"cannot be saved to a portal item that does not exist or is inaccessible"));vbt(t,e)}async function wbt(t,e){return/\/\d+\/?$/.test(t.url??"")?bbt(e[0]):mGi(t,e)}async function mGi(t,e){const{layer:{url:i,customParameters:r,apiKey:n}}=e[0];let s=await t.fetchData("json");s&&s.layers!=null&&s.tables!=null||(s=await gGi(s,{url:i??"",customParameters:r,apiKey:n},e.map(o=>o.layer.layerId)));for(const o of e)Sbt(o.layer,o.layerJSON,s);return s}async function gGi(t,e,i){var r,n;t||(t={}),(r=t).layers||(r.layers=[]),(n=t).tables||(n.tables=[]);const{url:s,customParameters:o,apiKey:a}=e,{serviceJSON:l,layersJSON:c}=await K3e(s,{customParameters:o,apiKey:a}),d=xbt(t.layers,l.layers,i),p=xbt(t.tables,l.tables,i);t.layers=d.itemResources,t.tables=p.itemResources;const y=[...d.added,...p.added],v=c?[...c.layers,...c.tables]:[];return await yGi(t,y,s,v),t}function xbt(t,e,i){const r=mkt(t,e,(s,o)=>s.id===o.id);t=t.filter(s=>!r.removed.some(o=>o.id===s.id));const n=r.added.map(({id:s})=>({id:s}));return n.forEach(({id:s})=>{t.push({id:s})}),{itemResources:t,added:n.filter(({id:s})=>!i.includes(s))}}async function yGi(t,e,i,r){const n=e.map(({id:s})=>new Hc({url:i,layerId:s,sourceJSON:r.find(({id:o})=>o===s)}));await bu(n.map(s=>s.load())),n.forEach(s=>{const{layerId:o,loaded:a,defaultPopupTemplate:l}=s;!a||lt(l)||Sbt(s,{id:o,popupInfo:l.toJSON()},t)})}function Sbt(t,e,i){t.isTable?Cbt(i.tables,e):Cbt(i.layers,e)}function Cbt(t,e){if(!t)return;const i=t.findIndex(({id:r})=>r===e.id);i===-1?t.push(e):t[i]=e}function vGi(t){const{portalItem:e}=t;return _8t(t)&&!t.dynamicDataSource&&!!e?.loaded&&e.type===bfe}async function _Gi(t){if(!t?.length)throw new st("feature-layer-utils-saveall:missing-parameters","'layers' array should contain at least one feature layer");await Promise.all(t.map(r=>r.load()));for(const r of t)if(!vGi(r))throw new st("feature-layer-utils-saveall:invalid-parameters",`'layers' array should only contain layers or tables in a feature service loaded from 'Feature Service' item. ${aZ(r,"does not conform")}`,{layer:r});const e=t.map(r=>r.portalItem.id);if(new Set(e).size>1)throw new st("feature-layer-utils-saveall:invalid-parameters","All layers in the 'layers' array should be loaded from the same portal item");const i=t.map(r=>r.layerId);if(new Set(i).size!==i.length)throw new st("feature-layer-utils-saveall:invalid-parameters","'layers' array should contain only one instance each of layer or table in a feature service")}function bGi(t,e){var i,r;let n=X0.from(e);return n.id&&(n=n.clone(),n.id=null),(i=n).type??(i.type=bfe),(r=n).portal??(r.portal=_c.getDefault()),vbt(t,n),n}async function wGi(t,e){const{url:i,layerId:r,title:n,fullExtent:s,isTable:o}=t,a=JC(i),l=ye(a)&&a.serverType==="FeatureServer";e.url=l?i:`${i}/${r}`,e.title||(e.title=n),e.extent=null,!o&&ye(s)&&(e.extent=await cqt(s)),QYe(e,cB.METADATA),QYe(e,cB.MULTI_LAYER),YSe(e,cB.SINGLE_LAYER),o&&YSe(e,cB.TABLE),V4e(e)}async function xGi(t,e,i){const r=t.portal;await r?.signIn(),await r?.user?.addItem({item:t,data:e,folder:i?.folder})}const SGi=$y(CGi);async function CGi(t,e){await _bt(t),fGi(t);const i=t.portalItem,r=J3e(i),n=await G4e(t,r,e),s=await wbt(i,[{layer:t,layerJSON:n}]);return V4e(i),await i.update({data:s}),KU(r),i}const TGi=$y(async(t,e)=>{await _Gi(t);const i=t[0].portalItem,r=J3e(i),n=await Promise.all(t.map(o=>G4e(o,r,e))),s=await wbt(i,t.map((o,a)=>({layer:o,layerJSON:n[a]})));return V4e(i),await i.update({data:s}),await Promise.all(t.slice(1).map(o=>o.portalItem.reload())),KU(r),i.clone()}),EGi=$y(IGi);async function IGi(t,e,i){await _bt(t);const r=bGi(t,e),n=J3e(r),s=bbt({layer:t,layerJSON:await G4e(t,n,i)});return await wGi(t,r),await xGi(r,s,i),t.portalItem=r,KU(n),r}const Tbt=Object.freeze(Object.defineProperty({__proto__:null,save:SGi,saveAll:TGi,saveAs:EGi},Symbol.toStringTag,{value:"Module"})),lZ=Object.freeze(Object.defineProperty({__proto__:null,buffer:Fmt,changeDefaultSpatialReferenceTolerance:Kmt,clearDefaultSpatialReferenceTolerance:Jmt,clip:fmt,contains:gmt,convexHull:Amt,crosses:ymt,cut:mmt,densify:jmt,difference:Pmt,disjoint:Smt,distance:vmt,equals:_mt,extendedSpatialReferenceInfo:pmt,flipHorizontal:Gmt,flipVertical:Vmt,generalize:Umt,geodesicArea:qmt,geodesicBuffer:Lmt,geodesicDensify:zmt,geodesicLength:Ymt,intersect:Rmt,intersectLinesToPoints:Xmt,intersects:bmt,isSimple:Emt,nearestCoordinate:kmt,nearestVertex:Nmt,nearestVertices:$mt,offset:Dmt,overlaps:Cmt,planarArea:Hmt,planarLength:Wmt,relate:Tmt,rotate:Bmt,simplify:Imt,symmetricDifference:Omt,touches:wmt,union:Mmt,within:xmt},Symbol.toStringTag,{value:"Module"}));let U4e=Ebt();function Ebt(){return new hae(50)}function AGi(){U4e=Ebt()}function PGi(t,e){if(t.type==="icon")return j4e(t,e);if(t.type==="object")return z4e(t,e);throw new st("symbol3d:unsupported-symbol-layer","computeLayerSize only works with symbol layers of type Icon and Object")}async function OGi(t,e){if(t.type==="icon")return RGi(t,e);if(t.type==="object")return DGi(t,e);throw new st("symbol3d:unsupported-symbol-layer","computeLayerSize only works with symbol layers of type Icon and Object")}async function j4e(t,e){if(t.resource?.href)return MGi(t.resource.href).then(i=>[i.width,i.height]);if(t.resource?.primitive)return ye(e)?[e,e]:[256,256];throw new st("symbol3d:invalid-symbol-layer","symbol layers of type Icon must have either an href or a primitive resource")}function RGi(t,e){return j4e(t,e).then(i=>{if(t.size==null)return i;const r=i[0]/i[1];return r>1?[t.size,t.size/r]:[t.size*r,t.size]})}function MGi(t){return ir(t,{responseType:"image"}).then(e=>e.data)}function z4e(t,e){return FGi(t,e).then(i=>fGt(i))}async function DGi(t,e){const i=await z4e(t,e);return bGt(i,t)}async function FGi(t,e){if(!t.isPrimitive){const r=_u(t.resource?.href),n=U4e.get(r);if(n!==void 0)return n;const s=await Promise.resolve().then(()=>PAr),o=await s.fetch(r,{disableTextures:!0});return U4e.put(r,o.referenceBoundingBox),o.referenceBoundingBox}let i=null;if(t.resource&&t.resource.primitive&&(i=Qb(CGt(t.resource.primitive)),ye(e)))for(let r=0;rr[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Ibt,uZ,Abt,wfe={};Ibt={get exports(){return wfe},set exports(t){wfe=t}},uZ=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(uZ=uZ||__filename),Abt=function(t){var e,i;(t=(t=t||{})!==void 0?t:{}).ready=new Promise(function(A,ve){e=A,i=ve});var r,n,s,o,a,l,c=Object.assign({},t),d=typeof window=="object",p=typeof importScripts=="function",y=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",v="";function S(A){return t.locateFile?t.locateFile(A,v):v+A}y?(v=p?require("path").dirname(v)+"/":__dirname+"/",l=()=>{a||(o=require("fs"),a=require("path"))},r=function(A,ve){return l(),A=a.normalize(A),o.readFileSync(A,ve?void 0:"utf8")},s=A=>{var ve=r(A,!0);return ve.buffer||(ve=new Uint8Array(ve)),ve},n=(A,ve,W)=>{l(),A=a.normalize(A),o.readFile(A,function(T,b){T?W(T):ve(b.buffer)})},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(A){if(!(A instanceof Ue))throw A}),process.on("unhandledRejection",function(A){throw A}),t.inspect=function(){return"[Emscripten Module object]"}):(d||p)&&(p?v=self.location.href:typeof document<"u"&&document.currentScript&&(v=document.currentScript.src),uZ&&(v=uZ),v=v.indexOf("blob:")!==0?v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1):"",r=A=>{var ve=new XMLHttpRequest;return ve.open("GET",A,!1),ve.send(null),ve.responseText},p&&(s=A=>{var ve=new XMLHttpRequest;return ve.open("GET",A,!1),ve.responseType="arraybuffer",ve.send(null),new Uint8Array(ve.response)}),n=(A,ve,W)=>{var T=new XMLHttpRequest;T.open("GET",A,!0),T.responseType="arraybuffer",T.onload=()=>{T.status==200||T.status==0&&T.response?ve(T.response):W()},T.onerror=W,T.send(null)}),t.print||console.log.bind(console);var I,O,L=t.printErr||console.warn.bind(console);Object.assign(t,c),c=null,t.arguments&&t.arguments,t.thisProgram&&t.thisProgram,t.quit&&t.quit,t.wasmBinary&&(I=t.wasmBinary),t.noExitRuntime,typeof WebAssembly!="object"&&ft("no native wasm support detected");var N,G,V,Y,X,te,re=!1,fe=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ge(A,ve,W){for(var T=ve+W,b=ve;A[b]&&!(b>=T);)++b;if(b-ve>16&&A.buffer&&fe)return fe.decode(A.subarray(ve,b));for(var m="";ve>10,56320|1023&F)}}else m+=String.fromCharCode((31&_)<<6|C)}else m+=String.fromCharCode(_)}return m}function _e(A,ve){return A?ge(V,A,ve):""}function Ie(A){N=A,t.HEAP8=G=new Int8Array(A),t.HEAP16=new Int16Array(A),t.HEAP32=Y=new Int32Array(A),t.HEAPU8=V=new Uint8Array(A),t.HEAPU16=new Uint16Array(A),t.HEAPU32=X=new Uint32Array(A),t.HEAPF32=new Float32Array(A),t.HEAPF64=new Float64Array(A)}t.INITIAL_MEMORY;var ke=[],Ne=[],J=[];function he(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)Oe(t.preRun.shift());Be(ke)}function xe(){Be(Ne)}function Pe(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)ze(t.postRun.shift());Be(J)}function Oe(A){ke.unshift(A)}function Ae(A){Ne.unshift(A)}function ze(A){J.unshift(A)}var Ge=0,Je=null;function et(A){Ge++,t.monitorRunDependencies&&t.monitorRunDependencies(Ge)}function tt(A){if(Ge--,t.monitorRunDependencies&&t.monitorRunDependencies(Ge),Ge==0&&Je){var ve=Je;Je=null,ve()}}function ft(A){t.onAbort&&t.onAbort(A),L(A="Aborted("+A+")"),re=!0,A+=". Build with -sASSERTIONS for more info.";var ve=new WebAssembly.RuntimeError(A);throw i(ve),ve}var Pt,$t="data:application/octet-stream;base64,";function St(A){return A.startsWith($t)}function Tt(A){return A.startsWith("file://")}function Lt(A){try{if(A==Pt&&I)return new Uint8Array(I);if(s)return s(A);throw"both async and sync fetching of the wasm failed"}catch(ve){ft(ve)}}function at(){if(!I&&(d||p)){if(typeof fetch=="function"&&!Tt(Pt))return fetch(Pt,{credentials:"same-origin"}).then(function(A){if(!A.ok)throw"failed to load wasm binary file at '"+Pt+"'";return A.arrayBuffer()}).catch(function(){return Lt(Pt)});if(n)return new Promise(function(A,ve){n(Pt,function(W){A(new Uint8Array(W))},ve)})}return Promise.resolve().then(function(){return Lt(Pt)})}function Ee(){var A={a:Ve};function ve(m,_){var C=m.exports;t.asm=C,Ie((O=t.asm.g).buffer),te=t.asm.m,Ae(t.asm.h),tt()}function W(m){ve(m.instance)}function T(m){return at().then(function(_){return WebAssembly.instantiate(_,A)}).then(function(_){return _}).then(m,function(_){L("failed to asynchronously prepare wasm: "+_),ft(_)})}function b(){return I||typeof WebAssembly.instantiateStreaming!="function"||St(Pt)||Tt(Pt)||y||typeof fetch!="function"?T(W):fetch(Pt,{credentials:"same-origin"}).then(function(m){return WebAssembly.instantiateStreaming(m,A).then(W,function(_){return L("wasm streaming compile failed: "+_),L("falling back to ArrayBuffer instantiation"),T(W)})})}if(et(),t.instantiateWasm)try{return t.instantiateWasm(A,ve)}catch(m){return L("Module.instantiateWasm callback failed with error: "+m),!1}return b().catch(i),{}}function Be(A){for(;A.length>0;){var ve=A.shift();if(typeof ve!="function"){var W=ve.func;typeof W=="number"?ve.arg===void 0?kt(W)():kt(W)(ve.arg):W(ve.arg===void 0?null:ve.arg)}else ve(t)}}St(Pt="lerc-wasm.wasm")||(Pt=S(Pt));var mt=[];function kt(A){var ve=mt[A];return ve||(A>=mt.length&&(mt.length=A+1),mt[A]=ve=te.get(A)),ve}function ct(A,ve,W,T){ft("Assertion failed: "+_e(A)+", at: "+[ve?_e(ve):"unknown filename",W,T?_e(T):"unknown function"])}function le(A){return At(A+24)+24}function it(A){this.excPtr=A,this.ptr=A-24,this.set_type=function(ve){X[this.ptr+4>>2]=ve},this.get_type=function(){return X[this.ptr+4>>2]},this.set_destructor=function(ve){X[this.ptr+8>>2]=ve},this.get_destructor=function(){return X[this.ptr+8>>2]},this.set_refcount=function(ve){Y[this.ptr>>2]=ve},this.set_caught=function(ve){ve=ve?1:0,G[this.ptr+12>>0]=ve},this.get_caught=function(){return G[this.ptr+12>>0]!=0},this.set_rethrown=function(ve){ve=ve?1:0,G[this.ptr+13>>0]=ve},this.get_rethrown=function(){return G[this.ptr+13>>0]!=0},this.init=function(ve,W){this.set_adjusted_ptr(0),this.set_type(ve),this.set_destructor(W),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var ve=Y[this.ptr>>2];Y[this.ptr>>2]=ve+1},this.release_ref=function(){var ve=Y[this.ptr>>2];return Y[this.ptr>>2]=ve-1,ve===1},this.set_adjusted_ptr=function(ve){X[this.ptr+16>>2]=ve},this.get_adjusted_ptr=function(){return X[this.ptr+16>>2]},this.get_exception_ptr=function(){if(gt(this.get_type()))return X[this.excPtr>>2];var ve=this.get_adjusted_ptr();return ve!==0?ve:this.excPtr}}function pt(A,ve,W){throw new it(A).init(ve,W),A}function Le(){ft("")}function ce(A,ve,W){V.copyWithin(A,ve,ve+W)}function Ce(){return 2147483648}function Ze(A){try{return O.grow(A-N.byteLength+65535>>>16),Ie(O.buffer),1}catch{}}function yt(A){var ve=V.length;A>>>=0;var W=Ce();if(A>W)return!1;let T=(_,C)=>_+(C-_%C)%C;for(var b=1;b<=4;b*=2){var m=ve*(1+.2/b);if(m=Math.min(m,A+100663296),Ze(Math.min(W,T(Math.max(A,m),65536))))return!0}return!1}var Ve={a:ct,c:le,b:pt,d:Le,f:ce,e:yt};Ee(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.h).apply(null,arguments)},t._lerc_getBlobInfo=function(){return(t._lerc_getBlobInfo=t.asm.i).apply(null,arguments)},t._lerc_getDataRanges=function(){return(t._lerc_getDataRanges=t.asm.j).apply(null,arguments)},t._lerc_decode=function(){return(t._lerc_decode=t.asm.k).apply(null,arguments)},t._lerc_decode_4D=function(){return(t._lerc_decode_4D=t.asm.l).apply(null,arguments)};var At=t._malloc=function(){return(At=t._malloc=t.asm.n).apply(null,arguments)};t._free=function(){return(t._free=t.asm.o).apply(null,arguments)};var ii,gt=t.___cxa_is_pointer_type=function(){return(gt=t.___cxa_is_pointer_type=t.asm.p).apply(null,arguments)};function Ue(A){this.name="ExitStatus",this.message="Program terminated with exit("+A+")",this.status=A}function ni(A){function ve(){ii||(ii=!0,t.calledRun=!0,re||(xe(),e(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),Pe()))}Ge>0||(he(),Ge>0||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),ve()},1)):ve()))}if(Je=function A(){ii||ni(),ii||(Je=A)},t.run=ni,t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return ni(),t.ready},Ibt.exports=Abt;const NGi=kGi({__proto__:null,default:wfe},[wfe]),$Gi=Object.freeze(Object.defineProperty({__proto__:null,l:NGi},Symbol.toStringTag,{value:"Module"}));var JU;const H4e=new WeakMap;let BGi=0,wE=JU=class extends Ni{constructor(t){super(t),this.wrap="repeat"}get url(){return this._get("url")||null}set url(t){this._set("url",t),t&&this._set("data",null)}get data(){return this._get("data")||null}set data(t){this._set("data",t),t&&this._set("url",null)}writeData(t,e,i,r){if(t instanceof HTMLImageElement){const n={type:"image-element",src:a2(t.src,r),crossOrigin:t.crossOrigin};e[i]=n}else if(t instanceof HTMLCanvasElement){const n=t.getContext("2d").getImageData(0,0,t.width,t.height),s={type:"canvas-element",imageData:this._encodeImageData(n)};e[i]=s}else if(t instanceof HTMLVideoElement){const n={type:"video-element",src:a2(t.src,r),autoplay:t.autoplay,loop:t.loop,muted:t.muted,crossOrigin:t.crossOrigin,preload:t.preload};e[i]=n}else if(t instanceof ImageData){const n={type:"image-data",imageData:this._encodeImageData(t)};e[i]=n}}readData(t){switch(t.type){case"image-element":{const e=new Image;return e.src=t.src,e.crossOrigin=t.crossOrigin,e}case"canvas-element":{const e=this._decodeImageData(t.imageData),i=document.createElement("canvas");return i.width=e.width,i.height=e.height,i.getContext("2d").putImageData(e,0,0),i}case"image-data":return this._decodeImageData(t.imageData);case"video-element":{const e=document.createElement("video");return e.src=t.src,e.crossOrigin=t.crossOrigin,e.autoplay=t.autoplay,e.loop=t.loop,e.muted=t.muted,e.preload=t.preload,e}default:return}}get transparent(){const t=this.data,e=this.url;if(t instanceof HTMLCanvasElement)return this._imageDataContainsTransparent(t.getContext("2d").getImageData(0,0,t.width,t.height));if(t instanceof ImageData)return this._imageDataContainsTransparent(t);if(e){const i=e.substr(e.length-4,4).toLowerCase(),r=e.substr(0,15).toLocaleLowerCase();if(i===".png"||r==="data:image/png;")return!0}return!1}set transparent(t){this._overrideIfSome("transparent",t)}get contentHash(){const t=typeof this.wrap=="string"?this.wrap:typeof this.wrap=="object"?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",e=(i="")=>`d:${i},t:${this.transparent},w:${t}`;return this.url!=null?e(this.url):this.data!=null?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?e(this.data.src):(H4e.has(this.data)||H4e.set(this.data,++BGi),e(H4e.get(this.data))):e()}clone(){const t={url:this.url,data:this.data,wrap:this._cloneWrap()};return new JU(t)}cloneWithDeduplication(t){const e=t.get(this);if(e)return e;const i=this.clone();return t.set(this,i),i}_cloneWrap(){return typeof this.wrap=="string"?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}_encodeImageData(t){let e="";for(let i=0;iv-c),y=new Uint32Array(BU(d,p,3));i.push({position:d,faces:y}),r+=d.length,n+=y.length}const s=zGi(i,r,n),o=Array.isArray(s.position)?aDe(s.position,3,{originalIndices:s.faces}):aDe(s.position.buffer,6,{originalIndices:s.faces});return s.position=new Float64Array(o.buffer),s.faces=o.indices,s}function zGi(t,e,i){if(t.length===1)return t[0];const r=Rbt(e),n=new Uint32Array(i);let s=0,o=0,a=0;for(const l of t){for(let c=0;c=0;v--){const S=t[v],I=i===Cfe.CCW_IS_HOLE&&WGi(S);if(I&&r!==1)n[a++]=S;else{let O=S.length;for(let N=0;N0&&(o[c++]={index:y,count:S.length}),y=I?Sfe(S,S.length-1,-1,p,y,S.length,e):Sfe(S,0,1,p,y,S.length,e);for(let N=0;N0&&(o[c++]={index:y,count:G.length}),y=Sfe(G,0,1,p,y,G.length,e)}a=0,L.count>0&&(s[l++]=L)}}for(let v=0;v0&&(o[c++]={index:y,count:S.length}),y=Sfe(S,0,1,p,y,S.length,e)}return s.length=l,o.length=c,{position:p,polygons:s,outlines:o}}function Sfe(t,e,i,r,n,s,o){n*=3;for(let a=0;aWFt),i),n=await Mbt(e,i),s=r(new Yi({x:0,y:0,z:0,spatialReference:t.spatialReference}),n.url,{resolveFile:tVi(n),useTransform:!0,signal:ye(i)?i.signal:null});s.then(()=>n.dispose(),()=>n.dispose());const{vertexAttributes:o,components:a}=await s;t.vertexAttributes=o,t.components=a}function tVi(t){const e=VH(t.url);return i=>{const r=ine(i,e,e),n=r?r.replace(/^ *\.\//,""):null;return(n?t.files.get(n):null)??i}}async function Mbt(t,e){return t instanceof Blob?Tfe.fromBlob(t):typeof t=="string"?new Tfe(t):Array.isArray(t)?iVi(t,e):rVi(t,e)}async function iVi(t,e){const i=new Map;let r=null;const n=await AH(t.map(async o=>({name:o.name,source:await Mbt(o instanceof Blob?o:o.source,e)}))),s=[];for(const o of n)o&&(bm(e)?o.source.dispose():s.push(o));sn(e);for(const{name:o,source:a}of s)(lt(r)||/\.(gltf|glb)/i.test(o))&&(r=a.url),i.set(o,a.url),a.files&&a.files.forEach((l,c)=>i.set(c,l));if(lt(r))throw new st("mesh-load-external:missing-files","Missing files to load external mesh source");return new Tfe(r,()=>s.forEach(({source:o})=>o.dispose()),i)}async function rVi(t,e){const{default:i}=await Vg(Promise.resolve().then(()=>_1e),e),r=typeof t.multipart[0]=="string"?await Promise.all(t.multipart.map(async n=>(await i(n,{responseType:"array-buffer"})).data)):t.multipart;return Tfe.fromBlob(new Blob(r))}let Tfe=class b5t{constructor(e,i=()=>{},r=new Map){this.url=e,this.dispose=i,this.files=r}static fromBlob(e){const i=URL.createObjectURL(e);return new b5t(i,()=>URL.revokeObjectURL(i))}};function nVi(t,e,i){t.vertexAttributes&&t.vertexAttributes.position&&(ye(t.transform)?(i?.geographic!=null&&i.geographic!==t.transform.geographic&&Ei.getLogger("esri.geometry.support.meshUtils.offset").warn(`Specifying the 'geographic' parameter (${i.geographic}) different from the Mesh transform setting (${t.transform.geographic}) is not supported`),sVi(t.transform,e)):GN(t.spatialReference,i)?oVi(t,e):aVi(t,e))}function sVi(t,e){const i=t.origin;t.origin=Uc(Qr(),i,e)}function oVi(t,e){const i=t.spatialReference,r=t.vertexAttributes.position,n=t.vertexAttributes.normal,s=t.vertexAttributes.tangent,o=new Float64Array(r.length),a=ye(n)?new Float32Array(n.length):null,l=ye(s)?new Float32Array(s.length):null,c=t.extent.center,d=lVi;sB(i,[c.x,c.y,c.z],Fbt,FD(i)),aX(Lbt,Fbt),RC(d,e,Lbt),Jde(r,i,o),ye(n)&&ye(a)&&Xde(n,r,o,i,a),ye(s)&&ye(l)&&Qde(s,r,o,i,l),Dbt(o,d),Zde(o,r,i),ye(n)&&ye(a)&&Kde(a,r,o,i,n),ye(s)&&ye(l)&&epe(l,r,o,i,s),t.vertexAttributesChanged()}function aVi(t,e){Dbt(t.vertexAttributes.position,e),t.vertexAttributesChanged()}function Dbt(t,e){if(t)for(let i=0;i=s&&d=5-1,O=v===2||v===4,L=S?i-1:i;for(let N=0;N<=L;N++){const G=N/L*2*Math.PI,V=S?0:.5;rm[0]=V*Math.sin(G),rm[1]=V*-Math.cos(G),rm[2]=v<=2?.5:-.5;for(let Y=0;Y<3;Y++)n[l++]=rm[Y],s[c++]=I?Y===2?v<=1?1:-1:0:Y===2?0:rm[Y]/V;o[d++]=(N+(S?.5:0))/i,o[d++]=v<=1?1*v/3:v<=3?1*(v-2)/3+.3333333333333333:1*(v-4)/3+.6666666666666666,O||v===0||N===i||(v!==5&&(a[p++]=y,a[p++]=y+1,a[p++]=y-i),v!==1&&(a[p++]=y,a[p++]=y-i,a[p++]=y-i-1)),y++}}return{position:n,normal:s,uv:o,faces:a}}function pVi(t,e){const i=typeof e=="number"?e:e!=null?e.width:1,r=typeof e=="number"?e:e!=null?e.height:1;switch(t){case"up":case"down":return{width:i,depth:r};case"north":case"south":return{width:i,height:r};case"east":case"west":return{depth:i,height:r}}}function fVi(t){const e=dZ.facingAxisOrderSwap[t],i=dZ.position,r=dZ.normal,n=new Float64Array(i.length),s=new Float32Array(r.length);let o=0;for(let a=0;a<4;a++){const l=o;for(let c=0;c<3;c++){const d=e[c],p=Math.abs(d)-1,y=d>=0?1:-1;n[o]=i[l+p]*y,s[o]=r[l+p]*y,o++}}return{position:n,normal:s,uv:new Float32Array(dZ.uv),faces:new Uint32Array(dZ.faces),isPlane:!0}}const tj=1,ij=2,rj=3,dZ={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:[rj,tj,ij],west:[-rj,-tj,ij],north:[-tj,rj,ij],south:[tj,-rj,ij],up:[tj,ij,rj],down:[tj,-ij,-rj]}};function Efe(t,e,i){t.isPlane||mVi(t),gVi(t,i?.size);const{vertexAttributes:r,transform:n}=Myt(t,e,i);return{vertexAttributes:new gy({...r,uv:t.uv}),transform:n,components:[new d6({faces:t.faces,material:i&&i.material||null})],spatialReference:e.spatialReference}}function mVi(t){for(let e=0;e{this.handles.add(Qi(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(t=>t.clone())}),()=>this._set("external",null),{once:!0,sync:!0}))})}get hasExtent(){return!this.loaded&&ye(this.external)&&ye(this.external.extent)||this.loaded&&this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0)}get _boundingInfo(){const t=this.vertexAttributes.position,e=this.spatialReference;if(t.length===0||this.components&&this.components.length===0)return{extent:new vr({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:e}),center:new Yi({x:0,y:0,z:0,spatialReference:e})};const i=ye(this.transform)?this.transform.project(t,e):t;let r=1/0,n=1/0,s=1/0,o=-1/0,a=-1/0,l=-1/0,c=0,d=0,p=0;const y=i.length,v=1/(y/3);let S=0;for(;Sn.cloneWithDeduplication(i,r))}const e={components:t,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),transform:ye(this.transform)?this.transform.clone():null,external:ye(this.external)?{source:this.external.source,extent:ye(this.external.extent)?this.external.extent.clone():null}:null};return new bS(e)}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(t){const e=Promise.resolve().then(()=>sPr),i=this.load(),r=await Promise.all([e,i]),{toBinaryGLTF:n}=r[0];return n(this,t)}static createBox(t,e){if(!(t instanceof Yi))return Ei.getLogger(p6).error(".createBox()","expected location to be a Point instance"),null;const i=new bS(Efe(uVi(),t,e));return e&&e.imageFace&&e.imageFace!=="all"?cVi(i,e.imageFace):i}static createSphere(t,e){return t instanceof Yi?new bS(Efe(hVi(e&&e.densificationFactor||0),t,e)):(Ei.getLogger(p6).error(".createSphere()","expected location to be a Point instance"),null)}static createCylinder(t,e){return t instanceof Yi?new bS(Efe(dVi(e&&e.densificationFactor||0),t,e)):(Ei.getLogger(p6).error(".createCylinder()","expected location to be a Point instance"),null)}static createPlane(t,e){if(!(t instanceof Yi))return Ei.getLogger(p6).error(".createPlane()","expected location to be a Point instance"),null;const i=e?.facing??"up",r=pVi(i,e?.size);return new bS(Efe(fVi(i),t,{...e,size:r}))}static createFromPolygon(t,e){if(!(t instanceof po))return Ei.getLogger(p6).error(".createFromPolygon()","expected polygon to be a Polygon instance"),null;const i=jGi(t);return new bS({vertexAttributes:new gy({position:i.position}),components:[new d6({faces:i.faces,shading:"flat",material:e?.material??null})],spatialReference:t.spatialReference})}static async createFromGLTF(t,e,i){if(!(t instanceof Yi))throw Ei.getLogger(p6).error(".createfromGLTF()","expected location to be a Point instance"),new st("invalid-input","Expected location to be a Point instance");const{loadGLTFMesh:r}=await Vg(Promise.resolve().then(()=>WFt),i);return new bS(await r(t,e,i))}static createWithExternalSource(t,e,i){const r=i?.extent??null,n=i?.transform?.clone()??new tU;n.origin=[t.x,t.y,t.z??0];const s=t.spatialReference;return new bS({external:{source:e,extent:r},transform:n,spatialReference:s})}static createIncomplete(t,e){const i=e?.transform?.clone()??new tU;i.origin=[t.x,t.y,t.z??0];const r=t.spatialReference,n=new bS({transform:i,spatialReference:r});return n.addResolvingPromise(Promise.reject(new st("mesh-incomplete","Mesh resources are not complete"))),n}};E([k({type:[d6],json:{write:!0}})],G_.prototype,"components",void 0),E([k({type:tU,json:{write:!0}})],G_.prototype,"transform",void 0),E([k({constructOnly:!0})],G_.prototype,"external",void 0),E([k({readOnly:!0})],G_.prototype,"hasExtent",null),E([k({readOnly:!0})],G_.prototype,"_boundingInfo",null),E([k({readOnly:!0})],G_.prototype,"anchor",null),E([k({readOnly:!0})],G_.prototype,"origin",null),E([k({readOnly:!0,json:{read:!1}})],G_.prototype,"extent",null),E([k({readOnly:!0,json:{read:!1,write:!0,default:!0}})],G_.prototype,"hasZ",void 0),E([k({readOnly:!0,json:{read:!1,write:!0,default:!1}})],G_.prototype,"hasM",void 0),E([k({type:gy,nonNullable:!0,json:{write:!0}})],G_.prototype,"vertexAttributes",void 0),G_=bS=E([ht(p6)],G_);const Z4e={x:Ma(1,0,0),y:Ma(0,1,0),z:Ma(0,0,1)},aj=hE(),Hbt=hE(),Wbt=hE(),Afe=Qr(),qbt=G_;function IVi(t,e,i){const r=i.features;i.features=[],delete i.geometryType;const n=Wu.fromJSON(i);if(n.geometryType="mesh",!i.assetMaps)return n;const s=MVi(e,i.assetMaps),o=n.spatialReference??rr.WGS84,a=i.globalIdFieldName,{outFields:l}=t,c=ye(l)&&l.length>0?AVi(l.includes("*")?null:new Set(l)):()=>({});for(const d of r){const p=PVi(d,a,o,e,s);ye(p)&&n.features.push(new js({geometry:p,attributes:c(d)}))}return n}function AVi(t){return({attributes:e})=>{if(!e)return{};if(!t)return e;for(const i in e)t.has(i)||delete e[i];return e}}function PVi(t,e,i,r,n){const s=t.attributes[e],o=n.get(s);if(o==null||o.status===oF.FAILED||o.url==null)return null;const a=OVi(t,i,r),l=vr.fromJSON(t.geometry);l.spatialReference=i;const c=RVi(t.attributes,r,o.projectVertices);return o.status===oF.PENDING?qbt.createIncomplete(a,{extent:l,transform:c}):qbt.createWithExternalSource(a,[{name:o.name,source:o.url}],{extent:l,transform:c})}function OVi({attributes:t},e,{transformFieldRoles:i}){return new Yi({x:t[i.originX],y:t[i.originY],z:t[i.originZ],spatialReference:e})}function RVi(t,{transformFieldRoles:e},i){return new tU({translation:[t[e.translationX],-t[e.translationZ],t[e.translationY]],rotation:Vde([t[e.rotationX],t[e.rotationZ],t[e.rotationY]],t[e.rotationDeg]),scale:[t[e.scaleX],t[e.scaleY],t[e.scaleZ]],geographic:i})}var oF;function MVi(t,e){const i=new Map;for(const r of e){const n=r.parentGlobalId;if(n==null)continue;const s=r.assetName,o=r.assetURL,a=r.conversionStatus;let l=i.get(n);if(l==null)switch(l={name:s,status:oF.FAILED,url:o,projectVertices:DVi(r.flags).projectVertices},i.set(n,l),a){case"COMPLETED":case"SUBMITTED":l.status=oF.COMPLETED;break;case"INPROGRESS":l.status=oF.PENDING;break;default:l.status=oF.FAILED}else console.warn(`Multiple asset parts not expected. Ignoring additional parts. conflicting assetname: ${r.assetName}`)}return i}function DVi(t){return{projectVertices:t.includes("PROJECT_VERTICES")}}(function(t){t[t.FAILED=0]="FAILED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"})(oF||(oF={}));const FVi=Object.freeze(Object.defineProperty({__proto__:null,meshFeatureSetFromJSON:IVi},Symbol.toStringTag,{value:"Module"})),Q4e=Ei.getLogger("esri.layers.support.ElevationSampler");let Ybt=class{queryElevation(e){return kVi(e.clone(),this)}on(){return GVi}projectIfRequired(e,i){return Kbt(e,i)}},LVi=class extends Ybt{get spatialReference(){return this.extent.spatialReference}constructor(e,i,r){super(),this.tile=e,this.noDataValue=r;const n=e.tile.extent;this.extent=kL(n,i.spatialReference),this.extent.zmin=e.zmin,this.extent.zmax=e.zmax,this._aaExtent=n;const s=Vc(i.spatialReference),o=i.lodAt(e.tile.level).resolution*s;this.demResolution={min:o,max:o}}contains(e){const i=this.projectIfRequired(e,this.spatialReference);return!lt(i)&&this.containsAt(i.x,i.y)}containsAt(e,i){return p7e(this._aaExtent,e,i)}elevationAt(e,i){if(!this.containsAt(e,i)){const r=this.extent,n=`${r.xmin}, ${r.ymin}, ${r.xmax}, ${r.ymax}`;return Q4e.warn("#elevationAt()",`Point used to sample elevation (${e}, ${i}) is outside of the sampler extent (${n})`),this.noDataValue}return Fu(this.tile.sample(e,i),this.noDataValue)}},Xbt=class extends Ybt{get spatialReference(){return this.extent.spatialReference}constructor(e,i,r){let n;super(),typeof i=="number"?(this.noDataValue=i,n=null):(n=i,this.noDataValue=r),this.samplers=n?e.map(o=>new LVi(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;li?i:t}let UVi=class{async queryAll(e,i,r){if(!(e=r&&r.ignoreInvisibleLayers?e.filter(c=>c.visible):e.slice()).length)throw new st("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");const n=pZ.fromGeometry(i);let s=!1;r&&r.returnSampleInfo||(s=!0);const o={...Pfe,...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,i,r){if(!e)throw new st("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!i||!(i instanceof pZ)&&i.type!=="point"&&i.type!=="multipoint"&&i.type!=="polyline")throw new st("elevation-query:invalid-geometry","Only point, polyline and multipoint geometries can be used to query elevation");const n={...Pfe,...r},s=new jVi(e,i.spatialReference,n),o=n.signal;return await e.load({signal:o}),await this._createGeometryDescriptor(s,i,o),await this._selectTiles(s,o),await this._populateElevationTiles(s,o),this._sampleGeometryWithElevation(s),this._createQueryResult(s,o)}async createSampler(e,i,r){if(!e)throw new st("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!i||i.type!=="extent")throw new st("elevation-query:invalid-extent","Invalid or undefined extent");const n={...Pfe,...r};return this._createSampler(e,i,n)}async createSamplerAll(e,i,r){if(!(e=r&&r.ignoreInvisibleLayers?e.filter(o=>o.visible):e.slice()).length)throw new st("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");if(!i||i.type!=="extent")throw new st("elevation-query:invalid-extent","Invalid or undefined extent");const n={...Pfe,...r,returnSampleInfo:!0},s=await this._createSampler(e[e.length-1],i,n);return this._createSamplerAllContinue(e,i,s,n)}async _createSampler(e,i,r,n){const s=r.signal;await e.load({signal:s});const o=i.spatialReference,a=e.tileInfo.spatialReference;o.equals(a)||(await YR([{source:o,dest:a}],{signal:s}),i=rp(i,a));const l=new zVi(e,i,r,n);return await this._selectTiles(l,s),await this._populateElevationTiles(l,s),new Xbt(l.elevationTiles,l.layer.tileInfo,l.options.noDataValue)}async _createSamplerAllContinue(e,i,r,n){if(e.pop(),!e.length)return r;const s=r.samplers.map(c=>fR(c.extent)),o=await this._createSampler(e[e.length-1],i,n,s);if(o.samplers.length===0)return r;const a=r.samplers.concat(o.samplers),l=new Xbt(a,n.noDataValue);return this._createSamplerAllContinue(e,i,l,n)}async _queryAllContinue(e,i,r){const n=e.pop(),s=i.geometry.coordinates,o=i.sampleInfo;ig(o);const a=[],l=[];for(let y=0;y=0?v.source||(v.source=n):e.length&&(a.push(s[y]),l.push(y))}if(!e.length||a.length===0)return i;const c=i.geometry.clone(a),d=await this.query(e[e.length-1],c,r),p=d.sampleInfo;if(!p)throw new Error("no sampleInfo");return l.forEach((y,v)=>{s[y].z=d.geometry.coordinates[v].z,o[y].demResolution=p[v].demResolution}),this._queryAllContinue(e,i,r)}async _createQueryResult(e,i){const r=await e.geometry.project(e.outSpatialReference,i);ig(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,i,r){let n;const s=e.layer.tileInfo.spatialReference;if(i instanceof pZ?n=await i.project(s,r):(await YR([{source:i.spatialReference,dest:s}],{signal:r}),n=rp(i,s)),!n)throw new st("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${i.spatialReference.wkid}' on an elevation service in '${s.wkid}'`);e.geometry=pZ.fromGeometry(n)}async _selectTiles(e,i){const r=e.options.demResolution;if(e.type==="geometry"&&this._preselectOutsideLayerExtent(e),typeof r=="number")this._selectTilesClosestResolution(e);else if(r==="finest-contiguous")await this._selectTilesFinestContiguous(e,i);else{if(r!=="auto")throw new st("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${r}', expected a number, "finest-contiguous" or "auto"`);await this._selectTilesAuto(e,i)}}_preselectOutsideLayerExtent(e){if(lt(e.layer.fullExtent))return;const i=new Jbt(null);i.sample=()=>e.options.noDataValue,e.outsideExtentTile=i;const r=e.layer.fullExtent;e.geometry.coordinates.forEach(n=>{const s=n.x,o=n.y;(sr.xmax||or.ymax)&&(n.elevationTile=i)})}_selectTilesClosestResolution(e){const i=e.layer.tileInfo,r=this._findNearestDemResolutionLODIndex(i,e.options.demResolution);e.selectTilesAtLOD(r)}_findNearestDemResolutionLODIndex(e,i){const r=i/Vc(e.spatialReference);let n=e.lods[0],s=0;for(let o=1;os.fetchAvailability(a.level,a.row,a.col,{signal:r}))),r);else if(await this._populateElevationTiles(e,r),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new st("elevation-query:has-unavailable-tiles")}catch(a){Ga(a),await this._selectTilesFinestContiguousAt(e,i-1,r)}}async _populateElevationTiles(e,i){const r=e.getTilesToFetch(),n={},s=e.options.cache,o=e.options.noDataValue,a=r.map(async l=>{if(l.id==null)return;const c=`${e.layer.uid}:${l.id}:${o}`,d=ye(s)?s.get(c):null,p=ye(d)?d:await e.layer.fetchTile(l.level,l.row,l.col,{noDataValue:o,signal:i});ye(s)&&s.put(c,p),n[l.id]=new Jbt(l,p)});await Vg(bu(a),i),e.populateElevationTiles(n)}async _selectTilesAuto(e,i){this._selectTilesAutoFinest(e),this._reduceTilesForMaximumRequests(e);const r=e.layer.tilemapCache;if(!r)return this._selectTilesAutoPrefetchUpsample(e,i);const n=e.getTilesToFetch(),s={},o=n.map(async a=>{const l=new kB(null,0,0,0,_o()),c=await TC(r.fetchAvailabilityUpsample(a.level,a.row,a.col,l,{signal:i}));c.ok!==!1?a.id!=null&&(s[a.id]=l):Ga(c.error)});await Vg(Promise.all(o),i),e.remapTiles(s)}_reduceTilesForMaximumRequests(e){const i=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 c=n[l.id];c===1?(delete n[l.id],r--):n[l.id]=c-1};e.forEachTileToFetch(s,o);let a=!0;for(;a&&(a=!1,e.forEachTileToFetch(l=>{r<=e.options.maximumAutoTileRequests||(o(l),i.upsampleTile(l)&&(a=!0),s(l))},o),a););}_selectTilesAutoFinest(e){const i=eLe(e.layer.tileInfo,e.options.minDemResolution);e.selectTilesAtLOD(i,e.options.maximumAutoTileRequests)}async _selectTilesAutoPrefetchUpsample(e,i){const r=e.layer.tileInfo;await this._populateElevationTiles(e,i);let n=!1;e.forEachTileToFetch((s,o)=>{r.upsampleTile(s)?n=!0:o()}),n&&await this._selectTilesAutoPrefetchUpsample(e,i)}_sampleGeometryWithElevation(e){e.geometry.coordinates.forEach(i=>{const r=i.elevationTile;let n=e.options.noDataValue;if(r){const s=r.sample(i.x,i.y);ye(s)?n=s:i.elevationTile=null}i.z=n})}_extractSampleInfo(e){const i=e.layer.tileInfo,r=Vc(i.spatialReference);return e.geometry.coordinates.map(n=>{let s=-1;return n.elevationTile&&n.elevationTile!==e.outsideExtentTile&&(s=i.lodAt(n.elevationTile.tile.level).resolution*r),{demResolution:s}})}},pZ=class o_e{export(){return this._exporter(this.coordinates,this.spatialReference)}clone(e){const i=new o_e;return i.geometry=this.geometry,i.spatialReference=this.spatialReference,i.coordinates=e||this.coordinates.map(r=>r.clone()),i._exporter=this._exporter,i}async project(e,i){if(this.spatialReference.equals(e))return this.clone();await YR([{source:this.spatialReference,dest:e}],{signal:i});const r=new fd({spatialReference:this.spatialReference,points:this.coordinates.map(a=>[a.x,a.y])}),n=rp(r,e);if(!n)return null;const s=this.coordinates.map((a,l)=>{const c=a.clone(),d=n.points[l];return c.x=d[0],c.y=d[1],c}),o=this.clone(s);return o.spatialReference=e,o}static fromGeometry(e){const i=new o_e;if(i.geometry=e,i.spatialReference=e.spatialReference,e instanceof o_e)i.coordinates=e.coordinates.map(r=>r.clone()),i._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;i.coordinates=n&&s?[new sx(r.x,r.y,r.z,r.m)]:n?[new sx(r.x,r.y,r.z)]:s?[new sx(r.x,r.y,null,r.m)]:[new sx(r.x,r.y)],i._exporter=(o,a)=>e.hasM?new Yi(o[0].x,o[0].y,o[0].z,o[0].m,a):new Yi(o[0].x,o[0].y,o[0].z,a);break}case"multipoint":{const r=e,{hasZ:n,hasM:s}=r;i.coordinates=n&&s?r.points.map(o=>new sx(o[0],o[1],o[2],o[3])):n?r.points.map(o=>new sx(o[0],o[1],o[2])):s?r.points.map(o=>new sx(o[0],o[1],null,o[2])):r.points.map(o=>new sx(o[0],o[1])),i._exporter=(o,a)=>e.hasM?new fd({points:o.map(l=>[l.x,l.y,l.z,l.m]),hasZ:!0,hasM:!0,spatiaReference:a}):new fd(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 c of r.paths)if(s.push([l,l+c.length]),l+=c.length,o&&a)for(const d of c)n.push(new sx(d[0],d[1],d[2],d[3]));else if(o)for(const d of c)n.push(new sx(d[0],d[1],d[2]));else if(a)for(const d of c)n.push(new sx(d[0],d[1],null,d[2]));else for(const d of c)n.push(new sx(d[0],d[1]));i.coordinates=n,i._exporter=(c,d)=>{const p=e.hasM?c.map(v=>[v.x,v.y,v.z,v.m]):c.map(v=>[v.x,v.y,v.z]),y=s.map(v=>p.slice(v[0],v[1]));return new va({paths:y,hasM:e.hasM,hasZ:!0,spatialReference:d})};break}}return i}},sx=class w5t{constructor(e,i,r=null,n=null,s=null,o=null){this.x=e,this.y=i,this.z=r,this.m=n,this.tile=s,this.elevationTile=o}clone(){return new w5t(this.x,this.y,this.z,this.m)}},Qbt=class{constructor(e,i){this.layer=e,this.options=i}},jVi=class extends Qbt{constructor(e,i,r){super(e,r),this.outSpatialReference=i,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(i=>{i.tile=null});else{const i=this.layer.tileInfo,r=i.lods[e].level;this.geometry.coordinates.forEach(n=>{n.tile=i.tileAt(r,n.x,n.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 i of this.geometry.coordinates)!i.elevationTile&&i.tile?.id&&(i.elevationTile=e[i.tile.id])}remapTiles(e){for(const i of this.geometry.coordinates){const r=i.tile?.id;i.tile=r?e[r]:null}}getTilesToFetch(){const e={},i=[];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,i.push(n))}return i}forEachTileToFetch(e){for(const i of this.geometry.coordinates)i.tile&&!i.elevationTile&&e(i.tile,()=>{i.tile=null})}},zVi=class extends Qbt{constructor(e,i,r,n){super(e,r),this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=i.intersection(e.fullExtent),this.maskExtents=n}selectTilesAtLOD(e,i){const r=this._maximumLodForRequests(i),n=Math.min(r,e);n<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(n)}_maximumLodForRequests(e){const i=this.layer.tileInfo;if(!e)return i.lods.length-1;const r=this.extent;if(lt(r))return-1;for(let n=i.lods.length-1;n>=0;n--){const s=i.lods[n],o=s.resolution*i.size[0],a=s.resolution*i.size[1];if(Math.ceil(r.width/o)*Math.ceil(r.height/a)<=e)return n}return-1}allElevationTilesFetched(){return this._candidateTiles.length===this.elevationTiles.length}clearElevationTiles(){this.elevationTiles.length=0,this._fetchedCandidates.clear()}populateElevationTiles(e){for(const i of this._candidateTiles){const r=i.id&&e[i.id];r&&(this._fetchedCandidates.add(i),this.elevationTiles.push(r))}}remapTiles(e){this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles.map(i=>e[i.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,i){const r=this._candidateTiles;this._candidateTiles=[],r.forEach(n=>{if(this._fetchedCandidates.has(n))return void(i&&i(n));let s=!1;e(n,()=>s=!0),s?i&&i(n):this._candidateTiles.push(n)}),this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles,i)}_uniqueNonOverlappingTiles(e,i){const r={},n=[];for(const o of e){const a=o.id;a&&!r[a]?(r[a]=o,n.push(o)):i&&i(o)}const s=n.sort((o,a)=>o.level-a.level);return s.filter((o,a)=>{for(let l=0;le.extent&&ewe(i,e.extent))}};function eLe(t,e=0){let i=t.lods.length-1;if(e>0){const r=e/Vc(t.spatialReference),n=t.lods.findIndex(s=>s.resolution0&&(i=n-1)}return i}const Pfe={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0},Ofe=Object.freeze(Object.defineProperty({__proto__:null,ElevationQuery:UVi,GeometryDescriptor:pZ,getFinestLodIndex:eLe},Symbol.toStringTag,{value:"Module"}));/*! +`;const o=this.attributes(),a=this.attributesInfo();let l=-1;for(const c of o){l++;const{name:h,type:p,precisionFactor:y,isLayout:v}=a[c],x=y&&y!==1?" * "+1/y:"",{bytesPerElement:I,count:P}=TBe._encodingInfo[p],F=k=>`a_data_${k.dataIndex}${rVi(P,k.offset,I)}`;switch(this.getAtributeState(l)){case d6.UNIFORM:{const k=this._getType(P),j=`u_${h}`;s.push({name:j,type:k,getValue:(V,Y,X,Z)=>{const ie=v?V.getLayoutValue(c,Y):V.getPaintValue(c,Y);if(p===Gs.R16G16B16A16_DASHARRAY){const ce=V.getDashKey(ie,V.getLayoutValue("line-cap",Y)),he=Z.getMosaicItemPosition(ce,!1);if(lt(he))return null;const{tl:_e,br:xe}=he;return[_e[0],xe[1],xe[0],_e[1]]}if(p===Gs.R16G16B16A16_PATTERN){const ce=Z.getMosaicItemPosition(ie,!c.includes("line-"));if(lt(ce))return null;const{tl:he,br:_e}=ce;return[he[0],_e[1],_e[0],he[1]]}if(p===Gs.R8G8B8A8_COLOR){const ce=ie[3];return[ce*ie[0],ce*ie[1],ce*ie[2],ce]}return ie}}),r+=`uniform ${k} ${j}; +`,n+=`${k} ${h} = ${j}; +`}break;case d6.DATA_DRIVEN:{const k=F(i[c][0]);n+=`${this._getType(P)} ${h} = ${k}${x}; +`}break;case d6.INTERPOLATED_DATA_DRIVEN:{const k=`u_t_${h}`;s.push({name:k,type:"float",getValue:(Y,X,Z,ie)=>(v?Y.getLayoutProperty(c):Y.getPaintProperty(c)).interpolator.interpolationUniformValue(Z,X)}),r+=`uniform float ${k}; +`;const j=F(i[c][0]),V=F(i[c][1]);n+=`${this._getType(P)} ${h} = mix(${j}${x}, ${V}${x}, ${k}); +`}}}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 i=255*e[3];return Wm.i8888to32(e[0]*i,e[1]*i,e[2]*i,i)}_encodePattern(e,i,r){if(!r||!r.rect)return;const n=2,s=r.rect,o=r.width,a=r.height;i[e]=this._encodeShort(s.x+n,0),i[e]|=this._encodeShort(s.y+n+a,16),i[e+1]=this._encodeShort(s.x+n+o,0),i[e+1]|=this._encodeShort(s.y+n,16)}_encodeByte(e,i){return(255&e)<{switch(t){case Bi.FLOAT:case Bi.INT:case Bi.UNSIGNED_INT:return 4;case Bi.SHORT:case Bi.UNSIGNED_SHORT:return 2;case Bi.BYTE:case Bi.UNSIGNED_BYTE:return 1}},rVi=(t,e,i)=>{const r=e/i;if(t===1)switch(r){case 0:return".x";case 1:return".y";case 2:return".z";case 3:return".w"}else if(t===2)switch(r){case 0:return".xy";case 1:return".yz";case 2:return".zw"}else if(t===3)switch(r){case 0:return".xyz";case 1:return".yzw"}return""};let JG=class o_e extends aF{constructor(e){super(e)}geometryInfo(){return o_e.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return o_e.ATTRIBUTES}attributesInfo(){return o_e.ATTRIBUTES_INFO}};JG.ATTRIBUTES=[],JG.GEOMETRY_LAYOUT=[new na("a_pos",2,Bi.BYTE,0,2)],JG.ATTRIBUTES_INFO={};let ZG=class a_e extends aF{constructor(e){super(e)}geometryInfo(){return a_e.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return a_e.ATTRIBUTES}attributesInfo(){return a_e.ATTRIBUTES_INFO}};ZG.ATTRIBUTES=["circle-radius","circle-color","circle-opacity","circle-stroke-width","circle-stroke-color","circle-stroke-opacity","circle-blur"],ZG.GEOMETRY_LAYOUT=[new na("a_pos",2,Bi.SHORT,0,4)],ZG.ATTRIBUTES_INFO={"circle-radius":{name:"radius",type:Gs.R8_UNSIGNED},"circle-color":{name:"color",type:Gs.R8G8B8A8_COLOR},"circle-opacity":{name:"opacity",type:Gs.R8_UNSIGNED,precisionFactor:100},"circle-stroke-width":{name:"stroke_width",type:Gs.R8_UNSIGNED,precisionFactor:4},"circle-stroke-color":{name:"stroke_color",type:Gs.R8G8B8A8_COLOR},"circle-stroke-opacity":{name:"stroke_opacity",type:Gs.R8_UNSIGNED,precisionFactor:100},"circle-blur":{name:"blur",type:Gs.R8_UNSIGNED,precisionFactor:32}};let QG=class l_e extends aF{constructor(e){super(e)}geometryInfo(){return l_e.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return l_e.ATTRIBUTES}attributesInfo(){return l_e.ATTRIBUTES_INFO}};QG.ATTRIBUTES=["fill-color","fill-opacity","fill-pattern"],QG.GEOMETRY_LAYOUT=[new na("a_pos",2,Bi.SHORT,0,4)],QG.ATTRIBUTES_INFO={"fill-color":{name:"color",type:Gs.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:Gs.R8_UNSIGNED,precisionFactor:100},"fill-pattern":{name:"tlbr",type:Gs.R16G16B16A16_PATTERN,isOptional:!0}};let xE=class cH extends aF{constructor(e,i){super(e),this._usefillColor=i}geometryInfo(){return cH.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return this._usefillColor?cH.ATTRIBUTES_FILL:cH.ATTRIBUTES_OUTLINE}attributesInfo(){return this._usefillColor?cH.ATTRIBUTES_INFO_FILL:cH.ATTRIBUTES_INFO_OUTLINE}};xE.ATTRIBUTES_OUTLINE=["fill-outline-color","fill-opacity"],xE.ATTRIBUTES_FILL=["fill-color","fill-opacity"],xE.GEOMETRY_LAYOUT=[new na("a_pos",2,Bi.SHORT,0,8),new na("a_offset",2,Bi.BYTE,4,8),new na("a_xnormal",2,Bi.BYTE,6,8)],xE.ATTRIBUTES_INFO_OUTLINE={"fill-outline-color":{name:"color",type:Gs.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:Gs.R8_UNSIGNED,precisionFactor:100}},xE.ATTRIBUTES_INFO_FILL={"fill-color":{name:"color",type:Gs.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:Gs.R8_UNSIGNED,precisionFactor:100}};let eU=class u_e extends aF{constructor(e){super(e)}geometryInfo(){return u_e.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return u_e.ATTRIBUTES}attributesInfo(){return u_e.ATTRIBUTES_INFO}};eU.ATTRIBUTES=["line-blur","line-color","line-gap-width","line-offset","line-opacity","line-width","line-pattern","line-dasharray"],eU.GEOMETRY_LAYOUT=[new na("a_pos",2,Bi.SHORT,0,16),new na("a_extrude_offset",4,Bi.BYTE,4,16),new na("a_dir_normal",4,Bi.BYTE,8,16),new na("a_accumulatedDistance",2,Bi.UNSIGNED_SHORT,12,16)],eU.ATTRIBUTES_INFO={"line-width":{name:"width",type:Gs.R8_UNSIGNED,precisionFactor:2},"line-gap-width":{name:"gap_width",type:Gs.R8_UNSIGNED,precisionFactor:2},"line-offset":{name:"offset",type:Gs.R8_SIGNED,precisionFactor:2},"line-color":{name:"color",type:Gs.R8G8B8A8_COLOR},"line-opacity":{name:"opacity",type:Gs.R8_UNSIGNED,precisionFactor:100},"line-blur":{name:"blur",type:Gs.R8_UNSIGNED,precisionFactor:4},"line-pattern":{name:"tlbr",type:Gs.R16G16B16A16_PATTERN,isOptional:!0},"line-dasharray":{name:"tlbr",type:Gs.R16G16B16A16_DASHARRAY,isOptional:!0}};const kbt=[new na("a_pos",2,Bi.SHORT,0,16),new na("a_vertexOffset",2,Bi.SHORT,4,16),new na("a_texAngleRange",4,Bi.UNSIGNED_BYTE,8,16),new na("a_levelInfo",4,Bi.UNSIGNED_BYTE,12,16)],$bt=[new na("a_opacityInfo",1,Bi.UNSIGNED_BYTE,0,1)];let oZ=class EBe extends aF{constructor(e){super(e)}geometryInfo(){return kbt}opacityInfo(){return $bt}attributes(){return EBe.ATTRIBUTES}attributesInfo(){return EBe.ATTRIBUTES_INFO}};oZ.ATTRIBUTES=["icon-color","icon-opacity","icon-halo-blur","icon-halo-color","icon-halo-width","icon-size"],oZ.ATTRIBUTES_INFO={"icon-color":{name:"color",type:Gs.R8G8B8A8_COLOR},"icon-opacity":{name:"opacity",type:Gs.R8_UNSIGNED,precisionFactor:100},"icon-halo-color":{name:"halo_color",type:Gs.R8G8B8A8_COLOR},"icon-halo-width":{name:"halo_width",type:Gs.R8_UNSIGNED,precisionFactor:4},"icon-halo-blur":{name:"halo_blur",type:Gs.R8_UNSIGNED,precisionFactor:4},"icon-size":{name:"size",type:Gs.R8_UNSIGNED,precisionFactor:32,isLayout:!0}};let aZ=class IBe extends aF{constructor(e){super(e)}geometryInfo(){return kbt}opacityInfo(){return $bt}attributes(){return IBe.ATTRIBUTES}attributesInfo(){return IBe.ATTRIBUTES_INFO}};aZ.ATTRIBUTES=["text-color","text-opacity","text-halo-blur","text-halo-color","text-halo-width","text-size"],aZ.ATTRIBUTES_INFO={"text-color":{name:"color",type:Gs.R8G8B8A8_COLOR},"text-opacity":{name:"opacity",type:Gs.R8_UNSIGNED,precisionFactor:100},"text-halo-color":{name:"halo_color",type:Gs.R8G8B8A8_COLOR},"text-halo-width":{name:"halo_width",type:Gs.R8_UNSIGNED,precisionFactor:4},"text-halo-blur":{name:"halo_blur",type:Gs.R8_UNSIGNED,precisionFactor:4},"text-size":{name:"size",type:Gs.R8_UNSIGNED,isLayout:!0}};const Bbt={kind:"null"},Sp={kind:"number"},xb={kind:"string"},yy={kind:"boolean"},lO={kind:"color"},$fe={kind:"object"},uO={kind:"value"};function lZ(t,e){return{kind:"array",itemType:t,n:e}}const nVi=[Bbt,Sp,xb,yy,lO,$fe,lZ(uO)];function tU(t){if(t.kind==="array"){const e=tU(t.itemType);return typeof t.n=="number"?`array<${e}, ${t.n}>`:t.itemType.kind==="value"?"array":`array<${e}>`}return t.kind}function Bfe(t){if(t===null)return Bbt;if(typeof t=="string")return xb;if(typeof t=="boolean")return yy;if(typeof t=="number")return Sp;if(t instanceof en)return lO;if(Array.isArray(t)){let e;for(const i of t){const r=Bfe(i);if(e){if(e!==r){e=uO;break}}else e=r}return lZ(e||uO,t.length)}return typeof t=="object"?$fe:uO}function eLe(t,e){if(e.kind==="array")return t.kind==="array"&&(t.n===0&&t.itemType.kind==="value"||eLe(t.itemType,e.itemType))&&(typeof e.n!="number"||e.n===t.n);if(e.kind==="value"){for(const i of nVi)if(eLe(t,i))return!0}return e.kind===t.kind}function tLe(t){if(t===null)return"";const e=typeof t;return e==="string"?t:e==="number"||e==="boolean"?String(t):t instanceof en?t.toString():JSON.stringify(t)}let sVi=class{constructor(e){this._parent=e,this._vars={}}add(e,i){this._vars[e]=i}get(e){return this._vars[e]?this._vars[e]:this._parent?this._parent.get(e):null}},oVi=class x5t{constructor(){this.type=uO}static parse(e){if(e.length>1)throw new Error('"id" does not expect arguments');return new x5t}evaluate(e,i){return e?.id}},aVi=class S5t{constructor(){this.type=xb}static parse(e){if(e.length>1)throw new Error('"geometry-type" does not expect arguments');return new S5t}evaluate(e,i){if(!e)return null;switch(e.type){case gy.Point:return"Point";case gy.LineString:return"LineString";case gy.Polygon:return"Polygon";default:return null}}},lVi=class C5t{constructor(){this.type=$fe}static parse(e){if(e.length>1)throw new Error('"properties" does not expect arguments');return new C5t}evaluate(e,i){return e?.values}},Vbt=class T5t{constructor(){this.type=Sp}static parse(e){if(e.length>1)throw new Error('"zoom" does not expect arguments');return new T5t}evaluate(e,i){return i}},nx=class E5t{constructor(e,i,r){this._lhs=e,this._rhs=i,this._compare=r,this.type=yy}static parse(e,i,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 E5t(xa(e[1],i),xa(e[2],i),r)}evaluate(e,i){return this._compare(this._lhs.evaluate(e,i),this._rhs.evaluate(e,i))}},uVi=class extends nx{static parse(e,i){return nx.parse(e,i,(r,n)=>r===n)}},cVi=class extends nx{static parse(e,i){return nx.parse(e,i,(r,n)=>r!==n)}},hVi=class extends nx{static parse(e,i){return nx.parse(e,i,(r,n)=>rr<=n)}},pVi=class extends nx{static parse(e,i){return nx.parse(e,i,(r,n)=>r>n)}},fVi=class extends nx{static parse(e,i){return nx.parse(e,i,(r,n)=>r>=n)}},mVi=class I5t{constructor(e){this._arg=e,this.type=yy}static parse(e,i){if(e.length!==2)throw new Error('"!" expects 1 argument');return new I5t(xa(e[1],i))}evaluate(e,i){return!this._arg.evaluate(e,i)}},gVi=class A5t{constructor(e){this._args=e,this.type=yy}static parse(e,i){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],i,Sp);let a;n==="interpolate-hcl"||n==="interpolate-lab"?a=lO:r&&r.kind!=="value"&&(a=r);const l=[];for(let c=3;c=h)throw new Error(`"${n}" requires strictly ascending stop inputs`);const p=xa(e[c+1],i,a);a||(a=p.type),l.push([h,p])}if(a&&a!==lO&&a!==Sp&&(a.kind!=="array"||a.itemType!==Sp))throw new Error(`"${n}" cannot interpolate type ${tU(a)}`);return new P8(n,a,s,o,l)}evaluate(e,i){const r=this._stops;if(r.length===1)return r[0][1].evaluate(e,i);const n=this.input.evaluate(e,i);if(n<=r[0][0])return r[0][1].evaluate(e,i);if(n>=r[r.length-1][0])return r[r.length-1][1].evaluate(e,i);let s=0;for(;++sHm(p,h[y],l));if(this.type.kind==="color"&&c instanceof en&&h instanceof en){const p=new en(c),y=new en(h);return new en([Hm(p.r,y.r,l),Hm(p.g,y.g,l),Hm(p.b,y.b,l),Hm(p.a,y.a,l)])}if(this.type.kind==="number"&&typeof c=="number"&&typeof h=="number")return Hm(c,h,l);throw new Error(`"${this._operator}" cannot interpolate type ${tU(this.type)}`)}if(this._operator==="interpolate-hcl"){const p=Joe(c),y=Joe(h),v=y.h-p.h,x=eM({h:p.h+l*(v>180||v<-180?v-360*Math.round(v/360):v),c:Hm(p.c,y.c,l),l:Hm(p.l,y.l,l)});return new en({a:Hm(c.a,h.a,l),...x})}if(this._operator==="interpolate-lab"){const p=Koe(c),y=Koe(h),v=eM({l:Hm(p.l,y.l,l),a:Hm(p.a,y.a,l),b:Hm(p.b,y.b,l)});return new en({a:Hm(c.a,h.a,l),...v})}throw new Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(e,i){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,i,r,n){const s=n-r;if(s===0)return 0;const o=e-r;return i===1?o/s:(i**o-1)/(i**s-1)}},xVi=class F5t{constructor(e,i,r){this.type=e,this._input=i,this._stops=r}static parse(e,i){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],i,Sp);let n;const s=[];s.push([-1/0,xa(e[2],i)]);for(let o=3;o=a)throw new Error('"step" requires strictly ascending stop inputs');const l=xa(e[o+1],i);n||(n=l.type),s.push([a,l])}return new F5t(n,r,s)}evaluate(e,i){const r=this._stops;if(r.length===1)return r[0][1].evaluate(e,i);const n=this._input.evaluate(e,i);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]}},EVi=class ABe{constructor(e,i){this._key=e,this._obj=i,this.type=uO}static parse(e,i){let r,n;switch(e.length){case 2:return r=xa(e[1],i),new ABe(r);case 3:return r=xa(e[1],i),n=xa(e[2],i),new ABe(r,n);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(e,i){const r=this._key.evaluate(e,i);return this._obj?this._obj.evaluate(e,i)[r]:e?.values[r]}},IVi=class PBe{constructor(e,i){this._key=e,this._obj=i,this.type=yy}static parse(e,i){let r,n;switch(e.length){case 2:return r=xa(e[1],i),new PBe(r);case 3:return r=xa(e[1],i),n=xa(e[2],i),new PBe(r,n);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(e,i){const r=this._key.evaluate(e,i);return this._obj?r in this._obj.evaluate(e,i):!!e?.values[r]}},AVi=class $5t{constructor(e,i){this._key=e,this._vals=i,this.type=yy}static parse(e,i){if(e.length!==3)throw new Error('"in" expects 2 arguments');return new $5t(xa(e[1],i),xa(e[2],i))}evaluate(e,i){const r=this._key.evaluate(e,i);return this._vals.evaluate(e,i).includes(r)}},PVi=class OBe{constructor(e,i,r){this._item=e,this._array=i,this._from=r,this.type=Sp}static parse(e,i){if(e.length<3||e.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=xa(e[1],i),n=xa(e[2],i);if(e.length===4){const s=xa(e[3],i,Sp);return new OBe(r,n,s)}return new OBe(r,n)}evaluate(e,i){const r=this._item.evaluate(e,i),n=this._array.evaluate(e,i);if(this._from){const s=this._from.evaluate(e,i);if(s!==Math.floor(s))throw new Error('"index-of" index must be an integer');return n.indexOf(r,s)}return n.indexOf(r)}},OVi=class B5t{constructor(e){this._arg=e,this.type=Sp}static parse(e,i){if(e.length!==2)throw new Error('"length" expects 2 arguments');const r=xa(e[1],i);return new B5t(r)}evaluate(e,i){const r=this._arg.evaluate(e,i);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}},RVi=class RBe{constructor(e,i,r,n){this.type=e,this._array=i,this._from=r,this._to=n}static parse(e,i){if(e.length<3||e.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=xa(e[1],i),n=xa(e[2],i,Sp);if(n.type!==Sp)throw new Error('"slice" index must return a number');if(e.length===4){const s=xa(e[3],i,Sp);if(s.type!==Sp)throw new Error('"slice" index must return a number');return new RBe(r.type,r,n,s)}return new RBe(r.type,r,n)}evaluate(e,i){const r=this._array.evaluate(e,i);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,i);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,i);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)}},MVi=class V5t{constructor(){this.type=yy}static parse(e){if(e.length!==1)throw new Error('"has-id" expects no arguments');return new V5t}evaluate(e,i){return e&&e.id!==void 0}},Sb=class j5t{constructor(e,i){this._args=e,this._calculate=i,this.type=Sp}static parse(e,i,r){const n=e.slice(1).map(s=>xa(s,i));return new j5t(n,r)}evaluate(e,i){let r;return this._args&&(r=this._args.map(n=>n.evaluate(e,i))),this._calculate(r)}},DVi=class extends Sb{static parse(e,i){switch(e.length){case 2:return Sb.parse(e,i,r=>-r[0]);case 3:return Sb.parse(e,i,r=>r[0]-r[1]);default:throw new Error('"-" expects 1 or 2 arguments')}}},FVi=class extends Sb{static parse(e,i){return Sb.parse(e,i,r=>{let n=1;for(const s of r)n*=s;return n})}},LVi=class extends Sb{static parse(e,i){if(e.length===3)return Sb.parse(e,i,r=>r[0]/r[1]);throw new Error('"/" expects 2 arguments')}},NVi=class extends Sb{static parse(e,i){if(e.length===3)return Sb.parse(e,i,r=>r[0]%r[1]);throw new Error('"%" expects 2 arguments')}},kVi=class extends Sb{static parse(e,i){if(e.length===3)return Sb.parse(e,i,r=>r[0]**r[1]);throw new Error('"^" expects 1 or 2 arguments')}},$Vi=class extends Sb{static parse(e,i){return Sb.parse(e,i,r=>{let n=0;for(const s of r)n+=s;return n})}},um=class MBe{constructor(e,i){this._args=e,this._calculate=i,this.type=Sp}static parse(e,i){const r=e.slice(1).map(n=>xa(n,i));return new MBe(r,MBe.ops[e[0]])}evaluate(e,i){let r;return this._args&&(r=this._args.map(n=>n.evaluate(e,i))),this._calculate(r)}};um.ops={abs:t=>Math.abs(t[0]),acos:t=>Math.acos(t[0]),asin:t=>Math.asin(t[0]),atan:t=>Math.atan(t[0]),ceil:t=>Math.ceil(t[0]),cos:t=>Math.cos(t[0]),e:()=>Math.E,floor:t=>Math.floor(t[0]),ln:t=>Math.log(t[0]),ln2:()=>Math.LN2,log10:t=>Math.log(t[0])/Math.LN10,log2:t=>Math.log(t[0])/Math.LN2,max:t=>Math.max(...t),min:t=>Math.min(...t),pi:()=>Math.PI,round:t=>Math.round(t[0]),sin:t=>Math.sin(t[0]),sqrt:t=>Math.sqrt(t[0]),tan:t=>Math.tan(t[0])};class iLe{constructor(e){this._args=e,this.type=xb}static parse(e,i){return new iLe(e.slice(1).map(r=>xa(r,i)))}evaluate(e,i){return this._args.map(r=>r.evaluate(e,i)).join("")}}class iU{constructor(e,i){this._arg=e,this._calculate=i,this.type=xb}static parse(e,i){if(e.length!==2)throw new Error(`${e[0]} expects 1 argument`);const r=xa(e[1],i);return new iU(r,iU.ops[e[0]])}evaluate(e,i){return this._calculate(this._arg.evaluate(e,i))}}iU.ops={downcase:t=>t.toLowerCase(),upcase:t=>t.toUpperCase()};class rLe{constructor(e){this._args=e,this.type=lO}static parse(e,i){if(e.length!==4)throw new Error('"rgb" expects 3 arguments');const r=e.slice(1).map(n=>xa(n,i));return new rLe(r)}evaluate(e,i){const r=this._validate(this._args[0].evaluate(e,i)),n=this._validate(this._args[1].evaluate(e,i)),s=this._validate(this._args[2].evaluate(e,i));return new en({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)}}class nLe{constructor(e){this._args=e,this.type=lO}static parse(e,i){if(e.length!==5)throw new Error('"rgba" expects 4 arguments');const r=e.slice(1).map(n=>xa(n,i));return new nLe(r)}evaluate(e,i){const r=this._validate(this._args[0].evaluate(e,i)),n=this._validate(this._args[1].evaluate(e,i)),s=this._validate(this._args[2].evaluate(e,i)),o=this._validateAlpha(this._args[3].evaluate(e,i));return new en({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}}let BVi=class G5t{constructor(e){this._color=e,this.type=lZ(Sp,4)}static parse(e,i){if(e.length!==2)throw new Error('"to-rgba" expects 1 argument');const r=xa(e[1],i);return new G5t(r)}evaluate(e,i){return new en(this._color.evaluate(e,i)).toRgba()}};class p6{constructor(e,i){this.type=e,this._args=i}static parse(e,i){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=xb;break;case"number":n=Sp;break;case"boolean":n=yy;break;default:throw new Error('"array" type argument must be string, number or boolean')}s++}else n=uO;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=lZ(n,a)}else switch(r){case"string":n=xb;break;case"number":n=Sp;break;case"boolean":n=yy;break;case"object":n=$fe}const o=[];for(;s":pVi,">=":fVi,all:gVi,any:yVi,case:_Vi,coalesce:bVi,match:wVi,within:null,interpolate:Vfe,"interpolate-hcl":Vfe,"interpolate-lab":Vfe,step:xVi,let:SVi,var:CVi,concat:iLe,downcase:iU,"is-supported-script":null,"resolved-locale":null,upcase:iU,rgb:rLe,rgba:nLe,"to-rgba":BVi,"-":DVi,"*":FVi,"/":LVi,"%":NVi,"^":kVi,"+":$Vi,abs:um,acos:um,asin:um,atan:um,ceil:um,cos:um,e:um,floor:um,ln:um,ln2:um,log10:um,log2:um,max:um,min:um,pi:um,round:um,sin:um,sqrt:um,tan:um,zoom:Vbt,"heatmap-density":null,"has-id":MVi,none:vVi};let VVi=class zb{constructor(e){this._expression=e}filter(e,i){if(!this._expression)return!0;try{return this._expression.evaluate(e,i)}catch(r){return console.log(r.message),!0}}static createFilter(e){if(!e)return null;this.isLegacyFilter(e)&&(e=this.convertLegacyFilter(e));try{const i=xa(e,null,yy);return new zb(i)}catch(i){return console.log(i.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 i=1;i":case"<":case">=":case"<=":return zb.convertComparison(i,e[1],e[2]);case"in":return zb.convertIn(e[1],e.slice(2));case"!in":return zb.negate(zb.convertIn(e[1],e.slice(2)));case"any":case"all":case"none":return zb.convertCombining(i,e.slice(1));case"has":return zb.convertHas(e[1]);case"!has":return zb.negate(zb.convertHas(e[1]));default:throw new Error("Unexpected legacy filter.")}}static convertComparison(e,i,r){switch(i){case"$type":return[e,["geometry-type"],r];case"$id":return[e,["id"],r];default:return[e,["get",i],r]}}static convertIn(e,i){switch(e){case"$type":return["in",["geometry-type"],["literal",i]];case"$id":return["in",["id"],["literal",i]];default:return["in",["get",e],["literal",i]]}}static convertHas(e){switch(e){case"$type":return!0;case"$id":return["has-id"];default:return["has",e]}}static convertCombining(e,i){return[e].concat(i.map(this.convertLegacyFilter))}static negate(e){return["!",e]}},Gbt=class U5t{constructor(e,i){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(i==null&&(i=e.default),Array.isArray(i)&&i.length>0&&jbt[i[0]]){const s={number:Sp,color:lO,string:xb,boolean:yy,enum:xb};try{const o=e.type==="array"?lZ(s[e.value]||uO,e.length):s[e.type],a=xa(i,null,o);this.getValue=this._buildExpression(a,e),this.isDataDriven=!0,a instanceof Vfe&&a.input instanceof Vbt&&(this.interpolator=a)}catch(o){console.log(o.message),this.getValue=this._buildSimple(e.default)}return}r&&i.type==="interval"&&(r=!1);const n=i&&i.stops&&i.stops.length>0;if(n)for(const s of i.stops)s[1]=this._validate(s[1],e);if(this.isDataDriven=!!i&&!!i.property,this.isDataDriven)if(i.default!==void 0&&(i.default=this._validate(i.default,e)),n)switch(i.type){case"identity":this.getValue=this._buildIdentity(i,e);break;case"categorical":this.getValue=this._buildCategorical(i,e);break;default:this.getValue=r?this._buildInterpolate(i,e):this._buildInterval(i,e)}else this.getValue=this._buildIdentity(i,e);else n?this.getValue=r?this._buildZoomInterpolate(i):this._buildZoomInterval(i):(i=this._validate(i,e),this.getValue=this._buildSimple(i))}_validate(e,i){if(i.type==="number"){if(ei.maximum)return i.maximum}else i.type==="color"?e=U5t._parseColor(e):i.type==="enum"?typeof e=="string"&&(e=i.values.indexOf(e)):i.type==="array"&&i.value==="enum"?e=e.map(r=>typeof r=="string"?i.values.indexOf(r):r):i.type==="string"&&(e=tLe(e));return e}_buildSimple(e){return()=>e}_buildExpression(e,i){return(r,n)=>{try{const s=e.evaluate(n,r);return s===void 0?i.default:this._validate(s,i)}catch(s){return console.log(s.message),i.default}}}_buildIdentity(e,i){return(r,n)=>{let s;return n&&(s=n.values[e.property]),s!==void 0&&(s=this._validate(s,i)),s??(e.default!==void 0?e.default:i.default)}}_buildCategorical(e,i){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:i.default}}_buildInterval(e,i){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:i.default}}_buildInterpolate(e,i){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:i.default}}_buildZoomInterpolate(e){return i=>this._interpolate(i,e.stops,e.base||1)}_buildZoomInterval(e){return i=>this._interval(i,e.stops)}_categorical(e,i){const r=i.length;for(let n=0;n0){c&&(x=c.getValue(s,I));for(const Z of x){let ie=r[Z];ie||(ie=r[Z]=new Set);for(let ce=0;cep.getGlyphItems(ke));if(j=new cbt(Pe,_e,xe,he,Z,ie,ce).getShaping(Y,F.rtl,X),j&&j.length>0){let ke=1e30,J=-1e30;for(const de of j)ke=Math.min(ke,de.x),J=Math.max(J,de.x);V=(J-ke+2*vE)*x*iZ}}for(let X of F.geometry){const Z=[];if(n===aO.LINE){if(j?.length&&h?.size){const ie=h.size*iZ*(2+Math.min(2,4*Math.abs(h.offset[1])));X=mC._smoothVertices(X,ie)}mC._pushAnchors(Z,X,o,V)}else n===aO.LINE_CENTER?mC._pushCenterAnchor(Z,X):F.feature.type===gy.Polygon?mC._pushCentroid(Z,X):Z.push(new Pfe(X[0].x,X[0].y));for(const ie of Z){if(ie.x<0||ie.x>dbt||ie.y<0||ie.y>dbt||s&&V>0&&h?.rotationAlignment===oc.MAP&&!mC._honorsTextMaxAngle(X,ie,V,I,P))continue;const ce={shaping:j,line:X,iconMosaicItem:k,anchor:ie,symbolFeature:F,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};v.push(ce),this._processFeature(ce,c,h)}}}v.sort(UVi),this._addPlacedGlyphs(),this._symbolInstances=v}serialize(){let e=11;e+=this.layerUIDs.length,e+=3*this.markerPageMap.size,e+=3*this.glyphsPageMap.size,e+=mC._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;const i=new Uint32Array(e),r=new Int32Array(i.buffer),n=new Float32Array(i.buffer);let s=0;i[s++]=this.type,i[s++]=this.layerUIDs.length;for(let o=0;on in i?i[n]:"")}_processFeature(e,i,r){const{line:n,iconMosaicItem:s,shaping:o,anchor:a}=e,l=this.zoom,c=this.layer,h=!!s;let p=!0;h&&(p=i?.optional||!s);const y=o&&o.length>0,v=!y||r?.optional;let x,I;if(h&&(x=this._placementEngine.getIconPlacement(a,s,i)),(x||p)&&(y&&(I=this._placementEngine.getTextPlacement(a,o,n,r)),I||v)){if(x&&I||(v||p?v||I?p||x||(I=null):x=null:(x=null,I=null)),I){const P=c.hasDataDrivenText?c.textMaterial.encodeAttributes(e.symbolFeature.feature,l,c):null;if(this._storePlacedGlyphs(e,I.shapes,l,r.rotationAlignment,P),I.textColliders){e.textColliders=I.textColliders;for(const F of I.textColliders){F.minLod=Math.max(l+sF(F.minLod),0),F.maxLod=Math.min(l+sF(F.maxLod),25);const k=F.angle;if(k){const j=Math.cos(k),V=Math.sin(k),Y=F.dxPixels*j-F.dyPixels*V,X=F.dxPixels*V+F.dyPixels*j,Z=(F.dxPixels+F.width)*j-F.dyPixels*V,ie=(F.dxPixels+F.width)*V+F.dyPixels*j,ce=F.dxPixels*j-(F.dyPixels+F.height)*V,he=F.dxPixels*V+(F.dyPixels+F.height)*j,_e=(F.dxPixels+F.width)*j-(F.dyPixels+F.height)*V,xe=(F.dxPixels+F.width)*V+(F.dyPixels+F.height)*j,Pe=Math.min(Y,Z,ce,_e),ke=Math.max(Y,Z,ce,_e),J=Math.min(X,ie,he,xe),de=Math.max(X,ie,he,xe);F.dxPixels=Pe,F.dyPixels=J,F.width=ke-Pe,F.height=de-J}}}}if(x){const P=c.hasDataDrivenIcon?c.iconMaterial.encodeAttributes(e.symbolFeature.feature,l,c):null;if(this._addPlacedIcons(e,x.shapes,l,s.page,i.rotationAlignment===oc.VIEWPORT,P),x.iconColliders){e.iconColliders=x.iconColliders;for(const F of x.iconColliders){F.minLod=Math.max(l+sF(F.minLod),0),F.maxLod=Math.min(l+sF(F.maxLod),25);const k=F.angle;if(k){const j=Math.cos(k),V=Math.sin(k),Y=F.dxPixels*j-F.dyPixels*V,X=F.dxPixels*V+F.dyPixels*j,Z=(F.dxPixels+F.width)*j-F.dyPixels*V,ie=(F.dxPixels+F.width)*V+F.dyPixels*j,ce=F.dxPixels*j-(F.dyPixels+F.height)*V,he=F.dxPixels*V+(F.dyPixels+F.height)*j,_e=(F.dxPixels+F.width)*j-(F.dyPixels+F.height)*V,xe=(F.dxPixels+F.width)*V+(F.dyPixels+F.height)*j,Pe=Math.min(Y,Z,ce,_e),ke=Math.max(Y,Z,ce,_e),J=Math.min(X,ie,he,xe),de=Math.max(X,ie,he,xe);F.dxPixels=Pe,F.dyPixels=J,F.width=ke-Pe,F.height=de-J}}}}}}_addPlacedIcons(e,i,r,n,s,o){const a=Math.max(r-1,0),l=this._iconVertexBuffer,c=this._iconIndexBuffer,h=this._markerMap;for(const p of i){const y=s?0:Math.max(r+sF(p.minzoom),a),v=s?25:Math.min(r+sF(p.maxzoom),25);if(v<=y)continue;const x=p.tl,I=p.tr,P=p.bl,F=p.br,k=p.mosaicRect,j=p.labelAngle,V=p.minAngle,Y=p.maxAngle,X=p.anchor,Z=l.index,ie=k.x,ce=k.y,he=ie+k.width,_e=ce+k.height,xe=l.index;l.add(X.x,X.y,x.x,x.y,ie,ce,j,V,Y,y,v,o),l.add(X.x,X.y,I.x,I.y,he,ce,j,V,Y,y,v,o),l.add(X.x,X.y,P.x,P.y,ie,_e,j,V,Y,y,v,o),l.add(X.x,X.y,F.x,F.y,he,_e,j,V,Y,y,v,o),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===xe?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([xe,4]),c.add(Z+0,Z+1,Z+2),c.add(Z+1,Z+2,Z+3),h.has(n)?h.get(n)[1]+=6:h.set(n,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const e=this._textVertexBuffer,i=this._textIndexBuffer,r=this._glyphMap;for(const[n,s]of this._glyphBufferDataStorage)for(const o of s){const a=e.index,l=o.symbolInstance,c=o.ddAttributes,h=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,c),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,c),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,c),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,c),l.textVertexRanges.length>0&&l.textVertexRanges[0][0]+l.textVertexRanges[0][1]===h?l.textVertexRanges[0][1]+=4:l.textVertexRanges.push([h,4]),i.add(a+0,a+1,a+2),i.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,i,r,n,s){const o=Math.max(r-1,0),a=n===oc.VIEWPORT;let l,c,h,p,y,v,x,I,P,F,k;for(const j of i)l=a?0:Math.max(r+sF(j.minzoom),o),c=a?25:Math.min(r+sF(j.maxzoom),25),!(c<=l)&&(h=j.tl,p=j.tr,y=j.bl,v=j.br,x=j.labelAngle,I=j.minAngle,P=j.maxAngle,F=j.anchor,k=j.mosaicRect,this._glyphBufferDataStorage.has(j.page)||this._glyphBufferDataStorage.set(j.page,[]),this._glyphBufferDataStorage.get(j.page).push({glyphAnchor:[F.x,F.y],tl:[h.x,h.y],tr:[p.x,p.y],bl:[y.x,y.y],br:[v.x,v.y],xmin:k.x,ymin:k.y,xmax:k.x+k.width,ymax:k.y+k.height,labelAngle:x,minAngle:I,maxAngle:P,minLod:l,maxLod:c,placementLod:o,symbolInstance:e,ddAttributes:s}))}static _pushAnchors(e,i,r,n){r+=n;let s=0;const o=i.length-1;for(let y=0;y-a;){if(--c,c<0)return!1;o-=oa.distance(e[c],l),l=e[c]}o+=oa.distance(e[c],e[c+1]);const h=[];let p=0;const y=e.length;for(;os;)p-=h.shift().deviation;if(Math.abs(p)>n)return!1;o+=oa.distance(x,P),c=I}return!0}static _smoothVertices(e,i){if(i<=0)return e;let r=e.length;if(r<3)return e;const n=[];let s=0,o=0;n.push(0);for(let I=1;I0&&(s+=P,n.push(s),o++,o!==I&&(e[o]=e[I]))}if(r=o+1,r<3)return e;i=Math.min(i,.2*s);const a=e[0].x,l=e[0].y,c=e[r-1].x,h=e[r-1].y,p=oa.sub(e[0],e[1]);p.normalize(),e[0].x+=i*p.x,e[0].y+=i*p.y,p.assignSub(e[r-1],e[r-2]),p.normalize(),e[r-1].x+=i*p.x,e[r-1].y+=i*p.y,n[0]-=i,n[r-1]+=i;const y=[];y.push(new oa(a,l));const v=1e-6,x=.5*i;for(let I=1;I=0;j--){const V=x+n[j+1]-n[I];if(V<0)break;const Y=n[j+1]-n[j],X=n[I]-n[j]4096&&(p=4096),p<0&&(p=0),y>4096&&(y=4096),y<0&&(y=0);for(let v=1;v4096&&(x=4096),x<0&&(x=0),I>4096&&(I=4096),I<0&&(I=0),P>4096&&(P=4096),P<0&&(P=0),F>4096&&(F=4096),F<0&&(F=0);const k=(x-p)*(F-y)-(P-p)*(I-y);l+=k*(p+x+P),c+=k*(y+I+F),h+=k}l/=3*h,c/=3*h,isNaN(l)||isNaN(c)||e.push(new Pfe(l,c))}};Xbt._bidiEngine=new Abt;var cO;(function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.NO_DATA=1]="NO_DATA",t[t.READY=2]="READY",t[t.MODIFIED=3]="MODIFIED",t[t.INVALID=4]="INVALID"})(cO||(cO={}));const zVi=8,HVi=14,WVi=5;let qVi=class{constructor(e,i,r,n,s){if(this._pbfTiles={},this._tileClippers={},this._client=r,this._tile=i,s){this._styleLayerUIDs=new Set;for(const h of s)this._styleLayerUIDs.add(h)}this._styleRepository=n,this._layers=this._styleRepository?.layers??[];const[o,a,l]=i.tileKey.split("/").map(parseFloat);this._level=o;const c=zVi+Math.max((this._level-HVi)*WVi,0);for(const h of Object.keys(e)){const p=e[h];if(this._pbfTiles[h]=new q5(new Uint8Array(p.protobuff),new DataView(p.protobuff)),p.refKey){const[y]=p.refKey.split("/").map(parseFloat),v=o-y;if(v>0){const x=(1<{o.has(h)||(s.push({name:h,repeat:p}),o.add(h))},l={};for(const h of n)h.getResources(h.tileClipper,a,l);if(this._tile.status===cO.INVALID)return[];const c=this._fetchResources(s,l,e);return Promise.all([...c,i]).then(()=>this._processFeatures(r.returnedBuckets))}_initialize(e){return{signal:e&&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:i,layers:r,zoom:n,sourceNameToTileClipper:s,sourceNameToUniqueSourceLayerBuckets:o,sourceNameToUniqueSourceLayers:a,returnedBuckets:l,layerIdToBucket:c,referencerUIDToReferencedId:h}=e;for(let p=r.length-1;p>=0;p--){const y=r[p];if(!this._canParseStyleLayer(y.uid)||y.minzoom&&n=y.maxzoom||y.type===vl.BACKGROUND||!i[y.source]||!s[y.source])continue;const v=i[y.source],x=s[y.source],I=y.sourceLayer,P=v[I];if(P){let F=a[y.source];if(F||(F=a[y.source]=new Set),F.add(y.sourceLayer),y.refLayerId)h.set(y.uid,y.refLayerId);else{const k=this._createBucket(y);if(k){k.layerUIDs=[y.uid],k.layerExtent=P.extent,k.tileClipper=x;let j=o[y.source];j||(j=o[y.source]={});let V=j[I];V||(V=j[I]=[]),V.push(k),l.push(k),c[y.id]=k}}}}}_linkReferences(e){const{layerIdToBucket:i,referencerUIDToReferencedId:r}=e;r.forEach((n,s)=>{i[n]&&i[n].layerUIDs.push(s)})}_filterFeatures(e){const{signal:i,sourceNameToTileData:r,sourceNameToUniqueSourceLayerBuckets:n,sourceNameToUniqueSourceLayers:s}=e,o=10*this._level,a=10*(this._level+1),l=[],c=[];for(const h of Object.keys(s))s[h].forEach(p=>{l.push(p),c.push(h)});for(let h=0;h=a)continue;const V=k._maxzoom;if(V&&V<=o)continue}for(const j of x)j.pushFeature(F)}}}_fetchResources(e,i,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 i){const c=i[l];c.size>0&&(a=s.fetchGlyphs(this._tile.tileKey,l,c,this._client,r),n.push(a))}return n}_processFeatures(e){const i=e.filter(r=>r.hasFeatures()||this._canParseStyleLayer(r.layer.uid));for(const r of i)r.processFeatures(r.tileClipper);return i}_parseTileData(e){const i={};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 rBi(o);o.release(),s[a.name]=a;break}default:n.skip()}i[r]=s}return i}_createBucket(e){switch(e.type){case vl.BACKGROUND:return null;case vl.FILL:return this._createFillBucket(e);case vl.LINE:return this._createLineBucket(e);case vl.CIRCLE:return this._createCircleBucket(e);case vl.SYMBOL:return this._createSymbolBucket(e)}}_createFillBucket(e){return new cBi(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new sBi(e.fillMaterial.getStride()),new WG,new oBi(e.outlineMaterial.getStride()),new WG)}_createLineBucket(e){return new fBi(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new nBi(e.lineMaterial.getStride()),new WG)}_createCircleBucket(e){return new lBi(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new aBi(e.circleMaterial.getStride()),new WG)}_createSymbolBucket(e){const i=this._tile;return new Xbt(e,this._level,new vbt(e.iconMaterial.getStride()),new WG,new vbt(e.textMaterial.getStride()),new WG,i.placementEngine,i.getWorkerTileHandler())}},YVi=class{constructor(e,i,r,n){this.status=cO.INITIALIZED,this.placementEngine=new Q9i,this.tileKey=e,this.refKeys=i,this._workerTileHandler=r,this._styleRepository=n}release(){this.tileKey="",this.refKeys=null,this.status=cO.INITIALIZED,this._workerTileHandler=null}async parse(e,i){const r=i&&i.signal;if(ve(r)){const h=()=>{r.removeEventListener("abort",h),this.status=cO.INVALID};r.addEventListener("abort",h)}let n;const s={bucketsWithData:[],emptyBuckets:null};try{n=await this._parse(e,i)}catch(h){if(ys(h))throw h;return{result:s,transferList:[]}}this.status=cO.READY;const o=s.bucketsWithData,a=[];for(const h of n)if(h.hasFeatures()){const p=h.serialize();o.push(p)}else a.push(h.layer.uid);const l=[...o];let c=null;return a.length>0&&(c=Uint32Array.from(a),l.push(c.buffer)),s.emptyBuckets=c,{result:s,transferList:l}}setObsolete(){this.status=cO.INVALID}getLayers(){return this._workerTileHandler.getLayers()}getWorkerTileHandler(){return this._workerTileHandler}async _parse(e,i){const r=e.sourceName2DataAndRefKey;return Object.keys(r).length===0?[]:(this.status=cO.MODIFIED,new qVi(r,this,i.client,this._styleRepository,e.styleLayerUIDs).parse(i))}},jfe=class Xie{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((i,r,n)=>this._create(i,r,n)).filter(i=>!!i),this.layers){let i;for(let r=0;r=this.layers.length?null:this.layers[e].id}getStyleLayerByUID(e){return this._uidToLayer.get(e)??null}getStyleLayerIndex(e){const i=this._layerByName[e];return i?this.layers.indexOf(i):-1}setStyleLayer(e,i){if(!e||!e.id)return;const r=this._style;i!=null&&i>=this.layers.length&&(i=this.layers.length-1);let n,s=!0;const o=this._layerByName[e.id];if(o){const a=this.layers.indexOf(o);i||(i=a),i===a?(s=!1,n=Xie._recreateLayer(e,o),this.layers[i]=n,r.layers[i]=e):(this.layers.splice(a,1),r.layers.splice(a,1),n=this._create(e,i,this.layers),this.layers.splice(i,0,n),r.layers.splice(i,0,e))}else n=this._create(e,i,this.layers),!i||i>=this.layers.length?(this.layers.push(n),r.layers.push(e)):(this.layers.splice(i,0,n),r.layers.splice(i,0,e));this._layerByName[e.id]=n,this._uidToLayer.set(n.uid,n),s&&this._recomputeZValues(),this._identifyRefLayers()}getStyleLayer(e){const i=this._layerByName[e];return i?{type:i.typeName,id:i.id,source:i.source,"source-layer":i.sourceLayer,minzoom:i.minzoom,maxzoom:i.maxzoom,filter:i.filter,layout:i.layout,paint:i.paint}:null}deleteStyleLayer(e){const i=this._layerByName[e];if(i){delete this._layerByName[e],this._uidToLayer.delete(i.uid);const r=this.layers.indexOf(i);this.layers.splice(r,1),this._style.layers.splice(r,1),this._recomputeZValues(),this._identifyRefLayers()}}getLayerById(e){return this._layerByName[e]}getLayoutProperties(e){const i=this._layerByName[e];return i?i.layout:null}getPaintProperties(e){const i=this._layerByName[e];return i?i.paint:null}setPaintProperties(e,i){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:i},s=Xie._recreateLayer(n,r),o=this.layers.indexOf(r);this.layers[o]=s,this._style.layers[o].paint=i,this._layerByName[r.id]=s,this._uidToLayer.set(r.uid,s)}setLayoutProperties(e,i){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:i,paint:r.paint},s=Xie._recreateLayer(n,r),o=this.layers.indexOf(r);this.layers[o]=s,this._style.layers[o].layout=i,this._layerByName[r.id]=s,this._uidToLayer.set(r.uid,s)}setStyleLayerVisibility(e,i){const r=this._layerByName[e];if(!r)return;const n=r.layout||{};n.visibility=i;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=Xie._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 i=this._layerByName[e];return i?i.layout?.visibility??"visible":"none"}_recomputeZValues(){const e=this.layers,i=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,i,r,n,s){const o=[];let a=this._glyphInfo[i];return a?r.forEach(l=>{a[l]||o.push(l)}):(a=this._glyphInfo[i]=[],r.forEach(l=>o.push(l))),o.length===0?Promise.resolve():n.invoke("getGlyphs",{tileID:e,font:i,codePoints:o},s).then(l=>{for(let c=0;c{n=a,s=l})};t.emit("apply-edits",o);try{const{results:a,edits:l}=await ZVi(t,e,i,r),c=p=>p.filter(y=>!y.error).map(gi),h={edits:l,addedFeatures:c(a.addFeatureResults),updatedFeatures:c(a.updateFeatureResults),deletedFeatures:c(a.deleteFeatureResults),addedAttachments:c(a.addAttachmentResults),updatedAttachments:c(a.updateAttachmentResults),deletedAttachments:c(a.deleteAttachmentResults),exceededTransferLimit:!1};return a.editedFeatureResults?.length&&(h.editedFeatures=a.editedFeatureResults),(h.addedFeatures.length||h.updatedFeatures.length||h.deletedFeatures.length||h.addedAttachments.length||h.updatedAttachments.length||h.deletedAttachments.length)&&(t.emit("edits",h),V7t(t)&&sWe.emit("edits",{layer:t,event:h})),n(h),a}catch(a){throw s(a),a}}async function ZVi(t,e,i,r){if(await t.load(),!KVi(e))throw new st(`${t.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:t});if(!jGe(t))throw new st(`${t.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:t});const{edits:n,options:s}=await QVi(t,i,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 QVi(t,e,i){const r=e&&(e.addFeatures||e.updateFeatures||e.deleteFeatures),n=e&&(e.addAttachments||e.updateAttachments||e.deleteAttachments),s=ve(t.infoFor3D);if(!e||!r&&!n)throw new st(`${t.type}-layer:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");const o=AL(t);if(!o.data.isVersioned&&i?.gdbVersion)throw new st(`${t.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!o.editing.supportsRollbackOnFailure&&i?.rollbackOnFailureEnabled)throw new st(`${t.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");if(!o.editing.supportsGlobalId&&i?.globalIdUsed)throw new st(`${t.type}-layer:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!o.editing.supportsGlobalId&&n)throw new st(`${t.type}-layer:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!i?.globalIdUsed&&n)throw new st(`${t.type}-layer:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true");const a={...i};if(a.rollbackOnFailureEnabled!=null||o.editing.supportsRollbackOnFailure||(a.rollbackOnFailureEnabled=!0),a.rollbackOnFailureEnabled===!1&&a.returnServiceEditsOption==="original-and-current-features")throw new st(`${t.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true.");if(!o.editing.supportsReturnServiceEditsInSourceSpatialReference&&a.returnServiceEditsInSourceSR)throw new st(`${t.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 st(`${t.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const l={...e};if(l.addFeatures=e&&Sr.isCollection(e.addFeatures)?e.addFeatures.toArray():l.addFeatures||[],l.updateFeatures=e&&Sr.isCollection(e.updateFeatures)?e.updateFeatures.toArray():l.updateFeatures||[],l.deleteFeatures=e&&Sr.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():l.deleteFeatures||[],l.addFeatures.length&&!o.operations.supportsAdd)throw new st(`${t.type}-layer:unsupported-operation`,"Layer does not support adding features.");if(l.updateFeatures.length&&!o.operations.supportsUpdate)throw new st(`${t.type}-layer:unsupported-operation`,"Layer does not support updating features.");if(l.deleteFeatures.length&&!o.operations.supportsDelete)throw new st(`${t.type}-layer:unsupported-operation`,"Layer does not support deleting features.");l.addAttachments=l.addAttachments||[],l.updateAttachments=l.updateAttachments||[],l.deleteAttachments=l.deleteAttachments||[],l.addFeatures=l.addFeatures.map(Jbt),l.updateFeatures=l.updateFeatures.map(Jbt),l.addAssets=[];const c=i?.globalIdUsed||s;return l.addFeatures.forEach(h=>eji(h,t,c)),l.updateFeatures.forEach(h=>iji(h,t,c)),l.deleteFeatures.forEach(h=>tji(h,t,c)),l.addAttachments.forEach(h=>Kbt(h,t)),l.updateAttachments.forEach(h=>Kbt(h,t)),s&&await nji(l,t),{edits:await rji(l),options:a}}function aLe(t,e,i){if(i){if("attributes"in t&&!t.attributes[e.globalIdField])throw new st(`${e.type}-layer:invalid-parameter`,"Feature should have 'globalId' when 'globalIdUsed' is true");if(!("attributes"in t)&&!t.globalId)throw new st(`${e.type}-layer:invalid-parameter`,"'globalId' of the feature should be passed when 'globalIdUsed' is true")}if("geometry"in t&&ve(t.geometry)){if(t.geometry.hasZ&&e.capabilities?.data.supportsZ===!1)throw new st(`${e.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(t.geometry.hasM&&e.capabilities?.data.supportsM===!1)throw new st(`${e.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function eji(t,e,i){aLe(t,e,i)}function tji(t,e,i){aLe(t,e,i)}function iji(t,e,i){aLe(t,e,i);const r=AL(e);if("geometry"in t&&ve(t.geometry)&&!r?.editing.supportsGeometryUpdate)throw new st(`${e.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function Kbt(t,e){const{feature:i,attachment:r}=t;if(!i||"attributes"in i&&!i.attributes[e.globalIdField])throw new st(`${e.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in i)&&!i.globalId)throw new st(`${e.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!r.globalId)throw new st(`${e.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!r.data&&!r.uploadId)throw new st(`${e.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(r.data instanceof File&&r.data.name)&&!r.name)throw new st(`${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 st(`${e.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if(typeof r.data=="string"){const n=Y3(r.data);if(n&&!n.isBase64)throw new st(`${e.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}async function rji(t){const e=t.addFeatures??[],i=t.updateFeatures??[],r=e.concat(i).map(a=>a.geometry),n=await ov(r),s=e.length,o=i.length;return n.slice(0,s).forEach((a,l)=>e[l].geometry=a),n.slice(s,s+o).forEach((a,l)=>i[l].geometry=a),t}function Jbt(t){const e=new io;return t.attributes||(t.attributes={}),e.geometry=t.geometry,e.attributes=t.attributes,e}async function nji(t,e){if(lt(e.infoFor3D))return;const{infoFor3D:i}=e;let r=!1;for(const o of i.editFormats)if(o===Ufe.GLTF_BINARY){r=!0;break}const n=[];for(const o of t.addFeatures??[])n.push(Zbt(o,t,e,r));for(const o of t.updateFeatures??[])n.push(Zbt(o,t,e,r));const s=await Promise.allSettled(n);for(const o of s)if(o.status==="rejected")throw o.reason}async function Zbt(t,e,i,r){if(lt(t.geometry)||t.geometry.type!=="mesh")return;const n=t.geometry,s=i.globalIdField;if(ve(i.parsedUrl)&&ve(n.external)&&Array.isArray(n.external.source)&&n.external.source.length===1&&"source"in n.external.source[0]&&typeof n.external.source[0].source=="string"&&n.external.source[0].source.startsWith(i.parsedUrl.path))return;if(!r)throw new st(`${i.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");const o=await n.toBinaryGLTF({ignoreLocalTransform:!0}),a=await o.buffer(),l=`{${GB()}}`,c=`${l}.glb`;e.addAssets?.push({featureGlobalId:t.getAttribute(s),assetMapGlobalId:l,assetName:c,flags:ve(n.transform)&&n.transform.geographic?Gfe.PROJECT_VERTICES:0,data:a.data,mimeType:a.type,assetType:Ufe.GLTF_BINARY,feature:t})}const lLe=Object.freeze(Object.defineProperty({__proto__:null,applyEdits:JVi},Symbol.toStringTag,{value:"Module"}));function sji(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Qbt,hZ,ewt,zfe={};Qbt={get exports(){return zfe},set exports(t){zfe=t}},hZ=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(hZ=hZ||__filename),ewt=function(t){var e,i;(t=(t=t||{})!==void 0?t:{}).ready=new Promise(function(At,zi){e=At,i=zi});var r,n,s,o=Object.assign({},t),a="./this.program",l=typeof window=="object",c=typeof importScripts=="function",h=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",p="";function y(At){return t.locateFile?t.locateFile(At,p):p+At}if(h){var v=require("fs"),x=require("path");p=c?x.dirname(p)+"/":__dirname+"/",r=(At,zi)=>(At=kt(At)?new URL(At):x.normalize(At),v.readFileSync(At,zi?void 0:"utf8")),s=At=>{var zi=r(At,!0);return zi.buffer||(zi=new Uint8Array(zi)),zi},n=(At,zi,Vr)=>{At=kt(At)?new URL(At):x.normalize(At),v.readFile(At,function(ts,Os){ts?Vr(ts):zi(Os.buffer)})},process.argv.length>1&&(a=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(At){if(!(At instanceof wt))throw At}),process.on("unhandledRejection",function(At){throw At}),t.inspect=function(){return"[Emscripten Module object]"}}else(l||c)&&(c?p=self.location.href:typeof document<"u"&&document.currentScript&&(p=document.currentScript.src),hZ&&(p=hZ),p=p.indexOf("blob:")!==0?p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1):"",r=At=>{var zi=new XMLHttpRequest;return zi.open("GET",At,!1),zi.send(null),zi.responseText},c&&(s=At=>{var zi=new XMLHttpRequest;return zi.open("GET",At,!1),zi.responseType="arraybuffer",zi.send(null),new Uint8Array(zi.response)}),n=(At,zi,Vr)=>{var ts=new XMLHttpRequest;ts.open("GET",At,!0),ts.responseType="arraybuffer",ts.onload=()=>{ts.status==200||ts.status==0&&ts.response?zi(ts.response):Vr()},ts.onerror=Vr,ts.send(null)});var I,P,F=t.print||console.log.bind(console),k=t.printErr||console.warn.bind(console);Object.assign(t,o),o=null,t.arguments&&t.arguments,t.thisProgram&&(a=t.thisProgram),t.quit&&t.quit,t.wasmBinary&&(I=t.wasmBinary),t.noExitRuntime,typeof WebAssembly!="object"&&ot("no native wasm support detected");var j=!1;function V(At,zi){At||ot(zi)}var Y,X,Z,ie,ce,he,_e,xe,Pe=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ke(At,zi,Vr){for(var ts=zi+Vr,Os=zi;At[Os]&&!(Os>=ts);)++Os;if(Os-zi>16&&At.buffer&&Pe)return Pe.decode(At.subarray(zi,Os));for(var Rs="";zi>10,56320|1023&k0)}}else Rs+=String.fromCharCode((31&Ia)<<6|cl)}else Rs+=String.fromCharCode(Ia)}return Rs}function J(At,zi){return At?ke(Z,At,zi):""}function de(At,zi,Vr,ts){if(!(ts>0))return 0;for(var Os=Vr,Rs=Vr+ts-1,Ia=0;Ia=55296&&cl<=57343&&(cl=65536+((1023&cl)<<10)|1023&At.charCodeAt(++Ia)),cl<=127){if(Vr>=Rs)break;zi[Vr++]=cl}else if(cl<=2047){if(Vr+1>=Rs)break;zi[Vr++]=192|cl>>6,zi[Vr++]=128|63&cl}else if(cl<=65535){if(Vr+2>=Rs)break;zi[Vr++]=224|cl>>12,zi[Vr++]=128|cl>>6&63,zi[Vr++]=128|63&cl}else{if(Vr+3>=Rs)break;zi[Vr++]=240|cl>>18,zi[Vr++]=128|cl>>12&63,zi[Vr++]=128|cl>>6&63,zi[Vr++]=128|63&cl}}return zi[Vr]=0,Vr-Os}function Se(At){for(var zi=0,Vr=0;Vr=55296&&ts<=57343?(zi+=4,++Vr):zi+=3}return zi}function Ie(At){Y=At,t.HEAP8=X=new Int8Array(At),t.HEAP16=ie=new Int16Array(At),t.HEAP32=ce=new Int32Array(At),t.HEAPU8=Z=new Uint8Array(At),t.HEAPU16=new Uint16Array(At),t.HEAPU32=he=new Uint32Array(At),t.HEAPF32=_e=new Float32Array(At),t.HEAPF64=xe=new Float64Array(At)}t.INITIAL_MEMORY;var Re=[],Oe=[],Ge=[];function Be(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)Ze(t.preRun.shift());Ne(Re)}function qe(){Ne(Oe)}function et(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)Pt(t.postRun.shift());Ne(Ge)}function Ze(At){Re.unshift(At)}function mt(At){Oe.unshift(At)}function Pt(At){Ge.unshift(At)}var $t=0,Ct=null;function Et(At){$t++,t.monitorRunDependencies&&t.monitorRunDependencies($t)}function Ft(At){if($t--,t.monitorRunDependencies&&t.monitorRunDependencies($t),$t==0&&Ct){var zi=Ct;Ct=null,zi()}}function ot(At){t.onAbort&&t.onAbort(At),k(At="Aborted("+At+")"),j=!0,At+=". Build with -sASSERTIONS for more info.";var zi=new WebAssembly.RuntimeError(At);throw i(zi),zi}var Te,je="data:application/octet-stream;base64,";function pt(At){return At.startsWith(je)}function kt(At){return At.startsWith("file://")}function ct(At){try{if(At==Te&&I)return new Uint8Array(I);if(s)return s(At);throw"both async and sync fetching of the wasm failed"}catch(zi){ot(zi)}}function ae(){if(!I&&(l||c)){if(typeof fetch=="function"&&!kt(Te))return fetch(Te,{credentials:"same-origin"}).then(function(At){if(!At.ok)throw"failed to load wasm binary file at '"+Te+"'";return At.arrayBuffer()}).catch(function(){return ct(Te)});if(n)return new Promise(function(At,zi){n(Te,function(Vr){At(new Uint8Array(Vr))},zi)})}return Promise.resolve().then(function(){return ct(Te)})}function ht(){var At={a:Zt};function zi(Rs,Ia){var cl=Rs.exports;t.asm=cl,Ie((P=t.asm.t).buffer),t.asm.Yb,mt(t.asm.u),Ft()}function Vr(Rs){zi(Rs.instance)}function ts(Rs){return ae().then(function(Ia){return WebAssembly.instantiate(Ia,At)}).then(function(Ia){return Ia}).then(Rs,function(Ia){k("failed to asynchronously prepare wasm: "+Ia),ot(Ia)})}function Os(){return I||typeof WebAssembly.instantiateStreaming!="function"||pt(Te)||kt(Te)||h||typeof fetch!="function"?ts(Vr):fetch(Te,{credentials:"same-origin"}).then(function(Rs){return WebAssembly.instantiateStreaming(Rs,At).then(Vr,function(Ia){return k("wasm streaming compile failed: "+Ia),k("falling back to ArrayBuffer instantiation"),ts(Vr)})})}if(Et(),t.instantiateWasm)try{return t.instantiateWasm(At,zi)}catch(Rs){k("Module.instantiateWasm callback failed with error: "+Rs),i(Rs)}return Os().catch(i),{}}function wt(At){this.name="ExitStatus",this.message="Program terminated with exit("+At+")",this.status=At}function Ne(At){for(;At.length>0;)At.shift()(t)}function pe(At,zi="i8"){switch(zi.endsWith("*")&&(zi="*"),zi){case"i1":case"i8":return X[At>>0];case"i16":return ie[At>>1];case"i32":case"i64":return ce[At>>2];case"float":return _e[At>>2];case"double":return xe[At>>3];case"*":return he[At>>2];default:ot("invalid type for getValue: "+zi)}return null}function Ae(At,zi,Vr){return 0}function tt(At,zi,Vr){}function gt(At,zi,Vr){return 0}function ze(At,zi,Vr,ts){}function Ot(At){}function jt(At,zi){}function nt(At,zi,Vr){}function $e(At){return he[At>>2]+4294967296*ce[At+4>>2]}function Xt(At){return At%4==0&&(At%100!=0||At%400==0)}pt(Te="pe-wasm.wasm")||(Te=y(Te));var A=[0,31,60,91,121,152,182,213,244,274,305,335],ye=[0,31,59,90,120,151,181,212,243,273,304,334];function H(At){return(Xt(At.getFullYear())?A:ye)[At.getMonth()]+At.getDate()-1}function T(At,zi){var Vr=new Date(1e3*$e(At));ce[zi>>2]=Vr.getSeconds(),ce[zi+4>>2]=Vr.getMinutes(),ce[zi+8>>2]=Vr.getHours(),ce[zi+12>>2]=Vr.getDate(),ce[zi+16>>2]=Vr.getMonth(),ce[zi+20>>2]=Vr.getFullYear()-1900,ce[zi+24>>2]=Vr.getDay();var ts=0|H(Vr);ce[zi+28>>2]=ts,ce[zi+36>>2]=-60*Vr.getTimezoneOffset();var Os=new Date(Vr.getFullYear(),0,1),Rs=new Date(Vr.getFullYear(),6,1).getTimezoneOffset(),Ia=Os.getTimezoneOffset(),cl=0|(Rs!=Ia&&Vr.getTimezoneOffset()==Math.min(Ia,Rs));ce[zi+32>>2]=cl}function b(At){var zi=Se(At)+1,Vr=at(zi);return Vr&&de(At,X,Vr,zi),Vr}function m(At,zi,Vr){var ts=new Date().getFullYear(),Os=new Date(ts,0,1),Rs=new Date(ts,6,1),Ia=Os.getTimezoneOffset(),cl=Rs.getTimezoneOffset(),Ng=Math.max(Ia,cl);function k0(rt){var hu=rt.toTimeString().match(/\(([A-Za-z ]+)\)$/);return hu?hu[1]:"GMT"}he[At>>2]=60*Ng,ce[zi>>2]=+(Ia!=cl);var Of=k0(Os),vm=k0(Rs),Ip=b(Of),h3=b(vm);cl>2]=Ip,he[Vr+4>>2]=h3):(he[Vr>>2]=h3,he[Vr+4>>2]=Ip)}function _(){ot("")}function C(){return Date.now()}function D(At,zi,Vr){Z.copyWithin(At,zi,zi+Vr)}function L(){return 2147483648}function B(At){try{return P.grow(At-Y.byteLength+65535>>>16),Ie(P.buffer),1}catch{}}function q(At){var zi=Z.length;At>>>=0;var Vr=L();if(At>Vr)return!1;let ts=(Ia,cl)=>Ia+(cl-Ia%cl)%cl;for(var Os=1;Os<=4;Os*=2){var Rs=zi*(1+.2/Os);if(Rs=Math.min(Rs,At+100663296),B(Math.min(Vr,ts(Math.max(At,Rs),65536))))return!0}return!1}var Q={};function oe(){return a||"./this.program"}function le(){if(!le.strings){var At={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",_:oe()};for(var zi in Q)Q[zi]===void 0?delete At[zi]:At[zi]=Q[zi];var Vr=[];for(var zi in At)Vr.push(zi+"="+At[zi]);le.strings=Vr}return le.strings}function be(At,zi,Vr){for(var ts=0;ts>0]=At.charCodeAt(ts);Vr||(X[zi>>0]=0)}function Me(At,zi){var Vr=0;return le().forEach(function(ts,Os){var Rs=zi+Vr;he[At+4*Os>>2]=Rs,be(ts,Rs),Vr+=ts.length+1}),0}function Ye(At,zi){var Vr=le();he[At>>2]=Vr.length;var ts=0;return Vr.forEach(function(Os){ts+=Os.length+1}),he[zi>>2]=ts,0}function it(At){return 52}function Lt(At,zi,Vr,ts){return 52}function Ut(At,zi,Vr,ts,Os){return 70}var Je=[null,[],[]];function Rt(At,zi){var Vr=Je[At];zi===0||zi===10?((At===1?F:k)(ke(Vr,0)),Vr.length=0):Vr.push(zi)}function ri(At,zi,Vr,ts){for(var Os=0,Rs=0;Rs>2],cl=he[zi+4>>2];zi+=8;for(var Ng=0;Ng>2]=Os,0}function ti(At,zi,Vr){var ts=Vr>0?Vr:Se(At)+1,Os=new Array(ts),Rs=de(At,Os,0,Os.length);return zi&&(Os.length=Rs),Os}var Zt={c:Ae,p:tt,f:gt,d:ze,n:Ot,m:jt,o:nt,h:T,i:m,k:_,g:C,s:D,l:q,q:Me,r:Ye,a:it,e:Lt,j:Ut,b:ri};ht(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.u).apply(null,arguments)};var ii=t._emscripten_bind_PeObject_getCode_0=function(){return(ii=t._emscripten_bind_PeObject_getCode_0=t.asm.v).apply(null,arguments)},Ci=t._emscripten_bind_PeObject_getName_1=function(){return(Ci=t._emscripten_bind_PeObject_getName_1=t.asm.w).apply(null,arguments)},ki=t._emscripten_bind_PeObject_getType_0=function(){return(ki=t._emscripten_bind_PeObject_getType_0=t.asm.x).apply(null,arguments)},Ni=t._emscripten_bind_PeCoordsys_getCode_0=function(){return(Ni=t._emscripten_bind_PeCoordsys_getCode_0=t.asm.y).apply(null,arguments)},tr=t._emscripten_bind_PeCoordsys_getName_1=function(){return(tr=t._emscripten_bind_PeCoordsys_getName_1=t.asm.z).apply(null,arguments)},cr=t._emscripten_bind_PeCoordsys_getType_0=function(){return(cr=t._emscripten_bind_PeCoordsys_getType_0=t.asm.A).apply(null,arguments)},wi=t._emscripten_bind_VoidPtr___destroy___0=function(){return(wi=t._emscripten_bind_VoidPtr___destroy___0=t.asm.B).apply(null,arguments)},bn=t._emscripten_bind_PeDatum_getSpheroid_0=function(){return(bn=t._emscripten_bind_PeDatum_getSpheroid_0=t.asm.C).apply(null,arguments)},qr=t._emscripten_bind_PeDatum_getCode_0=function(){return(qr=t._emscripten_bind_PeDatum_getCode_0=t.asm.D).apply(null,arguments)},eo=t._emscripten_bind_PeDatum_getName_1=function(){return(eo=t._emscripten_bind_PeDatum_getName_1=t.asm.E).apply(null,arguments)},Ur=t._emscripten_bind_PeDatum_getType_0=function(){return(Ur=t._emscripten_bind_PeDatum_getType_0=t.asm.F).apply(null,arguments)},os=t._emscripten_bind_PeDefs_get_PE_BUFFER_MAX_0=function(){return(os=t._emscripten_bind_PeDefs_get_PE_BUFFER_MAX_0=t.asm.G).apply(null,arguments)},Wn=t._emscripten_bind_PeDefs_get_PE_NAME_MAX_0=function(){return(Wn=t._emscripten_bind_PeDefs_get_PE_NAME_MAX_0=t.asm.H).apply(null,arguments)},Mn=t._emscripten_bind_PeDefs_get_PE_MGRS_MAX_0=function(){return(Mn=t._emscripten_bind_PeDefs_get_PE_MGRS_MAX_0=t.asm.I).apply(null,arguments)},es=t._emscripten_bind_PeDefs_get_PE_USNG_MAX_0=function(){return(es=t._emscripten_bind_PeDefs_get_PE_USNG_MAX_0=t.asm.J).apply(null,arguments)},ji=t._emscripten_bind_PeDefs_get_PE_DD_MAX_0=function(){return(ji=t._emscripten_bind_PeDefs_get_PE_DD_MAX_0=t.asm.K).apply(null,arguments)},Xr=t._emscripten_bind_PeDefs_get_PE_DMS_MAX_0=function(){return(Xr=t._emscripten_bind_PeDefs_get_PE_DMS_MAX_0=t.asm.L).apply(null,arguments)},wo=t._emscripten_bind_PeDefs_get_PE_DDM_MAX_0=function(){return(wo=t._emscripten_bind_PeDefs_get_PE_DDM_MAX_0=t.asm.M).apply(null,arguments)},An=t._emscripten_bind_PeDefs_get_PE_UTM_MAX_0=function(){return(An=t._emscripten_bind_PeDefs_get_PE_UTM_MAX_0=t.asm.N).apply(null,arguments)},Zi=t._emscripten_bind_PeDefs_get_PE_PARM_MAX_0=function(){return(Zi=t._emscripten_bind_PeDefs_get_PE_PARM_MAX_0=t.asm.O).apply(null,arguments)},ui=t._emscripten_bind_PeDefs_get_PE_TYPE_NONE_0=function(){return(ui=t._emscripten_bind_PeDefs_get_PE_TYPE_NONE_0=t.asm.P).apply(null,arguments)},W=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGCS_0=function(){return(W=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGCS_0=t.asm.Q).apply(null,arguments)},Mr=t._emscripten_bind_PeDefs_get_PE_TYPE_PROJCS_0=function(){return(Mr=t._emscripten_bind_PeDefs_get_PE_TYPE_PROJCS_0=t.asm.R).apply(null,arguments)},Qo=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGTRAN_0=function(){return(Qo=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGTRAN_0=t.asm.S).apply(null,arguments)},Go=t._emscripten_bind_PeDefs_get_PE_TYPE_COORDSYS_0=function(){return(Go=t._emscripten_bind_PeDefs_get_PE_TYPE_COORDSYS_0=t.asm.T).apply(null,arguments)},Wt=t._emscripten_bind_PeDefs_get_PE_TYPE_UNIT_0=function(){return(Wt=t._emscripten_bind_PeDefs_get_PE_TYPE_UNIT_0=t.asm.U).apply(null,arguments)},Ta=t._emscripten_bind_PeDefs_get_PE_TYPE_LINUNIT_0=function(){return(Ta=t._emscripten_bind_PeDefs_get_PE_TYPE_LINUNIT_0=t.asm.V).apply(null,arguments)},Ti=t._emscripten_bind_PeDefs_get_PE_STR_OPTS_NONE_0=function(){return(Ti=t._emscripten_bind_PeDefs_get_PE_STR_OPTS_NONE_0=t.asm.W).apply(null,arguments)},_t=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_NONE_0=function(){return(_t=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_NONE_0=t.asm.X).apply(null,arguments)},Br=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_TOP_0=function(){return(Br=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_TOP_0=t.asm.Y).apply(null,arguments)},Kr=t._emscripten_bind_PeDefs_get_PE_STR_NAME_CANON_0=function(){return(Kr=t._emscripten_bind_PeDefs_get_PE_STR_NAME_CANON_0=t.asm.Z).apply(null,arguments)},jn=t._emscripten_bind_PeDefs_get_PE_PARM_X0_0=function(){return(jn=t._emscripten_bind_PeDefs_get_PE_PARM_X0_0=t.asm._).apply(null,arguments)},Kn=t._emscripten_bind_PeDefs_get_PE_PARM_ND_0=function(){return(Kn=t._emscripten_bind_PeDefs_get_PE_PARM_ND_0=t.asm.$).apply(null,arguments)},Cs=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_1_TO_2_0=function(){return(Cs=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_1_TO_2_0=t.asm.aa).apply(null,arguments)},ea=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_2_TO_1_0=function(){return(ea=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_2_TO_1_0=t.asm.ba).apply(null,arguments)},Bt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_P_TO_G_0=function(){return(Bt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_P_TO_G_0=t.asm.ca).apply(null,arguments)},Nt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_G_TO_P_0=function(){return(Nt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_G_TO_P_0=t.asm.da).apply(null,arguments)},xi=t._emscripten_bind_PeDefs_get_PE_HORIZON_RECT_0=function(){return(xi=t._emscripten_bind_PeDefs_get_PE_HORIZON_RECT_0=t.asm.ea).apply(null,arguments)},Ai=t._emscripten_bind_PeDefs_get_PE_HORIZON_POLY_0=function(){return(Ai=t._emscripten_bind_PeDefs_get_PE_HORIZON_POLY_0=t.asm.fa).apply(null,arguments)},Ei=t._emscripten_bind_PeDefs_get_PE_HORIZON_LINE_0=function(){return(Ei=t._emscripten_bind_PeDefs_get_PE_HORIZON_LINE_0=t.asm.ga).apply(null,arguments)},ir=t._emscripten_bind_PeDefs_get_PE_HORIZON_DELTA_0=function(){return(ir=t._emscripten_bind_PeDefs_get_PE_HORIZON_DELTA_0=t.asm.ha).apply(null,arguments)},or=t._emscripten_bind_PeFactory_initialize_1=function(){return(or=t._emscripten_bind_PeFactory_initialize_1=t.asm.ia).apply(null,arguments)},Cn=t._emscripten_bind_PeFactory_factoryByType_2=function(){return(Cn=t._emscripten_bind_PeFactory_factoryByType_2=t.asm.ja).apply(null,arguments)},Gn=t._emscripten_bind_PeFactory_fromString_2=function(){return(Gn=t._emscripten_bind_PeFactory_fromString_2=t.asm.ka).apply(null,arguments)},Po=t._emscripten_bind_PeFactory_getCode_1=function(){return(Po=t._emscripten_bind_PeFactory_getCode_1=t.asm.la).apply(null,arguments)},Dn=t._emscripten_bind_PeGCSExtent_PeGCSExtent_6=function(){return(Dn=t._emscripten_bind_PeGCSExtent_PeGCSExtent_6=t.asm.ma).apply(null,arguments)},Lo=t._emscripten_bind_PeGCSExtent_getLLon_0=function(){return(Lo=t._emscripten_bind_PeGCSExtent_getLLon_0=t.asm.na).apply(null,arguments)},si=t._emscripten_bind_PeGCSExtent_getSLat_0=function(){return(si=t._emscripten_bind_PeGCSExtent_getSLat_0=t.asm.oa).apply(null,arguments)},vt=t._emscripten_bind_PeGCSExtent_getRLon_0=function(){return(vt=t._emscripten_bind_PeGCSExtent_getRLon_0=t.asm.pa).apply(null,arguments)},Kt=t._emscripten_bind_PeGCSExtent_getNLat_0=function(){return(Kt=t._emscripten_bind_PeGCSExtent_getNLat_0=t.asm.qa).apply(null,arguments)},Di=t._emscripten_bind_PeGCSExtent___destroy___0=function(){return(Di=t._emscripten_bind_PeGCSExtent___destroy___0=t.asm.ra).apply(null,arguments)},Tr=t._emscripten_bind_PeGeogcs_getDatum_0=function(){return(Tr=t._emscripten_bind_PeGeogcs_getDatum_0=t.asm.sa).apply(null,arguments)},Pr=t._emscripten_bind_PeGeogcs_getPrimem_0=function(){return(Pr=t._emscripten_bind_PeGeogcs_getPrimem_0=t.asm.ta).apply(null,arguments)},oi=t._emscripten_bind_PeGeogcs_getUnit_0=function(){return(oi=t._emscripten_bind_PeGeogcs_getUnit_0=t.asm.ua).apply(null,arguments)},mi=t._emscripten_bind_PeGeogcs_getCode_0=function(){return(mi=t._emscripten_bind_PeGeogcs_getCode_0=t.asm.va).apply(null,arguments)},yi=t._emscripten_bind_PeGeogcs_getName_1=function(){return(yi=t._emscripten_bind_PeGeogcs_getName_1=t.asm.wa).apply(null,arguments)},vr=t._emscripten_bind_PeGeogcs_getType_0=function(){return(vr=t._emscripten_bind_PeGeogcs_getType_0=t.asm.xa).apply(null,arguments)},Gr=t._emscripten_bind_PeGeogtran_isEqual_1=function(){return(Gr=t._emscripten_bind_PeGeogtran_isEqual_1=t.asm.ya).apply(null,arguments)},Or=t._emscripten_bind_PeGeogtran_getGeogcs1_0=function(){return(Or=t._emscripten_bind_PeGeogtran_getGeogcs1_0=t.asm.za).apply(null,arguments)},zr=t._emscripten_bind_PeGeogtran_getGeogcs2_0=function(){return(zr=t._emscripten_bind_PeGeogtran_getGeogcs2_0=t.asm.Aa).apply(null,arguments)},Ir=t._emscripten_bind_PeGeogtran_getParameters_0=function(){return(Ir=t._emscripten_bind_PeGeogtran_getParameters_0=t.asm.Ba).apply(null,arguments)},Fn=t._emscripten_bind_PeGeogtran_loadConstants_0=function(){return(Fn=t._emscripten_bind_PeGeogtran_loadConstants_0=t.asm.Ca).apply(null,arguments)},gs=t._emscripten_bind_PeGeogtran_getCode_0=function(){return(gs=t._emscripten_bind_PeGeogtran_getCode_0=t.asm.Da).apply(null,arguments)},Ts=t._emscripten_bind_PeGeogtran_getName_1=function(){return(Ts=t._emscripten_bind_PeGeogtran_getName_1=t.asm.Ea).apply(null,arguments)},fi=t._emscripten_bind_PeGeogtran_getType_0=function(){return(fi=t._emscripten_bind_PeGeogtran_getType_0=t.asm.Fa).apply(null,arguments)},dr=t._emscripten_bind_PeGTlistExtended_getGTlist_6=function(){return(dr=t._emscripten_bind_PeGTlistExtended_getGTlist_6=t.asm.Ga).apply(null,arguments)},wr=t._emscripten_bind_PeGTlistExtended_get_PE_GTLIST_OPTS_COMMON_0=function(){return(wr=t._emscripten_bind_PeGTlistExtended_get_PE_GTLIST_OPTS_COMMON_0=t.asm.Ha).apply(null,arguments)},on=t._emscripten_bind_PeGTlistExtendedEntry_getEntries_0=function(){return(on=t._emscripten_bind_PeGTlistExtendedEntry_getEntries_0=t.asm.Ia).apply(null,arguments)},ar=t._emscripten_bind_PeGTlistExtendedEntry_getSteps_0=function(){return(ar=t._emscripten_bind_PeGTlistExtendedEntry_getSteps_0=t.asm.Ja).apply(null,arguments)},Es=t._emscripten_bind_PeGTlistExtendedEntry_Delete_1=function(){return(Es=t._emscripten_bind_PeGTlistExtendedEntry_Delete_1=t.asm.Ka).apply(null,arguments)},Ha=t._emscripten_bind_PeGTlistExtendedGTs_getDirection_0=function(){return(Ha=t._emscripten_bind_PeGTlistExtendedGTs_getDirection_0=t.asm.La).apply(null,arguments)},La=t._emscripten_bind_PeGTlistExtendedGTs_getGeogtran_0=function(){return(La=t._emscripten_bind_PeGTlistExtendedGTs_getGeogtran_0=t.asm.Ma).apply(null,arguments)},zs=t._emscripten_bind_PeHorizon_getNump_0=function(){return(zs=t._emscripten_bind_PeHorizon_getNump_0=t.asm.Na).apply(null,arguments)},Eu=t._emscripten_bind_PeHorizon_getKind_0=function(){return(Eu=t._emscripten_bind_PeHorizon_getKind_0=t.asm.Oa).apply(null,arguments)},Iu=t._emscripten_bind_PeHorizon_getInclusive_0=function(){return(Iu=t._emscripten_bind_PeHorizon_getInclusive_0=t.asm.Pa).apply(null,arguments)},Vc=t._emscripten_bind_PeHorizon_getSize_0=function(){return(Vc=t._emscripten_bind_PeHorizon_getSize_0=t.asm.Qa).apply(null,arguments)},jc=t._emscripten_bind_PeHorizon_getCoord_0=function(){return(jc=t._emscripten_bind_PeHorizon_getCoord_0=t.asm.Ra).apply(null,arguments)},Vl=t._emscripten_bind_PeInteger_PeInteger_1=function(){return(Vl=t._emscripten_bind_PeInteger_PeInteger_1=t.asm.Sa).apply(null,arguments)},fh=t._emscripten_bind_PeInteger_get_val_0=function(){return(fh=t._emscripten_bind_PeInteger_get_val_0=t.asm.Ta).apply(null,arguments)},ud=t._emscripten_bind_PeInteger_set_val_1=function(){return(ud=t._emscripten_bind_PeInteger_set_val_1=t.asm.Ua).apply(null,arguments)},rf=t._emscripten_bind_PeInteger___destroy___0=function(){return(rf=t._emscripten_bind_PeInteger___destroy___0=t.asm.Va).apply(null,arguments)},Yl=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_NEW_0=function(){return(Yl=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_NEW_0=t.asm.Wa).apply(null,arguments)},mh=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_OLD_0=function(){return(mh=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_OLD_0=t.asm.Xa).apply(null,arguments)},cd=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_AUTO_0=function(){return(cd=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_AUTO_0=t.asm.Ya).apply(null,arguments)},vu=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_180_ZONE_1_PLUS_0=function(){return(vu=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_180_ZONE_1_PLUS_0=t.asm.Za).apply(null,arguments)},nf=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_ADD_SPACES_0=function(){return(nf=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_ADD_SPACES_0=t.asm._a).apply(null,arguments)},Mh=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NONE_0=function(){return(Mh=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NONE_0=t.asm.$a).apply(null,arguments)},Mg=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_0=function(){return(Mg=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_0=t.asm.ab).apply(null,arguments)},Dg=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_STRICT_0=function(){return(Dg=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_STRICT_0=t.asm.bb).apply(null,arguments)},ep=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_ADD_SPACES_0=function(){return(ep=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_ADD_SPACES_0=t.asm.cb).apply(null,arguments)},Ea=t._emscripten_bind_PeParameter_getValue_0=function(){return(Ea=t._emscripten_bind_PeParameter_getValue_0=t.asm.db).apply(null,arguments)},ym=t._emscripten_bind_PeParameter_getCode_0=function(){return(ym=t._emscripten_bind_PeParameter_getCode_0=t.asm.eb).apply(null,arguments)},wl=t._emscripten_bind_PeParameter_getName_1=function(){return(wl=t._emscripten_bind_PeParameter_getName_1=t.asm.fb).apply(null,arguments)},sf=t._emscripten_bind_PeParameter_getType_0=function(){return(sf=t._emscripten_bind_PeParameter_getType_0=t.asm.gb).apply(null,arguments)},gh=t._emscripten_bind_PePCSInfo_getCentralMeridian_0=function(){return(gh=t._emscripten_bind_PePCSInfo_getCentralMeridian_0=t.asm.hb).apply(null,arguments)},pi=t._emscripten_bind_PePCSInfo_getDomainMinx_0=function(){return(pi=t._emscripten_bind_PePCSInfo_getDomainMinx_0=t.asm.ib).apply(null,arguments)},xl=t._emscripten_bind_PePCSInfo_getDomainMiny_0=function(){return(xl=t._emscripten_bind_PePCSInfo_getDomainMiny_0=t.asm.jb).apply(null,arguments)},of=t._emscripten_bind_PePCSInfo_getDomainMaxx_0=function(){return(of=t._emscripten_bind_PePCSInfo_getDomainMaxx_0=t.asm.kb).apply(null,arguments)},Fg=t._emscripten_bind_PePCSInfo_getDomainMaxy_0=function(){return(Fg=t._emscripten_bind_PePCSInfo_getDomainMaxy_0=t.asm.lb).apply(null,arguments)},ua=t._emscripten_bind_PePCSInfo_getNorthPoleLocation_0=function(){return(ua=t._emscripten_bind_PePCSInfo_getNorthPoleLocation_0=t.asm.mb).apply(null,arguments)},Ep=t._emscripten_bind_PePCSInfo_getNorthPoleGeometry_0=function(){return(Ep=t._emscripten_bind_PePCSInfo_getNorthPoleGeometry_0=t.asm.nb).apply(null,arguments)},to=t._emscripten_bind_PePCSInfo_getSouthPoleLocation_0=function(){return(to=t._emscripten_bind_PePCSInfo_getSouthPoleLocation_0=t.asm.ob).apply(null,arguments)},lo=t._emscripten_bind_PePCSInfo_getSouthPoleGeometry_0=function(){return(lo=t._emscripten_bind_PePCSInfo_getSouthPoleGeometry_0=t.asm.pb).apply(null,arguments)},uu=t._emscripten_bind_PePCSInfo_isDensificationNeeded_0=function(){return(uu=t._emscripten_bind_PePCSInfo_isDensificationNeeded_0=t.asm.qb).apply(null,arguments)},ju=t._emscripten_bind_PePCSInfo_isGcsHorizonMultiOverlap_0=function(){return(ju=t._emscripten_bind_PePCSInfo_isGcsHorizonMultiOverlap_0=t.asm.rb).apply(null,arguments)},Jm=t._emscripten_bind_PePCSInfo_isPannableRectangle_0=function(){return(Jm=t._emscripten_bind_PePCSInfo_isPannableRectangle_0=t.asm.sb).apply(null,arguments)},oh=t._emscripten_bind_PePCSInfo_generate_2=function(){return(oh=t._emscripten_bind_PePCSInfo_generate_2=t.asm.tb).apply(null,arguments)},ah=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_NONE_0=function(){return(ah=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_NONE_0=t.asm.ub).apply(null,arguments)},Au=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_DOMAIN_0=function(){return(Au=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_DOMAIN_0=t.asm.vb).apply(null,arguments)},cu=t._emscripten_bind_PePCSInfo_get_PE_POLE_OUTSIDE_BOUNDARY_0=function(){return(cu=t._emscripten_bind_PePCSInfo_get_PE_POLE_OUTSIDE_BOUNDARY_0=t.asm.wb).apply(null,arguments)},el=t._emscripten_bind_PePCSInfo_get_PE_POLE_POINT_0=function(){return(el=t._emscripten_bind_PePCSInfo_get_PE_POLE_POINT_0=t.asm.xb).apply(null,arguments)},Dh=t._emscripten_bind_PePrimem_getLongitude_0=function(){return(Dh=t._emscripten_bind_PePrimem_getLongitude_0=t.asm.yb).apply(null,arguments)},uc=t._emscripten_bind_PePrimem_getCode_0=function(){return(uc=t._emscripten_bind_PePrimem_getCode_0=t.asm.zb).apply(null,arguments)},Xl=t._emscripten_bind_PePrimem_getName_1=function(){return(Xl=t._emscripten_bind_PePrimem_getName_1=t.asm.Ab).apply(null,arguments)},Dc=t._emscripten_bind_PePrimem_getType_0=function(){return(Dc=t._emscripten_bind_PePrimem_getType_0=t.asm.Bb).apply(null,arguments)},Zm=t._emscripten_bind_PeProjcs_getGeogcs_0=function(){return(Zm=t._emscripten_bind_PeProjcs_getGeogcs_0=t.asm.Cb).apply(null,arguments)},tp=t._emscripten_bind_PeProjcs_getParameters_0=function(){return(tp=t._emscripten_bind_PeProjcs_getParameters_0=t.asm.Db).apply(null,arguments)},Af=t._emscripten_bind_PeProjcs_getUnit_0=function(){return(Af=t._emscripten_bind_PeProjcs_getUnit_0=t.asm.Eb).apply(null,arguments)},Oy=t._emscripten_bind_PeProjcs_loadConstants_0=function(){return(Oy=t._emscripten_bind_PeProjcs_loadConstants_0=t.asm.Fb).apply(null,arguments)},Lg=t._emscripten_bind_PeProjcs_horizonGcsGenerate_0=function(){return(Lg=t._emscripten_bind_PeProjcs_horizonGcsGenerate_0=t.asm.Gb).apply(null,arguments)},qt=t._emscripten_bind_PeProjcs_horizonPcsGenerate_0=function(){return(qt=t._emscripten_bind_PeProjcs_horizonPcsGenerate_0=t.asm.Hb).apply(null,arguments)},Jt=t._emscripten_bind_PeProjcs_getCode_0=function(){return(Jt=t._emscripten_bind_PeProjcs_getCode_0=t.asm.Ib).apply(null,arguments)},Fi=t._emscripten_bind_PeProjcs_getName_1=function(){return(Fi=t._emscripten_bind_PeProjcs_getName_1=t.asm.Jb).apply(null,arguments)},Yi=t._emscripten_bind_PeProjcs_getType_0=function(){return(Yi=t._emscripten_bind_PeProjcs_getType_0=t.asm.Kb).apply(null,arguments)},me=t._emscripten_bind_PeSpheroid_getAxis_0=function(){return(me=t._emscripten_bind_PeSpheroid_getAxis_0=t.asm.Lb).apply(null,arguments)},Le=t._emscripten_bind_PeSpheroid_getFlattening_0=function(){return(Le=t._emscripten_bind_PeSpheroid_getFlattening_0=t.asm.Mb).apply(null,arguments)},We=t._emscripten_bind_PeSpheroid_getCode_0=function(){return(We=t._emscripten_bind_PeSpheroid_getCode_0=t.asm.Nb).apply(null,arguments)},bt=t._emscripten_bind_PeSpheroid_getName_1=function(){return(bt=t._emscripten_bind_PeSpheroid_getName_1=t.asm.Ob).apply(null,arguments)},ne=t._emscripten_bind_PeSpheroid_getType_0=function(){return(ne=t._emscripten_bind_PeSpheroid_getType_0=t.asm.Pb).apply(null,arguments)},ee=t._emscripten_bind_PeUnit_getUnitFactor_0=function(){return(ee=t._emscripten_bind_PeUnit_getUnitFactor_0=t.asm.Qb).apply(null,arguments)},se=t._emscripten_bind_PeUnit_getCode_0=function(){return(se=t._emscripten_bind_PeUnit_getCode_0=t.asm.Rb).apply(null,arguments)},ge=t._emscripten_bind_PeUnit_getName_1=function(){return(ge=t._emscripten_bind_PeUnit_getName_1=t.asm.Sb).apply(null,arguments)},Ee=t._emscripten_bind_PeUnit_getType_0=function(){return(Ee=t._emscripten_bind_PeUnit_getType_0=t.asm.Tb).apply(null,arguments)},He=t._emscripten_bind_PeVersion_version_string_0=function(){return(He=t._emscripten_bind_PeVersion_version_string_0=t.asm.Ub).apply(null,arguments)};t._pe_getPeGTlistExtendedEntrySize=function(){return(t._pe_getPeGTlistExtendedEntrySize=t.asm.Vb).apply(null,arguments)},t._pe_getPeGTlistExtendedGTsSize=function(){return(t._pe_getPeGTlistExtendedGTsSize=t.asm.Wb).apply(null,arguments)},t._pe_getPeHorizonSize=function(){return(t._pe_getPeHorizonSize=t.asm.Xb).apply(null,arguments)},t._pe_geog_to_geog=function(){return(t._pe_geog_to_geog=t.asm.Zb).apply(null,arguments)},t._pe_geog_to_proj=function(){return(t._pe_geog_to_proj=t.asm._b).apply(null,arguments)},t._pe_geog_to_dd=function(){return(t._pe_geog_to_dd=t.asm.$b).apply(null,arguments)},t._pe_dd_to_geog=function(){return(t._pe_dd_to_geog=t.asm.ac).apply(null,arguments)},t._pe_geog_to_ddm=function(){return(t._pe_geog_to_ddm=t.asm.bc).apply(null,arguments)},t._pe_ddm_to_geog=function(){return(t._pe_ddm_to_geog=t.asm.cc).apply(null,arguments)},t._pe_geog_to_dms=function(){return(t._pe_geog_to_dms=t.asm.dc).apply(null,arguments)},t._pe_dms_to_geog=function(){return(t._pe_dms_to_geog=t.asm.ec).apply(null,arguments)},t._pe_geog_to_mgrs_extended=function(){return(t._pe_geog_to_mgrs_extended=t.asm.fc).apply(null,arguments)},t._pe_mgrs_to_geog_extended=function(){return(t._pe_mgrs_to_geog_extended=t.asm.gc).apply(null,arguments)},t._pe_geog_to_usng=function(){return(t._pe_geog_to_usng=t.asm.hc).apply(null,arguments)},t._pe_usng_to_geog=function(){return(t._pe_usng_to_geog=t.asm.ic).apply(null,arguments)},t._pe_geog_to_utm=function(){return(t._pe_geog_to_utm=t.asm.jc).apply(null,arguments)},t._pe_utm_to_geog=function(){return(t._pe_utm_to_geog=t.asm.kc).apply(null,arguments)},t._pe_object_to_string_ext=function(){return(t._pe_object_to_string_ext=t.asm.lc).apply(null,arguments)},t._pe_proj_to_geog_center=function(){return(t._pe_proj_to_geog_center=t.asm.mc).apply(null,arguments)};var Xe,at=t._malloc=function(){return(at=t._malloc=t.asm.nc).apply(null,arguments)};function Tt(At){function zi(){Xe||(Xe=!0,t.calledRun=!0,j||(qe(),e(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),et()))}$t>0||(Be(),$t>0||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),zi()},1)):zi()))}if(t._free=function(){return(t._free=t.asm.oc).apply(null,arguments)},t.___start_em_js=1970140,t.___stop_em_js=1970238,t.UTF8ToString=J,t.getValue=pe,Ct=function At(){Xe||Tt(),Xe||(Ct=At)},t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();function Yt(){}function bi(At){return(At||Yt).__cache__}function _i(At,zi){var Vr=bi(zi),ts=Vr[At];return ts||((ts=Object.create((zi||Yt).prototype)).ptr=At,Vr[At]=ts)}function Li(At,zi){return _i(At.ptr,zi)}function Xi(At){if(!At.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";At.__destroy__(),delete bi(At.__class__)[At.ptr]}function fr(At,zi){return At.ptr===zi.ptr}function lr(At){return At.ptr}function Fr(At){return At.__class__}Tt(),Yt.prototype=Object.create(Yt.prototype),Yt.prototype.constructor=Yt,Yt.prototype.__class__=Yt,Yt.__cache__={},t.WrapperObject=Yt,t.getCache=bi,t.wrapPointer=_i,t.castObject=Li,t.NULL=_i(0),t.destroy=Xi,t.compare=fr,t.getPointer=lr,t.getClass=Fr;var gr={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(gr.needed){for(var At=0;At=gr.size?(V(Os>0),gr.needed+=Os,Vr=t._malloc(Os),gr.temps.push(Vr)):(Vr=gr.buffer+gr.pos,gr.pos+=Os),Vr},copy:function(At,zi,Vr){switch(Vr>>>=0,zi.BYTES_PER_ELEMENT){case 2:Vr>>>=1;break;case 4:Vr>>>=2;break;case 8:Vr>>>=3}for(var ts=0;ts{const r=new FileReader;r.readAsDataURL(t),r.onload=()=>e(Y3(r.result)),r.onerror=n=>i(n)})}const gji=new Set(["Feature Layer","Table"]),yji=new Ks({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let rU=class extends gd{constructor(){super(...arguments),this.type="feature-layer",this.refresh=q0(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 i=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:i,updates:i?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}})}load(e){const i=ve(e)?e.signal:null,r=this.layer.sourceJSON;return this.addResolvingPromise(this._fetchService(r,i)),Promise.resolve(this)}get queryTask(){const{capabilities:e,parsedUrl:i,dynamicDataSource:r,infoFor3D:n,gdbVersion:s,spatialReference:o,fieldsIndex:a}=this.layer,l=Hi("featurelayer-pbf")&&e?.query.supportsFormatPBF&<(n),c=e?.operations?.supportsQueryAttachments??!1;return new nZe({url:i.path,pbfSupported:l,fieldsIndex:a,infoFor3D:n,dynamicDataSource:r,gdbVersion:s,sourceSpatialReference:o,queryAttachmentsSupported:c})}async addAttachment(e,i){await this.load();const r=e.attributes[this.layer.objectIdField],n=this.layer.parsedUrl.path+"/"+r+"/addAttachment",s=this._getLayerRequestOptions(),o=this._getFormDataForAttachment(i,s.query);try{const a=await ur(n,{body:o});return this._createFeatureEditResult(a.data.addAttachmentResult)}catch(a){throw this._createAttachmentErrorResult(r,a)}}async updateAttachment(e,i,r){await this.load();const n=e.attributes[this.layer.objectIdField],s=this.layer.parsedUrl.path+"/"+n+"/updateAttachment",o=this._getLayerRequestOptions({query:{attachmentId:i}}),a=this._getFormDataForAttachment(r,o.query);try{const l=await ur(s,{body:a});return this._createFeatureEditResult(l.data.updateAttachmentResult)}catch(l){throw this._createAttachmentErrorResult(n,l)}}async applyEdits(e,i){await this.load();const r=this.layer.infoFor3D,n=ve(r),s=n||(i?.globalIdUsed??!1),o=e.addFeatures?.map(j=>this._serializeFeature(j,r)).filter(ve)??[],a=e.updateFeatures?.map(j=>this._serializeFeature(j,r)).filter(ve)??[],l=this._getFeatureIds(e.deleteFeatures,s);AHe(o,a,this.layer.spatialReference);const c=[],h=[],p=[...e.deleteAttachments??[]];for(const j of e.addAttachments??[])c.push(await this._serializeAttachment(j));for(const j of e.updateAttachments??[])h.push(await this._serializeAttachment(j));const y=c.length||h.length||p.length?{adds:c,updates:h,deletes:p}:null;let v,x=null;if(n){x=new Map;const j=[];for(const Y of e.addAssets??[])j.push(this._serializeAssetMapEditAndUploadAssets(Y,x));const V=await Promise.all(j);v=V.length?{adds:V,updates:[],deletes:[]}:void 0}const I={gdbVersion:i?.gdbVersion||this.layer.gdbVersion,rollbackOnFailure:i?.rollbackOnFailureEnabled,useGlobalIds:s,returnEditMoment:i?.returnEditMoment,usePreviousEditMoment:i?.usePreviousEditMoment,sessionId:i?.sessionId};i?.returnServiceEditsOption?(I.edits=JSON.stringify([{id:this.layer.layerId,adds:o,updates:a,deletes:l,attachments:y,assetMaps:v}]),I.returnServiceEditsOption=mji.toJSON(i?.returnServiceEditsOption),I.returnServiceEditsInSourceSR=i?.returnServiceEditsInSourceSR):(I.adds=o.length?JSON.stringify(o):null,I.updates=a.length?JSON.stringify(a):null,I.deletes=l.length?s?JSON.stringify(l):l.join(","):null,I.attachments=y&&JSON.stringify(y),I.assetMaps=ve(v)?JSON.stringify(v):void 0);const P=this._getLayerRequestOptions({method:"post",query:I}),F=i?.returnServiceEditsOption?this.layer.url:this.layer.parsedUrl.path,k=await ur(F+"/applyEdits",P);if(!this.layer.capabilities.operations?.supportsEditing&&this.layer.effectiveCapabilities?.operations?.supportsEditing&&await Ho?.findCredential(this.layer.url)?.refreshToken(),n&&k.data!=null&&k.data.assetMaps!=null){const j=k.data,V=this.layer.objectIdField,Y=[];for(const ie of j.addResults)ie.success&&Y.push(ie.objectId);for(const ie of j.updateResults)ie.success&&Y.push(ie.objectId);const X=this._createRequestQueryOptions(),Z=await ur(F+"/query",{...X,query:{f:"json",formatOf3DObjects:"3D_glb",where:`OBJECTID IN (${Y.join(",")})`,outFields:`${V}`}});if(Z&&Z.data&&Z.data.assetMaps&&ve(x)){const ie=Z.data.assetMaps;for(const ce of ie){const he=x.get(ce.parentGlobalId).geometry;ve(he)&&he.type==="mesh"&&he.updateExternalSource({source:[{name:ce.assetName,source:ce.assetName}],extent:he.extent})}}}return this._createEditsResult(k)}async deleteAttachments(e,i){await this.load();const r=e.attributes[this.layer.objectIdField],n=this.layer.parsedUrl.path+"/"+r+"/deleteAttachments";try{return(await ur(n,this._getLayerRequestOptions({query:{attachmentIds:i.join(",")},method:"post"}))).data.deleteAttachmentResults.map(this._createFeatureEditResult)}catch(s){throw this._createAttachmentErrorResult(r,s)}}fetchRecomputedExtents(e={}){const i=e.signal;return this.load({signal:i}).then(async()=>{const r=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:n,url:s}=this.layer,{data:o}=await ur(`${s}/${n}`,r),{id:a,extent:l,fullExtent:c,timeExtent:h}=o,p=l||c;return{id:a,fullExtent:p&&Ar.fromJSON(p),timeExtent:h&&Xg.fromJSON({start:h[0],end:h[1]})}})}async queryAttachments(e,i={}){await this.load();const r=this._getLayerRequestOptions(i);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,i){return await this.load(),this.queryTask.execute(e,{...i,query:this._createRequestQueryOptions(i)})}async queryFeaturesJSON(e,i){return await this.load(),this.queryTask.executeJSON(e,{...i,query:this._createRequestQueryOptions(i)})}async queryObjectIds(e,i){return await this.load(),this.queryTask.executeForIds(e,{...i,query:this._createRequestQueryOptions(i)})}async queryFeatureCount(e,i){return await this.load(),this.queryTask.executeForCount(e,{...i,query:this._createRequestQueryOptions(i)})}async queryExtent(e,i){return await this.load(),this.queryTask.executeForExtent(e,{...i,query:this._createRequestQueryOptions(i)})}async queryRelatedFeatures(e,i){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...i,query:this._createRequestQueryOptions(i)})}async queryRelatedFeaturesCount(e,i){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...i,query:this._createRequestQueryOptions(i)})}async queryTopFeatures(e,i){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...i,query:this._createRequestQueryOptions(i)})}async queryTopObjectIds(e,i){return await this.load(),this.queryTask.executeForTopIds(e,{...i,query:this._createRequestQueryOptions(i)})}async queryTopExtents(e,i){return await this.load(),this.queryTask.executeForTopExtents(e,{...i,query:this._createRequestQueryOptions(i)})}async queryTopCount(e,i){return await this.load(),this.queryTask.executeForTopCount(e,{...i,query:this._createRequestQueryOptions(i)})}async fetchPublishingStatus(){if(!L9(this.layer.url))return"unavailable";const e=yd(this.layer.url,"status"),i=await ur(e,{query:{f:"json"}});return yji.fromJSON(i.data.status)}_createRequestQueryOptions(e){const i={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(i.timeReferenceUnknownClient=!0),i}async _fetchService(e,i){if(!e){const{data:n}=await ur(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:Hi("featurelayer-advanced-symbols")?{returnAdvancedSymbols:!0}:{},signal:i}));e=n}this.sourceJSON=this._patchServiceJSON(e);const r=e.type;if(!gji.has(r))throw new st("feature-layer-source:unsupported-type",`Source type "${r}" is not supported`)}_patchServiceJSON(e){if(e.type!=="Table"&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const i=iG(e.geometryType).renderer;Dp("drawingInfo.renderer",i,e)}return e.geometryType==="esriGeometryMultiPatch"&&e.infoFor3D&&(e.geometryType="mesh"),e}_serializeFeature(e,i){const{geometry:r,attributes:n}=e;if(ve(i)&&ve(e.geometry)&&e.geometry.type==="mesh"){const s={...n},o=e.geometry,a=o.origin,l=o.transform;if(s[i.transformFieldRoles.originX]=a.x,s[i.transformFieldRoles.originY]=a.y,s[i.transformFieldRoles.originZ]=a.z,ve(l)){const c=l.translation,h=l.scale,p=l.rotation;s[i.transformFieldRoles.translationX]=c[0],s[i.transformFieldRoles.translationY]=-c[2],s[i.transformFieldRoles.translationZ]=c[1],s[i.transformFieldRoles.scaleX]=h[0],s[i.transformFieldRoles.scaleY]=h[1],s[i.transformFieldRoles.scaleZ]=h[2],s[i.transformFieldRoles.rotationX]=p[0],s[i.transformFieldRoles.rotationY]=p[2],s[i.transformFieldRoles.rotationZ]=p[1],s[i.transformFieldRoles.rotationDeg]=p[3]}return{geometry:null,attributes:s}}return lt(r)?{attributes:n}:r.type==="mesh"||r.type==="extent"?null:{geometry:r.toJSON(),attributes:n}}async _serializeAttachment(e){const{feature:i,attachment:r}=e,{globalId:n,name:s,contentType:o,data:a,uploadId:l}=r,c={globalId:n,parentGlobalId:null,contentType:null,name:null,uploadId:null,data:null};if(i&&(c.parentGlobalId="attributes"in i?i.attributes&&i.attributes[this.layer.globalIdField]:i.globalId),l)c.uploadId=l;else if(a){const h=await twt(a);h&&(c.contentType=h.mediaType,c.data=h.data),a instanceof File&&(c.name=a.name)}return s&&(c.name=s),o&&(c.contentType=o),c}async _serializeAssetMapEditAndUploadAssets(e,i){const r=this.layer.url;let n=null;try{const h=new Blob([e.data],{type:e.mimeType}),p=new FormData;p.append("f","json"),p.append("file",h,`${e.assetName}`);const y={body:p,method:"post",responseType:"json"},{data:v}=await ur(`${r}/uploads/upload`,y);if(!v.success)throw new st("feature-layer-source:upload-failure","Expected upload to be successfull.");n={assetType:e.assetType,assetUploadId:v.item.itemID}}catch{n=null}if(lt(n)){const h=await twt(new Blob([e.data]));if(!h.isBase64)throw new st("feature-layer-source:uploadAssets-failure","Expected gltf data in base64 format after conversion.");n={assetType:e.assetType,assetData:h.data}}if(lt(n))throw new st("feature-layer-source:uploadAssets-failure","Unable to prepare uploadAsset request options.");const s={method:"post",query:{f:"json",assets:JSON.stringify([n])},responseType:"json"},o=await ur(yd(this.layer.parsedUrl.path,"uploadAssets"),s);if(o.data.uploadResults.length!==1||!o.data.uploadResults[0].success)throw new st("feature-layer-source:uploadAssets-failure","Bad response.");const a=o.data.uploadResults[0].assetHash,l=[];e.flags&Gfe.PROJECT_VERTICES&&l.push("PROJECT_VERTICES");const c={globalId:e.assetMapGlobalId,parentGlobalId:e.featureGlobalId,assetName:e.assetName,assetHash:a,flags:l};return i.set(e.featureGlobalId,e.feature),c}_getFeatureIds(e,i){const r=e?.[0];return r?this._canUseGlobalIds(i,e)?this._getGlobalIdsFromFeatureIdentifier(e):"objectId"in r?this._getObjectIdsFromFeatureIdentifier(e):this._getIdsFromFeatures(e):[]}_getIdsFromFeatures(e){const i=this.layer.objectIdField;return e.map(r=>r.attributes&&r.attributes[i])}_canUseGlobalIds(e,i){return e&&"globalId"in i[0]}_getObjectIdsFromFeatureIdentifier(e){return e.map(i=>i.objectId)}_getGlobalIdsFromFeatureIdentifier(e){return e.map(i=>i.globalId)}_createEditsResult(e){const i=e.data,{layerId:r}=this.layer,n=[];let s=null;if(Array.isArray(i))for(const l of i)n.push({id:l.id,editedFeatures:l.editedFeatures}),l.id===r&&(s={addResults:l.addResults??[],updateResults:l.updateResults??[],deleteResults:l.deleteResults??[],attachments:l.attachments,editMoment:l.editMoment});else s=i;const o=s?.attachments,a={addFeatureResults:s?.addResults?.map(this._createFeatureEditResult,this)??[],updateFeatureResults:s?.updateResults?.map(this._createFeatureEditResult,this)??[],deleteFeatureResults:s?.deleteResults?.map(this._createFeatureEditResult,this)??[],addAttachmentResults:o&&o.addResults?o.addResults.map(this._createFeatureEditResult,this):[],updateAttachmentResults:o&&o.updateResults?o.updateResults.map(this._createFeatureEditResult,this):[],deleteAttachmentResults:o&&o.deleteResults?o.deleteResults.map(this._createFeatureEditResult,this):[]};if(s?.editMoment&&(a.editMoment=s.editMoment),n.length>0){a.editedFeatureResults=[];for(const l of n){const{editedFeatures:c}=l,h=c?.spatialReference?new hr(c.spatialReference):null;a.editedFeatureResults.push({layerId:l.id,editedFeatures:{adds:c?.adds?.map(p=>this._createEditedFeature(p,h))||[],updates:c?.updates?.map(p=>({original:this._createEditedFeature(p[0],h),current:this._createEditedFeature(p[1],h)}))||[],deletes:c?.deletes?.map(p=>this._createEditedFeature(p,h))||[],spatialReference:h}})}}return a}_createEditedFeature(e,i){return new io({attributes:e.attributes,geometry:Sl({...e.geometry,spatialReference:i})})}_createFeatureEditResult(e){const i=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:i?new st("feature-layer-source:edit-failure",i.description,{code:i.code}):null}}_createAttachmentErrorResult(e,i){const r=i.details.messages&&i.details.messages[0]||i.message,n=i.details.httpStatus||i.details.messageCode;return{objectId:e,globalId:null,error:new st("feature-layer-source:attachment-failure",r,{code:n})}}_getFormDataForAttachment(e,i){const r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(const n in i){const s=i[n];s!=null&&(r.set?r.set(n,s):r.append(n,s))}return r}_getLayerRequestOptions(e={}){const{parsedUrl:i,gdbVersion:r,dynamicDataSource:n}=this.layer;return{...e,query:{gdbVersion:r,layer:n?JSON.stringify({source:n}):void 0,...i.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}};E([N()],rU.prototype,"type",void 0),E([N({constructOnly:!0})],rU.prototype,"layer",void 0),E([N({readOnly:!0})],rU.prototype,"queryTask",null),rU=E([dt("esri.layers.graphics.sources.FeatureLayerSource")],rU);const iwt=Object.freeze(Object.defineProperty({__proto__:null,default:rU},Symbol.toStringTag,{value:"Module"}));function rwt(t){return t&&"getAtOrigin"in t&&"originOf"in t}function dZ(t){t&&t.writtenProperties&&t.writtenProperties.forEach(({target:e,propName:i,newOrigin:r})=>{rwt(e)&&r&&e.originOf(i)!==r&&e.updateOrigin(i,r)})}const vji=Oi.getLogger("esri.layers.FeatureLayer"),uLe="Feature Service";function Hfe(t,e){return`Layer (title: ${t.title}, id: ${t.id}) of type '${t.declaredClass}' ${e}`}function nwt(t,e){if(e.type!==uLe)throw new st("feature-layer:portal-item-wrong-type",Hfe(t,`should have portal item of type "${uLe}"`))}async function swt(t){if(await t.load(),cne(t))throw new st("feature-layer:save",Hfe(t,"using an in-memory source cannot be saved to a portal item"))}function _ji(t,e){let i=(t.messages??[]).filter(({type:r})=>r==="error").map(({name:r,message:n,details:s})=>new st(r,n,s));if(e?.ignoreUnsupported&&(i=i.filter(({name:r})=>r!=="layer:unsupported"&&r!=="symbol:unsupported"&&r!=="symbol-layer:unsupported"&&r!=="property:unsupported"&&r!=="url:unsupported")),i.length>0)throw new st("feature-layer:save","Failed to save feature layer due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:i})}async function owt(t,e,i){"beforeSave"in t&&typeof t.beforeSave=="function"&&await t.beforeSave();const r=t.write({},e);return _ji(e,i),r}function awt(t){const{layer:e,layerJSON:i}=t;return e.isTable?{layers:[],tables:[i]}:{layers:[i],tables:[]}}function lwt(t){ZSe(t,lB.JSAPI),t.typeKeywords&&(t.typeKeywords=t.typeKeywords.filter((e,i,r)=>r.indexOf(e)===i))}function bji(t){const e=t.portalItem;if(!e)throw vji.error("save: requires the portalItem property to be set"),new st("feature-layer:portal-item-not-set",Hfe(t,"requires the portalItem property to be set"));if(!e.loaded)throw new st("feature-layer:portal-item-not-loaded",Hfe(t,"cannot be saved to a portal item that does not exist or is inaccessible"));nwt(t,e)}async function wji(t,e){return/\/\d+\/?$/.test(t.url??"")?awt(e[0]):xji(t,e)}async function xji(t,e){const{layer:{url:i,customParameters:r,apiKey:n}}=e[0];let s=await t.fetchData("json");s&&s.layers!=null&&s.tables!=null||(s=await Sji(s,{url:i??"",customParameters:r,apiKey:n},e.map(o=>o.layer.layerId)));for(const o of e)cwt(o.layer,o.layerJSON,s);return s}async function Sji(t,e,i){var r,n;t||(t={}),(r=t).layers||(r.layers=[]),(n=t).tables||(n.tables=[]);const{url:s,customParameters:o,apiKey:a}=e,{serviceJSON:l,layersJSON:c}=await bRe(s,{customParameters:o,apiKey:a}),h=uwt(t.layers,l.layers,i),p=uwt(t.tables,l.tables,i);t.layers=h.itemResources,t.tables=p.itemResources;const y=[...h.added,...p.added],v=c?[...c.layers,...c.tables]:[];return await Cji(t,y,s,v),t}function uwt(t,e,i){const r=BNt(t,e,(s,o)=>s.id===o.id);t=t.filter(s=>!r.removed.some(o=>o.id===s.id));const n=r.added.map(({id:s})=>({id:s}));return n.forEach(({id:s})=>{t.push({id:s})}),{itemResources:t,added:n.filter(({id:s})=>!i.includes(s))}}async function Cji(t,e,i,r){const n=e.map(({id:s})=>new Xc({url:i,layerId:s,sourceJSON:r.find(({id:o})=>o===s)}));await Ru(n.map(s=>s.load())),n.forEach(s=>{const{layerId:o,loaded:a,defaultPopupTemplate:l}=s;!a||lt(l)||cwt(s,{id:o,popupInfo:l.toJSON()},t)})}function cwt(t,e,i){t.isTable?hwt(i.tables,e):hwt(i.layers,e)}function hwt(t,e){if(!t)return;const i=t.findIndex(({id:r})=>r===e.id);i===-1?t.push(e):t[i]=e}function Tji(t,e){var i,r;let n=Q0.from(e);return n.id&&(n=n.clone(),n.id=null),(i=n).type??(i.type=uLe),(r=n).portal??(r.portal=Cc.getDefault()),nwt(t,n),n}async function Eji(t,e){const{url:i,layerId:r,title:n,fullExtent:s,isTable:o}=t,a=XC(i),l=ve(a)&&a.serverType==="FeatureServer";e.url=l?i:`${i}/${r}`,e.title||(e.title=n),e.extent=null,!o&&ve(s)&&(e.extent=await Dqt(s)),rXe(e,lB.METADATA),rXe(e,lB.MULTI_LAYER),ZSe(e,lB.SINGLE_LAYER),o&&ZSe(e,lB.TABLE),lwt(e)}async function Iji(t,e,i){const r=t.portal;await r?.signIn(),await r?.user?.addItem({item:t,data:e,folder:i?.folder})}const Aji=q0(Pji);async function Pji(t,e){await swt(t),bji(t);const i=t.portalItem,r=Mpt(i),n=await owt(t,r,e),s=await wji(i,[{layer:t,layerJSON:n}]);return lwt(i),await i.update({data:s}),dZ(r),i}const Oji=q0(Rji);async function Rji(t,e,i){await swt(t);const r=Tji(t,e),n=Mpt(r),s=awt({layer:t,layerJSON:await owt(t,n,i)});return await Eji(t,r),await Iji(r,s,i),t.portalItem=r,dZ(n),r}const dwt=Object.freeze(Object.defineProperty({__proto__:null,save:Aji,saveAs:Oji},Symbol.toStringTag,{value:"Module"})),pZ=Object.freeze(Object.defineProperty({__proto__:null,buffer:bgt,changeDefaultSpatialReferenceTolerance:Ngt,clearDefaultSpatialReferenceTolerance:kgt,clip:egt,contains:igt,convexHull:fgt,crosses:rgt,cut:tgt,densify:Pgt,difference:mgt,disjoint:ugt,distance:ngt,equals:sgt,extendedSpatialReferenceInfo:Qmt,flipHorizontal:Egt,flipVertical:Igt,generalize:Agt,geodesicArea:Dgt,geodesicBuffer:wgt,geodesicDensify:Ogt,geodesicLength:Fgt,intersect:ygt,intersectLinesToPoints:Lgt,intersects:ogt,isSimple:dgt,nearestCoordinate:xgt,nearestVertex:Sgt,nearestVertices:Cgt,offset:_gt,overlaps:cgt,planarArea:Rgt,planarLength:Mgt,relate:hgt,rotate:Tgt,simplify:pgt,symmetricDifference:ggt,touches:agt,union:vgt,within:lgt},Symbol.toStringTag,{value:"Module"}));let cLe=pwt();function pwt(){return new lae(50)}function Mji(){cLe=pwt()}function Dji(t,e){if(t.type==="icon")return hLe(t,e);if(t.type==="object")return dLe(t,e);throw new st("symbol3d:unsupported-symbol-layer","computeLayerSize only works with symbol layers of type Icon and Object")}async function Fji(t,e){if(t.type==="icon")return Lji(t,e);if(t.type==="object")return kji(t,e);throw new st("symbol3d:unsupported-symbol-layer","computeLayerSize only works with symbol layers of type Icon and Object")}async function hLe(t,e){if(t.resource?.href)return Nji(t.resource.href).then(i=>[i.width,i.height]);if(t.resource?.primitive)return ve(e)?[e,e]:[256,256];throw new st("symbol3d:invalid-symbol-layer","symbol layers of type Icon must have either an href or a primitive resource")}function Lji(t,e){return hLe(t,e).then(i=>{if(t.size==null)return i;const r=i[0]/i[1];return r>1?[t.size,t.size/r]:[t.size*r,t.size]})}function Nji(t){return ur(t,{responseType:"image"}).then(e=>e.data)}function dLe(t,e){return $ji(t,e).then(i=>kVt(i))}async function kji(t,e){const i=await dLe(t,e);return UVt(i,t)}async function $ji(t,e){if(!t.isPrimitive){const r=Ou(t.resource?.href),n=cLe.get(r);if(n!==void 0)return n;const s=await Promise.resolve().then(()=>mPr),o=await s.fetch(r,{disableTextures:!0});return cLe.put(r,o.referenceBoundingBox),o.referenceBoundingBox}let i=null;if(t.resource&&t.resource.primitive&&(i=iw(qVt(t.resource.primitive)),ve(e)))for(let r=0;rr[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var fwt,fZ,mwt,Wfe={};fwt={get exports(){return Wfe},set exports(t){Wfe=t}},fZ=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(fZ=fZ||__filename),mwt=function(t){var e,i;(t=(t=t||{})!==void 0?t:{}).ready=new Promise(function(A,ye){e=A,i=ye});var r,n,s,o,a,l,c=Object.assign({},t),h=typeof window=="object",p=typeof importScripts=="function",y=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",v="";function x(A){return t.locateFile?t.locateFile(A,v):v+A}y?(v=p?require("path").dirname(v)+"/":__dirname+"/",l=()=>{a||(o=require("fs"),a=require("path"))},r=function(A,ye){return l(),A=a.normalize(A),o.readFileSync(A,ye?void 0:"utf8")},s=A=>{var ye=r(A,!0);return ye.buffer||(ye=new Uint8Array(ye)),ye},n=(A,ye,H)=>{l(),A=a.normalize(A),o.readFile(A,function(T,b){T?H(T):ye(b.buffer)})},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(A){if(!(A instanceof $e))throw A}),process.on("unhandledRejection",function(A){throw A}),t.inspect=function(){return"[Emscripten Module object]"}):(h||p)&&(p?v=self.location.href:typeof document<"u"&&document.currentScript&&(v=document.currentScript.src),fZ&&(v=fZ),v=v.indexOf("blob:")!==0?v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1):"",r=A=>{var ye=new XMLHttpRequest;return ye.open("GET",A,!1),ye.send(null),ye.responseText},p&&(s=A=>{var ye=new XMLHttpRequest;return ye.open("GET",A,!1),ye.responseType="arraybuffer",ye.send(null),new Uint8Array(ye.response)}),n=(A,ye,H)=>{var T=new XMLHttpRequest;T.open("GET",A,!0),T.responseType="arraybuffer",T.onload=()=>{T.status==200||T.status==0&&T.response?ye(T.response):H()},T.onerror=H,T.send(null)}),t.print||console.log.bind(console);var I,P,F=t.printErr||console.warn.bind(console);Object.assign(t,c),c=null,t.arguments&&t.arguments,t.thisProgram&&t.thisProgram,t.quit&&t.quit,t.wasmBinary&&(I=t.wasmBinary),t.noExitRuntime,typeof WebAssembly!="object"&&mt("no native wasm support detected");var k,j,V,Y,X,Z,ie=!1,ce=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function he(A,ye,H){for(var T=ye+H,b=ye;A[b]&&!(b>=T);)++b;if(b-ye>16&&A.buffer&&ce)return ce.decode(A.subarray(ye,b));for(var m="";ye>10,56320|1023&L)}}else m+=String.fromCharCode((31&_)<<6|C)}else m+=String.fromCharCode(_)}return m}function _e(A,ye){return A?he(V,A,ye):""}function xe(A){k=A,t.HEAP8=j=new Int8Array(A),t.HEAP16=new Int16Array(A),t.HEAP32=Y=new Int32Array(A),t.HEAPU8=V=new Uint8Array(A),t.HEAPU16=new Uint16Array(A),t.HEAPU32=X=new Uint32Array(A),t.HEAPF32=new Float32Array(A),t.HEAPF64=new Float64Array(A)}t.INITIAL_MEMORY;var Pe=[],ke=[],J=[];function de(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)Re(t.preRun.shift());je(Pe)}function Se(){je(ke)}function Ie(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)Ge(t.postRun.shift());je(J)}function Re(A){Pe.unshift(A)}function Oe(A){ke.unshift(A)}function Ge(A){J.unshift(A)}var Be=0,qe=null;function et(A){Be++,t.monitorRunDependencies&&t.monitorRunDependencies(Be)}function Ze(A){if(Be--,t.monitorRunDependencies&&t.monitorRunDependencies(Be),Be==0&&qe){var ye=qe;qe=null,ye()}}function mt(A){t.onAbort&&t.onAbort(A),F(A="Aborted("+A+")"),ie=!0,A+=". Build with -sASSERTIONS for more info.";var ye=new WebAssembly.RuntimeError(A);throw i(ye),ye}var Pt,$t="data:application/octet-stream;base64,";function Ct(A){return A.startsWith($t)}function Et(A){return A.startsWith("file://")}function Ft(A){try{if(A==Pt&&I)return new Uint8Array(I);if(s)return s(A);throw"both async and sync fetching of the wasm failed"}catch(ye){mt(ye)}}function ot(){if(!I&&(h||p)){if(typeof fetch=="function"&&!Et(Pt))return fetch(Pt,{credentials:"same-origin"}).then(function(A){if(!A.ok)throw"failed to load wasm binary file at '"+Pt+"'";return A.arrayBuffer()}).catch(function(){return Ft(Pt)});if(n)return new Promise(function(A,ye){n(Pt,function(H){A(new Uint8Array(H))},ye)})}return Promise.resolve().then(function(){return Ft(Pt)})}function Te(){var A={a:ze};function ye(m,_){var C=m.exports;t.asm=C,xe((P=t.asm.g).buffer),Z=t.asm.m,Oe(t.asm.h),Ze()}function H(m){ye(m.instance)}function T(m){return ot().then(function(_){return WebAssembly.instantiate(_,A)}).then(function(_){return _}).then(m,function(_){F("failed to asynchronously prepare wasm: "+_),mt(_)})}function b(){return I||typeof WebAssembly.instantiateStreaming!="function"||Ct(Pt)||Et(Pt)||y||typeof fetch!="function"?T(H):fetch(Pt,{credentials:"same-origin"}).then(function(m){return WebAssembly.instantiateStreaming(m,A).then(H,function(_){return F("wasm streaming compile failed: "+_),F("falling back to ArrayBuffer instantiation"),T(H)})})}if(et(),t.instantiateWasm)try{return t.instantiateWasm(A,ye)}catch(m){return F("Module.instantiateWasm callback failed with error: "+m),!1}return b().catch(i),{}}function je(A){for(;A.length>0;){var ye=A.shift();if(typeof ye!="function"){var H=ye.func;typeof H=="number"?ye.arg===void 0?kt(H)():kt(H)(ye.arg):H(ye.arg===void 0?null:ye.arg)}else ye(t)}}Ct(Pt="lerc-wasm.wasm")||(Pt=x(Pt));var pt=[];function kt(A){var ye=pt[A];return ye||(A>=pt.length&&(pt.length=A+1),pt[A]=ye=Z.get(A)),ye}function ct(A,ye,H,T){mt("Assertion failed: "+_e(A)+", at: "+[ye?_e(ye):"unknown filename",H,T?_e(T):"unknown function"])}function ae(A){return Ot(A+24)+24}function ht(A){this.excPtr=A,this.ptr=A-24,this.set_type=function(ye){X[this.ptr+4>>2]=ye},this.get_type=function(){return X[this.ptr+4>>2]},this.set_destructor=function(ye){X[this.ptr+8>>2]=ye},this.get_destructor=function(){return X[this.ptr+8>>2]},this.set_refcount=function(ye){Y[this.ptr>>2]=ye},this.set_caught=function(ye){ye=ye?1:0,j[this.ptr+12>>0]=ye},this.get_caught=function(){return j[this.ptr+12>>0]!=0},this.set_rethrown=function(ye){ye=ye?1:0,j[this.ptr+13>>0]=ye},this.get_rethrown=function(){return j[this.ptr+13>>0]!=0},this.init=function(ye,H){this.set_adjusted_ptr(0),this.set_type(ye),this.set_destructor(H),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var ye=Y[this.ptr>>2];Y[this.ptr>>2]=ye+1},this.release_ref=function(){var ye=Y[this.ptr>>2];return Y[this.ptr>>2]=ye-1,ye===1},this.set_adjusted_ptr=function(ye){X[this.ptr+16>>2]=ye},this.get_adjusted_ptr=function(){return X[this.ptr+16>>2]},this.get_exception_ptr=function(){if(nt(this.get_type()))return X[this.excPtr>>2];var ye=this.get_adjusted_ptr();return ye!==0?ye:this.excPtr}}function wt(A,ye,H){throw new ht(A).init(ye,H),A}function Ne(){mt("")}function pe(A,ye,H){V.copyWithin(A,ye,ye+H)}function Ae(){return 2147483648}function tt(A){try{return P.grow(A-k.byteLength+65535>>>16),xe(P.buffer),1}catch{}}function gt(A){var ye=V.length;A>>>=0;var H=Ae();if(A>H)return!1;let T=(_,C)=>_+(C-_%C)%C;for(var b=1;b<=4;b*=2){var m=ye*(1+.2/b);if(m=Math.min(m,A+100663296),tt(Math.min(H,T(Math.max(A,m),65536))))return!0}return!1}var ze={a:ct,c:ae,b:wt,d:Ne,f:pe,e:gt};Te(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.h).apply(null,arguments)},t._lerc_getBlobInfo=function(){return(t._lerc_getBlobInfo=t.asm.i).apply(null,arguments)},t._lerc_getDataRanges=function(){return(t._lerc_getDataRanges=t.asm.j).apply(null,arguments)},t._lerc_decode=function(){return(t._lerc_decode=t.asm.k).apply(null,arguments)},t._lerc_decode_4D=function(){return(t._lerc_decode_4D=t.asm.l).apply(null,arguments)};var Ot=t._malloc=function(){return(Ot=t._malloc=t.asm.n).apply(null,arguments)};t._free=function(){return(t._free=t.asm.o).apply(null,arguments)};var jt,nt=t.___cxa_is_pointer_type=function(){return(nt=t.___cxa_is_pointer_type=t.asm.p).apply(null,arguments)};function $e(A){this.name="ExitStatus",this.message="Program terminated with exit("+A+")",this.status=A}function Xt(A){function ye(){jt||(jt=!0,t.calledRun=!0,ie||(Se(),e(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),Ie()))}Be>0||(de(),Be>0||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),ye()},1)):ye()))}if(qe=function A(){jt||Xt(),jt||(qe=A)},t.run=Xt,t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return Xt(),t.ready},fwt.exports=mwt;const jji=Vji({__proto__:null,default:Wfe},[Wfe]),Gji=Object.freeze(Object.defineProperty({__proto__:null,l:jji},Symbol.toStringTag,{value:"Module"}));var nU;const pLe=new WeakMap;let Uji=0,SE=nU=class extends Ui{constructor(t){super(t),this.wrap="repeat"}get url(){return this._get("url")||null}set url(t){this._set("url",t),t&&this._set("data",null)}get data(){return this._get("data")||null}set data(t){this._set("data",t),t&&this._set("url",null)}writeData(t,e,i,r){if(t instanceof HTMLImageElement){const n={type:"image-element",src:o2(t.src,r),crossOrigin:t.crossOrigin};e[i]=n}else if(t instanceof HTMLCanvasElement){const n=t.getContext("2d").getImageData(0,0,t.width,t.height),s={type:"canvas-element",imageData:this._encodeImageData(n)};e[i]=s}else if(t instanceof HTMLVideoElement){const n={type:"video-element",src:o2(t.src,r),autoplay:t.autoplay,loop:t.loop,muted:t.muted,crossOrigin:t.crossOrigin,preload:t.preload};e[i]=n}else if(t instanceof ImageData){const n={type:"image-data",imageData:this._encodeImageData(t)};e[i]=n}}readData(t){switch(t.type){case"image-element":{const e=new Image;return e.src=t.src,e.crossOrigin=t.crossOrigin,e}case"canvas-element":{const e=this._decodeImageData(t.imageData),i=document.createElement("canvas");return i.width=e.width,i.height=e.height,i.getContext("2d").putImageData(e,0,0),i}case"image-data":return this._decodeImageData(t.imageData);case"video-element":{const e=document.createElement("video");return e.src=t.src,e.crossOrigin=t.crossOrigin,e.autoplay=t.autoplay,e.loop=t.loop,e.muted=t.muted,e.preload=t.preload,e}default:return}}get transparent(){const t=this.data,e=this.url;if(t instanceof HTMLCanvasElement)return this._imageDataContainsTransparent(t.getContext("2d").getImageData(0,0,t.width,t.height));if(t instanceof ImageData)return this._imageDataContainsTransparent(t);if(e){const i=e.substr(e.length-4,4).toLowerCase(),r=e.substr(0,15).toLocaleLowerCase();if(i===".png"||r==="data:image/png;")return!0}return!1}set transparent(t){this._overrideIfSome("transparent",t)}get contentHash(){const t=typeof this.wrap=="string"?this.wrap:typeof this.wrap=="object"?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",e=(i="")=>`d:${i},t:${this.transparent},w:${t}`;return this.url!=null?e(this.url):this.data!=null?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?e(this.data.src):(pLe.has(this.data)||pLe.set(this.data,++Uji),e(pLe.get(this.data))):e()}clone(){const t={url:this.url,data:this.data,wrap:this._cloneWrap()};return new nU(t)}cloneWithDeduplication(t){const e=t.get(this);if(e)return e;const i=this.clone();return t.set(this,i),i}_cloneWrap(){return typeof this.wrap=="string"?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}_encodeImageData(t){let e="";for(let i=0;iv-c),y=new Uint32Array(qG(h,p,3));i.push({position:h,faces:y}),r+=h.length,n+=y.length}const s=Yji(i,r,n),o=Array.isArray(s.position)?ODe(s.position,3,{originalIndices:s.faces}):ODe(s.position.buffer,6,{originalIndices:s.faces});return s.position=new Float64Array(o.buffer),s.faces=o.indices,s}function Yji(t,e,i){if(t.length===1)return t[0];const r=vwt(e),n=new Uint32Array(i);let s=0,o=0,a=0;for(const l of t){for(let c=0;c=0;v--){const x=t[v],I=i===Xfe.CCW_IS_HOLE&&Kji(x);if(I&&r!==1)n[a++]=x;else{let P=x.length;for(let k=0;k0&&(o[c++]={index:y,count:x.length}),y=I?Yfe(x,x.length-1,-1,p,y,x.length,e):Yfe(x,0,1,p,y,x.length,e);for(let k=0;k0&&(o[c++]={index:y,count:j.length}),y=Yfe(j,0,1,p,y,j.length,e)}a=0,F.count>0&&(s[l++]=F)}}for(let v=0;v0&&(o[c++]={index:y,count:x.length}),y=Yfe(x,0,1,p,y,x.length,e)}return s.length=l,o.length=c,{position:p,polygons:s,outlines:o}}function Yfe(t,e,i,r,n,s,o){n*=3;for(let a=0;ag4t),i),n=await _wt(e,i),s=r(new er({x:0,y:0,z:0,spatialReference:t.spatialReference}),n.url,{resolveFile:sGi(n),useTransform:!0,signal:ve(i)?i.signal:null});s.then(()=>n.dispose(),()=>n.dispose());const{vertexAttributes:o,components:a}=await s;t.vertexAttributes=o,t.components=a}function sGi(t){const e=jH(t.url);return i=>{const r=Qre(i,e,e),n=r?r.replace(/^ *\.\//,""):null;return(n?t.files.get(n):null)??i}}async function _wt(t,e){return t instanceof Blob?Kfe.fromBlob(t):typeof t=="string"?new Kfe(t):Array.isArray(t)?oGi(t,e):aGi(t,e)}async function oGi(t,e){const i=new Map;let r=null;const n=await AH(t.map(async o=>({name:o.name,source:await _wt(o instanceof Blob?o:o.source,e)}))),s=[];for(const o of n)o&&(Im(e)?o.source.dispose():s.push(o));yn(e);for(const{name:o,source:a}of s)(lt(r)||/\.(gltf|glb)/i.test(o))&&(r=a.url),i.set(o,a.url),a.files&&a.files.forEach((l,c)=>i.set(c,l));if(lt(r))throw new st("mesh-load-external:missing-files","Missing files to load external mesh source");return new Kfe(r,()=>s.forEach(({source:o})=>o.dispose()),i)}async function aGi(t,e){const{default:i}=await zg(Promise.resolve().then(()=>S1e),e),r=typeof t.multipart[0]=="string"?await Promise.all(t.multipart.map(async n=>(await i(n,{responseType:"array-buffer"})).data)):t.multipart;return Kfe.fromBlob(new Blob(r))}let Kfe=class z5t{constructor(e,i=()=>{},r=new Map){this.url=e,this.dispose=i,this.files=r}static fromBlob(e){const i=URL.createObjectURL(e);return new z5t(i,()=>URL.revokeObjectURL(i))}};function lGi(t,e,i){t.vertexAttributes&&t.vertexAttributes.position&&(ve(t.transform)?(i?.geographic!=null&&i.geographic!==t.transform.geographic&&Oi.getLogger("esri.geometry.support.meshUtils.offset").warn(`Specifying the 'geographic' parameter (${i.geographic}) different from the Mesh transform setting (${t.transform.geographic}) is not supported`),uGi(t.transform,e)):Gk(t.spatialReference,i)?cGi(t,e):hGi(t,e))}function uGi(t,e){const i=t.origin;t.origin=Wc(hn(),i,e)}function cGi(t,e){const i=t.spatialReference,r=t.vertexAttributes.position,n=t.vertexAttributes.normal,s=t.vertexAttributes.tangent,o=new Float64Array(r.length),a=ve(n)?new Float32Array(n.length):null,l=ve(s)?new Float32Array(s.length):null,c=t.extent.center,h=dGi;rB(i,[c.x,c.y,c.z],wwt,kD(i)),aX(xwt,wwt),PC(h,e,xwt),xpe(r,i,o),ve(n)&&ve(a)&&bpe(n,r,o,i,a),ve(s)&&ve(l)&&Cpe(s,r,o,i,l),bwt(o,h),Spe(o,r,i),ve(n)&&ve(a)&&wpe(a,r,o,i,n),ve(s)&&ve(l)&&Tpe(l,r,o,i,s),t.vertexAttributesChanged()}function hGi(t,e){bwt(t.vertexAttributes.position,e),t.vertexAttributesChanged()}function bwt(t,e){if(t)for(let i=0;i=s&&h=5-1,P=v===2||v===4,F=x?i-1:i;for(let k=0;k<=F;k++){const j=k/F*2*Math.PI,V=x?0:.5;cm[0]=V*Math.sin(j),cm[1]=V*-Math.cos(j),cm[2]=v<=2?.5:-.5;for(let Y=0;Y<3;Y++)n[l++]=cm[Y],s[c++]=I?Y===2?v<=1?1:-1:0:Y===2?0:cm[Y]/V;o[h++]=(k+(x?.5:0))/i,o[h++]=v<=1?1*v/3:v<=3?1*(v-2)/3+.3333333333333333:1*(v-4)/3+.6666666666666666,P||v===0||k===i||(v!==5&&(a[p++]=y,a[p++]=y+1,a[p++]=y-i),v!==1&&(a[p++]=y,a[p++]=y-i,a[p++]=y-i-1)),y++}}return{position:n,normal:s,uv:o,faces:a}}function yGi(t,e){const i=typeof e=="number"?e:e!=null?e.width:1,r=typeof e=="number"?e:e!=null?e.height:1;switch(t){case"up":case"down":return{width:i,depth:r};case"north":case"south":return{width:i,height:r};case"east":case"west":return{depth:i,height:r}}}function vGi(t){const e=yZ.facingAxisOrderSwap[t],i=yZ.position,r=yZ.normal,n=new Float64Array(i.length),s=new Float32Array(r.length);let o=0;for(let a=0;a<4;a++){const l=o;for(let c=0;c<3;c++){const h=e[c],p=Math.abs(h)-1,y=h>=0?1:-1;n[o]=i[l+p]*y,s[o]=r[l+p]*y,o++}}return{position:n,normal:s,uv:new Float32Array(yZ.uv),faces:new Uint32Array(yZ.faces),isPlane:!0}}const lU=1,uU=2,cU=3,yZ={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:[cU,lU,uU],west:[-cU,-lU,uU],north:[-lU,cU,uU],south:[lU,-cU,uU],up:[lU,uU,cU],down:[lU,-uU,-cU]}};function Jfe(t,e,i){t.isPlane||_Gi(t),bGi(t,i?.size);const{vertexAttributes:r,transform:n}=v0t(t,e,i);return{vertexAttributes:new vy({...r,uv:t.uv}),transform:n,components:[new f6({faces:t.faces,material:i&&i.material||null})],spatialReference:e.spatialReference}}function _Gi(t){for(let e=0;e{this.handles.add(sr(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(t=>t.clone())}),()=>this._set("external",null),{once:!0,sync:!0}))})}get hasExtent(){return!this.loaded&&ve(this.external)&&ve(this.external.extent)||this.loaded&&this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0)}get _boundingInfo(){const t=this.vertexAttributes.position,e=this.spatialReference;if(t.length===0||this.components&&this.components.length===0)return{extent:new Ar({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:e}),center:new er({x:0,y:0,z:0,spatialReference:e})};const i=ve(this.transform)?this.transform.project(t,e):t;let r=1/0,n=1/0,s=1/0,o=-1/0,a=-1/0,l=-1/0,c=0,h=0,p=0;const y=i.length,v=1/(y/3);let x=0;for(;xn.cloneWithDeduplication(i,r))}const e={components:t,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),transform:ve(this.transform)?this.transform.clone():null,external:ve(this.external)?{source:this.external.source,extent:ve(this.external.extent)?this.external.extent.clone():null}:null};return new bS(e)}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(t){const e=Promise.resolve().then(()=>HPr),i=this.load(),r=await Promise.all([e,i]),{toBinaryGLTF:n}=r[0];return n(this,t)}static createBox(t,e){if(!(t instanceof er))return Oi.getLogger(m6).error(".createBox()","expected location to be a Point instance"),null;const i=new bS(Jfe(pGi(),t,e));return e&&e.imageFace&&e.imageFace!=="all"?fGi(i,e.imageFace):i}static createSphere(t,e){return t instanceof er?new bS(Jfe(mGi(e&&e.densificationFactor||0),t,e)):(Oi.getLogger(m6).error(".createSphere()","expected location to be a Point instance"),null)}static createCylinder(t,e){return t instanceof er?new bS(Jfe(gGi(e&&e.densificationFactor||0),t,e)):(Oi.getLogger(m6).error(".createCylinder()","expected location to be a Point instance"),null)}static createPlane(t,e){if(!(t instanceof er))return Oi.getLogger(m6).error(".createPlane()","expected location to be a Point instance"),null;const i=e?.facing??"up",r=yGi(i,e?.size);return new bS(Jfe(vGi(i),t,{...e,size:r}))}static createFromPolygon(t,e){if(!(t instanceof To))return Oi.getLogger(m6).error(".createFromPolygon()","expected polygon to be a Polygon instance"),null;const i=qji(t);return new bS({vertexAttributes:new vy({position:i.position}),components:[new f6({faces:i.faces,shading:"flat",material:e?.material??null})],spatialReference:t.spatialReference})}static async createFromGLTF(t,e,i){if(!(t instanceof er))throw Oi.getLogger(m6).error(".createfromGLTF()","expected location to be a Point instance"),new st("invalid-input","Expected location to be a Point instance");const{loadGLTFMesh:r}=await zg(Promise.resolve().then(()=>g4t),i);return new bS(await r(t,e,i))}static createWithExternalSource(t,e,i){const r=i?.extent??null,n=i?.transform?.clone()??new uG;n.origin=[t.x,t.y,t.z??0];const s=t.spatialReference;return new bS({external:{source:e,extent:r},transform:n,spatialReference:s})}static createIncomplete(t,e){const i=e?.transform?.clone()??new uG;i.origin=[t.x,t.y,t.z??0];const r=t.spatialReference,n=new bS({transform:i,spatialReference:r});return n.addResolvingPromise(Promise.reject(new st("mesh-incomplete","Mesh resources are not complete"))),n}};E([N({type:[f6],json:{write:!0}})],z_.prototype,"components",void 0),E([N({type:uG,json:{write:!0}})],z_.prototype,"transform",void 0),E([N({constructOnly:!0})],z_.prototype,"external",void 0),E([N({readOnly:!0})],z_.prototype,"hasExtent",null),E([N({readOnly:!0})],z_.prototype,"_boundingInfo",null),E([N({readOnly:!0})],z_.prototype,"anchor",null),E([N({readOnly:!0})],z_.prototype,"origin",null),E([N({readOnly:!0,json:{read:!1}})],z_.prototype,"extent",null),E([N({readOnly:!0,json:{read:!1,write:!0,default:!0}})],z_.prototype,"hasZ",void 0),E([N({readOnly:!0,json:{read:!1,write:!0,default:!1}})],z_.prototype,"hasM",void 0),E([N({type:vy,nonNullable:!0,json:{write:!0}})],z_.prototype,"vertexAttributes",void 0),z_=bS=E([dt(m6)],z_);const bLe={x:ja(1,0,0),y:ja(0,1,0),z:ja(0,0,1)},fU=pE(),Mwt=pE(),Dwt=pE(),Qfe=hn(),Fwt=z_;function RGi(t,e,i){const r=i.features;i.features=[],delete i.geometryType;const n=tc.fromJSON(i);if(n.geometryType="mesh",!i.assetMaps)return n;const s=NGi(e,i.assetMaps),o=n.spatialReference??hr.WGS84,a=i.globalIdFieldName,{outFields:l}=t,c=ve(l)&&l.length>0?MGi(l.includes("*")?null:new Set(l)):()=>({});for(const h of r){const p=DGi(h,a,o,e,s);ve(p)&&n.features.push(new io({geometry:p,attributes:c(h)}))}return n}function MGi(t){return({attributes:e})=>{if(!e)return{};if(!t)return e;for(const i in e)t.has(i)||delete e[i];return e}}function DGi(t,e,i,r,n){const s=t.attributes[e],o=n.get(s);if(o==null||o.status===uF.FAILED||o.url==null)return null;const a=FGi(t,i,r),l=Ar.fromJSON(t.geometry);l.spatialReference=i;const c=LGi(t.attributes,r,o.projectVertices);return o.status===uF.PENDING?Fwt.createIncomplete(a,{extent:l,transform:c}):Fwt.createWithExternalSource(a,[{name:o.name,source:o.url}],{extent:l,transform:c})}function FGi({attributes:t},e,{transformFieldRoles:i}){return new er({x:t[i.originX],y:t[i.originY],z:t[i.originZ],spatialReference:e})}function LGi(t,{transformFieldRoles:e},i){return new uG({translation:[t[e.translationX],-t[e.translationZ],t[e.translationY]],rotation:dpe([t[e.rotationX],t[e.rotationZ],t[e.rotationY]],t[e.rotationDeg]),scale:[t[e.scaleX],t[e.scaleY],t[e.scaleZ]],geographic:i})}var uF;function NGi(t,e){const i=new Map;for(const r of e){const n=r.parentGlobalId;if(n==null)continue;const s=r.assetName,o=r.assetURL,a=r.conversionStatus;let l=i.get(n);if(l==null)switch(l={name:s,status:uF.FAILED,url:o,projectVertices:kGi(r.flags).projectVertices},i.set(n,l),a){case"COMPLETED":case"SUBMITTED":l.status=uF.COMPLETED;break;case"INPROGRESS":l.status=uF.PENDING;break;default:l.status=uF.FAILED}else console.warn(`Multiple asset parts not expected. Ignoring additional parts. conflicting assetname: ${r.assetName}`)}return i}function kGi(t){return{projectVertices:t.includes("PROJECT_VERTICES")}}(function(t){t[t.FAILED=0]="FAILED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"})(uF||(uF={}));const $Gi=Object.freeze(Object.defineProperty({__proto__:null,meshFeatureSetFromJSON:RGi},Symbol.toStringTag,{value:"Module"})),wLe=Oi.getLogger("esri.layers.support.ElevationSampler");let Lwt=class{queryElevation(e){return VGi(e.clone(),this)}on(){return zGi}projectIfRequired(e,i){return kwt(e,i)}},BGi=class extends Lwt{get spatialReference(){return this.extent.spatialReference}constructor(e,i,r){super(),this.tile=e,this.noDataValue=r;const n=e.tile.extent;this.extent=BL(n,i.spatialReference),this.extent.zmin=e.zmin,this.extent.zmax=e.zmax,this._aaExtent=n;const s=Hc(i.spatialReference),o=i.lodAt(e.tile.level).resolution*s;this.demResolution={min:o,max:o}}contains(e){const i=this.projectIfRequired(e,this.spatialReference);return!lt(i)&&this.containsAt(i.x,i.y)}containsAt(e,i){return y7e(this._aaExtent,e,i)}elevationAt(e,i){if(!this.containsAt(e,i)){const r=this.extent,n=`${r.xmin}, ${r.ymin}, ${r.xmax}, ${r.ymax}`;return wLe.warn("#elevationAt()",`Point used to sample elevation (${e}, ${i}) is outside of the sampler extent (${n})`),this.noDataValue}return zu(this.tile.sample(e,i),this.noDataValue)}},Nwt=class extends Lwt{get spatialReference(){return this.extent.spatialReference}constructor(e,i,r){let n;super(),typeof i=="number"?(this.noDataValue=i,n=null):(n=i,this.noDataValue=r),this.samplers=n?e.map(o=>new BGi(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;li?i:t}let WGi=class{async queryAll(e,i,r){if(!(e=r&&r.ignoreInvisibleLayers?e.filter(c=>c.visible):e.slice()).length)throw new st("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");const n=vZ.fromGeometry(i);let s=!1;r&&r.returnSampleInfo||(s=!0);const o={...eme,...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,i,r){if(!e)throw new st("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!i||!(i instanceof vZ)&&i.type!=="point"&&i.type!=="multipoint"&&i.type!=="polyline")throw new st("elevation-query:invalid-geometry","Only point, polyline and multipoint geometries can be used to query elevation");const n={...eme,...r},s=new qGi(e,i.spatialReference,n),o=n.signal;return await e.load({signal:o}),await this._createGeometryDescriptor(s,i,o),await this._selectTiles(s,o),await this._populateElevationTiles(s,o),this._sampleGeometryWithElevation(s),this._createQueryResult(s,o)}async createSampler(e,i,r){if(!e)throw new st("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!i||i.type!=="extent")throw new st("elevation-query:invalid-extent","Invalid or undefined extent");const n={...eme,...r};return this._createSampler(e,i,n)}async createSamplerAll(e,i,r){if(!(e=r&&r.ignoreInvisibleLayers?e.filter(o=>o.visible):e.slice()).length)throw new st("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");if(!i||i.type!=="extent")throw new st("elevation-query:invalid-extent","Invalid or undefined extent");const n={...eme,...r,returnSampleInfo:!0},s=await this._createSampler(e[e.length-1],i,n);return this._createSamplerAllContinue(e,i,s,n)}async _createSampler(e,i,r,n){const s=r.signal;await e.load({signal:s});const o=i.spatialReference,a=e.tileInfo.spatialReference;o.equals(a)||(await YR([{source:o,dest:a}],{signal:s}),i=cp(i,a));const l=new YGi(e,i,r,n);return await this._selectTiles(l,s),await this._populateElevationTiles(l,s),new Nwt(l.elevationTiles,l.layer.tileInfo,l.options.noDataValue)}async _createSamplerAllContinue(e,i,r,n){if(e.pop(),!e.length)return r;const s=r.samplers.map(c=>fR(c.extent)),o=await this._createSampler(e[e.length-1],i,n,s);if(o.samplers.length===0)return r;const a=r.samplers.concat(o.samplers),l=new Nwt(a,n.noDataValue);return this._createSamplerAllContinue(e,i,l,n)}async _queryAllContinue(e,i,r){const n=e.pop(),s=i.geometry.coordinates,o=i.sampleInfo;sg(o);const a=[],l=[];for(let y=0;y=0?v.source||(v.source=n):e.length&&(a.push(s[y]),l.push(y))}if(!e.length||a.length===0)return i;const c=i.geometry.clone(a),h=await this.query(e[e.length-1],c,r),p=h.sampleInfo;if(!p)throw new Error("no sampleInfo");return l.forEach((y,v)=>{s[y].z=h.geometry.coordinates[v].z,o[y].demResolution=p[v].demResolution}),this._queryAllContinue(e,i,r)}async _createQueryResult(e,i){const r=await e.geometry.project(e.outSpatialReference,i);sg(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,i,r){let n;const s=e.layer.tileInfo.spatialReference;if(i instanceof vZ?n=await i.project(s,r):(await YR([{source:i.spatialReference,dest:s}],{signal:r}),n=cp(i,s)),!n)throw new st("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${i.spatialReference.wkid}' on an elevation service in '${s.wkid}'`);e.geometry=vZ.fromGeometry(n)}async _selectTiles(e,i){const r=e.options.demResolution;if(e.type==="geometry"&&this._preselectOutsideLayerExtent(e),typeof r=="number")this._selectTilesClosestResolution(e);else if(r==="finest-contiguous")await this._selectTilesFinestContiguous(e,i);else{if(r!=="auto")throw new st("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${r}', expected a number, "finest-contiguous" or "auto"`);await this._selectTilesAuto(e,i)}}_preselectOutsideLayerExtent(e){if(lt(e.layer.fullExtent))return;const i=new $wt(null);i.sample=()=>e.options.noDataValue,e.outsideExtentTile=i;const r=e.layer.fullExtent;e.geometry.coordinates.forEach(n=>{const s=n.x,o=n.y;(sr.xmax||or.ymax)&&(n.elevationTile=i)})}_selectTilesClosestResolution(e){const i=e.layer.tileInfo,r=this._findNearestDemResolutionLODIndex(i,e.options.demResolution);e.selectTilesAtLOD(r)}_findNearestDemResolutionLODIndex(e,i){const r=i/Hc(e.spatialReference);let n=e.lods[0],s=0;for(let o=1;os.fetchAvailability(a.level,a.row,a.col,{signal:r}))),r);else if(await this._populateElevationTiles(e,r),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new st("elevation-query:has-unavailable-tiles")}catch(a){Ya(a),await this._selectTilesFinestContiguousAt(e,i-1,r)}}async _populateElevationTiles(e,i){const r=e.getTilesToFetch(),n={},s=e.options.cache,o=e.options.noDataValue,a=r.map(async l=>{if(l.id==null)return;const c=`${e.layer.uid}:${l.id}:${o}`,h=ve(s)?s.get(c):null,p=ve(h)?h:await e.layer.fetchTile(l.level,l.row,l.col,{noDataValue:o,signal:i});ve(s)&&s.put(c,p),n[l.id]=new $wt(l,p)});await zg(Ru(a),i),e.populateElevationTiles(n)}async _selectTilesAuto(e,i){this._selectTilesAutoFinest(e),this._reduceTilesForMaximumRequests(e);const r=e.layer.tilemapCache;if(!r)return this._selectTilesAutoPrefetchUpsample(e,i);const n=e.getTilesToFetch(),s={},o=n.map(async a=>{const l=new FB(null,0,0,0,Mo()),c=await SC(r.fetchAvailabilityUpsample(a.level,a.row,a.col,l,{signal:i}));c.ok!==!1?a.id!=null&&(s[a.id]=l):Ya(c.error)});await zg(Promise.all(o),i),e.remapTiles(s)}_reduceTilesForMaximumRequests(e){const i=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 c=n[l.id];c===1?(delete n[l.id],r--):n[l.id]=c-1};e.forEachTileToFetch(s,o);let a=!0;for(;a&&(a=!1,e.forEachTileToFetch(l=>{r<=e.options.maximumAutoTileRequests||(o(l),i.upsampleTile(l)&&(a=!0),s(l))},o),a););}_selectTilesAutoFinest(e){const i=xLe(e.layer.tileInfo,e.options.minDemResolution);e.selectTilesAtLOD(i,e.options.maximumAutoTileRequests)}async _selectTilesAutoPrefetchUpsample(e,i){const r=e.layer.tileInfo;await this._populateElevationTiles(e,i);let n=!1;e.forEachTileToFetch((s,o)=>{r.upsampleTile(s)?n=!0:o()}),n&&await this._selectTilesAutoPrefetchUpsample(e,i)}_sampleGeometryWithElevation(e){e.geometry.coordinates.forEach(i=>{const r=i.elevationTile;let n=e.options.noDataValue;if(r){const s=r.sample(i.x,i.y);ve(s)?n=s:i.elevationTile=null}i.z=n})}_extractSampleInfo(e){const i=e.layer.tileInfo,r=Hc(i.spatialReference);return e.geometry.coordinates.map(n=>{let s=-1;return n.elevationTile&&n.elevationTile!==e.outsideExtentTile&&(s=i.lodAt(n.elevationTile.tile.level).resolution*r),{demResolution:s}})}},vZ=class c_e{export(){return this._exporter(this.coordinates,this.spatialReference)}clone(e){const i=new c_e;return i.geometry=this.geometry,i.spatialReference=this.spatialReference,i.coordinates=e||this.coordinates.map(r=>r.clone()),i._exporter=this._exporter,i}async project(e,i){if(this.spatialReference.equals(e))return this.clone();await YR([{source:this.spatialReference,dest:e}],{signal:i});const r=new _d({spatialReference:this.spatialReference,points:this.coordinates.map(a=>[a.x,a.y])}),n=cp(r,e);if(!n)return null;const s=this.coordinates.map((a,l)=>{const c=a.clone(),h=n.points[l];return c.x=h[0],c.y=h[1],c}),o=this.clone(s);return o.spatialReference=e,o}static fromGeometry(e){const i=new c_e;if(i.geometry=e,i.spatialReference=e.spatialReference,e instanceof c_e)i.coordinates=e.coordinates.map(r=>r.clone()),i._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;i.coordinates=n&&s?[new ax(r.x,r.y,r.z,r.m)]:n?[new ax(r.x,r.y,r.z)]:s?[new ax(r.x,r.y,null,r.m)]:[new ax(r.x,r.y)],i._exporter=(o,a)=>e.hasM?new er(o[0].x,o[0].y,o[0].z,o[0].m,a):new er(o[0].x,o[0].y,o[0].z,a);break}case"multipoint":{const r=e,{hasZ:n,hasM:s}=r;i.coordinates=n&&s?r.points.map(o=>new ax(o[0],o[1],o[2],o[3])):n?r.points.map(o=>new ax(o[0],o[1],o[2])):s?r.points.map(o=>new ax(o[0],o[1],null,o[2])):r.points.map(o=>new ax(o[0],o[1])),i._exporter=(o,a)=>e.hasM?new _d({points:o.map(l=>[l.x,l.y,l.z,l.m]),hasZ:!0,hasM:!0,spatiaReference:a}):new _d(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 c of r.paths)if(s.push([l,l+c.length]),l+=c.length,o&&a)for(const h of c)n.push(new ax(h[0],h[1],h[2],h[3]));else if(o)for(const h of c)n.push(new ax(h[0],h[1],h[2]));else if(a)for(const h of c)n.push(new ax(h[0],h[1],null,h[2]));else for(const h of c)n.push(new ax(h[0],h[1]));i.coordinates=n,i._exporter=(c,h)=>{const p=e.hasM?c.map(v=>[v.x,v.y,v.z,v.m]):c.map(v=>[v.x,v.y,v.z]),y=s.map(v=>p.slice(v[0],v[1]));return new Oa({paths:y,hasM:e.hasM,hasZ:!0,spatialReference:h})};break}}return i}},ax=class H5t{constructor(e,i,r=null,n=null,s=null,o=null){this.x=e,this.y=i,this.z=r,this.m=n,this.tile=s,this.elevationTile=o}clone(){return new H5t(this.x,this.y,this.z,this.m)}},Vwt=class{constructor(e,i){this.layer=e,this.options=i}},qGi=class extends Vwt{constructor(e,i,r){super(e,r),this.outSpatialReference=i,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(i=>{i.tile=null});else{const i=this.layer.tileInfo,r=i.lods[e].level;this.geometry.coordinates.forEach(n=>{n.tile=i.tileAt(r,n.x,n.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 i of this.geometry.coordinates)!i.elevationTile&&i.tile?.id&&(i.elevationTile=e[i.tile.id])}remapTiles(e){for(const i of this.geometry.coordinates){const r=i.tile?.id;i.tile=r?e[r]:null}}getTilesToFetch(){const e={},i=[];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,i.push(n))}return i}forEachTileToFetch(e){for(const i of this.geometry.coordinates)i.tile&&!i.elevationTile&&e(i.tile,()=>{i.tile=null})}},YGi=class extends Vwt{constructor(e,i,r,n){super(e,r),this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=i.intersection(e.fullExtent),this.maskExtents=n}selectTilesAtLOD(e,i){const r=this._maximumLodForRequests(i),n=Math.min(r,e);n<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(n)}_maximumLodForRequests(e){const i=this.layer.tileInfo;if(!e)return i.lods.length-1;const r=this.extent;if(lt(r))return-1;for(let n=i.lods.length-1;n>=0;n--){const s=i.lods[n],o=s.resolution*i.size[0],a=s.resolution*i.size[1];if(Math.ceil(r.width/o)*Math.ceil(r.height/a)<=e)return n}return-1}allElevationTilesFetched(){return this._candidateTiles.length===this.elevationTiles.length}clearElevationTiles(){this.elevationTiles.length=0,this._fetchedCandidates.clear()}populateElevationTiles(e){for(const i of this._candidateTiles){const r=i.id&&e[i.id];r&&(this._fetchedCandidates.add(i),this.elevationTiles.push(r))}}remapTiles(e){this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles.map(i=>e[i.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,i){const r=this._candidateTiles;this._candidateTiles=[],r.forEach(n=>{if(this._fetchedCandidates.has(n))return void(i&&i(n));let s=!1;e(n,()=>s=!0),s?i&&i(n):this._candidateTiles.push(n)}),this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles,i)}_uniqueNonOverlappingTiles(e,i){const r={},n=[];for(const o of e){const a=o.id;a&&!r[a]?(r[a]=o,n.push(o)):i&&i(o)}const s=n.sort((o,a)=>o.level-a.level);return s.filter((o,a)=>{for(let l=0;le.extent&&nwe(i,e.extent))}};function xLe(t,e=0){let i=t.lods.length-1;if(e>0){const r=e/Hc(t.spatialReference),n=t.lods.findIndex(s=>s.resolution0&&(i=n-1)}return i}const eme={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0},tme=Object.freeze(Object.defineProperty({__proto__:null,ElevationQuery:WGi,GeometryDescriptor:vZ,getFinestLodIndex:xLe},Symbol.toStringTag,{value:"Module"}));/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */function aF(t,e,i){const r=HVi(t);return new r(e,i)}function HVi(t){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 t==="intersection"?window.IntersectionObserver:t==="mutation"?e:window.ResizeObserver}()}/*! + */function cF(t,e,i){const r=XGi(t);return new r(e,i)}function XGi(t){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 t==="intersection"?window.IntersectionObserver:t==="mutation"?e:window.ResizeObserver}()}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const WVi={icon:"icon",flipRtl:"flip-rtl"},tLe={},iLe={},ewt={s:16,m:24,l:32};async function qVi({icon:t,scale:e}){const i=ewt[e],r=YVi(t),n=r.charAt(r.length-1)==="F",o=`${n?r.substring(0,r.length-1):r}${i}${n?"F":""}`;if(tLe[o])return tLe[o];iLe[o]||(iLe[o]=fetch($Qe(`./assets/icon/${o}.json`)).then(l=>l.json()).catch(()=>(console.error(`"${o}" is not a valid calcite-ui-icon name`),"")));const a=await iLe[o];return tLe[o]=a,a}function YVi(t){const e=!isNaN(Number(t.charAt(0))),i=t.split("-");if(i.length>0){const n=/[a-z]/i;t=i.map((s,o)=>s.replace(n,function(l,c){return o===0&&c===0?l:l.toUpperCase()})).join("")}return e?`i${t}`:t}const XVi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{display:inline-flex;color:var(--calcite-ui-icon-color)}:host([scale=s]){block-size:1rem;inline-size:1rem;min-inline-size:1rem;min-block-size:1rem}:host([scale=m]){block-size:1.5rem;inline-size:1.5rem;min-inline-size:1.5rem;min-block-size:1.5rem}:host([scale=l]){block-size:2rem;inline-size:2rem;min-inline-size:2rem;min-block-size:2rem}.flip-rtl{transform:scaleX(-1)}.svg{display:block}",twt=h0(class extends d0{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:t,flipRtl:e,pathData:i,scale:r,textLabel:n}=this,s=FY(t),o=ewt[r],a=!!n,l=[].concat(i||"");return dr(YA,{"aria-hidden":yw(!a),"aria-label":a?n:null,role:a?"img":null},dr("svg",{"aria-hidden":"true",class:{[WVi.flipRtl]:s==="rtl"&&e,svg:!0},fill:"currentColor",height:"100%",viewBox:`0 0 ${o} ${o}`,width:"100%",xmlns:"http://www.w3.org/2000/svg"},l.map(c=>typeof c=="string"?dr("path",{d:c}):dr("path",{d:c.d,opacity:"opacity"in c?c.opacity:1}))))}async loadIconPathData(){const{icon:t,scale:e,visible:i}=this;!t||!i||(this.pathData=await qVi({icon:t,scale:e}))}waitUntilVisible(t){if(this.intersectionObserver=aF("intersection",e=>{e.forEach(i=>{i.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,t())})},{rootMargin:"50px"}),!this.intersectionObserver){t();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 XVi}},[1,"calcite-icon",{icon:[513],flipRtl:[516,"flip-rtl"],scale:[513],textLabel:[1,"text-label"],pathData:[32],visible:[32]}]);function ox(){if(typeof customElements>"u")return;["calcite-icon"].forEach(e=>{switch(e){case"calcite-icon":customElements.get(e)||customElements.define(e,twt);break}})}ox();/*! + */const KGi={icon:"icon",flipRtl:"flip-rtl"},SLe={},CLe={},jwt={s:16,m:24,l:32};async function JGi({icon:t,scale:e}){const i=jwt[e],r=ZGi(t),n=r.charAt(r.length-1)==="F",o=`${n?r.substring(0,r.length-1):r}${i}${n?"F":""}`;if(SLe[o])return SLe[o];CLe[o]||(CLe[o]=fetch(GQe(`./assets/icon/${o}.json`)).then(l=>l.json()).catch(()=>(console.error(`"${o}" is not a valid calcite-ui-icon name`),"")));const a=await CLe[o];return SLe[o]=a,a}function ZGi(t){const e=!isNaN(Number(t.charAt(0))),i=t.split("-");if(i.length>0){const n=/[a-z]/i;t=i.map((s,o)=>s.replace(n,function(l,c){return o===0&&c===0?l:l.toUpperCase()})).join("")}return e?`i${t}`:t}const QGi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{display:inline-flex;color:var(--calcite-ui-icon-color)}:host([scale=s]){block-size:1rem;inline-size:1rem;min-inline-size:1rem;min-block-size:1rem}:host([scale=m]){block-size:1.5rem;inline-size:1.5rem;min-inline-size:1.5rem;min-block-size:1.5rem}:host([scale=l]){block-size:2rem;inline-size:2rem;min-inline-size:2rem;min-block-size:2rem}.flip-rtl{transform:scaleX(-1)}.svg{display:block}",Gwt=d0(class extends p0{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:t,flipRtl:e,pathData:i,scale:r,textLabel:n}=this,s=FY(t),o=jwt[r],a=!!n,l=[].concat(i||"");return br(qA,{"aria-hidden":bw(!a),"aria-label":a?n:null,role:a?"img":null},br("svg",{"aria-hidden":"true",class:{[KGi.flipRtl]:s==="rtl"&&e,svg:!0},fill:"currentColor",height:"100%",viewBox:`0 0 ${o} ${o}`,width:"100%",xmlns:"http://www.w3.org/2000/svg"},l.map(c=>typeof c=="string"?br("path",{d:c}):br("path",{d:c.d,opacity:"opacity"in c?c.opacity:1}))))}async loadIconPathData(){const{icon:t,scale:e,visible:i}=this;!t||!i||(this.pathData=await JGi({icon:t,scale:e}))}waitUntilVisible(t){if(this.intersectionObserver=cF("intersection",e=>{e.forEach(i=>{i.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,t())})},{rootMargin:"50px"}),!this.intersectionObserver){t();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 QGi}},[1,"calcite-icon",{icon:[513],flipRtl:[516,"flip-rtl"],scale:[513],textLabel:[1,"text-label"],pathData:[32],visible:[32]}]);function lx(){if(typeof customElements>"u")return;["calcite-icon"].forEach(e=>{switch(e){case"calcite-icon":customElements.get(e)||customElements.define(e,Gwt);break}})}lx();/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const rLe=Object.freeze(Object.defineProperty({__proto__:null,CalciteIcon:twt,defineCustomElement:ox},Symbol.toStringTag,{value:"Module"}));function yl(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}function KVi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var iwt,rwt,fZ={},JVi={get exports(){return fZ},set exports(t){fZ=t}};iwt=JVi,(rwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"م",_era_bc:"ق.م",A:"ص",P:"م",AM:"ص",PM:"م","A.M.":"ص","P.M.":"م",January:"يناير",February:"فبراير",March:"مارس",April:"أبريل",May:"مايو",June:"يونيو",July:"يوليو",August:"أغسطس",September:"سبتمبر",October:"أكتوبر",November:"نوفمبر",December:"ديسمبر",Jan:"يناير",Feb:"فبراير",Mar:"مارس",Apr:"أبريل","May(short)":"مايو",Jun:"يونيو",Jul:"يوليو",Aug:"أغسطس",Sep:"سبتمبر",Oct:"أكتوبر",Nov:"نوفمبر",Dec:"ديسمبر",Sunday:"الأحد",Monday:"الاثنين",Tuesday:"الثلاثاء",Wednesday:"الأربعاء",Thursday:"الخميس",Friday:"الجمعة",Saturday:"السبت",Sun:"الأحد",Mon:"الاثنين",Tue:"الثلاثاء",Wed:"الأربعاء",Thu:"الخميس",Fri:"الجمعة",Sat:"السبت",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"تغيير مقياس الرسم",Play:"تشغيل",Stop:"إيقاف تشغيل",Legend:"وسيلة الإيضاح","Click, tap or press ENTER to toggle":"",Loading:"تحميل",Home:"الصفحة الرئيسية",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"طباعة",Image:"صورة",Data:"بيانات",Print:"طباعة","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"من %1 إلى %2","From %1":"من %1","To %1":"إلى %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,fZ))!==void 0&&(iwt.exports=rwt);const ZVi=KVi({__proto__:null,default:qa(fZ)},[fZ]),QVi=Object.freeze(Object.defineProperty({__proto__:null,a:ZVi},Symbol.toStringTag,{value:"Module"}));function eUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var nwt,swt,mZ={},tUi={get exports(){return mZ},set exports(t){mZ=t}};nwt=tUi,(swt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_percentPrefix:null,_percentSuffix:"%","Zoom Out":"Отдалечаване","From %1 to %2":"От %1 до %2","From %1":"От %1","To %1":"До %1"}}(yl,mZ))!==void 0&&(nwt.exports=swt);const iUi=eUi({__proto__:null,default:qa(mZ)},[mZ]),rUi=Object.freeze(Object.defineProperty({__proto__:null,b:iUi},Symbol.toStringTag,{value:"Module"}));function nUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var owt,awt,gZ={},sUi={get exports(){return gZ},set exports(t){gZ=t}};owt=sUi,(awt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n. e.",_era_bc:"p. n. e.",A:"prijepodne",P:"popodne",AM:"AM",PM:"PM","A.M.":"prijepodne","P.M.":"popodne",January:"januar",February:"februar",March:"mart",April:"april",May:"maj",June:"juni",July:"juli",August:"august",September:"septembar",October:"oktobar",November:"novembar",December:"decembar",Jan:"jan",Feb:"feb",Mar:"mar",Apr:"apr","May(short)":"maj",Jun:"jun",Jul:"jul",Aug:"aug",Sep:"sep",Oct:"okt",Nov:"nov",Dec:"dec",Sunday:"nedjelja",Monday:"ponedjeljak",Tuesday:"utorak",Wednesday:"srijeda",Thursday:"četvrtak",Friday:"petak",Saturday:"subota",Sun:"ned",Mon:"pon",Tue:"uto",Wed:"sri",Thu:"čet",Fri:"pet",Sat:"sub",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Povećaj",Play:"Reproduciraj",Stop:"Zaustavi",Legend:"Legenda","Click, tap or press ENTER to toggle":"",Loading:"Učitavanje",Home:"Početna",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Ispis",Image:"Slika",Data:"Podaci",Print:"Ispis","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,gZ))!==void 0&&(owt.exports=awt);const oUi=nUi({__proto__:null,default:qa(gZ)},[gZ]),aUi=Object.freeze(Object.defineProperty({__proto__:null,b:oUi},Symbol.toStringTag,{value:"Module"}));function lUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var lwt,uwt,yZ={},uUi={get exports(){return yZ},set exports(t){yZ=t}};lwt=uUi,(uwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"dC",_era_bc:"aC",A:"a. m.",P:"p. m.",AM:"a. m.",PM:"p. m.","A.M.":"a. m.","P.M.":"p. m.",January:"de gener",February:"de febrer",March:"de març",April:"d’abril",May:"de maig",June:"de juny",July:"de juliol",August:"d’agost",September:"de setembre",October:"d’octubre",November:"de novembre",December:"de desembre",Jan:"de gen.",Feb:"de febr.",Mar:"de març",Apr:"d’abr.","May(short)":"de maig",Jun:"de juny",Jul:"de jul.",Aug:"d’ag.",Sep:"de set.",Oct:"d’oct.",Nov:"de nov.",Dec:"de des.",Sunday:"diumenge",Monday:"dilluns",Tuesday:"dimarts",Wednesday:"dimecres",Thursday:"dijous",Friday:"divendres",Saturday:"dissabte",Sun:"dg.",Mon:"dl.",Tue:"dt.",Wed:"dc.",Thu:"dj.",Fri:"dv.",Sat:"ds.",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Zoom",Play:"Reprodueix",Stop:"Parada",Legend:"Llegenda","Click, tap or press ENTER to toggle":"",Loading:"S'està carregant",Home:"Inici",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Imprimeix",Image:"Imatge",Data:"Dades",Print:"Imprimeix","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"De %1 a %2","From %1":"De %1","To %1":"A %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,yZ))!==void 0&&(lwt.exports=uwt);const cUi=lUi({__proto__:null,default:qa(yZ)},[yZ]),hUi=Object.freeze(Object.defineProperty({__proto__:null,c:cUi},Symbol.toStringTag,{value:"Module"}));function dUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var cwt,hwt,vZ={},pUi={get exports(){return vZ},set exports(t){vZ=t}};cwt=pUi,(hwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n. l.",_era_bc:"př. n. l.",A:"dop.",P:"odp.",AM:"dop.",PM:"odp.","A.M.":"dop.","P.M.":"odp.",January:"ledna",February:"února",March:"března",April:"dubna",May:"května",June:"června",July:"července",August:"srpna",September:"září",October:"října",November:"listopadu",December:"prosince",Jan:"led",Feb:"úno",Mar:"bře",Apr:"dub","May(short)":"kvě",Jun:"čvn",Jul:"čvc",Aug:"srp",Sep:"zář",Oct:"říj",Nov:"lis",Dec:"pro",Sunday:"neděle",Monday:"pondělí",Tuesday:"úterý",Wednesday:"středa",Thursday:"čtvrtek",Friday:"pátek",Saturday:"sobota",Sun:"ne",Mon:"po",Tue:"út",Wed:"st",Thu:"čt",Fri:"pá",Sat:"so",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Zvětšení",Play:"Přehrát",Stop:"Ukončit iteraci (Stop)",Legend:"Legenda","Click, tap or press ENTER to toggle":"",Loading:"Načítání",Home:"Domů",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Tisk",Image:"Snímek",Data:"Data",Print:"Tisk","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,vZ))!==void 0&&(cwt.exports=hwt);const fUi=dUi({__proto__:null,default:qa(vZ)},[vZ]),mUi=Object.freeze(Object.defineProperty({__proto__:null,c:fUi},Symbol.toStringTag,{value:"Module"}));function gUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var dwt,pwt,_Z={},yUi={get exports(){return _Z},set exports(t){_Z=t}};dwt=yUi,(pwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"e.Kr.",_era_bc:"f.Kr.",A:"a",P:"p",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"januar",February:"februar",March:"marts",April:"april",May:"maj",June:"juni",July:"juli",August:"august",September:"september",October:"oktober",November:"november",December:"december",Jan:"jan.",Feb:"feb.",Mar:"mar.",Apr:"apr.","May(short)":"maj",Jun:"jun.",Jul:"jul.",Aug:"aug.",Sep:"sep.",Oct:"okt.",Nov:"nov.",Dec:"dec.",Sunday:"søndag",Monday:"mandag",Tuesday:"tirsdag",Wednesday:"onsdag",Thursday:"torsdag",Friday:"fredag",Saturday:"lørdag",Sun:"søn.",Mon:"man.",Tue:"tir.",Wed:"ons.",Thu:"tor.",Fri:"fre.",Sat:"lør.",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Zoom",Play:"Afspil",Stop:"Stop",Legend:"Signaturforklaring","Click, tap or press ENTER to toggle":"",Loading:"Indlæser",Home:"Hjem",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Udskriv",Image:"Billede",Data:"Data",Print:"Udskriv","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Fra %1 til %2","From %1":"Fra %1","To %1":"Til %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,_Z))!==void 0&&(dwt.exports=pwt);const vUi=gUi({__proto__:null,default:qa(_Z)},[_Z]),_Ui=Object.freeze(Object.defineProperty({__proto__:null,d:vUi},Symbol.toStringTag,{value:"Module"}));function bUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var fwt,mwt,bZ={},wUi={get exports(){return bZ},set exports(t){bZ=t}};fwt=wUi,(mwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"K",_big_number_suffix_6:"Mio",_big_number_suffix_9:"Mrd",_big_number_suffix_12:"Bio",_big_number_suffix_15:"Brd",_big_number_suffix_18:"Trill",_big_number_suffix_21:"Trd",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"dd. MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"v. Chr.",_era_bc:"n. Chr.",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Januar",February:"Februar",March:"März",April:"April",May:"Mai",June:"Juni",July:"Juli",August:"August",September:"September",October:"Oktober",November:"November",December:"Dezember",Jan:"Jan.",Feb:"Febr.",Mar:"März",Apr:"Apr.","May(short)":"Mai",Jun:"Juni",Jul:"Juli",Aug:"Aug.",Sep:"Sept.",Oct:"Okt.",Nov:"Nov.",Dec:"Dez.",Sunday:"Sonntag",Monday:"Montag",Tuesday:"Dienstag",Wednesday:"Mittwoch",Thursday:"Donnerstag",Friday:"Freitag",Saturday:"Samstag",Sun:"So.",Mon:"Mo.",Tue:"Di.",Wed:"Mi.",Thu:"Do.",Fri:"Fr.",Sat:"Sa.",_dateOrd:function(i){return i+"."},"Zoom Out":"Herauszoomen",Play:"Abspielen",Stop:"Stop",Legend:"Legende","Click, tap or press ENTER to toggle":"Klicken, tippen oder ENTER drücken zum Umschalten",Loading:"Wird geladen",Home:"Home",Chart:"Diagramm","Serial chart":"Seriendiagramm","X/Y chart":"X-Y-Diagramm","Pie chart":"Kreisdiagramm","Gauge chart":"Messdiagramm","Radar chart":"Netzdiagramm","Sankey diagram":"Sankey-Diagramm","Chord diagram":"","Flow diagram":"Flussdiagramm","TreeMap chart":"Baumdiagramm",Series:"Serie","Candlestick Series":"Kerzendiagramm","Column Series":"Balkendiagramm","Line Series":"Liniendiagramm","Pie Slice Series":"Kreisdiagramm","X/Y Series":"Punktdiagramm",Map:"Karte","Press ENTER to zoom in":"Drücke ENTER zum Hereinzoomen","Press ENTER to zoom out":"Drücke ENTER zum Herauszoomen","Use arrow keys to zoom in and out":"Benutze die Pfeiltasten zum Zoomen","Use plus and minus keys on your keyboard to zoom in and out":"Benutze Plus- und Minustasten zum Zoomen",Export:"Export",Image:"Bild",Data:"Daten",Print:"Drucken","Click, tap or press ENTER to open":"Zum Öffnen klicken, tippen oder ENTER drücken","Click, tap or press ENTER to print.":"Zum Drucken klicken, tippen oder ENTER drücken.","Click, tap or press ENTER to export as %1.":"Klicken, tippen oder ENTER drücken um als %1 zu exportieren",'To save the image, right-click this link and choose "Save picture as..."':'Um das Bild zu speichern, Rechtsklicken und "Bild speichern unter ..." auswählen','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Um das Bild zu speichern, Rechtsklick auf das Vorschaubild links und "Bild speichern unter ..." auswählen',"(Press ESC to close this message)":"ESC drücken um diese Nachricht zu schließen","Image Export Complete":"Bildexport komplett","Export operation took longer than expected. Something might have gone wrong.":"Der Export dauert länger als geplant. Vielleicht ist etwas schiefgelaufen.","Saved from":"Gespeichert von",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"TAB nutzen, um Ankerpunkte auszuwählen oder linke und rechte Pfeiltaste um die Auswahl zu ändern","Use left and right arrows to move selection":"Linke und rechte Pfeiltaste nutzen um die Auswahl zu verschieben","Use left and right arrows to move left selection":"Linke und rechte Pfeiltaste nutzen um die linke Auswahl zu verschieben","Use left and right arrows to move right selection":"Linke und rechte Pfeiltaste nutzen um die rechte Auswahl zu verschieben","Use TAB select grip buttons or up and down arrows to change selection":"TAB nutzen, um Ankerpunkte auszuwählen oder Pfeiltaste nach oben und unten drücken, um die Auswahl zu ändern","Use up and down arrows to move selection":"Pfeiltaste nach oben und unten drücken, um die Auswahl zu verschieben","Use up and down arrows to move lower selection":"Pfeiltaste nach oben und unten drücken, um die untere Auswahl zu verschieben","Use up and down arrows to move upper selection":"Pfeiltaste nach oben und unten drücken, um die obere Auswahl zu verschieben","From %1 to %2":"Von %1 bis %2","From %1":"Von %1","To %1":"Bis %1","No parser available for file: %1":"Kein Parser für Datei %1 verfügbar","Error parsing file: %1":"Fehler beim Parsen von Datei %1","Unable to load file: %1":"Datei %1 konnte nicht geladen werden","Invalid date":"Kein Datum"}}(yl,bZ))!==void 0&&(fwt.exports=mwt);const xUi=bUi({__proto__:null,default:qa(bZ)},[bZ]),SUi=Object.freeze(Object.defineProperty({__proto__:null,d:xUi},Symbol.toStringTag,{value:"Module"}));function CUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var gwt,ywt,wZ={},TUi={get exports(){return wZ},set exports(t){wZ=t}};gwt=TUi,(ywt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:"'",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"K",_big_number_suffix_6:"Mio",_big_number_suffix_9:"Mrd",_big_number_suffix_12:"Bio",_big_number_suffix_15:"Brd",_big_number_suffix_18:"Trill",_big_number_suffix_21:"Trd",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"dd. MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"v. Chr.",_era_bc:"n. Chr.",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Januar",February:"Februar",March:"März",April:"April",May:"Mai",June:"Juni",July:"Juli",August:"August",September:"September",October:"Oktober",November:"November",December:"Dezember",Jan:"Jan.",Feb:"Febr.",Mar:"März",Apr:"Apr.","May(short)":"Mai",Jun:"Juni",Jul:"Juli",Aug:"Aug.",Sep:"Sept.",Oct:"Okt.",Nov:"Nov.",Dec:"Dez.",Sunday:"Sonntag",Monday:"Montag",Tuesday:"Dienstag",Wednesday:"Mittwoch",Thursday:"Donnerstag",Friday:"Freitag",Saturday:"Samstag",Sun:"So.",Mon:"Mo.",Tue:"Di.",Wed:"Mi.",Thu:"Do.",Fri:"Fr.",Sat:"Sa.",_dateOrd:function(i){return i+"."},"Zoom Out":"Herauszoomen",Play:"Abspielen",Stop:"Stop",Legend:"Legende","Click, tap or press ENTER to toggle":"Klicken, tippen oder ENTER drücken zum Umschalten",Loading:"Wird geladen",Home:"Home",Chart:"Diagramm","Serial chart":"Seriendiagramm","X/Y chart":"X-Y-Diagramm","Pie chart":"Kreisdiagramm","Gauge chart":"Messdiagramm","Radar chart":"Netzdiagramm","Sankey diagram":"Sankey-Diagramm","Chord diagram":"","Flow diagram":"Flussdiagramm","TreeMap chart":"Baumdiagramm",Series:"Serie","Candlestick Series":"Kerzendiagramm","Column Series":"Balkendiagramm","Line Series":"Liniendiagramm","Pie Slice Series":"Kreisdiagramm","X/Y Series":"Punktdiagramm",Map:"Karte","Press ENTER to zoom in":"Drücke ENTER zum Hereinzoomen","Press ENTER to zoom out":"Drücke ENTER zum Herauszoomen","Use arrow keys to zoom in and out":"Benutze die Pfeiltasten zum Zoomen","Use plus and minus keys on your keyboard to zoom in and out":"Benutze Plus- und Minustasten zum Zoomen",Export:"Export",Image:"Bild",Data:"Daten",Print:"Drucken","Click, tap or press ENTER to open":"Zum Öffnen klicken, tippen oder ENTER drücken","Click, tap or press ENTER to print.":"Zum Drucken klicken, tippen oder ENTER drücken.","Click, tap or press ENTER to export as %1.":"Klicken, tippen oder ENTER drücken um als %1 zu exportieren",'To save the image, right-click this link and choose "Save picture as..."':'Um das Bild zu speichern, Rechtsklicken und "Bild speichern unter ..." auswählen','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Um das Bild zu speichern, Rechtsklick auf das Vorschaubild links und "Bild speichern unter ..." auswählen',"(Press ESC to close this message)":"ESC drücken um diese Nachricht zu schließen","Image Export Complete":"Bildexport komplett","Export operation took longer than expected. Something might have gone wrong.":"Der Export dauert länger als geplant. Vielleicht ist etwas schiefgelaufen.","Saved from":"Gespeichert von",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"TAB nutzen, um Ankerpunkte auszuwählen oder linke und rechte Pfeiltaste um die Auswahl zu ändern","Use left and right arrows to move selection":"Linke und rechte Pfeiltaste nutzen um die Auswahl zu verschieben","Use left and right arrows to move left selection":"Linke und rechte Pfeiltaste nutzen um die linke Auswahl zu verschieben","Use left and right arrows to move right selection":"Linke und rechte Pfeiltaste nutzen um die rechte Auswahl zu verschieben","Use TAB select grip buttons or up and down arrows to change selection":"TAB nutzen, um Ankerpunkte auszuwählen oder Pfeiltaste nach oben und unten drücken, um die Auswahl zu ändern","Use up and down arrows to move selection":"Pfeiltaste nach oben und unten drücken, um die Auswahl zu verschieben","Use up and down arrows to move lower selection":"Pfeiltaste nach oben und unten drücken, um die untere Auswahl zu verschieben","Use up and down arrows to move upper selection":"Pfeiltaste nach oben und unten drücken, um die obere Auswahl zu verschieben","From %1 to %2":"Von %1 bis %2","From %1":"Von %1","To %1":"Bis %1","No parser available for file: %1":"Kein Parser für Datei %1 verfügbar","Error parsing file: %1":"Fehler beim Parsen von Datei %1","Unable to load file: %1":"Datei %1 konnte nicht geladen werden","Invalid date":"Kein Datum"}}(yl,wZ))!==void 0&&(gwt.exports=ywt);const EUi=CUi({__proto__:null,default:qa(wZ)},[wZ]),IUi=Object.freeze(Object.defineProperty({__proto__:null,d:EUi},Symbol.toStringTag,{value:"Module"}));function AUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var vwt,_wt,xZ={},PUi={get exports(){return xZ},set exports(t){xZ=t}};vwt=PUi,(_wt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"μ.Χ.",_era_bc:"π.Χ.",A:"πμ",P:"μμ",AM:"π.μ.",PM:"μ.μ.","A.M.":"π.μ.","P.M.":"μ.μ.",January:"Ιανουαρίου",February:"Φεβρουαρίου",March:"Μαρτίου",April:"Απριλίου",May:"Μαΐου",June:"Ιουνίου",July:"Ιουλίου",August:"Αυγούστου",September:"Σεπτεμβρίου",October:"Οκτωβρίου",November:"Νοεμβρίου",December:"Δεκεμβρίου",Jan:"Ιαν",Feb:"Φεβ",Mar:"Μαρ",Apr:"Απρ","May(short)":"Μαΐ",Jun:"Ιουν",Jul:"Ιουλ",Aug:"Αυγ",Sep:"Σεπ",Oct:"Οκτ",Nov:"Νοε",Dec:"Δεκ",Sunday:"Κυριακή",Monday:"Δευτέρα",Tuesday:"Τρίτη",Wednesday:"Τετάρτη",Thursday:"Πέμπτη",Friday:"Παρασκευή",Saturday:"Σάββατο",Sun:"Κυρ",Mon:"Δευ",Tue:"Τρί",Wed:"Τετ",Thu:"Πέμ",Fri:"Παρ",Sat:"Σάβ",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Εστίαση",Play:"Αναπαραγωγή",Stop:"Στάση",Legend:"Υπόμνημα","Click, tap or press ENTER to toggle":"",Loading:"Φόρτωση",Home:"Αρχική",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Εκτύπωση",Image:"Image",Data:"Δεδομένα",Print:"Εκτύπωση","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Από %1 έως %2","From %1":"Από %1","To %1":"Έως %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,xZ))!==void 0&&(vwt.exports=_wt);const OUi=AUi({__proto__:null,default:qa(xZ)},[xZ]),RUi=Object.freeze(Object.defineProperty({__proto__:null,e:OUi},Symbol.toStringTag,{value:"Module"}));function MUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var bwt,wwt,SZ={},DUi={get exports(){return SZ},set exports(t){SZ=t}};bwt=DUi,(wwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm::ss SSS",_date_second:"hh:mm:ss a",_date_minute:"hh:mm a",_date_hour:"hh:mm a",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},Play:"",Stop:"","Zoom Out":"",Legend:"","Click, tap or press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Chord diagram":"","Flow diagram":"","TreeMap chart":"",Series:"","Candlestick Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,SZ))!==void 0&&(bwt.exports=wwt);const FUi=MUi({__proto__:null,default:qa(SZ)},[SZ]),LUi=Object.freeze(Object.defineProperty({__proto__:null,e:FUi},Symbol.toStringTag,{value:"Module"}));function kUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var xwt,Swt,CZ={},NUi={get exports(){return CZ},set exports(t){CZ=t}};xwt=NUi,(Swt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm::ss SSS",_date_second:"hh:mm:ss a",_date_minute:"hh:mm a",_date_hour:"hh:mm a",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},Play:"",Stop:"","Zoom Out":"",Legend:"","Click, tap or press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Chord diagram":"","Flow diagram":"","TreeMap chart":"",Series:"","Candlestick Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,CZ))!==void 0&&(xwt.exports=Swt);const $Ui=kUi({__proto__:null,default:qa(CZ)},[CZ]),BUi=Object.freeze(Object.defineProperty({__proto__:null,e:$Ui},Symbol.toStringTag,{value:"Module"}));function GUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Cwt,Twt,TZ={},VUi={get exports(){return TZ},set exports(t){TZ=t}};Cwt=VUi,(Twt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"dd MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"DC",_era_bc:"AC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Enero",February:"Febrero",March:"Marzo",April:"Abril",May:"Mayo",June:"Junio",July:"Julio",August:"Agosto",September:"Septiembre",October:"Octubre",November:"Noviembre",December:"Diciembre",Jan:"Ene",Feb:"Feb",Mar:"Mar",Apr:"Abr","May(short)":"May",Jun:"Jun",Jul:"Jul",Aug:"Ago",Sep:"Sep",Oct:"Oct",Nov:"Nov",Dec:"Dic",Sunday:"Domingo",Monday:"Lunes",Tuesday:"Martes",Wednesday:"Miércoles",Thursday:"Jueves",Friday:"Viernes",Saturday:"Sábado",Sun:"Dom",Mon:"Lun",Tue:"Mar",Wed:"Mie",Thu:"Jue",Fri:"Vie",Sat:"Sáb",_dateOrd:function(i){return"º"},"Zoom Out":"Aumentar Zoom",Play:"Reproducir",Stop:"Detener",Legend:"Leyenda","Click, tap or press ENTER to toggle":"Haga clic, toque o presione ENTER para alternar",Loading:"Cargando",Home:"Inicio",Chart:"Gráfico","Serial chart":"Gráfico de serie","X/Y chart":"Gráfico X/Y","Pie chart":"Gráfico circular","Gauge chart":"Gráfico de medidor radial","Radar chart":"Gráfico de radar","Sankey diagram":"Diagrama de sankey","Chord diagram":"Diagrama de cuerdas","Flow diagram":"Diagrama de flujo","TreeMap chart":"Gráfico de mapa de árbol",Series:"Series","Candlestick Series":"Series de velas","Column Series":"Series de columnas","Line Series":"Series de líneas","Pie Slice Series":"Series de trozos circular","X/Y Series":"Series de X/Y",Map:"Mapa","Press ENTER to zoom in":"Presione ENTER para aumentar el zoom","Press ENTER to zoom out":"Presione ENTER para disminuir el zoom","Use arrow keys to zoom in and out":"Use los cursores para disminuir o aumentar el zoom","Use plus and minus keys on your keyboard to zoom in and out":"Use las teclas mas o menos en su teclado para disminuir ou aumentar el zoom",Export:"Exportar",Image:"Imagen",Data:"Datos",Print:"Imprimir","Click, tap or press ENTER to open":"Haga clic, toque o presione ENTER para abrir","Click, tap or press ENTER to print.":"Haga clic, toque o presione ENTER para imprimir","Click, tap or press ENTER to export as %1.":"Haga clic, toque o presione ENTER para exportar como %1.",'To save the image, right-click this link and choose "Save picture as..."':'Para guardar la imagen, haga clic en el link con el botón derecho y elija "Guardar imagen como..."','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Para guardar la imagen, haga clic con el botón derecho en la miniatura a la izquierda y elija "Guardar imagen como ..."',"(Press ESC to close this message)":"(Presione ESC para cerrar este mensaje)","Image Export Complete":"Exportación de imagen completada","Export operation took longer than expected. Something might have gone wrong.":"La operación de exportación llevó más tiempo de lo esperado. Algo pudo haber salido mal.","Saved from":"Guardado de",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"Use TAB para seleccionar los botones de agarre o las flechas izquierda y derecha para cambiar la selección","Use left and right arrows to move selection":"Use las flechas izquierda y derecha para mover la selección","Use left and right arrows to move left selection":"Use las flechas izquierda y derecha para mover la selección izquierda","Use left and right arrows to move right selection":"Use las flechas izquierda y derecha para mover la selección derecha","Use TAB select grip buttons or up and down arrows to change selection":"Utilice los botones de control de selección TAB o flechas arriba y abajo para cambiar la selección","Use up and down arrows to move selection":"Use las flechas hacia arriba y hacia abajo para mover la selección","Use up and down arrows to move lower selection":"Use las flechas hacia arriba y hacia abajo para mover la selección inferior","Use up and down arrows to move upper selection":"Use las flechas hacia arriba y hacia abajo para mover la selección superior","From %1 to %2":"Desde %1 hasta %2","From %1":"Desde %1","To %1":"Hasta %1","No parser available for file: %1":"No hay analizador disponible para el archivo: %1","Error parsing file: %1":"Error al analizar el archivo: %1","Unable to load file: %1":"No se puede cargar el archivo: %1","Invalid date":"Fecha inválida"}}(yl,TZ))!==void 0&&(Cwt.exports=Twt);const UUi=GUi({__proto__:null,default:qa(TZ)},[TZ]),jUi=Object.freeze(Object.defineProperty({__proto__:null,e:UUi},Symbol.toStringTag,{value:"Module"}));function zUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Ewt,Iwt,EZ={},HUi={get exports(){return EZ},set exports(t){EZ=t}};Ewt=HUi,(Iwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"pKr",_era_bc:"eKr",A:"AM",P:"PM",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"jaanuar",February:"veebruar",March:"märts",April:"aprill",May:"mai",June:"juuni",July:"juuli",August:"august",September:"september",October:"oktoober",November:"november",December:"detsember",Jan:"jaan",Feb:"veebr",Mar:"märts",Apr:"apr","May(short)":"mai",Jun:"juuni",Jul:"juuli",Aug:"aug",Sep:"sept",Oct:"okt",Nov:"nov",Dec:"dets",Sunday:"pühapäev",Monday:"esmaspäev",Tuesday:"teisipäev",Wednesday:"kolmapäev",Thursday:"neljapäev",Friday:"reede",Saturday:"laupäev",Sun:"P",Mon:"E",Tue:"T",Wed:"K",Thu:"N",Fri:"R",Sat:"L",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Suumi",Play:"Esita",Stop:"Lõpeta",Legend:"Legend","Click, tap or press ENTER to toggle":"",Loading:"Laadin",Home:"Kodu",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Prindi",Image:"Pilt",Data:"Andmed",Print:"Prindi","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Alates %1 kuni %2","From %1":"Alates %1","To %1":"Kuni %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,EZ))!==void 0&&(Ewt.exports=Iwt);const WUi=zUi({__proto__:null,default:qa(EZ)},[EZ]),qUi=Object.freeze(Object.defineProperty({__proto__:null,e:WUi},Symbol.toStringTag,{value:"Module"}));function YUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Awt,Pwt,IZ={},XUi={get exports(){return IZ},set exports(t){IZ=t}};Awt=XUi,(Pwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"jKr.",_era_bc:"eKr.",A:"ap.",P:"ip.",AM:"ap.",PM:"ip.","A.M.":"ap.","P.M.":"ip.",January:"tammikuuta",February:"helmikuuta",March:"maaliskuuta",April:"huhtikuuta",May:"toukokuuta",June:"kesäkuuta",July:"heinäkuuta",August:"elokuuta",September:"syyskuuta",October:"lokakuuta",November:"marraskuuta",December:"joulukuuta",Jan:"tammik.",Feb:"helmik.",Mar:"maalisk.",Apr:"huhtik.","May(short)":"toukok.",Jun:"kesäk.",Jul:"heinäk.",Aug:"elok.",Sep:"syysk.",Oct:"lokak.",Nov:"marrask.",Dec:"jouluk.",Sunday:"sunnuntaina",Monday:"maanantaina",Tuesday:"tiistaina",Wednesday:"keskiviikkona",Thursday:"torstaina",Friday:"perjantaina",Saturday:"lauantaina",Sun:"su",Mon:"ma",Tue:"ti",Wed:"ke",Thu:"to",Fri:"pe",Sat:"la",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Tarkennus",Play:"Toista",Stop:"Lopeta",Legend:"Selite","Click, tap or press ENTER to toggle":"",Loading:"Ladataan",Home:"Aloitussivu",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Tulosta",Image:"kuva",Data:"Data",Print:"Tulosta","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Mistä %1 mihin %2","From %1":"Mistä %1","To %1":"Mihin %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,IZ))!==void 0&&(Awt.exports=Pwt);const KUi=YUi({__proto__:null,default:qa(IZ)},[IZ]),JUi=Object.freeze(Object.defineProperty({__proto__:null,f:KUi},Symbol.toStringTag,{value:"Module"}));function ZUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Owt,Rwt,AZ={},QUi={get exports(){return AZ},set exports(t){AZ=t}};Owt=QUi,(Rwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"dd MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"A",P:"P",AM:"AM",PM:"PM","A.M.":"A.M.","P.M.":"P.M.",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",Jan:"Jan",Feb:"Fév",Mar:"Mar",Apr:"Avr","May(short)":"Mai",Jun:"Jui",Jul:"Jul",Aug:"Aoû",Sep:"Sep",Oct:"Oct",Nov:"Nov",Dec:"Déc",Sunday:"Dimanche",Monday:"Lundi",Tuesday:"Mardi",Wednesday:"Mercredi",Thursday:"Jeudi",Friday:"Vendredi",Saturday:"Samedi",Sun:"Dim",Mon:"Lun",Tue:"Mar",Wed:"Mer",Thu:"Jeu",Fri:"Ven",Sat:"Sam",_dateOrd:function(i){var r="e";return(i<11||i>13)&&i%10==1&&(r="er"),r},"Zoom Out":"Zoom Arrière",Play:"Joue",Stop:"Arrête",Legend:"Légende","Click, tap or press ENTER to toggle":"cliquez, appuyez ou appuyez sur entrée pour basculer",Loading:"Charger",Home:"Accueil",Chart:"Graphique","Serial chart":"Graphique sérial","X/Y chart":"Graphique X/Y","Pie chart":"Camembert","Gauge chart":"Jauge graphique","Radar chart":"Carte radar","Sankey diagram":"Graphique Sankey","Flow diagram":"représentation schématique","Chord diagram":"diagramme d'accord","TreeMap chart":"carte de l'arbre","Sliced chart":"graphique en tranches",Series:"Séries","Candlestick Series":"Séries chandelier","OHLC Series":"Séries OHLC","Column Series":"Séries de colonnes","Line Series":"Série de lignes","Pie Slice Series":"Tarte tranche Séries","Funnel Series":"Séries d'entonnoir","Pyramid Series":"Séries pyramidale","X/Y Series":"Séries X/Y",Map:"Mappe","Press ENTER to zoom in":"Appuyez sur ENTER pour zoomer","Press ENTER to zoom out":"Appuyez sur ENTER pour effectuer un zoom arrière","Use arrow keys to zoom in and out":"Utilisez les touches fléchées pour zoomer et dézoomer","Use plus and minus keys on your keyboard to zoom in and out":"Utilisez les touches plus et moins de votre clavier pour effectuer un zoom avant ou arrière",Export:"Exporter",Image:"Image",Data:"Data",Print:"Imprimer","Click, tap or press ENTER to open":"Cliquez, appuyez ou appuyez sur ENTER pour ouvrir","Click, tap or press ENTER to print.":"Cliquez, appuyez ou appuyez sur ENTER pour imprimer","Click, tap or press ENTER to export as %1.":"Cliquez, appuyez ou appuyez sur ENTER pour exporter comme %1",'To save the image, right-click this link and choose "Save picture as..."':"Pour enregistrer l'image, cliquez avec le bouton droit sur ce lien et choisissez 'Enregistrer l'image sous ...'",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"'Pour enregistrer l'image, cliquez sur la vignette à gauche avec le bouton droit de la souris et choisissez 'Enregistrer l'image sous ...'","(Press ESC to close this message)":"(Appuyez sur ESC pour fermer ce message)","Image Export Complete":"Exportation d'image terminée","Export operation took longer than expected. Something might have gone wrong.":"L'exportation a pris plus de temps que prévu. Quelque chose aurait mal tourné.","Saved from":"Enregistré de",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"Utilisez la touche TAB pour sélectionner les boutons des poignées ou les flèches gauche et droite pour modifier la sélection.","Use left and right arrows to move selection":"Utilisez les flèches gauche et droite pour déplacer la sélection","Use left and right arrows to move left selection":"Utilisez les flèches gauche et droite pour déplacer la sélection gauche","Use left and right arrows to move right selection":"Utilisez les flèches gauche et droite pour déplacer la sélection droite","Use TAB select grip buttons or up and down arrows to change selection":"Utilisez les boutons de sélection TAB ou les flèches vers le haut et le bas pour modifier la sélection.","Use up and down arrows to move selection":"Utilisez les flèches haut et bas pour déplacer la sélection","Use up and down arrows to move lower selection":"Utilisez les flèches haut et bas pour déplacer la sélection inférieure","Use up and down arrows to move upper selection":"Utilisez les flèches haut et bas pour déplacer la sélection supérieure","From %1 to %2":"De %1 à %2","From %1":"De %1","To %1":"à %1","No parser available for file: %1":"Aucun analyseur disponible pour le fichier: %1","Error parsing file: %1":"Erreur d'analyse du fichier: %1","Unable to load file: %1":"Impossible de charger le fichier: %1","Invalid date":"Date invalide"}}(yl,AZ))!==void 0&&(Owt.exports=Rwt);const eji=ZUi({__proto__:null,default:qa(AZ)},[AZ]),tji=Object.freeze(Object.defineProperty({__proto__:null,f:eji},Symbol.toStringTag,{value:"Module"}));function iji(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Mwt,Dwt,PZ={},rji={get exports(){return PZ},set exports(t){PZ=t}};Mwt=rji,(Dwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"לספירה",_era_bc:"לפנה״ס",A:"לפנה״צ",P:"אחה״צ",AM:"לפנה״צ",PM:"אחה״צ","A.M.":"לפנה״צ","P.M.":"אחה״צ",January:"ינואר",February:"פברואר",March:"מרץ",April:"אפריל",May:"מאי",June:"יוני",July:"יולי",August:"אוגוסט",September:"ספטמבר",October:"אוקטובר",November:"נובמבר",December:"דצמבר",Jan:"ינו׳",Feb:"פבר׳",Mar:"מרץ",Apr:"אפר׳","May(short)":"מאי",Jun:"יוני",Jul:"יולי",Aug:"אוג׳",Sep:"ספט׳",Oct:"אוק׳",Nov:"נוב׳",Dec:"דצמ׳",Sunday:"יום ראשון",Monday:"יום שני",Tuesday:"יום שלישי",Wednesday:"יום רביעי",Thursday:"יום חמישי",Friday:"יום שישי",Saturday:"יום שבת",Sun:"יום א׳",Mon:"יום ב׳",Tue:"יום ג׳",Wed:"יום ד׳",Thu:"יום ה׳",Fri:"יום ו׳",Sat:"שבת",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"התמקד",Play:"נגן",Stop:"עצור",Legend:"מקרא","Click, tap or press ENTER to toggle":"",Loading:"טעינה",Home:"דף הבית",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"הדפס",Image:"תמונה",Data:"נתונים",Print:"הדפס","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"מ %1 עד %2","From %1":"מ %1","To %1":"עד %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,PZ))!==void 0&&(Mwt.exports=Dwt);const nji=iji({__proto__:null,default:qa(PZ)},[PZ]),sji=Object.freeze(Object.defineProperty({__proto__:null,h:nji},Symbol.toStringTag,{value:"Module"}));function oji(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Fwt,Lwt,OZ={},aji={get exports(){return OZ},set exports(t){OZ=t}};Fwt=aji,(Lwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"po. Kr.",_era_bc:"pr. Kr.",A:"AM",P:"PM",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"siječnja",February:"veljače",March:"ožujka",April:"travnja",May:"svibnja",June:"lipnja",July:"srpnja",August:"kolovoza",September:"rujna",October:"listopada",November:"studenoga",December:"prosinca",Jan:"sij",Feb:"velj",Mar:"ožu",Apr:"tra","May(short)":"svi",Jun:"lip",Jul:"srp",Aug:"kol",Sep:"ruj",Oct:"lis",Nov:"stu",Dec:"pro",Sunday:"nedjelja",Monday:"ponedjeljak",Tuesday:"utorak",Wednesday:"srijeda",Thursday:"četvrtak",Friday:"petak",Saturday:"subota",Sun:"ned",Mon:"pon",Tue:"uto",Wed:"sri",Thu:"čet",Fri:"pet",Sat:"sub",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Povećaj",Play:"Reproduciraj",Stop:"Zaustavi",Legend:"Legenda","Click, tap or press ENTER to toggle":"",Loading:"Učitavanje",Home:"Početna",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Ispis",Image:"Slika",Data:"Podaci",Print:"Ispis","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,OZ))!==void 0&&(Fwt.exports=Lwt);const lji=oji({__proto__:null,default:qa(OZ)},[OZ]),uji=Object.freeze(Object.defineProperty({__proto__:null,h:lji},Symbol.toStringTag,{value:"Module"}));function cji(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var kwt,Nwt,RZ={},hji={get exports(){return RZ},set exports(t){RZ=t}};kwt=hji,(Nwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"i. sz.",_era_bc:"i. e.",A:"de.",P:"du.",AM:"de.",PM:"du.","A.M.":"de.","P.M.":"du.",January:"január",February:"február",March:"március",April:"április",May:"május",June:"június",July:"július",August:"augusztus",September:"szeptember",October:"október",November:"november",December:"december",Jan:"jan.",Feb:"febr.",Mar:"márc.",Apr:"ápr.","May(short)":"máj.",Jun:"jún.",Jul:"júl.",Aug:"aug.",Sep:"szept.",Oct:"okt.",Nov:"nov.",Dec:"dec.",Sunday:"vasárnap",Monday:"hétfő",Tuesday:"kedd",Wednesday:"szerda",Thursday:"csütörtök",Friday:"péntek",Saturday:"szombat",Sun:"V",Mon:"H",Tue:"K",Wed:"Sze",Thu:"Cs",Fri:"P",Sat:"Szo",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Nagyítás/kicsinyítés",Play:"Lejátszás",Stop:"Megálló",Legend:"Jelmagyarázat","Click, tap or press ENTER to toggle":"",Loading:"Betöltés",Home:"Kezdőlap",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Nyomtatás",Image:"Kép",Data:"Adatok",Print:"Nyomtatás","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Ettől %1 eddig %2","From %1":"Ettől %1","To %1":"Eddig %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,RZ))!==void 0&&(kwt.exports=Nwt);const dji=cji({__proto__:null,default:qa(RZ)},[RZ]),pji=Object.freeze(Object.defineProperty({__proto__:null,h:dji},Symbol.toStringTag,{value:"Module"}));function fji(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var $wt,Bwt,MZ={},mji={get exports(){return MZ},set exports(t){MZ=t}};$wt=mji,(Bwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"M",_era_bc:"SM",A:"AM",P:"PM",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"Januari",February:"Februari",March:"Maret",April:"April",May:"Mei",June:"Juni",July:"Juli",August:"Agustus",September:"September",October:"Oktober",November:"November",December:"Desember",Jan:"Jan",Feb:"Feb",Mar:"Mar",Apr:"Apr","May(short)":"Mei",Jun:"Jun",Jul:"Jul",Aug:"Agu",Sep:"Sep",Oct:"Okt",Nov:"Nov",Dec:"Des",Sunday:"Minggu",Monday:"Senin",Tuesday:"Selasa",Wednesday:"Rabu",Thursday:"Kamis",Friday:"Jumat",Saturday:"Sabtu",Sun:"Min",Mon:"Sen",Tue:"Sel",Wed:"Rab",Thu:"Kam",Fri:"Jum",Sat:"Sab",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Perkecil",Play:"Putar",Stop:"Hentikan",Legend:"Legenda","Click, tap or press ENTER to toggle":"Klik, ketuk atau tekan ENTER untuk beralih",Loading:"Memuat",Home:"Beranda",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"Peta","Press ENTER to zoom in":"Tekan ENTER untuk memperbesar","Press ENTER to zoom out":"Tekan ENTER untuk memperkecil","Use arrow keys to zoom in and out":"Gunakan tombol panah untuk memperbesar dan memperkecil","Use plus and minus keys on your keyboard to zoom in and out":"Gunakan tombol plus dan minus pada keyboard Anda untuk memperbesar dan memperkecil",Export:"Cetak",Image:"Gambar",Data:"Data",Print:"Cetak","Click, tap or press ENTER to open":"Klik, ketuk atau tekan ENTER untuk membuka","Click, tap or press ENTER to print.":"Klik, ketuk atau tekan ENTER untuk mencetak","Click, tap or press ENTER to export as %1.":"Klik, ketuk atau tekan ENTER untuk mengekspor sebagai %1",'To save the image, right-click this link and choose "Save picture as..."':'Untuk menyimpan gambar, klik kanan tautan ini dan pilih "Simpan gambar sebagai"','To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"Tekan ESC untuk menutup pesan ini","Image Export Complete":"Ekspor gambar selesai","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Dari %1 ke %2","From %1":"Dari %1","To %1":"Ke %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,MZ))!==void 0&&($wt.exports=Bwt);const gji=fji({__proto__:null,default:qa(MZ)},[MZ]),yji=Object.freeze(Object.defineProperty({__proto__:null,i:gji},Symbol.toStringTag,{value:"Module"}));function vji(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Gwt,Vwt,DZ={},_ji={get exports(){return DZ},set exports(t){DZ=t}};Gwt=_ji,(Vwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"dd MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"HH:mm:ss SSS",_duration_millisecond_day:"d'g' mm:ss SSS",_duration_millisecond_week:"d'g' mm:ss SSS",_duration_millisecond_month:"M'm' dd'g' mm:ss SSS",_duration_millisecond_year:"y'a' MM'm' dd'g' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'g' hh:mm:ss",_duration_second_week:"d'g' hh:mm:ss",_duration_second_month:"M'm' dd'g' hh:mm:ss",_duration_second_year:"y'a' MM'm' dd'g' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'g' hh:mm",_duration_minute_week:"d'g' hh:mm",_duration_minute_month:"M'm' dd'g' hh:mm",_duration_minute_year:"y'a' MM'm' dd'g' hh:mm",_duration_hour:"hh'o'",_duration_hour_day:"d'g' hh'o'",_duration_hour_week:"d'g' hh'o'",_duration_hour_month:"M'm' dd'g' hh'o'",_duration_hour_year:"y'a' MM'm' dd'g' hh'o'",_duration_day:"d'g'",_duration_day_week:"d'g'",_duration_day_month:"M'm' dd'g'",_duration_day_year:"y'a' MM'm' dd'g'",_duration_week:"w's'",_duration_week_month:"w's'",_duration_week_year:"w's'",_duration_month:"M'm'",_duration_month_year:"y'a' MM'm'",_duration_year:"y'a'",_era_ad:"A.C.",_era_bc:"D.C.",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Gennaio",February:"Febbraio",March:"Marzo",April:"Aprile",May:"Maggio",June:"Giugno",July:"Luglio",August:"Agosto",September:"Settembre",October:"Ottobre",November:"Novembre",December:"Dicembre",Jan:"Gen",Feb:"Feb",Mar:"Mar",Apr:"Apr","May(short)":"Mag",Jun:"Giu",Jul:"Lug",Aug:"Ago",Sep:"Set",Oct:"Ott",Nov:"Nov",Dec:"Dic",Sunday:"Domenica",Monday:"Lunedì",Tuesday:"Martedì",Wednesday:"Mercoledì",Thursday:"Giovedì",Friday:"Venerdì",Saturday:"Sabato",Sun:"Dom",Mon:"Lun",Tue:"Mar",Wed:"Mer",Thu:"Gio",Fri:"Ven",Sat:"Sab",_dateOrd:function(i){return i+"°"},"Zoom Out":"Riduci zoom",Play:"Avvia",Stop:"Ferma",Legend:"Legenda","Click, tap or press ENTER to toggle":"Clicca, tappa o premi ENTER per attivare",Loading:"Caricamento",Home:"Home",Chart:"Grafico","Serial chart":"Grafico combinato","X/Y chart":"Grafico X/Y","Pie chart":"Grafico a torta","Gauge chart":"Diagramma di livello","Radar chart":"Grafico radar","Sankey diagram":"Diagramma di Sankey","Flow diagram":"Diagramma di flusso","Chord diagram":"Diagramma a corda","TreeMap chart":"Mappa ad albero","Sliced chart":"Grafico a fette",Series:"Serie","Candlestick Series":"Serie a candele","OHLC Series":"Serie OHLC","Column Series":"Serie a colonne","Line Series":"Serie a linee","Pie Slice Series":"Serie a fetta di torta","Funnel Series":"Serie ad imbuto","Pyramid Series":"Serie a piramide","X/Y Series":"Serie X/Y",Map:"Mappa","Press ENTER to zoom in":"Premi ENTER per ingrandire","Press ENTER to zoom out":"Premi ENTER per ridurre","Use arrow keys to zoom in and out":"Usa le frecce per ingrandire e ridurre","Use plus and minus keys on your keyboard to zoom in and out":"Utilizza i tasti più e meno sulla tastiera per ingrandire e ridurre",Export:"Esporta",Image:"Immagine",Data:"Dati",Print:"Stampa","Click, tap or press ENTER to open":"Clicca, tappa o premi ENTER per aprire","Click, tap or press ENTER to print.":"Clicca, tappa o premi ENTER per stampare.","Click, tap or press ENTER to export as %1.":"Clicca, tappa o premi ENTER per esportare come %1.",'To save the image, right-click this link and choose "Save picture as..."':`Per salvare l'immagine, fai clic con il pulsante destro del mouse su questo link e seleziona "Salva immagine come ..."`,'To save the image, right-click thumbnail on the left and choose "Save picture as..."':`Per salvare l'immagine, fare clic con il tasto destro del mouse sulla miniatura e selezionare "Salva immagine come ..."`,"(Press ESC to close this message)":"(Premere ESC per chiudere questo messaggio)","Image Export Complete":"Esportazione immagine completata","Export operation took longer than expected. Something might have gone wrong.":"L'operazione di esportazione ha richiesto più tempo del previsto. Potrebbe esserci qualche problema.","Saved from":"Salvato da",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"Utilizzare TAB per selezionare i punti di ancoraggio o i tasti freccia sinistra e destra per modificare la selezione","Use left and right arrows to move selection":"Utilizzare le frecce sinistra e destra per spostare la selezione","Use left and right arrows to move left selection":"Utilizzare frecce destra e sinistra per spostare la selezione sinistra","Use left and right arrows to move right selection":"Utilizzare frecce destra e sinistra per spostare la selezione destra","Use TAB select grip buttons or up and down arrows to change selection":"Utilizzare TAB per selezionare i punti di ancoraggio o premere le frecce su e giù per modificare la selezione","Use up and down arrows to move selection":"Utilizzare le frecce su e giù per spostare la selezione","Use up and down arrows to move lower selection":"Utilizzare le frecce su e giù per spostare la selezione inferiore","Use up and down arrows to move upper selection":"Utilizzare le frecce su e giù per spostare la selezione superiore","From %1 to %2":"Da %1 a %2","From %1":"Da %1","To %1":"a %1","No parser available for file: %1":"Nessun parser disponibile per il file: %1","Error parsing file: %1":"Errore durante l'analisi del file: %1","Unable to load file: %1":"Impossibile caricare il file: %1","Invalid date":"Data non valida"}}(yl,DZ))!==void 0&&(Gwt.exports=Vwt);const bji=vji({__proto__:null,default:qa(DZ)},[DZ]),wji=Object.freeze(Object.defineProperty({__proto__:null,i:bji},Symbol.toStringTag,{value:"Module"}));function xji(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Uwt,jwt,FZ={},Sji={get exports(){return FZ},set exports(t){FZ=t}};Uwt=Sji,(jwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"西暦",_era_bc:"紀元前",A:"午前",P:"午後",AM:"午前",PM:"午後","A.M.":"午前","P.M.":"午後",January:"1月",February:"2月",March:"3月",April:"4月",May:"5月",June:"6月",July:"7月",August:"8月",September:"9月",October:"10月",November:"11月",December:"12月",Jan:"1月",Feb:"2月",Mar:"3月",Apr:"4月","May(short)":"5月",Jun:"6月",Jul:"7月",Aug:"8月",Sep:"9月",Oct:"10月",Nov:"11月",Dec:"12月",Sunday:"日曜日",Monday:"月曜日",Tuesday:"火曜日",Wednesday:"水曜日",Thursday:"木曜日",Friday:"金曜日",Saturday:"土曜日",Sun:"日",Mon:"月",Tue:"火",Wed:"水",Thu:"木",Fri:"金",Sat:"土",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"ズーム",Play:"再生",Stop:"停止",Legend:"凡例","Click, tap or press ENTER to toggle":"",Loading:"読み込んでいます",Home:"ホーム",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"印刷",Image:"イメージ",Data:"データ",Print:"印刷","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"始点 %1 終点 %2","From %1":"始点 %1","To %1":"終点 %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,FZ))!==void 0&&(Uwt.exports=jwt);const Cji=xji({__proto__:null,default:qa(FZ)},[FZ]),Tji=Object.freeze(Object.defineProperty({__proto__:null,j:Cji},Symbol.toStringTag,{value:"Module"}));function Eji(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var zwt,Hwt,LZ={},Iji={get exports(){return LZ},set exports(t){LZ=t}};zwt=Iji,(Hwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"AM",P:"PM",AM:"AM",PM:"PM","A.M.":"오전","P.M.":"오후",January:"1월",February:"2월",March:"3월",April:"4월",May:"5월",June:"6월",July:"7월",August:"8월",September:"9월",October:"10월",November:"11월",December:"12월",Jan:"1월",Feb:"2월",Mar:"3월",Apr:"4월","May(short)":"5월",Jun:"6월",Jul:"7월",Aug:"8월",Sep:"9월",Oct:"10월",Nov:"11월",Dec:"12월",Sunday:"일요일",Monday:"월요일",Tuesday:"화요일",Wednesday:"수요일",Thursday:"목요일",Friday:"금요일",Saturday:"토요일",Sun:"일",Mon:"월",Tue:"화",Wed:"수",Thu:"목",Fri:"금",Sat:"토",_dateOrd:function(i){var r="일";if(i<11||i>13)switch(i%10){case 1:case 2:case 3:r="일"}return r},"Zoom Out":"축소",Play:"시작",Stop:"정지",Legend:"범례","Click, tap or press ENTER to toggle":"켜고 끄려면 클릭, 탭 혹은 엔터를 눌러주세요.",Loading:"불러오는 중",Home:"홈",Chart:"차트","Serial chart":"시리얼 차트","X/Y chart":"X/Y 차트","Pie chart":"파이 차트","Gauge chart":"게이지 차트","Radar chart":"레이더 차트","Sankey diagram":"생키 다이어그램","Flow diagram":"플로우 다이어그램","Chord diagram":"코드 다이어그램","TreeMap chart":"트리맵 차트","Force directed tree":"포스 디렉티드 트리","Sliced chart":"슬라이스 차트",Series:"시리즈","Candlestick Series":"캔들스틱 시리즈","OHLC Series":"OHLC 시리즈","Column Series":"컬럼 시리즈","Line Series":"라인 시리즈","Pie Slice Series":"파이 슬라이스 시리즈","Funnel Series":"퍼널 시리즈","Pyramid Series":"피라미드 시리즈","X/Y Series":"X/Y 시리즈",Map:"맵","Press ENTER to zoom in":"확대하려면 엔터를 누르세요.","Press ENTER to zoom out":"축소하려면 엔터를 누르세요.","Use arrow keys to zoom in and out":"확대 혹은 축소하려면 방향키를 이용하세요.","Use plus and minus keys on your keyboard to zoom in and out":"확대 혹은 축소하려면 키보드의 +/- 키를 이용하세요.",Export:"내보내기",Image:"이미지",Data:"데이터",Print:"인쇄","Click, tap or press ENTER to open":"열려면, 클릭, 탭 또는 엔터를 누르세요.","Click, tap or press ENTER to print.":"출력하려면, 클릭, 탭 또는 엔터를 누르세요.","Click, tap or press ENTER to export as %1.":"%1(으)로 내보내려면 클릭, 탭 또는 엔터를 누르세요.",'To save the image, right-click this link and choose "Save picture as..."':'이미지를 저장하려면, 이 링크를 마우스로 우클릭하여 "다른 이름으로 저장"을 선택하세요.','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'이미지를 저장하려면, 좌측 썸네일을 마우스로 우클릭하여 "다른 이름으로 저장"을 선택하세요.',"(Press ESC to close this message)":"(이 메시지를 끄려면 ESC를 누르세요.)","Image Export Complete":"이미지 내보내기 완료","Export operation took longer than expected. Something might have gone wrong.":"내보내기가 지연되고 있습니다. 문제가 없는지 확인이 필요합니다.","Saved from":"다음으로부터 저장됨: ",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"선택 범위를 변경하려면 선택 버튼이나 좌우 화살표를 이용하세요.","Use left and right arrows to move selection":"선택 범위를 움직이려면 좌우 화살표를 이용하세요.","Use left and right arrows to move left selection":"왼쪽 선택 범위를 움직이려면 좌우 화살표를 이용하세요.","Use left and right arrows to move right selection":"오른쪽 선택 범위를 움직이려면 좌우 화살표를 이용하세요.","Use TAB select grip buttons or up and down arrows to change selection":"선택 범위를 변경하려면 선택 버튼이나 상하 화살표를 이용하세요.","Use up and down arrows to move selection":"선택 범위를 움직이려면 상하 화살표를 이용하세요.","Use up and down arrows to move lower selection":"하단 선택 범위를 움직이려면 상하 화살표를 이용하세요.","Use up and down arrows to move upper selection":"상단 선택 범위를 움직이려면 상하 화살표를 이용하세요.","From %1 to %2":"%1 부터 %2 까지","From %1":"%1 부터","To %1":"%1 까지","No parser available for file: %1":"파일 파싱 불가능: %1","Error parsing file: %1":"파일 파싱 오류: %1","Unable to load file: %1":"파일 로드 불가능: %1","Invalid date":"날짜 올바르지 않음"}}(yl,LZ))!==void 0&&(zwt.exports=Hwt);const Aji=Eji({__proto__:null,default:qa(LZ)},[LZ]),Pji=Object.freeze(Object.defineProperty({__proto__:null,k:Aji},Symbol.toStringTag,{value:"Module"}));function Oji(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Wwt,qwt,kZ={},Rji={get exports(){return kZ},set exports(t){kZ=t}};Wwt=Rji,(qwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm::ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"yyyy-MM-dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"m.e.",_era_bc:"p.m.e.",A:"R",P:"V",AM:"ryto",PM:"vakaro","A.M.":"ryto","P.M.":"vakaro",January:"sausio",February:"vasario",March:"kovo",April:"balandžio",May:"gegužės",June:"birželio",July:"liepos",August:"rugpjūčio",September:"rugsėjo",October:"spalio",November:"lapkričio",December:"gruodžio",Jan:"sau.",Feb:"vas.",Mar:"kov.",Apr:"bal.","May(short)":"geg.",Jun:"bir.",Jul:"lie.",Aug:"rgp.",Sep:"rgs.",Oct:"spa.",Nov:"lap.",Dec:"gruo.",Sunday:"sekmadienis",Monday:"pirmadienis",Tuesday:"antradienis",Wednesday:"trečiadienis",Thursday:"ketvirtadienis",Friday:"penktadienis",Saturday:"šeštadienis",Sun:"sekm.",Mon:"pirm.",Tue:"antr.",Wed:"treč.",Thu:"ketv.",Fri:"penk.",Sat:"šešt.",_dateOrd:function(i){return"-a(s)"},"Zoom Out":"Rodyti viską",Play:"Paleisti",Stop:"Sustabdyti",Legend:"Legenda","Click, tap or press ENTER to toggle":"Spragtelkite, palieskite arba spauskite ENTER, kad perjungtumėte",Loading:"Kraunama",Home:"Pradžia",Chart:"Grafikas","Serial chart":"Serijinis grafikas","X/Y chart":"X/Y grafikas","Pie chart":"Pyrago tipo grafikas","Gauge chart":"Daviklio tipo grafikas","Radar chart":"Radaro tipo grafikas","Sankey diagram":"Sankey diagrama","Chord diagram":"Chord diagrama","Flow diagram":"Flow diagrama","TreeMap chart":"TreeMap grafikas",Series:"Serija","Candlestick Series":'"Candlestick" tipo grafiko serija',"Column Series":"Stulpelinio grafiko serija","Line Series":"Linijinio grafiko serija","Pie Slice Series":"Pyrago tipo serija","X/Y Series":"X/Y serija",Map:"Žemėlapis","Press ENTER to zoom in":"Spauskite ENTER, kad pritrauktumėte vaizdą","Press ENTER to zoom out":"Spauskite ENTER, kad atitolintumėte vaizdą","Use arrow keys to zoom in and out":"Naudokitės royklėmis vaizdo pritraukimui ar atitolinimui","Use plus and minus keys on your keyboard to zoom in and out":"Spauskite pliuso arba minuso klavišus ant klaviatūros, kad pritrautumėte arba atitolintumėte vaizdą",Export:"Eksportuoti",Image:"Paveiksliukas",Data:"Duomenys",Print:"Spausdinti","Click, tap or press ENTER to open":"Spragtelkite arba spauskite ENTER, kad atidarytumėte","Click, tap or press ENTER to print.":"Spragtelkite arba spauskite ENTER, kad spausdintumėte.","Click, tap or press ENTER to export as %1.":"Spragtelkite arba spauskite ENTER, kad eksportuotumėte kaip %1.",'To save the image, right-click this link and choose "Save picture as..."':'Kad išsaugotumėte paveiksliuką, spauskite dešinį pelės klavišą ir pasirinkite "Išsaugoti, kaip paveiksliuką..."',"(Press ESC to close this message)":"(Spauskite ESC, kad uždarytumėte šį pranešimą)","Image Export Complete":"Paveiksliuko eksportas baigtas","Export operation took longer than expected. Something might have gone wrong.":"Eksportas užtruko ilgiau negu turėtų. Greičiausiai įvyko klaida.","Saved from":"Išsaugota iš",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"Spauskite TAB klavišą, kad pasirinktumėte žymeklius, arba kairė/dešinė klavišus, kad pakeistumėte pasirinkimą","Use left and right arrows to move selection":"Naudokitės klavišais kairė/dešinė, kad pajudintumėte pasirinkimą","Use left and right arrows to move left selection":"Naudokitės klavišais kairė/dešinė, kad pajudintumėte kairį žymeklį","Use left and right arrows to move right selection":"Naudokitės klavišais kairė/dešinė, kad pajudintumėte dešinį žymeklį","Use TAB select grip buttons or up and down arrows to change selection":"Spauskite TAB klavišą, kad pasirinktumėte žymeklius, arba aukštyn/žemyn klavišus, kad pakeistumėte pasirinkimą","Use up and down arrows to move selection":"Naudokitės klavišais aukštyn/žemyn, kad pajudintumėte pasirinkimą","Use up and down arrows to move lower selection":"Naudokitės klavišais aukštyn/žemyn, kad pajudintumėte apatinį žymeklį","Use up and down arrows to move upper selection":"Naudokitės klavišais aukštyn/žemyn, kad pajudintumėte viršutinį žymeklį","From %1 to %2":"Nuo %1 iki %2","From %1":"Nuo %1","To %1":"Iki %1","No parser available for file: %1":"Failui %1 neturime tinkamo dešifruotojo","Error parsing file: %1":"Skaitant failą %1 įvyko klaida","Unable to load file: %1":"Nepavyko užkrauti failo %1","Invalid date":"Klaidinga data"}}(yl,kZ))!==void 0&&(Wwt.exports=qwt);const Mji=Oji({__proto__:null,default:qa(kZ)},[kZ]),Dji=Object.freeze(Object.defineProperty({__proto__:null,l:Mji},Symbol.toStringTag,{value:"Module"}));function Fji(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Ywt,Xwt,NZ={},Lji={get exports(){return NZ},set exports(t){NZ=t}};Ywt=Lji,(Xwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"m.ē.",_era_bc:"p.m.ē.",A:"priekšp.",P:"pēcp.",AM:"priekšp.",PM:"pēcp.","A.M.":"priekšpusdienā","P.M.":"pēcpusdienā",January:"janvāris",February:"februāris",March:"marts",April:"aprīlis",May:"maijs",June:"jūnijs",July:"jūlijs",August:"augusts",September:"septembris",October:"oktobris",November:"novembris",December:"decembris",Jan:"janv.",Feb:"febr.",Mar:"marts",Apr:"apr.","May(short)":"maijs",Jun:"jūn.",Jul:"jūl.",Aug:"aug.",Sep:"sept.",Oct:"okt.",Nov:"nov.",Dec:"dec.",Sunday:"svētdiena",Monday:"pirmdiena",Tuesday:"otrdiena",Wednesday:"trešdiena",Thursday:"ceturtdiena",Friday:"piektdiena",Saturday:"sestdiena",Sun:"svētd.",Mon:"pirmd.",Tue:"otrd.",Wed:"trešd.",Thu:"ceturtd.",Fri:"piektd.",Sat:"sestd.",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Tālummaiņa",Play:"Darbināt",Stop:"Apturēt",Legend:"Apzīmējumi","Click, tap or press ENTER to toggle":"",Loading:"Ielādē",Home:"Sākums",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Drukāt",Image:"Attēls",Data:"Dati",Print:"Drukāt","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"No %1 līdz %2","From %1":"No %1","To %1":"Līdz %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,NZ))!==void 0&&(Ywt.exports=Xwt);const kji=Fji({__proto__:null,default:qa(NZ)},[NZ]),Nji=Object.freeze(Object.defineProperty({__proto__:null,l:kji},Symbol.toStringTag,{value:"Module"}));function $ji(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Kwt,Jwt,$Z={},Bji={get exports(){return $Z},set exports(t){$Z=t}};Kwt=Bji,(Jwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"e.Kr.",_era_bc:"f.Kr.",A:"a",P:"p",AM:"a.m.",PM:"p.m.","A.M.":"a.m.","P.M.":"p.m.",January:"januar",February:"februar",March:"mars",April:"april",May:"mai",June:"juni",July:"juli",August:"august",September:"september",October:"oktober",November:"november",December:"desember",Jan:"jan.",Feb:"feb.",Mar:"mar.",Apr:"apr.","May(short)":"mai",Jun:"jun.",Jul:"jul.",Aug:"aug.",Sep:"sep.",Oct:"okt.",Nov:"nov.",Dec:"des.",Sunday:"søndag",Monday:"mandag",Tuesday:"tirsdag",Wednesday:"onsdag",Thursday:"torsdag",Friday:"fredag",Saturday:"lørdag",Sun:"søn.",Mon:"man.",Tue:"tir.",Wed:"ons.",Thu:"tor.",Fri:"fre.",Sat:"lør.",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Zoom",Play:"Spill av",Stop:"Stopp",Legend:"Tegnforklaring","Click, tap or press ENTER to toggle":"",Loading:"Laster inn",Home:"Hjem",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Skriv ut",Image:"Bilde",Data:"Data",Print:"Skriv ut","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Fra %1 til %2","From %1":"Fra %1","To %1":"Til %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,$Z))!==void 0&&(Kwt.exports=Jwt);const Gji=$ji({__proto__:null,default:qa($Z)},[$Z]),Vji=Object.freeze(Object.defineProperty({__proto__:null,n:Gji},Symbol.toStringTag,{value:"Module"}));function Uji(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Zwt,Qwt,BZ={},jji={get exports(){return BZ},set exports(t){BZ=t}};Zwt=jji,(Qwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"d MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"AD",_era_bc:"v.C.",A:"A",P:"P",AM:"AM",PM:"PM","A.M.":"a.m.","P.M.":"p.m.",January:"januari",February:"februari",March:"maart",April:"april",May:"mei",June:"juni",July:"juli",August:"augustus",September:"september",October:"oktober",November:"november",December:"december",Jan:"jan",Feb:"feb",Mar:"mrt",Apr:"apr","May(short)":"mei",Jun:"jun",Jul:"jul",Aug:"aug",Sep:"sep",Oct:"okt",Nov:"nov",Dec:"dec",Sunday:"zondag",Monday:"maandag",Tuesday:"dinsdag",Wednesday:"woensdag",Thursday:"donderdag",Friday:"vrijdag",Saturday:"zaterdag",Sun:"Zo",Mon:"Ma",Tue:"Di",Wed:"Wo",Thu:"Do",Fri:"Vr",Sat:"Za",_dateOrd:function(i){var r="de";return(i==1||i==8||i>19)&&(r="ste"),r},"Zoom Out":"Uitzoomen",Play:"Afspelen",Stop:"Stoppen",Legend:"Legenda","Click, tap or press ENTER to toggle":"Klik, tik of druk op Enter om aan of uit te zetten",Loading:"Laden",Home:"Home",Chart:"Grafiek","Serial chart":"Periodieke grafiek","X/Y chart":"X-Y grafiek","Pie chart":"Taartdiagram","Gauge chart":"Meterdiagram","Radar chart":"Radardiagram","Sankey diagram":"Sankey-diagram","Chord diagram":"Chord-diagram","Flow diagram":"Flow-diagram","TreeMap chart":"Treemap-grafiek",Series:"Reeks","Candlestick Series":"Candlestick-reeks","Column Series":"Kolomreeks","Line Series":"Lijnreeks","Pie Slice Series":"Taartpuntreeks","X/Y Series":"XY reeks",Map:"Kaart","Press ENTER to zoom in":"Druk op Enter om in te zoomen","Press ENTER to zoom out":"Druk op Enter om uit te zoomen","Use arrow keys to zoom in and out":"Zoom in of uit met de pijltjestoetsen","Use plus and minus keys on your keyboard to zoom in and out":"Zoom in of uit met de plus- en minustoetsen",Export:"Exporteren",Image:"Afbeelding",Data:"Data",Print:"Printen","Click, tap or press ENTER to open":"Klik, tik of druk op Enter om te openen","Click, tap or press ENTER to print.":"Klik, tik of druk op Enter om te printen","Click, tap or press ENTER to export as %1.":"Klik, tik of druk op Enter om te exporteren als %1",'To save the image, right-click this link and choose "Save picture as..."':'Klik met de rechtermuisknop op deze link en kies "Afbeelding opslaan als..." om de afbeelding op te slaan','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Klik met de rechtermuisknop op de miniatuur links en kies "Afbeelding opslaan als..." om de afbeelding op te slaan',"(Press ESC to close this message)":"(Druk op ESC om dit bericht te sluiten)","Image Export Complete":"Afbeelding exporteren gereed","Export operation took longer than expected. Something might have gone wrong.":"Exportproces duurt langer dan verwacht. Er is misschien iets fout gegaan.","Saved from":"Opgeslagen via:",PNG:"PNG",JPG:"JPG",GIF:"GIF",SVG:"SVG",PDF:"PDF",JSON:"JSON",CSV:"CSV",XLSX:"XLSX","Use TAB to select grip buttons or left and right arrows to change selection":"Gebruik Tab om de hendels te selecteren of linker- en rechterpijltje om de selectie te veranderen","Use left and right arrows to move selection":"Gebruik linker- en rechterpijltje om de selectie te verplaatsen","Use left and right arrows to move left selection":"Gebruik linker- en rechterpijltje om de linkerselectie te verplaatsen","Use left and right arrows to move right selection":"Gebruik linker- en rechterpijltje om de rechterselectie te verplaatsen","Use TAB select grip buttons or up and down arrows to change selection":"Gebruik Tab om de hendels te selecteren of pijltje omhoog en omlaag om de selectie te veranderen","Use up and down arrows to move selection":"Gebruik pijltje omhoog en omlaag om de selectie te verplaatsen","Use up and down arrows to move lower selection":"Gebruik pijltje omhoog en omlaag om de onderste selectie te verplaatsen","Use up and down arrows to move upper selection":"Gebruik pijltje omhoog en omlaag om de bovenste selectie te verplaatsen","From %1 to %2":"Van %1 tot %2","From %1":"Van %1","To %1":"Tot %2","No parser available for file: %1":"Geen data-parser beschikbaar voor dit bestand: %1","Error parsing file: %1":"Fout tijdens parsen van bestand: %1","Unable to load file: %1":"Kan bestand niet laden: %1","Invalid date":"Ongeldige datum"}}(yl,BZ))!==void 0&&(Zwt.exports=Qwt);const zji=Uji({__proto__:null,default:qa(BZ)},[BZ]),Hji=Object.freeze(Object.defineProperty({__proto__:null,n:zji},Symbol.toStringTag,{value:"Module"}));function Wji(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var ext,txt,GZ={},qji={get exports(){return GZ},set exports(t){GZ=t}};ext=qji,(txt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n.e.",_era_bc:"p.n.e.",A:"a",P:"p",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"stycznia",February:"lutego",March:"marca",April:"kwietnia",May:"maja",June:"czerwca",July:"lipca",August:"sierpnia",September:"września",October:"października",November:"listopada",December:"grudnia",Jan:"sty",Feb:"lut",Mar:"mar",Apr:"kwi","May(short)":"maj",Jun:"cze",Jul:"lip",Aug:"sie",Sep:"wrz",Oct:"paź",Nov:"lis",Dec:"gru",Sunday:"niedziela",Monday:"poniedziałek",Tuesday:"wtorek",Wednesday:"środa",Thursday:"czwartek",Friday:"piątek",Saturday:"sobota",Sun:"niedz.",Mon:"pon.",Tue:"wt.",Wed:"śr.",Thu:"czw.",Fri:"pt.",Sat:"sob.",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Zmiana skali",Play:"Odtwarzanie",Stop:"Zatrzymaj",Legend:"Legenda","Click, tap or press ENTER to toggle":"",Loading:"Wczytywanie",Home:"Strona główna",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Drukuj",Image:"Obraz",Data:"Dane",Print:"Drukuj","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,GZ))!==void 0&&(ext.exports=txt);const Yji=Wji({__proto__:null,default:qa(GZ)},[GZ]),Xji=Object.freeze(Object.defineProperty({__proto__:null,p:Yji},Symbol.toStringTag,{value:"Module"}));function Kji(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var ixt,rxt,VZ={},Jji={get exports(){return VZ},set exports(t){VZ=t}};ixt=Jji,(rxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"dd MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"DC",_era_bc:"AC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Janeiro",February:"Fevereiro",March:"Março",April:"Abril",May:"Maio",June:"Junho",July:"Julho",August:"Agosto",September:"Setembro",October:"Outubro",November:"Novembro",December:"Dezembro",Jan:"Jan",Feb:"Fev",Mar:"Mar",Apr:"Abr","May(short)":"Mai",Jun:"Jun",Jul:"Jul",Aug:"Ago",Sep:"Set",Oct:"Out",Nov:"Nov",Dec:"Dez",Sunday:"Domingo",Monday:"Segunda-feira",Tuesday:"Terça-feira",Wednesday:"Quarta-feira",Thursday:"Quinta-feira",Friday:"Sexta-feira",Saturday:"Sábado",Sun:"Dom",Mon:"Seg",Tue:"Ter",Wed:"Qua",Thu:"Qui",Fri:"Sex",Sat:"Sáb",_dateOrd:function(i){return"º"},"Zoom Out":"Reduzir Zoom",Play:"Play",Stop:"Parar",Legend:"Legenda","Click, tap or press ENTER to toggle":"Clique, toque ou pressione ENTER para alternar",Loading:"Carregando",Home:"Início",Chart:"Gráfico","Serial chart":"Gráfico Serial","X/Y chart":"Gráfico XY","Pie chart":"Gráfico de Pizza","Gauge chart":"Gráfico Indicador","Radar chart":"Gráfico de Radar","Sankey diagram":"Diagrama Sankey","Chord diagram":"Diagram Chord","Flow diagram":"Diagrama Flow","TreeMap chart":"Gráfico de Mapa de Árvore",Series:"Séries","Candlestick Series":"Séries do Candlestick","Column Series":"Séries de Colunas","Line Series":"Séries de Linhas","Pie Slice Series":"Séries de Fatias de Pizza","X/Y Series":"Séries de XY",Map:"Mapa","Press ENTER to zoom in":"Pressione ENTER para aumentar o zoom","Press ENTER to zoom out":"Pressione ENTER para diminuir o zoom","Use arrow keys to zoom in and out":"Use as setas para diminuir ou aumentar o zoom","Use plus and minus keys on your keyboard to zoom in and out":"Use as teclas mais ou menos no seu teclado para diminuir ou aumentar o zoom",Export:"Exportar",Image:"Imagem",Data:"Dados",Print:"Imprimir","Click, tap or press ENTER to open":"Clique, toque ou pressione ENTER para abrir","Click, tap or press ENTER to print.":"Clique, toque ou pressione ENTER para imprimir","Click, tap or press ENTER to export as %1.":"Clique, toque ou pressione ENTER para exportar como %1.",'To save the image, right-click this link and choose "Save picture as..."':'Para salvar a imagem, clique no link com o botão da direira e escolha "Salvar imagem como..."','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Para salvar, clique na imagem à esquerda com o botão direito e escolha "Salvar imagem como..."',"(Press ESC to close this message)":"(Pressione ESC para fechar esta mensagem)","Image Export Complete":"A exportação da imagem foi completada","Export operation took longer than expected. Something might have gone wrong.":"A exportação da imagem demorou mais do que o experado. Algo deve ter dado errado.","Saved from":"Salvo de",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"Use TAB para selecionar os botões ou setas para a direita ou esquerda para mudar a seleção","Use left and right arrows to move selection":"Use as setas para a esquerda ou direita para mover a seleção","Use left and right arrows to move left selection":"Use as setas para a esquerda ou direita para mover a seleção da esquerda","Use left and right arrows to move right selection":"Use as setas para a esquerda ou direita para mover a seleção da direita","Use TAB select grip buttons or up and down arrows to change selection":"Use TAB para selecionar os botões ou setas para cima ou para baixo para mudar a seleção","Use up and down arrows to move selection":"Use as setas para cima ou para baixo para mover a seleção","Use up and down arrows to move lower selection":"Use as setas para cima ou para baixo para mover a seleção de baixo","Use up and down arrows to move upper selection":"Use as setas para cima ou para baixo para mover a seleção de cima","From %1 to %2":"De %1 até %2","From %1":"De %1","To %1":"Até %1","No parser available for file: %1":"Não há um interpretador para este arquivo: %1","Error parsing file: %1":"Erro analizando o arquivo: %1","Unable to load file: %1":"O arquivo não pôde ser carregado: %1","Invalid date":"Data inválida"}}(yl,VZ))!==void 0&&(ixt.exports=rxt);const Zji=Kji({__proto__:null,default:qa(VZ)},[VZ]),Qji=Object.freeze(Object.defineProperty({__proto__:null,p:Zji},Symbol.toStringTag,{value:"Module"}));function e7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var nxt,sxt,UZ={},t7i={get exports(){return UZ},set exports(t){UZ=t}};nxt=t7i,(sxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"dd MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"DC",_era_bc:"AC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Janeiro",February:"Fevereiro",March:"Março",April:"Abril",May:"Maio",June:"Junho",July:"Julho",August:"Agosto",September:"Setembro",October:"Outubro",November:"Novembro",December:"Dezembro",Jan:"Jan",Feb:"Fev",Mar:"Mar",Apr:"Abr","May(short)":"Mai",Jun:"Jun",Jul:"Jul",Aug:"Ago",Sep:"Set",Oct:"Out",Nov:"Nov",Dec:"Dez",Sunday:"Domingo",Monday:"Segunda-feira",Tuesday:"Terça-feira",Wednesday:"Quarta-feira",Thursday:"Quinta-feira",Friday:"Sexta-feira",Saturday:"Sábado",Sun:"Dom",Mon:"Seg",Tue:"Ter",Wed:"Qua",Thu:"Qui",Fri:"Sex",Sat:"Sáb",_dateOrd:function(i){return"º"},"Zoom Out":"Reduzir Zoom",Play:"Play",Stop:"Parar",Legend:"Legenda","Click, tap or press ENTER to toggle":"Clique, toque ou pressione ENTER para alternar",Loading:"Carregando",Home:"Início",Chart:"Gráfico","Serial chart":"Gráfico Serial","X/Y chart":"Gráfico XY","Pie chart":"Gráfico de Pizza","Gauge chart":"Gráfico Indicador","Radar chart":"Gráfico de Radar","Sankey diagram":"Diagrama Sankey","Chord diagram":"Diagram Chord","Flow diagram":"Diagrama Flow","TreeMap chart":"Gráfico de Mapa de Árvore",Series:"Séries","Candlestick Series":"Séries do Candlestick","Column Series":"Séries de Colunas","Line Series":"Séries de Linhas","Pie Slice Series":"Séries de Fatias de Pizza","X/Y Series":"Séries de XY",Map:"Mapa","Press ENTER to zoom in":"Pressione ENTER para aumentar o zoom","Press ENTER to zoom out":"Pressione ENTER para diminuir o zoom","Use arrow keys to zoom in and out":"Use as setas para diminuir ou aumentar o zoom","Use plus and minus keys on your keyboard to zoom in and out":"Use as teclas mais ou menos no seu teclado para diminuir ou aumentar o zoom",Export:"Exportar",Image:"Imagem",Data:"Dados",Print:"Imprimir","Click, tap or press ENTER to open":"Clique, toque ou pressione ENTER para abrir","Click, tap or press ENTER to print.":"Clique, toque ou pressione ENTER para imprimir","Click, tap or press ENTER to export as %1.":"Clique, toque ou pressione ENTER para exportar como %1.",'To save the image, right-click this link and choose "Save picture as..."':'Para salvar a imagem, clique no link com o botão da direira e escolha "Salvar imagem como..."','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Para salvar, clique na imagem à esquerda com o botão direito e escolha "Salvar imagem como..."',"(Press ESC to close this message)":"(Pressione ESC para fechar esta mensagem)","Image Export Complete":"A exportação da imagem foi completada","Export operation took longer than expected. Something might have gone wrong.":"A exportação da imagem demorou mais do que o experado. Algo deve ter dado errado.","Saved from":"Salvo de",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"Use TAB para selecionar os botões ou setas para a direita ou esquerda para mudar a seleção","Use left and right arrows to move selection":"Use as setas para a esquerda ou direita para mover a seleção","Use left and right arrows to move left selection":"Use as setas para a esquerda ou direita para mover a seleção da esquerda","Use left and right arrows to move right selection":"Use as setas para a esquerda ou direita para mover a seleção da direita","Use TAB select grip buttons or up and down arrows to change selection":"Use TAB para selecionar os botões ou setas para cima ou para baixo para mudar a seleção","Use up and down arrows to move selection":"Use as setas para cima ou para baixo para mover a seleção","Use up and down arrows to move lower selection":"Use as setas para cima ou para baixo para mover a seleção de baixo","Use up and down arrows to move upper selection":"Use as setas para cima ou para baixo para mover a seleção de cima","From %1 to %2":"De %1 até %2","From %1":"De %1","To %1":"Até %1","No parser available for file: %1":"Nenhum interpretador está disponível para este arquivo: %1","Error parsing file: %1":"Erro ao analizar o arquivo: %1","Unable to load file: %1":"O arquivo não pôde ser carregado: %1","Invalid date":"Data inválida"}}(yl,UZ))!==void 0&&(nxt.exports=sxt);const i7i=e7i({__proto__:null,default:qa(UZ)},[UZ]),r7i=Object.freeze(Object.defineProperty({__proto__:null,p:i7i},Symbol.toStringTag,{value:"Module"}));function n7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var oxt,axt,jZ={},s7i={get exports(){return jZ},set exports(t){jZ=t}};oxt=s7i,(axt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"d.Hr.",_era_bc:"î.Hr.",A:"a.m.",P:"p.m.",AM:"a.m.",PM:"p.m.","A.M.":"a.m.","P.M.":"p.m.",January:"ianuarie",February:"februarie",March:"martie",April:"aprilie",May:"mai",June:"iunie",July:"iulie",August:"august",September:"septembrie",October:"octombrie",November:"noiembrie",December:"decembrie",Jan:"ian.",Feb:"feb.",Mar:"mar.",Apr:"apr.","May(short)":"mai",Jun:"iun.",Jul:"iul.",Aug:"aug.",Sep:"sept.",Oct:"oct.",Nov:"nov.",Dec:"dec.",Sunday:"duminică",Monday:"luni",Tuesday:"marți",Wednesday:"miercuri",Thursday:"joi",Friday:"vineri",Saturday:"sâmbătă",Sun:"dum.",Mon:"lun.",Tue:"mar.",Wed:"mie.",Thu:"joi",Fri:"vin.",Sat:"sâm.",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Zoom",Play:"Redare",Stop:"Oprire",Legend:"Legendă","Click, tap or press ENTER to toggle":"",Loading:"Se încarcă",Home:"Pagina principală",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Imprimare",Image:"Imagine",Data:"Date",Print:"Imprimare","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Din %1 la %2","From %1":"Din %1","To %1":"La %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,jZ))!==void 0&&(oxt.exports=axt);const o7i=n7i({__proto__:null,default:qa(jZ)},[jZ]),a7i=Object.freeze(Object.defineProperty({__proto__:null,r:o7i},Symbol.toStringTag,{value:"Module"}));function l7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var lxt,uxt,zZ={},u7i={get exports(){return zZ},set exports(t){zZ=t}};lxt=u7i,(uxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"dd MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"н.э.",_era_bc:"до н.э.",A:"У",P:"В",AM:"утра",PM:"вечера","A.M.":"до полудня","P.M.":"после полудня",January:"января",February:"февраля",March:"марта",April:"апреля",May:"мая",June:"июня",July:"июля",August:"августа",September:"сентября",October:"октября",November:"ноября",December:"декабря",Jan:"янв.",Feb:"февр.",Mar:"март",Apr:"апр.","May(short)":"май",Jun:"июнь",Jul:"июль",Aug:"авг.",Sep:"сент.",Oct:"окт.",Nov:"нояб.",Dec:"дек.",Sunday:"воскресенье",Monday:"понедельник",Tuesday:"вторник",Wednesday:"среда",Thursday:"четверг",Friday:"пятница",Saturday:"суббота",Sun:"вс.",Mon:"пн.",Tue:"вт.",Wed:"ср.",Thu:"чт.",Fri:"пт.",Sat:"сб.",_dateOrd:function(i){return"-ое"},"Zoom Out":"Уменьшить",Play:"Старт",Stop:"Стоп",Legend:"Легенда","Click, tap or press ENTER to toggle":"Щелкните, коснитесь или нажмите ВВОД, чтобы переключить",Loading:"Идет загрузка",Home:"Начало",Chart:"График","Serial chart":"Серийная диаграмма","X/Y chart":"Диаграмма X/Y","Pie chart":"Круговая диаграмма","Gauge chart":"Датчик-диаграмма","Radar chart":"Лепестковая диаграмма","Sankey diagram":"Диаграмма Сэнки","Chord diagram":"Диаграмма Chord","Flow diagram":"Диаграмма флоу","TreeMap chart":"Иерархическая диаграмма",Series:"Серия","Candlestick Series":"Серия-подсвечник","Column Series":"Столбчатая серия","Line Series":"Линейная серия","Pie Slice Series":"Круговая серия","X/Y Series":"X/Y серия",Map:"Карта","Press ENTER to zoom in":"Нажмите ВВОД чтобу увеличить","Press ENTER to zoom out":"Нажмите ВВОД чтобы уменьшить","Use arrow keys to zoom in and out":"Используйте клавиши-стрелки чтобы увеличить и уменьшить","Use plus and minus keys on your keyboard to zoom in and out":"Используйте клавиши плюс и минус на клавиатуре чтобы увеличить и уменьшить",Export:"Экспортировать",Image:"Изображение",Data:"Данные",Print:"Печатать","Click, tap or press ENTER to open":"Щелкните, коснитесь или нажмите ВВОД чтобы открыть","Click, tap or press ENTER to print.":"Щелкните, коснитесь или нажмите ВВОД чтобы распечатать","Click, tap or press ENTER to export as %1.":"Щелкните, коснитесь или нажмите ВВОД чтобы экспортировать как %1",'To save the image, right-click this link and choose "Save picture as..."':'Чтобы сохранить изображение, щелкните правой кнопкой на ссылке и выберите "Сохранить изображение как..."','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Чтобы сохранить изображение, щелкните правой кнопкой на картинке слева и выберите "Сохранить изображение как..."',"(Press ESC to close this message)":"(Нажмите ESC чтобы закрыть это сообщение)","Image Export Complete":"Экспорт изображения завершен","Export operation took longer than expected. Something might have gone wrong.":"Экспортирование заняло дольше, чем планировалось. Возможно что-то пошло не так.","Saved from":"Сохранено из",PNG:"PNG",JPG:"JPG",GIF:"GIF",SVG:"SVG",PDF:"PDF",JSON:"JSON",CSV:"CSV",XLSX:"XLSX","Use TAB to select grip buttons or left and right arrows to change selection":"Используйте клавишу TAB, чтобы выбрать рукоятки или клавиши стрелок влево и вправо, чтобы изменить выделение","Use left and right arrows to move selection":"Используйте стрелки влево-вправо, чтобы передвинуть выделение","Use left and right arrows to move left selection":"Используйте стрелки влево-вправо, чтобы передвинуть левое выделение","Use left and right arrows to move right selection":"Используйте стрелки влево-вправо, чтобы передвинуть правое выделение","Use TAB select grip buttons or up and down arrows to change selection":"Используйте TAB, чтобы выбрать рукоятки или клавиши вверх-вниз, чтобы изменить выделение","Use up and down arrows to move selection":"Используйте стрелки вверх-вниз, чтобы передвинуть выделение","Use up and down arrows to move lower selection":"Используйте стрелки вверх-вниз, чтобы передвинуть нижнее выделение","Use up and down arrows to move upper selection":"Используйте стрелки вверх-вниз, чтобы передвинуть верхнее выделение","From %1 to %2":"От %1 до %2","From %1":"От %1","To %1":"До %1","No parser available for file: %1":"Нет анализатора для файла: %1","Error parsing file: %1":"Ошибка при разборе файла: %1","Unable to load file: %1":"Не удалось загрузить файл: %1","Invalid date":"Некорректная дата"}}(yl,zZ))!==void 0&&(lxt.exports=uxt);const c7i=l7i({__proto__:null,default:qa(zZ)},[zZ]),h7i=Object.freeze(Object.defineProperty({__proto__:null,r:c7i},Symbol.toStringTag,{value:"Module"}));function d7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var cxt,hxt,HZ={},p7i={get exports(){return HZ},set exports(t){HZ=t}};cxt=p7i,(hxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n. l.",_era_bc:"pr. n. l.",A:"dop.",P:"odp.",AM:"dop.",PM:"odp.","A.M.":"dop.","P.M.":"odp.",January:"januára",February:"februára",March:"marca",April:"apríla",May:"mája",June:"júna",July:"júla",August:"augusta",September:"septembra",October:"októbra",November:"novembra",December:"decembra",Jan:"jan",Feb:"feb",Mar:"mar",Apr:"apr","May(short)":"máj",Jun:"jún",Jul:"júl",Aug:"aug",Sep:"sep",Oct:"okt",Nov:"nov",Dec:"dec",Sunday:"nedela",Monday:"pondelok",Tuesday:"utorok",Wednesday:"streda",Thursday:"štvrtok",Friday:"piatok",Saturday:"sobota",Sun:"ne",Mon:"po",Tue:"ut",Wed:"st",Thu:"št",Fri:"pi",Sat:"so",_dateOrd:function(i){return"."},"Zoom Out":"Zväčšenie",Play:"Prehrať",Stop:"Ukončiť iteráciu (Stop)",Legend:"Legenda","Click, tap or press ENTER to toggle":"",Loading:"Načítanie",Home:"Domov",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Export",Image:"Obrázok",Data:"Data",Print:"Tlač","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,HZ))!==void 0&&(cxt.exports=hxt);const f7i=d7i({__proto__:null,default:qa(HZ)},[HZ]),m7i=Object.freeze(Object.defineProperty({__proto__:null,s:f7i},Symbol.toStringTag,{value:"Module"}));function g7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var dxt,pxt,WZ={},y7i={get exports(){return WZ},set exports(t){WZ=t}};dxt=y7i,(pxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n. št.",_era_bc:"pr. n. št.",A:"A",P:"P",AM:"AM",PM:"PM","A.M.":"A.M.","P.M.":"P.M.",January:"Januar",February:"Februar",March:"Marec",April:"April",May:"Maj",June:"Junij",July:"Julij",August:"Avgust",September:"September",October:"Oktober",November:"November",December:"December",Jan:"Jan",Feb:"Feb",Mar:"Mar",Apr:"Apr","May(short)":"Maj",Jun:"Jun",Jul:"Jul",Aug:"Avg",Sep:"Sep",Oct:"Okt",Nov:"Nov",Dec:"Dec",Sunday:"Nedelja",Monday:"Ponedeljek",Tuesday:"Torek",Wednesday:"Sreda",Thursday:"Četrtek",Friday:"Petek",Saturday:"Sobota",Sun:"Ned",Mon:"Pon",Tue:"Tor",Wed:"Sre",Thu:"Čet",Fri:"Pet",Sat:"Sob",_dateOrd:function(i){return"."},"Zoom Out":"Oddalji pogled",Play:"Zaženi",Stop:"Ustavi",Legend:"Legenda","Click, tap or press ENTER to toggle":"Klikni, tapni ali pritisni ENTER za preklop",Loading:"Nalagam",Home:"Domov",Chart:"Graf","Serial chart":"Serijski graf","X/Y chart":"X/Y graf","Pie chart":"Tortni graf","Gauge chart":"Stevčni graf","Radar chart":"Radar graf","Sankey diagram":"Sankey diagram","Flow diagram":"Prikaz poteka","Chord diagram":"Kolobarni diagram","TreeMap chart":"Drevesi graf","Sliced chart":"Sliced graf",Series:"Serija","Candlestick Series":"Svečna serija","OHLC Series":"OHLC serija","Column Series":"Stolpičasta serija","Line Series":"Črtna serija","Pie Slice Series":"Tortna serija","Funnel Series":"Lijak serija","Pyramid Series":"Piramidna serija","X/Y Series":"X/Y serija",Map:"Mapa","Press ENTER to zoom in":"Pritisni ENTER za približevanje","Press ENTER to zoom out":"Pritisni ENTER za oddaljevanje","Use arrow keys to zoom in and out":"Uporabi smerne tiple za približevanje in oddaljevanje","Use plus and minus keys on your keyboard to zoom in and out":"Uporabi plus in minus tipke na tipkovnici za približevanje in oddaljevanje",Export:"Izvozi",Image:"Slika",Data:"Podatki",Print:"Natisni","Click, tap or press ENTER to open":"Klikni, tapni ali pritisni ENTER da odpreš.","Click, tap or press ENTER to print.":"Klikni, tapni ali pritisni ENTER za tiskanje.","Click, tap or press ENTER to export as %1.":"Klikni, tapni ali pritisni ENTER da izvoziš kot %1.",'To save the image, right-click this link and choose "Save picture as..."':'Da shraniš sliko, z desnim gumbom miške klikni to povezavo in izberi "Shrani sliko kot..."','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Da shraniš sliko, z desnim gumbom miške klikni sličico na levi in izberi "Shrani sliko kot..."',"(Press ESC to close this message)":"(Pritisni ESC da zapreš to sporočilo)","Image Export Complete":"Izvoz slike končan","Export operation took longer than expected. Something might have gone wrong.":"Operacija izvoza je trajala dlje kot pričakovano. Nekaj je šlo narobe.","Saved from":"Shranjeno od",PNG:"PNG",JPG:"JPG",GIF:"GIF",SVG:"SVG",PDF:"PDF",JSON:"JSON",CSV:"CSV",XLSX:"XLSX","Use TAB to select grip buttons or left and right arrows to change selection":"Uporabi TAB za izbiro drsnih gumbov ali levo in desno smerno tipko da spremeniš izbiro","Use left and right arrows to move selection":"Uporabi levo in desno smerno tipko za premik izbranega","Use left and right arrows to move left selection":"Uporabi levo in desno smerno tipko za premik leve izbire","Use left and right arrows to move right selection":"Uporabi levo in desno smerno tipko za premik desne izbire","Use TAB select grip buttons or up and down arrows to change selection":"Uporabi TAB za izbiro drsnih gumbov ali gor in dol smerno tipko da spremeniš izbiro","Use up and down arrows to move selection":"Uporabi gor in dol smerne tipke za premik izbire","Use up and down arrows to move lower selection":"Uporabi gor in dol smerne tipke za premik spodnje izbire","Use up and down arrows to move upper selection":"Uporabi gor in dol smerne tipke za premik zgornje izbire","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"Nobenega parserja ni na voljo za datoteko: %1","Error parsing file: %1":"Napaka pri parsanju datoteke: %1","Unable to load file: %1":"Ni mogoče naložiti datoteke: %1","Invalid date":"Neveljaven datum"}}(yl,WZ))!==void 0&&(dxt.exports=pxt);const v7i=g7i({__proto__:null,default:qa(WZ)},[WZ]),_7i=Object.freeze(Object.defineProperty({__proto__:null,s:v7i},Symbol.toStringTag,{value:"Module"}));function b7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var fxt,mxt,qZ={},w7i={get exports(){return qZ},set exports(t){qZ=t}};fxt=w7i,(mxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"н. е.",_era_bc:"п. н. е.",A:"a",P:"p",AM:"пре подне",PM:"по подне","A.M.":"пре подне","P.M.":"по подне",January:"јануар",February:"фебруар",March:"март",April:"април",May:"мај",June:"јун",July:"јул",August:"август",September:"септембар",October:"октобар",November:"новембар",December:"децембар",Jan:"јан",Feb:"феб",Mar:"мар",Apr:"апр","May(short)":"мај",Jun:"јун",Jul:"јул",Aug:"авг",Sep:"сеп",Oct:"окт",Nov:"нов",Dec:"дец",Sunday:"недеља",Monday:"понедељак",Tuesday:"уторак",Wednesday:"среда",Thursday:"четвртак",Friday:"петак",Saturday:"субота",Sun:"нед",Mon:"пон",Tue:"уто",Wed:"сре",Thu:"чет",Fri:"пет",Sat:"суб",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Zumiranje",Play:"Reprodukuj",Stop:"Zaustavi",Legend:"Legenda","Click, tap or press ENTER to toggle":"",Loading:"Učitavanje",Home:"Matična stranica",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Štampaj",Image:"Snimak",Data:"Podaci",Print:"Štampaj","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Iz %1 u %2","From %1":"Iz %1","To %1":"U %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,qZ))!==void 0&&(fxt.exports=mxt);const x7i=b7i({__proto__:null,default:qa(qZ)},[qZ]),S7i=Object.freeze(Object.defineProperty({__proto__:null,s:x7i},Symbol.toStringTag,{value:"Module"}));function C7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var gxt,yxt,YZ={},T7i={get exports(){return YZ},set exports(t){YZ=t}};gxt=T7i,(yxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"yyyy-MM-dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"e.Kr.",_era_bc:"f.Kr.",A:"fm",P:"em",AM:"fm",PM:"em","A.M.":"f.m.","P.M.":"e.m.",January:"januari",February:"februari",March:"mars",April:"april",May:"maj",June:"juni",July:"juli",August:"augusti",September:"september",October:"oktober",November:"november",December:"december",Jan:"jan.",Feb:"feb.",Mar:"mars",Apr:"apr.","May(short)":"maj",Jun:"juni",Jul:"juli",Aug:"aug.",Sep:"sep.",Oct:"okt.",Nov:"nov.",Dec:"dec.",Sunday:"söndag",Monday:"måndag",Tuesday:"tisdag",Wednesday:"onsdag",Thursday:"torsdag",Friday:"fredag",Saturday:"lördag",Sun:"sön",Mon:"mån",Tue:"tis",Wed:"ons",Thu:"tor",Fri:"fre",Sat:"lör",_dateOrd:function(i){return""},"Zoom Out":"Zooma ut",Play:"Spela",Stop:"Stoppa",Legend:"Teckenförklaring","Click, tap or press ENTER to toggle":"Klicka eller tryck ENTER för att ändra",Loading:"Läser in",Home:"Hem",Chart:"Diagram","Serial chart":"Seriediagram","X/Y chart":"XY-diagram","Pie chart":"Tårtdiagram","Gauge chart":"Instrumentdiagram","Radar chart":"Radardiagram","Sankey diagram":"Sankeydiagram","Chord diagram":"Strängdiagram","Flow diagram":"Flödesschema","TreeMap chart":"Träddiagram ",Series:"Serier","Candlestick Series":"Candlestick-serier","Column Series":"Kolumnserier","Line Series":"Linjeserier","Pie Slice Series":"Tårtserier","X/Y Series":"X/Y-serier",Map:"Karta","Press ENTER to zoom in":"Tryck RETUR för att zooma in","Press ENTER to zoom out":"Tryck RETUR för att zooma ut","Use arrow keys to zoom in and out":"Använd pil-knapparna för att zooma in och ut","Use plus and minus keys on your keyboard to zoom in and out":"Använd plus- och minus-knapparna för att zooma in och ut",Export:"Exportera",Image:"Bild",Data:"Data",Print:"Skriv ut","Click, tap or press ENTER to open":"Klicka eller tryck ENTER för att öppna","Click, tap or press ENTER to print.":"Klicka eller tryck ENTER för att skriva ut.","Click, tap or press ENTER to export as %1.":"Klicka eller tryck ENTER för att exportera till %1.",'To save the image, right-click this link and choose "Save picture as..."':'För att spara bilden, höger-klicka länken och välj "Spara bild som..."','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'För att spara bilden, höger-klicka miniatyrbilden till vänster och välj "Spara bild som..."',"(Press ESC to close this message)":"(Tryck ESC för att stänga)","Image Export Complete":"Bildexport klar","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"Sparad från",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"Använd vänster och höger pilknappar för att flytta urvalet","Use left and right arrows to move left selection":"Använd vänster och höger pilknappar för att flytta vänsterurval","Use left and right arrows to move right selection":"Använd vänster och höger pilknappar för att flytta högerurval","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"Använd upp och ner pilknappar för att flytta urvalet","Use up and down arrows to move lower selection":"Använd upp och ner pilknappar för att flytta nedre urvalet","Use up and down arrows to move upper selection":"Använd upp och ner pilknappar för att flytta övre urvalet","From %1 to %2":"Från %1 till %2","From %1":"Från %1","To %1":"Till %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"Ogiltigt datum"}}(yl,YZ))!==void 0&&(gxt.exports=yxt);const E7i=C7i({__proto__:null,default:qa(YZ)},[YZ]),I7i=Object.freeze(Object.defineProperty({__proto__:null,s:E7i},Symbol.toStringTag,{value:"Module"}));function A7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var vxt,_xt,XZ={},P7i={get exports(){return XZ},set exports(t){XZ=t}};vxt=P7i,(_xt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"ค.ศ.",_era_bc:"ก่อน ค.ศ.",A:"a",P:"p",AM:"ก่อนเที่ยง",PM:"หลังเที่ยง","A.M.":"ก่อนเที่ยง","P.M.":"หลังเที่ยง",January:"มกราคม",February:"กุมภาพันธ์",March:"มีนาคม",April:"เมษายน",May:"พฤษภาคม",June:"มิถุนายน",July:"กรกฎาคม",August:"สิงหาคม",September:"กันยายน",October:"ตุลาคม",November:"พฤศจิกายน",December:"ธันวาคม",Jan:"ม.ค.",Feb:"ก.พ.",Mar:"มี.ค.",Apr:"เม.ย.","May(short)":"พ.ค.",Jun:"มิ.ย.",Jul:"ก.ค.",Aug:"ส.ค.",Sep:"ก.ย.",Oct:"ต.ค.",Nov:"พ.ย.",Dec:"ธ.ค.",Sunday:"วันอาทิตย์",Monday:"วันจันทร์",Tuesday:"วันอังคาร",Wednesday:"วันพุธ",Thursday:"วันพฤหัสบดี",Friday:"วันศุกร์",Saturday:"วันเสาร์",Sun:"อา.",Mon:"จ.",Tue:"อ.",Wed:"พ.",Thu:"พฤ.",Fri:"ศ.",Sat:"ส.",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"ขยาย",Play:"เล่น",Stop:"หยุด",Legend:"คำอธิบายสัญลักษณ์","Click, tap or press ENTER to toggle":"",Loading:"กำลังโหลด",Home:"หน้าหลัก",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"พิมพ์",Image:"รูปภาพ",Data:"ข้อมูล",Print:"พิมพ์","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"จาก %1 ถึง %2","From %1":"จาก %1","To %1":"ถึง %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,XZ))!==void 0&&(vxt.exports=_xt);const O7i=A7i({__proto__:null,default:qa(XZ)},[XZ]),R7i=Object.freeze(Object.defineProperty({__proto__:null,t:O7i},Symbol.toStringTag,{value:"Module"}));function M7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var bxt,wxt,KZ={},D7i={get exports(){return KZ},set exports(t){KZ=t}};bxt=D7i,(wxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:"%",_percentSuffix:null,_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"MS",_era_bc:"MÖ",A:"öö",P:"ös",AM:"ÖÖ",PM:"ÖS","A.M.":"ÖÖ","P.M.":"ÖS",January:"Ocak",February:"Şubat",March:"Mart",April:"Nisan",May:"Mayıs",June:"Haziran",July:"Temmuz",August:"Ağustos",September:"Eylül",October:"Ekim",November:"Kasım",December:"Aralık",Jan:"Oca",Feb:"Şub",Mar:"Mar",Apr:"Nis","May(short)":"May",Jun:"Haz",Jul:"Tem",Aug:"Ağu",Sep:"Eyl",Oct:"Eki",Nov:"Kas",Dec:"Ara",Sunday:"Pazar",Monday:"Pazartesi",Tuesday:"Salı",Wednesday:"Çarşamba",Thursday:"Perşembe",Friday:"Cuma",Saturday:"Cumartesi",Sun:"Paz",Mon:"Pzt",Tue:"Sal",Wed:"Çar",Thu:"Per",Fri:"Cum",Sat:"Cmt",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Yakınlaştır",Play:"Oynat",Stop:"Durdur",Legend:"Gösterge","Click, tap or press ENTER to toggle":"",Loading:"Yükleniyor",Home:"Giriş Sayfası",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Yazdır",Image:"Görüntü",Data:"Veri",Print:"Yazdır","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Kaynak %1 hedef %2","From %1":"Kaynak %1","To %1":"Hedef %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,KZ))!==void 0&&(bxt.exports=wxt);const F7i=M7i({__proto__:null,default:qa(KZ)},[KZ]),L7i=Object.freeze(Object.defineProperty({__proto__:null,t:F7i},Symbol.toStringTag,{value:"Module"}));function k7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var xxt,Sxt,JZ={},N7i={get exports(){return JZ},set exports(t){JZ=t}};xxt=N7i,(Sxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"н. е.",_era_bc:"до н. е.",A:"дп",P:"пп",AM:"дп",PM:"пп","A.M.":"дп","P.M.":"пп",January:"січня",February:"лютого",March:"березня",April:"квітня",May:"травня",June:"червня",July:"липня",August:"серпня",September:"вересня",October:"жовтня",November:"листопада",December:"грудня",Jan:"січ.",Feb:"лют.",Mar:"бер.",Apr:"квіт.","May(short)":"трав.",Jun:"черв.",Jul:"лип.",Aug:"серп.",Sep:"вер.",Oct:"жовт.",Nov:"лист.",Dec:"груд.",Sunday:"неділя",Monday:"понеділок",Tuesday:"вівторок",Wednesday:"середа",Thursday:"четвер",Friday:"пʼятниця",Saturday:"субота",Sun:"нд",Mon:"пн",Tue:"вт",Wed:"ср",Thu:"чт",Fri:"пт",Sat:"сб",_dateOrd:function(i){return""},"Zoom Out":"Масштабування",Play:"Відтворювати",Stop:"Зупинка",Legend:"Легенда","Click, tap or press ENTER to toggle":"",Loading:"Завантажується",Home:"Головна сторінка",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"карта","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Друк",Image:"Зображення",Data:"Дані",Print:"Друк","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Від %1 до %2","From %1":"Від %1","To %1":"До %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,JZ))!==void 0&&(xxt.exports=Sxt);const $7i=k7i({__proto__:null,default:qa(JZ)},[JZ]),B7i=Object.freeze(Object.defineProperty({__proto__:null,u:$7i},Symbol.toStringTag,{value:"Module"}));function G7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Cxt,Txt,ZZ={},V7i={get exports(){return ZZ},set exports(t){ZZ=t}};Cxt=V7i,(Txt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"sau CN",_era_bc:"Trước CN",A:"s",P:"c",AM:"SA",PM:"CH","A.M.":"SA","P.M.":"CH",January:"tháng 1",February:"tháng 2",March:"tháng 3",April:"tháng 4",May:"tháng 5",June:"tháng 6",July:"tháng 7",August:"tháng 8",September:"tháng 9",October:"tháng 10",November:"tháng 11",December:"tháng 12",Jan:"thg 1",Feb:"thg 2",Mar:"thg 3",Apr:"thg 4","May(short)":"thg 5",Jun:"thg 6",Jul:"thg 7",Aug:"thg 8",Sep:"thg 9",Oct:"thg 10",Nov:"thg 11",Dec:"thg 12",Sunday:"Chủ Nhật",Monday:"Thứ Hai",Tuesday:"Thứ Ba",Wednesday:"Thứ Tư",Thursday:"Thứ Năm",Friday:"Thứ Sáu",Saturday:"Thứ Bảy",Sun:"CN",Mon:"Th 2",Tue:"Th 3",Wed:"Th 4",Thu:"Th 5",Fri:"Th 6",Sat:"Th 7",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Thu phóng",Play:"Phát",Stop:"Dừng",Legend:"Chú giải","Click, tap or press ENTER to toggle":"",Loading:"Đang tải",Home:"Trang chủ",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"In",Image:"Hình ảnh",Data:"Dữ liệu",Print:"In","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Từ %1 đến %2","From %1":"Từ %1","To %1":"Đến %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,ZZ))!==void 0&&(Cxt.exports=Txt);const U7i=G7i({__proto__:null,default:qa(ZZ)},[ZZ]),j7i=Object.freeze(Object.defineProperty({__proto__:null,v:U7i},Symbol.toStringTag,{value:"Module"}));function z7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Ext,Ixt,QZ={},H7i={get exports(){return QZ},set exports(t){QZ=t}};Ext=H7i,(Ixt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"公元",_era_bc:"公元前",A:"上午",P:"下午",AM:"上午",PM:"下午","A.M.":"上午","P.M.":"下午",January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月",Jan:"1月",Feb:"2月",Mar:"3月",Apr:"4月","May(short)":"5月",Jun:"6月",Jul:"7月",Aug:"8月",Sep:"9月",Oct:"10月",Nov:"11月",Dec:"12月",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",Sun:"周日",Mon:"周一",Tue:"周二",Wed:"周三",Thu:"周四",Fri:"周五",Sat:"周六",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:case 2:case 3:r="日"}return r},"Zoom Out":"缩放",Play:"播放",Stop:"停靠点",Legend:"图例","Click, tap or press ENTER to toggle":"",Loading:"加载",Home:"主页",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"打印",Image:"影像",Data:"数据",Print:"打印","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"自 %1 至 %2","From %1":"自 %1","To %1":"至 %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,QZ))!==void 0&&(Ext.exports=Ixt);const W7i=z7i({__proto__:null,default:qa(QZ)},[QZ]),q7i=Object.freeze(Object.defineProperty({__proto__:null,z:W7i},Symbol.toStringTag,{value:"Module"}));function Y7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Axt,Pxt,eQ={},X7i={get exports(){return eQ},set exports(t){eQ=t}};Axt=X7i,(Pxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"西元",_era_bc:"西元前",A:"上午",P:"下午",AM:"上午",PM:"下午","A.M.":"上午","P.M.":"下午",January:"1月",February:"2月",March:"3月",April:"4月",May:"5月",June:"6月",July:"7月",August:"8月",September:"9月",October:"10月",November:"11月",December:"12月",Jan:"1月",Feb:"2月",Mar:"3月",Apr:"4月","May(short)":"5月",Jun:"6月",Jul:"7月",Aug:"8月",Sep:"9月",Oct:"10月",Nov:"11月",Dec:"12月",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",Sun:"週日",Mon:"週一",Tue:"週二",Wed:"週三",Thu:"週四",Fri:"週五",Sat:"週六",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:case 2:case 3:r="日"}return r},"Zoom Out":"縮放",Play:"播放",Stop:"停止",Legend:"圖例","Click, tap or press ENTER to toggle":"",Loading:"正在載入",Home:"首頁",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"列印",Image:"影像",Data:"資料",Print:"列印","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"從 %1 至 %2","From %1":"從 %1","To %1":"至 %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(yl,eQ))!==void 0&&(Axt.exports=Pxt);const K7i=Y7i({__proto__:null,default:qa(eQ)},[eQ]),Oxt=Object.freeze(Object.defineProperty({__proto__:null,z:K7i},Symbol.toStringTag,{value:"Module"}));function J7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Rxt,Rfe={};Rxt=()=>(()=>{var t,e,i,r,n={},s={};function o(j){var R=s[j];if(R!==void 0)return R.exports;var u=s[j]={exports:{}};return n[j].call(u.exports,u,u.exports,o),u.exports}o.m=n,o.n=j=>{var R=j&&j.__esModule?()=>j.default:()=>j;return o.d(R,{a:R}),R},e=Object.getPrototypeOf?j=>Object.getPrototypeOf(j):j=>j.__proto__,o.t=function(j,R){if(1&R&&(j=this(j)),8&R||typeof j=="object"&&j&&(4&R&&j.__esModule||16&R&&typeof j.then=="function"))return j;var u=Object.create(null);o.r(u);var w={};t=t||[null,e({}),e([]),e(e)];for(var $=2&R&&j;typeof $=="object"&&!~t.indexOf($);$=e($))Object.getOwnPropertyNames($).forEach(U=>w[U]=()=>j[U]);return w.default=()=>j,o.d(u,w),u},o.d=(j,R)=>{for(var u in R)o.o(R,u)&&!o.o(j,u)&&Object.defineProperty(j,u,{enumerable:!0,get:R[u]})},o.f={},o.e=j=>Promise.all(Object.keys(o.f).reduce((R,u)=>(o.f[u](j,R),R),[])),o.u=j=>({265:"canvg",297:"xlsx",643:"pdfmake"}[j]||j)+".js",o.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),o.o=(j,R)=>Object.prototype.hasOwnProperty.call(j,R),i={},r="EsriAmCharts:",o.l=(j,R,u,w)=>{if(i[j])i[j].push(R);else{var $,U;if(u!==void 0)for(var K=document.getElementsByTagName("script"),ie=0;ie{$.onerror=$.onload=null,clearTimeout(Re);var Qe=i[j];if(delete i[j],$.parentNode&&$.parentNode.removeChild($),Qe&&Qe.forEach(dt=>dt(Xe)),$e)return $e(Xe)},Re=setTimeout(we.bind(null,void 0,{type:"timeout",target:$}),12e4);$.onerror=we.bind(null,$.onerror),$.onload=we.bind(null,$.onload),U&&document.head.appendChild($)}},o.r=j=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(j,"__esModule",{value:!0})},o.p="",(()=>{var j={826:0};o.f.j=(w,$)=>{var U=o.o(j,w)?j[w]:void 0;if(U!==0)if(U)$.push(U[2]);else{var K=new Promise((we,Re)=>U=j[w]=[we,Re]);$.push(U[2]=K);var ie=o.p+o.u(w),ae=new Error;o.l(ie,we=>{if(o.o(j,w)&&((U=j[w])!==0&&(j[w]=void 0),U)){var Re=we&&(we.type==="load"?"missing":we.type),$e=we&&we.target&&we.target.src;ae.message="Loading chunk "+w+` failed. -(`+Re+": "+$e+")",ae.name="ChunkLoadError",ae.type=Re,ae.request=$e,U[1](ae)}},"chunk-"+w,w)}};var R=(w,$)=>{var U,K,[ie,ae,we]=$,Re=0;if(ie.some($e=>j[$e]!==0)){for(U in ae)o.o(ae,U)&&(o.m[U]=ae[U]);we&&we(o)}for(w&&w($);ReX,am4core:()=>Y,am4themes_animated:()=>u9e,am4themes_dark:()=>Gx});var l={};o.r(l),o.d(l,{castNumber:()=>$t,castString:()=>Pt,checkArray:()=>tt,checkBoolean:()=>Ge,checkDate:()=>ft,checkNumber:()=>Je,checkObject:()=>et,checkString:()=>ze,getDefault:()=>Ae,getType:()=>Oe,getValue:()=>Be,getValueDefault:()=>mt,hasValue:()=>Ee,isArray:()=>pt,isDate:()=>kt,isNaN:()=>Pe,isNumber:()=>le,isObject:()=>it,isString:()=>ct,toBoolean:()=>St,toNumber:()=>Tt,toNumberOrPercent:()=>at,toText:()=>Lt});var c={};o.r(c),o.d(c,{DEGREES:()=>Ze,HALFPI:()=>ce,PI:()=>Le,RADIANS:()=>Ce,adjustTension:()=>Ot,ceil:()=>At,closest:()=>T,cos:()=>A,fitAngleToRange:()=>Jt,fitToRange:()=>gt,getAngle:()=>ue,getArcPoint:()=>ti,getArcRect:()=>Xt,getBBox:()=>De,getCenterShift:()=>be,getCommonRectangle:()=>qe,getCubicControlPointA:()=>Vt,getCubicControlPointB:()=>Ke,getCubicCurveDistance:()=>B,getDistance:()=>C,getHorizontalDistance:()=>D,getLineIntersection:()=>Fi,getMidPoint:()=>Z,getPointOnCubicCurve:()=>Dt,getPointOnQuadraticCurve:()=>rt,getRotation:()=>oe,getScale:()=>q,getVerticalDistance:()=>F,intersect:()=>b,intersection:()=>_,invertRange:()=>m,isInRectangle:()=>bi,max:()=>ve,min:()=>W,normalizeAngle:()=>ei,round:()=>Ve,sin:()=>Ue,stretch:()=>ii,tan:()=>ni,toNumberRange:()=>yt});var d={};o.r(d),o.d(d,{add:()=>Qo,any:()=>er,copy:()=>H,each:()=>mi,eachContinue:()=>Lr,eachReverse:()=>dn,find:()=>wi,findIndex:()=>Ha,first:()=>is,getSortedIndex:()=>zt,has:()=>li,indexOf:()=>Ri,insert:()=>Hn,insertIndex:()=>Ta,keepIf:()=>Mr,last:()=>kr,map:()=>ar,move:()=>Ur,pushAll:()=>Kn,remove:()=>$i,removeIndex:()=>ea,replace:()=>In,setIndex:()=>En,shiftLeft:()=>xo,shuffle:()=>_t,slice:()=>xr,toArray:()=>Xi});var p={};o.r(p),o.d(p,{clone:()=>Kr,copy:()=>Wr,copyAllProperties:()=>Ms,copyProperties:()=>Cr,each:()=>gi,eachContinue:()=>_i,eachOrdered:()=>_r,entries:()=>Pu,forceCopyProperties:()=>Rs,getKey:()=>fi,hasKey:()=>ju,keys:()=>$o,keysOrdered:()=>mc,merge:()=>Gr,softCopyProperties:()=>Wn});var y={};o.r(y),o.d(y,{ListIterator:()=>Qp,concat:()=>Cf,contains:()=>_p,each:()=>pr,eachContinue:()=>Na,filter:()=>Nc,find:()=>qm,findIndex:()=>Ig,findMap:()=>ec,flatten:()=>Jp,foldl:()=>nd,fromArray:()=>Vo,indexed:()=>ch,join:()=>cu,length:()=>Pc,map:()=>uh,max:()=>sd,min:()=>$l,sort:()=>Uo,toArray:()=>Ea});var v={};o.r(v),o.d(v,{order:()=>Ph,random:()=>Pg,repeat:()=>Ag});var S={};o.r(S),o.d(S,{order:()=>ih});var I={};o.r(I),o.d(I,{brighten:()=>pe,getBrightnessStep:()=>Fe,getLightnessStep:()=>ji,hexToRgb:()=>Xm,hexToRgbWithAlpha:()=>Xd,hslToRgb:()=>bt,hsvToRgb:()=>se,interpolate:()=>qt,isLight:()=>me,lighten:()=>Ai,pad2:()=>Ht,rgb:()=>Oc,rgbToHex:()=>Py,rgbToHsl:()=>ne,rgbToHsv:()=>Q,rgbToRGBA:()=>Rg,rgbaToRgb:()=>Tf,saturate:()=>We});var O={};o.r(O),o.d(O,{anyToDate:()=>Oy,anyToNumber:()=>It,camelToDashed:()=>Rh,capitalize:()=>ic,cleanFormat:()=>Fh,copy:()=>tl,copyProperties:()=>tn,decimalPlaces:()=>k$,documentPointToSprite:()=>Mb,documentPointToSvg:()=>tu,escapeForRgex:()=>Gl,fitNumber:()=>Mg,fitNumberRelative:()=>F0,get12Hours:()=>gs,getBaseURI:()=>Ds,getDayFromWeek:()=>ms,getFormat:()=>uo,getMonthWeek:()=>Vn,getPixelRatio:()=>Er,getTimeZone:()=>ma,getWeek:()=>Pr,getYearDay:()=>Bi,height:()=>Ry,isIE:()=>ZS,isNotEmpty:()=>Ks,joinUrl:()=>d3,ltrim:()=>Md,numberToString:()=>Kd,padString:()=>Vl,parseUrl:()=>g4,plainText:()=>Lh,random:()=>il,relativeRadiusToValue:()=>yo,relativeToValue:()=>hs,reverseString:()=>vl,rtrim:()=>Dh,serializeUrl:()=>bn,softCopyProperties:()=>Po,splitTextByCharCount:()=>Mh,spritePointToDocument:()=>cr,spritePointToSprite:()=>wp,spritePointToSvg:()=>hm,spriteRectToSvg:()=>nt,stringify:()=>Ru,stripHash:()=>kn,stripTags:()=>vu,svgPointToDocument:()=>L0,svgPointToSprite:()=>If,svgRectToSprite:()=>h3,trim:()=>Ef,truncateWithEllipsis:()=>Rd,unquote:()=>$c,used:()=>qr,valueToRelative:()=>rh,width:()=>ds});var L={};o.r(L),o.d(L,{bounceIn:()=>ga,bounceInOut:()=>f3,bounceOut:()=>_I,circleIn:()=>tz,circleInOut:()=>b4,circleOut:()=>zr,cubicIn:()=>_4,cubicInOut:()=>Sa,cubicOut:()=>kv,elasticIn:()=>w4,elasticInOut:()=>iz,elasticOut:()=>B$,expIn:()=>mI,expInOut:()=>k0,expOut:()=>gI,linear:()=>ph,polyIn:()=>N$,polyIn3:()=>Km,polyInOut:()=>f1,polyInOut3:()=>$$,polyOut:()=>co,polyOut3:()=>y4,quadIn:()=>fI,quadInOut:()=>kh,quadOut:()=>p3,sinIn:()=>My,sinInOut:()=>yI,sinOut:()=>v4});var N={};o.r(N),o.d(N,{add:()=>xp,checkChange:()=>EI,copy:()=>iC,getDuration:()=>Du,getNextUnit:()=>A4,getTime:()=>Jm,getTimezoneMinutes:()=>cz,now:()=>TI,round:()=>od,setTimezone:()=>w3,timeUnitDurations:()=>I4});var G={};o.r(G),o.d(G,{load:()=>si,readBlob:()=>Un});var V={};o.r(V),o.d(V,{arc:()=>lC,arcTo:()=>Dd,arcToPoint:()=>$0,closePath:()=>X8e,cubicCurveTo:()=>C3,lineTo:()=>br,moveTo:()=>ln,pathToPoints:()=>K8e,pointsToPath:()=>Z8e,polyline:()=>L4,quadraticCurveTo:()=>aC,rectToPath:()=>uC,rectangle:()=>mz,spiralPoints:()=>J8e});var Y={};o.r(Y),o.d(Y,{AMElement:()=>CI,Adapter:()=>tc,Animation:()=>dm,BaseObject:()=>Wt,BaseObjectEvents:()=>pi,Basis:()=>Q8e,BlurFilter:()=>Q0e,Button:()=>oC,CSVParser:()=>sC,Cache:()=>dl,Circle:()=>FI,CirclePattern:()=>t8,CloseButton:()=>W0e,Color:()=>Te,ColorModifier:()=>Bn,ColorSet:()=>Qm,ColorizeFilter:()=>Z0e,Component:()=>DI,Cone:()=>_z,Container:()=>Zn,CounterDisposer:()=>ws,DATE:()=>sr,DURATION:()=>tr,DataItem:()=>MI,DataLoader:()=>V0e,DataParser:()=>Xte,DataSource:()=>pz,DateFormatter:()=>AI,DesaturateFilter:()=>i8,Dictionary:()=>fa,DictionaryDisposer:()=>Yd,DictionaryTemplate:()=>cm,Disposer:()=>jr,DropShadowFilter:()=>Zte,DurationFormatter:()=>F4,Ellipse:()=>fz,EventDispatcher:()=>Ts,Export:()=>Lg,ExportMenu:()=>jt,Filter:()=>hC,FocusFilter:()=>eve,GlobalAdapter:()=>Wa,Group:()=>T4,Image:()=>X$,IndexedIterable:()=>tf,Inertia:()=>E4,Interaction:()=>q$,InteractionKeyboardObject:()=>W$,InteractionObject:()=>H$,InteractionObjectEventDispatcher:()=>b3,InterfaceColorSet:()=>$a,JSONParser:()=>S3,Keyboard:()=>uz,Label:()=>Zm,Language:()=>y1,LightenFilter:()=>bz,Line:()=>Nv,LinePattern:()=>nie,LinearGradient:()=>Dy,LinearGradientModifier:()=>$4,List:()=>Us,ListDisposer:()=>ta,ListGrouper:()=>Og,ListIterator:()=>Qp,ListTemplate:()=>Xs,Modal:()=>Y$,Morpher:()=>H0e,MouseCursorStyle:()=>_l,MultiDisposer:()=>Nn,MutableValueDisposer:()=>Jn,NUMBER:()=>zi,NumberFormatter:()=>x3,OrderedList:()=>Ql,OrderedListTemplate:()=>Ym,PLACEHOLDER:()=>Sr,PLACEHOLDER2:()=>lr,PX:()=>di,Paper:()=>nC,Pattern:()=>g1,PatternSet:()=>sie,Percent:()=>J,PlayButton:()=>tie,Plugin:()=>tve,PointedRectangle:()=>z0e,PointedShape:()=>j0e,Polyarc:()=>Kte,Polygon:()=>T3,Polyline:()=>k4,Polyspline:()=>N4,Popup:()=>N0,Preloader:()=>cC,RadialGradient:()=>Fy,RadialGradientModifier:()=>rie,RectPattern:()=>kg,Rectangle:()=>OI,Rectangle3D:()=>$b,Registry:()=>dh,ResizeButton:()=>K$,Responsive:()=>U0e,ResponsiveBreakpoints:()=>Af,RoundedRectangle:()=>Nb,STRING:()=>Oi,SVGContainer:()=>kb,SVGDefaults:()=>x4,Scrollbar:()=>B0,Slice:()=>LI,Slice3D:()=>J0e,Slider:()=>Jte,SortedList:()=>Ou,SortedListTemplate:()=>th,Sprite:()=>so,SpriteEventDispatcher:()=>rz,SpriteState:()=>Nr,StyleClass:()=>z$,StyleRule:()=>Ns,SwitchButton:()=>J$,System:()=>G0e,TargetedEventDispatcher:()=>xa,Tension:()=>_1,TextFormatter:()=>D4,TextLink:()=>gz,Tooltip:()=>kI,Trapezoid:()=>yz,Triangle:()=>Z$,Validatable:()=>xt,WavedCircle:()=>Q$,WavedLine:()=>Tr,WavedRectangle:()=>e8,ZoomOutButton:()=>eie,addClass:()=>Fb,addLicense:()=>o9e,animate:()=>Db,array:()=>d,blur:()=>eC,cache:()=>ef,castColor:()=>ot,castNumber:()=>$t,castString:()=>Pt,checkBoolean:()=>Ge,checkNumber:()=>Je,checkObject:()=>et,checkString:()=>ze,color:()=>He,colors:()=>I,copyAttributes:()=>Nh,create:()=>e9e,createDeferred:()=>i9e,createFromConfig:()=>t9e,dataLoader:()=>RI,defaultRules:()=>Zd,disposeAllCharts:()=>r8,ease:()=>L,fixPixelPerfect:()=>j$,focus:()=>C4,getElement:()=>U$,getInteraction:()=>Vs,getTextFormatter:()=>v1,globalAdapter:()=>Oh,is:()=>pl,isArray:()=>pt,isColor:()=>Ye,isElement:()=>m1,isNaN:()=>Pe,isNumber:()=>le,isObject:()=>it,isPercent:()=>xe,isString:()=>ct,iter:()=>y,join:()=>cu,keyboard:()=>Dg,math:()=>c,max:()=>sd,min:()=>$l,net:()=>G,nextFrame:()=>pn,number:()=>S,object:()=>p,options:()=>no,or:()=>eu,outerHTML:()=>xI,path:()=>V,percent:()=>he,readFrame:()=>$n,ready:()=>SI,registry:()=>ui,removeClass:()=>QS,reverse:()=>yu,string:()=>v,system:()=>ia,time:()=>N,triggerIdle:()=>No,type:()=>l,unuseAllThemes:()=>s9e,unuseTheme:()=>n9e,useTheme:()=>r9e,utils:()=>O,viewPortHandler:()=>E3,whenIdle:()=>An,writeFrame:()=>ko});var X={};o.r(X),o.d(X,{Axis:()=>l8,AxisBreak:()=>a8,AxisBullet:()=>V4,AxisDataItem:()=>dC,AxisFill:()=>Cz,AxisFillCircular:()=>yie,AxisLabel:()=>Tz,AxisLabelCircular:()=>p8,AxisLine:()=>die,AxisRenderer:()=>u8,AxisRendererCircular:()=>vie,AxisRendererRadial:()=>f8,AxisRendererX:()=>Fd,AxisRendererX3D:()=>A3,AxisRendererY:()=>w1,AxisRendererY3D:()=>Pie,AxisTick:()=>Ez,Bullet:()=>Oo,Candlestick:()=>b8,CandlestickSeries:()=>Rie,CandlestickSeriesDataItem:()=>W4,CategoryAxis:()=>$h,CategoryAxisBreak:()=>mie,CategoryAxisDataItem:()=>Nx,Chart:()=>kx,ChartDataItem:()=>uie,ChordDiagram:()=>fve,ChordDiagramDataItem:()=>pve,ChordLink:()=>Gz,ChordNode:()=>Bz,CircleBullet:()=>Yz,ClockHand:()=>Dz,Column:()=>BI,Column3D:()=>Oie,ColumnSeries:()=>$v,ColumnSeries3D:()=>_8,ColumnSeries3DDataItem:()=>H4,ColumnSeriesDataItem:()=>Bb,ConeColumn:()=>Wz,ConeSeries:()=>wve,ConeSeriesDataItem:()=>qz,Cursor:()=>kie,CurvedColumn:()=>VI,CurvedColumnSeries:()=>xve,CurvedColumnSeriesDataItem:()=>Lie,DateAxis:()=>nc,DateAxisBreak:()=>pie,DateAxisDataItem:()=>fie,DurationAxis:()=>h8,DurationAxisDataItem:()=>ove,ErrorBullet:()=>Sve,FlowDiagram:()=>Nz,FlowDiagramDataItem:()=>y8,FlowDiagramLink:()=>z4,FlowDiagramNode:()=>g8,FunnelSeries:()=>zz,FunnelSeriesDataItem:()=>Bx,FunnelSlice:()=>GI,GaugeChart:()=>lve,GaugeChartDataItem:()=>bie,Grid:()=>B4,GridCircular:()=>Mz,HeatLegend:()=>Vz,LabelBullet:()=>I3,Legend:()=>n8,LegendDataItem:()=>xz,LegendSettings:()=>cie,LineSeries:()=>Oz,LineSeriesDataItem:()=>d8,LineSeriesSegment:()=>Pz,NavigationBar:()=>P3,NavigationBarDataItem:()=>Cve,OHLC:()=>Uz,OHLCSeries:()=>gve,OHLCSeriesDataItem:()=>w8,PictorialStackedSeries:()=>bve,PictorialStackedSeriesDataItem:()=>q4,PieChart:()=>Sie,PieChart3D:()=>cve,PieChart3DDataItem:()=>uve,PieChartDataItem:()=>U4,PieSeries:()=>kz,PieSeries3D:()=>Cie,PieSeries3DDataItem:()=>pC,PieSeriesDataItem:()=>Lz,PieTick:()=>xie,PyramidSeries:()=>Fie,PyramidSeriesDataItem:()=>Hz,RadarChart:()=>_ie,RadarChartDataItem:()=>ave,RadarColumn:()=>Die,RadarColumnSeries:()=>_ve,RadarColumnSeriesDataItem:()=>vve,RadarCursor:()=>Tve,RadarSeries:()=>gie,RadarSeriesDataItem:()=>Rz,SankeyDiagram:()=>dve,SankeyDiagramDataItem:()=>hve,SankeyLink:()=>$z,SankeyNode:()=>pm,SerialChart:()=>Sz,SerialChartDataItem:()=>hie,Series:()=>o8,SeriesDataItem:()=>s8,SlicedChart:()=>Tie,SlicedChartDataItem:()=>j4,StepLineSeries:()=>Mie,StepLineSeriesDataItem:()=>jz,Tick:()=>G4,TreeMap:()=>Aie,TreeMapDataItem:()=>Iie,TreeMapSeries:()=>v8,TreeMapSeriesDataItem:()=>Eie,ValueAxis:()=>vo,ValueAxisBreak:()=>Iz,ValueAxisDataItem:()=>c8,XYChart:()=>G0,XYChart3D:()=>mve,XYChart3DDataItem:()=>l9e,XYChartDataItem:()=>Az,XYChartScrollbar:()=>$I,XYCursor:()=>Y4,XYSeries:()=>NI,XYSeriesDataItem:()=>eg});var te=function(j,R){return te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,w){u.__proto__=w}||function(u,w){for(var $ in w)Object.prototype.hasOwnProperty.call(w,$)&&(u[$]=w[$])},te(j,R)};function re(j,R){if(typeof R!="function"&&R!==null)throw new TypeError("Class extends value "+String(R)+" is not a constructor or null");function u(){this.constructor=j}te(j,R),j.prototype=R===null?Object.create(R):(u.prototype=R.prototype,new u)}var fe=function(){return fe=Object.assign||function(j){for(var R,u=1,w=arguments.length;u0&&$[$.length-1])||Re[0]!==6&&Re[0]!==2)){K=0;continue}if(Re[0]===3&&(!$||Re[1]>$[0]&&Re[1]<$[3])){K.label=Re[1];break}if(Re[0]===6&&K.label<$[1]){K.label=$[1],$=Re;break}if($&&K.label<$[2]){K.label=$[2],K.ops.push(Re);break}$[2]&&K.ops.pop(),K.trys.pop();continue}Re=R.call(j,K)}catch($e){Re=[6,$e],w=0}finally{u=$=0}if(5&Re[0])throw Re[1];return{value:Re[0]?Re[1]:void 0,done:!0}}([ae,we])}}}function Ie(j){var R=typeof Symbol=="function"&&Symbol.iterator,u=R&&j[R],w=0;if(u)return u.call(j);if(j&&typeof j.length=="number")return{next:function(){return j&&w>=j.length&&(j=void 0),{value:j&&j[w++],done:!j}}};throw new TypeError(R?"Object is not iterable.":"Symbol.iterator is not defined.")}function ke(j,R){var u=typeof Symbol=="function"&&j[Symbol.iterator];if(!u)return j;var w,$,U=u.call(j),K=[];try{for(;(R===void 0||R-- >0)&&!(w=U.next()).done;)K.push(w.value)}catch(ie){$={error:ie}}finally{try{w&&!w.done&&(u=U.return)&&u.call(U)}finally{if($)throw $.error}}return K}function Ne(){for(var j=[],R=0;Ru&&(j=u),j}function Ue(j){return Ve(Math.sin(Ce*j),10)}function ni(j){return Ve(Math.tan(Ce*j),10)}function A(j){return Ve(Math.cos(Ce*j),10)}function ve(j,R){return le(j)?le(R)&&R>j?R:j:le(R)?R:null}function W(j,R){return le(j)?le(R)&&R0)for(var ie=0;ie<=$;ie++){var ae=Dt(j,R,u,w,ie/$);U+=C(K,ae),K=ae}return U}function q(j,R,u,w){var $=C(R,w),U=C(j,u);return Math.abs(U/$)}function Z(j,R,u){return le(u)||(u=.5),{x:j.x+(R.x-j.x)*u,y:j.y+(R.y-j.y)*u}}function oe(j,R,u,w){var $=ue(R,w)-ue(j,u);return $<0&&($+=360),$}function ue(j,R){R||(R={x:2*j.x,y:2*j.y});var u=R.x-j.x,w=R.y-j.y,$=Math.atan2(w,u)*Ze;return $<0&&($+=360),ei($)}function be(j,R,u,w,$){var U=oe(R,u,w,$)-90;U<0&&(U+=360);var K=C(R,w),ie=Math.cos(U)/K+R.x,ae=Math.cos(U)/K+R.y;return{x:ie-j.x,y:ae-j.y}}function De(j){if(j){var R=j.length;if(R!==0){for(var u,w=void 0,$=void 0,U=void 0,K=0;K$)&&($=ie.x),(!le(w)||ie.xU)&&(U=ie.y)}return{x:w,y:u,width:$-w,height:U-u}}}return{x:0,y:0,width:0,height:0}}function qe(j){var R=j.length;if(R!==0){for(var u=void 0,w=void 0,$=void 0,U=void 0,K=0;Ku){var w=R;R=u,u=w}j=ei(j);var $=(R-ei(R))/360;return ju&&(j-360>R?j-=360:j=jR+(u-R)/2-180?R:u),j}function Xt(j,R,u){var w=Number.MAX_VALUE,$=Number.MAX_VALUE,U=-Number.MAX_VALUE,K=-Number.MAX_VALUE,ie=[];le(u)||(u=1),ie.push(ti(u,j)),ie.push(ti(u,R));for(var ae=Math.min(90*Math.floor(j/90),90*Math.floor(R/90)),we=Math.max(90*Math.ceil(j/90),90*Math.ceil(R/90)),Re=ae;Re<=we;Re+=90)Re>=j&&Re<=R&&ie.push(ti(u,Re));for(var $e=0;$eU&&(U=Xe.x),Xe.y>K&&(K=Xe.y)}return{x:w,y:$,width:U-w,height:K-$}}function ti(j,R){return{x:j*A(R),y:j*Ue(R)}}function bi(j,R){return j.x>=R.x&&j.x<=R.x+R.width&&j.y>=R.y&&j.y<=R.y+R.height}function Fi(j,R,u,w){return{x:((j.x*R.y-R.x*j.y)*(u.x-w.x)-(j.x-R.x)*(u.x*w.y-u.y*w.x))/((j.x-R.x)*(u.y-w.y)-(j.y-R.y)*(u.x-w.x)),y:((j.x*R.y-R.x*j.y)*(u.y-w.y)-(j.y-R.y)*(u.x*w.y-u.y*w.x))/((j.x-R.x)*(u.y-w.y)-(j.y-R.y)*(u.x-w.x))}}function Ri(j,R){for(var u=j.length,w=0;w>1,ie=R(u,j[K]);ie<0?$=K:(ie===0&&(U=!0),w=K+1)}return{found:U,index:U?w-1:w}}function Ha(j,R){for(var u=j.length,w=0;w0&&this.hasListenersByType(R)&&this._disabled[R]==null},j.prototype.has=function(R,u,w){return Ha(this._listeners,function($){return $.once!==!0&&$.type===R&&(u==null||$.callback===u)&&$.context===w})!==-1},j.prototype._shouldDispatch=function(R){if(this._disposed)throw new Error("EventDispatcher is disposed");var u=this._disabled[R];return le(u)?(u<=1?delete this._disabled[R]:--this._disabled[R],!1):this._enabled},j.prototype._eachListener=function(R){var u=this;++this._iterating;try{mi(this._listeners,R)}finally{--this._iterating,this._iterating===0&&this._killed.length!==0&&(mi(this._killed,function(w){u._removeListener(w)}),this._killed.length=0)}},j.prototype.dispatchImmediately=function(R,u){this._shouldDispatch(R)&&this._eachListener(function(w){w.killed||w.type!==null&&w.type!==R||w.dispatch(R,u)})},j.prototype.dispatch=function(R,u){this._shouldDispatch(R)&&this._eachListener(function(w){w.killed||w.type!==null&&w.type!==R||An(function(){w.killed||w.dispatch(R,u)})})},j.prototype._on=function(R,u,w,$,U,K){var ie=this;if(this._disposed)throw new Error("EventDispatcher is disposed");this._removeExistingListener(R,u,w,$);var ae={type:u,callback:w,context:$,shouldClone:U,dispatch:K,killed:!1,once:R,disposer:new jr(function(){ae.killed=!0,ie._removeListener(ae)})};return this._listeners.push(ae),ae},j.prototype.onAll=function(R,u,w){return w===void 0&&(w=!0),this._on(!1,null,R,u,w,function($,U){return R.call(u,$,U)}).disposer},j.prototype.on=function(R,u,w,$){return $===void 0&&($=!0),this._on(!1,R,u,w,$,function(U,K){return u.call(w,K)}).disposer},j.prototype.once=function(R,u,w,$){$===void 0&&($=!0);var U=this._on(!0,R,u,w,$,function(K,ie){U.disposer.dispose(),u.call(w,ie)});return U.disposer},j.prototype.off=function(R,u,w){this._removeExistingListener(!1,R,u,w)},j.prototype.copyFrom=function(R){var u=this;if(this._disposed)throw new Error("EventDispatcher is disposed");if(R===this)throw new Error("Cannot copyFrom the same TargetedEventDispatcher");mi(R._listeners,function(w){!w.killed&&w.shouldClone&&(w.type===null?u.onAll(w.callback,w.context):w.once?u.once(w.type,w.callback,w.context):u.on(w.type,w.callback,w.context))})},j}(),xa=function(j){function R(u){var w=j.call(this)||this;return w.target=u,w}return re(R,j),R.prototype.copyFrom=function(u){var w=this;if(this._disposed)throw new Error("EventDispatcher is disposed");if(u===this)throw new Error("Cannot copyFrom the same TargetedEventDispatcher");mi(u._listeners,function($){$.context!==u.target&&!$.killed&&$.shouldClone&&($.type===null?w.onAll($.callback,$.context):$.once?w.once($.type,$.callback,$.context):w.on($.type,$.callback,$.context))})},R}(Ts);function Pu(j){return function(R){for(var u in j)if(ju(j,u)&&!R([u,j[u]]))break}}function $o(j){var R=[];for(var u in j)ju(j,u)&&R.push(u);return R}function mc(j,R){return $o(j).sort(R)}function ju(j,R){return{}.hasOwnProperty.call(j,R)}function fi(j,R){return j[R]}function _i(j,R){for(var u in j)if(ju(j,u)&&!R(u,j[u]))break}function gi(j,R){_i(j,function(u,w){return R(u,w),!0})}function _r(j,R,u){mi(mc(j,u),function(w){R(w,j[w])})}function Wr(j){return Object.assign({},j)}function Gr(j,R){return Object.assign({},j,R)}function Kr(j){return JSON.parse(JSON.stringify(j))}function Cr(j,R,u){mi(u,function(w){Ee(j[w])&&(R[w]=j[w])})}function Wn(j,R,u){mi(u,function(w){Ee(j[w])&&!Ee(R[w])&&(R[w]=j[w])})}function Rs(j,R,u){mi(u,function(w){R[w]=j[w]})}function Ms(j,R){Cr(j,R,$o(j))}function Vo(j){return function(R){for(var u=j.length,w=0;wj?R:j}function sd(j){return nd(j,null,hh)}function cu(j,R){R===void 0&&(R="");var u=!0,w="";return j(function($){return u?u=!1:w+=R,w+=$,!0}),w}var Qp=function(){function j(R,u){this.createNewItems=!1,this.list=R,this._create=u,this.reset()}return j.prototype.reset=function(){this._listCopy=Ea(this.list.iterator())},j.prototype.clear=function(){this._listCopy.length=0},j.prototype.getFirst=function(){return this.returnItem(0)},j.prototype.getLast=function(){return this.returnItem(this._listCopy.length-1)},j.prototype.find=function(R){var u=Ha(this._listCopy,R);if(u!==-1){var w=this._listCopy[u];return $i(this._listCopy,w),w}return this.getLast()},j.prototype.removeItem=function(R){return $i(this._listCopy,R)},j.prototype.returnItem=function(R){if(R>=0&&R=R._end&&u(R._array[w]);--w);}},j.prototype.backwards=function(){return new j(this._array,this._end,this._start)},j.prototype.range=function(R,u){if(R<=u){if(this._start===this._end)return this;if(this._start=0&&j=0&&R0);if(K>=ie)return ie;this.swap(K,ie)}},j.prototype.sort=function(R){this._sortQuicksort(0,this._values.length-1,R)},j.prototype.swap=function(R,u){var w=this._values.length;if(bp(R,w),bp(u,w),R!==u){var $=this._values[R],U=this._values[u];this._values[R]=U,this.events.isEnabled("setIndex")&&this.events.dispatchImmediately("setIndex",{type:"setIndex",target:this,index:R,oldValue:$,newValue:U}),this._values[u]=$,this.events.isEnabled("setIndex")&&this.events.dispatchImmediately("setIndex",{type:"setIndex",target:this,index:u,oldValue:U,newValue:$})}},j.prototype.removeIndex=function(R){bp(R,this._values.length);var u=this._values[R];return ea(this._values,R),this.events.isEnabled("removeIndex")&&this.events.dispatchImmediately("removeIndex",{type:"removeIndex",target:this,index:R,oldValue:u}),this.events.isEnabled("removed")&&this.events.dispatchImmediately("removed",{type:"removed",target:this,oldValue:u}),u},j.prototype.moveValue=function(R,u){var w=this.indexOf(R);if(w!==-1){var $=this._values[w];ea(this._values,w),this.events.isEnabled("removeIndex")&&this.events.dispatchImmediately("removeIndex",{type:"removeIndex",target:this,index:w,oldValue:$})}u==null?(u=this._values.length,this._values.push(R)):Ta(this._values,u,R),this.events.isEnabled("insertIndex")&&this.events.dispatchImmediately("insertIndex",{type:"insertIndex",target:this,index:u,newValue:R}),w===-1&&this.events.isEnabled("inserted")&&this.events.dispatchImmediately("inserted",{type:"inserted",target:this,newValue:R})},j.prototype.push=function(R){var u=this._values.push(R)-1;return this.events.isEnabled("insertIndex")&&this.events.dispatchImmediately("insertIndex",{type:"insertIndex",target:this,index:u,newValue:R}),this.events.isEnabled("inserted")&&this.events.dispatchImmediately("inserted",{type:"inserted",target:this,newValue:R}),R},j.prototype.unshift=function(R){this.insertIndex(0,R)},j.prototype.pushAll=function(R){var u=this;mi(R,function(w){u.push(w)})},j.prototype.copyFrom=function(R){this.pushAll(R._values)},j.prototype.pop=function(){return this._values.length-1<0?void 0:this.removeIndex(this._values.length-1)},j.prototype.shift=function(){return this._values.length?this.removeIndex(0):void 0},j.prototype.setAll=function(R){var u=this,w=H(this._values);this._values.length=0,mi(R,function($){u._values.push($)}),this.events.isEnabled("setAll")&&this.events.dispatchImmediately("setAll",{type:"setAll",target:this,oldArray:w,newArray:this._values}),this.events.isEnabled("removed")&&mi(w,function($){u.events.dispatchImmediately("removed",{type:"removed",target:u,oldValue:$})}),this.events.isEnabled("inserted")&&mi(this._values,function($){u.events.dispatchImmediately("inserted",{type:"inserted",target:u,newValue:$})})},j.prototype.clear=function(){this.setAll([])},j.prototype.iterator=function(){return Vo(this._values)},j.prototype[Symbol.iterator]=function(){var R,u;return _e(this,function(w){switch(w.label){case 0:R=this._values.length,u=0,w.label=1;case 1:return uRe)&&(K=ie,$=we,U=Re)}else w==="left"&&we=R&&(!Ee($)||$>=we)&&(K=ie,$=we);return++ie,!0}),K===-1&&(w==="left"?K=0:w==="right"&&(K=this.length-1)),K},j.prototype.iterator=function(){return Vo(this._values)},j.prototype[Symbol.iterator]=function(){var R,u;return _e(this,function(w){switch(w.label){case 0:R=this._values.length,u=0,w.label=1;case 1:return u0)for(var U=0;U<$;++U){var K=w[U];K.key===R&&(u=K.callback.call(K.scope,u,this.object,R))}return Oh.applyAll(this.object,R,u)}return u},j.prototype.keys=function(){return Ea(uh(this._callbacks.iterator(),function(R){return R.key}))},j.prototype.copyFrom=function(R){var u=this;pr(R._callbacks.iterator(),function(w){u.add(w.key,w.callback,w.priority,w.scope)}),gi(R._disabled,function(w,$){u._disabled[w]=$})},j.prototype.clear=function(){this._callbacks.clear()},j}(),Bl={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgrey:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},grey:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgrey:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},rebeccapurple:{r:102,g:51,b:153},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}};function Oc(j,R){var u;return Bl[j]?u=Bl[j]:j.charAt(0)==="#"?u=Xm(j):j.match(/^rgba?\(/)&&(u=Tf(j)),u||(u={r:0,g:0,b:0,a:1}),Ee(R)&&(u.a=R),u}function Xm(j){j=j.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(u,w,$,U){return w+w+$+$+U+U});var R=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(j);return R?{r:parseInt(R[1],16),g:parseInt(R[2],16),b:parseInt(R[3],16)}:Xd(j)}function Xd(j){j=j.replace(/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])$/i,function(u,w,$,U,K){return w+w+$+$+U+U+K+K});var R=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(j);return R?{r:parseInt(R[1],16),g:parseInt(R[2],16),b:parseInt(R[3],16),a:parseInt(R[4],16)/256}:void 0}function Tf(j){var R=(j=j.replace(/[ ]/g,"")).match(/^rgb\(([0-9]*),([0-9]*),([0-9]*)\)/i);if(R)R.push("1");else if(!(R=j.match(/^rgba\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\)/i)))return;return{r:parseInt(R[1]),g:parseInt(R[2]),b:parseInt(R[3]),a:parseFloat(R[4])}}function Py(j){return"#"+Ht(j.r.toString(16))+Ht(j.g.toString(16))+Ht(j.b.toString(16))}function Rg(j){return Ee(j.a)&&j.a!==1?"rgba("+j.r+","+j.g+","+j.b+","+j.a+")":"rgb("+j.r+","+j.g+","+j.b+")"}function Ht(j){return j.length==1?"0"+j:""+j}function qt(j,R,u){return u=gt(u,0,1),j?R?{r:j.r+Math.round((R.r-j.r)*u),g:j.g+Math.round((R.g-j.g)*u),b:j.b+Math.round((R.b-j.b)*u),a:(j.a||1)+Math.round(((R.a||1)-(j.a||1))*u)}:j:R||j}function Ai(j,R){return j&&{r:Math.max(0,Math.min(255,j.r+ji(j.r,R))),g:Math.max(0,Math.min(255,j.g+ji(j.g,R))),b:Math.max(0,Math.min(255,j.b+ji(j.b,R))),a:j.a}}function ji(j,R){var u=R>0?255-j:j;return Math.round(u*R)}function pe(j,R){if(j){var u=ji(Math.min(Math.max(j.r,j.g,j.b),230),R);return{r:Math.max(0,Math.min(255,Math.round(j.r+u))),g:Math.max(0,Math.min(255,Math.round(j.g+u))),b:Math.max(0,Math.min(255,Math.round(j.b+u))),a:j.a}}return j}function Fe(j,R){return Math.round(255*R)}function We(j,R){if(j==null||R==1)return j;var u=ne(j);return u.s=R,bt(u)}function bt(j){var R,u,w,$=j.h,U=j.s,K=j.l;if(U==0)R=u=w=K;else{var ie=function(Re,$e,Xe){return Xe<0&&(Xe+=1),Xe>1&&(Xe-=1),Xe<.16666666666666666?Re+6*($e-Re)*Xe:Xe<.5?$e:Xe<.6666666666666666?Re+($e-Re)*(.6666666666666666-Xe)*6:Re},ae=K<.5?K*(1+U):K+U-K*U,we=2*K-ae;R=ie(we,ae,$+.3333333333333333),u=ie(we,ae,$),w=ie(we,ae,$-.3333333333333333)}return{r:Math.round(255*R),g:Math.round(255*u),b:Math.round(255*w)}}function ne(j){var R=j.r/255,u=j.g/255,w=j.b/255,$=Math.max(R,u,w),U=Math.min(R,u,w),K=0,ie=0,ae=($+U)/2;if($===U)K=ie=0;else{var we=$-U;switch(ie=ae>.5?we/(2-$-U):we/($+U),$){case R:K=(u-w)/we+(u=128}var Te=function(){function j(R){this._value=R}return Object.defineProperty(j.prototype,"rgb",{get:function(){return this._value},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"hex",{get:function(){return this._value?Py(this._value):"none"},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"rgba",{get:function(){return this._value?Rg(this._value):"none"},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"alpha",{get:function(){return this._value!=null&&this._value.a!=null?this._value.a:1},set:function(R){this._value&&(this._value.a=R)},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"lightColor",{get:function(){return this._lightColor||(this._lightColor=new j({r:255,g:255,b:255})),this._lightColor},set:function(R){this._lightColor=R},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"darkColor",{get:function(){return this._darkColor||(this._darkColor=new j({r:0,g:0,b:0})),this._darkColor},set:function(R){this._darkColor=R},enumerable:!0,configurable:!0}),j.prototype.toString=function(){return this.alpha<1?this.rgba:this.hex},j.prototype.lighten=function(R){return new j(Ai(this.rgb,R))},j.prototype.brighten=function(R){return new j(pe(this.rgb,R))},j.prototype.saturate=function(R){return new j(We(this.rgb,R))},Object.defineProperty(j.prototype,"alternative",{get:function(){if(this.rgb!=null)return me(this.rgb)?this.darkColor:this.lightColor;throw new Error("Color does not exist")},enumerable:!0,configurable:!0}),j}();function He(j,R){if(!Ee(j))return new Te(void 0);if(typeof j=="string"){var u="_color_"+j+"_"+(R||"1"),w=ui.getCache(u);if(w)return new Te({r:w.r,g:w.g,b:w.b,a:w.a});var $=Oc(j,R);return ui.setCache(u,$),new Te($)}return j instanceof Te?(Ee(R)&&(j.alpha=R),j):new Te(j)}function Ye(j){return j instanceof Te}function ot(j){return He(j)}function Ct(j){return Ee(j)&&!Ye(j)?ot(j):j}var Wt=function(){function j(){this._disposed=!1,this._disposers=[],this.className="BaseObject"}return j.prototype.debug=function(){},Object.defineProperty(j.prototype,"uid",{get:function(){return this._uid||(this._uid=ui.getUniqueId(),ui.map.setKey(this._uid,this)),this._uid},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"id",{get:function(){return this._id},set:function(R){this._id=R},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"map",{get:function(){return this._map||(this._map=new fa),this._map},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"delayedMap",{get:function(){return this._delayedMap||(this._delayedMap=new fa),this._delayedMap},enumerable:!0,configurable:!0}),j.prototype.addDelayedMap=function(R,u){var w=this.delayedMap;w.hasKey(u)||w.setKey(u,[]),w.getKey(u).push({property:R,target:this})},j.prototype.processDelayedMap=function(){var R=this;this.delayedMap.each(function(u,w){if(R.map.hasKey(u)){var $=R.map.getKey(u);mi(w,function(U){U.target[U.property]=$}),R.delayedMap.removeKey(u)}})},j.prototype.applyTheme=function(){var R=this;if(ui){var u=this.getCurrentThemes();u&&mi(u,function(w,$){w(R)})}},Object.defineProperty(j.prototype,"themes",{get:function(){return this._themes},set:function(R){this._themes=R},enumerable:!0,configurable:!0}),j.prototype.getCurrentThemes=function(){return this.themes||ui.themes},j.prototype.isDisposed=function(){return this._disposed},j.prototype.dispose=function(){if(!this._disposed){this._disposed=!0;var R=this._disposers;for(this._disposers=null;R.length!==0;)R.shift().dispose();this.clearCache(),this.clonedFrom&&this.clonedFrom.clones.removeValue(this);var u=this._uid;u!=null&&ui.map.removeKey(u)}},j.prototype.addDisposer=function(R){this._disposers.push(R)},j.prototype.removeDispose=function(R){if(!this._disposed){var u=Ri(this._disposers,R);u>-1&&this._disposers.splice(u,1)}R.dispose()},j.prototype.clone=function(R){R||(R="clone-"+ui.getUniqueId());var u=new this.constructor;return u.cloneId=R,u.copyFrom(this),u},Object.defineProperty(j.prototype,"clones",{get:function(){return this._clones||(this._clones=new Us),this._clones},enumerable:!0,configurable:!0}),j.prototype.copyFrom=function(R){R.clones.push(this),this.clonedFrom=R},Object.defineProperty(j.prototype,"className",{get:function(){return this._className},set:function(R){this._className=R},enumerable:!0,configurable:!0}),j.prototype.setCache=function(R,u,w){ef.set(this.uid,R,u,w)},j.prototype.getCache=function(R,u){return u===void 0&&(u=void 0),ef.get(this.uid,R,u)},j.prototype.clearCache=function(){ef.clear(this.uid)},j.prototype.setTimeout=function(R,u){var w=this,$=setTimeout(function(){w.removeDispose(U),R()},u),U=new jr(function(){clearTimeout($)});return this._disposers.push(U),U},j.prototype.setInterval=function(R,u){var w=this,$=setInterval(function(){w.removeDispose(U),R()},u),U=new jr(function(){clearTimeout($)});return this._disposers.push(U),U},Object.defineProperty(j.prototype,"config",{set:function(R){try{this.processConfig(R)}catch(u){this.raiseCriticalError(u)}},enumerable:!0,configurable:!0}),j.prototype.processConfig=function(R){var u=this;if(R){var w=this;if(_r(R,function(U,K){var ie,ae=K;if(U=="callback"&&typeof K=="function"&&K.call(w),u.hasProperty(U))if(!it(ae)||!Ee(ae.type)||it(w[U])&&Ee(w[U].className)&&!ae.forceCreate&&w[U].className==ae.type||u.asIs(U)?ie=w[U]:(ie=u.createClassInstance(ae.type))?w[U]=ie:ie=w[U],ie instanceof tc)u.processAdapters(ie,ae);else if(ie instanceof Ts)u.processEvents(ie,ae);else if(U=="locale"&&ct(ae))window["am4lang_"+ae]&&(w[U]=window["am4lang_"+ae]);else if(U=="parent"&&ct(ae)){var we=u.map.getKey(ae);we?w[U]=we:u.addDelayedMap("parent",ae)}else if(u.asIs(U))w[U]=ae;else if(u.asFunction(U)&&ct(ae)){if(!Ee(ui.registeredClasses[ae]))throw Error("Invalid easing function: "+ae);w[U]=ui.registeredClasses[ae]}else if(ae instanceof j)w[U]=ae;else if(ie instanceof j)ie.config=ae;else if(ie instanceof Xs||ie instanceof Ym||ie instanceof th){if(pt(ae))ie instanceof Xs?u.processListTemplate(ae,ie):u.processOrderedTemplate(ae,ie);else if(it(ae))if(ae instanceof j)ie.template=ae;else{var Re;Re=Ee(ae.template)?ae.template:ae,ie.template instanceof j?ie.template.config=Re:gi(Re,function($e,Xe){var Qe=ie.template[$e];Qe instanceof tc?u.processAdapters(Qe,Xe):Qe instanceof Ts?u.processEvents(Qe,Xe):Qe instanceof cm?u.processDictionaryTemplate(Qe,Xe):ie.template[$e]instanceof j?ie.template[$e].config=Xe:it(Xe)&&Ee(Xe.type)?(Qe=u.createClassInstance(Xe.type))?(Qe instanceof j&&(Qe.config=Xe),ie.template[$e]=Qe):ie.template[$e]=Xe:Qe instanceof Us?u.processList(Xe,Qe):ie.template[$e]=u.maybeColorOrPercent(Xe)}),Ee(ae.values)&&(ie instanceof Xs?u.processListTemplate(ae.values,ie):u.processOrderedTemplate(ae.values,ie))}}else ie instanceof Us?U=="children"?u.processList(ae,ie,u):u.processList(ae,ie):ie instanceof cm?u.processDictionaryTemplate(ie,ae):ie instanceof fa?u.processDictionary(ie,ae):ie instanceof Te||ie instanceof J?w[U]=u.maybeColorOrPercent(ae):it(ie)&&it(ae)?Ms(ae,ie):(ae=u.maybeColorOrPercent(ae),w[U]=ae);else u.isReserved(U)||(w[U]=ae)},this.configOrder),this.processingErrors.length){var $=this.processingErrors.join(` -`);throw this._processingErrors=[],Error($)}}},j.prototype.maybeColorOrPercent=function(R){if(ct(R)){if(R.match(/^[\-]?[0-9.]+\%$/))return he(Tt(R));if(R.match(/^\#[0-9abcdef]{3,}$/i))return He(R)}return R},j.prototype.processAdapters=function(R,u){var w=this;pt(u)?mi(u,function($,U){R.add($.key,$.callback,$.priority||0,w)}):it(u)&&gi(u,function($,U){R.has($,U)||R.add($,U)})},j.prototype.processEvents=function(R,u){var w=this;pt(u)?mi(u,function($,U){R.on($.type,$.callback,w)}):it(u)&&gi(u,function($,U){R.has($,U)||R.on($,U)})},j.prototype.processDictionaryTemplate=function(R,u){it(u)&&gi(u,function(w,$){var U;(U=w=="template"?R.template:R.hasKey(w)?R.getKey(w):R.create(w))instanceof j?U.config=$:it(U)&&it($)?Ms($,U):U.setKey(w,$)})},j.prototype.processDictionary=function(R,u){it(u)&&gi(u,function(w,$){R.setKey(w,$)})},j.prototype.processListTemplate=function(R,u){var w=this;for(mi(R,function($,U){var K,ie=w.getConfigEntryType($);if(u.hasIndex(U)&&!$.forceCreate)K=u.getIndex(U);else{if($ instanceof j)return void u.push($);K=ie?u.create(ie):u.create()}$===K||it($)&&(K instanceof j?K.config=$:it(K)&&it($)?Ms($,K):u.setIndex(u.indexOf(K),$))});R.length>u.length;)u.pop()},j.prototype.processOrderedTemplate=function(R,u){var w=this;mi(R,function($,U){var K,ie=w.getConfigEntryType($);K=ie?u.create(ie):u.create(),it($)&&(K instanceof j?K.config=$:it(K)&&it($)?Ms($,K):u.insert($))})},j.prototype.processList=function(R,u,w){var $=this;pt(R)||(R=[R]);var U=u.length,K=0;for(mi(R,function(ie,ae){if(it(ie)){var we=void 0;if(aeR&&(u!==!0||$!=0)){if(w&&(we=vl(we)),Xe=we.match(new RegExp(".{1,"+R+"}","g"))){if(w)for(var $e=0;$eR&&U[K]!==""&&(U.push(""),K++),U[K]+=we;K=U.length-1}}}else{var Xe;if(Xe=j.match(new RegExp(".{1,"+R+"}","g"))){if(w)for($e=0;$eR&&(U=[]),U}function Rd(j,R,u,w,$){return j.length<=R?j:((R-=u.length)<1&&(R=1),(Mh(j,R,w,$)[0]||"")+u)}function Ef(j){return j.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function Dh(j){return j.replace(/[\s\uFEFF\xA0]+$/g,"")}function Md(j){return j.replace(/^[\s\uFEFF\xA0]+/g,"")}function vl(j){return j.split("").reverse().join("")}function $c(j){var R=j.trim();return(R=j.replace(/^'(.*)'$/,"$1"))==j&&(R=j.replace(/^"(.*)"$/,"$1")),R}function Vl(j,R,u){return R===void 0&&(R=0),u===void 0&&(u="0"),typeof j!="string"&&(j=j.toString()),R>j.length?Array(R-j.length+1).join(u)+j:j}function uo(j){if(j===void 0)return Oi;var R=(j=(j=(j=j.toLowerCase().replace(/^\[[^\]]*\]/,"")).replace(/\[[^\]]+\]/,"")).trim()).match(/\/(date|number|duration)$/);return R?R[1]:j===zi?zi:j===sr?sr:j===tr?tr:j.match(/[#0]/)?zi:j.match(/[ymwdhnsqaxkzgtei]/)?sr:Oi}function Fh(j){return j.replace(/\/(date|number|duration)$/i,"")}function vu(j){return j&&j.replace(/<[^>]*>/g,"")}function Lh(j){return j&&vu((""+j).replace(/[\n\r]+/g,". "))}function Kd(j){if(Pe(j))return"NaN";if(j===1/0)return"Infinity";if(j===-1/0)return"-Infinity";if(j===0&&1/j==-1/0)return"-0";var R=j<0;j=Math.abs(j);var u,w=Be(/^([0-9]+)(?:\.([0-9]+))?(?:e[\+\-]([0-9]+))?$/.exec(""+j)),$=w[1],U=w[2]||"";if(w[3]==null)u=U===""?$:$+"."+U;else{var K,ie=+w[3];u=j<1?"0."+Ag("0",K=ie-1)+$+U:(K=ie-U.length)==0?$+U:K<0?$+U.slice(0,K)+"."+U.slice(K):$+U+Ag("0",K)}return R?"-"+u:u}function Oy(j){if(kt(j)){var R=new Date(j);return R.setMilliseconds(j.getMilliseconds()),R}if(le(j))return new Date(j);var u=Number(j);return le(u)?new Date(u):new Date(j)}function It(j){if(kt(j))return j.getTime();if(le(j))return j;if(ct(j)){var R=Number(j);return le(R)?R:void 0}}function Bi(j,R){var u=new Date(j.getFullYear(),0,0),w=j.getTime()-u.getTime()+60*(u.getTimezoneOffset()-j.getTimezoneOffset())*1e3;return Math.floor(w/864e5)}function Pr(j,R){var u=new Date(Date.UTC(j.getFullYear(),j.getMonth(),j.getDate())),w=u.getUTCDay()||7;u.setUTCDate(u.getUTCDate()+4-w);var $=new Date(Date.UTC(u.getUTCFullYear(),0,1));return Math.ceil(((u.getTime()-$.getTime())/864e5+1)/7)}function Vn(j,R){var u=Pr(new Date(j.getFullYear(),j.getMonth(),1)),w=Pr(j);return w==1&&(w=53),w-u+1}function ms(j,R,u,w){u===void 0&&(u=1),w===void 0&&(w=!1);var $=new Date(R,0,4,0,0,0,0);return w&&$.setUTCFullYear(R),7*j+u-(($.getDay()||7)+3)}function gs(j,R){return j>12?j-=12:j===0&&(j=12),Ee(R)?j+(R-1):j}function ma(j,R,u,w){if(R===void 0&&(R=!1),u===void 0&&(u=!1),w===void 0&&(w=!1),w)return R?"Coordinated Universal Time":"UTC";var $=j.toLocaleString("UTC"),U=j.toLocaleString("UTC",{timeZoneName:R?"long":"short"}).substr($.length);return u===!1&&(U=U.replace(/ (standard|daylight|summer|winter) /i," ")),U}function il(j,R){return Math.floor(Math.random()*(R-j))+j}function Mg(j,R,u){return j>u?u:ju||j1&&$.pop(),Kn($,U),u.path=$.join("/"),u.path!==""&&u.path[0]!=="/")throw new Error("URL path must start with /")}return u.query=w.query,u.hash=w.hash,bn(u)}return bn(w)}function ZS(){return!!window.MSInputMethodContext&&!!document.documentMode}function ph(j){return+j}function fI(j){return j*j}function p3(j){return j*(2-j)}function kh(j){return((j*=2)<=1?j*j:--j*(2-j)+1)/2}function N$(j,R){return Math.pow(j,R)}function co(j,R){return 1-Math.pow(1-j,R)}function f1(j,R){return((j*=2)<=1?Math.pow(j,R):2-Math.pow(2-j,R))/2}function Km(j){return N$(j,3)}function y4(j){return co(j,3)}function $$(j){return f1(j,3)}function mI(j){return Math.pow(2,10*j-10)}function gI(j){return 1-Math.pow(2,-10*j)}function k0(j){return((j*=2)<=1?Math.pow(2,10*j-10):2-Math.pow(2,10-10*j))/2}function My(j){return 1-Math.cos(j*ce)}function v4(j){return Math.sin(j*ce)}function yI(j){return(1-Math.cos(Le*j))/2}function _4(j){return j*j*j}function kv(j){return--j*j*j+1}function Sa(j){return((j*=2)<=1?j*j*j:(j-=2)*j*j+2)/2}function tz(j){return 1-Math.sqrt(1-j*j)}function zr(j){return Math.sqrt(1- --j*j)}function b4(j){return((j*=2)<=1?1-Math.sqrt(1-j*j):Math.sqrt(1-(j-=2)*j)+1)/2}ui.registeredClasses["ease.linear"]=ph,ui.registeredClasses["ease.quadIn"]=fI,ui.registeredClasses["ease.quadOut"]=p3,ui.registeredClasses["ease.quadInOut"]=kh,ui.registeredClasses["ease.polyIn"]=N$,ui.registeredClasses["ease.polyOut"]=co,ui.registeredClasses["ease.polyInOut"]=f1,ui.registeredClasses["ease.polyIn3"]=Km,ui.registeredClasses["ease.polyOut3"]=y4,ui.registeredClasses["ease.polyInOut3"]=$$,ui.registeredClasses["ease.expIn"]=mI,ui.registeredClasses["ease.expOut"]=gI,ui.registeredClasses["ease.expInOut"]=k0,ui.registeredClasses["ease.sinIn"]=My,ui.registeredClasses["ease.sinOut"]=v4,ui.registeredClasses["ease.sinInOut"]=yI,ui.registeredClasses["ease.cubicIn"]=_4,ui.registeredClasses["ease.cubicOut"]=kv,ui.registeredClasses["ease.cubicInOut"]=Sa,ui.registeredClasses["ease.circleIn"]=tz,ui.registeredClasses["ease.circleOut"]=zr,ui.registeredClasses["ease.circleInOut"]=b4;var vI=7.5625;function ga(j){return 1-_I(1-j)}function _I(j){return(j=+j)<.36363636363636365?vI*j*j:j<.7272727272727273?vI*(j-=.5454545454545454)*j+.75:j<.9090909090909091?vI*(j-=.8181818181818182)*j+.9375:vI*(j-=.9545454545454546)*j+.984375}function f3(j){return((j*=2)<=1?1-_I(1-j):_I(j-1)+1)/2}ui.registeredClasses["ease.bounceIn"]=ga,ui.registeredClasses["ease.bounceOut"]=_I,ui.registeredClasses["ease.bounceInOut"]=f3;var m3=.3/(2*Math.PI),g3=Math.asin(1)*m3;function w4(j){return 1*Math.pow(2,10*--j)*Math.sin((g3-j)/m3)}function B$(j){return 1-1*Math.pow(2,-10*(j=+j))*Math.sin((j+g3)/m3)}function iz(j){return((j=2*j-1)<0?1*Math.pow(2,10*j)*Math.sin((g3-j)/m3):2-1*Math.pow(2,-10*j)*Math.sin((g3+j)/m3))/2}ui.registeredClasses["ease.elasticIn"]=w4,ui.registeredClasses["ease.elasticOut"]=B$,ui.registeredClasses["ease.elasticInOut"]=iz;var Nr=function(j){function R(){var u=j.call(this)||this;return u.transitionDuration=0,u.transitionEasing=kv,u.properties={},u.propertyFields={},u.filters=new Us,u.isTemplate=!1,u.className="SpriteState",u._disposers.push(new ta(u.filters)),u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"adapter",{get:function(){var u=this;return this._adapterO||(this._adapterO=new tc(this),this._adapterO.events.on("inserted",function(w){u[w.newValue.key]=u[w.newValue.key]},void 0,!1),this._adapterO.events.on("removed",function(w){u[w.newValue.key]=u[w.newValue.key]},void 0,!1)),this._adapterO},enumerable:!0,configurable:!0}),R.prototype.getPropertyValue=function(u){var w=this.properties[u],$=this.sprite;if($){var U=this.propertyFields[u];if(Ee(U)&&($.dataItem&&(w=$.dataItem.dataContext[U]),w==null&&(w="__unset")),Ee(w))this._adapterO&&(w=this._adapterO.apply(u,w));else{var K=$.getPropertyValue(u);(w=this._adapterO?this._adapterO.apply(u,K):K)==K&&(w=void 0)}}return w},R.prototype.copyFrom=function(u){u&&u!=this&&(this.transitionDuration=u.transitionDuration,this.transitionEasing=u.transitionEasing,tn(u.properties,this.properties),tn(u.propertyFields,this.propertyFields),this.filters.copyFrom(u.filters),u._adapterO&&this.adapter.copyFrom(u._adapterO))},Object.defineProperty(R.prototype,"allValues",{get:function(){var u=this,w={};return gi(this.properties,function($,U){w[$]=u.getPropertyValue($)}),this._adapterO&&gi(this._adapterO.keys(),function($,U){var K=u.getPropertyValue(U);w[U]=K}),gi(this.propertyFields,function($){var U=u.getPropertyValue($);w[$]=U}),w},enumerable:!0,configurable:!0}),R.prototype.reset=function(){this.properties={},this.filters.clear()},R.prototype.processConfig=function(u){Ee(u)&&Ee(u.properties)&&gi(u.properties,function(w,$){ct($)&&($.match(/^[0-9.\-]+\%$/)?u.properties[w]=he(Tt($)):$.match(/^\#[0-9abcdef]{3,}$/i)&&(u.properties[w]=Ct($)))}),j.prototype.processConfig.call(this,u)},R.prototype.asFunction=function(u){return u=="transitionEasing"||j.prototype.asIs.call(this,u)},R}(Wt);ui.registeredClasses.SpriteState=Nr;var rz=function(j){function R(){var u=j!==null&&j.apply(this,arguments)||this;return u._interactionEvents=new fa,u}return re(R,j),R.prototype._dispatchSpriteEvent=function(u){if(!this.target.disabled&&!this.target.isTemplate&&this.target.events.isEnabled(u.type)){var w=Gr(u,{target:this.target});this.target.events.dispatchImmediately(w.type,w)}},R.prototype._dispatchSpritePointEvent=function(u){if(!this.target.disabled&&!this.target.isTemplate&&this.target.events.isEnabled(u.type)){var w=Gr(u,{target:this.target,spritePoint:u.point?Mb(u.point,this.target):void 0,svgPoint:this.target.getSvgPoint(u.point)});this.target.events.dispatchImmediately(w.type,w)}},R.prototype._addInteractionObjectEvent=function(u,w,$,U){var K=this,ie=U+"-"+u;return this._interactionEvents.insertKeyIfEmpty(ie,function(){var ae=K.target.interactions.events.on(u,w,$,U);return new ws(function(){K._interactionEvents.removeKey(ie),ae.dispose()})}).increment()},R.prototype._on=function(u,w,$,U,K,ie){var ae=j.prototype._on.call(this,u,w,$,U,K,ie),we=[ae.disposer];switch(w){case"hit":case"track":case"doublehit":case"wheel":case"wheelup":case"wheeldown":case"wheelleft":case"wheelright":we.push(this._addInteractionObjectEvent(w,this._dispatchSpritePointEvent,this,K));break;case"rightclick":case"down":case"up":case"drag":case"dragged":case"dragstart":case"dragstop":case"over":case"out":case"swipe":case"swipeleft":case"swiperight":case"resize":case"focus":case"blur":case"toggled":we.push(this._addInteractionObjectEvent(w,this._dispatchSpriteEvent,this,K))}switch(w){case"hit":case"doublehit":case"rightclick":case"down":case"up":this.target.clickable=!0;break;case"toggled":this.target.togglable=!0;break;case"drag":case"dragstart":case"dragstop":this.target.draggable=!0;break;case"track":this.target.trackable=!0;break;case"resize":this.target.resizable=!0;break;case"swipe":case"swipeleft":case"swiperight":this.target.swipeable=!0;break;case"wheel":case"wheelup":case"wheeldown":case"wheelleft":case"wheelright":this.target.wheelable=!0;break;case"over":this.target.hoverable=!0;case"out":this.target.hoverable=!0;break;case"focus":case"blur":this.target.focusable=!0}return ae.disposer=new Nn(we),ae},R}(xa),x4=function(){function j(){}return j.opacity=1,j.strokeOpacity=1,j.strokeWidth=1,j.fillOpacity=1,j.fill=He("#000000"),j.stroke=He("#000000"),j.focusable=void 0,j.tabindex=0,j}(),no={verbose:!0,commercialLicense:!1,classNamePrefix:"amcharts-",autoSetClassName:!1,minPolylineStep:.5,onlyShowOnViewport:!1,queue:!1,autoDispose:!1,licenses:[],suppressErrors:!1,suppressWarnings:!1,animationsEnabled:!0,nonce:"",deferredDelay:100,disableHoverOnTransform:"never",pixelPerfectPrecision:0};function Db(j,R){var u=!1,w=Date.now();return pn(function $(U){if(!u){var K=U-w;K>=j?R(1):(pn($),R(K/j))}}),new jr(function(){u=!0})}function nz(j,R,u){return R+(u-R)*j}function G$(j,R,u){return new J(nz(j,R.percent,u.percent))}function bI(j,R,u){var w=new Te(qt(R.rgb,u.rgb,j));return R.alpha!=u.alpha&&(w.alpha=R.alpha+(u.alpha-R.alpha)*j),w}function sz(j,R){return R+j.charAt(0).toUpperCase()+j.substr(1)}var V$,Mx=function(){function j(R){this._disposer=new jr(function(){for(;R.length!==0;)R[0].dispose()})}return j.prototype.isDisposed=function(){return this._disposer.isDisposed()},j.prototype.dispose=function(){this._disposer.dispose()},j}(),dm=function(j){function R(u,w,$,U){var K=j.call(this)||this;return K.duration=0,K.easing=ph,K.progress=0,K._loop=0,K._pause=!1,K._delayTimeout=null,K._time=0,K._isFinished=!1,K.className="Animation",no.animationsEnabled===!1&&($=0),K.object=u,K.animationOptions=Xi(w),K.duration=$,U&&(K.easing=U),K.applyTheme(),K}return re(R,j),R.prototype.debug=function(){},R.prototype.dispose=function(){j.prototype.dispose.call(this),this.pause()},R.prototype.delay=function(u){var w=this;if(u>0){this.pause(),Ur(this.object.animations,this);var $=setTimeout(function(){w._delayTimeout=null,w.start()},u);this._delayTimeout=new jr(function(){clearTimeout($)})}return this},R.prototype._start=function(){this._isFinished=!1,this._delayTimeout&&(this.removeDispose(this._delayTimeout),this._delayTimeout=null),this.stopSameAnimations(),this._pause=!1,Ur(ia.animations,this),Ur(this.object.animations,this),ia.requestFrame()},R.prototype.start=function(){this._start(),this._startTime=Date.now(),this._time=0,this.staticOptions=[];for(var u=this.animationOptions.length-1;u>=0;u--){var w=this.animationOptions[u];if(Ee(w.from)||(w.childObject?w.from=w.childObject[w.property]:(w.from=this.object[w.property],Ee(w.from)||(w.from=x4[w.property]))),w.from==w.to)$i(this.animationOptions,w);else if(!Ee(w.from)||!(w.from instanceof J)&&w.to instanceof J||w.from instanceof J&&!(w.to instanceof J))this.staticOptions.push(w),$i(this.animationOptions,w);else if(le(w.to))if(w.updateMethod=nz,w.from instanceof J){var $=this.object[sz(w.property,"pixel")];isNaN($)?(this.staticOptions.push(w),$i(this.animationOptions,w)):w.from=$}else isNaN(w.from)&&(this.staticOptions.push(w),$i(this.animationOptions,w));else w.to instanceof Te?w.from?w.updateMethod=bI:(this.staticOptions.push(w),$i(this.animationOptions,w)):w.to instanceof J?(w.updateMethod=G$,isNaN(w.from)||($=this.object[sz(w.property,"relative")],isNaN($)||(w.from=he(100*$)))):(this.staticOptions.push(w),$i(this.animationOptions,w))}if(this.applyStaticOptions(),this.events.isEnabled("animationstarted")){var U={type:"animationstarted",target:this,progress:this.progress};this.events.dispatchImmediately("animationstarted",U)}return this.update(),this.duration===0&&this.end(),this},R.prototype.loop=function(u){return le(u)||(u=1/0),this._loop=u,this},R.prototype.pause=function(){return this._pause=!0,this._delayTimeout&&(this.removeDispose(this._delayTimeout),this._delayTimeout=null),$i(ia.animations,this),$i(this.object.animations,this),this},R.prototype.resume=function(){return this._start(),this._startTime=Date.now()-this._time,this},R.prototype.end=function(){if(this._loop==0&&this.pause(),this.setProgress(1),this.applyStaticOptions(),this.events.isEnabled("animationended")){var u={type:"animationended",target:this,progress:this.progress};this.events.dispatchImmediately("animationended",u)}return this._loop>0?(this._loop--,this.start()):(this.stop(),this._isFinished=!0),this},R.prototype.kill=function(){this.pause(),this._isFinished=!0},R.prototype.isFinished=function(){return this._isFinished},R.prototype.applyStaticOptions=function(){var u=this;mi(this.staticOptions,function(w){w.childObject?w.childObject[w.property]=u.progress==1?w.to:w.from:u.object[w.property]=u.progress==1?w.to:w.from})},R.prototype.stop=function(u){if(this.pause(),!u&&this.events.isEnabled("animationstopped")){var w={type:"animationstopped",target:this,progress:this.progress};this.events.dispatchImmediately("animationstopped",w)}return this},R.prototype.setProgress=function(u){var w=this;if(this._time=this.duration*u,mi(this.animationOptions,function(U){if(U.updateMethod&&Ee(U.from)){var K=U.updateMethod(u,U.from,U.to);U.childObject?U.childObject[U.property]=K:w.object[U.property]=K}}),this.progress=u,this.events.isEnabled("animationprogress")){var $={type:"animationprogress",target:this,progress:this.progress};this.events.dispatchImmediately("animationprogress",$)}ia.requestFrame()},R.prototype.update=function(){if(!this._pause){var u=void 0;this._time=gt(Date.now()-this._startTime,0,this.duration);var w=this._time/this.duration;u=this.easing(w),(this.duration==0||!le(u)||w>=1)&&(u=1),this.setProgress(u),Ve(this._time/this.duration,6)==1&&this.end()}return this},Object.defineProperty(R.prototype,"delayed",{get:function(){return!!this._delayTimeout},enumerable:!0,configurable:!0}),R.prototype.stopSameAnimations=function(){var u=this;mi(H(this.object.animations),function(w){if(w!==u&&!w.delayed){var $=[];mi(u.animationOptions,function(U){mi(w.animationOptions,function(K){U.property==K.property&&U.childObject==K.childObject&&($.push(K),w.animationOptions.length==0&&w.kill())})}),mi($,function(U){$i(w.animationOptions,U)})}})},R.prototype.asFunction=function(u){return u=="easing"||j.prototype.asIs.call(this,u)},R}(pi),rf="http://www.w3.org/2000/svg",y3="http://www.w3.org/2000/xmlns/",wI="http://www.w3.org/1999/xlink";function Mu(j,R,u,w){return j.addEventListener(R,u,w||!1),new jr(function(){j.removeEventListener(R,u,w||!1)})}function U$(j){if(ct(j)){var R=document.getElementById(j);if(R==null&&(R=document.getElementsByClassName(j)[0]),R instanceof HTMLElement)return R}else if(j instanceof HTMLElement)return j}function Fb(j,R){if(j)if(j.classList)mi(R.split(" "),function(w){j.classList.add(w)});else{var u=j.getAttribute("class");u?j.setAttribute("class",u.split(" ").filter(function(w){return w!==R}).join(" ")+" "+R):j.setAttribute("class",R)}}function QS(j,R){if(j)if(j.classList)j.classList.remove(R);else{var u=j.getAttribute("class");u&&j.setAttribute("class",u.split(" ").filter(function(w){return w!==R}).join(" "))}}function oz(j,R,u){j.style[R]=u}function S4(j,R){return j.currentStyle?j.currentStyle[R]:document.defaultView.getComputedStyle(j,null).getPropertyValue(R)}function eC(){if(document.activeElement&&document.activeElement!=document.body)if(document.activeElement.blur)document.activeElement.blur();else{var j=document.createElement("button");j.style.position="fixed",j.style.top="0px",j.style.left="-10000px",document.body.appendChild(j),j.focus(),j.blur(),document.body.removeChild(j)}}function C4(j){if(j instanceof HTMLElement)j.focus();else{var R=document.createElement("input"),u=document.createElementNS(rf,"foreignObject");u.appendChild(R),j.appendChild(u),R.focus(),R.disabled=!0,u.remove()}}function xI(j){if(j.outerHTML)return j.outerHTML;var R=document.createElement("div"),u=j.cloneNode(!0);return R.appendChild(u),R.innerHTML}function m1(j){return j instanceof Object&&j&&j.nodeType===1}function az(j,R){for(var u=R;;){if(j===u)return!0;if(u.parentNode==null){if(u.host==null)return!1;u=u.host}else u=u.parentNode}}function Lb(j){for(var R=j;;){if(R.parentNode==null)return R.host!=null?R:null;R=R.parentNode}}function Jd(j){for(var R=j.ownerDocument,u=j;;){if(u.parentNode==null)return u===R||u.host!=null?u:null;u=u.parentNode}}function Nh(j,R){mi(j.attributes,function(u){u.value!=null&&R.setAttribute(u.name,u.value)})}function j$(j){$n(function(){try{var R=j.getBoundingClientRect(),u=R.left-Math.round(R.left),w=R.top-Math.round(R.top);u!==0&&ko(function(){j.style.left=u+"px"}),w!==0&&ko(function(){j.style.top=w+"px"})}catch{}})}var Ns=function(j){function R(u,w,$){var U=this,K=function(ie){return ie==null?(Ee(V$)||((ae=document.createElement("style")).type="text/css",no.nonce!=""&&ae.setAttribute("nonce",no.nonce),document.head.appendChild(ae),V$=ae.sheet),V$):((ae=document.createElement("style")).type="text/css",no.nonce!=""&&ae.setAttribute("nonce",no.nonce),ie.appendChild(ae),ae.sheet);var ae}(u);return(U=j.call(this,function(){var ie=Ri(K.cssRules,U._rule);if(ie===-1)throw new Error("Could not dispose StyleRule");K.deleteRule(ie)})||this)._rule=function(ie,ae){var we=ie.cssRules.length;return ie.insertRule(ae+"{}",we),ie.cssRules[we]}(K,w),gi($,function(ie,ae){U.setStyle(ie,ae)}),U}return re(R,j),Object.defineProperty(R.prototype,"selector",{get:function(){return this._rule.selectorText},set:function(u){this._rule.selectorText=u},enumerable:!0,configurable:!0}),R.prototype._setVendorPrefixName=function(u,w){var $=this._rule.style;$.setProperty("-webkit-"+u,w,""),$.setProperty("-moz-"+u,w,""),$.setProperty("-ms-"+u,w,""),$.setProperty("-o-"+u,w,""),$.setProperty(u,w,"")},R.prototype.setStyle=function(u,w){u==="transition"?this._setVendorPrefixName(u,w):this._rule.style.setProperty(u,w,"")},R}(jr),lz=0,z$=function(j){function R(u,w,$){var U=this,K=Ee($)?$:"__style_"+ ++lz+"__";return(U=j.call(this,u,"."+K,w)||this)._className=K,U}return re(R,j),Object.defineProperty(R.prototype,"className",{get:function(){return this._className},set:function(u){this._className=u,this.selector="."+u},enumerable:!0,configurable:!0}),R.prototype.toString=function(){return this._className},R}(Ns);function SI(j){if(document.readyState!=="loading")j();else{var R=function(){document.readyState!=="loading"&&(document.removeEventListener("readystatechange",R),j())};document.addEventListener("readystatechange",R)}}function v3(j){var R=S4(j,"font-family");if(R)return R;var u=j.parentElement||j.parentNode;return u?v3(u):void 0}function _3(j){var R=S4(j,"font-size");if(R)return R;var u=j.parentElement||j.parentNode;return u?_3(u):void 0}function tC(j,R){var u=j.getBoundingClientRect(),w=pt(R)?R:R?[R]:[];if(w.length){for(var $=0;$=0&&u.left>=0&&u.top<=K.top+K.height&&u.left<=K.left+K.width)return!0}return!1}return u.top>=0&&u.left>=0&&u.top<=(window.innerHeight||document.documentElement.clientHeight)&&u.left<=(window.innerWidth||document.documentElement.clientWidth)}var CI=function(){function j(R){this._isDisposed=!1,this._x=0,this._y=0,this._rotationY=0,this._rotationX=0,this._rotation=0,this._scale=1,this.node=typeof R=="string"?document.createElementNS(rf,R):R}return j.prototype.removeNode=function(){this.node&&this.node.parentNode&&this.node.parentNode.removeChild(this.node)},Object.defineProperty(j.prototype,"transformString",{get:function(){if(this.node)return this._transformString},enumerable:!0,configurable:!0}),j.prototype.transform=function(){var R="translate("+this._x+","+this._y+")";if(this._scale!=1&&(R+=(R?" ":"")+"scale("+this._scale+")"),this._rotation!=0){var u="rotate("+this._rotation+")";this._rotationX&&this._rotationY&&(u="rotate("+this._rotation+" "+this._rotationX+" "+this._rotationY+")"),R+=(R?" ":"")+u}this._transformString=R,this.node.setAttribute("transform",R)},j.prototype.getBBox=function(){var R={width:0,height:0,x:0,y:0};if(this.node&&this.node.parentNode)try{var u=this.node.getBBox();R.x=u.x,R.y=u.y,R.width=u.width,R.height=u.height}catch{}return R},j.prototype.moveTo=function(R){if(R){var u=R.x,w=R.y;this._x==u&&this._y==w||(this._x=u,this._y=w,this.transform())}},Object.defineProperty(j.prototype,"content",{get:function(){return this.node.innerHTML||""},set:function(R){this.node.innerHTML=R},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"textContent",{get:function(){return this.node.textContent||""},set:function(R){this.node.textContent=R},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"x",{get:function(){return this._x},set:function(R){this._x!=R&&(this._x=R,this.transform())},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"y",{get:function(){return this._y},set:function(R){this._y!=R&&(this._y=R,this.transform())},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"rotation",{get:function(){return this._rotation},set:function(R){this._rotation!=R&&(this._rotation=R,this.transform())},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"rotationX",{get:function(){return this._rotationX},set:function(R){this._rotationX!=R&&(this._rotationX=R,this.transform())},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"rotationY",{get:function(){return this._rotationY},set:function(R){this._rotationY!=R&&(this._rotationY=R,this.transform())},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"scale",{get:function(){return this._scale},set:function(R){this._scale!=R&&(this._scale=R,this.transform())},enumerable:!0,configurable:!0}),j.prototype.removeAttr=function(R){this.node.removeAttribute(R)},j.prototype.attr=function(R){var u=this;return gi(R,function(w,$){Ee($)?u.node.setAttribute(w,$):u.node.removeAttribute(w)}),this},j.prototype.getAttr=function(R){return this.node.getAttribute(R)},j.prototype.attrNS=function(R,u,w){return this.node.setAttributeNS(R,u,w),this},j.prototype.getAttrNS=function(R,u){return this.node.getAttributeNS(R,u)},j.prototype.removeStyle=function(R){this.node.style[R]=null,delete this.node.style[R]},j.prototype.getStyle=function(R){return this.node.style[R]},j.prototype.addStyle=function(R){var u=this;return gi(R,function(w,$){Ee($)?u.node.style[w]=$:u.removeStyle(w)}),this},j.prototype.addClass=function(R){Fb(this.node,R)},j.prototype.removeClass=function(R){QS(this.node,R)},j.prototype.setClass=function(R){this.node.setAttribute("class",R)},j.prototype.removeChildNodes=function(){for(;this.node.childNodes.length>0;)this.node.removeChild(this.node.firstChild)},j.prototype.isDisposed=function(){return this._isDisposed},j.prototype.dispose=function(){this.removeNode()},j}(),T4=function(j){function R(u){return j.call(this,u)||this}return re(R,j),R.prototype.add=function(u){u&&this.node.appendChild(u.node)},R.prototype.addToBack=function(u){if(u){var w=this.node.childNodes[0];w?w!=u.node&&this.node.insertBefore(u.node,w):this.node.appendChild(u.node)}},R.prototype.removeElement=function(u){if(u)try{u.node&&u.node.parentNode==this.node&&this.node.removeChild(u.node)}catch{}},R.prototype.hasChild=function(u){for(var w=0;w0;){var u=this.node.firstChild;u&&u.parentNode&&u.parentNode.removeChild(u)}},R.prototype.removeChildrenByTag=function(u){if(this.node.childNodes)for(var w=this.node.getElementsByTagName(u),$=0;$-1&&(this.focusable=!0),Vs().processFocusable(this))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"element",{get:function(){return this._element},set:function(u){this._element=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"originalPosition",{get:function(){return this._originalPosition||{x:0,y:0}},set:function(u){this._originalPosition=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"originalScale",{get:function(){return mt(this._originalScale,1)},set:function(u){this._originalScale!==u&&(this._originalScale=u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"originalAngle",{get:function(){return mt(this._originalAngle,0)},set:function(u){this._originalAngle!==u&&(this._originalAngle=u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"inertiaOptions",{get:function(){return this.sprite&&this.sprite._adapterO?this.sprite._adapterO.apply("inertiaOptions",this._inertiaOptions):this._inertiaOptions},set:function(u){this._inertiaOptions=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"hitOptions",{get:function(){return this.sprite&&this.sprite._adapterO?this.sprite._adapterO.apply("hitOptions",this._hitOptions):this._hitOptions},set:function(u){this._hitOptions=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"hoverOptions",{get:function(){return this.sprite&&this.sprite._adapterO?this.sprite._adapterO.apply("hoverOptions",this._hoverOptions):this._hoverOptions},set:function(u){this._hoverOptions=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"swipeOptions",{get:function(){return this.sprite&&this.sprite._adapterO?this.sprite._adapterO.apply("swipeOptions",this._swipeOptions):this._swipeOptions},set:function(u){this._swipeOptions=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"keyboardOptions",{get:function(){return this.sprite&&this.sprite._adapterO?this.sprite._adapterO.apply("keyboardOptions",this._keyboardOptions):this._keyboardOptions},set:function(u){this._keyboardOptions=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"mouseOptions",{get:function(){return this.sprite&&this.sprite._adapterO?this.sprite._adapterO.apply("mouseOptions",this._mouseOptions):this._mouseOptions},set:function(u){this._mouseOptions=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cursorOptions",{get:function(){return this.sprite&&this.sprite._adapterO?this.sprite._adapterO.apply("cursorOptions",this._cursorOptions):this._cursorOptions},set:function(u){this._cursorOptions=u},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.inertiaOptions=u.inertiaOptions,this.hitOptions=u.hitOptions,this.hoverOptions=u.hoverOptions,this.swipeOptions=u.swipeOptions,this.keyboardOptions=u.keyboardOptions,this.cursorOptions=u.cursorOptions,this.contextMenuDisabled=u.contextMenuDisabled,Vs().applyCursorOverStyle(this)},R.prototype.setEventDisposer=function(u,w,$){var U=this.eventDisposers.getKey(u);w?U==null&&this.eventDisposers.setKey(u,$()):U!=null&&(U.dispose(),this.eventDisposers.removeKey(u))},R.prototype.dispose=function(){j.prototype.dispose.call(this);var u=Vs();u.overObjects.removeValue(this),u.downObjects.removeValue(this),u.trackedObjects.removeValue(this),u.transformedObjects.removeValue(this),this.isHover&&this.wheelable&&u.unlockWheel(),u.focusedObject===this&&(u.focusedObject=void 0)},R}(pi),W$=function(){function j(R,u){this._disposed=!1,this.directionX=0,this.directionY=0,this.interaction=R,this.keyboardEvent=u,this._startedOn=new Date().getTime(),Vs().processDragStart(R),ia.animations.push(this),this.update()}return j.prototype.update=function(){var R=this.interaction,u=Vs().getKeyboardOption(R,"speed"),w=Vs().getKeyboardOption(R,"accelleration"),$=Vs().getKeyboardOption(R,"accellerationDelay"),U={x:0,y:0};this.keyboardEvent.shiftKey?(u*=.5,w=1):this.keyboardEvent.ctrlKey&&(u*=2);var K=new Date().getTime()-this._startedOn,ie=K-$;if(w>0&&ie>0){var ae=K/$;K=$,U.x+=this.directionX*(u*w*ae*ie),U.y+=this.directionY*(u*w*ae*ie)}U.x+=this.directionX*(u*K),U.y+=this.directionY*(u*K),Vs().handleTransformMove(R,U,{x:0,y:0},this.keyboardEvent,!0,!1)},j.prototype.isDisposed=function(){return this._disposed},j.prototype.dispose=function(){this._disposed||(Vs().processDragStop(this.interaction),$i(ia.animations,this))},j}(),E4=function(j){function R(u,w,$,U){var K=j.call(this)||this;return K.animations=[],K.className="Inertia",K.interaction=u,K.type=w,K.point=$,K.startPoint=U,K._disposers.push(new Mx(K.animations)),K}return re(R,j),Object.defineProperty(R.prototype,"x",{get:function(){return this.point.x},set:function(u){le(u)&&(this.point.x=u,this.handleMove())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"y",{get:function(){return this.point.y},set:function(u){le(u)&&(this.point.y=u,this.handleMove())},enumerable:!0,configurable:!0}),R.prototype.handleMove=function(){if(this.interaction.events.isEnabled("drag")){var u={type:"drag",target:this.interaction,shift:{x:this.x-this.startPoint.x,y:this.y-this.startPoint.y},startPoint:this.startPoint,point:{x:this.x,y:this.y},touch:!1};this.interaction.events.dispatchImmediately("drag",u)}},R.prototype.done=function(){this.interaction.inertias.removeKey(this.type),this.type==="move"&&Vs().processDragStop(this.interaction),this.dispose()},R}(Wt),uz=function(){function j(){}return j.prototype.getEventKey=function(R){var u;switch(R.keyCode||R.which){case 38:u="up";break;case 40:u="down";break;case 37:u="left";break;case 39:u="right";break;case 13:u="enter";break;case 27:u="esc";break;case 36:case 36:u="home";break;case 35:case 35:u="end";break;case 9:u="tab";break;case 17:u="ctrl";break;case 18:u="alt";break;case 16:u="shift";break;case 32:u="space";break;case 33:u="pgup";break;case 34:u="pgdn";break;case 45:u="ins";break;case 46:u="del";break;case 107:u="plus";break;case 109:u="minus";break;default:u="other"}return u},j.prototype.isKey=function(R,u){var w=this.getEventKey(R);return ct(u)&&(u=[u]),u.indexOf(w)!==-1},j.prototype.shiftKey=function(R){return R.shiftKey},j.prototype.ctrlKey=function(R){return R.ctrlKey},j.prototype.altKey=function(R){return R.altKey},j.prototype.metaKey=function(R){return R.metaKey},j}(),Dg=new uz,I4={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6};function A4(j){switch(j){case"year":return;case"month":return"year";case"week":case"day":return"month";case"hour":return"day";case"minute":return"hour";case"second":return"minute";case"millisecond":return"second"}}function Du(j,R){return Ee(R)||(R=1),I4[j]*R}function TI(){return new Date}function Jm(){return TI().getTime()}function iC(j){return new Date(j.getTime())}function EI(j,R,u,w){j=new Date(j.getTime()),R=new Date(R.getTime());var $=0,U=0;w||u=="millisecond"||($=j.getTimezoneOffset(),j.setUTCMinutes(j.getUTCMinutes()-$),U=R.getTimezoneOffset(),R.setUTCMinutes(R.getUTCMinutes()-U));var K=!1;switch(u){case"year":j.getUTCFullYear()!=R.getUTCFullYear()&&(K=!0);break;case"month":(j.getUTCFullYear()!=R.getUTCFullYear()||j.getUTCMonth()!=R.getUTCMonth())&&(K=!0);break;case"day":(j.getUTCMonth()!=R.getUTCMonth()||j.getUTCDate()!=R.getUTCDate())&&(K=!0);break;case"hour":j.getUTCHours()!=R.getUTCHours()&&(K=!0);break;case"minute":j.getUTCMinutes()!=R.getUTCMinutes()&&(K=!0);break;case"second":j.getUTCSeconds()!=R.getUTCSeconds()&&(K=!0);break;case"millisecond":j.getTime()!=R.getTime()&&(K=!0)}if(K)return!0;var ie=A4(u);return!!ie&&(j.setUTCMinutes(j.getUTCMinutes()+$),R.setUTCMinutes(R.getUTCMinutes()+U),EI(j,R,ie,w))}function xp(j,R,u,w){var $=0;switch(w||R=="millisecond"||($=j.getTimezoneOffset(),j.setUTCMinutes(j.getUTCMinutes()-$)),R){case"day":var U=j.getUTCDate();j.setUTCDate(U+u);break;case"second":var K=j.getUTCSeconds();j.setUTCSeconds(K+u);break;case"millisecond":var ie=j.getUTCMilliseconds();j.setUTCMilliseconds(ie+u);break;case"hour":var ae=j.getUTCHours();j.setUTCHours(ae+u);break;case"minute":var we=j.getUTCMinutes();j.setUTCMinutes(we+u);break;case"year":var Re=j.getUTCFullYear();j.setUTCFullYear(Re+u);break;case"month":var $e=j.getUTCMonth();j.setUTCMonth($e+u);break;case"week":var Xe=j.getUTCDate();j.setUTCDate(Xe+7*u)}if(!w&&R!="millisecond"&&(j.setUTCMinutes(j.getUTCMinutes()+$),R=="day"||R=="week"||R=="month"||R=="year")){var Qe=j.getTimezoneOffset();if(Qe!=$){var dt=Qe-$;j.setUTCMinutes(j.getUTCMinutes()+dt),j.getTimezoneOffset()!=Qe&&j.setUTCMinutes(j.getUTCMinutes()-dt)}}return j}function od(j,R,u,w,$,U,K,ie){K===void 0&&(K=0),le(u)||(u=1);var ae=0;switch(ie&&["day","month","week","year"].indexOf(R)!=-1&&(j=w3(j,ie)),$||R=="millisecond"||(ae=j.getTimezoneOffset(),j.setUTCMinutes(j.getUTCMinutes()-ae)),R){case"day":var we=j.getUTCDate();if(u>1){if(U){U=od(U,"day",1);var Re=j.getTime()-U.getTime(),$e=Math.floor(Re/Du("day")/u),Xe=Du("day",$e*u);j.setTime(U.getTime()+Xe-ae*Du("minute"))}}else j.setUTCDate(we);j.setUTCHours(0,0,0,0);break;case"second":var Qe=j.getUTCSeconds();u>1&&(Qe=Math.floor(Qe/u)*u),j.setUTCSeconds(Qe,0);break;case"millisecond":if(u==1)return j;var dt=j.getUTCMilliseconds();dt=Math.floor(dt/u)*u,j.setUTCMilliseconds(dt);break;case"hour":var Gt=j.getUTCHours();u>1&&(Gt=Math.floor(Gt/u)*u),j.setUTCHours(Gt,K,0,0);break;case"minute":var Yt=j.getUTCMinutes();dt=j.getUTCMilliseconds(),u>1&&(Yt=Math.floor(Yt/u)*u),j.setUTCMinutes(Yt,0,0);break;case"month":var ai=j.getUTCMonth();u>1&&(ai=Math.floor(ai/u)*u),j.setUTCMonth(ai,1),j.setUTCHours(0,K,0,0);break;case"year":var oi=j.getUTCFullYear();u>1&&(oi=Math.floor(oi/u)*u),j.setUTCFullYear(oi,0,1),j.setUTCHours(0,K,0,0);break;case"week":var Ui=j.getUTCDate(),Ji=j.getUTCDay();le(w)||(w=1),Ui=Ji>=w?Ui-Ji+w:Ui-(7+Ji)+w,j.setUTCDate(Ui),j.setUTCHours(0,K,0,0)}if(!$&&R!="millisecond"&&(j.setUTCMinutes(j.getUTCMinutes()+ae),R=="day"||R=="week"||R=="month"||R=="year")){var Si=j.getTimezoneOffset();if(Si!=ae){var Hi=Si-ae;j.setUTCMinutes(j.getUTCMinutes()+Hi)}}return j}function w3(j,R){return new Date(j.toLocaleString("en-US",{timeZone:R}))}function cz(j){var R=new Date;return R.setHours(0,0,0,0),w3(R,j).getMinutes()}var q$=function(j){function R(){var u=j.call(this)||this;return u._globalEventsAdded=!1,u._pointerEvents={pointerdown:"mousedown",pointerup:"mouseup",pointermove:"mousemove",pointercancel:"mouseup",pointerover:"mouseover",pointerout:"mouseout",wheel:"wheel"},u._usePointerEventsOnly=!1,u._useTouchEventsOnly=!1,u._addHoverEvents=!0,u._passiveSupported=!1,u._delayedEvents={out:[]},u.overObjects=new Us,u.downObjects=new Us,u.trackedObjects=new Us,u.transformedObjects=new Us,u.pointers=new fa,u.inertiaOptions=new fa,u.hitOptions={doubleHitTime:300,hitTolerance:10,noFocus:!0},u.hoverOptions={touchOutBehavior:"leave",touchOutDelay:1e3},u.swipeOptions={time:500,verticalThreshold:75,horizontalThreshold:30},u.keyboardOptions={speed:.1,accelleration:1.2,accellerationDelay:2e3},u.mouseOptions={sensitivity:1},u.className="Interaction",u.body=u.getInteraction(document.body),u._disposers.push(u.body),window.hasOwnProperty("PointerEvent")?(u._pointerEvents.pointerdown="pointerdown",u._pointerEvents.pointerup="pointerup",u._pointerEvents.pointermove="pointermove",u._pointerEvents.pointercancel="pointercancel",u._pointerEvents.pointerover="pointerover",u._pointerEvents.pointerout="pointerout"):window.hasOwnProperty("MSPointerEvent")?(u._pointerEvents.pointerdown="MSPointerDown",u._pointerEvents.pointerup="MSPointerUp",u._pointerEvents.pointermove="MSPointerMove",u._pointerEvents.pointercancel="MSPointerUp",u._pointerEvents.pointerover="MSPointerOver",u._pointerEvents.pointerout="MSPointerOut"):typeof matchMedia<"u"&&matchMedia("(pointer:fine)").matches?"ontouchstart"in window&&(u._addHoverEvents=!1,u._useTouchEventsOnly=!0):window.navigator.userAgent.match(/MSIE /)||u.fullFF()?u._usePointerEventsOnly=!0:u._useTouchEventsOnly=!0,"onwheel"in document.createElement("div")?u._pointerEvents.wheel="wheel":Ee(document.onmousewheel)&&(u._pointerEvents.wheel="mousewheel"),u.inertiaOptions.setKey("move",{time:100,duration:500,factor:1,easing:y4}),u.inertiaOptions.setKey("resize",{time:100,duration:500,factor:1,easing:y4}),u._passiveSupported=R.passiveSupported,u.applyTheme(),u}return re(R,j),R.prototype.fullFF=function(){return window.navigator.userAgent.match(/Firefox/)&&!window.navigator.userAgent.match(/Android/)},R.prototype.debug=function(){},R.prototype.addGlobalEvents=function(){var u=this;this._globalEventsAdded||(this._useTouchEventsOnly||(this._disposers.push(Mu(document,this._pointerEvents.pointerdown,function(w){u.handleGlobalPointerDown(w)})),this._disposers.push(Mu(document,this._pointerEvents.pointermove,function(w){u.handleGlobalPointerMove(w)})),this._disposers.push(Mu(document,this._pointerEvents.pointerup,function(w){u.handleGlobalPointerUp(w)})),this._disposers.push(Mu(document,this._pointerEvents.pointercancel,function(w){u.handleGlobalPointerUp(w,!0)})),this._disposers.push(Mu(document,"mouseenter",function(w){Ee(w.relatedTarget)||w.buttons!=0&&w.which!=0||u.handleDocumentLeave(w)}))),this._usePointerEventsOnly||(this._disposers.push(Mu(document,"touchstart",function(w){u.handleGlobalTouchStart(w)})),this._disposers.push(Mu(document,"touchmove",function(w){u.handleGlobalTouchMove(w)})),this._disposers.push(Mu(document,"touchend",function(w){u.handleGlobalTouchEnd(w)}))),this._disposers.push(Mu(document,"keydown",function(w){u.handleGlobalKeyDown(w)})),this._disposers.push(Mu(document,"keyup",function(w){u.handleGlobalKeyUp(w)})),this._globalEventsAdded=!0)},R.prototype.processClickable=function(u){this.processTouchable(u)},R.prototype.processContextMenu=function(u){u.contextMenuDisabled?u.eventDisposers.hasKey("contextMenuDisabled")||u.eventDisposers.setKey("contextMenuDisabled",Mu(u.element,"contextmenu",function(w){w.preventDefault()})):u.eventDisposers.hasKey("contextMenuDisabled")&&u.eventDisposers.getKey("contextMenuDisabled").dispose()},R.prototype.processHoverable=function(u){var w=this;if(u.hoverable||u.trackable)this.addGlobalEvents(),this.applyCursorOverStyle(u),!u.eventDisposers.hasKey("hoverable")&&this._addHoverEvents&&u.eventDisposers.setKey("hoverable",new Nn([Mu(u.element,this._pointerEvents.pointerout,function(U){return w.handlePointerOut(u,U)}),Mu(u.element,this._pointerEvents.pointerover,function(U){return w.handlePointerOver(u,U)})])),u.trackable;else{var $=u.eventDisposers.getKey("hoverable");$!=null&&($.dispose(),u.eventDisposers.removeKey("hoverable"))}this.processTouchable(u)},R.prototype.processMovable=function(u){(u.draggable||u.swipeable||u.trackable||u.resizable)&&(this.isGlobalElement(u)||u.isTouchProtected||this.prepElement(u),this.applyCursorOverStyle(u)),this.processTouchable(u)},R.prototype.processTrackable=function(u){this.processHoverable(u),this.processMovable(u),u.trackable?this.trackedObjects.moveValue(u):this.trackedObjects.removeValue(u)},R.prototype.processDraggable=function(u){this.processMovable(u)},R.prototype.processSwipeable=function(u){this.processMovable(u)},R.prototype.processResizable=function(u){this.processMovable(u)},R.prototype.processWheelable=function(u){var w=this;if(u.wheelable)u.eventDisposers.hasKey("wheelable")||u.eventDisposers.setKey("wheelable",new Nn([Mu(u.element,this._pointerEvents.wheel,function(U){return w.handleMouseWheel(u,U)},!!this._passiveSupported&&{passive:!1}),u.events.on("out",function(U){u.wheelable&&w.unlockWheel()}),u.events.on("over",function(U){u.wheelable&&w.lockWheel()})]));else{var $=u.eventDisposers.getKey("wheelable");$!=null&&($.dispose(),u.eventDisposers.removeKey("wheelable"))}},R.prototype.processFocusable=function(u){var w=this;if(u.focusable===!0&&u.tabindex>-1&&!this._useTouchEventsOnly)u.eventDisposers.hasKey("focusable")||u.eventDisposers.setKey("focusable",new Nn([Mu(u.element,"focus",function(U){return w.handleFocus(u,U)}),Mu(u.element,"blur",function(U){return w.handleBlur(u,U)}),Mu(u.element,this._pointerEvents.pointerdown,function(U){return w.handleFocusBlur(u,U)}),Mu(u.element,"touchstart",function(U){return w.handleFocusBlur(u,U)},!!this._passiveSupported&&{passive:!1})]));else{var $=u.eventDisposers.getKey("focusable");$!=null&&($.dispose(),u.eventDisposers.removeKey("focusable"))}},R.prototype.processTouchable=function(u){var w=this;if(u.clickable||u.hoverable||u.trackable||u.draggable||u.swipeable||u.resizable)this.addGlobalEvents(),u.eventDisposers.hasKey("touchable")||(this._useTouchEventsOnly||this._usePointerEventsOnly?this._useTouchEventsOnly?this._usePointerEventsOnly||u.eventDisposers.setKey("touchable",Mu(u.element,"touchstart",function(U){return w.handleTouchDown(u,U)},!!this._passiveSupported&&{passive:!1})):u.eventDisposers.setKey("touchable",Mu(u.element,this._pointerEvents.pointerdown,function(U){return w.handlePointerDown(u,U)})):u.eventDisposers.setKey("touchable",new Nn([Mu(u.element,this._pointerEvents.pointerdown,function(U){return w.handlePointerDown(u,U)}),Mu(u.element,"touchstart",function(U){return w.handleTouchDown(u,U)},!!this._passiveSupported&&{passive:!1})])));else{var $=u.eventDisposers.getKey("touchable");$!=null&&($.dispose(),u.eventDisposers.removeKey("touchable"))}},R.prototype.handleFocus=function(u,w){if(u.focusable){if(u.isFocused=!0,u.events.isEnabled("focus")&&!ia.isPaused){var $={type:"focus",target:u,event:w};u.events.dispatchImmediately("focus",$)}}else w.preventDefault()},R.prototype.handleFocusBlur=function(u,w){u.focusable!==!1&&this.getHitOption(u,"noFocus")&&u.events.once("focus",function(){u.events.disableType("blur"),eC(),u.sprite&&u.sprite.handleBlur(),u.events.enableType("blur")})},R.prototype.handleBlur=function(u,w){if(u.focusable){if(u.isFocused=!1,u.events.isEnabled("blur")&&!ia.isPaused){var $={type:"blur",target:u,event:w};u.events.dispatchImmediately("blur",$)}}else w.preventDefault()},R.prototype.handleGlobalKeyDown=function(u){if(this.focusedObject){if(Dg.isKey(u,"esc"))eC();else if(this.focusedObject.draggable&&Dg.isKey(u,["up","down","left","right"])){u.preventDefault();var w=this.focusedObject,$="interactionKeyboardObject";if(w.eventDisposers.hasKey($))return;var U=new W$(w,u);switch(w.eventDisposers.setKey($,U),Dg.getEventKey(u)){case"up":U.directionY=-1;break;case"down":U.directionY=1;break;case"left":U.directionX=-1;break;case"right":U.directionX=1}}}},R.prototype.handleGlobalKeyUp=function(u){var w="interactionKeyboardObject";if(this.focusedObject){var $=this.focusedObject.eventDisposers.getKey(w);$!=null&&(u.preventDefault(),$.dispose(),this.focusedObject.eventDisposers.removeKey(w));var U=this.focusedObject.sprite;Dg.isKey(u,"enter")&&U&&(U.events.isEnabled("hit")||U.events.isEnabled("toggled")?this.focusedObject.dispatchImmediately("hit"):U.showTooltipOn=="hit"&&this.focusedObject.dispatchImmediately("up"))}},R.prototype.handleGlobalPointerMove=function(u){var w=this.getPointer(u);if(w.point=this.getPointerPoint(u),this.events.isEnabled("track")&&!ia.isPaused){var $={type:"track",target:this,event:u,pointer:w,touch:w.touch};this.events.dispatchImmediately("track",$)}this.addBreadCrumb(w,w.point),this.handleGlobalMove(w,u)},R.prototype.handleGlobalPointerDown=function(u){this.processDelayed();var w=this.getPointer(u);if(this.events.isEnabled("down")&&!ia.isPaused){var $={type:"down",target:this,event:u,pointer:w,touch:w.touch};this.events.dispatchImmediately("down",$)}},R.prototype.preventTouchAction=function(u){u.defaultPrevented||u.preventDefault()},R.prototype.handleGlobalPointerUp=function(u,w){w===void 0&&(w=!1);var $=this.getPointer(u);if(this.events.isEnabled("up")&&!ia.isPaused){var U={type:"up",target:this,event:u,pointer:$,touch:$.touch};this.events.dispatchImmediately("up",U)}this.handleGlobalUp($,u,w)},R.prototype.handleGlobalTouchMove=function(u){for(var w=0;w=U-this.getHitOption(u,"doubleHitTime")){if(U-u.lastHit<100)return;if(u.lastHit=void 0,u.lastHitPointer=void 0,u.events.isEnabled("doublehit")&&!ia.isPaused){var K={type:"doublehit",target:u,point:w.point,event:$,touch:w.touch};u.events.dispatchImmediately("doublehit",K)}}else u.lastHit=U,u.lastHitPointer=w,w.button===3?u.events.isEnabled("rightclick")&&!ia.isPaused&&(K={type:"rightclick",target:u,event:$},u.events.dispatchImmediately("rightclick",K)):u.events.isEnabled("hit")&&!ia.isPaused&&(K={type:"hit",target:u,event:$,point:w.point,touch:w.touch},u.events.dispatchImmediately("hit",K))},R.prototype.handleOver=function(u,w,$,U){if(u.hoverable){var K=!1;if(this.shouldCancelHovers(w)&&this.areTransformed()&&this.moved(w,this.getHitOption(u,"hitTolerance"))&&(K=!0,this.cancelAllHovers($)),this.processDelayed(),u.overPointers.moveValue(w),!u.isRealHover&&(K||(u.isHover=!0,u.isRealHover=!0,this.overObjects.moveValue(u)),this.handleTrack(this.body,w,$,!0),u.events.isEnabled("over")&&!ia.isPaused&&!K)){var ie={type:"over",target:u,event:$,pointer:w,touch:w.touch};u.events.dispatchImmediately("over",ie)}}},R.prototype.handleOut=function(u,w,$,U,K){var ie=this;if(U===void 0&&(U=!1),K===void 0&&(K=!1),u.hoverable&&(u.overPointers.removeValue(w),u.isHover&&(!u.hasDelayedOut||K))){if(U&&u.overPointers.length)return;if(w&&w.touch&&!K&&!this.old(w)){var ae=this.getHoverOption(u,"touchOutBehavior");if(ae=="leave")return this._delayedEvents.out.push({type:"out",io:u,pointer:w,event:$,keepUntil:Jm()+500}),void(u.hasDelayedOut=!0);if(ae=="delay"&&this.getHoverOption(u,"touchOutDelay"))return void this._delayedEvents.out.push({type:"out",io:u,pointer:w,event:$,keepUntil:Jm()+500,timeout:this.setTimeout(function(){ie.handleOut(u,w,$,!0)},this.getHoverOption(u,"touchOutDelay"))})}if(u.isHover=!1,this.overObjects.removeValue(u),!u.isDisposed()&&u.events.isEnabled("out")&&!ia.isPaused){var we={type:"out",target:u,event:$,pointer:w,touch:w.touch};u.events.dispatchImmediately("out",we)}u.overPointers.clear(),u.hasDelayedOut=!1}},R.prototype.processDelayed=function(){for(var u;u=this._delayedEvents.out.pop();)u.timeout&&u.timeout.dispose(),this.handleOut(u.io,u.pointer,u.event,!1,!0)},R.prototype.handleDown=function(u,w,$){if(this.maybePreventDefault(u,$,w),u.inert&&this.stopInertia(u),this.handleOver(u,w,$,!0),u.downPointers.moveValue(w),this.applyCursorDownStyle(u,w),u.isDown||(u.focusable!==!1&&this.getHitOption(u,"noFocus")&&this.focusedObject&&eC(),u.isDown=!0,this.downObjects.moveValue(u),u.draggable&&this.processDragStart(u,w,$),u.resizable&&this.processResizeStart(u,w,$)),u.events.isEnabled("down")&&!ia.isPaused){var U={type:"down",target:u,event:$,pointer:w,touch:w.touch};u.events.dispatchImmediately("down",U)}},R.prototype.handleGlobalUp=function(u,w,$){var U=this;$===void 0&&($=!1);var K=this.downObjects.values.slice();K.sort(function(ie,ae){if(ie&&ae){var we=ie.element.compareDocumentPosition(ae.element);return we&Node.DOCUMENT_POSITION_CONTAINED_BY?1:we&Node.DOCUMENT_POSITION_CONTAINS?-1:0}return 0}),mi(K,function(ie){ie&&ie.downPointers.contains(u)&&U.handleUp(ie,u,w,$)})},R.prototype.handleDocumentLeave=function(u){var w=this;pr(this.downObjects.backwards().iterator(),function($){$.downPointers.each(function(U){w.handleUp($,U,u)})})},R.prototype.handleUp=function(u,w,$,U){if(U===void 0&&(U=!1),this.restoreCursorDownStyle(u,w),u.downPointers.removeValue(w),(w.touch||this._useTouchEventsOnly)&&this.handleOut(u,w,$,!0),u.isDown){if(u.downPointers.length==0&&(u.isDown=!1,this.downObjects.removeValue(u)),u.events.isEnabled("up")&&!ia.isPaused){var K={type:"up",target:u,event:$,pointer:w,touch:w.touch};u.events.dispatchImmediately("up",K)}U||(u.swipeable&&this.swiped(u,w)?this.handleSwipe(u,w,$):(u.clickable&&!this.moved(w,this.getHitOption(u,"hitTolerance"))&&this.handleHit(u,w,$),u.inert&&this.moved(w,this.getHitOption(u,"hitTolerance"))?this.handleInertia(u,w):u.draggable&&this.processDragStop(u,w,$),u.resizable&&this.processResizeStop(u,w,$)))}},R.prototype.maybePreventDefault=function(u,w,$){!Ee(w)||!(u.draggable||u.swipeable||u.trackable||u.resizable)||this.isGlobalElement(u)||w.cancelable===!1||u.isTouchProtected&&$&&$.touch||w.preventDefault()},R.prototype.cancelAllHovers=function(u){var w=this;pr(this.overObjects.backwards().iterator(),function($){if($){var U=$.overPointers.getIndex(0);w.handleOut($,U,u,!0,!0)}})},R.prototype.shouldCancelHovers=function(u){return no.disableHoverOnTransform=="always"||no.disableHoverOnTransform=="touch"&&u.touch},R.prototype.handleGlobalMove=function(u,w){var $,U=this;if(!u.touch){var K=typeof($=u.lastEvent).composedPath=="function"?$.composedPath()[0]:$.target;pr(this.overObjects.backwards().iterator(),function(ie){if(ie&&ie.overPointers.contains(u)&&ie.hoverable){var ae=!1;ie.element&&u.lastEvent&&az(ie.element,K)||(ae=!0),ae&&U.handleOut(ie,u,w,!0)}})}pr(this.transformedObjects.backwards().iterator(),function(ie){!ie.downPointers.contains(u)||ie.swipeable&&U.swiping(ie,u)||!ie.draggable&&!ie.resizable||U.handleTransform(ie,w)}),pr(this.trackedObjects.backwards().iterator(),function(ie){ie.overPointers.contains(u)||U.handleTrack(ie,u,w)})},R.prototype.handleTrack=function(u,w,$,U){if(U===void 0&&(U=!1),(U||this.moved(w,0))&&u.events.isEnabled("track")&&!ia.isPaused){var K={type:"track",target:u,event:$,point:w.point,pointer:w,touch:w.touch};u.events.dispatchImmediately("track",K)}},R.prototype.handleSwipe=function(u,w,$){if(u.events.isEnabled("swipe")&&!ia.isPaused){var U={type:"swipe",target:u,event:$,touch:w.touch};u.events.dispatchImmediately("swipe",U)}w.startPoint.x0?u.events.isEnabled("swiperight")&&!ia.isPaused&&u.events.dispatchImmediately("wheelright",{type:"wheelright",target:u,event:K,point:w.point,shift:ie}):U<0?u.events.isEnabled("wheelup")&&!ia.isPaused&&u.events.dispatchImmediately("wheelup",{type:"wheelup",target:u,event:K,point:w.point,shift:ie}):U>0&&u.events.isEnabled("wheeldown")&&!ia.isPaused&&u.events.dispatchImmediately("wheeldown",{type:"wheeldown",target:u,event:K,point:w.point,shift:ie})},R.prototype.handleInertia=function(u,w){u.draggable&&u.downPointers.length===0&&this.handleMoveInertia(u,w),u.resizable&&u.downPointers.length>1&&this.handleResizeInertia(u,w)},R.prototype.handleMoveInertia=function(u,w){var $=u,U={x:w.point.x,y:w.point.y},K={x:w.startPoint.x,y:w.startPoint.y},ie=new E4($,"move",U,K),ae=this.getTrailPoint(w,Jm()-this.getInertiaOption(u,"move","time"));if(ae!==void 0){var we=this.getInertiaOption(u,"move","factor"),Re=[{to:w.point.x+(w.point.x-ae.point.x)*we,property:"x"},{to:w.point.y+(w.point.y-ae.point.y)*we,property:"y"}],$e=new dm(ie,Re,this.getInertiaOption(u,"move","duration"),this.getInertiaOption(u,"move","easing")).start();this._disposers.push($e.events.on("animationended",function(Xe){ie.done()})),u.inertias.setKey("move",ie)}else this.processDragStop(u,w,w.lastUpEvent)},R.prototype.handleResizeInertia=function(u,w){},R.prototype.handleTransform=function(u,w){var $,U,K,ie=u.downPointers.getIndex(0),ae=null,we=null;ie&&(ae=ie.point,we=ie.startPoint),K=U={x:u.originalPosition.x,y:u.originalPosition.y};for(var Re=!0,$e=1;$e$-this.getSwipeOption(u,"time")},R.prototype.swiped=function(u,w){var $=Jm();return!w.swipeCanceled&&Math.abs(w.startPoint.x-w.point.x)>this.getSwipeOption(u,"horizontalThreshold")&&Math.abs(w.startPoint.y-w.point.y)$-this.getSwipeOption(u,"time")},R.prototype.applyCursorOverStyle=function(u){var w=u.cursorOptions;if(Ee(w.overStyle))for(var $=0;$w||Math.abs(U.y)>w},R.prototype.old=function(u,w){return w===void 0&&(w=300),Jm()-u.startTime>w},R.prototype.getShift=function(u){return{x:u.startPoint.x-u.point.x,y:u.startPoint.y-u.point.y}},R.prototype.getTrailPoint=function(u,w){for(var $,U=0;U=w){$=u.track[U];break}return $},R.prototype.pointerExists=function(u,w){var $=!1;return u.each(function(U){U!=w&&($=U.point.x==w.point.x&&U.point.y==w.point.y)}),$},R.prototype.getInteraction=function(u){return new H$(u)},R.prototype.setTemporaryStyle=function(u,w,$){var U=u.element;Ee(U.style[w])&&!u.replacedStyles.hasKey(w)&&u.replacedStyles.setKey(w,U.style[w]),oz(U,w,$)},R.prototype.restoreStyle=function(u,w){u.replacedStyles.hasKey(w)?(u.element.style[w]=u.replacedStyles.getKey(w),u.replacedStyles.removeKey(w)):delete u.element.style[w]},R.prototype.restoreAllStyles=function(u){pr(u.replacedStyles.iterator(),function(w){var $=w[0],U=w[1];u.element.style[$]=U,u.replacedStyles.removeKey($)})},R.prototype.dispose=function(){this.isDisposed()||(j.prototype.dispose.call(this),this.restoreAllStyles(this.body),this.unlockWheel())},R.prototype.log=function(u,w,$){if(w.changedTouches)for(var U=0;U0},R.prototype.logTouch=function(u,w,$){console.log(u+" "+w+" touch "+$.identifier)},Object.defineProperty(R,"passiveSupported",{get:function(){var u=this;if(this._passiveSupported==null)try{var w=Object.defineProperty({},"passive",{get:function(){u._passiveSupported=!0}});window.addEventListener("test",w,w),window.removeEventListener("test",w,w)}catch{this._passiveSupported=!1}return this._passiveSupported},enumerable:!0,configurable:!0}),R}(pi),Fg=null;function Vs(){return Fg==null&&(Fg=new q$),Fg}var N0=function(j){function R(){var u=j.call(this)||this;return u.adapter=new tc(u),u._elements={},u._IOs={},u._content="",u._title="",u._classPrefix="ampopup",u._defaultStyles=!0,u._showCurtain=!1,u._draggable=!0,u._align="center",u._dynamicResize=!0,u._verticalAlign="middle",u._shift={x:0,y:0},u._tempShift={x:0,y:0},u._readerTitle="",u._closable=!0,u._cssLoaded=!1,u._fitTo="window",u.isTemplate=!1,u._sized=!1,u.className="Popup",u}return re(R,j),R.prototype.open=function(){this.container&&(this._elements.wrapper&&this.container.appendChild(this._elements.wrapper),this._elements.curtain&&(this.container.appendChild(this._elements.curtain),this.showCurtain=this.showCurtain),this.positionElement(),this.dispatchImmediately("opened"))},R.prototype.close=function(){this._elements.wrapper&&this._elements.wrapper.parentElement&&this._elements.wrapper.parentElement.removeChild(this._elements.wrapper),this._elements.curtain&&this._elements.curtain.parentElement&&this._elements.curtain.parentElement.removeChild(this._elements.curtain),this.dispatchImmediately("closed"),this.releasePointers()},R.prototype.dispose=function(){this.close(),j.prototype.dispose.call(this)},R.prototype.positionElement=function(u){var w=this;u===void 0&&(u=!0),this._elements.wrapper&&setTimeout(function(){if(w._elements.wrapper){if(u||!w._sized){w._elements.wrapper.style.opacity="0.01",w._elements.wrapper.style.left="0",w._elements.wrapper.style.top="0",w._elements.wrapper.style.margin="0 0 0 0",w._elements.wrapper.style.width="",w._elements.wrapper.style.height="";var $=w._elements.wrapper.getBoundingClientRect();w._elements.wrapper.style.width=$.width+"px",w._elements.wrapper.style.height=$.height+"px",w._sized=!0}if(w.dynamicResize)for(var U=w._elements.wrapper.getElementsByTagName("img"),K=0;K$+j.delay)&&($=ie,mi(w._targets,function(ae){var we=ae.target.getBoundingClientRect();we.width===ae.size.width&&we.height===ae.size.height||(ae.size=we,ae.callback())})),w._timer=requestAnimationFrame(U)};this._timer=requestAnimationFrame(U)}var K=R.getBoundingClientRect();this._targets.push({target:R,callback:u,size:K})},j.prototype.removeTarget=function(R){Mr(this._targets,function(u){return u.target!==R}),this._targets.length===0&&cancelAnimationFrame(this._timer)},j.delay=200,j}(),R4=null,rC=function(){function j(R,u){this._disposed=!1,this._sensor=(R4===null&&(R4=typeof ResizeObserver<"u"?new O4:new hz),R4),this._element=R,this._sensor.addTarget(R,u)}return j.prototype.isDisposed=function(){return this._disposed},j.prototype.dispose=function(){this._disposed||(this._disposed=!0,this._sensor.removeTarget(this._element))},Object.defineProperty(j.prototype,"sensor",{get:function(){return this._sensor},enumerable:!0,configurable:!0}),j.prototype.reset=function(){P4("resizeSensor.reset() is no longer needed and can be removed")},j}(),M4=[],kb=function(){function j(R,u){var w=this;this._disposed=!1,this.autoResize=!0,this.nonExportableSprites=[],this._disposers=[],this.cssScale=1,this._printing=!1,this.htmlElement=R,u||(this._printing=!1,this.initSensor(),this._disposers.push(Mu(window,"beforeprint",function(){w._printing=!0})),this._disposers.push(Mu(window,"afterprint",function(){w._printing=!1}))),M4.push(this);var $=document.createElement("div"),U=$.style;U.width="100%",U.height="100%",U.position="relative",R.appendChild($),this.SVGContainer=$}return j.prototype.initSensor=function(){var R=this;this.resizeSensor&&this.resizeSensor.dispose(),this.resizeSensor=new rC(this.htmlElement,function(){R.autoResize&&!R._printing&&R.measure()}),this._disposers.push(this.resizeSensor)},j.prototype.measure=function(){var R=ds(this.htmlElement),u=Ry(this.htmlElement),w=this.container;w&&(this.width==R&&this.height==u||(this.width=R,this.height=u,R>0&&(w.maxWidth=R),u>0&&(w.maxHeight=u),j$(this.SVGContainer)),w.maxWidth||(w.maxWidth=0),w.maxHeight||(w.maxHeight=0),this.cssScale=1,this.checkTransform(this.htmlElement))},Object.defineProperty(j.prototype,"container",{get:function(){return this._container},set:function(R){this._container=R,this.measure()},enumerable:!0,configurable:!0}),j.prototype.isDisposed=function(){return this._disposed},j.prototype.dispose=function(){this._disposed||$i(M4,this),mi(this._disposers,function(R){R.dispose()})},Object.defineProperty(j.prototype,"hideOverflow",{set:function(R){this.SVGContainer.style.overflow=R?"hidden":""},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"modal",{get:function(){return Ee(this._modal)||(this._modal=new Y$,this._modal.container=this.SVGContainer,this._disposers.push(this._modal)),this._modal},enumerable:!0,configurable:!0}),j.prototype.openModal=function(R,u){this.closeModal();var w=this.modal;return w.content=R,w.readerTitle=u||"",w.title=u||"",w.open(),w},j.prototype.closeModal=function(){this._modal&&this.modal.close()},Object.defineProperty(j.prototype,"popups",{get:function(){if(!Ee(this._popups)){var R=new N0;R.container=this.SVGContainer,this._popups=new Xs(R),this._disposers.push(new ta(this._popups)),this._disposers.push(this._popups.template)}return this._popups},enumerable:!0,configurable:!0}),j.prototype.openPopup=function(R,u){var w=this.popups.create();return w.content=R,Ee(u)&&(w.title=u),w.open(),w},j.prototype.closeAllPopups=function(){this.popups.each(function(R){R.close()})},Object.defineProperty(j.prototype,"readerAlertElement",{get:function(){if(!Ee(this._readerAlertElement)){var R=document.createElement("div");R.setAttribute("role","alert"),R.style.zIndex="-100000",R.style.opacity="0",R.style.position="absolute",R.style.top="0",this.SVGContainer.appendChild(R),this._readerAlertElement=R}return this._readerAlertElement},enumerable:!0,configurable:!0}),j.prototype.readerAlert=function(R){this.readerAlertElement.innerHTML=R},j.prototype.checkTransform=function(R){if(window.getComputedStyle){if(R&&R.style){var u=window.getComputedStyle(R,null);if(u){var w=u.getPropertyValue("-webkit-transform")||u.getPropertyValue("-moz-transform")||u.getPropertyValue("-ms-transform")||u.getPropertyValue("-o-transform")||u.getPropertyValue("transform");if(w&&w!=="none"){var $=w.split("(")[1].split(")")[0].split(","),U=Number($[0]),K=Number($[1]),ie=Math.sqrt(U*U+K*K);isNaN(ie)||(this.cssScale*=ie)}}}R.parentNode&&R.parentNode instanceof HTMLElement&&this.checkTransform(R.parentNode)}},j}(),nC=function(){function j(R,u){this.container=R,this.id=u;var w=document.createElementNS(rf,"svg");w.setAttribute("version","1.1"),w.setAttributeNS(y3,"xmlns",rf),w.setAttributeNS(y3,"xmlns:xlink",wI),w.setAttribute("role","group"),this.container.appendChild(w),this.defs=document.createElementNS(rf,"defs"),w.appendChild(this.defs),w.style.width="100%",w.style.height="100%",w.style.overflow="visible",this.svg=w}return j.prototype.add=function(R){return new CI(R)},j.prototype.addGroup=function(R){return new T4(R)},j.prototype.append=function(R){R&&this.svg.appendChild(R.node)},j.prototype.appendDef=function(R){R&&this.defs.appendChild(R.node)},j.prototype.foreignObject=function(){return new CI("foreignObject")},j.prototype.supportsForeignObject=function(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Extensibility","1.1")},j}(),II=null;function Fx(){if(II===null){var j=document.createElement("div");j.hidden=!0,j.style.width="1px",j.style.height="1px",j.style.position="absolute",j.style.zIndex="-1000000",document.body.appendChild(j);var R=new kb(j,!0);II=new nC(R.SVGContainer,"ghost")}return II}var g1=function(j){function R(){var u=j.call(this)||this;u._elements=new Us,u.properties={},u.className="Pattern",u.width=10,u.height=10,u.x=0,u.y=0,u.patternUnits="userSpaceOnUse";var w=new $a;return u.backgroundFill=w.getFor("background"),u.backgroundOpacity=0,u.fillOpacity=1,u.fill=w.getFor("alternativeBackground"),u.stroke=w.getFor("alternativeBackground"),u.strokeOpacity=1,u.strokeWidth=1,u.shapeRendering="crispEdges",u.rotation=0,u.element=u.paper.addGroup("pattern"),u.id="pattern-"+ui.getUniqueId(),u.element.attr({id:u.id}),u._disposers.push(u.element),u._disposers.push(new ta(u._elements)),u.patternUnits=u.patternUnits,u.width=u.width,u.height=u.height,u.applyTheme(),u}return re(R,j),R.prototype.draw=function(){var u=this,w=this.element;if(w){w.removeChildNodes();var $=this.paper.add("rect");$.attr({width:this.width,height:this.height,"shape-rendering":"crispEdges",fill:this.backgroundFill.hex,"fill-opacity":this.backgroundOpacity,stroke:this.backgroundFill.hex,"stroke-opacity":0}),w.add($),w.attr({x:this.x,y:this.y,width:this.width,height:this.height,stroke:this.stroke.hex,fill:this.fill.hex,"fill-opacity":this.fillOpacity,"stroke-opacity":this.strokeOpacity,"stroke-width":this.strokeWidth,"shape-rendering":this.shapeRendering,patternUnits:this.patternUnits,"stroke-dasharray":this.strokeDasharray}),pr(this._elements.iterator(),function(U){U.rotation=u.rotation,U.rotationX=u.properties.rotationX,U.rotationY=u.properties.rotationY,u.element.add(U)})}},R.prototype.animate=function(u,w,$){return new dm(this,u,w,$).start()},R.prototype.addElement=function(u){this._elements.push(u),this._disposers.push(u)},R.prototype.removeElement=function(u){this._elements.removeValue(u),this.removeDispose(u)},Object.defineProperty(R.prototype,"elements",{get:function(){return this._elements},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fillOpacity",{get:function(){return this.properties.fillOpacity},set:function(u){this.properties.fillOpacity=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fill",{get:function(){return this.properties.fill},set:function(u){this.properties.fill=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"backgroundFill",{get:function(){return this.properties.backgroundFill},set:function(u){this.properties.backgroundFill=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"backgroundOpacity",{get:function(){return this.properties.backgroundOpacity},set:function(u){this.properties.backgroundOpacity=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"stroke",{get:function(){return this.properties.stroke},set:function(u){this.properties.stroke=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"strokeOpacity",{get:function(){return this.properties.strokeOpacity},set:function(u){this.properties.strokeOpacity=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"strokeWidth",{get:function(){return this.properties.strokeWidth},set:function(u){this.properties.strokeWidth=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"shapeRendering",{get:function(){return this.properties.shapeRendering},set:function(u){this.properties.shapeRendering=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"rotation",{get:function(){return this.properties.rotation},set:function(u){this.properties.rotation=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"patternUnits",{get:function(){return this.properties.patternUnits},set:function(u){this.properties.patternUnits=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"width",{get:function(){return this.properties.width},set:function(u){this.properties.width=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"height",{get:function(){return this.properties.height},set:function(u){this.properties.height=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"x",{get:function(){return this.properties.x},set:function(u){this.properties.x=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"y",{get:function(){return this.properties.y},set:function(u){this.properties.y=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"paper",{get:function(){return this._paper?this._paper:Fx()},set:function(u){this._paper!=u&&(this._paper=u,this.draw(),u.appendDef(this.element))},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){var w=this;j.prototype.copyFrom.call(this,u),gi(u.properties,function($,U){w[$]=U})},Object.defineProperty(R.prototype,"animations",{get:function(){return this._animations||(this._animations=[],this._disposers.push(new Mx(this._animations))),this._animations},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"strokeDasharray",{get:function(){return this.properties.strokeDashArray},set:function(u){this.properties.strokeDashArray=u,this.draw()},enumerable:!0,configurable:!0}),R.prototype.processConfig=function(u){if(u&&Ee(u.elements)&&pt(u.elements))for(var w=0,$=u.elements.length;w<$;w++){var U=u.elements[w];if(Ee(U.type)){var K=this.createEntryInstance(U);K instanceof Wt&&(K.config=U),this.addElement(Ee(U.typeProperty)?K[U.typeProperty]:K.element)}}j.prototype.processConfig.call(this,u)},R}(Wt);ui.registeredClasses.Pattern=g1;var Dy=function(j){function R(){var u=j.call(this)||this;return u._stops=new Us,u._rotation=0,u.className="LinearGradient",u._stops.events.on("setIndex",u.validate,u),u._stops.events.on("inserted",u.validate,u),u.element=u.paper.addGroup("linearGradient"),u.id="gradient-"+ui.getUniqueId(),u.element.attr({id:u.id}),u._disposers.push(u.element),u.applyTheme(),u}return re(R,j),R.prototype.validate=function(){var u=this,w=(this._rotation+90)*Ce,$=Math.round(50+50*Math.sin(w+Math.PI))+"%",U=Math.round(50+50*Math.cos(w))+"%",K=Math.round(50+50*Math.sin(w))+"%",ie=Math.round(50+50*Math.cos(w+Math.PI))+"%",ae=this.element;ae.removeChildNodes(),ae.attr({x1:$,x2:K,y1:U,y2:ie}),pr(ch(this._stops.iterator()),function(we){var Re=we[0],$e=we[1],Xe=$e.offset;le(Xe)||(Xe=Re/(u._stops.length-1));var Qe=u.paper.add("stop");Ee($e.color)&&Qe.attr({"stop-color":$e.color.toString()}),le($e.opacity)&&Qe.attr({"stop-opacity":$e.opacity}),le(Xe)&&Qe.attr({offset:Xe}),ae.add(Qe)})},R.prototype.clear=function(){this._stops.clear()},R.prototype.addColor=function(u,w,$){this._stops.push({color:u,opacity:w,offset:$})},Object.defineProperty(R.prototype,"stops",{get:function(){return this._stops},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"paper",{get:function(){return this._paper?this._paper:Fx()},set:function(u){this._paper!=u&&(this._paper=u,this.validate(),u.appendDef(this.element))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"rotation",{get:function(){return this._rotation},set:function(u){this._rotation=u,this.validate()},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.stops.copyFrom(u.stops),this._rotation=u.rotation},Object.defineProperty(R.prototype,"gradientUnits",{set:function(u){this.element.attr({gradientUnits:u})},enumerable:!0,configurable:!0}),R}(Wt);ui.registeredClasses.LinearGradient=Dy;var Fy=function(j){function R(){var u=j.call(this)||this;return u._stops=new Us,u.element=u.paper.addGroup("radialGradient"),u.id="gradient-"+ui.getUniqueId(),u.element.attr({id:u.id}),u._disposers.push(u.element),u.applyTheme(),u}return re(R,j),R.prototype.draw=function(){var u,w=this,$=this.element;le(this.cx)&&((u=this.cx)instanceof J&&(u=u.percent+"%"),$.attr({cx:u})),le(this.cy)&&((u=this.cy)instanceof J&&(u=u.percent+"%"),$.attr({cy:u})),this.fx&&((u=this.fx)instanceof J&&(u=u.percent+"%"),$.attr({fx:u})),this.fy&&((u=this.fy)instanceof J&&(u=u.percent+"%"),$.attr({fy:u})),$.removeChildNodes(),pr(ch(this._stops.iterator()),function(U){var K=U[0],ie=U[1],ae=ie.offset;le(ae)||(ae=K/(w._stops.length-1));var we=w.paper.add("stop");Ee(ie.color)&&we.attr({"stop-color":ie.color.toString()}),le(ie.opacity)&&we.attr({"stop-opacity":ie.opacity}),le(ae)&&we.attr({offset:ae}),$.add(we)})},R.prototype.addColor=function(u,w,$){this._stops.push({color:u,opacity:w,offset:$}),this.draw()},Object.defineProperty(R.prototype,"paper",{get:function(){return this._paper?this._paper:Fx()},set:function(u){this._paper!=u&&(this._paper=u,this.draw(),u.appendDef(this.element))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cx",{get:function(){return this._cx},set:function(u){this._cx=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cy",{get:function(){return this._cy},set:function(u){this._cy=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fx",{get:function(){return this._fx},set:function(u){this._fx=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fy",{get:function(){return this._fy},set:function(u){this._fy=u,this.draw()},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.stops.copyFrom(u.stops),this.cx=u.cx,this.cy=u.cy,this.fx=u.fx,this.fy=u.fy},Object.defineProperty(R.prototype,"stops",{get:function(){return this._stops},enumerable:!0,configurable:!0}),R.prototype.clear=function(){this._stops.clear()},R}(Wt);ui.registeredClasses.RadialGradient=Fy;var _l=function(){function j(){}return j.grab=[{property:"cursor",value:"move"},{property:"cursor",value:"grab"},{property:"cursor",value:"-webkit-grab"}],j.grabbing=[{property:"cursor",value:"move"},{property:"cursor",value:"grabbing"},{property:"cursor",value:"-webkit-grabbing"}],j.pointer=[{property:"cursor",value:"pointer"}],j.default=[{property:"cursor",value:"default"}],j.horizontalResize=[{property:"cursor",value:"ew-resize"}],j.verticalResize=[{property:"cursor",value:"ns-resize"}],j.notAllowed=[{property:"cursor",value:"not-allowed"}],j.text=[{property:"cursor",value:"text"}],j}();const nf={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(j){var R="th";if(j<11||j>13)switch(j%10){case 1:R="st";break;case 2:R="nd";break;case 3:R="rd"}return R},"Zoom Out":"",Play:"",Stop:"",Legend:"","Click, tap or press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Force directed tree":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER or use arrow keys to navigate":"","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"",Close:"",Minimize:""};var wr,y1=function(j){function R(){var u=j.call(this)||this;return u.adapter=new tc(u),u._locale=nf,u._defaultLocale=nf,u.className="Language",Ee(no.defaultLocale)&&(u.locale=no.defaultLocale),u.applyTheme(),u}return re(R,j),R.prototype.getLocale=function(u){return u==null&&(u=this._locale),this.adapter.apply("locale",{locale:u}).locale},R.prototype.translate=function(u,w){for(var $=[],U=2;U0&&(Re=U[ie-1].replace("[","").replace("]","")),$+=this.wrap(we,Re,w)}}return $=this.unescape($),this.cleanUp($)},R.prototype.escape=function(u){return u.replace(/\[\[/g,ui.getPlaceholder("1")).replace(/([^\/\]]{1})\]\]/g,"$1"+ui.getPlaceholder("2")).replace(/\]\]/g,ui.getPlaceholder("2")).replace(/\{\{/g,ui.getPlaceholder("3")).replace(/\}\}/g,ui.getPlaceholder("4")).replace(/\'\'/g,ui.getPlaceholder("5"))},R.prototype.unescape=function(u){return u.replace(new RegExp(ui.getPlaceholder("1"),"g"),"[[").replace(new RegExp(ui.getPlaceholder("2"),"g"),"]]").replace(new RegExp(ui.getPlaceholder("3"),"g"),"{{").replace(new RegExp(ui.getPlaceholder("4"),"g"),"}}").replace(new RegExp(ui.getPlaceholder("5"),"g"),"''")},R.prototype.cleanUp=function(u){return u.replace(/\[\[/g,"[").replace(/\]\]/g,"]").replace(/\{\{/g,"{").replace(/\}\}/g,"}").replace(/\'\'/g,"'")},R.prototype.wrap=function(u,w,$){return w!==""&&w!=="/"||(w=""),$==="html"?this.wrapHtml(u,this.translateStyleShortcuts(w)):this.wrapSvg(u,this.translateStyleShortcuts(w))},R.prototype.wrapSvg=function(u,w){return w===""?""+u+"":""+u+""},R.prototype.getSvgElement=function(u,w){var $=new CI("tspan");return $.textContent=u,w&&$.node.setAttribute("style",w),$},R.prototype.wrapHtml=function(u,w){return w===""?""+u+"":""+u+""},R.prototype.getHtmlElement=function(u,w){var $=document.createElement("span");return $.innerHTML=u,w&&$.setAttribute("style",w),$},R.prototype.styleSvgToHtml=function(u){return u.replace(/fill:/,"color:")},R.prototype.translateStyleShortcuts=function(u){if(u==""||u=="[ ]")return"";var w=ui.getCache("translateStyleShortcuts_"+u);if(w)return w;var $=u.match(/('[^']*')|("[^"]*")/gi);if($)for(var U=0;U<$.length;U++)u=u.replace($[U],$[U].replace(/['"]*/g,"").replace(/[ ]+/g,"+"));var K=u.match(/([\w\-]*:[\s]?[^;\s\]]*)|(\#[\w]{1,6})|([\w]+)|(\/)/gi);if(!K)return u;for(U=0;Uthis._negativeBase?ie.positive:K=0?u.toExponential(w.decimals.passive).split("e"):u.toExponential().split("e"),u=Number(U[0]),ie="e"+U[1],w.modSpacing&&(ie=" "+ie);else if(w.decimals.passive===0)u=Math.round(u);else if(w.decimals.passive>0){var Xe=Math.pow(10,w.decimals.passive);u=Math.round(u*Xe)/Xe}var Qe="",dt=Kd(u).split("."),Gt=dt[0];if(Gt.length0){for(var Yt=[],ai=Gt.split("").reverse().join(""),oi=0,Ui=Gt.length;oi<=Ui;oi+=w.thousands.interval){var Ji=ai.substr(oi,w.thousands.interval).split("").reverse().join("");Ji!==""&&Yt.unshift(Ji)}Gt=Yt.join(w.thousands.separator)}Qe+=Gt,dt.length===1&&dt.push("");var Si=dt[1];return Si.length4&&Ui--,oi=w.parts[Yt]=="YYYY"?Math.abs(Ui).toString():Math.abs(Ui).toString().substr(-w.parts[Yt].length),Ui<0&&(oi+=$.translate("_era_bc"));break;case"u":case"F":case"g":break;case"q":oi=""+Math.ceil((u.getMonth()+1)/3);break;case"MMMMM":oi=$.translate(this.months[K]).substr(0,1);break;case"MMMM":oi=$.translate(this.months[K]);break;case"MMM":oi=$.translate(this.monthsShort[K]);break;case"MM":oi=Vl(K+1,2,"0");break;case"M":oi=(K+1).toString();break;case"ww":oi=Vl(Pr(u,this.utc),2,"0");break;case"w":oi=Pr(u,this.utc).toString();break;case"W":oi=Vn(u,this.utc).toString();break;case"dd":oi=Vl(ae,2,"0");break;case"d":oi=ae.toString();break;case"DD":case"DDD":oi=Vl(Bi(u,this.utc).toString(),w.parts[Yt].length,"0");break;case"D":oi=Bi(u,this.utc).toString();break;case"t":oi=$.translateFunc("_dateOrd").call(this,ae);break;case"E":oi=(ie||7).toString();break;case"EE":oi=Vl((ie||7).toString(),2,"0");break;case"EEE":case"eee":oi=$.translate(this.weekdaysShort[ie]);break;case"EEEE":case"eeee":oi=$.translate(this.weekdays[ie]);break;case"EEEEE":case"eeeee":oi=$.translate(this.weekdays[ie]).substr(0,1);break;case"e":case"ee":oi=(ie-this.firstDayOfWeek+1).toString(),w.parts[Yt]=="ee"&&(oi=Vl(oi,2,"0"));break;case"a":oi=we>=12?$.translate("PM"):$.translate("AM");break;case"aa":oi=we>=12?$.translate("P.M."):$.translate("A.M.");break;case"aaa":oi=we>=12?$.translate("P"):$.translate("A");break;case"h":oi=gs(we).toString();break;case"hh":oi=Vl(gs(we),2,"0");break;case"H":oi=we.toString();break;case"HH":oi=Vl(we,2,"0");break;case"K":oi=gs(we,0).toString();break;case"KK":oi=Vl(gs(we,0),2,"0");break;case"k":oi=(we+1).toString();break;case"kk":oi=Vl(we+1,2,"0");break;case"m":oi=Re.toString();break;case"mm":oi=Vl(Re,2,"0");break;case"s":oi=$e.toString();break;case"ss":oi=Vl($e,2,"0");break;case"S":case"SS":case"SSS":oi=Math.round(Xe/1e3*Math.pow(10,w.parts[Yt].length)).toString();break;case"x":oi=Gt.toString();break;case"n":case"nn":case"nnn":oi=Vl(Xe,w.parts[Yt].length,"0");break;case"z":oi=ma(u,!1,!1,this.utc);break;case"zz":oi=ma(u,!0,!1,this.utc);break;case"zzz":oi=ma(u,!1,!0,this.utc);break;case"zzzz":oi=ma(u,!0,!0,this.utc);break;case"Z":case"ZZ":var Ji=Math.abs(dt)/60,Si=Math.floor(Ji),Hi=60*Ji-60*Si;this.utc&&(Si=0,Hi=0),w.parts[Yt]=="Z"?(oi="GMT",oi+=dt>0?"-":"+",oi+=Vl(Si,2)+":"+Vl(Hi,2)):(oi=dt>0?"-":"+",oi+=Vl(Si,2)+Vl(Hi,2));break;case"i":oi=u.toISOString();break;case"I":oi=u.toUTCString()}Qe=Qe.replace(Sr,oi)}return Qe},R.prototype.parse=function(u,w){if(Ee(w)||(w=this.inputDateFormat),u instanceof Date)return u;if(typeof u=="number")return new Date(u);var $;typeof u!="string"&&(u=u.toString()),this.language||(this.sprite?this.language=this.sprite.language:this.language=new y1);var U="";w=(w=Fh(w)).substr(0,u.length);for(var K=this.parseFormat(w),ie={year:-1,year3:-1,year2:-1,year1:-1,month:-1,monthShort:-1,monthLong:-1,weekdayShort:-1,weekdayLong:-1,day:-1,yearDay:-1,week:-1,hourBase0:-1,hour12Base0:-1,hourBase1:-1,hour12Base1:-1,minute:-1,second:-1,millisecond:-1,millisecondDigits:-1,am:-1,zone:-1,timestamp:-1,iso:-1},ae={year:1970,month:0,day:1,hour:0,minute:0,second:0,millisecond:0,timestamp:null,offset:0,utc:this.utc},we=0,Re=0,$e=0;$e-1&&(ae.year=parseInt(Qe[ie.year])),ie.year3>-1){var dt=parseInt(Qe[ie.year3]);dt+=1e3,ae.year=dt}if(ie.year2>-1&&(dt=parseInt(Qe[ie.year2]),dt+=dt>50?1e3:2e3,ae.year=dt),ie.year1>-1&&(dt=parseInt(Qe[ie.year1]),dt=10*Math.floor(new Date().getFullYear()/10)+dt,ae.year=dt),ie.monthLong>-1&&(ae.month=this.resolveMonth(Qe[ie.monthLong])),ie.monthShort>-1&&(ae.month=this.resolveShortMonth(Qe[ie.monthShort])),ie.month>-1&&(ae.month=parseInt(Qe[ie.month])-1),ie.week>-1&&ie.day===-1&&(ae.month=0,ae.day=ms(parseInt(Qe[ie.week]),ae.year,1,this.utc)),ie.day>-1&&(ae.day=parseInt(Qe[ie.day])),ie.yearDay>-1&&(ae.month=0,ae.day=parseInt(Qe[ie.yearDay])),ie.hourBase0>-1&&(ae.hour=parseInt(Qe[ie.hourBase0])),ie.hourBase1>-1&&(ae.hour=parseInt(Qe[ie.hourBase1])-1),ie.hour12Base0>-1&&((dt=parseInt(Qe[ie.hour12Base0]))==11&&(dt=0),ie.am>-1&&!this.isAm(Qe[ie.am])&&(dt+=12),ae.hour=dt),ie.hour12Base1>-1&&((dt=parseInt(Qe[ie.hour12Base1]))==12&&(dt=0),ie.am>-1&&!this.isAm(Qe[ie.am])&&(dt+=12),ae.hour=dt),ie.minute>-1&&(ae.minute=parseInt(Qe[ie.minute])),ie.second>-1&&(ae.second=parseInt(Qe[ie.second])),ie.millisecond>-1&&(dt=parseInt(Qe[ie.millisecond]),ie.millisecondDigits==2?dt*=10:ie.millisecondDigits==1&&(dt*=100),ae.millisecond=dt),ie.timestamp>-1){ae.timestamp=parseInt(Qe[ie.timestamp]);var Gt=new Date(ae.timestamp);ae.year=Gt.getUTCFullYear(),ae.month=Gt.getUTCMonth(),ae.day=Gt.getUTCDate(),ae.hour=Gt.getUTCHours(),ae.minute=Gt.getUTCMinutes(),ae.second=Gt.getUTCSeconds(),ae.millisecond=Gt.getUTCMilliseconds()}ie.zone>-1&&(ae.offset=this.resolveTimezoneOffset(new Date(ae.year,ae.month,ae.day),Qe[ie.zone])),ie.iso>-1&&(ae.year=Tt(Qe[ie.iso+0]),ae.month=Tt(Qe[ie.iso+1])-1,ae.day=Tt(Qe[ie.iso+2]),ae.hour=Tt(Qe[ie.iso+3]),ae.minute=Tt(Qe[ie.iso+4]),ae.second=Tt(Qe[ie.iso+5]),ae.millisecond=Tt(Qe[ie.iso+6]),Qe[ie.iso+7]=="Z"||Qe[ie.iso+7]=="z"?ae.utc=!0:Qe[ie.iso+7]!=""&&(ae.offset=this.resolveTimezoneOffset(new Date(ae.year,ae.month,ae.day),Qe[ie.iso+7]))),$=ae.utc?new Date(Date.UTC(ae.year,ae.month,ae.day,ae.hour,ae.minute,ae.second,ae.millisecond)):new Date(ae.year,ae.month,ae.day,ae.hour,ae.minute+ae.offset,ae.second,ae.millisecond)}else $=new Date(u);return $},R.prototype.resolveTimezoneOffset=function(u,w){if(w.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/)){var $=Be(w.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/)),U=$[1],K=$[2],ie=$[3],ae=60*parseInt(K)+parseInt(ie);return U=="+"&&(ae*=-1),ae-(u||new Date).getTimezoneOffset()}return 0},R.prototype.resolveMonth=function(u){var w=this.months.indexOf(u);return w>-1||this.language&&!this.language.isDefault()&&(w=this.language.translateAll(this.months).indexOf(u))>-1?w:0},R.prototype.resolveShortMonth=function(u){var w=this.monthsShort.indexOf(u);return w>-1||(w=this.months.indexOf(u))>-1||this.language&&!this.language.isDefault()&&(w=this.language.translateAll(this.monthsShort).indexOf(u))>-1?w:0},R.prototype.isAm=function(u){return this.getStringList(["AM","A.M.","A"]).indexOf(u.toUpperCase())>-1},R.prototype.invalidateSprite=function(){this.sprite&&this.sprite.invalidate()},R.prototype.getStringList=function(u){for(var w=[],$=0;$this._negativeBase?ie.positive:ae"+we+"":this._outputFormat==="html"&&(we=""+we+"")),we},R.prototype.parseFormat=function(u,w){var $=this,U=this.getCache(u);if(Ee(U))return U;var K=w||this._baseUnit,ie={positive:{color:"",template:"",parts:[],source:"",baseUnit:K,parsed:!1,absolute:!1},negative:{color:"",template:"",parts:[],source:"",baseUnit:K,parsed:!1,absolute:!1},zero:{color:"",template:"",parts:[],source:"",baseUnit:K,parsed:!1,absolute:!1}},ae=(u=u.replace("||",lr)).split("|");return ie.positive.source=ae[0],ae[2]===void 0?ie.zero=ie.positive:ie.zero.source=ae[2],ae[1]===void 0?ie.negative=ie.positive:ie.negative.source=ae[1],gi(ie,function(we,Re){if(!Re.parsed)if($.getCache(Re.source)===void 0){var $e,Xe=Re.source;($e=Re.source.match(/^\[([^\]]*)\]/))&&$e.length&&$e[0]!==""&&(Xe=Re.source.substr($e[0].length),Re.color=$e[1]);for(var Qe=v1().chunk(Xe,!0),dt=0;dt div > ."+$+"-menu ."+$+"-item."+$+"-item-level-0, ."+$+"-item."+$+"-item-level-0.active",{opacity:"0.9"}),new Ns(u,"."+$+"-item."+$+"-item-level-0 > a",{padding:"0","text-align":"center",overflow:"hidden"}),new Ns(u,"."+$+"-item."+$+"-item-level-0:before",{display:"block"}),new Ns(u,"."+$+"-item",{position:"relative",display:"block",opacity:"0","z-index":"1","border-radius":"3px","background-color":U.getFor("secondaryButton").hex,padding:"0",margin:"1px 1px 0 0",color:U.getFor("secondaryButton").alternative.hex,transition:"all 100ms ease-in-out, opacity 0.5s ease 0.5s"}),new Ns(u,"."+$+"-left ."+$+"-item",{margin:"1px 0 0 1px"}),new Ns(u,"."+$+"-item:hover, ."+$+"-item.active",{background:U.getFor("secondaryButtonHover").hex,color:U.getFor("secondaryButtonText").hex}),new Ns(u,"."+$+"-item > ."+$+"-menu",{position:"absolute",top:"-1px",right:"0","margin-right":"100%"}),new Ns(u,"."+$+"-left ."+$+"-item > ."+$+"-menu",{left:"0",right:"auto","margin-left":"100%","margin-right":"auto"}),new Ns(u,"."+$+"-right ."+$+"-item > ."+$+"-menu",{left:"auto",right:"0","margin-left":"auto","margin-right":"100%"}),new Ns(u,"."+$+"-top ."+$+"-item > ."+$+"-menu",{top:"-1px",bottom:"auto"}),new Ns(u,"."+$+"-bottom ."+$+"-item > ."+$+"-menu",{top:"auto",bottom:"0"}),new Ns(u,"."+$+"-item > ."+$+"-menu",{display:"none"}),new Ns(u,"."+$+"-item:hover > ."+$+"-menu, ."+$+"-item.active > ."+$+"-menu",{display:"block"}),new Ns(u,"."+$+"-item:hover > ."+$+"-menu > ."+$+"-item, ."+$+"-item.active > ."+$+"-menu > ."+$+"-item",{opacity:"1"}),new Ns(u,"."+$+"-menu",{display:"block","list-style":"none",margin:"0",padding:"0"}),new Ns(u,"."+$+"-label",{display:"block",cursor:"default",padding:"0.5em 1em"}),new Ns(u,"."+$+"-icon",{display:"block",cursor:"default",padding:"0.2em 0.4em",width:"1.2em",height:"1.2em","min-width":"32px","min-height":"32px",margin:"auto auto","border-radius":"3px"}),new Ns(u,"."+$+"-item-level-0 > ."+$+"-icon",{padding:"0.1em 0.2em"}),new Ns(u,"."+$+"-clickable",{cursor:"pointer"})]);return new ws(function(){Se.removeKey($),K.dispose()})}).increment())),this._element&&(this._element.style.display="")},Object.defineProperty(R.prototype,"tabindex",{get:function(){return this.adapter.apply("tabindex",{tabindex:this._tabindex}).tabindex},set:function(u){this._tabindex=u,this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"language",{get:function(){var u=this,w=this._language.get();return w==null&&(w=new y1,this._language.set(w,w.events.on("localechanged",function($){u.invalidate()}))),w},set:function(u){var w=this;this._language.set(u,u.events.on("localechanged",function($){w.invalidate()})),this.invalidate()},enumerable:!0,configurable:!0}),R.prototype.close=function(){var u=this;if(!this.isDisposed())if(this._ignoreNextClose)this._ignoreNextClose=!1;else{if(this.closeOnClick&&(this._element.style.pointerEvents="none",setTimeout(function(){u._element.style.pointerEvents="auto"},100)),this._currentSelection&&(this.setBlur(this._currentSelection),this._currentSelection=void 0),this._element)for(var w=this._element.getElementsByClassName("active"),$=w.length-1;$>=0;$--)w[$]&&QS(w[$],"active");this.events.dispatchImmediately("closed",{type:"closed",target:this})}},R.prototype.selectBranch=function(u){var w=this;if(!this.isDisposed()&&(u.closeTimeout&&(this.removeDispose(u.closeTimeout),u.closeTimeout=void 0),Fb(u.element,"active"),u.submenuElement&&u.submenuElement.setAttribute("aria-expanded","true"),this._currentSelection&&this._currentSelection!==u&&this._currentSelection.ascendants&&pr(Cf(Vo([this._currentSelection]),this._currentSelection.ascendants.iterator()),function(U){u.ascendants.contains(U)||u===U||w.unselectBranch(U,!0)}),pr(u.ascendants.iterator(),function(U){U.closeTimeout&&(w.removeDispose(U.closeTimeout),U.closeTimeout=void 0),Fb(U.element,"active")}),this._currentSelection=u,this.events.isEnabled("branchselected"))){var $={type:"branchselected",target:this,branch:u};this.events.dispatchImmediately("branchselected",$)}},R.prototype.unselectBranch=function(u,w){if(!this.isDisposed()&&(QS(u.element,"active"),u.submenuElement&&u.submenuElement.removeAttribute("aria-expanded"),this._currentSelection==u&&(this._currentSelection=void 0),this.events.isEnabled("branchunselected"))){var $={type:"branchunselected",target:this,branch:u};this.events.dispatchImmediately("branchunselected",$)}},R.prototype.delayUnselectBranch=function(u,w){var $=this;this.isDisposed()||(u.closeTimeout&&(this.removeDispose(u.closeTimeout),u.closeTimeout=void 0),u.closeTimeout=this.setTimeout(function(){$.unselectBranch(u,w)},this.closeDelay),w!==!0&&u.ascendants&&pr(u.ascendants.iterator(),function(U){$.delayUnselectBranch(U,!0)}))},R.prototype.moveSelection=function(u){if(!this.isDisposed()&&this._currentSelection){var w;if(u=="up")w=this.getPrevSibling(this._currentSelection);else if(u=="down")w=this.getNextSibling(this._currentSelection);else if(u=="left"&&this.align=="right"||u=="right"&&this.align=="left"){var $=this.getSubMenu(this._currentSelection);$!=null&&(w=$[0])}else(u=="right"&&this.align=="right"||u=="left"&&this.align=="left")&&(w=this.getParentItem(this._currentSelection));w&&w!==this._currentSelection&&(this.selectBranch(w),this.setFocus(w),this._currentSelection=w)}},R.prototype.getSiblings=function(u){var w=this.getParentItem(u);return w&&w.menu?w.menu:[]},R.prototype.getParentItem=function(u){return u.ascendants&&u.ascendants.length?u.ascendants.getIndex(u.ascendants.length-1):void 0},R.prototype.getNextSibling=function(u){var w=this.getSiblings(u);if(w.length>1){var $=w.indexOf(u)+1;return w[$=w.length==$?0:$].unsupported?this.getNextSibling(w[$]):w[$]}return u},R.prototype.getPrevSibling=function(u){var w=this.getSiblings(u);if(w.length>1){var $=w.indexOf(u)-1;return w[$=$==-1?w.length-1:$].unsupported?this.getPrevSibling(w[$]):w[$]}return u},R.prototype.setFocus=function(u){if(u.interactions)try{u.interactions.element.focus()}catch{}},R.prototype.setBlur=function(u){if(u.interactions)try{u.interactions.element.blur()}catch{}},R.prototype.hideBranch=function(u){u.element.style.display="none"},R.prototype.showBranch=function(u){u.element.style.display=""},Object.defineProperty(R.prototype,"element",{get:function(){return this._element},enumerable:!0,configurable:!0}),R}(xt);function si(j,R,u){return new Promise(function(w,$){var U=Ee(u)&&u.responseType=="blob",K=new XMLHttpRequest;if(K.onload=function(){if(K.status===200){var we,Re;if(U)return void Un(we=K.response).then(function(Xe){var Qe={xhr:K,error:!1,response:Xe,blob:we,type:K.getResponseHeader("Content-Type"),target:R};w(Qe)});Re=K.responseText||K.response;var $e={xhr:K,error:!1,response:Re,blob:we,type:K.getResponseHeader("Content-Type"),target:R};w($e)}else $({xhr:K,error:!0,type:K.getResponseHeader("Content-Type"),target:R})},K.onerror=function(){$({xhr:K,error:!0,type:K.getResponseHeader("Content-Type"),target:R})},K.open("GET",j,!0),u&&u.withCredentials&&(K.withCredentials=!0),Ee(u)){if(Ee(u.requestHeaders))for(var ie=0;ie to load"))},1e4)})];case 3:return[2,u.sent()];case 4:return[2]}})})}function nh(j,R,u){return ge(this,void 0,void 0,function(){var w,$,U,K;return _e(this,function(ie){switch(ie.label){case 0:return ie.trys.push([0,2,,3]),[4,si(R)];case 1:return w=ie.sent(),[3,3];case 2:return $=ie.sent(),console.error("Failed to load stylesheet",R,$),[2];case 3:(U=j.createElement("style")).textContent=w.response,no.nonce!=""&&U.setAttribute("nonce",no.nonce),j.head.appendChild(U),ie.label=4;case 4:return ie.trys.push([4,,7,8]),[4,rc(U)];case 5:return K=ie.sent(),[4,PI(j,R,K,u)];case 6:return ie.sent(),[3,8];case 7:return j.head.removeChild(U),[7];case 8:return[2]}})})}function PI(j,R,u,w){return ge(this,void 0,void 0,function(){var $,U,K,ie,ae;return _e(this,function(we){switch(we.label){case 0:for($=[],U=u.length,K=0;K"+Yt[0]+""+this.serializeElement(this.sprite.paper.defs)+this.serializeElement(this.sprite.dom),u,ae,we,Xe,Re,$e),oi=new Blob([ai],{type:"image/svg+xml"}),U=$.createObjectURL(oi),[4,this.loadNewImage(U,ae*Xe*Qe,we*Xe*Qe,"anonymous")];case 3:return Ui=Ji.sent(),dt.drawImage(Ui,0,0),[3,5];case 4:return U!==null&&$.revokeObjectURL(U),K!==null&&mi(K,function(Si){$.revokeObjectURL(Si)}),this.restoreRemovedObjects(),[7];case 5:return[2,ie]}})})},R.prototype.getCanvasAdvanced=function(u){return ge(this,void 0,void 0,function(){var w,$,U,K,ie,ae,we,Re,$e,Xe,Qe;return _e(this,function(dt){switch(dt.label){case 0:return Ee(u)||(u={}),[4,this.imagesToDataURI(this.sprite.dom,u)];case 1:return dt.sent(),w=this.backgroundColor||this.findBackgroundColor(this.sprite.dom),[4,this.canvg];case 2:return $=dt.sent(),U=this.sprite.pixelWidth,K=this.sprite.pixelHeight,ie=v3(this.sprite.dom),ae=_3(this.sprite.dom),we=u.scale||1,Re=this.getPixelRatio(u),we=this.getAdjustedScale(U*Re,K*Re,we,u),$e=this.normalizeSVG(this.serializeElement(this.sprite.paper.defs)+this.serializeElement(this.sprite.dom),u,U,K,we,ie,ae,w),(Xe=this.getDisposableCanvas()).style.width=U*Re*we+"px",Xe.style.height=K*Re*we+"px",Xe.width=U*Re*we,Xe.height=K*Re*we,Qe={useCORS:!0},Re!=1&&(Qe.ignoreDimensions=!0,Qe.scaleWidth=U*Re*we,Qe.scaleHeight=K*Re*we),[4,$.fromString(Xe.getContext("2d"),$e,Qe).render()];case 3:return dt.sent(),[2,Xe]}})})},R.prototype.getImageAdvanced=function(u,w,$){return ge(this,void 0,void 0,function(){var U,K,ie;return _e(this,function(ae){switch(ae.label){case 0:return(U=this._objectsAlreadyHidden)||this.hideNonExportableSprites(),Ee(w)||(w=this.getFormatOptions(u)),[4,this.getCanvasAdvanced(w)];case 1:return K=ae.sent(),$===!1?[3,3]:[4,this.addExtras(K,w,!0)];case 2:K=ae.sent(),ae.label=3;case 3:return ie=K.toDataURL(this.getContentType(u),w.quality),this.disposeCanvas(K),U||this.restoreNonExportableSprites(),[2,ie]}})})},R.prototype.getDisposableCanvas=function(){var u=document.createElement("canvas");return u.style.position="fixed",u.style.top="-10000px",document.body.appendChild(u),u},R.prototype.disposeCanvas=function(u){document.body.removeChild(u)},R.prototype.getPixelRatio=function(u){return this.useRetina?Er():1},R.prototype.getAdjustedScale=function(u,w,$,U){if(!U)return $;var K,ie,ae=u*$,we=u*$;return U.maxWidth&&ae>U.maxWidth&&(K=U.maxWidth/u),U.maxHeight&&we>U.maxHeight&&(ie=U.maxHeight/w),K||ie?W(K,ie):(U.minWidth&&ae",{},1,1)],{type:"image/svg+xml"}),ie=U.createObjectURL(K),ae=void 0,we.label=2;case 2:return we.trys.push([2,4,,5]),[4,this.loadNewImage(ie,1,1)];case 3:return ae=we.sent(),[3,5];case 4:return we.sent(),[2,!1];case 5:$.drawImage(ae,0,0),U.revokeObjectURL(ie);try{return ui.setCache("simplifiedImageExport",!0),[2,!0]}catch{return ui.setCache("simplifiedImageExport",!1),[2,!1]}return[3,7];case 6:return we.sent(),ui.setCache("simplifiedImageExport",!1),[2,!1];case 7:return[2]}})})},R.prototype.loadNewImage=function(u,w,$,U){return new Promise(function(K,ie){var ae;function we(){if(U){var Re=ae.src;ae.onerror=function(){ie(new Error('Loading image "'+u+'" failed'))},ae.removeAttribute("crossorigin"),ae.src="",ae.src=Re}else ie(new Error('Loading image "'+u+'" failed'))}ae=w&&$?new Image(w,$):new Image,U&&ae.setAttribute("crossOrigin",U),ae.onload=function(){K(ae)},ae.onabort=we,ae.onerror=we,ae.src=u})},R.prototype.getDOMURL=function(){return self.URL||self.webkitURL||self},R.prototype.getSVG=function(u,w,$){return $===void 0&&($=!0),ge(this,void 0,void 0,function(){var U,K,ie,ae,we,Re,$e,Xe,Qe,dt;return _e(this,function(Gt){switch(Gt.label){case 0:return(U=this._objectsAlreadyHidden)||this.hideNonExportableSprites(),Ee(w)||(w=this.getFormatOptions("svg")),[4,this.awaitValidSprites()];case 1:return Gt.sent(),K=this.sprite.pixelWidth,ie=this.sprite.pixelHeight,ae=v3(this.sprite.dom),we=_3(this.sprite.dom),Re=w.scale||1,$e=this.getPixelRatio(w),Re=this.getAdjustedScale(K*$e,ie*$e,Re,w),Xe=this.normalizeSVG(this.serializeElement(this.sprite.paper.defs)+this.serializeElement(this.sprite.dom),w,K,ie,Re,ae,we),Qe=this.adapter.apply("charset",{charset:"charset=utf-8",type:"svg",options:w}).charset,dt=this.adapter.apply("getSVG",{data:$?"data:"+this.getContentType(u)+";"+Qe+","+encodeURIComponent(Xe):Xe,options:w}).data,U||this.restoreNonExportableSprites(),[2,dt]}})})},R.prototype.normalizeSVG=function(u,w,$,U,K,ie,ae,we){var Re="";$&&(Re+='width="'+Math.round($*(K||1))+'px" '),U&&(Re+='height="'+Math.round(U*(K||1))+'px" ');var $e="";ie&&($e+="font-family: "+ie.replace(/"/g,"")+";"),ae&&($e+="font-size: "+ae+";"),K&&(Re+='viewBox="0 0 '+$+" "+U+'" ');var Xe=[],Qe=u.match(//gi);if(Qe)for(var dt=0;dt]*)width="[^"]*"/,"$1")).replace(/(]*)height="[^"]*"/,"$1")).replace(/('+u+"",we&&(u=u.replace(/(]*>)/,'$1')),/MSIE |Trident\//.test(navigator.userAgent)&&(u=u.replace(/]*\/>/gi,""));var Gt=new RegExp("url\\("+Gl(Ds()),"g");if(u=(u=u.replace(Gt,"url(#")).replace(/url\("([^)]*)"\)/gm,"url($1)"),Xe.length)for(dt=0;dtGt?1:dtXe?1:$eoi?1:aiXe?1:$eUi?-1:oi=0)&&(Qe='"'+Qe+'"'),ae.push(Qe)},function(Re,$e){var Xe=we.indexOf(Re),Qe=we.indexOf($e);return Xe>Qe?1:Xe",w.tableClass&&(U=''),K=this.adapter.apply("formatDataFields",{dataFields:this.dataFields,format:"html"}).dataFields,ie=this.data,w.pivot)ae=this.adapter.apply("dataFieldsOrder",{dataFieldsOrder:this.dataFieldsOrder,format:"html"}).dataFieldsOrder,U+=` -`,_r(K,function(dt,Gt){var Yt=[];w.addColumnNames&&Yt.push(Gt);for(var ai=ie.length,oi=0;oiai?-1:Yt`;else{for(w.addColumnNames&&(U+=` + */const TLe=Object.freeze(Object.defineProperty({__proto__:null,CalciteIcon:Gwt,defineCustomElement:lx},Symbol.toStringTag,{value:"Module"}));function El(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}function eUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Uwt,zwt,_Z={},tUi={get exports(){return _Z},set exports(t){_Z=t}};Uwt=tUi,(zwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"م",_era_bc:"ق.م",A:"ص",P:"م",AM:"ص",PM:"م","A.M.":"ص","P.M.":"م",January:"يناير",February:"فبراير",March:"مارس",April:"أبريل",May:"مايو",June:"يونيو",July:"يوليو",August:"أغسطس",September:"سبتمبر",October:"أكتوبر",November:"نوفمبر",December:"ديسمبر",Jan:"يناير",Feb:"فبراير",Mar:"مارس",Apr:"أبريل","May(short)":"مايو",Jun:"يونيو",Jul:"يوليو",Aug:"أغسطس",Sep:"سبتمبر",Oct:"أكتوبر",Nov:"نوفمبر",Dec:"ديسمبر",Sunday:"الأحد",Monday:"الاثنين",Tuesday:"الثلاثاء",Wednesday:"الأربعاء",Thursday:"الخميس",Friday:"الجمعة",Saturday:"السبت",Sun:"الأحد",Mon:"الاثنين",Tue:"الثلاثاء",Wed:"الأربعاء",Thu:"الخميس",Fri:"الجمعة",Sat:"السبت",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"تغيير مقياس الرسم",Play:"تشغيل",Stop:"إيقاف تشغيل",Legend:"وسيلة الإيضاح","Click, tap or press ENTER to toggle":"",Loading:"تحميل",Home:"الصفحة الرئيسية",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"طباعة",Image:"صورة",Data:"بيانات",Print:"طباعة","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"من %1 إلى %2","From %1":"من %1","To %1":"إلى %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,_Z))!==void 0&&(Uwt.exports=zwt);const iUi=eUi({__proto__:null,default:tl(_Z)},[_Z]),rUi=Object.freeze(Object.defineProperty({__proto__:null,a:iUi},Symbol.toStringTag,{value:"Module"}));function nUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Hwt,Wwt,bZ={},sUi={get exports(){return bZ},set exports(t){bZ=t}};Hwt=sUi,(Wwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_percentPrefix:null,_percentSuffix:"%","Zoom Out":"Отдалечаване","From %1 to %2":"От %1 до %2","From %1":"От %1","To %1":"До %1"}}(El,bZ))!==void 0&&(Hwt.exports=Wwt);const oUi=nUi({__proto__:null,default:tl(bZ)},[bZ]),aUi=Object.freeze(Object.defineProperty({__proto__:null,b:oUi},Symbol.toStringTag,{value:"Module"}));function lUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var qwt,Ywt,wZ={},uUi={get exports(){return wZ},set exports(t){wZ=t}};qwt=uUi,(Ywt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n. e.",_era_bc:"p. n. e.",A:"prijepodne",P:"popodne",AM:"AM",PM:"PM","A.M.":"prijepodne","P.M.":"popodne",January:"januar",February:"februar",March:"mart",April:"april",May:"maj",June:"juni",July:"juli",August:"august",September:"septembar",October:"oktobar",November:"novembar",December:"decembar",Jan:"jan",Feb:"feb",Mar:"mar",Apr:"apr","May(short)":"maj",Jun:"jun",Jul:"jul",Aug:"aug",Sep:"sep",Oct:"okt",Nov:"nov",Dec:"dec",Sunday:"nedjelja",Monday:"ponedjeljak",Tuesday:"utorak",Wednesday:"srijeda",Thursday:"četvrtak",Friday:"petak",Saturday:"subota",Sun:"ned",Mon:"pon",Tue:"uto",Wed:"sri",Thu:"čet",Fri:"pet",Sat:"sub",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Povećaj",Play:"Reproduciraj",Stop:"Zaustavi",Legend:"Legenda","Click, tap or press ENTER to toggle":"",Loading:"Učitavanje",Home:"Početna",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Ispis",Image:"Slika",Data:"Podaci",Print:"Ispis","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,wZ))!==void 0&&(qwt.exports=Ywt);const cUi=lUi({__proto__:null,default:tl(wZ)},[wZ]),hUi=Object.freeze(Object.defineProperty({__proto__:null,b:cUi},Symbol.toStringTag,{value:"Module"}));function dUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Xwt,Kwt,xZ={},pUi={get exports(){return xZ},set exports(t){xZ=t}};Xwt=pUi,(Kwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"dC",_era_bc:"aC",A:"a. m.",P:"p. m.",AM:"a. m.",PM:"p. m.","A.M.":"a. m.","P.M.":"p. m.",January:"de gener",February:"de febrer",March:"de març",April:"d’abril",May:"de maig",June:"de juny",July:"de juliol",August:"d’agost",September:"de setembre",October:"d’octubre",November:"de novembre",December:"de desembre",Jan:"de gen.",Feb:"de febr.",Mar:"de març",Apr:"d’abr.","May(short)":"de maig",Jun:"de juny",Jul:"de jul.",Aug:"d’ag.",Sep:"de set.",Oct:"d’oct.",Nov:"de nov.",Dec:"de des.",Sunday:"diumenge",Monday:"dilluns",Tuesday:"dimarts",Wednesday:"dimecres",Thursday:"dijous",Friday:"divendres",Saturday:"dissabte",Sun:"dg.",Mon:"dl.",Tue:"dt.",Wed:"dc.",Thu:"dj.",Fri:"dv.",Sat:"ds.",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Zoom",Play:"Reprodueix",Stop:"Parada",Legend:"Llegenda","Click, tap or press ENTER to toggle":"",Loading:"S'està carregant",Home:"Inici",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Imprimeix",Image:"Imatge",Data:"Dades",Print:"Imprimeix","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"De %1 a %2","From %1":"De %1","To %1":"A %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,xZ))!==void 0&&(Xwt.exports=Kwt);const fUi=dUi({__proto__:null,default:tl(xZ)},[xZ]),mUi=Object.freeze(Object.defineProperty({__proto__:null,c:fUi},Symbol.toStringTag,{value:"Module"}));function gUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Jwt,Zwt,SZ={},yUi={get exports(){return SZ},set exports(t){SZ=t}};Jwt=yUi,(Zwt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n. l.",_era_bc:"př. n. l.",A:"dop.",P:"odp.",AM:"dop.",PM:"odp.","A.M.":"dop.","P.M.":"odp.",January:"ledna",February:"února",March:"března",April:"dubna",May:"května",June:"června",July:"července",August:"srpna",September:"září",October:"října",November:"listopadu",December:"prosince",Jan:"led",Feb:"úno",Mar:"bře",Apr:"dub","May(short)":"kvě",Jun:"čvn",Jul:"čvc",Aug:"srp",Sep:"zář",Oct:"říj",Nov:"lis",Dec:"pro",Sunday:"neděle",Monday:"pondělí",Tuesday:"úterý",Wednesday:"středa",Thursday:"čtvrtek",Friday:"pátek",Saturday:"sobota",Sun:"ne",Mon:"po",Tue:"út",Wed:"st",Thu:"čt",Fri:"pá",Sat:"so",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Zvětšení",Play:"Přehrát",Stop:"Ukončit iteraci (Stop)",Legend:"Legenda","Click, tap or press ENTER to toggle":"",Loading:"Načítání",Home:"Domů",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Tisk",Image:"Snímek",Data:"Data",Print:"Tisk","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,SZ))!==void 0&&(Jwt.exports=Zwt);const vUi=gUi({__proto__:null,default:tl(SZ)},[SZ]),_Ui=Object.freeze(Object.defineProperty({__proto__:null,c:vUi},Symbol.toStringTag,{value:"Module"}));function bUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Qwt,ext,CZ={},wUi={get exports(){return CZ},set exports(t){CZ=t}};Qwt=wUi,(ext=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"e.Kr.",_era_bc:"f.Kr.",A:"a",P:"p",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"januar",February:"februar",March:"marts",April:"april",May:"maj",June:"juni",July:"juli",August:"august",September:"september",October:"oktober",November:"november",December:"december",Jan:"jan.",Feb:"feb.",Mar:"mar.",Apr:"apr.","May(short)":"maj",Jun:"jun.",Jul:"jul.",Aug:"aug.",Sep:"sep.",Oct:"okt.",Nov:"nov.",Dec:"dec.",Sunday:"søndag",Monday:"mandag",Tuesday:"tirsdag",Wednesday:"onsdag",Thursday:"torsdag",Friday:"fredag",Saturday:"lørdag",Sun:"søn.",Mon:"man.",Tue:"tir.",Wed:"ons.",Thu:"tor.",Fri:"fre.",Sat:"lør.",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Zoom",Play:"Afspil",Stop:"Stop",Legend:"Signaturforklaring","Click, tap or press ENTER to toggle":"",Loading:"Indlæser",Home:"Hjem",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Udskriv",Image:"Billede",Data:"Data",Print:"Udskriv","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Fra %1 til %2","From %1":"Fra %1","To %1":"Til %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,CZ))!==void 0&&(Qwt.exports=ext);const xUi=bUi({__proto__:null,default:tl(CZ)},[CZ]),SUi=Object.freeze(Object.defineProperty({__proto__:null,d:xUi},Symbol.toStringTag,{value:"Module"}));function CUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var txt,ixt,TZ={},TUi={get exports(){return TZ},set exports(t){TZ=t}};txt=TUi,(ixt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"K",_big_number_suffix_6:"Mio",_big_number_suffix_9:"Mrd",_big_number_suffix_12:"Bio",_big_number_suffix_15:"Brd",_big_number_suffix_18:"Trill",_big_number_suffix_21:"Trd",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"dd. MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"v. Chr.",_era_bc:"n. Chr.",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Januar",February:"Februar",March:"März",April:"April",May:"Mai",June:"Juni",July:"Juli",August:"August",September:"September",October:"Oktober",November:"November",December:"Dezember",Jan:"Jan.",Feb:"Febr.",Mar:"März",Apr:"Apr.","May(short)":"Mai",Jun:"Juni",Jul:"Juli",Aug:"Aug.",Sep:"Sept.",Oct:"Okt.",Nov:"Nov.",Dec:"Dez.",Sunday:"Sonntag",Monday:"Montag",Tuesday:"Dienstag",Wednesday:"Mittwoch",Thursday:"Donnerstag",Friday:"Freitag",Saturday:"Samstag",Sun:"So.",Mon:"Mo.",Tue:"Di.",Wed:"Mi.",Thu:"Do.",Fri:"Fr.",Sat:"Sa.",_dateOrd:function(i){return i+"."},"Zoom Out":"Herauszoomen",Play:"Abspielen",Stop:"Stop",Legend:"Legende","Click, tap or press ENTER to toggle":"Klicken, tippen oder ENTER drücken zum Umschalten",Loading:"Wird geladen",Home:"Home",Chart:"Diagramm","Serial chart":"Seriendiagramm","X/Y chart":"X-Y-Diagramm","Pie chart":"Kreisdiagramm","Gauge chart":"Messdiagramm","Radar chart":"Netzdiagramm","Sankey diagram":"Sankey-Diagramm","Chord diagram":"","Flow diagram":"Flussdiagramm","TreeMap chart":"Baumdiagramm",Series:"Serie","Candlestick Series":"Kerzendiagramm","Column Series":"Balkendiagramm","Line Series":"Liniendiagramm","Pie Slice Series":"Kreisdiagramm","X/Y Series":"Punktdiagramm",Map:"Karte","Press ENTER to zoom in":"Drücke ENTER zum Hereinzoomen","Press ENTER to zoom out":"Drücke ENTER zum Herauszoomen","Use arrow keys to zoom in and out":"Benutze die Pfeiltasten zum Zoomen","Use plus and minus keys on your keyboard to zoom in and out":"Benutze Plus- und Minustasten zum Zoomen",Export:"Export",Image:"Bild",Data:"Daten",Print:"Drucken","Click, tap or press ENTER to open":"Zum Öffnen klicken, tippen oder ENTER drücken","Click, tap or press ENTER to print.":"Zum Drucken klicken, tippen oder ENTER drücken.","Click, tap or press ENTER to export as %1.":"Klicken, tippen oder ENTER drücken um als %1 zu exportieren",'To save the image, right-click this link and choose "Save picture as..."':'Um das Bild zu speichern, Rechtsklicken und "Bild speichern unter ..." auswählen','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Um das Bild zu speichern, Rechtsklick auf das Vorschaubild links und "Bild speichern unter ..." auswählen',"(Press ESC to close this message)":"ESC drücken um diese Nachricht zu schließen","Image Export Complete":"Bildexport komplett","Export operation took longer than expected. Something might have gone wrong.":"Der Export dauert länger als geplant. Vielleicht ist etwas schiefgelaufen.","Saved from":"Gespeichert von",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"TAB nutzen, um Ankerpunkte auszuwählen oder linke und rechte Pfeiltaste um die Auswahl zu ändern","Use left and right arrows to move selection":"Linke und rechte Pfeiltaste nutzen um die Auswahl zu verschieben","Use left and right arrows to move left selection":"Linke und rechte Pfeiltaste nutzen um die linke Auswahl zu verschieben","Use left and right arrows to move right selection":"Linke und rechte Pfeiltaste nutzen um die rechte Auswahl zu verschieben","Use TAB select grip buttons or up and down arrows to change selection":"TAB nutzen, um Ankerpunkte auszuwählen oder Pfeiltaste nach oben und unten drücken, um die Auswahl zu ändern","Use up and down arrows to move selection":"Pfeiltaste nach oben und unten drücken, um die Auswahl zu verschieben","Use up and down arrows to move lower selection":"Pfeiltaste nach oben und unten drücken, um die untere Auswahl zu verschieben","Use up and down arrows to move upper selection":"Pfeiltaste nach oben und unten drücken, um die obere Auswahl zu verschieben","From %1 to %2":"Von %1 bis %2","From %1":"Von %1","To %1":"Bis %1","No parser available for file: %1":"Kein Parser für Datei %1 verfügbar","Error parsing file: %1":"Fehler beim Parsen von Datei %1","Unable to load file: %1":"Datei %1 konnte nicht geladen werden","Invalid date":"Kein Datum"}}(El,TZ))!==void 0&&(txt.exports=ixt);const EUi=CUi({__proto__:null,default:tl(TZ)},[TZ]),IUi=Object.freeze(Object.defineProperty({__proto__:null,d:EUi},Symbol.toStringTag,{value:"Module"}));function AUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var rxt,nxt,EZ={},PUi={get exports(){return EZ},set exports(t){EZ=t}};rxt=PUi,(nxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:"'",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"K",_big_number_suffix_6:"Mio",_big_number_suffix_9:"Mrd",_big_number_suffix_12:"Bio",_big_number_suffix_15:"Brd",_big_number_suffix_18:"Trill",_big_number_suffix_21:"Trd",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"dd. MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"v. Chr.",_era_bc:"n. Chr.",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Januar",February:"Februar",March:"März",April:"April",May:"Mai",June:"Juni",July:"Juli",August:"August",September:"September",October:"Oktober",November:"November",December:"Dezember",Jan:"Jan.",Feb:"Febr.",Mar:"März",Apr:"Apr.","May(short)":"Mai",Jun:"Juni",Jul:"Juli",Aug:"Aug.",Sep:"Sept.",Oct:"Okt.",Nov:"Nov.",Dec:"Dez.",Sunday:"Sonntag",Monday:"Montag",Tuesday:"Dienstag",Wednesday:"Mittwoch",Thursday:"Donnerstag",Friday:"Freitag",Saturday:"Samstag",Sun:"So.",Mon:"Mo.",Tue:"Di.",Wed:"Mi.",Thu:"Do.",Fri:"Fr.",Sat:"Sa.",_dateOrd:function(i){return i+"."},"Zoom Out":"Herauszoomen",Play:"Abspielen",Stop:"Stop",Legend:"Legende","Click, tap or press ENTER to toggle":"Klicken, tippen oder ENTER drücken zum Umschalten",Loading:"Wird geladen",Home:"Home",Chart:"Diagramm","Serial chart":"Seriendiagramm","X/Y chart":"X-Y-Diagramm","Pie chart":"Kreisdiagramm","Gauge chart":"Messdiagramm","Radar chart":"Netzdiagramm","Sankey diagram":"Sankey-Diagramm","Chord diagram":"","Flow diagram":"Flussdiagramm","TreeMap chart":"Baumdiagramm",Series:"Serie","Candlestick Series":"Kerzendiagramm","Column Series":"Balkendiagramm","Line Series":"Liniendiagramm","Pie Slice Series":"Kreisdiagramm","X/Y Series":"Punktdiagramm",Map:"Karte","Press ENTER to zoom in":"Drücke ENTER zum Hereinzoomen","Press ENTER to zoom out":"Drücke ENTER zum Herauszoomen","Use arrow keys to zoom in and out":"Benutze die Pfeiltasten zum Zoomen","Use plus and minus keys on your keyboard to zoom in and out":"Benutze Plus- und Minustasten zum Zoomen",Export:"Export",Image:"Bild",Data:"Daten",Print:"Drucken","Click, tap or press ENTER to open":"Zum Öffnen klicken, tippen oder ENTER drücken","Click, tap or press ENTER to print.":"Zum Drucken klicken, tippen oder ENTER drücken.","Click, tap or press ENTER to export as %1.":"Klicken, tippen oder ENTER drücken um als %1 zu exportieren",'To save the image, right-click this link and choose "Save picture as..."':'Um das Bild zu speichern, Rechtsklicken und "Bild speichern unter ..." auswählen','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Um das Bild zu speichern, Rechtsklick auf das Vorschaubild links und "Bild speichern unter ..." auswählen',"(Press ESC to close this message)":"ESC drücken um diese Nachricht zu schließen","Image Export Complete":"Bildexport komplett","Export operation took longer than expected. Something might have gone wrong.":"Der Export dauert länger als geplant. Vielleicht ist etwas schiefgelaufen.","Saved from":"Gespeichert von",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"TAB nutzen, um Ankerpunkte auszuwählen oder linke und rechte Pfeiltaste um die Auswahl zu ändern","Use left and right arrows to move selection":"Linke und rechte Pfeiltaste nutzen um die Auswahl zu verschieben","Use left and right arrows to move left selection":"Linke und rechte Pfeiltaste nutzen um die linke Auswahl zu verschieben","Use left and right arrows to move right selection":"Linke und rechte Pfeiltaste nutzen um die rechte Auswahl zu verschieben","Use TAB select grip buttons or up and down arrows to change selection":"TAB nutzen, um Ankerpunkte auszuwählen oder Pfeiltaste nach oben und unten drücken, um die Auswahl zu ändern","Use up and down arrows to move selection":"Pfeiltaste nach oben und unten drücken, um die Auswahl zu verschieben","Use up and down arrows to move lower selection":"Pfeiltaste nach oben und unten drücken, um die untere Auswahl zu verschieben","Use up and down arrows to move upper selection":"Pfeiltaste nach oben und unten drücken, um die obere Auswahl zu verschieben","From %1 to %2":"Von %1 bis %2","From %1":"Von %1","To %1":"Bis %1","No parser available for file: %1":"Kein Parser für Datei %1 verfügbar","Error parsing file: %1":"Fehler beim Parsen von Datei %1","Unable to load file: %1":"Datei %1 konnte nicht geladen werden","Invalid date":"Kein Datum"}}(El,EZ))!==void 0&&(rxt.exports=nxt);const OUi=AUi({__proto__:null,default:tl(EZ)},[EZ]),RUi=Object.freeze(Object.defineProperty({__proto__:null,d:OUi},Symbol.toStringTag,{value:"Module"}));function MUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var sxt,oxt,IZ={},DUi={get exports(){return IZ},set exports(t){IZ=t}};sxt=DUi,(oxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"μ.Χ.",_era_bc:"π.Χ.",A:"πμ",P:"μμ",AM:"π.μ.",PM:"μ.μ.","A.M.":"π.μ.","P.M.":"μ.μ.",January:"Ιανουαρίου",February:"Φεβρουαρίου",March:"Μαρτίου",April:"Απριλίου",May:"Μαΐου",June:"Ιουνίου",July:"Ιουλίου",August:"Αυγούστου",September:"Σεπτεμβρίου",October:"Οκτωβρίου",November:"Νοεμβρίου",December:"Δεκεμβρίου",Jan:"Ιαν",Feb:"Φεβ",Mar:"Μαρ",Apr:"Απρ","May(short)":"Μαΐ",Jun:"Ιουν",Jul:"Ιουλ",Aug:"Αυγ",Sep:"Σεπ",Oct:"Οκτ",Nov:"Νοε",Dec:"Δεκ",Sunday:"Κυριακή",Monday:"Δευτέρα",Tuesday:"Τρίτη",Wednesday:"Τετάρτη",Thursday:"Πέμπτη",Friday:"Παρασκευή",Saturday:"Σάββατο",Sun:"Κυρ",Mon:"Δευ",Tue:"Τρί",Wed:"Τετ",Thu:"Πέμ",Fri:"Παρ",Sat:"Σάβ",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Εστίαση",Play:"Αναπαραγωγή",Stop:"Στάση",Legend:"Υπόμνημα","Click, tap or press ENTER to toggle":"",Loading:"Φόρτωση",Home:"Αρχική",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Εκτύπωση",Image:"Image",Data:"Δεδομένα",Print:"Εκτύπωση","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Από %1 έως %2","From %1":"Από %1","To %1":"Έως %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,IZ))!==void 0&&(sxt.exports=oxt);const FUi=MUi({__proto__:null,default:tl(IZ)},[IZ]),LUi=Object.freeze(Object.defineProperty({__proto__:null,e:FUi},Symbol.toStringTag,{value:"Module"}));function NUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var axt,lxt,AZ={},kUi={get exports(){return AZ},set exports(t){AZ=t}};axt=kUi,(lxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm::ss SSS",_date_second:"hh:mm:ss a",_date_minute:"hh:mm a",_date_hour:"hh:mm a",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},Play:"",Stop:"","Zoom Out":"",Legend:"","Click, tap or press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Chord diagram":"","Flow diagram":"","TreeMap chart":"",Series:"","Candlestick Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,AZ))!==void 0&&(axt.exports=lxt);const $Ui=NUi({__proto__:null,default:tl(AZ)},[AZ]),BUi=Object.freeze(Object.defineProperty({__proto__:null,e:$Ui},Symbol.toStringTag,{value:"Module"}));function VUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var uxt,cxt,PZ={},jUi={get exports(){return PZ},set exports(t){PZ=t}};uxt=jUi,(cxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm::ss SSS",_date_second:"hh:mm:ss a",_date_minute:"hh:mm a",_date_hour:"hh:mm a",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},Play:"",Stop:"","Zoom Out":"",Legend:"","Click, tap or press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Chord diagram":"","Flow diagram":"","TreeMap chart":"",Series:"","Candlestick Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,PZ))!==void 0&&(uxt.exports=cxt);const GUi=VUi({__proto__:null,default:tl(PZ)},[PZ]),UUi=Object.freeze(Object.defineProperty({__proto__:null,e:GUi},Symbol.toStringTag,{value:"Module"}));function zUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var hxt,dxt,OZ={},HUi={get exports(){return OZ},set exports(t){OZ=t}};hxt=HUi,(dxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"dd MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"DC",_era_bc:"AC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Enero",February:"Febrero",March:"Marzo",April:"Abril",May:"Mayo",June:"Junio",July:"Julio",August:"Agosto",September:"Septiembre",October:"Octubre",November:"Noviembre",December:"Diciembre",Jan:"Ene",Feb:"Feb",Mar:"Mar",Apr:"Abr","May(short)":"May",Jun:"Jun",Jul:"Jul",Aug:"Ago",Sep:"Sep",Oct:"Oct",Nov:"Nov",Dec:"Dic",Sunday:"Domingo",Monday:"Lunes",Tuesday:"Martes",Wednesday:"Miércoles",Thursday:"Jueves",Friday:"Viernes",Saturday:"Sábado",Sun:"Dom",Mon:"Lun",Tue:"Mar",Wed:"Mie",Thu:"Jue",Fri:"Vie",Sat:"Sáb",_dateOrd:function(i){return"º"},"Zoom Out":"Aumentar Zoom",Play:"Reproducir",Stop:"Detener",Legend:"Leyenda","Click, tap or press ENTER to toggle":"Haga clic, toque o presione ENTER para alternar",Loading:"Cargando",Home:"Inicio",Chart:"Gráfico","Serial chart":"Gráfico de serie","X/Y chart":"Gráfico X/Y","Pie chart":"Gráfico circular","Gauge chart":"Gráfico de medidor radial","Radar chart":"Gráfico de radar","Sankey diagram":"Diagrama de sankey","Chord diagram":"Diagrama de cuerdas","Flow diagram":"Diagrama de flujo","TreeMap chart":"Gráfico de mapa de árbol",Series:"Series","Candlestick Series":"Series de velas","Column Series":"Series de columnas","Line Series":"Series de líneas","Pie Slice Series":"Series de trozos circular","X/Y Series":"Series de X/Y",Map:"Mapa","Press ENTER to zoom in":"Presione ENTER para aumentar el zoom","Press ENTER to zoom out":"Presione ENTER para disminuir el zoom","Use arrow keys to zoom in and out":"Use los cursores para disminuir o aumentar el zoom","Use plus and minus keys on your keyboard to zoom in and out":"Use las teclas mas o menos en su teclado para disminuir ou aumentar el zoom",Export:"Exportar",Image:"Imagen",Data:"Datos",Print:"Imprimir","Click, tap or press ENTER to open":"Haga clic, toque o presione ENTER para abrir","Click, tap or press ENTER to print.":"Haga clic, toque o presione ENTER para imprimir","Click, tap or press ENTER to export as %1.":"Haga clic, toque o presione ENTER para exportar como %1.",'To save the image, right-click this link and choose "Save picture as..."':'Para guardar la imagen, haga clic en el link con el botón derecho y elija "Guardar imagen como..."','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Para guardar la imagen, haga clic con el botón derecho en la miniatura a la izquierda y elija "Guardar imagen como ..."',"(Press ESC to close this message)":"(Presione ESC para cerrar este mensaje)","Image Export Complete":"Exportación de imagen completada","Export operation took longer than expected. Something might have gone wrong.":"La operación de exportación llevó más tiempo de lo esperado. Algo pudo haber salido mal.","Saved from":"Guardado de",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"Use TAB para seleccionar los botones de agarre o las flechas izquierda y derecha para cambiar la selección","Use left and right arrows to move selection":"Use las flechas izquierda y derecha para mover la selección","Use left and right arrows to move left selection":"Use las flechas izquierda y derecha para mover la selección izquierda","Use left and right arrows to move right selection":"Use las flechas izquierda y derecha para mover la selección derecha","Use TAB select grip buttons or up and down arrows to change selection":"Utilice los botones de control de selección TAB o flechas arriba y abajo para cambiar la selección","Use up and down arrows to move selection":"Use las flechas hacia arriba y hacia abajo para mover la selección","Use up and down arrows to move lower selection":"Use las flechas hacia arriba y hacia abajo para mover la selección inferior","Use up and down arrows to move upper selection":"Use las flechas hacia arriba y hacia abajo para mover la selección superior","From %1 to %2":"Desde %1 hasta %2","From %1":"Desde %1","To %1":"Hasta %1","No parser available for file: %1":"No hay analizador disponible para el archivo: %1","Error parsing file: %1":"Error al analizar el archivo: %1","Unable to load file: %1":"No se puede cargar el archivo: %1","Invalid date":"Fecha inválida"}}(El,OZ))!==void 0&&(hxt.exports=dxt);const WUi=zUi({__proto__:null,default:tl(OZ)},[OZ]),qUi=Object.freeze(Object.defineProperty({__proto__:null,e:WUi},Symbol.toStringTag,{value:"Module"}));function YUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var pxt,fxt,RZ={},XUi={get exports(){return RZ},set exports(t){RZ=t}};pxt=XUi,(fxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"pKr",_era_bc:"eKr",A:"AM",P:"PM",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"jaanuar",February:"veebruar",March:"märts",April:"aprill",May:"mai",June:"juuni",July:"juuli",August:"august",September:"september",October:"oktoober",November:"november",December:"detsember",Jan:"jaan",Feb:"veebr",Mar:"märts",Apr:"apr","May(short)":"mai",Jun:"juuni",Jul:"juuli",Aug:"aug",Sep:"sept",Oct:"okt",Nov:"nov",Dec:"dets",Sunday:"pühapäev",Monday:"esmaspäev",Tuesday:"teisipäev",Wednesday:"kolmapäev",Thursday:"neljapäev",Friday:"reede",Saturday:"laupäev",Sun:"P",Mon:"E",Tue:"T",Wed:"K",Thu:"N",Fri:"R",Sat:"L",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Suumi",Play:"Esita",Stop:"Lõpeta",Legend:"Legend","Click, tap or press ENTER to toggle":"",Loading:"Laadin",Home:"Kodu",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Prindi",Image:"Pilt",Data:"Andmed",Print:"Prindi","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Alates %1 kuni %2","From %1":"Alates %1","To %1":"Kuni %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,RZ))!==void 0&&(pxt.exports=fxt);const KUi=YUi({__proto__:null,default:tl(RZ)},[RZ]),JUi=Object.freeze(Object.defineProperty({__proto__:null,e:KUi},Symbol.toStringTag,{value:"Module"}));function ZUi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var mxt,gxt,MZ={},QUi={get exports(){return MZ},set exports(t){MZ=t}};mxt=QUi,(gxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"jKr.",_era_bc:"eKr.",A:"ap.",P:"ip.",AM:"ap.",PM:"ip.","A.M.":"ap.","P.M.":"ip.",January:"tammikuuta",February:"helmikuuta",March:"maaliskuuta",April:"huhtikuuta",May:"toukokuuta",June:"kesäkuuta",July:"heinäkuuta",August:"elokuuta",September:"syyskuuta",October:"lokakuuta",November:"marraskuuta",December:"joulukuuta",Jan:"tammik.",Feb:"helmik.",Mar:"maalisk.",Apr:"huhtik.","May(short)":"toukok.",Jun:"kesäk.",Jul:"heinäk.",Aug:"elok.",Sep:"syysk.",Oct:"lokak.",Nov:"marrask.",Dec:"jouluk.",Sunday:"sunnuntaina",Monday:"maanantaina",Tuesday:"tiistaina",Wednesday:"keskiviikkona",Thursday:"torstaina",Friday:"perjantaina",Saturday:"lauantaina",Sun:"su",Mon:"ma",Tue:"ti",Wed:"ke",Thu:"to",Fri:"pe",Sat:"la",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Tarkennus",Play:"Toista",Stop:"Lopeta",Legend:"Selite","Click, tap or press ENTER to toggle":"",Loading:"Ladataan",Home:"Aloitussivu",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Tulosta",Image:"kuva",Data:"Data",Print:"Tulosta","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Mistä %1 mihin %2","From %1":"Mistä %1","To %1":"Mihin %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,MZ))!==void 0&&(mxt.exports=gxt);const e7i=ZUi({__proto__:null,default:tl(MZ)},[MZ]),t7i=Object.freeze(Object.defineProperty({__proto__:null,f:e7i},Symbol.toStringTag,{value:"Module"}));function i7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var yxt,vxt,DZ={},r7i={get exports(){return DZ},set exports(t){DZ=t}};yxt=r7i,(vxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"dd MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"A",P:"P",AM:"AM",PM:"PM","A.M.":"A.M.","P.M.":"P.M.",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",Jan:"Jan",Feb:"Fév",Mar:"Mar",Apr:"Avr","May(short)":"Mai",Jun:"Jui",Jul:"Jul",Aug:"Aoû",Sep:"Sep",Oct:"Oct",Nov:"Nov",Dec:"Déc",Sunday:"Dimanche",Monday:"Lundi",Tuesday:"Mardi",Wednesday:"Mercredi",Thursday:"Jeudi",Friday:"Vendredi",Saturday:"Samedi",Sun:"Dim",Mon:"Lun",Tue:"Mar",Wed:"Mer",Thu:"Jeu",Fri:"Ven",Sat:"Sam",_dateOrd:function(i){var r="e";return(i<11||i>13)&&i%10==1&&(r="er"),r},"Zoom Out":"Zoom Arrière",Play:"Joue",Stop:"Arrête",Legend:"Légende","Click, tap or press ENTER to toggle":"cliquez, appuyez ou appuyez sur entrée pour basculer",Loading:"Charger",Home:"Accueil",Chart:"Graphique","Serial chart":"Graphique sérial","X/Y chart":"Graphique X/Y","Pie chart":"Camembert","Gauge chart":"Jauge graphique","Radar chart":"Carte radar","Sankey diagram":"Graphique Sankey","Flow diagram":"représentation schématique","Chord diagram":"diagramme d'accord","TreeMap chart":"carte de l'arbre","Sliced chart":"graphique en tranches",Series:"Séries","Candlestick Series":"Séries chandelier","OHLC Series":"Séries OHLC","Column Series":"Séries de colonnes","Line Series":"Série de lignes","Pie Slice Series":"Tarte tranche Séries","Funnel Series":"Séries d'entonnoir","Pyramid Series":"Séries pyramidale","X/Y Series":"Séries X/Y",Map:"Mappe","Press ENTER to zoom in":"Appuyez sur ENTER pour zoomer","Press ENTER to zoom out":"Appuyez sur ENTER pour effectuer un zoom arrière","Use arrow keys to zoom in and out":"Utilisez les touches fléchées pour zoomer et dézoomer","Use plus and minus keys on your keyboard to zoom in and out":"Utilisez les touches plus et moins de votre clavier pour effectuer un zoom avant ou arrière",Export:"Exporter",Image:"Image",Data:"Data",Print:"Imprimer","Click, tap or press ENTER to open":"Cliquez, appuyez ou appuyez sur ENTER pour ouvrir","Click, tap or press ENTER to print.":"Cliquez, appuyez ou appuyez sur ENTER pour imprimer","Click, tap or press ENTER to export as %1.":"Cliquez, appuyez ou appuyez sur ENTER pour exporter comme %1",'To save the image, right-click this link and choose "Save picture as..."':"Pour enregistrer l'image, cliquez avec le bouton droit sur ce lien et choisissez 'Enregistrer l'image sous ...'",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"'Pour enregistrer l'image, cliquez sur la vignette à gauche avec le bouton droit de la souris et choisissez 'Enregistrer l'image sous ...'","(Press ESC to close this message)":"(Appuyez sur ESC pour fermer ce message)","Image Export Complete":"Exportation d'image terminée","Export operation took longer than expected. Something might have gone wrong.":"L'exportation a pris plus de temps que prévu. Quelque chose aurait mal tourné.","Saved from":"Enregistré de",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"Utilisez la touche TAB pour sélectionner les boutons des poignées ou les flèches gauche et droite pour modifier la sélection.","Use left and right arrows to move selection":"Utilisez les flèches gauche et droite pour déplacer la sélection","Use left and right arrows to move left selection":"Utilisez les flèches gauche et droite pour déplacer la sélection gauche","Use left and right arrows to move right selection":"Utilisez les flèches gauche et droite pour déplacer la sélection droite","Use TAB select grip buttons or up and down arrows to change selection":"Utilisez les boutons de sélection TAB ou les flèches vers le haut et le bas pour modifier la sélection.","Use up and down arrows to move selection":"Utilisez les flèches haut et bas pour déplacer la sélection","Use up and down arrows to move lower selection":"Utilisez les flèches haut et bas pour déplacer la sélection inférieure","Use up and down arrows to move upper selection":"Utilisez les flèches haut et bas pour déplacer la sélection supérieure","From %1 to %2":"De %1 à %2","From %1":"De %1","To %1":"à %1","No parser available for file: %1":"Aucun analyseur disponible pour le fichier: %1","Error parsing file: %1":"Erreur d'analyse du fichier: %1","Unable to load file: %1":"Impossible de charger le fichier: %1","Invalid date":"Date invalide"}}(El,DZ))!==void 0&&(yxt.exports=vxt);const n7i=i7i({__proto__:null,default:tl(DZ)},[DZ]),s7i=Object.freeze(Object.defineProperty({__proto__:null,f:n7i},Symbol.toStringTag,{value:"Module"}));function o7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var _xt,bxt,FZ={},a7i={get exports(){return FZ},set exports(t){FZ=t}};_xt=a7i,(bxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"לספירה",_era_bc:"לפנה״ס",A:"לפנה״צ",P:"אחה״צ",AM:"לפנה״צ",PM:"אחה״צ","A.M.":"לפנה״צ","P.M.":"אחה״צ",January:"ינואר",February:"פברואר",March:"מרץ",April:"אפריל",May:"מאי",June:"יוני",July:"יולי",August:"אוגוסט",September:"ספטמבר",October:"אוקטובר",November:"נובמבר",December:"דצמבר",Jan:"ינו׳",Feb:"פבר׳",Mar:"מרץ",Apr:"אפר׳","May(short)":"מאי",Jun:"יוני",Jul:"יולי",Aug:"אוג׳",Sep:"ספט׳",Oct:"אוק׳",Nov:"נוב׳",Dec:"דצמ׳",Sunday:"יום ראשון",Monday:"יום שני",Tuesday:"יום שלישי",Wednesday:"יום רביעי",Thursday:"יום חמישי",Friday:"יום שישי",Saturday:"יום שבת",Sun:"יום א׳",Mon:"יום ב׳",Tue:"יום ג׳",Wed:"יום ד׳",Thu:"יום ה׳",Fri:"יום ו׳",Sat:"שבת",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"התמקד",Play:"נגן",Stop:"עצור",Legend:"מקרא","Click, tap or press ENTER to toggle":"",Loading:"טעינה",Home:"דף הבית",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"הדפס",Image:"תמונה",Data:"נתונים",Print:"הדפס","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"מ %1 עד %2","From %1":"מ %1","To %1":"עד %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,FZ))!==void 0&&(_xt.exports=bxt);const l7i=o7i({__proto__:null,default:tl(FZ)},[FZ]),u7i=Object.freeze(Object.defineProperty({__proto__:null,h:l7i},Symbol.toStringTag,{value:"Module"}));function c7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var wxt,xxt,LZ={},h7i={get exports(){return LZ},set exports(t){LZ=t}};wxt=h7i,(xxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"po. Kr.",_era_bc:"pr. Kr.",A:"AM",P:"PM",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"siječnja",February:"veljače",March:"ožujka",April:"travnja",May:"svibnja",June:"lipnja",July:"srpnja",August:"kolovoza",September:"rujna",October:"listopada",November:"studenoga",December:"prosinca",Jan:"sij",Feb:"velj",Mar:"ožu",Apr:"tra","May(short)":"svi",Jun:"lip",Jul:"srp",Aug:"kol",Sep:"ruj",Oct:"lis",Nov:"stu",Dec:"pro",Sunday:"nedjelja",Monday:"ponedjeljak",Tuesday:"utorak",Wednesday:"srijeda",Thursday:"četvrtak",Friday:"petak",Saturday:"subota",Sun:"ned",Mon:"pon",Tue:"uto",Wed:"sri",Thu:"čet",Fri:"pet",Sat:"sub",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Povećaj",Play:"Reproduciraj",Stop:"Zaustavi",Legend:"Legenda","Click, tap or press ENTER to toggle":"",Loading:"Učitavanje",Home:"Početna",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Ispis",Image:"Slika",Data:"Podaci",Print:"Ispis","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,LZ))!==void 0&&(wxt.exports=xxt);const d7i=c7i({__proto__:null,default:tl(LZ)},[LZ]),p7i=Object.freeze(Object.defineProperty({__proto__:null,h:d7i},Symbol.toStringTag,{value:"Module"}));function f7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Sxt,Cxt,NZ={},m7i={get exports(){return NZ},set exports(t){NZ=t}};Sxt=m7i,(Cxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"i. sz.",_era_bc:"i. e.",A:"de.",P:"du.",AM:"de.",PM:"du.","A.M.":"de.","P.M.":"du.",January:"január",February:"február",March:"március",April:"április",May:"május",June:"június",July:"július",August:"augusztus",September:"szeptember",October:"október",November:"november",December:"december",Jan:"jan.",Feb:"febr.",Mar:"márc.",Apr:"ápr.","May(short)":"máj.",Jun:"jún.",Jul:"júl.",Aug:"aug.",Sep:"szept.",Oct:"okt.",Nov:"nov.",Dec:"dec.",Sunday:"vasárnap",Monday:"hétfő",Tuesday:"kedd",Wednesday:"szerda",Thursday:"csütörtök",Friday:"péntek",Saturday:"szombat",Sun:"V",Mon:"H",Tue:"K",Wed:"Sze",Thu:"Cs",Fri:"P",Sat:"Szo",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Nagyítás/kicsinyítés",Play:"Lejátszás",Stop:"Megálló",Legend:"Jelmagyarázat","Click, tap or press ENTER to toggle":"",Loading:"Betöltés",Home:"Kezdőlap",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Nyomtatás",Image:"Kép",Data:"Adatok",Print:"Nyomtatás","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Ettől %1 eddig %2","From %1":"Ettől %1","To %1":"Eddig %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,NZ))!==void 0&&(Sxt.exports=Cxt);const g7i=f7i({__proto__:null,default:tl(NZ)},[NZ]),y7i=Object.freeze(Object.defineProperty({__proto__:null,h:g7i},Symbol.toStringTag,{value:"Module"}));function v7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Txt,Ext,kZ={},_7i={get exports(){return kZ},set exports(t){kZ=t}};Txt=_7i,(Ext=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"M",_era_bc:"SM",A:"AM",P:"PM",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"Januari",February:"Februari",March:"Maret",April:"April",May:"Mei",June:"Juni",July:"Juli",August:"Agustus",September:"September",October:"Oktober",November:"November",December:"Desember",Jan:"Jan",Feb:"Feb",Mar:"Mar",Apr:"Apr","May(short)":"Mei",Jun:"Jun",Jul:"Jul",Aug:"Agu",Sep:"Sep",Oct:"Okt",Nov:"Nov",Dec:"Des",Sunday:"Minggu",Monday:"Senin",Tuesday:"Selasa",Wednesday:"Rabu",Thursday:"Kamis",Friday:"Jumat",Saturday:"Sabtu",Sun:"Min",Mon:"Sen",Tue:"Sel",Wed:"Rab",Thu:"Kam",Fri:"Jum",Sat:"Sab",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Perkecil",Play:"Putar",Stop:"Hentikan",Legend:"Legenda","Click, tap or press ENTER to toggle":"Klik, ketuk atau tekan ENTER untuk beralih",Loading:"Memuat",Home:"Beranda",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"Peta","Press ENTER to zoom in":"Tekan ENTER untuk memperbesar","Press ENTER to zoom out":"Tekan ENTER untuk memperkecil","Use arrow keys to zoom in and out":"Gunakan tombol panah untuk memperbesar dan memperkecil","Use plus and minus keys on your keyboard to zoom in and out":"Gunakan tombol plus dan minus pada keyboard Anda untuk memperbesar dan memperkecil",Export:"Cetak",Image:"Gambar",Data:"Data",Print:"Cetak","Click, tap or press ENTER to open":"Klik, ketuk atau tekan ENTER untuk membuka","Click, tap or press ENTER to print.":"Klik, ketuk atau tekan ENTER untuk mencetak","Click, tap or press ENTER to export as %1.":"Klik, ketuk atau tekan ENTER untuk mengekspor sebagai %1",'To save the image, right-click this link and choose "Save picture as..."':'Untuk menyimpan gambar, klik kanan tautan ini dan pilih "Simpan gambar sebagai"','To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"Tekan ESC untuk menutup pesan ini","Image Export Complete":"Ekspor gambar selesai","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Dari %1 ke %2","From %1":"Dari %1","To %1":"Ke %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,kZ))!==void 0&&(Txt.exports=Ext);const b7i=v7i({__proto__:null,default:tl(kZ)},[kZ]),w7i=Object.freeze(Object.defineProperty({__proto__:null,i:b7i},Symbol.toStringTag,{value:"Module"}));function x7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Ixt,Axt,$Z={},S7i={get exports(){return $Z},set exports(t){$Z=t}};Ixt=S7i,(Axt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"dd MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"HH:mm:ss SSS",_duration_millisecond_day:"d'g' mm:ss SSS",_duration_millisecond_week:"d'g' mm:ss SSS",_duration_millisecond_month:"M'm' dd'g' mm:ss SSS",_duration_millisecond_year:"y'a' MM'm' dd'g' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'g' hh:mm:ss",_duration_second_week:"d'g' hh:mm:ss",_duration_second_month:"M'm' dd'g' hh:mm:ss",_duration_second_year:"y'a' MM'm' dd'g' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'g' hh:mm",_duration_minute_week:"d'g' hh:mm",_duration_minute_month:"M'm' dd'g' hh:mm",_duration_minute_year:"y'a' MM'm' dd'g' hh:mm",_duration_hour:"hh'o'",_duration_hour_day:"d'g' hh'o'",_duration_hour_week:"d'g' hh'o'",_duration_hour_month:"M'm' dd'g' hh'o'",_duration_hour_year:"y'a' MM'm' dd'g' hh'o'",_duration_day:"d'g'",_duration_day_week:"d'g'",_duration_day_month:"M'm' dd'g'",_duration_day_year:"y'a' MM'm' dd'g'",_duration_week:"w's'",_duration_week_month:"w's'",_duration_week_year:"w's'",_duration_month:"M'm'",_duration_month_year:"y'a' MM'm'",_duration_year:"y'a'",_era_ad:"A.C.",_era_bc:"D.C.",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Gennaio",February:"Febbraio",March:"Marzo",April:"Aprile",May:"Maggio",June:"Giugno",July:"Luglio",August:"Agosto",September:"Settembre",October:"Ottobre",November:"Novembre",December:"Dicembre",Jan:"Gen",Feb:"Feb",Mar:"Mar",Apr:"Apr","May(short)":"Mag",Jun:"Giu",Jul:"Lug",Aug:"Ago",Sep:"Set",Oct:"Ott",Nov:"Nov",Dec:"Dic",Sunday:"Domenica",Monday:"Lunedì",Tuesday:"Martedì",Wednesday:"Mercoledì",Thursday:"Giovedì",Friday:"Venerdì",Saturday:"Sabato",Sun:"Dom",Mon:"Lun",Tue:"Mar",Wed:"Mer",Thu:"Gio",Fri:"Ven",Sat:"Sab",_dateOrd:function(i){return i+"°"},"Zoom Out":"Riduci zoom",Play:"Avvia",Stop:"Ferma",Legend:"Legenda","Click, tap or press ENTER to toggle":"Clicca, tappa o premi ENTER per attivare",Loading:"Caricamento",Home:"Home",Chart:"Grafico","Serial chart":"Grafico combinato","X/Y chart":"Grafico X/Y","Pie chart":"Grafico a torta","Gauge chart":"Diagramma di livello","Radar chart":"Grafico radar","Sankey diagram":"Diagramma di Sankey","Flow diagram":"Diagramma di flusso","Chord diagram":"Diagramma a corda","TreeMap chart":"Mappa ad albero","Sliced chart":"Grafico a fette",Series:"Serie","Candlestick Series":"Serie a candele","OHLC Series":"Serie OHLC","Column Series":"Serie a colonne","Line Series":"Serie a linee","Pie Slice Series":"Serie a fetta di torta","Funnel Series":"Serie ad imbuto","Pyramid Series":"Serie a piramide","X/Y Series":"Serie X/Y",Map:"Mappa","Press ENTER to zoom in":"Premi ENTER per ingrandire","Press ENTER to zoom out":"Premi ENTER per ridurre","Use arrow keys to zoom in and out":"Usa le frecce per ingrandire e ridurre","Use plus and minus keys on your keyboard to zoom in and out":"Utilizza i tasti più e meno sulla tastiera per ingrandire e ridurre",Export:"Esporta",Image:"Immagine",Data:"Dati",Print:"Stampa","Click, tap or press ENTER to open":"Clicca, tappa o premi ENTER per aprire","Click, tap or press ENTER to print.":"Clicca, tappa o premi ENTER per stampare.","Click, tap or press ENTER to export as %1.":"Clicca, tappa o premi ENTER per esportare come %1.",'To save the image, right-click this link and choose "Save picture as..."':`Per salvare l'immagine, fai clic con il pulsante destro del mouse su questo link e seleziona "Salva immagine come ..."`,'To save the image, right-click thumbnail on the left and choose "Save picture as..."':`Per salvare l'immagine, fare clic con il tasto destro del mouse sulla miniatura e selezionare "Salva immagine come ..."`,"(Press ESC to close this message)":"(Premere ESC per chiudere questo messaggio)","Image Export Complete":"Esportazione immagine completata","Export operation took longer than expected. Something might have gone wrong.":"L'operazione di esportazione ha richiesto più tempo del previsto. Potrebbe esserci qualche problema.","Saved from":"Salvato da",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"Utilizzare TAB per selezionare i punti di ancoraggio o i tasti freccia sinistra e destra per modificare la selezione","Use left and right arrows to move selection":"Utilizzare le frecce sinistra e destra per spostare la selezione","Use left and right arrows to move left selection":"Utilizzare frecce destra e sinistra per spostare la selezione sinistra","Use left and right arrows to move right selection":"Utilizzare frecce destra e sinistra per spostare la selezione destra","Use TAB select grip buttons or up and down arrows to change selection":"Utilizzare TAB per selezionare i punti di ancoraggio o premere le frecce su e giù per modificare la selezione","Use up and down arrows to move selection":"Utilizzare le frecce su e giù per spostare la selezione","Use up and down arrows to move lower selection":"Utilizzare le frecce su e giù per spostare la selezione inferiore","Use up and down arrows to move upper selection":"Utilizzare le frecce su e giù per spostare la selezione superiore","From %1 to %2":"Da %1 a %2","From %1":"Da %1","To %1":"a %1","No parser available for file: %1":"Nessun parser disponibile per il file: %1","Error parsing file: %1":"Errore durante l'analisi del file: %1","Unable to load file: %1":"Impossibile caricare il file: %1","Invalid date":"Data non valida"}}(El,$Z))!==void 0&&(Ixt.exports=Axt);const C7i=x7i({__proto__:null,default:tl($Z)},[$Z]),T7i=Object.freeze(Object.defineProperty({__proto__:null,i:C7i},Symbol.toStringTag,{value:"Module"}));function E7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Pxt,Oxt,BZ={},I7i={get exports(){return BZ},set exports(t){BZ=t}};Pxt=I7i,(Oxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"西暦",_era_bc:"紀元前",A:"午前",P:"午後",AM:"午前",PM:"午後","A.M.":"午前","P.M.":"午後",January:"1月",February:"2月",March:"3月",April:"4月",May:"5月",June:"6月",July:"7月",August:"8月",September:"9月",October:"10月",November:"11月",December:"12月",Jan:"1月",Feb:"2月",Mar:"3月",Apr:"4月","May(short)":"5月",Jun:"6月",Jul:"7月",Aug:"8月",Sep:"9月",Oct:"10月",Nov:"11月",Dec:"12月",Sunday:"日曜日",Monday:"月曜日",Tuesday:"火曜日",Wednesday:"水曜日",Thursday:"木曜日",Friday:"金曜日",Saturday:"土曜日",Sun:"日",Mon:"月",Tue:"火",Wed:"水",Thu:"木",Fri:"金",Sat:"土",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"ズーム",Play:"再生",Stop:"停止",Legend:"凡例","Click, tap or press ENTER to toggle":"",Loading:"読み込んでいます",Home:"ホーム",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"印刷",Image:"イメージ",Data:"データ",Print:"印刷","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"始点 %1 終点 %2","From %1":"始点 %1","To %1":"終点 %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,BZ))!==void 0&&(Pxt.exports=Oxt);const A7i=E7i({__proto__:null,default:tl(BZ)},[BZ]),P7i=Object.freeze(Object.defineProperty({__proto__:null,j:A7i},Symbol.toStringTag,{value:"Module"}));function O7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Rxt,Mxt,VZ={},R7i={get exports(){return VZ},set exports(t){VZ=t}};Rxt=R7i,(Mxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"AM",P:"PM",AM:"AM",PM:"PM","A.M.":"오전","P.M.":"오후",January:"1월",February:"2월",March:"3월",April:"4월",May:"5월",June:"6월",July:"7월",August:"8월",September:"9월",October:"10월",November:"11월",December:"12월",Jan:"1월",Feb:"2월",Mar:"3월",Apr:"4월","May(short)":"5월",Jun:"6월",Jul:"7월",Aug:"8월",Sep:"9월",Oct:"10월",Nov:"11월",Dec:"12월",Sunday:"일요일",Monday:"월요일",Tuesday:"화요일",Wednesday:"수요일",Thursday:"목요일",Friday:"금요일",Saturday:"토요일",Sun:"일",Mon:"월",Tue:"화",Wed:"수",Thu:"목",Fri:"금",Sat:"토",_dateOrd:function(i){var r="일";if(i<11||i>13)switch(i%10){case 1:case 2:case 3:r="일"}return r},"Zoom Out":"축소",Play:"시작",Stop:"정지",Legend:"범례","Click, tap or press ENTER to toggle":"켜고 끄려면 클릭, 탭 혹은 엔터를 눌러주세요.",Loading:"불러오는 중",Home:"홈",Chart:"차트","Serial chart":"시리얼 차트","X/Y chart":"X/Y 차트","Pie chart":"파이 차트","Gauge chart":"게이지 차트","Radar chart":"레이더 차트","Sankey diagram":"생키 다이어그램","Flow diagram":"플로우 다이어그램","Chord diagram":"코드 다이어그램","TreeMap chart":"트리맵 차트","Force directed tree":"포스 디렉티드 트리","Sliced chart":"슬라이스 차트",Series:"시리즈","Candlestick Series":"캔들스틱 시리즈","OHLC Series":"OHLC 시리즈","Column Series":"컬럼 시리즈","Line Series":"라인 시리즈","Pie Slice Series":"파이 슬라이스 시리즈","Funnel Series":"퍼널 시리즈","Pyramid Series":"피라미드 시리즈","X/Y Series":"X/Y 시리즈",Map:"맵","Press ENTER to zoom in":"확대하려면 엔터를 누르세요.","Press ENTER to zoom out":"축소하려면 엔터를 누르세요.","Use arrow keys to zoom in and out":"확대 혹은 축소하려면 방향키를 이용하세요.","Use plus and minus keys on your keyboard to zoom in and out":"확대 혹은 축소하려면 키보드의 +/- 키를 이용하세요.",Export:"내보내기",Image:"이미지",Data:"데이터",Print:"인쇄","Click, tap or press ENTER to open":"열려면, 클릭, 탭 또는 엔터를 누르세요.","Click, tap or press ENTER to print.":"출력하려면, 클릭, 탭 또는 엔터를 누르세요.","Click, tap or press ENTER to export as %1.":"%1(으)로 내보내려면 클릭, 탭 또는 엔터를 누르세요.",'To save the image, right-click this link and choose "Save picture as..."':'이미지를 저장하려면, 이 링크를 마우스로 우클릭하여 "다른 이름으로 저장"을 선택하세요.','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'이미지를 저장하려면, 좌측 썸네일을 마우스로 우클릭하여 "다른 이름으로 저장"을 선택하세요.',"(Press ESC to close this message)":"(이 메시지를 끄려면 ESC를 누르세요.)","Image Export Complete":"이미지 내보내기 완료","Export operation took longer than expected. Something might have gone wrong.":"내보내기가 지연되고 있습니다. 문제가 없는지 확인이 필요합니다.","Saved from":"다음으로부터 저장됨: ",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"선택 범위를 변경하려면 선택 버튼이나 좌우 화살표를 이용하세요.","Use left and right arrows to move selection":"선택 범위를 움직이려면 좌우 화살표를 이용하세요.","Use left and right arrows to move left selection":"왼쪽 선택 범위를 움직이려면 좌우 화살표를 이용하세요.","Use left and right arrows to move right selection":"오른쪽 선택 범위를 움직이려면 좌우 화살표를 이용하세요.","Use TAB select grip buttons or up and down arrows to change selection":"선택 범위를 변경하려면 선택 버튼이나 상하 화살표를 이용하세요.","Use up and down arrows to move selection":"선택 범위를 움직이려면 상하 화살표를 이용하세요.","Use up and down arrows to move lower selection":"하단 선택 범위를 움직이려면 상하 화살표를 이용하세요.","Use up and down arrows to move upper selection":"상단 선택 범위를 움직이려면 상하 화살표를 이용하세요.","From %1 to %2":"%1 부터 %2 까지","From %1":"%1 부터","To %1":"%1 까지","No parser available for file: %1":"파일 파싱 불가능: %1","Error parsing file: %1":"파일 파싱 오류: %1","Unable to load file: %1":"파일 로드 불가능: %1","Invalid date":"날짜 올바르지 않음"}}(El,VZ))!==void 0&&(Rxt.exports=Mxt);const M7i=O7i({__proto__:null,default:tl(VZ)},[VZ]),D7i=Object.freeze(Object.defineProperty({__proto__:null,k:M7i},Symbol.toStringTag,{value:"Module"}));function F7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Dxt,Fxt,jZ={},L7i={get exports(){return jZ},set exports(t){jZ=t}};Dxt=L7i,(Fxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm::ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"yyyy-MM-dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"m.e.",_era_bc:"p.m.e.",A:"R",P:"V",AM:"ryto",PM:"vakaro","A.M.":"ryto","P.M.":"vakaro",January:"sausio",February:"vasario",March:"kovo",April:"balandžio",May:"gegužės",June:"birželio",July:"liepos",August:"rugpjūčio",September:"rugsėjo",October:"spalio",November:"lapkričio",December:"gruodžio",Jan:"sau.",Feb:"vas.",Mar:"kov.",Apr:"bal.","May(short)":"geg.",Jun:"bir.",Jul:"lie.",Aug:"rgp.",Sep:"rgs.",Oct:"spa.",Nov:"lap.",Dec:"gruo.",Sunday:"sekmadienis",Monday:"pirmadienis",Tuesday:"antradienis",Wednesday:"trečiadienis",Thursday:"ketvirtadienis",Friday:"penktadienis",Saturday:"šeštadienis",Sun:"sekm.",Mon:"pirm.",Tue:"antr.",Wed:"treč.",Thu:"ketv.",Fri:"penk.",Sat:"šešt.",_dateOrd:function(i){return"-a(s)"},"Zoom Out":"Rodyti viską",Play:"Paleisti",Stop:"Sustabdyti",Legend:"Legenda","Click, tap or press ENTER to toggle":"Spragtelkite, palieskite arba spauskite ENTER, kad perjungtumėte",Loading:"Kraunama",Home:"Pradžia",Chart:"Grafikas","Serial chart":"Serijinis grafikas","X/Y chart":"X/Y grafikas","Pie chart":"Pyrago tipo grafikas","Gauge chart":"Daviklio tipo grafikas","Radar chart":"Radaro tipo grafikas","Sankey diagram":"Sankey diagrama","Chord diagram":"Chord diagrama","Flow diagram":"Flow diagrama","TreeMap chart":"TreeMap grafikas",Series:"Serija","Candlestick Series":'"Candlestick" tipo grafiko serija',"Column Series":"Stulpelinio grafiko serija","Line Series":"Linijinio grafiko serija","Pie Slice Series":"Pyrago tipo serija","X/Y Series":"X/Y serija",Map:"Žemėlapis","Press ENTER to zoom in":"Spauskite ENTER, kad pritrauktumėte vaizdą","Press ENTER to zoom out":"Spauskite ENTER, kad atitolintumėte vaizdą","Use arrow keys to zoom in and out":"Naudokitės royklėmis vaizdo pritraukimui ar atitolinimui","Use plus and minus keys on your keyboard to zoom in and out":"Spauskite pliuso arba minuso klavišus ant klaviatūros, kad pritrautumėte arba atitolintumėte vaizdą",Export:"Eksportuoti",Image:"Paveiksliukas",Data:"Duomenys",Print:"Spausdinti","Click, tap or press ENTER to open":"Spragtelkite arba spauskite ENTER, kad atidarytumėte","Click, tap or press ENTER to print.":"Spragtelkite arba spauskite ENTER, kad spausdintumėte.","Click, tap or press ENTER to export as %1.":"Spragtelkite arba spauskite ENTER, kad eksportuotumėte kaip %1.",'To save the image, right-click this link and choose "Save picture as..."':'Kad išsaugotumėte paveiksliuką, spauskite dešinį pelės klavišą ir pasirinkite "Išsaugoti, kaip paveiksliuką..."',"(Press ESC to close this message)":"(Spauskite ESC, kad uždarytumėte šį pranešimą)","Image Export Complete":"Paveiksliuko eksportas baigtas","Export operation took longer than expected. Something might have gone wrong.":"Eksportas užtruko ilgiau negu turėtų. Greičiausiai įvyko klaida.","Saved from":"Išsaugota iš",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"Spauskite TAB klavišą, kad pasirinktumėte žymeklius, arba kairė/dešinė klavišus, kad pakeistumėte pasirinkimą","Use left and right arrows to move selection":"Naudokitės klavišais kairė/dešinė, kad pajudintumėte pasirinkimą","Use left and right arrows to move left selection":"Naudokitės klavišais kairė/dešinė, kad pajudintumėte kairį žymeklį","Use left and right arrows to move right selection":"Naudokitės klavišais kairė/dešinė, kad pajudintumėte dešinį žymeklį","Use TAB select grip buttons or up and down arrows to change selection":"Spauskite TAB klavišą, kad pasirinktumėte žymeklius, arba aukštyn/žemyn klavišus, kad pakeistumėte pasirinkimą","Use up and down arrows to move selection":"Naudokitės klavišais aukštyn/žemyn, kad pajudintumėte pasirinkimą","Use up and down arrows to move lower selection":"Naudokitės klavišais aukštyn/žemyn, kad pajudintumėte apatinį žymeklį","Use up and down arrows to move upper selection":"Naudokitės klavišais aukštyn/žemyn, kad pajudintumėte viršutinį žymeklį","From %1 to %2":"Nuo %1 iki %2","From %1":"Nuo %1","To %1":"Iki %1","No parser available for file: %1":"Failui %1 neturime tinkamo dešifruotojo","Error parsing file: %1":"Skaitant failą %1 įvyko klaida","Unable to load file: %1":"Nepavyko užkrauti failo %1","Invalid date":"Klaidinga data"}}(El,jZ))!==void 0&&(Dxt.exports=Fxt);const N7i=F7i({__proto__:null,default:tl(jZ)},[jZ]),k7i=Object.freeze(Object.defineProperty({__proto__:null,l:N7i},Symbol.toStringTag,{value:"Module"}));function $7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Lxt,Nxt,GZ={},B7i={get exports(){return GZ},set exports(t){GZ=t}};Lxt=B7i,(Nxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"m.ē.",_era_bc:"p.m.ē.",A:"priekšp.",P:"pēcp.",AM:"priekšp.",PM:"pēcp.","A.M.":"priekšpusdienā","P.M.":"pēcpusdienā",January:"janvāris",February:"februāris",March:"marts",April:"aprīlis",May:"maijs",June:"jūnijs",July:"jūlijs",August:"augusts",September:"septembris",October:"oktobris",November:"novembris",December:"decembris",Jan:"janv.",Feb:"febr.",Mar:"marts",Apr:"apr.","May(short)":"maijs",Jun:"jūn.",Jul:"jūl.",Aug:"aug.",Sep:"sept.",Oct:"okt.",Nov:"nov.",Dec:"dec.",Sunday:"svētdiena",Monday:"pirmdiena",Tuesday:"otrdiena",Wednesday:"trešdiena",Thursday:"ceturtdiena",Friday:"piektdiena",Saturday:"sestdiena",Sun:"svētd.",Mon:"pirmd.",Tue:"otrd.",Wed:"trešd.",Thu:"ceturtd.",Fri:"piektd.",Sat:"sestd.",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Tālummaiņa",Play:"Darbināt",Stop:"Apturēt",Legend:"Apzīmējumi","Click, tap or press ENTER to toggle":"",Loading:"Ielādē",Home:"Sākums",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Drukāt",Image:"Attēls",Data:"Dati",Print:"Drukāt","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"No %1 līdz %2","From %1":"No %1","To %1":"Līdz %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,GZ))!==void 0&&(Lxt.exports=Nxt);const V7i=$7i({__proto__:null,default:tl(GZ)},[GZ]),j7i=Object.freeze(Object.defineProperty({__proto__:null,l:V7i},Symbol.toStringTag,{value:"Module"}));function G7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var kxt,$xt,UZ={},U7i={get exports(){return UZ},set exports(t){UZ=t}};kxt=U7i,($xt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"e.Kr.",_era_bc:"f.Kr.",A:"a",P:"p",AM:"a.m.",PM:"p.m.","A.M.":"a.m.","P.M.":"p.m.",January:"januar",February:"februar",March:"mars",April:"april",May:"mai",June:"juni",July:"juli",August:"august",September:"september",October:"oktober",November:"november",December:"desember",Jan:"jan.",Feb:"feb.",Mar:"mar.",Apr:"apr.","May(short)":"mai",Jun:"jun.",Jul:"jul.",Aug:"aug.",Sep:"sep.",Oct:"okt.",Nov:"nov.",Dec:"des.",Sunday:"søndag",Monday:"mandag",Tuesday:"tirsdag",Wednesday:"onsdag",Thursday:"torsdag",Friday:"fredag",Saturday:"lørdag",Sun:"søn.",Mon:"man.",Tue:"tir.",Wed:"ons.",Thu:"tor.",Fri:"fre.",Sat:"lør.",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Zoom",Play:"Spill av",Stop:"Stopp",Legend:"Tegnforklaring","Click, tap or press ENTER to toggle":"",Loading:"Laster inn",Home:"Hjem",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Skriv ut",Image:"Bilde",Data:"Data",Print:"Skriv ut","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Fra %1 til %2","From %1":"Fra %1","To %1":"Til %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,UZ))!==void 0&&(kxt.exports=$xt);const z7i=G7i({__proto__:null,default:tl(UZ)},[UZ]),H7i=Object.freeze(Object.defineProperty({__proto__:null,n:z7i},Symbol.toStringTag,{value:"Module"}));function W7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Bxt,Vxt,zZ={},q7i={get exports(){return zZ},set exports(t){zZ=t}};Bxt=q7i,(Vxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"d MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"AD",_era_bc:"v.C.",A:"A",P:"P",AM:"AM",PM:"PM","A.M.":"a.m.","P.M.":"p.m.",January:"januari",February:"februari",March:"maart",April:"april",May:"mei",June:"juni",July:"juli",August:"augustus",September:"september",October:"oktober",November:"november",December:"december",Jan:"jan",Feb:"feb",Mar:"mrt",Apr:"apr","May(short)":"mei",Jun:"jun",Jul:"jul",Aug:"aug",Sep:"sep",Oct:"okt",Nov:"nov",Dec:"dec",Sunday:"zondag",Monday:"maandag",Tuesday:"dinsdag",Wednesday:"woensdag",Thursday:"donderdag",Friday:"vrijdag",Saturday:"zaterdag",Sun:"Zo",Mon:"Ma",Tue:"Di",Wed:"Wo",Thu:"Do",Fri:"Vr",Sat:"Za",_dateOrd:function(i){var r="de";return(i==1||i==8||i>19)&&(r="ste"),r},"Zoom Out":"Uitzoomen",Play:"Afspelen",Stop:"Stoppen",Legend:"Legenda","Click, tap or press ENTER to toggle":"Klik, tik of druk op Enter om aan of uit te zetten",Loading:"Laden",Home:"Home",Chart:"Grafiek","Serial chart":"Periodieke grafiek","X/Y chart":"X-Y grafiek","Pie chart":"Taartdiagram","Gauge chart":"Meterdiagram","Radar chart":"Radardiagram","Sankey diagram":"Sankey-diagram","Chord diagram":"Chord-diagram","Flow diagram":"Flow-diagram","TreeMap chart":"Treemap-grafiek",Series:"Reeks","Candlestick Series":"Candlestick-reeks","Column Series":"Kolomreeks","Line Series":"Lijnreeks","Pie Slice Series":"Taartpuntreeks","X/Y Series":"XY reeks",Map:"Kaart","Press ENTER to zoom in":"Druk op Enter om in te zoomen","Press ENTER to zoom out":"Druk op Enter om uit te zoomen","Use arrow keys to zoom in and out":"Zoom in of uit met de pijltjestoetsen","Use plus and minus keys on your keyboard to zoom in and out":"Zoom in of uit met de plus- en minustoetsen",Export:"Exporteren",Image:"Afbeelding",Data:"Data",Print:"Printen","Click, tap or press ENTER to open":"Klik, tik of druk op Enter om te openen","Click, tap or press ENTER to print.":"Klik, tik of druk op Enter om te printen","Click, tap or press ENTER to export as %1.":"Klik, tik of druk op Enter om te exporteren als %1",'To save the image, right-click this link and choose "Save picture as..."':'Klik met de rechtermuisknop op deze link en kies "Afbeelding opslaan als..." om de afbeelding op te slaan','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Klik met de rechtermuisknop op de miniatuur links en kies "Afbeelding opslaan als..." om de afbeelding op te slaan',"(Press ESC to close this message)":"(Druk op ESC om dit bericht te sluiten)","Image Export Complete":"Afbeelding exporteren gereed","Export operation took longer than expected. Something might have gone wrong.":"Exportproces duurt langer dan verwacht. Er is misschien iets fout gegaan.","Saved from":"Opgeslagen via:",PNG:"PNG",JPG:"JPG",GIF:"GIF",SVG:"SVG",PDF:"PDF",JSON:"JSON",CSV:"CSV",XLSX:"XLSX","Use TAB to select grip buttons or left and right arrows to change selection":"Gebruik Tab om de hendels te selecteren of linker- en rechterpijltje om de selectie te veranderen","Use left and right arrows to move selection":"Gebruik linker- en rechterpijltje om de selectie te verplaatsen","Use left and right arrows to move left selection":"Gebruik linker- en rechterpijltje om de linkerselectie te verplaatsen","Use left and right arrows to move right selection":"Gebruik linker- en rechterpijltje om de rechterselectie te verplaatsen","Use TAB select grip buttons or up and down arrows to change selection":"Gebruik Tab om de hendels te selecteren of pijltje omhoog en omlaag om de selectie te veranderen","Use up and down arrows to move selection":"Gebruik pijltje omhoog en omlaag om de selectie te verplaatsen","Use up and down arrows to move lower selection":"Gebruik pijltje omhoog en omlaag om de onderste selectie te verplaatsen","Use up and down arrows to move upper selection":"Gebruik pijltje omhoog en omlaag om de bovenste selectie te verplaatsen","From %1 to %2":"Van %1 tot %2","From %1":"Van %1","To %1":"Tot %2","No parser available for file: %1":"Geen data-parser beschikbaar voor dit bestand: %1","Error parsing file: %1":"Fout tijdens parsen van bestand: %1","Unable to load file: %1":"Kan bestand niet laden: %1","Invalid date":"Ongeldige datum"}}(El,zZ))!==void 0&&(Bxt.exports=Vxt);const Y7i=W7i({__proto__:null,default:tl(zZ)},[zZ]),X7i=Object.freeze(Object.defineProperty({__proto__:null,n:Y7i},Symbol.toStringTag,{value:"Module"}));function K7i(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var jxt,Gxt,HZ={},J7i={get exports(){return HZ},set exports(t){HZ=t}};jxt=J7i,(Gxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n.e.",_era_bc:"p.n.e.",A:"a",P:"p",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"stycznia",February:"lutego",March:"marca",April:"kwietnia",May:"maja",June:"czerwca",July:"lipca",August:"sierpnia",September:"września",October:"października",November:"listopada",December:"grudnia",Jan:"sty",Feb:"lut",Mar:"mar",Apr:"kwi","May(short)":"maj",Jun:"cze",Jul:"lip",Aug:"sie",Sep:"wrz",Oct:"paź",Nov:"lis",Dec:"gru",Sunday:"niedziela",Monday:"poniedziałek",Tuesday:"wtorek",Wednesday:"środa",Thursday:"czwartek",Friday:"piątek",Saturday:"sobota",Sun:"niedz.",Mon:"pon.",Tue:"wt.",Wed:"śr.",Thu:"czw.",Fri:"pt.",Sat:"sob.",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Zmiana skali",Play:"Odtwarzanie",Stop:"Zatrzymaj",Legend:"Legenda","Click, tap or press ENTER to toggle":"",Loading:"Wczytywanie",Home:"Strona główna",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Drukuj",Image:"Obraz",Data:"Dane",Print:"Drukuj","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,HZ))!==void 0&&(jxt.exports=Gxt);const Z7i=K7i({__proto__:null,default:tl(HZ)},[HZ]),Q7i=Object.freeze(Object.defineProperty({__proto__:null,p:Z7i},Symbol.toStringTag,{value:"Module"}));function ezi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Uxt,zxt,WZ={},tzi={get exports(){return WZ},set exports(t){WZ=t}};Uxt=tzi,(zxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"dd MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"DC",_era_bc:"AC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Janeiro",February:"Fevereiro",March:"Março",April:"Abril",May:"Maio",June:"Junho",July:"Julho",August:"Agosto",September:"Setembro",October:"Outubro",November:"Novembro",December:"Dezembro",Jan:"Jan",Feb:"Fev",Mar:"Mar",Apr:"Abr","May(short)":"Mai",Jun:"Jun",Jul:"Jul",Aug:"Ago",Sep:"Set",Oct:"Out",Nov:"Nov",Dec:"Dez",Sunday:"Domingo",Monday:"Segunda-feira",Tuesday:"Terça-feira",Wednesday:"Quarta-feira",Thursday:"Quinta-feira",Friday:"Sexta-feira",Saturday:"Sábado",Sun:"Dom",Mon:"Seg",Tue:"Ter",Wed:"Qua",Thu:"Qui",Fri:"Sex",Sat:"Sáb",_dateOrd:function(i){return"º"},"Zoom Out":"Reduzir Zoom",Play:"Play",Stop:"Parar",Legend:"Legenda","Click, tap or press ENTER to toggle":"Clique, toque ou pressione ENTER para alternar",Loading:"Carregando",Home:"Início",Chart:"Gráfico","Serial chart":"Gráfico Serial","X/Y chart":"Gráfico XY","Pie chart":"Gráfico de Pizza","Gauge chart":"Gráfico Indicador","Radar chart":"Gráfico de Radar","Sankey diagram":"Diagrama Sankey","Chord diagram":"Diagram Chord","Flow diagram":"Diagrama Flow","TreeMap chart":"Gráfico de Mapa de Árvore",Series:"Séries","Candlestick Series":"Séries do Candlestick","Column Series":"Séries de Colunas","Line Series":"Séries de Linhas","Pie Slice Series":"Séries de Fatias de Pizza","X/Y Series":"Séries de XY",Map:"Mapa","Press ENTER to zoom in":"Pressione ENTER para aumentar o zoom","Press ENTER to zoom out":"Pressione ENTER para diminuir o zoom","Use arrow keys to zoom in and out":"Use as setas para diminuir ou aumentar o zoom","Use plus and minus keys on your keyboard to zoom in and out":"Use as teclas mais ou menos no seu teclado para diminuir ou aumentar o zoom",Export:"Exportar",Image:"Imagem",Data:"Dados",Print:"Imprimir","Click, tap or press ENTER to open":"Clique, toque ou pressione ENTER para abrir","Click, tap or press ENTER to print.":"Clique, toque ou pressione ENTER para imprimir","Click, tap or press ENTER to export as %1.":"Clique, toque ou pressione ENTER para exportar como %1.",'To save the image, right-click this link and choose "Save picture as..."':'Para salvar a imagem, clique no link com o botão da direira e escolha "Salvar imagem como..."','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Para salvar, clique na imagem à esquerda com o botão direito e escolha "Salvar imagem como..."',"(Press ESC to close this message)":"(Pressione ESC para fechar esta mensagem)","Image Export Complete":"A exportação da imagem foi completada","Export operation took longer than expected. Something might have gone wrong.":"A exportação da imagem demorou mais do que o experado. Algo deve ter dado errado.","Saved from":"Salvo de",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"Use TAB para selecionar os botões ou setas para a direita ou esquerda para mudar a seleção","Use left and right arrows to move selection":"Use as setas para a esquerda ou direita para mover a seleção","Use left and right arrows to move left selection":"Use as setas para a esquerda ou direita para mover a seleção da esquerda","Use left and right arrows to move right selection":"Use as setas para a esquerda ou direita para mover a seleção da direita","Use TAB select grip buttons or up and down arrows to change selection":"Use TAB para selecionar os botões ou setas para cima ou para baixo para mudar a seleção","Use up and down arrows to move selection":"Use as setas para cima ou para baixo para mover a seleção","Use up and down arrows to move lower selection":"Use as setas para cima ou para baixo para mover a seleção de baixo","Use up and down arrows to move upper selection":"Use as setas para cima ou para baixo para mover a seleção de cima","From %1 to %2":"De %1 até %2","From %1":"De %1","To %1":"Até %1","No parser available for file: %1":"Não há um interpretador para este arquivo: %1","Error parsing file: %1":"Erro analizando o arquivo: %1","Unable to load file: %1":"O arquivo não pôde ser carregado: %1","Invalid date":"Data inválida"}}(El,WZ))!==void 0&&(Uxt.exports=zxt);const izi=ezi({__proto__:null,default:tl(WZ)},[WZ]),rzi=Object.freeze(Object.defineProperty({__proto__:null,p:izi},Symbol.toStringTag,{value:"Module"}));function nzi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Hxt,Wxt,qZ={},szi={get exports(){return qZ},set exports(t){qZ=t}};Hxt=szi,(Wxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"dd MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"DC",_era_bc:"AC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Janeiro",February:"Fevereiro",March:"Março",April:"Abril",May:"Maio",June:"Junho",July:"Julho",August:"Agosto",September:"Setembro",October:"Outubro",November:"Novembro",December:"Dezembro",Jan:"Jan",Feb:"Fev",Mar:"Mar",Apr:"Abr","May(short)":"Mai",Jun:"Jun",Jul:"Jul",Aug:"Ago",Sep:"Set",Oct:"Out",Nov:"Nov",Dec:"Dez",Sunday:"Domingo",Monday:"Segunda-feira",Tuesday:"Terça-feira",Wednesday:"Quarta-feira",Thursday:"Quinta-feira",Friday:"Sexta-feira",Saturday:"Sábado",Sun:"Dom",Mon:"Seg",Tue:"Ter",Wed:"Qua",Thu:"Qui",Fri:"Sex",Sat:"Sáb",_dateOrd:function(i){return"º"},"Zoom Out":"Reduzir Zoom",Play:"Play",Stop:"Parar",Legend:"Legenda","Click, tap or press ENTER to toggle":"Clique, toque ou pressione ENTER para alternar",Loading:"Carregando",Home:"Início",Chart:"Gráfico","Serial chart":"Gráfico Serial","X/Y chart":"Gráfico XY","Pie chart":"Gráfico de Pizza","Gauge chart":"Gráfico Indicador","Radar chart":"Gráfico de Radar","Sankey diagram":"Diagrama Sankey","Chord diagram":"Diagram Chord","Flow diagram":"Diagrama Flow","TreeMap chart":"Gráfico de Mapa de Árvore",Series:"Séries","Candlestick Series":"Séries do Candlestick","Column Series":"Séries de Colunas","Line Series":"Séries de Linhas","Pie Slice Series":"Séries de Fatias de Pizza","X/Y Series":"Séries de XY",Map:"Mapa","Press ENTER to zoom in":"Pressione ENTER para aumentar o zoom","Press ENTER to zoom out":"Pressione ENTER para diminuir o zoom","Use arrow keys to zoom in and out":"Use as setas para diminuir ou aumentar o zoom","Use plus and minus keys on your keyboard to zoom in and out":"Use as teclas mais ou menos no seu teclado para diminuir ou aumentar o zoom",Export:"Exportar",Image:"Imagem",Data:"Dados",Print:"Imprimir","Click, tap or press ENTER to open":"Clique, toque ou pressione ENTER para abrir","Click, tap or press ENTER to print.":"Clique, toque ou pressione ENTER para imprimir","Click, tap or press ENTER to export as %1.":"Clique, toque ou pressione ENTER para exportar como %1.",'To save the image, right-click this link and choose "Save picture as..."':'Para salvar a imagem, clique no link com o botão da direira e escolha "Salvar imagem como..."','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Para salvar, clique na imagem à esquerda com o botão direito e escolha "Salvar imagem como..."',"(Press ESC to close this message)":"(Pressione ESC para fechar esta mensagem)","Image Export Complete":"A exportação da imagem foi completada","Export operation took longer than expected. Something might have gone wrong.":"A exportação da imagem demorou mais do que o experado. Algo deve ter dado errado.","Saved from":"Salvo de",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"Use TAB para selecionar os botões ou setas para a direita ou esquerda para mudar a seleção","Use left and right arrows to move selection":"Use as setas para a esquerda ou direita para mover a seleção","Use left and right arrows to move left selection":"Use as setas para a esquerda ou direita para mover a seleção da esquerda","Use left and right arrows to move right selection":"Use as setas para a esquerda ou direita para mover a seleção da direita","Use TAB select grip buttons or up and down arrows to change selection":"Use TAB para selecionar os botões ou setas para cima ou para baixo para mudar a seleção","Use up and down arrows to move selection":"Use as setas para cima ou para baixo para mover a seleção","Use up and down arrows to move lower selection":"Use as setas para cima ou para baixo para mover a seleção de baixo","Use up and down arrows to move upper selection":"Use as setas para cima ou para baixo para mover a seleção de cima","From %1 to %2":"De %1 até %2","From %1":"De %1","To %1":"Até %1","No parser available for file: %1":"Nenhum interpretador está disponível para este arquivo: %1","Error parsing file: %1":"Erro ao analizar o arquivo: %1","Unable to load file: %1":"O arquivo não pôde ser carregado: %1","Invalid date":"Data inválida"}}(El,qZ))!==void 0&&(Hxt.exports=Wxt);const ozi=nzi({__proto__:null,default:tl(qZ)},[qZ]),azi=Object.freeze(Object.defineProperty({__proto__:null,p:ozi},Symbol.toStringTag,{value:"Module"}));function lzi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var qxt,Yxt,YZ={},uzi={get exports(){return YZ},set exports(t){YZ=t}};qxt=uzi,(Yxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"d.Hr.",_era_bc:"î.Hr.",A:"a.m.",P:"p.m.",AM:"a.m.",PM:"p.m.","A.M.":"a.m.","P.M.":"p.m.",January:"ianuarie",February:"februarie",March:"martie",April:"aprilie",May:"mai",June:"iunie",July:"iulie",August:"august",September:"septembrie",October:"octombrie",November:"noiembrie",December:"decembrie",Jan:"ian.",Feb:"feb.",Mar:"mar.",Apr:"apr.","May(short)":"mai",Jun:"iun.",Jul:"iul.",Aug:"aug.",Sep:"sept.",Oct:"oct.",Nov:"nov.",Dec:"dec.",Sunday:"duminică",Monday:"luni",Tuesday:"marți",Wednesday:"miercuri",Thursday:"joi",Friday:"vineri",Saturday:"sâmbătă",Sun:"dum.",Mon:"lun.",Tue:"mar.",Wed:"mie.",Thu:"joi",Fri:"vin.",Sat:"sâm.",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Zoom",Play:"Redare",Stop:"Oprire",Legend:"Legendă","Click, tap or press ENTER to toggle":"",Loading:"Se încarcă",Home:"Pagina principală",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Imprimare",Image:"Imagine",Data:"Date",Print:"Imprimare","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Din %1 la %2","From %1":"Din %1","To %1":"La %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,YZ))!==void 0&&(qxt.exports=Yxt);const czi=lzi({__proto__:null,default:tl(YZ)},[YZ]),hzi=Object.freeze(Object.defineProperty({__proto__:null,r:czi},Symbol.toStringTag,{value:"Module"}));function dzi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Xxt,Kxt,XZ={},pzi={get exports(){return XZ},set exports(t){XZ=t}};Xxt=pzi,(Kxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"dd MMM",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"н.э.",_era_bc:"до н.э.",A:"У",P:"В",AM:"утра",PM:"вечера","A.M.":"до полудня","P.M.":"после полудня",January:"января",February:"февраля",March:"марта",April:"апреля",May:"мая",June:"июня",July:"июля",August:"августа",September:"сентября",October:"октября",November:"ноября",December:"декабря",Jan:"янв.",Feb:"февр.",Mar:"март",Apr:"апр.","May(short)":"май",Jun:"июнь",Jul:"июль",Aug:"авг.",Sep:"сент.",Oct:"окт.",Nov:"нояб.",Dec:"дек.",Sunday:"воскресенье",Monday:"понедельник",Tuesday:"вторник",Wednesday:"среда",Thursday:"четверг",Friday:"пятница",Saturday:"суббота",Sun:"вс.",Mon:"пн.",Tue:"вт.",Wed:"ср.",Thu:"чт.",Fri:"пт.",Sat:"сб.",_dateOrd:function(i){return"-ое"},"Zoom Out":"Уменьшить",Play:"Старт",Stop:"Стоп",Legend:"Легенда","Click, tap or press ENTER to toggle":"Щелкните, коснитесь или нажмите ВВОД, чтобы переключить",Loading:"Идет загрузка",Home:"Начало",Chart:"График","Serial chart":"Серийная диаграмма","X/Y chart":"Диаграмма X/Y","Pie chart":"Круговая диаграмма","Gauge chart":"Датчик-диаграмма","Radar chart":"Лепестковая диаграмма","Sankey diagram":"Диаграмма Сэнки","Chord diagram":"Диаграмма Chord","Flow diagram":"Диаграмма флоу","TreeMap chart":"Иерархическая диаграмма",Series:"Серия","Candlestick Series":"Серия-подсвечник","Column Series":"Столбчатая серия","Line Series":"Линейная серия","Pie Slice Series":"Круговая серия","X/Y Series":"X/Y серия",Map:"Карта","Press ENTER to zoom in":"Нажмите ВВОД чтобу увеличить","Press ENTER to zoom out":"Нажмите ВВОД чтобы уменьшить","Use arrow keys to zoom in and out":"Используйте клавиши-стрелки чтобы увеличить и уменьшить","Use plus and minus keys on your keyboard to zoom in and out":"Используйте клавиши плюс и минус на клавиатуре чтобы увеличить и уменьшить",Export:"Экспортировать",Image:"Изображение",Data:"Данные",Print:"Печатать","Click, tap or press ENTER to open":"Щелкните, коснитесь или нажмите ВВОД чтобы открыть","Click, tap or press ENTER to print.":"Щелкните, коснитесь или нажмите ВВОД чтобы распечатать","Click, tap or press ENTER to export as %1.":"Щелкните, коснитесь или нажмите ВВОД чтобы экспортировать как %1",'To save the image, right-click this link and choose "Save picture as..."':'Чтобы сохранить изображение, щелкните правой кнопкой на ссылке и выберите "Сохранить изображение как..."','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Чтобы сохранить изображение, щелкните правой кнопкой на картинке слева и выберите "Сохранить изображение как..."',"(Press ESC to close this message)":"(Нажмите ESC чтобы закрыть это сообщение)","Image Export Complete":"Экспорт изображения завершен","Export operation took longer than expected. Something might have gone wrong.":"Экспортирование заняло дольше, чем планировалось. Возможно что-то пошло не так.","Saved from":"Сохранено из",PNG:"PNG",JPG:"JPG",GIF:"GIF",SVG:"SVG",PDF:"PDF",JSON:"JSON",CSV:"CSV",XLSX:"XLSX","Use TAB to select grip buttons or left and right arrows to change selection":"Используйте клавишу TAB, чтобы выбрать рукоятки или клавиши стрелок влево и вправо, чтобы изменить выделение","Use left and right arrows to move selection":"Используйте стрелки влево-вправо, чтобы передвинуть выделение","Use left and right arrows to move left selection":"Используйте стрелки влево-вправо, чтобы передвинуть левое выделение","Use left and right arrows to move right selection":"Используйте стрелки влево-вправо, чтобы передвинуть правое выделение","Use TAB select grip buttons or up and down arrows to change selection":"Используйте TAB, чтобы выбрать рукоятки или клавиши вверх-вниз, чтобы изменить выделение","Use up and down arrows to move selection":"Используйте стрелки вверх-вниз, чтобы передвинуть выделение","Use up and down arrows to move lower selection":"Используйте стрелки вверх-вниз, чтобы передвинуть нижнее выделение","Use up and down arrows to move upper selection":"Используйте стрелки вверх-вниз, чтобы передвинуть верхнее выделение","From %1 to %2":"От %1 до %2","From %1":"От %1","To %1":"До %1","No parser available for file: %1":"Нет анализатора для файла: %1","Error parsing file: %1":"Ошибка при разборе файла: %1","Unable to load file: %1":"Не удалось загрузить файл: %1","Invalid date":"Некорректная дата"}}(El,XZ))!==void 0&&(Xxt.exports=Kxt);const fzi=dzi({__proto__:null,default:tl(XZ)},[XZ]),mzi=Object.freeze(Object.defineProperty({__proto__:null,r:fzi},Symbol.toStringTag,{value:"Module"}));function gzi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Jxt,Zxt,KZ={},yzi={get exports(){return KZ},set exports(t){KZ=t}};Jxt=yzi,(Zxt=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n. l.",_era_bc:"pr. n. l.",A:"dop.",P:"odp.",AM:"dop.",PM:"odp.","A.M.":"dop.","P.M.":"odp.",January:"januára",February:"februára",March:"marca",April:"apríla",May:"mája",June:"júna",July:"júla",August:"augusta",September:"septembra",October:"októbra",November:"novembra",December:"decembra",Jan:"jan",Feb:"feb",Mar:"mar",Apr:"apr","May(short)":"máj",Jun:"jún",Jul:"júl",Aug:"aug",Sep:"sep",Oct:"okt",Nov:"nov",Dec:"dec",Sunday:"nedela",Monday:"pondelok",Tuesday:"utorok",Wednesday:"streda",Thursday:"štvrtok",Friday:"piatok",Saturday:"sobota",Sun:"ne",Mon:"po",Tue:"ut",Wed:"st",Thu:"št",Fri:"pi",Sat:"so",_dateOrd:function(i){return"."},"Zoom Out":"Zväčšenie",Play:"Prehrať",Stop:"Ukončiť iteráciu (Stop)",Legend:"Legenda","Click, tap or press ENTER to toggle":"",Loading:"Načítanie",Home:"Domov",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Export",Image:"Obrázok",Data:"Data",Print:"Tlač","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,KZ))!==void 0&&(Jxt.exports=Zxt);const vzi=gzi({__proto__:null,default:tl(KZ)},[KZ]),_zi=Object.freeze(Object.defineProperty({__proto__:null,s:vzi},Symbol.toStringTag,{value:"Module"}));function bzi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Qxt,e2t,JZ={},wzi={get exports(){return JZ},set exports(t){JZ=t}};Qxt=wzi,(e2t=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n. št.",_era_bc:"pr. n. št.",A:"A",P:"P",AM:"AM",PM:"PM","A.M.":"A.M.","P.M.":"P.M.",January:"Januar",February:"Februar",March:"Marec",April:"April",May:"Maj",June:"Junij",July:"Julij",August:"Avgust",September:"September",October:"Oktober",November:"November",December:"December",Jan:"Jan",Feb:"Feb",Mar:"Mar",Apr:"Apr","May(short)":"Maj",Jun:"Jun",Jul:"Jul",Aug:"Avg",Sep:"Sep",Oct:"Okt",Nov:"Nov",Dec:"Dec",Sunday:"Nedelja",Monday:"Ponedeljek",Tuesday:"Torek",Wednesday:"Sreda",Thursday:"Četrtek",Friday:"Petek",Saturday:"Sobota",Sun:"Ned",Mon:"Pon",Tue:"Tor",Wed:"Sre",Thu:"Čet",Fri:"Pet",Sat:"Sob",_dateOrd:function(i){return"."},"Zoom Out":"Oddalji pogled",Play:"Zaženi",Stop:"Ustavi",Legend:"Legenda","Click, tap or press ENTER to toggle":"Klikni, tapni ali pritisni ENTER za preklop",Loading:"Nalagam",Home:"Domov",Chart:"Graf","Serial chart":"Serijski graf","X/Y chart":"X/Y graf","Pie chart":"Tortni graf","Gauge chart":"Stevčni graf","Radar chart":"Radar graf","Sankey diagram":"Sankey diagram","Flow diagram":"Prikaz poteka","Chord diagram":"Kolobarni diagram","TreeMap chart":"Drevesi graf","Sliced chart":"Sliced graf",Series:"Serija","Candlestick Series":"Svečna serija","OHLC Series":"OHLC serija","Column Series":"Stolpičasta serija","Line Series":"Črtna serija","Pie Slice Series":"Tortna serija","Funnel Series":"Lijak serija","Pyramid Series":"Piramidna serija","X/Y Series":"X/Y serija",Map:"Mapa","Press ENTER to zoom in":"Pritisni ENTER za približevanje","Press ENTER to zoom out":"Pritisni ENTER za oddaljevanje","Use arrow keys to zoom in and out":"Uporabi smerne tiple za približevanje in oddaljevanje","Use plus and minus keys on your keyboard to zoom in and out":"Uporabi plus in minus tipke na tipkovnici za približevanje in oddaljevanje",Export:"Izvozi",Image:"Slika",Data:"Podatki",Print:"Natisni","Click, tap or press ENTER to open":"Klikni, tapni ali pritisni ENTER da odpreš.","Click, tap or press ENTER to print.":"Klikni, tapni ali pritisni ENTER za tiskanje.","Click, tap or press ENTER to export as %1.":"Klikni, tapni ali pritisni ENTER da izvoziš kot %1.",'To save the image, right-click this link and choose "Save picture as..."':'Da shraniš sliko, z desnim gumbom miške klikni to povezavo in izberi "Shrani sliko kot..."','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Da shraniš sliko, z desnim gumbom miške klikni sličico na levi in izberi "Shrani sliko kot..."',"(Press ESC to close this message)":"(Pritisni ESC da zapreš to sporočilo)","Image Export Complete":"Izvoz slike končan","Export operation took longer than expected. Something might have gone wrong.":"Operacija izvoza je trajala dlje kot pričakovano. Nekaj je šlo narobe.","Saved from":"Shranjeno od",PNG:"PNG",JPG:"JPG",GIF:"GIF",SVG:"SVG",PDF:"PDF",JSON:"JSON",CSV:"CSV",XLSX:"XLSX","Use TAB to select grip buttons or left and right arrows to change selection":"Uporabi TAB za izbiro drsnih gumbov ali levo in desno smerno tipko da spremeniš izbiro","Use left and right arrows to move selection":"Uporabi levo in desno smerno tipko za premik izbranega","Use left and right arrows to move left selection":"Uporabi levo in desno smerno tipko za premik leve izbire","Use left and right arrows to move right selection":"Uporabi levo in desno smerno tipko za premik desne izbire","Use TAB select grip buttons or up and down arrows to change selection":"Uporabi TAB za izbiro drsnih gumbov ali gor in dol smerno tipko da spremeniš izbiro","Use up and down arrows to move selection":"Uporabi gor in dol smerne tipke za premik izbire","Use up and down arrows to move lower selection":"Uporabi gor in dol smerne tipke za premik spodnje izbire","Use up and down arrows to move upper selection":"Uporabi gor in dol smerne tipke za premik zgornje izbire","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"Nobenega parserja ni na voljo za datoteko: %1","Error parsing file: %1":"Napaka pri parsanju datoteke: %1","Unable to load file: %1":"Ni mogoče naložiti datoteke: %1","Invalid date":"Neveljaven datum"}}(El,JZ))!==void 0&&(Qxt.exports=e2t);const xzi=bzi({__proto__:null,default:tl(JZ)},[JZ]),Szi=Object.freeze(Object.defineProperty({__proto__:null,s:xzi},Symbol.toStringTag,{value:"Module"}));function Czi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var t2t,i2t,ZZ={},Tzi={get exports(){return ZZ},set exports(t){ZZ=t}};t2t=Tzi,(i2t=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"н. е.",_era_bc:"п. н. е.",A:"a",P:"p",AM:"пре подне",PM:"по подне","A.M.":"пре подне","P.M.":"по подне",January:"јануар",February:"фебруар",March:"март",April:"април",May:"мај",June:"јун",July:"јул",August:"август",September:"септембар",October:"октобар",November:"новембар",December:"децембар",Jan:"јан",Feb:"феб",Mar:"мар",Apr:"апр","May(short)":"мај",Jun:"јун",Jul:"јул",Aug:"авг",Sep:"сеп",Oct:"окт",Nov:"нов",Dec:"дец",Sunday:"недеља",Monday:"понедељак",Tuesday:"уторак",Wednesday:"среда",Thursday:"четвртак",Friday:"петак",Saturday:"субота",Sun:"нед",Mon:"пон",Tue:"уто",Wed:"сре",Thu:"чет",Fri:"пет",Sat:"суб",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Zumiranje",Play:"Reprodukuj",Stop:"Zaustavi",Legend:"Legenda","Click, tap or press ENTER to toggle":"",Loading:"Učitavanje",Home:"Matična stranica",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Štampaj",Image:"Snimak",Data:"Podaci",Print:"Štampaj","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Iz %1 u %2","From %1":"Iz %1","To %1":"U %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,ZZ))!==void 0&&(t2t.exports=i2t);const Ezi=Czi({__proto__:null,default:tl(ZZ)},[ZZ]),Izi=Object.freeze(Object.defineProperty({__proto__:null,s:Ezi},Symbol.toStringTag,{value:"Module"}));function Azi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var r2t,n2t,QZ={},Pzi={get exports(){return QZ},set exports(t){QZ=t}};r2t=Pzi,(n2t=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"yyyy-MM-dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"e.Kr.",_era_bc:"f.Kr.",A:"fm",P:"em",AM:"fm",PM:"em","A.M.":"f.m.","P.M.":"e.m.",January:"januari",February:"februari",March:"mars",April:"april",May:"maj",June:"juni",July:"juli",August:"augusti",September:"september",October:"oktober",November:"november",December:"december",Jan:"jan.",Feb:"feb.",Mar:"mars",Apr:"apr.","May(short)":"maj",Jun:"juni",Jul:"juli",Aug:"aug.",Sep:"sep.",Oct:"okt.",Nov:"nov.",Dec:"dec.",Sunday:"söndag",Monday:"måndag",Tuesday:"tisdag",Wednesday:"onsdag",Thursday:"torsdag",Friday:"fredag",Saturday:"lördag",Sun:"sön",Mon:"mån",Tue:"tis",Wed:"ons",Thu:"tor",Fri:"fre",Sat:"lör",_dateOrd:function(i){return""},"Zoom Out":"Zooma ut",Play:"Spela",Stop:"Stoppa",Legend:"Teckenförklaring","Click, tap or press ENTER to toggle":"Klicka eller tryck ENTER för att ändra",Loading:"Läser in",Home:"Hem",Chart:"Diagram","Serial chart":"Seriediagram","X/Y chart":"XY-diagram","Pie chart":"Tårtdiagram","Gauge chart":"Instrumentdiagram","Radar chart":"Radardiagram","Sankey diagram":"Sankeydiagram","Chord diagram":"Strängdiagram","Flow diagram":"Flödesschema","TreeMap chart":"Träddiagram ",Series:"Serier","Candlestick Series":"Candlestick-serier","Column Series":"Kolumnserier","Line Series":"Linjeserier","Pie Slice Series":"Tårtserier","X/Y Series":"X/Y-serier",Map:"Karta","Press ENTER to zoom in":"Tryck RETUR för att zooma in","Press ENTER to zoom out":"Tryck RETUR för att zooma ut","Use arrow keys to zoom in and out":"Använd pil-knapparna för att zooma in och ut","Use plus and minus keys on your keyboard to zoom in and out":"Använd plus- och minus-knapparna för att zooma in och ut",Export:"Exportera",Image:"Bild",Data:"Data",Print:"Skriv ut","Click, tap or press ENTER to open":"Klicka eller tryck ENTER för att öppna","Click, tap or press ENTER to print.":"Klicka eller tryck ENTER för att skriva ut.","Click, tap or press ENTER to export as %1.":"Klicka eller tryck ENTER för att exportera till %1.",'To save the image, right-click this link and choose "Save picture as..."':'För att spara bilden, höger-klicka länken och välj "Spara bild som..."','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'För att spara bilden, höger-klicka miniatyrbilden till vänster och välj "Spara bild som..."',"(Press ESC to close this message)":"(Tryck ESC för att stänga)","Image Export Complete":"Bildexport klar","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"Sparad från",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"Använd vänster och höger pilknappar för att flytta urvalet","Use left and right arrows to move left selection":"Använd vänster och höger pilknappar för att flytta vänsterurval","Use left and right arrows to move right selection":"Använd vänster och höger pilknappar för att flytta högerurval","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"Använd upp och ner pilknappar för att flytta urvalet","Use up and down arrows to move lower selection":"Använd upp och ner pilknappar för att flytta nedre urvalet","Use up and down arrows to move upper selection":"Använd upp och ner pilknappar för att flytta övre urvalet","From %1 to %2":"Från %1 till %2","From %1":"Från %1","To %1":"Till %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"Ogiltigt datum"}}(El,QZ))!==void 0&&(r2t.exports=n2t);const Ozi=Azi({__proto__:null,default:tl(QZ)},[QZ]),Rzi=Object.freeze(Object.defineProperty({__proto__:null,s:Ozi},Symbol.toStringTag,{value:"Module"}));function Mzi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var s2t,o2t,eQ={},Dzi={get exports(){return eQ},set exports(t){eQ=t}};s2t=Dzi,(o2t=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"ค.ศ.",_era_bc:"ก่อน ค.ศ.",A:"a",P:"p",AM:"ก่อนเที่ยง",PM:"หลังเที่ยง","A.M.":"ก่อนเที่ยง","P.M.":"หลังเที่ยง",January:"มกราคม",February:"กุมภาพันธ์",March:"มีนาคม",April:"เมษายน",May:"พฤษภาคม",June:"มิถุนายน",July:"กรกฎาคม",August:"สิงหาคม",September:"กันยายน",October:"ตุลาคม",November:"พฤศจิกายน",December:"ธันวาคม",Jan:"ม.ค.",Feb:"ก.พ.",Mar:"มี.ค.",Apr:"เม.ย.","May(short)":"พ.ค.",Jun:"มิ.ย.",Jul:"ก.ค.",Aug:"ส.ค.",Sep:"ก.ย.",Oct:"ต.ค.",Nov:"พ.ย.",Dec:"ธ.ค.",Sunday:"วันอาทิตย์",Monday:"วันจันทร์",Tuesday:"วันอังคาร",Wednesday:"วันพุธ",Thursday:"วันพฤหัสบดี",Friday:"วันศุกร์",Saturday:"วันเสาร์",Sun:"อา.",Mon:"จ.",Tue:"อ.",Wed:"พ.",Thu:"พฤ.",Fri:"ศ.",Sat:"ส.",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"ขยาย",Play:"เล่น",Stop:"หยุด",Legend:"คำอธิบายสัญลักษณ์","Click, tap or press ENTER to toggle":"",Loading:"กำลังโหลด",Home:"หน้าหลัก",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"พิมพ์",Image:"รูปภาพ",Data:"ข้อมูล",Print:"พิมพ์","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"จาก %1 ถึง %2","From %1":"จาก %1","To %1":"ถึง %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,eQ))!==void 0&&(s2t.exports=o2t);const Fzi=Mzi({__proto__:null,default:tl(eQ)},[eQ]),Lzi=Object.freeze(Object.defineProperty({__proto__:null,t:Fzi},Symbol.toStringTag,{value:"Module"}));function Nzi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var a2t,l2t,tQ={},kzi={get exports(){return tQ},set exports(t){tQ=t}};a2t=kzi,(l2t=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:"%",_percentSuffix:null,_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"MS",_era_bc:"MÖ",A:"öö",P:"ös",AM:"ÖÖ",PM:"ÖS","A.M.":"ÖÖ","P.M.":"ÖS",January:"Ocak",February:"Şubat",March:"Mart",April:"Nisan",May:"Mayıs",June:"Haziran",July:"Temmuz",August:"Ağustos",September:"Eylül",October:"Ekim",November:"Kasım",December:"Aralık",Jan:"Oca",Feb:"Şub",Mar:"Mar",Apr:"Nis","May(short)":"May",Jun:"Haz",Jul:"Tem",Aug:"Ağu",Sep:"Eyl",Oct:"Eki",Nov:"Kas",Dec:"Ara",Sunday:"Pazar",Monday:"Pazartesi",Tuesday:"Salı",Wednesday:"Çarşamba",Thursday:"Perşembe",Friday:"Cuma",Saturday:"Cumartesi",Sun:"Paz",Mon:"Pzt",Tue:"Sal",Wed:"Çar",Thu:"Per",Fri:"Cum",Sat:"Cmt",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Yakınlaştır",Play:"Oynat",Stop:"Durdur",Legend:"Gösterge","Click, tap or press ENTER to toggle":"",Loading:"Yükleniyor",Home:"Giriş Sayfası",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Yazdır",Image:"Görüntü",Data:"Veri",Print:"Yazdır","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Kaynak %1 hedef %2","From %1":"Kaynak %1","To %1":"Hedef %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,tQ))!==void 0&&(a2t.exports=l2t);const $zi=Nzi({__proto__:null,default:tl(tQ)},[tQ]),Bzi=Object.freeze(Object.defineProperty({__proto__:null,t:$zi},Symbol.toStringTag,{value:"Module"}));function Vzi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var u2t,c2t,iQ={},jzi={get exports(){return iQ},set exports(t){iQ=t}};u2t=jzi,(c2t=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"н. е.",_era_bc:"до н. е.",A:"дп",P:"пп",AM:"дп",PM:"пп","A.M.":"дп","P.M.":"пп",January:"січня",February:"лютого",March:"березня",April:"квітня",May:"травня",June:"червня",July:"липня",August:"серпня",September:"вересня",October:"жовтня",November:"листопада",December:"грудня",Jan:"січ.",Feb:"лют.",Mar:"бер.",Apr:"квіт.","May(short)":"трав.",Jun:"черв.",Jul:"лип.",Aug:"серп.",Sep:"вер.",Oct:"жовт.",Nov:"лист.",Dec:"груд.",Sunday:"неділя",Monday:"понеділок",Tuesday:"вівторок",Wednesday:"середа",Thursday:"четвер",Friday:"пʼятниця",Saturday:"субота",Sun:"нд",Mon:"пн",Tue:"вт",Wed:"ср",Thu:"чт",Fri:"пт",Sat:"сб",_dateOrd:function(i){return""},"Zoom Out":"Масштабування",Play:"Відтворювати",Stop:"Зупинка",Legend:"Легенда","Click, tap or press ENTER to toggle":"",Loading:"Завантажується",Home:"Головна сторінка",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"карта","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Друк",Image:"Зображення",Data:"Дані",Print:"Друк","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Від %1 до %2","From %1":"Від %1","To %1":"До %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,iQ))!==void 0&&(u2t.exports=c2t);const Gzi=Vzi({__proto__:null,default:tl(iQ)},[iQ]),Uzi=Object.freeze(Object.defineProperty({__proto__:null,u:Gzi},Symbol.toStringTag,{value:"Module"}));function zzi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var h2t,d2t,rQ={},Hzi={get exports(){return rQ},set exports(t){rQ=t}};h2t=Hzi,(d2t=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"sau CN",_era_bc:"Trước CN",A:"s",P:"c",AM:"SA",PM:"CH","A.M.":"SA","P.M.":"CH",January:"tháng 1",February:"tháng 2",March:"tháng 3",April:"tháng 4",May:"tháng 5",June:"tháng 6",July:"tháng 7",August:"tháng 8",September:"tháng 9",October:"tháng 10",November:"tháng 11",December:"tháng 12",Jan:"thg 1",Feb:"thg 2",Mar:"thg 3",Apr:"thg 4","May(short)":"thg 5",Jun:"thg 6",Jul:"thg 7",Aug:"thg 8",Sep:"thg 9",Oct:"thg 10",Nov:"thg 11",Dec:"thg 12",Sunday:"Chủ Nhật",Monday:"Thứ Hai",Tuesday:"Thứ Ba",Wednesday:"Thứ Tư",Thursday:"Thứ Năm",Friday:"Thứ Sáu",Saturday:"Thứ Bảy",Sun:"CN",Mon:"Th 2",Tue:"Th 3",Wed:"Th 4",Thu:"Th 5",Fri:"Th 6",Sat:"Th 7",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:r="st";break;case 2:r="nd";break;case 3:r="rd"}return r},"Zoom Out":"Thu phóng",Play:"Phát",Stop:"Dừng",Legend:"Chú giải","Click, tap or press ENTER to toggle":"",Loading:"Đang tải",Home:"Trang chủ",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"In",Image:"Hình ảnh",Data:"Dữ liệu",Print:"In","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Từ %1 đến %2","From %1":"Từ %1","To %1":"Đến %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,rQ))!==void 0&&(h2t.exports=d2t);const Wzi=zzi({__proto__:null,default:tl(rQ)},[rQ]),qzi=Object.freeze(Object.defineProperty({__proto__:null,v:Wzi},Symbol.toStringTag,{value:"Module"}));function Yzi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var p2t,f2t,nQ={},Xzi={get exports(){return nQ},set exports(t){nQ=t}};p2t=Xzi,(f2t=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"公元",_era_bc:"公元前",A:"上午",P:"下午",AM:"上午",PM:"下午","A.M.":"上午","P.M.":"下午",January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月",Jan:"1月",Feb:"2月",Mar:"3月",Apr:"4月","May(short)":"5月",Jun:"6月",Jul:"7月",Aug:"8月",Sep:"9月",Oct:"10月",Nov:"11月",Dec:"12月",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",Sun:"周日",Mon:"周一",Tue:"周二",Wed:"周三",Thu:"周四",Fri:"周五",Sat:"周六",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:case 2:case 3:r="日"}return r},"Zoom Out":"缩放",Play:"播放",Stop:"停靠点",Legend:"图例","Click, tap or press ENTER to toggle":"",Loading:"加载",Home:"主页",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"打印",Image:"影像",Data:"数据",Print:"打印","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"自 %1 至 %2","From %1":"自 %1","To %1":"至 %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,nQ))!==void 0&&(p2t.exports=f2t);const Kzi=Yzi({__proto__:null,default:tl(nQ)},[nQ]),Jzi=Object.freeze(Object.defineProperty({__proto__:null,z:Kzi},Symbol.toStringTag,{value:"Module"}));function Zzi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var m2t,g2t,sQ={},Qzi={get exports(){return sQ},set exports(t){sQ=t}};m2t=Qzi,(g2t=function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"西元",_era_bc:"西元前",A:"上午",P:"下午",AM:"上午",PM:"下午","A.M.":"上午","P.M.":"下午",January:"1月",February:"2月",March:"3月",April:"4月",May:"5月",June:"6月",July:"7月",August:"8月",September:"9月",October:"10月",November:"11月",December:"12月",Jan:"1月",Feb:"2月",Mar:"3月",Apr:"4月","May(short)":"5月",Jun:"6月",Jul:"7月",Aug:"8月",Sep:"9月",Oct:"10月",Nov:"11月",Dec:"12月",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",Sun:"週日",Mon:"週一",Tue:"週二",Wed:"週三",Thu:"週四",Fri:"週五",Sat:"週六",_dateOrd:function(i){var r="th";if(i<11||i>13)switch(i%10){case 1:case 2:case 3:r="日"}return r},"Zoom Out":"縮放",Play:"播放",Stop:"停止",Legend:"圖例","Click, tap or press ENTER to toggle":"",Loading:"正在載入",Home:"首頁",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"列印",Image:"影像",Data:"資料",Print:"列印","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"從 %1 至 %2","From %1":"從 %1","To %1":"至 %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""}}(El,sQ))!==void 0&&(m2t.exports=g2t);const eHi=Zzi({__proto__:null,default:tl(sQ)},[sQ]),y2t=Object.freeze(Object.defineProperty({__proto__:null,z:eHi},Symbol.toStringTag,{value:"Module"}));function tHi(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var v2t,ime={};v2t=()=>(()=>{var t,e,i,r,n={},s={};function o(U){var R=s[U];if(R!==void 0)return R.exports;var u=s[U]={exports:{}};return n[U].call(u.exports,u,u.exports,o),u.exports}o.m=n,o.n=U=>{var R=U&&U.__esModule?()=>U.default:()=>U;return o.d(R,{a:R}),R},e=Object.getPrototypeOf?U=>Object.getPrototypeOf(U):U=>U.__proto__,o.t=function(U,R){if(1&R&&(U=this(U)),8&R||typeof U=="object"&&U&&(4&R&&U.__esModule||16&R&&typeof U.then=="function"))return U;var u=Object.create(null);o.r(u);var w={};t=t||[null,e({}),e([]),e(e)];for(var $=2&R&&U;typeof $=="object"&&!~t.indexOf($);$=e($))Object.getOwnPropertyNames($).forEach(G=>w[G]=()=>U[G]);return w.default=()=>U,o.d(u,w),u},o.d=(U,R)=>{for(var u in R)o.o(R,u)&&!o.o(U,u)&&Object.defineProperty(U,u,{enumerable:!0,get:R[u]})},o.f={},o.e=U=>Promise.all(Object.keys(o.f).reduce((R,u)=>(o.f[u](U,R),R),[])),o.u=U=>({265:"canvg",297:"xlsx",643:"pdfmake"}[U]||U)+".js",o.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),o.o=(U,R)=>Object.prototype.hasOwnProperty.call(U,R),i={},r="EsriAmCharts:",o.l=(U,R,u,w)=>{if(i[U])i[U].push(R);else{var $,G;if(u!==void 0)for(var K=document.getElementsByTagName("script"),re=0;re{$.onerror=$.onload=null,clearTimeout(De);var Qe=i[U];if(delete i[U],$.parentNode&&$.parentNode.removeChild($),Qe&&Qe.forEach(ft=>ft(Ke)),Ve)return Ve(Ke)},De=setTimeout(we.bind(null,void 0,{type:"timeout",target:$}),12e4);$.onerror=we.bind(null,$.onerror),$.onload=we.bind(null,$.onload),G&&document.head.appendChild($)}},o.r=U=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(U,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(U,"__esModule",{value:!0})},o.p="",(()=>{var U={826:0};o.f.j=(w,$)=>{var G=o.o(U,w)?U[w]:void 0;if(G!==0)if(G)$.push(G[2]);else{var K=new Promise((we,De)=>G=U[w]=[we,De]);$.push(G[2]=K);var re=o.p+o.u(w),ue=new Error;o.l(re,we=>{if(o.o(U,w)&&((G=U[w])!==0&&(U[w]=void 0),G)){var De=we&&(we.type==="load"?"missing":we.type),Ve=we&&we.target&&we.target.src;ue.message="Loading chunk "+w+` failed. +(`+De+": "+Ve+")",ue.name="ChunkLoadError",ue.type=De,ue.request=Ve,G[1](ue)}},"chunk-"+w,w)}};var R=(w,$)=>{var G,K,[re,ue,we]=$,De=0;if(re.some(Ve=>U[Ve]!==0)){for(G in ue)o.o(ue,G)&&(o.m[G]=ue[G]);we&&we(o)}for(w&&w($);DeX,am4core:()=>Y,am4themes_animated:()=>p9e,am4themes_dark:()=>jx});var l={};o.r(l),o.d(l,{castNumber:()=>$t,castString:()=>Pt,checkArray:()=>Ze,checkBoolean:()=>Be,checkDate:()=>mt,checkNumber:()=>qe,checkObject:()=>et,checkString:()=>Ge,getDefault:()=>Oe,getType:()=>Re,getValue:()=>je,getValueDefault:()=>pt,hasValue:()=>Te,isArray:()=>wt,isDate:()=>kt,isNaN:()=>Ie,isNumber:()=>ae,isObject:()=>ht,isString:()=>ct,toBoolean:()=>Ct,toNumber:()=>Et,toNumberOrPercent:()=>ot,toText:()=>Ft});var c={};o.r(c),o.d(c,{DEGREES:()=>tt,HALFPI:()=>pe,PI:()=>Ne,RADIANS:()=>Ae,adjustTension:()=>Rt,ceil:()=>Ot,closest:()=>T,cos:()=>A,fitAngleToRange:()=>ti,fitToRange:()=>nt,getAngle:()=>le,getArcPoint:()=>ii,getArcRect:()=>Zt,getBBox:()=>Me,getCenterShift:()=>be,getCommonRectangle:()=>Ye,getCubicControlPointA:()=>Ut,getCubicControlPointB:()=>Je,getCubicCurveDistance:()=>B,getDistance:()=>C,getHorizontalDistance:()=>D,getLineIntersection:()=>ki,getMidPoint:()=>Q,getPointOnCubicCurve:()=>Lt,getPointOnQuadraticCurve:()=>it,getRotation:()=>oe,getScale:()=>q,getVerticalDistance:()=>L,intersect:()=>b,intersection:()=>_,invertRange:()=>m,isInRectangle:()=>Ci,max:()=>ye,min:()=>H,normalizeAngle:()=>ri,round:()=>ze,sin:()=>$e,stretch:()=>jt,tan:()=>Xt,toNumberRange:()=>gt});var h={};o.r(h),o.d(h,{add:()=>wo,any:()=>tr,copy:()=>W,each:()=>wi,eachContinue:()=>qr,eachReverse:()=>bn,find:()=>Ti,findIndex:()=>Ta,first:()=>os,getSortedIndex:()=>Wt,has:()=>ui,indexOf:()=>Ni,insert:()=>Wn,insertIndex:()=>Qo,keepIf:()=>Br,last:()=>Ur,map:()=>cr,move:()=>Xr,pushAll:()=>es,remove:()=>ji,removeIndex:()=>Go,replace:()=>An,setIndex:()=>Mn,shiftLeft:()=>eo,shuffle:()=>_t,slice:()=>Mr,toArray:()=>Zi});var p={};o.r(p),o.d(p,{clone:()=>zr,copy:()=>Gr,copyAllProperties:()=>Ts,copyProperties:()=>Ir,each:()=>yi,eachContinue:()=>mi,eachOrdered:()=>vr,entries:()=>Kt,forceCopyProperties:()=>gs,getKey:()=>oi,hasKey:()=>Pr,keys:()=>Di,keysOrdered:()=>Tr,merge:()=>Or,softCopyProperties:()=>Fn});var y={};o.r(y),o.d(y,{ListIterator:()=>nf,concat:()=>zs,contains:()=>fh,each:()=>ar,eachContinue:()=>on,filter:()=>La,find:()=>jc,findIndex:()=>Vc,findMap:()=>Vl,flatten:()=>Eu,foldl:()=>ud,fromArray:()=>fi,indexed:()=>Iu,join:()=>vu,length:()=>dr,map:()=>Ha,max:()=>cd,min:()=>Yl,sort:()=>Es,toArray:()=>wr});var v={};o.r(v),o.d(v,{order:()=>Mh,random:()=>Dg,repeat:()=>Mg});var x={};o.r(x),o.d(x,{order:()=>ah});var I={};o.r(I),o.d(I,{brighten:()=>me,getBrightnessStep:()=>Le,getLightnessStep:()=>Yi,hexToRgb:()=>Zm,hexToRgbWithAlpha:()=>tp,hslToRgb:()=>bt,hsvToRgb:()=>se,interpolate:()=>Jt,isLight:()=>ge,lighten:()=>Fi,pad2:()=>qt,rgb:()=>Dc,rgbToHex:()=>Oy,rgbToHsl:()=>ne,rgbToHsv:()=>ee,rgbToRGBA:()=>Lg,rgbaToRgb:()=>Af,saturate:()=>We});var P={};o.r(P),o.d(P,{anyToDate:()=>Ry,anyToNumber:()=>At,camelToDashed:()=>Fh,capitalize:()=>cc,cleanFormat:()=>kh,copy:()=>ul,copyProperties:()=>pn,decimalPlaces:()=>F$,documentPointToSprite:()=>Lb,documentPointToSvg:()=>hu,escapeForRgex:()=>Kl,fitNumber:()=>Ng,fitNumberRelative:()=>k0,get12Hours:()=>Rs,getBaseURI:()=>Hs,getDayFromWeek:()=>Os,getFormat:()=>xo,getMonthWeek:()=>ts,getPixelRatio:()=>Nr,getTimeZone:()=>Ia,getWeek:()=>Vr,getYearDay:()=>zi,height:()=>My,isIE:()=>JS,isNotEmpty:()=>uo,joinUrl:()=>d3,ltrim:()=>$d,numberToString:()=>ip,padString:()=>Jl,parseUrl:()=>_4,plainText:()=>$h,random:()=>cl,relativeRadiusToValue:()=>Oo,relativeToValue:()=>Is,reverseString:()=>Il,rtrim:()=>Nh,serializeUrl:()=>Rn,softCopyProperties:()=>Uo,splitTextByCharCount:()=>Lh,spritePointToDocument:()=>yr,spritePointToSprite:()=>Ip,spritePointToSvg:()=>vm,spriteRectToSvg:()=>rt,stringify:()=>Gu,stripHash:()=>Jn,stripTags:()=>Pu,svgPointToDocument:()=>$0,svgPointToSprite:()=>Of,svgRectToSprite:()=>h3,trim:()=>Pf,truncateWithEllipsis:()=>kd,unquote:()=>Gc,used:()=>nn,valueToRelative:()=>lh,width:()=>As});var F={};o.r(F),o.d(F,{bounceIn:()=>Aa,bounceInOut:()=>f3,bounceOut:()=>vI,circleIn:()=>tz,circleInOut:()=>S4,circleOut:()=>tn,cubicIn:()=>x4,cubicInOut:()=>Ma,cubicOut:()=>$v,elasticIn:()=>C4,elasticInOut:()=>iz,elasticOut:()=>k$,expIn:()=>fI,expInOut:()=>B0,expOut:()=>mI,linear:()=>yh,polyIn:()=>L$,polyIn3:()=>Qm,polyInOut:()=>v1,polyInOut3:()=>N$,polyOut:()=>So,polyOut3:()=>b4,quadIn:()=>pI,quadInOut:()=>Bh,quadOut:()=>p3,sinIn:()=>Dy,sinInOut:()=>gI,sinOut:()=>w4});var k={};o.r(k),o.d(k,{add:()=>Ap,checkChange:()=>EI,copy:()=>eC,getDuration:()=>Uu,getNextUnit:()=>R4,getTime:()=>eg,getTimezoneMinutes:()=>cz,now:()=>TI,round:()=>hd,setTimezone:()=>w3,timeUnitDurations:()=>O4});var j={};o.r(j),o.d(j,{load:()=>li,readBlob:()=>is});var V={};o.r(V),o.d(V,{arc:()=>oC,arcTo:()=>Bd,arcToPoint:()=>j0,closePath:()=>J8e,cubicCurveTo:()=>C3,lineTo:()=>Rr,moveTo:()=>wn,pathToPoints:()=>Z8e,pointsToPath:()=>e9e,polyline:()=>$4,quadraticCurveTo:()=>sC,rectToPath:()=>aC,rectangle:()=>mz,spiralPoints:()=>Q8e});var Y={};o.r(Y),o.d(Y,{AMElement:()=>CI,Adapter:()=>uc,Animation:()=>_m,BaseObject:()=>Yt,BaseObjectEvents:()=>bi,Basis:()=>t9e,BlurFilter:()=>ive,Button:()=>nC,CSVParser:()=>rC,Cache:()=>wl,Circle:()=>FI,CirclePattern:()=>Q$,CloseButton:()=>X0e,Color:()=>Ee,ColorModifier:()=>Zn,ColorSet:()=>ig,ColorizeFilter:()=>tve,Component:()=>DI,Cone:()=>_z,Container:()=>cs,CounterDisposer:()=>Cs,DATE:()=>fr,DURATION:()=>lr,DataItem:()=>MI,DataLoader:()=>z0e,DataParser:()=>Yte,DataSource:()=>pz,DateFormatter:()=>AI,DesaturateFilter:()=>e8,Dictionary:()=>Ea,DictionaryDisposer:()=>ep,DictionaryTemplate:()=>ym,Disposer:()=>Kr,DropShadowFilter:()=>Jte,DurationFormatter:()=>k4,Ellipse:()=>fz,EventDispatcher:()=>si,Export:()=>Bg,ExportMenu:()=>Ht,Filter:()=>uC,FocusFilter:()=>rve,GlobalAdapter:()=>el,Group:()=>A4,Image:()=>q$,IndexedIterable:()=>of,Inertia:()=>P4,Interaction:()=>H$,InteractionKeyboardObject:()=>z$,InteractionObject:()=>U$,InteractionObjectEventDispatcher:()=>b3,InterfaceColorSet:()=>Wa,JSONParser:()=>S3,Keyboard:()=>uz,Label:()=>tg,Language:()=>w1,LightenFilter:()=>bz,Line:()=>Bv,LinePattern:()=>rie,LinearGradient:()=>Fy,LinearGradientModifier:()=>j4,List:()=>to,ListDisposer:()=>ua,ListGrouper:()=>Fg,ListIterator:()=>nf,ListTemplate:()=>lo,Modal:()=>W$,Morpher:()=>Y0e,MouseCursorStyle:()=>Al,MultiDisposer:()=>jn,MutableValueDisposer:()=>Kn,NUMBER:()=>Xi,NumberFormatter:()=>x3,OrderedList:()=>uu,OrderedListTemplate:()=>Jm,PLACEHOLDER:()=>Fr,PLACEHOLDER2:()=>gr,PX:()=>_i,Paper:()=>iC,Pattern:()=>b1,PatternSet:()=>nie,Percent:()=>J,PlayButton:()=>eie,Plugin:()=>nve,PointedRectangle:()=>q0e,PointedShape:()=>W0e,Polyarc:()=>Xte,Polygon:()=>T3,Polyline:()=>B4,Polyspline:()=>V4,Popup:()=>V0,Preloader:()=>lC,RadialGradient:()=>Ly,RadialGradientModifier:()=>iie,RectPattern:()=>Vg,Rectangle:()=>OI,Rectangle3D:()=>jb,Registry:()=>gh,ResizeButton:()=>Y$,Responsive:()=>H0e,ResponsiveBreakpoints:()=>Mf,RoundedRectangle:()=>Vb,STRING:()=>Li,SVGContainer:()=>Bb,SVGDefaults:()=>T4,Scrollbar:()=>G0,Slice:()=>LI,Slice3D:()=>eve,Slider:()=>Kte,SortedList:()=>ju,SortedListTemplate:()=>oh,Sprite:()=>yo,SpriteEventDispatcher:()=>rz,SpriteState:()=>Qr,StyleClass:()=>G$,StyleRule:()=>Ys,SwitchButton:()=>X$,System:()=>U0e,TargetedEventDispatcher:()=>vt,Tension:()=>S1,TextFormatter:()=>N4,TextLink:()=>gz,Tooltip:()=>NI,Trapezoid:()=>yz,Triangle:()=>K$,Validatable:()=>St,WavedCircle:()=>J$,WavedLine:()=>Lr,WavedRectangle:()=>Z$,ZoomOutButton:()=>Qte,addClass:()=>kb,addLicense:()=>c9e,animate:()=>Nb,array:()=>h,blur:()=>QS,cache:()=>sf,castColor:()=>at,castNumber:()=>$t,castString:()=>Pt,checkBoolean:()=>Be,checkNumber:()=>qe,checkObject:()=>et,checkString:()=>Ge,color:()=>He,colors:()=>I,copyAttributes:()=>Vh,create:()=>n9e,createDeferred:()=>o9e,createFromConfig:()=>s9e,dataLoader:()=>RI,defaultRules:()=>sp,disposeAllCharts:()=>t8,ease:()=>F,fixPixelPerfect:()=>j$,focus:()=>I4,getElement:()=>V$,getInteraction:()=>Zs,getTextFormatter:()=>x1,globalAdapter:()=>Dh,is:()=>xl,isArray:()=>wt,isColor:()=>Xe,isElement:()=>_1,isNaN:()=>Ie,isNumber:()=>ae,isObject:()=>ht,isPercent:()=>Se,isString:()=>ct,iter:()=>y,join:()=>vu,keyboard:()=>kg,math:()=>c,max:()=>cd,min:()=>Yl,net:()=>j,nextFrame:()=>Cn,number:()=>x,object:()=>p,options:()=>rp,or:()=>cu,outerHTML:()=>wI,path:()=>V,percent:()=>de,readFrame:()=>Gn,ready:()=>xI,registry:()=>pi,removeClass:()=>ZS,reverse:()=>Au,string:()=>v,system:()=>ca,time:()=>k,triggerIdle:()=>Lo,type:()=>l,unuseAllThemes:()=>u9e,unuseTheme:()=>l9e,useTheme:()=>a9e,utils:()=>P,viewPortHandler:()=>r9e,whenIdle:()=>Dn,writeFrame:()=>Po});var X={};o.r(X),o.d(X,{Axis:()=>o8,AxisBreak:()=>s8,AxisBullet:()=>z4,AxisDataItem:()=>cC,AxisFill:()=>Cz,AxisFillCircular:()=>fie,AxisLabel:()=>Tz,AxisLabelCircular:()=>h8,AxisLine:()=>uie,AxisRenderer:()=>a8,AxisRendererCircular:()=>mie,AxisRendererRadial:()=>d8,AxisRendererX:()=>Vd,AxisRendererX3D:()=>I3,AxisRendererY:()=>T1,AxisRendererY3D:()=>Eie,AxisTick:()=>Ez,Bullet:()=>zo,Candlestick:()=>v8,CandlestickSeries:()=>Aie,CandlestickSeriesDataItem:()=>X4,CategoryAxis:()=>jh,CategoryAxisBreak:()=>die,CategoryAxisDataItem:()=>$x,Chart:()=>kx,ChartDataItem:()=>oie,ChordDiagram:()=>vve,ChordDiagramDataItem:()=>yve,ChordLink:()=>Vz,ChordNode:()=>Bz,CircleBullet:()=>Yz,ClockHand:()=>Dz,Column:()=>BI,Column3D:()=>Iie,ColumnSeries:()=>Vv,ColumnSeries3D:()=>y8,ColumnSeries3DDataItem:()=>Y4,ColumnSeriesDataItem:()=>Gb,ConeColumn:()=>Wz,ConeSeries:()=>Tve,ConeSeriesDataItem:()=>qz,Cursor:()=>Die,CurvedColumn:()=>jI,CurvedColumnSeries:()=>Eve,CurvedColumnSeriesDataItem:()=>Mie,DateAxis:()=>dc,DateAxisBreak:()=>cie,DateAxisDataItem:()=>hie,DurationAxis:()=>u8,DurationAxisDataItem:()=>cve,ErrorBullet:()=>Ive,FlowDiagram:()=>kz,FlowDiagramDataItem:()=>m8,FlowDiagramLink:()=>q4,FlowDiagramNode:()=>f8,FunnelSeries:()=>zz,FunnelSeriesDataItem:()=>Vx,FunnelSlice:()=>VI,GaugeChart:()=>dve,GaugeChartDataItem:()=>yie,Grid:()=>G4,GridCircular:()=>Mz,HeatLegend:()=>jz,LabelBullet:()=>E3,Legend:()=>i8,LegendDataItem:()=>xz,LegendSettings:()=>aie,LineSeries:()=>Oz,LineSeriesDataItem:()=>c8,LineSeriesSegment:()=>Pz,NavigationBar:()=>A3,NavigationBarDataItem:()=>Ave,OHLC:()=>Gz,OHLCSeries:()=>bve,OHLCSeriesDataItem:()=>_8,PictorialStackedSeries:()=>Cve,PictorialStackedSeriesDataItem:()=>K4,PieChart:()=>bie,PieChart3D:()=>fve,PieChart3DDataItem:()=>pve,PieChartDataItem:()=>H4,PieSeries:()=>Nz,PieSeries3D:()=>wie,PieSeries3DDataItem:()=>hC,PieSeriesDataItem:()=>Lz,PieTick:()=>_ie,PyramidSeries:()=>Rie,PyramidSeriesDataItem:()=>Hz,RadarChart:()=>gie,RadarChartDataItem:()=>hve,RadarColumn:()=>Oie,RadarColumnSeries:()=>Sve,RadarColumnSeriesDataItem:()=>xve,RadarCursor:()=>Pve,RadarSeries:()=>pie,RadarSeriesDataItem:()=>Rz,SankeyDiagram:()=>gve,SankeyDiagramDataItem:()=>mve,SankeyLink:()=>$z,SankeyNode:()=>bm,SerialChart:()=>Sz,SerialChartDataItem:()=>lie,Series:()=>n8,SeriesDataItem:()=>r8,SlicedChart:()=>xie,SlicedChartDataItem:()=>W4,StepLineSeries:()=>Pie,StepLineSeriesDataItem:()=>Uz,Tick:()=>U4,TreeMap:()=>Tie,TreeMapDataItem:()=>Cie,TreeMapSeries:()=>g8,TreeMapSeriesDataItem:()=>Sie,ValueAxis:()=>Ro,ValueAxisBreak:()=>Iz,ValueAxisDataItem:()=>l8,XYChart:()=>U0,XYChart3D:()=>_ve,XYChart3DDataItem:()=>d9e,XYChartDataItem:()=>Az,XYChartScrollbar:()=>$I,XYCursor:()=>J4,XYSeries:()=>kI,XYSeriesDataItem:()=>rg});var Z=function(U,R){return Z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,w){u.__proto__=w}||function(u,w){for(var $ in w)Object.prototype.hasOwnProperty.call(w,$)&&(u[$]=w[$])},Z(U,R)};function ie(U,R){if(typeof R!="function"&&R!==null)throw new TypeError("Class extends value "+String(R)+" is not a constructor or null");function u(){this.constructor=U}Z(U,R),U.prototype=R===null?Object.create(R):(u.prototype=R.prototype,new u)}var ce=function(){return ce=Object.assign||function(U){for(var R,u=1,w=arguments.length;u0&&$[$.length-1])||De[0]!==6&&De[0]!==2)){K=0;continue}if(De[0]===3&&(!$||De[1]>$[0]&&De[1]<$[3])){K.label=De[1];break}if(De[0]===6&&K.label<$[1]){K.label=$[1],$=De;break}if($&&K.label<$[2]){K.label=$[2],K.ops.push(De);break}$[2]&&K.ops.pop(),K.trys.pop();continue}De=R.call(U,K)}catch(Ve){De=[6,Ve],w=0}finally{u=$=0}if(5&De[0])throw De[1];return{value:De[0]?De[1]:void 0,done:!0}}([ue,we])}}}function xe(U){var R=typeof Symbol=="function"&&Symbol.iterator,u=R&&U[R],w=0;if(u)return u.call(U);if(U&&typeof U.length=="number")return{next:function(){return U&&w>=U.length&&(U=void 0),{value:U&&U[w++],done:!U}}};throw new TypeError(R?"Object is not iterable.":"Symbol.iterator is not defined.")}function Pe(U,R){var u=typeof Symbol=="function"&&U[Symbol.iterator];if(!u)return U;var w,$,G=u.call(U),K=[];try{for(;(R===void 0||R-- >0)&&!(w=G.next()).done;)K.push(w.value)}catch(re){$={error:re}}finally{try{w&&!w.done&&(u=G.return)&&u.call(G)}finally{if($)throw $.error}}return K}function ke(){for(var U=[],R=0;Ru&&(U=u),U}function $e(U){return ze(Math.sin(Ae*U),10)}function Xt(U){return ze(Math.tan(Ae*U),10)}function A(U){return ze(Math.cos(Ae*U),10)}function ye(U,R){return ae(U)?ae(R)&&R>U?R:U:ae(R)?R:null}function H(U,R){return ae(U)?ae(R)&&R0)for(var re=0;re<=$;re++){var ue=Lt(U,R,u,w,re/$);G+=C(K,ue),K=ue}return G}function q(U,R,u,w){var $=C(R,w),G=C(U,u);return Math.abs(G/$)}function Q(U,R,u){return ae(u)||(u=.5),{x:U.x+(R.x-U.x)*u,y:U.y+(R.y-U.y)*u}}function oe(U,R,u,w){var $=le(R,w)-le(U,u);return $<0&&($+=360),$}function le(U,R){R||(R={x:2*U.x,y:2*U.y});var u=R.x-U.x,w=R.y-U.y,$=Math.atan2(w,u)*tt;return $<0&&($+=360),ri($)}function be(U,R,u,w,$){var G=oe(R,u,w,$)-90;G<0&&(G+=360);var K=C(R,w),re=Math.cos(G)/K+R.x,ue=Math.cos(G)/K+R.y;return{x:re-U.x,y:ue-U.y}}function Me(U){if(U){var R=U.length;if(R!==0){for(var u,w=void 0,$=void 0,G=void 0,K=0;K$)&&($=re.x),(!ae(w)||re.xG)&&(G=re.y)}return{x:w,y:u,width:$-w,height:G-u}}}return{x:0,y:0,width:0,height:0}}function Ye(U){var R=U.length;if(R!==0){for(var u=void 0,w=void 0,$=void 0,G=void 0,K=0;Ku){var w=R;R=u,u=w}U=ri(U);var $=(R-ri(R))/360;return Uu&&(U-360>R?U-=360:U=UR+(u-R)/2-180?R:u),U}function Zt(U,R,u){var w=Number.MAX_VALUE,$=Number.MAX_VALUE,G=-Number.MAX_VALUE,K=-Number.MAX_VALUE,re=[];ae(u)||(u=1),re.push(ii(u,U)),re.push(ii(u,R));for(var ue=Math.min(90*Math.floor(U/90),90*Math.floor(R/90)),we=Math.max(90*Math.ceil(U/90),90*Math.ceil(R/90)),De=ue;De<=we;De+=90)De>=U&&De<=R&&re.push(ii(u,De));for(var Ve=0;VeG&&(G=Ke.x),Ke.y>K&&(K=Ke.y)}return{x:w,y:$,width:G-w,height:K-$}}function ii(U,R){return{x:U*A(R),y:U*$e(R)}}function Ci(U,R){return U.x>=R.x&&U.x<=R.x+R.width&&U.y>=R.y&&U.y<=R.y+R.height}function ki(U,R,u,w){return{x:((U.x*R.y-R.x*U.y)*(u.x-w.x)-(U.x-R.x)*(u.x*w.y-u.y*w.x))/((U.x-R.x)*(u.y-w.y)-(U.y-R.y)*(u.x-w.x)),y:((U.x*R.y-R.x*U.y)*(u.y-w.y)-(U.y-R.y)*(u.x*w.y-u.y*w.x))/((U.x-R.x)*(u.y-w.y)-(U.y-R.y)*(u.x-w.x))}}function Ni(U,R){for(var u=U.length,w=0;w>1,re=R(u,U[K]);re<0?$=K:(re===0&&(G=!0),w=K+1)}return{found:G,index:G?w-1:w}}function Ta(U,R){for(var u=U.length,w=0;w0&&this.hasListenersByType(R)&&this._disabled[R]==null},U.prototype.has=function(R,u,w){return Ta(this._listeners,function($){return $.once!==!0&&$.type===R&&(u==null||$.callback===u)&&$.context===w})!==-1},U.prototype._shouldDispatch=function(R){if(this._disposed)throw new Error("EventDispatcher is disposed");var u=this._disabled[R];return ae(u)?(u<=1?delete this._disabled[R]:--this._disabled[R],!1):this._enabled},U.prototype._eachListener=function(R){var u=this;++this._iterating;try{wi(this._listeners,R)}finally{--this._iterating,this._iterating===0&&this._killed.length!==0&&(wi(this._killed,function(w){u._removeListener(w)}),this._killed.length=0)}},U.prototype.dispatchImmediately=function(R,u){this._shouldDispatch(R)&&this._eachListener(function(w){w.killed||w.type!==null&&w.type!==R||w.dispatch(R,u)})},U.prototype.dispatch=function(R,u){this._shouldDispatch(R)&&this._eachListener(function(w){w.killed||w.type!==null&&w.type!==R||Dn(function(){w.killed||w.dispatch(R,u)})})},U.prototype._on=function(R,u,w,$,G,K){var re=this;if(this._disposed)throw new Error("EventDispatcher is disposed");this._removeExistingListener(R,u,w,$);var ue={type:u,callback:w,context:$,shouldClone:G,dispatch:K,killed:!1,once:R,disposer:new Kr(function(){ue.killed=!0,re._removeListener(ue)})};return this._listeners.push(ue),ue},U.prototype.onAll=function(R,u,w){return w===void 0&&(w=!0),this._on(!1,null,R,u,w,function($,G){return R.call(u,$,G)}).disposer},U.prototype.on=function(R,u,w,$){return $===void 0&&($=!0),this._on(!1,R,u,w,$,function(G,K){return u.call(w,K)}).disposer},U.prototype.once=function(R,u,w,$){$===void 0&&($=!0);var G=this._on(!0,R,u,w,$,function(K,re){G.disposer.dispose(),u.call(w,re)});return G.disposer},U.prototype.off=function(R,u,w){this._removeExistingListener(!1,R,u,w)},U.prototype.copyFrom=function(R){var u=this;if(this._disposed)throw new Error("EventDispatcher is disposed");if(R===this)throw new Error("Cannot copyFrom the same TargetedEventDispatcher");wi(R._listeners,function(w){!w.killed&&w.shouldClone&&(w.type===null?u.onAll(w.callback,w.context):w.once?u.once(w.type,w.callback,w.context):u.on(w.type,w.callback,w.context))})},U}(),vt=function(U){function R(u){var w=U.call(this)||this;return w.target=u,w}return ie(R,U),R.prototype.copyFrom=function(u){var w=this;if(this._disposed)throw new Error("EventDispatcher is disposed");if(u===this)throw new Error("Cannot copyFrom the same TargetedEventDispatcher");wi(u._listeners,function($){$.context!==u.target&&!$.killed&&$.shouldClone&&($.type===null?w.onAll($.callback,$.context):$.once?w.once($.type,$.callback,$.context):w.on($.type,$.callback,$.context))})},R}(si);function Kt(U){return function(R){for(var u in U)if(Pr(U,u)&&!R([u,U[u]]))break}}function Di(U){var R=[];for(var u in U)Pr(U,u)&&R.push(u);return R}function Tr(U,R){return Di(U).sort(R)}function Pr(U,R){return{}.hasOwnProperty.call(U,R)}function oi(U,R){return U[R]}function mi(U,R){for(var u in U)if(Pr(U,u)&&!R(u,U[u]))break}function yi(U,R){mi(U,function(u,w){return R(u,w),!0})}function vr(U,R,u){wi(Tr(U,u),function(w){R(w,U[w])})}function Gr(U){return Object.assign({},U)}function Or(U,R){return Object.assign({},U,R)}function zr(U){return JSON.parse(JSON.stringify(U))}function Ir(U,R,u){wi(u,function(w){Te(U[w])&&(R[w]=U[w])})}function Fn(U,R,u){wi(u,function(w){Te(U[w])&&!Te(R[w])&&(R[w]=U[w])})}function gs(U,R,u){wi(u,function(w){R[w]=U[w]})}function Ts(U,R){Ir(U,R,Di(U))}function fi(U){return function(R){for(var u=U.length,w=0;wU?R:U}function cd(U){return ud(U,null,mh)}function vu(U,R){R===void 0&&(R="");var u=!0,w="";return U(function($){return u?u=!1:w+=R,w+=$,!0}),w}var nf=function(){function U(R,u){this.createNewItems=!1,this.list=R,this._create=u,this.reset()}return U.prototype.reset=function(){this._listCopy=wr(this.list.iterator())},U.prototype.clear=function(){this._listCopy.length=0},U.prototype.getFirst=function(){return this.returnItem(0)},U.prototype.getLast=function(){return this.returnItem(this._listCopy.length-1)},U.prototype.find=function(R){var u=Ta(this._listCopy,R);if(u!==-1){var w=this._listCopy[u];return ji(this._listCopy,w),w}return this.getLast()},U.prototype.removeItem=function(R){return ji(this._listCopy,R)},U.prototype.returnItem=function(R){if(R>=0&&R=R._end&&u(R._array[w]);--w);}},U.prototype.backwards=function(){return new U(this._array,this._end,this._start)},U.prototype.range=function(R,u){if(R<=u){if(this._start===this._end)return this;if(this._start=0&&U=0&&R0);if(K>=re)return re;this.swap(K,re)}},U.prototype.sort=function(R){this._sortQuicksort(0,this._values.length-1,R)},U.prototype.swap=function(R,u){var w=this._values.length;if(Ep(R,w),Ep(u,w),R!==u){var $=this._values[R],G=this._values[u];this._values[R]=G,this.events.isEnabled("setIndex")&&this.events.dispatchImmediately("setIndex",{type:"setIndex",target:this,index:R,oldValue:$,newValue:G}),this._values[u]=$,this.events.isEnabled("setIndex")&&this.events.dispatchImmediately("setIndex",{type:"setIndex",target:this,index:u,oldValue:G,newValue:$})}},U.prototype.removeIndex=function(R){Ep(R,this._values.length);var u=this._values[R];return Go(this._values,R),this.events.isEnabled("removeIndex")&&this.events.dispatchImmediately("removeIndex",{type:"removeIndex",target:this,index:R,oldValue:u}),this.events.isEnabled("removed")&&this.events.dispatchImmediately("removed",{type:"removed",target:this,oldValue:u}),u},U.prototype.moveValue=function(R,u){var w=this.indexOf(R);if(w!==-1){var $=this._values[w];Go(this._values,w),this.events.isEnabled("removeIndex")&&this.events.dispatchImmediately("removeIndex",{type:"removeIndex",target:this,index:w,oldValue:$})}u==null?(u=this._values.length,this._values.push(R)):Qo(this._values,u,R),this.events.isEnabled("insertIndex")&&this.events.dispatchImmediately("insertIndex",{type:"insertIndex",target:this,index:u,newValue:R}),w===-1&&this.events.isEnabled("inserted")&&this.events.dispatchImmediately("inserted",{type:"inserted",target:this,newValue:R})},U.prototype.push=function(R){var u=this._values.push(R)-1;return this.events.isEnabled("insertIndex")&&this.events.dispatchImmediately("insertIndex",{type:"insertIndex",target:this,index:u,newValue:R}),this.events.isEnabled("inserted")&&this.events.dispatchImmediately("inserted",{type:"inserted",target:this,newValue:R}),R},U.prototype.unshift=function(R){this.insertIndex(0,R)},U.prototype.pushAll=function(R){var u=this;wi(R,function(w){u.push(w)})},U.prototype.copyFrom=function(R){this.pushAll(R._values)},U.prototype.pop=function(){return this._values.length-1<0?void 0:this.removeIndex(this._values.length-1)},U.prototype.shift=function(){return this._values.length?this.removeIndex(0):void 0},U.prototype.setAll=function(R){var u=this,w=W(this._values);this._values.length=0,wi(R,function($){u._values.push($)}),this.events.isEnabled("setAll")&&this.events.dispatchImmediately("setAll",{type:"setAll",target:this,oldArray:w,newArray:this._values}),this.events.isEnabled("removed")&&wi(w,function($){u.events.dispatchImmediately("removed",{type:"removed",target:u,oldValue:$})}),this.events.isEnabled("inserted")&&wi(this._values,function($){u.events.dispatchImmediately("inserted",{type:"inserted",target:u,newValue:$})})},U.prototype.clear=function(){this.setAll([])},U.prototype.iterator=function(){return fi(this._values)},U.prototype[Symbol.iterator]=function(){var R,u;return _e(this,function(w){switch(w.label){case 0:R=this._values.length,u=0,w.label=1;case 1:return uDe)&&(K=re,$=we,G=De)}else w==="left"&&we=R&&(!Te($)||$>=we)&&(K=re,$=we);return++re,!0}),K===-1&&(w==="left"?K=0:w==="right"&&(K=this.length-1)),K},U.prototype.iterator=function(){return fi(this._values)},U.prototype[Symbol.iterator]=function(){var R,u;return _e(this,function(w){switch(w.label){case 0:R=this._values.length,u=0,w.label=1;case 1:return u0)for(var G=0;G<$;++G){var K=w[G];K.key===R&&(u=K.callback.call(K.scope,u,this.object,R))}return Dh.applyAll(this.object,R,u)}return u},U.prototype.keys=function(){return wr(Ha(this._callbacks.iterator(),function(R){return R.key}))},U.prototype.copyFrom=function(R){var u=this;ar(R._callbacks.iterator(),function(w){u.add(w.key,w.callback,w.priority,w.scope)}),yi(R._disabled,function(w,$){u._disabled[w]=$})},U.prototype.clear=function(){this._callbacks.clear()},U}(),Xl={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgrey:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},grey:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgrey:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},rebeccapurple:{r:102,g:51,b:153},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}};function Dc(U,R){var u;return Xl[U]?u=Xl[U]:U.charAt(0)==="#"?u=Zm(U):U.match(/^rgba?\(/)&&(u=Af(U)),u||(u={r:0,g:0,b:0,a:1}),Te(R)&&(u.a=R),u}function Zm(U){U=U.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(u,w,$,G){return w+w+$+$+G+G});var R=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(U);return R?{r:parseInt(R[1],16),g:parseInt(R[2],16),b:parseInt(R[3],16)}:tp(U)}function tp(U){U=U.replace(/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])$/i,function(u,w,$,G,K){return w+w+$+$+G+G+K+K});var R=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(U);return R?{r:parseInt(R[1],16),g:parseInt(R[2],16),b:parseInt(R[3],16),a:parseInt(R[4],16)/256}:void 0}function Af(U){var R=(U=U.replace(/[ ]/g,"")).match(/^rgb\(([0-9]*),([0-9]*),([0-9]*)\)/i);if(R)R.push("1");else if(!(R=U.match(/^rgba\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\)/i)))return;return{r:parseInt(R[1]),g:parseInt(R[2]),b:parseInt(R[3]),a:parseFloat(R[4])}}function Oy(U){return"#"+qt(U.r.toString(16))+qt(U.g.toString(16))+qt(U.b.toString(16))}function Lg(U){return Te(U.a)&&U.a!==1?"rgba("+U.r+","+U.g+","+U.b+","+U.a+")":"rgb("+U.r+","+U.g+","+U.b+")"}function qt(U){return U.length==1?"0"+U:""+U}function Jt(U,R,u){return u=nt(u,0,1),U?R?{r:U.r+Math.round((R.r-U.r)*u),g:U.g+Math.round((R.g-U.g)*u),b:U.b+Math.round((R.b-U.b)*u),a:(U.a||1)+Math.round(((R.a||1)-(U.a||1))*u)}:U:R||U}function Fi(U,R){return U&&{r:Math.max(0,Math.min(255,U.r+Yi(U.r,R))),g:Math.max(0,Math.min(255,U.g+Yi(U.g,R))),b:Math.max(0,Math.min(255,U.b+Yi(U.b,R))),a:U.a}}function Yi(U,R){var u=R>0?255-U:U;return Math.round(u*R)}function me(U,R){if(U){var u=Yi(Math.min(Math.max(U.r,U.g,U.b),230),R);return{r:Math.max(0,Math.min(255,Math.round(U.r+u))),g:Math.max(0,Math.min(255,Math.round(U.g+u))),b:Math.max(0,Math.min(255,Math.round(U.b+u))),a:U.a}}return U}function Le(U,R){return Math.round(255*R)}function We(U,R){if(U==null||R==1)return U;var u=ne(U);return u.s=R,bt(u)}function bt(U){var R,u,w,$=U.h,G=U.s,K=U.l;if(G==0)R=u=w=K;else{var re=function(De,Ve,Ke){return Ke<0&&(Ke+=1),Ke>1&&(Ke-=1),Ke<.16666666666666666?De+6*(Ve-De)*Ke:Ke<.5?Ve:Ke<.6666666666666666?De+(Ve-De)*(.6666666666666666-Ke)*6:De},ue=K<.5?K*(1+G):K+G-K*G,we=2*K-ue;R=re(we,ue,$+.3333333333333333),u=re(we,ue,$),w=re(we,ue,$-.3333333333333333)}return{r:Math.round(255*R),g:Math.round(255*u),b:Math.round(255*w)}}function ne(U){var R=U.r/255,u=U.g/255,w=U.b/255,$=Math.max(R,u,w),G=Math.min(R,u,w),K=0,re=0,ue=($+G)/2;if($===G)K=re=0;else{var we=$-G;switch(re=ue>.5?we/(2-$-G):we/($+G),$){case R:K=(u-w)/we+(u=128}var Ee=function(){function U(R){this._value=R}return Object.defineProperty(U.prototype,"rgb",{get:function(){return this._value},enumerable:!0,configurable:!0}),Object.defineProperty(U.prototype,"hex",{get:function(){return this._value?Oy(this._value):"none"},enumerable:!0,configurable:!0}),Object.defineProperty(U.prototype,"rgba",{get:function(){return this._value?Lg(this._value):"none"},enumerable:!0,configurable:!0}),Object.defineProperty(U.prototype,"alpha",{get:function(){return this._value!=null&&this._value.a!=null?this._value.a:1},set:function(R){this._value&&(this._value.a=R)},enumerable:!0,configurable:!0}),Object.defineProperty(U.prototype,"lightColor",{get:function(){return this._lightColor||(this._lightColor=new U({r:255,g:255,b:255})),this._lightColor},set:function(R){this._lightColor=R},enumerable:!0,configurable:!0}),Object.defineProperty(U.prototype,"darkColor",{get:function(){return this._darkColor||(this._darkColor=new U({r:0,g:0,b:0})),this._darkColor},set:function(R){this._darkColor=R},enumerable:!0,configurable:!0}),U.prototype.toString=function(){return this.alpha<1?this.rgba:this.hex},U.prototype.lighten=function(R){return new U(Fi(this.rgb,R))},U.prototype.brighten=function(R){return new U(me(this.rgb,R))},U.prototype.saturate=function(R){return new U(We(this.rgb,R))},Object.defineProperty(U.prototype,"alternative",{get:function(){if(this.rgb!=null)return ge(this.rgb)?this.darkColor:this.lightColor;throw new Error("Color does not exist")},enumerable:!0,configurable:!0}),U}();function He(U,R){if(!Te(U))return new Ee(void 0);if(typeof U=="string"){var u="_color_"+U+"_"+(R||"1"),w=pi.getCache(u);if(w)return new Ee({r:w.r,g:w.g,b:w.b,a:w.a});var $=Dc(U,R);return pi.setCache(u,$),new Ee($)}return U instanceof Ee?(Te(R)&&(U.alpha=R),U):new Ee(U)}function Xe(U){return U instanceof Ee}function at(U){return He(U)}function Tt(U){return Te(U)&&!Xe(U)?at(U):U}var Yt=function(){function U(){this._disposed=!1,this._disposers=[],this.className="BaseObject"}return U.prototype.debug=function(){},Object.defineProperty(U.prototype,"uid",{get:function(){return this._uid||(this._uid=pi.getUniqueId(),pi.map.setKey(this._uid,this)),this._uid},enumerable:!0,configurable:!0}),Object.defineProperty(U.prototype,"id",{get:function(){return this._id},set:function(R){this._id=R},enumerable:!0,configurable:!0}),Object.defineProperty(U.prototype,"map",{get:function(){return this._map||(this._map=new Ea),this._map},enumerable:!0,configurable:!0}),Object.defineProperty(U.prototype,"delayedMap",{get:function(){return this._delayedMap||(this._delayedMap=new Ea),this._delayedMap},enumerable:!0,configurable:!0}),U.prototype.addDelayedMap=function(R,u){var w=this.delayedMap;w.hasKey(u)||w.setKey(u,[]),w.getKey(u).push({property:R,target:this})},U.prototype.processDelayedMap=function(){var R=this;this.delayedMap.each(function(u,w){if(R.map.hasKey(u)){var $=R.map.getKey(u);wi(w,function(G){G.target[G.property]=$}),R.delayedMap.removeKey(u)}})},U.prototype.applyTheme=function(){var R=this;if(pi){var u=this.getCurrentThemes();u&&wi(u,function(w,$){w(R)})}},Object.defineProperty(U.prototype,"themes",{get:function(){return this._themes},set:function(R){this._themes=R},enumerable:!0,configurable:!0}),U.prototype.getCurrentThemes=function(){return this.themes||pi.themes},U.prototype.isDisposed=function(){return this._disposed},U.prototype.dispose=function(){if(!this._disposed){this._disposed=!0;var R=this._disposers;for(this._disposers=null;R.length!==0;)R.shift().dispose();this.clearCache(),this.clonedFrom&&this.clonedFrom.clones.removeValue(this);var u=this._uid;u!=null&&pi.map.removeKey(u)}},U.prototype.addDisposer=function(R){this._disposers.push(R)},U.prototype.removeDispose=function(R){if(!this._disposed){var u=Ni(this._disposers,R);u>-1&&this._disposers.splice(u,1)}R.dispose()},U.prototype.clone=function(R){R||(R="clone-"+pi.getUniqueId());var u=new this.constructor;return u.cloneId=R,u.copyFrom(this),u},Object.defineProperty(U.prototype,"clones",{get:function(){return this._clones||(this._clones=new to),this._clones},enumerable:!0,configurable:!0}),U.prototype.copyFrom=function(R){R.clones.push(this),this.clonedFrom=R},Object.defineProperty(U.prototype,"className",{get:function(){return this._className},set:function(R){this._className=R},enumerable:!0,configurable:!0}),U.prototype.setCache=function(R,u,w){sf.set(this.uid,R,u,w)},U.prototype.getCache=function(R,u){return u===void 0&&(u=void 0),sf.get(this.uid,R,u)},U.prototype.clearCache=function(){sf.clear(this.uid)},U.prototype.setTimeout=function(R,u){var w=this,$=setTimeout(function(){w.removeDispose(G),R()},u),G=new Kr(function(){clearTimeout($)});return this._disposers.push(G),G},U.prototype.setInterval=function(R,u){var w=this,$=setInterval(function(){w.removeDispose(G),R()},u),G=new Kr(function(){clearTimeout($)});return this._disposers.push(G),G},Object.defineProperty(U.prototype,"config",{set:function(R){try{this.processConfig(R)}catch(u){this.raiseCriticalError(u)}},enumerable:!0,configurable:!0}),U.prototype.processConfig=function(R){var u=this;if(R){var w=this;if(vr(R,function(G,K){var re,ue=K;if(G=="callback"&&typeof K=="function"&&K.call(w),u.hasProperty(G))if(!ht(ue)||!Te(ue.type)||ht(w[G])&&Te(w[G].className)&&!ue.forceCreate&&w[G].className==ue.type||u.asIs(G)?re=w[G]:(re=u.createClassInstance(ue.type))?w[G]=re:re=w[G],re instanceof uc)u.processAdapters(re,ue);else if(re instanceof si)u.processEvents(re,ue);else if(G=="locale"&&ct(ue))window["am4lang_"+ue]&&(w[G]=window["am4lang_"+ue]);else if(G=="parent"&&ct(ue)){var we=u.map.getKey(ue);we?w[G]=we:u.addDelayedMap("parent",ue)}else if(u.asIs(G))w[G]=ue;else if(u.asFunction(G)&&ct(ue)){if(!Te(pi.registeredClasses[ue]))throw Error("Invalid easing function: "+ue);w[G]=pi.registeredClasses[ue]}else if(ue instanceof U)w[G]=ue;else if(re instanceof U)re.config=ue;else if(re instanceof lo||re instanceof Jm||re instanceof oh){if(wt(ue))re instanceof lo?u.processListTemplate(ue,re):u.processOrderedTemplate(ue,re);else if(ht(ue))if(ue instanceof U)re.template=ue;else{var De;De=Te(ue.template)?ue.template:ue,re.template instanceof U?re.template.config=De:yi(De,function(Ve,Ke){var Qe=re.template[Ve];Qe instanceof uc?u.processAdapters(Qe,Ke):Qe instanceof si?u.processEvents(Qe,Ke):Qe instanceof ym?u.processDictionaryTemplate(Qe,Ke):re.template[Ve]instanceof U?re.template[Ve].config=Ke:ht(Ke)&&Te(Ke.type)?(Qe=u.createClassInstance(Ke.type))?(Qe instanceof U&&(Qe.config=Ke),re.template[Ve]=Qe):re.template[Ve]=Ke:Qe instanceof to?u.processList(Ke,Qe):re.template[Ve]=u.maybeColorOrPercent(Ke)}),Te(ue.values)&&(re instanceof lo?u.processListTemplate(ue.values,re):u.processOrderedTemplate(ue.values,re))}}else re instanceof to?G=="children"?u.processList(ue,re,u):u.processList(ue,re):re instanceof ym?u.processDictionaryTemplate(re,ue):re instanceof Ea?u.processDictionary(re,ue):re instanceof Ee||re instanceof J?w[G]=u.maybeColorOrPercent(ue):ht(re)&&ht(ue)?Ts(ue,re):(ue=u.maybeColorOrPercent(ue),w[G]=ue);else u.isReserved(G)||(w[G]=ue)},this.configOrder),this.processingErrors.length){var $=this.processingErrors.join(` +`);throw this._processingErrors=[],Error($)}}},U.prototype.maybeColorOrPercent=function(R){if(ct(R)){if(R.match(/^[\-]?[0-9.]+\%$/))return de(Et(R));if(R.match(/^\#[0-9abcdef]{3,}$/i))return He(R)}return R},U.prototype.processAdapters=function(R,u){var w=this;wt(u)?wi(u,function($,G){R.add($.key,$.callback,$.priority||0,w)}):ht(u)&&yi(u,function($,G){R.has($,G)||R.add($,G)})},U.prototype.processEvents=function(R,u){var w=this;wt(u)?wi(u,function($,G){R.on($.type,$.callback,w)}):ht(u)&&yi(u,function($,G){R.has($,G)||R.on($,G)})},U.prototype.processDictionaryTemplate=function(R,u){ht(u)&&yi(u,function(w,$){var G;(G=w=="template"?R.template:R.hasKey(w)?R.getKey(w):R.create(w))instanceof U?G.config=$:ht(G)&&ht($)?Ts($,G):G.setKey(w,$)})},U.prototype.processDictionary=function(R,u){ht(u)&&yi(u,function(w,$){R.setKey(w,$)})},U.prototype.processListTemplate=function(R,u){var w=this;for(wi(R,function($,G){var K,re=w.getConfigEntryType($);if(u.hasIndex(G)&&!$.forceCreate)K=u.getIndex(G);else{if($ instanceof U)return void u.push($);K=re?u.create(re):u.create()}$===K||ht($)&&(K instanceof U?K.config=$:ht(K)&&ht($)?Ts($,K):u.setIndex(u.indexOf(K),$))});R.length>u.length;)u.pop()},U.prototype.processOrderedTemplate=function(R,u){var w=this;wi(R,function($,G){var K,re=w.getConfigEntryType($);K=re?u.create(re):u.create(),ht($)&&(K instanceof U?K.config=$:ht(K)&&ht($)?Ts($,K):u.insert($))})},U.prototype.processList=function(R,u,w){var $=this;wt(R)||(R=[R]);var G=u.length,K=0;for(wi(R,function(re,ue){if(ht(re)){var we=void 0;if(ueR&&(u!==!0||$!=0)){if(w&&(we=Il(we)),Ke=we.match(new RegExp(".{1,"+R+"}","g"))){if(w)for(var Ve=0;VeR&&G[K]!==""&&(G.push(""),K++),G[K]+=we;K=G.length-1}}}else{var Ke;if(Ke=U.match(new RegExp(".{1,"+R+"}","g"))){if(w)for(Ve=0;VeR&&(G=[]),G}function kd(U,R,u,w,$){return U.length<=R?U:((R-=u.length)<1&&(R=1),(Lh(U,R,w,$)[0]||"")+u)}function Pf(U){return U.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function Nh(U){return U.replace(/[\s\uFEFF\xA0]+$/g,"")}function $d(U){return U.replace(/^[\s\uFEFF\xA0]+/g,"")}function Il(U){return U.split("").reverse().join("")}function Gc(U){var R=U.trim();return(R=U.replace(/^'(.*)'$/,"$1"))==U&&(R=U.replace(/^"(.*)"$/,"$1")),R}function Jl(U,R,u){return R===void 0&&(R=0),u===void 0&&(u="0"),typeof U!="string"&&(U=U.toString()),R>U.length?Array(R-U.length+1).join(u)+U:U}function xo(U){if(U===void 0)return Li;var R=(U=(U=(U=U.toLowerCase().replace(/^\[[^\]]*\]/,"")).replace(/\[[^\]]+\]/,"")).trim()).match(/\/(date|number|duration)$/);return R?R[1]:U===Xi?Xi:U===fr?fr:U===lr?lr:U.match(/[#0]/)?Xi:U.match(/[ymwdhnsqaxkzgtei]/)?fr:Li}function kh(U){return U.replace(/\/(date|number|duration)$/i,"")}function Pu(U){return U&&U.replace(/<[^>]*>/g,"")}function $h(U){return U&&Pu((""+U).replace(/[\n\r]+/g,". "))}function ip(U){if(Ie(U))return"NaN";if(U===1/0)return"Infinity";if(U===-1/0)return"-Infinity";if(U===0&&1/U==-1/0)return"-0";var R=U<0;U=Math.abs(U);var u,w=je(/^([0-9]+)(?:\.([0-9]+))?(?:e[\+\-]([0-9]+))?$/.exec(""+U)),$=w[1],G=w[2]||"";if(w[3]==null)u=G===""?$:$+"."+G;else{var K,re=+w[3];u=U<1?"0."+Mg("0",K=re-1)+$+G:(K=re-G.length)==0?$+G:K<0?$+G.slice(0,K)+"."+G.slice(K):$+G+Mg("0",K)}return R?"-"+u:u}function Ry(U){if(kt(U)){var R=new Date(U);return R.setMilliseconds(U.getMilliseconds()),R}if(ae(U))return new Date(U);var u=Number(U);return ae(u)?new Date(u):new Date(U)}function At(U){if(kt(U))return U.getTime();if(ae(U))return U;if(ct(U)){var R=Number(U);return ae(R)?R:void 0}}function zi(U,R){var u=new Date(U.getFullYear(),0,0),w=U.getTime()-u.getTime()+60*(u.getTimezoneOffset()-U.getTimezoneOffset())*1e3;return Math.floor(w/864e5)}function Vr(U,R){var u=new Date(Date.UTC(U.getFullYear(),U.getMonth(),U.getDate())),w=u.getUTCDay()||7;u.setUTCDate(u.getUTCDate()+4-w);var $=new Date(Date.UTC(u.getUTCFullYear(),0,1));return Math.ceil(((u.getTime()-$.getTime())/864e5+1)/7)}function ts(U,R){var u=Vr(new Date(U.getFullYear(),U.getMonth(),1)),w=Vr(U);return w==1&&(w=53),w-u+1}function Os(U,R,u,w){u===void 0&&(u=1),w===void 0&&(w=!1);var $=new Date(R,0,4,0,0,0,0);return w&&$.setUTCFullYear(R),7*U+u-(($.getDay()||7)+3)}function Rs(U,R){return U>12?U-=12:U===0&&(U=12),Te(R)?U+(R-1):U}function Ia(U,R,u,w){if(R===void 0&&(R=!1),u===void 0&&(u=!1),w===void 0&&(w=!1),w)return R?"Coordinated Universal Time":"UTC";var $=U.toLocaleString("UTC"),G=U.toLocaleString("UTC",{timeZoneName:R?"long":"short"}).substr($.length);return u===!1&&(G=G.replace(/ (standard|daylight|summer|winter) /i," ")),G}function cl(U,R){return Math.floor(Math.random()*(R-U))+U}function Ng(U,R,u){return U>u?u:Uu||U1&&$.pop(),es($,G),u.path=$.join("/"),u.path!==""&&u.path[0]!=="/")throw new Error("URL path must start with /")}return u.query=w.query,u.hash=w.hash,Rn(u)}return Rn(w)}function JS(){return!!window.MSInputMethodContext&&!!document.documentMode}function yh(U){return+U}function pI(U){return U*U}function p3(U){return U*(2-U)}function Bh(U){return((U*=2)<=1?U*U:--U*(2-U)+1)/2}function L$(U,R){return Math.pow(U,R)}function So(U,R){return 1-Math.pow(1-U,R)}function v1(U,R){return((U*=2)<=1?Math.pow(U,R):2-Math.pow(2-U,R))/2}function Qm(U){return L$(U,3)}function b4(U){return So(U,3)}function N$(U){return v1(U,3)}function fI(U){return Math.pow(2,10*U-10)}function mI(U){return 1-Math.pow(2,-10*U)}function B0(U){return((U*=2)<=1?Math.pow(2,10*U-10):2-Math.pow(2,10-10*U))/2}function Dy(U){return 1-Math.cos(U*pe)}function w4(U){return Math.sin(U*pe)}function gI(U){return(1-Math.cos(Ne*U))/2}function x4(U){return U*U*U}function $v(U){return--U*U*U+1}function Ma(U){return((U*=2)<=1?U*U*U:(U-=2)*U*U+2)/2}function tz(U){return 1-Math.sqrt(1-U*U)}function tn(U){return Math.sqrt(1- --U*U)}function S4(U){return((U*=2)<=1?1-Math.sqrt(1-U*U):Math.sqrt(1-(U-=2)*U)+1)/2}pi.registeredClasses["ease.linear"]=yh,pi.registeredClasses["ease.quadIn"]=pI,pi.registeredClasses["ease.quadOut"]=p3,pi.registeredClasses["ease.quadInOut"]=Bh,pi.registeredClasses["ease.polyIn"]=L$,pi.registeredClasses["ease.polyOut"]=So,pi.registeredClasses["ease.polyInOut"]=v1,pi.registeredClasses["ease.polyIn3"]=Qm,pi.registeredClasses["ease.polyOut3"]=b4,pi.registeredClasses["ease.polyInOut3"]=N$,pi.registeredClasses["ease.expIn"]=fI,pi.registeredClasses["ease.expOut"]=mI,pi.registeredClasses["ease.expInOut"]=B0,pi.registeredClasses["ease.sinIn"]=Dy,pi.registeredClasses["ease.sinOut"]=w4,pi.registeredClasses["ease.sinInOut"]=gI,pi.registeredClasses["ease.cubicIn"]=x4,pi.registeredClasses["ease.cubicOut"]=$v,pi.registeredClasses["ease.cubicInOut"]=Ma,pi.registeredClasses["ease.circleIn"]=tz,pi.registeredClasses["ease.circleOut"]=tn,pi.registeredClasses["ease.circleInOut"]=S4;var yI=7.5625;function Aa(U){return 1-vI(1-U)}function vI(U){return(U=+U)<.36363636363636365?yI*U*U:U<.7272727272727273?yI*(U-=.5454545454545454)*U+.75:U<.9090909090909091?yI*(U-=.8181818181818182)*U+.9375:yI*(U-=.9545454545454546)*U+.984375}function f3(U){return((U*=2)<=1?1-vI(1-U):vI(U-1)+1)/2}pi.registeredClasses["ease.bounceIn"]=Aa,pi.registeredClasses["ease.bounceOut"]=vI,pi.registeredClasses["ease.bounceInOut"]=f3;var m3=.3/(2*Math.PI),g3=Math.asin(1)*m3;function C4(U){return 1*Math.pow(2,10*--U)*Math.sin((g3-U)/m3)}function k$(U){return 1-1*Math.pow(2,-10*(U=+U))*Math.sin((U+g3)/m3)}function iz(U){return((U=2*U-1)<0?1*Math.pow(2,10*U)*Math.sin((g3-U)/m3):2-1*Math.pow(2,-10*U)*Math.sin((g3+U)/m3))/2}pi.registeredClasses["ease.elasticIn"]=C4,pi.registeredClasses["ease.elasticOut"]=k$,pi.registeredClasses["ease.elasticInOut"]=iz;var Qr=function(U){function R(){var u=U.call(this)||this;return u.transitionDuration=0,u.transitionEasing=$v,u.properties={},u.propertyFields={},u.filters=new to,u.isTemplate=!1,u.className="SpriteState",u._disposers.push(new ua(u.filters)),u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"adapter",{get:function(){var u=this;return this._adapterO||(this._adapterO=new uc(this),this._adapterO.events.on("inserted",function(w){u[w.newValue.key]=u[w.newValue.key]},void 0,!1),this._adapterO.events.on("removed",function(w){u[w.newValue.key]=u[w.newValue.key]},void 0,!1)),this._adapterO},enumerable:!0,configurable:!0}),R.prototype.getPropertyValue=function(u){var w=this.properties[u],$=this.sprite;if($){var G=this.propertyFields[u];if(Te(G)&&($.dataItem&&(w=$.dataItem.dataContext[G]),w==null&&(w="__unset")),Te(w))this._adapterO&&(w=this._adapterO.apply(u,w));else{var K=$.getPropertyValue(u);(w=this._adapterO?this._adapterO.apply(u,K):K)==K&&(w=void 0)}}return w},R.prototype.copyFrom=function(u){u&&u!=this&&(this.transitionDuration=u.transitionDuration,this.transitionEasing=u.transitionEasing,pn(u.properties,this.properties),pn(u.propertyFields,this.propertyFields),this.filters.copyFrom(u.filters),u._adapterO&&this.adapter.copyFrom(u._adapterO))},Object.defineProperty(R.prototype,"allValues",{get:function(){var u=this,w={};return yi(this.properties,function($,G){w[$]=u.getPropertyValue($)}),this._adapterO&&yi(this._adapterO.keys(),function($,G){var K=u.getPropertyValue(G);w[G]=K}),yi(this.propertyFields,function($){var G=u.getPropertyValue($);w[$]=G}),w},enumerable:!0,configurable:!0}),R.prototype.reset=function(){this.properties={},this.filters.clear()},R.prototype.processConfig=function(u){Te(u)&&Te(u.properties)&&yi(u.properties,function(w,$){ct($)&&($.match(/^[0-9.\-]+\%$/)?u.properties[w]=de(Et($)):$.match(/^\#[0-9abcdef]{3,}$/i)&&(u.properties[w]=Tt($)))}),U.prototype.processConfig.call(this,u)},R.prototype.asFunction=function(u){return u=="transitionEasing"||U.prototype.asIs.call(this,u)},R}(Yt);pi.registeredClasses.SpriteState=Qr;var rz=function(U){function R(){var u=U!==null&&U.apply(this,arguments)||this;return u._interactionEvents=new Ea,u}return ie(R,U),R.prototype._dispatchSpriteEvent=function(u){if(!this.target.disabled&&!this.target.isTemplate&&this.target.events.isEnabled(u.type)){var w=Or(u,{target:this.target});this.target.events.dispatchImmediately(w.type,w)}},R.prototype._dispatchSpritePointEvent=function(u){if(!this.target.disabled&&!this.target.isTemplate&&this.target.events.isEnabled(u.type)){var w=Or(u,{target:this.target,spritePoint:u.point?Lb(u.point,this.target):void 0,svgPoint:this.target.getSvgPoint(u.point)});this.target.events.dispatchImmediately(w.type,w)}},R.prototype._addInteractionObjectEvent=function(u,w,$,G){var K=this,re=G+"-"+u;return this._interactionEvents.insertKeyIfEmpty(re,function(){var ue=K.target.interactions.events.on(u,w,$,G);return new Cs(function(){K._interactionEvents.removeKey(re),ue.dispose()})}).increment()},R.prototype._on=function(u,w,$,G,K,re){var ue=U.prototype._on.call(this,u,w,$,G,K,re),we=[ue.disposer];switch(w){case"hit":case"track":case"doublehit":case"wheel":case"wheelup":case"wheeldown":case"wheelleft":case"wheelright":we.push(this._addInteractionObjectEvent(w,this._dispatchSpritePointEvent,this,K));break;case"rightclick":case"down":case"up":case"drag":case"dragged":case"dragstart":case"dragstop":case"over":case"out":case"swipe":case"swipeleft":case"swiperight":case"resize":case"focus":case"blur":case"toggled":we.push(this._addInteractionObjectEvent(w,this._dispatchSpriteEvent,this,K))}switch(w){case"hit":case"doublehit":case"rightclick":case"down":case"up":this.target.clickable=!0;break;case"toggled":this.target.togglable=!0;break;case"drag":case"dragstart":case"dragstop":this.target.draggable=!0;break;case"track":this.target.trackable=!0;break;case"resize":this.target.resizable=!0;break;case"swipe":case"swipeleft":case"swiperight":this.target.swipeable=!0;break;case"wheel":case"wheelup":case"wheeldown":case"wheelleft":case"wheelright":this.target.wheelable=!0;break;case"over":this.target.hoverable=!0;case"out":this.target.hoverable=!0;break;case"focus":case"blur":this.target.focusable=!0}return ue.disposer=new jn(we),ue},R}(vt),T4=function(){function U(){}return U.opacity=1,U.strokeOpacity=1,U.strokeWidth=1,U.fillOpacity=1,U.fill=He("#000000"),U.stroke=He("#000000"),U.focusable=void 0,U.tabindex=0,U}(),rp={verbose:!0,commercialLicense:!1,classNamePrefix:"amcharts-",autoSetClassName:!1,minPolylineStep:.5,onlyShowOnViewport:!1,queue:!1,autoDispose:!1,licenses:[],suppressErrors:!1,suppressWarnings:!1,animationsEnabled:!0,nonce:"",deferredDelay:100,disableHoverOnTransform:"never",pixelPerfectPrecision:0};function Nb(U,R){var u=!1,w=Date.now();return Cn(function $(G){if(!u){var K=G-w;K>=U?R(1):(Cn($),R(K/U))}}),new Kr(function(){u=!0})}function nz(U,R,u){return R+(u-R)*U}function $$(U,R,u){return new J(nz(U,R.percent,u.percent))}function _I(U,R,u){var w=new Ee(Jt(R.rgb,u.rgb,U));return R.alpha!=u.alpha&&(w.alpha=R.alpha+(u.alpha-R.alpha)*U),w}function sz(U,R){return R+U.charAt(0).toUpperCase()+U.substr(1)}var B$,Dx=function(){function U(R){this._disposer=new Kr(function(){for(;R.length!==0;)R[0].dispose()})}return U.prototype.isDisposed=function(){return this._disposer.isDisposed()},U.prototype.dispose=function(){this._disposer.dispose()},U}(),_m=function(U){function R(u,w,$,G){var K=U.call(this)||this;return K.duration=0,K.easing=yh,K.progress=0,K._loop=0,K._pause=!1,K._delayTimeout=null,K._time=0,K._isFinished=!1,K.className="Animation",K.object=u,K.animationOptions=Zi(w),K.duration=$,G&&(K.easing=G),K.applyTheme(),K}return ie(R,U),R.prototype.debug=function(){},R.prototype.dispose=function(){U.prototype.dispose.call(this),this.pause()},R.prototype.delay=function(u){var w=this;if(u>0){this.pause(),Xr(this.object.animations,this);var $=setTimeout(function(){w._delayTimeout=null,w.start()},u);this._delayTimeout=new Kr(function(){clearTimeout($)})}return this},R.prototype._start=function(){this._isFinished=!1,this._delayTimeout&&(this.removeDispose(this._delayTimeout),this._delayTimeout=null),this.stopSameAnimations(),this._pause=!1,Xr(ca.animations,this),Xr(this.object.animations,this),ca.requestFrame()},R.prototype.start=function(){this._start(),this._startTime=Date.now(),this._time=0,this.staticOptions=[];for(var u=this.animationOptions.length-1;u>=0;u--){var w=this.animationOptions[u];if(Te(w.from)||(w.childObject?w.from=w.childObject[w.property]:(w.from=this.object[w.property],Te(w.from)||(w.from=T4[w.property]))),w.from==w.to)ji(this.animationOptions,w);else if(!Te(w.from)||!(w.from instanceof J)&&w.to instanceof J||w.from instanceof J&&!(w.to instanceof J))this.staticOptions.push(w),ji(this.animationOptions,w);else if(ae(w.to))if(w.updateMethod=nz,w.from instanceof J){var $=this.object[sz(w.property,"pixel")];isNaN($)?(this.staticOptions.push(w),ji(this.animationOptions,w)):w.from=$}else isNaN(w.from)&&(this.staticOptions.push(w),ji(this.animationOptions,w));else w.to instanceof Ee?w.from?w.updateMethod=_I:(this.staticOptions.push(w),ji(this.animationOptions,w)):w.to instanceof J?(w.updateMethod=$$,isNaN(w.from)||($=this.object[sz(w.property,"relative")],isNaN($)||(w.from=de(100*$)))):(this.staticOptions.push(w),ji(this.animationOptions,w))}if(this.applyStaticOptions(),this.events.isEnabled("animationstarted")){var G={type:"animationstarted",target:this,progress:this.progress};this.events.dispatchImmediately("animationstarted",G)}return this.update(),this.duration===0&&this.end(),this},R.prototype.loop=function(u){return ae(u)||(u=1/0),this._loop=u,this},R.prototype.pause=function(){return this._pause=!0,this._delayTimeout&&(this.removeDispose(this._delayTimeout),this._delayTimeout=null),ji(ca.animations,this),ji(this.object.animations,this),this},R.prototype.resume=function(){return this._start(),this._startTime=Date.now()-this._time,this},R.prototype.end=function(){if(this._loop==0&&this.pause(),this.setProgress(1),this.applyStaticOptions(),this.events.isEnabled("animationended")){var u={type:"animationended",target:this,progress:this.progress};this.events.dispatchImmediately("animationended",u)}return this._loop>0?(this._loop--,this.start()):(this.stop(),this._isFinished=!0),this},R.prototype.kill=function(){this.pause(),this._isFinished=!0},R.prototype.isFinished=function(){return this._isFinished},R.prototype.applyStaticOptions=function(){var u=this;wi(this.staticOptions,function(w){w.childObject?w.childObject[w.property]=u.progress==1?w.to:w.from:u.object[w.property]=u.progress==1?w.to:w.from})},R.prototype.stop=function(u){if(this.pause(),!u&&this.events.isEnabled("animationstopped")){var w={type:"animationstopped",target:this,progress:this.progress};this.events.dispatchImmediately("animationstopped",w)}return this},R.prototype.setProgress=function(u){var w=this;if(this._time=this.duration*u,wi(this.animationOptions,function(G){if(G.updateMethod&&Te(G.from)){var K=G.updateMethod(u,G.from,G.to);G.childObject?G.childObject[G.property]=K:w.object[G.property]=K}}),this.progress=u,this.events.isEnabled("animationprogress")){var $={type:"animationprogress",target:this,progress:this.progress};this.events.dispatchImmediately("animationprogress",$)}ca.requestFrame()},R.prototype.update=function(){if(!this._pause){var u=void 0;this._time=nt(Date.now()-this._startTime,0,this.duration);var w=this._time/this.duration;u=this.easing(w),(this.duration==0||!ae(u)||w>=1)&&(u=1),this.setProgress(u),ze(this._time/this.duration,6)==1&&this.end()}return this},Object.defineProperty(R.prototype,"delayed",{get:function(){return!!this._delayTimeout},enumerable:!0,configurable:!0}),R.prototype.stopSameAnimations=function(){var u=this;wi(W(this.object.animations),function(w){if(w!==u&&!w.delayed){var $=[];wi(u.animationOptions,function(G){wi(w.animationOptions,function(K){G.property==K.property&&G.childObject==K.childObject&&($.push(K),w.animationOptions.length==0&&w.kill())})}),wi($,function(G){ji(w.animationOptions,G)})}})},R.prototype.asFunction=function(u){return u=="easing"||U.prototype.asIs.call(this,u)},R}(bi),Rf="http://www.w3.org/2000/svg",y3="http://www.w3.org/2000/xmlns/",bI="http://www.w3.org/1999/xlink";function uh(U,R,u,w){return U.addEventListener(R,u,w||!1),new Kr(function(){U.removeEventListener(R,u,w||!1)})}function V$(U){if(ct(U)){var R=document.getElementById(U);if(R==null&&(R=document.getElementsByClassName(U)[0]),R instanceof HTMLElement)return R}else if(U instanceof HTMLElement)return U}function kb(U,R){if(U)if(U.classList)wi(R.split(" "),function(w){U.classList.add(w)});else{var u=U.getAttribute("class");u?U.setAttribute("class",u.split(" ").filter(function(w){return w!==R}).join(" ")+" "+R):U.setAttribute("class",R)}}function ZS(U,R){if(U)if(U.classList)U.classList.remove(R);else{var u=U.getAttribute("class");u&&U.setAttribute("class",u.split(" ").filter(function(w){return w!==R}).join(" "))}}function oz(U,R,u){U.style[R]=u}function E4(U,R){return U.currentStyle?U.currentStyle[R]:document.defaultView.getComputedStyle(U,null).getPropertyValue(R)}function QS(){if(document.activeElement&&document.activeElement!=document.body)if(document.activeElement.blur)document.activeElement.blur();else{var U=document.createElement("button");U.style.position="fixed",U.style.top="0px",U.style.left="-10000px",document.body.appendChild(U),U.focus(),U.blur(),document.body.removeChild(U)}}function I4(U){if(U instanceof HTMLElement)U.focus();else{var R=document.createElement("input"),u=document.createElementNS(Rf,"foreignObject");u.appendChild(R),U.appendChild(u),R.focus(),R.disabled=!0,u.remove()}}function wI(U){if(U.outerHTML)return U.outerHTML;var R=document.createElement("div"),u=U.cloneNode(!0);return R.appendChild(u),R.innerHTML}function _1(U){return U instanceof Object&&U&&U.nodeType===1}function az(U,R){for(var u=R;;){if(U===u)return!0;if(u.parentNode==null){if(u.host==null)return!1;u=u.host}else u=u.parentNode}}function $b(U){for(var R=U;;){if(R.parentNode==null)return R.host!=null?R:null;R=R.parentNode}}function np(U){for(var R=U.ownerDocument,u=U;;){if(u.parentNode==null)return u===R||u.host!=null?u:null;u=u.parentNode}}function Vh(U,R){wi(U.attributes,function(u){u.value!=null&&R.setAttribute(u.name,u.value)})}function j$(U){Gn(function(){try{var R=U.getBoundingClientRect(),u=R.left-Math.round(R.left),w=R.top-Math.round(R.top);u!==0&&Po(function(){U.style.left=u+"px"}),w!==0&&Po(function(){U.style.top=w+"px"})}catch{}})}var Ys=function(U){function R(u,w,$){var G=this,K=function(re){return re==null?(Te(B$)||((ue=document.createElement("style")).type="text/css",document.head.appendChild(ue),B$=ue.sheet),B$):((ue=document.createElement("style")).type="text/css",re.appendChild(ue),ue.sheet);var ue}(u);return(G=U.call(this,function(){var re=Ni(K.cssRules,G._rule);if(re===-1)throw new Error("Could not dispose StyleRule");K.deleteRule(re)})||this)._rule=function(re,ue){var we=re.cssRules.length;return re.insertRule(ue+"{}",we),re.cssRules[we]}(K,w),yi($,function(re,ue){G.setStyle(re,ue)}),G}return ie(R,U),Object.defineProperty(R.prototype,"selector",{get:function(){return this._rule.selectorText},set:function(u){this._rule.selectorText=u},enumerable:!0,configurable:!0}),R.prototype._setVendorPrefixName=function(u,w){var $=this._rule.style;$.setProperty("-webkit-"+u,w,""),$.setProperty("-moz-"+u,w,""),$.setProperty("-ms-"+u,w,""),$.setProperty("-o-"+u,w,""),$.setProperty(u,w,"")},R.prototype.setStyle=function(u,w){u==="transition"?this._setVendorPrefixName(u,w):this._rule.style.setProperty(u,w,"")},R}(Kr),lz=0,G$=function(U){function R(u,w,$){var G=this,K=Te($)?$:"__style_"+ ++lz+"__";return(G=U.call(this,u,"."+K,w)||this)._className=K,G}return ie(R,U),Object.defineProperty(R.prototype,"className",{get:function(){return this._className},set:function(u){this._className=u,this.selector="."+u},enumerable:!0,configurable:!0}),R.prototype.toString=function(){return this._className},R}(Ys);function xI(U){if(document.readyState!=="loading")U();else{var R=function(){document.readyState!=="loading"&&(document.removeEventListener("readystatechange",R),U())};document.addEventListener("readystatechange",R)}}function v3(U){var R=E4(U,"font-family");if(R)return R;var u=U.parentElement||U.parentNode;return u?v3(u):void 0}function _3(U){var R=E4(U,"font-size");if(R)return R;var u=U.parentElement||U.parentNode;return u?_3(u):void 0}function SI(U,R){var u=U.getBoundingClientRect(),w=wt(R)?R:R?[R]:[];if(w.length){for(var $=0;$=0&&u.left>=0&&u.top<=K.top+K.height&&u.left<=K.left+K.width)return!0}return!1}return u.top>=0&&u.left>=0&&u.top<=(window.innerHeight||document.documentElement.clientHeight)&&u.left<=(window.innerWidth||document.documentElement.clientWidth)}var CI=function(){function U(R){this._isDisposed=!1,this._x=0,this._y=0,this._rotationY=0,this._rotationX=0,this._rotation=0,this._scale=1,this.node=typeof R=="string"?document.createElementNS(Rf,R):R}return U.prototype.removeNode=function(){this.node&&this.node.parentNode&&this.node.parentNode.removeChild(this.node)},Object.defineProperty(U.prototype,"transformString",{get:function(){if(this.node)return this._transformString},enumerable:!0,configurable:!0}),U.prototype.transform=function(){var R="translate("+this._x+","+this._y+")";if(this._scale!=1&&(R+=(R?" ":"")+"scale("+this._scale+")"),this._rotation!=0){var u="rotate("+this._rotation+")";this._rotationX&&this._rotationY&&(u="rotate("+this._rotation+" "+this._rotationX+" "+this._rotationY+")"),R+=(R?" ":"")+u}this._transformString=R,this.node.setAttribute("transform",R)},U.prototype.getBBox=function(){var R={width:0,height:0,x:0,y:0};if(this.node&&this.node.parentNode)try{var u=this.node.getBBox();R.x=u.x,R.y=u.y,R.width=u.width,R.height=u.height}catch{}return R},U.prototype.moveTo=function(R){if(R){var u=R.x,w=R.y;this._x==u&&this._y==w||(this._x=u,this._y=w,this.transform())}},Object.defineProperty(U.prototype,"content",{get:function(){return this.node.innerHTML||""},set:function(R){this.node.innerHTML=R},enumerable:!0,configurable:!0}),Object.defineProperty(U.prototype,"textContent",{get:function(){return this.node.textContent||""},set:function(R){this.node.textContent=R},enumerable:!0,configurable:!0}),Object.defineProperty(U.prototype,"x",{get:function(){return this._x},set:function(R){this._x!=R&&(this._x=R,this.transform())},enumerable:!0,configurable:!0}),Object.defineProperty(U.prototype,"y",{get:function(){return this._y},set:function(R){this._y!=R&&(this._y=R,this.transform())},enumerable:!0,configurable:!0}),Object.defineProperty(U.prototype,"rotation",{get:function(){return this._rotation},set:function(R){this._rotation!=R&&(this._rotation=R,this.transform())},enumerable:!0,configurable:!0}),Object.defineProperty(U.prototype,"rotationX",{get:function(){return this._rotationX},set:function(R){this._rotationX!=R&&(this._rotationX=R,this.transform())},enumerable:!0,configurable:!0}),Object.defineProperty(U.prototype,"rotationY",{get:function(){return this._rotationY},set:function(R){this._rotationY!=R&&(this._rotationY=R,this.transform())},enumerable:!0,configurable:!0}),Object.defineProperty(U.prototype,"scale",{get:function(){return this._scale},set:function(R){this._scale!=R&&(this._scale=R,this.transform())},enumerable:!0,configurable:!0}),U.prototype.removeAttr=function(R){this.node.removeAttribute(R)},U.prototype.attr=function(R){var u=this;return yi(R,function(w,$){Te($)?u.node.setAttribute(w,$):u.node.removeAttribute(w)}),this},U.prototype.getAttr=function(R){return this.node.getAttribute(R)},U.prototype.attrNS=function(R,u,w){return this.node.setAttributeNS(R,u,w),this},U.prototype.getAttrNS=function(R,u){return this.node.getAttributeNS(R,u)},U.prototype.removeStyle=function(R){this.node.style[R]=null,delete this.node.style[R]},U.prototype.getStyle=function(R){return this.node.style[R]},U.prototype.addStyle=function(R){var u=this;return yi(R,function(w,$){Te($)?u.node.style[w]=$:u.removeStyle(w)}),this},U.prototype.addClass=function(R){kb(this.node,R)},U.prototype.removeClass=function(R){ZS(this.node,R)},U.prototype.setClass=function(R){this.node.setAttribute("class",R)},U.prototype.removeChildNodes=function(){for(;this.node.childNodes.length>0;)this.node.removeChild(this.node.firstChild)},U.prototype.isDisposed=function(){return this._isDisposed},U.prototype.dispose=function(){this.removeNode()},U}(),A4=function(U){function R(u){return U.call(this,u)||this}return ie(R,U),R.prototype.add=function(u){u&&this.node.appendChild(u.node)},R.prototype.addToBack=function(u){if(u){var w=this.node.childNodes[0];w?w!=u.node&&this.node.insertBefore(u.node,w):this.node.appendChild(u.node)}},R.prototype.removeElement=function(u){if(u)try{u.node&&u.node.parentNode==this.node&&this.node.removeChild(u.node)}catch{}},R.prototype.hasChild=function(u){for(var w=0;w0;){var u=this.node.firstChild;u&&u.parentNode&&u.parentNode.removeChild(u)}},R.prototype.removeChildrenByTag=function(u){if(this.node.childNodes)for(var w=this.node.getElementsByTagName(u),$=0;$-1&&(this.focusable=!0),Zs().processFocusable(this))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"element",{get:function(){return this._element},set:function(u){this._element=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"originalPosition",{get:function(){return this._originalPosition||{x:0,y:0}},set:function(u){this._originalPosition=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"originalScale",{get:function(){return pt(this._originalScale,1)},set:function(u){this._originalScale!==u&&(this._originalScale=u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"originalAngle",{get:function(){return pt(this._originalAngle,0)},set:function(u){this._originalAngle!==u&&(this._originalAngle=u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"inertiaOptions",{get:function(){return this.sprite&&this.sprite._adapterO?this.sprite._adapterO.apply("inertiaOptions",this._inertiaOptions):this._inertiaOptions},set:function(u){this._inertiaOptions=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"hitOptions",{get:function(){return this.sprite&&this.sprite._adapterO?this.sprite._adapterO.apply("hitOptions",this._hitOptions):this._hitOptions},set:function(u){this._hitOptions=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"hoverOptions",{get:function(){return this.sprite&&this.sprite._adapterO?this.sprite._adapterO.apply("hoverOptions",this._hoverOptions):this._hoverOptions},set:function(u){this._hoverOptions=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"swipeOptions",{get:function(){return this.sprite&&this.sprite._adapterO?this.sprite._adapterO.apply("swipeOptions",this._swipeOptions):this._swipeOptions},set:function(u){this._swipeOptions=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"keyboardOptions",{get:function(){return this.sprite&&this.sprite._adapterO?this.sprite._adapterO.apply("keyboardOptions",this._keyboardOptions):this._keyboardOptions},set:function(u){this._keyboardOptions=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"mouseOptions",{get:function(){return this.sprite&&this.sprite._adapterO?this.sprite._adapterO.apply("mouseOptions",this._mouseOptions):this._mouseOptions},set:function(u){this._mouseOptions=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cursorOptions",{get:function(){return this.sprite&&this.sprite._adapterO?this.sprite._adapterO.apply("cursorOptions",this._cursorOptions):this._cursorOptions},set:function(u){this._cursorOptions=u},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.inertiaOptions=u.inertiaOptions,this.hitOptions=u.hitOptions,this.hoverOptions=u.hoverOptions,this.swipeOptions=u.swipeOptions,this.keyboardOptions=u.keyboardOptions,this.cursorOptions=u.cursorOptions,this.contextMenuDisabled=u.contextMenuDisabled,Zs().applyCursorOverStyle(this)},R.prototype.setEventDisposer=function(u,w,$){var G=this.eventDisposers.getKey(u);w?G==null&&this.eventDisposers.setKey(u,$()):G!=null&&(G.dispose(),this.eventDisposers.removeKey(u))},R.prototype.dispose=function(){U.prototype.dispose.call(this);var u=Zs();u.overObjects.removeValue(this),u.downObjects.removeValue(this),u.trackedObjects.removeValue(this),u.transformedObjects.removeValue(this),this.isHover&&this.wheelable&&u.unlockWheel(),u.focusedObject===this&&(u.focusedObject=void 0)},R}(bi),z$=function(){function U(R,u){this._disposed=!1,this.directionX=0,this.directionY=0,this.interaction=R,this.keyboardEvent=u,this._startedOn=new Date().getTime(),Zs().processDragStart(R),ca.animations.push(this),this.update()}return U.prototype.update=function(){var R=this.interaction,u=Zs().getKeyboardOption(R,"speed"),w=Zs().getKeyboardOption(R,"accelleration"),$=Zs().getKeyboardOption(R,"accellerationDelay"),G={x:0,y:0};this.keyboardEvent.shiftKey?(u*=.5,w=1):this.keyboardEvent.ctrlKey&&(u*=2);var K=new Date().getTime()-this._startedOn,re=K-$;if(w>0&&re>0){var ue=K/$;K=$,G.x+=this.directionX*(u*w*ue*re),G.y+=this.directionY*(u*w*ue*re)}G.x+=this.directionX*(u*K),G.y+=this.directionY*(u*K),Zs().handleTransformMove(R,G,{x:0,y:0},this.keyboardEvent,!0,!1)},U.prototype.isDisposed=function(){return this._disposed},U.prototype.dispose=function(){this._disposed||(Zs().processDragStop(this.interaction),ji(ca.animations,this))},U}(),P4=function(U){function R(u,w,$,G){var K=U.call(this)||this;return K.animations=[],K.className="Inertia",K.interaction=u,K.type=w,K.point=$,K.startPoint=G,K._disposers.push(new Dx(K.animations)),K}return ie(R,U),Object.defineProperty(R.prototype,"x",{get:function(){return this.point.x},set:function(u){ae(u)&&(this.point.x=u,this.handleMove())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"y",{get:function(){return this.point.y},set:function(u){ae(u)&&(this.point.y=u,this.handleMove())},enumerable:!0,configurable:!0}),R.prototype.handleMove=function(){if(this.interaction.events.isEnabled("drag")){var u={type:"drag",target:this.interaction,shift:{x:this.x-this.startPoint.x,y:this.y-this.startPoint.y},startPoint:this.startPoint,point:{x:this.x,y:this.y},touch:!1};this.interaction.events.dispatchImmediately("drag",u)}},R.prototype.done=function(){this.interaction.inertias.removeKey(this.type),this.type==="move"&&Zs().processDragStop(this.interaction),this.dispose()},R}(Yt),uz=function(){function U(){}return U.prototype.getEventKey=function(R){var u;switch(R.keyCode||R.which){case 38:u="up";break;case 40:u="down";break;case 37:u="left";break;case 39:u="right";break;case 13:u="enter";break;case 27:u="esc";break;case 36:case 36:u="home";break;case 35:case 35:u="end";break;case 9:u="tab";break;case 17:u="ctrl";break;case 18:u="alt";break;case 16:u="shift";break;case 32:u="space";break;case 33:u="pgup";break;case 34:u="pgdn";break;case 45:u="ins";break;case 46:u="del";break;case 107:u="plus";break;case 109:u="minus";break;default:u="other"}return u},U.prototype.isKey=function(R,u){var w=this.getEventKey(R);return ct(u)&&(u=[u]),u.indexOf(w)!==-1},U.prototype.shiftKey=function(R){return R.shiftKey},U.prototype.ctrlKey=function(R){return R.ctrlKey},U.prototype.altKey=function(R){return R.altKey},U.prototype.metaKey=function(R){return R.metaKey},U}(),kg=new uz,O4={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6};function R4(U){switch(U){case"year":return;case"month":return"year";case"week":case"day":return"month";case"hour":return"day";case"minute":return"hour";case"second":return"minute";case"millisecond":return"second"}}function Uu(U,R){return Te(R)||(R=1),O4[U]*R}function TI(){return new Date}function eg(){return TI().getTime()}function eC(U){return new Date(U.getTime())}function EI(U,R,u,w){U=new Date(U.getTime()),R=new Date(R.getTime());var $=0,G=0;w||u=="millisecond"||($=U.getTimezoneOffset(),U.setUTCMinutes(U.getUTCMinutes()-$),G=R.getTimezoneOffset(),R.setUTCMinutes(R.getUTCMinutes()-G));var K=!1;switch(u){case"year":U.getUTCFullYear()!=R.getUTCFullYear()&&(K=!0);break;case"month":(U.getUTCFullYear()!=R.getUTCFullYear()||U.getUTCMonth()!=R.getUTCMonth())&&(K=!0);break;case"day":(U.getUTCMonth()!=R.getUTCMonth()||U.getUTCDate()!=R.getUTCDate())&&(K=!0);break;case"hour":U.getUTCHours()!=R.getUTCHours()&&(K=!0);break;case"minute":U.getUTCMinutes()!=R.getUTCMinutes()&&(K=!0);break;case"second":U.getUTCSeconds()!=R.getUTCSeconds()&&(K=!0);break;case"millisecond":U.getTime()!=R.getTime()&&(K=!0)}if(K)return!0;var re=R4(u);return!!re&&(U.setUTCMinutes(U.getUTCMinutes()+$),R.setUTCMinutes(R.getUTCMinutes()+G),EI(U,R,re,w))}function Ap(U,R,u,w){var $=0;switch(w||R=="millisecond"||($=U.getTimezoneOffset(),U.setUTCMinutes(U.getUTCMinutes()-$)),R){case"day":var G=U.getUTCDate();U.setUTCDate(G+u);break;case"second":var K=U.getUTCSeconds();U.setUTCSeconds(K+u);break;case"millisecond":var re=U.getUTCMilliseconds();U.setUTCMilliseconds(re+u);break;case"hour":var ue=U.getUTCHours();U.setUTCHours(ue+u);break;case"minute":var we=U.getUTCMinutes();U.setUTCMinutes(we+u);break;case"year":var De=U.getUTCFullYear();U.setUTCFullYear(De+u);break;case"month":var Ve=U.getUTCMonth();U.setUTCMonth(Ve+u);break;case"week":var Ke=U.getUTCDate();U.setUTCDate(Ke+7*u)}if(!w&&R!="millisecond"&&(U.setUTCMinutes(U.getUTCMinutes()+$),R=="day"||R=="week"||R=="month"||R=="year")){var Qe=U.getTimezoneOffset();if(Qe!=$){var ft=Qe-$;U.setUTCMinutes(U.getUTCMinutes()+ft),U.getTimezoneOffset()!=Qe&&U.setUTCMinutes(U.getUTCMinutes()-ft)}}return U}function hd(U,R,u,w,$,G,K,re){K===void 0&&(K=0),ae(u)||(u=1);var ue=0;switch(re&&["day","month","week","year"].indexOf(R)!=-1&&(U=w3(U,re)),$||R=="millisecond"||(ue=U.getTimezoneOffset(),U.setUTCMinutes(U.getUTCMinutes()-ue)),R){case"day":var we=U.getUTCDate();if(u>1){if(G){G=hd(G,"day",1);var De=U.getTime()-G.getTime(),Ve=Math.floor(De/Uu("day")/u),Ke=Uu("day",Ve*u);U.setTime(G.getTime()+Ke-ue*Uu("minute"))}}else U.setUTCDate(we);U.setUTCHours(0,0,0,0);break;case"second":var Qe=U.getUTCSeconds();u>1&&(Qe=Math.floor(Qe/u)*u),U.setUTCSeconds(Qe,0);break;case"millisecond":if(u==1)return U;var ft=U.getUTCMilliseconds();ft=Math.floor(ft/u)*u,U.setUTCMilliseconds(ft);break;case"hour":var Gt=U.getUTCHours();u>1&&(Gt=Math.floor(Gt/u)*u),U.setUTCHours(Gt,K,0,0);break;case"minute":var ei=U.getUTCMinutes();ft=U.getUTCMilliseconds(),u>1&&(ei=Math.floor(ei/u)*u),U.setUTCMinutes(ei,0,0);break;case"month":var di=U.getUTCMonth();u>1&&(di=Math.floor(di/u)*u),U.setUTCMonth(di,1),U.setUTCHours(0,K,0,0);break;case"year":var ci=U.getUTCFullYear();u>1&&(ci=Math.floor(ci/u)*u),U.setUTCFullYear(ci,0,1),U.setUTCHours(0,K,0,0);break;case"week":var qi=U.getUTCDate(),rr=U.getUTCDay();ae(w)||(w=1),qi=rr>=w?qi-rr+w:qi-(7+rr)+w,U.setUTCDate(qi),U.setUTCHours(0,K,0,0)}if(!$&&R!="millisecond"&&(U.setUTCMinutes(U.getUTCMinutes()+ue),R=="day"||R=="week"||R=="month"||R=="year")){var Ii=U.getTimezoneOffset();if(Ii!=ue){var Ki=Ii-ue;U.setUTCMinutes(U.getUTCMinutes()+Ki)}}return U}function w3(U,R){return new Date(U.toLocaleString("en-US",{timeZone:R}))}function cz(U){var R=new Date;return R.setHours(0,0,0,0),w3(R,U).getMinutes()}var H$=function(U){function R(){var u=U.call(this)||this;return u._globalEventsAdded=!1,u._pointerEvents={pointerdown:"mousedown",pointerup:"mouseup",pointermove:"mousemove",pointercancel:"mouseup",pointerover:"mouseover",pointerout:"mouseout",wheel:"wheel"},u._usePointerEventsOnly=!1,u._useTouchEventsOnly=!1,u._addHoverEvents=!0,u._passiveSupported=!1,u._delayedEvents={out:[]},u.overObjects=new to,u.downObjects=new to,u.trackedObjects=new to,u.transformedObjects=new to,u.pointers=new Ea,u.inertiaOptions=new Ea,u.hitOptions={doubleHitTime:300,hitTolerance:10,noFocus:!0},u.hoverOptions={touchOutBehavior:"leave",touchOutDelay:1e3},u.swipeOptions={time:500,verticalThreshold:75,horizontalThreshold:30},u.keyboardOptions={speed:.1,accelleration:1.2,accellerationDelay:2e3},u.mouseOptions={sensitivity:1},u.className="Interaction",u.body=u.getInteraction(document.body),u._disposers.push(u.body),window.hasOwnProperty("PointerEvent")?(u._pointerEvents.pointerdown="pointerdown",u._pointerEvents.pointerup="pointerup",u._pointerEvents.pointermove="pointermove",u._pointerEvents.pointercancel="pointercancel",u._pointerEvents.pointerover="pointerover",u._pointerEvents.pointerout="pointerout"):window.hasOwnProperty("MSPointerEvent")?(u._pointerEvents.pointerdown="MSPointerDown",u._pointerEvents.pointerup="MSPointerUp",u._pointerEvents.pointermove="MSPointerMove",u._pointerEvents.pointercancel="MSPointerUp",u._pointerEvents.pointerover="MSPointerOver",u._pointerEvents.pointerout="MSPointerOut"):typeof matchMedia<"u"&&matchMedia("(pointer:fine)").matches?"ontouchstart"in window&&(u._addHoverEvents=!1,u._useTouchEventsOnly=!0):window.navigator.userAgent.match(/MSIE /)||u.fullFF()?u._usePointerEventsOnly=!0:u._useTouchEventsOnly=!0,"onwheel"in document.createElement("div")?u._pointerEvents.wheel="wheel":Te(document.onmousewheel)&&(u._pointerEvents.wheel="mousewheel"),u.inertiaOptions.setKey("move",{time:100,duration:500,factor:1,easing:b4}),u.inertiaOptions.setKey("resize",{time:100,duration:500,factor:1,easing:b4}),u._passiveSupported=R.passiveSupported,u.applyTheme(),u}return ie(R,U),R.prototype.fullFF=function(){return window.navigator.userAgent.match(/Firefox/)&&!window.navigator.userAgent.match(/Android/)},R.prototype.debug=function(){},R.prototype.addGlobalEvents=function(){var u=this;this._globalEventsAdded||(this._useTouchEventsOnly||(this._disposers.push(uh(document,this._pointerEvents.pointerdown,function(w){u.handleGlobalPointerDown(w)})),this._disposers.push(uh(document,this._pointerEvents.pointermove,function(w){u.handleGlobalPointerMove(w)})),this._disposers.push(uh(document,this._pointerEvents.pointerup,function(w){u.handleGlobalPointerUp(w)})),this._disposers.push(uh(document,this._pointerEvents.pointercancel,function(w){u.handleGlobalPointerUp(w,!0)})),this._disposers.push(uh(document,"mouseenter",function(w){Te(w.relatedTarget)||w.buttons!=0&&w.which!=0||u.handleDocumentLeave(w)}))),this._usePointerEventsOnly||(this._disposers.push(uh(document,"touchstart",function(w){u.handleGlobalTouchStart(w)})),this._disposers.push(uh(document,"touchmove",function(w){u.handleGlobalTouchMove(w)})),this._disposers.push(uh(document,"touchend",function(w){u.handleGlobalTouchEnd(w)}))),this._disposers.push(uh(document,"keydown",function(w){u.handleGlobalKeyDown(w)})),this._disposers.push(uh(document,"keyup",function(w){u.handleGlobalKeyUp(w)})),this._globalEventsAdded=!0)},R.prototype.processClickable=function(u){this.processTouchable(u)},R.prototype.processContextMenu=function(u){u.contextMenuDisabled?u.eventDisposers.hasKey("contextMenuDisabled")||u.eventDisposers.setKey("contextMenuDisabled",uh(u.element,"contextmenu",function(w){w.preventDefault()})):u.eventDisposers.hasKey("contextMenuDisabled")&&u.eventDisposers.getKey("contextMenuDisabled").dispose()},R.prototype.processHoverable=function(u){var w=this;if(u.hoverable||u.trackable)this.addGlobalEvents(),this.applyCursorOverStyle(u),!u.eventDisposers.hasKey("hoverable")&&this._addHoverEvents&&u.eventDisposers.setKey("hoverable",new jn([uh(u.element,this._pointerEvents.pointerout,function(G){return w.handlePointerOut(u,G)}),uh(u.element,this._pointerEvents.pointerover,function(G){return w.handlePointerOver(u,G)})])),u.trackable;else{var $=u.eventDisposers.getKey("hoverable");$!=null&&($.dispose(),u.eventDisposers.removeKey("hoverable"))}this.processTouchable(u)},R.prototype.processMovable=function(u){(u.draggable||u.swipeable||u.trackable||u.resizable)&&(this.isGlobalElement(u)||u.isTouchProtected||this.prepElement(u),this.applyCursorOverStyle(u)),this.processTouchable(u)},R.prototype.processTrackable=function(u){this.processHoverable(u),this.processMovable(u),u.trackable?this.trackedObjects.moveValue(u):this.trackedObjects.removeValue(u)},R.prototype.processDraggable=function(u){this.processMovable(u)},R.prototype.processSwipeable=function(u){this.processMovable(u)},R.prototype.processResizable=function(u){this.processMovable(u)},R.prototype.processWheelable=function(u){var w=this;if(u.wheelable)u.eventDisposers.hasKey("wheelable")||u.eventDisposers.setKey("wheelable",new jn([uh(u.element,this._pointerEvents.wheel,function(G){return w.handleMouseWheel(u,G)},!!this._passiveSupported&&{passive:!1}),u.events.on("out",function(G){u.wheelable&&w.unlockWheel()}),u.events.on("over",function(G){u.wheelable&&w.lockWheel()})]));else{var $=u.eventDisposers.getKey("wheelable");$!=null&&($.dispose(),u.eventDisposers.removeKey("wheelable"))}},R.prototype.processFocusable=function(u){var w=this;if(u.focusable===!0&&u.tabindex>-1&&!this._useTouchEventsOnly)u.eventDisposers.hasKey("focusable")||u.eventDisposers.setKey("focusable",new jn([uh(u.element,"focus",function(G){return w.handleFocus(u,G)}),uh(u.element,"blur",function(G){return w.handleBlur(u,G)}),uh(u.element,this._pointerEvents.pointerdown,function(G){return w.handleFocusBlur(u,G)}),uh(u.element,"touchstart",function(G){return w.handleFocusBlur(u,G)},!!this._passiveSupported&&{passive:!1})]));else{var $=u.eventDisposers.getKey("focusable");$!=null&&($.dispose(),u.eventDisposers.removeKey("focusable"))}},R.prototype.processTouchable=function(u){var w=this;if(u.clickable||u.hoverable||u.trackable||u.draggable||u.swipeable||u.resizable)this.addGlobalEvents(),u.eventDisposers.hasKey("touchable")||(this._useTouchEventsOnly||this._usePointerEventsOnly?this._useTouchEventsOnly?this._usePointerEventsOnly||u.eventDisposers.setKey("touchable",uh(u.element,"touchstart",function(G){return w.handleTouchDown(u,G)},!!this._passiveSupported&&{passive:!1})):u.eventDisposers.setKey("touchable",uh(u.element,this._pointerEvents.pointerdown,function(G){return w.handlePointerDown(u,G)})):u.eventDisposers.setKey("touchable",new jn([uh(u.element,this._pointerEvents.pointerdown,function(G){return w.handlePointerDown(u,G)}),uh(u.element,"touchstart",function(G){return w.handleTouchDown(u,G)},!!this._passiveSupported&&{passive:!1})])));else{var $=u.eventDisposers.getKey("touchable");$!=null&&($.dispose(),u.eventDisposers.removeKey("touchable"))}},R.prototype.handleFocus=function(u,w){if(u.focusable){if(u.isFocused=!0,u.events.isEnabled("focus")&&!ca.isPaused){var $={type:"focus",target:u,event:w};u.events.dispatchImmediately("focus",$)}}else w.preventDefault()},R.prototype.handleFocusBlur=function(u,w){u.focusable!==!1&&this.getHitOption(u,"noFocus")&&u.events.once("focus",function(){u.events.disableType("blur"),QS(),u.sprite&&u.sprite.handleBlur(),u.events.enableType("blur")})},R.prototype.handleBlur=function(u,w){if(u.focusable){if(u.isFocused=!1,u.events.isEnabled("blur")&&!ca.isPaused){var $={type:"blur",target:u,event:w};u.events.dispatchImmediately("blur",$)}}else w.preventDefault()},R.prototype.handleGlobalKeyDown=function(u){if(this.focusedObject){if(kg.isKey(u,"esc"))QS();else if(this.focusedObject.draggable&&kg.isKey(u,["up","down","left","right"])){u.preventDefault();var w=this.focusedObject,$="interactionKeyboardObject";if(w.eventDisposers.hasKey($))return;var G=new z$(w,u);switch(w.eventDisposers.setKey($,G),kg.getEventKey(u)){case"up":G.directionY=-1;break;case"down":G.directionY=1;break;case"left":G.directionX=-1;break;case"right":G.directionX=1}}}},R.prototype.handleGlobalKeyUp=function(u){var w="interactionKeyboardObject";if(this.focusedObject){var $=this.focusedObject.eventDisposers.getKey(w);$!=null&&(u.preventDefault(),$.dispose(),this.focusedObject.eventDisposers.removeKey(w));var G=this.focusedObject.sprite;kg.isKey(u,"enter")&&G&&(G.events.isEnabled("hit")||G.events.isEnabled("toggled")?this.focusedObject.dispatchImmediately("hit"):G.showTooltipOn=="hit"&&this.focusedObject.dispatchImmediately("up"))}},R.prototype.handleGlobalPointerMove=function(u){var w=this.getPointer(u);if(w.point=this.getPointerPoint(u),this.events.isEnabled("track")&&!ca.isPaused){var $={type:"track",target:this,event:u,pointer:w,touch:w.touch};this.events.dispatchImmediately("track",$)}this.addBreadCrumb(w,w.point),this.handleGlobalMove(w,u)},R.prototype.handleGlobalPointerDown=function(u){this.processDelayed();var w=this.getPointer(u);if(this.events.isEnabled("down")&&!ca.isPaused){var $={type:"down",target:this,event:u,pointer:w,touch:w.touch};this.events.dispatchImmediately("down",$)}},R.prototype.preventTouchAction=function(u){u.defaultPrevented||u.preventDefault()},R.prototype.handleGlobalPointerUp=function(u,w){w===void 0&&(w=!1);var $=this.getPointer(u);if(this.events.isEnabled("up")&&!ca.isPaused){var G={type:"up",target:this,event:u,pointer:$,touch:$.touch};this.events.dispatchImmediately("up",G)}this.handleGlobalUp($,u,w)},R.prototype.handleGlobalTouchMove=function(u){for(var w=0;w=G-this.getHitOption(u,"doubleHitTime")){if(G-u.lastHit<100)return;if(u.lastHit=void 0,u.lastHitPointer=void 0,u.events.isEnabled("doublehit")&&!ca.isPaused){var K={type:"doublehit",target:u,point:w.point,event:$,touch:w.touch};u.events.dispatchImmediately("doublehit",K)}}else u.lastHit=G,u.lastHitPointer=w,w.button===3?u.events.isEnabled("rightclick")&&!ca.isPaused&&(K={type:"rightclick",target:u,event:$},u.events.dispatchImmediately("rightclick",K)):u.events.isEnabled("hit")&&!ca.isPaused&&(K={type:"hit",target:u,event:$,point:w.point,touch:w.touch},u.events.dispatchImmediately("hit",K))},R.prototype.handleOver=function(u,w,$,G){if(u.hoverable){var K=!1;if(this.shouldCancelHovers(w)&&this.areTransformed()&&this.moved(w,this.getHitOption(u,"hitTolerance"))&&(K=!0,this.cancelAllHovers($)),this.processDelayed(),u.overPointers.moveValue(w),!u.isRealHover&&(K||(u.isHover=!0,u.isRealHover=!0,this.overObjects.moveValue(u)),this.handleTrack(this.body,w,$,!0),u.events.isEnabled("over")&&!ca.isPaused&&!K)){var re={type:"over",target:u,event:$,pointer:w,touch:w.touch};u.events.dispatchImmediately("over",re)}}},R.prototype.handleOut=function(u,w,$,G,K){var re=this;if(G===void 0&&(G=!1),K===void 0&&(K=!1),u.hoverable&&(u.overPointers.removeValue(w),u.isHover&&(!u.hasDelayedOut||K))){if(G&&u.overPointers.length)return;if(w&&w.touch&&!K&&!this.old(w)){var ue=this.getHoverOption(u,"touchOutBehavior");if(ue=="leave")return this._delayedEvents.out.push({type:"out",io:u,pointer:w,event:$,keepUntil:eg()+500}),void(u.hasDelayedOut=!0);if(ue=="delay"&&this.getHoverOption(u,"touchOutDelay"))return void this._delayedEvents.out.push({type:"out",io:u,pointer:w,event:$,keepUntil:eg()+500,timeout:this.setTimeout(function(){re.handleOut(u,w,$,!0)},this.getHoverOption(u,"touchOutDelay"))})}if(u.isHover=!1,this.overObjects.removeValue(u),!u.isDisposed()&&u.events.isEnabled("out")&&!ca.isPaused){var we={type:"out",target:u,event:$,pointer:w,touch:w.touch};u.events.dispatchImmediately("out",we)}u.overPointers.clear(),u.hasDelayedOut=!1}},R.prototype.processDelayed=function(){for(var u;u=this._delayedEvents.out.pop();)u.timeout&&u.timeout.dispose(),this.handleOut(u.io,u.pointer,u.event,!1,!0)},R.prototype.handleDown=function(u,w,$){if(this.maybePreventDefault(u,$,w),u.inert&&this.stopInertia(u),this.handleOver(u,w,$,!0),u.downPointers.moveValue(w),this.applyCursorDownStyle(u,w),u.isDown||(u.focusable!==!1&&this.getHitOption(u,"noFocus")&&this.focusedObject&&QS(),u.isDown=!0,this.downObjects.moveValue(u),u.draggable&&this.processDragStart(u,w,$),u.resizable&&this.processResizeStart(u,w,$)),u.events.isEnabled("down")&&!ca.isPaused){var G={type:"down",target:u,event:$,pointer:w,touch:w.touch};u.events.dispatchImmediately("down",G)}},R.prototype.handleGlobalUp=function(u,w,$){var G=this;$===void 0&&($=!1);var K=this.downObjects.values.slice();K.sort(function(re,ue){if(re&&ue){var we=re.element.compareDocumentPosition(ue.element);return we&Node.DOCUMENT_POSITION_CONTAINED_BY?1:we&Node.DOCUMENT_POSITION_CONTAINS?-1:0}return 0}),wi(K,function(re){re&&re.downPointers.contains(u)&&G.handleUp(re,u,w,$)})},R.prototype.handleDocumentLeave=function(u){var w=this;ar(this.downObjects.backwards().iterator(),function($){$.downPointers.each(function(G){w.handleUp($,G,u)})})},R.prototype.handleUp=function(u,w,$,G){if(G===void 0&&(G=!1),this.restoreCursorDownStyle(u,w),u.downPointers.removeValue(w),(w.touch||this._useTouchEventsOnly)&&this.handleOut(u,w,$,!0),u.isDown){if(u.downPointers.length==0&&(u.isDown=!1,this.downObjects.removeValue(u)),u.events.isEnabled("up")&&!ca.isPaused){var K={type:"up",target:u,event:$,pointer:w,touch:w.touch};u.events.dispatchImmediately("up",K)}G||(u.swipeable&&this.swiped(u,w)?this.handleSwipe(u,w,$):(u.clickable&&!this.moved(w,this.getHitOption(u,"hitTolerance"))&&this.handleHit(u,w,$),u.inert&&this.moved(w,this.getHitOption(u,"hitTolerance"))?this.handleInertia(u,w):u.draggable&&this.processDragStop(u,w,$),u.resizable&&this.processResizeStop(u,w,$)))}},R.prototype.maybePreventDefault=function(u,w,$){!Te(w)||!(u.draggable||u.swipeable||u.trackable||u.resizable)||this.isGlobalElement(u)||w.cancelable===!1||u.isTouchProtected&&$&&$.touch||w.preventDefault()},R.prototype.cancelAllHovers=function(u){var w=this;ar(this.overObjects.backwards().iterator(),function($){if($){var G=$.overPointers.getIndex(0);w.handleOut($,G,u,!0,!0)}})},R.prototype.shouldCancelHovers=function(u){return rp.disableHoverOnTransform=="touch"},R.prototype.handleGlobalMove=function(u,w){var $,G=this;if(!u.touch){var K=typeof($=u.lastEvent).composedPath=="function"?$.composedPath()[0]:$.target;ar(this.overObjects.backwards().iterator(),function(re){if(re&&re.overPointers.contains(u)&&re.hoverable){var ue=!1;re.element&&u.lastEvent&&az(re.element,K)||(ue=!0),ue&&G.handleOut(re,u,w,!0)}})}ar(this.transformedObjects.backwards().iterator(),function(re){!re.downPointers.contains(u)||re.swipeable&&G.swiping(re,u)||!re.draggable&&!re.resizable||G.handleTransform(re,w)}),ar(this.trackedObjects.backwards().iterator(),function(re){re.overPointers.contains(u)||G.handleTrack(re,u,w)})},R.prototype.handleTrack=function(u,w,$,G){if(G===void 0&&(G=!1),(G||this.moved(w,0))&&u.events.isEnabled("track")&&!ca.isPaused){var K={type:"track",target:u,event:$,point:w.point,pointer:w,touch:w.touch};u.events.dispatchImmediately("track",K)}},R.prototype.handleSwipe=function(u,w,$){if(u.events.isEnabled("swipe")&&!ca.isPaused){var G={type:"swipe",target:u,event:$,touch:w.touch};u.events.dispatchImmediately("swipe",G)}w.startPoint.x0?u.events.isEnabled("swiperight")&&!ca.isPaused&&u.events.dispatchImmediately("wheelright",{type:"wheelright",target:u,event:K,point:w.point,shift:re}):G<0?u.events.isEnabled("wheelup")&&!ca.isPaused&&u.events.dispatchImmediately("wheelup",{type:"wheelup",target:u,event:K,point:w.point,shift:re}):G>0&&u.events.isEnabled("wheeldown")&&!ca.isPaused&&u.events.dispatchImmediately("wheeldown",{type:"wheeldown",target:u,event:K,point:w.point,shift:re})},R.prototype.handleInertia=function(u,w){u.draggable&&u.downPointers.length===0&&this.handleMoveInertia(u,w),u.resizable&&u.downPointers.length>1&&this.handleResizeInertia(u,w)},R.prototype.handleMoveInertia=function(u,w){var $=u,G={x:w.point.x,y:w.point.y},K={x:w.startPoint.x,y:w.startPoint.y},re=new P4($,"move",G,K),ue=this.getTrailPoint(w,eg()-this.getInertiaOption(u,"move","time"));if(ue!==void 0){var we=this.getInertiaOption(u,"move","factor"),De=[{to:w.point.x+(w.point.x-ue.point.x)*we,property:"x"},{to:w.point.y+(w.point.y-ue.point.y)*we,property:"y"}],Ve=new _m(re,De,this.getInertiaOption(u,"move","duration"),this.getInertiaOption(u,"move","easing")).start();this._disposers.push(Ve.events.on("animationended",function(Ke){re.done()})),u.inertias.setKey("move",re)}else this.processDragStop(u,w,w.lastUpEvent)},R.prototype.handleResizeInertia=function(u,w){},R.prototype.handleTransform=function(u,w){var $,G,K,re=u.downPointers.getIndex(0),ue=null,we=null;re&&(ue=re.point,we=re.startPoint),K=G={x:u.originalPosition.x,y:u.originalPosition.y};for(var De=!0,Ve=1;Ve$-this.getSwipeOption(u,"time")},R.prototype.swiped=function(u,w){var $=eg();return!w.swipeCanceled&&Math.abs(w.startPoint.x-w.point.x)>this.getSwipeOption(u,"horizontalThreshold")&&Math.abs(w.startPoint.y-w.point.y)$-this.getSwipeOption(u,"time")},R.prototype.applyCursorOverStyle=function(u){var w=u.cursorOptions;if(Te(w.overStyle))for(var $=0;$w||Math.abs(G.y)>w},R.prototype.old=function(u,w){return w===void 0&&(w=300),eg()-u.startTime>w},R.prototype.getShift=function(u){return{x:u.startPoint.x-u.point.x,y:u.startPoint.y-u.point.y}},R.prototype.getTrailPoint=function(u,w){for(var $,G=0;G=w){$=u.track[G];break}return $},R.prototype.pointerExists=function(u,w){var $=!1;return u.each(function(G){G!=w&&($=G.point.x==w.point.x&&G.point.y==w.point.y)}),$},R.prototype.getInteraction=function(u){return new U$(u)},R.prototype.setTemporaryStyle=function(u,w,$){var G=u.element;Te(G.style[w])&&!u.replacedStyles.hasKey(w)&&u.replacedStyles.setKey(w,G.style[w]),oz(G,w,$)},R.prototype.restoreStyle=function(u,w){u.replacedStyles.hasKey(w)?(u.element.style[w]=u.replacedStyles.getKey(w),u.replacedStyles.removeKey(w)):delete u.element.style[w]},R.prototype.restoreAllStyles=function(u){ar(u.replacedStyles.iterator(),function(w){var $=w[0],G=w[1];u.element.style[$]=G,u.replacedStyles.removeKey($)})},R.prototype.dispose=function(){this.isDisposed()||(U.prototype.dispose.call(this),this.restoreAllStyles(this.body),this.unlockWheel())},R.prototype.log=function(u,w,$){if(w.changedTouches)for(var G=0;G0},R.prototype.logTouch=function(u,w,$){console.log(u+" "+w+" touch "+$.identifier)},Object.defineProperty(R,"passiveSupported",{get:function(){var u=this;if(this._passiveSupported==null)try{var w=Object.defineProperty({},"passive",{get:function(){u._passiveSupported=!0}});window.addEventListener("test",w,w),window.removeEventListener("test",w,w)}catch{this._passiveSupported=!1}return this._passiveSupported},enumerable:!0,configurable:!0}),R}(bi),$g=null;function Zs(){return $g==null&&($g=new H$),$g}var V0=function(U){function R(){var u=U.call(this)||this;return u.adapter=new uc(u),u._elements={},u._IOs={},u._content="",u._title="",u._classPrefix="ampopup",u._defaultStyles=!0,u._showCurtain=!1,u._draggable=!0,u._align="center",u._dynamicResize=!0,u._verticalAlign="middle",u._shift={x:0,y:0},u._tempShift={x:0,y:0},u._readerTitle="",u._closable=!0,u._cssLoaded=!1,u._fitTo="window",u.isTemplate=!1,u._sized=!1,u.className="Popup",u}return ie(R,U),R.prototype.open=function(){this.container&&(this._elements.wrapper&&this.container.appendChild(this._elements.wrapper),this._elements.curtain&&(this.container.appendChild(this._elements.curtain),this.showCurtain=this.showCurtain),this.positionElement(),this.dispatchImmediately("opened"))},R.prototype.close=function(){this._elements.wrapper&&this._elements.wrapper.parentElement&&this._elements.wrapper.parentElement.removeChild(this._elements.wrapper),this._elements.curtain&&this._elements.curtain.parentElement&&this._elements.curtain.parentElement.removeChild(this._elements.curtain),this.dispatchImmediately("closed"),this.releasePointers()},R.prototype.dispose=function(){this.close(),U.prototype.dispose.call(this)},R.prototype.positionElement=function(u){var w=this;u===void 0&&(u=!0),this._elements.wrapper&&setTimeout(function(){if(w._elements.wrapper){if(u||!w._sized){w._elements.wrapper.style.opacity="0.01",w._elements.wrapper.style.left="0",w._elements.wrapper.style.top="0",w._elements.wrapper.style.margin="0 0 0 0",w._elements.wrapper.style.width="",w._elements.wrapper.style.height="";var $=w._elements.wrapper.getBoundingClientRect();w._elements.wrapper.style.width=$.width+"px",w._elements.wrapper.style.height=$.height+"px",w._sized=!0}if(w.dynamicResize)for(var G=w._elements.wrapper.getElementsByTagName("img"),K=0;K$+U.delay)&&($=re,wi(w._targets,function(ue){var we=ue.target.getBoundingClientRect();we.width===ue.size.width&&we.height===ue.size.height||(ue.size=we,ue.callback())})),w._timer=requestAnimationFrame(G)};this._timer=requestAnimationFrame(G)}var K=R.getBoundingClientRect();this._targets.push({target:R,callback:u,size:K})},U.prototype.removeTarget=function(R){Br(this._targets,function(u){return u.target!==R}),this._targets.length===0&&cancelAnimationFrame(this._timer)},U.delay=200,U}(),F4=null,tC=function(){function U(R,u){this._disposed=!1,this._sensor=(F4===null&&(F4=typeof ResizeObserver<"u"?new D4:new hz),F4),this._element=R,this._sensor.addTarget(R,u)}return U.prototype.isDisposed=function(){return this._disposed},U.prototype.dispose=function(){this._disposed||(this._disposed=!0,this._sensor.removeTarget(this._element))},Object.defineProperty(U.prototype,"sensor",{get:function(){return this._sensor},enumerable:!0,configurable:!0}),U.prototype.reset=function(){M4("resizeSensor.reset() is no longer needed and can be removed")},U}(),L4=[],Bb=function(){function U(R,u){var w=this;this._disposed=!1,this.autoResize=!0,this.nonExportableSprites=[],this._disposers=[],this.cssScale=1,this._printing=!1,this.htmlElement=R,u||(this._printing=!1,this.initSensor(),this._disposers.push(uh(window,"beforeprint",function(){w._printing=!0})),this._disposers.push(uh(window,"afterprint",function(){w._printing=!1}))),L4.push(this);var $=document.createElement("div"),G=$.style;G.width="100%",G.height="100%",G.position="relative",R.appendChild($),this.SVGContainer=$}return U.prototype.initSensor=function(){var R=this;this.resizeSensor&&this.resizeSensor.dispose(),this.resizeSensor=new tC(this.htmlElement,function(){R.autoResize&&!R._printing&&R.measure()}),this._disposers.push(this.resizeSensor)},U.prototype.measure=function(){var R=As(this.htmlElement),u=My(this.htmlElement),w=this.container;w&&(this.width==R&&this.height==u||(this.width=R,this.height=u,R>0&&(w.maxWidth=R),u>0&&(w.maxHeight=u),j$(this.SVGContainer)),w.maxWidth||(w.maxWidth=0),w.maxHeight||(w.maxHeight=0),this.cssScale=1,this.checkTransform(this.htmlElement))},Object.defineProperty(U.prototype,"container",{get:function(){return this._container},set:function(R){this._container=R,this.measure()},enumerable:!0,configurable:!0}),U.prototype.isDisposed=function(){return this._disposed},U.prototype.dispose=function(){this._disposed||ji(L4,this),wi(this._disposers,function(R){R.dispose()})},Object.defineProperty(U.prototype,"hideOverflow",{set:function(R){this.SVGContainer.style.overflow=R?"hidden":""},enumerable:!0,configurable:!0}),Object.defineProperty(U.prototype,"modal",{get:function(){return Te(this._modal)||(this._modal=new W$,this._modal.container=this.SVGContainer,this._disposers.push(this._modal)),this._modal},enumerable:!0,configurable:!0}),U.prototype.openModal=function(R,u){this.closeModal();var w=this.modal;return w.content=R,w.readerTitle=u||"",w.title=u||"",w.open(),w},U.prototype.closeModal=function(){this._modal&&this.modal.close()},Object.defineProperty(U.prototype,"popups",{get:function(){if(!Te(this._popups)){var R=new V0;R.container=this.SVGContainer,this._popups=new lo(R),this._disposers.push(new ua(this._popups)),this._disposers.push(this._popups.template)}return this._popups},enumerable:!0,configurable:!0}),U.prototype.openPopup=function(R,u){var w=this.popups.create();return w.content=R,Te(u)&&(w.title=u),w.open(),w},U.prototype.closeAllPopups=function(){this.popups.each(function(R){R.close()})},Object.defineProperty(U.prototype,"readerAlertElement",{get:function(){if(!Te(this._readerAlertElement)){var R=document.createElement("div");R.setAttribute("role","alert"),R.style.zIndex="-100000",R.style.opacity="0",R.style.position="absolute",R.style.top="0",this.SVGContainer.appendChild(R),this._readerAlertElement=R}return this._readerAlertElement},enumerable:!0,configurable:!0}),U.prototype.readerAlert=function(R){this.readerAlertElement.innerHTML=R},U.prototype.checkTransform=function(R){if(window.getComputedStyle){if(R&&R.style){var u=window.getComputedStyle(R,null);if(u){var w=u.getPropertyValue("-webkit-transform")||u.getPropertyValue("-moz-transform")||u.getPropertyValue("-ms-transform")||u.getPropertyValue("-o-transform")||u.getPropertyValue("transform");if(w&&w!=="none"){var $=w.split("(")[1].split(")")[0].split(","),G=Number($[0]),K=Number($[1]),re=Math.sqrt(G*G+K*K);isNaN(re)||(this.cssScale*=re)}}}R.parentNode&&R.parentNode instanceof HTMLElement&&this.checkTransform(R.parentNode)}},U}(),iC=function(){function U(R,u){this.container=R,this.id=u;var w=document.createElementNS(Rf,"svg");w.setAttribute("version","1.1"),w.setAttributeNS(y3,"xmlns",Rf),w.setAttributeNS(y3,"xmlns:xlink",bI),w.setAttribute("role","group"),this.container.appendChild(w),this.defs=document.createElementNS(Rf,"defs"),w.appendChild(this.defs),w.style.width="100%",w.style.height="100%",w.style.overflow="visible",this.svg=w}return U.prototype.add=function(R){return new CI(R)},U.prototype.addGroup=function(R){return new A4(R)},U.prototype.append=function(R){R&&this.svg.appendChild(R.node)},U.prototype.appendDef=function(R){R&&this.defs.appendChild(R.node)},U.prototype.foreignObject=function(){return new CI("foreignObject")},U.prototype.supportsForeignObject=function(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Extensibility","1.1")},U}(),II=null;function Lx(){if(II===null){var U=document.createElement("div");U.hidden=!0,U.style.width="1px",U.style.height="1px",U.style.position="absolute",U.style.zIndex="-1000000",document.body.appendChild(U);var R=new Bb(U,!0);II=new iC(R.SVGContainer,"ghost")}return II}var b1=function(U){function R(){var u=U.call(this)||this;u._elements=new to,u.properties={},u.className="Pattern",u.width=10,u.height=10,u.x=0,u.y=0,u.patternUnits="userSpaceOnUse";var w=new Wa;return u.backgroundFill=w.getFor("background"),u.backgroundOpacity=0,u.fillOpacity=1,u.fill=w.getFor("alternativeBackground"),u.stroke=w.getFor("alternativeBackground"),u.strokeOpacity=1,u.strokeWidth=1,u.shapeRendering="crispEdges",u.rotation=0,u.element=u.paper.addGroup("pattern"),u.id="pattern-"+pi.getUniqueId(),u.element.attr({id:u.id}),u._disposers.push(u.element),u._disposers.push(new ua(u._elements)),u.patternUnits=u.patternUnits,u.width=u.width,u.height=u.height,u.applyTheme(),u}return ie(R,U),R.prototype.draw=function(){var u=this,w=this.element;if(w){w.removeChildNodes();var $=this.paper.add("rect");$.attr({width:this.width,height:this.height,"shape-rendering":"crispEdges",fill:this.backgroundFill.hex,"fill-opacity":this.backgroundOpacity,stroke:this.backgroundFill.hex,"stroke-opacity":0}),w.add($),w.attr({x:this.x,y:this.y,width:this.width,height:this.height,stroke:this.stroke.hex,fill:this.fill.hex,"fill-opacity":this.fillOpacity,"stroke-opacity":this.strokeOpacity,"stroke-width":this.strokeWidth,"shape-rendering":this.shapeRendering,patternUnits:this.patternUnits,"stroke-dasharray":this.strokeDasharray}),ar(this._elements.iterator(),function(G){G.rotation=u.rotation,G.rotationX=u.properties.rotationX,G.rotationY=u.properties.rotationY,u.element.add(G)})}},R.prototype.animate=function(u,w,$){return new _m(this,u,w,$).start()},R.prototype.addElement=function(u){this._elements.push(u),this._disposers.push(u)},R.prototype.removeElement=function(u){this._elements.removeValue(u),this.removeDispose(u)},Object.defineProperty(R.prototype,"elements",{get:function(){return this._elements},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fillOpacity",{get:function(){return this.properties.fillOpacity},set:function(u){this.properties.fillOpacity=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fill",{get:function(){return this.properties.fill},set:function(u){this.properties.fill=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"backgroundFill",{get:function(){return this.properties.backgroundFill},set:function(u){this.properties.backgroundFill=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"backgroundOpacity",{get:function(){return this.properties.backgroundOpacity},set:function(u){this.properties.backgroundOpacity=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"stroke",{get:function(){return this.properties.stroke},set:function(u){this.properties.stroke=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"strokeOpacity",{get:function(){return this.properties.strokeOpacity},set:function(u){this.properties.strokeOpacity=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"strokeWidth",{get:function(){return this.properties.strokeWidth},set:function(u){this.properties.strokeWidth=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"shapeRendering",{get:function(){return this.properties.shapeRendering},set:function(u){this.properties.shapeRendering=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"rotation",{get:function(){return this.properties.rotation},set:function(u){this.properties.rotation=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"patternUnits",{get:function(){return this.properties.patternUnits},set:function(u){this.properties.patternUnits=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"width",{get:function(){return this.properties.width},set:function(u){this.properties.width=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"height",{get:function(){return this.properties.height},set:function(u){this.properties.height=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"x",{get:function(){return this.properties.x},set:function(u){this.properties.x=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"y",{get:function(){return this.properties.y},set:function(u){this.properties.y=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"paper",{get:function(){return this._paper?this._paper:Lx()},set:function(u){this._paper!=u&&(this._paper=u,this.draw(),u.appendDef(this.element))},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){var w=this;U.prototype.copyFrom.call(this,u),yi(u.properties,function($,G){w[$]=G})},Object.defineProperty(R.prototype,"animations",{get:function(){return this._animations||(this._animations=[],this._disposers.push(new Dx(this._animations))),this._animations},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"strokeDasharray",{get:function(){return this.properties.strokeDashArray},set:function(u){this.properties.strokeDashArray=u,this.draw()},enumerable:!0,configurable:!0}),R.prototype.processConfig=function(u){if(u&&Te(u.elements)&&wt(u.elements))for(var w=0,$=u.elements.length;w<$;w++){var G=u.elements[w];if(Te(G.type)){var K=this.createEntryInstance(G);K instanceof Yt&&(K.config=G),this.addElement(Te(G.typeProperty)?K[G.typeProperty]:K.element)}}U.prototype.processConfig.call(this,u)},R}(Yt);pi.registeredClasses.Pattern=b1;var Fy=function(U){function R(){var u=U.call(this)||this;return u._stops=new to,u._rotation=0,u.className="LinearGradient",u._stops.events.on("setIndex",u.validate,u),u._stops.events.on("inserted",u.validate,u),u.element=u.paper.addGroup("linearGradient"),u.id="gradient-"+pi.getUniqueId(),u.element.attr({id:u.id}),u._disposers.push(u.element),u.applyTheme(),u}return ie(R,U),R.prototype.validate=function(){var u=this,w=(this._rotation+90)*Ae,$=Math.round(50+50*Math.sin(w+Math.PI))+"%",G=Math.round(50+50*Math.cos(w))+"%",K=Math.round(50+50*Math.sin(w))+"%",re=Math.round(50+50*Math.cos(w+Math.PI))+"%",ue=this.element;ue.removeChildNodes(),ue.attr({x1:$,x2:K,y1:G,y2:re}),ar(Iu(this._stops.iterator()),function(we){var De=we[0],Ve=we[1],Ke=Ve.offset;ae(Ke)||(Ke=De/(u._stops.length-1));var Qe=u.paper.add("stop");Te(Ve.color)&&Qe.attr({"stop-color":Ve.color.toString()}),ae(Ve.opacity)&&Qe.attr({"stop-opacity":Ve.opacity}),ae(Ke)&&Qe.attr({offset:Ke}),ue.add(Qe)})},R.prototype.clear=function(){this._stops.clear()},R.prototype.addColor=function(u,w,$){this._stops.push({color:u,opacity:w,offset:$})},Object.defineProperty(R.prototype,"stops",{get:function(){return this._stops},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"paper",{get:function(){return this._paper?this._paper:Lx()},set:function(u){this._paper!=u&&(this._paper=u,this.validate(),u.appendDef(this.element))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"rotation",{get:function(){return this._rotation},set:function(u){this._rotation=u,this.validate()},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.stops.copyFrom(u.stops),this._rotation=u.rotation},Object.defineProperty(R.prototype,"gradientUnits",{set:function(u){this.element.attr({gradientUnits:u})},enumerable:!0,configurable:!0}),R}(Yt);pi.registeredClasses.LinearGradient=Fy;var Ly=function(U){function R(){var u=U.call(this)||this;return u._stops=new to,u.element=u.paper.addGroup("radialGradient"),u.id="gradient-"+pi.getUniqueId(),u.element.attr({id:u.id}),u._disposers.push(u.element),u.applyTheme(),u}return ie(R,U),R.prototype.draw=function(){var u,w=this,$=this.element;ae(this.cx)&&((u=this.cx)instanceof J&&(u=u.percent+"%"),$.attr({cx:u})),ae(this.cy)&&((u=this.cy)instanceof J&&(u=u.percent+"%"),$.attr({cy:u})),this.fx&&((u=this.fx)instanceof J&&(u=u.percent+"%"),$.attr({fx:u})),this.fy&&((u=this.fy)instanceof J&&(u=u.percent+"%"),$.attr({fy:u})),$.removeChildNodes(),ar(Iu(this._stops.iterator()),function(G){var K=G[0],re=G[1],ue=re.offset;ae(ue)||(ue=K/(w._stops.length-1));var we=w.paper.add("stop");Te(re.color)&&we.attr({"stop-color":re.color.toString()}),ae(re.opacity)&&we.attr({"stop-opacity":re.opacity}),ae(ue)&&we.attr({offset:ue}),$.add(we)})},R.prototype.addColor=function(u,w,$){this._stops.push({color:u,opacity:w,offset:$}),this.draw()},Object.defineProperty(R.prototype,"paper",{get:function(){return this._paper?this._paper:Lx()},set:function(u){this._paper!=u&&(this._paper=u,this.draw(),u.appendDef(this.element))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cx",{get:function(){return this._cx},set:function(u){this._cx=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cy",{get:function(){return this._cy},set:function(u){this._cy=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fx",{get:function(){return this._fx},set:function(u){this._fx=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fy",{get:function(){return this._fy},set:function(u){this._fy=u,this.draw()},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.stops.copyFrom(u.stops),this.cx=u.cx,this.cy=u.cy,this.fx=u.fx,this.fy=u.fy},Object.defineProperty(R.prototype,"stops",{get:function(){return this._stops},enumerable:!0,configurable:!0}),R.prototype.clear=function(){this._stops.clear()},R}(Yt);pi.registeredClasses.RadialGradient=Ly;var Al=function(){function U(){}return U.grab=[{property:"cursor",value:"move"},{property:"cursor",value:"grab"},{property:"cursor",value:"-webkit-grab"}],U.grabbing=[{property:"cursor",value:"move"},{property:"cursor",value:"grabbing"},{property:"cursor",value:"-webkit-grabbing"}],U.pointer=[{property:"cursor",value:"pointer"}],U.default=[{property:"cursor",value:"default"}],U.horizontalResize=[{property:"cursor",value:"ew-resize"}],U.verticalResize=[{property:"cursor",value:"ns-resize"}],U.notAllowed=[{property:"cursor",value:"not-allowed"}],U.text=[{property:"cursor",value:"text"}],U}();const af={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_second:"HH:mm:ss",_date_minute:"HH:mm",_date_hour:"HH:mm",_date_day:"MMM dd",_date_week:"ww",_date_month:"MMM",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(U){var R="th";if(U<11||U>13)switch(U%10){case 1:R="st";break;case 2:R="nd";break;case 3:R="rd"}return R},"Zoom Out":"",Play:"",Stop:"",Legend:"","Click, tap or press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Force directed tree":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER or use arrow keys to navigate":"","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"",'To save the image, right-click this link and choose "Save picture as..."':"",'To save the image, right-click thumbnail on the left and choose "Save picture as..."':"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"",Close:"",Minimize:""};var Dr,w1=function(U){function R(){var u=U.call(this)||this;return u.adapter=new uc(u),u._locale=af,u._defaultLocale=af,u.className="Language",Te(rp.defaultLocale)&&(u.locale=rp.defaultLocale),u.applyTheme(),u}return ie(R,U),R.prototype.getLocale=function(u){return u==null&&(u=this._locale),this.adapter.apply("locale",{locale:u}).locale},R.prototype.translate=function(u,w){for(var $=[],G=2;G0&&(De=G[re-1].replace("[","").replace("]","")),$+=this.wrap(we,De,w)}}return $=this.unescape($),this.cleanUp($)},R.prototype.escape=function(u){return u.replace(/\[\[/g,pi.getPlaceholder("1")).replace(/([^\/\]]{1})\]\]/g,"$1"+pi.getPlaceholder("2")).replace(/\]\]/g,pi.getPlaceholder("2")).replace(/\{\{/g,pi.getPlaceholder("3")).replace(/\}\}/g,pi.getPlaceholder("4")).replace(/\'\'/g,pi.getPlaceholder("5"))},R.prototype.unescape=function(u){return u.replace(new RegExp(pi.getPlaceholder("1"),"g"),"[[").replace(new RegExp(pi.getPlaceholder("2"),"g"),"]]").replace(new RegExp(pi.getPlaceholder("3"),"g"),"{{").replace(new RegExp(pi.getPlaceholder("4"),"g"),"}}").replace(new RegExp(pi.getPlaceholder("5"),"g"),"''")},R.prototype.cleanUp=function(u){return u.replace(/\[\[/g,"[").replace(/\]\]/g,"]").replace(/\{\{/g,"{").replace(/\}\}/g,"}").replace(/\'\'/g,"'")},R.prototype.wrap=function(u,w,$){return w!==""&&w!=="/"||(w=""),$==="html"?this.wrapHtml(u,this.translateStyleShortcuts(w)):this.wrapSvg(u,this.translateStyleShortcuts(w))},R.prototype.wrapSvg=function(u,w){return w===""?""+u+"":""+u+""},R.prototype.getSvgElement=function(u,w){var $=new CI("tspan");return $.textContent=u,w&&$.node.setAttribute("style",w),$},R.prototype.wrapHtml=function(u,w){return w===""?""+u+"":""+u+""},R.prototype.getHtmlElement=function(u,w){var $=document.createElement("span");return $.innerHTML=u,w&&$.setAttribute("style",w),$},R.prototype.styleSvgToHtml=function(u){return u.replace(/fill:/,"color:")},R.prototype.translateStyleShortcuts=function(u){if(u==""||u=="[ ]")return"";var w=pi.getCache("translateStyleShortcuts_"+u);if(w)return w;var $=u.match(/('[^']*')|("[^"]*")/gi);if($)for(var G=0;G<$.length;G++)u=u.replace($[G],$[G].replace(/['"]*/g,"").replace(/[ ]+/g,"+"));var K=u.match(/([\w\-]*:[\s]?[^;\s\]]*)|(\#[\w]{1,6})|([\w]+)|(\/)/gi);if(!K)return u;for(G=0;Gthis._negativeBase?re.positive:K=0?u.toExponential(w.decimals.passive).split("e"):u.toExponential().split("e"),u=Number(G[0]),re="e"+G[1],w.modSpacing&&(re=" "+re);else if(w.decimals.passive===0)u=Math.round(u);else if(w.decimals.passive>0){var Ke=Math.pow(10,w.decimals.passive);u=Math.round(u*Ke)/Ke}var Qe="",ft=ip(u).split("."),Gt=ft[0];if(Gt.length0){for(var ei=[],di=Gt.split("").reverse().join(""),ci=0,qi=Gt.length;ci<=qi;ci+=w.thousands.interval){var rr=di.substr(ci,w.thousands.interval).split("").reverse().join("");rr!==""&&ei.unshift(rr)}Gt=ei.join(w.thousands.separator)}Qe+=Gt,ft.length===1&&ft.push("");var Ii=ft[1];return Ii.length4&&qi--,ci=w.parts[ei]=="YYYY"?Math.abs(qi).toString():Math.abs(qi).toString().substr(-w.parts[ei].length),qi<0&&(ci+=$.translate("_era_bc"));break;case"u":case"F":case"g":break;case"q":ci=""+Math.ceil((u.getMonth()+1)/3);break;case"MMMMM":ci=$.translate(this.months[K]).substr(0,1);break;case"MMMM":ci=$.translate(this.months[K]);break;case"MMM":ci=$.translate(this.monthsShort[K]);break;case"MM":ci=Jl(K+1,2,"0");break;case"M":ci=(K+1).toString();break;case"ww":ci=Jl(Vr(u,this.utc),2,"0");break;case"w":ci=Vr(u,this.utc).toString();break;case"W":ci=ts(u,this.utc).toString();break;case"dd":ci=Jl(ue,2,"0");break;case"d":ci=ue.toString();break;case"DD":case"DDD":ci=Jl(zi(u,this.utc).toString(),w.parts[ei].length,"0");break;case"D":ci=zi(u,this.utc).toString();break;case"t":ci=$.translateFunc("_dateOrd").call(this,ue);break;case"E":ci=(re||7).toString();break;case"EE":ci=Jl((re||7).toString(),2,"0");break;case"EEE":case"eee":ci=$.translate(this.weekdaysShort[re]);break;case"EEEE":case"eeee":ci=$.translate(this.weekdays[re]);break;case"EEEEE":case"eeeee":ci=$.translate(this.weekdays[re]).substr(0,1);break;case"e":case"ee":ci=(re-this.firstDayOfWeek+1).toString(),w.parts[ei]=="ee"&&(ci=Jl(ci,2,"0"));break;case"a":ci=we>=12?$.translate("PM"):$.translate("AM");break;case"aa":ci=we>=12?$.translate("P.M."):$.translate("A.M.");break;case"aaa":ci=we>=12?$.translate("P"):$.translate("A");break;case"h":ci=Rs(we).toString();break;case"hh":ci=Jl(Rs(we),2,"0");break;case"H":ci=we.toString();break;case"HH":ci=Jl(we,2,"0");break;case"K":ci=Rs(we,0).toString();break;case"KK":ci=Jl(Rs(we,0),2,"0");break;case"k":ci=(we+1).toString();break;case"kk":ci=Jl(we+1,2,"0");break;case"m":ci=De.toString();break;case"mm":ci=Jl(De,2,"0");break;case"s":ci=Ve.toString();break;case"ss":ci=Jl(Ve,2,"0");break;case"S":case"SS":case"SSS":ci=Math.round(Ke/1e3*Math.pow(10,w.parts[ei].length)).toString();break;case"x":ci=Gt.toString();break;case"n":case"nn":case"nnn":ci=Jl(Ke,w.parts[ei].length,"0");break;case"z":ci=Ia(u,!1,!1,this.utc);break;case"zz":ci=Ia(u,!0,!1,this.utc);break;case"zzz":ci=Ia(u,!1,!0,this.utc);break;case"zzzz":ci=Ia(u,!0,!0,this.utc);break;case"Z":case"ZZ":var rr=Math.abs(ft)/60,Ii=Math.floor(rr),Ki=60*rr-60*Ii;this.utc&&(Ii=0,Ki=0),w.parts[ei]=="Z"?(ci="GMT",ci+=ft>0?"-":"+",ci+=Jl(Ii,2)+":"+Jl(Ki,2)):(ci=ft>0?"-":"+",ci+=Jl(Ii,2)+Jl(Ki,2));break;case"i":ci=u.toISOString();break;case"I":ci=u.toUTCString()}Qe=Qe.replace(Fr,ci)}return Qe},R.prototype.parse=function(u,w){if(Te(w)||(w=this.inputDateFormat),u instanceof Date)return u;if(typeof u=="number")return new Date(u);var $;typeof u!="string"&&(u=u.toString()),this.language||(this.sprite?this.language=this.sprite.language:this.language=new w1);var G="";w=(w=kh(w)).substr(0,u.length);for(var K=this.parseFormat(w),re={year:-1,year3:-1,year2:-1,year1:-1,month:-1,monthShort:-1,monthLong:-1,weekdayShort:-1,weekdayLong:-1,day:-1,yearDay:-1,week:-1,hourBase0:-1,hour12Base0:-1,hourBase1:-1,hour12Base1:-1,minute:-1,second:-1,millisecond:-1,millisecondDigits:-1,am:-1,zone:-1,timestamp:-1,iso:-1},ue={year:1970,month:0,day:1,hour:0,minute:0,second:0,millisecond:0,timestamp:null,offset:0,utc:this.utc},we=0,De=0,Ve=0;Ve-1&&(ue.year=parseInt(Qe[re.year])),re.year3>-1){var ft=parseInt(Qe[re.year3]);ft+=1e3,ue.year=ft}if(re.year2>-1&&(ft=parseInt(Qe[re.year2]),ft+=ft>50?1e3:2e3,ue.year=ft),re.year1>-1&&(ft=parseInt(Qe[re.year1]),ft=10*Math.floor(new Date().getFullYear()/10)+ft,ue.year=ft),re.monthLong>-1&&(ue.month=this.resolveMonth(Qe[re.monthLong])),re.monthShort>-1&&(ue.month=this.resolveShortMonth(Qe[re.monthShort])),re.month>-1&&(ue.month=parseInt(Qe[re.month])-1),re.week>-1&&re.day===-1&&(ue.month=0,ue.day=Os(parseInt(Qe[re.week]),ue.year,1,this.utc)),re.day>-1&&(ue.day=parseInt(Qe[re.day])),re.yearDay>-1&&(ue.month=0,ue.day=parseInt(Qe[re.yearDay])),re.hourBase0>-1&&(ue.hour=parseInt(Qe[re.hourBase0])),re.hourBase1>-1&&(ue.hour=parseInt(Qe[re.hourBase1])-1),re.hour12Base0>-1&&((ft=parseInt(Qe[re.hour12Base0]))==11&&(ft=0),re.am>-1&&!this.isAm(Qe[re.am])&&(ft+=12),ue.hour=ft),re.hour12Base1>-1&&((ft=parseInt(Qe[re.hour12Base1]))==12&&(ft=0),re.am>-1&&!this.isAm(Qe[re.am])&&(ft+=12),ue.hour=ft),re.minute>-1&&(ue.minute=parseInt(Qe[re.minute])),re.second>-1&&(ue.second=parseInt(Qe[re.second])),re.millisecond>-1&&(ft=parseInt(Qe[re.millisecond]),re.millisecondDigits==2?ft*=10:re.millisecondDigits==1&&(ft*=100),ue.millisecond=ft),re.timestamp>-1){ue.timestamp=parseInt(Qe[re.timestamp]);var Gt=new Date(ue.timestamp);ue.year=Gt.getUTCFullYear(),ue.month=Gt.getUTCMonth(),ue.day=Gt.getUTCDate(),ue.hour=Gt.getUTCHours(),ue.minute=Gt.getUTCMinutes(),ue.second=Gt.getUTCSeconds(),ue.millisecond=Gt.getUTCMilliseconds()}re.zone>-1&&(ue.offset=this.resolveTimezoneOffset(new Date(ue.year,ue.month,ue.day),Qe[re.zone])),re.iso>-1&&(ue.year=Et(Qe[re.iso+0]),ue.month=Et(Qe[re.iso+1])-1,ue.day=Et(Qe[re.iso+2]),ue.hour=Et(Qe[re.iso+3]),ue.minute=Et(Qe[re.iso+4]),ue.second=Et(Qe[re.iso+5]),ue.millisecond=Et(Qe[re.iso+6]),Qe[re.iso+7]=="Z"||Qe[re.iso+7]=="z"?ue.utc=!0:Qe[re.iso+7]!=""&&(ue.offset=this.resolveTimezoneOffset(new Date(ue.year,ue.month,ue.day),Qe[re.iso+7]))),$=ue.utc?new Date(Date.UTC(ue.year,ue.month,ue.day,ue.hour,ue.minute,ue.second,ue.millisecond)):new Date(ue.year,ue.month,ue.day,ue.hour,ue.minute+ue.offset,ue.second,ue.millisecond)}else $=new Date(u);return $},R.prototype.resolveTimezoneOffset=function(u,w){if(w.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/)){var $=je(w.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/)),G=$[1],K=$[2],re=$[3],ue=60*parseInt(K)+parseInt(re);return G=="+"&&(ue*=-1),ue-(u||new Date).getTimezoneOffset()}return 0},R.prototype.resolveMonth=function(u){var w=this.months.indexOf(u);return w>-1||this.language&&!this.language.isDefault()&&(w=this.language.translateAll(this.months).indexOf(u))>-1?w:0},R.prototype.resolveShortMonth=function(u){var w=this.monthsShort.indexOf(u);return w>-1||(w=this.months.indexOf(u))>-1||this.language&&!this.language.isDefault()&&(w=this.language.translateAll(this.monthsShort).indexOf(u))>-1?w:0},R.prototype.isAm=function(u){return this.getStringList(["AM","A.M.","A"]).indexOf(u.toUpperCase())>-1},R.prototype.invalidateSprite=function(){this.sprite&&this.sprite.invalidate()},R.prototype.getStringList=function(u){for(var w=[],$=0;$this._negativeBase?re.positive:ue"+we+"":this._outputFormat==="html"&&(we=""+we+"")),we},R.prototype.parseFormat=function(u,w){var $=this,G=this.getCache(u);if(Te(G))return G;var K=w||this._baseUnit,re={positive:{color:"",template:"",parts:[],source:"",baseUnit:K,parsed:!1,absolute:!1},negative:{color:"",template:"",parts:[],source:"",baseUnit:K,parsed:!1,absolute:!1},zero:{color:"",template:"",parts:[],source:"",baseUnit:K,parsed:!1,absolute:!1}},ue=(u=u.replace("||",gr)).split("|");return re.positive.source=ue[0],ue[2]===void 0?re.zero=re.positive:re.zero.source=ue[2],ue[1]===void 0?re.negative=re.positive:re.negative.source=ue[1],yi(re,function(we,De){if(!De.parsed)if($.getCache(De.source)===void 0){var Ve,Ke=De.source;(Ve=De.source.match(/^\[([^\]]*)\]/))&&Ve.length&&Ve[0]!==""&&(Ke=De.source.substr(Ve[0].length),De.color=Ve[1]);for(var Qe=x1().chunk(Ke,!0),ft=0;ft div > ."+$+"-menu ."+$+"-item."+$+"-item-level-0, ."+$+"-item."+$+"-item-level-0.active",{opacity:"0.9"}),new Ys(u,"."+$+"-item."+$+"-item-level-0 > a",{padding:"0","text-align":"center",overflow:"hidden"}),new Ys(u,"."+$+"-item."+$+"-item-level-0:before",{display:"block"}),new Ys(u,"."+$+"-item",{position:"relative",display:"block",opacity:"0","z-index":"1","border-radius":"3px","background-color":G.getFor("secondaryButton").hex,padding:"0",margin:"1px 1px 0 0",color:G.getFor("secondaryButton").alternative.hex,transition:"all 100ms ease-in-out, opacity 0.5s ease 0.5s"}),new Ys(u,"."+$+"-left ."+$+"-item",{margin:"1px 0 0 1px"}),new Ys(u,"."+$+"-item:hover, ."+$+"-item.active",{background:G.getFor("secondaryButtonHover").hex,color:G.getFor("secondaryButtonText").hex}),new Ys(u,"."+$+"-item > ."+$+"-menu",{position:"absolute",top:"-1px",right:"0","margin-right":"100%"}),new Ys(u,"."+$+"-left ."+$+"-item > ."+$+"-menu",{left:"0",right:"auto","margin-left":"100%","margin-right":"auto"}),new Ys(u,"."+$+"-right ."+$+"-item > ."+$+"-menu",{left:"auto",right:"0","margin-left":"auto","margin-right":"100%"}),new Ys(u,"."+$+"-top ."+$+"-item > ."+$+"-menu",{top:"-1px",bottom:"auto"}),new Ys(u,"."+$+"-bottom ."+$+"-item > ."+$+"-menu",{top:"auto",bottom:"0"}),new Ys(u,"."+$+"-item > ."+$+"-menu",{display:"none"}),new Ys(u,"."+$+"-item:hover > ."+$+"-menu, ."+$+"-item.active > ."+$+"-menu",{display:"block"}),new Ys(u,"."+$+"-item:hover > ."+$+"-menu > ."+$+"-item, ."+$+"-item.active > ."+$+"-menu > ."+$+"-item",{opacity:"1"}),new Ys(u,"."+$+"-menu",{display:"block","list-style":"none",margin:"0",padding:"0"}),new Ys(u,"."+$+"-label",{display:"block",cursor:"default",padding:"0.5em 1em"}),new Ys(u,"."+$+"-icon",{display:"block",cursor:"default",padding:"0.2em 0.4em",width:"1.2em",height:"1.2em","min-width":"32px","min-height":"32px",margin:"auto auto","border-radius":"3px"}),new Ys(u,"."+$+"-item-level-0 > ."+$+"-icon",{padding:"0.1em 0.2em"}),new Ys(u,"."+$+"-clickable",{cursor:"pointer"})]);return new Cs(function(){Ce.removeKey($),K.dispose()})}).increment())),this._element&&(this._element.style.display="")},Object.defineProperty(R.prototype,"tabindex",{get:function(){return this.adapter.apply("tabindex",{tabindex:this._tabindex}).tabindex},set:function(u){this._tabindex=u,this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"language",{get:function(){var u=this,w=this._language.get();return w==null&&(w=new w1,this._language.set(w,w.events.on("localechanged",function($){u.invalidate()}))),w},set:function(u){var w=this;this._language.set(u,u.events.on("localechanged",function($){w.invalidate()})),this.invalidate()},enumerable:!0,configurable:!0}),R.prototype.close=function(){var u=this;if(!this.isDisposed())if(this._ignoreNextClose)this._ignoreNextClose=!1;else{if(this.closeOnClick&&(this._element.style.pointerEvents="none",setTimeout(function(){u._element.style.pointerEvents="auto"},100)),this._currentSelection&&(this.setBlur(this._currentSelection),this._currentSelection=void 0),this._element)for(var w=this._element.getElementsByClassName("active"),$=w.length-1;$>=0;$--)w[$]&&ZS(w[$],"active");this.events.dispatchImmediately("closed",{type:"closed",target:this})}},R.prototype.selectBranch=function(u){var w=this;if(!this.isDisposed()&&(u.closeTimeout&&(this.removeDispose(u.closeTimeout),u.closeTimeout=void 0),kb(u.element,"active"),u.submenuElement&&u.submenuElement.setAttribute("aria-expanded","true"),this._currentSelection&&this._currentSelection!==u&&this._currentSelection.ascendants&&ar(zs(fi([this._currentSelection]),this._currentSelection.ascendants.iterator()),function(G){u.ascendants.contains(G)||u===G||w.unselectBranch(G,!0)}),ar(u.ascendants.iterator(),function(G){G.closeTimeout&&(w.removeDispose(G.closeTimeout),G.closeTimeout=void 0),kb(G.element,"active")}),this._currentSelection=u,this.events.isEnabled("branchselected"))){var $={type:"branchselected",target:this,branch:u};this.events.dispatchImmediately("branchselected",$)}},R.prototype.unselectBranch=function(u,w){if(!this.isDisposed()&&(ZS(u.element,"active"),u.submenuElement&&u.submenuElement.removeAttribute("aria-expanded"),this._currentSelection==u&&(this._currentSelection=void 0),this.events.isEnabled("branchunselected"))){var $={type:"branchunselected",target:this,branch:u};this.events.dispatchImmediately("branchunselected",$)}},R.prototype.delayUnselectBranch=function(u,w){var $=this;this.isDisposed()||(u.closeTimeout&&(this.removeDispose(u.closeTimeout),u.closeTimeout=void 0),u.closeTimeout=this.setTimeout(function(){$.unselectBranch(u,w)},this.closeDelay),w!==!0&&u.ascendants&&ar(u.ascendants.iterator(),function(G){$.delayUnselectBranch(G,!0)}))},R.prototype.moveSelection=function(u){if(!this.isDisposed()&&this._currentSelection){var w;if(u=="up")w=this.getPrevSibling(this._currentSelection);else if(u=="down")w=this.getNextSibling(this._currentSelection);else if(u=="left"&&this.align=="right"||u=="right"&&this.align=="left"){var $=this.getSubMenu(this._currentSelection);$!=null&&(w=$[0])}else(u=="right"&&this.align=="right"||u=="left"&&this.align=="left")&&(w=this.getParentItem(this._currentSelection));w&&w!==this._currentSelection&&(this.selectBranch(w),this.setFocus(w),this._currentSelection=w)}},R.prototype.getSiblings=function(u){var w=this.getParentItem(u);return w&&w.menu?w.menu:[]},R.prototype.getParentItem=function(u){return u.ascendants&&u.ascendants.length?u.ascendants.getIndex(u.ascendants.length-1):void 0},R.prototype.getNextSibling=function(u){var w=this.getSiblings(u);if(w.length>1){var $=w.indexOf(u)+1;return w[$=w.length==$?0:$].unsupported?this.getNextSibling(w[$]):w[$]}return u},R.prototype.getPrevSibling=function(u){var w=this.getSiblings(u);if(w.length>1){var $=w.indexOf(u)-1;return w[$=$==-1?w.length-1:$].unsupported?this.getPrevSibling(w[$]):w[$]}return u},R.prototype.setFocus=function(u){if(u.interactions)try{u.interactions.element.focus()}catch{}},R.prototype.setBlur=function(u){if(u.interactions)try{u.interactions.element.blur()}catch{}},R.prototype.hideBranch=function(u){u.element.style.display="none"},R.prototype.showBranch=function(u){u.element.style.display=""},Object.defineProperty(R.prototype,"element",{get:function(){return this._element},enumerable:!0,configurable:!0}),R}(St);function li(U,R,u){return new Promise(function(w,$){var G=Te(u)&&u.responseType=="blob",K=new XMLHttpRequest;if(K.onload=function(){if(K.status===200){var we,De;if(G)return void is(we=K.response).then(function(Ke){var Qe={xhr:K,error:!1,response:Ke,blob:we,type:K.getResponseHeader("Content-Type"),target:R};w(Qe)});De=K.responseText||K.response;var Ve={xhr:K,error:!1,response:De,blob:we,type:K.getResponseHeader("Content-Type"),target:R};w(Ve)}else $({xhr:K,error:!0,type:K.getResponseHeader("Content-Type"),target:R})},K.onerror=function(){$({xhr:K,error:!0,type:K.getResponseHeader("Content-Type"),target:R})},K.open("GET",U,!0),u&&u.withCredentials&&(K.withCredentials=!0),Te(u)){if(Te(u.requestHeaders))for(var re=0;re to load"))},1e4)})];case 3:return[2,u.sent()];case 4:return[2]}})})}function ch(U,R,u){return he(this,void 0,void 0,function(){var w,$,G,K;return _e(this,function(re){switch(re.label){case 0:return re.trys.push([0,2,,3]),[4,li(R)];case 1:return w=re.sent(),[3,3];case 2:return $=re.sent(),console.error("Failed to load stylesheet",R,$),[2];case 3:(G=U.createElement("style")).textContent=w.response,U.head.appendChild(G),re.label=4;case 4:return re.trys.push([4,,7,8]),[4,hc(G)];case 5:return K=re.sent(),[4,PI(U,R,K,u)];case 6:return re.sent(),[3,8];case 7:return U.head.removeChild(G),[7];case 8:return[2]}})})}function PI(U,R,u,w){return he(this,void 0,void 0,function(){var $,G,K,re,ue;return _e(this,function(we){switch(we.label){case 0:for($=[],G=u.length,K=0;K"+ei[0]+""+this.serializeElement(this.sprite.paper.defs)+this.serializeElement(this.sprite.dom),u,ue,we,Ke,De,Ve),ci=new Blob([di],{type:"image/svg+xml"}),G=$.createObjectURL(ci),[4,this.loadNewImage(G,ue*Ke*Qe,we*Ke*Qe,"anonymous")];case 3:return qi=rr.sent(),ft.drawImage(qi,0,0),[3,5];case 4:return G!==null&&$.revokeObjectURL(G),K!==null&&wi(K,function(Ii){$.revokeObjectURL(Ii)}),this.restoreRemovedObjects(),[7];case 5:return[2,re]}})})},R.prototype.getCanvasAdvanced=function(u){return he(this,void 0,void 0,function(){var w,$,G,K,re,ue,we,De,Ve,Ke,Qe;return _e(this,function(ft){switch(ft.label){case 0:return Te(u)||(u={}),[4,this.imagesToDataURI(this.sprite.dom,u)];case 1:return ft.sent(),w=this.backgroundColor||this.findBackgroundColor(this.sprite.dom),[4,this.canvg];case 2:return $=ft.sent(),G=this.sprite.pixelWidth,K=this.sprite.pixelHeight,re=v3(this.sprite.dom),ue=_3(this.sprite.dom),we=u.scale||1,De=this.getPixelRatio(u),we=this.getAdjustedScale(G*De,K*De,we,u),Ve=this.normalizeSVG(this.serializeElement(this.sprite.paper.defs)+this.serializeElement(this.sprite.dom),u,G,K,we,re,ue,w),(Ke=this.getDisposableCanvas()).style.width=G*De*we+"px",Ke.style.height=K*De*we+"px",Ke.width=G*De*we,Ke.height=K*De*we,Qe={useCORS:!0},De!=1&&(Qe.ignoreDimensions=!0,Qe.scaleWidth=G*De*we,Qe.scaleHeight=K*De*we),[4,$.fromString(Ke.getContext("2d"),Ve,Qe).render()];case 3:return ft.sent(),[2,Ke]}})})},R.prototype.getImageAdvanced=function(u,w,$){return he(this,void 0,void 0,function(){var G,K,re;return _e(this,function(ue){switch(ue.label){case 0:return(G=this._objectsAlreadyHidden)||this.hideNonExportableSprites(),Te(w)||(w=this.getFormatOptions(u)),[4,this.getCanvasAdvanced(w)];case 1:return K=ue.sent(),$===!1?[3,3]:[4,this.addExtras(K,w,!0)];case 2:K=ue.sent(),ue.label=3;case 3:return re=K.toDataURL(this.getContentType(u),w.quality),this.disposeCanvas(K),G||this.restoreNonExportableSprites(),[2,re]}})})},R.prototype.getDisposableCanvas=function(){var u=document.createElement("canvas");return u.style.position="fixed",u.style.top="-10000px",document.body.appendChild(u),u},R.prototype.disposeCanvas=function(u){document.body.removeChild(u)},R.prototype.getPixelRatio=function(u){return this.useRetina?Nr():1},R.prototype.getAdjustedScale=function(u,w,$,G){if(!G)return $;var K,re,ue=u*$,we=u*$;return G.maxWidth&&ue>G.maxWidth&&(K=G.maxWidth/u),G.maxHeight&&we>G.maxHeight&&(re=G.maxHeight/w),K||re?H(K,re):(G.minWidth&&ue",{},1,1)],{type:"image/svg+xml"}),re=G.createObjectURL(K),ue=void 0,we.label=2;case 2:return we.trys.push([2,4,,5]),[4,this.loadNewImage(re,1,1)];case 3:return ue=we.sent(),[3,5];case 4:return we.sent(),[2,!1];case 5:$.drawImage(ue,0,0),G.revokeObjectURL(re);try{return pi.setCache("simplifiedImageExport",!0),[2,!0]}catch{return pi.setCache("simplifiedImageExport",!1),[2,!1]}return[3,7];case 6:return we.sent(),pi.setCache("simplifiedImageExport",!1),[2,!1];case 7:return[2]}})})},R.prototype.loadNewImage=function(u,w,$,G){return new Promise(function(K,re){var ue;function we(){if(G){var De=ue.src;ue.onerror=function(){re(new Error('Loading image "'+u+'" failed'))},ue.removeAttribute("crossorigin"),ue.src="",ue.src=De}else re(new Error('Loading image "'+u+'" failed'))}ue=w&&$?new Image(w,$):new Image,G&&ue.setAttribute("crossOrigin",G),ue.onload=function(){K(ue)},ue.onabort=we,ue.onerror=we,ue.src=u})},R.prototype.getDOMURL=function(){return self.URL||self.webkitURL||self},R.prototype.getSVG=function(u,w,$){return $===void 0&&($=!0),he(this,void 0,void 0,function(){var G,K,re,ue,we,De,Ve,Ke,Qe,ft;return _e(this,function(Gt){switch(Gt.label){case 0:return(G=this._objectsAlreadyHidden)||this.hideNonExportableSprites(),Te(w)||(w=this.getFormatOptions("svg")),[4,this.awaitValidSprites()];case 1:return Gt.sent(),K=this.sprite.pixelWidth,re=this.sprite.pixelHeight,ue=v3(this.sprite.dom),we=_3(this.sprite.dom),De=w.scale||1,Ve=this.getPixelRatio(w),De=this.getAdjustedScale(K*Ve,re*Ve,De,w),Ke=this.normalizeSVG(this.serializeElement(this.sprite.paper.defs)+this.serializeElement(this.sprite.dom),w,K,re,De,ue,we),Qe=this.adapter.apply("charset",{charset:"charset=utf-8",type:"svg",options:w}).charset,ft=this.adapter.apply("getSVG",{data:$?"data:"+this.getContentType(u)+";"+Qe+","+encodeURIComponent(Ke):Ke,options:w}).data,G||this.restoreNonExportableSprites(),[2,ft]}})})},R.prototype.normalizeSVG=function(u,w,$,G,K,re,ue,we){var De="";$&&(De+='width="'+Math.round($*(K||1))+'px" '),G&&(De+='height="'+Math.round(G*(K||1))+'px" ');var Ve="";re&&(Ve+="font-family: "+re.replace(/"/g,"")+";"),ue&&(Ve+="font-size: "+ue+";"),K&&(De+='viewBox="0 0 '+$+" "+G+'" ');var Ke=[],Qe=u.match(//gi);if(Qe)for(var ft=0;ft]*)width="[^"]*"/,"$1")).replace(/(]*)height="[^"]*"/,"$1")).replace(/('+u+"",we&&(u=u.replace(/(]*>)/,'$1')),/MSIE |Trident\//.test(navigator.userAgent)&&(u=u.replace(/]*\/>/gi,""));var Gt=new RegExp("url\\("+Kl(Hs()),"g");if(u=(u=u.replace(Gt,"url(#")).replace(/url\("([^)]*)"\)/gm,"url($1)"),Ke.length)for(ft=0;ftGt?1:ftKe?1:Veci?1:diKe?1:Veqi?-1:ci=0)&&(Qe='"'+Qe+'"'),ue.push(Qe)},function(De,Ve){var Ke=we.indexOf(De),Qe=we.indexOf(Ve);return Ke>Qe?1:Ke",w.tableClass&&(G='
'),K=this.adapter.apply("formatDataFields",{dataFields:this.dataFields,format:"html"}).dataFields,re=this.data,w.pivot)ue=this.adapter.apply("dataFieldsOrder",{dataFieldsOrder:this.dataFieldsOrder,format:"html"}).dataFieldsOrder,G+=` +`,vr(K,function(ft,Gt){var ei=[];w.addColumnNames&&ei.push(Gt);for(var di=re.length,ci=0;cidi?-1:ei`;else{for(w.addColumnNames&&(G+=` `+this.getHTMLRow(K,w,void 0,!0,!0)+` -`),U+=` -`,we=ie.length,Re=0;Re`}return U+=` -
`,$e=this.adapter.apply("charset",{charset:"charset=utf-8",type:u,options:w}).charset,[2,this.adapter.apply("getHTML",{data:$?"data:"+this.getContentType(u)+";"+$e+","+encodeURIComponent(U):U,options:w}).data]})})},R.prototype.getHTMLRow=function(u,w,$,U,K){var ie=this;U===void 0&&(U=!1),K===void 0&&(K=!1);var ae=" ";w.rowClass&&(ae=' '),$||($=u);var we=this.adapter.apply("dataFieldsOrder",{dataFieldsOrder:this.dataFieldsOrder,format:"html"}).dataFieldsOrder,Re=K?"th":"td",$e=!0;return _r($,function(Xe,Qe){var dt=ie.convertEmptyValue(Xe,u[Xe],w),Gt=U?dt:ie.convertToSpecialFormat(Xe,dt,w);Gt=(Gt=""+Gt).replace(/[\u00A0-\u9999<>\&]/gim,function(ai){return"&#"+ai.charCodeAt(0)+";"});var Yt=Re;w.pivot&&$e&&(Yt="th"),w.cellClass?ae+=` - <`+Yt+' class="'+w.cellClass+'">'+Gt+"":ae+=` - <`+Yt+">"+Gt+"",$e=!1},function(Xe,Qe){var dt=we.indexOf(Xe),Gt=we.indexOf(Qe);return dt>Gt?1:dt`},R.prototype.getJSON=function(u,w,$){return $===void 0&&($=!0),ge(this,void 0,void 0,function(){var U,K,ie,ae,we,Re,$e,Xe,Qe=this;return _e(this,function(dt){if(Ee(w)||(w=this.getFormatOptions("json")),K=this.adapter.apply("formatDataFields",{dataFields:this.dataFields,format:"json"}).dataFields,this._dynamicDataFields)U=this.data;else for(U=[],ie=this.data,ae=function(Gt,Yt){var ai=ie[Yt];if(typeof ai=="object"){var oi={};gi(ai,function(Ui,Ji){Ee(K[Ui])&&(oi[K[Ui]]=Qe.convertToSpecialFormat(Ui,Ji,w))}),U.push(oi)}},we=ie.length,Re=0;Re

'+this.language.translate('To save the image, right-click thumbnail on the left and choose "Save picture as..."')+'

'+this.language.translate("(Press ESC to close this message)")+"

",this.language.translate("Image Export Complete")):(ai=void 0,w.match(/\.svg$/)?ai="image/svg+xml":(ai="text/plain",w+=".txt"),(oi=document.createElement("iframe")).width="1px",oi.height="1px",oi.style.display="none",document.body.appendChild(oi),(Ui=oi.contentDocument).open(ai,"replace"),Ui.write(decodeURIComponent(Yt[3])),Ui.close(),Ui.execCommand("SaveAs",!0,w),document.body.removeChild(oi))):window.location.href=u;return[2,!0]})})},R.prototype.downloadSupport=function(){return this.linkDownloadSupport()||this.msBlobDownloadSupport()},R.prototype.linkDownloadSupport=function(){var u=ui.getCache("linkDownloadSupport");if(u===!1||u===!0)return u;var w=document.createElement("a").download!==void 0;return ui.setCache("linkDownloadSupport",w),w},R.prototype.blobDownloadSupport=function(){return Ee(window.Blob)},R.prototype.msBlobDownloadSupport=function(){return Ee(window.navigator.msSaveOrOpenBlob)},R.prototype.legacyIE=function(){var u=document.createElement("div");return u.innerHTML="",u.getElementsByTagName("i").length==1},R.prototype.print=function(u,w,$){return ge(this,void 0,void 0,function(){return _e(this,function(U){return w.printMethod=="css"?[2,this.printViaCSS(u,w,$)]:[2,this.printViaIframe(u,w,$)]})})},R.prototype.printViaCSS=function(u,w,$){return ge(this,void 0,void 0,function(){var U,K,ie,ae;return _e(this,function(we){return U=document.documentElement.scrollTop||document.body.scrollTop,K=new Ns(Lb(this.container),"body > *",{display:"none",position:"fixed",visibility:"hidden",opacity:"0",clipPath:"polygon(0px 0px,0px 0px,0px 0px,0px 0px);"}),$&&document&&document.title&&(ie=document.title,document.title=$),(ae=new Image).src=u,ae.style.maxWidth="100%",ae.style.display="block",ae.style.position="relative",ae.style.visibility="visible",ae.style.opacity="1",ae.style.clipPath="none",document.body.appendChild(ae),this.setTimeout(function(){window.print()},50),/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&w.delay<1e3?w.delay=1e3:w.delay<100&&(w.delay=100),this.setTimeout(function(){document.body.removeChild(ae),K.dispose(),ie&&(document.title=document.title),document.documentElement.scrollTop=document.body.scrollTop=U},w.delay||500),[2,!0]})})},R.prototype.printViaIframe=function(u,w,$){return ge(this,void 0,void 0,function(){var U,K;return _e(this,function(ie){return(U=document.createElement("iframe")).style.visibility="hidden",document.body.appendChild(U),U.contentWindow.document.open(),U.contentWindow.document.close(),(K=new Image).src=u,K.style.maxWidth="100%",K.style.height="auto",$&&(U.contentWindow.document.title=$),U.contentWindow.document.body.appendChild(K),U.load=function(){U.contentWindow.document.body.appendChild(K)},this.setTimeout(function(){try{U.contentWindow.document.execCommand("print",!1,null)||U.contentWindow.print()}catch{U.contentWindow.print()}},w.delay||50),/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&w.delay<1e3?w.delay=1e3:w.delay<100&&(w.delay=100),this.setTimeout(function(){document.body.removeChild(U)},w.delay+50||100),[2,!0]})})},R.prototype.findBackgroundColor=function(u){var w=1,$=S4(u,"background-color");if(($.match(/[^,]*,[^,]*,[^,]*,[ ]?0/)||$=="transparent")&&(w=0),w==0){var U=u.parentElement;return U?this.findBackgroundColor(U):He("#fff")}return He($,w)},Object.defineProperty(R.prototype,"container",{get:function(){return this.adapter.apply("container",{container:this._container}).container},set:function(u){this._container=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"sprite",{get:function(){return this.adapter.apply("sprite",{sprite:this._sprite}).sprite},set:function(u){this._sprite=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"extraSprites",{get:function(){return this.adapter.apply("extraSprites",{extraSprites:this._extraSprites}).extraSprites},set:function(u){this._extraSprites=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"validateSprites",{get:function(){return this.adapter.apply("validateSprites",{validateSprites:this._validateSprites}).validateSprites},set:function(u){this._validateSprites=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"data",{get:function(){return this.adapter.apply("data",{data:this._data}).data},set:function(u){this._data=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dataFields",{get:function(){return this._dataFields||this.generateDataFields(),this.adapter.apply("dataFields",{dataFields:this._dataFields}).dataFields},set:function(u){this._dataFields=u,this._dynamicDataFields=!1},enumerable:!0,configurable:!0}),R.prototype.handleDataUpdated=function(){this._dynamicDataFields&&(this._dataFields=void 0);var u=this.data.length>0;this._prevHasData!=u&&(this._prevHasData=u,this.menu&&this.menu.invalidate())},Object.defineProperty(R.prototype,"dateFormatter",{get:function(){return this._dateFormatter||(this._dateFormatter=new AI,this._dateFormatter.language=this.language),this.adapter.apply("dateFormatter",{dateFormatter:this._dateFormatter}).dateFormatter},set:function(u){this._dateFormatter=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dateFormat",{get:function(){return this.adapter.apply("dateFormat",{dateFormat:this._dateFormat}).dateFormat},set:function(u){this._dateFormat=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dateFields",{get:function(){return this._dateFields||(this._dateFields=new Us),this.adapter.apply("dateFields",{dateFields:this._dateFields}).dateFields},set:function(u){this._dateFields=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"numberFormatter",{get:function(){return this._numberFormatter||(this._numberFormatter=new x3,this._numberFormatter.language=this.language),this.adapter.apply("numberFormatter",{numberFormatter:this._numberFormatter}).numberFormatter},set:function(u){this._numberFormatter=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"numberFormat",{get:function(){return this.adapter.apply("numberFormat",{numberFormat:this._numberFormat}).numberFormat},set:function(u){this._numberFormat=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"numberFields",{get:function(){return this._numberFields||(this._numberFields=new Us),this.adapter.apply("numberFields",{numberFields:this._numberFields}).numberFields},set:function(u){this._numberFields=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"durationFormatter",{get:function(){return this._durationFormatter||(this._durationFormatter=new F4,this._durationFormatter.language=this.language),this.adapter.apply("durationFormatter",{durationFormatter:this._durationFormatter}).durationFormatter},set:function(u){this._durationFormatter=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"durationFormat",{get:function(){return this.adapter.apply("durationFormat",{durationFormat:this._durationFormat}).durationFormat},set:function(u){this._durationFormat=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"durationFields",{get:function(){return this._durationFields||(this._durationFields=new Us),this.adapter.apply("durationFields",{durationFields:this._durationFields}).durationFields},set:function(u){this._durationFields=u},enumerable:!0,configurable:!0}),R.prototype.generateDataFields=function(){var u=this;this._dataFields={},this.data.length&&mi(this.data,function(w){gi(w,function($,U){Ee(u._dataFields[$])||(u._dataFields[$]=u.adapter.apply("dataFieldName",{name:$,field:$}).name)})})},R.prototype.isDateField=function(u){return this.adapter.apply("isDateField",{isDateField:this.dateFields.contains(u),field:u}).isDateField},R.prototype.isNumberField=function(u){return this.adapter.apply("isNumberField",{isNumberField:this.numberFields.contains(u),field:u}).isNumberField},R.prototype.isDurationField=function(u){return this.adapter.apply("isDurationField",{isDurationField:this.durationFields.contains(u),field:u}).isDurationField},R.prototype.getContentType=function(u){var w="";switch(u){case"png":case"gif":w="image/"+u;break;case"jpg":w="image/jpeg";break;case"svg":w="image/svg+xml";break;case"csv":w="text/csv";break;case"json":w="application/json";break;case"html":w="text/html";break;case"pdf":case"pdfdata":w="application/pdf";break;case"xlsx":w="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}return this.adapter.apply("contentType",{contentType:w,type:u}).contentType},Object.defineProperty(R.prototype,"filePrefix",{get:function(){return this.adapter.apply("filePrefix",{filePrefix:this._filePrefix}).filePrefix},set:function(u){this._filePrefix=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"backgroundColor",{get:function(){return this.adapter.apply("backgroundColor",{backgroundColor:this._backgroundColor}).backgroundColor},set:function(u){this._backgroundColor=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"title",{get:function(){return this.adapter.apply("title",{title:this._title}).title},set:function(u){this._title=u},enumerable:!0,configurable:!0}),R.prototype.showPreloader=function(){var u=this.preloader;u&&(u.progress=.5,u.label.text="...")},R.prototype.hidePreloader=function(){var u=this.preloader;u&&(u.progress=1)},Object.defineProperty(R.prototype,"preloader",{get:function(){return this._sprite&&this._sprite.parent&&this._sprite.parent.preloader?this._sprite.parent.preloader:void 0},enumerable:!0,configurable:!0}),R.prototype.showTimeout=function(){this.showModal(this.adapter.apply("timeoutMessage",{message:this.language.translate("Export operation took longer than expected. Something might have gone wrong.")}).message)},R.prototype.hideTimeout=function(){this._timeoutTimeout&&(this.removeDispose(this._timeoutTimeout),this._timeoutTimeout=null),this.hideModal()},Object.defineProperty(R.prototype,"language",{get:function(){return this._language||(this._language=new y1),this._language},set:function(u){this._language=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"modal",{get:function(){return this._modal||(this._modal=new Y$,this._modal.adapter.add("classPrefix",function(u){return no.classNamePrefix+u})),this._modal},enumerable:!0,configurable:!0}),R.prototype.showModal=function(u,w){this.hideModal(),this.hidePreloader();var $=this.modal;$.container=this.sprite.svgContainer.SVGContainer,$.content=u,$.readerTitle=w,$.open()},R.prototype.hideModal=function(){this._modal&&this.modal.close()},R.prototype._canvg=function(){return ge(this,void 0,void 0,function(){var u;return _e(this,function(w){switch(w.label){case 0:return[4,o.e(265).then(o.bind(o,1234))];case 1:return(u=w.sent()).default!=null?[2,u.default]:[2,u]}})})},Object.defineProperty(R.prototype,"canvg",{get:function(){return this._canvg()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pdfmake",{get:function(){return Lx==null&&(Lx=function(){return ge(this,void 0,void 0,function(){var u,w,$,U;return _e(this,function(K){switch(K.label){case 0:return[4,Promise.all([o.e(643).then(o.t.bind(o,6727,23)),o.e(643).then(o.bind(o,4995))])];case 1:return u=K.sent(),w=u[0],$=u[1],(U=window).pdfMake=U.pdfMake||{},U.pdfMake.vfs=$.default,w.vfs=$.default,[2,w]}})})}()),Lx},enumerable:!0,configurable:!0}),R.prototype._xlsx=function(){return ge(this,void 0,void 0,function(){return _e(this,function(u){switch(u.label){case 0:return[4,Promise.all([o.e(739),o.e(297)]).then(o.t.bind(o,7739,23))];case 1:return[2,u.sent()]}})})},Object.defineProperty(R.prototype,"xlsx",{get:function(){return this._xlsx()},enumerable:!0,configurable:!0}),R.prototype.setFormatOptions=function(u,w){this._formatOptions.setKey(u,w)},R.prototype.getFormatOptions=function(u){return this._formatOptions.getKey(u)},Object.defineProperty(R.prototype,"formatOptions",{get:function(){return this._formatOptions},enumerable:!0,configurable:!0}),R.prototype._disablePointers=function(){Ee(this._spriteInteractionsEnabled)||(this._spriteInteractionsEnabled=this.sprite.interactionsEnabled),this.sprite.interactionsEnabled=!1},R.prototype._releasePointers=function(){Ee(this._spriteInteractionsEnabled)&&!this._exportRunning&&(this.sprite.interactionsEnabled=this._spriteInteractionsEnabled)},R.prototype.hideNonExportableSprites=function(){var u=this;if(!this._objectsAlreadyHidden){var w=this.sprite.svgContainer;w&&mi(w.nonExportableSprites,function($){$.isHidden||$.isHiding||!$.visible||u._hiddenObjects.push($),$.hide(0)}),this._objectsAlreadyHidden=!0}},R.prototype.restoreNonExportableSprites=function(){this._objectsAlreadyHidden&&(mi(this._hiddenObjects,function(u){u.show(0)}),this._hiddenObjects=[],this._objectsAlreadyHidden=!1)},R.prototype.awaitValidSprites=function(){return ge(this,void 0,void 0,function(){var u;return _e(this,function(w){switch(w.label){case 0:return u=[],this.validateSprites.length&&mi(this.validateSprites,function($,U){$.invalid&&u.push(new Promise(function(K,ie){$.events.once("validated",function(ae){K()})}))}),u.length?[4,Promise.all(u)]:[3,2];case 1:w.sent(),w.label=2;case 2:return[2]}})})},R.prototype.processConfig=function(u){ui.registeredClasses.ExportMenu=jt,u&&(Ee(u.menu)&&!Ee(u.menu.type)&&(u.menu.type="ExportMenu"),Ee(u.dataFields)&&it(u.dataFields)&&(this.dataFields=u.dataFields,delete u.dataFields)),j.prototype.processConfig.call(this,u)},R.XLINK="http://www.w3.org/1999/xlink",R}(xt),gc=["fill","fillOpacity","stroke","strokeOpacity","strokeWidth","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin"],so=function(j){function R(){var u=j.call(this)||this;return u.properties={},u._eventDispatcher=new rz(u),u._bindings={},u._isTemplate=!1,u._isPath=!1,u._inited=!1,u._ready=!1,u.isHiding=!1,u._isHidden=!1,u.isShowing=!1,u.isStandaloneInstance=!1,u._isActive=!1,u._mask=new Jn,u._positionPrecision=3,u._language=new Jn,u._exporting=new Jn,u._exportable=!0,u._bbox={x:0,y:0,width:0,height:0},u.invalid=!1,u.positionInvalid=!1,u.propertyFields={},u.applyOnClones=!1,u._measuredWidthSelf=0,u._measuredHeightSelf=0,u.maxLeft=0,u.maxRight=0,u.maxTop=0,u.maxBottom=0,u.maxLeftSelf=0,u.maxRightSelf=0,u.maxTopSelf=0,u.maxBottomSelf=0,u._isDragged=!1,u._isResized=!1,u._disabled=!1,u._internalDisabled=!1,u._updateDisabled=!1,u._internalDefaultsApplied=!1,u.rollOutDelay=0,u.isBaseSprite=!1,u.shouldClone=!0,u.appeared=!1,u.ex=0,u.ey=0,u.dragWhileResize=!1,u.measureFailed=!1,u.preventShow=!1,u.cloneTooltip=!0,u.className="Sprite",u._disposers.push(u._eventDispatcher),u.uid,u.group=u.paper.addGroup("g"),u.setPropertyValue("scale",1),u.setPropertyValue("rotation",0),u.setPropertyValue("align","none"),u.setPropertyValue("valign","none"),u.setPropertyValue("pixelPerfect",!1),u.setPropertyValue("visible",!0),u.setPropertyValue("tooltipPosition","fixed"),u.setPropertyValue("verticalCenter","none"),u.setPropertyValue("horizontalCenter","none"),u.setPropertyValue("tooltipX",he(50)),u.setPropertyValue("tooltipX",he(50)),u.setPropertyValue("marginTop",0),u.setPropertyValue("marginBottom",0),u.setPropertyValue("marginLeft",0),u.setPropertyValue("marginRight",0),u.setPropertyValue("dx",0),u.setPropertyValue("dy",0),u.setPropertyValue("paddingTop",0),u.setPropertyValue("paddingBottom",0),u.setPropertyValue("paddingRight",0),u.setPropertyValue("paddingLeft",0),u.setPropertyValue("togglable",!1),u.setPropertyValue("hidden",!1),u.setPropertyValue("urlTarget","_self"),u.setPropertyValue("alwaysShowTooltip",!1),u.setPropertyValue("showTooltipOn","hover"),u._prevMeasuredWidth=0,u._prevMeasuredHeight=0,u._measuredWidth=0,u._measuredHeight=0,u._isMeasured=!0,u.invalidate(),u.applyTheme(),u._disposers.push(u.events),u._disposers.push(u.group),u._disposers.push(u._mask),u._disposers.push(u._language),u._disposers.push(u._exporting),u._disposers.push(new jr(function(){gi(u._bindings,function(w,$){$.dispose()})})),u.setPropertyValue("interactionsEnabled",!0),u}return re(R,j),Object.defineProperty(R.prototype,"events",{get:function(){return this._eventDispatcher},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"adapter",{get:function(){return this._adapterO||(this._adapterO=new tc(this)),this._adapterO},enumerable:!0,configurable:!0}),R.prototype.applyTheme=function(){j.prototype.applyTheme.call(this),no.autoSetClassName&&this.setClassName()},R.prototype.getCurrentThemes=function(){var u=this._themes;if(u)return u;var w=this._parent;return w?w.getCurrentThemes():ui.themes},R.prototype.applyInternalDefaults=function(){this._internalDefaultsApplied=!0},R.prototype.invalidate=function(){this.disabled||this._isTemplate||this.__disabled||this.invalid||(this.invalid=!0,ui.addToInvalidSprites(this),ia.requestFrame())},R.prototype.validate=function(){this.dispatchImmediately("beforevalidated"),this._internalDefaultsApplied||this.applyInternalDefaults(),this.beforeDraw(),this.draw(),this.invalid=!1,ui.removeFromInvalidSprites(this),this.afterDraw()},R.prototype.invalidatePosition=function(){this.disabled||this._isTemplate||this.positionInvalid||(this.positionInvalid=!0,ui.addToInvalidPositions(this),ia.requestFrame())},R.prototype.validatePosition=function(){var u=this.pixelX,w=this.pixelY,$=this.dx,U=this.dy,K=u+$,ie=w+U;this._updateDisabled&&(this._internalDisabled?this.group.attr({display:"none"}):this.disabled||this.removeSVGAttribute("display"),this._updateDisabled=!1);var ae=this.measure(),we=this.group.transformString;this.group.moveTo({x:K,y:ie}),this.group.rotation=this.rotation,this.nonScaling?this.group.scale=this.scale/this.globalScale:this.group.scale=this.scale,(we!=this.group.transformString||ae)&&(we==null?this.dispatch("transformed"):this.dispatchImmediately("transformed"),this.dispatch("positionchanged"),this.showTooltipOn!="hit"&&this.showTooltipOn!="always"||this.updateTooltipPosition()),u+$==K&&w+U==ie&&(ui.removeFromInvalidPositions(this),this.positionInvalid=!1);var Re=this._maskRectangle;Re&&this._clipElement.moveTo({x:Re.x-u,y:Re.y-w})},R.prototype.beforeDraw=function(){},R.prototype.draw=function(){},R.prototype.afterDraw=function(){var u,w;if((this.isMeasured||this.horizontalCenter!=="none"||this.verticalCenter!=="none")&&this.measureElement(),this._inited)this.dispatch("validated");else{if(this._adapterO)try{for(var $=Ie(this._adapterO.keys()),U=$.next();!U.done;U=$.next()){var K=U.value;switch(K){case"mask":case"fill":case"opacity":case"fillOpacity":case"stroke":case"strokeOpacity":case"strokeWidth":case"shapeRendering":case"strokeDasharray":case"strokeDashoffset":case"strokeLinecap":case"strokeLinejoin":case"textDecoration":case"fontSize":case"fontFamily":case"fontWeight":this[K]=this[K]}}}catch(ie){u={error:ie}}finally{try{U&&!U.done&&(w=$.return)&&w.call($)}finally{if(u)throw u.error}}this.applyFilters(),this.visible=this.visible,this.interactionsEnabled=this.getPropertyValue("interactionsEnabled"),this._inited=!0,this.showOnInit||(this.appeared=!0),this.hidden&&this.hide(0),this.applyMask(),this.dispatch("validated"),this.dispatch("inited"),this.dispatchReady()}this.showTooltipOn=="always"&&(!this.visible||this.disabled||this.__disabled?this.hideTooltip(0):this.showTooltip())},R.prototype.dispatchReady=function(){this.isReady()||(this._ready=!0,this.dispatch("ready"))},R.prototype.reinit=function(){this._inited=!1,this.setState(this.defaultState),this.invalidate()},R.prototype.handleGlobalScale=function(){this.dispatch("globalscalechanged"),this.nonScalingStroke&&(this.strokeWidth=this.strokeWidth),this.nonScaling&&this.validatePosition(),this.updateFilterScale()},R.prototype.updateFilterScale=function(){var u=this;pr(this.filters.iterator(),function(w){w.scale=u.globalScale})},R.prototype.removeFromInvalids=function(){ui.removeFromInvalidSprites(this),ui.removeFromInvalidPositions(this)},R.prototype.copyFrom=function(u){var w=this;j.prototype.copyFrom.call(this,u),this.isMeasured=u.isMeasured,this.states.copyFrom(u.states),u.filters.length>0&&u.filters.each(function($){w.filters.push($.clone())}),u._adapterO&&this.adapter.copyFrom(u._adapterO),u._interaction&&this.interactions.copyFrom(u.interactions),u._plugins&&this.plugins.copyFrom(u.plugins),this.configField=u.configField,this.applyOnClones=u.applyOnClones,this.disabled=u.disabled,this.virtualParent=u.virtualParent,this.exportable=u.exportable,u._tooltip&&(this._tooltip?this._tooltip.copyFrom(u.tooltip):u.cloneTooltip?this.tooltip=u.tooltip.clone():this._tooltip=u.tooltip),this._showSystemTooltip=u.showSystemTooltip,tn(u.propertyFields,this.propertyFields),tn(u.properties,this),u.fillModifier&&(this.fillModifier=u.fillModifier.clone()),u.strokeModifier&&(this.strokeModifier=u.strokeModifier.clone()),u.focusFilter&&(this.focusFilter=u.focusFilter.clone())},R.prototype.dispose=function(){if(!this.isDisposed()){if(this.showTooltipOn=="always"&&this.tooltip&&this.tooltip.hide(),this.dispatchImmediately("beforedisposed"),this.isBaseSprite){if(this.htmlContainer)for(;this.htmlContainer.childNodes.length>0;)this.htmlContainer.removeChild(this.htmlContainer.firstChild);this.isBaseSprite=!1}if(j.prototype.dispose.call(this),this._adapterO&&this._adapterO.clear(),this.applyOnClones&&this._clones)for(var u=this._clones.length-1;u>=0;u--)this._clones.getIndex(u).dispose();this._svgContainer&&this._svgContainer.dispose(),this._interactionDisposer&&(this._interactionDisposer.dispose(),this._interactionDisposer=void 0),this._urlDisposer&&this._urlDisposer.dispose(),this.removeFromInvalids(),this.element&&this.element.dispose(),this.group&&this.group.dispose(),this._numberFormatter&&this._numberFormatter.dispose(),this._focusFilter&&this._focusFilter.dispose();var w=this.stroke;!w||w instanceof Te||!w.dispose||this.clonedFrom&&this.clonedFrom.stroke==w||w.dispose();var $=this.fill;if(!$||$ instanceof Te||!$.dispose||this.clonedFrom&&this.clonedFrom.fill==$||$.dispose(),Ee(this.id)&&this.map.removeKey(this.id),this.parent=void 0,this._filters)for(;this._filters.length>0;){var U=this._filters.getIndex(0);U.dispose(),this._filters.removeValue(U)}this._alwaysShowDisposers=void 0}},Object.defineProperty(R.prototype,"isTemplate",{get:function(){return this._isTemplate},set:function(u){u=St(u),this._isTemplate!=u&&(this._isTemplate=u,this instanceof Zn&&pr(this.children.iterator(),function(w){w.isTemplate=u}),u?(this.parent=this._parent,this.removeFromInvalids()):this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"showSystemTooltip",{get:function(){return Ee(this._showSystemTooltip)?this._showSystemTooltip:this.virtualParent?this.virtualParent.showSystemTooltip:!!this._parent&&this._parent.showSystemTooltip},set:function(u){u=St(u),this._showSystemTooltip!=u&&(this._showSystemTooltip=u,this.applyAccessibility())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"topParent",{get:function(){return this._topParent?this._topParent:this._parent?this._parent.topParent:void 0},set:function(u){this._topParent=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"parent",{get:function(){return this._parent},set:function(u){if(!this._isTemplate){this.paper;var w=this._parent;w!=u&&(w&&w.children.removeValue(this),this._parent=u,u?(this.topParent=u.topParent,u.isTemplate&&(this.isTemplate=!0),this.baseId=u.baseId,u.children.push(this),this._tooltip&&!this._tooltipContainer&&(this._tooltip.parent=u.tooltipContainer),this._dataItem||(this.dataItem=u.dataItem),this.handleAlwaysShowTooltip(),this.dataItem&&this.applyAccessibility(),this.dispatchImmediately("parentset")):this.topParent=void 0)}},enumerable:!0,configurable:!0}),R.prototype.handleAlwaysShow=function(){this.showTooltip()},R.prototype.handleAlwaysShowTooltip=function(){var u=this,w=this._alwaysShowDisposers;if(w&&mi(w,function(U){U.dispose()}),this._alwaysShowDisposers=[],this.showTooltipOn=="always")for(;u!=null;){var $=u.events.on("visibilitychanged",this.handleAlwaysShow,this,!1);this.addDisposer($),this._alwaysShowDisposers.push($),u=u.parent}},Object.defineProperty(R.prototype,"virtualParent",{get:function(){return this._virtualParent},set:function(u){this._virtualParent=u,this.dataItem&&this.applyAccessibility()},enumerable:!0,configurable:!0}),R.prototype.appendDefs=function(){this.filterElement&&this.paper.appendDef(this.filterElement);var u=this.fill;u&&u.element&&this.paper.appendDef(u.element);var w=this.stroke;if(w&&w.element&&this.paper.appendDef(w.element),this.fillModifier&&this.fill instanceof Te){var $=this.fillModifier.modify(this.fill);$&&$.element&&this.paper.appendDef($.element)}if(this.strokeModifier&&this.stroke instanceof Te){var U=this.strokeModifier.modify(this.stroke);U&&U.element&&this.paper.appendDef(U.element)}this._clipPath&&this.paper.appendDef(this._clipPath),this._exportable===!1&&(this.exportable=!1)},Object.defineProperty(R.prototype,"map",{get:function(){var u=this.topParent;return u?u.map:(this._map||(this._map=new fa),this._map)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"delayedMap",{get:function(){var u=this.topParent;return u?u.delayedMap:(this._delayedMap||(this._delayedMap=new fa),this._delayedMap)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"id",{get:function(){return this._id},set:function(u){if(this._id!=u){if(this._id=u,this.map.hasKey(u))throw Error("Duplicate id ("+u+") used on multiple objects.");this.map.setKey(u,this),no.autoSetClassName&&this.setClassName()}},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dom",{get:function(){return this.group.node},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"paper",{get:function(){if(this._paper)return this._paper;var u=this._parent;return u?u.paper:Fx()},set:function(u){this.setPaper(u)},enumerable:!0,configurable:!0}),R.prototype.setPaper=function(u){return this._paper!=u&&(this._paper=u,this.appendDefs(),!0)},Object.defineProperty(R.prototype,"htmlContainer",{get:function(){if(this._htmlContainer)return this._htmlContainer;var u=this._parent;return u?u.htmlContainer:void 0},set:function(u){this._htmlContainer=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"titleElement",{get:function(){return this._titleElement||(this._titleElement=this.paper.add("title"),this.group.add(this._titleElement)),this._titleElement},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"descriptionElement",{get:function(){return this._descriptionElement||(this._descriptionElement=this.paper.add("desc"),this.group.add(this._descriptionElement)),this._descriptionElement},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"filters",{get:function(){return this._filters||(this._filters=new Us,this._disposers.push(this._filters.events.onAll(this.applyFilters,this)),this._disposers.push(new ta(this._filters))),this._filters},enumerable:!0,configurable:!0}),R.prototype.setSVGAttributes=function(){this.fill=this.fill,this.opacity=this.opacity,this.fillOpacity=this.fillOpacity,this.stroke=this.stroke,this.strokeOpacity=this.strokeOpacity,this.shapeRendering=this.shapeRendering,this.strokeDasharray=this.strokeDasharray,this.strokeDashoffset=this.strokeDashoffset,this.strokeLinecap=this.strokeLinecap,this.strokeLinejoin=this.strokeLinejoin,this.focusable=this.focusable,this.tabindex=this.tabindex,this.role=this.role},R.prototype.setSVGAttribute=function(u){this.group.attr(u)},R.prototype.removeSVGAttribute=function(u){this.group.removeAttr(u)},R.prototype.setClassName=function(){var u=this.className,w=no.classNamePrefix;this.element&&this.element.addClass(w+u),this.group.addClass(w+u+"-group"),Ee(this.id)&&this.group.addClass(w+this.id),this.userClassName&&this.group.addClass(this.userClassName)},R.prototype.uidAttr=function(){return this.setSVGAttribute({id:this.uid}),this.uid},R.prototype.updateClipPath=function(){var u=this._clipElement;u&&u.moveTo({x:this.mask.pixelX,y:this.mask.pixelY})},R.prototype.createClipPath=function(){if(!this._clipPath){this._clipPath=this.paper.addGroup("clipPath"),this.paper.appendDef(this._clipPath),this._disposers.push(this._clipPath);var u=ui.getUniqueId();this._clipPath.attr({id:u}),this.group.attr({"clip-path":'url("'+Ds()+u+'")'})}},R.prototype.applyMask=function(){var u=this.mask;if(this._clipPath&&u)if(u instanceof Zn){this._clipElement.attr({width:ve(0,u.pixelWidth),height:ve(0,u.pixelHeight)});var w=wp({x:u.pixelX,y:u.pixelY},u.parent,this);this._clipPath.x=w.x,this._clipPath.y=w.y}else u.element&&u.element!=this._clipElement&&(this._clipElement=u.element,this._clipPath.add(this._clipElement)),this._clipPath.scale=u.scale,this._clipPath.x=u.pixelX,this._clipPath.y=u.pixelY,this._clipPath.rotation=u.rotation},R.prototype.applyFilters=function(){var u=this;if(this._filters&&this._filters.length>0){var w=100,$=100;this.filterElement?this.filterElement.removeChildNodes():(this.filterElement=this.paper.addGroup("filter"),this._disposers.push(this.filterElement)),this.paper.appendDef(this.filterElement);var U="filter-"+this.uid;this.filterElement.attr({id:U}),pr(this.filters.iterator(),function(ae){ae.sprite=u,ae.paper=u.paper,u.filterElement.attr({filterUnits:ae.filterUnits}),ae.appendPrimitives(u.filterElement),ae.width>w&&(w=ae.width),ae.height>$&&($=ae.height),ae.scale=u.globalScale});var K=w+"%",ie=$+"%";this.filterElement.attr({width:K,height:ie,x:-(w-100)/2+"%",y:-($-100)/2+"%"}),this.group.attr({filter:'url("'+Ds()+U+'")'})}else this.filterElement&&(this.group.removeAttr("filter"),this.filterElement.removeChildNodes())},R.prototype.removeClipPath=function(){this._clipPath&&(this.removeDispose(this._clipPath),this._clipPath=void 0)},R.prototype.setElement=function(u){this.element=u,this.setSVGAttributes(),this.applyAccessibility()},Object.defineProperty(R.prototype,"element",{get:function(){return this._element},set:function(u){this.removeElement(),this._element=u,this.group.add(u),u.node instanceof SVGPathElement&&(this._isPath=!0),this.invalid||this.validate(),no.autoSetClassName&&this.setClassName()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"svgContainer",{get:function(){return this._svgContainer?this._svgContainer:this._parent?this._parent.svgContainer:void 0},set:function(u){this._svgContainer=u},enumerable:!0,configurable:!0}),R.prototype.measureElement=function(){if(this.element)if(this.definedBBox)this._bbox=this.definedBBox;else{var u=this.element.getBBox();this._bbox={x:u.x,y:u.y,width:u.width,height:u.height}}},R.prototype.updateCenter=function(){if(this.element){var u=this.element.transformString,w=this.bbox,$=0,U=0,K=w.x,ie=w.y,ae=w.width,we=w.height,Re=this.pixelPaddingLeft,$e=this.pixelPaddingRight,Xe=this.pixelPaddingTop,Qe=this.pixelPaddingBottom,dt=ve(ae+Re+$e,this.pixelWidth),Gt=ve(we+Xe+Qe,this.pixelHeight),Yt=w.x,ai=w.x+dt,oi=w.y,Ui=w.y+Gt,Ji=this.horizontalCenter,Si=this.verticalCenter;switch(Ji){case"none":$=K+Re;break;case"left":$=Re;break;case"middle":$=Re-(ae+$e+Re)/2;break;case"right":$=-$e-ae}switch(Si){case"none":U=ie+Xe;break;case"top":U=Xe;break;case"middle":U=Xe-(we+Qe+Xe)/2;break;case"bottom":U=-Qe-we}this._measuredHeight=Gt,this._measuredWidth=dt;var Hi=Ve($-K,this._positionPrecision,!0),nr=Ve(U-ie,this._positionPrecision,!0);this.ex=Hi-Re,this.ey=nr-Xe,this.maxLeft=Yt+Hi-Re,this.maxRight=ai+Hi-Re,this.maxTop=oi+nr-Xe,this.maxBottom=Ui+nr-Xe,this.pixelPerfect&&no.pixelPerfectPrecision==0&&(Hi-=.5,nr-=.5),this.element.moveTo({x:Hi,y:nr}),u!=this.element.transformString&&this.dispatchImmediately("transformed")}},R.prototype.measure=function(){this.updateCenter();var u=this._measuredWidth,w=this._measuredHeight,$=this.maxLeft,U=this.maxRight,K=this.maxTop,ie=this.maxBottom;this._measuredWidthSelf=u,this._measuredHeightSelf=w;var ae=this._positionPrecision;if(this.maxLeftSelf=this.maxLeft,this.maxRightSelf=this.maxRight,this.maxTopSelf=this.maxTop,this.maxBottomSelf=this.maxBottom,this.rotation!==0||this.scale!==1||this.nonScaling){this.nonScalingStroke&&(this.strokeWidth=this.strokeWidth);var we=this.paper.svg,Re=we.createSVGMatrix(),$e=this.rotation,Xe=this.scale;this.nonScaling&&(Xe=this.scale/this.globalScale),Re.a=A($e)*Xe,Re.c=-Ue($e)*Xe,Re.e=0,Re.b=Ue($e)*Xe,Re.d=A($e)*Xe,Re.f=0;var Qe=we.createSVGPoint();Qe.x=$,Qe.y=K;var dt=we.createSVGPoint();dt.x=U,dt.y=K;var Gt=we.createSVGPoint();Gt.x=U,Gt.y=ie;var Yt=we.createSVGPoint();Yt.x=$,Yt.y=ie;var ai=Qe.matrixTransform(Re),oi=dt.matrixTransform(Re),Ui=Gt.matrixTransform(Re),Ji=Yt.matrixTransform(Re);$=Math.min(ai.x,oi.x,Ui.x,Ji.x),U=Math.max(ai.x,oi.x,Ui.x,Ji.x),K=Math.min(ai.y,oi.y,Ui.y,Ji.y),u=U-$,w=(ie=Math.max(ai.y,oi.y,Ui.y,Ji.y))-K,this.maxLeft=Ve($,ae,!0),this.maxRight=Ve(U,ae,!0),this.maxTop=Ve(K,ae,!0),this.maxBottom=Ve(ie,ae,!0)}return this._measuredWidth=Ve(u,ae,!0),this._measuredHeight=Ve(w,ae,!0),(this._measuredWidth!=this._prevMeasuredWidth||this._measuredHeight!=this._prevMeasuredHeight)&&(this._prevMeasuredHeight=this._measuredHeight,this._prevMeasuredWidth=this._measuredWidth,this.dispatch("sizechanged"),(this.isHover||this.showTooltipOn=="hit"||this.showTooltipOn=="always")&&this.tooltip&&this.tooltip.visible&&(Ee(this.tooltipText)||Ee(this.tooltipHTML))&&this.updateTooltipPosition(),!0)},R.prototype.insertBefore=function(u){var w=this._parent;if(w){var $=w.children.indexOf(u);$!==-1&&(w.children.moveValue(this,$),w.sortChildren())}return this},R.prototype.insertAfter=function(u){var w=this._parent;if(w){var $=w.children.indexOf(u);$!==-1&&(w.children.moveValue(this,$+1),w.sortChildren())}return this},R.prototype.removeElement=function(){this._element&&(this.removeDispose(this._element),this._element=void 0)},R.prototype.getRelativeX=function(u){return u instanceof J?u.value:this._parent?u/this._parent.innerWidth:0},R.prototype.getRelativeY=function(u){return u instanceof J?u.value:this._parent?u/this._parent.innerHeight:0},R.prototype.getPixelX=function(u){var w=0;if(le(u))w=u;else if(u instanceof J){var $=u.value;this._parent&&(w=Ve(this._parent.innerWidth*$,this._positionPrecision,!0))}return w},R.prototype.getPixelY=function(u){var w=0;if(le(u))w=u;else if(u instanceof J){var $=u.value;this._parent&&(w=Ve(this._parent.innerHeight*$,this._positionPrecision,!0))}return w},R.prototype.moveTo=function(u,w,$,U){this.isDragged&&!U||(u&&(le(u.x)&&this.setPropertyValue("x",Ve(u.x,this._positionPrecision,!0)),le(u.y)&&this.setPropertyValue("y",Ve(u.y,this._positionPrecision,!0))),le(w)&&(this.rotation=w),le($)&&(this.scale=$),this.invalidatePosition())},Object.defineProperty(R.prototype,"mask",{get:function(){return this._adapterO?this._adapterO.apply("mask",this._mask.get()):this._mask.get()},set:function(u){var w=this;this._mask.get()!==u&&(u?(this.createClipPath(),u instanceof Zn?this._clipElement=this.paper.add("rect"):(u.isMeasured=!1,u.element&&(this._clipElement=u.element)),this._clipElement&&this._clipPath.add(this._clipElement),this._mask.set(u,new Nn([u.events.on("maxsizechanged",function(){w.inited&&w.applyMask()},void 0,!1),u.events.on("validated",this.applyMask,this,!1),u.events.on("positionchanged",this.applyMask,this,!1)])),this.applyMask()):(this._mask.reset(),this.group.removeAttr("clip-path"),this.removeClipPath()))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maskRectangle",{get:function(){return this._maskRectangle},set:function(u){u?(this.createClipPath(),this._clipElement||(this._clipElement=this.paper.add("rect"),this._clipPath.add(this._clipElement)),this._clipElement.attr({width:u.width,height:u.height})):(this.removeClipPath(),this._clipElement=void 0),this._maskRectangle=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"isMeasured",{get:function(){return this._isMeasured},set:function(u){(u=St(u))||(this._measuredWidth=0,this._measuredHeight=0),this._isMeasured!=u&&(this._isMeasured=u,this.invalidatePosition())},enumerable:!0,configurable:!0}),R.prototype.hitTest=function(u){this.invalid&&this.validate(),u.invalid&&u.validate();var w=this.pixelX+this.maxLeft,$=this.pixelY+this.maxTop,U=w+this.maxRight,K=$+this.maxBottom,ie=u.pixelX+u.maxLeft,ae=u.pixelY+u.maxTop,we=ie+u.maxRight,Re=ae+u.maxBottom;return!(ie>U||weK||Re<$)},Object.defineProperty(R.prototype,"inited",{get:function(){return this._inited},enumerable:!0,configurable:!0}),R.prototype.isReady=function(){return this._ready},Object.defineProperty(R.prototype,"states",{get:function(){if(!this._states){var u=new Nr;this._states=new cm(u),this._disposers.push(this._states.events.on("insertKey",this.processState,this,!1)),this._disposers.push(this._states.events.on("setKey",this.processState,this,!1)),this._disposers.push(new Yd(this._states)),this._disposers.push(u)}return this._states},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"hiddenState",{get:function(){if(!this.states.getKey("hidden")){var u=this.states.create("hidden");u.properties.opacity=0,u.properties.visible=!1}return this.states.getKey("hidden")},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"defaultState",{get:function(){return this.states.getKey("default")||(this.states.create("default").properties.opacity=1),this.states.getKey("default")},enumerable:!0,configurable:!0}),R.prototype.processState=function(u){var w=u.newValue;if(w.sprite=this,w.name=u.key,(this.states.hasKey("hover")||this.showTooltipOn=="hover"&&(Ee(this.tooltipHTML)||Ee(this.tooltipText)))&&(this.hoverable=!0),(this.states.hasKey("down")||this.showTooltipOn=="hover"&&(Ee(this.tooltipHTML)||Ee(this.tooltipText)))&&(this.clickable=!0),this.states.hasKey("focus")&&(this.focusable=!0),this.applyOnClones)for(var $=this.clones.values,U=$.length,K=0;K0&&((U=this.animate(ie,w,$))&&!U.isFinished()?this._disposers.push(U.events.on("animationended",function(){K.dispatchImmediately("transitionended")})):this.dispatchImmediately("transitionended")),u.filters.length>0){var ae=[];pr(u.filters.iterator(),function(we){var Re=we.clone();ae.push(Re);var $e=[];pr(K.filters.iterator(),function(Xe){Xe.className==Re.className&&(_p(K.defaultState.filters.iterator(),function(Qe){return Qe.className===Re.className})||K.defaultState.filters.push(Xe),gi(Re.properties,function(Qe,dt){var Gt=Xe.properties[Qe];Gt!=dt&&$e.push({property:Qe,from:Gt,to:dt})}))}),Re.animate($e,w,$)}),this.filters.clear(),this.filters.pushAll(ae)}return U},R.prototype.isInTransition=function(){return this.animations.length>0},Object.defineProperty(R.prototype,"isHover",{get:function(){return!!this.isInteractive()&&this.interactions.isHover},set:function(u){(u=St(u))!==this.isHover&&this.isInteractive()&&(this.interactions.isHover=u,u?this.handleOver():(this.interactions.isRealHover=!1,this.handleOut()))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"isDragged",{get:function(){return this._isDragged},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"isResized",{get:function(){return this._isResized},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"isDown",{get:function(){return!!this.isInteractive()&&this.interactions.isDown},set:function(u){u=St(u),this.isInteractive()&&this.isDown!=u&&(this.interactions.isDown=u,u?this.handleDown():this.handleUp())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"isFocused",{get:function(){return!!this.isInteractive()&&this.interactions.isFocused},set:function(u){u=St(u),this.focusable&&this.isFocused!=u&&this.isInteractive()&&(this.interactions.isFocused=u,u===!0?this.handleFocus():this.handleBlur())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"isActive",{get:function(){return this._isActive},set:function(u){this.setActive(u)},enumerable:!0,configurable:!0}),R.prototype.setActive=function(u){u=St(u),this._isActive!==u&&(this._isActive=u,u&&this.states.hasKey("active")?(this.setState("active"),this.isHover&&this.states.hasKey("hoverActive")&&this.setState("hoverActive")):this.applyCurrentState(),this.dispatchImmediately("toggled"))},Object.defineProperty(R.prototype,"disabled",{get:function(){var u=this.getPropertyValue("disabled");return Ee(u)?u:this.virtualParent?this.virtualParent.disabled:!!this._parent&&this._parent.disabled},set:function(u){this.setDisabled(u)},enumerable:!0,configurable:!0}),R.prototype.setDisabled=function(u){if(u=St(u),this.getPropertyValue("disabled")!=u){if(this.setPropertyValue("disabled",u,!0),u)this.parent=this._parent,this.removeFromInvalids(),this.group.attr({display:"none"}),this.dispatch("disabled");else{if(this._parent){var w=this._parent.element;w.hasChild(this.group)||w.add(this.group)}this instanceof Zn?(this.deepInvalidate(),this._background&&this._background.invalidate()):this.invalidate(),this.__disabled||this.removeSVGAttribute("display"),this.dispatch("enabled")}return this.dispatch("transformed"),ia.requestFrame(),!0}return!1},Object.defineProperty(R.prototype,"__disabled",{get:function(){return this._internalDisabled},set:function(u){this._internalDisabled!=u&&(this._internalDisabled=u,this._updateDisabled=!0,this.invalidatePosition(),u||this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"numberFormatter",{get:function(){return this._numberFormatter?this._numberFormatter:this.virtualParent?this.virtualParent.numberFormatter:this._parent?this._parent.numberFormatter:(this._numberFormatter=new x3,this._numberFormatter.language=this.language,this.numberFormatter)},set:function(u){this._numberFormatter=u,this._numberFormatter.language=this.language},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dateFormatter",{get:function(){return this._dateFormatter?this._dateFormatter:this.virtualParent?this.virtualParent.dateFormatter:this._parent?this._parent.dateFormatter:(this._dateFormatter=new AI,this._dateFormatter.language=this.language,this.dateFormatter)},set:function(u){this._dateFormatter=u,this._dateFormatter.language=this.language},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"durationFormatter",{get:function(){return this._durationFormatter?this._durationFormatter:this.virtualParent?this.virtualParent.durationFormatter:this._parent?this._parent.durationFormatter:(this._durationFormatter=new F4,this._durationFormatter.language=this.language,this.durationFormatter)},set:function(u){this._durationFormatter=u,this._durationFormatter.language=this.language},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"language",{get:function(){var u=this._language.get();return u||(this.virtualParent?this.virtualParent.language:this._parent?this._parent.language:(u=new y1,this.language=u,u))},set:function(u){var w=this;this._language.get()!==u&&this._language.set(u,u.events.on("localechanged",function($){if(w._numberFormatter&&(w._numberFormatter.language=w.language),w._dateFormatter&&(w._dateFormatter.language=w.language),w._durationFormatter&&(w._durationFormatter.language=w.language),w._exporting.get()){var U=w._exporting.get();U.numberFormatter.language=w.language,U.dateFormatter.language=w.language,U.durationFormatter.language=w.language,U.language=w.language}w instanceof Zn&&w.deepInvalidate()}))},enumerable:!0,configurable:!0}),R.prototype.populateString=function(u,w){if(Ee(u)){u=Pt(u);var $=(u=v1().escape(u)).match(/\{([^}]+)\}/g),U=void 0;if($)for(U=0;U<$.length;U++){var K=$[U].replace(/\{([^}]+)\}/,"$1"),ie=this.getTagValue(K,"",w);Ee(ie)||(ie=""),u=u.split($[U]).join(ie)}u=v1().unescape(u)}else u="";return this._adapterO?this._adapterO.apply("populateString",u):u},R.prototype.getTagValue=function(u,w,$){var U;Ee($)||($=this.dataItem);for(var K,ie=[],ae=/([^.]+)\(([^)]*)\)|([^.]+)/g;(K=ae.exec(u))!==null;)if(K[3])ie.push({prop:K[3]});else{var we=[];if(Ef(K[2])!="")for(var Re=/'([^']*)'|"([^"]*)"|([0-9\-]+)/g,$e=void 0;($e=Re.exec(K[2]))!==null;)we.push($e[1]||$e[2]||$e[3]);ie.push({method:K[1],params:we})}if($){Ee(U=this.getTagValueFromObject(ie,$.values))&&!it(U)||(U=this.getTagValueFromObject(ie,$));var Xe=$.dataContext;!Ee(U)&&Xe&&(Ee(U=this.getTagValueFromObject(ie,$.dataContext))||(U=this.getTagValueFromObject([{prop:u}],Xe)),!Ee(U)&&Xe.dataContext&&(U=this.getTagValueFromObject(ie,Xe.dataContext))),!Ee(U)&&$.component&&$.component.dataItem!==$&&(U=$.component.getTagValue(u,w))}return Ee(U)||(U=this.getTagValueFromObject(ie,this.populateStringFrom||this)),!Ee(U)&&this._parent&&(U=this._parent.getTagValue(u,w)),U},R.prototype.getTagValueFromObject=function(u,w,$){for(var U=w,K=!1,ie=0,ae=u.length;ie$e?1:ae.idx-we.idx}),u=w.map(function(ae){return ae.data});var $=this.element,U=!0;if($.node&&$.node.childNodes){for(var K=0,ie=$.node.childNodes.length;K0;){var u=this.children.getIndex(0);u.parent=void 0,this.children.removeValue(u)}},R.prototype.disposeChildren=function(){for(;this.children.length>0;){var u=this.children.getIndex(0);u.dispose(),this.children.removeValue(u)}},Object.defineProperty(R.prototype,"background",{get:function(){return this._background||(this._background=this.createBackground(),this.processBackground()),this._background},set:function(u){this._background&&this.background!=u&&this.removeDispose(this._background),u&&(this._background=u,this._disposers.push(u),this.processBackground())},enumerable:!0,configurable:!0}),R.prototype.handleGlobalScale=function(){j.prototype.handleGlobalScale.call(this),this.children.each(function(u){u.handleGlobalScale()})},R.prototype.createBackground=function(){return new OI},R.prototype.processBackground=function(){var u=this._background;u&&(u.isMeasured=!1,this._background.fill=new $a().getFor("background"),u.parent=this,u.isMeasured=!1,this.children.removeValue(u),this._disposers.push(u),this.group.addToBack(this._background.group))},R.prototype.validateLayout=function(){var u=this;ui.removeFromInvalidLayouts(this),this.layoutInvalid=!1,this._availableWidth=this.innerWidth,this._availableHeight=this.innerHeight;var w=0,$=0,U=!0;this.children&&(this.sortChildren(),mi(this._childrenByLayout,function(K){var ie,ae;if(le(K.relativeWidth)?(ie=Ve(u._availableWidth*K.relativeWidth,2),u.layout=="horizontal"&&(ie-=K.pixelMarginRight+K.pixelMarginLeft)):u.layout=="horizontal"&&K.invalid&&K.validate(),le(K.relativeHeight)?(ae=Ve(u._availableHeight*K.relativeHeight,2),u.layout=="vertical"&&(ae-=K.pixelMarginTop+K.pixelMarginBottom)):u.layout=="vertical"&&K.invalid&&K.validate(),K.invalid==0){if(le(K.relativeWidth)&&(K.maxWidth=ie),le(K.relativeHeight)&&(K.maxHeight=ae),K.isMeasured){u.layout=="horizontal"&&(le(K.percentWidth)||K.measuredWidth>0&&(u._availableWidth-=K.measuredWidth+K.pixelMarginLeft+K.pixelMarginRight)),u.layout=="vertical"&&(le(K.percentHeight)||K.measuredHeight>0&&(u._availableHeight-=K.measuredHeight+K.pixelMarginTop+K.pixelMarginBottom));var we=K.measuredWidth,Re=K.measuredHeight;K.align!="none"&&(we+=K.pixelMarginLeft+K.pixelMarginRight),K.valign!="none"&&(Re+=K.pixelMarginTop+K.pixelMarginBottom),w=Math.max(w,we),$=Math.max($,Re)}}else K.isMeasured&&(le(K.relativeWidth)&&K.maxWidth!=ie&&(K.maxWidth=ie,U=!1),le(K.relativeHeight)&&K.maxHeight!=ae&&(K.maxHeight=ae,U=!1))})),this._absoluteWidth=w,this._absoluteHeight=$,U&&this.arrange()},R.prototype.arrange=function(){var u,w,$,U,K,ie,ae,we,Re,$e,Xe,Qe=this,dt=this.children,Gt=0,Yt=0,ai=ve(this.innerWidth,this._absoluteWidth),oi=ve(this.innerHeight,this._absoluteHeight),Ui=this.pixelPaddingLeft,Ji=this.pixelPaddingRight,Si=this.pixelPaddingTop,Hi=this.pixelPaddingBottom,nr=0,Ir=0,yr=0,Es=0,Dn=[],Ra=[],fh=this.maxWidth,sf=this.maxHeight,wl=this.minWidth,fm=this.minHeight,zu=H(dt.values);if(this.reverseOrder&&zu.reverse(),this.layout=="grid"){ie=fh,K=1;for(var $s=0,Pf=zu.length;$sK&&(K=Of)}ie=gt(ie,1,fh),K=gt(K,1,fh),ae=this.fixedWidthGrid?fh/K:fh/ie,ae=ve(1,Math.floor(ae)),ae=W(this.maxColumns,ae),Dn=this.getColumnWidth(zu,ae,K)}for($s=0,Pf=zu.length;$sW(this.innerWidth,fh)-Xz+1&&Es=ae&&(Es=0,Ir+=Ra[yr],yr++,nr=0)}this.layout!=="none"&&(Is.moveTo({x:ad,y:hu}),fC=ad+Is.maxLeft-mh,UI=ad+Is.maxRight+Vx,O3=hu+Is.maxTop-Ng,x8=hu+Is.maxBottom+mm,(UI>w||!le(w))&&(w=UI),(fCU||!le(U))&&(U=x8),(UI>Re||!le(Re))&&(Re=UI),(fCXe||le(Xe))}}if(this.layout=="none"){var X4=this.bbox;u=X4.x,w=X4.x+X4.width,$=X4.y,U=X4.y+X4.height}le(u)||(u=0,we=0),le(w)||(Re=w=this._availableWidth),le($)||($=0,$e=0),le(U)||(Xe=U=this._availableHeight),le($e)||($e=0),le(Xe)||(Xe=$e),le(we)||(we=0),le(Re)||(Re=we),Gt=w-u,Yt=U-$,le(this.relativeWidth)&&(u=0,w=Gt=fh-Ui-Ji),le(this.relativeHeight)&&($=0,U=Yt=sf-Si-Hi),le(this._pixelWidth)&&(u=0,Gt=this._pixelWidth-Ui-Ji),le(wl)&&Gt0){var jI,C8,Jz=Gt,Ly=Yt;Jz=-.5&&w<=this.pixelWidth+.5&&$>=-.5&&$<=this.pixelHeight+.5},R.prototype.copyFrom=function(u){var w=this;j.prototype.copyFrom.call(this,u),this.layout=u.layout,this.setStateOnChildren=u.setStateOnChildren,u._background&&(this.background=u._background.clone(),this.background.copyFrom(u._background)),pr(u.children.iterator(),function($){$.shouldClone&&($.clone().parent=w)})},Object.defineProperty(R.prototype,"preloader",{get:function(){return this._preloader||(this.parent?this.parent.preloader:void 0)},set:function(u){this._preloader&&this.removeDispose(this._preloader),this._preloader=u,u&&(u.parent=this.tooltipContainer,this._disposers.push(u))},enumerable:!0,configurable:!0}),R.prototype.setPaper=function(u){var w=this,$=j.prototype.setPaper.call(this,u);return $&&(this._background&&(this._background.paper=u,this._background.topParent=this.topParent),this.children.each(function(U){U.setPaper(u),U.topParent=w.topParent})),$},R.prototype.removeFromInvalids=function(){j.prototype.removeFromInvalids.call(this),ui.removeFromInvalidLayouts(this)},R.prototype.setDataItem=function(u){this._dataItem!=u&&(pr(this.children.iterator(),function(w){w.dataItem=u}),this._background&&(this._background.dataItem=u)),j.prototype.setDataItem.call(this,u)},R.prototype.measureElement=function(){this.disabled||this.isTemplate||this.layout=="none"||this.__disabled||this.validateLayout()},Object.defineProperty(R.prototype,"fontFamily",{get:function(){return this.getPropertyValue("fontFamily")},set:function(u){this.setPropertyValue("fontFamily",u,!0)&&(this.setSVGAttribute({"font-family":u}),this.invalidateLabels())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fontSize",{get:function(){return this.getPropertyValue("fontSize")},set:function(u){this.setPropertyValue("fontSize",u,!0)&&(this.setSVGAttribute({"font-size":u}),this.invalidateLabels())},enumerable:!0,configurable:!0}),R.prototype.invalidateLabels=function(){this.children.each(function(u){u.hardInvalidate?(u.hardInvalidate(),u.events.once("validated",u.handleValidate,u,!1)):u instanceof R&&u.invalidateLabels()})},Object.defineProperty(R.prototype,"fontWeight",{get:function(){return this.getPropertyValue("fontWeight")},set:function(u){this.setPropertyValue("fontWeight",u),this.setSVGAttribute({"font-weight":u})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"textDecoration",{get:function(){return this.getPropertyValue("textDecoration")},set:function(u){this.setPropertyValue("textDecoration",u),this.setSVGAttribute({"text-decoration":u})},enumerable:!0,configurable:!0}),R.prototype.dispose=function(){this._background&&this._background.dispose(),this._shouldBeReady=[],this.disposeChildren(),j.prototype.dispose.call(this)},R.prototype.setState=function(u,w,$){var U=u;return u instanceof Nr&&(U=u.name),this.setStateOnChildren&&pr(this.children.iterator(),function(K){K.setState(U,w,$),U!="active"&&(K.isActive=!1)}),this._background&&this._background.setState(U),this.setStateOnSprites.length&&mi(this.setStateOnSprites,function(K){K.setState(U,w,$)}),j.prototype.setState.call(this,u,w,$)},R.prototype.setActive=function(u){j.prototype.setActive.call(this,u),this._background&&(this._background.isActive=u)},R.prototype.dispatchReady=function(){var u=this;if(!this.isReady()&&!this.isDisposed()){var w=!0;Na(this.children.iterator(),function($){return!!($.__disabled||$.disabled||$.isReady())||(w=!1,!1)}),Lr(this._shouldBeReady,function($){return!!($.__disabled||$.disabled||$.isReady())||(w=!1,!1)}),w?j.prototype.dispatchReady.call(this):ui.events.once("exitframe",function(){u.dispatchReady(),ia.requestFrame()},void 0,!1)}},R.prototype._systemUpdate=function(u){this.children.each(function(w){w.invalid&&(w._systemCheckIfValidate()?w.dataItem&&w.dataItem.component&&w.dataItem.component.dataInvalid?u.push(w):w.validate():u.push(w))}),j.prototype._systemUpdate.call(this,u)},R.prototype._systemValidatePositions=function(){this.children.each(function(u){u.positionInvalid&&u.validatePosition()}),j.prototype._systemValidatePositions.call(this)},R.prototype._systemValidateLayouts=function(){this.layoutInvalid&&!this.isDisposed()&&this.validateLayout()},Object.defineProperty(R.prototype,"tapToActivate",{get:function(){return this._tapToActivate},set:function(u){this._tapToActivate!=u&&this.setTapToActivate(u)},enumerable:!0,configurable:!0}),R.prototype.setTapToActivate=function(u){var w=this;this._tapToActivate=u,this.interactions.isTouchProtected=u,u&&this.interactions.setEventDisposer("container-tapToActivate",u,function(){return new Nn([w.events.on("hit",w.handleTapToActivate,w,!1),w.events.on("down",w.initTapTimeout,w,!1),w.events.on("track",w.initTapTimeout,w,!1),Vs().body.events.on("down",function($){Vs().isLocalElement($.pointer,w.paper.svg,w.uid)||w.handleTapToActivateDeactivation()},w,!1)])}),Vs()},R.prototype.handleTapToActivate=function(){this.interactions.isTouchProtected=!1,this.initTapTimeout()},R.prototype.handleTapToActivateDeactivation=function(){this.interactions.isTouchProtected=!0},R.prototype.initTapTimeout=function(){var u=this;this._tapToActivateTimeout&&this._tapToActivateTimeout.dispose(),this.tapToActivate&&!this.interactions.isTouchProtected&&this.tapTimeout&&(this._tapToActivateTimeout=this.setTimeout(function(){u.handleTapToActivateDeactivation()},this.tapTimeout))},R.prototype.moveHtmlContainer=function(u){var w=U$(u);if(w){this.htmlContainer=w;var $=this.svgContainer;$.htmlElement=w,$.htmlElement.appendChild($.SVGContainer),$.initSensor(),$.measure()}else ct(u)&&u!=""&&ia.log("html container '"+u+"' not found")},R.prototype.hasLicense=function(){if(no.commercialLicense)return!0;for(var u=0;u0;){var U=(K=$[0]).dataProvider;if(K.isDisposed())$i($,K);else if(U&&U.dataInvalid)try{if(U.validateData(),U.dataValidationProgress<1)break}catch(Re){$i($,U),U.raiseCriticalError(Re)}else try{if(K.validateData(),K.dataValidationProgress<1)break}catch(Re){$i($,K),K.raiseCriticalError(Re)}}if(Date.now()-u>this.updateStepDuration)break}for(;ui.invalidRawDatas.length>0;)if((K=ui.invalidRawDatas[0]).isDisposed())$i(ui.invalidRawDatas,K);else try{K.validateRawData()}catch(Re){$i(ui.invalidRawDatas,K),K.raiseCriticalError(Re)}for(;ui.invalidDataItems.length>0;){if(U=(K=ui.invalidDataItems[0]).dataProvider,!(K.isDisposed()||K.dataInvalid||U&&U.dataInvalid))try{K.validateDataItems()}catch(Re){$i(ui.invalidDataItems,K),K.raiseCriticalError(Re)}$i(ui.invalidDataItems,K)}for(;ui.invalidDataRange.length>0;){var K;if(U=(K=ui.invalidDataRange[0]).dataProvider,!(K.isDisposed()||K.dataInvalid||U&&U.dataInvalid))try{K.validateDataRange(),K.skipRangeEvent||K.dispatchImmediately("datarangechanged"),K.skipRangeEvent=!1}catch(Re){$i(ui.invalidDataRange,K),K.raiseCriticalError(Re)}$i(ui.invalidDataRange,K)}var ie=[];gi(ui.invalidLayouts,function(Re){R.validateLayouts(Re)}),gi(ui.invalidPositions,function(Re){R.validatePositions(Re)});var ae=!1;if(u=Date.now(),gi(ui.invalidSprites,function(Re,$e){for(var Xe=0;$e.length>0;){if(R.validateLayouts(Re),R.validatePositions(Re),++Xe==5){if(Date.now()-u>R.updateStepDuration)break;Xe=0}var Qe=$e[$e.length-1];if(Qe&&!Qe.isDisposed()){if(Qe._systemCheckIfValidate())if(R.checkIfValidate2(Qe))try{Qe._systemUpdate(ie)}catch(dt){Qe.invalid=!1,$i($e,Qe),Qe.raiseCriticalError(dt)}else ie.push(Qe);else ie.push(Qe);Qe.invalid=!1}$i($e,Qe)}ui.invalidSprites[Re]=ui.invalidSprites[Re].concat(ie)}),gi(ui.invalidSprites,function(Re,$e){$e.length>0&&(ae=!0)}),gi(ui.invalidDatas,function(Re,$e){$e.length>0&&(ae=!0)}),mi(H(this.animations),function(Re){Re.update()}),gi(ui.invalidLayouts,function(Re){R.validateLayouts(Re)}),gi(ui.invalidPositions,function(Re){R.validatePositions(Re)}),No(),gi(ui.invalidLayouts,function(Re){R.validateLayouts(Re)}),gi(ui.invalidPositions,function(Re){R.validatePositions(Re)}),ui.dispatchImmediately("exitframe"),(ae||this.animations.length>0||[].length>0)&&this.requestFrame(),this.updateStepDuration<200){var we=!0;gi(ui.invalidDatas,function(Re,$e){$e.length>0&&(we=!1)}),gi(ui.invalidSprites,function(Re,$e){$e.length>0&&(we=!1)}),we&&(this.updateStepDuration=200)}}},j.prototype.checkIfValidate2=function(R){return!(R.dataItem&&R.dataItem.component&&R.dataItem.component.dataInvalid&&!R.dataItem.component.isTemplate)},j.prototype.requestFrame=function(){var R=this;this._frameRequested||(xi(function(){R.update()}),this._frameRequested=!0)},j.prototype.softInvalidate=function(R){var u=this;R.children.each(function(w){w instanceof Zn&&u.softInvalidate(w),w.measureFailed&&(pl(w,"Label")?w.hardInvalidate():w.invalidate(),w.measureFailed=!1)})},j.prototype.validatePositions=function(R){for(var u=ui.invalidPositions[R];u.length>0;){var w=u[u.length-1];if(w.isDisposed())$i(u,w);else try{w._systemValidatePositions()}catch($){w.positionInvalid=!1,$i(u,w),w.raiseCriticalError($)}}},j.prototype.validateLayouts=function(R){for(var u=ui.invalidLayouts[R];u.length>0;){var w=u[u.length-1];if(w.isDisposed())$i(u,w);else try{w.children.each(function($){$._systemValidateLayouts()}),w.validateLayout()}catch($){w.layoutInvalid=!1,$i(u,w),w.raiseCriticalError($)}}},j.prototype.log=function(R){(function(){for(var u=[],w=0;w0},enumerable:!0,configurable:!0}),j.prototype.maybeToNumber=function(R,u){return this.options.numberFields.indexOf(R)!==-1?It(u):u},Object.defineProperty(j.prototype,"parsableDates",{get:function(){return this.options.dateFields&&this.options.dateFields.length>0},enumerable:!0,configurable:!0}),j.prototype.maybeToDate=function(R,u){return this.options.dateFields.indexOf(R)!==-1?this.options.dateFormatter.parse(u,this.dateFormat):u},j.prototype.maybeToEmpty=function(R){return Ee(R)&&R!=""||!Ee(this.options.emptyAs)?R:this.options.emptyAs},Object.defineProperty(j.prototype,"dateFormatter",{get:function(){return this.options.dateFormatter||(this.options.dateFormatter=new AI,this.options.dateFormat&&(this.options.dateFormat=this.options.dateFormat)),this.options.dateFormatter},enumerable:!0,configurable:!0}),Object.defineProperty(j.prototype,"dateFormat",{get:function(){return this.options.dateFormat||this.dateFormatter.inputDateFormat},enumerable:!0,configurable:!0}),j}(),dz=[",",";"," "],sC=function(j){function R(){var u=j!==null&&j.apply(this,arguments)||this;return u.contentType="text/csv",u.options={delimiter:"",reverse:!1,skipRows:0,skipEmpty:!0,useColumnNames:!1},u}return re(R,j),R.isCSV=function(u){return!!R.getDelimiterFromData(u)},R.getDelimiterFromData=function(u){var w,$=u.split(` -`),U=$.length;return mi(dz,function(K){for(var ie=0,ae=0,we=0;we1)){ae=0;break}if(ae===0)ae=ie;else if(ie!=ae){ae=0;break}}ae&&(w=K)}),w},R.prototype.parse=function(u){this.options.delimiter||(this.options.delimiter=R.getDelimiterFromData(u));var w,$,U,K=this.CSVToArray(u,this.options.delimiter),ie=Ee(this.options.emptyAs),ae=this.parsableNumbers,we=this.parsableDates,Re=[],$e=[];for($=0;$0&&ae.delay(w))}),U},R.prototype.dispose=function(){j.prototype.dispose.call(this),mi(this.sprites,function(u){u.dispose()}),this.sprites=[]},R.prototype.hide=function(u,w,$,U){var K=this;if(this.isHiding=!0,mi(this.sprites,function(ae){var we=ae.hide(u);we==null||we.isFinished()||(K._disposers.push(we),w!=null&&w>0&&we.delay(w))}),le($)&&U){var ie;if(mi(U,function(ae){var we=K.setWorkingValue(ae,$,u,w);we&&(ie=we)}),ie&&!ie.isFinished())return this._hideDisposer=ie.events.on("animationended",function(){K.setVisibility(!1,!0),K.isHiding=!1}),this._disposers.push(this._hideDisposer),ie;this.isHiding=!1,this.setVisibility(!1,!0)}else this.isHiding=!1,this.setVisibility(!1)},R.prototype.getDuration=function(u){if(!le(u)){var w=this.component;w&&(u=w.interpolationDuration)}if(u!=null)return this._adapterO?this._adapterO.apply("duration",u):u},R.prototype.getValue=function(u,w){if(u&&this.component){w||(w=this.component.dataFields[u+"Show"])||(w="value");var $=this.values[u][w];return this._adapterO&&this._adapterO.isEnabled("value")?this._adapterO.apply("value",{value:$,field:u}).value:$}},R.prototype.getWorkingValue=function(u){if(u&&this.component){var w=this.component.dataFields[u+"Show"];return w||(w="workingValue"),this._adapterO?this._adapterO.apply("workingValue",{workingValue:this.values[u][w],field:u}).workingValue:this.values[u][w]}},R.prototype.getActualWorkingValue=function(u){return this.values[u].workingValue},R.prototype.setValue=function(u,w,$,U){var K=this.values[u].value,ie=this.getDuration($);if(K!==(w=Tt(w))){if(this.values[u].value=w,this._eventDispatcher&&!this.__disabled&&this.events.isEnabled("valuechanged")){var ae={type:"valuechanged",target:this,property:u};this.events.dispatchImmediately("valuechanged",ae)}this.component&&this.component.handleDataItemValueChange(this,u)}this.setWorkingValue(u,w,ie,U)},R.prototype.setCalculatedValue=function(u,w,$){if(this.values[u][$]!==w&&le(w)){if(this.values[u][$]=w,this._eventDispatcher&&!this.__disabled&&this.events.isEnabled("calculatedvaluechanged")){var U={type:"calculatedvaluechanged",target:this,property:u};this.events.dispatchImmediately("calculatedvaluechanged",U)}this.component&&this.component.handleDataItemCalculatedValueChange(this,u)}},R.prototype.setWorkingValue=function(u,w,$,U){if(le(this.values[u].value)){var K=this.getDuration($),ie=this.values[u].workingValue;if(K!=null&&K>0&&le(ie)&&this.component){if(ie!=w){var ae=this.animate({childObject:this.values[u],property:"workingValue",from:ie,to:w,dummyData:u},K,this.component.interpolationEasing);return U!=null&&ae.delay(U),ae.events.on("animationstarted",this.handleInterpolationProgress,this),ae.events.on("animationprogress",this.handleInterpolationProgress,this),ae.events.on("animationended",this.handleInterpolationProgress,this),this._valueAnimations[u]=ae,ae}(we=this._valueAnimations[u])&&we.stop(),this.values[u].workingValue=w}else{var we;if((we=this._valueAnimations[u])&&we.stop(),this.values[u].workingValue=w,this._eventDispatcher&&!this.__disabled&&this.events.isEnabled("workingvaluechanged")){var Re={type:"workingvaluechanged",target:this,property:u};this.events.dispatchImmediately("workingvaluechanged",Re)}this.component&&this.component.handleDataItemWorkingValueChange(this,u)}}},R.prototype.setLocation=function(u,w,$,U){if(this.locations[u]!==w){if(this.locations[u]=w,this._eventDispatcher&&!this.__disabled&&this.events.isEnabled("locationchanged")){var K={type:"locationchanged",target:this,property:u};this.events.dispatchImmediately("locationchanged",K)}this.component&&this.component.handleDataItemValueChange(this,u),this.setWorkingLocation(u,w,$,U)}},R.prototype.setWorkingLocation=function(u,w,$,U){var K=this.getDuration($),ie=this.workingLocations[u];if(K!=null&&K>0&&le(ie)&&this.component){if(ie!=w){var ae=this.animate({childObject:this.workingLocations,property:u,from:ie,to:w,dummyData:u},K,this.component.interpolationEasing);return U!=null&&ae.delay(U),ae.events.on("animationstarted",this.handleInterpolationProgress,this),ae.events.on("animationprogress",this.handleInterpolationProgress,this),ae.events.on("animationended",this.handleInterpolationProgress,this),this._locationAnimations[u]=ae,ae}(we=this._locationAnimations[u])&&we.stop(),this.workingLocations[u]=w}else{var we;if((we=this._locationAnimations[u])&&we.stop(),this.workingLocations[u]=w,this._eventDispatcher&&!this.__disabled&&this.events.isEnabled("workinglocationchanged")){var Re={type:"workinglocationchanged",target:this,property:u};this.events.dispatchImmediately("workinglocationchanged",Re)}this.component&&this.component.handleDataItemWorkingLocationChange(this,u)}},R.prototype.setDate=function(u,w,$){!kt(w)&&this.component&&(w=this.component.dateFormatter.parse(w)),this.dates[u]!==w&&(this.dates[u]=w,this.setValue(u,w.getTime(),$))},R.prototype.getDate=function(u){return this._adapterO?this._adapterO.apply("date",{date:this.dates[u],field:u}).date:this.dates[u]},R.prototype.setProperty=function(u,w){if(this.properties[u]!==w){if(this.hasProperties=!0,this.properties[u]=w,this._eventDispatcher&&!this.__disabled&&this.events.isEnabled("propertychanged")){var $={type:"propertychanged",target:this,property:u,value:w};this.events.dispatchImmediately("propertychanged",$)}this.component&&this.component.handleDataItemPropertyChange(this,u)}},R.prototype.setCategory=function(u,w){ct(w)||(w=Pt(w)),this.categories[u]!==w&&(this.categories[u]=w)},R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),u.dataContext&&(this.dataContext=tl(u.dataContext,{})),tn(u.locations,this.locations),u._adapterO&&this.adapter.copyFrom(u._adapterO),this.component=u.component},Object.defineProperty(R.prototype,"opacity",{set:function(u){mi(this.sprites,function(w){w.opacity=u})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"ignoreMinMax",{get:function(){return this._ignoreMinMax},set:function(u){if(this._ignoreMinMax=u,this._eventDispatcher&&!this.__disabled&&this.events.isEnabled("propertychanged")){var w={type:"propertychanged",target:this,property:"ignoreMinMax",value:u};this.events.dispatchImmediately("propertychanged",w)}this.component&&this.component.handleDataItemPropertyChange(this,"ignoreMinMax")},enumerable:!0,configurable:!0}),R.prototype.animate=function(u,w,$){return new dm(this,u,w,$).start()},R.prototype.handleInterpolationProgress=function(u){var w=u.target.animationOptions[0];if(w){if(this._eventDispatcher&&!this.__disabled&&this.events.isEnabled("workingvaluechanged")){var $={type:"workingvaluechanged",target:this,property:w.dummyData};this.events.dispatchImmediately("workingvaluechanged",$)}this.component&&this.component.handleDataItemWorkingValueChange(this,w.dummyData)}},R.prototype.hasValue=function(u){for(var w=0,$=u.length;w<$;w++){var U=this.values[u[w]];if(!U||!Ee(U.value))return!1}return!0},Object.defineProperty(R.prototype,"depth",{get:function(){return this.parent?this.parent.depth+1:0},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dataContext",{get:function(){return this._dataContext},set:function(u){this._dataContext=u},enumerable:!0,configurable:!0}),R.prototype.addSprite=function(u){u.dataItem&&u.dataItem!=this&&$i(u.dataItem.sprites,u),this.visible||u.hide(0),this.isHiding&&u.hide(),this.sprites.push(u),u.dataItem=this},R}(pi),DI=function(j){function R(){var u=j.call(this)||this;return u.dataFields={},u._dataSources={},u._parseDataFrom=0,u._dataDisposers=[],u._currentDataSetId="",u._start=0,u._end=1,u.skipRangeEvent=!1,u.rangeChangeDuration=0,u.rangeChangeEasing=kv,u.parsingStepDuration=50,u.dataInvalid=!1,u.rawDataInvalid=!1,u.dataRangeInvalid=!1,u.dataItemsInvalid=!1,u.interpolationDuration=0,u.interpolationEasing=kv,u.sequencedInterpolation=!0,u.sequencedInterpolationDelay=0,u.dataValidationProgress=0,u._addAllDataItems=!0,u._usesData=!0,u.className="Component",u.minZoomCount=1,u.maxZoomCount=0,u._dataItems=new Ym(u.createDataItem()),u._dataItems.events.on("inserted",u.handleDataItemAdded,u,!1),u._dataItems.events.on("removed",u.handleDataItemRemoved,u,!1),u._disposers.push(new ta(u._dataItems)),u._disposers.push(u._dataItems.template),u.invalidateData(),u.dataUsers.events.on("inserted",u.handleDataUserAdded,u,!1),u._disposers.push(new Nn(u._dataDisposers)),u._start=0,u._end=1,u.maxZoomDeclination=1,u.applyTheme(),u}return re(R,j),R.prototype.createDataItem=function(){return new MI},R.prototype.handleDataUserAdded=function(u){u.newValue.dataProvider=this},R.prototype.handleDataItemValueChange=function(u,w){this.dataItemsInvalid||this.invalidateDataItems()},R.prototype.handleDataItemWorkingValueChange=function(u,w){},R.prototype.handleDataItemWorkingLocationChange=function(u,w){},R.prototype.handleDataItemCalculatedValueChange=function(u,w){},R.prototype.handleDataItemPropertyChange=function(u,w){},R.prototype.processDataItem=function(u,w){var $=this;if(u){w||(w={}),u.dataContext=w;var U=!1;gi(this.dataFields,function(K,ie){var ae=K,we=w[ie];if($._adapterO&&$._adapterO.isEnabled("dataContextValue")&&(we=$._adapterO.apply("dataContextValue",{field:ae,value:we,dataItem:u}).value),Ee(we))if(U=!0,u.hasChildren[ae]){var Re=$.createDataItem();Re.copyFrom($.mainDataSet.template);var $e=new Ym(Re);$e.events.on("inserted",$.handleDataItemAdded,$,!1),$e.events.on("removed",$.handleDataItemRemoved,$,!1),$._dataDisposers.push(new ta($e));for(var Xe=we.length,Qe=0;Qe0;)this.data.shift(),w--;this.invalidateData()},R.prototype.removeData=function(u,w){if(le(u)&&u>0){for(;u>0;){var $=this.mainDataSet.getIndex(0);$&&this.mainDataSet.remove($),this.dataUsers.each(function(U){if(!U.data||U.data.length==0){var K=U.mainDataSet.getIndex(0);K&&U.mainDataSet.remove(K)}}),w||this.data.shift(),this._parseDataFrom>0&&this._parseDataFrom--,u--}this.invalidateDataItems()}},R.prototype.invalidateData=function(){this.disabled||this.isTemplate||(ui.addToInvalidComponents(this),ia.requestFrame(),this.dataInvalid=!0,pr(this.dataUsers.iterator(),function(u){u.invalidateDataItems()}))},R.prototype.invalidateDataUsers=function(){pr(this.dataUsers.iterator(),function(u){u.invalidate()})},R.prototype.invalidateDataItems=function(){this.disabled||this.isTemplate||(Ur(ui.invalidDataItems,this),ia.requestFrame(),this.dataItemsInvalid=!0,pr(this.dataUsers.iterator(),function(u){u.invalidateDataItems()}))},R.prototype.invalidateDataRange=function(){this.disabled||this.isTemplate||(this.dataRangeInvalid=!0,Ur(ui.invalidDataRange,this),ia.requestFrame())},R.prototype.validateDataRange=function(){$i(ui.invalidDataRange,this),this.dataRangeInvalid=!1,this.startIndex==this._prevStartIndex&&this.endIndex==this._prevEndIndex||(this.rangeChangeUpdate(),this.appendDataItems(),this.invalidate(),this.dispatchImmediately("datarangechanged"))},R.prototype.sliceData=function(){this._workingStartIndex=this.startIndex,this._workingEndIndex=this.endIndex},R.prototype.rangeChangeUpdate=function(){this.sliceData(),this._prevStartIndex=this.startIndex,this._prevEndIndex=this.endIndex},R.prototype.appendDataItems=function(){for(var u=this.endIndex,w=this.startIndex;w0&&this.disposeData(),this.data.length>0){var w=this.preloader;pr(this.dataUsers.iterator(),function($e){$e._startIndex=void 0,$e._endIndex=void 0});for(var $=0,U=Date.now(),K=this._parseDataFrom,ie=this.data.length,ae=function(){var $e=we.data[K];if(we._usesData){var Xe=we.getDataItem($e);we.processDataItem(Xe,$e)}if(we.dataUsers.each(function(Qe){if(Qe.data.length==0){var dt=Qe.getDataItem($e);Qe.processDataItem(dt,$e)}}),++$==100&&($=0,Date.now()-U>we.parsingStepDuration&&K.5&&!w.visible||(w.progress=K/we.data.length)),we.dataValidationProgress=K/we.data.length,K=we.data.length,we.invalidateData(),{value:void 0}},we=this;K0?this.invalidateData():(this.dispatchImmediately("beforedatavalidated"),this.dispatch("datavalidated")))},R.prototype.getDataSource=function(u){var w=this;return Ee(this._dataSources[u])||(this._dataSources[u]=new pz,this._dataSources[u].component=this,this.setDataSourceEvents(this._dataSources[u],u),this._dataSources[u].adapter.add("dateFields",function($){return w.dataSourceDateFields($)}),this._dataSources[u].adapter.add("numberFields",function($){return w.dataSourceNumberFields($)}),this.events.on("inited",function(){w.loadData(u)},this,!1)),this._dataSources[u]},Object.defineProperty(R.prototype,"dataSource",{get:function(){return this._dataSources.data||this.getDataSource("data"),this._dataSources.data},set:function(u){var w=this;this._dataSources.data&&this.removeDispose(this._dataSources.data),this._dataSources.data=u,this._dataSources.data.component=this,this.events.on("inited",function(){w.loadData("data")},this,!1),this.setDataSourceEvents(u,"data")},enumerable:!0,configurable:!0}),R.prototype.loadData=function(u){this._dataSources[u].load()},R.prototype.dataSourceDateFields=function(u){return u},R.prototype.dataSourceNumberFields=function(u){return u},R.prototype.populateDataSourceFields=function(u,w,$){return mi($,function(U){w[U]&&Ri(u,w[U])===-1&&u.push(w[U])}),u},R.prototype.setDataSourceEvents=function(u,w){var $=this;u.events.on("started",function(U){var K=$.preloader;K&&(K.progress=0)},void 0,!1),u.events.on("loadstarted",function(U){var K=$.preloader;K&&(K.progress=.25)},void 0,!1),u.events.on("loadended",function(U){var K=$.preloader;K&&(K.progress=.5)},void 0,!1),u.events.on("parseended",function(U){var K=$.preloader;K&&(K.progress=.75)},void 0,!1),u.events.on("ended",function(U){var K=$.preloader;K&&(K.progress=1)},void 0,!1),u.events.on("error",function(U){var K=$.preloader;K&&(K.progress=1),$.openModal(U.message)},void 0,!1),w&&u.events.on("done",function(U){var K=$.preloader;K&&(K.progress=1),w!="data"||pt(U.data)||(U.data=[U.data]),u.incremental&&w=="data"&&$.data.length?$.addData(U.data,u.keepCount?U.data.length:0):u.updateCurrentData&&w=="data"&&$.data.length?(mi($.data,function(ie,ae){Ee(U.data[ae])&&gi(ie,function(we,Re){Ee(U.data[ae][we])&&(ie[we]=U.data[ae][we])})}),$.invalidateRawData()):$[w]=U.data})},Object.defineProperty(R.prototype,"responsive",{get:function(){return this._responsive||(this._responsive=new U0e,this._responsive.component=this),this._responsive},set:function(u){this._responsive=u,this._responsive.component=this},enumerable:!0,configurable:!0}),R.prototype.zoom=function(u,w,$,U){var K=this;w===void 0&&(w=!1),$===void 0&&($=!1);var ie=u.start,ae=u.end,we=u.priority;if(u.start==u.end&&(u.start=u.start-.5/this.maxZoomFactor,u.end=u.end+.5/this.maxZoomFactor),we=="end"&&ae==1&&ie!=0&&iethis.end&&(we="end"),le(U)||(U=this.maxZoomDeclination),!le(ie)||!le(ae))return{start:this.start,end:this.end};if(this._finalStart!=ie||this._finalEnd!=ae){var Re=this.maxZoomFactor/this.minZoomCount,$e=this.maxZoomFactor/this.maxZoomCount;if(we=="start"?(this.maxZoomCount>0&&1/(ae-ie)<$e&&(ae=ie+1/$e),1/(ae-ie)>Re&&(ae=ie+1/Re),ae>1&&ae-ie<1/Re&&(ie=ae-1/Re)):(this.maxZoomCount>0&&1/(ae-ie)<$e&&(ie=ae-1/$e),1/(ae-ie)>Re&&(ie<=0?ae=ie+1/Re:ie=ae-1/Re),ie<0&&ae-ie<1/Re&&(ae=ie+1/Re)),ie<-U&&(ie=-U),1/(ae-ie)>Re&&(ae=ie+1/Re),ae>1+U&&(ae=1+U),1/(ae-ie)>Re&&(ie=ae-1/Re),this._finalEnd=ae,this._finalStart=ie,this.skipRangeEvent=w,this.dispatchImmediately("rangechangestarted"),this.rangeChangeDuration>0&&!$){var Xe=this.rangeChangeAnimation;if(Xe&&Xe.progress<1){var Qe=Xe.animationOptions;if(Qe.length>1){if(Qe[0].to==ie&&Qe[1].to==ae)return{start:ie,end:ae};Xe.isDisposed()||Xe.stop()}}this.rangeChangeAnimation&&this.rangeChangeAnimation.kill(),Xe=this.animate([{property:"start",to:ie},{property:"end",to:ae}],this.rangeChangeDuration,this.rangeChangeEasing),this.rangeChangeAnimation=Xe,Xe&&!Xe.isFinished()?Xe.events.on("animationended",function(){K.dispatchImmediately("rangechangeended")}):this.dispatchImmediately("rangechangeended")}else this.start=ie,this.end=ae,this.dispatch("rangechangeended")}return{start:ie,end:ae}},R.prototype.zoomToIndexes=function(u,w,$,U){if(le(u)&&le(w)){var K=u/this.dataItems.length,ie=w/this.dataItems.length;this.zoom({start:K,end:ie},$,U)}},Object.defineProperty(R.prototype,"zoomFactor",{get:function(){return gt(1/(this.end-this.start),1,this.maxZoomFactor)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxZoomFactor",{get:function(){return this.getPropertyValue("maxZoomFactor")},set:function(u){this.setPropertyValue("maxZoomFactor",u)&&(u==1&&(this.maxZoomDeclination=0),this.invalidateDataRange())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxZoomDeclination",{get:function(){return this.getPropertyValue("maxZoomDeclination")},set:function(u){this.setPropertyValue("maxZoomDeclination",u)&&this.invalidateDataRange()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startIndex",{get:function(){return le(this._startIndex)||(this._startIndex=0),this._startIndex},set:function(u){this._startIndex=gt(Math.round(u),0,this.dataItems.length),this.start=this.indexToPosition(this._startIndex)},enumerable:!0,configurable:!0}),R.prototype.indexToPosition=function(u){return u/this.dataItems.length},Object.defineProperty(R.prototype,"endIndex",{get:function(){var u=this.dataItems.length;return(!le(this._endIndex)||this._endIndex>u)&&(this._endIndex=u),this._endIndex},set:function(u){this._endIndex=gt(Math.round(u),0,this.dataItems.length),this.end=this.indexToPosition(this._endIndex)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"start",{get:function(){return this._adapterO?this._adapterO.apply("start",this._start):this._start},set:function(u){if(this._start!=u){this._start=u;var w=Math.max(0,Math.floor(this.dataItems.length*u)||0);this._startIndex=Math.min(w,this.dataItems.length),this.invalidateDataRange(),this.invalidate(),this.dispatchImmediately("startchanged"),this.dispatch("startendchanged")}},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"end",{get:function(){return this._adapterO?this._adapterO.apply("end",this._end):this._end},set:function(u){this._end!=u&&(this._end=u,this._endIndex=Math.min(this.dataItems.length,Math.ceil(this.dataItems.length*u)||0),this.invalidateDataRange(),this.invalidate(),this.dispatchImmediately("endchanged"),this.dispatch("startendchanged"))},enumerable:!0,configurable:!0}),R.prototype.removeFromInvalids=function(){j.prototype.removeFromInvalids.call(this),ui.removeFromInvalidComponents(this),$i(ui.invalidDataItems,this),$i(ui.invalidDataRange,this),$i(ui.invalidRawDatas,this)},Object.defineProperty(R.prototype,"dataItems",{get:function(){if(this._currentDataSetId!=""){var u=this.dataSets.getKey(this._currentDataSetId);if(u)return u}return this._dataItems},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dataSets",{get:function(){return this._dataSets||(this._dataSets=new fa),this._dataSets},enumerable:!0,configurable:!0}),R.prototype.setDataSet=function(u){if(this._currentDataSetId!=u){if(this.dataSets.getKey(u))return this.dataItems.each(function(w){w.__disabled=!0}),this._currentDataSetId=u,this.invalidateDataRange(),this._prevStartIndex=void 0,this.dataItems.each(function(w){w.__disabled=!1}),!0;if(this._currentDataSetId!="")return this.dataItems.each(function(w){w.__disabled=!0}),this._currentDataSetId="",this.invalidateDataRange(),this._prevStartIndex=void 0,this.dataItems.each(function(w){w.__disabled=!1}),!0}return!1},Object.defineProperty(R.prototype,"currentDataSetId",{get:function(){return this._currentDataSetId},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"mainDataSet",{get:function(){return this._dataItems},enumerable:!0,configurable:!0}),R.prototype._updateDataItemIndexes=function(u){for(var w=this.mainDataSet.values,$=w.length,U=u;U<$;++U)w[U]._index=U},R.prototype.handleDataItemAdded=function(u){u.newValue.component=this,this._updateDataItemIndexes(u.index),this.dataItemsInvalid||this.invalidateDataItems()},R.prototype.handleDataItemRemoved=function(u){this._updateDataItemIndexes(u.index),this.dataItemsInvalid||this.invalidateDataItems()},R.prototype.bindDataField=function(u,w){this.dataFields[u]=w,this.invalidateDataRange()},R.prototype.invalidateProcessedData=function(){this.resetProcessedRange(),this.invalidateDataRange()},R.prototype.resetProcessedRange=function(){this._prevEndIndex=null,this._prevStartIndex=null},Object.defineProperty(R.prototype,"dataUsers",{get:function(){var u=this;return this._dataUsers||(this._dataUsers=new Us,this._disposers.push(new jr(function(){pr(u._dataUsers.iterator(),function(w){w.dispose()})}))),this._dataUsers},enumerable:!0,configurable:!0}),R.prototype.clone=function(){var u=j.prototype.clone.call(this);return u.dataFields=tn(this.dataFields,{}),u},R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.data=u.data,this.sequencedInterpolation=u.sequencedInterpolation,this.sequencedInterpolationDelay=u.sequencedInterpolationDelay,this.interpolationDuration=u.interpolationDuration,this.interpolationEasing=u.interpolationEasing},R.prototype.reinit=function(){this._inited=!1,this.deepInvalidate()},R.prototype.getExporting=function(){var u=j.prototype.getExporting.call(this);return u.adapter.has("data",this._exportData,-1,this)||(u.adapter.add("data",this._exportData,-1,this),this.events.on("datavalidated",function(w){u.handleDataUpdated()})),u},R.prototype._exportData=function(u){return u.data=this.data,u},R.prototype.setDisabled=function(u){var w=j.prototype.setDisabled.call(this,u);return w&&this.invalidateData(),w},R.prototype.setShowOnInit=function(u){u!=this.getPropertyValue("showOnInit")&&(!u||this.inited||this.hidden?this._showOnInitDisposer2&&this.removeDispose(this._showOnInitDisposer2):(this._showOnInitDisposer2=this.events.once("dataitemsvalidated",this.hideInitially,this,!1),this._disposers.push(this._showOnInitDisposer2))),j.prototype.setShowOnInit.call(this,u)},R.prototype.setBaseId=function(u){u!=this._baseId&&this.dataInvalid&&(this.dataInvalid=!1,ui.removeFromInvalidComponents(this),this._baseId=u,this.invalidateData()),j.prototype.setBaseId.call(this,u)},Object.defineProperty(R.prototype,"minZoomCount",{get:function(){return this.getPropertyValue("minZoomCount")},set:function(u){this.setPropertyValue("minZoomCount",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxZoomCount",{get:function(){return this.getPropertyValue("maxZoomCount")},set:function(u){this.setPropertyValue("maxZoomCount",u)},enumerable:!0,configurable:!0}),R.prototype._systemCheckIfValidate=function(){return!(this.dataInvalid||this.dataProvider&&this.dataProvider.dataInvalid)},R.prototype.asFunction=function(u){return u=="interpolationEasing"||u=="rangeChangeEasing"||j.prototype.asIs.call(this,u)},R}(Zn);ui.registeredClasses.Component=DI;var Zm=function(j){function R(){var u=j.call(this)||this;return u.isOversized=!1,u.className="Label",u.fill=new $a().getFor("text"),u.wrap=!1,u.truncate=!1,u.fullWords=!0,u.ellipsis="…",u.textAlign="start",u.textValign="top",u.layout="absolute",u.baseLineRatio=-.27,u._positionPrecision=1,u.events.on("maxsizechanged",function(){u.inited&&u.handleMaxSize()},u,!1),u.events.once("validated",u.handleValidate,u,!1),u.applyTheme(),u}return re(R,j),R.prototype.afterDraw=function(){j.prototype.afterDraw.call(this),this.validatePosition()},R.prototype.setPaper=function(u){var w=j.prototype.setPaper.call(this,u);return w&&this.hardInvalidate(),w},R.prototype.handleValidate=function(){!this.currentText&&!this.text||this.bbox.width!=0&&this.bbox.height!=0||ui.events.once("exitframe",this.hardInvalidate,this)},R.prototype.handleMaxSize=function(){(this.bbox.width>this.availableWidth||this.bbox.widththis.availableHeight||this.bbox.heightU){this.isOversized=!0;var Ir=Si.element.textContent,yr=Si.bbox.width/Ir.length,Es=W(Math.ceil((Si.bbox.width-U)/yr),Ir.length);if(this.truncate){var Dn=!1,Ra=Si.element.node;if(Ra&&Ra.childNodes)for(var fh=Si.element.node.childNodes.length-1;fh>=0;fh--){var sf=Si.element.node.childNodes[fh];if(Dn&&Si.bbox.width<=U&&(sf.textContent+=" "+this.ellipsis,Si.bbox=Si.element.getBBox(),Si.bbox.width=Math.floor(Si.bbox.width),Si.bbox.width<=U))break;Dn=!1;var wl=sf.textContent;for(Ir=Si.element.textContent,Es=W(Math.ceil((Si.bbox.width-U)/yr),Ir.length);Si.bbox.width>U&&Es<=Ir.length&&Es>0;)($s=ve(Ir.length-Es-this.ellipsis.length,1))<=1&&(Es=0,fh>0&&(Dn=!0,Si.element.node.removeChild(sf))),(wl=Rd(wl,$s,this.ellipsis,this.fullWords,this.rtl)).length>$s&&this.fullWords&&(wl=Rd(wl,$s,this.ellipsis,!1,this.rtl)),sf.textContent=wl,Si.bbox=Si.element.getBBox(),Si.bbox.width=Math.floor(Si.bbox.width),Es=Math.ceil(1.1*Es);Ji=!0}}else if(Si.element.node){for(var fm=Si.element.node.lastChild,zu=void 0;Si.bbox.width>U&&Es<=Ir.length&&Es>0;){var $s=ve(nr.text.length-Es,1);if(Ui?zu=Mh(nr.text,$s,!0,this.rtl):((zu=Mh(nr.text,$s,!0,this.rtl,!1))[0].length>$s||$s===1)&&(Si.element.node.removeChild(fm),Es=0),Es>0){var Pf=zu.shift();Ui&&(Pf=Ef(Pf)),fm.textContent=v1().cleanUp(Pf)}Si.bbox=Si.element.getBBox(),Si.bbox.width=Math.floor(Si.bbox.width),Es++}if(zu.length>0){var Of="";Ee(zu)&&(this.rtl?Of+=zu.join("")+dt:Of+=dt+zu.join("").replace(/([\[\]]{1})/g,"$1$1"));for(var Is=Hi+1;Is0&&(Qe+=mh),Xe.removeElement(hu);var Vx=this.getLineInfo(Gt);Vx&&(Vx.text="",Vx.element.textContent="")}}this.maybeHideOversized(),this.measureFailed=!1,this.bbox.width!=0&&this.bbox.height!=0||(this.measureFailed=!0),this._measuredWidth=Ve(ve(this.bbox.width,this.pixelWidth-this.pixelPaddingLeft-this.pixelPaddingRight)),this._measuredHeight=Ve(ve(this.bbox.height,this.pixelHeight-this.pixelPaddingTop-this.pixelPaddingBottom)),this.alignSVGText(),this.bbox.width=this._measuredWidth,this.bbox.height=this._measuredHeight,w==this._measuredHeight&&u==this._measuredWidth||this.dispatch("transformed"),this.hideUnused(Re.length)}else{this.element.removeAttr("display"),this.resetBBox(),(Xe=this.element).removeChildren(),this.setCache("lineInfo",[],0);var Ng=this.paper.foreignObject();Xe.add(Ng),this.maxWidth&&Ng.attr({width:this.maxWidth-this.pixelPaddingLeft-this.pixelPaddingRight}),this.maxHeight&&Ng.attr({height:this.maxHeight-this.pixelPaddingTop-this.pixelPaddingBottom});var mm=this.getHTMLLineElement(we);Ng.node.appendChild(mm),mm.style.display="inline-block";var x1=mm.clientWidth,Ux=mm.clientHeight;mm.style.display="block",this._bbox={x:0,y:0,width:x1,height:Ux},Ng.attr({width:x1+1,height:Ux}),this.maybeHideOversized(),this._measuredWidth=ve(this.bbox.width,this.pixelWidth-this.pixelPaddingLeft-this.pixelPaddingRight),this._measuredHeight=ve(this.bbox.height,this.pixelHeight-this.pixelPaddingTop-this.pixelPaddingBottom),this.bbox.width=this._measuredWidth,this.bbox.height=this._measuredHeight,this.truncate&&(mm.style.overflow="hidden"),(x1>U||Ux>K)&&(this.isOversized=!0)}this.setStyles(),this.updateCenter(),this.updateBackground(),$e=="none"&&this.group.attr({display:"none"}),this.pathElement&&this.paper.appendDef(this.pathElement)}else this.element.attr({display:"none"})}}else $.events.once("maxsizechanged",this.hardInvalidate,this,!1)},R.prototype.maybeHideOversized=function(){this.hideOversized&&(this.availableWidth=0;K--){var ie=w[K];if(ie.setAttribute("text-anchor",this.textAlign),this.textPathElement)ie.removeAttribute("x"),ie.removeAttribute("y");else{switch(this.textAlign){case"middle":ie.setAttribute("x",($/2).toString()+"px");break;case"end":this.rtl||ie.setAttribute("x",$.toString());break;default:this.rtl?ie.setAttribute("x",$.toString()):ie.removeAttribute("text-anchor")}var ae=Tt(ie.getAttribute("y"));switch(this.textValign){case"middle":ie.setAttribute("y",((ae||0)+(U-this.bbox.height)/2).toString());break;case"bottom":ie.setAttribute("y",((ae||0)+U-this.bbox.height).toString());break;default:ie.setAttribute("y",(ae||0).toString())}}}}},R.prototype.getSVGLineElement=function(u,w){var $=this.paper.addGroup("text");return $.textContent=u,$.attr({x:"0"}),Ee(w)&&$.attr({y:w.toString()}),(this.truncate||this.wrap)&&$.attr({overflow:"hidden"}),$},Object.defineProperty(R.prototype,"rtl",{get:function(){return Ee(this._rtl)?this._rtl:!!this._topParent&&this._topParent.rtl},set:function(u){u=St(u),this._rtl=u,this.element&&this.alignSVGText()},enumerable:!0,configurable:!0}),R.prototype.resetBBox=function(){this._bbox={x:0,y:0,width:0,height:0}},R.prototype.getHTMLLineElement=function(u){var w=document.createElement("div");switch(w.innerHTML=u,this.textAlign){case"middle":w.style.textAlign="center";break;case"end":w.style.textAlign="right"}return this.wrap?w.style.wordWrap="break-word":w.style.whiteSpace="nowrap",this.rtl&&(w.style.direction="rtl"),Ee(this.fill)&&(w.style.color=this.fill.toString()),w},R.prototype.setStyles=function(){var u=this.element;!this.selectable||this.draggable||this.resizable||this.swipeable?u.addStyle({webkitUserSelect:"none",msUserSelect:"none"}):this.selectable&&(u.removeStyle("webkitUserSelect"),u.removeStyle("msUserSelect"))},R.prototype.hideUnused=function(u){this.initLineCache();var w=this.getCache("lineInfo");if(w.length>=u)for(var $=u;$u?w[u]:void 0},R.prototype.addLineInfo=function(u,w){this.initLineCache(),this.getCache("lineInfo")[w]=u},R.prototype.initLineCache=function(){Ee(this.getCache("lineInfo"))||this.setCache("lineInfo",[],0)},R.prototype.setDataItem=function(u){this._sourceDataItemEvents&&this._sourceDataItemEvents.dispose(),u&&(this._sourceDataItemEvents=new Nn([u.events.on("valuechanged",this.invalidate,this,!1),u.events.on("workingvaluechanged",this.invalidate,this,!1),u.events.on("calculatedvaluechanged",this.invalidate,this,!1),u.events.on("propertychanged",this.invalidate,this,!1)])),j.prototype.setDataItem.call(this,u)},Object.defineProperty(R.prototype,"availableWidth",{get:function(){return Ee(this.maxWidth)?this.maxWidth:this.pixelWidth},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"availableHeight",{get:function(){return Ee(this.maxHeight)?this.maxHeight:this.pixelHeight},enumerable:!0,configurable:!0}),R.prototype.getSvgElement=function(u,w,$){var U=this.paper.add("tspan");if(U.textContent=u,w)if(no.nonce&&$){var K="amcharts_element_style_"+btoa(w).replace(/[^\w]*/g,"");U.node.setAttribute("class",K);var ie=document.createElementNS(rf,"defs");$.node.appendChild(ie);var ae=document.createElement("style");ae.type="text/css",ae.innerHTML="."+K+" { "+w+"}",ae.setAttribute("nonce",no.nonce),ie.appendChild(ae)}else U.node.setAttribute("style",w);return $&&$.add(U),U},R.prototype.deepInvalidate=function(){j.prototype.deepInvalidate.call(this),this.hardInvalidate()},Object.defineProperty(R.prototype,"readerTitle",{get:function(){var u=this.getPropertyValue("readerTitle");return u?this.dataItem&&(u=this.populateString(u)):u=this.populateString(Lh(Ks(this.html)?this.html:this.text)),u},set:function(u){u=Lt(u),this.setPropertyValue("readerTitle",u)&&this.applyAccessibility()},enumerable:!0,configurable:!0}),R}(Zn);ui.registeredClasses.Label=Zm,Zd.push({relevant:Af.heightXS,state:function(j,R){if(j instanceof Zm&&j.parent&&j.parent.isBaseSprite){var u=j.states.create(R);return u.properties.disabled=!0,u}return null}});var Nb=function(j){function R(){var u=j.call(this)||this;return u.className="RoundedRectangle",u.element=u.paper.add("path"),u.cornerRadius(3,3,3,3),u.applyTheme(),u}return re(R,j),R.prototype.draw=function(){j.prototype.draw.call(this);var u=this.innerWidth,w=this.innerHeight;if(le(u)&&le(w)){var $=W(u,w)/2,U=hs(this.cornerRadiusTopLeft,$),K=hs(this.cornerRadiusTopRight,$),ie=hs(this.cornerRadiusBottomRight,$),ae=hs(this.cornerRadiusBottomLeft,$),we=W(Math.abs(u/2),Math.abs(w/2)),Re=gt(U,0,we),$e=gt(K,0,we),Xe=gt(ie,0,we),Qe=gt(ae,0,we),dt="M"+Re+",0 L"+(u-$e)+",0 a"+$e+","+$e+" 0 0 1 "+$e+","+$e+" L"+u+","+(w-Xe)+" a"+Xe+","+Xe+" 0 0 1 -"+Xe+","+Xe+" L"+Qe+","+w+" a"+Qe+","+Qe+" 0 0 1 -"+Qe+",-"+Qe+" L0,"+Re+" a"+Re+","+Re+" 0 0 1 "+Re+",-"+Re+" Z";this.path=dt}},R.prototype.cornerRadius=function(u,w,$,U){this.cornerRadiusTopLeft=u,this.cornerRadiusTopRight=w,this.cornerRadiusBottomLeft=$,this.cornerRadiusBottomRight=U},Object.defineProperty(R.prototype,"cornerRadiusTopLeft",{get:function(){return this.getPropertyValue("cornerRadiusTopLeft")},set:function(u){this.setPercentProperty("cornerRadiusTopLeft",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cornerRadiusTopRight",{get:function(){return this.getPropertyValue("cornerRadiusTopRight")},set:function(u){this.setPercentProperty("cornerRadiusTopRight",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cornerRadiusBottomRight",{get:function(){return this.getPropertyValue("cornerRadiusBottomRight")},set:function(u){this.setPercentProperty("cornerRadiusBottomRight",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cornerRadiusBottomLeft",{get:function(){return this.getPropertyValue("cornerRadiusBottomLeft")},set:function(u){this.setPercentProperty("cornerRadiusBottomLeft",u,!0)},enumerable:!0,configurable:!0}),R.prototype.measureElement=function(){},Object.defineProperty(R.prototype,"bbox",{get:function(){return this.definedBBox?this.definedBBox:this.isMeasured?{x:0,y:0,width:this.innerWidth,height:this.innerHeight}:{x:0,y:0,width:0,height:0}},enumerable:!0,configurable:!0}),R}(so);ui.registeredClasses.RoundedRectangle=Nb;var oC=function(j){function R(){var u=j.call(this)||this;u.className="Button",u.tooltipY=0,u.iconPosition="left",u.layout="horizontal",u.contentAlign="center",u.contentValign="middle",u.padding(8,16,8,16),u.setStateOnChildren=!0;var w=new $a,$=u.background;$.fill=w.getFor("secondaryButton"),$.stroke=w.getFor("secondaryButtonStroke"),$.fillOpacity=1,$.strokeOpacity=1,$.cornerRadius(3,3,3,3),u.label=new Zm,u.label.fill=w.getFor("secondaryButtonText"),u.label.shouldClone=!1;var U=$.states.create("hover");U.properties.fillOpacity=1,U.properties.fill=w.getFor("secondaryButtonHover");var K=$.states.create("down");return K.transitionDuration=100,K.properties.fill=w.getFor("secondaryButtonDown"),K.properties.fillOpacity=1,u.role="button",u.focusable=!0,u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"icon",{get:function(){return this._icon},set:function(u){var w=this._icon;w&&(w.parent=void 0),u&&(this._icon=u,u.parent=this,u.interactionsEnabled=!1,u.shouldClone=!1,this.iconPosition=this.iconPosition,this._disposers.push(u))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"iconPosition",{get:function(){return this.getPropertyValue("iconPosition")},set:function(u){this.setPropertyValue("iconPosition",u),this.icon&&(u=="left"?this.icon.toBack():this.icon.toFront())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"label",{get:function(){return this._label},set:function(u){this._label&&this.removeDispose(this._label),this._label=u,u&&(u.parent=this,u.interactionsEnabled=!1,this._disposers.push(this._label))},enumerable:!0,configurable:!0}),R.prototype.createBackground=function(){return new Nb},R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),u.label&&this.label.copyFrom(u.label),u.icon&&(this.icon=u.icon.clone())},R}(Zn);ui.registeredClasses.Button=oC;var FI=function(j){function R(){var u=j.call(this)||this;return u.className="Circle",u.element=u.paper.add("circle"),u.setPercentProperty("radius",he(100)),u.setPropertyValue("horizontalCenter","middle"),u.setPropertyValue("verticalCenter","middle"),u.applyTheme(),u}return re(R,j),R.prototype.draw=function(){j.prototype.draw.call(this),this.element.attr({r:this.pixelRadius})},Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pixelRadius",{get:function(){return hs(this.radius,W(this.innerWidth/2,this.innerHeight/2))},enumerable:!0,configurable:!0}),R.prototype.measureElement=function(){var u=this.pixelRadius;this._bbox={x:-u,y:-u,width:2*u,height:2*u}},R}(so);ui.registeredClasses.Circle=FI;var fz=function(j){function R(){var u=j.call(this)||this;return u.className="Ellipse",u.element=u.paper.add("ellipse"),u.applyTheme(),u}return re(R,j),R.prototype.draw=function(){j.prototype.draw.call(this),this.element.attr({rx:this.radius}),this.element.attr({ry:this.radiusY})},Object.defineProperty(R.prototype,"radiusY",{get:function(){return this.innerHeight/2},set:function(u){this.height=2*u,this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radius",{get:function(){return this.innerWidth/2},set:function(u){this.width=2*u,this.invalidate()},enumerable:!0,configurable:!0}),R}(FI);ui.registeredClasses.Ellipse=fz;var X$=function(j){function R(){var u=j.call(this)||this;return u.className="Image",u.element=u.paper.add("image"),u.applyTheme(),u.width=50,u.height=50,u}return re(R,j),R.prototype.draw=function(){if(j.prototype.draw.call(this),this.href){var u=this.innerWidth,w=this.innerHeight;le(this.widthRatio)&&(u=w*this.widthRatio,this.width=u),le(this.heightRatio)&&(w=u*this.heightRatio,this.height=w),this.element.attr({width:u,height:w}),this.element.attrNS(wI,"xlink:href",this.href)}},Object.defineProperty(R.prototype,"href",{get:function(){return this.getPropertyValue("href")},set:function(u){this.setPropertyValue("href",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"widthRatio",{get:function(){return this.getPropertyValue("widthRatio")},set:function(u){this.setPropertyValue("widthRatio",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"heightRatio",{get:function(){return this.getPropertyValue("heightRatio")},set:function(u){this.setPropertyValue("heightRatio",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"bbox",{get:function(){return{x:0,y:0,width:this.pixelWidth,height:this.pixelHeight}},enumerable:!0,configurable:!0}),R}(so);ui.registeredClasses.Image=X$;var Nv=function(j){function R(){var u=j.call(this)||this;return u.className="Line",u.element=u.paper.add("line"),u.fill=He(),u.x1=0,u.y1=0,u.applyTheme(),u}return re(R,j),R.prototype.draw=function(){j.prototype.draw.call(this),this.x1==this.x2||this.y1==this.y2?this.pixelPerfect=!0:this.pixelPerfect=!1,this.x1=this.x1,this.x2=this.x2,this.y1=this.y1,this.y2=this.y2},Object.defineProperty(R.prototype,"x1",{get:function(){return this.getPropertyValue("x1")},set:function(u){le(u)||(u=0);var w=0;this.pixelPerfect&&this.stroke instanceof Dy&&(w=1e-5),this.setPropertyValue("x1",u,!0),this.element.attr({x1:u+w})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"x2",{get:function(){var u=this.getPropertyValue("x2");return le(u)||(u=this.pixelWidth),u},set:function(u){le(u)||(u=0),this.setPropertyValue("x2",u,!0),this.element.attr({x2:u})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"y1",{get:function(){return this.getPropertyValue("y1")},set:function(u){le(u)||(u=0);var w=0;this.pixelPerfect&&this.stroke instanceof Dy&&(w=1e-5),this.setPropertyValue("y1",u,!0),this.element.attr({y1:u+w})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"y2",{get:function(){var u=this.getPropertyValue("y2");return le(u)||(u=this.pixelHeight),u},set:function(u){le(u)||(u=0),this.setPropertyValue("y2",u,!0),this.element.attr({y2:u})},enumerable:!0,configurable:!0}),R.prototype.positionToPoint=function(u){var w={x:this.x1,y:this.y1},$={x:this.x2,y:this.y2},U=Z(w,$,u),K=ue(w,$);return{x:U.x,y:U.y,angle:K}},R}(so);ui.registeredClasses.Line=Nv;var j0e=function(j){function R(){var u=j.call(this)||this;return u.className="PointedShape",u.pointerBaseWidth=15,u.pointerLength=10,u.pointerY=0,u.pointerX=0,u.applyTheme(),u}return re(R,j),R.prototype.draw=function(){j.prototype.draw.call(this),le(this.pointerX)||(this.pointerX=this.pixelWidth/2),le(this.pointerY)||(this.pointerY=this.pixelHeight+10)},Object.defineProperty(R.prototype,"pointerBaseWidth",{get:function(){return this.getPropertyValue("pointerBaseWidth")},set:function(u){this.setPropertyValue("pointerBaseWidth",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pointerLength",{get:function(){return this.getPropertyValue("pointerLength")},set:function(u){this.setPropertyValue("pointerLength",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pointerX",{get:function(){return this.getPropertyValue("pointerX")},set:function(u){this.setPropertyValue("pointerX",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pointerY",{get:function(){return this.getPropertyValue("pointerY")},set:function(u){this.setPropertyValue("pointerY",u,!0)},enumerable:!0,configurable:!0}),R}(so),z0e=function(j){function R(){var u=j.call(this)||this;return u.className="PointedRectangle",u.element=u.paper.add("path"),u.cornerRadius=6,u.applyTheme(),u}return re(R,j),R.prototype.draw=function(){j.prototype.draw.call(this);var u=this.cornerRadius,w=this.innerWidth,$=this.innerHeight;if(w>0&&$>0){var U,K,ie=this.pointerX,ae=this.pointerY,we=this.pointerBaseWidth/2,Re=W(w/2,$/2),$e=gt(u,0,Re),Xe=gt(u,0,Re),Qe=gt(u,0,Re),dt=gt(u,0,Re),Gt=void 0,Yt=void 0,ai=void 0,oi=void 0,Ui=(ie-0)*($-0)-(ae-0)*(w-0),Ji=(ie-0)*(0-$)-(ae-$)*(w-0);Gt=Ui>0&&Ji>0?"M"+$e+",0 L"+((U=gt(ie,$e+we,w-we-Xe))-we)+",0 L"+ie+","+(ae=gt(ae,-1/0,0))+" L"+(U+we)+",0 L"+(w-Xe)+",0":"M"+$e+",0 L"+(w-Xe)+",0",ai=Ui<0&&Ji<0?" L"+(w-Qe)+","+$+" L"+((U=gt(ie,dt+we,w-we-Qe))+we)+","+$+" L"+ie+","+(ae=gt(ae,$,1/0))+" L"+(U-we)+","+$+" L"+dt+","+$:" L"+dt+","+$,oi=Ui<0&&Ji>0?" L0,"+($-dt)+" L0,"+((K=gt(ae,$e+we,$-dt-we))+we)+" L"+(ie=gt(ie,-1/0,0))+","+ae+" L0,"+(K-we)+" L0,"+$e:" L0,"+$e,Yt=Ui>0&&Ji<0?" L"+w+","+Xe+" L"+w+","+((K=gt(ae,Xe+we,$-we-Qe))-we)+" L"+(ie=gt(ie,w,1/0))+","+ae+" L"+w+","+(K+we)+" L"+w+","+($-Qe):" L"+w+","+($-Qe);var Si=" a"+Xe+","+Xe+" 0 0 1 "+Xe+","+Xe,Hi=" a"+Qe+","+Qe+" 0 0 1 -"+Qe+","+Qe,nr=" a"+dt+","+dt+" 0 0 1 -"+dt+",-"+dt,Ir=" a"+$e+","+$e+" 0 0 1 "+$e+",-"+$e;this.path=Gt+Si+Yt+Hi+ai+nr+oi+Ir}},Object.defineProperty(R.prototype,"cornerRadius",{get:function(){return this.getPropertyValue("cornerRadius")},set:function(u){this.setPropertyValue("cornerRadius",u,!0)},enumerable:!0,configurable:!0}),R}(j0e);function L4(j){var R=br(j[0]),u={x:0,y:0},w=no.minPolylineStep;le(w)||(w=.5);for(var $=0,U=j.length;$w&&(R+=br(K),u=K)}return R}function ln(j){return" M"+Ve(j.x,4)+","+Ve(j.y,4)+" "}function br(j){return" L"+Ve(j.x,4)+","+Ve(j.y,4)+" "}function aC(j,R){return" Q"+Ve(R.x,4)+","+Ve(R.y,4)+" "+Ve(j.x,4)+","+Ve(j.y,4)}function C3(j,R,u){return" C"+Ve(R.x,4)+","+Ve(R.y,4)+" "+Ve(u.x,4)+","+Ve(u.y,4)+" "+Ve(j.x,4)+","+Ve(j.y,4)}function X8e(){return" Z"}function Dd(j,R,u,w){if(R==0)return"";le(w)||(w=u);var $="",U=",",K=Math.ceil(Math.abs(R)/180),ie=1;R<0&&(ie=0);var ae=0,we=0,Re=-A(j)*u,$e=-Ue(j)*w;if(R<.5&&u>3e3)return br({x:dt=Ve(A(Qe=j+R)*u,4),y:Gt=Ve(Ue(Qe)*w,4)});for(var Xe=0;Xe(ae-j)/2&&(Ir=oi);var yr="";return R==360?yr=ln(Ji):(yr=ln(Ui),yr+=br(Ji),yr+=$0(nr,U,$e,!0)),yr+=Dd(j+Qe,R-2*Qe,u,$),le(w)&&w!=0?(R==360&&U==0?yr+=ln(Hi):(yr+=$0(Si,U,$e,!0),yr+=br(Hi),yr+=$0(Ir,K,Xe,!0)),yr+=Dd(ae-Gt,-(R-2*Gt),w,Re),(R<360||U>0)&&(yr+=$0(Ui,K,Xe,!0)),yr+=br(Ui)):(yr+=$0(Si,U,$e,!0),R<360&&(yr+=br(Ui))),yr}function $0(j,R,u,w,$,U){if(R==0)return"";var K=",";return" A"+R+K+u+K+(U=U||0)+K+ +($=Boolean($))+K+ +(w=Boolean(w))+K+Ve(j.x,4)+K+Ve(j.y,4)}function mz(j,R,u,w){return le(u)||(u=0),le(w)||(w=0),ln({x:u,y:w})+br({x:u+j,y:w})+br({x:u+j,y:w+R})+br({x:u,y:w+R})+" Z"}function uC(j,R){var u=",",w=" L";return R?"M"+j.x+u+j.y+w+j.x+u+(j.y+j.height)+w+(j.x+j.width)+u+(j.y+j.height)+w+(j.x+j.width)+u+j.y+w+j.x+u+j.y:"M"+j.x+u+j.y+w+(j.x+j.width)+u+j.y+w+(j.x+j.width)+u+(j.y+j.height)+w+j.x+u+(j.y+j.height)+w+j.x+u+j.y}function K8e(j,R){var u=Fx().add("path").node;if(u.setAttribute("d",j),u.getPointAtLength&&u.getTotalLength){for(var w=u.getTotalLength(),$=[],U=0;Uwe&&(Xe=2*we),(Re+=2*Math.asin(Xe/2/we))*Ze>ae+(u-$)/K*360)break;var Qe=Re*Ze,dt={x:j+we*Math.cos(Re),y:R+we*w/u*Math.sin(Re)};$e.push(dt),we=$+Qe/360*K}return $e.shift(),$e}function Z8e(j){if(!j||j.length==0)return"";var R=ln(j[0]);if(j&&j.length>0)for(var u=1;u0){for(var w="",$=0,U=u.length;$0){w+=ln(K[0]);for(var ie=1;ie1){for(var Qe=1;Qeu){$e=$.length;break}}else Xe.length==1&&(we=Xe[0],Re=Xe[0],ie=0,ae=1)}if(we&&Re){var dt=Z(we,Re,(u-ie)/(ae-ie));return{x:dt.x,y:dt.y,angle:w+ue(we,Re)}}}return{x:0,y:0,angle:0}},Object.defineProperty(R.prototype,"realSegments",{get:function(){return this._realSegments},enumerable:!0,configurable:!0}),R}(so);ui.registeredClasses.Polyline=k4;var Kte=function(j){function R(){var u=j.call(this)||this;return u.className="Polyarc",u.controlPointDistance=.5,u.controlPointPosition=.5,u.applyTheme(),u}return re(R,j),R.prototype.makePath=function(){this._distance=0;var u=this.segments;if(u&&u.length>0){var w="";this._realSegments=[];for(var $=0,U=u.length;$0){w+=ln(K[0]);for(var ae=1;ae0)for(var Ui=0;Ui<=ai;Ui++){var Ji=Dt(we,Re,Gt,Yt,Ui/ai);ie.push(Ji),this._distance+=C(oi,Ji),oi=Ji}else ie.push(we)}}}this.path=w}},Object.defineProperty(R.prototype,"controlPointPosition",{get:function(){return this.getPropertyValue("controlPointPosition")},set:function(u){this.setPropertyValue("controlPointPosition",u),this.makePath()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"controlPointDistance",{get:function(){return this.getPropertyValue("controlPointDistance")},set:function(u){this.setPropertyValue("controlPointDistance",u),this.makePath()},enumerable:!0,configurable:!0}),R}(k4);ui.registeredClasses.Polyarc=Kte;var H0e=function(j){function R(u){var w=j.call(this)||this;return w._bboxes=[],w.morphDuration=800,w.morphEasing=kv,w.morphToSingle=!0,w.scaleRatio=1,w.className="Morpher",w.morphable=u,w.applyTheme(),w}return re(R,j),R.prototype.morphToPolygon=function(u,w,$){var U=this.morphable.currentPoints;if(U&&u){this.sortPoints(U),this.sortPoints(u),this._morphFromPointsReal=[],this._morphToPointsReal=[],Ee(w)||(w=this.morphDuration),Ee($)||($=this.morphEasing),this._morphFromPointsReal=this.normalizePoints(u,U),this._morphToPointsReal=this.normalizePoints(U,u),this.morphable.currentPoints=this._morphFromPointsReal;var K=new dm(this,{property:"morphProgress",from:0,to:1},w,$);return this._disposers.push(K),K.start(),K}},R.prototype.normalizePoints=function(u,w){for(var $=0,U=u.length;$Re.width*Re.height?-1:1});for(var w=[],$=0,U=u.length;$oi&&(oi=we.length);for(var Ui=360/((oi=(Xe=this.addPoints(we,oi)).length)-1),Ji=0;Ji0)for(var nr=0,Ir=Re.length;nr0){var Qe=u[u.length-1];for(Re=U.length;Re0)for(var Ui=Qe.x+Qe.width/2,Ji=Qe.y+Qe.height/2,Si=0,Hi=Re.length;Si0&&$e&&$e.length>0){for(var Qe=[],dt=0,Gt=we.length;dt0&&Xe&&Xe.length>0){for(var Ui=[],Ji=0,Si=Re.length;Ji0){var ie=K.split("M"),ae=ie[0],we=ie[1];if(ae&&ae.length>0){var Re=ae.split("L");if(Re.length>0){var $e=[],Xe=[$e];u.push(Xe);for(var Qe=0;Qe0){var Gt=we.split("L");if(Gt.length>0){var Yt=[];for(Xe.push(Yt),Qe=Gt.length-1;Qe>=0;Qe--)dt=Gt[Qe].split(","),Yt.push({x:+dt[0],y:+dt[1]})}}}}}}this.setPropertyValue("points",u),this._currentPoints=u}return u},set:function(u){this.setPropertyValue("points",u,!0),this._currentPoints=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"currentPoints",{get:function(){return this._currentPoints&&this._currentPoints.length!=0||!this.path||(this._currentPoints=this.points),this._currentPoints},set:function(u){this._currentPoints!=u&&(this._currentPoints=u,this.draw())},enumerable:!0,configurable:!0}),R.prototype.draw=function(){var u,w,$,U,K="",ie=this._currentPoints;if(ie.length>0){for(var ae=0,we=ie.length;ae0){K+=ln(Qe=Re[0]);for(var Xe=0;XeQe.x)&&(u=Qe.x),(!le($)||$>Qe.y)&&($=Qe.y),(!le(U)||U0){var Qe;K+=ln(Qe=$e[0]);for(var dt=0,Gt=$e.length;dt0){var U="";this._realSegments=[];for(var K=0,ie=u.length;K0){var Re=ae[0],$e=ae[ae.length-1],Xe=!1;Ve(Re.x,3)==Ve($e.x)&&Ve(Re.y)==Ve($e.y)&&(Xe=!0),U+=ln(ae[0]);for(var Qe=0;Qe0)for(var Hi=0;Hi<=Ji;Hi++){var nr=Dt(Gt,Yt,oi,Ui,Hi/Ji);if(nr.x!=Si.x||nr.y!=Si.y){we.push(nr);var Ir=Ve(ue(Si,nr),5);this._distance+=C(Si,nr),this.allPoints[Math.floor(this._distance)]={x:nr.x,y:nr.y,angle:Ir},Si=nr}}else we.push(dt)}}var yr=this.allPoints;if(yr.length>1){for(var Es=0;Es1)yr[Es]=yr[Es-1];else for(var Dn=1;Dn1)for(var K=1;K<$.length;K++){var ie=C(u,$[K]);ie1){if(w&&K>3){if(u<0){u<-.01&&(u=-.01);var ie=U[0],ae=U[1];return{x:we=ie.x-(ie.x-ae.x)*K*u,y:Re=ie.y-(ie.y-ae.y)*K*u,angle:ue(ie,ae)}}var we,Re;if(u>1)return u>1.01&&(u=1.01),ie=U[U.length-2],ae=U[U.length-3],{x:we=ie.x+(ie.x-ae.x)*K*(u-1),y:Re=ie.y+(ie.y-ae.y)*K*(u-1),angle:ue(ie,{x:we,y:Re})};if(u==1){var $e=U[U.length-1];return{x:$e.x,y:$e.y,angle:$e.angle}}}else u<0&&(u=Math.abs(u),$=180),u>=1&&(u=.9999999999999);var Xe;return{x:(Xe=U[Math.floor(u*K)]).x,y:Xe.y,angle:Xe.angle+$}}return K==1?{x:(Xe=U[0]).x,y:Xe.y,angle:Xe.angle}:{x:0,y:0,angle:0}},R}(k4);ui.registeredClasses.Polyspline=N4;var LI=function(j){function R(){var u=j.call(this)||this;return u.className="Slice",u.setPropertyValue("cornerRadius",0),u.setPropertyValue("startAngle",0),u.setPercentProperty("innerRadius",0),u.setPercentProperty("radius",0),u.setPropertyValue("arc",0),u.setPropertyValue("shiftRadius",0),u.strokeOpacity=1,u.setPropertyValue("layout","none"),u.slice=u.createChild(so),u.slice.isMeasured=!1,u._disposers.push(u.slice),u.applyTheme(),u}return re(R,j),R.prototype.draw=function(){j.prototype.draw.call(this);var u=this.radiusY;this.radius>0&&u==0&&(u=.01),this.slice.path=lC(this.startAngle,this.arc,this.radius,this.pixelInnerRadius,u,this.cornerRadius,this.innerCornerRadius),this.slice.invalidate(),this.shiftRadius=this.shiftRadius,this.realFill instanceof Fy&&this.updateGradient(this.realFill),this.realStroke instanceof Fy&&this.updateGradient(this.realStroke)},R.prototype.updateGradient=function(u){u.element.attr({gradientUnits:"userSpaceOnUse"}),u.element.attr({r:this.radius}),u.cx=0,u.cy=0,u.element.attr({radius:this.radius})},Object.defineProperty(R.prototype,"bbox",{get:function(){return this.definedBBox?this.definedBBox:this.isMeasured?qe([Xt(this.startAngle,this.startAngle+this.arc,this.pixelInnerRadius),Xt(this.startAngle,this.startAngle+this.arc,this.radius)]):{x:0,y:0,width:0,height:0}},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startAngle",{get:function(){return this.getPropertyValue("startAngle")},set:function(u){this.setPropertyValue("startAngle",ei(u),!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"arc",{get:function(){return this.getPropertyValue("arc")},set:function(u){le(u)||(u=0),this.setPropertyValue("arc",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radius",{get:function(){var u=this.getPropertyValue("radius");return le(u)||(u=0),u},set:function(u){this.setPropertyValue("radius",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radiusY",{get:function(){var u=this.getPropertyValue("radiusY");return le(u)||(u=this.radius),u},set:function(u){this.setPropertyValue("radiusY",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"innerRadius",{get:function(){return this.getPropertyValue("innerRadius")},set:function(u){this.setPercentProperty("innerRadius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pixelInnerRadius",{get:function(){return hs(this.innerRadius,this.radius)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cornerRadius",{get:function(){return this.getPropertyValue("cornerRadius")},set:function(u){this.setPropertyValue("cornerRadius",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"innerCornerRadius",{get:function(){return this.getPropertyValue("innerCornerRadius")},set:function(u){this.setPropertyValue("innerCornerRadius",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"shiftRadius",{get:function(){return this.getPropertyValue("shiftRadius")},set:function(u){this.setPropertyValue("shiftRadius",u),u=this.getPropertyValue("shiftRadius"),this.dx=u*this.radius*this.ix,this.dy=u*this.radiusY*this.iy},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"ix",{get:function(){return A(this.middleAngle)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"iy",{get:function(){return Ue(this.middleAngle)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"middleAngle",{get:function(){return this.startAngle+this.arc/2},enumerable:!0,configurable:!0}),R.prototype.getTooltipX=function(){var u=this.getPropertyValue("tooltipX");if(le(u))return u;var w=.5;u instanceof J&&(w=u.value);var $=hs(this.innerRadius,this.radius);return this.ix*($+(this.radius-$)*w)},R.prototype.getTooltipY=function(){var u=this.getPropertyValue("tooltipY");if(le(u))return u;var w=.5;u instanceof J&&(w=u.value);var $=hs(this.innerRadius,this.radius);return this.iy*($+(this.radius-$)*w)+this.slice.dy},R}(Zn);ui.registeredClasses.Slice=LI;var cC=function(j){function R(){var u=j.call(this)||this;u.className="Preloader",u.width=he(100),u.height=he(100);var w=new $a,$=u.createChild(Zn);$.shouldClone=!1;var U=$.createChild(LI);U.shouldClone=!1,U.radius=53,U.arc=360,U.fill=w.getFor("fill"),U.fillOpacity=.8,U.innerRadius=42,U.isMeasured=!1,u.backgroundSlice=U;var K=$.createChild(LI);K.shouldClone=!1,K.radius=50,K.innerRadius=45,K.fill=w.getFor("alternativeBackground"),K.fillOpacity=.2,K.isMeasured=!1,u.progressSlice=K;var ie=$.createChild(Zm);return ie.shouldClone=!1,ie.horizontalCenter="middle",ie.verticalCenter="middle",ie.isMeasured=!1,ie.fill=w.getFor("text"),ie.align="center",ie.valign="middle",ie.textAlign="middle",ie.fillOpacity=.4,u.label=ie,u.background.opacity=1,u.background.fill=w.getFor("background"),u.contentAlign="center",u.contentValign="middle",u.delay=300,u.states.create("hidden").properties.opacity=0,u.visible=!1,u.hide(0),u.__disabled=!0,u._disposers.push(u.backgroundSlice),u._disposers.push(u.progressSlice),u._disposers.push(u.label),u._disposers.push($),u}return re(R,j),Object.defineProperty(R.prototype,"progress",{get:function(){return this.getPropertyValue("progress")},set:function(u){var w=this;this.__disabled=!1,this.validateLayout(),this.setPropertyValue("progress",u),this.progressSlice.arc=360*u,this.label&&(this.label.text=Math.round(100*u)+"%"),u>=1?(this._started&&(this._started=void 0),ui.events.once("enterframe",function(){var $=w.hide();$&&!$.isFinished()?$.events.once("animationended",function(){w.__disabled=!0}):w.__disabled=!0}),this.interactionsEnabled=!1,this.setPropertyValue("progress",0)):u>0&&(this.delay?this._started?this._started+this.delay<=new Date().getTime()&&(this.__disabled=!1,this.show(),this.interactionsEnabled=!0):this._started=new Date().getTime():(this.__disabled=!1,this.show(),this.interactionsEnabled=!0))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"delay",{get:function(){return this.getPropertyValue("delay")},set:function(u){this.setPropertyValue("delay",u)},enumerable:!0,configurable:!0}),R}(Zn);ui.registeredClasses.Preloader=cC;var K$=function(j){function R(){var u=j.call(this)||this;u.className="ResizeButton",u.orientation="horizontal",u.layout="absolute",u.horizontalCenter="middle",u.verticalCenter="middle",u.draggable=!0,u.padding(8,8,8,8),u.background.cornerRadius(20,20,20,20);var w=new so;w.element=u.paper.add("path");var $=ln({x:-2,y:-6});return $+=br({x:-2,y:6}),$+=ln({x:2,y:-6}),$+=br({x:2,y:6}),w.path=$,w.pixelPerfect=!0,w.padding(0,4,0,4),w.stroke=new $a().getFor("alternativeText"),w.strokeOpacity=.7,u.icon=w,u.label.dispose(),u.label=void 0,u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"orientation",{set:function(u){var w=this.icon;w&&(w.rotation=u=="horizontal"?0:-90)},enumerable:!0,configurable:!0}),R}(oC);ui.registeredClasses.ResizeButton=K$;var W0e=function(j){function R(){var u=j.call(this)||this;u.className="CloseButton",u.padding(8,8,8,8),u.showSystemTooltip=!0,u.width=30,u.height=30;var w=new $a;u.cursorOverStyle=_l.pointer;var $=u.background;$.cornerRadius(20,20,20,20);var U=w.getFor("background");$.fill=U,$.stroke=w.getFor("primaryButton"),$.strokeOpacity=1,$.strokeWidth=1;var K=w.getFor("primaryButtonActive"),ie=$.states.getKey("hover");ie.properties.strokeWidth=3,ie.properties.fill=U;var ae=$.states.getKey("down");ae.properties.stroke=K,ae.properties.fill=U;var we=new so;return we.element=u.paper.add("path"),we.stroke=$.stroke,u.icon=we,u.applyTheme(),u}return re(R,j),R.prototype.validate=function(){j.prototype.validate.call(this);var u=this.pixelWidth/3,w=this.pixelHeight/3,$=ln({x:-u/2,y:-w/2});$+=br({x:u/2,y:w/2}),$+=ln({x:u/2,y:-w/2}),$+=br({x:-u/2,y:w/2}),this.icon.path=$,this.invalidateLayout()},R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),Ee(this.readerTitle)||(this.readerTitle=this.language.translate("Close"))},R}(oC);ui.registeredClasses.CloseButton=W0e;var J$=function(j){function R(){var u=j.call(this)||this;u.className="SwitchButton",u.tooltipY=0,u.layout="horizontal",u.contentAlign="center",u.contentValign="middle",u.padding(8,16,8,16),u.setStateOnChildren=!0,u.states.create("active");var w=new $a,$=new Zm;$.fillOpacity=.3,$.states.create("active").properties.fillOpacity=1,$.isActive=!0,u.leftLabel=$;var U=new oC,K=new FI;U.contentValign="none",U.padding(0,0,0,0),K.radius=10,U.icon=K,U.icon.valign="middle",U.label=void 0;var ie=he(100);U.background.cornerRadius(ie,ie,ie,ie),U.width=3.5*K.radius,U.height=2.1*K.radius,U.marginLeft=8,U.marginRight=8,U.togglable=!0,K.dx=.7*-K.radius,K.fill=w.getFor("primaryButton"),K.states.create("hover").properties.fill=w.getFor("primaryButtonHover");var ae=K.states.create("active");ae.properties.fill=w.getFor("primaryButtonActive"),ae.properties.dx=.7*K.radius,u.switchButton=U,u.events.on("toggled",function(){u.leftLabel.isActive=!u.isActive,u.rightLabel.isActive=u.isActive});var we=new Zm;return we.fillOpacity=.3,we.states.create("active").properties.fillOpacity=1,u.rightLabel=we,u.role="button",u.focusable=!0,we.valign="middle",$.valign="middle",U.valign="middle",u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"leftLabel",{get:function(){return this._leftLabel},set:function(u){this._leftLabel&&this.removeDispose(this._leftLabel),this._leftLabel=u,u&&(u.parent=this,u.interactionsEnabled=!1,u.shouldClone=!1,this._disposers.push(this._leftLabel))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"rightLabel",{get:function(){return this._rightLabel},set:function(u){this._rightLabel&&this.removeDispose(this._rightLabel),this._rightLabel=u,u&&(u.parent=this,u.interactionsEnabled=!1,u.shouldClone=!1,this._disposers.push(this._rightLabel))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"switch",{get:function(){return this._switchButton},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"switchButton",{get:function(){return this._switchButton},set:function(u){this._switchButton&&this.removeDispose(this._switchButton),this._switchButton=u,u&&(u.parent=this,u.shouldClone=!1,this._disposers.push(this._switchButton))},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),u.leftLabel&&this.leftLabel.copyFrom(u.leftLabel),u.rightLabel&&this.rightLabel.copyFrom(u.rightLabel),u.switchButton&&this.switchButton.copyFrom(u.switchButton)},R}(Zn);ui.registeredClasses.SwitchButton=J$;var B0=function(j){function R(){var u=j.call(this)||this;u._previousStart=0,u._previousEnd=1,u._prevStart=0,u._prevEnd=1,u._isBusy=!1,u._skipRangeEvents=!1,u.updateWhileMoving=!0,u.className="Scrollbar",u.minHeight=12,u.minWidth=12,u.animationDuration=0,u.animationEasing=kv,u.margin(10,10,10,10);var w=new $a,$=u.background;return $.cornerRadius(10,10,10,10),$.fill=w.getFor("fill"),$.fillOpacity=.5,u.showSystemTooltip=!0,u.startGrip=new K$,u.endGrip=new K$,u.events.on("transformed",function(){u.updateThumb()},u,!1),u.start=0,u.end=1,u.role="scrollbar",u.thumb.role="slider",u.thumb.readerLive="polite",u.startGrip.role="slider",u.endGrip.role="slider",u.events.once("inited",function(){u._previousStart=void 0,u.dispatchRangeChange()},void 0,!1),u.hideGrips=!1,u.orientation="horizontal",u.setSVGAttribute({"aria-valuemin":"0"}),u.setSVGAttribute({"aria-valuemax":"100"}),u.applyTheme(),u}return re(R,j),R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),this.orientation==="horizontal"?(Ee(this.readerTitle)||(this.readerTitle=this.language.translate("Use TAB to select grip buttons or left and right arrows to change selection")),Ee(this.thumb.readerDescription)||(this.thumb.readerDescription=this.language.translate("Use left and right arrows to move selection")),Ee(this.startGrip.readerDescription)||(this.startGrip.readerDescription=this.language.translate("Use left and right arrows to move left selection")),Ee(this.endGrip.readerDescription)||(this.endGrip.readerDescription=this.language.translate("Use left and right arrows to move right selection")),this.readerOrientation="horizontal"):(Ee(this.readerTitle)||(this.readerTitle=this.language.translate("Use TAB select grip buttons or up and down arrows to change selection")),Ee(this.thumb.readerDescription)||(this.thumb.readerDescription=this.language.translate("Use up and down arrows to move selection")),Ee(this.startGrip.readerDescription)||(this.startGrip.readerDescription=this.language.translate("Use up and down arrows to move upper selection")),Ee(this.endGrip.readerDescription)||(this.endGrip.readerDescription=this.language.translate("Use up and down arrows to move lower selection")),this.readerOrientation="vertical"),this.readerControls=this.baseSprite.uidAttr()},R.prototype.validateLayout=function(){this.updateSize(),j.prototype.validateLayout.call(this),this.updateExtremes()},R.prototype.processBackground=function(){j.prototype.processBackground.call(this);var u=this.background;u.clickable=!0,u.events.on("hit",this.handleBgHit,this,void 0)},R.prototype.handleBgHit=function(u){this.makeBusy();var w=u.spritePoint;w=wp(w,this.background,this);var $=this.thumb;if(this.orientation=="horizontal"){var U=w.x-$.pixelWidth/2;U=gt(U,0,this.innerWidth-$.pixelWidth),this._thumbAnimation=$.animate({property:"x",to:U},this.animationDuration,this.animationEasing)}else{var K=w.y-$.pixelHeight/2;K=gt(K,0,this.innerHeight-$.pixelHeight),this._thumbAnimation=$.animate({property:"y",to:K},this.animationDuration,this.animationEasing)}this.animationDuration>0?this._thumbAnimation.events.on("animationended",this.makeUnbusy,this,!1):(this._thumb.validate(),this.makeUnbusy())},R.prototype.makeBusy=function(){this._isBusy=!0,this._skipRangeEvents=!1,this._unbusyTimeout&&this.removeDispose(this._unbusyTimeout),this._unbusyTimeout=void 0,this.stopAnimations()},R.prototype.stopAnimations=function(){this._thumbAnimation&&this._thumbAnimation.stop(!0),this._zoomAnimation&&this._zoomAnimation.stop(!0)},R.prototype.makeUnbusy=function(){this._unbusyTimeout=this.setTimeout(this.makeUnbusyReal.bind(this),1.1*this.animationDuration)},R.prototype.makeUnbusyReal=function(){this._usingGrip=void 0,this._isBusy=!1,this.updateWhileMoving||this.dispatchRangeChange()},R.prototype.dispatchRangeChange=function(){this._previousEnd==this.end&&this._previousStart==this.start||(this._previousStart=this.start,this._previousEnd=this.end,this.dispatch("rangechanged"))},R.prototype.updateThumb=function(u){if(u===void 0&&(u=!0),this.parent){var w=this.thumb,$=this.start,U=this.end,K=this.startGrip,ie=this.endGrip;if(this.orientation=="horizontal"){var ae=this.innerWidth;w.width=ae*(U-$),w.maxX=ae-w.pixelWidth,w.x=$*ae,K.moveTo({x:w.pixelX,y:0},void 0,void 0,!0),ie.moveTo({x:w.pixelX+w.pixelWidth,y:0},void 0,void 0,!0),K.readerTitle=this.language.translate("From %1",void 0,this.adapter.apply("positionValue",{value:Math.round(100*$)+"%",position:$}).value),K.readerValueNow=""+Math.round(100*$),K.readerValueText=K.readerTitle,ie.readerTitle=this.language.translate("To %1",void 0,this.adapter.apply("positionValue",{value:Math.round(100*U)+"%",position:U}).value),ie.readerValueNow=""+Math.round(100*U),ie.readerValueText=ie.readerTitle}else{var we=this.innerHeight;w.height=we*(U-$),w.maxY=we-w.pixelHeight,w.y=(1-U)*we,K.moveTo({x:0,y:w.pixelY+w.pixelHeight},void 0,void 0,!0),ie.moveTo({x:0,y:w.pixelY},void 0,void 0,!0),K.readerTitle=this.language.translate("To %1",void 0,this.adapter.apply("positionValue",{value:Math.round(100*(1-$))+"%",position:1-$}).value),K.readerValueNow=""+Math.round(100*$),K.readerValueText=K.readerTitle,ie.readerTitle=this.language.translate("From %1",void 0,this.adapter.apply("positionValue",{value:Math.round(100*(1-U))+"%",position:1-U}).value),ie.readerValueNow=""+Math.round(100*U),ie.readerValueText=ie.readerTitle}w.readerTitle=this.language.translate("From %1 to %2",void 0,this.adapter.apply("positionValue",{value:Math.round(100*$)+"%",position:$}).value,this.adapter.apply("positionValue",{value:Math.round(100*U)+"%",position:U}).value),w.readerValueNow=""+Math.round(100*$),w.readerValueText=w.readerTitle,this.readerValueNow=""+Math.round(100*$),this.readerValueText=w.readerTitle,!this._skipRangeEvents&&this.updateWhileMoving&&u&&this.dispatchRangeChange()}},R.prototype.updateExtremes=function(){var u=0,w=0,$=0,U=0;this.orientation=="horizontal"?($=this.innerWidth,w=U=this.innerHeight/2):(U=this.innerHeight,u=$=this.innerWidth/2);var K=this.startGrip;K.minX=u,K.maxX=$,K.minY=w,K.maxY=U;var ie=this.endGrip;ie.minX=u,ie.maxX=$,ie.minY=w,ie.maxY=U;var ae=this.thumb;ae.minX=u,ae.maxX=$,ae.minY=w,ae.maxY=U},R.prototype.updateSize=function(){var u=this.orientation,w=this.startGrip;w&&(w.orientation=u),this.endGrip&&(this.endGrip.orientation=u);var $=this.thumb;$&&(u=="horizontal"?(le(this._pixelWidth)||this.width instanceof J||(this.width=he(100)),Ee(this.percentHeight)&&(this.height=this.minHeight),$.height=this.innerHeight,$.verticalCenter="middle",$.horizontalCenter="left"):(le(this._pixelHeight)||this.height instanceof J||(this.height=he(100)),Ee(this.percentWidth)&&(this.width=this.minWidth),$.width=this.innerWidth,$.verticalCenter="top",$.horizontalCenter="middle"))},Object.defineProperty(R.prototype,"isBusy",{get:function(){return this._isBusy},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"start",{get:function(){return Math.min(this.getPosition(this._start),this.getPosition(this._end))},set:function(u){this._isBusy||(this.__start=u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"__start",{get:function(){return this._start},set:function(u){this._start=this.getPosition(u),this.updateThumb()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"end",{get:function(){return Math.max(this.getPosition(this._start),this.getPosition(this._end))},set:function(u){this._isBusy||(this.__end=u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"__end",{get:function(){return this._end},set:function(u){this._end=this.getPosition(u),this.updateThumb()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"range",{get:function(){return{start:this.start,end:this.end,priority:this._usingGrip}},enumerable:!0,configurable:!0}),R.prototype.skipRangeEvents=function(){this._isBusy||(this._skipRangeEvents=!0)},R.prototype.fixRange=function(u){u.start==Ve(this._start,2)&&u.end==Ve(this._end,2)||(this._start=u.start,this._end=u.end,this._skipRangeEvents=!0,this.updateThumb(),this._skipRangeEvents=!1,this.thumb.validate(),this.thumb.background.validate())},R.prototype.getPosition=function(u){return gt(Ve(u,4),0,1)},Object.defineProperty(R.prototype,"orientation",{get:function(){return this.getPropertyValue("orientation")},set:function(u){this.setPropertyValue("orientation",u)&&(u==="horizontal"?(this.startGrip.cursorOverStyle=_l.horizontalResize,this.endGrip.cursorOverStyle=_l.horizontalResize):(this.startGrip.cursorOverStyle=_l.verticalResize,this.endGrip.cursorOverStyle=_l.verticalResize),this.updateByOrientation(),this.invalidate())},enumerable:!0,configurable:!0}),R.prototype.updateByOrientation=function(){},Object.defineProperty(R.prototype,"startGrip",{get:function(){return this._startGrip},set:function(u){this._startGrip&&this.removeDispose(this._startGrip),this._startGrip=u,this.processGrip(u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endGrip",{get:function(){return this._endGrip},set:function(u){this._endGrip&&this.removeDispose(this._endGrip),this._endGrip=u,this.processGrip(u)},enumerable:!0,configurable:!0}),R.prototype.processGrip=function(u){u.parent=this,u.isMeasured=!1,u.focusable=!0,u.shouldClone=!1,u.zIndex=100,u.events.on("drag",this.handleGripDrag,this,!1),u.events.on("dragstop",this.makeUnbusy,this,!1),u.events.on("down",this.makeBusy,this,!1),u.events.on("up",this.makeUnbusy,this,!1),this._disposers.push(u)},R.prototype.handleGripDrag=function(u){this.makeBusy(),u.target===this._startGrip?this._usingGrip="start":this._usingGrip="end",this.orientation=="horizontal"?(this._start=this.startGrip.pixelX/this.innerWidth,this._end=this.endGrip.pixelX/this.innerWidth):(this._start=1-this.startGrip.pixelY/this.innerHeight,this._end=1-this.endGrip.pixelY/this.innerHeight),this.updateThumb()},Object.defineProperty(R.prototype,"thumb",{get:function(){if(!this._thumb){var u=new oC;u.background.cornerRadius(10,10,10,10),u.padding(0,0,0,0),this.thumb=u}return this._thumb},set:function(u){var w=this;u&&(this._thumb&&this.removeDispose(this._thumb),this._thumb=u,u.parent=this,u.isMeasured=!1,u.inert=!0,u.draggable=!0,u.clickable=!0,u.hoverable=!0,u.focusable=!0,u.shouldClone=!1,u.zIndex=0,u.cursorOverStyle=_l.grab,u.cursorDownStyle=_l.grabbing,u.events.on("dragstart",this.makeBusy,this,!1),u.events.on("dragstop",this.makeUnbusy,this,!1),u.events.on("positionchanged",this.handleThumbPosition,this,!1),u.events.on("sizechanged",this.handleThumbPosition,this,!1),u.events.on("doublehit",this.handleDoubleClick,this,!1),this._disposers.push(Vs().body.events.on("keyup",function($){Dg.isKey($.event,["space","enter"])&&w.thumb.isFocused&&($.event.preventDefault(),w.handleDoubleClick())})),this._disposers.push(this._thumb))},enumerable:!0,configurable:!0}),R.prototype.handleDoubleClick=function(){this.makeBusy();var u=0,w=1;this.start!=0||this.end!=1?(this._prevStart=this.start,this._prevEnd=this.end):(u=this._prevStart,w=this._prevEnd);var $=this.animate([{property:"__start",to:u},{property:"__end",to:w}],this.animationDuration,this.animationEasing);$&&!$.isFinished()?($.events.on("animationended",this.makeUnbusy,this,!1),this._zoomAnimation=$):this.makeUnbusy()},R.prototype.handleThumbPosition=function(){var u=this.thumb;if(this.orientation=="horizontal"){var w=this.innerWidth,$=u.innerWidth,U=u.pixelX;this._start=U/w,this._end=(U+$)/w,this.updateThumb()}else{var K=this.innerHeight,ie=u.innerHeight,ae=u.pixelY;ae+ie>K&&(ae=K-ie,u.y=ae),this._start=1-(ae+ie)/K,this._end=1-ae/K,this.updateThumb()}},R.prototype.createBackground=function(){return new Nb},Object.defineProperty(R.prototype,"hideGrips",{get:function(){return this._hideGrips},set:function(u){var w=this;this._hideGrips=u,this._overDisposer&&this.removeDispose(this._overDisposer),this._outDisposer&&this.removeDispose(this._outDisposer),u?(this._overDisposer=this.events.on("over",function(){w.startGrip.show(),w.endGrip.show()},void 0,!1),this._outDisposer=this.events.on("out",function(){w.startGrip.hide(),w.endGrip.hide()},void 0,!1),this.startGrip.hide(),this.endGrip.hide()):(this.startGrip.show(),this.endGrip.show())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"animationDuration",{get:function(){return this.getPropertyValue("animationDuration")},set:function(u){this.setPropertyValue("animationDuration",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"animationEasing",{get:function(){return this.getPropertyValue("animationEasing")},set:function(u){this.setPropertyValue("animationEasing",u)},enumerable:!0,configurable:!0}),R.prototype.asFunction=function(u){return u=="animationEasing"||j.prototype.asIs.call(this,u)},R}(Zn);ui.registeredClasses.Scrollbar=B0;var Jte=function(j){function R(){var u=j.call(this)||this;return u.className="Slider",u.thumb.opacity=0,u.thumb.interactionsEnabled=!1,u.endGrip.opacity=0,u.endGrip.interactionsEnabled=!1,u.startGrip.events.on("drag",function(){u.endGrip.x=u.startGrip.x,u.endGrip.y=u.startGrip.y}),u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"__end",{get:function(){return this._start},set:function(u){},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"end",{get:function(){return this._start},set:function(u){},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"start",{get:function(){return this._start},set:function(u){this._isBusy||(this.__start=u)},enumerable:!0,configurable:!0}),R}(B0);ui.registeredClasses.Slider=Jte;var gz=function(j){function R(){var u=j.call(this)||this;u.className="TextLink",u.selectable=!0;var w=new $a;return u.fill=w.getFor("primaryButton").brighten(.3),u.states.create("hover").properties.fill=w.getFor("primaryButtonHover").brighten(.3),u.states.create("down").properties.fill=w.getFor("primaryButtonDown").brighten(.3),u.cursorOverStyle=_l.pointer,u.applyTheme(),u}return re(R,j),R}(Zm);ui.registeredClasses.TextLink=gz;var hC=function(j){function R(){var u=j.call(this)||this;return u.properties={},u.isTemplate=!1,u._scale=1,u._nonScaling=!0,u.className="Filter",u.filterPrimitives=new Us,u.properties.filterUnits="objectBoundingBox",u.filterPrimitives.events.on("inserted",function(w){u._disposers.push(w.newValue)}),u.width=120,u.height=120,u.applyTheme(),u}return re(R,j),R.prototype.appendPrimitives=function(u){pr(this.filterPrimitives.iterator(),function(w){u.add(w)})},R.prototype.animate=function(u,w,$){return new dm(this,u,w,$).start()},Object.defineProperty(R.prototype,"width",{get:function(){return this.properties.width},set:function(u){this.properties.width=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"height",{get:function(){return this.properties.height},set:function(u){this.properties.height=u},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){var w=this;j.prototype.copyFrom.call(this,u),gi(u.properties,function($,U){w[$]=U})},Object.defineProperty(R.prototype,"paper",{get:function(){return this._paper?this._paper:Fx()},set:function(u){this._paper!=u&&(this._paper=u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"animations",{get:function(){return this._animations||(this._animations=[],this._disposers.push(new Mx(this._animations))),this._animations},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"scale",{get:function(){return this._scale},set:function(u){this._scale=u,this.updateScale()},enumerable:!0,configurable:!0}),R.prototype.updateScale=function(){},Object.defineProperty(R.prototype,"filterUnits",{get:function(){return this.properties.filterUnits},set:function(u){this.properties.filterUnits=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"nonScaling",{get:function(){return this._nonScaling},set:function(u){this._nonScaling=u,u||(this._scale=1),this.updateScale()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"sprite",{set:function(u){this.setSprite(u)},enumerable:!0,configurable:!0}),R.prototype.setSprite=function(u){this._sprite&&this._sprite!=u&&this._sprite.filters.removeValue(this),this._sprite=u},R}(Wt),Zte=function(j){function R(){var u=j.call(this)||this;return u.className="DropShadowFilter",u.color=He("#000"),u.feGaussianBlur=u.paper.add("feGaussianBlur"),u.feGaussianBlur.attr({result:"blurOut",in:"SourceGraphic"}),u.filterPrimitives.push(u.feGaussianBlur),u.feOffset=u.paper.add("feOffset"),u.feOffset.attr({result:"offsetBlur"}),u.filterPrimitives.push(u.feOffset),u.feFlood=u.paper.add("feFlood"),u.feFlood.attr({"flood-color":u.color}),u.filterPrimitives.push(u.feFlood),u.feComposite=u.paper.add("feComposite"),u.feComposite.attr({in2:"offsetBlur",operator:"in"}),u.filterPrimitives.push(u.feComposite),u.feMerge=u.paper.addGroup("feMerge"),u.feMerge.add(u.paper.add("feMergeNode")),u.feMerge.add(u.paper.add("feMergeNode").attr({in:"SourceGraphic"})),u.filterPrimitives.push(u.feMerge),u.width=200,u.height=200,u.blur=1.5,u.dx=3,u.dy=3,u.opacity=.5,u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"color",{get:function(){return this.properties.color},set:function(u){this.properties.color=u,this.feFlood&&this.feFlood.attr({"flood-color":u})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"opacity",{get:function(){return this.properties.opacity},set:function(u){this.properties.opacity=u,this.feFlood.attr({"flood-opacity":u})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dx",{get:function(){return this.properties.dx},set:function(u){this.properties.dx=u,this.feOffset.attr({dx:u/this.scale})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dy",{get:function(){return this.properties.dy},set:function(u){this.properties.dy=u,this.feOffset.attr({dy:u/this.scale})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"blur",{get:function(){return this.properties.blur},set:function(u){this.properties.blur=u,this.feGaussianBlur.attr({stdDeviation:u/this.scale})},enumerable:!0,configurable:!0}),R.prototype.updateScale=function(){this.dx=this.dx,this.dy=this.dy,this.blur=this.blur},R}(hC);ui.registeredClasses.DropShadowFilter=Zte;var kI=function(j){function R(){var u=j.call(this)||this;u._boundingRect={x:-4e4,y:-4e4,width:8e4,height:8e4},u._pointTo={x:0,y:0},u.fitPointerToBounds=!1,u._verticalOrientation="up",u.fixDoc=!0,u.className="Tooltip",u.isMeasured=!1,u.getFillFromObject=!0,u.margin(5,5,5,5),u.defaultState.transitionDuration=1,u.hiddenState.transitionDuration=1;var w=u.background;w.interactionsEnabled=!1,w.fillOpacity=.9,w.strokeWidth=1,w.strokeOpacity=1,w.stroke=He("#ffffff"),w.cornerRadius=3,w.pointerLength=6,w.pointerBaseWidth=10;var $=new Zte;$.dy=1,$.dx=1,$.opacity=.5,w.filters.push($),u.autoTextColor=!0;var U=u.createChild(Zm);return U.shouldClone=!1,u.label=U,U.padding(7,12,4,12),U.interactionsEnabled=!1,U.horizontalCenter="middle",U.fill=He("#ffffff"),u._disposers.push(U),u.label.events.on("sizechanged",u.drawBackground,u),u.label.zIndex=1,u.pointerOrientation="vertical",u.animationDuration=0,u.animationEasing=kv,u.setPropertyValue("showInViewport",!1),u.role="tooltip",u.visible=!1,u.opacity=0,u.x=0,u.y=0,u.events.on("visibilitychanged",u.handleVisibility,u),u.applyTheme(),u}return re(R,j),R.prototype.handleVisibility=function(){this.visible&&this.label.invalidate()},Object.defineProperty(R.prototype,"getStrokeFromObject",{get:function(){return this.getPropertyValue("getStrokeFromObject")},set:function(u){this.setPropertyValue("getStrokeFromObject",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"autoTextColor",{get:function(){return this.getPropertyValue("autoTextColor")},set:function(u){this.setPropertyValue("autoTextColor",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"keepTargetHover",{get:function(){return this.getPropertyValue("keepTargetHover")},set:function(u){var w=this;this.setPropertyValue("keepTargetHover",u,!0)&&u&&(this.hoverable=!0,this.background.interactionsEnabled=!0,this._disposers.push(this.events.on("over",function($){w.targetSprite&&w.targetSprite.hoverable&&(w.targetSprite.isHover=!0)})),this._disposers.push(this.events.on("out",function($){w.targetSprite&&w.targetSprite.hoverable&&(w.targetSprite.isHover=!1)})))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"showInViewport",{get:function(){return this.getPropertyValue("showInViewport")},set:function(u){this.setPropertyValue("showInViewport",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"getFillFromObject",{get:function(){return this.getPropertyValue("getFillFromObject")},set:function(u){this.setPropertyValue("getFillFromObject",u,!0)},enumerable:!0,configurable:!0}),R.prototype.createBackground=function(){return new z0e},Object.defineProperty(R.prototype,"pointerOrientation",{get:function(){return this.getPropertyValue("pointerOrientation")},set:function(u){this.setPropertyValue("pointerOrientation",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"animationDuration",{get:function(){return this.getPropertyValue("animationDuration")},set:function(u){this.setPropertyValue("animationDuration",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"animationEasing",{get:function(){return this.getPropertyValue("animationEasing")},set:function(u){this.setPropertyValue("animationEasing",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"html",{get:function(){return this.label.html},set:function(u){this.label.html!=u&&(this.label.html=u,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"text",{get:function(){return this.label.text},set:function(u){this.label.text!=u&&(this.label.text=u,this.invalidate())},enumerable:!0,configurable:!0}),R.prototype.draw=function(){j.prototype.draw.call(this);var u=this.label;u.invalid&&u.validate();var w,$,U=this._pointTo.x,K=this._pointTo.y,ie=this._boundingRect,ae=u.measuredWidth,we=u.measuredHeight,Re=this.background.pointerLength;if(this.ignoreBounds&&(ie=void 0),ie&&this.fixDoc&&ae>ie.width){cr({x:ie.x,y:ie.y},this.parent);var $e=cr({x:ie.x+ie.width,y:ie.y+ie.height},this.parent),Xe=document.body.offsetWidth;document.body.offsetHeight,$e.x>Xe/2?ie.x=ie.width-ae:ie.width=ie.x+ae}var Qe=this.pointerOrientation;Qe=="horizontal"||Qe=="left"||Qe=="right"?($=-we/2,w=Qe=="horizontal"?ie&&U>ie.x+ie.width/2?-ae/2-Re:ae/2+Re:Qe=="left"?ae/2+Re:-ae/2-Re):(ie&&(w=gt(0,ie.x-U+ae/2,ie.x-U+ie.width-ae/2)),Qe=="vertical"?ie&&K>ie.y+we+Re?($=-we-Re,this._verticalOrientation="up"):($=Re,this._verticalOrientation="down"):Qe=="down"?($=-we-Re,this._verticalOrientation="up"):($=Re,this._verticalOrientation="down")),ie&&($=gt($,ie.y-K,ie.y+ie.height-we-K)),u.x=w,u.y=$,this.drawBackground()},R.prototype.updateBackground=function(){this.group.addToBack(this.background.group)},R.prototype.drawBackground=function(){var u=this.label,w=this.background,$=u.measuredWidth,U=u.measuredHeight,K=this._boundingRect,ie=$,ae=u.pixelX-$/2,we=U,Re=u.pixelY,$e=this._pointTo.x,Xe=this._pointTo.y,Qe=K.x-$e,dt=Qe+K.width,Gt=K.y-Xe,Yt=Gt+K.height;w.x=ae,w.y=Re,w.width=ie,w.height=we,this.fitPointerToBounds?(w.pointerX=gt(-w.x,Qe-w.x,dt-w.x),w.pointerY=gt(-w.y,Gt-w.y,Yt-w.y)):(w.pointerX=-w.x,w.pointerY=-w.y),w.validate()},R.prototype.delayedPointTo=function(u,w){var $=this;this._pointToDisposer&&this._pointToDisposer.dispose(),this._pointToDisposer=ui.events.once("exitframe",function(){$.pointTo(u,w)}),this.addDisposer(this._pointToDisposer)},R.prototype.pointTo=function(u,w){this._pointTo.x==u.x&&this._pointTo.y==u.y||(this._pointTo=u,this.invalidate(),!this.visible||w?(this.moveTo(this._pointTo),this._animation&&this._animation.kill()):this.pixelX==0&&this.pixelY==0?this.moveTo(this._pointTo):(this._animation&&this._animation.kill(),this._animation=new dm(this,[{property:"x",to:u.x,from:this.pixelX},{property:"y",to:u.y,from:this.pixelY}],this.animationDuration,this.animationEasing).start()))},R.prototype.setBounds=function(u){var w=this._boundingRect;w.x==u.x&&w.y==u.y&&w.width==u.width&&w.height==u.height||(this._boundingRect=u,this.invalidate())},Object.defineProperty(R.prototype,"boundingContainer",{set:function(u){this._boundingContainer=u,u.events.on("sizechanged",this.updateBounds,this),u.events.on("positionchanged",this.updateBounds,this)},enumerable:!0,configurable:!0}),R.prototype.updateBounds=function(){var u=this._boundingContainer,w=nt({x:u.pixelX,y:u.pixelY,width:u.maxWidth,height:u.maxHeight},u);this.setBounds(w)},Object.defineProperty(R.prototype,"ignoreBounds",{get:function(){return this.getPropertyValue("ignoreBounds")},set:function(u){this.setPropertyValue("ignoreBounds",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"verticalOrientation",{get:function(){return this._verticalOrientation},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tooltip",{get:function(){},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.label.copyFrom(u.label),u._boundingRect&&(this._boundingRect=u._boundingRect)},R.prototype.asFunction=function(u){return u=="animationEasing"||j.prototype.asIs.call(this,u)},R}(Zn);ui.registeredClasses.Tooltip=kI;var yz=function(j){function R(){var u=j.call(this)||this;return u.className="Trapezoid",u.element=u.paper.add("path"),u.topSide=he(100),u.bottomSide=he(100),u.leftSide=he(100),u.rightSide=he(100),u.isMeasured=!1,u.applyTheme(),u}return re(R,j),R.prototype.draw=function(){j.prototype.draw.call(this);var u=this.pixelWidth,w=this.pixelHeight,$=hs(this.topSide,u),U=hs(this.bottomSide,u),K=hs(this.leftSide,w),ie=hs(this.rightSide,w),ae=(u-$)/2,we=(w-K)/2,Re=u-(u-$)/2,$e=(w-ie)/2,Xe=u-(u-U)/2,Qe=w-(w-ie)/2,dt=(u-U)/2,Gt=w-(w-K)/2,Yt="",ai="",oi="",Ui="";if(Ee(this.horizontalNeck)){var Ji=this.horizontalNeck.value;Yt=br({x:u*Ji,y:Math.max(we,$e)}),oi=br({x:u*Ji,y:Math.min(Qe,Gt)})}if(Ee(this.verticalNeck)){var Si=this.verticalNeck.value;ai=br({x:Math.min(Re,Xe),y:w*Si}),Ui=br({x:Math.max(ae,dt),y:w*Si})}var Hi=ln({x:ae,y:we})+Yt+br({x:Re,y:$e})+ai+br({x:Xe,y:Qe})+oi+br({x:dt,y:Gt})+Ui;this.path=Hi},Object.defineProperty(R.prototype,"topSide",{get:function(){return this.getPropertyValue("topSide")},set:function(u){this.setPercentProperty("topSide",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"bottomSide",{get:function(){return this.getPropertyValue("bottomSide")},set:function(u){this.setPercentProperty("bottomSide",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"leftSide",{get:function(){return this.getPropertyValue("leftSide")},set:function(u){this.setPercentProperty("leftSide",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"rightSide",{get:function(){return this.getPropertyValue("rightSide")},set:function(u){this.setPercentProperty("rightSide",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"horizontalNeck",{get:function(){return this.getPropertyValue("horizontalNeck")},set:function(u){this.setPropertyValue("horizontalNeck",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"verticalNeck",{get:function(){return this.getPropertyValue("verticalNeck")},set:function(u){this.setPropertyValue("verticalNeck",u,!0)},enumerable:!0,configurable:!0}),R}(so);ui.registeredClasses.Trapezoid=yz;var Z$=function(j){function R(){var u=j.call(this)||this;return u.className="Triangle",u.element=u.paper.add("path"),u.direction="top",u.applyTheme(),u}return re(R,j),R.prototype.draw=function(){j.prototype.draw.call(this);var u,w=this.pixelWidth,$=this.pixelHeight;switch(this.direction){case"right":u=ln({x:0,y:0})+br({x:w,y:$/2})+br({x:0,y:$})+" Z";break;case"left":u=ln({x:w,y:0})+br({x:0,y:$/2})+br({x:w,y:$})+" Z";break;case"bottom":u=ln({x:0,y:0})+br({x:w,y:0})+br({x:w/2,y:$})+" Z";break;case"top":u=ln({x:w/2,y:0})+br({x:w,y:$})+br({x:0,y:$})+" Z"}this.path=u},Object.defineProperty(R.prototype,"direction",{get:function(){return this.getPropertyValue("direction")},set:function(u){this.setPropertyValue("direction",u,!0)},enumerable:!0,configurable:!0}),R}(so);ui.registeredClasses.Triangle=Z$;var _1=function(){function j(R,u){this._tensionX=R,this._tensionY=u}return j.prototype.smooth=function(R){for(var u=R.length-1;u>0;u--){var w=R[u],$=R[u-1];Math.abs(w.x-$.x)<.1&&Math.abs(w.y-$.y)<.1&&R.splice(u-1,1)}var U=this._tensionX,K=this._tensionY;if(R.length<3||U>=1&&K>=1)return L4(R);var ie=R[0],ae=R[R.length-1],we=!1;Ve(ie.x,3)==Ve(ae.x)&&Ve(ie.y)==Ve(ae.y)&&(we=!0);for(var Re="",$e=(u=0,R.length-1);u<$e;u++){w=R[u-1],$=R[u];var Xe=R[u+1],Qe=R[u+2];u===0?w=we?R[R.length-2]:R[u]:u==R.length-2&&(Qe=we?R[1]:R[u+1]),Re+=C3(Xe,Vt(w,$,Xe,0,U,K),Ke(0,$,Xe,Qe,U,K))}return Re},j}();function b1(j,R,u,w,$,U){var K=j.x,ie=j.y,ae=R.x,we=R.y,Re=C(j,R);U&&(u=Re/Math.round(Re/u));var $e=ui.getCache(Ru(["wavedLine",j.x,R.x,j.y,R.y,u,w]));if(!$e){if(Re>0){var Xe=Math.atan2(we-ie,ae-K),Qe=Math.cos(Xe),dt=Math.sin(Xe),Gt=u*Qe,Yt=u*dt;if(u<=1||w<=1)$e=br(R);else{var ai=Math.round(2*Re/u),oi=[],Ui=1;ae0&&(u=ln(($=this.getPoints(w))[0])+new _1(this.tension,this.tension).smooth($));var $,U=this.pixelInnerRadius;U>0&&(($=this.getPoints(U)).reverse(),u+=ln($[0])+new _1(this.tension,this.tension).smooth($)),this.path=u},R.prototype.getPoints=function(u){for(var w=u*Math.PI*2,$=this.waveHeight/2,U=w/Math.round(w/this.waveLength),K=U/2,ie=[],ae=w/U,we=0;we<=ae;we++){var Re=we*U/w*360,$e=(we*U+K)/w*360;ie.push({x:(u-$)*A(Re),y:(u-$)*Ue(Re)}),ie.push({x:(u+$)*A($e),y:(u+$)*Ue($e)})}return ie.pop(),ie},Object.defineProperty(R.prototype,"innerRadius",{get:function(){return this.getPropertyValue("innerRadius")},set:function(u){this.setPercentProperty("innerRadius",u,!0,!1,10,!1),this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pixelInnerRadius",{get:function(){return hs(this.innerRadius,W(this.innerWidth/2,this.innerHeight/2))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"waveLength",{get:function(){return this.getPropertyValue("waveLength")},set:function(u){this.setPropertyValue("waveLength",u),this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"waveHeight",{get:function(){return this.getPropertyValue("waveHeight")},set:function(u){this.setPropertyValue("waveHeight",u),this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tension",{get:function(){return this.getPropertyValue("tension")},set:function(u){this.setPropertyValue("tension",u),this.invalidate()},enumerable:!0,configurable:!0}),R}(FI);ui.registeredClasses.WavedCircle=Q$;var Tr=function(j){function R(){var u=j.call(this)||this;return u.className="WavedLine",u.element=u.paper.add("path"),u.waveLength=16,u.waveHeight=4,u.tension=.8,u.pixelPerfect=!1,u.fill=He(),u.applyTheme(),u}return re(R,j),R.prototype.draw=function(){var u={x:this.x1,y:this.y1},w={x:this.x2,y:this.y2};this.path=ln(u)+b1(u,w,this.waveLength,this.waveHeight,this.tension,!0)},Object.defineProperty(R.prototype,"waveLength",{get:function(){return this.getPropertyValue("waveLength")},set:function(u){this.setPropertyValue("waveLength",u),this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"waveHeight",{get:function(){return this.getPropertyValue("waveHeight")},set:function(u){this.setPropertyValue("waveHeight",u),this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tension",{get:function(){return this.getPropertyValue("tension")},set:function(u){this.setPropertyValue("tension",u),this.invalidate()},enumerable:!0,configurable:!0}),R}(Nv),e8=function(j){function R(){var u=j.call(this)||this;return u.className="WavedRectangle",u.element=u.paper.add("path"),u.waveLength=16,u.waveHeight=4,u.tension=.8,u.setPropertyValue("wavedLeft",!0),u.setPropertyValue("wavedRight",!0),u.setPropertyValue("wavedTop",!0),u.setPropertyValue("wavedBottom",!0),u.applyTheme(),u}return re(R,j),R.prototype.draw=function(){j.prototype.draw.call(this);var u=this.pixelWidth,w=this.pixelHeight;if(u>0&&w>0){var $={x:0,y:0},U={x:u,y:0},K={x:u,y:w},ie={x:0,y:w},ae=Math.min(u,this.waveLength),we=Math.min(w,this.waveHeight),Re=Math.min(w,this.waveLength),$e=Math.min(u,this.waveHeight),Xe="",Qe="",dt="",Gt="";this.wavedTop&&(Xe=b1($,U,ae,we,this.tension,!0)),this.wavedRight&&(Qe=b1(U,K,Re,$e,this.tension,!0)),this.wavedBottom&&(dt=b1(K,ie,ae,we,this.tension,!0)),this.wavedLeft&&(Gt=b1(ie,$,Re,$e,this.tension,!0)),this.path=ln($)+Xe+br(U)+Qe+br(K)+dt+br(ie)+Gt+"z"}},Object.defineProperty(R.prototype,"waveLength",{get:function(){return this.getPropertyValue("waveLength")},set:function(u){this.setPropertyValue("waveLength",u),this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"waveHeight",{get:function(){return this.getPropertyValue("waveHeight")},set:function(u){this.setPropertyValue("waveHeight",u),this.invalidate()},enumerable:!0,configurable:!0}),R.prototype.setWavedSides=function(u,w,$,U){this.wavedTop=u,this.wavedRight=w,this.wavedBottom=$,this.wavedLeft=U},Object.defineProperty(R.prototype,"tension",{get:function(){return this.getPropertyValue("tension")},set:function(u){this.setPropertyValue("tension",u),this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"wavedRight",{get:function(){return this.getPropertyValue("wavedRight")},set:function(u){this.setPropertyValue("wavedRight",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"wavedLeft",{get:function(){return this.getPropertyValue("wavedLeft")},set:function(u){this.setPropertyValue("wavedLeft",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"wavedTop",{get:function(){return this.getPropertyValue("wavedTop")},set:function(u){this.setPropertyValue("wavedTop",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"wavedBottom",{get:function(){return this.getPropertyValue("wavedBottom")},set:function(u){this.setPropertyValue("wavedBottom",u,!0)},enumerable:!0,configurable:!0}),R}(OI),eie=function(j){function R(){var u=j.call(this)||this;u.className="ZoomOutButton",u.padding(9,9,9,9),u.showSystemTooltip=!0;var w=new $a,$=u.background;$.cornerRadius(20,20,20,20),$.fill=w.getFor("primaryButton"),$.stroke=w.getFor("primaryButtonStroke"),$.strokeOpacity=0,$.states.getKey("hover").properties.fill=w.getFor("primaryButtonHover"),$.states.getKey("down").properties.fill=w.getFor("primaryButtonActive");var U=new so;U.element=u.paper.add("path");var K=ln({x:0,y:0});return K+=br({x:11,y:0}),U.path=K,U.pixelPerfect=!0,U.padding(8,3,8,3),U.stroke=w.getFor("primaryButtonText"),u.icon=U,u.applyTheme(),u}return re(R,j),R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),Ee(this.readerTitle)||(this.readerTitle=this.language.translate("Zoom Out"))},R}(oC);ui.registeredClasses.ZoomOutButton=eie;var tie=function(j){function R(){var u=j.call(this)||this;u.className="PlayButton",u.padding(12,12,12,12),u.showSystemTooltip=!0;var w=new $a,$=u.background;$.cornerRadius(25,25,25,25),$.fill=w.getFor("primaryButton"),$.stroke=w.getFor("primaryButtonStroke"),$.strokeOpacity=0,$.states.getKey("hover").properties.fill=w.getFor("primaryButtonHover"),$.states.getKey("down").properties.fill=w.getFor("primaryButtonActive");var U=new Z$;U.direction="right",U.width=9,U.height=11,U.marginLeft=1,U.marginRight=1,U.horizontalCenter="middle",U.verticalCenter="middle",U.stroke=w.getFor("primaryButtonText"),U.fill=U.stroke,u.icon=U;var K=new Nb;K.width=11,K.height=11,K.horizontalCenter="middle",K.verticalCenter="middle",K.cornerRadius(0,0,0,0),K.stroke=w.getFor("primaryButtonText"),K.fill=U.stroke,u.togglable=!0;var ie=u.states.create("active");return ie.transitionDuration=0,ie.properties.icon=K,u.defaultState.transitionDuration=0,u.applyTheme(),u}return re(R,j),R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),Ee(this.readerTitle)||(this.readerTitle=this.language.translate("Play"))},R}(oC);ui.registeredClasses.PlayButton=tie;var Bn=function(j){function R(){var u=j.call(this)||this;return u.className="ColorModifier",u.applyTheme(),u}return re(R,j),R.prototype.modify=function(u){return u},R}(Wt);ui.registeredClasses.ColorModifier=Bn;var iie=function(j){function R(){var u=j.call(this)||this;return u.lightnesses=[],u.brightnesses=[],u.opacities=[],u.offsets=[],u.className="GradientModifier",u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"lightnesses",{get:function(){return this._lightnesses},set:function(u){this._lightnesses=u,this._brightnesses=[]},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"brightnesses",{get:function(){return this._brightnesses},set:function(u){this._brightnesses=u,this._lightnesses=[]},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"opacities",{get:function(){return this._opacities},set:function(u){this._opacities=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"offsets",{get:function(){return this._offsets},set:function(u){this._offsets=u},enumerable:!0,configurable:!0}),R.prototype.modify=function(u){this.gradient.clear();var w=0;this.opacities&&(w=ve(w,this.opacities.length)),this.lightnesses&&(w=ve(w,this.lightnesses.length)),this.brightnesses&&(w=ve(w,this.brightnesses.length));for(var $,U,K=1,ie=0;ie0&&this.depth>0){this.sideB.show(0),this.sideA.show(0),this.edge.show(0);for(var u=this.startAngle,w=this.arc,$=this.pixelInnerRadius||0,U=this.radiusY||0,K=this.radius,ie=u+w,ae=U/K*$,we={x:A(u)*$,y:Ue(u)*ae},Re={x:A(u)*K,y:Ue(u)*U},$e={x:A(ie)*K,y:Ue(ie)*U},Xe={x:A(ie)*$,y:Ue(ie)*ae},Qe=this.depth,dt={x:we.x,y:we.y-Qe},Gt={x:Re.x,y:Re.y-Qe},Yt={x:$e.x,y:$e.y-Qe},ai={x:Xe.x,y:Xe.y-Qe},oi="",Ui=Math.ceil(w/5),Ji=w/Ui,Si=u,Hi=Gt,nr=0;nr0&&Si<180){oi+=ln(Hi);var Ir={x:A(Si)*K,y:Ue(Si)*U-Qe};oi+=br({x:Hi.x,y:Hi.y+Qe}),oi+=$0({x:Ir.x,y:Ir.y+Qe},K,U,!0),oi+=br(Ir),oi+=$0(Hi,K,U),oi+="z",Hi=Ir}else oi+=ln(Hi),oi+=$0(Ir={x:A(Si)*K,y:Ue(Si)*U-Qe},K,U,!0),oi+=br({x:Ir.x,y:Ir.y+Qe}),oi+=$0({x:Hi.x,y:Hi.y+Qe},K,U),oi+=br(Hi),oi+="z",Hi=Ir;for(Hi=dt,Si=u,nr=0;nr0&&Si<180?(oi+=ln(Hi),Ir={x:A(Si)*$,y:Ue(Si)*ae-Qe},oi+=br({x:Hi.x,y:Hi.y+Qe}),oi+=$0({x:Ir.x,y:Ir.y+Qe},$,ae,!0),oi+=br(Ir),oi+=$0(Hi,$,ae),oi+="z",Hi=Ir):(oi+=ln(Hi),oi+=$0(Ir={x:A(Si)*$,y:Ue(Si)*ae-Qe},$,ae,!0),oi+=br({x:Ir.x,y:Ir.y+Qe}),oi+=$0({x:Hi.x,y:Hi.y+Qe},$,ae),oi+=br(Hi),oi+="z",Hi=Ir);this.edge.path=oi,this.sideA.path=ln(we)+br(Re)+br(Gt)+br(dt)+" Z",this.sideB.path=ln($e)+br(Xe)+br(ai)+br(Yt)+" Z",this.startAngle<90?this.sideA.toBack():this.sideA.toFront(),this.startAngle+this.arc>90?this.sideB.toBack():this.sideB.toFront(),this.slice.dy=-Qe}else this.sideA.hide(0),this.sideB.hide(0),this.edge.hide(0)},Object.defineProperty(R.prototype,"depth",{get:function(){return this.getPropertyValue("depth")},set:function(u){this.setPropertyValue("depth",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"angle",{get:function(){var u=this.getPropertyValue("angle");return le(u)||(u=0),u},set:function(u){this.setPropertyValue("angle",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radiusY",{get:function(){var u=this.getPropertyValue("radiusY");return le(u)||(u=this.radius-this.radius*this.angle/90),u},set:function(u){this.setPropertyValue("radiusY",u,!0)},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.edge.copyFrom(u.edge),this.sideA.copyFrom(u.sideA),this.sideB.copyFrom(u.sideB)},R}(LI),rie=function(j){function R(){var u=j.call(this)||this;return u.className="RadialGradientModifier",u.gradient=new Fy,u.applyTheme(),u}return re(R,j),R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.gradient=u.gradient.clone()},R}(iie);ui.registeredClasses.RadialGradientModifier=rie;var nie=function(j){function R(){var u=j.call(this)||this;return u.properties.gap=0,u._line=u.paper.add("path"),u.addElement(u._line),u}return re(R,j),R.prototype.draw=function(){if(j.prototype.draw.call(this),Math.round(this.rotation/90)!=this.rotation/90&&(this.properties.shapeRendering="auto"),this._line){var u=this.width,w=this.height,$="";if(this.gap)for(var U=this.gap+this.strokeWidth,K=this.height/U,ie=-K/2;ie<1.5*K;ie++)Math.round(this.rotation/90)!=this.rotation/90?($+=ln({x:-u,y:(ie+.5)*U})+br({x:2*u,y:(ie+.5)*U}),this.properties.rotationX=this.width/2,this.properties.rotationY=this.height/2):$+=ln({x:-u,y:ie*U})+br({x:2*u,y:ie*U});else Math.round(this.rotation/90)!=this.rotation/90?($=ln({x:-u,y:w/2})+br({x:2*u,y:w/2}),this.properties.rotationX=this.width/2,this.properties.rotationY=this.height/2):$=ln({x:0,y:0})+br({x:u,y:0});this._line.attr({d:$})}},Object.defineProperty(R.prototype,"gap",{get:function(){return this.properties.gap},set:function(u){this.properties.gap=u,this.draw()},enumerable:!0,configurable:!0}),R}(g1);ui.registeredClasses.LinePattern=nie;var t8=function(j){function R(){var u=j.call(this)||this;return u.properties.radius=2,u._circle=u.paper.add("circle"),u.addElement(u._circle),u.shapeRendering="auto",u}return re(R,j),R.prototype.draw=function(){j.prototype.draw.call(this),this._circle&&this._circle.attr({r:this.radius,cx:this.width/2,cy:this.height/2})},Object.defineProperty(R.prototype,"radius",{get:function(){return this.properties.radius},set:function(u){this.properties.radius=u,this.draw()},enumerable:!0,configurable:!0}),R}(g1);ui.registeredClasses.CirclePattern=t8;var kg=function(j){function R(){var u=j.call(this)||this;return u.rectHeight=1,u.rectWidth=1,u._rect=u.paper.add("rect"),u.addElement(u._rect),u}return re(R,j),R.prototype.draw=function(){j.prototype.draw.call(this),this.properties.rotationX=this.width/2,this.properties.rotationY=this.height/2,this._rect&&this._rect.attr({width:this.rectWidth,height:this.rectHeight,x:(this.width-this.rectWidth)/2,y:(this.height-this.rectHeight)/2})},Object.defineProperty(R.prototype,"rectWidth",{get:function(){return this.properties.rectWidth},set:function(u){this.properties.rectWidth=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"rectHeight",{get:function(){return this.properties.rectHeight},set:function(u){this.properties.rectHeight=u,this.draw()},enumerable:!0,configurable:!0}),R}(g1);ui.registeredClasses.RectPattern=kg;var Z0e=function(j){function R(){var u=j.call(this)||this;return u.className="ColorizeFilter",u.feColorMatrix=u.paper.add("feColorMatrix"),u.feColorMatrix.attr({type:"matrix"}),u.filterPrimitives.push(u.feColorMatrix),u.intensity=1,u.applyTheme(),u}return re(R,j),R.prototype.applyFilter=function(){var u,w,$,U=this.intensity,K=1-U,ie=this.color;ie&&ie.rgb?(u=ie.rgb.r/255*U,w=ie.rgb.g/255*U,$=ie.rgb.b/255*U):(u=0,w=0,$=0),this.feColorMatrix.attr({values:K+" 0 0 0 "+u+" 0 "+K+" 0 0 "+w+" 0 0 "+K+" 0 "+$+" 0 0 0 1 0"})},Object.defineProperty(R.prototype,"color",{get:function(){return this.properties.color},set:function(u){this.properties.color=u,this.applyFilter()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"intensity",{get:function(){return this.properties.intensity},set:function(u){this.properties.intensity=u,this.applyFilter()},enumerable:!0,configurable:!0}),R}(hC);ui.registeredClasses.ColorizeFilter=Z0e;var i8=function(j){function R(){var u=j.call(this)||this;return u.className="DesaturateFilter",u.feColorMatrix=u.paper.add("feColorMatrix"),u.feColorMatrix.attr({type:"saturate"}),u.filterPrimitives.push(u.feColorMatrix),u.width=120,u.height=120,u.saturation=0,u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"saturation",{get:function(){return this.properties.saturation},set:function(u){this.properties.saturation=u,this.feColorMatrix.attr({values:u.toString()})},enumerable:!0,configurable:!0}),R}(hC);ui.registeredClasses.DesaturateFilter=i8;var Q0e=function(j){function R(){var u=j.call(this)||this;return u.className="BlurFilter",u.feGaussianBlur=u.paper.add("feGaussianBlur"),u.feGaussianBlur.attr({result:"blurOut",in:"SourceGraphic"}),u.filterPrimitives.push(u.feGaussianBlur),u.width=200,u.height=200,u.blur=1.5,u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"blur",{get:function(){return this.properties.blur},set:function(u){this.properties.blur=u,this.feGaussianBlur.attr({stdDeviation:u/this.scale})},enumerable:!0,configurable:!0}),R}(hC);ui.registeredClasses.BlurFilter=Q0e;var eve=function(j){function R(){var u=j.call(this)||this;return u.className="FocusFilter",u.feFlood=u.paper.add("feFlood"),u.feFlood.attr({"flood-color":new $a().getFor("primaryButtonHover"),result:"base"}),u.filterPrimitives.push(u.feFlood),u.feMorphology=u.paper.add("feMorphology"),u.feMorphology.attr({result:"bigger",in:"SourceGraphic",operator:"dilate",radius:"2"}),u.filterPrimitives.push(u.feMorphology),u.feColorMatrix=u.paper.add("feColorMatrix"),u.feColorMatrix.attr({result:"mask",in:"bigger",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0"}),u.filterPrimitives.push(u.feColorMatrix),u.feComposite=u.paper.add("feComposite"),u.feComposite.attr({result:"drop",in:"base",in2:"mask",operator:"in"}),u.filterPrimitives.push(u.feComposite),u.feBlend=u.paper.add("feBlend"),u.feBlend.attr({in:"SourceGraphic",in2:"drop",mode:"normal"}),u.filterPrimitives.push(u.feBlend),u.width=130,u.height=130,u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"stroke",{get:function(){return this.properties.stroke},set:function(u){this.properties.stroke=u,this.feFlood.attr({"flood-color":u})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"strokeWidth",{get:function(){return this.properties.strokeWidth},set:function(u){this.properties.strokeWidth=u,this.feMorphology.attr({radius:u})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"opacity",{get:function(){return this.properties.opacity},set:function(u){this.properties.opacity=u,this.feColorMatrix.attr({values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "+u+" 0"})},enumerable:!0,configurable:!0}),R.prototype.setSprite=function(u){this._sprite&&this._sprite!=u&&this._sprite.group.removeStyle("outline"),u.group.addStyle({outline:"none"}),j.prototype.setSprite.call(this,u)},R}(hC),Qm=function(j){function R(){var u=j.call(this)||this;return u._list=[],u._currentStep=0,u._startIndex=0,u._currentPass=0,u.baseColor=new Te({r:103,g:183,b:220}),u.stepOptions={},u.passOptions={brighten:-.2},u.step=1,u.minColors=20,u.minLightness=.2,u.maxLightness=.9,u.shuffle=!1,u.wrap=!0,u.reuse=!1,u.saturation=1,u.className="ColorSet",u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"list",{get:function(){return this._list||this.generate(this.minColors),this._list},set:function(u){this._list=u,this.reset()},enumerable:!0,configurable:!0}),R.prototype.getReusableColor=function(u){if(this._list.length==0)return this.generate(1),this.list[0];var w=u-Math.floor(u/this._list.length)*this.list.length;return this.list[w]},R.prototype.next=function(){var u;return this.list.length<=this._currentStep?this.reuse?u=this.getReusableColor(this._currentStep):(this.generate(ve(this.minColors,this._currentStep+1)),u=this.list[this._currentStep]):u=this.list[this._currentStep],this._currentStep+=this.step,u.saturate(this.saturation)},R.prototype.getIndex=function(u){var w;return this.list.length<=u?this.reuse?w=this.getReusableColor(u):(this.generate(this.minColors),w=this.getIndex(u)):w=this.list[u],w.saturate(this.saturation)},R.prototype.reset=function(){this._currentStep=this._startIndex},Object.defineProperty(R.prototype,"currentStep",{get:function(){return this._currentStep},set:function(u){this._currentStep=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startIndex",{get:function(){return this._startIndex},set:function(u){this._startIndex=u,this.reset()},enumerable:!0,configurable:!0}),R.prototype.generate=function(u){var w=ne(Be(this.currentColor.rgb)),$=Ee(this.stepOptions.hue)?this.stepOptions.hue:1/u,U={brighten:0,lighten:0,hue:w.h,lightness:w.l,saturation:w.s},K=[],ie=this.list.length==0?0:1;if(this.reuse)for(var ae=ie;ae<=u;ae++)K.push(ne(Be(this._list[ae].rgb)).h);else for(ae=ie;ae<=u;ae++){var we=w.h+$*ae;this.wrap&&we>1&&(we-=1),K.push(we)}for(this.shuffle&&K.sort(function(Qe,dt){return Math.random()-.5}),ae=0;ae1?u.l=u.l-Math.floor(u.l):u.l<0&&(u.l=-(u.l-Math.floor(u.l))),u.l=F0(u.l,this.minLightness,this.maxLightness)):(u.l>1?u.l=1:u.l<0&&(u.l=0),u.l=Mg(u.l,this.minLightness,this.maxLightness))},R.prototype.processConfig=function(u){if(u){if(Ee(u.list)&&pt(u.list))for(var w=0,$=u.list.length;w<$;w++)u.list[w]instanceof Te||(u.list[w]=He(u.list[w]));!Ee(u.baseColor)||u.baseColor instanceof Te||(u.baseColor=He(u.baseColor))}j.prototype.processConfig.call(this,u)},R}(Wt);ui.registeredClasses.ColorSet=Qm;var sie=function(j){function R(){var u=j.call(this)||this;u._list=[],u._currentStep=0,u._startIndex=0,u._currentPass=0,u.baseColor=new Te({r:103,g:183,b:220}),u.className="PatternSet";var w=new $a;return u.list=[u.getLinePattern(1e3,45,1,6),u.getRectPattern(10,0,4),u.getLinePattern(1e3,-45,1,6),u.getCirclePattern(11,2,!0),u.getLinePattern(6,90,1),u.getRectPattern(12,45,6,!0),u.getLinePattern(6,0,1),u.getRectPattern(7,0,4),u.getLinePattern(1e3,45,2,3,"4,2"),u.getCirclePattern(9,3,!1),u.getLinePattern(1e3,-45,2,3,"4,2"),u.getRectPattern(10,45,Math.sqrt(50)),u.getLinePattern(1e3,-45,2,1),u.getRectPattern(10,0,9),u.getLinePattern(1e3,45,2,1),u.getLinePattern(1e3,0,3,1),u.getRectPattern(10,45,10),u.getLinePattern(1e3,90,3,1)],u.baseColor=w.getFor("stroke"),u.applyTheme(),u}return re(R,j),R.prototype.getLinePattern=function(u,w,$,U,K){var ie=new nie;return ie.width=u,ie.height=u,ie.stroke=this.baseColor,ie.gap=U,ie.strokeDasharray=K,ie.strokeWidth=$,ie.rotation=w,ie},R.prototype.getRectPattern=function(u,w,$,U){var K=new kg;return K.width=u,K.height=u,K.rectWidth=$,K.rectHeight=$,U?(K.stroke=this.baseColor,K.strokeWidth=1,K.fillOpacity=0):(K.fill=this.baseColor,K.strokeWidth=0),w!=0&&(K.shapeRendering="auto"),K.rotation=w,K},R.prototype.getCirclePattern=function(u,w,$){var U=new t8;return U.width=u,U.height=u,U.shapeRendering="auto",U.radius=w,$?(U.stroke=this.baseColor,U.strokeWidth=1,U.fillOpacity=0):(U.fill=this.baseColor,U.strokeWidth=0),U},Object.defineProperty(R.prototype,"list",{get:function(){return this._list},set:function(u){this._list=u,this.reset()},enumerable:!0,configurable:!0}),R.prototype.next=function(){var u=this.getIndex(this.currentStep);return this._currentStep++,u},R.prototype.getIndex=function(u){for(;this.list.length<=u;)this.generatePatterns();return this.list[u].clone()},R.prototype.generatePatterns=function(){var u=this.list.length/(this._currentPass+1);this._currentPass++;for(var w=0;w=0){ui.queue.splice(ui.queue.indexOf(j),1);var u=ui.queue[R];u&&rve(u)}}function E3(j){j.__disabled&&tC(j.htmlContainer,no.viewportTarget)&&(j.vpDisposer&&j.vpDisposer.dispose(),aie(j))}function rve(j){j&&j.tooltipContainer&&(j.__disabled=!1,j.tooltipContainer.__disabled=!1,j.events.enableType("appeared"),j.dispatch("removedfromqueue"),j.showOnInit&&j.events.on("appeared",function(){wz(j)}),j.vpDisposer&&j.vpDisposer.dispose(),j instanceof Zn&&j.invalidateLabels(),j.tooltipContainer&&j.tooltipContainer.invalidateLayout(),j instanceof DI?(j.invalidateData(),j.reinit(),j.events.once("datavalidated",function(){j.showOnInit?j.appear():wz(j)})):(j.reinit(),j.events.once("inited",function(){wz(j)}),j.showOnInit&&j.appear()))}function e9e(j,R){var u;ct(R)&&(Ee(ui.registeredClasses[R])?R=ui.registeredClasses[R]:(R=ui.registeredClasses.Container,u=new Error("Class ["+R+"] is not loaded.")));var w=oie(j,R);return u&&w.raiseCriticalError(u),w}function t9e(j,R,u){var w,$;Ee(u)||(u=j.type,delete j.type),Ee(R)||(R=j.container,delete j.container),ct(u)&&Ee(ui.registeredClasses[u])?w=ui.registeredClasses[u]:typeof u!="function"?(w=Zn,$=new Error("Class ["+u+"] is not loaded.")):w=u;var U=oie(R,w);return $?U.raiseCriticalError($):U.config=j,U}function i9e(j,R){for(var u=[],w=2;w10&&(u.properties.paddingLeft=10),j.pixelPaddingRight>10&&(u.properties.paddingRight=10),u}return null}}),Zd.push({relevant:Af.heightXS,state:function(j,R){if(j instanceof kx){var u=j.states.create(R);return j.pixelPaddingTop>10&&(u.properties.paddingTop=10),j.pixelPaddingBottom>10&&(u.properties.paddingBottom=10),u}return null}}),Zd.push({relevant:Af.widthXXS,state:function(j,R){if(j instanceof kx){var u=j.states.create(R);return u.properties.paddingLeft=0,u.properties.paddingRight=0,u}return null}}),Zd.push({relevant:Af.heightXXS,state:function(j,R){if(j instanceof kx){var u=j.states.create(R);return u.properties.paddingTop=0,u.properties.paddingBottom=0,u}return null}});var Oo=function(j){function R(){var u=j.call(this)||this;return u.className="Bullet",u.isMeasured=!1,u.tooltipX=0,u.tooltipY=0,u.layout="none",u.applyOnClones=!0,u.copyToLegendMarker=!0,u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"locationX",{get:function(){return this.getPropertyValue("locationX")},set:function(u){if(this.setPropertyValue("locationX",u)){var w=this.dataItem;w&&w.component&&w.component.invalidate()}},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"locationY",{get:function(){return this.getPropertyValue("locationY")},set:function(u){if(this.setPropertyValue("locationY",u)){var w=this.dataItem;w&&w.component&&w.component.invalidate()}},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"xField",{get:function(){return this.getPropertyValue("xField")},set:function(u){this.setPropertyValue("xField",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"yField",{get:function(){return this.getPropertyValue("yField")},set:function(u){this.setPropertyValue("yField",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"isDynamic",{get:function(){return this.getPropertyValue("isDynamic")},set:function(u){this.setPropertyValue("isDynamic",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"copyToLegendMarker",{get:function(){return this.getPropertyValue("copyToLegendMarker")},set:function(u){this.setPropertyValue("copyToLegendMarker",u)},enumerable:!0,configurable:!0}),R}(Zn);ui.registeredClasses.Bullet=Oo,Zd.push({relevant:Af.isXS,state:function(j,R){if(j instanceof Oo){var u=j.states.create(R);return u.properties.disabled=!0,u}return null}});var xz=function(j){function R(){var u=j.call(this)||this;return u.childrenCreated=!1,u.className="LegendDataItem",u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"label",{get:function(){var u=this;if(!this._label){var w=this.component.labels.create();this._label=w,this.addSprite(w),this._disposers.push(w),w.parent=this.itemContainer,this._disposers.push(new jr(function(){Ee(u.component)&&u.component.labels.removeValue(w)}))}return this._label},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"color",{get:function(){return this.properties.color},set:function(u){this.setProperty("color",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"valueLabel",{get:function(){var u=this;if(!this._valueLabel){var w=this.component.valueLabels.create();this._valueLabel=w,this.addSprite(w),this._disposers.push(w),w.parent=this.itemContainer,this._disposers.push(new jr(function(){Ee(u.component)&&u.component.valueLabels.removeValue(w)}))}return this._valueLabel},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"itemContainer",{get:function(){var u=this;if(!this._itemContainer){var w=this.component,$=w.itemContainers.create();$.parent=w,this._itemContainer=$,this.addSprite($),this._disposers.push($),$.togglable&&$.events.on("toggled",function(ie){w.toggleDataItem(ie.target.dataItem)},void 0,!1),$.focusable&&($.events.on("hit",function(ie){w.focusedItem=void 0},void 0,!1),$.events.on("focus",function(ie){w.focusedItem=ie.target.dataItem},void 0,!1),$.events.on("blur",function(ie){w.focusedItem=void 0},void 0,!1)),this._disposers.push(new jr(function(){Ee(u.component)&&u.component.itemContainers.removeValue($)})),this.dataContext.uidAttr&&($.readerControls=this.dataContext.uidAttr(),$.readerLabelledBy=this.dataContext.uidAttr());var U=this.dataContext;if((U instanceof MI||U instanceof so)&&!U.isDisposed()){var K=function(ie){$.readerChecked=ie.visible,$.events.disableType("toggled"),$.isActive=!ie.visible,$.events.enableType("toggled")};U.addDisposer(new jr(function(){u.component&&u.component.dataItems.remove(u)})),U instanceof so?($.addDisposer(U.events.on("visibilitychanged",K,void 0,!1)),$.addDisposer(U.events.on("hidden",function(ie){$.readerChecked=!1,$.events.disableType("toggled"),$.isActive=!0,$.events.enableType("toggled")},void 0,!1)),$.addDisposer(U.events.on("shown",function(ie){$.readerChecked=!0,$.events.disableType("toggled"),$.isActive=!1,$.events.enableType("toggled")},void 0,!1))):$.addDisposer(U.events.on("visibilitychanged",K,void 0,!1))}}return this._itemContainer},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"marker",{get:function(){var u=this;if(!this._marker){var w=this.component.markers.create();this._marker=w,w.parent=this.itemContainer,this.addSprite(w),this._disposers.push(w),this._disposers.push(new jr(function(){Ee(u.component)&&u.component.markers.removeValue(w)}))}return this._marker},enumerable:!0,configurable:!0}),R}(MI),cie=function(){this.createMarker=!0},n8=function(j){function R(){var u=j.call(this)||this;u.className="Legend",u.layout="grid",u.setPropertyValue("useDefaultMarker",!1),u.setPropertyValue("scrollable",!1),u.setPropertyValue("contentAlign","center");var w=new Zn;w.applyOnClones=!0,w.padding(8,0,8,0),w.margin(0,10,0,10),w.layout="horizontal",w.clickable=!0,w.focusable=!0,w.role="switch",w.togglable=!0,w.cursorOverStyle=_l.pointer,w.background.fillOpacity=0,u.itemContainers=new Xs(w),u._disposers.push(new ta(u.itemContainers)),u._disposers.push(u.itemContainers.template),u._disposers.push(Vs().body.events.on("keyup",function(Re){if(Dg.isKey(Re.event,"enter")&&u.focusedItem){var $e=u.focusedItem,Xe=$e.itemContainer;Xe.togglable?u.toggleDataItem($e):Xe.clickable&&Xe.events.isEnabled("hit")&&(Xe.dispatchImmediately("hit",{event:Re}),u.focusedItem=$e)}},u));var $=new $a,U=new Zn;U.width=23,U.height=23,U.interactionsEnabled=!1,U.applyOnClones=!0,U.setStateOnChildren=!0,U.background.fillOpacity=0,U.background.strokeOpacity=0,U.propertyFields.fill="fill",U.valign="middle";var K=$.getFor("disabledBackground");U.events.on("childadded",function(Re){var $e=Re.newValue.states.create("active");$e.properties.stroke=K,$e.properties.fill=K}),u.markers=new Xs(U),u._disposers.push(new ta(u.markers)),u._disposers.push(u.markers.template);var ie=U.createChild(Nb);ie.width=he(100),ie.height=he(100),ie.applyOnClones=!0,ie.propertyFields.fill="fill",ie.strokeOpacity=0;var ae=new Zm;ae.text="{name}",ae.margin(0,5,0,5),ae.valign="middle",ae.applyOnClones=!0,ae.states.create("active").properties.fill=$.getFor("disabledBackground"),u.labels=new Xs(ae),u._disposers.push(new ta(u.labels)),u._disposers.push(u.labels.template),ae.interactionsEnabled=!1,ae.truncate=!0,ae.fullWords=!1;var we=new Zm;return we.margin(0,5,0,0),we.valign="middle",we.width=50,we.align="right",we.textAlign="end",we.applyOnClones=!0,we.states.create("active").properties.fill=$.getFor("disabledBackground"),we.interactionsEnabled=!1,u.valueLabels=new Xs(we),u._disposers.push(new ta(u.valueLabels)),u._disposers.push(u.valueLabels.template),u.position="bottom",w.states.create("active"),w.setStateOnChildren=!0,u.role="group",u.events.on("layoutvalidated",u.handleScrollbar,u,!1),u.applyTheme(),u}return re(R,j),R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),Ee(this.readerTitle)||(this.readerTitle=this.language.translate("Legend"))},R.prototype.createDataItem=function(){return new xz},R.prototype.validateDataElements=function(){this.scrollbar&&(this.scrollbar.start=0,this.scrollbar.end=1),j.prototype.validateDataElements.call(this)},R.prototype.validateDataElement=function(u){j.prototype.validateDataElement.call(this,u);var w=u.itemContainer,$=u.marker;u.label;var U=u.valueLabel;w.readerChecked=u.dataContext.visible,u.dataContext.legendDataItem=u;var K=u.label.maxWidth;u.label.width instanceof J||(u.label.width=void 0),K>0&&(u.label.maxWidth=K),U.align=="right"&&(U.width=void 0);var ie=u.dataContext.legendSettings,ae=u.dataContext;!ae.createLegendMarker||this.useDefaultMarker&&ae instanceof so?this.markers.template.propertyFields.fill=void 0:u.childrenCreated||(ae.createLegendMarker($),u.childrenCreated=!0),ae.updateLegendValue&&ae.updateLegendValue(),ae.component&&ae.component.updateLegendValue&&ae.component.updateLegendValue(ae),U.invalid&&U.validate(),U.text==""||U.text==null?U.__disabled=!0:U.__disabled=!1,!ie||ie.itemValueText==null&&ie.valueText==null||(U.__disabled=!1);var we=u.dataContext.visible;we===void 0&&(we=!0),we=St(we),u.dataContext.visible=we,w.events.disableType("toggled"),w.isActive=!we,w.isActive?w.setState("active",0):w.setState("default",0),w.events.enableType("toggled")},R.prototype.afterDraw=function(){var u=this,w=this.getPropertyValue("maxWidth"),$=0;this.labels.each(function($e){$e.invalid&&($e.maxWidth=void 0,$e.validate()),$e.measuredWidth+$e.pixelMarginLeft+$e.pixelMarginRight>$&&($=$e.measuredWidth+$e.pixelMarginLeft+$e.pixelMarginRight)});var U=0;this.valueLabels.each(function($e){$e.invalid&&$e.validate(),$e.measuredWidth+$e.pixelMarginLeft+$e.pixelMarginRight>U&&(U=$e.measuredWidth+$e.pixelMarginLeft+$e.pixelMarginRight)});var K=0;this.markers.each(function($e){$e.invalid&&$e.validate(),$e.measuredWidth+$e.pixelMarginLeft+$e.pixelMarginRight>K&&(K=$e.measuredWidth+$e.pixelMarginLeft+$e.pixelMarginRight)});var ie,ae=this.itemContainers.template,we=ae.pixelMarginRight+ae.pixelMarginLeft,Re=$+U+K;le(w)?((w-=we)>Re&&(w=Re),ie=w-K-U):ie=$,this.labels.each(function($e){(u.valueLabels.template.align=="right"||$e.measuredWidth>ie)&&($e.width instanceof J||($e.width=Math.min($e.maxWidth,ie-$e.pixelMarginLeft-$e.pixelMarginRight),$e.maxWidth=$e.width))}),this.valueLabels.template.align=="right"&&this.valueLabels.each(function($e){$e.width=U-$e.pixelMarginRight-$e.pixelMarginLeft}),j.prototype.afterDraw.call(this)},R.prototype.handleScrollbar=function(){var u=this.scrollbar;this.scrollable&&u&&(u.height=this.measuredHeight,u.x=this.measuredWidth-u.pixelWidth-u.pixelMarginLeft,this.contentHeight>this.measuredHeight?(u.visible=!0,u.thumb.height=u.height*this.measuredHeight/this.contentHeight,this.paddingRight=u.pixelWidth+u.pixelMarginLeft+ +u.pixelMarginRight):u.visible=!1,u.handleThumbPosition(),this.updateMasks())},Object.defineProperty(R.prototype,"position",{get:function(){return this.getPropertyValue("position")},set:function(u){this.setPropertyValue("position",u)&&(u=="left"||u=="right"?(this.margin(10,5,10,10),this.valign="middle",this.contentAlign="none",this.valueLabels.template.align="right",le(this.maxColumns)||(this.maxColumns=1),this.width=void 0,this.maxWidth=220):(this.maxColumns=void 0,this.width=he(100),this.valueLabels.template.align="left"),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"useDefaultMarker",{get:function(){return this.getPropertyValue("useDefaultMarker")},set:function(u){this.setPropertyValue("useDefaultMarker",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"scrollable",{get:function(){return this.getPropertyValue("scrollable")},set:function(u){if(this.setPropertyValue("scrollable",u,!0))if(u){var w=this.createChild(B0);this.scrollbar=w,w.isMeasured=!1,w.orientation="vertical",w.endGrip.__disabled=!0,w.startGrip.__disabled=!0,w.visible=!1,w.marginLeft=5,this._mouseWheelDisposer=this.events.on("wheel",this.handleWheel,this,!1),this._disposers.push(this._mouseWheelDisposer),this._disposers.push(w.events.on("rangechanged",this.updateMasks,this,!1))}else this._mouseWheelDisposer&&(this._mouseWheelDisposer.dispose(),this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=void 0))},enumerable:!0,configurable:!0}),R.prototype.handleWheel=function(u){var w=u.shift.y,$=this.scrollbar;if($){var U=w/1e3*this.measuredHeight/this.contentHeight,K=$.end-$.start;w>0?($.start=ve(0,$.start-U),$.end=$.start+K):($.end=W(1,$.end-U),$.start=$.end-K)}},R.prototype.updateMasks=function(){var u=this;this.scrollbar&&this.itemContainers.each(function(w){w.dy=-u.scrollbar.thumb.pixelY*u.contentHeight/u.measuredHeight,w.maskRectangle={x:0,y:-w.dy,width:u.measuredWidth,height:u.measuredHeight}})},R.prototype.toggleDataItem=function(u){var w=u.dataContext;!w.visible||w.isHiding||w instanceof so&&w.isHidden?(u.color=u.colorOrig,w.appeared=!0,u.itemContainer.isActive=!1,w.hidden===!0&&(w.hidden=!1),w.show?w.show():w.visible=!0,this.svgContainer.readerAlert(this.language.translate("%1 shown",this.language.locale,u.label.readerTitle))):(u.itemContainer.isActive=!0,w.appeared=!0,w.hide?w.hide():w.visible=!1,this.svgContainer.readerAlert(this.language.translate("%1 hidden",this.language.locale,u.label.readerTitle)),u.color=new $a().getFor("disabledBackground"))},Object.defineProperty(R.prototype,"preloader",{get:function(){},enumerable:!0,configurable:!0}),R.prototype.handleDataItemPropertyChange=function(u,w){u.valueLabel.invalidate(),u.label.invalidate()},R}(DI);ui.registeredClasses.Legend=n8,Zd.push({relevant:Af.widthXS,state:function(j,R){if(j instanceof n8&&(j.position=="left"||j.position=="right")){var u=j.states.create(R);return u.properties.position="bottom",u}return null}}),Zd.push({relevant:Af.heightXS,state:function(j,R){if(j instanceof n8&&(j.position=="top"||j.position=="bottom")){var u=j.states.create(R);return u.properties.position="right",u}return null}}),Zd.push({relevant:Af.isXS,state:function(j,R){if(j instanceof n8){var u=j.states.create(R);return u.properties.disabled=!0,u}return null}});var s8=function(j){function R(){var u=j.call(this)||this;return u.className="SeriesDataItem",u.values.value={},u.values.value={},u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"bullets",{get:function(){return this._bullets||(this._bullets=new fa,this._disposers.push(new Yd(this._bullets))),this._bullets},enumerable:!0,configurable:!0}),R.prototype.dispose=function(){this.bullets.clear(),j.prototype.dispose.call(this)},Object.defineProperty(R.prototype,"value",{get:function(){return this.values.value.value},set:function(u){this.setValue("value",u)},enumerable:!0,configurable:!0}),R}(MI),o8=function(j){function R(){var u=j.call(this)||this;if(u._ignoreMinMax=!1,u._showBullets=!0,u.legendSettings=new cie,u._tmin=new fa,u._tmax=new fa,u._smin=new fa,u._smax=new fa,u.dataItemsByAxis=new fa,u.skipFocusThreshold=20,u._itemReaderTextChanged=!1,u.calculatePercent=!1,u.usePercentHack=!0,u.autoDispose=!0,u.simplifiedProcessing=!1,u.constructor===R)throw new Error("'Series' cannot be instantiated directly. Please use a specific series type.");u.className="Series",u.isMeasured=!1,u.layout="none",u.shouldClone=!1,u.setPropertyValue("hidden",!1),u.axisRanges=new Us,u.axisRanges.events.on("inserted",u.processAxisRange,u,!1),u.minBulletDistance=0,u.mainContainer=u.createChild(Zn),u.mainContainer.shouldClone=!1,u.mainContainer.mask=u.createChild(so),u._disposers.push(u.mainContainer);var w=u.mainContainer.createChild(Zn);return u._shouldBeReady.push(w),w.shouldClone=!1,w.layout="none",w.virtualParent=u,u._disposers.push(w),u.bulletsContainer=w,u.tooltip=new kI,u.tooltip.virtualParent=u,u._disposers.push(u.tooltip),u.hiddenState.transitionEasing=_4,u.dataItem=u.createDataItem(),u._disposers.push(u.dataItem),u.dataItem.component=u,u.role="group",u.applyTheme(),u}return re(R,j),R.prototype.applyTheme=function(){j.prototype.applyTheme.call(this),no.autoSetClassName&&this.bulletsContainer&&(this.bulletsContainer.className=this.className+"-bullets",this.bulletsContainer.setClassName())},R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),Ee(this.readerTitle)||(this.readerTitle=this.language.translate("Series"))},R.prototype.createDataItem=function(){return new s8},Object.defineProperty(R.prototype,"chart",{get:function(){return this._chart},set:function(u){this._chart=u},enumerable:!0,configurable:!0}),R.prototype.positionBullet=function(u){},R.prototype.processBullet=function(u){var w=this,$=u.newValue;$.isTemplate=!0,this.events.once("datavalidated",function(U){w.itemsFocusable()&&($.focusable=!0)}),this.invalidate()},R.prototype.removeBullet=function(u){var w=u.oldValue;this.dataItems.each(function($){var U=$.bullets.getKey(w.uid);U&&U.dispose()}),this.invalidate()},R.prototype.validateDataItems=function(){j.prototype.validateDataItems.call(this),this.processValues(!1)},R.prototype.getFirstValue=function(u,w){for(var $=w;$>=0;$--){var U=this.dataItems.getIndex($).getActualWorkingValue(u);if(le(U))return U}return null},R.prototype.getAbsoluteFirstValue=function(u){for(var w=0;w0){var ai=$.getIndex(Gt-1);gi(ai.values,function(nr,Ir){var yr=ai.getActualWorkingValue(nr);le(yr)&&(Xe[nr]=yr)})}for(var oi=function(nr){var Ir=$.getIndex(nr);gi(Ir.values,function(yr,Es){var Dn=Ir.getActualWorkingValue(yr);if(le(Dn)){le(U[yr])||(U[yr]=0),U[yr]++,le(K[yr])||(K[yr]=0),K[yr]+=Dn,le(ie[yr])||(ie[yr]=0),ie[yr]+=Math.abs(Dn),le(Re[yr])||(Re[yr]=Dn),$e[yr]=Dn,le(ae[yr])?ae[yr]>Dn&&(ae[yr]=Dn):ae[yr]=Dn,le(we[yr])?we[yr]0){w.usePercentHack&&Dn==Es&&(Es=Ir.values[yr].value);var Ra=Dn/Es*100;Ir.setCalculatedValue(yr,Ra,"percent")}else Ir.setCalculatedValue(yr,0,"percent")})};for(Ui=Gt;Ui0){var Si=$.getIndex(Gt-1);gi(Si.values,function(nr){var Ir=Si.values[nr].value;Si.setCalculatedValue(nr,Ir-Re[nr],"change"),Si.setCalculatedValue(nr,(Ir-Re[nr])/Re[nr]*100,"changePercent")})}var Hi=this.dataItem;gi(Hi.values,function(nr){Hi.setCalculatedValue(nr,K[nr],"sum"),Hi.setCalculatedValue(nr,ie[nr],"absoluteSum"),Hi.setCalculatedValue(nr,K[nr]/U[nr],"average"),Hi.setCalculatedValue(nr,Re[nr],"open"),Hi.setCalculatedValue(nr,$e[nr],"close"),Hi.setCalculatedValue(nr,ae[nr],"low"),Hi.setCalculatedValue(nr,we[nr],"high"),Hi.setCalculatedValue(nr,U[nr],"count")})}},R.prototype.validate=function(){ZS()&&this.filters.clear(),pr(this.axisRanges.iterator(),function(U){U.validate()}),j.prototype.validate.call(this);var u=this.bulletsContainer;if(u.fill=this.fill,u.stroke=this.stroke,u.x=this.pixelX,u.y=this.pixelY,this.bulletsContainer.children.length>0)if(this._showBullets){for(var w=0;wthis.endIndex;w--){var $;($=this.dataItems.getIndex(w))&&$.bullets.each(function(U,K){K.__disabled=!0})}}else this.bulletsContainer.children.each(function(U){U.__disabled=!0});this.updateTooltipBounds()},R.prototype.updateTooltipBounds=function(){if(this.topParent){var u={x:0,y:0,width:this.topParent.maxWidth,height:this.topParent.maxHeight};this.tooltip.setBounds(u)}},R.prototype.shouldCreateBullet=function(u,w){return!0},R.prototype.validateDataElement=function(u){var w=this;j.prototype.validateDataElement.call(this,u),this._showBullets?(this.isHidden||(this.bulletsContainer.visible=!0),this.bullets.each(function($){var U=u.bullets.getKey($.uid);if(w.shouldCreateBullet(u,$)){if(!U){var K=$.propertyFields.disabled,ie=u.dataContext;K&&ie&&ie[K]===!1?($.applyOnClones=!1,$.disabled=!1,U=$.clone(),$.disabled=!0,$.applyOnClones=!0):U=$.clone(),U.shouldClone=!1,u.addSprite(U),w.visible&&!w.isHiding||U.hide(0)}var ae=U.dataItem;if(ae!=u){ae&&ae.bullets.setKey($.uid,void 0);var we=w.itemReaderText;U instanceof Oo&&(we||(we="{"+U.xField+"}: {"+U.yField+"}"),U.isDynamic&&(u.events.on("workingvaluechanged",U.deepInvalidate,U,!1),w.dataItem.events.on("workingvaluechanged",U.deepInvalidate,U,!1)),U.deepInvalidate()),U.focusable&&(U.events.on("focus",function(Re){U.readerTitle=w.populateString(we,U.dataItem)},void 0,!1),U.events.on("blur",function(Re){U.readerTitle=""},void 0,!1)),U.hoverable&&(U.events.on("over",function(Re){U.readerTitle=w.populateString(we,U.dataItem)},void 0,!1),U.events.on("out",function(Re){U.readerTitle=""},void 0,!1))}U.parent=w.bulletsContainer,u.bullets.setKey($.uid,U),U.maxWidth=u.itemWidth,U.maxHeight=u.itemHeight,U.__disabled=!1,w.positionBullet(U)}else U&&(U.__disabled=!0)})):this.bulletsContainer.visible=!1},R.prototype.handleDataItemWorkingValueChange=function(u,w){this.dataRangeInvalid||this.invalidateProcessedData()},Object.defineProperty(R.prototype,"ignoreMinMax",{get:function(){return this._ignoreMinMax},set:function(u){this._ignoreMinMax=u,this.invalidateDataItems()},enumerable:!0,configurable:!0}),R.prototype.createMask=function(){},R.prototype.processAxisRange=function(u){this.rangesContainer||(this.rangesContainer=this.createChild(Zn),this.rangesContainer.shouldClone=!1,this.rangesContainer.isMeasured=!1);var w=u.newValue;w&&(w.contents.parent=this.rangesContainer,w.isRange=!0,w.events.on("valuechanged",this.invalidateDataItems,this,!1))},R.prototype.getAxisField=function(u){},R.prototype.showTooltipAtPosition=function(u,w){},Object.defineProperty(R.prototype,"minBulletDistance",{get:function(){return this.getPropertyValue("minBulletDistance")},set:function(u){this.setPropertyValue("minBulletDistance",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"bullets",{get:function(){return this._bullets||(this._bullets=new Xs(new Oo),this._bullets.template.virtualParent=this,this._bullets.events.on("inserted",this.processBullet,this,!1),this._bullets.events.on("removed",this.removeBullet,this,!1),this._disposers.push(new ta(this._bullets)),this._disposers.push(this._bullets.template)),this._bullets},enumerable:!0,configurable:!0}),R.prototype.createLegendMarker=function(u){},Object.defineProperty(R.prototype,"hiddenInLegend",{get:function(){return this.getPropertyValue("hiddenInLegend")},set:function(u){this.setPropertyValue("hiddenInLegend",u)&&this.chart&&this.chart.feedLegend()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"name",{get:function(){return this.getPropertyValue("name")},set:function(u){this.setPropertyValue("name",u);var w=this.legendDataItem;w&&(w.component.invalidate(),w.component.invalidateRawData()),this.readerTitle=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"itemReaderText",{get:function(){var u=this._itemReaderText;return u||(this.tooltipText?u=Lh(this.tooltipText):this.tooltipHTML&&(u=Lh(this.tooltipHTML))),this._adapterO?this._adapterO.apply("itemReaderText",u):u},set:function(u){this._itemReaderText=u,this._itemReaderTextChanged=!0},enumerable:!0,configurable:!0}),R.prototype.itemsFocusable=function(){return!(this.dataItems.length>=this.skipFocusThreshold)},Object.defineProperty(R.prototype,"legendDataItem",{get:function(){return this._legendDataItem},set:function(u){this._legendDataItem=u,this._legendDataItem.itemContainer.deepInvalidate()},enumerable:!0,configurable:!0}),R.prototype.updateLegendValue=function(u,w){if(this.legendDataItem){var $=this.legendSettings,U=this.legendDataItem,K=U.label,ie=U.valueLabel;u&&!u.isDisposed()||w?(ie&&($.itemValueText&&(ie.text=$.itemValueText),ie.dataItem=u),K&&($.itemLabelText&&(K.text=$.itemLabelText),K.dataItem=u)):(K&&(($.labelText||$.itemLabelText!=null)&&(K.text=$.labelText),K.dataItem=this.dataItem),ie&&(($.valueText||$.itemValueText!=null)&&(ie.text=$.valueText),ie.dataItem=this.dataItem))}},R.prototype.copyFrom=function(u){this.bullets.copyFrom(u.bullets),this.bulletsContainer.copyFrom(u.bulletsContainer),this.calculatePercent=u.calculatePercent,this.usePercentHack=u.usePercentHack,this.simplifiedProcessing=u.simplifiedProcessing,j.prototype.copyFrom.call(this,u)},R.prototype.raiseCriticalError=function(u){this._chart&&this._chart.modal&&(this._chart.modal.content=this._chart.adapter.apply("criticalError",u).message,this._chart.modal.closable=!1,no.suppressErrors||this._chart.modal.open(),this._chart.disabled=!0),no.verbose&&console.log(u)},R.prototype.applyFilters=function(){var u=this;j.prototype.applyFilters.call(this),this.bulletsContainer.filters.clear(),pr(this.filters.iterator(),function(w){u.bulletsContainer.filters.push(w.clone())})},Object.defineProperty(R.prototype,"heatRules",{get:function(){var u=this;return this._heatRules||(this._heatRules=new Us,this._heatRules.events.on("inserted",function(w){var $=w.newValue,U=$.target;if(U){var K=$.dataField;Ee(K)||(K="value");var ie=u.dataItem,ae=$.property,we=Tt($.minValue),Re=Tt($.maxValue);le(we)||le(Re)||u.dataItem.events.on("calculatedvaluechanged",function($e){$e.property==K&&pr(u.dataItems.iterator(),function(Xe){var Qe=!1;mi(Xe.sprites,function(dt){if(dt.clonedFrom==U){var Gt=dt;Gt[ae]=Gt[ae],Qe=!0}}),Qe||mi(Xe.sprites,function(dt){dt instanceof Zn&&pr(dt.children.iterator(),function(Gt){if(Gt.className==U.className){var Yt=Gt;Yt[ae]=Yt[ae]}else Gt instanceof Zn&&Gt.deepInvalidate()})})})}),u.dataItems.template.events.on("workingvaluechanged",function($e){if($e.property==K){var Xe=$e.target,Qe=!1;mi(Xe.sprites,function(dt){if(dt.clonedFrom==U){var Gt=dt;Gt[ae]=Gt[ae],Qe=!0}}),Qe||mi(Xe.sprites,function(dt){dt instanceof Zn&&pr(dt.children.iterator(),function(Gt){if(Gt.className==U.className){var Yt=Gt;Yt[ae]=Yt[ae]}else Gt instanceof Zn&&Gt.deepInvalidate()})})}}),U.adapter.add(ae,function($e,Xe,Qe){var dt=Tt($.minValue),Gt=Tt($.maxValue),Yt=$.min,ai=$.max;if(Xe instanceof so){var oi=Xe.propertyFields[Qe];if(oi&&Xe.dataItem){var Ui=Xe.dataItem.dataContext;if(Ui&&Ee(Ui[oi]))return $e}}var Ji=Xe.dataItem;if(le(dt)||(dt=ie.values[K].low),le(Gt)||(Gt=ie.values[K].high),Ji&&Ji.values[K]){var Si=Ji.getActualWorkingValue(K);if(Ee(Yt)&&Ee(ai)&&le(dt)&&le(Gt)&&le(Si)){var Hi=void 0;if(Hi=$.logarithmic?(Math.log(Si)*Math.LOG10E-Math.log(dt)*Math.LOG10E)/(Math.log(Gt)*Math.LOG10E-Math.log(dt)*Math.LOG10E):(Si-dt)/(Gt-dt),!le(Si)||le(Hi)&&Math.abs(Hi)!=1/0||(Hi=.5),le(Yt))return Yt+(ai-Yt)*Hi;if(Yt instanceof Te)return new Te(qt(Yt.rgb,ai.rgb,Hi))}}return $e})}})),this._heatRules},enumerable:!0,configurable:!0}),R.prototype.processConfig=function(u){var w;if(u){if(Ee(u.bullets)&&pt(u.bullets))for(var $=0,U=u.bullets.length;$=0;K--){var ie=U.getIndex(K);ie&&ie.dataContext==w&&$.dataItems.remove(ie)}for(K=$.data.length-1;K>=0;K--){var ae=$.data[K];ae&&ae==w&&$i($.data,ae)}}},R.prototype.handleSeriesAdded=function(u){var w=this,$=u.newValue;$.isDisposed()||($.chart=this,$.parent=this.seriesContainer,$.bulletsContainer.parent=this.bulletsContainer,this._dataUsers.moveValue($),$.addDisposer(new jr(function(){w.dataUsers.removeValue($)})),this.handleSeriesAdded2($),this.handleLegendSeriesAdded($))},R.prototype.handleLegendSeriesAdded=function(u){u.hiddenInLegend||this.legend&&this.legend.addData(u)},R.prototype.handleSeriesAdded2=function(u){var w=this;this.dataInvalid||this._disposers.push(ui.events.once("exitframe",function(){u.data&&u.data.length!=0||(u.data=w.data,u.showOnInit&&(u.reinit(),u.setPropertyValue("showOnInit",!1),u.showOnInit=!0),u.isDisposed()||u.events.once("datavalidated",function(){u.data==w.data&&(u._data=[])}))}))},R.prototype.feedLegend=function(){var u=this.legend;if(u){var w=[];pr(this.series.iterator(),function($){$.hiddenInLegend||w.push($)}),u.dataFields.name="name",u.data=w}},R.prototype.createSeries=function(){return new o8},Object.defineProperty(R.prototype,"colors",{get:function(){return this.getPropertyValue("colors")},set:function(u){this.setPropertyValue("colors",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"patterns",{get:function(){return this.getPropertyValue("patterns")},set:function(u){this.setPropertyValue("patterns",u,!0)},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.series.copyFrom(u.series)},R.prototype.appear=function(){j.prototype.appear.call(this),this.series.each(function(u){u.showOnInit&&u.inited&&u.appear()})},R}(kx);ui.registeredClasses.SerialChart=Sz;var a8=function(j){function R(){var u=j.call(this)||this;u._axis=new Jn,u.dataItems=new Us,u.className="AxisBreak",u.breakSize=.01,u.marginLeft=-5,u.marginRight=-5,u.marginTop=-5,u.marginBottom=-5;var w=new $a,$=new Tr;$.fill=w.getFor("background"),$.stroke=He(),$.fillOpacity=.9,$.zIndex=0,u._fillShape=$;var U=new Tr;U.fill=He(),U.stroke=w.getFor("grid"),U.strokeOpacity=.3,U.zIndex=1,u._startLine=U;var K=new Tr;return K.fill=He(),K.stroke=He("#000000"),K.strokeOpacity=.3,K.zIndex=2,u._endLine=K,u._disposers.push(u._axis),u.applyTheme(),u}return re(R,j),R.prototype.dispose=function(){j.prototype.dispose.call(this),this._fillShape&&this._fillShape.dispose(),this._startLine&&this._startLine.dispose(),this._endLine&&this._endLine.dispose()},Object.defineProperty(R.prototype,"startLine",{get:function(){return this._startLine},set:function(u){this._startLine&&this._startLine.dispose(),this._startLine=u,this.addBreakSprite(u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endLine",{get:function(){return this._endLine},set:function(u){this._endLine&&this._endLine.dispose(),this._endLine=u,this.addBreakSprite(u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fillShape",{get:function(){return this._fillShape},set:function(u){this._fillShape&&this._fillShape.dispose(),this._fillShape=u,this.addBreakSprite(u)},enumerable:!0,configurable:!0}),R.prototype.addBreakSprite=function(u){u.parent=this,u.isMeasured=!1,this._disposers.push(u)},Object.defineProperty(R.prototype,"axis",{get:function(){return this._axis.get()},set:function(u){if(this._axis.get()!==u){this._axis.set(u,u.renderer.gridContainer.events.on("transformed",this.invalidate,this,!1)),u.renderer.createBreakSprites(this);var w=u.axisBreaks.template;this.startLine.copyFrom(w.startLine),this.endLine.copyFrom(w.endLine),this.fillShape.copyFrom(w.fillShape)}},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"breakSize",{get:function(){return this.getPropertyValue("breakSize")},set:function(u){this.setPropertyValue("breakSize",u)&&this.axis&&(this.axis.invalidate(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startPoint",{get:function(){var u=this.axis.renderer;if(u)return u.positionToPoint(this.startPosition)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endPoint",{get:function(){var u=this.axis.renderer;if(u)return u.positionToPoint(this.endPosition)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startPosition",{get:function(){},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endPosition",{get:function(){},enumerable:!0,configurable:!0}),R.prototype.draw=function(){j.prototype.draw.call(this),this.axis&&this.axis.renderer.updateBreakElement(this)},Object.defineProperty(R.prototype,"startValue",{get:function(){return this.getPropertyValue("startValue")},set:function(u){this.setPropertyValue("startValue",u)&&this.axis&&(this.axis.invalidate(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endValue",{get:function(){return this.getPropertyValue("endValue")},set:function(u){this.setPropertyValue("endValue",u)&&this.axis&&(this.axis.invalidate(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),R}(Zn);ui.registeredClasses.AxisBreak=a8;var sve,dC=function(j){function R(){var u=j.call(this)||this;return u.className="AxisDataItem",u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"grid",{get:function(){if(!this._grid){var u=this.component;if(u){var w,$=void 0;if(this.isRange){if(($=u.axisRanges.template.grid).disabled)return;w=$.clone()}else{if(($=u.renderer.grid.template).disabled)return;w=u.renderer.grid.create(),this._disposers.push(new jr(function(){u.renderer.grid.removeValue(w)}))}this.grid=w,w.shouldClone=!1,this._disposers.push(w),w.axis=this.component}}return this._grid},set:function(u){this._grid&&this._grid!=u&&($i(this.sprites,this._grid),this._grid.dataItem=void 0),u&&(u.dataItem&&u.dataItem!=this&&($i(u.dataItem.sprites,u),u.dataItem.grid=void 0),this.addSprite(u)),this._grid=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tick",{get:function(){if(!this._tick){var u=this.component;if(u){var w,$=void 0;if(this.isRange){if(($=u.axisRanges.template.tick).disabled)return;w=$.clone()}else{if(($=u.renderer.ticks.template).disabled)return;w=u.renderer.ticks.create(),this._disposers.push(new jr(function(){u.renderer.ticks.removeValue(w)}))}this.tick=w,w.axis=this.component,w.shouldClone=!1,this._disposers.push(w)}}return this._tick},set:function(u){this._tick&&this._tick!=u&&($i(this.sprites,this._tick),this._tick.dataItem=void 0),u&&(u.dataItem&&u.dataItem!=this&&($i(u.dataItem.sprites,u),u.dataItem.tick=void 0),this.addSprite(u)),this._tick=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"label",{get:function(){if(!this._label){var u=this.component;if(u){var w,$=void 0;if(this.isRange){if(($=u.axisRanges.template.label).disabled)return;w=$.clone()}else{if(($=u.renderer.labels.template).disabled)return;w=u.renderer.labels.create(),this._disposers.push(new jr(function(){u.renderer.labels.removeValue(w)}))}this._disposers.push(w),this.label=w,w.shouldClone=!1,w.axis=this.component,w.virtualParent=u}}return this._label},set:function(u){this._label&&this._label!=u&&($i(this.sprites,this._label),this._label.dataItem=void 0),u&&(u.dataItem&&u.dataItem!=this&&($i(u.dataItem.sprites,u),u.dataItem.label=void 0),this.addSprite(u)),this._label=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"axisFill",{get:function(){if(!this._axisFill){var u=this.component;if(u){var w,$=void 0;if(this.isRange){if($=u.axisRanges.template.axisFill,!this.isTemplate&&$.disabled)return;w=$.clone()}else{if(($=u.renderer.axisFills.template).disabled)return;w=u.renderer.axisFills.create(),this._disposers.push(new jr(function(){u.renderer.axisFills.removeValue(w)}))}this.axisFill=w,w.shouldClone=!1,this._disposers.push(w)}}return this._axisFill},set:function(u){this._axisFill&&this._axisFill!=u&&($i(this.sprites,this._axisFill),this._axisFill.dataItem=void 0),u&&(u.dataItem&&u.dataItem!=this&&($i(u.dataItem.sprites,u),u.dataItem.axisFill=void 0),u.axis=this.component,this.addSprite(u)),this._axisFill=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"text",{get:function(){return this._text},set:function(u){this._text=u,this._label&&(this._label.text=u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"mask",{get:function(){return this._mask},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"contents",{get:function(){if(!this._contents){var u=new Zn;this.addSprite(u),u.isMeasured=!1,this._contents=u;var w=this.component;if(w){var $=w.renderer.createFill(this.component);$.disabled=!1,$.axis=w,this.addSprite($),this._mask=$,u.mask=$}}return this._contents},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"axisBreak",{get:function(){return this._axisBreak},set:function(u){this._axisBreak&&this._axisBreak.dataItems.removeValue(this),u&&u.dataItems.push(this),this._axisBreak=u},enumerable:!0,configurable:!0}),R.prototype.validate=function(){this.component&&this.component.validateDataElement(this)},R.prototype.appendChildren=function(){this.component&&this.component.appendDataItem(this)},R.prototype.hasProperty=function(u){return u=="component"||j.prototype.hasProperty.call(this,u)},R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.text=u.text,u.bullet&&(this.bullet=u.bullet.clone()),this.minPosition=u.minPosition,this.maxPosition=u.maxPosition},R.prototype.setVisibility=function(u,w){j.prototype.setVisibility.call(this,u,w),this._contents&&(this._contents.visible=u)},Object.defineProperty(R.prototype,"bullet",{get:function(){return this._bullet},set:function(u){this._bullet&&this._bullet!=u&&($i(this.sprites,this._bullet),this._bullet.dataItem=void 0),this._bullet=u,u&&this.addSprite(u)},enumerable:!0,configurable:!0}),R}(MI);(function(j){j[j.Start=0]="Start",j[j.Middle=.5]="Middle",j[j.End=1]="End"})(sve||(sve={}));var l8=function(j){function R(){var u=j.call(this)||this;if(u._gridCount=10,u._series=new Us,u.autoDispose=!0,u._axisItemCount=0,u.constructor===R)throw new Error("'Axis' cannot be instantiated directly. Please use a specific axis type.");u.hideTooltipWhileZooming=!0,u.minWidth=1e-4,u.minHeight=1e-4,u.className="Axis",u.shouldClone=!1,u.setPropertyValue("cursorTooltipEnabled",!0),u.toggleZoomOutButton=!0,u.zoomable=!0;var w=new $a;u.title=new Zm,u.title.shouldClone=!1,u._disposers.push(u.title),u.setPropertyValue("startLocation",0),u.setPropertyValue("endLocation",1),u._dataItemsIterator=new Qp(u.dataItems,function(){return u.dataItems.create()}),u._dataItemsIterator.createNewItems=!0;var $=new kI;u._disposers.push($),$.label.padding(5,10,5,10),$.background.pointerLength=5,$.fitPointerToBounds=!0,$.background.filters.clear(),$.virtualParent=u;var U=$.background;return U.cornerRadius=0,U.fill=w.getFor("alternativeBackground"),U.stroke=U.fill,U.strokeWidth=1,U.fillOpacity=1,$.label.fill=w.getFor("alternativeText"),u.tooltip=$,u.readerHidden=!0,u.events.on("rangechangestarted",function(){u.series.each(function(K){K.hideTooltipWhileZooming&&(K.tooltip.hide(),K.tooltip.preventShow=!0)}),u.hideTooltipWhileZooming&&(u.tooltip.hide(),u.tooltip.preventShow=!0)},void 0,!1),u.events.on("rangechangeended",function(){u.series.each(function(K){K.hideTooltipWhileZooming&&(K.tooltip.hide(),K.tooltip.preventShow=!1)}),u.hideTooltipWhileZooming&&(u.tooltip.hide(),u.tooltip.preventShow=!1)},void 0,!1),u.applyTheme(),u}return re(R,j),R.prototype.fillRule=function(u,w){le(w)||(w=u.index),w/2==Math.round(w/2)?(u.axisFill.__disabled=!0,u.axisFill.opacity=0):(u.axisFill.opacity=1,u.axisFill.__disabled=!1)},R.prototype.createDataItem=function(){return new dC},R.prototype.invalidateLayout=function(){j.prototype.invalidateLayout.call(this),pr(this.series.iterator(),function(u){u.invalidateLayout()})},R.prototype.invalidateSeries=function(){pr(this.series.iterator(),function(u){u.invalidate()})},R.prototype.validateDataElements=function(){this._axisItemCount=0,this.ghostLabel&&(this.renderer.updateLabelElement(this.ghostLabel,this.start,this.end),this.ghostLabel.validate())},R.prototype.updateGridCount=function(){if(this.renderer){var u=this.axisLength/this.renderer.minGridDistance;u!=this._gridCount&&(this._gridCount=u,this.clearCache())}},R.prototype.validateLayout=function(){this.axisFullLength=this.axisLength/(this.end-this.start),j.prototype.validateLayout.call(this),this.updateGridCount();var u=this.renderer;u&&(u.updateAxisLine(),u.updateTooltip(),u.updateBaseGridElement()),this._prevLength!=this.axisLength&&(this.dispatchImmediately("lengthchanged"),this._prevLength=this.axisLength)},R.prototype.initRenderer=function(){},R.prototype.appendDataItem=function(u){var w=this.renderer,$=u.tick;$&&($.above?$.parent=w.bulletsContainer:$.parent=w.gridContainer),u.label&&(u.label.parent=w);var U=u.axisFill;U&&(U.above?U.parent=w.bulletsContainer:U.parent=w.gridContainer);var K=u.grid;K&&(K.above?K.parent=w.bulletsContainer:K.parent=w.gridContainer),u.bullet&&(u.bullet.parent=w.bulletsContainer)},R.prototype.validate=function(){j.prototype.validate.call(this),this.validateLayout(),this.renderer.updateGridContainer()},R.prototype.validateAxisRanges=function(){var u=this;pr(this.axisRanges.iterator(),function(w){u.appendDataItem(w),u.validateDataElement(w),w.grid&&w.grid.validate(),w.tick&&w.tick.validate(),w.axisFill&&w.axisFill.validate(),w.label&&w.label.validate()})},R.prototype.validateBreaks=function(){this._axisBreaks&&pr(this._axisBreaks.iterator(),function(u){u.invalidate()})},R.prototype.processBreak=function(u){var w=u.newValue;w.parent=this.renderer.breakContainer,w.axis=this},R.prototype.registerSeries=function(u){var w=this;return this.series.moveValue(u),new Nn([new jr(function(){w.series.removeValue(u)}),this.events.on("lengthchanged",u.invalidate,u,!1),this.events.on("lengthchanged",u.createMask,u,!1),this.events.on("startchanged",u.invalidate,u,!1),this.events.on("endchanged",u.invalidate,u,!1)])},Object.defineProperty(R.prototype,"renderer",{get:function(){return this._renderer},set:function(u){if(u!=this._renderer){this._renderer=u,u.chart=this.chart,u.axis=this,u.parent=this,this.title.parent=this,this.initRenderer(),this._disposers.push(u.gridContainer.events.on("maxsizechanged",this.invalidate,this,!1));var w=this.renderer.labels.create();this._disposers.push(w),w.dataItem=this.dataItems.template.clone(),w.text="L",w.parent=this.renderer,w.shouldClone=!1,w.fillOpacity=0,w.opacity=0,w.strokeOpacity=0,w.interactionsEnabled=!1,w.validate(),this.ghostLabel=w,this.events.on("beforedatavalidated",function(){w.text="L"},void 0,!1)}},enumerable:!0,configurable:!0}),R.prototype.positionToAngle=function(u){return this.renderer.positionToAngle(u)},R.prototype.pointToPosition=function(u){return this.renderer.pointToPosition(u)},R.prototype.positionToCoordinate=function(u){return this.renderer.positionToCoordinate(u)},R.prototype.getAnyRangePath=function(u,w){return this.renderer.getPositionRangePath(u,w)},R.prototype.anyToPosition=function(u){return 0},R.prototype.anyToPoint=function(u){return{x:0,y:0,angle:0}},R.prototype.getPositionRangePath=function(u,w){return this.renderer?this.renderer.getPositionRangePath(u,w):""},Object.defineProperty(R.prototype,"axisLength",{get:function(){return this.renderer?this.renderer.axisLength:0},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cursorTooltipEnabled",{get:function(){return this.getPropertyValue("cursorTooltipEnabled")},set:function(u){this.setPropertyValue("cursorTooltipEnabled",u)&&(u&&this.renderer?this.renderer.updateTooltip():this.tooltip&&this.tooltip.hide(0))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"toggleZoomOutButton",{get:function(){return this.getPropertyValue("toggleZoomOutButton")},set:function(u){this.setPropertyValue("toggleZoomOutButton",u)},enumerable:!0,configurable:!0}),R.prototype.hideTooltip=function(u){j.prototype.hideTooltip.call(this,u),this._tooltipPosition=void 0},R.prototype.showTooltipAtPosition=function(u,w){var $=this._tooltip;if(!$||this.dataItems.length<=0)this._tooltipPosition=void 0;else{if(w||(u=this.toAxisPosition(u)),!le(u)||uthis.end)return $.hide(0),void(this._tooltipPosition=void 0);var U=this.renderer;$.parent||($.parent=this.tooltipContainer);var K=U.tooltipLocation,ie=this.getCellStartPosition(u),ae=this.getCellEndPosition(u);if(this.tooltipPosition=="fixed"&&(u=ie+(ae-ie)*K),u=gt(u,this.start,this.end),this._tooltipPosition!=u){this._tooltipPosition=u;var we=U.tooltipLocation2,Re=U.positionToPoint(ie,we),$e=U.positionToPoint(ae,we);this.currentItemStartPoint=Re,this.currentItemEndPoint=$e,U.fullWidthTooltip&&($.width=$e.x-Re.x,$.height=$e.y-Re.y);var Xe=hm(U.positionToPoint(u,we),this.renderer.line);$.text=this.getTooltipText(u),$.text&&($.delayedPointTo(Xe),$.show())}this.cursorTooltipEnabled&&!this.tooltip.disabled||$.hide(0)}},R.prototype.toAxisPosition=function(u){if((u=this.renderer.toAxisPosition(u))!=null)return u*=this.end-this.start,this.renderer.inversed?this.end-u:this.start+u},R.prototype.toGlobalPosition=function(u){return this.renderer.inversed?u=this.end-u:u-=this.start,u/(this.end-this.start)},R.prototype.getTooltipText=function(u){},R.prototype.updateTooltip=function(u,w){var $=this._tooltip;$&&($.fixDoc=!1,$.pointerOrientation=u,$.setBounds(nt(w,this.renderer.line)))},R.prototype.roundPosition=function(u,w,$){return u},R.prototype.getCellStartPosition=function(u){return u},R.prototype.getCellEndPosition=function(u){return u},Object.defineProperty(R.prototype,"axisRanges",{get:function(){if(!this._axisRanges){var u=this.createDataItem();u.isRange=!0,u.axisFill=this.renderer.axisFills.template.clone(),u.grid=this.renderer.grid.template.clone(),u.tick=this.renderer.ticks.template.clone(),u.label=this.renderer.labels.template.clone(),u.isTemplate=!0,u.component=this,u.axisFill.disabled=!1,u.tick.disabled=!1,u.grid.disabled=!1,u.label.disabled=!1,this._axisRanges=new Xs(u),this._axisRanges.events.on("inserted",this.processAxisRange,this,!1),this._disposers.push(new ta(this._axisRanges)),this._disposers.push(this._axisRanges.template)}return this._axisRanges},enumerable:!0,configurable:!0}),R.prototype.processAxisRange=function(u){var w=u.newValue;w.component=this,w.isRange=!0},Object.defineProperty(R.prototype,"axisBreaks",{get:function(){return this._axisBreaks||(this._axisBreaks=new th(this.createAxisBreak(),function(u,w){return ih(u.adjustedStartValue,w.adjustedStartValue)}),this._axisBreaks.events.on("inserted",this.processBreak,this,!1),this._disposers.push(new ta(this._axisBreaks)),this._disposers.push(this._axisBreaks.template)),this._axisBreaks},enumerable:!0,configurable:!0}),R.prototype.createAxisBreak=function(){return new a8},Object.defineProperty(R.prototype,"series",{get:function(){return this._series||(this._series=new Us),this._series},enumerable:!0,configurable:!0}),R.prototype.processSeriesDataItems=function(){},R.prototype.processSeriesDataItem=function(u,w){},R.prototype.postProcessSeriesDataItems=function(u){},R.prototype.postProcessSeriesDataItem=function(u){},R.prototype.updateAxisBySeries=function(){},R.prototype.hideUnusedDataItems=function(){var u=this,w=this._dataItemsIterator;w.createNewItems=!1,pr(w.iterator(),function($){u.validateDataElement($),$.__disabled=!0}),w.clear(),w.createNewItems=!0},R.prototype.getSeriesDataItem=function(u,w,$){},R.prototype.getAngle=function(u,w,$,U,K){},R.prototype.getX=function(u,w,$,U,K){},R.prototype.getPositionX=function(u,w,$,U,K){},R.prototype.getY=function(u,w,$,U,K){},R.prototype.getPositionY=function(u,w,$,U,K){},Object.defineProperty(R.prototype,"basePoint",{get:function(){return{x:0,y:0}},enumerable:!0,configurable:!0}),R.prototype.dataChangeUpdate=function(){},R.prototype.seriesDataChangeUpdate=function(u){},R.prototype.adjustDifference=function(u,w){var $=w-u;if(le($))return this._axisBreaks&&Na(this._axisBreaks.iterator(),function(U){var K=U.adjustedStartValue,ie=U.adjustedEndValue;if(le(K)&&le(ie)){if(K>w)return!1;if(ie>=u&&le(K)&&le(ie)){var ae=U.breakSize,we=_({start:K,end:ie},{start:u,end:w});we&&($-=(we.end-we.start)*(1-ae))}return!0}}),$},R.prototype.isInBreak=function(u){if(this._axisBreaks)return qm(this._axisBreaks.iterator(),function(w){return u>=w.adjustedStartValue&&u<=w.adjustedEndValue})},R.prototype.fixAxisBreaks=function(){var u=this;if(this._axisBreaks){var w=this._axisBreaks;if(w.length>0){mi(Ea(w.iterator()),function(K){var ie=W(K.startValue,K.endValue),ae=ve(K.startValue,K.endValue);K.adjustedStartValue=ie,K.adjustedEndValue=ae,u._axisBreaks.update(K)});var $=w.first,U=Math.min($.startValue,$.endValue);pr(w.iterator(),function(K){var ie=K.adjustedStartValue,ae=K.adjustedEndValue;iewe)},R.prototype.createBreakSprites=function(u){},Object.defineProperty(R.prototype,"axisFills",{get:function(){if(!this._axisFills){var u=this.createFill(this.axis);this._axisFills=new Xs(u),u.applyOnClones=!0,u.events.on("enabled",this.invalidateAxisItems,this,!1),this._disposers.push(new ta(this._axisFills)),this._disposers.push(this._axisFills.template)}return this._axisFills},enumerable:!0,configurable:!0}),R.prototype.createFill=function(u){return new Cz(u)},Object.defineProperty(R.prototype,"grid",{get:function(){if(!this._grid){var u=this.createGrid();this._grid=new Xs(u),u.applyOnClones=!0,u.events.on("enabled",this.invalidateAxisItems,this,!1),this._disposers.push(new ta(this._grid)),this._disposers.push(this._grid.template)}return this._grid},enumerable:!0,configurable:!0}),R.prototype.createGrid=function(){return new B4},Object.defineProperty(R.prototype,"ticks",{get:function(){if(!this._ticks){var u=this.createTick();u.applyOnClones=!0,u.isMeasured=!1,u.events.on("enabled",this.invalidateAxisItems,this,!1),this._ticks=new Xs(u),this._disposers.push(new ta(this._ticks)),this._disposers.push(this._ticks.template)}return this._ticks},enumerable:!0,configurable:!0}),R.prototype.createTick=function(){return new Ez},Object.defineProperty(R.prototype,"labels",{get:function(){if(!this._labels){var u=this.createLabel();this._labels=new Xs(u),u.applyOnClones=!0,u.events.on("enabled",this.invalidateAxisItems,this,!1),this._disposers.push(new ta(this._labels)),this._disposers.push(this._labels.template)}return this._labels},enumerable:!0,configurable:!0}),R.prototype.createLabel=function(){return new Tz},Object.defineProperty(R.prototype,"inside",{get:function(){return this.getPropertyValue("inside")},set:function(u){this.setPropertyValue("inside",u)&&this.axis&&this.axis.invalidate(),u?(this.width=0,this.height=0):(this.width=void 0,this.height=void 0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"opposite",{get:function(){return this.getPropertyValue("opposite")},set:function(u){this.setPropertyValue("opposite",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fullWidthTooltip",{get:function(){return this.getPropertyValue("fullWidthTooltip")},set:function(u){this.setPropertyValue("fullWidthTooltip",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tooltipLocation",{get:function(){return this.getPropertyValue("tooltipLocation")},set:function(u){this.setPropertyValue("tooltipLocation",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tooltipLocation2",{get:function(){return this.getPropertyValue("tooltipLocation2")},set:function(u){this.setPropertyValue("tooltipLocation2",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cellStartLocation",{get:function(){return this.getPropertyValue("cellStartLocation")},set:function(u){this.setPropertyValue("cellStartLocation",u)&&this.axis&&this.axis.invalidateSeries()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cellEndLocation",{get:function(){return this.getPropertyValue("cellEndLocation")},set:function(u){this.setPropertyValue("cellEndLocation",u)&&this.axis&&this.axis.invalidateSeries()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"inversed",{get:function(){return this.getPropertyValue("inversed")},set:function(u){this.setPropertyValue("inversed",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"minLabelPosition",{get:function(){return this.getPropertyValue("minLabelPosition")},set:function(u){this.setPropertyValue("minLabelPosition",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxLabelPosition",{get:function(){return this.getPropertyValue("maxLabelPosition")},set:function(u){this.setPropertyValue("maxLabelPosition",u,!0)},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.grid.template.copyFrom(u.grid.template),this.ticks.template.copyFrom(u.ticks.template),this.labels.template.copyFrom(u.labels.template),this.axisFills.template.copyFrom(u.axisFills.template),this.line.copyFrom(u.line),this.baseGrid.copyFrom(u.baseGrid)},R.prototype.toAxisPosition=function(u){return u},R.prototype.setVisibility=function(u){j.prototype.setVisibility.call(this,u),this.bulletsContainer.visible=u},R}(Zn);ui.registeredClasses.AxisRenderer=u8;var V4=function(j){function R(){var u=j.call(this)||this;return u.className="AxisBullet",u.location=.5,u.isMeasured=!1,u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"location",{get:function(){return this.getPropertyValue("location")},set:function(u){this.setPropertyValue("location",u,!0)},enumerable:!0,configurable:!0}),R.prototype.setDisabled=function(u){var w=j.prototype.setDisabled.call(this,u);return this.axis&&this.axis.invalidateDataItems(),w},R}(Zn);ui.registeredClasses.AxisBullet=V4;var w1=function(j){function R(){var u=j.call(this)||this;return u.className="AxisRendererY",u.minGridDistance=40,u.opposite=!1,u.height=he(100),u.labels.template.verticalCenter="middle",u.applyTheme(),u}return re(R,j),R.prototype.setAxis=function(u){j.prototype.setAxis.call(this,u),u.layout="horizontal"},R.prototype.updateGridContainer=function(){var u=this.axis;if(u){var w=this.gridContainer;w.y=u.pixelY,w.height=u.axisLength}},R.prototype.toAxisPosition=function(u){var w=this.axis;if(w){var $=1-u,U=w.relativePositionSprite,K=w.pixelY;if(U?K=wp({x:0,y:this.pixelY},this.parent,U).y:U=w.parent,U)return 1-($-K/U.innerHeight)/(w.axisLength/U.innerHeight)}return u},R.prototype.processRenderer=function(){j.prototype.processRenderer.call(this);var u=this.axis;if(u){var w=u.title;w.valign="middle",u.height instanceof J||(u.height=he(100)),this.opposite?(w.rotation=90,this.line.toBack(),w.toFront()):(w.rotation=-90,w.toBack(),this.line.toFront())}},R.prototype.updateTooltip=function(){if(this.axis){var u=2e3,w=0,$=u,U=this.axisLength;this.opposite?this.inside&&(w=-2e3,$=u):this.inside||(w=-2e3,$=u),this.axis.updateTooltip("horizontal",{x:w,y:0,width:$,height:U})}},Object.defineProperty(R.prototype,"axisLength",{get:function(){var u=this.axis;return u.measuredHeight-u.pixelPaddingTop-u.pixelPaddingBottom||0},enumerable:!0,configurable:!0}),R.prototype.positionToPoint=function(u,w){return{x:0,y:this.positionToCoordinate(u)}},R.prototype.pointToPosition=function(u){return this.coordinateToPosition(u.y,u.x)},R.prototype.coordinateToPosition=function(u,w){var $=this.axis,U=$.axisFullLength;return Ve($.renderer.inversed?1-$.start-u/U:u/U+(1-$.end),5)},R.prototype.getPositionRangePath=function(u,w){var $=gt(this.positionToCoordinate(u),0,this.axisLength),U=gt(this.positionToCoordinate(w),0,this.axisLength),K=Math.abs(U-$),ie=this.getWidth();return uC({x:0,y:Math.min($,U),width:ie,height:K},!0)},R.prototype.updateGridElement=function(u,w,$){w+=($-w)*u.location;var U=this.positionToPoint(w);u.path=ln({x:0,y:0})+br({x:this.getWidth(),y:0}),this.positionItem(u,U),this.toggleVisibility(u,w,0,1)},R.prototype.updateTickElement=function(u,w,$){w+=($-w)*u.location;var U=this.positionToPoint(w),K=u.length;try{this.axis.title.measuredWidth}catch{}U.x=wp({x:this.line.pixelX,y:0},this.line.parent,this.gridContainer).x,this.opposite?K*=u.inside?-1:1:K*=u.inside?1:-1,u.path=ln({x:0,y:0})+br({x:K,y:0}),this.positionItem(u,U),this.toggleVisibility(u,w,0,1)},R.prototype.updateAxisLine=function(){this.line.path=ln({x:0,y:0})+br({x:0,y:this.axisLength})},R.prototype.updateBaseGridElement=function(){j.prototype.updateBaseGridElement.call(this);var u=this.axis,w=this.getWidth(),$=this.axisLength,U=u.basePoint.y,K=this.baseGrid;if(U<-.2||U>$+.2)K.hide(0);else{var ie=wp({x:0,y:0},this.gridContainer,K.parent).x;K.path=ln({x:0,y:0})+br({x:w,y:0}),K.moveTo({x:ie,y:U}),K.show(0)}},R.prototype.updateLabelElement=function(u,w,$,U){Ee(U)||(U=u.location),w+=($-w)*U,u.isMeasured=!u.inside;var K,ie=this.positionToPoint(w),ae=0,we=this.gridContainer.maxWidth;this.opposite?(u.inside?(K="right",u.align=="left"&&(ae=-we,K="left"),u.align=="center"&&(ae=-we/2,K="middle")):K="left",ie.x=0+ae):(u.inside?(K="left",u.align=="right"&&(ae=we,K="right"),u.align=="center"&&(ae=we/2,K="middle")):K="right",ie.x=this.measuredWidth+ae),u.rotation==0&&(u.horizontalCenter=K),this.positionItem(u,ie),this.toggleVisibility(u,w,this.minLabelPosition,this.maxLabelPosition)},R.prototype.updateBreakElement=function(u){j.prototype.updateBreakElement.call(this,u);var w=u.startLine,$=u.endLine,U=u.fillShape,K=u.startPoint,ie=u.endPoint,ae=u.pixelMarginLeft,we=this.getWidth()-u.pixelMarginLeft-u.pixelMarginRight;K.y=gt(K.y,-1,this.axisLength+1),ie.y=gt(ie.y,-1,this.axisLength+1),K.y==ie.y&&(K.y<0||K.y>this.axisLength)?u.fillShape.__disabled=!0:u.fillShape.__disabled=!1;var Re=Math.abs(we-ae);w.x=ae,w.height=0,w.width=Re,$.x=ae,$.height=0,$.width=Re,U.width=Re,U.height=Math.abs(ie.y-K.y),U.x=ae,U.y=ie.y},R.prototype.createBreakSprites=function(u){u.startLine=new Tr,u.endLine=new Tr;var w=new e8;w.setWavedSides(!0,!1,!0,!1),u.fillShape=w},R.prototype.positionToCoordinate=function(u){var w=this.axis,$=w.axisFullLength;return w.renderer.inversed?(u-w.start)*$:(w.end-u)*$},R.prototype.updateBullet=function(u,w,$){var U=.5;u instanceof V4&&(U=u.location),w+=($-w)*U;var K=this.positionToPoint(w);K.x=wp({x:this.line.pixelX,y:0},this.line.parent,this.gridContainer).x,this.positionItem(u,K),this.toggleVisibility(u,w,0,1)},R}(u8);ui.registeredClasses.AxisRendererY=w1,Zd.push({relevant:Af.widthS,state:function(j,R){if(j instanceof w1){var u=j.states.create(R);return u.properties.inside=!0,u.properties.maxLabelPosition=.9,u.properties.minLabelPosition=.1,u}return null}}),Zd.push({relevant:Af.widthXS,state:function(j,R){if(j instanceof w1){var u=j.states.create(R);return u.properties.disabled=!0,u}return null}});var Iz=function(j){function R(){var u=j.call(this)||this;return u.className="ValueAxisBreak",u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"startPosition",{get:function(){if(this.axis)return this.axis.valueToPosition(this.adjustedStartValue)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endPosition",{get:function(){if(this.axis)return this.axis.valueToPosition(this.adjustedEndValue)},enumerable:!0,configurable:!0}),R}(a8);ui.registeredClasses.ValueAxisBreak=Iz;var c8=function(j){function R(){var u=j.call(this)||this;return u.className="ValueAxisDataItem",u.values.value={},u.values.endValue={},u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"value",{get:function(){return this.values.value.value},set:function(u){this.setValue("value",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endValue",{get:function(){return this.values.endValue.value},set:function(u){this.setValue("endValue",u)},enumerable:!0,configurable:!0}),R}(dC),vo=function(j){function R(){var u=j.call(this)||this;return u._stepDecimalPlaces=0,u._prevStepDecimalPlaces=0,u._adjustLabelPrecision=!0,u._baseValue=0,u._adjustedStart=0,u._adjustedEnd=1,u._extremesChanged=!1,u._deltaMinMax=1,u._dsc=!1,u.calculateTotals=!1,u.className="ValueAxis",u.axisFieldName="value",u.setPropertyValue("maxZoomFactor",1e3),u.setPropertyValue("extraMin",0),u.setPropertyValue("extraMax",0),u.setPropertyValue("strictMinMax",!1),u.setPropertyValue("maxPrecision",Number.MAX_VALUE),u.setPropertyValue("adjustLabelPrecision",!0),u.setPropertyValue("extraTooltipPrecision",0),u.keepSelection=!1,u.includeRangesInMinMax=!1,u.applyTheme(),u}return re(R,j),R.prototype.fillRule=function(u){var w=u.value,$=u.component;u.axisFill.disabled||(Ve(w/$.step/2,5)==Math.round(w/$.step/2)?u.axisFill.__disabled=!0:u.axisFill.__disabled=!1)},R.prototype.createDataItem=function(){return new c8},R.prototype.createAxisBreak=function(){return new Iz},R.prototype.dataChangeUpdate=function(){this.clearCache(),this.keepSelection?(this._start!=0&&this.dispatchImmediately("startchanged"),this._end!=1&&this.dispatchImmediately("endchanged"),this._start==0&&this._end==1||this.dispatchImmediately("startendchanged")):this._start==0&&this._end==1||(this._start=0,this._end=1,this.dispatchImmediately("startendchanged")),this._maxZoomed=this._maxDefined,this._minZoomed=this._minDefined,this._maxAdjusted=this._maxDefined,this._minAdjusted=this._minDefined},R.prototype.processSeriesDataItems=function(){if(this.calculateTotals){var u=this.series.getIndex(0),w=u.startIndex;if(u.dataItems.length>0){w>0&&w--;var $=u.endIndex;$1?w=Math.pow(10,Math.log(this.min)*Math.LOG10E):(w=Math.floor(this.minZoomed/this._step)*this._step)==0&&(w=this.minZoomed):w=Math.floor(w/this._step)*this._step;var $=this._maxZoomed+this._step;this.resetIterators();var U=this._dataItemsIterator;if(this._step==0)return;this._step=this.fixSmallStep(this._step);var K=0,ie=this._prevStepDecimalPlaces!=this._stepDecimalPlaces;for(this._prevStepDecimalPlaces=this._stepDecimalPlaces;w<=$;){if(!this.isInBreak(w)){var ae=U.find(function(dt){return dt.value===w});ae.__disabled&&(ae.__disabled=!1),this.appendDataItem(ae),ae.axisBreak=void 0,(ae.value!=w||ie)&&(ae.value=w,ae.text=this.formatLabel(w),ae.label&&ae.label.invalid&&ae.label.validate(),ae.value>=this.min&&ae.value<=this.max&&ae.label&&(this.axisLetter=="Y"&&ae.label.measuredWidth>this.ghostLabel.measuredWidth||this.axisLetter=="X"&&ae.label.measuredHeight>this.ghostLabel.measuredHeight)&&(this.ghostLabel.text=ae.label.currentText,this.ghostLabel.validate())),this.validateDataElement(ae)}K++;var we=w;this.logarithmic&&Math.log(this.max)*Math.LOG10E-Math.log(this.min)*Math.LOG10E>1?w=Math.pow(10,Math.log(this.min)*Math.LOG10E+K):w+=this._step;var Re=Math.pow(10,Math.floor(Math.log(Math.abs(this._step))*Math.LOG10E));if(Re<1){var $e=Math.round(Math.abs(Math.log(Math.abs(Re))*Math.LOG10E))+2;if($e=Math.min(13,$e),we==(w=Ve(w,$e))){w=$;break}}}var Xe=this._axisBreaks;if(Xe){var Qe=this.renderer;pr(Xe.iterator(),function(dt){if(dt.breakSize>0&&C(dt.startPoint,dt.endPoint)>Qe.minGridDistance)for(var Gt=dt.adjustedMin;Gt<=dt.adjustedMax;){if(Gt>=dt.adjustedStartValue&&Gt<=dt.adjustedEndValue){var Yt=U.find(function(ai){return ai.value===Gt});Yt.__disabled&&(Yt.__disabled=!1),u.appendDataItem(Yt),Yt.axisBreak=dt,Yt.value!=Gt&&(Yt.value=Gt,Yt.text=u.formatLabel(Gt),Yt.label&&Yt.label.invalid&&Yt.label.validate()),u.validateDataElement(Yt)}Gt+=dt.adjustedStep}})}}},R.prototype.validateDataElement=function(u){j.prototype.validateDataElement.call(this,u),u.itemIndex=this._axisItemCount,this._axisItemCount++;var w=this.renderer,$=u.value,U=u.endValue,K=this.valueToPosition($);u.position=K;var ie=K,ae=this.valueToPosition($+this._step);le(U)&&(ae=ie=this.valueToPosition(U)),u.point=w.positionToPoint(K);var we=u.tick;we&&!we.disabled&&w.updateTickElement(we,K,ie);var Re=u.grid;Re&&!Re.disabled&&w.updateGridElement(Re,K,ie);var $e=u.label;$e&&!$e.disabled&&w.updateLabelElement($e,K,ie);var Xe=u.axisFill;Xe&&!Xe.disabled&&(w.updateFillElement(Xe,K,ae),u.isRange||this.fillRule(u)),u.bullet&&w.updateBullet(u.bullet,K,ie);var Qe=u.mask;Qe&&w.updateFillElement(Qe,K,ae)},R.prototype.formatLabel=function(u){return this.adjustLabelPrecision&&u!=0?this.numberFormatter.format(u,void 0,this._stepDecimalPlaces):this.numberFormatter.format(u)},Object.defineProperty(R.prototype,"basePoint",{get:function(){var u=this.baseValue,w=this.valueToPosition(u);return this.renderer.positionToPoint(w)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"baseValue",{get:function(){var u=this._baseValue;return this.logarithmic&&(u=this.min),this._adapterO?this._adapterO.apply("baseValue",u):u},set:function(u){this._baseValue=u,this.invalidateLayout(),this.invalidateSeries()},enumerable:!0,configurable:!0}),R.prototype.anyToPosition=function(u){return this.valueToPosition(u)},R.prototype.valueToPoint=function(u){var w=this.valueToPosition(u),$=this.renderer.positionToPoint(w),U=this.renderer.positionToAngle(w);return{x:$.x,y:$.y,angle:U}},R.prototype.anyToPoint=function(u){return this.valueToPoint(u)},R.prototype.valueToPosition=function(u){if(le(u)){var w=this.min,$=this.max;if(le(w)&&le($)){var U=this._difference,K=this._axisBreaks;K&&K.length>0&&Na(K.iterator(),function(we){var Re=we.adjustedStartValue,$e=we.adjustedEndValue;if(le(Re)&&le($e)){if(u$e?w+=($e-Re)*(1-Xe):u0&&Na(ie.iterator(),function(ae){var we=ae.startPosition,Re=ae.endPosition,$e=ae.adjustedStartValue,Xe=ae.adjustedEndValue;if(le($e)&&le(Xe)){if($e>$)return!1;if(b({start:$e,end:Xe},{start:w,end:$})){$e=ve($e,w),Xe=W(Xe,$);var Qe=ae.breakSize;if(U-=(Xe-$e)*(1-Qe),u>Re)w+=(Xe-$e)*(1-Qe);else if(!(u$&&($=dt)}}),this.includeRangesInMinMax&&this.axisRanges.each(function(Xe){if(!Xe.ignoreMinMax){var Qe=W(Xe.value,Xe.endValue),dt=ve(Xe.value,Xe.endValue);(Qe$||!le($))&&($=dt)}})),this.logarithmic){var U=this.treatZeroAs;le(U)&&w<=0&&(w=U),w<=0&&this.raiseCriticalError(new Error("Logarithmic value axis can not have values <= 0."),!0)}if(w==0&&$==0&&($=.9,w=-.9),le(this._minDefined)&&(w=this._minDefined),le(this._maxDefined)&&($=this._maxDefined),this._adapterO&&(w=this._adapterO.apply("min",w)),this._adapterO&&($=this._adapterO.apply("max",$)),le(w)&&le($)){this._minReal=w,this._maxReal=$,w==Number.POSITIVE_INFINITY&&(w=void 0),$==Number.NEGATIVE_INFINITY&&($=void 0);var K=this.adjustDifference(w,$);if(w=this.fixMin(w),($=this.fixMax($))-w<=1/Math.pow(10,15)){if($-w!=0)this._deltaMinMax=($-w)/2;else{var ie=Math.log(Math.abs($))*Math.LOG10E,ae=Math.pow(10,Math.floor(ie));ae/=10,this._deltaMinMax=ae}w-=this._deltaMinMax,$+=this._deltaMinMax}w-=($-w)*this.extraMin,$+=($-w)*this.extraMax;var we=this.strictMinMax;le(this._maxDefined)&&(we=!0);var Re=this.adjustMinMax(w,$,K,this._gridCount,we);if(w=Re.min,K=($=Re.max)-w,Re=this.adjustMinMax(w,$,$-w,this._gridCount,!0),w=Re.min,$=Re.max,this.strictMinMax&&(w=le(this._minDefined)?this._minDefined:this._minReal,($=le(this._maxDefined)?this._maxDefined:this._maxReal)-w<=1e-8&&(w-=this._deltaMinMax,$+=this._deltaMinMax),w-=($-w)*this.extraMin,$+=($-w)*this.extraMax),this._adapterO&&(w=this._adapterO.apply("min",w)),this._adapterO&&($=this._adapterO.apply("max",$)),this._step=Re.step,le(w)||le($)||(this.start=0,this.end=1,this.renderer.labels.each(function(Xe){Xe.dataItem.text=""})),(this._minAdjusted!=w||this._maxAdjusted!=$)&&le(w)&&le($)){var $e=this._minMaxAnimation;if(this._extremesChanged&&le(this._minAdjusted)&&le(this._maxAdjusted)&&this.inited){if($e&&!$e.isFinished()&&this._finalMax==$&&this._finalMin==w)return;this._finalMin=w,this._finalMax=$,($e=this.animateMinMax(w,$))&&!$e.isFinished()?($e.events.on("animationprogress",this.validateDataItems,this),$e.events.on("animationended",function(){u.series.each(function(Xe){Xe.validate()}),u.validateDataItems(),u.handleSelectionExtremesChange()}),this._minMaxAnimation=$e):this.series.each(function(Xe){Xe.invalidate()}),this.validateDataItems(),this.dispatchImmediately("extremeschanged"),this.handleSelectionExtremesChange()}else{if($e&&!$e.isFinished()&&this._finalMax==$&&this._finalMin==w)return;this._minAdjusted=w,this._maxAdjusted=$,this._finalMin=w,this._finalMax=$,this.invalidateDataItems(),this.dispatchImmediately("extremeschanged")}}this._extremesChanged=!1,this._difference=this.adjustDifference(w,$)}},R.prototype.fixMin=function(u){return u},R.prototype.fixMax=function(u){return u},R.prototype.adjustMinMax=function(u,w,$,U,K){U<=1&&(U=1),U=Math.round(U);var ie=u,ae=w;$===0&&($=Math.abs(w));var we=Math.log(Math.abs($))*Math.LOG10E,Re=Math.pow(10,Math.floor(we)),$e=Re/=10;K&&($e=0),this.logarithmic?(u<=0&&(u=this.baseValue),u==1/0&&(u=1),w==-1/0&&(w=10),this.strictMinMax?(this._minDefined>0&&(u=this._minDefined),this._maxDefined):(u=Math.pow(10,Math.floor(Math.log(Math.abs(u))*Math.LOG10E)),w=Math.pow(10,Math.ceil(Math.log(Math.abs(w))*Math.LOG10E)))):(K?(u=Math.floor(u/Re)*Re,w=Math.ceil(w/Re)*Re):(u=Math.ceil(u/Re)*Re-$e,w=Math.floor(w/Re)*Re+$e),u<0&&ie>=0&&(u=0),w>0&&ae<=0&&(w=0)),we=Math.log(Math.abs($))*Math.LOG10E,Re=Math.pow(10,Math.floor(we)),Re/=10;var Xe=Math.ceil($/U/Re)*Re,Qe=Math.pow(10,Math.floor(Math.log(Math.abs(Xe))*Math.LOG10E)),dt=Math.ceil(Xe/Qe);dt>5?dt=10:dt<=5&&dt>2&&(dt=5),Xe=Math.ceil(Xe/(Qe*dt))*Qe*dt,this.maxPrecisionie&&(u-=Xe)}return{min:u,max:w,step:Xe}},Object.defineProperty(R.prototype,"min",{get:function(){var u=this._minAdjusted;return le(u)||(u=this._minDefined),u},set:function(u){this._minDefined!=u&&(this._minDefined=u,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"minDefined",{get:function(){return this._minDefined},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxDefined",{get:function(){return this._maxDefined},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"extraMin",{get:function(){return this.getPropertyValue("extraMin")},set:function(u){this.setPropertyValue("extraMin",u)&&this.invalidateDataItems()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"extraMax",{get:function(){return this.getPropertyValue("extraMax")},set:function(u){this.setPropertyValue("extraMax",u)&&this.invalidateDataItems()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"step",{get:function(){return this._step},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"max",{get:function(){var u=this._maxAdjusted;return le(u)||(u=this._maxDefined),u},set:function(u){this._maxDefined!=u&&(this._maxDefined=u,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"adjustLabelPrecision",{get:function(){return this.getPropertyValue("adjustLabelPrecision")},set:function(u){this.setPropertyValue("adjustLabelPrecision",u)&&this.invalidate()},enumerable:!0,configurable:!0}),R.prototype.registerSeries=function(u){return new Nn([j.prototype.registerSeries.call(this,u),u.events.on("extremeschanged",this.handleExtremesChange,this,!1),u.events.on("selectionextremeschanged",this.handleSelectionExtremesChange,this,!1),this.events.on("extremeschanged",u.invalidate,u,!1)])},R.prototype.handleSelectionExtremesChange=function(){var u,w,$=this,U=!0;if(pr(this.series.iterator(),function(Qe){if(!Qe.ignoreMinMax&&!Qe.isHidden&&!Qe.outOfRange){Qe.visible&&!Qe.isHiding&&(U=!1);var dt=Qe.selectionMin($),Gt=Qe.selectionMax($);le(dt)&&(!le(u)||dtw)&&(w=Gt)}}),this.includeRangesInMinMax&&this.axisRanges.each(function(Qe){if(!Qe.ignoreMinMax){var dt=W(Qe.value,Qe.endValue),Gt=ve(Qe.value,Qe.endValue);dtw&&(w=Gt)}}),le(this._minDefined)?u=this.strictMinMax?this._minDefined:this.min:this.strictMinMax&&(u=this._minReal),le(this._maxDefined)?w=this.strictMinMax?this._maxDefined:this.max:this.strictMinMax&&(w=this._maxReal),u==w){u-=this._deltaMinMax,w+=this._deltaMinMax;var K=this.adjustMinMax(u,w,0,this._gridCount,this.strictMinMax);u=K.min,w=K.max}var ie=this.adjustDifference(u,w),ae=this.adjustMinMax(u,w,ie,this._gridCount);u=ae.min,w=ae.max,u-=(w-u)*this.extraMin,w+=(w-u)*this.extraMax,u=gt(u,this.min,this.max),w=gt(w,this.min,this.max),ie=this.adjustDifference(u,w),ae=this.adjustMinMax(u,w,ie,this._gridCount,!0),u=ae.min,w=ae.max,this.strictMinMax&&(u=ve(u,this._minDefined),w=W(w,this._maxDefined));var we=ae.step;this.syncWithAxis&&(ae=this.syncAxes(u,w,we),u=ae.min,w=ae.max,this.invalidate()),we=ae.step,this._difference=this.adjustDifference(this.min,this.max);var Re=this.valueToPosition(u),$e=this.valueToPosition(w);U&&!this.syncWithAxis&&(Re=0,$e=1);var Xe=0;this.syncWithAxis?(Xe=5,this.setCache(u+"-"+w,we)):(this._step==we&&this._minZoomed==u&&this._maxZoomed==w||(this._dsc=!0),this._step=we,this._minZoomed=u,this._maxZoomed=w),this.keepSelection||this.zoom({start:Re,end:$e},!1,!1,Xe)},Object.defineProperty(R.prototype,"strictMinMax",{get:function(){return this.getPropertyValue("strictMinMax")},set:function(u){this.setPropertyValue("strictMinMax",u)&&this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"logarithmic",{get:function(){return this.getPropertyValue("logarithmic")},set:function(u){this.setPropertyValue("logarithmic",u)&&(this.invalidate(),this.series.each(function(w){w.invalidateDataItems()}))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"keepSelection",{get:function(){return this.getPropertyValue("keepSelection")},set:function(u){this.setPropertyValue("keepSelection",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"includeRangesInMinMax",{get:function(){return this.getPropertyValue("includeRangesInMinMax")},set:function(u){this.setPropertyValue("includeRangesInMinMax",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxPrecision",{get:function(){return this.getPropertyValue("maxPrecision")},set:function(u){this.setPropertyValue("maxPrecision",u)&&this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"extraTooltipPrecision",{get:function(){return this.getPropertyValue("extraTooltipPrecision")},set:function(u){this.setPropertyValue("extraTooltipPrecision",u)&&this.invalidate()},enumerable:!0,configurable:!0}),R.prototype.handleExtremesChange=function(){var u=this;this._extremesChanged=!0,this.getMinMax(),this.ghostLabel&&this.dataItems.each(function(w){w.label&&w.label.pixelWidth>0&&(u.ghostLabel.text=w.label.currentText)})},R.prototype.getX=function(u,w,$,U,K){return this.renderer.positionToPoint(this.getPositionX(u,w,$,U,K)).x},R.prototype.getPositionX=function(u,w,$,U,K){var ie=u.getWorkingValue(w);Ee(U)||(U="valueX");var ae=u.getValue(U,"stack");le(ie)||(ie=this.baseValue,this.logarithmic&&ae>0&&(ie=0));var we=this.valueToPosition(ie+ae);return K&&(we=gt(we,K.start,K.end)),we},R.prototype.getY=function(u,w,$,U,K){return this.renderer.positionToPoint(this.getPositionY(u,w,$,U,K)).y},R.prototype.getPositionY=function(u,w,$,U,K){var ie=u.getWorkingValue(w);Ee(U)||(U="valueY");var ae=u.getValue(U,"stack");le(ie)||(ie=this.baseValue,this.logarithmic&&ae>0&&(ie=0));var we=this.valueToPosition(ie+ae);return K&&(we=gt(we,K.start,K.end)),we},R.prototype.getAngle=function(u,w,$,U,K){var ie=u.getWorkingValue(w),ae=u.getValue(U,"stack");le(ie)||(ie=this.baseValue);var we=this.valueToPosition(ie+ae);return K&&(we=gt(we,K.start,K.end)),this.positionToAngle(we)},R.prototype.getAnyRangePath=function(u,w,$){var U=this.valueToPosition(u),K=this.valueToPosition(w);return this.getPositionRangePath(U,K)},R.prototype.getTooltipText=function(u){var w=Ve(this.positionToValue(u),this._stepDecimalPlaces+this.extraTooltipPrecision),$=this.tooltip.numberFormatter.format(w);return this._adapterO?this._adapterO.apply("getTooltipText",$):$},R.prototype.zoomToValues=function(u,w,$,U){var K=(u-this.min)/(this.max-this.min),ie=(w-this.min)/(this.max-this.min);this.zoom({start:K,end:ie},$,U)},Object.defineProperty(R.prototype,"minZoomed",{get:function(){return this.syncWithAxis?this._minZoomed:ve(this.min,this._minZoomed)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxZoomed",{get:function(){return this.syncWithAxis?this._maxZoomed:W(this.max,this._maxZoomed)},enumerable:!0,configurable:!0}),R.prototype.fixAxisBreaks=function(){var u=this;j.prototype.fixAxisBreaks.call(this);var w=this._axisBreaks;w&&w.length>0&&w.each(function($){var U=$.adjustedStartValue,K=$.adjustedEndValue,ie=K-U,ae=Math.ceil(ie*$.breakSize)*u._gridCount/(u.max-u.min),we=u.adjustMinMax(U,K,ie,ae,!0);$.adjustedStep=we.step,$.adjustedMin=we.min,$.adjustedMax=we.max}),this._difference=this.adjustDifference(this.min,this.max)},R.prototype.getPositionLabel=function(u){var w=this.positionToValue(u);return this.numberFormatter.format(w)},R.prototype.showTooltipAt=function(u){this.showTooltipAtPosition(this.valueToPosition(u))},R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.min=u.min,this.max=u.max,this.calculateTotals=u.calculateTotals,this._baseValue=u.baseValue},Object.defineProperty(R.prototype,"syncWithAxis",{get:function(){return this.getPropertyValue("syncWithAxis")},set:function(u){var w=this;this.setPropertyValue("syncWithAxis",u,!0)&&u&&(this._disposers.push(u.events.on("extremeschanged",this.handleSelectionExtremesChange,this,!1)),this._disposers.push(u.events.on("selectionextremeschanged",this.handleSelectionExtremesChange,this,!1)),this._disposers.push(u.events.on("startendchanged",this.handleSelectionExtremesChange,this,!1)),this.events.on("shown",this.handleSelectionExtremesChange,this,!1),this.events.on("maxsizechanged",function(){w.clearCache(),w._disposers.push(ui.events.once("exitframe",function(){w.handleSelectionExtremesChange()}))},this,!1))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"treatZeroAs",{get:function(){return this.getPropertyValue("treatZeroAs")},set:function(u){this.setPropertyValue("treatZeroAs",u,!0)},enumerable:!0,configurable:!0}),R.prototype.syncAxes=function(u,w,$){var U=this.syncWithAxis;if(U){le(u)||(u=this.min),le(w)||(w=this.max),le($)||($=this._step);var K=Math.round((U.maxZoomed-U.minZoomed)/U.step),ie=Math.round((w-u)/$);if(le(K)&&le(ie))for(var ae=!1,we=0,Re=.01*(w-u),$e=u,Xe=w,Qe=$;ae!=1;)if(ae=this.checkSync($e,Xe,Qe,K),++we>1e3&&(ae=!0),ae)u=$e,w=Xe,$=Qe;else{we/3==Math.round(we/3)?($e=u-Re*we,u>=0&&$e<0&&($e=0)):(Xe=w+Re*we)<=0&&Xe>0&&(Xe=0);var dt=this.adjustMinMax($e,Xe,Xe-$e,this._gridCount,!0);$e=dt.min,Xe=dt.max,Qe=dt.step}}return{min:u,max:w,step:$}},R.prototype.checkSync=function(u,w,$,U){for(var K=(w-u)/$,ie=1;ieai?(Re.startIndex=0,Re.endIndex=0,Re.outOfRange=!0):(Re.outOfRange=!1,Re.startIndex=Gt,Re.endIndex=Ji),!$&&Re.dataRangeInvalid&&Re.validateDataRange()}})},R.prototype.findFirst=function(u,w,$){var U=u.index;if(U>0){var K=u.component.dataItems.getIndex(U-1),ie=K[$];return!ie||ie.getTime()u._minDifference[$.uid]&&(w=u._minDifference[$.uid])}),w!=Number.MAX_VALUE&&w!=0||(w=Du("day")),w},enumerable:!0,configurable:!0}),R.prototype.seriesDataChangeUpdate=function(u){this._minDifference[u.uid]=Number.MAX_VALUE},R.prototype.postProcessSeriesDataItems=function(u){var w=this;this._firstWeekDay=this.getFirstWeekDay(),u?this.seriesGroupUpdate(u):this.series.each(function($){w.seriesGroupUpdate($)}),this.addEmptyUnitsBreaks()},R.prototype.seriesGroupUpdate=function(u){var w=this;JSON.stringify(u._baseInterval[this.uid])!=JSON.stringify(this.mainBaseInterval)&&(u._baseInterval[this.uid]=this.mainBaseInterval,u.mainDataSet.each(function($){w.postProcessSeriesDataItem($)}),this.groupData&&this.groupSeriesData(u))},R.prototype.groupSeriesData=function(u){var w=this;if(u.baseAxis==this&&u.dataItems.length>0&&!u.dataGrouped){u.bulletsContainer.removeChildren();var $=[],U=this.mainBaseInterval,K=Du(U.timeUnit,U.count);this.groupIntervals.each(function(ie){var ae=Du(ie.timeUnit,ie.count);(ae>K&&aeIr||!le(yr.low))&&(yr.low=Ir),(yr.high0&&w.each(function($){var U=Math.ceil(u._gridCount*(Math.min(u.end,$.endPosition)-Math.max(u.start,$.startPosition))/(u.end-u.start));$.gridInterval=u.chooseInterval(0,$.adjustedEndValue-$.adjustedStartValue,U);var K=od(new Date($.adjustedStartValue),$.gridInterval.timeUnit,$.gridInterval.count,u._firstWeekDay,u._df.utc,void 0,u._df.timezoneMinutes,u._df.timezone);K.getTime()>$.startDate.getTime()&&xp(K,$.gridInterval.timeUnit,$.gridInterval.count,u._df.utc),$.gridDate=K})},R.prototype.getFirstWeekDay=function(){return this._df?this._df.firstDayOfWeek:1},R.prototype.getGridDate=function(u,w){var $=this._gridInterval.timeUnit,U=this._gridInterval.count;od(u,$,1,this._firstWeekDay,this._df.utc,void 0,this._df.timezoneMinutes,this._df.timezone);var K=u.getTime(),ie=iC(u),ae=xp(ie,$,w,this._df.utc).getTime(),we=this.isInBreak(ae);we&&we.endDate&&(od(ie=new Date(we.endDate.getTime()),$,U,this._firstWeekDay,this._df.utc,void 0,this._df.timezoneMinutes,this._df.timezone),ie.getTime()0){var Xe=$e.gridInterval.timeUnit,Qe=$e.gridInterval.count;if(C($e.startPoint,$e.endPoint)>4*Re.minGridDistance)for(var dt,Gt=$e.gridDate.getTime(),Yt=0,ai=function(){var oi=iC($e.gridDate);if(Gt=xp(oi,Xe,Qe*Yt,u._df.utc).getTime(),Yt++,Gt>$e.adjustedStartValue&&Gt<$e.adjustedEndValue){var Ui=iC(oi);Ui=xp(Ui,Xe,Qe,u._df.utc);var Ji=u.dateFormats.getKey(Xe);u.markUnitChange&&dt&&EI(oi,dt,u._nextGridUnit,u._df.utc)&&Xe!=="year"&&(Ji=u.periodChangeDateFormats.getKey(Xe));var Si=u._df.format(oi,Ji),Hi=ie.find(function(nr){return nr.text===Si});Hi.__disabled&&(Hi.__disabled=!1),u.appendDataItem(Hi),Hi.axisBreak=$e,$e.dataItems.moveValue(Hi),Hi.date=oi,Hi.endDate=Ui,Hi.text=Si,dt=oi,u.validateDataElement(Hi)}};Gt<=$e.adjustedMax;)ai()}})}},R.prototype.validateDataElement=function(u){if(u.itemIndex=this._axisItemCount,this._axisItemCount++,le(this.max)&&le(this.min)){var w=this.renderer,$=u.value,U=u.endValue;le(U)||(U=$);var K=this.valueToPosition($),ie=this.valueToPosition(U),ae=ie;!u.isRange&&this._gridInterval.count>this.baseInterval.count&&(ie=K+(ie-K)/(this._gridInterval.count/this.baseInterval.count)),u.position=K;var we=u.tick;we&&!we.disabled&&w.updateTickElement(we,K,ie);var Re=u.grid;Re&&!Re.disabled&&w.updateGridElement(Re,K,ie);var $e=u.axisFill;$e&&!$e.disabled&&(w.updateFillElement($e,K,ae),u.isRange||this.fillRule(u));var Xe=u.mask;Xe&&w.updateFillElement(Xe,K,ie),u.bullet&&w.updateBullet(u.bullet,K,ie);var Qe=u.label;if(Qe&&!Qe.disabled){var dt=Qe.location;dt==0&&(dt=this._gridInterval.count!=1||this._gridInterval.timeUnit=="week"||u.isRange?0:.5),w.updateLabelElement(Qe,K,ie,dt)}}},Object.defineProperty(R.prototype,"baseDuration",{get:function(){return Du(this.baseInterval.timeUnit,this.baseInterval.count)},enumerable:!0,configurable:!0}),R.prototype.adjustMinMax=function(u,w){return{min:u,max:w,step:this.baseDuration}},R.prototype.fixMin=function(u){var w=this.baseInterval,$=od(new Date(u),w.timeUnit,w.count,this._firstWeekDay,this._df.utc,void 0,this._df.timezoneMinutes,this._df.timezone).getTime();return $+(xp(new Date($),w.timeUnit,w.count,this._df.utc).getTime()-$)*this.startLocation},R.prototype.fixMax=function(u){var w=this.baseInterval,$=od(new Date(u),w.timeUnit,w.count,this._firstWeekDay,this._df.utc,void 0,this._df.timezoneMinutes,this._df.timezone).getTime();return $+(xp(new Date($),w.timeUnit,w.count,this._df.utc).getTime()-$)*this.endLocation},R.prototype.chooseInterval=function(u,w,$,U){U||(U=this.gridIntervals);var K=U.getIndex(u),ie=Du(K.timeUnit,K.count),ae=U.length-1;if(u>=ae)return fe({},U.getIndex(ae));var we=Math.ceil(w/ie);return w0?fe({},U.getIndex(u-1)):we<=$?fe({},U.getIndex(u)):u+1Re&&(this._minDifference[U.uid]=Re)}var $e=$-we;$e>0&&this._minDifference[U.uid]>$e&&(this._minDifference[U.uid]=$e),this._prevSeriesTime[U.uid]=$,U._baseInterval[this.uid]&&this.postProcessSeriesDataItem(u)}},R.prototype.updateAxisBySeries=function(){j.prototype.updateAxisBySeries.call(this);var u=this.chooseInterval(0,this.minDifference,1);this.minDifference>=Du("day",27)&&u.timeUnit=="week"&&(u.timeUnit="month",u.count=1),u.timeUnit=="month"&&(this.minDifference>=Du("day",58)&&u.count==1&&(u.count=2),this.minDifference>=Du("day",87)&&u.count==2&&(u.count=3),this.minDifference>=Du("day",174)&&u.count==5&&(u.count=6)),this.minDifference>=Du("hour",23)&&u.timeUnit=="hour"&&(u.timeUnit="day",u.count=1),this.minDifference>=Du("week",1)-Du("hour",1)&&u.timeUnit=="day"&&(u.timeUnit="week",u.count=1),this.minDifference>=Du("year",1)-Du("day",1.01)&&u.timeUnit=="month"&&(u.timeUnit="year",u.count=1),this._baseIntervalReal=u,this._mainBaseInterval=u},Object.defineProperty(R.prototype,"baseInterval",{get:function(){return this._groupInterval?this._groupInterval:this._baseInterval?this._baseInterval:this._baseIntervalReal},set:function(u){JSON.stringify(this._baseInterval)!=JSON.stringify(u)&&(this._baseInterval=u,this._mainBaseInterval=u,le(u.count)||(u.count=1),this.invalidate(),this.postProcessSeriesDataItems())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"mainBaseInterval",{get:function(){return this._baseInterval?this._baseInterval:this._mainBaseInterval?this._mainBaseInterval:this._baseIntervalReal},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"skipEmptyPeriods",{get:function(){return this.getPropertyValue("skipEmptyPeriods")},set:function(u){if(u){var w=this.axisBreaks.template;w.startLine.disabled=!0,w.endLine.disabled=!0,w.fillShape.disabled=!0,w.breakSize=0}else this._gapBreaks&&(this.axisBreaks.clear(),this._gapBreaks=!1);this.setPropertyValue("skipEmptyPeriods",u)&&(this.invalidate(),this.postProcessSeriesDataItems(),this.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tooltipDateFormat",{get:function(){return this.getPropertyValue("tooltipDateFormat")},set:function(u){this.setPropertyValue("tooltipDateFormat",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"markUnitChange",{get:function(){return this.getPropertyValue("markUnitChange")},set:function(u){this.setPropertyValue("markUnitChange",u)&&this.invalidateData()},enumerable:!0,configurable:!0}),R.prototype.getTooltipText=function(u){var w,$=this.positionToDate(u);if($=od($,this.baseInterval.timeUnit,this.baseInterval.count,this._firstWeekDay,this._df.utc,new Date(this.min),this._df.timezoneMinutes,this._df.timezone),this.tooltipDate=$,Ee(this.tooltipDateFormat))w=this._df.format($,this.tooltipDateFormat,["day","month","week","year"].indexOf(this.baseInterval.timeUnit)==-1);else{var U=this.dateFormats.getKey(this.baseInterval.timeUnit);w=U?this._df.format($,U):this.getPositionLabel(u)}return this._adapterO?this._adapterO.apply("getTooltipText",w):w},R.prototype.roundPosition=function(u,w,$){var U=this.baseInterval,K=U.timeUnit,ie=U.count,ae=this.positionToDate(u);if(od(ae,K,ie,this._firstWeekDay,this._df.utc,void 0,this._df.timezoneMinutes,this._df.timezone),w>0&&xp(ae,K,w*ie,this._df.utc),$>0&&$<1&&ae.setTime(ae.getTime()+this.baseDuration*$),this.isInBreak(ae.getTime()))for(;ae.getTime()ie.getTime()&&Math.abs(ae.getTime()-K)Gt&&(Gt=Ji)}),this.groupMin[Qe]=dt,this.groupMax[Qe]=Gt),u=gt(u,dt,Gt),w=gt(w,dt,Gt),K&&(we&&(u=gt(u=w-ae,dt,Gt)),Re&&(w=gt(w=u+ae,dt,Gt))),Yt=(u-dt)/(Gt-dt),ai=(w-dt)/(Gt-dt),this.zoom({start:Yt,end:ai},$,U)}}else{var Yt=this.valueToPosition(u),ai=this.valueToPosition(w);this.zoom({start:Yt,end:ai},$,U)}},R.prototype.asIs=function(u){return u=="baseInterval"||j.prototype.asIs.call(this,u)},R.prototype.copyFrom=function(u){var w=this;j.prototype.copyFrom.call(this,u),this.dateFormats=u.dateFormats,this.periodChangeDateFormats=u.periodChangeDateFormats,this.groupIntervals.clear(),u.groupIntervals.each(function($){w.groupIntervals.push(fe({},$))}),this.gridIntervals.clear(),u.gridIntervals.each(function($){w.gridIntervals.push(fe({},$))}),u._baseInterval&&(this.baseInterval=u._baseInterval)},R.prototype.showTooltipAtPosition=function(u,w){var $=this;if(w||(u=this.toAxisPosition(u)),this.snapTooltip){var U,K=this.positionToDate(u).getTime();if(this.series.each(function(we){if(we.baseAxis==$){var Re=$.getSeriesDataItem(we,u,!0);if(Re){var $e=void 0;we.xAxis==$&&($e=Re.dateX),we.yAxis==$&&($e=Re.dateY),U?Math.abs(U.getTime()-K)>Math.abs($e.getTime()-K)&&(U=$e):U=$e}}}),U){var ie=U.getTime();U=od(new Date(ie),this.baseInterval.timeUnit,this.baseInterval.count,this._firstWeekDay,this._df.utc,void 0,this._df.timezoneMinutes,this._df.timezone),ie=U.getTime();var ae=this.renderer.tooltipLocation;ae==0&&(ae=1e-4),U=new Date(U.getTime()+this.baseDuration*ae),u=this.dateToPosition(U),this.chart.cursor&&this.chart.cursor.snapToSeries||this.series.each(function(we){var Re=we.dataItemsByAxis.getKey($.uid).getKey(ie+we.currentDataSetId),$e=we.showTooltipAtDataItem(Re);$e?$.chart._seriesPoints.push({series:we,point:$e}):(we.tooltipText||we.tooltipHTML)&&we.hideTooltip()})}}j.prototype.showTooltipAtPosition.call(this,u,!0)},Object.defineProperty(R.prototype,"snapTooltip",{get:function(){return this.getPropertyValue("snapTooltip")},set:function(u){this.setPropertyValue("snapTooltip",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"groupData",{get:function(){return this.getPropertyValue("groupData")},set:function(u){var w=this;this.setPropertyValue("groupData",u)&&(this.series.each(function($){$.setDataSet(""),u&&!$.dataGrouped&&$.inited&&($._baseInterval[w.uid]=w.mainBaseInterval,w.groupSeriesData($))}),this._currentDataSetId="",this._groupInterval=void 0,this.invalidate(),this.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"groupInterval",{get:function(){return this.getPropertyValue("groupInterval")},set:function(u){this.setPropertyValue("groupInterval",u)&&(this.invalidate(),this.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"groupCount",{get:function(){return this.getPropertyValue("groupCount")},set:function(u){this.setPropertyValue("groupCount",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"timezoneOffset",{get:function(){return this.getPropertyValue("timezoneOffset")},set:function(u){this.setPropertyValue("timezoneOffset",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"timezone",{get:function(){return this.getPropertyValue("timezone")},set:function(u){this.setPropertyValue("timezone",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"gridInterval",{get:function(){return this._gridInterval},enumerable:!0,configurable:!0}),R.prototype.makeGap=function(u,w){var $=u.component;if(u&&w&&!$.connect&&le($.autoGapCount)&&$.baseAxis==this){var U=u.dates["date"+this.axisLetter],K=w.dates["date"+this.axisLetter];if(U&&K&&U.getTime()-K.getTime()>$.autoGapCount*this.baseDuration)return!0}return!1},Object.defineProperty(R.prototype,"baseValue",{get:function(){return this.min},enumerable:!0,configurable:!0}),R}(vo);ui.registeredClasses.DateAxis=nc,ui.registeredClasses.DateAxisDataItem=fie;var Fd=function(j){function R(){var u=j.call(this)||this;return u.className="AxisRendererX",u.minGridDistance=120,u.opposite=!1,u.rotation=0,u.width=he(100),u.labels.template.horizontalCenter="middle",u.applyTheme(),u}return re(R,j),R.prototype.setAxis=function(u){j.prototype.setAxis.call(this,u),u.layout="vertical"},R.prototype.updateGridContainer=function(){var u=this.axis;if(u){var w=this.gridContainer;w.x=u.pixelX,w.width=u.axisLength}},R.prototype.processRenderer=function(){j.prototype.processRenderer.call(this);var u=this.axis;if(u){u.width instanceof J||(u.width=he(100)),this.line;var w=u.title;w.rotation=0,w.align="center",this.opposite?(this.line.toFront(),w.toBack()):(w.toFront(),this.toBack(),this.line.toBack())}},R.prototype.updateTooltip=function(){if(this.axis){var u=1e3,w=this.line.pixelX,$=this.line.pixelY,U=this.axisLength,K=u;this.opposite?this.inside||($=-1e3,K=u):this.inside&&($=-1e3,K=u),this.axis.updateTooltip("vertical",{x:w,y:$,width:U,height:K})}},R.prototype.updateLabelElement=function(u,w,$,U){Ee(U)||(U=u.location),w+=($-w)*U;var K=this.positionToPoint(w);u.isMeasured=!u.inside;var ie,ae=0,we=this.gridContainer.maxHeight;this.opposite?(u.inside?(ie="top",u.valign=="bottom"&&(ae=we,ie="bottom"),u.valign=="middle"&&(ae=we/2,ie="middle")):ie="bottom",K.y=ae):(u.inside?(ie="bottom",u.valign=="top"&&(ae=-we,ie="top"),u.valign=="middle"&&(ae=-we/2,ie="middle")):ie="top",K.y+=ae),u.rotation==0&&(u.verticalCenter=ie),this.positionItem(u,K),this.toggleVisibility(u,w,this.minLabelPosition,this.maxLabelPosition)},Object.defineProperty(R.prototype,"axisLength",{get:function(){var u=this.axis;return u.measuredWidth-u.pixelPaddingRight-u.pixelPaddingLeft||0},enumerable:!0,configurable:!0}),R.prototype.positionToPoint=function(u,w){return{x:this.positionToCoordinate(u),y:0}},R.prototype.pointToPosition=function(u){return this.coordinateToPosition(u.x,u.y)},R.prototype.getPositionRangePath=function(u,w){var $=gt(this.positionToCoordinate(u),0,this.axisLength),U=gt(this.positionToCoordinate(w),0,this.axisLength),K=Math.abs(U-$),ie=this.getHeight();return uC({x:Math.min($,U),y:0,width:K,height:ie},!0)},R.prototype.updateBreakElement=function(u){j.prototype.updateBreakElement.call(this,u);var w=u.startLine,$=u.endLine,U=u.fillShape,K=u.startPoint,ie=u.endPoint,ae=u.pixelMarginLeft,we=this.getHeight()-u.pixelMarginTop-u.pixelMarginBottom;K.x=gt(K.x,-1,this.axisLength+1),ie.x=gt(ie.x,-1,this.axisLength+1),K.x==ie.x&&(K.x<0||K.x>this.axisLength)?u.fillShape.__disabled=!0:u.fillShape.__disabled=!1,w.y=ae,w.width=0,w.height=we,$.y=ae,$.width=0,$.height=we,U.height=we,U.width=Math.abs(ie.x-K.x),U.y=ae,U.x=K.x},R.prototype.updateGridElement=function(u,w,$){w+=($-w)*u.location;var U=this.positionToPoint(w);u.path=ln({x:0,y:0})+br({x:0,y:this.getHeight()}),this.positionItem(u,U),this.toggleVisibility(u,w,0,1)},R.prototype.updateTickElement=function(u,w,$){w+=($-w)*u.location;var U=this.positionToPoint(w),K=u.length;U.y=wp({x:0,y:this.line.pixelY},this.line.parent,this.gridContainer).y,this.opposite?K*=u.inside?1:-1:K*=u.inside?-1:1,u.path=ln({x:0,y:0})+br({x:0,y:K}),this.positionItem(u,U),this.toggleVisibility(u,w,0,1)},R.prototype.updateAxisLine=function(){this.line.path=ln({x:0,y:0})+br({x:this.axisLength,y:0})},R.prototype.updateBaseGridElement=function(){j.prototype.updateBaseGridElement.call(this);var u=this.axis,w=this.getHeight(),$=this.axisLength,U=this.baseGrid,K=u.basePoint.x;if(K<-.2||K>$+.2)U.hide(0);else{var ie=wp({x:0,y:0},this.gridContainer,U.parent).y;U.path=ln({x:0,y:0})+br({x:0,y:w}),U.moveTo({x:K,y:ie}),U.show(0)}},R.prototype.createBreakSprites=function(u){u.startLine=new Tr,u.endLine=new Tr;var w=new e8;w.setWavedSides(!1,!0,!1,!0),u.fillShape=w},R.prototype.toAxisPosition=function(u){var w=u,$=this.axis;if($){var U=$.relativePositionSprite,K=$.pixelX;if(U?K=wp({x:this.pixelX,y:0},this.parent,U).x:U=$.parent,U)return(w-K/U.innerWidth)/($.axisLength/U.innerWidth)}return u},R.prototype.updateBullet=function(u,w,$){var U=.5;u instanceof V4&&(U=u.location),w+=($-w)*U;var K=this.positionToPoint(w);K.y=wp({x:0,y:this.line.pixelY},this.line.parent,this.gridContainer).y,this.positionItem(u,K),this.toggleVisibility(u,w,0,1)},R}(u8);ui.registeredClasses.AxisRendererX=Fd,Zd.push({relevant:Af.heightXS,state:function(j,R){if(j instanceof Fd){var u=j.states.create(R);return u.properties.inside=!0,u.properties.maxLabelPosition=.9,u.properties.minLabelPosition=.1,u}return null}}),Zd.push({relevant:Af.heightXXS,state:function(j,R){if(j instanceof Fd){var u=j.states.create(R);return u.properties.disabled=!0,u}return null}});var mie=function(j){function R(){var u=j.call(this)||this;return u.className="CategoryAxisBreak",u.properties.startLocation=.5,u.properties.endLocation=.5,u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"startPosition",{get:function(){if(this.axis)return this.axis.indexToPosition(this.adjustedStartValue,this.startLocation)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endPosition",{get:function(){if(this.axis)return this.axis.indexToPosition(this.adjustedEndValue,this.endLocation)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startCategory",{get:function(){return this.getPropertyValue("startCategory")},set:function(u){this.setPropertyValue("startCategory",u)&&this.axis&&(this.axis.invalidateDataItems(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endCategory",{get:function(){return this.getPropertyValue("endCategory")},set:function(u){this.setPropertyValue("endCategory",u)&&this.axis&&(this.axis.invalidateDataItems(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startValue",{get:function(){var u=this.getPropertyValue("startCategory");return u?this.axis.categoryToIndex(u):this.getPropertyValue("startValue")},set:function(u){this.setPropertyValue("startValue",u)&&this.axis&&(this.axis.invalidateDataItems(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endValue",{get:function(){var u=this.getPropertyValue("endCategory");return u?this.axis.categoryToIndex(u):this.getPropertyValue("endValue")},set:function(u){this.setPropertyValue("endValue",u)&&this.axis&&(this.axis.invalidateDataItems(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startLocation",{get:function(){return this.getPropertyValue("startLocation")},set:function(u){this.setPropertyValue("startLocation",u)&&this.axis&&(this.axis.invalidateDataItems(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endLocation",{get:function(){return this.getPropertyValue("endLocation")},set:function(u){this.setPropertyValue("endLocation",u)&&this.axis&&(this.axis.invalidateDataItems(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),R}(a8);ui.registeredClasses.CategoryAxisBreak=mie;var Nx=function(j){function R(){var u=j.call(this)||this;return u.seriesDataItems={},u.className="CategoryAxisDataItem",u.text="{category}",u.locations.category=0,u.locations.endCategory=1,u.deltaPosition=0,u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"category",{get:function(){return this._adapterO&&this._adapterO.isEnabled("category")?this._adapterO.apply("category",this.properties.category):this.properties.category},set:function(u){var w=this.properties.category;this.setProperty("category",u),Ee(w)&&w!=u&&this.component&&this.component.validateDataElement(this)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endCategory",{get:function(){return this.properties.endCategory},set:function(u){this.setProperty("endCategory",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"deltaPosition",{get:function(){return this.properties.deltaCoordinate},set:function(u){u!=this.properties.deltaCoordinate&&(this.setProperty("deltaCoordinate",u),this.component&&(this.component.invalidateDataItems(),this.component.invalidateSeries()))},enumerable:!0,configurable:!0}),R}(dC),$h=function(j){function R(){var u=j.call(this)||this;u.dataItemsByCategory=new fa,u.className="CategoryAxis",u.axisFieldName="category",u._lastDataItem=u.createDataItem(),u._lastDataItem.component=u,u._disposers.push(u._lastDataItem),u.applyTheme();var w=u.dataItemsByCategory;return u.addDisposer(u.mainDataSet.events.on("removed",function($){w.removeKey($.oldValue.category)})),u}return re(R,j),R.prototype.createDataItem=function(){return new Nx},R.prototype.createAxisBreak=function(){return new mie},R.prototype.processSeriesDataItem=function(u,w){j.prototype.processSeriesDataItem.call(this,u,w);var $=u["category"+this.axisLetter];if(Ee($)){var U=this.dataItemsByCategory.getKey($);if(U){var K=u.component.uid,ie=U.seriesDataItems[K];ie||(ie=[],U.seriesDataItems[K]=ie),ie.push(u)}}else u.component.dataItems.remove(u)},R.prototype.validateDataRange=function(){var u=this;j.prototype.validateDataRange.call(this),pr(this._series.iterator(),function(w){if(w.xAxis instanceof R&&w.yAxis instanceof R)w.invalidateDataRange();else{var $=u.positionToIndex(u.start),U=u.positionToIndex(u.end);U>=u.dataItems.length&&U--;for(var K=w.uid,ie=void 0,ae=void 0,we=$;we<=U;we++){var Re=u.dataItems.getIndex(we);if(Re){var $e=Re.seriesDataItems[K];if($e)for(var Xe=0;Xe<$e.length;Xe++){var Qe=$e[Xe];if(Qe){var dt=Qe.index;(!le(ie)||dtae)&&(ae=dt)}}}}le(ie)?w.startIndex=ie:w.start=u.start,le(ae)?w.endIndex=ae+1:w.end=u.end,u._axisBreaks&&u._axisBreaks.length>0&&w.invalidateDataRange()}})},R.prototype.validate=function(){var u=this;j.prototype.validate.call(this);var w=this.dataItems.length,$=gt(Math.floor(this.start*w-1),0,w),U=gt(Math.ceil(this.end*w),0,w);this.renderer.invalid&&this.renderer.validate();var K=this.renderer.axisLength/Math.max(this.renderer.minGridDistance,1/Number.MAX_SAFE_INTEGER),ie=Math.min(this.dataItems.length,Math.ceil((U-$)/K));if(this._startIndex=Math.floor($/ie)*ie,this._endIndex=Math.ceil(this.end*w),this.fixAxisBreaks(),this._startIndex==this._endIndex&&this._endIndex++,this._frequency=ie,!(this.axisLength<=0)){this.maxZoomFactor=this.dataItems.length,this.dataItems.length<=0&&(this.maxZoomFactor=1),this.resetIterators(),$=ve(0,this._startIndex-this._frequency),U=W(this.dataItems.length,this._endIndex+this._frequency);for(var ae=0,we=0;we<$;we++)($e=this.dataItems.getIndex(we)).__disabled=!0;we=U;for(var Re=this.dataItems.length;we0)for(Gt=Qe;Gt<=dt;Gt+=Yt){var oi;(oi=u.dataItems.getIndex(Gt)).__disabled=!1,u.appendDataItem(oi),u.validateDataElement(oi,ai),ai++}}}),this.validateBreaks(),this.validateAxisRanges(),this.ghostLabel.invalidate(),this.renderer.invalidateLayout()}},R.prototype.validateDataElement=function(u,w,$){j.prototype.validateDataElement.call(this,u),u.itemIndex=this._axisItemCount,this._axisItemCount++;var U=this.renderer;le($)||($=this.categoryToIndex(u.category));var K=this.categoryToIndex(u.endCategory);le(K)||(K=$);var ie,ae,we,Re=this.indexToPosition($,u.locations.category),$e=this.indexToPosition(K,u.locations.endCategory);u.position=Re,u.isRange&&(ie=K,ae=this.indexToPosition($,u.locations.category),we=this.indexToPosition(ie,u.locations.endCategory)),u.point=U.positionToPoint(Re);var Xe=u.tick;Xe&&!Xe.disabled&&U.updateTickElement(Xe,Re,$e);var Qe=u.grid;Qe&&!Qe.disabled&&U.updateGridElement(Qe,Re,$e);var dt=u.label;dt&&!dt.disabled&&(u.isRange&&dt.text!=null||(u.text=u.text),U.updateLabelElement(dt,Re,$e),(U instanceof w1&&u.label.measuredWidth>this.ghostLabel.measuredWidth||U instanceof Fd&&u.label.measuredHeight>this.ghostLabel.measuredHeight)&&(u.label.html?this.ghostLabel.html=u.label.currentText:this.ghostLabel.text=u.label.currentText));var Gt=u.axisFill;Gt&&!Gt.disabled&&(u.isRange||(ie=$+this._frequency,ae=this.indexToPosition($,Gt.location),we=this.indexToPosition(ie,Gt.location)),U.updateFillElement(Gt,ae,we),u.isRange||this.fillRule(u,w)),u.bullet&&U.updateBullet(u.bullet,Re,$e);var Yt=u.mask;Yt&&U.updateFillElement(Yt,ae,we)},R.prototype.disposeData=function(){this.dataItemsByCategory.clear(),j.prototype.disposeData.call(this)},R.prototype.processDataItem=function(u,w){u&&(j.prototype.processDataItem.call(this,u,w),Ee(u.category)&&this.dataItemsByCategory.setKey(u.category,u))},R.prototype.getDataItem=function(u){var w=u[this.dataFields.category];if(Ee(w))return this.dataItemsByCategory.getKey(w)||this.dataItems.create()},R.prototype.indexToPosition=function(u,w){le(w)||(w=.5);var $=this.startIndex,U=this.endIndex,K=this.adjustDifference($,U),ie=this.startLocation;K-=ie,K-=1-this.endLocation,this._axisBreaks&&Na(this._axisBreaks.iterator(),function(Re){var $e=Re.adjustedStartValue,Xe=Re.adjustedEndValue;if(u<$||!le($e)||!le(Xe))return!1;if(b({start:$e,end:Xe},{start:$,end:U})){$e=Math.max($,$e),Xe=Math.min(U,Xe);var Qe=Re.breakSize;u>Xe?$+=(Xe-$e)*(1-Qe):u<$e||(u=$e+(u-$e)*Qe)}return!0});var ae=0,we=this.dataItems.getIndex(u);return we&&(ae=we.deltaPosition),Ve(ae+(u+w-ie-$)/K,5)},R.prototype.categoryToPosition=function(u,w){var $=this.categoryToIndex(u);return this.indexToPosition($,w)},R.prototype.categoryToPoint=function(u,w){var $=this.categoryToPosition(u,w),U=this.renderer.positionToPoint($),K=this.renderer.positionToAngle($);return{x:U.x,y:U.y,angle:K}},R.prototype.anyToPoint=function(u,w){return this.categoryToPoint(u,w)},R.prototype.anyToPosition=function(u,w){return this.categoryToPosition(u,w)},R.prototype.categoryToIndex=function(u){if(Ee(u)){var w=this.dataItemsByCategory.getKey(u);if(w)return w.index}},R.prototype.zoomToCategories=function(u,w){this.zoomToIndexes(this.categoryToIndex(u),this.categoryToIndex(w)+1)},R.prototype.getAnyRangePath=function(u,w,$,U){var K=this.categoryToPosition(u,$),ie=this.categoryToPosition(w,U);return this.getPositionRangePath(K,ie)},R.prototype.roundPosition=function(u,w){var $=this.positionToIndex(u);return this.indexToPosition($,w)},R.prototype.getFirstSeriesDataItem=function(u,w){for(var $=0;$=0;$--){var U=u.dataItems.getIndex($);if(u.xAxis==this&&U.categoryX==w||u.yAxis==this&&U.categoryY==w)return U}},R.prototype.getSeriesDataItemByCategory=function(u,w){var $,U=this;return w.dataItems.each(function(K){w.xAxis==U?K.categoryX==u&&($=K):w.yAxis==U&&K.categoryY==u&&($=K)}),$},R.prototype.getSeriesDataItem=function(u,w,$){var U=this;if(le(w)){var K=this.positionToIndex(w);K>=this.dataItems.length&&K--;var ie=this.dataItems.getIndex(K);if(ie){var ae,we=ie.category,Re=u.dataItems.getIndex(K);return Re&&(u.xAxis==this&&Re.categoryX==we||u.yAxis==this&&Re.categoryY==we)?Re:(u.dataItems.each(function($e){u.xAxis==U&&$e.categoryX==we&&(ae||(ae=$e),Math.abs(K-ae.index)>Math.abs(K-$e.index)&&(ae=$e)),u.yAxis==U&&$e.categoryY==we&&(ae||(ae=$e),Math.abs(K-ae.index)>Math.abs(K-$e.index)&&(ae=$e))}),ae)}}},R.prototype.getX=function(u,w,$,U,K){var ie=this.getPositionX(u,w,$,U,K);return Pe(ie)?this.basePoint.x:this.renderer.positionToPoint(ie).x},R.prototype.getPositionX=function(u,w,$,U,K){var ie;return Ee(w)&&(ie=this.categoryToPosition(u.categories[w],$)),K&&(ie=gt(ie,K.start,K.end)),ie},R.prototype.getY=function(u,w,$,U,K){var ie=this.getPositionY(u,w,$,U,K);return Pe(ie)?this.basePoint.y:this.renderer.positionToPoint(ie).y},R.prototype.getPositionY=function(u,w,$,U,K){var ie;return Ee(w)&&(ie=this.categoryToPosition(u.categories[w],$)),K&&(ie=gt(ie,K.start,K.end)),ie},R.prototype.getAngle=function(u,w,$,U,K){var ie=this.categoryToPosition(u.categories[w],$);return K&&(ie=gt(ie,K.start,K.end)),this.positionToAngle(ie)},R.prototype.getCellStartPosition=function(u){return this.roundPosition(u,0)},R.prototype.getCellEndPosition=function(u){return this.roundPosition(u,1)},R.prototype.getTooltipText=function(u){var w=this.dataItems.getIndex(this.positionToIndex(u));if(w)return this.tooltipDataItem=w,this.tooltip.dataItem=w,this.tooltipText?this.tooltipText:this._adapterO?this._adapterO.apply("getTooltipText",w.category):w.category},R.prototype.positionToIndex=function(u){(u=Ve(u,10))<0&&(u=0),u>1&&(u=1);var w=this.startIndex,$=this.endIndex,U=$-w-this.startLocation-(1-this.endLocation);u+=1/U*this.startLocation;var K=null;return this._axisBreaks&&Na(this._axisBreaks.iterator(),function(ie){var ae=ie.startPosition,we=ie.endPosition,Re=ie.adjustedStartValue,$e=ie.adjustedEndValue;Re=ve(Re,w),$e=W($e,$);var Xe=ie.breakSize;if(U-=($e-Re)*(1-Xe),u>we)w+=($e-Re)*(1-Xe);else if(!(u=this.dataItems.length&&(K=this.dataItems.length-1),K},R.prototype.positionToCategory=function(u){return this.getPositionLabel(u)},R.prototype.getPositionLabel=function(u){var w=this.dataItems.getIndex(this.positionToIndex(u));if(w)return w.category},Object.defineProperty(R.prototype,"basePoint",{get:function(){return this.renderer.positionToPoint(1)},enumerable:!0,configurable:!0}),R.prototype.initRenderer=function(){j.prototype.initRenderer.call(this),this.renderer.baseGrid.disabled=!0},Object.defineProperty(R.prototype,"frequency",{get:function(){return this._frequency},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"sortBySeries",{get:function(){return this.getPropertyValue("sortBySeries")},set:function(u){this.setPropertyValue("sortBySeries",u,!0)},enumerable:!0,configurable:!0}),R.prototype.processConfig=function(u){u&&Ee(u.sortBySeries)&&ct(u.sortBySeries)&&(this.map.hasKey(u.sortBySeries)?u.sortBySeries=this.map.getKey(u.sortBySeries):(this.addDelayedMap("sortBySeries",u.sortBySeries),delete u.sortBySeries)),j.prototype.processConfig.call(this,u)},R}(l8);ui.registeredClasses.CategoryAxis=$h,ui.registeredClasses.CategoryAxisDataItem=Nx;var eg=function(j){function R(){var u=j.call(this)||this;return u.className="XYSeriesDataItem",u.values.customValue={},u.values.valueX={stack:0},u.values.valueY={stack:0},u.values.openValueX={},u.values.openValueY={},u.values.dateX={},u.values.dateY={},u.values.openDateX={},u.values.openDateY={},u.setLocation("dateX",.5,0),u.setLocation("dateY",.5,0),u.setLocation("categoryX",.5,0),u.setLocation("categoryY",.5,0),u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"valueX",{get:function(){return this.values.valueX.value},set:function(u){this.setValue("valueX",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"customValue",{get:function(){return this.values.customValue.value},set:function(u){this.setValue("customValue",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"valueY",{get:function(){return this.values.valueY.value},set:function(u){this.setValue("valueY",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dateX",{get:function(){return this.getDate("dateX")},set:function(u){this.setDate("dateX",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dateY",{get:function(){return this.getDate("dateY")},set:function(u){this.setDate("dateY",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"categoryX",{get:function(){return this.categories.categoryX},set:function(u){this.setCategory("categoryX",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"categoryY",{get:function(){return this.categories.categoryY},set:function(u){this.setCategory("categoryY",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"openValueX",{get:function(){return this.values.openValueX.value},set:function(u){this.setValue("openValueX",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"openValueY",{get:function(){return this.values.openValueY.value},set:function(u){this.setValue("openValueY",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"openDateX",{get:function(){return this.getDate("openDateX")},set:function(u){this.setDate("openDateX",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"openDateY",{get:function(){return this.getDate("openDateY")},set:function(u){this.setDate("openDateY",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"openCategoryX",{get:function(){return this.categories.openCategoryX},set:function(u){this.setCategory("openCategoryX",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"openCategoryY",{get:function(){return this.categories.openCategoryY},set:function(u){this.setCategory("openCategoryY",u)},enumerable:!0,configurable:!0}),R.prototype.getMin=function(u,w,$){var U,K=this;return le($)||($=0),mi(u,function(ie){var ae;ae=w?K.getWorkingValue(ie):K.getValue(ie),((ae+=$)U||!le(U))&&(U=ae)}),U},R}(s8),NI=function(j){function R(){var u=j.call(this)||this;return u.groupFields={},u._xAxis=new Jn,u._yAxis=new Jn,u._xValueFields=[],u._yValueFields=[],u._baseInterval={},u.dataGrouped=!1,u.usesShowFields=!1,u._dataSetChanged=!1,u._maxxX=1e5,u._maxxY=1e5,u._propertiesChanged=!1,u.outOfRange=!1,u.className="XYSeries",u.isMeasured=!1,u.groupFields.valueX="close",u.groupFields.valueY="close",u.groupFields.customValue="close",u.groupFields.openValueX="open",u.groupFields.openValueY="open",u.cursorTooltipEnabled=!0,u.cursorHoverEnabled=!0,u.excludeFromTotal=!1,u.mainContainer.mask=new so,u.mainContainer.mask.setElement(u.paper.add("path")),u.stacked=!1,u.snapTooltip=!1,u._showBullets=!1,u.tooltip.pointerOrientation="horizontal",u.properties.stackToNegative=!0,u.hideTooltipWhileZooming=!0,u.setPropertyValue("maskBullets",!0),u.tooltip.events.on("hidden",function(){u.returnBulletDefaultState()},void 0,!1),u._disposers.push(u._xAxis),u._disposers.push(u._yAxis),u.observe(gc,function(){u.inited&&(u._propertiesChanged=!0,u.legendDataItem&&(u.legendDataItem.childrenCreated=!1),u.chart&&u.chart.legend&&u.chart.legend.invalidateDataItems(),u.invalidate())},void 0,!1),u.applyTheme(),u}return re(R,j),R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),Ee(this.readerTitle)||(this.readerTitle=this.language.translate("X/Y Series"))},R.prototype.createDataItem=function(){return new eg},R.prototype.resetExtremes=function(){this._tmin.clear(),this._tmax.clear(),this._smin.clear(),this._smax.clear()},R.prototype.dataChangeUpdate=function(){this.dataGrouped=!1,this._baseInterval={},this._currentDataSetId="",this.resetExtremes(),this.xAxis&&this.xAxis.seriesDataChangeUpdate(this),this.yAxis&&this.yAxis.seriesDataChangeUpdate(this)},R.prototype.validateData=function(){this._baseInterval={};var u=this.dataFields;if(u.valueYShow||u.openValueXShow||u.openValueXShow||u.openValueYShow?this.usesShowFields=!0:this.usesShowFields=!1,this.defineFields(),this.data.length>0&&this.dataChangeUpdate(),j.prototype.validateData.call(this),this.updateItemReaderText(),this.chart&&(!Ee(this.dataFields[this._xField])||!Ee(this.dataFields[this._yField])))throw Error('Data fields for series "'+(this.name?this.name:this.uid)+'" are not properly defined.');this.inited&&this.isHidden&&this.hide(0),this.dataGrouped=!1},R.prototype.processDataItem=function(u,w){try{j.prototype.processDataItem.call(this,u,w),this.xAxis.processSeriesDataItem(u,"X"),this.yAxis.processSeriesDataItem(u,"Y"),this.setInitialWorkingValues(u)}catch($){this._chart&&this._chart.raiseCriticalError($)}},R.prototype.updateDataItem=function(u){j.prototype.updateDataItem.call(this,u),this.xAxis.processSeriesDataItem(u,"X"),this.yAxis.processSeriesDataItem(u,"Y")},R.prototype.setInitialWorkingValues=function(u){},R.prototype.disposeData=function(){j.prototype.disposeData.call(this);var u=this.xAxis,w=this.yAxis;if(u){var $=this.dataItemsByAxis.getKey(u.uid);$&&$.clear(),u instanceof $h&&this.clearCatAxis(u)}if(w){var U=this.dataItemsByAxis.getKey(w.uid);U&&U.clear(),w instanceof $h&&this.clearCatAxis(w)}},R.prototype.clearCatAxis=function(u){var w=this.uid;u.dataItems.each(function($){$.seriesDataItems[w]&&($.seriesDataItems[w]=[])})},R.prototype.defineFields=function(){var u=this.xAxis,w=this.yAxis;if(u&&w){var $=u.axisFieldName,U=$+"X",K="open"+ic($)+"X",ie=w.axisFieldName,ae=ie+"Y",we="open"+ic(ie)+"Y";this._xField=U,this._yField=ae,this.dataFields[K]&&(this._xOpenField=K),this.dataFields[we]&&(this._yOpenField=we),this.dataFields[we]||this.baseAxis!=w||(this._yOpenField=ae),this.dataFields[K]||this.baseAxis!=u||(this._xOpenField=U),this.stacked&&this.baseAxis==u&&(this._xOpenField=U),this.stacked&&this.baseAxis==w&&(this._yOpenField=ae),u instanceof $h&&w instanceof $h&&(this._yOpenField||(this._yOpenField=ae)),this._xValueFields=[],this._yValueFields=[],this.addValueField(u,this._xValueFields,this._xField),this.addValueField(u,this._xValueFields,this._xOpenField),this.addValueField(w,this._yValueFields,this._yField),this.addValueField(w,this._yValueFields,this._yOpenField)}},R.prototype.addValueField=function(u,w,$){u instanceof vo&&Ee(this.dataFields[$])&&w.indexOf($)==-1&&w.push($)},R.prototype.setCategoryAxisField=function(u,w){Ee(this.dataFields[u])||(this.dataFields[u]=w.dataFields.category)},R.prototype.setDateAxisField=function(u,w){Ee(this.dataFields[u])||(this.dataFields[u]=w.dataFields.date)},R.prototype.afterDraw=function(){j.prototype.afterDraw.call(this),this.createMask()},R.prototype.createMask=function(){if(this.mainContainer.mask){var u=this.getMaskPath();pr(this.axisRanges.iterator(),function(w){w.axisFill.fillPath&&(w.axisFill.validate(),u+=w.axisFill.fillPath)}),this.mainContainer.mask.path=u}},R.prototype.getMaskPath=function(){return this.xAxis&&this.yAxis?uC({x:0,y:0,width:this.xAxis.axisLength,height:this.yAxis.axisLength}):""},R.prototype.getAxisField=function(u){return u==this.xAxis?this.xField:u==this.yAxis?this.yField:void 0},R.prototype.validateDataItems=function(){var u=this.chart;u&&(this._maxxX=ve(1e5,2*u.plotContainer.maxWidth),this._maxxY=ve(1e5,2*u.plotContainer.maxHeight));var w=this.xAxis,$=this.yAxis;w&&$&&(w.updateAxisBySeries(),$.updateAxisBySeries()),j.prototype.validateDataItems.call(this),w&&$&&(w.postProcessSeriesDataItems(this),$.postProcessSeriesDataItems(this))},R.prototype.validateDataRange=function(){var u=this.xAxis,w=this.yAxis;u&&w&&(u.dataRangeInvalid&&u.validateDataRange(),w.dataRangeInvalid&&w.validateDataRange()),j.prototype.validateDataRange.call(this)},R.prototype.validate=function(){var u=this.xAxis,w=this.yAxis;if(u&&w){u.invalid&&u.validate(),w.invalid&&w.validate(),this.y=w.pixelY,this.x=u.pixelX,this._showBullets=!0;var $=this.minBulletDistance;le($)&&this.baseAxis.axisLength/(this.endIndex-this.startIndex)<$&&(this._showBullets=!1)}if(this.updateTooltip(),!(u instanceof nc&&u.groupData&&!this.dataGrouped||w instanceof nc&&w.groupData&&!this.dataGrouped)){j.prototype.validate.call(this);var U=this.chart,K=this.maskBullets;U&&K&&U.className=="XYChart"&&(U.leftAxesContainer.layout!="vertical"&&U.rightAxesContainer.layout!="vertical"||(this.yAxis?this.bulletsContainer.mask=this.yAxis.renderer.gridContainer:this.bulletsContainer.mask=void 0),U.topAxesContainer.layout!="horizontal"&&U.bottomAxesContainer.layout!="horizontal"||(this.xAxis?this.bulletsContainer.mask=this.xAxis.renderer.gridContainer:this.bulletsContainer.mask=void 0))}},Object.defineProperty(R.prototype,"xAxis",{get:function(){if(this.chart){if(!this._xAxis.get()){var u=this.chart.xAxes.getIndex(0);if(!u)throw Error("There are no X axes on chart.");this.xAxis=u}return this._xAxis.get()}},set:function(u){this.setXAxis(u)},enumerable:!0,configurable:!0}),R.prototype.setXAxis=function(u){var w=this._xAxis.get();w!=u&&(w&&(this.dataItemsByAxis.removeKey(w.uid),this._xAxis.dispose(),w.series.removeValue(this)),this._xAxis.set(u,u.registerSeries(this)),this.dataItemsByAxis.setKey(u.uid,new fa),this.invalidateData())},Object.defineProperty(R.prototype,"yAxis",{get:function(){if(this.chart){if(!this._yAxis.get()){var u=this.chart.yAxes.getIndex(0);if(!u)throw Error("There are no Y axes on chart.");this.yAxis=u}return this._yAxis.get()}},set:function(u){this.setYAxis(u)},enumerable:!0,configurable:!0}),R.prototype.setYAxis=function(u){var w=this._yAxis.get();w!=u&&(w&&(this.dataItemsByAxis.removeKey(w.uid),this._yAxis.dispose(),w.series.removeValue(this)),this._yAxis.set(u,u.registerSeries(this)),u.chart instanceof G0&&u.chart.handleYAxisSet(this),this.dataItemsByAxis.setKey(u.uid,new fa),this.invalidateData())},Object.defineProperty(R.prototype,"baseAxis",{get:function(){var u=this.xAxis,w=this.yAxis;return!this._baseAxis&&u&&w&&(w instanceof nc&&(this._baseAxis=w),u instanceof nc&&(this._baseAxis=u),w instanceof $h&&(this._baseAxis=w),u instanceof $h&&(this._baseAxis=u),this._baseAxis||(this._baseAxis=u)),this._baseAxis},set:function(u){this._baseAxis!=u&&(this._baseAxis=u,this.invalidate())},enumerable:!0,configurable:!0}),R.prototype.addData=function(u,w,$){j.prototype.addData.call(this,u,w,$),this.scrollbarSeries&&(this.scrollbarSeries.addData(u,w,!0),this.scrollbarSeries._parseDataFrom=this._parseDataFrom)},R.prototype.setData=function(u){j.prototype.setData.call(this,u),this.scrollbarSeries&&this.scrollbarSeries.setData(u)},R.prototype.setDataSet=function(u){var w=j.prototype.setDataSet.call(this,u);if(w){this._dataSetChanged=!0;var $=this.dataItems;if(this.resetExtremes(),$&&$.length>0){var U=this.xAxis,K=this.yAxis;this._prevStartIndex=void 0,this._prevEndIndex=void 0,this._startIndex=void 0,this._endIndex=void 0,this.appeared||this.processValues(!1),U instanceof nc&&U==this.baseAxis&&(this._tmin.setKey(U.uid,$.getIndex(0).dateX.getTime()),this._tmax.setKey(U.uid,$.getIndex($.length-1).dateX.getTime()),this.dispatch("extremeschanged")),K instanceof nc&&K==this.baseAxis&&(this._tmin.setKey(K.uid,$.getIndex(0).dateY.getTime()),this._tmax.setKey(K.uid,$.getIndex($.length-1).dateY.getTime()),this.dispatch("extremeschanged"))}}return w},R.prototype.processValues=function(u){j.prototype.processValues.call(this,u);var w=this.xAxis,$=this.yAxis;if(w&&$){var U=this.dataItems,K=1/0,ie=-1/0,ae=1/0,we=-1/0,Re=this.startIndex,$e=this.endIndex,Xe=Re,Qe=$e;u||(Re=0,$e=this.dataItems.length);for(var dt=Re;dt<$e;dt++){var Gt=U.getIndex(dt);this.getStackValue(Gt,u);var Yt=Gt.getValue("valueX","stack"),ai=Gt.getValue("valueY","stack");K=W(Gt.getMin(this._xValueFields,u,Yt),K),ae=W(Gt.getMin(this._yValueFields,u,ai),ae),ie=ve(Gt.getMax(this._xValueFields,u,Yt),ie),we=ve(Gt.getMax(this._yValueFields,u,ai),we),this.stacked&&(this.baseAxis==w&&(aiwe&&(we=ai)),this.baseAxis==$&&(Ytie&&(ie=Yt)))}w.processSeriesDataItems(),$.processSeriesDataItems();var oi=w.uid,Ui=$.uid;if(this.xAxis instanceof vo&&(K==1/0||ie==-1/0))return this._smin.setKey(oi,void 0),this._smax.setKey(oi,void 0),void this.dispatchImmediately("selectionextremeschanged");if(this.yAxis instanceof vo&&(ae==1/0||we==-1/0))return this._smin.setKey(Ui,void 0),this._smax.setKey(Ui,void 0),void this.dispatchImmediately("selectionextremeschanged");if(!u&&(this._tmin.getKey(oi)!=K||this._tmax.getKey(oi)!=ie||this._tmin.getKey(Ui)!=ae||this._tmax.getKey(Ui)!=we)){this._tmin.setKey(oi,K),this._tmax.setKey(oi,ie),this._tmin.setKey(Ui,ae),this._tmax.setKey(Ui,we);var Ji=this.stackedSeries;Ji&&(Ji.isDisposed()?this.stackedSeries=void 0:Ji.processValues(!1)),this.dispatchImmediately("extremeschanged")}if(Re!=Xe||$e!=Qe)for(K=1/0,ie=-1/0,ae=1/0,we=-1/0,dt=Xe;dtwe&&(we=ai)),this.baseAxis==$&&(Ytie&&(ie=Yt)));if(this.xAxis instanceof vo&&(K==1/0||ie==-1/0))return this._smin.setKey(oi,void 0),this._smax.setKey(oi,void 0),void this.dispatchImmediately("selectionextremeschanged");if(this.yAxis instanceof vo&&(ae==1/0||we==-1/0))return this._smin.setKey(Ui,void 0),this._smax.setKey(Ui,void 0),void this.dispatchImmediately("selectionextremeschanged");if((this._smin.getKey(oi)!=K||this._smax.getKey(oi)!=ie||this._smin.getKey(Ui)!=ae||this._smax.getKey(Ui)!=we)&&(this._smin.setKey(oi,K),this._smax.setKey(oi,ie),this._smin.setKey(Ui,ae),this._smax.setKey(Ui,we),this.appeared||this.start!=0||this.end!=1||this.dataItems!=this.mainDataSet)){var Si,Hi,nr=!1;$ instanceof vo&&!($ instanceof nc)&&((!le(Si=this._tmin.getKey(Ui))||(this.usesShowFields||this._dataSetChanged||w instanceof nc&&w.groupData&&this.isShowing)&&aeHi||this.stackedSeries&&!this.isHidden)&&(this._tmax.setKey(Ui,we),nr=!0)),w instanceof vo&&!(w instanceof nc)&&((!le(Si=this._tmin.getKey(oi))||(this.usesShowFields||this._dataSetChanged||$ instanceof nc&&$.groupData&&this.isShowing)&&KHi||this.stackedSeries&&!this.isHidden)&&(this._tmax.setKey(oi,ie),nr=!0)),nr&&this.dispatchImmediately("extremeschanged"),this.start==0&&this.end==1&&(this._dataSetChanged=!1),this.dispatchImmediately("selectionextremeschanged")}!u&&this.stacked&&this.processValues(!0)}},R.prototype.hideTooltip=function(u){j.prototype.hideTooltip.call(this,u),this.returnBulletDefaultState(),this._prevTooltipDataItem=void 0},R.prototype.showTooltipAtPosition=function(u,w){var $;if(this.visible&&!this.isHiding&&!this.isShowing){var U=this._xAxis.get(),K=this._yAxis.get();U==this.baseAxis&&($=U.getSeriesDataItem(this,U.toAxisPosition(u),this.snapTooltip)),K==this.baseAxis&&($=K.getSeriesDataItem(this,K.toAxisPosition(w),this.snapTooltip));var ie=this.showTooltipAtDataItem($);if(ie)return ie;if(!this.tooltipText&&!this.tooltipHTML)return}this.hideTooltip()},R.prototype.getAdjustedXLocation=function(u,w,$){return u.locations[w]},R.prototype.getAdjustedYLocation=function(u,w,$){return u.locations[w]},R.prototype.showTooltipAtDataItem=function(u){var w,$,U=this.chart.cursor;if(U&&U.hideSeriesTooltipsOnSelection&&U.selection.visible&&U.downPoint)this.hideTooltip();else if(this.returnBulletDefaultState(u),u&&u.visible){if(this.updateLegendValue(u),this.cursorTooltipEnabled){this.tooltipDataItem=u;var K=this.tooltipXField,ie=this.tooltipYField;if(Ee(u[K])&&Ee(u[ie])){var ae=this.getPoint(u,K,ie,this.getAdjustedXLocation(u,K),this.getAdjustedYLocation(u,ie));if(ae&&(this.chart.className!="XYChart"||!(ae.y<-1||ae.y>this.yAxis.pixelHeight+1||ae.x<-1||ae.x>this.xAxis.pixelWidth+1))){if(this.tooltipX=ae.x,this.tooltipY=ae.y,this._prevTooltipDataItem!=u&&(this.dispatchImmediately("tooltipshownat",{type:"tooltipshownat",target:this,dataItem:u}),this._prevTooltipDataItem=u),this.cursorHoverEnabled)try{for(var we=Ie(u.sprites),Re=we.next();!Re.done;Re=we.next()){var $e=Re.value;!$e.parent.visible||$e.isHidden||$e.__disabled||$e.disabled||$e.isHiding||($e.interactions.isRealHover||($e.dispatchImmediately("over"),$e.interactions.isRealHover=!0),$e.isHover=!0)}}catch(Xe){w={error:Xe}}finally{try{Re&&!Re.done&&($=we.return)&&$.call(we)}finally{if(w)throw w.error}}return this.showTooltip()?hm({x:ae.x,y:ae.y},this):void 0}}}}else this.updateLegendValue(u,!0)},R.prototype.returnBulletDefaultState=function(u){var w,$;if(this._prevTooltipDataItem&&this._prevTooltipDataItem!=u)try{for(var U=Ie(this._prevTooltipDataItem.sprites),K=U.next();!K.done;K=U.next()){var ie=K.value;if(ie.isDisposed())this._prevTooltipDataItem=void 0;else{var ae=ie.interactions.isRealHover;ie.isHover=!1,ae&&ie.dispatchImmediately("out")}}}catch(we){w={error:we}}finally{try{K&&!K.done&&($=U.return)&&$.call(U)}finally{if(w)throw w.error}}},R.prototype.shouldCreateBullet=function(u,w){var $=w.xField;Ee($)||($=this.xField);var U=w.yField;if(Ee(U)||(U=this.yField),this.xAxis instanceof vo&&!u.hasValue([$])||this.yAxis instanceof vo&&!u.hasValue([U]))return!1;if(w.disabled){var K=w.propertyFields.disabled,ie=u.dataContext;return!(!ie||ie[K]!==!1)}return!0},R.prototype.updateTooltip=function(){this.hideTooltipWhileZooming||!this.tooltip||this.tooltip.isHidden||this.isHiding||this.isHidden||!this.tooltipDataItem||this.showTooltipAtDataItem(this.tooltipDataItem)},R.prototype.positionBullet=function(u){j.prototype.positionBullet.call(this,u);var w=u.dataItem,$=u.xField;Ee($)||($=this.xField);var U=u.yField;Ee(U)||(U=this.yField);var K=this.xAxis,ie=this.yAxis;if(K instanceof vo&&!w.hasValue([$])||ie instanceof vo&&!w.hasValue([U]))u.visible=!1;else{var ae=this.getBulletLocationX(u,$),we=this.getBulletLocationY(u,U);if(this.getPoint(w,$,U,ae,we)){var Re=this.xOpenField,$e=this.yOpenField,Xe=void 0,Qe=void 0;if(K instanceof nc){le(ae)||(ae=0);var dt=void 0,Gt=w.getWorkingValue($);if(Re?dt=w.getWorkingValue(Re):K==this.baseAxis&&(dt=K.baseValue),le(dt)||(dt=Gt),(dt+=Hi=w.getValue("valueX","stack"))==(Gt+=Hi)){var Yt=K.baseInterval,ai=K.dateFormatter;dt=od(new Date(dt),Yt.timeUnit,Yt.count,ai.firstDayOfWeek,ai.utc,void 0,ai.timezoneMinutes,ai.timezone).getTime(),Gt=xp(new Date(dt),Yt.timeUnit,Yt.count,ai.utc).getTime()}var oi=void 0;oi=K==this.baseAxis?dt+(Gt-dt)*ae:dt+(Gt-dt)*(1-ae),Xe=K.valueToPosition(oi)}else if(K instanceof vo)le(ae)||(ae=0),dt=void 0,Gt=w.getWorkingValue($),dt=Re?w.getWorkingValue(Re):K.baseValue,oi=(dt+=Hi=w.getValue("valueX","stack"))+((Gt+=Hi)-dt)*(1-ae),Xe=K.valueToPosition(oi);else if(K instanceof $h){var Ui=this.getAdjustedXLocation(w,$,u.locationX),Ji=this.getAdjustedXLocation(w,Re,u.locationX);Xe=K.categoryToPosition(w[$],Ui);var Si=void 0;Re&&(Si=K.categoryToPosition(w[Re],Ji)),le(Si)||(Si=1),Xe=Si+(Xe-Si)*ae}if(ie instanceof nc)le(we)||(we=0),dt=void 0,Gt=w.getWorkingValue(U),$e?dt=w.getWorkingValue($e):ie==this.baseAxis&&(dt=ie.baseValue),le(dt)||(dt=Gt),(dt+=Hi=w.getValue("valueY","stack"))==(Gt+=Hi)&&(Yt=ie.baseInterval,ai=ie.dateFormatter,dt=od(new Date(dt),Yt.timeUnit,Yt.count,ai.firstDayOfWeek,ai.utc,void 0,ai.timezoneMinutes,ai.timezone).getTime(),Gt=xp(new Date(dt),Yt.timeUnit,Yt.count,ai.utc).getTime()),oi=void 0,oi=ie==this.baseAxis?dt+(Gt-dt)*we:dt+(Gt-dt)*(1-we),Qe=ie.valueToPosition(oi);else if(ie instanceof vo){var Hi;le(we)||(we=0),dt=void 0,Gt=w.getWorkingValue(U),dt=$e?w.getWorkingValue($e):ie.baseValue,oi=(dt+=Hi=w.getValue("valueY","stack"))+((Gt+=Hi)-dt)*(1-we),Qe=ie.valueToPosition(oi)}else if(ie instanceof $h){Qe=ie.categoryToPosition(w[U],we);var nr=this.getAdjustedYLocation(w,U,u.locationY),Ir=this.getAdjustedYLocation(w,$e,u.locationY);Qe=ie.categoryToPosition(w[U],nr);var yr=void 0;$e&&(yr=ie.categoryToPosition(w[$e],Ir)),le(yr)||(yr=1),Qe=yr+(Qe-yr)*we}u.visible=!0,this.positionBulletReal(u,Xe,Qe)}else u.visible=!1}},R.prototype.positionBulletReal=function(u,w,$){u.x=this.xAxis.renderer.positionToPoint(w,$).x,u.y=this.yAxis.renderer.positionToPoint($,w).y},R.prototype.getBulletLocationX=function(u,w){var $=u.locationX,U=u.dataItem;return le($)||($=U.workingLocations[w]),$},R.prototype.getBulletLocationY=function(u,w){var $=u.locationY,U=u.dataItem;return le($)||($=U.workingLocations[w]),$},R.prototype.updateStacking=function(){var u=this;this.invalidateDataItems(),this.chart&&this.chart.series.each(function(w){w.baseAxis==u.baseAxis&&(w.stackedSeries=void 0,w.invalidateDataItems(),w.invalidateProcessedData())})},Object.defineProperty(R.prototype,"stacked",{get:function(){return this.getPropertyValue("stacked")},set:function(u){if(this.setPropertyValue("stacked",u,!0)){this.updateStacking();var w,$=this.xAxis,U=this.yAxis;u||($!=this.baseAxis&&$ instanceof vo&&(w=this.xField),U!=this.baseAxis&&U instanceof vo&&(w=this.yField),w&&this.dataItems.each(function(K){K.setCalculatedValue(w,0,"stack")}))}},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"snapTooltip",{get:function(){return this.getPropertyValue("snapTooltip")},set:function(u){this.setPropertyValue("snapTooltip",u)},enumerable:!0,configurable:!0}),R.prototype.show=function(u){var w,$=this;this.isHidden&&(this.appeared&&this.xAxis instanceof nc&&this.xAxis.groupData&&(this._tmin.setKey(this.yAxis.uid,void 0),this._tmax.setKey(this.yAxis.uid,void 0)),this.appeared&&this.yAxis instanceof nc&&this.yAxis.groupData&&(this._tmin.setKey(this.xAxis.uid,void 0),this._tmax.setKey(this.xAxis.uid,void 0))),this.xAxis instanceof vo&&this.xAxis!=this.baseAxis&&(w=this._xValueFields),this.yAxis instanceof vo&&this.yAxis!=this.baseAxis&&(w=this._yValueFields);var U,K=this.startIndex,ie=this.endIndex,ae=0,we=this.defaultState.transitionDuration;le(u)&&(we=u),no.animationsEnabled||(we=0),pr(ch(this.dataItems.iterator()),function($e){var Xe=$e[0],Qe=$e[1],dt=we;(Xe<$.startIndex-10||Xe>$.endIndex+10)&&(dt=0,ae=0),$.sequencedInterpolation&&dt>0&&(ae=$.sequencedInterpolationDelay*Xe+we*(Xe-K)/(ie-K)),U=Qe.show(dt,ae,w)}),this.dataSets.each(function($e,Xe){Xe!=$.dataItems&&Xe.each(function(Qe){Qe.events.disable(),Qe.show(0,0,w),Qe.events.enable()})}),this.mainDataSet!=this.dataItems&&this.mainDataSet.each(function($e){$e.events.disable(),$e.show(0,0,w),$e.events.enable()});var Re=j.prototype.show.call(this,u);return U&&!U.isFinished()&&(Re=U),this.hidden&&(this.dispatchImmediately("selectionextremeschanged"),this.hidden=!1),Re},R.prototype.hide=function(u){var w,$,U=this,K=this.xAxis;K instanceof vo&&K!=this.baseAxis&&(w=this._xValueFields,$=this.stacked||K.minZoomedK.baseValue||this.stackedSeries?K.baseValue:K.min);var ie=this.yAxis;ie instanceof vo&&ie!=this.baseAxis&&(w=this._yValueFields,$=this.stacked||ie.minZoomedie.baseValue||this.stackedSeries?ie.baseValue:ie.min);var ae=this.startIndex,we=this.endIndex,Re=this.hiddenState.transitionDuration;le(u)&&(Re=u),no.animationsEnabled||(Re=0);var $e,Xe=0;pr(ch(this.dataItems.iterator()),function(dt){var Gt=dt[0],Yt=dt[1],ai=Re;(GtU.endIndex+10)&&(ai=0),ai==0?Yt.hide(0,0,$,w):(U.sequencedInterpolation&&ai>0&&(Xe=U.sequencedInterpolationDelay*Gt+Re*(Gt-ae)/(we-ae)),$e=Yt.hide(ai,Xe,$,w))}),this.dataSets.each(function(dt,Gt){Gt!=U.dataItems&&Gt.each(function(Yt){Yt.events.disable(),Yt.hide(0,0,$,w),Yt.events.enable()})}),this.mainDataSet!=this.dataItems&&this.mainDataSet.each(function(dt){dt.events.disable(),dt.hide(0,0,$,w),dt.events.enable()});var Qe=j.prototype.hide.call(this,Re);return Qe&&!Qe.isFinished()&&Qe.delay(Xe),$e&&!$e.isFinished()&&(Qe=$e),this.validateDataElements(),Qe},R.prototype.handleDataItemWorkingValueChange=function(u,w){j.prototype.handleDataItemWorkingValueChange.call(this,u,w),pr(this.baseAxis.series.iterator(),function($){($.stacked||$.stackedSeries)&&$.invalidateProcessedData()})},R.prototype.getStackValue=function(u,w){var $=this,U=this.xAxis,K=this.yAxis;if(this.stacked&&U&&K){var ie,ae=this.chart,we=ae.series.indexOf(this);U!=this.baseAxis&&U instanceof vo&&(ie=this.xField),K!=this.baseAxis&&K instanceof vo&&(ie=this.yField),ie&&(u.setCalculatedValue(ie,0,"stack"),Na(ae.series.range(0,we).backwards().iterator(),function(Re){if(Re.xAxis==U&&Re.yAxis==K&&Re.className==$.className){Re.stackedSeries=$;var $e=Re.dataItems.getIndex(u.index);if($e&&$e.hasValue($._xValueFields)&&$e.hasValue($._yValueFields)){var Xe,Qe=u.getValue(ie),dt=$e.getValue(ie)+$e.getValue(ie,"stack");if(Xe=w?$e.getWorkingValue(ie)+$e.getValue(ie,"stack"):$e.getValue(ie)+$e.getValue(ie,"stack"),!$.stackToNegative||Qe>=0&&dt>=0||Qe<0&&dt<0)return u.setCalculatedValue(ie,Xe,"stack"),!1;if(!Re.stacked)return!1}else if(!Re.stacked)return!1}return!0}))}},Object.defineProperty(R.prototype,"stackToNegative",{get:function(){return this.getPropertyValue("stackToNegative")},set:function(u){this.setPropertyValue("stackToNegative",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"xField",{get:function(){return this._xField},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"yField",{get:function(){return this._yField},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"xOpenField",{get:function(){return this._xOpenField},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"yOpenField",{get:function(){return this._yOpenField},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tooltipXField",{get:function(){return this._tooltipXField?this._tooltipXField:this._xField},set:function(u){this._tooltipXField=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tooltipYField",{get:function(){return this._tooltipYField?this._tooltipYField:this._yField},set:function(u){this._tooltipYField=u},enumerable:!0,configurable:!0}),R.prototype.min=function(u){return this._tmin.getKey(u.uid)},R.prototype.max=function(u){return this._tmax.getKey(u.uid)},R.prototype.selectionMin=function(u){return this._smin.getKey(u.uid)},R.prototype.selectionMax=function(u){return this._smax.getKey(u.uid)},R.prototype.processConfig=function(u){if(u){if(Ee(u.baseAxis)&&ct(u.baseAxis)&&(this.map.hasKey(u.baseAxis)?u.baseAxis=this.map.getKey(u.baseAxis):(this.processingErrors.push("[XYSeries ("+(this.name||"unnamed")+')] No axis with id "'+u.baseAxis+'" found for `baseAxis`.'),delete u.baseAxis)),Ee(u.xAxis)&&ct(u.xAxis)&&(this.map.hasKey(u.xAxis)?u.xAxis=this.map.getKey(u.xAxis):(this.processingErrors.push("[XYSeries ("+(this.name||"unnamed")+')] No axis with id "'+u.xAxis+'" found for `xAxis`.'),delete u.xAxis)),Ee(u.yAxis)&&ct(u.yAxis)&&(this.map.hasKey(u.yAxis)?u.yAxis=this.map.getKey(u.yAxis):(this.processingErrors.push("[XYSeries ("+(this.name||"unnamed")+')] No axis with id "'+u.yAxis+'" found for `yAxis`.'),delete u.yAxis)),Ee(u.axisRanges)&&pt(u.axisRanges))for(var w=0,$=u.axisRanges.length;w<$;w++){var U=u.axisRanges[w];Ee(U.type)||(U.type="AxisDataItem"),Ee(U.axis)&&ct(U.axis)&&this.map.hasKey(U.axis)?U.component=this.map.getKey(U.axis):Ee(U.component)&&ct(U.component)&&this.map.hasKey(U.component)&&(U.component=this.map.getKey(U.component))}Ee(u.dataFields)&&it(u.dataFields)||this.processingErrors.push("`dataFields` is not set for series ["+(this.name||"unnamed")+"]")}j.prototype.processConfig.call(this,u)},R.prototype.getPoint=function(u,w,$,U,K,ie,ae){if(this.xAxis&&this.yAxis){var we=this.xAxis.getX(u,w,U),Re=this.yAxis.getY(u,$,K);return{x:we=gt(we,-this._maxxX,this._maxxX),y:Re=gt(Re,-this._maxxY,this._maxxY)}}},R.prototype.updateItemReaderText=function(){if(!this._itemReaderTextChanged){var u="";gi(this.dataFields,function(w,$){u+="{"+w+"} "}),this.itemReaderText=u,this._itemReaderTextChanged=!1}},Object.defineProperty(R.prototype,"cursorTooltipEnabled",{get:function(){return this.getPropertyValue("cursorTooltipEnabled")},set:function(u){this.setPropertyValue("cursorTooltipEnabled",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cursorHoverEnabled",{get:function(){return this.getPropertyValue("cursorHoverEnabled")},set:function(u){this.setPropertyValue("cursorHoverEnabled",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"excludeFromTotal",{get:function(){return this.getPropertyValue("excludeFromTotal")},set:function(u){this.setPropertyValue("excludeFromTotal",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"hideTooltipWhileZooming",{get:function(){return this.getPropertyValue("hideTooltipWhileZooming")},set:function(u){this.setPropertyValue("hideTooltipWhileZooming",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maskBullets",{get:function(){return this.getPropertyValue("maskBullets")},set:function(u){this.setPropertyValue("maskBullets",u);var w=this.chart;w&&(this.bulletsContainer.parent=u?w.bulletsContainer:w.axisBulletsContainer)},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){this.groupFields=tn(u.groupFields,{}),j.prototype.copyFrom.call(this,u)},R.prototype.dispose=function(){this.scrollbarSeries&&this.scrollbarSeries.dispose(),j.prototype.dispose.call(this)},R}(o8);ui.registeredClasses.XYSeries=NI,ui.registeredClasses.XYSeriesDataItem=eg;var $I=function(j){function R(){var u=j.call(this)||this;u._chart=new Jn,u.className="XYChartScrollbar";var w=new $a;u.padding(0,0,0,0);var $=u.createChild(G0);if($.shouldClone=!1,$.margin(0,0,0,0),$.padding(0,0,0,0),$.interactionsEnabled=!1,u._scrollbarChart=$,!ZS()){var U=new i8;U.filterUnits="userSpaceOnUse",$.plotContainer.filters.push(U)}u._disposers.push(u._scrollbarChart),u.minHeight=60,u.minWidth=60;var K=u.createChild(so);K.shouldClone=!1,K.setElement(u.paper.add("path")),K.fill=w.getFor("background"),K.fillOpacity=.8,K.interactionsEnabled=!1,K.isMeasured=!1,K.toBack(),u._unselectedOverlay=K,u._disposers.push(u._unselectedOverlay),$.toBack(),u.background.cornerRadius(0,0,0,0);var ie=u.thumb.background;ie.cornerRadius(0,0,0,0),ie.fillOpacity=0,ie.fill=w.getFor("background");var ae=ie.states.getKey("hover");ae&&(ae.properties.fillOpacity=.2);var we=ie.states.getKey("down");return we&&(we.properties.fillOpacity=.4),u._disposers.push(u._chart),u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"series",{get:function(){return this._series||(this._series=new Us,this._disposers.push(this._series.events.on("inserted",this.handleSeriesAdded,this,!1)),this._disposers.push(this._series.events.on("removed",this.handleSeriesRemoved,this,!1))),this._series},enumerable:!0,configurable:!0}),R.prototype.handleSeriesAdded=function(u){var w=this,$=u.newValue;if($.xAxis&&$.yAxis){var U=this.scrollbarChart;U.zoomOutButton.disabled=!0,this.chart=$.chart,U.dateFormatter.inputDateFormat=this.chart.dateFormatter.inputDateFormat,U.language.locale=this.chart.language.locale;var K=!0,ie=!0;pr(this.series.iterator(),function(oi){oi!=$&&(oi.xAxis==$.xAxis&&w.scrollbarChart.xAxes.length>0&&(K=!1),oi.yAxis==$.yAxis&&w.scrollbarChart.yAxes.length>0&&(ie=!1))}),$.events.on("beforedisposed",function(){w.series.removeValue($)});var ae=new $a,we=$.clone();if((no.onlyShowOnViewport||no.queue)&&this.addDisposer(this.chart.events.on("removedfromqueue",function(){U.invalidateData()})),ZS()&&(we.stroke=He("#aaaaaa"),we.fill=we.stroke,we.propertyFields.fill=void 0,we.propertyFields.stroke=void 0),$.scrollbarSeries=we,K){var Re=$.xAxis.clone();if(U.xAxes.moveValue(Re),Re.title.disabled=!0,Re.rangeChangeDuration=0,(dt=Re.renderer).ticks.template.disabled=!0,dt.inside=!0,dt.labels.template.inside=!0,dt.line.strokeOpacity=0,dt.minLabelPosition=.02,dt.maxLabelPosition=.98,dt.line.disabled=!0,dt.axisFills.template.disabled=!0,dt.baseGrid.disabled=!0,dt.grid.template.strokeOpacity=.05,dt.minWidth=void 0,dt.minHeight=void 0,dt.padding(0,0,0,0),dt.chart=U,dt.margin(0,0,0,0),Re.width=he(100),dt.labels.template.fillOpacity=.5,Re.maxZoomCount=void 0,Re.minZoomCount=void 0,Re instanceof nc){var $e=Re,Xe=$.xAxis;$e.groupCount=5*Xe.groupCount,$e.min=void 0,$e.max=void 0,this._disposers.push($e.clonedFrom.events.on("extremeschanged",function(){le($e.clonedFrom.minDefined)&&($e.min=$e.clonedFrom.minDefined),le($e.clonedFrom.maxDefined)&&($e.max=$e.clonedFrom.maxDefined)},void 0,!1))}else if(Re instanceof vo){var Qe=Re;Qe.min=void 0,Qe.max=void 0,le(Qe.clonedFrom.minDefined)||(Qe.min=void 0),le(Qe.clonedFrom.maxDefined)||(Qe.max=void 0),this._disposers.push(Qe.clonedFrom.events.on("extremeschanged",function(){le(Qe.clonedFrom.minDefined)&&(Qe.min=Qe.clonedFrom.min),le(Qe.clonedFrom.maxDefined)&&(Qe.max=Qe.clonedFrom.max)},void 0,!1))}we.xAxis=Re}else this.scrollbarChart.xAxes.each(function(oi){oi.clonedFrom==$.xAxis&&(we.xAxis=oi)});if(ie){var dt,Gt=$.yAxis.clone();if(U.yAxes.moveValue(Gt),Gt.title.disabled=!0,Gt.rangeChangeDuration=0,(dt=Gt.renderer).ticks.template.disabled=!0,dt.inside=!0,dt.labels.template.inside=!0,dt.line.strokeOpacity=0,dt.minLabelPosition=.02,dt.maxLabelPosition=.98,dt.line.disabled=!0,dt.axisFills.template.disabled=!0,dt.grid.template.stroke=ae.getFor("background"),dt.baseGrid.disabled=!0,dt.grid.template.strokeOpacity=.05,dt.minWidth=void 0,dt.minHeight=void 0,dt.chart=U,dt.padding(0,0,0,0),dt.margin(0,0,0,0),Gt.height=he(100),dt.labels.template.fillOpacity=.5,we.yAxis=Gt,Gt.maxZoomCount=void 0,Gt.minZoomCount=void 0,Gt instanceof nc){var Yt=Gt;Yt.min=void 0,Yt.max=void 0,Xe=$.yAxis,Gt.groupCount=5*Xe.groupCount,this._disposers.push(Yt.clonedFrom.events.on("extremeschanged",function(){le(Yt.clonedFrom.minDefined)&&(Yt.min=Yt.clonedFrom.minDefined),le(Yt.clonedFrom.maxDefined)&&(Yt.max=Yt.clonedFrom.maxDefined)}))}else if(Gt instanceof vo){var ai=Gt;ai.min=void 0,ai.max=void 0,le(ai.clonedFrom.minDefined)||(ai.min=void 0),le(ai.clonedFrom.maxDefined)||(ai.max=void 0),this._disposers.push(ai.clonedFrom.events.on("extremeschanged",function(){le(ai.clonedFrom.minDefined)&&(ai.min=ai.clonedFrom.minDefined),le(ai.clonedFrom.maxDefined)&&(ai.max=ai.clonedFrom.maxDefined)}))}}else this.scrollbarChart.yAxes.each(function(oi){oi.clonedFrom==$.yAxis&&(we.yAxis=oi)});we.rangeChangeDuration=0,we.interpolationDuration=0,we.defaultState.transitionDuration=0,we.showOnInit=!1,this._disposers.push(we.events.on("validated",this.zoomOutAxes,this,!1)),this._disposers.push($.events.on("datavalidated",function(){we.data!=$.data&&(we.data=$.data)},void 0,!1)),we.defaultState.properties.visible=!0,U.series.push(we),this.updateByOrientation()}},R.prototype.updateByOrientation=function(){var u=this;this._scrollbarChart&&(pr(this._scrollbarChart.xAxes.iterator(),function(w){var $=w.renderer;u.orientation=="vertical"?($.grid.template.disabled=!0,$.labels.template.disabled=!0,$.minGridDistance=10):($.grid.template.disabled=!1,$.labels.template.disabled=!1,$.minGridDistance=w.clonedFrom.renderer.minGridDistance)}),pr(this._scrollbarChart.yAxes.iterator(),function(w){var $=w.renderer;u.orientation=="horizontal"?($.grid.template.disabled=!0,$.labels.template.disabled=!0,$.minGridDistance=10):($.grid.template.disabled=!1,$.labels.template.disabled=!1,$.minGridDistance=w.clonedFrom.renderer.minGridDistance)}))},R.prototype.handleSeriesRemoved=function(u){var w=u.oldValue,$=this.scrollbarChart;$.series.each(function(U){U&&U.clonedFrom==w&&$.series.removeValue(U)}),$.series.length==0&&($.xAxes.clear(),$.yAxes.clear());try{w.events.off("validated",this.zoomOutAxes,this)}catch{}},Object.defineProperty(R.prototype,"scrollbarChart",{get:function(){return this._scrollbarChart},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"chart",{get:function(){return this._chart.get()},set:function(u){this._chart.get()!==u&&(this._chart.set(u,u.events.on("datavalidated",this.handleDataChanged,this,!1)),this.handleDataChanged(),this._scrollbarChart.dataProvider=u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"unselectedOverlay",{get:function(){return this._unselectedOverlay},enumerable:!0,configurable:!0}),R.prototype.handleDataChanged=function(){this.chart.data!=this.scrollbarChart.data?this.scrollbarChart.data=this.chart.data:this.scrollbarChart.invalidateRawData()},R.prototype.zoomOutAxes=function(){var u=this.scrollbarChart;pr(u.xAxes.iterator(),function(w){w.zoom({start:0,end:1},!0,!0)}),pr(u.yAxes.iterator(),function(w){w.zoom({start:0,end:1},!0,!0)})},R.prototype.updateThumb=function(u){if(u===void 0&&(u=!0),j.prototype.updateThumb.call(this,u),this._unselectedOverlay){var w=this.thumb,$=w.pixelX||0,U=w.pixelY||0,K=w.pixelWidth||0,ie=w.pixelHeight||0,ae="";this.orientation=="horizontal"?(ae=uC({x:-1,y:0,width:$,height:ie}),ae+=uC({x:$+K,y:0,width:(this.pixelWidth||0)-$-K,height:ie})):(ae=uC({x:0,y:0,width:K,height:U}),ae+=uC({x:0,y:U+ie,width:K,height:(this.pixelHeight||0)-U-ie})),this._unselectedOverlay.path=ae}},R.prototype.processConfig=function(u){if(u&&Ee(u.series)&&pt(u.series))for(var w=0,$=u.series.length;w<$;w++){var U=u.series[w];if(Ee(U)&&ct(U)){if(!this.map.hasKey(U))throw Error("XYChartScrollbar error: Series with id `"+U+"` does not exist.");u.series[w]=this.map.getKey(U)}}j.prototype.processConfig.call(this,u)},R}(B0);ui.registeredClasses.XYChartScrollbar=$I;var Az=function(j){function R(){var u=j.call(this)||this;return u.className="XYChartDataItem",u.applyTheme(),u}return re(R,j),R}(hie),G0=function(j){function R(){var u=j.call(this)||this;u._axisRendererX=Fd,u._axisRendererY=w1,u._seriesPoints=[],u.className="XYChart",u.maskBullets=!0,u.arrangeTooltips=!0;var w=u.chartContainer;w.layout="vertical",u.padding(15,15,15,15);var $=w.createChild(Zn);$.shouldClone=!1,$.layout="vertical",$.width=he(100),$.zIndex=1,u.topAxesContainer=$;var U=w.createChild(Zn);U.shouldClone=!1,U.layout="horizontal",U.width=he(100),U.height=he(100),U.zIndex=0,u.yAxesAndPlotContainer=U;var K=w.createChild(Zn);K.shouldClone=!1,K.width=he(100),K.layout="vertical",K.zIndex=1,u.bottomAxesContainer=K;var ie=U.createChild(Zn);ie.shouldClone=!1,ie.layout="horizontal",ie.height=he(100),ie.contentAlign="right",ie.events.on("transformed",u.updateXAxesMargins,u,!1),ie.zIndex=1,u.leftAxesContainer=ie;var ae=U.createChild(Zn);ae.shouldClone=!1,ae.height=he(100),ae.width=he(100),ae.background.fillOpacity=0,u.plotContainer=ae,u.mouseWheelBehavior="none",u._cursorContainer=ae;var we=U.createChild(Zn);we.shouldClone=!1,we.layout="horizontal",we.height=he(100),we.zIndex=1,we.events.on("transformed",u.updateXAxesMargins,u,!1),u.rightAxesContainer=we,u.seriesContainer.parent=ae,u.bulletsContainer.parent=ae;var Re=ae.createChild(eie);Re.shouldClone=!1,Re.align="right",Re.valign="top",Re.zIndex=Number.MAX_SAFE_INTEGER,Re.marginTop=5,Re.marginRight=5,Re.hide(0),u.zoomOutButton=Re;var $e=u.plotContainer.createChild(Zn);return $e.shouldClone=!1,$e.width=he(100),$e.height=he(100),$e.isMeasured=!1,$e.zIndex=4,$e.layout="none",u.axisBulletsContainer=$e,u._bulletMask=u.plotContainer,u.events.on("beforedatavalidated",function(){u.series.each(function(Xe){Xe.dataGrouped=!1,Xe._baseInterval={}})},u,!1),u.applyTheme(),u}return re(R,j),R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),this.zoomOutButton.exportable=!1,Ee(this.readerTitle)||(this.readerTitle=this.language.translate("X/Y chart"))},R.prototype.draw=function(){j.prototype.draw.call(this),this.seriesContainer.toFront(),this.bulletsContainer.toFront(),this.maskBullets&&(this.bulletsContainer.mask=this._bulletMask),this.updateSeriesLegend()},R.prototype.updatePlotElements=function(){pr(this.series.iterator(),function(u){u.invalidate()})},R.prototype.validateData=function(){this._parseDataFrom==0&&(pr(this.xAxes.iterator(),function(u){u.dataChangeUpdate()}),pr(this.yAxes.iterator(),function(u){u.dataChangeUpdate()}),pr(this.series.iterator(),function(u){u.dataChangeUpdate()})),j.prototype.validateData.call(this)},R.prototype.updateXAxesMargins=function(){var u=this.leftAxesContainer.measuredWidth,w=this.rightAxesContainer.measuredWidth,$=this.bottomAxesContainer;$.paddingLeft==u&&$.paddingRight==w||($.paddingLeft=u,$.paddingRight=w);var U=this.topAxesContainer;U.paddingLeft==u&&U.paddingRight==w||(U.paddingLeft=u,U.paddingRight=w)},R.prototype.reinit=function(){j.prototype.reinit.call(this),this.series.each(function(u){u.appeared=!1})},R.prototype.handleXAxisChange=function(u){this.updateXAxis(u.target)},R.prototype.handleYAxisChange=function(u){this.updateYAxis(u.target)},R.prototype.processXAxis=function(u){var w=u.newValue;w.chart=this,w.renderer||(w.renderer=new this._axisRendererX,w.renderer.observe(["opposite","inside","inversed","minGridDistance"],this.handleXAxisChange,this,!1)),w.axisLetter="X",w.events.on("startendchanged",this.handleXAxisRangeChange,this,!1),w.dataProvider=this,this.updateXAxis(w.renderer),this.processAxis(w)},R.prototype.processYAxis=function(u){var w=u.newValue;w.chart=this,w.renderer||(w.renderer=new this._axisRendererY,w.renderer.observe(["opposite","inside","inversed","minGridDistance"],this.handleYAxisChange,this,!1)),w.axisLetter="Y",w.events.on("startendchanged",this.handleYAxisRangeChange,this,!1),w.dataProvider=this,this.updateYAxis(w.renderer),this.processAxis(w)},R.prototype.handleXAxisRangeChange=function(){var u=this.getCommonAxisRange(this.xAxes);this.scrollbarX&&this.zoomAxes(this.xAxes,u,!0),this.toggleZoomOutButton(),this.updateScrollbar(this.scrollbarX,u)},R.prototype.toggleZoomOutButton=function(){if(this.zoomOutButton){var u=!1;Na(this.xAxes.iterator(),function(w){if(w.toggleZoomOutButton){if(w.maxZoomCount>0){var $=w.maxZoomFactor/w.maxZoomCount;if(Ve(w.end-w.start,3)<1/$)return u=!0,!1}else if(Ve(w.start,3)>0||Ve(w.end,3)<1)return u=!0,!1}return!0}),Na(this.yAxes.iterator(),function(w){if(w.toggleZoomOutButton){if(w.maxZoomCount>0){var $=w.maxZoomFactor/w.maxZoomCount;if(Ve(w.end-w.start,3)<1/$)return u=!0,!1}else if(Ve(w.start,3)>0||Ve(w.end,3)<1)return u=!0,!1;return!0}}),this.seriesAppeared||(u=!1),u?this.zoomOutButton.show():this.zoomOutButton.hide()}},R.prototype.seriesAppeared=function(){var u=!1;return pr(this.series.iterator(),function(w){if(!w.appeared)return u=!1,!1}),u},R.prototype.handleYAxisRangeChange=function(){var u=this.getCommonAxisRange(this.yAxes);this.scrollbarY&&this.zoomAxes(this.yAxes,u,!0),this.toggleZoomOutButton(),this.updateScrollbar(this.scrollbarY,u)},R.prototype.updateScrollbar=function(u,w){u&&(u.skipRangeEvents(),u.start=w.start,u.end=w.end)},R.prototype.getCommonAxisRange=function(u){var w,$;return u.each(function(U){if(!(!U.zoomable||U instanceof vo&&U.syncWithAxis)){var K=U.start,ie=U.end;U.renderer.inversed&&(K=1-U.end,ie=1-U.start),(!le(w)||K$)&&($=ie)}}),{start:w,end:$}},R.prototype.updateXAxis=function(u){var w=u.axis;u.opposite?(w.parent=this.topAxesContainer,w.toFront()):(w.parent=this.bottomAxesContainer,w.toBack()),w.renderer&&w.renderer.processRenderer()},R.prototype.updateYAxis=function(u){var w=u.axis;u.opposite?(w.parent=this.rightAxesContainer,w.toBack()):(w.parent=this.leftAxesContainer,w.toFront()),w.renderer&&w.renderer.processRenderer()},R.prototype.processAxis=function(u){var w=this;u instanceof $h&&this._dataUsers.moveValue(u);var $=u.renderer;$.gridContainer.parent=this.plotContainer,$.gridContainer.toBack(),$.breakContainer.parent=this.plotContainer,$.breakContainer.toFront(),$.breakContainer.zIndex=10,u.addDisposer(new jr(function(){w.dataUsers.removeValue(u)})),$.bulletsContainer.parent=this.axisBulletsContainer,this._disposers.push(u.events.on("positionchanged",function(){var U=wp({x:0,y:0},u,w.axisBulletsContainer);u.renderer instanceof w1&&($.bulletsContainer.y=U.y),u.renderer instanceof Fd&&($.bulletsContainer.x=U.x)},void 0,!1)),this.plotContainer.events.on("maxsizechanged",function(){w.inited&&(u.invalidateDataItems(),w.updateSeriesMasks())},u,!1)},R.prototype.updateSeriesMasks=function(){ZS()&&this.series.each(function(u){var w=u.mainContainer.mask;u.mainContainer.mask=void 0,u.mainContainer.mask=w})},R.prototype.handleSeriesRemoved=function(u){var w=u.oldValue;w&&(w.xAxis&&(w.xAxis.series.removeValue(w),w.xAxis.invalidateProcessedData()),w.yAxis&&(w.yAxis.series.removeValue(w),w.yAxis.invalidateProcessedData()),this.series.each(function($){$.resetExtremes()})),j.prototype.handleSeriesRemoved.call(this,u)},Object.defineProperty(R.prototype,"xAxes",{get:function(){return this._xAxes||(this._xAxes=new Us,this._xAxes.events.on("inserted",this.processXAxis,this,!1),this._xAxes.events.on("removed",this.handleAxisRemoval,this,!1),this._disposers.push(new ta(this._xAxes,!1))),this._xAxes},enumerable:!0,configurable:!0}),R.prototype.handleAxisRemoval=function(u){var w=u.oldValue;this.dataUsers.removeValue(w),w.autoDispose&&w.dispose()},Object.defineProperty(R.prototype,"yAxes",{get:function(){return this._yAxes||(this._yAxes=new Us,this._yAxes.events.on("inserted",this.processYAxis,this,!1),this._yAxes.events.on("removed",this.handleAxisRemoval,this,!1),this._disposers.push(new ta(this._yAxes,!1))),this._yAxes},enumerable:!0,configurable:!0}),R.prototype.handleSeriesAdded=function(u){try{j.prototype.handleSeriesAdded.call(this,u);var w=u.newValue;this.xAxes.length!=0&&this.yAxes.length!=0||(ui.removeFromInvalidComponents(w),w.dataInvalid=!1),w.xAxis,w.yAxis,w.maskBullets=w.maskBullets,w.fill==null&&(this.patterns?(Ee(w.stroke)||(w.stroke=this.colors.next()),w.fill=this.patterns.next(),Ee(w.fillOpacity)&&(w.fill.backgroundOpacity=w.fillOpacity),w.stroke instanceof Te&&(w.fill.stroke=w.stroke,w.fill.fill=w.stroke)):w.fill=this.colors.next()),Ee(w.stroke)||(w.stroke=w.fill)}catch($){this.raiseCriticalError($)}},Object.defineProperty(R.prototype,"cursor",{get:function(){return this._cursor},set:function(u){this._cursor!=u&&(this._cursor&&this.removeDispose(this._cursor),this._cursor=u,u&&(this._disposers.push(u),u.chart=this,u.shouldClone=!1,u.parent=this._cursorContainer,u.events.on("cursorpositionchanged",this.handleCursorPositionChange,this,!1),u.events.on("zoomstarted",this.handleCursorZoomStart,this,!1),u.events.on("zoomended",this.handleCursorZoomEnd,this,!1),u.events.on("panstarted",this.handleCursorPanStart,this,!1),u.events.on("panning",this.handleCursorPanning,this,!1),u.events.on("panended",this.handleCursorPanEnd,this,!1),u.events.on("behaviorcanceled",this.handleCursorCanceled,this,!1),u.events.on("hidden",this.handleHideCursor,this,!1),u.zIndex=Number.MAX_SAFE_INTEGER-1,this.tapToActivate&&this.setTapToActivate(this.tapToActivate)))},enumerable:!0,configurable:!0}),R.prototype.handleCursorPositionChange=function(){var u=this.cursor;if(u.visible&&!u.isHiding){var w=this.cursor.xPosition,$=this.cursor.yPosition;this.showSeriesTooltip({x:w,y:$});var U=[],K=u.snapToSeries;if(K&&!u.downPoint){K instanceof NI&&(K=[K]);var ie=[];mi(K,function(we){if(!we.isHidden&&!we.isHiding){var Re=we.xAxis,$e=we.yAxis;Re instanceof vo&&!(Re instanceof nc)&&$e instanceof vo&&!($e instanceof nc)?(we.dataItems.each(function(Xe){ie.push(Xe)}),Ur(U,we.yAxis),Ur(U,we.xAxis)):(we.baseAxis==we.xAxis&&(Ur(U,we.yAxis),ie.push(Re.getSeriesDataItem(we,Re.toAxisPosition(w),!0))),we.baseAxis==we.yAxis&&(Ur(U,we.xAxis),ie.push($e.getSeriesDataItem(we,$e.toAxisPosition($),!0))))}});var ae=this.getClosest(ie,w,$);ae&&(this.series.each(function(we){var Re=ae.component;we!=Re&&(we.hideTooltip(),we.xAxis!=Re.xAxis&&(we.xAxis.hideTooltip(),U.push(we.xAxis)),we.yAxis!=Re.yAxis&&(we.yAxis.hideTooltip(),U.push(we.yAxis)))}),ae.component.showTooltipAtDataItem(ae),u.handleSnap(ae.component))}this._seriesPoints=[],this._cursorXPosition!=w&&this.showAxisTooltip(this.xAxes,w,U),this._cursorYPosition!=$&&this.showAxisTooltip(this.yAxes,$,U),this.arrangeTooltips&&this.sortSeriesTooltips(this._seriesPoints),this.legend&&this.legend.afterDraw()}},R.prototype.getClosest=function(u,w,$){var U,K=1/0;return Lr(u,function(ie){if(ie){var ae=ie.component.xAxis,we=ie.component.yAxis,Re=ae.positionToCoordinate(ae.toGlobalPosition(ae.toAxisPosition(w))),$e=we.positionToCoordinate(we.toGlobalPosition(we.toAxisPosition($))),Xe=ie.component.xField,Qe=ie.component.yField;if(ae instanceof vo&&!le(ie.getValue(Xe))||we instanceof vo&&!le(ie.getValue(Qe)))return!0;var dt=ae.positionToCoordinate(ae.toGlobalPosition(ae.getPositionX(ie,Xe,ie.locations[Xe],"valueX"))),Gt=we.positionToCoordinate(we.toGlobalPosition(we.getPositionY(ie,Qe,ie.locations[Qe],"valueY"))),Yt=Math.sqrt(Math.pow(Re-dt,2)+Math.pow($e-Gt,2));return Yt0){var w=this.cursor;if(w&&le(w.maxTooltipDistance)){var $,U,K=hm({x:w.point.x,y:w.point.y},w),ie=1/0;mi(u,function(Dn){var Ra=Dn.series,fh=Dn.point;if(fh){var sf={x:fh.x,y:fh.y},wl=Math.abs(C(sf,K));wl0&&mi(ae,function(Dn){$!=Dn.series&&Dn.series.hideTooltip(0)}),ae=[{series:$,point:U}])),u=ae}var we=hm({x:-.5,y:-.5},this.plotContainer),Re=hm({x:this.plotContainer.pixelWidth+.5,y:this.plotContainer.pixelHeight+.5},this.plotContainer),$e=0,Xe=[];mi(u,function(Dn){var Ra=Dn.point;Ra&&bi(Ra,{x:we.x,y:we.y,width:Re.x-we.x,height:Re.y-we.y})&&(Xe.push({point:Ra,series:Dn.series}),$e+=Ra.y)}),u=Xe;var Qe=this.series.getIndex(0),dt=!1;Qe&&Qe.yAxis&&Qe.yAxis.renderer.inversed&&(dt=!0),dt?u.sort(function(Dn,Ra){return ih(Dn.point.y,Ra.point.y)}):(u.sort(function(Dn,Ra){return ih(Ra.point.y,Dn.point.y)}),u.reverse());var Gt=$e/u.length,Yt=L0({x:0,y:0},this.svgContainer.SVGContainer).y;if(u.length>0){var ai=we.y,oi=Re.y;cr({x:0,y:ai},this);var Ui=!1;if(Gt>ai+(oi-ai)/2)for(var Ji=oi,Si=u.length-1;Si>=0;Si--){var Hi=(Es=u[Si].series).tooltip,nr=u[Si].point.y;if(Hi.setBounds({x:0,y:-Yt,width:this.pixelWidth,height:Ji+Yt}),Hi.invalid&&Hi.validate(),Hi.toBack(),(Ji=hm({x:0,y:Hi.label.pixelY-Hi.pixelY+nr-Hi.pixelMarginTop},Hi).y)<-Yt){Ui=!0;break}}if(Gt<=ai+(oi-ai)/2||Ui)for(var Ir=ai,yr=(Si=0,u.length);Si0||K.dataItems.length>0)&&K.showTooltipAtPosition(w)})},R.prototype.getUpdatedRange=function(u,w){if(u){var $,U;u.renderer.inversed?(m(w),$=1-u.end,U=1-u.start):($=u.start,U=u.end);var K=U-$;return{start:$+w.start*K,end:$+w.end*K}}},R.prototype.handleCursorZoomEnd=function(u){var w=this.cursor,$=w.behavior;if($=="zoomX"||$=="zoomXY"){var U=w.xRange;U&&this.xAxes.length>0&&((U=this.getUpdatedRange(this.xAxes.getIndex(0),U)).priority="start",this.zoomAxes(this.xAxes,U))}if($=="zoomY"||$=="zoomXY"){var K=w.yRange;K&&this.yAxes.length>0&&((K=this.getUpdatedRange(this.yAxes.getIndex(0),K)).priority="start",this.zoomAxes(this.yAxes,K))}this.handleHideCursor()},R.prototype.handleCursorPanStart=function(u){var w=this.xAxes.getIndex(0);w&&(this._panStartXRange={start:w.start,end:w.end},w.renderer.inversed&&(this._panStartXRange=m(this._panStartXRange)));var $=this.yAxes.getIndex(0);$&&(this._panStartYRange={start:$.start,end:$.end},$.renderer.inversed&&(this._panStartYRange=m(this._panStartYRange)))},R.prototype.handleCursorPanEnd=function(u){var w=this.cursor,$=w.behavior;if(this._panEndXRange&&($=="panX"||$=="panXY")){var U=this._panEndXRange,K=this._panStartXRange,ie=0;U.start<0&&(ie=U.start),K.end>1?U.end>K.end&&(ie=U.end-K.end):U.end>1&&(ie=U.end-1),this.zoomAxes(this.xAxes,{start:U.start-ie,end:U.end-ie},!1,w.snapOnPan),this._panEndXRange=void 0,this._panStartXRange=void 0}!this._panEndYRange||$!="panY"&&$!="panXY"||(ie=0,(U=this._panEndYRange).start<0&&(ie=U.start),U.end>1&&(ie=U.end-1),this.zoomAxes(this.yAxes,{start:U.start-ie,end:U.end-ie},!1,w.snapOnPan),this._panEndYRange=void 0,this._panStartYRange=void 0)},R.prototype.handleCursorCanceled=function(){this._panEndXRange=void 0,this._panStartXRange=void 0},R.prototype.handleCursorPanning=function(u){var w=this.cursor,$=w.behavior,U=w.maxPanOut;if(this._panStartXRange&&($=="panX"||$=="panXY")){var K=this._panStartXRange,ie=w.xRange,ae=this.getCommonAxisRange(this.xAxes),we=K.end-K.start,Re=ie.start*(ae.end-ae.start),$e=Math.max(-U,Re+K.start),Xe=Math.min(Re+K.end,1+U);$e<=0&&(Xe=$e+we),Xe>=1&&($e=Xe-we);var Qe={start:$e,end:Xe};this._panEndXRange=Qe,this.zoomAxes(this.xAxes,Qe,!1,!1,w.maxPanOut)}!this._panStartYRange||$!="panY"&&$!="panXY"||(K=this._panStartYRange,ie=w.yRange,ae=this.getCommonAxisRange(this.yAxes),we=K.end-K.start,Re=ie.start*(ae.end-ae.start),$e=Math.max(-U,Re+K.start),Xe=Math.min(Re+K.end,1+U),$e<=0&&(Xe=$e+we),Xe>=1&&($e=Xe-we),Qe={start:$e,end:Xe},this._panEndYRange=Qe,this.zoomAxes(this.yAxes,Qe,!1,!1,w.maxPanOut)),this.handleHideCursor()},R.prototype.handleYAxisSet=function(u){},R.prototype.handleCursorZoomStart=function(u){},Object.defineProperty(R.prototype,"scrollbarX",{get:function(){return this._scrollbarX},set:function(u){var w=this;this._scrollbarX&&this.removeDispose(this._scrollbarX),this._scrollbarX=u,u&&(this._disposers.push(u),u.parent=this.topAxesContainer,u.shouldClone=!1,u.startGrip.exportable=!1,u.endGrip.exportable=!1,u.toBack(),u.orientation="horizontal",u.events.on("rangechanged",this.handleXScrollbarChange,this,!1),this.events.on("datavalidated",function(){return u.updateThumb(!1)},this,!1),u.adapter.add("positionValue",function($){var U=w.xAxes.getIndex(0);return U&&($.value=U.getPositionLabel(U.renderer.inversed?1-$.position:$.position)),$}))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"scrollbarY",{get:function(){return this._scrollbarY},set:function(u){var w=this;this._scrollbarY&&this.removeDispose(this._scrollbarY),this._scrollbarY=u,u&&(this._disposers.push(u),u.parent=this.rightAxesContainer,u.startGrip.exportable=!1,u.shouldClone=!1,u.endGrip.exportable=!1,u.toFront(),u.orientation="vertical",u.events.on("rangechanged",this.handleYScrollbarChange,this,!1),this.events.on("datavalidated",function(){return u.updateThumb(!1)},this,!1),u.adapter.add("positionValue",function($){var U=w.yAxes.getIndex(0);return U&&($.value=U.getPositionLabel($.position)),$}))},enumerable:!0,configurable:!0}),R.prototype.handleXScrollbarChange=function(u){if(this.inited){var w=u.target,$=w.range;$.start==0&&($.priority="start"),$.end==1&&($.priority="end"),$=this.zoomAxes(this.xAxes,$),w.fixRange($)}},R.prototype.handleYScrollbarChange=function(u){if(this.inited){var w=u.target,$=w.range;$.end==1&&($.priority="end"),$.start==0&&($.priority="start"),$=this.zoomAxes(this.yAxes,$),w.fixRange($)}},R.prototype.zoomAxes=function(u,w,$,U,K,ie){var ae={start:0,end:1};this.showSeriesTooltip();var we=w;return this.dataInvalid||pr(u.iterator(),function(Re){var $e=Re.maxZoomFactor;if(le(Re.minZoomCount)&&($e/=Re.minZoomCount),!(ie&&1/(w.end-w.start)>=$e)){if(Re.zoomable){if(w=Re.renderer.inversed?m(we):we,Re.hideTooltip(0),U)if(Re instanceof $h){var Xe=Re.getCellEndPosition(0)-Re.getCellStartPosition(0);w.start=Re.roundPosition(w.start+Xe/2-Re.startLocation*Xe,Re.startLocation),w.end=Re.roundPosition(w.end-Xe/2+(1-Re.endLocation)*Xe,Re.endLocation)}else w.start=Re.roundPosition(w.start+1e-4,0,Re.startLocation),w.end=Re.roundPosition(w.end+1e-4,0,Re.endLocation);var Qe=Re.zoom(w,$,$,K);Re.renderer.inversed&&(Qe=m(Qe)),ae=Qe}}}),ae},Object.defineProperty(R.prototype,"maskBullets",{get:function(){return this.getPropertyValue("maskBullets")},set:function(u){this.setPropertyValue("maskBullets",u,!0)&&this.bulletsContainer&&(this.bulletsContainer.mask=u?this._bulletMask:void 0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"arrangeTooltips",{get:function(){return this.getPropertyValue("arrangeTooltips")},set:function(u){this.setPropertyValue("arrangeTooltips",u,!0)},enumerable:!0,configurable:!0}),R.prototype.handleWheel=function(u){var w=this.plotContainer,$=If(tu(u.point,this.htmlContainer,this.svgContainer.cssScale),w),U=u.shift.y;this.handleWheelReal(U,this.mouseWheelBehavior,$)},R.prototype.handleHorizontalWheel=function(u){var w=this.plotContainer,$=If(tu(u.point,this.htmlContainer,this.svgContainer.cssScale),w);this.handleWheelReal(u.shift.x,this.horizontalMouseWheelBehavior,$)},R.prototype.handleWheelReal=function(u,w,$){if(u!=0){var U=this.plotContainer,K=this.getCommonAxisRange(this.xAxes),ie=this.getCommonAxisRange(this.yAxes),ae=.1;if(w=="panX"||w=="panXY"){var we=K.end-K.start,Re=Math.max(-0,K.start+ae*u/100*(K.end-K.start)),$e=Math.min(K.end+ae*u/100*(K.end-K.start),1);Re<=0&&($e=Re+we),$e>=1&&(Re=$e-we),this.zoomAxes(this.xAxes,{start:Re,end:$e})}if(w=="panY"||w=="panXY"){u*=-1;var Xe=ie.end-ie.start,Qe=Math.max(-0,ie.start+ae*u/100*(ie.end-ie.start)),dt=Math.min(ie.end+ae*u/100*(ie.end-ie.start),1);Qe<=0&&(dt=Qe+Xe),dt>=1&&(Qe=dt-Xe),this.zoomAxes(this.yAxes,{start:Qe,end:dt})}if(w=="zoomX"||w=="zoomXY"){var Gt=$.x/U.maxWidth,Yt=this.xAxes.getIndex(0).toAxisPosition(Gt);Re=Math.max(-0,K.start-ae*(K.end-K.start)*u/100*Gt),Re=Math.min(Re,Yt),$e=Math.min(K.end+ae*(K.end-K.start)*u/100*(1-Gt),1),$e=Math.max($e,Yt),this.zoomAxes(this.xAxes,{start:Re,end:$e},void 0,void 0,void 0,!0)}if(w=="zoomY"||w=="zoomXY"){var ai=$.y/U.maxHeight,oi=this.yAxes.getIndex(0).toAxisPosition(ai);Qe=Math.max(-0,ie.start-ae*(ie.end-ie.start)*u/100*(1-ai)),Qe=Math.min(Qe,oi),dt=Math.min(ie.end+ae*u/100*ai*(ie.end-ie.start),1),dt=Math.max(dt,oi),this.zoomAxes(this.yAxes,{start:Qe,end:dt},void 0,void 0,void 0,!0)}}},Object.defineProperty(R.prototype,"mouseWheelBehavior",{get:function(){return this.getPropertyValue("mouseWheelBehavior")},set:function(u){this.setPropertyValue("mouseWheelBehavior",u)&&(u!="none"?(this._mouseWheelDisposer=this.plotContainer.events.on("wheel",this.handleWheel,this,!1),this._disposers.push(this._mouseWheelDisposer)):this._mouseWheelDisposer&&(this.plotContainer.wheelable=!1,this.plotContainer.hoverable=!1,this._mouseWheelDisposer.dispose()))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"horizontalMouseWheelBehavior",{get:function(){return this.getPropertyValue("horizontalMouseWheelBehavior")},set:function(u){this.setPropertyValue("horizontalMouseWheelBehavior",u)&&(u!="none"?(this._mouseWheelDisposer2=this.plotContainer.events.on("wheel",this.handleHorizontalWheel,this,!1),this._disposers.push(this._mouseWheelDisposer2)):this._mouseWheelDisposer2&&(this.plotContainer.wheelable=!1,this.plotContainer.hoverable=!1,this._mouseWheelDisposer2.dispose()))},enumerable:!0,configurable:!0}),R.prototype.dataSourceDateFields=function(u){var w=this;return u=j.prototype.dataSourceDateFields.call(this,u),pr(this.series.iterator(),function($){u=w.populateDataSourceFields(u,$.dataFields,["dateX","dateY","openDateX","openDateY"])}),u},R.prototype.dataSourceNumberFields=function(u){var w=this;return u=j.prototype.dataSourceDateFields.call(this,u),pr(this.series.iterator(),function($){u=w.populateDataSourceFields(u,$.dataFields,["valueX","valueY","openValueX","openValueY"])}),u},R.prototype.processConfig=function(u){if(u){var w=[],$=[];if(Ee(u.xAxes)&&pt(u.xAxes))for(var U=0,K=u.xAxes.length;U0;){var U=this.dataItems.getIndex(0);U&&$.dataItems.remove(U),$.dataUsers.each(function(K){var ie=K.dataItems.getIndex(0);ie&&K.dataItems.remove(ie)}),$._parseDataFrom--,w--}$.invalidateData()}},R.prototype.removeData=function(u){this.scrollbarX instanceof $I&&this.removeScrollbarData(this.scrollbarX,u),this.scrollbarY instanceof $I&&this.removeScrollbarData(this.scrollbarY,u),j.prototype.removeData.call(this,u)},R.prototype.setTapToActivate=function(u){j.prototype.setTapToActivate.call(this,u),this.cursor&&(this.cursor.interactions.isTouchProtected=u,this.plotContainer.interactions.isTouchProtected=u)},R.prototype.handleTapToActivate=function(){j.prototype.handleTapToActivate.call(this),this.cursor&&(this.cursor.interactions.isTouchProtected=!1,this.plotContainer.interactions.isTouchProtected=!1)},R.prototype.handleTapToActivateDeactivation=function(){j.prototype.handleTapToActivateDeactivation.call(this),this.cursor&&(this.cursor.interactions.isTouchProtected=!0,this.plotContainer.interactions.isTouchProtected=!0)},R}(Sz);ui.registeredClasses.XYChart=G0,Zd.push({relevant:Af.maybeXS,state:function(j,R){if(j instanceof G0&&j.scrollbarX){var u=j.states.create(R);return j.scrollbarX.states.create(R).properties.disabled=!0,u}return null}}),Zd.push({relevant:Af.maybeXS,state:function(j,R){if(j instanceof G0&&j.scrollbarY){var u=j.states.create(R);return j.scrollbarY.states.create(R).properties.disabled=!0,u}return null}});var Pz=function(j){function R(){var u=j.call(this)||this;u.className="LineSeriesSegment",u.isMeasured=!1,u.interactionsEnabled=!1,u.layout="none";var w=u.createChild(so);u.fillSprite=w,w.shouldClone=!1,w.setElement(u.paper.add("path")),w.isMeasured=!1,u._disposers.push(w);var $=u.createChild(so);return u.strokeSprite=$,$.shouldClone=!1,$.fill=He(),$.setElement(u.paper.add("path")),$.isMeasured=!1,u._disposers.push($),u}return re(R,j),R.prototype.drawSegment=function(u,w,$,U){if(!this.disabled)if(u.length>0&&w.length>0&&le(u[0].x)&&le(u[0].y)){var K=ln({x:u[0].x-.2,y:u[0].y-.2})+ln(u[0]),ie=this.series;ie.smoothing=="bezier"?K+=new _1($,U).smooth(u):ie.smoothing=="monotoneX"?K+=new X0e({closed:!1}).smooth(u):ie.smoothing=="monotoneY"&&(K+=new K0e({closed:!1}).smooth(u)),this.strokeOpacity==0||this.strokeSprite.strokeOpacity==0||(this.strokeSprite.path=K),(this.fillOpacity>0||this.fillSprite.fillOpacity>0)&&le(w[0].x)&&le(w[0].y)&&(K+=br(w[0]),ie.smoothing=="bezier"?K+=new _1($,U).smooth(w):ie.smoothing=="monotoneX"?K+=new X0e({closed:!1}).smooth(w):ie.smoothing=="monotoneY"&&(K+=new K0e({closed:!1}).smooth(w)),K+=br(u[0]),K+=" Z",this.fillSprite.path=K)}else this.fillSprite.path="",this.strokeSprite.path=""},R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u);var w=this.strokeSprite;Cr(u,w.properties,gc),w.events.copyFrom(u.strokeSprite.events),w.fillOpacity=0;var $=this.fillSprite;Cr(u,$.properties,gc),$.events.copyFrom(u.fillSprite.events),$.strokeOpacity=0},R}(Zn);ui.registeredClasses.LineSeriesSegment=Pz;var ove=function(j){function R(){var u=j.call(this)||this;return u.className="DurationAxisDataItem",u.applyTheme(),u}return re(R,j),R}(c8),h8=function(j){function R(){var u=j.call(this)||this;return u._baseUnit="second",u.className="DurationAxis",u.setPropertyValue("maxZoomFactor",1e6),u.applyTheme(),u}return re(R,j),R.prototype.formatLabel=function(u,w){return this.durationFormatter.format(u,w||this.axisDurationFormat)},R.prototype.adjustMinMax=function(u,w,$,U,K){var ie,ae,we,Re=this.baseUnit;if(this.setPropertyValue("maxPrecision",0),Re=="millisecond"||Re=="second"||Re=="minute"||Re=="hour"){U<=1&&(U=1),U=Math.round(U);var $e=u,Xe=w;$===0&&($=Math.abs(w));var Qe,dt=[60,30,20,15,10,2,1],Gt=1;Re=="hour"&&(dt=[24,12,6,4,2,1]);try{for(var Yt=Ie(dt),ai=Yt.next();!ai.done;ai=Yt.next()){var oi=ai.value;if($/oi>U){Gt=oi;break}}}catch(Hi){ie={error:Hi}}finally{try{ai&&!ai.done&&(ae=Yt.return)&&ae.call(Yt)}finally{if(ie)throw ie.error}}var Ui=Math.ceil((w-u)/Gt/U),Ji=Math.log(Math.abs(Ui))*Math.LOG10E,Si=Math.pow(10,Math.floor(Ji))/10;Qe=Gt*(Ui=T(dt,Ui/Si)*Si),this.durationFormatter.getValueUnit(Qe,this.baseUnit),u=Math.floor(u/Qe)*Qe,w=Math.ceil(w/Qe)*Qe,K&&((u-=Qe)<0&&$e>=0&&(u=0),(w+=Qe)>0&&Xe<=0&&(w=0)),we={min:u,max:w,step:Qe}}else we=j.prototype.adjustMinMax.call(this,u,w,$,U,K);return this.axisDurationFormat=this.durationFormatter.getFormat(we.step,we.max,this.baseUnit),we},Object.defineProperty(R.prototype,"tooltipDurationFormat",{get:function(){return this._tooltipDurationFormat},set:function(u){this._tooltipDurationFormat=u},enumerable:!0,configurable:!0}),R.prototype.getTooltipText=function(u){var w=Ve(this.positionToValue(u),this._stepDecimalPlaces),$=this.formatLabel(w,this.tooltipDurationFormat);return this._adapterO?this._adapterO.apply("getTooltipText",$):$},Object.defineProperty(R.prototype,"baseUnit",{get:function(){return this._baseUnit},set:function(u){this._baseUnit!=u&&(this._baseUnit=u,this.durationFormatter.baseUnit=u,this.invalidate())},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.baseUnit=u.baseUnit},R}(vo);ui.registeredClasses.DurationAxis=h8,ui.registeredClasses.DurationAxisDataItem=ove;var d8=function(j){function R(){var u=j.call(this)||this;return u.className="LineSeriesDataItem",u}return re(R,j),R}(eg),Oz=function(j){function R(){var u=j.call(this)||this;return u.minDistance=.5,u.segments=new Xs(u.createSegment()),u.segments.template.applyOnClones=!0,u._disposers.push(new ta(u.segments)),u._disposers.push(u.segments.template),u._segmentsIterator=new Qp(u.segments,function(){return u.segments.create()}),u._segmentsIterator.createNewItems=!0,u.className="LineSeries",u.strokeOpacity=1,u.fillOpacity=0,u.connect=!0,u.tensionX=1,u.tensionY=1,u.autoGapCount=1.1,u.smoothing="bezier",u.segmentsContainer=u.mainContainer.createChild(Zn),u.segmentsContainer.isMeasured=!1,u.bulletsContainer.toFront(),u.applyTheme(),u}return re(R,j),R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),Ee(this.readerTitle)||(this.readerTitle=this.language.translate("Line Series"))},R.prototype.createSegment=function(){return new Pz},R.prototype.createDataItem=function(){return new d8},R.prototype.setInitialWorkingValues=function(u){var w=this._yAxis.get(),$=this._xAxis.get();if(this.appeared&&this.visible){var U=this.dataItems.getIndex(u.index-1);if(u.component=this,this.baseAxis==$&&w instanceof vo){var K=w.minZoomed;if(U&&(K=U.values.valueY.workingValue),u.setWorkingValue("valueY",K,0),u.setWorkingValue("valueY",u.values.valueY.value),$ instanceof nc)u.setWorkingLocation("dateX",u.locations.dateX-1,0),u.setWorkingLocation("dateX",u.locations.dateX);else if($ instanceof h8&&U){var ie=u.valueX;u.setWorkingValue("valueX",U.valueX,0),u.setWorkingValue("valueX",ie)}}if(this.baseAxis==w&&$ instanceof vo){var ae=$.minZoomed;U&&(ae=U.values.valueX.workingValue),u.setWorkingValue("valueX",ae,0),u.setWorkingValue("valueX",u.values.valueX.value),w instanceof nc?(u.setWorkingLocation("dateY",u.locations.dateX-1,0),u.setWorkingLocation("dateY",u.locations.dateY)):w instanceof h8&&U&&(ie=u.valueY,u.setWorkingValue("valueY",U.valueY,0),u.setWorkingValue("valueY",ie))}}else this.baseAxis==$&&w instanceof vo&&($ instanceof nc&&u.setWorkingLocation("dateX",u.locations.dateX),$ instanceof $h&&u.setWorkingLocation("categoryX",u.locations.categoryX)),this.baseAxis==w&&$ instanceof vo&&(w instanceof nc&&u.setWorkingLocation("dateY",u.locations.dateY),w instanceof $h&&u.setWorkingLocation("categoryY",u.locations.categoryY))},R.prototype.updateLegendValue=function(u,w){j.prototype.updateLegendValue.call(this,u,w),u&&u.segment&&(this.tooltipColorSource=u.segment)},R.prototype.validate=function(){var u=this;j.prototype.validate.call(this),this.xAxis&&this.yAxis&&(this._segmentsIterator.reset(),this.openSegmentWrapper(this._adjustedStartIndex),pr(this.axisRanges.iterator(),function(w){u.openSegmentWrapper(u._adjustedStartIndex,w)}),pr(this._segmentsIterator.iterator(),function(w){w.__disabled=!0}))},R.prototype.sliceData=function(){for(var u=this.startIndex,w=this.endIndex,$=this.startIndex-1;$>=0;$--)if((K=this.dataItems.getIndex($))&&K.hasValue(this._xValueFields)&&K.hasValue(this._yValueFields)){u=$;break}this._adjustedStartIndex=this.findAdjustedIndex(u,["stroke","strokeWidth","strokeDasharray","strokeOpacity","fill","fillOpacity","opacity"]),$=this.endIndex;for(var U=this.dataItems.length;$=0;ae--){var we=$.dataItems.getIndex(ae);if(we&&Ee(we.properties[ie])){u>ae&&(u=ae);break}}}),u},R.prototype.openSegmentWrapper=function(u,w){var $={index:u,axisRange:w};do $=this.openSegment($.index,$.axisRange);while($)},R.prototype.getSegment=function(){var u=this._segmentsIterator.getFirst();return u.series=this,u.isDisposed()?(this.segments.removeValue(u),this.getSegment()):u},R.prototype.openSegment=function(u,w){var $=!1,U=[];u=Math.min(u,this.dataItems.length);var K,ie=Math.min(this._workingEndIndex,this.dataItems.length);this._workingEndIndex=Math.min(this._workingEndIndex,this.dataItems.length);var ae=!1,we=this.getSegment();we.strokeDasharray=void 0,we.__disabled=!1,w?(we.parent=w.contents,Cr(w.contents,we,gc)):(Cr(this,we,gc),we.filters.clear(),we.parent=this.segmentsContainer),this.group.node.removeAttribute("fill");for(var Re=this.connect,$e=!1,Xe=u;Xe=$;we--){var Re=this.dataItems.getIndex(we);Re.hasValue(this._xValueFields)&&Re.hasValue(this._yValueFields)&&this.addPoints(ae,Re,this.xOpenField,this.yOpenField,!0)}else{var $e=this.baseAxis,Xe=w.length,Qe=this.xAxis,dt=this.yAxis;Xe>0&&($e==Qe?(ae.push({x:w[Xe-1].x,y:dt.basePoint.y}),ae.push({x:w[0].x,y:dt.basePoint.y})):(ae.push({x:Qe.basePoint.x,y:w[Xe-1].y}),ae.push({x:Qe.basePoint.x,y:w[0].y})))}return this.drawSegment(u,w,ae),ie&&U++,U0){var ie=u.createChild(OI);Cr(this,ie,gc),ie.width=$,ie.height=U,ie.y=0,ie.strokeOpacity=0,ie.visible=!0,K.y=0}var ae=u.dataItem;ae.color=this.stroke,ae.colorOrig=this.fill,Na(this.bullets.iterator(),function(we){if(we instanceof Oo&&!we.copyToLegendMarker)return!1;var Re=!1;if(we instanceof Zn&&pr(we.children.iterator(),function(Xe){if(Xe instanceof Zm)return Re=!0,!0}),!Re){var $e=we.clone();return $e.parent=u,$e.isMeasured=!0,$e.tooltipText=void 0,$e.x=$/2,w.fillOpacity>0?$e.y=0:$e.y=U/2,$e.visible=!0,Ee($e.fill)||($e.fill=w.fill),Ee($e.stroke)||($e.stroke=w.stroke),!1}})},R.prototype.disposeData=function(){j.prototype.disposeData.call(this),this.segments.clear()},Object.defineProperty(R.prototype,"autoGapCount",{get:function(){return this.getPropertyValue("autoGapCount")},set:function(u){this.setPropertyValue("autoGapCount",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"smoothing",{get:function(){return this.getPropertyValue("smoothing")},set:function(u){this.setPropertyValue("smoothing",u,!0)},enumerable:!0,configurable:!0}),R}(NI);ui.registeredClasses.LineSeries=Oz,ui.registeredClasses.LineSeriesDataItem=d8;var Rz=function(j){function R(){var u=j.call(this)||this;return u.className="RadarSeriesDataItem",u.setLocation("dateX",0,0),u.setLocation("dateY",0,0),u.setLocation("categoryX",0,0),u.setLocation("categoryY",0,0),u.applyTheme(),u}return re(R,j),R}(d8),gie=function(j){function R(){var u=j.call(this)||this;return u.className="RadarSeries",u.connectEnds=!0,u.applyTheme(),u}return re(R,j),R.prototype.validate=function(){this.chart.invalid&&this.chart.validate(),j.prototype.validate.call(this)},R.prototype.createDataItem=function(){return new Rz},R.prototype.getPoint=function(u,w,$,U,K,ie,ae){ie||(ie="valueX"),ae||(ae="valueY");var we=C({x:this.yAxis.getX(u,$,K,ae),y:this.yAxis.getY(u,$,K,ae)});we==0&&(we=1e-5);var Re=this.xAxis.getAngle(u,w,U,ie),$e=this.chart.startAngle,Xe=this.chart.endAngle;return Re<$e||Re>Xe?void 0:{x:we*A(Re),y:we*Ue(Re)}},R.prototype.addPoints=function(u,w,$,U,K){var ie=this.getPoint(w,$,U,w.locations[$],w.locations[U]);ie&&u.push(ie)},R.prototype.getMaskPath=function(){var u=this.yAxis.renderer;return lC(u.startAngle,u.endAngle-u.startAngle,u.pixelRadius,u.pixelInnerRadius)},R.prototype.drawSegment=function(u,w,$){var U=this.yAxis.renderer;this.connectEnds&&Math.abs(U.endAngle-U.startAngle)==360&&(this.dataFields[this._xOpenField]||this.dataFields[this._yOpenField]||this.stacked)&&(w.push(w[0]),$.length>0&&$.unshift($[$.length-1])),j.prototype.drawSegment.call(this,u,w,$)},Object.defineProperty(R.prototype,"connectEnds",{get:function(){return this.getPropertyValue("connectEnds")},set:function(u){this.setPropertyValue("connectEnds",u,!0)},enumerable:!0,configurable:!0}),R.prototype.positionBulletReal=function(u,w,$){var U=this.xAxis,K=this.yAxis;(wU.end||$K.end)&&(u.visible=!1),u.moveTo(this.xAxis.renderer.positionToPoint(w,$))},R.prototype.setXAxis=function(u){j.prototype.setXAxis.call(this,u),this.updateRendererRefs()},R.prototype.setYAxis=function(u){j.prototype.setYAxis.call(this,u),this.updateRendererRefs()},R.prototype.updateRendererRefs=function(){var u=this.xAxis.renderer,w=this.yAxis.renderer;u.axisRendererY=w},R}(Oz);ui.registeredClasses.RadarSeries=gie,ui.registeredClasses.RadarSeriesDataItem=Rz;var yie=function(j){function R(u){var w=j.call(this,u)||this;return w.className="AxisFillCircular",w.element=w.paper.add("path"),w.radius=he(100),w.applyTheme(),w}return re(R,j),R.prototype.draw=function(){if(j.prototype.draw.call(this),!this.__disabled&&!this.disabled&&this.axis){var u=this.axis.renderer;this.fillPath=u.getPositionRangePath(this.startPosition,this.endPosition,this.radius,Ee(this.innerRadius)?this.innerRadius:u.innerRadius,this.cornerRadius),this.path=this.fillPath}},Object.defineProperty(R.prototype,"innerRadius",{get:function(){return this.getPropertyValue("innerRadius")},set:function(u){this.setPercentProperty("innerRadius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cornerRadius",{get:function(){return this.getPropertyValue("cornerRadius")},set:function(u){this.setPropertyValue("cornerRadius",u,!0)},enumerable:!0,configurable:!0}),R}(Cz);ui.registeredClasses.AxisFillCircular=yie;var Mz=function(j){function R(){var u=j.call(this)||this;return u.className="GridCircular",u.pixelPerfect=!1,u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"innerRadius",{get:function(){return this.getPropertyValue("innerRadius")},set:function(u){this.setPercentProperty("innerRadius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),R}(B4);ui.registeredClasses.GridCircular=Mz;var p8=function(j){function R(){var u=j.call(this)||this;return u.fdx=0,u.fdy=0,u.className="AxisLabelCircular",u.padding(0,0,0,0),u.location=.5,u.locationOnPath=.5,u.radius=0,u.isMeasured=!1,u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"relativeRotation",{get:function(){return this.getPropertyValue("relativeRotation")},set:function(u){if(this.setPropertyValue("relativeRotation",u,!0),!Ee(u)){this.rotation=void 0;var w=this.dataItem;w&&w.component&&w.component.invalidateDataItems()}},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"bent",{get:function(){return this.getPropertyValue("bent")},set:function(u){this.setPropertyValue("bent",u,!0),this.setPropertyValue("wrap",!1),this.setPropertyValue("horizontalCenter","none"),this.setPropertyValue("verticalCenter","none"),u?(this.setPropertyValue("dx",0),this.setPropertyValue("dy",0),this.setPropertyValue("x",0),this.setPropertyValue("y",0),this.setPropertyValue("rotation",0),this.fdx=0,this.fdy=0,this.textAlign="middle"):this.textPathElement&&(this.textPathElement.dispose(),this.textPathElement=void 0)},enumerable:!0,configurable:!0}),R.prototype.pixelRadius=function(u){var w=1;return this.inside&&(w=-1),hs(this.radius,u)*w},R.prototype.pixelRadiusY=function(u,w){var $=1;this.inside&&($=-1);var U=this.radius;return le(U)?hs(U*=w/u,u)*$:hs(U,w)*$},R.prototype.fixPosition=function(u,w,$,U,K){le($)||($=w),le(U)||(U=0),le(K)||(K=0);var ie={x:w*A(u),y:$*Ue(u)};this.invalid&&this.validate();var ae=!1,we=this.radius;(we instanceof J&&we.value<0||we<0)&&(ae=!0);var Re=this.relativeRotation,$e=this.pixelRadius(w);if(this.bent){var Xe={x:(w+$e)*A(u+180),y:($+$e*$/w)*Ue(u+180)};return this.path=ln(Xe)+Dd(u+180,360,w+$e,$+$e*$/w),void(this.textPathElement&&this.textPathElement.attr({startOffset:100*this.locationOnPath+"%"}))}if(le(Re)){this.horizontalCenter="none",this.verticalCenter="none",u=Jt(u,-180,180);var Qe=this.bbox.width,dt=this.bbox.height,Gt=this.pixelPaddingBottom,Yt=this.pixelPaddingTop,ai=this.pixelPaddingLeft,oi=this.pixelPaddingRight;u>90||u<-90?Re==-90&&(Re=90,Qe=0):(Re==-90&&(dt=-dt),Re==90&&(Re=-90,Qe=-ai-oi,dt=-dt-Yt-Gt)),this.rotation=Re+u+90;var Ui=Ue(Re)/2,Ji=A(Re)/2,Si=this.rotation;this.dx=dt*Ui*Ue(Si)-Qe*Ji*A(Si),this.dy=-dt*Ui*A(Si)-Qe*Ji*Ue(Si),this.inside?u>90||u<-90?$e-=(Gt+Yt)*A(Re)+(ai+oi)*Ue(Re):$e+=(Gt+this.bbox.height+Yt)*A(Re)+(ai+oi+this.bbox.width)*Ue(Re):$e+=(dt+Gt+Yt)*A(Re)+(Qe+ai+oi)*Ue(Re),ie.x+=A(u)*$e,ie.y+=Ue(u)*$e*$/w}else this.horizontalCenter="middle",this.verticalCenter="middle",ae?(this.dx=0,this.dy=0,ie.x=(w+$e)*A(u),ie.y=($+$e*$/w)*Ue(u)):(this.dy=this._measuredHeight/2*Ue(u),this.dx=this._measuredWidth/2*A(u),ie.x+=A(u)*$e,ie.y+=Ue(u)*$e*$/w);ie.x+=U,ie.y+=K,this.fdx=this.dx,this.fdy=this.dy,this.moveTo(ie)},R}(Tz);ui.registeredClasses.AxisLabelCircular=p8;var vie=function(j){function R(){var u=j.call(this)||this;return u.pixelRadiusReal=0,u.layout="none",u.className="AxisRendererCircular",u.isMeasured=!1,u.startAngle=-90,u.endAngle=270,u.useChartAngles=!0,u.radius=he(100),u.isMeasured=!1,u.grid.template.location=0,u.labels.template.location=0,u.labels.template.radius=15,u.ticks.template.location=0,u.ticks.template.pixelPerfect=!1,u.tooltipLocation=0,u.line.strokeOpacity=0,u.applyTheme(),u}return re(R,j),R.prototype.setAxis=function(u){var w=this;j.prototype.setAxis.call(this,u),u.isMeasured=!1;var $=u.tooltip;$.adapter.add("dx",function(U,K){var ie=If({x:K.pixelX,y:K.pixelY},w);return w.pixelRadius*Math.cos(Math.atan2(ie.y,ie.x))-ie.x}),$.adapter.add("dy",function(U,K){var ie=If({x:K.pixelX,y:K.pixelY},w);return w.pixelRadius*Math.sin(Math.atan2(ie.y,ie.x))-ie.y})},R.prototype.validate=function(){this.chart&&this.chart.invalid&&this.chart.validate(),j.prototype.validate.call(this)},Object.defineProperty(R.prototype,"axisLength",{get:function(){return 2*Math.PI*this.pixelRadius},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!1,!1,10,!1)&&this.axis&&this.axis.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pixelRadius",{get:function(){return yo(this.radius,this.pixelRadiusReal)||0},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"innerRadius",{get:function(){var u=this.chart,w=this.getPropertyValue("innerRadius");if(u){if(Ee(w)){if(w instanceof J&&u){var $=u.mr,U=w.value;w=he(100*(U=Math.max($*U,$-Math.min(u.plotContainer.innerHeight,u.plotContainer.innerWidth))/$))}}else(w=u.innerRadius)instanceof J&&u&&(w=he(w.value*u.innerRadiusModifyer*100));return w}},set:function(u){this.setPercentProperty("innerRadius",u,!1,!1,10,!1)&&this.axis&&this.axis.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"useChartAngles",{get:function(){return this.getPropertyValue("useChartAngles")},set:function(u){this.setPropertyValue("useChartAngles",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pixelInnerRadius",{get:function(){return yo(this.innerRadius,this.pixelRadiusReal)||0},enumerable:!0,configurable:!0}),R.prototype.positionToPoint=function(u,w){le(w)||(w=1);var $=this.positionToCoordinate(u),U=this.startAngle+(this.endAngle-this.startAngle)*$/this.axisLength,K=this.pixelRadius,ie=this.pixelInnerRadius;if(this.axisRendererY){var ae=gt(this.axisRendererY.positionToCoordinate(w),0,1/0);return ae==0&&(ae=1e-6),{x:ae*A(U),y:ae*Ue(U)}}return{x:A(U)*ie+(K-ie)*A(U)*w,y:Ue(U)*ie+(K-ie)*Ue(U)*w}},R.prototype.positionToAngle=function(u){var w=this.axis,$=(this.endAngle-this.startAngle)/(w.end-w.start);return Ve(w.renderer.inversed?this.startAngle+(w.end-u)*$:this.startAngle+(u-w.start)*$,3)},R.prototype.angleToPosition=function(u){var w=this.axis,$=(this.endAngle-this.startAngle)/(w.end-w.start);return Ve(w.renderer.inversed?w.end-(u-this.startAngle)/$:(u-this.startAngle)/$+w.start,5)},R.prototype.updateAxisLine=function(){var u=this.pixelRadius,w=this.startAngle,$=W(360,this.endAngle-w);this.line.path=ln({x:u*A(w),y:u*Ue(w)})+Dd(w,$,u,u)},R.prototype.updateGridElement=function(u,w,$){w+=($-w)*u.location;var U=this.positionToPoint(w);if(le(U.x)&&le(U.y)&&u.element){var K=Ze*Math.atan2(U.y,U.x),ie=yo(Ee(u.radius)?u.radius:he(100),this.pixelRadius),ae=yo(u.innerRadius,this.pixelRadius);u.zIndex=0;var we=yo(le(ae)?ae:this.innerRadius,this.pixelRadiusReal,!0);le(we)||(we=0),u.path=ln({x:we*A(K),y:we*Ue(K)})+br({x:ie*A(K),y:ie*Ue(K)})}this.toggleVisibility(u,w,0,1)},R.prototype.updateTickElement=function(u,w,$){w+=($-w)*u.location;var U=this.positionToPoint(w);if(u.element){var K=this.pixelRadius,ie=Ze*Math.atan2(U.y,U.x),ae=u.length;u.inside&&(ae=-ae),u.zIndex=1,u.path=ln({x:K*A(ie),y:K*Ue(ie)})+br({x:(K+ae)*A(ie),y:(K+ae)*Ue(ie)})}this.toggleVisibility(u,w,0,1)},R.prototype.updateBullet=function(u,w,$){var U=.5;u instanceof V4&&(U=u.location),w+=($-w)*U;var K=this.positionToPoint(w),ie=this.pixelRadius,ae=Ze*Math.atan2(K.y,K.x);K={x:ie*A(ae),y:ie*Ue(ae)},this.positionItem(u,K),this.toggleVisibility(u,w,0,1)},R.prototype.updateLabelElement=function(u,w,$,U){Ee(U)||(U=u.location),w+=($-w)*U,u.fixPosition(this.positionToAngle(w),this.pixelRadius),u.zIndex=2,this.toggleVisibility(u,w,this.minLabelPosition,this.maxLabelPosition)},R.prototype.fitsToBounds=function(u){return!0},Object.defineProperty(R.prototype,"startAngle",{get:function(){return this.getPropertyValue("startAngle")},set:function(u){this.setPropertyValue("startAngle",u)&&(this.invalidateAxisItems(),this.axis&&this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endAngle",{get:function(){return this.getPropertyValue("endAngle")},set:function(u){this.setPropertyValue("endAngle",u)&&(this.invalidateAxisItems(),this.axis&&this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),R.prototype.getPositionRangePath=function(u,w,$,U,K){var ie="";if(le(u)&&le(w)){Ee($)||($=this.radius),u=ve(u,this.axis.start),(w=W(w,this.axis.end))0&&Xe&&Re&&Re instanceof $h){var Qe=Re.renderer.grid.template.location,dt=Re.getAngle(Xe.dataItems.getIndex(0),"categoryX",Qe);U=ln({x:K*A(dt),y:K*Ue(dt)});for(var Gt=1;Gt<$e;Gt++)U+=br({x:K*A(dt=Re.getAngle(Xe.dataItems.getIndex(Gt),"categoryX",Qe)),y:K*Ue(dt)});U+=br({x:K*A(dt=Re.getAngle(Xe.dataItems.getIndex($e-1),"categoryX",Re.renderer.cellEndLocation)),y:K*Ue(dt)})}else U=ln({x:K*A(ie),y:K*Ue(ie)})+Dd(ie,ae-ie,K,K);u.path=U}this.toggleVisibility(u,w,0,1)},R.prototype.updateLabelElement=function(u,w,$,U){Ee(U)||(U=u.location),w+=($-w)*U;var K=this.positionToPoint(w);this.positionItem(u,K),this.toggleVisibility(u,w,this.minLabelPosition,this.maxLabelPosition)},R.prototype.updateBaseGridElement=function(){},R.prototype.fitsToBounds=function(u){return!0},Object.defineProperty(R.prototype,"startAngle",{get:function(){return this.getPropertyValue("startAngle")},set:function(u){this.setPropertyValue("startAngle",u)&&this.invalidateAxisItems()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endAngle",{get:function(){return this.getPropertyValue("endAngle")},set:function(u){this.setPropertyValue("endAngle",u)&&this.invalidateAxisItems()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"axisAngle",{get:function(){return this.getPropertyValue("axisAngle")},set:function(u){this.setPropertyValue("axisAngle",ei(u)),this.invalidateAxisItems()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"gridType",{get:function(){return this.chart.xAxes.getIndex(0)instanceof $h?this.getPropertyValue("gridType"):"circles"},set:function(u){this.setPropertyValue("gridType",u,!0)},enumerable:!0,configurable:!0}),R.prototype.getPositionRangePath=function(u,w){var $,U=this.pixelInnerRadius,K=this.axisLength+U,ie=gt(this.positionToCoordinate(u),U,K),ae=gt(this.positionToCoordinate(w),U,K),we=this.startAngle,Re=this.endAngle-we,$e=this.chart,Xe=$e.xAxes.getIndex(0),Qe=$e.series.getIndex(0),dt=0;if(Qe&&(dt=Qe.dataItems.length),this.gridType=="polygons"&&dt>0&&Qe&&Xe&&Xe instanceof $h){var Gt=Xe.renderer.grid.template.location,Yt=Xe.getAngle(Qe.dataItems.getIndex(0),"categoryX",Gt);$=ln({x:ae*A(Yt),y:ae*Ue(Yt)});for(var ai=1;ai=0;ai--)$+=br({x:ie*A(Yt=Xe.getAngle(Qe.dataItems.getIndex(ai),"categoryX",Gt)),y:ie*Ue(Yt)})}else $=lC(we,Re,ae,ie);return $},R.prototype.updateBreakElement=function(u){var w=u.startLine,$=u.endLine,U=u.fillShape,K=u.startPoint,ie=u.endPoint;w.radius=Math.abs(K.y),$.radius=Math.abs(ie.y),U.radius=Math.abs(ie.y),U.innerRadius=Math.abs(K.y)},R.prototype.createBreakSprites=function(u){u.startLine=new Q$,u.endLine=new Q$,u.fillShape=new Q$},R.prototype.updateTooltip=function(){if(this.axis){var u=this.axisAngle;u<0&&(u+=360);var w="vertical";(u>45&&u<135||u>225&&u<315)&&(w="horizontal"),this.axis.updateTooltip(w,{x:-4e3,y:-4e3,width:8e3,height:8e3})}},R.prototype.updateTickElement=function(u,w,$){w+=($-w)*u.location;var U=this.positionToPoint(w);if(u.element){var K=ei(this.axisAngle+90);K/90!=Math.round(K/90)?u.pixelPerfect=!1:u.pixelPerfect=!0;var ie=-u.length;u.inside&&(ie*=-1),u.path=ln({x:0,y:0})+br({x:ie*A(K),y:ie*Ue(K)})}this.positionItem(u,U),this.toggleVisibility(u,w,0,1)},R.prototype.updateBullet=function(u,w,$){var U=.5;u instanceof V4&&(U=u.location),w+=($-w)*U;var K=this.positionToPoint(w);this.positionItem(u,K),this.toggleVisibility(u,w,0,1)},R.prototype.positionToCoordinate=function(u){var w=this.axis,$=w.axisFullLength,U=this.pixelInnerRadius;return Ve(w.renderer.inversed?(w.end-u)*$+U:(u-w.start)*$+U,1)},R.prototype.pointToPosition=function(u){var w=C(u)-this.pixelInnerRadius;return this.coordinateToPosition(w)},Object.defineProperty(R.prototype,"chart",{get:function(){return this._chart.get()},set:function(u){this._chart.set(u,null)},enumerable:!0,configurable:!0}),R}(w1);ui.registeredClasses.AxisRendererRadial=f8;var ave=function(j){function R(){var u=j.call(this)||this;return u.className="RadarChartDataItem",u.applyTheme(),u}return re(R,j),R}(Az),_ie=function(j){function R(){var u=j.call(this)||this;u._axisRendererX=vie,u._axisRendererY=f8,u.innerRadiusModifyer=1,u.mr=1,u.className="RadarChart",u.startAngle=-90,u.endAngle=270,u.radius=he(80),u.innerRadius=0;var w=u.plotContainer.createChild(Zn);return w.shouldClone=!1,w.layout="absolute",w.align="center",w.valign="middle",u.seriesContainer.parent=w,u.radarContainer=w,u.bulletsContainer.parent=w,u.axisBulletsContainer=w,u._cursorContainer=w,u.chartContainer.events.on("maxsizechanged",u.invalidate,u,!1),u._bulletMask=w.createChild(FI),u._bulletMask.shouldClone=!1,u._bulletMask.element=u.paper.add("path"),u._bulletMask.opacity=0,u.applyTheme(),u}return re(R,j),R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),Ee(this.readerTitle)||(this.readerTitle=this.language.translate("Radar chart"))},R.prototype.processAxis=function(u){j.prototype.processAxis.call(this,u);var w=u.renderer;w.gridContainer.parent=w,w.breakContainer.parent=w,u.parent=this.radarContainer,w.toBack()},R.prototype.handleXAxisRangeChange=function(){j.prototype.handleXAxisRangeChange.call(this),pr(this.yAxes.iterator(),function(u){u.invalidate()})},R.prototype.handleYAxisRangeChange=function(){j.prototype.handleYAxisRangeChange.call(this),pr(this.xAxes.iterator(),function(u){u.invalidate()})},R.prototype.processConfig=function(u){if(u&&(Ee(u.cursor)&&!Ee(u.cursor.type)&&(u.cursor.type="RadarCursor"),Ee(u.series)&&pt(u.series)))for(var w=0,$=u.series.length;w<$;w++)u.series[w].type=u.series[w].type||"RadarSeries";j.prototype.processConfig.call(this,u)},R.prototype.beforeDraw=function(){j.prototype.beforeDraw.call(this);var u=this.plotContainer,w=Xt(this.startAngle,this.endAngle,1),$={x:0,y:0,width:0,height:0},U=u.innerWidth/w.width,K=u.innerHeight/w.height,ie=this.innerRadius;if(ie instanceof J){var ae=ie.value,we=Math.min(U,K);this.mr=we,ae=Math.max(we*ae,we-Math.min(u.innerHeight,u.innerWidth))/we,$=Xt(this.startAngle,this.endAngle,ae),this.innerRadiusModifyer=ae/ie.value,ie=he(100*ae)}w=qe([w,$]);var Re=Math.min(u.innerWidth/w.width,u.innerHeight/w.height),$e=2*yo(this.radius,Re)||0,Xe=$e/2,Qe=this.startAngle,dt=this.endAngle;this._pixelInnerRadius=yo(ie,Xe),this._bulletMask.path=lC(Qe,dt-Qe,Xe,this._pixelInnerRadius),pr(this.xAxes.iterator(),function(Yt){Yt.renderer.useChartAngles&&(Yt.renderer.startAngle=Qe,Yt.renderer.endAngle=dt),Yt.width=$e,Yt.height=$e,Yt.renderer.pixelRadiusReal=Xe}),pr(this.yAxes.iterator(),function(Yt){Yt.renderer.startAngle=Qe,Yt.renderer.endAngle=dt,Yt.width=$e,Yt.height=$e,Yt.renderer.pixelRadiusReal=Xe});var Gt=this.cursor;Gt&&(Gt.width=$e,Gt.height=$e,Gt.startAngle=Qe,Gt.endAngle=dt),this.radarContainer.definedBBox={x:Xe*w.x,y:Xe*w.y,width:Xe*w.width,height:Xe*w.height},this.radarContainer.validatePosition()},R.prototype.createSeries=function(){return new gie},Object.defineProperty(R.prototype,"startAngle",{get:function(){return this.getPropertyValue("startAngle")},set:function(u){this.setPropertyValue("startAngle",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endAngle",{get:function(){return this.getPropertyValue("endAngle")},set:function(u){this.setPropertyValue("endAngle",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pixelInnerRadius",{get:function(){return this._pixelInnerRadius},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"innerRadius",{get:function(){return this.getPropertyValue("innerRadius")},set:function(u){this.setPercentProperty("innerRadius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),R.prototype.updateXAxis=function(u){u&&u.processRenderer()},R.prototype.updateYAxis=function(u){u&&u.processRenderer()},R}(G0);ui.registeredClasses.RadarChart=_ie;var Dz=function(j){function R(){var u=j.call(this)||this;u._axis=new Jn,u.className="ClockHand";var w=new $a;u.fill=w.getFor("alternativeBackground"),u.stroke=u.fill;var $=new FI;$.radius=5,u.pin=$,u.isMeasured=!1,u.startWidth=5,u.endWidth=1,u.width=he(100),u.height=he(100),u.radius=he(100),u.innerRadius=he(0);var U=new yz;return u.hand=U,u._disposers.push(u._axis),u.applyTheme(),u}return re(R,j),R.prototype.validate=function(){j.prototype.validate.call(this);var u=this.hand;u.width=this.pixelWidth;var w=Math.max(this.startWidth,this.endWidth);if(u.height=w,u.leftSide=he(this.startWidth/w*100),u.rightSide=he(this.endWidth/w*100),this.axis){var $=this.axis.renderer,U=yo(this.innerRadius,$.pixelRadius),K=yo(this.radius,$.pixelRadius);u.x=U,u.y=-w/2,u.width=K-U}},Object.defineProperty(R.prototype,"pin",{get:function(){return this._pin},set:function(u){this._pin&&this.removeDispose(this._pin),u&&(this._pin=u,u.parent=this,this._disposers.push(u))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"hand",{get:function(){return this._hand},set:function(u){this._hand&&this.removeDispose(this._hand),u&&(this._hand=u,u.parent=this,this._disposers.push(u))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"innerRadius",{get:function(){return this.getPropertyValue("innerRadius")},set:function(u){this.setPercentProperty("innerRadius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startWidth",{get:function(){return this.getPropertyValue("startWidth")},set:function(u){this.setPropertyValue("startWidth",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endWidth",{get:function(){return this.getPropertyValue("endWidth")},set:function(u){this.setPropertyValue("endWidth",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"rotationDirection",{get:function(){return this.getPropertyValue("rotationDirection")},set:function(u){this.setPropertyValue("rotationDirection",u)},enumerable:!0,configurable:!0}),R.prototype.showValue=function(u,w,$){if(this._value=u,u!=null&&(le(w)||(w=0),this.axis)){var U=this.axis.renderer.positionToAngle(this.axis.anyToPosition(u)),K=this.rotation;this.rotationDirection=="clockWise"&&UK&&(this.rotation=K+360),this.animate({property:"rotation",to:U},w,$)}},Object.defineProperty(R.prototype,"currentPosition",{get:function(){if(this.axis)return this.axis.renderer.angleToPosition(this.rotation)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"value",{get:function(){return this._value},set:function(u){this.showValue(u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"axis",{get:function(){return this._axis.get()},set:function(u){if(this.axis!=u&&this._axis.set(u,new Nn([u.events.on("datavalidated",this.updateValue,this,!1),u.events.on("datarangechanged",this.updateValue,this,!1),u.events.on("dataitemsvalidated",this.updateValue,this,!1),u.events.on("propertychanged",this.invalidate,this,!1)])),u){var w=u.chart;w&&(this.rotation=w.startAngle)}this.parent=u.renderer,this.zIndex=5},enumerable:!0,configurable:!0}),R.prototype.updateValue=function(){this.value=this.value},R.prototype.processConfig=function(u){u&&Ee(u.axis)&&ct(u.axis)&&this.map.hasKey(u.axis)&&(u.axis=this.map.getKey(u.axis)),j.prototype.processConfig.call(this,u)},R}(Zn);ui.registeredClasses.ClockHand=Dz;var bie=function(j){function R(){var u=j.call(this)||this;return u.className="GaugeChartDataItem",u.applyTheme(),u}return re(R,j),R}(ave),lve=function(j){function R(){var u=j.call(this)||this;return u.className="GaugeChart",u.startAngle=180,u.endAngle=360,u.hands=new Xs(new Dz),u.hands.events.on("inserted",u.processHand,u,!1),u._disposers.push(new ta(u.hands)),u._disposers.push(u.hands.template),u.applyTheme(),u}return re(R,j),R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),Ee(this.readerTitle)||(this.readerTitle=this.language.translate("Gauge chart"))},R.prototype.processHand=function(u){var w=u.newValue;w.axis||(w.axis=this.xAxes.getIndex(0))},R.prototype.configOrder=function(u,w){return u==w?0:u=="hands"?1:w=="hands"?-1:j.prototype.configOrder.call(this,u,w)},R}(_ie);ui.registeredClasses.GaugeChart=lve;var $x=function(j){function R(){var u=j.call(this)||this;return u.className="PercentSeriesDataItem",u.applyTheme(),u}return re(R,j),R.prototype.uidAttr=function(){return this.slice.uidAttr()},R.prototype.hide=function(u,w,$,U){return U||(U=["value"]),j.prototype.hide.call(this,u,w,0,U)},R.prototype.setVisibility=function(u,w){w||(u?this.setWorkingValue("value",this.values.value.value,0,0):this.setWorkingValue("value",0,0,0)),j.prototype.setVisibility.call(this,u,w)},R.prototype.show=function(u,w,$){return $||($=["value"]),j.prototype.show.call(this,u,w,$)},Object.defineProperty(R.prototype,"category",{get:function(){return this.properties.category},set:function(u){this.setProperty("category",u)},enumerable:!0,configurable:!0}),R.prototype.createLegendMarker=function(u){this.component.createLegendMarker(u,this)},Object.defineProperty(R.prototype,"legendDataItem",{get:function(){return this._legendDataItem},set:function(u){this._legendDataItem=u,u.label&&(u.label.dataItem=this),u.valueLabel&&(u.valueLabel.dataItem=this)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tick",{get:function(){var u=this;if(!this._tick){var w=this.component.ticks.create();this._tick=w,this.addSprite(w),this._disposers.push(w),w.parent=this.component.ticksContainer,this._disposers.push(new jr(function(){u.component&&u.component.ticks.removeValue(w)})),w.visible=this.visible}return this._tick},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"label",{get:function(){var u=this;if(!this._label){var w=this.component.labels.create();this.addSprite(w),this._label=w,this._disposers.push(w),w.parent=this.component.labelsContainer,this._disposers.push(new jr(function(){u.component&&u.component.labels.removeValue(w)})),w.visible=this.visible}return this._label},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"slice",{get:function(){var u=this;if(!this._slice){var w=this.component,$=w.slices.create();this.addSprite($),this._slice=$,this._disposers.push($),$.parent=w.slicesContainer,this._disposers.push(new jr(function(){w.slices.removeValue($)})),$.visible=this.visible,w.itemsFocusable()?(Ee(this.component.role)||(this.component.role="menu"),Ee($.role)||($.role="menuitem"),$.focusable=!0):(Ee(this.component.role)||(this.component.role="list"),Ee($.role)||($.role="listitem"),$.focusable=!1),$.focusable&&($.events.on("focus",function(U){$.readerTitle=w.populateString(w.itemReaderText,u)},void 0,!1),$.events.on("blur",function(U){$.readerTitle=""},void 0,!1)),$.hoverable&&($.events.on("over",function(U){$.readerTitle=w.populateString(w.itemReaderText,u)},void 0,!1),$.events.on("out",function(U){$.readerTitle=""},void 0,!1))}return this._slice},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"hiddenInLegend",{get:function(){return this.properties.hiddenInLegend},set:function(u){this.setProperty("hiddenInLegend",u)},enumerable:!0,configurable:!0}),R}(s8),m8=function(j){function R(){var u=j.call(this)||this;u.className="PercentSeries",u._addAllDataItems=!1,u.colors=new Qm,u.colors.step=1,u.isMeasured=!0,u.calculatePercent=!0;var w=u.createChild(Zn);w.shouldClone=!1,w.isMeasured=!1,u.slicesContainer=w;var $=u.createChild(Zn);$.shouldClone=!1,$.isMeasured=!1,$.layout="none",u.ticksContainer=$;var U=u.createChild(Zn);return U.shouldClone=!1,U.isMeasured=!1,U.layout="none",u.labelsContainer=U,u.alignLabels=!1,u.bulletsContainer.toFront(),u.skipFocusThreshold=50,u.defaultState.transitionEasing=v4,u.itemReaderText="{category}: {value.percent.formatNumber('#.#p')}",u.applyTheme(),u}return re(R,j),R.prototype.createSlice=function(){return new so},R.prototype.createTick=function(){return new G4},R.prototype.createLabel=function(){return new Zm},Object.defineProperty(R.prototype,"slices",{get:function(){if(!this._slices){var u=this.createSlice();u.applyOnClones=!0,this._disposers.push(u),this.initSlice(u),this._slices=new Xs(u),this._disposers.push(new ta(this._slices))}return this._slices},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"ticks",{get:function(){if(!this._ticks){var u=this.createTick();u.applyOnClones=!0,this._disposers.push(u),this.initTick(u),this._ticks=new Xs(u),this._disposers.push(new ta(this._ticks))}return this._ticks},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"labels",{get:function(){if(!this._labels){var u=this.createLabel();u.applyOnClones=!0,this._disposers.push(u),this.initLabel(u),this._labels=new Xs(u),this._disposers.push(new ta(this._labels))}return this._labels},enumerable:!0,configurable:!0}),R.prototype.createDataItem=function(){return new $x},R.prototype.initSlice=function(u){},R.prototype.initLabel=function(u){u.text="{category}: {value.percent.formatNumber('#.0p')}",u.isMeasured=!1,u.padding(5,5,5,5)},R.prototype.initTick=function(u){},R.prototype.validateDataItems=function(){this.colors.reset(),this.patterns&&this.patterns.reset(),j.prototype.validateDataItems.call(this)},R.prototype.validateDataElement=function(u){var w=u.slice;w&&(w.fill==null?this.patterns?(Ee(w.stroke)||(w.stroke=this.colors.next()),w.fill=this.patterns.next(),Ee(w.fillOpacity)&&(w.fill.backgroundOpacity=w.fillOpacity),w.stroke instanceof Te&&(w.fill.stroke=w.stroke,w.fill.fill=w.stroke)):w.fill=this.colors.next():this.colors.currentStep+=this.colors.step,w.stroke==null&&(w.stroke=w.fill)),j.prototype.validateDataElement.call(this,u),w&&u.bullets.each(function($,U){U.fill==null&&(U.fill=w.fill),U.stroke==null&&(U.stroke=w.stroke)}),this.updateLegendValue(u)},R.prototype.validateData=function(){j.prototype.validateData.call(this),this.chart&&this.chart.feedLegend()},R.prototype.arrangeLabels=function(u){for(var w=0,$=u.length;w<$;w++){var U=u[w].label;if(U){U.invalid&&U.validate();var K=U.measuredHeight;U.visible||(K=0),U.pixelY-K/2<-this.maxHeight/2&&(U.y=-this.maxHeight/2+K/2);var ie=this.getNextLabel(w+1,u),ae=U.pixelY+K;ie&&ie.y=0;$--){var U=u[$].label;if(U){U.invalid&&U.validate();var K=U.measuredHeight;U.visible||(K=0),$==u.length-1&&(w+=K/2),U.pixelY+K>w&&(U.y=w-K,w=U.y)}}},R.prototype.getNextLabel=function(u,w){if(w.length>=u){var $=w[u];if($)return $.label&&$.visible?$.label:this.getNextLabel(u+1,w)}},Object.defineProperty(R.prototype,"colors",{get:function(){return this.getPropertyValue("colors")},set:function(u){this.setPropertyValue("colors",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"patterns",{get:function(){return this.getPropertyValue("patterns")},set:function(u){this.setPropertyValue("patterns",u,!0)},enumerable:!0,configurable:!0}),R.prototype.createLegendMarker=function(u,w){pr(u.children.iterator(),function($){var U=w.slice;$.defaultState.properties.fill=U.fill,$.defaultState.properties.stroke=U.stroke,$.defaultState.properties.fillOpacity=U.fillOpacity,$.defaultState.properties.strokeOpacity=U.strokeOpacity,$.fill=U.fill,$.stroke=U.stroke,$.fillOpacity=U.fillOpacity,$.strokeOpacity=U.strokeOpacity,$.fill==null&&($.__disabled=!0);var K=u.dataItem;K.color=U.fill,K.colorOrig=U.fill,$.addDisposer(U.events.on("propertychanged",function(ie){ie.property=="fill"&&($.__disabled=!1,$.isActive||($.fill=U.fill),$.defaultState.properties.fill=U.fill,K.color=U.fill,K.colorOrig=U.fill),ie.property=="stroke"&&($.isActive||($.stroke=U.stroke),$.defaultState.properties.stroke=U.stroke),ie.property=="strokeOpacity"&&($.isActive||($.strokeOpacity=U.strokeOpacity),$.defaultState.properties.strokeOpacity=U.strokeOpacity)},void 0,!1))})},R.prototype.handleSliceScale=function(u){var w=this,$=u.target.dataItem;$&&$.bullets&&pr($.bullets.iterator(),function(U){var K=U[1];w.positionBullet(K)})},R.prototype.handleSliceMove=function(u){},R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.slices.template.copyFrom(u.slices.template),this.labels.template.copyFrom(u.labels.template),this.ticks.template.copyFrom(u.ticks.template),this.colors=u.colors.clone()},Object.defineProperty(R.prototype,"alignLabels",{get:function(){return this.getPropertyValue("alignLabels")},set:function(u){this.setAlignLabels(u)},enumerable:!0,configurable:!0}),R.prototype.setAlignLabels=function(u){this.setPropertyValue("alignLabels",u,!0)},Object.defineProperty(R.prototype,"ignoreZeroValues",{get:function(){return this.getPropertyValue("ignoreZeroValues")},set:function(u){this.setPropertyValue("ignoreZeroValues",u,!0)},enumerable:!0,configurable:!0}),R.prototype.updateLegendValue=function(u){if(u){var w=u.legendDataItem,$=u.legendSettings;w&&$&&$&&($.labelText&&(w.label.text=$.labelText),$.itemLabelText&&(w.label.text=$.itemLabelText),$.valueText&&(w.valueLabel.text=$.valueText),$.itemValueText&&(w.valueLabel.text=$.itemValueText))}},R}(o8);ui.registeredClasses.PercentSeries=m8,ui.registeredClasses.PercentSeriesDataItem=$x,Zd.push({relevant:Af.maybeXS,state:function(j,R){if(j instanceof m8){var u=j.states.create(R);return j.labels.template.states.create(R).properties.disabled=!0,j.ticks.template.states.create(R).properties.disabled=!0,u}return null}});var wie=function(j){function R(){var u=j.call(this)||this;return u.className="PercentChartDataItem",u.applyTheme(),u}return re(R,j),R}(hie),Fz=function(j){function R(){var u=j.call(this)||this;return u.className="PercentChart",u.align="none",u.valign="none",u.chartContainer.minHeight=50,u.chartContainer.minWidth=50,u.applyTheme(),u}return re(R,j),R.prototype.validateData=function(){j.prototype.validateData.call(this),this.feedLegend()},R.prototype.feedLegend=function(){var u=this.legend;if(u){var w=[];pr(this.series.iterator(),function($){$.hiddenInLegend||pr($.dataItems.iterator(),function(U){U.hiddenInLegend||(w.push(U),U.legendSettings||(U.legendSettings=$.legendSettings))})}),u.data=w,u.dataFields.name="category"}},R.prototype.createSeries=function(){return new m8},R.prototype.setLegend=function(u){j.prototype.setLegend.call(this,u),u&&(u.labels.template.text="{category}",u.valueLabels.template.text="{value.percent.formatNumber('#.0p')}",u.itemContainers.template.events.on("over",function(w){var $=w.target.dataItem.dataContext;if($.visible&&!$.isHiding){var U=$.slice;U.dispatchImmediately("over"),U.isHover=!0,U.interactions.isRealHover=!0}}),u.itemContainers.template.events.on("out",function(w){var $=w.target.dataItem.dataContext.slice;$.dispatchImmediately("out"),$.isHover=!1}))},R}(Sz);ui.registeredClasses.PercentChart=Fz,ui.registeredClasses.PercentChartDataItem=wie;var xie=function(j){function R(){var u=j.call(this)||this;return u._label=new Jn,u._slice=new Jn,u.className="PieTick",u.element=u.paper.add("polyline"),u._disposers.push(u._label),u._disposers.push(u._slice),u.applyTheme(),u}return re(R,j),R.prototype.draw=function(){j.prototype.draw.call(this);var u=this.slice,w=this.label,$=u.dataItem.component;if(u&&u.radius>0&&w&&w.text){var U=u.dx+u.slice.dx+u.pixelX+u.ix*u.radius*u.scale,K=u.dy+u.slice.dy+u.pixelY+u.iy*u.radiusY*u.scale,ie=void 0,ae=void 0,we=void 0,Re=void 0;if($.alignLabels)ie=w.pixelX-this.length,ae=w.pixelY,we=w.pixelX,Re=ae,w.horizontalCenter=="right"&&(we=(ie+=2*this.length)-this.length);else{var $e=w.pixelRadius(u.radius);we=ie=U+$e*u.ix,Re=ae=K+$e*u.iy}this.element.attr({points:[U,K,ie,ae,we,Re]})}},Object.defineProperty(R.prototype,"slice",{get:function(){return this._slice.get()},set:function(u){this._slice.set(u,new Nn([u.events.on("transformed",this.invalidate,this),u.events.on("validated",this.invalidate,this)]))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"label",{get:function(){return this._label.get()},set:function(u){this._label.set(u,u.events.on("transformed",this.invalidate,this,!1))},enumerable:!0,configurable:!0}),R}(G4);ui.registeredClasses.PieTick=xie;var Lz=function(j){function R(){var u=j.call(this)||this;return u.className="PieSeriesDataItem",u.values.radiusValue={},u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"radiusValue",{get:function(){return this.values.radiusValue.value},set:function(u){this.setValue("radiusValue",u)},enumerable:!0,configurable:!0}),R.prototype.hide=function(u,w,$,U){return j.prototype.hide.call(this,u,w,0,["value","radiusValue"])},R.prototype.show=function(u,w,$){return j.prototype.show.call(this,u,w,["value","radiusValue"])},R}($x),kz=function(j){function R(){var u=j.call(this)||this;return u.className="PieSeries",u.alignLabels=!0,u.layout="none",u.labels.template.radius=he(5),u.addDisposer(u.labels.template.events.on("enabled",u.invalidate,u,!1)),u.applyTheme(),u}return re(R,j),R.prototype.createSlice=function(){return new LI},R.prototype.createTick=function(){return new xie},R.prototype.createLabel=function(){return new p8},R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),Ee(this.readerTitle)||(this.readerTitle=this.language.translate("Pie Slice Series"))},R.prototype.createDataItem=function(){return new Lz},R.prototype.initSlice=function(u){u.isMeasured=!1,u.defaultState.properties.scale=1,u.observe("scale",this.handleSliceScale,this),u.observe(["dx","dy","x","y","shiftRadius"],this.handleSliceMove,this),u.tooltipText="{category}: {value.percent.formatNumber('#.#p')} ({value.value})",u.states.create("hover").properties.scale=1.05,u.defaultState.properties.shiftRadius=0,u.togglable=!0,u.events.on("toggled",function(w){w.target.hideTooltip(),w.target.interactions.lastHitPointer&&w.target.interactions.lastHitPointer.touch&&!w.target.isActive&&(w.target.isHover=!1)}),u.states.create("active").properties.shiftRadius=.1},R.prototype.validate=function(){this._leftItems=[],this._rightItems=[],this._currentStartAngle=this.startAngle,this._arcRect=Xt(this.startAngle,this.endAngle),this._maxRadiusPercent=0;for(var u=this.startIndex;uthis._maxRadiusPercent&&(this._maxRadiusPercent=w)}j.prototype.validate.call(this),this.alignLabels&&(this.startAngle>this.endAngle?this._rightItems.reverse():this._leftItems.reverse(),this._rightItems.sort(function($,U){var K=($.slice.middleAngle+360)%360,ie=(U.slice.middleAngle+360)%360;return K>270&&(K-=360),ie>270&&(ie-=360),Kie?1:0}),this._leftItems.sort(function($,U){var K=($.slice.middleAngle+360)%360,ie=(U.slice.middleAngle+360)%360;return Kie?-1:0}),this.arrangeLabels(this._rightItems),this.arrangeLabels2(this._rightItems),this.arrangeLabels(this._leftItems),this.arrangeLabels2(this._leftItems))},R.prototype.validateDataElement=function(u){if(this.pixelRadius>0){!this.ignoreZeroValues||u.value!=0&&u.value!=null?u.__disabled=!1:u.__disabled=!0;var w=u.slice;if(w.radius=this.pixelRadius,le(u.radiusValue)&&(w.radius=this.pixelInnerRadius+(this.pixelRadius-this.pixelInnerRadius)*u.values.radiusValue.percent/this._maxRadiusPercent),w.innerRadius instanceof J||(w.innerRadius=this.pixelInnerRadius),w.startAngle=this._currentStartAngle,w.arc=Math.abs(u.values.value.percent)*(this.endAngle-this.startAngle)/100,!this.labels.template.disabled){var $=u.label,U=u.tick;U.slice=w,U.label=$;var K=(w.middleAngle+360)%360,ie=void 0;if(this.alignLabels){var ae=$.pixelRadius(w.radius),we=U.length+ae;$.dx=0,$.dy=0,$.verticalCenter="middle";var Re=this._arcRect;K>270||K<=90?(we+=(Re.width+Re.x)*this.pixelRadius,$.horizontalCenter="left",this._rightItems.push(u)):(we-=Re.x*this.pixelRadius,$.horizontalCenter="right",this._leftItems.push(u),we*=-1);var $e=w.radius+U.length+ae;ie={x:we,y:w.iy*$e},$.moveTo(ie)}else{var Xe=w.depth;le(Xe)||(Xe=0),$.fixPosition(w.middleAngle,w.radius,w.radiusY,0,-Xe)}}this._currentStartAngle+=w.arc,j.prototype.validateDataElement.call(this,u)}},Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!0,!1,10,!1)&&this.invalidateDataItems()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pixelRadius",{get:function(){return this._pixelRadius},set:function(u){this._pixelRadius!=u&&(this._pixelRadius=u,this.invalidateDataItems())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pixelInnerRadius",{get:function(){return this._pixelInnerRadius},set:function(u){this._pixelInnerRadius!=u&&(this._pixelInnerRadius=u,this.invalidateDataItems())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"innerRadius",{get:function(){return this.getPropertyValue("innerRadius")},set:function(u){this.setPercentProperty("innerRadius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startAngle",{get:function(){var u=this.getPropertyValue("startAngle");return le(u)?u:this._startAngleInternal},set:function(u){this.setPropertyValue("startAngle",ei(u),!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endAngle",{get:function(){var u=this.getPropertyValue("endAngle");return le(u)?u:this._endAngleInternal},set:function(u){this.setPropertyValue("endAngle",u,!0)},enumerable:!0,configurable:!0}),R.prototype.positionBullet=function(u){j.prototype.positionBullet.call(this,u);var w=u.dataItem.slice,$=u.locationX;le($)||($=.5);var U=u.locationY;le(U)||(U=1);var K=w.startAngle+w.arc*$;u.x=U*w.radius*A(K),u.y=U*w.radiusY*Ue(K)},R.prototype.handleSliceMove=function(u){if(!this.alignLabels){var w=u.target,$=w.dataItem;if($){var U=$.label;U&&(U.dx=U.fdx+w.dx+w.pixelX,U.dy=U.fdy+w.dy+w.pixelY)}}},Object.defineProperty(R.prototype,"bbox",{get:function(){if(this.definedBBox)return this.definedBBox;var u=this.chart;return u?Xt(u.startAngle,u.endAngle,this.pixelRadius):Xt(this.startAngle,this.endAngle,this.pixelRadius)},enumerable:!0,configurable:!0}),R}(m8);ui.registeredClasses.PieSeries=kz,ui.registeredClasses.PieSeriesDataItem=Lz;var U4=function(j){function R(){var u=j.call(this)||this;return u.className="PieChartDataItem",u.applyTheme(),u}return re(R,j),R}(wie),Sie=function(j){function R(){var u=j.call(this)||this;u.className="PieChart",u.innerRadius=0,u.radius=he(80),u.align="none",u.valign="none",u.startAngle=-90,u.endAngle=270;var w=u.seriesContainer;return w.isMeasured=!0,w.valign="middle",w.align="center",w.layout="absolute",w.width=void 0,w.height=void 0,u.chartContainer.minHeight=50,u.chartContainer.minWidth=50,u.chartContainer.events.on("maxsizechanged",u.updateRadius,u,!1),u.applyTheme(),u}return re(R,j),R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),Ee(this.readerTitle)||(this.readerTitle=this.language.translate("Pie chart"))},R.prototype.validateLayout=function(){j.prototype.validateLayout.call(this),this.updateRadius()},R.prototype.handleSeriesAdded=function(u){j.prototype.handleSeriesAdded.call(this,u),this._chartPixelRadius=void 0,this.updateSeriesAngles()},R.prototype.updateSeriesAngles=function(){var u=this;this.series.each(function(w){w._startAngleInternal=u.startAngle,w._endAngleInternal=u.endAngle})},R.prototype.updateRadius=function(){var u=this.chartContainer,w=Xt(this.startAngle,this.endAngle,1),$={x:0,y:0,width:0,height:0},U=this.innerRadius;U instanceof J&&($=Xt(this.startAngle,this.endAngle,U.value)),w=qe([w,$]);var K=Math.min(u.innerWidth/w.width,u.innerHeight/w.height);le(K)||(K=0);var ie=yo(this.radius,K),ae=yo(this.innerRadius,K),we=(ie-ae)/this.series.length;ie==this._chartPixelRadius&&ae==this._chartPixelInnerRadius||(this._chartPixelRadius=ie,this._chartPixelInnerRadius=ae,pr(ch(this.series.iterator()),function(Re){var $e=Re[0],Xe=Re[1],Qe=ae+yo(Xe.radius,ie-ae),dt=ae+yo(Xe.innerRadius,ie-ae);le(Qe)||(Qe=ae+we*($e+1)),le(dt)||(dt=ae+we*$e),Xe.pixelRadius=Qe,Xe.pixelInnerRadius=dt}),this.seriesContainer.definedBBox={x:ie*w.x,y:ie*w.y,width:ie*w.width,height:ie*w.height},this.seriesContainer.invalidateLayout(),this.bulletsContainer.x=this.seriesContainer.x,this.bulletsContainer.y=this.seriesContainer.y)},Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!0,!1,10,!1)&&this.invalidateLayout()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"innerRadius",{get:function(){return this.getPropertyValue("innerRadius")},set:function(u){this.setPercentProperty("innerRadius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),R.prototype.createSeries=function(){return new kz},Object.defineProperty(R.prototype,"startAngle",{get:function(){return this.getPropertyValue("startAngle")},set:function(u){this.setPropertyValue("startAngle",u)&&(this.updateRadius(),this.updateSeriesAngles())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endAngle",{get:function(){return this.getPropertyValue("endAngle")},set:function(u){this.setPropertyValue("endAngle",u)&&(this.updateRadius(),this.updateSeriesAngles())},enumerable:!0,configurable:!0}),R}(Fz);ui.registeredClasses.PieChart=Sie,ui.registeredClasses.PieChartDataItem=U4;var pC=function(j){function R(){var u=j.call(this)||this;return u.className="PieSeries3DDataItem",u.values.depthValue={},u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"depthValue",{get:function(){return this.values.depthValue.value},set:function(u){this.setValue("depthValue",u)},enumerable:!0,configurable:!0}),R}(Lz),Cie=function(j){function R(){var u=j.call(this)||this;return u.className="PieSeries3D",u.applyTheme(),u}return re(R,j),R.prototype.createDataItem=function(){return new pC},R.prototype.createSlice=function(){return new J0e},R.prototype.validateDataElement=function(u){var w=u.slice,$=this.depth;le($)||($=this.chart.depth);var U=u.values.depthValue.percent;le(U)||(U=100),w.depth=U*$/100;var K=this.angle;le(K)||(K=this.chart.angle),w.angle=K,j.prototype.validateDataElement.call(this,u)},R.prototype.validate=function(){j.prototype.validate.call(this);for(var u=this._workingStartIndex;u=-90&&$<90?w.toFront():$>=90&&w.toBack()}},Object.defineProperty(R.prototype,"depth",{get:function(){return this.getPropertyValue("depth")},set:function(u){this.setPropertyValue("depth",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"angle",{get:function(){return this.getPropertyValue("angle")},set:function(u){this.setPropertyValue("angle",u)},enumerable:!0,configurable:!0}),R.prototype.positionBullet=function(u){j.prototype.positionBullet.call(this,u);var w=u.dataItem.slice;u.y=u.pixelY-w.depth},R}(kz);ui.registeredClasses.PieSeries3D=Cie,ui.registeredClasses.PieSeries3DDataItem=pC;var uve=function(j){function R(){var u=j.call(this)||this;return u.className="PieChart3DDataItem",u.applyTheme(),u}return re(R,j),R}(U4),cve=function(j){function R(){var u=j.call(this)||this;return u.className="PieChart3D",u.depth=20,u.angle=10,u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"depth",{get:function(){return this.getPropertyValue("depth")},set:function(u){this.setPropertyValue("depth",u)&&this.invalidateDataUsers()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"angle",{get:function(){return this.getPropertyValue("angle")},set:function(u){u=gt(u,0,90),this.setPropertyValue("angle",u)&&this.invalidateDataUsers()},enumerable:!0,configurable:!0}),R.prototype.createSeries=function(){return new Cie},R}(Sie);ui.registeredClasses.PieChart3D=cve;var j4=function(j){function R(){var u=j.call(this)||this;return u.className="SlicedChartDataItem",u.applyTheme(),u}return re(R,j),R}(wie),Tie=function(j){function R(){var u=j.call(this)||this;return u.className="SlicedChart",u.seriesContainer.layout="horizontal",u.padding(15,15,15,15),u.applyTheme(),u}return re(R,j),R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),Ee(this.readerTitle)||(this.readerTitle=this.language.translate("Sliced chart"))},R.prototype.validate=function(){j.prototype.validate.call(this)},R}(Fz);ui.registeredClasses.SlicedChart=Tie,ui.registeredClasses.SlicedChartDataItem=j4;var g8=function(j){function R(){var u=j.call(this)||this;return u.legendSettings=new cie,u.className="FlowDiagramNode",u.isMeasured=!1,new $a,u.draggable=!0,u.inert=!0,u.setStateOnChildren=!0,u.events.on("positionchanged",u.invalidateLinks,u,!1),u.events.on("sizechanged",u.invalidateLinks,u,!1),u}return re(R,j),R.prototype.handleHit=function(u){this.isHidden||this.isHiding?this.show():this.hide()},R.prototype.show=function(u){var w=j.prototype.show.call(this,u);return this.outgoingDataItems.each(function($){(!$.toNode||$.toNode&&!$.toNode.isHidden)&&($.setWorkingValue("value",$.getValue("value"),u),$.link.show())}),this.incomingDataItems.each(function($){(!$.fromNode||$.fromNode&&!$.fromNode.isHidden)&&($.setWorkingValue("value",$.getValue("value"),u),$.link.show())}),w},R.prototype.hide=function(u){var w=j.prototype.hide.call(this,u);return this.outgoingDataItems.each(function($){$.setWorkingValue("value",0,u),$.link.hide()}),this.incomingDataItems.each(function($){$.setWorkingValue("value",0,u),$.link.hide()}),w},R.prototype.validate=function(){this.isDisposed()||(j.prototype.validate.call(this),this.invalidateLinks())},R.prototype.invalidateLinks=function(){var u=this;this.outgoingDataItems.each(function(w){var $=w.link;if($.colorMode=="fromNode"&&($.fill=$.dataItem.fromNode.color),$.colorMode=="gradient"){$.fill=$.gradient,$.stroke=$.gradient;var U=$.gradient.stops.getIndex(0);U&&(U.color=u.color,$.gradient.validate())}}),this.incomingDataItems.each(function(w){var $=w.link;if($.colorMode=="toNode"&&($.fill=$.dataItem.toNode.color),$.colorMode=="gradient"){$.fill=$.gradient,$.stroke=$.gradient;var U=$.gradient.stops.getIndex(1);U&&(U.color=u.color,$.gradient.validate())}})},Object.defineProperty(R.prototype,"incomingDataItems",{get:function(){var u=this;if(!this._incomingDataItems){var w=new Us;w.events.on("inserted",function(){u.chart.sortBy=="name"?u._incomingSorted=Uo(u._incomingDataItems.iterator(),function($,U){return Ph($.fromName,U.fromName)}):u.chart.sortBy=="value"?u._incomingSorted=Uo(u._incomingDataItems.iterator(),function($,U){return yu(ih($.value,U.value))}):u._incomingSorted=u._incomingDataItems.iterator()},void 0,!1),this._incomingDataItems=w}return this._incomingDataItems},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"outgoingDataItems",{get:function(){var u=this;if(!this._outgoingDataItems){var w=new Us;w.events.on("inserted",function(){u.chart.sortBy=="name"?u._outgoingSorted=Uo(u._outgoingDataItems.iterator(),function($,U){return Ph($.fromName,U.fromName)}):u.chart.sortBy=="value"?u._outgoingSorted=Uo(u._outgoingDataItems.iterator(),function($,U){return yu(ih($.value,U.value))}):u._outgoingSorted=u._outgoingDataItems.iterator()},void 0,!1),this._outgoingDataItems=w}return this._outgoingDataItems},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"name",{get:function(){return this.getPropertyValue("name")},set:function(u){this.setPropertyValue("name",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"total",{get:function(){return this.getPropertyValue("total")},set:function(u){this.setPropertyValue("total",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"totalIncoming",{get:function(){return this.getPropertyValue("totalIncoming")},set:function(u){this.setPropertyValue("totalIncoming",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"totalOutgoing",{get:function(){return this.getPropertyValue("totalOutgoing")},set:function(u){this.setPropertyValue("totalOutgoing",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"color",{get:function(){return this.getPropertyValue("color")},set:function(u){this.setColorProperty("color",u),this._background&&(this._background.fill=u),this.fill=u},enumerable:!0,configurable:!0}),R.prototype.createLegendMarker=function(u){var w=u.pixelWidth,$=u.pixelHeight;u.removeChildren();var U=u.createChild(Nb);U.shouldClone=!1,Cr(this,U,gc),U.stroke=this.fill,U.copyFrom(this),U.padding(0,0,0,0),U.width=w,U.height=$;var K=u.dataItem;K.color=U.fill,K.colorOrig=U.fill},Object.defineProperty(R.prototype,"legendDataItem",{get:function(){return this._legendDataItem},set:function(u){this._legendDataItem=u,this._legendDataItem.itemContainer.deepInvalidate()},enumerable:!0,configurable:!0}),R}(Zn);ui.registeredClasses.FlowDiagramNode=g8;var z4=function(j){function R(){var u=j.call(this)||this;u.className="FlowDiagramLink";var w=new $a;return u.maskBullets=!1,u.colorMode="fromNode",u.layout="none",u.isMeasured=!1,u.startAngle=0,u.endAngle=0,u.strokeOpacity=0,u.verticalCenter="none",u.horizontalCenter="none",u.tooltipText="{fromName}→{toName}:{value.value}",u.tooltipLocation=.5,u.link=u.createChild(so),u.link.shouldClone=!1,u.link.setElement(u.paper.add("path")),u.link.isMeasured=!1,u.fillOpacity=.2,u.fill=w.getFor("alternativeBackground"),u.applyTheme(),u}return re(R,j),R.prototype.positionBullets=function(){var u=this;pr(this.bullets.iterator(),function(w){w.parent=u.bulletsContainer,w.maxWidth=u.maxWidth,w.maxHeight=u.maxHeight,u.positionBullet(w)})},Object.defineProperty(R.prototype,"bulletsContainer",{get:function(){if(!this._bulletsContainer){var u=this.createChild(Zn);u.shouldClone=!1,u.layout="none",this._bulletsContainer=u}return this._bulletsContainer},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"bulletsMask",{get:function(){if(!this._bulletsMask){var u=this.createChild(so);u.shouldClone=!1,u.setElement(this.paper.add("path")),u.isMeasured=!1,this._bulletsMask=u}return this._bulletsMask},enumerable:!0,configurable:!0}),R.prototype.positionBullet=function(u){var w=u.locationX;le(w)||(w=u.locationY),le(w)||(w=.5);var $=this.middleLine.positionToPoint(w);u.moveTo($);var U,K=u.propertyFields.rotation;u.dataItem&&(U=u.dataItem.dataContext[K]),le(U)||(U=$.angle),u.rotation=U},Object.defineProperty(R.prototype,"startAngle",{get:function(){return this.getPropertyValue("startAngle")},set:function(u){this.setPropertyValue("startAngle",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endAngle",{get:function(){return this.getPropertyValue("endAngle")},set:function(u){this.setPropertyValue("endAngle",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"colorMode",{get:function(){return this.getPropertyValue("colorMode")},set:function(u){if(u=="gradient"){var w=this.fill;this.gradient.stops.clear(),w instanceof Te&&(this.gradient.addColor(w),this.gradient.addColor(w)),this.fill=this.gradient,this.stroke=this.gradient}this.setPropertyValue("colorMode",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maskBullets",{get:function(){return this.getPropertyValue("maskBullets")},set:function(u){this.setPropertyValue("maskBullets",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tooltipLocation",{get:function(){return this.getPropertyValue("tooltipLocation")},set:function(u){this.setPropertyValue("tooltipLocation",u,!0)},enumerable:!0,configurable:!0}),R.prototype.setFill=function(u){j.prototype.setFill.call(this,u);var w=this._gradient;w&&u instanceof Te&&(w.stops.clear(),w.addColor(u),w.addColor(u))},R.prototype.measureElement=function(){},Object.defineProperty(R.prototype,"bullets",{get:function(){var u=this;return this._bullets||(this._bullets=new Xs(new Oo),this._disposers.push(new ta(this._bullets)),this._disposers.push(this._bullets.template),this._bullets.events.on("inserted",function(w){w.newValue.events.on("propertychanged",function($){$.property!="locationX"&&$.property!="locationY"||u.positionBullet($.target)},void 0,!1)},void 0,!1)),this._bullets},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.bullets.copyFrom(u.bullets);var w=this.middleLine;w&&(w instanceof Nv&&u.middleLine instanceof Nv&&w.copyFrom(u.middleLine),w instanceof k4&&u.middleLine instanceof k4&&w.copyFrom(u.middleLine)),this.link.copyFrom(u.link)},R.prototype.getTooltipX=function(){if(this.middleLine)return this.middleLine.positionToPoint(this.tooltipLocation).x},R.prototype.getTooltipY=function(){if(this.middleLine)return this.middleLine.positionToPoint(this.tooltipLocation).y},Object.defineProperty(R.prototype,"gradient",{get:function(){return this._gradient||(this._gradient=new Dy),this._gradient},enumerable:!0,configurable:!0}),R}(Zn);ui.registeredClasses.FlowDiagramLink=z4;var y8=function(j){function R(){var u=j.call(this)||this;return u.className="FlowDiagramDataItem",u.values.value={},u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"fromName",{get:function(){return this.properties.fromName},set:function(u){this.setProperty("fromName",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"toName",{get:function(){return this.properties.toName},set:function(u){this.setProperty("toName",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"color",{get:function(){return this.properties.color},set:function(u){this.setProperty("color",Ct(u))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"value",{get:function(){return this.values.value.value},set:function(u){this.setValue("value",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"link",{get:function(){var u=this;if(!this._link){var w=this.component.links.create();this._link=w,this.addSprite(w),this._disposers.push(new jr(function(){u.component&&u.component.links.removeValue(w)}))}return this._link},enumerable:!0,configurable:!0}),R}(uie),Nz=function(j){function R(){var u=j.call(this)||this;u.colors=new Qm,u.className="FlowDiagram",u.nodePadding=20,u.sortBy="none",u.sequencedInterpolation=!0,u.colors.step=2,u.minNodeSize=.02;var w=u.chartContainer.createChild(Zn);w.shouldClone=!1,w.layout="none",w.isMeasured=!1,u.linksContainer=w;var $=u.chartContainer.createChild(Zn);return $.shouldClone=!1,$.layout="none",$.isMeasured=!1,u.nodesContainer=$,u.dataItem=u.createDataItem(),u.dataItem.component=u,u.applyTheme(),u}return re(R,j),R.prototype.dispose=function(){j.prototype.dispose.call(this),this.dataItem.dispose()},R.prototype.validateData=function(){var u=this;this._parseDataFrom==0&&this.nodes.clear(),this.sortNodes(),this.colors.reset(),j.prototype.validateData.call(this);var w,$,U=0,K=0;pr(this.dataItems.iterator(),function(ae){var we=ae.fromName;we&&((Re=u.nodes.getKey(we))||((Re=u.nodes.create(we)).name=we,Re.chart=u,Re.dataItem=ae),ae.fromNode=Re,ae.fromNode.outgoingDataItems.push(ae));var Re,$e=ae.toName;if($e&&((Re=u.nodes.getKey($e))||((Re=u.nodes.create($e)).name=$e,Re.chart=u,Re.dataItem=ae),ae.toNode=Re,ae.toNode.incomingDataItems.push(ae)),!ae.fromNode){var Xe=new $4;Xe.opacities=[0,1],ae.link.strokeModifier=Xe}if(!ae.toNode){var Qe=new $4;Qe.opacities=[1,0],ae.link.strokeModifier=Qe}var dt=ae.value;le(dt)&&(U+=dt,K++,(w>dt||!le(w))&&(w=dt),($this.dataItems.length||pr(u.incomingDataItems.iterator(),function($){w.checkLoop($.fromNode)})},R.prototype.calculateValueHeight=function(){var u=this;this._levelSum={},this._levelNodesCount={},this.maxSum=0;var w,$,U,K=this.dataItem.values.value.sum;pr(this._sorted,function($e){var Xe=$e[1];u.getNodeValue(Xe)}),this.nodes.each(function($e,Xe){var Qe=Xe.level,dt=Math.max(Xe.totalIncoming,Xe.totalOutgoing);dt/KGt||!le(U))&&(U=Gt,u.maxSum=Qe,$=Tt($e))}),this._maxSumLevel=$;var ie=this._levelNodesCount[this._maxSumLevel],ae=(w-(ie-1)*this.nodePadding)/this.maxSum;if(ae==1/0&&(ae=0),le(this.valueHeight)){var we=void 0;try{we=this._heightAnimation.animationOptions[0].to}catch{}if(we!=ae){var Re=this.interpolationDuration;try{Re=this.nodes.template.states.getKey("active").transitionDuration}catch{}this._heightAnimation=new dm(this,{property:"valueHeight",from:this.valueHeight,to:ae},Re,this.interpolationEasing).start(),this._disposers.push(this._heightAnimation)}}else this.valueHeight=ae},R.prototype.validate=function(){var u=this;j.prototype.validate.call(this),this.calculateValueHeight();var w,$=this.nodesContainer,U={},K=this._levelNodesCount[this._maxSumLevel],ie=this.dataItem.values.value.sum;w=this.orientation=="horizontal"?this.chartContainer.maxHeight-1:this.chartContainer.maxWidth-1,pr(this._sorted,function(ae){var we,Re,$e,Xe=ae[1],Qe=Xe.level,dt=0,Gt=u._levelNodesCount[Qe];switch(u.nodeAlign){case"bottom":dt=(u.maxSum-u._levelSum[Qe])*u.valueHeight-(Gt-K)*u.nodePadding;break;case"middle":dt=(u.maxSum-u._levelSum[Qe])*u.valueHeight/2-(Gt-K)*u.nodePadding/2}if(u.maxSum==0)switch(u.nodeAlign){case"bottom":dt=w-Gt*(u.minNodeSize*w+u.nodePadding);break;case"middle":dt=w/2-Gt/2*(u.minNodeSize*w+u.nodePadding)}Xe.parent=$;var Yt=Math.max(Xe.totalIncoming,Xe.totalOutgoing);if(Yt/ie0){var $=this.nodesContainer,U=0;pr(this.links.iterator(),function(K){K.hide(0)}),pr(this._sorted,function(K){var ie,ae=K[1];w.orientation=="horizontal"?(ae.dx=-($.pixelWidth-ae.pixelWidth)/Math.max(w._levelCount,1),ie="dx"):(ae.dy=-($.pixelHeight-ae.pixelHeight)/Math.max(w._levelCount,1),ie="dy");var we=0,Re=w.interpolationDuration;w.sequencedInterpolation&&(we=w.sequencedInterpolationDelay*U+Re*U/Pc(w.nodes.iterator())),ae.opacity=0,ae.invalidateLinks(),ae.animate([{property:"opacity",from:0,to:1},{property:ie,to:0}],w.interpolationDuration,w.interpolationEasing).delay(we),pr(ae.outgoingDataItems.iterator(),function($e){var Xe=$e.link.show(w.interpolationDuration);Xe&&!Xe.isFinished()&&Xe.delay(we)}),pr(ae.incomingDataItems.iterator(),function($e){if(!$e.fromNode){var Xe=$e.link.show(w.interpolationDuration);Xe&&!Xe.isFinished()&&Xe.delay(we)}}),U++})}return j.prototype.showReal.call(this)}},R.prototype.changeSorting=function(){var u=this;this.sortNodes();var w={};pr(this._sorted,function($){var U,K,ie=$[1],ae=ie.level,we=(u.maxSum-u._levelSum[ae])*u.valueHeight/2;u.orientation=="horizontal"?(U="y",K=ie.pixelHeight):(U="x",K=ie.pixelWidth),ie.animate({property:U,to:w[ae]||we},u.interpolationDuration,u.interpolationEasing),w[ae]=(w[ae]||we)+K+u.nodePadding,ie.invalidateLinks()})},R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),Ee(this.readerTitle)||(this.readerTitle=this.language.translate("Sankey diagram"))},R.prototype.createDataItem=function(){return new hve},Object.defineProperty(R.prototype,"nodeAlign",{get:function(){return this.getPropertyValue("nodeAlign")},set:function(u){this.setPropertyValue("nodeAlign",u),this.changeSorting()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"orientation",{get:function(){return this.getPropertyValue("orientation")},set:function(u){this.setPropertyValue("orientation",u,!0);var w=this.nodes.template.nameLabel;u=="vertical"?(this.nodes.template.width=void 0,w.label.horizontalCenter="middle",w.locationX=.5):(this.nodes.template.height=void 0,w.label.horizontalCenter="left",w.locationX=1)},enumerable:!0,configurable:!0}),R.prototype.createNode=function(){var u=new pm;return this._disposers.push(u),u},R.prototype.createLink=function(){var u=new $z;return this._disposers.push(u),u},Object.defineProperty(R.prototype,"valueHeight",{get:function(){return this._valueHeight},set:function(u){u!=this._valueHeight&&(this._valueHeight=u,this.invalidate())},enumerable:!0,configurable:!0}),R.prototype.disposeData=function(){j.prototype.disposeData.call(this),this._sorted=this.nodes.iterator()},R}(Nz);ui.registeredClasses.SankeyDiagram=dve;var Bz=function(j){function R(){var u=j.call(this)||this;u.className="ChordNode";var w=u.createChild(p8);w.location=.5,w.radius=5,w.text="{name}",w.zIndex=1,w.shouldClone=!1,u.label=w,u.layout="none",u.events.on("positionchanged",u.updateRotation,u,!1),u.isMeasured=!1,u.slice=u.createChild(LI),u.slice.isMeasured=!1;var $=u.hiddenState;return $.properties.fill=new $a().getFor("disabledBackground"),$.properties.opacity=.5,$.properties.visible=!0,u.setStateOnChildren=!1,u.slice.hiddenState.properties.visible=!0,u.adapter.add("tooltipX",function(U,K){return K.slice.ix*(K.slice.radius-(K.slice.radius-K.slice.pixelInnerRadius)/2)}),u.adapter.add("tooltipY",function(U,K){return K.slice.iy*(K.slice.radius-(K.slice.radius-K.slice.pixelInnerRadius)/2)}),u}return re(R,j),R.prototype.invalidateLinks=function(){var u=this;j.prototype.invalidateLinks.call(this);var w=this.label,$=this.slice,U=this.chart;if(U&&$){var K=this.total,ie=$.arc,ae=$.startAngle;this.children.each(function($e){if($e instanceof Oo){var Xe=$e.locationX;le(Xe)||(Xe=.5);var Qe=$e.locationY;le(Qe)||(Qe=1);var dt=ae+ie*Xe,Gt=Qe*$.radius;$e.x=Gt*A(dt),$e.y=Gt*Ue(dt)}});var we=ae+ie*w.location,Re=ae+(1-K/this.adjustedTotal)*ie*.5;Pe(Re)&&(Re=ae),w.fixPosition(we,$.radius),this.nextAngle=Re,this._outgoingSorted&&pr(this._outgoingSorted,function($e){var Xe=$e.link;Xe.parent=u.chart.linksContainer;var Qe=$e.getWorkingValue("value");if(le(Qe)){if(U.nonRibbon){var dt=Xe.percentWidth;le(dt)||(dt=5),dt/=100,Xe.startAngle=ae+ie/2-ie/2*dt,Xe.arc=ie*dt}else Xe.arc=Qe*U.valueAngle,Xe.startAngle=u.nextAngle,u.nextAngle+=Xe.arc;$e.toNode||(Xe.endAngle=Xe.startAngle),Xe.radius=$.pixelInnerRadius}}),this._incomingSorted&&pr(this._incomingSorted,function($e){var Xe=$e.link;if(Xe.radius=$.pixelInnerRadius,U.nonRibbon){var Qe=Xe.percentWidth;le(Qe)||(Qe=5),Qe/=100,Xe.endAngle=ae+ie/2-ie/2*Qe,Xe.arc=ie*Qe}else{Xe.endAngle=u.nextAngle;var dt=$e.getWorkingValue("value");le(dt)&&(Xe.arc=dt*U.valueAngle,u.nextAngle+=Xe.arc)}$e.fromNode||(Xe.startAngle=Xe.endAngle)})}},R.prototype.updateRotation=function(){var u=this.slice,w=this.trueStartAngle+u.arc/2,$=u.radius,U=$*A(w),K=$*Ue(w),ie=ue({x:U+this.pixelX,y:K+this.pixelY});u.startAngle=this.trueStartAngle+(ie-w),this.dx=-this.pixelX,this.dy=-this.pixelY},R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.label.copyFrom(u.label),this.slice.copyFrom(u.slice)},R}(g8);ui.registeredClasses.ChordNode=Bz;var a9e=function(j){function R(){var u=j.call(this)||this;return u.className="QuadraticCurve",u.element=u.paper.add("path"),u.pixelPerfect=!1,u.fill=He(),u.applyTheme(),u}return re(R,j),R.prototype.draw=function(){if(le(this.x1+this.x2+this.y1+this.y2+this.cpx+this.cpy)){var u={x:this.x1,y:this.y1},w={x:this.x2,y:this.y2},$={x:this.cpx,y:this.cpy},U=ln(u)+aC(w,$);this.path=U}},Object.defineProperty(R.prototype,"cpx",{get:function(){return this.getPropertyValue("cpx")},set:function(u){this.setPropertyValue("cpx",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cpy",{get:function(){return this.getPropertyValue("cpy")},set:function(u){this.setPropertyValue("cpy",u,!0)},enumerable:!0,configurable:!0}),R.prototype.positionToPoint=function(u){var w={x:this.x1,y:this.y1},$={x:this.cpx,y:this.cpy},U={x:this.x2,y:this.y2},K=rt(w,U,$,u),ie=rt(w,U,$,u+.001);return{x:K.x,y:K.y,angle:ue(K,ie)}},R}(Nv),Gz=function(j){function R(){var u=j.call(this)||this;return u.className="ChordLink",u.middleLine=u.createChild(a9e),u.middleLine.shouldClone=!1,u.middleLine.strokeOpacity=0,u.applyTheme(),u}return re(R,j),R.prototype.validate=function(){if(j.prototype.validate.call(this),!this.isTemplate){var u=this.startAngle,w=this.endAngle,$=this.arc,U=this.radius,K=this.dataItem.fromNode,ie=this.dataItem.toNode,ae=0,we=0;K&&(ae=K.pixelX+K.dx,we=K.pixelY+K.dy);var Re=0,$e=0;if(ie&&(Re=ie.pixelX+ie.dx,$e=ie.pixelY+ie.dy),U>0){var Xe=U*A(u)+ae,Qe=U*Ue(u)+we,dt=U*A(w)+Re,Gt=U*Ue(w)+$e,Yt={x:0,y:0},ai=ln({x:Xe,y:Qe});ai+=Dd(u,$,U),ai+=aC({x:dt,y:Gt},Yt),ai+=Dd(w,$,U),ai+=aC({x:Xe,y:Qe},Yt),this.link.path=$>0?ai:"",this.maskBullets&&(this.bulletsMask.path=ai,this.bulletsContainer.mask=this.bulletsMask);var oi=u+$/2,Ui=w+$/2,Ji=this.middleLine;Ji.x1=U*A(oi)+ae,Ji.y1=U*Ue(oi)+we,Ji.x2=U*A(Ui)+Re,Ji.y2=U*Ue(Ui)+$e,Ji.cpx=0,Ji.cpy=0,Ji.stroke=this.fill,this.positionBullets()}}},Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPropertyValue("radius",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"arc",{get:function(){return this.getPropertyValue("arc")},set:function(u){this.setPropertyValue("arc",u,!0)},enumerable:!0,configurable:!0}),R}(z4);ui.registeredClasses.ChordLink=Gz;var pve=function(j){function R(){var u=j.call(this)||this;return u.className="ChordDiagramDataItem",u.applyTheme(),u}return re(R,j),R}(y8),fve=function(j){function R(){var u=j.call(this)||this;u.valueAngle=0,u.className="ChordDiagram",u.startAngle=-90,u.endAngle=270,u.radius=he(80),u.innerRadius=-15,u.nodePadding=5;var w=u.chartContainer.createChild(Zn);return w.align="center",w.valign="middle",w.shouldClone=!1,w.layout="absolute",u.chordContainer=w,u.nodesContainer.parent=w,u.linksContainer.parent=w,u.chartContainer.events.on("maxsizechanged",u.invalidate,u,!1),u.applyTheme(),u}return re(R,j),R.prototype.validate=function(){var u=this,w=this.chartContainer,$=this.endAngle,U=this.startAngle+this.nodePadding/2,K=Xt(this.startAngle,this.endAngle,1);K=qe([K,{x:0,y:0,width:0,height:0}]);var ie=Math.min(w.innerWidth/K.width,w.innerHeight/K.height);le(ie)||(ie=0);var ae=yo(this.radius,ie),we=yo(this.innerRadius,ae,!0),Re=this.dataItem.values.value.sum,$e=0,Xe=0;pr(this._sorted,function(Qe){var dt=Qe[1];u.getNodeValue(dt),$e++;var Gt=dt.total;dt.total/Rethis.endIndex;Qe--)dt=this.dataItems.getIndex(Qe),this.disableUnusedColumns(dt);this._propertiesChanged=!1},R.prototype.sortCategoryAxis=function(u,w){var $=this;this.dataItems.values.sort(function(K,ie){return ie.values[w].workingValue-K.values[w].workingValue});var U=0;this.dataItems.each(function(K){K._index=U,U++}),u.dataItems.each(function(K){var ie=K.component,ae=ie.categoryToPosition(K.category)-K.deltaPosition,we=ie.getSeriesDataItemByCategory(K.category,$);if(we){var Re=$.dataItems.indexOf(we);K._index=Re;var $e=Ve((Re+.5)/$.dataItems.length-ae,3);K.deltaAnimation&&!K.deltaAnimation.isDisposed()&&K.deltaAnimation.animationOptions[0].to==$e||$e!=Ve(K.deltaPosition,3)&&(K.deltaAnimation&&K.deltaAnimation.stop(),K.deltaAnimation=K.animate({property:"deltaPosition",from:-$e,to:0},ie.interpolationDuration,ie.interpolationEasing),$._disposers.push(K.deltaAnimation))}}),u.dataItems.values.sort(function(K,ie){return K.index-ie.index})},R.prototype.validateDataElement=function(u){this.chart&&this.xAxis&&this.yAxis&&(this.validateDataElementReal(u),j.prototype.validateDataElement.call(this,u))},R.prototype.getStartLocation=function(u){var w=this._startLocation;return this.baseAxis==this.xAxis?w+=u.locations[this.xOpenField]-.5:w+=u.locations[this.yOpenField]-.5,w},R.prototype.getEndLocation=function(u){var w=this._endLocation;return this.baseAxis==this.xAxis?w+=u.locations[this.xField]-.5:w+=u.locations[this.yField]-.5,w},R.prototype.validateDataElementReal=function(u){var w,$,U,K,ie=this,ae=this.getStartLocation(u),we=this.getEndLocation(u),Re=this.xField,$e=this.xOpenField,Xe=this.yField,Qe=this.yOpenField,dt=this.columns.template,Gt=dt.percentWidth,Yt=dt.percentHeight,ai=dt.pixelWidth,oi=dt.pixelHeight,Ui=dt.maxWidth,Ji=dt.maxHeight,Si=dt.pixelPaddingLeft,Hi=dt.pixelPaddingRight,nr=dt.pixelPaddingTop,Ir=dt.pixelPaddingBottom,yr=!1,Es=u.width;Ee(Es)&&(le(Es)&&(ai=Es),Es instanceof J&&(Gt=100*Es.value));var Dn=u.height;if(Ee(Dn)&&(le(Dn)&&(oi=Dn),Dn instanceof J&&(Yt=100*Dn.value)),this.xAxis instanceof $h&&this.yAxis instanceof $h){if(!u.hasValue(this._xValueFields)||!u.hasValue(this._yValueFields))return;ae=0,we=1,Pe(Gt)||(ae+=wl=Ve((we-ae)*(1-Gt/100)/2,5),we-=wl),w=this.xAxis.getX(u,$e,ae),$=this.xAxis.getX(u,Re,we),Pe(Gt)&&(w+=wl=($-w-ai)/2,$-=wl),!Pe(Ui)&&Uisf&&K>sf)&&(yr=!0),U=this.fixVerticalCoordinate(U),K=this.fixVerticalCoordinate(K),Math.abs($-w)-Si-Hi==0&&(yr=!0)}else{if(!u.hasValue(this._xValueFields))return;var wl;Pe(Yt)||(ae+=wl=Ve((we-ae)*(1-Yt/100)/2,5),we-=wl),U=this.yAxis.getY(u,Qe,ae),K=this.yAxis.getY(u,Xe,we),Pe(Yt)&&(K-=wl=(K-U-oi)/2,U+=wl),!Pe(Ji)&&Jisf&&w>sf)&&(yr=!0),$=this.fixHorizontalCoordinate($),w=this.fixHorizontalCoordinate(w),Math.abs(U-K)-nr-Ir==0&&(yr=!0)}var $s,Pf=Math.abs($-w),Of=Math.abs(K-U),Is=Math.min(w,$),ad=Math.min(U,K);yr?this.disableUnusedColumns(u):(u.column?($s=u.column,this._propertiesChanged&&(Cr(this,$s,gc),Cr(this.columns.template,$s,gc),mi(gc,function(hu){$s[hu]=$s[hu]}))):(Cr(this,$s=this.columns.create(),gc),Cr(this.columns.template,$s,gc),u.addSprite($s),u.column=$s,$s.paper=this.paper,this.itemsFocusable()?(Ee(this.role)||(this.role="menu"),Ee($s.role)||($s.role="menuitem"),$s.focusable=!0):(Ee(this.role)||(this.role="list"),Ee($s.role)||($s.role="listitem"),$s.focusable=!1),$s.focusable&&($s.events.on("focus",function(hu){$s.readerTitle=ie.populateString(ie.itemReaderText,u)},void 0,!1),$s.events.on("blur",function(hu){$s.readerTitle=""},void 0,!1)),$s.hoverable&&($s.events.on("over",function(hu){$s.readerTitle=ie.populateString(ie.itemReaderText,u)},void 0,!1),$s.events.on("out",function(hu){$s.readerTitle=""},void 0,!1)),$s.parent=this.columnsContainer,$s.virtualParent=this),$s.width=Pf,$s.height=Of,$s.x=Is,$s.y=ad,$s.realX=w,$s.realY=U,$s.realWidth=$-w,$s.realHeight=K-U,this.setColumnStates($s),$s.invalid&&$s.validate(),$s.__disabled=!1,pr(this.axisRanges.iterator(),function(hu){var mh=u.rangesColumns.getKey(hu.uid);mh||(mh=ie.columns.create(),Cr(hu.contents,mh,gc),u.addSprite(mh),u.rangesColumns.setKey(hu.uid,mh),mh.paper=ie.paper),mh.parent=hu.contents,mh.width=Pf,mh.height=Of,mh.x=Is,mh.y=ad,ie.setColumnStates(mh),mh.invalid&&mh.validate(),mh.__disabled=!1})),u.itemWidth=Pf,u.itemHeight=Of},R.prototype.disableUnusedColumns=function(u){u&&(u.column&&(u.column.width=0,u.column.height=0,u.column.__disabled=!0),pr(this.axisRanges.iterator(),function(w){var $=u.rangesColumns.getKey(w.uid);$&&($.width=0,$.height=0,$.__disabled=!0)}))},R.prototype.setColumnStates=function(u){if(this._dropFromOpenState||this._dropFromPreviousState||this._riseFromOpenState||this._riseFromPreviousState){var w=u.dataItem;if(this.xAxis instanceof vo||this.yAxis instanceof vo){var $,U=void 0,K=void 0;this.baseAxis==this.yAxis?(this.xOpenField&&this.xField&&this.xAxis instanceof vo&&($=w.getValue(this.xOpenField),U=w.getValue(this.xField)),K=w.getValue(this.xAxis.axisFieldName+"X","previousChange")):(this.yOpenField&&this.yField&&this.yAxis instanceof vo&&($=w.getValue(this.yOpenField),U=w.getValue(this.yField)),K=w.getValue(this.yAxis.axisFieldName+"Y","previousChange")),U<$?(w.droppedFromOpen=!0,u.defaultState.copyFrom(this._dropFromOpenState),u.setState(this._dropFromOpenState,0)):(w.droppedFromOpen=!1,u.defaultState.copyFrom(this._riseFromOpenState),u.setState(this._riseFromOpenState,0)),K<0?(w.droppedFromPrevious=!0,u.defaultState.copyFrom(this._dropFromPreviousState),u.setState(this._dropFromPreviousState,0)):(w.droppedFromPrevious=!1,u.defaultState.copyFrom(this._riseFromPreviousState),u.setState(this._riseFromPreviousState,0))}}},Object.defineProperty(R.prototype,"columns",{get:function(){return this._columns||(this._columns=new Xs(this.createColumnTemplate()),this._disposers.push(new ta(this._columns)),this._disposers.push(this._columns.template)),this._columns},enumerable:!0,configurable:!0}),R.prototype.createColumnTemplate=function(){return new BI},Object.defineProperty(R.prototype,"clustered",{get:function(){return this.getPropertyValue("clustered")},set:function(u){this.setPropertyValue("clustered",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dropFromOpenState",{get:function(){return this._dropFromOpenState||(this._dropFromOpenState=this.states.create("dropFromOpenState")),this._dropFromOpenState},set:function(u){this._dropFromOpenState=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dropFromPreviousState",{get:function(){return this._dropFromPreviousState||(this._dropFromPreviousState=this.states.create("dropFromPreviousState")),this._dropFromPreviousState},set:function(u){this._dropFromPreviousState=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"riseFromOpenState",{get:function(){return this._riseFromOpenState||(this._riseFromOpenState=this.states.create("riseFromOpenState")),this._riseFromOpenState},set:function(u){this._riseFromOpenState=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"riseFromPreviousState",{get:function(){return this._riseFromPreviousState||(this._riseFromPreviousState=this.states.create("riseFromPreviousState")),this._riseFromPreviousState},set:function(u){this._riseFromPreviousState=u},enumerable:!0,configurable:!0}),R.prototype.updateLegendValue=function(u,w){var $=this;if(j.prototype.updateLegendValue.call(this,u,w),this.legendDataItem){var U,K,ie=this.legendDataItem.marker;u&&(U=u.droppedFromOpen?this._dropFromOpenState:this._riseFromOpenState,K=u.droppedFromPrevious?this._dropFromPreviousState:this._riseFromPreviousState),pr(ie.children.iterator(),function(ae){u?(ae.setState(K),ae.setState(U)):(ae.setState($._riseFromPreviousState),ae.setState($._riseFromOpenState))})}},R.prototype.createLegendMarker=function(u){var w=u.pixelWidth,$=u.pixelHeight;u.removeChildren();var U=u.createChild(Nb);U.shouldClone=!1,Cr(this,U,gc),U.copyFrom(this.columns.template),U.padding(0,0,0,0),U.width=w,U.height=$;var K=u.dataItem;K.color=this.fill,K.colorOrig=this.fill},R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.columns.template.copyFrom(u.columns.template)},R.prototype.getBulletLocationX=function(u,w){if(this.baseAxis==this.xAxis){var $=u.locationX;le($)||($=.5);var U=this.getEndLocation(u.dataItem);return U-(U-this.getStartLocation(u.dataItem))*$}return j.prototype.getBulletLocationX.call(this,u,w)},R.prototype.getBulletLocationY=function(u,w){if(this.baseAxis==this.yAxis){var $=u.locationY;le($)||($=.5);var U=this.getEndLocation(u.dataItem);return U-(U-this.getStartLocation(u.dataItem))*$}return j.prototype.getBulletLocationY.call(this,u,w)},R.prototype.getAdjustedXLocation=function(u,w,$){return le($)||($=u?u.locations[w]:.5),this._endLocation-(this._endLocation-this._startLocation)*(1-$)},R.prototype.getAdjustedYLocation=function(u,w,$){return le($)||($=u?u.locations[w]:.5),this._endLocation-(this._endLocation-this._startLocation)*$},R.prototype.fixVerticalCoordinate=function(u){var w=this.columns.template.pixelPaddingBottom;return gt(u,-this.columns.template.pixelPaddingTop,this.yAxis.axisLength+w)},R.prototype.fixHorizontalCoordinate=function(u){var w=this.columns.template.pixelPaddingLeft,$=this.columns.template.pixelPaddingRight;return gt(u,-w,this.xAxis.axisLength+$)},R.prototype.disposeData=function(){j.prototype.disposeData.call(this),this.columns.clear()},R}(NI);ui.registeredClasses.ColumnSeries=$v,ui.registeredClasses.ColumnSeriesDataItem=Bb;var Eie=function(j){function R(){var u=j.call(this)||this;return u.className="TreeMapSeriesDataItem",u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"parentName",{get:function(){var u=this.treeMapDataItem;if(u&&u.parent)return u.parent.name},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"value",{get:function(){var u=this.treeMapDataItem;if(u)return u.value},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"treeMapDataItem",{get:function(){return this._dataContext},enumerable:!0,configurable:!0}),R.prototype.hide=function(u,w,$,U){var K=this.treeMapDataItem;return K&&K.hide(u),j.prototype.hide.call(this,u,w,$,U)},R.prototype.show=function(u,w,$){var U=this.treeMapDataItem;return U&&U.show(u,w,$),j.prototype.show.call(this,u,w,$)},R}(Bb),v8=function(j){function R(){var u=j.call(this)||this;u.className="TreeMapSeries",u.applyTheme(),u.fillOpacity=1,u.strokeOpacity=1,u.minBulletDistance=0,u.columns.template.tooltipText="{parentName} {name}: {value}",u.columns.template.configField="config";var w=new $a;return u.stroke=w.getFor("background"),u.dataFields.openValueX="x0",u.dataFields.valueX="x1",u.dataFields.openValueY="y0",u.dataFields.valueY="y1",u.sequencedInterpolation=!1,u.showOnInit=!1,u.columns.template.pixelPerfect=!1,u}return re(R,j),R.prototype.processDataItem=function(u,w){w.seriesDataItem=u,j.prototype.processDataItem.call(this,u,w)},R.prototype.createDataItem=function(){return new Eie},R.prototype.show=function(u){if(!this.preventShow){var w=this.defaultState.transitionDuration;return le(u)&&(w=u),this.dataItems.each(function($){$.show(u)}),j.prototype.showReal.call(this,w)}},R.prototype.hide=function(u){var w=this.defaultState.transitionDuration;le(u)&&(w=u);var $=j.prototype.hideReal.call(this,w);return this.dataItems.each(function(U){U.hide(u)}),$},R.prototype.processValues=function(){},R.prototype.getStartLocation=function(u){return 0},R.prototype.getEndLocation=function(u){return 1},R.prototype.dataChangeUpdate=function(){},R.prototype.processConfig=function(u){u&&(Ee(u.dataFields)&&it(u.dataFields)||(u.dataFields={})),j.prototype.processConfig.call(this,u)},R.prototype.createLegendMarker=function(u){var w=u.pixelWidth,$=u.pixelHeight;u.removeChildren();var U=u.createChild(Nb);U.shouldClone=!1,Cr(this,U,gc),U.padding(0,0,0,0),U.width=w,U.height=$;var K=u.dataItem;K.color=U.fill,K.colorOrig=U.fill},R.prototype.disableUnusedColumns=function(u){j.prototype.disableUnusedColumns.call(this,u),u.column&&(u.column.__disabled=!1)},R}($v);ui.registeredClasses.TreeMapSeries=v8,ui.registeredClasses.TreeMapSeriesDataItem=Eie;var Iie=function(j){function R(){var u=j.call(this)||this;return u.rows=[],u.className="TreeMapDataItem",u.values.value={workingValue:0},u.values.x0={},u.values.y0={},u.values.x1={},u.values.y1={},u.hasChildren.children=!0,u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"legendDataItem",{get:function(){return this._legendDataItem},set:function(u){this._legendDataItem=u,u.label&&(u.label.dataItem=this),u.valueLabel&&(u.valueLabel.dataItem=this)},enumerable:!0,configurable:!0}),R.prototype.getDuration=function(){return 0},Object.defineProperty(R.prototype,"value",{get:function(){var u=0;return this.children&&this.children.length!=0?pr(this.children.iterator(),function(w){var $=w.value;le($)&&(u+=$)}):u=this.values.value.workingValue,u},set:function(u){this.setValue("value",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"percent",{get:function(){return this.parent?this.value/this.parent.value*100:100},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"x0",{get:function(){return this.values.x0.value},set:function(u){this.setValue("x0",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"x1",{get:function(){return this.values.x1.value},set:function(u){this.setValue("x1",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"y0",{get:function(){return this.values.y0.value},set:function(u){this.setValue("y0",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"y1",{get:function(){return this.values.y1.value},set:function(u){this.setValue("y1",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"name",{get:function(){return this.properties.name},set:function(u){this.setProperty("name",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"children",{get:function(){return this.properties.children},set:function(u){this.setProperty("children",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"level",{get:function(){return this.parent?this.parent.level+1:0},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"color",{get:function(){var u=this.properties.color;return u==null&&this.parent&&(u=this.parent.color),u==null&&this.component&&(u=this.component.colors.getIndex(this.component.colors.step*this.index)),u},set:function(u){this.setProperty("color",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fill",{get:function(){return this.color},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"series",{get:function(){return this._series},set:function(u){u!=this._series&&(this._series&&(this.component.series.removeValue(this._series),this._series.dispose()),this._series=u,this._disposers.push(u))},enumerable:!0,configurable:!0}),R.prototype.hide=function(u,w,$,U){this.setWorkingValue("value",0),this.children&&this.children.each(function(ie){ie.hide(u,w,$,U)});var K=this.seriesDataItem;return K&&K.bullets.each(function(ie,ae){ae.hide(),ae.preventShow=!0}),j.prototype.hide.call(this,u,w,$,U)},R.prototype.show=function(u,w,$){this.setWorkingValue("value",this.values.value.value),this.children&&this.children.each(function(K){K.show(u,w,$)});var U=this.seriesDataItem;return U&&U.bullets.each(function(K,ie){ie.preventShow=!1}),j.prototype.show.call(this,u,w,$)},R}(Az),Aie=function(j){function R(){var u=j.call(this)||this;u.layoutAlgorithm=u.squarify,u.zoomable=!0,u.className="TreeMap",u._usesData=!0,u.maxLevels=2,u.currentLevel=0,u.hideParentColumns=!1,u.colors=new Qm,u.sorting="descending";var w=u.xAxes.push(new vo);w.title.disabled=!0,w.strictMinMax=!0;var $=w.renderer;$.inside=!0,$.labels.template.disabled=!0,$.ticks.template.disabled=!0,$.grid.template.disabled=!0,$.axisFills.template.disabled=!0,$.minGridDistance=100,$.line.disabled=!0,$.baseGrid.disabled=!0;var U=u.yAxes.push(new vo);U.title.disabled=!0,U.strictMinMax=!0;var K=U.renderer;K.inside=!0,K.labels.template.disabled=!0,K.ticks.template.disabled=!0,K.grid.template.disabled=!0,K.axisFills.template.disabled=!0,K.minGridDistance=100,K.line.disabled=!0,K.baseGrid.disabled=!0,K.inversed=!0,u.xAxis=w,u.yAxis=U;var ie=new v8;return u.seriesTemplates=new cm(ie),ie.virtualParent=u,u._disposers.push(new Yd(u.seriesTemplates)),u._disposers.push(ie),u.zoomOutButton.events.on("hit",function(){u.zoomToChartDataItem(u._homeDataItem)},void 0,!1),u.seriesTemplates.events.on("insertKey",function(ae){ae.newValue.isTemplate=!0},void 0,!1),u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"navigationBar",{get:function(){return this._navigationBar},set:function(u){var w=this;this._navigationBar!=u&&(this._navigationBar=u,u.parent=this,u.toBack(),u.links.template.events.on("hit",function($){var U=$.target.dataItem.dataContext;U.isDisposed()||(w.zoomToChartDataItem(U),w.createTreeSeries(U))},void 0,!0),this._disposers.push(u))},enumerable:!0,configurable:!0}),R.prototype.validateData=function(){this.series.clear(),this._tempSeries=[],j.prototype.validateData.call(this),this._homeDataItem&&this._homeDataItem.dispose();var u=this.dataItems.template.clone();this._homeDataItem=u,pr(this.dataItems.iterator(),function(U){U.parent=u}),u.children=this.dataItems,u.x0=0,u.y0=0,u.name=this._homeText;var w=1e3,$=10*Math.round(w*this.pixelHeight/this.pixelWidth/10)||1e3;u.x1=w,u.y1=$,this.xAxis.min=0,this.xAxis.max=w,this.xAxis.getMinMax(),this.yAxis.min=0,this.yAxis.max=$,this.yAxis.getMinMax(),this.layoutItems(u),this.createTreeSeries(u),this.feedLegend()},R.prototype.layoutItems=function(u,w){if(u){var $=u.children;w||(w=this.sorting),w=="ascending"&&$.values.sort(function(ae,we){return ae.value-we.value}),w=="descending"&&$.values.sort(function(ae,we){return we.value-ae.value}),this._updateDataItemIndexes(0),this.layoutAlgorithm(u);for(var U=0,K=$.length;Uthis.currentLevel||u.children&&u.children.length>0)&&($.columns.template.cursorOverStyle=_l.pointer,this.zoomable&&$.columns.template.events.on("hit",function(ae){var we=ae.target.dataItem;u.level>w.currentLevel?w.zoomToChartDataItem(we.treeMapDataItem.parent):w.zoomToSeriesDataItem(we)},this,void 0))}this._tempSeries.push(u.series)},R.prototype.toggleBullets=function(u){var w=this;pr(this.series.iterator(),function($){w._tempSeries.indexOf($)==-1?($.columnsContainer.hide(),$.bulletsContainer.hide(u)):($.columnsContainer.show(),$.bulletsContainer.show(u),$.dataItems.each(function(U){U.bullets.each(function(K,ie){ie.show()})}),$.level1&&$.dataItems.each(function(U){U.treeMapDataItem.children&&U.bullets.each(function(K,ie){ie.hide()})}))})},R.prototype.zoomToSeriesDataItem=function(u){this.zoomToChartDataItem(u.treeMapDataItem)},R.prototype.zoomToChartDataItem=function(u){var w=this;u||(u=this._homeDataItem);var $=this.zoomOutButton;if($&&(u!=this._homeDataItem?$.show():$.hide()),u&&u.children){this.xAxis.zoomToValues(u.x0,u.x1),this.yAxis.zoomToValues(u.y0,u.y1),this.currentLevel=u.level,this.currentlyZoomed=u,this.createTreeSeries(u);var U=this.xAxis.rangeChangeAnimation||this.yAxis.rangeChangeAnimation;!U||U.isDisposed()||U.isFinished()?this.toggleBullets():(this._dataDisposers.push(U),U.events.once("animationended",function(){w.toggleBullets()}))}},R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),Ee(this.readerTitle)||(this.readerTitle=this.language.translate("TreeMap chart"))},R.prototype.createDataItem=function(){return new Iie},Object.defineProperty(R.prototype,"maxLevels",{get:function(){return this.getPropertyValue("maxLevels")},set:function(u){this.setPropertyValue("maxLevels",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"currentLevel",{get:function(){return this.getPropertyValue("currentLevel")},set:function(u){this.setPropertyValue("currentLevel",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"hideParentColumns",{get:function(){return this.getPropertyValue("hideParentColumns")},set:function(u){this.setPropertyValue("hideParentColumns",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"sorting",{get:function(){return this.getPropertyValue("sorting")},set:function(u){this.setPropertyValue("sorting",u,!0)},enumerable:!0,configurable:!0}),R.prototype.createSeries=function(){return new v8},Object.defineProperty(R.prototype,"homeText",{get:function(){return this._homeText},set:function(u){this._homeText=u,this._homeDataItem&&(this._homeDataItem.name=this._homeText)},enumerable:!0,configurable:!0}),R.prototype.processConfig=function(u){if(u){if(Ee(u.layoutAlgorithm)&&ct(u.layoutAlgorithm))switch(u.layoutAlgorithm){case"squarify":u.layoutAlgorithm=this.squarify;break;case"binaryTree":u.layoutAlgorithm=this.binaryTree;break;case"slice":u.layoutAlgorithm=this.slice;break;case"dice":u.layoutAlgorithm=this.dice;break;case"sliceDice":u.layoutAlgorithm=this.sliceDice;break;default:delete u.layoutAlgorithm}Ee(u.navigationBar)&&!Ee(u.navigationBar.type)&&(u.navigationBar.type="NavigationBar"),j.prototype.processConfig.call(this,u)}},R.prototype.validateLayout=function(){j.prototype.validateLayout.call(this),this.layoutItems(this.currentlyZoomed)},R.prototype.validateDataItems=function(){j.prototype.validateDataItems.call(this),this.layoutItems(this._homeDataItem),pr(this.series.iterator(),function(u){u.validateRawData()}),this.zoomToChartDataItem(this._homeDataItem)},R.prototype.binaryTree=function(u){var w,$,U=u.children,K=U.length,ie=new Array(K+1);for(ie[0]=$=w=0;w0&&function ae(we,Re,$e,Xe,Qe,dt,Gt){if(we>=Re-1)return(Si=U.getIndex(we)).x0=Xe,Si.y0=Qe,Si.x1=dt,void(Si.y1=Gt);for(var Yt=ie[we],ai=$e/2+Yt,oi=we+1,Ui=Re-1;oi>>1;ie[Ji]Gt-Qe){var Ir=(Xe*nr+dt*Hi)/$e;ae(we,oi,Hi,Xe,Qe,Ir,Gt),ae(oi,Re,nr,Ir,Qe,dt,Gt)}else{var yr=(Qe*nr+Gt*Hi)/$e;ae(we,oi,Hi,Xe,Qe,dt,yr),ae(oi,Re,nr,Xe,yr,dt,Gt)}}(0,K,u.value,u.x0,u.y0,u.x1,u.y1)},R.prototype.slice=function(u){for(var w,$=u.x0,U=u.x1,K=u.y0,ie=u.y1,ae=u.children,we=-1,Re=ae.length,$e=u.value&&(ie-K)/u.value;++weae&&(ae=w),Xe=K*K*$e,(we=Math.max(ae/Xe,Xe/ie))>Re){K-=w;break}Re=we}var nr=this.dataItems.template.clone();nr.value=K,nr.dice=$1)return u;if(u.children.length==1){var w=u.children.getIndex(0);return w.children?this.getLegendLevel(w):u}return u}},R.prototype.handleLegendSeriesAdded=function(u){},Object.defineProperty(R.prototype,"homeDataItem",{get:function(){return this._homeDataItem},enumerable:!0,configurable:!0}),R.prototype.feedLegend=function(){var u=this.legend;if(u){u.dataFields.name="name";var w=this.getLegendLevel(this._homeDataItem);if(w){var $=[];w.children.each(function(U){$.push(U)}),u.data=$}}},R.prototype.disposeData=function(){j.prototype.disposeData.call(this),this._homeDataItem=void 0,this.series.clear(),this.navigationBar&&this.navigationBar.disposeData(),this.xAxis.disposeData(),this.yAxis.disposeData()},R.prototype.getExporting=function(){var u=this,w=j.prototype.getExporting.call(this);return w.adapter.add("formatDataFields",function($){return $.format!="csv"&&$.format!="xlsx"||Ee(u.dataFields.children)&&delete $.dataFields[u.dataFields.children],$}),w},R}(G0);ui.registeredClasses.TreeMap=Aie;var A3=function(j){function R(){var u=j.call(this)||this;return u._chart=new Jn,u.className="AxisRendererX3D",u._disposers.push(u._chart),u.applyTheme(),u}return re(R,j),R.prototype.updateGridElement=function(u,w,$){w+=($-w)*u.location;var U=this.positionToPoint(w);if(u.element){var K=this.chart.dx3D||0,ie=this.chart.dy3D||0,ae=this.getHeight();u.path=ln({x:K,y:ie})+br({x:K,y:ae+ie})+br({x:0,y:ae})}this.positionItem(u,U),this.toggleVisibility(u,w,0,1)},R.prototype.updateBaseGridElement=function(){j.prototype.updateBaseGridElement.call(this);var u=this.getHeight(),w=this.chart.dx3D||0,$=this.chart.dy3D||0;this.baseGrid.path=ln({x:w,y:$})+br({x:0,y:0})+br({x:0,y:u})},Object.defineProperty(R.prototype,"chart",{get:function(){return this._chart.get()},set:function(u){u&&this._chart.set(u,u.events.on("propertychanged",this.handle3DChanged,this,!1))},enumerable:!0,configurable:!0}),R.prototype.handle3DChanged=function(u){u.property!="depth"&&u.property!="angle"||this.invalidate()},R}(Fd);ui.registeredClasses.AxisRendererX3D=A3;var Pie=function(j){function R(){var u=j.call(this)||this;return u._chart=new Jn,u.className="AxisRendererY3D",u._disposers.push(u._chart),u.applyTheme(),u}return re(R,j),R.prototype.updateGridElement=function(u,w,$){w+=($-w)*u.location;var U=this.positionToPoint(w);if(u.element){var K=this.chart.dx3D||0,ie=this.chart.dy3D||0,ae=this.getWidth();u.path=ln({x:0,y:0})+br({x:K,y:ie})+br({x:ae+K,y:ie})}this.positionItem(u,U),this.toggleVisibility(u,w,0,1)},R.prototype.updateBaseGridElement=function(){j.prototype.updateBaseGridElement.call(this);var u=this.chart.dx3D||0,w=this.chart.dy3D||0,$=this.getWidth();this.baseGrid.path=ln({x:0,y:0})+br({x:$,y:0})+br({x:$+u,y:w})},Object.defineProperty(R.prototype,"chart",{get:function(){return this._chart.get()},set:function(u){u&&this._chart.set(u,u.events.on("propertychanged",this.handle3DChanged,this,!1))},enumerable:!0,configurable:!0}),R.prototype.handle3DChanged=function(u){u.property!="depth"&&u.property!="angle"||this.invalidate()},R}(w1),Oie=function(j){function R(){var u=j.call(this)||this;return u.className="Column3D",u}return re(R,j),R.prototype.createAssets=function(){this.column3D=this.createChild($b),this.column3D.shouldClone=!1,this.column3D.strokeOpacity=0,this.column=this.column3D},R.prototype.validate=function(){j.prototype.validate.call(this),this.column3D&&(this.column3D.width=this.pixelWidth,this.column3D.height=this.pixelHeight,this.column3D.invalid&&this.column3D.validate())},R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.column3D&&this.column3D.copyFrom(u.column3D)},R.prototype.setFill=function(u){j.prototype.setFill.call(this,u),this.column.fill=u},R}(BI);ui.registeredClasses.Column3D=Oie;var H4=function(j){function R(){var u=j.call(this)||this;return u.className="ColumnSeries3DDataItem",u.applyTheme(),u}return re(R,j),R}(Bb),_8=function(j){function R(){var u=j.call(this)||this;return u.className="ColumnSeries3D",u.columns.template.column3D.applyOnClones=!0,u.columns.template.hiddenState.properties.visible=!0,u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"columnsContainer",{get:function(){var u=this.chart;return u&&u.columnsContainer&&u.leftAxesContainer.layout!="vertical"&&u.rightAxesContainer.layout!="vertical"&&u.bottomAxesContainer.layout!="horizontal"&&u.topAxesContainer.layout!="horizontal"?u.columnsContainer:this._columnsContainer},enumerable:!0,configurable:!0}),R.prototype.validateDataElementReal=function(u){j.prototype.validateDataElementReal.call(this,u),u.column&&(u.column.dx=this.dx,u.column.dy=this.dy,u.column.visible=this.visible)},R.prototype.validateDataElements=function(){j.prototype.validateDataElements.call(this),this.chart&&this.chart.invalidateLayout()},R.prototype.createColumnTemplate=function(){return new Oie},Object.defineProperty(R.prototype,"depth",{get:function(){return this.getPropertyValue("depth")},set:function(u){this.setPropertyValue("depth",u,!0),this.columns.template.column3D.depth=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"angle",{get:function(){return this.getPropertyValue("angle")},set:function(u){this.setPropertyValue("angle",u),this.columns.template.column3D.angle=u},enumerable:!0,configurable:!0}),R}($v);ui.registeredClasses.ColumnSeries3D=_8,ui.registeredClasses.ColumnSeries3DDataItem=H4;var l9e=function(j){function R(){var u=j.call(this)||this;return u.className="XYChart3DDataItem",u.applyTheme(),u}return re(R,j),R}(Az),mve=function(j){function R(){var u=j.call(this)||this;u._axisRendererX=A3,u._axisRendererY=Pie,u.className="XYChart3D",u.depth=30,u.angle=30;var w=u.seriesContainer.createChild(Zn);return w.shouldClone=!1,w.isMeasured=!1,w.layout="none",u.columnsContainer=w,u.columnsContainer.mask=u.createChild(so),u.applyTheme(),u}return re(R,j),R.prototype.updateSeriesMasks=function(){if(j.prototype.updateSeriesMasks.call(this),ZS()){var u=this.columnsContainer,w=u.mask;u.mask=void 0,u.mask=w}},Object.defineProperty(R.prototype,"depth",{get:function(){return this.getPropertyValue("depth")},set:function(u){this.setPropertyValue("depth",u),this.fixLayout(),this.invalidateDataUsers()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"angle",{get:function(){return this.getPropertyValue("angle")},set:function(u){this.setPropertyValue("angle",u),this.fixLayout(),this.invalidateDataUsers()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dx3D",{get:function(){return A(this.angle)*this.depth},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dy3D",{get:function(){return-Ue(this.angle)*this.depth},enumerable:!0,configurable:!0}),R.prototype.validateLayout=function(){j.prototype.validateLayout.call(this),this.fixColumns()},R.prototype.fixLayout=function(){this.chartContainer.paddingTop=-this.dy3D,this.chartContainer.paddingRight=this.dx3D,this.scrollbarX&&(this.scrollbarX.dy=this.dy3D,this.scrollbarX.dx=this.dx3D),this.scrollbarY&&(this.scrollbarY.dy=this.dy3D,this.scrollbarY.dx=this.dx3D),this.fixColumns(),j.prototype.fixLayout.call(this)},R.prototype.fixColumns=function(){var u=this,w=1,$=0;pr(this.series.iterator(),function(K){K instanceof _8&&(!K.clustered&&$>0&&w++,K.depthIndex=w-1,$++)});var U=0;pr(this.series.iterator(),function(K){if(K instanceof _8){K.depth=u.depth/w,K.angle=u.angle,K.columnsContainer==u.columnsContainer&&(K.dx=u.depth/w*A(u.angle)*K.depthIndex,K.dy=-u.depth/w*Ue(u.angle)*K.depthIndex);var ie=!1;(K.baseAxis==K.xAxis&&K.xAxis.renderer.inversed||K.baseAxis==K.yAxis&&K.yAxis.renderer.inversed)&&(ie=!0);var ae=1;K.dataItems.each(function(we){var Re=we.column;Re&&(Re.zIndex=ie?1e3*(1e3-ae)+U-100*K.depthIndex:1e3*ae+U-100*K.depthIndex),ae++}),ie?U--:U++}}),this.maskColumns()},R.prototype.processConfig=function(u){if(u&&Ee(u.series)&&pt(u.series))for(var w=0,$=u.series.length;w<$;w++)u.series[w].type=u.series[w].type||"ColumnSeries3D";j.prototype.processConfig.call(this,u)},R.prototype.maskColumns=function(){var u=this.plotContainer.pixelWidth,w=this.plotContainer.pixelHeight,$=this.dx3D,U=this.dy3D,K=ln({x:0,y:0})+br({x:$,y:U})+br({x:u+$,y:U})+br({x:u+$,y:w+U})+br({x:u,y:w})+br({x:u,y:w})+br({x:0,y:w})+" Z",ie=this.columnsContainer;ie&&ie.mask&&(ie.mask.path=K)},R}(G0);ui.registeredClasses.XYChart3D=mve;var Vz=function(j){function R(){var u=j.call(this)||this;u.className="HeatLegend",u.markerContainer=u.createChild(Zn),u.markerContainer.shouldClone=!1,u.markerCount=1;var w=new Nb;return w.minHeight=20,w.minWidth=20,w.interactionsEnabled=!1,w.fillOpacity=1,w.cornerRadius(0,0,0,0),u.markerContainer.minHeight=20,u.markerContainer.minWidth=20,u.orientation="horizontal",u.markers=new Xs(w),u._disposers.push(new ta(u.markers)),u._disposers.push(u.markers.template),u.applyTheme(),u}return re(R,j),R.prototype.getMinFromRules=function(u){var w,$=this.series;if($)return Na($.heatRules.iterator(),function(U){return U.property!=u||(w=U.min,!1)}),w},R.prototype.getMaxFromRules=function(u){var w,$=this.series;if($)return pr($.heatRules.iterator(),function(U){return U.property!=u||(w=U.max,!1)}),w},R.prototype.validate=function(){j.prototype.validate.call(this),this.valueAxis.renderer.inversed=this.reverseOrder;var u=this.series,w=this.minColor,$=this.maxColor;if(Ee(w)||(w=Ct(this.getMinFromRules("fill"))),Ee($)||($=Ct(this.getMaxFromRules("fill"))),u){var U=u.fill;!Ee(w)&&U instanceof Te&&(w=U),!Ee($)&&U instanceof Te&&($=U)}Ee($)||($=Ct(this.getMaxFromRules("fill")));var K=Tt(this.getMinFromRules("fillOpacity"));le(K)||(K=1);var ie=Tt(this.getMaxFromRules("fillOpacity"));le(ie)||(ie=1);var ae=Tt(this.getMinFromRules("strokeOpacity"));le(ae)||(ae=1);var we=Tt(this.getMaxFromRules("strokeOpacity"));le(we)||(we=1);for(var Re=Ct(this.getMinFromRules("stroke")),$e=Ct(this.getMaxFromRules("stroke")),Xe=0;Xe1&&(this.orientation=="horizontal"?Si.minGridDistance=this.measuredWidth/this.markerCount:Si.minGridDistance=this.measuredHeight/this.markerCount),this.valueAxis.invalidate(),Xe=this.markerCount;for(var Hi=this.markers.length;Xe0&&w.length>0)if(K){var ae=ln(u[0]);if(u.length>0)for(var we=1;we0||this.fillSprite.fillOpacity>0)&&(ae=ln(u[0])+L4(u),ae+=br(w[0])+L4(w),ae+=br(u[0]),ae+=" Z",this.fillSprite.path=ae)}else ae=ln(u[0])+L4(u),this.strokeSprite.path=ae,(this.fillOpacity>0||this.fillSprite.fillOpacity>0)&&(ae+=br(w[0])+L4(w),ae+=br(u[0]),ae+=" Z",this.fillSprite.path=ae);else this.strokeSprite.path="",this.fillSprite.path=""},R}(Pz);ui.registeredClasses.StepLineSeriesSegment=yve;var jz=function(j){function R(){var u=j.call(this)||this;return u.className="StepLineSeriesDataItem",u.applyTheme(),u}return re(R,j),R}(d8),Mie=function(j){function R(){var u=j.call(this)||this;return u.className="StepLineSeries",u.applyTheme(),u.startLocation=0,u.endLocation=1,u}return re(R,j),R.prototype.createDataItem=function(){return new jz},R.prototype.addPoints=function(u,w,$,U,K){var ie,ae,we,Re;this.baseAxis==this.xAxis&&(ie=this.startLocation,ae=this.endLocation,we=this.getAdjustedXLocation(w,this.yOpenField),Re=this.getAdjustedXLocation(w,this.yField)),this.baseAxis==this.yAxis&&(we=this.startLocation,Re=this.endLocation,ie=this.getAdjustedXLocation(w,this.xOpenField),ae=this.getAdjustedXLocation(w,this.xField));var $e=this.xAxis.getX(w,$,ie),Xe=this.yAxis.getY(w,U,we),Qe=this.xAxis.getX(w,$,ae),dt=this.yAxis.getY(w,U,Re);if($e=gt($e,-1e5,1e5),Xe=gt(Xe,-1e5,1e5),Qe=gt(Qe,-1e5,1e5),dt=gt(dt,-1e5,1e5),!this.noRisers&&u.length>1){var Gt=u[u.length-1];this.baseAxis==this.xAxis&&(K?u.push({x:Gt.x,y:dt}):u.push({x:$e,y:Gt.y})),this.baseAxis==this.yAxis&&(K?u.push({x:Qe,y:Gt.y}):u.push({x:Gt.x,y:Xe}))}var Yt={x:$e,y:Xe},ai={x:Qe,y:dt};K?u.push(ai,Yt):u.push(Yt,ai)},R.prototype.drawSegment=function(u,w,$){var U=!1;this.yAxis==this.baseAxis&&(U=!0),u.drawSegment(w,$,this.tensionX,this.tensionY,this.noRisers,U)},R.prototype.createSegment=function(){return new yve},Object.defineProperty(R.prototype,"noRisers",{get:function(){return this.getPropertyValue("noRisers")},set:function(u){this.setPropertyValue("noRisers",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startLocation",{get:function(){return this.getPropertyValue("startLocation")},set:function(u){this.setPropertyValue("startLocation",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endLocation",{get:function(){return this.getPropertyValue("endLocation")},set:function(u){this.setPropertyValue("endLocation",u,!0)},enumerable:!0,configurable:!0}),R}(Oz);ui.registeredClasses.StepLineSeries=Mie,ui.registeredClasses.StepLineSeriesDataItem=jz;var Die=function(j){function R(){var u=j.call(this)||this;return u.className="RadarColumn",u}return re(R,j),R.prototype.createAssets=function(){this.radarColumn=this.createChild(LI),this.radarColumn.shouldClone=!1,this.radarColumn.strokeOpacity=void 0,this.column=this.radarColumn},R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.radarColumn&&this.radarColumn.copyFrom(u.radarColumn)},R.prototype.getTooltipX=function(){var u=this.getPropertyValue("tooltipX");return le(u)?u:this.radarColumn.getTooltipX()},R.prototype.getTooltipY=function(){var u=this.getPropertyValue("tooltipX");return le(u)?u:this.radarColumn.getTooltipY()},R}(BI);ui.registeredClasses.RadarColumn=Die;var vve=function(j){function R(){var u=j.call(this)||this;return u.className="ColumnSeriesDataItem",u.applyTheme(),u}return re(R,j),R}(Bb),_ve=function(j){function R(){var u=j.call(this)||this;return u.className="RadarColumnSeries",u.applyTheme(),u}return re(R,j),R.prototype.createColumnTemplate=function(){return new Die},R.prototype.validate=function(){this.chart.invalid&&this.chart.validate(),j.prototype.validate.call(this)},R.prototype.disableUnusedColumns=function(u){u&&(u.column&&(u.column.__disabled=!0),pr(this.axisRanges.iterator(),function(w){var $=u.rangesColumns.getKey(w.uid);$&&($.__disabled=!0)}))},R.prototype.validateDataElementReal=function(u){var w,$,U,K,ie=this,ae=this.chart.startAngle,we=this.chart.endAngle,Re=this.yField,$e=this.yOpenField,Xe=this.xField,Qe=this.xOpenField,dt=this.getStartLocation(u),Gt=this.getEndLocation(u),Yt=(we-ae)/(this.dataItems.length*(this.end-this.start)),ai=u.column;ai||(ai=this.columns.create(),u.column=ai,Cr(this,ai,gc),Cr(this.columns.template,ai,gc),u.addSprite(ai),ai.paper=this.paper,this.setColumnStates(ai));var oi=ai.width,Ui=100;oi instanceof J&&(Ui=oi.percent);var Ji=Ve((Gt-dt)*(1-Ui/100)/2,5);if(dt+=Ji,Gt-=Ji,this.xAxis instanceof $h&&this.yAxis instanceof $h)U=C({x:this.yAxis.getX(u,Re,0,"valueY"),y:this.yAxis.getY(u,Re,0,"valueY")}),K=C({x:this.yAxis.getX(u,$e,1,"valueY"),y:this.yAxis.getY(u,$e,1,"valueY")}),w=this.xAxis.getAngle(u,Qe,0,"valueX"),$=this.xAxis.getAngle(u,Xe,1,"valueX"),ae+=dt*Yt,we-=(1-Gt)*Yt;else if(this.baseAxis==this.xAxis)U=C({x:this.yAxis.getX(u,Re,u.locations[Re],"valueY"),y:this.yAxis.getY(u,Re,u.locations[Re],"valueY")}),K=C({x:this.yAxis.getX(u,$e,u.locations[$e],"valueY"),y:this.yAxis.getY(u,$e,u.locations[$e],"valueY")}),w=this.xAxis.getAngle(u,Qe,dt,"valueX"),$=this.xAxis.getAngle(u,Xe,Gt,"valueX"),ae+=dt*Yt,we-=(1-Gt)*Yt;else{if(U=C({x:this.yAxis.getX(u,Re,dt,"valueY"),y:this.yAxis.getY(u,Re,dt,"valueY")}),K=C({x:this.yAxis.getX(u,$e,Gt,"valueY"),y:this.yAxis.getY(u,$e,Gt,"valueY")}),le(oi)){var Si=Math.abs(U-K);if(Si>oi){var Hi=(Si-oi)/2;U+=Hi,K-=Hi}}w=this.xAxis.getAngle(u,Xe,u.locations[Xe],"valueX"),$=this.xAxis.getAngle(u,Qe,u.locations[Qe],"valueX")}if($0?(Ir.arc=yr,Ir.radius=U,Ir.innerRadius=K,ai.__disabled=!1,ai.parent=this.columnsContainer,pr(this.axisRanges.iterator(),function(Es){var Dn=u.rangesColumns.getKey(Es.uid);Dn||(Dn=ie.columns.create(),Rs(ie.columns.template,Dn,gc),Cr(Es.contents,Dn,gc),Dn.dataItem&&$i(Dn.dataItem.sprites,Dn),u.addSprite(Dn),Dn.paper=ie.paper,ie.setColumnStates(Dn),u.rangesColumns.setKey(Es.uid,Dn));var Ra=Dn.radarColumn;Ra.startAngle=w,Ra.arc=yr,Ra.radius=U,Ra.innerRadius=K,Ra.invalid&&(Ra.paper=ie.paper,Ra.validate()),Dn.__disabled=!1,Dn.parent=Es.contents})):this.disableUnusedColumns(u)},R.prototype.getPoint=function(u,w,$,U,K,ie,ae){ie||(ie="valueX"),ae||(ae="valueY");var we=C({x:this.yAxis.getX(u,$,K,ae),y:this.yAxis.getY(u,$,K,ae)});we==0&&(we=1e-5);var Re=this.xAxis.getAngle(u,w,U,ie);return{x:we*A(Re),y:we*Ue(Re)}},R.prototype.getMaskPath=function(){var u=this.yAxis.renderer;return lC(u.startAngle,u.endAngle-u.startAngle,u.pixelRadius,u.pixelInnerRadius)},R.prototype.positionBulletReal=function(u,w,$){var U=this.xAxis,K=this.yAxis;(wU.end||$K.end)&&(u.visible=!1),u.moveTo(this.xAxis.renderer.positionToPoint(w,$))},R.prototype.setXAxis=function(u){j.prototype.setXAxis.call(this,u),this.updateRendererRefs()},R.prototype.setYAxis=function(u){j.prototype.setYAxis.call(this,u),this.updateRendererRefs()},R.prototype.updateRendererRefs=function(){var u=this.xAxis.renderer,w=this.yAxis.renderer;u.axisRendererY=w},R}($v);ui.registeredClasses.RadarColumnSeries=_ve,ui.registeredClasses.RadarColumnSeriesDataItem=vve;var GI=function(j){function R(){var u=j.call(this)||this;return u.slice=u.createChild(so),u.slice.shouldClone=!1,u.slice.setElement(u.paper.add("path")),u.slice.isMeasured=!1,u.orientation="vertical",u.bottomWidth=he(100),u.topWidth=he(100),u.isMeasured=!1,u.width=10,u.height=10,u.expandDistance=0,u.className="FunnelSlice",u.applyTheme(),u}return re(R,j),R.prototype.draw=function(){j.prototype.draw.call(this);var u=this.pixelPaddingTop,w=this.pixelPaddingBottom,$=this.pixelPaddingRight,U=this.pixelPaddingLeft,K=this.pixelWidth-$-U,ie=this.pixelHeight-u-w,ae=this.expandDistance,we="";if(this.orientation=="vertical"){var Re={x:(K-(oi=hs(this.topWidth,K)))/2+U,y:u},$e={x:(K+oi)/2+U,y:u},Xe={x:(K+(Ui=hs(this.bottomWidth,K)))/2+U,y:u+ie},Qe={x:(K-Ui)/2+U,y:u+ie},dt={x:$e.x+(Xe.x-$e.x)/2+ae*ie,y:$e.y+.5*ie},Gt={x:Re.x+(Qe.x-Re.x)/2-ae*ie,y:Re.y+.5*ie},Yt=br(Xe),ai=br(Re);ae!=0&&(Yt=aC(Xe,dt),ai=aC(Re,Gt)),we=ln(Re)+br($e)+Yt+br(Qe)+ai,this.tickPoint={x:$e.x+(Xe.x-$e.x)/2,y:$e.y+(Xe.y-$e.y)/2}}else{var oi,Ui,Ji={x:U,y:(ie-(oi=hs(this.topWidth,ie)))/2+u},Si={x:U,y:(ie+oi)/2+u},Hi={x:U+K,y:(ie-(Ui=hs(this.bottomWidth,ie)))/2+u},nr={x:U+K,y:(ie+Ui)/2+u};dt={y:Ji.y+(Hi.y-Ji.y)/2-ae*K,x:Ji.x+.5*K},Gt={y:Si.y+(nr.y-Si.y)/2+ae*K,x:Si.x+.5*K},Yt=br(Hi),ai=br(Si),ae!=0&&(Yt=aC(Hi,dt),ai=aC(Si,Gt)),we=ln(Si)+br(Ji)+Yt+br(nr)+ai,this.tickPoint={y:Si.y+(nr.y-Si.y)/2,x:Si.x+(nr.x-Si.x)/2}}this.slice.path=we,this.invalidateLayout()},R.prototype.getPoint=function(u,w){var $=this.pixelPaddingTop,U=this.pixelPaddingBottom,K=this.pixelPaddingRight,ie=this.pixelPaddingLeft,ae=this.pixelWidth-K-ie,we=this.pixelHeight-$-U;if(this.orientation=="vertical"){var Re={x:(ae-(dt=hs(this.topWidth,ae)))/2+ie,y:$},$e={x:(ae+dt)/2+ie,y:$},Xe={x:(ae+(Gt=hs(this.bottomWidth,ae)))/2+ie,y:$+we},Qe=Re.x+((ae-Gt)/2+ie-Re.x)*w;return{x:Qe+($e.x+(Xe.x-$e.x)*w-Qe)*u,y:$e.y+(Xe.y-$e.y)*w}}var dt,Gt,Yt=ie,ai=(we-(dt=hs(this.topWidth,we)))/2+$,oi=(we+dt)/2+$,Ui=ie+ae,Ji=ai+((we-(Gt=hs(this.bottomWidth,we)))/2+$-ai)*u;return{y:Ji+(oi+((we+Gt)/2+$-oi)*u-Ji)*w,x:Yt+(Ui-Yt)*u}},Object.defineProperty(R.prototype,"bottomWidth",{get:function(){return this.getPropertyValue("bottomWidth")},set:function(u){this.setPercentProperty("bottomWidth",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"topWidth",{get:function(){return this.getPropertyValue("topWidth")},set:function(u){this.setPercentProperty("topWidth",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"orientation",{get:function(){return this.getPropertyValue("orientation")},set:function(u){this.setPropertyValue("orientation",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"expandDistance",{get:function(){return this.getPropertyValue("expandDistance")},set:function(u){this.setPropertyValue("expandDistance",u,!0)},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.slice&&this.slice.copyFrom(u.slice)},R}(Zn);ui.registeredClasses.FunnelSlice=GI;var Ul=function(j){function R(){var u=j.call(this)||this;return u._label=new Jn,u._slice=new Jn,u.className="FunnelTick",u.element=u.paper.add("path"),u._disposers.push(u._label),u._disposers.push(u._slice),u.setPropertyValue("locationX",0),u.setPropertyValue("locationY",0),u.applyTheme(),u}return re(R,j),R.prototype.draw=function(){j.prototype.draw.call(this);var u=this.slice,w=u.getPoint(this.locationX,this.locationY);if(w){var $=this.label,U=u.dataItem.component,K=void 0,ie=void 0,ae=void 0;if(U.orientation=="vertical"){var we=$.pixelX,Re=$.pixelY;U.labelsOpposite||(we+=$.maxRight),K=wp(w,u,this.parent),ae=wp({x:we,y:Re},$.parent,this.parent),ie={x:$.parent.pixelX-this.length,y:ae.y},U.labelsOpposite||(ie.x=$.parent.measuredWidth+this.length)}else we=$.pixelX,Re=$.pixelY,U.labelsOpposite||(Re+=$.maxBottom),K=wp(w,u,this.parent),ie={x:(ae=wp({x:we,y:Re},$.parent,this.parent)).x,y:$.parent.pixelY-this.length},U.labelsOpposite||(ie.y=$.parent.measuredHeight+this.length);this.path=ln(K)+br(ie)+br(ae)}},Object.defineProperty(R.prototype,"slice",{get:function(){return this._slice.get()},set:function(u){this._slice.set(u,new Nn([u.events.on("transformed",this.invalidate,this,!1),u.events.on("validated",this.invalidate,this,!1)]))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"label",{get:function(){return this._label.get()},set:function(u){this._label.set(u,u.events.on("transformed",this.invalidate,this,!1))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"locationX",{get:function(){return this.getPropertyValue("locationX")},set:function(u){this.setPropertyValue("locationX",u,!1,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"locationY",{get:function(){return this.getPropertyValue("locationY")},set:function(u){this.setPropertyValue("locationY",u,!1,!0)},enumerable:!0,configurable:!0}),R}(G4);ui.registeredClasses.FunnelTick=Ul;var Bx=function(j){function R(){var u=j.call(this)||this;return u.className="FunnelSeriesDataItem",u.events.on("visibilitychanged",function(){u.component&&u.component.invalidateDataItems()},u,!1),u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"sliceLink",{get:function(){var u=this;if(!this._sliceLink){var w=this.component.sliceLinks.create();this._sliceLink=w,this._disposers.push(w),w.parent=this.component.slicesContainer,this._disposers.push(new jr(function(){u.component&&u.component.sliceLinks.removeValue(w)})),this.addSprite(w),w.visible=this.visible}return this._sliceLink},enumerable:!0,configurable:!0}),R}($x),zz=function(j){function R(){var u=j.call(this)||this;return u._nextY=0,u.className="FunnelSeries",u.orientation="vertical",u.width=he(100),u.height=he(100),u.slicesContainer.width=he(100),u.slicesContainer.height=he(100),u._disposers.push(u.slicesContainer.events.on("maxsizechanged",u.invalidateDataItems,u,!1)),u.labelsOpposite=!0,u.labelsContainer.layout="absolute",u.bottomRatio=0,u.applyTheme(),u}return re(R,j),R.prototype.createSlice=function(){return new GI},R.prototype.createTick=function(){return new Ul},R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),Ee(this.readerTitle)||(this.readerTitle=this.language.translate("Funnel Series"))},R.prototype.createDataItem=function(){return new Bx},R.prototype.initSlice=function(u){u.isMeasured=!1,u.defaultState.properties.scale=1,u.observe("scale",this.handleSliceScale,this),u.observe(["dx","dy","x","y"],this.handleSliceMove,this),u.tooltipText="{category}: {value.percent.formatNumber('#.#p')} ({value.value})",u.states.create("hover").properties.expandDistance=.2},R.prototype.initLabel=function(u){j.prototype.initLabel.call(this,u),u.verticalCenter="middle",u.horizontalCenter="middle",u.isMeasured=!0,u.padding(5,5,5,5)},R.prototype.validate=function(){j.prototype.validate.call(this),this._nextY=0},R.prototype.validateDataElements=function(){var u=this,w=this.slicesContainer,$=this.labelsContainer,U=this.labels.template;this.alignLabels?(U.interactionsEnabled=!0,w.isMeasured=!0,$.isMeasured=!0):(U.interactionsEnabled=!1,w.isMeasured=!1,$.isMeasured=!1);var K=0,ie=0;this.dataItems.each(function(ae){Ee(ae.value)&&(ie++,ae.value>0?K+=Math.abs(ae.getWorkingValue("value")/ae.value):u.ignoreZeroValues||!ae.visible||ae.__disabled||ae.isHiding?ie--:K+=1)}),this._total=1/ie*K,this._count=ie,j.prototype.validateDataElements.call(this),this.arrangeLabels()},R.prototype.getNextValue=function(u){var w=u.index,$=u.getWorkingValue("value");if(w0){var w=this.labels.getIndex(u);return w.__disabled||!w.visible?this.getLastLabel(u-1):w}},R.prototype.arrangeLabels=function(){if(this.alignLabels){var u=this.labels.length;if(u>1){var w=this.getLastLabel(u-1);if(w){var $=w.pixelY,U=w.pixelX;if(u>1){for(var K=u-2;K>=0;K--)(ie=this.labels.getIndex(K)).visible&&!ie.__disabled&&(ie.invalid&&ie.validate(),this.orientation=="vertical"?ie.pixelY+ie.measuredHeight>$&&(ie.y=Math.min(1e6,$-ie.measuredHeight)):ie.pixelX+ie.measuredWidth>U&&(ie.x=Math.min(1e6,U-ie.measuredWidth)),$=ie.pixelY,U=ie.pixelX);for($=0,U=0,K=0;K0){var ae=ie.getWorkingValue("value")/ie.value,we=ie.sliceLink;u.orientation=="vertical"?$-=we.pixelHeight*ae:w-=we.pixelWidth*ae}}),this._pyramidHeight=hs(this.pyramidHeight,$),this._pyramidWidth=hs(this.pyramidHeight,w),this.orientation=="vertical"){var U=($-this._pyramidHeight)/2;this.slicesContainer.y=U,this.labelsContainer.y=U,this.ticksContainer.y=U}else{var K=(w-this._pyramidWidth)/2;this.slicesContainer.x=K,this.labelsContainer.x=K,this.ticksContainer.x=K}j.prototype.validateDataElements.call(this)},R.prototype.decorateSlice=function(u){var w=this.dataItem.values.value.absoluteSum;if(w!=0){var $=u.slice,U=u.sliceLink,K=u.label,ie=u.tick;this.getNextValue(u);var ae=Math.abs(u.getWorkingValue("value")),we=this._pyramidWidth,Re=this._pyramidHeight,$e=this.slicesContainer.innerWidth,Xe=this.slicesContainer.innerHeight,Qe=U.pixelWidth,dt=U.pixelHeight;if(u.value!=0&&u.value!=null||!this.ignoreZeroValues?u.__disabled=!1:u.__disabled=!0,this.orientation=="vertical"){var Gt=hs(this.topWidth,$e);le(this._nextWidth)||(this._nextWidth=Gt);var Yt=hs(this.bottomWidth,$e),ai=this._nextWidth,oi=Math.atan2(Re,Gt-Yt);(nr=Math.tan(Math.PI/2-oi))==0&&(nr=1e-8);var Ui=void 0,Ji=void 0;if(this.valueIs=="area"){var Si=(Gt+Yt)/2*Re*ae/w,Hi=Math.abs(ai*ai-2*Si*nr);Ji=(Ui=(ai-Math.sqrt(Hi))/nr)>0?(2*Si-Ui*ai)/Ui:ai}else Ji=ai-(Ui=Re*ae/w)*nr;$.height=Ui,$.width=$e,$.bottomWidth=Ji,$.topWidth=ai,U.topWidth=$.bottomWidth,U.bottomWidth=$.bottomWidth,$.y=this._nextY,this.alignLabels?K.x=0:K.x=$e/2,K.y=$.pixelY+$.pixelHeight*ie.locationY+$.dy,this._nextY+=$.pixelHeight+dt*ae/Math.max(Math.abs(u.value),1e-8),U.y=this._nextY-dt,U.x=$e/2}else{var nr;Gt=hs(this.topWidth,Xe),le(this._nextWidth)||(this._nextWidth=Gt),Yt=hs(this.bottomWidth,Xe),ai=this._nextWidth,oi=Math.atan2(we,Gt-Yt),(nr=Math.tan(Math.PI/2-oi))==0&&(nr=1e-8);var Ir=void 0;Ji=void 0,Ji=this.valueIs=="area"?(2*(Si=(Gt+Yt)/2*we*ae/w)-(Ir=(ai-Math.sqrt(ai*ai-2*Si*nr))/nr)*ai)/Ir:ai-(Ir=we*ae/w)*nr,$.width=Ir,$.height=Xe,$.bottomWidth=Ji,$.topWidth=ai,U.topWidth=$.bottomWidth,U.bottomWidth=$.bottomWidth,$.x=this._nextY,this.alignLabels?K.y=this.labelsContainer.measuredHeight:K.y=Xe/2,K.x=$.pixelX+$.pixelWidth*ie.locationX+$.dx,this._nextY+=$.pixelWidth+Qe*ae/Math.max(Math.abs(u.value),1e-8),U.x=this._nextY-Qe,U.y=Xe/2}this._nextWidth=$.bottomWidth}},Object.defineProperty(R.prototype,"topWidth",{get:function(){return this.getPropertyValue("topWidth")},set:function(u){this.setPercentProperty("topWidth",u,!1,!1,10,!1)&&this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pyramidHeight",{get:function(){return this.getPropertyValue("pyramidHeight")},set:function(u){this.setPercentProperty("pyramidHeight",u,!1,!1,10,!1)&&this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"bottomWidth",{get:function(){return this.getPropertyValue("bottomWidth")},set:function(u){this.setPercentProperty("bottomWidth",u,!1,!1,10,!1)&&this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"valueIs",{get:function(){return this.getPropertyValue("valueIs")},set:function(u){this.setPropertyValue("valueIs",u)&&this.invalidate()},enumerable:!0,configurable:!0}),R}(zz);ui.registeredClasses.PyramidSeries=Fie,ui.registeredClasses.PyramidSeriesDataItem=Hz;var q4=function(j){function R(){var u=j.call(this)||this;return u.className="PictorialStackedSeriesDataItem",u.applyTheme(),u}return re(R,j),R}(Hz),bve=function(j){function R(){var u=j.call(this)||this;return u.className="PictorialStackedSeries",u.topWidth=he(100),u.bottomWidth=he(100),u.valueIs="height",u.applyTheme(),u.startLocation=0,u.endLocation=1,u.align="center",u.valign="middle",u._maskSprite=u.slicesContainer.createChild(so),u._maskSprite.visible=!1,u._maskSprite.zIndex=100,u._maskSprite.shouldClone=!1,u}return re(R,j),R.prototype.validateDataElements=function(){var u=this.slicesContainer.maxWidth,w=this.slicesContainer.maxHeight,$=this._maskSprite,U=$.measuredWidth/$.scale,K=$.measuredHeight/$.scale,ie=W(w/K,u/U);ie==1/0&&(ie=1),ie=ve(.001,ie);var ae,we,Re=this.startLocation,$e=this.endLocation,Xe=W(u,U*ie),Qe=W(w,K*ie);$.scale=ie,this.orientation=="vertical"?(this.topWidth=Xe+4,this.bottomWidth=Xe+4,this.pyramidHeight=Qe*($e-Re),$.x=u/2,$.y=Qe/2):(this.topWidth=Qe+4,this.bottomWidth=Qe+4,this.pyramidHeight=Xe*($e-Re),$.valign="middle",$.x=Xe/2,$.y=w/2),$.verticalCenter="middle",$.horizontalCenter="middle",j.prototype.validateDataElements.call(this),this.orientation=="vertical"?(this.valign=="bottom"&&(ae=w-Qe),this.valign=="middle"&&(ae=(w-Qe)/2),this.valign=="top"&&(ae=0),this.align=="left"&&(we=-(u-Xe)/2),this.align=="center"&&(we=0),this.align=="right"&&(we=(u-Xe)/2),this.slices.template.dy=Re*Qe,this.alignLabels&&(this.slicesContainer.dx=we)):(this.valign=="bottom"&&(ae=(w-Qe)/2),this.valign=="middle"&&(ae=0),this.valign=="top"&&(ae=-(w-Qe)/2),this.align=="left"&&(we=0),this.align=="center"&&(we=(u-Xe)/2),this.align=="right"&&(we=u-Xe),this.slices.template.dx=Re*Xe,this.alignLabels&&(this.slicesContainer.dy=ae)),this.slicesContainer.x=we,this.labelsContainer.x=we,this.ticksContainer.x=we,this.slicesContainer.y=ae,this.labelsContainer.y=ae,this.ticksContainer.y=ae,Xe>0&&Qe>0&&(this.slicesContainer.mask=$)},R.prototype.applyInternalDefaults=function(){j.prototype.applyInternalDefaults.call(this),Ee(this.readerTitle)||(this.readerTitle=this.language.translate("Pyramid Series"))},R.prototype.createDataItem=function(){return new q4},Object.defineProperty(R.prototype,"maskSprite",{get:function(){return this._maskSprite},enumerable:!0,configurable:!0}),R.prototype.initSlice=function(u){j.prototype.initSlice.call(this,u);var w=u.states.getKey("hover");w&&(w.properties.expandDistance=0)},Object.defineProperty(R.prototype,"startLocation",{get:function(){return this.getPropertyValue("startLocation")},set:function(u){this.setPropertyValue("startLocation",u)&&this.invalidateDataItems()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endLocation",{get:function(){return this.getPropertyValue("endLocation")},set:function(u){this.setPropertyValue("endLocation",u)&&this.invalidateDataItems()},enumerable:!0,configurable:!0}),R}(Fie);ui.registeredClasses.PictorialStackedSeries=bve,ui.registeredClasses.PictorialStackedSeriesDataItem=q4;var Wz=function(j){function R(){var u=j.call(this)||this;return u.className="ConeColumn",u}return re(R,j),R.prototype.createAssets=function(){this.coneColumn=this.createChild(_z),this.coneColumn.shouldClone=!1,this.column=this.coneColumn},R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.coneColumn&&this.coneColumn.copyFrom(u.coneColumn)},R}(BI);ui.registeredClasses.ConeColumn=Wz;var qz=function(j){function R(){var u=j.call(this)||this;return u.className="ConeSeriesDataItem",u.applyTheme(),u}return re(R,j),R}(Bb),wve=function(j){function R(){var u=j.call(this)||this;return u.className="ConeSeries",u.applyTheme(),u}return re(R,j),R.prototype.createColumnTemplate=function(){return new Wz},R.prototype.getMaskPath=function(){var u=0,w=0,$=this.columns.getIndex(0);if($)return this.baseAxis==this.xAxis?w=$.coneColumn.innerWidth/2+1:u=$.coneColumn.innerHeight/2+1,uC({x:-u,y:0,width:this.xAxis.axisLength+u,height:this.yAxis.axisLength+w})},R.prototype.validateDataElementReal=function(u){if(j.prototype.validateDataElementReal.call(this,u),u.column){var w=u.column.coneColumn;w.fill=u.column.fill,this.baseAxis==this.yAxis?w.orientation="horizontal":w.orientation="vertical"}},R}($v);ui.registeredClasses.ConeSeries=wve,ui.registeredClasses.ConeSeriesDataItem=qz;var VI=function(j){function R(){var u=j.call(this)||this;return u.className="CurvedColumn",u}return re(R,j),R.prototype.createAssets=function(){this.curvedColumn=this.createChild(so),this.curvedColumn.shouldClone=!1,this.setPropertyValue("tension",.7),this.width=he(120),this.height=he(120),this.column=this.curvedColumn},R.prototype.draw=function(){j.prototype.draw.call(this);var u,w=this.realWidth,$=this.realHeight,U=this.realX-this.pixelX,K=this.realY-this.pixelY;this.width;var ie=1,ae=1;this.orientation=="vertical"?(ie=this.tension,u=[{x:0,y:$+K},{x:w/2,y:K},{x:w,y:$+K}]):(ae=this.tension,u=[{x:U,y:$=Math.abs($)},{x:U+w,y:$/2},{x:U,y:0}]);var we=ln(u[0])+new _1(ie,ae).smooth(u);this.column.path=we},R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.curvedColumn&&this.curvedColumn.copyFrom(u.curvedColumn)},Object.defineProperty(R.prototype,"tension",{get:function(){return this.getPropertyValue("tension")},set:function(u){this.setPropertyValue("tension",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"orientation",{get:function(){return this.getPropertyValue("orientation")},set:function(u){this.setPropertyValue("orientation",u,!0)},enumerable:!0,configurable:!0}),R}(BI);ui.registeredClasses.CurvedColumn=VI;var Lie=function(j){function R(){var u=j.call(this)||this;return u.className="CurvedColumnSeriesDataItem",u.applyTheme(),u}return re(R,j),R}(Bb),xve=function(j){function R(){var u=j.call(this)||this;return u.className="CurvedColumnSeries",u.applyTheme(),u}return re(R,j),R.prototype.createColumnTemplate=function(){return new VI},R.prototype.validateDataElementReal=function(u){j.prototype.validateDataElementReal.call(this,u);var w=u.column;(w=u.column)&&(u.column.curvedColumn.fill=u.column.fill,this.baseAxis==this.yAxis?w.orientation="horizontal":w.orientation="vertical")},R}($v);ui.registeredClasses.CurvedColumnSeries=xve,ui.registeredClasses.CurvedColumnSeriesDataItem=Lie;var Yz=function(j){function R(){var u=j.call(this)||this;u.className="CircleBullet";var w=u.createChild(FI);return w.shouldClone=!1,w.radius=5,w.isMeasured=!1,u.circle=w,u.applyTheme(),u}return re(R,j),R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.circle.copyFrom(u.circle)},R}(Oo);ui.registeredClasses.CircleBullet=Yz;var Sve=function(j){function R(){var u=j.call(this)||this;return u.className="ErrorBullet",u.errorLine=u.createChild(so),u.errorLine.shouldClone=!1,u.width=20,u.height=20,u.strokeOpacity=1,u.isDynamic=!0,u}return re(R,j),R.prototype.validatePosition=function(){j.prototype.validatePosition.call(this);var u=this.pixelWidth/2,w=this.pixelHeight/2;this.errorLine.path=ln({x:-u,y:-w})+br({x:u,y:-w})+ln({x:0,y:-w})+br({x:0,y:w})+ln({x:-u,y:w})+br({x:u,y:w})},R.prototype.copyFrom=function(u){j.prototype.copyFrom.call(this,u),this.errorLine.copyFrom(u.errorLine)},R}(Oo);ui.registeredClasses.ErrorBullet=Sve;var Cve=function(j){function R(){var u=j.call(this)||this;return u.className="NavigationBarDataItem",u.applyTheme(),u}return re(R,j),Object.defineProperty(R.prototype,"name",{get:function(){return this.properties.name},set:function(u){this.setProperty("name",u)},enumerable:!0,configurable:!0}),R}(MI),P3=function(j){function R(){var u=j.call(this)||this;u.className="NavigationBar";var w=new $a,$=new gz;$.valign="middle",$.paddingTop=8,$.paddingBottom=8,u.paddingBottom=2,u.links=new Xs($),u._disposers.push(new ta(u.links)),u._disposers.push($),u._linksIterator=new Qp(u.links,function(){return u.links.create()}),u._linksIterator.createNewItems=!0;var U=new Z$;U.direction="right",U.width=8,U.height=12,U.fill=w.getFor("alternativeBackground"),U.fillOpacity=.5,U.valign="middle",U.marginLeft=10,U.marginRight=10,u.separators=new Xs(U),u._disposers.push(new ta(u.separators)),u._disposers.push(U);var K=new gz;return u.activeLink=K,K.copyFrom($),K.valign="middle",K.fontWeight="bold",u.width=he(100),u.layout="grid",u.dataFields.name="name",u.applyTheme(),u}return re(R,j),R.prototype.validateDataElements=function(){this.removeChildren(),this._linksIterator.reset(),j.prototype.validateDataElements.call(this)},R.prototype.validateDataElement=function(u){var w;if(j.prototype.validateDataElement.call(this,u),u.indexw.getHitOption(this.interactions,"hitTolerance")){switch(this._generalBehavior){case"zoom":this.dispatch("zoomended");break;case"select":this.dispatch("selectended");break;case"pan":this.dispatch("panended"),w.setGlobalStyle(_l.default)}this.downPoint=void 0,this.updateSelection()}},R.prototype.updateSelection=function(){},R.prototype.getPositions=function(){this.xPosition=this.point.x/this.innerWidth,this.yPosition=1-this.point.y/this.innerHeight},R.prototype.handleCursorDown=function(u){if(!(!this.interactionsEnabled||this.interactions.isTouchProtected&&u.touch)&&Vs().isLocalElement(u.pointer,this.paper.svg,this.uid)){eC();var w=Mb(u.pointer.point,this);this._stick=="hard"&&this._stickPoint&&(w=this._stickPoint),this._adapterO&&this._adapterO.apply("cursorPoint",w),this.fitsToBounds(w)&&(this._downPointOrig={x:w.x,y:w.y},u.event.cancelable&&this.shouldPreventGestures(u.touch)&&this.fitsToBounds(w)&&u.event.preventDefault(),this.triggerMove(w),this.triggerDown(w))}},R.prototype.shouldPreventGestures=function(u){return!0},R.prototype.updatePoint=function(u){},R.prototype.handleCursorUp=function(u){if(this.interactionsEnabled&&(this.downPoint||Vs().isLocalElement(u.pointer,this.paper.svg,this.uid))){var w=Mb(u.pointer.point,this);this._adapterO&&this._adapterO.apply("cursorPoint",w),this.downPoint&&this.fitsToBounds(this.downPoint)&&(this._stick=="hard"&&this._stickPoint&&(w=this._stickPoint),this._upPointOrig={x:w.x,y:w.y},this.triggerMove(w),this.triggerUp(w))}},Object.defineProperty(R.prototype,"chart",{get:function(){return this._chart},set:function(u){this._chart=u,Ee(this._chart.plotContainer)&&Vs().lockElement(this._chart.plotContainer.interactions)},enumerable:!0,configurable:!0}),R}(Zn);ui.registeredClasses.Cursor=kie;var Y4=function(j){function R(){var u=j.call(this)||this;u._lineX=new Jn,u._lineY=new Jn,u._xAxis=new Jn,u._yAxis=new Jn,u._snapToDisposers=[],u.className="XYCursor",u.behavior="zoomX",u.maxPanOut=.1;var w=new $a;u.snapOnPan=!0;var $=u.createChild(so);$.shouldClone=!1,$.fillOpacity=.2,$.fill=w.getFor("alternativeBackground"),$.isMeasured=!1,$.visible=!1,$.interactionsEnabled=!1,u.selection=$,u._disposers.push(u.selection);var U=u.createChild(so);U.shouldClone=!1,U.stroke=w.getFor("grid"),U.fill=He(),U.strokeDasharray="3,3",U.isMeasured=!1,U.strokeOpacity=.4,U.interactionsEnabled=!1,U.y=0,u.lineX=U,u._disposers.push(u.lineX);var K=u.createChild(so);return K.shouldClone=!1,K.stroke=w.getFor("grid"),K.fill=He(),K.strokeDasharray="3,3",K.isMeasured=!1,K.strokeOpacity=.4,K.interactionsEnabled=!1,K.x=0,u.lineY=K,u._disposers.push(u.lineY),u.events.on("sizechanged",u.updateSize,u,!1),u._disposers.push(u._lineX),u._disposers.push(u._lineY),u._disposers.push(u._xAxis),u._disposers.push(u._yAxis),u.mask=u,u.hideSeriesTooltipsOnSelection=!0,u.applyTheme(),u}return re(R,j),R.prototype.updateSize=function(){this.lineX&&(this.lineX.path=ln({x:0,y:0})+br({x:0,y:this.innerHeight})),this.lineY&&(this.lineY.path=ln({x:0,y:0})+br({x:this.innerWidth,y:0}))},R.prototype.updateSelection=function(){if(this._usesSelection){var u=this.downPoint,w=this.behavior;if(u){var $=this.point;this.lineX&&($.x=this.lineX.pixelX),this.lineY&&($.y=this.lineY.pixelY);var U=this.selection,K=Math.min($.x,u.x),ie=Math.min($.y,u.y),ae=Ve(Math.abs(u.x-$.x),this._positionPrecision),we=Ve(Math.abs(u.y-$.y),this._positionPrecision);switch(w){case"zoomX":case"selectX":ie=0,we=this.pixelHeight;break;case"zoomY":case"selectY":K=0,ae=this.pixelWidth}U.x=K,U.y=ie,U.path=mz(ae,we),U.validatePosition()}else this._generalBehavior!="select"&&this.selection.hide()}},R.prototype.fixPoint=function(u){return u.x=Math.max(0,u.x),u.y=Math.max(0,u.y),u.x=Math.min(this.pixelWidth,u.x),u.y=Math.min(this.pixelHeight,u.y),u},R.prototype.triggerMoveReal=function(u,w){j.prototype.triggerMoveReal.call(this,u,w);var $=this.snapToSeries;if($&&!this.downPoint)if($ instanceof NI)$.isHidden&&this.updateLinePositions(u);else{var U=!0;mi($,function(K){K.isHidden||(U=!1)}),U&&this.updateLinePositions(u)}else this.updateLinePositions(u);this.downPoint&&C(this.downPoint,u)>3&&this._generalBehavior=="pan"&&(this.getPanningRanges(),this.dispatch("panning"))},R.prototype.updateLinePositions=function(u){u=this.fixPoint(this.point),this.lineX&&this.lineX.visible&&!this.xAxis&&(this.lineX.x=u.x),this.lineY&&this.lineY.visible&&!this.yAxis&&(this.lineY.y=u.y),this.updateSelection()},R.prototype.triggerDownReal=function(u){if(this.visible&&!this.isHiding)if(this._generalBehavior=="select"&&(this.selection.parent=this.parent),this.fitsToBounds(u)){this.downPoint={x:u.x,y:u.y},this.updatePoint(u),this.point.x=this.downPoint.x,this.point.y=this.downPoint.y;var w=this.selection,$=this.downPoint.x,U=this.downPoint.y;this._usesSelection&&(w.x=$,w.y=U,w.path="",w.show()),j.prototype.triggerDownReal.call(this,u)}else this.downPoint=void 0;else this.downPoint=void 0},R.prototype.updatePoint=function(u){this.lineX&&(u.x=this.lineX.pixelX),this.lineY&&(u.y=this.lineY.pixelY)},R.prototype.triggerUpReal=function(u){this.hasMoved()?this.downPoint&&(this.upPoint=u,this.updatePoint(this.upPoint),this._generalBehavior!="pan"&&this.getRanges(),this._generalBehavior!="select"&&this.selection.hide(),j.prototype.triggerUpReal.call(this,u)):(this._generalBehavior!="select"?this.selection.hide(0):(this.xRange=void 0,this.yRange=void 0,this.dispatchImmediately("selectended")),this._generalBehavior=="pan"&&Vs().setGlobalStyle(_l.default),this.dispatchImmediately("behaviorcanceled")),this.downPoint=void 0,this.dispatch("cursorpositionchanged")},R.prototype.hasMoved=function(){return(this.behavior=="zoomX"||this.behavior=="panX"?D(this._upPointOrig,this._downPointOrig):this.behavior=="zoomY"||this.behavior=="panY"?F(this._upPointOrig,this._downPointOrig):C(this._upPointOrig,this._downPointOrig))>Vs().getHitOption(this.interactions,"hitTolerance")},R.prototype.getPanningRanges=function(){var u=Ve(this.downPoint.x/this.innerWidth,5),w=1-Ve(this.downPoint.y/this.innerHeight,5),$=u-Ve(this.point.x/this.innerWidth,5),U=w-(1-Ve(this.point.y/this.innerHeight,5));this.xRange={start:$,end:1+$},this.yRange={start:U,end:1+U},this.behavior=="panX"&&(this.yRange.start=0,this.yRange.end=1),this.behavior=="panY"&&(this.xRange.start=0,this.xRange.end=1)},R.prototype.getRanges=function(){this.lineX&&(this.upPoint.x=this.lineX.pixelX),this.lineY&&(this.upPoint.y=this.lineY.pixelY),this.selection;var u=Ve(this.downPoint.x/this.innerWidth,5),w=Ve(this.upPoint.x/this.innerWidth,5),$=1-Ve(this.downPoint.y/this.innerHeight,5),U=1-Ve(this.upPoint.y/this.innerHeight,5);this.xRange={start:W(u,w),end:ve(u,w)},this.yRange={start:W($,U),end:ve($,U)}},Object.defineProperty(R.prototype,"behavior",{get:function(){return this.getPropertyValue("behavior")},set:function(u){this.setPropertyValue("behavior",u,!0),this._usesSelection=!1,u.indexOf("zoom")!=-1&&(this._generalBehavior="zoom",this._usesSelection=!0),u.indexOf("select")!=-1&&(this._generalBehavior="select",this._usesSelection=!0),u.indexOf("pan")!=-1&&(this._generalBehavior="pan",this._usesSelection=!1)},enumerable:!0,configurable:!0}),R.prototype.shouldPreventGestures=function(u){return!(this.interactions.isTouchProtected&&u||this.behavior=="none")},Object.defineProperty(R.prototype,"fullWidthLineX",{get:function(){return this.getPropertyValue("fullWidthLineX")},set:function(u){this.setPropertyValue("fullWidthLineX",u),u||this.updateSize()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fullWidthLineY",{get:function(){return this.getPropertyValue("fullWidthLineY")},set:function(u){this.setPropertyValue("fullWidthLineY",u),u||this.updateSize()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"hideSeriesTooltipsOnSelection",{get:function(){return this.getPropertyValue("hideSeriesTooltipsOnSelection")},set:function(u){this.setPropertyValue("hideSeriesTooltipsOnSelection",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxTooltipDistance",{get:function(){return this.getPropertyValue("maxTooltipDistance")},set:function(u){this.setPropertyValue("maxTooltipDistance",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxPanOut",{get:function(){return this.getPropertyValue("maxPanOut")},set:function(u){this.setPropertyValue("maxPanOut",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"xAxis",{get:function(){return this._xAxis.get()},set:function(u){var w=this;this._xAxis.get()!=u&&this._xAxis.set(u,new Nn([u.tooltip.events.on("positionchanged",this.handleXTooltipPosition,this,!1),u.events.on("rangechangestarted",function($){w.hide(0),w.preventShow=!0},void 0,!1),u.events.on("rangechangeended",function($){w.preventShow=!1,w.hide(0),w.dispatch("cursorpositionchanged")},void 0,!1)]))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"yAxis",{get:function(){return this._yAxis.get()},set:function(u){var w=this;this._yAxis.get()!=u&&this._yAxis.set(u,new Nn([u.tooltip.events.on("positionchanged",this.handleYTooltipPosition,this,!1),u.events.on("rangechangestarted",function($){w.hide(0),w.__disabled=!0},void 0,!1),u.events.on("rangechangeended",function($){w.__disabled=!1,w.hide(0),w.dispatch("cursorpositionchanged")},void 0,!1)]))},enumerable:!0,configurable:!0}),R.prototype.handleXTooltipPosition=function(u){var w=this.xAxis.tooltip,$=If({x:w.pixelX,y:w.pixelY},this),U=$.x;if($.y=1,this.lineX&&(this.lineX.x=U,this.fitsToBounds($)||this.hide()),this.xAxis&&this.fullWidthLineX){var K=this.xAxis.currentItemStartPoint,ie=this.xAxis.currentItemEndPoint;if(K&&ie){this.lineX.x=U;var ae=ie.x-K.x;this.lineX.path=mz(ae,this.innerHeight,-ae/2)}}},R.prototype.handleYTooltipPosition=function(u){var w=this.yAxis.tooltip,$=If({x:w.pixelX,y:w.pixelY},this),U=$.y;if($.x=1,this.lineY&&(this.lineY.y=U,this.fitsToBounds($)||this.hide()),this.yAxis&&this.fullWidthLineY){var K=this.yAxis.currentItemStartPoint,ie=this.yAxis.currentItemEndPoint;if(K&&ie){this.lineY.y=U;var ae=ie.y-K.y;this.lineY.path=mz(this.innerWidth,ae,0,-ae/2)}}},Object.defineProperty(R.prototype,"lineX",{get:function(){return this._lineX.get()},set:function(u){u?(u.setElement(this.paper.add("path")),this._lineX.set(u,u.events.on("positionchanged",this.updateSelection,this,!1)),u.interactionsEnabled=!1,u.parent=this):this._lineX.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"lineY",{get:function(){return this._lineY.get()},set:function(u){u?(u.setElement(this.paper.add("path")),this._lineY.set(u,u.events.on("positionchanged",this.updateSelection,this,!1)),u.parent=this,u.interactionsEnabled=!1):this._lineY.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"selection",{get:function(){return this._selection},set:function(u){this._selection=u,u&&(u.element=this.paper.add("path"),u.parent=this)},enumerable:!0,configurable:!0}),R.prototype.processConfig=function(u){var w=this;if(u&&(Ee(u.xAxis)&&ct(u.xAxis)&&(this.map.hasKey(u.xAxis)?u.xAxis=this.map.getKey(u.xAxis):(this.processingErrors.push('[XYCursor] No axis with id "'+u.xAxis+'" found for `xAxis`'),delete u.xAxis)),Ee(u.yAxis)&&ct(u.yAxis)&&(this.map.hasKey(u.yAxis)?u.yAxis=this.map.getKey(u.yAxis):(this.processingErrors.push('[XYCursor] No axis with id "'+u.yAxis+'" found for `yAxis`'),delete u.yAxis)),Ee(u.snapToSeries))){var $=pt(u.snapToSeries)?u.snapToSeries:[u.snapToSeries],U=!1;mi($,function(K,ie){ct(K)&&(w.map.hasKey(K)?$[ie]=w.map.getKey(K):(w.processingErrors.push('[XYCursor] No series with id "'+K+'" found for `series`'),U=!0))}),U?delete u.snapToSeries:u.snapToSeries=$}j.prototype.processConfig.call(this,u)},Object.defineProperty(R.prototype,"snapToSeries",{get:function(){return this.getPropertyValue("snapToSeries")},set:function(u){var w=this;this.setPropertyValue("snapToSeries",u)&&(u instanceof NI&&(u=[u]),this._snapToDisposers&&mi(this._snapToDisposers,function($){$.dispose()}),this._snapToDisposers=[],u&&mi(u,function($){w._snapToDisposers.push($.events.on("tooltipshownat",function(){w.handleSnap($)},void 0,!1))}))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"snapOnPan",{get:function(){return this.getPropertyValue("snapOnPan")},set:function(u){this.setPropertyValue("snapOnPan",u)},enumerable:!0,configurable:!0}),R.prototype.handleSnap=function(u){if(!this.downPoint){var w=u.getTooltipX()+u.xAxis.pixelX,$=u.getTooltipY()+u.yAxis.pixelY,U=u.xAxis,K=u.yAxis;U&&U.renderer.opposite&&($-=this.pixelHeight),this.point={x:w,y:$},this.getPositions();var ie=w,ae=$;w-=this.pixelWidth,K&&K.renderer.opposite&&(w+=this.pixelWidth);var we=u.tooltip,Re=we.animationDuration,$e=we.animationEasing;U instanceof vo&&!(U instanceof nc)&&K instanceof vo&&!(K instanceof nc)?(u.yAxis.showTooltipAtPosition(this.yPosition),u.xAxis.showTooltipAtPosition(this.xPosition)):(u.baseAxis==u.xAxis&&u.yAxis.showTooltipAtPosition(this.yPosition),u.baseAxis==u.yAxis&&u.xAxis.showTooltipAtPosition(this.xPosition)),this.lineY.x=w,this.lineX.y=$,this.xAxis||this.lineX.animate([{property:"x",to:ie}],Re,$e),this.yAxis||this.lineY.animate([{property:"y",to:ae}],Re,$e)}},R.prototype.dispose=function(){this.hide(0),j.prototype.dispose.call(this)},R}(kie);ui.registeredClasses.XYCursor=Y4;var Tve=function(j){function R(){var u=j.call(this)||this;return u.className="RadarCursor",u.radius=he(100),u.innerRadius=he(0),u.applyTheme(),u.mask=void 0,u}return re(R,j),R.prototype.fitsToBounds=function(u){var w=C(u);return wthis.pixelInnerRadius-1},Object.defineProperty(R.prototype,"startAngle",{get:function(){return this.getPropertyValue("startAngle")},set:function(u){this.setPropertyValue("startAngle",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endAngle",{get:function(){return this.getPropertyValue("endAngle")},set:function(u){this.setPropertyValue("endAngle",u,!0)},enumerable:!0,configurable:!0}),R.prototype.triggerMoveReal=function(u,w){this.xAxis&&(!this.xAxis||this.xAxis.cursorTooltipEnabled&&!this.xAxis.tooltip.disabled)||this.updateLineX(this.point),this.yAxis&&(!this.yAxis||this.yAxis.cursorTooltipEnabled&&!this.yAxis.tooltip.disabled)||this.updateLineY(this.point),this.updateSelection(),j.prototype.triggerMoveReal.call(this,u,w)},R.prototype.updateLineX=function(u){var w=this.pixelRadius,$=this.startAngle,U=this.endAngle,K=this.pixelInnerRadius;if(w>0&&le($)&&le(U)&&le(K)){var ie=Jt(ue(u),$,U),ae=void 0;if(this.lineX&&this.lineX.visible){if(this.lineX.moveTo({x:0,y:0}),this.xAxis&&this.fullWidthLineX){var we=this.xAxis.currentItemStartPoint,Re=this.xAxis.currentItemEndPoint;if(we&&Re){var $e=Jt(ue(we),$,U),Xe=Jt(ue(Re),$,U)-$e;$0&&(Xe-=360),ae=ln({x:K*A(ie-=Xe/2),y:K*Ue(ie)})+br({x:w*A(ie),y:w*Ue(ie)})+Dd(ie,Xe,w)+br({x:K*A(ie+Xe),y:K*Ue(ie+Xe)})+Dd(ie+Xe,-Xe,K)}}ae||(ae=ln({x:K*A(ie),y:K*Ue(ie)})+br({x:w*A(ie),y:w*Ue(ie)})),this.lineX.path=ae}}},R.prototype.updateLineY=function(u){if(this.lineY&&this.lineY.visible){var w=this.startAngle,$=this.endAngle,U=this.truePixelRadius,K=gt(C(u),0,this.truePixelRadius);if(le(K)&&le(w)){this.lineY.moveTo({x:0,y:0});var ie=void 0,ae=$-w;if(this.yAxis&&this.fullWidthLineY){var we=this.yAxis.currentItemStartPoint,Re=this.yAxis.currentItemEndPoint;if(we&&Re){var $e=gt(C(we),0,U);ie=ln({x:(K=gt(C(Re),0,U))*A(w),y:K*Ue(w)})+Dd(w,ae,K),ie+=ln({x:$e*A($),y:$e*Ue($)})+Dd($,-ae,$e)}}ie||(ie=ln({x:K*A(w),y:K*Ue(w)})+Dd(w,$-w,K)),this.lineY.path=ie}}},R.prototype.updateSelection=function(){if(this._usesSelection){var u=this.downPoint;if(u){var w=this.point,$=this.pixelRadius,U=this.truePixelRadius,K=this.pixelInnerRadius,ie=Math.min(this.startAngle,this.endAngle),ae=Math.max(this.startAngle,this.endAngle),we=Jt(ue(u),ie,ae),Re=Jt(ue(w),ie,ae),$e=C(u);if($e`),G+=` +`,we=re.length,De=0;De`}return G+=` +`,Ve=this.adapter.apply("charset",{charset:"charset=utf-8",type:u,options:w}).charset,[2,this.adapter.apply("getHTML",{data:$?"data:"+this.getContentType(u)+";"+Ve+","+encodeURIComponent(G):G,options:w}).data]})})},R.prototype.getHTMLRow=function(u,w,$,G,K){var re=this;G===void 0&&(G=!1),K===void 0&&(K=!1);var ue=" ";w.rowClass&&(ue=' '),$||($=u);var we=this.adapter.apply("dataFieldsOrder",{dataFieldsOrder:this.dataFieldsOrder,format:"html"}).dataFieldsOrder,De=K?"th":"td",Ve=!0;return vr($,function(Ke,Qe){var ft=re.convertEmptyValue(Ke,u[Ke],w),Gt=G?ft:re.convertToSpecialFormat(Ke,ft,w);Gt=(Gt=""+Gt).replace(/[\u00A0-\u9999<>\&]/gim,function(di){return"&#"+di.charCodeAt(0)+";"});var ei=De;w.pivot&&Ve&&(ei="th"),w.cellClass?ue+=` + <`+ei+' class="'+w.cellClass+'">'+Gt+"":ue+=` + <`+ei+">"+Gt+"",Ve=!1},function(Ke,Qe){var ft=we.indexOf(Ke),Gt=we.indexOf(Qe);return ft>Gt?1:ft`},R.prototype.getJSON=function(u,w,$){return $===void 0&&($=!0),he(this,void 0,void 0,function(){var G,K,re,ue,we,De,Ve,Ke,Qe=this;return _e(this,function(ft){if(Te(w)||(w=this.getFormatOptions("json")),K=this.adapter.apply("formatDataFields",{dataFields:this.dataFields,format:"json"}).dataFields,this._dynamicDataFields)G=this.data;else for(G=[],re=this.data,ue=function(Gt,ei){var di=re[ei];if(typeof di=="object"){var ci={};yi(di,function(qi,rr){Te(K[qi])&&(ci[K[qi]]=Qe.convertToSpecialFormat(qi,rr,w))}),G.push(ci)}},we=re.length,De=0;De

'+this.language.translate('To save the image, right-click thumbnail on the left and choose "Save picture as..."')+'

'+this.language.translate("(Press ESC to close this message)")+"

",this.language.translate("Image Export Complete")):(di=void 0,w.match(/\.svg$/)?di="image/svg+xml":(di="text/plain",w+=".txt"),(ci=document.createElement("iframe")).width="1px",ci.height="1px",ci.style.display="none",document.body.appendChild(ci),(qi=ci.contentDocument).open(di,"replace"),qi.write(decodeURIComponent(ei[3])),qi.close(),qi.execCommand("SaveAs",!0,w),document.body.removeChild(ci))):window.location.href=u;return[2,!0]})})},R.prototype.downloadSupport=function(){return this.linkDownloadSupport()||this.msBlobDownloadSupport()},R.prototype.linkDownloadSupport=function(){var u=pi.getCache("linkDownloadSupport");if(u===!1||u===!0)return u;var w=document.createElement("a").download!==void 0;return pi.setCache("linkDownloadSupport",w),w},R.prototype.blobDownloadSupport=function(){return Te(window.Blob)},R.prototype.msBlobDownloadSupport=function(){return Te(window.navigator.msSaveOrOpenBlob)},R.prototype.legacyIE=function(){var u=document.createElement("div");return u.innerHTML="",u.getElementsByTagName("i").length==1},R.prototype.print=function(u,w,$){return he(this,void 0,void 0,function(){return _e(this,function(G){return w.printMethod=="css"?[2,this.printViaCSS(u,w,$)]:[2,this.printViaIframe(u,w,$)]})})},R.prototype.printViaCSS=function(u,w,$){return he(this,void 0,void 0,function(){var G,K,re,ue;return _e(this,function(we){return G=document.documentElement.scrollTop||document.body.scrollTop,K=new Ys($b(this.container),"body > *",{display:"none",position:"fixed",visibility:"hidden",opacity:"0",clipPath:"polygon(0px 0px,0px 0px,0px 0px,0px 0px);"}),$&&document&&document.title&&(re=document.title,document.title=$),(ue=new Image).src=u,ue.style.maxWidth="100%",ue.style.display="block",ue.style.position="relative",ue.style.visibility="visible",ue.style.opacity="1",ue.style.clipPath="none",document.body.appendChild(ue),this.setTimeout(function(){window.print()},50),/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&w.delay<1e3?w.delay=1e3:w.delay<100&&(w.delay=100),this.setTimeout(function(){document.body.removeChild(ue),K.dispose(),re&&(document.title=document.title),document.documentElement.scrollTop=document.body.scrollTop=G},w.delay||500),[2,!0]})})},R.prototype.printViaIframe=function(u,w,$){return he(this,void 0,void 0,function(){var G,K;return _e(this,function(re){return(G=document.createElement("iframe")).style.visibility="hidden",document.body.appendChild(G),G.contentWindow.document.open(),G.contentWindow.document.close(),(K=new Image).src=u,K.style.maxWidth="100%",K.style.height="auto",$&&(G.contentWindow.document.title=$),G.contentWindow.document.body.appendChild(K),G.load=function(){G.contentWindow.document.body.appendChild(K)},this.setTimeout(function(){try{G.contentWindow.document.execCommand("print",!1,null)||G.contentWindow.print()}catch{G.contentWindow.print()}},w.delay||50),/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&w.delay<1e3?w.delay=1e3:w.delay<100&&(w.delay=100),this.setTimeout(function(){document.body.removeChild(G)},w.delay+50||100),[2,!0]})})},R.prototype.findBackgroundColor=function(u){var w=1,$=E4(u,"background-color");if(($.match(/[^,]*,[^,]*,[^,]*,[ ]?0/)||$=="transparent")&&(w=0),w==0){var G=u.parentElement;return G?this.findBackgroundColor(G):He("#fff")}return He($,w)},Object.defineProperty(R.prototype,"container",{get:function(){return this.adapter.apply("container",{container:this._container}).container},set:function(u){this._container=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"sprite",{get:function(){return this.adapter.apply("sprite",{sprite:this._sprite}).sprite},set:function(u){this._sprite=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"extraSprites",{get:function(){return this.adapter.apply("extraSprites",{extraSprites:this._extraSprites}).extraSprites},set:function(u){this._extraSprites=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"validateSprites",{get:function(){return this.adapter.apply("validateSprites",{validateSprites:this._validateSprites}).validateSprites},set:function(u){this._validateSprites=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"data",{get:function(){return this.adapter.apply("data",{data:this._data}).data},set:function(u){this._data=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dataFields",{get:function(){return this._dataFields||this.generateDataFields(),this.adapter.apply("dataFields",{dataFields:this._dataFields}).dataFields},set:function(u){this._dataFields=u,this._dynamicDataFields=!1},enumerable:!0,configurable:!0}),R.prototype.handleDataUpdated=function(){this._dynamicDataFields&&(this._dataFields=void 0);var u=this.data.length>0;this._prevHasData!=u&&(this._prevHasData=u,this.menu&&this.menu.invalidate())},Object.defineProperty(R.prototype,"dateFormatter",{get:function(){return this._dateFormatter||(this._dateFormatter=new AI,this._dateFormatter.language=this.language),this.adapter.apply("dateFormatter",{dateFormatter:this._dateFormatter}).dateFormatter},set:function(u){this._dateFormatter=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dateFormat",{get:function(){return this.adapter.apply("dateFormat",{dateFormat:this._dateFormat}).dateFormat},set:function(u){this._dateFormat=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dateFields",{get:function(){return this._dateFields||(this._dateFields=new to),this.adapter.apply("dateFields",{dateFields:this._dateFields}).dateFields},set:function(u){this._dateFields=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"numberFormatter",{get:function(){return this._numberFormatter||(this._numberFormatter=new x3,this._numberFormatter.language=this.language),this.adapter.apply("numberFormatter",{numberFormatter:this._numberFormatter}).numberFormatter},set:function(u){this._numberFormatter=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"numberFormat",{get:function(){return this.adapter.apply("numberFormat",{numberFormat:this._numberFormat}).numberFormat},set:function(u){this._numberFormat=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"numberFields",{get:function(){return this._numberFields||(this._numberFields=new to),this.adapter.apply("numberFields",{numberFields:this._numberFields}).numberFields},set:function(u){this._numberFields=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"durationFormatter",{get:function(){return this._durationFormatter||(this._durationFormatter=new k4,this._durationFormatter.language=this.language),this.adapter.apply("durationFormatter",{durationFormatter:this._durationFormatter}).durationFormatter},set:function(u){this._durationFormatter=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"durationFormat",{get:function(){return this.adapter.apply("durationFormat",{durationFormat:this._durationFormat}).durationFormat},set:function(u){this._durationFormat=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"durationFields",{get:function(){return this._durationFields||(this._durationFields=new to),this.adapter.apply("durationFields",{durationFields:this._durationFields}).durationFields},set:function(u){this._durationFields=u},enumerable:!0,configurable:!0}),R.prototype.generateDataFields=function(){var u=this;this._dataFields={},this.data.length&&wi(this.data,function(w){yi(w,function($,G){Te(u._dataFields[$])||(u._dataFields[$]=u.adapter.apply("dataFieldName",{name:$,field:$}).name)})})},R.prototype.isDateField=function(u){return this.adapter.apply("isDateField",{isDateField:this.dateFields.contains(u),field:u}).isDateField},R.prototype.isNumberField=function(u){return this.adapter.apply("isNumberField",{isNumberField:this.numberFields.contains(u),field:u}).isNumberField},R.prototype.isDurationField=function(u){return this.adapter.apply("isDurationField",{isDurationField:this.durationFields.contains(u),field:u}).isDurationField},R.prototype.getContentType=function(u){var w="";switch(u){case"png":case"gif":w="image/"+u;break;case"jpg":w="image/jpeg";break;case"svg":w="image/svg+xml";break;case"csv":w="text/csv";break;case"json":w="application/json";break;case"html":w="text/html";break;case"pdf":case"pdfdata":w="application/pdf";break;case"xlsx":w="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}return this.adapter.apply("contentType",{contentType:w,type:u}).contentType},Object.defineProperty(R.prototype,"filePrefix",{get:function(){return this.adapter.apply("filePrefix",{filePrefix:this._filePrefix}).filePrefix},set:function(u){this._filePrefix=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"backgroundColor",{get:function(){return this.adapter.apply("backgroundColor",{backgroundColor:this._backgroundColor}).backgroundColor},set:function(u){this._backgroundColor=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"title",{get:function(){return this.adapter.apply("title",{title:this._title}).title},set:function(u){this._title=u},enumerable:!0,configurable:!0}),R.prototype.showPreloader=function(){var u=this.preloader;u&&(u.progress=.5,u.label.text="...")},R.prototype.hidePreloader=function(){var u=this.preloader;u&&(u.progress=1)},Object.defineProperty(R.prototype,"preloader",{get:function(){return this._sprite&&this._sprite.parent&&this._sprite.parent.preloader?this._sprite.parent.preloader:void 0},enumerable:!0,configurable:!0}),R.prototype.showTimeout=function(){this.showModal(this.adapter.apply("timeoutMessage",{message:this.language.translate("Export operation took longer than expected. Something might have gone wrong.")}).message)},R.prototype.hideTimeout=function(){this._timeoutTimeout&&(this.removeDispose(this._timeoutTimeout),this._timeoutTimeout=null),this.hideModal()},Object.defineProperty(R.prototype,"language",{get:function(){return this._language||(this._language=new w1),this._language},set:function(u){this._language=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"modal",{get:function(){return this._modal||(this._modal=new W$,this._modal.adapter.add("classPrefix",function(u){return rp.classNamePrefix+u})),this._modal},enumerable:!0,configurable:!0}),R.prototype.showModal=function(u,w){this.hideModal(),this.hidePreloader();var $=this.modal;$.container=this.sprite.svgContainer.SVGContainer,$.content=u,$.readerTitle=w,$.open()},R.prototype.hideModal=function(){this._modal&&this.modal.close()},R.prototype._canvg=function(){return he(this,void 0,void 0,function(){var u;return _e(this,function(w){switch(w.label){case 0:return[4,o.e(265).then(o.bind(o,1234))];case 1:return(u=w.sent()).default!=null?[2,u.default]:[2,u]}})})},Object.defineProperty(R.prototype,"canvg",{get:function(){return this._canvg()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pdfmake",{get:function(){return Nx==null&&(Nx=function(){return he(this,void 0,void 0,function(){var u,w,$,G;return _e(this,function(K){switch(K.label){case 0:return[4,Promise.all([o.e(643).then(o.t.bind(o,6727,23)),o.e(643).then(o.bind(o,4995))])];case 1:return u=K.sent(),w=u[0],$=u[1],(G=window).pdfMake=G.pdfMake||{},G.pdfMake.vfs=$.default,w.vfs=$.default,[2,w]}})})}()),Nx},enumerable:!0,configurable:!0}),R.prototype._xlsx=function(){return he(this,void 0,void 0,function(){return _e(this,function(u){switch(u.label){case 0:return[4,Promise.all([o.e(739),o.e(297)]).then(o.t.bind(o,7739,23))];case 1:return[2,u.sent()]}})})},Object.defineProperty(R.prototype,"xlsx",{get:function(){return this._xlsx()},enumerable:!0,configurable:!0}),R.prototype.setFormatOptions=function(u,w){this._formatOptions.setKey(u,w)},R.prototype.getFormatOptions=function(u){return this._formatOptions.getKey(u)},Object.defineProperty(R.prototype,"formatOptions",{get:function(){return this._formatOptions},enumerable:!0,configurable:!0}),R.prototype._disablePointers=function(){Te(this._spriteInteractionsEnabled)||(this._spriteInteractionsEnabled=this.sprite.interactionsEnabled),this.sprite.interactionsEnabled=!1},R.prototype._releasePointers=function(){Te(this._spriteInteractionsEnabled)&&!this._exportRunning&&(this.sprite.interactionsEnabled=this._spriteInteractionsEnabled)},R.prototype.hideNonExportableSprites=function(){var u=this;if(!this._objectsAlreadyHidden){var w=this.sprite.svgContainer;w&&wi(w.nonExportableSprites,function($){$.isHidden||$.isHiding||!$.visible||u._hiddenObjects.push($),$.hide(0)}),this._objectsAlreadyHidden=!0}},R.prototype.restoreNonExportableSprites=function(){this._objectsAlreadyHidden&&(wi(this._hiddenObjects,function(u){u.show(0)}),this._hiddenObjects=[],this._objectsAlreadyHidden=!1)},R.prototype.awaitValidSprites=function(){return he(this,void 0,void 0,function(){var u;return _e(this,function(w){switch(w.label){case 0:return u=[],this.validateSprites.length&&wi(this.validateSprites,function($,G){$.invalid&&u.push(new Promise(function(K,re){$.events.once("validated",function(ue){K()})}))}),u.length?[4,Promise.all(u)]:[3,2];case 1:w.sent(),w.label=2;case 2:return[2]}})})},R.prototype.processConfig=function(u){pi.registeredClasses.ExportMenu=Ht,u&&(Te(u.menu)&&!Te(u.menu.type)&&(u.menu.type="ExportMenu"),Te(u.dataFields)&&ht(u.dataFields)&&(this.dataFields=u.dataFields,delete u.dataFields)),U.prototype.processConfig.call(this,u)},R.XLINK="http://www.w3.org/1999/xlink",R}(St),wc=["fill","fillOpacity","stroke","strokeOpacity","strokeWidth","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin"],yo=function(U){function R(){var u=U.call(this)||this;return u.properties={},u._eventDispatcher=new rz(u),u._bindings={},u._isTemplate=!1,u._isPath=!1,u._inited=!1,u._ready=!1,u.isHiding=!1,u._isHidden=!1,u.isShowing=!1,u.isStandaloneInstance=!1,u._isActive=!1,u._mask=new Kn,u._positionPrecision=3,u._language=new Kn,u._exporting=new Kn,u._exportable=!0,u._bbox={x:0,y:0,width:0,height:0},u.invalid=!1,u.positionInvalid=!1,u.propertyFields={},u.applyOnClones=!1,u._measuredWidthSelf=0,u._measuredHeightSelf=0,u.maxLeft=0,u.maxRight=0,u.maxTop=0,u.maxBottom=0,u.maxLeftSelf=0,u.maxRightSelf=0,u.maxTopSelf=0,u.maxBottomSelf=0,u._isDragged=!1,u._isResized=!1,u._disabled=!1,u._internalDisabled=!1,u._updateDisabled=!1,u._internalDefaultsApplied=!1,u.rollOutDelay=0,u.isBaseSprite=!1,u.shouldClone=!0,u.appeared=!1,u.ex=0,u.ey=0,u.dragWhileResize=!1,u.measureFailed=!1,u.preventShow=!1,u.cloneTooltip=!0,u.className="Sprite",u._disposers.push(u._eventDispatcher),u.uid,u.group=u.paper.addGroup("g"),u.setPropertyValue("scale",1),u.setPropertyValue("rotation",0),u.setPropertyValue("align","none"),u.setPropertyValue("valign","none"),u.setPropertyValue("pixelPerfect",!1),u.setPropertyValue("visible",!0),u.setPropertyValue("tooltipPosition","fixed"),u.setPropertyValue("verticalCenter","none"),u.setPropertyValue("horizontalCenter","none"),u.setPropertyValue("tooltipX",de(50)),u.setPropertyValue("tooltipX",de(50)),u.setPropertyValue("marginTop",0),u.setPropertyValue("marginBottom",0),u.setPropertyValue("marginLeft",0),u.setPropertyValue("marginRight",0),u.setPropertyValue("dx",0),u.setPropertyValue("dy",0),u.setPropertyValue("paddingTop",0),u.setPropertyValue("paddingBottom",0),u.setPropertyValue("paddingRight",0),u.setPropertyValue("paddingLeft",0),u.setPropertyValue("togglable",!1),u.setPropertyValue("hidden",!1),u.setPropertyValue("urlTarget","_self"),u.setPropertyValue("alwaysShowTooltip",!1),u.setPropertyValue("showTooltipOn","hover"),u._prevMeasuredWidth=0,u._prevMeasuredHeight=0,u._measuredWidth=0,u._measuredHeight=0,u._isMeasured=!0,u.invalidate(),u.applyTheme(),u._disposers.push(u.events),u._disposers.push(u.group),u._disposers.push(u._mask),u._disposers.push(u._language),u._disposers.push(u._exporting),u._disposers.push(new Kr(function(){yi(u._bindings,function(w,$){$.dispose()})})),u.setPropertyValue("interactionsEnabled",!0),u}return ie(R,U),Object.defineProperty(R.prototype,"events",{get:function(){return this._eventDispatcher},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"adapter",{get:function(){return this._adapterO||(this._adapterO=new uc(this)),this._adapterO},enumerable:!0,configurable:!0}),R.prototype.applyTheme=function(){U.prototype.applyTheme.call(this)},R.prototype.getCurrentThemes=function(){var u=this._themes;if(u)return u;var w=this._parent;return w?w.getCurrentThemes():pi.themes},R.prototype.applyInternalDefaults=function(){this._internalDefaultsApplied=!0},R.prototype.invalidate=function(){this.disabled||this._isTemplate||this.__disabled||this.invalid||(this.invalid=!0,pi.addToInvalidSprites(this),ca.requestFrame())},R.prototype.validate=function(){this.dispatchImmediately("beforevalidated"),this._internalDefaultsApplied||this.applyInternalDefaults(),this.beforeDraw(),this.draw(),this.invalid=!1,pi.removeFromInvalidSprites(this),this.afterDraw()},R.prototype.invalidatePosition=function(){this.disabled||this._isTemplate||this.positionInvalid||(this.positionInvalid=!0,pi.addToInvalidPositions(this),ca.requestFrame())},R.prototype.validatePosition=function(){var u=this.pixelX,w=this.pixelY,$=this.dx,G=this.dy,K=u+$,re=w+G;this._updateDisabled&&(this._internalDisabled?this.group.attr({display:"none"}):this.disabled||this.removeSVGAttribute("display"),this._updateDisabled=!1);var ue=this.measure(),we=this.group.transformString;this.group.moveTo({x:K,y:re}),this.group.rotation=this.rotation,this.nonScaling?this.group.scale=this.scale/this.globalScale:this.group.scale=this.scale,(we!=this.group.transformString||ue)&&(we==null?this.dispatch("transformed"):this.dispatchImmediately("transformed"),this.dispatch("positionchanged"),this.showTooltipOn!="hit"&&this.showTooltipOn!="always"||this.updateTooltipPosition()),u+$==K&&w+G==re&&(pi.removeFromInvalidPositions(this),this.positionInvalid=!1);var De=this._maskRectangle;De&&this._clipElement.moveTo({x:De.x-u,y:De.y-w})},R.prototype.beforeDraw=function(){},R.prototype.draw=function(){},R.prototype.afterDraw=function(){var u,w;if((this.isMeasured||this.horizontalCenter!=="none"||this.verticalCenter!=="none")&&this.measureElement(),this._inited)this.dispatch("validated");else{if(this._adapterO)try{for(var $=xe(this._adapterO.keys()),G=$.next();!G.done;G=$.next()){var K=G.value;switch(K){case"mask":case"fill":case"opacity":case"fillOpacity":case"stroke":case"strokeOpacity":case"strokeWidth":case"shapeRendering":case"strokeDasharray":case"strokeDashoffset":case"strokeLinecap":case"strokeLinejoin":case"textDecoration":case"fontSize":case"fontFamily":case"fontWeight":this[K]=this[K]}}}catch(re){u={error:re}}finally{try{G&&!G.done&&(w=$.return)&&w.call($)}finally{if(u)throw u.error}}this.applyFilters(),this.visible=this.visible,this.interactionsEnabled=this.getPropertyValue("interactionsEnabled"),this._inited=!0,this.showOnInit||(this.appeared=!0),this.hidden&&this.hide(0),this.applyMask(),this.dispatch("validated"),this.dispatch("inited"),this.dispatchReady()}this.showTooltipOn=="always"&&(!this.visible||this.disabled||this.__disabled?this.hideTooltip(0):this.showTooltip())},R.prototype.dispatchReady=function(){this.isReady()||(this._ready=!0,this.dispatch("ready"))},R.prototype.reinit=function(){this._inited=!1,this.setState(this.defaultState),this.invalidate()},R.prototype.handleGlobalScale=function(){this.dispatch("globalscalechanged"),this.nonScalingStroke&&(this.strokeWidth=this.strokeWidth),this.nonScaling&&this.validatePosition(),this.updateFilterScale()},R.prototype.updateFilterScale=function(){var u=this;ar(this.filters.iterator(),function(w){w.scale=u.globalScale})},R.prototype.removeFromInvalids=function(){pi.removeFromInvalidSprites(this),pi.removeFromInvalidPositions(this)},R.prototype.copyFrom=function(u){var w=this;U.prototype.copyFrom.call(this,u),this.isMeasured=u.isMeasured,this.states.copyFrom(u.states),u.filters.length>0&&u.filters.each(function($){w.filters.push($.clone())}),u._adapterO&&this.adapter.copyFrom(u._adapterO),u._interaction&&this.interactions.copyFrom(u.interactions),u._plugins&&this.plugins.copyFrom(u.plugins),this.configField=u.configField,this.applyOnClones=u.applyOnClones,this.disabled=u.disabled,this.virtualParent=u.virtualParent,this.exportable=u.exportable,u._tooltip&&(this._tooltip?this._tooltip.copyFrom(u.tooltip):u.cloneTooltip?this.tooltip=u.tooltip.clone():this._tooltip=u.tooltip),this._showSystemTooltip=u.showSystemTooltip,pn(u.propertyFields,this.propertyFields),pn(u.properties,this),u.fillModifier&&(this.fillModifier=u.fillModifier.clone()),u.strokeModifier&&(this.strokeModifier=u.strokeModifier.clone()),u.focusFilter&&(this.focusFilter=u.focusFilter.clone())},R.prototype.dispose=function(){if(!this.isDisposed()){if(this.showTooltipOn=="always"&&this.tooltip&&this.tooltip.hide(),this.dispatchImmediately("beforedisposed"),this.isBaseSprite){if(this.htmlContainer)for(;this.htmlContainer.childNodes.length>0;)this.htmlContainer.removeChild(this.htmlContainer.firstChild);this.isBaseSprite=!1}if(U.prototype.dispose.call(this),this._adapterO&&this._adapterO.clear(),this.applyOnClones&&this._clones)for(var u=this._clones.length-1;u>=0;u--)this._clones.getIndex(u).dispose();this._svgContainer&&this._svgContainer.dispose(),this._interactionDisposer&&(this._interactionDisposer.dispose(),this._interactionDisposer=void 0),this._urlDisposer&&this._urlDisposer.dispose(),this.removeFromInvalids(),this.element&&this.element.dispose(),this.group&&this.group.dispose(),this._numberFormatter&&this._numberFormatter.dispose(),this._focusFilter&&this._focusFilter.dispose();var w=this.stroke;!w||w instanceof Ee||!w.dispose||this.clonedFrom&&this.clonedFrom.stroke==w||w.dispose();var $=this.fill;if(!$||$ instanceof Ee||!$.dispose||this.clonedFrom&&this.clonedFrom.fill==$||$.dispose(),Te(this.id)&&this.map.removeKey(this.id),this.parent=void 0,this._filters)for(;this._filters.length>0;){var G=this._filters.getIndex(0);G.dispose(),this._filters.removeValue(G)}this._alwaysShowDisposers=void 0}},Object.defineProperty(R.prototype,"isTemplate",{get:function(){return this._isTemplate},set:function(u){u=Ct(u),this._isTemplate!=u&&(this._isTemplate=u,this instanceof cs&&ar(this.children.iterator(),function(w){w.isTemplate=u}),u?(this.parent=this._parent,this.removeFromInvalids()):this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"showSystemTooltip",{get:function(){return Te(this._showSystemTooltip)?this._showSystemTooltip:this.virtualParent?this.virtualParent.showSystemTooltip:!!this._parent&&this._parent.showSystemTooltip},set:function(u){u=Ct(u),this._showSystemTooltip!=u&&(this._showSystemTooltip=u,this.applyAccessibility())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"topParent",{get:function(){return this._topParent?this._topParent:this._parent?this._parent.topParent:void 0},set:function(u){this._topParent=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"parent",{get:function(){return this._parent},set:function(u){if(!this._isTemplate){this.paper;var w=this._parent;w!=u&&(w&&w.children.removeValue(this),this._parent=u,u?(this.topParent=u.topParent,u.isTemplate&&(this.isTemplate=!0),this.baseId=u.baseId,u.children.push(this),this._tooltip&&!this._tooltipContainer&&(this._tooltip.parent=u.tooltipContainer),this._dataItem||(this.dataItem=u.dataItem),this.handleAlwaysShowTooltip(),this.dataItem&&this.applyAccessibility(),this.dispatchImmediately("parentset")):this.topParent=void 0)}},enumerable:!0,configurable:!0}),R.prototype.handleAlwaysShow=function(){this.showTooltip()},R.prototype.handleAlwaysShowTooltip=function(){var u=this,w=this._alwaysShowDisposers;if(w&&wi(w,function(G){G.dispose()}),this._alwaysShowDisposers=[],this.showTooltipOn=="always")for(;u!=null;){var $=u.events.on("visibilitychanged",this.handleAlwaysShow,this,!1);this.addDisposer($),this._alwaysShowDisposers.push($),u=u.parent}},Object.defineProperty(R.prototype,"virtualParent",{get:function(){return this._virtualParent},set:function(u){this._virtualParent=u,this.dataItem&&this.applyAccessibility()},enumerable:!0,configurable:!0}),R.prototype.appendDefs=function(){this.filterElement&&this.paper.appendDef(this.filterElement);var u=this.fill;u&&u.element&&this.paper.appendDef(u.element);var w=this.stroke;if(w&&w.element&&this.paper.appendDef(w.element),this.fillModifier&&this.fill instanceof Ee){var $=this.fillModifier.modify(this.fill);$&&$.element&&this.paper.appendDef($.element)}if(this.strokeModifier&&this.stroke instanceof Ee){var G=this.strokeModifier.modify(this.stroke);G&&G.element&&this.paper.appendDef(G.element)}this._clipPath&&this.paper.appendDef(this._clipPath),this._exportable===!1&&(this.exportable=!1)},Object.defineProperty(R.prototype,"map",{get:function(){var u=this.topParent;return u?u.map:(this._map||(this._map=new Ea),this._map)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"delayedMap",{get:function(){var u=this.topParent;return u?u.delayedMap:(this._delayedMap||(this._delayedMap=new Ea),this._delayedMap)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"id",{get:function(){return this._id},set:function(u){if(this._id!=u){if(this._id=u,this.map.hasKey(u))throw Error("Duplicate id ("+u+") used on multiple objects.");this.map.setKey(u,this)}},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dom",{get:function(){return this.group.node},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"paper",{get:function(){if(this._paper)return this._paper;var u=this._parent;return u?u.paper:Lx()},set:function(u){this.setPaper(u)},enumerable:!0,configurable:!0}),R.prototype.setPaper=function(u){return this._paper!=u&&(this._paper=u,this.appendDefs(),!0)},Object.defineProperty(R.prototype,"htmlContainer",{get:function(){if(this._htmlContainer)return this._htmlContainer;var u=this._parent;return u?u.htmlContainer:void 0},set:function(u){this._htmlContainer=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"titleElement",{get:function(){return this._titleElement||(this._titleElement=this.paper.add("title"),this.group.add(this._titleElement)),this._titleElement},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"descriptionElement",{get:function(){return this._descriptionElement||(this._descriptionElement=this.paper.add("desc"),this.group.add(this._descriptionElement)),this._descriptionElement},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"filters",{get:function(){return this._filters||(this._filters=new to,this._disposers.push(this._filters.events.onAll(this.applyFilters,this)),this._disposers.push(new ua(this._filters))),this._filters},enumerable:!0,configurable:!0}),R.prototype.setSVGAttributes=function(){this.fill=this.fill,this.opacity=this.opacity,this.fillOpacity=this.fillOpacity,this.stroke=this.stroke,this.strokeOpacity=this.strokeOpacity,this.shapeRendering=this.shapeRendering,this.strokeDasharray=this.strokeDasharray,this.strokeDashoffset=this.strokeDashoffset,this.strokeLinecap=this.strokeLinecap,this.strokeLinejoin=this.strokeLinejoin,this.focusable=this.focusable,this.tabindex=this.tabindex,this.role=this.role},R.prototype.setSVGAttribute=function(u){this.group.attr(u)},R.prototype.removeSVGAttribute=function(u){this.group.removeAttr(u)},R.prototype.setClassName=function(){var u=this.className,w=rp.classNamePrefix;this.element&&this.element.addClass(w+u),this.group.addClass(w+u+"-group"),Te(this.id)&&this.group.addClass(w+this.id),this.userClassName&&this.group.addClass(this.userClassName)},R.prototype.uidAttr=function(){return this.setSVGAttribute({id:this.uid}),this.uid},R.prototype.updateClipPath=function(){var u=this._clipElement;u&&u.moveTo({x:this.mask.pixelX,y:this.mask.pixelY})},R.prototype.createClipPath=function(){if(!this._clipPath){this._clipPath=this.paper.addGroup("clipPath"),this.paper.appendDef(this._clipPath),this._disposers.push(this._clipPath);var u=pi.getUniqueId();this._clipPath.attr({id:u}),this.group.attr({"clip-path":'url("'+Hs()+u+'")'})}},R.prototype.applyMask=function(){var u=this.mask;if(this._clipPath&&u)if(u instanceof cs){this._clipElement.attr({width:ye(0,u.pixelWidth),height:ye(0,u.pixelHeight)});var w=Ip({x:u.pixelX,y:u.pixelY},u.parent,this);this._clipPath.x=w.x,this._clipPath.y=w.y}else u.element&&u.element!=this._clipElement&&(this._clipElement=u.element,this._clipPath.add(this._clipElement)),this._clipPath.scale=u.scale,this._clipPath.x=u.pixelX,this._clipPath.y=u.pixelY,this._clipPath.rotation=u.rotation},R.prototype.applyFilters=function(){var u=this;if(this._filters&&this._filters.length>0){var w=100,$=100;this.filterElement?this.filterElement.removeChildNodes():(this.filterElement=this.paper.addGroup("filter"),this._disposers.push(this.filterElement)),this.paper.appendDef(this.filterElement);var G="filter-"+this.uid;this.filterElement.attr({id:G}),ar(this.filters.iterator(),function(ue){ue.sprite=u,ue.paper=u.paper,u.filterElement.attr({filterUnits:ue.filterUnits}),ue.appendPrimitives(u.filterElement),ue.width>w&&(w=ue.width),ue.height>$&&($=ue.height),ue.scale=u.globalScale});var K=w+"%",re=$+"%";this.filterElement.attr({width:K,height:re,x:-(w-100)/2+"%",y:-($-100)/2+"%"}),this.group.attr({filter:'url("'+Hs()+G+'")'})}else this.filterElement&&(this.group.removeAttr("filter"),this.filterElement.removeChildNodes())},R.prototype.removeClipPath=function(){this._clipPath&&(this.removeDispose(this._clipPath),this._clipPath=void 0)},R.prototype.setElement=function(u){this.element=u,this.setSVGAttributes(),this.applyAccessibility()},Object.defineProperty(R.prototype,"element",{get:function(){return this._element},set:function(u){this.removeElement(),this._element=u,this.group.add(u),u.node instanceof SVGPathElement&&(this._isPath=!0),this.invalid||this.validate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"svgContainer",{get:function(){return this._svgContainer?this._svgContainer:this._parent?this._parent.svgContainer:void 0},set:function(u){this._svgContainer=u},enumerable:!0,configurable:!0}),R.prototype.measureElement=function(){if(this.element)if(this.definedBBox)this._bbox=this.definedBBox;else{var u=this.element.getBBox();this._bbox={x:u.x,y:u.y,width:u.width,height:u.height}}},R.prototype.updateCenter=function(){if(this.element){var u=this.element.transformString,w=this.bbox,$=0,G=0,K=w.x,re=w.y,ue=w.width,we=w.height,De=this.pixelPaddingLeft,Ve=this.pixelPaddingRight,Ke=this.pixelPaddingTop,Qe=this.pixelPaddingBottom,ft=ye(ue+De+Ve,this.pixelWidth),Gt=ye(we+Ke+Qe,this.pixelHeight),ei=w.x,di=w.x+ft,ci=w.y,qi=w.y+Gt,rr=this.horizontalCenter,Ii=this.verticalCenter;switch(rr){case"none":$=K+De;break;case"left":$=De;break;case"middle":$=De-(ue+Ve+De)/2;break;case"right":$=-Ve-ue}switch(Ii){case"none":G=re+Ke;break;case"top":G=Ke;break;case"middle":G=Ke-(we+Qe+Ke)/2;break;case"bottom":G=-Qe-we}this._measuredHeight=Gt,this._measuredWidth=ft;var Ki=ze($-K,this._positionPrecision,!0),pr=ze(G-re,this._positionPrecision,!0);this.ex=Ki-De,this.ey=pr-Ke,this.maxLeft=ei+Ki-De,this.maxRight=di+Ki-De,this.maxTop=ci+pr-Ke,this.maxBottom=qi+pr-Ke,this.pixelPerfect&&rp.pixelPerfectPrecision==0&&(Ki-=.5,pr-=.5),this.element.moveTo({x:Ki,y:pr}),u!=this.element.transformString&&this.dispatchImmediately("transformed")}},R.prototype.measure=function(){this.updateCenter();var u=this._measuredWidth,w=this._measuredHeight,$=this.maxLeft,G=this.maxRight,K=this.maxTop,re=this.maxBottom;this._measuredWidthSelf=u,this._measuredHeightSelf=w;var ue=this._positionPrecision;if(this.maxLeftSelf=this.maxLeft,this.maxRightSelf=this.maxRight,this.maxTopSelf=this.maxTop,this.maxBottomSelf=this.maxBottom,this.rotation!==0||this.scale!==1||this.nonScaling){this.nonScalingStroke&&(this.strokeWidth=this.strokeWidth);var we=this.paper.svg,De=we.createSVGMatrix(),Ve=this.rotation,Ke=this.scale;this.nonScaling&&(Ke=this.scale/this.globalScale),De.a=A(Ve)*Ke,De.c=-$e(Ve)*Ke,De.e=0,De.b=$e(Ve)*Ke,De.d=A(Ve)*Ke,De.f=0;var Qe=we.createSVGPoint();Qe.x=$,Qe.y=K;var ft=we.createSVGPoint();ft.x=G,ft.y=K;var Gt=we.createSVGPoint();Gt.x=G,Gt.y=re;var ei=we.createSVGPoint();ei.x=$,ei.y=re;var di=Qe.matrixTransform(De),ci=ft.matrixTransform(De),qi=Gt.matrixTransform(De),rr=ei.matrixTransform(De);$=Math.min(di.x,ci.x,qi.x,rr.x),G=Math.max(di.x,ci.x,qi.x,rr.x),K=Math.min(di.y,ci.y,qi.y,rr.y),u=G-$,w=(re=Math.max(di.y,ci.y,qi.y,rr.y))-K,this.maxLeft=ze($,ue,!0),this.maxRight=ze(G,ue,!0),this.maxTop=ze(K,ue,!0),this.maxBottom=ze(re,ue,!0)}return this._measuredWidth=ze(u,ue,!0),this._measuredHeight=ze(w,ue,!0),(this._measuredWidth!=this._prevMeasuredWidth||this._measuredHeight!=this._prevMeasuredHeight)&&(this._prevMeasuredHeight=this._measuredHeight,this._prevMeasuredWidth=this._measuredWidth,this.dispatch("sizechanged"),(this.isHover||this.showTooltipOn=="hit"||this.showTooltipOn=="always")&&this.tooltip&&this.tooltip.visible&&(Te(this.tooltipText)||Te(this.tooltipHTML))&&this.updateTooltipPosition(),!0)},R.prototype.insertBefore=function(u){var w=this._parent;if(w){var $=w.children.indexOf(u);$!==-1&&(w.children.moveValue(this,$),w.sortChildren())}return this},R.prototype.insertAfter=function(u){var w=this._parent;if(w){var $=w.children.indexOf(u);$!==-1&&(w.children.moveValue(this,$+1),w.sortChildren())}return this},R.prototype.removeElement=function(){this._element&&(this.removeDispose(this._element),this._element=void 0)},R.prototype.getRelativeX=function(u){return u instanceof J?u.value:this._parent?u/this._parent.innerWidth:0},R.prototype.getRelativeY=function(u){return u instanceof J?u.value:this._parent?u/this._parent.innerHeight:0},R.prototype.getPixelX=function(u){var w=0;if(ae(u))w=u;else if(u instanceof J){var $=u.value;this._parent&&(w=ze(this._parent.innerWidth*$,this._positionPrecision,!0))}return w},R.prototype.getPixelY=function(u){var w=0;if(ae(u))w=u;else if(u instanceof J){var $=u.value;this._parent&&(w=ze(this._parent.innerHeight*$,this._positionPrecision,!0))}return w},R.prototype.moveTo=function(u,w,$,G){this.isDragged&&!G||(u&&(ae(u.x)&&this.setPropertyValue("x",ze(u.x,this._positionPrecision,!0)),ae(u.y)&&this.setPropertyValue("y",ze(u.y,this._positionPrecision,!0))),ae(w)&&(this.rotation=w),ae($)&&(this.scale=$),this.invalidatePosition())},Object.defineProperty(R.prototype,"mask",{get:function(){return this._adapterO?this._adapterO.apply("mask",this._mask.get()):this._mask.get()},set:function(u){var w=this;this._mask.get()!==u&&(u?(this.createClipPath(),u instanceof cs?this._clipElement=this.paper.add("rect"):(u.isMeasured=!1,u.element&&(this._clipElement=u.element)),this._clipElement&&this._clipPath.add(this._clipElement),this._mask.set(u,new jn([u.events.on("maxsizechanged",function(){w.inited&&w.applyMask()},void 0,!1),u.events.on("validated",this.applyMask,this,!1),u.events.on("positionchanged",this.applyMask,this,!1)])),this.applyMask()):(this._mask.reset(),this.group.removeAttr("clip-path"),this.removeClipPath()))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maskRectangle",{get:function(){return this._maskRectangle},set:function(u){u?(this.createClipPath(),this._clipElement||(this._clipElement=this.paper.add("rect"),this._clipPath.add(this._clipElement)),this._clipElement.attr({width:u.width,height:u.height})):(this.removeClipPath(),this._clipElement=void 0),this._maskRectangle=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"isMeasured",{get:function(){return this._isMeasured},set:function(u){(u=Ct(u))||(this._measuredWidth=0,this._measuredHeight=0),this._isMeasured!=u&&(this._isMeasured=u,this.invalidatePosition())},enumerable:!0,configurable:!0}),R.prototype.hitTest=function(u){this.invalid&&this.validate(),u.invalid&&u.validate();var w=this.pixelX+this.maxLeft,$=this.pixelY+this.maxTop,G=w+this.maxRight,K=$+this.maxBottom,re=u.pixelX+u.maxLeft,ue=u.pixelY+u.maxTop,we=re+u.maxRight,De=ue+u.maxBottom;return!(re>G||weK||De<$)},Object.defineProperty(R.prototype,"inited",{get:function(){return this._inited},enumerable:!0,configurable:!0}),R.prototype.isReady=function(){return this._ready},Object.defineProperty(R.prototype,"states",{get:function(){if(!this._states){var u=new Qr;this._states=new ym(u),this._disposers.push(this._states.events.on("insertKey",this.processState,this,!1)),this._disposers.push(this._states.events.on("setKey",this.processState,this,!1)),this._disposers.push(new ep(this._states)),this._disposers.push(u)}return this._states},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"hiddenState",{get:function(){if(!this.states.getKey("hidden")){var u=this.states.create("hidden");u.properties.opacity=0,u.properties.visible=!1}return this.states.getKey("hidden")},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"defaultState",{get:function(){return this.states.getKey("default")||(this.states.create("default").properties.opacity=1),this.states.getKey("default")},enumerable:!0,configurable:!0}),R.prototype.processState=function(u){var w=u.newValue;if(w.sprite=this,w.name=u.key,(this.states.hasKey("hover")||this.showTooltipOn=="hover"&&(Te(this.tooltipHTML)||Te(this.tooltipText)))&&(this.hoverable=!0),(this.states.hasKey("down")||this.showTooltipOn=="hover"&&(Te(this.tooltipHTML)||Te(this.tooltipText)))&&(this.clickable=!0),this.states.hasKey("focus")&&(this.focusable=!0),this.applyOnClones)for(var $=this.clones.values,G=$.length,K=0;K0&&((G=this.animate(re,w,$))&&!G.isFinished()?this._disposers.push(G.events.on("animationended",function(){K.dispatchImmediately("transitionended")})):this.dispatchImmediately("transitionended")),u.filters.length>0){var ue=[];ar(u.filters.iterator(),function(we){var De=we.clone();ue.push(De);var Ve=[];ar(K.filters.iterator(),function(Ke){Ke.className==De.className&&(fh(K.defaultState.filters.iterator(),function(Qe){return Qe.className===De.className})||K.defaultState.filters.push(Ke),yi(De.properties,function(Qe,ft){var Gt=Ke.properties[Qe];Gt!=ft&&Ve.push({property:Qe,from:Gt,to:ft})}))}),De.animate(Ve,w,$)}),this.filters.clear(),this.filters.pushAll(ue)}return G},R.prototype.isInTransition=function(){return this.animations.length>0},Object.defineProperty(R.prototype,"isHover",{get:function(){return!!this.isInteractive()&&this.interactions.isHover},set:function(u){(u=Ct(u))!==this.isHover&&this.isInteractive()&&(this.interactions.isHover=u,u?this.handleOver():(this.interactions.isRealHover=!1,this.handleOut()))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"isDragged",{get:function(){return this._isDragged},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"isResized",{get:function(){return this._isResized},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"isDown",{get:function(){return!!this.isInteractive()&&this.interactions.isDown},set:function(u){u=Ct(u),this.isInteractive()&&this.isDown!=u&&(this.interactions.isDown=u,u?this.handleDown():this.handleUp())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"isFocused",{get:function(){return!!this.isInteractive()&&this.interactions.isFocused},set:function(u){u=Ct(u),this.focusable&&this.isFocused!=u&&this.isInteractive()&&(this.interactions.isFocused=u,u===!0?this.handleFocus():this.handleBlur())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"isActive",{get:function(){return this._isActive},set:function(u){this.setActive(u)},enumerable:!0,configurable:!0}),R.prototype.setActive=function(u){u=Ct(u),this._isActive!==u&&(this._isActive=u,u&&this.states.hasKey("active")?(this.setState("active"),this.isHover&&this.states.hasKey("hoverActive")&&this.setState("hoverActive")):this.applyCurrentState(),this.dispatchImmediately("toggled"))},Object.defineProperty(R.prototype,"disabled",{get:function(){var u=this.getPropertyValue("disabled");return Te(u)?u:this.virtualParent?this.virtualParent.disabled:!!this._parent&&this._parent.disabled},set:function(u){this.setDisabled(u)},enumerable:!0,configurable:!0}),R.prototype.setDisabled=function(u){if(u=Ct(u),this.getPropertyValue("disabled")!=u){if(this.setPropertyValue("disabled",u,!0),u)this.parent=this._parent,this.removeFromInvalids(),this.group.attr({display:"none"}),this.dispatch("disabled");else{if(this._parent){var w=this._parent.element;w.hasChild(this.group)||w.add(this.group)}this instanceof cs?(this.deepInvalidate(),this._background&&this._background.invalidate()):this.invalidate(),this.__disabled||this.removeSVGAttribute("display"),this.dispatch("enabled")}return this.dispatch("transformed"),ca.requestFrame(),!0}return!1},Object.defineProperty(R.prototype,"__disabled",{get:function(){return this._internalDisabled},set:function(u){this._internalDisabled!=u&&(this._internalDisabled=u,this._updateDisabled=!0,this.invalidatePosition(),u||this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"numberFormatter",{get:function(){return this._numberFormatter?this._numberFormatter:this.virtualParent?this.virtualParent.numberFormatter:this._parent?this._parent.numberFormatter:(this._numberFormatter=new x3,this._numberFormatter.language=this.language,this.numberFormatter)},set:function(u){this._numberFormatter=u,this._numberFormatter.language=this.language},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dateFormatter",{get:function(){return this._dateFormatter?this._dateFormatter:this.virtualParent?this.virtualParent.dateFormatter:this._parent?this._parent.dateFormatter:(this._dateFormatter=new AI,this._dateFormatter.language=this.language,this.dateFormatter)},set:function(u){this._dateFormatter=u,this._dateFormatter.language=this.language},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"durationFormatter",{get:function(){return this._durationFormatter?this._durationFormatter:this.virtualParent?this.virtualParent.durationFormatter:this._parent?this._parent.durationFormatter:(this._durationFormatter=new k4,this._durationFormatter.language=this.language,this.durationFormatter)},set:function(u){this._durationFormatter=u,this._durationFormatter.language=this.language},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"language",{get:function(){var u=this._language.get();return u||(this.virtualParent?this.virtualParent.language:this._parent?this._parent.language:(u=new w1,this.language=u,u))},set:function(u){var w=this;this._language.get()!==u&&this._language.set(u,u.events.on("localechanged",function($){if(w._numberFormatter&&(w._numberFormatter.language=w.language),w._dateFormatter&&(w._dateFormatter.language=w.language),w._durationFormatter&&(w._durationFormatter.language=w.language),w._exporting.get()){var G=w._exporting.get();G.numberFormatter.language=w.language,G.dateFormatter.language=w.language,G.durationFormatter.language=w.language,G.language=w.language}w instanceof cs&&w.deepInvalidate()}))},enumerable:!0,configurable:!0}),R.prototype.populateString=function(u,w){if(Te(u)){u=Pt(u);var $=(u=x1().escape(u)).match(/\{([^}]+)\}/g),G=void 0;if($)for(G=0;G<$.length;G++){var K=$[G].replace(/\{([^}]+)\}/,"$1"),re=this.getTagValue(K,"",w);Te(re)||(re=""),u=u.split($[G]).join(re)}u=x1().unescape(u)}else u="";return this._adapterO?this._adapterO.apply("populateString",u):u},R.prototype.getTagValue=function(u,w,$){var G;Te($)||($=this.dataItem);for(var K,re=[],ue=/([^.]+)\(([^)]*)\)|([^.]+)/g;(K=ue.exec(u))!==null;)if(K[3])re.push({prop:K[3]});else{var we=[];if(Pf(K[2])!="")for(var De=/'([^']*)'|"([^"]*)"|([0-9\-]+)/g,Ve=void 0;(Ve=De.exec(K[2]))!==null;)we.push(Ve[1]||Ve[2]||Ve[3]);re.push({method:K[1],params:we})}if($){Te(G=this.getTagValueFromObject(re,$.values))&&!ht(G)||(G=this.getTagValueFromObject(re,$));var Ke=$.dataContext;!Te(G)&&Ke&&(Te(G=this.getTagValueFromObject(re,$.dataContext))||(G=this.getTagValueFromObject([{prop:u}],Ke)),!Te(G)&&Ke.dataContext&&(G=this.getTagValueFromObject(re,Ke.dataContext))),!Te(G)&&$.component&&$.component.dataItem!==$&&(G=$.component.getTagValue(u,w))}return Te(G)||(G=this.getTagValueFromObject(re,this.populateStringFrom||this)),!Te(G)&&this._parent&&(G=this._parent.getTagValue(u,w)),G},R.prototype.getTagValueFromObject=function(u,w,$){for(var G=w,K=!1,re=0,ue=u.length;reVe?1:ue.idx-we.idx}),u=w.map(function(ue){return ue.data});var $=this.element,G=!0;if($.node&&$.node.childNodes){for(var K=0,re=$.node.childNodes.length;K0;){var u=this.children.getIndex(0);u.parent=void 0,this.children.removeValue(u)}},R.prototype.disposeChildren=function(){for(;this.children.length>0;){var u=this.children.getIndex(0);u.dispose(),this.children.removeValue(u)}},Object.defineProperty(R.prototype,"background",{get:function(){return this._background||(this._background=this.createBackground(),this.processBackground()),this._background},set:function(u){this._background&&this.background!=u&&this.removeDispose(this._background),u&&(this._background=u,this._disposers.push(u),this.processBackground())},enumerable:!0,configurable:!0}),R.prototype.handleGlobalScale=function(){U.prototype.handleGlobalScale.call(this),this.children.each(function(u){u.handleGlobalScale()})},R.prototype.createBackground=function(){return new OI},R.prototype.processBackground=function(){var u=this._background;u&&(u.isMeasured=!1,this._background.fill=new Wa().getFor("background"),u.parent=this,u.isMeasured=!1,this.children.removeValue(u),this._disposers.push(u),this.group.addToBack(this._background.group))},R.prototype.validateLayout=function(){var u=this;pi.removeFromInvalidLayouts(this),this.layoutInvalid=!1,this._availableWidth=this.innerWidth,this._availableHeight=this.innerHeight;var w=0,$=0,G=!0;this.children&&(this.sortChildren(),wi(this._childrenByLayout,function(K){var re,ue;if(ae(K.relativeWidth)?(re=ze(u._availableWidth*K.relativeWidth,2),u.layout=="horizontal"&&(re-=K.pixelMarginRight+K.pixelMarginLeft)):u.layout=="horizontal"&&K.invalid&&K.validate(),ae(K.relativeHeight)?(ue=ze(u._availableHeight*K.relativeHeight,2),u.layout=="vertical"&&(ue-=K.pixelMarginTop+K.pixelMarginBottom)):u.layout=="vertical"&&K.invalid&&K.validate(),K.invalid==0){if(ae(K.relativeWidth)&&(K.maxWidth=re),ae(K.relativeHeight)&&(K.maxHeight=ue),K.isMeasured){u.layout=="horizontal"&&(ae(K.percentWidth)||K.measuredWidth>0&&(u._availableWidth-=K.measuredWidth+K.pixelMarginLeft+K.pixelMarginRight)),u.layout=="vertical"&&(ae(K.percentHeight)||K.measuredHeight>0&&(u._availableHeight-=K.measuredHeight+K.pixelMarginTop+K.pixelMarginBottom));var we=K.measuredWidth,De=K.measuredHeight;K.align!="none"&&(we+=K.pixelMarginLeft+K.pixelMarginRight),K.valign!="none"&&(De+=K.pixelMarginTop+K.pixelMarginBottom),w=Math.max(w,we),$=Math.max($,De)}}else K.isMeasured&&(ae(K.relativeWidth)&&K.maxWidth!=re&&(K.maxWidth=re,G=!1),ae(K.relativeHeight)&&K.maxHeight!=ue&&(K.maxHeight=ue,G=!1))})),this._absoluteWidth=w,this._absoluteHeight=$,G&&this.arrange()},R.prototype.arrange=function(){var u,w,$,G,K,re,ue,we,De,Ve,Ke,Qe=this,ft=this.children,Gt=0,ei=0,di=ye(this.innerWidth,this._absoluteWidth),ci=ye(this.innerHeight,this._absoluteHeight),qi=this.pixelPaddingLeft,rr=this.pixelPaddingRight,Ii=this.pixelPaddingTop,Ki=this.pixelPaddingBottom,pr=0,kr=0,Er=0,Bs=0,qn=[],Va=[],vh=this.maxWidth,lf=this.maxHeight,Ol=this.minWidth,wm=this.minHeight,Qu=W(ft.values);if(this.reverseOrder&&Qu.reverse(),this.layout=="grid"){re=vh,K=1;for(var Xs=0,Df=Qu.length;XsK&&(K=Ff)}re=nt(re,1,vh),K=nt(K,1,vh),ue=this.fixedWidthGrid?vh/K:vh/re,ue=ye(1,Math.floor(ue)),ue=H(this.maxColumns,ue),qn=this.getColumnWidth(Qu,ue,K)}for(Xs=0,Df=Qu.length;XsH(this.innerWidth,vh)-Xz+1&&Bs=ue&&(Bs=0,kr+=Va[Er],Er++,pr=0)}this.layout!=="none"&&(Vs.moveTo({x:dd,y:_u}),dC=dd+Vs.maxLeft-_h,GI=dd+Vs.maxRight+Gx,P3=_u+Vs.maxTop-jg,b8=_u+Vs.maxBottom+xm,(GI>w||!ae(w))&&(w=GI),(dCG||!ae(G))&&(G=b8),(GI>De||!ae(De))&&(De=GI),(dCKe||ae(Ke))}}if(this.layout=="none"){var Z4=this.bbox;u=Z4.x,w=Z4.x+Z4.width,$=Z4.y,G=Z4.y+Z4.height}ae(u)||(u=0,we=0),ae(w)||(De=w=this._availableWidth),ae($)||($=0,Ve=0),ae(G)||(Ke=G=this._availableHeight),ae(Ve)||(Ve=0),ae(Ke)||(Ke=Ve),ae(we)||(we=0),ae(De)||(De=we),Gt=w-u,ei=G-$,ae(this.relativeWidth)&&(u=0,w=Gt=vh-qi-rr),ae(this.relativeHeight)&&($=0,G=ei=lf-Ii-Ki),ae(this._pixelWidth)&&(u=0,Gt=this._pixelWidth-qi-rr),ae(Ol)&&Gt0){var UI,x8,Jz=Gt,Ny=ei;Jz=-.5&&w<=this.pixelWidth+.5&&$>=-.5&&$<=this.pixelHeight+.5},R.prototype.copyFrom=function(u){var w=this;U.prototype.copyFrom.call(this,u),this.layout=u.layout,this.setStateOnChildren=u.setStateOnChildren,u._background&&(this.background=u._background.clone(),this.background.copyFrom(u._background)),ar(u.children.iterator(),function($){$.shouldClone&&($.clone().parent=w)})},Object.defineProperty(R.prototype,"preloader",{get:function(){return this._preloader||(this.parent?this.parent.preloader:void 0)},set:function(u){this._preloader&&this.removeDispose(this._preloader),this._preloader=u,u&&(u.parent=this.tooltipContainer,this._disposers.push(u))},enumerable:!0,configurable:!0}),R.prototype.setPaper=function(u){var w=this,$=U.prototype.setPaper.call(this,u);return $&&(this._background&&(this._background.paper=u,this._background.topParent=this.topParent),this.children.each(function(G){G.setPaper(u),G.topParent=w.topParent})),$},R.prototype.removeFromInvalids=function(){U.prototype.removeFromInvalids.call(this),pi.removeFromInvalidLayouts(this)},R.prototype.setDataItem=function(u){this._dataItem!=u&&(ar(this.children.iterator(),function(w){w.dataItem=u}),this._background&&(this._background.dataItem=u)),U.prototype.setDataItem.call(this,u)},R.prototype.measureElement=function(){this.disabled||this.isTemplate||this.layout=="none"||this.__disabled||this.validateLayout()},Object.defineProperty(R.prototype,"fontFamily",{get:function(){return this.getPropertyValue("fontFamily")},set:function(u){this.setPropertyValue("fontFamily",u,!0)&&(this.setSVGAttribute({"font-family":u}),this.invalidateLabels())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fontSize",{get:function(){return this.getPropertyValue("fontSize")},set:function(u){this.setPropertyValue("fontSize",u,!0)&&(this.setSVGAttribute({"font-size":u}),this.invalidateLabels())},enumerable:!0,configurable:!0}),R.prototype.invalidateLabels=function(){this.children.each(function(u){u.hardInvalidate?(u.hardInvalidate(),u.events.once("validated",u.handleValidate,u,!1)):u instanceof R&&u.invalidateLabels()})},Object.defineProperty(R.prototype,"fontWeight",{get:function(){return this.getPropertyValue("fontWeight")},set:function(u){this.setPropertyValue("fontWeight",u),this.setSVGAttribute({"font-weight":u})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"textDecoration",{get:function(){return this.getPropertyValue("textDecoration")},set:function(u){this.setPropertyValue("textDecoration",u),this.setSVGAttribute({"text-decoration":u})},enumerable:!0,configurable:!0}),R.prototype.dispose=function(){this._background&&this._background.dispose(),this._shouldBeReady=[],this.disposeChildren(),U.prototype.dispose.call(this)},R.prototype.setState=function(u,w,$){var G=u;return u instanceof Qr&&(G=u.name),this.setStateOnChildren&&ar(this.children.iterator(),function(K){K.setState(G,w,$),G!="active"&&(K.isActive=!1)}),this._background&&this._background.setState(G),this.setStateOnSprites.length&&wi(this.setStateOnSprites,function(K){K.setState(G,w,$)}),U.prototype.setState.call(this,u,w,$)},R.prototype.setActive=function(u){U.prototype.setActive.call(this,u),this._background&&(this._background.isActive=u)},R.prototype.dispatchReady=function(){var u=this;if(!this.isReady()&&!this.isDisposed()){var w=!0;on(this.children.iterator(),function($){return!!($.__disabled||$.disabled||$.isReady())||(w=!1,!1)}),qr(this._shouldBeReady,function($){return!!($.__disabled||$.disabled||$.isReady())||(w=!1,!1)}),w?U.prototype.dispatchReady.call(this):pi.events.once("exitframe",function(){u.dispatchReady(),ca.requestFrame()},void 0,!1)}},R.prototype._systemUpdate=function(u){this.children.each(function(w){w.invalid&&(w._systemCheckIfValidate()?w.dataItem&&w.dataItem.component&&w.dataItem.component.dataInvalid?u.push(w):w.validate():u.push(w))}),U.prototype._systemUpdate.call(this,u)},R.prototype._systemValidatePositions=function(){this.children.each(function(u){u.positionInvalid&&u.validatePosition()}),U.prototype._systemValidatePositions.call(this)},R.prototype._systemValidateLayouts=function(){this.layoutInvalid&&!this.isDisposed()&&this.validateLayout()},Object.defineProperty(R.prototype,"tapToActivate",{get:function(){return this._tapToActivate},set:function(u){this._tapToActivate!=u&&this.setTapToActivate(u)},enumerable:!0,configurable:!0}),R.prototype.setTapToActivate=function(u){var w=this;this._tapToActivate=u,this.interactions.isTouchProtected=u,u&&this.interactions.setEventDisposer("container-tapToActivate",u,function(){return new jn([w.events.on("hit",w.handleTapToActivate,w,!1),w.events.on("down",w.initTapTimeout,w,!1),w.events.on("track",w.initTapTimeout,w,!1),Zs().body.events.on("down",function($){Zs().isLocalElement($.pointer,w.paper.svg,w.uid)||w.handleTapToActivateDeactivation()},w,!1)])}),Zs()},R.prototype.handleTapToActivate=function(){this.interactions.isTouchProtected=!1,this.initTapTimeout()},R.prototype.handleTapToActivateDeactivation=function(){this.interactions.isTouchProtected=!0},R.prototype.initTapTimeout=function(){var u=this;this._tapToActivateTimeout&&this._tapToActivateTimeout.dispose(),this.tapToActivate&&!this.interactions.isTouchProtected&&this.tapTimeout&&(this._tapToActivateTimeout=this.setTimeout(function(){u.handleTapToActivateDeactivation()},this.tapTimeout))},R.prototype.moveHtmlContainer=function(u){var w=V$(u);if(w){this.htmlContainer=w;var $=this.svgContainer;$.htmlElement=w,$.htmlElement.appendChild($.SVGContainer),$.initSensor(),$.measure()}else ct(u)&&u!=""&&ca.log("html container '"+u+"' not found")},R.prototype.hasLicense=function(){if(rp.commercialLicense)return!0;for(var u=0;u0;){var G=(K=$[0]).dataProvider;if(K.isDisposed())ji($,K);else if(G&&G.dataInvalid)try{if(G.validateData(),G.dataValidationProgress<1)break}catch(De){ji($,G),G.raiseCriticalError(De)}else try{if(K.validateData(),K.dataValidationProgress<1)break}catch(De){ji($,K),K.raiseCriticalError(De)}}if(Date.now()-u>this.updateStepDuration)break}for(;pi.invalidRawDatas.length>0;)if((K=pi.invalidRawDatas[0]).isDisposed())ji(pi.invalidRawDatas,K);else try{K.validateRawData()}catch(De){ji(pi.invalidRawDatas,K),K.raiseCriticalError(De)}for(;pi.invalidDataItems.length>0;){if(G=(K=pi.invalidDataItems[0]).dataProvider,!(K.isDisposed()||K.dataInvalid||G&&G.dataInvalid))try{K.validateDataItems()}catch(De){ji(pi.invalidDataItems,K),K.raiseCriticalError(De)}ji(pi.invalidDataItems,K)}for(;pi.invalidDataRange.length>0;){var K;if(G=(K=pi.invalidDataRange[0]).dataProvider,!(K.isDisposed()||K.dataInvalid||G&&G.dataInvalid))try{K.validateDataRange(),K.skipRangeEvent||K.dispatchImmediately("datarangechanged"),K.skipRangeEvent=!1}catch(De){ji(pi.invalidDataRange,K),K.raiseCriticalError(De)}ji(pi.invalidDataRange,K)}var re=[];yi(pi.invalidLayouts,function(De){R.validateLayouts(De)}),yi(pi.invalidPositions,function(De){R.validatePositions(De)});var ue=!1;if(u=Date.now(),yi(pi.invalidSprites,function(De,Ve){for(var Ke=0;Ve.length>0;){if(R.validateLayouts(De),R.validatePositions(De),++Ke==5){if(Date.now()-u>R.updateStepDuration)break;Ke=0}var Qe=Ve[Ve.length-1];if(Qe&&!Qe.isDisposed()){if(Qe._systemCheckIfValidate())if(R.checkIfValidate2(Qe))try{Qe._systemUpdate(re)}catch(ft){Qe.invalid=!1,ji(Ve,Qe),Qe.raiseCriticalError(ft)}else re.push(Qe);else re.push(Qe);Qe.invalid=!1}ji(Ve,Qe)}pi.invalidSprites[De]=pi.invalidSprites[De].concat(re)}),yi(pi.invalidSprites,function(De,Ve){Ve.length>0&&(ue=!0)}),yi(pi.invalidDatas,function(De,Ve){Ve.length>0&&(ue=!0)}),wi(W(this.animations),function(De){De.update()}),yi(pi.invalidLayouts,function(De){R.validateLayouts(De)}),yi(pi.invalidPositions,function(De){R.validatePositions(De)}),Lo(),yi(pi.invalidLayouts,function(De){R.validateLayouts(De)}),yi(pi.invalidPositions,function(De){R.validatePositions(De)}),pi.dispatchImmediately("exitframe"),(ue||this.animations.length>0||[].length>0)&&this.requestFrame(),this.updateStepDuration<200){var we=!0;yi(pi.invalidDatas,function(De,Ve){Ve.length>0&&(we=!1)}),yi(pi.invalidSprites,function(De,Ve){Ve.length>0&&(we=!1)}),we&&(this.updateStepDuration=200)}}},U.prototype.checkIfValidate2=function(R){return!(R.dataItem&&R.dataItem.component&&R.dataItem.component.dataInvalid&&!R.dataItem.component.isTemplate)},U.prototype.requestFrame=function(){var R=this;this._frameRequested||(Ei(function(){R.update()}),this._frameRequested=!0)},U.prototype.softInvalidate=function(R){var u=this;R.children.each(function(w){w instanceof cs&&u.softInvalidate(w),w.measureFailed&&(xl(w,"Label")?w.hardInvalidate():w.invalidate(),w.measureFailed=!1)})},U.prototype.validatePositions=function(R){for(var u=pi.invalidPositions[R];u.length>0;){var w=u[u.length-1];if(w.isDisposed())ji(u,w);else try{w._systemValidatePositions()}catch($){w.positionInvalid=!1,ji(u,w),w.raiseCriticalError($)}}},U.prototype.validateLayouts=function(R){for(var u=pi.invalidLayouts[R];u.length>0;){var w=u[u.length-1];if(w.isDisposed())ji(u,w);else try{w.children.each(function($){$._systemValidateLayouts()}),w.validateLayout()}catch($){w.layoutInvalid=!1,ji(u,w),w.raiseCriticalError($)}}},U.prototype.log=function(R){(function(){for(var u=[],w=0;w0},enumerable:!0,configurable:!0}),U.prototype.maybeToNumber=function(R,u){return this.options.numberFields.indexOf(R)!==-1?At(u):u},Object.defineProperty(U.prototype,"parsableDates",{get:function(){return this.options.dateFields&&this.options.dateFields.length>0},enumerable:!0,configurable:!0}),U.prototype.maybeToDate=function(R,u){return this.options.dateFields.indexOf(R)!==-1?this.options.dateFormatter.parse(u,this.dateFormat):u},U.prototype.maybeToEmpty=function(R){return Te(R)&&R!=""||!Te(this.options.emptyAs)?R:this.options.emptyAs},Object.defineProperty(U.prototype,"dateFormatter",{get:function(){return this.options.dateFormatter||(this.options.dateFormatter=new AI,this.options.dateFormat&&(this.options.dateFormat=this.options.dateFormat)),this.options.dateFormatter},enumerable:!0,configurable:!0}),Object.defineProperty(U.prototype,"dateFormat",{get:function(){return this.options.dateFormat||this.dateFormatter.inputDateFormat},enumerable:!0,configurable:!0}),U}(),dz=[",",";"," "],rC=function(U){function R(){var u=U!==null&&U.apply(this,arguments)||this;return u.contentType="text/csv",u.options={delimiter:"",reverse:!1,skipRows:0,skipEmpty:!0,useColumnNames:!1},u}return ie(R,U),R.isCSV=function(u){return!!R.getDelimiterFromData(u)},R.getDelimiterFromData=function(u){var w,$=u.split(` +`),G=$.length;return wi(dz,function(K){for(var re=0,ue=0,we=0;we1)){ue=0;break}if(ue===0)ue=re;else if(re!=ue){ue=0;break}}ue&&(w=K)}),w},R.prototype.parse=function(u){this.options.delimiter||(this.options.delimiter=R.getDelimiterFromData(u));var w,$,G,K=this.CSVToArray(u,this.options.delimiter),re=Te(this.options.emptyAs),ue=this.parsableNumbers,we=this.parsableDates,De=[],Ve=[];for($=0;$0&&ue.delay(w))}),G},R.prototype.dispose=function(){U.prototype.dispose.call(this),wi(this.sprites,function(u){u.dispose()}),this.sprites=[]},R.prototype.hide=function(u,w,$,G){var K=this;if(this.isHiding=!0,wi(this.sprites,function(ue){var we=ue.hide(u);we==null||we.isFinished()||(K._disposers.push(we),w!=null&&w>0&&we.delay(w))}),ae($)&&G){var re;if(wi(G,function(ue){var we=K.setWorkingValue(ue,$,u,w);we&&(re=we)}),re&&!re.isFinished())return this._hideDisposer=re.events.on("animationended",function(){K.setVisibility(!1,!0),K.isHiding=!1}),this._disposers.push(this._hideDisposer),re;this.isHiding=!1,this.setVisibility(!1,!0)}else this.isHiding=!1,this.setVisibility(!1)},R.prototype.getDuration=function(u){if(!ae(u)){var w=this.component;w&&(u=w.interpolationDuration)}if(u!=null)return this._adapterO?this._adapterO.apply("duration",u):u},R.prototype.getValue=function(u,w){if(u&&this.component){w||(w=this.component.dataFields[u+"Show"])||(w="value");var $=this.values[u][w];return this._adapterO&&this._adapterO.isEnabled("value")?this._adapterO.apply("value",{value:$,field:u}).value:$}},R.prototype.getWorkingValue=function(u){if(u&&this.component){var w=this.component.dataFields[u+"Show"];return w||(w="workingValue"),this._adapterO?this._adapterO.apply("workingValue",{workingValue:this.values[u][w],field:u}).workingValue:this.values[u][w]}},R.prototype.getActualWorkingValue=function(u){return this.values[u].workingValue},R.prototype.setValue=function(u,w,$,G){var K=this.values[u].value,re=this.getDuration($);if(K!==(w=Et(w))){if(this.values[u].value=w,this._eventDispatcher&&!this.__disabled&&this.events.isEnabled("valuechanged")){var ue={type:"valuechanged",target:this,property:u};this.events.dispatchImmediately("valuechanged",ue)}this.component&&this.component.handleDataItemValueChange(this,u)}this.setWorkingValue(u,w,re,G)},R.prototype.setCalculatedValue=function(u,w,$){if(this.values[u][$]!==w&&ae(w)){if(this.values[u][$]=w,this._eventDispatcher&&!this.__disabled&&this.events.isEnabled("calculatedvaluechanged")){var G={type:"calculatedvaluechanged",target:this,property:u};this.events.dispatchImmediately("calculatedvaluechanged",G)}this.component&&this.component.handleDataItemCalculatedValueChange(this,u)}},R.prototype.setWorkingValue=function(u,w,$,G){if(ae(this.values[u].value)){var K=this.getDuration($),re=this.values[u].workingValue;if(K!=null&&K>0&&ae(re)&&this.component){if(re!=w){var ue=this.animate({childObject:this.values[u],property:"workingValue",from:re,to:w,dummyData:u},K,this.component.interpolationEasing);return G!=null&&ue.delay(G),ue.events.on("animationstarted",this.handleInterpolationProgress,this),ue.events.on("animationprogress",this.handleInterpolationProgress,this),ue.events.on("animationended",this.handleInterpolationProgress,this),this._valueAnimations[u]=ue,ue}(we=this._valueAnimations[u])&&we.stop(),this.values[u].workingValue=w}else{var we;if((we=this._valueAnimations[u])&&we.stop(),this.values[u].workingValue=w,this._eventDispatcher&&!this.__disabled&&this.events.isEnabled("workingvaluechanged")){var De={type:"workingvaluechanged",target:this,property:u};this.events.dispatchImmediately("workingvaluechanged",De)}this.component&&this.component.handleDataItemWorkingValueChange(this,u)}}},R.prototype.setLocation=function(u,w,$,G){if(this.locations[u]!==w){if(this.locations[u]=w,this._eventDispatcher&&!this.__disabled&&this.events.isEnabled("locationchanged")){var K={type:"locationchanged",target:this,property:u};this.events.dispatchImmediately("locationchanged",K)}this.component&&this.component.handleDataItemValueChange(this,u),this.setWorkingLocation(u,w,$,G)}},R.prototype.setWorkingLocation=function(u,w,$,G){var K=this.getDuration($),re=this.workingLocations[u];if(K!=null&&K>0&&ae(re)&&this.component){if(re!=w){var ue=this.animate({childObject:this.workingLocations,property:u,from:re,to:w,dummyData:u},K,this.component.interpolationEasing);return G!=null&&ue.delay(G),ue.events.on("animationstarted",this.handleInterpolationProgress,this),ue.events.on("animationprogress",this.handleInterpolationProgress,this),ue.events.on("animationended",this.handleInterpolationProgress,this),this._locationAnimations[u]=ue,ue}(we=this._locationAnimations[u])&&we.stop(),this.workingLocations[u]=w}else{var we;if((we=this._locationAnimations[u])&&we.stop(),this.workingLocations[u]=w,this._eventDispatcher&&!this.__disabled&&this.events.isEnabled("workinglocationchanged")){var De={type:"workinglocationchanged",target:this,property:u};this.events.dispatchImmediately("workinglocationchanged",De)}this.component&&this.component.handleDataItemWorkingLocationChange(this,u)}},R.prototype.setDate=function(u,w,$){!kt(w)&&this.component&&(w=this.component.dateFormatter.parse(w)),this.dates[u]!==w&&(this.dates[u]=w,this.setValue(u,w.getTime(),$))},R.prototype.getDate=function(u){return this._adapterO?this._adapterO.apply("date",{date:this.dates[u],field:u}).date:this.dates[u]},R.prototype.setProperty=function(u,w){if(this.properties[u]!==w){if(this.hasProperties=!0,this.properties[u]=w,this._eventDispatcher&&!this.__disabled&&this.events.isEnabled("propertychanged")){var $={type:"propertychanged",target:this,property:u,value:w};this.events.dispatchImmediately("propertychanged",$)}this.component&&this.component.handleDataItemPropertyChange(this,u)}},R.prototype.setCategory=function(u,w){ct(w)||(w=Pt(w)),this.categories[u]!==w&&(this.categories[u]=w)},R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),u.dataContext&&(this.dataContext=ul(u.dataContext,{})),pn(u.locations,this.locations),u._adapterO&&this.adapter.copyFrom(u._adapterO),this.component=u.component},Object.defineProperty(R.prototype,"opacity",{set:function(u){wi(this.sprites,function(w){w.opacity=u})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"ignoreMinMax",{get:function(){return this._ignoreMinMax},set:function(u){if(this._ignoreMinMax=u,this._eventDispatcher&&!this.__disabled&&this.events.isEnabled("propertychanged")){var w={type:"propertychanged",target:this,property:"ignoreMinMax",value:u};this.events.dispatchImmediately("propertychanged",w)}this.component&&this.component.handleDataItemPropertyChange(this,"ignoreMinMax")},enumerable:!0,configurable:!0}),R.prototype.animate=function(u,w,$){return new _m(this,u,w,$).start()},R.prototype.handleInterpolationProgress=function(u){var w=u.target.animationOptions[0];if(w){if(this._eventDispatcher&&!this.__disabled&&this.events.isEnabled("workingvaluechanged")){var $={type:"workingvaluechanged",target:this,property:w.dummyData};this.events.dispatchImmediately("workingvaluechanged",$)}this.component&&this.component.handleDataItemWorkingValueChange(this,w.dummyData)}},R.prototype.hasValue=function(u){for(var w=0,$=u.length;w<$;w++){var G=this.values[u[w]];if(!G||!Te(G.value))return!1}return!0},Object.defineProperty(R.prototype,"depth",{get:function(){return this.parent?this.parent.depth+1:0},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dataContext",{get:function(){return this._dataContext},set:function(u){this._dataContext=u},enumerable:!0,configurable:!0}),R.prototype.addSprite=function(u){u.dataItem&&u.dataItem!=this&&ji(u.dataItem.sprites,u),this.visible||u.hide(0),this.isHiding&&u.hide(),this.sprites.push(u),u.dataItem=this},R}(bi),DI=function(U){function R(){var u=U.call(this)||this;return u.dataFields={},u._dataSources={},u._parseDataFrom=0,u._dataDisposers=[],u._currentDataSetId="",u._start=0,u._end=1,u.skipRangeEvent=!1,u.rangeChangeDuration=0,u.rangeChangeEasing=$v,u.parsingStepDuration=50,u.dataInvalid=!1,u.rawDataInvalid=!1,u.dataRangeInvalid=!1,u.dataItemsInvalid=!1,u.interpolationDuration=0,u.interpolationEasing=$v,u.sequencedInterpolation=!0,u.sequencedInterpolationDelay=0,u.dataValidationProgress=0,u._addAllDataItems=!0,u._usesData=!0,u.className="Component",u.minZoomCount=1,u.maxZoomCount=0,u._dataItems=new Jm(u.createDataItem()),u._dataItems.events.on("inserted",u.handleDataItemAdded,u,!1),u._dataItems.events.on("removed",u.handleDataItemRemoved,u,!1),u._disposers.push(new ua(u._dataItems)),u._disposers.push(u._dataItems.template),u.invalidateData(),u.dataUsers.events.on("inserted",u.handleDataUserAdded,u,!1),u._disposers.push(new jn(u._dataDisposers)),u._start=0,u._end=1,u.maxZoomDeclination=1,u.applyTheme(),u}return ie(R,U),R.prototype.createDataItem=function(){return new MI},R.prototype.handleDataUserAdded=function(u){u.newValue.dataProvider=this},R.prototype.handleDataItemValueChange=function(u,w){this.dataItemsInvalid||this.invalidateDataItems()},R.prototype.handleDataItemWorkingValueChange=function(u,w){},R.prototype.handleDataItemWorkingLocationChange=function(u,w){},R.prototype.handleDataItemCalculatedValueChange=function(u,w){},R.prototype.handleDataItemPropertyChange=function(u,w){},R.prototype.processDataItem=function(u,w){var $=this;if(u){w||(w={}),u.dataContext=w;var G=!1;yi(this.dataFields,function(K,re){var ue=K,we=w[re];if($._adapterO&&$._adapterO.isEnabled("dataContextValue")&&(we=$._adapterO.apply("dataContextValue",{field:ue,value:we,dataItem:u}).value),Te(we))if(G=!0,u.hasChildren[ue]){var De=$.createDataItem();De.copyFrom($.mainDataSet.template);var Ve=new Jm(De);Ve.events.on("inserted",$.handleDataItemAdded,$,!1),Ve.events.on("removed",$.handleDataItemRemoved,$,!1),$._dataDisposers.push(new ua(Ve));for(var Ke=we.length,Qe=0;Qe0;)this.data.shift(),w--;this.invalidateData()},R.prototype.removeData=function(u,w){if(ae(u)&&u>0){for(;u>0;){var $=this.mainDataSet.getIndex(0);$&&this.mainDataSet.remove($),this.dataUsers.each(function(G){if(!G.data||G.data.length==0){var K=G.mainDataSet.getIndex(0);K&&G.mainDataSet.remove(K)}}),w||this.data.shift(),this._parseDataFrom>0&&this._parseDataFrom--,u--}this.invalidateDataItems()}},R.prototype.invalidateData=function(){this.disabled||this.isTemplate||(pi.addToInvalidComponents(this),ca.requestFrame(),this.dataInvalid=!0,ar(this.dataUsers.iterator(),function(u){u.invalidateDataItems()}))},R.prototype.invalidateDataUsers=function(){ar(this.dataUsers.iterator(),function(u){u.invalidate()})},R.prototype.invalidateDataItems=function(){this.disabled||this.isTemplate||(Xr(pi.invalidDataItems,this),ca.requestFrame(),this.dataItemsInvalid=!0,ar(this.dataUsers.iterator(),function(u){u.invalidateDataItems()}))},R.prototype.invalidateDataRange=function(){this.disabled||this.isTemplate||(this.dataRangeInvalid=!0,Xr(pi.invalidDataRange,this),ca.requestFrame())},R.prototype.validateDataRange=function(){ji(pi.invalidDataRange,this),this.dataRangeInvalid=!1,this.startIndex==this._prevStartIndex&&this.endIndex==this._prevEndIndex||(this.rangeChangeUpdate(),this.appendDataItems(),this.invalidate(),this.dispatchImmediately("datarangechanged"))},R.prototype.sliceData=function(){this._workingStartIndex=this.startIndex,this._workingEndIndex=this.endIndex},R.prototype.rangeChangeUpdate=function(){this.sliceData(),this._prevStartIndex=this.startIndex,this._prevEndIndex=this.endIndex},R.prototype.appendDataItems=function(){for(var u=this.endIndex,w=this.startIndex;w0&&this.disposeData(),this.data.length>0){var w=this.preloader;ar(this.dataUsers.iterator(),function(Ve){Ve._startIndex=void 0,Ve._endIndex=void 0});for(var $=0,G=Date.now(),K=this._parseDataFrom,re=this.data.length,ue=function(){var Ve=we.data[K];if(we._usesData){var Ke=we.getDataItem(Ve);we.processDataItem(Ke,Ve)}if(we.dataUsers.each(function(Qe){if(Qe.data.length==0){var ft=Qe.getDataItem(Ve);Qe.processDataItem(ft,Ve)}}),++$==100&&($=0,Date.now()-G>we.parsingStepDuration&&K.5&&!w.visible||(w.progress=K/we.data.length)),we.dataValidationProgress=K/we.data.length,K=we.data.length,we.invalidateData(),{value:void 0}},we=this;K0?this.invalidateData():(this.dispatchImmediately("beforedatavalidated"),this.dispatch("datavalidated")))},R.prototype.getDataSource=function(u){var w=this;return Te(this._dataSources[u])||(this._dataSources[u]=new pz,this._dataSources[u].component=this,this.setDataSourceEvents(this._dataSources[u],u),this._dataSources[u].adapter.add("dateFields",function($){return w.dataSourceDateFields($)}),this._dataSources[u].adapter.add("numberFields",function($){return w.dataSourceNumberFields($)}),this.events.on("inited",function(){w.loadData(u)},this,!1)),this._dataSources[u]},Object.defineProperty(R.prototype,"dataSource",{get:function(){return this._dataSources.data||this.getDataSource("data"),this._dataSources.data},set:function(u){var w=this;this._dataSources.data&&this.removeDispose(this._dataSources.data),this._dataSources.data=u,this._dataSources.data.component=this,this.events.on("inited",function(){w.loadData("data")},this,!1),this.setDataSourceEvents(u,"data")},enumerable:!0,configurable:!0}),R.prototype.loadData=function(u){this._dataSources[u].load()},R.prototype.dataSourceDateFields=function(u){return u},R.prototype.dataSourceNumberFields=function(u){return u},R.prototype.populateDataSourceFields=function(u,w,$){return wi($,function(G){w[G]&&Ni(u,w[G])===-1&&u.push(w[G])}),u},R.prototype.setDataSourceEvents=function(u,w){var $=this;u.events.on("started",function(G){var K=$.preloader;K&&(K.progress=0)},void 0,!1),u.events.on("loadstarted",function(G){var K=$.preloader;K&&(K.progress=.25)},void 0,!1),u.events.on("loadended",function(G){var K=$.preloader;K&&(K.progress=.5)},void 0,!1),u.events.on("parseended",function(G){var K=$.preloader;K&&(K.progress=.75)},void 0,!1),u.events.on("ended",function(G){var K=$.preloader;K&&(K.progress=1)},void 0,!1),u.events.on("error",function(G){var K=$.preloader;K&&(K.progress=1),$.openModal(G.message)},void 0,!1),w&&u.events.on("done",function(G){var K=$.preloader;K&&(K.progress=1),w!="data"||wt(G.data)||(G.data=[G.data]),u.incremental&&w=="data"&&$.data.length?$.addData(G.data,u.keepCount?G.data.length:0):u.updateCurrentData&&w=="data"&&$.data.length?(wi($.data,function(re,ue){Te(G.data[ue])&&yi(re,function(we,De){Te(G.data[ue][we])&&(re[we]=G.data[ue][we])})}),$.invalidateRawData()):$[w]=G.data})},Object.defineProperty(R.prototype,"responsive",{get:function(){return this._responsive||(this._responsive=new H0e,this._responsive.component=this),this._responsive},set:function(u){this._responsive=u,this._responsive.component=this},enumerable:!0,configurable:!0}),R.prototype.zoom=function(u,w,$,G){var K=this;w===void 0&&(w=!1),$===void 0&&($=!1);var re=u.start,ue=u.end,we=u.priority;if(u.start==u.end&&(u.start=u.start-.5/this.maxZoomFactor,u.end=u.end+.5/this.maxZoomFactor),we=="end"&&ue==1&&re!=0&&rethis.end&&(we="end"),ae(G)||(G=this.maxZoomDeclination),!ae(re)||!ae(ue))return{start:this.start,end:this.end};if(this._finalStart!=re||this._finalEnd!=ue){var De=this.maxZoomFactor/this.minZoomCount,Ve=this.maxZoomFactor/this.maxZoomCount;if(we=="start"?(this.maxZoomCount>0&&1/(ue-re)De&&(ue=re+1/De),ue>1&&ue-re<1/De&&(re=ue-1/De)):(this.maxZoomCount>0&&1/(ue-re)De&&(re<=0?ue=re+1/De:re=ue-1/De),re<0&&ue-re<1/De&&(ue=re+1/De)),re<-G&&(re=-G),1/(ue-re)>De&&(ue=re+1/De),ue>1+G&&(ue=1+G),1/(ue-re)>De&&(re=ue-1/De),this._finalEnd=ue,this._finalStart=re,this.skipRangeEvent=w,this.dispatchImmediately("rangechangestarted"),this.rangeChangeDuration>0&&!$){var Ke=this.rangeChangeAnimation;if(Ke&&Ke.progress<1){var Qe=Ke.animationOptions;if(Qe.length>1){if(Qe[0].to==re&&Qe[1].to==ue)return{start:re,end:ue};Ke.isDisposed()||Ke.stop()}}this.rangeChangeAnimation&&this.rangeChangeAnimation.kill(),Ke=this.animate([{property:"start",to:re},{property:"end",to:ue}],this.rangeChangeDuration,this.rangeChangeEasing),this.rangeChangeAnimation=Ke,Ke&&!Ke.isFinished()?Ke.events.on("animationended",function(){K.dispatchImmediately("rangechangeended")}):this.dispatchImmediately("rangechangeended")}else this.start=re,this.end=ue,this.dispatch("rangechangeended")}return{start:re,end:ue}},R.prototype.zoomToIndexes=function(u,w,$,G){if(ae(u)&&ae(w)){var K=u/this.dataItems.length,re=w/this.dataItems.length;this.zoom({start:K,end:re},$,G)}},Object.defineProperty(R.prototype,"zoomFactor",{get:function(){return nt(1/(this.end-this.start),1,this.maxZoomFactor)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxZoomFactor",{get:function(){return this.getPropertyValue("maxZoomFactor")},set:function(u){this.setPropertyValue("maxZoomFactor",u)&&(u==1&&(this.maxZoomDeclination=0),this.invalidateDataRange())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxZoomDeclination",{get:function(){return this.getPropertyValue("maxZoomDeclination")},set:function(u){this.setPropertyValue("maxZoomDeclination",u)&&this.invalidateDataRange()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startIndex",{get:function(){return ae(this._startIndex)||(this._startIndex=0),this._startIndex},set:function(u){this._startIndex=nt(Math.round(u),0,this.dataItems.length),this.start=this.indexToPosition(this._startIndex)},enumerable:!0,configurable:!0}),R.prototype.indexToPosition=function(u){return u/this.dataItems.length},Object.defineProperty(R.prototype,"endIndex",{get:function(){var u=this.dataItems.length;return(!ae(this._endIndex)||this._endIndex>u)&&(this._endIndex=u),this._endIndex},set:function(u){this._endIndex=nt(Math.round(u),0,this.dataItems.length),this.end=this.indexToPosition(this._endIndex)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"start",{get:function(){return this._adapterO?this._adapterO.apply("start",this._start):this._start},set:function(u){if(this._start!=u){this._start=u;var w=Math.max(0,Math.floor(this.dataItems.length*u)||0);this._startIndex=Math.min(w,this.dataItems.length),this.invalidateDataRange(),this.invalidate(),this.dispatchImmediately("startchanged"),this.dispatch("startendchanged")}},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"end",{get:function(){return this._adapterO?this._adapterO.apply("end",this._end):this._end},set:function(u){this._end!=u&&(this._end=u,this._endIndex=Math.min(this.dataItems.length,Math.ceil(this.dataItems.length*u)||0),this.invalidateDataRange(),this.invalidate(),this.dispatchImmediately("endchanged"),this.dispatch("startendchanged"))},enumerable:!0,configurable:!0}),R.prototype.removeFromInvalids=function(){U.prototype.removeFromInvalids.call(this),pi.removeFromInvalidComponents(this),ji(pi.invalidDataItems,this),ji(pi.invalidDataRange,this),ji(pi.invalidRawDatas,this)},Object.defineProperty(R.prototype,"dataItems",{get:function(){if(this._currentDataSetId!=""){var u=this.dataSets.getKey(this._currentDataSetId);if(u)return u}return this._dataItems},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dataSets",{get:function(){return this._dataSets||(this._dataSets=new Ea),this._dataSets},enumerable:!0,configurable:!0}),R.prototype.setDataSet=function(u){if(this._currentDataSetId!=u){if(this.dataSets.getKey(u))return this.dataItems.each(function(w){w.__disabled=!0}),this._currentDataSetId=u,this.invalidateDataRange(),this._prevStartIndex=void 0,this.dataItems.each(function(w){w.__disabled=!1}),!0;if(this._currentDataSetId!="")return this.dataItems.each(function(w){w.__disabled=!0}),this._currentDataSetId="",this.invalidateDataRange(),this._prevStartIndex=void 0,this.dataItems.each(function(w){w.__disabled=!1}),!0}return!1},Object.defineProperty(R.prototype,"currentDataSetId",{get:function(){return this._currentDataSetId},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"mainDataSet",{get:function(){return this._dataItems},enumerable:!0,configurable:!0}),R.prototype._updateDataItemIndexes=function(u){for(var w=this.mainDataSet.values,$=w.length,G=u;G<$;++G)w[G]._index=G},R.prototype.handleDataItemAdded=function(u){u.newValue.component=this,this._updateDataItemIndexes(u.index),this.dataItemsInvalid||this.invalidateDataItems()},R.prototype.handleDataItemRemoved=function(u){this._updateDataItemIndexes(u.index),this.dataItemsInvalid||this.invalidateDataItems()},R.prototype.bindDataField=function(u,w){this.dataFields[u]=w,this.invalidateDataRange()},R.prototype.invalidateProcessedData=function(){this.resetProcessedRange(),this.invalidateDataRange()},R.prototype.resetProcessedRange=function(){this._prevEndIndex=null,this._prevStartIndex=null},Object.defineProperty(R.prototype,"dataUsers",{get:function(){var u=this;return this._dataUsers||(this._dataUsers=new to,this._disposers.push(new Kr(function(){ar(u._dataUsers.iterator(),function(w){w.dispose()})}))),this._dataUsers},enumerable:!0,configurable:!0}),R.prototype.clone=function(){var u=U.prototype.clone.call(this);return u.dataFields=pn(this.dataFields,{}),u},R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.data=u.data,this.sequencedInterpolation=u.sequencedInterpolation,this.sequencedInterpolationDelay=u.sequencedInterpolationDelay,this.interpolationDuration=u.interpolationDuration,this.interpolationEasing=u.interpolationEasing},R.prototype.reinit=function(){this._inited=!1,this.deepInvalidate()},R.prototype.getExporting=function(){var u=U.prototype.getExporting.call(this);return u.adapter.has("data",this._exportData,-1,this)||(u.adapter.add("data",this._exportData,-1,this),this.events.on("datavalidated",function(w){u.handleDataUpdated()})),u},R.prototype._exportData=function(u){return u.data=this.data,u},R.prototype.setDisabled=function(u){var w=U.prototype.setDisabled.call(this,u);return w&&this.invalidateData(),w},R.prototype.setShowOnInit=function(u){u!=this.getPropertyValue("showOnInit")&&(!u||this.inited||this.hidden?this._showOnInitDisposer2&&this.removeDispose(this._showOnInitDisposer2):(this._showOnInitDisposer2=this.events.once("dataitemsvalidated",this.hideInitially,this,!1),this._disposers.push(this._showOnInitDisposer2))),U.prototype.setShowOnInit.call(this,u)},R.prototype.setBaseId=function(u){u!=this._baseId&&this.dataInvalid&&(this.dataInvalid=!1,pi.removeFromInvalidComponents(this),this._baseId=u,this.invalidateData()),U.prototype.setBaseId.call(this,u)},Object.defineProperty(R.prototype,"minZoomCount",{get:function(){return this.getPropertyValue("minZoomCount")},set:function(u){this.setPropertyValue("minZoomCount",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxZoomCount",{get:function(){return this.getPropertyValue("maxZoomCount")},set:function(u){this.setPropertyValue("maxZoomCount",u)},enumerable:!0,configurable:!0}),R.prototype._systemCheckIfValidate=function(){return!(this.dataInvalid||this.dataProvider&&this.dataProvider.dataInvalid)},R.prototype.asFunction=function(u){return u=="interpolationEasing"||u=="rangeChangeEasing"||U.prototype.asIs.call(this,u)},R}(cs);pi.registeredClasses.Component=DI;var tg=function(U){function R(){var u=U.call(this)||this;return u.isOversized=!1,u.className="Label",u.fill=new Wa().getFor("text"),u.wrap=!1,u.truncate=!1,u.fullWords=!0,u.ellipsis="…",u.textAlign="start",u.textValign="top",u.layout="absolute",u.baseLineRatio=-.27,u._positionPrecision=1,u.events.on("maxsizechanged",function(){u.inited&&u.handleMaxSize()},u,!1),u.events.once("validated",u.handleValidate,u,!1),u.applyTheme(),u}return ie(R,U),R.prototype.afterDraw=function(){U.prototype.afterDraw.call(this),this.validatePosition()},R.prototype.setPaper=function(u){var w=U.prototype.setPaper.call(this,u);return w&&this.hardInvalidate(),w},R.prototype.handleValidate=function(){!this.currentText&&!this.text||this.bbox.width!=0&&this.bbox.height!=0||pi.events.once("exitframe",this.hardInvalidate,this)},R.prototype.handleMaxSize=function(){(this.bbox.width>this.availableWidth||this.bbox.widththis.availableHeight||this.bbox.heightG){this.isOversized=!0;var kr=Ii.element.textContent,Er=Ii.bbox.width/kr.length,Bs=H(Math.ceil((Ii.bbox.width-G)/Er),kr.length);if(this.truncate){var qn=!1,Va=Ii.element.node;if(Va&&Va.childNodes)for(var vh=Ii.element.node.childNodes.length-1;vh>=0;vh--){var lf=Ii.element.node.childNodes[vh];if(qn&&Ii.bbox.width<=G&&(lf.textContent+=" "+this.ellipsis,Ii.bbox=Ii.element.getBBox(),Ii.bbox.width=Math.floor(Ii.bbox.width),Ii.bbox.width<=G))break;qn=!1;var Ol=lf.textContent;for(kr=Ii.element.textContent,Bs=H(Math.ceil((Ii.bbox.width-G)/Er),kr.length);Ii.bbox.width>G&&Bs<=kr.length&&Bs>0;)(Xs=ye(kr.length-Bs-this.ellipsis.length,1))<=1&&(Bs=0,vh>0&&(qn=!0,Ii.element.node.removeChild(lf))),(Ol=kd(Ol,Xs,this.ellipsis,this.fullWords,this.rtl)).length>Xs&&this.fullWords&&(Ol=kd(Ol,Xs,this.ellipsis,!1,this.rtl)),lf.textContent=Ol,Ii.bbox=Ii.element.getBBox(),Ii.bbox.width=Math.floor(Ii.bbox.width),Bs=Math.ceil(1.1*Bs);rr=!0}}else if(Ii.element.node){for(var wm=Ii.element.node.lastChild,Qu=void 0;Ii.bbox.width>G&&Bs<=kr.length&&Bs>0;){var Xs=ye(pr.text.length-Bs,1);if(qi?Qu=Lh(pr.text,Xs,!0,this.rtl):((Qu=Lh(pr.text,Xs,!0,this.rtl,!1))[0].length>Xs||Xs===1)&&(Ii.element.node.removeChild(wm),Bs=0),Bs>0){var Df=Qu.shift();qi&&(Df=Pf(Df)),wm.textContent=x1().cleanUp(Df)}Ii.bbox=Ii.element.getBBox(),Ii.bbox.width=Math.floor(Ii.bbox.width),Bs++}if(Qu.length>0){var Ff="";Te(Qu)&&(this.rtl?Ff+=Qu.join("")+ft:Ff+=ft+Qu.join("").replace(/([\[\]]{1})/g,"$1$1"));for(var Vs=Ki+1;Vs0&&(Qe+=_h),Ke.removeElement(_u);var Gx=this.getLineInfo(Gt);Gx&&(Gx.text="",Gx.element.textContent="")}}this.maybeHideOversized(),this.measureFailed=!1,this.bbox.width!=0&&this.bbox.height!=0||(this.measureFailed=!0),this._measuredWidth=ze(ye(this.bbox.width,this.pixelWidth-this.pixelPaddingLeft-this.pixelPaddingRight)),this._measuredHeight=ze(ye(this.bbox.height,this.pixelHeight-this.pixelPaddingTop-this.pixelPaddingBottom)),this.alignSVGText(),this.bbox.width=this._measuredWidth,this.bbox.height=this._measuredHeight,w==this._measuredHeight&&u==this._measuredWidth||this.dispatch("transformed"),this.hideUnused(De.length)}else{this.element.removeAttr("display"),this.resetBBox(),(Ke=this.element).removeChildren(),this.setCache("lineInfo",[],0);var jg=this.paper.foreignObject();Ke.add(jg),this.maxWidth&&jg.attr({width:this.maxWidth-this.pixelPaddingLeft-this.pixelPaddingRight}),this.maxHeight&&jg.attr({height:this.maxHeight-this.pixelPaddingTop-this.pixelPaddingBottom});var xm=this.getHTMLLineElement(we);jg.node.appendChild(xm),xm.style.display="inline-block";var E1=xm.clientWidth,Ux=xm.clientHeight;xm.style.display="block",this._bbox={x:0,y:0,width:E1,height:Ux},jg.attr({width:E1+1,height:Ux}),this.maybeHideOversized(),this._measuredWidth=ye(this.bbox.width,this.pixelWidth-this.pixelPaddingLeft-this.pixelPaddingRight),this._measuredHeight=ye(this.bbox.height,this.pixelHeight-this.pixelPaddingTop-this.pixelPaddingBottom),this.bbox.width=this._measuredWidth,this.bbox.height=this._measuredHeight,this.truncate&&(xm.style.overflow="hidden"),(E1>G||Ux>K)&&(this.isOversized=!0)}this.setStyles(),this.updateCenter(),this.updateBackground(),Ve=="none"&&this.group.attr({display:"none"}),this.pathElement&&this.paper.appendDef(this.pathElement)}else this.element.attr({display:"none"})}}else $.events.once("maxsizechanged",this.hardInvalidate,this,!1)},R.prototype.maybeHideOversized=function(){this.hideOversized&&(this.availableWidth=0;K--){var re=w[K];if(re.setAttribute("text-anchor",this.textAlign),this.textPathElement)re.removeAttribute("x"),re.removeAttribute("y");else{switch(this.textAlign){case"middle":re.setAttribute("x",($/2).toString()+"px");break;case"end":this.rtl||re.setAttribute("x",$.toString());break;default:this.rtl?re.setAttribute("x",$.toString()):re.removeAttribute("text-anchor")}var ue=Et(re.getAttribute("y"));switch(this.textValign){case"middle":re.setAttribute("y",((ue||0)+(G-this.bbox.height)/2).toString());break;case"bottom":re.setAttribute("y",((ue||0)+G-this.bbox.height).toString());break;default:re.setAttribute("y",(ue||0).toString())}}}}},R.prototype.getSVGLineElement=function(u,w){var $=this.paper.addGroup("text");return $.textContent=u,$.attr({x:"0"}),Te(w)&&$.attr({y:w.toString()}),(this.truncate||this.wrap)&&$.attr({overflow:"hidden"}),$},Object.defineProperty(R.prototype,"rtl",{get:function(){return Te(this._rtl)?this._rtl:!!this._topParent&&this._topParent.rtl},set:function(u){u=Ct(u),this._rtl=u,this.element&&this.alignSVGText()},enumerable:!0,configurable:!0}),R.prototype.resetBBox=function(){this._bbox={x:0,y:0,width:0,height:0}},R.prototype.getHTMLLineElement=function(u){var w=document.createElement("div");switch(w.innerHTML=u,this.textAlign){case"middle":w.style.textAlign="center";break;case"end":w.style.textAlign="right"}return this.wrap?w.style.wordWrap="break-word":w.style.whiteSpace="nowrap",this.rtl&&(w.style.direction="rtl"),Te(this.fill)&&(w.style.color=this.fill.toString()),w},R.prototype.setStyles=function(){var u=this.element;!this.selectable||this.draggable||this.resizable||this.swipeable?u.addStyle({webkitUserSelect:"none",msUserSelect:"none"}):this.selectable&&(u.removeStyle("webkitUserSelect"),u.removeStyle("msUserSelect"))},R.prototype.hideUnused=function(u){this.initLineCache();var w=this.getCache("lineInfo");if(w.length>=u)for(var $=u;$u?w[u]:void 0},R.prototype.addLineInfo=function(u,w){this.initLineCache(),this.getCache("lineInfo")[w]=u},R.prototype.initLineCache=function(){Te(this.getCache("lineInfo"))||this.setCache("lineInfo",[],0)},R.prototype.setDataItem=function(u){this._sourceDataItemEvents&&this._sourceDataItemEvents.dispose(),u&&(this._sourceDataItemEvents=new jn([u.events.on("valuechanged",this.invalidate,this,!1),u.events.on("workingvaluechanged",this.invalidate,this,!1),u.events.on("calculatedvaluechanged",this.invalidate,this,!1),u.events.on("propertychanged",this.invalidate,this,!1)])),U.prototype.setDataItem.call(this,u)},Object.defineProperty(R.prototype,"availableWidth",{get:function(){return Te(this.maxWidth)?this.maxWidth:this.pixelWidth},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"availableHeight",{get:function(){return Te(this.maxHeight)?this.maxHeight:this.pixelHeight},enumerable:!0,configurable:!0}),R.prototype.getSvgElement=function(u,w,$){var G=this.paper.add("tspan");return G.textContent=u,w&&G.node.setAttribute("style",w),$&&$.add(G),G},R.prototype.deepInvalidate=function(){U.prototype.deepInvalidate.call(this),this.hardInvalidate()},Object.defineProperty(R.prototype,"readerTitle",{get:function(){var u=this.getPropertyValue("readerTitle");return u?this.dataItem&&(u=this.populateString(u)):u=this.populateString($h(uo(this.html)?this.html:this.text)),u},set:function(u){u=Ft(u),this.setPropertyValue("readerTitle",u)&&this.applyAccessibility()},enumerable:!0,configurable:!0}),R}(cs);pi.registeredClasses.Label=tg,sp.push({relevant:Mf.heightXS,state:function(U,R){if(U instanceof tg&&U.parent&&U.parent.isBaseSprite){var u=U.states.create(R);return u.properties.disabled=!0,u}return null}});var Vb=function(U){function R(){var u=U.call(this)||this;return u.className="RoundedRectangle",u.element=u.paper.add("path"),u.cornerRadius(3,3,3,3),u.applyTheme(),u}return ie(R,U),R.prototype.draw=function(){U.prototype.draw.call(this);var u=this.innerWidth,w=this.innerHeight;if(ae(u)&&ae(w)){var $=H(u,w)/2,G=Is(this.cornerRadiusTopLeft,$),K=Is(this.cornerRadiusTopRight,$),re=Is(this.cornerRadiusBottomRight,$),ue=Is(this.cornerRadiusBottomLeft,$),we=H(Math.abs(u/2),Math.abs(w/2)),De=nt(G,0,we),Ve=nt(K,0,we),Ke=nt(re,0,we),Qe=nt(ue,0,we),ft="M"+De+",0 L"+(u-Ve)+",0 a"+Ve+","+Ve+" 0 0 1 "+Ve+","+Ve+" L"+u+","+(w-Ke)+" a"+Ke+","+Ke+" 0 0 1 -"+Ke+","+Ke+" L"+Qe+","+w+" a"+Qe+","+Qe+" 0 0 1 -"+Qe+",-"+Qe+" L0,"+De+" a"+De+","+De+" 0 0 1 "+De+",-"+De+" Z";this.path=ft}},R.prototype.cornerRadius=function(u,w,$,G){this.cornerRadiusTopLeft=u,this.cornerRadiusTopRight=w,this.cornerRadiusBottomLeft=$,this.cornerRadiusBottomRight=G},Object.defineProperty(R.prototype,"cornerRadiusTopLeft",{get:function(){return this.getPropertyValue("cornerRadiusTopLeft")},set:function(u){this.setPercentProperty("cornerRadiusTopLeft",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cornerRadiusTopRight",{get:function(){return this.getPropertyValue("cornerRadiusTopRight")},set:function(u){this.setPercentProperty("cornerRadiusTopRight",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cornerRadiusBottomRight",{get:function(){return this.getPropertyValue("cornerRadiusBottomRight")},set:function(u){this.setPercentProperty("cornerRadiusBottomRight",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cornerRadiusBottomLeft",{get:function(){return this.getPropertyValue("cornerRadiusBottomLeft")},set:function(u){this.setPercentProperty("cornerRadiusBottomLeft",u,!0)},enumerable:!0,configurable:!0}),R.prototype.measureElement=function(){},Object.defineProperty(R.prototype,"bbox",{get:function(){return this.definedBBox?this.definedBBox:this.isMeasured?{x:0,y:0,width:this.innerWidth,height:this.innerHeight}:{x:0,y:0,width:0,height:0}},enumerable:!0,configurable:!0}),R}(yo);pi.registeredClasses.RoundedRectangle=Vb;var nC=function(U){function R(){var u=U.call(this)||this;u.className="Button",u.tooltipY=0,u.iconPosition="left",u.layout="horizontal",u.contentAlign="center",u.contentValign="middle",u.padding(8,16,8,16),u.setStateOnChildren=!0;var w=new Wa,$=u.background;$.fill=w.getFor("secondaryButton"),$.stroke=w.getFor("secondaryButtonStroke"),$.fillOpacity=1,$.strokeOpacity=1,$.cornerRadius(3,3,3,3),u.label=new tg,u.label.fill=w.getFor("secondaryButtonText"),u.label.shouldClone=!1;var G=$.states.create("hover");G.properties.fillOpacity=1,G.properties.fill=w.getFor("secondaryButtonHover");var K=$.states.create("down");return K.transitionDuration=100,K.properties.fill=w.getFor("secondaryButtonDown"),K.properties.fillOpacity=1,u.role="button",u.focusable=!0,u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"icon",{get:function(){return this._icon},set:function(u){var w=this._icon;w&&(w.parent=void 0),u&&(this._icon=u,u.parent=this,u.interactionsEnabled=!1,u.shouldClone=!1,this.iconPosition=this.iconPosition,this._disposers.push(u))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"iconPosition",{get:function(){return this.getPropertyValue("iconPosition")},set:function(u){this.setPropertyValue("iconPosition",u),this.icon&&(u=="left"?this.icon.toBack():this.icon.toFront())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"label",{get:function(){return this._label},set:function(u){this._label&&this.removeDispose(this._label),this._label=u,u&&(u.parent=this,u.interactionsEnabled=!1,this._disposers.push(this._label))},enumerable:!0,configurable:!0}),R.prototype.createBackground=function(){return new Vb},R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),u.label&&this.label.copyFrom(u.label),u.icon&&(this.icon=u.icon.clone())},R}(cs);pi.registeredClasses.Button=nC;var FI=function(U){function R(){var u=U.call(this)||this;return u.className="Circle",u.element=u.paper.add("circle"),u.setPercentProperty("radius",de(100)),u.setPropertyValue("horizontalCenter","middle"),u.setPropertyValue("verticalCenter","middle"),u.applyTheme(),u}return ie(R,U),R.prototype.draw=function(){U.prototype.draw.call(this),this.element.attr({r:this.pixelRadius})},Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pixelRadius",{get:function(){return Is(this.radius,H(this.innerWidth/2,this.innerHeight/2))},enumerable:!0,configurable:!0}),R.prototype.measureElement=function(){var u=this.pixelRadius;this._bbox={x:-u,y:-u,width:2*u,height:2*u}},R}(yo);pi.registeredClasses.Circle=FI;var fz=function(U){function R(){var u=U.call(this)||this;return u.className="Ellipse",u.element=u.paper.add("ellipse"),u.applyTheme(),u}return ie(R,U),R.prototype.draw=function(){U.prototype.draw.call(this),this.element.attr({rx:this.radius}),this.element.attr({ry:this.radiusY})},Object.defineProperty(R.prototype,"radiusY",{get:function(){return this.innerHeight/2},set:function(u){this.height=2*u,this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radius",{get:function(){return this.innerWidth/2},set:function(u){this.width=2*u,this.invalidate()},enumerable:!0,configurable:!0}),R}(FI);pi.registeredClasses.Ellipse=fz;var q$=function(U){function R(){var u=U.call(this)||this;return u.className="Image",u.element=u.paper.add("image"),u.applyTheme(),u.width=50,u.height=50,u}return ie(R,U),R.prototype.draw=function(){if(U.prototype.draw.call(this),this.href){var u=this.innerWidth,w=this.innerHeight;ae(this.widthRatio)&&(u=w*this.widthRatio,this.width=u),ae(this.heightRatio)&&(w=u*this.heightRatio,this.height=w),this.element.attr({width:u,height:w}),this.element.attrNS(bI,"xlink:href",this.href)}},Object.defineProperty(R.prototype,"href",{get:function(){return this.getPropertyValue("href")},set:function(u){this.setPropertyValue("href",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"widthRatio",{get:function(){return this.getPropertyValue("widthRatio")},set:function(u){this.setPropertyValue("widthRatio",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"heightRatio",{get:function(){return this.getPropertyValue("heightRatio")},set:function(u){this.setPropertyValue("heightRatio",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"bbox",{get:function(){return{x:0,y:0,width:this.pixelWidth,height:this.pixelHeight}},enumerable:!0,configurable:!0}),R}(yo);pi.registeredClasses.Image=q$;var Bv=function(U){function R(){var u=U.call(this)||this;return u.className="Line",u.element=u.paper.add("line"),u.fill=He(),u.x1=0,u.y1=0,u.applyTheme(),u}return ie(R,U),R.prototype.draw=function(){U.prototype.draw.call(this),this.x1==this.x2||this.y1==this.y2?this.pixelPerfect=!0:this.pixelPerfect=!1,this.x1=this.x1,this.x2=this.x2,this.y1=this.y1,this.y2=this.y2},Object.defineProperty(R.prototype,"x1",{get:function(){return this.getPropertyValue("x1")},set:function(u){ae(u)||(u=0);var w=0;this.pixelPerfect&&this.stroke instanceof Fy&&(w=1e-5),this.setPropertyValue("x1",u,!0),this.element.attr({x1:u+w})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"x2",{get:function(){var u=this.getPropertyValue("x2");return ae(u)||(u=this.pixelWidth),u},set:function(u){ae(u)||(u=0),this.setPropertyValue("x2",u,!0),this.element.attr({x2:u})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"y1",{get:function(){return this.getPropertyValue("y1")},set:function(u){ae(u)||(u=0);var w=0;this.pixelPerfect&&this.stroke instanceof Fy&&(w=1e-5),this.setPropertyValue("y1",u,!0),this.element.attr({y1:u+w})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"y2",{get:function(){var u=this.getPropertyValue("y2");return ae(u)||(u=this.pixelHeight),u},set:function(u){ae(u)||(u=0),this.setPropertyValue("y2",u,!0),this.element.attr({y2:u})},enumerable:!0,configurable:!0}),R.prototype.positionToPoint=function(u){var w={x:this.x1,y:this.y1},$={x:this.x2,y:this.y2},G=Q(w,$,u),K=le(w,$);return{x:G.x,y:G.y,angle:K}},R}(yo);pi.registeredClasses.Line=Bv;var W0e=function(U){function R(){var u=U.call(this)||this;return u.className="PointedShape",u.pointerBaseWidth=15,u.pointerLength=10,u.pointerY=0,u.pointerX=0,u.applyTheme(),u}return ie(R,U),R.prototype.draw=function(){U.prototype.draw.call(this),ae(this.pointerX)||(this.pointerX=this.pixelWidth/2),ae(this.pointerY)||(this.pointerY=this.pixelHeight+10)},Object.defineProperty(R.prototype,"pointerBaseWidth",{get:function(){return this.getPropertyValue("pointerBaseWidth")},set:function(u){this.setPropertyValue("pointerBaseWidth",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pointerLength",{get:function(){return this.getPropertyValue("pointerLength")},set:function(u){this.setPropertyValue("pointerLength",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pointerX",{get:function(){return this.getPropertyValue("pointerX")},set:function(u){this.setPropertyValue("pointerX",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pointerY",{get:function(){return this.getPropertyValue("pointerY")},set:function(u){this.setPropertyValue("pointerY",u,!0)},enumerable:!0,configurable:!0}),R}(yo),q0e=function(U){function R(){var u=U.call(this)||this;return u.className="PointedRectangle",u.element=u.paper.add("path"),u.cornerRadius=6,u.applyTheme(),u}return ie(R,U),R.prototype.draw=function(){U.prototype.draw.call(this);var u=this.cornerRadius,w=this.innerWidth,$=this.innerHeight;if(w>0&&$>0){var G,K,re=this.pointerX,ue=this.pointerY,we=this.pointerBaseWidth/2,De=H(w/2,$/2),Ve=nt(u,0,De),Ke=nt(u,0,De),Qe=nt(u,0,De),ft=nt(u,0,De),Gt=void 0,ei=void 0,di=void 0,ci=void 0,qi=(re-0)*($-0)-(ue-0)*(w-0),rr=(re-0)*(0-$)-(ue-$)*(w-0);Gt=qi>0&&rr>0?"M"+Ve+",0 L"+((G=nt(re,Ve+we,w-we-Ke))-we)+",0 L"+re+","+(ue=nt(ue,-1/0,0))+" L"+(G+we)+",0 L"+(w-Ke)+",0":"M"+Ve+",0 L"+(w-Ke)+",0",di=qi<0&&rr<0?" L"+(w-Qe)+","+$+" L"+((G=nt(re,ft+we,w-we-Qe))+we)+","+$+" L"+re+","+(ue=nt(ue,$,1/0))+" L"+(G-we)+","+$+" L"+ft+","+$:" L"+ft+","+$,ci=qi<0&&rr>0?" L0,"+($-ft)+" L0,"+((K=nt(ue,Ve+we,$-ft-we))+we)+" L"+(re=nt(re,-1/0,0))+","+ue+" L0,"+(K-we)+" L0,"+Ve:" L0,"+Ve,ei=qi>0&&rr<0?" L"+w+","+Ke+" L"+w+","+((K=nt(ue,Ke+we,$-we-Qe))-we)+" L"+(re=nt(re,w,1/0))+","+ue+" L"+w+","+(K+we)+" L"+w+","+($-Qe):" L"+w+","+($-Qe);var Ii=" a"+Ke+","+Ke+" 0 0 1 "+Ke+","+Ke,Ki=" a"+Qe+","+Qe+" 0 0 1 -"+Qe+","+Qe,pr=" a"+ft+","+ft+" 0 0 1 -"+ft+",-"+ft,kr=" a"+Ve+","+Ve+" 0 0 1 "+Ve+",-"+Ve;this.path=Gt+Ii+ei+Ki+di+pr+ci+kr}},Object.defineProperty(R.prototype,"cornerRadius",{get:function(){return this.getPropertyValue("cornerRadius")},set:function(u){this.setPropertyValue("cornerRadius",u,!0)},enumerable:!0,configurable:!0}),R}(W0e);function $4(U){var R=Rr(U[0]),u={x:0,y:0},w=rp.minPolylineStep;ae(w)||(w=.5);for(var $=0,G=U.length;$w&&(R+=Rr(K),u=K)}return R}function wn(U){return" M"+ze(U.x,4)+","+ze(U.y,4)+" "}function Rr(U){return" L"+ze(U.x,4)+","+ze(U.y,4)+" "}function sC(U,R){return" Q"+ze(R.x,4)+","+ze(R.y,4)+" "+ze(U.x,4)+","+ze(U.y,4)}function C3(U,R,u){return" C"+ze(R.x,4)+","+ze(R.y,4)+" "+ze(u.x,4)+","+ze(u.y,4)+" "+ze(U.x,4)+","+ze(U.y,4)}function J8e(){return" Z"}function Bd(U,R,u,w){if(R==0)return"";ae(w)||(w=u);var $="",G=",",K=Math.ceil(Math.abs(R)/180),re=1;R<0&&(re=0);var ue=0,we=0,De=-A(U)*u,Ve=-$e(U)*w;if(R<.5&&u>3e3)return Rr({x:ft=ze(A(Qe=U+R)*u,4),y:Gt=ze($e(Qe)*w,4)});for(var Ke=0;Ke(ue-U)/2&&(kr=ci);var Er="";return R==360?Er=wn(rr):(Er=wn(qi),Er+=Rr(rr),Er+=j0(pr,G,Ve,!0)),Er+=Bd(U+Qe,R-2*Qe,u,$),ae(w)&&w!=0?(R==360&&G==0?Er+=wn(Ki):(Er+=j0(Ii,G,Ve,!0),Er+=Rr(Ki),Er+=j0(kr,K,Ke,!0)),Er+=Bd(ue-Gt,-(R-2*Gt),w,De),(R<360||G>0)&&(Er+=j0(qi,K,Ke,!0)),Er+=Rr(qi)):(Er+=j0(Ii,G,Ve,!0),R<360&&(Er+=Rr(qi))),Er}function j0(U,R,u,w,$,G){if(R==0)return"";var K=",";return" A"+R+K+u+K+(G=G||0)+K+ +($=!!$)+K+ +(w=!!w)+K+ze(U.x,4)+K+ze(U.y,4)}function mz(U,R,u,w){return ae(u)||(u=0),ae(w)||(w=0),wn({x:u,y:w})+Rr({x:u+U,y:w})+Rr({x:u+U,y:w+R})+Rr({x:u,y:w+R})+" Z"}function aC(U,R){var u=",",w=" L";return R?"M"+U.x+u+U.y+w+U.x+u+(U.y+U.height)+w+(U.x+U.width)+u+(U.y+U.height)+w+(U.x+U.width)+u+U.y+w+U.x+u+U.y:"M"+U.x+u+U.y+w+(U.x+U.width)+u+U.y+w+(U.x+U.width)+u+(U.y+U.height)+w+U.x+u+(U.y+U.height)+w+U.x+u+U.y}function Z8e(U,R){var u=Lx().add("path").node;if(u.setAttribute("d",U),u.getPointAtLength&&u.getTotalLength){for(var w=u.getTotalLength(),$=[],G=0;Gwe&&(Ke=2*we),(De+=2*Math.asin(Ke/2/we))*tt>ue+(u-$)/K*360)break;var Qe=De*tt,ft={x:U+we*Math.cos(De),y:R+we*w/u*Math.sin(De)};Ve.push(ft),we=$+Qe/360*K}return Ve.shift(),Ve}function e9e(U){if(!U||U.length==0)return"";var R=wn(U[0]);if(U&&U.length>0)for(var u=1;u0){for(var w="",$=0,G=u.length;$0){w+=wn(K[0]);for(var re=1;re1){for(var Qe=1;Qeu){Ve=$.length;break}}else Ke.length==1&&(we=Ke[0],De=Ke[0],re=0,ue=1)}if(we&&De){var ft=Q(we,De,(u-re)/(ue-re));return{x:ft.x,y:ft.y,angle:w+le(we,De)}}}return{x:0,y:0,angle:0}},Object.defineProperty(R.prototype,"realSegments",{get:function(){return this._realSegments},enumerable:!0,configurable:!0}),R}(yo);pi.registeredClasses.Polyline=B4;var Xte=function(U){function R(){var u=U.call(this)||this;return u.className="Polyarc",u.controlPointDistance=.5,u.controlPointPosition=.5,u.applyTheme(),u}return ie(R,U),R.prototype.makePath=function(){this._distance=0;var u=this.segments;if(u&&u.length>0){var w="";this._realSegments=[];for(var $=0,G=u.length;$0){w+=wn(K[0]);for(var ue=1;ue0)for(var qi=0;qi<=di;qi++){var rr=Lt(we,De,Gt,ei,qi/di);re.push(rr),this._distance+=C(ci,rr),ci=rr}else re.push(we)}}}this.path=w}},Object.defineProperty(R.prototype,"controlPointPosition",{get:function(){return this.getPropertyValue("controlPointPosition")},set:function(u){this.setPropertyValue("controlPointPosition",u),this.makePath()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"controlPointDistance",{get:function(){return this.getPropertyValue("controlPointDistance")},set:function(u){this.setPropertyValue("controlPointDistance",u),this.makePath()},enumerable:!0,configurable:!0}),R}(B4);pi.registeredClasses.Polyarc=Xte;var Y0e=function(U){function R(u){var w=U.call(this)||this;return w._bboxes=[],w.morphDuration=800,w.morphEasing=$v,w.morphToSingle=!0,w.scaleRatio=1,w.className="Morpher",w.morphable=u,w.applyTheme(),w}return ie(R,U),R.prototype.morphToPolygon=function(u,w,$){var G=this.morphable.currentPoints;if(G&&u){this.sortPoints(G),this.sortPoints(u),this._morphFromPointsReal=[],this._morphToPointsReal=[],Te(w)||(w=this.morphDuration),Te($)||($=this.morphEasing),this._morphFromPointsReal=this.normalizePoints(u,G),this._morphToPointsReal=this.normalizePoints(G,u),this.morphable.currentPoints=this._morphFromPointsReal;var K=new _m(this,{property:"morphProgress",from:0,to:1},w,$);return this._disposers.push(K),K.start(),K}},R.prototype.normalizePoints=function(u,w){for(var $=0,G=u.length;$De.width*De.height?-1:1});for(var w=[],$=0,G=u.length;$ci&&(ci=we.length);for(var qi=360/((ci=(Ke=this.addPoints(we,ci)).length)-1),rr=0;rr0)for(var pr=0,kr=De.length;pr0){var Qe=u[u.length-1];for(De=G.length;De0)for(var qi=Qe.x+Qe.width/2,rr=Qe.y+Qe.height/2,Ii=0,Ki=De.length;Ii0&&Ve&&Ve.length>0){for(var Qe=[],ft=0,Gt=we.length;ft0&&Ke&&Ke.length>0){for(var qi=[],rr=0,Ii=De.length;rr0){var re=K.split("M"),ue=re[0],we=re[1];if(ue&&ue.length>0){var De=ue.split("L");if(De.length>0){var Ve=[],Ke=[Ve];u.push(Ke);for(var Qe=0;Qe0){var Gt=we.split("L");if(Gt.length>0){var ei=[];for(Ke.push(ei),Qe=Gt.length-1;Qe>=0;Qe--)ft=Gt[Qe].split(","),ei.push({x:+ft[0],y:+ft[1]})}}}}}}this.setPropertyValue("points",u),this._currentPoints=u}return u},set:function(u){this.setPropertyValue("points",u,!0),this._currentPoints=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"currentPoints",{get:function(){return this._currentPoints&&this._currentPoints.length!=0||!this.path||(this._currentPoints=this.points),this._currentPoints},set:function(u){this._currentPoints!=u&&(this._currentPoints=u,this.draw())},enumerable:!0,configurable:!0}),R.prototype.draw=function(){var u,w,$,G,K="",re=this._currentPoints;if(re.length>0){for(var ue=0,we=re.length;ue0){K+=wn(Qe=De[0]);for(var Ke=0;KeQe.x)&&(u=Qe.x),(!ae($)||$>Qe.y)&&($=Qe.y),(!ae(G)||G0){var Qe;K+=wn(Qe=Ve[0]);for(var ft=0,Gt=Ve.length;ft0){var G="";this._realSegments=[];for(var K=0,re=u.length;K0){var De=ue[0],Ve=ue[ue.length-1],Ke=!1;ze(De.x,3)==ze(Ve.x)&&ze(De.y)==ze(Ve.y)&&(Ke=!0),G+=wn(ue[0]);for(var Qe=0;Qe0)for(var Ki=0;Ki<=rr;Ki++){var pr=Lt(Gt,ei,ci,qi,Ki/rr);if(pr.x!=Ii.x||pr.y!=Ii.y){we.push(pr);var kr=ze(le(Ii,pr),5);this._distance+=C(Ii,pr),this.allPoints[Math.floor(this._distance)]={x:pr.x,y:pr.y,angle:kr},Ii=pr}}else we.push(ft)}}var Er=this.allPoints;if(Er.length>1){for(var Bs=0;Bs1)Er[Bs]=Er[Bs-1];else for(var qn=1;qn1)for(var K=1;K<$.length;K++){var re=C(u,$[K]);re1){if(w&&K>3){if(u<0){u<-.01&&(u=-.01);var re=G[0],ue=G[1];return{x:we=re.x-(re.x-ue.x)*K*u,y:De=re.y-(re.y-ue.y)*K*u,angle:le(re,ue)}}var we,De;if(u>1)return u>1.01&&(u=1.01),re=G[G.length-2],ue=G[G.length-3],{x:we=re.x+(re.x-ue.x)*K*(u-1),y:De=re.y+(re.y-ue.y)*K*(u-1),angle:le(re,{x:we,y:De})};if(u==1){var Ve=G[G.length-1];return{x:Ve.x,y:Ve.y,angle:Ve.angle}}}else u<0&&(u=Math.abs(u),$=180),u>=1&&(u=.9999999999999);var Ke;return{x:(Ke=G[Math.floor(u*K)]).x,y:Ke.y,angle:Ke.angle+$}}return K==1?{x:(Ke=G[0]).x,y:Ke.y,angle:Ke.angle}:{x:0,y:0,angle:0}},R}(B4);pi.registeredClasses.Polyspline=V4;var LI=function(U){function R(){var u=U.call(this)||this;return u.className="Slice",u.setPropertyValue("cornerRadius",0),u.setPropertyValue("startAngle",0),u.setPercentProperty("innerRadius",0),u.setPercentProperty("radius",0),u.setPropertyValue("arc",0),u.setPropertyValue("shiftRadius",0),u.strokeOpacity=1,u.setPropertyValue("layout","none"),u.slice=u.createChild(yo),u.slice.isMeasured=!1,u._disposers.push(u.slice),u.applyTheme(),u}return ie(R,U),R.prototype.draw=function(){U.prototype.draw.call(this);var u=this.radiusY;this.radius>0&&u==0&&(u=.01),this.slice.path=oC(this.startAngle,this.arc,this.radius,this.pixelInnerRadius,u,this.cornerRadius,this.innerCornerRadius),this.slice.invalidate(),this.shiftRadius=this.shiftRadius,this.realFill instanceof Ly&&this.updateGradient(this.realFill),this.realStroke instanceof Ly&&this.updateGradient(this.realStroke)},R.prototype.updateGradient=function(u){u.element.attr({gradientUnits:"userSpaceOnUse"}),u.element.attr({r:this.radius}),u.cx=0,u.cy=0,u.element.attr({radius:this.radius})},Object.defineProperty(R.prototype,"bbox",{get:function(){return this.definedBBox?this.definedBBox:this.isMeasured?Ye([Zt(this.startAngle,this.startAngle+this.arc,this.pixelInnerRadius),Zt(this.startAngle,this.startAngle+this.arc,this.radius)]):{x:0,y:0,width:0,height:0}},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startAngle",{get:function(){return this.getPropertyValue("startAngle")},set:function(u){this.setPropertyValue("startAngle",ri(u),!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"arc",{get:function(){return this.getPropertyValue("arc")},set:function(u){ae(u)||(u=0),this.setPropertyValue("arc",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radius",{get:function(){var u=this.getPropertyValue("radius");return ae(u)||(u=0),u},set:function(u){this.setPropertyValue("radius",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radiusY",{get:function(){var u=this.getPropertyValue("radiusY");return ae(u)||(u=this.radius),u},set:function(u){this.setPropertyValue("radiusY",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"innerRadius",{get:function(){return this.getPropertyValue("innerRadius")},set:function(u){this.setPercentProperty("innerRadius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pixelInnerRadius",{get:function(){return Is(this.innerRadius,this.radius)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cornerRadius",{get:function(){return this.getPropertyValue("cornerRadius")},set:function(u){this.setPropertyValue("cornerRadius",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"innerCornerRadius",{get:function(){return this.getPropertyValue("innerCornerRadius")},set:function(u){this.setPropertyValue("innerCornerRadius",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"shiftRadius",{get:function(){return this.getPropertyValue("shiftRadius")},set:function(u){this.setPropertyValue("shiftRadius",u),u=this.getPropertyValue("shiftRadius"),this.dx=u*this.radius*this.ix,this.dy=u*this.radiusY*this.iy},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"ix",{get:function(){return A(this.middleAngle)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"iy",{get:function(){return $e(this.middleAngle)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"middleAngle",{get:function(){return this.startAngle+this.arc/2},enumerable:!0,configurable:!0}),R.prototype.getTooltipX=function(){var u=this.getPropertyValue("tooltipX");if(ae(u))return u;var w=.5;u instanceof J&&(w=u.value);var $=Is(this.innerRadius,this.radius);return this.ix*($+(this.radius-$)*w)},R.prototype.getTooltipY=function(){var u=this.getPropertyValue("tooltipY");if(ae(u))return u;var w=.5;u instanceof J&&(w=u.value);var $=Is(this.innerRadius,this.radius);return this.iy*($+(this.radius-$)*w)+this.slice.dy},R}(cs);pi.registeredClasses.Slice=LI;var lC=function(U){function R(){var u=U.call(this)||this;u.className="Preloader",u.width=de(100),u.height=de(100);var w=new Wa,$=u.createChild(cs);$.shouldClone=!1;var G=$.createChild(LI);G.shouldClone=!1,G.radius=53,G.arc=360,G.fill=w.getFor("fill"),G.fillOpacity=.8,G.innerRadius=42,G.isMeasured=!1,u.backgroundSlice=G;var K=$.createChild(LI);K.shouldClone=!1,K.radius=50,K.innerRadius=45,K.fill=w.getFor("alternativeBackground"),K.fillOpacity=.2,K.isMeasured=!1,u.progressSlice=K;var re=$.createChild(tg);return re.shouldClone=!1,re.horizontalCenter="middle",re.verticalCenter="middle",re.isMeasured=!1,re.fill=w.getFor("text"),re.align="center",re.valign="middle",re.textAlign="middle",re.fillOpacity=.4,u.label=re,u.background.opacity=1,u.background.fill=w.getFor("background"),u.contentAlign="center",u.contentValign="middle",u.delay=300,u.states.create("hidden").properties.opacity=0,u.visible=!1,u.hide(0),u.__disabled=!0,u._disposers.push(u.backgroundSlice),u._disposers.push(u.progressSlice),u._disposers.push(u.label),u._disposers.push($),u}return ie(R,U),Object.defineProperty(R.prototype,"progress",{get:function(){return this.getPropertyValue("progress")},set:function(u){var w=this;this.__disabled=!1,this.validateLayout(),this.setPropertyValue("progress",u),this.progressSlice.arc=360*u,this.label&&(this.label.text=Math.round(100*u)+"%"),u>=1?(this._started&&(this._started=void 0),pi.events.once("enterframe",function(){var $=w.hide();$&&!$.isFinished()?$.events.once("animationended",function(){w.__disabled=!0}):w.__disabled=!0}),this.interactionsEnabled=!1,this.setPropertyValue("progress",0)):u>0&&(this.delay?this._started?this._started+this.delay<=new Date().getTime()&&(this.__disabled=!1,this.show(),this.interactionsEnabled=!0):this._started=new Date().getTime():(this.__disabled=!1,this.show(),this.interactionsEnabled=!0))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"delay",{get:function(){return this.getPropertyValue("delay")},set:function(u){this.setPropertyValue("delay",u)},enumerable:!0,configurable:!0}),R}(cs);pi.registeredClasses.Preloader=lC;var Y$=function(U){function R(){var u=U.call(this)||this;u.className="ResizeButton",u.orientation="horizontal",u.layout="absolute",u.horizontalCenter="middle",u.verticalCenter="middle",u.draggable=!0,u.padding(8,8,8,8),u.background.cornerRadius(20,20,20,20);var w=new yo;w.element=u.paper.add("path");var $=wn({x:-2,y:-6});return $+=Rr({x:-2,y:6}),$+=wn({x:2,y:-6}),$+=Rr({x:2,y:6}),w.path=$,w.pixelPerfect=!0,w.padding(0,4,0,4),w.stroke=new Wa().getFor("alternativeText"),w.strokeOpacity=.7,u.icon=w,u.label.dispose(),u.label=void 0,u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"orientation",{set:function(u){var w=this.icon;w&&(w.rotation=u=="horizontal"?0:-90)},enumerable:!0,configurable:!0}),R}(nC);pi.registeredClasses.ResizeButton=Y$;var X0e=function(U){function R(){var u=U.call(this)||this;u.className="CloseButton",u.padding(8,8,8,8),u.showSystemTooltip=!0,u.width=30,u.height=30;var w=new Wa;u.cursorOverStyle=Al.pointer;var $=u.background;$.cornerRadius(20,20,20,20);var G=w.getFor("background");$.fill=G,$.stroke=w.getFor("primaryButton"),$.strokeOpacity=1,$.strokeWidth=1;var K=w.getFor("primaryButtonActive"),re=$.states.getKey("hover");re.properties.strokeWidth=3,re.properties.fill=G;var ue=$.states.getKey("down");ue.properties.stroke=K,ue.properties.fill=G;var we=new yo;return we.element=u.paper.add("path"),we.stroke=$.stroke,u.icon=we,u.applyTheme(),u}return ie(R,U),R.prototype.validate=function(){U.prototype.validate.call(this);var u=this.pixelWidth/3,w=this.pixelHeight/3,$=wn({x:-u/2,y:-w/2});$+=Rr({x:u/2,y:w/2}),$+=wn({x:u/2,y:-w/2}),$+=Rr({x:-u/2,y:w/2}),this.icon.path=$,this.invalidateLayout()},R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),Te(this.readerTitle)||(this.readerTitle=this.language.translate("Close"))},R}(nC);pi.registeredClasses.CloseButton=X0e;var X$=function(U){function R(){var u=U.call(this)||this;u.className="SwitchButton",u.tooltipY=0,u.layout="horizontal",u.contentAlign="center",u.contentValign="middle",u.padding(8,16,8,16),u.setStateOnChildren=!0,u.states.create("active");var w=new Wa,$=new tg;$.fillOpacity=.3,$.states.create("active").properties.fillOpacity=1,$.isActive=!0,u.leftLabel=$;var G=new nC,K=new FI;G.contentValign="none",G.padding(0,0,0,0),K.radius=10,G.icon=K,G.icon.valign="middle",G.label=void 0;var re=de(100);G.background.cornerRadius(re,re,re,re),G.width=3.5*K.radius,G.height=2.1*K.radius,G.marginLeft=8,G.marginRight=8,G.togglable=!0,K.dx=.7*-K.radius,K.fill=w.getFor("primaryButton"),K.states.create("hover").properties.fill=w.getFor("primaryButtonHover");var ue=K.states.create("active");ue.properties.fill=w.getFor("primaryButtonActive"),ue.properties.dx=.7*K.radius,u.switchButton=G,u.events.on("toggled",function(){u.leftLabel.isActive=!u.isActive,u.rightLabel.isActive=u.isActive});var we=new tg;return we.fillOpacity=.3,we.states.create("active").properties.fillOpacity=1,u.rightLabel=we,u.role="button",u.focusable=!0,we.valign="middle",$.valign="middle",G.valign="middle",u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"leftLabel",{get:function(){return this._leftLabel},set:function(u){this._leftLabel&&this.removeDispose(this._leftLabel),this._leftLabel=u,u&&(u.parent=this,u.interactionsEnabled=!1,u.shouldClone=!1,this._disposers.push(this._leftLabel))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"rightLabel",{get:function(){return this._rightLabel},set:function(u){this._rightLabel&&this.removeDispose(this._rightLabel),this._rightLabel=u,u&&(u.parent=this,u.interactionsEnabled=!1,u.shouldClone=!1,this._disposers.push(this._rightLabel))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"switch",{get:function(){return this._switchButton},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"switchButton",{get:function(){return this._switchButton},set:function(u){this._switchButton&&this.removeDispose(this._switchButton),this._switchButton=u,u&&(u.parent=this,u.shouldClone=!1,this._disposers.push(this._switchButton))},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),u.leftLabel&&this.leftLabel.copyFrom(u.leftLabel),u.rightLabel&&this.rightLabel.copyFrom(u.rightLabel),u.switchButton&&this.switchButton.copyFrom(u.switchButton)},R}(cs);pi.registeredClasses.SwitchButton=X$;var G0=function(U){function R(){var u=U.call(this)||this;u._previousStart=0,u._previousEnd=1,u._prevStart=0,u._prevEnd=1,u._isBusy=!1,u._skipRangeEvents=!1,u.updateWhileMoving=!0,u.className="Scrollbar",u.minHeight=12,u.minWidth=12,u.animationDuration=0,u.animationEasing=$v,u.margin(10,10,10,10);var w=new Wa,$=u.background;return $.cornerRadius(10,10,10,10),$.fill=w.getFor("fill"),$.fillOpacity=.5,u.showSystemTooltip=!0,u.startGrip=new Y$,u.endGrip=new Y$,u.events.on("transformed",function(){u.updateThumb()},u,!1),u.start=0,u.end=1,u.role="scrollbar",u.thumb.role="slider",u.thumb.readerLive="polite",u.startGrip.role="slider",u.endGrip.role="slider",u.events.once("inited",function(){u._previousStart=void 0,u.dispatchRangeChange()},void 0,!1),u.hideGrips=!1,u.orientation="horizontal",u.setSVGAttribute({"aria-valuemin":"0"}),u.setSVGAttribute({"aria-valuemax":"100"}),u.applyTheme(),u}return ie(R,U),R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),this.orientation==="horizontal"?(Te(this.readerTitle)||(this.readerTitle=this.language.translate("Use TAB to select grip buttons or left and right arrows to change selection")),Te(this.thumb.readerDescription)||(this.thumb.readerDescription=this.language.translate("Use left and right arrows to move selection")),Te(this.startGrip.readerDescription)||(this.startGrip.readerDescription=this.language.translate("Use left and right arrows to move left selection")),Te(this.endGrip.readerDescription)||(this.endGrip.readerDescription=this.language.translate("Use left and right arrows to move right selection")),this.readerOrientation="horizontal"):(Te(this.readerTitle)||(this.readerTitle=this.language.translate("Use TAB select grip buttons or up and down arrows to change selection")),Te(this.thumb.readerDescription)||(this.thumb.readerDescription=this.language.translate("Use up and down arrows to move selection")),Te(this.startGrip.readerDescription)||(this.startGrip.readerDescription=this.language.translate("Use up and down arrows to move upper selection")),Te(this.endGrip.readerDescription)||(this.endGrip.readerDescription=this.language.translate("Use up and down arrows to move lower selection")),this.readerOrientation="vertical"),this.readerControls=this.baseSprite.uidAttr()},R.prototype.validateLayout=function(){this.updateSize(),U.prototype.validateLayout.call(this),this.updateExtremes()},R.prototype.processBackground=function(){U.prototype.processBackground.call(this);var u=this.background;u.clickable=!0,u.events.on("hit",this.handleBgHit,this,void 0)},R.prototype.handleBgHit=function(u){this.makeBusy();var w=u.spritePoint;w=Ip(w,this.background,this);var $=this.thumb;if(this.orientation=="horizontal"){var G=w.x-$.pixelWidth/2;G=nt(G,0,this.innerWidth-$.pixelWidth),this._thumbAnimation=$.animate({property:"x",to:G},this.animationDuration,this.animationEasing)}else{var K=w.y-$.pixelHeight/2;K=nt(K,0,this.innerHeight-$.pixelHeight),this._thumbAnimation=$.animate({property:"y",to:K},this.animationDuration,this.animationEasing)}this.animationDuration>0?this._thumbAnimation.events.on("animationended",this.makeUnbusy,this,!1):(this._thumb.validate(),this.makeUnbusy())},R.prototype.makeBusy=function(){this._isBusy=!0,this._skipRangeEvents=!1,this._unbusyTimeout&&this.removeDispose(this._unbusyTimeout),this._unbusyTimeout=void 0,this.stopAnimations()},R.prototype.stopAnimations=function(){this._thumbAnimation&&this._thumbAnimation.stop(!0),this._zoomAnimation&&this._zoomAnimation.stop(!0)},R.prototype.makeUnbusy=function(){this._unbusyTimeout=this.setTimeout(this.makeUnbusyReal.bind(this),1.1*this.animationDuration)},R.prototype.makeUnbusyReal=function(){this._usingGrip=void 0,this._isBusy=!1,this.updateWhileMoving||this.dispatchRangeChange()},R.prototype.dispatchRangeChange=function(){this._previousEnd==this.end&&this._previousStart==this.start||(this._previousStart=this.start,this._previousEnd=this.end,this.dispatch("rangechanged"))},R.prototype.updateThumb=function(u){if(u===void 0&&(u=!0),this.parent){var w=this.thumb,$=this.start,G=this.end,K=this.startGrip,re=this.endGrip;if(this.orientation=="horizontal"){var ue=this.innerWidth;w.width=ue*(G-$),w.maxX=ue-w.pixelWidth,w.x=$*ue,K.moveTo({x:w.pixelX,y:0},void 0,void 0,!0),re.moveTo({x:w.pixelX+w.pixelWidth,y:0},void 0,void 0,!0),K.readerTitle=this.language.translate("From %1",void 0,this.adapter.apply("positionValue",{value:Math.round(100*$)+"%",position:$}).value),K.readerValueNow=""+Math.round(100*$),K.readerValueText=K.readerTitle,re.readerTitle=this.language.translate("To %1",void 0,this.adapter.apply("positionValue",{value:Math.round(100*G)+"%",position:G}).value),re.readerValueNow=""+Math.round(100*G),re.readerValueText=re.readerTitle}else{var we=this.innerHeight;w.height=we*(G-$),w.maxY=we-w.pixelHeight,w.y=(1-G)*we,K.moveTo({x:0,y:w.pixelY+w.pixelHeight},void 0,void 0,!0),re.moveTo({x:0,y:w.pixelY},void 0,void 0,!0),K.readerTitle=this.language.translate("To %1",void 0,this.adapter.apply("positionValue",{value:Math.round(100*(1-$))+"%",position:1-$}).value),K.readerValueNow=""+Math.round(100*$),K.readerValueText=K.readerTitle,re.readerTitle=this.language.translate("From %1",void 0,this.adapter.apply("positionValue",{value:Math.round(100*(1-G))+"%",position:1-G}).value),re.readerValueNow=""+Math.round(100*G),re.readerValueText=re.readerTitle}w.readerTitle=this.language.translate("From %1 to %2",void 0,this.adapter.apply("positionValue",{value:Math.round(100*$)+"%",position:$}).value,this.adapter.apply("positionValue",{value:Math.round(100*G)+"%",position:G}).value),w.readerValueNow=""+Math.round(100*$),w.readerValueText=w.readerTitle,this.readerValueNow=""+Math.round(100*$),this.readerValueText=w.readerTitle,!this._skipRangeEvents&&this.updateWhileMoving&&u&&this.dispatchRangeChange()}},R.prototype.updateExtremes=function(){var u=0,w=0,$=0,G=0;this.orientation=="horizontal"?($=this.innerWidth,w=G=this.innerHeight/2):(G=this.innerHeight,u=$=this.innerWidth/2);var K=this.startGrip;K.minX=u,K.maxX=$,K.minY=w,K.maxY=G;var re=this.endGrip;re.minX=u,re.maxX=$,re.minY=w,re.maxY=G;var ue=this.thumb;ue.minX=u,ue.maxX=$,ue.minY=w,ue.maxY=G},R.prototype.updateSize=function(){var u=this.orientation,w=this.startGrip;w&&(w.orientation=u),this.endGrip&&(this.endGrip.orientation=u);var $=this.thumb;$&&(u=="horizontal"?(ae(this._pixelWidth)||this.width instanceof J||(this.width=de(100)),Te(this.percentHeight)&&(this.height=this.minHeight),$.height=this.innerHeight,$.verticalCenter="middle",$.horizontalCenter="left"):(ae(this._pixelHeight)||this.height instanceof J||(this.height=de(100)),Te(this.percentWidth)&&(this.width=this.minWidth),$.width=this.innerWidth,$.verticalCenter="top",$.horizontalCenter="middle"))},Object.defineProperty(R.prototype,"isBusy",{get:function(){return this._isBusy},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"start",{get:function(){return Math.min(this.getPosition(this._start),this.getPosition(this._end))},set:function(u){this._isBusy||(this.__start=u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"__start",{get:function(){return this._start},set:function(u){this._start=this.getPosition(u),this.updateThumb()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"end",{get:function(){return Math.max(this.getPosition(this._start),this.getPosition(this._end))},set:function(u){this._isBusy||(this.__end=u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"__end",{get:function(){return this._end},set:function(u){this._end=this.getPosition(u),this.updateThumb()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"range",{get:function(){return{start:this.start,end:this.end,priority:this._usingGrip}},enumerable:!0,configurable:!0}),R.prototype.skipRangeEvents=function(){this._isBusy||(this._skipRangeEvents=!0)},R.prototype.fixRange=function(u){u.start==ze(this._start,2)&&u.end==ze(this._end,2)||(this._start=u.start,this._end=u.end,this._skipRangeEvents=!0,this.updateThumb(),this._skipRangeEvents=!1,this.thumb.validate(),this.thumb.background.validate())},R.prototype.getPosition=function(u){return nt(ze(u,4),0,1)},Object.defineProperty(R.prototype,"orientation",{get:function(){return this.getPropertyValue("orientation")},set:function(u){this.setPropertyValue("orientation",u)&&(u==="horizontal"?(this.startGrip.cursorOverStyle=Al.horizontalResize,this.endGrip.cursorOverStyle=Al.horizontalResize):(this.startGrip.cursorOverStyle=Al.verticalResize,this.endGrip.cursorOverStyle=Al.verticalResize),this.updateByOrientation(),this.invalidate())},enumerable:!0,configurable:!0}),R.prototype.updateByOrientation=function(){},Object.defineProperty(R.prototype,"startGrip",{get:function(){return this._startGrip},set:function(u){this._startGrip&&this.removeDispose(this._startGrip),this._startGrip=u,this.processGrip(u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endGrip",{get:function(){return this._endGrip},set:function(u){this._endGrip&&this.removeDispose(this._endGrip),this._endGrip=u,this.processGrip(u)},enumerable:!0,configurable:!0}),R.prototype.processGrip=function(u){u.parent=this,u.isMeasured=!1,u.focusable=!0,u.shouldClone=!1,u.zIndex=100,u.events.on("drag",this.handleGripDrag,this,!1),u.events.on("dragstop",this.makeUnbusy,this,!1),u.events.on("down",this.makeBusy,this,!1),u.events.on("up",this.makeUnbusy,this,!1),this._disposers.push(u)},R.prototype.handleGripDrag=function(u){this.makeBusy(),u.target===this._startGrip?this._usingGrip="start":this._usingGrip="end",this.orientation=="horizontal"?(this._start=this.startGrip.pixelX/this.innerWidth,this._end=this.endGrip.pixelX/this.innerWidth):(this._start=1-this.startGrip.pixelY/this.innerHeight,this._end=1-this.endGrip.pixelY/this.innerHeight),this.updateThumb()},Object.defineProperty(R.prototype,"thumb",{get:function(){if(!this._thumb){var u=new nC;u.background.cornerRadius(10,10,10,10),u.padding(0,0,0,0),this.thumb=u}return this._thumb},set:function(u){var w=this;u&&(this._thumb&&this.removeDispose(this._thumb),this._thumb=u,u.parent=this,u.isMeasured=!1,u.inert=!0,u.draggable=!0,u.clickable=!0,u.hoverable=!0,u.focusable=!0,u.shouldClone=!1,u.zIndex=0,u.cursorOverStyle=Al.grab,u.cursorDownStyle=Al.grabbing,u.events.on("dragstart",this.makeBusy,this,!1),u.events.on("dragstop",this.makeUnbusy,this,!1),u.events.on("positionchanged",this.handleThumbPosition,this,!1),u.events.on("sizechanged",this.handleThumbPosition,this,!1),u.events.on("doublehit",this.handleDoubleClick,this,!1),this._disposers.push(Zs().body.events.on("keyup",function($){kg.isKey($.event,["space","enter"])&&w.thumb.isFocused&&($.event.preventDefault(),w.handleDoubleClick())})),this._disposers.push(this._thumb))},enumerable:!0,configurable:!0}),R.prototype.handleDoubleClick=function(){this.makeBusy();var u=0,w=1;this.start!=0||this.end!=1?(this._prevStart=this.start,this._prevEnd=this.end):(u=this._prevStart,w=this._prevEnd);var $=this.animate([{property:"__start",to:u},{property:"__end",to:w}],this.animationDuration,this.animationEasing);$&&!$.isFinished()?($.events.on("animationended",this.makeUnbusy,this,!1),this._zoomAnimation=$):this.makeUnbusy()},R.prototype.handleThumbPosition=function(){var u=this.thumb;if(this.orientation=="horizontal"){var w=this.innerWidth,$=u.innerWidth,G=u.pixelX;this._start=G/w,this._end=(G+$)/w,this.updateThumb()}else{var K=this.innerHeight,re=u.innerHeight,ue=u.pixelY;ue+re>K&&(ue=K-re,u.y=ue),this._start=1-(ue+re)/K,this._end=1-ue/K,this.updateThumb()}},R.prototype.createBackground=function(){return new Vb},Object.defineProperty(R.prototype,"hideGrips",{get:function(){return this._hideGrips},set:function(u){var w=this;this._hideGrips=u,this._overDisposer&&this.removeDispose(this._overDisposer),this._outDisposer&&this.removeDispose(this._outDisposer),u?(this._overDisposer=this.events.on("over",function(){w.startGrip.show(),w.endGrip.show()},void 0,!1),this._outDisposer=this.events.on("out",function(){w.startGrip.hide(),w.endGrip.hide()},void 0,!1),this.startGrip.hide(),this.endGrip.hide()):(this.startGrip.show(),this.endGrip.show())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"animationDuration",{get:function(){return this.getPropertyValue("animationDuration")},set:function(u){this.setPropertyValue("animationDuration",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"animationEasing",{get:function(){return this.getPropertyValue("animationEasing")},set:function(u){this.setPropertyValue("animationEasing",u)},enumerable:!0,configurable:!0}),R.prototype.asFunction=function(u){return u=="animationEasing"||U.prototype.asIs.call(this,u)},R}(cs);pi.registeredClasses.Scrollbar=G0;var Kte=function(U){function R(){var u=U.call(this)||this;return u.className="Slider",u.thumb.opacity=0,u.thumb.interactionsEnabled=!1,u.endGrip.opacity=0,u.endGrip.interactionsEnabled=!1,u.startGrip.events.on("drag",function(){u.endGrip.x=u.startGrip.x,u.endGrip.y=u.startGrip.y}),u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"__end",{get:function(){return this._start},set:function(u){},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"end",{get:function(){return this._start},set:function(u){},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"start",{get:function(){return this._start},set:function(u){this._isBusy||(this.__start=u)},enumerable:!0,configurable:!0}),R}(G0);pi.registeredClasses.Slider=Kte;var gz=function(U){function R(){var u=U.call(this)||this;u.className="TextLink",u.selectable=!0;var w=new Wa;return u.fill=w.getFor("primaryButton").brighten(.3),u.states.create("hover").properties.fill=w.getFor("primaryButtonHover").brighten(.3),u.states.create("down").properties.fill=w.getFor("primaryButtonDown").brighten(.3),u.cursorOverStyle=Al.pointer,u.applyTheme(),u}return ie(R,U),R}(tg);pi.registeredClasses.TextLink=gz;var uC=function(U){function R(){var u=U.call(this)||this;return u.properties={},u.isTemplate=!1,u._scale=1,u._nonScaling=!0,u.className="Filter",u.filterPrimitives=new to,u.properties.filterUnits="objectBoundingBox",u.filterPrimitives.events.on("inserted",function(w){u._disposers.push(w.newValue)}),u.width=120,u.height=120,u.applyTheme(),u}return ie(R,U),R.prototype.appendPrimitives=function(u){ar(this.filterPrimitives.iterator(),function(w){u.add(w)})},R.prototype.animate=function(u,w,$){return new _m(this,u,w,$).start()},Object.defineProperty(R.prototype,"width",{get:function(){return this.properties.width},set:function(u){this.properties.width=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"height",{get:function(){return this.properties.height},set:function(u){this.properties.height=u},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){var w=this;U.prototype.copyFrom.call(this,u),yi(u.properties,function($,G){w[$]=G})},Object.defineProperty(R.prototype,"paper",{get:function(){return this._paper?this._paper:Lx()},set:function(u){this._paper!=u&&(this._paper=u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"animations",{get:function(){return this._animations||(this._animations=[],this._disposers.push(new Dx(this._animations))),this._animations},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"scale",{get:function(){return this._scale},set:function(u){this._scale=u,this.updateScale()},enumerable:!0,configurable:!0}),R.prototype.updateScale=function(){},Object.defineProperty(R.prototype,"filterUnits",{get:function(){return this.properties.filterUnits},set:function(u){this.properties.filterUnits=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"nonScaling",{get:function(){return this._nonScaling},set:function(u){this._nonScaling=u,u||(this._scale=1),this.updateScale()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"sprite",{set:function(u){this.setSprite(u)},enumerable:!0,configurable:!0}),R.prototype.setSprite=function(u){this._sprite&&this._sprite!=u&&this._sprite.filters.removeValue(this),this._sprite=u},R}(Yt),Jte=function(U){function R(){var u=U.call(this)||this;return u.className="DropShadowFilter",u.color=He("#000"),u.feGaussianBlur=u.paper.add("feGaussianBlur"),u.feGaussianBlur.attr({result:"blurOut",in:"SourceGraphic"}),u.filterPrimitives.push(u.feGaussianBlur),u.feOffset=u.paper.add("feOffset"),u.feOffset.attr({result:"offsetBlur"}),u.filterPrimitives.push(u.feOffset),u.feFlood=u.paper.add("feFlood"),u.feFlood.attr({"flood-color":u.color}),u.filterPrimitives.push(u.feFlood),u.feComposite=u.paper.add("feComposite"),u.feComposite.attr({in2:"offsetBlur",operator:"in"}),u.filterPrimitives.push(u.feComposite),u.feMerge=u.paper.addGroup("feMerge"),u.feMerge.add(u.paper.add("feMergeNode")),u.feMerge.add(u.paper.add("feMergeNode").attr({in:"SourceGraphic"})),u.filterPrimitives.push(u.feMerge),u.width=200,u.height=200,u.blur=1.5,u.dx=3,u.dy=3,u.opacity=.5,u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"color",{get:function(){return this.properties.color},set:function(u){this.properties.color=u,this.feFlood&&this.feFlood.attr({"flood-color":u})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"opacity",{get:function(){return this.properties.opacity},set:function(u){this.properties.opacity=u,this.feFlood.attr({"flood-opacity":u})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dx",{get:function(){return this.properties.dx},set:function(u){this.properties.dx=u,this.feOffset.attr({dx:u/this.scale})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dy",{get:function(){return this.properties.dy},set:function(u){this.properties.dy=u,this.feOffset.attr({dy:u/this.scale})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"blur",{get:function(){return this.properties.blur},set:function(u){this.properties.blur=u,this.feGaussianBlur.attr({stdDeviation:u/this.scale})},enumerable:!0,configurable:!0}),R.prototype.updateScale=function(){this.dx=this.dx,this.dy=this.dy,this.blur=this.blur},R}(uC);pi.registeredClasses.DropShadowFilter=Jte;var NI=function(U){function R(){var u=U.call(this)||this;u._boundingRect={x:-4e4,y:-4e4,width:8e4,height:8e4},u._pointTo={x:0,y:0},u.fitPointerToBounds=!1,u._verticalOrientation="up",u.fixDoc=!0,u.className="Tooltip",u.isMeasured=!1,u.getFillFromObject=!0,u.margin(5,5,5,5),u.defaultState.transitionDuration=1,u.hiddenState.transitionDuration=1;var w=u.background;w.interactionsEnabled=!1,w.fillOpacity=.9,w.strokeWidth=1,w.strokeOpacity=1,w.stroke=He("#ffffff"),w.cornerRadius=3,w.pointerLength=6,w.pointerBaseWidth=10;var $=new Jte;$.dy=1,$.dx=1,$.opacity=.5,w.filters.push($),u.autoTextColor=!0;var G=u.createChild(tg);return G.shouldClone=!1,u.label=G,G.padding(7,12,4,12),G.interactionsEnabled=!1,G.horizontalCenter="middle",G.fill=He("#ffffff"),u._disposers.push(G),u.label.events.on("sizechanged",u.drawBackground,u),u.label.zIndex=1,u.pointerOrientation="vertical",u.animationDuration=0,u.animationEasing=$v,u.setPropertyValue("showInViewport",!1),u.role="tooltip",u.visible=!1,u.opacity=0,u.x=0,u.y=0,u.events.on("visibilitychanged",u.handleVisibility,u),u.applyTheme(),u}return ie(R,U),R.prototype.handleVisibility=function(){this.visible&&this.label.invalidate()},Object.defineProperty(R.prototype,"getStrokeFromObject",{get:function(){return this.getPropertyValue("getStrokeFromObject")},set:function(u){this.setPropertyValue("getStrokeFromObject",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"autoTextColor",{get:function(){return this.getPropertyValue("autoTextColor")},set:function(u){this.setPropertyValue("autoTextColor",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"keepTargetHover",{get:function(){return this.getPropertyValue("keepTargetHover")},set:function(u){var w=this;this.setPropertyValue("keepTargetHover",u,!0)&&u&&(this.hoverable=!0,this.background.interactionsEnabled=!0,this._disposers.push(this.events.on("over",function($){w.targetSprite&&w.targetSprite.hoverable&&(w.targetSprite.isHover=!0)})),this._disposers.push(this.events.on("out",function($){w.targetSprite&&w.targetSprite.hoverable&&(w.targetSprite.isHover=!1)})))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"showInViewport",{get:function(){return this.getPropertyValue("showInViewport")},set:function(u){this.setPropertyValue("showInViewport",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"getFillFromObject",{get:function(){return this.getPropertyValue("getFillFromObject")},set:function(u){this.setPropertyValue("getFillFromObject",u,!0)},enumerable:!0,configurable:!0}),R.prototype.createBackground=function(){return new q0e},Object.defineProperty(R.prototype,"pointerOrientation",{get:function(){return this.getPropertyValue("pointerOrientation")},set:function(u){this.setPropertyValue("pointerOrientation",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"animationDuration",{get:function(){return this.getPropertyValue("animationDuration")},set:function(u){this.setPropertyValue("animationDuration",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"animationEasing",{get:function(){return this.getPropertyValue("animationEasing")},set:function(u){this.setPropertyValue("animationEasing",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"html",{get:function(){return this.label.html},set:function(u){this.label.html!=u&&(this.label.html=u,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"text",{get:function(){return this.label.text},set:function(u){this.label.text!=u&&(this.label.text=u,this.invalidate())},enumerable:!0,configurable:!0}),R.prototype.draw=function(){U.prototype.draw.call(this);var u=this.label;u.invalid&&u.validate();var w,$,G=this._pointTo.x,K=this._pointTo.y,re=this._boundingRect,ue=u.measuredWidth,we=u.measuredHeight,De=this.background.pointerLength;if(this.ignoreBounds&&(re=void 0),re&&this.fixDoc&&ue>re.width){yr({x:re.x,y:re.y},this.parent);var Ve=yr({x:re.x+re.width,y:re.y+re.height},this.parent),Ke=document.body.offsetWidth;document.body.offsetHeight,Ve.x>Ke/2?re.x=re.width-ue:re.width=re.x+ue}var Qe=this.pointerOrientation;Qe=="horizontal"||Qe=="left"||Qe=="right"?($=-we/2,w=Qe=="horizontal"?re&&G>re.x+re.width/2?-ue/2-De:ue/2+De:Qe=="left"?ue/2+De:-ue/2-De):(re&&(w=nt(0,re.x-G+ue/2,re.x-G+re.width-ue/2)),Qe=="vertical"?re&&K>re.y+we+De?($=-we-De,this._verticalOrientation="up"):($=De,this._verticalOrientation="down"):Qe=="down"?($=-we-De,this._verticalOrientation="up"):($=De,this._verticalOrientation="down")),re&&($=nt($,re.y-K,re.y+re.height-we-K)),u.x=w,u.y=$,this.drawBackground()},R.prototype.updateBackground=function(){this.group.addToBack(this.background.group)},R.prototype.drawBackground=function(){var u=this.label,w=this.background,$=u.measuredWidth,G=u.measuredHeight,K=this._boundingRect,re=$,ue=u.pixelX-$/2,we=G,De=u.pixelY,Ve=this._pointTo.x,Ke=this._pointTo.y,Qe=K.x-Ve,ft=Qe+K.width,Gt=K.y-Ke,ei=Gt+K.height;w.x=ue,w.y=De,w.width=re,w.height=we,this.fitPointerToBounds?(w.pointerX=nt(-w.x,Qe-w.x,ft-w.x),w.pointerY=nt(-w.y,Gt-w.y,ei-w.y)):(w.pointerX=-w.x,w.pointerY=-w.y),w.validate()},R.prototype.delayedPointTo=function(u,w){var $=this;this._pointToDisposer&&this._pointToDisposer.dispose(),this._pointToDisposer=pi.events.once("exitframe",function(){$.pointTo(u,w)}),this.addDisposer(this._pointToDisposer)},R.prototype.pointTo=function(u,w){this._pointTo.x==u.x&&this._pointTo.y==u.y||(this._pointTo=u,this.invalidate(),!this.visible||w?(this.moveTo(this._pointTo),this._animation&&this._animation.kill()):this.pixelX==0&&this.pixelY==0?this.moveTo(this._pointTo):(this._animation&&this._animation.kill(),this._animation=new _m(this,[{property:"x",to:u.x,from:this.pixelX},{property:"y",to:u.y,from:this.pixelY}],this.animationDuration,this.animationEasing).start()))},R.prototype.setBounds=function(u){var w=this._boundingRect;w.x==u.x&&w.y==u.y&&w.width==u.width&&w.height==u.height||(this._boundingRect=u,this.invalidate())},Object.defineProperty(R.prototype,"boundingContainer",{set:function(u){this._boundingContainer=u,u.events.on("sizechanged",this.updateBounds,this),u.events.on("positionchanged",this.updateBounds,this)},enumerable:!0,configurable:!0}),R.prototype.updateBounds=function(){var u=this._boundingContainer,w=rt({x:u.pixelX,y:u.pixelY,width:u.maxWidth,height:u.maxHeight},u);this.setBounds(w)},Object.defineProperty(R.prototype,"ignoreBounds",{get:function(){return this.getPropertyValue("ignoreBounds")},set:function(u){this.setPropertyValue("ignoreBounds",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"verticalOrientation",{get:function(){return this._verticalOrientation},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tooltip",{get:function(){},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.label.copyFrom(u.label),u._boundingRect&&(this._boundingRect=u._boundingRect)},R.prototype.asFunction=function(u){return u=="animationEasing"||U.prototype.asIs.call(this,u)},R}(cs);pi.registeredClasses.Tooltip=NI;var yz=function(U){function R(){var u=U.call(this)||this;return u.className="Trapezoid",u.element=u.paper.add("path"),u.topSide=de(100),u.bottomSide=de(100),u.leftSide=de(100),u.rightSide=de(100),u.isMeasured=!1,u.applyTheme(),u}return ie(R,U),R.prototype.draw=function(){U.prototype.draw.call(this);var u=this.pixelWidth,w=this.pixelHeight,$=Is(this.topSide,u),G=Is(this.bottomSide,u),K=Is(this.leftSide,w),re=Is(this.rightSide,w),ue=(u-$)/2,we=(w-K)/2,De=u-(u-$)/2,Ve=(w-re)/2,Ke=u-(u-G)/2,Qe=w-(w-re)/2,ft=(u-G)/2,Gt=w-(w-K)/2,ei="",di="",ci="",qi="";if(Te(this.horizontalNeck)){var rr=this.horizontalNeck.value;ei=Rr({x:u*rr,y:Math.max(we,Ve)}),ci=Rr({x:u*rr,y:Math.min(Qe,Gt)})}if(Te(this.verticalNeck)){var Ii=this.verticalNeck.value;di=Rr({x:Math.min(De,Ke),y:w*Ii}),qi=Rr({x:Math.max(ue,ft),y:w*Ii})}var Ki=wn({x:ue,y:we})+ei+Rr({x:De,y:Ve})+di+Rr({x:Ke,y:Qe})+ci+Rr({x:ft,y:Gt})+qi;this.path=Ki},Object.defineProperty(R.prototype,"topSide",{get:function(){return this.getPropertyValue("topSide")},set:function(u){this.setPercentProperty("topSide",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"bottomSide",{get:function(){return this.getPropertyValue("bottomSide")},set:function(u){this.setPercentProperty("bottomSide",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"leftSide",{get:function(){return this.getPropertyValue("leftSide")},set:function(u){this.setPercentProperty("leftSide",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"rightSide",{get:function(){return this.getPropertyValue("rightSide")},set:function(u){this.setPercentProperty("rightSide",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"horizontalNeck",{get:function(){return this.getPropertyValue("horizontalNeck")},set:function(u){this.setPropertyValue("horizontalNeck",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"verticalNeck",{get:function(){return this.getPropertyValue("verticalNeck")},set:function(u){this.setPropertyValue("verticalNeck",u,!0)},enumerable:!0,configurable:!0}),R}(yo);pi.registeredClasses.Trapezoid=yz;var K$=function(U){function R(){var u=U.call(this)||this;return u.className="Triangle",u.element=u.paper.add("path"),u.direction="top",u.applyTheme(),u}return ie(R,U),R.prototype.draw=function(){U.prototype.draw.call(this);var u,w=this.pixelWidth,$=this.pixelHeight;switch(this.direction){case"right":u=wn({x:0,y:0})+Rr({x:w,y:$/2})+Rr({x:0,y:$})+" Z";break;case"left":u=wn({x:w,y:0})+Rr({x:0,y:$/2})+Rr({x:w,y:$})+" Z";break;case"bottom":u=wn({x:0,y:0})+Rr({x:w,y:0})+Rr({x:w/2,y:$})+" Z";break;case"top":u=wn({x:w/2,y:0})+Rr({x:w,y:$})+Rr({x:0,y:$})+" Z"}this.path=u},Object.defineProperty(R.prototype,"direction",{get:function(){return this.getPropertyValue("direction")},set:function(u){this.setPropertyValue("direction",u,!0)},enumerable:!0,configurable:!0}),R}(yo);pi.registeredClasses.Triangle=K$;var S1=function(){function U(R,u){this._tensionX=R,this._tensionY=u}return U.prototype.smooth=function(R){for(var u=R.length-1;u>0;u--){var w=R[u],$=R[u-1];Math.abs(w.x-$.x)<.1&&Math.abs(w.y-$.y)<.1&&R.splice(u-1,1)}var G=this._tensionX,K=this._tensionY;if(R.length<3||G>=1&&K>=1)return $4(R);var re=R[0],ue=R[R.length-1],we=!1;ze(re.x,3)==ze(ue.x)&&ze(re.y)==ze(ue.y)&&(we=!0);for(var De="",Ve=(u=0,R.length-1);u0){var Ke=Math.atan2(we-re,ue-K),Qe=Math.cos(Ke),ft=Math.sin(Ke),Gt=u*Qe,ei=u*ft;if(u<=1||w<=1)Ve=Rr(R);else{var di=Math.round(2*De/u),ci=[],qi=1;ue0&&(u=wn(($=this.getPoints(w))[0])+new S1(this.tension,this.tension).smooth($));var $,G=this.pixelInnerRadius;G>0&&(($=this.getPoints(G)).reverse(),u+=wn($[0])+new S1(this.tension,this.tension).smooth($)),this.path=u},R.prototype.getPoints=function(u){for(var w=u*Math.PI*2,$=this.waveHeight/2,G=w/Math.round(w/this.waveLength),K=G/2,re=[],ue=w/G,we=0;we<=ue;we++){var De=we*G/w*360,Ve=(we*G+K)/w*360;re.push({x:(u-$)*A(De),y:(u-$)*$e(De)}),re.push({x:(u+$)*A(Ve),y:(u+$)*$e(Ve)})}return re.pop(),re},Object.defineProperty(R.prototype,"innerRadius",{get:function(){return this.getPropertyValue("innerRadius")},set:function(u){this.setPercentProperty("innerRadius",u,!0,!1,10,!1),this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pixelInnerRadius",{get:function(){return Is(this.innerRadius,H(this.innerWidth/2,this.innerHeight/2))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"waveLength",{get:function(){return this.getPropertyValue("waveLength")},set:function(u){this.setPropertyValue("waveLength",u),this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"waveHeight",{get:function(){return this.getPropertyValue("waveHeight")},set:function(u){this.setPropertyValue("waveHeight",u),this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tension",{get:function(){return this.getPropertyValue("tension")},set:function(u){this.setPropertyValue("tension",u),this.invalidate()},enumerable:!0,configurable:!0}),R}(FI);pi.registeredClasses.WavedCircle=J$;var Lr=function(U){function R(){var u=U.call(this)||this;return u.className="WavedLine",u.element=u.paper.add("path"),u.waveLength=16,u.waveHeight=4,u.tension=.8,u.pixelPerfect=!1,u.fill=He(),u.applyTheme(),u}return ie(R,U),R.prototype.draw=function(){var u={x:this.x1,y:this.y1},w={x:this.x2,y:this.y2};this.path=wn(u)+C1(u,w,this.waveLength,this.waveHeight,this.tension,!0)},Object.defineProperty(R.prototype,"waveLength",{get:function(){return this.getPropertyValue("waveLength")},set:function(u){this.setPropertyValue("waveLength",u),this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"waveHeight",{get:function(){return this.getPropertyValue("waveHeight")},set:function(u){this.setPropertyValue("waveHeight",u),this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tension",{get:function(){return this.getPropertyValue("tension")},set:function(u){this.setPropertyValue("tension",u),this.invalidate()},enumerable:!0,configurable:!0}),R}(Bv),Z$=function(U){function R(){var u=U.call(this)||this;return u.className="WavedRectangle",u.element=u.paper.add("path"),u.waveLength=16,u.waveHeight=4,u.tension=.8,u.setPropertyValue("wavedLeft",!0),u.setPropertyValue("wavedRight",!0),u.setPropertyValue("wavedTop",!0),u.setPropertyValue("wavedBottom",!0),u.applyTheme(),u}return ie(R,U),R.prototype.draw=function(){U.prototype.draw.call(this);var u=this.pixelWidth,w=this.pixelHeight;if(u>0&&w>0){var $={x:0,y:0},G={x:u,y:0},K={x:u,y:w},re={x:0,y:w},ue=Math.min(u,this.waveLength),we=Math.min(w,this.waveHeight),De=Math.min(w,this.waveLength),Ve=Math.min(u,this.waveHeight),Ke="",Qe="",ft="",Gt="";this.wavedTop&&(Ke=C1($,G,ue,we,this.tension,!0)),this.wavedRight&&(Qe=C1(G,K,De,Ve,this.tension,!0)),this.wavedBottom&&(ft=C1(K,re,ue,we,this.tension,!0)),this.wavedLeft&&(Gt=C1(re,$,De,Ve,this.tension,!0)),this.path=wn($)+Ke+Rr(G)+Qe+Rr(K)+ft+Rr(re)+Gt+"z"}},Object.defineProperty(R.prototype,"waveLength",{get:function(){return this.getPropertyValue("waveLength")},set:function(u){this.setPropertyValue("waveLength",u),this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"waveHeight",{get:function(){return this.getPropertyValue("waveHeight")},set:function(u){this.setPropertyValue("waveHeight",u),this.invalidate()},enumerable:!0,configurable:!0}),R.prototype.setWavedSides=function(u,w,$,G){this.wavedTop=u,this.wavedRight=w,this.wavedBottom=$,this.wavedLeft=G},Object.defineProperty(R.prototype,"tension",{get:function(){return this.getPropertyValue("tension")},set:function(u){this.setPropertyValue("tension",u),this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"wavedRight",{get:function(){return this.getPropertyValue("wavedRight")},set:function(u){this.setPropertyValue("wavedRight",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"wavedLeft",{get:function(){return this.getPropertyValue("wavedLeft")},set:function(u){this.setPropertyValue("wavedLeft",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"wavedTop",{get:function(){return this.getPropertyValue("wavedTop")},set:function(u){this.setPropertyValue("wavedTop",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"wavedBottom",{get:function(){return this.getPropertyValue("wavedBottom")},set:function(u){this.setPropertyValue("wavedBottom",u,!0)},enumerable:!0,configurable:!0}),R}(OI),Qte=function(U){function R(){var u=U.call(this)||this;u.className="ZoomOutButton",u.padding(9,9,9,9),u.showSystemTooltip=!0;var w=new Wa,$=u.background;$.cornerRadius(20,20,20,20),$.fill=w.getFor("primaryButton"),$.stroke=w.getFor("primaryButtonStroke"),$.strokeOpacity=0,$.states.getKey("hover").properties.fill=w.getFor("primaryButtonHover"),$.states.getKey("down").properties.fill=w.getFor("primaryButtonActive");var G=new yo;G.element=u.paper.add("path");var K=wn({x:0,y:0});return K+=Rr({x:11,y:0}),G.path=K,G.pixelPerfect=!0,G.padding(8,3,8,3),G.stroke=w.getFor("primaryButtonText"),u.icon=G,u.applyTheme(),u}return ie(R,U),R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),Te(this.readerTitle)||(this.readerTitle=this.language.translate("Zoom Out"))},R}(nC);pi.registeredClasses.ZoomOutButton=Qte;var eie=function(U){function R(){var u=U.call(this)||this;u.className="PlayButton",u.padding(12,12,12,12),u.showSystemTooltip=!0;var w=new Wa,$=u.background;$.cornerRadius(25,25,25,25),$.fill=w.getFor("primaryButton"),$.stroke=w.getFor("primaryButtonStroke"),$.strokeOpacity=0,$.states.getKey("hover").properties.fill=w.getFor("primaryButtonHover"),$.states.getKey("down").properties.fill=w.getFor("primaryButtonActive");var G=new K$;G.direction="right",G.width=9,G.height=11,G.marginLeft=1,G.marginRight=1,G.horizontalCenter="middle",G.verticalCenter="middle",G.stroke=w.getFor("primaryButtonText"),G.fill=G.stroke,u.icon=G;var K=new Vb;K.width=11,K.height=11,K.horizontalCenter="middle",K.verticalCenter="middle",K.cornerRadius(0,0,0,0),K.stroke=w.getFor("primaryButtonText"),K.fill=G.stroke,u.togglable=!0;var re=u.states.create("active");return re.transitionDuration=0,re.properties.icon=K,u.defaultState.transitionDuration=0,u.applyTheme(),u}return ie(R,U),R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),Te(this.readerTitle)||(this.readerTitle=this.language.translate("Play"))},R}(nC);pi.registeredClasses.PlayButton=eie;var Zn=function(U){function R(){var u=U.call(this)||this;return u.className="ColorModifier",u.applyTheme(),u}return ie(R,U),R.prototype.modify=function(u){return u},R}(Yt);pi.registeredClasses.ColorModifier=Zn;var tie=function(U){function R(){var u=U.call(this)||this;return u.lightnesses=[],u.brightnesses=[],u.opacities=[],u.offsets=[],u.className="GradientModifier",u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"lightnesses",{get:function(){return this._lightnesses},set:function(u){this._lightnesses=u,this._brightnesses=[]},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"brightnesses",{get:function(){return this._brightnesses},set:function(u){this._brightnesses=u,this._lightnesses=[]},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"opacities",{get:function(){return this._opacities},set:function(u){this._opacities=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"offsets",{get:function(){return this._offsets},set:function(u){this._offsets=u},enumerable:!0,configurable:!0}),R.prototype.modify=function(u){this.gradient.clear();var w=0;this.opacities&&(w=ye(w,this.opacities.length)),this.lightnesses&&(w=ye(w,this.lightnesses.length)),this.brightnesses&&(w=ye(w,this.brightnesses.length));for(var $,G,K=1,re=0;re0&&this.depth>0){this.sideB.show(0),this.sideA.show(0),this.edge.show(0);for(var u=this.startAngle,w=this.arc,$=this.pixelInnerRadius||0,G=this.radiusY||0,K=this.radius,re=u+w,ue=G/K*$,we={x:A(u)*$,y:$e(u)*ue},De={x:A(u)*K,y:$e(u)*G},Ve={x:A(re)*K,y:$e(re)*G},Ke={x:A(re)*$,y:$e(re)*ue},Qe=this.depth,ft={x:we.x,y:we.y-Qe},Gt={x:De.x,y:De.y-Qe},ei={x:Ve.x,y:Ve.y-Qe},di={x:Ke.x,y:Ke.y-Qe},ci="",qi=Math.ceil(w/5),rr=w/qi,Ii=u,Ki=Gt,pr=0;pr0&&Ii<180){ci+=wn(Ki);var kr={x:A(Ii)*K,y:$e(Ii)*G-Qe};ci+=Rr({x:Ki.x,y:Ki.y+Qe}),ci+=j0({x:kr.x,y:kr.y+Qe},K,G,!0),ci+=Rr(kr),ci+=j0(Ki,K,G),ci+="z",Ki=kr}else ci+=wn(Ki),ci+=j0(kr={x:A(Ii)*K,y:$e(Ii)*G-Qe},K,G,!0),ci+=Rr({x:kr.x,y:kr.y+Qe}),ci+=j0({x:Ki.x,y:Ki.y+Qe},K,G),ci+=Rr(Ki),ci+="z",Ki=kr;for(Ki=ft,Ii=u,pr=0;pr0&&Ii<180?(ci+=wn(Ki),kr={x:A(Ii)*$,y:$e(Ii)*ue-Qe},ci+=Rr({x:Ki.x,y:Ki.y+Qe}),ci+=j0({x:kr.x,y:kr.y+Qe},$,ue,!0),ci+=Rr(kr),ci+=j0(Ki,$,ue),ci+="z",Ki=kr):(ci+=wn(Ki),ci+=j0(kr={x:A(Ii)*$,y:$e(Ii)*ue-Qe},$,ue,!0),ci+=Rr({x:kr.x,y:kr.y+Qe}),ci+=j0({x:Ki.x,y:Ki.y+Qe},$,ue),ci+=Rr(Ki),ci+="z",Ki=kr);this.edge.path=ci,this.sideA.path=wn(we)+Rr(De)+Rr(Gt)+Rr(ft)+" Z",this.sideB.path=wn(Ve)+Rr(Ke)+Rr(di)+Rr(ei)+" Z",this.startAngle<90?this.sideA.toBack():this.sideA.toFront(),this.startAngle+this.arc>90?this.sideB.toBack():this.sideB.toFront(),this.slice.dy=-Qe}else this.sideA.hide(0),this.sideB.hide(0),this.edge.hide(0)},Object.defineProperty(R.prototype,"depth",{get:function(){return this.getPropertyValue("depth")},set:function(u){this.setPropertyValue("depth",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"angle",{get:function(){var u=this.getPropertyValue("angle");return ae(u)||(u=0),u},set:function(u){this.setPropertyValue("angle",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radiusY",{get:function(){var u=this.getPropertyValue("radiusY");return ae(u)||(u=this.radius-this.radius*this.angle/90),u},set:function(u){this.setPropertyValue("radiusY",u,!0)},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.edge.copyFrom(u.edge),this.sideA.copyFrom(u.sideA),this.sideB.copyFrom(u.sideB)},R}(LI),iie=function(U){function R(){var u=U.call(this)||this;return u.className="RadialGradientModifier",u.gradient=new Ly,u.applyTheme(),u}return ie(R,U),R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.gradient=u.gradient.clone()},R}(tie);pi.registeredClasses.RadialGradientModifier=iie;var rie=function(U){function R(){var u=U.call(this)||this;return u.properties.gap=0,u._line=u.paper.add("path"),u.addElement(u._line),u}return ie(R,U),R.prototype.draw=function(){if(U.prototype.draw.call(this),Math.round(this.rotation/90)!=this.rotation/90&&(this.properties.shapeRendering="auto"),this._line){var u=this.width,w=this.height,$="";if(this.gap)for(var G=this.gap+this.strokeWidth,K=this.height/G,re=-K/2;re<1.5*K;re++)Math.round(this.rotation/90)!=this.rotation/90?($+=wn({x:-u,y:(re+.5)*G})+Rr({x:2*u,y:(re+.5)*G}),this.properties.rotationX=this.width/2,this.properties.rotationY=this.height/2):$+=wn({x:-u,y:re*G})+Rr({x:2*u,y:re*G});else Math.round(this.rotation/90)!=this.rotation/90?($=wn({x:-u,y:w/2})+Rr({x:2*u,y:w/2}),this.properties.rotationX=this.width/2,this.properties.rotationY=this.height/2):$=wn({x:0,y:0})+Rr({x:u,y:0});this._line.attr({d:$})}},Object.defineProperty(R.prototype,"gap",{get:function(){return this.properties.gap},set:function(u){this.properties.gap=u,this.draw()},enumerable:!0,configurable:!0}),R}(b1);pi.registeredClasses.LinePattern=rie;var Q$=function(U){function R(){var u=U.call(this)||this;return u.properties.radius=2,u._circle=u.paper.add("circle"),u.addElement(u._circle),u.shapeRendering="auto",u}return ie(R,U),R.prototype.draw=function(){U.prototype.draw.call(this),this._circle&&this._circle.attr({r:this.radius,cx:this.width/2,cy:this.height/2})},Object.defineProperty(R.prototype,"radius",{get:function(){return this.properties.radius},set:function(u){this.properties.radius=u,this.draw()},enumerable:!0,configurable:!0}),R}(b1);pi.registeredClasses.CirclePattern=Q$;var Vg=function(U){function R(){var u=U.call(this)||this;return u.rectHeight=1,u.rectWidth=1,u._rect=u.paper.add("rect"),u.addElement(u._rect),u}return ie(R,U),R.prototype.draw=function(){U.prototype.draw.call(this),this.properties.rotationX=this.width/2,this.properties.rotationY=this.height/2,this._rect&&this._rect.attr({width:this.rectWidth,height:this.rectHeight,x:(this.width-this.rectWidth)/2,y:(this.height-this.rectHeight)/2})},Object.defineProperty(R.prototype,"rectWidth",{get:function(){return this.properties.rectWidth},set:function(u){this.properties.rectWidth=u,this.draw()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"rectHeight",{get:function(){return this.properties.rectHeight},set:function(u){this.properties.rectHeight=u,this.draw()},enumerable:!0,configurable:!0}),R}(b1);pi.registeredClasses.RectPattern=Vg;var tve=function(U){function R(){var u=U.call(this)||this;return u.className="ColorizeFilter",u.feColorMatrix=u.paper.add("feColorMatrix"),u.feColorMatrix.attr({type:"matrix"}),u.filterPrimitives.push(u.feColorMatrix),u.intensity=1,u.applyTheme(),u}return ie(R,U),R.prototype.applyFilter=function(){var u,w,$,G=this.intensity,K=1-G,re=this.color;re&&re.rgb?(u=re.rgb.r/255*G,w=re.rgb.g/255*G,$=re.rgb.b/255*G):(u=0,w=0,$=0),this.feColorMatrix.attr({values:K+" 0 0 0 "+u+" 0 "+K+" 0 0 "+w+" 0 0 "+K+" 0 "+$+" 0 0 0 1 0"})},Object.defineProperty(R.prototype,"color",{get:function(){return this.properties.color},set:function(u){this.properties.color=u,this.applyFilter()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"intensity",{get:function(){return this.properties.intensity},set:function(u){this.properties.intensity=u,this.applyFilter()},enumerable:!0,configurable:!0}),R}(uC);pi.registeredClasses.ColorizeFilter=tve;var e8=function(U){function R(){var u=U.call(this)||this;return u.className="DesaturateFilter",u.feColorMatrix=u.paper.add("feColorMatrix"),u.feColorMatrix.attr({type:"saturate"}),u.filterPrimitives.push(u.feColorMatrix),u.width=120,u.height=120,u.saturation=0,u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"saturation",{get:function(){return this.properties.saturation},set:function(u){this.properties.saturation=u,this.feColorMatrix.attr({values:u.toString()})},enumerable:!0,configurable:!0}),R}(uC);pi.registeredClasses.DesaturateFilter=e8;var ive=function(U){function R(){var u=U.call(this)||this;return u.className="BlurFilter",u.feGaussianBlur=u.paper.add("feGaussianBlur"),u.feGaussianBlur.attr({result:"blurOut",in:"SourceGraphic"}),u.filterPrimitives.push(u.feGaussianBlur),u.width=200,u.height=200,u.blur=1.5,u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"blur",{get:function(){return this.properties.blur},set:function(u){this.properties.blur=u,this.feGaussianBlur.attr({stdDeviation:u/this.scale})},enumerable:!0,configurable:!0}),R}(uC);pi.registeredClasses.BlurFilter=ive;var rve=function(U){function R(){var u=U.call(this)||this;return u.className="FocusFilter",u.feFlood=u.paper.add("feFlood"),u.feFlood.attr({"flood-color":new Wa().getFor("primaryButtonHover"),result:"base"}),u.filterPrimitives.push(u.feFlood),u.feMorphology=u.paper.add("feMorphology"),u.feMorphology.attr({result:"bigger",in:"SourceGraphic",operator:"dilate",radius:"2"}),u.filterPrimitives.push(u.feMorphology),u.feColorMatrix=u.paper.add("feColorMatrix"),u.feColorMatrix.attr({result:"mask",in:"bigger",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0"}),u.filterPrimitives.push(u.feColorMatrix),u.feComposite=u.paper.add("feComposite"),u.feComposite.attr({result:"drop",in:"base",in2:"mask",operator:"in"}),u.filterPrimitives.push(u.feComposite),u.feBlend=u.paper.add("feBlend"),u.feBlend.attr({in:"SourceGraphic",in2:"drop",mode:"normal"}),u.filterPrimitives.push(u.feBlend),u.width=130,u.height=130,u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"stroke",{get:function(){return this.properties.stroke},set:function(u){this.properties.stroke=u,this.feFlood.attr({"flood-color":u})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"strokeWidth",{get:function(){return this.properties.strokeWidth},set:function(u){this.properties.strokeWidth=u,this.feMorphology.attr({radius:u})},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"opacity",{get:function(){return this.properties.opacity},set:function(u){this.properties.opacity=u,this.feColorMatrix.attr({values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 "+u+" 0"})},enumerable:!0,configurable:!0}),R.prototype.setSprite=function(u){this._sprite&&this._sprite!=u&&this._sprite.group.removeStyle("outline"),u.group.addStyle({outline:"none"}),U.prototype.setSprite.call(this,u)},R}(uC),ig=function(U){function R(){var u=U.call(this)||this;return u._list=[],u._currentStep=0,u._startIndex=0,u._currentPass=0,u.baseColor=new Ee({r:103,g:183,b:220}),u.stepOptions={},u.passOptions={brighten:-.2},u.step=1,u.minColors=20,u.minLightness=.2,u.maxLightness=.9,u.shuffle=!1,u.wrap=!0,u.reuse=!1,u.saturation=1,u.className="ColorSet",u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"list",{get:function(){return this._list||this.generate(this.minColors),this._list},set:function(u){this._list=u,this.reset()},enumerable:!0,configurable:!0}),R.prototype.getReusableColor=function(u){if(this._list.length==0)return this.generate(1),this.list[0];var w=u-Math.floor(u/this._list.length)*this.list.length;return this.list[w]},R.prototype.next=function(){var u;return this.list.length<=this._currentStep?this.reuse?u=this.getReusableColor(this._currentStep):(this.generate(ye(this.minColors,this._currentStep+1)),u=this.list[this._currentStep]):u=this.list[this._currentStep],this._currentStep+=this.step,u.saturate(this.saturation)},R.prototype.getIndex=function(u){var w;return this.list.length<=u?this.reuse?w=this.getReusableColor(u):(this.generate(this.minColors),w=this.getIndex(u)):w=this.list[u],w.saturate(this.saturation)},R.prototype.reset=function(){this._currentStep=this._startIndex},Object.defineProperty(R.prototype,"currentStep",{get:function(){return this._currentStep},set:function(u){this._currentStep=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startIndex",{get:function(){return this._startIndex},set:function(u){this._startIndex=u,this.reset()},enumerable:!0,configurable:!0}),R.prototype.generate=function(u){var w=ne(je(this.currentColor.rgb)),$=Te(this.stepOptions.hue)?this.stepOptions.hue:1/u,G={brighten:0,lighten:0,hue:w.h,lightness:w.l,saturation:w.s},K=[],re=this.list.length==0?0:1;if(this.reuse)for(var ue=re;ue<=u;ue++)K.push(ne(je(this._list[ue].rgb)).h);else for(ue=re;ue<=u;ue++){var we=w.h+$*ue;this.wrap&&we>1&&(we-=1),K.push(we)}for(this.shuffle&&K.sort(function(Qe,ft){return Math.random()-.5}),ue=0;ue1?u.l=u.l-Math.floor(u.l):u.l<0&&(u.l=-(u.l-Math.floor(u.l))),u.l=k0(u.l,this.minLightness,this.maxLightness)):(u.l>1?u.l=1:u.l<0&&(u.l=0),u.l=Ng(u.l,this.minLightness,this.maxLightness))},R.prototype.processConfig=function(u){if(u){if(Te(u.list)&&wt(u.list))for(var w=0,$=u.list.length;w<$;w++)u.list[w]instanceof Ee||(u.list[w]=He(u.list[w]));!Te(u.baseColor)||u.baseColor instanceof Ee||(u.baseColor=He(u.baseColor))}U.prototype.processConfig.call(this,u)},R}(Yt);pi.registeredClasses.ColorSet=ig;var nie=function(U){function R(){var u=U.call(this)||this;u._list=[],u._currentStep=0,u._startIndex=0,u._currentPass=0,u.baseColor=new Ee({r:103,g:183,b:220}),u.className="PatternSet";var w=new Wa;return u.list=[u.getLinePattern(1e3,45,1,6),u.getRectPattern(10,0,4),u.getLinePattern(1e3,-45,1,6),u.getCirclePattern(11,2,!0),u.getLinePattern(6,90,1),u.getRectPattern(12,45,6,!0),u.getLinePattern(6,0,1),u.getRectPattern(7,0,4),u.getLinePattern(1e3,45,2,3,"4,2"),u.getCirclePattern(9,3,!1),u.getLinePattern(1e3,-45,2,3,"4,2"),u.getRectPattern(10,45,Math.sqrt(50)),u.getLinePattern(1e3,-45,2,1),u.getRectPattern(10,0,9),u.getLinePattern(1e3,45,2,1),u.getLinePattern(1e3,0,3,1),u.getRectPattern(10,45,10),u.getLinePattern(1e3,90,3,1)],u.baseColor=w.getFor("stroke"),u.applyTheme(),u}return ie(R,U),R.prototype.getLinePattern=function(u,w,$,G,K){var re=new rie;return re.width=u,re.height=u,re.stroke=this.baseColor,re.gap=G,re.strokeDasharray=K,re.strokeWidth=$,re.rotation=w,re},R.prototype.getRectPattern=function(u,w,$,G){var K=new Vg;return K.width=u,K.height=u,K.rectWidth=$,K.rectHeight=$,G?(K.stroke=this.baseColor,K.strokeWidth=1,K.fillOpacity=0):(K.fill=this.baseColor,K.strokeWidth=0),w!=0&&(K.shapeRendering="auto"),K.rotation=w,K},R.prototype.getCirclePattern=function(u,w,$){var G=new Q$;return G.width=u,G.height=u,G.shapeRendering="auto",G.radius=w,$?(G.stroke=this.baseColor,G.strokeWidth=1,G.fillOpacity=0):(G.fill=this.baseColor,G.strokeWidth=0),G},Object.defineProperty(R.prototype,"list",{get:function(){return this._list},set:function(u){this._list=u,this.reset()},enumerable:!0,configurable:!0}),R.prototype.next=function(){var u=this.getIndex(this.currentStep);return this._currentStep++,u},R.prototype.getIndex=function(u){for(;this.list.length<=u;)this.generatePatterns();return this.list[u].clone()},R.prototype.generatePatterns=function(){var u=this.list.length/(this._currentPass+1);this._currentPass++;for(var w=0;w=0){pi.queue.splice(pi.queue.indexOf(U),1);var u=pi.queue[R];u&&ove(u)}}function r9e(U){U.__disabled&&SI(U.htmlContainer,rp.viewportTarget)&&(U.vpDisposer&&U.vpDisposer.dispose(),i9e(U))}function ove(U){U&&U.tooltipContainer&&(U.__disabled=!1,U.tooltipContainer.__disabled=!1,U.events.enableType("appeared"),U.dispatch("removedfromqueue"),U.showOnInit&&U.events.on("appeared",function(){wz(U)}),U.vpDisposer&&U.vpDisposer.dispose(),U instanceof cs&&U.invalidateLabels(),U.tooltipContainer&&U.tooltipContainer.invalidateLayout(),U instanceof DI?(U.invalidateData(),U.reinit(),U.events.once("datavalidated",function(){U.showOnInit?U.appear():wz(U)})):(U.reinit(),U.events.once("inited",function(){wz(U)}),U.showOnInit&&U.appear()))}function n9e(U,R){var u;ct(R)&&(Te(pi.registeredClasses[R])?R=pi.registeredClasses[R]:(R=pi.registeredClasses.Container,u=new Error("Class ["+R+"] is not loaded.")));var w=sie(U,R);return u&&w.raiseCriticalError(u),w}function s9e(U,R,u){var w,$;Te(u)||(u=U.type,delete U.type),Te(R)||(R=U.container,delete U.container),ct(u)&&Te(pi.registeredClasses[u])?w=pi.registeredClasses[u]:typeof u!="function"?(w=cs,$=new Error("Class ["+u+"] is not loaded.")):w=u;var G=sie(R,w);return $?G.raiseCriticalError($):G.config=U,G}function o9e(U,R){for(var u=[],w=2;w10&&(u.properties.paddingLeft=10),U.pixelPaddingRight>10&&(u.properties.paddingRight=10),u}return null}}),sp.push({relevant:Mf.heightXS,state:function(U,R){if(U instanceof kx){var u=U.states.create(R);return U.pixelPaddingTop>10&&(u.properties.paddingTop=10),U.pixelPaddingBottom>10&&(u.properties.paddingBottom=10),u}return null}}),sp.push({relevant:Mf.widthXXS,state:function(U,R){if(U instanceof kx){var u=U.states.create(R);return u.properties.paddingLeft=0,u.properties.paddingRight=0,u}return null}}),sp.push({relevant:Mf.heightXXS,state:function(U,R){if(U instanceof kx){var u=U.states.create(R);return u.properties.paddingTop=0,u.properties.paddingBottom=0,u}return null}});var zo=function(U){function R(){var u=U.call(this)||this;return u.className="Bullet",u.isMeasured=!1,u.tooltipX=0,u.tooltipY=0,u.layout="none",u.applyOnClones=!0,u.copyToLegendMarker=!0,u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"locationX",{get:function(){return this.getPropertyValue("locationX")},set:function(u){if(this.setPropertyValue("locationX",u)){var w=this.dataItem;w&&w.component&&w.component.invalidate()}},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"locationY",{get:function(){return this.getPropertyValue("locationY")},set:function(u){if(this.setPropertyValue("locationY",u)){var w=this.dataItem;w&&w.component&&w.component.invalidate()}},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"xField",{get:function(){return this.getPropertyValue("xField")},set:function(u){this.setPropertyValue("xField",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"yField",{get:function(){return this.getPropertyValue("yField")},set:function(u){this.setPropertyValue("yField",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"isDynamic",{get:function(){return this.getPropertyValue("isDynamic")},set:function(u){this.setPropertyValue("isDynamic",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"copyToLegendMarker",{get:function(){return this.getPropertyValue("copyToLegendMarker")},set:function(u){this.setPropertyValue("copyToLegendMarker",u)},enumerable:!0,configurable:!0}),R}(cs);pi.registeredClasses.Bullet=zo,sp.push({relevant:Mf.isXS,state:function(U,R){if(U instanceof zo){var u=U.states.create(R);return u.properties.disabled=!0,u}return null}});var xz=function(U){function R(){var u=U.call(this)||this;return u.childrenCreated=!1,u.className="LegendDataItem",u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"label",{get:function(){var u=this;if(!this._label){var w=this.component.labels.create();this._label=w,this.addSprite(w),this._disposers.push(w),w.parent=this.itemContainer,this._disposers.push(new Kr(function(){Te(u.component)&&u.component.labels.removeValue(w)}))}return this._label},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"color",{get:function(){return this.properties.color},set:function(u){this.setProperty("color",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"valueLabel",{get:function(){var u=this;if(!this._valueLabel){var w=this.component.valueLabels.create();this._valueLabel=w,this.addSprite(w),this._disposers.push(w),w.parent=this.itemContainer,this._disposers.push(new Kr(function(){Te(u.component)&&u.component.valueLabels.removeValue(w)}))}return this._valueLabel},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"itemContainer",{get:function(){var u=this;if(!this._itemContainer){var w=this.component,$=w.itemContainers.create();$.parent=w,this._itemContainer=$,this.addSprite($),this._disposers.push($),$.togglable&&$.events.on("toggled",function(re){w.toggleDataItem(re.target.dataItem)},void 0,!1),$.focusable&&($.events.on("hit",function(re){w.focusedItem=void 0},void 0,!1),$.events.on("focus",function(re){w.focusedItem=re.target.dataItem},void 0,!1),$.events.on("blur",function(re){w.focusedItem=void 0},void 0,!1)),this._disposers.push(new Kr(function(){Te(u.component)&&u.component.itemContainers.removeValue($)})),this.dataContext.uidAttr&&($.readerControls=this.dataContext.uidAttr(),$.readerLabelledBy=this.dataContext.uidAttr());var G=this.dataContext;if((G instanceof MI||G instanceof yo)&&!G.isDisposed()){var K=function(re){$.readerChecked=re.visible,$.events.disableType("toggled"),$.isActive=!re.visible,$.events.enableType("toggled")};G.addDisposer(new Kr(function(){u.component&&u.component.dataItems.remove(u)})),G instanceof yo?($.addDisposer(G.events.on("visibilitychanged",K,void 0,!1)),$.addDisposer(G.events.on("hidden",function(re){$.readerChecked=!1,$.events.disableType("toggled"),$.isActive=!0,$.events.enableType("toggled")},void 0,!1)),$.addDisposer(G.events.on("shown",function(re){$.readerChecked=!0,$.events.disableType("toggled"),$.isActive=!1,$.events.enableType("toggled")},void 0,!1))):$.addDisposer(G.events.on("visibilitychanged",K,void 0,!1))}}return this._itemContainer},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"marker",{get:function(){var u=this;if(!this._marker){var w=this.component.markers.create();this._marker=w,w.parent=this.itemContainer,this.addSprite(w),this._disposers.push(w),this._disposers.push(new Kr(function(){Te(u.component)&&u.component.markers.removeValue(w)}))}return this._marker},enumerable:!0,configurable:!0}),R}(MI),aie=function(){this.createMarker=!0},i8=function(U){function R(){var u=U.call(this)||this;u.className="Legend",u.layout="grid",u.setPropertyValue("useDefaultMarker",!1),u.setPropertyValue("scrollable",!1),u.setPropertyValue("contentAlign","center");var w=new cs;w.applyOnClones=!0,w.padding(8,0,8,0),w.margin(0,10,0,10),w.layout="horizontal",w.clickable=!0,w.focusable=!0,w.role="switch",w.togglable=!0,w.cursorOverStyle=Al.pointer,w.background.fillOpacity=0,u.itemContainers=new lo(w),u._disposers.push(new ua(u.itemContainers)),u._disposers.push(u.itemContainers.template),u._disposers.push(Zs().body.events.on("keyup",function(De){if(kg.isKey(De.event,"enter")&&u.focusedItem){var Ve=u.focusedItem,Ke=Ve.itemContainer;Ke.togglable?u.toggleDataItem(Ve):Ke.clickable&&Ke.events.isEnabled("hit")&&(Ke.dispatchImmediately("hit",{event:De}),u.focusedItem=Ve)}},u));var $=new Wa,G=new cs;G.width=23,G.height=23,G.interactionsEnabled=!1,G.applyOnClones=!0,G.setStateOnChildren=!0,G.background.fillOpacity=0,G.background.strokeOpacity=0,G.propertyFields.fill="fill",G.valign="middle";var K=$.getFor("disabledBackground");G.events.on("childadded",function(De){var Ve=De.newValue.states.create("active");Ve.properties.stroke=K,Ve.properties.fill=K}),u.markers=new lo(G),u._disposers.push(new ua(u.markers)),u._disposers.push(u.markers.template);var re=G.createChild(Vb);re.width=de(100),re.height=de(100),re.applyOnClones=!0,re.propertyFields.fill="fill",re.strokeOpacity=0;var ue=new tg;ue.text="{name}",ue.margin(0,5,0,5),ue.valign="middle",ue.applyOnClones=!0,ue.states.create("active").properties.fill=$.getFor("disabledBackground"),u.labels=new lo(ue),u._disposers.push(new ua(u.labels)),u._disposers.push(u.labels.template),ue.interactionsEnabled=!1,ue.truncate=!0,ue.fullWords=!1;var we=new tg;return we.margin(0,5,0,0),we.valign="middle",we.width=50,we.align="right",we.textAlign="end",we.applyOnClones=!0,we.states.create("active").properties.fill=$.getFor("disabledBackground"),we.interactionsEnabled=!1,u.valueLabels=new lo(we),u._disposers.push(new ua(u.valueLabels)),u._disposers.push(u.valueLabels.template),u.position="bottom",w.states.create("active"),w.setStateOnChildren=!0,u.role="group",u.events.on("layoutvalidated",u.handleScrollbar,u,!1),u.applyTheme(),u}return ie(R,U),R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),Te(this.readerTitle)||(this.readerTitle=this.language.translate("Legend"))},R.prototype.createDataItem=function(){return new xz},R.prototype.validateDataElements=function(){this.scrollbar&&(this.scrollbar.start=0,this.scrollbar.end=1),U.prototype.validateDataElements.call(this)},R.prototype.validateDataElement=function(u){U.prototype.validateDataElement.call(this,u);var w=u.itemContainer,$=u.marker;u.label;var G=u.valueLabel;w.readerChecked=u.dataContext.visible,u.dataContext.legendDataItem=u;var K=u.label.maxWidth;u.label.width instanceof J||(u.label.width=void 0),K>0&&(u.label.maxWidth=K),G.align=="right"&&(G.width=void 0);var re=u.dataContext.legendSettings,ue=u.dataContext;!ue.createLegendMarker||this.useDefaultMarker&&ue instanceof yo?this.markers.template.propertyFields.fill=void 0:u.childrenCreated||(ue.createLegendMarker($),u.childrenCreated=!0),ue.updateLegendValue&&ue.updateLegendValue(),ue.component&&ue.component.updateLegendValue&&ue.component.updateLegendValue(ue),G.invalid&&G.validate(),G.text==""||G.text==null?G.__disabled=!0:G.__disabled=!1,!re||re.itemValueText==null&&re.valueText==null||(G.__disabled=!1);var we=u.dataContext.visible;we===void 0&&(we=!0),we=Ct(we),u.dataContext.visible=we,w.events.disableType("toggled"),w.isActive=!we,w.isActive?w.setState("active",0):w.setState("default",0),w.events.enableType("toggled")},R.prototype.afterDraw=function(){var u=this,w=this.getPropertyValue("maxWidth"),$=0;this.labels.each(function(Ve){Ve.invalid&&(Ve.maxWidth=void 0,Ve.validate()),Ve.measuredWidth+Ve.pixelMarginLeft+Ve.pixelMarginRight>$&&($=Ve.measuredWidth+Ve.pixelMarginLeft+Ve.pixelMarginRight)});var G=0;this.valueLabels.each(function(Ve){Ve.invalid&&Ve.validate(),Ve.measuredWidth+Ve.pixelMarginLeft+Ve.pixelMarginRight>G&&(G=Ve.measuredWidth+Ve.pixelMarginLeft+Ve.pixelMarginRight)});var K=0;this.markers.each(function(Ve){Ve.invalid&&Ve.validate(),Ve.measuredWidth+Ve.pixelMarginLeft+Ve.pixelMarginRight>K&&(K=Ve.measuredWidth+Ve.pixelMarginLeft+Ve.pixelMarginRight)});var re,ue=this.itemContainers.template,we=ue.pixelMarginRight+ue.pixelMarginLeft,De=$+G+K;ae(w)?((w-=we)>De&&(w=De),re=w-K-G):re=$,this.labels.each(function(Ve){(u.valueLabels.template.align=="right"||Ve.measuredWidth>re)&&(Ve.width instanceof J||(Ve.width=Math.min(Ve.maxWidth,re-Ve.pixelMarginLeft-Ve.pixelMarginRight),Ve.maxWidth=Ve.width))}),this.valueLabels.template.align=="right"&&this.valueLabels.each(function(Ve){Ve.width=G-Ve.pixelMarginRight-Ve.pixelMarginLeft}),U.prototype.afterDraw.call(this)},R.prototype.handleScrollbar=function(){var u=this.scrollbar;this.scrollable&&u&&(u.height=this.measuredHeight,u.x=this.measuredWidth-u.pixelWidth-u.pixelMarginLeft,this.contentHeight>this.measuredHeight?(u.visible=!0,u.thumb.height=u.height*this.measuredHeight/this.contentHeight,this.paddingRight=u.pixelWidth+u.pixelMarginLeft+ +u.pixelMarginRight):u.visible=!1,u.handleThumbPosition(),this.updateMasks())},Object.defineProperty(R.prototype,"position",{get:function(){return this.getPropertyValue("position")},set:function(u){this.setPropertyValue("position",u)&&(u=="left"||u=="right"?(this.margin(10,5,10,10),this.valign="middle",this.contentAlign="none",this.valueLabels.template.align="right",ae(this.maxColumns)||(this.maxColumns=1),this.width=void 0,this.maxWidth=220):(this.maxColumns=void 0,this.width=de(100),this.valueLabels.template.align="left"),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"useDefaultMarker",{get:function(){return this.getPropertyValue("useDefaultMarker")},set:function(u){this.setPropertyValue("useDefaultMarker",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"scrollable",{get:function(){return this.getPropertyValue("scrollable")},set:function(u){if(this.setPropertyValue("scrollable",u,!0))if(u){var w=this.createChild(G0);this.scrollbar=w,w.isMeasured=!1,w.orientation="vertical",w.endGrip.__disabled=!0,w.startGrip.__disabled=!0,w.visible=!1,w.marginLeft=5,this._mouseWheelDisposer=this.events.on("wheel",this.handleWheel,this,!1),this._disposers.push(this._mouseWheelDisposer),this._disposers.push(w.events.on("rangechanged",this.updateMasks,this,!1))}else this._mouseWheelDisposer&&(this._mouseWheelDisposer.dispose(),this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=void 0))},enumerable:!0,configurable:!0}),R.prototype.handleWheel=function(u){var w=u.shift.y,$=this.scrollbar;if($){var G=w/1e3*this.measuredHeight/this.contentHeight,K=$.end-$.start;w>0?($.start=ye(0,$.start-G),$.end=$.start+K):($.end=H(1,$.end-G),$.start=$.end-K)}},R.prototype.updateMasks=function(){var u=this;this.scrollbar&&this.itemContainers.each(function(w){w.dy=-u.scrollbar.thumb.pixelY*u.contentHeight/u.measuredHeight,w.maskRectangle={x:0,y:-w.dy,width:u.measuredWidth,height:u.measuredHeight}})},R.prototype.toggleDataItem=function(u){var w=u.dataContext;!w.visible||w.isHiding||w instanceof yo&&w.isHidden?(u.color=u.colorOrig,w.appeared=!0,u.itemContainer.isActive=!1,w.hidden===!0&&(w.hidden=!1),w.show?w.show():w.visible=!0,this.svgContainer.readerAlert(this.language.translate("%1 shown",this.language.locale,u.label.readerTitle))):(u.itemContainer.isActive=!0,w.appeared=!0,w.hide?w.hide():w.visible=!1,this.svgContainer.readerAlert(this.language.translate("%1 hidden",this.language.locale,u.label.readerTitle)),u.color=new Wa().getFor("disabledBackground"))},Object.defineProperty(R.prototype,"preloader",{get:function(){},enumerable:!0,configurable:!0}),R.prototype.handleDataItemPropertyChange=function(u,w){u.valueLabel.invalidate(),u.label.invalidate()},R}(DI);pi.registeredClasses.Legend=i8,sp.push({relevant:Mf.widthXS,state:function(U,R){if(U instanceof i8&&(U.position=="left"||U.position=="right")){var u=U.states.create(R);return u.properties.position="bottom",u}return null}}),sp.push({relevant:Mf.heightXS,state:function(U,R){if(U instanceof i8&&(U.position=="top"||U.position=="bottom")){var u=U.states.create(R);return u.properties.position="right",u}return null}}),sp.push({relevant:Mf.isXS,state:function(U,R){if(U instanceof i8){var u=U.states.create(R);return u.properties.disabled=!0,u}return null}});var r8=function(U){function R(){var u=U.call(this)||this;return u.className="SeriesDataItem",u.values.value={},u.values.value={},u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"bullets",{get:function(){return this._bullets||(this._bullets=new Ea,this._disposers.push(new ep(this._bullets))),this._bullets},enumerable:!0,configurable:!0}),R.prototype.dispose=function(){this.bullets.clear(),U.prototype.dispose.call(this)},Object.defineProperty(R.prototype,"value",{get:function(){return this.values.value.value},set:function(u){this.setValue("value",u)},enumerable:!0,configurable:!0}),R}(MI),n8=function(U){function R(){var u=U.call(this)||this;if(u._ignoreMinMax=!1,u._showBullets=!0,u.legendSettings=new aie,u._tmin=new Ea,u._tmax=new Ea,u._smin=new Ea,u._smax=new Ea,u.dataItemsByAxis=new Ea,u.skipFocusThreshold=20,u._itemReaderTextChanged=!1,u.calculatePercent=!1,u.usePercentHack=!0,u.autoDispose=!0,u.simplifiedProcessing=!1,u.constructor===R)throw new Error("'Series' cannot be instantiated directly. Please use a specific series type.");u.className="Series",u.isMeasured=!1,u.layout="none",u.shouldClone=!1,u.setPropertyValue("hidden",!1),u.axisRanges=new to,u.axisRanges.events.on("inserted",u.processAxisRange,u,!1),u.minBulletDistance=0,u.mainContainer=u.createChild(cs),u.mainContainer.shouldClone=!1,u.mainContainer.mask=u.createChild(yo),u._disposers.push(u.mainContainer);var w=u.mainContainer.createChild(cs);return u._shouldBeReady.push(w),w.shouldClone=!1,w.layout="none",w.virtualParent=u,u._disposers.push(w),u.bulletsContainer=w,u.tooltip=new NI,u.tooltip.virtualParent=u,u._disposers.push(u.tooltip),u.hiddenState.transitionEasing=x4,u.dataItem=u.createDataItem(),u._disposers.push(u.dataItem),u.dataItem.component=u,u.role="group",u.applyTheme(),u}return ie(R,U),R.prototype.applyTheme=function(){U.prototype.applyTheme.call(this)},R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),Te(this.readerTitle)||(this.readerTitle=this.language.translate("Series"))},R.prototype.createDataItem=function(){return new r8},Object.defineProperty(R.prototype,"chart",{get:function(){return this._chart},set:function(u){this._chart=u},enumerable:!0,configurable:!0}),R.prototype.positionBullet=function(u){},R.prototype.processBullet=function(u){var w=this,$=u.newValue;$.isTemplate=!0,this.events.once("datavalidated",function(G){w.itemsFocusable()&&($.focusable=!0)}),this.invalidate()},R.prototype.removeBullet=function(u){var w=u.oldValue;this.dataItems.each(function($){var G=$.bullets.getKey(w.uid);G&&G.dispose()}),this.invalidate()},R.prototype.validateDataItems=function(){U.prototype.validateDataItems.call(this),this.processValues(!1)},R.prototype.getFirstValue=function(u,w){for(var $=w;$>=0;$--){var G=this.dataItems.getIndex($).getActualWorkingValue(u);if(ae(G))return G}return null},R.prototype.getAbsoluteFirstValue=function(u){for(var w=0;w0){var di=$.getIndex(Gt-1);yi(di.values,function(pr,kr){var Er=di.getActualWorkingValue(pr);ae(Er)&&(Ke[pr]=Er)})}for(var ci=function(pr){var kr=$.getIndex(pr);yi(kr.values,function(Er,Bs){var qn=kr.getActualWorkingValue(Er);if(ae(qn)){ae(G[Er])||(G[Er]=0),G[Er]++,ae(K[Er])||(K[Er]=0),K[Er]+=qn,ae(re[Er])||(re[Er]=0),re[Er]+=Math.abs(qn),ae(De[Er])||(De[Er]=qn),Ve[Er]=qn,ae(ue[Er])?ue[Er]>qn&&(ue[Er]=qn):ue[Er]=qn,ae(we[Er])?we[Er]0){w.usePercentHack&&qn==Bs&&(Bs=kr.values[Er].value);var Va=qn/Bs*100;kr.setCalculatedValue(Er,Va,"percent")}else kr.setCalculatedValue(Er,0,"percent")})};for(qi=Gt;qi0){var Ii=$.getIndex(Gt-1);yi(Ii.values,function(pr){var kr=Ii.values[pr].value;Ii.setCalculatedValue(pr,kr-De[pr],"change"),Ii.setCalculatedValue(pr,(kr-De[pr])/De[pr]*100,"changePercent")})}var Ki=this.dataItem;yi(Ki.values,function(pr){Ki.setCalculatedValue(pr,K[pr],"sum"),Ki.setCalculatedValue(pr,re[pr],"absoluteSum"),Ki.setCalculatedValue(pr,K[pr]/G[pr],"average"),Ki.setCalculatedValue(pr,De[pr],"open"),Ki.setCalculatedValue(pr,Ve[pr],"close"),Ki.setCalculatedValue(pr,ue[pr],"low"),Ki.setCalculatedValue(pr,we[pr],"high"),Ki.setCalculatedValue(pr,G[pr],"count")})}},R.prototype.validate=function(){JS()&&this.filters.clear(),ar(this.axisRanges.iterator(),function(G){G.validate()}),U.prototype.validate.call(this);var u=this.bulletsContainer;if(u.fill=this.fill,u.stroke=this.stroke,u.x=this.pixelX,u.y=this.pixelY,this.bulletsContainer.children.length>0)if(this._showBullets){for(var w=0;wthis.endIndex;w--){var $;($=this.dataItems.getIndex(w))&&$.bullets.each(function(G,K){K.__disabled=!0})}}else this.bulletsContainer.children.each(function(G){G.__disabled=!0});this.updateTooltipBounds()},R.prototype.updateTooltipBounds=function(){if(this.topParent){var u={x:0,y:0,width:this.topParent.maxWidth,height:this.topParent.maxHeight};this.tooltip.setBounds(u)}},R.prototype.shouldCreateBullet=function(u,w){return!0},R.prototype.validateDataElement=function(u){var w=this;U.prototype.validateDataElement.call(this,u),this._showBullets?(this.isHidden||(this.bulletsContainer.visible=!0),this.bullets.each(function($){var G=u.bullets.getKey($.uid);if(w.shouldCreateBullet(u,$)){if(!G){var K=$.propertyFields.disabled,re=u.dataContext;K&&re&&re[K]===!1?($.applyOnClones=!1,$.disabled=!1,G=$.clone(),$.disabled=!0,$.applyOnClones=!0):G=$.clone(),G.shouldClone=!1,u.addSprite(G),w.visible&&!w.isHiding||G.hide(0)}var ue=G.dataItem;if(ue!=u){ue&&ue.bullets.setKey($.uid,void 0);var we=w.itemReaderText;G instanceof zo&&(we||(we="{"+G.xField+"}: {"+G.yField+"}"),G.isDynamic&&(u.events.on("workingvaluechanged",G.deepInvalidate,G,!1),w.dataItem.events.on("workingvaluechanged",G.deepInvalidate,G,!1)),G.deepInvalidate()),G.focusable&&(G.events.on("focus",function(De){G.readerTitle=w.populateString(we,G.dataItem)},void 0,!1),G.events.on("blur",function(De){G.readerTitle=""},void 0,!1)),G.hoverable&&(G.events.on("over",function(De){G.readerTitle=w.populateString(we,G.dataItem)},void 0,!1),G.events.on("out",function(De){G.readerTitle=""},void 0,!1))}G.parent=w.bulletsContainer,u.bullets.setKey($.uid,G),G.maxWidth=u.itemWidth,G.maxHeight=u.itemHeight,G.__disabled=!1,w.positionBullet(G)}else G&&(G.__disabled=!0)})):this.bulletsContainer.visible=!1},R.prototype.handleDataItemWorkingValueChange=function(u,w){this.dataRangeInvalid||this.invalidateProcessedData()},Object.defineProperty(R.prototype,"ignoreMinMax",{get:function(){return this._ignoreMinMax},set:function(u){this._ignoreMinMax=u,this.invalidateDataItems()},enumerable:!0,configurable:!0}),R.prototype.createMask=function(){},R.prototype.processAxisRange=function(u){this.rangesContainer||(this.rangesContainer=this.createChild(cs),this.rangesContainer.shouldClone=!1,this.rangesContainer.isMeasured=!1);var w=u.newValue;w&&(w.contents.parent=this.rangesContainer,w.isRange=!0,w.events.on("valuechanged",this.invalidateDataItems,this,!1))},R.prototype.getAxisField=function(u){},R.prototype.showTooltipAtPosition=function(u,w){},Object.defineProperty(R.prototype,"minBulletDistance",{get:function(){return this.getPropertyValue("minBulletDistance")},set:function(u){this.setPropertyValue("minBulletDistance",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"bullets",{get:function(){return this._bullets||(this._bullets=new lo(new zo),this._bullets.template.virtualParent=this,this._bullets.events.on("inserted",this.processBullet,this,!1),this._bullets.events.on("removed",this.removeBullet,this,!1),this._disposers.push(new ua(this._bullets)),this._disposers.push(this._bullets.template)),this._bullets},enumerable:!0,configurable:!0}),R.prototype.createLegendMarker=function(u){},Object.defineProperty(R.prototype,"hiddenInLegend",{get:function(){return this.getPropertyValue("hiddenInLegend")},set:function(u){this.setPropertyValue("hiddenInLegend",u)&&this.chart&&this.chart.feedLegend()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"name",{get:function(){return this.getPropertyValue("name")},set:function(u){this.setPropertyValue("name",u);var w=this.legendDataItem;w&&(w.component.invalidate(),w.component.invalidateRawData()),this.readerTitle=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"itemReaderText",{get:function(){var u=this._itemReaderText;return u||(this.tooltipText?u=$h(this.tooltipText):this.tooltipHTML&&(u=$h(this.tooltipHTML))),this._adapterO?this._adapterO.apply("itemReaderText",u):u},set:function(u){this._itemReaderText=u,this._itemReaderTextChanged=!0},enumerable:!0,configurable:!0}),R.prototype.itemsFocusable=function(){return!(this.dataItems.length>=this.skipFocusThreshold)},Object.defineProperty(R.prototype,"legendDataItem",{get:function(){return this._legendDataItem},set:function(u){this._legendDataItem=u,this._legendDataItem.itemContainer.deepInvalidate()},enumerable:!0,configurable:!0}),R.prototype.updateLegendValue=function(u,w){if(this.legendDataItem){var $=this.legendSettings,G=this.legendDataItem,K=G.label,re=G.valueLabel;u&&!u.isDisposed()||w?(re&&($.itemValueText&&(re.text=$.itemValueText),re.dataItem=u),K&&($.itemLabelText&&(K.text=$.itemLabelText),K.dataItem=u)):(K&&(($.labelText||$.itemLabelText!=null)&&(K.text=$.labelText),K.dataItem=this.dataItem),re&&(($.valueText||$.itemValueText!=null)&&(re.text=$.valueText),re.dataItem=this.dataItem))}},R.prototype.copyFrom=function(u){this.bullets.copyFrom(u.bullets),this.bulletsContainer.copyFrom(u.bulletsContainer),this.calculatePercent=u.calculatePercent,this.usePercentHack=u.usePercentHack,this.simplifiedProcessing=u.simplifiedProcessing,U.prototype.copyFrom.call(this,u)},R.prototype.raiseCriticalError=function(u){this._chart&&this._chart.modal&&(this._chart.modal.content=this._chart.adapter.apply("criticalError",u).message,this._chart.modal.closable=!1,this._chart.modal.open(),this._chart.disabled=!0),console.log(u)},R.prototype.applyFilters=function(){var u=this;U.prototype.applyFilters.call(this),this.bulletsContainer.filters.clear(),ar(this.filters.iterator(),function(w){u.bulletsContainer.filters.push(w.clone())})},Object.defineProperty(R.prototype,"heatRules",{get:function(){var u=this;return this._heatRules||(this._heatRules=new to,this._heatRules.events.on("inserted",function(w){var $=w.newValue,G=$.target;if(G){var K=$.dataField;Te(K)||(K="value");var re=u.dataItem,ue=$.property,we=Et($.minValue),De=Et($.maxValue);ae(we)||ae(De)||u.dataItem.events.on("calculatedvaluechanged",function(Ve){Ve.property==K&&ar(u.dataItems.iterator(),function(Ke){var Qe=!1;wi(Ke.sprites,function(ft){if(ft.clonedFrom==G){var Gt=ft;Gt[ue]=Gt[ue],Qe=!0}}),Qe||wi(Ke.sprites,function(ft){ft instanceof cs&&ar(ft.children.iterator(),function(Gt){if(Gt.className==G.className){var ei=Gt;ei[ue]=ei[ue]}else Gt instanceof cs&&Gt.deepInvalidate()})})})}),u.dataItems.template.events.on("workingvaluechanged",function(Ve){if(Ve.property==K){var Ke=Ve.target,Qe=!1;wi(Ke.sprites,function(ft){if(ft.clonedFrom==G){var Gt=ft;Gt[ue]=Gt[ue],Qe=!0}}),Qe||wi(Ke.sprites,function(ft){ft instanceof cs&&ar(ft.children.iterator(),function(Gt){if(Gt.className==G.className){var ei=Gt;ei[ue]=ei[ue]}else Gt instanceof cs&&Gt.deepInvalidate()})})}}),G.adapter.add(ue,function(Ve,Ke,Qe){var ft=Et($.minValue),Gt=Et($.maxValue),ei=$.min,di=$.max;if(Ke instanceof yo){var ci=Ke.propertyFields[Qe];if(ci&&Ke.dataItem){var qi=Ke.dataItem.dataContext;if(qi&&Te(qi[ci]))return Ve}}var rr=Ke.dataItem;if(ae(ft)||(ft=re.values[K].low),ae(Gt)||(Gt=re.values[K].high),rr&&rr.values[K]){var Ii=rr.getActualWorkingValue(K);if(Te(ei)&&Te(di)&&ae(ft)&&ae(Gt)&&ae(Ii)){var Ki=void 0;if(Ki=$.logarithmic?(Math.log(Ii)*Math.LOG10E-Math.log(ft)*Math.LOG10E)/(Math.log(Gt)*Math.LOG10E-Math.log(ft)*Math.LOG10E):(Ii-ft)/(Gt-ft),!ae(Ii)||ae(Ki)&&Math.abs(Ki)!=1/0||(Ki=.5),ae(ei))return ei+(di-ei)*Ki;if(ei instanceof Ee)return new Ee(Jt(ei.rgb,di.rgb,Ki))}}return Ve})}})),this._heatRules},enumerable:!0,configurable:!0}),R.prototype.processConfig=function(u){var w;if(u){if(Te(u.bullets)&&wt(u.bullets))for(var $=0,G=u.bullets.length;$=0;K--){var re=G.getIndex(K);re&&re.dataContext==w&&$.dataItems.remove(re)}for(K=$.data.length-1;K>=0;K--){var ue=$.data[K];ue&&ue==w&&ji($.data,ue)}}},R.prototype.handleSeriesAdded=function(u){var w=this,$=u.newValue;$.isDisposed()||($.chart=this,$.parent=this.seriesContainer,$.bulletsContainer.parent=this.bulletsContainer,this._dataUsers.moveValue($),$.addDisposer(new Kr(function(){w.dataUsers.removeValue($)})),this.handleSeriesAdded2($),this.handleLegendSeriesAdded($))},R.prototype.handleLegendSeriesAdded=function(u){u.hiddenInLegend||this.legend&&this.legend.addData(u)},R.prototype.handleSeriesAdded2=function(u){var w=this;this.dataInvalid||this._disposers.push(pi.events.once("exitframe",function(){u.data&&u.data.length!=0||(u.data=w.data,u.showOnInit&&(u.reinit(),u.setPropertyValue("showOnInit",!1),u.showOnInit=!0),u.isDisposed()||u.events.once("datavalidated",function(){u.data==w.data&&(u._data=[])}))}))},R.prototype.feedLegend=function(){var u=this.legend;if(u){var w=[];ar(this.series.iterator(),function($){$.hiddenInLegend||w.push($)}),u.dataFields.name="name",u.data=w}},R.prototype.createSeries=function(){return new n8},Object.defineProperty(R.prototype,"colors",{get:function(){return this.getPropertyValue("colors")},set:function(u){this.setPropertyValue("colors",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"patterns",{get:function(){return this.getPropertyValue("patterns")},set:function(u){this.setPropertyValue("patterns",u,!0)},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.series.copyFrom(u.series)},R.prototype.appear=function(){U.prototype.appear.call(this),this.series.each(function(u){u.showOnInit&&u.inited&&u.appear()})},R}(kx);pi.registeredClasses.SerialChart=Sz;var s8=function(U){function R(){var u=U.call(this)||this;u._axis=new Kn,u.dataItems=new to,u.className="AxisBreak",u.breakSize=.01,u.marginLeft=-5,u.marginRight=-5,u.marginTop=-5,u.marginBottom=-5;var w=new Wa,$=new Lr;$.fill=w.getFor("background"),$.stroke=He(),$.fillOpacity=.9,$.zIndex=0,u._fillShape=$;var G=new Lr;G.fill=He(),G.stroke=w.getFor("grid"),G.strokeOpacity=.3,G.zIndex=1,u._startLine=G;var K=new Lr;return K.fill=He(),K.stroke=He("#000000"),K.strokeOpacity=.3,K.zIndex=2,u._endLine=K,u._disposers.push(u._axis),u.applyTheme(),u}return ie(R,U),R.prototype.dispose=function(){U.prototype.dispose.call(this),this._fillShape&&this._fillShape.dispose(),this._startLine&&this._startLine.dispose(),this._endLine&&this._endLine.dispose()},Object.defineProperty(R.prototype,"startLine",{get:function(){return this._startLine},set:function(u){this._startLine&&this._startLine.dispose(),this._startLine=u,this.addBreakSprite(u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endLine",{get:function(){return this._endLine},set:function(u){this._endLine&&this._endLine.dispose(),this._endLine=u,this.addBreakSprite(u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fillShape",{get:function(){return this._fillShape},set:function(u){this._fillShape&&this._fillShape.dispose(),this._fillShape=u,this.addBreakSprite(u)},enumerable:!0,configurable:!0}),R.prototype.addBreakSprite=function(u){u.parent=this,u.isMeasured=!1,this._disposers.push(u)},Object.defineProperty(R.prototype,"axis",{get:function(){return this._axis.get()},set:function(u){if(this._axis.get()!==u){this._axis.set(u,u.renderer.gridContainer.events.on("transformed",this.invalidate,this,!1)),u.renderer.createBreakSprites(this);var w=u.axisBreaks.template;this.startLine.copyFrom(w.startLine),this.endLine.copyFrom(w.endLine),this.fillShape.copyFrom(w.fillShape)}},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"breakSize",{get:function(){return this.getPropertyValue("breakSize")},set:function(u){this.setPropertyValue("breakSize",u)&&this.axis&&(this.axis.invalidate(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startPoint",{get:function(){var u=this.axis.renderer;if(u)return u.positionToPoint(this.startPosition)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endPoint",{get:function(){var u=this.axis.renderer;if(u)return u.positionToPoint(this.endPosition)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startPosition",{get:function(){},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endPosition",{get:function(){},enumerable:!0,configurable:!0}),R.prototype.draw=function(){U.prototype.draw.call(this),this.axis&&this.axis.renderer.updateBreakElement(this)},Object.defineProperty(R.prototype,"startValue",{get:function(){return this.getPropertyValue("startValue")},set:function(u){this.setPropertyValue("startValue",u)&&this.axis&&(this.axis.invalidate(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endValue",{get:function(){return this.getPropertyValue("endValue")},set:function(u){this.setPropertyValue("endValue",u)&&this.axis&&(this.axis.invalidate(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),R}(cs);pi.registeredClasses.AxisBreak=s8;var uve,cC=function(U){function R(){var u=U.call(this)||this;return u.className="AxisDataItem",u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"grid",{get:function(){if(!this._grid){var u=this.component;if(u){var w,$=void 0;if(this.isRange){if(($=u.axisRanges.template.grid).disabled)return;w=$.clone()}else{if(($=u.renderer.grid.template).disabled)return;w=u.renderer.grid.create(),this._disposers.push(new Kr(function(){u.renderer.grid.removeValue(w)}))}this.grid=w,w.shouldClone=!1,this._disposers.push(w),w.axis=this.component}}return this._grid},set:function(u){this._grid&&this._grid!=u&&(ji(this.sprites,this._grid),this._grid.dataItem=void 0),u&&(u.dataItem&&u.dataItem!=this&&(ji(u.dataItem.sprites,u),u.dataItem.grid=void 0),this.addSprite(u)),this._grid=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tick",{get:function(){if(!this._tick){var u=this.component;if(u){var w,$=void 0;if(this.isRange){if(($=u.axisRanges.template.tick).disabled)return;w=$.clone()}else{if(($=u.renderer.ticks.template).disabled)return;w=u.renderer.ticks.create(),this._disposers.push(new Kr(function(){u.renderer.ticks.removeValue(w)}))}this.tick=w,w.axis=this.component,w.shouldClone=!1,this._disposers.push(w)}}return this._tick},set:function(u){this._tick&&this._tick!=u&&(ji(this.sprites,this._tick),this._tick.dataItem=void 0),u&&(u.dataItem&&u.dataItem!=this&&(ji(u.dataItem.sprites,u),u.dataItem.tick=void 0),this.addSprite(u)),this._tick=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"label",{get:function(){if(!this._label){var u=this.component;if(u){var w,$=void 0;if(this.isRange){if(($=u.axisRanges.template.label).disabled)return;w=$.clone()}else{if(($=u.renderer.labels.template).disabled)return;w=u.renderer.labels.create(),this._disposers.push(new Kr(function(){u.renderer.labels.removeValue(w)}))}this._disposers.push(w),this.label=w,w.shouldClone=!1,w.axis=this.component,w.virtualParent=u}}return this._label},set:function(u){this._label&&this._label!=u&&(ji(this.sprites,this._label),this._label.dataItem=void 0),u&&(u.dataItem&&u.dataItem!=this&&(ji(u.dataItem.sprites,u),u.dataItem.label=void 0),this.addSprite(u)),this._label=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"axisFill",{get:function(){if(!this._axisFill){var u=this.component;if(u){var w,$=void 0;if(this.isRange){if($=u.axisRanges.template.axisFill,!this.isTemplate&&$.disabled)return;w=$.clone()}else{if(($=u.renderer.axisFills.template).disabled)return;w=u.renderer.axisFills.create(),this._disposers.push(new Kr(function(){u.renderer.axisFills.removeValue(w)}))}this.axisFill=w,w.shouldClone=!1,this._disposers.push(w)}}return this._axisFill},set:function(u){this._axisFill&&this._axisFill!=u&&(ji(this.sprites,this._axisFill),this._axisFill.dataItem=void 0),u&&(u.dataItem&&u.dataItem!=this&&(ji(u.dataItem.sprites,u),u.dataItem.axisFill=void 0),u.axis=this.component,this.addSprite(u)),this._axisFill=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"text",{get:function(){return this._text},set:function(u){this._text=u,this._label&&(this._label.text=u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"mask",{get:function(){return this._mask},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"contents",{get:function(){if(!this._contents){var u=new cs;this.addSprite(u),u.isMeasured=!1,this._contents=u;var w=this.component;if(w){var $=w.renderer.createFill(this.component);$.disabled=!1,$.axis=w,this.addSprite($),this._mask=$,u.mask=$}}return this._contents},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"axisBreak",{get:function(){return this._axisBreak},set:function(u){this._axisBreak&&this._axisBreak.dataItems.removeValue(this),u&&u.dataItems.push(this),this._axisBreak=u},enumerable:!0,configurable:!0}),R.prototype.validate=function(){this.component&&this.component.validateDataElement(this)},R.prototype.appendChildren=function(){this.component&&this.component.appendDataItem(this)},R.prototype.hasProperty=function(u){return u=="component"||U.prototype.hasProperty.call(this,u)},R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.text=u.text,u.bullet&&(this.bullet=u.bullet.clone()),this.minPosition=u.minPosition,this.maxPosition=u.maxPosition},R.prototype.setVisibility=function(u,w){U.prototype.setVisibility.call(this,u,w),this._contents&&(this._contents.visible=u)},Object.defineProperty(R.prototype,"bullet",{get:function(){return this._bullet},set:function(u){this._bullet&&this._bullet!=u&&(ji(this.sprites,this._bullet),this._bullet.dataItem=void 0),this._bullet=u,u&&this.addSprite(u)},enumerable:!0,configurable:!0}),R}(MI);(function(U){U[U.Start=0]="Start",U[U.Middle=.5]="Middle",U[U.End=1]="End"})(uve||(uve={}));var o8=function(U){function R(){var u=U.call(this)||this;if(u._gridCount=10,u._series=new to,u.autoDispose=!0,u._axisItemCount=0,u.constructor===R)throw new Error("'Axis' cannot be instantiated directly. Please use a specific axis type.");u.hideTooltipWhileZooming=!0,u.minWidth=1e-4,u.minHeight=1e-4,u.className="Axis",u.shouldClone=!1,u.setPropertyValue("cursorTooltipEnabled",!0),u.toggleZoomOutButton=!0,u.zoomable=!0;var w=new Wa;u.title=new tg,u.title.shouldClone=!1,u._disposers.push(u.title),u.setPropertyValue("startLocation",0),u.setPropertyValue("endLocation",1),u._dataItemsIterator=new nf(u.dataItems,function(){return u.dataItems.create()}),u._dataItemsIterator.createNewItems=!0;var $=new NI;u._disposers.push($),$.label.padding(5,10,5,10),$.background.pointerLength=5,$.fitPointerToBounds=!0,$.background.filters.clear(),$.virtualParent=u;var G=$.background;return G.cornerRadius=0,G.fill=w.getFor("alternativeBackground"),G.stroke=G.fill,G.strokeWidth=1,G.fillOpacity=1,$.label.fill=w.getFor("alternativeText"),u.tooltip=$,u.readerHidden=!0,u.events.on("rangechangestarted",function(){u.series.each(function(K){K.hideTooltipWhileZooming&&(K.tooltip.hide(),K.tooltip.preventShow=!0)}),u.hideTooltipWhileZooming&&(u.tooltip.hide(),u.tooltip.preventShow=!0)},void 0,!1),u.events.on("rangechangeended",function(){u.series.each(function(K){K.hideTooltipWhileZooming&&(K.tooltip.hide(),K.tooltip.preventShow=!1)}),u.hideTooltipWhileZooming&&(u.tooltip.hide(),u.tooltip.preventShow=!1)},void 0,!1),u.applyTheme(),u}return ie(R,U),R.prototype.fillRule=function(u,w){ae(w)||(w=u.index),w/2==Math.round(w/2)?(u.axisFill.__disabled=!0,u.axisFill.opacity=0):(u.axisFill.opacity=1,u.axisFill.__disabled=!1)},R.prototype.createDataItem=function(){return new cC},R.prototype.invalidateLayout=function(){U.prototype.invalidateLayout.call(this),ar(this.series.iterator(),function(u){u.invalidateLayout()})},R.prototype.invalidateSeries=function(){ar(this.series.iterator(),function(u){u.invalidate()})},R.prototype.validateDataElements=function(){this._axisItemCount=0,this.ghostLabel&&(this.renderer.updateLabelElement(this.ghostLabel,this.start,this.end),this.ghostLabel.validate())},R.prototype.updateGridCount=function(){if(this.renderer){var u=this.axisLength/this.renderer.minGridDistance;u!=this._gridCount&&(this._gridCount=u,this.clearCache())}},R.prototype.validateLayout=function(){this.axisFullLength=this.axisLength/(this.end-this.start),U.prototype.validateLayout.call(this),this.updateGridCount();var u=this.renderer;u&&(u.updateAxisLine(),u.updateTooltip(),u.updateBaseGridElement()),this._prevLength!=this.axisLength&&(this.dispatchImmediately("lengthchanged"),this._prevLength=this.axisLength)},R.prototype.initRenderer=function(){},R.prototype.appendDataItem=function(u){var w=this.renderer,$=u.tick;$&&($.above?$.parent=w.bulletsContainer:$.parent=w.gridContainer),u.label&&(u.label.parent=w);var G=u.axisFill;G&&(G.above?G.parent=w.bulletsContainer:G.parent=w.gridContainer);var K=u.grid;K&&(K.above?K.parent=w.bulletsContainer:K.parent=w.gridContainer),u.bullet&&(u.bullet.parent=w.bulletsContainer)},R.prototype.validate=function(){U.prototype.validate.call(this),this.validateLayout(),this.renderer.updateGridContainer()},R.prototype.validateAxisRanges=function(){var u=this;ar(this.axisRanges.iterator(),function(w){u.appendDataItem(w),u.validateDataElement(w),w.grid&&w.grid.validate(),w.tick&&w.tick.validate(),w.axisFill&&w.axisFill.validate(),w.label&&w.label.validate()})},R.prototype.validateBreaks=function(){this._axisBreaks&&ar(this._axisBreaks.iterator(),function(u){u.invalidate()})},R.prototype.processBreak=function(u){var w=u.newValue;w.parent=this.renderer.breakContainer,w.axis=this},R.prototype.registerSeries=function(u){var w=this;return this.series.moveValue(u),new jn([new Kr(function(){w.series.removeValue(u)}),this.events.on("lengthchanged",u.invalidate,u,!1),this.events.on("lengthchanged",u.createMask,u,!1),this.events.on("startchanged",u.invalidate,u,!1),this.events.on("endchanged",u.invalidate,u,!1)])},Object.defineProperty(R.prototype,"renderer",{get:function(){return this._renderer},set:function(u){if(u!=this._renderer){this._renderer=u,u.chart=this.chart,u.axis=this,u.parent=this,this.title.parent=this,this.initRenderer(),this._disposers.push(u.gridContainer.events.on("maxsizechanged",this.invalidate,this,!1));var w=this.renderer.labels.create();this._disposers.push(w),w.dataItem=this.dataItems.template.clone(),w.text="L",w.parent=this.renderer,w.shouldClone=!1,w.fillOpacity=0,w.opacity=0,w.strokeOpacity=0,w.interactionsEnabled=!1,w.validate(),this.ghostLabel=w,this.events.on("beforedatavalidated",function(){w.text="L"},void 0,!1)}},enumerable:!0,configurable:!0}),R.prototype.positionToAngle=function(u){return this.renderer.positionToAngle(u)},R.prototype.pointToPosition=function(u){return this.renderer.pointToPosition(u)},R.prototype.positionToCoordinate=function(u){return this.renderer.positionToCoordinate(u)},R.prototype.getAnyRangePath=function(u,w){return this.renderer.getPositionRangePath(u,w)},R.prototype.anyToPosition=function(u){return 0},R.prototype.anyToPoint=function(u){return{x:0,y:0,angle:0}},R.prototype.getPositionRangePath=function(u,w){return this.renderer?this.renderer.getPositionRangePath(u,w):""},Object.defineProperty(R.prototype,"axisLength",{get:function(){return this.renderer?this.renderer.axisLength:0},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cursorTooltipEnabled",{get:function(){return this.getPropertyValue("cursorTooltipEnabled")},set:function(u){this.setPropertyValue("cursorTooltipEnabled",u)&&(u&&this.renderer?this.renderer.updateTooltip():this.tooltip&&this.tooltip.hide(0))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"toggleZoomOutButton",{get:function(){return this.getPropertyValue("toggleZoomOutButton")},set:function(u){this.setPropertyValue("toggleZoomOutButton",u)},enumerable:!0,configurable:!0}),R.prototype.hideTooltip=function(u){U.prototype.hideTooltip.call(this,u),this._tooltipPosition=void 0},R.prototype.showTooltipAtPosition=function(u,w){var $=this._tooltip;if(!$||this.dataItems.length<=0)this._tooltipPosition=void 0;else{if(w||(u=this.toAxisPosition(u)),!ae(u)||uthis.end)return $.hide(0),void(this._tooltipPosition=void 0);var G=this.renderer;$.parent||($.parent=this.tooltipContainer);var K=G.tooltipLocation,re=this.getCellStartPosition(u),ue=this.getCellEndPosition(u);if(this.tooltipPosition=="fixed"&&(u=re+(ue-re)*K),u=nt(u,this.start,this.end),this._tooltipPosition!=u){this._tooltipPosition=u;var we=G.tooltipLocation2,De=G.positionToPoint(re,we),Ve=G.positionToPoint(ue,we);this.currentItemStartPoint=De,this.currentItemEndPoint=Ve,G.fullWidthTooltip&&($.width=Ve.x-De.x,$.height=Ve.y-De.y);var Ke=vm(G.positionToPoint(u,we),this.renderer.line);$.text=this.getTooltipText(u),$.text&&($.delayedPointTo(Ke),$.show())}this.cursorTooltipEnabled&&!this.tooltip.disabled||$.hide(0)}},R.prototype.toAxisPosition=function(u){if((u=this.renderer.toAxisPosition(u))!=null)return u*=this.end-this.start,this.renderer.inversed?this.end-u:this.start+u},R.prototype.toGlobalPosition=function(u){return this.renderer.inversed?u=this.end-u:u-=this.start,u/(this.end-this.start)},R.prototype.getTooltipText=function(u){},R.prototype.updateTooltip=function(u,w){var $=this._tooltip;$&&($.fixDoc=!1,$.pointerOrientation=u,$.setBounds(rt(w,this.renderer.line)))},R.prototype.roundPosition=function(u,w,$){return u},R.prototype.getCellStartPosition=function(u){return u},R.prototype.getCellEndPosition=function(u){return u},Object.defineProperty(R.prototype,"axisRanges",{get:function(){if(!this._axisRanges){var u=this.createDataItem();u.isRange=!0,u.axisFill=this.renderer.axisFills.template.clone(),u.grid=this.renderer.grid.template.clone(),u.tick=this.renderer.ticks.template.clone(),u.label=this.renderer.labels.template.clone(),u.isTemplate=!0,u.component=this,u.axisFill.disabled=!1,u.tick.disabled=!1,u.grid.disabled=!1,u.label.disabled=!1,this._axisRanges=new lo(u),this._axisRanges.events.on("inserted",this.processAxisRange,this,!1),this._disposers.push(new ua(this._axisRanges)),this._disposers.push(this._axisRanges.template)}return this._axisRanges},enumerable:!0,configurable:!0}),R.prototype.processAxisRange=function(u){var w=u.newValue;w.component=this,w.isRange=!0},Object.defineProperty(R.prototype,"axisBreaks",{get:function(){return this._axisBreaks||(this._axisBreaks=new oh(this.createAxisBreak(),function(u,w){return ah(u.adjustedStartValue,w.adjustedStartValue)}),this._axisBreaks.events.on("inserted",this.processBreak,this,!1),this._disposers.push(new ua(this._axisBreaks)),this._disposers.push(this._axisBreaks.template)),this._axisBreaks},enumerable:!0,configurable:!0}),R.prototype.createAxisBreak=function(){return new s8},Object.defineProperty(R.prototype,"series",{get:function(){return this._series||(this._series=new to),this._series},enumerable:!0,configurable:!0}),R.prototype.processSeriesDataItems=function(){},R.prototype.processSeriesDataItem=function(u,w){},R.prototype.postProcessSeriesDataItems=function(u){},R.prototype.postProcessSeriesDataItem=function(u){},R.prototype.updateAxisBySeries=function(){},R.prototype.hideUnusedDataItems=function(){var u=this,w=this._dataItemsIterator;w.createNewItems=!1,ar(w.iterator(),function($){u.validateDataElement($),$.__disabled=!0}),w.clear(),w.createNewItems=!0},R.prototype.getSeriesDataItem=function(u,w,$){},R.prototype.getAngle=function(u,w,$,G,K){},R.prototype.getX=function(u,w,$,G,K){},R.prototype.getPositionX=function(u,w,$,G,K){},R.prototype.getY=function(u,w,$,G,K){},R.prototype.getPositionY=function(u,w,$,G,K){},Object.defineProperty(R.prototype,"basePoint",{get:function(){return{x:0,y:0}},enumerable:!0,configurable:!0}),R.prototype.dataChangeUpdate=function(){},R.prototype.seriesDataChangeUpdate=function(u){},R.prototype.adjustDifference=function(u,w){var $=w-u;if(ae($))return this._axisBreaks&&on(this._axisBreaks.iterator(),function(G){var K=G.adjustedStartValue,re=G.adjustedEndValue;if(ae(K)&&ae(re)){if(K>w)return!1;if(re>=u&&ae(K)&&ae(re)){var ue=G.breakSize,we=_({start:K,end:re},{start:u,end:w});we&&($-=(we.end-we.start)*(1-ue))}return!0}}),$},R.prototype.isInBreak=function(u){if(this._axisBreaks)return jc(this._axisBreaks.iterator(),function(w){return u>=w.adjustedStartValue&&u<=w.adjustedEndValue})},R.prototype.fixAxisBreaks=function(){var u=this;if(this._axisBreaks){var w=this._axisBreaks;if(w.length>0){wi(wr(w.iterator()),function(K){var re=H(K.startValue,K.endValue),ue=ye(K.startValue,K.endValue);K.adjustedStartValue=re,K.adjustedEndValue=ue,u._axisBreaks.update(K)});var $=w.first,G=Math.min($.startValue,$.endValue);ar(w.iterator(),function(K){var re=K.adjustedStartValue,ue=K.adjustedEndValue;rewe)},R.prototype.createBreakSprites=function(u){},Object.defineProperty(R.prototype,"axisFills",{get:function(){if(!this._axisFills){var u=this.createFill(this.axis);this._axisFills=new lo(u),u.applyOnClones=!0,u.events.on("enabled",this.invalidateAxisItems,this,!1),this._disposers.push(new ua(this._axisFills)),this._disposers.push(this._axisFills.template)}return this._axisFills},enumerable:!0,configurable:!0}),R.prototype.createFill=function(u){return new Cz(u)},Object.defineProperty(R.prototype,"grid",{get:function(){if(!this._grid){var u=this.createGrid();this._grid=new lo(u),u.applyOnClones=!0,u.events.on("enabled",this.invalidateAxisItems,this,!1),this._disposers.push(new ua(this._grid)),this._disposers.push(this._grid.template)}return this._grid},enumerable:!0,configurable:!0}),R.prototype.createGrid=function(){return new G4},Object.defineProperty(R.prototype,"ticks",{get:function(){if(!this._ticks){var u=this.createTick();u.applyOnClones=!0,u.isMeasured=!1,u.events.on("enabled",this.invalidateAxisItems,this,!1),this._ticks=new lo(u),this._disposers.push(new ua(this._ticks)),this._disposers.push(this._ticks.template)}return this._ticks},enumerable:!0,configurable:!0}),R.prototype.createTick=function(){return new Ez},Object.defineProperty(R.prototype,"labels",{get:function(){if(!this._labels){var u=this.createLabel();this._labels=new lo(u),u.applyOnClones=!0,u.events.on("enabled",this.invalidateAxisItems,this,!1),this._disposers.push(new ua(this._labels)),this._disposers.push(this._labels.template)}return this._labels},enumerable:!0,configurable:!0}),R.prototype.createLabel=function(){return new Tz},Object.defineProperty(R.prototype,"inside",{get:function(){return this.getPropertyValue("inside")},set:function(u){this.setPropertyValue("inside",u)&&this.axis&&this.axis.invalidate(),u?(this.width=0,this.height=0):(this.width=void 0,this.height=void 0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"opposite",{get:function(){return this.getPropertyValue("opposite")},set:function(u){this.setPropertyValue("opposite",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fullWidthTooltip",{get:function(){return this.getPropertyValue("fullWidthTooltip")},set:function(u){this.setPropertyValue("fullWidthTooltip",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tooltipLocation",{get:function(){return this.getPropertyValue("tooltipLocation")},set:function(u){this.setPropertyValue("tooltipLocation",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tooltipLocation2",{get:function(){return this.getPropertyValue("tooltipLocation2")},set:function(u){this.setPropertyValue("tooltipLocation2",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cellStartLocation",{get:function(){return this.getPropertyValue("cellStartLocation")},set:function(u){this.setPropertyValue("cellStartLocation",u)&&this.axis&&this.axis.invalidateSeries()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cellEndLocation",{get:function(){return this.getPropertyValue("cellEndLocation")},set:function(u){this.setPropertyValue("cellEndLocation",u)&&this.axis&&this.axis.invalidateSeries()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"inversed",{get:function(){return this.getPropertyValue("inversed")},set:function(u){this.setPropertyValue("inversed",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"minLabelPosition",{get:function(){return this.getPropertyValue("minLabelPosition")},set:function(u){this.setPropertyValue("minLabelPosition",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxLabelPosition",{get:function(){return this.getPropertyValue("maxLabelPosition")},set:function(u){this.setPropertyValue("maxLabelPosition",u,!0)},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.grid.template.copyFrom(u.grid.template),this.ticks.template.copyFrom(u.ticks.template),this.labels.template.copyFrom(u.labels.template),this.axisFills.template.copyFrom(u.axisFills.template),this.line.copyFrom(u.line),this.baseGrid.copyFrom(u.baseGrid)},R.prototype.toAxisPosition=function(u){return u},R.prototype.setVisibility=function(u){U.prototype.setVisibility.call(this,u),this.bulletsContainer.visible=u},R}(cs);pi.registeredClasses.AxisRenderer=a8;var z4=function(U){function R(){var u=U.call(this)||this;return u.className="AxisBullet",u.location=.5,u.isMeasured=!1,u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"location",{get:function(){return this.getPropertyValue("location")},set:function(u){this.setPropertyValue("location",u,!0)},enumerable:!0,configurable:!0}),R.prototype.setDisabled=function(u){var w=U.prototype.setDisabled.call(this,u);return this.axis&&this.axis.invalidateDataItems(),w},R}(cs);pi.registeredClasses.AxisBullet=z4;var T1=function(U){function R(){var u=U.call(this)||this;return u.className="AxisRendererY",u.minGridDistance=40,u.opposite=!1,u.height=de(100),u.labels.template.verticalCenter="middle",u.applyTheme(),u}return ie(R,U),R.prototype.setAxis=function(u){U.prototype.setAxis.call(this,u),u.layout="horizontal"},R.prototype.updateGridContainer=function(){var u=this.axis;if(u){var w=this.gridContainer;w.y=u.pixelY,w.height=u.axisLength}},R.prototype.toAxisPosition=function(u){var w=this.axis;if(w){var $=1-u,G=w.relativePositionSprite,K=w.pixelY;if(G?K=Ip({x:0,y:this.pixelY},this.parent,G).y:G=w.parent,G)return 1-($-K/G.innerHeight)/(w.axisLength/G.innerHeight)}return u},R.prototype.processRenderer=function(){U.prototype.processRenderer.call(this);var u=this.axis;if(u){var w=u.title;w.valign="middle",u.height instanceof J||(u.height=de(100)),this.opposite?(w.rotation=90,this.line.toBack(),w.toFront()):(w.rotation=-90,w.toBack(),this.line.toFront())}},R.prototype.updateTooltip=function(){if(this.axis){var u=2e3,w=0,$=u,G=this.axisLength;this.opposite?this.inside&&(w=-2e3,$=u):this.inside||(w=-2e3,$=u),this.axis.updateTooltip("horizontal",{x:w,y:0,width:$,height:G})}},Object.defineProperty(R.prototype,"axisLength",{get:function(){var u=this.axis;return u.measuredHeight-u.pixelPaddingTop-u.pixelPaddingBottom||0},enumerable:!0,configurable:!0}),R.prototype.positionToPoint=function(u,w){return{x:0,y:this.positionToCoordinate(u)}},R.prototype.pointToPosition=function(u){return this.coordinateToPosition(u.y,u.x)},R.prototype.coordinateToPosition=function(u,w){var $=this.axis,G=$.axisFullLength;return ze($.renderer.inversed?1-$.start-u/G:u/G+(1-$.end),5)},R.prototype.getPositionRangePath=function(u,w){var $=nt(this.positionToCoordinate(u),0,this.axisLength),G=nt(this.positionToCoordinate(w),0,this.axisLength),K=Math.abs(G-$),re=this.getWidth();return aC({x:0,y:Math.min($,G),width:re,height:K},!0)},R.prototype.updateGridElement=function(u,w,$){w+=($-w)*u.location;var G=this.positionToPoint(w);u.path=wn({x:0,y:0})+Rr({x:this.getWidth(),y:0}),this.positionItem(u,G),this.toggleVisibility(u,w,0,1)},R.prototype.updateTickElement=function(u,w,$){w+=($-w)*u.location;var G=this.positionToPoint(w),K=u.length;try{this.axis.title.measuredWidth}catch{}G.x=Ip({x:this.line.pixelX,y:0},this.line.parent,this.gridContainer).x,this.opposite?K*=u.inside?-1:1:K*=u.inside?1:-1,u.path=wn({x:0,y:0})+Rr({x:K,y:0}),this.positionItem(u,G),this.toggleVisibility(u,w,0,1)},R.prototype.updateAxisLine=function(){this.line.path=wn({x:0,y:0})+Rr({x:0,y:this.axisLength})},R.prototype.updateBaseGridElement=function(){U.prototype.updateBaseGridElement.call(this);var u=this.axis,w=this.getWidth(),$=this.axisLength,G=u.basePoint.y,K=this.baseGrid;if(G<-.2||G>$+.2)K.hide(0);else{var re=Ip({x:0,y:0},this.gridContainer,K.parent).x;K.path=wn({x:0,y:0})+Rr({x:w,y:0}),K.moveTo({x:re,y:G}),K.show(0)}},R.prototype.updateLabelElement=function(u,w,$,G){Te(G)||(G=u.location),w+=($-w)*G,u.isMeasured=!u.inside;var K,re=this.positionToPoint(w),ue=0,we=this.gridContainer.maxWidth;this.opposite?(u.inside?(K="right",u.align=="left"&&(ue=-we,K="left"),u.align=="center"&&(ue=-we/2,K="middle")):K="left",re.x=0+ue):(u.inside?(K="left",u.align=="right"&&(ue=we,K="right"),u.align=="center"&&(ue=we/2,K="middle")):K="right",re.x=this.measuredWidth+ue),u.rotation==0&&(u.horizontalCenter=K),this.positionItem(u,re),this.toggleVisibility(u,w,this.minLabelPosition,this.maxLabelPosition)},R.prototype.updateBreakElement=function(u){U.prototype.updateBreakElement.call(this,u);var w=u.startLine,$=u.endLine,G=u.fillShape,K=u.startPoint,re=u.endPoint,ue=u.pixelMarginLeft,we=this.getWidth()-u.pixelMarginLeft-u.pixelMarginRight;K.y=nt(K.y,-1,this.axisLength+1),re.y=nt(re.y,-1,this.axisLength+1),K.y==re.y&&(K.y<0||K.y>this.axisLength)?u.fillShape.__disabled=!0:u.fillShape.__disabled=!1;var De=Math.abs(we-ue);w.x=ue,w.height=0,w.width=De,$.x=ue,$.height=0,$.width=De,G.width=De,G.height=Math.abs(re.y-K.y),G.x=ue,G.y=re.y},R.prototype.createBreakSprites=function(u){u.startLine=new Lr,u.endLine=new Lr;var w=new Z$;w.setWavedSides(!0,!1,!0,!1),u.fillShape=w},R.prototype.positionToCoordinate=function(u){var w=this.axis,$=w.axisFullLength;return w.renderer.inversed?(u-w.start)*$:(w.end-u)*$},R.prototype.updateBullet=function(u,w,$){var G=.5;u instanceof z4&&(G=u.location),w+=($-w)*G;var K=this.positionToPoint(w);K.x=Ip({x:this.line.pixelX,y:0},this.line.parent,this.gridContainer).x,this.positionItem(u,K),this.toggleVisibility(u,w,0,1)},R}(a8);pi.registeredClasses.AxisRendererY=T1,sp.push({relevant:Mf.widthS,state:function(U,R){if(U instanceof T1){var u=U.states.create(R);return u.properties.inside=!0,u.properties.maxLabelPosition=.9,u.properties.minLabelPosition=.1,u}return null}}),sp.push({relevant:Mf.widthXS,state:function(U,R){if(U instanceof T1){var u=U.states.create(R);return u.properties.disabled=!0,u}return null}});var Iz=function(U){function R(){var u=U.call(this)||this;return u.className="ValueAxisBreak",u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"startPosition",{get:function(){if(this.axis)return this.axis.valueToPosition(this.adjustedStartValue)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endPosition",{get:function(){if(this.axis)return this.axis.valueToPosition(this.adjustedEndValue)},enumerable:!0,configurable:!0}),R}(s8);pi.registeredClasses.ValueAxisBreak=Iz;var l8=function(U){function R(){var u=U.call(this)||this;return u.className="ValueAxisDataItem",u.values.value={},u.values.endValue={},u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"value",{get:function(){return this.values.value.value},set:function(u){this.setValue("value",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endValue",{get:function(){return this.values.endValue.value},set:function(u){this.setValue("endValue",u)},enumerable:!0,configurable:!0}),R}(cC),Ro=function(U){function R(){var u=U.call(this)||this;return u._stepDecimalPlaces=0,u._prevStepDecimalPlaces=0,u._adjustLabelPrecision=!0,u._baseValue=0,u._adjustedStart=0,u._adjustedEnd=1,u._extremesChanged=!1,u._deltaMinMax=1,u._dsc=!1,u.calculateTotals=!1,u.className="ValueAxis",u.axisFieldName="value",u.setPropertyValue("maxZoomFactor",1e3),u.setPropertyValue("extraMin",0),u.setPropertyValue("extraMax",0),u.setPropertyValue("strictMinMax",!1),u.setPropertyValue("maxPrecision",Number.MAX_VALUE),u.setPropertyValue("adjustLabelPrecision",!0),u.setPropertyValue("extraTooltipPrecision",0),u.keepSelection=!1,u.includeRangesInMinMax=!1,u.applyTheme(),u}return ie(R,U),R.prototype.fillRule=function(u){var w=u.value,$=u.component;u.axisFill.disabled||(ze(w/$.step/2,5)==Math.round(w/$.step/2)?u.axisFill.__disabled=!0:u.axisFill.__disabled=!1)},R.prototype.createDataItem=function(){return new l8},R.prototype.createAxisBreak=function(){return new Iz},R.prototype.dataChangeUpdate=function(){this.clearCache(),this.keepSelection?(this._start!=0&&this.dispatchImmediately("startchanged"),this._end!=1&&this.dispatchImmediately("endchanged"),this._start==0&&this._end==1||this.dispatchImmediately("startendchanged")):this._start==0&&this._end==1||(this._start=0,this._end=1,this.dispatchImmediately("startendchanged")),this._maxZoomed=this._maxDefined,this._minZoomed=this._minDefined,this._maxAdjusted=this._maxDefined,this._minAdjusted=this._minDefined},R.prototype.processSeriesDataItems=function(){if(this.calculateTotals){var u=this.series.getIndex(0),w=u.startIndex;if(u.dataItems.length>0){w>0&&w--;var $=u.endIndex;$1?w=Math.pow(10,Math.log(this.min)*Math.LOG10E):(w=Math.floor(this.minZoomed/this._step)*this._step)==0&&(w=this.minZoomed):w=Math.floor(w/this._step)*this._step;var $=this._maxZoomed+this._step;this.resetIterators();var G=this._dataItemsIterator;if(this._step==0)return;this._step=this.fixSmallStep(this._step);var K=0,re=this._prevStepDecimalPlaces!=this._stepDecimalPlaces;for(this._prevStepDecimalPlaces=this._stepDecimalPlaces;w<=$;){if(!this.isInBreak(w)){var ue=G.find(function(ft){return ft.value===w});ue.__disabled&&(ue.__disabled=!1),this.appendDataItem(ue),ue.axisBreak=void 0,(ue.value!=w||re)&&(ue.value=w,ue.text=this.formatLabel(w),ue.label&&ue.label.invalid&&ue.label.validate(),ue.value>=this.min&&ue.value<=this.max&&ue.label&&(this.axisLetter=="Y"&&ue.label.measuredWidth>this.ghostLabel.measuredWidth||this.axisLetter=="X"&&ue.label.measuredHeight>this.ghostLabel.measuredHeight)&&(this.ghostLabel.text=ue.label.currentText,this.ghostLabel.validate())),this.validateDataElement(ue)}K++;var we=w;this.logarithmic&&Math.log(this.max)*Math.LOG10E-Math.log(this.min)*Math.LOG10E>1?w=Math.pow(10,Math.log(this.min)*Math.LOG10E+K):w+=this._step;var De=Math.pow(10,Math.floor(Math.log(Math.abs(this._step))*Math.LOG10E));if(De<1){var Ve=Math.round(Math.abs(Math.log(Math.abs(De))*Math.LOG10E))+2;if(Ve=Math.min(13,Ve),we==(w=ze(w,Ve))){w=$;break}}}var Ke=this._axisBreaks;if(Ke){var Qe=this.renderer;ar(Ke.iterator(),function(ft){if(ft.breakSize>0&&C(ft.startPoint,ft.endPoint)>Qe.minGridDistance)for(var Gt=ft.adjustedMin;Gt<=ft.adjustedMax;){if(Gt>=ft.adjustedStartValue&&Gt<=ft.adjustedEndValue){var ei=G.find(function(di){return di.value===Gt});ei.__disabled&&(ei.__disabled=!1),u.appendDataItem(ei),ei.axisBreak=ft,ei.value!=Gt&&(ei.value=Gt,ei.text=u.formatLabel(Gt),ei.label&&ei.label.invalid&&ei.label.validate()),u.validateDataElement(ei)}Gt+=ft.adjustedStep}})}}},R.prototype.validateDataElement=function(u){U.prototype.validateDataElement.call(this,u),u.itemIndex=this._axisItemCount,this._axisItemCount++;var w=this.renderer,$=u.value,G=u.endValue,K=this.valueToPosition($);u.position=K;var re=K,ue=this.valueToPosition($+this._step);ae(G)&&(ue=re=this.valueToPosition(G)),u.point=w.positionToPoint(K);var we=u.tick;we&&!we.disabled&&w.updateTickElement(we,K,re);var De=u.grid;De&&!De.disabled&&w.updateGridElement(De,K,re);var Ve=u.label;Ve&&!Ve.disabled&&w.updateLabelElement(Ve,K,re);var Ke=u.axisFill;Ke&&!Ke.disabled&&(w.updateFillElement(Ke,K,ue),u.isRange||this.fillRule(u)),u.bullet&&w.updateBullet(u.bullet,K,re);var Qe=u.mask;Qe&&w.updateFillElement(Qe,K,ue)},R.prototype.formatLabel=function(u){return this.adjustLabelPrecision&&u!=0?this.numberFormatter.format(u,void 0,this._stepDecimalPlaces):this.numberFormatter.format(u)},Object.defineProperty(R.prototype,"basePoint",{get:function(){var u=this.baseValue,w=this.valueToPosition(u);return this.renderer.positionToPoint(w)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"baseValue",{get:function(){var u=this._baseValue;return this.logarithmic&&(u=this.min),this._adapterO?this._adapterO.apply("baseValue",u):u},set:function(u){this._baseValue=u,this.invalidateLayout(),this.invalidateSeries()},enumerable:!0,configurable:!0}),R.prototype.anyToPosition=function(u){return this.valueToPosition(u)},R.prototype.valueToPoint=function(u){var w=this.valueToPosition(u),$=this.renderer.positionToPoint(w),G=this.renderer.positionToAngle(w);return{x:$.x,y:$.y,angle:G}},R.prototype.anyToPoint=function(u){return this.valueToPoint(u)},R.prototype.valueToPosition=function(u){if(ae(u)){var w=this.min,$=this.max;if(ae(w)&&ae($)){var G=this._difference,K=this._axisBreaks;K&&K.length>0&&on(K.iterator(),function(we){var De=we.adjustedStartValue,Ve=we.adjustedEndValue;if(ae(De)&&ae(Ve)){if(uVe?w+=(Ve-De)*(1-Ke):u0&&on(re.iterator(),function(ue){var we=ue.startPosition,De=ue.endPosition,Ve=ue.adjustedStartValue,Ke=ue.adjustedEndValue;if(ae(Ve)&&ae(Ke)){if(Ve>$)return!1;if(b({start:Ve,end:Ke},{start:w,end:$})){Ve=ye(Ve,w),Ke=H(Ke,$);var Qe=ue.breakSize;if(G-=(Ke-Ve)*(1-Qe),u>De)w+=(Ke-Ve)*(1-Qe);else if(!(u$&&($=ft)}}),this.includeRangesInMinMax&&this.axisRanges.each(function(Ke){if(!Ke.ignoreMinMax){var Qe=H(Ke.value,Ke.endValue),ft=ye(Ke.value,Ke.endValue);(Qe$||!ae($))&&($=ft)}})),this.logarithmic){var G=this.treatZeroAs;ae(G)&&w<=0&&(w=G),w<=0&&this.raiseCriticalError(new Error("Logarithmic value axis can not have values <= 0."),!0)}if(w==0&&$==0&&($=.9,w=-.9),ae(this._minDefined)&&(w=this._minDefined),ae(this._maxDefined)&&($=this._maxDefined),this._adapterO&&(w=this._adapterO.apply("min",w)),this._adapterO&&($=this._adapterO.apply("max",$)),ae(w)&&ae($)){this._minReal=w,this._maxReal=$,w==Number.POSITIVE_INFINITY&&(w=void 0),$==Number.NEGATIVE_INFINITY&&($=void 0);var K=this.adjustDifference(w,$);if(w=this.fixMin(w),($=this.fixMax($))-w<=1/Math.pow(10,15)){if($-w!=0)this._deltaMinMax=($-w)/2;else{var re=Math.log(Math.abs($))*Math.LOG10E,ue=Math.pow(10,Math.floor(re));ue/=10,this._deltaMinMax=ue}w-=this._deltaMinMax,$+=this._deltaMinMax}w-=($-w)*this.extraMin,$+=($-w)*this.extraMax;var we=this.strictMinMax;ae(this._maxDefined)&&(we=!0);var De=this.adjustMinMax(w,$,K,this._gridCount,we);if(w=De.min,K=($=De.max)-w,De=this.adjustMinMax(w,$,$-w,this._gridCount,!0),w=De.min,$=De.max,this.strictMinMax&&(w=ae(this._minDefined)?this._minDefined:this._minReal,($=ae(this._maxDefined)?this._maxDefined:this._maxReal)-w<=1e-8&&(w-=this._deltaMinMax,$+=this._deltaMinMax),w-=($-w)*this.extraMin,$+=($-w)*this.extraMax),this._adapterO&&(w=this._adapterO.apply("min",w)),this._adapterO&&($=this._adapterO.apply("max",$)),this._step=De.step,ae(w)||ae($)||(this.start=0,this.end=1,this.renderer.labels.each(function(Ke){Ke.dataItem.text=""})),(this._minAdjusted!=w||this._maxAdjusted!=$)&&ae(w)&&ae($)){var Ve=this._minMaxAnimation;if(this._extremesChanged&&ae(this._minAdjusted)&&ae(this._maxAdjusted)&&this.inited){if(Ve&&!Ve.isFinished()&&this._finalMax==$&&this._finalMin==w)return;this._finalMin=w,this._finalMax=$,(Ve=this.animateMinMax(w,$))&&!Ve.isFinished()?(Ve.events.on("animationprogress",this.validateDataItems,this),Ve.events.on("animationended",function(){u.series.each(function(Ke){Ke.validate()}),u.validateDataItems(),u.handleSelectionExtremesChange()}),this._minMaxAnimation=Ve):this.series.each(function(Ke){Ke.invalidate()}),this.validateDataItems(),this.dispatchImmediately("extremeschanged"),this.handleSelectionExtremesChange()}else{if(Ve&&!Ve.isFinished()&&this._finalMax==$&&this._finalMin==w)return;this._minAdjusted=w,this._maxAdjusted=$,this._finalMin=w,this._finalMax=$,this.invalidateDataItems(),this.dispatchImmediately("extremeschanged")}}this._extremesChanged=!1,this._difference=this.adjustDifference(w,$)}},R.prototype.fixMin=function(u){return u},R.prototype.fixMax=function(u){return u},R.prototype.adjustMinMax=function(u,w,$,G,K){G<=1&&(G=1),G=Math.round(G);var re=u,ue=w;$===0&&($=Math.abs(w));var we=Math.log(Math.abs($))*Math.LOG10E,De=Math.pow(10,Math.floor(we)),Ve=De/=10;K&&(Ve=0),this.logarithmic?(u<=0&&(u=this.baseValue),u==1/0&&(u=1),w==-1/0&&(w=10),this.strictMinMax?(this._minDefined>0&&(u=this._minDefined),this._maxDefined):(u=Math.pow(10,Math.floor(Math.log(Math.abs(u))*Math.LOG10E)),w=Math.pow(10,Math.ceil(Math.log(Math.abs(w))*Math.LOG10E)))):(K?(u=Math.floor(u/De)*De,w=Math.ceil(w/De)*De):(u=Math.ceil(u/De)*De-Ve,w=Math.floor(w/De)*De+Ve),u<0&&re>=0&&(u=0),w>0&&ue<=0&&(w=0)),we=Math.log(Math.abs($))*Math.LOG10E,De=Math.pow(10,Math.floor(we)),De/=10;var Ke=Math.ceil($/G/De)*De,Qe=Math.pow(10,Math.floor(Math.log(Math.abs(Ke))*Math.LOG10E)),ft=Math.ceil(Ke/Qe);ft>5?ft=10:ft<=5&&ft>2&&(ft=5),Ke=Math.ceil(Ke/(Qe*ft))*Qe*ft,this.maxPrecisionre&&(u-=Ke)}return{min:u,max:w,step:Ke}},Object.defineProperty(R.prototype,"min",{get:function(){var u=this._minAdjusted;return ae(u)||(u=this._minDefined),u},set:function(u){this._minDefined!=u&&(this._minDefined=u,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"minDefined",{get:function(){return this._minDefined},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxDefined",{get:function(){return this._maxDefined},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"extraMin",{get:function(){return this.getPropertyValue("extraMin")},set:function(u){this.setPropertyValue("extraMin",u)&&this.invalidateDataItems()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"extraMax",{get:function(){return this.getPropertyValue("extraMax")},set:function(u){this.setPropertyValue("extraMax",u)&&this.invalidateDataItems()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"step",{get:function(){return this._step},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"max",{get:function(){var u=this._maxAdjusted;return ae(u)||(u=this._maxDefined),u},set:function(u){this._maxDefined!=u&&(this._maxDefined=u,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"adjustLabelPrecision",{get:function(){return this.getPropertyValue("adjustLabelPrecision")},set:function(u){this.setPropertyValue("adjustLabelPrecision",u)&&this.invalidate()},enumerable:!0,configurable:!0}),R.prototype.registerSeries=function(u){return new jn([U.prototype.registerSeries.call(this,u),u.events.on("extremeschanged",this.handleExtremesChange,this,!1),u.events.on("selectionextremeschanged",this.handleSelectionExtremesChange,this,!1),this.events.on("extremeschanged",u.invalidate,u,!1)])},R.prototype.handleSelectionExtremesChange=function(){var u,w,$=this,G=!0;if(ar(this.series.iterator(),function(Qe){if(!Qe.ignoreMinMax&&!Qe.isHidden&&!Qe.outOfRange){Qe.visible&&!Qe.isHiding&&(G=!1);var ft=Qe.selectionMin($),Gt=Qe.selectionMax($);ae(ft)&&(!ae(u)||ftw)&&(w=Gt)}}),this.includeRangesInMinMax&&this.axisRanges.each(function(Qe){if(!Qe.ignoreMinMax){var ft=H(Qe.value,Qe.endValue),Gt=ye(Qe.value,Qe.endValue);ftw&&(w=Gt)}}),ae(this._minDefined)?u=this.strictMinMax?this._minDefined:this.min:this.strictMinMax&&(u=this._minReal),ae(this._maxDefined)?w=this.strictMinMax?this._maxDefined:this.max:this.strictMinMax&&(w=this._maxReal),u==w){u-=this._deltaMinMax,w+=this._deltaMinMax;var K=this.adjustMinMax(u,w,0,this._gridCount,this.strictMinMax);u=K.min,w=K.max}var re=this.adjustDifference(u,w),ue=this.adjustMinMax(u,w,re,this._gridCount);u=ue.min,w=ue.max,u-=(w-u)*this.extraMin,w+=(w-u)*this.extraMax,u=nt(u,this.min,this.max),w=nt(w,this.min,this.max),re=this.adjustDifference(u,w),ue=this.adjustMinMax(u,w,re,this._gridCount,!0),u=ue.min,w=ue.max,this.strictMinMax&&(u=ye(u,this._minDefined),w=H(w,this._maxDefined));var we=ue.step;this.syncWithAxis&&(ue=this.syncAxes(u,w,we),u=ue.min,w=ue.max,this.invalidate()),we=ue.step,this._difference=this.adjustDifference(this.min,this.max);var De=this.valueToPosition(u),Ve=this.valueToPosition(w);G&&!this.syncWithAxis&&(De=0,Ve=1);var Ke=0;this.syncWithAxis?(Ke=5,this.setCache(u+"-"+w,we)):(this._step==we&&this._minZoomed==u&&this._maxZoomed==w||(this._dsc=!0),this._step=we,this._minZoomed=u,this._maxZoomed=w),this.keepSelection||this.zoom({start:De,end:Ve},!1,!1,Ke)},Object.defineProperty(R.prototype,"strictMinMax",{get:function(){return this.getPropertyValue("strictMinMax")},set:function(u){this.setPropertyValue("strictMinMax",u)&&this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"logarithmic",{get:function(){return this.getPropertyValue("logarithmic")},set:function(u){this.setPropertyValue("logarithmic",u)&&(this.invalidate(),this.series.each(function(w){w.invalidateDataItems()}))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"keepSelection",{get:function(){return this.getPropertyValue("keepSelection")},set:function(u){this.setPropertyValue("keepSelection",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"includeRangesInMinMax",{get:function(){return this.getPropertyValue("includeRangesInMinMax")},set:function(u){this.setPropertyValue("includeRangesInMinMax",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxPrecision",{get:function(){return this.getPropertyValue("maxPrecision")},set:function(u){this.setPropertyValue("maxPrecision",u)&&this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"extraTooltipPrecision",{get:function(){return this.getPropertyValue("extraTooltipPrecision")},set:function(u){this.setPropertyValue("extraTooltipPrecision",u)&&this.invalidate()},enumerable:!0,configurable:!0}),R.prototype.handleExtremesChange=function(){var u=this;this._extremesChanged=!0,this.getMinMax(),this.ghostLabel&&this.dataItems.each(function(w){w.label&&w.label.pixelWidth>0&&(u.ghostLabel.text=w.label.currentText)})},R.prototype.getX=function(u,w,$,G,K){return this.renderer.positionToPoint(this.getPositionX(u,w,$,G,K)).x},R.prototype.getPositionX=function(u,w,$,G,K){var re=u.getWorkingValue(w);Te(G)||(G="valueX");var ue=u.getValue(G,"stack");ae(re)||(re=this.baseValue,this.logarithmic&&ue>0&&(re=0));var we=this.valueToPosition(re+ue);return K&&(we=nt(we,K.start,K.end)),we},R.prototype.getY=function(u,w,$,G,K){return this.renderer.positionToPoint(this.getPositionY(u,w,$,G,K)).y},R.prototype.getPositionY=function(u,w,$,G,K){var re=u.getWorkingValue(w);Te(G)||(G="valueY");var ue=u.getValue(G,"stack");ae(re)||(re=this.baseValue,this.logarithmic&&ue>0&&(re=0));var we=this.valueToPosition(re+ue);return K&&(we=nt(we,K.start,K.end)),we},R.prototype.getAngle=function(u,w,$,G,K){var re=u.getWorkingValue(w),ue=u.getValue(G,"stack");ae(re)||(re=this.baseValue);var we=this.valueToPosition(re+ue);return K&&(we=nt(we,K.start,K.end)),this.positionToAngle(we)},R.prototype.getAnyRangePath=function(u,w,$){var G=this.valueToPosition(u),K=this.valueToPosition(w);return this.getPositionRangePath(G,K)},R.prototype.getTooltipText=function(u){var w=ze(this.positionToValue(u),this._stepDecimalPlaces+this.extraTooltipPrecision),$=this.tooltip.numberFormatter.format(w);return this._adapterO?this._adapterO.apply("getTooltipText",$):$},R.prototype.zoomToValues=function(u,w,$,G){var K=(u-this.min)/(this.max-this.min),re=(w-this.min)/(this.max-this.min);this.zoom({start:K,end:re},$,G)},Object.defineProperty(R.prototype,"minZoomed",{get:function(){return this.syncWithAxis?this._minZoomed:ye(this.min,this._minZoomed)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxZoomed",{get:function(){return this.syncWithAxis?this._maxZoomed:H(this.max,this._maxZoomed)},enumerable:!0,configurable:!0}),R.prototype.fixAxisBreaks=function(){var u=this;U.prototype.fixAxisBreaks.call(this);var w=this._axisBreaks;w&&w.length>0&&w.each(function($){var G=$.adjustedStartValue,K=$.adjustedEndValue,re=K-G,ue=Math.ceil(re*$.breakSize)*u._gridCount/(u.max-u.min),we=u.adjustMinMax(G,K,re,ue,!0);$.adjustedStep=we.step,$.adjustedMin=we.min,$.adjustedMax=we.max}),this._difference=this.adjustDifference(this.min,this.max)},R.prototype.getPositionLabel=function(u){var w=this.positionToValue(u);return this.numberFormatter.format(w)},R.prototype.showTooltipAt=function(u){this.showTooltipAtPosition(this.valueToPosition(u))},R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.min=u.min,this.max=u.max,this.calculateTotals=u.calculateTotals,this._baseValue=u.baseValue},Object.defineProperty(R.prototype,"syncWithAxis",{get:function(){return this.getPropertyValue("syncWithAxis")},set:function(u){var w=this;this.setPropertyValue("syncWithAxis",u,!0)&&u&&(this._disposers.push(u.events.on("extremeschanged",this.handleSelectionExtremesChange,this,!1)),this._disposers.push(u.events.on("selectionextremeschanged",this.handleSelectionExtremesChange,this,!1)),this._disposers.push(u.events.on("startendchanged",this.handleSelectionExtremesChange,this,!1)),this.events.on("shown",this.handleSelectionExtremesChange,this,!1),this.events.on("maxsizechanged",function(){w.clearCache(),w._disposers.push(pi.events.once("exitframe",function(){w.handleSelectionExtremesChange()}))},this,!1))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"treatZeroAs",{get:function(){return this.getPropertyValue("treatZeroAs")},set:function(u){this.setPropertyValue("treatZeroAs",u,!0)},enumerable:!0,configurable:!0}),R.prototype.syncAxes=function(u,w,$){var G=this.syncWithAxis;if(G){ae(u)||(u=this.min),ae(w)||(w=this.max),ae($)||($=this._step);var K=Math.round((G.maxZoomed-G.minZoomed)/G.step),re=Math.round((w-u)/$);if(ae(K)&&ae(re))for(var ue=!1,we=0,De=.01*(w-u),Ve=u,Ke=w,Qe=$;ue!=1;)if(ue=this.checkSync(Ve,Ke,Qe,K),++we>1e3&&(ue=!0),ue)u=Ve,w=Ke,$=Qe;else{we/3==Math.round(we/3)?(Ve=u-De*we,u>=0&&Ve<0&&(Ve=0)):(Ke=w+De*we)<=0&&Ke>0&&(Ke=0);var ft=this.adjustMinMax(Ve,Ke,Ke-Ve,this._gridCount,!0);Ve=ft.min,Ke=ft.max,Qe=ft.step}}return{min:u,max:w,step:$}},R.prototype.checkSync=function(u,w,$,G){for(var K=(w-u)/$,re=1;redi?(De.startIndex=0,De.endIndex=0,De.outOfRange=!0):(De.outOfRange=!1,De.startIndex=Gt,De.endIndex=rr),!$&&De.dataRangeInvalid&&De.validateDataRange()}})},R.prototype.findFirst=function(u,w,$){var G=u.index;if(G>0){var K=u.component.dataItems.getIndex(G-1),re=K[$];return!re||re.getTime()u._minDifference[$.uid]&&(w=u._minDifference[$.uid])}),w!=Number.MAX_VALUE&&w!=0||(w=Uu("day")),w},enumerable:!0,configurable:!0}),R.prototype.seriesDataChangeUpdate=function(u){this._minDifference[u.uid]=Number.MAX_VALUE},R.prototype.postProcessSeriesDataItems=function(u){var w=this;this._firstWeekDay=this.getFirstWeekDay(),u?this.seriesGroupUpdate(u):this.series.each(function($){w.seriesGroupUpdate($)}),this.addEmptyUnitsBreaks()},R.prototype.seriesGroupUpdate=function(u){var w=this;JSON.stringify(u._baseInterval[this.uid])!=JSON.stringify(this.mainBaseInterval)&&(u._baseInterval[this.uid]=this.mainBaseInterval,u.mainDataSet.each(function($){w.postProcessSeriesDataItem($)}),this.groupData&&this.groupSeriesData(u))},R.prototype.groupSeriesData=function(u){var w=this;if(u.baseAxis==this&&u.dataItems.length>0&&!u.dataGrouped){u.bulletsContainer.removeChildren();var $=[],G=this.mainBaseInterval,K=Uu(G.timeUnit,G.count);this.groupIntervals.each(function(re){var ue=Uu(re.timeUnit,re.count);(ue>K&&uekr||!ae(Er.low))&&(Er.low=kr),(Er.high0&&w.each(function($){var G=Math.ceil(u._gridCount*(Math.min(u.end,$.endPosition)-Math.max(u.start,$.startPosition))/(u.end-u.start));$.gridInterval=u.chooseInterval(0,$.adjustedEndValue-$.adjustedStartValue,G);var K=hd(new Date($.adjustedStartValue),$.gridInterval.timeUnit,$.gridInterval.count,u._firstWeekDay,u._df.utc,void 0,u._df.timezoneMinutes,u._df.timezone);K.getTime()>$.startDate.getTime()&&Ap(K,$.gridInterval.timeUnit,$.gridInterval.count,u._df.utc),$.gridDate=K})},R.prototype.getFirstWeekDay=function(){return this._df?this._df.firstDayOfWeek:1},R.prototype.getGridDate=function(u,w){var $=this._gridInterval.timeUnit,G=this._gridInterval.count;hd(u,$,1,this._firstWeekDay,this._df.utc,void 0,this._df.timezoneMinutes,this._df.timezone);var K=u.getTime(),re=eC(u),ue=Ap(re,$,w,this._df.utc).getTime(),we=this.isInBreak(ue);we&&we.endDate&&(hd(re=new Date(we.endDate.getTime()),$,G,this._firstWeekDay,this._df.utc,void 0,this._df.timezoneMinutes,this._df.timezone),re.getTime()0){var Ke=Ve.gridInterval.timeUnit,Qe=Ve.gridInterval.count;if(C(Ve.startPoint,Ve.endPoint)>4*De.minGridDistance)for(var ft,Gt=Ve.gridDate.getTime(),ei=0,di=function(){var ci=eC(Ve.gridDate);if(Gt=Ap(ci,Ke,Qe*ei,u._df.utc).getTime(),ei++,Gt>Ve.adjustedStartValue&&Gtthis.baseInterval.count&&(re=K+(re-K)/(this._gridInterval.count/this.baseInterval.count)),u.position=K;var we=u.tick;we&&!we.disabled&&w.updateTickElement(we,K,re);var De=u.grid;De&&!De.disabled&&w.updateGridElement(De,K,re);var Ve=u.axisFill;Ve&&!Ve.disabled&&(w.updateFillElement(Ve,K,ue),u.isRange||this.fillRule(u));var Ke=u.mask;Ke&&w.updateFillElement(Ke,K,re),u.bullet&&w.updateBullet(u.bullet,K,re);var Qe=u.label;if(Qe&&!Qe.disabled){var ft=Qe.location;ft==0&&(ft=this._gridInterval.count!=1||this._gridInterval.timeUnit=="week"||u.isRange?0:.5),w.updateLabelElement(Qe,K,re,ft)}}},Object.defineProperty(R.prototype,"baseDuration",{get:function(){return Uu(this.baseInterval.timeUnit,this.baseInterval.count)},enumerable:!0,configurable:!0}),R.prototype.adjustMinMax=function(u,w){return{min:u,max:w,step:this.baseDuration}},R.prototype.fixMin=function(u){var w=this.baseInterval,$=hd(new Date(u),w.timeUnit,w.count,this._firstWeekDay,this._df.utc,void 0,this._df.timezoneMinutes,this._df.timezone).getTime();return $+(Ap(new Date($),w.timeUnit,w.count,this._df.utc).getTime()-$)*this.startLocation},R.prototype.fixMax=function(u){var w=this.baseInterval,$=hd(new Date(u),w.timeUnit,w.count,this._firstWeekDay,this._df.utc,void 0,this._df.timezoneMinutes,this._df.timezone).getTime();return $+(Ap(new Date($),w.timeUnit,w.count,this._df.utc).getTime()-$)*this.endLocation},R.prototype.chooseInterval=function(u,w,$,G){G||(G=this.gridIntervals);var K=G.getIndex(u),re=Uu(K.timeUnit,K.count),ue=G.length-1;if(u>=ue)return ce({},G.getIndex(ue));var we=Math.ceil(w/re);return w0?ce({},G.getIndex(u-1)):we<=$?ce({},G.getIndex(u)):u+1De&&(this._minDifference[G.uid]=De)}var Ve=$-we;Ve>0&&this._minDifference[G.uid]>Ve&&(this._minDifference[G.uid]=Ve),this._prevSeriesTime[G.uid]=$,G._baseInterval[this.uid]&&this.postProcessSeriesDataItem(u)}},R.prototype.updateAxisBySeries=function(){U.prototype.updateAxisBySeries.call(this);var u=this.chooseInterval(0,this.minDifference,1);this.minDifference>=Uu("day",27)&&u.timeUnit=="week"&&(u.timeUnit="month",u.count=1),u.timeUnit=="month"&&(this.minDifference>=Uu("day",58)&&u.count==1&&(u.count=2),this.minDifference>=Uu("day",87)&&u.count==2&&(u.count=3),this.minDifference>=Uu("day",174)&&u.count==5&&(u.count=6)),this.minDifference>=Uu("hour",23)&&u.timeUnit=="hour"&&(u.timeUnit="day",u.count=1),this.minDifference>=Uu("week",1)-Uu("hour",1)&&u.timeUnit=="day"&&(u.timeUnit="week",u.count=1),this.minDifference>=Uu("year",1)-Uu("day",1.01)&&u.timeUnit=="month"&&(u.timeUnit="year",u.count=1),this._baseIntervalReal=u,this._mainBaseInterval=u},Object.defineProperty(R.prototype,"baseInterval",{get:function(){return this._groupInterval?this._groupInterval:this._baseInterval?this._baseInterval:this._baseIntervalReal},set:function(u){JSON.stringify(this._baseInterval)!=JSON.stringify(u)&&(this._baseInterval=u,this._mainBaseInterval=u,ae(u.count)||(u.count=1),this.invalidate(),this.postProcessSeriesDataItems())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"mainBaseInterval",{get:function(){return this._baseInterval?this._baseInterval:this._mainBaseInterval?this._mainBaseInterval:this._baseIntervalReal},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"skipEmptyPeriods",{get:function(){return this.getPropertyValue("skipEmptyPeriods")},set:function(u){if(u){var w=this.axisBreaks.template;w.startLine.disabled=!0,w.endLine.disabled=!0,w.fillShape.disabled=!0,w.breakSize=0}else this._gapBreaks&&(this.axisBreaks.clear(),this._gapBreaks=!1);this.setPropertyValue("skipEmptyPeriods",u)&&(this.invalidate(),this.postProcessSeriesDataItems(),this.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tooltipDateFormat",{get:function(){return this.getPropertyValue("tooltipDateFormat")},set:function(u){this.setPropertyValue("tooltipDateFormat",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"markUnitChange",{get:function(){return this.getPropertyValue("markUnitChange")},set:function(u){this.setPropertyValue("markUnitChange",u)&&this.invalidateData()},enumerable:!0,configurable:!0}),R.prototype.getTooltipText=function(u){var w,$=this.positionToDate(u);if($=hd($,this.baseInterval.timeUnit,this.baseInterval.count,this._firstWeekDay,this._df.utc,new Date(this.min),this._df.timezoneMinutes,this._df.timezone),this.tooltipDate=$,Te(this.tooltipDateFormat))w=this._df.format($,this.tooltipDateFormat,["day","month","week","year"].indexOf(this.baseInterval.timeUnit)==-1);else{var G=this.dateFormats.getKey(this.baseInterval.timeUnit);w=G?this._df.format($,G):this.getPositionLabel(u)}return this._adapterO?this._adapterO.apply("getTooltipText",w):w},R.prototype.roundPosition=function(u,w,$){var G=this.baseInterval,K=G.timeUnit,re=G.count,ue=this.positionToDate(u);if(hd(ue,K,re,this._firstWeekDay,this._df.utc,void 0,this._df.timezoneMinutes,this._df.timezone),w>0&&Ap(ue,K,w*re,this._df.utc),$>0&&$<1&&ue.setTime(ue.getTime()+this.baseDuration*$),this.isInBreak(ue.getTime()))for(;ue.getTime()re.getTime()&&Math.abs(ue.getTime()-K)Gt&&(Gt=rr)}),this.groupMin[Qe]=ft,this.groupMax[Qe]=Gt),u=nt(u,ft,Gt),w=nt(w,ft,Gt),K&&(we&&(u=nt(u=w-ue,ft,Gt)),De&&(w=nt(w=u+ue,ft,Gt))),ei=(u-ft)/(Gt-ft),di=(w-ft)/(Gt-ft),this.zoom({start:ei,end:di},$,G)}}else{var ei=this.valueToPosition(u),di=this.valueToPosition(w);this.zoom({start:ei,end:di},$,G)}},R.prototype.asIs=function(u){return u=="baseInterval"||U.prototype.asIs.call(this,u)},R.prototype.copyFrom=function(u){var w=this;U.prototype.copyFrom.call(this,u),this.dateFormats=u.dateFormats,this.periodChangeDateFormats=u.periodChangeDateFormats,this.groupIntervals.clear(),u.groupIntervals.each(function($){w.groupIntervals.push(ce({},$))}),this.gridIntervals.clear(),u.gridIntervals.each(function($){w.gridIntervals.push(ce({},$))}),u._baseInterval&&(this.baseInterval=u._baseInterval)},R.prototype.showTooltipAtPosition=function(u,w){var $=this;if(w||(u=this.toAxisPosition(u)),this.snapTooltip){var G,K=this.positionToDate(u).getTime();if(this.series.each(function(we){if(we.baseAxis==$){var De=$.getSeriesDataItem(we,u,!0);if(De){var Ve=void 0;we.xAxis==$&&(Ve=De.dateX),we.yAxis==$&&(Ve=De.dateY),G?Math.abs(G.getTime()-K)>Math.abs(Ve.getTime()-K)&&(G=Ve):G=Ve}}}),G){var re=G.getTime();G=hd(new Date(re),this.baseInterval.timeUnit,this.baseInterval.count,this._firstWeekDay,this._df.utc,void 0,this._df.timezoneMinutes,this._df.timezone),re=G.getTime();var ue=this.renderer.tooltipLocation;ue==0&&(ue=1e-4),G=new Date(G.getTime()+this.baseDuration*ue),u=this.dateToPosition(G),this.chart.cursor&&this.chart.cursor.snapToSeries||this.series.each(function(we){var De=we.dataItemsByAxis.getKey($.uid).getKey(re+we.currentDataSetId),Ve=we.showTooltipAtDataItem(De);Ve?$.chart._seriesPoints.push({series:we,point:Ve}):(we.tooltipText||we.tooltipHTML)&&we.hideTooltip()})}}U.prototype.showTooltipAtPosition.call(this,u,!0)},Object.defineProperty(R.prototype,"snapTooltip",{get:function(){return this.getPropertyValue("snapTooltip")},set:function(u){this.setPropertyValue("snapTooltip",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"groupData",{get:function(){return this.getPropertyValue("groupData")},set:function(u){var w=this;this.setPropertyValue("groupData",u)&&(this.series.each(function($){$.setDataSet(""),u&&!$.dataGrouped&&$.inited&&($._baseInterval[w.uid]=w.mainBaseInterval,w.groupSeriesData($))}),this._currentDataSetId="",this._groupInterval=void 0,this.invalidate(),this.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"groupInterval",{get:function(){return this.getPropertyValue("groupInterval")},set:function(u){this.setPropertyValue("groupInterval",u)&&(this.invalidate(),this.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"groupCount",{get:function(){return this.getPropertyValue("groupCount")},set:function(u){this.setPropertyValue("groupCount",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"timezoneOffset",{get:function(){return this.getPropertyValue("timezoneOffset")},set:function(u){this.setPropertyValue("timezoneOffset",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"timezone",{get:function(){return this.getPropertyValue("timezone")},set:function(u){this.setPropertyValue("timezone",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"gridInterval",{get:function(){return this._gridInterval},enumerable:!0,configurable:!0}),R.prototype.makeGap=function(u,w){var $=u.component;if(u&&w&&!$.connect&&ae($.autoGapCount)&&$.baseAxis==this){var G=u.dates["date"+this.axisLetter],K=w.dates["date"+this.axisLetter];if(G&&K&&G.getTime()-K.getTime()>$.autoGapCount*this.baseDuration)return!0}return!1},Object.defineProperty(R.prototype,"baseValue",{get:function(){return this.min},enumerable:!0,configurable:!0}),R}(Ro);pi.registeredClasses.DateAxis=dc,pi.registeredClasses.DateAxisDataItem=hie;var Vd=function(U){function R(){var u=U.call(this)||this;return u.className="AxisRendererX",u.minGridDistance=120,u.opposite=!1,u.rotation=0,u.width=de(100),u.labels.template.horizontalCenter="middle",u.applyTheme(),u}return ie(R,U),R.prototype.setAxis=function(u){U.prototype.setAxis.call(this,u),u.layout="vertical"},R.prototype.updateGridContainer=function(){var u=this.axis;if(u){var w=this.gridContainer;w.x=u.pixelX,w.width=u.axisLength}},R.prototype.processRenderer=function(){U.prototype.processRenderer.call(this);var u=this.axis;if(u){u.width instanceof J||(u.width=de(100)),this.line;var w=u.title;w.rotation=0,w.align="center",this.opposite?(this.line.toFront(),w.toBack()):(w.toFront(),this.toBack(),this.line.toBack())}},R.prototype.updateTooltip=function(){if(this.axis){var u=1e3,w=this.line.pixelX,$=this.line.pixelY,G=this.axisLength,K=u;this.opposite?this.inside||($=-1e3,K=u):this.inside&&($=-1e3,K=u),this.axis.updateTooltip("vertical",{x:w,y:$,width:G,height:K})}},R.prototype.updateLabelElement=function(u,w,$,G){Te(G)||(G=u.location),w+=($-w)*G;var K=this.positionToPoint(w);u.isMeasured=!u.inside;var re,ue=0,we=this.gridContainer.maxHeight;this.opposite?(u.inside?(re="top",u.valign=="bottom"&&(ue=we,re="bottom"),u.valign=="middle"&&(ue=we/2,re="middle")):re="bottom",K.y=ue):(u.inside?(re="bottom",u.valign=="top"&&(ue=-we,re="top"),u.valign=="middle"&&(ue=-we/2,re="middle")):re="top",K.y+=ue),u.rotation==0&&(u.verticalCenter=re),this.positionItem(u,K),this.toggleVisibility(u,w,this.minLabelPosition,this.maxLabelPosition)},Object.defineProperty(R.prototype,"axisLength",{get:function(){var u=this.axis;return u.measuredWidth-u.pixelPaddingRight-u.pixelPaddingLeft||0},enumerable:!0,configurable:!0}),R.prototype.positionToPoint=function(u,w){return{x:this.positionToCoordinate(u),y:0}},R.prototype.pointToPosition=function(u){return this.coordinateToPosition(u.x,u.y)},R.prototype.getPositionRangePath=function(u,w){var $=nt(this.positionToCoordinate(u),0,this.axisLength),G=nt(this.positionToCoordinate(w),0,this.axisLength),K=Math.abs(G-$),re=this.getHeight();return aC({x:Math.min($,G),y:0,width:K,height:re},!0)},R.prototype.updateBreakElement=function(u){U.prototype.updateBreakElement.call(this,u);var w=u.startLine,$=u.endLine,G=u.fillShape,K=u.startPoint,re=u.endPoint,ue=u.pixelMarginLeft,we=this.getHeight()-u.pixelMarginTop-u.pixelMarginBottom;K.x=nt(K.x,-1,this.axisLength+1),re.x=nt(re.x,-1,this.axisLength+1),K.x==re.x&&(K.x<0||K.x>this.axisLength)?u.fillShape.__disabled=!0:u.fillShape.__disabled=!1,w.y=ue,w.width=0,w.height=we,$.y=ue,$.width=0,$.height=we,G.height=we,G.width=Math.abs(re.x-K.x),G.y=ue,G.x=K.x},R.prototype.updateGridElement=function(u,w,$){w+=($-w)*u.location;var G=this.positionToPoint(w);u.path=wn({x:0,y:0})+Rr({x:0,y:this.getHeight()}),this.positionItem(u,G),this.toggleVisibility(u,w,0,1)},R.prototype.updateTickElement=function(u,w,$){w+=($-w)*u.location;var G=this.positionToPoint(w),K=u.length;G.y=Ip({x:0,y:this.line.pixelY},this.line.parent,this.gridContainer).y,this.opposite?K*=u.inside?1:-1:K*=u.inside?-1:1,u.path=wn({x:0,y:0})+Rr({x:0,y:K}),this.positionItem(u,G),this.toggleVisibility(u,w,0,1)},R.prototype.updateAxisLine=function(){this.line.path=wn({x:0,y:0})+Rr({x:this.axisLength,y:0})},R.prototype.updateBaseGridElement=function(){U.prototype.updateBaseGridElement.call(this);var u=this.axis,w=this.getHeight(),$=this.axisLength,G=this.baseGrid,K=u.basePoint.x;if(K<-.2||K>$+.2)G.hide(0);else{var re=Ip({x:0,y:0},this.gridContainer,G.parent).y;G.path=wn({x:0,y:0})+Rr({x:0,y:w}),G.moveTo({x:K,y:re}),G.show(0)}},R.prototype.createBreakSprites=function(u){u.startLine=new Lr,u.endLine=new Lr;var w=new Z$;w.setWavedSides(!1,!0,!1,!0),u.fillShape=w},R.prototype.toAxisPosition=function(u){var w=u,$=this.axis;if($){var G=$.relativePositionSprite,K=$.pixelX;if(G?K=Ip({x:this.pixelX,y:0},this.parent,G).x:G=$.parent,G)return(w-K/G.innerWidth)/($.axisLength/G.innerWidth)}return u},R.prototype.updateBullet=function(u,w,$){var G=.5;u instanceof z4&&(G=u.location),w+=($-w)*G;var K=this.positionToPoint(w);K.y=Ip({x:0,y:this.line.pixelY},this.line.parent,this.gridContainer).y,this.positionItem(u,K),this.toggleVisibility(u,w,0,1)},R}(a8);pi.registeredClasses.AxisRendererX=Vd,sp.push({relevant:Mf.heightXS,state:function(U,R){if(U instanceof Vd){var u=U.states.create(R);return u.properties.inside=!0,u.properties.maxLabelPosition=.9,u.properties.minLabelPosition=.1,u}return null}}),sp.push({relevant:Mf.heightXXS,state:function(U,R){if(U instanceof Vd){var u=U.states.create(R);return u.properties.disabled=!0,u}return null}});var die=function(U){function R(){var u=U.call(this)||this;return u.className="CategoryAxisBreak",u.properties.startLocation=.5,u.properties.endLocation=.5,u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"startPosition",{get:function(){if(this.axis)return this.axis.indexToPosition(this.adjustedStartValue,this.startLocation)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endPosition",{get:function(){if(this.axis)return this.axis.indexToPosition(this.adjustedEndValue,this.endLocation)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startCategory",{get:function(){return this.getPropertyValue("startCategory")},set:function(u){this.setPropertyValue("startCategory",u)&&this.axis&&(this.axis.invalidateDataItems(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endCategory",{get:function(){return this.getPropertyValue("endCategory")},set:function(u){this.setPropertyValue("endCategory",u)&&this.axis&&(this.axis.invalidateDataItems(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startValue",{get:function(){var u=this.getPropertyValue("startCategory");return u?this.axis.categoryToIndex(u):this.getPropertyValue("startValue")},set:function(u){this.setPropertyValue("startValue",u)&&this.axis&&(this.axis.invalidateDataItems(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endValue",{get:function(){var u=this.getPropertyValue("endCategory");return u?this.axis.categoryToIndex(u):this.getPropertyValue("endValue")},set:function(u){this.setPropertyValue("endValue",u)&&this.axis&&(this.axis.invalidateDataItems(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startLocation",{get:function(){return this.getPropertyValue("startLocation")},set:function(u){this.setPropertyValue("startLocation",u)&&this.axis&&(this.axis.invalidateDataItems(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endLocation",{get:function(){return this.getPropertyValue("endLocation")},set:function(u){this.setPropertyValue("endLocation",u)&&this.axis&&(this.axis.invalidateDataItems(),this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),R}(s8);pi.registeredClasses.CategoryAxisBreak=die;var $x=function(U){function R(){var u=U.call(this)||this;return u.seriesDataItems={},u.className="CategoryAxisDataItem",u.text="{category}",u.locations.category=0,u.locations.endCategory=1,u.deltaPosition=0,u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"category",{get:function(){return this._adapterO&&this._adapterO.isEnabled("category")?this._adapterO.apply("category",this.properties.category):this.properties.category},set:function(u){var w=this.properties.category;this.setProperty("category",u),Te(w)&&w!=u&&this.component&&this.component.validateDataElement(this)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endCategory",{get:function(){return this.properties.endCategory},set:function(u){this.setProperty("endCategory",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"deltaPosition",{get:function(){return this.properties.deltaCoordinate},set:function(u){u!=this.properties.deltaCoordinate&&(this.setProperty("deltaCoordinate",u),this.component&&(this.component.invalidateDataItems(),this.component.invalidateSeries()))},enumerable:!0,configurable:!0}),R}(cC),jh=function(U){function R(){var u=U.call(this)||this;u.dataItemsByCategory=new Ea,u.className="CategoryAxis",u.axisFieldName="category",u._lastDataItem=u.createDataItem(),u._lastDataItem.component=u,u._disposers.push(u._lastDataItem),u.applyTheme();var w=u.dataItemsByCategory;return u.addDisposer(u.mainDataSet.events.on("removed",function($){w.removeKey($.oldValue.category)})),u}return ie(R,U),R.prototype.createDataItem=function(){return new $x},R.prototype.createAxisBreak=function(){return new die},R.prototype.processSeriesDataItem=function(u,w){U.prototype.processSeriesDataItem.call(this,u,w);var $=u["category"+this.axisLetter];if(Te($)){var G=this.dataItemsByCategory.getKey($);if(G){var K=u.component.uid,re=G.seriesDataItems[K];re||(re=[],G.seriesDataItems[K]=re),re.push(u)}}else u.component.dataItems.remove(u)},R.prototype.validateDataRange=function(){var u=this;U.prototype.validateDataRange.call(this),ar(this._series.iterator(),function(w){if(w.xAxis instanceof R&&w.yAxis instanceof R)w.invalidateDataRange();else{var $=u.positionToIndex(u.start),G=u.positionToIndex(u.end);G>=u.dataItems.length&&G--;for(var K=w.uid,re=void 0,ue=void 0,we=$;we<=G;we++){var De=u.dataItems.getIndex(we);if(De){var Ve=De.seriesDataItems[K];if(Ve)for(var Ke=0;Keue)&&(ue=ft)}}}}ae(re)?w.startIndex=re:w.start=u.start,ae(ue)?w.endIndex=ue+1:w.end=u.end,u._axisBreaks&&u._axisBreaks.length>0&&w.invalidateDataRange()}})},R.prototype.validate=function(){var u=this;U.prototype.validate.call(this);var w=this.dataItems.length,$=nt(Math.floor(this.start*w-1),0,w),G=nt(Math.ceil(this.end*w),0,w);this.renderer.invalid&&this.renderer.validate();var K=this.renderer.axisLength/Math.max(this.renderer.minGridDistance,1/Number.MAX_SAFE_INTEGER),re=Math.min(this.dataItems.length,Math.ceil((G-$)/K));if(this._startIndex=Math.floor($/re)*re,this._endIndex=Math.ceil(this.end*w),this.fixAxisBreaks(),this._startIndex==this._endIndex&&this._endIndex++,this._frequency=re,!(this.axisLength<=0)){this.maxZoomFactor=this.dataItems.length,this.dataItems.length<=0&&(this.maxZoomFactor=1),this.resetIterators(),$=ye(0,this._startIndex-this._frequency),G=H(this.dataItems.length,this._endIndex+this._frequency);for(var ue=0,we=0;we<$;we++)(Ve=this.dataItems.getIndex(we)).__disabled=!0;we=G;for(var De=this.dataItems.length;we0)for(Gt=Qe;Gt<=ft;Gt+=ei){var ci;(ci=u.dataItems.getIndex(Gt)).__disabled=!1,u.appendDataItem(ci),u.validateDataElement(ci,di),di++}}}),this.validateBreaks(),this.validateAxisRanges(),this.ghostLabel.invalidate(),this.renderer.invalidateLayout()}},R.prototype.validateDataElement=function(u,w,$){U.prototype.validateDataElement.call(this,u),u.itemIndex=this._axisItemCount,this._axisItemCount++;var G=this.renderer;ae($)||($=this.categoryToIndex(u.category));var K=this.categoryToIndex(u.endCategory);ae(K)||(K=$);var re,ue,we,De=this.indexToPosition($,u.locations.category),Ve=this.indexToPosition(K,u.locations.endCategory);u.position=De,u.isRange&&(re=K,ue=this.indexToPosition($,u.locations.category),we=this.indexToPosition(re,u.locations.endCategory)),u.point=G.positionToPoint(De);var Ke=u.tick;Ke&&!Ke.disabled&&G.updateTickElement(Ke,De,Ve);var Qe=u.grid;Qe&&!Qe.disabled&&G.updateGridElement(Qe,De,Ve);var ft=u.label;ft&&!ft.disabled&&(u.isRange&&ft.text!=null||(u.text=u.text),G.updateLabelElement(ft,De,Ve),(G instanceof T1&&u.label.measuredWidth>this.ghostLabel.measuredWidth||G instanceof Vd&&u.label.measuredHeight>this.ghostLabel.measuredHeight)&&(u.label.html?this.ghostLabel.html=u.label.currentText:this.ghostLabel.text=u.label.currentText));var Gt=u.axisFill;Gt&&!Gt.disabled&&(u.isRange||(re=$+this._frequency,ue=this.indexToPosition($,Gt.location),we=this.indexToPosition(re,Gt.location)),G.updateFillElement(Gt,ue,we),u.isRange||this.fillRule(u,w)),u.bullet&&G.updateBullet(u.bullet,De,Ve);var ei=u.mask;ei&&G.updateFillElement(ei,ue,we)},R.prototype.disposeData=function(){this.dataItemsByCategory.clear(),U.prototype.disposeData.call(this)},R.prototype.processDataItem=function(u,w){u&&(U.prototype.processDataItem.call(this,u,w),Te(u.category)&&this.dataItemsByCategory.setKey(u.category,u))},R.prototype.getDataItem=function(u){var w=u[this.dataFields.category];if(Te(w))return this.dataItemsByCategory.getKey(w)||this.dataItems.create()},R.prototype.indexToPosition=function(u,w){ae(w)||(w=.5);var $=this.startIndex,G=this.endIndex,K=this.adjustDifference($,G),re=this.startLocation;K-=re,K-=1-this.endLocation,this._axisBreaks&&on(this._axisBreaks.iterator(),function(De){var Ve=De.adjustedStartValue,Ke=De.adjustedEndValue;if(u<$||!ae(Ve)||!ae(Ke))return!1;if(b({start:Ve,end:Ke},{start:$,end:G})){Ve=Math.max($,Ve),Ke=Math.min(G,Ke);var Qe=De.breakSize;u>Ke?$+=(Ke-Ve)*(1-Qe):u=0;$--){var G=u.dataItems.getIndex($);if(u.xAxis==this&&G.categoryX==w||u.yAxis==this&&G.categoryY==w)return G}},R.prototype.getSeriesDataItemByCategory=function(u,w){var $,G=this;return w.dataItems.each(function(K){w.xAxis==G?K.categoryX==u&&($=K):w.yAxis==G&&K.categoryY==u&&($=K)}),$},R.prototype.getSeriesDataItem=function(u,w,$){var G=this;if(ae(w)){var K=this.positionToIndex(w);K>=this.dataItems.length&&K--;var re=this.dataItems.getIndex(K);if(re){var ue,we=re.category,De=u.dataItems.getIndex(K);return De&&(u.xAxis==this&&De.categoryX==we||u.yAxis==this&&De.categoryY==we)?De:(u.dataItems.each(function(Ve){u.xAxis==G&&Ve.categoryX==we&&(ue||(ue=Ve),Math.abs(K-ue.index)>Math.abs(K-Ve.index)&&(ue=Ve)),u.yAxis==G&&Ve.categoryY==we&&(ue||(ue=Ve),Math.abs(K-ue.index)>Math.abs(K-Ve.index)&&(ue=Ve))}),ue)}}},R.prototype.getX=function(u,w,$,G,K){var re=this.getPositionX(u,w,$,G,K);return Ie(re)?this.basePoint.x:this.renderer.positionToPoint(re).x},R.prototype.getPositionX=function(u,w,$,G,K){var re;return Te(w)&&(re=this.categoryToPosition(u.categories[w],$)),K&&(re=nt(re,K.start,K.end)),re},R.prototype.getY=function(u,w,$,G,K){var re=this.getPositionY(u,w,$,G,K);return Ie(re)?this.basePoint.y:this.renderer.positionToPoint(re).y},R.prototype.getPositionY=function(u,w,$,G,K){var re;return Te(w)&&(re=this.categoryToPosition(u.categories[w],$)),K&&(re=nt(re,K.start,K.end)),re},R.prototype.getAngle=function(u,w,$,G,K){var re=this.categoryToPosition(u.categories[w],$);return K&&(re=nt(re,K.start,K.end)),this.positionToAngle(re)},R.prototype.getCellStartPosition=function(u){return this.roundPosition(u,0)},R.prototype.getCellEndPosition=function(u){return this.roundPosition(u,1)},R.prototype.getTooltipText=function(u){var w=this.dataItems.getIndex(this.positionToIndex(u));if(w)return this.tooltipDataItem=w,this.tooltip.dataItem=w,this.tooltipText?this.tooltipText:this._adapterO?this._adapterO.apply("getTooltipText",w.category):w.category},R.prototype.positionToIndex=function(u){(u=ze(u,10))<0&&(u=0),u>1&&(u=1);var w=this.startIndex,$=this.endIndex,G=$-w-this.startLocation-(1-this.endLocation);u+=1/G*this.startLocation;var K=null;return this._axisBreaks&&on(this._axisBreaks.iterator(),function(re){var ue=re.startPosition,we=re.endPosition,De=re.adjustedStartValue,Ve=re.adjustedEndValue;De=ye(De,w),Ve=H(Ve,$);var Ke=re.breakSize;if(G-=(Ve-De)*(1-Ke),u>we)w+=(Ve-De)*(1-Ke);else if(!(u=this.dataItems.length&&(K=this.dataItems.length-1),K},R.prototype.positionToCategory=function(u){return this.getPositionLabel(u)},R.prototype.getPositionLabel=function(u){var w=this.dataItems.getIndex(this.positionToIndex(u));if(w)return w.category},Object.defineProperty(R.prototype,"basePoint",{get:function(){return this.renderer.positionToPoint(1)},enumerable:!0,configurable:!0}),R.prototype.initRenderer=function(){U.prototype.initRenderer.call(this),this.renderer.baseGrid.disabled=!0},Object.defineProperty(R.prototype,"frequency",{get:function(){return this._frequency},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"sortBySeries",{get:function(){return this.getPropertyValue("sortBySeries")},set:function(u){this.setPropertyValue("sortBySeries",u,!0)},enumerable:!0,configurable:!0}),R.prototype.processConfig=function(u){u&&Te(u.sortBySeries)&&ct(u.sortBySeries)&&(this.map.hasKey(u.sortBySeries)?u.sortBySeries=this.map.getKey(u.sortBySeries):(this.addDelayedMap("sortBySeries",u.sortBySeries),delete u.sortBySeries)),U.prototype.processConfig.call(this,u)},R}(o8);pi.registeredClasses.CategoryAxis=jh,pi.registeredClasses.CategoryAxisDataItem=$x;var rg=function(U){function R(){var u=U.call(this)||this;return u.className="XYSeriesDataItem",u.values.customValue={},u.values.valueX={stack:0},u.values.valueY={stack:0},u.values.openValueX={},u.values.openValueY={},u.values.dateX={},u.values.dateY={},u.values.openDateX={},u.values.openDateY={},u.setLocation("dateX",.5,0),u.setLocation("dateY",.5,0),u.setLocation("categoryX",.5,0),u.setLocation("categoryY",.5,0),u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"valueX",{get:function(){return this.values.valueX.value},set:function(u){this.setValue("valueX",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"customValue",{get:function(){return this.values.customValue.value},set:function(u){this.setValue("customValue",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"valueY",{get:function(){return this.values.valueY.value},set:function(u){this.setValue("valueY",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dateX",{get:function(){return this.getDate("dateX")},set:function(u){this.setDate("dateX",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dateY",{get:function(){return this.getDate("dateY")},set:function(u){this.setDate("dateY",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"categoryX",{get:function(){return this.categories.categoryX},set:function(u){this.setCategory("categoryX",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"categoryY",{get:function(){return this.categories.categoryY},set:function(u){this.setCategory("categoryY",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"openValueX",{get:function(){return this.values.openValueX.value},set:function(u){this.setValue("openValueX",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"openValueY",{get:function(){return this.values.openValueY.value},set:function(u){this.setValue("openValueY",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"openDateX",{get:function(){return this.getDate("openDateX")},set:function(u){this.setDate("openDateX",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"openDateY",{get:function(){return this.getDate("openDateY")},set:function(u){this.setDate("openDateY",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"openCategoryX",{get:function(){return this.categories.openCategoryX},set:function(u){this.setCategory("openCategoryX",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"openCategoryY",{get:function(){return this.categories.openCategoryY},set:function(u){this.setCategory("openCategoryY",u)},enumerable:!0,configurable:!0}),R.prototype.getMin=function(u,w,$){var G,K=this;return ae($)||($=0),wi(u,function(re){var ue;ue=w?K.getWorkingValue(re):K.getValue(re),((ue+=$)G||!ae(G))&&(G=ue)}),G},R}(r8),kI=function(U){function R(){var u=U.call(this)||this;return u.groupFields={},u._xAxis=new Kn,u._yAxis=new Kn,u._xValueFields=[],u._yValueFields=[],u._baseInterval={},u.dataGrouped=!1,u.usesShowFields=!1,u._dataSetChanged=!1,u._maxxX=1e5,u._maxxY=1e5,u._propertiesChanged=!1,u.outOfRange=!1,u.className="XYSeries",u.isMeasured=!1,u.groupFields.valueX="close",u.groupFields.valueY="close",u.groupFields.customValue="close",u.groupFields.openValueX="open",u.groupFields.openValueY="open",u.cursorTooltipEnabled=!0,u.cursorHoverEnabled=!0,u.excludeFromTotal=!1,u.mainContainer.mask=new yo,u.mainContainer.mask.setElement(u.paper.add("path")),u.stacked=!1,u.snapTooltip=!1,u._showBullets=!1,u.tooltip.pointerOrientation="horizontal",u.properties.stackToNegative=!0,u.hideTooltipWhileZooming=!0,u.setPropertyValue("maskBullets",!0),u.tooltip.events.on("hidden",function(){u.returnBulletDefaultState()},void 0,!1),u._disposers.push(u._xAxis),u._disposers.push(u._yAxis),u.observe(wc,function(){u.inited&&(u._propertiesChanged=!0,u.legendDataItem&&(u.legendDataItem.childrenCreated=!1),u.chart&&u.chart.legend&&u.chart.legend.invalidateDataItems(),u.invalidate())},void 0,!1),u.applyTheme(),u}return ie(R,U),R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),Te(this.readerTitle)||(this.readerTitle=this.language.translate("X/Y Series"))},R.prototype.createDataItem=function(){return new rg},R.prototype.resetExtremes=function(){this._tmin.clear(),this._tmax.clear(),this._smin.clear(),this._smax.clear()},R.prototype.dataChangeUpdate=function(){this.dataGrouped=!1,this._baseInterval={},this._currentDataSetId="",this.resetExtremes(),this.xAxis&&this.xAxis.seriesDataChangeUpdate(this),this.yAxis&&this.yAxis.seriesDataChangeUpdate(this)},R.prototype.validateData=function(){this._baseInterval={};var u=this.dataFields;if(u.valueYShow||u.openValueXShow||u.openValueXShow||u.openValueYShow?this.usesShowFields=!0:this.usesShowFields=!1,this.defineFields(),this.data.length>0&&this.dataChangeUpdate(),U.prototype.validateData.call(this),this.updateItemReaderText(),this.chart&&(!Te(this.dataFields[this._xField])||!Te(this.dataFields[this._yField])))throw Error('Data fields for series "'+(this.name?this.name:this.uid)+'" are not properly defined.');this.inited&&this.isHidden&&this.hide(0),this.dataGrouped=!1},R.prototype.processDataItem=function(u,w){try{U.prototype.processDataItem.call(this,u,w),this.xAxis.processSeriesDataItem(u,"X"),this.yAxis.processSeriesDataItem(u,"Y"),this.setInitialWorkingValues(u)}catch($){this._chart&&this._chart.raiseCriticalError($)}},R.prototype.updateDataItem=function(u){U.prototype.updateDataItem.call(this,u),this.xAxis.processSeriesDataItem(u,"X"),this.yAxis.processSeriesDataItem(u,"Y")},R.prototype.setInitialWorkingValues=function(u){},R.prototype.disposeData=function(){U.prototype.disposeData.call(this);var u=this.xAxis,w=this.yAxis;if(u){var $=this.dataItemsByAxis.getKey(u.uid);$&&$.clear(),u instanceof jh&&this.clearCatAxis(u)}if(w){var G=this.dataItemsByAxis.getKey(w.uid);G&&G.clear(),w instanceof jh&&this.clearCatAxis(w)}},R.prototype.clearCatAxis=function(u){var w=this.uid;u.dataItems.each(function($){$.seriesDataItems[w]&&($.seriesDataItems[w]=[])})},R.prototype.defineFields=function(){var u=this.xAxis,w=this.yAxis;if(u&&w){var $=u.axisFieldName,G=$+"X",K="open"+cc($)+"X",re=w.axisFieldName,ue=re+"Y",we="open"+cc(re)+"Y";this._xField=G,this._yField=ue,this.dataFields[K]&&(this._xOpenField=K),this.dataFields[we]&&(this._yOpenField=we),this.dataFields[we]||this.baseAxis!=w||(this._yOpenField=ue),this.dataFields[K]||this.baseAxis!=u||(this._xOpenField=G),this.stacked&&this.baseAxis==u&&(this._xOpenField=G),this.stacked&&this.baseAxis==w&&(this._yOpenField=ue),u instanceof jh&&w instanceof jh&&(this._yOpenField||(this._yOpenField=ue)),this._xValueFields=[],this._yValueFields=[],this.addValueField(u,this._xValueFields,this._xField),this.addValueField(u,this._xValueFields,this._xOpenField),this.addValueField(w,this._yValueFields,this._yField),this.addValueField(w,this._yValueFields,this._yOpenField)}},R.prototype.addValueField=function(u,w,$){u instanceof Ro&&Te(this.dataFields[$])&&w.indexOf($)==-1&&w.push($)},R.prototype.setCategoryAxisField=function(u,w){Te(this.dataFields[u])||(this.dataFields[u]=w.dataFields.category)},R.prototype.setDateAxisField=function(u,w){Te(this.dataFields[u])||(this.dataFields[u]=w.dataFields.date)},R.prototype.afterDraw=function(){U.prototype.afterDraw.call(this),this.createMask()},R.prototype.createMask=function(){if(this.mainContainer.mask){var u=this.getMaskPath();ar(this.axisRanges.iterator(),function(w){w.axisFill.fillPath&&(w.axisFill.validate(),u+=w.axisFill.fillPath)}),this.mainContainer.mask.path=u}},R.prototype.getMaskPath=function(){return this.xAxis&&this.yAxis?aC({x:0,y:0,width:this.xAxis.axisLength,height:this.yAxis.axisLength}):""},R.prototype.getAxisField=function(u){return u==this.xAxis?this.xField:u==this.yAxis?this.yField:void 0},R.prototype.validateDataItems=function(){var u=this.chart;u&&(this._maxxX=ye(1e5,2*u.plotContainer.maxWidth),this._maxxY=ye(1e5,2*u.plotContainer.maxHeight));var w=this.xAxis,$=this.yAxis;w&&$&&(w.updateAxisBySeries(),$.updateAxisBySeries()),U.prototype.validateDataItems.call(this),w&&$&&(w.postProcessSeriesDataItems(this),$.postProcessSeriesDataItems(this))},R.prototype.validateDataRange=function(){var u=this.xAxis,w=this.yAxis;u&&w&&(u.dataRangeInvalid&&u.validateDataRange(),w.dataRangeInvalid&&w.validateDataRange()),U.prototype.validateDataRange.call(this)},R.prototype.validate=function(){var u=this.xAxis,w=this.yAxis;if(u&&w){u.invalid&&u.validate(),w.invalid&&w.validate(),this.y=w.pixelY,this.x=u.pixelX,this._showBullets=!0;var $=this.minBulletDistance;ae($)&&this.baseAxis.axisLength/(this.endIndex-this.startIndex)<$&&(this._showBullets=!1)}if(this.updateTooltip(),!(u instanceof dc&&u.groupData&&!this.dataGrouped||w instanceof dc&&w.groupData&&!this.dataGrouped)){U.prototype.validate.call(this);var G=this.chart,K=this.maskBullets;G&&K&&G.className=="XYChart"&&(G.leftAxesContainer.layout!="vertical"&&G.rightAxesContainer.layout!="vertical"||(this.yAxis?this.bulletsContainer.mask=this.yAxis.renderer.gridContainer:this.bulletsContainer.mask=void 0),G.topAxesContainer.layout!="horizontal"&&G.bottomAxesContainer.layout!="horizontal"||(this.xAxis?this.bulletsContainer.mask=this.xAxis.renderer.gridContainer:this.bulletsContainer.mask=void 0))}},Object.defineProperty(R.prototype,"xAxis",{get:function(){if(this.chart){if(!this._xAxis.get()){var u=this.chart.xAxes.getIndex(0);if(!u)throw Error("There are no X axes on chart.");this.xAxis=u}return this._xAxis.get()}},set:function(u){this.setXAxis(u)},enumerable:!0,configurable:!0}),R.prototype.setXAxis=function(u){var w=this._xAxis.get();w!=u&&(w&&(this.dataItemsByAxis.removeKey(w.uid),this._xAxis.dispose(),w.series.removeValue(this)),this._xAxis.set(u,u.registerSeries(this)),this.dataItemsByAxis.setKey(u.uid,new Ea),this.invalidateData())},Object.defineProperty(R.prototype,"yAxis",{get:function(){if(this.chart){if(!this._yAxis.get()){var u=this.chart.yAxes.getIndex(0);if(!u)throw Error("There are no Y axes on chart.");this.yAxis=u}return this._yAxis.get()}},set:function(u){this.setYAxis(u)},enumerable:!0,configurable:!0}),R.prototype.setYAxis=function(u){var w=this._yAxis.get();w!=u&&(w&&(this.dataItemsByAxis.removeKey(w.uid),this._yAxis.dispose(),w.series.removeValue(this)),this._yAxis.set(u,u.registerSeries(this)),u.chart instanceof U0&&u.chart.handleYAxisSet(this),this.dataItemsByAxis.setKey(u.uid,new Ea),this.invalidateData())},Object.defineProperty(R.prototype,"baseAxis",{get:function(){var u=this.xAxis,w=this.yAxis;return!this._baseAxis&&u&&w&&(w instanceof dc&&(this._baseAxis=w),u instanceof dc&&(this._baseAxis=u),w instanceof jh&&(this._baseAxis=w),u instanceof jh&&(this._baseAxis=u),this._baseAxis||(this._baseAxis=u)),this._baseAxis},set:function(u){this._baseAxis!=u&&(this._baseAxis=u,this.invalidate())},enumerable:!0,configurable:!0}),R.prototype.addData=function(u,w,$){U.prototype.addData.call(this,u,w,$),this.scrollbarSeries&&(this.scrollbarSeries.addData(u,w,!0),this.scrollbarSeries._parseDataFrom=this._parseDataFrom)},R.prototype.setData=function(u){U.prototype.setData.call(this,u),this.scrollbarSeries&&this.scrollbarSeries.setData(u)},R.prototype.setDataSet=function(u){var w=U.prototype.setDataSet.call(this,u);if(w){this._dataSetChanged=!0;var $=this.dataItems;if(this.resetExtremes(),$&&$.length>0){var G=this.xAxis,K=this.yAxis;this._prevStartIndex=void 0,this._prevEndIndex=void 0,this._startIndex=void 0,this._endIndex=void 0,this.appeared||this.processValues(!1),G instanceof dc&&G==this.baseAxis&&(this._tmin.setKey(G.uid,$.getIndex(0).dateX.getTime()),this._tmax.setKey(G.uid,$.getIndex($.length-1).dateX.getTime()),this.dispatch("extremeschanged")),K instanceof dc&&K==this.baseAxis&&(this._tmin.setKey(K.uid,$.getIndex(0).dateY.getTime()),this._tmax.setKey(K.uid,$.getIndex($.length-1).dateY.getTime()),this.dispatch("extremeschanged"))}}return w},R.prototype.processValues=function(u){U.prototype.processValues.call(this,u);var w=this.xAxis,$=this.yAxis;if(w&&$){var G=this.dataItems,K=1/0,re=-1/0,ue=1/0,we=-1/0,De=this.startIndex,Ve=this.endIndex,Ke=De,Qe=Ve;u||(De=0,Ve=this.dataItems.length);for(var ft=De;ftwe&&(we=di)),this.baseAxis==$&&(eire&&(re=ei)))}w.processSeriesDataItems(),$.processSeriesDataItems();var ci=w.uid,qi=$.uid;if(this.xAxis instanceof Ro&&(K==1/0||re==-1/0))return this._smin.setKey(ci,void 0),this._smax.setKey(ci,void 0),void this.dispatchImmediately("selectionextremeschanged");if(this.yAxis instanceof Ro&&(ue==1/0||we==-1/0))return this._smin.setKey(qi,void 0),this._smax.setKey(qi,void 0),void this.dispatchImmediately("selectionextremeschanged");if(!u&&(this._tmin.getKey(ci)!=K||this._tmax.getKey(ci)!=re||this._tmin.getKey(qi)!=ue||this._tmax.getKey(qi)!=we)){this._tmin.setKey(ci,K),this._tmax.setKey(ci,re),this._tmin.setKey(qi,ue),this._tmax.setKey(qi,we);var rr=this.stackedSeries;rr&&(rr.isDisposed()?this.stackedSeries=void 0:rr.processValues(!1)),this.dispatchImmediately("extremeschanged")}if(De!=Ke||Ve!=Qe)for(K=1/0,re=-1/0,ue=1/0,we=-1/0,ft=Ke;ftwe&&(we=di)),this.baseAxis==$&&(eire&&(re=ei)));if(this.xAxis instanceof Ro&&(K==1/0||re==-1/0))return this._smin.setKey(ci,void 0),this._smax.setKey(ci,void 0),void this.dispatchImmediately("selectionextremeschanged");if(this.yAxis instanceof Ro&&(ue==1/0||we==-1/0))return this._smin.setKey(qi,void 0),this._smax.setKey(qi,void 0),void this.dispatchImmediately("selectionextremeschanged");if((this._smin.getKey(ci)!=K||this._smax.getKey(ci)!=re||this._smin.getKey(qi)!=ue||this._smax.getKey(qi)!=we)&&(this._smin.setKey(ci,K),this._smax.setKey(ci,re),this._smin.setKey(qi,ue),this._smax.setKey(qi,we),this.appeared||this.start!=0||this.end!=1||this.dataItems!=this.mainDataSet)){var Ii,Ki,pr=!1;$ instanceof Ro&&!($ instanceof dc)&&((!ae(Ii=this._tmin.getKey(qi))||(this.usesShowFields||this._dataSetChanged||w instanceof dc&&w.groupData&&this.isShowing)&&ueKi||this.stackedSeries&&!this.isHidden)&&(this._tmax.setKey(qi,we),pr=!0)),w instanceof Ro&&!(w instanceof dc)&&((!ae(Ii=this._tmin.getKey(ci))||(this.usesShowFields||this._dataSetChanged||$ instanceof dc&&$.groupData&&this.isShowing)&&KKi||this.stackedSeries&&!this.isHidden)&&(this._tmax.setKey(ci,re),pr=!0)),pr&&this.dispatchImmediately("extremeschanged"),this.start==0&&this.end==1&&(this._dataSetChanged=!1),this.dispatchImmediately("selectionextremeschanged")}!u&&this.stacked&&this.processValues(!0)}},R.prototype.hideTooltip=function(u){U.prototype.hideTooltip.call(this,u),this.returnBulletDefaultState(),this._prevTooltipDataItem=void 0},R.prototype.showTooltipAtPosition=function(u,w){var $;if(this.visible&&!this.isHiding&&!this.isShowing){var G=this._xAxis.get(),K=this._yAxis.get();G==this.baseAxis&&($=G.getSeriesDataItem(this,G.toAxisPosition(u),this.snapTooltip)),K==this.baseAxis&&($=K.getSeriesDataItem(this,K.toAxisPosition(w),this.snapTooltip));var re=this.showTooltipAtDataItem($);if(re)return re;if(!this.tooltipText&&!this.tooltipHTML)return}this.hideTooltip()},R.prototype.getAdjustedXLocation=function(u,w,$){return u.locations[w]},R.prototype.getAdjustedYLocation=function(u,w,$){return u.locations[w]},R.prototype.showTooltipAtDataItem=function(u){var w,$,G=this.chart.cursor;if(G&&G.hideSeriesTooltipsOnSelection&&G.selection.visible&&G.downPoint)this.hideTooltip();else if(this.returnBulletDefaultState(u),u&&u.visible){if(this.updateLegendValue(u),this.cursorTooltipEnabled){this.tooltipDataItem=u;var K=this.tooltipXField,re=this.tooltipYField;if(Te(u[K])&&Te(u[re])){var ue=this.getPoint(u,K,re,this.getAdjustedXLocation(u,K),this.getAdjustedYLocation(u,re));if(ue&&(this.chart.className!="XYChart"||!(ue.y<-1||ue.y>this.yAxis.pixelHeight+1||ue.x<-1||ue.x>this.xAxis.pixelWidth+1))){if(this.tooltipX=ue.x,this.tooltipY=ue.y,this._prevTooltipDataItem!=u&&(this.dispatchImmediately("tooltipshownat",{type:"tooltipshownat",target:this,dataItem:u}),this._prevTooltipDataItem=u),this.cursorHoverEnabled)try{for(var we=xe(u.sprites),De=we.next();!De.done;De=we.next()){var Ve=De.value;!Ve.parent.visible||Ve.isHidden||Ve.__disabled||Ve.disabled||Ve.isHiding||(Ve.interactions.isRealHover||(Ve.dispatchImmediately("over"),Ve.interactions.isRealHover=!0),Ve.isHover=!0)}}catch(Ke){w={error:Ke}}finally{try{De&&!De.done&&($=we.return)&&$.call(we)}finally{if(w)throw w.error}}return this.showTooltip()?vm({x:ue.x,y:ue.y},this):void 0}}}}else this.updateLegendValue(u,!0)},R.prototype.returnBulletDefaultState=function(u){var w,$;if(this._prevTooltipDataItem&&this._prevTooltipDataItem!=u)try{for(var G=xe(this._prevTooltipDataItem.sprites),K=G.next();!K.done;K=G.next()){var re=K.value;if(re.isDisposed())this._prevTooltipDataItem=void 0;else{var ue=re.interactions.isRealHover;re.isHover=!1,ue&&re.dispatchImmediately("out")}}}catch(we){w={error:we}}finally{try{K&&!K.done&&($=G.return)&&$.call(G)}finally{if(w)throw w.error}}},R.prototype.shouldCreateBullet=function(u,w){var $=w.xField;Te($)||($=this.xField);var G=w.yField;if(Te(G)||(G=this.yField),this.xAxis instanceof Ro&&!u.hasValue([$])||this.yAxis instanceof Ro&&!u.hasValue([G]))return!1;if(w.disabled){var K=w.propertyFields.disabled,re=u.dataContext;return!(!re||re[K]!==!1)}return!0},R.prototype.updateTooltip=function(){this.hideTooltipWhileZooming||!this.tooltip||this.tooltip.isHidden||this.isHiding||this.isHidden||!this.tooltipDataItem||this.showTooltipAtDataItem(this.tooltipDataItem)},R.prototype.positionBullet=function(u){U.prototype.positionBullet.call(this,u);var w=u.dataItem,$=u.xField;Te($)||($=this.xField);var G=u.yField;Te(G)||(G=this.yField);var K=this.xAxis,re=this.yAxis;if(K instanceof Ro&&!w.hasValue([$])||re instanceof Ro&&!w.hasValue([G]))u.visible=!1;else{var ue=this.getBulletLocationX(u,$),we=this.getBulletLocationY(u,G);if(this.getPoint(w,$,G,ue,we)){var De=this.xOpenField,Ve=this.yOpenField,Ke=void 0,Qe=void 0;if(K instanceof dc){ae(ue)||(ue=0);var ft=void 0,Gt=w.getWorkingValue($);if(De?ft=w.getWorkingValue(De):K==this.baseAxis&&(ft=K.baseValue),ae(ft)||(ft=Gt),(ft+=Ki=w.getValue("valueX","stack"))==(Gt+=Ki)){var ei=K.baseInterval,di=K.dateFormatter;ft=hd(new Date(ft),ei.timeUnit,ei.count,di.firstDayOfWeek,di.utc,void 0,di.timezoneMinutes,di.timezone).getTime(),Gt=Ap(new Date(ft),ei.timeUnit,ei.count,di.utc).getTime()}var ci=void 0;ci=K==this.baseAxis?ft+(Gt-ft)*ue:ft+(Gt-ft)*(1-ue),Ke=K.valueToPosition(ci)}else if(K instanceof Ro)ae(ue)||(ue=0),ft=void 0,Gt=w.getWorkingValue($),ft=De?w.getWorkingValue(De):K.baseValue,ci=(ft+=Ki=w.getValue("valueX","stack"))+((Gt+=Ki)-ft)*(1-ue),Ke=K.valueToPosition(ci);else if(K instanceof jh){var qi=this.getAdjustedXLocation(w,$,u.locationX),rr=this.getAdjustedXLocation(w,De,u.locationX);Ke=K.categoryToPosition(w[$],qi);var Ii=void 0;De&&(Ii=K.categoryToPosition(w[De],rr)),ae(Ii)||(Ii=1),Ke=Ii+(Ke-Ii)*ue}if(re instanceof dc)ae(we)||(we=0),ft=void 0,Gt=w.getWorkingValue(G),Ve?ft=w.getWorkingValue(Ve):re==this.baseAxis&&(ft=re.baseValue),ae(ft)||(ft=Gt),(ft+=Ki=w.getValue("valueY","stack"))==(Gt+=Ki)&&(ei=re.baseInterval,di=re.dateFormatter,ft=hd(new Date(ft),ei.timeUnit,ei.count,di.firstDayOfWeek,di.utc,void 0,di.timezoneMinutes,di.timezone).getTime(),Gt=Ap(new Date(ft),ei.timeUnit,ei.count,di.utc).getTime()),ci=void 0,ci=re==this.baseAxis?ft+(Gt-ft)*we:ft+(Gt-ft)*(1-we),Qe=re.valueToPosition(ci);else if(re instanceof Ro){var Ki;ae(we)||(we=0),ft=void 0,Gt=w.getWorkingValue(G),ft=Ve?w.getWorkingValue(Ve):re.baseValue,ci=(ft+=Ki=w.getValue("valueY","stack"))+((Gt+=Ki)-ft)*(1-we),Qe=re.valueToPosition(ci)}else if(re instanceof jh){Qe=re.categoryToPosition(w[G],we);var pr=this.getAdjustedYLocation(w,G,u.locationY),kr=this.getAdjustedYLocation(w,Ve,u.locationY);Qe=re.categoryToPosition(w[G],pr);var Er=void 0;Ve&&(Er=re.categoryToPosition(w[Ve],kr)),ae(Er)||(Er=1),Qe=Er+(Qe-Er)*we}u.visible=!0,this.positionBulletReal(u,Ke,Qe)}else u.visible=!1}},R.prototype.positionBulletReal=function(u,w,$){u.x=this.xAxis.renderer.positionToPoint(w,$).x,u.y=this.yAxis.renderer.positionToPoint($,w).y},R.prototype.getBulletLocationX=function(u,w){var $=u.locationX,G=u.dataItem;return ae($)||($=G.workingLocations[w]),$},R.prototype.getBulletLocationY=function(u,w){var $=u.locationY,G=u.dataItem;return ae($)||($=G.workingLocations[w]),$},R.prototype.updateStacking=function(){var u=this;this.invalidateDataItems(),this.chart&&this.chart.series.each(function(w){w.baseAxis==u.baseAxis&&(w.stackedSeries=void 0,w.invalidateDataItems(),w.invalidateProcessedData())})},Object.defineProperty(R.prototype,"stacked",{get:function(){return this.getPropertyValue("stacked")},set:function(u){if(this.setPropertyValue("stacked",u,!0)){this.updateStacking();var w,$=this.xAxis,G=this.yAxis;u||($!=this.baseAxis&&$ instanceof Ro&&(w=this.xField),G!=this.baseAxis&&G instanceof Ro&&(w=this.yField),w&&this.dataItems.each(function(K){K.setCalculatedValue(w,0,"stack")}))}},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"snapTooltip",{get:function(){return this.getPropertyValue("snapTooltip")},set:function(u){this.setPropertyValue("snapTooltip",u)},enumerable:!0,configurable:!0}),R.prototype.show=function(u){var w,$=this;this.isHidden&&(this.appeared&&this.xAxis instanceof dc&&this.xAxis.groupData&&(this._tmin.setKey(this.yAxis.uid,void 0),this._tmax.setKey(this.yAxis.uid,void 0)),this.appeared&&this.yAxis instanceof dc&&this.yAxis.groupData&&(this._tmin.setKey(this.xAxis.uid,void 0),this._tmax.setKey(this.xAxis.uid,void 0))),this.xAxis instanceof Ro&&this.xAxis!=this.baseAxis&&(w=this._xValueFields),this.yAxis instanceof Ro&&this.yAxis!=this.baseAxis&&(w=this._yValueFields);var G,K=this.startIndex,re=this.endIndex,ue=0,we=this.defaultState.transitionDuration;ae(u)&&(we=u),ar(Iu(this.dataItems.iterator()),function(Ve){var Ke=Ve[0],Qe=Ve[1],ft=we;(Ke<$.startIndex-10||Ke>$.endIndex+10)&&(ft=0,ue=0),$.sequencedInterpolation&&ft>0&&(ue=$.sequencedInterpolationDelay*Ke+we*(Ke-K)/(re-K)),G=Qe.show(ft,ue,w)}),this.dataSets.each(function(Ve,Ke){Ke!=$.dataItems&&Ke.each(function(Qe){Qe.events.disable(),Qe.show(0,0,w),Qe.events.enable()})}),this.mainDataSet!=this.dataItems&&this.mainDataSet.each(function(Ve){Ve.events.disable(),Ve.show(0,0,w),Ve.events.enable()});var De=U.prototype.show.call(this,u);return G&&!G.isFinished()&&(De=G),this.hidden&&(this.dispatchImmediately("selectionextremeschanged"),this.hidden=!1),De},R.prototype.hide=function(u){var w,$,G=this,K=this.xAxis;K instanceof Ro&&K!=this.baseAxis&&(w=this._xValueFields,$=this.stacked||K.minZoomedK.baseValue||this.stackedSeries?K.baseValue:K.min);var re=this.yAxis;re instanceof Ro&&re!=this.baseAxis&&(w=this._yValueFields,$=this.stacked||re.minZoomedre.baseValue||this.stackedSeries?re.baseValue:re.min);var ue=this.startIndex,we=this.endIndex,De=this.hiddenState.transitionDuration;ae(u)&&(De=u);var Ve,Ke=0;ar(Iu(this.dataItems.iterator()),function(ft){var Gt=ft[0],ei=ft[1],di=De;(GtG.endIndex+10)&&(di=0),di==0?ei.hide(0,0,$,w):(G.sequencedInterpolation&&di>0&&(Ke=G.sequencedInterpolationDelay*Gt+De*(Gt-ue)/(we-ue)),Ve=ei.hide(di,Ke,$,w))}),this.dataSets.each(function(ft,Gt){Gt!=G.dataItems&&Gt.each(function(ei){ei.events.disable(),ei.hide(0,0,$,w),ei.events.enable()})}),this.mainDataSet!=this.dataItems&&this.mainDataSet.each(function(ft){ft.events.disable(),ft.hide(0,0,$,w),ft.events.enable()});var Qe=U.prototype.hide.call(this,De);return Qe&&!Qe.isFinished()&&Qe.delay(Ke),Ve&&!Ve.isFinished()&&(Qe=Ve),this.validateDataElements(),Qe},R.prototype.handleDataItemWorkingValueChange=function(u,w){U.prototype.handleDataItemWorkingValueChange.call(this,u,w),ar(this.baseAxis.series.iterator(),function($){($.stacked||$.stackedSeries)&&$.invalidateProcessedData()})},R.prototype.getStackValue=function(u,w){var $=this,G=this.xAxis,K=this.yAxis;if(this.stacked&&G&&K){var re,ue=this.chart,we=ue.series.indexOf(this);G!=this.baseAxis&&G instanceof Ro&&(re=this.xField),K!=this.baseAxis&&K instanceof Ro&&(re=this.yField),re&&(u.setCalculatedValue(re,0,"stack"),on(ue.series.range(0,we).backwards().iterator(),function(De){if(De.xAxis==G&&De.yAxis==K&&De.className==$.className){De.stackedSeries=$;var Ve=De.dataItems.getIndex(u.index);if(Ve&&Ve.hasValue($._xValueFields)&&Ve.hasValue($._yValueFields)){var Ke,Qe=u.getValue(re),ft=Ve.getValue(re)+Ve.getValue(re,"stack");if(Ke=w?Ve.getWorkingValue(re)+Ve.getValue(re,"stack"):Ve.getValue(re)+Ve.getValue(re,"stack"),!$.stackToNegative||Qe>=0&&ft>=0||Qe<0&&ft<0)return u.setCalculatedValue(re,Ke,"stack"),!1;if(!De.stacked)return!1}else if(!De.stacked)return!1}return!0}))}},Object.defineProperty(R.prototype,"stackToNegative",{get:function(){return this.getPropertyValue("stackToNegative")},set:function(u){this.setPropertyValue("stackToNegative",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"xField",{get:function(){return this._xField},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"yField",{get:function(){return this._yField},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"xOpenField",{get:function(){return this._xOpenField},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"yOpenField",{get:function(){return this._yOpenField},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tooltipXField",{get:function(){return this._tooltipXField?this._tooltipXField:this._xField},set:function(u){this._tooltipXField=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tooltipYField",{get:function(){return this._tooltipYField?this._tooltipYField:this._yField},set:function(u){this._tooltipYField=u},enumerable:!0,configurable:!0}),R.prototype.min=function(u){return this._tmin.getKey(u.uid)},R.prototype.max=function(u){return this._tmax.getKey(u.uid)},R.prototype.selectionMin=function(u){return this._smin.getKey(u.uid)},R.prototype.selectionMax=function(u){return this._smax.getKey(u.uid)},R.prototype.processConfig=function(u){if(u){if(Te(u.baseAxis)&&ct(u.baseAxis)&&(this.map.hasKey(u.baseAxis)?u.baseAxis=this.map.getKey(u.baseAxis):(this.processingErrors.push("[XYSeries ("+(this.name||"unnamed")+')] No axis with id "'+u.baseAxis+'" found for `baseAxis`.'),delete u.baseAxis)),Te(u.xAxis)&&ct(u.xAxis)&&(this.map.hasKey(u.xAxis)?u.xAxis=this.map.getKey(u.xAxis):(this.processingErrors.push("[XYSeries ("+(this.name||"unnamed")+')] No axis with id "'+u.xAxis+'" found for `xAxis`.'),delete u.xAxis)),Te(u.yAxis)&&ct(u.yAxis)&&(this.map.hasKey(u.yAxis)?u.yAxis=this.map.getKey(u.yAxis):(this.processingErrors.push("[XYSeries ("+(this.name||"unnamed")+')] No axis with id "'+u.yAxis+'" found for `yAxis`.'),delete u.yAxis)),Te(u.axisRanges)&&wt(u.axisRanges))for(var w=0,$=u.axisRanges.length;w<$;w++){var G=u.axisRanges[w];Te(G.type)||(G.type="AxisDataItem"),Te(G.axis)&&ct(G.axis)&&this.map.hasKey(G.axis)?G.component=this.map.getKey(G.axis):Te(G.component)&&ct(G.component)&&this.map.hasKey(G.component)&&(G.component=this.map.getKey(G.component))}Te(u.dataFields)&&ht(u.dataFields)||this.processingErrors.push("`dataFields` is not set for series ["+(this.name||"unnamed")+"]")}U.prototype.processConfig.call(this,u)},R.prototype.getPoint=function(u,w,$,G,K,re,ue){if(this.xAxis&&this.yAxis){var we=this.xAxis.getX(u,w,G),De=this.yAxis.getY(u,$,K);return{x:we=nt(we,-this._maxxX,this._maxxX),y:De=nt(De,-this._maxxY,this._maxxY)}}},R.prototype.updateItemReaderText=function(){if(!this._itemReaderTextChanged){var u="";yi(this.dataFields,function(w,$){u+="{"+w+"} "}),this.itemReaderText=u,this._itemReaderTextChanged=!1}},Object.defineProperty(R.prototype,"cursorTooltipEnabled",{get:function(){return this.getPropertyValue("cursorTooltipEnabled")},set:function(u){this.setPropertyValue("cursorTooltipEnabled",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cursorHoverEnabled",{get:function(){return this.getPropertyValue("cursorHoverEnabled")},set:function(u){this.setPropertyValue("cursorHoverEnabled",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"excludeFromTotal",{get:function(){return this.getPropertyValue("excludeFromTotal")},set:function(u){this.setPropertyValue("excludeFromTotal",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"hideTooltipWhileZooming",{get:function(){return this.getPropertyValue("hideTooltipWhileZooming")},set:function(u){this.setPropertyValue("hideTooltipWhileZooming",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maskBullets",{get:function(){return this.getPropertyValue("maskBullets")},set:function(u){this.setPropertyValue("maskBullets",u);var w=this.chart;w&&(this.bulletsContainer.parent=u?w.bulletsContainer:w.axisBulletsContainer)},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){this.groupFields=pn(u.groupFields,{}),U.prototype.copyFrom.call(this,u)},R.prototype.dispose=function(){this.scrollbarSeries&&this.scrollbarSeries.dispose(),U.prototype.dispose.call(this)},R}(n8);pi.registeredClasses.XYSeries=kI,pi.registeredClasses.XYSeriesDataItem=rg;var $I=function(U){function R(){var u=U.call(this)||this;u._chart=new Kn,u.className="XYChartScrollbar";var w=new Wa;u.padding(0,0,0,0);var $=u.createChild(U0);if($.shouldClone=!1,$.margin(0,0,0,0),$.padding(0,0,0,0),$.interactionsEnabled=!1,u._scrollbarChart=$,!JS()){var G=new e8;G.filterUnits="userSpaceOnUse",$.plotContainer.filters.push(G)}u._disposers.push(u._scrollbarChart),u.minHeight=60,u.minWidth=60;var K=u.createChild(yo);K.shouldClone=!1,K.setElement(u.paper.add("path")),K.fill=w.getFor("background"),K.fillOpacity=.8,K.interactionsEnabled=!1,K.isMeasured=!1,K.toBack(),u._unselectedOverlay=K,u._disposers.push(u._unselectedOverlay),$.toBack(),u.background.cornerRadius(0,0,0,0);var re=u.thumb.background;re.cornerRadius(0,0,0,0),re.fillOpacity=0,re.fill=w.getFor("background");var ue=re.states.getKey("hover");ue&&(ue.properties.fillOpacity=.2);var we=re.states.getKey("down");return we&&(we.properties.fillOpacity=.4),u._disposers.push(u._chart),u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"series",{get:function(){return this._series||(this._series=new to,this._disposers.push(this._series.events.on("inserted",this.handleSeriesAdded,this,!1)),this._disposers.push(this._series.events.on("removed",this.handleSeriesRemoved,this,!1))),this._series},enumerable:!0,configurable:!0}),R.prototype.handleSeriesAdded=function(u){var w=this,$=u.newValue;if($.xAxis&&$.yAxis){var G=this.scrollbarChart;G.zoomOutButton.disabled=!0,this.chart=$.chart,G.dateFormatter.inputDateFormat=this.chart.dateFormatter.inputDateFormat,G.language.locale=this.chart.language.locale;var K=!0,re=!0;ar(this.series.iterator(),function(ci){ci!=$&&(ci.xAxis==$.xAxis&&w.scrollbarChart.xAxes.length>0&&(K=!1),ci.yAxis==$.yAxis&&w.scrollbarChart.yAxes.length>0&&(re=!1))}),$.events.on("beforedisposed",function(){w.series.removeValue($)});var ue=new Wa,we=$.clone();if(JS()&&(we.stroke=He("#aaaaaa"),we.fill=we.stroke,we.propertyFields.fill=void 0,we.propertyFields.stroke=void 0),$.scrollbarSeries=we,K){var De=$.xAxis.clone();if(G.xAxes.moveValue(De),De.title.disabled=!0,De.rangeChangeDuration=0,(ft=De.renderer).ticks.template.disabled=!0,ft.inside=!0,ft.labels.template.inside=!0,ft.line.strokeOpacity=0,ft.minLabelPosition=.02,ft.maxLabelPosition=.98,ft.line.disabled=!0,ft.axisFills.template.disabled=!0,ft.baseGrid.disabled=!0,ft.grid.template.strokeOpacity=.05,ft.minWidth=void 0,ft.minHeight=void 0,ft.padding(0,0,0,0),ft.chart=G,ft.margin(0,0,0,0),De.width=de(100),ft.labels.template.fillOpacity=.5,De.maxZoomCount=void 0,De.minZoomCount=void 0,De instanceof dc){var Ve=De,Ke=$.xAxis;Ve.groupCount=5*Ke.groupCount,Ve.min=void 0,Ve.max=void 0,this._disposers.push(Ve.clonedFrom.events.on("extremeschanged",function(){ae(Ve.clonedFrom.minDefined)&&(Ve.min=Ve.clonedFrom.minDefined),ae(Ve.clonedFrom.maxDefined)&&(Ve.max=Ve.clonedFrom.maxDefined)},void 0,!1))}else if(De instanceof Ro){var Qe=De;Qe.min=void 0,Qe.max=void 0,ae(Qe.clonedFrom.minDefined)||(Qe.min=void 0),ae(Qe.clonedFrom.maxDefined)||(Qe.max=void 0),this._disposers.push(Qe.clonedFrom.events.on("extremeschanged",function(){ae(Qe.clonedFrom.minDefined)&&(Qe.min=Qe.clonedFrom.min),ae(Qe.clonedFrom.maxDefined)&&(Qe.max=Qe.clonedFrom.max)},void 0,!1))}we.xAxis=De}else this.scrollbarChart.xAxes.each(function(ci){ci.clonedFrom==$.xAxis&&(we.xAxis=ci)});if(re){var ft,Gt=$.yAxis.clone();if(G.yAxes.moveValue(Gt),Gt.title.disabled=!0,Gt.rangeChangeDuration=0,(ft=Gt.renderer).ticks.template.disabled=!0,ft.inside=!0,ft.labels.template.inside=!0,ft.line.strokeOpacity=0,ft.minLabelPosition=.02,ft.maxLabelPosition=.98,ft.line.disabled=!0,ft.axisFills.template.disabled=!0,ft.grid.template.stroke=ue.getFor("background"),ft.baseGrid.disabled=!0,ft.grid.template.strokeOpacity=.05,ft.minWidth=void 0,ft.minHeight=void 0,ft.chart=G,ft.padding(0,0,0,0),ft.margin(0,0,0,0),Gt.height=de(100),ft.labels.template.fillOpacity=.5,we.yAxis=Gt,Gt.maxZoomCount=void 0,Gt.minZoomCount=void 0,Gt instanceof dc){var ei=Gt;ei.min=void 0,ei.max=void 0,Ke=$.yAxis,Gt.groupCount=5*Ke.groupCount,this._disposers.push(ei.clonedFrom.events.on("extremeschanged",function(){ae(ei.clonedFrom.minDefined)&&(ei.min=ei.clonedFrom.minDefined),ae(ei.clonedFrom.maxDefined)&&(ei.max=ei.clonedFrom.maxDefined)}))}else if(Gt instanceof Ro){var di=Gt;di.min=void 0,di.max=void 0,ae(di.clonedFrom.minDefined)||(di.min=void 0),ae(di.clonedFrom.maxDefined)||(di.max=void 0),this._disposers.push(di.clonedFrom.events.on("extremeschanged",function(){ae(di.clonedFrom.minDefined)&&(di.min=di.clonedFrom.minDefined),ae(di.clonedFrom.maxDefined)&&(di.max=di.clonedFrom.maxDefined)}))}}else this.scrollbarChart.yAxes.each(function(ci){ci.clonedFrom==$.yAxis&&(we.yAxis=ci)});we.rangeChangeDuration=0,we.interpolationDuration=0,we.defaultState.transitionDuration=0,we.showOnInit=!1,this._disposers.push(we.events.on("validated",this.zoomOutAxes,this,!1)),this._disposers.push($.events.on("datavalidated",function(){we.data!=$.data&&(we.data=$.data)},void 0,!1)),we.defaultState.properties.visible=!0,G.series.push(we),this.updateByOrientation()}},R.prototype.updateByOrientation=function(){var u=this;this._scrollbarChart&&(ar(this._scrollbarChart.xAxes.iterator(),function(w){var $=w.renderer;u.orientation=="vertical"?($.grid.template.disabled=!0,$.labels.template.disabled=!0,$.minGridDistance=10):($.grid.template.disabled=!1,$.labels.template.disabled=!1,$.minGridDistance=w.clonedFrom.renderer.minGridDistance)}),ar(this._scrollbarChart.yAxes.iterator(),function(w){var $=w.renderer;u.orientation=="horizontal"?($.grid.template.disabled=!0,$.labels.template.disabled=!0,$.minGridDistance=10):($.grid.template.disabled=!1,$.labels.template.disabled=!1,$.minGridDistance=w.clonedFrom.renderer.minGridDistance)}))},R.prototype.handleSeriesRemoved=function(u){var w=u.oldValue,$=this.scrollbarChart;$.series.each(function(G){G&&G.clonedFrom==w&&$.series.removeValue(G)}),$.series.length==0&&($.xAxes.clear(),$.yAxes.clear());try{w.events.off("validated",this.zoomOutAxes,this)}catch{}},Object.defineProperty(R.prototype,"scrollbarChart",{get:function(){return this._scrollbarChart},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"chart",{get:function(){return this._chart.get()},set:function(u){this._chart.get()!==u&&(this._chart.set(u,u.events.on("datavalidated",this.handleDataChanged,this,!1)),this.handleDataChanged(),this._scrollbarChart.dataProvider=u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"unselectedOverlay",{get:function(){return this._unselectedOverlay},enumerable:!0,configurable:!0}),R.prototype.handleDataChanged=function(){this.chart.data!=this.scrollbarChart.data?this.scrollbarChart.data=this.chart.data:this.scrollbarChart.invalidateRawData()},R.prototype.zoomOutAxes=function(){var u=this.scrollbarChart;ar(u.xAxes.iterator(),function(w){w.zoom({start:0,end:1},!0,!0)}),ar(u.yAxes.iterator(),function(w){w.zoom({start:0,end:1},!0,!0)})},R.prototype.updateThumb=function(u){if(u===void 0&&(u=!0),U.prototype.updateThumb.call(this,u),this._unselectedOverlay){var w=this.thumb,$=w.pixelX||0,G=w.pixelY||0,K=w.pixelWidth||0,re=w.pixelHeight||0,ue="";this.orientation=="horizontal"?(ue=aC({x:-1,y:0,width:$,height:re}),ue+=aC({x:$+K,y:0,width:(this.pixelWidth||0)-$-K,height:re})):(ue=aC({x:0,y:0,width:K,height:G}),ue+=aC({x:0,y:G+re,width:K,height:(this.pixelHeight||0)-G-re})),this._unselectedOverlay.path=ue}},R.prototype.processConfig=function(u){if(u&&Te(u.series)&&wt(u.series))for(var w=0,$=u.series.length;w<$;w++){var G=u.series[w];if(Te(G)&&ct(G)){if(!this.map.hasKey(G))throw Error("XYChartScrollbar error: Series with id `"+G+"` does not exist.");u.series[w]=this.map.getKey(G)}}U.prototype.processConfig.call(this,u)},R}(G0);pi.registeredClasses.XYChartScrollbar=$I;var Az=function(U){function R(){var u=U.call(this)||this;return u.className="XYChartDataItem",u.applyTheme(),u}return ie(R,U),R}(lie),U0=function(U){function R(){var u=U.call(this)||this;u._axisRendererX=Vd,u._axisRendererY=T1,u._seriesPoints=[],u.className="XYChart",u.maskBullets=!0,u.arrangeTooltips=!0;var w=u.chartContainer;w.layout="vertical",u.padding(15,15,15,15);var $=w.createChild(cs);$.shouldClone=!1,$.layout="vertical",$.width=de(100),$.zIndex=1,u.topAxesContainer=$;var G=w.createChild(cs);G.shouldClone=!1,G.layout="horizontal",G.width=de(100),G.height=de(100),G.zIndex=0,u.yAxesAndPlotContainer=G;var K=w.createChild(cs);K.shouldClone=!1,K.width=de(100),K.layout="vertical",K.zIndex=1,u.bottomAxesContainer=K;var re=G.createChild(cs);re.shouldClone=!1,re.layout="horizontal",re.height=de(100),re.contentAlign="right",re.events.on("transformed",u.updateXAxesMargins,u,!1),re.zIndex=1,u.leftAxesContainer=re;var ue=G.createChild(cs);ue.shouldClone=!1,ue.height=de(100),ue.width=de(100),ue.background.fillOpacity=0,u.plotContainer=ue,u.mouseWheelBehavior="none",u._cursorContainer=ue;var we=G.createChild(cs);we.shouldClone=!1,we.layout="horizontal",we.height=de(100),we.zIndex=1,we.events.on("transformed",u.updateXAxesMargins,u,!1),u.rightAxesContainer=we,u.seriesContainer.parent=ue,u.bulletsContainer.parent=ue;var De=ue.createChild(Qte);De.shouldClone=!1,De.align="right",De.valign="top",De.zIndex=Number.MAX_SAFE_INTEGER,De.marginTop=5,De.marginRight=5,De.hide(0),u.zoomOutButton=De;var Ve=u.plotContainer.createChild(cs);return Ve.shouldClone=!1,Ve.width=de(100),Ve.height=de(100),Ve.isMeasured=!1,Ve.zIndex=4,Ve.layout="none",u.axisBulletsContainer=Ve,u._bulletMask=u.plotContainer,u.events.on("beforedatavalidated",function(){u.series.each(function(Ke){Ke.dataGrouped=!1,Ke._baseInterval={}})},u,!1),u.applyTheme(),u}return ie(R,U),R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),this.zoomOutButton.exportable=!1,Te(this.readerTitle)||(this.readerTitle=this.language.translate("X/Y chart"))},R.prototype.draw=function(){U.prototype.draw.call(this),this.seriesContainer.toFront(),this.bulletsContainer.toFront(),this.maskBullets&&(this.bulletsContainer.mask=this._bulletMask),this.updateSeriesLegend()},R.prototype.updatePlotElements=function(){ar(this.series.iterator(),function(u){u.invalidate()})},R.prototype.validateData=function(){this._parseDataFrom==0&&(ar(this.xAxes.iterator(),function(u){u.dataChangeUpdate()}),ar(this.yAxes.iterator(),function(u){u.dataChangeUpdate()}),ar(this.series.iterator(),function(u){u.dataChangeUpdate()})),U.prototype.validateData.call(this)},R.prototype.updateXAxesMargins=function(){var u=this.leftAxesContainer.measuredWidth,w=this.rightAxesContainer.measuredWidth,$=this.bottomAxesContainer;$.paddingLeft==u&&$.paddingRight==w||($.paddingLeft=u,$.paddingRight=w);var G=this.topAxesContainer;G.paddingLeft==u&&G.paddingRight==w||(G.paddingLeft=u,G.paddingRight=w)},R.prototype.reinit=function(){U.prototype.reinit.call(this),this.series.each(function(u){u.appeared=!1})},R.prototype.handleXAxisChange=function(u){this.updateXAxis(u.target)},R.prototype.handleYAxisChange=function(u){this.updateYAxis(u.target)},R.prototype.processXAxis=function(u){var w=u.newValue;w.chart=this,w.renderer||(w.renderer=new this._axisRendererX,w.renderer.observe(["opposite","inside","inversed","minGridDistance"],this.handleXAxisChange,this,!1)),w.axisLetter="X",w.events.on("startendchanged",this.handleXAxisRangeChange,this,!1),w.dataProvider=this,this.updateXAxis(w.renderer),this.processAxis(w)},R.prototype.processYAxis=function(u){var w=u.newValue;w.chart=this,w.renderer||(w.renderer=new this._axisRendererY,w.renderer.observe(["opposite","inside","inversed","minGridDistance"],this.handleYAxisChange,this,!1)),w.axisLetter="Y",w.events.on("startendchanged",this.handleYAxisRangeChange,this,!1),w.dataProvider=this,this.updateYAxis(w.renderer),this.processAxis(w)},R.prototype.handleXAxisRangeChange=function(){var u=this.getCommonAxisRange(this.xAxes);this.scrollbarX&&this.zoomAxes(this.xAxes,u,!0),this.toggleZoomOutButton(),this.updateScrollbar(this.scrollbarX,u)},R.prototype.toggleZoomOutButton=function(){if(this.zoomOutButton){var u=!1;on(this.xAxes.iterator(),function(w){if(w.toggleZoomOutButton){if(w.maxZoomCount>0){var $=w.maxZoomFactor/w.maxZoomCount;if(ze(w.end-w.start,3)<1/$)return u=!0,!1}else if(ze(w.start,3)>0||ze(w.end,3)<1)return u=!0,!1}return!0}),on(this.yAxes.iterator(),function(w){if(w.toggleZoomOutButton){if(w.maxZoomCount>0){var $=w.maxZoomFactor/w.maxZoomCount;if(ze(w.end-w.start,3)<1/$)return u=!0,!1}else if(ze(w.start,3)>0||ze(w.end,3)<1)return u=!0,!1;return!0}}),this.seriesAppeared||(u=!1),u?this.zoomOutButton.show():this.zoomOutButton.hide()}},R.prototype.seriesAppeared=function(){var u=!1;return ar(this.series.iterator(),function(w){if(!w.appeared)return u=!1,!1}),u},R.prototype.handleYAxisRangeChange=function(){var u=this.getCommonAxisRange(this.yAxes);this.scrollbarY&&this.zoomAxes(this.yAxes,u,!0),this.toggleZoomOutButton(),this.updateScrollbar(this.scrollbarY,u)},R.prototype.updateScrollbar=function(u,w){u&&(u.skipRangeEvents(),u.start=w.start,u.end=w.end)},R.prototype.getCommonAxisRange=function(u){var w,$;return u.each(function(G){if(!(!G.zoomable||G instanceof Ro&&G.syncWithAxis)){var K=G.start,re=G.end;G.renderer.inversed&&(K=1-G.end,re=1-G.start),(!ae(w)||K$)&&($=re)}}),{start:w,end:$}},R.prototype.updateXAxis=function(u){var w=u.axis;u.opposite?(w.parent=this.topAxesContainer,w.toFront()):(w.parent=this.bottomAxesContainer,w.toBack()),w.renderer&&w.renderer.processRenderer()},R.prototype.updateYAxis=function(u){var w=u.axis;u.opposite?(w.parent=this.rightAxesContainer,w.toBack()):(w.parent=this.leftAxesContainer,w.toFront()),w.renderer&&w.renderer.processRenderer()},R.prototype.processAxis=function(u){var w=this;u instanceof jh&&this._dataUsers.moveValue(u);var $=u.renderer;$.gridContainer.parent=this.plotContainer,$.gridContainer.toBack(),$.breakContainer.parent=this.plotContainer,$.breakContainer.toFront(),$.breakContainer.zIndex=10,u.addDisposer(new Kr(function(){w.dataUsers.removeValue(u)})),$.bulletsContainer.parent=this.axisBulletsContainer,this._disposers.push(u.events.on("positionchanged",function(){var G=Ip({x:0,y:0},u,w.axisBulletsContainer);u.renderer instanceof T1&&($.bulletsContainer.y=G.y),u.renderer instanceof Vd&&($.bulletsContainer.x=G.x)},void 0,!1)),this.plotContainer.events.on("maxsizechanged",function(){w.inited&&(u.invalidateDataItems(),w.updateSeriesMasks())},u,!1)},R.prototype.updateSeriesMasks=function(){JS()&&this.series.each(function(u){var w=u.mainContainer.mask;u.mainContainer.mask=void 0,u.mainContainer.mask=w})},R.prototype.handleSeriesRemoved=function(u){var w=u.oldValue;w&&(w.xAxis&&(w.xAxis.series.removeValue(w),w.xAxis.invalidateProcessedData()),w.yAxis&&(w.yAxis.series.removeValue(w),w.yAxis.invalidateProcessedData()),this.series.each(function($){$.resetExtremes()})),U.prototype.handleSeriesRemoved.call(this,u)},Object.defineProperty(R.prototype,"xAxes",{get:function(){return this._xAxes||(this._xAxes=new to,this._xAxes.events.on("inserted",this.processXAxis,this,!1),this._xAxes.events.on("removed",this.handleAxisRemoval,this,!1),this._disposers.push(new ua(this._xAxes,!1))),this._xAxes},enumerable:!0,configurable:!0}),R.prototype.handleAxisRemoval=function(u){var w=u.oldValue;this.dataUsers.removeValue(w),w.autoDispose&&w.dispose()},Object.defineProperty(R.prototype,"yAxes",{get:function(){return this._yAxes||(this._yAxes=new to,this._yAxes.events.on("inserted",this.processYAxis,this,!1),this._yAxes.events.on("removed",this.handleAxisRemoval,this,!1),this._disposers.push(new ua(this._yAxes,!1))),this._yAxes},enumerable:!0,configurable:!0}),R.prototype.handleSeriesAdded=function(u){try{U.prototype.handleSeriesAdded.call(this,u);var w=u.newValue;this.xAxes.length!=0&&this.yAxes.length!=0||(pi.removeFromInvalidComponents(w),w.dataInvalid=!1),w.xAxis,w.yAxis,w.maskBullets=w.maskBullets,w.fill==null&&(this.patterns?(Te(w.stroke)||(w.stroke=this.colors.next()),w.fill=this.patterns.next(),Te(w.fillOpacity)&&(w.fill.backgroundOpacity=w.fillOpacity),w.stroke instanceof Ee&&(w.fill.stroke=w.stroke,w.fill.fill=w.stroke)):w.fill=this.colors.next()),Te(w.stroke)||(w.stroke=w.fill)}catch($){this.raiseCriticalError($)}},Object.defineProperty(R.prototype,"cursor",{get:function(){return this._cursor},set:function(u){this._cursor!=u&&(this._cursor&&this.removeDispose(this._cursor),this._cursor=u,u&&(this._disposers.push(u),u.chart=this,u.shouldClone=!1,u.parent=this._cursorContainer,u.events.on("cursorpositionchanged",this.handleCursorPositionChange,this,!1),u.events.on("zoomstarted",this.handleCursorZoomStart,this,!1),u.events.on("zoomended",this.handleCursorZoomEnd,this,!1),u.events.on("panstarted",this.handleCursorPanStart,this,!1),u.events.on("panning",this.handleCursorPanning,this,!1),u.events.on("panended",this.handleCursorPanEnd,this,!1),u.events.on("behaviorcanceled",this.handleCursorCanceled,this,!1),u.events.on("hidden",this.handleHideCursor,this,!1),u.zIndex=Number.MAX_SAFE_INTEGER-1,this.tapToActivate&&this.setTapToActivate(this.tapToActivate)))},enumerable:!0,configurable:!0}),R.prototype.handleCursorPositionChange=function(){var u=this.cursor;if(u.visible&&!u.isHiding){var w=this.cursor.xPosition,$=this.cursor.yPosition;this.showSeriesTooltip({x:w,y:$});var G=[],K=u.snapToSeries;if(K&&!u.downPoint){K instanceof kI&&(K=[K]);var re=[];wi(K,function(we){if(!we.isHidden&&!we.isHiding){var De=we.xAxis,Ve=we.yAxis;De instanceof Ro&&!(De instanceof dc)&&Ve instanceof Ro&&!(Ve instanceof dc)?(we.dataItems.each(function(Ke){re.push(Ke)}),Xr(G,we.yAxis),Xr(G,we.xAxis)):(we.baseAxis==we.xAxis&&(Xr(G,we.yAxis),re.push(De.getSeriesDataItem(we,De.toAxisPosition(w),!0))),we.baseAxis==we.yAxis&&(Xr(G,we.xAxis),re.push(Ve.getSeriesDataItem(we,Ve.toAxisPosition($),!0))))}});var ue=this.getClosest(re,w,$);ue&&(this.series.each(function(we){var De=ue.component;we!=De&&(we.hideTooltip(),we.xAxis!=De.xAxis&&(we.xAxis.hideTooltip(),G.push(we.xAxis)),we.yAxis!=De.yAxis&&(we.yAxis.hideTooltip(),G.push(we.yAxis)))}),ue.component.showTooltipAtDataItem(ue),u.handleSnap(ue.component))}this._seriesPoints=[],this._cursorXPosition!=w&&this.showAxisTooltip(this.xAxes,w,G),this._cursorYPosition!=$&&this.showAxisTooltip(this.yAxes,$,G),this.arrangeTooltips&&this.sortSeriesTooltips(this._seriesPoints),this.legend&&this.legend.afterDraw()}},R.prototype.getClosest=function(u,w,$){var G,K=1/0;return qr(u,function(re){if(re){var ue=re.component.xAxis,we=re.component.yAxis,De=ue.positionToCoordinate(ue.toGlobalPosition(ue.toAxisPosition(w))),Ve=we.positionToCoordinate(we.toGlobalPosition(we.toAxisPosition($))),Ke=re.component.xField,Qe=re.component.yField;if(ue instanceof Ro&&!ae(re.getValue(Ke))||we instanceof Ro&&!ae(re.getValue(Qe)))return!0;var ft=ue.positionToCoordinate(ue.toGlobalPosition(ue.getPositionX(re,Ke,re.locations[Ke],"valueX"))),Gt=we.positionToCoordinate(we.toGlobalPosition(we.getPositionY(re,Qe,re.locations[Qe],"valueY"))),ei=Math.sqrt(Math.pow(De-ft,2)+Math.pow(Ve-Gt,2));return ei0){var w=this.cursor;if(w&&ae(w.maxTooltipDistance)){var $,G,K=vm({x:w.point.x,y:w.point.y},w),re=1/0;wi(u,function(qn){var Va=qn.series,vh=qn.point;if(vh){var lf={x:vh.x,y:vh.y},Ol=Math.abs(C(lf,K));Ol0&&wi(ue,function(qn){$!=qn.series&&qn.series.hideTooltip(0)}),ue=[{series:$,point:G}])),u=ue}var we=vm({x:-.5,y:-.5},this.plotContainer),De=vm({x:this.plotContainer.pixelWidth+.5,y:this.plotContainer.pixelHeight+.5},this.plotContainer),Ve=0,Ke=[];wi(u,function(qn){var Va=qn.point;Va&&Ci(Va,{x:we.x,y:we.y,width:De.x-we.x,height:De.y-we.y})&&(Ke.push({point:Va,series:qn.series}),Ve+=Va.y)}),u=Ke;var Qe=this.series.getIndex(0),ft=!1;Qe&&Qe.yAxis&&Qe.yAxis.renderer.inversed&&(ft=!0),ft?u.sort(function(qn,Va){return ah(qn.point.y,Va.point.y)}):(u.sort(function(qn,Va){return ah(Va.point.y,qn.point.y)}),u.reverse());var Gt=Ve/u.length,ei=$0({x:0,y:0},this.svgContainer.SVGContainer).y;if(u.length>0){var di=we.y,ci=De.y;yr({x:0,y:di},this);var qi=!1;if(Gt>di+(ci-di)/2)for(var rr=ci,Ii=u.length-1;Ii>=0;Ii--){var Ki=(Bs=u[Ii].series).tooltip,pr=u[Ii].point.y;if(Ki.setBounds({x:0,y:-ei,width:this.pixelWidth,height:rr+ei}),Ki.invalid&&Ki.validate(),Ki.toBack(),(rr=vm({x:0,y:Ki.label.pixelY-Ki.pixelY+pr-Ki.pixelMarginTop},Ki).y)<-ei){qi=!0;break}}if(Gt<=di+(ci-di)/2||qi)for(var kr=di,Er=(Ii=0,u.length);Ii0||K.dataItems.length>0)&&K.showTooltipAtPosition(w)})},R.prototype.getUpdatedRange=function(u,w){if(u){var $,G;u.renderer.inversed?(m(w),$=1-u.end,G=1-u.start):($=u.start,G=u.end);var K=G-$;return{start:$+w.start*K,end:$+w.end*K}}},R.prototype.handleCursorZoomEnd=function(u){var w=this.cursor,$=w.behavior;if($=="zoomX"||$=="zoomXY"){var G=w.xRange;G&&this.xAxes.length>0&&((G=this.getUpdatedRange(this.xAxes.getIndex(0),G)).priority="start",this.zoomAxes(this.xAxes,G))}if($=="zoomY"||$=="zoomXY"){var K=w.yRange;K&&this.yAxes.length>0&&((K=this.getUpdatedRange(this.yAxes.getIndex(0),K)).priority="start",this.zoomAxes(this.yAxes,K))}this.handleHideCursor()},R.prototype.handleCursorPanStart=function(u){var w=this.xAxes.getIndex(0);w&&(this._panStartXRange={start:w.start,end:w.end},w.renderer.inversed&&(this._panStartXRange=m(this._panStartXRange)));var $=this.yAxes.getIndex(0);$&&(this._panStartYRange={start:$.start,end:$.end},$.renderer.inversed&&(this._panStartYRange=m(this._panStartYRange)))},R.prototype.handleCursorPanEnd=function(u){var w=this.cursor,$=w.behavior;if(this._panEndXRange&&($=="panX"||$=="panXY")){var G=this._panEndXRange,K=this._panStartXRange,re=0;G.start<0&&(re=G.start),K.end>1?G.end>K.end&&(re=G.end-K.end):G.end>1&&(re=G.end-1),this.zoomAxes(this.xAxes,{start:G.start-re,end:G.end-re},!1,w.snapOnPan),this._panEndXRange=void 0,this._panStartXRange=void 0}!this._panEndYRange||$!="panY"&&$!="panXY"||(re=0,(G=this._panEndYRange).start<0&&(re=G.start),G.end>1&&(re=G.end-1),this.zoomAxes(this.yAxes,{start:G.start-re,end:G.end-re},!1,w.snapOnPan),this._panEndYRange=void 0,this._panStartYRange=void 0)},R.prototype.handleCursorCanceled=function(){this._panEndXRange=void 0,this._panStartXRange=void 0},R.prototype.handleCursorPanning=function(u){var w=this.cursor,$=w.behavior,G=w.maxPanOut;if(this._panStartXRange&&($=="panX"||$=="panXY")){var K=this._panStartXRange,re=w.xRange,ue=this.getCommonAxisRange(this.xAxes),we=K.end-K.start,De=re.start*(ue.end-ue.start),Ve=Math.max(-G,De+K.start),Ke=Math.min(De+K.end,1+G);Ve<=0&&(Ke=Ve+we),Ke>=1&&(Ve=Ke-we);var Qe={start:Ve,end:Ke};this._panEndXRange=Qe,this.zoomAxes(this.xAxes,Qe,!1,!1,w.maxPanOut)}!this._panStartYRange||$!="panY"&&$!="panXY"||(K=this._panStartYRange,re=w.yRange,ue=this.getCommonAxisRange(this.yAxes),we=K.end-K.start,De=re.start*(ue.end-ue.start),Ve=Math.max(-G,De+K.start),Ke=Math.min(De+K.end,1+G),Ve<=0&&(Ke=Ve+we),Ke>=1&&(Ve=Ke-we),Qe={start:Ve,end:Ke},this._panEndYRange=Qe,this.zoomAxes(this.yAxes,Qe,!1,!1,w.maxPanOut)),this.handleHideCursor()},R.prototype.handleYAxisSet=function(u){},R.prototype.handleCursorZoomStart=function(u){},Object.defineProperty(R.prototype,"scrollbarX",{get:function(){return this._scrollbarX},set:function(u){var w=this;this._scrollbarX&&this.removeDispose(this._scrollbarX),this._scrollbarX=u,u&&(this._disposers.push(u),u.parent=this.topAxesContainer,u.shouldClone=!1,u.startGrip.exportable=!1,u.endGrip.exportable=!1,u.toBack(),u.orientation="horizontal",u.events.on("rangechanged",this.handleXScrollbarChange,this,!1),this.events.on("datavalidated",function(){return u.updateThumb(!1)},this,!1),u.adapter.add("positionValue",function($){var G=w.xAxes.getIndex(0);return G&&($.value=G.getPositionLabel(G.renderer.inversed?1-$.position:$.position)),$}))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"scrollbarY",{get:function(){return this._scrollbarY},set:function(u){var w=this;this._scrollbarY&&this.removeDispose(this._scrollbarY),this._scrollbarY=u,u&&(this._disposers.push(u),u.parent=this.rightAxesContainer,u.startGrip.exportable=!1,u.shouldClone=!1,u.endGrip.exportable=!1,u.toFront(),u.orientation="vertical",u.events.on("rangechanged",this.handleYScrollbarChange,this,!1),this.events.on("datavalidated",function(){return u.updateThumb(!1)},this,!1),u.adapter.add("positionValue",function($){var G=w.yAxes.getIndex(0);return G&&($.value=G.getPositionLabel($.position)),$}))},enumerable:!0,configurable:!0}),R.prototype.handleXScrollbarChange=function(u){if(this.inited){var w=u.target,$=w.range;$.start==0&&($.priority="start"),$.end==1&&($.priority="end"),$=this.zoomAxes(this.xAxes,$),w.fixRange($)}},R.prototype.handleYScrollbarChange=function(u){if(this.inited){var w=u.target,$=w.range;$.end==1&&($.priority="end"),$.start==0&&($.priority="start"),$=this.zoomAxes(this.yAxes,$),w.fixRange($)}},R.prototype.zoomAxes=function(u,w,$,G,K,re){var ue={start:0,end:1};this.showSeriesTooltip();var we=w;return this.dataInvalid||ar(u.iterator(),function(De){var Ve=De.maxZoomFactor;if(ae(De.minZoomCount)&&(Ve/=De.minZoomCount),!(re&&1/(w.end-w.start)>=Ve)){if(De.zoomable){if(w=De.renderer.inversed?m(we):we,De.hideTooltip(0),G)if(De instanceof jh){var Ke=De.getCellEndPosition(0)-De.getCellStartPosition(0);w.start=De.roundPosition(w.start+Ke/2-De.startLocation*Ke,De.startLocation),w.end=De.roundPosition(w.end-Ke/2+(1-De.endLocation)*Ke,De.endLocation)}else w.start=De.roundPosition(w.start+1e-4,0,De.startLocation),w.end=De.roundPosition(w.end+1e-4,0,De.endLocation);var Qe=De.zoom(w,$,$,K);De.renderer.inversed&&(Qe=m(Qe)),ue=Qe}}}),ue},Object.defineProperty(R.prototype,"maskBullets",{get:function(){return this.getPropertyValue("maskBullets")},set:function(u){this.setPropertyValue("maskBullets",u,!0)&&this.bulletsContainer&&(this.bulletsContainer.mask=u?this._bulletMask:void 0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"arrangeTooltips",{get:function(){return this.getPropertyValue("arrangeTooltips")},set:function(u){this.setPropertyValue("arrangeTooltips",u,!0)},enumerable:!0,configurable:!0}),R.prototype.handleWheel=function(u){var w=this.plotContainer,$=Of(hu(u.point,this.htmlContainer,this.svgContainer.cssScale),w),G=u.shift.y;this.handleWheelReal(G,this.mouseWheelBehavior,$)},R.prototype.handleHorizontalWheel=function(u){var w=this.plotContainer,$=Of(hu(u.point,this.htmlContainer,this.svgContainer.cssScale),w);this.handleWheelReal(u.shift.x,this.horizontalMouseWheelBehavior,$)},R.prototype.handleWheelReal=function(u,w,$){if(u!=0){var G=this.plotContainer,K=this.getCommonAxisRange(this.xAxes),re=this.getCommonAxisRange(this.yAxes),ue=.1;if(w=="panX"||w=="panXY"){var we=K.end-K.start,De=Math.max(-0,K.start+ue*u/100*(K.end-K.start)),Ve=Math.min(K.end+ue*u/100*(K.end-K.start),1);De<=0&&(Ve=De+we),Ve>=1&&(De=Ve-we),this.zoomAxes(this.xAxes,{start:De,end:Ve})}if(w=="panY"||w=="panXY"){u*=-1;var Ke=re.end-re.start,Qe=Math.max(-0,re.start+ue*u/100*(re.end-re.start)),ft=Math.min(re.end+ue*u/100*(re.end-re.start),1);Qe<=0&&(ft=Qe+Ke),ft>=1&&(Qe=ft-Ke),this.zoomAxes(this.yAxes,{start:Qe,end:ft})}if(w=="zoomX"||w=="zoomXY"){var Gt=$.x/G.maxWidth,ei=this.xAxes.getIndex(0).toAxisPosition(Gt);De=Math.max(-0,K.start-ue*(K.end-K.start)*u/100*Gt),De=Math.min(De,ei),Ve=Math.min(K.end+ue*(K.end-K.start)*u/100*(1-Gt),1),Ve=Math.max(Ve,ei),this.zoomAxes(this.xAxes,{start:De,end:Ve},void 0,void 0,void 0,!0)}if(w=="zoomY"||w=="zoomXY"){var di=$.y/G.maxHeight,ci=this.yAxes.getIndex(0).toAxisPosition(di);Qe=Math.max(-0,re.start-ue*(re.end-re.start)*u/100*(1-di)),Qe=Math.min(Qe,ci),ft=Math.min(re.end+ue*u/100*di*(re.end-re.start),1),ft=Math.max(ft,ci),this.zoomAxes(this.yAxes,{start:Qe,end:ft},void 0,void 0,void 0,!0)}}},Object.defineProperty(R.prototype,"mouseWheelBehavior",{get:function(){return this.getPropertyValue("mouseWheelBehavior")},set:function(u){this.setPropertyValue("mouseWheelBehavior",u)&&(u!="none"?(this._mouseWheelDisposer=this.plotContainer.events.on("wheel",this.handleWheel,this,!1),this._disposers.push(this._mouseWheelDisposer)):this._mouseWheelDisposer&&(this.plotContainer.wheelable=!1,this.plotContainer.hoverable=!1,this._mouseWheelDisposer.dispose()))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"horizontalMouseWheelBehavior",{get:function(){return this.getPropertyValue("horizontalMouseWheelBehavior")},set:function(u){this.setPropertyValue("horizontalMouseWheelBehavior",u)&&(u!="none"?(this._mouseWheelDisposer2=this.plotContainer.events.on("wheel",this.handleHorizontalWheel,this,!1),this._disposers.push(this._mouseWheelDisposer2)):this._mouseWheelDisposer2&&(this.plotContainer.wheelable=!1,this.plotContainer.hoverable=!1,this._mouseWheelDisposer2.dispose()))},enumerable:!0,configurable:!0}),R.prototype.dataSourceDateFields=function(u){var w=this;return u=U.prototype.dataSourceDateFields.call(this,u),ar(this.series.iterator(),function($){u=w.populateDataSourceFields(u,$.dataFields,["dateX","dateY","openDateX","openDateY"])}),u},R.prototype.dataSourceNumberFields=function(u){var w=this;return u=U.prototype.dataSourceDateFields.call(this,u),ar(this.series.iterator(),function($){u=w.populateDataSourceFields(u,$.dataFields,["valueX","valueY","openValueX","openValueY"])}),u},R.prototype.processConfig=function(u){if(u){var w=[],$=[];if(Te(u.xAxes)&&wt(u.xAxes))for(var G=0,K=u.xAxes.length;G0;){var G=this.dataItems.getIndex(0);G&&$.dataItems.remove(G),$.dataUsers.each(function(K){var re=K.dataItems.getIndex(0);re&&K.dataItems.remove(re)}),$._parseDataFrom--,w--}$.invalidateData()}},R.prototype.removeData=function(u){this.scrollbarX instanceof $I&&this.removeScrollbarData(this.scrollbarX,u),this.scrollbarY instanceof $I&&this.removeScrollbarData(this.scrollbarY,u),U.prototype.removeData.call(this,u)},R.prototype.setTapToActivate=function(u){U.prototype.setTapToActivate.call(this,u),this.cursor&&(this.cursor.interactions.isTouchProtected=u,this.plotContainer.interactions.isTouchProtected=u)},R.prototype.handleTapToActivate=function(){U.prototype.handleTapToActivate.call(this),this.cursor&&(this.cursor.interactions.isTouchProtected=!1,this.plotContainer.interactions.isTouchProtected=!1)},R.prototype.handleTapToActivateDeactivation=function(){U.prototype.handleTapToActivateDeactivation.call(this),this.cursor&&(this.cursor.interactions.isTouchProtected=!0,this.plotContainer.interactions.isTouchProtected=!0)},R}(Sz);pi.registeredClasses.XYChart=U0,sp.push({relevant:Mf.maybeXS,state:function(U,R){if(U instanceof U0&&U.scrollbarX){var u=U.states.create(R);return U.scrollbarX.states.create(R).properties.disabled=!0,u}return null}}),sp.push({relevant:Mf.maybeXS,state:function(U,R){if(U instanceof U0&&U.scrollbarY){var u=U.states.create(R);return U.scrollbarY.states.create(R).properties.disabled=!0,u}return null}});var Pz=function(U){function R(){var u=U.call(this)||this;u.className="LineSeriesSegment",u.isMeasured=!1,u.interactionsEnabled=!1,u.layout="none";var w=u.createChild(yo);u.fillSprite=w,w.shouldClone=!1,w.setElement(u.paper.add("path")),w.isMeasured=!1,u._disposers.push(w);var $=u.createChild(yo);return u.strokeSprite=$,$.shouldClone=!1,$.fill=He(),$.setElement(u.paper.add("path")),$.isMeasured=!1,u._disposers.push($),u}return ie(R,U),R.prototype.drawSegment=function(u,w,$,G){if(!this.disabled)if(u.length>0&&w.length>0&&ae(u[0].x)&&ae(u[0].y)){var K=wn({x:u[0].x-.2,y:u[0].y-.2})+wn(u[0]),re=this.series;re.smoothing=="bezier"?K+=new S1($,G).smooth(u):re.smoothing=="monotoneX"?K+=new Z0e({closed:!1}).smooth(u):re.smoothing=="monotoneY"&&(K+=new Q0e({closed:!1}).smooth(u)),this.strokeOpacity==0||this.strokeSprite.strokeOpacity==0||(this.strokeSprite.path=K),(this.fillOpacity>0||this.fillSprite.fillOpacity>0)&&ae(w[0].x)&&ae(w[0].y)&&(K+=Rr(w[0]),re.smoothing=="bezier"?K+=new S1($,G).smooth(w):re.smoothing=="monotoneX"?K+=new Z0e({closed:!1}).smooth(w):re.smoothing=="monotoneY"&&(K+=new Q0e({closed:!1}).smooth(w)),K+=Rr(u[0]),K+=" Z",this.fillSprite.path=K)}else this.fillSprite.path="",this.strokeSprite.path=""},R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u);var w=this.strokeSprite;Ir(u,w.properties,wc),w.events.copyFrom(u.strokeSprite.events),w.fillOpacity=0;var $=this.fillSprite;Ir(u,$.properties,wc),$.events.copyFrom(u.fillSprite.events),$.strokeOpacity=0},R}(cs);pi.registeredClasses.LineSeriesSegment=Pz;var cve=function(U){function R(){var u=U.call(this)||this;return u.className="DurationAxisDataItem",u.applyTheme(),u}return ie(R,U),R}(l8),u8=function(U){function R(){var u=U.call(this)||this;return u._baseUnit="second",u.className="DurationAxis",u.setPropertyValue("maxZoomFactor",1e6),u.applyTheme(),u}return ie(R,U),R.prototype.formatLabel=function(u,w){return this.durationFormatter.format(u,w||this.axisDurationFormat)},R.prototype.adjustMinMax=function(u,w,$,G,K){var re,ue,we,De=this.baseUnit;if(this.setPropertyValue("maxPrecision",0),De=="millisecond"||De=="second"||De=="minute"||De=="hour"){G<=1&&(G=1),G=Math.round(G);var Ve=u,Ke=w;$===0&&($=Math.abs(w));var Qe,ft=[60,30,20,15,10,2,1],Gt=1;De=="hour"&&(ft=[24,12,6,4,2,1]);try{for(var ei=xe(ft),di=ei.next();!di.done;di=ei.next()){var ci=di.value;if($/ci>G){Gt=ci;break}}}catch(Ki){re={error:Ki}}finally{try{di&&!di.done&&(ue=ei.return)&&ue.call(ei)}finally{if(re)throw re.error}}var qi=Math.ceil((w-u)/Gt/G),rr=Math.log(Math.abs(qi))*Math.LOG10E,Ii=Math.pow(10,Math.floor(rr))/10;Qe=Gt*(qi=T(ft,qi/Ii)*Ii),this.durationFormatter.getValueUnit(Qe,this.baseUnit),u=Math.floor(u/Qe)*Qe,w=Math.ceil(w/Qe)*Qe,K&&((u-=Qe)<0&&Ve>=0&&(u=0),(w+=Qe)>0&&Ke<=0&&(w=0)),we={min:u,max:w,step:Qe}}else we=U.prototype.adjustMinMax.call(this,u,w,$,G,K);return this.axisDurationFormat=this.durationFormatter.getFormat(we.step,we.max,this.baseUnit),we},Object.defineProperty(R.prototype,"tooltipDurationFormat",{get:function(){return this._tooltipDurationFormat},set:function(u){this._tooltipDurationFormat=u},enumerable:!0,configurable:!0}),R.prototype.getTooltipText=function(u){var w=ze(this.positionToValue(u),this._stepDecimalPlaces),$=this.formatLabel(w,this.tooltipDurationFormat);return this._adapterO?this._adapterO.apply("getTooltipText",$):$},Object.defineProperty(R.prototype,"baseUnit",{get:function(){return this._baseUnit},set:function(u){this._baseUnit!=u&&(this._baseUnit=u,this.durationFormatter.baseUnit=u,this.invalidate())},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.baseUnit=u.baseUnit},R}(Ro);pi.registeredClasses.DurationAxis=u8,pi.registeredClasses.DurationAxisDataItem=cve;var c8=function(U){function R(){var u=U.call(this)||this;return u.className="LineSeriesDataItem",u}return ie(R,U),R}(rg),Oz=function(U){function R(){var u=U.call(this)||this;return u.minDistance=.5,u.segments=new lo(u.createSegment()),u.segments.template.applyOnClones=!0,u._disposers.push(new ua(u.segments)),u._disposers.push(u.segments.template),u._segmentsIterator=new nf(u.segments,function(){return u.segments.create()}),u._segmentsIterator.createNewItems=!0,u.className="LineSeries",u.strokeOpacity=1,u.fillOpacity=0,u.connect=!0,u.tensionX=1,u.tensionY=1,u.autoGapCount=1.1,u.smoothing="bezier",u.segmentsContainer=u.mainContainer.createChild(cs),u.segmentsContainer.isMeasured=!1,u.bulletsContainer.toFront(),u.applyTheme(),u}return ie(R,U),R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),Te(this.readerTitle)||(this.readerTitle=this.language.translate("Line Series"))},R.prototype.createSegment=function(){return new Pz},R.prototype.createDataItem=function(){return new c8},R.prototype.setInitialWorkingValues=function(u){var w=this._yAxis.get(),$=this._xAxis.get();if(this.appeared&&this.visible){var G=this.dataItems.getIndex(u.index-1);if(u.component=this,this.baseAxis==$&&w instanceof Ro){var K=w.minZoomed;if(G&&(K=G.values.valueY.workingValue),u.setWorkingValue("valueY",K,0),u.setWorkingValue("valueY",u.values.valueY.value),$ instanceof dc)u.setWorkingLocation("dateX",u.locations.dateX-1,0),u.setWorkingLocation("dateX",u.locations.dateX);else if($ instanceof u8&&G){var re=u.valueX;u.setWorkingValue("valueX",G.valueX,0),u.setWorkingValue("valueX",re)}}if(this.baseAxis==w&&$ instanceof Ro){var ue=$.minZoomed;G&&(ue=G.values.valueX.workingValue),u.setWorkingValue("valueX",ue,0),u.setWorkingValue("valueX",u.values.valueX.value),w instanceof dc?(u.setWorkingLocation("dateY",u.locations.dateX-1,0),u.setWorkingLocation("dateY",u.locations.dateY)):w instanceof u8&&G&&(re=u.valueY,u.setWorkingValue("valueY",G.valueY,0),u.setWorkingValue("valueY",re))}}else this.baseAxis==$&&w instanceof Ro&&($ instanceof dc&&u.setWorkingLocation("dateX",u.locations.dateX),$ instanceof jh&&u.setWorkingLocation("categoryX",u.locations.categoryX)),this.baseAxis==w&&$ instanceof Ro&&(w instanceof dc&&u.setWorkingLocation("dateY",u.locations.dateY),w instanceof jh&&u.setWorkingLocation("categoryY",u.locations.categoryY))},R.prototype.updateLegendValue=function(u,w){U.prototype.updateLegendValue.call(this,u,w),u&&u.segment&&(this.tooltipColorSource=u.segment)},R.prototype.validate=function(){var u=this;U.prototype.validate.call(this),this.xAxis&&this.yAxis&&(this._segmentsIterator.reset(),this.openSegmentWrapper(this._adjustedStartIndex),ar(this.axisRanges.iterator(),function(w){u.openSegmentWrapper(u._adjustedStartIndex,w)}),ar(this._segmentsIterator.iterator(),function(w){w.__disabled=!0}))},R.prototype.sliceData=function(){for(var u=this.startIndex,w=this.endIndex,$=this.startIndex-1;$>=0;$--)if((K=this.dataItems.getIndex($))&&K.hasValue(this._xValueFields)&&K.hasValue(this._yValueFields)){u=$;break}this._adjustedStartIndex=this.findAdjustedIndex(u,["stroke","strokeWidth","strokeDasharray","strokeOpacity","fill","fillOpacity","opacity"]),$=this.endIndex;for(var G=this.dataItems.length;$=0;ue--){var we=$.dataItems.getIndex(ue);if(we&&Te(we.properties[re])){u>ue&&(u=ue);break}}}),u},R.prototype.openSegmentWrapper=function(u,w){var $={index:u,axisRange:w};do $=this.openSegment($.index,$.axisRange);while($)},R.prototype.getSegment=function(){var u=this._segmentsIterator.getFirst();return u.series=this,u.isDisposed()?(this.segments.removeValue(u),this.getSegment()):u},R.prototype.openSegment=function(u,w){var $=!1,G=[];u=Math.min(u,this.dataItems.length);var K,re=Math.min(this._workingEndIndex,this.dataItems.length);this._workingEndIndex=Math.min(this._workingEndIndex,this.dataItems.length);var ue=!1,we=this.getSegment();we.strokeDasharray=void 0,we.__disabled=!1,w?(we.parent=w.contents,Ir(w.contents,we,wc)):(Ir(this,we,wc),we.filters.clear(),we.parent=this.segmentsContainer),this.group.node.removeAttribute("fill");for(var De=this.connect,Ve=!1,Ke=u;Ke=$;we--){var De=this.dataItems.getIndex(we);De.hasValue(this._xValueFields)&&De.hasValue(this._yValueFields)&&this.addPoints(ue,De,this.xOpenField,this.yOpenField,!0)}else{var Ve=this.baseAxis,Ke=w.length,Qe=this.xAxis,ft=this.yAxis;Ke>0&&(Ve==Qe?(ue.push({x:w[Ke-1].x,y:ft.basePoint.y}),ue.push({x:w[0].x,y:ft.basePoint.y})):(ue.push({x:Qe.basePoint.x,y:w[Ke-1].y}),ue.push({x:Qe.basePoint.x,y:w[0].y})))}return this.drawSegment(u,w,ue),re&&G++,G0){var re=u.createChild(OI);Ir(this,re,wc),re.width=$,re.height=G,re.y=0,re.strokeOpacity=0,re.visible=!0,K.y=0}var ue=u.dataItem;ue.color=this.stroke,ue.colorOrig=this.fill,on(this.bullets.iterator(),function(we){if(we instanceof zo&&!we.copyToLegendMarker)return!1;var De=!1;if(we instanceof cs&&ar(we.children.iterator(),function(Ke){if(Ke instanceof tg)return De=!0,!0}),!De){var Ve=we.clone();return Ve.parent=u,Ve.isMeasured=!0,Ve.tooltipText=void 0,Ve.x=$/2,w.fillOpacity>0?Ve.y=0:Ve.y=G/2,Ve.visible=!0,Te(Ve.fill)||(Ve.fill=w.fill),Te(Ve.stroke)||(Ve.stroke=w.stroke),!1}})},R.prototype.disposeData=function(){U.prototype.disposeData.call(this),this.segments.clear()},Object.defineProperty(R.prototype,"autoGapCount",{get:function(){return this.getPropertyValue("autoGapCount")},set:function(u){this.setPropertyValue("autoGapCount",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"smoothing",{get:function(){return this.getPropertyValue("smoothing")},set:function(u){this.setPropertyValue("smoothing",u,!0)},enumerable:!0,configurable:!0}),R}(kI);pi.registeredClasses.LineSeries=Oz,pi.registeredClasses.LineSeriesDataItem=c8;var Rz=function(U){function R(){var u=U.call(this)||this;return u.className="RadarSeriesDataItem",u.setLocation("dateX",0,0),u.setLocation("dateY",0,0),u.setLocation("categoryX",0,0),u.setLocation("categoryY",0,0),u.applyTheme(),u}return ie(R,U),R}(c8),pie=function(U){function R(){var u=U.call(this)||this;return u.className="RadarSeries",u.connectEnds=!0,u.applyTheme(),u}return ie(R,U),R.prototype.validate=function(){this.chart.invalid&&this.chart.validate(),U.prototype.validate.call(this)},R.prototype.createDataItem=function(){return new Rz},R.prototype.getPoint=function(u,w,$,G,K,re,ue){re||(re="valueX"),ue||(ue="valueY");var we=C({x:this.yAxis.getX(u,$,K,ue),y:this.yAxis.getY(u,$,K,ue)});we==0&&(we=1e-5);var De=this.xAxis.getAngle(u,w,G,re),Ve=this.chart.startAngle,Ke=this.chart.endAngle;return DeKe?void 0:{x:we*A(De),y:we*$e(De)}},R.prototype.addPoints=function(u,w,$,G,K){var re=this.getPoint(w,$,G,w.locations[$],w.locations[G]);re&&u.push(re)},R.prototype.getMaskPath=function(){var u=this.yAxis.renderer;return oC(u.startAngle,u.endAngle-u.startAngle,u.pixelRadius,u.pixelInnerRadius)},R.prototype.drawSegment=function(u,w,$){var G=this.yAxis.renderer;this.connectEnds&&Math.abs(G.endAngle-G.startAngle)==360&&(this.dataFields[this._xOpenField]||this.dataFields[this._yOpenField]||this.stacked)&&(w.push(w[0]),$.length>0&&$.unshift($[$.length-1])),U.prototype.drawSegment.call(this,u,w,$)},Object.defineProperty(R.prototype,"connectEnds",{get:function(){return this.getPropertyValue("connectEnds")},set:function(u){this.setPropertyValue("connectEnds",u,!0)},enumerable:!0,configurable:!0}),R.prototype.positionBulletReal=function(u,w,$){var G=this.xAxis,K=this.yAxis;(wG.end||$K.end)&&(u.visible=!1),u.moveTo(this.xAxis.renderer.positionToPoint(w,$))},R.prototype.setXAxis=function(u){U.prototype.setXAxis.call(this,u),this.updateRendererRefs()},R.prototype.setYAxis=function(u){U.prototype.setYAxis.call(this,u),this.updateRendererRefs()},R.prototype.updateRendererRefs=function(){var u=this.xAxis.renderer,w=this.yAxis.renderer;u.axisRendererY=w},R}(Oz);pi.registeredClasses.RadarSeries=pie,pi.registeredClasses.RadarSeriesDataItem=Rz;var fie=function(U){function R(u){var w=U.call(this,u)||this;return w.className="AxisFillCircular",w.element=w.paper.add("path"),w.radius=de(100),w.applyTheme(),w}return ie(R,U),R.prototype.draw=function(){if(U.prototype.draw.call(this),!this.__disabled&&!this.disabled&&this.axis){var u=this.axis.renderer;this.fillPath=u.getPositionRangePath(this.startPosition,this.endPosition,this.radius,Te(this.innerRadius)?this.innerRadius:u.innerRadius,this.cornerRadius),this.path=this.fillPath}},Object.defineProperty(R.prototype,"innerRadius",{get:function(){return this.getPropertyValue("innerRadius")},set:function(u){this.setPercentProperty("innerRadius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cornerRadius",{get:function(){return this.getPropertyValue("cornerRadius")},set:function(u){this.setPropertyValue("cornerRadius",u,!0)},enumerable:!0,configurable:!0}),R}(Cz);pi.registeredClasses.AxisFillCircular=fie;var Mz=function(U){function R(){var u=U.call(this)||this;return u.className="GridCircular",u.pixelPerfect=!1,u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"innerRadius",{get:function(){return this.getPropertyValue("innerRadius")},set:function(u){this.setPercentProperty("innerRadius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),R}(G4);pi.registeredClasses.GridCircular=Mz;var h8=function(U){function R(){var u=U.call(this)||this;return u.fdx=0,u.fdy=0,u.className="AxisLabelCircular",u.padding(0,0,0,0),u.location=.5,u.locationOnPath=.5,u.radius=0,u.isMeasured=!1,u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"relativeRotation",{get:function(){return this.getPropertyValue("relativeRotation")},set:function(u){if(this.setPropertyValue("relativeRotation",u,!0),!Te(u)){this.rotation=void 0;var w=this.dataItem;w&&w.component&&w.component.invalidateDataItems()}},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"bent",{get:function(){return this.getPropertyValue("bent")},set:function(u){this.setPropertyValue("bent",u,!0),this.setPropertyValue("wrap",!1),this.setPropertyValue("horizontalCenter","none"),this.setPropertyValue("verticalCenter","none"),u?(this.setPropertyValue("dx",0),this.setPropertyValue("dy",0),this.setPropertyValue("x",0),this.setPropertyValue("y",0),this.setPropertyValue("rotation",0),this.fdx=0,this.fdy=0,this.textAlign="middle"):this.textPathElement&&(this.textPathElement.dispose(),this.textPathElement=void 0)},enumerable:!0,configurable:!0}),R.prototype.pixelRadius=function(u){var w=1;return this.inside&&(w=-1),Is(this.radius,u)*w},R.prototype.pixelRadiusY=function(u,w){var $=1;this.inside&&($=-1);var G=this.radius;return ae(G)?Is(G*=w/u,u)*$:Is(G,w)*$},R.prototype.fixPosition=function(u,w,$,G,K){ae($)||($=w),ae(G)||(G=0),ae(K)||(K=0);var re={x:w*A(u),y:$*$e(u)};this.invalid&&this.validate();var ue=!1,we=this.radius;(we instanceof J&&we.value<0||we<0)&&(ue=!0);var De=this.relativeRotation,Ve=this.pixelRadius(w);if(this.bent){var Ke={x:(w+Ve)*A(u+180),y:($+Ve*$/w)*$e(u+180)};return this.path=wn(Ke)+Bd(u+180,360,w+Ve,$+Ve*$/w),void(this.textPathElement&&this.textPathElement.attr({startOffset:100*this.locationOnPath+"%"}))}if(ae(De)){this.horizontalCenter="none",this.verticalCenter="none",u=ti(u,-180,180);var Qe=this.bbox.width,ft=this.bbox.height,Gt=this.pixelPaddingBottom,ei=this.pixelPaddingTop,di=this.pixelPaddingLeft,ci=this.pixelPaddingRight;u>90||u<-90?De==-90&&(De=90,Qe=0):(De==-90&&(ft=-ft),De==90&&(De=-90,Qe=-di-ci,ft=-ft-ei-Gt)),this.rotation=De+u+90;var qi=$e(De)/2,rr=A(De)/2,Ii=this.rotation;this.dx=ft*qi*$e(Ii)-Qe*rr*A(Ii),this.dy=-ft*qi*A(Ii)-Qe*rr*$e(Ii),this.inside?u>90||u<-90?Ve-=(Gt+ei)*A(De)+(di+ci)*$e(De):Ve+=(Gt+this.bbox.height+ei)*A(De)+(di+ci+this.bbox.width)*$e(De):Ve+=(ft+Gt+ei)*A(De)+(Qe+di+ci)*$e(De),re.x+=A(u)*Ve,re.y+=$e(u)*Ve*$/w}else this.horizontalCenter="middle",this.verticalCenter="middle",ue?(this.dx=0,this.dy=0,re.x=(w+Ve)*A(u),re.y=($+Ve*$/w)*$e(u)):(this.dy=this._measuredHeight/2*$e(u),this.dx=this._measuredWidth/2*A(u),re.x+=A(u)*Ve,re.y+=$e(u)*Ve*$/w);re.x+=G,re.y+=K,this.fdx=this.dx,this.fdy=this.dy,this.moveTo(re)},R}(Tz);pi.registeredClasses.AxisLabelCircular=h8;var mie=function(U){function R(){var u=U.call(this)||this;return u.pixelRadiusReal=0,u.layout="none",u.className="AxisRendererCircular",u.isMeasured=!1,u.startAngle=-90,u.endAngle=270,u.useChartAngles=!0,u.radius=de(100),u.isMeasured=!1,u.grid.template.location=0,u.labels.template.location=0,u.labels.template.radius=15,u.ticks.template.location=0,u.ticks.template.pixelPerfect=!1,u.tooltipLocation=0,u.line.strokeOpacity=0,u.applyTheme(),u}return ie(R,U),R.prototype.setAxis=function(u){var w=this;U.prototype.setAxis.call(this,u),u.isMeasured=!1;var $=u.tooltip;$.adapter.add("dx",function(G,K){var re=Of({x:K.pixelX,y:K.pixelY},w);return w.pixelRadius*Math.cos(Math.atan2(re.y,re.x))-re.x}),$.adapter.add("dy",function(G,K){var re=Of({x:K.pixelX,y:K.pixelY},w);return w.pixelRadius*Math.sin(Math.atan2(re.y,re.x))-re.y})},R.prototype.validate=function(){this.chart&&this.chart.invalid&&this.chart.validate(),U.prototype.validate.call(this)},Object.defineProperty(R.prototype,"axisLength",{get:function(){return 2*Math.PI*this.pixelRadius},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!1,!1,10,!1)&&this.axis&&this.axis.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pixelRadius",{get:function(){return Oo(this.radius,this.pixelRadiusReal)||0},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"innerRadius",{get:function(){var u=this.chart,w=this.getPropertyValue("innerRadius");if(u){if(Te(w)){if(w instanceof J&&u){var $=u.mr,G=w.value;w=de(100*(G=Math.max($*G,$-Math.min(u.plotContainer.innerHeight,u.plotContainer.innerWidth))/$))}}else(w=u.innerRadius)instanceof J&&u&&(w=de(w.value*u.innerRadiusModifyer*100));return w}},set:function(u){this.setPercentProperty("innerRadius",u,!1,!1,10,!1)&&this.axis&&this.axis.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"useChartAngles",{get:function(){return this.getPropertyValue("useChartAngles")},set:function(u){this.setPropertyValue("useChartAngles",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pixelInnerRadius",{get:function(){return Oo(this.innerRadius,this.pixelRadiusReal)||0},enumerable:!0,configurable:!0}),R.prototype.positionToPoint=function(u,w){ae(w)||(w=1);var $=this.positionToCoordinate(u),G=this.startAngle+(this.endAngle-this.startAngle)*$/this.axisLength,K=this.pixelRadius,re=this.pixelInnerRadius;if(this.axisRendererY){var ue=nt(this.axisRendererY.positionToCoordinate(w),0,1/0);return ue==0&&(ue=1e-6),{x:ue*A(G),y:ue*$e(G)}}return{x:A(G)*re+(K-re)*A(G)*w,y:$e(G)*re+(K-re)*$e(G)*w}},R.prototype.positionToAngle=function(u){var w=this.axis,$=(this.endAngle-this.startAngle)/(w.end-w.start);return ze(w.renderer.inversed?this.startAngle+(w.end-u)*$:this.startAngle+(u-w.start)*$,3)},R.prototype.angleToPosition=function(u){var w=this.axis,$=(this.endAngle-this.startAngle)/(w.end-w.start);return ze(w.renderer.inversed?w.end-(u-this.startAngle)/$:(u-this.startAngle)/$+w.start,5)},R.prototype.updateAxisLine=function(){var u=this.pixelRadius,w=this.startAngle,$=H(360,this.endAngle-w);this.line.path=wn({x:u*A(w),y:u*$e(w)})+Bd(w,$,u,u)},R.prototype.updateGridElement=function(u,w,$){w+=($-w)*u.location;var G=this.positionToPoint(w);if(ae(G.x)&&ae(G.y)&&u.element){var K=tt*Math.atan2(G.y,G.x),re=Oo(Te(u.radius)?u.radius:de(100),this.pixelRadius),ue=Oo(u.innerRadius,this.pixelRadius);u.zIndex=0;var we=Oo(ae(ue)?ue:this.innerRadius,this.pixelRadiusReal,!0);ae(we)||(we=0),u.path=wn({x:we*A(K),y:we*$e(K)})+Rr({x:re*A(K),y:re*$e(K)})}this.toggleVisibility(u,w,0,1)},R.prototype.updateTickElement=function(u,w,$){w+=($-w)*u.location;var G=this.positionToPoint(w);if(u.element){var K=this.pixelRadius,re=tt*Math.atan2(G.y,G.x),ue=u.length;u.inside&&(ue=-ue),u.zIndex=1,u.path=wn({x:K*A(re),y:K*$e(re)})+Rr({x:(K+ue)*A(re),y:(K+ue)*$e(re)})}this.toggleVisibility(u,w,0,1)},R.prototype.updateBullet=function(u,w,$){var G=.5;u instanceof z4&&(G=u.location),w+=($-w)*G;var K=this.positionToPoint(w),re=this.pixelRadius,ue=tt*Math.atan2(K.y,K.x);K={x:re*A(ue),y:re*$e(ue)},this.positionItem(u,K),this.toggleVisibility(u,w,0,1)},R.prototype.updateLabelElement=function(u,w,$,G){Te(G)||(G=u.location),w+=($-w)*G,u.fixPosition(this.positionToAngle(w),this.pixelRadius),u.zIndex=2,this.toggleVisibility(u,w,this.minLabelPosition,this.maxLabelPosition)},R.prototype.fitsToBounds=function(u){return!0},Object.defineProperty(R.prototype,"startAngle",{get:function(){return this.getPropertyValue("startAngle")},set:function(u){this.setPropertyValue("startAngle",u)&&(this.invalidateAxisItems(),this.axis&&this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endAngle",{get:function(){return this.getPropertyValue("endAngle")},set:function(u){this.setPropertyValue("endAngle",u)&&(this.invalidateAxisItems(),this.axis&&this.axis.invalidateSeries())},enumerable:!0,configurable:!0}),R.prototype.getPositionRangePath=function(u,w,$,G,K){var re="";if(ae(u)&&ae(w)){Te($)||($=this.radius),u=ye(u,this.axis.start),(w=H(w,this.axis.end))0&&Ke&&De&&De instanceof jh){var Qe=De.renderer.grid.template.location,ft=De.getAngle(Ke.dataItems.getIndex(0),"categoryX",Qe);G=wn({x:K*A(ft),y:K*$e(ft)});for(var Gt=1;Gt0&&Qe&&Ke&&Ke instanceof jh){var Gt=Ke.renderer.grid.template.location,ei=Ke.getAngle(Qe.dataItems.getIndex(0),"categoryX",Gt);$=wn({x:ue*A(ei),y:ue*$e(ei)});for(var di=1;di=0;di--)$+=Rr({x:re*A(ei=Ke.getAngle(Qe.dataItems.getIndex(di),"categoryX",Gt)),y:re*$e(ei)})}else $=oC(we,De,ue,re);return $},R.prototype.updateBreakElement=function(u){var w=u.startLine,$=u.endLine,G=u.fillShape,K=u.startPoint,re=u.endPoint;w.radius=Math.abs(K.y),$.radius=Math.abs(re.y),G.radius=Math.abs(re.y),G.innerRadius=Math.abs(K.y)},R.prototype.createBreakSprites=function(u){u.startLine=new J$,u.endLine=new J$,u.fillShape=new J$},R.prototype.updateTooltip=function(){if(this.axis){var u=this.axisAngle;u<0&&(u+=360);var w="vertical";(u>45&&u<135||u>225&&u<315)&&(w="horizontal"),this.axis.updateTooltip(w,{x:-4e3,y:-4e3,width:8e3,height:8e3})}},R.prototype.updateTickElement=function(u,w,$){w+=($-w)*u.location;var G=this.positionToPoint(w);if(u.element){var K=ri(this.axisAngle+90);K/90!=Math.round(K/90)?u.pixelPerfect=!1:u.pixelPerfect=!0;var re=-u.length;u.inside&&(re*=-1),u.path=wn({x:0,y:0})+Rr({x:re*A(K),y:re*$e(K)})}this.positionItem(u,G),this.toggleVisibility(u,w,0,1)},R.prototype.updateBullet=function(u,w,$){var G=.5;u instanceof z4&&(G=u.location),w+=($-w)*G;var K=this.positionToPoint(w);this.positionItem(u,K),this.toggleVisibility(u,w,0,1)},R.prototype.positionToCoordinate=function(u){var w=this.axis,$=w.axisFullLength,G=this.pixelInnerRadius;return ze(w.renderer.inversed?(w.end-u)*$+G:(u-w.start)*$+G,1)},R.prototype.pointToPosition=function(u){var w=C(u)-this.pixelInnerRadius;return this.coordinateToPosition(w)},Object.defineProperty(R.prototype,"chart",{get:function(){return this._chart.get()},set:function(u){this._chart.set(u,null)},enumerable:!0,configurable:!0}),R}(T1);pi.registeredClasses.AxisRendererRadial=d8;var hve=function(U){function R(){var u=U.call(this)||this;return u.className="RadarChartDataItem",u.applyTheme(),u}return ie(R,U),R}(Az),gie=function(U){function R(){var u=U.call(this)||this;u._axisRendererX=mie,u._axisRendererY=d8,u.innerRadiusModifyer=1,u.mr=1,u.className="RadarChart",u.startAngle=-90,u.endAngle=270,u.radius=de(80),u.innerRadius=0;var w=u.plotContainer.createChild(cs);return w.shouldClone=!1,w.layout="absolute",w.align="center",w.valign="middle",u.seriesContainer.parent=w,u.radarContainer=w,u.bulletsContainer.parent=w,u.axisBulletsContainer=w,u._cursorContainer=w,u.chartContainer.events.on("maxsizechanged",u.invalidate,u,!1),u._bulletMask=w.createChild(FI),u._bulletMask.shouldClone=!1,u._bulletMask.element=u.paper.add("path"),u._bulletMask.opacity=0,u.applyTheme(),u}return ie(R,U),R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),Te(this.readerTitle)||(this.readerTitle=this.language.translate("Radar chart"))},R.prototype.processAxis=function(u){U.prototype.processAxis.call(this,u);var w=u.renderer;w.gridContainer.parent=w,w.breakContainer.parent=w,u.parent=this.radarContainer,w.toBack()},R.prototype.handleXAxisRangeChange=function(){U.prototype.handleXAxisRangeChange.call(this),ar(this.yAxes.iterator(),function(u){u.invalidate()})},R.prototype.handleYAxisRangeChange=function(){U.prototype.handleYAxisRangeChange.call(this),ar(this.xAxes.iterator(),function(u){u.invalidate()})},R.prototype.processConfig=function(u){if(u&&(Te(u.cursor)&&!Te(u.cursor.type)&&(u.cursor.type="RadarCursor"),Te(u.series)&&wt(u.series)))for(var w=0,$=u.series.length;w<$;w++)u.series[w].type=u.series[w].type||"RadarSeries";U.prototype.processConfig.call(this,u)},R.prototype.beforeDraw=function(){U.prototype.beforeDraw.call(this);var u=this.plotContainer,w=Zt(this.startAngle,this.endAngle,1),$={x:0,y:0,width:0,height:0},G=u.innerWidth/w.width,K=u.innerHeight/w.height,re=this.innerRadius;if(re instanceof J){var ue=re.value,we=Math.min(G,K);this.mr=we,ue=Math.max(we*ue,we-Math.min(u.innerHeight,u.innerWidth))/we,$=Zt(this.startAngle,this.endAngle,ue),this.innerRadiusModifyer=ue/re.value,re=de(100*ue)}w=Ye([w,$]);var De=Math.min(u.innerWidth/w.width,u.innerHeight/w.height),Ve=2*Oo(this.radius,De)||0,Ke=Ve/2,Qe=this.startAngle,ft=this.endAngle;this._pixelInnerRadius=Oo(re,Ke),this._bulletMask.path=oC(Qe,ft-Qe,Ke,this._pixelInnerRadius),ar(this.xAxes.iterator(),function(ei){ei.renderer.useChartAngles&&(ei.renderer.startAngle=Qe,ei.renderer.endAngle=ft),ei.width=Ve,ei.height=Ve,ei.renderer.pixelRadiusReal=Ke}),ar(this.yAxes.iterator(),function(ei){ei.renderer.startAngle=Qe,ei.renderer.endAngle=ft,ei.width=Ve,ei.height=Ve,ei.renderer.pixelRadiusReal=Ke});var Gt=this.cursor;Gt&&(Gt.width=Ve,Gt.height=Ve,Gt.startAngle=Qe,Gt.endAngle=ft),this.radarContainer.definedBBox={x:Ke*w.x,y:Ke*w.y,width:Ke*w.width,height:Ke*w.height},this.radarContainer.validatePosition()},R.prototype.createSeries=function(){return new pie},Object.defineProperty(R.prototype,"startAngle",{get:function(){return this.getPropertyValue("startAngle")},set:function(u){this.setPropertyValue("startAngle",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endAngle",{get:function(){return this.getPropertyValue("endAngle")},set:function(u){this.setPropertyValue("endAngle",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pixelInnerRadius",{get:function(){return this._pixelInnerRadius},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"innerRadius",{get:function(){return this.getPropertyValue("innerRadius")},set:function(u){this.setPercentProperty("innerRadius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),R.prototype.updateXAxis=function(u){u&&u.processRenderer()},R.prototype.updateYAxis=function(u){u&&u.processRenderer()},R}(U0);pi.registeredClasses.RadarChart=gie;var Dz=function(U){function R(){var u=U.call(this)||this;u._axis=new Kn,u.className="ClockHand";var w=new Wa;u.fill=w.getFor("alternativeBackground"),u.stroke=u.fill;var $=new FI;$.radius=5,u.pin=$,u.isMeasured=!1,u.startWidth=5,u.endWidth=1,u.width=de(100),u.height=de(100),u.radius=de(100),u.innerRadius=de(0);var G=new yz;return u.hand=G,u._disposers.push(u._axis),u.applyTheme(),u}return ie(R,U),R.prototype.validate=function(){U.prototype.validate.call(this);var u=this.hand;u.width=this.pixelWidth;var w=Math.max(this.startWidth,this.endWidth);if(u.height=w,u.leftSide=de(this.startWidth/w*100),u.rightSide=de(this.endWidth/w*100),this.axis){var $=this.axis.renderer,G=Oo(this.innerRadius,$.pixelRadius),K=Oo(this.radius,$.pixelRadius);u.x=G,u.y=-w/2,u.width=K-G}},Object.defineProperty(R.prototype,"pin",{get:function(){return this._pin},set:function(u){this._pin&&this.removeDispose(this._pin),u&&(this._pin=u,u.parent=this,this._disposers.push(u))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"hand",{get:function(){return this._hand},set:function(u){this._hand&&this.removeDispose(this._hand),u&&(this._hand=u,u.parent=this,this._disposers.push(u))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"innerRadius",{get:function(){return this.getPropertyValue("innerRadius")},set:function(u){this.setPercentProperty("innerRadius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startWidth",{get:function(){return this.getPropertyValue("startWidth")},set:function(u){this.setPropertyValue("startWidth",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endWidth",{get:function(){return this.getPropertyValue("endWidth")},set:function(u){this.setPropertyValue("endWidth",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"rotationDirection",{get:function(){return this.getPropertyValue("rotationDirection")},set:function(u){this.setPropertyValue("rotationDirection",u)},enumerable:!0,configurable:!0}),R.prototype.showValue=function(u,w,$){if(this._value=u,u!=null&&(ae(w)||(w=0),this.axis)){var G=this.axis.renderer.positionToAngle(this.axis.anyToPosition(u)),K=this.rotation;this.rotationDirection=="clockWise"&&GK&&(this.rotation=K+360),this.animate({property:"rotation",to:G},w,$)}},Object.defineProperty(R.prototype,"currentPosition",{get:function(){if(this.axis)return this.axis.renderer.angleToPosition(this.rotation)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"value",{get:function(){return this._value},set:function(u){this.showValue(u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"axis",{get:function(){return this._axis.get()},set:function(u){if(this.axis!=u&&this._axis.set(u,new jn([u.events.on("datavalidated",this.updateValue,this,!1),u.events.on("datarangechanged",this.updateValue,this,!1),u.events.on("dataitemsvalidated",this.updateValue,this,!1),u.events.on("propertychanged",this.invalidate,this,!1)])),u){var w=u.chart;w&&(this.rotation=w.startAngle)}this.parent=u.renderer,this.zIndex=5},enumerable:!0,configurable:!0}),R.prototype.updateValue=function(){this.value=this.value},R.prototype.processConfig=function(u){u&&Te(u.axis)&&ct(u.axis)&&this.map.hasKey(u.axis)&&(u.axis=this.map.getKey(u.axis)),U.prototype.processConfig.call(this,u)},R}(cs);pi.registeredClasses.ClockHand=Dz;var yie=function(U){function R(){var u=U.call(this)||this;return u.className="GaugeChartDataItem",u.applyTheme(),u}return ie(R,U),R}(hve),dve=function(U){function R(){var u=U.call(this)||this;return u.className="GaugeChart",u.startAngle=180,u.endAngle=360,u.hands=new lo(new Dz),u.hands.events.on("inserted",u.processHand,u,!1),u._disposers.push(new ua(u.hands)),u._disposers.push(u.hands.template),u.applyTheme(),u}return ie(R,U),R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),Te(this.readerTitle)||(this.readerTitle=this.language.translate("Gauge chart"))},R.prototype.processHand=function(u){var w=u.newValue;w.axis||(w.axis=this.xAxes.getIndex(0))},R.prototype.configOrder=function(u,w){return u==w?0:u=="hands"?1:w=="hands"?-1:U.prototype.configOrder.call(this,u,w)},R}(gie);pi.registeredClasses.GaugeChart=dve;var Bx=function(U){function R(){var u=U.call(this)||this;return u.className="PercentSeriesDataItem",u.applyTheme(),u}return ie(R,U),R.prototype.uidAttr=function(){return this.slice.uidAttr()},R.prototype.hide=function(u,w,$,G){return G||(G=["value"]),U.prototype.hide.call(this,u,w,0,G)},R.prototype.setVisibility=function(u,w){w||(u?this.setWorkingValue("value",this.values.value.value,0,0):this.setWorkingValue("value",0,0,0)),U.prototype.setVisibility.call(this,u,w)},R.prototype.show=function(u,w,$){return $||($=["value"]),U.prototype.show.call(this,u,w,$)},Object.defineProperty(R.prototype,"category",{get:function(){return this.properties.category},set:function(u){this.setProperty("category",u)},enumerable:!0,configurable:!0}),R.prototype.createLegendMarker=function(u){this.component.createLegendMarker(u,this)},Object.defineProperty(R.prototype,"legendDataItem",{get:function(){return this._legendDataItem},set:function(u){this._legendDataItem=u,u.label&&(u.label.dataItem=this),u.valueLabel&&(u.valueLabel.dataItem=this)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tick",{get:function(){var u=this;if(!this._tick){var w=this.component.ticks.create();this._tick=w,this.addSprite(w),this._disposers.push(w),w.parent=this.component.ticksContainer,this._disposers.push(new Kr(function(){u.component&&u.component.ticks.removeValue(w)})),w.visible=this.visible}return this._tick},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"label",{get:function(){var u=this;if(!this._label){var w=this.component.labels.create();this.addSprite(w),this._label=w,this._disposers.push(w),w.parent=this.component.labelsContainer,this._disposers.push(new Kr(function(){u.component&&u.component.labels.removeValue(w)})),w.visible=this.visible}return this._label},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"slice",{get:function(){var u=this;if(!this._slice){var w=this.component,$=w.slices.create();this.addSprite($),this._slice=$,this._disposers.push($),$.parent=w.slicesContainer,this._disposers.push(new Kr(function(){w.slices.removeValue($)})),$.visible=this.visible,w.itemsFocusable()?(Te(this.component.role)||(this.component.role="menu"),Te($.role)||($.role="menuitem"),$.focusable=!0):(Te(this.component.role)||(this.component.role="list"),Te($.role)||($.role="listitem"),$.focusable=!1),$.focusable&&($.events.on("focus",function(G){$.readerTitle=w.populateString(w.itemReaderText,u)},void 0,!1),$.events.on("blur",function(G){$.readerTitle=""},void 0,!1)),$.hoverable&&($.events.on("over",function(G){$.readerTitle=w.populateString(w.itemReaderText,u)},void 0,!1),$.events.on("out",function(G){$.readerTitle=""},void 0,!1))}return this._slice},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"hiddenInLegend",{get:function(){return this.properties.hiddenInLegend},set:function(u){this.setProperty("hiddenInLegend",u)},enumerable:!0,configurable:!0}),R}(r8),p8=function(U){function R(){var u=U.call(this)||this;u.className="PercentSeries",u._addAllDataItems=!1,u.colors=new ig,u.colors.step=1,u.isMeasured=!0,u.calculatePercent=!0;var w=u.createChild(cs);w.shouldClone=!1,w.isMeasured=!1,u.slicesContainer=w;var $=u.createChild(cs);$.shouldClone=!1,$.isMeasured=!1,$.layout="none",u.ticksContainer=$;var G=u.createChild(cs);return G.shouldClone=!1,G.isMeasured=!1,G.layout="none",u.labelsContainer=G,u.alignLabels=!1,u.bulletsContainer.toFront(),u.skipFocusThreshold=50,u.defaultState.transitionEasing=w4,u.itemReaderText="{category}: {value.percent.formatNumber('#.#p')}",u.applyTheme(),u}return ie(R,U),R.prototype.createSlice=function(){return new yo},R.prototype.createTick=function(){return new U4},R.prototype.createLabel=function(){return new tg},Object.defineProperty(R.prototype,"slices",{get:function(){if(!this._slices){var u=this.createSlice();u.applyOnClones=!0,this._disposers.push(u),this.initSlice(u),this._slices=new lo(u),this._disposers.push(new ua(this._slices))}return this._slices},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"ticks",{get:function(){if(!this._ticks){var u=this.createTick();u.applyOnClones=!0,this._disposers.push(u),this.initTick(u),this._ticks=new lo(u),this._disposers.push(new ua(this._ticks))}return this._ticks},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"labels",{get:function(){if(!this._labels){var u=this.createLabel();u.applyOnClones=!0,this._disposers.push(u),this.initLabel(u),this._labels=new lo(u),this._disposers.push(new ua(this._labels))}return this._labels},enumerable:!0,configurable:!0}),R.prototype.createDataItem=function(){return new Bx},R.prototype.initSlice=function(u){},R.prototype.initLabel=function(u){u.text="{category}: {value.percent.formatNumber('#.0p')}",u.isMeasured=!1,u.padding(5,5,5,5)},R.prototype.initTick=function(u){},R.prototype.validateDataItems=function(){this.colors.reset(),this.patterns&&this.patterns.reset(),U.prototype.validateDataItems.call(this)},R.prototype.validateDataElement=function(u){var w=u.slice;w&&(w.fill==null?this.patterns?(Te(w.stroke)||(w.stroke=this.colors.next()),w.fill=this.patterns.next(),Te(w.fillOpacity)&&(w.fill.backgroundOpacity=w.fillOpacity),w.stroke instanceof Ee&&(w.fill.stroke=w.stroke,w.fill.fill=w.stroke)):w.fill=this.colors.next():this.colors.currentStep+=this.colors.step,w.stroke==null&&(w.stroke=w.fill)),U.prototype.validateDataElement.call(this,u),w&&u.bullets.each(function($,G){G.fill==null&&(G.fill=w.fill),G.stroke==null&&(G.stroke=w.stroke)}),this.updateLegendValue(u)},R.prototype.validateData=function(){U.prototype.validateData.call(this),this.chart&&this.chart.feedLegend()},R.prototype.arrangeLabels=function(u){for(var w=0,$=u.length;w<$;w++){var G=u[w].label;if(G){G.invalid&&G.validate();var K=G.measuredHeight;G.visible||(K=0),G.pixelY-K/2<-this.maxHeight/2&&(G.y=-this.maxHeight/2+K/2);var re=this.getNextLabel(w+1,u),ue=G.pixelY+K;re&&re.y=0;$--){var G=u[$].label;if(G){G.invalid&&G.validate();var K=G.measuredHeight;G.visible||(K=0),$==u.length-1&&(w+=K/2),G.pixelY+K>w&&(G.y=w-K,w=G.y)}}},R.prototype.getNextLabel=function(u,w){if(w.length>=u){var $=w[u];if($)return $.label&&$.visible?$.label:this.getNextLabel(u+1,w)}},Object.defineProperty(R.prototype,"colors",{get:function(){return this.getPropertyValue("colors")},set:function(u){this.setPropertyValue("colors",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"patterns",{get:function(){return this.getPropertyValue("patterns")},set:function(u){this.setPropertyValue("patterns",u,!0)},enumerable:!0,configurable:!0}),R.prototype.createLegendMarker=function(u,w){ar(u.children.iterator(),function($){var G=w.slice;$.defaultState.properties.fill=G.fill,$.defaultState.properties.stroke=G.stroke,$.defaultState.properties.fillOpacity=G.fillOpacity,$.defaultState.properties.strokeOpacity=G.strokeOpacity,$.fill=G.fill,$.stroke=G.stroke,$.fillOpacity=G.fillOpacity,$.strokeOpacity=G.strokeOpacity,$.fill==null&&($.__disabled=!0);var K=u.dataItem;K.color=G.fill,K.colorOrig=G.fill,$.addDisposer(G.events.on("propertychanged",function(re){re.property=="fill"&&($.__disabled=!1,$.isActive||($.fill=G.fill),$.defaultState.properties.fill=G.fill,K.color=G.fill,K.colorOrig=G.fill),re.property=="stroke"&&($.isActive||($.stroke=G.stroke),$.defaultState.properties.stroke=G.stroke),re.property=="strokeOpacity"&&($.isActive||($.strokeOpacity=G.strokeOpacity),$.defaultState.properties.strokeOpacity=G.strokeOpacity)},void 0,!1))})},R.prototype.handleSliceScale=function(u){var w=this,$=u.target.dataItem;$&&$.bullets&&ar($.bullets.iterator(),function(G){var K=G[1];w.positionBullet(K)})},R.prototype.handleSliceMove=function(u){},R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.slices.template.copyFrom(u.slices.template),this.labels.template.copyFrom(u.labels.template),this.ticks.template.copyFrom(u.ticks.template),this.colors=u.colors.clone()},Object.defineProperty(R.prototype,"alignLabels",{get:function(){return this.getPropertyValue("alignLabels")},set:function(u){this.setAlignLabels(u)},enumerable:!0,configurable:!0}),R.prototype.setAlignLabels=function(u){this.setPropertyValue("alignLabels",u,!0)},Object.defineProperty(R.prototype,"ignoreZeroValues",{get:function(){return this.getPropertyValue("ignoreZeroValues")},set:function(u){this.setPropertyValue("ignoreZeroValues",u,!0)},enumerable:!0,configurable:!0}),R.prototype.updateLegendValue=function(u){if(u){var w=u.legendDataItem,$=u.legendSettings;w&&$&&$&&($.labelText&&(w.label.text=$.labelText),$.itemLabelText&&(w.label.text=$.itemLabelText),$.valueText&&(w.valueLabel.text=$.valueText),$.itemValueText&&(w.valueLabel.text=$.itemValueText))}},R}(n8);pi.registeredClasses.PercentSeries=p8,pi.registeredClasses.PercentSeriesDataItem=Bx,sp.push({relevant:Mf.maybeXS,state:function(U,R){if(U instanceof p8){var u=U.states.create(R);return U.labels.template.states.create(R).properties.disabled=!0,U.ticks.template.states.create(R).properties.disabled=!0,u}return null}});var vie=function(U){function R(){var u=U.call(this)||this;return u.className="PercentChartDataItem",u.applyTheme(),u}return ie(R,U),R}(lie),Fz=function(U){function R(){var u=U.call(this)||this;return u.className="PercentChart",u.align="none",u.valign="none",u.chartContainer.minHeight=50,u.chartContainer.minWidth=50,u.applyTheme(),u}return ie(R,U),R.prototype.validateData=function(){U.prototype.validateData.call(this),this.feedLegend()},R.prototype.feedLegend=function(){var u=this.legend;if(u){var w=[];ar(this.series.iterator(),function($){$.hiddenInLegend||ar($.dataItems.iterator(),function(G){G.hiddenInLegend||(w.push(G),G.legendSettings||(G.legendSettings=$.legendSettings))})}),u.data=w,u.dataFields.name="category"}},R.prototype.createSeries=function(){return new p8},R.prototype.setLegend=function(u){U.prototype.setLegend.call(this,u),u&&(u.labels.template.text="{category}",u.valueLabels.template.text="{value.percent.formatNumber('#.0p')}",u.itemContainers.template.events.on("over",function(w){var $=w.target.dataItem.dataContext;if($.visible&&!$.isHiding){var G=$.slice;G.dispatchImmediately("over"),G.isHover=!0,G.interactions.isRealHover=!0}}),u.itemContainers.template.events.on("out",function(w){var $=w.target.dataItem.dataContext.slice;$.dispatchImmediately("out"),$.isHover=!1}))},R}(Sz);pi.registeredClasses.PercentChart=Fz,pi.registeredClasses.PercentChartDataItem=vie;var _ie=function(U){function R(){var u=U.call(this)||this;return u._label=new Kn,u._slice=new Kn,u.className="PieTick",u.element=u.paper.add("polyline"),u._disposers.push(u._label),u._disposers.push(u._slice),u.applyTheme(),u}return ie(R,U),R.prototype.draw=function(){U.prototype.draw.call(this);var u=this.slice,w=this.label,$=u.dataItem.component;if(u&&u.radius>0&&w&&w.text){var G=u.dx+u.slice.dx+u.pixelX+u.ix*u.radius*u.scale,K=u.dy+u.slice.dy+u.pixelY+u.iy*u.radiusY*u.scale,re=void 0,ue=void 0,we=void 0,De=void 0;if($.alignLabels)re=w.pixelX-this.length,ue=w.pixelY,we=w.pixelX,De=ue,w.horizontalCenter=="right"&&(we=(re+=2*this.length)-this.length);else{var Ve=w.pixelRadius(u.radius);we=re=G+Ve*u.ix,De=ue=K+Ve*u.iy}this.element.attr({points:[G,K,re,ue,we,De]})}},Object.defineProperty(R.prototype,"slice",{get:function(){return this._slice.get()},set:function(u){this._slice.set(u,new jn([u.events.on("transformed",this.invalidate,this),u.events.on("validated",this.invalidate,this)]))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"label",{get:function(){return this._label.get()},set:function(u){this._label.set(u,u.events.on("transformed",this.invalidate,this,!1))},enumerable:!0,configurable:!0}),R}(U4);pi.registeredClasses.PieTick=_ie;var Lz=function(U){function R(){var u=U.call(this)||this;return u.className="PieSeriesDataItem",u.values.radiusValue={},u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"radiusValue",{get:function(){return this.values.radiusValue.value},set:function(u){this.setValue("radiusValue",u)},enumerable:!0,configurable:!0}),R.prototype.hide=function(u,w,$,G){return U.prototype.hide.call(this,u,w,0,["value","radiusValue"])},R.prototype.show=function(u,w,$){return U.prototype.show.call(this,u,w,["value","radiusValue"])},R}(Bx),Nz=function(U){function R(){var u=U.call(this)||this;return u.className="PieSeries",u.alignLabels=!0,u.layout="none",u.labels.template.radius=de(5),u.addDisposer(u.labels.template.events.on("enabled",u.invalidate,u,!1)),u.applyTheme(),u}return ie(R,U),R.prototype.createSlice=function(){return new LI},R.prototype.createTick=function(){return new _ie},R.prototype.createLabel=function(){return new h8},R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),Te(this.readerTitle)||(this.readerTitle=this.language.translate("Pie Slice Series"))},R.prototype.createDataItem=function(){return new Lz},R.prototype.initSlice=function(u){u.isMeasured=!1,u.defaultState.properties.scale=1,u.observe("scale",this.handleSliceScale,this),u.observe(["dx","dy","x","y","shiftRadius"],this.handleSliceMove,this),u.tooltipText="{category}: {value.percent.formatNumber('#.#p')} ({value.value})",u.states.create("hover").properties.scale=1.05,u.defaultState.properties.shiftRadius=0,u.togglable=!0,u.events.on("toggled",function(w){w.target.hideTooltip(),w.target.interactions.lastHitPointer&&w.target.interactions.lastHitPointer.touch&&!w.target.isActive&&(w.target.isHover=!1)}),u.states.create("active").properties.shiftRadius=.1},R.prototype.validate=function(){this._leftItems=[],this._rightItems=[],this._currentStartAngle=this.startAngle,this._arcRect=Zt(this.startAngle,this.endAngle),this._maxRadiusPercent=0;for(var u=this.startIndex;uthis._maxRadiusPercent&&(this._maxRadiusPercent=w)}U.prototype.validate.call(this),this.alignLabels&&(this.startAngle>this.endAngle?this._rightItems.reverse():this._leftItems.reverse(),this._rightItems.sort(function($,G){var K=($.slice.middleAngle+360)%360,re=(G.slice.middleAngle+360)%360;return K>270&&(K-=360),re>270&&(re-=360),Kre?1:0}),this._leftItems.sort(function($,G){var K=($.slice.middleAngle+360)%360,re=(G.slice.middleAngle+360)%360;return Kre?-1:0}),this.arrangeLabels(this._rightItems),this.arrangeLabels2(this._rightItems),this.arrangeLabels(this._leftItems),this.arrangeLabels2(this._leftItems))},R.prototype.validateDataElement=function(u){if(this.pixelRadius>0){!this.ignoreZeroValues||u.value!=0&&u.value!=null?u.__disabled=!1:u.__disabled=!0;var w=u.slice;if(w.radius=this.pixelRadius,ae(u.radiusValue)&&(w.radius=this.pixelInnerRadius+(this.pixelRadius-this.pixelInnerRadius)*u.values.radiusValue.percent/this._maxRadiusPercent),w.innerRadius instanceof J||(w.innerRadius=this.pixelInnerRadius),w.startAngle=this._currentStartAngle,w.arc=Math.abs(u.values.value.percent)*(this.endAngle-this.startAngle)/100,!this.labels.template.disabled){var $=u.label,G=u.tick;G.slice=w,G.label=$;var K=(w.middleAngle+360)%360,re=void 0;if(this.alignLabels){var ue=$.pixelRadius(w.radius),we=G.length+ue;$.dx=0,$.dy=0,$.verticalCenter="middle";var De=this._arcRect;K>270||K<=90?(we+=(De.width+De.x)*this.pixelRadius,$.horizontalCenter="left",this._rightItems.push(u)):(we-=De.x*this.pixelRadius,$.horizontalCenter="right",this._leftItems.push(u),we*=-1);var Ve=w.radius+G.length+ue;re={x:we,y:w.iy*Ve},$.moveTo(re)}else{var Ke=w.depth;ae(Ke)||(Ke=0),$.fixPosition(w.middleAngle,w.radius,w.radiusY,0,-Ke)}}this._currentStartAngle+=w.arc,U.prototype.validateDataElement.call(this,u)}},Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!0,!1,10,!1)&&this.invalidateDataItems()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pixelRadius",{get:function(){return this._pixelRadius},set:function(u){this._pixelRadius!=u&&(this._pixelRadius=u,this.invalidateDataItems())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pixelInnerRadius",{get:function(){return this._pixelInnerRadius},set:function(u){this._pixelInnerRadius!=u&&(this._pixelInnerRadius=u,this.invalidateDataItems())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"innerRadius",{get:function(){return this.getPropertyValue("innerRadius")},set:function(u){this.setPercentProperty("innerRadius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startAngle",{get:function(){var u=this.getPropertyValue("startAngle");return ae(u)?u:this._startAngleInternal},set:function(u){this.setPropertyValue("startAngle",ri(u),!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endAngle",{get:function(){var u=this.getPropertyValue("endAngle");return ae(u)?u:this._endAngleInternal},set:function(u){this.setPropertyValue("endAngle",u,!0)},enumerable:!0,configurable:!0}),R.prototype.positionBullet=function(u){U.prototype.positionBullet.call(this,u);var w=u.dataItem.slice,$=u.locationX;ae($)||($=.5);var G=u.locationY;ae(G)||(G=1);var K=w.startAngle+w.arc*$;u.x=G*w.radius*A(K),u.y=G*w.radiusY*$e(K)},R.prototype.handleSliceMove=function(u){if(!this.alignLabels){var w=u.target,$=w.dataItem;if($){var G=$.label;G&&(G.dx=G.fdx+w.dx+w.pixelX,G.dy=G.fdy+w.dy+w.pixelY)}}},Object.defineProperty(R.prototype,"bbox",{get:function(){if(this.definedBBox)return this.definedBBox;var u=this.chart;return u?Zt(u.startAngle,u.endAngle,this.pixelRadius):Zt(this.startAngle,this.endAngle,this.pixelRadius)},enumerable:!0,configurable:!0}),R}(p8);pi.registeredClasses.PieSeries=Nz,pi.registeredClasses.PieSeriesDataItem=Lz;var H4=function(U){function R(){var u=U.call(this)||this;return u.className="PieChartDataItem",u.applyTheme(),u}return ie(R,U),R}(vie),bie=function(U){function R(){var u=U.call(this)||this;u.className="PieChart",u.innerRadius=0,u.radius=de(80),u.align="none",u.valign="none",u.startAngle=-90,u.endAngle=270;var w=u.seriesContainer;return w.isMeasured=!0,w.valign="middle",w.align="center",w.layout="absolute",w.width=void 0,w.height=void 0,u.chartContainer.minHeight=50,u.chartContainer.minWidth=50,u.chartContainer.events.on("maxsizechanged",u.updateRadius,u,!1),u.applyTheme(),u}return ie(R,U),R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),Te(this.readerTitle)||(this.readerTitle=this.language.translate("Pie chart"))},R.prototype.validateLayout=function(){U.prototype.validateLayout.call(this),this.updateRadius()},R.prototype.handleSeriesAdded=function(u){U.prototype.handleSeriesAdded.call(this,u),this._chartPixelRadius=void 0,this.updateSeriesAngles()},R.prototype.updateSeriesAngles=function(){var u=this;this.series.each(function(w){w._startAngleInternal=u.startAngle,w._endAngleInternal=u.endAngle})},R.prototype.updateRadius=function(){var u=this.chartContainer,w=Zt(this.startAngle,this.endAngle,1),$={x:0,y:0,width:0,height:0},G=this.innerRadius;G instanceof J&&($=Zt(this.startAngle,this.endAngle,G.value)),w=Ye([w,$]);var K=Math.min(u.innerWidth/w.width,u.innerHeight/w.height);ae(K)||(K=0);var re=Oo(this.radius,K),ue=Oo(this.innerRadius,K),we=(re-ue)/this.series.length;re==this._chartPixelRadius&&ue==this._chartPixelInnerRadius||(this._chartPixelRadius=re,this._chartPixelInnerRadius=ue,ar(Iu(this.series.iterator()),function(De){var Ve=De[0],Ke=De[1],Qe=ue+Oo(Ke.radius,re-ue),ft=ue+Oo(Ke.innerRadius,re-ue);ae(Qe)||(Qe=ue+we*(Ve+1)),ae(ft)||(ft=ue+we*Ve),Ke.pixelRadius=Qe,Ke.pixelInnerRadius=ft}),this.seriesContainer.definedBBox={x:re*w.x,y:re*w.y,width:re*w.width,height:re*w.height},this.seriesContainer.invalidateLayout(),this.bulletsContainer.x=this.seriesContainer.x,this.bulletsContainer.y=this.seriesContainer.y)},Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPercentProperty("radius",u,!0,!1,10,!1)&&this.invalidateLayout()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"innerRadius",{get:function(){return this.getPropertyValue("innerRadius")},set:function(u){this.setPercentProperty("innerRadius",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),R.prototype.createSeries=function(){return new Nz},Object.defineProperty(R.prototype,"startAngle",{get:function(){return this.getPropertyValue("startAngle")},set:function(u){this.setPropertyValue("startAngle",u)&&(this.updateRadius(),this.updateSeriesAngles())},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endAngle",{get:function(){return this.getPropertyValue("endAngle")},set:function(u){this.setPropertyValue("endAngle",u)&&(this.updateRadius(),this.updateSeriesAngles())},enumerable:!0,configurable:!0}),R}(Fz);pi.registeredClasses.PieChart=bie,pi.registeredClasses.PieChartDataItem=H4;var hC=function(U){function R(){var u=U.call(this)||this;return u.className="PieSeries3DDataItem",u.values.depthValue={},u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"depthValue",{get:function(){return this.values.depthValue.value},set:function(u){this.setValue("depthValue",u)},enumerable:!0,configurable:!0}),R}(Lz),wie=function(U){function R(){var u=U.call(this)||this;return u.className="PieSeries3D",u.applyTheme(),u}return ie(R,U),R.prototype.createDataItem=function(){return new hC},R.prototype.createSlice=function(){return new eve},R.prototype.validateDataElement=function(u){var w=u.slice,$=this.depth;ae($)||($=this.chart.depth);var G=u.values.depthValue.percent;ae(G)||(G=100),w.depth=G*$/100;var K=this.angle;ae(K)||(K=this.chart.angle),w.angle=K,U.prototype.validateDataElement.call(this,u)},R.prototype.validate=function(){U.prototype.validate.call(this);for(var u=this._workingStartIndex;u=-90&&$<90?w.toFront():$>=90&&w.toBack()}},Object.defineProperty(R.prototype,"depth",{get:function(){return this.getPropertyValue("depth")},set:function(u){this.setPropertyValue("depth",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"angle",{get:function(){return this.getPropertyValue("angle")},set:function(u){this.setPropertyValue("angle",u)},enumerable:!0,configurable:!0}),R.prototype.positionBullet=function(u){U.prototype.positionBullet.call(this,u);var w=u.dataItem.slice;u.y=u.pixelY-w.depth},R}(Nz);pi.registeredClasses.PieSeries3D=wie,pi.registeredClasses.PieSeries3DDataItem=hC;var pve=function(U){function R(){var u=U.call(this)||this;return u.className="PieChart3DDataItem",u.applyTheme(),u}return ie(R,U),R}(H4),fve=function(U){function R(){var u=U.call(this)||this;return u.className="PieChart3D",u.depth=20,u.angle=10,u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"depth",{get:function(){return this.getPropertyValue("depth")},set:function(u){this.setPropertyValue("depth",u)&&this.invalidateDataUsers()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"angle",{get:function(){return this.getPropertyValue("angle")},set:function(u){u=nt(u,0,90),this.setPropertyValue("angle",u)&&this.invalidateDataUsers()},enumerable:!0,configurable:!0}),R.prototype.createSeries=function(){return new wie},R}(bie);pi.registeredClasses.PieChart3D=fve;var W4=function(U){function R(){var u=U.call(this)||this;return u.className="SlicedChartDataItem",u.applyTheme(),u}return ie(R,U),R}(vie),xie=function(U){function R(){var u=U.call(this)||this;return u.className="SlicedChart",u.seriesContainer.layout="horizontal",u.padding(15,15,15,15),u.applyTheme(),u}return ie(R,U),R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),Te(this.readerTitle)||(this.readerTitle=this.language.translate("Sliced chart"))},R.prototype.validate=function(){U.prototype.validate.call(this)},R}(Fz);pi.registeredClasses.SlicedChart=xie,pi.registeredClasses.SlicedChartDataItem=W4;var f8=function(U){function R(){var u=U.call(this)||this;return u.legendSettings=new aie,u.className="FlowDiagramNode",u.isMeasured=!1,new Wa,u.draggable=!0,u.inert=!0,u.setStateOnChildren=!0,u.events.on("positionchanged",u.invalidateLinks,u,!1),u.events.on("sizechanged",u.invalidateLinks,u,!1),u}return ie(R,U),R.prototype.handleHit=function(u){this.isHidden||this.isHiding?this.show():this.hide()},R.prototype.show=function(u){var w=U.prototype.show.call(this,u);return this.outgoingDataItems.each(function($){(!$.toNode||$.toNode&&!$.toNode.isHidden)&&($.setWorkingValue("value",$.getValue("value"),u),$.link.show())}),this.incomingDataItems.each(function($){(!$.fromNode||$.fromNode&&!$.fromNode.isHidden)&&($.setWorkingValue("value",$.getValue("value"),u),$.link.show())}),w},R.prototype.hide=function(u){var w=U.prototype.hide.call(this,u);return this.outgoingDataItems.each(function($){$.setWorkingValue("value",0,u),$.link.hide()}),this.incomingDataItems.each(function($){$.setWorkingValue("value",0,u),$.link.hide()}),w},R.prototype.validate=function(){this.isDisposed()||(U.prototype.validate.call(this),this.invalidateLinks())},R.prototype.invalidateLinks=function(){var u=this;this.outgoingDataItems.each(function(w){var $=w.link;if($.colorMode=="fromNode"&&($.fill=$.dataItem.fromNode.color),$.colorMode=="gradient"){$.fill=$.gradient,$.stroke=$.gradient;var G=$.gradient.stops.getIndex(0);G&&(G.color=u.color,$.gradient.validate())}}),this.incomingDataItems.each(function(w){var $=w.link;if($.colorMode=="toNode"&&($.fill=$.dataItem.toNode.color),$.colorMode=="gradient"){$.fill=$.gradient,$.stroke=$.gradient;var G=$.gradient.stops.getIndex(1);G&&(G.color=u.color,$.gradient.validate())}})},Object.defineProperty(R.prototype,"incomingDataItems",{get:function(){var u=this;if(!this._incomingDataItems){var w=new to;w.events.on("inserted",function(){u.chart.sortBy=="name"?u._incomingSorted=Es(u._incomingDataItems.iterator(),function($,G){return Mh($.fromName,G.fromName)}):u.chart.sortBy=="value"?u._incomingSorted=Es(u._incomingDataItems.iterator(),function($,G){return Au(ah($.value,G.value))}):u._incomingSorted=u._incomingDataItems.iterator()},void 0,!1),this._incomingDataItems=w}return this._incomingDataItems},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"outgoingDataItems",{get:function(){var u=this;if(!this._outgoingDataItems){var w=new to;w.events.on("inserted",function(){u.chart.sortBy=="name"?u._outgoingSorted=Es(u._outgoingDataItems.iterator(),function($,G){return Mh($.fromName,G.fromName)}):u.chart.sortBy=="value"?u._outgoingSorted=Es(u._outgoingDataItems.iterator(),function($,G){return Au(ah($.value,G.value))}):u._outgoingSorted=u._outgoingDataItems.iterator()},void 0,!1),this._outgoingDataItems=w}return this._outgoingDataItems},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"name",{get:function(){return this.getPropertyValue("name")},set:function(u){this.setPropertyValue("name",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"total",{get:function(){return this.getPropertyValue("total")},set:function(u){this.setPropertyValue("total",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"totalIncoming",{get:function(){return this.getPropertyValue("totalIncoming")},set:function(u){this.setPropertyValue("totalIncoming",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"totalOutgoing",{get:function(){return this.getPropertyValue("totalOutgoing")},set:function(u){this.setPropertyValue("totalOutgoing",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"color",{get:function(){return this.getPropertyValue("color")},set:function(u){this.setColorProperty("color",u),this._background&&(this._background.fill=u),this.fill=u},enumerable:!0,configurable:!0}),R.prototype.createLegendMarker=function(u){var w=u.pixelWidth,$=u.pixelHeight;u.removeChildren();var G=u.createChild(Vb);G.shouldClone=!1,Ir(this,G,wc),G.stroke=this.fill,G.copyFrom(this),G.padding(0,0,0,0),G.width=w,G.height=$;var K=u.dataItem;K.color=G.fill,K.colorOrig=G.fill},Object.defineProperty(R.prototype,"legendDataItem",{get:function(){return this._legendDataItem},set:function(u){this._legendDataItem=u,this._legendDataItem.itemContainer.deepInvalidate()},enumerable:!0,configurable:!0}),R}(cs);pi.registeredClasses.FlowDiagramNode=f8;var q4=function(U){function R(){var u=U.call(this)||this;u.className="FlowDiagramLink";var w=new Wa;return u.maskBullets=!1,u.colorMode="fromNode",u.layout="none",u.isMeasured=!1,u.startAngle=0,u.endAngle=0,u.strokeOpacity=0,u.verticalCenter="none",u.horizontalCenter="none",u.tooltipText="{fromName}→{toName}:{value.value}",u.tooltipLocation=.5,u.link=u.createChild(yo),u.link.shouldClone=!1,u.link.setElement(u.paper.add("path")),u.link.isMeasured=!1,u.fillOpacity=.2,u.fill=w.getFor("alternativeBackground"),u.applyTheme(),u}return ie(R,U),R.prototype.positionBullets=function(){var u=this;ar(this.bullets.iterator(),function(w){w.parent=u.bulletsContainer,w.maxWidth=u.maxWidth,w.maxHeight=u.maxHeight,u.positionBullet(w)})},Object.defineProperty(R.prototype,"bulletsContainer",{get:function(){if(!this._bulletsContainer){var u=this.createChild(cs);u.shouldClone=!1,u.layout="none",this._bulletsContainer=u}return this._bulletsContainer},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"bulletsMask",{get:function(){if(!this._bulletsMask){var u=this.createChild(yo);u.shouldClone=!1,u.setElement(this.paper.add("path")),u.isMeasured=!1,this._bulletsMask=u}return this._bulletsMask},enumerable:!0,configurable:!0}),R.prototype.positionBullet=function(u){var w=u.locationX;ae(w)||(w=u.locationY),ae(w)||(w=.5);var $=this.middleLine.positionToPoint(w);u.moveTo($);var G,K=u.propertyFields.rotation;u.dataItem&&(G=u.dataItem.dataContext[K]),ae(G)||(G=$.angle),u.rotation=G},Object.defineProperty(R.prototype,"startAngle",{get:function(){return this.getPropertyValue("startAngle")},set:function(u){this.setPropertyValue("startAngle",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endAngle",{get:function(){return this.getPropertyValue("endAngle")},set:function(u){this.setPropertyValue("endAngle",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"colorMode",{get:function(){return this.getPropertyValue("colorMode")},set:function(u){if(u=="gradient"){var w=this.fill;this.gradient.stops.clear(),w instanceof Ee&&(this.gradient.addColor(w),this.gradient.addColor(w)),this.fill=this.gradient,this.stroke=this.gradient}this.setPropertyValue("colorMode",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maskBullets",{get:function(){return this.getPropertyValue("maskBullets")},set:function(u){this.setPropertyValue("maskBullets",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"tooltipLocation",{get:function(){return this.getPropertyValue("tooltipLocation")},set:function(u){this.setPropertyValue("tooltipLocation",u,!0)},enumerable:!0,configurable:!0}),R.prototype.setFill=function(u){U.prototype.setFill.call(this,u);var w=this._gradient;w&&u instanceof Ee&&(w.stops.clear(),w.addColor(u),w.addColor(u))},R.prototype.measureElement=function(){},Object.defineProperty(R.prototype,"bullets",{get:function(){var u=this;return this._bullets||(this._bullets=new lo(new zo),this._disposers.push(new ua(this._bullets)),this._disposers.push(this._bullets.template),this._bullets.events.on("inserted",function(w){w.newValue.events.on("propertychanged",function($){$.property!="locationX"&&$.property!="locationY"||u.positionBullet($.target)},void 0,!1)},void 0,!1)),this._bullets},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.bullets.copyFrom(u.bullets);var w=this.middleLine;w&&(w instanceof Bv&&u.middleLine instanceof Bv&&w.copyFrom(u.middleLine),w instanceof B4&&u.middleLine instanceof B4&&w.copyFrom(u.middleLine)),this.link.copyFrom(u.link)},R.prototype.getTooltipX=function(){if(this.middleLine)return this.middleLine.positionToPoint(this.tooltipLocation).x},R.prototype.getTooltipY=function(){if(this.middleLine)return this.middleLine.positionToPoint(this.tooltipLocation).y},Object.defineProperty(R.prototype,"gradient",{get:function(){return this._gradient||(this._gradient=new Fy),this._gradient},enumerable:!0,configurable:!0}),R}(cs);pi.registeredClasses.FlowDiagramLink=q4;var m8=function(U){function R(){var u=U.call(this)||this;return u.className="FlowDiagramDataItem",u.values.value={},u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"fromName",{get:function(){return this.properties.fromName},set:function(u){this.setProperty("fromName",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"toName",{get:function(){return this.properties.toName},set:function(u){this.setProperty("toName",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"color",{get:function(){return this.properties.color},set:function(u){this.setProperty("color",Tt(u))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"value",{get:function(){return this.values.value.value},set:function(u){this.setValue("value",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"link",{get:function(){var u=this;if(!this._link){var w=this.component.links.create();this._link=w,this.addSprite(w),this._disposers.push(new Kr(function(){u.component&&u.component.links.removeValue(w)}))}return this._link},enumerable:!0,configurable:!0}),R}(oie),kz=function(U){function R(){var u=U.call(this)||this;u.colors=new ig,u.className="FlowDiagram",u.nodePadding=20,u.sortBy="none",u.sequencedInterpolation=!0,u.colors.step=2,u.minNodeSize=.02;var w=u.chartContainer.createChild(cs);w.shouldClone=!1,w.layout="none",w.isMeasured=!1,u.linksContainer=w;var $=u.chartContainer.createChild(cs);return $.shouldClone=!1,$.layout="none",$.isMeasured=!1,u.nodesContainer=$,u.dataItem=u.createDataItem(),u.dataItem.component=u,u.applyTheme(),u}return ie(R,U),R.prototype.dispose=function(){U.prototype.dispose.call(this),this.dataItem.dispose()},R.prototype.validateData=function(){var u=this;this._parseDataFrom==0&&this.nodes.clear(),this.sortNodes(),this.colors.reset(),U.prototype.validateData.call(this);var w,$,G=0,K=0;ar(this.dataItems.iterator(),function(ue){var we=ue.fromName;we&&((De=u.nodes.getKey(we))||((De=u.nodes.create(we)).name=we,De.chart=u,De.dataItem=ue),ue.fromNode=De,ue.fromNode.outgoingDataItems.push(ue));var De,Ve=ue.toName;if(Ve&&((De=u.nodes.getKey(Ve))||((De=u.nodes.create(Ve)).name=Ve,De.chart=u,De.dataItem=ue),ue.toNode=De,ue.toNode.incomingDataItems.push(ue)),!ue.fromNode){var Ke=new j4;Ke.opacities=[0,1],ue.link.strokeModifier=Ke}if(!ue.toNode){var Qe=new j4;Qe.opacities=[1,0],ue.link.strokeModifier=Qe}var ft=ue.value;ae(ft)&&(G+=ft,K++,(w>ft||!ae(w))&&(w=ft),($this.dataItems.length||ar(u.incomingDataItems.iterator(),function($){w.checkLoop($.fromNode)})},R.prototype.calculateValueHeight=function(){var u=this;this._levelSum={},this._levelNodesCount={},this.maxSum=0;var w,$,G,K=this.dataItem.values.value.sum;ar(this._sorted,function(Ve){var Ke=Ve[1];u.getNodeValue(Ke)}),this.nodes.each(function(Ve,Ke){var Qe=Ke.level,ft=Math.max(Ke.totalIncoming,Ke.totalOutgoing);ft/KGt||!ae(G))&&(G=Gt,u.maxSum=Qe,$=Et(Ve))}),this._maxSumLevel=$;var re=this._levelNodesCount[this._maxSumLevel],ue=(w-(re-1)*this.nodePadding)/this.maxSum;if(ue==1/0&&(ue=0),ae(this.valueHeight)){var we=void 0;try{we=this._heightAnimation.animationOptions[0].to}catch{}if(we!=ue){var De=this.interpolationDuration;try{De=this.nodes.template.states.getKey("active").transitionDuration}catch{}this._heightAnimation=new _m(this,{property:"valueHeight",from:this.valueHeight,to:ue},De,this.interpolationEasing).start(),this._disposers.push(this._heightAnimation)}}else this.valueHeight=ue},R.prototype.validate=function(){var u=this;U.prototype.validate.call(this),this.calculateValueHeight();var w,$=this.nodesContainer,G={},K=this._levelNodesCount[this._maxSumLevel],re=this.dataItem.values.value.sum;w=this.orientation=="horizontal"?this.chartContainer.maxHeight-1:this.chartContainer.maxWidth-1,ar(this._sorted,function(ue){var we,De,Ve,Ke=ue[1],Qe=Ke.level,ft=0,Gt=u._levelNodesCount[Qe];switch(u.nodeAlign){case"bottom":ft=(u.maxSum-u._levelSum[Qe])*u.valueHeight-(Gt-K)*u.nodePadding;break;case"middle":ft=(u.maxSum-u._levelSum[Qe])*u.valueHeight/2-(Gt-K)*u.nodePadding/2}if(u.maxSum==0)switch(u.nodeAlign){case"bottom":ft=w-Gt*(u.minNodeSize*w+u.nodePadding);break;case"middle":ft=w/2-Gt/2*(u.minNodeSize*w+u.nodePadding)}Ke.parent=$;var ei=Math.max(Ke.totalIncoming,Ke.totalOutgoing);if(ei/re0){var $=this.nodesContainer,G=0;ar(this.links.iterator(),function(K){K.hide(0)}),ar(this._sorted,function(K){var re,ue=K[1];w.orientation=="horizontal"?(ue.dx=-($.pixelWidth-ue.pixelWidth)/Math.max(w._levelCount,1),re="dx"):(ue.dy=-($.pixelHeight-ue.pixelHeight)/Math.max(w._levelCount,1),re="dy");var we=0,De=w.interpolationDuration;w.sequencedInterpolation&&(we=w.sequencedInterpolationDelay*G+De*G/dr(w.nodes.iterator())),ue.opacity=0,ue.invalidateLinks(),ue.animate([{property:"opacity",from:0,to:1},{property:re,to:0}],w.interpolationDuration,w.interpolationEasing).delay(we),ar(ue.outgoingDataItems.iterator(),function(Ve){var Ke=Ve.link.show(w.interpolationDuration);Ke&&!Ke.isFinished()&&Ke.delay(we)}),ar(ue.incomingDataItems.iterator(),function(Ve){if(!Ve.fromNode){var Ke=Ve.link.show(w.interpolationDuration);Ke&&!Ke.isFinished()&&Ke.delay(we)}}),G++})}return U.prototype.showReal.call(this)}},R.prototype.changeSorting=function(){var u=this;this.sortNodes();var w={};ar(this._sorted,function($){var G,K,re=$[1],ue=re.level,we=(u.maxSum-u._levelSum[ue])*u.valueHeight/2;u.orientation=="horizontal"?(G="y",K=re.pixelHeight):(G="x",K=re.pixelWidth),re.animate({property:G,to:w[ue]||we},u.interpolationDuration,u.interpolationEasing),w[ue]=(w[ue]||we)+K+u.nodePadding,re.invalidateLinks()})},R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),Te(this.readerTitle)||(this.readerTitle=this.language.translate("Sankey diagram"))},R.prototype.createDataItem=function(){return new mve},Object.defineProperty(R.prototype,"nodeAlign",{get:function(){return this.getPropertyValue("nodeAlign")},set:function(u){this.setPropertyValue("nodeAlign",u),this.changeSorting()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"orientation",{get:function(){return this.getPropertyValue("orientation")},set:function(u){this.setPropertyValue("orientation",u,!0);var w=this.nodes.template.nameLabel;u=="vertical"?(this.nodes.template.width=void 0,w.label.horizontalCenter="middle",w.locationX=.5):(this.nodes.template.height=void 0,w.label.horizontalCenter="left",w.locationX=1)},enumerable:!0,configurable:!0}),R.prototype.createNode=function(){var u=new bm;return this._disposers.push(u),u},R.prototype.createLink=function(){var u=new $z;return this._disposers.push(u),u},Object.defineProperty(R.prototype,"valueHeight",{get:function(){return this._valueHeight},set:function(u){u!=this._valueHeight&&(this._valueHeight=u,this.invalidate())},enumerable:!0,configurable:!0}),R.prototype.disposeData=function(){U.prototype.disposeData.call(this),this._sorted=this.nodes.iterator()},R}(kz);pi.registeredClasses.SankeyDiagram=gve;var Bz=function(U){function R(){var u=U.call(this)||this;u.className="ChordNode";var w=u.createChild(h8);w.location=.5,w.radius=5,w.text="{name}",w.zIndex=1,w.shouldClone=!1,u.label=w,u.layout="none",u.events.on("positionchanged",u.updateRotation,u,!1),u.isMeasured=!1,u.slice=u.createChild(LI),u.slice.isMeasured=!1;var $=u.hiddenState;return $.properties.fill=new Wa().getFor("disabledBackground"),$.properties.opacity=.5,$.properties.visible=!0,u.setStateOnChildren=!1,u.slice.hiddenState.properties.visible=!0,u.adapter.add("tooltipX",function(G,K){return K.slice.ix*(K.slice.radius-(K.slice.radius-K.slice.pixelInnerRadius)/2)}),u.adapter.add("tooltipY",function(G,K){return K.slice.iy*(K.slice.radius-(K.slice.radius-K.slice.pixelInnerRadius)/2)}),u}return ie(R,U),R.prototype.invalidateLinks=function(){var u=this;U.prototype.invalidateLinks.call(this);var w=this.label,$=this.slice,G=this.chart;if(G&&$){var K=this.total,re=$.arc,ue=$.startAngle;this.children.each(function(Ve){if(Ve instanceof zo){var Ke=Ve.locationX;ae(Ke)||(Ke=.5);var Qe=Ve.locationY;ae(Qe)||(Qe=1);var ft=ue+re*Ke,Gt=Qe*$.radius;Ve.x=Gt*A(ft),Ve.y=Gt*$e(ft)}});var we=ue+re*w.location,De=ue+(1-K/this.adjustedTotal)*re*.5;Ie(De)&&(De=ue),w.fixPosition(we,$.radius),this.nextAngle=De,this._outgoingSorted&&ar(this._outgoingSorted,function(Ve){var Ke=Ve.link;Ke.parent=u.chart.linksContainer;var Qe=Ve.getWorkingValue("value");if(ae(Qe)){if(G.nonRibbon){var ft=Ke.percentWidth;ae(ft)||(ft=5),ft/=100,Ke.startAngle=ue+re/2-re/2*ft,Ke.arc=re*ft}else Ke.arc=Qe*G.valueAngle,Ke.startAngle=u.nextAngle,u.nextAngle+=Ke.arc;Ve.toNode||(Ke.endAngle=Ke.startAngle),Ke.radius=$.pixelInnerRadius}}),this._incomingSorted&&ar(this._incomingSorted,function(Ve){var Ke=Ve.link;if(Ke.radius=$.pixelInnerRadius,G.nonRibbon){var Qe=Ke.percentWidth;ae(Qe)||(Qe=5),Qe/=100,Ke.endAngle=ue+re/2-re/2*Qe,Ke.arc=re*Qe}else{Ke.endAngle=u.nextAngle;var ft=Ve.getWorkingValue("value");ae(ft)&&(Ke.arc=ft*G.valueAngle,u.nextAngle+=Ke.arc)}Ve.fromNode||(Ke.startAngle=Ke.endAngle)})}},R.prototype.updateRotation=function(){var u=this.slice,w=this.trueStartAngle+u.arc/2,$=u.radius,G=$*A(w),K=$*$e(w),re=le({x:G+this.pixelX,y:K+this.pixelY});u.startAngle=this.trueStartAngle+(re-w),this.dx=-this.pixelX,this.dy=-this.pixelY},R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.label.copyFrom(u.label),this.slice.copyFrom(u.slice)},R}(f8);pi.registeredClasses.ChordNode=Bz;var h9e=function(U){function R(){var u=U.call(this)||this;return u.className="QuadraticCurve",u.element=u.paper.add("path"),u.pixelPerfect=!1,u.fill=He(),u.applyTheme(),u}return ie(R,U),R.prototype.draw=function(){if(ae(this.x1+this.x2+this.y1+this.y2+this.cpx+this.cpy)){var u={x:this.x1,y:this.y1},w={x:this.x2,y:this.y2},$={x:this.cpx,y:this.cpy},G=wn(u)+sC(w,$);this.path=G}},Object.defineProperty(R.prototype,"cpx",{get:function(){return this.getPropertyValue("cpx")},set:function(u){this.setPropertyValue("cpx",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"cpy",{get:function(){return this.getPropertyValue("cpy")},set:function(u){this.setPropertyValue("cpy",u,!0)},enumerable:!0,configurable:!0}),R.prototype.positionToPoint=function(u){var w={x:this.x1,y:this.y1},$={x:this.cpx,y:this.cpy},G={x:this.x2,y:this.y2},K=it(w,G,$,u),re=it(w,G,$,u+.001);return{x:K.x,y:K.y,angle:le(K,re)}},R}(Bv),Vz=function(U){function R(){var u=U.call(this)||this;return u.className="ChordLink",u.middleLine=u.createChild(h9e),u.middleLine.shouldClone=!1,u.middleLine.strokeOpacity=0,u.applyTheme(),u}return ie(R,U),R.prototype.validate=function(){if(U.prototype.validate.call(this),!this.isTemplate){var u=this.startAngle,w=this.endAngle,$=this.arc,G=this.radius,K=this.dataItem.fromNode,re=this.dataItem.toNode,ue=0,we=0;K&&(ue=K.pixelX+K.dx,we=K.pixelY+K.dy);var De=0,Ve=0;if(re&&(De=re.pixelX+re.dx,Ve=re.pixelY+re.dy),G>0){var Ke=G*A(u)+ue,Qe=G*$e(u)+we,ft=G*A(w)+De,Gt=G*$e(w)+Ve,ei={x:0,y:0},di=wn({x:Ke,y:Qe});di+=Bd(u,$,G),di+=sC({x:ft,y:Gt},ei),di+=Bd(w,$,G),di+=sC({x:Ke,y:Qe},ei),this.link.path=$>0?di:"",this.maskBullets&&(this.bulletsMask.path=di,this.bulletsContainer.mask=this.bulletsMask);var ci=u+$/2,qi=w+$/2,rr=this.middleLine;rr.x1=G*A(ci)+ue,rr.y1=G*$e(ci)+we,rr.x2=G*A(qi)+De,rr.y2=G*$e(qi)+Ve,rr.cpx=0,rr.cpy=0,rr.stroke=this.fill,this.positionBullets()}}},Object.defineProperty(R.prototype,"radius",{get:function(){return this.getPropertyValue("radius")},set:function(u){this.setPropertyValue("radius",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"arc",{get:function(){return this.getPropertyValue("arc")},set:function(u){this.setPropertyValue("arc",u,!0)},enumerable:!0,configurable:!0}),R}(q4);pi.registeredClasses.ChordLink=Vz;var yve=function(U){function R(){var u=U.call(this)||this;return u.className="ChordDiagramDataItem",u.applyTheme(),u}return ie(R,U),R}(m8),vve=function(U){function R(){var u=U.call(this)||this;u.valueAngle=0,u.className="ChordDiagram",u.startAngle=-90,u.endAngle=270,u.radius=de(80),u.innerRadius=-15,u.nodePadding=5;var w=u.chartContainer.createChild(cs);return w.align="center",w.valign="middle",w.shouldClone=!1,w.layout="absolute",u.chordContainer=w,u.nodesContainer.parent=w,u.linksContainer.parent=w,u.chartContainer.events.on("maxsizechanged",u.invalidate,u,!1),u.applyTheme(),u}return ie(R,U),R.prototype.validate=function(){var u=this,w=this.chartContainer,$=this.endAngle,G=this.startAngle+this.nodePadding/2,K=Zt(this.startAngle,this.endAngle,1);K=Ye([K,{x:0,y:0,width:0,height:0}]);var re=Math.min(w.innerWidth/K.width,w.innerHeight/K.height);ae(re)||(re=0);var ue=Oo(this.radius,re),we=Oo(this.innerRadius,ue,!0),De=this.dataItem.values.value.sum,Ve=0,Ke=0;ar(this._sorted,function(Qe){var ft=Qe[1];u.getNodeValue(ft),Ve++;var Gt=ft.total;ft.total/Dethis.endIndex;Qe--)ft=this.dataItems.getIndex(Qe),this.disableUnusedColumns(ft);this._propertiesChanged=!1},R.prototype.sortCategoryAxis=function(u,w){var $=this;this.dataItems.values.sort(function(K,re){return re.values[w].workingValue-K.values[w].workingValue});var G=0;this.dataItems.each(function(K){K._index=G,G++}),u.dataItems.each(function(K){var re=K.component,ue=re.categoryToPosition(K.category)-K.deltaPosition,we=re.getSeriesDataItemByCategory(K.category,$);if(we){var De=$.dataItems.indexOf(we);K._index=De;var Ve=ze((De+.5)/$.dataItems.length-ue,3);K.deltaAnimation&&!K.deltaAnimation.isDisposed()&&K.deltaAnimation.animationOptions[0].to==Ve||Ve!=ze(K.deltaPosition,3)&&(K.deltaAnimation&&K.deltaAnimation.stop(),K.deltaAnimation=K.animate({property:"deltaPosition",from:-Ve,to:0},re.interpolationDuration,re.interpolationEasing),$._disposers.push(K.deltaAnimation))}}),u.dataItems.values.sort(function(K,re){return K.index-re.index})},R.prototype.validateDataElement=function(u){this.chart&&this.xAxis&&this.yAxis&&(this.validateDataElementReal(u),U.prototype.validateDataElement.call(this,u))},R.prototype.getStartLocation=function(u){var w=this._startLocation;return this.baseAxis==this.xAxis?w+=u.locations[this.xOpenField]-.5:w+=u.locations[this.yOpenField]-.5,w},R.prototype.getEndLocation=function(u){var w=this._endLocation;return this.baseAxis==this.xAxis?w+=u.locations[this.xField]-.5:w+=u.locations[this.yField]-.5,w},R.prototype.validateDataElementReal=function(u){var w,$,G,K,re=this,ue=this.getStartLocation(u),we=this.getEndLocation(u),De=this.xField,Ve=this.xOpenField,Ke=this.yField,Qe=this.yOpenField,ft=this.columns.template,Gt=ft.percentWidth,ei=ft.percentHeight,di=ft.pixelWidth,ci=ft.pixelHeight,qi=ft.maxWidth,rr=ft.maxHeight,Ii=ft.pixelPaddingLeft,Ki=ft.pixelPaddingRight,pr=ft.pixelPaddingTop,kr=ft.pixelPaddingBottom,Er=!1,Bs=u.width;Te(Bs)&&(ae(Bs)&&(di=Bs),Bs instanceof J&&(Gt=100*Bs.value));var qn=u.height;if(Te(qn)&&(ae(qn)&&(ci=qn),qn instanceof J&&(ei=100*qn.value)),this.xAxis instanceof jh&&this.yAxis instanceof jh){if(!u.hasValue(this._xValueFields)||!u.hasValue(this._yValueFields))return;ue=0,we=1,Ie(Gt)||(ue+=Ol=ze((we-ue)*(1-Gt/100)/2,5),we-=Ol),w=this.xAxis.getX(u,Ve,ue),$=this.xAxis.getX(u,De,we),Ie(Gt)&&(w+=Ol=($-w-di)/2,$-=Ol),!Ie(qi)&&qilf&&K>lf)&&(Er=!0),G=this.fixVerticalCoordinate(G),K=this.fixVerticalCoordinate(K),Math.abs($-w)-Ii-Ki==0&&(Er=!0)}else{if(!u.hasValue(this._xValueFields))return;var Ol;Ie(ei)||(ue+=Ol=ze((we-ue)*(1-ei/100)/2,5),we-=Ol),G=this.yAxis.getY(u,Qe,ue),K=this.yAxis.getY(u,Ke,we),Ie(ei)&&(K-=Ol=(K-G-ci)/2,G+=Ol),!Ie(rr)&&rrlf&&w>lf)&&(Er=!0),$=this.fixHorizontalCoordinate($),w=this.fixHorizontalCoordinate(w),Math.abs(G-K)-pr-kr==0&&(Er=!0)}var Xs,Df=Math.abs($-w),Ff=Math.abs(K-G),Vs=Math.min(w,$),dd=Math.min(G,K);Er?this.disableUnusedColumns(u):(u.column?(Xs=u.column,this._propertiesChanged&&(Ir(this,Xs,wc),Ir(this.columns.template,Xs,wc),wi(wc,function(_u){Xs[_u]=Xs[_u]}))):(Ir(this,Xs=this.columns.create(),wc),Ir(this.columns.template,Xs,wc),u.addSprite(Xs),u.column=Xs,Xs.paper=this.paper,this.itemsFocusable()?(Te(this.role)||(this.role="menu"),Te(Xs.role)||(Xs.role="menuitem"),Xs.focusable=!0):(Te(this.role)||(this.role="list"),Te(Xs.role)||(Xs.role="listitem"),Xs.focusable=!1),Xs.focusable&&(Xs.events.on("focus",function(_u){Xs.readerTitle=re.populateString(re.itemReaderText,u)},void 0,!1),Xs.events.on("blur",function(_u){Xs.readerTitle=""},void 0,!1)),Xs.hoverable&&(Xs.events.on("over",function(_u){Xs.readerTitle=re.populateString(re.itemReaderText,u)},void 0,!1),Xs.events.on("out",function(_u){Xs.readerTitle=""},void 0,!1)),Xs.parent=this.columnsContainer,Xs.virtualParent=this),Xs.width=Df,Xs.height=Ff,Xs.x=Vs,Xs.y=dd,Xs.realX=w,Xs.realY=G,Xs.realWidth=$-w,Xs.realHeight=K-G,this.setColumnStates(Xs),Xs.invalid&&Xs.validate(),Xs.__disabled=!1,ar(this.axisRanges.iterator(),function(_u){var _h=u.rangesColumns.getKey(_u.uid);_h||(_h=re.columns.create(),Ir(_u.contents,_h,wc),u.addSprite(_h),u.rangesColumns.setKey(_u.uid,_h),_h.paper=re.paper),_h.parent=_u.contents,_h.width=Df,_h.height=Ff,_h.x=Vs,_h.y=dd,re.setColumnStates(_h),_h.invalid&&_h.validate(),_h.__disabled=!1})),u.itemWidth=Df,u.itemHeight=Ff},R.prototype.disableUnusedColumns=function(u){u&&(u.column&&(u.column.width=0,u.column.height=0,u.column.__disabled=!0),ar(this.axisRanges.iterator(),function(w){var $=u.rangesColumns.getKey(w.uid);$&&($.width=0,$.height=0,$.__disabled=!0)}))},R.prototype.setColumnStates=function(u){if(this._dropFromOpenState||this._dropFromPreviousState||this._riseFromOpenState||this._riseFromPreviousState){var w=u.dataItem;if(this.xAxis instanceof Ro||this.yAxis instanceof Ro){var $,G=void 0,K=void 0;this.baseAxis==this.yAxis?(this.xOpenField&&this.xField&&this.xAxis instanceof Ro&&($=w.getValue(this.xOpenField),G=w.getValue(this.xField)),K=w.getValue(this.xAxis.axisFieldName+"X","previousChange")):(this.yOpenField&&this.yField&&this.yAxis instanceof Ro&&($=w.getValue(this.yOpenField),G=w.getValue(this.yField)),K=w.getValue(this.yAxis.axisFieldName+"Y","previousChange")),G<$?(w.droppedFromOpen=!0,u.defaultState.copyFrom(this._dropFromOpenState),u.setState(this._dropFromOpenState,0)):(w.droppedFromOpen=!1,u.defaultState.copyFrom(this._riseFromOpenState),u.setState(this._riseFromOpenState,0)),K<0?(w.droppedFromPrevious=!0,u.defaultState.copyFrom(this._dropFromPreviousState),u.setState(this._dropFromPreviousState,0)):(w.droppedFromPrevious=!1,u.defaultState.copyFrom(this._riseFromPreviousState),u.setState(this._riseFromPreviousState,0))}}},Object.defineProperty(R.prototype,"columns",{get:function(){return this._columns||(this._columns=new lo(this.createColumnTemplate()),this._disposers.push(new ua(this._columns)),this._disposers.push(this._columns.template)),this._columns},enumerable:!0,configurable:!0}),R.prototype.createColumnTemplate=function(){return new BI},Object.defineProperty(R.prototype,"clustered",{get:function(){return this.getPropertyValue("clustered")},set:function(u){this.setPropertyValue("clustered",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dropFromOpenState",{get:function(){return this._dropFromOpenState||(this._dropFromOpenState=this.states.create("dropFromOpenState")),this._dropFromOpenState},set:function(u){this._dropFromOpenState=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dropFromPreviousState",{get:function(){return this._dropFromPreviousState||(this._dropFromPreviousState=this.states.create("dropFromPreviousState")),this._dropFromPreviousState},set:function(u){this._dropFromPreviousState=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"riseFromOpenState",{get:function(){return this._riseFromOpenState||(this._riseFromOpenState=this.states.create("riseFromOpenState")),this._riseFromOpenState},set:function(u){this._riseFromOpenState=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"riseFromPreviousState",{get:function(){return this._riseFromPreviousState||(this._riseFromPreviousState=this.states.create("riseFromPreviousState")),this._riseFromPreviousState},set:function(u){this._riseFromPreviousState=u},enumerable:!0,configurable:!0}),R.prototype.updateLegendValue=function(u,w){var $=this;if(U.prototype.updateLegendValue.call(this,u,w),this.legendDataItem){var G,K,re=this.legendDataItem.marker;u&&(G=u.droppedFromOpen?this._dropFromOpenState:this._riseFromOpenState,K=u.droppedFromPrevious?this._dropFromPreviousState:this._riseFromPreviousState),ar(re.children.iterator(),function(ue){u?(ue.setState(K),ue.setState(G)):(ue.setState($._riseFromPreviousState),ue.setState($._riseFromOpenState))})}},R.prototype.createLegendMarker=function(u){var w=u.pixelWidth,$=u.pixelHeight;u.removeChildren();var G=u.createChild(Vb);G.shouldClone=!1,Ir(this,G,wc),G.copyFrom(this.columns.template),G.padding(0,0,0,0),G.width=w,G.height=$;var K=u.dataItem;K.color=this.fill,K.colorOrig=this.fill},R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.columns.template.copyFrom(u.columns.template)},R.prototype.getBulletLocationX=function(u,w){if(this.baseAxis==this.xAxis){var $=u.locationX;ae($)||($=.5);var G=this.getEndLocation(u.dataItem);return G-(G-this.getStartLocation(u.dataItem))*$}return U.prototype.getBulletLocationX.call(this,u,w)},R.prototype.getBulletLocationY=function(u,w){if(this.baseAxis==this.yAxis){var $=u.locationY;ae($)||($=.5);var G=this.getEndLocation(u.dataItem);return G-(G-this.getStartLocation(u.dataItem))*$}return U.prototype.getBulletLocationY.call(this,u,w)},R.prototype.getAdjustedXLocation=function(u,w,$){return ae($)||($=u?u.locations[w]:.5),this._endLocation-(this._endLocation-this._startLocation)*(1-$)},R.prototype.getAdjustedYLocation=function(u,w,$){return ae($)||($=u?u.locations[w]:.5),this._endLocation-(this._endLocation-this._startLocation)*$},R.prototype.fixVerticalCoordinate=function(u){var w=this.columns.template.pixelPaddingBottom;return nt(u,-this.columns.template.pixelPaddingTop,this.yAxis.axisLength+w)},R.prototype.fixHorizontalCoordinate=function(u){var w=this.columns.template.pixelPaddingLeft,$=this.columns.template.pixelPaddingRight;return nt(u,-w,this.xAxis.axisLength+$)},R.prototype.disposeData=function(){U.prototype.disposeData.call(this),this.columns.clear()},R}(kI);pi.registeredClasses.ColumnSeries=Vv,pi.registeredClasses.ColumnSeriesDataItem=Gb;var Sie=function(U){function R(){var u=U.call(this)||this;return u.className="TreeMapSeriesDataItem",u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"parentName",{get:function(){var u=this.treeMapDataItem;if(u&&u.parent)return u.parent.name},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"value",{get:function(){var u=this.treeMapDataItem;if(u)return u.value},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"treeMapDataItem",{get:function(){return this._dataContext},enumerable:!0,configurable:!0}),R.prototype.hide=function(u,w,$,G){var K=this.treeMapDataItem;return K&&K.hide(u),U.prototype.hide.call(this,u,w,$,G)},R.prototype.show=function(u,w,$){var G=this.treeMapDataItem;return G&&G.show(u,w,$),U.prototype.show.call(this,u,w,$)},R}(Gb),g8=function(U){function R(){var u=U.call(this)||this;u.className="TreeMapSeries",u.applyTheme(),u.fillOpacity=1,u.strokeOpacity=1,u.minBulletDistance=0,u.columns.template.tooltipText="{parentName} {name}: {value}",u.columns.template.configField="config";var w=new Wa;return u.stroke=w.getFor("background"),u.dataFields.openValueX="x0",u.dataFields.valueX="x1",u.dataFields.openValueY="y0",u.dataFields.valueY="y1",u.sequencedInterpolation=!1,u.showOnInit=!1,u.columns.template.pixelPerfect=!1,u}return ie(R,U),R.prototype.processDataItem=function(u,w){w.seriesDataItem=u,U.prototype.processDataItem.call(this,u,w)},R.prototype.createDataItem=function(){return new Sie},R.prototype.show=function(u){if(!this.preventShow){var w=this.defaultState.transitionDuration;return ae(u)&&(w=u),this.dataItems.each(function($){$.show(u)}),U.prototype.showReal.call(this,w)}},R.prototype.hide=function(u){var w=this.defaultState.transitionDuration;ae(u)&&(w=u);var $=U.prototype.hideReal.call(this,w);return this.dataItems.each(function(G){G.hide(u)}),$},R.prototype.processValues=function(){},R.prototype.getStartLocation=function(u){return 0},R.prototype.getEndLocation=function(u){return 1},R.prototype.dataChangeUpdate=function(){},R.prototype.processConfig=function(u){u&&(Te(u.dataFields)&&ht(u.dataFields)||(u.dataFields={})),U.prototype.processConfig.call(this,u)},R.prototype.createLegendMarker=function(u){var w=u.pixelWidth,$=u.pixelHeight;u.removeChildren();var G=u.createChild(Vb);G.shouldClone=!1,Ir(this,G,wc),G.padding(0,0,0,0),G.width=w,G.height=$;var K=u.dataItem;K.color=G.fill,K.colorOrig=G.fill},R.prototype.disableUnusedColumns=function(u){U.prototype.disableUnusedColumns.call(this,u),u.column&&(u.column.__disabled=!1)},R}(Vv);pi.registeredClasses.TreeMapSeries=g8,pi.registeredClasses.TreeMapSeriesDataItem=Sie;var Cie=function(U){function R(){var u=U.call(this)||this;return u.rows=[],u.className="TreeMapDataItem",u.values.value={workingValue:0},u.values.x0={},u.values.y0={},u.values.x1={},u.values.y1={},u.hasChildren.children=!0,u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"legendDataItem",{get:function(){return this._legendDataItem},set:function(u){this._legendDataItem=u,u.label&&(u.label.dataItem=this),u.valueLabel&&(u.valueLabel.dataItem=this)},enumerable:!0,configurable:!0}),R.prototype.getDuration=function(){return 0},Object.defineProperty(R.prototype,"value",{get:function(){var u=0;return this.children&&this.children.length!=0?ar(this.children.iterator(),function(w){var $=w.value;ae($)&&(u+=$)}):u=this.values.value.workingValue,u},set:function(u){this.setValue("value",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"percent",{get:function(){return this.parent?this.value/this.parent.value*100:100},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"x0",{get:function(){return this.values.x0.value},set:function(u){this.setValue("x0",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"x1",{get:function(){return this.values.x1.value},set:function(u){this.setValue("x1",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"y0",{get:function(){return this.values.y0.value},set:function(u){this.setValue("y0",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"y1",{get:function(){return this.values.y1.value},set:function(u){this.setValue("y1",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"name",{get:function(){return this.properties.name},set:function(u){this.setProperty("name",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"children",{get:function(){return this.properties.children},set:function(u){this.setProperty("children",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"level",{get:function(){return this.parent?this.parent.level+1:0},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"color",{get:function(){var u=this.properties.color;return u==null&&this.parent&&(u=this.parent.color),u==null&&this.component&&(u=this.component.colors.getIndex(this.component.colors.step*this.index)),u},set:function(u){this.setProperty("color",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fill",{get:function(){return this.color},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"series",{get:function(){return this._series},set:function(u){u!=this._series&&(this._series&&(this.component.series.removeValue(this._series),this._series.dispose()),this._series=u,this._disposers.push(u))},enumerable:!0,configurable:!0}),R.prototype.hide=function(u,w,$,G){this.setWorkingValue("value",0),this.children&&this.children.each(function(re){re.hide(u,w,$,G)});var K=this.seriesDataItem;return K&&K.bullets.each(function(re,ue){ue.hide(),ue.preventShow=!0}),U.prototype.hide.call(this,u,w,$,G)},R.prototype.show=function(u,w,$){this.setWorkingValue("value",this.values.value.value),this.children&&this.children.each(function(K){K.show(u,w,$)});var G=this.seriesDataItem;return G&&G.bullets.each(function(K,re){re.preventShow=!1}),U.prototype.show.call(this,u,w,$)},R}(Az),Tie=function(U){function R(){var u=U.call(this)||this;u.layoutAlgorithm=u.squarify,u.zoomable=!0,u.className="TreeMap",u._usesData=!0,u.maxLevels=2,u.currentLevel=0,u.hideParentColumns=!1,u.colors=new ig,u.sorting="descending";var w=u.xAxes.push(new Ro);w.title.disabled=!0,w.strictMinMax=!0;var $=w.renderer;$.inside=!0,$.labels.template.disabled=!0,$.ticks.template.disabled=!0,$.grid.template.disabled=!0,$.axisFills.template.disabled=!0,$.minGridDistance=100,$.line.disabled=!0,$.baseGrid.disabled=!0;var G=u.yAxes.push(new Ro);G.title.disabled=!0,G.strictMinMax=!0;var K=G.renderer;K.inside=!0,K.labels.template.disabled=!0,K.ticks.template.disabled=!0,K.grid.template.disabled=!0,K.axisFills.template.disabled=!0,K.minGridDistance=100,K.line.disabled=!0,K.baseGrid.disabled=!0,K.inversed=!0,u.xAxis=w,u.yAxis=G;var re=new g8;return u.seriesTemplates=new ym(re),re.virtualParent=u,u._disposers.push(new ep(u.seriesTemplates)),u._disposers.push(re),u.zoomOutButton.events.on("hit",function(){u.zoomToChartDataItem(u._homeDataItem)},void 0,!1),u.seriesTemplates.events.on("insertKey",function(ue){ue.newValue.isTemplate=!0},void 0,!1),u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"navigationBar",{get:function(){return this._navigationBar},set:function(u){var w=this;this._navigationBar!=u&&(this._navigationBar=u,u.parent=this,u.toBack(),u.links.template.events.on("hit",function($){var G=$.target.dataItem.dataContext;G.isDisposed()||(w.zoomToChartDataItem(G),w.createTreeSeries(G))},void 0,!0),this._disposers.push(u))},enumerable:!0,configurable:!0}),R.prototype.validateData=function(){this.series.clear(),this._tempSeries=[],U.prototype.validateData.call(this),this._homeDataItem&&this._homeDataItem.dispose();var u=this.dataItems.template.clone();this._homeDataItem=u,ar(this.dataItems.iterator(),function(G){G.parent=u}),u.children=this.dataItems,u.x0=0,u.y0=0,u.name=this._homeText;var w=1e3,$=10*Math.round(w*this.pixelHeight/this.pixelWidth/10)||1e3;u.x1=w,u.y1=$,this.xAxis.min=0,this.xAxis.max=w,this.xAxis.getMinMax(),this.yAxis.min=0,this.yAxis.max=$,this.yAxis.getMinMax(),this.layoutItems(u),this.createTreeSeries(u),this.feedLegend()},R.prototype.layoutItems=function(u,w){if(u){var $=u.children;w||(w=this.sorting),w=="ascending"&&$.values.sort(function(ue,we){return ue.value-we.value}),w=="descending"&&$.values.sort(function(ue,we){return we.value-ue.value}),this._updateDataItemIndexes(0),this.layoutAlgorithm(u);for(var G=0,K=$.length;Gthis.currentLevel||u.children&&u.children.length>0)&&($.columns.template.cursorOverStyle=Al.pointer,this.zoomable&&$.columns.template.events.on("hit",function(ue){var we=ue.target.dataItem;u.level>w.currentLevel?w.zoomToChartDataItem(we.treeMapDataItem.parent):w.zoomToSeriesDataItem(we)},this,void 0))}this._tempSeries.push(u.series)},R.prototype.toggleBullets=function(u){var w=this;ar(this.series.iterator(),function($){w._tempSeries.indexOf($)==-1?($.columnsContainer.hide(),$.bulletsContainer.hide(u)):($.columnsContainer.show(),$.bulletsContainer.show(u),$.dataItems.each(function(G){G.bullets.each(function(K,re){re.show()})}),$.level1&&$.dataItems.each(function(G){G.treeMapDataItem.children&&G.bullets.each(function(K,re){re.hide()})}))})},R.prototype.zoomToSeriesDataItem=function(u){this.zoomToChartDataItem(u.treeMapDataItem)},R.prototype.zoomToChartDataItem=function(u){var w=this;u||(u=this._homeDataItem);var $=this.zoomOutButton;if($&&(u!=this._homeDataItem?$.show():$.hide()),u&&u.children){this.xAxis.zoomToValues(u.x0,u.x1),this.yAxis.zoomToValues(u.y0,u.y1),this.currentLevel=u.level,this.currentlyZoomed=u,this.createTreeSeries(u);var G=this.xAxis.rangeChangeAnimation||this.yAxis.rangeChangeAnimation;!G||G.isDisposed()||G.isFinished()?this.toggleBullets():(this._dataDisposers.push(G),G.events.once("animationended",function(){w.toggleBullets()}))}},R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),Te(this.readerTitle)||(this.readerTitle=this.language.translate("TreeMap chart"))},R.prototype.createDataItem=function(){return new Cie},Object.defineProperty(R.prototype,"maxLevels",{get:function(){return this.getPropertyValue("maxLevels")},set:function(u){this.setPropertyValue("maxLevels",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"currentLevel",{get:function(){return this.getPropertyValue("currentLevel")},set:function(u){this.setPropertyValue("currentLevel",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"hideParentColumns",{get:function(){return this.getPropertyValue("hideParentColumns")},set:function(u){this.setPropertyValue("hideParentColumns",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"sorting",{get:function(){return this.getPropertyValue("sorting")},set:function(u){this.setPropertyValue("sorting",u,!0)},enumerable:!0,configurable:!0}),R.prototype.createSeries=function(){return new g8},Object.defineProperty(R.prototype,"homeText",{get:function(){return this._homeText},set:function(u){this._homeText=u,this._homeDataItem&&(this._homeDataItem.name=this._homeText)},enumerable:!0,configurable:!0}),R.prototype.processConfig=function(u){if(u){if(Te(u.layoutAlgorithm)&&ct(u.layoutAlgorithm))switch(u.layoutAlgorithm){case"squarify":u.layoutAlgorithm=this.squarify;break;case"binaryTree":u.layoutAlgorithm=this.binaryTree;break;case"slice":u.layoutAlgorithm=this.slice;break;case"dice":u.layoutAlgorithm=this.dice;break;case"sliceDice":u.layoutAlgorithm=this.sliceDice;break;default:delete u.layoutAlgorithm}Te(u.navigationBar)&&!Te(u.navigationBar.type)&&(u.navigationBar.type="NavigationBar"),U.prototype.processConfig.call(this,u)}},R.prototype.validateLayout=function(){U.prototype.validateLayout.call(this),this.layoutItems(this.currentlyZoomed)},R.prototype.validateDataItems=function(){U.prototype.validateDataItems.call(this),this.layoutItems(this._homeDataItem),ar(this.series.iterator(),function(u){u.validateRawData()}),this.zoomToChartDataItem(this._homeDataItem)},R.prototype.binaryTree=function(u){var w,$,G=u.children,K=G.length,re=new Array(K+1);for(re[0]=$=w=0;w0&&function ue(we,De,Ve,Ke,Qe,ft,Gt){if(we>=De-1)return(Ii=G.getIndex(we)).x0=Ke,Ii.y0=Qe,Ii.x1=ft,void(Ii.y1=Gt);for(var ei=re[we],di=Ve/2+ei,ci=we+1,qi=De-1;ci>>1;re[rr]Gt-Qe){var kr=(Ke*pr+ft*Ki)/Ve;ue(we,ci,Ki,Ke,Qe,kr,Gt),ue(ci,De,pr,kr,Qe,ft,Gt)}else{var Er=(Qe*pr+Gt*Ki)/Ve;ue(we,ci,Ki,Ke,Qe,ft,Er),ue(ci,De,pr,Ke,Er,ft,Gt)}}(0,K,u.value,u.x0,u.y0,u.x1,u.y1)},R.prototype.slice=function(u){for(var w,$=u.x0,G=u.x1,K=u.y0,re=u.y1,ue=u.children,we=-1,De=ue.length,Ve=u.value&&(re-K)/u.value;++weue&&(ue=w),Ke=K*K*Ve,(we=Math.max(ue/Ke,Ke/re))>De){K-=w;break}De=we}var pr=this.dataItems.template.clone();pr.value=K,pr.dice=$1)return u;if(u.children.length==1){var w=u.children.getIndex(0);return w.children?this.getLegendLevel(w):u}return u}},R.prototype.handleLegendSeriesAdded=function(u){},Object.defineProperty(R.prototype,"homeDataItem",{get:function(){return this._homeDataItem},enumerable:!0,configurable:!0}),R.prototype.feedLegend=function(){var u=this.legend;if(u){u.dataFields.name="name";var w=this.getLegendLevel(this._homeDataItem);if(w){var $=[];w.children.each(function(G){$.push(G)}),u.data=$}}},R.prototype.disposeData=function(){U.prototype.disposeData.call(this),this._homeDataItem=void 0,this.series.clear(),this.navigationBar&&this.navigationBar.disposeData(),this.xAxis.disposeData(),this.yAxis.disposeData()},R.prototype.getExporting=function(){var u=this,w=U.prototype.getExporting.call(this);return w.adapter.add("formatDataFields",function($){return $.format!="csv"&&$.format!="xlsx"||Te(u.dataFields.children)&&delete $.dataFields[u.dataFields.children],$}),w},R}(U0);pi.registeredClasses.TreeMap=Tie;var I3=function(U){function R(){var u=U.call(this)||this;return u._chart=new Kn,u.className="AxisRendererX3D",u._disposers.push(u._chart),u.applyTheme(),u}return ie(R,U),R.prototype.updateGridElement=function(u,w,$){w+=($-w)*u.location;var G=this.positionToPoint(w);if(u.element){var K=this.chart.dx3D||0,re=this.chart.dy3D||0,ue=this.getHeight();u.path=wn({x:K,y:re})+Rr({x:K,y:ue+re})+Rr({x:0,y:ue})}this.positionItem(u,G),this.toggleVisibility(u,w,0,1)},R.prototype.updateBaseGridElement=function(){U.prototype.updateBaseGridElement.call(this);var u=this.getHeight(),w=this.chart.dx3D||0,$=this.chart.dy3D||0;this.baseGrid.path=wn({x:w,y:$})+Rr({x:0,y:0})+Rr({x:0,y:u})},Object.defineProperty(R.prototype,"chart",{get:function(){return this._chart.get()},set:function(u){u&&this._chart.set(u,u.events.on("propertychanged",this.handle3DChanged,this,!1))},enumerable:!0,configurable:!0}),R.prototype.handle3DChanged=function(u){u.property!="depth"&&u.property!="angle"||this.invalidate()},R}(Vd);pi.registeredClasses.AxisRendererX3D=I3;var Eie=function(U){function R(){var u=U.call(this)||this;return u._chart=new Kn,u.className="AxisRendererY3D",u._disposers.push(u._chart),u.applyTheme(),u}return ie(R,U),R.prototype.updateGridElement=function(u,w,$){w+=($-w)*u.location;var G=this.positionToPoint(w);if(u.element){var K=this.chart.dx3D||0,re=this.chart.dy3D||0,ue=this.getWidth();u.path=wn({x:0,y:0})+Rr({x:K,y:re})+Rr({x:ue+K,y:re})}this.positionItem(u,G),this.toggleVisibility(u,w,0,1)},R.prototype.updateBaseGridElement=function(){U.prototype.updateBaseGridElement.call(this);var u=this.chart.dx3D||0,w=this.chart.dy3D||0,$=this.getWidth();this.baseGrid.path=wn({x:0,y:0})+Rr({x:$,y:0})+Rr({x:$+u,y:w})},Object.defineProperty(R.prototype,"chart",{get:function(){return this._chart.get()},set:function(u){u&&this._chart.set(u,u.events.on("propertychanged",this.handle3DChanged,this,!1))},enumerable:!0,configurable:!0}),R.prototype.handle3DChanged=function(u){u.property!="depth"&&u.property!="angle"||this.invalidate()},R}(T1),Iie=function(U){function R(){var u=U.call(this)||this;return u.className="Column3D",u}return ie(R,U),R.prototype.createAssets=function(){this.column3D=this.createChild(jb),this.column3D.shouldClone=!1,this.column3D.strokeOpacity=0,this.column=this.column3D},R.prototype.validate=function(){U.prototype.validate.call(this),this.column3D&&(this.column3D.width=this.pixelWidth,this.column3D.height=this.pixelHeight,this.column3D.invalid&&this.column3D.validate())},R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.column3D&&this.column3D.copyFrom(u.column3D)},R.prototype.setFill=function(u){U.prototype.setFill.call(this,u),this.column.fill=u},R}(BI);pi.registeredClasses.Column3D=Iie;var Y4=function(U){function R(){var u=U.call(this)||this;return u.className="ColumnSeries3DDataItem",u.applyTheme(),u}return ie(R,U),R}(Gb),y8=function(U){function R(){var u=U.call(this)||this;return u.className="ColumnSeries3D",u.columns.template.column3D.applyOnClones=!0,u.columns.template.hiddenState.properties.visible=!0,u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"columnsContainer",{get:function(){var u=this.chart;return u&&u.columnsContainer&&u.leftAxesContainer.layout!="vertical"&&u.rightAxesContainer.layout!="vertical"&&u.bottomAxesContainer.layout!="horizontal"&&u.topAxesContainer.layout!="horizontal"?u.columnsContainer:this._columnsContainer},enumerable:!0,configurable:!0}),R.prototype.validateDataElementReal=function(u){U.prototype.validateDataElementReal.call(this,u),u.column&&(u.column.dx=this.dx,u.column.dy=this.dy,u.column.visible=this.visible)},R.prototype.validateDataElements=function(){U.prototype.validateDataElements.call(this),this.chart&&this.chart.invalidateLayout()},R.prototype.createColumnTemplate=function(){return new Iie},Object.defineProperty(R.prototype,"depth",{get:function(){return this.getPropertyValue("depth")},set:function(u){this.setPropertyValue("depth",u,!0),this.columns.template.column3D.depth=u},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"angle",{get:function(){return this.getPropertyValue("angle")},set:function(u){this.setPropertyValue("angle",u),this.columns.template.column3D.angle=u},enumerable:!0,configurable:!0}),R}(Vv);pi.registeredClasses.ColumnSeries3D=y8,pi.registeredClasses.ColumnSeries3DDataItem=Y4;var d9e=function(U){function R(){var u=U.call(this)||this;return u.className="XYChart3DDataItem",u.applyTheme(),u}return ie(R,U),R}(Az),_ve=function(U){function R(){var u=U.call(this)||this;u._axisRendererX=I3,u._axisRendererY=Eie,u.className="XYChart3D",u.depth=30,u.angle=30;var w=u.seriesContainer.createChild(cs);return w.shouldClone=!1,w.isMeasured=!1,w.layout="none",u.columnsContainer=w,u.columnsContainer.mask=u.createChild(yo),u.applyTheme(),u}return ie(R,U),R.prototype.updateSeriesMasks=function(){if(U.prototype.updateSeriesMasks.call(this),JS()){var u=this.columnsContainer,w=u.mask;u.mask=void 0,u.mask=w}},Object.defineProperty(R.prototype,"depth",{get:function(){return this.getPropertyValue("depth")},set:function(u){this.setPropertyValue("depth",u),this.fixLayout(),this.invalidateDataUsers()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"angle",{get:function(){return this.getPropertyValue("angle")},set:function(u){this.setPropertyValue("angle",u),this.fixLayout(),this.invalidateDataUsers()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dx3D",{get:function(){return A(this.angle)*this.depth},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"dy3D",{get:function(){return-$e(this.angle)*this.depth},enumerable:!0,configurable:!0}),R.prototype.validateLayout=function(){U.prototype.validateLayout.call(this),this.fixColumns()},R.prototype.fixLayout=function(){this.chartContainer.paddingTop=-this.dy3D,this.chartContainer.paddingRight=this.dx3D,this.scrollbarX&&(this.scrollbarX.dy=this.dy3D,this.scrollbarX.dx=this.dx3D),this.scrollbarY&&(this.scrollbarY.dy=this.dy3D,this.scrollbarY.dx=this.dx3D),this.fixColumns(),U.prototype.fixLayout.call(this)},R.prototype.fixColumns=function(){var u=this,w=1,$=0;ar(this.series.iterator(),function(K){K instanceof y8&&(!K.clustered&&$>0&&w++,K.depthIndex=w-1,$++)});var G=0;ar(this.series.iterator(),function(K){if(K instanceof y8){K.depth=u.depth/w,K.angle=u.angle,K.columnsContainer==u.columnsContainer&&(K.dx=u.depth/w*A(u.angle)*K.depthIndex,K.dy=-u.depth/w*$e(u.angle)*K.depthIndex);var re=!1;(K.baseAxis==K.xAxis&&K.xAxis.renderer.inversed||K.baseAxis==K.yAxis&&K.yAxis.renderer.inversed)&&(re=!0);var ue=1;K.dataItems.each(function(we){var De=we.column;De&&(De.zIndex=re?1e3*(1e3-ue)+G-100*K.depthIndex:1e3*ue+G-100*K.depthIndex),ue++}),re?G--:G++}}),this.maskColumns()},R.prototype.processConfig=function(u){if(u&&Te(u.series)&&wt(u.series))for(var w=0,$=u.series.length;w<$;w++)u.series[w].type=u.series[w].type||"ColumnSeries3D";U.prototype.processConfig.call(this,u)},R.prototype.maskColumns=function(){var u=this.plotContainer.pixelWidth,w=this.plotContainer.pixelHeight,$=this.dx3D,G=this.dy3D,K=wn({x:0,y:0})+Rr({x:$,y:G})+Rr({x:u+$,y:G})+Rr({x:u+$,y:w+G})+Rr({x:u,y:w})+Rr({x:u,y:w})+Rr({x:0,y:w})+" Z",re=this.columnsContainer;re&&re.mask&&(re.mask.path=K)},R}(U0);pi.registeredClasses.XYChart3D=_ve;var jz=function(U){function R(){var u=U.call(this)||this;u.className="HeatLegend",u.markerContainer=u.createChild(cs),u.markerContainer.shouldClone=!1,u.markerCount=1;var w=new Vb;return w.minHeight=20,w.minWidth=20,w.interactionsEnabled=!1,w.fillOpacity=1,w.cornerRadius(0,0,0,0),u.markerContainer.minHeight=20,u.markerContainer.minWidth=20,u.orientation="horizontal",u.markers=new lo(w),u._disposers.push(new ua(u.markers)),u._disposers.push(u.markers.template),u.applyTheme(),u}return ie(R,U),R.prototype.getMinFromRules=function(u){var w,$=this.series;if($)return on($.heatRules.iterator(),function(G){return G.property!=u||(w=G.min,!1)}),w},R.prototype.getMaxFromRules=function(u){var w,$=this.series;if($)return ar($.heatRules.iterator(),function(G){return G.property!=u||(w=G.max,!1)}),w},R.prototype.validate=function(){U.prototype.validate.call(this),this.valueAxis.renderer.inversed=this.reverseOrder;var u=this.series,w=this.minColor,$=this.maxColor;if(Te(w)||(w=Tt(this.getMinFromRules("fill"))),Te($)||($=Tt(this.getMaxFromRules("fill"))),u){var G=u.fill;!Te(w)&&G instanceof Ee&&(w=G),!Te($)&&G instanceof Ee&&($=G)}Te($)||($=Tt(this.getMaxFromRules("fill")));var K=Et(this.getMinFromRules("fillOpacity"));ae(K)||(K=1);var re=Et(this.getMaxFromRules("fillOpacity"));ae(re)||(re=1);var ue=Et(this.getMinFromRules("strokeOpacity"));ae(ue)||(ue=1);var we=Et(this.getMaxFromRules("strokeOpacity"));ae(we)||(we=1);for(var De=Tt(this.getMinFromRules("stroke")),Ve=Tt(this.getMaxFromRules("stroke")),Ke=0;Ke1&&(this.orientation=="horizontal"?Ii.minGridDistance=this.measuredWidth/this.markerCount:Ii.minGridDistance=this.measuredHeight/this.markerCount),this.valueAxis.invalidate(),Ke=this.markerCount;for(var Ki=this.markers.length;Ke0&&w.length>0)if(K){var ue=wn(u[0]);if(u.length>0)for(var we=1;we0||this.fillSprite.fillOpacity>0)&&(ue=wn(u[0])+$4(u),ue+=Rr(w[0])+$4(w),ue+=Rr(u[0]),ue+=" Z",this.fillSprite.path=ue)}else ue=wn(u[0])+$4(u),this.strokeSprite.path=ue,(this.fillOpacity>0||this.fillSprite.fillOpacity>0)&&(ue+=Rr(w[0])+$4(w),ue+=Rr(u[0]),ue+=" Z",this.fillSprite.path=ue);else this.strokeSprite.path="",this.fillSprite.path=""},R}(Pz);pi.registeredClasses.StepLineSeriesSegment=wve;var Uz=function(U){function R(){var u=U.call(this)||this;return u.className="StepLineSeriesDataItem",u.applyTheme(),u}return ie(R,U),R}(c8),Pie=function(U){function R(){var u=U.call(this)||this;return u.className="StepLineSeries",u.applyTheme(),u.startLocation=0,u.endLocation=1,u}return ie(R,U),R.prototype.createDataItem=function(){return new Uz},R.prototype.addPoints=function(u,w,$,G,K){var re,ue,we,De;this.baseAxis==this.xAxis&&(re=this.startLocation,ue=this.endLocation,we=this.getAdjustedXLocation(w,this.yOpenField),De=this.getAdjustedXLocation(w,this.yField)),this.baseAxis==this.yAxis&&(we=this.startLocation,De=this.endLocation,re=this.getAdjustedXLocation(w,this.xOpenField),ue=this.getAdjustedXLocation(w,this.xField));var Ve=this.xAxis.getX(w,$,re),Ke=this.yAxis.getY(w,G,we),Qe=this.xAxis.getX(w,$,ue),ft=this.yAxis.getY(w,G,De);if(Ve=nt(Ve,-1e5,1e5),Ke=nt(Ke,-1e5,1e5),Qe=nt(Qe,-1e5,1e5),ft=nt(ft,-1e5,1e5),!this.noRisers&&u.length>1){var Gt=u[u.length-1];this.baseAxis==this.xAxis&&(K?u.push({x:Gt.x,y:ft}):u.push({x:Ve,y:Gt.y})),this.baseAxis==this.yAxis&&(K?u.push({x:Qe,y:Gt.y}):u.push({x:Gt.x,y:Ke}))}var ei={x:Ve,y:Ke},di={x:Qe,y:ft};K?u.push(di,ei):u.push(ei,di)},R.prototype.drawSegment=function(u,w,$){var G=!1;this.yAxis==this.baseAxis&&(G=!0),u.drawSegment(w,$,this.tensionX,this.tensionY,this.noRisers,G)},R.prototype.createSegment=function(){return new wve},Object.defineProperty(R.prototype,"noRisers",{get:function(){return this.getPropertyValue("noRisers")},set:function(u){this.setPropertyValue("noRisers",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"startLocation",{get:function(){return this.getPropertyValue("startLocation")},set:function(u){this.setPropertyValue("startLocation",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endLocation",{get:function(){return this.getPropertyValue("endLocation")},set:function(u){this.setPropertyValue("endLocation",u,!0)},enumerable:!0,configurable:!0}),R}(Oz);pi.registeredClasses.StepLineSeries=Pie,pi.registeredClasses.StepLineSeriesDataItem=Uz;var Oie=function(U){function R(){var u=U.call(this)||this;return u.className="RadarColumn",u}return ie(R,U),R.prototype.createAssets=function(){this.radarColumn=this.createChild(LI),this.radarColumn.shouldClone=!1,this.radarColumn.strokeOpacity=void 0,this.column=this.radarColumn},R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.radarColumn&&this.radarColumn.copyFrom(u.radarColumn)},R.prototype.getTooltipX=function(){var u=this.getPropertyValue("tooltipX");return ae(u)?u:this.radarColumn.getTooltipX()},R.prototype.getTooltipY=function(){var u=this.getPropertyValue("tooltipX");return ae(u)?u:this.radarColumn.getTooltipY()},R}(BI);pi.registeredClasses.RadarColumn=Oie;var xve=function(U){function R(){var u=U.call(this)||this;return u.className="ColumnSeriesDataItem",u.applyTheme(),u}return ie(R,U),R}(Gb),Sve=function(U){function R(){var u=U.call(this)||this;return u.className="RadarColumnSeries",u.applyTheme(),u}return ie(R,U),R.prototype.createColumnTemplate=function(){return new Oie},R.prototype.validate=function(){this.chart.invalid&&this.chart.validate(),U.prototype.validate.call(this)},R.prototype.disableUnusedColumns=function(u){u&&(u.column&&(u.column.__disabled=!0),ar(this.axisRanges.iterator(),function(w){var $=u.rangesColumns.getKey(w.uid);$&&($.__disabled=!0)}))},R.prototype.validateDataElementReal=function(u){var w,$,G,K,re=this,ue=this.chart.startAngle,we=this.chart.endAngle,De=this.yField,Ve=this.yOpenField,Ke=this.xField,Qe=this.xOpenField,ft=this.getStartLocation(u),Gt=this.getEndLocation(u),ei=(we-ue)/(this.dataItems.length*(this.end-this.start)),di=u.column;di||(di=this.columns.create(),u.column=di,Ir(this,di,wc),Ir(this.columns.template,di,wc),u.addSprite(di),di.paper=this.paper,this.setColumnStates(di));var ci=di.width,qi=100;ci instanceof J&&(qi=ci.percent);var rr=ze((Gt-ft)*(1-qi/100)/2,5);if(ft+=rr,Gt-=rr,this.xAxis instanceof jh&&this.yAxis instanceof jh)G=C({x:this.yAxis.getX(u,De,0,"valueY"),y:this.yAxis.getY(u,De,0,"valueY")}),K=C({x:this.yAxis.getX(u,Ve,1,"valueY"),y:this.yAxis.getY(u,Ve,1,"valueY")}),w=this.xAxis.getAngle(u,Qe,0,"valueX"),$=this.xAxis.getAngle(u,Ke,1,"valueX"),ue+=ft*ei,we-=(1-Gt)*ei;else if(this.baseAxis==this.xAxis)G=C({x:this.yAxis.getX(u,De,u.locations[De],"valueY"),y:this.yAxis.getY(u,De,u.locations[De],"valueY")}),K=C({x:this.yAxis.getX(u,Ve,u.locations[Ve],"valueY"),y:this.yAxis.getY(u,Ve,u.locations[Ve],"valueY")}),w=this.xAxis.getAngle(u,Qe,ft,"valueX"),$=this.xAxis.getAngle(u,Ke,Gt,"valueX"),ue+=ft*ei,we-=(1-Gt)*ei;else{if(G=C({x:this.yAxis.getX(u,De,ft,"valueY"),y:this.yAxis.getY(u,De,ft,"valueY")}),K=C({x:this.yAxis.getX(u,Ve,Gt,"valueY"),y:this.yAxis.getY(u,Ve,Gt,"valueY")}),ae(ci)){var Ii=Math.abs(G-K);if(Ii>ci){var Ki=(Ii-ci)/2;G+=Ki,K-=Ki}}w=this.xAxis.getAngle(u,Ke,u.locations[Ke],"valueX"),$=this.xAxis.getAngle(u,Qe,u.locations[Qe],"valueX")}if($0?(kr.arc=Er,kr.radius=G,kr.innerRadius=K,di.__disabled=!1,di.parent=this.columnsContainer,ar(this.axisRanges.iterator(),function(Bs){var qn=u.rangesColumns.getKey(Bs.uid);qn||(qn=re.columns.create(),gs(re.columns.template,qn,wc),Ir(Bs.contents,qn,wc),qn.dataItem&&ji(qn.dataItem.sprites,qn),u.addSprite(qn),qn.paper=re.paper,re.setColumnStates(qn),u.rangesColumns.setKey(Bs.uid,qn));var Va=qn.radarColumn;Va.startAngle=w,Va.arc=Er,Va.radius=G,Va.innerRadius=K,Va.invalid&&(Va.paper=re.paper,Va.validate()),qn.__disabled=!1,qn.parent=Bs.contents})):this.disableUnusedColumns(u)},R.prototype.getPoint=function(u,w,$,G,K,re,ue){re||(re="valueX"),ue||(ue="valueY");var we=C({x:this.yAxis.getX(u,$,K,ue),y:this.yAxis.getY(u,$,K,ue)});we==0&&(we=1e-5);var De=this.xAxis.getAngle(u,w,G,re);return{x:we*A(De),y:we*$e(De)}},R.prototype.getMaskPath=function(){var u=this.yAxis.renderer;return oC(u.startAngle,u.endAngle-u.startAngle,u.pixelRadius,u.pixelInnerRadius)},R.prototype.positionBulletReal=function(u,w,$){var G=this.xAxis,K=this.yAxis;(wG.end||$K.end)&&(u.visible=!1),u.moveTo(this.xAxis.renderer.positionToPoint(w,$))},R.prototype.setXAxis=function(u){U.prototype.setXAxis.call(this,u),this.updateRendererRefs()},R.prototype.setYAxis=function(u){U.prototype.setYAxis.call(this,u),this.updateRendererRefs()},R.prototype.updateRendererRefs=function(){var u=this.xAxis.renderer,w=this.yAxis.renderer;u.axisRendererY=w},R}(Vv);pi.registeredClasses.RadarColumnSeries=Sve,pi.registeredClasses.RadarColumnSeriesDataItem=xve;var VI=function(U){function R(){var u=U.call(this)||this;return u.slice=u.createChild(yo),u.slice.shouldClone=!1,u.slice.setElement(u.paper.add("path")),u.slice.isMeasured=!1,u.orientation="vertical",u.bottomWidth=de(100),u.topWidth=de(100),u.isMeasured=!1,u.width=10,u.height=10,u.expandDistance=0,u.className="FunnelSlice",u.applyTheme(),u}return ie(R,U),R.prototype.draw=function(){U.prototype.draw.call(this);var u=this.pixelPaddingTop,w=this.pixelPaddingBottom,$=this.pixelPaddingRight,G=this.pixelPaddingLeft,K=this.pixelWidth-$-G,re=this.pixelHeight-u-w,ue=this.expandDistance,we="";if(this.orientation=="vertical"){var De={x:(K-(ci=Is(this.topWidth,K)))/2+G,y:u},Ve={x:(K+ci)/2+G,y:u},Ke={x:(K+(qi=Is(this.bottomWidth,K)))/2+G,y:u+re},Qe={x:(K-qi)/2+G,y:u+re},ft={x:Ve.x+(Ke.x-Ve.x)/2+ue*re,y:Ve.y+.5*re},Gt={x:De.x+(Qe.x-De.x)/2-ue*re,y:De.y+.5*re},ei=Rr(Ke),di=Rr(De);ue!=0&&(ei=sC(Ke,ft),di=sC(De,Gt)),we=wn(De)+Rr(Ve)+ei+Rr(Qe)+di,this.tickPoint={x:Ve.x+(Ke.x-Ve.x)/2,y:Ve.y+(Ke.y-Ve.y)/2}}else{var ci,qi,rr={x:G,y:(re-(ci=Is(this.topWidth,re)))/2+u},Ii={x:G,y:(re+ci)/2+u},Ki={x:G+K,y:(re-(qi=Is(this.bottomWidth,re)))/2+u},pr={x:G+K,y:(re+qi)/2+u};ft={y:rr.y+(Ki.y-rr.y)/2-ue*K,x:rr.x+.5*K},Gt={y:Ii.y+(pr.y-Ii.y)/2+ue*K,x:Ii.x+.5*K},ei=Rr(Ki),di=Rr(Ii),ue!=0&&(ei=sC(Ki,ft),di=sC(Ii,Gt)),we=wn(Ii)+Rr(rr)+ei+Rr(pr)+di,this.tickPoint={y:Ii.y+(pr.y-Ii.y)/2,x:Ii.x+(pr.x-Ii.x)/2}}this.slice.path=we,this.invalidateLayout()},R.prototype.getPoint=function(u,w){var $=this.pixelPaddingTop,G=this.pixelPaddingBottom,K=this.pixelPaddingRight,re=this.pixelPaddingLeft,ue=this.pixelWidth-K-re,we=this.pixelHeight-$-G;if(this.orientation=="vertical"){var De={x:(ue-(ft=Is(this.topWidth,ue)))/2+re,y:$},Ve={x:(ue+ft)/2+re,y:$},Ke={x:(ue+(Gt=Is(this.bottomWidth,ue)))/2+re,y:$+we},Qe=De.x+((ue-Gt)/2+re-De.x)*w;return{x:Qe+(Ve.x+(Ke.x-Ve.x)*w-Qe)*u,y:Ve.y+(Ke.y-Ve.y)*w}}var ft,Gt,ei=re,di=(we-(ft=Is(this.topWidth,we)))/2+$,ci=(we+ft)/2+$,qi=re+ue,rr=di+((we-(Gt=Is(this.bottomWidth,we)))/2+$-di)*u;return{y:rr+(ci+((we+Gt)/2+$-ci)*u-rr)*w,x:ei+(qi-ei)*u}},Object.defineProperty(R.prototype,"bottomWidth",{get:function(){return this.getPropertyValue("bottomWidth")},set:function(u){this.setPercentProperty("bottomWidth",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"topWidth",{get:function(){return this.getPropertyValue("topWidth")},set:function(u){this.setPercentProperty("topWidth",u,!0,!1,10,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"orientation",{get:function(){return this.getPropertyValue("orientation")},set:function(u){this.setPropertyValue("orientation",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"expandDistance",{get:function(){return this.getPropertyValue("expandDistance")},set:function(u){this.setPropertyValue("expandDistance",u,!0)},enumerable:!0,configurable:!0}),R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.slice&&this.slice.copyFrom(u.slice)},R}(cs);pi.registeredClasses.FunnelSlice=VI;var Zl=function(U){function R(){var u=U.call(this)||this;return u._label=new Kn,u._slice=new Kn,u.className="FunnelTick",u.element=u.paper.add("path"),u._disposers.push(u._label),u._disposers.push(u._slice),u.setPropertyValue("locationX",0),u.setPropertyValue("locationY",0),u.applyTheme(),u}return ie(R,U),R.prototype.draw=function(){U.prototype.draw.call(this);var u=this.slice,w=u.getPoint(this.locationX,this.locationY);if(w){var $=this.label,G=u.dataItem.component,K=void 0,re=void 0,ue=void 0;if(G.orientation=="vertical"){var we=$.pixelX,De=$.pixelY;G.labelsOpposite||(we+=$.maxRight),K=Ip(w,u,this.parent),ue=Ip({x:we,y:De},$.parent,this.parent),re={x:$.parent.pixelX-this.length,y:ue.y},G.labelsOpposite||(re.x=$.parent.measuredWidth+this.length)}else we=$.pixelX,De=$.pixelY,G.labelsOpposite||(De+=$.maxBottom),K=Ip(w,u,this.parent),re={x:(ue=Ip({x:we,y:De},$.parent,this.parent)).x,y:$.parent.pixelY-this.length},G.labelsOpposite||(re.y=$.parent.measuredHeight+this.length);this.path=wn(K)+Rr(re)+Rr(ue)}},Object.defineProperty(R.prototype,"slice",{get:function(){return this._slice.get()},set:function(u){this._slice.set(u,new jn([u.events.on("transformed",this.invalidate,this,!1),u.events.on("validated",this.invalidate,this,!1)]))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"label",{get:function(){return this._label.get()},set:function(u){this._label.set(u,u.events.on("transformed",this.invalidate,this,!1))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"locationX",{get:function(){return this.getPropertyValue("locationX")},set:function(u){this.setPropertyValue("locationX",u,!1,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"locationY",{get:function(){return this.getPropertyValue("locationY")},set:function(u){this.setPropertyValue("locationY",u,!1,!0)},enumerable:!0,configurable:!0}),R}(U4);pi.registeredClasses.FunnelTick=Zl;var Vx=function(U){function R(){var u=U.call(this)||this;return u.className="FunnelSeriesDataItem",u.events.on("visibilitychanged",function(){u.component&&u.component.invalidateDataItems()},u,!1),u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"sliceLink",{get:function(){var u=this;if(!this._sliceLink){var w=this.component.sliceLinks.create();this._sliceLink=w,this._disposers.push(w),w.parent=this.component.slicesContainer,this._disposers.push(new Kr(function(){u.component&&u.component.sliceLinks.removeValue(w)})),this.addSprite(w),w.visible=this.visible}return this._sliceLink},enumerable:!0,configurable:!0}),R}(Bx),zz=function(U){function R(){var u=U.call(this)||this;return u._nextY=0,u.className="FunnelSeries",u.orientation="vertical",u.width=de(100),u.height=de(100),u.slicesContainer.width=de(100),u.slicesContainer.height=de(100),u._disposers.push(u.slicesContainer.events.on("maxsizechanged",u.invalidateDataItems,u,!1)),u.labelsOpposite=!0,u.labelsContainer.layout="absolute",u.bottomRatio=0,u.applyTheme(),u}return ie(R,U),R.prototype.createSlice=function(){return new VI},R.prototype.createTick=function(){return new Zl},R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),Te(this.readerTitle)||(this.readerTitle=this.language.translate("Funnel Series"))},R.prototype.createDataItem=function(){return new Vx},R.prototype.initSlice=function(u){u.isMeasured=!1,u.defaultState.properties.scale=1,u.observe("scale",this.handleSliceScale,this),u.observe(["dx","dy","x","y"],this.handleSliceMove,this),u.tooltipText="{category}: {value.percent.formatNumber('#.#p')} ({value.value})",u.states.create("hover").properties.expandDistance=.2},R.prototype.initLabel=function(u){U.prototype.initLabel.call(this,u),u.verticalCenter="middle",u.horizontalCenter="middle",u.isMeasured=!0,u.padding(5,5,5,5)},R.prototype.validate=function(){U.prototype.validate.call(this),this._nextY=0},R.prototype.validateDataElements=function(){var u=this,w=this.slicesContainer,$=this.labelsContainer,G=this.labels.template;this.alignLabels?(G.interactionsEnabled=!0,w.isMeasured=!0,$.isMeasured=!0):(G.interactionsEnabled=!1,w.isMeasured=!1,$.isMeasured=!1);var K=0,re=0;this.dataItems.each(function(ue){Te(ue.value)&&(re++,ue.value>0?K+=Math.abs(ue.getWorkingValue("value")/ue.value):u.ignoreZeroValues||!ue.visible||ue.__disabled||ue.isHiding?re--:K+=1)}),this._total=1/re*K,this._count=re,U.prototype.validateDataElements.call(this),this.arrangeLabels()},R.prototype.getNextValue=function(u){var w=u.index,$=u.getWorkingValue("value");if(w0){var w=this.labels.getIndex(u);return w.__disabled||!w.visible?this.getLastLabel(u-1):w}},R.prototype.arrangeLabels=function(){if(this.alignLabels){var u=this.labels.length;if(u>1){var w=this.getLastLabel(u-1);if(w){var $=w.pixelY,G=w.pixelX;if(u>1){for(var K=u-2;K>=0;K--)(re=this.labels.getIndex(K)).visible&&!re.__disabled&&(re.invalid&&re.validate(),this.orientation=="vertical"?re.pixelY+re.measuredHeight>$&&(re.y=Math.min(1e6,$-re.measuredHeight)):re.pixelX+re.measuredWidth>G&&(re.x=Math.min(1e6,G-re.measuredWidth)),$=re.pixelY,G=re.pixelX);for($=0,G=0,K=0;K0){var ue=re.getWorkingValue("value")/re.value,we=re.sliceLink;u.orientation=="vertical"?$-=we.pixelHeight*ue:w-=we.pixelWidth*ue}}),this._pyramidHeight=Is(this.pyramidHeight,$),this._pyramidWidth=Is(this.pyramidHeight,w),this.orientation=="vertical"){var G=($-this._pyramidHeight)/2;this.slicesContainer.y=G,this.labelsContainer.y=G,this.ticksContainer.y=G}else{var K=(w-this._pyramidWidth)/2;this.slicesContainer.x=K,this.labelsContainer.x=K,this.ticksContainer.x=K}U.prototype.validateDataElements.call(this)},R.prototype.decorateSlice=function(u){var w=this.dataItem.values.value.absoluteSum;if(w!=0){var $=u.slice,G=u.sliceLink,K=u.label,re=u.tick;this.getNextValue(u);var ue=Math.abs(u.getWorkingValue("value")),we=this._pyramidWidth,De=this._pyramidHeight,Ve=this.slicesContainer.innerWidth,Ke=this.slicesContainer.innerHeight,Qe=G.pixelWidth,ft=G.pixelHeight;if(u.value!=0&&u.value!=null||!this.ignoreZeroValues?u.__disabled=!1:u.__disabled=!0,this.orientation=="vertical"){var Gt=Is(this.topWidth,Ve);ae(this._nextWidth)||(this._nextWidth=Gt);var ei=Is(this.bottomWidth,Ve),di=this._nextWidth,ci=Math.atan2(De,Gt-ei);(pr=Math.tan(Math.PI/2-ci))==0&&(pr=1e-8);var qi=void 0,rr=void 0;if(this.valueIs=="area"){var Ii=(Gt+ei)/2*De*ue/w,Ki=Math.abs(di*di-2*Ii*pr);rr=(qi=(di-Math.sqrt(Ki))/pr)>0?(2*Ii-qi*di)/qi:di}else rr=di-(qi=De*ue/w)*pr;$.height=qi,$.width=Ve,$.bottomWidth=rr,$.topWidth=di,G.topWidth=$.bottomWidth,G.bottomWidth=$.bottomWidth,$.y=this._nextY,this.alignLabels?K.x=0:K.x=Ve/2,K.y=$.pixelY+$.pixelHeight*re.locationY+$.dy,this._nextY+=$.pixelHeight+ft*ue/Math.max(Math.abs(u.value),1e-8),G.y=this._nextY-ft,G.x=Ve/2}else{var pr;Gt=Is(this.topWidth,Ke),ae(this._nextWidth)||(this._nextWidth=Gt),ei=Is(this.bottomWidth,Ke),di=this._nextWidth,ci=Math.atan2(we,Gt-ei),(pr=Math.tan(Math.PI/2-ci))==0&&(pr=1e-8);var kr=void 0;rr=void 0,rr=this.valueIs=="area"?(2*(Ii=(Gt+ei)/2*we*ue/w)-(kr=(di-Math.sqrt(di*di-2*Ii*pr))/pr)*di)/kr:di-(kr=we*ue/w)*pr,$.width=kr,$.height=Ke,$.bottomWidth=rr,$.topWidth=di,G.topWidth=$.bottomWidth,G.bottomWidth=$.bottomWidth,$.x=this._nextY,this.alignLabels?K.y=this.labelsContainer.measuredHeight:K.y=Ke/2,K.x=$.pixelX+$.pixelWidth*re.locationX+$.dx,this._nextY+=$.pixelWidth+Qe*ue/Math.max(Math.abs(u.value),1e-8),G.x=this._nextY-Qe,G.y=Ke/2}this._nextWidth=$.bottomWidth}},Object.defineProperty(R.prototype,"topWidth",{get:function(){return this.getPropertyValue("topWidth")},set:function(u){this.setPercentProperty("topWidth",u,!1,!1,10,!1)&&this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"pyramidHeight",{get:function(){return this.getPropertyValue("pyramidHeight")},set:function(u){this.setPercentProperty("pyramidHeight",u,!1,!1,10,!1)&&this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"bottomWidth",{get:function(){return this.getPropertyValue("bottomWidth")},set:function(u){this.setPercentProperty("bottomWidth",u,!1,!1,10,!1)&&this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"valueIs",{get:function(){return this.getPropertyValue("valueIs")},set:function(u){this.setPropertyValue("valueIs",u)&&this.invalidate()},enumerable:!0,configurable:!0}),R}(zz);pi.registeredClasses.PyramidSeries=Rie,pi.registeredClasses.PyramidSeriesDataItem=Hz;var K4=function(U){function R(){var u=U.call(this)||this;return u.className="PictorialStackedSeriesDataItem",u.applyTheme(),u}return ie(R,U),R}(Hz),Cve=function(U){function R(){var u=U.call(this)||this;return u.className="PictorialStackedSeries",u.topWidth=de(100),u.bottomWidth=de(100),u.valueIs="height",u.applyTheme(),u.startLocation=0,u.endLocation=1,u.align="center",u.valign="middle",u._maskSprite=u.slicesContainer.createChild(yo),u._maskSprite.visible=!1,u._maskSprite.zIndex=100,u._maskSprite.shouldClone=!1,u}return ie(R,U),R.prototype.validateDataElements=function(){var u=this.slicesContainer.maxWidth,w=this.slicesContainer.maxHeight,$=this._maskSprite,G=$.measuredWidth/$.scale,K=$.measuredHeight/$.scale,re=H(w/K,u/G);re==1/0&&(re=1),re=ye(.001,re);var ue,we,De=this.startLocation,Ve=this.endLocation,Ke=H(u,G*re),Qe=H(w,K*re);$.scale=re,this.orientation=="vertical"?(this.topWidth=Ke+4,this.bottomWidth=Ke+4,this.pyramidHeight=Qe*(Ve-De),$.x=u/2,$.y=Qe/2):(this.topWidth=Qe+4,this.bottomWidth=Qe+4,this.pyramidHeight=Ke*(Ve-De),$.valign="middle",$.x=Ke/2,$.y=w/2),$.verticalCenter="middle",$.horizontalCenter="middle",U.prototype.validateDataElements.call(this),this.orientation=="vertical"?(this.valign=="bottom"&&(ue=w-Qe),this.valign=="middle"&&(ue=(w-Qe)/2),this.valign=="top"&&(ue=0),this.align=="left"&&(we=-(u-Ke)/2),this.align=="center"&&(we=0),this.align=="right"&&(we=(u-Ke)/2),this.slices.template.dy=De*Qe,this.alignLabels&&(this.slicesContainer.dx=we)):(this.valign=="bottom"&&(ue=(w-Qe)/2),this.valign=="middle"&&(ue=0),this.valign=="top"&&(ue=-(w-Qe)/2),this.align=="left"&&(we=0),this.align=="center"&&(we=(u-Ke)/2),this.align=="right"&&(we=u-Ke),this.slices.template.dx=De*Ke,this.alignLabels&&(this.slicesContainer.dy=ue)),this.slicesContainer.x=we,this.labelsContainer.x=we,this.ticksContainer.x=we,this.slicesContainer.y=ue,this.labelsContainer.y=ue,this.ticksContainer.y=ue,Ke>0&&Qe>0&&(this.slicesContainer.mask=$)},R.prototype.applyInternalDefaults=function(){U.prototype.applyInternalDefaults.call(this),Te(this.readerTitle)||(this.readerTitle=this.language.translate("Pyramid Series"))},R.prototype.createDataItem=function(){return new K4},Object.defineProperty(R.prototype,"maskSprite",{get:function(){return this._maskSprite},enumerable:!0,configurable:!0}),R.prototype.initSlice=function(u){U.prototype.initSlice.call(this,u);var w=u.states.getKey("hover");w&&(w.properties.expandDistance=0)},Object.defineProperty(R.prototype,"startLocation",{get:function(){return this.getPropertyValue("startLocation")},set:function(u){this.setPropertyValue("startLocation",u)&&this.invalidateDataItems()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endLocation",{get:function(){return this.getPropertyValue("endLocation")},set:function(u){this.setPropertyValue("endLocation",u)&&this.invalidateDataItems()},enumerable:!0,configurable:!0}),R}(Rie);pi.registeredClasses.PictorialStackedSeries=Cve,pi.registeredClasses.PictorialStackedSeriesDataItem=K4;var Wz=function(U){function R(){var u=U.call(this)||this;return u.className="ConeColumn",u}return ie(R,U),R.prototype.createAssets=function(){this.coneColumn=this.createChild(_z),this.coneColumn.shouldClone=!1,this.column=this.coneColumn},R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.coneColumn&&this.coneColumn.copyFrom(u.coneColumn)},R}(BI);pi.registeredClasses.ConeColumn=Wz;var qz=function(U){function R(){var u=U.call(this)||this;return u.className="ConeSeriesDataItem",u.applyTheme(),u}return ie(R,U),R}(Gb),Tve=function(U){function R(){var u=U.call(this)||this;return u.className="ConeSeries",u.applyTheme(),u}return ie(R,U),R.prototype.createColumnTemplate=function(){return new Wz},R.prototype.getMaskPath=function(){var u=0,w=0,$=this.columns.getIndex(0);if($)return this.baseAxis==this.xAxis?w=$.coneColumn.innerWidth/2+1:u=$.coneColumn.innerHeight/2+1,aC({x:-u,y:0,width:this.xAxis.axisLength+u,height:this.yAxis.axisLength+w})},R.prototype.validateDataElementReal=function(u){if(U.prototype.validateDataElementReal.call(this,u),u.column){var w=u.column.coneColumn;w.fill=u.column.fill,this.baseAxis==this.yAxis?w.orientation="horizontal":w.orientation="vertical"}},R}(Vv);pi.registeredClasses.ConeSeries=Tve,pi.registeredClasses.ConeSeriesDataItem=qz;var jI=function(U){function R(){var u=U.call(this)||this;return u.className="CurvedColumn",u}return ie(R,U),R.prototype.createAssets=function(){this.curvedColumn=this.createChild(yo),this.curvedColumn.shouldClone=!1,this.setPropertyValue("tension",.7),this.width=de(120),this.height=de(120),this.column=this.curvedColumn},R.prototype.draw=function(){U.prototype.draw.call(this);var u,w=this.realWidth,$=this.realHeight,G=this.realX-this.pixelX,K=this.realY-this.pixelY;this.width;var re=1,ue=1;this.orientation=="vertical"?(re=this.tension,u=[{x:0,y:$+K},{x:w/2,y:K},{x:w,y:$+K}]):(ue=this.tension,u=[{x:G,y:$=Math.abs($)},{x:G+w,y:$/2},{x:G,y:0}]);var we=wn(u[0])+new S1(re,ue).smooth(u);this.column.path=we},R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.curvedColumn&&this.curvedColumn.copyFrom(u.curvedColumn)},Object.defineProperty(R.prototype,"tension",{get:function(){return this.getPropertyValue("tension")},set:function(u){this.setPropertyValue("tension",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"orientation",{get:function(){return this.getPropertyValue("orientation")},set:function(u){this.setPropertyValue("orientation",u,!0)},enumerable:!0,configurable:!0}),R}(BI);pi.registeredClasses.CurvedColumn=jI;var Mie=function(U){function R(){var u=U.call(this)||this;return u.className="CurvedColumnSeriesDataItem",u.applyTheme(),u}return ie(R,U),R}(Gb),Eve=function(U){function R(){var u=U.call(this)||this;return u.className="CurvedColumnSeries",u.applyTheme(),u}return ie(R,U),R.prototype.createColumnTemplate=function(){return new jI},R.prototype.validateDataElementReal=function(u){U.prototype.validateDataElementReal.call(this,u);var w=u.column;(w=u.column)&&(u.column.curvedColumn.fill=u.column.fill,this.baseAxis==this.yAxis?w.orientation="horizontal":w.orientation="vertical")},R}(Vv);pi.registeredClasses.CurvedColumnSeries=Eve,pi.registeredClasses.CurvedColumnSeriesDataItem=Mie;var Yz=function(U){function R(){var u=U.call(this)||this;u.className="CircleBullet";var w=u.createChild(FI);return w.shouldClone=!1,w.radius=5,w.isMeasured=!1,u.circle=w,u.applyTheme(),u}return ie(R,U),R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.circle.copyFrom(u.circle)},R}(zo);pi.registeredClasses.CircleBullet=Yz;var Ive=function(U){function R(){var u=U.call(this)||this;return u.className="ErrorBullet",u.errorLine=u.createChild(yo),u.errorLine.shouldClone=!1,u.width=20,u.height=20,u.strokeOpacity=1,u.isDynamic=!0,u}return ie(R,U),R.prototype.validatePosition=function(){U.prototype.validatePosition.call(this);var u=this.pixelWidth/2,w=this.pixelHeight/2;this.errorLine.path=wn({x:-u,y:-w})+Rr({x:u,y:-w})+wn({x:0,y:-w})+Rr({x:0,y:w})+wn({x:-u,y:w})+Rr({x:u,y:w})},R.prototype.copyFrom=function(u){U.prototype.copyFrom.call(this,u),this.errorLine.copyFrom(u.errorLine)},R}(zo);pi.registeredClasses.ErrorBullet=Ive;var Ave=function(U){function R(){var u=U.call(this)||this;return u.className="NavigationBarDataItem",u.applyTheme(),u}return ie(R,U),Object.defineProperty(R.prototype,"name",{get:function(){return this.properties.name},set:function(u){this.setProperty("name",u)},enumerable:!0,configurable:!0}),R}(MI),A3=function(U){function R(){var u=U.call(this)||this;u.className="NavigationBar";var w=new Wa,$=new gz;$.valign="middle",$.paddingTop=8,$.paddingBottom=8,u.paddingBottom=2,u.links=new lo($),u._disposers.push(new ua(u.links)),u._disposers.push($),u._linksIterator=new nf(u.links,function(){return u.links.create()}),u._linksIterator.createNewItems=!0;var G=new K$;G.direction="right",G.width=8,G.height=12,G.fill=w.getFor("alternativeBackground"),G.fillOpacity=.5,G.valign="middle",G.marginLeft=10,G.marginRight=10,u.separators=new lo(G),u._disposers.push(new ua(u.separators)),u._disposers.push(G);var K=new gz;return u.activeLink=K,K.copyFrom($),K.valign="middle",K.fontWeight="bold",u.width=de(100),u.layout="grid",u.dataFields.name="name",u.applyTheme(),u}return ie(R,U),R.prototype.validateDataElements=function(){this.removeChildren(),this._linksIterator.reset(),U.prototype.validateDataElements.call(this)},R.prototype.validateDataElement=function(u){var w;if(U.prototype.validateDataElement.call(this,u),u.indexw.getHitOption(this.interactions,"hitTolerance")){switch(this._generalBehavior){case"zoom":this.dispatch("zoomended");break;case"select":this.dispatch("selectended");break;case"pan":this.dispatch("panended"),w.setGlobalStyle(Al.default)}this.downPoint=void 0,this.updateSelection()}},R.prototype.updateSelection=function(){},R.prototype.getPositions=function(){this.xPosition=this.point.x/this.innerWidth,this.yPosition=1-this.point.y/this.innerHeight},R.prototype.handleCursorDown=function(u){if(!(!this.interactionsEnabled||this.interactions.isTouchProtected&&u.touch)&&Zs().isLocalElement(u.pointer,this.paper.svg,this.uid)){QS();var w=Lb(u.pointer.point,this);this._stick=="hard"&&this._stickPoint&&(w=this._stickPoint),this._adapterO&&this._adapterO.apply("cursorPoint",w),this.fitsToBounds(w)&&(this._downPointOrig={x:w.x,y:w.y},u.event.cancelable&&this.shouldPreventGestures(u.touch)&&this.fitsToBounds(w)&&u.event.preventDefault(),this.triggerMove(w),this.triggerDown(w))}},R.prototype.shouldPreventGestures=function(u){return!0},R.prototype.updatePoint=function(u){},R.prototype.handleCursorUp=function(u){if(this.interactionsEnabled&&(this.downPoint||Zs().isLocalElement(u.pointer,this.paper.svg,this.uid))){var w=Lb(u.pointer.point,this);this._adapterO&&this._adapterO.apply("cursorPoint",w),this.downPoint&&this.fitsToBounds(this.downPoint)&&(this._stick=="hard"&&this._stickPoint&&(w=this._stickPoint),this._upPointOrig={x:w.x,y:w.y},this.triggerMove(w),this.triggerUp(w))}},Object.defineProperty(R.prototype,"chart",{get:function(){return this._chart},set:function(u){this._chart=u,Te(this._chart.plotContainer)&&Zs().lockElement(this._chart.plotContainer.interactions)},enumerable:!0,configurable:!0}),R}(cs);pi.registeredClasses.Cursor=Die;var J4=function(U){function R(){var u=U.call(this)||this;u._lineX=new Kn,u._lineY=new Kn,u._xAxis=new Kn,u._yAxis=new Kn,u._snapToDisposers=[],u.className="XYCursor",u.behavior="zoomX",u.maxPanOut=.1;var w=new Wa;u.snapOnPan=!0;var $=u.createChild(yo);$.shouldClone=!1,$.fillOpacity=.2,$.fill=w.getFor("alternativeBackground"),$.isMeasured=!1,$.visible=!1,$.interactionsEnabled=!1,u.selection=$,u._disposers.push(u.selection);var G=u.createChild(yo);G.shouldClone=!1,G.stroke=w.getFor("grid"),G.fill=He(),G.strokeDasharray="3,3",G.isMeasured=!1,G.strokeOpacity=.4,G.interactionsEnabled=!1,G.y=0,u.lineX=G,u._disposers.push(u.lineX);var K=u.createChild(yo);return K.shouldClone=!1,K.stroke=w.getFor("grid"),K.fill=He(),K.strokeDasharray="3,3",K.isMeasured=!1,K.strokeOpacity=.4,K.interactionsEnabled=!1,K.x=0,u.lineY=K,u._disposers.push(u.lineY),u.events.on("sizechanged",u.updateSize,u,!1),u._disposers.push(u._lineX),u._disposers.push(u._lineY),u._disposers.push(u._xAxis),u._disposers.push(u._yAxis),u.mask=u,u.hideSeriesTooltipsOnSelection=!0,u.applyTheme(),u}return ie(R,U),R.prototype.updateSize=function(){this.lineX&&(this.lineX.path=wn({x:0,y:0})+Rr({x:0,y:this.innerHeight})),this.lineY&&(this.lineY.path=wn({x:0,y:0})+Rr({x:this.innerWidth,y:0}))},R.prototype.updateSelection=function(){if(this._usesSelection){var u=this.downPoint,w=this.behavior;if(u){var $=this.point;this.lineX&&($.x=this.lineX.pixelX),this.lineY&&($.y=this.lineY.pixelY);var G=this.selection,K=Math.min($.x,u.x),re=Math.min($.y,u.y),ue=ze(Math.abs(u.x-$.x),this._positionPrecision),we=ze(Math.abs(u.y-$.y),this._positionPrecision);switch(w){case"zoomX":case"selectX":re=0,we=this.pixelHeight;break;case"zoomY":case"selectY":K=0,ue=this.pixelWidth}G.x=K,G.y=re,G.path=mz(ue,we),G.validatePosition()}else this._generalBehavior!="select"&&this.selection.hide()}},R.prototype.fixPoint=function(u){return u.x=Math.max(0,u.x),u.y=Math.max(0,u.y),u.x=Math.min(this.pixelWidth,u.x),u.y=Math.min(this.pixelHeight,u.y),u},R.prototype.triggerMoveReal=function(u,w){U.prototype.triggerMoveReal.call(this,u,w);var $=this.snapToSeries;if($&&!this.downPoint)if($ instanceof kI)$.isHidden&&this.updateLinePositions(u);else{var G=!0;wi($,function(K){K.isHidden||(G=!1)}),G&&this.updateLinePositions(u)}else this.updateLinePositions(u);this.downPoint&&C(this.downPoint,u)>3&&this._generalBehavior=="pan"&&(this.getPanningRanges(),this.dispatch("panning"))},R.prototype.updateLinePositions=function(u){u=this.fixPoint(this.point),this.lineX&&this.lineX.visible&&!this.xAxis&&(this.lineX.x=u.x),this.lineY&&this.lineY.visible&&!this.yAxis&&(this.lineY.y=u.y),this.updateSelection()},R.prototype.triggerDownReal=function(u){if(this.visible&&!this.isHiding)if(this._generalBehavior=="select"&&(this.selection.parent=this.parent),this.fitsToBounds(u)){this.downPoint={x:u.x,y:u.y},this.updatePoint(u),this.point.x=this.downPoint.x,this.point.y=this.downPoint.y;var w=this.selection,$=this.downPoint.x,G=this.downPoint.y;this._usesSelection&&(w.x=$,w.y=G,w.path="",w.show()),U.prototype.triggerDownReal.call(this,u)}else this.downPoint=void 0;else this.downPoint=void 0},R.prototype.updatePoint=function(u){this.lineX&&(u.x=this.lineX.pixelX),this.lineY&&(u.y=this.lineY.pixelY)},R.prototype.triggerUpReal=function(u){this.hasMoved()?this.downPoint&&(this.upPoint=u,this.updatePoint(this.upPoint),this._generalBehavior!="pan"&&this.getRanges(),this._generalBehavior!="select"&&this.selection.hide(),U.prototype.triggerUpReal.call(this,u)):(this._generalBehavior!="select"?this.selection.hide(0):(this.xRange=void 0,this.yRange=void 0,this.dispatchImmediately("selectended")),this._generalBehavior=="pan"&&Zs().setGlobalStyle(Al.default),this.dispatchImmediately("behaviorcanceled")),this.downPoint=void 0,this.dispatch("cursorpositionchanged")},R.prototype.hasMoved=function(){return(this.behavior=="zoomX"||this.behavior=="panX"?D(this._upPointOrig,this._downPointOrig):this.behavior=="zoomY"||this.behavior=="panY"?L(this._upPointOrig,this._downPointOrig):C(this._upPointOrig,this._downPointOrig))>Zs().getHitOption(this.interactions,"hitTolerance")},R.prototype.getPanningRanges=function(){var u=ze(this.downPoint.x/this.innerWidth,5),w=1-ze(this.downPoint.y/this.innerHeight,5),$=u-ze(this.point.x/this.innerWidth,5),G=w-(1-ze(this.point.y/this.innerHeight,5));this.xRange={start:$,end:1+$},this.yRange={start:G,end:1+G},this.behavior=="panX"&&(this.yRange.start=0,this.yRange.end=1),this.behavior=="panY"&&(this.xRange.start=0,this.xRange.end=1)},R.prototype.getRanges=function(){this.lineX&&(this.upPoint.x=this.lineX.pixelX),this.lineY&&(this.upPoint.y=this.lineY.pixelY),this.selection;var u=ze(this.downPoint.x/this.innerWidth,5),w=ze(this.upPoint.x/this.innerWidth,5),$=1-ze(this.downPoint.y/this.innerHeight,5),G=1-ze(this.upPoint.y/this.innerHeight,5);this.xRange={start:H(u,w),end:ye(u,w)},this.yRange={start:H($,G),end:ye($,G)}},Object.defineProperty(R.prototype,"behavior",{get:function(){return this.getPropertyValue("behavior")},set:function(u){this.setPropertyValue("behavior",u,!0),this._usesSelection=!1,u.indexOf("zoom")!=-1&&(this._generalBehavior="zoom",this._usesSelection=!0),u.indexOf("select")!=-1&&(this._generalBehavior="select",this._usesSelection=!0),u.indexOf("pan")!=-1&&(this._generalBehavior="pan",this._usesSelection=!1)},enumerable:!0,configurable:!0}),R.prototype.shouldPreventGestures=function(u){return!(this.interactions.isTouchProtected&&u||this.behavior=="none")},Object.defineProperty(R.prototype,"fullWidthLineX",{get:function(){return this.getPropertyValue("fullWidthLineX")},set:function(u){this.setPropertyValue("fullWidthLineX",u),u||this.updateSize()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"fullWidthLineY",{get:function(){return this.getPropertyValue("fullWidthLineY")},set:function(u){this.setPropertyValue("fullWidthLineY",u),u||this.updateSize()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"hideSeriesTooltipsOnSelection",{get:function(){return this.getPropertyValue("hideSeriesTooltipsOnSelection")},set:function(u){this.setPropertyValue("hideSeriesTooltipsOnSelection",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxTooltipDistance",{get:function(){return this.getPropertyValue("maxTooltipDistance")},set:function(u){this.setPropertyValue("maxTooltipDistance",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"maxPanOut",{get:function(){return this.getPropertyValue("maxPanOut")},set:function(u){this.setPropertyValue("maxPanOut",u)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"xAxis",{get:function(){return this._xAxis.get()},set:function(u){var w=this;this._xAxis.get()!=u&&this._xAxis.set(u,new jn([u.tooltip.events.on("positionchanged",this.handleXTooltipPosition,this,!1),u.events.on("rangechangestarted",function($){w.hide(0),w.preventShow=!0},void 0,!1),u.events.on("rangechangeended",function($){w.preventShow=!1,w.hide(0),w.dispatch("cursorpositionchanged")},void 0,!1)]))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"yAxis",{get:function(){return this._yAxis.get()},set:function(u){var w=this;this._yAxis.get()!=u&&this._yAxis.set(u,new jn([u.tooltip.events.on("positionchanged",this.handleYTooltipPosition,this,!1),u.events.on("rangechangestarted",function($){w.hide(0),w.__disabled=!0},void 0,!1),u.events.on("rangechangeended",function($){w.__disabled=!1,w.hide(0),w.dispatch("cursorpositionchanged")},void 0,!1)]))},enumerable:!0,configurable:!0}),R.prototype.handleXTooltipPosition=function(u){var w=this.xAxis.tooltip,$=Of({x:w.pixelX,y:w.pixelY},this),G=$.x;if($.y=1,this.lineX&&(this.lineX.x=G,this.fitsToBounds($)||this.hide()),this.xAxis&&this.fullWidthLineX){var K=this.xAxis.currentItemStartPoint,re=this.xAxis.currentItemEndPoint;if(K&&re){this.lineX.x=G;var ue=re.x-K.x;this.lineX.path=mz(ue,this.innerHeight,-ue/2)}}},R.prototype.handleYTooltipPosition=function(u){var w=this.yAxis.tooltip,$=Of({x:w.pixelX,y:w.pixelY},this),G=$.y;if($.x=1,this.lineY&&(this.lineY.y=G,this.fitsToBounds($)||this.hide()),this.yAxis&&this.fullWidthLineY){var K=this.yAxis.currentItemStartPoint,re=this.yAxis.currentItemEndPoint;if(K&&re){this.lineY.y=G;var ue=re.y-K.y;this.lineY.path=mz(this.innerWidth,ue,0,-ue/2)}}},Object.defineProperty(R.prototype,"lineX",{get:function(){return this._lineX.get()},set:function(u){u?(u.setElement(this.paper.add("path")),this._lineX.set(u,u.events.on("positionchanged",this.updateSelection,this,!1)),u.interactionsEnabled=!1,u.parent=this):this._lineX.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"lineY",{get:function(){return this._lineY.get()},set:function(u){u?(u.setElement(this.paper.add("path")),this._lineY.set(u,u.events.on("positionchanged",this.updateSelection,this,!1)),u.parent=this,u.interactionsEnabled=!1):this._lineY.reset()},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"selection",{get:function(){return this._selection},set:function(u){this._selection=u,u&&(u.element=this.paper.add("path"),u.parent=this)},enumerable:!0,configurable:!0}),R.prototype.processConfig=function(u){var w=this;if(u&&(Te(u.xAxis)&&ct(u.xAxis)&&(this.map.hasKey(u.xAxis)?u.xAxis=this.map.getKey(u.xAxis):(this.processingErrors.push('[XYCursor] No axis with id "'+u.xAxis+'" found for `xAxis`'),delete u.xAxis)),Te(u.yAxis)&&ct(u.yAxis)&&(this.map.hasKey(u.yAxis)?u.yAxis=this.map.getKey(u.yAxis):(this.processingErrors.push('[XYCursor] No axis with id "'+u.yAxis+'" found for `yAxis`'),delete u.yAxis)),Te(u.snapToSeries))){var $=wt(u.snapToSeries)?u.snapToSeries:[u.snapToSeries],G=!1;wi($,function(K,re){ct(K)&&(w.map.hasKey(K)?$[re]=w.map.getKey(K):(w.processingErrors.push('[XYCursor] No series with id "'+K+'" found for `series`'),G=!0))}),G?delete u.snapToSeries:u.snapToSeries=$}U.prototype.processConfig.call(this,u)},Object.defineProperty(R.prototype,"snapToSeries",{get:function(){return this.getPropertyValue("snapToSeries")},set:function(u){var w=this;this.setPropertyValue("snapToSeries",u)&&(u instanceof kI&&(u=[u]),this._snapToDisposers&&wi(this._snapToDisposers,function($){$.dispose()}),this._snapToDisposers=[],u&&wi(u,function($){w._snapToDisposers.push($.events.on("tooltipshownat",function(){w.handleSnap($)},void 0,!1))}))},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"snapOnPan",{get:function(){return this.getPropertyValue("snapOnPan")},set:function(u){this.setPropertyValue("snapOnPan",u)},enumerable:!0,configurable:!0}),R.prototype.handleSnap=function(u){if(!this.downPoint){var w=u.getTooltipX()+u.xAxis.pixelX,$=u.getTooltipY()+u.yAxis.pixelY,G=u.xAxis,K=u.yAxis;G&&G.renderer.opposite&&($-=this.pixelHeight),this.point={x:w,y:$},this.getPositions();var re=w,ue=$;w-=this.pixelWidth,K&&K.renderer.opposite&&(w+=this.pixelWidth);var we=u.tooltip,De=we.animationDuration,Ve=we.animationEasing;G instanceof Ro&&!(G instanceof dc)&&K instanceof Ro&&!(K instanceof dc)?(u.yAxis.showTooltipAtPosition(this.yPosition),u.xAxis.showTooltipAtPosition(this.xPosition)):(u.baseAxis==u.xAxis&&u.yAxis.showTooltipAtPosition(this.yPosition),u.baseAxis==u.yAxis&&u.xAxis.showTooltipAtPosition(this.xPosition)),this.lineY.x=w,this.lineX.y=$,this.xAxis||this.lineX.animate([{property:"x",to:re}],De,Ve),this.yAxis||this.lineY.animate([{property:"y",to:ue}],De,Ve)}},R.prototype.dispose=function(){this.hide(0),U.prototype.dispose.call(this)},R}(Die);pi.registeredClasses.XYCursor=J4;var Pve=function(U){function R(){var u=U.call(this)||this;return u.className="RadarCursor",u.radius=de(100),u.innerRadius=de(0),u.applyTheme(),u.mask=void 0,u}return ie(R,U),R.prototype.fitsToBounds=function(u){var w=C(u);return wthis.pixelInnerRadius-1},Object.defineProperty(R.prototype,"startAngle",{get:function(){return this.getPropertyValue("startAngle")},set:function(u){this.setPropertyValue("startAngle",u,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(R.prototype,"endAngle",{get:function(){return this.getPropertyValue("endAngle")},set:function(u){this.setPropertyValue("endAngle",u,!0)},enumerable:!0,configurable:!0}),R.prototype.triggerMoveReal=function(u,w){this.xAxis&&(!this.xAxis||this.xAxis.cursorTooltipEnabled&&!this.xAxis.tooltip.disabled)||this.updateLineX(this.point),this.yAxis&&(!this.yAxis||this.yAxis.cursorTooltipEnabled&&!this.yAxis.tooltip.disabled)||this.updateLineY(this.point),this.updateSelection(),U.prototype.triggerMoveReal.call(this,u,w)},R.prototype.updateLineX=function(u){var w=this.pixelRadius,$=this.startAngle,G=this.endAngle,K=this.pixelInnerRadius;if(w>0&&ae($)&&ae(G)&&ae(K)){var re=ti(le(u),$,G),ue=void 0;if(this.lineX&&this.lineX.visible){if(this.lineX.moveTo({x:0,y:0}),this.xAxis&&this.fullWidthLineX){var we=this.xAxis.currentItemStartPoint,De=this.xAxis.currentItemEndPoint;if(we&&De){var Ve=ti(le(we),$,G),Ke=ti(le(De),$,G)-Ve;$0&&(Ke-=360),ue=wn({x:K*A(re-=Ke/2),y:K*$e(re)})+Rr({x:w*A(re),y:w*$e(re)})+Bd(re,Ke,w)+Rr({x:K*A(re+Ke),y:K*$e(re+Ke)})+Bd(re+Ke,-Ke,K)}}ue||(ue=wn({x:K*A(re),y:K*$e(re)})+Rr({x:w*A(re),y:w*$e(re)})),this.lineX.path=ue}}},R.prototype.updateLineY=function(u){if(this.lineY&&this.lineY.visible){var w=this.startAngle,$=this.endAngle,G=this.truePixelRadius,K=nt(C(u),0,this.truePixelRadius);if(ae(K)&&ae(w)){this.lineY.moveTo({x:0,y:0});var re=void 0,ue=$-w;if(this.yAxis&&this.fullWidthLineY){var we=this.yAxis.currentItemStartPoint,De=this.yAxis.currentItemEndPoint;if(we&&De){var Ve=nt(C(we),0,G);re=wn({x:(K=nt(C(De),0,G))*A(w),y:K*$e(w)})+Bd(w,ue,K),re+=wn({x:Ve*A($),y:Ve*$e($)})+Bd($,-ue,Ve)}}re||(re=wn({x:K*A(w),y:K*$e(w)})+Bd(w,$-w,K)),this.lineY.path=re}}},R.prototype.updateSelection=function(){if(this._usesSelection){var u=this.downPoint;if(u){var w=this.point,$=this.pixelRadius,G=this.truePixelRadius,K=this.pixelInnerRadius,re=Math.min(this.startAngle,this.endAngle),ue=Math.max(this.startAngle,this.endAngle),we=ti(le(u),re,ue),De=ti(le(w),re,ue),Ve=C(u);if(Ven?.matches(izi)).map(n=>Array.from(n.querySelectorAll(Mxt))).reduce((n,s)=>[...n,...s],[]),r=e.filter(n=>n?.matches(Mxt));return[...i,...r]}function Fxt(t){t.forEach(e=>{e.setPosition=t.indexOf(e)+1,e.setSize=t.length})}function Lxt(t,e=!1){const i=e?"ancestor::calcite-list-item | ancestor::calcite-list-item-group":"ancestor::calcite-list-item";return document.evaluate(i,t,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotLength}/*! + */const qm={container:"container",containerBorderSelected:"container--border-selected",containerBorderUnselected:"container--border-unselected",contentContainer:"content-container",contentContainerSelectable:"content-container--selectable",contentContainerHasCenterContent:"content-container--has-center-content",nestedContainer:"nested-container",nestedContainerHidden:"nested-container--hidden",content:"content",customContent:"custom-content",actionsStart:"actions-start",contentStart:"content-start",label:"label",description:"description",contentEnd:"content-end",actionsEnd:"actions-end",selectionContainer:"selection-container",openContainer:"open-container"},oQ={actionsStart:"actions-start",contentStart:"content-start",content:"content",contentEnd:"content-end",actionsEnd:"actions-end"},sHi=5,y6={selectedMultiple:"check-circle-f",selectedSingle:"circle-f",unselected:"blank",closedLTR:"caret-right",closedRTL:"caret-left",open:"caret-down",blank:"blank"},oHi="calcite-list-item-group",_2t="calcite-list-item";function b2t(t){const e=t.target.assignedElements({flatten:!0}),i=e.filter(n=>n?.matches(oHi)).map(n=>Array.from(n.querySelectorAll(_2t))).reduce((n,s)=>[...n,...s],[]),r=e.filter(n=>n?.matches(_2t));return[...i,...r]}function w2t(t){t.forEach(e=>{e.setPosition=t.indexOf(e)+1,e.setSize=t.length})}function x2t(t,e=!1){const i=e?"ancestor::calcite-list-item | ancestor::calcite-list-item-group":"ancestor::calcite-list-item";return document.evaluate(i,t,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotLength}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const kxt=new WeakMap,Nxt=new WeakMap;function SE(t){Nxt.set(t,new Promise(e=>kxt.set(t,e)))}function CE(t){kxt.get(t)()}function TE(t){return Nxt.get(t)}/*! + */const S2t=new WeakMap,C2t=new WeakMap;function TE(t){C2t.set(t,new Promise(e=>S2t.set(t,e)))}function EE(t){S2t.get(t)()}function IE(t){return C2t.get(t)}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */var $xt=typeof global=="object"&&global&&global.Object===Object&&global,rzi=typeof self=="object"&&self&&self.Object===Object&&self,nLe=$xt||rzi||Function("return this")(),lj=nLe.Symbol,Bxt=Object.prototype,nzi=Bxt.hasOwnProperty,szi=Bxt.toString,iQ=lj?lj.toStringTag:void 0;function ozi(t){var e=nzi.call(t,iQ),i=t[iQ];try{t[iQ]=void 0;var r=!0}catch{}var n=szi.call(t);return r&&(e?t[iQ]=i:delete t[iQ]),n}var azi=Object.prototype,lzi=azi.toString;function uzi(t){return lzi.call(t)}var czi="[object Null]",hzi="[object Undefined]",Gxt=lj?lj.toStringTag:void 0;function Mfe(t){return t==null?t===void 0?hzi:czi:Gxt&&Gxt in Object(t)?ozi(t):uzi(t)}function Dfe(t){return t!=null&&typeof t=="object"}var dzi="[object Symbol]";function Vxt(t){return typeof t=="symbol"||Dfe(t)&&Mfe(t)==dzi}var pzi=/\s/;function fzi(t){for(var e=t.length;e--&&pzi.test(t.charAt(e)););return e}var mzi=/^\s+/;function gzi(t){return t&&t.slice(0,fzi(t)+1).replace(mzi,"")}function rQ(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Uxt=0/0,yzi=/^[-+]0x[0-9a-f]+$/i,vzi=/^0b[01]+$/i,_zi=/^0o[0-7]+$/i,bzi=parseInt;function jxt(t){if(typeof t=="number")return t;if(Vxt(t))return Uxt;if(rQ(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=rQ(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=gzi(t);var i=vzi.test(t);return i||_zi.test(t)?bzi(t.slice(2),i?2:8):yzi.test(t)?Uxt:+t}var sLe=function(){return nLe.Date.now()},wzi="Expected a function",xzi=Math.max,Szi=Math.min;function Ffe(t,e,i){var r,n,s,o,a,l,c=0,d=!1,p=!1,y=!0;if(typeof t!="function")throw new TypeError(wzi);e=jxt(e)||0,rQ(i)&&(d=!!i.leading,p="maxWait"in i,s=p?xzi(jxt(i.maxWait)||0,e):s,y="trailing"in i?!!i.trailing:y);function v(X){var te=r,re=n;return r=n=void 0,c=X,o=t.apply(re,te),o}function S(X){return c=X,a=setTimeout(L,e),d?v(X):o}function I(X){var te=X-l,re=X-c,fe=e-te;return p?Szi(fe,s-re):fe}function O(X){var te=X-l,re=X-c;return l===void 0||te>=e||te<0||p&&re>=s}function L(){var X=sLe();if(O(X))return N(X);a=setTimeout(L,I(X))}function N(X){return a=void 0,y&&r?v(X):(r=n=void 0,o)}function G(){a!==void 0&&clearTimeout(a),c=0,r=l=n=a=void 0}function V(){return a===void 0?o:N(sLe())}function Y(){var X=sLe(),te=O(X);if(r=arguments,n=this,l=X,te){if(a===void 0)return S(l);if(p)return clearTimeout(a),a=setTimeout(L,e),v(l)}return a===void 0&&(a=setTimeout(L,e)),o}return Y.cancel=G,Y.flush=V,Y}/*! + */var T2t=typeof global=="object"&&global&&global.Object===Object&&global,aHi=typeof self=="object"&&self&&self.Object===Object&&self,ELe=T2t||aHi||Function("return this")(),mU=ELe.Symbol,E2t=Object.prototype,lHi=E2t.hasOwnProperty,uHi=E2t.toString,aQ=mU?mU.toStringTag:void 0;function cHi(t){var e=lHi.call(t,aQ),i=t[aQ];try{t[aQ]=void 0;var r=!0}catch{}var n=uHi.call(t);return r&&(e?t[aQ]=i:delete t[aQ]),n}var hHi=Object.prototype,dHi=hHi.toString;function pHi(t){return dHi.call(t)}var fHi="[object Null]",mHi="[object Undefined]",I2t=mU?mU.toStringTag:void 0;function rme(t){return t==null?t===void 0?mHi:fHi:I2t&&I2t in Object(t)?cHi(t):pHi(t)}function nme(t){return t!=null&&typeof t=="object"}var gHi="[object Symbol]";function A2t(t){return typeof t=="symbol"||nme(t)&&rme(t)==gHi}var yHi=/\s/;function vHi(t){for(var e=t.length;e--&&yHi.test(t.charAt(e)););return e}var _Hi=/^\s+/;function bHi(t){return t&&t.slice(0,vHi(t)+1).replace(_Hi,"")}function lQ(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var P2t=0/0,wHi=/^[-+]0x[0-9a-f]+$/i,xHi=/^0b[01]+$/i,SHi=/^0o[0-7]+$/i,CHi=parseInt;function O2t(t){if(typeof t=="number")return t;if(A2t(t))return P2t;if(lQ(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=lQ(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=bHi(t);var i=xHi.test(t);return i||SHi.test(t)?CHi(t.slice(2),i?2:8):wHi.test(t)?P2t:+t}var ILe=function(){return ELe.Date.now()},THi="Expected a function",EHi=Math.max,IHi=Math.min;function sme(t,e,i){var r,n,s,o,a,l,c=0,h=!1,p=!1,y=!0;if(typeof t!="function")throw new TypeError(THi);e=O2t(e)||0,lQ(i)&&(h=!!i.leading,p="maxWait"in i,s=p?EHi(O2t(i.maxWait)||0,e):s,y="trailing"in i?!!i.trailing:y);function v(X){var Z=r,ie=n;return r=n=void 0,c=X,o=t.apply(ie,Z),o}function x(X){return c=X,a=setTimeout(F,e),h?v(X):o}function I(X){var Z=X-l,ie=X-c,ce=e-Z;return p?IHi(ce,s-ie):ce}function P(X){var Z=X-l,ie=X-c;return l===void 0||Z>=e||Z<0||p&&ie>=s}function F(){var X=ILe();if(P(X))return k(X);a=setTimeout(F,I(X))}function k(X){return a=void 0,y&&r?v(X):(r=n=void 0,o)}function j(){a!==void 0&&clearTimeout(a),c=0,r=l=n=a=void 0}function V(){return a===void 0?o:k(ILe())}function Y(){var X=ILe(),Z=P(X);if(r=arguments,n=this,l=X,Z){if(a===void 0)return x(l);if(p)return clearTimeout(a),a=setTimeout(F,e),v(l)}return a===void 0&&(a=setTimeout(F,e)),o}return Y.cancel=j,Y.flush=V,Y}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */function Czi(t,e){for(var i=-1,r=t==null?0:t.length,n=Array(r);++i-1&&t%1==0&&t-1&&t%1==0&&t<=Lzi}function kzi(t){return t!=null&&Yxt(t.length)&&!Rzi(t)}var Nzi=Object.prototype;function $zi(t){var e=t&&t.constructor,i=typeof e=="function"&&e.prototype||Nzi;return t===i}function Bzi(t,e){for(var i=-1,r=Array(t);++i{const i=LHi(e),r=new RegExp(i,"i");t.length===0&&console.warn(`No data was passed to the filter function. - The data argument should be an array of objects`);const n=(o,a)=>{if(o?.constant||o?.filterDisabled)return!0;let l=!1;return kHi(o,c=>{typeof c=="function"||c==null||(Array.isArray(c)||typeof c=="object"&&c!==null?n(c,a)&&(l=!0):a.test(c)&&(l=!0))}),l};return t.filter(o=>n(o,r))};/*! + */function AHi(t,e){for(var i=-1,r=t==null?0:t.length,n=Array(r);++i-1&&t%1==0&&t-1&&t%1==0&&t<=BHi}function VHi(t){return t!=null&&L2t(t.length)&&!LHi(t)}var jHi=Object.prototype;function GHi(t){var e=t&&t.constructor,i=typeof e=="function"&&e.prototype||jHi;return t===i}function UHi(t,e){for(var i=-1,r=Array(t);++i{const i=BWi(e),r=new RegExp(i,"i");t.length===0&&console.warn(`No data was passed to the filter function. + The data argument should be an array of objects`);const n=(o,a)=>{if(o?.constant||o?.filterDisabled)return!0;let l=!1;return VWi(o,c=>{typeof c=="function"||c==null||(Array.isArray(c)||typeof c=="object"&&c!==null?n(c,a)&&(l=!0):a.test(c)&&(l=!0))}),l};return t.filter(o=>n(o,r))};/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */function s2t(t){return t==="Enter"||t===" "}const aLe=["0","1","2","3","4","5","6","7","8","9"];/*! + */function W2t(t){return t==="Enter"||t===" "}const PLe=["0","1","2","3","4","5","6","7","8","9"];/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const NHi=new RegExp("-","g"),$Hi=new RegExp("\\.?0+$");class Ic{constructor(e){if(this.add=n=>Ic.fromBigInt(this.value+new Ic(n).value),this.subtract=n=>Ic.fromBigInt(this.value-new Ic(n).value),this.multiply=n=>Ic._divRound(this.value*new Ic(n).value,Ic.SHIFT),this.divide=n=>Ic._divRound(this.value*Ic.SHIFT,new Ic(n).value),e instanceof Ic)return e;const[i,r]=String(e).split(".").concat("");this.value=BigInt(i+r.padEnd(Ic.DECIMALS,"0").slice(0,Ic.DECIMALS))+BigInt(Ic.ROUNDED&&r[Ic.DECIMALS]>="5"),this.isNegative=e.charAt(0)==="-"}getIntegersAndDecimals(){const e=this.value.toString().replace(NHi,"").padStart(Ic.DECIMALS+1,"0"),i=e.slice(0,-Ic.DECIMALS),r=e.slice(-Ic.DECIMALS).replace($Hi,"");return{integers:i,decimals:r}}toString(){const{integers:e,decimals:i}=this.getIntegersAndDecimals();return`${this.isNegative?"-":""}${e}${i.length?"."+i:""}`}formatToParts(e){const{integers:i,decimals:r}=this.getIntegersAndDecimals(),n=e.numberFormatter.formatToParts(BigInt(i));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:i,decimals:r}=this.getIntegersAndDecimals(),n=`${this.isNegative?e.minusSign:""}${e.numberFormatter.format(BigInt(i))}`,s=r.length?`${e.decimal}${r.split("").map(o=>e.numberFormatter.format(Number(o))).join("")}`:"";return`${n}${s}`}}Ic.DECIMALS=100,Ic.ROUNDED=!0,Ic.SHIFT=BigInt("1"+"0".repeat(Ic.DECIMALS)),Ic._divRound=(t,e)=>Ic.fromBigInt(t/e+(Ic.ROUNDED?t*BigInt(2)/e%BigInt(2):BigInt(0))),Ic.fromBigInt=t=>Object.assign(Object.create(Ic.prototype),{value:t});function EE(t){return!(!t||isNaN(Number(t)))}function BHi(t){return!t||!HHi(t)?"":Lfe(t,e=>{let i=!1;const r=e.split("").filter((n,s)=>n.match(/\./g)&&!i?(i=!0,!0):n.match(/\-/g)&&s===0?!0:aLe.includes(n)).reduce((n,s)=>n+s);return EE(r)?new Ic(r).toString():""})}const GHi=/^([-0])0+(?=\d)/,VHi=/(?!^\.)\.$/,UHi=/(?!^-)-/g,jHi=/^-\b0\b\.?0*$/,zHi=t=>Lfe(t,e=>{const i=e.replace(UHi,"").replace(VHi,"").replace(GHi,"$1");return EE(i)?jHi.test(i)?i:new Ic(i).toString():e});function Lfe(t,e){if(!t)return t;const i=t.toLowerCase().indexOf("e")+1;return i?t.replace(/[eE]*$/g,"").substring(0,i).concat(t.slice(i).replace(/[eE]/g,"")).split(/[eE]/).map((r,n)=>e(n===1?r.replace(/\./g,""):r)).join("e").replace(/^e/,"1e"):e(t)}function HHi(t){return aLe.some(e=>t.includes(e))}const lF="en",WHi=["ar","bg","bs","ca","cs","da","de","el",lF,"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"],qHi=["ar","bg","bs","ca","cs","da","de","de-CH","el",lF,"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"],YHi=["arab","arabext","bali","beng","deva","fullwide","gujr","guru","hanidec","khmr","knda","laoo","latn","limb","mlym","mong","mymr","orya","tamldec","telu","thai","tibt"],o2t=t=>YHi.includes(t),lLe=new Intl.NumberFormat().resolvedOptions().numberingSystem,uLe=lLe==="arab"||!o2t(lLe)?"latn":lLe,XHi=t=>o2t(t)?t:uLe;function a2t(t,e="cldr"){const i=e==="cldr"?qHi:WHi;return t?i.includes(t)?t:(t=t.toLowerCase(),t==="nb"?"no":e==="t9n"&&t==="pt"?"pt-BR":(t.includes("-")&&(t=t.replace(/(\w+)-(\w+)/,(r,n,s)=>`${n}-${s.toUpperCase()}`),i.includes(t)||(t=t.split("-")[0])),t==="zh"?"zh-CN":i.includes(t)?t:(console.warn(`Translations for the "${t}" locale are not available and will fall back to the default, English (en).`),lF))):lF}const sQ=new Set;function uF(t){KHi(t),sQ.size===0&&l2t?.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}),sQ.add(t)}function KHi(t){t.effectiveLocale=JHi(t)}function cF(t){sQ.delete(t),sQ.size===0&&l2t.disconnect()}const l2t=aF("mutation",t=>{t.forEach(e=>{const i=e.target;sQ.forEach(r=>{if(!_ii(i,r.el))return;const s=XB(r.el,"[lang]");if(!s){r.effectiveLocale=lF;return}const o=s.lang;r.effectiveLocale=s.hasAttribute("lang")&&o===""?lF:o})})});function JHi(t){return t.el.lang||XB(t.el,"[lang]")?.lang||document.documentElement.lang||lF}class ZHi{constructor(){this.delocalize=e=>this._numberFormatOptions?Lfe(e,i=>i.trim().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?Lfe(e,i=>EE(i.trim())?new Ic(i.trim()).format(this).replace(new RegExp(`[${this._actualGroup}]`,"g"),this._group):i):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=a2t(e?.locale),e.numberingSystem=XHi(e?.numberingSystem),!this._numberFormatOptions&&e.locale===lF&&e.numberingSystem===uLe&&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 i=new Map(this._digits.map((n,s)=>[n,s])),r=new Intl.NumberFormat(this._numberFormatOptions.locale).formatToParts(-123456789e-1);this._actualGroup=r.find(n=>n.type==="group").value,this._group=this._actualGroup.trim().length===0?" ":this._actualGroup,this._decimal=r.find(n=>n.type==="decimal").value,this._minusSign=r.find(n=>n.type==="minusSign").value,this._getDigitIndex=n=>i.get(n)}}const uO=new ZHi;/*! + */const jWi=new RegExp("-","g"),GWi=new RegExp("\\.?0+$");class Rc{constructor(e){if(this.add=n=>Rc.fromBigInt(this.value+new Rc(n).value),this.subtract=n=>Rc.fromBigInt(this.value-new Rc(n).value),this.multiply=n=>Rc._divRound(this.value*new Rc(n).value,Rc.SHIFT),this.divide=n=>Rc._divRound(this.value*Rc.SHIFT,new Rc(n).value),e instanceof Rc)return e;const[i,r]=String(e).split(".").concat("");this.value=BigInt(i+r.padEnd(Rc.DECIMALS,"0").slice(0,Rc.DECIMALS))+BigInt(Rc.ROUNDED&&r[Rc.DECIMALS]>="5"),this.isNegative=e.charAt(0)==="-"}getIntegersAndDecimals(){const e=this.value.toString().replace(jWi,"").padStart(Rc.DECIMALS+1,"0"),i=e.slice(0,-Rc.DECIMALS),r=e.slice(-Rc.DECIMALS).replace(GWi,"");return{integers:i,decimals:r}}toString(){const{integers:e,decimals:i}=this.getIntegersAndDecimals();return`${this.isNegative?"-":""}${e}${i.length?"."+i:""}`}formatToParts(e){const{integers:i,decimals:r}=this.getIntegersAndDecimals(),n=e.numberFormatter.formatToParts(BigInt(i));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:i,decimals:r}=this.getIntegersAndDecimals(),n=`${this.isNegative?e.minusSign:""}${e.numberFormatter.format(BigInt(i))}`,s=r.length?`${e.decimal}${r.split("").map(o=>e.numberFormatter.format(Number(o))).join("")}`:"";return`${n}${s}`}}Rc.DECIMALS=100,Rc.ROUNDED=!0,Rc.SHIFT=BigInt("1"+"0".repeat(Rc.DECIMALS)),Rc._divRound=(t,e)=>Rc.fromBigInt(t/e+(Rc.ROUNDED?t*BigInt(2)/e%BigInt(2):BigInt(0))),Rc.fromBigInt=t=>Object.assign(Object.create(Rc.prototype),{value:t});function AE(t){return!(!t||isNaN(Number(t)))}function UWi(t){return!t||!XWi(t)?"":ome(t,e=>{let i=!1;const r=e.split("").filter((n,s)=>n.match(/\./g)&&!i?(i=!0,!0):n.match(/\-/g)&&s===0?!0:PLe.includes(n)).reduce((n,s)=>n+s);return AE(r)?new Rc(r).toString():""})}const zWi=/^([-0])0+(?=\d)/,HWi=/(?!^\.)\.$/,WWi=/(?!^-)-/g,qWi=/^-\b0\b\.?0*$/,YWi=t=>ome(t,e=>{const i=e.replace(WWi,"").replace(HWi,"").replace(zWi,"$1");return AE(i)?qWi.test(i)?i:new Rc(i).toString():e});function ome(t,e){if(!t)return t;const i=t.toLowerCase().indexOf("e")+1;return i?t.replace(/[eE]*$/g,"").substring(0,i).concat(t.slice(i).replace(/[eE]/g,"")).split(/[eE]/).map((r,n)=>e(n===1?r.replace(/\./g,""):r)).join("e").replace(/^e/,"1e"):e(t)}function XWi(t){return PLe.some(e=>t.includes(e))}const hF="en",KWi=["ar","bg","bs","ca","cs","da","de","el",hF,"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"],JWi=["ar","bg","bs","ca","cs","da","de","de-CH","el",hF,"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"],ZWi=["arab","arabext","bali","beng","deva","fullwide","gujr","guru","hanidec","khmr","knda","laoo","latn","limb","mlym","mong","mymr","orya","tamldec","telu","thai","tibt"],q2t=t=>ZWi.includes(t),OLe=new Intl.NumberFormat().resolvedOptions().numberingSystem,RLe=OLe==="arab"||!q2t(OLe)?"latn":OLe,QWi=t=>q2t(t)?t:RLe;function Y2t(t,e="cldr"){const i=e==="cldr"?JWi:KWi;return t?i.includes(t)?t:(t=t.toLowerCase(),t==="nb"?"no":e==="t9n"&&t==="pt"?"pt-BR":(t.includes("-")&&(t=t.replace(/(\w+)-(\w+)/,(r,n,s)=>`${n}-${s.toUpperCase()}`),i.includes(t)||(t=t.split("-")[0])),t==="zh"?"zh-CN":i.includes(t)?t:(console.warn(`Translations for the "${t}" locale are not available and will fall back to the default, English (en).`),hF))):hF}const cQ=new Set;function dF(t){eqi(t),cQ.size===0&&X2t?.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}),cQ.add(t)}function eqi(t){t.effectiveLocale=tqi(t)}function pF(t){cQ.delete(t),cQ.size===0&&X2t.disconnect()}const X2t=cF("mutation",t=>{t.forEach(e=>{const i=e.target;cQ.forEach(r=>{if(!Gii(i,r.el))return;const s=qB(r.el,"[lang]");if(!s){r.effectiveLocale=hF;return}const o=s.lang;r.effectiveLocale=s.hasAttribute("lang")&&o===""?hF:o})})});function tqi(t){return t.el.lang||qB(t.el,"[lang]")?.lang||document.documentElement.lang||hF}class iqi{constructor(){this.delocalize=e=>this._numberFormatOptions?ome(e,i=>i.trim().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?ome(e,i=>AE(i.trim())?new Rc(i.trim()).format(this).replace(new RegExp(`[${this._actualGroup}]`,"g"),this._group):i):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=Y2t(e?.locale),e.numberingSystem=QWi(e?.numberingSystem),!this._numberFormatOptions&&e.locale===hF&&e.numberingSystem===RLe&&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 i=new Map(this._digits.map((n,s)=>[n,s])),r=new Intl.NumberFormat(this._numberFormatOptions.locale).formatToParts(-123456789e-1);this._actualGroup=r.find(n=>n.type==="group").value,this._group=this._actualGroup.trim().length===0?" ":this._actualGroup,this._decimal=r.find(n=>n.type==="decimal").value,this._minusSign=r.find(n=>n.type==="minusSign").value,this._getDigitIndex=n=>i.get(n)}}const dO=new iqi;/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const kfe={};async function QHi(t,e){const i=`${e}_${t}`;return kfe[i]||(kfe[i]=fetch($Qe(`./assets/${e}/t9n/messages_${t}.json`)).then(r=>(r.ok||u2t(),r.json())).catch(()=>u2t())),kfe[i]}function u2t(){throw new Error("could not fetch component message bundle")}function cLe(t){t.messages={...t.defaultMessages,...t.messageOverrides}}async function hF(t){t.defaultMessages=await c2t(t,t.effectiveLocale),cLe(t)}async function c2t(t,e){const{el:i}=t,n=i.tagName.toLowerCase().replace("calcite-","");return QHi(a2t(e,"t9n"),n)}async function dF(t,e){t.defaultMessages=await c2t(t,e),cLe(t)}function pF(t){t.onMessagesChange=eWi}function fF(t){t.onMessagesChange=void 0}function eWi(){cLe(this)}/*! + */const ame={};async function rqi(t,e){const i=`${e}_${t}`;return ame[i]||(ame[i]=fetch(GQe(`./assets/${e}/t9n/messages_${t}.json`)).then(r=>(r.ok||K2t(),r.json())).catch(()=>K2t())),ame[i]}function K2t(){throw new Error("could not fetch component message bundle")}function MLe(t){t.messages={...t.defaultMessages,...t.messageOverrides}}async function fF(t){t.defaultMessages=await J2t(t,t.effectiveLocale),MLe(t)}async function J2t(t,e){const{el:i}=t,n=i.tagName.toLowerCase().replace("calcite-","");return rqi(Y2t(e,"t9n"),n)}async function mF(t,e){t.defaultMessages=await J2t(t,e),MLe(t)}function gF(t){t.onMessagesChange=nqi}function yF(t){t.onMessagesChange=void 0}function nqi(){MLe(this)}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const hLe="hidden-form-input";function dLe(t){return"checked"in t}const pLe=new WeakMap,fLe=new WeakSet;function tWi(t,e){const i="calciteInternalFormComponentRegister";let r=!1;return t.addEventListener(i,n=>{r=n.composedPath().some(s=>fLe.has(s)),n.stopPropagation()},{once:!0}),e.dispatchEvent(new CustomEvent(i,{bubbles:!0,composed:!0})),r}function iWi(t){const{formEl:e}=t;return e?("requestSubmit"in e?e.requestSubmit():e.submit(),!0):!1}function rWi(t){const{el:e,value:i}=t,r=XB(e,"form");if(!r||tWi(r,e))return;t.formEl=r,t.defaultValue=i,dLe(t)&&(t.defaultChecked=t.checked);const n=(t.onFormReset||nWi).bind(t);r.addEventListener("reset",n),pLe.set(t.el,n),fLe.add(e)}function nWi(){if(dLe(this)){this.checked=this.defaultChecked;return}this.value=this.defaultValue}function sWi(t){const{el:e,formEl:i}=t;if(!i)return;const r=pLe.get(e);i.removeEventListener("reset",r),pLe.delete(e),t.formEl=null,fLe.delete(e)}const h2t=t=>{t.target.dispatchEvent(new CustomEvent("calciteInternalHiddenInputChange",{bubbles:!0}))},d2t=t=>t.removeEventListener("change",h2t);function oWi(t){const{el:e,formEl:i,name:r,value:n}=t,{ownerDocument:s}=e,o=e.querySelectorAll(`input[slot="${hLe}"]`);if(!i||!r){o.forEach(p=>{d2t(p),p.remove()});return}const a=Array.isArray(n)?n:[n],l=[],c=new Set;o.forEach(p=>{const y=a.find(v=>v==p.value);y!=null?(c.add(y),p2t(t,p,y)):l.push(p)});let d;a.forEach(p=>{if(c.has(p))return;let y=l.pop();y||(y=s.createElement("input"),y.slot=hLe),d||(d=s.createDocumentFragment()),d.append(y),y.addEventListener("change",h2t),p2t(t,y,p)}),d&&e.append(d),l.forEach(p=>{d2t(p),p.remove()})}function p2t(t,e,i){const{defaultValue:r,disabled:n,name:s,required:o}=t;e.defaultValue=r,e.disabled=n,e.name=s,e.required=o,e.tabIndex=-1,dLe(t)?(e.checked=t.checked,e.defaultChecked=t.defaultChecked,e.value=t.checked?i||"on":""):e.value=i||"",t.syncHiddenFormInput?.(e)}const aWi=({component:t})=>(oWi(t),dr("slot",{name:hLe}));/*! + */const DLe="hidden-form-input";function FLe(t){return"checked"in t}const LLe=new WeakMap,NLe=new WeakSet;function sqi(t,e){const i="calciteInternalFormComponentRegister";let r=!1;return t.addEventListener(i,n=>{r=n.composedPath().some(s=>NLe.has(s)),n.stopPropagation()},{once:!0}),e.dispatchEvent(new CustomEvent(i,{bubbles:!0,composed:!0})),r}function oqi(t){const{formEl:e}=t;return e?("requestSubmit"in e?e.requestSubmit():e.submit(),!0):!1}function aqi(t){const{el:e,value:i}=t,r=qB(e,"form");if(!r||sqi(r,e))return;t.formEl=r,t.defaultValue=i,FLe(t)&&(t.defaultChecked=t.checked);const n=(t.onFormReset||lqi).bind(t);r.addEventListener("reset",n),LLe.set(t.el,n),NLe.add(e)}function lqi(){if(FLe(this)){this.checked=this.defaultChecked;return}this.value=this.defaultValue}function uqi(t){const{el:e,formEl:i}=t;if(!i)return;const r=LLe.get(e);i.removeEventListener("reset",r),LLe.delete(e),t.formEl=null,NLe.delete(e)}const Z2t=t=>{t.target.dispatchEvent(new CustomEvent("calciteInternalHiddenInputChange",{bubbles:!0}))},Q2t=t=>t.removeEventListener("change",Z2t);function cqi(t){const{el:e,formEl:i,name:r,value:n}=t,{ownerDocument:s}=e,o=e.querySelectorAll(`input[slot="${DLe}"]`);if(!i||!r){o.forEach(p=>{Q2t(p),p.remove()});return}const a=Array.isArray(n)?n:[n],l=[],c=new Set;o.forEach(p=>{const y=a.find(v=>v==p.value);y!=null?(c.add(y),eSt(t,p,y)):l.push(p)});let h;a.forEach(p=>{if(c.has(p))return;let y=l.pop();y||(y=s.createElement("input"),y.slot=DLe),h||(h=s.createDocumentFragment()),h.append(y),y.addEventListener("change",Z2t),eSt(t,y,p)}),h&&e.append(h),l.forEach(p=>{Q2t(p),p.remove()})}function eSt(t,e,i){const{defaultValue:r,disabled:n,name:s,required:o}=t;e.defaultValue=r,e.disabled=n,e.name=s,e.required=o,e.tabIndex=-1,FLe(t)?(e.checked=t.checked,e.defaultChecked=t.defaultChecked,e.value=t.checked?i||"on":""):e.value=i||"",t.syncHiddenFormInput?.(e)}const hqi=({component:t})=>(cqi(t),br("slot",{name:DLe}));/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const f2t="calciteInternalLabelClick",mLe="calciteInternalLabelConnected",gLe="calciteInternaLabelDisconnected",m2t="calcite-label",Nfe=new WeakMap,oQ=new WeakMap,$fe=new WeakMap,uj=new Set,lWi=t=>{const{id:e}=t,i=e&&DEe(t,{selector:`${m2t}[for="${e}"]`});if(i)return i;const r=XB(t,m2t);return!r||uWi(r,t)?null:r};function uWi(t,e){let i;const r="custom-element-ancestor-check",n=o=>{o.stopImmediatePropagation();const a=o.composedPath();i=a.slice(a.indexOf(e),a.indexOf(t))};return t.addEventListener(r,n,{once:!0}),e.dispatchEvent(new CustomEvent(r,{composed:!0,bubbles:!0})),t.removeEventListener(r,n),i.filter(o=>o!==e&&o!==t).filter(o=>o.tagName?.includes("-")).length>0}function g2t(t){const e=lWi(t.el);if(Nfe.has(e)||!e&&uj.has(t))return;const i=pWi.bind(t);if(e){t.labelEl=e;const r=hWi.bind(t);Nfe.set(t.labelEl,r),t.labelEl.addEventListener(f2t,r),uj.delete(t),document.removeEventListener(mLe,oQ.get(t)),$fe.set(t,i),document.addEventListener(gLe,i)}else uj.has(t)||(i(),document.removeEventListener(gLe,$fe.get(t)))}function cWi(t){if(uj.delete(t),document.removeEventListener(mLe,oQ.get(t)),document.removeEventListener(gLe,$fe.get(t)),oQ.delete(t),$fe.delete(t),!t.labelEl)return;const e=Nfe.get(t.labelEl);t.labelEl.removeEventListener(f2t,e),Nfe.delete(t.labelEl)}function y2t(t){return t.label||t.labelEl?.textContent?.trim()||""}function hWi(t){this.disabled||this.el.contains(t.detail.sourceEvent.target)||this.onLabelClick(t)}function dWi(){uj.has(this)&&g2t(this)}function pWi(){uj.add(this);const t=oQ.get(this)||dWi.bind(this);oQ.set(this,t),document.addEventListener(mLe,t)}/*! + */const tSt="calciteInternalLabelClick",kLe="calciteInternalLabelConnected",$Le="calciteInternaLabelDisconnected",iSt="calcite-label",lme=new WeakMap,hQ=new WeakMap,ume=new WeakMap,gU=new Set,dqi=t=>{const{id:e}=t,i=e&&kEe(t,{selector:`${iSt}[for="${e}"]`});if(i)return i;const r=qB(t,iSt);return!r||pqi(r,t)?null:r};function pqi(t,e){let i;const r="custom-element-ancestor-check",n=o=>{o.stopImmediatePropagation();const a=o.composedPath();i=a.slice(a.indexOf(e),a.indexOf(t))};return t.addEventListener(r,n,{once:!0}),e.dispatchEvent(new CustomEvent(r,{composed:!0,bubbles:!0})),t.removeEventListener(r,n),i.filter(o=>o!==e&&o!==t).filter(o=>o.tagName?.includes("-")).length>0}function rSt(t){const e=dqi(t.el);if(lme.has(e)||!e&&gU.has(t))return;const i=yqi.bind(t);if(e){t.labelEl=e;const r=mqi.bind(t);lme.set(t.labelEl,r),t.labelEl.addEventListener(tSt,r),gU.delete(t),document.removeEventListener(kLe,hQ.get(t)),ume.set(t,i),document.addEventListener($Le,i)}else gU.has(t)||(i(),document.removeEventListener($Le,ume.get(t)))}function fqi(t){if(gU.delete(t),document.removeEventListener(kLe,hQ.get(t)),document.removeEventListener($Le,ume.get(t)),hQ.delete(t),ume.delete(t),!t.labelEl)return;const e=lme.get(t.labelEl);t.labelEl.removeEventListener(tSt,e),lme.delete(t.labelEl)}function nSt(t){return t.label||t.labelEl?.textContent?.trim()||""}function mqi(t){this.disabled||this.el.contains(t.detail.sourceEvent.target)||this.onLabelClick(t)}function gqi(){gU.has(this)&&rSt(this)}function yqi(){gU.add(this);const t=hQ.get(this)||gqi.bind(this);hQ.set(this,t),document.addEventListener(kLe,t)}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const v2t=t=>{const e=(""+t).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0};/*! + */const sSt=t=>{const e=(""+t).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0};/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const fWi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{position:relative;display:block;inline-size:100%}.track,.bar{position:absolute;inset-block-start:0px;block-size:2px}.track{z-index:1;inline-size:100%;overflow:hidden;background:var(--calcite-ui-border-3)}.bar{z-index:1;background-color:var(--calcite-ui-brand)}@media (forced-colors: active){.track{background-color:highlightText}.bar{background-color:linkText}}.indeterminate{inline-size:20%;animation:looping-progress-bar-ani calc(var(--calcite-internal-animation-timing-medium) * 11) linear infinite}.reversed{animation-direction:reverse}.text{padding-inline:0px;padding-block:1rem 0px;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2)}@keyframes looping-progress-bar-ani{0%{transform:translate3d(-100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(600%, 0, 0)}}",mWi=h0(class extends d0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.type="determinate",this.value=0,this.label=void 0,this.text=void 0,this.reversed=!1}render(){const e=this.type==="determinate"?{width:`${this.value*100}%`}:{};return dr("div",{"aria-label":this.label||this.text,"aria-valuemax":1,"aria-valuemin":0,"aria-valuenow":this.value,role:"progressbar"},dr("div",{class:"track"},dr("div",{class:{bar:!0,indeterminate:this.type==="indeterminate",reversed:this.reversed},style:e})),this.text?dr("div",{class:"text"},this.text):null)}get el(){return this}static get style(){return fWi}},[1,"calcite-progress",{type:[513],value:[2],label:[1],text:[1],reversed:[516]}]);function Bfe(){if(typeof customElements>"u")return;["calcite-progress"].forEach(e=>{switch(e){case"calcite-progress":customElements.get(e)||customElements.define(e,mWi);break}})}Bfe();/*! + */const vqi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{position:relative;display:block;inline-size:100%}.track,.bar{position:absolute;inset-block-start:0px;block-size:2px}.track{z-index:1;inline-size:100%;overflow:hidden;background:var(--calcite-ui-border-3)}.bar{z-index:1;background-color:var(--calcite-ui-brand)}@media (forced-colors: active){.track{background-color:highlightText}.bar{background-color:linkText}}.indeterminate{inline-size:20%;animation:looping-progress-bar-ani calc(var(--calcite-internal-animation-timing-medium) * 11) linear infinite}.reversed{animation-direction:reverse}.text{padding-inline:0px;padding-block:1rem 0px;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2)}@keyframes looping-progress-bar-ani{0%{transform:translate3d(-100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(600%, 0, 0)}}",_qi=d0(class extends p0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.type="determinate",this.value=0,this.label=void 0,this.text=void 0,this.reversed=!1}render(){const e=this.type==="determinate"?{width:`${this.value*100}%`}:{};return br("div",{"aria-label":this.label||this.text,"aria-valuemax":1,"aria-valuemin":0,"aria-valuenow":this.value,role:"progressbar"},br("div",{class:"track"},br("div",{class:{bar:!0,indeterminate:this.type==="indeterminate",reversed:this.reversed},style:e})),this.text?br("div",{class:"text"},this.text):null)}get el(){return this}static get style(){return vqi}},[1,"calcite-progress",{type:[513],value:[2],label:[1],text:[1],reversed:[516]}]);function cme(){if(typeof customElements>"u")return;["calcite-progress"].forEach(e=>{switch(e){case"calcite-progress":customElements.get(e)||customElements.define(e,_qi);break}})}cme();/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const x0={loader:"loader",clearButton:"clear-button",editingEnabled:"editing-enabled",inlineChild:"inline-child",inputIcon:"icon",prefix:"prefix",suffix:"suffix",numberButtonWrapper:"number-button-wrapper",buttonItemHorizontal:"number-button-item--horizontal",wrapper:"element-wrapper",inputWrapper:"wrapper",actionWrapper:"action-wrapper",resizeIconWrapper:"resize-icon-wrapper",numberButtonItem:"number-button-item"},_2t={tel:"phone",password:"lock",email:"email-address",date:"calendar",time:"clock",search:"search"},gWi={action:"action"},yWi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{display:block}:host([scale=s]) input,:host([scale=s]) .prefix,:host([scale=s]) .suffix{block-size:1.5rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) textarea{block-size:1.5rem;min-block-size:1.5rem}:host([scale=s]) .number-button-wrapper,:host([scale=s]) .action-wrapper calcite-button,:host([scale=s]) .action-wrapper calcite-button button{block-size:1.5rem}:host([scale=s]) input[type=file]{block-size:1.5rem}:host([scale=s]) .clear-button{min-block-size:1.5rem;min-inline-size:1.5rem}:host([scale=s]) textarea{block-size:auto;padding-block:0.25rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]) input,:host([scale=m]) .prefix,:host([scale=m]) .suffix{block-size:2rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) textarea{min-block-size:2rem}:host([scale=m]) .number-button-wrapper,:host([scale=m]) .action-wrapper calcite-button,:host([scale=m]) .action-wrapper calcite-button button{block-size:2rem}:host([scale=m]) input[type=file]{block-size:2rem}:host([scale=m]) .clear-button{min-block-size:2rem;min-inline-size:2rem}:host([scale=m]) textarea{block-size:auto;padding-block:0.5rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) input,:host([scale=l]) .prefix,:host([scale=l]) .suffix{block-size:2.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) textarea{min-block-size:2.75rem}:host([scale=l]) .number-button-wrapper,:host([scale=l]) .action-wrapper calcite-button,:host([scale=l]) .action-wrapper calcite-button button{block-size:2.75rem}:host([scale=l]) input[type=file]{block-size:2.75rem}:host([scale=l]) .clear-button{min-block-size:2.75rem;min-inline-size:2.75rem}:host([scale=l]) textarea{block-size:auto;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([disabled]) textarea{resize:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host textarea,:host input{transition:var(--calcite-animation-timing), block-size 0, outline-offset 0s;-webkit-appearance:none;position:relative;margin:0px;box-sizing:border-box;display:flex;max-block-size:100%;inline-size:100%;max-inline-size:100%;flex:1 1 0%;border-radius:0px;background-color:var(--calcite-ui-foreground-1);font-family:inherit;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-1)}:host input[type=search]::-webkit-search-decoration{-webkit-appearance:none}:host input,:host textarea{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);color:var(--calcite-ui-text-1)}:host input::placeholder,:host input:-ms-input-placeholder,:host input::-ms-input-placeholder,:host textarea::placeholder,:host textarea:-ms-input-placeholder,:host textarea::-ms-input-placeholder{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}:host input:focus,:host textarea:focus{border-color:var(--calcite-ui-brand);color:var(--calcite-ui-text-1)}:host input[readonly],:host textarea[readonly]{background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium)}:host input[readonly]:focus,:host textarea[readonly]:focus{color:var(--calcite-ui-text-1)}:host calcite-icon{color:var(--calcite-ui-text-3)}:host textarea,:host input{outline-color:transparent}:host textarea:focus,:host input:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host([status=invalid]) input,:host([status=invalid]) textarea{border-color:var(--calcite-ui-danger)}:host([status=invalid]) input:focus,:host([status=invalid]) textarea:focus{outline:2px solid var(--calcite-ui-danger);outline-offset:-2px}:host([scale=s]) .icon{inset-inline-start:0.5rem}:host([scale=m]) .icon{inset-inline-start:0.75rem}:host([scale=l]) .icon{inset-inline-start:1rem}:host([icon][scale=s]) input{padding-inline-start:2rem}:host([icon][scale=m]) input{padding-inline-start:2.5rem}:host([icon][scale=l]) input{padding-inline-start:3.5rem}.element-wrapper{position:relative;order:3;display:inline-flex;flex:1 1 0%;align-items:center}.icon{pointer-events:none;position:absolute;display:block;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.icon,.resize-icon-wrapper{z-index:1}input[type=text]::-ms-clear,input[type=text]::-ms-reveal{display:none;block-size:0px;inline-size:0px}input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration,input[type=date]::-webkit-clear-button,input[type=time]::-webkit-clear-button{display:none}.clear-button{pointer-events:initial;order:4;margin:0px;box-sizing:border-box;display:flex;min-block-size:100%;cursor:pointer;align-items:center;justify-content:center;align-self:stretch;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);outline-color:transparent;border-inline-start-width:0px}.clear-button:hover{background-color:var(--calcite-ui-foreground-2);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:hover calcite-icon{color:var(--calcite-ui-text-1);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:active{background-color:var(--calcite-ui-foreground-3)}.clear-button:active calcite-icon{color:var(--calcite-ui-text-1)}.clear-button:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}.clear-button:disabled{opacity:var(--calcite-ui-opacity-disabled)}.loader{inset-block-start:1px;inset-inline:1px;pointer-events:none;position:absolute;display:block}.action-wrapper{order:7;display:flex}.prefix,.suffix{box-sizing:border-box;display:flex;block-size:auto;min-block-size:100%;-webkit-user-select:none;user-select:none;align-content:center;align-items:center;overflow-wrap:break-word;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium);line-height:1;color:var(--calcite-ui-text-2)}.prefix{order:2;border-inline-end-width:0px}.suffix{order:5;border-inline-start-width:0px}:host([alignment=start]) textarea,:host([alignment=start]) input{text-align:start}:host([alignment=end]) textarea,:host([alignment=end]) input{text-align:end}:host input[type=number]{-moz-appearance:textfield}:host input[type=number]::-webkit-inner-spin-button,:host input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:textfield;margin:0px}.number-button-wrapper{pointer-events:none;order:6;box-sizing:border-box;display:flex;flex-direction:column;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([number-button-type=vertical]) .wrapper{flex-direction:row;display:flex}:host([number-button-type=vertical]) input,:host([number-button-type=vertical]) textarea{order:2}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=down] calcite-icon{transform:rotate(-90deg)}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=up] calcite-icon{transform:rotate(-90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down],.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:1;max-block-size:100%;min-block-size:100%;align-self:stretch}.number-button-item.number-button-item--horizontal[data-adjustment=down] calcite-icon,.number-button-item.number-button-item--horizontal[data-adjustment=up] calcite-icon{transform:rotate(90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down]{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);border-inline-end-width:0px}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover{background-color:var(--calcite-ui-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover calcite-icon{color:var(--calcite-ui-text-1)}.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:5}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover{background-color:var(--calcite-ui-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover{background-color:var(--calcite-ui-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover{background-color:var(--calcite-ui-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]{border-block-start-width:0px}.number-button-item{max-block-size:50%;min-block-size:50%;pointer-events:initial;margin:0px;box-sizing:border-box;display:flex;cursor:pointer;align-items:center;align-self:center;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);padding-block:0px;padding-inline:0.5rem;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-inline-start-width:0px}.number-button-item calcite-icon{pointer-events:none;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.number-button-item:focus{background-color:var(--calcite-ui-foreground-2)}.number-button-item:focus calcite-icon{color:var(--calcite-ui-text-1)}.number-button-item:active{background-color:var(--calcite-ui-foreground-3)}.number-button-item:disabled{pointer-events:none}.wrapper{position:relative;display:flex;flex-direction:row;align-items:center}:host input::-webkit-calendar-picker-indicator{display:none}:host input[type=date]::-webkit-input-placeholder{visibility:hidden !important}:host textarea::-webkit-resizer{position:absolute;inset-block-end:0px;box-sizing:border-box;padding-block:0px;padding-inline:0.25rem;inset-inline-end:0}.resize-icon-wrapper{inset-block-end:2px;inset-inline-end:2px;pointer-events:none;position:absolute;block-size:0.75rem;inline-size:0.75rem;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-3)}.resize-icon-wrapper calcite-icon{inset-block-end:0.25rem;inset-inline-end:0.25rem;transform:rotate(-45deg)}.calcite--rtl .resize-icon-wrapper calcite-icon{transform:rotate(45deg)}:host([type=color]) input{padding:0.25rem}:host([type=file]) input{cursor:pointer;border-width:1px;border-style:dashed;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);text-align:center}:host([type=file][scale=s]) input{padding-block:1px;padding-inline:0.5rem}:host([type=file][scale=m]) input{padding-block:0.25rem;padding-inline:0.75rem}:host([type=file][scale=l]) input{padding-block:0.5rem;padding-inline:1rem}:host(.no-bottom-border) input{border-block-end-width:0px}:host(.border-top-color-one) input{border-block-start-color:var(--calcite-ui-border-1)}:host .inline-child{background-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host .inline-child .editing-enabled{background-color:inherit}:host .inline-child:not(.editing-enabled){display:flex;cursor:pointer;text-overflow:ellipsis;border-color:transparent;padding-inline-start:0}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}",vWi=h0(class extends d0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalInputFocus=Wh(this,"calciteInternalInputFocus",6),this.calciteInternalInputBlur=Wh(this,"calciteInternalInputBlur",6),this.calciteInputInput=Wh(this,"calciteInputInput",7),this.calciteInputChange=Wh(this,"calciteInputChange",6),this.childElType="input",this.previousValueOrigin="initial",this.mutationObserver=aF("mutation",()=>this.setDisabledAction()),this.userChangedValue=!1,this.keyDownHandler=t=>{this.readOnly||this.disabled||(this.isClearable&&t.key==="Escape"&&(this.clearInputValue(t),t.preventDefault()),t.key==="Enter"&&!t.defaultPrevented&&iWi(this)&&t.preventDefault())},this.clearInputValue=t=>{this.setValue({committing:!0,nativeEvent:t,origin:"user",value:""})},this.emitChangeIfUserModified=()=>{this.previousValueOrigin==="user"&&this.value!==this.previousEmittedValue&&(this.calciteInputChange.emit(),this.setPreviousEmittedValue(this.value))},this.inputBlurHandler=()=>{this.calciteInternalInputBlur.emit(),this.emitChangeIfUserModified()},this.clickHandler=t=>{const e=FEe(this.el,"action");t.target!==e&&this.setFocus()},this.inputFocusHandler=()=>{this.calciteInternalInputFocus.emit()},this.inputInputHandler=t=>{this.disabled||this.readOnly||this.setValue({nativeEvent:t,origin:"user",value:t.target.value})},this.inputKeyDownHandler=t=>{this.disabled||this.readOnly||t.key==="Enter"&&this.emitChangeIfUserModified()},this.inputNumberInputHandler=t=>{if(this.disabled||this.readOnly)return;const e=t.target.value;uO.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator};const i=uO.delocalize(e);t.inputType==="insertFromPaste"?(EE(i)||t.preventDefault(),this.setValue({nativeEvent:t,origin:"user",value:BHi(i)}),this.childNumberEl.value=this.localizedValue):this.setValue({nativeEvent:t,origin:"user",value:i})},this.inputNumberKeyDownHandler=t=>{if(this.type!=="number"||this.disabled||this.readOnly)return;if(t.key==="ArrowUp"){t.preventDefault(),this.nudgeNumberValue("up",t);return}if(t.key==="ArrowDown"){this.nudgeNumberValue("down",t);return}const e=[...aLe,"ArrowLeft","ArrowRight","Backspace","Delete","Enter","Escape","Tab"];if(t.altKey||t.ctrlKey||t.metaKey)return;const i=t.shiftKey&&t.key==="Tab";if(e.includes(t.key)&&(!t.shiftKey||i)){t.key==="Enter"&&this.emitChangeIfUserModified();return}uO.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},!(t.key===uO.decimal&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.indexOf(uO.decimal)===-1))&&(/[eE]/.test(t.key)&&(!this.value&&!this.childNumberEl.value||this.value&&!/[eE]/.test(this.childNumberEl.value))||t.key==="-"&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.split("-").length<=2)||t.preventDefault())},this.nudgeNumberValue=(t,e)=>{if(e instanceof KeyboardEvent&&e.repeat||this.type!=="number")return;const i=this.maxString?parseFloat(this.maxString):null,r=this.minString?parseFloat(this.minString):null,n=150;this.incrementOrDecrementNumberValue(t,i,r,e),this.nudgeNumberValueIntervalId&&window.clearInterval(this.nudgeNumberValueIntervalId);let s=!0;this.nudgeNumberValueIntervalId=window.setInterval(()=>{if(s){s=!1;return}this.incrementOrDecrementNumberValue(t,i,r,e)},n)},this.numberButtonPointerUpAndOutHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.numberButtonPointerDownHandler=t=>{if(!NY(t))return;t.preventDefault();const e=t.target.dataset.adjustment;this.disabled||this.nudgeNumberValue(e,t)},this.hiddenInputChangeHandler=t=>{t.target.name===this.name&&this.setValue({value:t.target.value,origin:"direct"}),t.stopPropagation()},this.setChildElRef=t=>{this.childEl=t},this.setChildNumberElRef=t=>{this.childNumberEl=t},this.setInputValue=t=>{this.type==="text"&&!this.childEl||this.type==="number"&&!this.childNumberEl||(this[`child${this.type==="number"?"Number":""}El`].value=t)},this.setPreviousEmittedValue=t=>{this.previousEmittedValue=this.normalizeValue(t)},this.setPreviousValue=t=>{this.previousValue=this.normalizeValue(t)},this.setValue=({committing:t=!1,nativeEvent:e,origin:i,previousValue:r,value:n})=>{if(this.setPreviousValue(r??this.value),this.previousValueOrigin=i,this.type==="number"){uO.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator,signDisplay:"never"};const s=zHi(this.numberingSystem&&this.numberingSystem!=="latn"||uLe!=="latn"?uO.delocalize(n):n),o=n&&!s?EE(this.previousValue)?this.previousValue:"":s,a=uO.localize(o);this.localizedValue=a,this.userChangedValue=i==="user"&&this.value!==o,this.value=["-","."].includes(o)?"":o}else this.userChangedValue=i==="user"&&this.value!==n,this.value=n;i==="direct"&&(this.setInputValue(n),this.previousEmittedValue=n),e&&(this.calciteInputInput.emit().defaultPrevented?(this.value=this.previousValue,this.localizedValue=this.type==="number"?uO.localize(this.previousValue):this.previousValue):t&&this.emitChangeIfUserModified())},this.inputKeyUpHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.alignment="start",this.autofocus=!1,this.clearable=!1,this.disabled=!1,this.groupSeparator=!1,this.hidden=!1,this.icon=void 0,this.iconFlipRtl=!1,this.label=void 0,this.loading=!1,this.numberingSystem=void 0,this.localeFormat=!1,this.max=void 0,this.min=void 0,this.maxLength=void 0,this.minLength=void 0,this.name=void 0,this.numberButtonType="vertical",this.placeholder=void 0,this.prefixText=void 0,this.readOnly=!1,this.required=!1,this.scale="m",this.status="idle",this.step=void 0,this.autocomplete=void 0,this.pattern=void 0,this.accept=void 0,this.multiple=!1,this.inputMode="text",this.enterKeyHint=void 0,this.suffixText=void 0,this.editingEnabled=!1,this.type="text",this.value="",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0,this.localizedValue=void 0,this.slottedActionElDisabledInternally=!1}disabledWatcher(){this.setDisabledAction()}maxWatcher(){this.maxString=this.max?.toString()||null}minWatcher(){this.minString=this.min?.toString()||null}onMessagesChange(){}valueWatcher(t,e){this.userChangedValue||(this.setValue({origin:"direct",previousValue:e,value:t==null||t==""?"":this.type==="number"?EE(t)?t:this.previousValue||"":t}),this.warnAboutInvalidNumberValue(t)),this.userChangedValue=!1}updateRequestedIcon(){this.requestedIcon=mle(_2t,this.icon,this.type)}get isClearable(){return!this.isTextarea&&(this.clearable||this.type==="search")&&this.value.length>0}get isTextarea(){return this.childElType==="textarea"}effectiveLocaleChange(){dF(this,this.effectiveLocale)}connectedCallback(){uF(this),pF(this),this.scale=bet(this.el,"scale",this.scale),this.status=bet(this.el,"status",this.status),this.inlineEditableEl=this.el.closest("calcite-inline-editable"),this.inlineEditableEl&&(this.editingEnabled=this.inlineEditableEl.editingEnabled||!1),g2t(this),rWi(this),this.setPreviousEmittedValue(this.value),this.setPreviousValue(this.value),this.type==="number"&&(this.warnAboutInvalidNumberValue(this.value),this.setValue({origin:"connected",value:EE(this.value)?this.value:""})),this.mutationObserver?.observe(this.el,{childList:!0}),this.setDisabledAction(),this.el.addEventListener("calciteInternalHiddenInputChange",this.hiddenInputChangeHandler)}disconnectedCallback(){cWi(this),sWi(this),cF(this),fF(this),this.mutationObserver?.disconnect(),this.el.removeEventListener("calciteInternalHiddenInputChange",this.hiddenInputChangeHandler)}async componentWillLoad(){SE(this),this.childElType=this.type==="textarea"?"textarea":"input",this.maxString=this.max?.toString(),this.minString=this.min?.toString(),this.requestedIcon=mle(_2t,this.icon,this.type),await hF(this)}componentDidLoad(){CE(this)}componentShouldUpdate(t,e,i){return this.type==="number"&&i==="value"&&t&&!EE(t)?(this.setValue({origin:"reset",value:e}),!1):!0}componentDidRender(){f6(this)}async setFocus(){await TE(this),this.type==="number"?this.childNumberEl?.focus():this.childEl?.focus()}async selectText(){this.type==="number"?this.childNumberEl?.select():this.childEl?.select()}async internalSyncChildElValue(){this.type==="number"?this.childNumberEl.value=this.value:this.childEl.value=this.value}onLabelClick(){this.setFocus()}incrementOrDecrementNumberValue(t,e,i,r){const{value:n}=this,s=this.step==="any"?1:Math.abs(this.step||1),o=n&&n!==""?parseFloat(n):0,l=o+s*(t==="up"?1:-1),c=typeof i=="number"&&!isNaN(i)&&le?e:l,d=v2t(o),p=v2t(s);this.setValue({committing:!0,nativeEvent:r,origin:"user",value:c.toFixed(Math.max(d,p))})}onFormReset(){this.setValue({origin:"reset",value:this.defaultValue})}syncHiddenFormInput(t){const{type:e}=this;t.type=e,e==="number"?(t.min=this.min?.toString(10)??"",t.max=this.max?.toString(10)??""):e==="text"&&(this.minLength!=null&&(t.minLength=this.minLength),this.maxLength!=null&&(t.maxLength=this.maxLength))}setDisabledAction(){const t=FEe(this.el,"action");t&&(this.disabled?(t.getAttribute("disabled")==null&&(this.slottedActionElDisabledInternally=!0),t.setAttribute("disabled","")):this.slottedActionElDisabledInternally&&(t.removeAttribute("disabled"),this.slottedActionElDisabledInternally=!1))}normalizeValue(t){return this.type==="number"?EE(t)?t:"":t}warnAboutInvalidNumberValue(t){this.type==="number"&&t&&!EE(t)&&console.warn(`The specified value "${t}" cannot be parsed, or is out of range.`)}render(){const t=FY(this.el),e=dr("div",{class:x0.loader},dr("calcite-progress",{label:this.messages.loading,type:"indeterminate"})),i=dr("button",{"aria-label":this.messages.clear,class:x0.clearButton,disabled:this.disabled||this.readOnly,onClick:this.clearInputValue,tabIndex:-1,type:"button"},dr("calcite-icon",{icon:"x",scale:this.scale==="l"?"m":"s"})),r=dr("calcite-icon",{class:x0.inputIcon,flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:this.scale==="l"?"m":"s"}),n=this.numberButtonType==="horizontal",s=dr("button",{"aria-hidden":"true",class:{[x0.numberButtonItem]:!0,[x0.buttonItemHorizontal]:n},"data-adjustment":"up",disabled:this.disabled||this.readOnly,onPointerDown:this.numberButtonPointerDownHandler,onPointerOut:this.numberButtonPointerUpAndOutHandler,onPointerUp:this.numberButtonPointerUpAndOutHandler,tabIndex:-1,type:"button"},dr("calcite-icon",{icon:"chevron-up",scale:this.scale==="l"?"m":"s"})),o=dr("button",{"aria-hidden":"true",class:{[x0.numberButtonItem]:!0,[x0.buttonItemHorizontal]:n},"data-adjustment":"down",disabled:this.disabled||this.readOnly,onPointerDown:this.numberButtonPointerDownHandler,onPointerOut:this.numberButtonPointerUpAndOutHandler,onPointerUp:this.numberButtonPointerUpAndOutHandler,tabIndex:-1,type:"button"},dr("calcite-icon",{icon:"chevron-down",scale:this.scale==="l"?"m":"s"})),a=dr("div",{class:x0.numberButtonWrapper},s,o),l=dr("div",{class:x0.prefix},this.prefixText),c=dr("div",{class:x0.suffix},this.suffixText),d=this.type==="number"?dr("input",{accept:this.accept,"aria-label":y2t(this),autocomplete:this.autocomplete,autofocus:this.autofocus?!0:null,defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:this.enterKeyHint,inputMode:this.inputMode,key:"localized-input",maxLength:this.maxLength,minLength:this.minLength,multiple:this.multiple,name:void 0,onBlur:this.inputBlurHandler,onFocus:this.inputFocusHandler,onInput:this.inputNumberInputHandler,onKeyDown:this.inputNumberKeyDownHandler,onKeyUp:this.inputKeyUpHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,ref:this.setChildNumberElRef,type:"text",value:this.localizedValue}):null,p=this.type!=="number"?[dr(this.childElType,{accept:this.accept,"aria-label":y2t(this),autocomplete:this.autocomplete,autofocus:this.autofocus?!0:null,class:{[x0.editingEnabled]:this.editingEnabled,[x0.inlineChild]:!!this.inlineEditableEl},defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:this.enterKeyHint,inputMode:this.inputMode,max:this.maxString,maxLength:this.maxLength,min:this.minString,minLength:this.minLength,multiple:this.multiple,name:this.name,onBlur:this.inputBlurHandler,onFocus:this.inputFocusHandler,onInput:this.inputInputHandler,onKeyDown:this.inputKeyDownHandler,onKeyUp:this.inputKeyUpHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,ref:this.setChildElRef,required:this.required?!0:null,step:this.step,tabIndex:this.disabled||this.inlineEditableEl&&!this.editingEnabled?-1:null,type:this.type,value:this.value}),this.isTextarea?dr("div",{class:x0.resizeIconWrapper},dr("calcite-icon",{icon:"chevron-down",scale:this.scale==="l"?"m":"s"})):null]:null;return dr(YA,{onClick:this.clickHandler,onKeyDown:this.keyDownHandler},dr("div",{class:{[x0.inputWrapper]:!0,[rii.rtl]:t==="rtl"}},this.type==="number"&&this.numberButtonType==="horizontal"&&!this.readOnly?o:null,this.prefixText?l:null,dr("div",{class:x0.wrapper},d,p,this.isClearable?i:null,this.requestedIcon?r:null,this.loading?e:null),dr("div",{class:x0.actionWrapper},dr("slot",{name:gWi.action})),this.type==="number"&&this.numberButtonType==="vertical"&&!this.readOnly?a:null,this.suffixText?c:null,this.type==="number"&&this.numberButtonType==="horizontal"&&!this.readOnly?s:null,dr(aWi,{component:this})))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{disabled:["disabledWatcher"],max:["maxWatcher"],min:["minWatcher"],messageOverrides:["onMessagesChange"],value:["valueWatcher"],icon:["updateRequestedIcon"],type:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return yWi}},[1,"calcite-input",{alignment:[513],autofocus:[516],clearable:[516],disabled:[516],groupSeparator:[516,"group-separator"],hidden:[516],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],label:[1],loading:[516],numberingSystem:[513,"numbering-system"],localeFormat:[4,"locale-format"],max:[514],min:[514],maxLength:[514,"max-length"],minLength:[514,"min-length"],name:[513],numberButtonType:[513,"number-button-type"],placeholder:[1],prefixText:[1,"prefix-text"],readOnly:[516,"read-only"],required:[516],scale:[1537],status:[1537],step:[520],autocomplete:[1],pattern:[1],accept:[1],multiple:[4],inputMode:[1,"input-mode"],enterKeyHint:[1,"enter-key-hint"],suffixText:[1,"suffix-text"],editingEnabled:[1540,"editing-enabled"],type:[513],value:[1025],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],localizedValue:[32],slottedActionElDisabledInternally:[32],setFocus:[64],selectText:[64],internalSyncChildElValue:[64]}]);function yLe(){if(typeof customElements>"u")return;["calcite-input","calcite-icon","calcite-progress"].forEach(e=>{switch(e){case"calcite-input":customElements.get(e)||customElements.define(e,vWi);break;case"calcite-icon":customElements.get(e)||ox();break;case"calcite-progress":customElements.get(e)||Bfe();break}})}yLe();/*! + */const T0={loader:"loader",clearButton:"clear-button",editingEnabled:"editing-enabled",inlineChild:"inline-child",inputIcon:"icon",prefix:"prefix",suffix:"suffix",numberButtonWrapper:"number-button-wrapper",buttonItemHorizontal:"number-button-item--horizontal",wrapper:"element-wrapper",inputWrapper:"wrapper",actionWrapper:"action-wrapper",resizeIconWrapper:"resize-icon-wrapper",numberButtonItem:"number-button-item"},oSt={tel:"phone",password:"lock",email:"email-address",date:"calendar",time:"clock",search:"search"},bqi={action:"action"},wqi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{display:block}:host([scale=s]) input,:host([scale=s]) .prefix,:host([scale=s]) .suffix{block-size:1.5rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) textarea{block-size:1.5rem;min-block-size:1.5rem}:host([scale=s]) .number-button-wrapper,:host([scale=s]) .action-wrapper calcite-button,:host([scale=s]) .action-wrapper calcite-button button{block-size:1.5rem}:host([scale=s]) input[type=file]{block-size:1.5rem}:host([scale=s]) .clear-button{min-block-size:1.5rem;min-inline-size:1.5rem}:host([scale=s]) textarea{block-size:auto;padding-block:0.25rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]) input,:host([scale=m]) .prefix,:host([scale=m]) .suffix{block-size:2rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) textarea{min-block-size:2rem}:host([scale=m]) .number-button-wrapper,:host([scale=m]) .action-wrapper calcite-button,:host([scale=m]) .action-wrapper calcite-button button{block-size:2rem}:host([scale=m]) input[type=file]{block-size:2rem}:host([scale=m]) .clear-button{min-block-size:2rem;min-inline-size:2rem}:host([scale=m]) textarea{block-size:auto;padding-block:0.5rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) input,:host([scale=l]) .prefix,:host([scale=l]) .suffix{block-size:2.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) textarea{min-block-size:2.75rem}:host([scale=l]) .number-button-wrapper,:host([scale=l]) .action-wrapper calcite-button,:host([scale=l]) .action-wrapper calcite-button button{block-size:2.75rem}:host([scale=l]) input[type=file]{block-size:2.75rem}:host([scale=l]) .clear-button{min-block-size:2.75rem;min-inline-size:2.75rem}:host([scale=l]) textarea{block-size:auto;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([disabled]) textarea{resize:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host textarea,:host input{transition:var(--calcite-animation-timing), block-size 0, outline-offset 0s;-webkit-appearance:none;position:relative;margin:0px;box-sizing:border-box;display:flex;max-block-size:100%;inline-size:100%;max-inline-size:100%;flex:1 1 0%;border-radius:0px;background-color:var(--calcite-ui-foreground-1);font-family:inherit;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-1)}:host input[type=search]::-webkit-search-decoration{-webkit-appearance:none}:host input,:host textarea{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);color:var(--calcite-ui-text-1)}:host input::placeholder,:host input:-ms-input-placeholder,:host input::-ms-input-placeholder,:host textarea::placeholder,:host textarea:-ms-input-placeholder,:host textarea::-ms-input-placeholder{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}:host input:focus,:host textarea:focus{border-color:var(--calcite-ui-brand);color:var(--calcite-ui-text-1)}:host input[readonly],:host textarea[readonly]{background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium)}:host input[readonly]:focus,:host textarea[readonly]:focus{color:var(--calcite-ui-text-1)}:host calcite-icon{color:var(--calcite-ui-text-3)}:host textarea,:host input{outline-color:transparent}:host textarea:focus,:host input:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host([status=invalid]) input,:host([status=invalid]) textarea{border-color:var(--calcite-ui-danger)}:host([status=invalid]) input:focus,:host([status=invalid]) textarea:focus{outline:2px solid var(--calcite-ui-danger);outline-offset:-2px}:host([scale=s]) .icon{inset-inline-start:0.5rem}:host([scale=m]) .icon{inset-inline-start:0.75rem}:host([scale=l]) .icon{inset-inline-start:1rem}:host([icon][scale=s]) input{padding-inline-start:2rem}:host([icon][scale=m]) input{padding-inline-start:2.5rem}:host([icon][scale=l]) input{padding-inline-start:3.5rem}.element-wrapper{position:relative;order:3;display:inline-flex;flex:1 1 0%;align-items:center}.icon{pointer-events:none;position:absolute;display:block;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.icon,.resize-icon-wrapper{z-index:1}input[type=text]::-ms-clear,input[type=text]::-ms-reveal{display:none;block-size:0px;inline-size:0px}input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration,input[type=date]::-webkit-clear-button,input[type=time]::-webkit-clear-button{display:none}.clear-button{pointer-events:initial;order:4;margin:0px;box-sizing:border-box;display:flex;min-block-size:100%;cursor:pointer;align-items:center;justify-content:center;align-self:stretch;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);outline-color:transparent;border-inline-start-width:0px}.clear-button:hover{background-color:var(--calcite-ui-foreground-2);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:hover calcite-icon{color:var(--calcite-ui-text-1);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:active{background-color:var(--calcite-ui-foreground-3)}.clear-button:active calcite-icon{color:var(--calcite-ui-text-1)}.clear-button:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}.clear-button:disabled{opacity:var(--calcite-ui-opacity-disabled)}.loader{inset-block-start:1px;inset-inline:1px;pointer-events:none;position:absolute;display:block}.action-wrapper{order:7;display:flex}.prefix,.suffix{box-sizing:border-box;display:flex;block-size:auto;min-block-size:100%;-webkit-user-select:none;user-select:none;align-content:center;align-items:center;overflow-wrap:break-word;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium);line-height:1;color:var(--calcite-ui-text-2)}.prefix{order:2;border-inline-end-width:0px}.suffix{order:5;border-inline-start-width:0px}:host([alignment=start]) textarea,:host([alignment=start]) input{text-align:start}:host([alignment=end]) textarea,:host([alignment=end]) input{text-align:end}:host input[type=number]{-moz-appearance:textfield}:host input[type=number]::-webkit-inner-spin-button,:host input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:textfield;margin:0px}.number-button-wrapper{pointer-events:none;order:6;box-sizing:border-box;display:flex;flex-direction:column;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([number-button-type=vertical]) .wrapper{flex-direction:row;display:flex}:host([number-button-type=vertical]) input,:host([number-button-type=vertical]) textarea{order:2}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=down] calcite-icon{transform:rotate(-90deg)}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=up] calcite-icon{transform:rotate(-90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down],.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:1;max-block-size:100%;min-block-size:100%;align-self:stretch}.number-button-item.number-button-item--horizontal[data-adjustment=down] calcite-icon,.number-button-item.number-button-item--horizontal[data-adjustment=up] calcite-icon{transform:rotate(90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down]{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);border-inline-end-width:0px}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover{background-color:var(--calcite-ui-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover calcite-icon{color:var(--calcite-ui-text-1)}.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:5}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover{background-color:var(--calcite-ui-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover{background-color:var(--calcite-ui-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover{background-color:var(--calcite-ui-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]{border-block-start-width:0px}.number-button-item{max-block-size:50%;min-block-size:50%;pointer-events:initial;margin:0px;box-sizing:border-box;display:flex;cursor:pointer;align-items:center;align-self:center;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);padding-block:0px;padding-inline:0.5rem;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-inline-start-width:0px}.number-button-item calcite-icon{pointer-events:none;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.number-button-item:focus{background-color:var(--calcite-ui-foreground-2)}.number-button-item:focus calcite-icon{color:var(--calcite-ui-text-1)}.number-button-item:active{background-color:var(--calcite-ui-foreground-3)}.number-button-item:disabled{pointer-events:none}.wrapper{position:relative;display:flex;flex-direction:row;align-items:center}:host input::-webkit-calendar-picker-indicator{display:none}:host input[type=date]::-webkit-input-placeholder{visibility:hidden !important}:host textarea::-webkit-resizer{position:absolute;inset-block-end:0px;box-sizing:border-box;padding-block:0px;padding-inline:0.25rem;inset-inline-end:0}.resize-icon-wrapper{inset-block-end:2px;inset-inline-end:2px;pointer-events:none;position:absolute;block-size:0.75rem;inline-size:0.75rem;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-3)}.resize-icon-wrapper calcite-icon{inset-block-end:0.25rem;inset-inline-end:0.25rem;transform:rotate(-45deg)}.calcite--rtl .resize-icon-wrapper calcite-icon{transform:rotate(45deg)}:host([type=color]) input{padding:0.25rem}:host([type=file]) input{cursor:pointer;border-width:1px;border-style:dashed;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);text-align:center}:host([type=file][scale=s]) input{padding-block:1px;padding-inline:0.5rem}:host([type=file][scale=m]) input{padding-block:0.25rem;padding-inline:0.75rem}:host([type=file][scale=l]) input{padding-block:0.5rem;padding-inline:1rem}:host(.no-bottom-border) input{border-block-end-width:0px}:host(.border-top-color-one) input{border-block-start-color:var(--calcite-ui-border-1)}:host .inline-child{background-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host .inline-child .editing-enabled{background-color:inherit}:host .inline-child:not(.editing-enabled){display:flex;cursor:pointer;text-overflow:ellipsis;border-color:transparent;padding-inline-start:0}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}",xqi=d0(class extends p0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalInputFocus=Xh(this,"calciteInternalInputFocus",6),this.calciteInternalInputBlur=Xh(this,"calciteInternalInputBlur",6),this.calciteInputInput=Xh(this,"calciteInputInput",7),this.calciteInputChange=Xh(this,"calciteInputChange",6),this.childElType="input",this.previousValueOrigin="initial",this.mutationObserver=cF("mutation",()=>this.setDisabledAction()),this.userChangedValue=!1,this.keyDownHandler=t=>{this.readOnly||this.disabled||(this.isClearable&&t.key==="Escape"&&(this.clearInputValue(t),t.preventDefault()),t.key==="Enter"&&!t.defaultPrevented&&oqi(this)&&t.preventDefault())},this.clearInputValue=t=>{this.setValue({committing:!0,nativeEvent:t,origin:"user",value:""})},this.emitChangeIfUserModified=()=>{this.previousValueOrigin==="user"&&this.value!==this.previousEmittedValue&&(this.calciteInputChange.emit(),this.setPreviousEmittedValue(this.value))},this.inputBlurHandler=()=>{this.calciteInternalInputBlur.emit(),this.emitChangeIfUserModified()},this.clickHandler=t=>{const e=$Ee(this.el,"action");t.target!==e&&this.setFocus()},this.inputFocusHandler=()=>{this.calciteInternalInputFocus.emit()},this.inputInputHandler=t=>{this.disabled||this.readOnly||this.setValue({nativeEvent:t,origin:"user",value:t.target.value})},this.inputKeyDownHandler=t=>{this.disabled||this.readOnly||t.key==="Enter"&&this.emitChangeIfUserModified()},this.inputNumberInputHandler=t=>{if(this.disabled||this.readOnly)return;const e=t.target.value;dO.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator};const i=dO.delocalize(e);t.inputType==="insertFromPaste"?(AE(i)||t.preventDefault(),this.setValue({nativeEvent:t,origin:"user",value:UWi(i)}),this.childNumberEl.value=this.localizedValue):this.setValue({nativeEvent:t,origin:"user",value:i})},this.inputNumberKeyDownHandler=t=>{if(this.type!=="number"||this.disabled||this.readOnly)return;if(t.key==="ArrowUp"){t.preventDefault(),this.nudgeNumberValue("up",t);return}if(t.key==="ArrowDown"){this.nudgeNumberValue("down",t);return}const e=[...PLe,"ArrowLeft","ArrowRight","Backspace","Delete","Enter","Escape","Tab"];if(t.altKey||t.ctrlKey||t.metaKey)return;const i=t.shiftKey&&t.key==="Tab";if(e.includes(t.key)&&(!t.shiftKey||i)){t.key==="Enter"&&this.emitChangeIfUserModified();return}dO.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},!(t.key===dO.decimal&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.indexOf(dO.decimal)===-1))&&(/[eE]/.test(t.key)&&(!this.value&&!this.childNumberEl.value||this.value&&!/[eE]/.test(this.childNumberEl.value))||t.key==="-"&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.split("-").length<=2)||t.preventDefault())},this.nudgeNumberValue=(t,e)=>{if(e instanceof KeyboardEvent&&e.repeat||this.type!=="number")return;const i=this.maxString?parseFloat(this.maxString):null,r=this.minString?parseFloat(this.minString):null,n=150;this.incrementOrDecrementNumberValue(t,i,r,e),this.nudgeNumberValueIntervalId&&window.clearInterval(this.nudgeNumberValueIntervalId);let s=!0;this.nudgeNumberValueIntervalId=window.setInterval(()=>{if(s){s=!1;return}this.incrementOrDecrementNumberValue(t,i,r,e)},n)},this.numberButtonPointerUpAndOutHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.numberButtonPointerDownHandler=t=>{if(!kY(t))return;t.preventDefault();const e=t.target.dataset.adjustment;this.disabled||this.nudgeNumberValue(e,t)},this.hiddenInputChangeHandler=t=>{t.target.name===this.name&&this.setValue({value:t.target.value,origin:"direct"}),t.stopPropagation()},this.setChildElRef=t=>{this.childEl=t},this.setChildNumberElRef=t=>{this.childNumberEl=t},this.setInputValue=t=>{this.type==="text"&&!this.childEl||this.type==="number"&&!this.childNumberEl||(this[`child${this.type==="number"?"Number":""}El`].value=t)},this.setPreviousEmittedValue=t=>{this.previousEmittedValue=this.normalizeValue(t)},this.setPreviousValue=t=>{this.previousValue=this.normalizeValue(t)},this.setValue=({committing:t=!1,nativeEvent:e,origin:i,previousValue:r,value:n})=>{if(this.setPreviousValue(r??this.value),this.previousValueOrigin=i,this.type==="number"){dO.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator,signDisplay:"never"};const s=YWi(this.numberingSystem&&this.numberingSystem!=="latn"||RLe!=="latn"?dO.delocalize(n):n),o=n&&!s?AE(this.previousValue)?this.previousValue:"":s,a=dO.localize(o);this.localizedValue=a,this.userChangedValue=i==="user"&&this.value!==o,this.value=["-","."].includes(o)?"":o}else this.userChangedValue=i==="user"&&this.value!==n,this.value=n;i==="direct"&&(this.setInputValue(n),this.previousEmittedValue=n),e&&(this.calciteInputInput.emit().defaultPrevented?(this.value=this.previousValue,this.localizedValue=this.type==="number"?dO.localize(this.previousValue):this.previousValue):t&&this.emitChangeIfUserModified())},this.inputKeyUpHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.alignment="start",this.autofocus=!1,this.clearable=!1,this.disabled=!1,this.groupSeparator=!1,this.hidden=!1,this.icon=void 0,this.iconFlipRtl=!1,this.label=void 0,this.loading=!1,this.numberingSystem=void 0,this.localeFormat=!1,this.max=void 0,this.min=void 0,this.maxLength=void 0,this.minLength=void 0,this.name=void 0,this.numberButtonType="vertical",this.placeholder=void 0,this.prefixText=void 0,this.readOnly=!1,this.required=!1,this.scale="m",this.status="idle",this.step=void 0,this.autocomplete=void 0,this.pattern=void 0,this.accept=void 0,this.multiple=!1,this.inputMode="text",this.enterKeyHint=void 0,this.suffixText=void 0,this.editingEnabled=!1,this.type="text",this.value="",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0,this.localizedValue=void 0,this.slottedActionElDisabledInternally=!1}disabledWatcher(){this.setDisabledAction()}maxWatcher(){this.maxString=this.max?.toString()||null}minWatcher(){this.minString=this.min?.toString()||null}onMessagesChange(){}valueWatcher(t,e){this.userChangedValue||(this.setValue({origin:"direct",previousValue:e,value:t==null||t==""?"":this.type==="number"?AE(t)?t:this.previousValue||"":t}),this.warnAboutInvalidNumberValue(t)),this.userChangedValue=!1}updateRequestedIcon(){this.requestedIcon=dle(oSt,this.icon,this.type)}get isClearable(){return!this.isTextarea&&(this.clearable||this.type==="search")&&this.value.length>0}get isTextarea(){return this.childElType==="textarea"}effectiveLocaleChange(){mF(this,this.effectiveLocale)}connectedCallback(){dF(this),gF(this),this.scale=Cet(this.el,"scale",this.scale),this.status=Cet(this.el,"status",this.status),this.inlineEditableEl=this.el.closest("calcite-inline-editable"),this.inlineEditableEl&&(this.editingEnabled=this.inlineEditableEl.editingEnabled||!1),rSt(this),aqi(this),this.setPreviousEmittedValue(this.value),this.setPreviousValue(this.value),this.type==="number"&&(this.warnAboutInvalidNumberValue(this.value),this.setValue({origin:"connected",value:AE(this.value)?this.value:""})),this.mutationObserver?.observe(this.el,{childList:!0}),this.setDisabledAction(),this.el.addEventListener("calciteInternalHiddenInputChange",this.hiddenInputChangeHandler)}disconnectedCallback(){fqi(this),uqi(this),pF(this),yF(this),this.mutationObserver?.disconnect(),this.el.removeEventListener("calciteInternalHiddenInputChange",this.hiddenInputChangeHandler)}async componentWillLoad(){TE(this),this.childElType=this.type==="textarea"?"textarea":"input",this.maxString=this.max?.toString(),this.minString=this.min?.toString(),this.requestedIcon=dle(oSt,this.icon,this.type),await fF(this)}componentDidLoad(){EE(this)}componentShouldUpdate(t,e,i){return this.type==="number"&&i==="value"&&t&&!AE(t)?(this.setValue({origin:"reset",value:e}),!1):!0}componentDidRender(){g6(this)}async setFocus(){await IE(this),this.type==="number"?this.childNumberEl?.focus():this.childEl?.focus()}async selectText(){this.type==="number"?this.childNumberEl?.select():this.childEl?.select()}async internalSyncChildElValue(){this.type==="number"?this.childNumberEl.value=this.value:this.childEl.value=this.value}onLabelClick(){this.setFocus()}incrementOrDecrementNumberValue(t,e,i,r){const{value:n}=this,s=this.step==="any"?1:Math.abs(this.step||1),o=n&&n!==""?parseFloat(n):0,l=o+s*(t==="up"?1:-1),c=typeof i=="number"&&!isNaN(i)&&le?e:l,h=sSt(o),p=sSt(s);this.setValue({committing:!0,nativeEvent:r,origin:"user",value:c.toFixed(Math.max(h,p))})}onFormReset(){this.setValue({origin:"reset",value:this.defaultValue})}syncHiddenFormInput(t){const{type:e}=this;t.type=e,e==="number"?(t.min=this.min?.toString(10)??"",t.max=this.max?.toString(10)??""):e==="text"&&(this.minLength!=null&&(t.minLength=this.minLength),this.maxLength!=null&&(t.maxLength=this.maxLength))}setDisabledAction(){const t=$Ee(this.el,"action");t&&(this.disabled?(t.getAttribute("disabled")==null&&(this.slottedActionElDisabledInternally=!0),t.setAttribute("disabled","")):this.slottedActionElDisabledInternally&&(t.removeAttribute("disabled"),this.slottedActionElDisabledInternally=!1))}normalizeValue(t){return this.type==="number"?AE(t)?t:"":t}warnAboutInvalidNumberValue(t){this.type==="number"&&t&&!AE(t)&&console.warn(`The specified value "${t}" cannot be parsed, or is out of range.`)}render(){const t=FY(this.el),e=br("div",{class:T0.loader},br("calcite-progress",{label:this.messages.loading,type:"indeterminate"})),i=br("button",{"aria-label":this.messages.clear,class:T0.clearButton,disabled:this.disabled||this.readOnly,onClick:this.clearInputValue,tabIndex:-1,type:"button"},br("calcite-icon",{icon:"x",scale:this.scale==="l"?"m":"s"})),r=br("calcite-icon",{class:T0.inputIcon,flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:this.scale==="l"?"m":"s"}),n=this.numberButtonType==="horizontal",s=br("button",{"aria-hidden":"true",class:{[T0.numberButtonItem]:!0,[T0.buttonItemHorizontal]:n},"data-adjustment":"up",disabled:this.disabled||this.readOnly,onPointerDown:this.numberButtonPointerDownHandler,onPointerOut:this.numberButtonPointerUpAndOutHandler,onPointerUp:this.numberButtonPointerUpAndOutHandler,tabIndex:-1,type:"button"},br("calcite-icon",{icon:"chevron-up",scale:this.scale==="l"?"m":"s"})),o=br("button",{"aria-hidden":"true",class:{[T0.numberButtonItem]:!0,[T0.buttonItemHorizontal]:n},"data-adjustment":"down",disabled:this.disabled||this.readOnly,onPointerDown:this.numberButtonPointerDownHandler,onPointerOut:this.numberButtonPointerUpAndOutHandler,onPointerUp:this.numberButtonPointerUpAndOutHandler,tabIndex:-1,type:"button"},br("calcite-icon",{icon:"chevron-down",scale:this.scale==="l"?"m":"s"})),a=br("div",{class:T0.numberButtonWrapper},s,o),l=br("div",{class:T0.prefix},this.prefixText),c=br("div",{class:T0.suffix},this.suffixText),h=this.type==="number"?br("input",{accept:this.accept,"aria-label":nSt(this),autocomplete:this.autocomplete,autofocus:this.autofocus?!0:null,defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:this.enterKeyHint,inputMode:this.inputMode,key:"localized-input",maxLength:this.maxLength,minLength:this.minLength,multiple:this.multiple,name:void 0,onBlur:this.inputBlurHandler,onFocus:this.inputFocusHandler,onInput:this.inputNumberInputHandler,onKeyDown:this.inputNumberKeyDownHandler,onKeyUp:this.inputKeyUpHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,ref:this.setChildNumberElRef,type:"text",value:this.localizedValue}):null,p=this.type!=="number"?[br(this.childElType,{accept:this.accept,"aria-label":nSt(this),autocomplete:this.autocomplete,autofocus:this.autofocus?!0:null,class:{[T0.editingEnabled]:this.editingEnabled,[T0.inlineChild]:!!this.inlineEditableEl},defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:this.enterKeyHint,inputMode:this.inputMode,max:this.maxString,maxLength:this.maxLength,min:this.minString,minLength:this.minLength,multiple:this.multiple,name:this.name,onBlur:this.inputBlurHandler,onFocus:this.inputFocusHandler,onInput:this.inputInputHandler,onKeyDown:this.inputKeyDownHandler,onKeyUp:this.inputKeyUpHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,ref:this.setChildElRef,required:this.required?!0:null,step:this.step,tabIndex:this.disabled||this.inlineEditableEl&&!this.editingEnabled?-1:null,type:this.type,value:this.value}),this.isTextarea?br("div",{class:T0.resizeIconWrapper},br("calcite-icon",{icon:"chevron-down",scale:this.scale==="l"?"m":"s"})):null]:null;return br(qA,{onClick:this.clickHandler,onKeyDown:this.keyDownHandler},br("div",{class:{[T0.inputWrapper]:!0,[Eii.rtl]:t==="rtl"}},this.type==="number"&&this.numberButtonType==="horizontal"&&!this.readOnly?o:null,this.prefixText?l:null,br("div",{class:T0.wrapper},h,p,this.isClearable?i:null,this.requestedIcon?r:null,this.loading?e:null),br("div",{class:T0.actionWrapper},br("slot",{name:bqi.action})),this.type==="number"&&this.numberButtonType==="vertical"&&!this.readOnly?a:null,this.suffixText?c:null,this.type==="number"&&this.numberButtonType==="horizontal"&&!this.readOnly?s:null,br(hqi,{component:this})))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{disabled:["disabledWatcher"],max:["maxWatcher"],min:["minWatcher"],messageOverrides:["onMessagesChange"],value:["valueWatcher"],icon:["updateRequestedIcon"],type:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return wqi}},[1,"calcite-input",{alignment:[513],autofocus:[516],clearable:[516],disabled:[516],groupSeparator:[516,"group-separator"],hidden:[516],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],label:[1],loading:[516],numberingSystem:[513,"numbering-system"],localeFormat:[4,"locale-format"],max:[514],min:[514],maxLength:[514,"max-length"],minLength:[514,"min-length"],name:[513],numberButtonType:[513,"number-button-type"],placeholder:[1],prefixText:[1,"prefix-text"],readOnly:[516,"read-only"],required:[516],scale:[1537],status:[1537],step:[520],autocomplete:[1],pattern:[1],accept:[1],multiple:[4],inputMode:[1,"input-mode"],enterKeyHint:[1,"enter-key-hint"],suffixText:[1,"suffix-text"],editingEnabled:[1540,"editing-enabled"],type:[513],value:[1025],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],localizedValue:[32],slottedActionElDisabledInternally:[32],setFocus:[64],selectText:[64],internalSyncChildElValue:[64]}]);function BLe(){if(typeof customElements>"u")return;["calcite-input","calcite-icon","calcite-progress"].forEach(e=>{switch(e){case"calcite-input":customElements.get(e)||customElements.define(e,xqi);break;case"calcite-icon":customElements.get(e)||lx();break;case"calcite-progress":customElements.get(e)||cme();break}})}BLe();/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const _Wi={container:"container",searchIcon:"search-icon"},bWi={search:"search",close:"x"},wWi=250,xWi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{display:flex;inline-size:100%}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.container{display:flex;inline-size:100%;padding:0.5rem}label{position:relative;margin-inline:0.25rem;margin-block:0px;display:flex;inline-size:100%;align-items:center;overflow:hidden}input[type=text]{margin-block-end:0.25rem;inline-size:100%;border-style:none;background-color:transparent;padding-block:0.25rem;font-family:inherit;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-ui-text-1);padding-inline-end:0.25rem;padding-inline-start:1.5rem;transition:padding var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing)}input[type=text]::-ms-clear{display:none}calcite-input{inline-size:100%}.search-icon{position:absolute;display:flex;color:var(--calcite-ui-text-2);inset-inline-start:0;transition:inset-inline-start var(--calcite-animation-timing), inset-inline-end var(--calcite-animation-timing), opacity var(--calcite-animation-timing)}input[type=text]:focus{border-color:var(--calcite-ui-brand);outline:2px solid transparent;outline-offset:2px;padding-inline:0.25rem}input[type=text]:focus~.search-icon{inset-inline-start:calc(1rem * -1);opacity:0}.clear-button{display:flex;cursor:pointer;align-items:center;border-width:0px;background-color:transparent;color:var(--calcite-ui-text-2)}.clear-button:hover,.clear-button:focus{color:var(--calcite-ui-text-1)}",SWi=h0(class extends d0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFilterChange=Wh(this,"calciteFilterChange",6),this.filter=Ffe((t,e=!1)=>this.updateFiltered(n2t(this.items,t),e),wWi),this.inputHandler=t=>{const e=t.target;this.value=e.value,this.filter(e.value,!0)},this.keyDownHandler=t=>{t.key==="Escape"&&(this.clear(),t.preventDefault()),t.key==="Enter"&&t.preventDefault()},this.clear=()=>{this.value="",this.filter("",!0),this.setFocus()},this.items=[],this.disabled=!1,this.filteredItems=[],this.placeholder=void 0,this.scale="m",this.value="",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}watchItemsHandler(){this.filter(this.value)}onMessagesChange(){}valueHandler(t){this.filter(t)}effectiveLocaleChange(){dF(this,this.effectiveLocale)}async componentWillLoad(){SE(this),this.updateFiltered(n2t(this.items,this.value)),await hF(this)}connectedCallback(){uF(this),pF(this)}componentDidRender(){f6(this)}disconnectedCallback(){cF(this),fF(this)}componentDidLoad(){CE(this)}async setFocus(){await TE(this),this.el?.focus()}updateFiltered(t,e=!1){this.filteredItems.length=0,this.filteredItems=this.filteredItems.concat(t),e&&this.calciteFilterChange.emit()}render(){const{disabled:t,scale:e}=this;return dr(PEe,null,dr("div",{class:_Wi.container},dr("label",null,dr("calcite-input",{"aria-label":this.messages.label,clearable:!0,disabled:t,icon:bWi.search,messageOverrides:{clear:this.messages.clear},onCalciteInputInput:this.inputHandler,onKeyDown:this.keyDownHandler,placeholder:this.placeholder,ref:i=>{this.textInput=i},scale:e,type:"text",value:this.value}))))}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{items:["watchItemsHandler"],messageOverrides:["onMessagesChange"],value:["valueHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return xWi}},[17,"calcite-filter",{items:[1040],disabled:[516],filteredItems:[1040],placeholder:[1],scale:[513],value:[1025],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]}]);function b2t(){if(typeof customElements>"u")return;["calcite-filter","calcite-icon","calcite-input","calcite-progress"].forEach(e=>{switch(e){case"calcite-filter":customElements.get(e)||customElements.define(e,SWi);break;case"calcite-icon":customElements.get(e)||ox();break;case"calcite-input":customElements.get(e)||yLe();break;case"calcite-progress":customElements.get(e)||Bfe();break}})}b2t();/*! + */const Sqi={container:"container",searchIcon:"search-icon"},Cqi={search:"search",close:"x"},Tqi=250,Eqi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{display:flex;inline-size:100%}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.container{display:flex;inline-size:100%;padding:0.5rem}label{position:relative;margin-inline:0.25rem;margin-block:0px;display:flex;inline-size:100%;align-items:center;overflow:hidden}input[type=text]{margin-block-end:0.25rem;inline-size:100%;border-style:none;background-color:transparent;padding-block:0.25rem;font-family:inherit;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-ui-text-1);padding-inline-end:0.25rem;padding-inline-start:1.5rem;transition:padding var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing)}input[type=text]::-ms-clear{display:none}calcite-input{inline-size:100%}.search-icon{position:absolute;display:flex;color:var(--calcite-ui-text-2);inset-inline-start:0;transition:inset-inline-start var(--calcite-animation-timing), inset-inline-end var(--calcite-animation-timing), opacity var(--calcite-animation-timing)}input[type=text]:focus{border-color:var(--calcite-ui-brand);outline:2px solid transparent;outline-offset:2px;padding-inline:0.25rem}input[type=text]:focus~.search-icon{inset-inline-start:calc(1rem * -1);opacity:0}.clear-button{display:flex;cursor:pointer;align-items:center;border-width:0px;background-color:transparent;color:var(--calcite-ui-text-2)}.clear-button:hover,.clear-button:focus{color:var(--calcite-ui-text-1)}",Iqi=d0(class extends p0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFilterChange=Xh(this,"calciteFilterChange",6),this.filter=sme((t,e=!1)=>this.updateFiltered(H2t(this.items,t),e),Tqi),this.inputHandler=t=>{const e=t.target;this.value=e.value,this.filter(e.value,!0)},this.keyDownHandler=t=>{t.key==="Escape"&&(this.clear(),t.preventDefault()),t.key==="Enter"&&t.preventDefault()},this.clear=()=>{this.value="",this.filter("",!0),this.setFocus()},this.items=[],this.disabled=!1,this.filteredItems=[],this.placeholder=void 0,this.scale="m",this.value="",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}watchItemsHandler(){this.filter(this.value)}onMessagesChange(){}valueHandler(t){this.filter(t)}effectiveLocaleChange(){mF(this,this.effectiveLocale)}async componentWillLoad(){TE(this),this.updateFiltered(H2t(this.items,this.value)),await fF(this)}connectedCallback(){dF(this),gF(this)}componentDidRender(){g6(this)}disconnectedCallback(){pF(this),yF(this)}componentDidLoad(){EE(this)}async setFocus(){await IE(this),this.el?.focus()}updateFiltered(t,e=!1){this.filteredItems.length=0,this.filteredItems=this.filteredItems.concat(t),e&&this.calciteFilterChange.emit()}render(){const{disabled:t,scale:e}=this;return br(DEe,null,br("div",{class:Sqi.container},br("label",null,br("calcite-input",{"aria-label":this.messages.label,clearable:!0,disabled:t,icon:Cqi.search,messageOverrides:{clear:this.messages.clear},onCalciteInputInput:this.inputHandler,onKeyDown:this.keyDownHandler,placeholder:this.placeholder,ref:i=>{this.textInput=i},scale:e,type:"text",value:this.value}))))}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{items:["watchItemsHandler"],messageOverrides:["onMessagesChange"],value:["valueHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Eqi}},[17,"calcite-filter",{items:[1040],disabled:[516],filteredItems:[1040],placeholder:[1],scale:[513],value:[1025],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]}]);function aSt(){if(typeof customElements>"u")return;["calcite-filter","calcite-icon","calcite-input","calcite-progress"].forEach(e=>{switch(e){case"calcite-filter":customElements.get(e)||customElements.define(e,Iqi);break;case"calcite-icon":customElements.get(e)||lx();break;case"calcite-input":customElements.get(e)||BLe();break;case"calcite-progress":customElements.get(e)||cme();break}})}aSt();/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const CWi='@charset "UTF-8";@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}: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-ui-brand);stroke-width:3;fill:none;transform:scale(1, 1);animation:loader-color-shift calc(var(--calcite-internal-animation-timing-slow) * 2) alternate-reverse infinite linear;padding-block:var(--calcite-loader-padding, 4rem)}: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-ui-text-1);margin-block-start:calc(var(--calcite-loader-size) + 1.5rem)}.loader__percentage{position:absolute;display:block;text-align:center;color:var(--calcite-ui-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);transform:scale(1, 1)}.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;animation-name:loader-clockwise}@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-ui-border-3)}:host([type=determinate]) .loader__svg--3{animation:none;stroke:var(--calcite-ui-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-ui-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) * 2.4)}@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) * 3.2)}@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) * 3.867)}@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-ui-brand)}33%{stroke:var(--calcite-ui-brand-press)}66%{stroke:var(--calcite-ui-brand-hover)}100%{stroke:var(--calcite-ui-brand)}}@keyframes loader-clockwise{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}',TWi=h0(class extends d0{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:t,inline:e,label:i,scale:r,text:n,type:s,value:o}=this,a=t.id||DY(),l=.45,c=e?this.getInlineSize(r):this.getSize(r),d=c*l,p=`0 0 ${c} ${c}`,y=s==="determinate",v=2*d*Math.PI,S=o/100*v,I=v-S,O=Math.floor(o),L={"aria-valuenow":O,"aria-valuemin":0,"aria-valuemax":100,complete:O===100},N={r:d,cx:c/2,cy:c/2},G={"stroke-dasharray":`${S} ${I}`};return dr(YA,{"aria-label":i,id:a,role:"progressbar",...y?L:{}},dr("div",{class:"loader__svgs"},dr("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--1",viewBox:p},dr("circle",{...N})),dr("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--2",viewBox:p},dr("circle",{...N})),dr("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--3",viewBox:p,...y?{style:G}:{}},dr("circle",{...N}))),n&&dr("div",{class:"loader__text"},n),y&&dr("div",{class:"loader__percentage"},o))}getSize(t){return{s:32,m:56,l:80}[t]}getInlineSize(t){return{s:12,m:16,l:20}[t]}get el(){return this}static get style(){return CWi}},[1,"calcite-loader",{inline:[516],label:[1],scale:[513],type:[513],value:[2],text:[1]}]);function mF(){if(typeof customElements>"u")return;["calcite-loader"].forEach(e=>{switch(e){case"calcite-loader":customElements.get(e)||customElements.define(e,TWi);break}})}mF();/*! + */const Aqi='@charset "UTF-8";@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}: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-ui-brand);stroke-width:3;fill:none;transform:scale(1, 1);animation:loader-color-shift calc(var(--calcite-internal-animation-timing-slow) * 2) alternate-reverse infinite linear;padding-block:var(--calcite-loader-padding, 4rem)}: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-ui-text-1);margin-block-start:calc(var(--calcite-loader-size) + 1.5rem)}.loader__percentage{position:absolute;display:block;text-align:center;color:var(--calcite-ui-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);transform:scale(1, 1)}.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;animation-name:loader-clockwise}@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-ui-border-3)}:host([type=determinate]) .loader__svg--3{animation:none;stroke:var(--calcite-ui-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-ui-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) * 2.4)}@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) * 3.2)}@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) * 3.867)}@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-ui-brand)}33%{stroke:var(--calcite-ui-brand-press)}66%{stroke:var(--calcite-ui-brand-hover)}100%{stroke:var(--calcite-ui-brand)}}@keyframes loader-clockwise{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}',Pqi=d0(class extends p0{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:t,inline:e,label:i,scale:r,text:n,type:s,value:o}=this,a=t.id||DY(),l=.45,c=e?this.getInlineSize(r):this.getSize(r),h=c*l,p=`0 0 ${c} ${c}`,y=s==="determinate",v=2*h*Math.PI,x=o/100*v,I=v-x,P=Math.floor(o),F={"aria-valuenow":P,"aria-valuemin":0,"aria-valuemax":100,complete:P===100},k={r:h,cx:c/2,cy:c/2},j={"stroke-dasharray":`${x} ${I}`};return br(qA,{"aria-label":i,id:a,role:"progressbar",...y?F:{}},br("div",{class:"loader__svgs"},br("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--1",viewBox:p},br("circle",{...k})),br("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--2",viewBox:p},br("circle",{...k})),br("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--3",viewBox:p,...y?{style:j}:{}},br("circle",{...k}))),n&&br("div",{class:"loader__text"},n),y&&br("div",{class:"loader__percentage"},o))}getSize(t){return{s:32,m:56,l:80}[t]}getInlineSize(t){return{s:12,m:16,l:20}[t]}get el(){return this}static get style(){return Aqi}},[1,"calcite-loader",{inline:[516],label:[1],scale:[513],type:[513],value:[2],text:[1]}]);function vF(){if(typeof customElements>"u")return;["calcite-loader"].forEach(e=>{switch(e){case"calcite-loader":customElements.get(e)||customElements.define(e,Pqi);break}})}vF();/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const w2t={scrim:"scrim",content:"content"},EWi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{position:absolute;inset:0px;z-index:700;display:flex;block-size:100%;inline-size:100%;flex-direction:column;align-items:stretch}@keyframes calcite-scrim-fade-in{0%{--tw-bg-opacity:0}100%{--tw-text-opacity:1}}.scrim{position:absolute;inset:0px;display:flex;flex-direction:column;align-content:center;align-items:center;justify-content:center;overflow:hidden;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-scrim-background, var(--calcite-scrim-background-internal))}.content{padding:1rem}",x2t=h0(class extends d0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.loading=!1,this.messages=void 0,this.messageOverrides=void 0,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}effectiveLocaleChange(){dF(this,this.effectiveLocale)}connectedCallback(){uF(this),pF(this)}async componentWillLoad(){await hF(this)}disconnectedCallback(){cF(this),fF(this)}render(){const{el:t,loading:e,messages:i}=this,r=t.innerHTML.trim().length>0,n=e?dr("calcite-loader",{label:i.loading}):null,s=r?dr("div",{class:w2t.content},dr("slot",null)):null;return dr("div",{class:w2t.scrim},n,s)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return EWi}},[1,"calcite-scrim",{loading:[516],messages:[1040],messageOverrides:[1040],defaultMessages:[32],effectiveLocale:[32]}]);function aQ(){if(typeof customElements>"u")return;["calcite-scrim","calcite-loader"].forEach(e=>{switch(e){case"calcite-scrim":customElements.get(e)||customElements.define(e,x2t);break;case"calcite-loader":customElements.get(e)||mF();break}})}aQ();/*! + */const lSt={scrim:"scrim",content:"content"},Oqi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{position:absolute;inset:0px;z-index:700;display:flex;block-size:100%;inline-size:100%;flex-direction:column;align-items:stretch}@keyframes calcite-scrim-fade-in{0%{--tw-bg-opacity:0}100%{--tw-text-opacity:1}}.scrim{position:absolute;inset:0px;display:flex;flex-direction:column;align-content:center;align-items:center;justify-content:center;overflow:hidden;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-scrim-background, var(--calcite-scrim-background-internal))}.content{padding:1rem}",uSt=d0(class extends p0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.loading=!1,this.messages=void 0,this.messageOverrides=void 0,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}effectiveLocaleChange(){mF(this,this.effectiveLocale)}connectedCallback(){dF(this),gF(this)}async componentWillLoad(){await fF(this)}disconnectedCallback(){pF(this),yF(this)}render(){const{el:t,loading:e,messages:i}=this,r=t.innerHTML.trim().length>0,n=e?br("calcite-loader",{label:i.loading}):null,s=r?br("div",{class:lSt.content},br("slot",null)):null;return br("div",{class:lSt.scrim},n,s)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Oqi}},[1,"calcite-scrim",{loading:[516],messages:[1040],messageOverrides:[1040],defaultMessages:[32],effectiveLocale:[32]}]);function dQ(){if(typeof customElements>"u")return;["calcite-scrim","calcite-loader"].forEach(e=>{switch(e){case"calcite-scrim":customElements.get(e)||customElements.define(e,uSt);break;case"calcite-loader":customElements.get(e)||vF();break}})}dQ();/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const lQ={container:"container",table:"table",scrim:"scrim",tableContainer:"table-container",sticky:"sticky-pos"},IWi=100,AWi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{display:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.container{position:relative}.table-container{position:relative;z-index:1;box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;background-color:transparent}.table-container *{box-sizing:border-box}.table{inline-size:100%}::slotted(calcite-list-item){margin-block-end:1px;--tw-shadow:0 1px 0 var(--calcite-ui-border-3);--tw-shadow-colored:0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}::slotted(calcite-list-item:last-child){--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.sticky-pos{position:sticky;inset-block-start:0px;z-index:300}calcite-filter{margin-block-end:1px}",S2t="calcite-list-item",C2t=h0(class extends d0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteListFilter=Wh(this,"calciteListFilter",6),this.listItems=[],this.enabledListItems=[],this.mutationObserver=aF("mutation",()=>this.updateListItems()),this.handleDefaultSlotChange=t=>{Fxt(Dxt(t))},this.setActiveListItem=()=>{const{enabledListItems:t}=this;t.some(e=>e.active)||t[0]&&(t[0].active=!0)},this.updateSelectedItems=Ffe(()=>{this.selectedItems=this.enabledListItems.filter(t=>t.selected)},IWi),this.updateFilteredItems=Ffe(()=>{const{listItems:t,filteredData:e,filterText:i}=this,r=e.map(o=>o.value),n=new Set,s=t?.filter(o=>{const a=o.parentElement;a.matches("calcite-list-item-group")&&n.add(a);const c=i?r.includes(o.value):!0;return o.hidden=!c,c})||[];this.filteredItems=s,n.forEach(o=>{const a=s.some(c=>o.contains(c));if(o.hidden=!a,!a)return;const l=o.closest("calcite-list-item");l&&(l.hidden=!1,s.includes(l)&&Array.from(o.querySelectorAll("calcite-list-item")).forEach(c=>c.hidden=!1))}),n.clear()}),this.handleFilter=t=>{t.stopPropagation();const{filteredItems:e,value:i}=t.currentTarget;this.filteredData=e,this.filterText=i,this.updateFilteredItems(),this.calciteListFilter.emit()},this.getItemData=()=>this.listItems.map(t=>({label:t.label,description:t.description,metadata:t.metadata,value:t.value})),this.queryListItems=()=>Array.from(this.el.querySelectorAll(S2t)),this.focusRow=t=>{const{enabledListItems:e}=this;t&&(e.forEach(i=>i.active=i===t),t.setFocus())},this.isNavigable=t=>{const e=t.parentElement?.closest(S2t);return e?e.open&&this.isNavigable(e):!0},this.handleListKeydown=t=>{const{key:e}=t,i=this.enabledListItems.filter(n=>this.isNavigable(n)),r=i.findIndex(n=>n.active);if(e==="ArrowDown"){t.preventDefault();const n=r+1;i[n]&&this.focusRow(i[n])}else if(e==="ArrowUp"){t.preventDefault();const n=r-1;i[n]&&this.focusRow(i[n])}else if(e==="Home"){t.preventDefault();const n=i[0];n&&this.focusRow(n)}else if(e==="End"){t.preventDefault();const n=i[i.length-1];n&&this.focusRow(n)}},this.disabled=!1,this.filterEnabled=!1,this.filteredItems=[],this.filteredData=[],this.filterPlaceholder=void 0,this.filterText=void 0,this.label=void 0,this.loading=!1,this.openable=!1,this.selectedItems=[],this.selectionMode="none",this.selectionAppearance="icon",this.dataForFilter=[]}handleFilterEnabledChange(){this.updateListItems()}handleSelectionAppearanceChange(){this.updateListItems()}handleCalciteInternalFocusPreviousItem(t){t.stopPropagation();const{enabledListItems:e}=this,r=e.findIndex(n=>n.active)-1;e[r]&&this.focusRow(e[r])}handleCalciteListItemActive(t){const e=t.target,{listItems:i}=this;i.forEach(r=>{r.active=r===e})}handleCalciteListItemSelect(t){const e=t.target,{listItems:i,selectionMode:r}=this;i.forEach(n=>{r==="single"&&(n.selected=n===e)}),this.updateSelectedItems()}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.updateListItems()}disconnectedCallback(){this.mutationObserver?.disconnect()}componentWillLoad(){SE(this)}componentDidRender(){f6(this)}componentDidLoad(){CE(this);const{filterEl:t}=this,e=t?.filteredItems;e&&(this.filteredData=e),this.updateFilteredItems()}async setFocus(){await TE(this),this.enabledListItems.find(t=>t.active)?.setFocus()}render(){const{loading:t,label:e,disabled:i,dataForFilter:r,filterEnabled:n,filterPlaceholder:s,filterText:o}=this;return dr("div",{class:lQ.container},t?dr("calcite-scrim",{class:lQ.scrim,loading:t}):null,dr("table",{"aria-busy":yw(t),"aria-label":e||"",class:lQ.table,onKeyDown:this.handleListKeydown,role:"treegrid"},n?dr("thead",null,dr("tr",{class:{[lQ.sticky]:!0}},dr("th",{colSpan:tzi},dr("calcite-filter",{"aria-label":s,disabled:t||i,items:r,onCalciteFilterChange:this.handleFilter,placeholder:s,ref:a=>this.filterEl=a,value:o})))):null,dr("tbody",{class:lQ.tableContainer},dr("slot",{onSlotchange:this.handleDefaultSlotChange}))))}updateListItems(){const{selectionAppearance:t,selectionMode:e}=this,i=this.queryListItems();i.forEach(r=>{r.selectionAppearance=t,r.selectionMode=e}),this.listItems=i,this.enabledListItems=i.filter(r=>!r.disabled),this.filterEnabled&&(this.dataForFilter=this.getItemData()),this.setActiveListItem(),this.updateSelectedItems(),this.updateFilteredItems()}get el(){return this}static get watchers(){return{filterEnabled:["handleFilterEnabledChange"],selectionMode:["handleSelectionAppearanceChange"],selectionAppearance:["handleSelectionAppearanceChange"]}}static get style(){return AWi}},[1,"calcite-list",{disabled:[516],filterEnabled:[516,"filter-enabled"],filteredItems:[1040],filteredData:[1040],filterPlaceholder:[513,"filter-placeholder"],filterText:[1537,"filter-text"],label:[1],loading:[516],openable:[4],selectedItems:[1040],selectionMode:[513,"selection-mode"],selectionAppearance:[513,"selection-appearance"],dataForFilter:[32],setFocus:[64]},[[0,"calciteInternalFocusPreviousItem","handleCalciteInternalFocusPreviousItem"],[0,"calciteInternalListItemActive","handleCalciteListItemActive"],[0,"calciteInternalListItemSelect","handleCalciteListItemSelect"]]]);function T2t(){if(typeof customElements>"u")return;["calcite-list","calcite-filter","calcite-icon","calcite-input","calcite-loader","calcite-progress","calcite-scrim"].forEach(e=>{switch(e){case"calcite-list":customElements.get(e)||customElements.define(e,C2t);break;case"calcite-filter":customElements.get(e)||b2t();break;case"calcite-icon":customElements.get(e)||ox();break;case"calcite-input":customElements.get(e)||yLe();break;case"calcite-loader":customElements.get(e)||mF();break;case"calcite-progress":customElements.get(e)||Bfe();break;case"calcite-scrim":customElements.get(e)||aQ();break}})}T2t();const PWi=Object.freeze(Object.defineProperty({__proto__:null,CalciteList:C2t,defineCustomElement:T2t},Symbol.toStringTag,{value:"Module"}));/*! + */const pQ={container:"container",table:"table",scrim:"scrim",tableContainer:"table-container",sticky:"sticky-pos"},Rqi=100,Mqi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{display:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.container{position:relative}.table-container{position:relative;z-index:1;box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;background-color:transparent}.table-container *{box-sizing:border-box}.table{inline-size:100%}::slotted(calcite-list-item){margin-block-end:1px;--tw-shadow:0 1px 0 var(--calcite-ui-border-3);--tw-shadow-colored:0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}::slotted(calcite-list-item:last-child){--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.sticky-pos{position:sticky;inset-block-start:0px;z-index:300}calcite-filter{margin-block-end:1px}",cSt="calcite-list-item",hSt=d0(class extends p0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteListFilter=Xh(this,"calciteListFilter",6),this.listItems=[],this.enabledListItems=[],this.mutationObserver=cF("mutation",()=>this.updateListItems()),this.handleDefaultSlotChange=t=>{w2t(b2t(t))},this.setActiveListItem=()=>{const{enabledListItems:t}=this;t.some(e=>e.active)||t[0]&&(t[0].active=!0)},this.updateSelectedItems=sme(()=>{this.selectedItems=this.enabledListItems.filter(t=>t.selected)},Rqi),this.updateFilteredItems=sme(()=>{const{listItems:t,filteredData:e,filterText:i}=this,r=e.map(o=>o.value),n=new Set,s=t?.filter(o=>{const a=o.parentElement;a.matches("calcite-list-item-group")&&n.add(a);const c=i?r.includes(o.value):!0;return o.hidden=!c,c})||[];this.filteredItems=s,n.forEach(o=>{const a=s.some(c=>o.contains(c));if(o.hidden=!a,!a)return;const l=o.closest("calcite-list-item");l&&(l.hidden=!1,s.includes(l)&&Array.from(o.querySelectorAll("calcite-list-item")).forEach(c=>c.hidden=!1))}),n.clear()}),this.handleFilter=t=>{t.stopPropagation();const{filteredItems:e,value:i}=t.currentTarget;this.filteredData=e,this.filterText=i,this.updateFilteredItems(),this.calciteListFilter.emit()},this.getItemData=()=>this.listItems.map(t=>({label:t.label,description:t.description,metadata:t.metadata,value:t.value})),this.queryListItems=()=>Array.from(this.el.querySelectorAll(cSt)),this.focusRow=t=>{const{enabledListItems:e}=this;t&&(e.forEach(i=>i.active=i===t),t.setFocus())},this.isNavigable=t=>{const e=t.parentElement?.closest(cSt);return e?e.open&&this.isNavigable(e):!0},this.handleListKeydown=t=>{const{key:e}=t,i=this.enabledListItems.filter(n=>this.isNavigable(n)),r=i.findIndex(n=>n.active);if(e==="ArrowDown"){t.preventDefault();const n=r+1;i[n]&&this.focusRow(i[n])}else if(e==="ArrowUp"){t.preventDefault();const n=r-1;i[n]&&this.focusRow(i[n])}else if(e==="Home"){t.preventDefault();const n=i[0];n&&this.focusRow(n)}else if(e==="End"){t.preventDefault();const n=i[i.length-1];n&&this.focusRow(n)}},this.disabled=!1,this.filterEnabled=!1,this.filteredItems=[],this.filteredData=[],this.filterPlaceholder=void 0,this.filterText=void 0,this.label=void 0,this.loading=!1,this.openable=!1,this.selectedItems=[],this.selectionMode="none",this.selectionAppearance="icon",this.dataForFilter=[]}handleFilterEnabledChange(){this.updateListItems()}handleSelectionAppearanceChange(){this.updateListItems()}handleCalciteInternalFocusPreviousItem(t){t.stopPropagation();const{enabledListItems:e}=this,r=e.findIndex(n=>n.active)-1;e[r]&&this.focusRow(e[r])}handleCalciteListItemActive(t){const e=t.target,{listItems:i}=this;i.forEach(r=>{r.active=r===e})}handleCalciteListItemSelect(t){const e=t.target,{listItems:i,selectionMode:r}=this;i.forEach(n=>{r==="single"&&(n.selected=n===e)}),this.updateSelectedItems()}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.updateListItems()}disconnectedCallback(){this.mutationObserver?.disconnect()}componentWillLoad(){TE(this)}componentDidRender(){g6(this)}componentDidLoad(){EE(this);const{filterEl:t}=this,e=t?.filteredItems;e&&(this.filteredData=e),this.updateFilteredItems()}async setFocus(){await IE(this),this.enabledListItems.find(t=>t.active)?.setFocus()}render(){const{loading:t,label:e,disabled:i,dataForFilter:r,filterEnabled:n,filterPlaceholder:s,filterText:o}=this;return br("div",{class:pQ.container},t?br("calcite-scrim",{class:pQ.scrim,loading:t}):null,br("table",{"aria-busy":bw(t),"aria-label":e||"",class:pQ.table,onKeyDown:this.handleListKeydown,role:"treegrid"},n?br("thead",null,br("tr",{class:{[pQ.sticky]:!0}},br("th",{colSpan:sHi},br("calcite-filter",{"aria-label":s,disabled:t||i,items:r,onCalciteFilterChange:this.handleFilter,placeholder:s,ref:a=>this.filterEl=a,value:o})))):null,br("tbody",{class:pQ.tableContainer},br("slot",{onSlotchange:this.handleDefaultSlotChange}))))}updateListItems(){const{selectionAppearance:t,selectionMode:e}=this,i=this.queryListItems();i.forEach(r=>{r.selectionAppearance=t,r.selectionMode=e}),this.listItems=i,this.enabledListItems=i.filter(r=>!r.disabled),this.filterEnabled&&(this.dataForFilter=this.getItemData()),this.setActiveListItem(),this.updateSelectedItems(),this.updateFilteredItems()}get el(){return this}static get watchers(){return{filterEnabled:["handleFilterEnabledChange"],selectionMode:["handleSelectionAppearanceChange"],selectionAppearance:["handleSelectionAppearanceChange"]}}static get style(){return Mqi}},[1,"calcite-list",{disabled:[516],filterEnabled:[516,"filter-enabled"],filteredItems:[1040],filteredData:[1040],filterPlaceholder:[513,"filter-placeholder"],filterText:[1537,"filter-text"],label:[1],loading:[516],openable:[4],selectedItems:[1040],selectionMode:[513,"selection-mode"],selectionAppearance:[513,"selection-appearance"],dataForFilter:[32],setFocus:[64]},[[0,"calciteInternalFocusPreviousItem","handleCalciteInternalFocusPreviousItem"],[0,"calciteInternalListItemActive","handleCalciteListItemActive"],[0,"calciteInternalListItemSelect","handleCalciteListItemSelect"]]]);function dSt(){if(typeof customElements>"u")return;["calcite-list","calcite-filter","calcite-icon","calcite-input","calcite-loader","calcite-progress","calcite-scrim"].forEach(e=>{switch(e){case"calcite-list":customElements.get(e)||customElements.define(e,hSt);break;case"calcite-filter":customElements.get(e)||aSt();break;case"calcite-icon":customElements.get(e)||lx();break;case"calcite-input":customElements.get(e)||BLe();break;case"calcite-loader":customElements.get(e)||vF();break;case"calcite-progress":customElements.get(e)||cme();break;case"calcite-scrim":customElements.get(e)||dQ();break}})}dSt();const Dqi=Object.freeze(Object.defineProperty({__proto__:null,CalciteList:hSt,defineCustomElement:dSt},Symbol.toStringTag,{value:"Module"}));/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const OWi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{display:flex;flex-direction:column;--calcite-list-item-icon-color:var(--calcite-ui-brand);--calcite-list-item-spacing-indent:1rem}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.container{box-sizing:border-box;display:flex;flex:1 1 0%;background-color:var(--calcite-ui-foreground-1);font-family:var(--calcite-sans-family);padding-inline-start:calc(var(--calcite-list-item-spacing-indent) * var(--calcite-list-item-spacing-indent-multiplier))}.container *{box-sizing:border-box}.container:hover{cursor:pointer;background-color:var(--calcite-ui-foreground-2)}.container--border-selected{border-inline-start:4px solid var(--calcite-ui-brand)}.container--border-unselected{border-inline-start:4px solid transparent}.nested-container{display:flex;flex-direction:column;background-color:var(--calcite-ui-foreground-1)}.nested-container--hidden{display:none}.content-container{display:flex;flex:1 1 auto;align-items:stretch;padding:0px;font-family:var(--calcite-sans-family);font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2)}tr,td{outline-color:transparent}tr:focus,td:focus{z-index:300;outline:2px solid var(--calcite-ui-brand)}.content,.custom-content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--2);line-height:1.375}.label,.description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);word-wrap:break-word;word-break:break-word}.label:only-child,.description:only-child{margin:0px;padding-block:0.25rem}.label{color:var(--calcite-ui-text-1)}.description{margin-block-start:0.125rem;color:var(--calcite-ui-text-3)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:1 1 auto}.content-container--has-center-content .content-start,.content-container--has-center-content .content-end{flex:0 1 auto}.selection-container{display:flex;padding-inline:0.75rem;color:var(--calcite-list-item-icon-color)}.actions-start,.actions-end,.content-start,.content-end,.selection-container,.open-container{display:flex;align-items:center}.open-container,.selection-container{cursor:pointer}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.actions-start ::slotted(calcite-action),.actions-end ::slotted(calcite-action){align-self:stretch;color:inherit}::slotted(calcite-list-item){border-width:0px;border-block-start-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}[hidden]{display:none}",vLe=new Map,RWi="calcite-list",E2t=h0(class extends d0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteListItemSelect=Wh(this,"calciteListItemSelect",6),this.calciteInternalListItemSelect=Wh(this,"calciteInternalListItemSelect",6),this.calciteInternalListItemActive=Wh(this,"calciteInternalListItemActive",6),this.calciteInternalFocusPreviousItem=Wh(this,"calciteInternalFocusPreviousItem",6),this.handleContentSlotChange=t=>{this.hasCustomContent=kY(t)},this.handleActionsStartSlotChange=t=>{this.hasActionsStart=kY(t)},this.handleActionsEndSlotChange=t=>{this.hasActionsEnd=kY(t)},this.handleContentStartSlotChange=t=>{this.hasContentStart=kY(t)},this.handleContentEndSlotChange=t=>{this.hasContentEnd=kY(t)},this.handleDefaultSlotChange=t=>{const{parentListEl:e}=this,i=Dxt(t);Fxt(i);const r=!!i.length;r&&e&&!e.openable&&(e.openable=!0),this.openable=r,r||(this.open=!1)},this.toggleOpen=()=>{this.open=!this.open},this.itemClicked=()=>{this.toggleSelected(),this.calciteInternalListItemActive.emit()},this.toggleSelected=()=>{this.disabled||(this.selectionMode!=="none"&&(this.selected=!this.selected),this.calciteListItemSelect.emit())},this.handleItemKeyDown=t=>{const{key:e}=t,i=t.composedPath(),{containerEl:r,contentEl:n,actionsStartEl:s,actionsEndEl:o,open:a,openable:l}=this,c=[s,n,o].filter(Boolean),d=c.findIndex(p=>i.includes(p));if(e===" ")t.preventDefault(),this.toggleSelected();else if(e==="ArrowRight"){t.preventDefault();const p=d+1;d===-1?!a&&l?(this.open=!0,this.focusCell(null)):c[0]&&this.focusCell(c[0]):c[d]&&c[p]&&this.focusCell(c[p])}else if(e==="ArrowLeft"){t.preventDefault();const p=d-1;d===-1?(this.focusCell(null),a&&l?this.open=!1:this.calciteInternalFocusPreviousItem.emit()):d===0?(this.focusCell(null),r.focus()):c[d]&&c[p]&&this.focusCell(c[p])}},this.focusCellNull=()=>{this.focusCell(null)},this.focusCell=(t,e=!0)=>{const{contentEl:i,actionsStartEl:r,actionsEndEl:n,parentListEl:s}=this;e&&vLe.set(s,null),[r,i,n].filter(Boolean).forEach((o,a)=>{const l="tabindex";o===t?(o.setAttribute(l,"0"),e&&vLe.set(s,a)):o.removeAttribute(l)}),t?.focus()},this.active=!1,this.description=void 0,this.disabled=!1,this.label=void 0,this.metadata=void 0,this.open=!1,this.setSize=null,this.setPosition=null,this.selected=!1,this.value=void 0,this.selectionMode=null,this.selectionAppearance=null,this.level=null,this.visualLevel=null,this.parentListEl=void 0,this.openable=!1,this.hasActionsStart=!1,this.hasActionsEnd=!1,this.hasCustomContent=!1,this.hasContentStart=!1,this.hasContentEnd=!1}activeHandler(t){t||this.focusCell(null,!1)}handleSelectedChange(t){t&&this.calciteInternalListItemSelect.emit()}connectedCallback(){const{el:t}=this;this.parentListEl=t.closest(RWi),this.level=Lxt(t)+1,this.visualLevel=Lxt(t,!0),this.setSelectionDefaults()}componentWillLoad(){SE(this)}componentDidLoad(){CE(this)}componentDidRender(){f6(this,"managed")}async setFocus(){await TE(this);const{containerEl:t,contentEl:e,actionsStartEl:i,actionsEndEl:r,parentListEl:n}=this,s=vLe.get(n);if(typeof s=="number"){const o=[i,e,r].filter(Boolean);o[s]?this.focusCell(o[s]):t?.focus();return}t?.focus()}renderSelected(){const{selected:t,selectionMode:e,selectionAppearance:i}=this;return e==="none"||i==="border"?null:dr("td",{class:jm.selectionContainer,key:"selection-container",onClick:this.itemClicked},dr("calcite-icon",{icon:t?e==="multiple"?m6.selectedMultiple:m6.selectedSingle:m6.unselected,scale:"s"}))}renderOpen(){const{el:t,open:e,openable:i,parentListEl:r}=this,n=FY(t);return i?dr("td",{class:jm.openContainer,key:"open-container",onClick:this.toggleOpen},dr("calcite-icon",{icon:e?m6.open:n==="rtl"?m6.closedRTL:m6.closedLTR,scale:"s"})):r?.openable?dr("td",{class:jm.openContainer,key:"open-container",onClick:this.itemClicked},dr("calcite-icon",{icon:m6.blank,scale:"s"})):null}renderActionsStart(){const{label:t,hasActionsStart:e}=this;return dr("td",{"aria-label":t,class:jm.actionsStart,hidden:!e,key:"actions-start-container",ref:i=>this.actionsStartEl=i,role:"gridcell"},dr("slot",{name:tQ.actionsStart,onSlotchange:this.handleActionsStartSlotChange}))}renderActionsEnd(){const{label:t,hasActionsEnd:e}=this;return dr("td",{"aria-label":t,class:jm.actionsEnd,hidden:!e,key:"actions-end-container",ref:i=>this.actionsEndEl=i,role:"gridcell"},dr("slot",{name:tQ.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}))}renderContentStart(){const{hasContentStart:t}=this;return dr("div",{class:jm.contentStart,hidden:!t},dr("slot",{name:tQ.contentStart,onSlotchange:this.handleContentStartSlotChange}))}renderCustomContent(){const{hasCustomContent:t}=this;return dr("div",{class:jm.customContent,hidden:!t},dr("slot",{name:tQ.content,onSlotchange:this.handleContentSlotChange}))}renderContentEnd(){const{hasContentEnd:t}=this;return dr("div",{class:jm.contentEnd,hidden:!t},dr("slot",{name:tQ.contentEnd,onSlotchange:this.handleContentEndSlotChange}))}renderContentProperties(){const{label:t,description:e,hasCustomContent:i}=this;return!i&&(t||e)?dr("div",{class:jm.content,key:"content"},t?dr("div",{class:jm.label,key:"label"},t):null,e?dr("div",{class:jm.description,key:"description"},e):null):null}renderContentContainer(){const{description:t,label:e,selectionMode:i,hasCustomContent:r}=this,n=r||!!e||!!t,s=[this.renderContentStart(),this.renderCustomContent(),this.renderContentProperties(),this.renderContentEnd()];return dr("td",{"aria-label":e,class:{[jm.contentContainer]:!0,[jm.contentContainerSelectable]:i!=="none",[jm.contentContainerHasCenterContent]:n},key:"content-container",onClick:this.itemClicked,ref:o=>this.contentEl=o,role:"gridcell"},s)}render(){const{openable:t,open:e,level:i,setPosition:r,setSize:n,active:s,label:o,selected:a,selectionAppearance:l,selectionMode:c}=this,d=c!=="none"&&l==="border",p=d&&a,y=d&&!a;return dr(YA,null,dr("tr",{"aria-expanded":t?yw(e):null,"aria-label":o,"aria-level":i,"aria-posinset":r,"aria-selected":yw(a),"aria-setsize":n,class:{[jm.container]:!0,[jm.containerBorderSelected]:p,[jm.containerBorderUnselected]:y},onFocus:this.focusCellNull,onKeyDown:this.handleItemKeyDown,ref:v=>this.containerEl=v,role:"row",style:{"--calcite-list-item-spacing-indent-multiplier":`${this.visualLevel}`},tabIndex:s?0:-1},this.renderSelected(),this.renderOpen(),this.renderActionsStart(),this.renderContentContainer(),this.renderActionsEnd()),dr("div",{class:{[jm.nestedContainer]:!0,[jm.nestedContainerHidden]:t&&!e}},dr("slot",{onSlotchange:this.handleDefaultSlotChange})))}setSelectionDefaults(){const{parentListEl:t,selectionMode:e,selectionAppearance:i}=this;t&&(e||(this.selectionMode=t.selectionMode),i||(this.selectionAppearance=t.selectionAppearance))}get el(){return this}static get watchers(){return{active:["activeHandler"],selected:["handleSelectedChange"]}}static get style(){return OWi}},[1,"calcite-list-item",{active:[4],description:[1],disabled:[516],label:[1],metadata:[16],open:[1540],setSize:[2,"set-size"],setPosition:[2,"set-position"],selected:[1540],value:[8],selectionMode:[1025,"selection-mode"],selectionAppearance:[1025,"selection-appearance"],level:[32],visualLevel:[32],parentListEl:[32],openable:[32],hasActionsStart:[32],hasActionsEnd:[32],hasCustomContent:[32],hasContentStart:[32],hasContentEnd:[32],setFocus:[64]}]);function I2t(){if(typeof customElements>"u")return;["calcite-list-item","calcite-icon"].forEach(e=>{switch(e){case"calcite-list-item":customElements.get(e)||customElements.define(e,E2t);break;case"calcite-icon":customElements.get(e)||ox();break}})}I2t();const MWi=Object.freeze(Object.defineProperty({__proto__:null,CalciteListItem:E2t,defineCustomElement:I2t},Symbol.toStringTag,{value:"Module"}));/*! + */const Fqi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{display:flex;flex-direction:column;--calcite-list-item-icon-color:var(--calcite-ui-brand);--calcite-list-item-spacing-indent:1rem}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.container{box-sizing:border-box;display:flex;flex:1 1 0%;background-color:var(--calcite-ui-foreground-1);font-family:var(--calcite-sans-family);padding-inline-start:calc(var(--calcite-list-item-spacing-indent) * var(--calcite-list-item-spacing-indent-multiplier))}.container *{box-sizing:border-box}.container:hover{cursor:pointer;background-color:var(--calcite-ui-foreground-2)}.container--border-selected{border-inline-start:4px solid var(--calcite-ui-brand)}.container--border-unselected{border-inline-start:4px solid transparent}.nested-container{display:flex;flex-direction:column;background-color:var(--calcite-ui-foreground-1)}.nested-container--hidden{display:none}.content-container{display:flex;flex:1 1 auto;align-items:stretch;padding:0px;font-family:var(--calcite-sans-family);font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2)}tr,td{outline-color:transparent}tr:focus,td:focus{z-index:300;outline:2px solid var(--calcite-ui-brand)}.content,.custom-content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--2);line-height:1.375}.label,.description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);word-wrap:break-word;word-break:break-word}.label:only-child,.description:only-child{margin:0px;padding-block:0.25rem}.label{color:var(--calcite-ui-text-1)}.description{margin-block-start:0.125rem;color:var(--calcite-ui-text-3)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:1 1 auto}.content-container--has-center-content .content-start,.content-container--has-center-content .content-end{flex:0 1 auto}.selection-container{display:flex;padding-inline:0.75rem;color:var(--calcite-list-item-icon-color)}.actions-start,.actions-end,.content-start,.content-end,.selection-container,.open-container{display:flex;align-items:center}.open-container,.selection-container{cursor:pointer}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.actions-start ::slotted(calcite-action),.actions-end ::slotted(calcite-action){align-self:stretch;color:inherit}::slotted(calcite-list-item){border-width:0px;border-block-start-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}[hidden]{display:none}",VLe=new Map,Lqi="calcite-list",pSt=d0(class extends p0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteListItemSelect=Xh(this,"calciteListItemSelect",6),this.calciteInternalListItemSelect=Xh(this,"calciteInternalListItemSelect",6),this.calciteInternalListItemActive=Xh(this,"calciteInternalListItemActive",6),this.calciteInternalFocusPreviousItem=Xh(this,"calciteInternalFocusPreviousItem",6),this.handleContentSlotChange=t=>{this.hasCustomContent=NY(t)},this.handleActionsStartSlotChange=t=>{this.hasActionsStart=NY(t)},this.handleActionsEndSlotChange=t=>{this.hasActionsEnd=NY(t)},this.handleContentStartSlotChange=t=>{this.hasContentStart=NY(t)},this.handleContentEndSlotChange=t=>{this.hasContentEnd=NY(t)},this.handleDefaultSlotChange=t=>{const{parentListEl:e}=this,i=b2t(t);w2t(i);const r=!!i.length;r&&e&&!e.openable&&(e.openable=!0),this.openable=r,r||(this.open=!1)},this.toggleOpen=()=>{this.open=!this.open},this.itemClicked=()=>{this.toggleSelected(),this.calciteInternalListItemActive.emit()},this.toggleSelected=()=>{this.disabled||(this.selectionMode!=="none"&&(this.selected=!this.selected),this.calciteListItemSelect.emit())},this.handleItemKeyDown=t=>{const{key:e}=t,i=t.composedPath(),{containerEl:r,contentEl:n,actionsStartEl:s,actionsEndEl:o,open:a,openable:l}=this,c=[s,n,o].filter(Boolean),h=c.findIndex(p=>i.includes(p));if(e===" ")t.preventDefault(),this.toggleSelected();else if(e==="ArrowRight"){t.preventDefault();const p=h+1;h===-1?!a&&l?(this.open=!0,this.focusCell(null)):c[0]&&this.focusCell(c[0]):c[h]&&c[p]&&this.focusCell(c[p])}else if(e==="ArrowLeft"){t.preventDefault();const p=h-1;h===-1?(this.focusCell(null),a&&l?this.open=!1:this.calciteInternalFocusPreviousItem.emit()):h===0?(this.focusCell(null),r.focus()):c[h]&&c[p]&&this.focusCell(c[p])}},this.focusCellNull=()=>{this.focusCell(null)},this.focusCell=(t,e=!0)=>{const{contentEl:i,actionsStartEl:r,actionsEndEl:n,parentListEl:s}=this;e&&VLe.set(s,null),[r,i,n].filter(Boolean).forEach((o,a)=>{const l="tabindex";o===t?(o.setAttribute(l,"0"),e&&VLe.set(s,a)):o.removeAttribute(l)}),t?.focus()},this.active=!1,this.description=void 0,this.disabled=!1,this.label=void 0,this.metadata=void 0,this.open=!1,this.setSize=null,this.setPosition=null,this.selected=!1,this.value=void 0,this.selectionMode=null,this.selectionAppearance=null,this.level=null,this.visualLevel=null,this.parentListEl=void 0,this.openable=!1,this.hasActionsStart=!1,this.hasActionsEnd=!1,this.hasCustomContent=!1,this.hasContentStart=!1,this.hasContentEnd=!1}activeHandler(t){t||this.focusCell(null,!1)}handleSelectedChange(t){t&&this.calciteInternalListItemSelect.emit()}connectedCallback(){const{el:t}=this;this.parentListEl=t.closest(Lqi),this.level=x2t(t)+1,this.visualLevel=x2t(t,!0),this.setSelectionDefaults()}componentWillLoad(){TE(this)}componentDidLoad(){EE(this)}componentDidRender(){g6(this,"managed")}async setFocus(){await IE(this);const{containerEl:t,contentEl:e,actionsStartEl:i,actionsEndEl:r,parentListEl:n}=this,s=VLe.get(n);if(typeof s=="number"){const o=[i,e,r].filter(Boolean);o[s]?this.focusCell(o[s]):t?.focus();return}t?.focus()}renderSelected(){const{selected:t,selectionMode:e,selectionAppearance:i}=this;return e==="none"||i==="border"?null:br("td",{class:qm.selectionContainer,key:"selection-container",onClick:this.itemClicked},br("calcite-icon",{icon:t?e==="multiple"?y6.selectedMultiple:y6.selectedSingle:y6.unselected,scale:"s"}))}renderOpen(){const{el:t,open:e,openable:i,parentListEl:r}=this,n=FY(t);return i?br("td",{class:qm.openContainer,key:"open-container",onClick:this.toggleOpen},br("calcite-icon",{icon:e?y6.open:n==="rtl"?y6.closedRTL:y6.closedLTR,scale:"s"})):r?.openable?br("td",{class:qm.openContainer,key:"open-container",onClick:this.itemClicked},br("calcite-icon",{icon:y6.blank,scale:"s"})):null}renderActionsStart(){const{label:t,hasActionsStart:e}=this;return br("td",{"aria-label":t,class:qm.actionsStart,hidden:!e,key:"actions-start-container",ref:i=>this.actionsStartEl=i,role:"gridcell"},br("slot",{name:oQ.actionsStart,onSlotchange:this.handleActionsStartSlotChange}))}renderActionsEnd(){const{label:t,hasActionsEnd:e}=this;return br("td",{"aria-label":t,class:qm.actionsEnd,hidden:!e,key:"actions-end-container",ref:i=>this.actionsEndEl=i,role:"gridcell"},br("slot",{name:oQ.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}))}renderContentStart(){const{hasContentStart:t}=this;return br("div",{class:qm.contentStart,hidden:!t},br("slot",{name:oQ.contentStart,onSlotchange:this.handleContentStartSlotChange}))}renderCustomContent(){const{hasCustomContent:t}=this;return br("div",{class:qm.customContent,hidden:!t},br("slot",{name:oQ.content,onSlotchange:this.handleContentSlotChange}))}renderContentEnd(){const{hasContentEnd:t}=this;return br("div",{class:qm.contentEnd,hidden:!t},br("slot",{name:oQ.contentEnd,onSlotchange:this.handleContentEndSlotChange}))}renderContentProperties(){const{label:t,description:e,hasCustomContent:i}=this;return!i&&(t||e)?br("div",{class:qm.content,key:"content"},t?br("div",{class:qm.label,key:"label"},t):null,e?br("div",{class:qm.description,key:"description"},e):null):null}renderContentContainer(){const{description:t,label:e,selectionMode:i,hasCustomContent:r}=this,n=r||!!e||!!t,s=[this.renderContentStart(),this.renderCustomContent(),this.renderContentProperties(),this.renderContentEnd()];return br("td",{"aria-label":e,class:{[qm.contentContainer]:!0,[qm.contentContainerSelectable]:i!=="none",[qm.contentContainerHasCenterContent]:n},key:"content-container",onClick:this.itemClicked,ref:o=>this.contentEl=o,role:"gridcell"},s)}render(){const{openable:t,open:e,level:i,setPosition:r,setSize:n,active:s,label:o,selected:a,selectionAppearance:l,selectionMode:c}=this,h=c!=="none"&&l==="border",p=h&&a,y=h&&!a;return br(qA,null,br("tr",{"aria-expanded":t?bw(e):null,"aria-label":o,"aria-level":i,"aria-posinset":r,"aria-selected":bw(a),"aria-setsize":n,class:{[qm.container]:!0,[qm.containerBorderSelected]:p,[qm.containerBorderUnselected]:y},onFocus:this.focusCellNull,onKeyDown:this.handleItemKeyDown,ref:v=>this.containerEl=v,role:"row",style:{"--calcite-list-item-spacing-indent-multiplier":`${this.visualLevel}`},tabIndex:s?0:-1},this.renderSelected(),this.renderOpen(),this.renderActionsStart(),this.renderContentContainer(),this.renderActionsEnd()),br("div",{class:{[qm.nestedContainer]:!0,[qm.nestedContainerHidden]:t&&!e}},br("slot",{onSlotchange:this.handleDefaultSlotChange})))}setSelectionDefaults(){const{parentListEl:t,selectionMode:e,selectionAppearance:i}=this;t&&(e||(this.selectionMode=t.selectionMode),i||(this.selectionAppearance=t.selectionAppearance))}get el(){return this}static get watchers(){return{active:["activeHandler"],selected:["handleSelectedChange"]}}static get style(){return Fqi}},[1,"calcite-list-item",{active:[4],description:[1],disabled:[516],label:[1],metadata:[16],open:[1540],setSize:[2,"set-size"],setPosition:[2,"set-position"],selected:[1540],value:[8],selectionMode:[1025,"selection-mode"],selectionAppearance:[1025,"selection-appearance"],level:[32],visualLevel:[32],parentListEl:[32],openable:[32],hasActionsStart:[32],hasActionsEnd:[32],hasCustomContent:[32],hasContentStart:[32],hasContentEnd:[32],setFocus:[64]}]);function fSt(){if(typeof customElements>"u")return;["calcite-list-item","calcite-icon"].forEach(e=>{switch(e){case"calcite-list-item":customElements.get(e)||customElements.define(e,pSt);break;case"calcite-icon":customElements.get(e)||lx();break}})}fSt();const Nqi=Object.freeze(Object.defineProperty({__proto__:null,CalciteListItem:pSt,defineCustomElement:fSt},Symbol.toStringTag,{value:"Module"}));/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const A2t=new Set;let cj;const P2t={childList:!0};function DWi(t){cj||(cj=aF("mutation",O2t)),cj.observe(t.el,P2t)}function FWi(t){A2t.delete(t.el),O2t(cj.takeRecords()),cj.disconnect();for(const[e]of A2t.entries())cj.observe(e,P2t)}function O2t(t){t.forEach(({target:e})=>{AEe(e)})}/*! + */const mSt=new Set;let yU;const gSt={childList:!0};function kqi(t){yU||(yU=cF("mutation",ySt)),yU.observe(t.el,gSt)}function $qi(t){mSt.delete(t.el),ySt(yU.takeRecords()),yU.disconnect();for(const[e]of mSt.entries())yU.observe(e,gSt)}function ySt(t){t.forEach(({target:e})=>{MEe(e)})}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */var Gfe;(function(t){t.brand="lightbulb",t.danger="exclamationMarkTriangle",t.info="information",t.success="checkCircle",t.warning="exclamationMarkTriangle"})(Gfe||(Gfe={}));/*! + */var hme;(function(t){t.brand="lightbulb",t.danger="exclamationMarkTriangle",t.info="information",t.success="checkCircle",t.warning="exclamationMarkTriangle"})(hme||(hme={}));/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const uQ={title:"title",message:"message",link:"link",actionsEnd:"actions-end"},cQ={actionsEnd:"actions-end",close:"notice-close",container:"container",content:"notice-content",icon:"notice-icon"},LWi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([scale=s]){--calcite-notice-spacing-token-small:0.5rem;--calcite-notice-spacing-token-large:0.75rem}:host([scale=s]) .container slot[name=title]::slotted(*),:host([scale=s]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) .container slot[name=message]::slotted(*),:host([scale=s]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .notice-close{padding:0.5rem}:host([scale=m]){--calcite-notice-spacing-token-small:0.75rem;--calcite-notice-spacing-token-large:1rem}:host([scale=m]) .container slot[name=title]::slotted(*),:host([scale=m]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) .container slot[name=message]::slotted(*),:host([scale=m]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=l]){--calcite-notice-spacing-token-small:1rem;--calcite-notice-spacing-token-large:1.25rem}:host([scale=l]) .container slot[name=title]::slotted(*),:host([scale=l]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) .container slot[name=message]::slotted(*),:host([scale=l]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([width=auto]){--calcite-notice-width:auto}:host([width=half]){--calcite-notice-width:50%}:host([width=full]){--calcite-notice-width:100%}:host{margin-inline:auto;display:none;max-inline-size:100%;align-items:center;inline-size:var(--calcite-notice-width)}.container{pointer-events:none;margin-block:0px;box-sizing:border-box;display:none;inline-size:100%;background-color:var(--calcite-ui-foreground-1);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;max-block-size:0;text-align:start;border-inline-start:0px solid;box-shadow:0 0 0 0 transparent}.notice-close{outline-color:transparent}.notice-close:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host{display:flex}:host([open]) .container{pointer-events:auto;display:flex;max-block-size:100%;align-items:center;border-width:2px;opacity:1;--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.container slot[name=title]::slotted(*),.container *::slotted([slot=title]){margin:0px;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}.container slot[name=message]::slotted(*),.container *::slotted([slot=message]){margin:0px;display:inline;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2);margin-inline-end:var(--calcite-notice-spacing-token-small)}.notice-content{box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;display:flex;min-inline-size:0px;flex-direction:column;overflow-wrap:break-word;flex:1 1 0;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:0 var(--calcite-notice-spacing-token-small)}.notice-content:first-of-type:not(:only-child){padding-inline-start:var(--calcite-notice-spacing-token-large)}.notice-content:only-of-type{padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large)}.notice-icon{display:flex;align-items:center;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto}.notice-close{display:flex;cursor:pointer;align-items:center;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-ui-text-3);outline:2px solid transparent;outline-offset:2px;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;-webkit-appearance:none}.notice-close:hover,.notice-close:focus{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.notice-close:active{background-color:var(--calcite-ui-foreground-3)}.actions-end{display:flex;align-self:stretch}:host([kind=brand]) .container{border-color:var(--calcite-ui-brand)}:host([kind=brand]) .container .notice-icon{color:var(--calcite-ui-brand)}:host([kind=info]) .container{border-color:var(--calcite-ui-info)}:host([kind=info]) .container .notice-icon{color:var(--calcite-ui-info)}:host([kind=danger]) .container{border-color:var(--calcite-ui-danger)}:host([kind=danger]) .container .notice-icon{color:var(--calcite-ui-danger)}:host([kind=success]) .container{border-color:var(--calcite-ui-success)}:host([kind=success]) .container .notice-icon{color:var(--calcite-ui-success)}:host([kind=warning]) .container{border-color:var(--calcite-ui-warning)}:host([kind=warning]) .container .notice-icon{color:var(--calcite-ui-warning)}",R2t=h0(class extends d0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteNoticeClose=Wh(this,"calciteNoticeClose",6),this.calciteNoticeOpen=Wh(this,"calciteNoticeOpen",6),this.close=()=>{this.open=!1,this.calciteNoticeClose.emit()},this.open=!1,this.kind="brand",this.closable=!1,this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.width="auto",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}onMessagesChange(){}updateRequestedIcon(){this.requestedIcon=mle(Gfe,this.icon,this.kind)}connectedCallback(){DWi(this),uF(this),pF(this)}disconnectedCallback(){FWi(this),cF(this),fF(this)}async componentWillLoad(){SE(this),this.requestedIcon=mle(Gfe,this.icon,this.kind),await hF(this)}componentDidLoad(){CE(this)}render(){const{el:t}=this,e=dr("button",{"aria-label":this.messages.close,class:cQ.close,onClick:this.close,ref:r=>this.closeButton=r},dr("calcite-icon",{icon:"x",scale:this.scale==="l"?"m":"s"})),i=FEe(t,uQ.actionsEnd);return dr("div",{class:cQ.container},this.requestedIcon?dr("div",{class:cQ.icon},dr("calcite-icon",{flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:this.scale==="l"?"m":"s"})):null,dr("div",{class:cQ.content},dr("slot",{name:uQ.title}),dr("slot",{name:uQ.message}),dr("slot",{name:uQ.link})),i?dr("div",{class:cQ.actionsEnd},dr("slot",{name:uQ.actionsEnd})):null,this.closable?e:null)}async setFocus(){await TE(this);const t=this.el.querySelector("calcite-link");!this.closeButton&&!t||(t?t.setFocus():this.closeButton&&this.closeButton.focus())}effectiveLocaleChange(){dF(this,this.effectiveLocale)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],icon:["updateRequestedIcon"],kind:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return LWi}},[1,"calcite-notice",{open:[1540],kind:[513],closable:[516],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],width:[513],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]}]);function M2t(){if(typeof customElements>"u")return;["calcite-notice","calcite-icon"].forEach(e=>{switch(e){case"calcite-notice":customElements.get(e)||customElements.define(e,R2t);break;case"calcite-icon":customElements.get(e)||ox();break}})}M2t();const D2t=Object.freeze(Object.defineProperty({__proto__:null,CalciteNotice:R2t,defineCustomElement:M2t},Symbol.toStringTag,{value:"Module"}));function _Le(t){if(!t)return"arial-unicode-ms";const e=t.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 kWi(t){const e=NWi(t)+$Wi(t);return _Le(t.family)+(e.length>0?e:"-regular")}function NWi(t){if(!t.weight)return"";switch(t.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}function $Wi(t){if(!t.style)return"";switch(t.style.toLowerCase()){case"italic":case"oblique":return"-italic"}return""}const bLe=new U1t;function gF(t){if(t==null)return["",!1];if(!bLe.hasBidiChar(t))return[t,!1];let e;return e=bLe.checkContextual(t)==="rtl"?"IDNNN":"ICNNN",[bLe.bidiTransform(t,e,"VLYSN"),!0]}let hj=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,i){this.tx=e,this.ty=i}setTranslateZ(e){this.tz=e}setRotateCS(e,i){this.rz=void 0,this.rzCos=e,this.rzSin=i}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}};const F2t=512;let yy,wLe=class{constructor(e){this._geometry=e}next(){const e=this._geometry;return this._geometry=null,e}};function xLe(t,e){let i,r;yy||(yy=new XJ(0,0,0,1)),yy.reset(fy.Polygon),yy.setPixelMargin(e+1),yy.setExtent(F2t);for(const s of t.rings)if(s&&!(s.length<3)){i=s[0][0],r=-s[0][1],yy.moveTo(i,r);for(let o=1;o0;--e)t[e][0]-=t[e-1][0],t[e][1]-=t[e-1][1]}function V2t(t){if(t)for(const e of t)G2t(e)}function U2t(t){if(t){const e=t.length;for(let i=1;i1&&S>0&&n>0&&(i*y+r*v)/S/n<=this._maxCosAngle&&dj(c,1),d===1&&(s=y,o=v,a=S),S>0&&(c=p,i=y,r=v,n=S)}this._isClosed&&n>0&&a>0&&(i*s+r*o)/a/n<=this._maxCosAngle&&dj(e[0],1)}}};const pQ=.03;let pj=class{constructor(){this._path=[]}path(){return this._path}addPath(e,i){i||e.reverse(),Array.prototype.push.apply(this._path,e),i||e.reverse()}static mergePath(e,i){i&&Array.prototype.push.apply(e,i)}startPath(e){this._path.push(e)}lineTo(e){this._path.push(e)}close(){const e=this._path;e.length>1&&(e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]||e.push([e[0][0],e[0][1]]))}},cO=class{constructor(e=0,i=!1){}normalize(e){const i=Math.sqrt(e[0]*e[0]+e[1]*e[1]);i!==0&&(e[0]/=i,e[1]/=i)}calculateLength(e,i){const r=i[0]-e[0],n=i[1]-e[1];return Math.sqrt(r*r+n*n)}calculateSegLength(e,i){return this.calculateLength(e[i],e[i+1])}calculatePathLength(e){let i=0;const r=e?e.length:0;for(let n=0;n0?[n/o,s/o]:[1,0]}getSegAngleCS(e,i,r){return this.getAngleCS(e[i],e[i+1],r)}cut(e,i,r,n){return[r<=0?e[i]:this.getSegCoord2D(e,i,r),n>=1?e[i+1]:this.getSegCoord2D(e,i,n)]}addSegment(e,i,r){r&&e.push(i[0]),e.push(i[1])}getSubCurve(e,i,r){const n=[];return this.appendSubCurve(n,e,i,r)?n:null}appendSubCurve(e,i,r,n){const s=i?i.length-1:0;let o=0,a=!0,l=0;for(;lr){const d=(r-o)/c;let p=1,y=!1;o+c>=n&&(p=(n-o)/c,y=!0);const v=this.cut(i,l,d,p);if(v&&this.addSegment(e,v,a),y)break;a=!1}}else{if(o+c>n){const d=this.cut(i,l,0,(n-o)/c);d&&this.addSegment(e,d,a);break}this.addSegment(e,[i[l],i[l+1]],a)}o+=c,++l}else++l}return!0}getCIMPointAlong(e,i){const r=e?e.length-1:0;let n=0,s=-1;for(;si){const a=(i-n)/o;return this.getCoord2D(e[s],e[s+1],a)}n+=o}}return null}isEmpty(e,i){if(!e||e.length<=1)return!0;const r=e?e.length-1:0;let n=-1;for(;n=0==i<=0){if(L<1){const N=[S[0]-I[0],S[1]-I[1]];this.normalize(N);const G=Math.sqrt((1+L)/2);if(G>1/n){const V=-Math.abs(i)/G;d.push([p[0]-N[0]*V,p[1]-N[1]*V])}}}else switch(r){case ZP.Mitered:{const N=Math.sqrt((1+L)/2);if(N>0&&1/N0){const G=1/N;let V=G;for(let Y=1;Y0){const n=[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]],s=this._curveHelper.offset(n,this._size,ZP.Rounded,4,this._offsetFlattenError);if(s)return{rings:[s]}}else if(this._size<0&&Math.min(e.xmax-e.xmin,e.ymax-e.ymin)+2*this._size>0)return{xmin:e.xmin-this._size,xmax:e.xmax+this._size,ymin:e.ymin-this._size,ymax:e.ymax+this._size}}const i=this._geometryEngine;if(lt(i))return null;let r=e;if((!Va(e)||!this._tileKey||(r=xLe(e,Math.abs(this._size)+1),r&&r.rings&&r.rings.length!==0))&&(!Lu(e)||!this._tileKey||(r=L2t(e,Math.abs(this._size)+1),r&&r.paths&&r.paths.length!==0)))return i.buffer(rr.WebMercator,r,this._size,1)}return null}},Y2t=class ire{static local(){return ire.instance===null&&(ire.instance=new ire),ire.instance}execute(e,i,r,n,s){return new XWi(e,i,r)}};Y2t.instance=null;let XWi=class{constructor(e,i,r){this._defaultPointSize=20,this._inputGeometries=e,this._geomUnitsPerPoint=r,this._rule=i.rule??Il.FullGeometry,this._defaultSize=this._defaultPointSize*r}next(){let e;for(;e=this._inputGeometries.next();){let i;if(Wy(e)?i=this._processGeom([[[e.x,e.y]]]):sg(e)?i=this._processGeom([e.points]):Lu(e)?i=this._processGeom(e.paths):Va(e)&&(i=this._processGeom(e.rings)),i&&i.length)return{paths:i}}return null}_clone(e){return[e[0],e[1]]}_mid(e,i){return[(e[0]+i[0])/2,(e[1]+i[1])/2]}_mix(e,i,r,n){return[e[0]*i+r[0]*n,e[1]*i+r[1]*n]}_add(e,i){return[e[0]+i[0],e[1]+i[1]]}_add2(e,i,r){return[e[0]+i,e[1]+r]}_sub(e,i){return[e[0]-i[0],e[1]-i[1]]}_dist(e,i){return Math.sqrt((e[0]-i[0])*(e[0]-i[0])+(e[1]-i[1])*(e[1]-i[1]))}_norm(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}_normalize(e,i=1){const r=i/this._norm(e);e[0]*=r,e[1]*=r}_leftPerpendicular(e){const i=-e[1],r=e[0];e[0]=i,e[1]=r}_leftPerp(e){return[-e[1],e[0]]}_rightPerpendicular(e){const i=e[1],r=-e[0];e[0]=i,e[1]=r}_rightPerp(e){return[e[1],-e[0]]}_dotProduct(e,i){return e[0]*i[0]+e[1]*i[1]}_crossProduct(e,i){return e[0]*i[1]-e[1]*i[0]}_rotateDirect(e,i,r){const n=e[0]*i-e[1]*r,s=e[0]*r+e[1]*i;e[0]=n,e[1]=s}_makeCtrlPt(e){const i=[e[0],e[1]];return dj(i,1),i}_addAngledTicks(e,i,r,n){const s=this._sub(r,i);this._normalize(s);const o=this._crossProduct(s,this._sub(n,i));let a;a=o>0?this._rightPerp(s):this._leftPerp(s);const l=Math.abs(o)/2,c=[];c.push([i[0]+(a[0]-s[0])*l,i[1]+(a[1]-s[1])*l]),c.push(i),c.push(r),c.push([r[0]+(a[0]+s[0])*l,r[1]+(a[1]+s[1])*l]),e.push(c)}_addBezier2(e,i,r,n,s){if(s--==0)return void e.push(n);const o=this._mid(i,r),a=this._mid(r,n),l=this._mid(o,a);this._addBezier2(e,i,o,l,s),this._addBezier2(e,l,a,n,s)}_addBezier3(e,i,r,n,s,o){if(o--==0)return void e.push(s);const a=this._mid(i,r),l=this._mid(r,n),c=this._mid(n,s),d=this._mid(a,l),p=this._mid(l,c),y=this._mid(d,p);this._addBezier3(e,i,a,d,y,o),this._addBezier3(e,y,p,c,s,o)}_add90DegArc(e,i,r,n,s){const o=s??this._crossProduct(this._sub(r,i),this._sub(n,i))>0,a=this._mid(i,r),l=this._sub(a,i);o?this._leftPerpendicular(l):this._rightPerpendicular(l),a[0]+=l[0],a[1]+=l[1],this._addBezier3(e,i,this._mix(i,.33333,a,.66667),this._mix(r,.33333,a,.66667),r,4)}_addArrow(e,i,r){const n=i[0],s=i[1],o=i[i.length-1],a=this._sub(n,s);this._normalize(a);const l=this._crossProduct(a,this._sub(o,s)),c=.5*l,d=this._leftPerp(a),p=[o[0]-d[0]*l,o[1]-d[1]*l],y=i.length-1,v=[];v.push(r?[-d[0],-d[1]]:d);let S=[-a[0],-a[1]];for(let I=1;I0;I--)e.push([i[I][0]+v[I][0]*c,i[I][1]+v[I][1]*c]);e.push([p[0]+v[0][0]*c,p[1]+v[0][1]*c]),e.push([p[0]+v[0][0]*l,p[1]+v[0][1]*l]),e.push(n),e.push([p[0]-v[0][0]*l,p[1]-v[0][1]*l]),e.push([p[0]-v[0][0]*c,p[1]-v[0][1]*c]);for(let I=1;I=2?e[1]:this._add2(e[0],i*this._defaultSize,r*this._defaultSize)}_cp3(e,i,r,n){if(e.length>=3)return e[2];const s=this._mix(e[0],1-r,i,r),o=this._sub(i,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 i=e[0],r=this._cp2(e,-4,0),n=this._sub(i,r);this._normalize(n);const s=this._rightPerp(n);return[i,r,[i[0]+(s[0]-n[0])*this._defaultSize,i[1]+(s[1]-n[1])*this._defaultSize]]}_arrowLastSeg(e){const i=e[0],r=this._cp2(e,-4,0);let n;if(e.length>=3)n=e[e.length-1];else{const s=this._sub(i,r);this._normalize(s);const o=this._rightPerp(s);n=[i[0]+(o[0]-s[0])*this._defaultSize,i[1]+(o[1]-s[1])*this._defaultSize]}return[r,n]}_processGeom(e){if(!e)return null;const i=[];for(const r of e){if(!r||r.length===0)continue;const n=r.length;let s=r[0];switch(this._rule){case Il.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)),i.push(l);break}case Il.ReversedFirstSegment:{const o=this._cp2(r,0,-1);i.push([o,s]);break}case Il.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),i.push(l);break}case Il.SecondSegmentWithTicks:{const o=this._cp2(r,-4,1),a=this._cp3(r,o,.882353,-1.94),l=this._sub(a,o);let c;c=this._crossProduct(l,this._sub(s,o))>0?this._rightPerp(c):this._leftPerp(l);const d=[];d.push([o[0]+(c[0]-l[0])/3,o[1]+(c[1]-l[1])/3]),d.push(o),d.push(a),d.push([a[0]+(c[0]+l[0])/3,a[1]+(c[1]+l[1])/3]),i.push(d);break}case Il.DoublePerpendicular:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,3),l=this._mid(s,o),c=this._sub(l,a);this._normalize(c);const d=this._crossProduct(c,this._sub(s,a));this._leftPerpendicular(c);const p=[];p.push(s),p.push([a[0]+c[0]*d,a[1]+c[1]*d]),i.push(p);const y=[];y.push([a[0]-c[0]*d,a[1]-c[1]*d]),y.push(o),i.push(y);break}case Il.OppositeToFirstSegment:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,3),l=this._mid(s,o),c=this._sub(l,a);this._normalize(c);const d=this._crossProduct(c,this._sub(s,a));this._leftPerpendicular(c);const p=[];p.push([a[0]+c[0]*d,a[1]+c[1]*d]),p.push([a[0]-c[0]*d,a[1]-c[1]*d]),i.push(p);break}case Il.TriplePerpendicular:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,4),l=this._mid(s,o),c=this._sub(l,a);this._normalize(c);const d=this._crossProduct(c,this._sub(s,a));this._leftPerpendicular(c);const p=[];p.push([a[0]+c[0]*d*.8,a[1]+c[1]*d*.8]),p.push([l[0]+.8*(s[0]-l[0]),l[1]+.8*(s[1]-l[1])]),i.push(p),i.push([a,l]);const y=[];y.push([a[0]-c[0]*d*.8,a[1]-c[1]*d*.8]),y.push([l[0]+.8*(o[0]-l[0]),l[1]+.8*(o[1]-l[1])]),i.push(y);break}case Il.HalfCircleFirstSegment:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,4),l=this._mid(s,o);let c=this._sub(o,s);const d=Math.cos(Math.PI/18),p=Math.sin(Math.PI/18),y=Math.sqrt((1+d)/2),v=Math.sqrt((1-d)/2),S=[];let I;this._crossProduct(c,this._sub(a,s))>0?(S.push(s),c=this._sub(s,l),I=o):(S.push(o),c=this._sub(o,l),I=s),this._rotateDirect(c,y,v),c[0]/=y,c[1]/=y;for(let O=1;O<=18;O++)S.push(this._add(l,c)),this._rotateDirect(c,d,p);S.push(I),i.push(S);break}case Il.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 c=this._crossProduct(l,this._sub(a,o))/2;this._leftPerpendicular(l);const d=[o[0]+l[0]*c,o[1]+l[1]*c];l=this._sub(o,d);const p=Math.cos(Math.PI/18);let y=Math.sin(Math.PI/18);c>0&&(y=-y);const v=[o];for(let S=1;S<=18;S++)this._rotateDirect(l,p,y),v.push(this._add(d,l));i.push(v);break}case Il.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 S=this._sub(s,o);l=this._add(a,S)}const c=this._dist(o,a)/2/.75,d=this._sub(o,s);this._normalize(d,c);const p=this._sub(a,l);this._normalize(p,c);const y=[l,a];i.push(y);const v=[this._clone(a)];this._addBezier3(v,a,this._add(a,p),this._add(o,d),o,4),v.push(s),i.push(v);break}case Il.OpenCircle:{const o=this._cp2(r,-2,0),a=this._sub(o,s),l=Math.cos(Math.PI/18),c=-Math.sin(Math.PI/18),d=[o];for(let p=1;p<=33;p++)this._rotateDirect(a,l,c),d.push(this._add(s,a));i.push(d);break}case Il.CoverageEdgesWithTicks:{const o=this._cp2(r,0,-1);let a,l;if(n>=3)a=r[2];else{const y=this._sub(o,s),v=this._leftPerp(y);a=[s[0]+v[0]-.25*y[0],s[1]+v[1]-.25*y[1]]}if(n>=4)l=r[3];else{const y=this._mid(s,o),v=this._sub(s,o);this._normalize(v),this._leftPerpendicular(v);const S=this._crossProduct(v,this._sub(a,y));this._rightPerpendicular(v),l=[a[0]+v[0]*S*2,a[1]+v[1]*S*2]}const c=this._sub(o,s);let d,p;d=this._crossProduct(c,this._sub(a,s))>0?this._rightPerp(c):this._leftPerp(c),p=[],p.push(a),p.push(s),p.push([s[0]+(d[0]-c[0])/3,s[1]+(d[1]-c[1])/3]),i.push(p),d=this._crossProduct(c,this._sub(l,o))>0?this._rightPerp(d):this._leftPerp(c),p=[],p.push([o[0]+(d[0]+c[0])/3,o[1]+(d[1]+c[1])/3]),p.push(o),p.push(l),i.push(p);break}case Il.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 c=this._sub(o,s);l=this._add(a,c)}this._addAngledTicks(i,s,o,this._mid(a,l)),this._addAngledTicks(i,a,l,this._mid(s,o));break}case Il.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 d=this._sub(o,s);l=this._add(a,d)}const c=[];c.push(this._mid(s,a)),c.push(this._mid(o,l)),i.push(c);break}case Il.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)}i.push([o,this._makeCtrlPt(s),a]);break}case Il.PerpendicularWithArc:{const o=this._cp2(r,0,-2),a=this._cp3(r,o,.5,-1);let l=this._sub(o,s);const c=this._norm(l);l[0]/=c,l[1]/=c;const d=this._crossProduct(l,this._sub(a,s));let p=this._dotProduct(l,this._sub(a,s));p<.05*c?p=.05*c:p>.95*c&&(p=.95*c);const y=[s[0]+l[0]*p,s[1]+l[1]*p];this._leftPerpendicular(l);let v=[];v.push([y[0]-l[0]*d,y[1]-l[1]*d]),v.push([y[0]+l[0]*d,y[1]+l[1]*d]),i.push(v);const S=[o[0]+l[0]*d,o[1]+l[1]*d];l=this._sub(o,S);const I=Math.cos(Math.PI/18);let O=Math.sin(Math.PI/18);d<0&&(O=-O),v=[s,o];for(let L=1;L<=9;L++)this._rotateDirect(l,I,O),v.push(this._add(S,l));i.push(v);break}case Il.ClosedHalfCircle:{const o=this._cp2(r,2,0),a=this._mid(s,o),l=this._sub(o,a),c=Math.cos(Math.PI/18),d=Math.sin(Math.PI/18),p=[s,o];for(let y=1;y<=18;y++)this._rotateDirect(l,c,d),p.push(this._add(a,l));i.push(p);break}case Il.TripleParallelExtended:{const o=this._cp2(r,0,-2),a=this._cp3(r,o,1,-2),l=this._mid(s,o),c=this._sub(a,o);this._normalize(c);const d=Math.abs(this._crossProduct(c,this._sub(l,o)))/2,p=this._dist(o,a),y=[o,s];y.push([s[0]+c[0]*p*.5,s[1]+c[1]*p*.5]),i.push(y);const v=[];v.push([l[0]-c[0]*d,l[1]-c[1]*d]),v.push([l[0]+c[0]*p*.375,l[1]+c[1]*p*.375]),dj(v[v.length-1],1),v.push([l[0]+c[0]*p*.75,l[1]+c[1]*p*.75]),i.push(v);const S=[o,a];i.push(S);break}case Il.ParallelWithTicks:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(a,o);this._normalize(l);const c=this._crossProduct(l,this._sub(a,s));this._leftPerpendicular(l),this._addAngledTicks(i,s,o,a),this._addAngledTicks(i,this._mix(s,1,l,c),this._mix(o,1,l,c),this._mid(s,o));break}case Il.Parallel:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(o,s);this._normalize(l);const c=this._leftPerp(l),d=this._crossProduct(l,this._sub(a,s));let p=[s,o];i.push(p),p=[],p.push([s[0]+c[0]*d,s[1]+c[1]*d]),p.push([o[0]+c[0]*d,o[1]+c[1]*d]),i.push(p);break}case Il.PerpendicularToFirstSegment:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._mid(s,o),c=this._sub(o,s);this._normalize(c);const d=this._crossProduct(c,this._sub(a,s));this._leftPerpendicular(c);const p=[];p.push([l[0]-c[0]*d*.25,l[1]-c[1]*d*.25]),p.push([l[0]+c[0]*d*1.25,l[1]+c[1]*d*1.25]),i.push(p);break}case Il.ParallelOffset:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(o,s);this._normalize(l);const c=this._crossProduct(l,this._sub(a,s));this._leftPerpendicular(l);const d=[];d.push([s[0]-l[0]*c,s[1]-l[1]*c]),d.push([o[0]-l[0]*c,o[1]-l[1]*c]),i.push(d);const p=[];p.push([s[0]+l[0]*c,s[1]+l[1]*c]),p.push([o[0]+l[0]*c,o[1]+l[1]*c]),i.push(p);break}case Il.OffsetOpposite:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(o,s);this._normalize(l);const c=this._crossProduct(l,this._sub(a,s));this._leftPerpendicular(l);const d=[];d.push([s[0]-l[0]*c,s[1]-l[1]*c]),d.push([o[0]-l[0]*c,o[1]-l[1]*c]),i.push(d);break}case Il.OffsetSame:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(o,s);this._normalize(l);const c=this._crossProduct(l,this._sub(a,s));this._leftPerpendicular(l);const d=[];d.push([s[0]+l[0]*c,s[1]+l[1]*c]),d.push([o[0]+l[0]*c,o[1]+l[1]*c]),i.push(d);break}case Il.CircleWithArc:{let o=this._cp2(r,3,0);const a=this._cp3(r,o,.5,-1);let l,c;if(n>=4)l=r[3],c=this._crossProduct(this._sub(l,o),this._sub(a,o))>0;else{l=o,c=this._crossProduct(this._sub(l,s),this._sub(a,s))>0;const S=24*this._geomUnitsPerPoint,I=this._sub(l,s);this._normalize(I,S);const O=Math.sqrt(2)/2;this._rotateDirect(I,O,c?O:-O),o=this._add(s,I)}const d=this._sub(o,s),p=Math.cos(Math.PI/18),y=Math.sin(Math.PI/18),v=[o];for(let S=1;S<=36;S++)this._rotateDirect(d,p,y),v.push(this._add(s,d));this._add90DegArc(v,o,l,a,c),dj(v[v.length-8],1),i.push(v);break}case Il.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 L=s;s=l,a=o;const N=this._dist(s,L),G=this._dist(a,L);let V=30*this._geomUnitsPerPoint;.5*N0?this._rotateDirect(I,S,-S):this._rotateDirect(I,S,S);let O=[];O.push(l),O.push(this._add(c,I)),O.push(this._sub(c,I)),O.push(s),i.push(O),I=this._sub(a,o),this._normalize(I,v),this._crossProduct(I,this._sub(s,o))<0?this._rotateDirect(I,S,S):this._rotateDirect(I,S,-S),O=[],O.push(o),O.push(this._add(d,I)),O.push(this._sub(d,I)),O.push(a),i.push(O);break}case Il.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 c=[l[0]/8,l[1]/8],d=this._sub(this._mid(o,a),c);i.push([d,s]);break}case Il.LineExcludingLastSegment:{const o=this._arrowPath(r),a=[];let l=o.length-2;for(;l--;)a.push(o[l]);i.push(a);break}case Il.MultivertexArrow:{const o=this._arrowPath(r),a=[];this._addArrow(a,o,!1),i.push(a);break}case Il.CrossedArrow:{const o=this._arrowPath(r),a=[];this._addArrow(a,o,!0),i.push(a);break}case Il.ChevronArrow:{const[o,a]=this._arrowLastSeg(r),l=10*this._geomUnitsPerPoint,c=this._sub(s,o);this._normalize(c);const d=this._crossProduct(c,this._sub(a,o)),p=this._leftPerp(c),y=[a[0]-p[0]*d*2,a[1]-p[1]*d*2],v=[];v.push([a[0]+c[0]*l,a[1]+c[1]*l]),v.push(s),v.push([y[0]+c[0]*l,y[1]+c[1]*l]),i.push(v);break}case Il.ChevronArrowOffset:{const[o,a]=this._arrowLastSeg(r),l=this._sub(s,o);this._normalize(l);const c=this._crossProduct(l,this._sub(a,o));this._leftPerpendicular(l);const d=[a[0]-l[0]*c,a[1]-l[1]*c],p=[];p.push([d[0]+l[0]*c*.5,d[1]+l[1]*c*.5]),p.push(this._mid(d,s)),p.push([d[0]-l[0]*c*.5,d[1]-l[1]*c*.5]),i.push(p);break}case Il.PartialFirstSegment:{const[o,a]=this._arrowLastSeg(r),l=this._sub(s,o);this._normalize(l);const c=this._crossProduct(l,this._sub(a,o));this._leftPerpendicular(l);const d=[a[0]-l[0]*c,a[1]-l[1]*c];i.push([o,d]);break}case Il.Arch:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,1),l=this._sub(s,o),c=this._mix(a,1,l,.55),d=this._mix(a,1,l,-.55),p=[s];this._addBezier2(p,s,c,a,4),this._addBezier2(p,a,d,o,4),i.push(p);break}case Il.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 c=[l[0]/8,l[1]/8],d=this._sub(this._mid(o,a),c),p=this._sub(this._mix(o,.75,a,.25),c),y=this._sub(this._mix(o,.25,a,.75),c),v=[o];this._addBezier2(v,o,p,d,3),this._addBezier2(v,d,y,a,3),i.push(v);for(let S=0;S<8;S++){const I=v[2*S+1],O=[this._clone(I)];O.push(this._add(I,[l[0]/4,l[1]/4])),i.push(O)}break}case Il.Arc90Degrees:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,1),l=[o];this._add90DegArc(l,o,s,a),i.push(l);break}case Il.FullGeometry:default:i.push(r)}}return i}},X2t=class rre{static local(){return rre.instance===null&&(rre.instance=new rre),rre.instance}execute(e,i,r,n,s){return new KWi(e,i,r)}};X2t.instance=null;let KWi=class extends Vfe{constructor(e,i,r){super(e,!0,!0),this._curveHelper=new cO,this._beginCut=(i.beginCut!==void 0?i.beginCut:1)*r,this._endCut=(i.endCut!==void 0?i.endCut:1)*r,this._middleCut=(i.middleCut!==void 0?i.middleCut:0)*r,this._invert=i.invert!==void 0&&i.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(e){const i=this._beginCut,r=this._endCut,n=this._middleCut,s=this._curveHelper.calculatePathLength(e),o=[];if(this._invert){if(!(i===0&&r===0&&n===0))if(i+r+n>=s)o.push(e);else{let a=this._curveHelper.getSubCurve(e,0,i);a&&o.push(a),a=this._curveHelper.getSubCurve(e,.5*(s-n),.5*(s+n)),a&&o.push(a),a=this._curveHelper.getSubCurve(e,s-r,r),a&&o.push(a)}}else if(i===0&&r===0&&n===0)o.push(e);else if(!(i+r+n>=s))if(n===0){const a=this._curveHelper.getSubCurve(e,i,s-r);a&&o.push(a)}else{let a=this._curveHelper.getSubCurve(e,i,.5*(s-n));a&&o.push(a),a=this._curveHelper.getSubCurve(e,.5*(s+n),s-r),a&&o.push(a)}return o.length===0?null:{paths:o}}};const K2t=1e-7;let Ufe=class{constructor(){this._values=[],this.extPtGap=0,this.ctrlPtGap=0,this._length=0,this._currentValue=0}isEmpty(){return this._values.length===0}size(){return this._values.length}init(e,i,r=!0){if(this._setEmpty(),!e||e.length===0)return!1;for(let n=0;n0&&(s/=this._currentPosition.segmentLength),this._currentPosition.copyTo(i);i.abscissa+e*this._partLengthRatio>i.segmentLength+this._tolerance;){if(r){if(r.length===0)if(s===0){const a=this._path[i.segment];r.push([a[0],a[1]])}else r.push(this.getSegCoord2D(this._path,i.segment,s));const o=this._path[i.segment+1];r.push([o[0],o[1]])}if(s=0,e-=(i.segmentLength-i.abscissa)/this._partLengthRatio,this._partSegCount)i.segment=this._nextSegment(),i.segmentLength=this.calculateSegLength(this._path,i.segment),i.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return n!==yF.FAIL&&(i.segmentLength=this.calculateSegLength(this._path,i.segment),i.isPartEnd=!0,n===yF.END?(i.abscissa=i.segmentLength,i.isPathEnd=!0):i.abscissa=i.segmentLength+e,!0);this._currentPosition.copyTo(i)}}if(i.abscissa+=e*this._partLengthRatio,r){if(r.length===0)if(s===0){const a=this._path[i.segment];r.push([a[0],a[1]])}else r.push(this.getSegCoord2D(this._path,i.segment,s));const o=i.abscissa/i.segmentLength;if(o===1){const a=this._path[i.segment+1];r.push([a[0],a[1]])}else r.push(this.getSegCoord2D(this._path,i.segment,o))}return this._partSegCount||Math.abs(i.abscissa-i.segmentLength)=this._path.length&&(r=0),this._ctrlPtEnd=hQ(this._path[r])===1,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=i;)n-=i,i=this._pattern.nextValue(),o=!o;i-=n,o?(this._walker.nextPosition(i),i=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(i),i=this._pattern.nextValue(),this._walker.nextPosition(i),i=this._pattern.nextValue())}let r=this._walker.nextCurve(i);return r?this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(this._firstCurve.splice(0,1),pj.mergePath(r,this._firstCurve),this._firstCurve=null)):(i=this._pattern.nextValue(),!this._walker.nextPosition(i)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(r=this._firstCurve,this._firstCurve=null)):this.iteratePath=!0):(this.iteratePath=!1,r=this._firstCurve,this._firstCurve=null),{paths:[r]}}},Z2t=class sre{static local(){return sre.instance===null&&(sre.instance=new sre),sre.instance}execute(e,i,r,n,s){return new ZWi(e,i,r,n,s)}};Z2t.instance=null;let ZWi=class{constructor(e,i,r,n,s){switch(this._inputGeometries=e,this._tileKey=n,this._geometryEngine=s,this._width=(i.width!==void 0?i.width:2)*r,i.method){case HN.Mitered:case HN.Bevelled:case HN.Rounded:case HN.TrueBuffer:case HN.Square:}this._option=i.option}next(){let e;for(;e=this._inputGeometries.next();){if(ac(e)&&this._width>0){if(Math.min(e.xmax-e.xmin,e.ymax-e.ymin)-2*this._width<0)return e;const i=[];return i.push([[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]),i.push([[e.xmin+this._width,e.ymin+this._width],[e.xmax-this._width,e.ymin+this._width],[e.xmax-this._width,e.ymax-this._width],[e.xmin+this._width,e.ymax-this._width],[e.xmin+this._width,e.ymin+this._width]]),{rings:i}}if(Va(e)){let i=null;const r=this._geometryEngine;let n=e;if(this._tileKey&&(n=xLe(e,Math.abs(this._width)+1),!n||!n.rings||n.rings.length===0))continue;if(ye(r)&&(i=r.buffer(rr.WebMercator,n,-this._width,1)),this._width>0){const s=[];for(const o of e.rings)o&&s.push(o);if(i)for(const o of i.rings)o&&s.push(o.reverse());if(s.length)return{rings:s}}}}return null}},Q2t=class ore{static local(){return ore.instance===null&&(ore.instance=new ore),ore.instance}execute(e,i,r,n,s){return new QWi(e,i,r)}};Q2t.instance=null;let QWi=class extends Vfe{constructor(e,i,r){super(e,!1,!0),this._curveHelper=new cO,this._length=(i.length!==void 0?i.length:20)*r,this._angle=i.angle!==void 0?i.angle:225,this._position=i.position!==void 0?i.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){if(this._curveHelper.isEmpty(e,!1))return null;const i=e[0],r=e[e.length-1],n=[r[0]-i[0],r[1]-i[1]];this._curveHelper.normalize(n);const s=[i[0]+(r[0]-i[0])*this._position/100,i[1]+(r[1]-i[1])*this._position/100],o=Math.cos((90-this._angle)/180*Math.PI);let a=Math.sin((90-this._angle)/180*Math.PI);return this._mirror&&(a=-a),this._mirror=!this._mirror,{paths:[[i,[s[0]-this._length/2*o,s[1]-this._length/2*a],[s[0]+this._length/2*o,s[1]+this._length/2*a],r]]}}},eSt=class are{static local(){return are.instance===null&&(are.instance=new are),are.instance}execute(e,i,r,n,s){return new eqi(e,i,r)}};eSt.instance=null;let eqi=class{constructor(e,i,r){this._inputGeometries=e,this._offsetX=i.offsetX!==void 0?i.offsetX*r:0,this._offsetY=i.offsetY!==void 0?-i.offsetY*r:0}next(){let e=this._inputGeometries.next();for(;e;){if(ac(e))return{xmin:e.xmin+this._offsetX,xmax:e.xmax+this._offsetX,ymin:e.ymin+this._offsetY,ymax:e.ymax+this._offsetY};if(Va(e)){const i=hi(e);return this._moveMultipath(i.rings,this._offsetX,this._offsetY),i}if(Lu(e)){const i=hi(e);return this._moveMultipath(i.paths,this._offsetX,this._offsetY),i}if(sg(e)){const i=hi(e);return this._movePath(i.points,this._offsetX,this._offsetY),i}if(Wy(e))return{x:e.x+this._offsetX,y:e.y+this._offsetY};e=this._inputGeometries.next()}return null}_moveMultipath(e,i,r){if(e)for(const n of e)this._movePath(n,i,r)}_movePath(e,i,r){if(e)for(const n of e)n[0]+=i,n[1]+=r}},tSt=class lre{static local(){return lre.instance===null&&(lre.instance=new lre),lre.instance}execute(e,i,r,n,s){return new tqi(e,i,r,n,s)}};tSt.instance=null;let tqi=class{constructor(e,i,r,n,s){this._inputGeometries=e,this._tileKey=n,this._geometryEngine=s,this._curveHelper=new cO,this._offset=(i.offset??1)*r,this._method=i.method,this._option=i.option,this._offsetFlattenError=pQ*r}next(){let e;for(;e=this._inputGeometries.next();){if(this._offset===0)return e;if(ac(e)){if(this._method===ZP.Rounded&&this._offset>0){const n=[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]],s=this._curveHelper.offset(n,-this._offset,this._method,4,this._offsetFlattenError);return s?{rings:[s]}:null}if(Math.min(e.xmax-e.xmin,e.ymax-e.ymin)+2*this._offset>0)return{xmin:e.xmin-this._offset,xmax:e.xmax+this._offset,ymin:e.ymin-this._offset,ymax:e.ymax+this._offset}}const i=this._geometryEngine;if(lt(i))return null;let r=e;if(Va(e)){if(this._tileKey&&(r=xLe(e,Math.abs(this._offset)+1),!r||!r.rings||r.rings.length===0))continue}else if(Lu(e)&&this._tileKey&&(r=L2t(e,Math.abs(this._offset)+1),!r||!r.paths||r.paths.length===0))continue;return i.offset(rr.WebMercator,r,-this._offset,1,this._method,4,this._offsetFlattenError)}return null}},iSt=class ure{static local(){return ure.instance===null&&(ure.instance=new ure),ure.instance}execute(e,i,r,n,s){return new iqi(e,i,r)}};iSt.instance=null;let iqi=class{constructor(e,i,r){this._inputGeometries=e,this._reverse=i.reverse===void 0||i.reverse}next(){let e=this._inputGeometries.next();for(;e;){if(!this._reverse)return e;if(Lu(e)){const i=hi(e);return UWi(i.paths),i}e=this._inputGeometries.next()}return null}},rSt=class cre{static local(){return cre.instance===null&&(cre.instance=new cre),cre.instance}execute(e,i,r,n,s){return new rqi(e,i,r)}};rSt.instance=null;let rqi=class{constructor(e,i,r){this._inputGeometries=e,this._rotateAngle=i.angle!==void 0?i.angle*Math.PI/180:0}next(){let e=this._inputGeometries.next();for(;e;){if(this._rotateAngle===0)return e;const i=_o();DC(i,e);const r=(i[2]+i[0])/2,n=(i[3]+i[1])/2;if(ac(e)){const s={rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]};return this._rotateMultipath(s.rings,r,n),s}if(Va(e)){const s=hi(e);return this._rotateMultipath(s.rings,r,n),s}if(Lu(e)){const s=hi(e);return this._rotateMultipath(s.paths,r,n),s}if(sg(e)){const s=hi(e);return this._rotatePath(s.points,r,n),s}if(Wy(e))return e;e=this._inputGeometries.next()}return null}_rotateMultipath(e,i,r){if(e)for(const n of e)this._rotatePath(n,i,r)}_rotatePath(e,i,r){if(e){const n=Math.cos(this._rotateAngle),s=Math.sin(this._rotateAngle);for(const o of e){const a=o[0]-i,l=o[1]-r;o[0]=i+a*n-l*s,o[1]=r+a*s+l*n}}}},nSt=class hre{static local(){return hre.instance===null&&(hre.instance=new hre),hre.instance}execute(e,i,r,n,s){return new nqi(e,i,r)}};nSt.instance=null;let nqi=class{constructor(e,i,r){this._inputGeometries=e,this._xFactor=i.xScaleFactor!==void 0?i.xScaleFactor:1.15,this._yFactor=i.yScaleFactor!==void 0?i.yScaleFactor:1.15}next(){let e=this._inputGeometries.next();for(;e;){if(this._xFactor===1&&this._yFactor===1)return e;const i=_o();DC(i,e);const r=(i[2]+i[0])/2,n=(i[3]+i[1])/2;if(ac(e)){const s={rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]};return this._scaleMultipath(s.rings,r,n),s}if(Va(e)){const s=hi(e);return this._scaleMultipath(s.rings,r,n),s}if(Lu(e)){const s=hi(e);return this._scaleMultipath(s.paths,r,n),s}if(sg(e)){const s=hi(e);return this._scalePath(s.points,r,n),s}if(Wy(e))return e;e=this._inputGeometries.next()}return null}_scaleMultipath(e,i,r){if(e)for(const n of e)this._scalePath(n,i,r)}_scalePath(e,i,r){if(e)for(const n of e){const s=(n[0]-i)*this._xFactor,o=(n[1]-r)*this._yFactor;n[0]=i+s,n[1]=r+o}}},sSt=class dre{static local(){return dre.instance===null&&(dre.instance=new dre),dre.instance}execute(e,i,r,n,s){return new sqi(e,i,r)}};sSt.instance=null;let sqi=class{constructor(e,i,r){this._inputGeometries=e,this._height=(i.amplitude!==void 0?i.amplitude:2)*r,this._period=(i.period!==void 0?i.period:3)*r,this._style=i.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new Ufe,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new zfe,this._walker.updateTolerance(r)}next(){let e=this._inputGeometries.next();for(;e;){if(this._height===0||this._period===0)return e;if(Lu(e)){const i=this._processGeom(e.paths);if(i.length)return{paths:i}}if(Va(e)){const i=this._processGeom(e.rings);if(i.length)return{rings:i}}e=this._inputGeometries.next()}return null}_processGeom(e){const i=[];for(const r of e)if(this._walker.init(r,this._pattern))switch(this._style){case uU.Sinus:default:i.push(this._constructCurve(r,!1));break;case uU.Square:i.push(this._constructSquare(r));break;case uU.Triangle:i.push(this._constructTriangle(r));break;case uU.Random:i.push(this._constructCurve(r,!0))}else i.push(r);return i}_constructCurve(e,i){const r=new pj,n=this._walker.calculatePathLength(e);let s=Math.round(n/this._period);s===0&&(s=1);const o=s*16+1,a=n/s,l=this._period/16,c=1/o,d=2*Math.PI*n/a,p=2*Math.PI*Math.random(),y=2*Math.PI*Math.random(),v=2*Math.PI*Math.random(),S=.75-Math.random()/2,I=.75-Math.random()/2,O=new hO;this._walker.curPointAndAngle(O),r.startPath(O.pt);let L=0;for(;;){if(!this._walker.nextPointAndAngle(l,O)){r.lineTo(e[e.length-1]);break}{const N=L;let G;if(L+=c,i){const V=this._height/2*(1+.3*Math.sin(S*d*N+p));G=V*Math.sin(d*N+y),G+=V*Math.sin(I*d*N+v),G/=2}else G=.5*this._height*Math.sin(.5*d*N);r.lineTo([O.pt[0]-G*O.sa,O.pt[1]+G*O.ca])}}return r.path()}_constructSquare(e){const i=new pj,r=this._walker.calculatePathLength(e);Math.round(r/this._period);let n=!0;for(;;){let s=!1;if(this._walker.curPositionIsValid()){const o=new hO;this._walker.curPointAndAngle(o);const a=new hO;if(this._walker.nextPointAndAngle(this._period,a)){const l=new hO;this._walker.nextPointAndAngle(this._period,l)&&(n?(i.startPath(o.pt),n=!1):i.lineTo(o.pt),i.lineTo([o.pt[0]-this._height/2*o.sa,o.pt[1]+this._height/2*o.ca]),i.lineTo([a.pt[0]-this._height/2*a.sa,a.pt[1]+this._height/2*a.ca]),i.lineTo([a.pt[0]+this._height/2*a.sa,a.pt[1]-this._height/2*a.ca]),i.lineTo([l.pt[0]+this._height/2*l.sa,l.pt[1]-this._height/2*l.ca]),s=!0)}}if(!s){i.lineTo(this._walker.getPathEnd());break}}return i.path()}_constructTriangle(e){const i=new pj,r=this._walker.calculatePathLength(e);Math.round(r/this._period);let n=!0;for(;;){let s=!1;if(this._walker.curPositionIsValid()){const o=new hO;this._walker.curPointAndAngle(o);const a=new hO;if(this._walker.nextPointAndAngle(this._period/2,a)){const l=new hO;this._walker.nextPointAndAngle(this._period,l)&&(this._walker.nextPosition(this._period/2)&&(n?(i.startPath(o.pt),n=!1):i.lineTo(o.pt),i.lineTo([a.pt[0]-this._height/2*a.sa,a.pt[1]+this._height/2*a.ca]),i.lineTo([l.pt[0]+this._height/2*l.sa,l.pt[1]-this._height/2*l.ca])),s=!0)}}if(!s){i.lineTo(this._walker.getPathEnd());break}}return i.path()}},oSt=class pre{static local(){return pre.instance===null&&(pre.instance=new pre),pre.instance}execute(e,i,r,n,s){return new oqi(e,i,r)}};oSt.instance=null;let oqi=class extends dQ{constructor(e,i,r){super(e,!0,!0),this._geometryWalker=new zfe,this._geometryWalker.updateTolerance(r),this._angleToLine=i.angleToLine??!0,this._offset=(i.offset?i.offset:0)*r,this._originalEndings=i.endings,this._offsetAtEnd=(i.customEndingOffset?i.customEndingOffset:0)*r,this._position=-(i.offsetAlongLine?i.offsetAlongLine:0)*r,this._pattern=new Ufe,this._pattern.init(i.placementTemplate,!1),this._pattern.scale(r),this._endings=this._originalEndings}processPath(e){if(this._pattern.isEmpty())return null;let i;if(this.iteratePath)i=this._pattern.nextValue();else{this._originalEndings===fS.WithFullGap&&this.isClosed?this._endings=fS.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let n,s=!0;switch(this._endings){case fS.NoConstraint:n=-this._position,n=this._adjustPosition(n),s=!1;break;case fS.WithHalfGap:default:n=-this._pattern.lastValue()/2;break;case fS.WithFullGap:n=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case fS.WithMarkers:n=0;break;case fS.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,i=o,this.iteratePath=!0}const r=new hO;return this._geometryWalker.nextPointAndAngle(i,r)?this._endings===fS.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===fS.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 i=e/this._pattern.length();return i-=Math.floor(i),i*this._pattern.length()}},aSt=class fre{static local(){return fre.instance===null&&(fre.instance=new fre),fre.instance}execute(e,i,r,n,s){return new aqi(e,i,r)}};aSt.instance=null;let aqi=class extends dQ{constructor(e,i,r){super(e,!1,!0),this._curveHelper=new cO,this._angleToLine=i.angleToLine===void 0||i.angleToLine,this._offset=i.offset!==void 0?i.offset*r:0,this._type=i.extremityPlacement,this._position=i.offsetAlongLine!==void 0?i.offsetAlongLine*r:0,this._beginProcessed=!1}processPath(e){let i;switch(this._type){case F_.Both:default:this._beginProcessed?(i=this._atExtremities(e,this._position,!1),this._beginProcessed=!1,this.iteratePath=!1):(i=this._atExtremities(e,this._position,!0),this._beginProcessed=!0,this.iteratePath=!0);break;case F_.JustBegin:i=this._atExtremities(e,this._position,!0);break;case F_.JustEnd:i=this._atExtremities(e,this._position,!1);case F_.None:}return i}_atExtremities(e,i,r){const n=e.length;if(n<2)return null;const s=r?1:n-2,o=r?n:-1,a=r?1:-1;let l,c=0,d=r?e[0]:e[n-1];for(let p=s;p!==o;p+=a){l=d,d=e[p];const y=this._curveHelper.calculateLength(l,d);if(c+y>i){const v=(i-c)/y,[S,I]=this._curveHelper.getAngleCS(l,d,v),O=CLe(l,d,v);return this.internalPlacement.setTranslate(O[0]-this._offset*I,O[1]+this._offset*S),this._angleToLine&&this.internalPlacement.setRotateCS(-S,-I),this.internalPlacement}c+=y}return null}},lSt=class mre{static local(){return mre.instance===null&&(mre.instance=new mre),mre.instance}execute(e,i,r,n,s){return new lqi(e,i,r)}};lSt.instance=null;let lqi=class extends dQ{constructor(e,i,r){super(e,!0,!0),this._walker=new zfe,this._walker.updateTolerance(r),this._angleToLine=i.angleToLine===void 0||i.angleToLine,this._offset=i.offset!==void 0?i.offset*r:0,this._beginGap=i.beginPosition!==void 0?i.beginPosition*r:0,this._endGap=i.endPosition!==void 0?i.endPosition*r:0,this._flipFirst=i.flipFirst===void 0||i.flipFirst,this._pattern=new Ufe,this._pattern.init(i.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 i;if(this.iteratePath){const a=this._pattern.nextValue()*this._subPathLen,l=this._beginGap+a;i=l-this._prevPos,this._prevPos=l}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=this._walker.calculatePathLength(e)-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;i=l-this._prevPos,this._prevPos=l,this.iteratePath=!0}const r=new hO;if(!this._walker.nextPointAndAngle(i,r,yF.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 vF=512,uqi=10,cqi=12,uSt=25,IE=24;function hqi(t){return t.rings!==void 0}let cSt=class gre{static local(){return gre.instance===null&&(gre.instance=new gre),gre.instance}execute(e,i,r,n,s){return new dqi(e,i,r,n,s)}};cSt.instance=null;let dqi=class M8{constructor(e,i,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(i.stepX??16)*r,this._stepY=Math.abs(i.stepY??16)*r,this._stepX!==0&&this._stepY!==0&&e&&hqi(e)&&e.rings){if(this._gridType=i.gridType??OJ.Fixed,this._gridType===OJ.Random){const o=i.seed??13,a=1;this._randomLCG=new bC(o*a),this._randomness=(i.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=i.gridAngle??0,this._shiftOddRows=i.shiftOddRows??!1,this._offsetX=(i.offsetX??0)*r,this._offsetY=(i.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]=n.split("/"),c=parseFloat(a),d=parseFloat(l);this._graphicOriginX=-d*vF,this._graphicOriginY=c*vF,this._testInsidePolygon=!0}this._internalPlacement=new hj,this._calculateMinMax(e),this._geometry=e}}next(){return this._geometry?this._nextInside():null}_buildRandomValues(){if(!M8._randValues){M8._randValues=[];for(let e=0;e=G,this._polygonMin=this._verticalSubdivision?y:S,this._testInsidePolygon){let V=0-this._graphicOriginX-this._offsetX-this._stepX,Y=vF-this._graphicOriginX-this._offsetX+this._stepX,X=-vF-this._graphicOriginY-this._offsetY-this._stepY,te=0-this._graphicOriginY-this._offsetY+this._stepY;if(O){const re=[[V,X],[V,te],[Y,X],[Y,te]];V=X=Number.MAX_VALUE,Y=te=-Number.MAX_VALUE;for(const fe of re){const ge=this._cosAngle*fe[0]-this._sinAngle*fe[1],_e=this._sinAngle*fe[0]+this._cosAngle*fe[1];V=Math.min(V,ge),Y=Math.max(Y,ge),X=Math.min(X,_e),te=Math.max(te,_e)}}l=l!==Number.MAX_VALUE?Math.max(l,V):V,c=c!==Number.MAX_VALUE?Math.max(c,X):X,d=d!==-Number.MAX_VALUE?Math.min(d,Y):Y,p=p!==-Number.MAX_VALUE?Math.min(p,te):te}this._xMin=Math.round(l/this._stepX),this._xMax=Math.round(d/this._stepX),this._yMin=Math.round(c/this._stepY),this._yMax=Math.round(p/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._testInsidePolygon&&L>cqi&&(N>uSt||G>uSt)&&this._buildAccelerationMap(e,S,I,y,v)}_buildAccelerationMap(e,i,r,n,s){const{rings:o}=e,a=new Map,l=this._verticalSubdivision,c=l?s-n:r-i;let d=Math.ceil(c/uqi);if(d<=1)return;const p=Math.floor(c/d);let y,v,S,I,O,L,N,G,V,Y;d++,this._delta=p,l?(G=-vF-this._stepY,V=this._stepY,Y=n):(G=-this._stepX,V=vF+this._stepX,Y=i);for(let X=0;XV&&S[1]>V)continue;I=Math.min(v[1],S[1]),O=Math.max(v[1],S[1])}else{if(v[0]===S[0]||v[0]V&&S[0]>V)continue;I=Math.min(v[0],S[0]),O=Math.max(v[0],S[0])}for(;IL&&hSt(N,X,te,a)}this._accelerationMap=a}_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 i=this._currentY*this._stepY+this._offsetY;let r,n;if(this._currentX++,this._gridType===OJ.Random){const s=(this._currentX%IE+IE)%IE,o=(this._currentY%IE+IE)%IE;r=this._graphicOriginX+e+this._stepX*this._randomness*(.5-M8._randValues[o*IE+s])*2/3,n=this._graphicOriginY+i+this._stepY*this._randomness*(.5-M8._randValues[o*IE+s+1])*2/3}else r=this._graphicOriginX+this._cosAngle*e+this._sinAngle*i,n=this._graphicOriginY-this._sinAngle*e+this._cosAngle*i;if(!this._testInsidePolygon||this._isInsidePolygon(r,n,this._geometry))return this._internalPlacement.setTranslate(r,n),this._internalPlacement}}_isInsidePolygon(e,i,r){const{rings:n}=r;if(lt(this._accelerationMap))return pqi(e,i,r);const s=this._verticalSubdivision,o=s?i:e,a=Math.floor((o-this._polygonMin)/this._delta),l=this._accelerationMap.get(a);if(!l)return!1;let c,d,p,y,v,S=0;for(const I of l){v=I[0];const O=n[v];if(y=I[1],c=O[y-1],d=O[y],s){if(c[1]>i==d[1]>i)continue;p=(d[0]-c[0])*(i-c[1])-(d[1]-c[1])*(e-c[0])}else{if(c[0]>e==d[0]>e)continue;p=(d[1]-c[1])*(e-c[0])-(d[0]-c[0])*(i-c[1])}p>0?S++:S--}return S!==0}};function pqi(t,e,i){const{rings:r}=i;let n,s,o,a=0;for(const l of r){n=l.length;for(let c=1;ce!=o[1]>e&&((o[0]-s[0])*(e-s[1])-(o[1]-s[1])*(t-s[0])>0?a++:a--)}return a!==0}function hSt(t,e,i,r){let n=r.get(t);n||(n=[],r.set(t,n)),n.push([e,i])}const fqi=.001;let dSt=class yre{static local(){return yre.instance===null&&(yre.instance=new yre),yre.instance}execute(e,i,r,n,s){return new mqi(e,i,r)}};dSt.instance=null;let mqi=class extends dQ{constructor(e,i,r){super(e,!0,!0),this._curveHelper=new cO,this._angleToLine=i.angleToLine===void 0||i.angleToLine,this._offset=i.offset!==void 0?i.offset*r:0,this._relativeTo=i.relativeTo,this._position=i.startPointOffset!==void 0?i.startPointOffset*r:0,this._epsilon=fqi*r}processPath(e){const i=this._position;if(this._relativeTo===GD.SegmentMidpoint){for(this.iteratePath||(this._segmentCount=e.length,this._curSegment=1,this.iteratePath=!0);this._curSegmentr){const p=(r-a)/d,[y,v]=this._curveHelper.getAngleCS(o,l,p),S=CLe(o,l,p),I=n?-this._offset:this._offset;return this.internalPlacement.setTranslate(S[0]-I*v,S[1]+I*y),this._angleToLine&&(n?this.internalPlacement.setRotateCS(-y,-v):this.internalPlacement.setRotateCS(y,v)),this.internalPlacement}a+=d}return null}},pSt=class vre{static local(){return vre.instance===null&&(vre.instance=new vre),vre.instance}execute(e,i,r,n,s){return new yqi(e,i,r)}};pSt.instance=null;const gqi=1e-15;let yqi=class extends dQ{constructor(e,i,r){super(e,!0,!0),this._curveHelper=new cO,this._angleToLine=i.angleToLine===void 0||i.angleToLine,this._offset=i.offset!==void 0?i.offset*r:0,this._endPoints=i.placeOnEndPoints===void 0||i.placeOnEndPoints,this._controlPoints=i.placeOnControlPoints===void 0||i.placeOnControlPoints,this._regularVertices=i.placeOnRegularVertices===void 0||i.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 i=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(i[2]);let r=i[0],n=i[1];if(this._offset!==0){const s=Math.cos(i[2]),o=Math.sin(i[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;const i=jWi(e),r=e.length-1;let n,s,o=0,a=0,l=0,c=0,d=0;for(;oi+2*gqi;)e-t>i?e-=2*i:e+=2*i;return(t+e)/2}let vqi=class{constructor(e=_qi){this._data=[],this._compare=e}get size(){return this._data.length}enqueue(e){if(e==null)return;const{_data:i,_compare:r}=this;i.push(e);let n=i.length-1>>>0;const s=i[n];for(;n>0;){const o=n-1>>1,a=i[o];if(!(r(a,s)<=0))break;i[o]=s,i[n]=a,n=o}}dequeue(){const{_data:e,_compare:i}=this,r=e[0],n=e.pop();if(e.length===0)return r;e[0]=n;let s=0;const o=e.length,a=e[0];let l,c,d=null;for(;;){const p=2*s+1,y=2*s+2;if(d=null,p0&&(d=p)),yte?1:0,bqi=100*222045e-21;function wqi(t){const{rings:e}=t;if(!e||e.length===0)return null;const i=DC(_o(),t);if(!i)return null;const r=4*(Math.abs(i[0])+Math.abs(i[2])+Math.abs(i[1])+Math.abs(i[3])+1)*bqi;let n=0,s=0;for(let ge=0;ges&&(s=_e,n=ge)}if(Math.abs(s)<=2*r*r){const ge=Q8(_o(),e[n]);return[(ge[0]+ge[2])/2,(ge[1]+ge[3])/2]}const o=mje(e[n],!1,_o());if(o===null)return null;if(e.length===1&&e[0].length<4)return o;const a=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],l=[NaN,NaN,NaN,NaN],c=[NaN,NaN,NaN,NaN];let d=!1,p=fQ(o,t,!0);p.distance===0&&(d=!0,a[0][0]=o[0],a[0][1]=o[1],p=fQ(o,t,!1)),l[0]=p.distance,c[0]=0;const y=[NaN,NaN];let v=!1,S=.25,I=-1;const O=Q8(_o(),e[n]);let L=NaN;do if(L=NaN,a[1]=ELe(t,ILe(O[0],O[2],S),r,i),isNaN(a[1][0])||isNaN(a[1][1])||(p=fQ(a[1],t,!1),L=p.distance),!isNaN(L)&&L>r&&Wfe(a[1],t))v=!0,l[1]=L,c[1]=g6(a[1],o);else if(!isNaN(L)&&L>I&&(I=L,y[0]=a[1][0],y[1]=a[1][1]),S-=.01,S<.1){if(!(I>=0))break;v=!0,l[1]=I,a[1][0]=y[0],a[1][1]=y[1],c[1]=g6(a[1],o)}while(!v);v=!1,S=.5,I=-1;let N=.01,G=1;do if(L=NaN,a[2]=ELe(t,ILe(O[0],O[2],S),r,i),isNaN(a[2][0])||isNaN(a[2][1])||(p=fQ(a[2],t,!1),L=p.distance),!isNaN(L)&&L>r&&Wfe(a[2],t))v=!0,l[2]=L,c[2]=g6(a[2],o);else if(!isNaN(L)&&L>I)I=L,y[0]=a[2][0],y[1]=a[2][1];else if(L>I&&(I=L,y[0]=a[2][0],y[1]=a[2][1]),S=.5+N*G,N+=.01,G*=-1,S<.3||S>.7){if(!(I>=0))break;v=!0,l[2]=I,a[2][0]=y[0],a[2][1]=y[1],c[2]=g6(a[2],o)}while(!v);v=!1,S=.75,I=-1;do if(L=NaN,a[3]=ELe(t,ILe(O[0],O[2],S),r,i),isNaN(a[3][0])||isNaN(a[3][1])||(p=fQ(a[3],t,!1),L=p.distance),!isNaN(L)&&L>r&&Wfe(a[3],t))v=!0,l[3]=L,c[3]=g6(a[3],o);else if(L>I&&(I=L,y[0]=a[3][0],y[1]=a[3][1]),S+=.01,S>.9){if(!(I>=0))break;v=!0,l[3]=I,a[3][0]=y[0],a[3][1]=y[1],c[3]=g6(a[3],o)}while(!v);const V=[0,1,2,3],Y=d?0:1;let X;for(let ge=Y;ge<4;ge++)for(let _e=Y;_e<3;_e++){const Ie=c[_e],ke=c[_e+1];Cqi(Ie,ke)>0&&(X=V[_e],V[_e]=V[_e+1],V[_e+1]=X,c[_e]=ke,c[_e+1]=Ie)}let te=Y,re=0,fe=0;for(let ge=Y;ge<4;ge++){switch(ge){case 0:fe=2*l[V[ge]];break;case 1:fe=1.66666666*l[V[ge]];break;case 2:fe=1.33333333*l[V[ge]];break;case 3:fe=l[V[ge]]}fe>re&&(re=fe,te=V[ge])}return a[te]}function Wfe(t,e){const{rings:i}=e;let r=0;for(const n of i){const s=n.length;for(let o=1;ot[1]!=l[1]>t[1]&&((l[0]-a[0])*(t[1]-a[1])-(l[1]-a[1])*(t[0]-a[0])>0?r++:r--)}}return r!==0}function fQ(t,e,i){if(i&&Wfe(t,e))return{coord:t,distance:0};let r=1/0,n=0,s=0;const o=[0,0],{rings:a}=e;for(const l of a)if(!(l.length<2))for(let c=0;co?Np)r&fSt?(r&qfe?(e[1]+=p*(s-e[0])/d,e[0]=s):(e[1]+=p*(a-e[0])/d,e[0]=a),r=AE(e,t)):n&fSt?(n&qfe?(i[1]+=p*(s-i[0])/d,i[0]=s):(i[1]+=p*(a-i[0])/d,i[0]=a),n=AE(i,t)):r?(r&Yfe?(e[0]+=d*(o-e[1])/p,e[1]=o):(e[0]+=d*(l-e[1])/p,e[1]=l),r=AE(e,t)):(n&Yfe?(i[0]+=d*(o-i[1])/p,i[1]=o):(i[0]+=d*(l-i[1])/p,i[1]=l),n=AE(i,t));else if(r&mSt?(r&Yfe?(e[0]+=d*(o-e[1])/p,e[1]=o):(e[0]+=d*(l-e[1])/p,e[1]=l),r=AE(e,t)):n&mSt?(n&Yfe?(i[0]+=d*(o-i[1])/p,i[1]=o):(i[0]+=d*(l-i[1])/p,i[1]=l),n=AE(i,t)):r?(r&qfe?(e[1]+=p*(s-e[0])/d,e[0]=s):(e[1]+=p*(a-e[0])/d,e[0]=a),r=AE(e,t)):(n&qfe?(i[1]+=p*(s-i[0])/d,i[0]=s):(i[1]+=p*(a-i[0])/d,i[0]=a),n=AE(i,t)),r&n)return 0}while(r|n);return c}function AE(t,e){return(t[0]e[2]?1:0)<<1|(t[1]e[3]?1:0)<<3}function ILe(t,e,i){return t+(e-t)*i}function g6(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function Cqi(t,e){if(te)return 1;if(t===e)return 0;const i=isNaN(t),r=isNaN(e);return ir?1:0}let fj=class{constructor(e,i,r,n){this.x=e,this.y=i,this.cellSize=r,this.distancefromCellCenter=I9t(e,i,n),this.maxDistanceToPolygon=this.distancefromCellCenter+this.cellSize*Math.SQRT2}};const Tqi=1,Eqi=100;function Iqi(t){if(!t||!t.rings||t.rings.length===0)return null;const e=Q8(_o(),t.rings[0]);if(!e)return null;const i=e[2]-e[0],r=e[3]-e[1];if(i===0||r===0)return[e[0]+i/2,e[1]+r/2];const n=Math.max(Math.min(i,r)/Eqi,Tqi),s=new vqi((v,S)=>S.maxDistanceToPolygon-v.maxDistanceToPolygon),o=Math.min(i,r);let a=o/2,l=0,c=0;for(l=e[0];l0;)p=s.dequeue(),p.distancefromCellCenter>y.distancefromCellCenter&&(y=p),p.maxDistanceToPolygon-y.distancefromCellCenter<=n||(a=p.cellSize/2,s.enqueue(new fj(p.x-a,p.y-a,a,t)),s.enqueue(new fj(p.x+a,p.y-a,a,t)),s.enqueue(new fj(p.x-a,p.y+a,a,t)),s.enqueue(new fj(p.x+a,p.y+a,a,t)));return[y.x,y.y]}function Aqi(t){return t.rings!==void 0}let gSt=class _re{static local(){return _re.instance===null&&(_re.instance=new _re),_re.instance}execute(e,i,r,n,s){return new Pqi(e,i,r)}};gSt.instance=null;let Pqi=class{constructor(e,i,r){this._geometry=e,this._offsetX=i.offsetX!==void 0?i.offsetX*r:0,this._offsetY=i.offsetY!==void 0?i.offsetY*r:0,this._method=i.method!==void 0?i.method:cU.OnPolygon,this._internalPlacement=new hj}next(){const e=this._geometry;return this._geometry=null,e&&Aqi(e)?this._polygonCenter(e):null}_polygonCenter(e){let i=!1;switch(this._method){case cU.CenterOfMass:{const r=L9t(e);r&&(this._internalPlacement.setTranslate(r[0]+this._offsetX,r[1]+this._offsetY),i=!0)}break;case cU.BoundingBoxCenter:{const r=_o();DC(r,e),r&&(this._internalPlacement.setTranslate((r[2]+r[0])/2+this._offsetX,(r[3]+r[1])/2+this._offsetY),i=!0)}break;case cU.OnPolygon:default:{let r;r=Gi("polylabel-placement-enabled")?Iqi(e):wqi(e),r!==null&&(this._internalPlacement.setTranslate(r[0]+this._offsetX,r[1]+this._offsetY),i=!0)}}return i?this._internalPlacement:null}};function ALe(t){if(!t)return null;switch(t.type){case"CIMGeometricEffectAddControlPoints":return H2t.local();case"CIMGeometricEffectArrow":return W2t.local();case"CIMGeometricEffectBuffer":return q2t.local();case"CIMGeometricEffectControlMeasureLine":return Y2t.local();case"CIMGeometricEffectCut":return X2t.local();case"CIMGeometricEffectDashes":return J2t.local();case"CIMGeometricEffectDonut":return Z2t.local();case"CIMGeometricEffectJog":return Q2t.local();case"CIMGeometricEffectMove":return eSt.local();case"CIMGeometricEffectOffset":return tSt.local();case"CIMGeometricEffectReverse":return iSt.local();case"CIMGeometricEffectRotate":return rSt.local();case"CIMGeometricEffectScale":return nSt.local();case"CIMGeometricEffectWave":return sSt.local()}return null}function ySt(t){if(!t)return null;switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":return oSt.local();case"CIMMarkerPlacementAtExtremities":return aSt.local();case"CIMMarkerPlacementAtRatioPositions":return lSt.local();case"CIMMarkerPlacementInsidePolygon":return cSt.local();case"CIMMarkerPlacementOnLine":return dSt.local();case"CIMMarkerPlacementOnVertices":return pSt.local();case"CIMMarkerPlacementPolygonCenter":return gSt.local()}return null}function PLe(t){const e=t.getFrame(0);if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement)return e;const i=document.createElement("canvas");i.width=t.width,i.height=t.height;const r=i.getContext("2d");return e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0),i}let Xfe=class{constructor(e=0,i=0,r=0,n=0){this.x=e,this.y=i,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)}};function Oqi(t){return`rgb(${t.slice(0,3).toString()})`}function Rqi(t){return`rgba(${t.slice(0,3).toString()},${t[3]})`}let vSt=class{constructor(e){e&&(this._textRasterizationCanvas=e)}rasterizeText(e,i){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const r=this._textRasterizationCanvas,n=r.getContext("2d");this._setFontProperties(n,i),this._parameters=i,this._textLines=e.split(/\r?\n/),this._lineHeight=this._computeLineHeight();const s=this._computeTextWidth(n,i),{decoration:o,weight:a}=i.font;this._lineThroughWidthOffset=o&&o==="line-through"?.1*this._lineHeight:0;const l=this._lineHeight*this._textLines.length;r.width=s+2*this._lineThroughWidthOffset,r.height=l,this._renderedLineHeight=Math.round(this._lineHeight*i.pixelRatio),this._renderedHaloSize=i.halo.size*i.pixelRatio,this._renderedWidth=s*i.pixelRatio,this._renderedHeight=l*i.pixelRatio,this._lineThroughWidthOffset*=i.pixelRatio;const c=i.color??[0,0,0,0],d=i.halo&&i.halo.color?i.halo.color:[0,0,0,0];this._fillStyle=Rqi(c),this._haloStyle=Oqi(d);const p=this._renderedLineHeight,y=this._renderedHaloSize;n.save(),n.clearRect(0,0,r.width,r.height),this._setFontProperties(n,i);const v=Mqi(n.textAlign,this._renderedWidth)+y,S=y,I=y>0;let O=this._lineThroughWidthOffset,L=0;I&&this._renderHalo(n,v,S,O,L,i),L+=S,O+=v;for(const re of this._textLines)I?(n.globalCompositeOperation="destination-out",n.fillStyle="rgb(0, 0, 0)",n.fillText(re,O,L),n.globalCompositeOperation="source-over",n.fillStyle=this._fillStyle,n.fillText(re,O,L)):(n.fillStyle=this._fillStyle,n.fillText(re,O,L)),o&&o!=="none"&&this._renderDecoration(n,O,L,o,a),L+=p;n.restore();const N=this._renderedWidth+2*this._lineThroughWidthOffset,G=this._renderedHeight,V=n.getImageData(0,0,N,G),Y=new Uint8Array(V.data);if(i.premultiplyColors){let re;for(let fe=0;fe600)&&(r+=.3*e.measureText("w").width),r+=2*this._parameters.halo.size,Math.round(r)}_computeLineHeight(){let e=1.275*this._parameters.size;const i=this._parameters.font.decoration;return i&&i==="underline"&&(e*=1.3),Math.round(e+2*this._parameters.halo.size)}_renderDecoration(e,i,r,n,s,o){const a=.9*this._lineHeight,l=s==="bold"?.06:s==="bolder"?.09:.04;switch(e.textAlign){case"center":i-=this._renderedWidth/2;break;case"right":i-=this._renderedWidth}const c=e.textBaseline;if(n==="underline")switch(c){case"top":r+=a;break;case"middle":r+=a/2}else if(n==="line-through")switch(c){case"top":r+=a/1.5;break;case"middle":r+=a/3}const d=o?1.5*o:Math.ceil(a*l);e.save(),e.beginPath(),e.strokeStyle=e.fillStyle,e.lineWidth=d,e.moveTo(i-this._lineThroughWidthOffset,r),e.lineTo(i+this._renderedWidth+2*this._lineThroughWidthOffset,r),e.stroke(),e.restore()}};function Mqi(t,e){return t==="center"?.5*e:t==="right"?e:0}var Ad,Pd;function _St(t){switch(t){case"left":return Ad.Left;case"right":return Ad.Right;case"center":return Ad.Center}}function bSt(t){switch(t){case"top":return Pd.Top;case"middle":return Pd.Center;case"baseline":return Pd.Baseline;case"bottom":return Pd.Bottom}}function Dqi(t){switch(t){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return[Ad.Right,Pd.Bottom];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return[Ad.Center,Pd.Bottom];case"above-right":case"esriServerPointLabelPlacementAboveRight":return[Ad.Left,Pd.Bottom];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return[Ad.Right,Pd.Center];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return[Ad.Center,Pd.Center];case"center-right":case"esriServerPointLabelPlacementCenterRight":return[Ad.Left,Pd.Center];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return[Ad.Right,Pd.Top];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return[Ad.Center,Pd.Top];case"below-right":case"esriServerPointLabelPlacementBelowRight":return[Ad.Left,Pd.Top];default:return console.debug(`Found invalid placement type ${t}`),[Ad.Center,Pd.Center]}}function Fqi(t){switch(t){case Ad.Right:return-1;case Ad.Center:return 0;case Ad.Left:return 1;default:return console.debug(`Found invalid horizontal alignment ${t}`),0}}function Lqi(t){switch(t){case Pd.Top:return 1;case Pd.Center:return 0;case Pd.Bottom:case Pd.Baseline:return-1;default:return console.debug(`Found invalid vertical alignment ${t}`),0}}function kqi(t){switch(t){case"left":return Ad.Left;case"right":return Ad.Right;case"center":return Ad.Center}}function wSt(t){switch(t){case"above-along":case"below-along":case"center-along":case"esriServerLinePlacementAboveAlong":case"esriServerLinePlacementBelowAlong":case"esriServerLinePlacementCenterAlong":return!0;default:return!1}}(function(t){t[t.Left=-1]="Left",t[t.Center=0]="Center",t[t.Right=1]="Right"})(Ad||(Ad={})),function(t){t[t.Top=1]="Top",t[t.Center=0]="Center",t[t.Bottom=-1]="Bottom",t[t.Baseline=2]="Baseline"}(Pd||(Pd={}));let mQ=class PBe{constructor(e,i,r,n){this.center=lp(e,i),this.centerT=CT(),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 PBe(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,i=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+i)/r,o=(e.halfHeight+this.halfHeight+i)/n,a=Math.min(s,o);return Math.log2(a)}extend(e){const i=Math.min(this.xmin,e.xmin),r=Math.min(this.ymin,e.ymin),n=Math.max(this.xmax,e.xmax)-i,s=Math.max(this.ymax,e.ymax)-r,o=i+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 i=e.readF32(),r=e.readF32(),n=e.readInt32(),s=e.readInt32();return new PBe(i,r,n,s)}};const OLe=26,xSt=4,Nqi=OLe+xSt,$qi=OLe-6,SSt=3,S0=8,Bqi=Math.PI/180,_F=8,Gqi=1.5;let CSt=class{constructor(e,i,r,n){this._rotationT=d_(),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,i*=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]=i,o[2]=e+a,o[3]=i,o[4]=e,o[5]=i+l,o[6]=e+a,o[7]=i+l,this._data=o,this._setTextureCoords(s),this._scale=n,this._mosaic=r,this.x=e,this.y=i,this.maxOffset=Math.max(e+a,i+l)}get mosaic(){return this._mosaic}set angle(e){this._angle=e,qY(this._rotationT,-e),this._setOffsets(this._data)}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._data),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:i}=this._mosaic.metrics,r=i*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=tG(d_(),this._rotationT,this._transform);hIe(s,s,o);let a=1/0,l=1/0,c=0,d=0;for(let I=0;I<4;I++){const O=s[2*I],L=s[2*I+1];a=Math.min(a,O),l=Math.min(l,L),c=Math.max(c,O),d=Math.max(d,L)}const p=c-a,y=d-l,v=a+p/2,S=l+y/2;this._bounds=new mQ(v,S,p,y)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}_setOffsets(e){this._offsets||(this._offsets={upperLeft:0,upperRight:0,lowerLeft:0,lowerRight:0});const i=this._offsets,r=new Float32Array(8),n=tG(d_(),this._rotationT,this._transform);hIe(r,e,n),i.upperLeft=Ln(r[0]*S0,r[1]*S0),i.upperRight=Ln(r[2]*S0,r[3]*S0),i.lowerLeft=Ln(r[4]*S0,r[5]*S0),i.lowerRight=Ln(r[6]*S0,r[7]*S0)}_setTextureCoords({x:e,y:i,width:r,height:n}){this._texcoords={upperLeft:Ln(e,i),upperRight:Ln(e+r,i),lowerLeft:Ln(e,i+n),lowerRight:Ln(e+r,i+n)}}};const Vqi=(t,e)=>({code:0,page:0,sdf:!0,rect:new Ed(0,0,11,8),textureBinding:e,metrics:{advance:0,height:4,width:t,left:0,top:0}});function gQ(t,e){return t.forEach(i=>f0(i,i,e)),{upperLeft:Ln(S0*t[0][0],S0*t[0][1]),upperRight:Ln(S0*t[1][0],S0*t[1][1]),lowerLeft:Ln(S0*t[2][0],S0*t[2][1]),lowerRight:Ln(S0*t[3][0],S0*t[3][1])}}let Uqi=class{constructor(e,i,r){this._rotation=0,this._decorate(e,i,r),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=i.length>1,this._hasRotation=r.angle!==0,this._transform=this._createGlyphTransform(this.bounds,r),this._borderLineSize=r.borderLineSize,(r.borderLineSize||r.hasBackground)&&([this.bounds,this.background]=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 i=this._transform,r=qY(d_(),e);tG(i,r,i);for(const n of this.glyphs)n.setTransform(this._transform)}_decorate(e,i,r){if(!r.decoration||r.decoration==="none"||!e.length)return;const n=r.scale,s=r.decoration==="underline"?Nqi:$qi,o=e[0].textureBinding;for(const a of i){const l=a.startX*n,c=a.startY*n,d=(a.width+a.glyphWidthEnd)*n;e.push(new CSt(l,c+s*n,Vqi(d,o),1))}}shapeBackground(e){const i=on(this._borderLineSize||0),r=(Gqi+i)/2,n=this._borderLineSize?r:0,{xmin:s,ymin:o,xmax:a,ymax:l,x:c,y:d,width:p,height:y}=this.bounds,v=[s-_F,o-_F],S=[a+_F,o-_F],I=[s-_F,l+_F],O=[a+_F,l+_F],L=gQ([[v[0]-r,v[1]-r],[S[0]+r,S[1]-r],[v[0]+n,v[1]+n],[S[0]-n,S[1]+n]],e),N=gQ([[I[0]+n,I[1]-n],[O[0]-n,O[1]-n],[I[0]-r,I[1]+r],[O[0]+r,O[1]+r]],e),G=gQ([[v[0]-r,v[1]-r],[v[0]+n,v[1]+n],[I[0]-r,I[1]+r],[I[0]+n,I[1]-n]],e),V=gQ([[S[0]-n,S[1]+n],[S[0]+r,S[1]-r],[O[0]-n,O[1]-n],[O[0]+r,O[1]+r]],e),Y={main:gQ([v,S,I,O],e),top:L,bot:N,left:G,right:V};return[new mQ(c,d,p+2*r,y+2*r),Y]}get boundsT(){const e=this.bounds,i=aa(CT(),e.x,e.y);if(f0(i,i,this._transform),this._hasRotation){const r=Math.max(e.width,e.height);return new mQ(i[0],i[1],r,r)}return new mQ(i[0],i[1],e.width,e.height)}_createBounds(e){let i=1/0,r=1/0,n=0,s=0;for(const l of e)i=Math.min(i,l.xTopLeft),r=Math.min(r,l.yTopLeft),n=Math.max(n,l.xBottomRight),s=Math.max(s,l.yBottomRight);const o=n-i,a=s-r;return new mQ(i+o/2,r+a/2,o,a)}_createGlyphTransform(e,i){const r=Bqi*i.angle,n=d_(),s=CT();return vM(n,n,aa(s,i.xOffset,-i.yOffset)),i.isCIM?pk(n,n,r):(vM(n,n,aa(s,e.x,e.y)),pk(n,n,r),vM(n,n,aa(s,-e.x,-e.y))),n}},Kfe=class{constructor(e,i,r,n,s,o){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(i,r)),this.end=Math.max(0,Math.max(i,r)),this.endt===10,TSt=t=>t===32;function jqi(t,e,i){const r=new Array,n=1/i.scale,s=i.maxLineWidth*n,o=e?t.length-1:0,a=e?-1:t.length,l=e?-1:1;let c=o,d=0,p=0,y=c,v=y,S=0,I=1/0,O=0;for(;c!==a;){const{code:N,metrics:G}=t[c],V=Math.abs(G.top);if(RLe(N)||TSt(N)||(I=Math.min(I,V),O=Math.max(O,V+G.height)),RLe(N))c!==o&&(r.push(new Kfe(t,y,c-l,d,I,O)),I=1/0,O=0),d=0,y=c+l,v=c+l,p=0;else if(TSt(N))v=c+l,p=0,S=G.advance,d+=G.advance;else if(d>s){if(v!==y){const Y=v-2*l;d-=S,r.push(new Kfe(t,y,Y,d-p,I,O)),I=1/0,O=0,y=v,d=p}else r.push(new Kfe(t,y,c-l,d,I,O)),I=1/0,O=0,y=c,v=c,d=0;d+=G.advance,p+=G.advance}else d+=G.advance,p+=G.advance;c+=l}const L=new Kfe(t,y,c-l,d,I,O);return L.start>=0&&L.end1}back(){return this._transfos[this._transfos.length-1]}push(e,i){const r=i?e.scaleRatio():1;v6.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,i,r){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(e,i);break;case"CIMTextSymbol":this.drawTextSymbol(e,i,r)}}drawMultiLayerSymbol(e,i){if(!e||!i)return;const r=e.symbolLayers;if(!r)return;const n=e.effects;if(n&&n.length>0){const s=this.executeEffects(n,i);if(s){let o=s.next();for(;o;)this.drawSymbolLayers(r,o),o=s.next()}}else this.drawSymbolLayers(r,i)}executeEffects(e,i){const r=this._resourceManager.geometryEngine;let n=new wLe(i);for(const s of e){const o=ALe(s);o&&(n=o.execute(n,s,this.geomUnitsPerPoint(),null,r))}return n}drawSymbolLayers(e,i){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,i);if(o){let a=null;for(;(a=o.next())&&(this.drawSymbolLayer(n,a),!this._earlyReturn););}}else this.drawSymbolLayer(n,i);if(this._earlyReturn)return}}drawSymbolLayer(e,i){switch(e.type){case"CIMSolidFill":this.drawSolidFill(i,e.color);break;case"CIMHatchFill":this.drawHatchFill(i,e);break;case"CIMPictureFill":this.drawPictureFill(i,e);break;case"CIMGradientFill":this.drawGradientFill(i,e);break;case"CIMSolidStroke":this.drawSolidStroke(i,e.color,e.width,e.capStyle,e.joinStyle,e.miterLimit);break;case"CIMPictureStroke":this.drawPictureStroke(i,e);break;case"CIMGradientStroke":this.drawGradientStroke(i,e);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(e,i)}}drawHatchFill(e,i){const r=this._buildHatchPolyline(i,e,this.geomUnitsPerPoint());r&&(this.pushClipPath(e),this.drawMultiLayerSymbol(i.lineSymbol,r),this.popClipPath())}drawPictureFill(e,i){}drawGradientFill(e,i){}drawPictureStroke(e,i){}drawGradientStroke(e,i){}drawMarkerLayer(e,i){const r=e.markerPlacement;if(r){const n=ySt(r);if(n){const s=r.type==="CIMMarkerPlacementInsidePolygon"||r.type==="CIMMarkerPlacementPolygonCenter"&&r.clipAtBoundary;s&&this.pushClipPath(i);const o=n.execute(i,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(Wy(i))n.tx=i.x,n.ty=i.y,this.drawMarker(e,n);else if(Va(i)){const s=Ine(i);s&&([n.tx,n.ty]=s,this.drawMarker(e,n))}else for(const s of i.points)if(n.tx=s[0],n.ty=s[1],this.drawMarker(e,n),this._earlyReturn)break;this._placementPool.release(n)}}drawMarker(e,i){switch(e.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(e,i);break;case"CIMVectorMarker":this.drawVectorMarker(e,i)}}drawPictureMarker(e,i){if(!e)return;const r=this._resourceManager.getResource(e.url),n=e.size??10;if(lt(r)||n<=0)return;const s=r.width,o=r.height;if(!s||!o)return;const a=s/o,l=e.scaleX??1,c=v6.createIdentity(),d=e.anchorPoint;if(d){let O=d.x,L=d.y;e.anchorPointUnits!=="Absolute"&&(O*=n*a*l,L*=n),c.translate(-O,-L)}let p=e.rotation??0;e.rotateClockwise&&(p=-p),this._mapRotation&&(p+=this._mapRotation),p&&c.rotate(p*y6);let y=e.offsetX??0,v=e.offsetY??0;if(y||v){if(this._mapRotation){const O=y6*this._mapRotation,L=Math.cos(O),N=Math.sin(O),G=y*N+v*L;y=y*L-v*N,v=G}c.translate(y,v)}const S=this.geomUnitsPerPoint();S!==1&&c.scale(S,S);const I=i.getAngle();I&&c.rotate(I),c.translate(i.tx,i.ty),this.push(c,!1),this.drawImage(e,n),this.pop()}drawVectorMarker(e,i){if(!e)return;const r=e.markerGraphics;if(!r)return;const n=e.size??10,s=e.frame,o=s?s.ymax-s.ymin:0,a=n&&o?n/o:1,l=v6.createIdentity();s&&l.translate(.5*-(s.xmax+s.xmin),.5*-(s.ymax+s.ymin));const c=e.anchorPoint;if(c){let I=c.x,O=c.y;e.anchorPointUnits!=="Absolute"?s&&(I*=s.xmax-s.xmin,O*=s.ymax-s.ymin):(I/=a,O/=a),l.translate(-I,-O)}a!==1&&l.scale(a,a);let d=e.rotation??0;e.rotateClockwise&&(d=-d),this._mapRotation&&(d+=this._mapRotation),d&&l.rotate(d*y6);let p=e.offsetX??0,y=e.offsetY??0;if(p||y){if(this._mapRotation){const I=y6*this._mapRotation,O=Math.cos(I),L=Math.sin(I),N=p*L+y*O;p=p*O-y*L,y=N}l.translate(p,y)}const v=this.geomUnitsPerPoint();v!==1&&l.scale(v,v);const S=i.getAngle();S&&l.rotate(S),l.translate(i.tx,i.ty),this.push(l,e.scaleSymbolsProportionally);for(const I of r)if(I&&I.symbol&&I.geometry||ESt.error("Invalid marker graphic",I),this.drawSymbol(I.symbol,I.geometry,I.textString),this._earlyReturn)break;this.pop()}drawTextSymbol(e,i,r){if(!e||!Wy(i)||(e.height??10)<=0)return;const n=v6.createIdentity();let s=e.angle??0;s=-s,s&&n.rotate(s*y6);const o=e.offsetX??0,a=e.offsetY??0;(o||a)&&n.translate(o,a);const l=this.geomUnitsPerPoint();l!==1&&n.scale(l,l),n.translate(i.x,i.y),this.push(n,!1),this.drawText(e,r),this.pop()}_buildHatchPolyline(e,i,r){let n=(e.separation!==void 0?e.separation:4)*r,s=e.rotation!==void 0?e.rotation:0;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=_o();DC(l,i),l[0]-=a,l[1]-=a,l[2]+=a,l[3]+=a;const c=[[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 d=Math.cos(s*y6),p=Math.sin(s*y6),y=-n*p,v=n*d;let S,I,O,L;o=(e.offsetX!==void 0?e.offsetX*r:0)*p-(e.offsetY!==void 0?e.offsetY*r:0)*d,S=O=Number.MAX_VALUE,I=L=-Number.MAX_VALUE;for(const re of c){const fe=re[0],ge=re[1],_e=d*fe+p*ge,Ie=-p*fe+d*ge;S=Math.min(S,_e),O=Math.min(O,Ie),I=Math.max(I,_e),L=Math.max(L,Ie)}O=Math.floor(O/n)*n;let N=d*S-p*O-y*o/n,G=p*S+d*O-v*o/n,V=d*I-p*O-y*o/n,Y=p*I+d*O-v*o/n;const X=1+Math.round((L-O)/n),te=[];for(let re=0;re0))if(Va(e))this._processPath(e.rings,0);else if(Lu(e))this._processPath(e.paths,0);else if(ac(e)){const i=_6(e);i&&this._processPath(i.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(e,i,r){if(!e||this._clipCount>0)return;const n=.5*this.transformSize(r??0);if(Va(e))this._processPath(e.rings,n);else if(Lu(e))this._processPath(e.paths,n);else if(ac(e)){const s=_6(e);s&&this._processPath(s.rings,n)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(e,i){Va(i)&&e.markerPlacement&&(e.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||e.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&e.markerPlacement.clipAtBoundary)?this._processPath(i.rings,0):super.drawMarkerLayer(e,i)}drawHatchFill(e,i){this.drawSolidFill(e)}drawPictureFill(e,i){this.drawSolidFill(e)}drawGradientFill(e,i){this.drawSolidFill(e)}drawPictureStroke(e,i){this.drawSolidStroke(e,null,i.width)}drawGradientStroke(e,i){this.drawSolidStroke(e,null,i.width)}pushClipPath(e){this.drawSolidFill(e),this._clipCount++}popClipPath(){this._clipCount--}drawImage(e,i){const{url:r}=e,n=e.scaleX??1;let s=n*i,o=i;const a=this._resourceManager.getResource(r);!i&&ye(a)&&(s=n*a.width,o=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,i){if(!i||i.length===0)return;this._textRasterizer||(this._textRasterizer=new vSt);const r=OSt(e),[n,s]=this._textRasterizer.computeTextSize(i,r);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,i){if(e)for(const r of e){const n=r?r.length:0;if(n>1){this._merge(this.transformPt(r[0]),i);for(let s=1;sthis._xmax&&(this._xmax=e[0]+i),e[1]-ithis._ymax&&(this._ymax=e[1]+i)}},qqi=class extends DLe{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null}hitTest(e,i,r,n,s,o){const a=o*on(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=i&&(i.type==="CIMPointSymbol"&&i.angleAlignment!=="Map"||i.type==="CIMTextSymbol");return this._mapRotation=l?s:0,this._earlyReturn=!1,this.drawSymbol(i,r),this._earlyReturn}drawSolidFill(e,i){this._hitTestFill(e)}drawHatchFill(e,i){this._hitTestFill(e)}drawPictureFill(e,i){this._hitTestFill(e)}drawGradientFill(e,i){this._hitTestFill(e)}drawSolidStroke(e,i,r,n,s,o){this._hitTestStroke(e,r)}drawPictureStroke(e,i){this._hitTestStroke(e,i.width)}drawGradientStroke(e,i){this._hitTestStroke(e,i.width)}drawMarkerLayer(e,i){e.markerPlacement&&(e.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||e.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&e.markerPlacement.clipAtBoundary)?this._hitTestFill(i):super.drawMarkerLayer(e,i)}pushClipPath(e){}popClipPath(){}drawImage(e,i){const{url:r}=e,n=e.scaleX??1,s=this._resourceManager.getResource(r);if(lt(s)||s.height===0||i===0)return;const o=i*this.geomUnitsPerPoint(),a=o*n*(s.width/s.height),l=this.reverseTransformPt(this._searchPoint),c=this._searchDistPoint;Math.abs(l[0])N.xTopLeft&&O-N.yBottomRight&&L<-N.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(e){let i=null;if(ac(e)){const n=e;i=[[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]]]}else if(Va(e))i=e.rings;else{if(!Lu(e))return;i=e.paths}const r=this.reverseTransformPt(this._searchPoint);if(this._pointInPolygon(r,i)&&(this._earlyReturn=!0),!this._earlyReturn){const n=this.reverseTransformSize(this._searchDistPoint)*this.geomUnitsPerPoint();this._nearLine(r,i,n)&&(this._earlyReturn=!0)}}_hitTestStroke(e,i){let r=null;if(ac(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(Va(e))r=e.rings;else{if(!Lu(e))return;r=e.paths}const n=this.reverseTransformPt(this._searchPoint),s=(i??0)*this.geomUnitsPerPoint(),o=this.reverseTransformSize(this._searchDistPoint)*this.geomUnitsPerPoint();this._nearLine(n,r,s/2+o)&&(this._earlyReturn=!0)}_pointInPolygon(e,i){let r=0;for(const n of i){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,i,r){for(const n of i){const s=n.length;for(let o=1;o-r&&p1){let o=this.transformPt(n[0]);r.moveTo(o[0],o[1]);for(let a=1;at?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,ISt=t=>{switch(t){case"Left":return Ad.Left;case"Right":return Ad.Right;case"Center":return Ad.Center;case"Justify":return ESt.warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."),Ad.Center}},ASt=t=>{switch(t){case"Top":return Pd.Top;case"Center":return Pd.Center;case"Bottom":return Pd.Bottom;case"Baseline":return Pd.Baseline}},PSt=(t,e,i)=>{switch(t){case"ExtraLeading":return 1+e/i;case"Multiple":return e;case"Exact":return e/i}};function OSt(t,e=1){const i=oKe(t),r=sKe(t.fontStyleName),n=_Le(t.fontFamilyName),{weight:s,style:o}=r,a=e*(t.height||5),l=aKe(t.horizontalAlignment),c=lKe(t.verticalAlignment),d=k5(t),p=N5(t.haloSymbol),y=p?e*(0|t.haloSize):0;return{color:d,size:a,horizontalAlignment:l,verticalAlignment:c,font:{family:n,style:jYt(o),weight:zYt(s),decoration:i},halo:{size:y||0,color:p,style:o},pixelRatio:1,premultiplyColors:!0}}const Kqi=1e-4;function Jqi(t){let e,i,r,n,s,o=t[0],a=1;for(;ak3i(r,e,i,n,s);case"esriGeometryPolygon":return(i,r,n,s)=>N3i(r,e,i,n,s);case"esriGeometryPolyline":return(i,r,n,s)=>$3i(r,e,i,n,s);case"esriGeometryMultipoint":return(i,r,n,s)=>L3i(r,e,i,n,s);default:return Ei.getLogger("esri.views.2d.support.arcadeOnDemand").error(new st("mapview-arcade",`Unable to handle geometryType: ${t}`)),i=>i}}const RSt=Math.PI,eYi=RSt/2,tYi=4,MSt=4,iYi=10,PE=96/72,DSt=Math.PI/180,LLe=Ei.getLogger("esri.symbols.cim.CIMSymbolHelper");function rYi(t){if(!t||!t.type)return null;let e;switch(t.type){case"cim":return t.data;case"web-style":return t;case"simple-marker":{const i=bb.fromSimpleMarker(t);if(!i)return null;e=i;break}case"picture-marker":e=bb.fromPictureMarker(t);break;case"simple-line":e=bb.fromSimpleLineSymbol(t);break;case"simple-fill":e=bb.fromSimpleFillSymbol(t);break;case"picture-fill":e=bb.fromPictureFillSymbol(t);break;case"text":e=bb.fromTextSymbol(t)}return{type:"CIMSymbolReference",symbol:e}}function Jfe(t,e,i){switch(e.type){case"CIMSymbolReference":return Jfe(t,e.symbol,i);case"CIMPointSymbol":i==null&&(i={x:0,y:0}),t.drawSymbol(e,i);break;case"CIMLineSymbol":i==null&&(i={paths:[[[0,0],[10,0]]]}),t.drawSymbol(e,i);break;case"CIMPolygonSymbol":i==null&&(i={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),t.drawSymbol(e,i);break;case"CIMTextSymbol":{const r={x:0,y:0};t.drawSymbol(e,r);break}case"CIMVectorMarker":{const r=new hj;t.drawMarker(e,r);break}}return t.envelope()}function nYi(t){if(!t)return 0;switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(t.offset);default:return 0}}function sYi(t){if(!t)return 0;switch(t.type){case"CIMGeometricEffectArrow":return Math.abs(.5*t.width);case"CIMGeometricEffectBuffer":return Math.abs(t.size);case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(t.length);case"CIMGeometricEffectJog":return Math.abs(.5*t.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(bo(t.offsetX)),Math.abs(bo(t.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(t.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(t.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return .5*Math.max(Math.abs(t.fromWidth),Math.abs(t.toWidth));case"CIMGeometricEffectWave":return Math.abs(t.amplitude)}}function FSt(t){if(!t)return 0;let e=0;for(const i of t)e+=sYi(i);return e}let LSt=class{getSymbolInflateSize(e,i,r,n,s){return e||(e=[0,0,0,0]),i?this._getInflateSize(e,i,r,n,s):e}static safeSize(e){const i=Math.max(Math.abs(e[0]),Math.abs(e[2])),r=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(i*i+r*r)}_vectorMarkerBounds(e,i,r,n){let s=!0;const o=_o();if(i&&i.markerGraphics)for(const a of i.markerGraphics){const l=[0,0,0,0];a.geometry&&(DC(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}_getInflateSize(e,i,r,n,s){if(hYi(i)){const o=this._getLayersInflateSize(e,i.symbolLayers,r,n,s),a=FSt(i.effects);return a>0&&(o[0]-=a,o[1]-=a,o[2]+=a,o[3]+=a),o}return this._getTextInflatedSize(e,i,s)}_getLayersInflateSize(e,i,r,n,s){let o=!0;if(!i)return e;for(const a of i){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 d=a;let p=d.width;p!=null&&(d.capStyle===dS.Square||d.joinStyle===pS.Miter?p/=1.4142135623730951:p/=2,l[0]=-p,l[1]=-p,l[2]=p,l[3]=p);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const d=a;if(a.type==="CIMVectorMarker"){const I=a;if(l=this._vectorMarkerBounds(l,I,r,s),I.frame){const O=(I.frame.xmin+I.frame.xmax)/2,L=(I.frame.ymin+I.frame.ymax)/2;if(l[0]-=O,l[1]-=L,l[2]-=O,l[3]-=L,I.size!=null){const N=I.size/(I.frame.ymax-I.frame.ymin);l[0]*=N,l[1]*=N,l[2]*=N,l[3]*=N}}}else if(a.type==="CIMPictureMarker"){const I=a,O=r.getResource(I.url);let L=1;if(ye(O)&&O.height&&(L=O.width/O.height),d.size!=null){const N=d.size/2,G=d.size*L*I.scaleX/2;l=[-G,-N,G,N]}}else if(d.size!=null){const I=d.size/2;l=[-I,-I,I,I]}if(d.anchorPoint){let I,O;d.anchorPointUnits==="Absolute"?(I=d.anchorPoint.x,O=d.anchorPoint.y):(I=d.anchorPoint.x*(l[2]-l[0]),O=d.anchorPoint.y*(l[3]-l[1])),l[0]-=I,l[1]-=O,l[2]-=I,l[3]-=O}let p=bo(d.rotation);if(d.rotateClockwise&&(p=-p),n&&(p-=n),p){const I=DSt*p,O=Math.cos(I),L=Math.sin(I),N=_o([mE,mE,-mE,-mE]);ise(N,[l[0]*O-l[1]*L,l[0]*L+l[1]*O]),ise(N,[l[0]*O-l[3]*L,l[0]*L+l[3]*O]),ise(N,[l[2]*O-l[1]*L,l[2]*L+l[1]*O]),ise(N,[l[2]*O-l[3]*L,l[2]*L+l[3]*O]),l=N}let y=bo(d.offsetX),v=bo(d.offsetY);if(n){const I=DSt*n,O=Math.cos(I),L=Math.sin(I),N=y*L+v*O;y=y*O-v*L,v=N}l[0]+=y,l[1]+=v,l[2]+=y,l[3]+=v;const S=nYi(d.markerPlacement);S>0&&(l[0]-=S,l[1]-=S,l[2]+=S,l[3]+=S);break}}const c=FSt(a.effects);c>0&&(l[0]-=c,l[1]-=c,l[2]+=c,l[3]+=c),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}_getTextInflatedSize(e,i,r){const n=i.height??iYi;if(e[0]=-n/2,e[1]=-n/2,e[2]=n/2,e[3]=n/2,!r)return e;const s=r.get(i);if(!s)return e;const{text:o,mosaicItem:a}=s;if(!a?.glyphMosaicItems?.length)return e;const{lineGapType:l,lineGap:c}=i,d=l?PSt(l,c??0,n):0,p=gF(o)[1],y=a.glyphMosaicItems,v=i.callout?.type==="CIMBackgroundCallout",S=MLe(y,p,{scale:n/fpe,angle:bo(i.angle),xOffset:bo(i.offsetX),yOffset:bo(i.offsetY),hAlign:ISt(i.horizontalAlignment),vAlign:ASt(i.verticalAlignment),maxLineWidth:512,lineHeight:UDe*Math.max(.25,Math.min(d||1,4)),decoration:i.font.decoration||"none",isCIM:!0,hasBackground:v}).boundsT;return e[0]=S.x-S.halfWidth,e[1]=-S.y-S.halfHeight,e[2]=S.x+S.halfWidth,e[3]=-S.y+S.halfHeight,e}},bb=class OBe{static getEnvelope(e,i,r){if(!e)return null;const n=new Wqi(r);if(Array.isArray(e)){let s;for(const o of e)s?s.union(Jfe(n,o,i)):s=Jfe(n,o,i);return s}return Jfe(n,e,i)}static getTextureAnchor(e,i){const r=this.getEnvelope(e,null,i);if(!r)return[0,0,0];const n=(r.x+.5*r.width)*PE,s=(r.y+.5*r.height)*PE,o=r.width*PE+2,a=r.height*PE+2;return[-n/o,-s/a,a]}static rasterize(e,i,r,n,s=!0){const o=r||this.getEnvelope(i,null,n);if(!o)return[null,0,0,0,0];const a=(o.x+.5*o.width)*PE,l=(o.y+.5*o.height)*PE;e.width=o.width*PE,e.height=o.height*PE,r||(e.width+=2,e.height+=2);const c=e.getContext("2d"),d=v6.createScale(PE,-PE);d.translate(.5*e.width-a,.5*e.height+l);const p=new Yqi(c,n,d);switch(i.type){case"CIMPointSymbol":{const S={type:"point",x:0,y:0};p.drawSymbol(i,S);break}case"CIMVectorMarker":{const S=new hj;p.drawMarker(i,S);break}}const y=c.getImageData(0,0,e.width,e.height),v=new Uint8Array(y.data);if(s){let S;for(let I=0;I.667?on(Math.round(Xy(p.width))):p.width,color:V_(p.color)})}else!i||e.type!=="line-marker"||e.style!=="cross"&&e.style!=="x"||c.push({type:"CIMSolidStroke",enable:!0,width:i,color:V_(s)});c.push({type:"CIMSolidFill",enable:!0,color:V_(s)});const d={type:"CIMPolygonSymbol",symbolLayers:c};l={type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:bo(-e.angle),size:bo(e.size||6*i),offsetX:bo(e.xoffset),offsetY:bo(e.yoffset),frame:o,markerGraphics:[{type:"CIMMarkerGraphic",geometry:a,symbol:d}]}]}}return l}static fromCIMHatchFill(e,i){const r=i*(e.separation??tYi),n=r/2,s=hi(e.lineSymbol);s.symbolLayers?.forEach(l=>{switch(l.type){case"CIMSolidStroke":l.width!=null&&(l.width*=i),l.effects?.forEach(c=>{c.type==="CIMGeometricEffectDashes"&&(c.dashTemplate=c.dashTemplate.map(d=>d*i))});break;case"CIMVectorMarker":{l.size!=null&&(l.size*=i);const c=l.markerPlacement;c!=null&&"placementTemplate"in c&&(c.placementTemplate=c.placementTemplate.map(d=>d*i));break}}});let o=this._getLineSymbolPeriod(s)||MSt;for(;o({type:"CIMMarkerGraphic",geometry:p,symbol:{type:"CIMPointSymbol",symbolLayers:[r]}})),size:c}}static getSize(e){if(e)switch(e.type){case"CIMTextSymbol":return e.height;case"CIMPointSymbol":{let i=0;if(e.symbolLayers){for(const r of e.symbolLayers)if(r)switch(r.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const n=r.size;n!=null&&n>i&&(i=n);break}}}return i}case"CIMLineSymbol":case"CIMPolygonSymbol":{let i=0;if(e.symbolLayers){for(const r of e.symbolLayers)if(r)switch(r.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const n=r.width;n!=null&&n>i&&(i=n);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(r.markerPlacement&&GYt(r.markerPlacement)){const n=r.size;n!=null&&n>i&&(i=n)}}}return i}}}static getMarkerScaleRatio(e){if(e&&e.type==="CIMVectorMarker"&&e.scaleSymbolsProportionally!==!1&&e.frame&&e.size!=null){const i=e.frame.ymax-e.frame.ymin;return e.size/i}return 1}},w6=class Rf{static findApplicableOverrides(e,i,r){if(e&&i){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 i)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)Rf.findApplicableOverrides(n,i,r);if(e.symbolLayers)for(const n of e.symbolLayers)Rf.findApplicableOverrides(n,i,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)Rf.findApplicableOverrides(n,i,r);if(e.markerPlacement&&Rf.findApplicableOverrides(e.markerPlacement,i,r),e.type==="CIMVectorMarker"){if(e.markerGraphics)for(const n of e.markerGraphics)Rf.findApplicableOverrides(n,i,r),Rf.findApplicableOverrides(n.symbol,i,r)}else e.type==="CIMCharacterMarker"?Rf.findApplicableOverrides(e.symbol,i,r):e.type==="CIMHatchFill"?Rf.findApplicableOverrides(e.lineSymbol,i,r):e.type==="CIMPictureMarker"&&Rf.findApplicableOverrides(e.animatedSymbolProperties,i,r)}}}static findEffectOverrides(e,i,r){if(!i||!e)return;const n=e.length;for(let s=0;s!y.valueExpressionInfo?.expression.includes("$feature"))),a||(c=c.filter(y=>!y.valueExpressionInfo?.expression.includes("$view"))),c.length>0){const y=HYt(i.attributes);await Rf.evaluateOverrides(c,i,{spatialReference:r,fields:y,geometryType:s},o,a)}Rf.applyOverrides(l,c)}return n&&Rf.applyDictionaryTextOverrides(l,i,n),l}static async evaluateOverrides(e,i,r,n,s){if(!i)return;let o;for(const a of e){const l=a.valueExpressionInfo;if(l&&r&&r.geometryType){o||(o=[]),a.value=void 0;const c=Rne(l.expression,r.spatialReference,r.fields).then(d=>{a.value=b6(d,i,{$view:s},r.geometryType,n)});o.push(c)}}o!==void 0&&o.length>0&&await Promise.all(o)}static applyDictionaryTextOverrides(e,i,r,n="Normal"){if(e&&e.type)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const s=e.symbolLayers;if(!s)return;for(const o of s)o&&o.type==="CIMVectorMarker"&&Rf.applyDictionaryTextOverrides(o,i,r,e.type==="CIMTextSymbol"?e.textCase:n)}break;case"CIMVectorMarker":{const s=e.markerGraphics;if(!s)return;for(const o of s)o&&Rf.applyDictionaryTextOverrides(o,i,r)}break;case"CIMMarkerGraphic":{const s=e.textString;if(s&&s.includes("[")){const o=iKe(s,r);e.textString=rKe(i,o,n)}}}}static applyOverrides(e,i,r,n){if(e.primitiveName){for(const s of i)if(s.primitiveName===e.primitiveName){const o=pYi(s.propertyName);if(n&&n.push({cim:e,nocapPropertyName:o,value:e[o]}),s.expression&&(s.value=Rf.toValue(s.propertyName,s.expression)),r){let a=!1;for(const l of r)l.primitiveName===e.primitiveName&&(a=!0);a||r.push(s)}ye(s.value)&&(e[o]=s.value)}}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const s of e.effects)Rf.applyOverrides(s,i,r,n);if(e.symbolLayers)for(const s of e.symbolLayers)Rf.applyOverrides(s,i,r,n);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(e.effects)for(const s of e.effects)Rf.applyOverrides(s,i,r,n);if(e.type==="CIMVectorMarker"&&e.markerGraphics)for(const s of e.markerGraphics)Rf.applyOverrides(s,i,r,n),Rf.applyOverrides(s.symbol,i,r,n)}}static restoreOverrides(e){for(const i of e)i.cim[i.nocapPropertyName]=i.value}static buildOverrideKey(e){let i="";for(const r of e)r.value!==void 0&&(i+=`${r.primitiveName}${r.propertyName}${JSON.stringify(r.value)}`);return i}static toValue(e,i){if(e==="DashTemplate")return i.split(" ").map(r=>Number(r));if(e==="Color"){const r=new $r(i).toRgba();return r[3]*=255,r}return i}};const kLe=t=>{if(!t)return dS.Butt;switch(t){case"butt":return dS.Butt;case"square":return dS.Square;case"round":return dS.Round}},NLe=t=>{if(!t)return pS.Miter;switch(t){case"miter":return pS.Miter;case"round":return pS.Round;case"bevel":return pS.Bevel}},oYi=t=>{if(lt(t))return"Center";switch(t){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},aYi=t=>{if(lt(t))return"Center";switch(t){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},V_=t=>{if(!t)return[0,0,0,0];const{r:e,g:i,b:r,a:n}=t;return[e,i,r,255*n]},lYi=(t,e)=>{const i=uYi(e),r=cYi(t);return i&&r?`${i}-${r}`:`${i}${r}`},uYi=t=>{if(!t)return"";switch(t.toLowerCase()){case"bold":case"bolder":return"bold"}return""},cYi=t=>{if(!t)return"";switch(t.toLowerCase()){case"italic":case"oblique":return"italic"}return""},$Le=(t,e)=>{const i=e==="butt";switch(t){case"dash":case"esriSLSDash":return i?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return i?[4,3,1,3]:[3,4,0,4];case"dot":case"esriSLSDot":return i?[1,3]:[0,4];case"long-dash":case"esriSLSLongDash":return i?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return i?[8,3,1,3]:[7,4,0,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return i?[8,3,1,3,1,3]:[7,4,0,4,0,4];case"short-dash":case"esriSLSShortDash":return i?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return i?[4,1,1,1]:[3,2,0,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return i?[4,1,1,1,1,1]:[3,2,0,2,0,2];case"short-dot":case"esriSLSShortDot":return i?[1,1]:[0,2];case"solid":case"esriSLSSolid":case"none":return LLe.error("Unexpected: style does not require rasterization"),[0,0];default:return LLe.error(`Tried to rasterize SLS, but found an unexpected style: ${t}!`),[0,0]}};function hYi(t){return t.symbolLayers!==void 0}const kSt=t=>{let r,n;const s=t;if(s==="circle"||s==="esriSMSCircle"){let a=Math.acos(.995),l=Math.ceil(RSt/a/4);l===0&&(l=1),a=eYi/l,l*=4;const c=[];c.push([50,0]);for(let d=1;dt==="vertical"||t==="horizontal"||t==="cross"||t==="esriSFSCross"||t==="esriSFSVertical"||t==="esriSFSHorizontal",pYi=t=>t&&t.charAt(0).toLowerCase()+t.substr(1);function fYi(t,e,i){if(!(!t.effects||ye(e.geometryEngine))){if(e.geometryEnginePromise)return void i.push(e.geometryEnginePromise);VYt(t.effects)&&(e.geometryEnginePromise=UYt(),i.push(e.geometryEnginePromise),e.geometryEnginePromise.then(r=>e.geometryEngine=r))}}const NSt=.05;function mYi(t){return Math.max(Math.round(t/NSt),1)*NSt}const gYi=new Set(["StartTimeOffset","Duration","RepeatDelay"]);function yYi(t,e){return gYi.has(e)?mYi(t):t}function BLe(t,e,i=0){const r=Hl(t,0,bYi);for(let n=0;n<4;n++)e[i+n]=Math.floor(256*wYi(r*vYi[n]))}function $St(t,e=0){let i=0;for(let r=0;r<4;r++)i+=t[e+r]*_Yi[r];return i}const vYi=[1,256,65536,16777216],_Yi=[1/256,1/65536,1/16777216,1/4294967296],bYi=$St(new Uint8ClampedArray([255,255,255,255]));function wYi(t){return t-Math.floor(t)}function GLe(t){if(!t)return null;switch(t.type){case"CIMPointSymbol":{const e=t.symbolLayers;return e&&e.length===1?GLe(e[0]):null}case"CIMVectorMarker":{const e=t.markerGraphics;if(!e||e.length!==1)return null;const i=e[0];if(!i)return null;const r=i.geometry;if(!r)return null;const n=i.symbol;return!n||n.type!=="CIMPolygonSymbol"&&n.type!=="CIMLineSymbol"||n.symbolLayers?.some(s=>!!s.effects)?null:{geom:r,asFill:n.type==="CIMPolygonSymbol"}}case"sdf":return{geom:t.geom,asFill:t.asFill}}return null}function xYi(t){return t?t.rings?t.rings:t.paths?t.paths:t.xmin!==void 0&&t.ymin!==void 0&&t.xmax!==void 0&&t.ymax!==void 0?[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]:null:null}function SYi(t){let e=1/0,i=-1/0,r=1/0,n=-1/0;for(const s of t)for(const o of s)o[0]i&&(i=o[0]),o[1]n&&(n=o[1]);return new Xfe(e,r,i-e,n-r)}function BSt(t){let e=1/0,i=-1/0,r=1/0,n=-1/0;for(const s of t)for(const o of s)o[0]i&&(i=o[0]),o[1]n&&(n=o[1]);return[e,r,i,n]}function GSt(t){return t?t.rings?BSt(t.rings):t.paths?BSt(t.paths):ac(t)?[t.xmin,t.ymin,t.xmax,t.ymax]:null:null}function VSt(t,e,i,r,n){const[s,o,a,l]=t;if(a0&&(V=(e.xmax-e.xmin)/(e.ymax-e.ymin),N=r.x/(i*V),G=r.y/i):(N=r.x,G=r.y)),e&&(N=.5*(e.xmax+e.xmin)+N*(e.xmax-e.xmin),G=.5*(e.ymax+e.ymin)+G*(e.ymax-e.ymin)),N-=s,G-=o,N*=S,G*=S,N+=v,G+=v;let Y=N/I-.5,X=G/O-.5;return n&&i&&(Y*=i*V,X*=i),[L,Y,X]}function CYi(t){const e=xYi(t.geom),i=SYi(e),r=128,n=1,s=Math.floor(.5*(.5*r-n)),o=(r-2*(s+n))/Math.max(i.width,i.height),a=Math.round(i.width*o)+2*s,l=Math.round(i.height*o)+2*s,c=[];for(const p of e)if(p&&p.length>1){const y=[];for(const v of p){let[S,I]=v;S-=i.x,I-=i.y,S*=o,I*=o,S+=s-.5,I+=s-.5,t.asFill?y.push([S,I]):y.push([Math.round(S),Math.round(I)])}if(t.asFill){const v=y.length-1;y[0][0]===y[v][0]&&y[0][1]===y[v][1]||y.push(y[0])}c.push(y)}const d=TYi(c,a,l,s);return t.asFill&&EYi(c,a,l,s,d),[IYi(d,s),a,l]}function TYi(t,e,i,r){const n=e*i,s=new Array(n),o=r*r+1;for(let a=0;ae&&(L=e),N<0&&(N=0),G>i&&(G=i);const V=p[0]-d[0],Y=p[1]-d[1],X=V*V+Y*Y;for(let te=O;teX?(fe=p[0],ge=p[1]):(_e/=X,fe=d[0]+_e*V,ge=d[1]+_e*Y);const Ie=(te-fe)*(te-fe)+(re-ge)*(re-ge),ke=(i-re-1)*e+te;Iee-r&&(I=e-r),Oi-r&&(L=i-r);for(let N=O;NN==c[1]>N)continue;const G=(i-N-1)*e;for(let V=S;V>8^i)+r|0;while(--r!=0)}return(1+i/-2147483648)/2}function jSt(t){return Math.floor(USt(t,PYi)*OYi)}const PYi=53290320,OYi=10,zSt=Ei.getLogger("esri.symbols.cim.cimAnalyzer");function VLe(t){switch(t){case"Butt":return vf.BUTT;case"Square":return vf.SQUARE;default:return vf.ROUND}}function ULe(t){switch(t){case"Bevel":return Zf.BEVEL;case"Miter":return Zf.MITER;default:return Zf.ROUND}}function HSt(t,e,i,r){let n;t[e]?n=t[e]:(n={},t[e]=n),n[i]=r}function WSt(t){const e=t.markerPlacement;return e&&e.angleToLine?hy.MAP:hy.SCREEN}async function RYi(t,e,i,r,n){const s=r??[];if(!t)return s;let o,a;const l={};if(t.type!=="CIMSymbolReference")return zSt.error("Expect cim type to be 'CIMSymbolReference'"),s;if(o=t.symbol,a=t.primitiveOverrides,a){const d=[];for(const p of a){const y=p.valueExpressionInfo;if(y&&e){const v=y.expression,S=Rne(v,e.spatialReference,e.fields).then(I=>{lt(I)||HSt(l,p.primitiveName,p.propertyName,I)});d.push(S)}else p.value!=null&&HSt(l,p.primitiveName,p.propertyName,p.value)}d.length>0&&await Promise.all(d)}const c=[];switch(bb.fetchResources(o,i,c),c.length>0&&await Promise.all(c),o?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":MYi(o,a,l,e,s,i,!!n)}return s}function MYi(t,e,i,r,n,s,o){if(!t)return;const a=t.symbolLayers;if(!a)return;const l=t.effects;let c=hy.SCREEN;const d=bb.getSize(t)??0;t.type==="CIMPointSymbol"&&t.angleAlignment==="Map"&&(c=hy.MAP);let p=a.length;for(;p--;){const y=a[p];if(!y||y.enable===!1)continue;let v;l&&l.length&&(v=[...l]);const S=y.effects;S&&S.length&&(l?v.push(...S):v=[...S]);const I=[];let O;w6.findEffectOverrides(v,e,I),O=I.length>0?WYi(v,I,i,r):v;const L=[];switch(w6.findApplicableOverrides(y,e,L),y.type){case"CIMSolidFill":DYi(y,O,i,L,r,n);break;case"CIMPictureFill":FYi(y,O,i,L,r,s,n);break;case"CIMHatchFill":LYi(y,O,i,L,r,n);break;case"CIMGradientFill":kYi(y,O,i,L,r,n);break;case"CIMSolidStroke":NYi(y,O,i,L,r,n,t.type==="CIMPolygonSymbol",d);break;case"CIMPictureStroke":$Yi(y,O,i,L,r,n,t.type==="CIMPolygonSymbol",d);break;case"CIMGradientStroke":BYi(y,O,i,L,r,n,t.type==="CIMPolygonSymbol",d);break;case"CIMCharacterMarker":if(jLe(y,O,i,L,r,n))break;break;case"CIMPictureMarker":if(jLe(y,O,i,L,r,n))break;t.type==="CIMLineSymbol"&&(c=WSt(y)),GYi(y,O,i,L,r,s,n,c,d);break;case"CIMVectorMarker":if(jLe(y,O,i,L,r,n))break;t.type==="CIMLineSymbol"&&(c=WSt(y)),VYi(y,O,i,L,r,n,s,c,d,o);break;default:zSt.error("Cannot analyze CIM layer",y.type)}}}function DYi(t,e,i,r,n,s){const o=t.primitiveName,a=z1(t.color),[l,c]=ax(r,o,e,null,null),d=Gc(JSON.stringify(t)+c).toString();s.push({type:"fill",templateHash:d,materialHash:l?()=>d:d,cim:t,materialOverrides:null,colorLocked:!!t.colorLocked,color:qs(o,i,"Color",n,a,wS),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:e,applyRandomOffset:!1,sampleAlphaOnly:!0})}function FYi(t,e,i,r,n,s,o){const a=t.primitiveName,l=dae(t),[c,d]=ax(r,a,e,null,null),p=Gc(JSON.stringify(t)+d).toString(),y=Gc(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString();let v=bo(t.scaleX);if("width"in t&&typeof t.width=="number"){const S=t.width;let I=1;const O=s.getResource(t.url);ye(O)&&(I=O.width/O.height),v/=I*(t.height/S)}o.push({type:"fill",templateHash:p,materialHash:c?()=>y:y,cim:t,materialOverrides:null,colorLocked:!!t.colorLocked,effects:e,color:qs(a,i,"TintColor",n,l,wS),height:qs(a,i,"Height",n,t.height),scaleX:qs(a,i,"ScaleX",n,v),angle:qs(a,i,"Rotation",n,bo(t.rotation)),offsetX:qs(a,i,"OffsetX",n,bo(t.offsetX)),offsetY:qs(a,i,"OffsetY",n,bo(t.offsetY)),url:t.url,applyRandomOffset:!1,sampleAlphaOnly:!1})}function LYi(t,e,i,r,n,s){const o=["Rotation","OffsetX","OffsetY"],a=r.filter(O=>O.primitiveName!==t.primitiveName||!o.includes(O.propertyName)),l=t.primitiveName;let[c,d]=ax(r,l,e,null,null);const p=Gc(JSON.stringify(t)+d).toString(),y=Gc(`${t.separation}${JSON.stringify(t.lineSymbol)}`).toString();let v={r:255,g:255,b:255,a:1},S=!1;const I=t.lineSymbol?.symbolLayers?.find(O=>O.type==="CIMSolidStroke"&&i[O.primitiveName]?.Color!=null);if(I){v=z1(I.color),v=qs(I.primitiveName,i,"Color",n,v,wS);const O=typeof v=="function";c=c||O,S=I.color!=null||O}s.push({type:"fill",templateHash:p,materialHash:c?vQ(y,i,a,n):y,cim:t,materialOverrides:a,colorLocked:!!t.colorLocked,effects:e,color:v,height:qs(l,i,"Separation",n,t.separation),scaleX:1,angle:qs(l,i,"Rotation",n,bo(t.rotation)),offsetX:qs(l,i,"OffsetX",n,bo(t.offsetX)),offsetY:qs(l,i,"OffsetY",n,bo(t.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!S})}function kYi(t,e,i,r,n,s){const o=t.primitiveName,[a,l]=ax(r,o,e,null,null),c=Gc(JSON.stringify(t)+l).toString();s.push({type:"fill",templateHash:c,materialHash:a?vQ(c,i,r,n):c,cim:t,materialOverrides:null,colorLocked:!!t.colorLocked,effects:e,color:{r:128,g:128,b:128,a:1},height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1})}function NYi(t,e,i,r,n,s,o,a){const l=t.primitiveName,c=z1(t.color),d=t.width!=null?t.width:4,p=VLe(t.capStyle),y=ULe(t.joinStyle),v=t.miterLimit,[S,I]=ax(r,l,e,null,null),O=Gc(JSON.stringify(t)+I).toString();let L,N;if(e&&e instanceof Array&&e.length>0){const G=e[e.length-1];if(G.type==="CIMGeometricEffectDashes"&&G.lineDashEnding==="NoConstraint"&&G.offsetAlongLine===null){const V=(e=[...e]).pop();L=V.dashTemplate,N=V.scaleDash}}s.push({type:"line",templateHash:O,materialHash:S?()=>O:O,cim:t,materialOverrides:null,isOutline:o,colorLocked:!!t.colorLocked,effects:e,color:qs(l,i,"Color",n,c,wS),width:qs(l,i,"Width",n,d),cap:qs(l,i,"CapStyle",n,p),join:qs(l,i,"JoinStyle",n,y),miterLimit:v&&qs(l,i,"MiterLimit",n,v),referenceWidth:a,zOrder:zLe(t.name),dashTemplate:L,scaleDash:N,sampleAlphaOnly:!0})}function $Yi(t,e,i,r,n,s,o,a){const l=Gc(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString(),c=t.primitiveName,d=dae(t),p=t.width!=null?t.width:4,y=VLe(t.capStyle),v=ULe(t.joinStyle),S=t.miterLimit,[I,O]=ax(r,c,e,null,null),L=Gc(JSON.stringify(t)+O).toString();s.push({type:"line",templateHash:L,materialHash:I?()=>l:l,cim:t,materialOverrides:null,isOutline:o,colorLocked:!!t.colorLocked,effects:e,color:qs(c,i,"TintColor",n,d,wS),width:qs(c,i,"Width",n,p),cap:qs(c,i,"CapStyle",n,y),join:qs(c,i,"JoinStyle",n,v),miterLimit:S&&qs(c,i,"MiterLimit",n,S),referenceWidth:a,zOrder:zLe(t.name),dashTemplate:null,scaleDash:!1,url:t.url,sampleAlphaOnly:!1})}function BYi(t,e,i,r,n,s,o,a){const l=t.primitiveName,c=t.width!=null?t.width:4,d=VLe(t.capStyle),p=ULe(t.joinStyle),y=t.miterLimit,[v,S]=ax(r,l,e,null,null),I=Gc(JSON.stringify(t)+S).toString();s.push({type:"line",templateHash:I,materialHash:v?vQ(I,i,r,n):I,cim:t,materialOverrides:null,isOutline:o,colorLocked:!!t.colorLocked,effects:e,color:{r:128,g:128,b:128,a:1},width:qs(l,i,"Width",n,c),cap:qs(l,i,"CapStyle",n,d),join:qs(l,i,"JoinStyle",n,p),miterLimit:y&&qs(l,i,"MiterLimit",n,y),referenceWidth:a,zOrder:zLe(t.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}function jLe(t,e,i,r,n,s){const{markerPlacement:o,type:a}=t;if(!o||o.type!=="CIMMarkerPlacementInsidePolygon")return!1;if(a==="CIMVectorMarker"||a==="CIMPictureMarker"){const Y=t.primitiveName;if(Y){const[te,re]=ax(r,Y,e,null,null);if(te)return!1}const X=o.primitiveName;if(X){const[te,re]=ax(r,X,e,null,null);if(te)return!1}if(a==="CIMVectorMarker"){const{markerGraphics:te}=t;if(te)for(const re of te){const{symbol:fe}=re;if(fe?.type==="CIMPolygonSymbol"&&fe.symbolLayers){const{symbolLayers:ge}=fe;for(const _e of ge)if(_e.type==="CIMSolidStroke")return!1}}}else{const{animatedSymbolProperties:te}=t;if(te)return!1}}const l=o,c=Math.abs(l.stepX),d=Math.abs(l.stepY);if(c===0||d===0)return!0;const p=["Rotation","OffsetX","OffsetY"],y=r.filter(Y=>Y.primitiveName!==t.primitiveName||!p.includes(Y.propertyName)),v="url"in t&&typeof t.url=="string"?t.url:void 0,[S,I]=ax(r,l.primitiveName,e,null,null),O=Gc(JSON.stringify(t)+I).toString();let L,N,G=null;if(o.gridType==="Random"){const Y=Xy(A0t),X=Math.max(Math.floor(Y/c),1),te=Math.max(Math.floor(Y/d),1);L=d*te,G=re=>re?re*te:0,N=X*c/L}else o.shiftOddRows?(L=2*d,G=Y=>Y?2*Y:0,N=c/d*.5):(L=d,G=null,N=c/d);const V=dae(t);return s.push({type:"fill",templateHash:O,materialHash:S?vQ(O,i,y,n):O,cim:t,materialOverrides:y,colorLocked:!!t.colorLocked,effects:e,color:qs(l.primitiveName,i,"TintColor",n,V,wS),height:qs(l.primitiveName,i,"StepY",n,L,G),scaleX:N,angle:qs(l.primitiveName,i,"GridAngle",n,l.gridAngle),offsetX:qs(l.primitiveName,i,"OffsetX",n,bo(l.offsetX)),offsetY:qs(l.primitiveName,i,"OffsetY",n,bo(l.offsetY)),url:v,applyRandomOffset:o.gridType==="Random",sampleAlphaOnly:!v,hasUnresolvedReplacementColor:!0}),!0}function GYi(t,e,i,r,n,s,o,a,l){const c=t.primitiveName,d=bo(t.size);let p=bo(t.scaleX,1);const y=bo(t.rotation),v=bo(t.offsetX),S=bo(t.offsetY),I=dae(t),O=Gc(`${t.url}${JSON.stringify(t.colorSubstitutions)}${JSON.stringify(t.animatedSymbolProperties)}`).toString(),L=YSt(t.markerPlacement,r,i,n),N=qYi(t.animatedSymbolProperties,r,i,n),[G,V]=ax(r,c,e,L,N),Y=Gc(JSON.stringify(t)+V).toString(),X=t.anchorPoint??{x:0,y:0};if("width"in t&&typeof t.width=="number"){const fe=t.width;let ge=1;const _e=s.getResource(t.url);ye(_e)&&(ge=_e.width/_e.height),p/=ge*(d/fe)}function te(fe,ge){return ye(N)?vB(N,fe,ge):null}const re=t.animatedSymbolProperties&&t.animatedSymbolProperties.randomizeStartTime===!0?(fe,ge,_e,Ie)=>{const ke=jSt(Ie??0),Ne=te(fe,ge);return O+`-MATERIALGROUP(${ke})-ASP(${JSON.stringify(Ne)})`}:G?(fe,ge)=>{const _e=te(fe,ge);return O+`-ASP(${JSON.stringify(_e)})`}:O;o.push({type:"marker",templateHash:Y,materialHash:re,cim:t,materialOverrides:null,colorLocked:!!t.colorLocked,effects:e,scaleSymbolsProportionally:!1,alignment:a,size:qs(c,i,"Size",n,d),scaleX:qs(c,i,"ScaleX",n,p),rotation:qs(c,i,"Rotation",n,y),offsetX:qs(c,i,"OffsetX",n,v),offsetY:qs(c,i,"OffsetY",n,S),color:qs(c,i,"TintColor",n,I,wS),anchorPoint:{x:X.x,y:-X.y},isAbsoluteAnchorPoint:t.anchorPointUnits!=="Relative",outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,frameHeight:0,rotateClockwise:!!t.rotateClockwise,referenceSize:l,sizeRatio:1,markerPlacement:L,url:t.url,animatedSymbolProperties:N})}function VYi(t,e,i,r,n,s,o,a,l,c){const d=t.markerGraphics;if(!d)return;let p=0;if(t.scaleSymbolsProportionally){const v=t.frame;v&&(p=v.ymax-v.ymin)}const y=YSt(t.markerPlacement,r,i,n);for(const v of d)if(v){const S=v.symbol;if(!S)continue;switch(S.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":jYi(t,e,y,null,v,r,i,n,s,o,a,l,p,!!c);break;case"CIMTextSymbol":UYi(t,e,y,v,i,r,n,s,a,l,p)}}}function UYi(t,e,i,r,n,s,o,a,l,c,d){const p=[];w6.findApplicableOverrides(r,s,p);const y=r.geometry;if(!("x"in y)||!("y"in y))return;const v=r.symbol,S=oKe(v),I=sKe(v.fontStyleName),O=_Le(v.fontFamilyName);v.font={family:O,decoration:S,...I};const L=t.frame,N=y.x-.5*(L.xmin+L.xmax),G=y.y-.5*(L.ymin+L.ymax),V=t.size/d,Y=t.primitiveName,X=bo(v.height)*V,te=bo(v.angle),re=bo(t.offsetX)+(bo(v.offsetX)+N)*V,fe=bo(t.offsetY)+(bo(v.offsetY)+G)*V,ge=z1(k5(v));let _e=z1(N5(v)),Ie=sY(v)??0;Ie||(_e=z1(k5(v.haloSymbol)),v.haloSize&&(Ie=v.haloSize*V));let ke=null,Ne=null,J=0;if(v.callout&&v.callout.type==="CIMBackgroundCallout"){const et=v.callout;if(et.backgroundSymbol){const tt=et.backgroundSymbol.symbolLayers;if(tt)for(const ft of tt)ft.type==="CIMSolidFill"?ke=z1(ft.color):ft.type==="CIMSolidStroke"&&(Ne=z1(ft.color),J=bo(ft.width))}}const[he,xe]=ax(s,Y,e,i,null),Pe=JSON.stringify(t.effects)+Number(t.colorLocked).toString()+JSON.stringify(t.anchorPoint)+t.anchorPointUnits+JSON.stringify(t.markerPlacement)+t.size.toString(),Oe=Gc(JSON.stringify(r)+Pe+xe).toString();let Ae=qs(r.primitiveName,n,"TextString",o,r.textString??"",nKe,v.textCase);if(Ae==null)return;const{fontStyleName:ze}=v,Ge=O+(ze?"-"+ze.toLowerCase():"-regular"),Je=Ge;typeof Ae=="string"&&Ae.includes("[")&&v.fieldMap&&(Ae=$Yt(v.fieldMap,Ae,v.textCase)),a.push({type:"text",templateHash:Oe,materialHash:he||typeof Ae=="function"||Ae.match(/\[(.*?)\]/)?(et,tt,ft)=>Je+"-"+vB(Ae,et,tt,ft):Je+"-"+Gc(Ae),cim:v,materialOverrides:null,colorLocked:!!t.colorLocked,effects:e,alignment:l,anchorPoint:{x:t.anchorPoint?t.anchorPoint.x:0,y:t.anchorPoint?t.anchorPoint.y:0},isAbsoluteAnchorPoint:t.anchorPointUnits!=="Relative",fontName:Ge,decoration:S,weight:qs(Y,n,"Weight",o,I.weight),style:qs(Y,n,"Size",o,I.style),size:qs(Y,n,"Size",o,X),angle:qs(Y,n,"Rotation",o,te),offsetX:qs(Y,n,"OffsetX",o,re),offsetY:qs(Y,n,"OffsetY",o,fe),horizontalAlignment:aKe(v.horizontalAlignment),verticalAlignment:lKe(v.verticalAlignment),text:Ae,color:ge,outlineColor:_e,outlineSize:Ie,backgroundColor:ke,borderLineColor:Ne,borderLineWidth:J,referenceSize:c,sizeRatio:1,markerPlacement:i})}function jYi(t,e,i,r,n,s,o,a,l,c,d,p,y,v){const S=n.symbol,I=S.symbolLayers;if(!I)return;if(v)return void qSt(t,e,i,r,n,o,s,a,l,c,d,p,y);let O=I.length;if(XYi(I))return void zYi(t,e,i,r,n,I,s,o,a,l,d,p,y);const L=yQ.applyEffects(S.effects,n.geometry,c.geometryEngine);if(L)for(;O--;){const N=I[O];if(N&&N.enable!==!1)switch(N.type){case"CIMSolidFill":case"CIMSolidStroke":{const G=yQ.applyEffects(N.effects,L,c.geometryEngine),V=GSt(G);if(!V)continue;const Y=t.anchorPointUnits!=="Relative",[X,te,re]=VSt(V,t.frame,t.size,t.anchorPoint,Y),fe=N.type==="CIMSolidFill",ge={type:"sdf",geom:G,asFill:fe},_e=t.primitiveName,Ie=bo(t.size)??10,ke=bo(t.rotation),Ne=bo(t.offsetX),J=bo(t.offsetY),he=N.path,xe=N.primitiveName,Pe=z1(fe?k5(N):N5(N)),Oe=fe?{r:0,g:0,b:0,a:0}:z1(N5(N)),Ae=sY(N)??0;if(!fe&&!Ae)break;let ze=!1,Ge="";for(const ft of s)ft.primitiveName!==xe&&ft.primitiveName!==_e||(ft.value!==void 0?Ge+=`-${ft.primitiveName}-${ft.propertyName}-${JSON.stringify(ft.value)}`:ft.valueExpressionInfo&&(ze=!0));(ye(e)&&typeof e=="function"||ye(i)&&typeof i=="function")&&(ze=!0);const Je=JSON.stringify({...t,markerGraphics:null}),et=Gc(JSON.stringify(ge)+he).toString(),tt={type:"marker",templateHash:Gc(JSON.stringify(n)+JSON.stringify(N)+Je+Ge).toString(),materialHash:ze?()=>et:et,cim:ge,materialOverrides:null,colorLocked:!!t.colorLocked,effects:e,scaleSymbolsProportionally:!!t.scaleSymbolsProportionally,alignment:d,anchorPoint:{x:te,y:re},isAbsoluteAnchorPoint:Y,size:qs(t.primitiveName,o,"Size",a,Ie),rotation:qs(t.primitiveName,o,"Rotation",a,ke),offsetX:qs(t.primitiveName,o,"OffsetX",a,Ne),offsetY:qs(t.primitiveName,o,"OffsetY",a,J),scaleX:1,frameHeight:y,rotateClockwise:!!t.rotateClockwise,referenceSize:p,sizeRatio:X,color:qs(xe,o,"Color",a,Pe,wS),outlineColor:qs(xe,o,"Color",a,Oe,wS),outlineWidth:qs(xe,o,"Width",a,Ae),markerPlacement:i,animatedSymbolProperties:r,path:he};l.push(tt);break}default:qSt(t,e,i,r,n,o,s,a,l,c,d,p,y)}}}function zYi(t,e,i,r,n,s,o,a,l,c,d,p,y){const v=n.geometry,S=s[0],I=s[1],O=GSt(v);if(!O)return;const L=t.anchorPointUnits!=="Relative",[N,G,V]=VSt(O,t.frame,t.size,t.anchorPoint,L),Y={type:"sdf",geom:v,asFill:!0},X=t.primitiveName,te=bo(t.size),re=bo(t.rotation),fe=bo(t.offsetX),ge=bo(t.offsetY),_e=I.path,Ie=I.primitiveName,ke=S.primitiveName,Ne=z1(k5(I)),J=z1(N5(S)),he=sY(S)??0;let xe=!1,Pe="";for(const Ge of o)Ge.primitiveName!==Ie&&Ge.primitiveName!==ke&&Ge.primitiveName!==X||(Ge.value!==void 0?Pe+=`-${Ge.primitiveName}-${Ge.propertyName}-${JSON.stringify(Ge.value)}`:Ge.valueExpressionInfo&&(xe=!0));ye(i)&&typeof i=="function"&&(xe=!0);const Oe=JSON.stringify({...t,markerGraphics:null}),Ae=Gc(JSON.stringify(Y)+_e).toString(),ze={type:"marker",templateHash:Gc(JSON.stringify(n)+JSON.stringify(I)+JSON.stringify(S)+Oe+Pe).toString(),materialHash:xe?()=>Ae:Ae,cim:Y,materialOverrides:null,colorLocked:!!t.colorLocked,effects:e,scaleSymbolsProportionally:!!t.scaleSymbolsProportionally,alignment:d,anchorPoint:{x:G,y:V},isAbsoluteAnchorPoint:L,size:qs(t.primitiveName,a,"Size",l,te),rotation:qs(t.primitiveName,a,"Rotation",l,re),offsetX:qs(t.primitiveName,a,"OffsetX",l,fe),offsetY:qs(t.primitiveName,a,"OffsetY",l,ge),scaleX:1,frameHeight:y,rotateClockwise:!!t.rotateClockwise,referenceSize:p,sizeRatio:N,color:qs(Ie,a,"Color",l,Ne,wS),outlineColor:qs(ke,a,"Color",l,J,wS),outlineWidth:qs(ke,a,"Width",l,he),markerPlacement:i,path:_e,animatedSymbolProperties:r};c.push(ze)}function qSt(t,e,i,r,n,s,o,a,l,c,d,p,y){const v=HYi(t,n),S=["Rotation","OffsetX","OffsetY"],I=o.filter(ge=>ge.primitiveName!==t.primitiveName||!S.includes(ge.propertyName));let O="";for(const ge of o)ge.value!==void 0&&(O+=`-${ge.primitiveName}-${ge.propertyName}-${JSON.stringify(ge.value)}`);const[L,N,G]=bb.getTextureAnchor(v,c),V=t.primitiveName,Y=bo(t.rotation),X=bo(t.offsetX),te=bo(t.offsetY),re=Gc(JSON.stringify(v)+O).toString(),fe={type:"marker",templateHash:re,materialHash:I.length>0||ye(e)&&typeof e=="function"?vQ(re,s,I,a):re,cim:v,materialOverrides:I,colorLocked:!!t.colorLocked,effects:e,scaleSymbolsProportionally:!!t.scaleSymbolsProportionally,alignment:d,anchorPoint:{x:L,y:N},isAbsoluteAnchorPoint:!1,size:bo(t.size),rotation:qs(V,s,"Rotation",a,Y),offsetX:qs(V,s,"OffsetX",a,X),offsetY:qs(V,s,"OffsetY",a,te),color:{r:255,g:255,b:255,a:1},outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,scaleX:1,frameHeight:y,rotateClockwise:!!t.rotateClockwise,referenceSize:p,sizeRatio:G/on(t.size),markerPlacement:i,animatedSymbolProperties:r,avoidSDFRasterization:!0};l.push(fe)}function HYi(t,e){return{type:t.type,enable:!0,name:t.name,colorLocked:t.colorLocked,primitiveName:t.primitiveName,anchorPoint:t.anchorPoint,anchorPointUnits:t.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:t.rotateClockwise,rotation:0,size:t.size,billboardMode3D:t.billboardMode3D,depth3D:t.depth3D,frame:t.frame,markerGraphics:[e],scaleSymbolsProportionally:t.scaleSymbolsProportionally,respectFrame:t.respectFrame,clippingPath:t.clippingPath}}function zLe(t){if(t&&t.indexOf("Level_")===0){const e=parseInt(t.substr(6),10);if(!isNaN(e))return e}return 0}function wS(t){if(!t||t.length===0)return null;const e=new $r(t).toRgba();return{r:e[0],g:e[1],b:e[2],a:e[3]}}function qs(t,e,i,r,n,s,o){if(t==null)return n;const a=e[t];if(a){const l=a[i];if(typeof l=="string"||typeof l=="number"||l instanceof Array)return s?s.call(null,l,o):l;if(l!=null&&l instanceof lR&&r?.geometryType)return(c,d,p)=>{let y=b6(l,c,{$view:p},r.geometryType,d);return y!==null&&s&&(y=s.call(null,y,o)),y!==null?y:n}}return n}function HLe(t){return t&&t.charAt(0).toLowerCase()+t.substr(1)}function WYi(t,e,i,r){for(const n of e)if(n.valueExpressionInfo&&r?.geometryType){const s=i[n.primitiveName]&&i[n.primitiveName][n.propertyName];s instanceof lR&&(n.fn=(o,a,l)=>b6(s,o,{$view:l},r.geometryType,a))}return(n,s,o)=>{for(const l of e)l.fn&&(l.value=l.fn(n,s,o));const a=[];for(let l of t){const c=l?.primitiveName;if(c){let d=!1;for(const p of e)if(p.primitiveName===c){const y=HLe(p.propertyName);p.value!=null&&p.value!==l[y]&&(d||(l=hi(l),d=!0),l[y]=p.value)}}a.push(l)}return a}}function YSt(t,e,i,r){const n=[];if(w6.findApplicableOverrides(t,e,n),t==null||n.length===0)return t;for(const s of n)if(s.valueExpressionInfo&&r?.geometryType){const o=i[s.primitiveName]&&i[s.primitiveName][s.propertyName];o instanceof lR&&(s.fn=(a,l,c)=>b6(o,a,{$view:c},r.geometryType,l))}return(s,o,a)=>{for(const d of n)d.fn&&(d.value=d.fn(s,o,a));const l=hi(t),c=t.primitiveName;for(const d of n)if(d.primitiveName===c){const p=HLe(d.propertyName);d.value!=null&&d.value!==l[p]&&(l[p]=d.value)}return l}}function qYi(t,e,i,r){const n=[];if(w6.findApplicableOverrides(t,e,n),t==null||n.length===0)return t;for(const s of n)if(s.valueExpressionInfo&&r?.geometryType){const o=i[s.primitiveName]&&i[s.primitiveName][s.propertyName];o instanceof lR&&(s.fn=(a,l,c)=>b6(o,a,{$view:c},r.geometryType,l))}return(s,o,a)=>{for(const d of n)d.fn&&(d.value=d.fn(s,o,a));const l=hi(t),c=t.primitiveName;for(const d of n)if(d.primitiveName===c){const p=HLe(d.propertyName);if(d.value!=null){const y=yYi(d.value,d.propertyName);y!==l[p]&&(l[p]=y)}}return l}}function vQ(t,e,i,r){for(const n of i)if(n.valueExpressionInfo&&r?.geometryType){const s=e[n.primitiveName]&&e[n.primitiveName][n.propertyName];s instanceof lR&&(n.fn=(o,a,l)=>b6(s,o,{$view:l},r.geometryType,a))}return(n,s,o)=>{for(const a of i)a.fn&&(a.value=a.fn(n,s,o));return Gc(t+w6.buildOverrideKey(i)).toString()}}function YYi(t,e){if(!e||e.length===0)return t;const i=hi(t);return w6.applyOverrides(i,e),i}function ax(t,e,i,r,n){let s=!1,o="";for(const a of t)a.primitiveName===e&&(a.value!==void 0?o+=`-${a.primitiveName}-${a.propertyName}-${JSON.stringify(a.value)}`:a.valueExpressionInfo&&(s=!0));return ye(i)&&typeof i=="function"&&(s=!0),ye(r)&&typeof r=="function"&&(s=!0),ye(n)&&typeof n=="function"&&(s=!0),[s,o]}const XYi=t=>t&&t.length===2&&t[0].enable&&t[1].enable&&t[0].type==="CIMSolidStroke"&&t[1].type==="CIMSolidFill"&&!t[0].effects&&!t[1].effects;var XSt,WLe={};XSt=function(){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={exports:{},id:r,loaded:!1};return t[r].call(n.exports,n,n.exports,i),n.loaded=!0,n.exports}return i.m=t,i.c=e,i.p="",i(0)}([function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.isNotPNG=l,e.isNotAPNG=c,e.default=p;var r=s(i(1)),n=i(2);function s(N){return N&&N.__esModule?N:{default:N}}var o=new Error("Not a PNG"),a=new Error("Not an animated PNG");function l(N){return N===o}function c(N){return N===a}var d=new Uint8Array([137,80,78,71,13,10,26,10]);function p(N){var G=new Uint8Array(N);if(Array.prototype.some.call(d,function(ke,Ne){return ke!==G[Ne]}))return o;var V=!1;if(y(G,function(ke){return!(V=ke==="acTL")}),!V)return a;var Y=[],X=[],te=null,re=null,fe=0,ge=new n.APNG;if(y(G,function(ke,Ne,J,he){var xe=new DataView(Ne.buffer);switch(ke){case"IHDR":te=Ne.subarray(J+8,J+8+he),ge.width=xe.getUint32(J+8),ge.height=xe.getUint32(J+12);break;case"acTL":ge.numPlays=xe.getUint32(J+8+4);break;case"fcTL":re&&(ge.frames.push(re),fe++),(re=new n.Frame).width=xe.getUint32(J+8+4),re.height=xe.getUint32(J+8+8),re.left=xe.getUint32(J+8+12),re.top=xe.getUint32(J+8+16);var Pe=xe.getUint16(J+8+20),Oe=xe.getUint16(J+8+22);Oe===0&&(Oe=100),re.delay=1e3*Pe/Oe,re.delay<=10&&(re.delay=100),ge.playTime+=re.delay,re.disposeOp=xe.getUint8(J+8+24),re.blendOp=xe.getUint8(J+8+25),re.dataParts=[],fe===0&&re.disposeOp===2&&(re.disposeOp=1);break;case"fdAT":re&&re.dataParts.push(Ne.subarray(J+8+4,J+8+he));break;case"IDAT":re&&re.dataParts.push(Ne.subarray(J+8,J+8+he));break;case"IEND":X.push(I(Ne,J,12+he));break;default:Y.push(I(Ne,J,12+he))}}),re&&ge.frames.push(re),ge.frames.length==0)return a;var _e=new Blob(Y),Ie=new Blob(X);return ge.frames.forEach(function(ke){var Ne=[];Ne.push(d),te.set(L(ke.width),0),te.set(L(ke.height),4),Ne.push(O("IHDR",te)),Ne.push(_e),ke.dataParts.forEach(function(J){return Ne.push(O("IDAT",J))}),Ne.push(Ie),ke.imageData=new Blob(Ne,{type:"image/png"}),delete ke.dataParts,Ne=null}),ge}function y(N,G){var V=new DataView(N.buffer),Y=8,X=void 0,te=void 0,re=void 0;do te=V.getUint32(Y),re=G(X=v(N,Y+4,4),N,Y,te),Y+=12+te;while(re!==!1&&X!="IEND"&&Y>>24&255,N>>>16&255,N>>>8&255,255&N])}},function(t,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,c=a,d=a+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:o.length-a);c>>8^i[255&(l^o[c])];return-1^l};for(var i=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;i[r]=n}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.Frame=e.APNG=void 0;var r=function(){function a(l,c){for(var d=0;d1&&arguments[1]!==void 0&&arguments[1];return this.createImages().then(function(){return new n.default(c,l,d)})}}]),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(c,d){var p=URL.createObjectURL(l.imageData);l.imageElement=document.createElement("img"),l.imageElement.onload=function(){URL.revokeObjectURL(p),c()},l.imageElement.onerror=function(){URL.revokeObjectURL(p),l.imageElement=null,d(new Error("Image creation error"))},l.imageElement.src=p})}}]),a}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function c(d,p){for(var y=0;y=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 p=this.currentFrame;this._prevFrame=p,this._prevFrameData=null,p.disposeOp==2&&(this._prevFrameData=this.context.getImageData(p.left,p.top,p.width,p.height)),p.blendOp==0&&this.context.clearRect(p.left,p.top,p.width,p.height),this.context.drawImage(p.imageElement,p.left,p.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var p=this;this.emit("play"),this._ended&&this.stop(),this._paused=!1;var y=performance.now()+this.currentFrame.delay/this.playbackRate,v=function S(I){if(!p._ended&&!p._paused){if(I>=y){for(;I-y>=p._apng.playTime/p.playbackRate;)y+=p._apng.playTime/p.playbackRate,p._numPlays++;do p.renderNextFrame(),y+=p.currentFrame.delay/p.playbackRate;while(!p._ended&&I>y)}requestAnimationFrame(S)}};requestAnimationFrame(v)}},{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}}]),d}(n(i(4)).default);e.default=l},function(t,e){function i(){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}t.exports=i,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(a){if(!n(a)||a<0||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},i.prototype.emit=function(a){var l,c,d,p,y,v;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 S=new Error('Uncaught, unspecified "error" event. ('+l+")");throw S.context=l,S}if(o(c=this._events[a]))return!1;if(r(c))switch(arguments.length){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:p=Array.prototype.slice.call(arguments,1),c.apply(this,p)}else if(s(c))for(p=Array.prototype.slice.call(arguments,1),d=(v=c.slice()).length,y=0;y0&&this._events[a].length>c&&(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},i.prototype.on=i.prototype.addListener,i.prototype.once=function(a,l){if(!r(l))throw TypeError("listener must be a function");var c=!1;function d(){this.removeListener(a,d),c||(c=!0,l.apply(this,arguments))}return d.listener=l,this.on(a,d),this},i.prototype.removeListener=function(a,l){var c,d,p,y;if(!r(l))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(p=(c=this._events[a]).length,d=-1,c===l||r(c.listener)&&c.listener===l)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,l);else if(s(c)){for(y=p;y-- >0;)if(c[y]===l||c[y].listener&&c[y].listener===l){d=y;break}if(d<0)return this;c.length===1?(c.length=0,delete this._events[a]):c.splice(d,1),this._events.removeListener&&this.emit("removeListener",a,l)}return this},i.prototype.removeAllListeners=function(a){var l,c;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(c=this._events[a]))this.removeListener(a,c);else if(c)for(;c.length;)this.removeListener(a,c[c.length-1]);return delete this._events[a],this},i.prototype.listeners=function(a){return this._events&&this._events[a]?r(this._events[a])?[this._events[a]]:this._events[a].slice():[]},i.prototype.listenerCount=function(a){if(this._events){var l=this._events[a];if(r(l))return 1;if(l)return l.length}return 0},i.listenerCount=function(a,l){return a.listenerCount(l)}}])},{get exports(){return WLe},set exports(t){WLe=t}}.exports=XSt();const KYi=qa(WLe);async function JYi(t,e){const i=KYi(t);if(i instanceof Error)throw i;await i.createImages(),sn(e);const{frames:r,width:n,height:s}=i,o=document.createElement("canvas");o.width=n,o.height=s;const a=o.getContext("2d",{willReadFrequently:!0}),l=[],c=[];for(const d of r){c.push(d.delay||100);const p=d.imageElement;d.blendOp===0?a.globalCompositeOperation="copy":a.globalCompositeOperation="source-over";const y=d.disposeOp===2?a.getImageData(d.left,d.top,d.width,d.height):void 0;a.drawImage(p,d.left,d.top);const v=a.getImageData(0,0,n,s);l.push(v),d.disposeOp===0||(d.disposeOp===1?a.clearRect(d.left,d.top,d.width,d.height):d.disposeOp===2&&a.putImageData(y,d.left,d.top))}return{frameDurations:c,getFrame:d=>l[d],width:n,height:s}}const ZYi=[137,80,78,71,13,10,26,10];function QYi(t){const e=new Uint8Array(t);return!ZYi.some((i,r)=>i!==e[r])}function eXi(t){if(!QYi(t))return!1;const e=new DataView(t),i=new Uint8Array(t);let r,n=8;do{const s=e.getUint32(n);if(r=String.fromCharCode.apply(String,Array.prototype.slice.call(i.subarray(n+4,n+8))),r==="acTL")return!0;n+=12+s}while(r!=="IEND"&&ne.toBlob(n,i));if(!r)throw new st("imageToArrayBuffer","Failed to encode image");return{data:await r.arrayBuffer(),type:i}}async function iXi(t){if(!(t instanceof HTMLImageElement))return"image/png";const e=t.src;if(E1(e)){const i=Y3(e);return i?.mediaType==="image/jpeg"?i.mediaType:"image/png"}return/\.png$/i.test(e)?"image/png":/\.(jpg|jpeg)$/i.test(e)?"image/jpeg":"image/png"}function Zfe(t){if(t instanceof HTMLCanvasElement)return t;if(t instanceof HTMLVideoElement)return null;const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");return t instanceof HTMLImageElement?i.drawImage(t,0,0,t.width,t.height):t instanceof ImageData&&i.putImageData(t,0,0),e}function rXi(t){const e=[],i=new Uint8Array(t);for(let r=0;r2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:r;if(Array.isArray(i))i.forEach(function(o){return t(e,o,r,n)});else if(typeof i=="function")i(e,r,n,t);else{var s=Object.keys(i)[0];Array.isArray(i[s])?(n[s]={},t(e,i[s],r,n[s])):n[s]=i[s](e,r,n,t)}return r};dO.parse=sXi;var oXi=function(t,e){return function(i,r,n,s){e(i,r,n)&&s(i,t,r,n)}};dO.conditional=oXi;var aXi=function(t,e){return function(i,r,n,s){for(var o=[],a=i.pos;e(i,r,n);){var l={};if(s(i,t,r,l),i.pos===a)break;a=i.pos,o.push(l)}return o}};dO.loop=aXi;var wf={};Object.defineProperty(wf,"__esModule",{value:!0}),wf.readBits=wf.readArray=wf.readUnsigned=wf.readString=wf.peekBytes=wf.readBytes=wf.peekByte=wf.readByte=wf.buildStream=void 0;var lXi=function(t){return{data:t,pos:0}};wf.buildStream=lXi;var ZSt=function(){return function(t){return t.data[t.pos++]}};wf.readByte=ZSt;var uXi=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(e){return e.data[e.pos+t]}};wf.peekByte=uXi;var Qfe=function(t){return function(e){return e.data.subarray(e.pos,e.pos+=t)}};wf.readBytes=Qfe;var cXi=function(t){return function(e){return e.data.subarray(e.pos,e.pos+t)}};wf.peekBytes=cXi;var hXi=function(t){return function(e){return Array.from(Qfe(t)(e)).map(function(i){return String.fromCharCode(i)}).join("")}};wf.readString=hXi;var dXi=function(t){return function(e){var i=Qfe(2)(e);return t?(i[1]<<8)+i[0]:(i[0]<<8)+i[1]}};wf.readUnsigned=dXi;var pXi=function(t,e){return function(i,r,n){for(var s=typeof e=="function"?e(i,r,n):e,o=Qfe(t),a=new Array(s),l=0;l=v){var O=v-d.pos;y.push((0,i.readBytes)(O)(d)),S+=O;break}y.push((0,i.readBytes)(I)(d)),S+=I}for(var L=new Uint8Array(S),N=0,G=0;G>=o,S-=o,d>r||d==a)break;if(d==n){s=(1<<(o=y+1))-1,r=n+2,c=V;continue}if(c==V){fe[O++]=re[d],c=d,I=d;continue}for(l=d,d==r&&(fe[O++]=I,d=c);d>n;)fe[O++]=re[d],d=te[d];I=255&re[d],fe[O++]=I,rl[d],width:n,height:s}}const AXi=[71,73,70];function PXi(t){const e=new Uint8Array(t);return!AXi.some((i,r)=>i!==e[r])}function OXi(t){if(!PXi(t))return!1;const e=new DataView(t),i=e.getUint8(10);let r=13+(128&i?3*2**(1+(7&i)):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:c();break;case 254:d();break;case 255:p();break;default:return!1}return!0}function a(){n++,r+=8;const v=e.getUint8(r++);r+=128&v?3*2**(1+(7&v)):0,r++,y()}function l(){r++,r+=4,y()}function c(){n++,r++,r+=12,y()}function d(){y()}function p(){r++,r+=8,r+=3,y()}function y(){let v;for(;v=e.getUint8(r++);)r+=v}return!1}let RXi=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,i){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=DXi(e,i),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)}};async function MXi(t,e){const i=window.URL.createObjectURL(t);try{const{data:r}=await ir(i,{...e,responseType:"image"});return r}catch(r){throw ss(r)?r:new st("mapview-invalid-resource",`Could not fetch requested resource at ${i}`)}finally{window.URL.revokeObjectURL(i)}}async function DXi(t,e){const{arrayBuffer:i,mediaType:r}=await FXi(t,e),n=r==="image/png";return r==="image/gif"&&OXi(i)?IXi(i):n&&eXi(i)?JYi(i,e):MXi(new Blob([i],{type:r}),e)}async function FXi(t,e){let i;const r=";base64,";if(t.includes(r)){const n=t.indexOf(r),s=t.indexOf(r)+r.length,o=t.substring(s),a=atob(o),l=new Uint8Array(a.length);for(let c=0;ct==="vertical"||t==="horizontal"||t==="cross"||t==="esriSFSCross"||t==="esriSFSVertical"||t==="esriSFSHorizontal";function kXi(t,e,i){const r=X8(Math.ceil(i)),n=LXi(e)?8*r:16*r,s=2*r;t.width=n,t.height=n;const o=t.getContext("2d");o.strokeStyle="#FFFFFF",o.lineWidth=r,o.beginPath(),e!=="vertical"&&e!=="cross"&&e!=="esriSFSCross"&&e!=="esriSFSVertical"||(o.moveTo(n/2,-s),o.lineTo(n/2,n+s)),e!=="horizontal"&&e!=="cross"&&e!=="esriSFSCross"&&e!=="esriSFSHorizontal"||(o.moveTo(-s,n/2),o.lineTo(n+s,n/2)),e!=="forward-diagonal"&&e!=="diagonal-cross"&&e!=="esriSFSDiagonalCross"&&e!=="esriSFSForwardDiagonal"||(o.moveTo(-s,-s),o.lineTo(n+s,n+s),o.moveTo(n-s,-s),o.lineTo(n+s,s),o.moveTo(-s,n-s),o.lineTo(s,n+s)),e!=="backward-diagonal"&&e!=="diagonal-cross"&&e!=="esriSFSBackwardDiagonal"&&e!=="esriSFSDiagonalCross"||(o.moveTo(n+s,-s),o.lineTo(-s,n+s),o.moveTo(s,-s),o.lineTo(-s,s),o.moveTo(n+s,n-s),o.lineTo(n-s,n+s)),o.stroke();const a=o.getImageData(0,0,t.width,t.height),l=new Uint8Array(a.data);let c;for(let d=0;d=y||p>=y){const v=d/p;v>1?(d=y,p=Math.round(y/v)):(p=y,d=Math.round(y*v)),c=new Uint8Array(4*d*p);const S=new Uint8ClampedArray(c.buffer);BYt(a,e,i,S,d,p,!1)}return{size:[d,p],image:new Uint32Array(c.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0}}};/*! + */const fQ={title:"title",message:"message",link:"link",actionsEnd:"actions-end"},mQ={actionsEnd:"actions-end",close:"notice-close",container:"container",content:"notice-content",icon:"notice-icon"},Bqi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([scale=s]){--calcite-notice-spacing-token-small:0.5rem;--calcite-notice-spacing-token-large:0.75rem}:host([scale=s]) .container slot[name=title]::slotted(*),:host([scale=s]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) .container slot[name=message]::slotted(*),:host([scale=s]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .notice-close{padding:0.5rem}:host([scale=m]){--calcite-notice-spacing-token-small:0.75rem;--calcite-notice-spacing-token-large:1rem}:host([scale=m]) .container slot[name=title]::slotted(*),:host([scale=m]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) .container slot[name=message]::slotted(*),:host([scale=m]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=l]){--calcite-notice-spacing-token-small:1rem;--calcite-notice-spacing-token-large:1.25rem}:host([scale=l]) .container slot[name=title]::slotted(*),:host([scale=l]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) .container slot[name=message]::slotted(*),:host([scale=l]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([width=auto]){--calcite-notice-width:auto}:host([width=half]){--calcite-notice-width:50%}:host([width=full]){--calcite-notice-width:100%}:host{margin-inline:auto;display:none;max-inline-size:100%;align-items:center;inline-size:var(--calcite-notice-width)}.container{pointer-events:none;margin-block:0px;box-sizing:border-box;display:none;inline-size:100%;background-color:var(--calcite-ui-foreground-1);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;max-block-size:0;text-align:start;border-inline-start:0px solid;box-shadow:0 0 0 0 transparent}.notice-close{outline-color:transparent}.notice-close:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host{display:flex}:host([open]) .container{pointer-events:auto;display:flex;max-block-size:100%;align-items:center;border-width:2px;opacity:1;--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.container slot[name=title]::slotted(*),.container *::slotted([slot=title]){margin:0px;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}.container slot[name=message]::slotted(*),.container *::slotted([slot=message]){margin:0px;display:inline;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2);margin-inline-end:var(--calcite-notice-spacing-token-small)}.notice-content{box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;display:flex;min-inline-size:0px;flex-direction:column;overflow-wrap:break-word;flex:1 1 0;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:0 var(--calcite-notice-spacing-token-small)}.notice-content:first-of-type:not(:only-child){padding-inline-start:var(--calcite-notice-spacing-token-large)}.notice-content:only-of-type{padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large)}.notice-icon{display:flex;align-items:center;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto}.notice-close{display:flex;cursor:pointer;align-items:center;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-ui-text-3);outline:2px solid transparent;outline-offset:2px;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;-webkit-appearance:none}.notice-close:hover,.notice-close:focus{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.notice-close:active{background-color:var(--calcite-ui-foreground-3)}.actions-end{display:flex;align-self:stretch}:host([kind=brand]) .container{border-color:var(--calcite-ui-brand)}:host([kind=brand]) .container .notice-icon{color:var(--calcite-ui-brand)}:host([kind=info]) .container{border-color:var(--calcite-ui-info)}:host([kind=info]) .container .notice-icon{color:var(--calcite-ui-info)}:host([kind=danger]) .container{border-color:var(--calcite-ui-danger)}:host([kind=danger]) .container .notice-icon{color:var(--calcite-ui-danger)}:host([kind=success]) .container{border-color:var(--calcite-ui-success)}:host([kind=success]) .container .notice-icon{color:var(--calcite-ui-success)}:host([kind=warning]) .container{border-color:var(--calcite-ui-warning)}:host([kind=warning]) .container .notice-icon{color:var(--calcite-ui-warning)}",vSt=d0(class extends p0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteNoticeClose=Xh(this,"calciteNoticeClose",6),this.calciteNoticeOpen=Xh(this,"calciteNoticeOpen",6),this.close=()=>{this.open=!1,this.calciteNoticeClose.emit()},this.open=!1,this.kind="brand",this.closable=!1,this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.width="auto",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}onMessagesChange(){}updateRequestedIcon(){this.requestedIcon=dle(hme,this.icon,this.kind)}connectedCallback(){kqi(this),dF(this),gF(this)}disconnectedCallback(){$qi(this),pF(this),yF(this)}async componentWillLoad(){TE(this),this.requestedIcon=dle(hme,this.icon,this.kind),await fF(this)}componentDidLoad(){EE(this)}render(){const{el:t}=this,e=br("button",{"aria-label":this.messages.close,class:mQ.close,onClick:this.close,ref:r=>this.closeButton=r},br("calcite-icon",{icon:"x",scale:this.scale==="l"?"m":"s"})),i=$Ee(t,fQ.actionsEnd);return br("div",{class:mQ.container},this.requestedIcon?br("div",{class:mQ.icon},br("calcite-icon",{flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:this.scale==="l"?"m":"s"})):null,br("div",{class:mQ.content},br("slot",{name:fQ.title}),br("slot",{name:fQ.message}),br("slot",{name:fQ.link})),i?br("div",{class:mQ.actionsEnd},br("slot",{name:fQ.actionsEnd})):null,this.closable?e:null)}async setFocus(){await IE(this);const t=this.el.querySelector("calcite-link");!this.closeButton&&!t||(t?t.setFocus():this.closeButton&&this.closeButton.focus())}effectiveLocaleChange(){mF(this,this.effectiveLocale)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],icon:["updateRequestedIcon"],kind:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Bqi}},[1,"calcite-notice",{open:[1540],kind:[513],closable:[516],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],width:[513],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]}]);function _St(){if(typeof customElements>"u")return;["calcite-notice","calcite-icon"].forEach(e=>{switch(e){case"calcite-notice":customElements.get(e)||customElements.define(e,vSt);break;case"calcite-icon":customElements.get(e)||lx();break}})}_St();const bSt=Object.freeze(Object.defineProperty({__proto__:null,CalciteNotice:vSt,defineCustomElement:_St},Symbol.toStringTag,{value:"Module"}));function jLe(t){if(!t)return"arial-unicode-ms";const e=t.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 Vqi(t){const e=jqi(t)+Gqi(t);return jLe(t.family)+(e.length>0?e:"-regular")}function jqi(t){if(!t.weight)return"";switch(t.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}function Gqi(t){if(!t.style)return"";switch(t.style.toLowerCase()){case"italic":case"oblique":return"-italic"}return""}const GLe=new Abt;function _F(t){if(t==null)return["",!1];if(!GLe.hasBidiChar(t))return[t,!1];let e;return e=GLe.checkContextual(t)==="rtl"?"IDNNN":"ICNNN",[GLe.bidiTransform(t,e,"VLYSN"),!0]}let vU=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,i){this.tx=e,this.ty=i}setTranslateZ(e){this.tz=e}setRotateCS(e,i){this.rz=void 0,this.rzCos=e,this.rzSin=i}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}};const wSt=512;let _y,ULe=class{constructor(e){this._geometry=e}next(){const e=this._geometry;return this._geometry=null,e}};function zLe(t,e){let i,r;_y||(_y=new eZ(0,0,0,1)),_y.reset(gy.Polygon),_y.setPixelMargin(e+1),_y.setExtent(wSt);for(const s of t.rings)if(s&&!(s.length<3)){i=s[0][0],r=-s[0][1],_y.moveTo(i,r);for(let o=1;o0;--e)t[e][0]-=t[e-1][0],t[e][1]-=t[e-1][1]}function ASt(t){if(t)for(const e of t)ISt(e)}function PSt(t){if(t){const e=t.length;for(let i=1;i1&&x>0&&n>0&&(i*y+r*v)/x/n<=this._maxCosAngle&&_U(c,1),h===1&&(s=y,o=v,a=x),x>0&&(c=p,i=y,r=v,n=x)}this._isClosed&&n>0&&a>0&&(i*s+r*o)/a/n<=this._maxCosAngle&&_U(e[0],1)}}};const vQ=.03;let bU=class{constructor(){this._path=[]}path(){return this._path}addPath(e,i){i||e.reverse(),Array.prototype.push.apply(this._path,e),i||e.reverse()}static mergePath(e,i){i&&Array.prototype.push.apply(e,i)}startPath(e){this._path.push(e)}lineTo(e){this._path.push(e)}close(){const e=this._path;e.length>1&&(e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]||e.push([e[0][0],e[0][1]]))}},pO=class{constructor(e=0,i=!1){}normalize(e){const i=Math.sqrt(e[0]*e[0]+e[1]*e[1]);i!==0&&(e[0]/=i,e[1]/=i)}calculateLength(e,i){const r=i[0]-e[0],n=i[1]-e[1];return Math.sqrt(r*r+n*n)}calculateSegLength(e,i){return this.calculateLength(e[i],e[i+1])}calculatePathLength(e){let i=0;const r=e?e.length:0;for(let n=0;n0?[n/o,s/o]:[1,0]}getSegAngleCS(e,i,r){return this.getAngleCS(e[i],e[i+1],r)}cut(e,i,r,n){return[r<=0?e[i]:this.getSegCoord2D(e,i,r),n>=1?e[i+1]:this.getSegCoord2D(e,i,n)]}addSegment(e,i,r){r&&e.push(i[0]),e.push(i[1])}getSubCurve(e,i,r){const n=[];return this.appendSubCurve(n,e,i,r)?n:null}appendSubCurve(e,i,r,n){const s=i?i.length-1:0;let o=0,a=!0,l=0;for(;lr){const h=(r-o)/c;let p=1,y=!1;o+c>=n&&(p=(n-o)/c,y=!0);const v=this.cut(i,l,h,p);if(v&&this.addSegment(e,v,a),y)break;a=!1}}else{if(o+c>n){const h=this.cut(i,l,0,(n-o)/c);h&&this.addSegment(e,h,a);break}this.addSegment(e,[i[l],i[l+1]],a)}o+=c,++l}else++l}return!0}getCIMPointAlong(e,i){const r=e?e.length-1:0;let n=0,s=-1;for(;si){const a=(i-n)/o;return this.getCoord2D(e[s],e[s+1],a)}n+=o}}return null}isEmpty(e,i){if(!e||e.length<=1)return!0;const r=e?e.length-1:0;let n=-1;for(;n=0==i<=0){if(F<1){const k=[x[0]-I[0],x[1]-I[1]];this.normalize(k);const j=Math.sqrt((1+F)/2);if(j>1/n){const V=-Math.abs(i)/j;h.push([p[0]-k[0]*V,p[1]-k[1]*V])}}}else switch(r){case tO.Mitered:{const k=Math.sqrt((1+F)/2);if(k>0&&1/k0){const j=1/k;let V=j;for(let Y=1;Y0){const n=[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]],s=this._curveHelper.offset(n,this._size,tO.Rounded,4,this._offsetFlattenError);if(s)return{rings:[s]}}else if(this._size<0&&Math.min(e.xmax-e.xmin,e.ymax-e.ymin)+2*this._size>0)return{xmin:e.xmin-this._size,xmax:e.xmax+this._size,ymin:e.ymin-this._size,ymax:e.ymax+this._size}}const i=this._geometryEngine;if(lt(i))return null;let r=e;if((!Xa(e)||!this._tileKey||(r=zLe(e,Math.abs(this._size)+1),r&&r.rings&&r.rings.length!==0))&&(!Hu(e)||!this._tileKey||(r=xSt(e,Math.abs(this._size)+1),r&&r.paths&&r.paths.length!==0)))return i.buffer(hr.WebMercator,r,this._size,1)}return null}},LSt=class Qie{static local(){return Qie.instance===null&&(Qie.instance=new Qie),Qie.instance}execute(e,i,r,n,s){return new Qqi(e,i,r)}};LSt.instance=null;let Qqi=class{constructor(e,i,r){this._defaultPointSize=20,this._inputGeometries=e,this._geomUnitsPerPoint=r,this._rule=i.rule??$l.FullGeometry,this._defaultSize=this._defaultPointSize*r}next(){let e;for(;e=this._inputGeometries.next();){let i;if(qy(e)?i=this._processGeom([[[e.x,e.y]]]):lg(e)?i=this._processGeom([e.points]):Hu(e)?i=this._processGeom(e.paths):Xa(e)&&(i=this._processGeom(e.rings)),i&&i.length)return{paths:i}}return null}_clone(e){return[e[0],e[1]]}_mid(e,i){return[(e[0]+i[0])/2,(e[1]+i[1])/2]}_mix(e,i,r,n){return[e[0]*i+r[0]*n,e[1]*i+r[1]*n]}_add(e,i){return[e[0]+i[0],e[1]+i[1]]}_add2(e,i,r){return[e[0]+i,e[1]+r]}_sub(e,i){return[e[0]-i[0],e[1]-i[1]]}_dist(e,i){return Math.sqrt((e[0]-i[0])*(e[0]-i[0])+(e[1]-i[1])*(e[1]-i[1]))}_norm(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}_normalize(e,i=1){const r=i/this._norm(e);e[0]*=r,e[1]*=r}_leftPerpendicular(e){const i=-e[1],r=e[0];e[0]=i,e[1]=r}_leftPerp(e){return[-e[1],e[0]]}_rightPerpendicular(e){const i=e[1],r=-e[0];e[0]=i,e[1]=r}_rightPerp(e){return[e[1],-e[0]]}_dotProduct(e,i){return e[0]*i[0]+e[1]*i[1]}_crossProduct(e,i){return e[0]*i[1]-e[1]*i[0]}_rotateDirect(e,i,r){const n=e[0]*i-e[1]*r,s=e[0]*r+e[1]*i;e[0]=n,e[1]=s}_makeCtrlPt(e){const i=[e[0],e[1]];return _U(i,1),i}_addAngledTicks(e,i,r,n){const s=this._sub(r,i);this._normalize(s);const o=this._crossProduct(s,this._sub(n,i));let a;a=o>0?this._rightPerp(s):this._leftPerp(s);const l=Math.abs(o)/2,c=[];c.push([i[0]+(a[0]-s[0])*l,i[1]+(a[1]-s[1])*l]),c.push(i),c.push(r),c.push([r[0]+(a[0]+s[0])*l,r[1]+(a[1]+s[1])*l]),e.push(c)}_addBezier2(e,i,r,n,s){if(s--==0)return void e.push(n);const o=this._mid(i,r),a=this._mid(r,n),l=this._mid(o,a);this._addBezier2(e,i,o,l,s),this._addBezier2(e,l,a,n,s)}_addBezier3(e,i,r,n,s,o){if(o--==0)return void e.push(s);const a=this._mid(i,r),l=this._mid(r,n),c=this._mid(n,s),h=this._mid(a,l),p=this._mid(l,c),y=this._mid(h,p);this._addBezier3(e,i,a,h,y,o),this._addBezier3(e,y,p,c,s,o)}_add90DegArc(e,i,r,n,s){const o=s??this._crossProduct(this._sub(r,i),this._sub(n,i))>0,a=this._mid(i,r),l=this._sub(a,i);o?this._leftPerpendicular(l):this._rightPerpendicular(l),a[0]+=l[0],a[1]+=l[1],this._addBezier3(e,i,this._mix(i,.33333,a,.66667),this._mix(r,.33333,a,.66667),r,4)}_addArrow(e,i,r){const n=i[0],s=i[1],o=i[i.length-1],a=this._sub(n,s);this._normalize(a);const l=this._crossProduct(a,this._sub(o,s)),c=.5*l,h=this._leftPerp(a),p=[o[0]-h[0]*l,o[1]-h[1]*l],y=i.length-1,v=[];v.push(r?[-h[0],-h[1]]:h);let x=[-a[0],-a[1]];for(let I=1;I0;I--)e.push([i[I][0]+v[I][0]*c,i[I][1]+v[I][1]*c]);e.push([p[0]+v[0][0]*c,p[1]+v[0][1]*c]),e.push([p[0]+v[0][0]*l,p[1]+v[0][1]*l]),e.push(n),e.push([p[0]-v[0][0]*l,p[1]-v[0][1]*l]),e.push([p[0]-v[0][0]*c,p[1]-v[0][1]*c]);for(let I=1;I=2?e[1]:this._add2(e[0],i*this._defaultSize,r*this._defaultSize)}_cp3(e,i,r,n){if(e.length>=3)return e[2];const s=this._mix(e[0],1-r,i,r),o=this._sub(i,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 i=e[0],r=this._cp2(e,-4,0),n=this._sub(i,r);this._normalize(n);const s=this._rightPerp(n);return[i,r,[i[0]+(s[0]-n[0])*this._defaultSize,i[1]+(s[1]-n[1])*this._defaultSize]]}_arrowLastSeg(e){const i=e[0],r=this._cp2(e,-4,0);let n;if(e.length>=3)n=e[e.length-1];else{const s=this._sub(i,r);this._normalize(s);const o=this._rightPerp(s);n=[i[0]+(o[0]-s[0])*this._defaultSize,i[1]+(o[1]-s[1])*this._defaultSize]}return[r,n]}_processGeom(e){if(!e)return null;const i=[];for(const r of e){if(!r||r.length===0)continue;const n=r.length;let s=r[0];switch(this._rule){case $l.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)),i.push(l);break}case $l.ReversedFirstSegment:{const o=this._cp2(r,0,-1);i.push([o,s]);break}case $l.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),i.push(l);break}case $l.SecondSegmentWithTicks:{const o=this._cp2(r,-4,1),a=this._cp3(r,o,.882353,-1.94),l=this._sub(a,o);let c;c=this._crossProduct(l,this._sub(s,o))>0?this._rightPerp(c):this._leftPerp(l);const h=[];h.push([o[0]+(c[0]-l[0])/3,o[1]+(c[1]-l[1])/3]),h.push(o),h.push(a),h.push([a[0]+(c[0]+l[0])/3,a[1]+(c[1]+l[1])/3]),i.push(h);break}case $l.DoublePerpendicular:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,3),l=this._mid(s,o),c=this._sub(l,a);this._normalize(c);const h=this._crossProduct(c,this._sub(s,a));this._leftPerpendicular(c);const p=[];p.push(s),p.push([a[0]+c[0]*h,a[1]+c[1]*h]),i.push(p);const y=[];y.push([a[0]-c[0]*h,a[1]-c[1]*h]),y.push(o),i.push(y);break}case $l.OppositeToFirstSegment:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,3),l=this._mid(s,o),c=this._sub(l,a);this._normalize(c);const h=this._crossProduct(c,this._sub(s,a));this._leftPerpendicular(c);const p=[];p.push([a[0]+c[0]*h,a[1]+c[1]*h]),p.push([a[0]-c[0]*h,a[1]-c[1]*h]),i.push(p);break}case $l.TriplePerpendicular:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,4),l=this._mid(s,o),c=this._sub(l,a);this._normalize(c);const h=this._crossProduct(c,this._sub(s,a));this._leftPerpendicular(c);const p=[];p.push([a[0]+c[0]*h*.8,a[1]+c[1]*h*.8]),p.push([l[0]+.8*(s[0]-l[0]),l[1]+.8*(s[1]-l[1])]),i.push(p),i.push([a,l]);const y=[];y.push([a[0]-c[0]*h*.8,a[1]-c[1]*h*.8]),y.push([l[0]+.8*(o[0]-l[0]),l[1]+.8*(o[1]-l[1])]),i.push(y);break}case $l.HalfCircleFirstSegment:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,4),l=this._mid(s,o);let c=this._sub(o,s);const h=Math.cos(Math.PI/18),p=Math.sin(Math.PI/18),y=Math.sqrt((1+h)/2),v=Math.sqrt((1-h)/2),x=[];let I;this._crossProduct(c,this._sub(a,s))>0?(x.push(s),c=this._sub(s,l),I=o):(x.push(o),c=this._sub(o,l),I=s),this._rotateDirect(c,y,v),c[0]/=y,c[1]/=y;for(let P=1;P<=18;P++)x.push(this._add(l,c)),this._rotateDirect(c,h,p);x.push(I),i.push(x);break}case $l.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 c=this._crossProduct(l,this._sub(a,o))/2;this._leftPerpendicular(l);const h=[o[0]+l[0]*c,o[1]+l[1]*c];l=this._sub(o,h);const p=Math.cos(Math.PI/18);let y=Math.sin(Math.PI/18);c>0&&(y=-y);const v=[o];for(let x=1;x<=18;x++)this._rotateDirect(l,p,y),v.push(this._add(h,l));i.push(v);break}case $l.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 x=this._sub(s,o);l=this._add(a,x)}const c=this._dist(o,a)/2/.75,h=this._sub(o,s);this._normalize(h,c);const p=this._sub(a,l);this._normalize(p,c);const y=[l,a];i.push(y);const v=[this._clone(a)];this._addBezier3(v,a,this._add(a,p),this._add(o,h),o,4),v.push(s),i.push(v);break}case $l.OpenCircle:{const o=this._cp2(r,-2,0),a=this._sub(o,s),l=Math.cos(Math.PI/18),c=-Math.sin(Math.PI/18),h=[o];for(let p=1;p<=33;p++)this._rotateDirect(a,l,c),h.push(this._add(s,a));i.push(h);break}case $l.CoverageEdgesWithTicks:{const o=this._cp2(r,0,-1);let a,l;if(n>=3)a=r[2];else{const y=this._sub(o,s),v=this._leftPerp(y);a=[s[0]+v[0]-.25*y[0],s[1]+v[1]-.25*y[1]]}if(n>=4)l=r[3];else{const y=this._mid(s,o),v=this._sub(s,o);this._normalize(v),this._leftPerpendicular(v);const x=this._crossProduct(v,this._sub(a,y));this._rightPerpendicular(v),l=[a[0]+v[0]*x*2,a[1]+v[1]*x*2]}const c=this._sub(o,s);let h,p;h=this._crossProduct(c,this._sub(a,s))>0?this._rightPerp(c):this._leftPerp(c),p=[],p.push(a),p.push(s),p.push([s[0]+(h[0]-c[0])/3,s[1]+(h[1]-c[1])/3]),i.push(p),h=this._crossProduct(c,this._sub(l,o))>0?this._rightPerp(h):this._leftPerp(c),p=[],p.push([o[0]+(h[0]+c[0])/3,o[1]+(h[1]+c[1])/3]),p.push(o),p.push(l),i.push(p);break}case $l.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 c=this._sub(o,s);l=this._add(a,c)}this._addAngledTicks(i,s,o,this._mid(a,l)),this._addAngledTicks(i,a,l,this._mid(s,o));break}case $l.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 h=this._sub(o,s);l=this._add(a,h)}const c=[];c.push(this._mid(s,a)),c.push(this._mid(o,l)),i.push(c);break}case $l.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)}i.push([o,this._makeCtrlPt(s),a]);break}case $l.PerpendicularWithArc:{const o=this._cp2(r,0,-2),a=this._cp3(r,o,.5,-1);let l=this._sub(o,s);const c=this._norm(l);l[0]/=c,l[1]/=c;const h=this._crossProduct(l,this._sub(a,s));let p=this._dotProduct(l,this._sub(a,s));p<.05*c?p=.05*c:p>.95*c&&(p=.95*c);const y=[s[0]+l[0]*p,s[1]+l[1]*p];this._leftPerpendicular(l);let v=[];v.push([y[0]-l[0]*h,y[1]-l[1]*h]),v.push([y[0]+l[0]*h,y[1]+l[1]*h]),i.push(v);const x=[o[0]+l[0]*h,o[1]+l[1]*h];l=this._sub(o,x);const I=Math.cos(Math.PI/18);let P=Math.sin(Math.PI/18);h<0&&(P=-P),v=[s,o];for(let F=1;F<=9;F++)this._rotateDirect(l,I,P),v.push(this._add(x,l));i.push(v);break}case $l.ClosedHalfCircle:{const o=this._cp2(r,2,0),a=this._mid(s,o),l=this._sub(o,a),c=Math.cos(Math.PI/18),h=Math.sin(Math.PI/18),p=[s,o];for(let y=1;y<=18;y++)this._rotateDirect(l,c,h),p.push(this._add(a,l));i.push(p);break}case $l.TripleParallelExtended:{const o=this._cp2(r,0,-2),a=this._cp3(r,o,1,-2),l=this._mid(s,o),c=this._sub(a,o);this._normalize(c);const h=Math.abs(this._crossProduct(c,this._sub(l,o)))/2,p=this._dist(o,a),y=[o,s];y.push([s[0]+c[0]*p*.5,s[1]+c[1]*p*.5]),i.push(y);const v=[];v.push([l[0]-c[0]*h,l[1]-c[1]*h]),v.push([l[0]+c[0]*p*.375,l[1]+c[1]*p*.375]),_U(v[v.length-1],1),v.push([l[0]+c[0]*p*.75,l[1]+c[1]*p*.75]),i.push(v);const x=[o,a];i.push(x);break}case $l.ParallelWithTicks:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(a,o);this._normalize(l);const c=this._crossProduct(l,this._sub(a,s));this._leftPerpendicular(l),this._addAngledTicks(i,s,o,a),this._addAngledTicks(i,this._mix(s,1,l,c),this._mix(o,1,l,c),this._mid(s,o));break}case $l.Parallel:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(o,s);this._normalize(l);const c=this._leftPerp(l),h=this._crossProduct(l,this._sub(a,s));let p=[s,o];i.push(p),p=[],p.push([s[0]+c[0]*h,s[1]+c[1]*h]),p.push([o[0]+c[0]*h,o[1]+c[1]*h]),i.push(p);break}case $l.PerpendicularToFirstSegment:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._mid(s,o),c=this._sub(o,s);this._normalize(c);const h=this._crossProduct(c,this._sub(a,s));this._leftPerpendicular(c);const p=[];p.push([l[0]-c[0]*h*.25,l[1]-c[1]*h*.25]),p.push([l[0]+c[0]*h*1.25,l[1]+c[1]*h*1.25]),i.push(p);break}case $l.ParallelOffset:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(o,s);this._normalize(l);const c=this._crossProduct(l,this._sub(a,s));this._leftPerpendicular(l);const h=[];h.push([s[0]-l[0]*c,s[1]-l[1]*c]),h.push([o[0]-l[0]*c,o[1]-l[1]*c]),i.push(h);const p=[];p.push([s[0]+l[0]*c,s[1]+l[1]*c]),p.push([o[0]+l[0]*c,o[1]+l[1]*c]),i.push(p);break}case $l.OffsetOpposite:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(o,s);this._normalize(l);const c=this._crossProduct(l,this._sub(a,s));this._leftPerpendicular(l);const h=[];h.push([s[0]-l[0]*c,s[1]-l[1]*c]),h.push([o[0]-l[0]*c,o[1]-l[1]*c]),i.push(h);break}case $l.OffsetSame:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(o,s);this._normalize(l);const c=this._crossProduct(l,this._sub(a,s));this._leftPerpendicular(l);const h=[];h.push([s[0]+l[0]*c,s[1]+l[1]*c]),h.push([o[0]+l[0]*c,o[1]+l[1]*c]),i.push(h);break}case $l.CircleWithArc:{let o=this._cp2(r,3,0);const a=this._cp3(r,o,.5,-1);let l,c;if(n>=4)l=r[3],c=this._crossProduct(this._sub(l,o),this._sub(a,o))>0;else{l=o,c=this._crossProduct(this._sub(l,s),this._sub(a,s))>0;const x=24*this._geomUnitsPerPoint,I=this._sub(l,s);this._normalize(I,x);const P=Math.sqrt(2)/2;this._rotateDirect(I,P,c?P:-P),o=this._add(s,I)}const h=this._sub(o,s),p=Math.cos(Math.PI/18),y=Math.sin(Math.PI/18),v=[o];for(let x=1;x<=36;x++)this._rotateDirect(h,p,y),v.push(this._add(s,h));this._add90DegArc(v,o,l,a,c),_U(v[v.length-8],1),i.push(v);break}case $l.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 F=s;s=l,a=o;const k=this._dist(s,F),j=this._dist(a,F);let V=30*this._geomUnitsPerPoint;.5*k0?this._rotateDirect(I,x,-x):this._rotateDirect(I,x,x);let P=[];P.push(l),P.push(this._add(c,I)),P.push(this._sub(c,I)),P.push(s),i.push(P),I=this._sub(a,o),this._normalize(I,v),this._crossProduct(I,this._sub(s,o))<0?this._rotateDirect(I,x,x):this._rotateDirect(I,x,-x),P=[],P.push(o),P.push(this._add(h,I)),P.push(this._sub(h,I)),P.push(a),i.push(P);break}case $l.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 c=[l[0]/8,l[1]/8],h=this._sub(this._mid(o,a),c);i.push([h,s]);break}case $l.LineExcludingLastSegment:{const o=this._arrowPath(r),a=[];let l=o.length-2;for(;l--;)a.push(o[l]);i.push(a);break}case $l.MultivertexArrow:{const o=this._arrowPath(r),a=[];this._addArrow(a,o,!1),i.push(a);break}case $l.CrossedArrow:{const o=this._arrowPath(r),a=[];this._addArrow(a,o,!0),i.push(a);break}case $l.ChevronArrow:{const[o,a]=this._arrowLastSeg(r),l=10*this._geomUnitsPerPoint,c=this._sub(s,o);this._normalize(c);const h=this._crossProduct(c,this._sub(a,o)),p=this._leftPerp(c),y=[a[0]-p[0]*h*2,a[1]-p[1]*h*2],v=[];v.push([a[0]+c[0]*l,a[1]+c[1]*l]),v.push(s),v.push([y[0]+c[0]*l,y[1]+c[1]*l]),i.push(v);break}case $l.ChevronArrowOffset:{const[o,a]=this._arrowLastSeg(r),l=this._sub(s,o);this._normalize(l);const c=this._crossProduct(l,this._sub(a,o));this._leftPerpendicular(l);const h=[a[0]-l[0]*c,a[1]-l[1]*c],p=[];p.push([h[0]+l[0]*c*.5,h[1]+l[1]*c*.5]),p.push(this._mid(h,s)),p.push([h[0]-l[0]*c*.5,h[1]-l[1]*c*.5]),i.push(p);break}case $l.PartialFirstSegment:{const[o,a]=this._arrowLastSeg(r),l=this._sub(s,o);this._normalize(l);const c=this._crossProduct(l,this._sub(a,o));this._leftPerpendicular(l);const h=[a[0]-l[0]*c,a[1]-l[1]*c];i.push([o,h]);break}case $l.Arch:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,1),l=this._sub(s,o),c=this._mix(a,1,l,.55),h=this._mix(a,1,l,-.55),p=[s];this._addBezier2(p,s,c,a,4),this._addBezier2(p,a,h,o,4),i.push(p);break}case $l.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 c=[l[0]/8,l[1]/8],h=this._sub(this._mid(o,a),c),p=this._sub(this._mix(o,.75,a,.25),c),y=this._sub(this._mix(o,.25,a,.75),c),v=[o];this._addBezier2(v,o,p,h,3),this._addBezier2(v,h,y,a,3),i.push(v);for(let x=0;x<8;x++){const I=v[2*x+1],P=[this._clone(I)];P.push(this._add(I,[l[0]/4,l[1]/4])),i.push(P)}break}case $l.Arc90Degrees:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,1),l=[o];this._add90DegArc(l,o,s,a),i.push(l);break}case $l.FullGeometry:default:i.push(r)}}return i}},NSt=class ere{static local(){return ere.instance===null&&(ere.instance=new ere),ere.instance}execute(e,i,r,n,s){return new eYi(e,i,r)}};NSt.instance=null;let eYi=class extends dme{constructor(e,i,r){super(e,!0,!0),this._curveHelper=new pO,this._beginCut=(i.beginCut!==void 0?i.beginCut:1)*r,this._endCut=(i.endCut!==void 0?i.endCut:1)*r,this._middleCut=(i.middleCut!==void 0?i.middleCut:0)*r,this._invert=i.invert!==void 0&&i.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(e){const i=this._beginCut,r=this._endCut,n=this._middleCut,s=this._curveHelper.calculatePathLength(e),o=[];if(this._invert){if(!(i===0&&r===0&&n===0))if(i+r+n>=s)o.push(e);else{let a=this._curveHelper.getSubCurve(e,0,i);a&&o.push(a),a=this._curveHelper.getSubCurve(e,.5*(s-n),.5*(s+n)),a&&o.push(a),a=this._curveHelper.getSubCurve(e,s-r,r),a&&o.push(a)}}else if(i===0&&r===0&&n===0)o.push(e);else if(!(i+r+n>=s))if(n===0){const a=this._curveHelper.getSubCurve(e,i,s-r);a&&o.push(a)}else{let a=this._curveHelper.getSubCurve(e,i,.5*(s-n));a&&o.push(a),a=this._curveHelper.getSubCurve(e,.5*(s+n),s-r),a&&o.push(a)}return o.length===0?null:{paths:o}}};const kSt=1e-7;let pme=class{constructor(){this._values=[],this.extPtGap=0,this.ctrlPtGap=0,this._length=0,this._currentValue=0}isEmpty(){return this._values.length===0}size(){return this._values.length}init(e,i,r=!0){if(this._setEmpty(),!e||e.length===0)return!1;for(let n=0;n0&&(s/=this._currentPosition.segmentLength),this._currentPosition.copyTo(i);i.abscissa+e*this._partLengthRatio>i.segmentLength+this._tolerance;){if(r){if(r.length===0)if(s===0){const a=this._path[i.segment];r.push([a[0],a[1]])}else r.push(this.getSegCoord2D(this._path,i.segment,s));const o=this._path[i.segment+1];r.push([o[0],o[1]])}if(s=0,e-=(i.segmentLength-i.abscissa)/this._partLengthRatio,this._partSegCount)i.segment=this._nextSegment(),i.segmentLength=this.calculateSegLength(this._path,i.segment),i.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return n!==bF.FAIL&&(i.segmentLength=this.calculateSegLength(this._path,i.segment),i.isPartEnd=!0,n===bF.END?(i.abscissa=i.segmentLength,i.isPathEnd=!0):i.abscissa=i.segmentLength+e,!0);this._currentPosition.copyTo(i)}}if(i.abscissa+=e*this._partLengthRatio,r){if(r.length===0)if(s===0){const a=this._path[i.segment];r.push([a[0],a[1]])}else r.push(this.getSegCoord2D(this._path,i.segment,s));const o=i.abscissa/i.segmentLength;if(o===1){const a=this._path[i.segment+1];r.push([a[0],a[1]])}else r.push(this.getSegCoord2D(this._path,i.segment,o))}return this._partSegCount||Math.abs(i.abscissa-i.segmentLength)=this._path.length&&(r=0),this._ctrlPtEnd=gQ(this._path[r])===1,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=i;)n-=i,i=this._pattern.nextValue(),o=!o;i-=n,o?(this._walker.nextPosition(i),i=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(i),i=this._pattern.nextValue(),this._walker.nextPosition(i),i=this._pattern.nextValue())}let r=this._walker.nextCurve(i);return r?this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(this._firstCurve.splice(0,1),bU.mergePath(r,this._firstCurve),this._firstCurve=null)):(i=this._pattern.nextValue(),!this._walker.nextPosition(i)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(r=this._firstCurve,this._firstCurve=null)):this.iteratePath=!0):(this.iteratePath=!1,r=this._firstCurve,this._firstCurve=null),{paths:[r]}}},BSt=class ire{static local(){return ire.instance===null&&(ire.instance=new ire),ire.instance}execute(e,i,r,n,s){return new iYi(e,i,r,n,s)}};BSt.instance=null;let iYi=class{constructor(e,i,r,n,s){switch(this._inputGeometries=e,this._tileKey=n,this._geometryEngine=s,this._width=(i.width!==void 0?i.width:2)*r,i.method){case qk.Mitered:case qk.Bevelled:case qk.Rounded:case qk.TrueBuffer:case qk.Square:}this._option=i.option}next(){let e;for(;e=this._inputGeometries.next();){if(mc(e)&&this._width>0){if(Math.min(e.xmax-e.xmin,e.ymax-e.ymin)-2*this._width<0)return e;const i=[];return i.push([[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]),i.push([[e.xmin+this._width,e.ymin+this._width],[e.xmax-this._width,e.ymin+this._width],[e.xmax-this._width,e.ymax-this._width],[e.xmin+this._width,e.ymax-this._width],[e.xmin+this._width,e.ymin+this._width]]),{rings:i}}if(Xa(e)){let i=null;const r=this._geometryEngine;let n=e;if(this._tileKey&&(n=zLe(e,Math.abs(this._width)+1),!n||!n.rings||n.rings.length===0))continue;if(ve(r)&&(i=r.buffer(hr.WebMercator,n,-this._width,1)),this._width>0){const s=[];for(const o of e.rings)o&&s.push(o);if(i)for(const o of i.rings)o&&s.push(o.reverse());if(s.length)return{rings:s}}}}return null}},VSt=class rre{static local(){return rre.instance===null&&(rre.instance=new rre),rre.instance}execute(e,i,r,n,s){return new rYi(e,i,r)}};VSt.instance=null;let rYi=class extends dme{constructor(e,i,r){super(e,!1,!0),this._curveHelper=new pO,this._length=(i.length!==void 0?i.length:20)*r,this._angle=i.angle!==void 0?i.angle:225,this._position=i.position!==void 0?i.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){if(this._curveHelper.isEmpty(e,!1))return null;const i=e[0],r=e[e.length-1],n=[r[0]-i[0],r[1]-i[1]];this._curveHelper.normalize(n);const s=[i[0]+(r[0]-i[0])*this._position/100,i[1]+(r[1]-i[1])*this._position/100],o=Math.cos((90-this._angle)/180*Math.PI);let a=Math.sin((90-this._angle)/180*Math.PI);return this._mirror&&(a=-a),this._mirror=!this._mirror,{paths:[[i,[s[0]-this._length/2*o,s[1]-this._length/2*a],[s[0]+this._length/2*o,s[1]+this._length/2*a],r]]}}},jSt=class nre{static local(){return nre.instance===null&&(nre.instance=new nre),nre.instance}execute(e,i,r,n,s){return new nYi(e,i,r)}};jSt.instance=null;let nYi=class{constructor(e,i,r){this._inputGeometries=e,this._offsetX=i.offsetX!==void 0?i.offsetX*r:0,this._offsetY=i.offsetY!==void 0?-i.offsetY*r:0}next(){let e=this._inputGeometries.next();for(;e;){if(mc(e))return{xmin:e.xmin+this._offsetX,xmax:e.xmax+this._offsetX,ymin:e.ymin+this._offsetY,ymax:e.ymax+this._offsetY};if(Xa(e)){const i=gi(e);return this._moveMultipath(i.rings,this._offsetX,this._offsetY),i}if(Hu(e)){const i=gi(e);return this._moveMultipath(i.paths,this._offsetX,this._offsetY),i}if(lg(e)){const i=gi(e);return this._movePath(i.points,this._offsetX,this._offsetY),i}if(qy(e))return{x:e.x+this._offsetX,y:e.y+this._offsetY};e=this._inputGeometries.next()}return null}_moveMultipath(e,i,r){if(e)for(const n of e)this._movePath(n,i,r)}_movePath(e,i,r){if(e)for(const n of e)n[0]+=i,n[1]+=r}},GSt=class sre{static local(){return sre.instance===null&&(sre.instance=new sre),sre.instance}execute(e,i,r,n,s){return new sYi(e,i,r,n,s)}};GSt.instance=null;let sYi=class{constructor(e,i,r,n,s){this._inputGeometries=e,this._tileKey=n,this._geometryEngine=s,this._curveHelper=new pO,this._offset=(i.offset??1)*r,this._method=i.method,this._option=i.option,this._offsetFlattenError=vQ*r}next(){let e;for(;e=this._inputGeometries.next();){if(this._offset===0)return e;if(mc(e)){if(this._method===tO.Rounded&&this._offset>0){const n=[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]],s=this._curveHelper.offset(n,-this._offset,this._method,4,this._offsetFlattenError);return s?{rings:[s]}:null}if(Math.min(e.xmax-e.xmin,e.ymax-e.ymin)+2*this._offset>0)return{xmin:e.xmin-this._offset,xmax:e.xmax+this._offset,ymin:e.ymin-this._offset,ymax:e.ymax+this._offset}}const i=this._geometryEngine;if(lt(i))return null;let r=e;if(Xa(e)){if(this._tileKey&&(r=zLe(e,Math.abs(this._offset)+1),!r||!r.rings||r.rings.length===0))continue}else if(Hu(e)&&this._tileKey&&(r=xSt(e,Math.abs(this._offset)+1),!r||!r.paths||r.paths.length===0))continue;return i.offset(hr.WebMercator,r,-this._offset,1,this._method,4,this._offsetFlattenError)}return null}},USt=class ore{static local(){return ore.instance===null&&(ore.instance=new ore),ore.instance}execute(e,i,r,n,s){return new oYi(e,i,r)}};USt.instance=null;let oYi=class{constructor(e,i,r){this._inputGeometries=e,this._reverse=i.reverse===void 0||i.reverse}next(){let e=this._inputGeometries.next();for(;e;){if(!this._reverse)return e;if(Hu(e)){const i=gi(e);return Wqi(i.paths),i}e=this._inputGeometries.next()}return null}},zSt=class are{static local(){return are.instance===null&&(are.instance=new are),are.instance}execute(e,i,r,n,s){return new aYi(e,i,r)}};zSt.instance=null;let aYi=class{constructor(e,i,r){this._inputGeometries=e,this._rotateAngle=i.angle!==void 0?i.angle*Math.PI/180:0}next(){let e=this._inputGeometries.next();for(;e;){if(this._rotateAngle===0)return e;const i=Mo();RC(i,e);const r=(i[2]+i[0])/2,n=(i[3]+i[1])/2;if(mc(e)){const s={rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]};return this._rotateMultipath(s.rings,r,n),s}if(Xa(e)){const s=gi(e);return this._rotateMultipath(s.rings,r,n),s}if(Hu(e)){const s=gi(e);return this._rotateMultipath(s.paths,r,n),s}if(lg(e)){const s=gi(e);return this._rotatePath(s.points,r,n),s}if(qy(e))return e;e=this._inputGeometries.next()}return null}_rotateMultipath(e,i,r){if(e)for(const n of e)this._rotatePath(n,i,r)}_rotatePath(e,i,r){if(e){const n=Math.cos(this._rotateAngle),s=Math.sin(this._rotateAngle);for(const o of e){const a=o[0]-i,l=o[1]-r;o[0]=i+a*n-l*s,o[1]=r+a*s+l*n}}}},HSt=class lre{static local(){return lre.instance===null&&(lre.instance=new lre),lre.instance}execute(e,i,r,n,s){return new lYi(e,i,r)}};HSt.instance=null;let lYi=class{constructor(e,i,r){this._inputGeometries=e,this._xFactor=i.xScaleFactor!==void 0?i.xScaleFactor:1.15,this._yFactor=i.yScaleFactor!==void 0?i.yScaleFactor:1.15}next(){let e=this._inputGeometries.next();for(;e;){if(this._xFactor===1&&this._yFactor===1)return e;const i=Mo();RC(i,e);const r=(i[2]+i[0])/2,n=(i[3]+i[1])/2;if(mc(e)){const s={rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]};return this._scaleMultipath(s.rings,r,n),s}if(Xa(e)){const s=gi(e);return this._scaleMultipath(s.rings,r,n),s}if(Hu(e)){const s=gi(e);return this._scaleMultipath(s.paths,r,n),s}if(lg(e)){const s=gi(e);return this._scalePath(s.points,r,n),s}if(qy(e))return e;e=this._inputGeometries.next()}return null}_scaleMultipath(e,i,r){if(e)for(const n of e)this._scalePath(n,i,r)}_scalePath(e,i,r){if(e)for(const n of e){const s=(n[0]-i)*this._xFactor,o=(n[1]-r)*this._yFactor;n[0]=i+s,n[1]=r+o}}},WSt=class ure{static local(){return ure.instance===null&&(ure.instance=new ure),ure.instance}execute(e,i,r,n,s){return new uYi(e,i,r)}};WSt.instance=null;let uYi=class{constructor(e,i,r){this._inputGeometries=e,this._height=(i.amplitude!==void 0?i.amplitude:2)*r,this._period=(i.period!==void 0?i.period:3)*r,this._style=i.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new pme,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new mme,this._walker.updateTolerance(r)}next(){let e=this._inputGeometries.next();for(;e;){if(this._height===0||this._period===0)return e;if(Hu(e)){const i=this._processGeom(e.paths);if(i.length)return{paths:i}}if(Xa(e)){const i=this._processGeom(e.rings);if(i.length)return{rings:i}}e=this._inputGeometries.next()}return null}_processGeom(e){const i=[];for(const r of e)if(this._walker.init(r,this._pattern))switch(this._style){case yG.Sinus:default:i.push(this._constructCurve(r,!1));break;case yG.Square:i.push(this._constructSquare(r));break;case yG.Triangle:i.push(this._constructTriangle(r));break;case yG.Random:i.push(this._constructCurve(r,!0))}else i.push(r);return i}_constructCurve(e,i){const r=new bU,n=this._walker.calculatePathLength(e);let s=Math.round(n/this._period);s===0&&(s=1);const o=s*16+1,a=n/s,l=this._period/16,c=1/o,h=2*Math.PI*n/a,p=2*Math.PI*Math.random(),y=2*Math.PI*Math.random(),v=2*Math.PI*Math.random(),x=.75-Math.random()/2,I=.75-Math.random()/2,P=new fO;this._walker.curPointAndAngle(P),r.startPath(P.pt);let F=0;for(;;){if(!this._walker.nextPointAndAngle(l,P)){r.lineTo(e[e.length-1]);break}{const k=F;let j;if(F+=c,i){const V=this._height/2*(1+.3*Math.sin(x*h*k+p));j=V*Math.sin(h*k+y),j+=V*Math.sin(I*h*k+v),j/=2}else j=.5*this._height*Math.sin(.5*h*k);r.lineTo([P.pt[0]-j*P.sa,P.pt[1]+j*P.ca])}}return r.path()}_constructSquare(e){const i=new bU,r=this._walker.calculatePathLength(e);Math.round(r/this._period);let n=!0;for(;;){let s=!1;if(this._walker.curPositionIsValid()){const o=new fO;this._walker.curPointAndAngle(o);const a=new fO;if(this._walker.nextPointAndAngle(this._period,a)){const l=new fO;this._walker.nextPointAndAngle(this._period,l)&&(n?(i.startPath(o.pt),n=!1):i.lineTo(o.pt),i.lineTo([o.pt[0]-this._height/2*o.sa,o.pt[1]+this._height/2*o.ca]),i.lineTo([a.pt[0]-this._height/2*a.sa,a.pt[1]+this._height/2*a.ca]),i.lineTo([a.pt[0]+this._height/2*a.sa,a.pt[1]-this._height/2*a.ca]),i.lineTo([l.pt[0]+this._height/2*l.sa,l.pt[1]-this._height/2*l.ca]),s=!0)}}if(!s){i.lineTo(this._walker.getPathEnd());break}}return i.path()}_constructTriangle(e){const i=new bU,r=this._walker.calculatePathLength(e);Math.round(r/this._period);let n=!0;for(;;){let s=!1;if(this._walker.curPositionIsValid()){const o=new fO;this._walker.curPointAndAngle(o);const a=new fO;if(this._walker.nextPointAndAngle(this._period/2,a)){const l=new fO;this._walker.nextPointAndAngle(this._period,l)&&(this._walker.nextPosition(this._period/2)&&(n?(i.startPath(o.pt),n=!1):i.lineTo(o.pt),i.lineTo([a.pt[0]-this._height/2*a.sa,a.pt[1]+this._height/2*a.ca]),i.lineTo([l.pt[0]+this._height/2*l.sa,l.pt[1]-this._height/2*l.ca])),s=!0)}}if(!s){i.lineTo(this._walker.getPathEnd());break}}return i.path()}},qSt=class cre{static local(){return cre.instance===null&&(cre.instance=new cre),cre.instance}execute(e,i,r,n,s){return new cYi(e,i,r)}};qSt.instance=null;let cYi=class extends yQ{constructor(e,i,r){super(e,!0,!0),this._geometryWalker=new mme,this._geometryWalker.updateTolerance(r),this._angleToLine=i.angleToLine??!0,this._offset=(i.offset?i.offset:0)*r,this._originalEndings=i.endings,this._offsetAtEnd=(i.customEndingOffset?i.customEndingOffset:0)*r,this._position=-(i.offsetAlongLine?i.offsetAlongLine:0)*r,this._pattern=new pme,this._pattern.init(i.placementTemplate,!1),this._pattern.scale(r),this._endings=this._originalEndings}processPath(e){if(this._pattern.isEmpty())return null;let i;if(this.iteratePath)i=this._pattern.nextValue();else{this._originalEndings===fS.WithFullGap&&this.isClosed?this._endings=fS.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let n,s=!0;switch(this._endings){case fS.NoConstraint:n=-this._position,n=this._adjustPosition(n),s=!1;break;case fS.WithHalfGap:default:n=-this._pattern.lastValue()/2;break;case fS.WithFullGap:n=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case fS.WithMarkers:n=0;break;case fS.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,i=o,this.iteratePath=!0}const r=new fO;return this._geometryWalker.nextPointAndAngle(i,r)?this._endings===fS.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===fS.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 i=e/this._pattern.length();return i-=Math.floor(i),i*this._pattern.length()}},YSt=class hre{static local(){return hre.instance===null&&(hre.instance=new hre),hre.instance}execute(e,i,r,n,s){return new hYi(e,i,r)}};YSt.instance=null;let hYi=class extends yQ{constructor(e,i,r){super(e,!1,!0),this._curveHelper=new pO,this._angleToLine=i.angleToLine===void 0||i.angleToLine,this._offset=i.offset!==void 0?i.offset*r:0,this._type=i.extremityPlacement,this._position=i.offsetAlongLine!==void 0?i.offsetAlongLine*r:0,this._beginProcessed=!1}processPath(e){let i;switch(this._type){case $_.Both:default:this._beginProcessed?(i=this._atExtremities(e,this._position,!1),this._beginProcessed=!1,this.iteratePath=!1):(i=this._atExtremities(e,this._position,!0),this._beginProcessed=!0,this.iteratePath=!0);break;case $_.JustBegin:i=this._atExtremities(e,this._position,!0);break;case $_.JustEnd:i=this._atExtremities(e,this._position,!1);case $_.None:}return i}_atExtremities(e,i,r){const n=e.length;if(n<2)return null;const s=r?1:n-2,o=r?n:-1,a=r?1:-1;let l,c=0,h=r?e[0]:e[n-1];for(let p=s;p!==o;p+=a){l=h,h=e[p];const y=this._curveHelper.calculateLength(l,h);if(c+y>i){const v=(i-c)/y,[x,I]=this._curveHelper.getAngleCS(l,h,v),P=WLe(l,h,v);return this.internalPlacement.setTranslate(P[0]-this._offset*I,P[1]+this._offset*x),this._angleToLine&&this.internalPlacement.setRotateCS(-x,-I),this.internalPlacement}c+=y}return null}},XSt=class dre{static local(){return dre.instance===null&&(dre.instance=new dre),dre.instance}execute(e,i,r,n,s){return new dYi(e,i,r)}};XSt.instance=null;let dYi=class extends yQ{constructor(e,i,r){super(e,!0,!0),this._walker=new mme,this._walker.updateTolerance(r),this._angleToLine=i.angleToLine===void 0||i.angleToLine,this._offset=i.offset!==void 0?i.offset*r:0,this._beginGap=i.beginPosition!==void 0?i.beginPosition*r:0,this._endGap=i.endPosition!==void 0?i.endPosition*r:0,this._flipFirst=i.flipFirst===void 0||i.flipFirst,this._pattern=new pme,this._pattern.init(i.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 i;if(this.iteratePath){const a=this._pattern.nextValue()*this._subPathLen,l=this._beginGap+a;i=l-this._prevPos,this._prevPos=l}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=this._walker.calculatePathLength(e)-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;i=l-this._prevPos,this._prevPos=l,this.iteratePath=!0}const r=new fO;if(!this._walker.nextPointAndAngle(i,r,bF.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 wF=512,pYi=10,fYi=12,KSt=25,PE=24;function mYi(t){return t.rings!==void 0}let JSt=class pre{static local(){return pre.instance===null&&(pre.instance=new pre),pre.instance}execute(e,i,r,n,s){return new gYi(e,i,r,n,s)}};JSt.instance=null;let gYi=class O8{constructor(e,i,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(i.stepX??16)*r,this._stepY=Math.abs(i.stepY??16)*r,this._stepX!==0&&this._stepY!==0&&e&&mYi(e)&&e.rings){if(this._gridType=i.gridType??LJ.Fixed,this._gridType===LJ.Random){const o=i.seed??13,a=1;this._randomLCG=new vC(o*a),this._randomness=(i.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=i.gridAngle??0,this._shiftOddRows=i.shiftOddRows??!1,this._offsetX=(i.offsetX??0)*r,this._offsetY=(i.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]=n.split("/"),c=parseFloat(a),h=parseFloat(l);this._graphicOriginX=-h*wF,this._graphicOriginY=c*wF,this._testInsidePolygon=!0}this._internalPlacement=new vU,this._calculateMinMax(e),this._geometry=e}}next(){return this._geometry?this._nextInside():null}_buildRandomValues(){if(!O8._randValues){O8._randValues=[];for(let e=0;e=j,this._polygonMin=this._verticalSubdivision?y:x,this._testInsidePolygon){let V=0-this._graphicOriginX-this._offsetX-this._stepX,Y=wF-this._graphicOriginX-this._offsetX+this._stepX,X=-wF-this._graphicOriginY-this._offsetY-this._stepY,Z=0-this._graphicOriginY-this._offsetY+this._stepY;if(P){const ie=[[V,X],[V,Z],[Y,X],[Y,Z]];V=X=Number.MAX_VALUE,Y=Z=-Number.MAX_VALUE;for(const ce of ie){const he=this._cosAngle*ce[0]-this._sinAngle*ce[1],_e=this._sinAngle*ce[0]+this._cosAngle*ce[1];V=Math.min(V,he),Y=Math.max(Y,he),X=Math.min(X,_e),Z=Math.max(Z,_e)}}l=l!==Number.MAX_VALUE?Math.max(l,V):V,c=c!==Number.MAX_VALUE?Math.max(c,X):X,h=h!==-Number.MAX_VALUE?Math.min(h,Y):Y,p=p!==-Number.MAX_VALUE?Math.min(p,Z):Z}this._xMin=Math.round(l/this._stepX),this._xMax=Math.round(h/this._stepX),this._yMin=Math.round(c/this._stepY),this._yMax=Math.round(p/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._testInsidePolygon&&F>fYi&&(k>KSt||j>KSt)&&this._buildAccelerationMap(e,x,I,y,v)}_buildAccelerationMap(e,i,r,n,s){const{rings:o}=e,a=new Map,l=this._verticalSubdivision,c=l?s-n:r-i;let h=Math.ceil(c/pYi);if(h<=1)return;const p=Math.floor(c/h);let y,v,x,I,P,F,k,j,V,Y;h++,this._delta=p,l?(j=-wF-this._stepY,V=this._stepY,Y=n):(j=-this._stepX,V=wF+this._stepX,Y=i);for(let X=0;XV&&x[1]>V)continue;I=Math.min(v[1],x[1]),P=Math.max(v[1],x[1])}else{if(v[0]===x[0]||v[0]V&&x[0]>V)continue;I=Math.min(v[0],x[0]),P=Math.max(v[0],x[0])}for(;IF&&ZSt(k,X,Z,a)}this._accelerationMap=a}_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 i=this._currentY*this._stepY+this._offsetY;let r,n;if(this._currentX++,this._gridType===LJ.Random){const s=(this._currentX%PE+PE)%PE,o=(this._currentY%PE+PE)%PE;r=this._graphicOriginX+e+this._stepX*this._randomness*(.5-O8._randValues[o*PE+s])*2/3,n=this._graphicOriginY+i+this._stepY*this._randomness*(.5-O8._randValues[o*PE+s+1])*2/3}else r=this._graphicOriginX+this._cosAngle*e+this._sinAngle*i,n=this._graphicOriginY-this._sinAngle*e+this._cosAngle*i;if(!this._testInsidePolygon||this._isInsidePolygon(r,n,this._geometry))return this._internalPlacement.setTranslate(r,n),this._internalPlacement}}_isInsidePolygon(e,i,r){const{rings:n}=r;if(lt(this._accelerationMap))return yYi(e,i,r);const s=this._verticalSubdivision,o=s?i:e,a=Math.floor((o-this._polygonMin)/this._delta),l=this._accelerationMap.get(a);if(!l)return!1;let c,h,p,y,v,x=0;for(const I of l){v=I[0];const P=n[v];if(y=I[1],c=P[y-1],h=P[y],s){if(c[1]>i==h[1]>i)continue;p=(h[0]-c[0])*(i-c[1])-(h[1]-c[1])*(e-c[0])}else{if(c[0]>e==h[0]>e)continue;p=(h[1]-c[1])*(e-c[0])-(h[0]-c[0])*(i-c[1])}p>0?x++:x--}return x!==0}};function yYi(t,e,i){const{rings:r}=i;let n,s,o,a=0;for(const l of r){n=l.length;for(let c=1;ce!=o[1]>e&&((o[0]-s[0])*(e-s[1])-(o[1]-s[1])*(t-s[0])>0?a++:a--)}return a!==0}function ZSt(t,e,i,r){let n=r.get(t);n||(n=[],r.set(t,n)),n.push([e,i])}const vYi=.001;let QSt=class fre{static local(){return fre.instance===null&&(fre.instance=new fre),fre.instance}execute(e,i,r,n,s){return new _Yi(e,i,r)}};QSt.instance=null;let _Yi=class extends yQ{constructor(e,i,r){super(e,!0,!0),this._curveHelper=new pO,this._angleToLine=i.angleToLine===void 0||i.angleToLine,this._offset=i.offset!==void 0?i.offset*r:0,this._relativeTo=i.relativeTo,this._position=i.startPointOffset!==void 0?i.startPointOffset*r:0,this._epsilon=vYi*r}processPath(e){const i=this._position;if(this._relativeTo===UD.SegmentMidpoint){for(this.iteratePath||(this._segmentCount=e.length,this._curSegment=1,this.iteratePath=!0);this._curSegmentr){const p=(r-a)/h,[y,v]=this._curveHelper.getAngleCS(o,l,p),x=WLe(o,l,p),I=n?-this._offset:this._offset;return this.internalPlacement.setTranslate(x[0]-I*v,x[1]+I*y),this._angleToLine&&(n?this.internalPlacement.setRotateCS(-y,-v):this.internalPlacement.setRotateCS(y,v)),this.internalPlacement}a+=h}return null}},eCt=class mre{static local(){return mre.instance===null&&(mre.instance=new mre),mre.instance}execute(e,i,r,n,s){return new wYi(e,i,r)}};eCt.instance=null;const bYi=1e-15;let wYi=class extends yQ{constructor(e,i,r){super(e,!0,!0),this._curveHelper=new pO,this._angleToLine=i.angleToLine===void 0||i.angleToLine,this._offset=i.offset!==void 0?i.offset*r:0,this._endPoints=i.placeOnEndPoints===void 0||i.placeOnEndPoints,this._controlPoints=i.placeOnControlPoints===void 0||i.placeOnControlPoints,this._regularVertices=i.placeOnRegularVertices===void 0||i.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 i=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(i[2]);let r=i[0],n=i[1];if(this._offset!==0){const s=Math.cos(i[2]),o=Math.sin(i[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;const i=qqi(e),r=e.length-1;let n,s,o=0,a=0,l=0,c=0,h=0;for(;oi+2*bYi;)e-t>i?e-=2*i:e+=2*i;return(t+e)/2}let xYi=class{constructor(e=SYi){this._data=[],this._compare=e}get size(){return this._data.length}enqueue(e){if(e==null)return;const{_data:i,_compare:r}=this;i.push(e);let n=i.length-1>>>0;const s=i[n];for(;n>0;){const o=n-1>>1,a=i[o];if(!(r(a,s)<=0))break;i[o]=s,i[n]=a,n=o}}dequeue(){const{_data:e,_compare:i}=this,r=e[0],n=e.pop();if(e.length===0)return r;e[0]=n;let s=0;const o=e.length,a=e[0];let l,c,h=null;for(;;){const p=2*s+1,y=2*s+2;if(h=null,p0&&(h=p)),yte?1:0,CYi=100*222045e-21;function TYi(t){const{rings:e}=t;if(!e||e.length===0)return null;const i=RC(Mo(),t);if(!i)return null;const r=4*(Math.abs(i[0])+Math.abs(i[2])+Math.abs(i[1])+Math.abs(i[3])+1)*CYi;let n=0,s=0;for(let he=0;hes&&(s=_e,n=he)}if(Math.abs(s)<=2*r*r){const he=J8(Mo(),e[n]);return[(he[0]+he[2])/2,(he[1]+he[3])/2]}const o=_Ue(e[n],!1,Mo());if(o===null)return null;if(e.length===1&&e[0].length<4)return o;const a=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],l=[NaN,NaN,NaN,NaN],c=[NaN,NaN,NaN,NaN];let h=!1,p=_Q(o,t,!0);p.distance===0&&(h=!0,a[0][0]=o[0],a[0][1]=o[1],p=_Q(o,t,!1)),l[0]=p.distance,c[0]=0;const y=[NaN,NaN];let v=!1,x=.25,I=-1;const P=J8(Mo(),e[n]);let F=NaN;do if(F=NaN,a[1]=YLe(t,XLe(P[0],P[2],x),r,i),isNaN(a[1][0])||isNaN(a[1][1])||(p=_Q(a[1],t,!1),F=p.distance),!isNaN(F)&&F>r&&yme(a[1],t))v=!0,l[1]=F,c[1]=v6(a[1],o);else if(!isNaN(F)&&F>I&&(I=F,y[0]=a[1][0],y[1]=a[1][1]),x-=.01,x<.1){if(!(I>=0))break;v=!0,l[1]=I,a[1][0]=y[0],a[1][1]=y[1],c[1]=v6(a[1],o)}while(!v);v=!1,x=.5,I=-1;let k=.01,j=1;do if(F=NaN,a[2]=YLe(t,XLe(P[0],P[2],x),r,i),isNaN(a[2][0])||isNaN(a[2][1])||(p=_Q(a[2],t,!1),F=p.distance),!isNaN(F)&&F>r&&yme(a[2],t))v=!0,l[2]=F,c[2]=v6(a[2],o);else if(!isNaN(F)&&F>I)I=F,y[0]=a[2][0],y[1]=a[2][1];else if(F>I&&(I=F,y[0]=a[2][0],y[1]=a[2][1]),x=.5+k*j,k+=.01,j*=-1,x<.3||x>.7){if(!(I>=0))break;v=!0,l[2]=I,a[2][0]=y[0],a[2][1]=y[1],c[2]=v6(a[2],o)}while(!v);v=!1,x=.75,I=-1;do if(F=NaN,a[3]=YLe(t,XLe(P[0],P[2],x),r,i),isNaN(a[3][0])||isNaN(a[3][1])||(p=_Q(a[3],t,!1),F=p.distance),!isNaN(F)&&F>r&&yme(a[3],t))v=!0,l[3]=F,c[3]=v6(a[3],o);else if(F>I&&(I=F,y[0]=a[3][0],y[1]=a[3][1]),x+=.01,x>.9){if(!(I>=0))break;v=!0,l[3]=I,a[3][0]=y[0],a[3][1]=y[1],c[3]=v6(a[3],o)}while(!v);const V=[0,1,2,3],Y=h?0:1;let X;for(let he=Y;he<4;he++)for(let _e=Y;_e<3;_e++){const xe=c[_e],Pe=c[_e+1];AYi(xe,Pe)>0&&(X=V[_e],V[_e]=V[_e+1],V[_e+1]=X,c[_e]=Pe,c[_e+1]=xe)}let Z=Y,ie=0,ce=0;for(let he=Y;he<4;he++){switch(he){case 0:ce=2*l[V[he]];break;case 1:ce=1.66666666*l[V[he]];break;case 2:ce=1.33333333*l[V[he]];break;case 3:ce=l[V[he]]}ce>ie&&(ie=ce,Z=V[he])}return a[Z]}function yme(t,e){const{rings:i}=e;let r=0;for(const n of i){const s=n.length;for(let o=1;ot[1]!=l[1]>t[1]&&((l[0]-a[0])*(t[1]-a[1])-(l[1]-a[1])*(t[0]-a[0])>0?r++:r--)}}return r!==0}function _Q(t,e,i){if(i&&yme(t,e))return{coord:t,distance:0};let r=1/0,n=0,s=0;const o=[0,0],{rings:a}=e;for(const l of a)if(!(l.length<2))for(let c=0;co?kp)r&tCt?(r&vme?(e[1]+=p*(s-e[0])/h,e[0]=s):(e[1]+=p*(a-e[0])/h,e[0]=a),r=OE(e,t)):n&tCt?(n&vme?(i[1]+=p*(s-i[0])/h,i[0]=s):(i[1]+=p*(a-i[0])/h,i[0]=a),n=OE(i,t)):r?(r&_me?(e[0]+=h*(o-e[1])/p,e[1]=o):(e[0]+=h*(l-e[1])/p,e[1]=l),r=OE(e,t)):(n&_me?(i[0]+=h*(o-i[1])/p,i[1]=o):(i[0]+=h*(l-i[1])/p,i[1]=l),n=OE(i,t));else if(r&iCt?(r&_me?(e[0]+=h*(o-e[1])/p,e[1]=o):(e[0]+=h*(l-e[1])/p,e[1]=l),r=OE(e,t)):n&iCt?(n&_me?(i[0]+=h*(o-i[1])/p,i[1]=o):(i[0]+=h*(l-i[1])/p,i[1]=l),n=OE(i,t)):r?(r&vme?(e[1]+=p*(s-e[0])/h,e[0]=s):(e[1]+=p*(a-e[0])/h,e[0]=a),r=OE(e,t)):(n&vme?(i[1]+=p*(s-i[0])/h,i[0]=s):(i[1]+=p*(a-i[0])/h,i[0]=a),n=OE(i,t)),r&n)return 0}while(r|n);return c}function OE(t,e){return(t[0]e[2]?1:0)<<1|(t[1]e[3]?1:0)<<3}function XLe(t,e,i){return t+(e-t)*i}function v6(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function AYi(t,e){if(te)return 1;if(t===e)return 0;const i=isNaN(t),r=isNaN(e);return ir?1:0}let wU=class{constructor(e,i,r,n){this.x=e,this.y=i,this.cellSize=r,this.distancefromCellCenter=K9t(e,i,n),this.maxDistanceToPolygon=this.distancefromCellCenter+this.cellSize*Math.SQRT2}};const PYi=1,OYi=100;function RYi(t){if(!t||!t.rings||t.rings.length===0)return null;const e=J8(Mo(),t.rings[0]);if(!e)return null;const i=e[2]-e[0],r=e[3]-e[1];if(i===0||r===0)return[e[0]+i/2,e[1]+r/2];const n=Math.max(Math.min(i,r)/OYi,PYi),s=new xYi((v,x)=>x.maxDistanceToPolygon-v.maxDistanceToPolygon),o=Math.min(i,r);let a=o/2,l=0,c=0;for(l=e[0];l0;)p=s.dequeue(),p.distancefromCellCenter>y.distancefromCellCenter&&(y=p),p.maxDistanceToPolygon-y.distancefromCellCenter<=n||(a=p.cellSize/2,s.enqueue(new wU(p.x-a,p.y-a,a,t)),s.enqueue(new wU(p.x+a,p.y-a,a,t)),s.enqueue(new wU(p.x-a,p.y+a,a,t)),s.enqueue(new wU(p.x+a,p.y+a,a,t)));return[y.x,y.y]}function MYi(t){return t.rings!==void 0}let rCt=class gre{static local(){return gre.instance===null&&(gre.instance=new gre),gre.instance}execute(e,i,r,n,s){return new DYi(e,i,r)}};rCt.instance=null;let DYi=class{constructor(e,i,r){this._geometry=e,this._offsetX=i.offsetX!==void 0?i.offsetX*r:0,this._offsetY=i.offsetY!==void 0?i.offsetY*r:0,this._method=i.method!==void 0?i.method:vG.OnPolygon,this._internalPlacement=new vU}next(){const e=this._geometry;return this._geometry=null,e&&MYi(e)?this._polygonCenter(e):null}_polygonCenter(e){let i=!1;switch(this._method){case vG.CenterOfMass:{const r=nBt(e);r&&(this._internalPlacement.setTranslate(r[0]+this._offsetX,r[1]+this._offsetY),i=!0)}break;case vG.BoundingBoxCenter:{const r=Mo();RC(r,e),r&&(this._internalPlacement.setTranslate((r[2]+r[0])/2+this._offsetX,(r[3]+r[1])/2+this._offsetY),i=!0)}break;case vG.OnPolygon:default:{let r;r=Hi("polylabel-placement-enabled")?RYi(e):TYi(e),r!==null&&(this._internalPlacement.setTranslate(r[0]+this._offsetX,r[1]+this._offsetY),i=!0)}}return i?this._internalPlacement:null}};function KLe(t){if(!t)return null;switch(t.type){case"CIMGeometricEffectAddControlPoints":return MSt.local();case"CIMGeometricEffectArrow":return DSt.local();case"CIMGeometricEffectBuffer":return FSt.local();case"CIMGeometricEffectControlMeasureLine":return LSt.local();case"CIMGeometricEffectCut":return NSt.local();case"CIMGeometricEffectDashes":return $St.local();case"CIMGeometricEffectDonut":return BSt.local();case"CIMGeometricEffectJog":return VSt.local();case"CIMGeometricEffectMove":return jSt.local();case"CIMGeometricEffectOffset":return GSt.local();case"CIMGeometricEffectReverse":return USt.local();case"CIMGeometricEffectRotate":return zSt.local();case"CIMGeometricEffectScale":return HSt.local();case"CIMGeometricEffectWave":return WSt.local()}return null}function nCt(t){if(!t)return null;switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":return qSt.local();case"CIMMarkerPlacementAtExtremities":return YSt.local();case"CIMMarkerPlacementAtRatioPositions":return XSt.local();case"CIMMarkerPlacementInsidePolygon":return JSt.local();case"CIMMarkerPlacementOnLine":return QSt.local();case"CIMMarkerPlacementOnVertices":return eCt.local();case"CIMMarkerPlacementPolygonCenter":return rCt.local()}return null}function JLe(t){const e=t.getFrame(0);if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement)return e;const i=document.createElement("canvas");i.width=t.width,i.height=t.height;const r=i.getContext("2d");return e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0),i}let bme=class{constructor(e=0,i=0,r=0,n=0){this.x=e,this.y=i,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)}};function FYi(t){return`rgb(${t.slice(0,3).toString()})`}function LYi(t){return`rgba(${t.slice(0,3).toString()},${t[3]})`}let sCt=class{constructor(e){e&&(this._textRasterizationCanvas=e)}rasterizeText(e,i){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const r=this._textRasterizationCanvas,n=r.getContext("2d");this._setFontProperties(n,i),this._parameters=i,this._textLines=e.split(/\r?\n/),this._lineHeight=this._computeLineHeight();const s=this._computeTextWidth(n,i),{decoration:o,weight:a}=i.font;this._lineThroughWidthOffset=o&&o==="line-through"?.1*this._lineHeight:0;const l=this._lineHeight*this._textLines.length;r.width=s+2*this._lineThroughWidthOffset,r.height=l,this._renderedLineHeight=Math.round(this._lineHeight*i.pixelRatio),this._renderedHaloSize=i.halo.size*i.pixelRatio,this._renderedWidth=s*i.pixelRatio,this._renderedHeight=l*i.pixelRatio,this._lineThroughWidthOffset*=i.pixelRatio;const c=i.color??[0,0,0,0],h=i.halo&&i.halo.color?i.halo.color:[0,0,0,0];this._fillStyle=LYi(c),this._haloStyle=FYi(h);const p=this._renderedLineHeight,y=this._renderedHaloSize;n.save(),n.clearRect(0,0,r.width,r.height),this._setFontProperties(n,i);const v=NYi(n.textAlign,this._renderedWidth)+y,x=y,I=y>0;let P=this._lineThroughWidthOffset,F=0;I&&this._renderHalo(n,v,x,P,F,i),F+=x,P+=v;for(const ie of this._textLines)I?(n.globalCompositeOperation="destination-out",n.fillStyle="rgb(0, 0, 0)",n.fillText(ie,P,F),n.globalCompositeOperation="source-over",n.fillStyle=this._fillStyle,n.fillText(ie,P,F)):(n.fillStyle=this._fillStyle,n.fillText(ie,P,F)),o&&o!=="none"&&this._renderDecoration(n,P,F,o,a),F+=p;n.restore();const k=this._renderedWidth+2*this._lineThroughWidthOffset,j=this._renderedHeight,V=n.getImageData(0,0,k,j),Y=new Uint8Array(V.data);if(i.premultiplyColors){let ie;for(let ce=0;ce600)&&(r+=.3*e.measureText("w").width),r+=2*this._parameters.halo.size,Math.round(r)}_computeLineHeight(){let e=1.275*this._parameters.size;const i=this._parameters.font.decoration;return i&&i==="underline"&&(e*=1.3),Math.round(e+2*this._parameters.halo.size)}_renderDecoration(e,i,r,n,s,o){const a=.9*this._lineHeight,l=s==="bold"?.06:s==="bolder"?.09:.04;switch(e.textAlign){case"center":i-=this._renderedWidth/2;break;case"right":i-=this._renderedWidth}const c=e.textBaseline;if(n==="underline")switch(c){case"top":r+=a;break;case"middle":r+=a/2}else if(n==="line-through")switch(c){case"top":r+=a/1.5;break;case"middle":r+=a/3}const h=o?1.5*o:Math.ceil(a*l);e.save(),e.beginPath(),e.strokeStyle=e.fillStyle,e.lineWidth=h,e.moveTo(i-this._lineThroughWidthOffset,r),e.lineTo(i+this._renderedWidth+2*this._lineThroughWidthOffset,r),e.stroke(),e.restore()}};function NYi(t,e){return t==="center"?.5*e:t==="right"?e:0}var Fd,Ld;function oCt(t){switch(t){case"left":return Fd.Left;case"right":return Fd.Right;case"center":return Fd.Center}}function aCt(t){switch(t){case"top":return Ld.Top;case"middle":return Ld.Center;case"baseline":return Ld.Baseline;case"bottom":return Ld.Bottom}}function kYi(t){switch(t){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return[Fd.Right,Ld.Bottom];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return[Fd.Center,Ld.Bottom];case"above-right":case"esriServerPointLabelPlacementAboveRight":return[Fd.Left,Ld.Bottom];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return[Fd.Right,Ld.Center];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return[Fd.Center,Ld.Center];case"center-right":case"esriServerPointLabelPlacementCenterRight":return[Fd.Left,Ld.Center];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return[Fd.Right,Ld.Top];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return[Fd.Center,Ld.Top];case"below-right":case"esriServerPointLabelPlacementBelowRight":return[Fd.Left,Ld.Top];default:return console.debug(`Found invalid placement type ${t}`),[Fd.Center,Ld.Center]}}function $Yi(t){switch(t){case Fd.Right:return-1;case Fd.Center:return 0;case Fd.Left:return 1;default:return console.debug(`Found invalid horizontal alignment ${t}`),0}}function BYi(t){switch(t){case Ld.Top:return 1;case Ld.Center:return 0;case Ld.Bottom:case Ld.Baseline:return-1;default:return console.debug(`Found invalid vertical alignment ${t}`),0}}function VYi(t){switch(t){case"left":return Fd.Left;case"right":return Fd.Right;case"center":return Fd.Center}}function lCt(t){switch(t){case"above-along":case"below-along":case"center-along":case"esriServerLinePlacementAboveAlong":case"esriServerLinePlacementBelowAlong":case"esriServerLinePlacementCenterAlong":return!0;default:return!1}}(function(t){t[t.Left=-1]="Left",t[t.Center=0]="Center",t[t.Right=1]="Right"})(Fd||(Fd={})),function(t){t[t.Top=1]="Top",t[t.Center=0]="Center",t[t.Bottom=-1]="Bottom",t[t.Baseline=2]="Baseline"}(Ld||(Ld={}));let bQ=class DBe{constructor(e,i,r,n){this.center=mp(e,i),this.centerT=xT(),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 DBe(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,i=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+i)/r,o=(e.halfHeight+this.halfHeight+i)/n,a=Math.min(s,o);return Math.log2(a)}extend(e){const i=Math.min(this.xmin,e.xmin),r=Math.min(this.ymin,e.ymin),n=Math.max(this.xmax,e.xmax)-i,s=Math.max(this.ymax,e.ymax)-r,o=i+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 i=e.readF32(),r=e.readF32(),n=e.readInt32(),s=e.readInt32();return new DBe(i,r,n,s)}};const ZLe=26,uCt=4,jYi=ZLe+uCt,GYi=ZLe-6,cCt=3,E0=8,UYi=Math.PI/180,xF=8,zYi=1.5;let hCt=class{constructor(e,i,r,n){this._rotationT=g_(),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,i*=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]=i,o[2]=e+a,o[3]=i,o[4]=e,o[5]=i+l,o[6]=e+a,o[7]=i+l,this._data=o,this._setTextureCoords(s),this._scale=n,this._mosaic=r,this.x=e,this.y=i,this.maxOffset=Math.max(e+a,i+l)}get mosaic(){return this._mosaic}set angle(e){this._angle=e,qY(this._rotationT,-e),this._setOffsets(this._data)}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._data),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:i}=this._mosaic.metrics,r=i*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=QB(g_(),this._rotationT,this._transform);mIe(s,s,o);let a=1/0,l=1/0,c=0,h=0;for(let I=0;I<4;I++){const P=s[2*I],F=s[2*I+1];a=Math.min(a,P),l=Math.min(l,F),c=Math.max(c,P),h=Math.max(h,F)}const p=c-a,y=h-l,v=a+p/2,x=l+y/2;this._bounds=new bQ(v,x,p,y)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}_setOffsets(e){this._offsets||(this._offsets={upperLeft:0,upperRight:0,lowerLeft:0,lowerRight:0});const i=this._offsets,r=new Float32Array(8),n=QB(g_(),this._rotationT,this._transform);mIe(r,e,n),i.upperLeft=Xn(r[0]*E0,r[1]*E0),i.upperRight=Xn(r[2]*E0,r[3]*E0),i.lowerLeft=Xn(r[4]*E0,r[5]*E0),i.lowerRight=Xn(r[6]*E0,r[7]*E0)}_setTextureCoords({x:e,y:i,width:r,height:n}){this._texcoords={upperLeft:Xn(e,i),upperRight:Xn(e+r,i),lowerLeft:Xn(e,i+n),lowerRight:Xn(e+r,i+n)}}};const HYi=(t,e)=>({code:0,page:0,sdf:!0,rect:new Md(0,0,11,8),textureBinding:e,metrics:{advance:0,height:4,width:t,left:0,top:0}});function wQ(t,e){return t.forEach(i=>m0(i,i,e)),{upperLeft:Xn(E0*t[0][0],E0*t[0][1]),upperRight:Xn(E0*t[1][0],E0*t[1][1]),lowerLeft:Xn(E0*t[2][0],E0*t[2][1]),lowerRight:Xn(E0*t[3][0],E0*t[3][1])}}let WYi=class{constructor(e,i,r){this._rotation=0,this._decorate(e,i,r),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=i.length>1,this._hasRotation=r.angle!==0,this._transform=this._createGlyphTransform(this.bounds,r),this._borderLineSize=r.borderLineSize,(r.borderLineSize||r.hasBackground)&&([this.bounds,this.background]=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 i=this._transform,r=qY(g_(),e);QB(i,r,i);for(const n of this.glyphs)n.setTransform(this._transform)}_decorate(e,i,r){if(!r.decoration||r.decoration==="none"||!e.length)return;const n=r.scale,s=r.decoration==="underline"?jYi:GYi,o=e[0].textureBinding;for(const a of i){const l=a.startX*n,c=a.startY*n,h=(a.width+a.glyphWidthEnd)*n;e.push(new hCt(l,c+s*n,HYi(h,o),1))}}shapeBackground(e){const i=vn(this._borderLineSize||0),r=(zYi+i)/2,n=this._borderLineSize?r:0,{xmin:s,ymin:o,xmax:a,ymax:l,x:c,y:h,width:p,height:y}=this.bounds,v=[s-xF,o-xF],x=[a+xF,o-xF],I=[s-xF,l+xF],P=[a+xF,l+xF],F=wQ([[v[0]-r,v[1]-r],[x[0]+r,x[1]-r],[v[0]+n,v[1]+n],[x[0]-n,x[1]+n]],e),k=wQ([[I[0]+n,I[1]-n],[P[0]-n,P[1]-n],[I[0]-r,I[1]+r],[P[0]+r,P[1]+r]],e),j=wQ([[v[0]-r,v[1]-r],[v[0]+n,v[1]+n],[I[0]-r,I[1]+r],[I[0]+n,I[1]-n]],e),V=wQ([[x[0]-n,x[1]+n],[x[0]+r,x[1]-r],[P[0]-n,P[1]-n],[P[0]+r,P[1]+r]],e),Y={main:wQ([v,x,I,P],e),top:F,bot:k,left:j,right:V};return[new bQ(c,h,p+2*r,y+2*r),Y]}get boundsT(){const e=this.bounds,i=ga(xT(),e.x,e.y);if(m0(i,i,this._transform),this._hasRotation){const r=Math.max(e.width,e.height);return new bQ(i[0],i[1],r,r)}return new bQ(i[0],i[1],e.width,e.height)}_createBounds(e){let i=1/0,r=1/0,n=0,s=0;for(const l of e)i=Math.min(i,l.xTopLeft),r=Math.min(r,l.yTopLeft),n=Math.max(n,l.xBottomRight),s=Math.max(s,l.yBottomRight);const o=n-i,a=s-r;return new bQ(i+o/2,r+a/2,o,a)}_createGlyphTransform(e,i){const r=UYi*i.angle,n=g_(),s=xT();return vM(n,n,ga(s,i.xOffset,-i.yOffset)),i.isCIM?gN(n,n,r):(vM(n,n,ga(s,e.x,e.y)),gN(n,n,r),vM(n,n,ga(s,-e.x,-e.y))),n}},wme=class{constructor(e,i,r,n,s,o){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(i,r)),this.end=Math.max(0,Math.max(i,r)),this.endt===10,dCt=t=>t===32;function qYi(t,e,i){const r=new Array,n=1/i.scale,s=i.maxLineWidth*n,o=e?t.length-1:0,a=e?-1:t.length,l=e?-1:1;let c=o,h=0,p=0,y=c,v=y,x=0,I=1/0,P=0;for(;c!==a;){const{code:k,metrics:j}=t[c],V=Math.abs(j.top);if(QLe(k)||dCt(k)||(I=Math.min(I,V),P=Math.max(P,V+j.height)),QLe(k))c!==o&&(r.push(new wme(t,y,c-l,h,I,P)),I=1/0,P=0),h=0,y=c+l,v=c+l,p=0;else if(dCt(k))v=c+l,p=0,x=j.advance,h+=j.advance;else if(h>s){if(v!==y){const Y=v-2*l;h-=x,r.push(new wme(t,y,Y,h-p,I,P)),I=1/0,P=0,y=v,h=p}else r.push(new wme(t,y,c-l,h,I,P)),I=1/0,P=0,y=c,v=c,h=0;h+=j.advance,p+=j.advance}else h+=j.advance,p+=j.advance;c+=l}const F=new wme(t,y,c-l,h,I,P);return F.start>=0&&F.end1}back(){return this._transfos[this._transfos.length-1]}push(e,i){const r=i?e.scaleRatio():1;b6.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,i,r){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(e,i);break;case"CIMTextSymbol":this.drawTextSymbol(e,i,r)}}drawMultiLayerSymbol(e,i){if(!e||!i)return;const r=e.symbolLayers;if(!r)return;const n=e.effects;if(n&&n.length>0){const s=this.executeEffects(n,i);if(s){let o=s.next();for(;o;)this.drawSymbolLayers(r,o),o=s.next()}}else this.drawSymbolLayers(r,i)}executeEffects(e,i){const r=this._resourceManager.geometryEngine;let n=new ULe(i);for(const s of e){const o=KLe(s);o&&(n=o.execute(n,s,this.geomUnitsPerPoint(),null,r))}return n}drawSymbolLayers(e,i){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,i);if(o){let a=null;for(;(a=o.next())&&(this.drawSymbolLayer(n,a),!this._earlyReturn););}}else this.drawSymbolLayer(n,i);if(this._earlyReturn)return}}drawSymbolLayer(e,i){switch(e.type){case"CIMSolidFill":this.drawSolidFill(i,e.color);break;case"CIMHatchFill":this.drawHatchFill(i,e);break;case"CIMPictureFill":this.drawPictureFill(i,e);break;case"CIMGradientFill":this.drawGradientFill(i,e);break;case"CIMSolidStroke":this.drawSolidStroke(i,e.color,e.width,e.capStyle,e.joinStyle,e.miterLimit);break;case"CIMPictureStroke":this.drawPictureStroke(i,e);break;case"CIMGradientStroke":this.drawGradientStroke(i,e);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(e,i)}}drawHatchFill(e,i){const r=this._buildHatchPolyline(i,e,this.geomUnitsPerPoint());r&&(this.pushClipPath(e),this.drawMultiLayerSymbol(i.lineSymbol,r),this.popClipPath())}drawPictureFill(e,i){}drawGradientFill(e,i){}drawPictureStroke(e,i){}drawGradientStroke(e,i){}drawMarkerLayer(e,i){const r=e.markerPlacement;if(r){const n=nCt(r);if(n){const s=r.type==="CIMMarkerPlacementInsidePolygon"||r.type==="CIMMarkerPlacementPolygonCenter"&&r.clipAtBoundary;s&&this.pushClipPath(i);const o=n.execute(i,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(qy(i))n.tx=i.x,n.ty=i.y,this.drawMarker(e,n);else if(Xa(i)){const s=Cne(i);s&&([n.tx,n.ty]=s,this.drawMarker(e,n))}else for(const s of i.points)if(n.tx=s[0],n.ty=s[1],this.drawMarker(e,n),this._earlyReturn)break;this._placementPool.release(n)}}drawMarker(e,i){switch(e.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(e,i);break;case"CIMVectorMarker":this.drawVectorMarker(e,i)}}drawPictureMarker(e,i){if(!e)return;const r=this._resourceManager.getResource(e.url),n=e.size??10;if(lt(r)||n<=0)return;const s=r.width,o=r.height;if(!s||!o)return;const a=s/o,l=e.scaleX??1,c=b6.createIdentity(),h=e.anchorPoint;if(h){let P=h.x,F=h.y;e.anchorPointUnits!=="Absolute"&&(P*=n*a*l,F*=n),c.translate(-P,-F)}let p=e.rotation??0;e.rotateClockwise&&(p=-p),this._mapRotation&&(p+=this._mapRotation),p&&c.rotate(p*_6);let y=e.offsetX??0,v=e.offsetY??0;if(y||v){if(this._mapRotation){const P=_6*this._mapRotation,F=Math.cos(P),k=Math.sin(P),j=y*k+v*F;y=y*F-v*k,v=j}c.translate(y,v)}const x=this.geomUnitsPerPoint();x!==1&&c.scale(x,x);const I=i.getAngle();I&&c.rotate(I),c.translate(i.tx,i.ty),this.push(c,!1),this.drawImage(e,n),this.pop()}drawVectorMarker(e,i){if(!e)return;const r=e.markerGraphics;if(!r)return;const n=e.size??10,s=e.frame,o=s?s.ymax-s.ymin:0,a=n&&o?n/o:1,l=b6.createIdentity();s&&l.translate(.5*-(s.xmax+s.xmin),.5*-(s.ymax+s.ymin));const c=e.anchorPoint;if(c){let I=c.x,P=c.y;e.anchorPointUnits!=="Absolute"?s&&(I*=s.xmax-s.xmin,P*=s.ymax-s.ymin):(I/=a,P/=a),l.translate(-I,-P)}a!==1&&l.scale(a,a);let h=e.rotation??0;e.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&l.rotate(h*_6);let p=e.offsetX??0,y=e.offsetY??0;if(p||y){if(this._mapRotation){const I=_6*this._mapRotation,P=Math.cos(I),F=Math.sin(I),k=p*F+y*P;p=p*P-y*F,y=k}l.translate(p,y)}const v=this.geomUnitsPerPoint();v!==1&&l.scale(v,v);const x=i.getAngle();x&&l.rotate(x),l.translate(i.tx,i.ty),this.push(l,e.scaleSymbolsProportionally);for(const I of r)if(I&&I.symbol&&I.geometry||pCt.error("Invalid marker graphic",I),this.drawSymbol(I.symbol,I.geometry,I.textString),this._earlyReturn)break;this.pop()}drawTextSymbol(e,i,r){if(!e||!qy(i)||(e.height??10)<=0)return;const n=b6.createIdentity();let s=e.angle??0;s=-s,s&&n.rotate(s*_6);const o=e.offsetX??0,a=e.offsetY??0;(o||a)&&n.translate(o,a);const l=this.geomUnitsPerPoint();l!==1&&n.scale(l,l),n.translate(i.x,i.y),this.push(n,!1),this.drawText(e,r),this.pop()}_buildHatchPolyline(e,i,r){let n=(e.separation!==void 0?e.separation:4)*r,s=e.rotation!==void 0?e.rotation:0;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=Mo();RC(l,i),l[0]-=a,l[1]-=a,l[2]+=a,l[3]+=a;const c=[[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 h=Math.cos(s*_6),p=Math.sin(s*_6),y=-n*p,v=n*h;let x,I,P,F;o=(e.offsetX!==void 0?e.offsetX*r:0)*p-(e.offsetY!==void 0?e.offsetY*r:0)*h,x=P=Number.MAX_VALUE,I=F=-Number.MAX_VALUE;for(const ie of c){const ce=ie[0],he=ie[1],_e=h*ce+p*he,xe=-p*ce+h*he;x=Math.min(x,_e),P=Math.min(P,xe),I=Math.max(I,_e),F=Math.max(F,xe)}P=Math.floor(P/n)*n;let k=h*x-p*P-y*o/n,j=p*x+h*P-v*o/n,V=h*I-p*P-y*o/n,Y=p*I+h*P-v*o/n;const X=1+Math.round((F-P)/n),Z=[];for(let ie=0;ie0))if(Xa(e))this._processPath(e.rings,0);else if(Hu(e))this._processPath(e.paths,0);else if(mc(e)){const i=w6(e);i&&this._processPath(i.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(e,i,r){if(!e||this._clipCount>0)return;const n=.5*this.transformSize(r??0);if(Xa(e))this._processPath(e.rings,n);else if(Hu(e))this._processPath(e.paths,n);else if(mc(e)){const s=w6(e);s&&this._processPath(s.rings,n)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(e,i){Xa(i)&&e.markerPlacement&&(e.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||e.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&e.markerPlacement.clipAtBoundary)?this._processPath(i.rings,0):super.drawMarkerLayer(e,i)}drawHatchFill(e,i){this.drawSolidFill(e)}drawPictureFill(e,i){this.drawSolidFill(e)}drawGradientFill(e,i){this.drawSolidFill(e)}drawPictureStroke(e,i){this.drawSolidStroke(e,null,i.width)}drawGradientStroke(e,i){this.drawSolidStroke(e,null,i.width)}pushClipPath(e){this.drawSolidFill(e),this._clipCount++}popClipPath(){this._clipCount--}drawImage(e,i){const{url:r}=e,n=e.scaleX??1;let s=n*i,o=i;const a=this._resourceManager.getResource(r);!i&&ve(a)&&(s=n*a.width,o=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,i){if(!i||i.length===0)return;this._textRasterizer||(this._textRasterizer=new sCt);const r=yCt(e),[n,s]=this._textRasterizer.computeTextSize(i,r);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,i){if(e)for(const r of e){const n=r?r.length:0;if(n>1){this._merge(this.transformPt(r[0]),i);for(let s=1;sthis._xmax&&(this._xmax=e[0]+i),e[1]-ithis._ymax&&(this._ymax=e[1]+i)}},JYi=class extends t5e{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null}hitTest(e,i,r,n,s,o){const a=o*vn(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=i&&(i.type==="CIMPointSymbol"&&i.angleAlignment!=="Map"||i.type==="CIMTextSymbol");return this._mapRotation=l?s:0,this._earlyReturn=!1,this.drawSymbol(i,r),this._earlyReturn}drawSolidFill(e,i){this._hitTestFill(e)}drawHatchFill(e,i){this._hitTestFill(e)}drawPictureFill(e,i){this._hitTestFill(e)}drawGradientFill(e,i){this._hitTestFill(e)}drawSolidStroke(e,i,r,n,s,o){this._hitTestStroke(e,r)}drawPictureStroke(e,i){this._hitTestStroke(e,i.width)}drawGradientStroke(e,i){this._hitTestStroke(e,i.width)}drawMarkerLayer(e,i){e.markerPlacement&&(e.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||e.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&e.markerPlacement.clipAtBoundary)?this._hitTestFill(i):super.drawMarkerLayer(e,i)}pushClipPath(e){}popClipPath(){}drawImage(e,i){const{url:r}=e,n=e.scaleX??1,s=this._resourceManager.getResource(r);if(lt(s)||s.height===0||i===0)return;const o=i*this.geomUnitsPerPoint(),a=o*n*(s.width/s.height),l=this.reverseTransformPt(this._searchPoint),c=this._searchDistPoint;Math.abs(l[0])k.xTopLeft&&P-k.yBottomRight&&F<-k.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(e){let i=null;if(mc(e)){const n=e;i=[[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]]]}else if(Xa(e))i=e.rings;else{if(!Hu(e))return;i=e.paths}const r=this.reverseTransformPt(this._searchPoint);if(this._pointInPolygon(r,i)&&(this._earlyReturn=!0),!this._earlyReturn){const n=this.reverseTransformSize(this._searchDistPoint)*this.geomUnitsPerPoint();this._nearLine(r,i,n)&&(this._earlyReturn=!0)}}_hitTestStroke(e,i){let r=null;if(mc(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(Xa(e))r=e.rings;else{if(!Hu(e))return;r=e.paths}const n=this.reverseTransformPt(this._searchPoint),s=(i??0)*this.geomUnitsPerPoint(),o=this.reverseTransformSize(this._searchDistPoint)*this.geomUnitsPerPoint();this._nearLine(n,r,s/2+o)&&(this._earlyReturn=!0)}_pointInPolygon(e,i){let r=0;for(const n of i){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,i,r){for(const n of i){const s=n.length;for(let o=1;o-r&&p1){let o=this.transformPt(n[0]);r.moveTo(o[0],o[1]);for(let a=1;at?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,fCt=t=>{switch(t){case"Left":return Fd.Left;case"Right":return Fd.Right;case"Center":return Fd.Center;case"Justify":return pCt.warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."),Fd.Center}},mCt=t=>{switch(t){case"Top":return Ld.Top;case"Center":return Ld.Center;case"Bottom":return Ld.Bottom;case"Baseline":return Ld.Baseline}},gCt=(t,e,i)=>{switch(t){case"ExtraLeading":return 1+e/i;case"Multiple":return e;case"Exact":return e/i}};function yCt(t,e=1){const i=cKe(t),r=uKe(t.fontStyleName),n=jLe(t.fontFamilyName),{weight:s,style:o}=r,a=e*(t.height||5),l=hKe(t.horizontalAlignment),c=dKe(t.verticalAlignment),h=B5(t),p=V5(t.haloSymbol),y=p?e*(0|t.haloSize):0;return{color:h,size:a,horizontalAlignment:l,verticalAlignment:c,font:{family:n,style:dXt(o),weight:pXt(s),decoration:i},halo:{size:y||0,color:p,style:o},pixelRatio:1,premultiplyColors:!0}}const eXi=1e-4;function tXi(t){let e,i,r,n,s,o=t[0],a=1;for(;aGRi(r,e,i,n,s);case"esriGeometryPolygon":return(i,r,n,s)=>URi(r,e,i,n,s);case"esriGeometryPolyline":return(i,r,n,s)=>zRi(r,e,i,n,s);case"esriGeometryMultipoint":return(i,r,n,s)=>jRi(r,e,i,n,s);default:return Oi.getLogger("esri.views.2d.support.arcadeOnDemand").error(new st("mapview-arcade",`Unable to handle geometryType: ${t}`)),i=>i}}const vCt=Math.PI,nXi=vCt/2,sXi=4,_Ct=4,oXi=10,RE=96/72,bCt=Math.PI/180,r5e=Oi.getLogger("esri.symbols.cim.CIMSymbolHelper");function aXi(t){if(!t||!t.type)return null;let e;switch(t.type){case"cim":return t.data;case"web-style":return t;case"simple-marker":{const i=Cb.fromSimpleMarker(t);if(!i)return null;e=i;break}case"picture-marker":e=Cb.fromPictureMarker(t);break;case"simple-line":e=Cb.fromSimpleLineSymbol(t);break;case"simple-fill":e=Cb.fromSimpleFillSymbol(t);break;case"picture-fill":e=Cb.fromPictureFillSymbol(t);break;case"text":e=Cb.fromTextSymbol(t)}return{type:"CIMSymbolReference",symbol:e}}function xme(t,e,i){switch(e.type){case"CIMSymbolReference":return xme(t,e.symbol,i);case"CIMPointSymbol":i==null&&(i={x:0,y:0}),t.drawSymbol(e,i);break;case"CIMLineSymbol":i==null&&(i={paths:[[[0,0],[10,0]]]}),t.drawSymbol(e,i);break;case"CIMPolygonSymbol":i==null&&(i={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),t.drawSymbol(e,i);break;case"CIMTextSymbol":{const r={x:0,y:0};t.drawSymbol(e,r);break}case"CIMVectorMarker":{const r=new vU;t.drawMarker(e,r);break}}return t.envelope()}function lXi(t){if(!t)return 0;switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(t.offset);default:return 0}}function uXi(t){if(!t)return 0;switch(t.type){case"CIMGeometricEffectArrow":return Math.abs(.5*t.width);case"CIMGeometricEffectBuffer":return Math.abs(t.size);case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(t.length);case"CIMGeometricEffectJog":return Math.abs(.5*t.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(Do(t.offsetX)),Math.abs(Do(t.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(t.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(t.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return .5*Math.max(Math.abs(t.fromWidth),Math.abs(t.toWidth));case"CIMGeometricEffectWave":return Math.abs(t.amplitude)}}function wCt(t){if(!t)return 0;let e=0;for(const i of t)e+=uXi(i);return e}let xCt=class{getSymbolInflateSize(e,i,r,n,s){return e||(e=[0,0,0,0]),i?this._getInflateSize(e,i,r,n,s):e}static safeSize(e){const i=Math.max(Math.abs(e[0]),Math.abs(e[2])),r=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(i*i+r*r)}_vectorMarkerBounds(e,i,r,n){let s=!0;const o=Mo();if(i&&i.markerGraphics)for(const a of i.markerGraphics){const l=[0,0,0,0];a.geometry&&(RC(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}_getInflateSize(e,i,r,n,s){if(mXi(i)){const o=this._getLayersInflateSize(e,i.symbolLayers,r,n,s),a=wCt(i.effects);return a>0&&(o[0]-=a,o[1]-=a,o[2]+=a,o[3]+=a),o}return this._getTextInflatedSize(e,i,s)}_getLayersInflateSize(e,i,r,n,s){let o=!0;if(!i)return e;for(const a of i){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 h=a;let p=h.width;p!=null&&(h.capStyle===dS.Square||h.joinStyle===pS.Miter?p/=1.4142135623730951:p/=2,l[0]=-p,l[1]=-p,l[2]=p,l[3]=p);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const h=a;if(a.type==="CIMVectorMarker"){const I=a;if(l=this._vectorMarkerBounds(l,I,r,s),I.frame){const P=(I.frame.xmin+I.frame.xmax)/2,F=(I.frame.ymin+I.frame.ymax)/2;if(l[0]-=P,l[1]-=F,l[2]-=P,l[3]-=F,I.size!=null){const k=I.size/(I.frame.ymax-I.frame.ymin);l[0]*=k,l[1]*=k,l[2]*=k,l[3]*=k}}}else if(a.type==="CIMPictureMarker"){const I=a,P=r.getResource(I.url);let F=1;if(ve(P)&&P.height&&(F=P.width/P.height),h.size!=null){const k=h.size/2,j=h.size*F*I.scaleX/2;l=[-j,-k,j,k]}}else if(h.size!=null){const I=h.size/2;l=[-I,-I,I,I]}if(h.anchorPoint){let I,P;h.anchorPointUnits==="Absolute"?(I=h.anchorPoint.x,P=h.anchorPoint.y):(I=h.anchorPoint.x*(l[2]-l[0]),P=h.anchorPoint.y*(l[3]-l[1])),l[0]-=I,l[1]-=P,l[2]-=I,l[3]-=P}let p=Do(h.rotation);if(h.rotateClockwise&&(p=-p),n&&(p-=n),p){const I=bCt*p,P=Math.cos(I),F=Math.sin(I),k=Mo([yE,yE,-yE,-yE]);Qne(k,[l[0]*P-l[1]*F,l[0]*F+l[1]*P]),Qne(k,[l[0]*P-l[3]*F,l[0]*F+l[3]*P]),Qne(k,[l[2]*P-l[1]*F,l[2]*F+l[1]*P]),Qne(k,[l[2]*P-l[3]*F,l[2]*F+l[3]*P]),l=k}let y=Do(h.offsetX),v=Do(h.offsetY);if(n){const I=bCt*n,P=Math.cos(I),F=Math.sin(I),k=y*F+v*P;y=y*P-v*F,v=k}l[0]+=y,l[1]+=v,l[2]+=y,l[3]+=v;const x=lXi(h.markerPlacement);x>0&&(l[0]-=x,l[1]-=x,l[2]+=x,l[3]+=x);break}}const c=wCt(a.effects);c>0&&(l[0]-=c,l[1]-=c,l[2]+=c,l[3]+=c),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}_getTextInflatedSize(e,i,r){const n=i.height??oXi;if(e[0]=-n/2,e[1]=-n/2,e[2]=n/2,e[3]=n/2,!r)return e;const s=r.get(i);if(!s)return e;const{text:o,mosaicItem:a}=s;if(!a?.glyphMosaicItems?.length)return e;const{lineGapType:l,lineGap:c}=i,h=l?gCt(l,c??0,n):0,p=_F(o)[1],y=a.glyphMosaicItems,v=i.callout?.type==="CIMBackgroundCallout",x=e5e(y,p,{scale:n/Bpe,angle:Do(i.angle),xOffset:Do(i.offsetX),yOffset:Do(i.offsetY),hAlign:fCt(i.horizontalAlignment),vAlign:mCt(i.verticalAlignment),maxLineWidth:512,lineHeight:hFe*Math.max(.25,Math.min(h||1,4)),decoration:i.font.decoration||"none",isCIM:!0,hasBackground:v}).boundsT;return e[0]=x.x-x.halfWidth,e[1]=-x.y-x.halfHeight,e[2]=x.x+x.halfWidth,e[3]=-x.y+x.halfHeight,e}},Cb=class FBe{static getEnvelope(e,i,r){if(!e)return null;const n=new KYi(r);if(Array.isArray(e)){let s;for(const o of e)s?s.union(xme(n,o,i)):s=xme(n,o,i);return s}return xme(n,e,i)}static getTextureAnchor(e,i){const r=this.getEnvelope(e,null,i);if(!r)return[0,0,0];const n=(r.x+.5*r.width)*RE,s=(r.y+.5*r.height)*RE,o=r.width*RE+2,a=r.height*RE+2;return[-n/o,-s/a,a]}static rasterize(e,i,r,n,s=!0){const o=r||this.getEnvelope(i,null,n);if(!o)return[null,0,0,0,0];const a=(o.x+.5*o.width)*RE,l=(o.y+.5*o.height)*RE;e.width=o.width*RE,e.height=o.height*RE,r||(e.width+=2,e.height+=2);const c=e.getContext("2d"),h=b6.createScale(RE,-RE);h.translate(.5*e.width-a,.5*e.height+l);const p=new ZYi(c,n,h);switch(i.type){case"CIMPointSymbol":{const x={type:"point",x:0,y:0};p.drawSymbol(i,x);break}case"CIMVectorMarker":{const x=new vU;p.drawMarker(i,x);break}}const y=c.getImageData(0,0,e.width,e.height),v=new Uint8Array(y.data);if(s){let x;for(let I=0;I.667?vn(Math.round(Ky(p.width))):p.width,color:H_(p.color)})}else!i||e.type!=="line-marker"||e.style!=="cross"&&e.style!=="x"||c.push({type:"CIMSolidStroke",enable:!0,width:i,color:H_(s)});c.push({type:"CIMSolidFill",enable:!0,color:H_(s)});const h={type:"CIMPolygonSymbol",symbolLayers:c};l={type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:Do(-e.angle),size:Do(e.size||6*i),offsetX:Do(e.xoffset),offsetY:Do(e.yoffset),frame:o,markerGraphics:[{type:"CIMMarkerGraphic",geometry:a,symbol:h}]}]}}return l}static fromCIMHatchFill(e,i){const r=i*(e.separation??sXi),n=r/2,s=gi(e.lineSymbol);s.symbolLayers?.forEach(l=>{switch(l.type){case"CIMSolidStroke":l.width!=null&&(l.width*=i),l.effects?.forEach(c=>{c.type==="CIMGeometricEffectDashes"&&(c.dashTemplate=c.dashTemplate.map(h=>h*i))});break;case"CIMVectorMarker":{l.size!=null&&(l.size*=i);const c=l.markerPlacement;c!=null&&"placementTemplate"in c&&(c.placementTemplate=c.placementTemplate.map(h=>h*i));break}}});let o=this._getLineSymbolPeriod(s)||_Ct;for(;o<_Ct;)o*=2;const a=o/2;return{type:"CIMVectorMarker",frame:{xmin:-a,xmax:a,ymin:-n,ymax:n},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[-a,0],[a,0]]]},symbol:s}],size:r}}static fetchResources(e,i,r){if(e&&i)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const n=e.symbolLayers;if(!n)return;for(const s of n)switch(vXi(s,i,r),s.type){case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMCharacterMarker":case"CIMPictureMarker":"url"in s&&s.url&&r.push(i.fetchResource(s.url,null));break;case"CIMVectorMarker":{const o=s.markerGraphics;if(!o)continue;for(const a of o)if(a){const l=a.symbol;l&&FBe.fetchResources(l,i,r)}}}}}}static _getLineSymbolPeriod(e){if(e){const i=this._getEffectsRepeat(e.effects);if(i)return i;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 i of e)if(i)switch(i.type){case"CIMGeometricEffectDashes":{const r=i.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 i.period;default:r5e.error(`unsupported geometric effect type ${i.type}`)}}return 0}static _getPlacementRepeat(e){if(e)switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const i=e.placementTemplate;if(i&&i.length){let r=0;for(const n of i)r+=+n;return 1&i.length&&(r*=2),r}break}}return 0}static fromCIMInsidePolygon(e){const i=e.markerPlacement,r={...e};r.markerPlacement=null,r.anchorPoint=null;const n=Math.abs(i.stepX),s=Math.abs(i.stepY),o=(i.randomness??100)/100;let a,l,c,h;if(i.gridType==="Random"){const p=Ky(fvt),y=Math.max(Math.floor(p/n),1),v=Math.max(Math.floor(p/s),1);a=y*n/2,l=v*s/2,c=2*l;const x=new vC(i.seed),I=o*n/1.5,P=o*s/1.5;h=[];for(let F=0;F({type:"CIMMarkerGraphic",geometry:p,symbol:{type:"CIMPointSymbol",symbolLayers:[r]}})),size:c}}static getSize(e){if(e)switch(e.type){case"CIMTextSymbol":return e.height;case"CIMPointSymbol":{let i=0;if(e.symbolLayers){for(const r of e.symbolLayers)if(r)switch(r.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const n=r.size;n!=null&&n>i&&(i=n);break}}}return i}case"CIMLineSymbol":case"CIMPolygonSymbol":{let i=0;if(e.symbolLayers){for(const r of e.symbolLayers)if(r)switch(r.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const n=r.width;n!=null&&n>i&&(i=n);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(r.markerPlacement&&uXt(r.markerPlacement)){const n=r.size;n!=null&&n>i&&(i=n)}}}return i}}}static getMarkerScaleRatio(e){if(e&&e.type==="CIMVectorMarker"&&e.scaleSymbolsProportionally!==!1&&e.frame&&e.size!=null){const i=e.frame.ymax-e.frame.ymin;return e.size/i}return 1}},S6=class Lf{static findApplicableOverrides(e,i,r){if(e&&i){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 i)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)Lf.findApplicableOverrides(n,i,r);if(e.symbolLayers)for(const n of e.symbolLayers)Lf.findApplicableOverrides(n,i,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)Lf.findApplicableOverrides(n,i,r);if(e.markerPlacement&&Lf.findApplicableOverrides(e.markerPlacement,i,r),e.type==="CIMVectorMarker"){if(e.markerGraphics)for(const n of e.markerGraphics)Lf.findApplicableOverrides(n,i,r),Lf.findApplicableOverrides(n.symbol,i,r)}else e.type==="CIMCharacterMarker"?Lf.findApplicableOverrides(e.symbol,i,r):e.type==="CIMHatchFill"?Lf.findApplicableOverrides(e.lineSymbol,i,r):e.type==="CIMPictureMarker"&&Lf.findApplicableOverrides(e.animatedSymbolProperties,i,r)}}}static findEffectOverrides(e,i,r){if(!i||!e)return;const n=e.length;for(let s=0;s!y.valueExpressionInfo?.expression.includes("$feature"))),a||(c=c.filter(y=>!y.valueExpressionInfo?.expression.includes("$view"))),c.length>0){const y=fXt(i.attributes);await Lf.evaluateOverrides(c,i,{spatialReference:r,fields:y,geometryType:s},o,a)}Lf.applyOverrides(l,c)}return n&&Lf.applyDictionaryTextOverrides(l,i,n),l}static async evaluateOverrides(e,i,r,n,s){if(!i)return;let o;for(const a of e){const l=a.valueExpressionInfo;if(l&&r&&r.geometryType){o||(o=[]),a.value=void 0;const c=Ane(l.expression,r.spatialReference,r.fields).then(h=>{a.value=x6(h,i,{$view:s},r.geometryType,n)});o.push(c)}}o!==void 0&&o.length>0&&await Promise.all(o)}static applyDictionaryTextOverrides(e,i,r,n="Normal"){if(e&&e.type)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const s=e.symbolLayers;if(!s)return;for(const o of s)o&&o.type==="CIMVectorMarker"&&Lf.applyDictionaryTextOverrides(o,i,r,e.type==="CIMTextSymbol"?e.textCase:n)}break;case"CIMVectorMarker":{const s=e.markerGraphics;if(!s)return;for(const o of s)o&&Lf.applyDictionaryTextOverrides(o,i,r)}break;case"CIMMarkerGraphic":{const s=e.textString;if(s&&s.includes("[")){const o=oKe(s,r);e.textString=aKe(i,o,n)}}}}static applyOverrides(e,i,r,n){if(e.primitiveName){for(const s of i)if(s.primitiveName===e.primitiveName){const o=yXi(s.propertyName);if(n&&n.push({cim:e,nocapPropertyName:o,value:e[o]}),s.expression&&(s.value=Lf.toValue(s.propertyName,s.expression)),r){let a=!1;for(const l of r)l.primitiveName===e.primitiveName&&(a=!0);a||r.push(s)}ve(s.value)&&(e[o]=s.value)}}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const s of e.effects)Lf.applyOverrides(s,i,r,n);if(e.symbolLayers)for(const s of e.symbolLayers)Lf.applyOverrides(s,i,r,n);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(e.effects)for(const s of e.effects)Lf.applyOverrides(s,i,r,n);if(e.type==="CIMVectorMarker"&&e.markerGraphics)for(const s of e.markerGraphics)Lf.applyOverrides(s,i,r,n),Lf.applyOverrides(s.symbol,i,r,n)}}static restoreOverrides(e){for(const i of e)i.cim[i.nocapPropertyName]=i.value}static buildOverrideKey(e){let i="";for(const r of e)r.value!==void 0&&(i+=`${r.primitiveName}${r.propertyName}${JSON.stringify(r.value)}`);return i}static toValue(e,i){if(e==="DashTemplate")return i.split(" ").map(r=>Number(r));if(e==="Color"){const r=new en(i).toRgba();return r[3]*=255,r}return i}};const n5e=t=>{if(!t)return dS.Butt;switch(t){case"butt":return dS.Butt;case"square":return dS.Square;case"round":return dS.Round}},s5e=t=>{if(!t)return pS.Miter;switch(t){case"miter":return pS.Miter;case"round":return pS.Round;case"bevel":return pS.Bevel}},cXi=t=>{if(lt(t))return"Center";switch(t){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},hXi=t=>{if(lt(t))return"Center";switch(t){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},H_=t=>{if(!t)return[0,0,0,0];const{r:e,g:i,b:r,a:n}=t;return[e,i,r,255*n]},dXi=(t,e)=>{const i=pXi(e),r=fXi(t);return i&&r?`${i}-${r}`:`${i}${r}`},pXi=t=>{if(!t)return"";switch(t.toLowerCase()){case"bold":case"bolder":return"bold"}return""},fXi=t=>{if(!t)return"";switch(t.toLowerCase()){case"italic":case"oblique":return"italic"}return""},o5e=(t,e)=>{const i=e==="butt";switch(t){case"dash":case"esriSLSDash":return i?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return i?[4,3,1,3]:[3,4,0,4];case"dot":case"esriSLSDot":return i?[1,3]:[0,4];case"long-dash":case"esriSLSLongDash":return i?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return i?[8,3,1,3]:[7,4,0,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return i?[8,3,1,3,1,3]:[7,4,0,4,0,4];case"short-dash":case"esriSLSShortDash":return i?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return i?[4,1,1,1]:[3,2,0,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return i?[4,1,1,1,1,1]:[3,2,0,2,0,2];case"short-dot":case"esriSLSShortDot":return i?[1,1]:[0,2];case"solid":case"esriSLSSolid":case"none":return r5e.error("Unexpected: style does not require rasterization"),[0,0];default:return r5e.error(`Tried to rasterize SLS, but found an unexpected style: ${t}!`),[0,0]}};function mXi(t){return t.symbolLayers!==void 0}const SCt=t=>{let r,n;const s=t;if(s==="circle"||s==="esriSMSCircle"){let a=Math.acos(.995),l=Math.ceil(vCt/a/4);l===0&&(l=1),a=nXi/l,l*=4;const c=[];c.push([50,0]);for(let h=1;ht==="vertical"||t==="horizontal"||t==="cross"||t==="esriSFSCross"||t==="esriSFSVertical"||t==="esriSFSHorizontal",yXi=t=>t&&t.charAt(0).toLowerCase()+t.substr(1);function vXi(t,e,i){if(!(!t.effects||ve(e.geometryEngine))){if(e.geometryEnginePromise)return void i.push(e.geometryEnginePromise);cXt(t.effects)&&(e.geometryEnginePromise=hXt(),i.push(e.geometryEnginePromise),e.geometryEnginePromise.then(r=>e.geometryEngine=r))}}const CCt=.05;function _Xi(t){return Math.max(Math.round(t/CCt),1)*CCt}const bXi=new Set(["StartTimeOffset","Duration","RepeatDelay"]);function wXi(t,e){return bXi.has(e)?_Xi(t):t}function a5e(t,e,i=0){const r=eu(t,0,CXi);for(let n=0;n<4;n++)e[i+n]=Math.floor(256*TXi(r*xXi[n]))}function TCt(t,e=0){let i=0;for(let r=0;r<4;r++)i+=t[e+r]*SXi[r];return i}const xXi=[1,256,65536,16777216],SXi=[1/256,1/65536,1/16777216,1/4294967296],CXi=TCt(new Uint8ClampedArray([255,255,255,255]));function TXi(t){return t-Math.floor(t)}function l5e(t){if(!t)return null;switch(t.type){case"CIMPointSymbol":{const e=t.symbolLayers;return e&&e.length===1?l5e(e[0]):null}case"CIMVectorMarker":{const e=t.markerGraphics;if(!e||e.length!==1)return null;const i=e[0];if(!i)return null;const r=i.geometry;if(!r)return null;const n=i.symbol;return!n||n.type!=="CIMPolygonSymbol"&&n.type!=="CIMLineSymbol"||n.symbolLayers?.some(s=>!!s.effects)?null:{geom:r,asFill:n.type==="CIMPolygonSymbol"}}case"sdf":return{geom:t.geom,asFill:t.asFill}}return null}function EXi(t){return t?t.rings?t.rings:t.paths?t.paths:t.xmin!==void 0&&t.ymin!==void 0&&t.xmax!==void 0&&t.ymax!==void 0?[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]:null:null}function IXi(t){let e=1/0,i=-1/0,r=1/0,n=-1/0;for(const s of t)for(const o of s)o[0]i&&(i=o[0]),o[1]n&&(n=o[1]);return new bme(e,r,i-e,n-r)}function ECt(t){let e=1/0,i=-1/0,r=1/0,n=-1/0;for(const s of t)for(const o of s)o[0]i&&(i=o[0]),o[1]n&&(n=o[1]);return[e,r,i,n]}function ICt(t){return t?t.rings?ECt(t.rings):t.paths?ECt(t.paths):mc(t)?[t.xmin,t.ymin,t.xmax,t.ymax]:null:null}function ACt(t,e,i,r,n){const[s,o,a,l]=t;if(a0&&(V=(e.xmax-e.xmin)/(e.ymax-e.ymin),k=r.x/(i*V),j=r.y/i):(k=r.x,j=r.y)),e&&(k=.5*(e.xmax+e.xmin)+k*(e.xmax-e.xmin),j=.5*(e.ymax+e.ymin)+j*(e.ymax-e.ymin)),k-=s,j-=o,k*=x,j*=x,k+=v,j+=v;let Y=k/I-.5,X=j/P-.5;return n&&i&&(Y*=i*V,X*=i),[F,Y,X]}function AXi(t){const e=EXi(t.geom),i=IXi(e),r=128,n=1,s=Math.floor(.5*(.5*r-n)),o=(r-2*(s+n))/Math.max(i.width,i.height),a=Math.round(i.width*o)+2*s,l=Math.round(i.height*o)+2*s,c=[];for(const p of e)if(p&&p.length>1){const y=[];for(const v of p){let[x,I]=v;x-=i.x,I-=i.y,x*=o,I*=o,x+=s-.5,I+=s-.5,t.asFill?y.push([x,I]):y.push([Math.round(x),Math.round(I)])}if(t.asFill){const v=y.length-1;y[0][0]===y[v][0]&&y[0][1]===y[v][1]||y.push(y[0])}c.push(y)}const h=PXi(c,a,l,s);return t.asFill&&OXi(c,a,l,s,h),[RXi(h,s),a,l]}function PXi(t,e,i,r){const n=e*i,s=new Array(n),o=r*r+1;for(let a=0;ae&&(F=e),k<0&&(k=0),j>i&&(j=i);const V=p[0]-h[0],Y=p[1]-h[1],X=V*V+Y*Y;for(let Z=P;ZX?(ce=p[0],he=p[1]):(_e/=X,ce=h[0]+_e*V,he=h[1]+_e*Y);const xe=(Z-ce)*(Z-ce)+(ie-he)*(ie-he),Pe=(i-ie-1)*e+Z;xee-r&&(I=e-r),Pi-r&&(F=i-r);for(let k=P;kk==c[1]>k)continue;const j=(i-k-1)*e;for(let V=x;V>8^i)+r|0;while(--r!=0)}return(1+i/-2147483648)/2}function OCt(t){return Math.floor(PCt(t,DXi)*FXi)}const DXi=53290320,FXi=10,RCt=Oi.getLogger("esri.symbols.cim.cimAnalyzer");function u5e(t){switch(t){case"Butt":return xf.BUTT;case"Square":return xf.SQUARE;default:return xf.ROUND}}function c5e(t){switch(t){case"Bevel":return sm.BEVEL;case"Miter":return sm.MITER;default:return sm.ROUND}}function MCt(t,e,i,r){let n;t[e]?n=t[e]:(n={},t[e]=n),n[i]=r}function DCt(t){const e=t.markerPlacement;return e&&e.angleToLine?py.MAP:py.SCREEN}async function LXi(t,e,i,r,n){const s=r??[];if(!t)return s;let o,a;const l={};if(t.type!=="CIMSymbolReference")return RCt.error("Expect cim type to be 'CIMSymbolReference'"),s;if(o=t.symbol,a=t.primitiveOverrides,a){const h=[];for(const p of a){const y=p.valueExpressionInfo;if(y&&e){const v=y.expression,x=Ane(v,e.spatialReference,e.fields).then(I=>{lt(I)||MCt(l,p.primitiveName,p.propertyName,I)});h.push(x)}else p.value!=null&&MCt(l,p.primitiveName,p.propertyName,p.value)}h.length>0&&await Promise.all(h)}const c=[];switch(Cb.fetchResources(o,i,c),c.length>0&&await Promise.all(c),o?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":NXi(o,a,l,e,s,i,!!n)}return s}function NXi(t,e,i,r,n,s,o){if(!t)return;const a=t.symbolLayers;if(!a)return;const l=t.effects;let c=py.SCREEN;const h=Cb.getSize(t)??0;t.type==="CIMPointSymbol"&&t.angleAlignment==="Map"&&(c=py.MAP);let p=a.length;for(;p--;){const y=a[p];if(!y||y.enable===!1)continue;let v;l&&l.length&&(v=[...l]);const x=y.effects;x&&x.length&&(l?v.push(...x):v=[...x]);const I=[];let P;S6.findEffectOverrides(v,e,I),P=I.length>0?KXi(v,I,i,r):v;const F=[];switch(S6.findApplicableOverrides(y,e,F),y.type){case"CIMSolidFill":kXi(y,P,i,F,r,n);break;case"CIMPictureFill":$Xi(y,P,i,F,r,s,n);break;case"CIMHatchFill":BXi(y,P,i,F,r,n);break;case"CIMGradientFill":VXi(y,P,i,F,r,n);break;case"CIMSolidStroke":jXi(y,P,i,F,r,n,t.type==="CIMPolygonSymbol",h);break;case"CIMPictureStroke":GXi(y,P,i,F,r,n,t.type==="CIMPolygonSymbol",h);break;case"CIMGradientStroke":UXi(y,P,i,F,r,n,t.type==="CIMPolygonSymbol",h);break;case"CIMCharacterMarker":if(h5e(y,P,i,F,r,n))break;break;case"CIMPictureMarker":if(h5e(y,P,i,F,r,n))break;t.type==="CIMLineSymbol"&&(c=DCt(y)),zXi(y,P,i,F,r,s,n,c,h);break;case"CIMVectorMarker":if(h5e(y,P,i,F,r,n))break;t.type==="CIMLineSymbol"&&(c=DCt(y)),HXi(y,P,i,F,r,n,s,c,h,o);break;default:RCt.error("Cannot analyze CIM layer",y.type)}}}function kXi(t,e,i,r,n,s){const o=t.primitiveName,a=W1(t.color),[l,c]=ux(r,o,e,null,null),h=zc(JSON.stringify(t)+c).toString();s.push({type:"fill",templateHash:h,materialHash:l?()=>h:h,cim:t,materialOverrides:null,colorLocked:!!t.colorLocked,color:oo(o,i,"Color",n,a,wS),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:e,applyRandomOffset:!1,sampleAlphaOnly:!0})}function $Xi(t,e,i,r,n,s,o){const a=t.primitiveName,l=uae(t),[c,h]=ux(r,a,e,null,null),p=zc(JSON.stringify(t)+h).toString(),y=zc(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString();let v=Do(t.scaleX);if("width"in t&&typeof t.width=="number"){const x=t.width;let I=1;const P=s.getResource(t.url);ve(P)&&(I=P.width/P.height),v/=I*(t.height/x)}o.push({type:"fill",templateHash:p,materialHash:c?()=>y:y,cim:t,materialOverrides:null,colorLocked:!!t.colorLocked,effects:e,color:oo(a,i,"TintColor",n,l,wS),height:oo(a,i,"Height",n,t.height),scaleX:oo(a,i,"ScaleX",n,v),angle:oo(a,i,"Rotation",n,Do(t.rotation)),offsetX:oo(a,i,"OffsetX",n,Do(t.offsetX)),offsetY:oo(a,i,"OffsetY",n,Do(t.offsetY)),url:t.url,applyRandomOffset:!1,sampleAlphaOnly:!1})}function BXi(t,e,i,r,n,s){const o=["Rotation","OffsetX","OffsetY"],a=r.filter(P=>P.primitiveName!==t.primitiveName||!o.includes(P.propertyName)),l=t.primitiveName;let[c,h]=ux(r,l,e,null,null);const p=zc(JSON.stringify(t)+h).toString(),y=zc(`${t.separation}${JSON.stringify(t.lineSymbol)}`).toString();let v={r:255,g:255,b:255,a:1},x=!1;const I=t.lineSymbol?.symbolLayers?.find(P=>P.type==="CIMSolidStroke"&&i[P.primitiveName]?.Color!=null);if(I){v=W1(I.color),v=oo(I.primitiveName,i,"Color",n,v,wS);const P=typeof v=="function";c=c||P,x=I.color!=null||P}s.push({type:"fill",templateHash:p,materialHash:c?SQ(y,i,a,n):y,cim:t,materialOverrides:a,colorLocked:!!t.colorLocked,effects:e,color:v,height:oo(l,i,"Separation",n,t.separation),scaleX:1,angle:oo(l,i,"Rotation",n,Do(t.rotation)),offsetX:oo(l,i,"OffsetX",n,Do(t.offsetX)),offsetY:oo(l,i,"OffsetY",n,Do(t.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!x})}function VXi(t,e,i,r,n,s){const o=t.primitiveName,[a,l]=ux(r,o,e,null,null),c=zc(JSON.stringify(t)+l).toString();s.push({type:"fill",templateHash:c,materialHash:a?SQ(c,i,r,n):c,cim:t,materialOverrides:null,colorLocked:!!t.colorLocked,effects:e,color:{r:128,g:128,b:128,a:1},height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1})}function jXi(t,e,i,r,n,s,o,a){const l=t.primitiveName,c=W1(t.color),h=t.width!=null?t.width:4,p=u5e(t.capStyle),y=c5e(t.joinStyle),v=t.miterLimit,[x,I]=ux(r,l,e,null,null),P=zc(JSON.stringify(t)+I).toString();let F,k;if(e&&e instanceof Array&&e.length>0){const j=e[e.length-1];if(j.type==="CIMGeometricEffectDashes"&&j.lineDashEnding==="NoConstraint"&&j.offsetAlongLine===null){const V=(e=[...e]).pop();F=V.dashTemplate,k=V.scaleDash}}s.push({type:"line",templateHash:P,materialHash:x?()=>P:P,cim:t,materialOverrides:null,isOutline:o,colorLocked:!!t.colorLocked,effects:e,color:oo(l,i,"Color",n,c,wS),width:oo(l,i,"Width",n,h),cap:oo(l,i,"CapStyle",n,p),join:oo(l,i,"JoinStyle",n,y),miterLimit:v&&oo(l,i,"MiterLimit",n,v),referenceWidth:a,zOrder:d5e(t.name),dashTemplate:F,scaleDash:k,sampleAlphaOnly:!0})}function GXi(t,e,i,r,n,s,o,a){const l=zc(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString(),c=t.primitiveName,h=uae(t),p=t.width!=null?t.width:4,y=u5e(t.capStyle),v=c5e(t.joinStyle),x=t.miterLimit,[I,P]=ux(r,c,e,null,null),F=zc(JSON.stringify(t)+P).toString();s.push({type:"line",templateHash:F,materialHash:I?()=>l:l,cim:t,materialOverrides:null,isOutline:o,colorLocked:!!t.colorLocked,effects:e,color:oo(c,i,"TintColor",n,h,wS),width:oo(c,i,"Width",n,p),cap:oo(c,i,"CapStyle",n,y),join:oo(c,i,"JoinStyle",n,v),miterLimit:x&&oo(c,i,"MiterLimit",n,x),referenceWidth:a,zOrder:d5e(t.name),dashTemplate:null,scaleDash:!1,url:t.url,sampleAlphaOnly:!1})}function UXi(t,e,i,r,n,s,o,a){const l=t.primitiveName,c=t.width!=null?t.width:4,h=u5e(t.capStyle),p=c5e(t.joinStyle),y=t.miterLimit,[v,x]=ux(r,l,e,null,null),I=zc(JSON.stringify(t)+x).toString();s.push({type:"line",templateHash:I,materialHash:v?SQ(I,i,r,n):I,cim:t,materialOverrides:null,isOutline:o,colorLocked:!!t.colorLocked,effects:e,color:{r:128,g:128,b:128,a:1},width:oo(l,i,"Width",n,c),cap:oo(l,i,"CapStyle",n,h),join:oo(l,i,"JoinStyle",n,p),miterLimit:y&&oo(l,i,"MiterLimit",n,y),referenceWidth:a,zOrder:d5e(t.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}function h5e(t,e,i,r,n,s){const{markerPlacement:o,type:a}=t;if(!o||o.type!=="CIMMarkerPlacementInsidePolygon")return!1;if(a==="CIMVectorMarker"||a==="CIMPictureMarker"){const Y=t.primitiveName;if(Y){const[Z,ie]=ux(r,Y,e,null,null);if(Z)return!1}const X=o.primitiveName;if(X){const[Z,ie]=ux(r,X,e,null,null);if(Z)return!1}if(a==="CIMVectorMarker"){const{markerGraphics:Z}=t;if(Z)for(const ie of Z){const{symbol:ce}=ie;if(ce?.type==="CIMPolygonSymbol"&&ce.symbolLayers){const{symbolLayers:he}=ce;for(const _e of he)if(_e.type==="CIMSolidStroke")return!1}}}else{const{animatedSymbolProperties:Z}=t;if(Z)return!1}}const l=o,c=Math.abs(l.stepX),h=Math.abs(l.stepY);if(c===0||h===0)return!0;const p=["Rotation","OffsetX","OffsetY"],y=r.filter(Y=>Y.primitiveName!==t.primitiveName||!p.includes(Y.propertyName)),v="url"in t&&typeof t.url=="string"?t.url:void 0,[x,I]=ux(r,l.primitiveName,e,null,null),P=zc(JSON.stringify(t)+I).toString();let F,k,j=null;if(o.gridType==="Random"){const Y=Ky(fvt),X=Math.max(Math.floor(Y/c),1),Z=Math.max(Math.floor(Y/h),1);F=h*Z,j=ie=>ie?ie*Z:0,k=X*c/F}else o.shiftOddRows?(F=2*h,j=Y=>Y?2*Y:0,k=c/h*.5):(F=h,j=null,k=c/h);const V=uae(t);return s.push({type:"fill",templateHash:P,materialHash:x?SQ(P,i,y,n):P,cim:t,materialOverrides:y,colorLocked:!!t.colorLocked,effects:e,color:oo(l.primitiveName,i,"TintColor",n,V,wS),height:oo(l.primitiveName,i,"StepY",n,F,j),scaleX:k,angle:oo(l.primitiveName,i,"GridAngle",n,l.gridAngle),offsetX:oo(l.primitiveName,i,"OffsetX",n,Do(l.offsetX)),offsetY:oo(l.primitiveName,i,"OffsetY",n,Do(l.offsetY)),url:v,applyRandomOffset:o.gridType==="Random",sampleAlphaOnly:!v,hasUnresolvedReplacementColor:!0}),!0}function zXi(t,e,i,r,n,s,o,a,l){const c=t.primitiveName,h=Do(t.size);let p=Do(t.scaleX,1);const y=Do(t.rotation),v=Do(t.offsetX),x=Do(t.offsetY),I=uae(t),P=zc(`${t.url}${JSON.stringify(t.colorSubstitutions)}${JSON.stringify(t.animatedSymbolProperties)}`).toString(),F=LCt(t.markerPlacement,r,i,n),k=JXi(t.animatedSymbolProperties,r,i,n),[j,V]=ux(r,c,e,F,k),Y=zc(JSON.stringify(t)+V).toString(),X=t.anchorPoint??{x:0,y:0};if("width"in t&&typeof t.width=="number"){const ce=t.width;let he=1;const _e=s.getResource(t.url);ve(_e)&&(he=_e.width/_e.height),p/=he*(h/ce)}function Z(ce,he){return ve(k)?gB(k,ce,he):null}const ie=t.animatedSymbolProperties&&t.animatedSymbolProperties.randomizeStartTime===!0?(ce,he,_e,xe)=>{const Pe=OCt(xe??0),ke=Z(ce,he);return P+`-MATERIALGROUP(${Pe})-ASP(${JSON.stringify(ke)})`}:j?(ce,he)=>{const _e=Z(ce,he);return P+`-ASP(${JSON.stringify(_e)})`}:P;o.push({type:"marker",templateHash:Y,materialHash:ie,cim:t,materialOverrides:null,colorLocked:!!t.colorLocked,effects:e,scaleSymbolsProportionally:!1,alignment:a,size:oo(c,i,"Size",n,h),scaleX:oo(c,i,"ScaleX",n,p),rotation:oo(c,i,"Rotation",n,y),offsetX:oo(c,i,"OffsetX",n,v),offsetY:oo(c,i,"OffsetY",n,x),color:oo(c,i,"TintColor",n,I,wS),anchorPoint:{x:X.x,y:-X.y},isAbsoluteAnchorPoint:t.anchorPointUnits!=="Relative",outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,frameHeight:0,rotateClockwise:!!t.rotateClockwise,referenceSize:l,sizeRatio:1,markerPlacement:F,url:t.url,animatedSymbolProperties:k})}function HXi(t,e,i,r,n,s,o,a,l,c){const h=t.markerGraphics;if(!h)return;let p=0;if(t.scaleSymbolsProportionally){const v=t.frame;v&&(p=v.ymax-v.ymin)}const y=LCt(t.markerPlacement,r,i,n);for(const v of h)if(v){const x=v.symbol;if(!x)continue;switch(x.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":qXi(t,e,y,null,v,r,i,n,s,o,a,l,p,!!c);break;case"CIMTextSymbol":WXi(t,e,y,v,i,r,n,s,a,l,p)}}}function WXi(t,e,i,r,n,s,o,a,l,c,h){const p=[];S6.findApplicableOverrides(r,s,p);const y=r.geometry;if(!("x"in y)||!("y"in y))return;const v=r.symbol,x=cKe(v),I=uKe(v.fontStyleName),P=jLe(v.fontFamilyName);v.font={family:P,decoration:x,...I};const F=t.frame,k=y.x-.5*(F.xmin+F.xmax),j=y.y-.5*(F.ymin+F.ymax),V=t.size/h,Y=t.primitiveName,X=Do(v.height)*V,Z=Do(v.angle),ie=Do(t.offsetX)+(Do(v.offsetX)+k)*V,ce=Do(t.offsetY)+(Do(v.offsetY)+j)*V,he=W1(B5(v));let _e=W1(V5(v)),xe=sY(v)??0;xe||(_e=W1(B5(v.haloSymbol)),v.haloSize&&(xe=v.haloSize*V));let Pe=null,ke=null,J=0;if(v.callout&&v.callout.type==="CIMBackgroundCallout"){const et=v.callout;if(et.backgroundSymbol){const Ze=et.backgroundSymbol.symbolLayers;if(Ze)for(const mt of Ze)mt.type==="CIMSolidFill"?Pe=W1(mt.color):mt.type==="CIMSolidStroke"&&(ke=W1(mt.color),J=Do(mt.width))}}const[de,Se]=ux(s,Y,e,i,null),Ie=JSON.stringify(t.effects)+Number(t.colorLocked).toString()+JSON.stringify(t.anchorPoint)+t.anchorPointUnits+JSON.stringify(t.markerPlacement)+t.size.toString(),Re=zc(JSON.stringify(r)+Ie+Se).toString();let Oe=oo(r.primitiveName,n,"TextString",o,r.textString??"",lKe,v.textCase);if(Oe==null)return;const{fontStyleName:Ge}=v,Be=P+(Ge?"-"+Ge.toLowerCase():"-regular"),qe=Be;typeof Oe=="string"&&Oe.includes("[")&&v.fieldMap&&(Oe=aXt(v.fieldMap,Oe,v.textCase)),a.push({type:"text",templateHash:Re,materialHash:de||typeof Oe=="function"||Oe.match(/\[(.*?)\]/)?(et,Ze,mt)=>qe+"-"+gB(Oe,et,Ze,mt):qe+"-"+zc(Oe),cim:v,materialOverrides:null,colorLocked:!!t.colorLocked,effects:e,alignment:l,anchorPoint:{x:t.anchorPoint?t.anchorPoint.x:0,y:t.anchorPoint?t.anchorPoint.y:0},isAbsoluteAnchorPoint:t.anchorPointUnits!=="Relative",fontName:Be,decoration:x,weight:oo(Y,n,"Weight",o,I.weight),style:oo(Y,n,"Size",o,I.style),size:oo(Y,n,"Size",o,X),angle:oo(Y,n,"Rotation",o,Z),offsetX:oo(Y,n,"OffsetX",o,ie),offsetY:oo(Y,n,"OffsetY",o,ce),horizontalAlignment:hKe(v.horizontalAlignment),verticalAlignment:dKe(v.verticalAlignment),text:Oe,color:he,outlineColor:_e,outlineSize:xe,backgroundColor:Pe,borderLineColor:ke,borderLineWidth:J,referenceSize:c,sizeRatio:1,markerPlacement:i})}function qXi(t,e,i,r,n,s,o,a,l,c,h,p,y,v){const x=n.symbol,I=x.symbolLayers;if(!I)return;if(v)return void FCt(t,e,i,r,n,o,s,a,l,c,h,p,y);let P=I.length;if(QXi(I))return void YXi(t,e,i,r,n,I,s,o,a,l,h,p,y);const F=xQ.applyEffects(x.effects,n.geometry,c.geometryEngine);if(F)for(;P--;){const k=I[P];if(k&&k.enable!==!1)switch(k.type){case"CIMSolidFill":case"CIMSolidStroke":{const j=xQ.applyEffects(k.effects,F,c.geometryEngine),V=ICt(j);if(!V)continue;const Y=t.anchorPointUnits!=="Relative",[X,Z,ie]=ACt(V,t.frame,t.size,t.anchorPoint,Y),ce=k.type==="CIMSolidFill",he={type:"sdf",geom:j,asFill:ce},_e=t.primitiveName,xe=Do(t.size)??10,Pe=Do(t.rotation),ke=Do(t.offsetX),J=Do(t.offsetY),de=k.path,Se=k.primitiveName,Ie=W1(ce?B5(k):V5(k)),Re=ce?{r:0,g:0,b:0,a:0}:W1(V5(k)),Oe=sY(k)??0;if(!ce&&!Oe)break;let Ge=!1,Be="";for(const mt of s)mt.primitiveName!==Se&&mt.primitiveName!==_e||(mt.value!==void 0?Be+=`-${mt.primitiveName}-${mt.propertyName}-${JSON.stringify(mt.value)}`:mt.valueExpressionInfo&&(Ge=!0));(ve(e)&&typeof e=="function"||ve(i)&&typeof i=="function")&&(Ge=!0);const qe=JSON.stringify({...t,markerGraphics:null}),et=zc(JSON.stringify(he)+de).toString(),Ze={type:"marker",templateHash:zc(JSON.stringify(n)+JSON.stringify(k)+qe+Be).toString(),materialHash:Ge?()=>et:et,cim:he,materialOverrides:null,colorLocked:!!t.colorLocked,effects:e,scaleSymbolsProportionally:!!t.scaleSymbolsProportionally,alignment:h,anchorPoint:{x:Z,y:ie},isAbsoluteAnchorPoint:Y,size:oo(t.primitiveName,o,"Size",a,xe),rotation:oo(t.primitiveName,o,"Rotation",a,Pe),offsetX:oo(t.primitiveName,o,"OffsetX",a,ke),offsetY:oo(t.primitiveName,o,"OffsetY",a,J),scaleX:1,frameHeight:y,rotateClockwise:!!t.rotateClockwise,referenceSize:p,sizeRatio:X,color:oo(Se,o,"Color",a,Ie,wS),outlineColor:oo(Se,o,"Color",a,Re,wS),outlineWidth:oo(Se,o,"Width",a,Oe),markerPlacement:i,animatedSymbolProperties:r,path:de};l.push(Ze);break}default:FCt(t,e,i,r,n,o,s,a,l,c,h,p,y)}}}function YXi(t,e,i,r,n,s,o,a,l,c,h,p,y){const v=n.geometry,x=s[0],I=s[1],P=ICt(v);if(!P)return;const F=t.anchorPointUnits!=="Relative",[k,j,V]=ACt(P,t.frame,t.size,t.anchorPoint,F),Y={type:"sdf",geom:v,asFill:!0},X=t.primitiveName,Z=Do(t.size),ie=Do(t.rotation),ce=Do(t.offsetX),he=Do(t.offsetY),_e=I.path,xe=I.primitiveName,Pe=x.primitiveName,ke=W1(B5(I)),J=W1(V5(x)),de=sY(x)??0;let Se=!1,Ie="";for(const Be of o)Be.primitiveName!==xe&&Be.primitiveName!==Pe&&Be.primitiveName!==X||(Be.value!==void 0?Ie+=`-${Be.primitiveName}-${Be.propertyName}-${JSON.stringify(Be.value)}`:Be.valueExpressionInfo&&(Se=!0));ve(i)&&typeof i=="function"&&(Se=!0);const Re=JSON.stringify({...t,markerGraphics:null}),Oe=zc(JSON.stringify(Y)+_e).toString(),Ge={type:"marker",templateHash:zc(JSON.stringify(n)+JSON.stringify(I)+JSON.stringify(x)+Re+Ie).toString(),materialHash:Se?()=>Oe:Oe,cim:Y,materialOverrides:null,colorLocked:!!t.colorLocked,effects:e,scaleSymbolsProportionally:!!t.scaleSymbolsProportionally,alignment:h,anchorPoint:{x:j,y:V},isAbsoluteAnchorPoint:F,size:oo(t.primitiveName,a,"Size",l,Z),rotation:oo(t.primitiveName,a,"Rotation",l,ie),offsetX:oo(t.primitiveName,a,"OffsetX",l,ce),offsetY:oo(t.primitiveName,a,"OffsetY",l,he),scaleX:1,frameHeight:y,rotateClockwise:!!t.rotateClockwise,referenceSize:p,sizeRatio:k,color:oo(xe,a,"Color",l,ke,wS),outlineColor:oo(Pe,a,"Color",l,J,wS),outlineWidth:oo(Pe,a,"Width",l,de),markerPlacement:i,path:_e,animatedSymbolProperties:r};c.push(Ge)}function FCt(t,e,i,r,n,s,o,a,l,c,h,p,y){const v=XXi(t,n),x=["Rotation","OffsetX","OffsetY"],I=o.filter(he=>he.primitiveName!==t.primitiveName||!x.includes(he.propertyName));let P="";for(const he of o)he.value!==void 0&&(P+=`-${he.primitiveName}-${he.propertyName}-${JSON.stringify(he.value)}`);const[F,k,j]=Cb.getTextureAnchor(v,c),V=t.primitiveName,Y=Do(t.rotation),X=Do(t.offsetX),Z=Do(t.offsetY),ie=zc(JSON.stringify(v)+P).toString(),ce={type:"marker",templateHash:ie,materialHash:I.length>0||ve(e)&&typeof e=="function"?SQ(ie,s,I,a):ie,cim:v,materialOverrides:I,colorLocked:!!t.colorLocked,effects:e,scaleSymbolsProportionally:!!t.scaleSymbolsProportionally,alignment:h,anchorPoint:{x:F,y:k},isAbsoluteAnchorPoint:!1,size:Do(t.size),rotation:oo(V,s,"Rotation",a,Y),offsetX:oo(V,s,"OffsetX",a,X),offsetY:oo(V,s,"OffsetY",a,Z),color:{r:255,g:255,b:255,a:1},outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,scaleX:1,frameHeight:y,rotateClockwise:!!t.rotateClockwise,referenceSize:p,sizeRatio:j/vn(t.size),markerPlacement:i,animatedSymbolProperties:r,avoidSDFRasterization:!0};l.push(ce)}function XXi(t,e){return{type:t.type,enable:!0,name:t.name,colorLocked:t.colorLocked,primitiveName:t.primitiveName,anchorPoint:t.anchorPoint,anchorPointUnits:t.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:t.rotateClockwise,rotation:0,size:t.size,billboardMode3D:t.billboardMode3D,depth3D:t.depth3D,frame:t.frame,markerGraphics:[e],scaleSymbolsProportionally:t.scaleSymbolsProportionally,respectFrame:t.respectFrame,clippingPath:t.clippingPath}}function d5e(t){if(t&&t.indexOf("Level_")===0){const e=parseInt(t.substr(6),10);if(!isNaN(e))return e}return 0}function wS(t){if(!t||t.length===0)return null;const e=new en(t).toRgba();return{r:e[0],g:e[1],b:e[2],a:e[3]}}function oo(t,e,i,r,n,s,o){if(t==null)return n;const a=e[t];if(a){const l=a[i];if(typeof l=="string"||typeof l=="number"||l instanceof Array)return s?s.call(null,l,o):l;if(l!=null&&l instanceof lR&&r?.geometryType)return(c,h,p)=>{let y=x6(l,c,{$view:p},r.geometryType,h);return y!==null&&s&&(y=s.call(null,y,o)),y!==null?y:n}}return n}function p5e(t){return t&&t.charAt(0).toLowerCase()+t.substr(1)}function KXi(t,e,i,r){for(const n of e)if(n.valueExpressionInfo&&r?.geometryType){const s=i[n.primitiveName]&&i[n.primitiveName][n.propertyName];s instanceof lR&&(n.fn=(o,a,l)=>x6(s,o,{$view:l},r.geometryType,a))}return(n,s,o)=>{for(const l of e)l.fn&&(l.value=l.fn(n,s,o));const a=[];for(let l of t){const c=l?.primitiveName;if(c){let h=!1;for(const p of e)if(p.primitiveName===c){const y=p5e(p.propertyName);p.value!=null&&p.value!==l[y]&&(h||(l=gi(l),h=!0),l[y]=p.value)}}a.push(l)}return a}}function LCt(t,e,i,r){const n=[];if(S6.findApplicableOverrides(t,e,n),t==null||n.length===0)return t;for(const s of n)if(s.valueExpressionInfo&&r?.geometryType){const o=i[s.primitiveName]&&i[s.primitiveName][s.propertyName];o instanceof lR&&(s.fn=(a,l,c)=>x6(o,a,{$view:c},r.geometryType,l))}return(s,o,a)=>{for(const h of n)h.fn&&(h.value=h.fn(s,o,a));const l=gi(t),c=t.primitiveName;for(const h of n)if(h.primitiveName===c){const p=p5e(h.propertyName);h.value!=null&&h.value!==l[p]&&(l[p]=h.value)}return l}}function JXi(t,e,i,r){const n=[];if(S6.findApplicableOverrides(t,e,n),t==null||n.length===0)return t;for(const s of n)if(s.valueExpressionInfo&&r?.geometryType){const o=i[s.primitiveName]&&i[s.primitiveName][s.propertyName];o instanceof lR&&(s.fn=(a,l,c)=>x6(o,a,{$view:c},r.geometryType,l))}return(s,o,a)=>{for(const h of n)h.fn&&(h.value=h.fn(s,o,a));const l=gi(t),c=t.primitiveName;for(const h of n)if(h.primitiveName===c){const p=p5e(h.propertyName);if(h.value!=null){const y=wXi(h.value,h.propertyName);y!==l[p]&&(l[p]=y)}}return l}}function SQ(t,e,i,r){for(const n of i)if(n.valueExpressionInfo&&r?.geometryType){const s=e[n.primitiveName]&&e[n.primitiveName][n.propertyName];s instanceof lR&&(n.fn=(o,a,l)=>x6(s,o,{$view:l},r.geometryType,a))}return(n,s,o)=>{for(const a of i)a.fn&&(a.value=a.fn(n,s,o));return zc(t+S6.buildOverrideKey(i)).toString()}}function ZXi(t,e){if(!e||e.length===0)return t;const i=gi(t);return S6.applyOverrides(i,e),i}function ux(t,e,i,r,n){let s=!1,o="";for(const a of t)a.primitiveName===e&&(a.value!==void 0?o+=`-${a.primitiveName}-${a.propertyName}-${JSON.stringify(a.value)}`:a.valueExpressionInfo&&(s=!0));return ve(i)&&typeof i=="function"&&(s=!0),ve(r)&&typeof r=="function"&&(s=!0),ve(n)&&typeof n=="function"&&(s=!0),[s,o]}const QXi=t=>t&&t.length===2&&t[0].enable&&t[1].enable&&t[0].type==="CIMSolidStroke"&&t[1].type==="CIMSolidFill"&&!t[0].effects&&!t[1].effects;var NCt,f5e={};NCt=function(){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={exports:{},id:r,loaded:!1};return t[r].call(n.exports,n,n.exports,i),n.loaded=!0,n.exports}return i.m=t,i.c=e,i.p="",i(0)}([function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.isNotPNG=l,e.isNotAPNG=c,e.default=p;var r=s(i(1)),n=i(2);function s(k){return k&&k.__esModule?k:{default:k}}var o=new Error("Not a PNG"),a=new Error("Not an animated PNG");function l(k){return k===o}function c(k){return k===a}var h=new Uint8Array([137,80,78,71,13,10,26,10]);function p(k){var j=new Uint8Array(k);if(Array.prototype.some.call(h,function(Pe,ke){return Pe!==j[ke]}))return o;var V=!1;if(y(j,function(Pe){return!(V=Pe==="acTL")}),!V)return a;var Y=[],X=[],Z=null,ie=null,ce=0,he=new n.APNG;if(y(j,function(Pe,ke,J,de){var Se=new DataView(ke.buffer);switch(Pe){case"IHDR":Z=ke.subarray(J+8,J+8+de),he.width=Se.getUint32(J+8),he.height=Se.getUint32(J+12);break;case"acTL":he.numPlays=Se.getUint32(J+8+4);break;case"fcTL":ie&&(he.frames.push(ie),ce++),(ie=new n.Frame).width=Se.getUint32(J+8+4),ie.height=Se.getUint32(J+8+8),ie.left=Se.getUint32(J+8+12),ie.top=Se.getUint32(J+8+16);var Ie=Se.getUint16(J+8+20),Re=Se.getUint16(J+8+22);Re===0&&(Re=100),ie.delay=1e3*Ie/Re,ie.delay<=10&&(ie.delay=100),he.playTime+=ie.delay,ie.disposeOp=Se.getUint8(J+8+24),ie.blendOp=Se.getUint8(J+8+25),ie.dataParts=[],ce===0&&ie.disposeOp===2&&(ie.disposeOp=1);break;case"fdAT":ie&&ie.dataParts.push(ke.subarray(J+8+4,J+8+de));break;case"IDAT":ie&&ie.dataParts.push(ke.subarray(J+8,J+8+de));break;case"IEND":X.push(I(ke,J,12+de));break;default:Y.push(I(ke,J,12+de))}}),ie&&he.frames.push(ie),he.frames.length==0)return a;var _e=new Blob(Y),xe=new Blob(X);return he.frames.forEach(function(Pe){var ke=[];ke.push(h),Z.set(F(Pe.width),0),Z.set(F(Pe.height),4),ke.push(P("IHDR",Z)),ke.push(_e),Pe.dataParts.forEach(function(J){return ke.push(P("IDAT",J))}),ke.push(xe),Pe.imageData=new Blob(ke,{type:"image/png"}),delete Pe.dataParts,ke=null}),he}function y(k,j){var V=new DataView(k.buffer),Y=8,X=void 0,Z=void 0,ie=void 0;do Z=V.getUint32(Y),ie=j(X=v(k,Y+4,4),k,Y,Z),Y+=12+Z;while(ie!==!1&&X!="IEND"&&Y>>24&255,k>>>16&255,k>>>8&255,255&k])}},function(t,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,c=a,h=a+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:o.length-a);c>>8^i[255&(l^o[c])];return-1^l};for(var i=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;i[r]=n}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.Frame=e.APNG=void 0;var r=function(){function a(l,c){for(var h=0;h1&&arguments[1]!==void 0&&arguments[1];return this.createImages().then(function(){return new n.default(c,l,h)})}}]),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(c,h){var p=URL.createObjectURL(l.imageData);l.imageElement=document.createElement("img"),l.imageElement.onload=function(){URL.revokeObjectURL(p),c()},l.imageElement.onerror=function(){URL.revokeObjectURL(p),l.imageElement=null,h(new Error("Image creation error"))},l.imageElement.src=p})}}]),a}()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function c(h,p){for(var y=0;y=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 p=this.currentFrame;this._prevFrame=p,this._prevFrameData=null,p.disposeOp==2&&(this._prevFrameData=this.context.getImageData(p.left,p.top,p.width,p.height)),p.blendOp==0&&this.context.clearRect(p.left,p.top,p.width,p.height),this.context.drawImage(p.imageElement,p.left,p.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var p=this;this.emit("play"),this._ended&&this.stop(),this._paused=!1;var y=performance.now()+this.currentFrame.delay/this.playbackRate,v=function x(I){if(!p._ended&&!p._paused){if(I>=y){for(;I-y>=p._apng.playTime/p.playbackRate;)y+=p._apng.playTime/p.playbackRate,p._numPlays++;do p.renderNextFrame(),y+=p.currentFrame.delay/p.playbackRate;while(!p._ended&&I>y)}requestAnimationFrame(x)}};requestAnimationFrame(v)}},{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}}]),h}(n(i(4)).default);e.default=l},function(t,e){function i(){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}t.exports=i,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(a){if(!n(a)||a<0||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},i.prototype.emit=function(a){var l,c,h,p,y,v;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 x=new Error('Uncaught, unspecified "error" event. ('+l+")");throw x.context=l,x}if(o(c=this._events[a]))return!1;if(r(c))switch(arguments.length){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:p=Array.prototype.slice.call(arguments,1),c.apply(this,p)}else if(s(c))for(p=Array.prototype.slice.call(arguments,1),h=(v=c.slice()).length,y=0;y0&&this._events[a].length>c&&(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},i.prototype.on=i.prototype.addListener,i.prototype.once=function(a,l){if(!r(l))throw TypeError("listener must be a function");var c=!1;function h(){this.removeListener(a,h),c||(c=!0,l.apply(this,arguments))}return h.listener=l,this.on(a,h),this},i.prototype.removeListener=function(a,l){var c,h,p,y;if(!r(l))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(p=(c=this._events[a]).length,h=-1,c===l||r(c.listener)&&c.listener===l)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,l);else if(s(c)){for(y=p;y-- >0;)if(c[y]===l||c[y].listener&&c[y].listener===l){h=y;break}if(h<0)return this;c.length===1?(c.length=0,delete this._events[a]):c.splice(h,1),this._events.removeListener&&this.emit("removeListener",a,l)}return this},i.prototype.removeAllListeners=function(a){var l,c;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(c=this._events[a]))this.removeListener(a,c);else if(c)for(;c.length;)this.removeListener(a,c[c.length-1]);return delete this._events[a],this},i.prototype.listeners=function(a){return this._events&&this._events[a]?r(this._events[a])?[this._events[a]]:this._events[a].slice():[]},i.prototype.listenerCount=function(a){if(this._events){var l=this._events[a];if(r(l))return 1;if(l)return l.length}return 0},i.listenerCount=function(a,l){return a.listenerCount(l)}}])},{get exports(){return f5e},set exports(t){f5e=t}}.exports=NCt();const eKi=tl(f5e);async function tKi(t,e){const i=eKi(t);if(i instanceof Error)throw i;await i.createImages(),yn(e);const{frames:r,width:n,height:s}=i,o=document.createElement("canvas");o.width=n,o.height=s;const a=o.getContext("2d",{willReadFrequently:!0}),l=[],c=[];for(const h of r){c.push(h.delay||100);const p=h.imageElement;h.blendOp===0?a.globalCompositeOperation="copy":a.globalCompositeOperation="source-over";const y=h.disposeOp===2?a.getImageData(h.left,h.top,h.width,h.height):void 0;a.drawImage(p,h.left,h.top);const v=a.getImageData(0,0,n,s);l.push(v),h.disposeOp===0||(h.disposeOp===1?a.clearRect(h.left,h.top,h.width,h.height):h.disposeOp===2&&a.putImageData(y,h.left,h.top))}return{frameDurations:c,getFrame:h=>l[h],width:n,height:s}}const iKi=[137,80,78,71,13,10,26,10];function rKi(t){const e=new Uint8Array(t);return!iKi.some((i,r)=>i!==e[r])}function nKi(t){if(!rKi(t))return!1;const e=new DataView(t),i=new Uint8Array(t);let r,n=8;do{const s=e.getUint32(n);if(r=String.fromCharCode.apply(String,Array.prototype.slice.call(i.subarray(n+4,n+8))),r==="acTL")return!0;n+=12+s}while(r!=="IEND"&&ne.toBlob(n,i));if(!r)throw new st("imageToArrayBuffer","Failed to encode image");return{data:await r.arrayBuffer(),type:i}}async function oKi(t){if(!(t instanceof HTMLImageElement))return"image/png";const e=t.src;if(A1(e)){const i=Y3(e);return i?.mediaType==="image/jpeg"?i.mediaType:"image/png"}return/\.png$/i.test(e)?"image/png":/\.(jpg|jpeg)$/i.test(e)?"image/jpeg":"image/png"}function Sme(t){if(t instanceof HTMLCanvasElement)return t;if(t instanceof HTMLVideoElement)return null;const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");return t instanceof HTMLImageElement?i.drawImage(t,0,0,t.width,t.height):t instanceof ImageData&&i.putImageData(t,0,0),e}function aKi(t){const e=[],i=new Uint8Array(t);for(let r=0;r2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:r;if(Array.isArray(i))i.forEach(function(o){return t(e,o,r,n)});else if(typeof i=="function")i(e,r,n,t);else{var s=Object.keys(i)[0];Array.isArray(i[s])?(n[s]={},t(e,i[s],r,n[s])):n[s]=i[s](e,r,n,t)}return r};mO.parse=uKi;var cKi=function(t,e){return function(i,r,n,s){e(i,r,n)&&s(i,t,r,n)}};mO.conditional=cKi;var hKi=function(t,e){return function(i,r,n,s){for(var o=[],a=i.pos;e(i,r,n);){var l={};if(s(i,t,r,l),i.pos===a)break;a=i.pos,o.push(l)}return o}};mO.loop=hKi;var Tf={};Object.defineProperty(Tf,"__esModule",{value:!0}),Tf.readBits=Tf.readArray=Tf.readUnsigned=Tf.readString=Tf.peekBytes=Tf.readBytes=Tf.peekByte=Tf.readByte=Tf.buildStream=void 0;var dKi=function(t){return{data:t,pos:0}};Tf.buildStream=dKi;var BCt=function(){return function(t){return t.data[t.pos++]}};Tf.readByte=BCt;var pKi=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(e){return e.data[e.pos+t]}};Tf.peekByte=pKi;var Cme=function(t){return function(e){return e.data.subarray(e.pos,e.pos+=t)}};Tf.readBytes=Cme;var fKi=function(t){return function(e){return e.data.subarray(e.pos,e.pos+t)}};Tf.peekBytes=fKi;var mKi=function(t){return function(e){return Array.from(Cme(t)(e)).map(function(i){return String.fromCharCode(i)}).join("")}};Tf.readString=mKi;var gKi=function(t){return function(e){var i=Cme(2)(e);return t?(i[1]<<8)+i[0]:(i[0]<<8)+i[1]}};Tf.readUnsigned=gKi;var yKi=function(t,e){return function(i,r,n){for(var s=typeof e=="function"?e(i,r,n):e,o=Cme(t),a=new Array(s),l=0;l=v){var P=v-h.pos;y.push((0,i.readBytes)(P)(h)),x+=P;break}y.push((0,i.readBytes)(I)(h)),x+=I}for(var F=new Uint8Array(x),k=0,j=0;j>=o,x-=o,h>r||h==a)break;if(h==n){s=(1<<(o=y+1))-1,r=n+2,c=V;continue}if(c==V){ce[P++]=ie[h],c=h,I=h;continue}for(l=h,h==r&&(ce[P++]=I,h=c);h>n;)ce[P++]=ie[h],h=Z[h];I=255&ie[h],ce[P++]=I,rl[h],width:n,height:s}}const MKi=[71,73,70];function DKi(t){const e=new Uint8Array(t);return!MKi.some((i,r)=>i!==e[r])}function FKi(t){if(!DKi(t))return!1;const e=new DataView(t),i=e.getUint8(10);let r=13+(128&i?3*2**(1+(7&i)):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:c();break;case 254:h();break;case 255:p();break;default:return!1}return!0}function a(){n++,r+=8;const v=e.getUint8(r++);r+=128&v?3*2**(1+(7&v)):0,r++,y()}function l(){r++,r+=4,y()}function c(){n++,r++,r+=12,y()}function h(){y()}function p(){r++,r+=8,r+=3,y()}function y(){let v;for(;v=e.getUint8(r++);)r+=v}return!1}let LKi=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,i){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=kKi(e,i),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)}};async function NKi(t,e){const i=window.URL.createObjectURL(t);try{const{data:r}=await ur(i,{...e,responseType:"image"});return r}catch(r){throw ys(r)?r:new st("mapview-invalid-resource",`Could not fetch requested resource at ${i}`)}finally{window.URL.revokeObjectURL(i)}}async function kKi(t,e){const{arrayBuffer:i,mediaType:r}=await $Ki(t,e),n=r==="image/png";return r==="image/gif"&&FKi(i)?RKi(i):n&&nKi(i)?tKi(i,e):NKi(new Blob([i],{type:r}),e)}async function $Ki(t,e){let i;const r=";base64,";if(t.includes(r)){const n=t.indexOf(r),s=t.indexOf(r)+r.length,o=t.substring(s),a=atob(o),l=new Uint8Array(a.length);for(let c=0;ct==="vertical"||t==="horizontal"||t==="cross"||t==="esriSFSCross"||t==="esriSFSVertical"||t==="esriSFSHorizontal";function VKi(t,e,i){const r=q8(Math.ceil(i)),n=BKi(e)?8*r:16*r,s=2*r;t.width=n,t.height=n;const o=t.getContext("2d");o.strokeStyle="#FFFFFF",o.lineWidth=r,o.beginPath(),e!=="vertical"&&e!=="cross"&&e!=="esriSFSCross"&&e!=="esriSFSVertical"||(o.moveTo(n/2,-s),o.lineTo(n/2,n+s)),e!=="horizontal"&&e!=="cross"&&e!=="esriSFSCross"&&e!=="esriSFSHorizontal"||(o.moveTo(-s,n/2),o.lineTo(n+s,n/2)),e!=="forward-diagonal"&&e!=="diagonal-cross"&&e!=="esriSFSDiagonalCross"&&e!=="esriSFSForwardDiagonal"||(o.moveTo(-s,-s),o.lineTo(n+s,n+s),o.moveTo(n-s,-s),o.lineTo(n+s,s),o.moveTo(-s,n-s),o.lineTo(s,n+s)),e!=="backward-diagonal"&&e!=="diagonal-cross"&&e!=="esriSFSBackwardDiagonal"&&e!=="esriSFSDiagonalCross"||(o.moveTo(n+s,-s),o.lineTo(-s,n+s),o.moveTo(s,-s),o.lineTo(-s,s),o.moveTo(n+s,n-s),o.lineTo(n-s,n+s)),o.stroke();const a=o.getImageData(0,0,t.width,t.height),l=new Uint8Array(a.data);let c;for(let h=0;h=y||p>=y){const v=h/p;v>1?(h=y,p=Math.round(y/v)):(p=y,h=Math.round(y*v)),c=new Uint8Array(4*h*p);const x=new Uint8ClampedArray(c.buffer);lXt(a,e,i,x,h,p,!1)}return{size:[h,p],image:new Uint32Array(c.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0}}};/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const qLe={frame:"frame",frameAdvancing:"frame--advancing",frameRetreating:"frame--retreating"},BXi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;align-items:stretch;overflow:hidden;background-color:transparent}:host .frame{position:relative;margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;padding:0px}:host ::slotted(calcite-flow-item),:host ::slotted(calcite-panel){block-size:100%}:host ::slotted(.calcite-match-height:last-child){display:flex;flex:1 1 auto;overflow:hidden}:host .frame--advancing{animation:calcite-frame-advance var(--calcite-animation-timing)}:host .frame--retreating{animation:calcite-frame-retreat var(--calcite-animation-timing)}@keyframes calcite-frame-advance{0%{--tw-bg-opacity:0.5;transform:translate3d(50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}@keyframes calcite-frame-retreat{0%{--tw-bg-opacity:0.5;transform:translate3d(-50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}",rCt=h0(class extends d0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.itemMutationObserver=aF("mutation",()=>this.updateFlowProps()),this.getFlowDirection=(t,e)=>{const i=t>1;return!(t&&e>1)&&!i?null:e{const{el:t,items:e}=this,i=Array.from(t.querySelectorAll("calcite-flow-item")).filter(a=>a.closest("calcite-flow")===t),r=e.length,n=i.length,s=i[n-1],o=i[n-2];if(n&&s&&i.forEach(a=>{a.showBackButton=a===s&&n>1,a.hidden=a!==s}),o&&(o.menuOpen=!1),this.items=i,r!==n){const a=this.getFlowDirection(r,n);this.itemCount=n,this.flowDirection=a}},this.flowDirection=null,this.itemCount=0,this.items=[]}async back(){const{items:t}=this,e=t[t.length-1];return e?(e.beforeBack?e.beforeBack:()=>Promise.resolve()).call(e).then(()=>(e.remove(),e)):void 0}connectedCallback(){this.itemMutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.updateFlowProps()}disconnectedCallback(){this.itemMutationObserver?.disconnect()}handleItemBackClick(){this.back()}render(){const{flowDirection:t}=this,e={[qLe.frame]:!0,[qLe.frameAdvancing]:t==="advancing",[qLe.frameRetreating]:t==="retreating"};return dr("div",{class:e},dr("slot",null))}get el(){return this}static get style(){return BXi}},[1,"calcite-flow",{flowDirection:[32],itemCount:[32],items:[32],back:[64]},[[0,"calciteFlowItemBack","handleItemBackClick"]]]);function nCt(){if(typeof customElements>"u")return;["calcite-flow"].forEach(e=>{switch(e){case"calcite-flow":customElements.get(e)||customElements.define(e,rCt);break}})}nCt();const GXi=Object.freeze(Object.defineProperty({__proto__:null,CalciteFlow:rCt,defineCustomElement:nCt},Symbol.toStringTag,{value:"Module"}));/*! + */const m5e={frame:"frame",frameAdvancing:"frame--advancing",frameRetreating:"frame--retreating"},UKi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;align-items:stretch;overflow:hidden;background-color:transparent}:host .frame{position:relative;margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;padding:0px}:host ::slotted(calcite-flow-item),:host ::slotted(calcite-panel){block-size:100%}:host ::slotted(.calcite-match-height:last-child){display:flex;flex:1 1 auto;overflow:hidden}:host .frame--advancing{animation:calcite-frame-advance var(--calcite-animation-timing)}:host .frame--retreating{animation:calcite-frame-retreat var(--calcite-animation-timing)}@keyframes calcite-frame-advance{0%{--tw-bg-opacity:0.5;transform:translate3d(50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}@keyframes calcite-frame-retreat{0%{--tw-bg-opacity:0.5;transform:translate3d(-50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}",zCt=d0(class extends p0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.itemMutationObserver=cF("mutation",()=>this.updateFlowProps()),this.getFlowDirection=(t,e)=>{const i=t>1;return!(t&&e>1)&&!i?null:e{const{el:t,items:e}=this,i=Array.from(t.querySelectorAll("calcite-flow-item")).filter(a=>a.closest("calcite-flow")===t),r=e.length,n=i.length,s=i[n-1],o=i[n-2];if(n&&s&&i.forEach(a=>{a.showBackButton=a===s&&n>1,a.hidden=a!==s}),o&&(o.menuOpen=!1),this.items=i,r!==n){const a=this.getFlowDirection(r,n);this.itemCount=n,this.flowDirection=a}},this.flowDirection=null,this.itemCount=0,this.items=[]}async back(){const{items:t}=this,e=t[t.length-1];return e?(e.beforeBack?e.beforeBack:()=>Promise.resolve()).call(e).then(()=>(e.remove(),e)):void 0}connectedCallback(){this.itemMutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.updateFlowProps()}disconnectedCallback(){this.itemMutationObserver?.disconnect()}handleItemBackClick(){this.back()}render(){const{flowDirection:t}=this,e={[m5e.frame]:!0,[m5e.frameAdvancing]:t==="advancing",[m5e.frameRetreating]:t==="retreating"};return br("div",{class:e},br("slot",null))}get el(){return this}static get style(){return UKi}},[1,"calcite-flow",{flowDirection:[32],itemCount:[32],items:[32],back:[64]},[[0,"calciteFlowItemBack","handleItemBackClick"]]]);function HCt(){if(typeof customElements>"u")return;["calcite-flow"].forEach(e=>{switch(e){case"calcite-flow":customElements.get(e)||customElements.define(e,zCt);break}})}HCt();const zKi=Object.freeze(Object.defineProperty({__proto__:null,CalciteFlow:zCt,defineCustomElement:HCt},Symbol.toStringTag,{value:"Module"}));/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */function sCt(t,e){return(t+e)%e}/*! + */function WCt(t,e){return(t+e)%e}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const pO={button:"button",buttonTextVisible:"button--text-visible",buttonCompact:"button--compact",indicatorText:"indicator-text",iconContainer:"icon-container",slotContainer:"slot-container",slotContainerHidden:"slot-container--hidden",textContainer:"text-container",textContainerVisible:"text-container--visible"},VXi={tooltip:"tooltip"},UXi='@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{display:flex;background-color:transparent;--calcite-action-indicator-color:var(--calcite-ui-brand)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.button{position:relative;margin:0px;display:flex;inline-size:auto;cursor:pointer;align-items:center;justify-content:flex-start;border-style:none;background-color:var(--calcite-ui-foreground-1);fill:var(--calcite-ui-text-3);font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-3);outline-color:transparent;text-align:unset;flex:1 0 auto}.button:hover{background-color:var(--calcite-ui-foreground-2);fill:var(--calcite-ui-text-1);color:var(--calcite-ui-text-1)}.button:focus{background-color:var(--calcite-ui-foreground-2);fill:var(--calcite-ui-text-1);color:var(--calcite-ui-text-1);outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}.button:active{background-color:var(--calcite-ui-foreground-3)}.button .icon-container{pointer-events:none;margin:0px;display:flex;align-items:center;justify-content:center;min-inline-size:1rem;min-block-size:1rem}.button .text-container{margin:0px;inline-size:0px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.5rem;opacity:0;transition-property:opacity;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-property:margin;transition-property:inline-size}.button .text-container--visible{inline-size:auto;flex:1 1 auto;opacity:1}:host([scale=s]) .button{padding-inline:0.5rem;padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=s]) .button--text-visible .icon-container{margin-inline-end:0.5rem}:host([scale=m]) .button{padding-inline:1rem;padding-block:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=m]) .button--text-visible .icon-container{margin-inline-end:0.75rem}:host([scale=l]) .button{padding:1.25rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=l]) .button--text-visible .icon-container{margin-inline-end:1rem}:host([alignment=center]) .button{justify-content:center}:host([alignment=end]) .button{justify-content:flex-end}:host([alignment=center]) .button .text-container--visible,:host([alignment=end]) .button .text-container--visible{flex:0 1 auto}:host([scale=s][compact]) .button,:host([scale=m][compact]) .button,:host([scale=l][compact]) .button{padding-inline:0px}.slot-container{display:flex}.slot-container--hidden{display:none}.button--text-visible{inline-size:100%}:host([active]) .button,:host([active]) .button:hover,:host([active]) .button:focus,:host([active][loading]) .button{background-color:var(--calcite-ui-foreground-3);fill:var(--calcite-ui-text-1);color:var(--calcite-ui-text-1)}:host([active]) .button:active{background-color:var(--calcite-ui-foreground-1)}:host([appearance=transparent]) .button{background-color:transparent;transition-property:box-shadow;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}:host([appearance=transparent]) .button:hover,:host([appearance=transparent]) .button:focus{background-color:transparent;box-shadow:0 0 0 2px var(--calcite-ui-border-1) inset}:host([active][appearance=transparent]) .button,:host([active][appearance=transparent]) .button:hover,:host([active][appearance=transparent]) .button:focus{background-color:var(--calcite-ui-foreground-3);fill:var(--calcite-ui-text-1);color:var(--calcite-ui-text-1)}:host([appearance=transparent][loading]) .button,:host([appearance=transparent][disabled]) .button{background-color:transparent}:host([loading]) .button,:host([loading]) .button:hover,:host([loading]) .button:focus{background-color:var(--calcite-ui-foreground-1)}:host([loading]) .button .text-container,:host([loading]) .button:hover .text-container,:host([loading]) .button:focus .text-container{opacity:var(--calcite-ui-opacity-disabled)}:host([loading]) calcite-loader[inline]{color:var(--calcite-ui-text-3);margin-inline-end:0px}:host([disabled]) .button,:host([disabled]) .button:hover,:host([disabled]) .button:focus{cursor:default;background-color:var(--calcite-ui-foreground-1);opacity:var(--calcite-ui-opacity-disabled)}:host([disabled][active]) .button,:host([disabled][active]) .button:hover,:host([disabled][active]) .button:focus{background-color:var(--calcite-ui-foreground-3);opacity:var(--calcite-ui-opacity-disabled)}:host([indicator]) .button::after{content:"";position:absolute;block-size:0.5rem;inline-size:0.5rem;border-radius:9999px;border-width:2px;background-color:var(--calcite-action-indicator-color);border-color:var(--calcite-ui-foreground-1);inset-block-end:0.75rem;inset-inline-end:0.75rem}:host([indicator]) .button--text-visible::after{inset-block-end:auto}:host([indicator]) .button--text-visible .text-container--visible{margin-inline-end:1rem}:host([indicator]) .button:hover::after,:host([indicator]) .button:focus::after{border-color:var(--calcite-ui-foreground-1)}:host([indicator][scale=s]) .button::after{inset-block-end:0.25rem;inset-inline-end:0.25rem}:host([indicator][scale=s]) .button--text-visible::after{inset-block-end:auto;inset-inline-end:0.5rem}:host([indicator][active]) .button::after{border-color:var(--calcite-ui-foreground-3)}.indicator-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}',oCt=h0(class extends d0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.mutationObserver=aF("mutation",()=>AEe(this)),this.guid=`calcite-action-${DY()}`,this.indicatorId=`${this.guid}-indicator`,this.buttonId=`${this.guid}-button`,this.handleTooltipSlotChange=t=>{const i=t.target.assignedElements({flatten:!0}).filter(r=>r?.matches("calcite-tooltip"))[0];i&&(i.referenceElement=this.buttonEl)},this.active=!1,this.alignment=void 0,this.appearance="solid",this.compact=!1,this.disabled=!1,this.icon=void 0,this.iconFlipRtl=!1,this.indicator=!1,this.label=void 0,this.loading=!1,this.scale="m",this.text=void 0,this.textEnabled=!1,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0}onMessagesChange(){}effectiveLocaleChange(){dF(this,this.effectiveLocale)}connectedCallback(){uF(this),pF(this),this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}async componentWillLoad(){SE(this),await hF(this)}componentDidLoad(){CE(this)}disconnectedCallback(){cF(this),fF(this),this.mutationObserver?.disconnect()}componentDidRender(){f6(this)}async setFocus(){await TE(this),this.buttonEl?.focus()}renderTextContainer(){const{text:t,textEnabled:e}=this,i={[pO.textContainer]:!0,[pO.textContainerVisible]:e};return t?dr("div",{class:i,key:"text-container"},t):null}renderIndicatorText(){const{indicator:t,messages:e,indicatorId:i,buttonId:r}=this;return dr("div",{"aria-labelledby":r,"aria-live":"polite",class:pO.indicatorText,id:i,role:"region"},t?e.indicator:null)}renderIconContainer(){const{loading:t,icon:e,scale:i,el:r,iconFlipRtl:n}=this,s=i==="l"?"m":"s",o=i==="l"?"l":"m",a=t?dr("calcite-loader",{inline:!0,label:this.messages.loading,scale:o}):null,l=e?dr("calcite-icon",{flipRtl:n,icon:e,scale:s}):null,c=a||l,d=c||r.children?.length,p=dr("div",{class:{[pO.slotContainer]:!0,[pO.slotContainerHidden]:t}},dr("slot",null));return d?dr("div",{"aria-hidden":"true",class:pO.iconContainer,key:"icon-container"},c,p):null}render(){const{active:t,compact:e,disabled:i,loading:r,textEnabled:n,label:s,text:o,indicator:a,indicatorId:l,buttonId:c,messages:d}=this,p=`${s||o}${a?` (${d.indicator})`:""}`,y={[pO.button]:!0,[pO.buttonTextVisible]:n,[pO.buttonCompact]:e};return dr(YA,null,dr("button",{"aria-busy":yw(r),"aria-controls":a?l:null,"aria-disabled":yw(i),"aria-label":p,"aria-pressed":yw(t),class:y,disabled:i,id:c,ref:v=>this.buttonEl=v},this.renderIconContainer(),this.renderTextContainer()),dr("slot",{name:VXi.tooltip,onSlotchange:this.handleTooltipSlotChange}),this.renderIndicatorText())}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return UXi}},[1,"calcite-action",{active:[516],alignment:[513],appearance:[513],compact:[516],disabled:[516],icon:[1],iconFlipRtl:[516,"icon-flip-rtl"],indicator:[516],label:[1],loading:[516],scale:[513],text:[1],textEnabled:[516,"text-enabled"],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]}]);function mj(){if(typeof customElements>"u")return;["calcite-action","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-action":customElements.get(e)||customElements.define(e,oCt);break;case"calcite-icon":customElements.get(e)||ox();break;case"calcite-loader":customElements.get(e)||mF();break}})}mj();/*! + */const gO={button:"button",buttonTextVisible:"button--text-visible",buttonCompact:"button--compact",indicatorText:"indicator-text",iconContainer:"icon-container",slotContainer:"slot-container",slotContainerHidden:"slot-container--hidden",textContainer:"text-container",textContainerVisible:"text-container--visible"},HKi={tooltip:"tooltip"},WKi='@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{display:flex;background-color:transparent;--calcite-action-indicator-color:var(--calcite-ui-brand)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.button{position:relative;margin:0px;display:flex;inline-size:auto;cursor:pointer;align-items:center;justify-content:flex-start;border-style:none;background-color:var(--calcite-ui-foreground-1);fill:var(--calcite-ui-text-3);font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-3);outline-color:transparent;text-align:unset;flex:1 0 auto}.button:hover{background-color:var(--calcite-ui-foreground-2);fill:var(--calcite-ui-text-1);color:var(--calcite-ui-text-1)}.button:focus{background-color:var(--calcite-ui-foreground-2);fill:var(--calcite-ui-text-1);color:var(--calcite-ui-text-1);outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}.button:active{background-color:var(--calcite-ui-foreground-3)}.button .icon-container{pointer-events:none;margin:0px;display:flex;align-items:center;justify-content:center;min-inline-size:1rem;min-block-size:1rem}.button .text-container{margin:0px;inline-size:0px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.5rem;opacity:0;transition-property:opacity;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-property:margin;transition-property:inline-size}.button .text-container--visible{inline-size:auto;flex:1 1 auto;opacity:1}:host([scale=s]) .button{padding-inline:0.5rem;padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=s]) .button--text-visible .icon-container{margin-inline-end:0.5rem}:host([scale=m]) .button{padding-inline:1rem;padding-block:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=m]) .button--text-visible .icon-container{margin-inline-end:0.75rem}:host([scale=l]) .button{padding:1.25rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;font-weight:var(--calcite-font-weight-normal)}:host([scale=l]) .button--text-visible .icon-container{margin-inline-end:1rem}:host([alignment=center]) .button{justify-content:center}:host([alignment=end]) .button{justify-content:flex-end}:host([alignment=center]) .button .text-container--visible,:host([alignment=end]) .button .text-container--visible{flex:0 1 auto}:host([scale=s][compact]) .button,:host([scale=m][compact]) .button,:host([scale=l][compact]) .button{padding-inline:0px}.slot-container{display:flex}.slot-container--hidden{display:none}.button--text-visible{inline-size:100%}:host([active]) .button,:host([active]) .button:hover,:host([active]) .button:focus,:host([active][loading]) .button{background-color:var(--calcite-ui-foreground-3);fill:var(--calcite-ui-text-1);color:var(--calcite-ui-text-1)}:host([active]) .button:active{background-color:var(--calcite-ui-foreground-1)}:host([appearance=transparent]) .button{background-color:transparent;transition-property:box-shadow;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}:host([appearance=transparent]) .button:hover,:host([appearance=transparent]) .button:focus{background-color:transparent;box-shadow:0 0 0 2px var(--calcite-ui-border-1) inset}:host([active][appearance=transparent]) .button,:host([active][appearance=transparent]) .button:hover,:host([active][appearance=transparent]) .button:focus{background-color:var(--calcite-ui-foreground-3);fill:var(--calcite-ui-text-1);color:var(--calcite-ui-text-1)}:host([appearance=transparent][loading]) .button,:host([appearance=transparent][disabled]) .button{background-color:transparent}:host([loading]) .button,:host([loading]) .button:hover,:host([loading]) .button:focus{background-color:var(--calcite-ui-foreground-1)}:host([loading]) .button .text-container,:host([loading]) .button:hover .text-container,:host([loading]) .button:focus .text-container{opacity:var(--calcite-ui-opacity-disabled)}:host([loading]) calcite-loader[inline]{color:var(--calcite-ui-text-3);margin-inline-end:0px}:host([disabled]) .button,:host([disabled]) .button:hover,:host([disabled]) .button:focus{cursor:default;background-color:var(--calcite-ui-foreground-1);opacity:var(--calcite-ui-opacity-disabled)}:host([disabled][active]) .button,:host([disabled][active]) .button:hover,:host([disabled][active]) .button:focus{background-color:var(--calcite-ui-foreground-3);opacity:var(--calcite-ui-opacity-disabled)}:host([indicator]) .button::after{content:"";position:absolute;block-size:0.5rem;inline-size:0.5rem;border-radius:9999px;border-width:2px;background-color:var(--calcite-action-indicator-color);border-color:var(--calcite-ui-foreground-1);inset-block-end:0.75rem;inset-inline-end:0.75rem}:host([indicator]) .button--text-visible::after{inset-block-end:auto}:host([indicator]) .button--text-visible .text-container--visible{margin-inline-end:1rem}:host([indicator]) .button:hover::after,:host([indicator]) .button:focus::after{border-color:var(--calcite-ui-foreground-1)}:host([indicator][scale=s]) .button::after{inset-block-end:0.25rem;inset-inline-end:0.25rem}:host([indicator][scale=s]) .button--text-visible::after{inset-block-end:auto;inset-inline-end:0.5rem}:host([indicator][active]) .button::after{border-color:var(--calcite-ui-foreground-3)}.indicator-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}',qCt=d0(class extends p0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.mutationObserver=cF("mutation",()=>MEe(this)),this.guid=`calcite-action-${DY()}`,this.indicatorId=`${this.guid}-indicator`,this.buttonId=`${this.guid}-button`,this.handleTooltipSlotChange=t=>{const i=t.target.assignedElements({flatten:!0}).filter(r=>r?.matches("calcite-tooltip"))[0];i&&(i.referenceElement=this.buttonEl)},this.active=!1,this.alignment=void 0,this.appearance="solid",this.compact=!1,this.disabled=!1,this.icon=void 0,this.iconFlipRtl=!1,this.indicator=!1,this.label=void 0,this.loading=!1,this.scale="m",this.text=void 0,this.textEnabled=!1,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0}onMessagesChange(){}effectiveLocaleChange(){mF(this,this.effectiveLocale)}connectedCallback(){dF(this),gF(this),this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}async componentWillLoad(){TE(this),await fF(this)}componentDidLoad(){EE(this)}disconnectedCallback(){pF(this),yF(this),this.mutationObserver?.disconnect()}componentDidRender(){g6(this)}async setFocus(){await IE(this),this.buttonEl?.focus()}renderTextContainer(){const{text:t,textEnabled:e}=this,i={[gO.textContainer]:!0,[gO.textContainerVisible]:e};return t?br("div",{class:i,key:"text-container"},t):null}renderIndicatorText(){const{indicator:t,messages:e,indicatorId:i,buttonId:r}=this;return br("div",{"aria-labelledby":r,"aria-live":"polite",class:gO.indicatorText,id:i,role:"region"},t?e.indicator:null)}renderIconContainer(){const{loading:t,icon:e,scale:i,el:r,iconFlipRtl:n}=this,s=i==="l"?"m":"s",o=i==="l"?"l":"m",a=t?br("calcite-loader",{inline:!0,label:this.messages.loading,scale:o}):null,l=e?br("calcite-icon",{flipRtl:n,icon:e,scale:s}):null,c=a||l,h=c||r.children?.length,p=br("div",{class:{[gO.slotContainer]:!0,[gO.slotContainerHidden]:t}},br("slot",null));return h?br("div",{"aria-hidden":"true",class:gO.iconContainer,key:"icon-container"},c,p):null}render(){const{active:t,compact:e,disabled:i,loading:r,textEnabled:n,label:s,text:o,indicator:a,indicatorId:l,buttonId:c,messages:h}=this,p=`${s||o}${a?` (${h.indicator})`:""}`,y={[gO.button]:!0,[gO.buttonTextVisible]:n,[gO.buttonCompact]:e};return br(qA,null,br("button",{"aria-busy":bw(r),"aria-controls":a?l:null,"aria-disabled":bw(i),"aria-label":p,"aria-pressed":bw(t),class:y,disabled:i,id:c,ref:v=>this.buttonEl=v},this.renderIconContainer(),this.renderTextContainer()),br("slot",{name:HKi.tooltip,onSlotchange:this.handleTooltipSlotChange}),this.renderIndicatorText())}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return WKi}},[1,"calcite-action",{active:[516],alignment:[513],appearance:[513],compact:[516],disabled:[516],icon:[1],iconFlipRtl:[516,"icon-flip-rtl"],indicator:[516],label:[1],loading:[516],scale:[513],text:[1],textEnabled:[516,"text-enabled"],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]}]);function xU(){if(typeof customElements>"u")return;["calcite-action","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-action":customElements.get(e)||customElements.define(e,qCt);break;case"calcite-icon":customElements.get(e)||lx();break;case"calcite-loader":customElements.get(e)||vF();break}})}xU();/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */function OE(t){return t.split("-")[1]}function YLe(t){return t==="y"?"height":"width"}function fO(t){return t.split("-")[0]}function _Q(t){return["top","bottom"].includes(fO(t))?"x":"y"}function aCt(t,e,i){let{reference:r,floating:n}=t;const s=r.x+r.width/2-n.width/2,o=r.y+r.height/2-n.height/2,a=_Q(e),l=YLe(a),c=r[l]/2-n[l]/2,d=fO(e),p=a==="x";let y;switch(d){case"top":y={x:s,y:r.y-n.height};break;case"bottom":y={x:s,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:o};break;case"left":y={x:r.x-n.width,y:o};break;default:y={x:r.x,y:r.y}}switch(OE(e)){case"start":y[a]-=c*(i&&p?-1:1);break;case"end":y[a]+=c*(i&&p?-1:1);break}return y}const jXi=async(t,e,i)=>{const{placement:r="bottom",strategy:n="absolute",middleware:s=[],platform:o}=i,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:n}),{x:d,y:p}=aCt(c,r,l),y=r,v={},S=0;for(let I=0;I({name:"arrow",options:t,async fn(e){const{element:i,padding:r=0}=t||{},{x:n,y:s,placement:o,rects:a,platform:l}=e;if(i==null)return{};const c=lCt(r),d={x:n,y:s},p=_Q(o),y=YLe(p),v=await l.getDimensions(i),S=p==="y"?"top":"left",I=p==="y"?"bottom":"right",O=a.reference[y]+a.reference[p]-d[p]-a.floating[y],L=d[p]-a.reference[p],N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(i));let G=N?p==="y"?N.clientHeight||0:N.clientWidth||0:0;G===0&&(G=a.floating[y]);const V=O/2-L/2,Y=c[S],X=G-v[y]-c[I],te=G/2-v[y]/2+V,re=KLe(Y,te,X),ge=OE(o)!=null&&te!=re&&a.reference[y]/2-(tet.concat(e,e+"-start",e+"-end"),[]),YXi={left:"right",right:"left",bottom:"top",top:"bottom"};function ime(t){return t.replace(/left|right|bottom|top/g,e=>YXi[e])}function hCt(t,e,i){i===void 0&&(i=!1);const r=OE(t),n=_Q(t),s=YLe(n);let o=n==="x"?r===(i?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=ime(o)),{main:o,cross:ime(o)}}const XXi={start:"end",end:"start"};function rme(t){return t.replace(/start|end/g,e=>XXi[e])}function KXi(t,e,i){return(t?[...i.filter(n=>OE(n)===t),...i.filter(n=>OE(n)!==t)]:i.filter(n=>fO(n)===n)).filter(n=>t?OE(n)===t||(e?rme(n)!==n:!1):!0)}const JXi=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var i,r,n;const{rects:s,middlewareData:o,placement:a,platform:l,elements:c}=e,{crossAxis:d=!1,alignment:p,allowedPlacements:y=cCt,autoAlignment:v=!0,...S}=t,I=p!==void 0||y===cCt?KXi(p||null,v,y):y,O=await bQ(e,S),L=((i=o.autoPlacement)==null?void 0:i.index)||0,N=I[L];if(N==null)return{};const{main:G,cross:V}=hCt(N,s,await(l.isRTL==null?void 0:l.isRTL(c.floating)));if(a!==N)return{reset:{placement:I[0]}};const Y=[O[fO(N)],O[G],O[V]],X=[...((r=o.autoPlacement)==null?void 0:r.overflows)||[],{placement:N,overflows:Y}],te=I[L+1];if(te)return{data:{index:L+1,overflows:X},reset:{placement:te}};const re=X.map(_e=>{const Ie=OE(_e.placement);return[_e.placement,Ie&&d?_e.overflows.slice(0,2).reduce((ke,Ne)=>ke+Ne,0):_e.overflows[0],_e.overflows]}).sort((_e,Ie)=>_e[1]-Ie[1]),ge=((n=re.filter(_e=>_e[2].slice(0,OE(_e[0])?2:3).every(Ie=>Ie<=0))[0])==null?void 0:n[0])||re[0][0];return ge!==a?{data:{index:L+1,overflows:X},reset:{placement:ge}}:{}}}};function ZXi(t){const e=ime(t);return[rme(t),e,rme(e)]}function QXi(t,e,i){const r=["left","right"],n=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return i?e?n:r:e?r:n;case"left":case"right":return e?s:o;default:return[]}}function eKi(t,e,i,r){const n=OE(t);let s=QXi(fO(t),i==="start",r);return n&&(s=s.map(o=>o+"-"+n),e&&(s=s.concat(s.map(rme)))),s}const dCt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var i;const{placement:r,middlewareData:n,rects:s,initialPlacement:o,platform:a,elements:l}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:S=!0,...I}=t,O=fO(r),L=fO(o)===o,N=await(a.isRTL==null?void 0:a.isRTL(l.floating)),G=p||(L||!S?[ime(o)]:ZXi(o));!p&&v!=="none"&&G.push(...eKi(o,S,v,N));const V=[o,...G],Y=await bQ(e,I),X=[];let te=((i=n.flip)==null?void 0:i.overflows)||[];if(c&&X.push(Y[O]),d){const{main:_e,cross:Ie}=hCt(r,s,N);X.push(Y[_e],Y[Ie])}if(te=[...te,{placement:r,overflows:X}],!X.every(_e=>_e<=0)){var re,fe;const _e=(((re=n.flip)==null?void 0:re.index)||0)+1,Ie=V[_e];if(Ie)return{data:{index:_e,overflows:te},reset:{placement:Ie}};let ke=(fe=te.filter(Ne=>Ne.overflows[0]<=0).sort((Ne,J)=>Ne.overflows[1]-J.overflows[1])[0])==null?void 0:fe.placement;if(!ke)switch(y){case"bestFit":{var ge;const Ne=(ge=te.map(J=>[J.placement,J.overflows.filter(he=>he>0).reduce((he,xe)=>he+xe,0)]).sort((J,he)=>J[1]-he[1])[0])==null?void 0:ge[0];Ne&&(ke=Ne);break}case"initialPlacement":ke=o;break}if(r!==ke)return{reset:{placement:ke}}}return{}}}};function pCt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function fCt(t){return uCt.some(e=>t[e]>=0)}const tKi=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{strategy:i="referenceHidden",...r}=t,{rects:n}=e;switch(i){case"referenceHidden":{const s=await bQ(e,{...r,elementContext:"reference"}),o=pCt(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:fCt(o)}}}case"escaped":{const s=await bQ(e,{...r,altBoundary:!0}),o=pCt(s,n.floating);return{data:{escapedOffsets:o,escaped:fCt(o)}}}default:return{}}}}};async function iKi(t,e){const{placement:i,platform:r,elements:n}=t,s=await(r.isRTL==null?void 0:r.isRTL(n.floating)),o=fO(i),a=OE(i),l=_Q(i)==="x",c=["left","top"].includes(o)?-1:1,d=s&&l?-1:1,p=typeof e=="function"?e(t):e;let{mainAxis:y,crossAxis:v,alignmentAxis:S}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return a&&typeof S=="number"&&(v=a==="end"?S*-1:S),l?{x:v*d,y:y*c}:{x:y*c,y:v*d}}const rKi=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:i,y:r}=e,n=await iKi(e,t);return{x:i+n.x,y:r+n.y,data:n}}}};function nKi(t){return t==="x"?"y":"x"}const sKi=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:r,placement:n}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:O=>{let{x:L,y:N}=O;return{x:L,y:N}}},...l}=t,c={x:i,y:r},d=await bQ(e,l),p=_Q(fO(n)),y=nKi(p);let v=c[p],S=c[y];if(s){const O=p==="y"?"top":"left",L=p==="y"?"bottom":"right",N=v+d[O],G=v-d[L];v=KLe(N,v,G)}if(o){const O=y==="y"?"top":"left",L=y==="y"?"bottom":"right",N=S+d[O],G=S-d[L];S=KLe(N,S,G)}const I=a.fn({...e,[p]:v,[y]:S});return{...I,data:{x:I.x-i,y:I.y-r}}}}};function wb(t){var e;return((e=t.ownerDocument)==null?void 0:e.defaultView)||window}function RE(t){return wb(t).getComputedStyle(t)}const mCt=Math.min,wQ=Math.max,nme=Math.round;function gCt(t){const e=RE(t);let i=parseFloat(e.width),r=parseFloat(e.height);const n=t.offsetWidth,s=t.offsetHeight,o=nme(i)!==n||nme(r)!==s;return o&&(i=n,r=s),{width:i,height:r,fallback:o}}function bF(t){return vCt(t)?(t.nodeName||"").toLowerCase():""}let sme;function yCt(){if(sme)return sme;const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?(sme=t.brands.map(e=>e.brand+"/"+e.version).join(" "),sme):navigator.userAgent}function ME(t){return t instanceof wb(t).HTMLElement}function xS(t){return t instanceof wb(t).Element}function vCt(t){return t instanceof wb(t).Node}function _Ct(t){if(typeof ShadowRoot>"u")return!1;const e=wb(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function ome(t){const{overflow:e,overflowX:i,overflowY:r,display:n}=RE(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+i)&&!["inline","contents"].includes(n)}function oKi(t){return["table","td","th"].includes(bF(t))}function JLe(t){const e=/firefox/i.test(yCt()),i=RE(t),r=i.backdropFilter||i.WebkitBackdropFilter;return i.transform!=="none"||i.perspective!=="none"||(r?r!=="none":!1)||e&&i.willChange==="filter"||e&&(i.filter?i.filter!=="none":!1)||["transform","perspective"].some(n=>i.willChange.includes(n))||["paint","layout","strict","content"].some(n=>{const s=i.contain;return s!=null?s.includes(n):!1})}function ZLe(){return/^((?!chrome|android).)*safari/i.test(yCt())}function QLe(t){return["html","body","#document"].includes(bF(t))}function bCt(t){return xS(t)?t:t.contextElement}const wCt={x:1,y:1};function gj(t){const e=bCt(t);if(!ME(e))return wCt;const i=e.getBoundingClientRect(),{width:r,height:n,fallback:s}=gCt(e);let o=(s?nme(i.width):i.width)/r,a=(s?nme(i.height):i.height)/n;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}function S6(t,e,i,r){var n,s;e===void 0&&(e=!1),i===void 0&&(i=!1);const o=t.getBoundingClientRect(),a=bCt(t);let l=wCt;e&&(r?xS(r)&&(l=gj(r)):l=gj(t));const c=a?wb(a):window,d=ZLe()&&i;let p=(o.left+(d&&((n=c.visualViewport)==null?void 0:n.offsetLeft)||0))/l.x,y=(o.top+(d&&((s=c.visualViewport)==null?void 0:s.offsetTop)||0))/l.y,v=o.width/l.x,S=o.height/l.y;if(a){const I=wb(a),O=r&&xS(r)?wb(r):r;let L=I.frameElement;for(;L&&r&&O!==I;){const N=gj(L),G=L.getBoundingClientRect(),V=getComputedStyle(L);G.x+=(L.clientLeft+parseFloat(V.paddingLeft))*N.x,G.y+=(L.clientTop+parseFloat(V.paddingTop))*N.y,p*=N.x,y*=N.y,v*=N.x,S*=N.y,p+=G.x,y+=G.y,L=wb(L).frameElement}}return{width:v,height:S,top:y,right:p+v,bottom:y+S,left:p,x:p,y}}function wF(t){return((vCt(t)?t.ownerDocument:t.document)||window.document).documentElement}function ame(t){return xS(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function aKi(t){let{rect:e,offsetParent:i,strategy:r}=t;const n=ME(i),s=wF(i);if(i===s)return e;let o={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((n||!n&&r!=="fixed")&&((bF(i)!=="body"||ome(s))&&(o=ame(i)),ME(i))){const c=S6(i);a=gj(i),l.x=c.x+i.clientLeft,l.y=c.y+i.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-o.scrollLeft*a.x+l.x,y:e.y*a.y-o.scrollTop*a.y+l.y}}function xCt(t){return S6(wF(t)).left+ame(t).scrollLeft}function lKi(t){const e=wF(t),i=ame(t),r=t.ownerDocument.body,n=wQ(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=wQ(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-i.scrollLeft+xCt(t);const a=-i.scrollTop;return RE(r).direction==="rtl"&&(o+=wQ(e.clientWidth,r.clientWidth)-n),{width:n,height:s,x:o,y:a}}function xQ(t){if(bF(t)==="html")return t;const e=t.assignedSlot||t.parentNode||_Ct(t)&&t.host||wF(t);return _Ct(e)?e.host:e}function SCt(t){const e=xQ(t);return QLe(e)?e.ownerDocument.body:ME(e)&&ome(e)?e:SCt(e)}function SQ(t,e){var i;e===void 0&&(e=[]);const r=SCt(t),n=r===((i=t.ownerDocument)==null?void 0:i.body),s=wb(r);return n?e.concat(s,s.visualViewport||[],ome(r)?r:[]):e.concat(r,SQ(r))}function uKi(t,e){const i=wb(t),r=wF(t),n=i.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(n){s=n.width,o=n.height;const c=ZLe();(!c||c&&e==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:s,height:o,x:a,y:l}}function cKi(t,e){const i=S6(t,!0,e==="fixed"),r=i.top+t.clientTop,n=i.left+t.clientLeft,s=ME(t)?gj(t):{x:1,y:1},o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=n*s.x,c=r*s.y;return{width:o,height:a,x:l,y:c}}function CCt(t,e,i){let r;if(e==="viewport")r=uKi(t,i);else if(e==="document")r=lKi(wF(t));else if(xS(e))r=cKi(e,i);else{const o={...e};if(ZLe()){var n,s;const a=wb(t);o.x-=((n=a.visualViewport)==null?void 0:n.offsetLeft)||0,o.y-=((s=a.visualViewport)==null?void 0:s.offsetTop)||0}r=o}return XLe(r)}function hKi(t,e){const i=e.get(t);if(i)return i;let r=SQ(t).filter(a=>xS(a)&&bF(a)!=="body"),n=null;const s=RE(t).position==="fixed";let o=s?xQ(t):t;for(;xS(o)&&!QLe(o);){const a=RE(o),l=JLe(o);a.position==="fixed"?n=null:(s?!l&&!n:!l&&a.position==="static"&&!!n&&["absolute","fixed"].includes(n.position))?r=r.filter(p=>p!==o):n=a,o=xQ(o)}return e.set(t,r),r}function dKi(t){let{element:e,boundary:i,rootBoundary:r,strategy:n}=t;const o=[...i==="clippingAncestors"?hKi(e,this._c):[].concat(i),r],a=o[0],l=o.reduce((c,d)=>{const p=CCt(e,d,n);return c.top=wQ(p.top,c.top),c.right=mCt(p.right,c.right),c.bottom=mCt(p.bottom,c.bottom),c.left=wQ(p.left,c.left),c},CCt(e,a,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function pKi(t){return ME(t)?gCt(t):t.getBoundingClientRect()}function TCt(t,e){return!ME(t)||RE(t).position==="fixed"?null:e?e(t):t.offsetParent}function fKi(t){let e=xQ(t);for(;ME(e)&&!QLe(e);){if(JLe(e))return e;e=xQ(e)}return null}function ECt(t,e){const i=wb(t);let r=TCt(t,e);for(;r&&oKi(r)&&RE(r).position==="static";)r=TCt(r,e);return r&&(bF(r)==="html"||bF(r)==="body"&&RE(r).position==="static"&&!JLe(r))?i:r||fKi(t)||i}function mKi(t,e,i){const r=ME(e),n=wF(e),s=S6(t,!0,i==="fixed",e);let o={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&i!=="fixed")if((bF(e)!=="body"||ome(n))&&(o=ame(e)),ME(e)){const l=S6(e,!0);a.x=l.x+e.clientLeft,a.y=l.y+e.clientTop}else n&&(a.x=xCt(n));return{x:s.left+o.scrollLeft-a.x,y:s.top+o.scrollTop-a.y,width:s.width,height:s.height}}const e5e={getClippingRect:dKi,convertOffsetParentRelativeRectToViewportRelativeRect:aKi,isElement:xS,getDimensions:pKi,getOffsetParent:ECt,getDocumentElement:wF,getScale:gj,async getElementRects(t){let{reference:e,floating:i,strategy:r}=t;const n=this.getOffsetParent||ECt,s=this.getDimensions;return{reference:mKi(e,await n(i),r),floating:{x:0,y:0,...await s(i)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>RE(t).direction==="rtl"};function gKi(t,e,i,r){r===void 0&&(r={});const{ancestorScroll:n=!0,ancestorResize:s=!0,elementResize:o=!0,animationFrame:a=!1}=r,l=n&&!a,c=l||s?[...xS(t)?SQ(t):t.contextElement?SQ(t.contextElement):[],...SQ(e)]:[];c.forEach(S=>{l&&S.addEventListener("scroll",i,{passive:!0}),s&&S.addEventListener("resize",i)});let d=null;if(o){let S=!0;d=new ResizeObserver(()=>{S||i(),S=!1}),xS(t)&&!a&&d.observe(t),!xS(t)&&t.contextElement&&!a&&d.observe(t.contextElement),d.observe(e)}let p,y=a?S6(t):null;a&&v();function v(){const S=S6(t);y&&(S.x!==y.x||S.y!==y.y||S.width!==y.width||S.height!==y.height)&&i(),y=S,p=requestAnimationFrame(v)}return i(),()=>{var S;c.forEach(I=>{l&&I.removeEventListener("scroll",i),s&&I.removeEventListener("resize",i)}),(S=d)==null||S.disconnect(),d=null,a&&cancelAnimationFrame(p)}}const yKi=(t,e,i)=>{const r=new Map,n={platform:e5e,...i},s={...n.platform,_c:r};return jXi(t,e,{...n,platform:s})},vKi={floatingUINonChromiumPositioningFix:!0,...globalThis.calciteComponentsConfig},_Ki=bKi();async function bKi(){function t(){return navigator.userAgentData}function e(){const r=t();return r?.brands?r.brands.map(({brand:n,version:s})=>`${n}/${s}`).join(" "):navigator.userAgent}function i(){const r=t();return r?.brands?!!r.brands.find(({brand:n,version:s})=>(n==="Google Chrome"||n==="Chromium")&&Number(s)>=109):!!navigator.userAgent.split(" ").find(n=>{const[s,o]=n.split("/");return s==="Chrome"&&parseInt(o)>=109})}if(vKi.floatingUINonChromiumPositioningFix&&(/firefox|safari/i.test(e())||i())){const{offsetParent:r}=await Promise.resolve().then(()=>aPr),n=e5e.getOffsetParent;e5e.getOffsetParent=s=>n(s,r)}}const ICt="data-placement",ACt=100,PCt=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end"],CQ={animation:"calcite-floating-ui-anim",animationActive:"calcite-floating-ui-anim--active"};function wKi({placement:t,flipDisabled:e,flipPlacements:i,offsetDistance:r,offsetSkidding:n,arrowEl:s,type:o}){const a=[sKi(),tKi()];if(o==="menu")return[...a,dCt({fallbackPlacements:i||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})];if(o==="popover"||o==="tooltip"){const l=[...a,rKi({mainAxis:typeof r=="number"?r:0,crossAxis:typeof n=="number"?n:0})];return t==="auto"||t==="auto-start"||t==="auto-end"?l.push(JXi({alignment:t==="auto-start"?"start":t==="auto-end"?"end":null})):e||l.push(dCt(i?{fallbackPlacements:i}:{})),s&&l.push(qXi({element:s})),l}return[]}function xKi(t,e){const i=t.filter(r=>PCt.includes(r));return i.length!==t.length&&console.warn(`${e.tagName}: Invalid value found in: flipPlacements. Try any of these: ${PCt.map(r=>`"${r}"`).join(", ").trim()}`,{el:e}),i}function SKi(t,e){const i=["left","right"];return FY(t)==="rtl"&&i.reverse(),e.replace(/leading/gi,i[0]).replace(/trailing/gi,i[1])}async function OCt(t,e,i=!1){if(t.open)return i?CKi(e):RCt(e)}const CKi=Ffe(RCt,ACt,{leading:!0,maxWait:ACt});async function RCt({referenceEl:t,floatingEl:e,overlayPositioning:i="absolute",placement:r,flipDisabled:n,flipPlacements:s,offsetDistance:o,offsetSkidding:a,includeArrow:l=!1,arrowEl:c,type:d}){if(!t||!e||l&&!c)return null;await _Ki;const{x:p,y,placement:v,strategy:S,middlewareData:I}=await yKi(t,e,{strategy:i,placement:r==="auto"||r==="auto-start"||r==="auto-end"?void 0:SKi(e,r),middleware:wKi({placement:r,flipDisabled:n,flipPlacements:s,offsetDistance:o,offsetSkidding:a,arrowEl:c,type:d})});if(I?.arrow){const{x:V,y:Y}=I.arrow;Object.assign(c.style,{left:V!=null?`${V}px`:"",top:Y!=null?`${Y}px`:""})}const L=I?.hide?.referenceHidden?"hidden":null,N=L?"none":null;e.setAttribute(ICt,v);const G=`translate(${Math.round(p)}px,${Math.round(y)}px)`;Object.assign(e.style,{visibility:L,pointerEvents:N,position:S,top:"0",left:"0",transform:G})}const t5e=new WeakMap;function MCt(t,e,i){if(!i||!e)return;i5e(t,e,i);const r=t.overlayPositioning;Object.assign(i.style,{visibility:"hidden",pointerEvents:"none",position:r}),r==="absolute"&&kCt(i);const n=gKi;t5e.set(t,n(e,i,()=>t.reposition()))}function i5e(t,e,i){if(!i||!e)return;r5e(i).removeEventListener("transitionend",n5e);const r=t5e.get(t);r&&r(),t5e.delete(t)}const DCt=4,FCt=Math.ceil(Math.hypot(DCt,DCt));function LCt(t){!t||t.style.position!=="absolute"||r5e(t).addEventListener("transitionend",n5e)}function r5e(t){return t.shadowRoot||t}function n5e(t){const e=t.target;if(t.propertyName==="opacity"&&e.classList.contains(CQ.animation)){const i=TKi(e);kCt(i),r5e(i).removeEventListener("transitionend",n5e)}}function kCt(t){t.style.transform="",t.style.top="0",t.style.left="0"}function TKi(t){return XB(t,`[${ICt}]`)}/*! + */function ME(t){return t.split("-")[1]}function g5e(t){return t==="y"?"height":"width"}function yO(t){return t.split("-")[0]}function CQ(t){return["top","bottom"].includes(yO(t))?"x":"y"}function YCt(t,e,i){let{reference:r,floating:n}=t;const s=r.x+r.width/2-n.width/2,o=r.y+r.height/2-n.height/2,a=CQ(e),l=g5e(a),c=r[l]/2-n[l]/2,h=yO(e),p=a==="x";let y;switch(h){case"top":y={x:s,y:r.y-n.height};break;case"bottom":y={x:s,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:o};break;case"left":y={x:r.x-n.width,y:o};break;default:y={x:r.x,y:r.y}}switch(ME(e)){case"start":y[a]-=c*(i&&p?-1:1);break;case"end":y[a]+=c*(i&&p?-1:1);break}return y}const qKi=async(t,e,i)=>{const{placement:r="bottom",strategy:n="absolute",middleware:s=[],platform:o}=i,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:n}),{x:h,y:p}=YCt(c,r,l),y=r,v={},x=0;for(let I=0;I({name:"arrow",options:t,async fn(e){const{element:i,padding:r=0}=t||{},{x:n,y:s,placement:o,rects:a,platform:l}=e;if(i==null)return{};const c=XCt(r),h={x:n,y:s},p=CQ(o),y=g5e(p),v=await l.getDimensions(i),x=p==="y"?"top":"left",I=p==="y"?"bottom":"right",P=a.reference[y]+a.reference[p]-h[p]-a.floating[y],F=h[p]-a.reference[p],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(i));let j=k?p==="y"?k.clientHeight||0:k.clientWidth||0:0;j===0&&(j=a.floating[y]);const V=P/2-F/2,Y=c[x],X=j-v[y]-c[I],Z=j/2-v[y]/2+V,ie=v5e(Y,Z,X),he=ME(o)!=null&&Z!=ie&&a.reference[y]/2-(Zt.concat(e,e+"-start",e+"-end"),[]),ZKi={left:"right",right:"left",bottom:"top",top:"bottom"};function Ime(t){return t.replace(/left|right|bottom|top/g,e=>ZKi[e])}function ZCt(t,e,i){i===void 0&&(i=!1);const r=ME(t),n=CQ(t),s=g5e(n);let o=n==="x"?r===(i?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Ime(o)),{main:o,cross:Ime(o)}}const QKi={start:"end",end:"start"};function Ame(t){return t.replace(/start|end/g,e=>QKi[e])}function eJi(t,e,i){return(t?[...i.filter(n=>ME(n)===t),...i.filter(n=>ME(n)!==t)]:i.filter(n=>yO(n)===n)).filter(n=>t?ME(n)===t||(e?Ame(n)!==n:!1):!0)}const tJi=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var i,r,n;const{rects:s,middlewareData:o,placement:a,platform:l,elements:c}=e,{crossAxis:h=!1,alignment:p,allowedPlacements:y=JCt,autoAlignment:v=!0,...x}=t,I=p!==void 0||y===JCt?eJi(p||null,v,y):y,P=await TQ(e,x),F=((i=o.autoPlacement)==null?void 0:i.index)||0,k=I[F];if(k==null)return{};const{main:j,cross:V}=ZCt(k,s,await(l.isRTL==null?void 0:l.isRTL(c.floating)));if(a!==k)return{reset:{placement:I[0]}};const Y=[P[yO(k)],P[j],P[V]],X=[...((r=o.autoPlacement)==null?void 0:r.overflows)||[],{placement:k,overflows:Y}],Z=I[F+1];if(Z)return{data:{index:F+1,overflows:X},reset:{placement:Z}};const ie=X.map(_e=>{const xe=ME(_e.placement);return[_e.placement,xe&&h?_e.overflows.slice(0,2).reduce((Pe,ke)=>Pe+ke,0):_e.overflows[0],_e.overflows]}).sort((_e,xe)=>_e[1]-xe[1]),he=((n=ie.filter(_e=>_e[2].slice(0,ME(_e[0])?2:3).every(xe=>xe<=0))[0])==null?void 0:n[0])||ie[0][0];return he!==a?{data:{index:F+1,overflows:X},reset:{placement:he}}:{}}}};function iJi(t){const e=Ime(t);return[Ame(t),e,Ame(e)]}function rJi(t,e,i){const r=["left","right"],n=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return i?e?n:r:e?r:n;case"left":case"right":return e?s:o;default:return[]}}function nJi(t,e,i,r){const n=ME(t);let s=rJi(yO(t),i==="start",r);return n&&(s=s.map(o=>o+"-"+n),e&&(s=s.concat(s.map(Ame)))),s}const QCt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var i;const{placement:r,middlewareData:n,rects:s,initialPlacement:o,platform:a,elements:l}=e,{mainAxis:c=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:x=!0,...I}=t,P=yO(r),F=yO(o)===o,k=await(a.isRTL==null?void 0:a.isRTL(l.floating)),j=p||(F||!x?[Ime(o)]:iJi(o));!p&&v!=="none"&&j.push(...nJi(o,x,v,k));const V=[o,...j],Y=await TQ(e,I),X=[];let Z=((i=n.flip)==null?void 0:i.overflows)||[];if(c&&X.push(Y[P]),h){const{main:_e,cross:xe}=ZCt(r,s,k);X.push(Y[_e],Y[xe])}if(Z=[...Z,{placement:r,overflows:X}],!X.every(_e=>_e<=0)){var ie,ce;const _e=(((ie=n.flip)==null?void 0:ie.index)||0)+1,xe=V[_e];if(xe)return{data:{index:_e,overflows:Z},reset:{placement:xe}};let Pe=(ce=Z.filter(ke=>ke.overflows[0]<=0).sort((ke,J)=>ke.overflows[1]-J.overflows[1])[0])==null?void 0:ce.placement;if(!Pe)switch(y){case"bestFit":{var he;const ke=(he=Z.map(J=>[J.placement,J.overflows.filter(de=>de>0).reduce((de,Se)=>de+Se,0)]).sort((J,de)=>J[1]-de[1])[0])==null?void 0:he[0];ke&&(Pe=ke);break}case"initialPlacement":Pe=o;break}if(r!==Pe)return{reset:{placement:Pe}}}return{}}}};function eTt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function tTt(t){return KCt.some(e=>t[e]>=0)}const sJi=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{strategy:i="referenceHidden",...r}=t,{rects:n}=e;switch(i){case"referenceHidden":{const s=await TQ(e,{...r,elementContext:"reference"}),o=eTt(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:tTt(o)}}}case"escaped":{const s=await TQ(e,{...r,altBoundary:!0}),o=eTt(s,n.floating);return{data:{escapedOffsets:o,escaped:tTt(o)}}}default:return{}}}}};async function oJi(t,e){const{placement:i,platform:r,elements:n}=t,s=await(r.isRTL==null?void 0:r.isRTL(n.floating)),o=yO(i),a=ME(i),l=CQ(i)==="x",c=["left","top"].includes(o)?-1:1,h=s&&l?-1:1,p=typeof e=="function"?e(t):e;let{mainAxis:y,crossAxis:v,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return a&&typeof x=="number"&&(v=a==="end"?x*-1:x),l?{x:v*h,y:y*c}:{x:y*c,y:v*h}}const aJi=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:i,y:r}=e,n=await oJi(e,t);return{x:i+n.x,y:r+n.y,data:n}}}};function lJi(t){return t==="x"?"y":"x"}const uJi=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:r,placement:n}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:P=>{let{x:F,y:k}=P;return{x:F,y:k}}},...l}=t,c={x:i,y:r},h=await TQ(e,l),p=CQ(yO(n)),y=lJi(p);let v=c[p],x=c[y];if(s){const P=p==="y"?"top":"left",F=p==="y"?"bottom":"right",k=v+h[P],j=v-h[F];v=v5e(k,v,j)}if(o){const P=y==="y"?"top":"left",F=y==="y"?"bottom":"right",k=x+h[P],j=x-h[F];x=v5e(k,x,j)}const I=a.fn({...e,[p]:v,[y]:x});return{...I,data:{x:I.x-i,y:I.y-r}}}}};function Tb(t){var e;return((e=t.ownerDocument)==null?void 0:e.defaultView)||window}function DE(t){return Tb(t).getComputedStyle(t)}const iTt=Math.min,EQ=Math.max,Pme=Math.round;function rTt(t){const e=DE(t);let i=parseFloat(e.width),r=parseFloat(e.height);const n=t.offsetWidth,s=t.offsetHeight,o=Pme(i)!==n||Pme(r)!==s;return o&&(i=n,r=s),{width:i,height:r,fallback:o}}function SF(t){return sTt(t)?(t.nodeName||"").toLowerCase():""}let Ome;function nTt(){if(Ome)return Ome;const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?(Ome=t.brands.map(e=>e.brand+"/"+e.version).join(" "),Ome):navigator.userAgent}function FE(t){return t instanceof Tb(t).HTMLElement}function xS(t){return t instanceof Tb(t).Element}function sTt(t){return t instanceof Tb(t).Node}function oTt(t){if(typeof ShadowRoot>"u")return!1;const e=Tb(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Rme(t){const{overflow:e,overflowX:i,overflowY:r,display:n}=DE(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+i)&&!["inline","contents"].includes(n)}function cJi(t){return["table","td","th"].includes(SF(t))}function _5e(t){const e=/firefox/i.test(nTt()),i=DE(t),r=i.backdropFilter||i.WebkitBackdropFilter;return i.transform!=="none"||i.perspective!=="none"||(r?r!=="none":!1)||e&&i.willChange==="filter"||e&&(i.filter?i.filter!=="none":!1)||["transform","perspective"].some(n=>i.willChange.includes(n))||["paint","layout","strict","content"].some(n=>{const s=i.contain;return s!=null?s.includes(n):!1})}function b5e(){return/^((?!chrome|android).)*safari/i.test(nTt())}function w5e(t){return["html","body","#document"].includes(SF(t))}function aTt(t){return xS(t)?t:t.contextElement}const lTt={x:1,y:1};function SU(t){const e=aTt(t);if(!FE(e))return lTt;const i=e.getBoundingClientRect(),{width:r,height:n,fallback:s}=rTt(e);let o=(s?Pme(i.width):i.width)/r,a=(s?Pme(i.height):i.height)/n;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}function T6(t,e,i,r){var n,s;e===void 0&&(e=!1),i===void 0&&(i=!1);const o=t.getBoundingClientRect(),a=aTt(t);let l=lTt;e&&(r?xS(r)&&(l=SU(r)):l=SU(t));const c=a?Tb(a):window,h=b5e()&&i;let p=(o.left+(h&&((n=c.visualViewport)==null?void 0:n.offsetLeft)||0))/l.x,y=(o.top+(h&&((s=c.visualViewport)==null?void 0:s.offsetTop)||0))/l.y,v=o.width/l.x,x=o.height/l.y;if(a){const I=Tb(a),P=r&&xS(r)?Tb(r):r;let F=I.frameElement;for(;F&&r&&P!==I;){const k=SU(F),j=F.getBoundingClientRect(),V=getComputedStyle(F);j.x+=(F.clientLeft+parseFloat(V.paddingLeft))*k.x,j.y+=(F.clientTop+parseFloat(V.paddingTop))*k.y,p*=k.x,y*=k.y,v*=k.x,x*=k.y,p+=j.x,y+=j.y,F=Tb(F).frameElement}}return{width:v,height:x,top:y,right:p+v,bottom:y+x,left:p,x:p,y}}function CF(t){return((sTt(t)?t.ownerDocument:t.document)||window.document).documentElement}function Mme(t){return xS(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function hJi(t){let{rect:e,offsetParent:i,strategy:r}=t;const n=FE(i),s=CF(i);if(i===s)return e;let o={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((n||!n&&r!=="fixed")&&((SF(i)!=="body"||Rme(s))&&(o=Mme(i)),FE(i))){const c=T6(i);a=SU(i),l.x=c.x+i.clientLeft,l.y=c.y+i.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-o.scrollLeft*a.x+l.x,y:e.y*a.y-o.scrollTop*a.y+l.y}}function uTt(t){return T6(CF(t)).left+Mme(t).scrollLeft}function dJi(t){const e=CF(t),i=Mme(t),r=t.ownerDocument.body,n=EQ(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=EQ(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-i.scrollLeft+uTt(t);const a=-i.scrollTop;return DE(r).direction==="rtl"&&(o+=EQ(e.clientWidth,r.clientWidth)-n),{width:n,height:s,x:o,y:a}}function IQ(t){if(SF(t)==="html")return t;const e=t.assignedSlot||t.parentNode||oTt(t)&&t.host||CF(t);return oTt(e)?e.host:e}function cTt(t){const e=IQ(t);return w5e(e)?e.ownerDocument.body:FE(e)&&Rme(e)?e:cTt(e)}function AQ(t,e){var i;e===void 0&&(e=[]);const r=cTt(t),n=r===((i=t.ownerDocument)==null?void 0:i.body),s=Tb(r);return n?e.concat(s,s.visualViewport||[],Rme(r)?r:[]):e.concat(r,AQ(r))}function pJi(t,e){const i=Tb(t),r=CF(t),n=i.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(n){s=n.width,o=n.height;const c=b5e();(!c||c&&e==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:s,height:o,x:a,y:l}}function fJi(t,e){const i=T6(t,!0,e==="fixed"),r=i.top+t.clientTop,n=i.left+t.clientLeft,s=FE(t)?SU(t):{x:1,y:1},o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=n*s.x,c=r*s.y;return{width:o,height:a,x:l,y:c}}function hTt(t,e,i){let r;if(e==="viewport")r=pJi(t,i);else if(e==="document")r=dJi(CF(t));else if(xS(e))r=fJi(e,i);else{const o={...e};if(b5e()){var n,s;const a=Tb(t);o.x-=((n=a.visualViewport)==null?void 0:n.offsetLeft)||0,o.y-=((s=a.visualViewport)==null?void 0:s.offsetTop)||0}r=o}return y5e(r)}function mJi(t,e){const i=e.get(t);if(i)return i;let r=AQ(t).filter(a=>xS(a)&&SF(a)!=="body"),n=null;const s=DE(t).position==="fixed";let o=s?IQ(t):t;for(;xS(o)&&!w5e(o);){const a=DE(o),l=_5e(o);a.position==="fixed"?n=null:(s?!l&&!n:!l&&a.position==="static"&&!!n&&["absolute","fixed"].includes(n.position))?r=r.filter(p=>p!==o):n=a,o=IQ(o)}return e.set(t,r),r}function gJi(t){let{element:e,boundary:i,rootBoundary:r,strategy:n}=t;const o=[...i==="clippingAncestors"?mJi(e,this._c):[].concat(i),r],a=o[0],l=o.reduce((c,h)=>{const p=hTt(e,h,n);return c.top=EQ(p.top,c.top),c.right=iTt(p.right,c.right),c.bottom=iTt(p.bottom,c.bottom),c.left=EQ(p.left,c.left),c},hTt(e,a,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function yJi(t){return FE(t)?rTt(t):t.getBoundingClientRect()}function dTt(t,e){return!FE(t)||DE(t).position==="fixed"?null:e?e(t):t.offsetParent}function vJi(t){let e=IQ(t);for(;FE(e)&&!w5e(e);){if(_5e(e))return e;e=IQ(e)}return null}function pTt(t,e){const i=Tb(t);let r=dTt(t,e);for(;r&&cJi(r)&&DE(r).position==="static";)r=dTt(r,e);return r&&(SF(r)==="html"||SF(r)==="body"&&DE(r).position==="static"&&!_5e(r))?i:r||vJi(t)||i}function _Ji(t,e,i){const r=FE(e),n=CF(e),s=T6(t,!0,i==="fixed",e);let o={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&i!=="fixed")if((SF(e)!=="body"||Rme(n))&&(o=Mme(e)),FE(e)){const l=T6(e,!0);a.x=l.x+e.clientLeft,a.y=l.y+e.clientTop}else n&&(a.x=uTt(n));return{x:s.left+o.scrollLeft-a.x,y:s.top+o.scrollTop-a.y,width:s.width,height:s.height}}const x5e={getClippingRect:gJi,convertOffsetParentRelativeRectToViewportRelativeRect:hJi,isElement:xS,getDimensions:yJi,getOffsetParent:pTt,getDocumentElement:CF,getScale:SU,async getElementRects(t){let{reference:e,floating:i,strategy:r}=t;const n=this.getOffsetParent||pTt,s=this.getDimensions;return{reference:_Ji(e,await n(i),r),floating:{x:0,y:0,...await s(i)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>DE(t).direction==="rtl"};function bJi(t,e,i,r){r===void 0&&(r={});const{ancestorScroll:n=!0,ancestorResize:s=!0,elementResize:o=!0,animationFrame:a=!1}=r,l=n&&!a,c=l||s?[...xS(t)?AQ(t):t.contextElement?AQ(t.contextElement):[],...AQ(e)]:[];c.forEach(x=>{l&&x.addEventListener("scroll",i,{passive:!0}),s&&x.addEventListener("resize",i)});let h=null;if(o){let x=!0;h=new ResizeObserver(()=>{x||i(),x=!1}),xS(t)&&!a&&h.observe(t),!xS(t)&&t.contextElement&&!a&&h.observe(t.contextElement),h.observe(e)}let p,y=a?T6(t):null;a&&v();function v(){const x=T6(t);y&&(x.x!==y.x||x.y!==y.y||x.width!==y.width||x.height!==y.height)&&i(),y=x,p=requestAnimationFrame(v)}return i(),()=>{var x;c.forEach(I=>{l&&I.removeEventListener("scroll",i),s&&I.removeEventListener("resize",i)}),(x=h)==null||x.disconnect(),h=null,a&&cancelAnimationFrame(p)}}const wJi=(t,e,i)=>{const r=new Map,n={platform:x5e,...i},s={...n.platform,_c:r};return qKi(t,e,{...n,platform:s})},xJi={floatingUINonChromiumPositioningFix:!0,...globalThis.calciteComponentsConfig},SJi=CJi();async function CJi(){function t(){return navigator.userAgentData}function e(){const r=t();return r?.brands?r.brands.map(({brand:n,version:s})=>`${n}/${s}`).join(" "):navigator.userAgent}function i(){const r=t();return r?.brands?!!r.brands.find(({brand:n,version:s})=>(n==="Google Chrome"||n==="Chromium")&&Number(s)>=109):!!navigator.userAgent.split(" ").find(n=>{const[s,o]=n.split("/");return s==="Chrome"&&parseInt(o)>=109})}if(xJi.floatingUINonChromiumPositioningFix&&(/firefox|safari/i.test(e())||i())){const{offsetParent:r}=await Promise.resolve().then(()=>qPr),n=x5e.getOffsetParent;x5e.getOffsetParent=s=>n(s,r)}}const fTt="data-placement",mTt=100,gTt=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end"],PQ={animation:"calcite-floating-ui-anim",animationActive:"calcite-floating-ui-anim--active"};function TJi({placement:t,flipDisabled:e,flipPlacements:i,offsetDistance:r,offsetSkidding:n,arrowEl:s,type:o}){const a=[uJi(),sJi()];if(o==="menu")return[...a,QCt({fallbackPlacements:i||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})];if(o==="popover"||o==="tooltip"){const l=[...a,aJi({mainAxis:typeof r=="number"?r:0,crossAxis:typeof n=="number"?n:0})];return t==="auto"||t==="auto-start"||t==="auto-end"?l.push(tJi({alignment:t==="auto-start"?"start":t==="auto-end"?"end":null})):e||l.push(QCt(i?{fallbackPlacements:i}:{})),s&&l.push(JKi({element:s})),l}return[]}function EJi(t,e){const i=t.filter(r=>gTt.includes(r));return i.length!==t.length&&console.warn(`${e.tagName}: Invalid value found in: flipPlacements. Try any of these: ${gTt.map(r=>`"${r}"`).join(", ").trim()}`,{el:e}),i}function IJi(t,e){const i=["left","right"];return FY(t)==="rtl"&&i.reverse(),e.replace(/leading/gi,i[0]).replace(/trailing/gi,i[1])}async function yTt(t,e,i=!1){if(t.open)return i?AJi(e):vTt(e)}const AJi=sme(vTt,mTt,{leading:!0,maxWait:mTt});async function vTt({referenceEl:t,floatingEl:e,overlayPositioning:i="absolute",placement:r,flipDisabled:n,flipPlacements:s,offsetDistance:o,offsetSkidding:a,includeArrow:l=!1,arrowEl:c,type:h}){if(!t||!e||l&&!c)return null;await SJi;const{x:p,y,placement:v,strategy:x,middlewareData:I}=await wJi(t,e,{strategy:i,placement:r==="auto"||r==="auto-start"||r==="auto-end"?void 0:IJi(e,r),middleware:TJi({placement:r,flipDisabled:n,flipPlacements:s,offsetDistance:o,offsetSkidding:a,arrowEl:c,type:h})});if(I?.arrow){const{x:V,y:Y}=I.arrow;Object.assign(c.style,{left:V!=null?`${V}px`:"",top:Y!=null?`${Y}px`:""})}const F=I?.hide?.referenceHidden?"hidden":null,k=F?"none":null;e.setAttribute(fTt,v);const j=`translate(${Math.round(p)}px,${Math.round(y)}px)`;Object.assign(e.style,{visibility:F,pointerEvents:k,position:x,top:"0",left:"0",transform:j})}const S5e=new WeakMap;function _Tt(t,e,i){if(!i||!e)return;C5e(t,e,i);const r=t.overlayPositioning;Object.assign(i.style,{visibility:"hidden",pointerEvents:"none",position:r}),r==="absolute"&&STt(i);const n=bJi;S5e.set(t,n(e,i,()=>t.reposition()))}function C5e(t,e,i){if(!i||!e)return;T5e(i).removeEventListener("transitionend",E5e);const r=S5e.get(t);r&&r(),S5e.delete(t)}const bTt=4,wTt=Math.ceil(Math.hypot(bTt,bTt));function xTt(t){!t||t.style.position!=="absolute"||T5e(t).addEventListener("transitionend",E5e)}function T5e(t){return t.shadowRoot||t}function E5e(t){const e=t.target;if(t.propertyName==="opacity"&&e.classList.contains(PQ.animation)){const i=PJi(e);STt(i),T5e(i).removeEventListener("transitionend",E5e)}}function STt(t){t.style.transform="",t.style.top="0",t.style.left="0"}function PJi(t){return qB(t,`[${fTt}]`)}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 *//*! * focus-trap 7.2.0 * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE -*/function NCt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function $Ct(t){for(var e=1;e0){var r=e[e.length-1];r!==i&&r.pause()}var n=e.indexOf(i);n===-1||e.splice(n,1),e.push(i)},deactivateTrap:function(e,i){var r=e.indexOf(i);r!==-1&&e.splice(r,1),e.length>0&&e[e.length-1].unpause()}},PKi=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},OKi=function(e){return e.key==="Escape"||e.key==="Esc"||e.keyCode===27},TQ=function(e){return e.key==="Tab"||e.keyCode===9},RKi=function(e){return TQ(e)&&!e.shiftKey},MKi=function(e){return TQ(e)&&e.shiftKey},GCt=function(e){return setTimeout(e,0)},VCt=function(e,i){var r=-1;return e.every(function(n,s){return i(n)?(r=s,!1):!0}),r},EQ=function(e){for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n1?fe-1:0),_e=1;_e=0)te=r.activeElement;else{var re=o.tabbableGroups[0],fe=re&&re.firstTabbableNode;te=fe||d("fallbackFocus")}if(!te)throw new Error("Your focus-trap needs to have at least one focusable element");return te},y=function(){if(o.containerGroups=o.containers.map(function(te){var re=vet(te,s.tabbableOptions),fe=gii(te,s.tabbableOptions);return{container:te,tabbableNodes:re,focusableNodes:fe,firstTabbableNode:re.length>0?re[0]:null,lastTabbableNode:re.length>0?re[re.length-1]:null,nextTabbableNode:function(_e){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ke=fe.findIndex(function(Ne){return Ne===_e});if(!(ke<0))return Ie?fe.slice(ke+1).find(function(Ne){return fle(Ne,s.tabbableOptions)}):fe.slice(0,ke).reverse().find(function(Ne){return fle(Ne,s.tabbableOptions)})}}}),o.tabbableGroups=o.containerGroups.filter(function(te){return te.tabbableNodes.length>0}),o.tabbableGroups.length<=0&&!d("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},v=function X(te){if(te!==!1&&te!==r.activeElement){if(!te||!te.focus){X(p());return}te.focus({preventScroll:!!s.preventScroll}),o.mostRecentlyFocusedNode=te,PKi(te)&&te.select()}},S=function(te){var re=d("setReturnFocus",te);return re||(re===!1?!1:te)},I=function(te){var re=lme(te);if(!(c(re)>=0)){if(EQ(s.clickOutsideDeactivates,te)){a.deactivate({returnFocus:s.returnFocusOnDeactivate&&!MEe(re,s.tabbableOptions)});return}EQ(s.allowOutsideClick,te)||te.preventDefault()}},O=function(te){var re=lme(te),fe=c(re)>=0;fe||re instanceof Document?fe&&(o.mostRecentlyFocusedNode=re):(te.stopImmediatePropagation(),v(o.mostRecentlyFocusedNode||p()))},L=function(te){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,fe=lme(te);y();var ge=null;if(o.tabbableGroups.length>0){var _e=c(fe),Ie=_e>=0?o.containerGroups[_e]:void 0;if(_e<0)re?ge=o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:ge=o.tabbableGroups[0].firstTabbableNode;else if(re){var ke=VCt(o.tabbableGroups,function(Oe){var Ae=Oe.firstTabbableNode;return fe===Ae});if(ke<0&&(Ie.container===fe||MEe(fe,s.tabbableOptions)&&!fle(fe,s.tabbableOptions)&&!Ie.nextTabbableNode(fe,!1))&&(ke=_e),ke>=0){var Ne=ke===0?o.tabbableGroups.length-1:ke-1,J=o.tabbableGroups[Ne];ge=J.lastTabbableNode}else TQ(te)||(ge=Ie.nextTabbableNode(fe,!1))}else{var he=VCt(o.tabbableGroups,function(Oe){var Ae=Oe.lastTabbableNode;return fe===Ae});if(he<0&&(Ie.container===fe||MEe(fe,s.tabbableOptions)&&!fle(fe,s.tabbableOptions)&&!Ie.nextTabbableNode(fe))&&(he=_e),he>=0){var xe=he===o.tabbableGroups.length-1?0:he+1,Pe=o.tabbableGroups[xe];ge=Pe.firstTabbableNode}else TQ(te)||(ge=Ie.nextTabbableNode(fe))}}else ge=d("fallbackFocus");ge&&(TQ(te)&&te.preventDefault(),v(ge))},N=function(te){if(OKi(te)&&EQ(s.escapeDeactivates,te)!==!1){te.preventDefault(),a.deactivate();return}(s.isKeyForward(te)||s.isKeyBackward(te))&&L(te,s.isKeyBackward(te))},G=function(te){var re=lme(te);c(re)>=0||EQ(s.clickOutsideDeactivates,te)||EQ(s.allowOutsideClick,te)||(te.preventDefault(),te.stopImmediatePropagation())},V=function(){if(o.active)return BCt.activateTrap(n,a),o.delayInitialFocusTimer=s.delayInitialFocus?GCt(function(){v(p())}):v(p()),r.addEventListener("focusin",O,!0),r.addEventListener("mousedown",I,{capture:!0,passive:!1}),r.addEventListener("touchstart",I,{capture:!0,passive:!1}),r.addEventListener("click",G,{capture:!0,passive:!1}),r.addEventListener("keydown",N,{capture:!0,passive:!1}),a},Y=function(){if(o.active)return r.removeEventListener("focusin",O,!0),r.removeEventListener("mousedown",I,!0),r.removeEventListener("touchstart",I,!0),r.removeEventListener("click",G,!0),r.removeEventListener("keydown",N,!0),a};return a={get active(){return o.active},get paused(){return o.paused},activate:function(te){if(o.active)return this;var re=l(te,"onActivate"),fe=l(te,"onPostActivate"),ge=l(te,"checkCanFocusTrap");ge||y(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,re&&re();var _e=function(){ge&&y(),V(),fe&&fe()};return ge?(ge(o.containers.concat()).then(_e,_e),this):(_e(),this)},deactivate:function(te){if(!o.active)return this;var re=$Ct({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},te);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,Y(),o.active=!1,o.paused=!1,BCt.deactivateTrap(n,a);var fe=l(re,"onDeactivate"),ge=l(re,"onPostDeactivate"),_e=l(re,"checkCanReturnFocus"),Ie=l(re,"returnFocus","returnFocusOnDeactivate");fe&&fe();var ke=function(){GCt(function(){Ie&&v(S(o.nodeFocusedBeforeActivation)),ge&&ge()})};return Ie&&_e?(_e(S(o.nodeFocusedBeforeActivation)).then(ke,ke),this):(ke(),this)},pause:function(){return o.paused||!o.active?this:(o.paused=!0,Y(),this)},unpause:function(){return!o.paused||!o.active?this:(o.paused=!1,y(),V(),this)},updateContainerElements:function(te){var re=[].concat(te).filter(Boolean);return o.containers=re.map(function(fe){return typeof fe=="string"?r.querySelector(fe):fe}),o.active&&y(),this}},a.updateContainerElements(e),a};const LKi=[];function kKi(t){const{focusTrapEl:e}=t;if(!e)return;e.tabIndex==null&&(e.tabIndex=-1);const i={clickOutsideDeactivates:!0,document:e.ownerDocument,escapeDeactivates:!1,fallbackFocus:e,setReturnFocus:r=>(Tet(r),!1),tabbableOptions:_et,trapStack:LKi};t.focusTrap=FKi(e,i)}function UCt(t){t.focusTrapDisabled||t.focusTrap?.activate()}function s5e(t){t.focusTrap?.deactivate()}function NKi(t){t.focusTrap?.updateContainerElements(t.focusTrapEl)}/*! +*/function CTt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function TTt(t){for(var e=1;e0){var r=e[e.length-1];r!==i&&r.pause()}var n=e.indexOf(i);n===-1||e.splice(n,1),e.push(i)},deactivateTrap:function(e,i){var r=e.indexOf(i);r!==-1&&e.splice(r,1),e.length>0&&e[e.length-1].unpause()}},DJi=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},FJi=function(e){return e.key==="Escape"||e.key==="Esc"||e.keyCode===27},OQ=function(e){return e.key==="Tab"||e.keyCode===9},LJi=function(e){return OQ(e)&&!e.shiftKey},NJi=function(e){return OQ(e)&&e.shiftKey},ITt=function(e){return setTimeout(e,0)},ATt=function(e,i){var r=-1;return e.every(function(n,s){return i(n)?(r=s,!1):!0}),r},RQ=function(e){for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n1?ce-1:0),_e=1;_e=0)Z=r.activeElement;else{var ie=o.tabbableGroups[0],ce=ie&&ie.firstTabbableNode;Z=ce||h("fallbackFocus")}if(!Z)throw new Error("Your focus-trap needs to have at least one focusable element");return Z},y=function(){if(o.containerGroups=o.containers.map(function(Z){var ie=wet(Z,s.tabbableOptions),ce=Bii(Z,s.tabbableOptions);return{container:Z,tabbableNodes:ie,focusableNodes:ce,firstTabbableNode:ie.length>0?ie[0]:null,lastTabbableNode:ie.length>0?ie[ie.length-1]:null,nextTabbableNode:function(_e){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Pe=ce.findIndex(function(ke){return ke===_e});if(!(Pe<0))return xe?ce.slice(Pe+1).find(function(ke){return hle(ke,s.tabbableOptions)}):ce.slice(0,Pe).reverse().find(function(ke){return hle(ke,s.tabbableOptions)})}}}),o.tabbableGroups=o.containerGroups.filter(function(Z){return Z.tabbableNodes.length>0}),o.tabbableGroups.length<=0&&!h("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},v=function X(Z){if(Z!==!1&&Z!==r.activeElement){if(!Z||!Z.focus){X(p());return}Z.focus({preventScroll:!!s.preventScroll}),o.mostRecentlyFocusedNode=Z,DJi(Z)&&Z.select()}},x=function(Z){var ie=h("setReturnFocus",Z);return ie||(ie===!1?!1:Z)},I=function(Z){var ie=Dme(Z);if(!(c(ie)>=0)){if(RQ(s.clickOutsideDeactivates,Z)){a.deactivate({returnFocus:s.returnFocusOnDeactivate&&!NEe(ie,s.tabbableOptions)});return}RQ(s.allowOutsideClick,Z)||Z.preventDefault()}},P=function(Z){var ie=Dme(Z),ce=c(ie)>=0;ce||ie instanceof Document?ce&&(o.mostRecentlyFocusedNode=ie):(Z.stopImmediatePropagation(),v(o.mostRecentlyFocusedNode||p()))},F=function(Z){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=Dme(Z);y();var he=null;if(o.tabbableGroups.length>0){var _e=c(ce),xe=_e>=0?o.containerGroups[_e]:void 0;if(_e<0)ie?he=o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:he=o.tabbableGroups[0].firstTabbableNode;else if(ie){var Pe=ATt(o.tabbableGroups,function(Re){var Oe=Re.firstTabbableNode;return ce===Oe});if(Pe<0&&(xe.container===ce||NEe(ce,s.tabbableOptions)&&!hle(ce,s.tabbableOptions)&&!xe.nextTabbableNode(ce,!1))&&(Pe=_e),Pe>=0){var ke=Pe===0?o.tabbableGroups.length-1:Pe-1,J=o.tabbableGroups[ke];he=J.lastTabbableNode}else OQ(Z)||(he=xe.nextTabbableNode(ce,!1))}else{var de=ATt(o.tabbableGroups,function(Re){var Oe=Re.lastTabbableNode;return ce===Oe});if(de<0&&(xe.container===ce||NEe(ce,s.tabbableOptions)&&!hle(ce,s.tabbableOptions)&&!xe.nextTabbableNode(ce))&&(de=_e),de>=0){var Se=de===o.tabbableGroups.length-1?0:de+1,Ie=o.tabbableGroups[Se];he=Ie.firstTabbableNode}else OQ(Z)||(he=xe.nextTabbableNode(ce))}}else he=h("fallbackFocus");he&&(OQ(Z)&&Z.preventDefault(),v(he))},k=function(Z){if(FJi(Z)&&RQ(s.escapeDeactivates,Z)!==!1){Z.preventDefault(),a.deactivate();return}(s.isKeyForward(Z)||s.isKeyBackward(Z))&&F(Z,s.isKeyBackward(Z))},j=function(Z){var ie=Dme(Z);c(ie)>=0||RQ(s.clickOutsideDeactivates,Z)||RQ(s.allowOutsideClick,Z)||(Z.preventDefault(),Z.stopImmediatePropagation())},V=function(){if(o.active)return ETt.activateTrap(n,a),o.delayInitialFocusTimer=s.delayInitialFocus?ITt(function(){v(p())}):v(p()),r.addEventListener("focusin",P,!0),r.addEventListener("mousedown",I,{capture:!0,passive:!1}),r.addEventListener("touchstart",I,{capture:!0,passive:!1}),r.addEventListener("click",j,{capture:!0,passive:!1}),r.addEventListener("keydown",k,{capture:!0,passive:!1}),a},Y=function(){if(o.active)return r.removeEventListener("focusin",P,!0),r.removeEventListener("mousedown",I,!0),r.removeEventListener("touchstart",I,!0),r.removeEventListener("click",j,!0),r.removeEventListener("keydown",k,!0),a};return a={get active(){return o.active},get paused(){return o.paused},activate:function(Z){if(o.active)return this;var ie=l(Z,"onActivate"),ce=l(Z,"onPostActivate"),he=l(Z,"checkCanFocusTrap");he||y(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,ie&&ie();var _e=function(){he&&y(),V(),ce&&ce()};return he?(he(o.containers.concat()).then(_e,_e),this):(_e(),this)},deactivate:function(Z){if(!o.active)return this;var ie=TTt({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},Z);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,Y(),o.active=!1,o.paused=!1,ETt.deactivateTrap(n,a);var ce=l(ie,"onDeactivate"),he=l(ie,"onPostDeactivate"),_e=l(ie,"checkCanReturnFocus"),xe=l(ie,"returnFocus","returnFocusOnDeactivate");ce&&ce();var Pe=function(){ITt(function(){xe&&v(x(o.nodeFocusedBeforeActivation)),he&&he()})};return xe&&_e?(_e(x(o.nodeFocusedBeforeActivation)).then(Pe,Pe),this):(Pe(),this)},pause:function(){return o.paused||!o.active?this:(o.paused=!0,Y(),this)},unpause:function(){return!o.paused||!o.active?this:(o.paused=!1,y(),V(),this)},updateContainerElements:function(Z){var ie=[].concat(Z).filter(Boolean);return o.containers=ie.map(function(ce){return typeof ce=="string"?r.querySelector(ce):ce}),o.active&&y(),this}},a.updateContainerElements(e),a};const BJi=[];function VJi(t){const{focusTrapEl:e}=t;if(!e)return;e.tabIndex==null&&(e.tabIndex=-1);const i={clickOutsideDeactivates:!0,document:e.ownerDocument,escapeDeactivates:!1,fallbackFocus:e,setReturnFocus:r=>(Aet(r),!1),tabbableOptions:xet,trapStack:BJi};t.focusTrap=$Ji(e,i)}function PTt(t){t.focusTrapDisabled||t.focusTrap?.activate()}function I5e(t){t.focusTrap?.deactivate()}function jJi(t){t.focusTrap?.updateContainerElements(t.focusTrapEl)}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const ume=new WeakMap;function $Ki(t){t.propertyName===this.openTransitionProp&&t.target===this.transitionEl&&(this.open?this.onBeforeOpen():this.onBeforeClose())}function BKi(t){t.propertyName===this.openTransitionProp&&t.target===this.transitionEl&&(this.open?this.onOpen():this.onClose())}function cme(t){if(o5e(t),t.transitionEl){const e=$Ki.bind(t),i=BKi.bind(t);ume.set(t,[t.transitionEl,e,i]),t.transitionEl.addEventListener("transitionstart",e),t.transitionEl.addEventListener("transitionend",i)}}function o5e(t){if(!ume.has(t))return;const[e,i,r]=ume.get(t);e.removeEventListener("transitionstart",i),e.removeEventListener("transitionend",r),ume.delete(t)}/*! + */const Fme=new WeakMap;function GJi(t){t.propertyName===this.openTransitionProp&&t.target===this.transitionEl&&(this.open?this.onBeforeOpen():this.onBeforeClose())}function UJi(t){t.propertyName===this.openTransitionProp&&t.target===this.transitionEl&&(this.open?this.onOpen():this.onClose())}function Lme(t){if(A5e(t),t.transitionEl){const e=GJi.bind(t),i=UJi.bind(t);Fme.set(t,[t.transitionEl,e,i]),t.transitionEl.addEventListener("transitionstart",e),t.transitionEl.addEventListener("transitionend",i)}}function A5e(t){if(!Fme.has(t))return;const[e,i,r]=Fme.get(t);e.removeEventListener("transitionstart",i),e.removeEventListener("transitionend",r),Fme.delete(t)}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const jCt=(t,e)=>{const i=t.level?`h${t.level}`:"div";return delete t.level,dr(i,{...t},e)};/*! + */const OTt=(t,e)=>{const i=t.level?`h${t.level}`:"div";return delete t.level,br(i,{...t},e)};/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const DE={container:"container",arrow:"arrow",imageContainer:"image-container",closeButtonContainer:"close-button-container",closeButton:"close-button",content:"content",hasHeader:"has-header",header:"header",headerContent:"header-content",heading:"heading"},GKi="auto",zCt="aria-controls",HCt="aria-expanded";class VKi{constructor(){this.registeredElements=new Map,this.registeredElementCount=0,this.queryPopover=e=>{const{registeredElements:i}=this,r=e.find(n=>i.has(n));return i.get(r)},this.togglePopovers=e=>{const i=e.composedPath(),r=this.queryPopover(i);r&&!r.triggerDisabled&&(r.open=!r.open),Array.from(this.registeredElements.values()).filter(n=>n!==r&&n.autoClose&&n.open&&!i.includes(n)).forEach(n=>n.open=!1)},this.keyHandler=e=>{e.defaultPrevented||(e.key==="Escape"?this.closeAllPopovers():s2t(e.key)&&this.togglePopovers(e))},this.clickHandler=e=>{NY(e)&&this.togglePopovers(e)}}registerElement(e,i){this.registeredElementCount++,this.registeredElements.set(e,i),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}closeAllPopovers(){Array.from(this.registeredElements.values()).forEach(e=>e.open=!1)}addListeners(){document.addEventListener("pointerdown",this.clickHandler,{capture:!0}),document.addEventListener("keydown",this.keyHandler,{capture:!0})}removeListeners(){document.removeEventListener("pointerdown",this.clickHandler,{capture:!0}),document.removeEventListener("keydown",this.keyHandler,{capture:!0})}}const UKi='@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{--calcite-floating-ui-z-index:var(--calcite-popover-z-index, 900);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:1;border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{transform:translateY(-5px)}:host([data-placement^=top]) .calcite-floating-ui-anim{transform:translateY(5px)}:host([data-placement^=left]) .calcite-floating-ui-anim{transform:translateX(5px)}:host([data-placement^=right]) .calcite-floating-ui-anim{transform:translateX(-5px)}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.arrow,.arrow::before{position:absolute;inline-size:8px;block-size:8px;z-index:-1}.arrow::before{content:"";--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transform:rotate(45deg);background:var(--calcite-ui-foreground-1)}:host([data-placement^=top]) .arrow{inset-block-end:-4px}:host([data-placement^=bottom]) .arrow{inset-block-start:-4px}:host([data-placement^=right]) .arrow,:host([data-placement^=left]) .arrow{direction:ltr;text-align:start}:host([data-placement^=left]) .arrow{inset-inline-end:-4px}:host([data-placement^=right]) .arrow{inset-inline-start:-4px}:host([scale=s]) .heading{padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .heading{padding-inline:1rem;padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .heading{padding-inline:1.25rem;padding-block:1rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host{pointer-events:none}:host([open]){pointer-events:initial}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);background-color:var(--calcite-ui-foreground-1)}.arrow::before{outline:1px solid var(--calcite-ui-border-3)}.header{display:flex;flex:1 1 auto;align-items:stretch;justify-content:flex-start;border-width:0px;border-block-end-width:1px;border-style:solid;background-color:var(--calcite-ui-foreground-1);border-block-end-color:var(--calcite-ui-border-3)}.heading{margin:0px;display:block;flex:1 1 auto;align-self:center;white-space:normal;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);word-wrap:break-word;word-break:break-word}.container{position:relative;display:flex;block-size:100%;flex-direction:row;flex-wrap:nowrap;border-radius:0.25rem;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-1)}.container.has-header{flex-direction:column}.content{display:flex;block-size:100%;inline-size:100%;flex-direction:column;flex-wrap:nowrap;align-self:center;word-wrap:break-word;word-break:break-word}.close-button-container{display:flex;overflow:hidden;flex:0 0 auto;border-start-end-radius:0.25rem;border-end-end-radius:0.25rem}::slotted(calcite-panel),::slotted(calcite-flow){block-size:100%}',WCt=new VKi,jKi=h0(class extends d0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calcitePopoverBeforeClose=Wh(this,"calcitePopoverBeforeClose",6),this.calcitePopoverClose=Wh(this,"calcitePopoverClose",6),this.calcitePopoverBeforeOpen=Wh(this,"calcitePopoverBeforeOpen",6),this.calcitePopoverOpen=Wh(this,"calcitePopoverOpen",6),this.guid=`calcite-popover-${DY()}`,this.openTransitionProp="opacity",this.hasLoaded=!1,this.setTransitionEl=t=>{this.transitionEl=t,cme(this),this.focusTrapEl=t,kKi(this)},this.setFilteredPlacements=()=>{const{el:t,flipPlacements:e}=this;this.filteredFlipPlacements=e?xKi(e,t):null},this.setUpReferenceElement=(t=!0)=>{this.removeReferences(),this.effectiveReferenceElement=this.getReferenceElement(),MCt(this,this.effectiveReferenceElement,this.el);const{el:e,referenceElement:i,effectiveReferenceElement:r}=this;t&&i&&!r&&console.warn(`${e.tagName}: reference-element id "${i}" was not found.`,{el:e}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.setExpandedAttr=()=>{const{effectiveReferenceElement:t,open:e}=this;t&&"setAttribute"in t&&t.setAttribute(HCt,yw(e))},this.addReferences=()=>{const{effectiveReferenceElement:t}=this;if(!t)return;const e=this.getId();"setAttribute"in t&&t.setAttribute(zCt,e),WCt.registerElement(t,this.el),this.setExpandedAttr()},this.removeReferences=()=>{const{effectiveReferenceElement:t}=this;t&&("removeAttribute"in t&&(t.removeAttribute(zCt),t.removeAttribute(HCt)),WCt.unregisterElement(t))},this.hide=()=>{this.open=!1},this.storeArrowEl=t=>{this.arrowEl=t,this.reposition(!0)},this.autoClose=!1,this.closable=!1,this.flipDisabled=!1,this.focusTrapDisabled=!1,this.pointerDisabled=!1,this.flipPlacements=void 0,this.heading=void 0,this.headingLevel=void 0,this.label=void 0,this.messageOverrides=void 0,this.messages=void 0,this.offsetDistance=FCt,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement=GKi,this.referenceElement=void 0,this.scale="m",this.triggerDisabled=!1,this.effectiveLocale="",this.effectiveReferenceElement=void 0,this.defaultMessages=void 0}handlefocusTrapDisabled(t){this.open&&(t?s5e(this):UCt(this))}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}onMessagesChange(){}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(t){t?this.reposition(!0):LCt(this.el),this.setExpandedAttr()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement(),this.reposition(!0)}effectiveLocaleChange(){dF(this,this.effectiveLocale)}connectedCallback(){this.setFilteredPlacements(),uF(this),pF(this),cme(this),this.setUpReferenceElement(this.hasLoaded)}async componentWillLoad(){await hF(this),SE(this)}componentDidLoad(){CE(this),this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement(),this.reposition(),this.hasLoaded=!0}disconnectedCallback(){this.removeReferences(),cF(this),fF(this),i5e(this,this.effectiveReferenceElement,this.el),o5e(this),s5e(this)}async reposition(t=!1){const{el:e,effectiveReferenceElement:i,placement:r,overlayPositioning:n,flipDisabled:s,filteredFlipPlacements:o,offsetDistance:a,offsetSkidding:l,arrowEl:c}=this;return OCt(this,{floatingEl:e,referenceEl:i,overlayPositioning:n,placement:r,flipDisabled:s,flipPlacements:o,offsetDistance:a,offsetSkidding:l,includeArrow:!this.pointerDisabled,arrowEl:c,type:"popover"},t)}async setFocus(){await TE(this),AEe(this.el),Eet(this.focusTrapEl)}async updateFocusTrapElements(){NKi(this)}getReferenceElement(){const{referenceElement:t,el:e}=this;return(typeof t=="string"?DEe(e,{id:t}):t)||null}onBeforeOpen(){this.calcitePopoverBeforeOpen.emit()}onOpen(){this.calcitePopoverOpen.emit(),UCt(this)}onBeforeClose(){this.calcitePopoverBeforeClose.emit()}onClose(){this.calcitePopoverClose.emit(),s5e(this)}renderCloseButton(){const{messages:t,closable:e}=this;return e?dr("div",{class:DE.closeButtonContainer,key:DE.closeButtonContainer},dr("calcite-action",{class:DE.closeButton,onClick:this.hide,ref:i=>this.closeButtonEl=i,scale:this.scale,text:t.close},dr("calcite-icon",{icon:"x",scale:this.scale==="l"?"m":this.scale}))):null}renderHeader(){const{heading:t,headingLevel:e}=this,i=t?dr(jCt,{class:DE.heading,level:e},t):null;return i?dr("div",{class:DE.header,key:DE.header},i,this.renderCloseButton()):null}render(){const{effectiveReferenceElement:t,heading:e,label:i,open:r,pointerDisabled:n}=this,s=t&&r,o=!s,a=n?null:dr("div",{class:DE.arrow,ref:this.storeArrowEl});return dr(YA,{"aria-hidden":yw(o),"aria-label":i,"aria-live":"polite","calcite-hydrated-hidden":o,id:this.getId(),role:"dialog"},dr("div",{class:{[CQ.animation]:!0,[CQ.animationActive]:s},ref:this.setTransitionEl},a,dr("div",{class:{[DE.hasHeader]:!!e,[DE.container]:!0}},this.renderHeader(),dr("div",{class:DE.content},dr("slot",null)),e?null:this.renderCloseButton())))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{focusTrapDisabled:["handlefocusTrapDisabled"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return UKi}},[1,"calcite-popover",{autoClose:[516,"auto-close"],closable:[1540],flipDisabled:[516,"flip-disabled"],focusTrapDisabled:[516,"focus-trap-disabled"],pointerDisabled:[516,"pointer-disabled"],flipPlacements:[16],heading:[1],headingLevel:[514,"heading-level"],label:[1],messageOverrides:[1040],messages:[1040],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],scale:[513],triggerDisabled:[516,"trigger-disabled"],effectiveLocale:[32],effectiveReferenceElement:[32],defaultMessages:[32],reposition:[64],setFocus:[64],updateFocusTrapElements:[64]}]);function hme(){if(typeof customElements>"u")return;["calcite-popover","calcite-action","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-popover":customElements.get(e)||customElements.define(e,jKi);break;case"calcite-action":customElements.get(e)||mj();break;case"calcite-icon":customElements.get(e)||ox();break;case"calcite-loader":customElements.get(e)||mF();break}})}hme();/*! + */const LE={container:"container",arrow:"arrow",imageContainer:"image-container",closeButtonContainer:"close-button-container",closeButton:"close-button",content:"content",hasHeader:"has-header",header:"header",headerContent:"header-content",heading:"heading"},zJi="auto",RTt="aria-controls",MTt="aria-expanded";class HJi{constructor(){this.registeredElements=new Map,this.registeredElementCount=0,this.queryPopover=e=>{const{registeredElements:i}=this,r=e.find(n=>i.has(n));return i.get(r)},this.togglePopovers=e=>{const i=e.composedPath(),r=this.queryPopover(i);r&&!r.triggerDisabled&&(r.open=!r.open),Array.from(this.registeredElements.values()).filter(n=>n!==r&&n.autoClose&&n.open&&!i.includes(n)).forEach(n=>n.open=!1)},this.keyHandler=e=>{e.defaultPrevented||(e.key==="Escape"?this.closeAllPopovers():W2t(e.key)&&this.togglePopovers(e))},this.clickHandler=e=>{kY(e)&&this.togglePopovers(e)}}registerElement(e,i){this.registeredElementCount++,this.registeredElements.set(e,i),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}closeAllPopovers(){Array.from(this.registeredElements.values()).forEach(e=>e.open=!1)}addListeners(){document.addEventListener("pointerdown",this.clickHandler,{capture:!0}),document.addEventListener("keydown",this.keyHandler,{capture:!0})}removeListeners(){document.removeEventListener("pointerdown",this.clickHandler,{capture:!0}),document.removeEventListener("keydown",this.keyHandler,{capture:!0})}}const WJi='@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{--calcite-floating-ui-z-index:var(--calcite-popover-z-index, 900);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:1;border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{transform:translateY(-5px)}:host([data-placement^=top]) .calcite-floating-ui-anim{transform:translateY(5px)}:host([data-placement^=left]) .calcite-floating-ui-anim{transform:translateX(5px)}:host([data-placement^=right]) .calcite-floating-ui-anim{transform:translateX(-5px)}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.arrow,.arrow::before{position:absolute;inline-size:8px;block-size:8px;z-index:-1}.arrow::before{content:"";--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transform:rotate(45deg);background:var(--calcite-ui-foreground-1)}:host([data-placement^=top]) .arrow{inset-block-end:-4px}:host([data-placement^=bottom]) .arrow{inset-block-start:-4px}:host([data-placement^=right]) .arrow,:host([data-placement^=left]) .arrow{direction:ltr;text-align:start}:host([data-placement^=left]) .arrow{inset-inline-end:-4px}:host([data-placement^=right]) .arrow{inset-inline-start:-4px}:host([scale=s]) .heading{padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .heading{padding-inline:1rem;padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .heading{padding-inline:1.25rem;padding-block:1rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host{pointer-events:none}:host([open]){pointer-events:initial}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);background-color:var(--calcite-ui-foreground-1)}.arrow::before{outline:1px solid var(--calcite-ui-border-3)}.header{display:flex;flex:1 1 auto;align-items:stretch;justify-content:flex-start;border-width:0px;border-block-end-width:1px;border-style:solid;background-color:var(--calcite-ui-foreground-1);border-block-end-color:var(--calcite-ui-border-3)}.heading{margin:0px;display:block;flex:1 1 auto;align-self:center;white-space:normal;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);word-wrap:break-word;word-break:break-word}.container{position:relative;display:flex;block-size:100%;flex-direction:row;flex-wrap:nowrap;border-radius:0.25rem;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-1)}.container.has-header{flex-direction:column}.content{display:flex;block-size:100%;inline-size:100%;flex-direction:column;flex-wrap:nowrap;align-self:center;word-wrap:break-word;word-break:break-word}.close-button-container{display:flex;overflow:hidden;flex:0 0 auto;border-start-end-radius:0.25rem;border-end-end-radius:0.25rem}::slotted(calcite-panel),::slotted(calcite-flow){block-size:100%}',DTt=new HJi,qJi=d0(class extends p0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calcitePopoverBeforeClose=Xh(this,"calcitePopoverBeforeClose",6),this.calcitePopoverClose=Xh(this,"calcitePopoverClose",6),this.calcitePopoverBeforeOpen=Xh(this,"calcitePopoverBeforeOpen",6),this.calcitePopoverOpen=Xh(this,"calcitePopoverOpen",6),this.guid=`calcite-popover-${DY()}`,this.openTransitionProp="opacity",this.hasLoaded=!1,this.setTransitionEl=t=>{this.transitionEl=t,Lme(this),this.focusTrapEl=t,VJi(this)},this.setFilteredPlacements=()=>{const{el:t,flipPlacements:e}=this;this.filteredFlipPlacements=e?EJi(e,t):null},this.setUpReferenceElement=(t=!0)=>{this.removeReferences(),this.effectiveReferenceElement=this.getReferenceElement(),_Tt(this,this.effectiveReferenceElement,this.el);const{el:e,referenceElement:i,effectiveReferenceElement:r}=this;t&&i&&!r&&console.warn(`${e.tagName}: reference-element id "${i}" was not found.`,{el:e}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.setExpandedAttr=()=>{const{effectiveReferenceElement:t,open:e}=this;t&&"setAttribute"in t&&t.setAttribute(MTt,bw(e))},this.addReferences=()=>{const{effectiveReferenceElement:t}=this;if(!t)return;const e=this.getId();"setAttribute"in t&&t.setAttribute(RTt,e),DTt.registerElement(t,this.el),this.setExpandedAttr()},this.removeReferences=()=>{const{effectiveReferenceElement:t}=this;t&&("removeAttribute"in t&&(t.removeAttribute(RTt),t.removeAttribute(MTt)),DTt.unregisterElement(t))},this.hide=()=>{this.open=!1},this.storeArrowEl=t=>{this.arrowEl=t,this.reposition(!0)},this.autoClose=!1,this.closable=!1,this.flipDisabled=!1,this.focusTrapDisabled=!1,this.pointerDisabled=!1,this.flipPlacements=void 0,this.heading=void 0,this.headingLevel=void 0,this.label=void 0,this.messageOverrides=void 0,this.messages=void 0,this.offsetDistance=wTt,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement=zJi,this.referenceElement=void 0,this.scale="m",this.triggerDisabled=!1,this.effectiveLocale="",this.effectiveReferenceElement=void 0,this.defaultMessages=void 0}handlefocusTrapDisabled(t){this.open&&(t?I5e(this):PTt(this))}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}onMessagesChange(){}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(t){t?this.reposition(!0):xTt(this.el),this.setExpandedAttr()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement(),this.reposition(!0)}effectiveLocaleChange(){mF(this,this.effectiveLocale)}connectedCallback(){this.setFilteredPlacements(),dF(this),gF(this),Lme(this),this.setUpReferenceElement(this.hasLoaded)}async componentWillLoad(){await fF(this),TE(this)}componentDidLoad(){EE(this),this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement(),this.reposition(),this.hasLoaded=!0}disconnectedCallback(){this.removeReferences(),pF(this),yF(this),C5e(this,this.effectiveReferenceElement,this.el),A5e(this),I5e(this)}async reposition(t=!1){const{el:e,effectiveReferenceElement:i,placement:r,overlayPositioning:n,flipDisabled:s,filteredFlipPlacements:o,offsetDistance:a,offsetSkidding:l,arrowEl:c}=this;return yTt(this,{floatingEl:e,referenceEl:i,overlayPositioning:n,placement:r,flipDisabled:s,flipPlacements:o,offsetDistance:a,offsetSkidding:l,includeArrow:!this.pointerDisabled,arrowEl:c,type:"popover"},t)}async setFocus(){await IE(this),MEe(this.el),Pet(this.focusTrapEl)}async updateFocusTrapElements(){jJi(this)}getReferenceElement(){const{referenceElement:t,el:e}=this;return(typeof t=="string"?kEe(e,{id:t}):t)||null}onBeforeOpen(){this.calcitePopoverBeforeOpen.emit()}onOpen(){this.calcitePopoverOpen.emit(),PTt(this)}onBeforeClose(){this.calcitePopoverBeforeClose.emit()}onClose(){this.calcitePopoverClose.emit(),I5e(this)}renderCloseButton(){const{messages:t,closable:e}=this;return e?br("div",{class:LE.closeButtonContainer,key:LE.closeButtonContainer},br("calcite-action",{class:LE.closeButton,onClick:this.hide,ref:i=>this.closeButtonEl=i,scale:this.scale,text:t.close},br("calcite-icon",{icon:"x",scale:this.scale==="l"?"m":this.scale}))):null}renderHeader(){const{heading:t,headingLevel:e}=this,i=t?br(OTt,{class:LE.heading,level:e},t):null;return i?br("div",{class:LE.header,key:LE.header},i,this.renderCloseButton()):null}render(){const{effectiveReferenceElement:t,heading:e,label:i,open:r,pointerDisabled:n}=this,s=t&&r,o=!s,a=n?null:br("div",{class:LE.arrow,ref:this.storeArrowEl});return br(qA,{"aria-hidden":bw(o),"aria-label":i,"aria-live":"polite","calcite-hydrated-hidden":o,id:this.getId(),role:"dialog"},br("div",{class:{[PQ.animation]:!0,[PQ.animationActive]:s},ref:this.setTransitionEl},a,br("div",{class:{[LE.hasHeader]:!!e,[LE.container]:!0}},this.renderHeader(),br("div",{class:LE.content},br("slot",null)),e?null:this.renderCloseButton())))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{focusTrapDisabled:["handlefocusTrapDisabled"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return WJi}},[1,"calcite-popover",{autoClose:[516,"auto-close"],closable:[1540],flipDisabled:[516,"flip-disabled"],focusTrapDisabled:[516,"focus-trap-disabled"],pointerDisabled:[516,"pointer-disabled"],flipPlacements:[16],heading:[1],headingLevel:[514,"heading-level"],label:[1],messageOverrides:[1040],messages:[1040],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],scale:[513],triggerDisabled:[516,"trigger-disabled"],effectiveLocale:[32],effectiveReferenceElement:[32],defaultMessages:[32],reposition:[64],setFocus:[64],updateFocusTrapElements:[64]}]);function Nme(){if(typeof customElements>"u")return;["calcite-popover","calcite-action","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-popover":customElements.get(e)||customElements.define(e,qJi);break;case"calcite-action":customElements.get(e)||xU();break;case"calcite-icon":customElements.get(e)||lx();break;case"calcite-loader":customElements.get(e)||vF();break}})}Nme();/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const qCt={menu:"menu",defaultTrigger:"default-trigger"},a5e={tooltip:"tooltip",trigger:"trigger"},zKi={menu:"ellipsis"},HKi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{box-sizing:border-box;display:flex;flex-direction:column;background-color:var(--calcite-ui-foreground-1);font-size:var(--calcite-font-size-1);color:var(--calcite-ui-text-2)}.menu ::slotted(calcite-action){margin:0.125rem;display:flex;outline-color:transparent}.menu ::slotted(calcite-action[active]){outline:2px solid var(--calcite-ui-brand);outline-offset:0px}.default-trigger{position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}slot[name=trigger]::slotted(calcite-action),calcite-action::slotted([slot=trigger]){position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}.menu{flex-direction:column;flex-wrap:nowrap;outline:2px solid transparent;outline-offset:2px}",WKi=["ArrowUp","ArrowDown","End","Home"],qKi=h0(class extends d0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteActionMenuOpen=Wh(this,"calciteActionMenuOpen",6),this.actionElements=[],this.guid=`calcite-action-menu-${DY()}`,this.menuId=`${this.guid}-menu`,this.menuButtonId=`${this.guid}-menu-button`,this.connectMenuButtonEl=()=>{const{menuButtonId:t,menuId:e,open:i,label:r}=this,n=this.slottedMenuButtonEl||this.defaultMenuButtonEl;this.menuButtonEl!==n&&(this.disconnectMenuButtonEl(),this.menuButtonEl=n,this.setTooltipReferenceElement(),n&&(n.active=i,n.setAttribute("aria-controls",e),n.setAttribute("aria-expanded",yw(i)),n.setAttribute("aria-haspopup","true"),n.id||(n.id=t),n.label||(n.label=r),n.text||(n.text=r),n.addEventListener("pointerdown",this.menuButtonClick),n.addEventListener("keydown",this.menuButtonKeyDown)))},this.disconnectMenuButtonEl=()=>{const{menuButtonEl:t}=this;t&&(t.removeEventListener("pointerdown",this.menuButtonClick),t.removeEventListener("keydown",this.menuButtonKeyDown))},this.setMenuButtonEl=t=>{const e=t.target.assignedElements({flatten:!0}).filter(i=>i?.matches("calcite-action"));this.slottedMenuButtonEl=e[0],this.connectMenuButtonEl()},this.setDefaultMenuButtonEl=t=>{this.defaultMenuButtonEl=t,this.connectMenuButtonEl()},this.handleCalciteActionClick=()=>{this.open=!1,this.setFocus()},this.menuButtonClick=t=>{NY(t)&&this.toggleOpen()},this.updateTooltip=t=>{const e=t.target.assignedElements({flatten:!0}).filter(i=>i?.matches("calcite-tooltip"));this.tooltipEl=e[0],this.setTooltipReferenceElement()},this.setTooltipReferenceElement=()=>{const{tooltipEl:t,expanded:e,menuButtonEl:i,open:r}=this;t&&(t.referenceElement=!e&&!r?i:null)},this.updateAction=(t,e)=>{const{guid:i,activeMenuItemIndex:r}=this,n=`${i}-action-${e}`;t.tabIndex=-1,t.setAttribute("role","menuitem"),t.id||(t.id=n),t.active=e===r},this.updateActions=t=>{t?.forEach(this.updateAction)},this.handleDefaultSlotChange=t=>{const e=t.target.assignedElements({flatten:!0}).filter(i=>i?.matches("calcite-action"));this.actionElements=e},this.menuButtonKeyDown=t=>{const{key:e}=t,{actionElements:i,activeMenuItemIndex:r,open:n}=this;if(i.length){if(s2t(e)){if(t.preventDefault(),!n){this.toggleOpen();return}const s=i[r];s?s.click():this.toggleOpen(!1)}if(e==="Tab"){this.open=!1;return}if(e==="Escape"){this.toggleOpen(!1),t.preventDefault();return}this.handleActionNavigation(t,e,i)}},this.handleActionNavigation=(t,e,i)=>{if(!this.isValidKey(e,WKi))return;if(t.preventDefault(),!this.open){this.toggleOpen(),(e==="Home"||e==="ArrowDown")&&(this.activeMenuItemIndex=0),(e==="End"||e==="ArrowUp")&&(this.activeMenuItemIndex=i.length-1);return}e==="Home"&&(this.activeMenuItemIndex=0),e==="End"&&(this.activeMenuItemIndex=i.length-1);const r=this.activeMenuItemIndex;e==="ArrowUp"&&(this.activeMenuItemIndex=sCt(Math.max(r-1,-1),i.length)),e==="ArrowDown"&&(this.activeMenuItemIndex=sCt(r+1,i.length))},this.toggleOpenEnd=()=>{this.setFocus(),this.el.removeEventListener("calcitePopoverOpen",this.toggleOpenEnd)},this.toggleOpen=(t=!this.open)=>{this.el.addEventListener("calcitePopoverOpen",this.toggleOpenEnd),this.open=t},this.expanded=!1,this.flipPlacements=void 0,this.label=void 0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.scale=void 0,this.menuButtonEl=void 0,this.activeMenuItemIndex=-1}componentWillLoad(){SE(this)}componentDidLoad(){CE(this)}disconnectedCallback(){this.disconnectMenuButtonEl()}expandedHandler(){this.open=!1,this.setTooltipReferenceElement()}openHandler(t){this.activeMenuItemIndex=this.open?0:-1,this.menuButtonEl&&(this.menuButtonEl.active=t),this.calciteActionMenuOpen.emit(),this.setTooltipReferenceElement()}closeCalciteActionMenuOnClick(t){!NY(t)||t.composedPath().includes(this.el)||(this.open=!1)}activeMenuItemIndexHandler(){this.updateActions(this.actionElements)}async setFocus(){await TE(this),Tet(this.menuButtonEl)}renderMenuButton(){const{label:t,scale:e,expanded:i}=this;return dr("slot",{name:a5e.trigger,onSlotchange:this.setMenuButtonEl},dr("calcite-action",{class:qCt.defaultTrigger,icon:zKi.menu,ref:this.setDefaultMenuButtonEl,scale:e,text:t,textEnabled:i}))}renderMenuItems(){const{actionElements:t,activeMenuItemIndex:e,open:i,menuId:r,menuButtonEl:n,label:s,placement:o,overlayPositioning:a,flipPlacements:l}=this,d=t[e]?.id||null;return dr("calcite-popover",{flipPlacements:l,focusTrapDisabled:!0,label:s,offsetDistance:0,open:i,overlayPositioning:a,placement:o,pointerDisabled:!0,referenceElement:n},dr("div",{"aria-activedescendant":d,"aria-labelledby":n?.id,class:qCt.menu,id:r,onClick:this.handleCalciteActionClick,role:"menu",tabIndex:-1},dr("slot",{onSlotchange:this.handleDefaultSlotChange})))}render(){return dr(PEe,null,this.renderMenuButton(),this.renderMenuItems(),dr("slot",{name:a5e.tooltip,onSlotchange:this.updateTooltip}))}isValidKey(t,e){return!!e.find(i=>i===t)}get el(){return this}static get watchers(){return{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}}static get style(){return HKi}},[1,"calcite-action-menu",{expanded:[516],flipPlacements:[16],label:[1],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],scale:[513],menuButtonEl:[32],activeMenuItemIndex:[32],setFocus:[64]},[[9,"pointerdown","closeCalciteActionMenuOnClick"]]]);function l5e(){if(typeof customElements>"u")return;["calcite-action-menu","calcite-action","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-menu":customElements.get(e)||customElements.define(e,qKi);break;case"calcite-action":customElements.get(e)||mj();break;case"calcite-icon":customElements.get(e)||ox();break;case"calcite-loader":customElements.get(e)||mF();break;case"calcite-popover":customElements.get(e)||hme();break}})}l5e();/*! + */const FTt={menu:"menu",defaultTrigger:"default-trigger"},P5e={tooltip:"tooltip",trigger:"trigger"},YJi={menu:"ellipsis"},XJi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{box-sizing:border-box;display:flex;flex-direction:column;background-color:var(--calcite-ui-foreground-1);font-size:var(--calcite-font-size-1);color:var(--calcite-ui-text-2)}.menu ::slotted(calcite-action){margin:0.125rem;display:flex;outline-color:transparent}.menu ::slotted(calcite-action[active]){outline:2px solid var(--calcite-ui-brand);outline-offset:0px}.default-trigger{position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}slot[name=trigger]::slotted(calcite-action),calcite-action::slotted([slot=trigger]){position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}.menu{flex-direction:column;flex-wrap:nowrap;outline:2px solid transparent;outline-offset:2px}",KJi=["ArrowUp","ArrowDown","End","Home"],JJi=d0(class extends p0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteActionMenuOpen=Xh(this,"calciteActionMenuOpen",6),this.actionElements=[],this.guid=`calcite-action-menu-${DY()}`,this.menuId=`${this.guid}-menu`,this.menuButtonId=`${this.guid}-menu-button`,this.connectMenuButtonEl=()=>{const{menuButtonId:t,menuId:e,open:i,label:r}=this,n=this.slottedMenuButtonEl||this.defaultMenuButtonEl;this.menuButtonEl!==n&&(this.disconnectMenuButtonEl(),this.menuButtonEl=n,this.setTooltipReferenceElement(),n&&(n.active=i,n.setAttribute("aria-controls",e),n.setAttribute("aria-expanded",bw(i)),n.setAttribute("aria-haspopup","true"),n.id||(n.id=t),n.label||(n.label=r),n.text||(n.text=r),n.addEventListener("pointerdown",this.menuButtonClick),n.addEventListener("keydown",this.menuButtonKeyDown)))},this.disconnectMenuButtonEl=()=>{const{menuButtonEl:t}=this;t&&(t.removeEventListener("pointerdown",this.menuButtonClick),t.removeEventListener("keydown",this.menuButtonKeyDown))},this.setMenuButtonEl=t=>{const e=t.target.assignedElements({flatten:!0}).filter(i=>i?.matches("calcite-action"));this.slottedMenuButtonEl=e[0],this.connectMenuButtonEl()},this.setDefaultMenuButtonEl=t=>{this.defaultMenuButtonEl=t,this.connectMenuButtonEl()},this.handleCalciteActionClick=()=>{this.open=!1,this.setFocus()},this.menuButtonClick=t=>{kY(t)&&this.toggleOpen()},this.updateTooltip=t=>{const e=t.target.assignedElements({flatten:!0}).filter(i=>i?.matches("calcite-tooltip"));this.tooltipEl=e[0],this.setTooltipReferenceElement()},this.setTooltipReferenceElement=()=>{const{tooltipEl:t,expanded:e,menuButtonEl:i,open:r}=this;t&&(t.referenceElement=!e&&!r?i:null)},this.updateAction=(t,e)=>{const{guid:i,activeMenuItemIndex:r}=this,n=`${i}-action-${e}`;t.tabIndex=-1,t.setAttribute("role","menuitem"),t.id||(t.id=n),t.active=e===r},this.updateActions=t=>{t?.forEach(this.updateAction)},this.handleDefaultSlotChange=t=>{const e=t.target.assignedElements({flatten:!0}).filter(i=>i?.matches("calcite-action"));this.actionElements=e},this.menuButtonKeyDown=t=>{const{key:e}=t,{actionElements:i,activeMenuItemIndex:r,open:n}=this;if(i.length){if(W2t(e)){if(t.preventDefault(),!n){this.toggleOpen();return}const s=i[r];s?s.click():this.toggleOpen(!1)}if(e==="Tab"){this.open=!1;return}if(e==="Escape"){this.toggleOpen(!1),t.preventDefault();return}this.handleActionNavigation(t,e,i)}},this.handleActionNavigation=(t,e,i)=>{if(!this.isValidKey(e,KJi))return;if(t.preventDefault(),!this.open){this.toggleOpen(),(e==="Home"||e==="ArrowDown")&&(this.activeMenuItemIndex=0),(e==="End"||e==="ArrowUp")&&(this.activeMenuItemIndex=i.length-1);return}e==="Home"&&(this.activeMenuItemIndex=0),e==="End"&&(this.activeMenuItemIndex=i.length-1);const r=this.activeMenuItemIndex;e==="ArrowUp"&&(this.activeMenuItemIndex=WCt(Math.max(r-1,-1),i.length)),e==="ArrowDown"&&(this.activeMenuItemIndex=WCt(r+1,i.length))},this.toggleOpenEnd=()=>{this.setFocus(),this.el.removeEventListener("calcitePopoverOpen",this.toggleOpenEnd)},this.toggleOpen=(t=!this.open)=>{this.el.addEventListener("calcitePopoverOpen",this.toggleOpenEnd),this.open=t},this.expanded=!1,this.flipPlacements=void 0,this.label=void 0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.scale=void 0,this.menuButtonEl=void 0,this.activeMenuItemIndex=-1}componentWillLoad(){TE(this)}componentDidLoad(){EE(this)}disconnectedCallback(){this.disconnectMenuButtonEl()}expandedHandler(){this.open=!1,this.setTooltipReferenceElement()}openHandler(t){this.activeMenuItemIndex=this.open?0:-1,this.menuButtonEl&&(this.menuButtonEl.active=t),this.calciteActionMenuOpen.emit(),this.setTooltipReferenceElement()}closeCalciteActionMenuOnClick(t){!kY(t)||t.composedPath().includes(this.el)||(this.open=!1)}activeMenuItemIndexHandler(){this.updateActions(this.actionElements)}async setFocus(){await IE(this),Aet(this.menuButtonEl)}renderMenuButton(){const{label:t,scale:e,expanded:i}=this;return br("slot",{name:P5e.trigger,onSlotchange:this.setMenuButtonEl},br("calcite-action",{class:FTt.defaultTrigger,icon:YJi.menu,ref:this.setDefaultMenuButtonEl,scale:e,text:t,textEnabled:i}))}renderMenuItems(){const{actionElements:t,activeMenuItemIndex:e,open:i,menuId:r,menuButtonEl:n,label:s,placement:o,overlayPositioning:a,flipPlacements:l}=this,h=t[e]?.id||null;return br("calcite-popover",{flipPlacements:l,focusTrapDisabled:!0,label:s,offsetDistance:0,open:i,overlayPositioning:a,placement:o,pointerDisabled:!0,referenceElement:n},br("div",{"aria-activedescendant":h,"aria-labelledby":n?.id,class:FTt.menu,id:r,onClick:this.handleCalciteActionClick,role:"menu",tabIndex:-1},br("slot",{onSlotchange:this.handleDefaultSlotChange})))}render(){return br(DEe,null,this.renderMenuButton(),this.renderMenuItems(),br("slot",{name:P5e.tooltip,onSlotchange:this.updateTooltip}))}isValidKey(t,e){return!!e.find(i=>i===t)}get el(){return this}static get watchers(){return{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}}static get style(){return XJi}},[1,"calcite-action-menu",{expanded:[516],flipPlacements:[16],label:[1],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],scale:[513],menuButtonEl:[32],activeMenuItemIndex:[32],setFocus:[64]},[[9,"pointerdown","closeCalciteActionMenuOnClick"]]]);function O5e(){if(typeof customElements>"u")return;["calcite-action-menu","calcite-action","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-menu":customElements.get(e)||customElements.define(e,JJi);break;case"calcite-action":customElements.get(e)||xU();break;case"calcite-icon":customElements.get(e)||lx();break;case"calcite-loader":customElements.get(e)||vF();break;case"calcite-popover":customElements.get(e)||Nme();break}})}O5e();/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const C0={backButton:"back-button",container:"container",header:"header",heading:"heading",summary:"summary",description:"description",headerContent:"header-content",headerActions:"header-actions",headerActionsEnd:"header-actions--end",headerActionsStart:"header-actions--start",contentWrapper:"content-wrapper",contentContainer:"content-container",contentHeight:"content-height",fabContainer:"fab-container",footer:"footer"},YCt={close:"x",menu:"ellipsis",backLeft:"chevron-left",backRight:"chevron-right"},U_={headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerActions:"footer-actions"},YKi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{position:relative;display:flex;block-size:100%;inline-size:100%;flex:1 1 auto;overflow:hidden;--calcite-min-header-height:calc(var(--calcite-icon-size) * 3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.header{margin:0px;display:flex;align-content:space-between;align-items:center;fill:var(--calcite-ui-text-2);color:var(--calcite-ui-text-2)}.heading{margin:0px;padding:0px;font-weight:var(--calcite-font-weight-medium)}.header .heading{flex:1 1 auto;padding:0.5rem}.container{margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;background-color:var(--calcite-ui-background);padding:0px;transition:max-block-size var(--calcite-animation-timing), inline-size var(--calcite-animation-timing)}.container[hidden]{display:none}.header{border-block-end:1px solid;position:sticky;inset-block-start:0px;z-index:400;inline-size:100%;align-items:stretch;justify-content:flex-start;background-color:var(--calcite-ui-foreground-1);border-block-end-color:var(--calcite-ui-border-3);flex:0 0 auto}.header-content{display:flex;flex-direction:column;overflow:hidden;padding-inline:0.75rem;padding-block:0.875rem;margin-inline-end:auto}.header-content .heading,.header-content .description{display:block;overflow-wrap:break-word;padding:0px}.header-content .heading{margin-inline:0px;margin-block:0px 0.25rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;font-weight:var(--calcite-font-weight-medium)}.header-content .heading:only-child{margin-block-end:0px}.header-content .description{font-size:var(--calcite-font-size--1);line-height:1rem;color:var(--calcite-ui-text-2)}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-ui-border-3);border-inline-end-width:1px}.header-actions{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:stretch}.header-actions--end{margin-inline-start:auto}.content-wrapper{overflow:auto}.content-height{block-size:100%}.content-container{display:flex;flex:1 1 auto;flex-direction:column;flex-wrap:nowrap;align-items:stretch;background-color:var(--calcite-ui-background)}.footer{border-block-start:1px solid;position:sticky;inset-block-end:0px;display:flex;inline-size:100%;justify-content:space-evenly;background-color:var(--calcite-ui-foreground-1);border-block-start-color:var(--calcite-ui-border-3);flex:0 0 auto;min-block-size:3rem;padding:0.5rem}.fab-container{position:sticky;inset-block-end:0px;z-index:300;margin-block:0px;margin-inline:auto;display:block;padding:0.5rem;inset-inline:0;inline-size:-moz-fit-content;inline-size:fit-content}[hidden]{display:none}",XKi=h0(class extends d0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calcitePanelClose=Wh(this,"calcitePanelClose",6),this.calcitePanelScroll=Wh(this,"calcitePanelScroll",6),this.resizeObserver=aF("resize",()=>this.resizeHandler()),this.resizeHandler=()=>{const{panelScrollEl:t}=this;!t||typeof t.scrollHeight!="number"||typeof t.offsetHeight!="number"||(t.tabIndex=t.scrollHeight>t.offsetHeight?0:-1)},this.setContainerRef=t=>{this.containerEl=t},this.setCloseRef=t=>{this.closeButtonEl=t},this.setBackRef=t=>{this.backButtonEl=t},this.panelKeyDownHandler=t=>{this.closable&&t.key==="Escape"&&!t.defaultPrevented&&(this.close(),t.preventDefault())},this.close=()=>{this.closed=!0,this.calcitePanelClose.emit()},this.panelScrollHandler=()=>{this.calcitePanelScroll.emit()},this.handleHeaderActionsStartSlotChange=t=>{const e=t.target.assignedElements({flatten:!0});this.hasStartActions=!!e.length},this.handleHeaderActionsEndSlotChange=t=>{const e=t.target.assignedElements({flatten:!0});this.hasEndActions=!!e.length},this.handleHeaderMenuActionsSlotChange=t=>{const e=t.target.assignedElements({flatten:!0});this.hasMenuItems=!!e.length},this.handleHeaderContentSlotChange=t=>{const e=t.target.assignedElements({flatten:!0});this.hasHeaderContent=!!e.length},this.handleFooterSlotChange=t=>{const e=t.target.assignedElements({flatten:!0});this.hasFooterContent=!!e.length},this.handleFooterActionsSlotChange=t=>{const e=t.target.assignedElements({flatten:!0});this.hasFooterActions=!!e.length},this.handleFabSlotChange=t=>{const e=t.target.assignedElements({flatten:!0});this.hasFab=!!e.length},this.setPanelScrollEl=t=>{this.panelScrollEl=t,this.resizeObserver?.disconnect(),t&&(this.resizeObserver?.observe(t),this.resizeHandler())},this.closed=!1,this.disabled=!1,this.closable=!1,this.headingLevel=void 0,this.loading=!1,this.heading=void 0,this.description=void 0,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.hasStartActions=!1,this.hasEndActions=!1,this.hasMenuItems=!1,this.hasHeaderContent=!1,this.hasFooterContent=!1,this.hasFooterActions=!1,this.hasFab=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){uF(this),pF(this)}async componentWillLoad(){SE(this),await hF(this)}componentDidLoad(){CE(this)}componentDidRender(){f6(this)}disconnectedCallback(){cF(this),fF(this),this.resizeObserver?.disconnect()}effectiveLocaleChange(){dF(this,this.effectiveLocale)}async setFocus(){await TE(this),Eet(this.containerEl)}async scrollContentTo(t){this.panelScrollEl?.scrollTo(t)}renderHeaderContent(){const{heading:t,headingLevel:e,description:i,hasHeaderContent:r}=this,n=t?dr(jCt,{class:C0.heading,level:e},t):null,s=i?dr("span",{class:C0.description},i):null;return!r&&(n||s)?dr("div",{class:C0.headerContent,key:"header-content"},n,s):null}renderHeaderSlottedContent(){return dr("div",{class:C0.headerContent,hidden:!this.hasHeaderContent,key:"slotted-header-content"},dr("slot",{name:U_.headerContent,onSlotchange:this.handleHeaderContentSlotChange}))}renderHeaderStartActions(){const{hasStartActions:t}=this;return dr("div",{class:{[C0.headerActionsStart]:!0,[C0.headerActions]:!0},hidden:!t,key:"header-actions-start"},dr("slot",{name:U_.headerActionsStart,onSlotchange:this.handleHeaderActionsStartSlotChange}))}renderHeaderActionsEnd(){const{close:t,hasEndActions:e,messages:i,closable:r}=this,n=i.close,s=r?dr("calcite-action",{"aria-label":n,icon:YCt.close,onClick:t,ref:this.setCloseRef,text:n}):null,o=dr("slot",{name:U_.headerActionsEnd,onSlotchange:this.handleHeaderActionsEndSlotChange}),a=e||s;return dr("div",{class:{[C0.headerActionsEnd]:!0,[C0.headerActions]:!0},hidden:!a,key:"header-actions-end"},o,s)}renderMenu(){const{hasMenuItems:t,messages:e,menuOpen:i}=this;return dr("calcite-action-menu",{flipPlacements:["top","bottom"],hidden:!t,key:"menu",label:e.options,open:i,placement:"bottom-end"},dr("calcite-action",{icon:YCt.menu,slot:a5e.trigger,text:e.options}),dr("slot",{name:U_.headerMenuActions,onSlotchange:this.handleHeaderMenuActionsSlotChange}))}renderHeaderNode(){const{hasHeaderContent:t,hasStartActions:e,hasEndActions:i,closable:r,hasMenuItems:n}=this,s=this.renderHeaderContent(),o=t||s||e||i||r||n;return dr("header",{class:C0.header,hidden:!o},this.renderHeaderStartActions(),this.renderHeaderSlottedContent(),s,this.renderHeaderActionsEnd(),this.renderMenu())}renderFooterNode(){const{hasFooterContent:t,hasFooterActions:e}=this,i=t||e;return dr("footer",{class:C0.footer,hidden:!i},dr("slot",{key:"footer-slot",name:U_.footer,onSlotchange:this.handleFooterSlotChange}),dr("slot",{key:"footer-actions-slot",name:U_.footerActions,onSlotchange:this.handleFooterActionsSlotChange}))}renderContent(){const{hasFab:t}=this,e=dr("slot",{key:"default-slot"}),i=t?dr("section",{class:C0.contentContainer},e):e;return dr("div",{class:{[C0.contentWrapper]:!0,[C0.contentContainer]:!t,[C0.contentHeight]:t},onScroll:this.panelScrollHandler,ref:this.setPanelScrollEl},i,this.renderFab())}renderFab(){return dr("div",{class:C0.fabContainer,hidden:!this.hasFab},dr("slot",{name:U_.fab,onSlotchange:this.handleFabSlotChange}))}render(){const{loading:t,panelKeyDownHandler:e,closed:i,closable:r}=this,n=dr("article",{"aria-busy":yw(t),class:C0.container,hidden:i,onKeyDown:e,ref:this.setContainerRef,tabIndex:r?0:-1},this.renderHeaderNode(),this.renderContent(),this.renderFooterNode());return dr(PEe,null,t?dr("calcite-scrim",{loading:t}):null,n)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return YKi}},[1,"calcite-panel",{closed:[1540],disabled:[516],closable:[1540],headingLevel:[514,"heading-level"],loading:[516],heading:[1],description:[1],menuOpen:[516,"menu-open"],messageOverrides:[1040],messages:[1040],hasStartActions:[32],hasEndActions:[32],hasMenuItems:[32],hasHeaderContent:[32],hasFooterContent:[32],hasFooterActions:[32],hasFab:[32],defaultMessages:[32],effectiveLocale:[32],setFocus:[64],scrollContentTo:[64]}]);function XCt(){if(typeof customElements>"u")return;["calcite-panel","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover","calcite-scrim"].forEach(e=>{switch(e){case"calcite-panel":customElements.get(e)||customElements.define(e,XKi);break;case"calcite-action":customElements.get(e)||mj();break;case"calcite-action-menu":customElements.get(e)||l5e();break;case"calcite-icon":customElements.get(e)||ox();break;case"calcite-loader":customElements.get(e)||mF();break;case"calcite-popover":customElements.get(e)||hme();break;case"calcite-scrim":customElements.get(e)||aQ();break}})}XCt();/*! + */const I0={backButton:"back-button",container:"container",header:"header",heading:"heading",summary:"summary",description:"description",headerContent:"header-content",headerActions:"header-actions",headerActionsEnd:"header-actions--end",headerActionsStart:"header-actions--start",contentWrapper:"content-wrapper",contentContainer:"content-container",contentHeight:"content-height",fabContainer:"fab-container",footer:"footer"},LTt={close:"x",menu:"ellipsis",backLeft:"chevron-left",backRight:"chevron-right"},W_={headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerActions:"footer-actions"},ZJi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{position:relative;display:flex;block-size:100%;inline-size:100%;flex:1 1 auto;overflow:hidden;--calcite-min-header-height:calc(var(--calcite-icon-size) * 3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.header{margin:0px;display:flex;align-content:space-between;align-items:center;fill:var(--calcite-ui-text-2);color:var(--calcite-ui-text-2)}.heading{margin:0px;padding:0px;font-weight:var(--calcite-font-weight-medium)}.header .heading{flex:1 1 auto;padding:0.5rem}.container{margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;background-color:var(--calcite-ui-background);padding:0px;transition:max-block-size var(--calcite-animation-timing), inline-size var(--calcite-animation-timing)}.container[hidden]{display:none}.header{border-block-end:1px solid;position:sticky;inset-block-start:0px;z-index:400;inline-size:100%;align-items:stretch;justify-content:flex-start;background-color:var(--calcite-ui-foreground-1);border-block-end-color:var(--calcite-ui-border-3);flex:0 0 auto}.header-content{display:flex;flex-direction:column;overflow:hidden;padding-inline:0.75rem;padding-block:0.875rem;margin-inline-end:auto}.header-content .heading,.header-content .description{display:block;overflow-wrap:break-word;padding:0px}.header-content .heading{margin-inline:0px;margin-block:0px 0.25rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;font-weight:var(--calcite-font-weight-medium)}.header-content .heading:only-child{margin-block-end:0px}.header-content .description{font-size:var(--calcite-font-size--1);line-height:1rem;color:var(--calcite-ui-text-2)}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-ui-border-3);border-inline-end-width:1px}.header-actions{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:stretch}.header-actions--end{margin-inline-start:auto}.content-wrapper{overflow:auto}.content-height{block-size:100%}.content-container{display:flex;flex:1 1 auto;flex-direction:column;flex-wrap:nowrap;align-items:stretch;background-color:var(--calcite-ui-background)}.footer{border-block-start:1px solid;position:sticky;inset-block-end:0px;display:flex;inline-size:100%;justify-content:space-evenly;background-color:var(--calcite-ui-foreground-1);border-block-start-color:var(--calcite-ui-border-3);flex:0 0 auto;min-block-size:3rem;padding:0.5rem}.fab-container{position:sticky;inset-block-end:0px;z-index:300;margin-block:0px;margin-inline:auto;display:block;padding:0.5rem;inset-inline:0;inline-size:-moz-fit-content;inline-size:fit-content}[hidden]{display:none}",QJi=d0(class extends p0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calcitePanelClose=Xh(this,"calcitePanelClose",6),this.calcitePanelScroll=Xh(this,"calcitePanelScroll",6),this.resizeObserver=cF("resize",()=>this.resizeHandler()),this.resizeHandler=()=>{const{panelScrollEl:t}=this;!t||typeof t.scrollHeight!="number"||typeof t.offsetHeight!="number"||(t.tabIndex=t.scrollHeight>t.offsetHeight?0:-1)},this.setContainerRef=t=>{this.containerEl=t},this.setCloseRef=t=>{this.closeButtonEl=t},this.setBackRef=t=>{this.backButtonEl=t},this.panelKeyDownHandler=t=>{this.closable&&t.key==="Escape"&&!t.defaultPrevented&&(this.close(),t.preventDefault())},this.close=()=>{this.closed=!0,this.calcitePanelClose.emit()},this.panelScrollHandler=()=>{this.calcitePanelScroll.emit()},this.handleHeaderActionsStartSlotChange=t=>{const e=t.target.assignedElements({flatten:!0});this.hasStartActions=!!e.length},this.handleHeaderActionsEndSlotChange=t=>{const e=t.target.assignedElements({flatten:!0});this.hasEndActions=!!e.length},this.handleHeaderMenuActionsSlotChange=t=>{const e=t.target.assignedElements({flatten:!0});this.hasMenuItems=!!e.length},this.handleHeaderContentSlotChange=t=>{const e=t.target.assignedElements({flatten:!0});this.hasHeaderContent=!!e.length},this.handleFooterSlotChange=t=>{const e=t.target.assignedElements({flatten:!0});this.hasFooterContent=!!e.length},this.handleFooterActionsSlotChange=t=>{const e=t.target.assignedElements({flatten:!0});this.hasFooterActions=!!e.length},this.handleFabSlotChange=t=>{const e=t.target.assignedElements({flatten:!0});this.hasFab=!!e.length},this.setPanelScrollEl=t=>{this.panelScrollEl=t,this.resizeObserver?.disconnect(),t&&(this.resizeObserver?.observe(t),this.resizeHandler())},this.closed=!1,this.disabled=!1,this.closable=!1,this.headingLevel=void 0,this.loading=!1,this.heading=void 0,this.description=void 0,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.hasStartActions=!1,this.hasEndActions=!1,this.hasMenuItems=!1,this.hasHeaderContent=!1,this.hasFooterContent=!1,this.hasFooterActions=!1,this.hasFab=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){dF(this),gF(this)}async componentWillLoad(){TE(this),await fF(this)}componentDidLoad(){EE(this)}componentDidRender(){g6(this)}disconnectedCallback(){pF(this),yF(this),this.resizeObserver?.disconnect()}effectiveLocaleChange(){mF(this,this.effectiveLocale)}async setFocus(){await IE(this),Pet(this.containerEl)}async scrollContentTo(t){this.panelScrollEl?.scrollTo(t)}renderHeaderContent(){const{heading:t,headingLevel:e,description:i,hasHeaderContent:r}=this,n=t?br(OTt,{class:I0.heading,level:e},t):null,s=i?br("span",{class:I0.description},i):null;return!r&&(n||s)?br("div",{class:I0.headerContent,key:"header-content"},n,s):null}renderHeaderSlottedContent(){return br("div",{class:I0.headerContent,hidden:!this.hasHeaderContent,key:"slotted-header-content"},br("slot",{name:W_.headerContent,onSlotchange:this.handleHeaderContentSlotChange}))}renderHeaderStartActions(){const{hasStartActions:t}=this;return br("div",{class:{[I0.headerActionsStart]:!0,[I0.headerActions]:!0},hidden:!t,key:"header-actions-start"},br("slot",{name:W_.headerActionsStart,onSlotchange:this.handleHeaderActionsStartSlotChange}))}renderHeaderActionsEnd(){const{close:t,hasEndActions:e,messages:i,closable:r}=this,n=i.close,s=r?br("calcite-action",{"aria-label":n,icon:LTt.close,onClick:t,ref:this.setCloseRef,text:n}):null,o=br("slot",{name:W_.headerActionsEnd,onSlotchange:this.handleHeaderActionsEndSlotChange}),a=e||s;return br("div",{class:{[I0.headerActionsEnd]:!0,[I0.headerActions]:!0},hidden:!a,key:"header-actions-end"},o,s)}renderMenu(){const{hasMenuItems:t,messages:e,menuOpen:i}=this;return br("calcite-action-menu",{flipPlacements:["top","bottom"],hidden:!t,key:"menu",label:e.options,open:i,placement:"bottom-end"},br("calcite-action",{icon:LTt.menu,slot:P5e.trigger,text:e.options}),br("slot",{name:W_.headerMenuActions,onSlotchange:this.handleHeaderMenuActionsSlotChange}))}renderHeaderNode(){const{hasHeaderContent:t,hasStartActions:e,hasEndActions:i,closable:r,hasMenuItems:n}=this,s=this.renderHeaderContent(),o=t||s||e||i||r||n;return br("header",{class:I0.header,hidden:!o},this.renderHeaderStartActions(),this.renderHeaderSlottedContent(),s,this.renderHeaderActionsEnd(),this.renderMenu())}renderFooterNode(){const{hasFooterContent:t,hasFooterActions:e}=this,i=t||e;return br("footer",{class:I0.footer,hidden:!i},br("slot",{key:"footer-slot",name:W_.footer,onSlotchange:this.handleFooterSlotChange}),br("slot",{key:"footer-actions-slot",name:W_.footerActions,onSlotchange:this.handleFooterActionsSlotChange}))}renderContent(){const{hasFab:t}=this,e=br("slot",{key:"default-slot"}),i=t?br("section",{class:I0.contentContainer},e):e;return br("div",{class:{[I0.contentWrapper]:!0,[I0.contentContainer]:!t,[I0.contentHeight]:t},onScroll:this.panelScrollHandler,ref:this.setPanelScrollEl},i,this.renderFab())}renderFab(){return br("div",{class:I0.fabContainer,hidden:!this.hasFab},br("slot",{name:W_.fab,onSlotchange:this.handleFabSlotChange}))}render(){const{loading:t,panelKeyDownHandler:e,closed:i,closable:r}=this,n=br("article",{"aria-busy":bw(t),class:I0.container,hidden:i,onKeyDown:e,ref:this.setContainerRef,tabIndex:r?0:-1},this.renderHeaderNode(),this.renderContent(),this.renderFooterNode());return br(DEe,null,t?br("calcite-scrim",{loading:t}):null,n)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return ZJi}},[1,"calcite-panel",{closed:[1540],disabled:[516],closable:[1540],headingLevel:[514,"heading-level"],loading:[516],heading:[1],description:[1],menuOpen:[516,"menu-open"],messageOverrides:[1040],messages:[1040],hasStartActions:[32],hasEndActions:[32],hasMenuItems:[32],hasHeaderContent:[32],hasFooterContent:[32],hasFooterActions:[32],hasFab:[32],defaultMessages:[32],effectiveLocale:[32],setFocus:[64],scrollContentTo:[64]}]);function NTt(){if(typeof customElements>"u")return;["calcite-panel","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover","calcite-scrim"].forEach(e=>{switch(e){case"calcite-panel":customElements.get(e)||customElements.define(e,QJi);break;case"calcite-action":customElements.get(e)||xU();break;case"calcite-action-menu":customElements.get(e)||O5e();break;case"calcite-icon":customElements.get(e)||lx();break;case"calcite-loader":customElements.get(e)||vF();break;case"calcite-popover":customElements.get(e)||Nme();break;case"calcite-scrim":customElements.get(e)||dQ();break}})}NTt();/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const KCt={container:"container",arrow:"arrow"},KKi=500,JCt="aria-describedby";function ZCt(t){const{referenceElement:e}=t;return(typeof e=="string"?DEe(t,{id:e}):e)||null}class JKi{constructor(){this.registeredElements=new WeakMap,this.hoverTimeout=null,this.registeredElementCount=0,this.queryTooltip=e=>{const{registeredElements:i}=this,r=e.find(n=>i.has(n));return i.get(r)},this.keyDownHandler=e=>{if(e.key==="Escape"&&!e.defaultPrevented){const{activeTooltipEl:i}=this;if(i&&i.open){this.clearHoverTimeout(),this.toggleTooltip(i,!1);const r=ZCt(i);r instanceof Element&&r.contains(e.target)&&e.preventDefault()}}},this.queryHoveredTooltip=e=>{const{activeTooltipEl:i}=this;if(i&&e.includes(i)){this.clearHoverTimeout();return}const r=this.queryTooltip(e);r?this.toggleHoveredTooltip(r,!0):i&&this.toggleHoveredTooltip(i,!1)},this.pointerMoveHandler=e=>{const i=e.composedPath();this.clearHoverTimeout(),this.hoverTimeout=window.setTimeout(()=>this.queryHoveredTooltip(i),KKi)},this.pointerDownHandler=e=>{if(!NY(e))return;const i=this.queryTooltip(e.composedPath());this.clickedTooltip=i,i?.closeOnClick&&(this.toggleTooltip(i,!1),this.clearHoverTimeout())},this.focusInHandler=e=>{this.queryFocusedTooltip(e,!0)},this.focusOutHandler=e=>{this.queryFocusedTooltip(e,!1)},this.toggleHoveredTooltip=(e,i)=>{i&&this.closeExistingTooltip(),this.toggleTooltip(e,i)}}registerElement(e,i){this.registeredElementCount++,this.registeredElements.set(e,i),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}addListeners(){document.addEventListener("keydown",this.keyDownHandler,{capture:!0}),document.addEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),document.addEventListener("pointerdown",this.pointerDownHandler,{capture:!0}),document.addEventListener("focusin",this.focusInHandler,{capture:!0}),document.addEventListener("focusout",this.focusOutHandler,{capture:!0})}removeListeners(){document.removeEventListener("keydown",this.keyDownHandler,{capture:!0}),document.removeEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),document.removeEventListener("pointerdown",this.pointerDownHandler,{capture:!0}),document.removeEventListener("focusin",this.focusInHandler,{capture:!0}),document.removeEventListener("focusout",this.focusOutHandler,{capture:!0})}clearHoverTimeout(){window.clearTimeout(this.hoverTimeout)}closeExistingTooltip(){const{activeTooltipEl:e}=this;e&&this.toggleTooltip(e,!1)}toggleFocusedTooltip(e,i){this.closeExistingTooltip(),i&&this.clearHoverTimeout(),this.toggleTooltip(e,i)}toggleTooltip(e,i){e.open=i,i&&(this.activeTooltipEl=e)}queryFocusedTooltip(e,i){const r=this.queryTooltip(e.composedPath());if(!r||r===this.clickedTooltip){this.clickedTooltip=null;return}this.toggleFocusedTooltip(r,i)}}const ZKi='@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{--calcite-floating-ui-z-index:var(--calcite-tooltip-z-index, 901);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:1;border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{transform:translateY(-5px)}:host([data-placement^=top]) .calcite-floating-ui-anim{transform:translateY(5px)}:host([data-placement^=left]) .calcite-floating-ui-anim{transform:translateX(5px)}:host([data-placement^=right]) .calcite-floating-ui-anim{transform:translateX(-5px)}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.arrow,.arrow::before{position:absolute;inline-size:8px;block-size:8px;z-index:-1}.arrow::before{content:"";--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transform:rotate(45deg);background:var(--calcite-ui-foreground-1)}:host([data-placement^=top]) .arrow{inset-block-end:-4px}:host([data-placement^=bottom]) .arrow{inset-block-start:-4px}:host([data-placement^=right]) .arrow,:host([data-placement^=left]) .arrow{direction:ltr;text-align:start}:host([data-placement^=left]) .arrow{inset-inline-end:-4px}:host([data-placement^=right]) .arrow{inset-inline-start:-4px}.container{position:relative;overflow:hidden;border-radius:0.25rem;background-color:var(--calcite-ui-foreground-1);padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size--2);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);max-inline-size:20rem;max-block-size:20rem;text-align:start}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);background-color:var(--calcite-ui-foreground-1)}.arrow::before{outline:1px solid var(--calcite-ui-border-3)}',QCt=new JKi,eTt=h0(class extends d0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteTooltipBeforeClose=Wh(this,"calciteTooltipBeforeClose",6),this.calciteTooltipClose=Wh(this,"calciteTooltipClose",6),this.calciteTooltipBeforeOpen=Wh(this,"calciteTooltipBeforeOpen",6),this.calciteTooltipOpen=Wh(this,"calciteTooltipOpen",6),this.guid=`calcite-tooltip-${DY()}`,this.hasLoaded=!1,this.openTransitionProp="opacity",this.setTransitionEl=t=>{this.transitionEl=t,cme(this)},this.setUpReferenceElement=(t=!0)=>{this.removeReferences(),this.effectiveReferenceElement=ZCt(this.el),MCt(this,this.effectiveReferenceElement,this.el);const{el:e,referenceElement:i,effectiveReferenceElement:r}=this;t&&i&&!r&&console.warn(`${e.tagName}: reference-element id "${i}" was not found.`,{el:e}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.addReferences=()=>{const{effectiveReferenceElement:t}=this;if(!t)return;const e=this.getId();"setAttribute"in t&&t.setAttribute(JCt,e),QCt.registerElement(t,this.el)},this.removeReferences=()=>{const{effectiveReferenceElement:t}=this;t&&("removeAttribute"in t&&t.removeAttribute(JCt),QCt.unregisterElement(t))},this.closeOnClick=!1,this.label=void 0,this.offsetDistance=FCt,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.referenceElement=void 0,this.effectiveReferenceElement=void 0}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(t){t?this.reposition(!0):LCt(this.el)}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement()}connectedCallback(){cme(this),this.setUpReferenceElement(this.hasLoaded)}componentDidLoad(){this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement(),this.reposition(!0),this.hasLoaded=!0}disconnectedCallback(){this.removeReferences(),i5e(this,this.effectiveReferenceElement,this.el),o5e(this)}async reposition(t=!1){const{el:e,effectiveReferenceElement:i,placement:r,overlayPositioning:n,offsetDistance:s,offsetSkidding:o,arrowEl:a}=this;return OCt(this,{floatingEl:e,referenceEl:i,overlayPositioning:n,placement:r,offsetDistance:s,offsetSkidding:o,includeArrow:!0,arrowEl:a,type:"tooltip"},t)}onBeforeOpen(){this.calciteTooltipBeforeOpen.emit()}onOpen(){this.calciteTooltipOpen.emit()}onBeforeClose(){this.calciteTooltipBeforeClose.emit()}onClose(){this.calciteTooltipClose.emit()}render(){const{effectiveReferenceElement:t,label:e,open:i}=this,r=t&&i,n=!r;return dr(YA,{"aria-hidden":yw(n),"aria-label":e,"aria-live":"polite","calcite-hydrated-hidden":n,id:this.getId(),role:"tooltip"},dr("div",{class:{[CQ.animation]:!0,[CQ.animationActive]:r},ref:this.setTransitionEl},dr("div",{class:KCt.arrow,ref:s=>this.arrowEl=s}),dr("div",{class:KCt.container},dr("slot",null))))}get el(){return this}static get watchers(){return{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}}static get style(){return ZKi}},[1,"calcite-tooltip",{closeOnClick:[516,"close-on-click"],label:[1],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[516],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],effectiveReferenceElement:[32],reposition:[64]}]);function u5e(){if(typeof customElements>"u")return;["calcite-tooltip"].forEach(e=>{switch(e){case"calcite-tooltip":customElements.get(e)||customElements.define(e,eTt);break}})}u5e();/*! + */const kTt={container:"container",arrow:"arrow"},eZi=500,$Tt="aria-describedby";function BTt(t){const{referenceElement:e}=t;return(typeof e=="string"?kEe(t,{id:e}):e)||null}class tZi{constructor(){this.registeredElements=new WeakMap,this.hoverTimeout=null,this.registeredElementCount=0,this.queryTooltip=e=>{const{registeredElements:i}=this,r=e.find(n=>i.has(n));return i.get(r)},this.keyDownHandler=e=>{if(e.key==="Escape"&&!e.defaultPrevented){const{activeTooltipEl:i}=this;if(i&&i.open){this.clearHoverTimeout(),this.toggleTooltip(i,!1);const r=BTt(i);r instanceof Element&&r.contains(e.target)&&e.preventDefault()}}},this.queryHoveredTooltip=e=>{const{activeTooltipEl:i}=this;if(i&&e.includes(i)){this.clearHoverTimeout();return}const r=this.queryTooltip(e);r?this.toggleHoveredTooltip(r,!0):i&&this.toggleHoveredTooltip(i,!1)},this.pointerMoveHandler=e=>{const i=e.composedPath();this.clearHoverTimeout(),this.hoverTimeout=window.setTimeout(()=>this.queryHoveredTooltip(i),eZi)},this.pointerDownHandler=e=>{if(!kY(e))return;const i=this.queryTooltip(e.composedPath());this.clickedTooltip=i,i?.closeOnClick&&(this.toggleTooltip(i,!1),this.clearHoverTimeout())},this.focusInHandler=e=>{this.queryFocusedTooltip(e,!0)},this.focusOutHandler=e=>{this.queryFocusedTooltip(e,!1)},this.toggleHoveredTooltip=(e,i)=>{i&&this.closeExistingTooltip(),this.toggleTooltip(e,i)}}registerElement(e,i){this.registeredElementCount++,this.registeredElements.set(e,i),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}addListeners(){document.addEventListener("keydown",this.keyDownHandler,{capture:!0}),document.addEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),document.addEventListener("pointerdown",this.pointerDownHandler,{capture:!0}),document.addEventListener("focusin",this.focusInHandler,{capture:!0}),document.addEventListener("focusout",this.focusOutHandler,{capture:!0})}removeListeners(){document.removeEventListener("keydown",this.keyDownHandler,{capture:!0}),document.removeEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),document.removeEventListener("pointerdown",this.pointerDownHandler,{capture:!0}),document.removeEventListener("focusin",this.focusInHandler,{capture:!0}),document.removeEventListener("focusout",this.focusOutHandler,{capture:!0})}clearHoverTimeout(){window.clearTimeout(this.hoverTimeout)}closeExistingTooltip(){const{activeTooltipEl:e}=this;e&&this.toggleTooltip(e,!1)}toggleFocusedTooltip(e,i){this.closeExistingTooltip(),i&&this.clearHoverTimeout(),this.toggleTooltip(e,i)}toggleTooltip(e,i){e.open=i,i&&(this.activeTooltipEl=e)}queryFocusedTooltip(e,i){const r=this.queryTooltip(e.composedPath());if(!r||r===this.clickedTooltip){this.clickedTooltip=null;return}this.toggleFocusedTooltip(r,i)}}const iZi='@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host{--calcite-floating-ui-z-index:var(--calcite-tooltip-z-index, 901);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:1;border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{transform:translateY(-5px)}:host([data-placement^=top]) .calcite-floating-ui-anim{transform:translateY(5px)}:host([data-placement^=left]) .calcite-floating-ui-anim{transform:translateX(5px)}:host([data-placement^=right]) .calcite-floating-ui-anim{transform:translateX(-5px)}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.arrow,.arrow::before{position:absolute;inline-size:8px;block-size:8px;z-index:-1}.arrow::before{content:"";--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transform:rotate(45deg);background:var(--calcite-ui-foreground-1)}:host([data-placement^=top]) .arrow{inset-block-end:-4px}:host([data-placement^=bottom]) .arrow{inset-block-start:-4px}:host([data-placement^=right]) .arrow,:host([data-placement^=left]) .arrow{direction:ltr;text-align:start}:host([data-placement^=left]) .arrow{inset-inline-end:-4px}:host([data-placement^=right]) .arrow{inset-inline-start:-4px}.container{position:relative;overflow:hidden;border-radius:0.25rem;background-color:var(--calcite-ui-foreground-1);padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size--2);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);max-inline-size:20rem;max-block-size:20rem;text-align:start}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);background-color:var(--calcite-ui-foreground-1)}.arrow::before{outline:1px solid var(--calcite-ui-border-3)}',VTt=new tZi,jTt=d0(class extends p0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteTooltipBeforeClose=Xh(this,"calciteTooltipBeforeClose",6),this.calciteTooltipClose=Xh(this,"calciteTooltipClose",6),this.calciteTooltipBeforeOpen=Xh(this,"calciteTooltipBeforeOpen",6),this.calciteTooltipOpen=Xh(this,"calciteTooltipOpen",6),this.guid=`calcite-tooltip-${DY()}`,this.hasLoaded=!1,this.openTransitionProp="opacity",this.setTransitionEl=t=>{this.transitionEl=t,Lme(this)},this.setUpReferenceElement=(t=!0)=>{this.removeReferences(),this.effectiveReferenceElement=BTt(this.el),_Tt(this,this.effectiveReferenceElement,this.el);const{el:e,referenceElement:i,effectiveReferenceElement:r}=this;t&&i&&!r&&console.warn(`${e.tagName}: reference-element id "${i}" was not found.`,{el:e}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.addReferences=()=>{const{effectiveReferenceElement:t}=this;if(!t)return;const e=this.getId();"setAttribute"in t&&t.setAttribute($Tt,e),VTt.registerElement(t,this.el)},this.removeReferences=()=>{const{effectiveReferenceElement:t}=this;t&&("removeAttribute"in t&&t.removeAttribute($Tt),VTt.unregisterElement(t))},this.closeOnClick=!1,this.label=void 0,this.offsetDistance=wTt,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.referenceElement=void 0,this.effectiveReferenceElement=void 0}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(t){t?this.reposition(!0):xTt(this.el)}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement()}connectedCallback(){Lme(this),this.setUpReferenceElement(this.hasLoaded)}componentDidLoad(){this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement(),this.reposition(!0),this.hasLoaded=!0}disconnectedCallback(){this.removeReferences(),C5e(this,this.effectiveReferenceElement,this.el),A5e(this)}async reposition(t=!1){const{el:e,effectiveReferenceElement:i,placement:r,overlayPositioning:n,offsetDistance:s,offsetSkidding:o,arrowEl:a}=this;return yTt(this,{floatingEl:e,referenceEl:i,overlayPositioning:n,placement:r,offsetDistance:s,offsetSkidding:o,includeArrow:!0,arrowEl:a,type:"tooltip"},t)}onBeforeOpen(){this.calciteTooltipBeforeOpen.emit()}onOpen(){this.calciteTooltipOpen.emit()}onBeforeClose(){this.calciteTooltipBeforeClose.emit()}onClose(){this.calciteTooltipClose.emit()}render(){const{effectiveReferenceElement:t,label:e,open:i}=this,r=t&&i,n=!r;return br(qA,{"aria-hidden":bw(n),"aria-label":e,"aria-live":"polite","calcite-hydrated-hidden":n,id:this.getId(),role:"tooltip"},br("div",{class:{[PQ.animation]:!0,[PQ.animationActive]:r},ref:this.setTransitionEl},br("div",{class:kTt.arrow,ref:s=>this.arrowEl=s}),br("div",{class:kTt.container},br("slot",null))))}get el(){return this}static get watchers(){return{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}}static get style(){return iZi}},[1,"calcite-tooltip",{closeOnClick:[516,"close-on-click"],label:[1],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[516],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],effectiveReferenceElement:[32],reposition:[64]}]);function R5e(){if(typeof customElements>"u")return;["calcite-tooltip"].forEach(e=>{switch(e){case"calcite-tooltip":customElements.get(e)||customElements.define(e,jTt);break}})}R5e();/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const QKi={backButton:"back-button"},tTt={backLeft:"chevron-left",backRight:"chevron-right"},C6={headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerActions:"footer-actions"},eJi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;overflow:hidden}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-ui-border-3);border-inline-end-width:1px}",iTt=h0(class extends d0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFlowItemBack=Wh(this,"calciteFlowItemBack",6),this.calciteFlowItemScroll=Wh(this,"calciteFlowItemScroll",6),this.calciteFlowItemClose=Wh(this,"calciteFlowItemClose",6),this.handlePanelScroll=t=>{t.stopPropagation(),this.calciteFlowItemScroll.emit()},this.handlePanelClose=t=>{t.stopPropagation(),this.calciteFlowItemClose.emit()},this.backButtonClick=()=>{this.calciteFlowItemBack.emit()},this.setBackRef=t=>{this.backButtonEl=t},this.setContainerRef=t=>{this.containerEl=t},this.closable=!1,this.closed=!1,this.beforeBack=void 0,this.description=void 0,this.disabled=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.showBackButton=!1,this.backButtonEl=void 0,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){uF(this),pF(this)}async componentWillLoad(){await hF(this),SE(this)}componentDidRender(){f6(this)}disconnectedCallback(){cF(this),fF(this)}componentDidLoad(){CE(this)}effectiveLocaleChange(){dF(this,this.effectiveLocale)}async setFocus(){await TE(this);const{backButtonEl:t,containerEl:e}=this;if(t){t.setFocus();return}e?.setFocus()}async scrollContentTo(t){await this.containerEl?.scrollContentTo(t)}renderBackButton(){const{el:t}=this,e=FY(t)==="rtl",{showBackButton:i,backButtonClick:r,messages:n}=this,s=n.back,o=e?tTt.backRight:tTt.backLeft;return i?dr("calcite-action",{"aria-label":s,class:QKi.backButton,icon:o,key:"flow-back-button",onClick:r,ref:this.setBackRef,scale:"s",slot:"header-actions-start",text:s}):null}render(){const{closable:t,closed:e,description:i,disabled:r,heading:n,headingLevel:s,loading:o,menuOpen:a,messages:l,backButtonEl:c}=this,d=l.back;return dr(YA,null,dr("calcite-panel",{closable:t,closed:e,description:i,disabled:r,heading:n,headingLevel:s,loading:o,menuOpen:a,messageOverrides:l,onCalcitePanelClose:this.handlePanelClose,onCalcitePanelScroll:this.handlePanelScroll,ref:this.setContainerRef},this.renderBackButton(),dr("slot",{name:C6.headerActionsStart,slot:U_.headerActionsStart}),dr("slot",{name:C6.headerActionsEnd,slot:U_.headerActionsEnd}),dr("slot",{name:C6.headerContent,slot:U_.headerContent}),dr("slot",{name:C6.headerMenuActions,slot:U_.headerMenuActions}),dr("slot",{name:C6.fab,slot:U_.fab}),dr("slot",{name:C6.footerActions,slot:U_.footerActions}),dr("slot",{name:C6.footer,slot:U_.footer}),dr("slot",null)),c?dr("calcite-tooltip",{label:d,overlayPositioning:"fixed",placement:"top",referenceElement:c},d):null)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return eJi}},[1,"calcite-flow-item",{closable:[1540],closed:[1540],beforeBack:[16],description:[1],disabled:[516],heading:[1],headingLevel:[514,"heading-level"],loading:[516],menuOpen:[516,"menu-open"],messageOverrides:[1040],messages:[1040],showBackButton:[4,"show-back-button"],backButtonEl:[32],defaultMessages:[32],effectiveLocale:[32],setFocus:[64],scrollContentTo:[64]}]);function rTt(){if(typeof customElements>"u")return;["calcite-flow-item","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-panel","calcite-popover","calcite-scrim","calcite-tooltip"].forEach(e=>{switch(e){case"calcite-flow-item":customElements.get(e)||customElements.define(e,iTt);break;case"calcite-action":customElements.get(e)||mj();break;case"calcite-action-menu":customElements.get(e)||l5e();break;case"calcite-icon":customElements.get(e)||ox();break;case"calcite-loader":customElements.get(e)||mF();break;case"calcite-panel":customElements.get(e)||XCt();break;case"calcite-popover":customElements.get(e)||hme();break;case"calcite-scrim":customElements.get(e)||aQ();break;case"calcite-tooltip":customElements.get(e)||u5e();break}})}rTt();const tJi=Object.freeze(Object.defineProperty({__proto__:null,CalciteFlowItem:iTt,defineCustomElement:rTt},Symbol.toStringTag,{value:"Module"}));/*! + */const rZi={backButton:"back-button"},GTt={backLeft:"chevron-left",backRight:"chevron-right"},E6={headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerActions:"footer-actions"},nZi="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:600}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;overflow:hidden}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-ui-border-3);border-inline-end-width:1px}",UTt=d0(class extends p0{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFlowItemBack=Xh(this,"calciteFlowItemBack",6),this.calciteFlowItemScroll=Xh(this,"calciteFlowItemScroll",6),this.calciteFlowItemClose=Xh(this,"calciteFlowItemClose",6),this.handlePanelScroll=t=>{t.stopPropagation(),this.calciteFlowItemScroll.emit()},this.handlePanelClose=t=>{t.stopPropagation(),this.calciteFlowItemClose.emit()},this.backButtonClick=()=>{this.calciteFlowItemBack.emit()},this.setBackRef=t=>{this.backButtonEl=t},this.setContainerRef=t=>{this.containerEl=t},this.closable=!1,this.closed=!1,this.beforeBack=void 0,this.description=void 0,this.disabled=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.showBackButton=!1,this.backButtonEl=void 0,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){dF(this),gF(this)}async componentWillLoad(){await fF(this),TE(this)}componentDidRender(){g6(this)}disconnectedCallback(){pF(this),yF(this)}componentDidLoad(){EE(this)}effectiveLocaleChange(){mF(this,this.effectiveLocale)}async setFocus(){await IE(this);const{backButtonEl:t,containerEl:e}=this;if(t){t.setFocus();return}e?.setFocus()}async scrollContentTo(t){await this.containerEl?.scrollContentTo(t)}renderBackButton(){const{el:t}=this,e=FY(t)==="rtl",{showBackButton:i,backButtonClick:r,messages:n}=this,s=n.back,o=e?GTt.backRight:GTt.backLeft;return i?br("calcite-action",{"aria-label":s,class:rZi.backButton,icon:o,key:"flow-back-button",onClick:r,ref:this.setBackRef,scale:"s",slot:"header-actions-start",text:s}):null}render(){const{closable:t,closed:e,description:i,disabled:r,heading:n,headingLevel:s,loading:o,menuOpen:a,messages:l,backButtonEl:c}=this,h=l.back;return br(qA,null,br("calcite-panel",{closable:t,closed:e,description:i,disabled:r,heading:n,headingLevel:s,loading:o,menuOpen:a,messageOverrides:l,onCalcitePanelClose:this.handlePanelClose,onCalcitePanelScroll:this.handlePanelScroll,ref:this.setContainerRef},this.renderBackButton(),br("slot",{name:E6.headerActionsStart,slot:W_.headerActionsStart}),br("slot",{name:E6.headerActionsEnd,slot:W_.headerActionsEnd}),br("slot",{name:E6.headerContent,slot:W_.headerContent}),br("slot",{name:E6.headerMenuActions,slot:W_.headerMenuActions}),br("slot",{name:E6.fab,slot:W_.fab}),br("slot",{name:E6.footerActions,slot:W_.footerActions}),br("slot",{name:E6.footer,slot:W_.footer}),br("slot",null)),c?br("calcite-tooltip",{label:h,overlayPositioning:"fixed",placement:"top",referenceElement:c},h):null)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return nZi}},[1,"calcite-flow-item",{closable:[1540],closed:[1540],beforeBack:[16],description:[1],disabled:[516],heading:[1],headingLevel:[514,"heading-level"],loading:[516],menuOpen:[516,"menu-open"],messageOverrides:[1040],messages:[1040],showBackButton:[4,"show-back-button"],backButtonEl:[32],defaultMessages:[32],effectiveLocale:[32],setFocus:[64],scrollContentTo:[64]}]);function zTt(){if(typeof customElements>"u")return;["calcite-flow-item","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-panel","calcite-popover","calcite-scrim","calcite-tooltip"].forEach(e=>{switch(e){case"calcite-flow-item":customElements.get(e)||customElements.define(e,UTt);break;case"calcite-action":customElements.get(e)||xU();break;case"calcite-action-menu":customElements.get(e)||O5e();break;case"calcite-icon":customElements.get(e)||lx();break;case"calcite-loader":customElements.get(e)||vF();break;case"calcite-panel":customElements.get(e)||NTt();break;case"calcite-popover":customElements.get(e)||Nme();break;case"calcite-scrim":customElements.get(e)||dQ();break;case"calcite-tooltip":customElements.get(e)||R5e();break}})}zTt();const sZi=Object.freeze(Object.defineProperty({__proto__:null,CalciteFlowItem:UTt,defineCustomElement:zTt},Symbol.toStringTag,{value:"Module"}));/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const iJi=Object.freeze(Object.defineProperty({__proto__:null,CalciteAction:oCt,defineCustomElement:mj},Symbol.toStringTag,{value:"Module"}));/*! + */const oZi=Object.freeze(Object.defineProperty({__proto__:null,CalciteAction:qCt,defineCustomElement:xU},Symbol.toStringTag,{value:"Module"}));/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const rJi=Object.freeze(Object.defineProperty({__proto__:null,CalciteTooltip:eTt,defineCustomElement:u5e},Symbol.toStringTag,{value:"Module"}));let T6=class extends Ni{constructor(e){super(e),this.geometries=[],this.outSpatialReference=null,this.transformation=null,this.transformForward=null}toJSON(){const e=this.geometries.map(n=>n.toJSON()),i=this.geometries[0],r={};return r.outSR=this.outSpatialReference.wkid||JSON.stringify(this.outSpatialReference.toJSON()),r.inSR=i.spatialReference.wkid||JSON.stringify(i.spatialReference.toJSON()),r.geometries=JSON.stringify({geometryType:md(i),geometries:e}),this.transformation&&(r.transformation=this.transformation.wkid||JSON.stringify(this.transformation)),this.transformForward!=null&&(r.transformForward=this.transformForward),r}};E([k()],T6.prototype,"geometries",void 0),E([k({json:{read:{source:"outSR"}}})],T6.prototype,"outSpatialReference",void 0),E([k()],T6.prototype,"transformation",void 0),E([k()],T6.prototype,"transformForward",void 0),T6=E([ht("esri.rest.support.ProjectParameters")],T6);const nTt=T6,nJi=ud(nTt);async function sJi(t,e,i){e=nJi(e);const r=sh(t),n={...r.query,f:"json",...e.toJSON()},s=e.outSpatialReference,o=md(e.geometries[0]),a=r_(n,i);return ir(r.path+"/project",a).then(({data:{geometries:l}})=>kXe(l,o,s))}async function sTt(t=null,e){if(na.geometryServiceUrl)return na.geometryServiceUrl;if(!t)throw new st("internal:geometry-service-url-not-configured");let i;i="portal"in t?t.portal||_c.getDefault():t,await i.load({signal:e});const r=i.helperServices?.geometry?.url;if(!r)throw new st("internal:geometry-service-url-not-configured");return r}async function oJi(t,e,i=null,r){const n=await sTt(i,r),s=new nTt;s.geometries=[t],s.outSpatialReference=e;const o=await sJi(n,s,{signal:r});if(o&&Array.isArray(o)&&o.length===1)return o[0];throw new st("internal:geometry-service-projection-failed")}const aJi=Object.freeze(Object.defineProperty({__proto__:null,getGeometryServiceURL:sTt,projectGeometry:oJi},Symbol.toStringTag,{value:"Module"})),lJi=Ei.getLogger("esri.views.webgl.checkWebGLError");function uJi(t,e){switch(e){case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.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 t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const oTt=!!Gi("enable-feature:webgl-debug");function xb(){return oTt}function c5e(){return oTt}function xF(t){if(xb()){const e=t.getError();if(e){const i=uJi(t,e),r=new Error().stack;lJi.error(new st("webgl-error","WebGL error occured",{message:i,stack:r}))}}}const FE=Ei.getLogger("esri.views.webgl.BufferObject");let Ko=class hH{static createIndex(e,i,r){return new hH(e,to.ELEMENT_ARRAY_BUFFER,i,r)}static createVertex(e,i,r){return new hH(e,to.ARRAY_BUFFER,i,r)}static createUniform(e,i,r){if(e.type!==lo.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new hH(e,to.UNIFORM_BUFFER,i,r)}static createPixelPack(e,i=Lo.STREAM_READ,r){if(e.type!==lo.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const n=new hH(e,to.PIXEL_PACK_BUFFER,i);return r&&n.setSize(r),n}static createPixelUnpack(e,i=Lo.STREAM_DRAW,r){if(e.type!==lo.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new hH(e,to.PIXEL_UNPACK_BUFFER,i,r)}constructor(e,i,r,n){this._context=e,this.bufferType=i,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(gf.BufferObject,this),this._glName=this._context.gl.createBuffer(),xF(this._context.gl),n&&this.setData(n)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===to.ELEMENT_ARRAY_BUFFER?this._indexType===Di.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===to.ELEMENT_ARRAY_BUFFER||this.bufferType===to.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(gf.BufferObject,this),this._context=vH(this._context)):this._glName&&FE.warn("Leaked WebGL buffer object")}setSize(e,i=null){if(e<=0&&FE.error("Buffer size needs to be positive!"),this.bufferType===to.ELEMENT_ARRAY_BUFFER&&ye(i))switch(this._indexType=i,i){case Di.UNSIGNED_SHORT:e*=2;break;case Di.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let i=e.byteLength;this.bufferType===to.ELEMENT_ARRAY_BUFFER&&(m_e(e)&&(i/=2,this._indexType=Di.UNSIGNED_SHORT),oGe(e)&&(i/=4,this._indexType=Di.UNSIGNED_INT)),this._setBufferData(i,e)}_setBufferData(e,i=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;ye(i)?n.bufferData(this.bufferType,i,this.usage):n.bufferData(this.bufferType,e,this.usage),xF(n),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,i,r,n){if(!e)return;(i<0||i*e.BYTES_PER_ELEMENT>=this.byteSize)&&FE.error("offset is out of range!"),r>=n&&FE.error("end must be bigger than start!"),(i+(n-r))*e.BYTES_PER_ELEMENT>this.byteSize&&FE.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 o=this._context.gl;if(this._context.type===lo.WEBGL2)o.bufferSubData(this.bufferType,i*e.BYTES_PER_ELEMENT,e,r,n-r);else{const a=r===0&&n===e.length?e:e.subarray(r,n);o.bufferSubData(this.bufferType,i*e.BYTES_PER_ELEMENT,a)}xF(o),this._isVAOAware&&this._context.bindVAO(s)}getSubData(e,i=0,r,n){if(this._context.type!==lo.WEBGL2)return void FE.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||n<0)return void FE.error("Problem getting subdata: offset and length were less than zero!");const s=cJi(e)?e.BYTES_PER_ELEMENT:1;if(s*((r??0)+(n??0))>e.byteLength)return void FE.error("Problem getting subdata: offset and length exceeded destination size!");i+s*(n??0)>this.byteSize&&FE.warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;this._context.bindBuffer(this,to.COPY_READ_BUFFER),o.getBufferSubData(to.COPY_READ_BUFFER,i,e,r,n),this._context.unbindBuffer(to.COPY_READ_BUFFER)}async getSubDataAsync(e,i=0,r,n){this._context.type===lo.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,i,r,n)):FE.error("Get buffer subdata is supported in WebGL2 only!")}};function cJi(t){return eGe(t)}let mO=class{constructor(e,i){this._context=e,this._desc=i,this.type="renderbuffer",this._context.instanceCounter.increment(gf.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:n,height:s,internalFormat:o,multisampled:a}=i;if(a){if(this._context.type!==lo.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,n,s)}else r.renderbufferStorage(r.RENDERBUFFER,o,n,s)}get descriptor(){return this._desc}get samples(){const e=this._desc.samples,i=this._context.parameters.maxSamples;return e?Math.min(e,i):i}resize(e,i){const r=this._desc;if(r.width===e&&r.height===i)return;r.width=e,r.height=i;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(gf.Renderbuffer,this),this._context=vH(this._context))}};const h5e={target:Ws.TEXTURE_2D,samplingMode:mn.LINEAR,wrapMode:us.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1},aTt=4;let bs=class{constructor(e,i,r=null){this._context=e,this.type="texture",this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,e.instanceCounter.increment(gf.Texture,this),this._descriptor={...h5e,...i};for(const n in h5e)this._descriptor[n]===void 0&&(this._descriptor[n]=h5e[n]);if(e.type!==lo.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),E6(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===Ws.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTexture(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(gf.Texture,this))}release(){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");r.width=e,r.height=i,this._descriptor.target===Ws.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let i=Ws.TEXTURE_CUBE_MAP_POSITIVE_X;i<=Ws.TEXTURE_CUBE_MAP_NEGATIVE_Z;i++)this._setData(e,i)}setData(e){this._setData(e)}_setData(e,i){if(!this._context||!this._context.gl)return;const r=this._context.gl;this._glName||(this._glName=r.createTexture()),e===void 0&&(e=null);const n=this._descriptor,s=i??n.target,o=E6(s);e===null&&(n.width=n.width||aTt,n.height=n.height||aTt,o&&(n.depth=n.depth??1));const a=this._context.bindTexture(this,bs.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(bs.TEXTURE_UNIT_FOR_UPDATES),bs._validateTexture(this._context,n),this._configurePixelStorage(),xF(r);const l=n.pixelFormat;let c=n.internalFormat??this._deriveInternalFormat(l,n.dataType);if(d5e(e)){let d=e.width,p=e.height;const y=1;e instanceof HTMLVideoElement&&(d=e.videoWidth,p=e.videoHeight),n.width&&n.height,o&&n.depth,n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,c,n.hasMipmap,d,p,y),this._texImage(s,0,c,d,p,y,e),xF(r),n.hasMipmap&&this.generateMipmap(),n.width===void 0&&(n.width=d),n.height===void 0&&(n.height=p),o&&n.depth===void 0&&(n.depth=y)}else{const{width:d,height:p,depth:y}=n;if(d==null||p==null)throw new Error("Width and height must be specified!");if(o&&y==null)throw new Error("Depth must be specified!");if(n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,c,n.hasMipmap,d,p,y),r.DEPTH24_STENCIL8&&c===r.DEPTH_STENCIL&&(c=r.DEPTH24_STENCIL8),dme(e)){const v=e.levels,S=lTt(s,d,p,y),I=Math.min(S-1,v.length-1);ye(this._context.gl2)?r.texParameteri(n.target,this._context.gl2.TEXTURE_MAX_LEVEL,I):n.hasMipmap=n.hasMipmap&&S===v.length;const O=c;if(!dJi(O))throw new Error("Attempting to use compressed data with an umcompressed format!");this._forEachMipmapLevel((L,N,G,V)=>{const Y=v[Math.min(L,v.length-1)];this._compressedTexImage(s,L,O,N,G,V,Y)},I)}else ye(e)?(this._texImage(s,0,c,d,p,y,e),xF(r),n.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel((v,S,I,O)=>{this._texImage(s,v,c,S,I,O,null),xF(r)})}bs._applySamplingMode(r,this._descriptor),bs._applyWrapMode(r,this._descriptor),bs._applyAnisotropicFilteringParameters(this._context,this._descriptor),xF(r),this._context.bindTexture(a,bs.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,i,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._context.gl,c=this._descriptor,{pixelFormat:d,dataType:p,target:y,isImmutable:v}=c,S=c.internalFormat??this._deriveInternalFormat(d,p);if(v&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const I=this._context.bindTexture(this,bs.TEXTURE_UNIT_FOR_UPDATES,!0);if((i<0||r<0||n>c.width||s>c.height||i+n>c.width||r+s>c.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),a){if(lt(this._context.gl2))return void console.error("Webgl2 must be enabled to use dataRowOffset!");l.pixelStorei(this._context.gl2.UNPACK_SKIP_ROWS,a)}if(d5e(o)?ye(this._context.gl2)?this._context.gl2.texSubImage2D(y,e,i,r,n,s,d,p,o):l.texSubImage2D(y,e,i,r,d,p,o):dme(o)?l.compressedTexSubImage2D(y,e,i,r,n,s,S,o.levels[e]):l.texSubImage2D(y,e,i,r,n,s,d,p,o),a){if(lt(this._context.gl2))return void console.error("Webgl2 must be enabled to use dataRowOffset!");l.pixelStorei(this._context.gl2.UNPACK_SKIP_ROWS,0)}this._context.bindTexture(I,bs.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,i,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 c=this._context.gl2;if(lt(c))throw new Error("3D textures are not supported in WebGL1");const d=this._descriptor,{pixelFormat:p,dataType:y,isImmutable:v,target:S}=d,I=d.internalFormat??this._deriveInternalFormat(p,y);if(v&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");E6(S)||console.warn("Attempting to set 3D texture data on a non-3D texture");const O=this._context.bindTexture(this,bs.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(bs.TEXTURE_UNIT_FOR_UPDATES),(i<0||r<0||n<0||s>d.width||o>d.height||a>d.depth||i+s>d.width||r+o>d.height||n+a>d.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),dme(l))l=l.levels[e],c.compressedTexSubImage3D(S,e,i,r,n,s,o,a,I,l);else{const L=l;c.texSubImage3D(S,e,i,r,n,s,o,a,p,y,L)}this._context.bindTexture(O,bs.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,bs._validateTexture(this._context,e)}e.samplingMode===mn.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=mn.LINEAR_MIPMAP_NEAREST):e.samplingMode===mn.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=mn.NEAREST_MIPMAP_NEAREST);const i=this._context.bindTexture(this,bs.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(bs.TEXTURE_UNIT_FOR_UPDATES),this._context.gl.generateMipmap(e.target),this._context.bindTexture(i,bs.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,bs._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,i=this._descriptor;this._samplingModeDirty&&(bs._applySamplingMode(e,i),this._samplingModeDirty=!1),this._wrapModeDirty&&(bs._applyWrapMode(e,i),this._wrapModeDirty=!1)}_deriveInternalFormat(e,i){if(this._context.type===lo.WEBGL1)return e;switch(i){case ts.FLOAT:switch(e){case nn.RGBA:return ks.RGBA32F;case nn.RGB:return ks.RGB32F;default:throw new Error("Unable to derive format")}case ts.UNSIGNED_BYTE:switch(e){case nn.RGBA:return ks.RGBA8;case nn.RGB:return ks.RGB8}default:return e}}_configurePixelStorage(){const e=this._context.gl,{unpackAlignment:i,flipped:r,preMultiplyAlpha:n}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,i),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n?1:0)}_texStorage(e,i,r,n,s,o){const a=this._context.gl2;if(lt(a))throw new Error("Immutable textures are not supported in WebGL1");if(!hJi(i))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?lTt(e,n,s,o):1;if(E6(e)){if(o==null)throw new Error("Missing depth dimension for 3D texture upload");a.texStorage3D(e,l,i,n,s,o)}else a.texStorage2D(e,l,i,n,s);this._wasImmutablyAllocated=!0}_texImage(e,i,r,n,s,o,a){const l=this._context.gl;let c=null;const d=this._context.type===lo.WEBGL2,p=E6(e),{isImmutable:y,pixelFormat:v,dataType:S}=this._descriptor;if(d&&(c=l),d||!d5e(a))if(y){if(ye(a)){const I=a;if(p){if(o==null)throw new Error("Missing depth dimension for 3D texture upload");c.texSubImage3D(e,i,0,0,0,n,s,o,v,S,I)}else l.texSubImage2D(e,i,0,0,n,s,v,S,I)}}else{const I=a;if(p){if(o==null)throw new Error("Missing depth dimension for 3D texture upload");c.texImage3D(e,i,r,n,s,o,0,v,S,I)}else l.texImage2D(e,i,r,n,s,0,v,S,I)}else l.texImage2D(e,0,r,v,S,a)}_compressedTexImage(e,i,r,n,s,o,a){const l=this._context.gl;let c=null;const d=E6(e),p=this._descriptor.isImmutable;if(d){if(this._context.type!==lo.WEBGL2)throw new Error("3D textures are not supported in WebGL1");c=l}if(p){if(ye(a))if(d){if(o==null)throw new Error("Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,i,0,0,0,n,s,o,r,a)}else l.compressedTexSubImage2D(e,i,0,0,n,s,r,a)}else if(d){if(o==null)throw new Error("Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,i,r,n,s,o,0,a)}else l.compressedTexImage2D(e,i,r,n,s,0,a)}_forEachMipmapLevel(e,i=1/0){let{width:r,height:n,depth:s,hasMipmap:o,target:a}=this._descriptor;const l=a===Ws.TEXTURE_3D;if(r==null||n==null||l&&s==null)throw new Error("Missing texture dimensions for mipmap calculation");for(let c=0;e(c,r,n,s),o&&(r!==1||n!==1||l&&s!==1)&&!(c>=i);++c)r=Math.max(1,r>>1),n=Math.max(1,n>>1),l&&(s=Math.max(1,s>>1))}static _validateTexture(e,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!");const r=e.type===lo.WEBGL2,n=i.width!=null&&MC(i.width)&&i.height!=null&&MC(i.height);r||!i.isImmutable&&!E6(i.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||n||(typeof i.wrapMode=="number"?i.wrapMode!==us.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):i.wrapMode.s===us.CLAMP_TO_EDGE&&i.wrapMode.t===us.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),i.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(e,i){let r=i.samplingMode,n=i.samplingMode;r===mn.LINEAR_MIPMAP_NEAREST||r===mn.LINEAR_MIPMAP_LINEAR?(r=mn.LINEAR,i.hasMipmap||(n=mn.LINEAR)):r!==mn.NEAREST_MIPMAP_NEAREST&&r!==mn.NEAREST_MIPMAP_LINEAR||(r=mn.NEAREST,i.hasMipmap||(n=mn.NEAREST)),e.texParameteri(i.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(i.target,e.TEXTURE_MIN_FILTER,n)}static _applyWrapMode(e,i){typeof i.wrapMode=="number"?(e.texParameteri(i.target,e.TEXTURE_WRAP_S,i.wrapMode),e.texParameteri(i.target,e.TEXTURE_WRAP_T,i.wrapMode)):(e.texParameteri(i.target,e.TEXTURE_WRAP_S,i.wrapMode.s),e.texParameteri(i.target,e.TEXTURE_WRAP_T,i.wrapMode.t))}static _applyAnisotropicFilteringParameters(e,i){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(i.target,r.TEXTURE_MAX_ANISOTROPY,i.maxAnisotropy??1)}};function hJi(t){return t in ks}function dJi(t){return t in Qh}function dme(t){return ye(t)&&"type"in t&&t.type==="compressed"}function pJi(t){return ye(t)&&"byteLength"in t}function d5e(t){return ye(t)&&!dme(t)&&!pJi(t)}function E6(t){return t===Ws.TEXTURE_3D||t===Ws.TEXTURE_2D_ARRAY}function lTt(t,e,i,r=1){let n=Math.max(e,i);return t===Ws.TEXTURE_3D&&(n=Math.max(n,r)),Math.round(Math.log(n)/Math.LN2)+1}bs.TEXTURE_UNIT_FOR_UPDATES=0;function uTt(t){const e=t.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 fJi(t,e){return t.vertexBuffers[e].size/mJi(t.layout[e])}function mJi(t){return t[0].stride}function gJi(t,e,i,r,n=0){const s=t.gl,o=t.capabilities.instancing;t.bindBuffer(i);for(const a of r){const l=e.get(a.name);l===void 0&&console.error(`There is no location for vertex attribute '${a.name}' defined.`);const c=n*a.stride;if(a.count<=4)s.vertexAttribPointer(l,a.count,a.type,a.normalized,a.stride,a.offset+c),s.enableVertexAttribArray(l),a.divisor>0&&o&&o.vertexAttribDivisor(l,a.divisor);else if(a.count===9)for(let d=0;d<3;d++)s.vertexAttribPointer(l+d,3,a.type,a.normalized,a.stride,a.offset+12*d+c),s.enableVertexAttribArray(l+d),a.divisor>0&&o&&o.vertexAttribDivisor(l+d,a.divisor);else if(a.count===16)for(let d=0;d<4;d++)s.vertexAttribPointer(l+d,4,a.type,a.normalized,a.stride,a.offset+16*d+c),s.enableVertexAttribArray(l+d),a.divisor>0&&o&&o.vertexAttribDivisor(l+d,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count)}}function yJi(t,e,i,r){const n=t.gl,s=t.capabilities.instancing;t.bindBuffer(i);for(const o of r){const a=e.get(o.name);if(o.count<=4)n.disableVertexAttribArray(a),o.divisor&&o.divisor>0&&s&&s.vertexAttribDivisor(a,0);else if(o.count===9)for(let l=0;l<3;l++)n.disableVertexAttribArray(a+l),o.divisor&&o.divisor>0&&s&&s.vertexAttribDivisor(a+l,0);else if(o.count===16)for(let l=0;l<4;l++)n.disableVertexAttribArray(a+l),o.divisor&&o.divisor>0&&s&&s.vertexAttribDivisor(a+l,0);else console.error("Unsupported vertex attribute element count: "+o.count)}t.unbindBuffer(to.ARRAY_BUFFER)}function cTt(t){switch(t){case nn.ALPHA:case nn.LUMINANCE:case nn.RED:case nn.RED_INTEGER:case ks.R8:case ks.R8I:case ks.R8UI:case ks.R8_SNORM:case gg.STENCIL_INDEX8:return 1;case nn.LUMINANCE_ALPHA:case nn.RG:case nn.RG_INTEGER:case ks.RGBA4:case ks.R16F:case ks.R16I:case ks.R16UI:case ks.RG8:case ks.RG8I:case ks.RG8UI:case ks.RG8_SNORM:case ks.RGB565:case ks.RGB5_A1:case gg.DEPTH_COMPONENT16:return 2;case nn.DEPTH_COMPONENT:case nn.RGB:case nn.RGB_INTEGER:case ks.RGB8:case ks.RGB8I:case ks.RGB8UI:case ks.RGB8_SNORM:case ks.SRGB8:case gg.DEPTH_COMPONENT24:return 3;case nn.DEPTH_STENCIL:case nn.RGBA:case nn.RGBA_INTEGER:case ks.RGBA8:case ks.R32F:case ks.R11F_G11F_B10F:case ks.RG16F:case ks.R32I:case ks.R32UI:case ks.RG16I:case ks.RG16UI:case ks.RGBA8I:case ks.RGBA8UI:case ks.RGBA8_SNORM:case ks.SRGB8_ALPHA8:case ks.RGB9_E5:case ks.RGB10_A2UI:case ks.RGB10_A2:case gg.DEPTH_STENCIL:case gg.DEPTH_COMPONENT32F:case gg.DEPTH24_STENCIL8:return 4;case gg.DEPTH32F_STENCIL8:return 5;case ks.RGB16F:case ks.RGB16I:case ks.RGB16UI:return 6;case ks.RG32F:case ks.RG32I:case ks.RG32UI:case ks.RGBA16F:case ks.RGBA16I:case ks.RGBA16UI:return 8;case ks.RGB32F:case ks.RGB32I:case ks.RGB32UI:return 12;case ks.RGBA32F:case ks.RGBA32I:case ks.RGBA32UI:return 16;case Qh.COMPRESSED_RGB_S3TC_DXT1_EXT:case Qh.COMPRESSED_RGBA_S3TC_DXT1_EXT:return .5;case Qh.COMPRESSED_RGBA_S3TC_DXT3_EXT:case Qh.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case Qh.COMPRESSED_R11_EAC:case Qh.COMPRESSED_SIGNED_R11_EAC:case Qh.COMPRESSED_RGB8_ETC2:case Qh.COMPRESSED_SRGB8_ETC2:case Qh.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case Qh.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return .5;case Qh.COMPRESSED_RG11_EAC:case Qh.COMPRESSED_SIGNED_RG11_EAC:case Qh.COMPRESSED_RGBA8_ETC2_EAC:case Qh.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function p5e(t){if(lt(t))return 0;if("descriptor"in t)return t.glName?p5e(t.descriptor):0;const e=t.internalFormat||"pixelFormat"in t&&t.pixelFormat;if(!e)return 0;const i="hasMipmap"in t&&t.hasMipmap?1.3:1,r=t.width*t.height;return cTt(e)*r*i}let id=class dH{constructor(e,i,r=null,n=null){if(this._context=e,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._depthStencilTexture=null,this._initialized=!1,this._desc={...i},e.instanceCounter.increment(gf.FramebufferObject,this),ye(r)){Array.isArray(r)||(r=[r]);for(let s=0;se+p5e(r),0)+p5e(this.depthStencilAttachment)}getColorTexture(e){const i=this._colorAttachments.get(e);return i&&gO(i)?i:null}attachColorTexture(e,i=bv.COLOR_ATTACHMENT0){e&&(this._validateColorAttachmentPoint(i),pme(e.descriptor,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,i)),this._colorAttachments.set(i,e))}detachColorTexture(e=bv.COLOR_ATTACHMENT0){const i=this._colorAttachments.get(e);if(gO(i)){const r=i;return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),r}}setColorTextureTarget(e,i=bv.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(i);gO(r)&&this._framebufferTexture2D(r.glName,i,e)}attachDepthStencilTexture(e){if(lt(e))return;const i=e.descriptor;i.pixelFormat!==nn.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),i.dataType!==ts.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!"),pme(i,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==gl.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=gl.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,Xgt)),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,Xgt)),this._depthStencilTexture=null,e}attachDepthStencilBuffer(e){if(lt(e))return;const i=e.descriptor;if(i.internalFormat!==gg.DEPTH_STENCIL&&i.internalFormat!==gg.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),f5e(i,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=i.internalFormat===gg.DEPTH_STENCIL?gl.DEPTH_STENCIL_RENDER_BUFFER:gl.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,n=this._desc.depthStencilTarget===gl.DEPTH_RENDER_BUFFER?r.DEPTH_ATTACHMENT:r.DEPTH_STENCIL_ATTACHMENT;r.framebufferRenderbuffer(Yf.FRAMEBUFFER,n,r.RENDERBUFFER,e.glName)}this._depthAttachment=e}detachDepthStencilBuffer(){const e=this._context.gl,i=this._depthAttachment;if(i&&this._initialized){this._context.bindFramebuffer(this);const r=this._desc.depthStencilTarget===gl.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(Yf.FRAMEBUFFER,r,e.RENDERBUFFER,null)}return this._depthAttachment=null,i}detachAll(){this._colorAttachments.forEach((e,i)=>this._detachColorAttachment(i)),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(e,i,r,n,s,o,a){(e<0||i<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=this._desc,c=a.descriptor;a.descriptor.target!==Ws.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(l?.width==null||l?.height==null||c?.width==null||c?.height==null||e+r>l.width||i+n>l.height||s+r>c.width||o+n>c.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const d=this._context,p=d.bindTexture(a,bs.TEXTURE_UNIT_FOR_UPDATES);d.setActiveTexture(bs.TEXTURE_UNIT_FOR_UPDATES),d.bindFramebuffer(this),d.gl.copyTexSubImage2D(Ws.TEXTURE_2D,0,s,o,e,i,r,n),d.bindTexture(p,bs.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,i,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,i,r,n,s,o,a)}async readPixelsAsync(e,i,r,n,s,o,a){if(this._context.type!==lo.WEBGL2)return xb()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,i,r,n,s,o,a);const l=this._context.gl,c=Ko.createPixelPack(this._context,Lo.STREAM_READ,a.byteLength);this._context.bindBuffer(c),this._context.bindFramebuffer(this),l.readPixels(e,i,r,n,s,o,0),this._context.unbindBuffer(to.PIXEL_PACK_BUFFER),await c.getSubDataAsync(a),c.dispose()}resize(e,i){const r=this._desc;if(r.width!==e||r.height!==i){if(r.width=e,r.height=i,!this._initialized)return this._colorAttachments.forEach(n=>{n&&n.resize(e,i)}),void(this._depthStencilTexture&&this._depthStencilTexture.resize(e,i));this._colorAttachments.forEach(n=>{n&&n.resize(e,i)}),this._depthStencilTexture!=null?this._depthStencilTexture.resize(e,i):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(e,i),this._stencilAttachment&&this._stencilAttachment.resize(e,i)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(e=Yf.FRAMEBUFFER){const i=this._context.gl;if(this._initialized)return void i.bindFramebuffer(e,this.glName);this._glName&&i.deleteFramebuffer(this._glName);const r=this._context,n=i.createFramebuffer(),s=this._desc,o=s.colorTarget??Th.RENDER_BUFFER,a=s.width??1,l=s.height??1;if(i.bindFramebuffer(e,n),this._colorAttachments.size===0)if(o===Th.TEXTURE||o===Th.CUBEMAP)this._colorAttachments.set(bv.COLOR_ATTACHMENT0,vJi(r,s,this.descriptor.colorTarget===Th.CUBEMAP?Ws.TEXTURE_CUBE_MAP:Ws.TEXTURE_2D));else{const d=new mO(r,{internalFormat:ks.RGBA4,width:a,height:l});this._colorAttachments.set(bv.COLOR_ATTACHMENT0,d)}this._colorAttachments.forEach((d,p)=>{d&&(gO(d)?this._framebufferTexture2D(d.glName,p,pTt(d),e):i.framebufferRenderbuffer(e,p,i.RENDERBUFFER,d.glName))});const c=s.depthStencilTarget??gl.NONE;switch(c){case gl.DEPTH_RENDER_BUFFER:case gl.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new mO(r,{internalFormat:s.depthStencilTarget===gl.DEPTH_RENDER_BUFFER?gg.DEPTH_COMPONENT16:gg.DEPTH_STENCIL,width:a,height:l}));const d=c===gl.DEPTH_RENDER_BUFFER?i.DEPTH_ATTACHMENT:i.DEPTH_STENCIL_ATTACHMENT;i.framebufferRenderbuffer(e,d,i.RENDERBUFFER,this._depthAttachment.glName);break}case gl.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new mO(r,{internalFormat:gg.STENCIL_INDEX8,width:a,height:l})),i.framebufferRenderbuffer(e,i.STENCIL_ATTACHMENT,i.RENDERBUFFER,this._stencilAttachment.glName);break;case gl.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){r.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const d={target:Ws.TEXTURE_2D,pixelFormat:nn.DEPTH_STENCIL,dataType:ts.UNSIGNED_INT_24_8,samplingMode:mn.NEAREST,wrapMode:us.CLAMP_TO_EDGE,width:a,height:l};this._depthStencilTexture=new bs(r,d)}this._framebufferTexture2D(this._depthStencilTexture.glName,i.DEPTH_STENCIL_ATTACHMENT,pTt(this._depthStencilTexture),e)}xb()&&i.checkFramebufferStatus(e)!==i.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=n,this._initialized=!0}_framebufferTexture2D(e,i=bv.COLOR_ATTACHMENT0,r=Ws.TEXTURE_2D,n=Yf.FRAMEBUFFER,s=0){this._context.gl.framebufferTexture2D(n,i,r,e,s)}_detachColorAttachment(e){xb()&&console.warn("Detaching an FBO attachment can be a slow due to invalidating framebuffer completeness!");const i=this._context.gl,r=this._colorAttachments.get(e);return gO(r)?this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)):this._initialized&&(this._context.bindFramebuffer(this),i.framebufferRenderbuffer(Yf.FRAMEBUFFER,e,i.RENDERBUFFER,null)),this._colorAttachments.delete(e),r}_disposeColorAttachments(){this._colorAttachments.forEach((e,i)=>{this._detachColorAttachment(i),e.dispose()}),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const i=this._desc.depthStencilTarget===gl.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(Yf.FRAMEBUFFER,i,e.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(Yf.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateColorAttachmentPoint(e){if(dH._MAX_COLOR_ATTACHMENTS===-1){const r=this._context.capabilities.drawBuffers;if(r){const n=this._context.gl;dH._MAX_COLOR_ATTACHMENTS=n.getParameter(r.MAX_COLOR_ATTACHMENTS)}else dH._MAX_COLOR_ATTACHMENTS=1}const i=e-bv.COLOR_ATTACHMENT0;i+1>dH._MAX_COLOR_ATTACHMENTS&&Ei.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${i+1}. Implementation supports up to ${dH._MAX_COLOR_ATTACHMENTS} color attachments`)}};function gO(t){return t!=null&&"type"in t&&t.type==="texture"}function hTt(t){return t!=null&&"type"in t&&t.type==="renderbuffer"}function dTt(t){return gO(t)||t!=null&&"pixelFormat"in t}function vJi(t,e,i){return new bs(t,{target:i,pixelFormat:nn.RGBA,dataType:ts.UNSIGNED_BYTE,samplingMode:mn.NEAREST,wrapMode:us.CLAMP_TO_EDGE,width:e.width,height:e.height})}function pme(t,e){t.target!==Ws.TEXTURE_2D&&t.target!==Ws.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),e.width!==void 0&&e.width>=0&&e.height!==void 0&&e.height>=0?e.width===t.width&&e.height===t.height||console.error("Color attachment texture must match the framebuffer's!"):(e.width=t.width,e.height=t.height)}function f5e(t,e){e.width!==void 0&&e.width>=0&&e.height!==void 0&&e.height>=0?e.width===t.width&&e.height===t.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(e.width=t.width,e.height=t.height)}function pTt(t){return t.descriptor.target===Ws.TEXTURE_CUBE_MAP?Ws.TEXTURE_CUBE_MAP_POSITIVE_X:Ws.TEXTURE_2D}id._MAX_COLOR_ATTACHMENTS=-1;const _Ji=["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 fTt,m5e={},bJi={get exports(){return m5e},set exports(t){m5e=t}};(fTt=["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&&(bJi.exports=fTt);const wJi=m5e;var mTt,g5e={},xJi={get exports(){return g5e},set exports(t){g5e=t}};mTt=xJi,function(t){var e=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"];e!==void 0&&(mTt.exports=e)}();const gTt=g5e;var y5e={},SJi={get exports(){return y5e},set exports(t){y5e=t}};(function(t){(function(e){var i=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"]}();i!==void 0&&(t.exports=i)})()})(SJi);const CJi=y5e;var SS=999,yTt=9999,v5e=0,_5e=1,vTt=2,_Tt=3,bTt=4,fme=5,TJi=6,EJi=7,IJi=8,wTt=9,AJi=10,xTt=11,PJi=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function OJi(){var t,e,i,r=0,n=0,s=SS,o=[],a=[],l=1,c=0,d=0,p=!1,y=!1,v="";return function(Ie){return a=[],Ie!==null?I(Ie.replace?Ie.replace(/\r\n/g,` -`):Ie):O()};function S(Ie){Ie.length&&a.push({type:PJi[s],data:Ie,position:d,line:l,column:c})}function I(Ie){var ke;for(r=0,i=(v+=Ie).length;t=v[r],r0)continue;Ne=Ie.slice(0,1).join("")}return S(Ne),d+=Ne.length,(o=o.slice(Ne.length)).length}}function re(){return/[^a-fA-F0-9]/.test(t)?(S(o.join("")),s=SS,r):(o.push(t),e=t,r+1)}function fe(){return t==="."||/[eE]/.test(t)?(o.push(t),s=fme,e=t,r+1):t==="x"&&o.length===1&&o[0]==="0"?(s=xTt,o.push(t),e=t,r+1):/[^\d]/.test(t)?(S(o.join("")),s=SS,r):(o.push(t),e=t,r+1)}function ge(){return t==="f"&&(o.push(t),e=t,r+=1),/[eE]/.test(t)||t==="-"&&/[eE]/.test(e)?(o.push(t),e=t,r+1):/[^\d]/.test(t)?(S(o.join("")),s=SS,r):(o.push(t),e=t,r+1)}function _e(){if(/[^\d\w_]/.test(t)){var Ie=o.join("");return s=wJi.indexOf(Ie)>-1?IJi:CJi.indexOf(Ie)>-1?EJi:TJi,S(o.join("")),s=SS,r}return o.push(t),e=t,r+1}}function RJi(t){var e=OJi(),i=[];return i=(i=i.concat(e(t))).concat(e(null))}function MJi(t){return RJi(t)}function DJi(t){return t.map(e=>e.type!=="eof"?e.data:"").join("")}const b5e=["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"];function FJi(t,e="100",i="300 es"){const r=/^\s*\#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const n of t)if(n.type==="preprocessor"){const s=r.exec(n.data);if(s){const o=s[1].replace(/\s\s+/g," ");if(o===i)return o;if(o===e)return n.data="#version "+i,e;throw new Error("unknown glsl version: "+o)}}return t.splice(0,0,{type:"preprocessor",data:"#version "+i},{type:"whitespace",data:` -`}),null}function LJi(t,e){for(let i=e-1;i>=0;i--){const r=t[i];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 IQ(t,e,i,r){r=r||i;for(const n of t)if(n.type==="ident"&&n.data===i)return r in e?e[r]++:e[r]=0,IQ(t,e,r+"_"+e[r],r);return i}function STt(t,e,i="afterVersion"){function r(l,c){for(let d=c;dl=0;--l){const c=r[l];if(c.type==="preprocessor"){const d=c.data.match(/\#extension\s+(.*)\:/);if(d&&d[1]&&b5e.includes(d[1].trim())){const v=r[l+1];r.splice(l,v&&v.type==="whitespace"?2:1)}const p=c.data.match(/\#ifdef\s+(.*)/);p&&p[1]&&b5e.includes(p[1].trim())&&(c.data="#if 1");const y=c.data.match(/\#ifndef\s+(.*)/);y&&y[1]&&b5e.includes(y[1].trim())&&(c.data="#if 0")}}return GJi(t,DJi(r))}function BJi(t){return null}function GJi(t,e){return e}const VJi=4294967295;let w5e=class{constructor(e,i,r,n,s=new Map){this._context=e,this._locations=n,this._uniformBlockBindings=s,this._refCount=1,this._compiled=!1,this._nameToUniformLocation={},this._nameToUniform1={},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!"),i.length===0&&console.error("Shaders source should not be empty!"),this._context.type===lo.WEBGL2&&(i=CTt(i,hb.VERTEX_SHADER),r=CTt(r,hb.FRAGMENT_SHADER)),this._vShader=TTt(this._context,hb.VERTEX_SHADER,i),this._fShader=TTt(this._context,hb.FRAGMENT_SHADER,r),this._vShader&&this._fShader||console.error("Error loading shaders!"),this._context.instanceCounter.increment(gf.Shader,this),c5e()&&(this.vertexShader=i,this.fragmentShader=r);const o=this._context.gl,a=o.createProgram();if(o.attachShader(a,this._vShader),o.attachShader(a,this._fShader),this._locations.forEach((l,c)=>o.bindAttribLocation(a,l,c)),o.linkProgram(a),c5e()&&!o.getProgramParameter(a,o.LINK_STATUS)&&console.error(`Could not link shader -validated: ${o.getProgramParameter(a,o.VALIDATE_STATUS)}, gl error ${o.getError()}, vertex: ${o.getShaderParameter(this._vShader,o.COMPILE_STATUS)}, fragment: ${o.getShaderParameter(this._fShader,o.COMPILE_STATUS)}, info log: ${o.getProgramInfoLog(a)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`),this._context.type===lo.WEBGL2){const l=o;for(const[c,d]of this._uniformBlockBindings){const p=l.getUniformBlockIndex(a,c);p0)return;const e=this._context.gl;this._vShader&&(e.deleteShader(this._vShader),this._vShader=null,this._context.instanceCounter.decrement(gf.Shader,this)),this._fShader&&(e.deleteShader(this._fShader),this._fShader=null),this._glName&&(e.deleteProgram(this._glName),this._glName=null,this._context.instanceCounter.decrement(gf.Program,this))}ref(){++this._refCount}_getUniformLocation(e){return this._nameToUniformLocation[e]===void 0&&ye(this.glName)&&(++x5e.numUniforms,this._nameToUniformLocation[e]=this._context.gl.getUniformLocation(this.glName,e)),this._nameToUniformLocation[e]}hasUniform(e){return this._getUniformLocation(e)!==null}setUniform1i(e,i){const r=this._nameToUniform1[e];r!==void 0&&i===r||(this._context.gl.uniform1i(this._getUniformLocation(e),i),this._nameToUniform1[e]=i)}setUniform1iv(e,i){LE(this._nameToUniform1v,e,i)&&this._context.gl.uniform1iv(this._getUniformLocation(e),i)}setUniform2iv(e,i){LE(this._nameToUniform2,e,i)&&this._context.gl.uniform2iv(this._getUniformLocation(e),i)}setUniform3iv(e,i){LE(this._nameToUniform3,e,i)&&this._context.gl.uniform3iv(this._getUniformLocation(e),i)}setUniform4iv(e,i){LE(this._nameToUniform4,e,i)&&this._context.gl.uniform4iv(this._getUniformLocation(e),i)}setUniform1f(e,i){const r=this._nameToUniform1[e];r!==void 0&&i===r||(this._context.gl.uniform1f(this._getUniformLocation(e),i),this._nameToUniform1[e]=i)}setUniform1fv(e,i){LE(this._nameToUniform1v,e,i)&&this._context.gl.uniform1fv(this._getUniformLocation(e),i)}setUniform2f(e,i,r){const n=this._nameToUniform2.get(e);n===void 0?(this._context.gl.uniform2f(this._getUniformLocation(e),i,r),this._nameToUniform2.set(e,[i,r])):i===n[0]&&r===n[1]||(this._context.gl.uniform2f(this._getUniformLocation(e),i,r),n[0]=i,n[1]=r)}setUniform2fv(e,i){LE(this._nameToUniform2,e,i)&&this._context.gl.uniform2fv(this._getUniformLocation(e),i)}setUniform3f(e,i,r,n){const s=this._nameToUniform3.get(e);s===void 0?(this._context.gl.uniform3f(this._getUniformLocation(e),i,r,n),this._nameToUniform3[e]=[i,r,n]):i===s[0]&&r===s[1]&&n===s[2]||(this._context.gl.uniform3f(this._getUniformLocation(e),i,r,n),s[0]=i,s[1]=r,s[2]=n)}setUniform3fv(e,i){LE(this._nameToUniform3,e,i)&&this._context.gl.uniform3fv(this._getUniformLocation(e),i)}setUniform4f(e,i,r,n,s){const o=this._nameToUniform4.get(e);o===void 0?(this._context.gl.uniform4f(this._getUniformLocation(e),i,r,n,s),this._nameToUniform4.set(e,[i,r,n,s])):o!==void 0&&i===o[0]&&r===o[1]&&n===o[2]&&s===o[3]||(this._context.gl.uniform4f(this._getUniformLocation(e),i,r,n,s),o[0]=i,o[1]=r,o[2]=n,o[3]=s)}setUniform4fv(e,i){LE(this._nameToUniform4,e,i)&&this._context.gl.uniform4fv(this._getUniformLocation(e),i)}setUniformMatrix3fv(e,i,r=!1){LE(this._nameToUniformMatrix3,e,i)&&this._context.gl.uniformMatrix3fv(this._getUniformLocation(e),r,i)}setUniformMatrix4fv(e,i,r=!1){LE(this._nameToUniformMatrix4,e,i)&&this._context.gl.uniformMatrix4fv(this._getUniformLocation(e),r,i)}stop(){}};function TTt(t,e,i){const r=t.gl,n=r.createShader(e);return r.shaderSource(n,i),r.compileShader(n),c5e()&&!r.getShaderParameter(n,r.COMPILE_STATUS)&&(console.error("Compile error in ".concat(e===hb.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(r.getShaderInfoLog(n)),console.error(UJi(i))),x5e.enabled&&(x5e.compiledLOC+=i.match(/\n/g).length+1),n}function UJi(t){let e=2;return t.replace(/\n/g,()=>` -`+jJi(e++)+":")}function jJi(t){return t>=1e3?t.toString():(" "+t).slice(-3)}function LE(t,e,i){const r=t.get(e);return r?QBe(r,i):(t.set(e,Array.from(i)),!0)}const x5e={compiledLOC:0,numUniforms:0,enabled:!1};let ETt=class{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return this._outer.size===0}get(e,i){return this._outer.get(e)?.get(i)}set(e,i,r){const n=this._outer.get(e);n?n.set(i,r):this._outer.set(e,new Map([[i,r]]))}delete(e,i){const r=this._outer.get(e);r&&(r.delete(i),r.size===0&&this._outer.delete(e))}forEach(e){this._outer.forEach((i,r)=>e(i,r))}},ITt=class{constructor(e){this._rctx=e,this._store=new ETt}dispose(){this._store.forEach(e=>e.forEach(i=>i.dispose())),this._store.clear()}acquire(e,i,r,n){const s=this._store.get(e,i);if(ye(s))return s.ref(),s;const o=new w5e(this._rctx,e,i,r,n);return o.ref(),this._store.set(e,i,o),o}get test(){let e=0;return this._store.forEach(i=>i.forEach(r=>e+=r.hasGLName?2:1)),{cachedWebGLObjects:e}}},S5e=class{constructor(e){this._readFile=e}resolveIncludes(e){return this._resolve(e)}_resolve(e,i=new Map){if(i.has(e))return i.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(c=>{l+=r.slice(a,c.start),l+=i.has(c.path)?"":this._resolve(c.path,i),a=c.start+c.length}),l+=r.slice(a),i.set(e,l),l}_read(e){return this._readFile(e)}};const I6=Ei.getLogger("esri.views.webgl.VertexArrayObject");let Ac=class{constructor(e,i,r,n,s=null){this._context=e,this._locations=i,this._layout=r,this._buffers=n,this._indexBuffer=s,this._glName=null,this._initialized=!1,e.instanceCounter.increment(gf.VertexArrayObject,this)}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce((e,i)=>e+this._buffers[i].size,ye(this._indexBuffer)?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(e=!0){if(!this._context)return void((this._glName||e&&Object.getOwnPropertyNames(this._buffers).length>0)&&I6.warn("Leaked WebGL VAO"));if(this._glName){const i=this._context?.capabilities?.vao;i?(i.deleteVertexArray(this._glName),this._glName=null):I6.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),e){for(const i in this._buffers)this._buffers[i]?.dispose(),delete this._buffers[i];this._indexBuffer=Ba(this._indexBuffer)}this._context.instanceCounter.decrement(gf.VertexArrayObject,this),this._context=vH(this._context)}initialize(){if(this._initialized)return;const e=this._context.capabilities.vao;if(e){const i=e.createVertexArray();e.bindVertexArray(i),this._bindLayout(),e.bindVertexArray(null),this._glName=i}this._initialized=!0}bind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:e,_layout:i,_indexBuffer:r}=this;e||I6.error("Vertex buffer dictionary is empty!");const n=this._context.gl;for(const s in e){const o=e[s];o||I6.error("Vertex buffer is uninitialized!");const a=i[s];a||I6.error("Vertex element descriptor is empty!"),gJi(this._context,this._locations,o,a)}ye(r)&&(this._context.capabilities.vao?n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r))}unbind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:e,_layout:i}=this;e||I6.error("Vertex buffer dictionary is empty!");for(const r in e){const n=e[r];n||I6.error("Vertex buffer is uninitialized!");const s=i[r];yJi(this._context,this._locations,n,s)}ye(this._indexBuffer)&&this._context.unbindBuffer(this._indexBuffer.bufferType)}};function zJi(t){const{options:e,value:i}=t;return typeof e[i]=="number"}function yO(t){let e="";for(const i in t){const r=t[i];if(typeof r=="boolean")r&&(e+=`#define ${i} + */const aZi=Object.freeze(Object.defineProperty({__proto__:null,CalciteTooltip:jTt,defineCustomElement:R5e},Symbol.toStringTag,{value:"Module"}));let I6=class extends Ui{constructor(e){super(e),this.geometries=[],this.outSpatialReference=null,this.transformation=null,this.transformForward=null}toJSON(){const e=this.geometries.map(n=>n.toJSON()),i=this.geometries[0],r={};return r.outSR=this.outSpatialReference.wkid||JSON.stringify(this.outSpatialReference.toJSON()),r.inSR=i.spatialReference.wkid||JSON.stringify(i.spatialReference.toJSON()),r.geometries=JSON.stringify({geometryType:bd(i),geometries:e}),this.transformation&&(r.transformation=this.transformation.wkid||JSON.stringify(this.transformation)),this.transformForward!=null&&(r.transformForward=this.transformForward),r}};E([N()],I6.prototype,"geometries",void 0),E([N({json:{read:{source:"outSR"}}})],I6.prototype,"outSpatialReference",void 0),E([N()],I6.prototype,"transformation",void 0),E([N()],I6.prototype,"transformForward",void 0),I6=E([dt("esri.rest.support.ProjectParameters")],I6);const HTt=I6,lZi=fd(HTt);async function uZi(t,e,i){e=lZi(e);const r=hh(t),n={...r.query,f:"json",...e.toJSON()},s=e.outSpatialReference,o=bd(e.geometries[0]),a=a_(n,i);return ur(r.path+"/project",a).then(({data:{geometries:l}})=>VXe(l,o,s))}async function WTt(t=null,e){if(pa.geometryServiceUrl)return pa.geometryServiceUrl;if(!t)throw new st("internal:geometry-service-url-not-configured");let i;i="portal"in t?t.portal||Cc.getDefault():t,await i.load({signal:e});const r=i.helperServices?.geometry?.url;if(!r)throw new st("internal:geometry-service-url-not-configured");return r}async function cZi(t,e,i=null,r){const n=await WTt(i,r),s=new HTt;s.geometries=[t],s.outSpatialReference=e;const o=await uZi(n,s,{signal:r});if(o&&Array.isArray(o)&&o.length===1)return o[0];throw new st("internal:geometry-service-projection-failed")}const hZi=Object.freeze(Object.defineProperty({__proto__:null,getGeometryServiceURL:WTt,projectGeometry:cZi},Symbol.toStringTag,{value:"Module"})),dZi=Oi.getLogger("esri.views.webgl.checkWebGLError");function pZi(t,e){switch(e){case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.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 t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const qTt=!!Hi("enable-feature:webgl-debug");function Eb(){return qTt}function M5e(){return qTt}function TF(t){if(Eb()){const e=t.getError();if(e){const i=pZi(t,e),r=new Error().stack;dZi.error(new st("webgl-error","WebGL error occured",{message:i,stack:r}))}}}const NE=Oi.getLogger("esri.views.webgl.BufferObject");let aa=class hH{static createIndex(e,i,r){return new hH(e,fo.ELEMENT_ARRAY_BUFFER,i,r)}static createVertex(e,i,r){return new hH(e,fo.ARRAY_BUFFER,i,r)}static createUniform(e,i,r){if(e.type!==bo.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new hH(e,fo.UNIFORM_BUFFER,i,r)}static createPixelPack(e,i=Xo.STREAM_READ,r){if(e.type!==bo.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const n=new hH(e,fo.PIXEL_PACK_BUFFER,i);return r&&n.setSize(r),n}static createPixelUnpack(e,i=Xo.STREAM_DRAW,r){if(e.type!==bo.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new hH(e,fo.PIXEL_UNPACK_BUFFER,i,r)}constructor(e,i,r,n){this._context=e,this.bufferType=i,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(bf.BufferObject,this),this._glName=this._context.gl.createBuffer(),TF(this._context.gl),n&&this.setData(n)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===fo.ELEMENT_ARRAY_BUFFER?this._indexType===Bi.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===fo.ELEMENT_ARRAY_BUFFER||this.bufferType===fo.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(bf.BufferObject,this),this._context=vH(this._context)):this._glName&&NE.warn("Leaked WebGL buffer object")}setSize(e,i=null){if(e<=0&&NE.error("Buffer size needs to be positive!"),this.bufferType===fo.ELEMENT_ARRAY_BUFFER&&ve(i))switch(this._indexType=i,i){case Bi.UNSIGNED_SHORT:e*=2;break;case Bi.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let i=e.byteLength;this.bufferType===fo.ELEMENT_ARRAY_BUFFER&&(__e(e)&&(i/=2,this._indexType=Bi.UNSIGNED_SHORT),cVe(e)&&(i/=4,this._indexType=Bi.UNSIGNED_INT)),this._setBufferData(i,e)}_setBufferData(e,i=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;ve(i)?n.bufferData(this.bufferType,i,this.usage):n.bufferData(this.bufferType,e,this.usage),TF(n),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,i,r,n){if(!e)return;(i<0||i*e.BYTES_PER_ELEMENT>=this.byteSize)&&NE.error("offset is out of range!"),r>=n&&NE.error("end must be bigger than start!"),(i+(n-r))*e.BYTES_PER_ELEMENT>this.byteSize&&NE.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 o=this._context.gl;if(this._context.type===bo.WEBGL2)o.bufferSubData(this.bufferType,i*e.BYTES_PER_ELEMENT,e,r,n-r);else{const a=r===0&&n===e.length?e:e.subarray(r,n);o.bufferSubData(this.bufferType,i*e.BYTES_PER_ELEMENT,a)}TF(o),this._isVAOAware&&this._context.bindVAO(s)}getSubData(e,i=0,r,n){if(this._context.type!==bo.WEBGL2)return void NE.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||n<0)return void NE.error("Problem getting subdata: offset and length were less than zero!");const s=fZi(e)?e.BYTES_PER_ELEMENT:1;if(s*((r??0)+(n??0))>e.byteLength)return void NE.error("Problem getting subdata: offset and length exceeded destination size!");i+s*(n??0)>this.byteSize&&NE.warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;this._context.bindBuffer(this,fo.COPY_READ_BUFFER),o.getBufferSubData(fo.COPY_READ_BUFFER,i,e,r,n),this._context.unbindBuffer(fo.COPY_READ_BUFFER)}async getSubDataAsync(e,i=0,r,n){this._context.type===bo.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,i,r,n)):NE.error("Get buffer subdata is supported in WebGL2 only!")}};function fZi(t){return nVe(t)}let vO=class{constructor(e,i){this._context=e,this._desc=i,this.type="renderbuffer",this._context.instanceCounter.increment(bf.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:n,height:s,internalFormat:o,multisampled:a}=i;if(a){if(this._context.type!==bo.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,n,s)}else r.renderbufferStorage(r.RENDERBUFFER,o,n,s)}get descriptor(){return this._desc}get samples(){const e=this._desc.samples,i=this._context.parameters.maxSamples;return e?Math.min(e,i):i}resize(e,i){const r=this._desc;if(r.width===e&&r.height===i)return;r.width=e,r.height=i;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(bf.Renderbuffer,this),this._context=vH(this._context))}};const D5e={target:so.TEXTURE_2D,samplingMode:In.LINEAR,wrapMode:ws.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1},YTt=4;let Fs=class{constructor(e,i,r=null){this._context=e,this.type="texture",this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,e.instanceCounter.increment(bf.Texture,this),this._descriptor={...D5e,...i};for(const n in D5e)this._descriptor[n]===void 0&&(this._descriptor[n]=D5e[n]);if(e.type!==bo.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),A6(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===so.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTexture(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(bf.Texture,this))}release(){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");r.width=e,r.height=i,this._descriptor.target===so.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let i=so.TEXTURE_CUBE_MAP_POSITIVE_X;i<=so.TEXTURE_CUBE_MAP_NEGATIVE_Z;i++)this._setData(e,i)}setData(e){this._setData(e)}_setData(e,i){if(!this._context||!this._context.gl)return;const r=this._context.gl;this._glName||(this._glName=r.createTexture()),e===void 0&&(e=null);const n=this._descriptor,s=i??n.target,o=A6(s);e===null&&(n.width=n.width||YTt,n.height=n.height||YTt,o&&(n.depth=n.depth??1));const a=this._context.bindTexture(this,Fs.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(Fs.TEXTURE_UNIT_FOR_UPDATES),Fs._validateTexture(this._context,n),this._configurePixelStorage(),TF(r);const l=n.pixelFormat;let c=n.internalFormat??this._deriveInternalFormat(l,n.dataType);if(F5e(e)){let h=e.width,p=e.height;const y=1;e instanceof HTMLVideoElement&&(h=e.videoWidth,p=e.videoHeight),n.width&&n.height,o&&n.depth,n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,c,n.hasMipmap,h,p,y),this._texImage(s,0,c,h,p,y,e),TF(r),n.hasMipmap&&this.generateMipmap(),n.width===void 0&&(n.width=h),n.height===void 0&&(n.height=p),o&&n.depth===void 0&&(n.depth=y)}else{const{width:h,height:p,depth:y}=n;if(h==null||p==null)throw new Error("Width and height must be specified!");if(o&&y==null)throw new Error("Depth must be specified!");if(n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,c,n.hasMipmap,h,p,y),r.DEPTH24_STENCIL8&&c===r.DEPTH_STENCIL&&(c=r.DEPTH24_STENCIL8),kme(e)){const v=e.levels,x=XTt(s,h,p,y),I=Math.min(x-1,v.length-1);ve(this._context.gl2)?r.texParameteri(n.target,this._context.gl2.TEXTURE_MAX_LEVEL,I):n.hasMipmap=n.hasMipmap&&x===v.length;const P=c;if(!gZi(P))throw new Error("Attempting to use compressed data with an umcompressed format!");this._forEachMipmapLevel((F,k,j,V)=>{const Y=v[Math.min(F,v.length-1)];this._compressedTexImage(s,F,P,k,j,V,Y)},I)}else ve(e)?(this._texImage(s,0,c,h,p,y,e),TF(r),n.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel((v,x,I,P)=>{this._texImage(s,v,c,x,I,P,null),TF(r)})}Fs._applySamplingMode(r,this._descriptor),Fs._applyWrapMode(r,this._descriptor),Fs._applyAnisotropicFilteringParameters(this._context,this._descriptor),TF(r),this._context.bindTexture(a,Fs.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,i,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._context.gl,c=this._descriptor,{pixelFormat:h,dataType:p,target:y,isImmutable:v}=c,x=c.internalFormat??this._deriveInternalFormat(h,p);if(v&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const I=this._context.bindTexture(this,Fs.TEXTURE_UNIT_FOR_UPDATES,!0);if((i<0||r<0||n>c.width||s>c.height||i+n>c.width||r+s>c.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),a){if(lt(this._context.gl2))return void console.error("Webgl2 must be enabled to use dataRowOffset!");l.pixelStorei(this._context.gl2.UNPACK_SKIP_ROWS,a)}if(F5e(o)?ve(this._context.gl2)?this._context.gl2.texSubImage2D(y,e,i,r,n,s,h,p,o):l.texSubImage2D(y,e,i,r,h,p,o):kme(o)?l.compressedTexSubImage2D(y,e,i,r,n,s,x,o.levels[e]):l.texSubImage2D(y,e,i,r,n,s,h,p,o),a){if(lt(this._context.gl2))return void console.error("Webgl2 must be enabled to use dataRowOffset!");l.pixelStorei(this._context.gl2.UNPACK_SKIP_ROWS,0)}this._context.bindTexture(I,Fs.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,i,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 c=this._context.gl2;if(lt(c))throw new Error("3D textures are not supported in WebGL1");const h=this._descriptor,{pixelFormat:p,dataType:y,isImmutable:v,target:x}=h,I=h.internalFormat??this._deriveInternalFormat(p,y);if(v&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");A6(x)||console.warn("Attempting to set 3D texture data on a non-3D texture");const P=this._context.bindTexture(this,Fs.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(Fs.TEXTURE_UNIT_FOR_UPDATES),(i<0||r<0||n<0||s>h.width||o>h.height||a>h.depth||i+s>h.width||r+o>h.height||n+a>h.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),kme(l))l=l.levels[e],c.compressedTexSubImage3D(x,e,i,r,n,s,o,a,I,l);else{const F=l;c.texSubImage3D(x,e,i,r,n,s,o,a,p,y,F)}this._context.bindTexture(P,Fs.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,Fs._validateTexture(this._context,e)}e.samplingMode===In.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=In.LINEAR_MIPMAP_NEAREST):e.samplingMode===In.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=In.NEAREST_MIPMAP_NEAREST);const i=this._context.bindTexture(this,Fs.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(Fs.TEXTURE_UNIT_FOR_UPDATES),this._context.gl.generateMipmap(e.target),this._context.bindTexture(i,Fs.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,Fs._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,i=this._descriptor;this._samplingModeDirty&&(Fs._applySamplingMode(e,i),this._samplingModeDirty=!1),this._wrapModeDirty&&(Fs._applyWrapMode(e,i),this._wrapModeDirty=!1)}_deriveInternalFormat(e,i){if(this._context.type===bo.WEBGL1)return e;switch(i){case ds.FLOAT:switch(e){case gn.RGBA:return qs.RGBA32F;case gn.RGB:return qs.RGB32F;default:throw new Error("Unable to derive format")}case ds.UNSIGNED_BYTE:switch(e){case gn.RGBA:return qs.RGBA8;case gn.RGB:return qs.RGB8}default:return e}}_configurePixelStorage(){const e=this._context.gl,{unpackAlignment:i,flipped:r,preMultiplyAlpha:n}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,i),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n?1:0)}_texStorage(e,i,r,n,s,o){const a=this._context.gl2;if(lt(a))throw new Error("Immutable textures are not supported in WebGL1");if(!mZi(i))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?XTt(e,n,s,o):1;if(A6(e)){if(o==null)throw new Error("Missing depth dimension for 3D texture upload");a.texStorage3D(e,l,i,n,s,o)}else a.texStorage2D(e,l,i,n,s);this._wasImmutablyAllocated=!0}_texImage(e,i,r,n,s,o,a){const l=this._context.gl;let c=null;const h=this._context.type===bo.WEBGL2,p=A6(e),{isImmutable:y,pixelFormat:v,dataType:x}=this._descriptor;if(h&&(c=l),h||!F5e(a))if(y){if(ve(a)){const I=a;if(p){if(o==null)throw new Error("Missing depth dimension for 3D texture upload");c.texSubImage3D(e,i,0,0,0,n,s,o,v,x,I)}else l.texSubImage2D(e,i,0,0,n,s,v,x,I)}}else{const I=a;if(p){if(o==null)throw new Error("Missing depth dimension for 3D texture upload");c.texImage3D(e,i,r,n,s,o,0,v,x,I)}else l.texImage2D(e,i,r,n,s,0,v,x,I)}else l.texImage2D(e,0,r,v,x,a)}_compressedTexImage(e,i,r,n,s,o,a){const l=this._context.gl;let c=null;const h=A6(e),p=this._descriptor.isImmutable;if(h){if(this._context.type!==bo.WEBGL2)throw new Error("3D textures are not supported in WebGL1");c=l}if(p){if(ve(a))if(h){if(o==null)throw new Error("Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,i,0,0,0,n,s,o,r,a)}else l.compressedTexSubImage2D(e,i,0,0,n,s,r,a)}else if(h){if(o==null)throw new Error("Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,i,r,n,s,o,0,a)}else l.compressedTexImage2D(e,i,r,n,s,0,a)}_forEachMipmapLevel(e,i=1/0){let{width:r,height:n,depth:s,hasMipmap:o,target:a}=this._descriptor;const l=a===so.TEXTURE_3D;if(r==null||n==null||l&&s==null)throw new Error("Missing texture dimensions for mipmap calculation");for(let c=0;e(c,r,n,s),o&&(r!==1||n!==1||l&&s!==1)&&!(c>=i);++c)r=Math.max(1,r>>1),n=Math.max(1,n>>1),l&&(s=Math.max(1,s>>1))}static _validateTexture(e,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!");const r=e.type===bo.WEBGL2,n=i.width!=null&&OC(i.width)&&i.height!=null&&OC(i.height);r||!i.isImmutable&&!A6(i.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||n||(typeof i.wrapMode=="number"?i.wrapMode!==ws.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):i.wrapMode.s===ws.CLAMP_TO_EDGE&&i.wrapMode.t===ws.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),i.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(e,i){let r=i.samplingMode,n=i.samplingMode;r===In.LINEAR_MIPMAP_NEAREST||r===In.LINEAR_MIPMAP_LINEAR?(r=In.LINEAR,i.hasMipmap||(n=In.LINEAR)):r!==In.NEAREST_MIPMAP_NEAREST&&r!==In.NEAREST_MIPMAP_LINEAR||(r=In.NEAREST,i.hasMipmap||(n=In.NEAREST)),e.texParameteri(i.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(i.target,e.TEXTURE_MIN_FILTER,n)}static _applyWrapMode(e,i){typeof i.wrapMode=="number"?(e.texParameteri(i.target,e.TEXTURE_WRAP_S,i.wrapMode),e.texParameteri(i.target,e.TEXTURE_WRAP_T,i.wrapMode)):(e.texParameteri(i.target,e.TEXTURE_WRAP_S,i.wrapMode.s),e.texParameteri(i.target,e.TEXTURE_WRAP_T,i.wrapMode.t))}static _applyAnisotropicFilteringParameters(e,i){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(i.target,r.TEXTURE_MAX_ANISOTROPY,i.maxAnisotropy??1)}};function mZi(t){return t in qs}function gZi(t){return t in nd}function kme(t){return ve(t)&&"type"in t&&t.type==="compressed"}function yZi(t){return ve(t)&&"byteLength"in t}function F5e(t){return ve(t)&&!kme(t)&&!yZi(t)}function A6(t){return t===so.TEXTURE_3D||t===so.TEXTURE_2D_ARRAY}function XTt(t,e,i,r=1){let n=Math.max(e,i);return t===so.TEXTURE_3D&&(n=Math.max(n,r)),Math.round(Math.log(n)/Math.LN2)+1}Fs.TEXTURE_UNIT_FOR_UPDATES=0;function KTt(t){const e=t.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 vZi(t,e){return t.vertexBuffers[e].size/_Zi(t.layout[e])}function _Zi(t){return t[0].stride}function bZi(t,e,i,r,n=0){const s=t.gl,o=t.capabilities.instancing;t.bindBuffer(i);for(const a of r){const l=e.get(a.name);l===void 0&&console.error(`There is no location for vertex attribute '${a.name}' defined.`);const c=n*a.stride;if(a.count<=4)s.vertexAttribPointer(l,a.count,a.type,a.normalized,a.stride,a.offset+c),s.enableVertexAttribArray(l),a.divisor>0&&o&&o.vertexAttribDivisor(l,a.divisor);else if(a.count===9)for(let h=0;h<3;h++)s.vertexAttribPointer(l+h,3,a.type,a.normalized,a.stride,a.offset+12*h+c),s.enableVertexAttribArray(l+h),a.divisor>0&&o&&o.vertexAttribDivisor(l+h,a.divisor);else if(a.count===16)for(let h=0;h<4;h++)s.vertexAttribPointer(l+h,4,a.type,a.normalized,a.stride,a.offset+16*h+c),s.enableVertexAttribArray(l+h),a.divisor>0&&o&&o.vertexAttribDivisor(l+h,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count)}}function wZi(t,e,i,r){const n=t.gl,s=t.capabilities.instancing;t.bindBuffer(i);for(const o of r){const a=e.get(o.name);if(o.count<=4)n.disableVertexAttribArray(a),o.divisor&&o.divisor>0&&s&&s.vertexAttribDivisor(a,0);else if(o.count===9)for(let l=0;l<3;l++)n.disableVertexAttribArray(a+l),o.divisor&&o.divisor>0&&s&&s.vertexAttribDivisor(a+l,0);else if(o.count===16)for(let l=0;l<4;l++)n.disableVertexAttribArray(a+l),o.divisor&&o.divisor>0&&s&&s.vertexAttribDivisor(a+l,0);else console.error("Unsupported vertex attribute element count: "+o.count)}t.unbindBuffer(fo.ARRAY_BUFFER)}function JTt(t){switch(t){case gn.ALPHA:case gn.LUMINANCE:case gn.RED:case gn.RED_INTEGER:case qs.R8:case qs.R8I:case qs.R8UI:case qs.R8_SNORM:case xg.STENCIL_INDEX8:return 1;case gn.LUMINANCE_ALPHA:case gn.RG:case gn.RG_INTEGER:case qs.RGBA4:case qs.R16F:case qs.R16I:case qs.R16UI:case qs.RG8:case qs.RG8I:case qs.RG8UI:case qs.RG8_SNORM:case qs.RGB565:case qs.RGB5_A1:case xg.DEPTH_COMPONENT16:return 2;case gn.DEPTH_COMPONENT:case gn.RGB:case gn.RGB_INTEGER:case qs.RGB8:case qs.RGB8I:case qs.RGB8UI:case qs.RGB8_SNORM:case qs.SRGB8:case xg.DEPTH_COMPONENT24:return 3;case gn.DEPTH_STENCIL:case gn.RGBA:case gn.RGBA_INTEGER:case qs.RGBA8:case qs.R32F:case qs.R11F_G11F_B10F:case qs.RG16F:case qs.R32I:case qs.R32UI:case qs.RG16I:case qs.RG16UI:case qs.RGBA8I:case qs.RGBA8UI:case qs.RGBA8_SNORM:case qs.SRGB8_ALPHA8:case qs.RGB9_E5:case qs.RGB10_A2UI:case qs.RGB10_A2:case xg.DEPTH_STENCIL:case xg.DEPTH_COMPONENT32F:case xg.DEPTH24_STENCIL8:return 4;case xg.DEPTH32F_STENCIL8:return 5;case qs.RGB16F:case qs.RGB16I:case qs.RGB16UI:return 6;case qs.RG32F:case qs.RG32I:case qs.RG32UI:case qs.RGBA16F:case qs.RGBA16I:case qs.RGBA16UI:return 8;case qs.RGB32F:case qs.RGB32I:case qs.RGB32UI:return 12;case qs.RGBA32F:case qs.RGBA32I:case qs.RGBA32UI:return 16;case nd.COMPRESSED_RGB_S3TC_DXT1_EXT:case nd.COMPRESSED_RGBA_S3TC_DXT1_EXT:return .5;case nd.COMPRESSED_RGBA_S3TC_DXT3_EXT:case nd.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case nd.COMPRESSED_R11_EAC:case nd.COMPRESSED_SIGNED_R11_EAC:case nd.COMPRESSED_RGB8_ETC2:case nd.COMPRESSED_SRGB8_ETC2:case nd.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case nd.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return .5;case nd.COMPRESSED_RG11_EAC:case nd.COMPRESSED_SIGNED_RG11_EAC:case nd.COMPRESSED_RGBA8_ETC2_EAC:case nd.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function L5e(t){if(lt(t))return 0;if("descriptor"in t)return t.glName?L5e(t.descriptor):0;const e=t.internalFormat||"pixelFormat"in t&&t.pixelFormat;if(!e)return 0;const i="hasMipmap"in t&&t.hasMipmap?1.3:1,r=t.width*t.height;return JTt(e)*r*i}let ad=class dH{constructor(e,i,r=null,n=null){if(this._context=e,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._depthStencilTexture=null,this._initialized=!1,this._desc={...i},e.instanceCounter.increment(bf.FramebufferObject,this),ve(r)){Array.isArray(r)||(r=[r]);for(let s=0;se+L5e(r),0)+L5e(this.depthStencilAttachment)}getColorTexture(e){const i=this._colorAttachments.get(e);return i&&_O(i)?i:null}attachColorTexture(e,i=Sv.COLOR_ATTACHMENT0){e&&(this._validateColorAttachmentPoint(i),$me(e.descriptor,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,i)),this._colorAttachments.set(i,e))}detachColorTexture(e=Sv.COLOR_ATTACHMENT0){const i=this._colorAttachments.get(e);if(_O(i)){const r=i;return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),r}}setColorTextureTarget(e,i=Sv.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(i);_O(r)&&this._framebufferTexture2D(r.glName,i,e)}attachDepthStencilTexture(e){if(lt(e))return;const i=e.descriptor;i.pixelFormat!==gn.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),i.dataType!==ds.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!"),$me(i,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==Tl.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=Tl.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,Lyt)),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,Lyt)),this._depthStencilTexture=null,e}attachDepthStencilBuffer(e){if(lt(e))return;const i=e.descriptor;if(i.internalFormat!==xg.DEPTH_STENCIL&&i.internalFormat!==xg.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),N5e(i,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=i.internalFormat===xg.DEPTH_STENCIL?Tl.DEPTH_STENCIL_RENDER_BUFFER:Tl.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,n=this._desc.depthStencilTarget===Tl.DEPTH_RENDER_BUFFER?r.DEPTH_ATTACHMENT:r.DEPTH_STENCIL_ATTACHMENT;r.framebufferRenderbuffer(tm.FRAMEBUFFER,n,r.RENDERBUFFER,e.glName)}this._depthAttachment=e}detachDepthStencilBuffer(){const e=this._context.gl,i=this._depthAttachment;if(i&&this._initialized){this._context.bindFramebuffer(this);const r=this._desc.depthStencilTarget===Tl.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(tm.FRAMEBUFFER,r,e.RENDERBUFFER,null)}return this._depthAttachment=null,i}detachAll(){this._colorAttachments.forEach((e,i)=>this._detachColorAttachment(i)),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(e,i,r,n,s,o,a){(e<0||i<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=this._desc,c=a.descriptor;a.descriptor.target!==so.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(l?.width==null||l?.height==null||c?.width==null||c?.height==null||e+r>l.width||i+n>l.height||s+r>c.width||o+n>c.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const h=this._context,p=h.bindTexture(a,Fs.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(Fs.TEXTURE_UNIT_FOR_UPDATES),h.bindFramebuffer(this),h.gl.copyTexSubImage2D(so.TEXTURE_2D,0,s,o,e,i,r,n),h.bindTexture(p,Fs.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,i,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,i,r,n,s,o,a)}async readPixelsAsync(e,i,r,n,s,o,a){if(this._context.type!==bo.WEBGL2)return Eb()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,i,r,n,s,o,a);const l=this._context.gl,c=aa.createPixelPack(this._context,Xo.STREAM_READ,a.byteLength);this._context.bindBuffer(c),this._context.bindFramebuffer(this),l.readPixels(e,i,r,n,s,o,0),this._context.unbindBuffer(fo.PIXEL_PACK_BUFFER),await c.getSubDataAsync(a),c.dispose()}resize(e,i){const r=this._desc;if(r.width!==e||r.height!==i){if(r.width=e,r.height=i,!this._initialized)return this._colorAttachments.forEach(n=>{n&&n.resize(e,i)}),void(this._depthStencilTexture&&this._depthStencilTexture.resize(e,i));this._colorAttachments.forEach(n=>{n&&n.resize(e,i)}),this._depthStencilTexture!=null?this._depthStencilTexture.resize(e,i):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(e,i),this._stencilAttachment&&this._stencilAttachment.resize(e,i)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(e=tm.FRAMEBUFFER){const i=this._context.gl;if(this._initialized)return void i.bindFramebuffer(e,this.glName);this._glName&&i.deleteFramebuffer(this._glName);const r=this._context,n=i.createFramebuffer(),s=this._desc,o=s.colorTarget??Ah.RENDER_BUFFER,a=s.width??1,l=s.height??1;if(i.bindFramebuffer(e,n),this._colorAttachments.size===0)if(o===Ah.TEXTURE||o===Ah.CUBEMAP)this._colorAttachments.set(Sv.COLOR_ATTACHMENT0,xZi(r,s,this.descriptor.colorTarget===Ah.CUBEMAP?so.TEXTURE_CUBE_MAP:so.TEXTURE_2D));else{const h=new vO(r,{internalFormat:qs.RGBA4,width:a,height:l});this._colorAttachments.set(Sv.COLOR_ATTACHMENT0,h)}this._colorAttachments.forEach((h,p)=>{h&&(_O(h)?this._framebufferTexture2D(h.glName,p,eEt(h),e):i.framebufferRenderbuffer(e,p,i.RENDERBUFFER,h.glName))});const c=s.depthStencilTarget??Tl.NONE;switch(c){case Tl.DEPTH_RENDER_BUFFER:case Tl.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new vO(r,{internalFormat:s.depthStencilTarget===Tl.DEPTH_RENDER_BUFFER?xg.DEPTH_COMPONENT16:xg.DEPTH_STENCIL,width:a,height:l}));const h=c===Tl.DEPTH_RENDER_BUFFER?i.DEPTH_ATTACHMENT:i.DEPTH_STENCIL_ATTACHMENT;i.framebufferRenderbuffer(e,h,i.RENDERBUFFER,this._depthAttachment.glName);break}case Tl.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new vO(r,{internalFormat:xg.STENCIL_INDEX8,width:a,height:l})),i.framebufferRenderbuffer(e,i.STENCIL_ATTACHMENT,i.RENDERBUFFER,this._stencilAttachment.glName);break;case Tl.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){r.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const h={target:so.TEXTURE_2D,pixelFormat:gn.DEPTH_STENCIL,dataType:ds.UNSIGNED_INT_24_8,samplingMode:In.NEAREST,wrapMode:ws.CLAMP_TO_EDGE,width:a,height:l};this._depthStencilTexture=new Fs(r,h)}this._framebufferTexture2D(this._depthStencilTexture.glName,i.DEPTH_STENCIL_ATTACHMENT,eEt(this._depthStencilTexture),e)}Eb()&&i.checkFramebufferStatus(e)!==i.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=n,this._initialized=!0}_framebufferTexture2D(e,i=Sv.COLOR_ATTACHMENT0,r=so.TEXTURE_2D,n=tm.FRAMEBUFFER,s=0){this._context.gl.framebufferTexture2D(n,i,r,e,s)}_detachColorAttachment(e){Eb()&&console.warn("Detaching an FBO attachment can be a slow due to invalidating framebuffer completeness!");const i=this._context.gl,r=this._colorAttachments.get(e);return _O(r)?this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)):this._initialized&&(this._context.bindFramebuffer(this),i.framebufferRenderbuffer(tm.FRAMEBUFFER,e,i.RENDERBUFFER,null)),this._colorAttachments.delete(e),r}_disposeColorAttachments(){this._colorAttachments.forEach((e,i)=>{this._detachColorAttachment(i),e.dispose()}),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const i=this._desc.depthStencilTarget===Tl.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(tm.FRAMEBUFFER,i,e.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(tm.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateColorAttachmentPoint(e){if(dH._MAX_COLOR_ATTACHMENTS===-1){const r=this._context.capabilities.drawBuffers;if(r){const n=this._context.gl;dH._MAX_COLOR_ATTACHMENTS=n.getParameter(r.MAX_COLOR_ATTACHMENTS)}else dH._MAX_COLOR_ATTACHMENTS=1}const i=e-Sv.COLOR_ATTACHMENT0;i+1>dH._MAX_COLOR_ATTACHMENTS&&Oi.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${i+1}. Implementation supports up to ${dH._MAX_COLOR_ATTACHMENTS} color attachments`)}};function _O(t){return t!=null&&"type"in t&&t.type==="texture"}function ZTt(t){return t!=null&&"type"in t&&t.type==="renderbuffer"}function QTt(t){return _O(t)||t!=null&&"pixelFormat"in t}function xZi(t,e,i){return new Fs(t,{target:i,pixelFormat:gn.RGBA,dataType:ds.UNSIGNED_BYTE,samplingMode:In.NEAREST,wrapMode:ws.CLAMP_TO_EDGE,width:e.width,height:e.height})}function $me(t,e){t.target!==so.TEXTURE_2D&&t.target!==so.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),e.width!==void 0&&e.width>=0&&e.height!==void 0&&e.height>=0?e.width===t.width&&e.height===t.height||console.error("Color attachment texture must match the framebuffer's!"):(e.width=t.width,e.height=t.height)}function N5e(t,e){e.width!==void 0&&e.width>=0&&e.height!==void 0&&e.height>=0?e.width===t.width&&e.height===t.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(e.width=t.width,e.height=t.height)}function eEt(t){return t.descriptor.target===so.TEXTURE_CUBE_MAP?so.TEXTURE_CUBE_MAP_POSITIVE_X:so.TEXTURE_2D}ad._MAX_COLOR_ATTACHMENTS=-1;const SZi=["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 tEt,k5e={},CZi={get exports(){return k5e},set exports(t){k5e=t}};(tEt=["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&&(CZi.exports=tEt);const TZi=k5e;var iEt,$5e={},EZi={get exports(){return $5e},set exports(t){$5e=t}};iEt=EZi,function(t){var e=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"];e!==void 0&&(iEt.exports=e)}();const rEt=$5e;var B5e={},IZi={get exports(){return B5e},set exports(t){B5e=t}};(function(t){(function(e){var i=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"]}();i!==void 0&&(t.exports=i)})()})(IZi);const AZi=B5e;var SS=999,nEt=9999,V5e=0,j5e=1,sEt=2,oEt=3,aEt=4,Bme=5,PZi=6,OZi=7,RZi=8,lEt=9,MZi=10,uEt=11,DZi=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function FZi(){var t,e,i,r=0,n=0,s=SS,o=[],a=[],l=1,c=0,h=0,p=!1,y=!1,v="";return function(xe){return a=[],xe!==null?I(xe.replace?xe.replace(/\r\n/g,` +`):xe):P()};function x(xe){xe.length&&a.push({type:DZi[s],data:xe,position:h,line:l,column:c})}function I(xe){var Pe;for(r=0,i=(v+=xe).length;t=v[r],r0)continue;ke=xe.slice(0,1).join("")}return x(ke),h+=ke.length,(o=o.slice(ke.length)).length}}function ie(){return/[^a-fA-F0-9]/.test(t)?(x(o.join("")),s=SS,r):(o.push(t),e=t,r+1)}function ce(){return t==="."||/[eE]/.test(t)?(o.push(t),s=Bme,e=t,r+1):t==="x"&&o.length===1&&o[0]==="0"?(s=uEt,o.push(t),e=t,r+1):/[^\d]/.test(t)?(x(o.join("")),s=SS,r):(o.push(t),e=t,r+1)}function he(){return t==="f"&&(o.push(t),e=t,r+=1),/[eE]/.test(t)||t==="-"&&/[eE]/.test(e)?(o.push(t),e=t,r+1):/[^\d]/.test(t)?(x(o.join("")),s=SS,r):(o.push(t),e=t,r+1)}function _e(){if(/[^\d\w_]/.test(t)){var xe=o.join("");return s=TZi.indexOf(xe)>-1?RZi:AZi.indexOf(xe)>-1?OZi:PZi,x(o.join("")),s=SS,r}return o.push(t),e=t,r+1}}function LZi(t){var e=FZi(),i=[];return i=(i=i.concat(e(t))).concat(e(null))}function NZi(t){return LZi(t)}function kZi(t){return t.map(e=>e.type!=="eof"?e.data:"").join("")}const G5e=["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"];function $Zi(t,e="100",i="300 es"){const r=/^\s*\#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const n of t)if(n.type==="preprocessor"){const s=r.exec(n.data);if(s){const o=s[1].replace(/\s\s+/g," ");if(o===i)return o;if(o===e)return n.data="#version "+i,e;throw new Error("unknown glsl version: "+o)}}return t.splice(0,0,{type:"preprocessor",data:"#version "+i},{type:"whitespace",data:` +`}),null}function BZi(t,e){for(let i=e-1;i>=0;i--){const r=t[i];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 MQ(t,e,i,r){r=r||i;for(const n of t)if(n.type==="ident"&&n.data===i)return r in e?e[r]++:e[r]=0,MQ(t,e,r+"_"+e[r],r);return i}function cEt(t,e,i="afterVersion"){function r(l,c){for(let h=c;hl=0;--l){const c=r[l];if(c.type==="preprocessor"){const h=c.data.match(/\#extension\s+(.*)\:/);if(h&&h[1]&&G5e.includes(h[1].trim())){const v=r[l+1];r.splice(l,v&&v.type==="whitespace"?2:1)}const p=c.data.match(/\#ifdef\s+(.*)/);p&&p[1]&&G5e.includes(p[1].trim())&&(c.data="#if 1");const y=c.data.match(/\#ifndef\s+(.*)/);y&&y[1]&&G5e.includes(y[1].trim())&&(c.data="#if 0")}}return zZi(t,kZi(r))}function UZi(t){return null}function zZi(t,e){return e}const HZi=4294967295;let U5e=class{constructor(e,i,r,n,s=new Map){this._context=e,this._locations=n,this._uniformBlockBindings=s,this._refCount=1,this._compiled=!1,this._nameToUniformLocation={},this._nameToUniform1={},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!"),i.length===0&&console.error("Shaders source should not be empty!"),this._context.type===bo.WEBGL2&&(i=hEt(i,mb.VERTEX_SHADER),r=hEt(r,mb.FRAGMENT_SHADER)),this._vShader=dEt(this._context,mb.VERTEX_SHADER,i),this._fShader=dEt(this._context,mb.FRAGMENT_SHADER,r),this._vShader&&this._fShader||console.error("Error loading shaders!"),this._context.instanceCounter.increment(bf.Shader,this),M5e()&&(this.vertexShader=i,this.fragmentShader=r);const o=this._context.gl,a=o.createProgram();if(o.attachShader(a,this._vShader),o.attachShader(a,this._fShader),this._locations.forEach((l,c)=>o.bindAttribLocation(a,l,c)),o.linkProgram(a),M5e()&&!o.getProgramParameter(a,o.LINK_STATUS)&&console.error(`Could not link shader +validated: ${o.getProgramParameter(a,o.VALIDATE_STATUS)}, gl error ${o.getError()}, vertex: ${o.getShaderParameter(this._vShader,o.COMPILE_STATUS)}, fragment: ${o.getShaderParameter(this._fShader,o.COMPILE_STATUS)}, info log: ${o.getProgramInfoLog(a)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`),this._context.type===bo.WEBGL2){const l=o;for(const[c,h]of this._uniformBlockBindings){const p=l.getUniformBlockIndex(a,c);p0)return;const e=this._context.gl;this._vShader&&(e.deleteShader(this._vShader),this._vShader=null,this._context.instanceCounter.decrement(bf.Shader,this)),this._fShader&&(e.deleteShader(this._fShader),this._fShader=null),this._glName&&(e.deleteProgram(this._glName),this._glName=null,this._context.instanceCounter.decrement(bf.Program,this))}ref(){++this._refCount}_getUniformLocation(e){return this._nameToUniformLocation[e]===void 0&&ve(this.glName)&&(++z5e.numUniforms,this._nameToUniformLocation[e]=this._context.gl.getUniformLocation(this.glName,e)),this._nameToUniformLocation[e]}hasUniform(e){return this._getUniformLocation(e)!==null}setUniform1i(e,i){const r=this._nameToUniform1[e];r!==void 0&&i===r||(this._context.gl.uniform1i(this._getUniformLocation(e),i),this._nameToUniform1[e]=i)}setUniform1iv(e,i){kE(this._nameToUniform1v,e,i)&&this._context.gl.uniform1iv(this._getUniformLocation(e),i)}setUniform2iv(e,i){kE(this._nameToUniform2,e,i)&&this._context.gl.uniform2iv(this._getUniformLocation(e),i)}setUniform3iv(e,i){kE(this._nameToUniform3,e,i)&&this._context.gl.uniform3iv(this._getUniformLocation(e),i)}setUniform4iv(e,i){kE(this._nameToUniform4,e,i)&&this._context.gl.uniform4iv(this._getUniformLocation(e),i)}setUniform1f(e,i){const r=this._nameToUniform1[e];r!==void 0&&i===r||(this._context.gl.uniform1f(this._getUniformLocation(e),i),this._nameToUniform1[e]=i)}setUniform1fv(e,i){kE(this._nameToUniform1v,e,i)&&this._context.gl.uniform1fv(this._getUniformLocation(e),i)}setUniform2f(e,i,r){const n=this._nameToUniform2.get(e);n===void 0?(this._context.gl.uniform2f(this._getUniformLocation(e),i,r),this._nameToUniform2.set(e,[i,r])):i===n[0]&&r===n[1]||(this._context.gl.uniform2f(this._getUniformLocation(e),i,r),n[0]=i,n[1]=r)}setUniform2fv(e,i){kE(this._nameToUniform2,e,i)&&this._context.gl.uniform2fv(this._getUniformLocation(e),i)}setUniform3f(e,i,r,n){const s=this._nameToUniform3.get(e);s===void 0?(this._context.gl.uniform3f(this._getUniformLocation(e),i,r,n),this._nameToUniform3[e]=[i,r,n]):i===s[0]&&r===s[1]&&n===s[2]||(this._context.gl.uniform3f(this._getUniformLocation(e),i,r,n),s[0]=i,s[1]=r,s[2]=n)}setUniform3fv(e,i){kE(this._nameToUniform3,e,i)&&this._context.gl.uniform3fv(this._getUniformLocation(e),i)}setUniform4f(e,i,r,n,s){const o=this._nameToUniform4.get(e);o===void 0?(this._context.gl.uniform4f(this._getUniformLocation(e),i,r,n,s),this._nameToUniform4.set(e,[i,r,n,s])):o!==void 0&&i===o[0]&&r===o[1]&&n===o[2]&&s===o[3]||(this._context.gl.uniform4f(this._getUniformLocation(e),i,r,n,s),o[0]=i,o[1]=r,o[2]=n,o[3]=s)}setUniform4fv(e,i){kE(this._nameToUniform4,e,i)&&this._context.gl.uniform4fv(this._getUniformLocation(e),i)}setUniformMatrix3fv(e,i,r=!1){kE(this._nameToUniformMatrix3,e,i)&&this._context.gl.uniformMatrix3fv(this._getUniformLocation(e),r,i)}setUniformMatrix4fv(e,i,r=!1){kE(this._nameToUniformMatrix4,e,i)&&this._context.gl.uniformMatrix4fv(this._getUniformLocation(e),r,i)}stop(){}};function dEt(t,e,i){const r=t.gl,n=r.createShader(e);return r.shaderSource(n,i),r.compileShader(n),M5e()&&!r.getShaderParameter(n,r.COMPILE_STATUS)&&(console.error("Compile error in ".concat(e===mb.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(r.getShaderInfoLog(n)),console.error(WZi(i))),z5e.enabled&&(z5e.compiledLOC+=i.match(/\n/g).length+1),n}function WZi(t){let e=2;return t.replace(/\n/g,()=>` +`+qZi(e++)+":")}function qZi(t){return t>=1e3?t.toString():(" "+t).slice(-3)}function kE(t,e,i){const r=t.get(e);return r?rVe(r,i):(t.set(e,Array.from(i)),!0)}const z5e={compiledLOC:0,numUniforms:0,enabled:!1};let pEt=class{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return this._outer.size===0}get(e,i){return this._outer.get(e)?.get(i)}set(e,i,r){const n=this._outer.get(e);n?n.set(i,r):this._outer.set(e,new Map([[i,r]]))}delete(e,i){const r=this._outer.get(e);r&&(r.delete(i),r.size===0&&this._outer.delete(e))}forEach(e){this._outer.forEach((i,r)=>e(i,r))}},fEt=class{constructor(e){this._rctx=e,this._store=new pEt}dispose(){this._store.forEach(e=>e.forEach(i=>i.dispose())),this._store.clear()}acquire(e,i,r,n){const s=this._store.get(e,i);if(ve(s))return s.ref(),s;const o=new U5e(this._rctx,e,i,r,n);return o.ref(),this._store.set(e,i,o),o}get test(){let e=0;return this._store.forEach(i=>i.forEach(r=>e+=r.hasGLName?2:1)),{cachedWebGLObjects:e}}},H5e=class{constructor(e){this._readFile=e}resolveIncludes(e){return this._resolve(e)}_resolve(e,i=new Map){if(i.has(e))return i.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(c=>{l+=r.slice(a,c.start),l+=i.has(c.path)?"":this._resolve(c.path,i),a=c.start+c.length}),l+=r.slice(a),i.set(e,l),l}_read(e){return this._readFile(e)}};const P6=Oi.getLogger("esri.views.webgl.VertexArrayObject");let Mc=class{constructor(e,i,r,n,s=null){this._context=e,this._locations=i,this._layout=r,this._buffers=n,this._indexBuffer=s,this._glName=null,this._initialized=!1,e.instanceCounter.increment(bf.VertexArrayObject,this)}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce((e,i)=>e+this._buffers[i].size,ve(this._indexBuffer)?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(e=!0){if(!this._context)return void((this._glName||e&&Object.getOwnPropertyNames(this._buffers).length>0)&&P6.warn("Leaked WebGL VAO"));if(this._glName){const i=this._context?.capabilities?.vao;i?(i.deleteVertexArray(this._glName),this._glName=null):P6.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),e){for(const i in this._buffers)this._buffers[i]?.dispose(),delete this._buffers[i];this._indexBuffer=qa(this._indexBuffer)}this._context.instanceCounter.decrement(bf.VertexArrayObject,this),this._context=vH(this._context)}initialize(){if(this._initialized)return;const e=this._context.capabilities.vao;if(e){const i=e.createVertexArray();e.bindVertexArray(i),this._bindLayout(),e.bindVertexArray(null),this._glName=i}this._initialized=!0}bind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:e,_layout:i,_indexBuffer:r}=this;e||P6.error("Vertex buffer dictionary is empty!");const n=this._context.gl;for(const s in e){const o=e[s];o||P6.error("Vertex buffer is uninitialized!");const a=i[s];a||P6.error("Vertex element descriptor is empty!"),bZi(this._context,this._locations,o,a)}ve(r)&&(this._context.capabilities.vao?n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r))}unbind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:e,_layout:i}=this;e||P6.error("Vertex buffer dictionary is empty!");for(const r in e){const n=e[r];n||P6.error("Vertex buffer is uninitialized!");const s=i[r];wZi(this._context,this._locations,n,s)}ve(this._indexBuffer)&&this._context.unbindBuffer(this._indexBuffer.bufferType)}};function YZi(t){const{options:e,value:i}=t;return typeof e[i]=="number"}function bO(t){let e="";for(const i in t){const r=t[i];if(typeof r=="boolean")r&&(e+=`#define ${i} `);else if(typeof r=="number")e+=`#define ${i} ${r.toFixed()} -`;else if(typeof r=="object")if(zJi(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(YZi(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 ${i} ${a}${n} `}else{const n=r.options;let s=0;for(const o in n)e+=`#define ${n[o]} ${(s++).toFixed()} `;e+=`#define ${i} ${n[r.value]} -`}}return e}function kE(t,e,i=""){return new w5e(t,i+e.shaders.vertexShader,i+e.shaders.fragmentShader,e.attributes)}const ATt=Object.freeze(Object.defineProperty({__proto__:null,BufferObject:Ko,FramebufferObject:id,Program:w5e,ProgramCache:ITt,Renderbuffer:mO,ShaderCompiler:S5e,Texture:bs,VertexArrayObject:Ac,createContextOrErrorHTML:Mrt,createProgram:kE,glslifyDefineMap:yO},Symbol.toStringTag,{value:"Module"})),AQ=-1;let lx=class extends fn{constructor(e){super(e),this._from=null,this._to=null,this._final=null,this._current=[],this._time=0,this.duration=Gi("mapview-transitions-duration"),this.effects=[]}set effect(e){if(this._get("effect")!==(e=e||"")){this._set("effect",e);try{this._transitionTo(PTt(e))}catch(i){this._transitionTo([]),Ei.getLogger(this.declaredClass).warn("Invalid Effect",{effect:e,error:i})}}}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&&OTt(this._current,PTt(e),this.scale)}catch{return!1}}transitionStep(e,i){this._applyTimeTransition(e),this._updateForScale(i)}endTransitions(){this._applyTimeTransition(this.duration)}_transitionTo(e){this.scale>0&&OTt(this._current,e,this.scale)?(this._final=e,this._to=hi(e),HJi(this._current,this._to,this.scale),this._from=hi(this._current),this._time=0):(this._from=this._to=this._final=null,this._current=e),this._set("effects",this._current[0]?hi(this._current[0].effects):[])}_applyTimeTransition(e){if(!(this._to&&this._from&&this._current&&this._final))return;this._time+=e;const i=Math.min(1,this._time/this.duration);for(let r=0;r=i[0].scale)s=n=i[0].effects;else if(e<=i[r].scale)s=n=i[r].effects;else for(let a=0;a=e&&c.scale<=e){o=(e-l.scale)/(c.scale-l.scale),n=l.effects,s=c.effects;break}}for(let a=0;a1||e.length>1)&&i<=0)&&qHe(t[0].effects,e[0].effects)}function HJi(t,e,i){const r=t.length>e.length?t:e,n=t.length>e.length?e:t,s=n[n.length-1],o=s?.scale??i,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 C5e=1,XJi=[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],KJi=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],PQ=256,SF={outlineWidth:1.3,outerHaloWidth:.4,innerHaloWidth:.4,outlinePosition:0},T5e=Ei.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function JJi(t,e){e.fillColor[0]=t.color.r/255,e.fillColor[1]=t.color.g/255,e.fillColor[2]=t.color.b/255,e.fillColor[3]=t.color.a,t.haloColor?(e.outlineColor[0]=t.haloColor.r/255,e.outlineColor[1]=t.haloColor.g/255,e.outlineColor[2]=t.haloColor.b/255,e.outlineColor[3]=t.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]*=t.fillOpacity,e.outlineColor[3]*=t.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=SF.outlineWidth,e.outerHaloWidth=SF.outerHaloWidth,e.innerHaloWidth=SF.innerHaloWidth,e.outlinePosition=SF.outlinePosition}const ZJi=[0,0,0,0];let QJi=class{constructor(){this._convertedHighlightOptions={fillColor:[.2*.75,.6*.75,.675,.75],outlineColor:[.2*.9,.54,.81,.9],outlinePosition:SF.outlinePosition,outlineWidth:SF.outlineWidth,innerHaloWidth:SF.innerHaloWidth,outerHaloWidth:SF.outerHaloWidth},this._shadeTexChanged=!0,this._texelData=new Uint8Array(4*PQ),this._minMaxDistance=[0,0]}setHighlightOptions(e){const i=this._convertedHighlightOptions;JJi(e,i);const r=i.outlinePosition-i.outlineWidth/2-i.outerHaloWidth,n=i.outlinePosition-i.outlineWidth/2,s=i.outlinePosition+i.outlineWidth/2,o=i.outlinePosition+i.outlineWidth/2+i.innerHaloWidth,a=Math.sqrt(Math.PI/2)*C5e,l=Math.abs(r)>a?Math.round(10*(Math.abs(r)-a))/10:0,c=Math.abs(o)>a?Math.round(10*(Math.abs(o)-a))/10:0;let d;l&&!c?T5e.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&&c?T5e.error("The inner rim of the highlight is "+c+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):l&&c&&T5e.error("The highlight is "+Math.max(l,c)+"px away from the edge of the feature; consider reducing some width values.");const p=[void 0,void 0,void 0,void 0];function y(S,I,O){p[0]=(1-O)*S[0]+O*I[0],p[1]=(1-O)*S[1]+O*I[1],p[2]=(1-O)*S[2]+O*I[2],p[3]=(1-O)*S[3]+O*I[3]}const{_texelData:v}=this;for(let S=0;Si.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 lx),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||(this._highlightGradient=new QJi),this._highlightGradient.setHighlightOptions(e),this.requestRender())}updateTransitionProperties(e,i){super.updateTransitionProperties(e,i),this._effectView&&(this._effectView.transitionStep(e,i),this._effectView.transitioning&&this.requestRender())}doRender(e){const i=this.createRenderParams(e);this.renderChildren(i)}addChild(e){return this.addChildAt(e,this.children.length)}addChildAt(e,i=this.children.length){if(!e||this.contains(e))return e;this._needsSort=!0;const r=e.parent;return r&&r!==this&&r.removeChild(e),i>=this.children.length?this.children.push(e):this.children.splice(i,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 i=this.children.splice(e,1)[0];return this._childrenSet.delete(i),this!==this.stage&&(i.clips=null),i.stage=null,i.parent=null,i}sortChildren(e){this._needsSort&&(this.children.sort(e),this._needsSort=!1)}beforeRender(e){super.beforeRender(e);for(const i of this.children)i.beforeRender(e)}afterRender(e){super.afterRender(e);for(const i of this.children)i.afterRender(e)}_createTransforms(){return{dvs:Cl()}}onAttach(){super.onAttach();const e=this.stage;for(const i of this.children)i.stage=e}onDetach(){super.onDetach();for(const e of this.children)e.stage=null}renderChildren(e){for(const i of this.children)i.processRender(e)}createRenderParams(e){return{...e,blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:e.globalOpacity*this.computedOpacity,inFadeTransition:this.inFadeTransition,highlightGradient:this._highlightGradient||e.highlightGradient}}},NE=class x5t{constructor(e){if(this.next=null,!Array.isArray(e))return void(this.data=e);this.data=e[0];let i=this;for(let r=1;re(i.data)?this:i;return this.next?this.next.max(e,r):r}remove(e,i=null){return this===e?i?(i.next=this.next,i):this.next:this.next?.remove(e,this)??null}get last(){return this.next?this.next.last:this}},RTt=class{constructor(e){this._head=null,lt(e)||(this._head=new NE(e))}get head(){return this._head}maxAvailableSpace(){if(lt(this._head))return 0;const e=this._head.max(i=>i.end-i.start);return e.data.end-e.data.start}firstFit(e){if(lt(this._head))return null;let i=null,r=this._head;for(;r;){const n=r.data.end-r.data.start;if(n===e)return i?i.next=r.next:this._head=r.next,r.data.start;if(n>e){const s=r.data.start;return r.data.start+=e,s}i=r,r=r.next}return null}free(e,i){const r=e+i;if(lt(this._head)){const a=new NE({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-=i);const a=new NE({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+=i,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-=i);const a=new NE({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+=i);const o=new NE({start:e,end:r});n.next=o}};const MTt=Gi("esri-2d-log-allocations");let eZi=class RBe{constructor(e,i){this._array=e,this._pool=i}get array(){return this._array}get length(){return this._array.length}static create(e,i){const r=i.acquire(e);return new RBe(r,i)}expand(e){const i=this._pool.acquire(e);i.set(this._array),this._pool.release(this._array),this._array=i}destroy(){this._pool.release(this._array)}set(e,i){this._array.set(e._array,i)}slice(){const e=this._pool.acquire(this._array.byteLength);return e.set(this._array),new RBe(e,this._pool)}},E5e=class S5t{constructor(){this._data=new ArrayBuffer(S5t.BYTE_LENGTH),this._freeList=new RTt({start:0,end:this._data.byteLength})}static get BYTE_LENGTH(){return 64e6}get buffer(){return this._data}allocate(e){const i=this._freeList.firstFit(e);return lt(i)?null:new Uint32Array(this._data,i,e/Uint32Array.BYTES_PER_ELEMENT)}free(e){this._freeList.free(e.byteOffset,e.byteLength)}},tZi=class{constructor(){this._bytesAllocated=0,this._pages=[],this._pagesByBuffer=new Map,this._addPage()}destroy(){this._pages=[],this._pagesByBuffer=null}get _bytesTotal(){return this._pages.length*E5e.BYTE_LENGTH}acquire(e){if(this._bytesAllocated+=e,MTt&&console.log(`Allocating ${e}, (${this._bytesAllocated} / ${this._bytesTotal})`),e>E5e.BYTE_LENGTH)return new Uint32Array(e/Uint32Array.BYTES_PER_ELEMENT);for(const i of this._pages){const r=i.allocate(e);if(ye(r))return r}return _u(this._addPage().allocate(e),"Expected to allocate page")}release(e){this._bytesAllocated-=e.byteLength,MTt&&console.log(`Freeing ${e.byteLength}, (${this._bytesAllocated} / ${this._bytesTotal})`);const i=this._pagesByBuffer.get(e.buffer);i&&i.free(e)}_addPage(){const e=new E5e;return this._pages.push(e),this._pagesByBuffer.set(e.buffer,e),e}},ux=class{constructor(e,i){this._rctx=e,this._vertexBuffer=Ko.createVertex(e,Lo.STATIC_DRAW,new Uint16Array(i)),this._vao=new Ac(e,new Map([["a_position",0]]),{geometry:[new qo("a_position",2,Di.SHORT,0,4)]},{geometry:this._vertexBuffer}),this._count=i.length/2}bind(){this._rctx.bindVAO(this._vao)}unbind(){this._rctx.bindVAO(null)}dispose(){this._vao.dispose(!1),this._vertexBuffer.dispose()}draw(){this._rctx.bindVAO(this._vao),this._rctx.drawArrays(ls.TRIANGLE_STRIP,0,this._count)}},j_=class{constructor(){this.name=this.constructor.name||"UnnamedBrush",this.brushEffect=null}prepareState(e,i){}draw(e,i,r){}drawMany(e,i,r){for(const n of i)n.visible&&this.draw(e,n,r)}};const I5e={nearest:{defines:[],samplingMode:mn.NEAREST,mips:!1},bilinear:{defines:[],samplingMode:mn.LINEAR,mips:!1},bicubic:{defines:["bicubic"],samplingMode:mn.LINEAR,mips:!1},trilinear:{defines:[],samplingMode:mn.LINEAR_MIPMAP_LINEAR,mips:!0}},iZi=(t,e,i)=>{if(i.samplingMode==="dynamic"){const{state:r}=t,n=e.resolution/e.pixelRatio/r.resolution,s=Math.round(t.pixelRatio)!==t.pixelRatio,o=n>1.05||n<.95;return r.rotation||o||s||e.isSourceScaled||e.rotation?I5e.bilinear:I5e.nearest}return I5e[i.samplingMode]};let rZi=class extends j_{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,i){const{context:r,renderingOptions:n,painter:s,requestRender:o,allowDelayedRender:a}=e;if(!i.source||!i.isReady)return;const l=iZi(e,i,n),c=s.materialManager.getProgram(this._desc,l.defines);if(a&&ye(o)&&!c.compiled)return void o();e.timeline.begin(this.name),i.blendFunction==="additive"?r.setBlendFunctionSeparate(cn.ONE,cn.ONE,cn.ONE,cn.ONE):r.setBlendFunctionSeparate(cn.ONE,cn.ONE_MINUS_SRC_ALPHA,cn.ONE,cn.ONE_MINUS_SRC_ALPHA),r.setStencilFunction(El.EQUAL,i.stencilRef,255),this._quad||(this._quad=new ux(r,[0,0,1,0,0,1,1,1]));const{coordScale:d,computedOpacity:p,transforms:y}=i;i.setSamplingProfile(l),i.bind(e.context,mpe),r.useProgram(c),c.setUniformMatrix3fv("u_dvsMat3",y.dvs),c.setUniform1i("u_texture",mpe),c.setUniform2fv("u_coordScale",d),c.setUniform1f("u_opacity",p),this._quad.draw(),e.timeline.end(this.name)}};function DTt(){return new Float32Array(4)}function nZi(t){const e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function $E(t,e,i,r){const n=new Float32Array(4);return n[0]=t,n[1]=e,n[2]=i,n[3]=r,n}function sZi(t,e){return new Float32Array(t,e,4)}function FTt(){return DTt()}function LTt(){return $E(1,1,1,1)}function kTt(){return $E(1,0,0,0)}function NTt(){return $E(0,1,0,0)}function $Tt(){return $E(0,0,1,0)}function BTt(){return $E(0,0,0,1)}const oZi=FTt(),aZi=LTt(),lZi=kTt(),uZi=NTt(),cZi=$Tt(),hZi=BTt();Object.freeze(Object.defineProperty({__proto__:null,ONES:aZi,UNIT_W:hZi,UNIT_X:lZi,UNIT_Y:uZi,UNIT_Z:cZi,ZEROS:oZi,clone:nZi,create:DTt,createView:sZi,fromValues:$E,ones:LTt,unitW:BTt,unitX:kTt,unitY:NTt,unitZ:$Tt,zeros:FTt},Symbol.toStringTag,{value:"Module"}));const dZi={background:{"background.frag":`uniform lowp vec4 u_color; +`}}return e}function $E(t,e,i=""){return new U5e(t,i+e.shaders.vertexShader,i+e.shaders.fragmentShader,e.attributes)}const mEt=Object.freeze(Object.defineProperty({__proto__:null,BufferObject:aa,FramebufferObject:ad,Program:U5e,ProgramCache:fEt,Renderbuffer:vO,ShaderCompiler:H5e,Texture:Fs,VertexArrayObject:Mc,createContextOrErrorHTML:Lrt,createProgram:$E,glslifyDefineMap:bO},Symbol.toStringTag,{value:"Module"})),DQ=-1;let cx=class extends Tn{constructor(e){super(e),this._from=null,this._to=null,this._final=null,this._current=[],this._time=0,this.duration=Hi("mapview-transitions-duration"),this.effects=[]}set effect(e){if(this._get("effect")!==(e=e||"")){this._set("effect",e);try{this._transitionTo(gEt(e))}catch(i){this._transitionTo([]),Oi.getLogger(this.declaredClass).warn("Invalid Effect",{effect:e,error:i})}}}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&&yEt(this._current,gEt(e),this.scale)}catch{return!1}}transitionStep(e,i){this._applyTimeTransition(e),this._updateForScale(i)}endTransitions(){this._applyTimeTransition(this.duration)}_transitionTo(e){this.scale>0&&yEt(this._current,e,this.scale)?(this._final=e,this._to=gi(e),XZi(this._current,this._to,this.scale),this._from=gi(this._current),this._time=0):(this._from=this._to=this._final=null,this._current=e),this._set("effects",this._current[0]?gi(this._current[0].effects):[])}_applyTimeTransition(e){if(!(this._to&&this._from&&this._current&&this._final))return;this._time+=e;const i=Math.min(1,this._time/this.duration);for(let r=0;r=i[0].scale)s=n=i[0].effects;else if(e<=i[r].scale)s=n=i[r].effects;else for(let a=0;a=e&&c.scale<=e){o=(e-l.scale)/(c.scale-l.scale),n=l.effects,s=c.effects;break}}for(let a=0;a1||e.length>1)&&i<=0)&&JHe(t[0].effects,e[0].effects)}function XZi(t,e,i){const r=t.length>e.length?t:e,n=t.length>e.length?e:t,s=n[n.length-1],o=s?.scale??i,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 W5e=1,QZi=[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],eQi=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],FQ=256,EF={outlineWidth:1.3,outerHaloWidth:.4,innerHaloWidth:.4,outlinePosition:0},q5e=Oi.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function tQi(t,e){e.fillColor[0]=t.color.r/255,e.fillColor[1]=t.color.g/255,e.fillColor[2]=t.color.b/255,e.fillColor[3]=t.color.a,t.haloColor?(e.outlineColor[0]=t.haloColor.r/255,e.outlineColor[1]=t.haloColor.g/255,e.outlineColor[2]=t.haloColor.b/255,e.outlineColor[3]=t.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]*=t.fillOpacity,e.outlineColor[3]*=t.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=EF.outlineWidth,e.outerHaloWidth=EF.outerHaloWidth,e.innerHaloWidth=EF.innerHaloWidth,e.outlinePosition=EF.outlinePosition}const iQi=[0,0,0,0];let rQi=class{constructor(){this._convertedHighlightOptions={fillColor:[.2*.75,.6*.75,.675,.75],outlineColor:[.2*.9,.54,.81,.9],outlinePosition:EF.outlinePosition,outlineWidth:EF.outlineWidth,innerHaloWidth:EF.innerHaloWidth,outerHaloWidth:EF.outerHaloWidth},this._shadeTexChanged=!0,this._texelData=new Uint8Array(4*FQ),this._minMaxDistance=[0,0]}setHighlightOptions(e){const i=this._convertedHighlightOptions;tQi(e,i);const r=i.outlinePosition-i.outlineWidth/2-i.outerHaloWidth,n=i.outlinePosition-i.outlineWidth/2,s=i.outlinePosition+i.outlineWidth/2,o=i.outlinePosition+i.outlineWidth/2+i.innerHaloWidth,a=Math.sqrt(Math.PI/2)*W5e,l=Math.abs(r)>a?Math.round(10*(Math.abs(r)-a))/10:0,c=Math.abs(o)>a?Math.round(10*(Math.abs(o)-a))/10:0;let h;l&&!c?q5e.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&&c?q5e.error("The inner rim of the highlight is "+c+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):l&&c&&q5e.error("The highlight is "+Math.max(l,c)+"px away from the edge of the feature; consider reducing some width values.");const p=[void 0,void 0,void 0,void 0];function y(x,I,P){p[0]=(1-P)*x[0]+P*I[0],p[1]=(1-P)*x[1]+P*I[1],p[2]=(1-P)*x[2]+P*I[2],p[3]=(1-P)*x[3]+P*I[3]}const{_texelData:v}=this;for(let x=0;xi.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 cx),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||(this._highlightGradient=new rQi),this._highlightGradient.setHighlightOptions(e),this.requestRender())}updateTransitionProperties(e,i){super.updateTransitionProperties(e,i),this._effectView&&(this._effectView.transitionStep(e,i),this._effectView.transitioning&&this.requestRender())}doRender(e){const i=this.createRenderParams(e);this.renderChildren(i)}addChild(e){return this.addChildAt(e,this.children.length)}addChildAt(e,i=this.children.length){if(!e||this.contains(e))return e;this._needsSort=!0;const r=e.parent;return r&&r!==this&&r.removeChild(e),i>=this.children.length?this.children.push(e):this.children.splice(i,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 i=this.children.splice(e,1)[0];return this._childrenSet.delete(i),this!==this.stage&&(i.clips=null),i.stage=null,i.parent=null,i}sortChildren(e){this._needsSort&&(this.children.sort(e),this._needsSort=!1)}beforeRender(e){super.beforeRender(e);for(const i of this.children)i.beforeRender(e)}afterRender(e){super.afterRender(e);for(const i of this.children)i.afterRender(e)}_createTransforms(){return{dvs:Dl()}}onAttach(){super.onAttach();const e=this.stage;for(const i of this.children)i.stage=e}onDetach(){super.onDetach();for(const e of this.children)e.stage=null}renderChildren(e){for(const i of this.children)i.processRender(e)}createRenderParams(e){return{...e,blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:e.globalOpacity*this.computedOpacity,inFadeTransition:this.inFadeTransition,highlightGradient:this._highlightGradient||e.highlightGradient}}},BE=class W5t{constructor(e){if(this.next=null,!Array.isArray(e))return void(this.data=e);this.data=e[0];let i=this;for(let r=1;re(i.data)?this:i;return this.next?this.next.max(e,r):r}remove(e,i=null){return this===e?i?(i.next=this.next,i):this.next:this.next?.remove(e,this)??null}get last(){return this.next?this.next.last:this}},vEt=class{constructor(e){this._head=null,lt(e)||(this._head=new BE(e))}get head(){return this._head}maxAvailableSpace(){if(lt(this._head))return 0;const e=this._head.max(i=>i.end-i.start);return e.data.end-e.data.start}firstFit(e){if(lt(this._head))return null;let i=null,r=this._head;for(;r;){const n=r.data.end-r.data.start;if(n===e)return i?i.next=r.next:this._head=r.next,r.data.start;if(n>e){const s=r.data.start;return r.data.start+=e,s}i=r,r=r.next}return null}free(e,i){const r=e+i;if(lt(this._head)){const a=new BE({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-=i);const a=new BE({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+=i,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-=i);const a=new BE({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+=i);const o=new BE({start:e,end:r});n.next=o}};const _Et=Hi("esri-2d-log-allocations");let nQi=class LBe{constructor(e,i){this._array=e,this._pool=i}get array(){return this._array}get length(){return this._array.length}static create(e,i){const r=i.acquire(e);return new LBe(r,i)}expand(e){const i=this._pool.acquire(e);i.set(this._array),this._pool.release(this._array),this._array=i}destroy(){this._pool.release(this._array)}set(e,i){this._array.set(e._array,i)}slice(){const e=this._pool.acquire(this._array.byteLength);return e.set(this._array),new LBe(e,this._pool)}},Y5e=class q5t{constructor(){this._data=new ArrayBuffer(q5t.BYTE_LENGTH),this._freeList=new vEt({start:0,end:this._data.byteLength})}static get BYTE_LENGTH(){return 64e6}get buffer(){return this._data}allocate(e){const i=this._freeList.firstFit(e);return lt(i)?null:new Uint32Array(this._data,i,e/Uint32Array.BYTES_PER_ELEMENT)}free(e){this._freeList.free(e.byteOffset,e.byteLength)}},sQi=class{constructor(){this._bytesAllocated=0,this._pages=[],this._pagesByBuffer=new Map,this._addPage()}destroy(){this._pages=[],this._pagesByBuffer=null}get _bytesTotal(){return this._pages.length*Y5e.BYTE_LENGTH}acquire(e){if(this._bytesAllocated+=e,_Et&&console.log(`Allocating ${e}, (${this._bytesAllocated} / ${this._bytesTotal})`),e>Y5e.BYTE_LENGTH)return new Uint32Array(e/Uint32Array.BYTES_PER_ELEMENT);for(const i of this._pages){const r=i.allocate(e);if(ve(r))return r}return Ou(this._addPage().allocate(e),"Expected to allocate page")}release(e){this._bytesAllocated-=e.byteLength,_Et&&console.log(`Freeing ${e.byteLength}, (${this._bytesAllocated} / ${this._bytesTotal})`);const i=this._pagesByBuffer.get(e.buffer);i&&i.free(e)}_addPage(){const e=new Y5e;return this._pages.push(e),this._pagesByBuffer.set(e.buffer,e),e}},hx=class{constructor(e,i){this._rctx=e,this._vertexBuffer=aa.createVertex(e,Xo.STATIC_DRAW,new Uint16Array(i)),this._vao=new Mc(e,new Map([["a_position",0]]),{geometry:[new na("a_position",2,Bi.SHORT,0,4)]},{geometry:this._vertexBuffer}),this._count=i.length/2}bind(){this._rctx.bindVAO(this._vao)}unbind(){this._rctx.bindVAO(null)}dispose(){this._vao.dispose(!1),this._vertexBuffer.dispose()}draw(){this._rctx.bindVAO(this._vao),this._rctx.drawArrays(bs.TRIANGLE_STRIP,0,this._count)}},q_=class{constructor(){this.name=this.constructor.name||"UnnamedBrush",this.brushEffect=null}prepareState(e,i){}draw(e,i,r){}drawMany(e,i,r){for(const n of i)n.visible&&this.draw(e,n,r)}};const X5e={nearest:{defines:[],samplingMode:In.NEAREST,mips:!1},bilinear:{defines:[],samplingMode:In.LINEAR,mips:!1},bicubic:{defines:["bicubic"],samplingMode:In.LINEAR,mips:!1},trilinear:{defines:[],samplingMode:In.LINEAR_MIPMAP_LINEAR,mips:!0}},oQi=(t,e,i)=>{if(i.samplingMode==="dynamic"){const{state:r}=t,n=e.resolution/e.pixelRatio/r.resolution,s=Math.round(t.pixelRatio)!==t.pixelRatio,o=n>1.05||n<.95;return r.rotation||o||s||e.isSourceScaled||e.rotation?X5e.bilinear:X5e.nearest}return X5e[i.samplingMode]};let aQi=class extends q_{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,i){const{context:r,renderingOptions:n,painter:s,requestRender:o,allowDelayedRender:a}=e;if(!i.source||!i.isReady)return;const l=oQi(e,i,n),c=s.materialManager.getProgram(this._desc,l.defines);if(a&&ve(o)&&!c.compiled)return void o();e.timeline.begin(this.name),i.blendFunction==="additive"?r.setBlendFunctionSeparate(Sn.ONE,Sn.ONE,Sn.ONE,Sn.ONE):r.setBlendFunctionSeparate(Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA,Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA),r.setStencilFunction(kl.EQUAL,i.stencilRef,255),this._quad||(this._quad=new hx(r,[0,0,1,0,0,1,1,1]));const{coordScale:h,computedOpacity:p,transforms:y}=i;i.setSamplingProfile(l),i.bind(e.context,Vpe),r.useProgram(c),c.setUniformMatrix3fv("u_dvsMat3",y.dvs),c.setUniform1i("u_texture",Vpe),c.setUniform2fv("u_coordScale",h),c.setUniform1f("u_opacity",p),this._quad.draw(),e.timeline.end(this.name)}};function bEt(){return new Float32Array(4)}function lQi(t){const e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function VE(t,e,i,r){const n=new Float32Array(4);return n[0]=t,n[1]=e,n[2]=i,n[3]=r,n}function uQi(t,e){return new Float32Array(t,e,4)}function wEt(){return bEt()}function xEt(){return VE(1,1,1,1)}function SEt(){return VE(1,0,0,0)}function CEt(){return VE(0,1,0,0)}function TEt(){return VE(0,0,1,0)}function EEt(){return VE(0,0,0,1)}const cQi=wEt(),hQi=xEt(),dQi=SEt(),pQi=CEt(),fQi=TEt(),mQi=EEt();Object.freeze(Object.defineProperty({__proto__:null,ONES:hQi,UNIT_W:mQi,UNIT_X:dQi,UNIT_Y:pQi,UNIT_Z:fQi,ZEROS:cQi,clone:lQi,create:bEt,createView:uQi,fromValues:VE,ones:xEt,unitW:EEt,unitX:SEt,unitY:CEt,unitZ:TEt,zeros:wEt},Symbol.toStringTag,{value:"Module"}));const gQi={background:{"background.frag":`uniform lowp vec4 u_color; void main() { gl_FragColor = u_color; }`,"background.vert":`attribute vec2 a_pos; @@ -4279,7 +4283,7 @@ return t3; ); float rgba2float(vec4 rgba) { return dot(rgba, rgba2float_factors); -}`}};function pZi(t){let e=dZi;return t.split("/").forEach(i=>{e&&(e=e[i])}),e}const fZi=new S5e(pZi);function wg(t){return fZi.resolveIncludes(t)}const OQ={shaders:{vertexShader:wg("background/background.vert"),fragmentShader:wg("background/background.frag")},attributes:new Map([["a_pos",0]])},mZi=()=>QP("clip",{geometry:[{location:0,name:"a_pos",count:2,type:Di.SHORT}]});let gZi=class extends j_{constructor(){super(...arguments),this._color=$E(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(Yl.KEEP,Yl.KEEP,Yl.REPLACE),e.setStencilWriteMask(255),e.setStencilFunction(El.ALWAYS,0,255)}draw(e,i){const{context:r,state:n,requestRender:s,allowDelayedRender:o}=e,a=mZi(),l=i.getVAO(r,n,a.attributes,a.bufferLayouts);lt(l.indexBuffer)||(this._program||(this._program=kE(r,OQ)),o&&ye(s)&&!this._program.compiled?s():(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(ls.TRIANGLES,l.indexBuffer.size,Di.UNSIGNED_INT,0),r.bindVAO()))}};const yZi=()=>QP("overlay",{geometry:[{location:0,name:"a_pos",count:2,type:Di.FLOAT}],tex:[{location:1,name:"a_uv",count:2,type:Di.UNSIGNED_SHORT}]});let vZi=class extends j_{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(cn.ONE,cn.ONE_MINUS_SRC_ALPHA,cn.ONE,cn.ONE_MINUS_SRC_ALPHA),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0),e.setStencilFunction(El.GREATER,255,255)}draw(e,i){const{context:r,painter:n,requestRender:s,allowDelayedRender:o}=e;if(!i.isReady)return;const{computedOpacity:a,dvsMat3:l,isWrapAround:c,perspectiveTransform:d,texture:p}=i;e.timeline.begin(this.name);const y=n.materialManager.getProgram(this._desc);if(o&&ye(s)&&!y.compiled)return void s();const v=yZi(),S=i.getVAO(r,v.bufferLayouts,v.attributes);if(!S)return;r.bindVAO(S),r.useProgram(y),r.bindTexture(p,mpe),y.setUniformMatrix3fv("u_dvsMat3",l),y.setUniform1i("u_texture",mpe),y.setUniform1f("u_opacity",a),y.setUniform2fv("u_perspective",d);const I=c?10:4;r.drawArrays(ls.TRIANGLE_STRIP,0,I),r.bindVAO(),e.timeline.end(this.name)}};function _Zi(t,e,i){const r=ed.SIZE_FIELD_STOPS|ed.SIZE_MINMAX_VALUE|ed.SIZE_SCALE_STOPS|ed.SIZE_UNIT_VALUE,n=(e&(dU.FIELD_TARGETS_OUTLINE|dU.MINMAX_TARGETS_OUTLINE|dU.SCALE_TARGETS_OUTLINE|dU.UNIT_TARGETS_OUTLINE))>>>4;return t===wn.LINE&&i.isOutline||t===wn.FILL&&mme(i.symbologyType)?r&n:r&~n}const GTt=0,VTt=8,bZi=7,UTt=8,jTt=11,zTt=11,HTt=12,WTt=13,qTt=14,YTt=15,XTt=16,KTt=17,JTt=18,ZTt=19,QTt=20,eEt=21,tEt=26,wZi=Object.keys(Yo).filter(t=>typeof Yo[t]=="number").reduce((t,e)=>({...t,[e]:Yo[e]}),{});function xZi(t){return t===Yo.SIMPLE||t===Yo.OUTLINE_FILL_SIMPLE}function mme(t){return t===Yo.OUTLINE_FILL||t===Yo.OUTLINE_FILL_SIMPLE}function iEt(t){return xZi(t.symbologyType)}function gme(t){return mme(t.symbologyType)}function TS(t,e){switch(t){case wn.FILL:return ES.from(e);case wn.LINE:return vO.from(e);case wn.MARKER:return CF.from(e);case wn.TEXT:return vj.from(e);case wn.LABEL:return TF.from(e);default:throw new Error(`Unable to createMaterialKey for unknown geometryType ${t}`)}}function SZi(t){switch(z_.load(t).geometryType){case wn.MARKER:return new CF(t);case wn.FILL:return new ES(t);case wn.LINE:return new vO(t);case wn.TEXT:return new vj(t);case wn.LABEL:return new TF(t)}}let z_=class{static load(e){const i=this.shared;return i.data=e,i}constructor(e){this._data=0,this._data=e}set data(e){this._data=e??0}get data(){return this._data}get geometryType(){return this.bits(UTt,jTt)}set geometryType(e){this.setBits(e,UTt,jTt)}get mapAligned(){return!!this.bit(QTt)}set mapAligned(e){this.setBit(QTt,e)}get sdf(){return!!this.bit(zTt)}set sdf(e){this.setBit(zTt,e??!1)}get pattern(){return!!this.bit(HTt)}set pattern(e){this.setBit(HTt,e)}get textureBinding(){return this.bits(GTt,VTt)}set textureBinding(e){this.setBits(e,GTt,VTt)}get symbologyType(){return this.bits(eEt,tEt)}set symbologyType(e){this.setBits(e,eEt,tEt)}get geometryTypeString(){switch(this.geometryType){case wn.FILL:return"fill";case wn.MARKER:return"marker";case wn.LINE:return"line";case wn.TEXT:return"text";case wn.LABEL:return"label";default:throw new st(`Unable to handle unknown geometryType: ${this.geometryType}`)}}setBit(e,i){const r=1<>e}setBits(e,i,r){for(let n=i,s=0;nclass extends t{get vvSizeMinMaxValue(){return this.bit(XTt)!==0}set vvSizeMinMaxValue(e){this.setBit(XTt,e)}get vvSizeScaleStops(){return this.bit(KTt)!==0}set vvSizeScaleStops(e){this.setBit(KTt,e)}get vvSizeFieldStops(){return this.bit(JTt)!==0}set vvSizeFieldStops(e){this.setBit(JTt,e)}get vvSizeUnitValue(){return this.bit(ZTt)!==0}set vvSizeUnitValue(e){this.setBit(ZTt,e)}hasVV(){return super.hasVV()||this.vvSizeMinMaxValue||this.vvSizeScaleStops||this.vvSizeFieldStops||this.vvSizeUnitValue}setVV(e,i){super.setVV(e,i);const r=_Zi(this.geometryType,e,i)&e;this.vvSizeMinMaxValue=!!(r&ed.SIZE_MINMAX_VALUE),this.vvSizeFieldStops=!!(r&ed.SIZE_FIELD_STOPS),this.vvSizeUnitValue=!!(r&ed.SIZE_UNIT_VALUE),this.vvSizeScaleStops=!!(r&ed.SIZE_SCALE_STOPS)}},rEt=t=>class extends t{get vvRotation(){return this.bit(YTt)!==0}set vvRotation(e){this.setBit(YTt,e)}hasVV(){return super.hasVV()||this.vvRotation}setVV(e,i){super.setVV(e,i),this.vvRotation=!i.isOutline&&!!(e&ed.ROTATION)}},yme=t=>class extends t{get vvColor(){return this.bit(WTt)!==0}set vvColor(e){this.setBit(WTt,e)}hasVV(){return super.hasVV()||this.vvColor}setVV(e,i){super.setVV(e,i),this.vvColor=!i.isOutline&&!!(e&ed.COLOR)}},vme=t=>class extends t{get vvOpacity(){return this.bit(qTt)!==0}set vvOpacity(e){this.setBit(qTt,e)}hasVV(){return super.hasVV()||this.vvOpacity}setVV(e,i){super.setVV(e,i),this.vvOpacity=!i.isOutline&&!!(e&ed.OPACITY)}};let ES=class extends yme(vme(RQ(z_))){static load(e){const i=this.shared;return i.data=e,i}static from(e){const{symbologyType:i,vvFlags:r}=e,n=this.load(0);return n.geometryType=wn.FILL,n.symbologyType=i,i!==Yo.DOT_DENSITY&&n.setVV(r,e),n.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};ES.shared=new ES(0);let CF=class extends yme(vme(rEt(RQ(z_)))){static load(e){const i=this.shared;return i.data=e,i}static from(e){const{symbologyType:i,vvFlags:r}=e,n=this.load(0);return n.geometryType=wn.MARKER,n.symbologyType=i,i!==Yo.HEATMAP&&n.setVV(r,e),n.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvRotation:this.vvRotation,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};CF.shared=new CF(0);let vO=class extends yme(vme(RQ(z_))){static load(e){const i=this.shared;return i.data=e,i}static from(e){const i=this.load(0);return i.geometryType=wn.LINE,i.symbologyType=e.symbologyType,i.setVV(e.vvFlags,e),i.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};vO.shared=new vO(0);let vj=class extends yme(vme(rEt(RQ(z_)))){static load(e){const i=this.shared;return i.data=e,i}static from(e){const i=this.load(0);return i.geometryType=wn.TEXT,i.symbologyType=e.symbologyType,i.setVV(e.vvFlags,e),i.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvRotation:this.vvRotation,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};vj.shared=new vj(0);let TF=class extends RQ(z_){static load(e){const i=this.shared;return i.data=e,i}static from(e){const i=this.load(0);return i.geometryType=wn.LABEL,i.symbologyType=e.symbologyType,i.setVV(e.vvFlags,e),i.mapAligned=wSt(e.placement),i.data}getVariation(){return{...super.getVariation(),vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};TF.shared=new TF(0);let MQ=class extends j_{constructor(){super(...arguments),this._computeDesc=new Map}prepareState({context:e},i){i&&i.includes("hittest")?e.setBlendFunctionSeparate(cn.ONE,cn.ONE,cn.ONE,cn.ONE):e.setBlendFunctionSeparate(cn.ONE,cn.ONE_MINUS_SRC_ALPHA,cn.ONE,cn.ONE_MINUS_SRC_ALPHA),e.setBlendingEnabled(!0),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0)}draw(e,i,r){const n=this.getGeometryType();i.commit(e);const s=i.getGeometry(n);lt(s)||(e.timeline.begin(this.name),e.attributeView.bindTextures(e.context),e.context.setStencilFunction(El.EQUAL,i.stencilRef,255),s.forEachCommand(o=>{const a=z_.load(o.materialKey).symbologyType;this.supportsSymbology(a)&&this.drawGeometry(e,i,o,r)}))}_setSharedUniforms(e,i,r){const{displayLevel:n,pixelRatio:s,state:o,passOptions:a}=i;ye(a)&&a.type==="hittest"&&(e.setUniform2fv("u_hittestPos",a.position),e.setUniform1f("u_hittestDist",a.distance)),e.setUniform1f("u_pixelRatio",s),e.setUniformMatrix3fv("u_tileMat3",r.transforms.tileMat3),e.setUniformMatrix3fv("u_viewMat3",o.viewMat3),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.dvs),e.setUniformMatrix3fv("u_displayViewMat3",o.displayViewMat3),e.setUniform1f("u_currentZoom",Math.round(n*cy)),e.setUniform1i("u_attributeTextureSize",i.attributeView.size),e.setUniform1i("u_attributeData0",gpe),e.setUniform1i("u_attributeData1",ype),e.setUniform1i("u_attributeData2",jDe),e.setUniform1i("u_attributeData3",zDe),e.setUniform1i("u_attributeData4",vpe),e.setUniform1i("u_attributeData5",_pe)}_setSizeVVUniforms(e,i,r,n){if(e.vvSizeMinMaxValue&&i.setUniform4fv("u_vvSizeMinMaxValue",r.vvSizeMinMaxValue),e.vvSizeScaleStops&&i.setUniform1f("u_vvSizeScaleStopsValue",r.vvSizeScaleStopsValue),e.vvSizeFieldStops){const s=r.getSizeVVFieldStops(n.key.level);s!=null&&(i.setUniform1fv("u_vvSizeFieldStopsValues",s.values),i.setUniform1fv("u_vvSizeFieldStopsSizes",s.sizes))}e.vvSizeUnitValue&&i.setUniform1f("u_vvSizeUnitValueWorldToPixelsRatio",r.vvSizeUnitValueToPixelsRatio)}_setColorAndOpacityVVUniforms(e,i,r){e.vvColor&&(i.setUniform1fv("u_vvColorValues",r.vvColorValues),i.setUniform4fv("u_vvColors",r.vvColors)),e.vvOpacity&&(i.setUniform1fv("u_vvOpacityValues",r.vvOpacityValues),i.setUniform1fv("u_vvOpacities",r.vvOpacities))}_setRotationVVUniforms(e,i,r){e.vvRotation&&i.setUniform1f("u_vvRotationType",r.vvMaterialParameters.vvRotationType==="geographic"?0:1)}_getTriangleDesc(e,i,r=["a_pos"]){const n=i.bufferLayouts.geometry,s=r.map(l=>n.findIndex(c=>c.name===l)),o=`${e}-${s.join("-")}`;let a=this._computeDesc.get(o);if(!a){const l=i.strides,c=i.strides.geometry,d=new Map(i.attributes),p=n.map(I=>({...I})),y=Math.max(...i.attributes.values()),v={geometry:p};let S=0;for(const I of s){const O=n[I];v.geometry.push({count:O.count,name:O.name+"1",divisor:O.divisor,normalized:O.normalized,offset:c+O.offset,stride:c,type:O.type}),v.geometry.push({count:O.count,name:O.name+"2",divisor:O.divisor,normalized:O.normalized,offset:2*c+O.offset,stride:c,type:O.type}),d.set(O.name+"1",y+ ++S),d.set(O.name+"2",y+ ++S)}a={bufferLayouts:v,attributes:d,strides:l},this._computeDesc.set(o,a)}return a}},EF=class{static getStorageSpec(e){return null}static createOrUpdateRendererSchema(e,i){return ye(e)&&e.type==="default"?e:{type:"default"}}static getVariation(e){return{}}static getVariationHash(e){return 0}};EF.type="default",EF.programSpec=null;let _me=class extends EF{static getStorageSpec({attributes:e}){return{visualVariables:!1,attributes:e??null}}static _createRendererSchema(){return{type:"dot-density",colors:new Float32Array(32),dotValue:-1,dotSize:-1,dotScale:-1,dotBlending:!1,backgroundColor:new Float32Array(4),activeDots:new Float32Array(8),seed:-1}}static createOrUpdateRendererSchema(e,i){const{attributes:r,dotValue:n,referenceScale:s,dotSize:o,dotBlendingEnabled:a,seed:l,backgroundColor:c}=i,d=ye(e)&&e.type==="dot-density"?e:this._createRendererSchema();d.dotValue=n,d.dotSize=o,d.dotScale=s,d.dotBlending=a,d.seed=l;const{colors:p,activeDots:y,backgroundColor:v}=d;for(let S=0;S=r.length?null:r[S].color;fU(p,I,4*S)}for(let S=0;S<8;S++)y[S]=S`${O}:${I.toString()}`).join();let v,S=!0;return ye(e)&&e.type==="heatmap"?(v=e,S=y!==e.gradientHash):v=this._createRendererSchema(),v.radius=on(r),v.minDensity=n,v.densityRange=d,v.referenceScale=o,v.isFieldActive=p,S&&(v.gradient=Ize(c),v.gradientHash=y),v}};bme.type="heatmap",bme.programSpec={shader:"materials/icon/heatmapAccumulate",vertexLayout:{geometry:[{location:0,name:"a_pos",count:2,type:Di.SHORT},{location:1,name:"a_vertexOffset",count:2,type:Di.SHORT},{location:4,name:"a_id",count:4,type:Di.UNSIGNED_BYTE}]}};let wme=class extends EF{static getStorageSpec({attributes:e}){return{visualVariables:!0,attributes:e??null}}static _createRendererSchema(){return{type:"pie-chart",colors:new Float32Array(4*v0t),defaultColor:new Float32Array(4),othersColor:new Float32Array(4),outlineColor:new Float32Array(4),holePercentage:0,sectorThreshold:0,outlineWidth:1,numberOfFields:10}}static createOrUpdateRendererSchema(e,i){const{attributes:r,defaultColor:n,holePercentage:s,othersCategory:o,outline:a}=i,l=ye(e)&&e.type==="pie-chart"?e:this._createRendererSchema();for(let c=0;c=r.length?new $r([0,0,0,0]):r[c].color;fU(l.colors,d,4*c)}return fU(l.defaultColor,n),fU(l.othersColor,o?.color),fU(l.outlineColor,a?.color),l.outlineWidth=on(a?.width||0),l.holePercentage=s,l.sectorThreshold=o?.threshold||0,l.numberOfFields=r.length,l}static getVariation(e){return{numberOfFields:e.numberOfFields}}static getVariationHash(e){return e.numberOfFields}};wme.type="pie-chart",wme.programSpec={shader:"materials/pie",vertexLayout:{geometry:[{location:0,name:"a_pos",count:2,type:Di.SHORT},{location:1,name:"a_vertexOffset",count:2,type:Di.SHORT},{location:2,name:"a_texCoords",count:2,type:Di.UNSIGNED_SHORT},{location:3,name:"a_bitSetAndDistRatio",count:2,type:Di.UNSIGNED_SHORT},{location:4,name:"a_id",count:4,type:Di.UNSIGNED_BYTE},{location:5,name:"a_color",count:4,type:Di.UNSIGNED_BYTE,normalized:!0},{location:6,name:"a_outlineColor",count:4,type:Di.UNSIGNED_BYTE,normalized:!0},{location:7,name:"a_sizeAndOutlineWidth",count:4,type:Di.UNSIGNED_BYTE},{location:8,name:"a_zoomRange",count:2,type:Di.UNSIGNED_SHORT}]},hittestAttributes:["a_vertexOffset","a_texCoords"]};function _j(t,e){if(t.type!==e)throw new st("material-view-model:unexpected-renderer-schema",`expected to find renderer schema of type "${e}" but found type "${t.type}"`)}function nEt(t){switch(t?.type){case"dot-density":return _me;case"heatmap":return bme;case"pie-chart":return wme;default:return EF}}function sEt(t){const{geometryType:e,symbologyType:i}=z_.load(t);switch(e){case wn.FILL:if(i===Yo.DOT_DENSITY)return _me;break;case wn.MARKER:switch(i){case Yo.HEATMAP:return bme;case Yo.PIE_CHART:return wme}}return EF}function CZi(t){const e={geometry:[{location:0,name:"a_pos",count:2,type:Di.SHORT},{location:1,name:"a_id",count:3,type:Di.UNSIGNED_BYTE},{location:2,name:"a_bitset",count:1,type:Di.UNSIGNED_BYTE},{location:3,name:"a_color",count:4,type:Di.UNSIGNED_BYTE,normalized:!0},{location:4,name:"a_aux1",count:4,type:Di.UNSIGNED_SHORT},{location:5,name:"a_aux2",count:4,type:Di.SHORT},{location:6,name:"a_aux3",count:4,type:Di.UNSIGNED_BYTE},{location:7,name:"a_zoomRange",count:2,type:Di.UNSIGNED_SHORT}]};switch(t.symbologyType){case Yo.SIMPLE:case Yo.OUTLINE_FILL_SIMPLE:e.geometry.splice(7,1),e.geometry.splice(4,1)}return{shader:"materials/fill",vertexLayout:e}}let oEt=class extends MQ{dispose(){}getGeometryType(){return wn.FILL}supportsSymbology(e){return e!==Yo.DOT_DENSITY}drawGeometry(e,i,r,n){const{context:s,painter:o,rendererInfo:a,requiredLevel:l,passOptions:c,requestRender:d,allowDelayedRender:p}=e,y=ES.load(r.materialKey),v=sEt(y.data),S=ye(c)&&c.type==="hittest",I=o.materialManager,{shader:O,vertexLayout:L,hittestAttributes:N}=Fu(v.programSpec,CZi(y));let G=ls.TRIANGLES,V=QP(y.data,L);S&&(V=this._getTriangleDesc(r.materialKey,V,N),G=ls.POINTS);const{attributes:Y,bufferLayouts:X}=V,te=I.getMaterialProgram(e,y,O,Y,n);if(p&&ye(d)&&!te.compiled)return void d();if(s.useProgram(te),this._setSharedUniforms(te,e,i),te.setUniform2f("u_tileOffset",512*i.key.col,512*i.key.row),y.textureBinding){o.textureManager.bindTextures(s,te,y);const Ie=1/2**(l-i.key.level);te.setUniform1f("u_zoomFactor",Ie)}const re=1/e.pixelRatio;te.setUniform1f("u_blur",re),te.setUniform1f("u_antialiasing",re),this._setSizeVVUniforms(y,te,a,i),this._setColorAndOpacityVVUniforms(y,te,a);const fe=r.target.getVAO(s,X,Y,S);let ge=r.indexCount,_e=r.indexFrom*Uint32Array.BYTES_PER_ELEMENT;S&&(ge/=3,_e/=3),s.bindVAO(fe),this._drawFills(e,i,te,G,ge,_e)}_drawFills(e,i,r,n,s,o){e.context.drawElements(n,s,Di.UNSIGNED_INT,o)}},TZi=class extends oEt{constructor(){super(...arguments),this._dotTextureSize=0,this._dotTextures=null,this._dotSamplers=new Int32Array([WLi,qLi]),this._dotVAO=null,this._dotDesc={vsPath:"dot/dot",fsPath:"dot/dot",attributes:new Map([["a_pos",0]])}}dispose(){super.dispose(),this._disposeTextures(),this._dotFBO=Ba(this._dotFBO),this._dotVAO=Ba(this._dotVAO)}getGeometryType(){return wn.FILL}supportsSymbology(e){return e===Yo.DOT_DENSITY}_drawFills(e,i,r,n,s,o){const{passOptions:a}=e;if(ye(a)&&a.type==="hittest")super._drawFills(e,i,r,n,s,o);else{const l=this._drawDotLocations(e,i,r,s,o);this._drawDotDensity(e,i,l)}}_drawDotDensity(e,i,r){const{context:n,painter:s,rendererInfo:o,requestRender:a,allowDelayedRender:l}=e,c=s.materialManager.getProgram(this._dotDesc);if(l&&ye(a)&&!c.compiled)return void a();const{rendererSchema:d}=o;_j(d,"dot-density");const p=this._createDotDensityMesh(n,this._dotDesc.attributes,{geometry:[{name:"a_pos",count:2,type:Di.SHORT,divisor:0,normalized:!1,offset:0,stride:4}]});n.setStencilTestEnabled(!0),n.useProgram(c),c.setUniform1f("u_tileZoomFactor",1),c.setUniform1i("u_texture",this._dotSamplers[0]),c.setUniform1f("u_dotSize",Math.max(d.dotSize,1)),c.setUniform1f("u_pixelRatio",window.devicePixelRatio),this._setSharedUniforms(c,e,i),n.bindTexture(r,this._dotSamplers[0]),n.bindVAO(p),n.drawArrays(ls.POINTS,0,262144)}_drawDotLocations(e,i,r,n,s){const{context:o,rendererInfo:a,requiredLevel:l}=e,c=o.getViewport(),{rendererSchema:d}=a;_j(d,"dot-density");const{dotScale:p,colors:y,activeDots:v,backgroundColor:S,dotValue:I}=d;o.setViewport(0,0,512,512);const O=o.getBoundFramebufferObject(),L=this._createFBO(o);o.bindFramebuffer(L),o.setClearColor(0,0,0,0),o.clear(o.gl.COLOR_BUFFER_BIT|o.gl.STENCIL_BUFFER_BIT),o.setStencilTestEnabled(!1);const N=1/2**(l-i.key.level),G=Tc,V=G*window.devicePixelRatio*G*window.devicePixelRatio,Y=1/N*(1/N),X=p?e.state.scale/p:1;return r.setUniform1f("u_tileZoomFactor",N),r.setUniform1f("u_tileDotsOverArea",V/(Tc*window.devicePixelRatio*Tc*window.devicePixelRatio)),r.setUniformMatrix4fv("u_dotColors",y),r.setUniform4fv("u_isActive",v),r.setUniform4fv("u_dotBackgroundColor",S),r.setUniform1f("u_dotValue",Math.max(1,I*X*Y)),this._bindDotDensityTextures(o,r,a,G),o.drawElements(ls.TRIANGLES,n,Di.UNSIGNED_INT,s),o.setViewport(c.x,c.y,c.width,c.height),o.bindFramebuffer(O),L.colorTexture}_createFBO(e){if(lt(this._dotFBO)){const n={target:Ws.TEXTURE_2D,pixelFormat:nn.RGBA,dataType:ts.UNSIGNED_BYTE,samplingMode:mn.NEAREST,wrapMode:us.CLAMP_TO_EDGE,width:512,height:512},s={colorTarget:Th.TEXTURE,depthStencilTarget:gl.DEPTH_STENCIL_RENDER_BUFFER},o=new mO(e,{width:512,height:512,internalFormat:gg.DEPTH_STENCIL});this._dotFBO=new id(e,s,n,o)}return this._dotFBO}_disposeTextures(){if(this._dotTextures){for(let e=0;e0&&(n+=`, ${r}`);const s=this._canvas,o=s.getContext("2d");return o.font="24px sans-serif",o.textAlign="left",o.textBaseline="top",o.clearRect(0,0,xme,Sme),r>1e5?(o.fillStyle="red",o.fillRect(0,0,xme,Sme),o.fillStyle="black"):(o.clearRect(0,0,xme,Sme),o.fillStyle="blue"),o.fillText(n,0,0),i.texture=new bs(e,{target:Ws.TEXTURE_2D,pixelFormat:nn.RGBA,dataType:ts.UNSIGNED_BYTE,samplingMode:mn.NEAREST,wrapMode:us.CLAMP_TO_EDGE},s),i.texture}},MZi=class extends A5e{supportsSymbology(e){return e===Yo.PIE_CHART}_drawMarkers(e,i,r,n,s,o,a){const{context:l}=e,{rendererInfo:c}=e,{rendererSchema:d}=c;_j(d,"pie-chart"),r.setUniform4fv("u_colors",d.colors),r.setUniform4fv("u_defaultColor",d.defaultColor),r.setUniform4fv("u_othersColor",d.othersColor),r.setUniform4fv("u_outlineColor",d.outlineColor),r.setUniform1f("u_donutRatio",d.holePercentage),r.setUniform1f("u_sectorThreshold",d.sectorThreshold),r.setUniform1f("u_outlineWidth",d.outlineWidth),l.drawElements(n,s,Di.UNSIGNED_INT,o)}},dEt=class extends j_{constructor(){super(...arguments),this._color=$E(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(Yl.KEEP,Yl.KEEP,Yl.REPLACE),e.setStencilWriteMask(255)}draw(e,i){const{context:r,requestRender:n,allowDelayedRender:s}=e;this._initialized||this._initialize(r),s&&ye(n)&&!this._solidProgram.compiled?n():(r.setStencilFunctionSeparate(Xw.FRONT_AND_BACK,El.GREATER,i.stencilRef,255),r.bindVAO(this._solidVertexArrayObject),r.useProgram(this._solidProgram),this._solidProgram.setUniformMatrix3fv("u_dvsMat3",i.transforms.dvs),this._solidProgram.setUniform2fv("u_coord_range",[i.rangeX,i.rangeY]),this._solidProgram.setUniform1f("u_depth",0),this._solidProgram.setUniform4fv("u_color",this._color),r.drawArrays(ls.TRIANGLE_STRIP,0,4),r.bindVAO())}_initialize(e){if(this._initialized)return!0;const i=kE(e,OQ);if(!i)return!1;const r=new Int8Array([0,0,1,0,0,1,1,1]),n=Ko.createVertex(e,Lo.STATIC_DRAW,r),s=new Ac(e,OQ.attributes,P5e,{geometry:n});return this._solidProgram=i,this._solidVertexArrayObject=s,this._initialized=!0,!0}},DZi=class extends j_{constructor(){super(...arguments),this._color=$E(1,0,0,1),this._patternMatrix=Cl(),this._programOptions={id:!1,pattern:!1}}dispose(){this._vao&&(this._vao.dispose(),this._vao=null)}drawMany(e,i){const{context:r,painter:n,styleLayerUID:s,requestRender:o,allowDelayedRender:a}=e;this._loadWGLResources(e);const l=e.displayLevel,c=e.styleLayer,d=c.backgroundMaterial,p=n.vectorTilesMaterialManager,y=c.getPaintValue("background-color",l),v=c.getPaintValue("background-opacity",l),S=c.getPaintValue("background-pattern",l),I=S!==void 0,O=y[3]*v,L=1|window.devicePixelRatio,N=e.spriteMosaic;let G,V;const Y=L>I0t?2:1,X=e.drawPhase===io.HITTEST,te=this._programOptions;te.id=X,te.pattern=I;const re=p.getMaterialProgram(r,d,te);if(a&&ye(o)&&!re.compiled)o();else{if(r.bindVAO(this._vao),r.useProgram(re),I){const fe=N.getMosaicItemPosition(S,!0);if(ye(fe)){const{tl:ge,br:_e,page:Ie}=fe;G=_e[0]-ge[0],V=_e[1]-ge[1];const ke=N.getPageSize(Ie);ye(ke)&&(N.bind(r,mn.LINEAR,Ie,Kw),re.setUniform4f("u_tlbr",ge[0],ge[1],_e[0],_e[1]),re.setUniform2fv("u_mosaicSize",ke),re.setUniform1i("u_texture",Kw))}re.setUniform1f("u_opacity",v)}else this._color[0]=O*y[0],this._color[1]=O*y[1],this._color[2]=O*y[2],this._color[3]=O,re.setUniform4fv("u_color",this._color);if(re.setUniform1f("u_depth",c.z||0),X){const fe=FJ(s+1);re.setUniform4fv("u_id",fe)}for(const fe of i){if(re.setUniform1f("u_coord_range",fe.rangeX),re.setUniformMatrix3fv("u_dvsMat3",fe.transforms.dvs),I){const ge=Math.max(2**(Math.round(l)-fe.key.level),1),_e=Y*fe.width*ge,Ie=_e/X8(G),ke=_e/X8(V);this._patternMatrix[0]=Ie,this._patternMatrix[4]=ke,re.setUniformMatrix3fv("u_pattern_matrix",this._patternMatrix)}r.setStencilFunction(El.EQUAL,0,255),r.drawArrays(ls.TRIANGLE_STRIP,0,4)}}}_loadWGLResources(e){if(this._vao)return;const{context:i,styleLayer:r}=e,n=r.backgroundMaterial,s=new Int8Array([0,0,1,0,0,1,1,1]),o=Ko.createVertex(i,Lo.STATIC_DRAW,s),a=new Ac(i,n.getAttributeLocations(),n.getLayoutInfo(),{geometry:o});this._vao=a}},FZi=class extends j_{constructor(){super(...arguments),this._programOptions={id:!1}}dispose(){}drawMany(e,i){const{context:r,displayLevel:n,requiredLevel:s,state:o,drawPhase:a,painter:l,spriteMosaic:c,styleLayerUID:d,requestRender:p,allowDelayedRender:y}=e;if(!i.some(te=>te.layerData.get(d)?.circleIndexCount??!1))return;const v=e.styleLayer,S=v.circleMaterial,I=l.vectorTilesMaterialManager,O=1.2,L=v.getPaintValue("circle-translate",n),N=v.getPaintValue("circle-translate-anchor",n),G=a===io.HITTEST,V=this._programOptions;V.id=G;const Y=I.getMaterialProgram(r,S,V);if(y&&ye(p)&&!Y.compiled)return void p();r.useProgram(Y),Y.setUniformMatrix3fv("u_displayMat3",N===B_.VIEWPORT?o.displayMat3:o.displayViewMat3),Y.setUniform2fv("u_circleTranslation",L),Y.setUniform1f("u_depth",v.z),Y.setUniform1f("u_antialiasingWidth",O);let X=-1;if(G){const te=FJ(d+1);Y.setUniform4fv("u_id",te)}for(const te of i){if(!te.layerData.has(d))continue;te.key.level!==X&&(X=te.key.level,S.setDataUniforms(Y,n,v,X,c));const re=te.layerData.get(d);if(!re.circleIndexCount)continue;re.prepareForRendering(r);const fe=re.circleVertexArrayObject;lt(fe)||(r.bindVAO(fe),Y.setUniformMatrix3fv("u_dvsMat3",te.transforms.dvs),s!==te.key.level?r.setStencilFunction(El.EQUAL,te.stencilRef,255):r.setStencilFunction(El.GREATER,255,255),r.drawElements(ls.TRIANGLES,re.circleIndexCount,Di.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*re.circleIndexStart),te.triangleCount+=re.circleIndexCount/3)}}};const pEt=1/65536;let LZi=class extends j_{constructor(){super(...arguments),this._fillProgramOptions={id:!1,pattern:!1},this._outlineProgramOptions={id:!1}}dispose(){}drawMany(e,i){const{displayLevel:r,drawPhase:n,renderPass:s,spriteMosaic:o,styleLayerUID:a}=e;let l=!1;for(const Y of i)if(Y.layerData.has(a)){const X=Y.layerData.get(a);if(X.fillIndexCount>0||X.outlineIndexCount>0){l=!0;break}}if(!l)return;const c=e.styleLayer,d=c.getPaintProperty("fill-pattern"),p=d!==void 0,y=p&&d.isDataDriven;let v;if(p&&!y){const Y=d.getValue(r);v=o.getMosaicItemPosition(Y,!0)}const S=!p&&c.getPaintValue("fill-antialias",r);let I=!0,O=1;if(!p){const Y=c.getPaintProperty("fill-color"),X=c.getPaintProperty("fill-opacity");if(!Y?.isDataDriven&&!X?.isDataDriven){const te=c.getPaintValue("fill-color",r);O=c.getPaintValue("fill-opacity",r)*te[3],O>=1&&(I=!1)}}if(I&&s==="opaque")return;let L;n===io.HITTEST&&(L=FJ(a+1));const N=c.getPaintValue("fill-translate",r),G=c.getPaintValue("fill-translate-anchor",r);(I||s!=="translucent")&&this._drawFill(e,a,c,i,N,G,p,v,y,L);const V=!c.hasDataDrivenOutlineColor&&c.outlineUsesFillColor&&O<1;S&&s!=="opaque"&&!V&&this._drawOutline(e,a,c,i,N,G,L)}_drawFill(e,i,r,n,s,o,a,l,c,d){if(a&&!c&<(l))return;const{context:p,displayLevel:y,state:v,drawPhase:S,painter:I,pixelRatio:O,spriteMosaic:L,requestRender:N,allowDelayedRender:G}=e,V=r.fillMaterial,Y=I.vectorTilesMaterialManager,X=O>I0t?2:1,te=S===io.HITTEST,re=this._fillProgramOptions;re.id=te,re.pattern=a;const fe=Y.getMaterialProgram(p,V,re);if(G&&ye(N)&&!fe.compiled)return void N();if(p.useProgram(fe),ye(l)){const{page:_e}=l,Ie=L.getPageSize(_e);ye(Ie)&&(L.bind(p,mn.LINEAR,_e,Kw),fe.setUniform2fv("u_mosaicSize",Ie),fe.setUniform1i("u_texture",Kw))}fe.setUniformMatrix3fv("u_displayMat3",o===B_.VIEWPORT?v.displayMat3:v.displayViewMat3),fe.setUniform2fv("u_fillTranslation",s),fe.setUniform1f("u_depth",r.z+pEt),te&&fe.setUniform4fv("u_id",d);let ge=-1;for(const _e of n){if(!_e.layerData.has(i))continue;_e.key.level!==ge&&(ge=_e.key.level,V.setDataUniforms(fe,y,r,ge,L));const Ie=_e.layerData.get(i);if(!Ie.fillIndexCount)continue;Ie.prepareForRendering(p);const ke=Ie.fillVertexArrayObject;if(!lt(ke)){if(p.bindVAO(ke),fe.setUniformMatrix3fv("u_dvsMat3",_e.transforms.dvs),p.setStencilFunction(El.EQUAL,_e.stencilRef,255),a){const Ne=Math.max(2**(Math.round(y)-_e.key.level),1),J=_e.rangeX/(X*_e.width*Ne);fe.setUniform1f("u_patternFactor",J)}if(c){const Ne=Ie.patternMap;if(!Ne)continue;for(const[J,he]of Ne){const xe=L.getPageSize(J);ye(xe)&&(L.bind(p,mn.LINEAR,J,Kw),fe.setUniform2fv("u_mosaicSize",xe),fe.setUniform1i("u_texture",Kw),p.drawElements(ls.TRIANGLES,he[1],Di.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*he[0]))}}else p.drawElements(ls.TRIANGLES,Ie.fillIndexCount,Di.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*Ie.fillIndexStart);_e.triangleCount+=Ie.fillIndexCount/3}}}_drawOutline(e,i,r,n,s,o,a){const{context:l,displayLevel:c,state:d,drawPhase:p,painter:y,pixelRatio:v,spriteMosaic:S,requestRender:I,allowDelayedRender:O}=e,L=r.outlineMaterial,N=y.vectorTilesMaterialManager,G=.75/v,V=p===io.HITTEST,Y=this._outlineProgramOptions;Y.id=V;const X=N.getMaterialProgram(l,L,Y);if(O&&ye(I)&&!X.compiled)return void I();l.useProgram(X),X.setUniformMatrix3fv("u_displayMat3",o===B_.VIEWPORT?d.displayMat3:d.displayViewMat3),X.setUniform2fv("u_fillTranslation",s),X.setUniform1f("u_depth",r.z+pEt),X.setUniform1f("u_outline_width",G),V&&X.setUniform4fv("u_id",a);let te=-1;for(const re of n){if(!re.layerData.has(i))continue;re.key.level!==te&&(te=re.key.level,L.setDataUniforms(X,c,r,te,S));const fe=re.layerData.get(i);if(fe.prepareForRendering(l),!fe.outlineIndexCount)continue;const ge=fe.outlineVertexArrayObject;lt(ge)||(l.bindVAO(ge),X.setUniformMatrix3fv("u_dvsMat3",re.transforms.dvs),l.setStencilFunction(El.EQUAL,re.stencilRef,255),l.drawElements(ls.TRIANGLES,fe.outlineIndexCount,Di.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*fe.outlineIndexStart),re.triangleCount+=fe.outlineIndexCount/3)}}},kZi=class extends j_{constructor(){super(...arguments),this._programOptions={id:!1,pattern:!1,sdf:!1}}dispose(){}drawMany(e,i){const{context:r,displayLevel:n,state:s,drawPhase:o,painter:a,pixelRatio:l,spriteMosaic:c,styleLayerUID:d,requestRender:p,allowDelayedRender:y}=e;if(!i.some(ke=>ke.layerData.get(d)?.lineIndexCount??!1))return;const v=e.styleLayer,S=v.lineMaterial,I=a.vectorTilesMaterialManager,O=v.getPaintValue("line-translate",n),L=v.getPaintValue("line-translate-anchor",n),N=v.getPaintProperty("line-pattern"),G=N!==void 0,V=G&&N.isDataDriven;let Y,X;if(G&&!V){const ke=N.getValue(n);Y=c.getMosaicItemPosition(ke)}let te=!1;if(!G){const ke=v.getPaintProperty("line-dasharray");if(X=ke!==void 0,te=X&&ke.isDataDriven,X&&!te){const Ne=ke.getValue(n),J=v.getDashKey(Ne,v.getLayoutValue("line-cap",n));Y=c.getMosaicItemPosition(J)}}const re=1/l,fe=o===io.HITTEST,ge=this._programOptions;ge.id=fe,ge.pattern=G,ge.sdf=X;const _e=I.getMaterialProgram(r,S,ge);if(y&&ye(p)&&!_e.compiled)return void p();if(r.useProgram(_e),_e.setUniformMatrix3fv("u_displayViewMat3",s.displayViewMat3),_e.setUniformMatrix3fv("u_displayMat3",L===B_.VIEWPORT?s.displayMat3:s.displayViewMat3),_e.setUniform2fv("u_lineTranslation",O),_e.setUniform1f("u_depth",v.z),_e.setUniform1f("u_antialiasing",re),fe){const ke=FJ(d+1);_e.setUniform4fv("u_id",ke)}if(Y&&ye(Y)){const{page:ke}=Y,Ne=c.getPageSize(ke);ye(Ne)&&(c.bind(r,mn.LINEAR,ke,Kw),_e.setUniform2fv("u_mosaicSize",Ne),_e.setUniform1i("u_texture",Kw))}let Ie=-1;for(const ke of i){if(!ke.layerData.has(d))continue;ke.key.level!==Ie&&(Ie=ke.key.level,S.setDataUniforms(_e,n,v,Ie,c));const Ne=2**(n-Ie)/l;_e.setUniform1f("u_zoomFactor",Ne);const J=ke.layerData.get(d);if(!J.lineIndexCount)continue;J.prepareForRendering(r);const he=J.lineVertexArrayObject;if(!lt(he)){if(r.bindVAO(he),_e.setUniformMatrix3fv("u_dvsMat3",ke.transforms.dvs),r.setStencilFunction(El.EQUAL,ke.stencilRef,255),V||te){const xe=J.patternMap;if(!xe)continue;for(const[Pe,Oe]of xe){const Ae=c.getPageSize(Pe);ye(Ae)&&(c.bind(r,mn.LINEAR,Pe,Kw),_e.setUniform2fv("u_mosaicSize",Ae),_e.setUniform1i("u_texture",Kw),r.drawElements(ls.TRIANGLES,Oe[1],Di.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*Oe[0]))}}else r.drawElements(ls.TRIANGLES,J.lineIndexCount,Di.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*J.lineIndexStart);ke.triangleCount+=J.lineIndexCount/3}}}};const NZi=256/360,$Zi=1/Math.LN2;function BZi(t,e){return(t%=e)>=0?t:t+e}function DQ(t){return BZi(t*NZi,256)}function fEt(t){return Math.log(t)*$Zi}const GZi=1/65536;let VZi=class extends j_{constructor(){super(...arguments),this._iconProgramOptions={id:!1,sdf:!1},this._sdfProgramOptions={id:!1},this._spritesTextureSize=CT()}dispose(){}drawMany(e,i){const{drawPhase:r,styleLayerUID:n}=e,s=e.styleLayer;let o;r===io.HITTEST&&(o=FJ(n+1)),this._drawIcons(e,s,i,o),this._drawText(e,s,i,o)}_drawIcons(e,i,r,n){const{context:s,displayLevel:o,drawPhase:a,painter:l,spriteMosaic:c,state:d,styleLayerUID:p,requestRender:y,allowDelayedRender:v}=e,S=i.iconMaterial,I=l.vectorTilesMaterialManager;let O,L=!1;for(const Ie of r)if(Ie.layerData.has(p)&&(O=Ie.layerData.get(p),O.iconPerPageElementsMap.size>0)){L=!0;break}if(!L)return;const N=i.getPaintValue("icon-translate",o),G=i.getPaintValue("icon-translate-anchor",o);let V=i.getLayoutValue("icon-rotation-alignment",o);V===Ju.AUTO&&(V=i.getLayoutValue("symbol-placement",o)===nO.POINT?Ju.VIEWPORT:Ju.MAP);const Y=V===Ju.MAP,X=i.getLayoutValue("icon-keep-upright",o)&&Y,te=O.isIconSDF,re=a===io.HITTEST,fe=this._iconProgramOptions;fe.id=re,fe.sdf=te;const ge=I.getMaterialProgram(s,S,fe);if(v&&ye(y)&&!ge.compiled)return void y();s.useProgram(ge),ge.setUniformMatrix3fv("u_displayViewMat3",V===Ju.MAP?d.displayViewMat3:d.displayMat3),ge.setUniformMatrix3fv("u_displayMat3",G===B_.VIEWPORT?d.displayMat3:d.displayViewMat3),ge.setUniform2fv("u_iconTranslation",N),ge.setUniform1f("u_depth",i.z),ge.setUniform1f("u_mapRotation",DQ(d.rotation)),ge.setUniform1f("u_keepUpright",X?1:0),ge.setUniform1f("u_level",10*o),ge.setUniform1i("u_texture",Kw),ge.setUniform1f("u_fadeDuration",LU/1e3),re&&ge.setUniform4fv("u_id",n);let _e=-1;for(const Ie of r){if(!Ie.layerData.has(p)||(Ie.key.level!==_e&&(_e=Ie.key.level,S.setDataUniforms(ge,o,i,_e,c)),O=Ie.layerData.get(p),O.iconPerPageElementsMap.size===0))continue;O.prepareForRendering(s),O.updateOpacityInfo();const ke=O.iconVertexArrayObject;if(!lt(ke)){s.bindVAO(ke),ge.setUniformMatrix3fv("u_dvsMat3",Ie.transforms.dvs),ge.setUniform1f("u_time",(performance.now()-O.lastOpacityUpdate)/1e3);for(const[Ne,J]of O.iconPerPageElementsMap)this._renderIconRange(e,ge,J,Ne,Ie)}}}_renderIconRange(e,i,r,n,s){const{context:o,spriteMosaic:a}=e;this._spritesTextureSize[0]=a.getWidth(n)/4,this._spritesTextureSize[1]=a.getHeight(n)/4,i.setUniform2fv("u_mosaicSize",this._spritesTextureSize),a.bind(o,mn.LINEAR,n,Kw),o.setStencilTestEnabled(!0),o.setStencilFunction(El.GREATER,255,255),o.setStencilWriteMask(0),o.drawElements(ls.TRIANGLES,r[1],Di.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*r[0]),s.triangleCount+=r[1]/3}_drawText(e,i,r,n){const{context:s,displayLevel:o,drawPhase:a,glyphMosaic:l,painter:c,pixelRatio:d,spriteMosaic:p,state:y,styleLayerUID:v,requestRender:S,allowDelayedRender:I}=e,O=i.textMaterial,L=c.vectorTilesMaterialManager;let N,G=!1;for(const ze of r)if(ze.layerData.has(v)&&(N=ze.layerData.get(v),N.glyphPerPageElementsMap.size>0)){G=!0;break}if(!G)return;const V=i.getPaintProperty("text-opacity");if(V&&!V.isDataDriven&&V.getValue(o)===0)return;const Y=i.getPaintProperty("text-color"),X=!Y||Y.isDataDriven||Y.getValue(o)[3]>0,te=i.getPaintProperty("text-halo-width"),re=i.getPaintProperty("text-halo-color"),fe=(!te||te.isDataDriven||te.getValue(o)>0)&&(!re||re.isDataDriven||re.getValue(o)[3]>0);if(!X&&!fe)return;const ge=24/8;let _e=i.getLayoutValue("text-rotation-alignment",o);_e===Ju.AUTO&&(_e=i.getLayoutValue("symbol-placement",o)===nO.POINT?Ju.VIEWPORT:Ju.MAP);const Ie=_e===Ju.MAP,ke=i.getLayoutValue("text-keep-upright",o)&&Ie,Ne=a===io.HITTEST,J=.8*ge/d;this._glyphTextureSize||(this._glyphTextureSize=lp(l.width/4,l.height/4));const he=i.getPaintValue("text-translate",o),xe=i.getPaintValue("text-translate-anchor",o),Pe=this._sdfProgramOptions;Pe.id=Ne;const Oe=L.getMaterialProgram(s,O,Pe);if(I&&ye(S)&&!Oe.compiled)return void S();s.useProgram(Oe),Oe.setUniformMatrix3fv("u_displayViewMat3",_e===Ju.MAP?y.displayViewMat3:y.displayMat3),Oe.setUniformMatrix3fv("u_displayMat3",xe===B_.VIEWPORT?y.displayMat3:y.displayViewMat3),Oe.setUniform2fv("u_textTranslation",he),Oe.setUniform1f("u_depth",i.z+GZi),Oe.setUniform2fv("u_mosaicSize",this._glyphTextureSize),Oe.setUniform1f("u_mapRotation",DQ(y.rotation)),Oe.setUniform1f("u_keepUpright",ke?1:0),Oe.setUniform1f("u_level",10*o),Oe.setUniform1i("u_texture",E0t),Oe.setUniform1f("u_antialiasingWidth",J),Oe.setUniform1f("u_fadeDuration",LU/1e3),Ne&&Oe.setUniform4fv("u_id",n);let Ae=-1;for(const ze of r){if(!ze.layerData.has(v)||(ze.key.level!==Ae&&(Ae=ze.key.level,O.setDataUniforms(Oe,o,i,Ae,p)),N=ze.layerData.get(v),N.glyphPerPageElementsMap.size===0))continue;N.prepareForRendering(s),N.updateOpacityInfo();const Ge=N.textVertexArrayObject;if(lt(Ge))continue;s.bindVAO(Ge),Oe.setUniformMatrix3fv("u_dvsMat3",ze.transforms.dvs),s.setStencilTestEnabled(!0),s.setStencilFunction(El.GREATER,255,255),s.setStencilWriteMask(0);const Je=(performance.now()-N.lastOpacityUpdate)/1e3;Oe.setUniform1f("u_time",Je),N.glyphPerPageElementsMap.forEach((et,tt)=>{this._renderGlyphRange(s,et,tt,l,Oe,fe,X,ze)})}}_renderGlyphRange(e,i,r,n,s,o,a,l){n.bind(e,mn.LINEAR,r,E0t),o&&(s.setUniform1f("u_halo",1),e.drawElements(ls.TRIANGLES,i[1],Di.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*i[0]),l.triangleCount+=i[1]/3),a&&(s.setUniform1f("u_halo",0),e.drawElements(ls.TRIANGLES,i[1],Di.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*i[0]),l.triangleCount+=i[1]/3)}};const UZi=t=>QP(t.data,{geometry:[{location:0,name:"a_pos",count:2,type:Di.SHORT},{location:1,name:"a_id",count:4,type:Di.UNSIGNED_BYTE},{location:2,name:"a_color",count:4,type:Di.UNSIGNED_BYTE,normalized:!0},{location:3,name:"a_haloColor",count:4,type:Di.UNSIGNED_BYTE,normalized:!0},{location:4,name:"a_texAndSize",count:4,type:Di.UNSIGNED_BYTE},{location:5,name:"a_refSymbolAndPlacementOffset",count:4,type:Di.UNSIGNED_BYTE},{location:6,name:"a_glyphData",count:4,type:Di.UNSIGNED_BYTE},{location:7,name:"a_vertexOffset",count:2,type:Di.SHORT},{location:8,name:"a_texCoords",count:2,type:Di.UNSIGNED_SHORT}]});let jZi=class extends MQ{dispose(){}getGeometryType(){return wn.LABEL}supportsSymbology(e){return!0}drawGeometry(e,i,r,n){const{context:s,painter:o,state:a,rendererInfo:l,requestRender:c,allowDelayedRender:d}=e,p=TF.load(r.materialKey),y=p.mapAligned?1:0;if(!y&&Math.abs(i.key.level-Math.round(100*e.displayLevel)/100)>=1)return;const{bufferLayouts:v,attributes:S}=UZi(p),I=o.materialManager.getMaterialProgram(e,p,"materials/label",S,n);if(d&&ye(c)&&!I.compiled)return void c();e.context.setStencilFunction(El.EQUAL,0,255),s.useProgram(I),this._setSharedUniforms(I,e,i),o.textureManager.bindTextures(s,I,p);const O=y===1?a.displayViewMat3:a.displayMat3;this._setSizeVVUniforms(p,I,l,i),I.setUniform1f("u_mapRotation",Math.floor(a.rotation/360*254)),I.setUniform1f("u_mapAligned",y),I.setUniformMatrix3fv("u_displayMat3",O),I.setUniform1f("u_opacity",1),I.setUniform2fv("u_screenSize",e.state.size);const L=r.target.getVAO(s,v,S),N=r.indexFrom*Uint32Array.BYTES_PER_ELEMENT;s.bindVAO(L),I.setUniform1f("u_isHaloPass",0),I.setUniform1f("u_isBackgroundPass",1),s.drawElements(ls.TRIANGLES,r.indexCount,Di.UNSIGNED_INT,N),I.setUniform1f("u_isHaloPass",1),I.setUniform1f("u_isBackgroundPass",0),s.drawElements(ls.TRIANGLES,r.indexCount,Di.UNSIGNED_INT,N),I.setUniform1f("u_isHaloPass",0),I.setUniform1f("u_isBackgroundPass",0),s.drawElements(ls.TRIANGLES,r.indexCount,Di.UNSIGNED_INT,N),s.setStencilTestEnabled(!0),s.setBlendingEnabled(!0)}};const zZi=t=>QP(t.data,{geometry:[{location:0,name:"a_pos",count:2,type:Di.SHORT},{location:1,name:"a_id",count:4,type:Di.UNSIGNED_BYTE},{location:2,name:"a_color",count:4,type:Di.UNSIGNED_BYTE,normalized:!0},{location:3,name:"a_offsetAndNormal",count:4,type:Di.BYTE},{location:4,name:"a_accumulatedDistanceAndHalfWidth",count:2,type:Di.UNSIGNED_SHORT},{location:5,name:"a_tlbr",count:4,type:Di.UNSIGNED_SHORT},{location:6,name:"a_segmentDirection",count:4,type:Di.BYTE},{location:7,name:"a_aux",count:2,type:Di.UNSIGNED_SHORT},{location:8,name:"a_zoomRange",count:2,type:Di.UNSIGNED_SHORT}]});let HZi=class extends MQ{dispose(){}getGeometryType(){return wn.LINE}supportsSymbology(e){return!0}drawGeometry(e,i,r,n){const{context:s,painter:o,rendererInfo:a,displayLevel:l,passOptions:c,requestRender:d,allowDelayedRender:p}=e,y=vO.load(r.materialKey),v=ye(c)&&c.type==="hittest";let S=zZi(y),I=ls.TRIANGLES;v&&(S=this._getTriangleDesc(r.materialKey,S),I=ls.POINTS);const{attributes:O,bufferLayouts:L}=S,N=o.materialManager.getMaterialProgram(e,y,"materials/line",O,n);if(p&&ye(d)&&!N.compiled)return void d();const G=1/e.pixelRatio,V=0;s.useProgram(N),this._setSharedUniforms(N,e,i),y.textureBinding&&o.textureManager.bindTextures(s,N,y);const Y=2**(l-i.key.level);N.setUniform1f("u_zoomFactor",Y),N.setUniform1f("u_blur",V+G),N.setUniform1f("u_antialiasing",G),this._setSizeVVUniforms(y,N,a,i),this._setColorAndOpacityVVUniforms(y,N,a),s.setFaceCullingEnabled(!1);const X=r.target.getVAO(s,L,O,v);let te=r.indexCount,re=r.indexFrom*Uint32Array.BYTES_PER_ELEMENT;v&&(te/=3,re/=3),s.bindVAO(X),s.drawElements(I,te,Di.UNSIGNED_INT,re)}};const WZi=t=>QP(t.data,{geometry:[{location:0,name:"a_pos",count:2,type:Di.SHORT},{location:1,name:"a_id",count:4,type:Di.UNSIGNED_BYTE},{location:2,name:"a_color",count:4,type:Di.UNSIGNED_BYTE,normalized:!0},{location:3,name:"a_haloColor",count:4,type:Di.UNSIGNED_BYTE,normalized:!0},{location:4,name:"a_texFontSize",count:4,type:Di.UNSIGNED_BYTE},{location:5,name:"a_aux",count:4,type:Di.BYTE},{location:6,name:"a_zoomRange",count:2,type:Di.UNSIGNED_SHORT},{location:7,name:"a_vertexOffset",count:2,type:Di.SHORT},{location:8,name:"a_texCoords",count:2,type:Di.UNSIGNED_SHORT}]}),lh={marker:A5e,line:HZi,fill:oEt,text:class extends MQ{dispose(){}getGeometryType(){return wn.TEXT}supportsSymbology(e){return!0}drawGeometry(e,i,r,n){const{context:s,painter:o,rendererInfo:a,state:l,passOptions:c,requestRender:d,allowDelayedRender:p}=e,y=vj.load(r.materialKey),v=ye(c)&&c.type==="hittest",{bufferLayouts:S,attributes:I}=WZi(y),O=o.materialManager.getMaterialProgram(e,y,"materials/text",I,n);if(p&&ye(d)&&!O.compiled)return void d();s.useProgram(O);let L=ls.TRIANGLES;v&&(L=ls.POINTS),this._setSharedUniforms(O,e,i),o.textureManager.bindTextures(s,O,y),O.setUniformMatrix3fv("u_displayMat3",l.displayMat3),O.setUniformMatrix3fv("u_displayViewMat3",l.displayViewMat3),this._setSizeVVUniforms(y,O,a,i),this._setColorAndOpacityVVUniforms(y,O,a),this._setRotationVVUniforms(y,O,a);const N=r.target.getVAO(s,S,I),G=r.indexFrom*Uint32Array.BYTES_PER_ELEMENT;O.setUniform1f("u_isHaloPass",0),O.setUniform1f("u_isBackgroundPass",1),s.bindVAO(N),s.drawElements(L,r.indexCount,Di.UNSIGNED_INT,G),O.setUniform1f("u_isHaloPass",1),O.setUniform1f("u_isBackgroundPass",0),s.drawElements(ls.TRIANGLES,r.indexCount,Di.UNSIGNED_INT,G),O.setUniform1f("u_isHaloPass",0),O.setUniform1f("u_isBackgroundPass",0),s.drawElements(L,r.indexCount,Di.UNSIGNED_INT,G)}},label:jZi,clip:gZi,stencil:dEt,bitmap:rZi,overlay:vZi,tileInfo:hEt,vtlBackground:DZi,vtlFill:LZi,vtlLine:kZi,vtlCircle:FZi,vtlSymbol:VZi,dotDensity:TZi,heatmap:AZi,pieChart:MZi},qZi={background:{"background.frag":`#ifdef PATTERN +}`}};function yQi(t){let e=gQi;return t.split("/").forEach(i=>{e&&(e=e[i])}),e}const vQi=new H5e(yQi);function Ig(t){return vQi.resolveIncludes(t)}const LQ={shaders:{vertexShader:Ig("background/background.vert"),fragmentShader:Ig("background/background.frag")},attributes:new Map([["a_pos",0]])},_Qi=()=>iO("clip",{geometry:[{location:0,name:"a_pos",count:2,type:Bi.SHORT}]});let bQi=class extends q_{constructor(){super(...arguments),this._color=VE(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(nu.KEEP,nu.KEEP,nu.REPLACE),e.setStencilWriteMask(255),e.setStencilFunction(kl.ALWAYS,0,255)}draw(e,i){const{context:r,state:n,requestRender:s,allowDelayedRender:o}=e,a=_Qi(),l=i.getVAO(r,n,a.attributes,a.bufferLayouts);lt(l.indexBuffer)||(this._program||(this._program=$E(r,LQ)),o&&ve(s)&&!this._program.compiled?s():(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(bs.TRIANGLES,l.indexBuffer.size,Bi.UNSIGNED_INT,0),r.bindVAO()))}};const wQi=()=>iO("overlay",{geometry:[{location:0,name:"a_pos",count:2,type:Bi.FLOAT}],tex:[{location:1,name:"a_uv",count:2,type:Bi.UNSIGNED_SHORT}]});let xQi=class extends q_{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(Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA,Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0),e.setStencilFunction(kl.GREATER,255,255)}draw(e,i){const{context:r,painter:n,requestRender:s,allowDelayedRender:o}=e;if(!i.isReady)return;const{computedOpacity:a,dvsMat3:l,isWrapAround:c,perspectiveTransform:h,texture:p}=i;e.timeline.begin(this.name);const y=n.materialManager.getProgram(this._desc);if(o&&ve(s)&&!y.compiled)return void s();const v=wQi(),x=i.getVAO(r,v.bufferLayouts,v.attributes);if(!x)return;r.bindVAO(x),r.useProgram(y),r.bindTexture(p,Vpe),y.setUniformMatrix3fv("u_dvsMat3",l),y.setUniform1i("u_texture",Vpe),y.setUniform1f("u_opacity",a),y.setUniform2fv("u_perspective",h);const I=c?10:4;r.drawArrays(bs.TRIANGLE_STRIP,0,I),r.bindVAO(),e.timeline.end(this.name)}};function SQi(t,e,i){const r=sd.SIZE_FIELD_STOPS|sd.SIZE_MINMAX_VALUE|sd.SIZE_SCALE_STOPS|sd.SIZE_UNIT_VALUE,n=(e&(bG.FIELD_TARGETS_OUTLINE|bG.MINMAX_TARGETS_OUTLINE|bG.SCALE_TARGETS_OUTLINE|bG.UNIT_TARGETS_OUTLINE))>>>4;return t===Ln.LINE&&i.isOutline||t===Ln.FILL&&Vme(i.symbologyType)?r&n:r&~n}const IEt=0,AEt=8,CQi=7,PEt=8,OEt=11,REt=11,MEt=12,DEt=13,FEt=14,LEt=15,NEt=16,kEt=17,$Et=18,BEt=19,VEt=20,jEt=21,GEt=26,TQi=Object.keys(sa).filter(t=>typeof sa[t]=="number").reduce((t,e)=>({...t,[e]:sa[e]}),{});function EQi(t){return t===sa.SIMPLE||t===sa.OUTLINE_FILL_SIMPLE}function Vme(t){return t===sa.OUTLINE_FILL||t===sa.OUTLINE_FILL_SIMPLE}function UEt(t){return EQi(t.symbologyType)}function jme(t){return Vme(t.symbologyType)}function TS(t,e){switch(t){case Ln.FILL:return ES.from(e);case Ln.LINE:return wO.from(e);case Ln.MARKER:return IF.from(e);case Ln.TEXT:return TU.from(e);case Ln.LABEL:return AF.from(e);default:throw new Error(`Unable to createMaterialKey for unknown geometryType ${t}`)}}function IQi(t){switch(Y_.load(t).geometryType){case Ln.MARKER:return new IF(t);case Ln.FILL:return new ES(t);case Ln.LINE:return new wO(t);case Ln.TEXT:return new TU(t);case Ln.LABEL:return new AF(t)}}let Y_=class{static load(e){const i=this.shared;return i.data=e,i}constructor(e){this._data=0,this._data=e}set data(e){this._data=e??0}get data(){return this._data}get geometryType(){return this.bits(PEt,OEt)}set geometryType(e){this.setBits(e,PEt,OEt)}get mapAligned(){return!!this.bit(VEt)}set mapAligned(e){this.setBit(VEt,e)}get sdf(){return!!this.bit(REt)}set sdf(e){this.setBit(REt,e??!1)}get pattern(){return!!this.bit(MEt)}set pattern(e){this.setBit(MEt,e)}get textureBinding(){return this.bits(IEt,AEt)}set textureBinding(e){this.setBits(e,IEt,AEt)}get symbologyType(){return this.bits(jEt,GEt)}set symbologyType(e){this.setBits(e,jEt,GEt)}get geometryTypeString(){switch(this.geometryType){case Ln.FILL:return"fill";case Ln.MARKER:return"marker";case Ln.LINE:return"line";case Ln.TEXT:return"text";case Ln.LABEL:return"label";default:throw new st(`Unable to handle unknown geometryType: ${this.geometryType}`)}}setBit(e,i){const r=1<>e}setBits(e,i,r){for(let n=i,s=0;nclass extends t{get vvSizeMinMaxValue(){return this.bit(NEt)!==0}set vvSizeMinMaxValue(e){this.setBit(NEt,e)}get vvSizeScaleStops(){return this.bit(kEt)!==0}set vvSizeScaleStops(e){this.setBit(kEt,e)}get vvSizeFieldStops(){return this.bit($Et)!==0}set vvSizeFieldStops(e){this.setBit($Et,e)}get vvSizeUnitValue(){return this.bit(BEt)!==0}set vvSizeUnitValue(e){this.setBit(BEt,e)}hasVV(){return super.hasVV()||this.vvSizeMinMaxValue||this.vvSizeScaleStops||this.vvSizeFieldStops||this.vvSizeUnitValue}setVV(e,i){super.setVV(e,i);const r=SQi(this.geometryType,e,i)&e;this.vvSizeMinMaxValue=!!(r&sd.SIZE_MINMAX_VALUE),this.vvSizeFieldStops=!!(r&sd.SIZE_FIELD_STOPS),this.vvSizeUnitValue=!!(r&sd.SIZE_UNIT_VALUE),this.vvSizeScaleStops=!!(r&sd.SIZE_SCALE_STOPS)}},zEt=t=>class extends t{get vvRotation(){return this.bit(LEt)!==0}set vvRotation(e){this.setBit(LEt,e)}hasVV(){return super.hasVV()||this.vvRotation}setVV(e,i){super.setVV(e,i),this.vvRotation=!i.isOutline&&!!(e&sd.ROTATION)}},Gme=t=>class extends t{get vvColor(){return this.bit(DEt)!==0}set vvColor(e){this.setBit(DEt,e)}hasVV(){return super.hasVV()||this.vvColor}setVV(e,i){super.setVV(e,i),this.vvColor=!i.isOutline&&!!(e&sd.COLOR)}},Ume=t=>class extends t{get vvOpacity(){return this.bit(FEt)!==0}set vvOpacity(e){this.setBit(FEt,e)}hasVV(){return super.hasVV()||this.vvOpacity}setVV(e,i){super.setVV(e,i),this.vvOpacity=!i.isOutline&&!!(e&sd.OPACITY)}};let ES=class extends Gme(Ume(NQ(Y_))){static load(e){const i=this.shared;return i.data=e,i}static from(e){const{symbologyType:i,vvFlags:r}=e,n=this.load(0);return n.geometryType=Ln.FILL,n.symbologyType=i,i!==sa.DOT_DENSITY&&n.setVV(r,e),n.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};ES.shared=new ES(0);let IF=class extends Gme(Ume(zEt(NQ(Y_)))){static load(e){const i=this.shared;return i.data=e,i}static from(e){const{symbologyType:i,vvFlags:r}=e,n=this.load(0);return n.geometryType=Ln.MARKER,n.symbologyType=i,i!==sa.HEATMAP&&n.setVV(r,e),n.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvRotation:this.vvRotation,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};IF.shared=new IF(0);let wO=class extends Gme(Ume(NQ(Y_))){static load(e){const i=this.shared;return i.data=e,i}static from(e){const i=this.load(0);return i.geometryType=Ln.LINE,i.symbologyType=e.symbologyType,i.setVV(e.vvFlags,e),i.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};wO.shared=new wO(0);let TU=class extends Gme(Ume(zEt(NQ(Y_)))){static load(e){const i=this.shared;return i.data=e,i}static from(e){const i=this.load(0);return i.geometryType=Ln.TEXT,i.symbologyType=e.symbologyType,i.setVV(e.vvFlags,e),i.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvRotation:this.vvRotation,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};TU.shared=new TU(0);let AF=class extends NQ(Y_){static load(e){const i=this.shared;return i.data=e,i}static from(e){const i=this.load(0);return i.geometryType=Ln.LABEL,i.symbologyType=e.symbologyType,i.setVV(e.vvFlags,e),i.mapAligned=lCt(e.placement),i.data}getVariation(){return{...super.getVariation(),vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};AF.shared=new AF(0);let kQ=class extends q_{constructor(){super(...arguments),this._computeDesc=new Map}prepareState({context:e},i){i&&i.includes("hittest")?e.setBlendFunctionSeparate(Sn.ONE,Sn.ONE,Sn.ONE,Sn.ONE):e.setBlendFunctionSeparate(Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA,Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA),e.setBlendingEnabled(!0),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0)}draw(e,i,r){const n=this.getGeometryType();i.commit(e);const s=i.getGeometry(n);lt(s)||(e.timeline.begin(this.name),e.attributeView.bindTextures(e.context),e.context.setStencilFunction(kl.EQUAL,i.stencilRef,255),s.forEachCommand(o=>{const a=Y_.load(o.materialKey).symbologyType;this.supportsSymbology(a)&&this.drawGeometry(e,i,o,r)}))}_setSharedUniforms(e,i,r){const{displayLevel:n,pixelRatio:s,state:o,passOptions:a}=i;ve(a)&&a.type==="hittest"&&(e.setUniform2fv("u_hittestPos",a.position),e.setUniform1f("u_hittestDist",a.distance)),e.setUniform1f("u_pixelRatio",s),e.setUniformMatrix3fv("u_tileMat3",r.transforms.tileMat3),e.setUniformMatrix3fv("u_viewMat3",o.viewMat3),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.dvs),e.setUniformMatrix3fv("u_displayViewMat3",o.displayViewMat3),e.setUniform1f("u_currentZoom",Math.round(n*dy)),e.setUniform1i("u_attributeTextureSize",i.attributeView.size),e.setUniform1i("u_attributeData0",jpe),e.setUniform1i("u_attributeData1",Gpe),e.setUniform1i("u_attributeData2",dFe),e.setUniform1i("u_attributeData3",pFe),e.setUniform1i("u_attributeData4",Upe),e.setUniform1i("u_attributeData5",zpe)}_setSizeVVUniforms(e,i,r,n){if(e.vvSizeMinMaxValue&&i.setUniform4fv("u_vvSizeMinMaxValue",r.vvSizeMinMaxValue),e.vvSizeScaleStops&&i.setUniform1f("u_vvSizeScaleStopsValue",r.vvSizeScaleStopsValue),e.vvSizeFieldStops){const s=r.getSizeVVFieldStops(n.key.level);s!=null&&(i.setUniform1fv("u_vvSizeFieldStopsValues",s.values),i.setUniform1fv("u_vvSizeFieldStopsSizes",s.sizes))}e.vvSizeUnitValue&&i.setUniform1f("u_vvSizeUnitValueWorldToPixelsRatio",r.vvSizeUnitValueToPixelsRatio)}_setColorAndOpacityVVUniforms(e,i,r){e.vvColor&&(i.setUniform1fv("u_vvColorValues",r.vvColorValues),i.setUniform4fv("u_vvColors",r.vvColors)),e.vvOpacity&&(i.setUniform1fv("u_vvOpacityValues",r.vvOpacityValues),i.setUniform1fv("u_vvOpacities",r.vvOpacities))}_setRotationVVUniforms(e,i,r){e.vvRotation&&i.setUniform1f("u_vvRotationType",r.vvMaterialParameters.vvRotationType==="geographic"?0:1)}_getTriangleDesc(e,i,r=["a_pos"]){const n=i.bufferLayouts.geometry,s=r.map(l=>n.findIndex(c=>c.name===l)),o=`${e}-${s.join("-")}`;let a=this._computeDesc.get(o);if(!a){const l=i.strides,c=i.strides.geometry,h=new Map(i.attributes),p=n.map(I=>({...I})),y=Math.max(...i.attributes.values()),v={geometry:p};let x=0;for(const I of s){const P=n[I];v.geometry.push({count:P.count,name:P.name+"1",divisor:P.divisor,normalized:P.normalized,offset:c+P.offset,stride:c,type:P.type}),v.geometry.push({count:P.count,name:P.name+"2",divisor:P.divisor,normalized:P.normalized,offset:2*c+P.offset,stride:c,type:P.type}),h.set(P.name+"1",y+ ++x),h.set(P.name+"2",y+ ++x)}a={bufferLayouts:v,attributes:h,strides:l},this._computeDesc.set(o,a)}return a}},PF=class{static getStorageSpec(e){return null}static createOrUpdateRendererSchema(e,i){return ve(e)&&e.type==="default"?e:{type:"default"}}static getVariation(e){return{}}static getVariationHash(e){return 0}};PF.type="default",PF.programSpec=null;let zme=class extends PF{static getStorageSpec({attributes:e}){return{visualVariables:!1,attributes:e??null}}static _createRendererSchema(){return{type:"dot-density",colors:new Float32Array(32),dotValue:-1,dotSize:-1,dotScale:-1,dotBlending:!1,backgroundColor:new Float32Array(4),activeDots:new Float32Array(8),seed:-1}}static createOrUpdateRendererSchema(e,i){const{attributes:r,dotValue:n,referenceScale:s,dotSize:o,dotBlendingEnabled:a,seed:l,backgroundColor:c}=i,h=ve(e)&&e.type==="dot-density"?e:this._createRendererSchema();h.dotValue=n,h.dotSize=o,h.dotScale=s,h.dotBlending=a,h.seed=l;const{colors:p,activeDots:y,backgroundColor:v}=h;for(let x=0;x=r.length?null:r[x].color;xG(p,I,4*x)}for(let x=0;x<8;x++)y[x]=x`${P}:${I.toString()}`).join();let v,x=!0;return ve(e)&&e.type==="heatmap"?(v=e,x=y!==e.gradientHash):v=this._createRendererSchema(),v.radius=vn(r),v.minDensity=n,v.densityRange=h,v.referenceScale=o,v.isFieldActive=p,x&&(v.gradient=Rze(c),v.gradientHash=y),v}};Hme.type="heatmap",Hme.programSpec={shader:"materials/icon/heatmapAccumulate",vertexLayout:{geometry:[{location:0,name:"a_pos",count:2,type:Bi.SHORT},{location:1,name:"a_vertexOffset",count:2,type:Bi.SHORT},{location:4,name:"a_id",count:4,type:Bi.UNSIGNED_BYTE}]}};let Wme=class extends PF{static getStorageSpec({attributes:e}){return{visualVariables:!0,attributes:e??null}}static _createRendererSchema(){return{type:"pie-chart",colors:new Float32Array(4*nvt),defaultColor:new Float32Array(4),othersColor:new Float32Array(4),outlineColor:new Float32Array(4),holePercentage:0,sectorThreshold:0,outlineWidth:1,numberOfFields:10}}static createOrUpdateRendererSchema(e,i){const{attributes:r,defaultColor:n,holePercentage:s,othersCategory:o,outline:a}=i,l=ve(e)&&e.type==="pie-chart"?e:this._createRendererSchema();for(let c=0;c=r.length?new en([0,0,0,0]):r[c].color;xG(l.colors,h,4*c)}return xG(l.defaultColor,n),xG(l.othersColor,o?.color),xG(l.outlineColor,a?.color),l.outlineWidth=vn(a?.width||0),l.holePercentage=s,l.sectorThreshold=o?.threshold||0,l.numberOfFields=r.length,l}static getVariation(e){return{numberOfFields:e.numberOfFields}}static getVariationHash(e){return e.numberOfFields}};Wme.type="pie-chart",Wme.programSpec={shader:"materials/pie",vertexLayout:{geometry:[{location:0,name:"a_pos",count:2,type:Bi.SHORT},{location:1,name:"a_vertexOffset",count:2,type:Bi.SHORT},{location:2,name:"a_texCoords",count:2,type:Bi.UNSIGNED_SHORT},{location:3,name:"a_bitSetAndDistRatio",count:2,type:Bi.UNSIGNED_SHORT},{location:4,name:"a_id",count:4,type:Bi.UNSIGNED_BYTE},{location:5,name:"a_color",count:4,type:Bi.UNSIGNED_BYTE,normalized:!0},{location:6,name:"a_outlineColor",count:4,type:Bi.UNSIGNED_BYTE,normalized:!0},{location:7,name:"a_sizeAndOutlineWidth",count:4,type:Bi.UNSIGNED_BYTE},{location:8,name:"a_zoomRange",count:2,type:Bi.UNSIGNED_SHORT}]},hittestAttributes:["a_vertexOffset","a_texCoords"]};function EU(t,e){if(t.type!==e)throw new st("material-view-model:unexpected-renderer-schema",`expected to find renderer schema of type "${e}" but found type "${t.type}"`)}function HEt(t){switch(t?.type){case"dot-density":return zme;case"heatmap":return Hme;case"pie-chart":return Wme;default:return PF}}function WEt(t){const{geometryType:e,symbologyType:i}=Y_.load(t);switch(e){case Ln.FILL:if(i===sa.DOT_DENSITY)return zme;break;case Ln.MARKER:switch(i){case sa.HEATMAP:return Hme;case sa.PIE_CHART:return Wme}}return PF}function AQi(t){const e={geometry:[{location:0,name:"a_pos",count:2,type:Bi.SHORT},{location:1,name:"a_id",count:3,type:Bi.UNSIGNED_BYTE},{location:2,name:"a_bitset",count:1,type:Bi.UNSIGNED_BYTE},{location:3,name:"a_color",count:4,type:Bi.UNSIGNED_BYTE,normalized:!0},{location:4,name:"a_aux1",count:4,type:Bi.UNSIGNED_SHORT},{location:5,name:"a_aux2",count:4,type:Bi.SHORT},{location:6,name:"a_aux3",count:4,type:Bi.UNSIGNED_BYTE},{location:7,name:"a_zoomRange",count:2,type:Bi.UNSIGNED_SHORT}]};switch(t.symbologyType){case sa.SIMPLE:case sa.OUTLINE_FILL_SIMPLE:e.geometry.splice(7,1),e.geometry.splice(4,1)}return{shader:"materials/fill",vertexLayout:e}}let qEt=class extends kQ{dispose(){}getGeometryType(){return Ln.FILL}supportsSymbology(e){return e!==sa.DOT_DENSITY}drawGeometry(e,i,r,n){const{context:s,painter:o,rendererInfo:a,requiredLevel:l,passOptions:c,requestRender:h,allowDelayedRender:p}=e,y=ES.load(r.materialKey),v=WEt(y.data),x=ve(c)&&c.type==="hittest",I=o.materialManager,{shader:P,vertexLayout:F,hittestAttributes:k}=zu(v.programSpec,AQi(y));let j=bs.TRIANGLES,V=iO(y.data,F);x&&(V=this._getTriangleDesc(r.materialKey,V,k),j=bs.POINTS);const{attributes:Y,bufferLayouts:X}=V,Z=I.getMaterialProgram(e,y,P,Y,n);if(p&&ve(h)&&!Z.compiled)return void h();if(s.useProgram(Z),this._setSharedUniforms(Z,e,i),Z.setUniform2f("u_tileOffset",512*i.key.col,512*i.key.row),y.textureBinding){o.textureManager.bindTextures(s,Z,y);const xe=1/2**(l-i.key.level);Z.setUniform1f("u_zoomFactor",xe)}const ie=1/e.pixelRatio;Z.setUniform1f("u_blur",ie),Z.setUniform1f("u_antialiasing",ie),this._setSizeVVUniforms(y,Z,a,i),this._setColorAndOpacityVVUniforms(y,Z,a);const ce=r.target.getVAO(s,X,Y,x);let he=r.indexCount,_e=r.indexFrom*Uint32Array.BYTES_PER_ELEMENT;x&&(he/=3,_e/=3),s.bindVAO(ce),this._drawFills(e,i,Z,j,he,_e)}_drawFills(e,i,r,n,s,o){e.context.drawElements(n,s,Bi.UNSIGNED_INT,o)}},PQi=class extends qEt{constructor(){super(...arguments),this._dotTextureSize=0,this._dotTextures=null,this._dotSamplers=new Int32Array([Z5i,Q5i]),this._dotVAO=null,this._dotDesc={vsPath:"dot/dot",fsPath:"dot/dot",attributes:new Map([["a_pos",0]])}}dispose(){super.dispose(),this._disposeTextures(),this._dotFBO=qa(this._dotFBO),this._dotVAO=qa(this._dotVAO)}getGeometryType(){return Ln.FILL}supportsSymbology(e){return e===sa.DOT_DENSITY}_drawFills(e,i,r,n,s,o){const{passOptions:a}=e;if(ve(a)&&a.type==="hittest")super._drawFills(e,i,r,n,s,o);else{const l=this._drawDotLocations(e,i,r,s,o);this._drawDotDensity(e,i,l)}}_drawDotDensity(e,i,r){const{context:n,painter:s,rendererInfo:o,requestRender:a,allowDelayedRender:l}=e,c=s.materialManager.getProgram(this._dotDesc);if(l&&ve(a)&&!c.compiled)return void a();const{rendererSchema:h}=o;EU(h,"dot-density");const p=this._createDotDensityMesh(n,this._dotDesc.attributes,{geometry:[{name:"a_pos",count:2,type:Bi.SHORT,divisor:0,normalized:!1,offset:0,stride:4}]});n.setStencilTestEnabled(!0),n.useProgram(c),c.setUniform1f("u_tileZoomFactor",1),c.setUniform1i("u_texture",this._dotSamplers[0]),c.setUniform1f("u_dotSize",Math.max(h.dotSize,1)),c.setUniform1f("u_pixelRatio",window.devicePixelRatio),this._setSharedUniforms(c,e,i),n.bindTexture(r,this._dotSamplers[0]),n.bindVAO(p),n.drawArrays(bs.POINTS,0,262144)}_drawDotLocations(e,i,r,n,s){const{context:o,rendererInfo:a,requiredLevel:l}=e,c=o.getViewport(),{rendererSchema:h}=a;EU(h,"dot-density");const{dotScale:p,colors:y,activeDots:v,backgroundColor:x,dotValue:I}=h;o.setViewport(0,0,512,512);const P=o.getBoundFramebufferObject(),F=this._createFBO(o);o.bindFramebuffer(F),o.setClearColor(0,0,0,0),o.clear(o.gl.COLOR_BUFFER_BIT|o.gl.STENCIL_BUFFER_BIT),o.setStencilTestEnabled(!1);const k=1/2**(l-i.key.level),j=Pc,V=j*window.devicePixelRatio*j*window.devicePixelRatio,Y=1/k*(1/k),X=p?e.state.scale/p:1;return r.setUniform1f("u_tileZoomFactor",k),r.setUniform1f("u_tileDotsOverArea",V/(Pc*window.devicePixelRatio*Pc*window.devicePixelRatio)),r.setUniformMatrix4fv("u_dotColors",y),r.setUniform4fv("u_isActive",v),r.setUniform4fv("u_dotBackgroundColor",x),r.setUniform1f("u_dotValue",Math.max(1,I*X*Y)),this._bindDotDensityTextures(o,r,a,j),o.drawElements(bs.TRIANGLES,n,Bi.UNSIGNED_INT,s),o.setViewport(c.x,c.y,c.width,c.height),o.bindFramebuffer(P),F.colorTexture}_createFBO(e){if(lt(this._dotFBO)){const n={target:so.TEXTURE_2D,pixelFormat:gn.RGBA,dataType:ds.UNSIGNED_BYTE,samplingMode:In.NEAREST,wrapMode:ws.CLAMP_TO_EDGE,width:512,height:512},s={colorTarget:Ah.TEXTURE,depthStencilTarget:Tl.DEPTH_STENCIL_RENDER_BUFFER},o=new vO(e,{width:512,height:512,internalFormat:xg.DEPTH_STENCIL});this._dotFBO=new ad(e,s,n,o)}return this._dotFBO}_disposeTextures(){if(this._dotTextures){for(let e=0;e0&&(n+=`, ${r}`);const s=this._canvas,o=s.getContext("2d");return o.font="24px sans-serif",o.textAlign="left",o.textBaseline="top",o.clearRect(0,0,qme,Yme),r>1e5?(o.fillStyle="red",o.fillRect(0,0,qme,Yme),o.fillStyle="black"):(o.clearRect(0,0,qme,Yme),o.fillStyle="blue"),o.fillText(n,0,0),i.texture=new Fs(e,{target:so.TEXTURE_2D,pixelFormat:gn.RGBA,dataType:ds.UNSIGNED_BYTE,samplingMode:In.NEAREST,wrapMode:ws.CLAMP_TO_EDGE},s),i.texture}},NQi=class extends K5e{supportsSymbology(e){return e===sa.PIE_CHART}_drawMarkers(e,i,r,n,s,o,a){const{context:l}=e,{rendererInfo:c}=e,{rendererSchema:h}=c;EU(h,"pie-chart"),r.setUniform4fv("u_colors",h.colors),r.setUniform4fv("u_defaultColor",h.defaultColor),r.setUniform4fv("u_othersColor",h.othersColor),r.setUniform4fv("u_outlineColor",h.outlineColor),r.setUniform1f("u_donutRatio",h.holePercentage),r.setUniform1f("u_sectorThreshold",h.sectorThreshold),r.setUniform1f("u_outlineWidth",h.outlineWidth),l.drawElements(n,s,Bi.UNSIGNED_INT,o)}},QEt=class extends q_{constructor(){super(...arguments),this._color=VE(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(nu.KEEP,nu.KEEP,nu.REPLACE),e.setStencilWriteMask(255)}draw(e,i){const{context:r,requestRender:n,allowDelayedRender:s}=e;this._initialized||this._initialize(r),s&&ve(n)&&!this._solidProgram.compiled?n():(r.setStencilFunctionSeparate(Jw.FRONT_AND_BACK,kl.GREATER,i.stencilRef,255),r.bindVAO(this._solidVertexArrayObject),r.useProgram(this._solidProgram),this._solidProgram.setUniformMatrix3fv("u_dvsMat3",i.transforms.dvs),this._solidProgram.setUniform2fv("u_coord_range",[i.rangeX,i.rangeY]),this._solidProgram.setUniform1f("u_depth",0),this._solidProgram.setUniform4fv("u_color",this._color),r.drawArrays(bs.TRIANGLE_STRIP,0,4),r.bindVAO())}_initialize(e){if(this._initialized)return!0;const i=$E(e,LQ);if(!i)return!1;const r=new Int8Array([0,0,1,0,0,1,1,1]),n=aa.createVertex(e,Xo.STATIC_DRAW,r),s=new Mc(e,LQ.attributes,J5e,{geometry:n});return this._solidProgram=i,this._solidVertexArrayObject=s,this._initialized=!0,!0}},kQi=class extends q_{constructor(){super(...arguments),this._color=VE(1,0,0,1),this._patternMatrix=Dl(),this._programOptions={id:!1,pattern:!1}}dispose(){this._vao&&(this._vao.dispose(),this._vao=null)}drawMany(e,i){const{context:r,painter:n,styleLayerUID:s,requestRender:o,allowDelayedRender:a}=e;this._loadWGLResources(e);const l=e.displayLevel,c=e.styleLayer,h=c.backgroundMaterial,p=n.vectorTilesMaterialManager,y=c.getPaintValue("background-color",l),v=c.getPaintValue("background-opacity",l),x=c.getPaintValue("background-pattern",l),I=x!==void 0,P=y[3]*v,F=1|window.devicePixelRatio,k=e.spriteMosaic;let j,V;const Y=F>pvt?2:1,X=e.drawPhase===mo.HITTEST,Z=this._programOptions;Z.id=X,Z.pattern=I;const ie=p.getMaterialProgram(r,h,Z);if(a&&ve(o)&&!ie.compiled)o();else{if(r.bindVAO(this._vao),r.useProgram(ie),I){const ce=k.getMosaicItemPosition(x,!0);if(ve(ce)){const{tl:he,br:_e,page:xe}=ce;j=_e[0]-he[0],V=_e[1]-he[1];const Pe=k.getPageSize(xe);ve(Pe)&&(k.bind(r,In.LINEAR,xe,Zw),ie.setUniform4f("u_tlbr",he[0],he[1],_e[0],_e[1]),ie.setUniform2fv("u_mosaicSize",Pe),ie.setUniform1i("u_texture",Zw))}ie.setUniform1f("u_opacity",v)}else this._color[0]=P*y[0],this._color[1]=P*y[1],this._color[2]=P*y[2],this._color[3]=P,ie.setUniform4fv("u_color",this._color);if(ie.setUniform1f("u_depth",c.z||0),X){const ce=BJ(s+1);ie.setUniform4fv("u_id",ce)}for(const ce of i){if(ie.setUniform1f("u_coord_range",ce.rangeX),ie.setUniformMatrix3fv("u_dvsMat3",ce.transforms.dvs),I){const he=Math.max(2**(Math.round(l)-ce.key.level),1),_e=Y*ce.width*he,xe=_e/q8(j),Pe=_e/q8(V);this._patternMatrix[0]=xe,this._patternMatrix[4]=Pe,ie.setUniformMatrix3fv("u_pattern_matrix",this._patternMatrix)}r.setStencilFunction(kl.EQUAL,0,255),r.drawArrays(bs.TRIANGLE_STRIP,0,4)}}}_loadWGLResources(e){if(this._vao)return;const{context:i,styleLayer:r}=e,n=r.backgroundMaterial,s=new Int8Array([0,0,1,0,0,1,1,1]),o=aa.createVertex(i,Xo.STATIC_DRAW,s),a=new Mc(i,n.getAttributeLocations(),n.getLayoutInfo(),{geometry:o});this._vao=a}},$Qi=class extends q_{constructor(){super(...arguments),this._programOptions={id:!1}}dispose(){}drawMany(e,i){const{context:r,displayLevel:n,requiredLevel:s,state:o,drawPhase:a,painter:l,spriteMosaic:c,styleLayerUID:h,requestRender:p,allowDelayedRender:y}=e;if(!i.some(Z=>Z.layerData.get(h)?.circleIndexCount??!1))return;const v=e.styleLayer,x=v.circleMaterial,I=l.vectorTilesMaterialManager,P=1.2,F=v.getPaintValue("circle-translate",n),k=v.getPaintValue("circle-translate-anchor",n),j=a===mo.HITTEST,V=this._programOptions;V.id=j;const Y=I.getMaterialProgram(r,x,V);if(y&&ve(p)&&!Y.compiled)return void p();r.useProgram(Y),Y.setUniformMatrix3fv("u_displayMat3",k===U_.VIEWPORT?o.displayMat3:o.displayViewMat3),Y.setUniform2fv("u_circleTranslation",F),Y.setUniform1f("u_depth",v.z),Y.setUniform1f("u_antialiasingWidth",P);let X=-1;if(j){const Z=BJ(h+1);Y.setUniform4fv("u_id",Z)}for(const Z of i){if(!Z.layerData.has(h))continue;Z.key.level!==X&&(X=Z.key.level,x.setDataUniforms(Y,n,v,X,c));const ie=Z.layerData.get(h);if(!ie.circleIndexCount)continue;ie.prepareForRendering(r);const ce=ie.circleVertexArrayObject;lt(ce)||(r.bindVAO(ce),Y.setUniformMatrix3fv("u_dvsMat3",Z.transforms.dvs),s!==Z.key.level?r.setStencilFunction(kl.EQUAL,Z.stencilRef,255):r.setStencilFunction(kl.GREATER,255,255),r.drawElements(bs.TRIANGLES,ie.circleIndexCount,Bi.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*ie.circleIndexStart),Z.triangleCount+=ie.circleIndexCount/3)}}};const eIt=1/65536;let BQi=class extends q_{constructor(){super(...arguments),this._fillProgramOptions={id:!1,pattern:!1},this._outlineProgramOptions={id:!1}}dispose(){}drawMany(e,i){const{displayLevel:r,drawPhase:n,renderPass:s,spriteMosaic:o,styleLayerUID:a}=e;let l=!1;for(const Y of i)if(Y.layerData.has(a)){const X=Y.layerData.get(a);if(X.fillIndexCount>0||X.outlineIndexCount>0){l=!0;break}}if(!l)return;const c=e.styleLayer,h=c.getPaintProperty("fill-pattern"),p=h!==void 0,y=p&&h.isDataDriven;let v;if(p&&!y){const Y=h.getValue(r);v=o.getMosaicItemPosition(Y,!0)}const x=!p&&c.getPaintValue("fill-antialias",r);let I=!0,P=1;if(!p){const Y=c.getPaintProperty("fill-color"),X=c.getPaintProperty("fill-opacity");if(!Y?.isDataDriven&&!X?.isDataDriven){const Z=c.getPaintValue("fill-color",r);P=c.getPaintValue("fill-opacity",r)*Z[3],P>=1&&(I=!1)}}if(I&&s==="opaque")return;let F;n===mo.HITTEST&&(F=BJ(a+1));const k=c.getPaintValue("fill-translate",r),j=c.getPaintValue("fill-translate-anchor",r);(I||s!=="translucent")&&this._drawFill(e,a,c,i,k,j,p,v,y,F);const V=!c.hasDataDrivenOutlineColor&&c.outlineUsesFillColor&&P<1;x&&s!=="opaque"&&!V&&this._drawOutline(e,a,c,i,k,j,F)}_drawFill(e,i,r,n,s,o,a,l,c,h){if(a&&!c&<(l))return;const{context:p,displayLevel:y,state:v,drawPhase:x,painter:I,pixelRatio:P,spriteMosaic:F,requestRender:k,allowDelayedRender:j}=e,V=r.fillMaterial,Y=I.vectorTilesMaterialManager,X=P>pvt?2:1,Z=x===mo.HITTEST,ie=this._fillProgramOptions;ie.id=Z,ie.pattern=a;const ce=Y.getMaterialProgram(p,V,ie);if(j&&ve(k)&&!ce.compiled)return void k();if(p.useProgram(ce),ve(l)){const{page:_e}=l,xe=F.getPageSize(_e);ve(xe)&&(F.bind(p,In.LINEAR,_e,Zw),ce.setUniform2fv("u_mosaicSize",xe),ce.setUniform1i("u_texture",Zw))}ce.setUniformMatrix3fv("u_displayMat3",o===U_.VIEWPORT?v.displayMat3:v.displayViewMat3),ce.setUniform2fv("u_fillTranslation",s),ce.setUniform1f("u_depth",r.z+eIt),Z&&ce.setUniform4fv("u_id",h);let he=-1;for(const _e of n){if(!_e.layerData.has(i))continue;_e.key.level!==he&&(he=_e.key.level,V.setDataUniforms(ce,y,r,he,F));const xe=_e.layerData.get(i);if(!xe.fillIndexCount)continue;xe.prepareForRendering(p);const Pe=xe.fillVertexArrayObject;if(!lt(Pe)){if(p.bindVAO(Pe),ce.setUniformMatrix3fv("u_dvsMat3",_e.transforms.dvs),p.setStencilFunction(kl.EQUAL,_e.stencilRef,255),a){const ke=Math.max(2**(Math.round(y)-_e.key.level),1),J=_e.rangeX/(X*_e.width*ke);ce.setUniform1f("u_patternFactor",J)}if(c){const ke=xe.patternMap;if(!ke)continue;for(const[J,de]of ke){const Se=F.getPageSize(J);ve(Se)&&(F.bind(p,In.LINEAR,J,Zw),ce.setUniform2fv("u_mosaicSize",Se),ce.setUniform1i("u_texture",Zw),p.drawElements(bs.TRIANGLES,de[1],Bi.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*de[0]))}}else p.drawElements(bs.TRIANGLES,xe.fillIndexCount,Bi.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*xe.fillIndexStart);_e.triangleCount+=xe.fillIndexCount/3}}}_drawOutline(e,i,r,n,s,o,a){const{context:l,displayLevel:c,state:h,drawPhase:p,painter:y,pixelRatio:v,spriteMosaic:x,requestRender:I,allowDelayedRender:P}=e,F=r.outlineMaterial,k=y.vectorTilesMaterialManager,j=.75/v,V=p===mo.HITTEST,Y=this._outlineProgramOptions;Y.id=V;const X=k.getMaterialProgram(l,F,Y);if(P&&ve(I)&&!X.compiled)return void I();l.useProgram(X),X.setUniformMatrix3fv("u_displayMat3",o===U_.VIEWPORT?h.displayMat3:h.displayViewMat3),X.setUniform2fv("u_fillTranslation",s),X.setUniform1f("u_depth",r.z+eIt),X.setUniform1f("u_outline_width",j),V&&X.setUniform4fv("u_id",a);let Z=-1;for(const ie of n){if(!ie.layerData.has(i))continue;ie.key.level!==Z&&(Z=ie.key.level,F.setDataUniforms(X,c,r,Z,x));const ce=ie.layerData.get(i);if(ce.prepareForRendering(l),!ce.outlineIndexCount)continue;const he=ce.outlineVertexArrayObject;lt(he)||(l.bindVAO(he),X.setUniformMatrix3fv("u_dvsMat3",ie.transforms.dvs),l.setStencilFunction(kl.EQUAL,ie.stencilRef,255),l.drawElements(bs.TRIANGLES,ce.outlineIndexCount,Bi.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*ce.outlineIndexStart),ie.triangleCount+=ce.outlineIndexCount/3)}}},VQi=class extends q_{constructor(){super(...arguments),this._programOptions={id:!1,pattern:!1,sdf:!1}}dispose(){}drawMany(e,i){const{context:r,displayLevel:n,state:s,drawPhase:o,painter:a,pixelRatio:l,spriteMosaic:c,styleLayerUID:h,requestRender:p,allowDelayedRender:y}=e;if(!i.some(Pe=>Pe.layerData.get(h)?.lineIndexCount??!1))return;const v=e.styleLayer,x=v.lineMaterial,I=a.vectorTilesMaterialManager,P=v.getPaintValue("line-translate",n),F=v.getPaintValue("line-translate-anchor",n),k=v.getPaintProperty("line-pattern"),j=k!==void 0,V=j&&k.isDataDriven;let Y,X;if(j&&!V){const Pe=k.getValue(n);Y=c.getMosaicItemPosition(Pe)}let Z=!1;if(!j){const Pe=v.getPaintProperty("line-dasharray");if(X=Pe!==void 0,Z=X&&Pe.isDataDriven,X&&!Z){const ke=Pe.getValue(n),J=v.getDashKey(ke,v.getLayoutValue("line-cap",n));Y=c.getMosaicItemPosition(J)}}const ie=1/l,ce=o===mo.HITTEST,he=this._programOptions;he.id=ce,he.pattern=j,he.sdf=X;const _e=I.getMaterialProgram(r,x,he);if(y&&ve(p)&&!_e.compiled)return void p();if(r.useProgram(_e),_e.setUniformMatrix3fv("u_displayViewMat3",s.displayViewMat3),_e.setUniformMatrix3fv("u_displayMat3",F===U_.VIEWPORT?s.displayMat3:s.displayViewMat3),_e.setUniform2fv("u_lineTranslation",P),_e.setUniform1f("u_depth",v.z),_e.setUniform1f("u_antialiasing",ie),ce){const Pe=BJ(h+1);_e.setUniform4fv("u_id",Pe)}if(Y&&ve(Y)){const{page:Pe}=Y,ke=c.getPageSize(Pe);ve(ke)&&(c.bind(r,In.LINEAR,Pe,Zw),_e.setUniform2fv("u_mosaicSize",ke),_e.setUniform1i("u_texture",Zw))}let xe=-1;for(const Pe of i){if(!Pe.layerData.has(h))continue;Pe.key.level!==xe&&(xe=Pe.key.level,x.setDataUniforms(_e,n,v,xe,c));const ke=2**(n-xe)/l;_e.setUniform1f("u_zoomFactor",ke);const J=Pe.layerData.get(h);if(!J.lineIndexCount)continue;J.prepareForRendering(r);const de=J.lineVertexArrayObject;if(!lt(de)){if(r.bindVAO(de),_e.setUniformMatrix3fv("u_dvsMat3",Pe.transforms.dvs),r.setStencilFunction(kl.EQUAL,Pe.stencilRef,255),V||Z){const Se=J.patternMap;if(!Se)continue;for(const[Ie,Re]of Se){const Oe=c.getPageSize(Ie);ve(Oe)&&(c.bind(r,In.LINEAR,Ie,Zw),_e.setUniform2fv("u_mosaicSize",Oe),_e.setUniform1i("u_texture",Zw),r.drawElements(bs.TRIANGLES,Re[1],Bi.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*Re[0]))}}else r.drawElements(bs.TRIANGLES,J.lineIndexCount,Bi.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*J.lineIndexStart);Pe.triangleCount+=J.lineIndexCount/3}}}};const jQi=256/360,GQi=1/Math.LN2;function UQi(t,e){return(t%=e)>=0?t:t+e}function $Q(t){return UQi(t*jQi,256)}function tIt(t){return Math.log(t)*GQi}const zQi=1/65536;let HQi=class extends q_{constructor(){super(...arguments),this._iconProgramOptions={id:!1,sdf:!1},this._sdfProgramOptions={id:!1},this._spritesTextureSize=xT()}dispose(){}drawMany(e,i){const{drawPhase:r,styleLayerUID:n}=e,s=e.styleLayer;let o;r===mo.HITTEST&&(o=BJ(n+1)),this._drawIcons(e,s,i,o),this._drawText(e,s,i,o)}_drawIcons(e,i,r,n){const{context:s,displayLevel:o,drawPhase:a,painter:l,spriteMosaic:c,state:h,styleLayerUID:p,requestRender:y,allowDelayedRender:v}=e,x=i.iconMaterial,I=l.vectorTilesMaterialManager;let P,F=!1;for(const xe of r)if(xe.layerData.has(p)&&(P=xe.layerData.get(p),P.iconPerPageElementsMap.size>0)){F=!0;break}if(!F)return;const k=i.getPaintValue("icon-translate",o),j=i.getPaintValue("icon-translate-anchor",o);let V=i.getLayoutValue("icon-rotation-alignment",o);V===oc.AUTO&&(V=i.getLayoutValue("symbol-placement",o)===aO.POINT?oc.VIEWPORT:oc.MAP);const Y=V===oc.MAP,X=i.getLayoutValue("icon-keep-upright",o)&&Y,Z=P.isIconSDF,ie=a===mo.HITTEST,ce=this._iconProgramOptions;ce.id=ie,ce.sdf=Z;const he=I.getMaterialProgram(s,x,ce);if(v&&ve(y)&&!he.compiled)return void y();s.useProgram(he),he.setUniformMatrix3fv("u_displayViewMat3",V===oc.MAP?h.displayViewMat3:h.displayMat3),he.setUniformMatrix3fv("u_displayMat3",j===U_.VIEWPORT?h.displayMat3:h.displayViewMat3),he.setUniform2fv("u_iconTranslation",k),he.setUniform1f("u_depth",i.z),he.setUniform1f("u_mapRotation",$Q(h.rotation)),he.setUniform1f("u_keepUpright",X?1:0),he.setUniform1f("u_level",10*o),he.setUniform1i("u_texture",Zw),he.setUniform1f("u_fadeDuration",UG/1e3),ie&&he.setUniform4fv("u_id",n);let _e=-1;for(const xe of r){if(!xe.layerData.has(p)||(xe.key.level!==_e&&(_e=xe.key.level,x.setDataUniforms(he,o,i,_e,c)),P=xe.layerData.get(p),P.iconPerPageElementsMap.size===0))continue;P.prepareForRendering(s),P.updateOpacityInfo();const Pe=P.iconVertexArrayObject;if(!lt(Pe)){s.bindVAO(Pe),he.setUniformMatrix3fv("u_dvsMat3",xe.transforms.dvs),he.setUniform1f("u_time",(performance.now()-P.lastOpacityUpdate)/1e3);for(const[ke,J]of P.iconPerPageElementsMap)this._renderIconRange(e,he,J,ke,xe)}}}_renderIconRange(e,i,r,n,s){const{context:o,spriteMosaic:a}=e;this._spritesTextureSize[0]=a.getWidth(n)/4,this._spritesTextureSize[1]=a.getHeight(n)/4,i.setUniform2fv("u_mosaicSize",this._spritesTextureSize),a.bind(o,In.LINEAR,n,Zw),o.setStencilTestEnabled(!0),o.setStencilFunction(kl.GREATER,255,255),o.setStencilWriteMask(0),o.drawElements(bs.TRIANGLES,r[1],Bi.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*r[0]),s.triangleCount+=r[1]/3}_drawText(e,i,r,n){const{context:s,displayLevel:o,drawPhase:a,glyphMosaic:l,painter:c,pixelRatio:h,spriteMosaic:p,state:y,styleLayerUID:v,requestRender:x,allowDelayedRender:I}=e,P=i.textMaterial,F=c.vectorTilesMaterialManager;let k,j=!1;for(const Ge of r)if(Ge.layerData.has(v)&&(k=Ge.layerData.get(v),k.glyphPerPageElementsMap.size>0)){j=!0;break}if(!j)return;const V=i.getPaintProperty("text-opacity");if(V&&!V.isDataDriven&&V.getValue(o)===0)return;const Y=i.getPaintProperty("text-color"),X=!Y||Y.isDataDriven||Y.getValue(o)[3]>0,Z=i.getPaintProperty("text-halo-width"),ie=i.getPaintProperty("text-halo-color"),ce=(!Z||Z.isDataDriven||Z.getValue(o)>0)&&(!ie||ie.isDataDriven||ie.getValue(o)[3]>0);if(!X&&!ce)return;const he=24/8;let _e=i.getLayoutValue("text-rotation-alignment",o);_e===oc.AUTO&&(_e=i.getLayoutValue("symbol-placement",o)===aO.POINT?oc.VIEWPORT:oc.MAP);const xe=_e===oc.MAP,Pe=i.getLayoutValue("text-keep-upright",o)&&xe,ke=a===mo.HITTEST,J=.8*he/h;this._glyphTextureSize||(this._glyphTextureSize=mp(l.width/4,l.height/4));const de=i.getPaintValue("text-translate",o),Se=i.getPaintValue("text-translate-anchor",o),Ie=this._sdfProgramOptions;Ie.id=ke;const Re=F.getMaterialProgram(s,P,Ie);if(I&&ve(x)&&!Re.compiled)return void x();s.useProgram(Re),Re.setUniformMatrix3fv("u_displayViewMat3",_e===oc.MAP?y.displayViewMat3:y.displayMat3),Re.setUniformMatrix3fv("u_displayMat3",Se===U_.VIEWPORT?y.displayMat3:y.displayViewMat3),Re.setUniform2fv("u_textTranslation",de),Re.setUniform1f("u_depth",i.z+zQi),Re.setUniform2fv("u_mosaicSize",this._glyphTextureSize),Re.setUniform1f("u_mapRotation",$Q(y.rotation)),Re.setUniform1f("u_keepUpright",Pe?1:0),Re.setUniform1f("u_level",10*o),Re.setUniform1i("u_texture",dvt),Re.setUniform1f("u_antialiasingWidth",J),Re.setUniform1f("u_fadeDuration",UG/1e3),ke&&Re.setUniform4fv("u_id",n);let Oe=-1;for(const Ge of r){if(!Ge.layerData.has(v)||(Ge.key.level!==Oe&&(Oe=Ge.key.level,P.setDataUniforms(Re,o,i,Oe,p)),k=Ge.layerData.get(v),k.glyphPerPageElementsMap.size===0))continue;k.prepareForRendering(s),k.updateOpacityInfo();const Be=k.textVertexArrayObject;if(lt(Be))continue;s.bindVAO(Be),Re.setUniformMatrix3fv("u_dvsMat3",Ge.transforms.dvs),s.setStencilTestEnabled(!0),s.setStencilFunction(kl.GREATER,255,255),s.setStencilWriteMask(0);const qe=(performance.now()-k.lastOpacityUpdate)/1e3;Re.setUniform1f("u_time",qe),k.glyphPerPageElementsMap.forEach((et,Ze)=>{this._renderGlyphRange(s,et,Ze,l,Re,ce,X,Ge)})}}_renderGlyphRange(e,i,r,n,s,o,a,l){n.bind(e,In.LINEAR,r,dvt),o&&(s.setUniform1f("u_halo",1),e.drawElements(bs.TRIANGLES,i[1],Bi.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*i[0]),l.triangleCount+=i[1]/3),a&&(s.setUniform1f("u_halo",0),e.drawElements(bs.TRIANGLES,i[1],Bi.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*i[0]),l.triangleCount+=i[1]/3)}};const WQi=t=>iO(t.data,{geometry:[{location:0,name:"a_pos",count:2,type:Bi.SHORT},{location:1,name:"a_id",count:4,type:Bi.UNSIGNED_BYTE},{location:2,name:"a_color",count:4,type:Bi.UNSIGNED_BYTE,normalized:!0},{location:3,name:"a_haloColor",count:4,type:Bi.UNSIGNED_BYTE,normalized:!0},{location:4,name:"a_texAndSize",count:4,type:Bi.UNSIGNED_BYTE},{location:5,name:"a_refSymbolAndPlacementOffset",count:4,type:Bi.UNSIGNED_BYTE},{location:6,name:"a_glyphData",count:4,type:Bi.UNSIGNED_BYTE},{location:7,name:"a_vertexOffset",count:2,type:Bi.SHORT},{location:8,name:"a_texCoords",count:2,type:Bi.UNSIGNED_SHORT}]});let qQi=class extends kQ{dispose(){}getGeometryType(){return Ln.LABEL}supportsSymbology(e){return!0}drawGeometry(e,i,r,n){const{context:s,painter:o,state:a,rendererInfo:l,requestRender:c,allowDelayedRender:h}=e,p=AF.load(r.materialKey),y=p.mapAligned?1:0;if(!y&&Math.abs(i.key.level-Math.round(100*e.displayLevel)/100)>=1)return;const{bufferLayouts:v,attributes:x}=WQi(p),I=o.materialManager.getMaterialProgram(e,p,"materials/label",x,n);if(h&&ve(c)&&!I.compiled)return void c();e.context.setStencilFunction(kl.EQUAL,0,255),s.useProgram(I),this._setSharedUniforms(I,e,i),o.textureManager.bindTextures(s,I,p);const P=y===1?a.displayViewMat3:a.displayMat3;this._setSizeVVUniforms(p,I,l,i),I.setUniform1f("u_mapRotation",Math.floor(a.rotation/360*254)),I.setUniform1f("u_mapAligned",y),I.setUniformMatrix3fv("u_displayMat3",P),I.setUniform1f("u_opacity",1),I.setUniform2fv("u_screenSize",e.state.size);const F=r.target.getVAO(s,v,x),k=r.indexFrom*Uint32Array.BYTES_PER_ELEMENT;s.bindVAO(F),I.setUniform1f("u_isHaloPass",0),I.setUniform1f("u_isBackgroundPass",1),s.drawElements(bs.TRIANGLES,r.indexCount,Bi.UNSIGNED_INT,k),I.setUniform1f("u_isHaloPass",1),I.setUniform1f("u_isBackgroundPass",0),s.drawElements(bs.TRIANGLES,r.indexCount,Bi.UNSIGNED_INT,k),I.setUniform1f("u_isHaloPass",0),I.setUniform1f("u_isBackgroundPass",0),s.drawElements(bs.TRIANGLES,r.indexCount,Bi.UNSIGNED_INT,k),s.setStencilTestEnabled(!0),s.setBlendingEnabled(!0)}};const YQi=t=>iO(t.data,{geometry:[{location:0,name:"a_pos",count:2,type:Bi.SHORT},{location:1,name:"a_id",count:4,type:Bi.UNSIGNED_BYTE},{location:2,name:"a_color",count:4,type:Bi.UNSIGNED_BYTE,normalized:!0},{location:3,name:"a_offsetAndNormal",count:4,type:Bi.BYTE},{location:4,name:"a_accumulatedDistanceAndHalfWidth",count:2,type:Bi.UNSIGNED_SHORT},{location:5,name:"a_tlbr",count:4,type:Bi.UNSIGNED_SHORT},{location:6,name:"a_segmentDirection",count:4,type:Bi.BYTE},{location:7,name:"a_aux",count:2,type:Bi.UNSIGNED_SHORT},{location:8,name:"a_zoomRange",count:2,type:Bi.UNSIGNED_SHORT}]});let XQi=class extends kQ{dispose(){}getGeometryType(){return Ln.LINE}supportsSymbology(e){return!0}drawGeometry(e,i,r,n){const{context:s,painter:o,rendererInfo:a,displayLevel:l,passOptions:c,requestRender:h,allowDelayedRender:p}=e,y=wO.load(r.materialKey),v=ve(c)&&c.type==="hittest";let x=YQi(y),I=bs.TRIANGLES;v&&(x=this._getTriangleDesc(r.materialKey,x),I=bs.POINTS);const{attributes:P,bufferLayouts:F}=x,k=o.materialManager.getMaterialProgram(e,y,"materials/line",P,n);if(p&&ve(h)&&!k.compiled)return void h();const j=1/e.pixelRatio,V=0;s.useProgram(k),this._setSharedUniforms(k,e,i),y.textureBinding&&o.textureManager.bindTextures(s,k,y);const Y=2**(l-i.key.level);k.setUniform1f("u_zoomFactor",Y),k.setUniform1f("u_blur",V+j),k.setUniform1f("u_antialiasing",j),this._setSizeVVUniforms(y,k,a,i),this._setColorAndOpacityVVUniforms(y,k,a),s.setFaceCullingEnabled(!1);const X=r.target.getVAO(s,F,P,v);let Z=r.indexCount,ie=r.indexFrom*Uint32Array.BYTES_PER_ELEMENT;v&&(Z/=3,ie/=3),s.bindVAO(X),s.drawElements(I,Z,Bi.UNSIGNED_INT,ie)}};const KQi=t=>iO(t.data,{geometry:[{location:0,name:"a_pos",count:2,type:Bi.SHORT},{location:1,name:"a_id",count:4,type:Bi.UNSIGNED_BYTE},{location:2,name:"a_color",count:4,type:Bi.UNSIGNED_BYTE,normalized:!0},{location:3,name:"a_haloColor",count:4,type:Bi.UNSIGNED_BYTE,normalized:!0},{location:4,name:"a_texFontSize",count:4,type:Bi.UNSIGNED_BYTE},{location:5,name:"a_aux",count:4,type:Bi.BYTE},{location:6,name:"a_zoomRange",count:2,type:Bi.UNSIGNED_SHORT},{location:7,name:"a_vertexOffset",count:2,type:Bi.SHORT},{location:8,name:"a_texCoords",count:2,type:Bi.UNSIGNED_SHORT}]}),ph={marker:K5e,line:XQi,fill:qEt,text:class extends kQ{dispose(){}getGeometryType(){return Ln.TEXT}supportsSymbology(e){return!0}drawGeometry(e,i,r,n){const{context:s,painter:o,rendererInfo:a,state:l,passOptions:c,requestRender:h,allowDelayedRender:p}=e,y=TU.load(r.materialKey),v=ve(c)&&c.type==="hittest",{bufferLayouts:x,attributes:I}=KQi(y),P=o.materialManager.getMaterialProgram(e,y,"materials/text",I,n);if(p&&ve(h)&&!P.compiled)return void h();s.useProgram(P);let F=bs.TRIANGLES;v&&(F=bs.POINTS),this._setSharedUniforms(P,e,i),o.textureManager.bindTextures(s,P,y),P.setUniformMatrix3fv("u_displayMat3",l.displayMat3),P.setUniformMatrix3fv("u_displayViewMat3",l.displayViewMat3),this._setSizeVVUniforms(y,P,a,i),this._setColorAndOpacityVVUniforms(y,P,a),this._setRotationVVUniforms(y,P,a);const k=r.target.getVAO(s,x,I),j=r.indexFrom*Uint32Array.BYTES_PER_ELEMENT;P.setUniform1f("u_isHaloPass",0),P.setUniform1f("u_isBackgroundPass",1),s.bindVAO(k),s.drawElements(F,r.indexCount,Bi.UNSIGNED_INT,j),P.setUniform1f("u_isHaloPass",1),P.setUniform1f("u_isBackgroundPass",0),s.drawElements(bs.TRIANGLES,r.indexCount,Bi.UNSIGNED_INT,j),P.setUniform1f("u_isHaloPass",0),P.setUniform1f("u_isBackgroundPass",0),s.drawElements(F,r.indexCount,Bi.UNSIGNED_INT,j)}},label:qQi,clip:bQi,stencil:QEt,bitmap:aQi,overlay:xQi,tileInfo:ZEt,vtlBackground:kQi,vtlFill:BQi,vtlLine:VQi,vtlCircle:$Qi,vtlSymbol:HQi,dotDensity:PQi,heatmap:MQi,pieChart:NQi},JQi={background:{"background.frag":`#ifdef PATTERN uniform lowp float u_opacity; uniform lowp sampler2D u_texture; varying mediump vec4 v_tlbr; @@ -4827,15 +4831,15 @@ 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 YZi(t){let e=qZi;return t.split("/").forEach(i=>{e&&(e=e[i])}),e}const XZi=new S5e(YZi);function H_(t){return XZi.resolveIncludes(t)}const mEt=t=>yO({ID:t.id,PATTERN:t.pattern}),KZi={shaders:t=>({vertexShader:mEt(t)+H_("background/background.vert"),fragmentShader:mEt(t)+H_("background/background.frag")})},gEt=t=>yO({ID:t.id}),JZi={shaders:t=>({vertexShader:gEt(t)+H_("circle/circle.vert"),fragmentShader:gEt(t)+H_("circle/circle.frag")})},yEt=t=>yO({ID:t.id,PATTERN:t.pattern}),ZZi={shaders:t=>({vertexShader:yEt(t)+H_("fill/fill.vert"),fragmentShader:yEt(t)+H_("fill/fill.frag")})},vEt=t=>yO({ID:t.id}),QZi={shaders:t=>({vertexShader:vEt(t)+H_("outline/outline.vert"),fragmentShader:vEt(t)+H_("outline/outline.frag")})},_Et=t=>yO({ID:t.id,SDF:t.sdf}),eQi={shaders:t=>({vertexShader:_Et(t)+H_("icon/icon.vert"),fragmentShader:_Et(t)+H_("icon/icon.frag")})},bEt=t=>yO({ID:t.id,PATTERN:t.pattern,SDF:t.sdf}),tQi={shaders:t=>({vertexShader:bEt(t)+H_("line/line.vert"),fragmentShader:bEt(t)+H_("line/line.frag")})},wEt=t=>yO({ID:t.id}),iQi={shaders:t=>({vertexShader:wEt(t)+H_("text/text.vert"),fragmentShader:wEt(t)+H_("text/text.frag")})};let rQi=class{constructor(){this._programByKey=new Map}dispose(){this._programByKey.forEach(e=>e.dispose()),this._programByKey.clear()}getMaterialProgram(e,i,r){const n=i.key<<3|this._getMaterialOptionsValue(i.type,r);if(this._programByKey.has(n))return this._programByKey.get(n);const s=this._getProgramTemplate(i.type),{shaders:o}=s,{vertexShader:a,fragmentShader:l}=o(r),c=i.getShaderHeader(),d=i.getShaderMain(),p=a.replace("#pragma header",c).replace("#pragma main",d),y=e.programCache.acquire(p,l,i.getAttributeLocations());return this._programByKey.set(n,y),y}_getMaterialOptionsValue(e,i){switch(e){case mp.BACKGROUND:{const r=i;return(r.pattern?1:0)<<1|(r.id?1:0)}case mp.FILL:{const r=i;return(r.pattern?1:0)<<1|(r.id?1:0)}case mp.OUTLINE:return i.id?1:0;case mp.LINE:{const r=i;return(r.sdf?1:0)<<2|(r.pattern?1:0)<<1|(r.id?1:0)}case mp.ICON:{const r=i;return(r.sdf?1:0)<<1|(r.id?1:0)}case mp.CIRCLE:return i.id?1:0;case mp.TEXT:return i.id?1:0;default:return 0}}_getProgramTemplate(e){switch(e){case mp.BACKGROUND:return KZi;case mp.CIRCLE:return JZi;case mp.FILL:return ZZi;case mp.ICON:return eQi;case mp.LINE:return tQi;case mp.OUTLINE:return QZi;case mp.TEXT:return iQi;default:return null}}};const xEt={shaders:{vertexShader:wg("bitBlit/bitBlit.vert"),fragmentShader:wg("bitBlit/bitBlit.frag")},attributes:new Map([["a_pos",0],["a_tex",1]])};let SEt=class{constructor(){this._initialized=!1}dispose(){this._program=Ba(this._program),this._vertexArrayObject=Ba(this._vertexArrayObject)}render(e,i,r,n){e&&(this._initialized||this._initialize(e),e.setBlendFunctionSeparate(cn.ONE,cn.ONE_MINUS_SRC_ALPHA,cn.ONE,cn.ONE_MINUS_SRC_ALPHA),e.bindVAO(this._vertexArrayObject),e.useProgram(this._program),i.setSamplingMode(r),e.bindTexture(i,0),this._program.setUniform1i("u_tex",0),this._program.setUniform1f("u_opacity",n),e.drawArrays(ls.TRIANGLE_STRIP,0,4),e.bindTexture(null,0),e.bindVAO())}_initialize(e){if(this._initialized)return!0;const i=kE(e,xEt);if(!i)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=xEt.attributes,s=new Ac(e,n,RZi,{geometry:Ko.createVertex(e,Lo.STATIC_DRAW,r)});return this._program=i,this._vertexArrayObject=s,this._initialized=!0,!0}};const nQi=t=>{let e="";e+=t[0].toUpperCase();for(let i=1;i{const e={};for(const i in t)e[nQi(i)]=t[i];return yO(e)},O5e=(t,e,i,r)=>{const n=t+t.substring(t.lastIndexOf("/")),s=e+e.substring(e.lastIndexOf("/")),o=sQi(r);return{attributes:i,shaders:{vertexShader:o+wg(`${n}.vert`),fragmentShader:o+wg(`${s}.frag`)}}},CEt=t=>t===io.HITTEST||t===io.LABEL_ALPHA,oQi=t=>(CEt(t)?1:0)|(t===io.HIGHLIGHT?2:0),aQi=({rendererInfo:t,drawPhase:e},i,r)=>`${i.getVariationHash()}-${oQi(e)}-${t.getVariationHash()}-${ye(r)&&r.join(".")}`,lQi=(t,e,i,r={})=>{if(r={...r,...e.getVariation(),...t.rendererInfo.getVariation(),highlight:t.drawPhase===io.HIGHLIGHT,id:CEt(t.drawPhase)},ye(i))for(const n of i)r[n]=!0;return r};let uQi=class{constructor(e){this._rctx=e,this._programByKey=new Map}dispose(){this._programByKey.forEach(e=>e.dispose()),this._programByKey.clear()}getProgram(e,i=[]){const r=e.vsPath+"."+e.fsPath+JSON.stringify(i);if(this._programByKey.has(r))return this._programByKey.get(r);const n={...i.map(d=>typeof d=="string"?{name:d,value:!0}:d).reduce((d,p)=>({...d,[p.name]:p.value}),{})},{vsPath:s,fsPath:o,attributes:a}=e,l=O5e(s,o,a,n),c=this._rctx.programCache.acquire(l.shaders.vertexShader,l.shaders.fragmentShader,l.attributes);if(!c)throw new Error("Unable to get program for key: ${key}");return this._programByKey.set(r,c),c}getMaterialProgram(e,i,r,n,s){const o=aQi(e,i,s);if(this._programByKey.has(o))return this._programByKey.get(o);const a=lQi(e,i,s,{ignoresSamplerPrecision:e.context.driverTest.ignoresSamplerPrecision.result}),l=O5e(r,r,n,a),c=this._rctx.programCache.acquire(l.shaders.vertexShader,l.shaders.fragmentShader,l.attributes);if(!c)throw new Error("Unable to get program for key: ${key}");return this._programByKey.set(o,c),c}},Cme=class{constructor(e,i){this._width=0,this._height=0,this._free=[],this._width=e,this._height=i,this._free.push(new Ed(0,0,e,i))}get width(){return this._width}get height(){return this._height}allocate(e,i){if(e>this._width||i>this._height)return new Ed;let r=null,n=-1;for(let s=0;se&&this._free.push(new Ed(r.x+e,r.y,r.width-e,i)),r.height>i&&this._free.push(new Ed(r.x,r.y+i,r.width,r.height-i))):(r.width>e&&this._free.push(new Ed(r.x+e,r.y,r.width-e,r.height)),r.height>i&&this._free.push(new Ed(r.x,r.y+i,e,r.height-i))),new Ed(r.x,r.y,e,i))}release(e){for(let i=0;iMath.floor(t/256);function dQi(t){const e=new Set;for(const i of t)e.add(hQi(i));return e}function pQi(t,e,i){return t.has(e)||t.set(e,i().then(()=>{t.delete(e)}).catch(r=>{t.delete(e),wC(r)})),t.get(e)}const fQi=t=>({rect:new Ed(0,0,0,0),page:0,metrics:{left:0,width:0,height:0,advance:0,top:0},code:t,sdf:!0});let mQi=class{constructor(e,i,r){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphCache={},this._textures=[],this._rangePromises=new Map,this.width=e,this.height=i,this._glyphSource=r,this._binPack=new Cme(e-4,i-4),this._glyphData.push(new Uint8Array(e*i)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyph()}dispose(){this._binPack=null;for(const e of this._textures)e&&e.dispose();this._textures.length=0,this._glyphData.length=0}_initDecorationGlyph(){const e=[117,149,181,207,207,181,149,117],i=[];for(let n=0;nthis._getMosaicItem(n,e,s))}bind(e,i,r,n){const s=this._getTexture(e,r);s.setSamplingMode(i),this._dirties[r]&&(s.setData(this._glyphData[r]),this._dirties[r]=!1),e.bindTexture(s,n)}_getGlyphCache(e){return this._glyphCache[e]||(this._glyphCache[e]={}),this._glyphCache[e]}_getTexture(e,i){return this._textures[i]||(this._textures[i]=new bs(e,{pixelFormat:nn.ALPHA,dataType:ts.UNSIGNED_BYTE,width:this.width,height:this.height},new Uint8Array(this.width*this.height))),this._textures[i]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(e,i,r){const n=dQi(i),s=[];n.forEach(o=>{s.push(this._fetchRange(e,o,r))}),await Promise.all(s)}async _fetchRange(e,i,r){if(i>cQi)return;const n=e+i;return pQi(this._rangePromises,n,()=>this._glyphSource.getRange(e,i,r))}_getMosaicItem(e,i,r){if(!e[r]){const n=this._glyphSource.getGlyph(i,r);if(!n||!n.metrics)return fQi(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 i=e.metrics;let r;if(i.width===0)r=new Ed(0,0,0,0);else{const s=i.width+6,o=i.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._initDecorationGlyph(),this._binPack=new Cme(this.width-4,this.height-4),r=this._binPack.allocate(s,o));const a=this._glyphData[this._currentPage],l=e.bitmap;let c,d;if(l)for(let p=0;p{n.addRange(i,new gQi(new z5(new Uint8Array(l.data),new DataView(l.data))))})}getGlyph(e,i){const r=this._getFontStack(e);if(!r)return;const n=Math.floor(i/256);if(n>256)return;const s=r.getRange(n);return s?{metrics:s.getMetrics(i),bitmap:s.getBitmap(i)}:void 0}_getFontStack(e){let i=this._glyphInfo[e];return i||(i=this._glyphInfo[e]=new yQi),i}};const FQ=1e20;let _Qi=class{constructor(e){this._svg=null,this.size=e;const i=document.createElement("canvas");i.width=i.height=e,this._context=i.getContext("2d"),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,i,r=31){this._initSVG();const n=this.createSVGString(e);return new Promise((s,o)=>{const a=new Image;a.src="data:image/svg+xml; charset=utf8, "+encodeURIComponent(n),a.onload=()=>{a.onload=null,this._context.clearRect(0,0,this.size,this.size),this._context.drawImage(a,0,0,this.size,this.size);const c=this._context.getImageData(0,0,this.size,this.size),d=new Uint8Array(this.size*this.size*4);for(let p=0;po(vc()))})}_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){const i=this._initSVG(),r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttribute("d",e),i.appendChild(r);const n=r.getBBox(),s=n.width/n.height,o=this.size/2;let a,l,c,d;if(s>1){l=a=o/n.width;const S=o*(1/s);c=this.size/4,d=o-S/2}else a=l=o/n.height,c=o-o*s/2,d=this.size/4;const p=-n.x*a+c,y=-n.y*l+d;r.setAttribute("style",`transform: matrix(${a}, 0, 0, ${l}, ${p}, ${y})`);const v=`${i.innerHTML}`;return i.removeChild(r),v}_edt(e,i,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 Cme(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 i=this._mosaicPages[e.page],r=i.mosaicsData;if(!wj(i.mosaicsData))throw new st("mapview-invalid-resource","unsuitable data type!");const n=e.spriteData,s=r.data;s&&n||console.error("Source or target images are uninitialized!"),C5t._copyBits(n,e.spriteSize[0],0,0,s,e.pageSize[0],e.rect.x+Ec,e.rect.y+Ec,e.spriteSize[0],e.spriteSize[1],e.repeat),i.dirty=!0}_allocateImage(e,i){e+=2*Ec,i+=2*Ec;const r=Math.max(e,i);if(this._maxItemSize&&this._maxItemSizee+i,0)}function xQi(t){const{width:e,height:i}=t;return{frameDurations:t.frameDurations.reverse(),getFrame:r=>{const n=t.frameDurations.length-1-r;return t.getFrame(n)},width:e,height:i}}function SQi(t,e){const{width:i,height:r,getFrame:n}=t,s=e/TEt(t);return{frameDurations:t.frameDurations.map(o=>o*s),getFrame:n,width:i,height:r}}function CQi(t,e){const{width:i,height:r,getFrame:n}=t,s=t.frameDurations.slice(),o=s.shift();return s.unshift(o+e),{frameDurations:s,getFrame:n,width:i,height:r}}function EEt(t,e){const{width:i,height:r,getFrame:n}=t,s=t.frameDurations.slice(),o=s.pop();return s.push(o+e),{frameDurations:s,getFrame:n,width:i,height:r}}let TQi=class{constructor(e,i,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(;i>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 hS.None:this._currentFrame-=this._direction;break;case hS.Loop:this._currentFrame=0;break;case hS.Oscillate:this._currentFrame-=this._direction,this._direction=-1}}else if(this._currentFrame===-1)switch(this._repeatType){case hS.None:this._currentFrame-=this._direction;break;case hS.Loop:this._currentFrame=this._animation.frameDurations.length-1;break;case hS.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 EQi(t,e,i,r){let n,{repeatType:s}=e;if(s==null&&(s=hS.Loop),e.reverseAnimation===!0&&(t=xQi(t)),e.duration!=null&&(t=SQi(t,1e3*e.duration)),e.repeatDelay!=null){const o=1e3*e.repeatDelay;s===hS.Loop?t=EEt(t,o):s===hS.Oscillate&&(t=CQi(EEt(t,o/2),o/2))}if(e.startTimeOffset!=null)n=1e3*e.startTimeOffset;else if(e.randomizeStartTime!=null){const o=jSt(i),a=82749913,l=e.randomizeStartSeed!=null?e.randomizeStartSeed:a,c=USt(o,l);n=c*TEt(t)}else n=0;return new TQi(t,n,s,r)}function IQi(t,e,i,r){const n=e.playAnimation==null||e.playAnimation,s=EQi(t,e,i,r);let o,a=s.timeToFrame;function l(){o=n?setTimeout(()=>{s.nextFrame(),a=s.timeToFrame,l()},a):void 0}return l(),{remove:()=>{n&&clearTimeout(o)}}}const R5e=document.createElement("canvas"),Tme=R5e.getContext("2d");function AQi(t,e,i){R5e.width=e,R5e.height=i;const r=[],n=t.frameDurations.length;for(let s=0;sr[s]}}let PQi=class{constructor(e,i,r,n){this._animation=e,this._frameData=null;const s=o=>{this._frameData=o,i.requestRender()};this.frameCount=this._animation.frameDurations.length,this.width=this._animation.width,this.height=this._animation.height,this._playHandle=IQi(this._animation,r,n,s)}destroy(){this._playHandle.remove()}bindFrame(e,i,r){e.bindTexture(i,r),lt(this._frameData)||(i.updateData(0,Ec,Ec,this._frameData.width,this._frameData.height,this._frameData),this._frameData=null)}};function W_(t,e){if(t&&"name"in t){const i=t;return e&&e.error(new st(i.name,i.message,i.details)),!1}return!0}function OQi(t){switch(t.type){case"esriSMS":return`${t.style}.${t.path}`;case"esriSLS":return`${t.style}.${t.cap}`;case"esriSFS":return`${t.style}`;case"esriPFS":case"esriPMS":return t.imageData?`${t.imageData}${t.width}${t.height}`:`${t.url}${t.width}${t.height}`;default:return"mosaicHash"in t?t.mosaicHash:JSON.stringify(t)}}const IEt=CT(),AEt="arial-unicode-ms-regular",M5e=126,PEt=Ei.getLogger("esri.views.2d.engine.webgl.TextureManager");function OEt(t,e){const i=Math.round(on(e)*window.devicePixelRatio),r=i>=128?2:4;return Math.min(t,i*r)}const D5e=(t,e,i)=>PEt.error(new st(t,e,i));let RQi=class T5t{static fromMosaic(e,i){return new T5t(e,i.page,i.sdf)}constructor(e,i,r){this.mosaicType=e,this.page=i,this.sdf=r}},MQi=class{constructor(e,i,r){this._requestRender=e,this.resourceManager=i,this._allowNonPowerOfTwo=r,this._invalidFontsMap=new Map,this._sdfConverter=new _Qi(M5e),this._bindingInfos=new Array,this._hashToBindingIndex=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new _k({concurrency:10,process:async(n,s)=>{sn(s);try{return await ir(n,{responseType:"image",signal:s})}catch(o){throw ss(o)?o:new st("mapview-invalid-resource",`Could not fetch requested resource at ${n}`,o)}}}),this._spriteMosaic=new bQi(2048,2048,500),this._glyphSource=new vQi(`${na.fontsUrl}/{fontstack}/{range}.pbf`),this._glyphMosaic=new mQi(1024,1024,this._glyphSource),this._rasterizer=new $Xi(i)}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}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}async rasterizeItem(e,i,r,n){if(lt(e))return D5e("mapview-null-resource","Unable to rasterize null resource"),null;switch(e.type){case"text":case"esriTS":{const s=await this._rasterizeText(e,r,n);return s.forEach(o=>this._setTextureBinding(pU.GLYPH,o)),{glyphMosaicItems:s}}default:{if(H5i(e))return D5e("mapview-invalid-type",`MapView does not support symbol type: ${e.type}`,e),null;const s=await this._rasterizeSpriteSymbol(e,i,n);return W_(s)&&s&&this._setTextureBinding(pU.SPRITE,s),{spriteMosaicItem:s}}}}bindTextures(e,i,r,n=!1){if(r.textureBinding===0)return;const s=this._bindingInfos[r.textureBinding-1],o=s.page,a=n?mn.LINEAR_MIPMAP_LINEAR:mn.LINEAR;switch(s.mosaicType){case pU.SPRITE:{const l=this.sprites.getWidth(o),c=this.sprites.getHeight(o),d=aa(IEt,l,c);return this._spriteMosaic.bind(e,a,o,_0t),i.setUniform1i("u_texture",_0t),void i.setUniform2fv("u_mosaicSize",d)}case pU.GLYPH:{const l=this.glyphs.width,c=this.glyphs.height,d=aa(IEt,l,c);return this._glyphMosaic.bind(e,a,o,b0t),i.setUniform1i("u_texture",b0t),void i.setUniform2fv("u_mosaicSize",d)}default:PEt.error("mapview-texture-manager",`Cannot handle unknown type ${s.mosaicType}`)}}_hashMosaic(e,i){return 1|e<<1|(i.sdf?1:0)<<2|i.page<<3}_setTextureBinding(e,i){const r=this._hashMosaic(e,i);if(!this._hashToBindingIndex.has(r)){const n=RQi.fromMosaic(e,i),s=this._bindingInfos.length+1;this._hashToBindingIndex.set(r,s),this._bindingInfos.push(n)}i.textureBinding=this._hashToBindingIndex.get(r)}async _rasterizeText(e,i,r){let n,s;if("cim"in e){const l=e;n=l.fontName,s=l.text}else{const l=e;n=kWi(l.font),s=l.text}const o=this._invalidFontsMap.has(n),a=i||Y5i(gF(s)[0]);try{return await this._glyphMosaic.getGlyphItems(o?AEt:n,a,r)}catch{return D5e("mapview-invalid-resource",`Couldn't find font ${n}. Falling back to Arial Unicode MS Regular`),this._invalidFontsMap.set(n,!0),this._glyphMosaic.getGlyphItems(AEt,a,r)}}async _rasterizeSpriteSymbol(e,i,r){if(W5i(e))return;const n=OQi(e);if(this._spriteMosaic.has(n))return this._spriteMosaic.getSpriteItem(n);if(gvt(e)||U5i(e)&&!wvt(e))return this._handleAsyncResource(n,e,r);const s=o5i,o=this._rasterizer.rasterizeJSONResource(e,s);if(o){const{size:a,image:l,sdf:c,simplePattern:d,rasterizationScale:p}=o;return this._addItemToMosaic(n,a,{type:"static",data:l},Ipe(e),c,d,p)}return new st("TextureManager","unrecognized or null rasterized image")}async _handleAsyncResource(e,i,r){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let n;n=gvt(i)?this._handleSVG(i,e,r):this._handleImage(i,e,r),this._ongoingRasterizations.set(e,n);try{await n,this._ongoingRasterizations.delete(e)}catch{this._ongoingRasterizations.delete(e)}return n}async _handleSVG(e,i,r){const n=[M5e,M5e],s=await this._sdfConverter.draw(e.path,r);return this._addItemToMosaic(i,n,{type:"static",data:new Uint32Array(s.buffer)},!1,!0,!0)}async _handleGIFOrPNG(e,i,r){const n=yvt(e);await this.resourceManager.fetchResource(n,r);let s=this.resourceManager.getResource(n);if(lt(s))return new st("mapview-invalid-resource",`Could not fetch requested resource at ${n}.`);let o=s.width,a=s.height;if(s instanceof HTMLImageElement){e.type==="esriPMS"&&(o=Math.round(OEt(s.width,bvt(e))),a=Math.round(s.height*(o/s.width)));const p="cim"in e?e.cim.colorSubstitutions:void 0,{size:y,sdf:v,image:S}=this._rasterizer.rasterizeImageResource(o,a,s,p);return this._addItemToMosaic(i,y,{type:"static",data:S},Ipe(e),v,!1)}this._allowNonPowerOfTwo||(o=X8(s.width+2*Ec)-2*Ec,a=X8(s.height+2*Ec)-2*Ec),o===s.width&&a===s.height||(s=AQi(s,o,a));const l=e.animatedSymbolProperties||{},c=e.objectId,d=new PQi(s,this._requestRender,l,c);return this._addItemToMosaic(i,[d.width,d.height],{type:"animated",data:d},Ipe(e),!1,!1)}async _handleImage(e,i,r){if(j5i(e)||z5i(e))return this._handleGIFOrPNG(e,i,r);const n=yvt(e);try{let s;const o=this.resourceManager.getResource(n);if(ye(o)&&o instanceof HTMLImageElement)s=o;else{const{data:v}=await this._imageRequestQueue.push(n,{...r});s=v}if(q5i(n)){if("width"in e&&"height"in e)s.width=on(e.width),s.height=on(e.height);else if("cim"in e){const v=e.cim;s.width=on(v.width??v.scaleX*v.size),s.height=on(v.size)}}if(!s.width||!s.height)return null;let a=s.width,l=s.height;e.type==="esriPMS"&&(a=Math.round(OEt(s.width,bvt(e))),l=Math.round(s.height*(a/s.width)));const c="cim"in e?e.cim.colorSubstitutions:void 0,{size:d,sdf:p,image:y}=this._rasterizer.rasterizeImageResource(a,l,s,c);return this._addItemToMosaic(i,d,{type:"static",data:y},Ipe(e),p,!1)}catch(s){if(!ss(s))return new st("mapview-invalid-resource",`Could not fetch requested resource at ${n}. ${s.message}`)}}_addItemToMosaic(e,i,r,n,s,o,a){return this._spriteMosaic.addSpriteItem(e,i,r,n,s,o,a)}},DQi=class{constructor(e,i){this._queue=[],this._context=e,this._refreshable=i}destroy(){this._queue=[]}enqueueTextureUpdate(e,i){const r=Mf(),n=e,s=n5i,o=Math.ceil(n.height/s);if(sn(i),this._context.type===lo.WEBGL1)this._queue.push({type:"no-chunk",request:e,resolver:r,options:i});else for(let a=0;ar.reject(a)),r.promise}upload(){let e=0;for(;this._queue.length;){const i=performance.now(),r=this._queue.shift();if(r){if(ye(r.options.signal)&&r.options.signal.aborted)continue;switch(r.type){case"chunk":this._uploadChunk(r);break;case"no-chunk":this._uploadNoChunk(r)}const n=performance.now()-i;if(e+=n,e+n>=s5i)break}}this._queue.length&&this._refreshable.requestRender()}_uploadChunk(e){const{request:i,resolver:r,chunkOffset:n,chunkIsLast:s,destHeight:o}=e,{data:a,texture:l,width:c}=i;ye(a)&&(l.updateData(0,0,n,c,o,a,n),s&&r.resolve())}_uploadNoChunk(e){const{request:i,resolver:r}=e,{data:n,texture:s}=i;s.setData(n),r.resolve()}};const FQi={shaders:{vertexShader:wg("stencil/stencil.vert"),fragmentShader:wg("stencil/stencil.frag")},attributes:new Map([["a_pos",0]])},LQi=xT(-.5,-.5);let kQi=class{constructor(){this._centerNdc=Qr(),this._pxToNdc=Qr(),this._worldDimensionsPx=Qr(),this._mat3=Cl(),this._initialized=!1}dispose(){this._program=Ba(this._program),this._quad=Ba(this._quad)}render(e,i){const{context:r}=e;return!!this._updateGeometry(e,i)&&(this._initialized||this._initialize(r),r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setColorMask(!1,!1,!1,!1),r.setBlendingEnabled(!1),r.setStencilOp(Yl.KEEP,Yl.KEEP,Yl.REPLACE),r.setStencilFunction(El.ALWAYS,1,255),r.setStencilTestEnabled(!0),r.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.draw(),this._quad.unbind(),!0)}_initialize(e){if(this._initialized)return;const i=kE(e,FQi);i&&(this._program=i,this._quad=new ux(e,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(e,i){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 c=IL(o),d=Math.abs(Math.cos(c)),p=Math.abs(Math.sin(c)),y=Math.round(a*d+l*p),v=Math.round(r.worldScreenWidth);if(y<=v)return!1;const S=a*p+l*d,I=v*n,O=(i.left-i.right)*n/a,L=(i.bottom-i.top)*n/l;xl(this._worldDimensionsPx,I,S,1),xl(this._pxToNdc,2/a,-2/l,1),xl(this._centerNdc,O,L,1);const N=this._mat3;return UIe(N,this._centerNdc),nP(N,N,this._pxToNdc),o!==0&&ST(N,N,c),nP(N,N,this._worldDimensionsPx),ug(N,N,LQi),!0}},NQi=class extends bj{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,i){if(!i?.size)return;const{context:r,renderingOptions:n}=e;this._quad||(this._quad=new ux(r,[0,0,1,0,0,1,1,1]));const s=r.getBoundFramebufferObject(),{x:o,y:a,width:l,height:c}=r.getViewport();i.bindTextures(r);const d=i.getBlock(HDe);if(lt(d))return;const p=d.getFBO(r),y=d.getFBO(r,1);r.setViewport(0,0,i.size,i.size),this._computeDelta(e,y,n.labelsAnimationTime),this._updateAnimationState(e,y,p),r.bindFramebuffer(s),r.setViewport(o,a,l,c)}_computeDelta(e,i,r){const{context:n,painter:s,displayLevel:o}=e,a=s.materialManager.getProgram(this._desc,["delta"]);n.bindFramebuffer(i),n.setClearColor(0,0,0,0),n.clear(n.gl.COLOR_BUFFER_BIT),n.useProgram(a),a.setUniform1i("u_maskTexture",gpe),a.setUniform1i("u_sourceTexture",ype),a.setUniform1f("u_timeDelta",e.deltaTime),a.setUniform1f("u_animationTime",r),a.setUniform1f("u_zoomLevel",Math.round(10*o)),this._quad.draw()}_updateAnimationState(e,i,r){const{context:n,painter:s}=e,o=s.materialManager.getProgram(this._desc,["update"]);n.bindTexture(i.colorTexture,1),n.useProgram(o),o.setUniform1i("u_sourceTexture",1),n.bindFramebuffer(r),n.setClearColor(0,0,0,0),n.clear(n.gl.COLOR_BUFFER_BIT),this._quad.draw()}};const $Qi=t=>t.replace("-","_").toUpperCase(),REt=t=>`#define ${$Qi(t)} -`;function MEt(t){return{attributes:new Map([["a_pos",0],["a_tex",1]]),shaders:{vertexShader:REt(t)+wg("blend/blend.vert"),fragmentShader:REt(t)+wg("blend/blend.frag")}}}const DEt=Ei.getLogger("esri.views.2d.engine.webgl.effects.blendEffects.BlendEffect");let BQi=class{constructor(){this._size=[0,0]}dispose(e){this._backBufferTexture=Ba(this._backBufferTexture),this._quad=Ba(this._quad)}draw(e,i,r,n,s){const{context:o,drawPhase:a}=e;if(this._setupShader(o),n&&n!=="normal"&&a!==io.LABEL)return void this._drawBlended(e,i,r,n,s);const l=MEt("normal"),c=o.programCache.acquire(l.shaders.vertexShader,l.shaders.fragmentShader,l.attributes);if(!c)return void DEt.error(new st("mapview-BlendEffect",'Error creating shader program for blend mode "normal"'));o.useProgram(c),i.setSamplingMode(r),o.bindTexture(i,0),c.setUniform1i("u_layerTexture",0),c.setUniform1f("u_opacity",s),o.setBlendingEnabled(!0),o.setBlendFunction(cn.ONE,cn.ONE_MINUS_SRC_ALPHA);const d=this._quad;d.draw(),d.unbind(),c.dispose()}_drawBlended(e,i,r,n,s){const{context:o,state:a,pixelRatio:l,inFadeTransition:c}=e,{size:d}=a,p=o.getBoundFramebufferObject();let y,v;if(ye(p)){const N=p.descriptor;y=N.width,v=N.height}else y=Math.round(l*d[0]),v=Math.round(l*d[1]);this._createOrResizeTexture(e,y,v);const S=this._backBufferTexture;p.copyToTexture(0,0,y,v,0,0,S),o.setStencilTestEnabled(!1),o.setStencilWriteMask(0),o.setBlendingEnabled(!0),o.setDepthTestEnabled(!1),o.setDepthWriteEnabled(!1);const I=MEt(n),O=o.programCache.acquire(I.shaders.vertexShader,I.shaders.fragmentShader,I.attributes);if(!O)return void DEt.error(new st("mapview-BlendEffect",`Error creating shader program for blend mode ${n}`));o.useProgram(O),S.setSamplingMode(r),o.bindTexture(S,0),O.setUniform1i("u_backbufferTexture",0),i.setSamplingMode(r),o.bindTexture(i,1),O.setUniform1i("u_layerTexture",1),O.setUniform1f("u_opacity",s),O.setUniform1f("u_inFadeOpacity",c?1:0),o.setBlendFunction(cn.ONE,cn.ZERO);const L=this._quad;L.draw(),L.unbind(),O.dispose(),o.setBlendFunction(cn.ONE,cn.ONE_MINUS_SRC_ALPHA)}_setupShader(e){this._quad||(this._quad=new ux(e,[-1,-1,1,-1,-1,1,1,1]))}_createOrResizeTexture(e,i,r){const{context:n}=e;this._backBufferTexture!==null&&i===this._size[0]&&r===this._size[1]||(this._backBufferTexture?this._backBufferTexture.resize(i,r):this._backBufferTexture=new bs(n,{target:Ws.TEXTURE_2D,pixelFormat:nn.RGBA,internalFormat:nn.RGBA,dataType:ts.UNSIGNED_BYTE,wrapMode:us.CLAMP_TO_EDGE,samplingMode:mn.LINEAR,flipped:!1,width:i,height:r}),this._size[0]=i,this._size[1]=r)}},FEt=class extends bj{constructor(e){super(),this.name=this.constructor.name,this.defines=[e]}dispose(){}bind({context:e,painter:i}){this._prev=e.getBoundFramebufferObject();const{width:r,height:n}=e.getViewport(),s=i.getFbos(r,n).effect0;e.bindFramebuffer(s),e.setColorMask(!0,!0,!0,!0),e.setClearColor(0,0,0,0),e.clear(e.gl.COLOR_BUFFER_BIT)}unbind(){}draw(e,i){const{context:r,painter:n}=e,s=n.getPostProcessingEffects(i),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,mn.NEAREST),r.setStencilTestEnabled(!0)}};const GQi={shaders:{vertexShader:wg("highlight/textured.vert"),fragmentShader:wg("highlight/highlight.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},VQi={shaders:{vertexShader:wg("highlight/textured.vert"),fragmentShader:wg("highlight/blur.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])};let UQi=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,i){e.bindTexture(i,AJ),e.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[1,0,1/this._width,0]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",XJi),e.bindVAO(this._resources.quadVAO),e.drawArrays(ls.TRIANGLE_STRIP,0,4),e.bindVAO()}finalBlur(e,i){e.bindTexture(i,AJ),e.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[0,1,0,1/this._height]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",KJi),e.bindVAO(this._resources.quadVAO),e.drawArrays(ls.TRIANGLE_STRIP,0,4),e.bindVAO()}renderHighlight(e,i,r){e.bindTexture(i,AJ),e.useProgram(this._resources.highlightProgram),r.applyHighlightOptions(e,this._resources.highlightProgram),e.bindVAO(this._resources.quadVAO),e.setBlendingEnabled(!0),e.setBlendFunction(cn.ONE,cn.ONE_MINUS_SRC_ALPHA),e.drawArrays(ls.TRIANGLE_STRIP,0,4),e.bindVAO()}_initialize(e,i,r){this._width=i,this._height=r;const n=Ko.createVertex(e,Lo.STATIC_DRAW,new Int8Array([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]).buffer),s=new Ac(e,new Map([["a_position",0],["a_texcoord",1]]),{geometry:[new qo("a_position",2,Di.BYTE,0,4),new qo("a_texcoord",2,Di.UNSIGNED_BYTE,2,4)]},{geometry:n}),o=kE(e,GQi),a=kE(e,VQi);e.useProgram(o),o.setUniform1i("u_texture",AJ),o.setUniform1i("u_shade",x0t),o.setUniform1f("u_sigma",C5e),e.useProgram(a),a.setUniform1i("u_texture",AJ),a.setUniform1f("u_sigma",C5e),this._resources={quadGeometry:n,quadVAO:s,highlightProgram:o,blurProgram:a}}setup(e,i,r){this._resources?(this._width=i,this._height=r):this._initialize(e,i,r)}};function LEt(t,e,i){const r=new bs(t,{target:Ws.TEXTURE_2D,pixelFormat:nn.RGBA,dataType:ts.UNSIGNED_BYTE,wrapMode:us.CLAMP_TO_EDGE,width:e,height:i,samplingMode:mn.LINEAR});return[r,new id(t,{colorTarget:Th.TEXTURE,depthStencilTarget:gl.STENCIL_RENDER_BUFFER},r)]}let jQi=class{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.sharedBlur1Tex.dispose(),this._resources.sharedBlur1Fbo.dispose(),this._resources.sharedBlur2Tex.dispose(),this._resources.sharedBlur2Fbo.dispose(),this._resources=vH(this._resources))}_initialize(e,i,r){this._width=i,this._height=r;const[n,s]=LEt(e,i,r),[o,a]=LEt(e,i,r);this._resources={sharedBlur1Tex:n,sharedBlur1Fbo:s,sharedBlur2Tex:o,sharedBlur2Fbo:a}}setup(e,i,r){!this._resources||this._width===i&&this._height===r||this.dispose(),this._resources||this._initialize(e,i,r)}get sharedBlur1Tex(){return this._resources.sharedBlur1Tex}get sharedBlur1Fbo(){return this._resources.sharedBlur1Fbo}get sharedBlur2Tex(){return this._resources.sharedBlur2Tex}get sharedBlur2Fbo(){return this._resources.sharedBlur2Fbo}};const A6=4,Eme=4/A6;let zQi=class extends bj{constructor(){super(...arguments),this.defines=["highlight"],this._hlRenderer=new UQi,this._width=void 0,this._height=void 0,this._boundFBO=null,this._hlSurfaces=new jQi,this._adjustedWidth=void 0,this._adjustedHeight=void 0,this._blitRenderer=new SEt}dispose(){this._hlSurfaces?.dispose(),this._hlRenderer?.dispose(),this._boundFBO=null}bind(e){const{context:i,painter:r}=e,{width:n,height:s}=i.getViewport(),o=r.getFbos(n,s).effect0;this.setup(e,n,s),i.bindFramebuffer(o),i.setColorMask(!0,!0,!0,!0),i.setClearColor(0,0,0,0),i.clear(i.gl.COLOR_BUFFER_BIT)}unbind(){}setup({context:e},i,r){this._width=i,this._height=r;const n=i%A6,s=r%A6;i+=nd.resolve([]));const o=s.getFBO(r),a=new Uint8Array(o.width*o.height*4);try{await o.readPixelsAsync(0,0,o.width,o.height,nn.RGBA,ts.UNSIGNED_BYTE,a)}catch{return void i.forEach(p=>p.resolve([]))}const l=[];for(let d=0;dp.directHits===d.directHits?p.id-d.id:p.directHits-d.directHits);const c=l.map(d=>d.id);i.forEach(d=>d.resolve(c))}},WQi=class extends bj{constructor(){super(...arguments),this.name=this.constructor.name,this.defines=["id"],this._lastSize=0,this._boundFBO=null}dispose(){ye(this._fbo)&&this._fbo.dispose()}bind({context:e,painter:i}){const{width:r,height:n}=e.getViewport();this._boundFBO=e.getBoundFramebufferObject();const s=i.getFbos(r,n).effect0;e.bindFramebuffer(s),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,i,r=2*T0t){this._resolve(e,i,r)}async _resolve({context:e,state:i,pixelRatio:r},n,s){const o=e.getBoundFramebufferObject(),a=i.size[1]*r,l=Math.round(s*r),c=l/2,d=l/2;this._ensureBuffer(l),n.forEach(async(p,y)=>{const v=new Map,S=Math.floor(y.x*r-l/2),I=Math.floor(a-y.y*r-l/2);await o.readPixelsAsync(S,I,l,l,nn.RGBA,ts.UNSIGNED_BYTE,this._buf);for(let L=0;LL[1]-N[1]).map(L=>L[0]);p.resolve(O),n.delete(y)})}_ensureBuffer(e){this._lastSize!==e&&(this._lastSize=e,this._buf=new Uint8Array(4*e*e),this._buf32=new Uint32Array(this._buf.buffer))}};const F5e=5,qQi=[1,0],YQi=[0,1],XQi=[1,.8,.6,.4,.2],KQi=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];let JQi=class{constructor(){this._intensityFBO=null,this._compositeFBO=null,this._mipsFBOs=new Array(F5e),this._nMips=F5e,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 ter,blur:()=>new eer,bloom:()=>new JQi,opacity:()=>new ser,"drop-shadow":()=>new ner};let ler=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 i=[];for(const r of e){const n=oer(r.type);let s=this._effectMap.get(n);s||(s=aer[n](),this._effectMap.set(n,s)),i.push({postProcessingEffect:s,effect:r})}return i}},uer=class{constructor(e,i){this.brushes=e,this.name=i.name,this.drawPhase=i.drawPhase||io.MAP,this._targetFn=i.target,this.effects=i.effects||[],this.enableDefaultDraw=i.enableDefaultDraw??(()=>!0)}render(e){const{context:i,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&&o.args(),c=i.getViewport(),d=i.getBoundFramebufferObject(),p=e.passOptions;this._bindEffect(e,a,l),this._doRender(e,n,a.defines),this._drawAndUnbindEffect(e,a,c,d,p,l)}}}_doRender(e,i,r){if(lt(i))return;const{profiler:n,context:s}=e;for(const o of this.brushes){if(n.recordBrushStart(o.name),ye(o.brushEffect)){const a=s.getViewport(),l=s.getBoundFramebufferObject(),c=e.passOptions;this._bindEffect(e,o.brushEffect),this._drawWithBrush(o,e,i,r),this._drawAndUnbindEffect(e,o.brushEffect,a,l,c)}else this._drawWithBrush(o,e,i,r);n.recordBrushEnd()}}_drawWithBrush(e,i,r,n){eGe(r)?(e.prepareState(i,n),e.drawMany(i,r,n)):r.visible&&(e.prepareState(i,n),e.draw(i,r,n))}_bindEffect(e,i,r){const{profiler:n}=e;n.recordPassStart(this.name+"."+i.name),i.bind(e,r);const s=i.createOptions(e,r);e.passOptions=s}_drawAndUnbindEffect(e,i,r,n,s,o){const{profiler:a,context:l}=e;e.passOptions=s,a.recordBrushStart(i.name),i.draw(e,o),i.unbind(e,o),l.bindFramebuffer(n);const{x:c,y:d,width:p,height:y}=r;l.setViewport(c,d,p,y),a.recordBrushEnd(),a.recordPassEnd()}};function cer(t,e){switch(t){case wn.LINE:return lh.line;case wn.TEXT:return lh.text;case wn.LABEL:return lh.label;case wn.FILL:return e===Yo.DOT_DENSITY?lh.dotDensity:lh.fill;case wn.MARKER:switch(e){case Yo.HEATMAP:return lh.heatmap;case Yo.PIE_CHART:return lh.pieChart;default:return lh.marker}}}let her=class{constructor(e,i,r){this.context=e,this._blitRenderer=new SEt,this._worldExtentClipRenderer=new kQi,this._isClippedToWorldExtent=!1,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._prevFBO=null,this._vtlMaterialManager=new rQi,this._blendEffect=new BQi,this._stencilBuf=null,this._fbos=null,this._fboPool=[],this._renderTarget=null,this.effects={highlight:new zQi,hittest:new HQi,hittestVTL:new WQi,integrate:new NQi,insideEffect:new FEt("inside"),outsideEffect:new FEt("outside")},this.materialManager=new uQi(e),this.textureManager=new MQi(i,r,e.type===lo.WEBGL2),this.textureUploadManager=new DQi(e,i),this._effectsManager=new ler}get vectorTilesMaterialManager(){return this._vtlMaterialManager}getRenderTarget(){return this._renderTarget}setRenderTarget(e){this._renderTarget=e}getFbos(e,i){if(e!==this._lastWidth||i!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=i,this._fbos){for(const o in this._fbos)this._fbos[o].resize(e,i);return this._fbos}const r={target:Ws.TEXTURE_2D,pixelFormat:nn.RGBA,dataType:ts.UNSIGNED_BYTE,samplingMode:mn.NEAREST,wrapMode:us.CLAMP_TO_EDGE,width:e,height:i},n={colorTarget:Th.TEXTURE,depthStencilTarget:gl.DEPTH_STENCIL_RENDER_BUFFER},s=new mO(this.context,{width:e,height:i,internalFormat:gg.DEPTH_STENCIL});this._stencilBuf=s,this._fbos={output:new id(this.context,n,r,s),blend:new id(this.context,n,r,s),effect0:new id(this.context,n,r,s)}}return this._fbos}acquireFbo(e,i){let r;r=this._fboPool.length>0?this._fboPool.pop():new id(this.context,{colorTarget:Th.TEXTURE,depthStencilTarget:gl.DEPTH_STENCIL_RENDER_BUFFER},{target:Ws.TEXTURE_2D,pixelFormat:nn.RGBA,dataType:ts.UNSIGNED_BYTE,samplingMode:mn.NEAREST,wrapMode:us.CLAMP_TO_EDGE,width:e,height:i},this._stencilBuf);const n=r.descriptor;return n.width===e&&n.height===i||r.resize(e,i),r}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderLayers(e,i=null){const{width:r,height:n}=e.getViewport();this._prevFBO=e.getBoundFramebufferObject();const s=this.getFbos(r,n);if(e.bindFramebuffer(s?.output),e.setColorMask(!0,!0,!0,!0),ye(i)){const{r:o,g:a,b:l,a:c}=i.color;e.setClearColor(c*o/255,c*a/255,c*l/255,c)}else e.setClearColor(0,0,0,0);e.setDepthWriteEnabled(!0),e.setClearDepth(1),e.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT),e.setDepthWriteEnabled(!1)}beforeRenderLayer(e,i,r){const{context:n,blendMode:s,effects:o,requireFBO:a,drawPhase:l}=e;if(a||kEt(l,s,o,r))n.bindFramebuffer(this._fbos?.blend),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);else{const c=this._getOutputFBO();n.bindFramebuffer(c)}n.setDepthWriteEnabled(!1),n.setDepthTestEnabled(!1),n.setStencilTestEnabled(!0),n.setClearStencil(i),n.setStencilWriteMask(255),n.clear(n.gl.STENCIL_BUFFER_BIT)}compositeLayer(e,i){const{context:r,blendMode:n,effects:s,requireFBO:o,drawPhase:a}=e;if(o||kEt(a,n,s,i)){ye(s)&&s.length>0&&a===io.MAP&&this._applyEffects(e,s);const l=this._getOutputFBO();r.bindFramebuffer(l),r.setStencilTestEnabled(!1),r.setStencilWriteMask(0),r.setBlendingEnabled(!0),r.setBlendFunctionSeparate(cn.ONE,cn.ONE_MINUS_SRC_ALPHA,cn.ONE,cn.ONE_MINUS_SRC_ALPHA),r.setColorMask(!0,!0,!0,!0);const c=lt(n)||a===io.HIGHLIGHT?"normal":n,d=this._fbos;d?.blend.colorTexture&&this._blendEffect.draw(e,d.blend.colorTexture,mn.NEAREST,c,i)}}renderLayers(e){e.bindFramebuffer(this._prevFBO);const i=this._getOutputFBO();i&&(e.setDepthTestEnabled(!1),e.setStencilWriteMask(0),this._isClippedToWorldExtent?(e.setStencilTestEnabled(!0),e.setStencilFunction(El.EQUAL,1,255)):e.setStencilTestEnabled(!1),this.blitTexture(e,i.colorTexture,mn.NEAREST))}prepareDisplay(e,i,r){const{context:n}=e;if(n.bindFramebuffer(this._prevFBO),n.setColorMask(!0,!0,!0,!0),ye(i)){const{r:s,g:o,b:a,a:l}=i.color;n.setClearColor(l*s/255,l*o/255,l*a/255,l)}else n.setClearColor(0,0,0,0);n.setStencilWriteMask(255),n.setClearStencil(0),n.clear(n.gl.COLOR_BUFFER_BIT|n.gl.STENCIL_BUFFER_BIT),this._isClippedToWorldExtent=this._worldExtentClipRenderer.render(e,r)}dispose(){if(this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=Ba(this._blitRenderer),this._worldExtentClipRenderer=Ba(this._worldExtentClipRenderer),this._brushCache&&(this._brushCache.forEach(e=>e.dispose()),this._brushCache.clear(),this._brushCache=null),this._fbos)for(const 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)for(const e in this.effects)this.effects[e]&&this.effects[e].dispose();this._effectsManager.dispose(),this._vtlMaterialManager=Ba(this._vtlMaterialManager),this._prevFBO=null}getBrush(e,i){const r=cer(e,i);let n=this._brushCache.get(r);return n===void 0&&(n=new r,this._brushCache.set(r,n)),n}renderObject(e,i,r,n){const s=lh[r];if(!s)return;let o=this._brushCache.get(s);o===void 0&&(o=new s,this._brushCache.set(s,o)),o.prepareState(e,n),o.draw(e,i,n)}renderObjects(e,i,r,n){const s=lh[r];if(!s)return;let o=this._brushCache.get(s);o===void 0&&(o=new s,this._brushCache.set(s,o)),o.drawMany(e,i,n)}registerRenderPass(e){const i=e.brushes.map(r=>(this._brushCache.has(r)||this._brushCache.set(r,new r),this._brushCache.get(r)));return new uer(i,e)}blitTexture(e,i,r,n=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(cn.ONE,cn.ONE_MINUS_SRC_ALPHA,cn.ONE,cn.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,i,r,n)}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}_getOutputFBO(){return this._renderTarget!=null?this._renderTarget:this._fbos?.output??null}_applyEffects(e,i){const r=this._fbos?.blend;if(!r)return;const{context:n}=e,s=this._effectsManager.getPostProcessingEffects(i);for(const{postProcessingEffect:o,effect:a}of s)n.bindFramebuffer(r),o.draw(e,r,a)}};function kEt(t,e,i,r){return t!==io.HIGHLIGHT&&(r!==1||ye(e)&&e!=="normal"||ye(i)&&i.length>0)}function BE(t){return window.WebGL2RenderingContext&&t instanceof window.WebGL2RenderingContext}let NEt=class{constructor(e,i,r,n,s,o,a,l,c){this.createQuery=e,this.deleteQuery=i,this.resultAvailable=r,this.getResult=n,this.disjoint=s,this.beginTimeElapsed=o,this.endTimeElapsed=a,this.createTimestamp=l,this.timestampBits=c}},IF=!1;function $Et(t,e){if(e.disjointTimerQuery)return null;let i=t.getExtension("EXT_disjoint_timer_query_webgl2");return i&&BE(t)?new NEt(()=>t.createQuery(),r=>{t.deleteQuery(r),IF=!1},r=>t.getQueryParameter(r,t.QUERY_RESULT_AVAILABLE),r=>t.getQueryParameter(r,t.QUERY_RESULT),()=>t.getParameter(i.GPU_DISJOINT_EXT),r=>{IF||(IF=!0,t.beginQuery(i.TIME_ELAPSED_EXT,r))},()=>{t.endQuery(i.TIME_ELAPSED_EXT),IF=!1},r=>i.queryCounterEXT(r,i.TIMESTAMP_EXT),()=>t.getQuery(i.TIMESTAMP_EXT,i.QUERY_COUNTER_BITS_EXT)):(i=t.getExtension("EXT_disjoint_timer_query"),i?new NEt(()=>i.createQueryEXT(),r=>{i.deleteQueryEXT(r),IF=!1},r=>i.getQueryObjectEXT(r,i.QUERY_RESULT_AVAILABLE_EXT),r=>i.getQueryObjectEXT(r,i.QUERY_RESULT_EXT),()=>t.getParameter(i.GPU_DISJOINT_EXT),r=>{IF||(IF=!0,i.beginQueryEXT(i.TIME_ELAPSED_EXT,r))},()=>{i.endQueryEXT(i.TIME_ELAPSED_EXT),IF=!1},r=>i.queryCounterEXT(r,i.TIMESTAMP_EXT),()=>i.getQueryEXT(i.TIMESTAMP_EXT,i.QUERY_COUNTER_BITS_EXT)):null)}const IS=Gi("esri-2d-profiler");let der=class{constructor(e,i){if(this._events=new cd,this._entries=new Map,this._timings=new BD(10),this._currentContainer=null,this._currentPass=null,this._currentBrush=null,this._currentSummary=null,!IS)return;this._ext=$Et(e.gl,{}),this._debugOutput=i;const r=e.gl;if(this.enableCommandLogging){for(const 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 IS=="object"&&IS.disableCommands)}recordContainerStart(e){IS&&(this._currentContainer=e)}recordContainerEnd(){IS&&(this._currentContainer=null)}recordPassStart(e){IS&&(this._currentPass=e,this._initSummary())}recordPassEnd(){IS&&(this._currentPass=null,this._emitSummary())}recordBrushStart(e){IS&&(this._currentBrush=e)}recordBrushEnd(){IS&&(this._currentBrush=null)}recordStart(e){if(IS&&ye(this._ext)){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(ye(this._timings.enqueue(o))){const d=this._timings.entries,p=d.length;let y=0;for(const v of d)y+=v;a=y/p}const l=o.toFixed(2),c=a?a.toFixed(2):"--";this.enableCommandLogging?(console.groupCollapsed(`Frame report for ${e}, ${l} ms (${c} 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 (${c} last 10 avg)`),this._debugOutput.innerHTML=`${l} (${c})`}for(const o of r.handles)o.remove();this._ext.deleteQuery(r.query),this._entries.delete(e)}const i={name:e,query:this._ext.createQuery(),commands:[],commandsLen:0,drawCommands:0,summaries:[],handles:[]};this.enableCommandLogging&&(i.handles.push(this._events.on("command",r=>{i.commandsLen++,i.commands.push(r),r.isDrawCommand&&i.drawCommands++})),i.handles.push(this._events.on("summary",r=>{i.summaries.push(r)}))),this._ext.beginTimeElapsed(i.query),this._entries.set(e,i)}}recordEnd(e){IS&&ye(this._ext)&&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)}},BEt=class{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:cn.ONE,dstRGB:cn.ZERO,srcAlpha:cn.ONE,dstAlpha:cn.ZERO},this.blendEquation={mode:RD.ADD,modeAlpha:RD.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=Xw.BACK,this.frontFace=JV.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=El.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:Xw.FRONT_AND_BACK,func:El.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:Xw.FRONT_AND_BACK,fail:Yl.KEEP,zFail:Yl.KEEP,zPass:Yl.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.uniformBufferBindingPoints=new Array,this.readFramebuffer=null,this.drawFramebuffer=null,this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array,this.vertexArrayObject=null}},per=class{constructor(e){this._allocations=new Map,e?Error.stackTraceLimit=1/0:(this.add=()=>{},this.remove=()=>{})}add(e){this._allocations.set(e,new Error().stack)}remove(e){this._allocations.delete(e)}get information(){let e="";if(this._allocations.size>0){e+=`${this._allocations.size} live object allocations: +}`}};function ZQi(t){let e=JQi;return t.split("/").forEach(i=>{e&&(e=e[i])}),e}const QQi=new H5e(ZQi);function X_(t){return QQi.resolveIncludes(t)}const iIt=t=>bO({ID:t.id,PATTERN:t.pattern}),eer={shaders:t=>({vertexShader:iIt(t)+X_("background/background.vert"),fragmentShader:iIt(t)+X_("background/background.frag")})},rIt=t=>bO({ID:t.id}),ter={shaders:t=>({vertexShader:rIt(t)+X_("circle/circle.vert"),fragmentShader:rIt(t)+X_("circle/circle.frag")})},nIt=t=>bO({ID:t.id,PATTERN:t.pattern}),ier={shaders:t=>({vertexShader:nIt(t)+X_("fill/fill.vert"),fragmentShader:nIt(t)+X_("fill/fill.frag")})},sIt=t=>bO({ID:t.id}),rer={shaders:t=>({vertexShader:sIt(t)+X_("outline/outline.vert"),fragmentShader:sIt(t)+X_("outline/outline.frag")})},oIt=t=>bO({ID:t.id,SDF:t.sdf}),ner={shaders:t=>({vertexShader:oIt(t)+X_("icon/icon.vert"),fragmentShader:oIt(t)+X_("icon/icon.frag")})},aIt=t=>bO({ID:t.id,PATTERN:t.pattern,SDF:t.sdf}),ser={shaders:t=>({vertexShader:aIt(t)+X_("line/line.vert"),fragmentShader:aIt(t)+X_("line/line.frag")})},lIt=t=>bO({ID:t.id}),oer={shaders:t=>({vertexShader:lIt(t)+X_("text/text.vert"),fragmentShader:lIt(t)+X_("text/text.frag")})};let aer=class{constructor(){this._programByKey=new Map}dispose(){this._programByKey.forEach(e=>e.dispose()),this._programByKey.clear()}getMaterialProgram(e,i,r){const n=i.key<<3|this._getMaterialOptionsValue(i.type,r);if(this._programByKey.has(n))return this._programByKey.get(n);const s=this._getProgramTemplate(i.type),{shaders:o}=s,{vertexShader:a,fragmentShader:l}=o(r),c=i.getShaderHeader(),h=i.getShaderMain(),p=a.replace("#pragma header",c).replace("#pragma main",h),y=e.programCache.acquire(p,l,i.getAttributeLocations());return this._programByKey.set(n,y),y}_getMaterialOptionsValue(e,i){switch(e){case xp.BACKGROUND:{const r=i;return(r.pattern?1:0)<<1|(r.id?1:0)}case xp.FILL:{const r=i;return(r.pattern?1:0)<<1|(r.id?1:0)}case xp.OUTLINE:return i.id?1:0;case xp.LINE:{const r=i;return(r.sdf?1:0)<<2|(r.pattern?1:0)<<1|(r.id?1:0)}case xp.ICON:{const r=i;return(r.sdf?1:0)<<1|(r.id?1:0)}case xp.CIRCLE:return i.id?1:0;case xp.TEXT:return i.id?1:0;default:return 0}}_getProgramTemplate(e){switch(e){case xp.BACKGROUND:return eer;case xp.CIRCLE:return ter;case xp.FILL:return ier;case xp.ICON:return ner;case xp.LINE:return ser;case xp.OUTLINE:return rer;case xp.TEXT:return oer;default:return null}}};const uIt={shaders:{vertexShader:Ig("bitBlit/bitBlit.vert"),fragmentShader:Ig("bitBlit/bitBlit.frag")},attributes:new Map([["a_pos",0],["a_tex",1]])};let cIt=class{constructor(){this._initialized=!1}dispose(){this._program=qa(this._program),this._vertexArrayObject=qa(this._vertexArrayObject)}render(e,i,r,n){e&&(this._initialized||this._initialize(e),e.setBlendFunctionSeparate(Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA,Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA),e.bindVAO(this._vertexArrayObject),e.useProgram(this._program),i.setSamplingMode(r),e.bindTexture(i,0),this._program.setUniform1i("u_tex",0),this._program.setUniform1f("u_opacity",n),e.drawArrays(bs.TRIANGLE_STRIP,0,4),e.bindTexture(null,0),e.bindVAO())}_initialize(e){if(this._initialized)return!0;const i=$E(e,uIt);if(!i)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=uIt.attributes,s=new Mc(e,n,LQi,{geometry:aa.createVertex(e,Xo.STATIC_DRAW,r)});return this._program=i,this._vertexArrayObject=s,this._initialized=!0,!0}};const ler=t=>{let e="";e+=t[0].toUpperCase();for(let i=1;i{const e={};for(const i in t)e[ler(i)]=t[i];return bO(e)},Z5e=(t,e,i,r)=>{const n=t+t.substring(t.lastIndexOf("/")),s=e+e.substring(e.lastIndexOf("/")),o=uer(r);return{attributes:i,shaders:{vertexShader:o+Ig(`${n}.vert`),fragmentShader:o+Ig(`${s}.frag`)}}},hIt=t=>t===mo.HITTEST||t===mo.LABEL_ALPHA,cer=t=>(hIt(t)?1:0)|(t===mo.HIGHLIGHT?2:0),her=({rendererInfo:t,drawPhase:e},i,r)=>`${i.getVariationHash()}-${cer(e)}-${t.getVariationHash()}-${ve(r)&&r.join(".")}`,der=(t,e,i,r={})=>{if(r={...r,...e.getVariation(),...t.rendererInfo.getVariation(),highlight:t.drawPhase===mo.HIGHLIGHT,id:hIt(t.drawPhase)},ve(i))for(const n of i)r[n]=!0;return r};let per=class{constructor(e){this._rctx=e,this._programByKey=new Map}dispose(){this._programByKey.forEach(e=>e.dispose()),this._programByKey.clear()}getProgram(e,i=[]){const r=e.vsPath+"."+e.fsPath+JSON.stringify(i);if(this._programByKey.has(r))return this._programByKey.get(r);const n={...i.map(h=>typeof h=="string"?{name:h,value:!0}:h).reduce((h,p)=>({...h,[p.name]:p.value}),{})},{vsPath:s,fsPath:o,attributes:a}=e,l=Z5e(s,o,a,n),c=this._rctx.programCache.acquire(l.shaders.vertexShader,l.shaders.fragmentShader,l.attributes);if(!c)throw new Error("Unable to get program for key: ${key}");return this._programByKey.set(r,c),c}getMaterialProgram(e,i,r,n,s){const o=her(e,i,s);if(this._programByKey.has(o))return this._programByKey.get(o);const a=der(e,i,s,{ignoresSamplerPrecision:e.context.driverTest.ignoresSamplerPrecision.result}),l=Z5e(r,r,n,a),c=this._rctx.programCache.acquire(l.shaders.vertexShader,l.shaders.fragmentShader,l.attributes);if(!c)throw new Error("Unable to get program for key: ${key}");return this._programByKey.set(o,c),c}},Xme=class{constructor(e,i){this._width=0,this._height=0,this._free=[],this._width=e,this._height=i,this._free.push(new Md(0,0,e,i))}get width(){return this._width}get height(){return this._height}allocate(e,i){if(e>this._width||i>this._height)return new Md;let r=null,n=-1;for(let s=0;se&&this._free.push(new Md(r.x+e,r.y,r.width-e,i)),r.height>i&&this._free.push(new Md(r.x,r.y+i,r.width,r.height-i))):(r.width>e&&this._free.push(new Md(r.x+e,r.y,r.width-e,r.height)),r.height>i&&this._free.push(new Md(r.x,r.y+i,e,r.height-i))),new Md(r.x,r.y,e,i))}release(e){for(let i=0;iMath.floor(t/256);function ger(t){const e=new Set;for(const i of t)e.add(mer(i));return e}function yer(t,e,i){return t.has(e)||t.set(e,i().then(()=>{t.delete(e)}).catch(r=>{t.delete(e),_C(r)})),t.get(e)}const ver=t=>({rect:new Md(0,0,0,0),page:0,metrics:{left:0,width:0,height:0,advance:0,top:0},code:t,sdf:!0});let _er=class{constructor(e,i,r){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphCache={},this._textures=[],this._rangePromises=new Map,this.width=e,this.height=i,this._glyphSource=r,this._binPack=new Xme(e-4,i-4),this._glyphData.push(new Uint8Array(e*i)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyph()}dispose(){this._binPack=null;for(const e of this._textures)e&&e.dispose();this._textures.length=0,this._glyphData.length=0}_initDecorationGlyph(){const e=[117,149,181,207,207,181,149,117],i=[];for(let n=0;nthis._getMosaicItem(n,e,s))}bind(e,i,r,n){const s=this._getTexture(e,r);s.setSamplingMode(i),this._dirties[r]&&(s.setData(this._glyphData[r]),this._dirties[r]=!1),e.bindTexture(s,n)}_getGlyphCache(e){return this._glyphCache[e]||(this._glyphCache[e]={}),this._glyphCache[e]}_getTexture(e,i){return this._textures[i]||(this._textures[i]=new Fs(e,{pixelFormat:gn.ALPHA,dataType:ds.UNSIGNED_BYTE,width:this.width,height:this.height},new Uint8Array(this.width*this.height))),this._textures[i]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(e,i,r){const n=ger(i),s=[];n.forEach(o=>{s.push(this._fetchRange(e,o,r))}),await Promise.all(s)}async _fetchRange(e,i,r){if(i>fer)return;const n=e+i;return yer(this._rangePromises,n,()=>this._glyphSource.getRange(e,i,r))}_getMosaicItem(e,i,r){if(!e[r]){const n=this._glyphSource.getGlyph(i,r);if(!n||!n.metrics)return ver(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 i=e.metrics;let r;if(i.width===0)r=new Md(0,0,0,0);else{const s=i.width+6,o=i.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._initDecorationGlyph(),this._binPack=new Xme(this.width-4,this.height-4),r=this._binPack.allocate(s,o));const a=this._glyphData[this._currentPage],l=e.bitmap;let c,h;if(l)for(let p=0;p{n.addRange(i,new ber(new q5(new Uint8Array(l.data),new DataView(l.data))))})}getGlyph(e,i){const r=this._getFontStack(e);if(!r)return;const n=Math.floor(i/256);if(n>256)return;const s=r.getRange(n);return s?{metrics:s.getMetrics(i),bitmap:s.getBitmap(i)}:void 0}_getFontStack(e){let i=this._glyphInfo[e];return i||(i=this._glyphInfo[e]=new wer),i}};const BQ=1e20;let Ser=class{constructor(e){this._svg=null,this.size=e;const i=document.createElement("canvas");i.width=i.height=e,this._context=i.getContext("2d"),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,i,r=31){this._initSVG();const n=this.createSVGString(e);return new Promise((s,o)=>{const a=new Image;a.src="data:image/svg+xml; charset=utf8, "+encodeURIComponent(n),a.onload=()=>{a.onload=null,this._context.clearRect(0,0,this.size,this.size),this._context.drawImage(a,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;po(Sc()))})}_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){const i=this._initSVG(),r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttribute("d",e),i.appendChild(r);const n=r.getBBox(),s=n.width/n.height,o=this.size/2;let a,l,c,h;if(s>1){l=a=o/n.width;const x=o*(1/s);c=this.size/4,h=o-x/2}else a=l=o/n.height,c=o-o*s/2,h=this.size/4;const p=-n.x*a+c,y=-n.y*l+h;r.setAttribute("style",`transform: matrix(${a}, 0, 0, ${l}, ${p}, ${y})`);const v=`${i.innerHTML}`;return i.removeChild(r),v}_edt(e,i,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 Xme(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 i=this._mosaicPages[e.page],r=i.mosaicsData;if(!AU(i.mosaicsData))throw new st("mapview-invalid-resource","unsuitable data type!");const n=e.spriteData,s=r.data;s&&n||console.error("Source or target images are uninitialized!"),Y5t._copyBits(n,e.spriteSize[0],0,0,s,e.pageSize[0],e.rect.x+Oc,e.rect.y+Oc,e.spriteSize[0],e.spriteSize[1],e.repeat),i.dirty=!0}_allocateImage(e,i){e+=2*Oc,i+=2*Oc;const r=Math.max(e,i);if(this._maxItemSize&&this._maxItemSizee+i,0)}function Eer(t){const{width:e,height:i}=t;return{frameDurations:t.frameDurations.reverse(),getFrame:r=>{const n=t.frameDurations.length-1-r;return t.getFrame(n)},width:e,height:i}}function Ier(t,e){const{width:i,height:r,getFrame:n}=t,s=e/dIt(t);return{frameDurations:t.frameDurations.map(o=>o*s),getFrame:n,width:i,height:r}}function Aer(t,e){const{width:i,height:r,getFrame:n}=t,s=t.frameDurations.slice(),o=s.shift();return s.unshift(o+e),{frameDurations:s,getFrame:n,width:i,height:r}}function pIt(t,e){const{width:i,height:r,getFrame:n}=t,s=t.frameDurations.slice(),o=s.pop();return s.push(o+e),{frameDurations:s,getFrame:n,width:i,height:r}}let Per=class{constructor(e,i,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(;i>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 hS.None:this._currentFrame-=this._direction;break;case hS.Loop:this._currentFrame=0;break;case hS.Oscillate:this._currentFrame-=this._direction,this._direction=-1}}else if(this._currentFrame===-1)switch(this._repeatType){case hS.None:this._currentFrame-=this._direction;break;case hS.Loop:this._currentFrame=this._animation.frameDurations.length-1;break;case hS.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 Oer(t,e,i,r){let n,{repeatType:s}=e;if(s==null&&(s=hS.Loop),e.reverseAnimation===!0&&(t=Eer(t)),e.duration!=null&&(t=Ier(t,1e3*e.duration)),e.repeatDelay!=null){const o=1e3*e.repeatDelay;s===hS.Loop?t=pIt(t,o):s===hS.Oscillate&&(t=Aer(pIt(t,o/2),o/2))}if(e.startTimeOffset!=null)n=1e3*e.startTimeOffset;else if(e.randomizeStartTime!=null){const o=OCt(i),a=82749913,l=e.randomizeStartSeed!=null?e.randomizeStartSeed:a,c=PCt(o,l);n=c*dIt(t)}else n=0;return new Per(t,n,s,r)}function Rer(t,e,i,r){const n=e.playAnimation==null||e.playAnimation,s=Oer(t,e,i,r);let o,a=s.timeToFrame;function l(){o=n?setTimeout(()=>{s.nextFrame(),a=s.timeToFrame,l()},a):void 0}return l(),{remove:()=>{n&&clearTimeout(o)}}}const Q5e=document.createElement("canvas"),Kme=Q5e.getContext("2d");function Mer(t,e,i){Q5e.width=e,Q5e.height=i;const r=[],n=t.frameDurations.length;for(let s=0;sr[s]}}let Der=class{constructor(e,i,r,n){this._animation=e,this._frameData=null;const s=o=>{this._frameData=o,i.requestRender()};this.frameCount=this._animation.frameDurations.length,this.width=this._animation.width,this.height=this._animation.height,this._playHandle=Rer(this._animation,r,n,s)}destroy(){this._playHandle.remove()}bindFrame(e,i,r){e.bindTexture(i,r),lt(this._frameData)||(i.updateData(0,Oc,Oc,this._frameData.width,this._frameData.height,this._frameData),this._frameData=null)}};function K_(t,e){if(t&&"name"in t){const i=t;return e&&e.error(new st(i.name,i.message,i.details)),!1}return!0}function Fer(t){switch(t.type){case"esriSMS":return`${t.style}.${t.path}`;case"esriSLS":return`${t.style}.${t.cap}`;case"esriSFS":return`${t.style}`;case"esriPFS":case"esriPMS":return t.imageData?`${t.imageData}${t.width}${t.height}`:`${t.url}${t.width}${t.height}`;default:return"mosaicHash"in t?t.mosaicHash:JSON.stringify(t)}}const fIt=xT(),mIt="arial-unicode-ms-regular",eNe=126,gIt=Oi.getLogger("esri.views.2d.engine.webgl.TextureManager");function yIt(t,e){const i=Math.round(vn(e)*window.devicePixelRatio),r=i>=128?2:4;return Math.min(t,i*r)}const tNe=(t,e,i)=>gIt.error(new st(t,e,i));let Ler=class X5t{static fromMosaic(e,i){return new X5t(e,i.page,i.sdf)}constructor(e,i,r){this.mosaicType=e,this.page=i,this.sdf=r}},Ner=class{constructor(e,i,r){this._requestRender=e,this.resourceManager=i,this._allowNonPowerOfTwo=r,this._invalidFontsMap=new Map,this._sdfConverter=new Ser(eNe),this._bindingInfos=new Array,this._hashToBindingIndex=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new xN({concurrency:10,process:async(n,s)=>{yn(s);try{return await ur(n,{responseType:"image",signal:s})}catch(o){throw ys(o)?o:new st("mapview-invalid-resource",`Could not fetch requested resource at ${n}`,o)}}}),this._spriteMosaic=new Cer(2048,2048,500),this._glyphSource=new xer(`${pa.fontsUrl}/{fontstack}/{range}.pbf`),this._glyphMosaic=new _er(1024,1024,this._glyphSource),this._rasterizer=new GKi(i)}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}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}async rasterizeItem(e,i,r,n){if(lt(e))return tNe("mapview-null-resource","Unable to rasterize null resource"),null;switch(e.type){case"text":case"esriTS":{const s=await this._rasterizeText(e,r,n);return s.forEach(o=>this._setTextureBinding(wG.GLYPH,o)),{glyphMosaicItems:s}}default:{if(JNi(e))return tNe("mapview-invalid-type",`MapView does not support symbol type: ${e.type}`,e),null;const s=await this._rasterizeSpriteSymbol(e,i,n);return K_(s)&&s&&this._setTextureBinding(wG.SPRITE,s),{spriteMosaicItem:s}}}}bindTextures(e,i,r,n=!1){if(r.textureBinding===0)return;const s=this._bindingInfos[r.textureBinding-1],o=s.page,a=n?In.LINEAR_MIPMAP_LINEAR:In.LINEAR;switch(s.mosaicType){case wG.SPRITE:{const l=this.sprites.getWidth(o),c=this.sprites.getHeight(o),h=ga(fIt,l,c);return this._spriteMosaic.bind(e,a,o,svt),i.setUniform1i("u_texture",svt),void i.setUniform2fv("u_mosaicSize",h)}case wG.GLYPH:{const l=this.glyphs.width,c=this.glyphs.height,h=ga(fIt,l,c);return this._glyphMosaic.bind(e,a,o,ovt),i.setUniform1i("u_texture",ovt),void i.setUniform2fv("u_mosaicSize",h)}default:gIt.error("mapview-texture-manager",`Cannot handle unknown type ${s.mosaicType}`)}}_hashMosaic(e,i){return 1|e<<1|(i.sdf?1:0)<<2|i.page<<3}_setTextureBinding(e,i){const r=this._hashMosaic(e,i);if(!this._hashToBindingIndex.has(r)){const n=Ler.fromMosaic(e,i),s=this._bindingInfos.length+1;this._hashToBindingIndex.set(r,s),this._bindingInfos.push(n)}i.textureBinding=this._hashToBindingIndex.get(r)}async _rasterizeText(e,i,r){let n,s;if("cim"in e){const l=e;n=l.fontName,s=l.text}else{const l=e;n=Vqi(l.font),s=l.text}const o=this._invalidFontsMap.has(n),a=i||eki(_F(s)[0]);try{return await this._glyphMosaic.getGlyphItems(o?mIt:n,a,r)}catch{return tNe("mapview-invalid-resource",`Couldn't find font ${n}. Falling back to Arial Unicode MS Regular`),this._invalidFontsMap.set(n,!0),this._glyphMosaic.getGlyphItems(mIt,a,r)}}async _rasterizeSpriteSymbol(e,i,r){if(ZNi(e))return;const n=Fer(e);if(this._spriteMosaic.has(n))return this._spriteMosaic.getSpriteItem(n);if(i_t(e)||YNi(e)&&!a_t(e))return this._handleAsyncResource(n,e,r);const s=dNi,o=this._rasterizer.rasterizeJSONResource(e,s);if(o){const{size:a,image:l,sdf:c,simplePattern:h,rasterizationScale:p}=o;return this._addItemToMosaic(n,a,{type:"static",data:l},Zpe(e),c,h,p)}return new st("TextureManager","unrecognized or null rasterized image")}async _handleAsyncResource(e,i,r){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let n;n=i_t(i)?this._handleSVG(i,e,r):this._handleImage(i,e,r),this._ongoingRasterizations.set(e,n);try{await n,this._ongoingRasterizations.delete(e)}catch{this._ongoingRasterizations.delete(e)}return n}async _handleSVG(e,i,r){const n=[eNe,eNe],s=await this._sdfConverter.draw(e.path,r);return this._addItemToMosaic(i,n,{type:"static",data:new Uint32Array(s.buffer)},!1,!0,!0)}async _handleGIFOrPNG(e,i,r){const n=r_t(e);await this.resourceManager.fetchResource(n,r);let s=this.resourceManager.getResource(n);if(lt(s))return new st("mapview-invalid-resource",`Could not fetch requested resource at ${n}.`);let o=s.width,a=s.height;if(s instanceof HTMLImageElement){e.type==="esriPMS"&&(o=Math.round(yIt(s.width,o_t(e))),a=Math.round(s.height*(o/s.width)));const p="cim"in e?e.cim.colorSubstitutions:void 0,{size:y,sdf:v,image:x}=this._rasterizer.rasterizeImageResource(o,a,s,p);return this._addItemToMosaic(i,y,{type:"static",data:x},Zpe(e),v,!1)}this._allowNonPowerOfTwo||(o=q8(s.width+2*Oc)-2*Oc,a=q8(s.height+2*Oc)-2*Oc),o===s.width&&a===s.height||(s=Mer(s,o,a));const l=e.animatedSymbolProperties||{},c=e.objectId,h=new Der(s,this._requestRender,l,c);return this._addItemToMosaic(i,[h.width,h.height],{type:"animated",data:h},Zpe(e),!1,!1)}async _handleImage(e,i,r){if(XNi(e)||KNi(e))return this._handleGIFOrPNG(e,i,r);const n=r_t(e);try{let s;const o=this.resourceManager.getResource(n);if(ve(o)&&o instanceof HTMLImageElement)s=o;else{const{data:v}=await this._imageRequestQueue.push(n,{...r});s=v}if(QNi(n)){if("width"in e&&"height"in e)s.width=vn(e.width),s.height=vn(e.height);else if("cim"in e){const v=e.cim;s.width=vn(v.width??v.scaleX*v.size),s.height=vn(v.size)}}if(!s.width||!s.height)return null;let a=s.width,l=s.height;e.type==="esriPMS"&&(a=Math.round(yIt(s.width,o_t(e))),l=Math.round(s.height*(a/s.width)));const c="cim"in e?e.cim.colorSubstitutions:void 0,{size:h,sdf:p,image:y}=this._rasterizer.rasterizeImageResource(a,l,s,c);return this._addItemToMosaic(i,h,{type:"static",data:y},Zpe(e),p,!1)}catch(s){if(!ys(s))return new st("mapview-invalid-resource",`Could not fetch requested resource at ${n}. ${s.message}`)}}_addItemToMosaic(e,i,r,n,s,o,a){return this._spriteMosaic.addSpriteItem(e,i,r,n,s,o,a)}},ker=class{constructor(e,i){this._queue=[],this._context=e,this._refreshable=i}destroy(){this._queue=[]}enqueueTextureUpdate(e,i){const r=kf(),n=e,s=cNi,o=Math.ceil(n.height/s);if(yn(i),this._context.type===bo.WEBGL1)this._queue.push({type:"no-chunk",request:e,resolver:r,options:i});else for(let a=0;ar.reject(a)),r.promise}upload(){let e=0;for(;this._queue.length;){const i=performance.now(),r=this._queue.shift();if(r){if(ve(r.options.signal)&&r.options.signal.aborted)continue;switch(r.type){case"chunk":this._uploadChunk(r);break;case"no-chunk":this._uploadNoChunk(r)}const n=performance.now()-i;if(e+=n,e+n>=hNi)break}}this._queue.length&&this._refreshable.requestRender()}_uploadChunk(e){const{request:i,resolver:r,chunkOffset:n,chunkIsLast:s,destHeight:o}=e,{data:a,texture:l,width:c}=i;ve(a)&&(l.updateData(0,0,n,c,o,a,n),s&&r.resolve())}_uploadNoChunk(e){const{request:i,resolver:r}=e,{data:n,texture:s}=i;s.setData(n),r.resolve()}};const $er={shaders:{vertexShader:Ig("stencil/stencil.vert"),fragmentShader:Ig("stencil/stencil.frag")},attributes:new Map([["a_pos",0]])},Ber=bT(-.5,-.5);let Ver=class{constructor(){this._centerNdc=hn(),this._pxToNdc=hn(),this._worldDimensionsPx=hn(),this._mat3=Dl(),this._initialized=!1}dispose(){this._program=qa(this._program),this._quad=qa(this._quad)}render(e,i){const{context:r}=e;return!!this._updateGeometry(e,i)&&(this._initialized||this._initialize(r),r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setColorMask(!1,!1,!1,!1),r.setBlendingEnabled(!1),r.setStencilOp(nu.KEEP,nu.KEEP,nu.REPLACE),r.setStencilFunction(kl.ALWAYS,1,255),r.setStencilTestEnabled(!0),r.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.draw(),this._quad.unbind(),!0)}_initialize(e){if(this._initialized)return;const i=$E(e,$er);i&&(this._program=i,this._quad=new hx(e,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(e,i){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 c=OL(o),h=Math.abs(Math.cos(c)),p=Math.abs(Math.sin(c)),y=Math.round(a*h+l*p),v=Math.round(r.worldScreenWidth);if(y<=v)return!1;const x=a*p+l*h,I=v*n,P=(i.left-i.right)*n/a,F=(i.bottom-i.top)*n/l;Rl(this._worldDimensionsPx,I,x,1),Rl(this._pxToNdc,2/a,-2/l,1),Rl(this._centerNdc,P,F,1);const k=this._mat3;return WIe(k,this._centerNdc),rP(k,k,this._pxToNdc),o!==0&&wT(k,k,c),rP(k,k,this._worldDimensionsPx),dg(k,k,Ber),!0}},jer=class extends IU{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,i){if(!i?.size)return;const{context:r,renderingOptions:n}=e;this._quad||(this._quad=new hx(r,[0,0,1,0,0,1,1,1]));const s=r.getBoundFramebufferObject(),{x:o,y:a,width:l,height:c}=r.getViewport();i.bindTextures(r);const h=i.getBlock(fFe);if(lt(h))return;const p=h.getFBO(r),y=h.getFBO(r,1);r.setViewport(0,0,i.size,i.size),this._computeDelta(e,y,n.labelsAnimationTime),this._updateAnimationState(e,y,p),r.bindFramebuffer(s),r.setViewport(o,a,l,c)}_computeDelta(e,i,r){const{context:n,painter:s,displayLevel:o}=e,a=s.materialManager.getProgram(this._desc,["delta"]);n.bindFramebuffer(i),n.setClearColor(0,0,0,0),n.clear(n.gl.COLOR_BUFFER_BIT),n.useProgram(a),a.setUniform1i("u_maskTexture",jpe),a.setUniform1i("u_sourceTexture",Gpe),a.setUniform1f("u_timeDelta",e.deltaTime),a.setUniform1f("u_animationTime",r),a.setUniform1f("u_zoomLevel",Math.round(10*o)),this._quad.draw()}_updateAnimationState(e,i,r){const{context:n,painter:s}=e,o=s.materialManager.getProgram(this._desc,["update"]);n.bindTexture(i.colorTexture,1),n.useProgram(o),o.setUniform1i("u_sourceTexture",1),n.bindFramebuffer(r),n.setClearColor(0,0,0,0),n.clear(n.gl.COLOR_BUFFER_BIT),this._quad.draw()}};const Ger=t=>t.replace("-","_").toUpperCase(),vIt=t=>`#define ${Ger(t)} +`;function _It(t){return{attributes:new Map([["a_pos",0],["a_tex",1]]),shaders:{vertexShader:vIt(t)+Ig("blend/blend.vert"),fragmentShader:vIt(t)+Ig("blend/blend.frag")}}}const bIt=Oi.getLogger("esri.views.2d.engine.webgl.effects.blendEffects.BlendEffect");let Uer=class{constructor(){this._size=[0,0]}dispose(e){this._backBufferTexture=qa(this._backBufferTexture),this._quad=qa(this._quad)}draw(e,i,r,n,s){const{context:o,drawPhase:a}=e;if(this._setupShader(o),n&&n!=="normal"&&a!==mo.LABEL)return void this._drawBlended(e,i,r,n,s);const l=_It("normal"),c=o.programCache.acquire(l.shaders.vertexShader,l.shaders.fragmentShader,l.attributes);if(!c)return void bIt.error(new st("mapview-BlendEffect",'Error creating shader program for blend mode "normal"'));o.useProgram(c),i.setSamplingMode(r),o.bindTexture(i,0),c.setUniform1i("u_layerTexture",0),c.setUniform1f("u_opacity",s),o.setBlendingEnabled(!0),o.setBlendFunction(Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA);const h=this._quad;h.draw(),h.unbind(),c.dispose()}_drawBlended(e,i,r,n,s){const{context:o,state:a,pixelRatio:l,inFadeTransition:c}=e,{size:h}=a,p=o.getBoundFramebufferObject();let y,v;if(ve(p)){const k=p.descriptor;y=k.width,v=k.height}else y=Math.round(l*h[0]),v=Math.round(l*h[1]);this._createOrResizeTexture(e,y,v);const x=this._backBufferTexture;p.copyToTexture(0,0,y,v,0,0,x),o.setStencilTestEnabled(!1),o.setStencilWriteMask(0),o.setBlendingEnabled(!0),o.setDepthTestEnabled(!1),o.setDepthWriteEnabled(!1);const I=_It(n),P=o.programCache.acquire(I.shaders.vertexShader,I.shaders.fragmentShader,I.attributes);if(!P)return void bIt.error(new st("mapview-BlendEffect",`Error creating shader program for blend mode ${n}`));o.useProgram(P),x.setSamplingMode(r),o.bindTexture(x,0),P.setUniform1i("u_backbufferTexture",0),i.setSamplingMode(r),o.bindTexture(i,1),P.setUniform1i("u_layerTexture",1),P.setUniform1f("u_opacity",s),P.setUniform1f("u_inFadeOpacity",c?1:0),o.setBlendFunction(Sn.ONE,Sn.ZERO);const F=this._quad;F.draw(),F.unbind(),P.dispose(),o.setBlendFunction(Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA)}_setupShader(e){this._quad||(this._quad=new hx(e,[-1,-1,1,-1,-1,1,1,1]))}_createOrResizeTexture(e,i,r){const{context:n}=e;this._backBufferTexture!==null&&i===this._size[0]&&r===this._size[1]||(this._backBufferTexture?this._backBufferTexture.resize(i,r):this._backBufferTexture=new Fs(n,{target:so.TEXTURE_2D,pixelFormat:gn.RGBA,internalFormat:gn.RGBA,dataType:ds.UNSIGNED_BYTE,wrapMode:ws.CLAMP_TO_EDGE,samplingMode:In.LINEAR,flipped:!1,width:i,height:r}),this._size[0]=i,this._size[1]=r)}},wIt=class extends IU{constructor(e){super(),this.name=this.constructor.name,this.defines=[e]}dispose(){}bind({context:e,painter:i}){this._prev=e.getBoundFramebufferObject();const{width:r,height:n}=e.getViewport(),s=i.getFbos(r,n).effect0;e.bindFramebuffer(s),e.setColorMask(!0,!0,!0,!0),e.setClearColor(0,0,0,0),e.clear(e.gl.COLOR_BUFFER_BIT)}unbind(){}draw(e,i){const{context:r,painter:n}=e,s=n.getPostProcessingEffects(i),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,In.NEAREST),r.setStencilTestEnabled(!0)}};const zer={shaders:{vertexShader:Ig("highlight/textured.vert"),fragmentShader:Ig("highlight/highlight.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},Her={shaders:{vertexShader:Ig("highlight/textured.vert"),fragmentShader:Ig("highlight/blur.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])};let Wer=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,i){e.bindTexture(i,DJ),e.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[1,0,1/this._width,0]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",QZi),e.bindVAO(this._resources.quadVAO),e.drawArrays(bs.TRIANGLE_STRIP,0,4),e.bindVAO()}finalBlur(e,i){e.bindTexture(i,DJ),e.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[0,1,0,1/this._height]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",eQi),e.bindVAO(this._resources.quadVAO),e.drawArrays(bs.TRIANGLE_STRIP,0,4),e.bindVAO()}renderHighlight(e,i,r){e.bindTexture(i,DJ),e.useProgram(this._resources.highlightProgram),r.applyHighlightOptions(e,this._resources.highlightProgram),e.bindVAO(this._resources.quadVAO),e.setBlendingEnabled(!0),e.setBlendFunction(Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA),e.drawArrays(bs.TRIANGLE_STRIP,0,4),e.bindVAO()}_initialize(e,i,r){this._width=i,this._height=r;const n=aa.createVertex(e,Xo.STATIC_DRAW,new Int8Array([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]).buffer),s=new Mc(e,new Map([["a_position",0],["a_texcoord",1]]),{geometry:[new na("a_position",2,Bi.BYTE,0,4),new na("a_texcoord",2,Bi.UNSIGNED_BYTE,2,4)]},{geometry:n}),o=$E(e,zer),a=$E(e,Her);e.useProgram(o),o.setUniform1i("u_texture",DJ),o.setUniform1i("u_shade",lvt),o.setUniform1f("u_sigma",W5e),e.useProgram(a),a.setUniform1i("u_texture",DJ),a.setUniform1f("u_sigma",W5e),this._resources={quadGeometry:n,quadVAO:s,highlightProgram:o,blurProgram:a}}setup(e,i,r){this._resources?(this._width=i,this._height=r):this._initialize(e,i,r)}};function xIt(t,e,i){const r=new Fs(t,{target:so.TEXTURE_2D,pixelFormat:gn.RGBA,dataType:ds.UNSIGNED_BYTE,wrapMode:ws.CLAMP_TO_EDGE,width:e,height:i,samplingMode:In.LINEAR});return[r,new ad(t,{colorTarget:Ah.TEXTURE,depthStencilTarget:Tl.STENCIL_RENDER_BUFFER},r)]}let qer=class{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.sharedBlur1Tex.dispose(),this._resources.sharedBlur1Fbo.dispose(),this._resources.sharedBlur2Tex.dispose(),this._resources.sharedBlur2Fbo.dispose(),this._resources=vH(this._resources))}_initialize(e,i,r){this._width=i,this._height=r;const[n,s]=xIt(e,i,r),[o,a]=xIt(e,i,r);this._resources={sharedBlur1Tex:n,sharedBlur1Fbo:s,sharedBlur2Tex:o,sharedBlur2Fbo:a}}setup(e,i,r){!this._resources||this._width===i&&this._height===r||this.dispose(),this._resources||this._initialize(e,i,r)}get sharedBlur1Tex(){return this._resources.sharedBlur1Tex}get sharedBlur1Fbo(){return this._resources.sharedBlur1Fbo}get sharedBlur2Tex(){return this._resources.sharedBlur2Tex}get sharedBlur2Fbo(){return this._resources.sharedBlur2Fbo}};const O6=4,Jme=4/O6;let Yer=class extends IU{constructor(){super(...arguments),this.defines=["highlight"],this._hlRenderer=new Wer,this._width=void 0,this._height=void 0,this._boundFBO=null,this._hlSurfaces=new qer,this._adjustedWidth=void 0,this._adjustedHeight=void 0,this._blitRenderer=new cIt}dispose(){this._hlSurfaces?.dispose(),this._hlRenderer?.dispose(),this._boundFBO=null}bind(e){const{context:i,painter:r}=e,{width:n,height:s}=i.getViewport(),o=r.getFbos(n,s).effect0;this.setup(e,n,s),i.bindFramebuffer(o),i.setColorMask(!0,!0,!0,!0),i.setClearColor(0,0,0,0),i.clear(i.gl.COLOR_BUFFER_BIT)}unbind(){}setup({context:e},i,r){this._width=i,this._height=r;const n=i%O6,s=r%O6;i+=nh.resolve([]));const o=s.getFBO(r),a=new Uint8Array(o.width*o.height*4);try{await o.readPixelsAsync(0,0,o.width,o.height,gn.RGBA,ds.UNSIGNED_BYTE,a)}catch{return void i.forEach(p=>p.resolve([]))}const l=[];for(let h=0;hp.directHits===h.directHits?p.id-h.id:p.directHits-h.directHits);const c=l.map(h=>h.id);i.forEach(h=>h.resolve(c))}},Ker=class extends IU{constructor(){super(...arguments),this.name=this.constructor.name,this.defines=["id"],this._lastSize=0,this._boundFBO=null}dispose(){ve(this._fbo)&&this._fbo.dispose()}bind({context:e,painter:i}){const{width:r,height:n}=e.getViewport();this._boundFBO=e.getBoundFramebufferObject();const s=i.getFbos(r,n).effect0;e.bindFramebuffer(s),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,i,r=2*hvt){this._resolve(e,i,r)}async _resolve({context:e,state:i,pixelRatio:r},n,s){const o=e.getBoundFramebufferObject(),a=i.size[1]*r,l=Math.round(s*r),c=l/2,h=l/2;this._ensureBuffer(l),n.forEach(async(p,y)=>{const v=new Map,x=Math.floor(y.x*r-l/2),I=Math.floor(a-y.y*r-l/2);await o.readPixelsAsync(x,I,l,l,gn.RGBA,ds.UNSIGNED_BYTE,this._buf);for(let F=0;FF[1]-k[1]).map(F=>F[0]);p.resolve(P),n.delete(y)})}_ensureBuffer(e){this._lastSize!==e&&(this._lastSize=e,this._buf=new Uint8Array(4*e*e),this._buf32=new Uint32Array(this._buf.buffer))}};const iNe=5,Jer=[1,0],Zer=[0,1],Qer=[1,.8,.6,.4,.2],etr=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];let ttr=class{constructor(){this._intensityFBO=null,this._compositeFBO=null,this._mipsFBOs=new Array(iNe),this._nMips=iNe,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=qa(this._quad),this._intensityFBO=qa(this._intensityFBO),this._compositeFBO=qa(this._compositeFBO),this._mipsFBOs){for(let e=0;enew str,blur:()=>new ntr,bloom:()=>new ttr,opacity:()=>new utr,"drop-shadow":()=>new ltr};let dtr=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 i=[];for(const r of e){const n=ctr(r.type);let s=this._effectMap.get(n);s||(s=htr[n](),this._effectMap.set(n,s)),i.push({postProcessingEffect:s,effect:r})}return i}},ptr=class{constructor(e,i){this.brushes=e,this.name=i.name,this.drawPhase=i.drawPhase||mo.MAP,this._targetFn=i.target,this.effects=i.effects||[],this.enableDefaultDraw=i.enableDefaultDraw??(()=>!0)}render(e){const{context:i,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&&o.args(),c=i.getViewport(),h=i.getBoundFramebufferObject(),p=e.passOptions;this._bindEffect(e,a,l),this._doRender(e,n,a.defines),this._drawAndUnbindEffect(e,a,c,h,p,l)}}}_doRender(e,i,r){if(lt(i))return;const{profiler:n,context:s}=e;for(const o of this.brushes){if(n.recordBrushStart(o.name),ve(o.brushEffect)){const a=s.getViewport(),l=s.getBoundFramebufferObject(),c=e.passOptions;this._bindEffect(e,o.brushEffect),this._drawWithBrush(o,e,i,r),this._drawAndUnbindEffect(e,o.brushEffect,a,l,c)}else this._drawWithBrush(o,e,i,r);n.recordBrushEnd()}}_drawWithBrush(e,i,r,n){nVe(r)?(e.prepareState(i,n),e.drawMany(i,r,n)):r.visible&&(e.prepareState(i,n),e.draw(i,r,n))}_bindEffect(e,i,r){const{profiler:n}=e;n.recordPassStart(this.name+"."+i.name),i.bind(e,r);const s=i.createOptions(e,r);e.passOptions=s}_drawAndUnbindEffect(e,i,r,n,s,o){const{profiler:a,context:l}=e;e.passOptions=s,a.recordBrushStart(i.name),i.draw(e,o),i.unbind(e,o),l.bindFramebuffer(n);const{x:c,y:h,width:p,height:y}=r;l.setViewport(c,h,p,y),a.recordBrushEnd(),a.recordPassEnd()}};function ftr(t,e){switch(t){case Ln.LINE:return ph.line;case Ln.TEXT:return ph.text;case Ln.LABEL:return ph.label;case Ln.FILL:return e===sa.DOT_DENSITY?ph.dotDensity:ph.fill;case Ln.MARKER:switch(e){case sa.HEATMAP:return ph.heatmap;case sa.PIE_CHART:return ph.pieChart;default:return ph.marker}}}let mtr=class{constructor(e,i,r){this.context=e,this._blitRenderer=new cIt,this._worldExtentClipRenderer=new Ver,this._isClippedToWorldExtent=!1,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._prevFBO=null,this._vtlMaterialManager=new aer,this._blendEffect=new Uer,this._stencilBuf=null,this._fbos=null,this._fboPool=[],this._renderTarget=null,this.effects={highlight:new Yer,hittest:new Xer,hittestVTL:new Ker,integrate:new jer,insideEffect:new wIt("inside"),outsideEffect:new wIt("outside")},this.materialManager=new per(e),this.textureManager=new Ner(i,r,e.type===bo.WEBGL2),this.textureUploadManager=new ker(e,i),this._effectsManager=new dtr}get vectorTilesMaterialManager(){return this._vtlMaterialManager}getRenderTarget(){return this._renderTarget}setRenderTarget(e){this._renderTarget=e}getFbos(e,i){if(e!==this._lastWidth||i!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=i,this._fbos){for(const o in this._fbos)this._fbos[o].resize(e,i);return this._fbos}const r={target:so.TEXTURE_2D,pixelFormat:gn.RGBA,dataType:ds.UNSIGNED_BYTE,samplingMode:In.NEAREST,wrapMode:ws.CLAMP_TO_EDGE,width:e,height:i},n={colorTarget:Ah.TEXTURE,depthStencilTarget:Tl.DEPTH_STENCIL_RENDER_BUFFER},s=new vO(this.context,{width:e,height:i,internalFormat:xg.DEPTH_STENCIL});this._stencilBuf=s,this._fbos={output:new ad(this.context,n,r,s),blend:new ad(this.context,n,r,s),effect0:new ad(this.context,n,r,s)}}return this._fbos}acquireFbo(e,i){let r;r=this._fboPool.length>0?this._fboPool.pop():new ad(this.context,{colorTarget:Ah.TEXTURE,depthStencilTarget:Tl.DEPTH_STENCIL_RENDER_BUFFER},{target:so.TEXTURE_2D,pixelFormat:gn.RGBA,dataType:ds.UNSIGNED_BYTE,samplingMode:In.NEAREST,wrapMode:ws.CLAMP_TO_EDGE,width:e,height:i},this._stencilBuf);const n=r.descriptor;return n.width===e&&n.height===i||r.resize(e,i),r}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderLayers(e,i=null){const{width:r,height:n}=e.getViewport();this._prevFBO=e.getBoundFramebufferObject();const s=this.getFbos(r,n);if(e.bindFramebuffer(s?.output),e.setColorMask(!0,!0,!0,!0),ve(i)){const{r:o,g:a,b:l,a:c}=i.color;e.setClearColor(c*o/255,c*a/255,c*l/255,c)}else e.setClearColor(0,0,0,0);e.setDepthWriteEnabled(!0),e.setClearDepth(1),e.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT),e.setDepthWriteEnabled(!1)}beforeRenderLayer(e,i,r){const{context:n,blendMode:s,effects:o,requireFBO:a,drawPhase:l}=e;if(a||SIt(l,s,o,r))n.bindFramebuffer(this._fbos?.blend),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);else{const c=this._getOutputFBO();n.bindFramebuffer(c)}n.setDepthWriteEnabled(!1),n.setDepthTestEnabled(!1),n.setStencilTestEnabled(!0),n.setClearStencil(i),n.setStencilWriteMask(255),n.clear(n.gl.STENCIL_BUFFER_BIT)}compositeLayer(e,i){const{context:r,blendMode:n,effects:s,requireFBO:o,drawPhase:a}=e;if(o||SIt(a,n,s,i)){ve(s)&&s.length>0&&a===mo.MAP&&this._applyEffects(e,s);const l=this._getOutputFBO();r.bindFramebuffer(l),r.setStencilTestEnabled(!1),r.setStencilWriteMask(0),r.setBlendingEnabled(!0),r.setBlendFunctionSeparate(Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA,Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA),r.setColorMask(!0,!0,!0,!0);const c=lt(n)||a===mo.HIGHLIGHT?"normal":n,h=this._fbos;h?.blend.colorTexture&&this._blendEffect.draw(e,h.blend.colorTexture,In.NEAREST,c,i)}}renderLayers(e){e.bindFramebuffer(this._prevFBO);const i=this._getOutputFBO();i&&(e.setDepthTestEnabled(!1),e.setStencilWriteMask(0),this._isClippedToWorldExtent?(e.setStencilTestEnabled(!0),e.setStencilFunction(kl.EQUAL,1,255)):e.setStencilTestEnabled(!1),this.blitTexture(e,i.colorTexture,In.NEAREST))}prepareDisplay(e,i,r){const{context:n}=e;if(n.bindFramebuffer(this._prevFBO),n.setColorMask(!0,!0,!0,!0),ve(i)){const{r:s,g:o,b:a,a:l}=i.color;n.setClearColor(l*s/255,l*o/255,l*a/255,l)}else n.setClearColor(0,0,0,0);n.setStencilWriteMask(255),n.setClearStencil(0),n.clear(n.gl.COLOR_BUFFER_BIT|n.gl.STENCIL_BUFFER_BIT),this._isClippedToWorldExtent=this._worldExtentClipRenderer.render(e,r)}dispose(){if(this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=qa(this._blitRenderer),this._worldExtentClipRenderer=qa(this._worldExtentClipRenderer),this._brushCache&&(this._brushCache.forEach(e=>e.dispose()),this._brushCache.clear(),this._brushCache=null),this._fbos)for(const 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)for(const e in this.effects)this.effects[e]&&this.effects[e].dispose();this._effectsManager.dispose(),this._vtlMaterialManager=qa(this._vtlMaterialManager),this._prevFBO=null}getBrush(e,i){const r=ftr(e,i);let n=this._brushCache.get(r);return n===void 0&&(n=new r,this._brushCache.set(r,n)),n}renderObject(e,i,r,n){const s=ph[r];if(!s)return;let o=this._brushCache.get(s);o===void 0&&(o=new s,this._brushCache.set(s,o)),o.prepareState(e,n),o.draw(e,i,n)}renderObjects(e,i,r,n){const s=ph[r];if(!s)return;let o=this._brushCache.get(s);o===void 0&&(o=new s,this._brushCache.set(s,o)),o.drawMany(e,i,n)}registerRenderPass(e){const i=e.brushes.map(r=>(this._brushCache.has(r)||this._brushCache.set(r,new r),this._brushCache.get(r)));return new ptr(i,e)}blitTexture(e,i,r,n=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA,Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,i,r,n)}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}_getOutputFBO(){return this._renderTarget!=null?this._renderTarget:this._fbos?.output??null}_applyEffects(e,i){const r=this._fbos?.blend;if(!r)return;const{context:n}=e,s=this._effectsManager.getPostProcessingEffects(i);for(const{postProcessingEffect:o,effect:a}of s)n.bindFramebuffer(r),o.draw(e,r,a)}};function SIt(t,e,i,r){return t!==mo.HIGHLIGHT&&(r!==1||ve(e)&&e!=="normal"||ve(i)&&i.length>0)}function jE(t){return window.WebGL2RenderingContext&&t instanceof window.WebGL2RenderingContext}let CIt=class{constructor(e,i,r,n,s,o,a,l,c){this.createQuery=e,this.deleteQuery=i,this.resultAvailable=r,this.getResult=n,this.disjoint=s,this.beginTimeElapsed=o,this.endTimeElapsed=a,this.createTimestamp=l,this.timestampBits=c}},OF=!1;function TIt(t,e){if(e.disjointTimerQuery)return null;let i=t.getExtension("EXT_disjoint_timer_query_webgl2");return i&&jE(t)?new CIt(()=>t.createQuery(),r=>{t.deleteQuery(r),OF=!1},r=>t.getQueryParameter(r,t.QUERY_RESULT_AVAILABLE),r=>t.getQueryParameter(r,t.QUERY_RESULT),()=>t.getParameter(i.GPU_DISJOINT_EXT),r=>{OF||(OF=!0,t.beginQuery(i.TIME_ELAPSED_EXT,r))},()=>{t.endQuery(i.TIME_ELAPSED_EXT),OF=!1},r=>i.queryCounterEXT(r,i.TIMESTAMP_EXT),()=>t.getQuery(i.TIMESTAMP_EXT,i.QUERY_COUNTER_BITS_EXT)):(i=t.getExtension("EXT_disjoint_timer_query"),i?new CIt(()=>i.createQueryEXT(),r=>{i.deleteQueryEXT(r),OF=!1},r=>i.getQueryObjectEXT(r,i.QUERY_RESULT_AVAILABLE_EXT),r=>i.getQueryObjectEXT(r,i.QUERY_RESULT_EXT),()=>t.getParameter(i.GPU_DISJOINT_EXT),r=>{OF||(OF=!0,i.beginQueryEXT(i.TIME_ELAPSED_EXT,r))},()=>{i.endQueryEXT(i.TIME_ELAPSED_EXT),OF=!1},r=>i.queryCounterEXT(r,i.TIMESTAMP_EXT),()=>i.getQueryEXT(i.TIMESTAMP_EXT,i.QUERY_COUNTER_BITS_EXT)):null)}const IS=Hi("esri-2d-profiler");let gtr=class{constructor(e,i){if(this._events=new md,this._entries=new Map,this._timings=new GD(10),this._currentContainer=null,this._currentPass=null,this._currentBrush=null,this._currentSummary=null,!IS)return;this._ext=TIt(e.gl,{}),this._debugOutput=i;const r=e.gl;if(this.enableCommandLogging){for(const 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 IS=="object"&&IS.disableCommands)}recordContainerStart(e){IS&&(this._currentContainer=e)}recordContainerEnd(){IS&&(this._currentContainer=null)}recordPassStart(e){IS&&(this._currentPass=e,this._initSummary())}recordPassEnd(){IS&&(this._currentPass=null,this._emitSummary())}recordBrushStart(e){IS&&(this._currentBrush=e)}recordBrushEnd(){IS&&(this._currentBrush=null)}recordStart(e){if(IS&&ve(this._ext)){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(ve(this._timings.enqueue(o))){const h=this._timings.entries,p=h.length;let y=0;for(const v of h)y+=v;a=y/p}const l=o.toFixed(2),c=a?a.toFixed(2):"--";this.enableCommandLogging?(console.groupCollapsed(`Frame report for ${e}, ${l} ms (${c} 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 (${c} last 10 avg)`),this._debugOutput.innerHTML=`${l} (${c})`}for(const o of r.handles)o.remove();this._ext.deleteQuery(r.query),this._entries.delete(e)}const i={name:e,query:this._ext.createQuery(),commands:[],commandsLen:0,drawCommands:0,summaries:[],handles:[]};this.enableCommandLogging&&(i.handles.push(this._events.on("command",r=>{i.commandsLen++,i.commands.push(r),r.isDrawCommand&&i.drawCommands++})),i.handles.push(this._events.on("summary",r=>{i.summaries.push(r)}))),this._ext.beginTimeElapsed(i.query),this._entries.set(e,i)}}recordEnd(e){IS&&ve(this._ext)&&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)}},EIt=class{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:Sn.ONE,dstRGB:Sn.ZERO,srcAlpha:Sn.ONE,dstAlpha:Sn.ZERO},this.blendEquation={mode:FD.ADD,modeAlpha:FD.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=Jw.BACK,this.frontFace=sG.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=kl.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:Jw.FRONT_AND_BACK,func:kl.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:Jw.FRONT_AND_BACK,fail:nu.KEEP,zFail:nu.KEEP,zPass:nu.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.uniformBufferBindingPoints=new Array,this.readFramebuffer=null,this.drawFramebuffer=null,this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array,this.vertexArrayObject=null}},ytr=class{constructor(e){this._allocations=new Map,e?Error.stackTraceLimit=1/0:(this.add=()=>{},this.remove=()=>{})}add(e){this._allocations.set(e,new Error().stack)}remove(e){this._allocations.delete(e)}get information(){let e="";if(this._allocations.size>0){e+=`${this._allocations.size} live object allocations: `;const i=new Map;this._allocations.forEach(r=>{i.set(r,(i.get(r)??0)+1)}),i.forEach((r,n)=>{const s=n.split(` `);s.shift(),s.shift(),e+=`${r}: ${s.shift()} `,s.forEach(o=>e+=` ${o} -`)})}return e}};const fer={RECORD_ALLOCATIONS:!1};let mer=class{constructor(){for(this._current=new Array,this._max=new Array,this._allocations=new per(fer.RECORD_ALLOCATIONS);this._current.lengthe+i,0)}get resourceInformation(){let e="";if(this.total>0){e+=`Live objects: -`;for(let i=0;i0&&(e+=`${gf[i]}: ${r} -`)}}return e+=this._allocations.information,e}};var cx,P6,GEt,LQ,GE,L5e,kQ,VEt,Hp,UEt,_O;(function(t){t[t.None=0]="None",t[t.Front=1]="Front",t[t.Back=2]="Back",t[t.COUNT=3]="COUNT"})(cx||(cx={})),function(t){t[t.Less=0]="Less",t[t.Lequal=1]="Lequal",t[t.COUNT=2]="COUNT"}(P6||(P6={})),function(t){t[t.BACKGROUND=0]="BACKGROUND",t[t.UPDATE=1]="UPDATE"}(GEt||(GEt={})),function(t){t[t.NOT_LOADED=0]="NOT_LOADED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED"}(LQ||(LQ={})),function(t){t[t.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",t[t.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(GE||(GE={})),function(t){t[t.Highlight=0]="Highlight",t[t.MaskOccludee=1]="MaskOccludee",t[t.COUNT=2]="COUNT"}(L5e||(L5e={})),function(t){t[t.STRETCH=1]="STRETCH",t[t.PAD=2]="PAD"}(kQ||(kQ={})),function(t){t[t.CHANGED=0]="CHANGED",t[t.UNCHANGED=1]="UNCHANGED"}(VEt||(VEt={})),function(t){t[t.Blend=0]="Blend",t[t.Opaque=1]="Opaque",t[t.Mask=2]="Mask",t[t.MaskBlend=3]="MaskBlend",t[t.COUNT=4]="COUNT"}(Hp||(Hp={})),function(t){t[t.OFF=0]="OFF",t[t.ON=1]="ON"}(UEt||(UEt={})),function(t){t.DDS_ENCODING="image/vnd-ms.dds",t.KTX2_ENCODING="image/ktx2",t.BASIS_ENCODING="image/x.basis"}(_O||(_O={}));function jEt(t,e,i=RD.ADD,r=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:r[0],g:r[1],b:r[2],a:r[3]}}}function ger(t,e,i,r,n=RD.ADD,s=RD.ADD,o=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:r,opRgb:n,opAlpha:s,color:{r:o[0],g:o[1],b:o[2],a:o[3]}}}const yer={face:Xw.BACK,mode:JV.CCW},ver={face:Xw.FRONT,mode:JV.CCW},_er=t=>t===cx.Back?yer:t===cx.Front?ver:null,ber={zNear:0,zFar:1},k5e={r:!0,g:!0,b:!0,a:!0};function wer(t){return Per.intern(t)}function xer(t){return Oer.intern(t)}function Ser(t){return Rer.intern(t)}function Cer(t){return Mer.intern(t)}function Ter(t){return Der.intern(t)}function Eer(t){return Fer.intern(t)}function Ier(t){return Ler.intern(t)}function Aer(t){return ker.intern(t)}function Ime(t){return Ner.intern(t)}let bO=class{constructor(e,i){this._makeKey=e,this._makeRef=i,this._interns=new Map}intern(e){if(!e)return null;const i=this._makeKey(e),r=this._interns;return r.has(i)||r.set(i,this._makeRef(e)),r.get(i)??null}};function wO(t){return"["+t.join(",")+"]"}const Per=new bO(zEt,t=>({__tag:"Blending",...t}));function zEt(t){return t?wO([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const Oer=new bO(HEt,t=>({__tag:"Culling",...t}));function HEt(t){return t?wO([t.face,t.mode]):null}const Rer=new bO(WEt,t=>({__tag:"PolygonOffset",...t}));function WEt(t){return t?wO([t.factor,t.units]):null}const Mer=new bO(qEt,t=>({__tag:"DepthTest",...t}));function qEt(t){return t?wO([t.func]):null}const Der=new bO(YEt,t=>({__tag:"StencilTest",...t}));function YEt(t){return t?wO([t.function.func,t.function.ref,t.function.mask,t.operation.fail,t.operation.zFail,t.operation.zPass]):null}const Fer=new bO(XEt,t=>({__tag:"DepthWrite",...t}));function XEt(t){return t?wO([t.zNear,t.zFar]):null}const Ler=new bO(KEt,t=>({__tag:"ColorWrite",...t}));function KEt(t){return t?wO([t.r,t.g,t.b,t.a]):null}const ker=new bO(JEt,t=>({__tag:"StencilWrite",...t}));function JEt(t){return t?wO([t.mask]):null}const Ner=new bO($er,t=>({blending:wer(t.blending),culling:xer(t.culling),polygonOffset:Ser(t.polygonOffset),depthTest:Cer(t.depthTest),stencilTest:Ter(t.stencilTest),depthWrite:Eer(t.depthWrite),colorWrite:Ier(t.colorWrite),stencilWrite:Aer(t.stencilWrite)}));function $er(t){return t?wO([zEt(t.blending),HEt(t.culling),WEt(t.polygonOffset),qEt(t.depthTest),YEt(t.stencilTest),XEt(t.depthWrite),KEt(t.colorWrite),JEt(t.stencilWrite)]):null}let Ber=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._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._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}_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}_setSubState(e,i,r,n){return(r||e!==i)&&(n(e),this._pipelineInvalid=!0),e}};const Ame=class{};function Ii(t,...e){let i="";for(let r=0;re+i,0)}get resourceInformation(){let e="";if(this.total>0){e+=`Live objects: +`;for(let i=0;i0&&(e+=`${bf[i]}: ${r} +`)}}return e+=this._allocations.information,e}};var dx,R6,IIt,VQ,GE,rNe,jQ,AIt,Kp,PIt,xO;(function(t){t[t.None=0]="None",t[t.Front=1]="Front",t[t.Back=2]="Back",t[t.COUNT=3]="COUNT"})(dx||(dx={})),function(t){t[t.Less=0]="Less",t[t.Lequal=1]="Lequal",t[t.COUNT=2]="COUNT"}(R6||(R6={})),function(t){t[t.BACKGROUND=0]="BACKGROUND",t[t.UPDATE=1]="UPDATE"}(IIt||(IIt={})),function(t){t[t.NOT_LOADED=0]="NOT_LOADED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED"}(VQ||(VQ={})),function(t){t[t.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",t[t.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(GE||(GE={})),function(t){t[t.Highlight=0]="Highlight",t[t.MaskOccludee=1]="MaskOccludee",t[t.COUNT=2]="COUNT"}(rNe||(rNe={})),function(t){t[t.STRETCH=1]="STRETCH",t[t.PAD=2]="PAD"}(jQ||(jQ={})),function(t){t[t.CHANGED=0]="CHANGED",t[t.UNCHANGED=1]="UNCHANGED"}(AIt||(AIt={})),function(t){t[t.Blend=0]="Blend",t[t.Opaque=1]="Opaque",t[t.Mask=2]="Mask",t[t.MaskBlend=3]="MaskBlend",t[t.COUNT=4]="COUNT"}(Kp||(Kp={})),function(t){t[t.OFF=0]="OFF",t[t.ON=1]="ON"}(PIt||(PIt={})),function(t){t.DDS_ENCODING="image/vnd-ms.dds",t.KTX2_ENCODING="image/ktx2",t.BASIS_ENCODING="image/x.basis"}(xO||(xO={}));function OIt(t,e,i=FD.ADD,r=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:r[0],g:r[1],b:r[2],a:r[3]}}}function btr(t,e,i,r,n=FD.ADD,s=FD.ADD,o=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:r,opRgb:n,opAlpha:s,color:{r:o[0],g:o[1],b:o[2],a:o[3]}}}const wtr={face:Jw.BACK,mode:sG.CCW},xtr={face:Jw.FRONT,mode:sG.CCW},Str=t=>t===dx.Back?wtr:t===dx.Front?xtr:null,Ctr={zNear:0,zFar:1},nNe={r:!0,g:!0,b:!0,a:!0};function Ttr(t){return Dtr.intern(t)}function Etr(t){return Ftr.intern(t)}function Itr(t){return Ltr.intern(t)}function Atr(t){return Ntr.intern(t)}function Ptr(t){return ktr.intern(t)}function Otr(t){return $tr.intern(t)}function Rtr(t){return Btr.intern(t)}function Mtr(t){return Vtr.intern(t)}function Zme(t){return jtr.intern(t)}let SO=class{constructor(e,i){this._makeKey=e,this._makeRef=i,this._interns=new Map}intern(e){if(!e)return null;const i=this._makeKey(e),r=this._interns;return r.has(i)||r.set(i,this._makeRef(e)),r.get(i)??null}};function CO(t){return"["+t.join(",")+"]"}const Dtr=new SO(RIt,t=>({__tag:"Blending",...t}));function RIt(t){return t?CO([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const Ftr=new SO(MIt,t=>({__tag:"Culling",...t}));function MIt(t){return t?CO([t.face,t.mode]):null}const Ltr=new SO(DIt,t=>({__tag:"PolygonOffset",...t}));function DIt(t){return t?CO([t.factor,t.units]):null}const Ntr=new SO(FIt,t=>({__tag:"DepthTest",...t}));function FIt(t){return t?CO([t.func]):null}const ktr=new SO(LIt,t=>({__tag:"StencilTest",...t}));function LIt(t){return t?CO([t.function.func,t.function.ref,t.function.mask,t.operation.fail,t.operation.zFail,t.operation.zPass]):null}const $tr=new SO(NIt,t=>({__tag:"DepthWrite",...t}));function NIt(t){return t?CO([t.zNear,t.zFar]):null}const Btr=new SO(kIt,t=>({__tag:"ColorWrite",...t}));function kIt(t){return t?CO([t.r,t.g,t.b,t.a]):null}const Vtr=new SO($It,t=>({__tag:"StencilWrite",...t}));function $It(t){return t?CO([t.mask]):null}const jtr=new SO(Gtr,t=>({blending:Ttr(t.blending),culling:Etr(t.culling),polygonOffset:Itr(t.polygonOffset),depthTest:Atr(t.depthTest),stencilTest:Ptr(t.stencilTest),depthWrite:Otr(t.depthWrite),colorWrite:Rtr(t.colorWrite),stencilWrite:Mtr(t.stencilWrite)}));function Gtr(t){return t?CO([RIt(t.blending),MIt(t.culling),DIt(t.polygonOffset),FIt(t.depthTest),LIt(t.stencilTest),NIt(t.depthWrite),kIt(t.colorWrite),$It(t.stencilWrite)]):null}let Utr=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._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._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}_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}_setSubState(e,i,r,n){return(r||e!==i)&&(n(e),this._pipelineInvalid=!0),e}};const Qme=class{};function Ri(t,...e){let i="";for(let r=0;r5)}_runProgram(e){const i=this._rctx;i.resetState();const r=new id(i,{colorTarget:Th.TEXTURE,depthStencilTarget:gl.NONE},{target:Ws.TEXTURE_2D,wrapMode:us.CLAMP_TO_EDGE,pixelFormat:nn.RGBA,dataType:ts.UNSIGNED_BYTE,samplingMode:mn.NEAREST,width:1,height:1}),n=Ko.createVertex(i,Lo.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),s=new Ac(i,new Map([["position",0]]),{geometry:[new qo("position",2,Di.UNSIGNED_SHORT,0,4)]},{geometry:n}),o=Ma(5633261287538229e-9,2626832878767164e-9,1.4349880495278358e6),a=Ma(563327146742708e-8,2.6268736381334523e6,1434963231608387e-9),l=new Float32Array(6);ZEt(o,l,3);const c=new Float32Array(6);ZEt(a,c,3),i.useProgram(e),e.setUniform3f("u_highA",l[0],l[2],l[4]),e.setUniform3f("u_lowA",l[1],l[3],l[5]),e.setUniform3f("u_highB",c[0],c[2],c[4]),e.setUniform3f("u_lowB",c[1],c[3],c[5]),i.bindFramebuffer(r),i.setViewport(0,0,1,1),i.bindVAO(s),i.drawArrays(ls.TRIANGLE_STRIP,0,4);const d=new Uint8Array(4);r.readPixels(0,0,1,1,nn.RGBA,ts.UNSIGNED_BYTE,d),s.dispose(!1),n.dispose(),r.dispose();const p=(o[2]-a[2])/25,y=$St(d);return Math.abs(p-y)}};function QEt(t,e){const i=` + }`;return this._rctx.programCache.acquire(e,i,new Map([]))}};function BIt(t,e,i){for(let r=0;r5)}_runProgram(e){const i=this._rctx;i.resetState();const r=new ad(i,{colorTarget:Ah.TEXTURE,depthStencilTarget:Tl.NONE},{target:so.TEXTURE_2D,wrapMode:ws.CLAMP_TO_EDGE,pixelFormat:gn.RGBA,dataType:ds.UNSIGNED_BYTE,samplingMode:In.NEAREST,width:1,height:1}),n=aa.createVertex(i,Xo.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),s=new Mc(i,new Map([["position",0]]),{geometry:[new na("position",2,Bi.UNSIGNED_SHORT,0,4)]},{geometry:n}),o=ja(5633261287538229e-9,2626832878767164e-9,1.4349880495278358e6),a=ja(563327146742708e-8,2.6268736381334523e6,1434963231608387e-9),l=new Float32Array(6);BIt(o,l,3);const c=new Float32Array(6);BIt(a,c,3),i.useProgram(e),e.setUniform3f("u_highA",l[0],l[2],l[4]),e.setUniform3f("u_lowA",l[1],l[3],l[5]),e.setUniform3f("u_highB",c[0],c[2],c[4]),e.setUniform3f("u_lowB",c[1],c[3],c[5]),i.bindFramebuffer(r),i.setViewport(0,0,1,1),i.bindVAO(s),i.drawArrays(bs.TRIANGLE_STRIP,0,4);const h=new Uint8Array(4);r.readPixels(0,0,1,1,gn.RGBA,ds.UNSIGNED_BYTE,h),s.dispose(!1),n.dispose(),r.dispose();const p=(o[2]-a[2])/25,y=TCt(h);return Math.abs(p-y)}};function VIt(t,e){const i=` precision highp float; @@ -4948,7 +4952,7 @@ ${r.commandsLen} Commands (${r.drawCommands} draw)`),console.log("RenderPass bre void main() { gl_FragColor = v_color; } - `;return t.programCache.acquire(i,r,new Map([["position",0]]))}var hx;(function(t){t[t.Color=0]="Color",t[t.Alpha=1]="Alpha",t[t.FrontFace=2]="FrontFace",t[t.NONE=3]="NONE",t[t.COUNT=4]="COUNT"})(hx||(hx={}));const zer=ger(cn.SRC_ALPHA,cn.ONE,cn.ONE_MINUS_SRC_ALPHA,cn.ONE_MINUS_SRC_ALPHA),Her=jEt(cn.ONE,cn.ONE),eIt=jEt(cn.ZERO,cn.ONE_MINUS_SRC_ALPHA);function Wer(t){return t===hx.FrontFace?null:t===hx.Alpha?eIt:Her}const qer=5e5,Yer={factor:-1,units:-2};function Xer(t){return t?Yer:null}function Ker(t,e=El.LESS){return t===hx.NONE||t===hx.FrontFace?e:El.LEQUAL}var tIt,iIt,N5e={},Jer={get exports(){return N5e},set exports(t){N5e=t}};tIt=Jer,(iIt=function(){var t=function(I){window.console&&window.console.log&&window.console.log(I)},e=function(I){window.console&&window.console.error?window.console.error(I):t(I)},i={enable:{1:{0:!0}},disable:{1:{0:!0}},getParameter:{1:{0:!0}},drawArrays:{3:{0:!0}},drawElements:{4:{0:!0,2:!0}},createShader:{1:{0:!0}},getShaderParameter:{2:{1:!0}},getProgramParameter:{2:{1:!0}},getShaderPrecisionFormat:{2:{0:!0,1:!0}},getVertexAttrib:{2:{1:!0}},vertexAttribPointer:{6:{2:!0}},bindTexture:{2:{0:!0}},activeTexture:{1:{0:!0}},getTexParameter:{2:{0:!0,1:!0}},texParameterf:{3:{0:!0,1:!0}},texParameteri:{3:{0:!0,1:!0,2:!0}},texImage2D:{9:{0:!0,2:!0,6:!0,7:!0},6:{0:!0,2:!0,3:!0,4:!0}},texSubImage2D:{9:{0:!0,6:!0,7:!0},7:{0:!0,4:!0,5:!0}},copyTexImage2D:{8:{0:!0,2:!0}},copyTexSubImage2D:{8:{0:!0}},generateMipmap:{1:{0:!0}},compressedTexImage2D:{7:{0:!0,2:!0}},compressedTexSubImage2D:{8:{0:!0,6:!0}},bindBuffer:{2:{0:!0}},bufferData:{3:{0:!0,2:!0}},bufferSubData:{3:{0:!0}},getBufferParameter:{2:{0:!0,1:!0}},pixelStorei:{2:{0:!0,1:!0}},readPixels:{7:{4:!0,5:!0}},bindRenderbuffer:{2:{0:!0}},bindFramebuffer:{2:{0:!0}},checkFramebufferStatus:{1:{0:!0}},framebufferRenderbuffer:{4:{0:!0,1:!0,2:!0}},framebufferTexture2D:{5:{0:!0,1:!0,2:!0}},getFramebufferAttachmentParameter:{3:{0:!0,1:!0,2:!0}},getRenderbufferParameter:{2:{0:!0,1:!0}},renderbufferStorage:{4:{0:!0,1:!0}},clear:{1:{0:{enumBitwiseOr:["COLOR_BUFFER_BIT","DEPTH_BUFFER_BIT","STENCIL_BUFFER_BIT"]}}},depthFunc:{1:{0:!0}},blendFunc:{2:{0:!0,1:!0}},blendFuncSeparate:{4:{0:!0,1:!0,2:!0,3:!0}},blendEquation:{1:{0:!0}},blendEquationSeparate:{2:{0:!0,1:!0}},stencilFunc:{3:{0:!0}},stencilFuncSeparate:{4:{0:!0,1:!0}},stencilMaskSeparate:{2:{0:!0}},stencilOp:{3:{0:!0,1:!0,2:!0}},stencilOpSeparate:{4:{0:!0,1:!0,2:!0,3:!0}},cullFace:{1:{0:!0}},frontFace:{1:{0:!0}},drawArraysInstancedANGLE:{4:{0:!0}},drawElementsInstancedANGLE:{5:{0:!0,2:!0}},blendEquationEXT:{1:{0:!0}}},r=null,n=null;function s(I){if(r==null)for(var O in r={},n={},I)typeof I[O]=="number"&&(r[I[O]]=O,n[O]=I[O])}function o(){if(r==null)throw"WebGLDebugUtils.init(ctx) not called"}function a(I){return o(),r[I]!==void 0}function l(I){o();var O=r[I];return O!==void 0?"gl."+O:"/*UNKNOWN WebGL ENUM*/ 0x"+I.toString(16)}function c(I,O,L,N){var G;if((G=i[I])!==void 0&&(G=G[O])!==void 0&&G[L]){if(typeof G[L]=="object"&&G[L].enumBitwiseOr!==void 0){for(var V=G[L].enumBitwiseOr,Y=0,X=[],te=0;te=0&&setTimeout(function(){I.restoreContext()},_e)},0)}},I.restoreContext=function(){X&&G.length&&setTimeout(function(){if(!ge)throw"can not restore. webglcontestlost listener did not call event.preventDefault";Ae(),v(O),X=!1,fe=0,ge=!1;for(var Je=G.slice(),et=ze("context restored"),tt=0;tt=0&&setTimeout(function(){I.restoreContext()},_e)},0)}},I.restoreContext=function(){X&&j.length&&setTimeout(function(){if(!he)throw"can not restore. webglcontestlost listener did not call event.preventDefault";Oe(),v(P),X=!1,ce=0,he=!1;for(var qe=j.slice(),et=Ge("context restored"),Ze=0;Zei.loseContext()}:null}function dtr(t,e){if(BE(t))return{createVertexArray:t.createVertexArray.bind(t),deleteVertexArray:t.deleteVertexArray.bind(t),bindVertexArray:t.bindVertexArray.bind(t)};if(e.vao)return null;const i=t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object");return i?{createVertexArray:i.createVertexArrayOES.bind(i),deleteVertexArray:i.deleteVertexArrayOES.bind(i),bindVertexArray:i.bindVertexArrayOES.bind(i)}:null}let ptr=class{constructor(e,i){this._gl=e,this._instancing=null,this._vertexArrayObject=null,this._compressedTextureETC=null,this._compressedTextureS3TC=null,this._textureFilterAnisotropic=null,this._textureFloat=null,this._colorBufferFloat=null,this._minMaxBlending=null,this._loseContext=null,this._drawBuffers=null,this._textureNorm16=null,this._depthTexture=null,this._standardDerivatives=null,this._shaderTextureLOD=null,this._fragDepth=null,this._textureFloatLinear=null,this._disabledExtensions=i.disabledExtensions||{},this._debugWebGLExtensions=i.debugWebGLExtensions||{}}get drawBuffers(){return this._drawBuffers||(this._drawBuffers=itr(this._gl,this._disabledExtensions)),this._drawBuffers}get instancing(){return this._instancing||(this._instancing=rtr(this._gl)),this._instancing}get vao(){return this._vertexArrayObject||(this._vertexArrayObject=dtr(this._gl,this._disabledExtensions)),this._vertexArrayObject}get compressedTextureETC(){return this._compressedTextureETC||(this._compressedTextureETC=ntr(this._gl,this._disabledExtensions)),this._compressedTextureETC}get compressedTextureS3TC(){return this._compressedTextureS3TC||(this._compressedTextureS3TC=str(this._gl,this._disabledExtensions)),this._compressedTextureS3TC}get textureFilterAnisotropic(){return this._textureFilterAnisotropic||(this._textureFilterAnisotropic=atr(this._gl,this._disabledExtensions)),this._textureFilterAnisotropic}get disjointTimerQuery(){return this._disjointTimerQuery||(this._disjointTimerQuery=$Et(this._gl,this._disabledExtensions)),this._disjointTimerQuery}get textureFloat(){return this._textureFloat||(this._textureFloat=ltr(this._gl,this._disabledExtensions)),this._textureFloat}get colorBufferFloat(){return this._colorBufferFloat||(this._colorBufferFloat=utr(this._gl,this._disabledExtensions)),this._colorBufferFloat}get blendMinMax(){return this._minMaxBlending||(this._minMaxBlending=otr(this._gl,this._disabledExtensions)),this._minMaxBlending}get depthTexture(){return this._depthTexture===null&&(this._depthTexture=$Q(this._gl,this._disabledExtensions,"depthTexture",!0,["WEBGL_depth_texture","MOZ_WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"])),this._depthTexture}get standardDerivatives(){return this._standardDerivatives===null&&(this._standardDerivatives=$Q(this._gl,this._disabledExtensions,"standardDerivatives",!0,["OES_standard_derivatives"])),this._standardDerivatives}get shaderTextureLOD(){return this._shaderTextureLOD===null&&(this._shaderTextureLOD=$Q(this._gl,this._disabledExtensions,"shaderTextureLOD",!0,["EXT_shader_texture_lod"])),this._shaderTextureLOD}get fragDepth(){return this._fragDepth===null&&(this._fragDepth=$Q(this._gl,this._disabledExtensions,"fragDepth",!0,["EXT_frag_depth"])),this._fragDepth}get loseContext(){return this._loseContext||(this._loseContext=htr(this._gl,this._debugWebGLExtensions)),this._loseContext}get textureNorm16(){return this._textureNorm16||(this._textureNorm16=ctr(this._gl,this._disabledExtensions)),this._textureNorm16}get textureFloatLinear(){return this._textureFloatLinear===null&&(this._textureFloatLinear=$Q(this._gl,this._disabledExtensions,"textureFloatLinear",!1,["OES_texture_float_linear"])),this._textureFloatLinear}enable(e){return this[e]}},rIt=class{constructor(e,i){this.gl=e,this.instanceCounter=new mer,this.programCache=new ITt(this),this._state=new BEt,this._numOfDrawCalls=0,this._numOfTriangles=0,this.type=BE(e)?lo.WEBGL2:lo.WEBGL1,this._loadExtensions(),this.configure(i)}get gl2(){return this.type===lo.WEBGL1?null:this.gl}configure(e){this._capabilities=new ptr(this.gl,e),this._parameters=this._loadParameters(e);const i=this.gl.getParameter(this.gl.VIEWPORT);this._state=new BEt,this._state.viewport={x:i[0],y:i[1],width:i[2],height:i[3]},this._stateTracker=new Ber({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)}}),this.enforceState(),Ba(this._driverTest),this._driverTest=new ttr(this)}dispose(){Ba(this._driverTest),this.programCache.dispose(),this.bindVAO(null),this.unbindBuffer(to.ARRAY_BUFFER),this.unbindBuffer(to.ELEMENT_ARRAY_BUFFER),this.type===lo.WEBGL2&&(this.unbindBuffer(to.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(to.PIXEL_PACK_BUFFER),this.unbindBuffer(to.PIXEL_UNPACK_BUFFER),this.unbindBuffer(to.COPY_READ_BUFFER),this.unbindBuffer(to.COPY_WRITE_BUFFER)),this._state.textureUnitMap.length=0,xb()&&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,i){for(let r=0;r=0&&(this._state.activeTexture=i)}externalVertexArrayObjectUpdate(){const e=this.capabilities.vao;e&&(e.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,i,r,n){e===this._state.blendColor.r&&i===this._state.blendColor.g&&r===this._state.blendColor.b&&n===this._state.blendColor.a||(this.gl.blendColor(e,i,r,n),this._state.blendColor.r=e,this._state.blendColor.g=i,this._state.blendColor.b=r,this._state.blendColor.a=n,this._stateTracker.invalidateBlending())}setBlendFunction(e,i){e===this._state.blendFunction.srcRGB&&i===this._state.blendFunction.dstRGB||(this.gl.blendFunc(e,i),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=e,this._state.blendFunction.dstRGB=i,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(e,i,r,n){this._state.blendFunction.srcRGB===e&&this._state.blendFunction.srcAlpha===r&&this._state.blendFunction.dstRGB===i&&this._state.blendFunction.dstAlpha===n||(this.gl.blendFuncSeparate(e,i,r,n),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=r,this._state.blendFunction.dstRGB=i,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,i){this._state.blendEquation.mode===e&&this._state.blendEquation.modeAlpha===i||(this.gl.blendEquationSeparate(e,i),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=i,this._stateTracker.invalidateBlending())}setColorMask(e,i,r,n){this._state.colorMask.r===e&&this._state.colorMask.g===i&&this._state.colorMask.b===r&&this._state.colorMask.a===n||(this.gl.colorMask(e,i,r,n),this._state.colorMask.r=e,this._state.colorMask.g=i,this._state.colorMask.b=r,this._state.colorMask.a=n,this._stateTracker.invalidateColorWrite())}setClearColor(e,i,r,n){this._state.clearColor.r===e&&this._state.clearColor.g===i&&this._state.clearColor.b===r&&this._state.clearColor.a===n||(this.gl.clearColor(e,i,r,n),this._state.clearColor.r=e,this._state.clearColor.g=i,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,i){this._state.polygonOffset[0]===e&&this._state.polygonOffset[1]===i||(this._state.polygonOffset[0]=e,this._state.polygonOffset[1]=i,this.gl.polygonOffset(e,i),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,i,r,n){this._state.scissorRect.x===e&&this._state.scissorRect.y===i&&this._state.scissorRect.width===r&&this._state.scissorRect.height===n||(this.gl.scissor(e,i,r,n),this._state.scissorRect.x=e,this._state.scissorRect.y=i,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,i){this._state.depthRange.zNear===e&&this._state.depthRange.zFar===i||(this.gl.depthRange(e,i),this._state.depthRange.zNear=e,this._state.depthRange.zFar=i,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,i,r){this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===i&&this._state.stencilFunction.mask===r||(this.gl.stencilFunc(e,i,r),this._state.stencilFunction.face=Xw.FRONT_AND_BACK,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=i,this._state.stencilFunction.mask=r,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(e,i,r,n){this._state.stencilFunction.face===e&&this._state.stencilFunction.func===i&&this._state.stencilFunction.ref===r&&this._state.stencilFunction.mask===n||(this.gl.stencilFuncSeparate(e,i,r,n),this._state.stencilFunction.face=e,this._state.stencilFunction.func=i,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,i,r){this._state.stencilOperation.face===Xw.FRONT_AND_BACK&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===i&&this._state.stencilOperation.zPass===r||(this.gl.stencilOp(e,i,r),this._state.stencilOperation.face=Xw.FRONT_AND_BACK,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=i,this._state.stencilOperation.zPass=r,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(e,i,r,n){this._state.stencilOperation.face===e&&this._state.stencilOperation.fail===i&&this._state.stencilOperation.zFail===r&&this._state.stencilOperation.zPass===n||(this.gl.stencilOpSeparate(e,i,r,n),this._state.stencilOperation.face=e,this._state.stencilOperation.fail=i,this._state.stencilOperation.zFail=r,this._state.stencilOperation.zPass=n,this._stateTracker.invalidateStencilTest())}setActiveTexture(e,i=!1){const r=this._state.activeTexture;return e>=0&&(i||e!==this._state.activeTexture)&&(this.gl.activeTexture(JMe+e),this._state.activeTexture=e),r}clear(e){e&&this.gl.clear(e)}clearSafe(e,i=255){e&&(e&lE.COLOR_BUFFER_BIT&&this.setColorMask(!0,!0,!0,!0),e&lE.DEPTH_BUFFER_BIT&&this.setDepthWriteEnabled(!0),e&lE.STENCIL_BUFFER_BIT&&this.setStencilWriteMask(i),this.gl.clear(e))}drawArrays(e,i,r){if(xb()&&(this._numOfDrawCalls++,this._numOfTriangles+=nIt(e,r)),this.gl.drawArrays(e,i,r),xb()){const n=uTt(this);n&&console.error("drawArrays:",n)}}drawElements(e,i,r,n){if(xb()&&(this._numOfDrawCalls++,this._numOfTriangles+=nIt(e,i)),this.gl.drawElements(e,i,r,n),xb()){const s=uTt(this);if(s){const o=this.getBoundVAO(),a=o?.indexBuffer,l=o?.vertexBuffers,c={indexBuffer:a,vertexBuffers:l},d={mode:e,count:i,type:r,offset:n},p=ya(a,S=>S.size)??0,y=n+i,v=p=this.parameters.maxTextureImageUnits||i<0)&&console.error("Input texture unit is out of range of available units!");const n=this._state.textureUnitMap[i];return lt(e)||e.glName==null?(ye(n)&&(this.setActiveTexture(i,r),this.gl.bindTexture(n.descriptor.target,null)),this._state.textureUnitMap[i]=null,n):r||n!==e?(this.setActiveTexture(i,r),this.gl.bindTexture(e.descriptor.target,e.glName),e.applyChanges(),this._state.textureUnitMap[i]=e,n):(e.isDirty&&(this.setActiveTexture(i,r),e.applyChanges()),n)}unbindTexture(e){if(!lt(e))for(let i=0;i=this.parameters.maxUniformBufferBindings||i<0)return console.error("Uniform buffer binding point is out of range!"),null;const r=this._state.uniformBufferBindingPoints;let n=r[i];return lt(n)&&(n={buffer:null,offset:0,size:0},r[i]=n),n}bindBufferBase(e,i,r){const n=this._getBufferBinding(e,i);lt(n)||n.buffer===r&&n.offset===0&&n.size===0||(this.gl.bindBufferBase(e,i,r?r.glName:null),n.buffer=r,n.offset=0,n.size=0)}bindBufferRange(e,i,r,n,s){const o=this._getBufferBinding(e,i);if(!lt(o)&&!(o.buffer===r&&o.offset===n&&o.size===s)){if(n%this._parameters.uniformBufferOffsetAlignment!=0)return void console.error("Uniform buffer binding offset is not a multiple of the context offset alignment");this.gl.bindBufferRange(e,i,r.glName,n,s),o.buffer=r,o.offset=n,o.size=s}}bindUBO(e,i,r,n){lt(i)?this.bindBufferBase(to.UNIFORM_BUFFER,e,null):(xb()&&(n??i.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),i.initialize(),r!==void 0&&n!==void 0?this.bindBufferRange(to.UNIFORM_BUFFER,e,i.buffer,r,n):this.bindBufferBase(to.UNIFORM_BUFFER,e,i.buffer))}unbindUBO(e){for(let i=0,r=this._state.uniformBufferBindingPoints.length;ithis._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:i.timeline||new sAe,renderingOptions:i.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new der(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return l()}},this._taskHandle=uL({render:c=>this.renderFrame(c)}),this._taskHandle.pause(),this._lostWebGLContextHandle=QI(r,"webglcontextlost",()=>{this.emit("webgl-error",{error:new st("webgl-context-lost")})}),this._bufferPool=new tZi,r.setAttribute("style","width: 100%; height:100%; display:block;"),e.appendChild(r)}destroy(){this.removeAllChildren(),this._emptyTrash(),this._taskHandle=Bc(this._taskHandle),this._lostWebGLContextHandle=Bc(this._lostWebGLContextHandle),this._canvas.parentNode?.removeChild(this._canvas),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.resourceManager.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get background(){return this._background}set background(e){this._background=e,this.requestRender()}get bufferPool(){return this._bufferPool}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}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=ftr,this.renderRequested||(this.renderRequested=!0,this.emit("will-render"),this._taskHandle.resume())}renderFrame(e){const i=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=i,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this.renderRequested=!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(),this.emit("post-render")}_createTransforms(){return{dvs:Cl()}}renderChildren(e){for(const i of this.children)i.beforeRender(e);this._renderChildren(this.children,e);for(const i of this.children)i.afterRender(e)}_renderChildren(e,i){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),i.profiler.recordStart("drawLayers"),i.dataUploadCounter=0,i.drawPhase=io.MAP,this.painter.beforeRenderLayers(r,this.background);for(const n of e)n.processRender(i);this.painter.prepareDisplay(i,this.background,this.state.padding),this.painter.renderLayers(r),i.drawPhase=io.HIGHLIGHT,this.painter.beforeRenderLayers(r);for(const n of e)n.processRender(i);if(this.painter.renderLayers(r),this._isLabelDrawPhaseRequired(e)){i.drawPhase=io.LABEL,this.painter.beforeRenderLayers(r);for(const n of e)n.processRender(i);this.painter.renderLayers(r)}if(Gi("esri-tiles-debug")){i.drawPhase=io.DEBUG,this.painter.beforeRenderLayers(r);for(const n of e)n.processRender(i);this.painter.renderLayers(r)}i.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const i=this.context,{state:r,pixelRatio:n}=e;this._resizeCanvas(e),i.setViewport(0,0,n*r.size[0],n*r.size[1]),i.setDepthWriteEnabled(!0),i.setStencilWriteMask(255),super.doRender(e)}async takeScreenshot(e){const{framebufferWidth:i,framebufferHeight:r}={framebufferWidth:Math.round(this.state.size[0]*e.resolutionScale),framebufferHeight:Math.round(this.state.size[1]*e.resolutionScale)},n=e.resolutionScale,s=this.context,o=this._state.clone();if(e.rotation!=null){const S=o.viewpoint;o.viewpoint.rotation=e.rotation,o.viewpoint=S}const a={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:o,pixelRatio:n,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1},l=new id(s,{colorTarget:Th.TEXTURE,depthStencilTarget:gl.DEPTH_STENCIL_RENDER_BUFFER,width:i,height:r}),c=s.getBoundFramebufferObject(),d=s.getViewport();s.bindFramebuffer(l),s.setViewport(0,0,i,r),this._renderChildren(e.children,a);const p=this._readbackScreenshot(l,{...e.cropArea,y:r-(e.cropArea.y+e.cropArea.height)});s.bindFramebuffer(c),s.setViewport(d.x,d.y,d.width,d.height),this.requestRender();const y=await p;let v;return e.outputScale===1?v=y:(v=new ImageData(Math.round(y.width*e.outputScale),Math.round(y.height*e.outputScale)),fli(y,v,!0)),v}async _readbackScreenshot(e,i){const r=sli(i.width,i.height,document.createElement("canvas"));return await e.readPixelsAsync(i.x,i.y,i.width,i.height,nn.RGBA,ts.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_resizeCanvas(e){const i=this._canvas,r=i.style,{state:{size:n},pixelRatio:s}=e,o=n[0],a=n[1],l=Math.round(o*s),c=Math.round(a*s);i.width===l&&i.height===c||(i.width=l,i.height=c),r.width=o+"px",r.height=a+"px"}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const i of e)i.processDetach()}}_isLabelDrawPhaseRequired(e){let i=!1;for(const r of e){if(!(r instanceof yj)){i=i||!1;break}if(r.hasLabels)return!0;i=i||this._isLabelDrawPhaseRequired(r.children)}return i}};const Pme=2,VE=1,BQ=0,GQ=1,VQ=2;let gtr=class{constructor(e,i,r){this._debugMap=new Map,this._width=e*r,this._height=i*r,this._pixelRatio=r;const n=Math.ceil(this._width/VE),s=Math.ceil(this._height/VE);this._cols=n,this._rows=s,this._cells=ODe.create(n*s)}insertMetrics(e){const i=this._hasCollision(e);return i===BQ&&this._markMetrics(e),i}getCellId(e,i){return e+i*this._cols}has(e){return this._cells.has(e)}hasRange(e,i){return this._cells.hasRange(e,i)}set(e){this._cells.set(e)}setRange(e,i){this._cells.setRange(e,i)}_collide(e,i,r,n){const s=e-r/2,o=i-n/2,a=s+r,l=o+n;if(a<0||l<0||s>this._width||o>this._height)return GQ;const c=Hl(Math.floor(s/VE),0,this._cols),d=Hl(Math.floor(o/VE),0,this._rows),p=Hl(Math.ceil(a/VE),0,this._cols),y=Hl(Math.ceil(l/VE),0,this._rows);for(let v=d;v<=y;v++)for(let S=c;S<=p;S++){const I=this.getCellId(S,v);if(this.has(I))return VQ}return BQ}_mark(e,i,r,n,s){const o=e-r/2,a=i-n/2,l=o+r,c=a+n,d=Hl(Math.floor(o/VE),0,this._cols),p=Hl(Math.floor(a/VE),0,this._rows),y=Hl(Math.ceil(l/VE),0,this._cols),v=Hl(Math.ceil(c/VE),0,this._rows);for(let S=p;S<=v;S++)for(let I=d;I<=y;I++){const O=this.getCellId(I,S);this._debugMap.set(O,s),this.set(O)}return!1}_hasCollision(e){const i=e.id;let r=0,n=0;e.save();do{const s=e.boundsCount;r+=s;for(let o=0;o=r?o:s+n*(o-s)}function wtr(t,e){const i=t/e.minDataValue,r=AS(e.minSize,t),n=AS(e.maxSize,t);let s=null;return s=i*r,Hl(s,r,n)}function xtr(t,e){const[i,r,n]=Ctr(t,e.cache.ipData);if(i===r)return AS(e.stops[i].size,t);{const s=AS(e.stops[i].size,t);return s+(AS(e.stops[r].size,t)-s)*n}}function Str(t,e){const i=XW[e.valueUnit],r=AS(e.minSize,t),n=AS(e.maxSize,t),{valueRepresentation:s}=e;let o=null;return o=s==="area"?2*Math.sqrt(t/ytr)/i:s==="radius"||s==="distance"?2*t/i:t/i,Hl(o,r,n)}function Ctr(t,e){if(!e)return;let i=0,r=e.length-1;return e.some((n,s)=>ti.push(r)),i.sort((r,n)=>r.instanceId-n.instanceId),i.forEach(r=>{ye(r.labelMetrics)&&r.isReady&&e(r,r.labelMetrics.getCursor())})}function Ttr(t){return t.layer&&(t.layer.type==="feature"||t.layer.type==="csv"||t.layer.type==="geojson"||t.layer.type==="ogc-feature"||t.layer.type==="stream"||t.layer.type==="subtype-group"||t.layer.type==="wfs")}function Etr(t){return e=>on(sIt(e,t))}function Itr(t){const e=t!=null&&"visualVariables"in t&&t.visualVariables;if(!e)return null;for(const i of e)if(i.type==="size")return Etr(i);return null}function Atr(t){for(const e of t){const i="featureReduction"in e&&e.featureReduction&&"labelingInfo"in e.featureReduction?e.featureReduction:void 0,r=[...e.labelingInfo||[],...i?.labelingInfo||[]];if(!(!e.labelsVisible||!r.length)&&r.some(n=>n.deconflictionStrategy==="none"))return!0}return!1}function Ptr(t,e){if(!Ttr(e))return;const i=e.layer.type==="subtype-group"?e.layer.sublayers.items:[e.layer],r=e.layer.geometryType,n=!Atr(i),s={};if(e.layer.type!=="subtype-group"){if(e.tileRenderer?.type==="heatmap")return;const l=Itr(e.layer.renderer);s[0]=l}const o=e.tileRenderer;if(lt(o))return;const a=e.layer.visible&&!e.suspended;t.push({tileRenderer:o,vvEvaluators:s,deconflictionEnabled:n,geometryType:r,visible:a})}let Otr=class{run(e,i,r){const n=[];for(let s=e.length-1;s>=0;s--)Ptr(n,e[s]);this._transformMetrics(n),this._runCollision(n,i,r)}_runCollision(e,i,r){const[n,s]=i.state.size,o=new gtr(n,s,i.pixelRatio);for(const{tileRenderer:a,deconflictionEnabled:l,visible:c}of e){const d=a.featuresView.attributeView;l?c?(this._prepare(a),this._collideVisible(o,a,r),this._collideInvisible(o,a)):Sj(a,(p,y)=>{for(;y.nextId();)d.setLabelMinZoom(y.id,Ome)}):Sj(a,(p,y)=>{for(;y.nextId();)d.setLabelMinZoom(y.id,UQ),c&&o.insertMetrics(y)})}}_isFiltered(e,i,r){const n=i.getFilterFlags(e),s=!r.hasFilter||!!(n&C0t),o=lt(r.featureEffect)||r.featureEffect.excludedLabelsVisible||!!(n&JLi);return!(s&&o)}_prepare(e){const i=e.featuresView.attributeView,r=new Set;Sj(e,(n,s)=>{for(;s.nextId();)if(!r.has(s.id)){if(r.add(s.id),this._isFiltered(s.id,i,e.layerView)){i.setLabelMinZoom(s.id,$5e);continue}i.getLabelMinZoom(s.id)!==UQ?i.setLabelMinZoom(s.id,Ome):i.setLabelMinZoom(s.id,UQ)}})}_collideVisible(e,i,r){const n=i.featuresView.attributeView,s=new Set;Sj(i,(o,a)=>{for(;a.nextId();)if(!s.has(a.id))if(o.key.level===r){if(n.getLabelMinZoom(a.id)===0)switch(e.insertMetrics(a)){case GQ:break;case VQ:n.setLabelMinZoom(a.id,$5e),s.add(a.id);break;case BQ:n.setLabelMinZoom(a.id,UQ),s.add(a.id)}}else n.setLabelMinZoom(a.id,$5e)})}_collideInvisible(e,i){const r=i.featuresView.attributeView,n=new Set;Sj(i,(s,o)=>{for(;o.nextId();)if(!n.has(o.id)&&r.getLabelMinZoom(o.id)===Ome)switch(e.insertMetrics(o)){case GQ:break;case VQ:r.setLabelMinZoom(o.id,Ome),n.add(o.id);break;case BQ:r.setLabelMinZoom(o.id,UQ),n.add(o.id)}})}_transformMetrics(e){for(const{tileRenderer:i,geometryType:r,vvEvaluators:n}of e)Sj(i,(s,o)=>{const a=i.featuresView.attributeView,l=s.transforms.labelMat2d;l[4]=Math.round(l[4]),l[5]=Math.round(l[5]);const c=r==="polyline";for(;o.next();){const d=o.boundsCount,p=o.anchorX,y=o.anchorY;let v=o.size;const S=n[0];if(ye(S)){const L=S(a.getVVSize(o.id));v=isNaN(L)||L==null||L===1/0?v:L}const I=o.directionX*(v/2),O=o.directionY*(v/2);for(let L=0;L updateRequested: ${this.updateRequested}`),this.updateRequested}update(e){this._applyVisibilityPassThrottled(e)}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view?.requestUpdate())}processUpdate(e){this._set("updateParameters",e),this.updateRequested&&(this.updateRequested=!1,this.update(e))}_applyVisibilityPass(e){const i=this.view;if(i)try{const r=i.featuresTilingScheme.getClosestInfoForScale(e.state.scale).level;this.collisionEngine.run(i.allLayerViews.items,e,r)}catch{}}};E([k()],O6.prototype,"updateRequested",void 0),E([k({readOnly:!0})],O6.prototype,"updateParameters",void 0),E([k()],O6.prototype,"updating",null),E([k()],O6.prototype,"view",void 0),O6=E([ht("esri.views.2d.layers.labels.LabelManager")],O6);const Mtr=O6;function Dtr(t){return oIt(t,!0)}function Ftr(t){return oIt(t,!1)}function oIt(t,e){if(lt(t))return null;const i=t.spatialReference,r=pd(i),n="toJSON"in t?t.toJSON():t;if(!r)return n;const s=Wb(i)?102100:4326,o=gB[s].maxX,a=gB[s].minX;if(Wy(n))return aIt(n,o,a);if(sg(n))return n.points=n.points.map(l=>aIt(l,o,a)),n;if(ac(n))return Ltr(n,r);if(Va(n)||Lu(n)){const l=DC(Ntr,n),c={xmin:l[0],ymin:l[1],xmax:l[2],ymax:l[3]},d=uw(c.xmin,a)*(2*o),p=d===0?n:fCe(n,d);return c.xmin+=d,c.xmax+=d,c.xmax>o?uIt(p,o,e):c.xminr.extent);return i.length<2?i[0]||t:i.length>2?(t.xmin=e.valid[0],t.xmax=e.valid[1],t):{rings:i.map(r=>[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]])}}function aIt(t,e,i){if(Array.isArray(t)){const r=t[0];if(r>e){const n=uw(r,e);t[0]=r+n*(-2*e)}else if(re){const n=uw(r,e);t.x+=n*(-2*e)}else if(r0;if(a>2*c){const I={xmin:sy||S?i.push(new R6({xmin:d,ymin:r,xmax:c,ymax:n},[p]),new R6({xmin:l,ymin:r,xmax:y,ymax:n},[v])):i.push(new R6({xmin:d,ymin:r,xmax:y,ymax:n},[p]));return i}function lIt(t,e){const[i,r]=e.valid,n=2*r;let s,o=0;return t>r?(s=Math.ceil(Math.abs(t-r)/n),t-=s*n,o=s):t=t.xmin&&e<=t.xmax&&i>=t.ymin&&i<=t.ymax}function uIt(t,e,i=!0){const r=!Lu(t);if(r&&fje(t),i)return new $tr().cut(t,e);const n=r?t.rings:t.paths,s=r?4:2,o=n.length,a=-2*e;for(let l=0;l=s){const d=[];for(const p of c)d.push([p[0]+a,p[1]]);n.push(d)}}return r?t.rings=n:t.paths=n,t}let R6=class{constructor(e,i){this.extent=e,this.frameIds=i}};const Ntr=_o();let $tr=class{constructor(){this._linesIn=[],this._linesOut=[]}cut(e,i){let r;if(this._xCut=i,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 i=this._side(e[0]);if(i*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],i)}else this._lineTo(e[0],e[1],i);this._prevSide=i,this._prevPt=e}close(){const e=this._firstPt,i=this._prevPt;e[0]===i[0]&&e[1]===i[1]||this.lineTo(e),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(e,i,r){this._closed?(this._lineIn.push([r<=0?e:this._xCut,i]),this._lineOut.push([r>=0?e:this._xCut,i])):(r<=0&&this._lineIn.push([e,i]),r>=0&&this._lineOut.push([e,i]))}_lineTo(e,i,r){this._closed?(this._addPolyVertex(this._lineIn,r<=0?e:this._xCut,i),this._addPolyVertex(this._lineOut,r>=0?e:this._xCut,i)):r<0?(this._prevSide===0&&this._pushLineOut(),this._lineIn.push([e,i])):r>0?(this._prevSide===0&&this._pushLineIn(),this._lineOut.push([e,i])):this._prevSide<0?(this._lineIn.push([e,i]),this._lineOut.push([e,i])):this._prevSide>0&&(this._lineOut.push([e,i]),this._lineIn.push([e,i]))}_addPolyVertex(e,i,r){const n=e.length;n>1&&e[n-1][0]===i&&e[n-2][0]===i?e[n-1][1]=r:e.push([i,r])}_checkClosingPt(e){const i=e.length;i>3&&e[0][0]===this._xCut&&e[i-2][0]===this._xCut&&e[1][0]===this._xCut&&(e[0][1]=e[i-2][1],e.pop())}_side(e){return ethis._xCut?1:0}_intersect(e,i){const r=(this._xCut-e[0])/(i[0]-e[0]);return e[1]+r*(i[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 Zc=-1;let cIt=class{constructor(){this._dirties=[{vertexFrom:Zc,vertexCount:Zc,indexFrom:Zc,indexCount:Zc,allDirty:!1},{vertexFrom:Zc,vertexCount:Zc,indexFrom:Zc,indexCount:Zc,allDirty:!1},{vertexFrom:Zc,vertexCount:Zc,indexFrom:Zc,indexCount:Zc,allDirty:!1},{vertexFrom:Zc,vertexCount:Zc,indexFrom:Zc,indexCount:Zc,allDirty:!1},{vertexFrom:Zc,vertexCount:Zc,indexFrom:Zc,indexCount:Zc,allDirty:!1}]}hasDirty(){return this._dirties.some(e=>e.indexCount!==Zc||e.allDirty)}markAllClean(){for(const e of this._dirties)e.indexFrom=Zc,e.indexCount=Zc,e.vertexFrom=Zc,e.vertexCount=Zc,e.allDirty=!1}markAllDirty(){for(const e of this._dirties)e.allDirty=!0}forEach(e){for(let i=0;i0)&&(l.geometry={count:s,from:o,allDirty:a},d=!0),(a||n!==Zc&&r>0)&&(c={count:r,from:n,allDirty:a},d=!0),d&&e({indices:c,vertices:l},i)}}markDirtyIndices(e,i,r){const n=this._dirties[e],s=i,o=r;if(!n.allDirty)if(n.indexCount!==Zc){const a=Math.min(n.indexFrom,s),l=Math.max(n.indexFrom+n.indexCount,s+o)-a;n.indexFrom=a,n.indexCount=l}else n.indexFrom=s,n.indexCount=o}markDirtyVertices(e,i,r,n){const s=this._dirties[e],o=r,a=n;if(!s.allDirty)if(s.vertexCount!==Zc){const l=Math.min(s.vertexFrom,o),c=Math.max(s.vertexFrom+s.vertexCount,o+a)-l;s.vertexFrom=l,s.vertexCount=c}else s.vertexFrom=o,s.vertexCount=a}},Btr=class{get largestRange(){return this._largestRange}constructor(e){this._largestRange=null,this._parent=e,this._updateLargestRange()}rangeCreated(e){(!this._largestRange||e.count>this._largestRange.count)&&(this._largestRange=e)}rangeResized(e,i){e===this._largestRange?e.countthis._largestRange.count)&&(this._largestRange=e)}findBestRange(e){let i=this._parent._freeHead,r=null;for(;i!==null;)i.count>=e&&(!r||i.count-e=a&&e+i<=l?(r=!1,n=!0):o!==null?(s=o,o=o.next):r=!1}return[s,o]}_updateLargestRange(){let e=null,i=this._parent._freeHead;for(;i!==null;)(!e||i.count>e.count)&&(e=i),i=i.next;this._largestRange=e}},Dme=class pH{constructor(e,i){this._allocated=0,this._size=e,this._freeHead=e>0?{from:0,count:e,prev:null,next:null}:null,this._bookKeeper=i||new Btr(this),this._freeHead&&this._bookKeeper.rangeCreated(this._freeHead)}allocate(e){const i=this._bookKeeper.findBestRange(e);if(i==null)return-1;const r=i.from,n=i.count;if(i.from+=e,i.count-=e,this._bookKeeper.rangeResized(i,r,n),this._allocated+=e,i.count===0){const s=i.prev!==null?this._freeHead:i.next;pH._removeRange(i),this._freeHead=s}return r}free(e,i){const[r,n]=this._bookKeeper.findAdjacentRanges(e,i),s={from:e,count:i,prev:r??null,next:n??null};if(r!=null&&(r.next=s),n!=null&&(n.prev=s),this._bookKeeper.rangeCreated(s),this._allocated-=i,n!=null&&s.from+s.count===n.from){const o=s.from,a=s.count;pH._fuse(s,n),pH._removeRange(n),this._bookKeeper.rangeResized(s,o,a),this._bookKeeper.rangeResized(n,void 0,0)}if(r!=null&&r.from+r.count===s.from){const o=r.from,a=r.count;pH._fuse(r,s),pH._removeRange(s),this._bookKeeper.rangeResized(r,o,a),this._bookKeeper.rangeResized(s,void 0,0)}this._freeHead=s.prev!==null?this._freeHead:s}get fragmentation(){const e=this._size-this._allocated;return e===0?0:1-this._bookKeeper.largestRange.count/e}static _removeRange(e){e.prev!==null?e.next!==null?(e.prev.next=e.next,e.next.prev=e.prev):e.prev.next=null:e.next!==null&&(e.next.prev=null)}static _fuse(e,i){e.count+=i.count,e.next=i.next,i.from+=i.count,i.count=0,i.next!==null&&(i.next.prev=e)}};const jQ=["FILL","LINE","MARKER","TEXT","LABEL"];function Gtr(t){const e=t.getStrides(),i={};for(let r=0;re.vertexCount?(this._freeVertices(o,e.vertexFrom,e.vertexCount),l=i.vertexCount,a=this._allocateVertices(o,l)):i.vertexCount===e.vertexCount?(a=e.vertexFrom,l=e.vertexCount):(this._freeVertices(o,e.vertexFrom+i.vertexCount,e.vertexCount-i.vertexCount),a=e.vertexFrom,l=i.vertexCount);let c,d,p,y=!0;if(e.indexFrom===void 0?(c=s,p=i.indexCount,d=this._allocateIndices(o,p)):i.indexCount>e.indexCount?(c=this._displayList.removeFromList(e),this._freeIndices(o,e.indexFrom,e.indexCount),p=i.indexCount,d=this._allocateIndices(o,p)):i.indexCount===e.indexCount?(y=!1,d=e.indexFrom,p=e.indexCount):(c=this._displayList.removeFromList(e),this._freeIndices(o,e.indexFrom+i.indexCount,e.indexCount-i.indexCount),d=e.indexFrom,p=i.indexCount),a!==-1&&d!==-1){const v=this._storageFor(o);if(sFe(a,d,v.vertexBuffers,v.indexBuffer,i,r,n),e.vertexFrom=a,e.indexFrom=d,e.vertexCount=i.vertexCount,e.indexCount=i.indexCount,this._dirtyMap){this._dirtyMap.markDirtyIndices(e.geometryType,e.indexFrom,e.indexCount);for(const S in r)this._dirtyMap.markDirtyVertices(e.geometryType,S,e.vertexFrom,e.vertexCount)}return y&&this._displayList.addToList(e,c),!0}return a!==-1&&this._freeVertices(o,a,l),d!==-1&&this._freeIndices(o,d,p),e.setMeshDataFromBuffers(i,r,n),e.vertexFrom=void 0,e.vertexCount=0,e.indexFrom=void 0,e.indexCount=0,!1}tryAddMeshData(e,i){const r=i.vertexBuffer,n=i.indexBuffer,s=jQ[e.geometryType],o=this._allocateVertices(s,e.vertexCount);if(o===-1)return this._freeVertices(s,o,e.vertexCount),!1;const a=this._allocateIndices(s,e.indexCount);if(a===-1)return this._freeVertices(s,o,e.vertexCount),this._freeIndices(s,a,e.indexCount),!1;const l=this._storageFor(s);if(sFe(o,a,l.vertexBuffers,l.indexBuffer,e,r,n),e.vertexFrom=o,e.indexFrom=a,this._dirtyMap){this._dirtyMap.markDirtyIndices(e.geometryType,e.indexFrom,e.indexCount);for(const c in r)this._dirtyMap.markDirtyVertices(e.geometryType,c,o,e.vertexCount)}return this._displayList.addToList(e),!0}_allocateVertices(e,i){const r=this._storageFor(e),n=r.vtxFreeList?.allocate(i);if(n==null||n===-1)return-1;const s=r.vtxFreeList?.fragmentation;return s==null||s>hIt?-1:n}_freeVertices(e,i,r){this._storageFor(e).vtxFreeList?.free(i,r)}_freeIndices(e,i,r){this._storageFor(e).idxFreeList?.free(i,r)}_allocateIndices(e,i){const r=this._storageFor(e),n=r.idxFreeList?.allocate(i);if(n==null||n===-1)return-1;const s=r.idxFreeList?.fragmentation;return s==null||s>hIt?-1:n}_storageFor(e){return this._freeListsAndStorage[e]}_stridesFor(e,i){return this._strides[e][i]}},Vtr=class{constructor(e){this.geometryMap=k5i(()=>({indexBuffer:Ko.createIndex(e,Lo.STATIC_DRAW),vao:null}),(i,r)=>({vertexBuffer:Ko.createVertex(e,L5i[r])}))}dispose(){for(let e=0;e<5;e++){const i=this.geometryMap[e];if(i){i.data.vao&&i.data.vao.dispose(!1),i.data.indexBuffer&&i.data.indexBuffer.dispose();for(const r in i.buffers)i.buffers[r]&&i.buffers[r].data.vertexBuffer.dispose()}}}get(e){const i=this.geometryMap[e];return{getVAO(r,n,s){if(!i.data.vao){const o={};for(const a in i.buffers)o[a]=i.buffers[a].data.vertexBuffer;i.data.vao=new Ac(r,s,n,o,i.data.indexBuffer)}return i.data.vao}}}has(e){return this.geometryMap[e]!=null}upload(e,i){i.forEach((r,n)=>{this._upload(r,n,e)})}_upload(e,i,r){if(e.indices&&(e.indices.allDirty?this._uploadIndices(r,i):e.indices.from!=null&&e.indices.count!=null&&this._uploadIndices(r,i,e.indices.from,e.indices.count)),e.vertices){const n=e.vertices;for(const s in n){const o=n[s];o.allDirty?this._uploadVertices(r,i,s):o.from!=null&&o.count!=null&&this._uploadVertices(r,i,s,o.from,o.count)}}}_uploadVertices(e,i,r,n,s){const o=this.geometryMap[i];if(!o)return;const a=e.geometries[i].vertexBuffer[r];if(!a)return;const{data:l,stride:c}=a;if(o.buffers[r]&&l.length>0){const d=c/l.BYTES_PER_ELEMENT;n!=null&&s!=null?o.buffers[r].data.vertexBuffer.setSubData(l,n*d,n*d,(n+s)*d):o.buffers[r].data.vertexBuffer.setData(l)}}_uploadIndices(e,i,r,n){const s=this.geometryMap[i];if(!s)return;const o=e.geometries[i].indexBuffer;s.data.indexBuffer&&o.length>0&&(r!=null&&n!=null?s.data.indexBuffer.setSubData(o,r,r,r+n):s.data.indexBuffer.setData(o))}},Cj=class extends CS{constructor(e,i,r,n,s,o,a=s,l=o){super(),this.triangleCountReportedInDebug=0,this.triangleCount=0,this.texture=null,this.key=new xh(e),this.resolution=i,this.x=r,this.y=n,this.width=s,this.height=o,this.rangeX=a,this.rangeY=l}destroy(){this.texture&&(this.texture.dispose(),this.texture=null)}setTransform(e){const i=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*i,a=this.height/this.rangeY*i;vk(r,o,0,0,0,a,0,n,s,1),ov(this.transforms.dvs,e.displayViewMat3,r)}},Utr=class{acquire(e){return{refCount:1,version:-1,labelMat2d:d_(),tileMat3:Cl(),dvs:Cl()}}release(e){}},B5e=class MBe extends Cj{constructor(e,i,r,n){super(e,i,r,n,Tc,Tc)}destroy(){super.destroy(),this._transforms&&MBe.TransformCache.release(this.key.hash)}setTransform(e){const i=this.resolution/e.resolution,r=this.transforms.tileMat3,[n,s]=e.toScreenNoRotation([0,0],[this.x,this.y]),o=this.width/this.rangeX*i,a=this.height/this.rangeY*i;vk(r,o,0,0,0,a,0,n,s,1),ov(this.transforms.dvs,e.displayViewMat3,r);const l=this.transforms.labelMat2d,c=window.devicePixelRatio,d=Ott(d_(),o*c,0,0,a*c,n*c,s*c);tG(l,e.viewMat2d,d)}_createTransforms(){return MBe.TransformCache.acquire(this.key.hash)}};B5e.TransformCache=new Utr;let jtr=class extends B5e{constructor(){super(...arguments),this._data=null,this._displayList=null,this._lastCommitTime=0,this._hasData=!1,this._invalidated=!1,this._wglBuffers=null,this._dirtyMap=new cIt}destroy(){super.destroy(),this.clear()}get hasData(){return!!this._hasData}get displayObjects(){return this._displayObjects??[]}getGeometry(e){return this._wglBuffers&&this._wglBuffers.has(e)?this._wglBuffers.get(e):null}getDisplayList(){return this._displayList}patch(e){if(e.clear===!0)return this.clear(),void(this._hasData=!1);const i=e.addOrUpdate,r=e.remove;!this._data&&i&&i.tileDisplayData?.displayObjects.length?(i.tileDisplayData.computeDisplayList(),this._dirtyMap=new cIt,this._dispRecStore=dIt.fromTileData(i,this._dirtyMap),this._data=i,this._dirtyMap.markAllDirty(),this._hasData=!0,e.end&&this.ready()):this._data&&(i&&i.tileDisplayData?.displayObjects.length||r.length)?this._doPatchData(e):e.end&&this.ready(),e.end&&!this._data&&this.clear(),this.requestRender(),this.emit("change")}commit(e){e.time&&e.time===this._lastCommitTime||(this._lastCommitTime=e.time,this.visible&&this._data&&(this._wglBuffers||(this._wglBuffers=new Vtr(e.context)),(this._dirtyMap.hasDirty()||this._invalidated)&&(this._invalidated=!1,this._wglBuffers.upload(this._data.tileBufferData,this._dirtyMap),this._displayList=this._data.tileDisplayData.displayList.clone(),this._displayObjects=this._data.tileDisplayData.displayObjects.slice(),this._dirtyMap.markAllClean())))}clear(){this._data=null,this._displayList=null,this._dispRecStore=null,this._wglBuffers&&(this._wglBuffers.dispose(),this._wglBuffers=null)}_doPatchData(e){this._invalidated=!0,this._patchData(e)||(this._dirtyMap.markAllDirty(),this._data.reshuffle(),this._dispRecStore=dIt.fromTileData(this._data,this._dirtyMap)),this.requestRender()}_patchData(e){let i=!0;const r=e.addOrUpdate&&e.addOrUpdate.tileDisplayData&&e.addOrUpdate.tileDisplayData.displayObjects||[],n=(e.remove||[]).slice();for(const a of r)a.insertAfter!=null&&n.push(a.id);let s;n.length>0&&(s=new Set(n));const o=this._data.tileDisplayData;for(const a of n){const l=o.displayObjectRegistry.get(a);if(l){o.displayList.removeFromList(l.displayRecords);for(const c of l.displayRecords)this._dispRecStore.delete(c);o.displayObjectRegistry.delete(a)}}s?.size&&(o.displayObjects=o.displayObjects.filter(a=>!s.has(a.id)));for(const a of r){let l,c=o.displayObjectRegistry.get(a.id);if(c){const p=c.displayRecords;c.set(a),c.displayRecords=p;const y=c.displayRecords.length;for(let v=0;v=a.displayRecords.length||S.geometryType!==I.geometryType||S.symbolLevel!==I.symbolLevel||S.zOrder!==I.zOrder||S.materialKey!==I.materialKey)&&(this._dispRecStore.delete(c.displayRecords[v]),v=0){const v=o.displayObjectRegistry.get(c.insertAfter);v?(p=y.indexOf(v)+1,p0?1:0;let S=0;for(let I=p-1;I>=0&&S=0&&So.indexFrom&&n<=o.indexFrom+o.indexCount){if(n=0&&ol.indexFrom&&e.indexFromi.clone()),e.line=this.line&&this.line.map(i=>i.clone()),e.marker=this.marker&&this.marker.map(i=>i.clone()),e.text=this.text&&this.text.map(i=>i.clone()),e.label=this.label&&this.label.map(i=>i.clone()),e.unified=this.unified&&this.unified.map(i=>i.clone()),e}},Htr=class O5t{constructor(){this.geometryDPInfo=new fIt}clone(){const e=new O5t;return e.zLevel=this.zLevel,e.geometryDPInfo=this.geometryDPInfo.clone(),e}},Wtr=class R5t{constructor(){this.zLevels=[]}clone(){const e=new R5t;e.symbolLevel=this.symbolLevel;for(const i of this.zLevels)e.zLevels.push(i.clone());return e}},mIt=class{constructor(){this.vertexData=new Map,this.vertexCount=0,this.indexData=[]}clear(){this.vertexData.clear(),this.vertexCount=0,this.indexData=[]}update(e,i,r){for(const n in e)this.vertexData.set(n,e[n]);for(const n in this.vertexData)e[n]===null&&this.vertexData.delete(n);this.vertexCount=i,this.indexData=r}},j5e=class FBe{constructor(e,i,r,n=0,s=0){this.id=e,this.geometryType=i,this.materialKey=r,this.minZoom=n,this.maxZoom=s,this.meshData=null,this.symbolLevel=0,this.zOrder=0,this.vertexFrom=0,this.vertexCount=0,this.indexFrom=0,this.indexCount=0,this._sortKey=null}get sortKey(){return this._sortKey==null&&this._computeSortKey(),this._sortKey}clone(){return this.copy()}copy(){const e=new FBe(this.id,this.geometryType,this.materialKey);return e.vertexFrom=this.vertexFrom,e.vertexCount=this.vertexCount,e.indexFrom=this.indexFrom,e.indexCount=this.indexCount,e.zOrder=this.zOrder,e.symbolLevel=this.symbolLevel,e.meshData=this.meshData,e.minZoom=this.minZoom,e.maxZoom=this.maxZoom,e}setMeshDataFromBuffers(e,i,r){const n=new mIt;for(const s in i){const o=i[s].stride,a=i[s].data;if(!a)continue;const l=[],c=MJ(o);for(let d=0;di.clone()),e.insertAfter=this.insertAfter,e}set(e){this.id=e.id,this.displayRecords=e.displayRecords,this.insertAfter=e.insertAfter}serialize(e){return e.push(this.id),gIt(e,this.displayRecords),e}static deserialize(e){const i=e.readInt32(),r=new a_e(i),n={id:i};return r.displayRecords=qtr(e,j5e,n)??[],r}},vIt=class LBe{constructor(){this.displayObjects=[],this._displayList=null}get displayObjectRegistry(){if(!this._displayObjectRegistry){this._displayObjectRegistry=new Map;for(const e of this.displayObjects)this._displayObjectRegistry.set(e.id,e)}return this._displayObjectRegistry}get displayList(){return this._displayList}computeDisplayList(){this._displayList=new ztr;for(const e of this.displayObjects)for(const i of e.displayRecords)this._displayList.addToList(i)}clone(){const e=new LBe;return this.displayObjects&&(e.displayObjects=this.displayObjects.map(i=>i.clone())),e}serialize(e){return gIt(e,this.displayObjects),e}_deserializeObjects(e){const i=e.readInt32(),r=new Array(i),n=new Map;for(let s=0;s=this._packedRecords.length?0:this._packedRecords[e]}getCursor(){return this.copy()}copy(){const e=new ym(this._packedRecords);return e._indexStart=this._indexStart,e._link=this._link,e._index=this._index,e._offsets=this._offsets,e._deletedCount=this._deletedCount,e}};M6.ELEMENTS_PER_RECORD=PJ,M6.BYTES_PER_RECORD=M6.ELEMENTS_PER_RECORD*Int32Array.BYTES_PER_ELEMENT;let z5e=class NBe{constructor(e,i){this.data=e,this.stride=i}static decode(e){const i=Tpe(e.data,e.stride),r=e.stride;return new NBe(i,r)}static fromVertexVector(e){const i=Tpe(e.data.buffer(),e.stride),r=e.stride;return new NBe(i,r)}},_It=class l_e{constructor(e,i,r){this.geometryType=e,this.indexBuffer=new Uint32Array(i),this.namedBuffers=r}static decode(e){const i=e.geometryType,r=e.indexBuffer,n={};for(const s in e.namedBuffers)n[s]=z5e.decode(e.namedBuffers[s]);return new l_e(i,r,n)}static fromVertexData(e,i){const r=e.indices,n=Tpe(e.vertices,e.stride),s=e.stride,o={geometry:new z5e(n,s)};return new l_e(i,r,o)}static fromVertexVectors(e){const i=e.geometryType,r=e.indexVector.buffer(),n={};for(const s in e.namedVectors)n[s]=z5e.fromVertexVector(e.namedVectors[s]);return new l_e(i,r,n)}};const Ytr=1.25;let AF=class{get length(){return this._pos}constructor(e,i){this._pos=0;const r=i?this._roundToNearest(i,e.BYTES_PER_ELEMENT):40;this._array=new ArrayBuffer(r),this._buffer=new e(this._array),this._ctor=e,this._i16View=new Int16Array(this._array)}_roundToNearest(e,i){const r=Math.round(e);return r+(i-r%i)}_ensureSize(e){if(this._pos+e>=this._buffer.length){const i=this._roundToNearest((this._array.byteLength+e*this._buffer.BYTES_PER_ELEMENT)*Ytr,this._buffer.BYTES_PER_ELEMENT),r=new ArrayBuffer(i),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 i=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=e,this._pos++,i}push(e){this._ensureSize(1);const i=this._pos;return this._buffer[this._pos++]=e,i}writeFixed(e){this._buffer[this._pos++]=e}setValue(e,i){this._buffer[e]=i}i1616Add(e,i,r){this._i16View[2*e]+=i,this._i16View[2*e+1]+=r}getValue(e){return this._buffer[e]}incr(e){if(this._buffer.length{const o=e.data[s];if(ye(o)){const a=Tj.from(o.records).getCursor();for(;a.next();){const l=a.id,c=a.materialKey,d=a.indexFrom,p=a.indexCount,y=a.vertexFrom,v=a.vertexCount,S=n.get(l),I=new j5e(l,s,c);I.indexFrom=d,I.indexCount=p,I.vertexFrom=y,I.vertexCount=v,S.displayRecords.push(I)}r[s]=_It.fromVertexData(o,s)}else r[s]=new Ktr(s,0,Yo.DEFAULT).intoBuffers()}),tL.fromMeshData({displayObjects:i,vertexBuffersMap:r})}static fromMeshData(e){const i=new tL,r=new vIt,n=new V5e;r.displayObjects=e.displayObjects;for(const s in e.vertexBuffersMap){const o=e.vertexBuffersMap[s];n.geometries[s].indexBuffer=o.indexBuffer,n.geometries[s].vertexBuffer=o.namedBuffers}return i.tileDisplayData=r,i.tileBufferData=n,i}static bind(e,i){const r=new tL;return r.tileDisplayData=e,r.tileBufferData=i,r}static create(e,i){const r=new tL;r.tileDisplayData=new vIt,r.tileDisplayData.displayObjects=e;const n=[0,0,0,0,0],s=[0,0,0,0,0],o=[[],[],[],[],[]];for(const c of e)for(const d of c.displayRecords)o[d.geometryType].push(d),n[d.geometryType]+=d.meshData.vertexCount,s[d.geometryType]+=d.meshData.indexData.length;const a=new V5e,l=Qtr(i);for(let c=0;c=s?(n.col=o-s,n.world+=1):n.col=o,n.row=a,n}const Nme=1,H5e=2,$me=4,W5e=8,q5e=16,Bme=32,Y5e=64,Gme=128;function SIt(t){switch(t){case Nme:case W5e:case Bme:return-1;case H5e:case Y5e:return 0;case $me:case q5e:case Gme:return 1}}function CIt(t){switch(t){case Nme:case H5e:case $me:return-1;case W5e:case q5e:return 0;case Bme:case Y5e:case Gme:return 1}}const TIt=Nme|W5e|Bme,EIt=$me|q5e|Gme,IIt=Nme|H5e|$me,AIt=Bme|Y5e|Gme;let PIt=class{constructor(e,i,r,n,s,o=0){this._hasAggregate=!1,this.hasRecords=!1,this._data={self:new Map,neighbors:new Array},this._version=0,this._current={geometryType:0,writer:null,overlaps:0,start:0,insertAfter:0,sortKey:0,id:0,materialKey:0,indexStart:0,vertStart:0,isDotDensity:!1,bufferingEnabled:!1,metricBoxLenPointer:0},this.hint=i,this.tileKey=e,this._hasAggregate=n,this._pixelBufferEnabled=s,this._version=o,this._symbologyType=r}get hasAggregates(){return this._hasAggregate}get hasPixelBufferEnabled(){return this._pixelBufferEnabled}serialize(e){const i=[];return i.push(this._serializeTileVertexData(this.tileKey,this.tileKey,this._data.self)),this._data.neighbors.forEach((r,n)=>{const s=1<=Tc-r?TIt:EIt|TIt)|(i<0+n?AIt:i>=Tc-n?IIt:AIt|IIt));this._current.overlaps|=s}_getVertexWriter(e){if(!this._data.self.has(e)){const i=this._data.self,r=Cpe(e,this._symbologyType).geometry;i.set(e,new xIt(e,r,this.hint.records))}return this._data.self.get(e)}};const UE=0,jE=100;function OIt(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function RIt(t,e){return Math.sqrt(t*t+e*e)}function MIt(t){const e=RIt(t[0],t[1]);t[0]/=e,t[1]/=e}function iir(t,e){return RIt(t[0]-e[0],t[1]-e[1])}function Nl(t){return typeof t=="function"}function X5e(t=2){return 1/Math.max(t,1)}function PF(t,e){return[!!t?.minScale&&e.scaleToZoom(t.minScale)||UE,!!t?.maxScale&&e.scaleToZoom(t.maxScale)||jE]}function rir(t,e){return t[e+1]}function DIt(t){return t.length-1}function nir(t){let e=0;for(let i=0;ie._index||this._index===e._index&&this._distance>=e._distance}get _segment(){return this._segments[this._index+1]}get angle(){const e=this.dy,i=(0*e+-1*-this.dx)/(1*this.length);let r=Math.acos(i);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:i}=this;return Math.sqrt(e*e+i*i)}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,i?this:null}seek(e,i=!1){if(e<0)return this._seekBackwards(Math.abs(e),i);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,i);r+=this.length}return this._distance=1,i?this:null}};function air(t,e,i,r=!0){const n=nir(t),s=oir.create(t),o=n/2;if(!r)return s.seek(o),void i(s.clone(),0,o+0*e,n);const a=Math.max((n-e)/2,0),l=Math.floor(a/e),c=o-l*e;s.seek(c);for(let d=-l;d<=l;d++)s.x<512&&s.x>=0&&s.y<512&&s.y>=0&&i(s.clone(),d,o+d*e,n),s.seek(e)}function lir(t,e){const i=e;for(let r=0;r=0&&!(n[I+1]n[p]+d);I++){const O=d-n[I-1]+n[p],L=n[I]-n[I-1],N=n[I]-n[p]class extends t{constructor(...e){super(...e),this._isCIM=!1,this._vertexBoundsScale=1,this.geometryType=wn.TEXT,this._aux=Up(0,0,this._referenceSize,this._bitset)}bindTextInfo(e,i){e&&e.length?this._shapingInfo=ya(e,r=>MLe(r,i,{scale:this._scale,angle:this._angle,xOffset:this._xOffset,yOffset:this._yOffset,hAlign:this._xAlignD,vAlign:this._yAlignD,maxLineWidth:Math.max(32,Math.min(this._lineWidth,512)),lineHeight:UDe*Math.max(.25,Math.min(this._lineHeight,4)),decoration:this._decoration,isCIM:this._isCIM,hasBackground:!!this._backgroundColor,borderLineSize:this._borderLineSize})):this._shapingInfo=null}_write(e,i,r,n){const s=i.getDisplayId();this._writeGeometry(e,i,s,r,n)}_writeGeometry(e,i,r,n,s){const o=this._shapingInfo;if(lt(o))return;if(ye(this._textPlacement)){const l=s??i.readLegacyGeometryForDisplay();return this._writePlacedText(e,r,l,o,n)}const a=s?ATe(H5(s),2):i.geometryType==="esriGeometryPolygon"?i.readCentroid():i.readGeometryForDisplay();if(!lt(a)){if(a.isPoint){const[l,c]=a.coords;return!e.hasAggregates&&e.hasPixelBufferEnabled&&(l<0||l>=512||c<0||c>=512)?void 0:this._writeGlyphs(e,r,{x:l,y:c},o)}a.forEachVertex((l,c)=>this._writeGlyphs(e,r,{x:l,y:c},o))}}_writePlacedText(e,i,r,n,s){const o=this._textPlacement,a=FIt.getPlacement(r,o,on(1),e.tileKey,s.geometryEngine);if(!a)return;let l=a.next();for(;l!=null;){const c=-l.getAngle();n.setRotation(c);const d=l.tx,p=-l.ty;d<0||d>=512||p<0||p>=512||(this._writeGlyphs(e,i,{x:d,y:p},n),n.setRotation(-c)),l=a.next()}}_writeGlyphs(e,i,r,n){const s=z_.load(this._materialKey),o=Ln(Math.round(Aj*r.x),Math.round(Aj*r.y)),a=this._vertexBoundsScale,{bounds:l,background:c,glyphs:d}=n;d.length>0&&(this._borderLineColor||this._backgroundColor)&&(s.textureBinding=d[0].textureBinding,e.recordStart(i,s.data,this.geometryType,!0),this._writeBackgroundGeometry(e,i,r,l,c),e.recordEnd());const p=2*Math.max(l.width,l.height);for(const y of n.glyphs)s.textureBinding=y.textureBinding,e.recordStart(i,s.data,this.geometryType,!0),e.vertexBounds(r.x+l.x+this._xOffset,r.y+l.y-this._yOffset,p*a,p*a),this._writeVertices(e,i,o,y),e.recordEnd()}_writeGlyph(e,i,r,n,s){const o=z_.load(this._materialKey),a=Ln(Math.round(Aj*r),Math.round(Aj*n));o.textureBinding=s.textureBinding,e.recordStart(i,o.data,this.geometryType,!0);const l=s.bounds,c=this._vertexBoundsScale;e.vertexBounds(r+l.x*c,n+l.y*c,l.width*c,l.height*c),this._writeVertices(e,i,a,s),e.recordEnd()}_writeVertices(e,i,r,n){const s=e.vertexCount();this._writeVertexCommon(e,i,r,n),e.vertexWrite(n.offsets.upperLeft),e.vertexWrite(n.texcoords.upperLeft),e.vertexEnd(),this._writeVertexCommon(e,i,r,n),e.vertexWrite(n.offsets.upperRight),e.vertexWrite(n.texcoords.upperRight),e.vertexEnd(),this._writeVertexCommon(e,i,r,n),e.vertexWrite(n.offsets.lowerLeft),e.vertexWrite(n.texcoords.lowerLeft),e.vertexEnd(),this._writeVertexCommon(e,i,r,n),e.vertexWrite(n.offsets.lowerRight),e.vertexWrite(n.texcoords.lowerRight),e.vertexEnd(),e.indexWrite(s+0),e.indexWrite(s+1),e.indexWrite(s+2),e.indexWrite(s+1),e.indexWrite(s+3),e.indexWrite(s+2)}_writeVertexCommon(e,i,r,n){const s=this._color,o=this._haloColor,a=Up(0,0,this._referenceSize,this._bitset),l=Up(0,0,this._size,this._haloSize);e.vertexWrite(r),e.vertexWrite(i),e.vertexWrite(s),e.vertexWrite(o),e.vertexWrite(l),e.vertexWrite(a),e.vertexWrite(this._minMaxZoom)}_writeBackgroundVertex(e,i,r,n,s,o){const a=Up(0,1,this._referenceSize,this._bitset),l=Up(0,0,this._size,this._haloSize),c=Up(0,0,0,0);e.vertexWrite(r),e.vertexWrite(i),e.vertexWrite(n),e.vertexWrite(c),e.vertexWrite(l),e.vertexWrite(a),e.vertexWrite(this._minMaxZoom),e.vertexWrite(s),e.vertexWrite(o),e.vertexEnd()}_writeBackgroundQuad(e,i,r,n,s,o){const a=e.vertexCount();this._writeBackgroundVertex(e,i,r,n,s.upperLeft,o[0]),this._writeBackgroundVertex(e,i,r,n,s.upperRight,o[1]),this._writeBackgroundVertex(e,i,r,n,s.lowerLeft,o[2]),this._writeBackgroundVertex(e,i,r,n,s.lowerRight,o[3]),e.indexWrite(a+0),e.indexWrite(a+1),e.indexWrite(a+2),e.indexWrite(a+1),e.indexWrite(a+3),e.indexWrite(a+2)}_writeBackgroundGeometry(e,i,r,n,s){const o=Ln(Math.round(Aj*r.x),Math.round(Aj*r.y)),{x:a,y:l,width:c,height:d}=n,p=2*Math.max(c,d);if(e.vertexBounds(r.x+a+this._xOffset,r.y+l-this._yOffset,p*this._vertexBoundsScale,p*this._vertexBoundsScale),this._backgroundColor){const y=[dx,dx,dx,dx];this._writeBackgroundQuad(e,i,o,this._backgroundColor,s.main,y)}if(this._borderLineColor||this._backgroundColor){const y=!!this._borderLineColor&&!!this._borderLineSize&&this._borderLineSize>0,[v,S,I,O,L]=y?[LIt,LIt,kIt,kIt,this._borderLineColor]:[cir,hir,dir,pir,this._backgroundColor];this._writeBackgroundQuad(e,i,o,L,s.top,v),this._writeBackgroundQuad(e,i,o,L,s.bot,S),this._writeBackgroundQuad(e,i,o,L,s.left,I),this._writeBackgroundQuad(e,i,o,L,s.right,O)}}};let zQ=class{constructor(){this._materialKey=null}bindFeature(e,i,r){}write(e,i,r,n){if(lt(this._effects)||this._effects?.length===0)return this._write(e,i,n);const s=yQ.executeEffects(this._effects,i.readLegacyGeometryForDisplay(),e.tileKey,n.geometryEngine);let o=yQ.next(s);for(;o;)this._write(e,i,n,o),o=yQ.next(s)}_write(e,i,r,n){}};const fir=5;let K5e=class BBe extends NIt(zQ){constructor(e,i,r,n,s,o,a,l,c,d,p,y,v,S,I,O,L,N,G,V,Y,X,te,re){super(),this._xOffset=on(v),this._yOffset=on(S),this._decoration=d||"none",this._backgroundColor=X,this._borderLineColor=te,this._borderLineSize=re,this._color=s,this._haloColor=o,this._haloSize=Math.min(Math.floor(fir*on(Da(r))),127),this._size=Math.min(Math.round(on(i)),127);const fe=Math.min(Math.round(on(n||i)),127);this._referenceSize=Math.round(Math.sqrt(256*fe)),this._scale=this._size/fpe,this._angle=y,this._justify=kqi(a||"center"),this._xAlignD=_St(a||"center"),this._yAlignD=bSt(l||"baseline"),this._baseline=(l||"baseline")==="baseline",this._bitset=(c===hy.MAP?1:0)|(p?1:0)<<1;const ge=z_.load(e);ge.sdf=!0,this._materialKey=ge.data,this._lineWidth=on(I)||512,this._lineHeight=O||1,this._textPlacement=L,this._effects=N,this._isCIM=G??!1,this._minMaxZoom=Ln(Math.round(V*cy),Math.round(Y*cy))}static fromText(e,i){const r=e.font?.size,n=new BBe(e.materialKey,r,e.haloSize||0,r,e.color&&db(e.color)||0,e.haloColor&&db(e.haloColor)||0,e.horizontalAlignment,e.verticalAlignment,hy.SCREEN,e.font?.decoration,!1,e.angle||0,e.xoffset||0,e.yoffset||0,e.lineWidth||0,e.lineHeight||0,null,null,!1,UE,jE,e.backgroundColor&&db(e.backgroundColor),e.borderLineColor&&db(e.borderLineColor),e.borderLineSize),[,s]=gF(e.text);return n.bindTextInfo(i??[],s),n._vertexBoundsScale=e.maxVVSize&&r?e.maxVVSize/r:1,n}static fromCIMText(e,i,r){const n=e.scaleFactor||1,s=e.size*e.sizeRatio*n,[o,a]=PF(e.scaleInfo,r),l=new BBe(e.materialKey,s,e.outlineSize*e.sizeRatio,e.referenceSize,jp(e.color),jp(e.outlineColor),e.horizontalAlignment,e.verticalAlignment,e.alignment,e.decoration,e.colorLocked??!1,e.angle,e.offsetX*e.sizeRatio*n,e.offsetY*e.sizeRatio*n,512,1,e.markerPlacement,e.effects,!0,o,a,e.backgroundColor?jp(e.backgroundColor):void 0,e.borderLineColor?jp(e.borderLineColor):void 0,e.borderLineWidth),[,c]=gF(e.text);return l.bindTextInfo(i,c),l._vertexBoundsScale=e.maxVVSize?e.maxVVSize/s:1,l}};const $It=Ei.getLogger("esri.views.2d.engine.webgl.WGLLabelTemplate"),mir=(t,e="mapview-labeling")=>$It.error(new st(e,t)),Ume=1,Pj=0,gir=4,J5e=25;function yir(t,e){const i=!!t.minScale&&e.scaleToZoom(t.minScale)||0;return Hl(i,0,25.5)}function vir(t,e){const i=!!t.maxScale&&e.scaleToZoom(t.maxScale)||255;return Hl(i,0,25.5)}function _ir(t){const e=new Map;return i=>(e.has(i)||e.set(i,t(i)),e.get(i))}const bir=_ir(t=>{let e=0;if(t===0)return 1/0;for(;!(t%2);)e++,t/=2;return e}),jme=t=>Math.floor(127*t+127),D6=t=>Math.floor(10*t),OF=t=>Math.round(t*(254/360));let BIt=class M5t extends K5e{constructor(e,i,r,n){super(e,r.font?.size,r.haloSize||0,r.font?.size,r.color&&db(r.color)||0,r.haloColor&&db(r.haloColor)||0,r.horizontalAlignment,r.verticalAlignment,wSt(i.labelPlacement)?hy.MAP:hy.SCREEN,r.font?.decoration,!1,r.angle||0,r.xoffset,r.yoffset,r.lineWidth,r.lineHeight,null,null,!1,null,null,r.backgroundColor&&db(r.backgroundColor),r.borderLineColor&&db(r.borderLineColor),r.borderLineSize),this._outLineLabelAngle=0,this._refPlacementPadding=0,this._refPlacementDirX=0,this._refPlacementDirY=0,this._refOffsetX=0,this._refOffsetY=0,this._zoomLevel=0,this.geometryType=wn.LABEL,this._allowOverrun=i.allowOverrun??!1,this._repeatLabel=i.repeatLabel??!0,this._labelPosition=i.labelPosition??"curved";const s=yir(i,n),o=vir(i,n),a=i.labelPlacement,[l,c]=Dqi(a);this._xAlignD=l,this._yAlignD=c,this._minZoom=s,this._maxZoom=o,this._minBackgroundZoom=s,this._maxBackgroundZoom=o,this._refPlacementPadding=on(r.haloSize)+HLi,this._repeatLabelDistance=i.repeatLabelDistance?on(i.repeatLabelDistance):128;const d=TF.load(e);d.sdf=!0,this._materialKey=d.data}static fromLabelClass(e,i){if(e.labelPlacement==="esriServerLinePlacementCenterAlong"){const r=e.symbol;r.xoffset=0,r.yoffset=0,r.angle=0,r.font.decoration="none"}return new M5t(e.materialKey,e,e.symbol,i)}get _shapedBox(){return this._shapingInfo.bounds}setZoomLevel(e){this._zoomLevel=e}bindReferenceTemplate(e){let i=Fqi(this._xAlignD),r=Lqi(this._yAlignD);if(this._refOffsetX=0,this._refOffsetY=0,lt(e))return void(this._refSymbolAndPlacementOffset=Up(0,0,jme(i),jme(r)));if(e.boundsType==="circle"&&(i||r)){const o=Math.sqrt(i*i+r*r);i/=o,r/=o}const n=Math.max(e.height,e.width),s=this._refPlacementPadding*gir;this._refSymbolAndPlacementOffset=Up(s,n,jme(i),jme(r)),this._referenceSize=n,this._refPlacementDirX=i,this._refPlacementDirY=r,this._refOffsetX=e.xOffset,this._refOffsetY=e.yOffset}_write(e,i){if(lt(this._shapingInfo))return;const r=this._shapingInfo,n=i.getDisplayId(),s=i.geometryType==="esriGeometryPolygon"?i.readLegacyCentroid():i.readLegacyGeometry();if(s)switch(this._current={out:e,inId:n,inShaping:r,zoomLevel:this._zoomLevel},i.geometryType==="esriGeometryPolyline"&&this._labelPosition==="curved"&&(this._borderLineColor||this._backgroundColor)&&$It.warnOnce("TextSymbol properties 'borderLineColor', 'borderLineSize', and 'backgroundColor' are not supported in curved labels"),i.geometryType){case"esriGeometryPolyline":this._placeLineLabels(s);break;case"esriGeometryPoint":case"esriGeometryPolygon":this._placePointLabels(s);break;default:mir(`Geometry of type ${i.geometryType} is not supported`)}}_isVisible(e,i){const r=D6(this._current.zoomLevel);return D6(e)<=r&&r<=D6(i)}_placePointLabels(e){const{out:i,inId:r,inShaping:n}=this._current;this._writeGlyphs(i,r,e,n)}_placeLineLabels(e){const i=lir(e.paths,this._current.inShaping.bounds.width),r=this._placeSubdivGlyphs.bind(this),n=(this._shapedBox.width+this._repeatLabelDistance)/(1<0&&(this._borderLineColor||this._backgroundColor);if(this._maxBackgroundZoom=J5e,this._minBackgroundZoom=Math.max(i,0),c){const d=TF.load(this._materialKey);d.textureBinding=s.glyphs[0].textureBinding;const p=qY(d_(),-e.angle),[y,v]=s.shapeBackground(p);this._outLineLabelAngle=OF(a),r.recordStart(n,d.data,this.geometryType,!0),this._writeBackgroundGeometry(r,n,e,y,v),r.recordEnd(),this._outLineLabelAngle=OF(l),r.recordStart(n,d.data,this.geometryType,!0),this._writeBackgroundGeometry(r,n,e,y,v),r.recordEnd()}this._outLineLabelAngle=OF(a),this._placeFirst(o,i,1,!0),this._outLineLabelAngle=OF(l),this._placeFirst(o,i,0,!0),r.metricEnd()}_placeBack(e,i,r,n,s){const o=e.clone();let a=e.backwardLength+Pj;for(;o.prev()&&!(a>=n);)this._placeOnSegment(o,i,a,r,-1,s),a+=o.length+Pj}_placeForward(e,i,r,n,s){const o=e.clone();let a=e.remainingLength+Pj;for(;o.next()&&!(a>=n);)this._placeOnSegment(o,i,a,r,1,s),a+=o.length+Pj}_placeFirst(e,i,r,n=!1){const s=e,o=this._current.inShaping,a=o.glyphs,l=this._current.zoomLevel,{out:c,inId:d}=this._current;for(const p of a){const y=p.x>o.bounds.x?r:1-r,v=y*e.remainingLength+(1-y)*e.backwardLength,S=Math.abs(p.x+p.width/2-o.bounds.x),I=Math.max(0,l+Math.log2(S/(v+Pj))),O=Math.max(i,n?0:I);if(p.maxZoom=J5e,p.angle=e.angle+(1-r)*Math.PI,p.minZoom=O,this._writeGlyph(c,d,s.x,s.y,p),r&&this._isVisible(p.minZoom,p.maxZoom)){const L=p.bounds;c.metricBoxWrite(L.center[0],L.center[1],L.width,L.height)}}}_placeOnSegment(e,i,r,n,s,o){const a=this._current.inShaping.glyphs,{out:l,inId:c}=this._current,d=this._current.inShaping,p=this._current.zoomLevel,y=e.dx/e.length,v=e.dy/e.length,S={x:e.x+r*-s*y,y:e.y+r*-s*v};for(const I of a){const O=I.x>d.bounds.x?o:1-o;if(!(O&&s===1||!O&&s===-1))continue;const L=Math.abs(I.x+I.width/2-d.bounds.x),N=Math.max(0,p+Math.log2(L/r)-.1),G=Math.max(n,p+Math.log2(L/(r+e.length+Pj)));if(N!==0&&(I.angle=e.angle+(1-o)*Math.PI,I.minZoom=G,I.maxZoom=N,this._writeGlyph(l,c,S.x,S.y,I),o&&this._isVisible(I.minZoom,I.maxZoom))){const V=I.bounds,Y=e.x-i.x,X=e.y-i.y;l.metricBoxWrite(V.center[0]+Y,V.center[1]+X,V.width,V.height)}}}_writeGlyphs(e,i,r,n,s=this._minZoom){if(r.x<0||r.x>=512||r.y<0||r.y>=512)return;if(n.glyphs.length>0&&(this._borderLineColor||this._backgroundColor)){const p=TF.load(this._materialKey);p.textureBinding=n.glyphs[0].textureBinding,e.recordStart(i,p.data,this.geometryType,!0),this._writeBackgroundGeometry(e,i,r,n.bounds,n.background),e.recordEnd()}const o=r.x+this._refOffsetX,a=r.y-this._refOffsetY;for(const p of n.glyphs)p.minZoom=s,p.maxZoom=this._maxZoom,this._writeGlyph(e,i,o,a,p);const l=this._refPlacementDirX,c=this._refPlacementDirY,d=n.boundsT;e.metricStart(i,s,o,a,l,c,this._referenceSize,this._materialKey),e.metricBoxWrite(d.center[0],d.center[1],d.width,d.height),e.metricEnd()}_writeVertexCommon(e,i,r,n){const s=this._color,o=this._haloColor,a=Up(0,0,this._size,this._haloSize),l=Math.max(n.minZoom,this._minZoom),c=Math.min(n.maxZoom,this._maxZoom),d=Up(D6(l),D6(c),this._outLineLabelAngle,0);e.vertexWrite(r),e.vertexWrite(i),e.vertexWrite(s),e.vertexWrite(o),e.vertexWrite(a),e.vertexWrite(this._refSymbolAndPlacementOffset),e.vertexWrite(d)}_writeBackgroundVertex(e,i,r,n,s,o){const a=Up(0,0,this._size,this._haloSize),l=Up(0,0,0,0),c=Up(D6(this._minBackgroundZoom),D6(this._maxBackgroundZoom),this._outLineLabelAngle,1);e.vertexWrite(r),e.vertexWrite(i),e.vertexWrite(n),e.vertexWrite(l),e.vertexWrite(a),e.vertexWrite(this._refSymbolAndPlacementOffset),e.vertexWrite(c),e.vertexWrite(s),e.vertexWrite(o),e.vertexEnd()}};const GIt=3.14159265359/180,VIt=8,UIt=t=>class extends t{constructor(...e){super(...e),this.angle=0,this.xOffset=0,this.yOffset=0,this.width=0,this.height=0,this.boundsType="square",this._anchorX=0,this._anchorY=0,this._computedWidth=0,this._computedHeight=0,this._allowBorrowing=!0,this._vertexBoundsScaleX=1,this._vertexBoundsScaleY=1,this._offsets={xUpperLeft:0,yUpperLeft:0,xUpperRight:0,yUpperRight:0,xBottomLeft:0,yBottomLeft:0,xBottomRight:0,yBottomRight:0},this.geometryType=wn.MARKER}_write(e,i,r,n){const s=i.getDisplayId();e.recordStart(s,this._materialKey,this.geometryType,!0),this._writeGeometry(e,i,s,r,n),e.recordEnd()}_writeGeometry(e,i,r,n,s){if(ye(this._markerPlacement))return this._writePlacedMarkers(e,i,n,s);if(this._allowBorrowing=!0,!s&&i.geometryType==="esriGeometryPoint"){const a=i.getX(),l=i.getY();return!e.hasAggregates&&e.hasPixelBufferEnabled&&(a<0||a>=513||l<0||l>=513)?void 0:this._writeVertices(e,r,this._getPos(a,l),a,l)}const o=s?ATe(H5(s),2):i.geometryType==="esriGeometryPolygon"?i.readCentroid():i.readGeometryForDisplay();if(!lt(o)){if(o.isPoint){const[a,l]=o.coords;return!e.hasAggregates&&e.hasPixelBufferEnabled&&(a<0||a>=512||l<0||l>=512)?void 0:this._writeVertices(e,r,this._getPos(a,l),a,l)}o.forEachVertex((a,l)=>{const c=2*Tc;a<-c||a>=c||l<-c||l>=c||this._writeVertices(e,r,this._getPos(a,l),a,l)})}}_writePlacedMarkers(e,i,r,n){const s=n??i.readLegacyGeometryForDisplay(),o=FIt.getPlacement(s,this._markerPlacement,on(1),e.tileKey,r.geometryEngine);if(!o)return;this._allowBorrowing=i.geometryType!=="esriGeometryPolygon";const a=i.getDisplayId(),l=CT(),c=d_(),d=-128,p=640;let y=o.next();for(;y!=null;){const v=y.tx,S=-y.ty;v>=d&&v<=p&&S>=d&&S<=p&&(this._applyTransformation(c,l,-y.getAngle()/GIt),this._writeVertices(e,a,this._getPos(v,S),v,S)),y=o.next()}}_writeVertices(e,i,r,n,s){const o=CF.load(this._materialKey);return o.symbologyType===Yo.HEATMAP?this._writeHeatmapVertices(e,i,r):this._writeMarkerVertices(e,i,o,r,n,s)}_writeMarkerVertices(e,i,r,n,s,o){const a=r.vvRotation,l=e.vertexCount();let c=this._computedWidth*this._vertexBoundsScaleX,d=this._computedHeight*this._vertexBoundsScaleY;if(this.angle){const p=Math.max(c,d);c=p,d=p}if(a){const p=Math.max(this.xOffset,this.yOffset);c+=p,d+=p}this._allowBorrowing&&e.vertexBounds(s+this.xOffset,o-this.yOffset,c,d),e.vertexWrite(n),e.vertexWrite(this._offsetUpperLeft),e.vertexWrite(this._texUpperLeft),e.vertexWrite(this._bitestAndDistRatio),e.vertexWrite(i),e.vertexWrite(this._fillColor),e.vertexWrite(this._outlineColor),e.vertexWrite(this._sizeOutlineWidth),e.vertexWrite(this._minMaxZoom),e.vertexEnd(),e.vertexWrite(n),e.vertexWrite(this._offsetUpperRight),e.vertexWrite(this._texUpperRight),e.vertexWrite(this._bitestAndDistRatio),e.vertexWrite(i),e.vertexWrite(this._fillColor),e.vertexWrite(this._outlineColor),e.vertexWrite(this._sizeOutlineWidth),e.vertexWrite(this._minMaxZoom),e.vertexEnd(),e.vertexWrite(n),e.vertexWrite(this._offsetBottomLeft),e.vertexWrite(this._texBottomLeft),e.vertexWrite(this._bitestAndDistRatio),e.vertexWrite(i),e.vertexWrite(this._fillColor),e.vertexWrite(this._outlineColor),e.vertexWrite(this._sizeOutlineWidth),e.vertexWrite(this._minMaxZoom),e.vertexEnd(),e.vertexWrite(n),e.vertexWrite(this._offsetBottomRight),e.vertexWrite(this._texBottomRight),e.vertexWrite(this._bitestAndDistRatio),e.vertexWrite(i),e.vertexWrite(this._fillColor),e.vertexWrite(this._outlineColor),e.vertexWrite(this._sizeOutlineWidth),e.vertexWrite(this._minMaxZoom),e.vertexEnd(),this._writeIndices(e,l)}_writeHeatmapVertices(e,i,r){const n=e.vertexCount();e.vertexWrite(r),e.vertexWrite(this._offsetUpperLeft),e.vertexWrite(i),e.vertexEnd(),e.vertexWrite(r),e.vertexWrite(this._offsetUpperRight),e.vertexWrite(i),e.vertexEnd(),e.vertexWrite(r),e.vertexWrite(this._offsetBottomLeft),e.vertexWrite(i),e.vertexEnd(),e.vertexWrite(r),e.vertexWrite(this._offsetBottomRight),e.vertexWrite(i),e.vertexEnd(),this._writeIndices(e,n)}_writeIndices(e,i){e.indexWrite(i+0),e.indexWrite(i+1),e.indexWrite(i+2),e.indexWrite(i+1),e.indexWrite(i+3),e.indexWrite(i+2)}_applyTransformation(e,i,r=0){Mle(e,lp(this.xOffset,-this.yOffset)),this.angle!=null&&this.angle+r!==0&&pk(e,e,GIt*(this.angle+r));const n=this._computedWidth,s=this._computedHeight,o=-(.5+this._anchorX)*n,a=-(.5-this._anchorY)*s;aa(i,o,a),f0(i,i,e),this._offsetUpperLeft=Ln(16*i[0],16*i[1]),this._offsets.xUpperLeft=i[0],this._offsets.yUpperLeft=i[1],aa(i,o+n,a),f0(i,i,e),this._offsetUpperRight=Ln(16*i[0],16*i[1]),this._offsets.xUpperRight=i[0],this._offsets.yUpperRight=i[1],aa(i,o,a+s),f0(i,i,e),this._offsetBottomLeft=Ln(16*i[0],16*i[1]),this._offsets.xBottomLeft=i[0],this._offsets.yBottomLeft=i[1],aa(i,o+n,a+s),f0(i,i,e),this._offsetBottomRight=Ln(16*i[0],16*i[1]),this._offsets.xBottomRight=i[0],this._offsets.yBottomRight=i[1]}_getPos(e,i){return Ln(Math.round(VIt*e),Math.round(VIt*i))}};let HQ=class bre extends UIt(zQ){constructor(e,i,r,n,s,o,a,l,c,d,p,y,v,S,I,O,L,N,G,V,Y,X,te){super(),this.angle=n,this.height=a,this.width=o,this.xOffset=i*G,this.yOffset=r*G,this._markerPlacement=V,this._effects=Y,this._anchorX=O,this._anchorY=L,this._minMaxZoom=Ln(Math.round(X*cy),Math.round(te*cy));const re=(S===hy.MAP?e5i:QLi)|(p?zN:0)|(v?t5i:0)|(y?i5i:0),fe=I&&I.sdf,ge=CF.load(e);ge.sdf=fe,ge.pattern=!0,ge.textureBinding=I.textureBinding,this._materialKey=ge.data,this._fillColor=s,this._outlineColor=c,this._sizeOutlineWidth=Up(Math.round(Math.min(Math.sqrt(128*o),255)),Math.round(Math.min(Math.sqrt(128*a),255)),Math.round(Math.min(Math.sqrt(128*d),255)),Math.round(Math.min(Math.sqrt(128*l),255)));const _e=I.rect.x+Ec,Ie=I.rect.y+Ec,ke=_e+I.width,Ne=Ie+I.height;this._offsets.xUpperLeft=_e,this._offsets.yUpperLeft=Ie,this._offsets.xUpperRight=ke,this._offsets.yUpperRight=Ie,this._offsets.xBottomLeft=_e,this._offsets.yBottomLeft=Ne,this._offsets.xBottomRight=ke,this._offsets.yBottomRight=Ne,ge.symbologyType===Yo.PIE_CHART?(this._texUpperLeft=Ln(0,1),this._texUpperRight=Ln(1,1),this._texBottomLeft=Ln(0,0),this._texBottomRight=Ln(1,0)):(this._texUpperLeft=Ln(_e,Ie),this._texUpperRight=Ln(ke,Ie),this._texBottomLeft=Ln(_e,Ne),this._texBottomRight=Ln(ke,Ne)),o*=N,a*=N,o*=G,a*=G;const J=Math.round(64*N);this._bitestAndDistRatio=Ln(re,J),this._computedWidth=o,this._computedHeight=a;const he=CT(),xe=d_();this._applyTransformation(xe,he)}static fromCIMMarker(e,i,r){const n=i&&i.width||1,s=i&&i.height||1,o=e.size,a=n/s*e.scaleX,l=e.scaleSymbolsProportionally&&e.frameHeight?o/e.frameHeight:1,c=jp(e.color),d=jp(e.outlineColor),p=on(o),y=p*a,v=on(e.offsetX||0),S=on(e.offsetY||0),I=on(e.outlineWidth||0)*l,O=e.alignment||hy.SCREEN,L=on(e.referenceSize),[N,G]=PF(e.scaleInfo,r);let V=e.rotation||0;e.rotateClockwise||(V=-V);let Y=0,X=0;const te=e.anchorPoint;te&&(e.isAbsoluteAnchorPoint?o&&(Y=te.x/(o*a),X=te.y/o):(Y=te.x,X=te.y));const re=new bre(e.materialKey,v,S,V,c,y,p,L,d,I,e.colorLocked,e.scaleSymbolsProportionally,!1,O,i,Y,X,e.sizeRatio,Fu(e.scaleFactor,1),e.markerPlacement,e.effects,N,G);return re._vertexBoundsScaleX=e.maxVVSize?e.maxVVSize/y:1,re._vertexBoundsScaleY=e.maxVVSize?e.maxVVSize/p:1,re}static fromPictureMarker(e,i){const r=Math.round(on(e.width)),n=Math.round(on(e.height)),s=y0t,o=Math.round(on(e.xoffset||0)),a=Math.round(on(e.yoffset||0)),l=new bre(e.materialKey,o,a,e.angle,s,r,n,n,0,0,!1,!1,!1,hy.SCREEN,i,0,0,1,1,null,null,UE,jE);return l._vertexBoundsScaleX=e.maxVVSize?e.maxVVSize/e.width:1,l._vertexBoundsScaleY=e.maxVVSize?e.maxVVSize/e.height:1,l}static fromSimpleMarker(e,i){const r=db(e.color),n=Math.round(on(e.size)),s=n,o=Math.round(on(e.xoffset||0)),a=Math.round(on(e.yoffset||0)),l=e.style,c=e.outline,d=0|(c?.color&&db(c.color)),p=0|(c?.width&&Math.round(on(c.width))),y=new bre(e.materialKey,o,a,e.angle,r,n,s,s,d,p,!1,!1,l==="esriSMSCross"||l==="esriSMSX",hy.SCREEN,i,0,0,126/64,1,null,null,UE,jE);return y.boundsType=l==="esriSMSCircle"?"circle":"square",y._vertexBoundsScaleX=e.maxVVSize?e.maxVVSize/e.size:1,y._vertexBoundsScaleY=e.maxVVSize?e.maxVVSize/e.size:1,y}static fromLineSymbolMarker(e,i){const r=db(e.color),n=6,s=Math.round(on(n*e.lineWidth)),o=s,a=e.style==="cross"||e.style==="x";let l;switch(e.placement){case"begin-end":l=F_.Both;break;case"begin":l=F_.JustBegin;break;case"end":l=F_.JustEnd;break;default:l=F_.None}const c={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:l,offsetAlongLine:0},d=new bre(e.materialKey,0,0,0,r,s,o,o/n,r,a?Math.round(on(e.lineWidth)):0,!1,!1,a,hy.MAP,i,0,0,126/64,1,c,null,UE,jE);return d.boundsType=e.style==="circle"?"circle":"square",d}};function wir(t,e,i,r,n,s,o){eke=0;const a=(r-i)*s,l=n&&n.length,c=l?(n[0]-i)*s:a;let d,p,y,v,S,I=jIt(e,i,r,0,c,s,!0);if(I&&I.next!==I.prev){if(l&&(I=Tir(e,i,r,n,I,s)),a>80*s){d=y=e[0+i*s],p=v=e[1+i*s];for(let O=s;O0)for(let l=r;l=r;l-=s)a=zIt(l+e*s,t[l+e*s],t[l+1+e*s],a);return a&&F6(a,a.next)&&(YQ(a),a=a.next),a}function WQ(t,e=t){if(!t)return t;let i,r=t;do if(i=!1,r.steiner||!F6(r,r.next)&&vy(r.prev,r,r.next)!==0)r=r.next;else{if(YQ(r),r=e=r.prev,r===r.next)break;i=!0}while(i||r!==e);return e}function qQ(t,e,i,r,n,s,o,a){if(!t)return;!a&&s&&(t=HIt(t,r,n,s));let l=t;for(;t.prev!==t.next;){const c=t.prev,d=t.next;if(s?Sir(t,r,n,s):xir(t))e.push(c.index/i+o),e.push(t.index/i+o),e.push(d.index/i+o),YQ(t),t=d.next,l=d.next;else if((t=d)===l){a?a===1?qQ(t=Mir(t,e,i,o),e,i,r,n,s,o,2):a===2&&Dir(t,e,i,r,n,s,o):qQ(WQ(t),e,i,r,n,s,o,1);break}}}function xir(t){const e=t.prev,i=t,r=t.next;if(vy(e,i,r)>=0)return!1;let n=t.next.next;const s=n;let o=0;for(;n!==t.prev&&(o===0||n!==s);){if(o++,Oj(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y)&&vy(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function Sir(t,e,i,r){const n=t.prev,s=t,o=t.next;if(vy(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,d=n.y>s.y?n.y>o.y?n.y:o.y:s.y>o.y?s.y:o.y,p=Z5e(a,l,e,i,r),y=Z5e(c,d,e,i,r);let v=t.prevZ,S=t.nextZ;for(;v&&v.z>=p&&S&&S.z<=y;){if(v!==t.prev&&v!==t.next&&Oj(n.x,n.y,s.x,s.y,o.x,o.y,v.x,v.y)&&vy(v.prev,v,v.next)>=0||(v=v.prevZ,S!==t.prev&&S!==t.next&&Oj(n.x,n.y,s.x,s.y,o.x,o.y,S.x,S.y)&&vy(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;v&&v.z>=p;){if(v!==t.prev&&v!==t.next&&Oj(n.x,n.y,s.x,s.y,o.x,o.y,v.x,v.y)&&vy(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;S&&S.z<=y;){if(S!==t.prev&&S!==t.next&&Oj(n.x,n.y,s.x,s.y,o.x,o.y,S.x,S.y)&&vy(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function zIt(t,e,i,r){const n=zme.create(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function YQ(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Cir(t){let e=t,i=t;do(e.x=i.next.y&&i.next.y!==i.y){const y=i.x+(n-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(y<=r&&y>o){if(o=y,y===r){if(n===i.y)return i;if(n===i.next.y)return i.next}s=i.x=i.x&&i.x>=l&&r!==i.x&&Oj(ns.x)&&XQ(i,t)&&(s=i,p=d)),i=i.next;return s}function HIt(t,e,i,r){let n;for(;n!==t;n=n.next){if(n=n||t,n.z===null&&(n.z=Z5e(n.x,n.y,e,i,r)),n.prev.next!==n||n.next.prev!==n)return n.prev.next=n,n.next.prev=n,HIt(t,e,i,r);n.prevZ=n.prev,n.nextZ=n.next}return t.prevZ.nextZ=null,t.prevZ=null,Air(t)}function Air(t){let e,i=1;for(;;){let r,n=t;t=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:t=l,l.prevZ=e,e=l}n=r}if(e.nextZ=null,i*=2,s<2)return t}}function vy(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function WIt(t,e,i,r){return!!(F6(t,e)&&F6(i,r)||F6(t,r)&&F6(i,e))||vy(t,e,i)>0!=vy(t,e,r)>0&&vy(i,r,t)>0!=vy(i,r,e)>0}function Pir(t,e){let i=t;do{if(i.index!==t.index&&i.next.index!==t.index&&i.index!==e.index&&i.next.index!==e.index&&WIt(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}function Oir(t,e,i,r,n,s){let o=0;for(let a=r,l=n-s;a=0&&(t-o)*(r-a)-(i-o)*(e-a)>=0&&(i-o)*(s-a)-(n-o)*(r-a)>=0}function XQ(t,e){return vy(t.prev,t,t.next)<0?vy(t,e,t.next)>=0&&vy(t,t.prev,e)>=0:vy(t,e,t.prev)<0||vy(t,t.next,e)<0}function Z5e(t,e,i,r,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function F6(t,e){return t.x===e.x&&t.y===e.y}function Rir(t,e){return t.x-e.x}function Mir(t,e,i,r){let n=t;do{const s=n.prev,o=n.next.next;!F6(s,o)&&WIt(s,n,n.next,o)&&XQ(s,o)&&XQ(o,s)&&(e.push(s.index/i+r),e.push(n.index/i+r),e.push(o.index/i+r),YQ(n),YQ(n.next),n=t=o),n=n.next}while(n!==t);return n}function Dir(t,e,i,r,n,s,o){let a=t;do{let l=a.next.next;for(;l!==a.prev;){if(a.index!==l.index&&Fir(a,l)){let c=qIt(a,l);return a=WQ(a,a.next),c=WQ(c,c.next),qQ(a,e,i,r,n,s,o,0),void qQ(c,e,i,r,n,s,o,0)}l=l.next}a=a.next}while(a!==t)}function Fir(t,e){return t.next.index!==e.index&&t.prev.index!==e.index&&!Pir(t,e)&&XQ(t,e)&&XQ(e,t)&&Lir(t,e)}function Lir(t,e){let i=t,r=!1;const n=(t.x+e.x)/2,s=(t.y+e.y)/2;do i.y>s!=i.next.y>s&&i.next.y!==i.y&&n<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next;while(i!==t);return r}function qIt(t,e){const i=zme.create(t.index,t.x,t.y),r=zme.create(e.index,e.x,e.y),n=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,s.next=r,r.prev=s,r}let zme=class D5t{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,i,r){const n=eke0))break;p+=L,y.push(a+d),d+=O}const v=o.length;wir(o,i,a,a+d,y,2,s);const S=$ir(o,i,v,o.length,s),I=Math.abs(p);if(Math.abs((S-I)/Math.max(1e-7,I))>Nir)return o.length=0,!1;l=c,a+=d}return!0}function Gir(t){const{coords:e,lengths:i}=t,{buffer:r}=R1t(e,i);return r}function Vir(t,e,i){let r=0;for(let n=0;ni||li)return!0}r+=s}return!1}function Uir(t,e){if(lt(t))return null;if(!Vir(t,-128,Tc+128))return t;L6.setPixelMargin(e),L6.reset(fy.Polygon);let i=0;for(let o=0;on||pn){o=!0;continue}l.push({x:d,y:p})}let y=!1;const v=c.length;for(let S=1;Sn||pn){y=!0;break}l.push({x:d,y:p})}if(y)o=!0;else{if(o){const S=i.resultWithStarts();if(S)for(const I of S)s.push(I)}else s.push({line:l,start:0});a++,o=!1}}return s=s.filter(l=>l.line.length>1),s.length===0?null:s}L6.setExtent(Tc),tke.setExtent(Tc);const Hme=8,Y_=16,XIt=65535,KIt=t=>class extends t{constructor(...e){super(...e),this.tessellationProperties={},this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0},this.geometryType=wn.LINE}writeGeometry(e,i,r,n){this._writeGeometry(e,i,r,n)}_initializeTessellator(e){const i=vO.load(this._materialKey),r=ES.load(this._materialKey),n=this._tessellationOptions,s=i.vvSizeFieldStops||i.vvSizeMinMaxValue||i.vvSizeScaleStops||i.vvSizeUnitValue,o=this.tessellationProperties._halfWidth(r,n,s,o,a,l,c,d,p,y,v)=>{const S=Ln(v,Math.ceil(Y_*t._halfWidth)),I=Up(Math.round(Y_*c),Math.round(Y_*d),Math.round(Y_*p),Math.round(Y_*y)),O=Up(Y_*a,Y_*l,0,t._bitset),L=t.out;return L.vertexBounds(r,n,e,i),L.vertexWrite(Ln(Hme*r,Hme*n)),L.vertexWrite(t.id),L.vertexWrite(t._fillColor),L.vertexWrite(I),L.vertexWrite(S),L.vertexWrite(t._tl),L.vertexWrite(t._br),L.vertexWrite(O),L.vertexWrite(Ln(Math.ceil(Y_*t._halfReferenceWidth),0)),L.vertexWrite(t.minMaxZoom),L.vertexEnd(),t.offset+t.vertexCount++},Hir=(t,e,i)=>(r,n,s,o,a,l,c,d,p,y,v)=>{const S=Ln(Y_*t._halfWidth,Y_*t._halfReferenceWidth),I=Up(Y_*c+128,Y_*d+128,Y_*p+128,Y_*y+128),O=t.out,L=t._bitset<<24|t.id;O.vertexBounds(r,n,e,i),O.vertexWrite(Ln(Hme*r,Hme*n)),O.vertexWrite(L),O.vertexWrite(t._fillColor);const N=iEt(t.key);return N||(O.vertexWrite(0),O.vertexWrite(0)),O.vertexWrite(0),O.vertexWrite(S),O.vertexWrite(I),N||O.vertexWrite(t.minMaxZoom),O.vertexEnd(),t.offset+t.vertexCount++},Wir=t=>(e,i,r)=>{const n=t.out;n.indexWrite(e),n.indexWrite(i),n.indexWrite(r),t.indexCount+=3};let ike=class fH extends KIt(zQ){constructor(e,i,r,n,s,o,a,l,c,d,p,y,v,S,I,O,L,N,G,V){super();const Y=vO.load(e);i&&(Y.sdf=i.sdf,Y.pattern=!0,Y.textureBinding=i.textureBinding),this._capType=n,this._joinType=s,this._miterLimitCosine=X5e(o),this.tessellationProperties._fillColor=a,this.tessellationProperties._tl=l,this.tessellationProperties._br=c,this._hasPattern=d,this._isDashed=p,this._zOrder=L,this._effects=N,this._minMaxZoom=Ln(Math.round(G*cy),Math.round(V*cy)),this._materialKey=Y.data;const X=(v?zN:0)|(S?r5i:0)|(y?P0t:0)|(I?wpe:0);this.tessellationProperties._bitset=X,this.tessellationProperties._halfWidth=.5*r,this.tessellationProperties._halfReferenceWidth=.5*O,this.tessellationProperties.offset=0,this._initializeTessellator(!1)}static fromCIMLine(e,i,r){const n=e.color,s=e.scaleFactor||1,o=!!e.dashTemplate;let a=e.cap;o&&a===vf.ROUND&&(a=vf.SQUARE);const l=e.join,c=on(e.width)*s,d=on(e.referenceWidth),p=on(e.miterLimit),y=n&&jp(n)||0,[v,S]=PF(e.scaleInfo,r),I=!1;if(!i)return new fH(e.materialKey,i,c,a,l,p,y,0,0,!1,o,e.scaleDash??!1,e.colorLocked??!1,I,e.sampleAlphaOnly,d,e.zOrder,e.effects,v,S);const{rect:O,width:L,height:N}=i,G=O.x+Ec,V=O.y+Ec,Y=G+L,X=V+N,te=Ln(G,V),re=Ln(Y,X),fe=!1;return new fH(e.materialKey,i,c,a,l,p,y,te,re,!0,o,e.scaleDash??!1,e.colorLocked??!1,fe,e.sampleAlphaOnly,d,e.zOrder,e.effects,v,S)}static fromFillOutline(e){const i=ES.load(e.materialKey);return gme(i)&&e.outline&&e.outline?.style==="esriSLSSolid"?fH.fromSimpleLine({hash:"",materialKey:e.materialKey,...e.outline},null,!0):null}static fromSimpleLine(e,i,r=!1){const{color:n}=e,s=e.style!=="esriSLSSolid"&&e.style!=="esriSLSNull",o=M5i(e.cap||"round"),a=D5i(e.join||"round");let l=n&&e.style!=="esriSLSNull"&&db(n)||0;e.style==="esriSLSNull"&&(l=0);const c=on(e.width),d=e.miterLimit;if(!i)return new fH(e.materialKey,i,c,o,a,d,l,0,0,!1,s,!0,!1,r,!1,c,0,null,UE,jE);const{rect:p,width:y,height:v}=i,S=p.x+Ec,I=p.y+Ec,O=S+y,L=I+v,N=Ln(S,I),G=Ln(O,L);return new fH(e.materialKey,i,c,o,a,d,l,N,G,!0,s,!0,!1,r,!1,c,0,null,UE,jE)}static fromPictureLineSymbol(e,i,r,n){return Ei.getLogger("esri.views.2d.engine.webgl.WGLLineTemplate").error("PictureLineSymbol support does not exist!"),null}};const qir=100,JIt=1,ZIt=t=>class extends t{constructor(...e){super(...e),this.forceLibtess=!1,this._bitset=0,this._lineTemplate=null,this.geometryType=wn.FILL}_maybeAddLineTemplate(e){this._lineTemplate=ike.fromFillOutline(e)}_write(e,i,r,n){const s=i.geometryType==="esriGeometryPoint",o=ES.load(this._materialKey);e.recordStart(i.getDisplayId(),this._materialKey,this.geometryType,s),this._writeGeometry(e,i,o,n,s),gme(o)&&ye(this._lineTemplate)&&this._lineTemplate.writeGeometry(e,i,n,s),e.recordEnd()}_writeGeometry(e,i,r,n,s){const o=this._getGeometry(i,n,s);if(lt(o))return;const a=[];if(!(o.maxLength>qir)&&!this.forceLibtess&&Bir(a,o))return void(a.length&&this._writeVertices(e,i,o.coords,o.lengths,r,a));const l=Gir(o);this._writeVertices(e,i,l,[l.length/2],r)}_writeVertex(e,i,r,n,s,o){const a=Ln(JIt*n,JIt*s);if(e.vertexBounds(n,s,0,0),e.vertexWrite(a),e.vertexWrite(i),r.symbologyType===Yo.DOT_DENSITY)e.vertexWriteF32(1/Math.abs(o.readGeometryArea()));else{e.vertexWrite(this.fillColor);const l=iEt(r);l||(e.vertexWrite(this.tl),e.vertexWrite(this.br)),e.vertexWrite(this.aux21),e.vertexWrite(this.aux22),e.vertexWrite(this.aux3),l||e.vertexWrite(this._minMaxZoom)}}_writeVertices(e,i,r,n,s,o){const a=i.getDisplayId(),l=this._bitset<<24|a,c=n.reduce((v,S)=>v+S),d=Cpe(s.geometryType,s.symbologyType).geometry/4,p=e.vertexCount();e.vertexEnsureSize(d*c);let y=0;if(o)for(const v of o){const S=r[2*v],I=r[2*v+1];this._writeVertex(e,l,s,S,I,i),y++}else for(let v=0;v0,a=i.readLegacyFeature(),l=i.getObjectId(),c=this._materialCache,d=this._cimLayer.materialHash;if(!d)return QIt.error("A Dynamic mesh template must have a material hash value or function!"),Promise.reject(null);const p=typeof d=="function"?d(a,r,n,l):d,y=c.get(p);if(y!=null)return Promise.resolve(y);const v=this._ongoingMaterialRequestMap.get(p);if(v)return v;const S=this._cimLayer,I=YYi(S.cim,this._cimLayer.materialOverrides);I.mosaicHash=p;const{type:O,url:L}=S,N={cim:I,type:O,mosaicHash:p,url:L,size:null,dashTemplate:null,text:null,fontName:null,objectId:l,animatedSymbolProperties:null};switch(O){case"marker":N.size=vB(S.size,a,r,n),N.animatedSymbolProperties=vB(S.animatedSymbolProperties,a,r,n);break;case"line":N.dashTemplate=S.dashTemplate;break;case"text":N.text=vB(S.text,a,r,n),N.fontName=vB(S.fontName,a,r,n)}const G=e.getMosaicItem(N,s).then(V=>(o||(this._ongoingMaterialRequestMap.delete(p),c.set(p,V)),V)).catch(V=>(this._ongoingMaterialRequestMap.delete(p),QIt.error(".analyze()",V.message),null));return o||this._ongoingMaterialRequestMap.set(p,G),G}};const eAt=128;let Yir=class F5t extends ZIt(Wme){constructor(e,i,r){if(super(e),this._minMaxZoom=Ln(Math.round(i*cy),Math.round(r*cy)),Nl(e.color)){const d=(p,y,v)=>{const S=e.color(p,y,v);return S&&jp(S)||0};this._dynamicPropertyMap.set("fillColor",d)}else{const d=e.color;this.fillColor=d&&jp(d)||0}const n=e.cim.placement?.type==="CIMMarkerPlacementInsidePolygon"&&e.cim.placement.shiftOddRows?2:1,s=e.height;if(Nl(s)){const d=(p,y,v)=>s(p,y,v)*n;this._dynamicPropertyMap.set("_height",d)}else this._height=(s||0)*n;const o=e.offsetX;if(Nl(o)){const d=(p,y,v)=>on(o(p,y,v));this._dynamicPropertyMap.set("_offsetX",d)}else this._offsetX=on(o||0);const a=e.offsetY;if(Nl(a)){const d=(p,y,v)=>on(-a(p,y,v));this._dynamicPropertyMap.set("_offsetY",d)}else this._offsetY=on(-a||0);const l=e.scaleX;Nl(l)?this._dynamicPropertyMap.set("_scaleX",l):this._scaleX=l||1;const c=e.angle;if(Nl(c)){const d=(p,y,v)=>DQ(c(p,y,v));this._dynamicPropertyMap.set("_angle",d)}else this._angle=DQ(c)||0;if(ye(e.effects)){const d=e.effects;Nl(d)?this._dynamicPropertyMap.set("_effects",d):this._effects=d}this._cimFillLayer=e,this._bitset=(e.colorLocked?zN:0)|(e.applyRandomOffset?O0t:0)|(e.sampleAlphaOnly?wpe:0)|(e.hasUnresolvedReplacementColor?R0t:0),this._fillMaterialKey=e.materialKey}static fromCIMFill(e,i){const[r,n]=PF(e.scaleInfo,i);return new F5t(e,r,n)}bindFeature(e,i,r){const n=e.readLegacyFeature();this._dynamicPropertyMap.forEach((d,p)=>{this[p]=d(n,i,r)});const s=ES.load(this._fillMaterialKey),o=this._materialCache,a=(0,this._cimFillLayer.materialHash)(n,i,r),l=o.get(a);let c=null;if(l&&W_(l.spriteMosaicItem)&&(c=l.spriteMosaicItem),c){const{rect:d,width:p,height:y}=c,v=d.x+Ec,S=d.y+Ec,I=v+p,O=S+y;let L=Math.round(on(this._height));L<=0&&(L=O-S);let N=Math.round(on(this._height/y*p||0));N<=0&&(N=I-v);const G=this._scaleX,V=1;this.tl=Ln(v,S),this.br=Ln(I,O),this.aux21=Ln(N,L),this.aux22=Ln(this._offsetX,this._offsetY),this.aux3=Up(G*eAt,V*eAt,this._angle,0),s.sdf=c.sdf,s.pattern=!0,s.textureBinding=c.textureBinding}else this.tl=0,this.br=0,this.aux21=0,this.aux22=0,this.aux3=0,s.sdf=!1,s.pattern=!1,s.textureBinding=0;this._materialKey=s.data}},Xir=class L5t extends KIt(Wme){constructor(e,i,r){super(e),this._minMaxZoom=Ln(Math.round(i*cy),Math.round(r*cy)),this._cimLineLayer=e;let n=0;Nl(e.width)||(n=.5*on(e.width));const s=(p,y,v)=>Nl(e.width)?.5*on(e.width(p,y,v)):n;this._dynamicPropertyMap.set("_halfWidth",s),Nl(e.cap)?this._dynamicPropertyMap.set("_capType",e.cap):this._capType=e.cap,Nl(e.join)?this._dynamicPropertyMap.set("_joinType",e.join):this._joinType=e.join;const o=e.color;if(Nl(o)){const p=(y,v,S)=>jp(o(y,v,S));this._dynamicPropertyMap.set("_fillColor",p)}else this._fillColor=o&&jp(o)||0;const a=e.miterLimit;if(Nl(a)){const p=(y,v,S)=>X5e(a(y,v,S));this._dynamicPropertyMap.set("_miterLimitCosine",p)}else this._miterLimitCosine=X5e(a);if(ye(e.effects)){const p=e.effects;Nl(p)?this._dynamicPropertyMap.set("_effects",p):this._effects=p}this._scaleFactor=e.scaleFactor||1,this._isDashed=e.dashTemplate!=null;const l=e.colorLocked?zN:0,c=e.scaleDash?P0t:0,d=e.sampleAlphaOnly?wpe:0;this.tessellationProperties._bitset=l|c|d,this._materialKey=e.materialKey,this._initializeTessellator(!0)}static fromCIMLine(e,i){const[r,n]=PF(e.scaleInfo,i);return new L5t(e,r,n)}bindFeature(e,i,r){const n=e.readLegacyFeature();this._dynamicPropertyMap.forEach((d,p)=>{this[p]=d(n,i,r)}),this._halfWidth*=this._scaleFactor;const s=this._materialCache,o=(0,this._cimLineLayer.materialHash)(n,i,r),a=s.get(o);let l=null;if(a&&W_(a.spriteMosaicItem)&&(l=a.spriteMosaicItem),l){this._hasPattern=!0;const{rect:d,width:p,height:y}=l,v=d.x+Ec,S=d.y+Ec,I=v+p,O=S+y;this.tessellationProperties._tl=Ln(v,S),this.tessellationProperties._br=Ln(I,O)}else this._hasPattern=!1,this.tessellationProperties._tl=0,this.tessellationProperties._br=0;this.tessellationProperties._fillColor=this._fillColor,this.tessellationProperties._halfWidth=this._halfWidth,this.tessellationProperties.offset=0,this.tessellationProperties._halfReferenceWidth=this.tessellationProperties._halfWidth;const c=vO.load(this._materialKey);l&&(c.sdf=l.sdf,c.pattern=!0,c.textureBinding=l.textureBinding),this._materialKey=c.data}};const Kir=CT(),Jir=d_();let Zir=class k5t extends UIt(Wme){constructor(e,i,r){super(e),this._cimMarkerLayer=e,this._minMaxZoom=Ln(Math.round(i*cy),Math.round(r*cy));const n=e.color;if(Nl(n)){const y=(v,S,I)=>jp(n(v,S,I));this._dynamicPropertyMap.set("_fillColor",y)}else this._fillColor=jp(n);const s=e.outlineColor;if(Nl(s)){const y=(v,S,I)=>jp(s(v,S,I));this._dynamicPropertyMap.set("_outlineColor",y)}else this._outlineColor=jp(s);const o=e.size;if(Nl(o)){const y=(v,S,I)=>on(o(v,S,I));this._dynamicPropertyMap.set("_size",y)}else this._size=on(o)||0;const a=e.scaleX;Nl(a)?this._dynamicPropertyMap.set("_scaleX",a):this._scaleX=a;const l=e.offsetX;if(Nl(l)){const y=(v,S,I)=>on(l(v,S,I));this._dynamicPropertyMap.set("xOffset",y)}else this.xOffset=on(l)||0;const c=e.offsetY;if(Nl(c)){const y=(v,S,I)=>on(c(v,S,I));this._dynamicPropertyMap.set("yOffset",y)}else this.yOffset=on(c)||0;const d=e.outlineWidth;if(Nl(d)){const y=(v,S,I)=>on(d(v,S,I));this._dynamicPropertyMap.set("_outlineWidth",y)}else this._outlineWidth=on(d)||0;const p=e.rotation;if(Nl(p)?this._dynamicPropertyMap.set("_angle",p):this._angle=p||0,ye(e.effects)){const y=e.effects;Nl(y)?this._dynamicPropertyMap.set("_effects",y):this._effects=y}if(ye(e.markerPlacement)){const y=e.markerPlacement;Nl(y)?this._dynamicPropertyMap.set("_markerPlacement",y):this._markerPlacement=y}this._scaleFactor=Fu(e.scaleFactor,1),this._bitSet=(e.alignment===hy.MAP?1:0)|(e.colorLocked?1:0)<<1|(e.scaleSymbolsProportionally?1:0)<<3,this._materialKey=e.materialKey}static fromCIMMarker(e,i){const[r,n]=PF(e.scaleInfo,i);return new k5t(e,r,n)}bindFeature(e,i,r){const n=e.readLegacyFeature(),s=e.getObjectId();this._dynamicPropertyMap.forEach((ke,Ne)=>{this[Ne]=ke(n,i,r)});const o=this._cimMarkerLayer.materialHash,a=typeof o=="function"?o(n,i,r,s):o,l=this._materialCache.get(a);if(!l||!W_(l.spriteMosaicItem)||!l.spriteMosaicItem)return void Ei.getLogger("esri.views.2d.engine.webgl.WGLDynamicMarkerTemplate").error(new st("mapview-cim","Encountered an error when binding feature"));const c=l.spriteMosaicItem,d=this._cimMarkerLayer.sizeRatio,p=c.width/c.height*this._scaleX,y=this._cimMarkerLayer.rotateClockwise?this._angle:-this._angle;let v=this._size,S=v*p;const I=this.xOffset,O=this.yOffset;this.xOffset*=this._scaleFactor,this.yOffset*=this._scaleFactor;const L=this._cimMarkerLayer.scaleSymbolsProportionally&&this._cimMarkerLayer.frameHeight?this._size/on(this._cimMarkerLayer.frameHeight):1,N=this._outlineWidth*L,G=on(this._cimMarkerLayer.referenceSize);let V=0,Y=0;const X=this._cimMarkerLayer.anchorPoint;X&&(this._cimMarkerLayer.isAbsoluteAnchorPoint?this._size&&(V=on(X.x)/(this._size*p),Y=on(X.y)/this._size):(V=X.x,Y=X.y)),this._anchorX=V,this._anchorY=Y,this._sizeOutlineWidth=Up(Math.round(Math.min(Math.sqrt(128*S),255)),Math.round(Math.min(Math.sqrt(128*v),255)),Math.round(Math.min(Math.sqrt(128*N),255)),Math.round(Math.min(Math.sqrt(128*G),255))),this.angle=y;const te=Math.round(64*d);this._bitestAndDistRatio=Ln(this._bitSet,te);const re=c.rect.x+Ec,fe=c.rect.y+Ec,ge=re+c.width,_e=fe+c.height;this._texUpperLeft=Ln(re,fe),this._texUpperRight=Ln(ge,fe),this._texBottomLeft=Ln(re,_e),this._texBottomRight=Ln(ge,_e);const Ie=CF.load(this._materialKey);Ie.sdf=c.sdf,Ie.pattern=!0,Ie.textureBinding=c.textureBinding,this._materialKey=Ie.data,S*=d,v*=d,S*=this._scaleFactor,v*=this._scaleFactor,S*=c.rect.width/c.width,v*=c.rect.height/c.height,this._computedWidth=S,this._computedHeight=v,this._applyTransformation(Jir,Kir),this.xOffset=I,this.yOffset=O}};function rke(t){if(t==null)return[];const e=new Array(t.length);for(let i=0;ijp(s(O,L,N));this._dynamicPropertyMap.set("_color",I)}else this._color=jp(s);const o=e.outlineColor;if(Nl(o)){const I=(O,L,N)=>jp(o(O,L,N));this._dynamicPropertyMap.set("_haloColor",I)}else this._haloColor=jp(o);let a;Nl(e.size)||(a=Math.min(Math.round(on(e.size*e.sizeRatio)),127));const l=(I,O,L)=>Nl(e.size)?Math.min(Math.round(on(e.size(I,O,L)*e.sizeRatio)),127):a;if(this._dynamicPropertyMap.set("_size",l),Nl(e.outlineSize)){const I=(O,L,N)=>Math.min(Math.floor(tAt*on(e.outlineSize(O,L,N)*e.sizeRatio)),127);this._dynamicPropertyMap.set("_haloSize",I)}else this._haloSize=Math.min(Math.floor(tAt*on(e.outlineSize*e.sizeRatio)),127);let c;Nl(e.offsetX)||(c=Math.round(on(e.offsetX*e.sizeRatio)));const d=(I,O,L)=>Nl(e.offsetX)?Math.round(on(e.offsetX(I,O,L)*e.sizeRatio)):c;let p;this._dynamicPropertyMap.set("_xOffset",d),Nl(e.offsetY)||(p=Math.round(on(e.offsetY*e.sizeRatio)));const y=(I,O,L)=>Nl(e.offsetY)?Math.round(on(e.offsetY(I,O,L)*e.sizeRatio)):p;if(this._dynamicPropertyMap.set("_yOffset",y),Nl(e.angle)?this._dynamicPropertyMap.set("_angle",e.angle):this._angle=e.angle,Nl(e.horizontalAlignment)?this._dynamicPropertyMap.set("_horizontalAlignment",e.horizontalAlignment):this._horizontalAlignment=e.horizontalAlignment,Nl(e.verticalAlignment)?this._dynamicPropertyMap.set("_verticalAlignment",e.verticalAlignment):this._verticalAlignment=e.verticalAlignment,ye(e.effects)){const I=e.effects;Nl(I)?this._dynamicPropertyMap.set("_effects",I):this._effects=I}if(ye(e.markerPlacement)){const I=e.markerPlacement;Nl(I)?this._dynamicPropertyMap.set("_markerPlacement",I):this._textPlacement=I}Nl(e.text)?this._dynamicPropertyMap.set("_text",e.text):this._text=e.text,this._backgroundColor=e.backgroundColor&&jp(e.backgroundColor),this._borderLineColor=e.borderLineColor&&jp(e.borderLineColor),this._borderLineSize=e.borderLineWidth,this._scaleFactor=n;const v=Math.min(Math.round(on(e.referenceSize*e.sizeRatio)),127);this._referenceSize=Math.round(Math.sqrt(256*v)),this._materialKey=e.materialKey;const S=vj.load(this._materialKey);S.sdf=!0,this._bitset=(e.alignment===hy.MAP?1:0)|(e.colorLocked?1:0)<<1,this._materialKey=S.data,this._decoration="none",this._lineHeight=1,this._lineWidth=512,this._isCIM=!0}static fromCIMText(e,i){const[r,n]=PF(e.scaleInfo,i);return new N5t(e,r,n)}async analyze(e,i,r,n){const s=i.readLegacyFeature(),o=Qir(this._cimTextLayer,s,r,n),a=await super.analyze(e,i,r,n,rke(o));return a&&a.glyphMosaicItems&&this._textToGlyphs.set(o,a.glyphMosaicItems),a}bindFeature(e,i,r){const n=e.readLegacyFeature();if(this._dynamicPropertyMap.forEach((o,a)=>{this[a]=o(n,i,r)}),!this._text||this._text.length===0)return void(this._shapingInfo=null);this._size*=this._scaleFactor,this._scale=this._size/fpe,this._xOffset*=this._scaleFactor,this._yOffset*=this._scaleFactor,this._xAlignD=_St(Fu(this._horizontalAlignment,"center")),this._yAlignD=bSt(Fu(this._verticalAlignment,"baseline"));const s=this._textToGlyphs.get(this._text)??[];this.bindTextInfo(s,!1)}};const Rj=128;let nke=class mH extends ZIt(zQ){constructor(e,i,r,n,s,o,a,l,c,d,p,y,v,S,I,O){super(),this._effects=S;const L=ES.load(e);i&&(L.sdf=i.sdf,L.pattern=!0,L.textureBinding=i.textureBinding),this.fillColor=r,this.tl=n,this.br=s,this.aux21=Ln(o,a),this.aux22=Ln(l,c),this.aux3=Up(d,p,y,0),this._bitset=v,this._minMaxZoom=Ln(Math.round(I*cy),Math.round(O*cy)),this._materialKey=L.data}static fromCIMFill(e,i,r){const n=e.color,s=n&&jp(n)||0,o=e.materialKey,[a,l]=PF(e.scaleInfo,r),c=(e.colorLocked?zN:0)|(e.applyRandomOffset?O0t:0)|(e.sampleAlphaOnly?wpe:0)|(e.hasUnresolvedReplacementColor?R0t:0);if(!i)return new mH(o,null,s,0,0,0,0,0,0,0,0,0,c,e.effects,a,l);const{rect:d,width:p,height:y}=i,v=e.scaleX||1,S=d.x+Ec,I=d.y+Ec,O=S+p,L=I+y,N=on(e.height);let G=v*N;e.cim.type==="CIMHatchFill"&&(G*=p/y);let V=Math.round(N);V<=0&&(V=L-I);let Y=Math.round(G);Y<=0&&(Y=O-S);const X=on(e.offsetX||0),te=on(-e.offsetY||0),re=Ln(S,I),fe=Ln(O,L);return new mH(o,i,s,re,fe,Y,V,X,te,Rj,Rj,DQ(e.angle),c,e.effects,a,l)}static fromSimpleFill(e,i,r=!1){const{color:n}=e,s=n&&e.style!=="esriSFSNull"&&db(n)||0,o=r?zN:0,a=e.materialKey;let l;if(i){const{rect:c,width:d,height:p,pixelRatio:y}=i,v=c.x+Ec,S=c.y+Ec,I=v+d,O=S+p,L=Ln(v,S),N=Ln(I,O);l=new mH(a,i,s,L,N,d/y,p/y,0,0,Rj,Rj,0,o,null,UE,jE)}else l=new mH(a,null,s,0,0,0,0,0,0,0,0,0,o,null,UE,jE);return l._maybeAddLineTemplate(e),l}static fromPictureFill(e,i,r=!1){const n=y0t,{rect:s,width:o,height:a}=i,l=s.x+Ec,c=s.y+Ec,d=l+o,p=c+a,y=Ln(l,c),v=Ln(d,p),S=Math.round(on(e.width)),I=Math.round(on(e.height)),O=on(e.xoffset),L=on(-e.yoffset),N=e.materialKey,G=r?zN:0,V=new mH(N,i,n,y,v,S,I,O,L,Rj*e.xscale,Rj*e.yscale,0,G,null,UE,jE);return V._maybeAddLineTemplate(e),V}},trr=class{constructor(){this._resolver=null}isHeld(){return!!this._resolver}async acquire(){this._resolver?(await this._resolver.promise,await this.acquire()):this._resolver=Mf()}release(){const e=this._resolver;this._resolver=null,e?.resolve()}};async function irr(t,e,i){try{await t.acquire(),await e(i),t.release()}catch(r){throw t.release(),r}}const rrr={marker:wn.MARKER,fill:wn.FILL,line:wn.LINE,text:wn.TEXT};let nrr=class{constructor(e,i,r,n){const s={minScale:i?.minScale,maxScale:i?.maxScale},o=srr(s);this.layers=e,this.data=i,this.hash=this._createHash()+o,this.rendererKey=r;const a={isOutline:!1,placement:null,symbologyType:Yo.DEFAULT,vvFlags:r};for(const l of e){const c=rrr[l.type];a.isOutline=l.type==="line"&&l.isOutline,l.materialKey=TS(c,a),l.maxVVSize=n,l.scaleInfo=s,l.templateHash+=o}}get type(){return"expanded-cim"}_createHash(){let e="";for(const i of this.layers)e+=i.templateHash;return e}};function srr(t){return t.minScale||t.maxScale?t.minScale+"-"+t.maxScale:""}async function orr(t,e,i){if(!t.name)throw new st("style-symbol-reference-name-missing","Missing name in style symbol reference");if(t.styleName&&t.styleName==="Esri2DPointSymbolsStyle")return arr(t,i);try{return lrr(await Cxe(t,e,i),t.name,e,i)}catch(r){return sn(r),null}}async function arr(t,e){const i=Gze.replace(/\{SymbolName\}/gi,t.name);try{const r=await iq(i,e);return Use(r.data)}catch(r){return sn(r),null}}async function lrr(t,e,i,r){const n=t.data,s={portal:i&&ye(i.portal)?i.portal:_c.getDefault(),url:sa(t.baseUrl),origin:"portal-item"},o=n.items.find(l=>l.name===e);if(!o)throw new st("symbolstyleutils:symbol-name-not-found",`The symbol name '${e}' could not be found`,{symbolName:e});let a=ew(Nze(o,"cimRef"),s);Ftt()&&(a=Dle(a));try{const l=await iq(a,r);return Use(l.data)}catch(l){return sn(l),null}}const iAt=async(t,e,i)=>new nrr(await RYi(t.data,e,i),t.data,t.rendererKey,t.maxVVSize);async function PS(t,e,i,r){if(!t)return null;if(t.type==="cim")return iAt(t,e,i);if(t.type==="web-style"){const n={type:"cim",data:await orr(t,null,r)??void 0,rendererKey:t.rendererKey,maxVVSize:t.maxVVSize};return iAt(n,e,i)}return t}function qme(t){if(!t)return null;const{avoidSDFRasterization:e,type:i,cim:r,url:n,materialHash:s}=t,o={cim:r,type:i,mosaicHash:s,url:n,size:null,dashTemplate:null,path:null,text:null,fontName:null,animatedSymbolProperties:null,avoidSDFRasterization:e};switch(i){case"marker":o.size=t.size,o.path=t.path,o.animatedSymbolProperties=t.animatedSymbolProperties;break;case"line":o.dashTemplate=t.dashTemplate;break;case"text":o.text=t.text,o.fontName=t.fontName}return o}const X_=Ei.getLogger("esri.views.2d.engine.webgl.mesh.templates.WGLTemplateStore"),rAt={sortKey:null,templates:new Array},ske={isOutline:!1,placement:null,symbologyType:Yo.DEFAULT,vvFlags:0},urr={...vSe,hash:JSON.stringify(vSe),materialKey:TS(wn.MARKER,ske)},crr={..._Se,hash:JSON.stringify(_Se),materialKey:TS(wn.LINE,ske)},hrr={...bSe,hash:JSON.stringify(bSe),materialKey:TS(wn.FILL,ske)};function SO(t,e){const i=t.length;return t.push(null),e.then(r=>t[i]=r),t}function KQ(t){return t!=null&&!!(1&t)}function drr(t){return t.name==="worker:port-closed"}let nAt=class{constructor(e,i){this._idCounter=1,this._templateIdCounter=1,this._idToTemplateGroup=new Map,this._symbolToTemplate=new Map,this._fetchQueue=[],this._idToResolver=new Map,this._cimTemplateCache=new Map,this._cimAnalyses=[],this._lock=new trr,this._fetchResource=e,this._tileInfo=i}get _markerError(){return this._errorTemplates.marker[0]}get _fillError(){return this._errorTemplates.fill[0]}get _lineError(){return this._errorTemplates.line[0]}get _textError(){return this._errorTemplates.line[0]}createTemplateGroup(e,i,r=null){this._initErrorTemplates();const n=e.hash,s=this._symbolToTemplate.get(n);if(s!=null)return s;const o=new Array,a={sortKey:r,templates:o};i&&this._createMeshTemplates(o,i,!0),this._createMeshTemplates(o,e,!1);const l=this._createGroupId(e.type==="expanded-cim"&&prr(e));return this._idToTemplateGroup.set(l,a),this._symbolToTemplate.set(n,l),l}getTemplateGroup(e){return this._idToTemplateGroup.get(e)??rAt}getDynamicTemplateGroup(e){return this._idToTemplateGroup.has(e)?(KQ(e)||X_.error("mapview-template-store",`Id ${e} does not refer to a dynamic template`),this._idToTemplateGroup.get(e)):rAt}getMosaicItem(e,i){const r=this._createTemplateId(),n=new Promise(s=>this._idToResolver.set(r,s));return this._fetchQueue.push({symbol:e,id:r,glyphIds:i}),n}finalize(e){return this._fetchQueue.length||this._lock.isHeld()?irr(this._lock,this._fetchAllQueuedResources.bind(this),e):Promise.resolve()}_initErrorTemplates(){this._errorTemplates||(this._errorTemplates={fill:this._createMeshTemplates([],hrr,!1),marker:this._createMeshTemplates([],urr,!1),line:this._createMeshTemplates([],crr,!1)})}_fetchAllQueuedResources(e){if(!this._fetchQueue.length)return Promise.resolve();const i=this._fetchQueue,r=this._cimAnalyses;return this._fetchQueue=[],this._cimAnalyses=[],Promise.all(r).then(()=>this._fetchResource(i,e).then(n=>{for(const{id:s,mosaicItem:o}of n)this._idToResolver.get(s)(o),this._idToResolver.delete(s)})).catch(n=>{ss(n)?this._fetchQueue=this._fetchQueue.concat(i):drr(n)||X_.error(new st("mapview-template-store","Unable to fetch requested texture resources",n))})}_createGroupId(e){return this._idCounter++<<1|(e?1:0)}_createTemplateId(){return this._templateIdCounter++}async _createSMS(e){const{spriteMosaicItem:i}=await this.getMosaicItem(e);return W_(i,X_)?HQ.fromSimpleMarker(e,i):this._markerError}async _createPMS(e){const{spriteMosaicItem:i}=await this.getMosaicItem(e);return W_(i,X_)?HQ.fromPictureMarker(e,i):this._markerError}async _createSFS(e,i){const{spriteMosaicItem:r}=await this.getMosaicItem(e);return W_(r,X_)?nke.fromSimpleFill(e,r,i):this._fillError}async _createPFS(e,i){const{spriteMosaicItem:r}=await this.getMosaicItem(e);return W_(r,X_)?nke.fromPictureFill(e,r,i):this._fillError}async _createSLS(e,i){const{spriteMosaicItem:r}=await this.getMosaicItem(e);return W_(r,X_)?ike.fromSimpleLine(e,r):this._lineError}async _createLMS(e){const{spriteMosaicItem:i}=await this.getMosaicItem(e);return W_(i,X_)?HQ.fromLineSymbolMarker(e,i):this._markerError}async _createTS(e){const{glyphMosaicItems:i}=await this.getMosaicItem(e);return K5e.fromText(e,i??[])}async _createCIMText(e){const{glyphMosaicItems:i}=await this.getMosaicItem(qme(e),rke(e.text));return W_(i,X_)?K5e.fromCIMText(e,i,this._tileInfo):this._textError}async _createCIMFill(e){const{spriteMosaicItem:i}=await this.getMosaicItem(qme(e));return W_(i,X_)?nke.fromCIMFill(e,i,this._tileInfo):this._fillError}async _createCIMLine(e){const{spriteMosaicItem:i}=await this.getMosaicItem(qme(e));return W_(i,X_)?ike.fromCIMLine(e,i,this._tileInfo):this._lineError}async _createCIMMarker(e){const{spriteMosaicItem:i}=await this.getMosaicItem(qme(e));return W_(i,X_)?HQ.fromCIMMarker(e,i,this._tileInfo):this._markerError}async _createCIM(e){const i=e.templateHash;let r=this._cimTemplateCache.get(i);if(r!=null)return r;switch(e.type){case"marker":r=await this._createCIMMarker(e);break;case"line":r=await this._createCIMLine(e);break;case"fill":r=await this._createCIMFill(e);break;case"text":r=await this._createCIMText(e)}return this._cimTemplateCache.set(i,r),r}async _createDynamicCIM(e){const i=e.templateHash;let r=this._cimTemplateCache.get(i);if(r!=null)return r;switch(e.type){case"marker":r=Zir.fromCIMMarker(e,this._tileInfo);break;case"line":r=Xir.fromCIMLine(e,this._tileInfo);break;case"fill":r=Yir.fromCIMFill(e,this._tileInfo);break;case"text":r=err.fromCIMText(e,this._tileInfo)}return this._cimTemplateCache.set(i,r),r}_createPrimitiveMeshTemplates(e,i,r){switch(i.type){case"esriSMS":return SO(e,this._createSMS(i));case"esriPMS":return SO(e,this._createPMS(i));case"esriSFS":return SO(e,this._createSFS(i,r));case"line-marker":return SO(e,this._createLMS(i));case"esriPFS":return SO(e,this._createPFS(i,r));case"esriSLS":return SO(e,this._createSLS(i,!1));case"esriTS":return SO(e,this._createTS(i));default:return X_.error("Unable to create mesh template for unknown symbol type {: $ }{symbol.type}"),e}}_createMeshTemplates(e,i,r){if(i.type.includes("3d"))return X_.error("3D symbols are not supported with MapView"),e;if(i.type==="expanded-cim"){for(const n of i.layers)typeof n.materialHash=="function"?SO(e,this._createDynamicCIM(n)):SO(e,this._createCIM(n));return e}if(i.type==="composite-symbol"){for(const n of i.layers)this._createPrimitiveMeshTemplates(e,n,r);return e}return i.type==="cim"||i.type==="label"||i.type==="web-style"?e:this._createPrimitiveMeshTemplates(e,i,r)}};const prr=t=>{if(!t.layers)return!1;for(const e of t.layers)if(typeof e.materialHash=="function")return!0;return!1};let sAt=class{constructor(e,i,r){this._loadPromise=O1t(),this._geometryType=e,this._idField=i,this._templateStore=r}update(e,i){ye(e.mesh.labels)&&(this._labelTemplates=this._createLabelTemplates(e.mesh.labels,i)),this._schema=e}_createLabelTemplates(e,i){const r=new Map;if(e.type==="simple"){for(const n of e.classes){const s=BIt.fromLabelClass(n,i);r.set(n.index,s)}return r}for(const n in e.classes){const s=e.classes[n];for(const o of s){const a=BIt.fromLabelClass(o,i);r.set(o.index,a)}}return r}get templates(){return this._templateStore}async analyze(e,i,r,n,s,o,a){if(bm(a))return;let l;r?.type==="dictionary"&&(l=await r.analyze(this._idField,e.copy(),i,s,o,a));let c=0;for(;e.next();){let d=null;if(d=l?l[c++]:ye(n)&&D0t(e.getDisplayId())&&e.readAttribute("cluster_count")!==1?n.match(this._idField,e,this._geometryType,s,o):r.match(this._idField,e,this._geometryType,s,o),e.setGroupId(d),KQ(d)){const p=this._templateStore.getDynamicTemplateGroup(d).templates;for(const y of p)y&&y.analyze&&y.analyze(this._templateStore,e,s,o)}}return await this._loadPromise,this._templateStore.finalize(a)}async analyzeGraphics(e,i,r,n,s,o){if(bm(o))return;const a=e.getCursor();for(r&&await r.analyze(this._idField,a.copy(),i,n,s,o);a.next();){let l=a.getGroupId();if(l!=null&&l!==-1||(l=r?.match(this._idField,a,a.geometryType,n,s),a.setGroupId(l)),KQ(l)){const c=this._templateStore.getDynamicTemplateGroup(l).templates;for(const d of c)d&&d.analyze&&d.analyze(this._templateStore,a,n,s)}a.setGroupId(l)}return await this._loadPromise,this._templateStore.finalize(o)}writeGraphic(e,i,r,n){const s=i.getGroupId(),o=i.getDisplayId(),a=this._templateStore.getTemplateGroup(s);if(e.featureStart(i.insertAfter,0),o!=null){if(KQ(s))for(const l of a.templates)l&&l.bindFeature(i,null,null);if(a){for(const l of a.templates)l&&l.write(e,i,r,n);e.featureEnd()}}}writeCursor(e,i,r,n,s,o,a){const l=i.getGroupId(),c=i.getDisplayId(),d=this._templateStore.getTemplateGroup(l),p=d.templates,y=this._getSortKeyValue(i,d);if(e.featureStart(0,y),c!=null&&p){if(KQ(l))for(const v of p)v.bindFeature(i,r,n);for(const v of p)v.write(e,i,s,a);if(ye(o)&&e.hasRecords){const v=o&&this._findLabelRef(p);this._writeLabels(e,i,o,v,s,a)}e.featureEnd()}}_getSortKeyValue(e,i){const r=this._schema.mesh.sortKey;if(lt(r))return 0;let n=0;return n=r.byRenderer===!0&&i.sortKey!=null?i.sortKey:r.fieldIndex!=null?e.getComputedNumericAtIndex(r.fieldIndex):r.field!=null?e.readAttribute(r.field):e.readAttribute(this._idField),n*=r.order==="asc"?1:-1,n==null||isNaN(n)?0:n}_findLabelRef(e){for(const i of e)if(i instanceof HQ)return i;return null}_writeLabels(e,i,r,n,s,o){for(const a of r)if(ye(a)&&a){const{glyphs:l,rtl:c,index:d}=a,p=this._labelTemplates.get(d);if(!p)continue;p.setZoomLevel(s),p.bindReferenceTemplate(n),p.bindTextInfo(l,c),p.write(e,i,null,o)}}};const oke=Ei.getLogger("esri/views/2d/engine/webgl/util/Matcher");async function Yme(t,e,i,r){switch(t.type){case"simple":case"heatmap":return JQ.fromBasicRenderer(t,e,i,r);case"map":return mrr.fromUVRenderer(t,e,i,r);case"interval":return frr.fromCBRenderer(t,e,i,r);case"dictionary":return vrr.fromDictionaryRenderer(t,e,i,r);case"pie-chart":return oAt.fromPieChartRenderer(t,e,i,r);case"subtype":return oAt.fromSubtypes(t,e,i,r)}}let JQ=class GBe{constructor(){this.type="feature",this._defaultResult=null}static async fromBasicRenderer(e,i,r,n){const s=new GBe;if(e.symbol){const o=await PS(e.symbol,r,n),a=i.createTemplateGroup(o,null);s.setDefault(a)}return s}static async fromPieChartRenderer(e,i,r,n){const s=new GBe;if(e.markerSymbol){const o=await PS(e.markerSymbol,r,n);let a;e.fillSymbol&&(a=await PS(e.fillSymbol,r,n));const l=i.createTemplateGroup(o,a);s.setDefault(l)}return s}size(){return 1}getDefault(){return this._defaultResult}setDefault(e){this._defaultResult=e}match(e,i,r,n,s){return this.getDefault()}async analyze(e,i,r,n,s,o){return null}},oAt=class $5t extends JQ{constructor(e,i){super(),this._subMatchers=e,this._subtypeField=i}static async fromSubtypes(e,i,r,n){const s=new Map,o=[];for(const a in e.renderers){const l=parseInt(a,10),c=Yme(e.renderers[a],i,r,n).then(d=>s.set(l,d));o.push(c)}return await Promise.all(o),new $5t(s,e.subtypeField)}match(e,i,r,n,s){const o=i.readAttribute(this._subtypeField),a=this._subMatchers.get(o);return a?a.match(e,i,r,n,s):null}},frr=class B5t extends JQ{constructor(e,i,r,n){super(),this.type="interval",this._intervals=[],this._isMaxInclusive=i,this._fieldIndex=n,this._field=e,this._normalizationInfo=r}static async fromCBRenderer(e,i,r,n){const{isMaxInclusive:s,normalizationField:o,normalizationTotal:a,normalizationType:l}=e,c=e.field,d=new B5t(c,s,{normalizationField:o,normalizationTotal:a,normalizationType:l},e.fieldIndex),p=await PS(e.backgroundFillSymbol,r,n);await Promise.all(e.intervals.map(async v=>{const S=await PS(v.symbol,r,n),I=await i.createTemplateGroup(S,p),O={min:v.min,max:v.max};d.add(O,I)}));const y=await PS(e.defaultSymbol,r,n);if(y){const v=await i.createTemplateGroup(y,p);d.setDefault(v)}return d}add(e,i){this._intervals.push({interval:e,result:i}),this._intervals.sort((r,n)=>r.interval.min-n.interval.min)}size(){return super.size()+this._intervals.length}match(e,i,r,n,s){if(this._fieldIndex==null&&!this._field)return this.getDefault();const o=this._fieldIndex!=null?i.getComputedNumericAtIndex(this._fieldIndex):this._getValueFromField(i);if(o==null||isNaN(o)||o===1/0||o===-1/0)return this.getDefault();for(let a=0;a=l.min,p=this._isMaxInclusive?o<=l.max:o{const y=await PS(d.symbol,r,n),v=p+1,S=await i.createTemplateGroup(y,a,v);d.value===""?l.setNullResult(S):l.add(d.value,S)}));const c=await PS(e.defaultSymbol,r,n);if(c){const d=Number.MAX_SAFE_INTEGER,p=await i.createTemplateGroup(c,a,d);l.setDefault(p)}return l}setNullResult(e){this._nullResult=e}add(e,i){this._resultsMap.set(e.toString(),i)}size(){return super.size()+this._resultsMap.size}match(e,i,r,n,s){if(this._fieldsIndex==null&&!this._fields)return this.getDefault();const o=this._fieldsIndex!=null?i.getComputedStringAtIndex(this._fieldsIndex):this._getValueFromFields(i);if(this._nullResult!==null&&(o==null||o===""||o===""))return this._nullResult;if(o==null)return this.getDefault();const a=o.toString();return this._resultsMap.has(a)?this._resultsMap.get(a):this.getDefault()}_getValueFromFields(e){const i=[];for(const r of this._fields){const n=e.readAttribute(r);n==null||n===""?i.push(""):i.push(n)}return i.join(this._seperator)}};async function grr(t,e){const i=t||1;if(typeof i=="number")return(n,s,o)=>i;const r=await Rne(i,e.spatialReference,e.fields);return(n,s,o)=>b6(r,n,{$view:o},e.geometryType,s)||1}let ake;async function yrr(){return ake||(ake=Promise.resolve().then(()=>Crr)),ake}let vrr=class V5t extends JQ{constructor(e,i,r,n,s,o){super(),this.type="dictionary",this._groupIdCache=new E9(100),this._loader=e,this._fieldMap=e.fieldMap,this._symbolFields=e.getSymbolFields(),this._templates=i,this._info=r,this._scaleFn=n,this._schemaUtilsModule=s,this._symbolOptions=o}static async fromDictionaryRenderer(e,i,r,n){const[{DictionaryLoader:s},o]=await Promise.all([Promise.resolve().then(()=>AVt),yrr()]),a=new s(e.url,e.config,e.fieldMap);await a.fetchResources({spatialReference:r.spatialReference,fields:r.fields});const l=await grr(e.scaleExpression,r);return new V5t(a,i,r,l,o,e.symbolOptions)}async _analyzeFeature(e,i,r,n,s){const o=e.readLegacyFeature(),a=this._scaleFn(o,r,n),l=this._attributeHash(o)+"-"+a,c=this._groupIdCache.get(l);if(c)return c;const d={...n,spatialReference:this._info.spatialReference,abortOptions:s,fields:this._info.fields},p=await this._loader.getSymbolAsync(o,d),y=this._schemaUtilsModule.createSymbolSchema(p,this._symbolOptions),v=PS(y,this._info,i,s).then(S=>{if(S?.type!=="expanded-cim")return oke.error(new st("mapview-bad-type",`Found unexpected type ${S?.type} in dictionary response`)),null;S.hash+="-"+a;for(const I of S.layers)I.scaleFactor=a,I.templateHash+="-"+a;return this._templates.createTemplateGroup(S,null)});return this._groupIdCache.put(l,v,1),v}async analyze(e,i,r,n,s,o){const a=i.getCursor(),l=[];for(;a.next();)l.push(this._analyzeFeature(a,r,n,s,o));return Promise.all(l).then(c=>c.filter(ye))}match(e,i,r,n,s){return null}_attributeHash(e){let i="";for(const r of this._symbolFields){const n=this._fieldMap?.[r];n&&(i+=e.attributes[n]+"-")}return i}};function aAt(t){if(!t)return ed.NONE;let e=0;for(const i of t)if(i.type==="size"){const r=Cvt(i);e|=r,i.target==="outline"&&(e|=r<<4)}else i.type==="color"?e|=ed.COLOR:i.type==="opacity"?e|=ed.OPACITY:i.type==="rotation"&&(e|=ed.ROTATION);return e}function k6(t){return t.type==="line-marker"?{type:"line-marker",color:t.color?.toJSON(),placement:t.placement,style:t.style}:t.constructor.fromJSON(t.toJSON()).toJSON()}function N6(t){return SZi(t)}function K_(t,e,i=!1){if(!t)return null;switch(t.type){case"simple-fill":case"picture-fill":return brr(t,e,i);case"simple-marker":case"picture-marker":return xrr(t,e,i);case"simple-line":return wrr(t,e,i);case"text":return Srr(t,e,i);case"label":return _rr(t,e,i);case"cim":return{type:"cim",rendererKey:e.vvFlags,data:t.data,maxVVSize:e.maxVVSize};case"CIMSymbolReference":return{type:"cim",rendererKey:e.vvFlags,data:t,maxVVSize:e.maxVVSize};case"web-style":return{...k6(t),type:"web-style",hash:t.hash(),rendererKey:e.vvFlags,maxVVSize:e.maxVVSize};default:throw new Error(`symbol not supported ${t.type}`)}}function _rr(t,e,i){const r=t.toJSON(),n=TS(wn.LABEL,{...e,placement:r.labelPlacement});return{materialKey:i?N6(n):n,hash:t.hash(),...r,labelPlacement:r.labelPlacement}}function brr(t,e,i){const r=TS(wn.FILL,e),n=i?N6(r):r,s=t.clone(),o=s.outline,a=mme(e.symbologyType);a||(s.outline=null);const l={materialKey:n,hash:s.hash(),...k6(s)};if(a)return l;const c=[];if(c.push(l),o){const d=TS(wn.LINE,{...e,isOutline:!0}),p={materialKey:i?N6(d):d,hash:o.hash(),...k6(o)};c.push(p)}return{type:"composite-symbol",layers:c,hash:c.reduce((d,p)=>p.hash+d,"")}}function wrr(t,e,i){const r=mme(e.symbologyType)?Yo.DEFAULT:e.symbologyType,n=TS(wn.LINE,{...e,symbologyType:r}),s=i?N6(n):n,o=t.clone(),a=o.marker;o.marker=null;const l=[];if(l.push({materialKey:s,hash:o.hash(),...k6(o)}),a){const c=TS(wn.MARKER,e),d=i?N6(c):c;a.color=a.color??o.color,l.push({materialKey:d,hash:a.hash(),lineWidth:o.width,...k6(a)})}return{type:"composite-symbol",layers:l,hash:l.reduce((c,d)=>d.hash+c,"")}}function xrr(t,e,i){const r=TS(wn.MARKER,e),n=i?N6(r):r,s=k6(t);return{materialKey:n,hash:t.hash(),...s,angle:t.angle,maxVVSize:e.maxVVSize}}function Srr(t,e,i){const r=TS(wn.TEXT,e),n=i?N6(r):r,s=k6(t);return{materialKey:n,hash:t.hash(),...s,angle:t.angle,maxVVSize:e.maxVVSize}}const Crr=Object.freeze(Object.defineProperty({__proto__:null,createSymbolSchema:K_},Symbol.toStringTag,{value:"Module"})),Mj=512,CO=50;function Trr(t,e){const i=pd(e);if(!i)return null;const[r,n]=i.valid;return t[2]>n?[_o([t[0],t[1],n,t[3]]),_o([r,t[1],r+t[2]-n,t[3]])]:t[0]n.size).reduce(lke,0);if(r.transformationType==="clamped-linear"){let n=-1/0,s=-1/0;return n=typeof r.maxSize=="number"?r.maxSize:r.maxSize.stops.map(o=>o.size).reduce(lke,0),s=typeof r.minSize=="number"?r.minSize:r.minSize.stops.map(o=>o.size).reduce(lke,0),Math.max(n,s)}return r.transformationType==="real-world-size"?30:void 0}function lke(t,e){return Math.max(t,e)}const Xme=8,uAt=Xme-2,Kme=Ei.getLogger("esri.views.2d.layers.features.support.rendererUtils"),Orr=t=>{if(!("visualVariables"in t)||!t.visualVariables||!t.visualVariables.length)return t;const e=t.clone(),i=e.visualVariables.map(r=>cAt(r)?hAt(r):r);return e.visualVariables=i,e};function Rrr(t){return t.map(e=>cAt(e)?hAt(e.clone()):e)}function cAt(t){return(t.type==="size"||t.type==="color"||t.type==="opacity")&&t.stops!=null}function hAt(t){return t.stops=Frr(t.type,t.stops??[]),t}function Dj(t,e,i){return(1-i)*t+i*e}function Mrr(t,e){const[i,...r]=e,n=r.pop(),s=r[0].value,o=r[r.length-1].value,a=(o-s)/uAt,l=[];for(let c=s;c=r[d].value;)d++;const p=r[d],y=e[d-1],v=c-y.value,S=p.value===y.value?1:v/(p.value-y.value);if(t==="color"){const I=r[d],O=e[d-1],L=I.color.clone();L.r=Dj(O.color.r,L.r,S),L.g=Dj(O.color.g,L.g,S),L.b=Dj(O.color.b,L.b,S),L.a=Dj(O.color.a,L.a,S),l.push({value:c,color:L,label:I.label})}else if(t==="size"){const I=r[d],O=e[d-1],L=Da(I.size),N=Dj(Da(O.size),L,S);l.push({value:c,size:N,label:I.label})}else{const I=r[d],O=Dj(e[d-1].opacity,I.opacity,S);l.push({value:c,opacity:O,label:I.label})}}return[i,...l,n]}function Drr(t){const[e,...i]=t,r=i.pop();for(;i.length>uAt;){let n=0,s=0;for(let o=1;os&&(s=c,n=o)}i.splice(n,1)}return[e,...i,r]}function Frr(t,e){return e.length<=Xme?e:(Kme.warn(`Found ${e.length} Visual Variable stops, but MapView only supports ${Xme}. Displayed stops will be simplified.`),e.length>2*Xme?Mrr(t,e):Drr(e))}function uke(){if(Gi("heatmap-force-raster"))return"raster";const{supportsTextureFloat:t,supportsTextureHalfFloat:e,supportsColorBufferFloat:i,supportsColorBufferFloatBlend:r,supportsColorBufferHalfFloat:n}=TT("2d");return t&&i&&r||e&&n?"symbol":Gi("heatmap-allow-raster-fallback")?"raster":"none"}function Lrr(t){if(!t)return!0;switch(t.type){case"dot-density":if(!TT("2d").supportsTextureFloat)return Kme.error(new st("webgl-missing-extension","Missing WebGL extension OES_Texture_Float which is required for DotDensity")),!1;break;case"heatmap":{const e=uke();if(e==="none"||e==="raster"&&!Gi("heatmap-force-raster")){const i=TT("2d"),r=["supportsTextureFloat","supportsTextureHalfFloat","supportsColorBufferFloat","supportsColorBufferFloatBlend","supportsColorBufferHalfFloat"].filter(n=>!i[n]).join(", ");if(e==="none")return Kme.errorOnce(new st("webgl-missing-extension",`Missing WebGL${i.type} requirements for Heatmap: ${r}`)),!1;e==="raster"&&Kme.warnOnce(`Missing WebGL${i.type} requirements for accelerated Heatmap: ${r}. Feature support may be limited.`)}break}}return!0}const krr=new Bs({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function Jme(t){return krr.toJSON(t)}function dAt(t){const{bandCount:e,attributeTable:i,colormap:r,pixelType:n}=t.raster.rasterInfo;return e===1&&(i!=null||r!=null||n==="u8"||n==="s8")}const $6=Ei.getLogger("esri.views.2d.layers.features.schemaUtils"),J_="ValidationError";function n4r(t){return t}function ZQ(t,e){let i=0,r=0,n=Yo.DEFAULT;if(ye(t)){if(r=Prr(t,e),"visualVariables"in t&&(i=aAt(t.visualVariables||[]),t.type==="dot-density"&&(n=Yo.DOT_DENSITY)),t.type==="heatmap"&&(n=Yo.HEATMAP),t.type==="dictionary")return{maxVVSize:r,vvFlags:i,symbologyType:Yo.DEFAULT};if(t.type==="pie-chart")return{maxVVSize:r,vvFlags:i,symbologyType:Yo.PIE_CHART};if(n!==Yo.DOT_DENSITY&&n!==Yo.HEATMAP){const s=t.getSymbols();"backgroundFillSymbol"in t&&t.backgroundFillSymbol&&s.push(t.backgroundFillSymbol);let o=!0,a=!0;for(const l of s)if(l.type==="cim"&&(a=!1),l.type==="simple-fill"||l.type==="picture-fill"){const c=l.outline,d=c&&c.style!=="none"&&c.style!=="solid",p=l.type==="simple-fill"&&l.style!=="none"&&l.style!=="solid";d&&(o=!1),(l.type==="picture-fill"||p||d)&&(a=!1)}o?n=a?Yo.OUTLINE_FILL_SIMPLE:Yo.OUTLINE_FILL:a&&(n=Yo.SIMPLE)}}return{vvFlags:i,maxVVSize:r,symbologyType:n}}let pAt=null;function Nrr(t){if(Gi("esri-2d-update-debug")){const e=fAt(t,!0);console.debug("Created new schema",e),console.debug("Schema diff",d2(pAt,e)),pAt=e}return fAt(t)}function fAt(t,e=!1){try{const i=Vrr(t,e),r=zrr(t),n={};i.map(a=>$rr(n,t,a));const s=ye(t.subtypeCode)?`${t.subtypeField} = ${t.subtypeCode}`:null;return{source:{definitionExpression:OR(t.definitionExpression,s),fields:t.fields.map(a=>a.toJSON()),gdbVersion:t.gdbVersion,historicMoment:t.historicMoment?.getTime(),outFields:t.availableFields,pixelBuffer:t.pixelBuffer,spatialReference:t.spatialReference.toJSON(),timeExtent:t.timeExtent?.toJSON(),customParameters:t.customParameters},attributes:{fields:{},indexCount:0},processors:i,tileRenderer:r,targets:n}}catch(i){if(i.fieldName===J_)return $6.error(i),null;throw i}}function $rr(t,e,i){switch(i.target){case"feature":return void dke(t,hke(e),i);case"aggregate":{if(!("featureReduction"in e))return;const r=e.featureReduction;switch(r?.type){case"selection":throw new st(J_,"Mapview does not support `selection` reduction type",r);case"binning":return dke(t,hke(e),i),void Brr(t,r,e.fields.map(n=>n.toJSON()),i);case"cluster":return dke(t,hke(e),i),void Grr(t,r,e.fields.map(n=>n.toJSON()),i)}}}}function cke(t,e){for(const i in e){const r=e[i];if(r.target!==t.name)continue;const n=t.attributes[i];if(n?.context){const s=n.context;s.mesh=s.mesh||r.context?.mesh,s.storage=s.storage||r.context?.storage}else t.attributes[i]=r}return t}function hke(t){return[t.filter?.toJSON()??null,t.featureEffect?.filter?.toJSON()??null]}function dke(t,e,i){return t.feature||(t.feature={name:"feature",input:"source",filters:e,attributes:{}}),cke(t.feature,i.attributes.fields),t}function mAt(t,e){const{onStatisticExpression:i,onStatisticField:r,statisticType:n}=t;switch(n){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(i){const{returnType:o}=i;return o?o==="string"?"esriFieldTypeString":"esriFieldTypeDouble":($6.error(new st(J_,"Unable to infer type of aggregateField with onStatisticExpression. ReturnType is not defined",t)),"esriFieldTypeString")}const s=e.find(o=>o.name===r);return s?s.type:($6.error(new st(J_,"Unable to infer type of aggregateField with onStatisticExpression. ReturnType is not defined",t)),"esriFieldTypeString")}}}function Brr(t,e,i,r){return t.aggregate||(t.aggregate={name:"aggregate",type:"bin",filters:null,input:"feature",params:{fixedBinLevel:e.fixedBinLevel,fields:(e.fields??[]).map(n=>({...n.toJSON(),type:mAt(n,i)}))},attributes:{}}),cke(t.aggregate,r.attributes.fields),t}function Grr(t,e,i,r){return t.aggregate||(t.aggregate={name:"aggregate",type:"cluster",input:"feature",filters:null,attributes:{},params:{clusterRadius:on(e.clusterRadius/2),clusterPixelBuffer:64*Math.ceil(on(e.clusterMaxSize)/64),fields:(e.fields??[])?.map(n=>({...n.toJSON(),type:mAt(n,i)}))}}),cke(t.aggregate,r.attributes.fields),t}function zE(t,e){return e.field?B6(t,{...e,type:"field",field:e.field}):e.valueExpression?B6(t,{...e,type:"expression",valueExpression:e.valueExpression}):{field:void 0,fieldIndex:void 0}}function B6(t,e){switch(e.type){case"expression":{const i=e.valueExpression;if(!t.fields[i]){const r=t.indexCount++;t.fields[i]={...e,name:i,fieldIndex:r}}return{fieldIndex:t.fields[i].fieldIndex}}case"label-expression":{const i=JSON.stringify(e.label);if(!t.fields[i]){const r=t.indexCount++;t.fields[i]={...e,name:i,fieldIndex:r}}return{fieldIndex:t.fields[i].fieldIndex}}case"field":{const i=e.field;return e.target==="aggregate"&&t.fields[i]||(t.fields[i]={...e,name:i}),{field:i}}case"statistic":return t.fields[e.name]={...e},{field:e.name}}}function Vrr(t,e=!1){const i=new Array;let r=0;return i.push(jrr(t,r++,e)),i}function pke(t,e,i,r,n,s=!1){const o=B6(t,{type:"label-expression",target:i,context:{mesh:!0},resultType:"string",label:{labelExpression:e.labelExpression,labelExpressionInfo:e.labelExpressionInfo?{expression:e.labelExpressionInfo.expression}:null,symbol:!!e.symbol,where:e.where}}),{fieldIndex:a}=o;return{...K_(e,n,s),fieldIndex:a,target:i,index:r}}function Urr(t,e,i){const r="featureReduction"in e&&e.featureReduction;if(!r)return{fields:[],labels:[],matcher:void 0,rendererOverride:void 0};const n="aggregate",s=[];let o=null,a=Jme(e.geometryType),l=[],c=null;if(r)switch(r.type){case"selection":return $6.error(new st(J_,"Mapview does not support `selection` reduction type",r)),{fields:[],labels:[],matcher:void 0,rendererOverride:void 0};case"cluster":case"binning":if(s.push(...r.fields??[]),r.type==="cluster"?a="esriGeometryPoint":r.type==="binning"&&(a="esriGeometryPolygon"),r.renderer&&!r.renderer.authoringInfo?.isAutoGenerated){if(r.type==="cluster"){const{renderer:p}=PYe(r.renderer,r,null);c=p}else c=r.renderer;const d=ZQ(r.renderer,r);o=Zme(t,n,r.renderer,d,i),l=r&&r.labelsVisible&&r.labelingInfo||[]}else if(r.type==="cluster"){if(c=PSe(s,e.renderer,r,null,!0),r.symbol){const d=ZQ(c,r);o={type:"simple",symbol:K_(r.symbol,d,i),symbologyType:d.symbologyType}}l=r&&r.labelsVisible&&r.labelingInfo||[]}}return Wrr(t,s),{labels:ZSe(l,r.type==="binning"?"esriGeometryPolygon":a),matcher:o,fields:s,rendererOverride:c}}function jrr(t,e,i=!1){const r={indexCount:0,fields:{}},n="featureReduction"in t?t.featureReduction??void 0:void 0,s=n?"aggregate":"feature";if("sublayers"in t){const L={type:"subtype",subtypeField:t.subtypeField,renderers:{},symbologyType:Yo.DEFAULT},N={type:"subtype",mapping:{},target:"feature",subtypeField:t.subtypeField},G={type:"subtype",classes:{}},V={type:"symbol",target:"feature",aggregateFields:[],attributes:r,storage:N,mesh:{matcher:L,aggregateMatcher:null,labels:G,sortKey:null}},Y=new Set;let X=0;for(const{renderer:te,subtypeCode:re,labelingInfo:fe,labelsVisible:ge}of t.sublayers){let _e=0;"visualVariables"in te&&te.visualVariables&&(te.visualVariables.some(he=>he.type!=="rotation")&&$6.warnOnce("SubtypeGroupLayer currently only supports rotation visualVariables. All other visualVariable types will be ignored."),_e=aAt(te.visualVariables.filter(he=>he.type!=="size")));const Ie={symbologyType:Yo.DEFAULT,vvFlags:_e,maxVVSize:0},ke=Zme(r,s,te,Ie,i),Ne=gAt(r,s,te),J=ge&&fe;if(ke.type==="dictionary")throw new st(J_,"Dictionary renderer is not supported in subtype layers");if(ke.type==="subtype")throw new st(J_,"Nested subtype renderers is not supported");if(ye(Ne)&&Ne.type==="subtype")throw new st(J_,"Nested subtype storage is not supported");if(ye(Ne)&&ye(Ne.attributeMapping))throw new st(J_,"Non-visual-variable attributes are not supported in subtype layers");if(ke.type==="heatmap")throw new st(J_,"Heatmaps are not supported in subtype layers");if(ke.type==="pie-chart")throw new st(J_,"Pie-charts are not supported in subtype layers");if(Y.has(re))throw new st(J_,"Subtype codes for sublayers must be unique");Y.add(re),L.renderers[re]=ke,N.mapping[re]=Ne,J&&(G.classes[re]=J.map(he=>pke(r,he,"feature",X++,Ie,i)))}return V}if(t.renderer?.type==="heatmap"&&uke()==="raster"){const{radius:L,fieldOffset:N,field:G}=t.renderer;return{type:"heatmap",aggregateFields:[],attributes:r,target:s,storage:null,mesh:{radius:L,fieldOffset:N,field:zE(r,{target:s,field:G,resultType:"numeric"}).field}}}const o=Urr(r,t,i),a=Jme(t.geometryType),l=o.rendererOverride??t.renderer,c=ZQ(l,n),d=Zme(r,s,l,c,i),p=gAt(r,s,l),y=Hrr(r,t.orderBy,t.renderer,n),v=t.labelsVisible&&t.labelingInfo||[],S=ZSe(v,a);let I=0;const O=[...S.map(L=>pke(r,L,"feature",I++,c,i)),...o.labels.map(L=>pke(r,L,"aggregate",I++,c,i))];return{type:"symbol",target:s,attributes:r,aggregateFields:o.fields,storage:p,mesh:{matcher:d,labels:{type:"simple",classes:O},aggregateMatcher:o.matcher,sortKey:y}}}function zrr(t){return t.renderer?.type==="heatmap"&&uke()==="raster"?{type:"heatmap"}:{type:"symbol"}}function Hrr(t,e,i,r){if(ye(r))return null;if(ye(e)&&e.length){e.length>1&&$6.warn(`Layer rendering currently only supports ordering by 1 orderByInfo, but found ${e.length}. All but the first will be discarded`);const n=e[0],s=n.order==="ascending"?"asc":"desc";return n.field?{field:n.field,order:s}:n.valueExpression?{fieldIndex:B6(t,{type:"expression",target:"feature",valueExpression:n.valueExpression,resultType:"numeric"}).fieldIndex,order:s}:($6.error(new st(J_,"Expected to find a field or valueExpression for OrderByInfo",n)),null)}return ye(i)&&i.type==="unique-value"&&i.orderByClassesEnabled?{byRenderer:!0,order:"asc"}:null}function Wrr(t,e){const i={mesh:!0,storage:!0};for(const r of e){const{name:n,onStatisticField:s,onStatisticExpression:o,statisticType:a}=r;let l,c;const d="numeric",p="feature";o?c=B6(t,{type:"expression",target:p,valueExpression:o.expression,resultType:d}).fieldIndex:l=B6(t,{type:"field",target:p,field:s,resultType:d}).field,B6(t,{type:"statistic",target:"aggregate",name:n,context:i,inField:l,inFieldIndex:c,statisticType:a})}}function gAt(t,e,i){let r;switch(i.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":r={visualVariables:!0,attributes:null};break;default:r=nEt(i).getStorageSpec(i)}return qrr(t,e,r,i)}function qrr(t,e,i,r){if(lt(i))return null;const{visualVariables:n,attributes:s}=i;let o=null;n&&"visualVariables"in r&&(o=Yrr(t,e,r.visualVariables));const a=ye(o)?4:0;let l=null;return ye(s)&&(l=s.map((c,d)=>{const{field:p,fieldIndex:y}=zE(t,{valueExpression:c.valueExpression,field:c.field,resultType:"numeric",target:e});return{binding:d+a,field:p,fieldIndex:y}})),{type:"simple",target:e,attributeMapping:l,vvMapping:o}}function Yrr(t,e,i){if(!i||!i.length)return[];const r={storage:!0},n="numeric";return Rrr(i).map(s=>{const o=F5i(s.type),{field:a,fieldIndex:l}=zE(t,{target:e,valueExpression:s.valueExpression,field:s.field,context:r,resultType:n});switch(s.type){case"size":return s.valueExpression==="$view.scale"?null:{type:"size",binding:o,field:a,fieldIndex:l,normalizationField:zE(t,{target:e,field:s.normalizationField,context:r,resultType:n}).field,valueRepresentation:s.valueRepresentation??null};case"color":return{type:"color",binding:o,field:a,fieldIndex:l,normalizationField:zE(t,{target:e,field:s.normalizationField,context:r,resultType:n}).field};case"opacity":return{type:"opacity",binding:o,field:a,fieldIndex:l,normalizationField:zE(t,{target:e,field:s.normalizationField,context:r,resultType:n}).field};case"rotation":return{type:"rotation",binding:o,field:a,fieldIndex:l}}}).filter(ye)}function Zme(t,e,i,r,n=!1){const s=Fu(t,{indexCount:0,fields:{}});switch(i.type){case"simple":case"dot-density":return Xrr(s,i,r,n);case"class-breaks":return Jrr(s,e,i,r,n);case"unique-value":return Zrr(s,e,i,r,n);case"dictionary":return Qrr(s,i,r,n);case"heatmap":return enr(s,i,r,n);case"pie-chart":return Krr(s,i,r,n)}}function Xrr(t,e,i,r=!1){const n=e.getSymbols(),s=n.length?n[0]:null;return{type:"simple",symbol:K_(s,i,r),symbologyType:i.symbologyType}}function Krr(t,e,i,r=!1){const n=e.getSymbols(),s=n[0],o=n.length>1?n[1]:null;return{type:"pie-chart",markerSymbol:K_(s,i,r),fillSymbol:K_(o,i,r),symbologyType:i.symbologyType}}function Jrr(t,e,i,r,n=!1){const s={mesh:!0,use:"renderer.field"},o=i.backgroundFillSymbol,{field:a,fieldIndex:l}=zE(t,{target:e,field:i.field,valueExpression:i.valueExpression,resultType:"numeric",context:s}),c=i.normalizationType,d=c==="log"?"esriNormalizeByLog":c==="percent-of-total"?"esriNormalizeByPercentOfTotal":c==="field"?"esriNormalizeByField":null,p=i.classBreakInfos.map(y=>({symbol:K_(y.symbol,r,n),min:y.minValue,max:y.maxValue})).sort((y,v)=>y.min-v.min);return{type:"interval",attributes:t.fields,field:a,fieldIndex:l,backgroundFillSymbol:K_(o,r,n),defaultSymbol:K_(i.defaultSymbol,r,n),intervals:p,normalizationField:i.normalizationField,normalizationTotal:i.normalizationTotal,normalizationType:d,isMaxInclusive:i.isMaxInclusive,symbologyType:r.symbologyType}}function Zrr(t,e,i,r,n=!1){const s=[],o=i.backgroundFillSymbol,a={target:e,context:{mesh:!0},resultType:"string"};if(i.field&&typeof i.field!="string")throw new st(J_,"Expected renderer.field to be a string",i);const{field:l,fieldIndex:c}=zE(t,{...a,field:i.field,valueExpression:i.valueExpression});for(const d of i.uniqueValueInfos??[])s.push({value:""+d.value,symbol:K_(d.symbol,r,n)});return{type:"map",attributes:t.fields,field:l,fieldIndex:c,field2:zE(t,{...a,field:i.field2}).field,field3:zE(t,{...a,field:i.field3}).field,fieldDelimiter:i.fieldDelimiter??void 0,backgroundFillSymbol:K_(o,r),defaultSymbol:K_(i.defaultSymbol,r),map:s,symbologyType:r.symbologyType}}function Qrr(t,e,i,r=!1){return{type:"dictionary",config:e.config,fieldMap:e.fieldMap,scaleExpression:e.scaleExpression,url:e.url,symbolOptions:i,symbologyType:i.symbologyType}}function enr(t,e,i,r=!1){const n=e.getSymbols(),s=n.length?n[0]:null;return{type:"heatmap",symbol:K_(s,i,r),symbologyType:i.symbologyType}}let tnr=class VBe extends Sv{static from(e,i,r){const n=jN.createInstance(),s=[],o=e.filter(a=>!!a.geometry);for(const a of o){const l=md(a.geometry);XJt(s,[a],l,!1,!1,i)}return new VBe(n,s,r)}constructor(e,i,r){super(e,i,null),this._transform=r}get geometryType(){const e=this._current;return e?e.geometryType:null}get insertAfter(){return this._current.insertAfter}readGraphic(){return this._current}getCursor(){return this.copy()}copy(){const e=new VBe(this.instance,this._features,this._transform);return this.copyInto(e),e}};const QQ=new Sl,fke=new Sl,yAt="esriGeometryPolyline";function vAt(t){t.coords.length=0,t.lengths.length=0}let eee=class u_e{constructor(){this.bounds=_o(),this.graphic=null}static acquire(e=null,i,r,n,s){let o;return u_e._pool.length===0?o=new u_e:(o=u_e._pool.pop(),this._set.delete(o)),o.acquire(e,i,r,n,s),o}static release(e){e&&!this._set.has(e)&&(e.release(),this._pool.push(e),this._set.add(e))}static getCentroidQuantized(e,i){if(Va(e.geometry)){const r=e.symbol;if(lt(r))return null;if(r?.layers.length>0&&r.layers.some(n=>n.type==="text"||n.type==="marker")){const n=Ine(e.geometry);return n!==null?gMe(i,{},{x:n[0],y:n[1]},!1,!1):null}}return null}acquire(e=null,i,r,n,s){e&&this.set(e,i,r,n,s)}release(){this.graphic=null,this.symbolResource=null,this.geometry=null}get symbol(){return this.symbolResource.symbol}set(e,i,r,n,s){this.graphic=e,this.geometry=r,this.symbolResource=i,this.bounds=n,s&&(this.size=s)}getGeometryQuantized(e,i,r,n){const s=this.geometry,o=md(s);if(lt(o))return null;switch(o){case"esriGeometryPolygon":{const a=s,{rings:l}=a;if(!l||l.length===0)return null;let c;if(c=l.length===1&&l[0].length===2?pJ(e,{paths:[[l[0][0],l[0][1]]]}):pJ(e,this.geometry),!c){const d={x:l[0][0][0],y:l[0][0][1]};if(c=pJ(e,d),c){const{x:p,y}=c;return{rings:[[[p-1,y],[1,-1],[1,1],[-1,1],[-1,-1]]]}}}return c}case"esriGeometryPolyline":{const a=s;vAt(QQ),vAt(fke);const l=a.hasZ??!1,c=a.hasM??!1;return xTe(QQ,a),UJe(fke,QQ,l,c,yAt,e.scale[0]),UA(QQ,fke,l,c,yAt,e),kae(QQ,a.hasZ??!1,a.hasM??!1)}case"esriGeometryMultipoint":{const a=s,l=.5*n*Math.max(Math.abs(this.size[0])+this.size[2]-this.size[0],Math.abs(this.size[1])+this.size[3]-this.size[1]),c=pd(r);let d=a.points;if(c){const[p,y]=c.valid,v=y-p;d=d.filter(S=>{if(S[0]+l>y||S[0]-ly?I[0]-=v:I[0]+=v,rse(i,S,l)||rse(i,I,l)}return rse(i,S,l)})}return d.length===0?{points:d}:pJ(e,{points:d})}}return pJ(e,this.geometry)}};eee._pool=[],eee._set=new Set;const tee={minX:0,minY:0,maxX:0,maxY:0},Fj=_o(),_At=1e-5;function Qme(t,e,i,r,n){return tee.minX=e,tee.minY=i,tee.maxX=r,tee.maxY=n,t.search(tee)}function inr(t){return{minX:t.bounds[0],minY:t.bounds[1],maxX:t.bounds[2],maxY:t.bounds[3]}}let rnr=class{constructor(e,i,r,n,s,o,a){this._graphics=n,this._onAdd=s,this._onRemove=o,this._hashToCIM=a,this._index=Tk(9,inr),this._itemByGraphic=new Map,this._inflatedSizeHelper=new LSt,this._tileInfoView=e,this._uidFieldName=r;const l=e.getClosestInfoForScale(i);l&&(this._resolution=this._tileInfoView.getTileResolution(l.level))}setResourceManager(e){this._cimResourceManager=e,this._hittestDrawHelper=new qqi(e)}hitTest(e,i,r,n,s){e=mCe(e,this._tileInfoView.spatialReference);const o=.5*n*window.devicePixelRatio*r;Fj[0]=e-o,Fj[1]=i-o,Fj[2]=e+o,Fj[3]=i+o;const a=.5*n*(r+CO),l=Qme(this._index,e-a,i-a,e+a,i+a);if(!l||l.length===0)return[];const c=[],d=_o(),p=_o();for(const S of l){const{geometry:I,symbolResource:O}=S;this._getSymbolBounds(d,O,I,p,s),p[3]=p[2]=p[1]=p[0]=0,nse(d,Fj)&&S.graphic?.visible&&c.push(S)}if(c.length===0)return[];const y=this._hittestDrawHelper,v=[];for(const S of c){const{geometry:I,symbolResource:O}=S,{hash:L,textInfo:N}=O,G=this._hashToCIM.get(L);G&&y.hitTest(Fj,G.symbol,I,N,s,n)&&v.push(S)}return v.sort(nnr),v.map(S=>S.graphic)}getGraphicsData(e,i,r){const n=this._searchForItems(i);if(n.length===0||r.length===0)return[];n.sort((p,y)=>p.zorder-y.zorder),n[0].insertAfter=-1;for(let p=1;pp.graphic.uid-y.graphic.uid),r.sort((p,y)=>p.uid-y.uid);let s,o=0,a=0;const l=i.resolution,c=[],d={originPosition:"upperLeft",scale:[l,l],translate:[i.bounds[0],i.bounds[3]]};for(const p of r){for(a=-2;op.zorder-y.zorder),c}queryTileData(e,i){if(this._graphics.length===0)return[];const{bounds:r,resolution:n}=i,s=this._searchForItems(i),o=[];return s.length===0||this._createTileGraphics(o,e,s,{originPosition:"upperLeft",scale:[n,n],translate:[r[0],r[3]]},i),o}has(e){return this._itemByGraphic.has(e)}getBounds(e){const i=this._itemByGraphic.get(e);return i?i.bounds:null}getAllBounds(){return Array.from(this._itemByGraphic.values()).filter(e=>e.graphic.visible).map(e=>e.bounds)}addOrModify(e,i,r){if(!e||lt(i))return;this.has(e)&&this.remove(e),this._onAdd(e);const n=[0,0,0,0],s=this._getSymbolBounds(null,i,r,n,0),o=eee.acquire(e,i,r,ye(s)?s:null,n);return this._itemByGraphic.set(e,o),r&&this._index.insert(o),o.bounds}remove(e){if(!this._itemByGraphic.has(e))return;this._onRemove(e);const i=this._itemByGraphic.get(e);i?.bounds&&this._index.remove(i),this._itemByGraphic.delete(e)}updateZ(){const e=this._graphics.items;let i,r;for(let n=0;nS.zorder-I.zorder);for(let S=0;S{const i=lAt(t.graphic),r=lAt(e.graphic);return i===r?e.zorder-t.zorder:i-r},snr=t=>{let e=class extends R1(t){constructor(){super(...arguments),this.graphics=null,this.renderer=null}};return E([k()],e.prototype,"graphics",void 0),E([k()],e.prototype,"renderer",void 0),E([k()],e.prototype,"updating",void 0),E([k()],e.prototype,"view",void 0),e=E([ht("esri.views.layers.GraphicsView")],e),e},onr=Gi("esri-2d-graphic-debug");function mke(t,e,i){let r=i.get(t);return r||(r={tile:e,addedOrModified:[],removed:[]},i.set(t,r)),r}let HE=class extends snr(Nd(fn)){constructor(e){super(e),this._storage=new Dvt,this._displayIds=new Map,this._controller=new AbortController,this._tiles=new Map,this._graphicStoreUpdate=!1,this._graphicsSet=new Set,this._matcher=Promise.resolve(null),this._tileUpdateSet=new Set,this._tilesToUpdate=new Map,this._graphicIdToAbortController=new Map,this._attached=!1,this._updatingGraphicsTimer=null,this._hashToExpandedSymbol=new Map,this._hashToExpandedSymbolPromise=new Map,this._hashToCIMSymbolPromise=new Map,this._hashToCIM=new Map,this._processing=!1,this._needsProcessing=!1,this._pendingUpdate={added:new Set,updated:new Set,removed:new Set},this.lastUpdateId=-1,this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this._updatingGraphicsTimer&&(clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=null,this.notifyChange("updating")),this._controller.abort(),this.container.destroy(),this._set("graphics",null),this._graphicStore.clear(),this._attributeStore=null,this._hashToExpandedSymbol.clear(),this.view=null,this.renderer=null,this._hashToCIM.clear(),this._hashToCIMSymbolPromise.clear(),this._hashToExpandedSymbolPromise.clear()}_createMatcher(e,i,r){if(e){const n=ZQ(e),s=Zme({indexCount:0,fields:{}},"feature",e,n);this._matcher=Yme(s,i,null,r)}}_createDisplayId(e){let i=this._displayIds.get(e);return i||(i=this._storage.createDisplayId(),this._displayIds.set(e,i)),i}initialize(){this._attributeStore=new Avt({type:"local",initialize:s=>Promise.resolve(this.container.attributeView.initialize(s)),update:s=>this.container.attributeView.requestUpdate(s),render:()=>this.container.requestRender()},TT("2d"),()=>this.notifyChange("updating")),this.container.hasHighlight=()=>this._attributeStore.hasHighlight;const e=s=>{this._createDisplayId(s.uid),this._setFilterState(s.uid,s.visible)},i=s=>{const o=this._displayIds.get(s.uid);this._displayIds.delete(s.uid),this._storage.releaseDisplayId(o)},r=new nAt(this.container.getMaterialItems.bind(this.container),this.view.featuresTilingScheme.tileInfo);this._graphicStore=new rnr(this.view.featuresTilingScheme,this.view.state.scale,this.uid,this.graphics,e,i,this._hashToCIM),this._meshFactory=new sAt(null,this.uid,r),this._templateStore=r,this.handles.add([Qi(()=>this.renderer,s=>{this._createMatcher(s,r,this.container.stage.resourceManager);for(const o of this.graphics)this._pendingUpdate.updated.add(o);this.requestUpdate()}),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{onr&&this.container.enableRenderingBounds(()=>this._graphicStore.getAllBounds()),this.graphics.items.length>0&&this._graphicsChangeHandler({target:this.graphics,added:this.graphics.items,removed:[],moved:[]}),this.handles.add(this.graphics.on("change",o=>this._graphicsChangeHandler(o)),"graphics");const s=this.container.stage.resourceManager;this._createMatcher(this.renderer,r,s),this._graphicStore.setResourceManager(s),this._attached=!0,this.notifyChange("updating")})]);const n=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:n,removed:[]})}get updating(){return!this._attached||this._updatingGraphicsTimer!==null||this._tileUpdateSet.size>0||this._tilesToUpdate.size>0||this._attributeStore.isUpdating()}hitTest(e){if(!this.view||!this.view.position)return[];const{resolution:i,rotation:r}=this.view.state;return this._graphicStore.hitTest(e.x,e.y,2,i,r)}update(e){sn(this._controller.signal);const i=e.state,{resolution:r}=i;if(this._graphicStore.updateLevel(r),this._graphicStoreUpdate=!0,this.updateRequested=!1,this._pendingUpdate.updated.size>0){if(!this._processing)return void this._updateGraphics();this._needsProcessing=!0}}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback())}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}graphicUpdateHandler(e){const{graphic:i,property:r}=e;switch(r){case"attributes":case"geometry":case"symbol":this._pendingUpdate.updated.add(i),this.requestUpdate();break;case"visible":this._setFilterState(i.uid,i.visible),this._attributeStore.sendUpdates()}}setHighlight(e){const i=e.map(r=>this._displayIds.get(r)).filter(ye);this._attributeStore.setHighlight(e,i)}_getIntersectingTiles(e){const i=this._graphicStore.getBounds(e);if(!i||c7e(i)===0||h7e(i)===0)return[];const r=Trr(i,this.view.spatialReference);return ye(r)?[...new Set([...this.view.graphicsTileStore.boundsIntersections(r[0]),...this.view.graphicsTileStore.boundsIntersections(r[1])])]:this.view.graphicsTileStore.boundsIntersections(i)}async _updateTile(e){sn(this._controller.signal);const i=e.tile,r=this._getGraphicsData(this._templateStore,i,e.addedOrModified),n=await this._processGraphics(i,r);return sn(this._controller.signal),this._patchTile(i.key,{type:"update",addOrUpdate:n,remove:e.removed,end:!0,clear:!1,sort:!1}),n}_patchTile(e,i){const r=this._tiles.get(e);r&&(this.container.onTileData(r,i),this.container.requestRender())}_graphicsChangeHandler(e){const i=this._pendingUpdate;for(const r of e.added)i.added.add(r);for(const r of e.moved)i.updated.add(r);for(const r of e.removed)this._pendingUpdate.added.has(r)?i.added.delete(r):i.removed.add(r);this._processing?this._needsProcessing=!0:this._updateGraphics()}_getGraphicsToUpdate(){const e={added:[],removed:[],updated:[]};if(!this.graphics)return e;const i=this._pendingUpdate;for(const r of this.graphics.items)i.added.has(r)?e.added.push(r):i.updated.has(r)&&e.updated.push(r);for(const r of i.removed)this._graphicStore.has(r)&&e.removed.push(r);return i.added.clear(),i.removed.clear(),i.updated.clear(),e}async _updateGraphics(){this._processing=!0;const{added:e,removed:i,updated:r}=this._getGraphicsToUpdate(),n=this._tilesToUpdate;let s;try{if(!this._graphicStoreUpdate){const p=this.view.state,{resolution:y}=p;this._graphicStore.updateLevel(y)}const o=[],a=new Array(e.length+i.length);for(let p=0;p({name:r,alias:r,type:typeof e.attributes[r]=="string"?"esriFieldTypeString":"esriFieldTypeDouble"}));return lt(e.geometry)?null:{geometryType:md(e.geometry),spatialReference:rr.fromJSON(e.geometry.spatialReference),fields:i}}_getSymbolForGraphic(e,i){return sn(this._controller.signal),ye(e.symbol)?Promise.resolve(e.symbol):ye(this.renderer)?this.renderer.getSymbolAsync(e,{scale:this.view.scale,signal:ye(i)?i.signal:null}):Promise.resolve(this._getNullSymbol(e))}_getCIMSymbol(e,i,r){let n=this._hashToCIM.get(i);if(n)return Promise.resolve(n);const s=rYi(e);if(ye(s)){if(s.type==="CIMSymbolReference")return n=s,this._hashToCIM.set(i,n),Promise.resolve(n);let o=this._hashToCIMSymbolPromise.get(i);return o||(o=s.fetchCIMSymbol(r).then(a=>(this._hashToCIM.set(i,a.data),this._hashToCIMSymbolPromise.delete(i),a)).catch(a=>(this._hashToCIMSymbolPromise.delete(i),Ga(a),null)),this._hashToCIMSymbolPromise.set(i,o),o)}return Promise.resolve(null)}_expandCIMSymbol(e,i,r,n){const s=this._hashToExpandedSymbol.get(r);if(s)return Promise.resolve(s);let o=this._hashToExpandedSymbolPromise.get(r);if(o)return o;const a=this.container.stage,l=this._getArcadeInfo(i),c=ZQ(null),d=K_(e,c);return o=PS(d,l,a.resourceManager,n),this._hashToExpandedSymbolPromise.set(r,o),o.then(p=>(this._hashToExpandedSymbol.set(r,p),this._hashToExpandedSymbolPromise.delete(r),p)),o}async _getSymbolResources(e,i){return sn(this._controller.signal),this.container.stage?this._getSymbolForGraphic(e,i).then(r=>{if(!r)return null;const n=r.hash();return this._getCIMSymbol(r,n,i).then(s=>lt(s)?null:this._expandCIMSymbol(s,e,n,i).then(o=>{const a=o.layers.filter(l=>l.type==="text"&&typeof l.text=="string");if(a&&a.length>0){const l=new Array(a.length);for(let d=0;d{ig(d);for(let p=0;p(Ga(r),null)):null}async _projectAndNormalizeGeometry(e,i){if(sn(this._controller.signal),lt(e.geometry)||e.geometry.type==="mesh")return null;let r=e.geometry;if(Va(r)){const o=r.rings;r.rings=o}else if(Lu(r)){const o=r.paths;r.paths=o}else if(ac(r)){const o=await this._getSymbolForGraphic(e,i);sn(this._controller.signal),o&&(Irr(o.type)||Err(o.type))?r=r.center:r=Arr(r)}await uy(r.spatialReference,this.view.spatialReference);const n=Ftr(r),s=fp(n,r.spatialReference,this.view.spatialReference);return s&&R9t(s),s}_onTileUpdate(e){const i=pd(this.view.spatialReference);if(e.added&&e.added.length>0)for(const r of e.added)this._addNewTile(r,i);if(e.removed&&e.removed.length>0)for(const r of e.removed)this._removeTile(r.key)}async _addGraphic(e){this._abortProcessingGraphic(e.uid),sn(this._controller.signal);const i=new AbortController;this._graphicIdToAbortController.set(e.uid,i);const r={signal:i.signal};try{await this._addOrUpdateGraphic(e,r),sn(this._controller.signal),this._graphicIdToAbortController.delete(e.uid)}catch(n){if(this._graphicIdToAbortController.delete(e.uid),!ss(n))throw n}}_updateGraphic(e,i){sn(this._controller.signal);const r=this._projectAndNormalizeGeometry(e,i),n=this._getSymbolResources(e,i);return Promise.all([r,n]).then(([s,o])=>{sn(this._controller.signal),this._graphicStore.addOrModify(e,o,s)})}_addOrUpdateGraphic(e,i){sn(this._controller.signal);const r=this._projectAndNormalizeGeometry(e,i),n=this._getSymbolResources(e,i);return Promise.all([r,n]).then(([s,o])=>{sn(this._controller.signal),this._graphicsSet.has(e)&&this._graphicStore.addOrModify(e,o,s)})}_addTile(e){const i=this.view.featuresTilingScheme.getTileBounds(_o(),e),r=this.view.featuresTilingScheme.getTileResolution(e.level),n=new jtr(e,r,i[0],i[3]);return this._tiles.set(e,n),this.container.addChild(n),n}async _addNewTile(e,i){const r=this._addTile(e.key),n=this._graphicStore.queryTileData(this._templateStore,e);if(n.length===0)return;if(i){const o=Math.round((i.valid[1]-i.valid[0])/e.resolution);for(const a of n)a.geometry&&(Wy(a.geometry)||sg(a.geometry))&&this._wrapPoints(a,o)}const s=e.key;this._tileUpdateSet.add(e.key),this.notifyChange("updating");try{const o={type:"update",clear:!1,addOrUpdate:await this._processGraphics(e,n),remove:[],end:!0,sort:!1};r.patch(o),this._tileUpdateSet.delete(s),this.notifyChange("updating")}catch(o){if(this._tileUpdateSet.delete(s),this.notifyChange("updating"),!ss(o))throw o}}_removeTile(e){if(!this._tiles.has(e))return;const i=this._tiles.get(e);this.container.removeChild(i),i.destroy(),this._tiles.delete(e)}_setFilterState(e,i){const r=this._displayIds.get(e),n=this._attributeStore.getHighlightFlag(e);this._attributeStore.setData(r,0,0,n|(i?C0t:0))}_getGraphicsData(e,i,r){const n=this.view,s=pd(n.spatialReference),o=this._graphicStore.getGraphicsData(e,i,r);if(s){const a=Math.round((s.valid[1]-s.valid[0])/i.resolution);for(const l of o)l.geometry&&(Wy(l.geometry)||sg(l.geometry))&&this._wrapPoints(l,a)}return o}_wrapPoints(e,i){const r=e.geometry;sg(r)?this._wrapMultipoint(r,i):this._wrapPoint(e,i)}_wrapMultipoint(e,i){const r=e.points,n=[];let s=0,o=0;for(const[a,l]of r){if(n.push([a+s,l]),s=0,i===Mj){const c=5*CO;a+oMj-c&&(n.push([-i,0]),s=i)}else a+o<-CO?(n.push([i,0]),s=-i):a+o>Mj+CO&&(n.push([-i,0]),s=i);o+=a}e.points=n}_wrapPoint(e,i){const r=e.geometry;if(i===Mj){const n=5*CO;r.xMj-n&&(e.geometry={points:[[r.x,r.y],[-i,0]]})}else r.x<-CO?e.geometry={points:[[r.x,r.y],[i,0]]}:r.x>Mj+CO&&(e.geometry={points:[[r.x,r.y],[-i,0]]})}_processGraphics(e,i,r){if(!(i&&i.length)||!this._meshFactory)return Promise.resolve(null);const n=tnr.from(i,this.uid,e.transform),s=this._meshFactory;return this._matcher.then(o=>s.analyzeGraphics(n,this.container.stage.resourceManager,o,null,null,r).then(()=>(this._attributeStore.sendUpdates(),this._processAnalyzedGraphics(e,n))))}_processAnalyzedGraphics(e,i){const r=this._meshFactory,n=i.getSize(),s=i.getCursor(),o={features:n,records:n,metrics:0},a=new PIt(e.key.id,o,Yo.DEFAULT,!1,!1),l=[];for(;s.next();){const y=s.readGraphic();y.insertAfter=y.insertAfter===-1?-1:this._displayIds.get(y.insertAfter),y.displayId=this._displayIds.get(y.attributes[this.uid]);const v=new yIt(y.displayId);v.insertAfter=y.insertAfter,l.push(v),r.writeGraphic(a,s,e.level,this.container.stage.resourceManager)}const c=e.tileInfoView.tileInfo.isWrappable,d=a.serialize(c);if(d.length!==1)return new wIt;const p=d[0].message;return wIt.fromVertexData(p,l)}_abortProcessingGraphic(e){this._graphicIdToAbortController.get(e)?.abort()}_getNullSymbol(e){const i=e.geometry;return Lu(i)?mWt:Va(i)||ac(i)?gWt:this.defaultPointSymbolEnabled?fWt:null}_flipUpdatingGraphics(){this._updatingGraphicsTimer&&clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=setTimeout(()=>{this._updatingGraphicsTimer=null,this.notifyChange("updating")},160),this.notifyChange("updating")}};E([k({constructOnly:!0})],HE.prototype,"requestUpdateCallback",void 0),E([k()],HE.prototype,"container",void 0),E([k({constructOnly:!0})],HE.prototype,"graphics",void 0),E([k()],HE.prototype,"updating",null),E([k()],HE.prototype,"view",void 0),E([k()],HE.prototype,"updateRequested",void 0),E([k()],HE.prototype,"defaultPointSymbolEnabled",void 0),HE=E([ht("esri.views.2d.layers.support.GraphicsView2D")],HE);const fx=HE,gke=Ei.getLogger("esri.views.2d.engine.webgl.AttributeStoreView"),yke=xvt(Svt,gke);let bAt=class{constructor(e,i,r){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:n,pixelType:s,textureOnly:o}=e,a=DJ(s);this.shared=r,this.pixelType=s,this.size=i,this.textureOnly=o,o||(this.data=new a(n)),this._resetRange()}destroy(){ya(this._texture,e=>e.dispose());for(const e in this._fbos)ya(this._fbos[e],i=>{e==="0"&&i.detachColorTexture(),i.dispose()}),this._fbos[e]=null;this._texture=null}get _textureDesc(){return{target:Ws.TEXTURE_2D,wrapMode:us.CLAMP_TO_EDGE,pixelFormat:nn.RGBA,dataType:this.pixelType,samplingMode:mn.NEAREST,width:this.size,height:this.size}}setData(e,i,r){const n=JP(e),s=this.data,o=n*this.texelSize+i;!s||o>=s.length||(s[o]=r,this.dirtyStart=Math.min(this.dirtyStart,n),this.dirtyEnd=Math.max(this.dirtyEnd,n))}getData(e,i){if(lt(this.data))return null;const r=JP(e)*this.texelSize+i;return!this.data||r>=this.data.length?null:this.data[r]}getTexture(e){return Fu(this._texture,()=>this._initTexture(e))}getFBO(e,i=0){if(lt(this._fbos[i])){const r={colorTarget:Th.TEXTURE,depthStencilTarget:gl.NONE},n=i===0?this.getTexture(e):this._textureDesc;this._fbos[i]=new id(e,r,n)}return this._fbos[i]}get locked(){return!(this.pixelType!==ts.UNSIGNED_BYTE||!this.shared||this.textureOnly||!Gi("esri-atomics")||!this.data)&&Atomics.load(this.data,0)===1}get hasDirty(){const e=this.dirtyStart;return this.dirtyEnd>=e}updateTexture(e,i){if(!this.locked){try{const r=this.dirtyStart,n=this.dirtyEnd;if(!this.hasDirty)return;this._resetRange();const s=this.data.buffer,o=this.getTexture(e),a=4,l=(r-r%this.size)/this.size,c=(n-n%this.size)/this.size,d=l,p=this.size,y=c,v=l*this.size*a,S=(p+y*this.size)*a-v,I=DJ(this.pixelType),O=new I(s,v*I.BYTES_PER_ELEMENT,S),L=this.size,N=y-d+1;if(N>this.size)return void gke.error(new st("mapview-webgl","Out-of-bounds index when updating AttributeData"));o.updateData(0,0,d,L,N,O)}catch{}i()}}update(e){const{data:i,start:r,end:n}=e;if(ye(i)&&ye(this.data)){const s=this.data,o=r*this.texelSize;for(let a=0;anew bAt(s,n,r));else for(let s=0;sp_e(e,i=>i.destroy())),ya(this._defaultTexture,e=>e.dispose())}isEmpty(){const e=this._data;return lt(e)}isUpdating(){const e=ye(this._pendingAttributeUpdate),i=e;return Gi("esri-2d-log-updating")&&console.log(`Updating AttributeStoreView ${i} - -> hasPendingUpdate ${e}`),i}getBlock(e){return lt(this._data)?null:this._data[e]}setLabelMinZoom(e,i){this.setData(e,0,1,i)}getLabelMinZoom(e){return this.getData(e,0,1,255)}getFilterFlags(e){return this.getData(e,0,0,0)}getVVSize(e){return this.getData(e,WDe,0,0)}getData(e,i,r,n){if(!this._data)return 0;const s=this._data[i];if(lt(s))return 0;const o=s.getData(e,r);return ye(o)?o:n}setData(e,i,r,n){const s=this._data[i];s.setData(e,r,n)}lockTextureUpload(){this._locked=!0}unlockTextureUpload(){this._locked=!1}forceTextureUpload(){this._forceNextUpload=!0}async requestUpdate(e){if(this._pendingAttributeUpdate)return void gke.error(new st("mapview-webgl","Tried to update attribute data with a pending update"));const i=Mf();return yke("AttributeStoreView Update Requested",e),this._pendingAttributeUpdate={data:e,resolver:i},this._onUpdate(),i.promise}update(){if(this._initialized&&ye(this._pendingAttributeUpdate)){Gi("esri-2d-update-debug")&&console.debug("AttributeStoreView::update");const{data:e,resolver:i}=this._pendingAttributeUpdate,r=this._data;for(let n=0;nya(s,l=>{yke(`Updating block ${n}`,l),a.update(l)}))}this._pendingAttributeUpdate=null,i(),this._onUpdate()}}bindTextures(e,i=!0){const r=this._getDefaultTexture(e);if(!this._initialized)return e.bindTexture(r,gpe),void(i&&(e.bindTexture(r,ype),e.bindTexture(r,jDe),e.bindTexture(r,zDe),e.bindTexture(r,vpe),e.bindTexture(r,_pe),e.bindTexture(r,w0t)));const n=this._data;this._locked&&!this._forceNextUpload||(JBe(n,s=>s.updateTexture(e,()=>this._onUpdate())),this._forceNextUpload=!1),e.bindTexture(Vv(n[YLi],r,s=>s.getTexture(e)),gpe),i&&(e.bindTexture(Vv(n[bpe],r,s=>s.getTexture(e)),w0t),e.bindTexture(Vv(n[HDe],r,s=>s.getTexture(e)),ype),e.bindTexture(Vv(n[WDe],r,s=>s.getTexture(e)),jDe),e.bindTexture(Vv(n[XLi],r,s=>s.getTexture(e)),zDe),e.bindTexture(Vv(n[vpe],r,s=>s.getTexture(e)),vpe),e.bindTexture(Vv(n[_pe],r,s=>s.getTexture(e)),_pe))}_getDefaultTexture(e){if(lt(this._defaultTexture)){const i={wrapMode:us.CLAMP_TO_EDGE,pixelFormat:nn.RGBA,dataType:ts.UNSIGNED_BYTE,samplingMode:mn.NEAREST,width:1,height:1};this._defaultTexture=new bs(e,i,new Uint8Array(4))}return this._defaultTexture}};const lnr=t=>{switch(t.BYTES_PER_ELEMENT){case 1:return Di.UNSIGNED_BYTE;case 2:return Di.UNSIGNED_SHORT;case 4:return Di.UNSIGNED_INT;default:throw new st("Cannot get DataType of array")}},unr=(t,e,i,r)=>{let n=0;for(let s=1;s0:n<0},wAt=({coords:t,lengths:e},i)=>{const r=[];for(let n=0,s=0;n({...r,[n]:Ko.createVertex(e,i,this.vertices[n])}),{})),this._cache.vertexBuffers}};const tge=t=>parseFloat(t)/100;let cnr=class U5t extends CS{constructor(e,i){super(),this._clip=i,this._cache={},this.stage=e,this._handle=Qi(()=>i.version,()=>this._invalidate()),this.ready()}static fromClipArea(e,i){return new U5t(e,i)}_destroyGL(){ye(this._cache.mesh)&&(this._cache.mesh.destroy(),this._cache.mesh=null),ye(this._cache.vao)&&(this._cache.vao.dispose(),this._cache.vao=null)}destroy(){this._destroyGL(),this._handle.remove()}getVAO(e,i,r,n){const[s,o]=i.size;if(this._clip.type!=="geometry"&&this._lastWidth===s&&this._lastHeight===o||(this._lastWidth=s,this._lastHeight=o,this._destroyGL()),lt(this._cache.vao)){const a=this._createMesh(i,this._clip),l=a.getIndexBuffer(e),c=a.getVertexBuffers(e);this._cache.mesh=a,this._cache.vao=new Ac(e,r,n,c,l)}return this._cache.vao}_createTransforms(){return{dvs:Cl()}}_invalidate(){this._destroyGL(),this.requestRender()}_createScreenRect(e,i){const[r,n]=e.size,s=typeof i.left=="string"?tge(i.left)*r:i.left,o=typeof i.right=="string"?tge(i.right)*r:i.right,a=typeof i.top=="string"?tge(i.top)*n:i.top,l=typeof i.bottom=="string"?tge(i.bottom)*n:i.bottom,c=s,d=a;return{x:c,y:d,width:Math.max(r-o-c,0),height:Math.max(n-l-d,0)}}_createMesh(e,i){switch(i.type){case"rect":return ege.fromRect(this._createScreenRect(e,i));case"path":return ege.fromPath(i);case"geometry":return ege.fromGeometry(e,i);default:return Ei.getLogger("esri.views.2d.engine.webgl.ClippingInfo").error(new st("mapview-bad-type","Unable to create ClippingInfo mesh from clip of type: ${clip.type}")),ege.fromRect({x:0,y:0,width:1,height:1})}}},Lj=class extends yj{constructor(){super(...arguments),this.name=this.constructor.name}set clips(e){this._clips=e,this.children.forEach(i=>i.clips=e),this._updateClippingInfo()}beforeRender(e){super.beforeRender(e),this.updateTransforms(e.state)}_createTransforms(){return{dvs:Cl()}}doRender(e){const i=this.createRenderParams(e),{painter:r,globalOpacity:n,profiler:s,drawPhase:o}=i,a=o===io.LABEL||o===io.HIGHLIGHT?1:n*this.computedOpacity;s.recordContainerStart(this.name),r.beforeRenderLayer(i,this._clippingInfos?255:0,a),this.renderChildren(i),r.compositeLayer(i,a),s.recordContainerEnd()}renderChildren(e){lt(this._renderPasses)&&(this._renderPasses=this.prepareRenderPasses(e.painter));for(const i of this._renderPasses)try{i.render(e)}catch{}}createRenderParams(e){return e.requireFBO=this.requiresDedicatedFBO,e}prepareRenderPasses(e){return[e.registerRenderPass({name:"clip",brushes:[lh.clip],target:()=>this._clippingInfos,drawPhase:io.MAP|io.LABEL|io.LABEL_ALPHA|io.DEBUG|io.HIGHLIGHT})]}updateTransforms(e){for(const i of this.children)i.setTransform(e)}onAttach(){super.onAttach(),this._updateClippingInfo()}onDetach(){super.onDetach(),this._updateClippingInfo()}_updateClippingInfo(){ye(this._clippingInfos)&&(this._clippingInfos.forEach(r=>r.destroy()),this._clippingInfos=null);const e=this.stage;if(!e)return;const i=this._clips;ye(i)&&i.length&&(this._clippingInfos=i.items.map(r=>cnr.fromClipArea(e,r))),this.requestRender()}};const hnr=(t,e)=>t.key.level-e.key.level!=0?t.key.level-e.key.level:t.key.row-e.key.row!=0?t.key.row-e.key.row:t.key.col-e.key.col;let iee=class extends Lj{constructor(e){super(),this._tileInfoView=e}get requiresDedicatedFBO(){return!1}renderChildren(e){this.sortChildren(hnr),this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:i}=e,r=super.createRenderParams(e);return r.requiredLevel=this._tileInfoView.getClosestInfoForScale(i.scale).level,r.displayLevel=this._tileInfoView.tileInfo.scaleToZoom(i.scale),r}prepareRenderPasses(e){const i=super.prepareRenderPasses(e);return i.push(e.registerRenderPass({name:"stencil",brushes:[dEt],drawPhase:io.DEBUG|io.MAP|io.HIGHLIGHT,target:()=>this.getStencilTarget()})),Gi("esri-tiles-debug")&&i.push(e.registerRenderPass({name:"tileInfo",brushes:[hEt],drawPhase:io.DEBUG,target:()=>this.children})),i}getStencilTarget(){return this.children}setStencilReference(e){let i=1;for(const r of this.children)r.stencilRef=i++}};function vke(t,e){const i=e.length;if(t{let r=1/0,n=0;for(const l in i.levels){const c=parseFloat(l),d=Math.abs(e-c);dthis.onAttributeStoreUpdate())}destroy(){this.children.forEach(e=>e.destroy()),this.removeAllChildren(),this.attributeView.destroy(),this._materialItemsRequestQueue.clear()}setRendererInfo(e,i,r){this._rendererInfo.setInfo(e,i,r),this.requestRender()}async getMaterialItems(e,i){if(!e||e.length===0)return[];const r=Mf();return this._materialItemsRequestQueue.push({items:e,abortOptions:i,resolver:r}),this.requestRender(),r.promise}doRender(e){if(e.context.capabilities.enable("textureFloat"),e.context.capabilities.enable("vao"),this._materialItemsRequestQueue.length>0){let i=this._materialItemsRequestQueue.pop();for(;i;)this._processMaterialItemRequest(e,i),i=this._materialItemsRequestQueue.pop()}super.doRender(e)}renderChildren(e){for(const i of this.children)i.commit(e);this._rendererInfo.update(e.state),super.renderChildren(e)}updateTransforms(e){if(this.children.some(i=>i.hasData))for(const i of this.children)i.setTransform(e)}createRenderParams(e){const i=super.createRenderParams(e);return i.rendererInfo=this._rendererInfo,i.attributeView=this.attributeView,i}onAttributeStoreUpdate(){}_processMaterialItemRequest(e,{items:i,abortOptions:r,resolver:n}){const{painter:s,pixelRatio:o}=e,a=i.map(l=>s.textureManager.rasterizeItem(l.symbol,o,l.glyphIds,r));Promise.all(a).then(l=>{if(!this.stage)return void n.reject();const c=l.map((d,p)=>({id:i[p].id,mosaicItem:d}));n.resolve(c)},n.reject)}};const pnr=Math.PI/180,fnr=4;let mnr=class extends CS{constructor(e){super(),this._program=null,this._vao=null,this._vertexBuffer=null,this._indexBuffer=null,this._dvsMat3=Cl(),this._localOrigin={x:0,y:0},this._getBounds=e}destroy(){this._vao&&(this._vao.dispose(!0),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program=Ba(this._program)}doRender(e){const{context:i}=e,r=this._getBounds();if(r.length<1)return;this._createShaderProgram(i),this._updateMatricesAndLocalOrigin(e),this._updateBufferData(i,r),i.setBlendingEnabled(!0),i.setDepthTestEnabled(!1),i.setStencilWriteMask(0),i.setStencilTestEnabled(!1),i.setBlendFunction(cn.ONE,cn.ONE_MINUS_SRC_ALPHA),i.setColorMask(!0,!0,!0,!0);const n=this._program;i.bindVAO(this._vao),i.useProgram(n),n.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),i.gl.lineWidth(1),i.drawElements(ls.LINES,8*r.length,Di.UNSIGNED_INT,0),i.bindVAO()}_createTransforms(){return{dvs:Cl()}}_createShaderProgram(e){if(this._program)return;const i=`precision highp float; + `;this._program=e.programCache.acquire(i,r,new Map([["a_pos",0]]))}dispose(){super.dispose(),this._image.src=""}_test(e){const i=this._rctx;if(!i.gl)return e.dispose(),!0;const r=new ad(i,{colorTarget:Ah.TEXTURE,depthStencilTarget:Tl.NONE},{target:so.TEXTURE_2D,wrapMode:ws.CLAMP_TO_EDGE,pixelFormat:gn.RGBA,dataType:ds.UNSIGNED_BYTE,samplingMode:In.NEAREST,width:1,height:1}),n=aa.createVertex(i,Xo.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),s=new Mc(i,new Map([["a_pos",0]]),KEt,{geometry:n}),o=new Fs(i,{dataType:ds.UNSIGNED_BYTE,pixelFormat:gn.RGBA,preMultiplyAlpha:!1,wrapMode:ws.CLAMP_TO_EDGE,samplingMode:In.LINEAR},this._image);i.useProgram(e),i.bindTexture(o,0),e.setUniform1i("u_texture",0);const a=i.getBoundFramebufferObject(),{x:l,y:c,width:h,height:p}=i.getViewport();i.bindFramebuffer(r),i.setViewport(0,0,1,1),i.setClearColor(0,0,0,0),i.setBlendingEnabled(!1),i.clearSafe(cE.COLOR_BUFFER_BIT),i.bindVAO(s),i.drawArrays(bs.TRIANGLE_STRIP,0,4);const y=new Uint8Array(4);return r.readPixels(0,0,1,1,gn.RGBA,ds.UNSIGNED_BYTE,y),s.dispose(!1),n.dispose(),r.dispose(),o.dispose(),i.setViewport(l,c,h,p),i.bindFramebuffer(a),y[0]!==255}},sir=class{constructor(e){this.rctx=e,this.floatBufferBlend=new iir(e),this.svgPremultipliesAlpha=new nir(e),this.doublePrecisionRequiresObfuscation=new qtr(e),this.ignoresSamplerPrecision=new rir(e),this.drawArraysRequiresIndicesTypeReset=new ztr(e)}dispose(){this.ignoresSamplerPrecision.dispose(),this.doublePrecisionRequiresObfuscation.dispose(),this.svgPremultipliesAlpha.dispose(),this.floatBufferBlend.dispose(),this.drawArraysRequiresIndicesTypeReset.dispose()}};function oir(t,e){if(e.disjointTimerQuery)return null;if(jE(t))return{drawBuffers:t.drawBuffers.bind(t),MAX_DRAW_BUFFERS:t.MAX_DRAW_BUFFERS,MAX_COLOR_ATTACHMENTS:t.MAX_COLOR_ATTACHMENTS};if(e.drawBuffers)return null;const i=t.getExtension("WEBGL_draw_buffers");return i?{drawBuffers:i.drawBuffersWEBGL.bind(i),MAX_DRAW_BUFFERS:i.MAX_DRAW_BUFFERS_WEBGL,MAX_COLOR_ATTACHMENTS:i.MAX_COLOR_ATTACHMENTS_WEBGL}:null}function air(t){if(jE(t))return t;const e=t.getExtension("ANGLE_instanced_arrays");return e?{drawArraysInstanced:e.drawArraysInstancedANGLE.bind(e),drawElementsInstanced:e.drawElementsInstancedANGLE.bind(e),vertexAttribDivisor:e.vertexAttribDivisorANGLE.bind(e)}:null}function lir(t,e){if(e.compressedTextureETC)return null;const i=t.getExtension("WEBGL_compressed_texture_etc");return i?{COMPRESSED_R11_EAC:i.COMPRESSED_R11_EAC,COMPRESSED_SIGNED_R11_EAC:i.COMPRESSED_SIGNED_R11_EAC,COMPRESSED_RG11_EAC:i.COMPRESSED_RG11_EAC,COMPRESSED_SIGNED_RG11_EAC:i.COMPRESSED_SIGNED_RG11_EAC,COMPRESSED_RGB8_ETC2:i.COMPRESSED_RGB8_ETC2,COMPRESSED_SRGB8_ETC2:i.COMPRESSED_SRGB8_ETC2,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:i.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:i.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_RGBA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}:null}function uir(t,e){if(e.compressedTextureS3TC)return null;const i=t.getExtension("WEBGL_compressed_texture_s3tc");return i?{COMPRESSED_RGB_S3TC_DXT1:i.COMPRESSED_RGB_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT1:i.COMPRESSED_RGBA_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT3:i.COMPRESSED_RGBA_S3TC_DXT3_EXT,COMPRESSED_RGBA_S3TC_DXT5:i.COMPRESSED_RGBA_S3TC_DXT5_EXT}:null}function cir(t,e){if(jE(t))return{MIN:t.MIN,MAX:t.MAX};if(e.blendMinMax)return null;{const i=t.getExtension("EXT_blend_minmax");return i?{MIN:i.MIN_EXT,MAX:i.MAX_EXT}:null}}function hir(t,e){if(e.textureFilterAnisotropic)return null;const i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");return i?{MAX_TEXTURE_MAX_ANISOTROPY:i.MAX_TEXTURE_MAX_ANISOTROPY_EXT,TEXTURE_MAX_ANISOTROPY:i.TEXTURE_MAX_ANISOTROPY_EXT}:null}function dir(t,e){if(jE(t))return{textureFloat:!0,textureFloatLinear:!e.textureFloatLinear&&!!t.getExtension("OES_texture_float_linear"),textureHalfFloat:!0,textureHalfFloatLinear:!0,HALF_FLOAT:t.HALF_FLOAT,R16F:t.R16F,RG16F:t.RG16F,RGBA16F:t.RGBA16F,R32F:t.R32F,RG32F:t.RG32F,RGBA32F:t.RGBA32F,R11F_G11F_B10F:t.R11F_G11F_B10F,RGB16F:t.RGB16F};if(t instanceof WebGLRenderingContext){const i=!e.textureHalfFloat&&t.getExtension("OES_texture_half_float");return{textureFloat:!e.textureFloat&&!!t.getExtension("OES_texture_float"),textureFloatLinear:!e.textureFloatLinear&&!!t.getExtension("OES_texture_float_linear"),textureHalfFloat:!!i,textureHalfFloatLinear:!e.textureHalfFloatLinear&&!!t.getExtension("OES_texture_half_float_linear"),HALF_FLOAT:i?i.HALF_FLOAT_OES:void 0}}return null}function pir(t,e){if(jE(t)){const i=!e.colorBufferHalfFloat&&t.getExtension("EXT_color_buffer_half_float")||!e.colorBufferFloat&&t.getExtension("EXT_color_buffer_float"),r=!e.colorBufferFloat&&t.getExtension("EXT_color_buffer_float"),n=!e.floatBlend&&!e.colorBufferFloat&&t.getExtension("EXT_float_blend");return i||r||n?{textureFloat:!!r,textureHalfFloat:!!i,floatBlend:!!n,R16F:t.R16F,RG16F:t.RG16F,RGBA16F:t.RGBA16F,R32F:t.R32F,RG32F:t.RG32F,RGBA32F:t.RGBA32F,R11F_G11F_B10F:t.R11F_G11F_B10F,RGB16F:t.RGB16F}:null}if(t instanceof WebGLRenderingContext){const i=!e.colorBufferHalfFloat&&t.getExtension("EXT_color_buffer_half_float"),r=!e.colorBufferFloat&&t.getExtension("WEBGL_color_buffer_float"),n=!e.floatBlend&&!e.colorBufferFloat&&t.getExtension("EXT_float_blend");return i||r||n?{textureFloat:!!r,textureHalfFloat:!!i,floatBlend:!!n,RGBA16F:i?i.RGBA16F_EXT:void 0,RGB16F:i?i.RGB16F_EXT:void 0,RGBA32F:r?r.RGBA32F_EXT:void 0}:null}return null}function UQ(t,e,i,r,n){if(r&&jE(t))return!0;if(e[i])return!1;for(const s of n)if(t.getExtension(s))return!0;return!1}function fir(t,e){if(!jE(t)||e.textureNorm16)return null;const i=t.getExtension("EXT_texture_norm16");return i?{R16:i.R16_EXT,RG16:i.RG16_EXT,RGB16:i.RGB16_EXT,RGBA16:i.RGBA16_EXT,R16_SNORM:i.R16_SNORM_EXT,RG16_SNORM:i.RG16_SNORM_EXT,RGB16_SNORM:i.RGB16_SNORM_EXT,RGBA16_SNORM:i.RGBA16_SNORM_EXT}:null}function mir(t,e){const i=e.loseContext&&t.getExtension("WEBGL_lose_context");return i?{loseRenderingContext:()=>i.loseContext()}:null}function gir(t,e){if(jE(t))return{createVertexArray:t.createVertexArray.bind(t),deleteVertexArray:t.deleteVertexArray.bind(t),bindVertexArray:t.bindVertexArray.bind(t)};if(e.vao)return null;const i=t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object");return i?{createVertexArray:i.createVertexArrayOES.bind(i),deleteVertexArray:i.deleteVertexArrayOES.bind(i),bindVertexArray:i.bindVertexArrayOES.bind(i)}:null}let yir=class{constructor(e,i){this._gl=e,this._instancing=null,this._vertexArrayObject=null,this._compressedTextureETC=null,this._compressedTextureS3TC=null,this._textureFilterAnisotropic=null,this._textureFloat=null,this._colorBufferFloat=null,this._minMaxBlending=null,this._loseContext=null,this._drawBuffers=null,this._textureNorm16=null,this._depthTexture=null,this._standardDerivatives=null,this._shaderTextureLOD=null,this._fragDepth=null,this._textureFloatLinear=null,this._disabledExtensions=i.disabledExtensions||{},this._debugWebGLExtensions=i.debugWebGLExtensions||{}}get drawBuffers(){return this._drawBuffers||(this._drawBuffers=oir(this._gl,this._disabledExtensions)),this._drawBuffers}get instancing(){return this._instancing||(this._instancing=air(this._gl)),this._instancing}get vao(){return this._vertexArrayObject||(this._vertexArrayObject=gir(this._gl,this._disabledExtensions)),this._vertexArrayObject}get compressedTextureETC(){return this._compressedTextureETC||(this._compressedTextureETC=lir(this._gl,this._disabledExtensions)),this._compressedTextureETC}get compressedTextureS3TC(){return this._compressedTextureS3TC||(this._compressedTextureS3TC=uir(this._gl,this._disabledExtensions)),this._compressedTextureS3TC}get textureFilterAnisotropic(){return this._textureFilterAnisotropic||(this._textureFilterAnisotropic=hir(this._gl,this._disabledExtensions)),this._textureFilterAnisotropic}get disjointTimerQuery(){return this._disjointTimerQuery||(this._disjointTimerQuery=TIt(this._gl,this._disabledExtensions)),this._disjointTimerQuery}get textureFloat(){return this._textureFloat||(this._textureFloat=dir(this._gl,this._disabledExtensions)),this._textureFloat}get colorBufferFloat(){return this._colorBufferFloat||(this._colorBufferFloat=pir(this._gl,this._disabledExtensions)),this._colorBufferFloat}get blendMinMax(){return this._minMaxBlending||(this._minMaxBlending=cir(this._gl,this._disabledExtensions)),this._minMaxBlending}get depthTexture(){return this._depthTexture===null&&(this._depthTexture=UQ(this._gl,this._disabledExtensions,"depthTexture",!0,["WEBGL_depth_texture","MOZ_WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"])),this._depthTexture}get standardDerivatives(){return this._standardDerivatives===null&&(this._standardDerivatives=UQ(this._gl,this._disabledExtensions,"standardDerivatives",!0,["OES_standard_derivatives"])),this._standardDerivatives}get shaderTextureLOD(){return this._shaderTextureLOD===null&&(this._shaderTextureLOD=UQ(this._gl,this._disabledExtensions,"shaderTextureLOD",!0,["EXT_shader_texture_lod"])),this._shaderTextureLOD}get fragDepth(){return this._fragDepth===null&&(this._fragDepth=UQ(this._gl,this._disabledExtensions,"fragDepth",!0,["EXT_frag_depth"])),this._fragDepth}get loseContext(){return this._loseContext||(this._loseContext=mir(this._gl,this._debugWebGLExtensions)),this._loseContext}get textureNorm16(){return this._textureNorm16||(this._textureNorm16=fir(this._gl,this._disabledExtensions)),this._textureNorm16}get textureFloatLinear(){return this._textureFloatLinear===null&&(this._textureFloatLinear=UQ(this._gl,this._disabledExtensions,"textureFloatLinear",!1,["OES_texture_float_linear"])),this._textureFloatLinear}enable(e){return this[e]}},zIt=class{constructor(e,i){this.gl=e,this.instanceCounter=new _tr,this.programCache=new fEt(this),this._state=new EIt,this._numOfDrawCalls=0,this._numOfTriangles=0,this.type=jE(e)?bo.WEBGL2:bo.WEBGL1,this._loadExtensions(),this.configure(i)}get gl2(){return this.type===bo.WEBGL1?null:this.gl}configure(e){this._capabilities=new yir(this.gl,e),this._parameters=this._loadParameters(e);const i=this.gl.getParameter(this.gl.VIEWPORT);this._state=new EIt,this._state.viewport={x:i[0],y:i[1],width:i[2],height:i[3]},this._stateTracker=new Utr({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)}}),this.enforceState(),qa(this._driverTest),this._driverTest=new sir(this)}dispose(){qa(this._driverTest),this.programCache.dispose(),this.bindVAO(null),this.unbindBuffer(fo.ARRAY_BUFFER),this.unbindBuffer(fo.ELEMENT_ARRAY_BUFFER),this.type===bo.WEBGL2&&(this.unbindBuffer(fo.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(fo.PIXEL_PACK_BUFFER),this.unbindBuffer(fo.PIXEL_UNPACK_BUFFER),this.unbindBuffer(fo.COPY_READ_BUFFER),this.unbindBuffer(fo.COPY_WRITE_BUFFER)),this._state.textureUnitMap.length=0,Eb()&&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,i){for(let r=0;r=0&&(this._state.activeTexture=i)}externalVertexArrayObjectUpdate(){const e=this.capabilities.vao;e&&(e.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,i,r,n){e===this._state.blendColor.r&&i===this._state.blendColor.g&&r===this._state.blendColor.b&&n===this._state.blendColor.a||(this.gl.blendColor(e,i,r,n),this._state.blendColor.r=e,this._state.blendColor.g=i,this._state.blendColor.b=r,this._state.blendColor.a=n,this._stateTracker.invalidateBlending())}setBlendFunction(e,i){e===this._state.blendFunction.srcRGB&&i===this._state.blendFunction.dstRGB||(this.gl.blendFunc(e,i),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=e,this._state.blendFunction.dstRGB=i,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(e,i,r,n){this._state.blendFunction.srcRGB===e&&this._state.blendFunction.srcAlpha===r&&this._state.blendFunction.dstRGB===i&&this._state.blendFunction.dstAlpha===n||(this.gl.blendFuncSeparate(e,i,r,n),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=r,this._state.blendFunction.dstRGB=i,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,i){this._state.blendEquation.mode===e&&this._state.blendEquation.modeAlpha===i||(this.gl.blendEquationSeparate(e,i),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=i,this._stateTracker.invalidateBlending())}setColorMask(e,i,r,n){this._state.colorMask.r===e&&this._state.colorMask.g===i&&this._state.colorMask.b===r&&this._state.colorMask.a===n||(this.gl.colorMask(e,i,r,n),this._state.colorMask.r=e,this._state.colorMask.g=i,this._state.colorMask.b=r,this._state.colorMask.a=n,this._stateTracker.invalidateColorWrite())}setClearColor(e,i,r,n){this._state.clearColor.r===e&&this._state.clearColor.g===i&&this._state.clearColor.b===r&&this._state.clearColor.a===n||(this.gl.clearColor(e,i,r,n),this._state.clearColor.r=e,this._state.clearColor.g=i,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,i){this._state.polygonOffset[0]===e&&this._state.polygonOffset[1]===i||(this._state.polygonOffset[0]=e,this._state.polygonOffset[1]=i,this.gl.polygonOffset(e,i),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,i,r,n){this._state.scissorRect.x===e&&this._state.scissorRect.y===i&&this._state.scissorRect.width===r&&this._state.scissorRect.height===n||(this.gl.scissor(e,i,r,n),this._state.scissorRect.x=e,this._state.scissorRect.y=i,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,i){this._state.depthRange.zNear===e&&this._state.depthRange.zFar===i||(this.gl.depthRange(e,i),this._state.depthRange.zNear=e,this._state.depthRange.zFar=i,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,i,r){this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===i&&this._state.stencilFunction.mask===r||(this.gl.stencilFunc(e,i,r),this._state.stencilFunction.face=Jw.FRONT_AND_BACK,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=i,this._state.stencilFunction.mask=r,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(e,i,r,n){this._state.stencilFunction.face===e&&this._state.stencilFunction.func===i&&this._state.stencilFunction.ref===r&&this._state.stencilFunction.mask===n||(this.gl.stencilFuncSeparate(e,i,r,n),this._state.stencilFunction.face=e,this._state.stencilFunction.func=i,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,i,r){this._state.stencilOperation.face===Jw.FRONT_AND_BACK&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===i&&this._state.stencilOperation.zPass===r||(this.gl.stencilOp(e,i,r),this._state.stencilOperation.face=Jw.FRONT_AND_BACK,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=i,this._state.stencilOperation.zPass=r,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(e,i,r,n){this._state.stencilOperation.face===e&&this._state.stencilOperation.fail===i&&this._state.stencilOperation.zFail===r&&this._state.stencilOperation.zPass===n||(this.gl.stencilOpSeparate(e,i,r,n),this._state.stencilOperation.face=e,this._state.stencilOperation.fail=i,this._state.stencilOperation.zFail=r,this._state.stencilOperation.zPass=n,this._stateTracker.invalidateStencilTest())}setActiveTexture(e,i=!1){const r=this._state.activeTexture;return e>=0&&(i||e!==this._state.activeTexture)&&(this.gl.activeTexture(bDe+e),this._state.activeTexture=e),r}clear(e){e&&this.gl.clear(e)}clearSafe(e,i=255){e&&(e&cE.COLOR_BUFFER_BIT&&this.setColorMask(!0,!0,!0,!0),e&cE.DEPTH_BUFFER_BIT&&this.setDepthWriteEnabled(!0),e&cE.STENCIL_BUFFER_BIT&&this.setStencilWriteMask(i),this.gl.clear(e))}drawArrays(e,i,r){if(Eb()&&(this._numOfDrawCalls++,this._numOfTriangles+=HIt(e,r)),this.gl.drawArrays(e,i,r),Eb()){const n=KTt(this);n&&console.error("drawArrays:",n)}}drawElements(e,i,r,n){if(Eb()&&(this._numOfDrawCalls++,this._numOfTriangles+=HIt(e,i)),this.gl.drawElements(e,i,r,n),Eb()){const s=KTt(this);if(s){const o=this.getBoundVAO(),a=o?.indexBuffer,l=o?.vertexBuffers,c={indexBuffer:a,vertexBuffers:l},h={mode:e,count:i,type:r,offset:n},p=Pa(a,x=>x.size)??0,y=n+i,v=p=this.parameters.maxTextureImageUnits||i<0)&&console.error("Input texture unit is out of range of available units!");const n=this._state.textureUnitMap[i];return lt(e)||e.glName==null?(ve(n)&&(this.setActiveTexture(i,r),this.gl.bindTexture(n.descriptor.target,null)),this._state.textureUnitMap[i]=null,n):r||n!==e?(this.setActiveTexture(i,r),this.gl.bindTexture(e.descriptor.target,e.glName),e.applyChanges(),this._state.textureUnitMap[i]=e,n):(e.isDirty&&(this.setActiveTexture(i,r),e.applyChanges()),n)}unbindTexture(e){if(!lt(e))for(let i=0;i=this.parameters.maxUniformBufferBindings||i<0)return console.error("Uniform buffer binding point is out of range!"),null;const r=this._state.uniformBufferBindingPoints;let n=r[i];return lt(n)&&(n={buffer:null,offset:0,size:0},r[i]=n),n}bindBufferBase(e,i,r){const n=this._getBufferBinding(e,i);lt(n)||n.buffer===r&&n.offset===0&&n.size===0||(this.gl.bindBufferBase(e,i,r?r.glName:null),n.buffer=r,n.offset=0,n.size=0)}bindBufferRange(e,i,r,n,s){const o=this._getBufferBinding(e,i);if(!lt(o)&&!(o.buffer===r&&o.offset===n&&o.size===s)){if(n%this._parameters.uniformBufferOffsetAlignment!=0)return void console.error("Uniform buffer binding offset is not a multiple of the context offset alignment");this.gl.bindBufferRange(e,i,r.glName,n,s),o.buffer=r,o.offset=n,o.size=s}}bindUBO(e,i,r,n){lt(i)?this.bindBufferBase(fo.UNIFORM_BUFFER,e,null):(Eb()&&(n??i.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),i.initialize(),r!==void 0&&n!==void 0?this.bindBufferRange(fo.UNIFORM_BUFFER,e,i.buffer,r,n):this.bindBufferBase(fo.UNIFORM_BUFFER,e,i.buffer))}unbindUBO(e){for(let i=0,r=this._state.uniformBufferBindingPoints.length;ithis._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:i.timeline||new uAe,renderingOptions:i.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new gtr(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return l()}},this._taskHandle=dL({render:c=>this.renderFrame(c)}),this._taskHandle.pause(),this._lostWebGLContextHandle=ZI(r,"webglcontextlost",()=>{this.emit("webgl-error",{error:new st("webgl-context-lost")})}),this._bufferPool=new sQi,r.setAttribute("style","width: 100%; height:100%; display:block;"),e.appendChild(r)}destroy(){this.removeAllChildren(),this._emptyTrash(),this._taskHandle=Uc(this._taskHandle),this._lostWebGLContextHandle=Uc(this._lostWebGLContextHandle),this._canvas.parentNode?.removeChild(this._canvas),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.resourceManager.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get background(){return this._background}set background(e){this._background=e,this.requestRender()}get bufferPool(){return this._bufferPool}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}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=vir,this.renderRequested||(this.renderRequested=!0,this.emit("will-render"),this._taskHandle.resume())}renderFrame(e){const i=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=i,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this.renderRequested=!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(),this.emit("post-render")}_createTransforms(){return{dvs:Dl()}}renderChildren(e){for(const i of this.children)i.beforeRender(e);this._renderChildren(this.children,e);for(const i of this.children)i.afterRender(e)}_renderChildren(e,i){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),i.profiler.recordStart("drawLayers"),i.dataUploadCounter=0,i.drawPhase=mo.MAP,this.painter.beforeRenderLayers(r,this.background);for(const n of e)n.processRender(i);this.painter.prepareDisplay(i,this.background,this.state.padding),this.painter.renderLayers(r),i.drawPhase=mo.HIGHLIGHT,this.painter.beforeRenderLayers(r);for(const n of e)n.processRender(i);if(this.painter.renderLayers(r),this._isLabelDrawPhaseRequired(e)){i.drawPhase=mo.LABEL,this.painter.beforeRenderLayers(r);for(const n of e)n.processRender(i);this.painter.renderLayers(r)}if(Hi("esri-tiles-debug")){i.drawPhase=mo.DEBUG,this.painter.beforeRenderLayers(r);for(const n of e)n.processRender(i);this.painter.renderLayers(r)}i.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const i=this.context,{state:r,pixelRatio:n}=e;this._resizeCanvas(e),i.setViewport(0,0,n*r.size[0],n*r.size[1]),i.setDepthWriteEnabled(!0),i.setStencilWriteMask(255),super.doRender(e)}async takeScreenshot(e){const{framebufferWidth:i,framebufferHeight:r}={framebufferWidth:Math.round(this.state.size[0]*e.resolutionScale),framebufferHeight:Math.round(this.state.size[1]*e.resolutionScale)},n=e.resolutionScale,s=this.context,o=this._state.clone();if(e.rotation!=null){const x=o.viewpoint;o.viewpoint.rotation=e.rotation,o.viewpoint=x}const a={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:o,pixelRatio:n,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1},l=new ad(s,{colorTarget:Ah.TEXTURE,depthStencilTarget:Tl.DEPTH_STENCIL_RENDER_BUFFER,width:i,height:r}),c=s.getBoundFramebufferObject(),h=s.getViewport();s.bindFramebuffer(l),s.setViewport(0,0,i,r),this._renderChildren(e.children,a);const p=this._readbackScreenshot(l,{...e.cropArea,y:r-(e.cropArea.y+e.cropArea.height)});s.bindFramebuffer(c),s.setViewport(h.x,h.y,h.width,h.height),this.requestRender();const y=await p;let v;return e.outputScale===1?v=y:(v=new ImageData(Math.round(y.width*e.outputScale),Math.round(y.height*e.outputScale)),kli(y,v,!0)),v}async _readbackScreenshot(e,i){const r=Ali(i.width,i.height,document.createElement("canvas"));return await e.readPixelsAsync(i.x,i.y,i.width,i.height,gn.RGBA,ds.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_resizeCanvas(e){const i=this._canvas,r=i.style,{state:{size:n},pixelRatio:s}=e,o=n[0],a=n[1],l=Math.round(o*s),c=Math.round(a*s);i.width===l&&i.height===c||(i.width=l,i.height=c),r.width=o+"px",r.height=a+"px"}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const i of e)i.processDetach()}}_isLabelDrawPhaseRequired(e){let i=!1;for(const r of e){if(!(r instanceof CU)){i=i||!1;break}if(r.hasLabels)return!0;i=i||this._isLabelDrawPhaseRequired(r.children)}return i}};const ege=2,UE=1,zQ=0,HQ=1,WQ=2;let bir=class{constructor(e,i,r){this._debugMap=new Map,this._width=e*r,this._height=i*r,this._pixelRatio=r;const n=Math.ceil(this._width/UE),s=Math.ceil(this._height/UE);this._cols=n,this._rows=s,this._cells=QDe.create(n*s)}insertMetrics(e){const i=this._hasCollision(e);return i===zQ&&this._markMetrics(e),i}getCellId(e,i){return e+i*this._cols}has(e){return this._cells.has(e)}hasRange(e,i){return this._cells.hasRange(e,i)}set(e){this._cells.set(e)}setRange(e,i){this._cells.setRange(e,i)}_collide(e,i,r,n){const s=e-r/2,o=i-n/2,a=s+r,l=o+n;if(a<0||l<0||s>this._width||o>this._height)return HQ;const c=eu(Math.floor(s/UE),0,this._cols),h=eu(Math.floor(o/UE),0,this._rows),p=eu(Math.ceil(a/UE),0,this._cols),y=eu(Math.ceil(l/UE),0,this._rows);for(let v=h;v<=y;v++)for(let x=c;x<=p;x++){const I=this.getCellId(x,v);if(this.has(I))return WQ}return zQ}_mark(e,i,r,n,s){const o=e-r/2,a=i-n/2,l=o+r,c=a+n,h=eu(Math.floor(o/UE),0,this._cols),p=eu(Math.floor(a/UE),0,this._rows),y=eu(Math.ceil(l/UE),0,this._cols),v=eu(Math.ceil(c/UE),0,this._rows);for(let x=p;x<=v;x++)for(let I=h;I<=y;I++){const P=this.getCellId(I,x);this._debugMap.set(P,s),this.set(P)}return!1}_hasCollision(e){const i=e.id;let r=0,n=0;e.save();do{const s=e.boundsCount;r+=s;for(let o=0;o=r?o:s+n*(o-s)}function Tir(t,e){const i=t/e.minDataValue,r=AS(e.minSize,t),n=AS(e.maxSize,t);let s=null;return s=i*r,eu(s,r,n)}function Eir(t,e){const[i,r,n]=Air(t,e.cache.ipData);if(i===r)return AS(e.stops[i].size,t);{const s=AS(e.stops[i].size,t);return s+(AS(e.stops[r].size,t)-s)*n}}function Iir(t,e){const i=XW[e.valueUnit],r=AS(e.minSize,t),n=AS(e.maxSize,t),{valueRepresentation:s}=e;let o=null;return o=s==="area"?2*Math.sqrt(t/wir)/i:s==="radius"||s==="distance"?2*t/i:t/i,eu(o,r,n)}function Air(t,e){if(!e)return;let i=0,r=e.length-1;return e.some((n,s)=>ti.push(r)),i.sort((r,n)=>r.instanceId-n.instanceId),i.forEach(r=>{ve(r.labelMetrics)&&r.isReady&&e(r,r.labelMetrics.getCursor())})}function Pir(t){return t.layer&&(t.layer.type==="feature"||t.layer.type==="csv"||t.layer.type==="geojson"||t.layer.type==="ogc-feature"||t.layer.type==="stream"||t.layer.type==="subtype-group"||t.layer.type==="wfs")}function Oir(t){return e=>vn(WIt(e,t))}function Rir(t){const e=t!=null&&"visualVariables"in t&&t.visualVariables;if(!e)return null;for(const i of e)if(i.type==="size")return Oir(i);return null}function Mir(t){for(const e of t){const i="featureReduction"in e&&e.featureReduction&&"labelingInfo"in e.featureReduction?e.featureReduction:void 0,r=[...e.labelingInfo||[],...i?.labelingInfo||[]];if(!(!e.labelsVisible||!r.length)&&r.some(n=>n.deconflictionStrategy==="none"))return!0}return!1}function Dir(t,e){if(!Pir(e))return;const i=e.layer.type==="subtype-group"?e.layer.sublayers.items:[e.layer],r=e.layer.geometryType,n=!Mir(i),s={};if(e.layer.type!=="subtype-group"){if(e.tileRenderer?.type==="heatmap")return;const l=Rir(e.layer.renderer);s[0]=l}const o=e.tileRenderer;if(lt(o))return;const a=e.layer.visible&&!e.suspended;t.push({tileRenderer:o,vvEvaluators:s,deconflictionEnabled:n,geometryType:r,visible:a})}let Fir=class{run(e,i,r){const n=[];for(let s=e.length-1;s>=0;s--)Dir(n,e[s]);this._transformMetrics(n),this._runCollision(n,i,r)}_runCollision(e,i,r){const[n,s]=i.state.size,o=new bir(n,s,i.pixelRatio);for(const{tileRenderer:a,deconflictionEnabled:l,visible:c}of e){const h=a.featuresView.attributeView;l?c?(this._prepare(a),this._collideVisible(o,a,r),this._collideInvisible(o,a)):OU(a,(p,y)=>{for(;y.nextId();)h.setLabelMinZoom(y.id,tge)}):OU(a,(p,y)=>{for(;y.nextId();)h.setLabelMinZoom(y.id,qQ),c&&o.insertMetrics(y)})}}_isFiltered(e,i,r){const n=i.getFilterFlags(e),s=!r.hasFilter||!!(n&cvt),o=lt(r.featureEffect)||r.featureEffect.excludedLabelsVisible||!!(n&rNi);return!(s&&o)}_prepare(e){const i=e.featuresView.attributeView,r=new Set;OU(e,(n,s)=>{for(;s.nextId();)if(!r.has(s.id)){if(r.add(s.id),this._isFiltered(s.id,i,e.layerView)){i.setLabelMinZoom(s.id,oNe);continue}i.getLabelMinZoom(s.id)!==qQ?i.setLabelMinZoom(s.id,tge):i.setLabelMinZoom(s.id,qQ)}})}_collideVisible(e,i,r){const n=i.featuresView.attributeView,s=new Set;OU(i,(o,a)=>{for(;a.nextId();)if(!s.has(a.id))if(o.key.level===r){if(n.getLabelMinZoom(a.id)===0)switch(e.insertMetrics(a)){case HQ:break;case WQ:n.setLabelMinZoom(a.id,oNe),s.add(a.id);break;case zQ:n.setLabelMinZoom(a.id,qQ),s.add(a.id)}}else n.setLabelMinZoom(a.id,oNe)})}_collideInvisible(e,i){const r=i.featuresView.attributeView,n=new Set;OU(i,(s,o)=>{for(;o.nextId();)if(!n.has(o.id)&&r.getLabelMinZoom(o.id)===tge)switch(e.insertMetrics(o)){case HQ:break;case WQ:r.setLabelMinZoom(o.id,tge),n.add(o.id);break;case zQ:r.setLabelMinZoom(o.id,qQ),n.add(o.id)}})}_transformMetrics(e){for(const{tileRenderer:i,geometryType:r,vvEvaluators:n}of e)OU(i,(s,o)=>{const a=i.featuresView.attributeView,l=s.transforms.labelMat2d;l[4]=Math.round(l[4]),l[5]=Math.round(l[5]);const c=r==="polyline";for(;o.next();){const h=o.boundsCount,p=o.anchorX,y=o.anchorY;let v=o.size;const x=n[0];if(ve(x)){const F=x(a.getVVSize(o.id));v=isNaN(F)||F==null||F===1/0?v:F}const I=o.directionX*(v/2),P=o.directionY*(v/2);for(let F=0;F updateRequested: ${this.updateRequested}`),this.updateRequested}update(e){this._applyVisibilityPassThrottled(e)}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view?.requestUpdate())}processUpdate(e){this._set("updateParameters",e),this.updateRequested&&(this.updateRequested=!1,this.update(e))}_applyVisibilityPass(e){const i=this.view;if(i)try{const r=i.featuresTilingScheme.getClosestInfoForScale(e.state.scale).level;this.collisionEngine.run(i.allLayerViews.items,e,r)}catch{}}};E([N()],M6.prototype,"updateRequested",void 0),E([N({readOnly:!0})],M6.prototype,"updateParameters",void 0),E([N()],M6.prototype,"updating",null),E([N()],M6.prototype,"view",void 0),M6=E([dt("esri.views.2d.layers.labels.LabelManager")],M6);const Nir=M6;function kir(t){return qIt(t,!0)}function $ir(t){return qIt(t,!1)}function qIt(t,e){if(lt(t))return null;const i=t.spatialReference,r=vd(i),n="toJSON"in t?t.toJSON():t;if(!r)return n;const s=Xb(i)?102100:4326,o=fB[s].maxX,a=fB[s].minX;if(qy(n))return YIt(n,o,a);if(lg(n))return n.points=n.points.map(l=>YIt(l,o,a)),n;if(mc(n))return Bir(n,r);if(Xa(n)||Hu(n)){const l=RC(jir,n),c={xmin:l[0],ymin:l[1],xmax:l[2],ymax:l[3]},h=dw(c.xmin,a)*(2*o),p=h===0?n:vCe(n,h);return c.xmin+=h,c.xmax+=h,c.xmax>o?KIt(p,o,e):c.xminr.extent);return i.length<2?i[0]||t:i.length>2?(t.xmin=e.valid[0],t.xmax=e.valid[1],t):{rings:i.map(r=>[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]])}}function YIt(t,e,i){if(Array.isArray(t)){const r=t[0];if(r>e){const n=dw(r,e);t[0]=r+n*(-2*e)}else if(re){const n=dw(r,e);t.x+=n*(-2*e)}else if(r0;if(a>2*c){const I={xmin:sy||x?i.push(new D6({xmin:h,ymin:r,xmax:c,ymax:n},[p]),new D6({xmin:l,ymin:r,xmax:y,ymax:n},[v])):i.push(new D6({xmin:h,ymin:r,xmax:y,ymax:n},[p]));return i}function XIt(t,e){const[i,r]=e.valid,n=2*r;let s,o=0;return t>r?(s=Math.ceil(Math.abs(t-r)/n),t-=s*n,o=s):t=t.xmin&&e<=t.xmax&&i>=t.ymin&&i<=t.ymax}function KIt(t,e,i=!0){const r=!Hu(t);if(r&&vUe(t),i)return new Gir().cut(t,e);const n=r?t.rings:t.paths,s=r?4:2,o=n.length,a=-2*e;for(let l=0;l=s){const h=[];for(const p of c)h.push([p[0]+a,p[1]]);n.push(h)}}return r?t.rings=n:t.paths=n,t}let D6=class{constructor(e,i){this.extent=e,this.frameIds=i}};const jir=Mo();let Gir=class{constructor(){this._linesIn=[],this._linesOut=[]}cut(e,i){let r;if(this._xCut=i,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 i=this._side(e[0]);if(i*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],i)}else this._lineTo(e[0],e[1],i);this._prevSide=i,this._prevPt=e}close(){const e=this._firstPt,i=this._prevPt;e[0]===i[0]&&e[1]===i[1]||this.lineTo(e),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(e,i,r){this._closed?(this._lineIn.push([r<=0?e:this._xCut,i]),this._lineOut.push([r>=0?e:this._xCut,i])):(r<=0&&this._lineIn.push([e,i]),r>=0&&this._lineOut.push([e,i]))}_lineTo(e,i,r){this._closed?(this._addPolyVertex(this._lineIn,r<=0?e:this._xCut,i),this._addPolyVertex(this._lineOut,r>=0?e:this._xCut,i)):r<0?(this._prevSide===0&&this._pushLineOut(),this._lineIn.push([e,i])):r>0?(this._prevSide===0&&this._pushLineIn(),this._lineOut.push([e,i])):this._prevSide<0?(this._lineIn.push([e,i]),this._lineOut.push([e,i])):this._prevSide>0&&(this._lineOut.push([e,i]),this._lineIn.push([e,i]))}_addPolyVertex(e,i,r){const n=e.length;n>1&&e[n-1][0]===i&&e[n-2][0]===i?e[n-1][1]=r:e.push([i,r])}_checkClosingPt(e){const i=e.length;i>3&&e[0][0]===this._xCut&&e[i-2][0]===this._xCut&&e[1][0]===this._xCut&&(e[0][1]=e[i-2][1],e.pop())}_side(e){return ethis._xCut?1:0}_intersect(e,i){const r=(this._xCut-e[0])/(i[0]-e[0]);return e[1]+r*(i[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 rh=-1;let JIt=class{constructor(){this._dirties=[{vertexFrom:rh,vertexCount:rh,indexFrom:rh,indexCount:rh,allDirty:!1},{vertexFrom:rh,vertexCount:rh,indexFrom:rh,indexCount:rh,allDirty:!1},{vertexFrom:rh,vertexCount:rh,indexFrom:rh,indexCount:rh,allDirty:!1},{vertexFrom:rh,vertexCount:rh,indexFrom:rh,indexCount:rh,allDirty:!1},{vertexFrom:rh,vertexCount:rh,indexFrom:rh,indexCount:rh,allDirty:!1}]}hasDirty(){return this._dirties.some(e=>e.indexCount!==rh||e.allDirty)}markAllClean(){for(const e of this._dirties)e.indexFrom=rh,e.indexCount=rh,e.vertexFrom=rh,e.vertexCount=rh,e.allDirty=!1}markAllDirty(){for(const e of this._dirties)e.allDirty=!0}forEach(e){for(let i=0;i0)&&(l.geometry={count:s,from:o,allDirty:a},h=!0),(a||n!==rh&&r>0)&&(c={count:r,from:n,allDirty:a},h=!0),h&&e({indices:c,vertices:l},i)}}markDirtyIndices(e,i,r){const n=this._dirties[e],s=i,o=r;if(!n.allDirty)if(n.indexCount!==rh){const a=Math.min(n.indexFrom,s),l=Math.max(n.indexFrom+n.indexCount,s+o)-a;n.indexFrom=a,n.indexCount=l}else n.indexFrom=s,n.indexCount=o}markDirtyVertices(e,i,r,n){const s=this._dirties[e],o=r,a=n;if(!s.allDirty)if(s.vertexCount!==rh){const l=Math.min(s.vertexFrom,o),c=Math.max(s.vertexFrom+s.vertexCount,o+a)-l;s.vertexFrom=l,s.vertexCount=c}else s.vertexFrom=o,s.vertexCount=a}},Uir=class{get largestRange(){return this._largestRange}constructor(e){this._largestRange=null,this._parent=e,this._updateLargestRange()}rangeCreated(e){(!this._largestRange||e.count>this._largestRange.count)&&(this._largestRange=e)}rangeResized(e,i){e===this._largestRange?e.countthis._largestRange.count)&&(this._largestRange=e)}findBestRange(e){let i=this._parent._freeHead,r=null;for(;i!==null;)i.count>=e&&(!r||i.count-e=a&&e+i<=l?(r=!1,n=!0):o!==null?(s=o,o=o.next):r=!1}return[s,o]}_updateLargestRange(){let e=null,i=this._parent._freeHead;for(;i!==null;)(!e||i.count>e.count)&&(e=i),i=i.next;this._largestRange=e}},nge=class pH{constructor(e,i){this._allocated=0,this._size=e,this._freeHead=e>0?{from:0,count:e,prev:null,next:null}:null,this._bookKeeper=i||new Uir(this),this._freeHead&&this._bookKeeper.rangeCreated(this._freeHead)}allocate(e){const i=this._bookKeeper.findBestRange(e);if(i==null)return-1;const r=i.from,n=i.count;if(i.from+=e,i.count-=e,this._bookKeeper.rangeResized(i,r,n),this._allocated+=e,i.count===0){const s=i.prev!==null?this._freeHead:i.next;pH._removeRange(i),this._freeHead=s}return r}free(e,i){const[r,n]=this._bookKeeper.findAdjacentRanges(e,i),s={from:e,count:i,prev:r??null,next:n??null};if(r!=null&&(r.next=s),n!=null&&(n.prev=s),this._bookKeeper.rangeCreated(s),this._allocated-=i,n!=null&&s.from+s.count===n.from){const o=s.from,a=s.count;pH._fuse(s,n),pH._removeRange(n),this._bookKeeper.rangeResized(s,o,a),this._bookKeeper.rangeResized(n,void 0,0)}if(r!=null&&r.from+r.count===s.from){const o=r.from,a=r.count;pH._fuse(r,s),pH._removeRange(s),this._bookKeeper.rangeResized(r,o,a),this._bookKeeper.rangeResized(s,void 0,0)}this._freeHead=s.prev!==null?this._freeHead:s}get fragmentation(){const e=this._size-this._allocated;return e===0?0:1-this._bookKeeper.largestRange.count/e}static _removeRange(e){e.prev!==null?e.next!==null?(e.prev.next=e.next,e.next.prev=e.prev):e.prev.next=null:e.next!==null&&(e.next.prev=null)}static _fuse(e,i){e.count+=i.count,e.next=i.next,i.from+=i.count,i.count=0,i.next!==null&&(i.next.prev=e)}};const YQ=["FILL","LINE","MARKER","TEXT","LABEL"];function zir(t){const e=t.getStrides(),i={};for(let r=0;re.vertexCount?(this._freeVertices(o,e.vertexFrom,e.vertexCount),l=i.vertexCount,a=this._allocateVertices(o,l)):i.vertexCount===e.vertexCount?(a=e.vertexFrom,l=e.vertexCount):(this._freeVertices(o,e.vertexFrom+i.vertexCount,e.vertexCount-i.vertexCount),a=e.vertexFrom,l=i.vertexCount);let c,h,p,y=!0;if(e.indexFrom===void 0?(c=s,p=i.indexCount,h=this._allocateIndices(o,p)):i.indexCount>e.indexCount?(c=this._displayList.removeFromList(e),this._freeIndices(o,e.indexFrom,e.indexCount),p=i.indexCount,h=this._allocateIndices(o,p)):i.indexCount===e.indexCount?(y=!1,h=e.indexFrom,p=e.indexCount):(c=this._displayList.removeFromList(e),this._freeIndices(o,e.indexFrom+i.indexCount,e.indexCount-i.indexCount),h=e.indexFrom,p=i.indexCount),a!==-1&&h!==-1){const v=this._storageFor(o);if(AFe(a,h,v.vertexBuffers,v.indexBuffer,i,r,n),e.vertexFrom=a,e.indexFrom=h,e.vertexCount=i.vertexCount,e.indexCount=i.indexCount,this._dirtyMap){this._dirtyMap.markDirtyIndices(e.geometryType,e.indexFrom,e.indexCount);for(const x in r)this._dirtyMap.markDirtyVertices(e.geometryType,x,e.vertexFrom,e.vertexCount)}return y&&this._displayList.addToList(e,c),!0}return a!==-1&&this._freeVertices(o,a,l),h!==-1&&this._freeIndices(o,h,p),e.setMeshDataFromBuffers(i,r,n),e.vertexFrom=void 0,e.vertexCount=0,e.indexFrom=void 0,e.indexCount=0,!1}tryAddMeshData(e,i){const r=i.vertexBuffer,n=i.indexBuffer,s=YQ[e.geometryType],o=this._allocateVertices(s,e.vertexCount);if(o===-1)return this._freeVertices(s,o,e.vertexCount),!1;const a=this._allocateIndices(s,e.indexCount);if(a===-1)return this._freeVertices(s,o,e.vertexCount),this._freeIndices(s,a,e.indexCount),!1;const l=this._storageFor(s);if(AFe(o,a,l.vertexBuffers,l.indexBuffer,e,r,n),e.vertexFrom=o,e.indexFrom=a,this._dirtyMap){this._dirtyMap.markDirtyIndices(e.geometryType,e.indexFrom,e.indexCount);for(const c in r)this._dirtyMap.markDirtyVertices(e.geometryType,c,o,e.vertexCount)}return this._displayList.addToList(e),!0}_allocateVertices(e,i){const r=this._storageFor(e),n=r.vtxFreeList?.allocate(i);if(n==null||n===-1)return-1;const s=r.vtxFreeList?.fragmentation;return s==null||s>ZIt?-1:n}_freeVertices(e,i,r){this._storageFor(e).vtxFreeList?.free(i,r)}_freeIndices(e,i,r){this._storageFor(e).idxFreeList?.free(i,r)}_allocateIndices(e,i){const r=this._storageFor(e),n=r.idxFreeList?.allocate(i);if(n==null||n===-1)return-1;const s=r.idxFreeList?.fragmentation;return s==null||s>ZIt?-1:n}_storageFor(e){return this._freeListsAndStorage[e]}_stridesFor(e,i){return this._strides[e][i]}},Hir=class{constructor(e){this.geometryMap=GNi(()=>({indexBuffer:aa.createIndex(e,Xo.STATIC_DRAW),vao:null}),(i,r)=>({vertexBuffer:aa.createVertex(e,jNi[r])}))}dispose(){for(let e=0;e<5;e++){const i=this.geometryMap[e];if(i){i.data.vao&&i.data.vao.dispose(!1),i.data.indexBuffer&&i.data.indexBuffer.dispose();for(const r in i.buffers)i.buffers[r]&&i.buffers[r].data.vertexBuffer.dispose()}}}get(e){const i=this.geometryMap[e];return{getVAO(r,n,s){if(!i.data.vao){const o={};for(const a in i.buffers)o[a]=i.buffers[a].data.vertexBuffer;i.data.vao=new Mc(r,s,n,o,i.data.indexBuffer)}return i.data.vao}}}has(e){return this.geometryMap[e]!=null}upload(e,i){i.forEach((r,n)=>{this._upload(r,n,e)})}_upload(e,i,r){if(e.indices&&(e.indices.allDirty?this._uploadIndices(r,i):e.indices.from!=null&&e.indices.count!=null&&this._uploadIndices(r,i,e.indices.from,e.indices.count)),e.vertices){const n=e.vertices;for(const s in n){const o=n[s];o.allDirty?this._uploadVertices(r,i,s):o.from!=null&&o.count!=null&&this._uploadVertices(r,i,s,o.from,o.count)}}}_uploadVertices(e,i,r,n,s){const o=this.geometryMap[i];if(!o)return;const a=e.geometries[i].vertexBuffer[r];if(!a)return;const{data:l,stride:c}=a;if(o.buffers[r]&&l.length>0){const h=c/l.BYTES_PER_ELEMENT;n!=null&&s!=null?o.buffers[r].data.vertexBuffer.setSubData(l,n*h,n*h,(n+s)*h):o.buffers[r].data.vertexBuffer.setData(l)}}_uploadIndices(e,i,r,n){const s=this.geometryMap[i];if(!s)return;const o=e.geometries[i].indexBuffer;s.data.indexBuffer&&o.length>0&&(r!=null&&n!=null?s.data.indexBuffer.setSubData(o,r,r,r+n):s.data.indexBuffer.setData(o))}},RU=class extends CS{constructor(e,i,r,n,s,o,a=s,l=o){super(),this.triangleCountReportedInDebug=0,this.triangleCount=0,this.texture=null,this.key=new Eh(e),this.resolution=i,this.x=r,this.y=n,this.width=s,this.height=o,this.rangeX=a,this.rangeY=l}destroy(){this.texture&&(this.texture.dispose(),this.texture=null)}setTransform(e){const i=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*i,a=this.height/this.rangeY*i;wN(r,o,0,0,0,a,0,n,s,1),cv(this.transforms.dvs,e.displayViewMat3,r)}},Wir=class{acquire(e){return{refCount:1,version:-1,labelMat2d:g_(),tileMat3:Dl(),dvs:Dl()}}release(e){}},aNe=class NBe extends RU{constructor(e,i,r,n){super(e,i,r,n,Pc,Pc)}destroy(){super.destroy(),this._transforms&&NBe.TransformCache.release(this.key.hash)}setTransform(e){const i=this.resolution/e.resolution,r=this.transforms.tileMat3,[n,s]=e.toScreenNoRotation([0,0],[this.x,this.y]),o=this.width/this.rangeX*i,a=this.height/this.rangeY*i;wN(r,o,0,0,0,a,0,n,s,1),cv(this.transforms.dvs,e.displayViewMat3,r);const l=this.transforms.labelMat2d,c=window.devicePixelRatio,h=Dtt(g_(),o*c,0,0,a*c,n*c,s*c);QB(l,e.viewMat2d,h)}_createTransforms(){return NBe.TransformCache.acquire(this.key.hash)}};aNe.TransformCache=new Wir;let qir=class extends aNe{constructor(){super(...arguments),this._data=null,this._displayList=null,this._lastCommitTime=0,this._hasData=!1,this._invalidated=!1,this._wglBuffers=null,this._dirtyMap=new JIt}destroy(){super.destroy(),this.clear()}get hasData(){return!!this._hasData}get displayObjects(){return this._displayObjects??[]}getGeometry(e){return this._wglBuffers&&this._wglBuffers.has(e)?this._wglBuffers.get(e):null}getDisplayList(){return this._displayList}patch(e){if(e.clear===!0)return this.clear(),void(this._hasData=!1);const i=e.addOrUpdate,r=e.remove;!this._data&&i&&i.tileDisplayData?.displayObjects.length?(i.tileDisplayData.computeDisplayList(),this._dirtyMap=new JIt,this._dispRecStore=QIt.fromTileData(i,this._dirtyMap),this._data=i,this._dirtyMap.markAllDirty(),this._hasData=!0,e.end&&this.ready()):this._data&&(i&&i.tileDisplayData?.displayObjects.length||r.length)?this._doPatchData(e):e.end&&this.ready(),e.end&&!this._data&&this.clear(),this.requestRender(),this.emit("change")}commit(e){e.time&&e.time===this._lastCommitTime||(this._lastCommitTime=e.time,this.visible&&this._data&&(this._wglBuffers||(this._wglBuffers=new Hir(e.context)),(this._dirtyMap.hasDirty()||this._invalidated)&&(this._invalidated=!1,this._wglBuffers.upload(this._data.tileBufferData,this._dirtyMap),this._displayList=this._data.tileDisplayData.displayList.clone(),this._displayObjects=this._data.tileDisplayData.displayObjects.slice(),this._dirtyMap.markAllClean())))}clear(){this._data=null,this._displayList=null,this._dispRecStore=null,this._wglBuffers&&(this._wglBuffers.dispose(),this._wglBuffers=null)}_doPatchData(e){this._invalidated=!0,this._patchData(e)||(this._dirtyMap.markAllDirty(),this._data.reshuffle(),this._dispRecStore=QIt.fromTileData(this._data,this._dirtyMap)),this.requestRender()}_patchData(e){let i=!0;const r=e.addOrUpdate&&e.addOrUpdate.tileDisplayData&&e.addOrUpdate.tileDisplayData.displayObjects||[],n=(e.remove||[]).slice();for(const a of r)a.insertAfter!=null&&n.push(a.id);let s;n.length>0&&(s=new Set(n));const o=this._data.tileDisplayData;for(const a of n){const l=o.displayObjectRegistry.get(a);if(l){o.displayList.removeFromList(l.displayRecords);for(const c of l.displayRecords)this._dispRecStore.delete(c);o.displayObjectRegistry.delete(a)}}s?.size&&(o.displayObjects=o.displayObjects.filter(a=>!s.has(a.id)));for(const a of r){let l,c=o.displayObjectRegistry.get(a.id);if(c){const p=c.displayRecords;c.set(a),c.displayRecords=p;const y=c.displayRecords.length;for(let v=0;v=a.displayRecords.length||x.geometryType!==I.geometryType||x.symbolLevel!==I.symbolLevel||x.zOrder!==I.zOrder||x.materialKey!==I.materialKey)&&(this._dispRecStore.delete(c.displayRecords[v]),v=0){const v=o.displayObjectRegistry.get(c.insertAfter);v?(p=y.indexOf(v)+1,p0?1:0;let x=0;for(let I=p-1;I>=0&&x=0&&xo.indexFrom&&n<=o.indexFrom+o.indexCount){if(n=0&&ol.indexFrom&&e.indexFromi.clone()),e.line=this.line&&this.line.map(i=>i.clone()),e.marker=this.marker&&this.marker.map(i=>i.clone()),e.text=this.text&&this.text.map(i=>i.clone()),e.label=this.label&&this.label.map(i=>i.clone()),e.unified=this.unified&&this.unified.map(i=>i.clone()),e}},Xir=class eNt{constructor(){this.geometryDPInfo=new tAt}clone(){const e=new eNt;return e.zLevel=this.zLevel,e.geometryDPInfo=this.geometryDPInfo.clone(),e}},Kir=class tNt{constructor(){this.zLevels=[]}clone(){const e=new tNt;e.symbolLevel=this.symbolLevel;for(const i of this.zLevels)e.zLevels.push(i.clone());return e}},iAt=class{constructor(){this.vertexData=new Map,this.vertexCount=0,this.indexData=[]}clear(){this.vertexData.clear(),this.vertexCount=0,this.indexData=[]}update(e,i,r){for(const n in e)this.vertexData.set(n,e[n]);for(const n in this.vertexData)e[n]===null&&this.vertexData.delete(n);this.vertexCount=i,this.indexData=r}},hNe=class $Be{constructor(e,i,r,n=0,s=0){this.id=e,this.geometryType=i,this.materialKey=r,this.minZoom=n,this.maxZoom=s,this.meshData=null,this.symbolLevel=0,this.zOrder=0,this.vertexFrom=0,this.vertexCount=0,this.indexFrom=0,this.indexCount=0,this._sortKey=null}get sortKey(){return this._sortKey==null&&this._computeSortKey(),this._sortKey}clone(){return this.copy()}copy(){const e=new $Be(this.id,this.geometryType,this.materialKey);return e.vertexFrom=this.vertexFrom,e.vertexCount=this.vertexCount,e.indexFrom=this.indexFrom,e.indexCount=this.indexCount,e.zOrder=this.zOrder,e.symbolLevel=this.symbolLevel,e.meshData=this.meshData,e.minZoom=this.minZoom,e.maxZoom=this.maxZoom,e}setMeshDataFromBuffers(e,i,r){const n=new iAt;for(const s in i){const o=i[s].stride,a=i[s].data;if(!a)continue;const l=[],c=kJ(o);for(let h=0;hi.clone()),e.insertAfter=this.insertAfter,e}set(e){this.id=e.id,this.displayRecords=e.displayRecords,this.insertAfter=e.insertAfter}serialize(e){return e.push(this.id),rAt(e,this.displayRecords),e}static deserialize(e){const i=e.readInt32(),r=new h_e(i),n={id:i};return r.displayRecords=Jir(e,hNe,n)??[],r}},sAt=class BBe{constructor(){this.displayObjects=[],this._displayList=null}get displayObjectRegistry(){if(!this._displayObjectRegistry){this._displayObjectRegistry=new Map;for(const e of this.displayObjects)this._displayObjectRegistry.set(e.id,e)}return this._displayObjectRegistry}get displayList(){return this._displayList}computeDisplayList(){this._displayList=new Yir;for(const e of this.displayObjects)for(const i of e.displayRecords)this._displayList.addToList(i)}clone(){const e=new BBe;return this.displayObjects&&(e.displayObjects=this.displayObjects.map(i=>i.clone())),e}serialize(e){return rAt(e,this.displayObjects),e}_deserializeObjects(e){const i=e.readInt32(),r=new Array(i),n=new Map;for(let s=0;s=this._packedRecords.length?0:this._packedRecords[e]}getCursor(){return this.copy()}copy(){const e=new Cm(this._packedRecords);return e._indexStart=this._indexStart,e._link=this._link,e._index=this._index,e._offsets=this._offsets,e._deletedCount=this._deletedCount,e}};F6.ELEMENTS_PER_RECORD=FJ,F6.BYTES_PER_RECORD=F6.ELEMENTS_PER_RECORD*Int32Array.BYTES_PER_ELEMENT;let dNe=class jBe{constructor(e,i){this.data=e,this.stride=i}static decode(e){const i=Kpe(e.data,e.stride),r=e.stride;return new jBe(i,r)}static fromVertexVector(e){const i=Kpe(e.data.buffer(),e.stride),r=e.stride;return new jBe(i,r)}},oAt=class d_e{constructor(e,i,r){this.geometryType=e,this.indexBuffer=new Uint32Array(i),this.namedBuffers=r}static decode(e){const i=e.geometryType,r=e.indexBuffer,n={};for(const s in e.namedBuffers)n[s]=dNe.decode(e.namedBuffers[s]);return new d_e(i,r,n)}static fromVertexData(e,i){const r=e.indices,n=Kpe(e.vertices,e.stride),s=e.stride,o={geometry:new dNe(n,s)};return new d_e(i,r,o)}static fromVertexVectors(e){const i=e.geometryType,r=e.indexVector.buffer(),n={};for(const s in e.namedVectors)n[s]=dNe.fromVertexVector(e.namedVectors[s]);return new d_e(i,r,n)}};const Zir=1.25;let RF=class{get length(){return this._pos}constructor(e,i){this._pos=0;const r=i?this._roundToNearest(i,e.BYTES_PER_ELEMENT):40;this._array=new ArrayBuffer(r),this._buffer=new e(this._array),this._ctor=e,this._i16View=new Int16Array(this._array)}_roundToNearest(e,i){const r=Math.round(e);return r+(i-r%i)}_ensureSize(e){if(this._pos+e>=this._buffer.length){const i=this._roundToNearest((this._array.byteLength+e*this._buffer.BYTES_PER_ELEMENT)*Zir,this._buffer.BYTES_PER_ELEMENT),r=new ArrayBuffer(i),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 i=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=e,this._pos++,i}push(e){this._ensureSize(1);const i=this._pos;return this._buffer[this._pos++]=e,i}writeFixed(e){this._buffer[this._pos++]=e}setValue(e,i){this._buffer[e]=i}i1616Add(e,i,r){this._i16View[2*e]+=i,this._i16View[2*e+1]+=r}getValue(e){return this._buffer[e]}incr(e){if(this._buffer.length{const o=e.data[s];if(ve(o)){const a=MU.from(o.records).getCursor();for(;a.next();){const l=a.id,c=a.materialKey,h=a.indexFrom,p=a.indexCount,y=a.vertexFrom,v=a.vertexCount,x=n.get(l),I=new hNe(l,s,c);I.indexFrom=h,I.indexCount=p,I.vertexFrom=y,I.vertexCount=v,x.displayRecords.push(I)}r[s]=oAt.fromVertexData(o,s)}else r[s]=new err(s,0,sa.DEFAULT).intoBuffers()}),nL.fromMeshData({displayObjects:i,vertexBuffersMap:r})}static fromMeshData(e){const i=new nL,r=new sAt,n=new uNe;r.displayObjects=e.displayObjects;for(const s in e.vertexBuffersMap){const o=e.vertexBuffersMap[s];n.geometries[s].indexBuffer=o.indexBuffer,n.geometries[s].vertexBuffer=o.namedBuffers}return i.tileDisplayData=r,i.tileBufferData=n,i}static bind(e,i){const r=new nL;return r.tileDisplayData=e,r.tileBufferData=i,r}static create(e,i){const r=new nL;r.tileDisplayData=new sAt,r.tileDisplayData.displayObjects=e;const n=[0,0,0,0,0],s=[0,0,0,0,0],o=[[],[],[],[],[]];for(const c of e)for(const h of c.displayRecords)o[h.geometryType].push(h),n[h.geometryType]+=h.meshData.vertexCount,s[h.geometryType]+=h.meshData.indexData.length;const a=new uNe,l=rrr(i);for(let c=0;c=s?(n.col=o-s,n.world+=1):n.col=o,n.row=a,n}const lge=1,pNe=2,uge=4,fNe=8,mNe=16,cge=32,gNe=64,hge=128;function cAt(t){switch(t){case lge:case fNe:case cge:return-1;case pNe:case gNe:return 0;case uge:case mNe:case hge:return 1}}function hAt(t){switch(t){case lge:case pNe:case uge:return-1;case fNe:case mNe:return 0;case cge:case gNe:case hge:return 1}}const dAt=lge|fNe|cge,pAt=uge|mNe|hge,fAt=lge|pNe|uge,mAt=cge|gNe|hge;let gAt=class{constructor(e,i,r,n,s,o=0){this._hasAggregate=!1,this.hasRecords=!1,this._data={self:new Map,neighbors:new Array},this._version=0,this._current={geometryType:0,writer:null,overlaps:0,start:0,insertAfter:0,sortKey:0,id:0,materialKey:0,indexStart:0,vertStart:0,isDotDensity:!1,bufferingEnabled:!1,metricBoxLenPointer:0},this.hint=i,this.tileKey=e,this._hasAggregate=n,this._pixelBufferEnabled=s,this._version=o,this._symbologyType=r}get hasAggregates(){return this._hasAggregate}get hasPixelBufferEnabled(){return this._pixelBufferEnabled}serialize(e){const i=[];return i.push(this._serializeTileVertexData(this.tileKey,this.tileKey,this._data.self)),this._data.neighbors.forEach((r,n)=>{const s=1<=Pc-r?dAt:pAt|dAt)|(i<0+n?mAt:i>=Pc-n?fAt:mAt|fAt));this._current.overlaps|=s}_getVertexWriter(e){if(!this._data.self.has(e)){const i=this._data.self,r=Xpe(e,this._symbologyType).geometry;i.set(e,new uAt(e,r,this.hint.records))}return this._data.self.get(e)}};const zE=0,HE=100;function yAt(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function vAt(t,e){return Math.sqrt(t*t+e*e)}function _At(t){const e=vAt(t[0],t[1]);t[0]/=e,t[1]/=e}function orr(t,e){return vAt(t[0]-e[0],t[1]-e[1])}function ql(t){return typeof t=="function"}function yNe(t=2){return 1/Math.max(t,1)}function MF(t,e){return[!!t?.minScale&&e.scaleToZoom(t.minScale)||zE,!!t?.maxScale&&e.scaleToZoom(t.maxScale)||HE]}function arr(t,e){return t[e+1]}function bAt(t){return t.length-1}function lrr(t){let e=0;for(let i=0;ie._index||this._index===e._index&&this._distance>=e._distance}get _segment(){return this._segments[this._index+1]}get angle(){const e=this.dy,i=(0*e+-1*-this.dx)/(1*this.length);let r=Math.acos(i);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:i}=this;return Math.sqrt(e*e+i*i)}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,i?this:null}seek(e,i=!1){if(e<0)return this._seekBackwards(Math.abs(e),i);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,i);r+=this.length}return this._distance=1,i?this:null}};function hrr(t,e,i,r=!0){const n=lrr(t),s=crr.create(t),o=n/2;if(!r)return s.seek(o),void i(s.clone(),0,o+0*e,n);const a=Math.max((n-e)/2,0),l=Math.floor(a/e),c=o-l*e;s.seek(c);for(let h=-l;h<=l;h++)s.x<512&&s.x>=0&&s.y<512&&s.y>=0&&i(s.clone(),h,o+h*e,n),s.seek(e)}function drr(t,e){const i=e;for(let r=0;r=0&&!(n[I+1]n[p]+h);I++){const P=h-n[I-1]+n[p],F=n[I]-n[I-1],k=n[I]-n[p]class extends t{constructor(...e){super(...e),this._isCIM=!1,this._vertexBoundsScale=1,this.geometryType=Ln.TEXT,this._aux=qp(0,0,this._referenceSize,this._bitset)}bindTextInfo(e,i){e&&e.length?this._shapingInfo=Pa(e,r=>e5e(r,i,{scale:this._scale,angle:this._angle,xOffset:this._xOffset,yOffset:this._yOffset,hAlign:this._xAlignD,vAlign:this._yAlignD,maxLineWidth:Math.max(32,Math.min(this._lineWidth,512)),lineHeight:hFe*Math.max(.25,Math.min(this._lineHeight,4)),decoration:this._decoration,isCIM:this._isCIM,hasBackground:!!this._backgroundColor,borderLineSize:this._borderLineSize})):this._shapingInfo=null}_write(e,i,r,n){const s=i.getDisplayId();this._writeGeometry(e,i,s,r,n)}_writeGeometry(e,i,r,n,s){const o=this._shapingInfo;if(lt(o))return;if(ve(this._textPlacement)){const l=s??i.readLegacyGeometryForDisplay();return this._writePlacedText(e,r,l,o,n)}const a=s?MTe(Y5(s),2):i.geometryType==="esriGeometryPolygon"?i.readCentroid():i.readGeometryForDisplay();if(!lt(a)){if(a.isPoint){const[l,c]=a.coords;return!e.hasAggregates&&e.hasPixelBufferEnabled&&(l<0||l>=512||c<0||c>=512)?void 0:this._writeGlyphs(e,r,{x:l,y:c},o)}a.forEachVertex((l,c)=>this._writeGlyphs(e,r,{x:l,y:c},o))}}_writePlacedText(e,i,r,n,s){const o=this._textPlacement,a=wAt.getPlacement(r,o,vn(1),e.tileKey,s.geometryEngine);if(!a)return;let l=a.next();for(;l!=null;){const c=-l.getAngle();n.setRotation(c);const h=l.tx,p=-l.ty;h<0||h>=512||p<0||p>=512||(this._writeGlyphs(e,i,{x:h,y:p},n),n.setRotation(-c)),l=a.next()}}_writeGlyphs(e,i,r,n){const s=Y_.load(this._materialKey),o=Xn(Math.round(LU*r.x),Math.round(LU*r.y)),a=this._vertexBoundsScale,{bounds:l,background:c,glyphs:h}=n;h.length>0&&(this._borderLineColor||this._backgroundColor)&&(s.textureBinding=h[0].textureBinding,e.recordStart(i,s.data,this.geometryType,!0),this._writeBackgroundGeometry(e,i,r,l,c),e.recordEnd());const p=2*Math.max(l.width,l.height);for(const y of n.glyphs)s.textureBinding=y.textureBinding,e.recordStart(i,s.data,this.geometryType,!0),e.vertexBounds(r.x+l.x+this._xOffset,r.y+l.y-this._yOffset,p*a,p*a),this._writeVertices(e,i,o,y),e.recordEnd()}_writeGlyph(e,i,r,n,s){const o=Y_.load(this._materialKey),a=Xn(Math.round(LU*r),Math.round(LU*n));o.textureBinding=s.textureBinding,e.recordStart(i,o.data,this.geometryType,!0);const l=s.bounds,c=this._vertexBoundsScale;e.vertexBounds(r+l.x*c,n+l.y*c,l.width*c,l.height*c),this._writeVertices(e,i,a,s),e.recordEnd()}_writeVertices(e,i,r,n){const s=e.vertexCount();this._writeVertexCommon(e,i,r,n),e.vertexWrite(n.offsets.upperLeft),e.vertexWrite(n.texcoords.upperLeft),e.vertexEnd(),this._writeVertexCommon(e,i,r,n),e.vertexWrite(n.offsets.upperRight),e.vertexWrite(n.texcoords.upperRight),e.vertexEnd(),this._writeVertexCommon(e,i,r,n),e.vertexWrite(n.offsets.lowerLeft),e.vertexWrite(n.texcoords.lowerLeft),e.vertexEnd(),this._writeVertexCommon(e,i,r,n),e.vertexWrite(n.offsets.lowerRight),e.vertexWrite(n.texcoords.lowerRight),e.vertexEnd(),e.indexWrite(s+0),e.indexWrite(s+1),e.indexWrite(s+2),e.indexWrite(s+1),e.indexWrite(s+3),e.indexWrite(s+2)}_writeVertexCommon(e,i,r,n){const s=this._color,o=this._haloColor,a=qp(0,0,this._referenceSize,this._bitset),l=qp(0,0,this._size,this._haloSize);e.vertexWrite(r),e.vertexWrite(i),e.vertexWrite(s),e.vertexWrite(o),e.vertexWrite(l),e.vertexWrite(a),e.vertexWrite(this._minMaxZoom)}_writeBackgroundVertex(e,i,r,n,s,o){const a=qp(0,1,this._referenceSize,this._bitset),l=qp(0,0,this._size,this._haloSize),c=qp(0,0,0,0);e.vertexWrite(r),e.vertexWrite(i),e.vertexWrite(n),e.vertexWrite(c),e.vertexWrite(l),e.vertexWrite(a),e.vertexWrite(this._minMaxZoom),e.vertexWrite(s),e.vertexWrite(o),e.vertexEnd()}_writeBackgroundQuad(e,i,r,n,s,o){const a=e.vertexCount();this._writeBackgroundVertex(e,i,r,n,s.upperLeft,o[0]),this._writeBackgroundVertex(e,i,r,n,s.upperRight,o[1]),this._writeBackgroundVertex(e,i,r,n,s.lowerLeft,o[2]),this._writeBackgroundVertex(e,i,r,n,s.lowerRight,o[3]),e.indexWrite(a+0),e.indexWrite(a+1),e.indexWrite(a+2),e.indexWrite(a+1),e.indexWrite(a+3),e.indexWrite(a+2)}_writeBackgroundGeometry(e,i,r,n,s){const o=Xn(Math.round(LU*r.x),Math.round(LU*r.y)),{x:a,y:l,width:c,height:h}=n,p=2*Math.max(c,h);if(e.vertexBounds(r.x+a+this._xOffset,r.y+l-this._yOffset,p*this._vertexBoundsScale,p*this._vertexBoundsScale),this._backgroundColor){const y=[fx,fx,fx,fx];this._writeBackgroundQuad(e,i,o,this._backgroundColor,s.main,y)}if(this._borderLineColor||this._backgroundColor){const y=!!this._borderLineColor&&!!this._borderLineSize&&this._borderLineSize>0,[v,x,I,P,F]=y?[xAt,xAt,SAt,SAt,this._borderLineColor]:[frr,mrr,grr,yrr,this._backgroundColor];this._writeBackgroundQuad(e,i,o,F,s.top,v),this._writeBackgroundQuad(e,i,o,F,s.bot,x),this._writeBackgroundQuad(e,i,o,F,s.left,I),this._writeBackgroundQuad(e,i,o,F,s.right,P)}}};let XQ=class{constructor(){this._materialKey=null}bindFeature(e,i,r){}write(e,i,r,n){if(lt(this._effects)||this._effects?.length===0)return this._write(e,i,n);const s=xQ.executeEffects(this._effects,i.readLegacyGeometryForDisplay(),e.tileKey,n.geometryEngine);let o=xQ.next(s);for(;o;)this._write(e,i,n,o),o=xQ.next(s)}_write(e,i,r,n){}};const vrr=5;let vNe=class UBe extends CAt(XQ){constructor(e,i,r,n,s,o,a,l,c,h,p,y,v,x,I,P,F,k,j,V,Y,X,Z,ie){super(),this._xOffset=vn(v),this._yOffset=vn(x),this._decoration=h||"none",this._backgroundColor=X,this._borderLineColor=Z,this._borderLineSize=ie,this._color=s,this._haloColor=o,this._haloSize=Math.min(Math.floor(vrr*vn(Ga(r))),127),this._size=Math.min(Math.round(vn(i)),127);const ce=Math.min(Math.round(vn(n||i)),127);this._referenceSize=Math.round(Math.sqrt(256*ce)),this._scale=this._size/Bpe,this._angle=y,this._justify=VYi(a||"center"),this._xAlignD=oCt(a||"center"),this._yAlignD=aCt(l||"baseline"),this._baseline=(l||"baseline")==="baseline",this._bitset=(c===py.MAP?1:0)|(p?1:0)<<1;const he=Y_.load(e);he.sdf=!0,this._materialKey=he.data,this._lineWidth=vn(I)||512,this._lineHeight=P||1,this._textPlacement=F,this._effects=k,this._isCIM=j??!1,this._minMaxZoom=Xn(Math.round(V*dy),Math.round(Y*dy))}static fromText(e,i){const r=e.font?.size,n=new UBe(e.materialKey,r,e.haloSize||0,r,e.color&&gb(e.color)||0,e.haloColor&&gb(e.haloColor)||0,e.horizontalAlignment,e.verticalAlignment,py.SCREEN,e.font?.decoration,!1,e.angle||0,e.xoffset||0,e.yoffset||0,e.lineWidth||0,e.lineHeight||0,null,null,!1,zE,HE,e.backgroundColor&&gb(e.backgroundColor),e.borderLineColor&&gb(e.borderLineColor),e.borderLineSize),[,s]=_F(e.text);return n.bindTextInfo(i??[],s),n._vertexBoundsScale=e.maxVVSize&&r?e.maxVVSize/r:1,n}static fromCIMText(e,i,r){const n=e.scaleFactor||1,s=e.size*e.sizeRatio*n,[o,a]=MF(e.scaleInfo,r),l=new UBe(e.materialKey,s,e.outlineSize*e.sizeRatio,e.referenceSize,Yp(e.color),Yp(e.outlineColor),e.horizontalAlignment,e.verticalAlignment,e.alignment,e.decoration,e.colorLocked??!1,e.angle,e.offsetX*e.sizeRatio*n,e.offsetY*e.sizeRatio*n,512,1,e.markerPlacement,e.effects,!0,o,a,e.backgroundColor?Yp(e.backgroundColor):void 0,e.borderLineColor?Yp(e.borderLineColor):void 0,e.borderLineWidth),[,c]=_F(e.text);return l.bindTextInfo(i,c),l._vertexBoundsScale=e.maxVVSize?e.maxVVSize/s:1,l}};const TAt=Oi.getLogger("esri.views.2d.engine.webgl.WGLLabelTemplate"),_rr=(t,e="mapview-labeling")=>TAt.error(new st(e,t)),pge=1,NU=0,brr=4,_Ne=25;function wrr(t,e){const i=!!t.minScale&&e.scaleToZoom(t.minScale)||0;return eu(i,0,25.5)}function xrr(t,e){const i=!!t.maxScale&&e.scaleToZoom(t.maxScale)||255;return eu(i,0,25.5)}function Srr(t){const e=new Map;return i=>(e.has(i)||e.set(i,t(i)),e.get(i))}const Crr=Srr(t=>{let e=0;if(t===0)return 1/0;for(;!(t%2);)e++,t/=2;return e}),fge=t=>Math.floor(127*t+127),L6=t=>Math.floor(10*t),DF=t=>Math.round(t*(254/360));let EAt=class iNt extends vNe{constructor(e,i,r,n){super(e,r.font?.size,r.haloSize||0,r.font?.size,r.color&&gb(r.color)||0,r.haloColor&&gb(r.haloColor)||0,r.horizontalAlignment,r.verticalAlignment,lCt(i.labelPlacement)?py.MAP:py.SCREEN,r.font?.decoration,!1,r.angle||0,r.xoffset,r.yoffset,r.lineWidth,r.lineHeight,null,null,!1,null,null,r.backgroundColor&&gb(r.backgroundColor),r.borderLineColor&&gb(r.borderLineColor),r.borderLineSize),this._outLineLabelAngle=0,this._refPlacementPadding=0,this._refPlacementDirX=0,this._refPlacementDirY=0,this._refOffsetX=0,this._refOffsetY=0,this._zoomLevel=0,this.geometryType=Ln.LABEL,this._allowOverrun=i.allowOverrun??!1,this._repeatLabel=i.repeatLabel??!0,this._labelPosition=i.labelPosition??"curved";const s=wrr(i,n),o=xrr(i,n),a=i.labelPlacement,[l,c]=kYi(a);this._xAlignD=l,this._yAlignD=c,this._minZoom=s,this._maxZoom=o,this._minBackgroundZoom=s,this._maxBackgroundZoom=o,this._refPlacementPadding=vn(r.haloSize)+J5i,this._repeatLabelDistance=i.repeatLabelDistance?vn(i.repeatLabelDistance):128;const h=AF.load(e);h.sdf=!0,this._materialKey=h.data}static fromLabelClass(e,i){if(e.labelPlacement==="esriServerLinePlacementCenterAlong"){const r=e.symbol;r.xoffset=0,r.yoffset=0,r.angle=0,r.font.decoration="none"}return new iNt(e.materialKey,e,e.symbol,i)}get _shapedBox(){return this._shapingInfo.bounds}setZoomLevel(e){this._zoomLevel=e}bindReferenceTemplate(e){let i=$Yi(this._xAlignD),r=BYi(this._yAlignD);if(this._refOffsetX=0,this._refOffsetY=0,lt(e))return void(this._refSymbolAndPlacementOffset=qp(0,0,fge(i),fge(r)));if(e.boundsType==="circle"&&(i||r)){const o=Math.sqrt(i*i+r*r);i/=o,r/=o}const n=Math.max(e.height,e.width),s=this._refPlacementPadding*brr;this._refSymbolAndPlacementOffset=qp(s,n,fge(i),fge(r)),this._referenceSize=n,this._refPlacementDirX=i,this._refPlacementDirY=r,this._refOffsetX=e.xOffset,this._refOffsetY=e.yOffset}_write(e,i){if(lt(this._shapingInfo))return;const r=this._shapingInfo,n=i.getDisplayId(),s=i.geometryType==="esriGeometryPolygon"?i.readLegacyCentroid():i.readLegacyGeometry();if(s)switch(this._current={out:e,inId:n,inShaping:r,zoomLevel:this._zoomLevel},i.geometryType==="esriGeometryPolyline"&&this._labelPosition==="curved"&&(this._borderLineColor||this._backgroundColor)&&TAt.warnOnce("TextSymbol properties 'borderLineColor', 'borderLineSize', and 'backgroundColor' are not supported in curved labels"),i.geometryType){case"esriGeometryPolyline":this._placeLineLabels(s);break;case"esriGeometryPoint":case"esriGeometryPolygon":this._placePointLabels(s);break;default:_rr(`Geometry of type ${i.geometryType} is not supported`)}}_isVisible(e,i){const r=L6(this._current.zoomLevel);return L6(e)<=r&&r<=L6(i)}_placePointLabels(e){const{out:i,inId:r,inShaping:n}=this._current;this._writeGlyphs(i,r,e,n)}_placeLineLabels(e){const i=drr(e.paths,this._current.inShaping.bounds.width),r=this._placeSubdivGlyphs.bind(this),n=(this._shapedBox.width+this._repeatLabelDistance)/(1<0&&(this._borderLineColor||this._backgroundColor);if(this._maxBackgroundZoom=_Ne,this._minBackgroundZoom=Math.max(i,0),c){const h=AF.load(this._materialKey);h.textureBinding=s.glyphs[0].textureBinding;const p=qY(g_(),-e.angle),[y,v]=s.shapeBackground(p);this._outLineLabelAngle=DF(a),r.recordStart(n,h.data,this.geometryType,!0),this._writeBackgroundGeometry(r,n,e,y,v),r.recordEnd(),this._outLineLabelAngle=DF(l),r.recordStart(n,h.data,this.geometryType,!0),this._writeBackgroundGeometry(r,n,e,y,v),r.recordEnd()}this._outLineLabelAngle=DF(a),this._placeFirst(o,i,1,!0),this._outLineLabelAngle=DF(l),this._placeFirst(o,i,0,!0),r.metricEnd()}_placeBack(e,i,r,n,s){const o=e.clone();let a=e.backwardLength+NU;for(;o.prev()&&!(a>=n);)this._placeOnSegment(o,i,a,r,-1,s),a+=o.length+NU}_placeForward(e,i,r,n,s){const o=e.clone();let a=e.remainingLength+NU;for(;o.next()&&!(a>=n);)this._placeOnSegment(o,i,a,r,1,s),a+=o.length+NU}_placeFirst(e,i,r,n=!1){const s=e,o=this._current.inShaping,a=o.glyphs,l=this._current.zoomLevel,{out:c,inId:h}=this._current;for(const p of a){const y=p.x>o.bounds.x?r:1-r,v=y*e.remainingLength+(1-y)*e.backwardLength,x=Math.abs(p.x+p.width/2-o.bounds.x),I=Math.max(0,l+Math.log2(x/(v+NU))),P=Math.max(i,n?0:I);if(p.maxZoom=_Ne,p.angle=e.angle+(1-r)*Math.PI,p.minZoom=P,this._writeGlyph(c,h,s.x,s.y,p),r&&this._isVisible(p.minZoom,p.maxZoom)){const F=p.bounds;c.metricBoxWrite(F.center[0],F.center[1],F.width,F.height)}}}_placeOnSegment(e,i,r,n,s,o){const a=this._current.inShaping.glyphs,{out:l,inId:c}=this._current,h=this._current.inShaping,p=this._current.zoomLevel,y=e.dx/e.length,v=e.dy/e.length,x={x:e.x+r*-s*y,y:e.y+r*-s*v};for(const I of a){const P=I.x>h.bounds.x?o:1-o;if(!(P&&s===1||!P&&s===-1))continue;const F=Math.abs(I.x+I.width/2-h.bounds.x),k=Math.max(0,p+Math.log2(F/r)-.1),j=Math.max(n,p+Math.log2(F/(r+e.length+NU)));if(k!==0&&(I.angle=e.angle+(1-o)*Math.PI,I.minZoom=j,I.maxZoom=k,this._writeGlyph(l,c,x.x,x.y,I),o&&this._isVisible(I.minZoom,I.maxZoom))){const V=I.bounds,Y=e.x-i.x,X=e.y-i.y;l.metricBoxWrite(V.center[0]+Y,V.center[1]+X,V.width,V.height)}}}_writeGlyphs(e,i,r,n,s=this._minZoom){if(r.x<0||r.x>=512||r.y<0||r.y>=512)return;if(n.glyphs.length>0&&(this._borderLineColor||this._backgroundColor)){const p=AF.load(this._materialKey);p.textureBinding=n.glyphs[0].textureBinding,e.recordStart(i,p.data,this.geometryType,!0),this._writeBackgroundGeometry(e,i,r,n.bounds,n.background),e.recordEnd()}const o=r.x+this._refOffsetX,a=r.y-this._refOffsetY;for(const p of n.glyphs)p.minZoom=s,p.maxZoom=this._maxZoom,this._writeGlyph(e,i,o,a,p);const l=this._refPlacementDirX,c=this._refPlacementDirY,h=n.boundsT;e.metricStart(i,s,o,a,l,c,this._referenceSize,this._materialKey),e.metricBoxWrite(h.center[0],h.center[1],h.width,h.height),e.metricEnd()}_writeVertexCommon(e,i,r,n){const s=this._color,o=this._haloColor,a=qp(0,0,this._size,this._haloSize),l=Math.max(n.minZoom,this._minZoom),c=Math.min(n.maxZoom,this._maxZoom),h=qp(L6(l),L6(c),this._outLineLabelAngle,0);e.vertexWrite(r),e.vertexWrite(i),e.vertexWrite(s),e.vertexWrite(o),e.vertexWrite(a),e.vertexWrite(this._refSymbolAndPlacementOffset),e.vertexWrite(h)}_writeBackgroundVertex(e,i,r,n,s,o){const a=qp(0,0,this._size,this._haloSize),l=qp(0,0,0,0),c=qp(L6(this._minBackgroundZoom),L6(this._maxBackgroundZoom),this._outLineLabelAngle,1);e.vertexWrite(r),e.vertexWrite(i),e.vertexWrite(n),e.vertexWrite(l),e.vertexWrite(a),e.vertexWrite(this._refSymbolAndPlacementOffset),e.vertexWrite(c),e.vertexWrite(s),e.vertexWrite(o),e.vertexEnd()}};const IAt=3.14159265359/180,AAt=8,PAt=t=>class extends t{constructor(...e){super(...e),this.angle=0,this.xOffset=0,this.yOffset=0,this.width=0,this.height=0,this.boundsType="square",this._anchorX=0,this._anchorY=0,this._computedWidth=0,this._computedHeight=0,this._allowBorrowing=!0,this._vertexBoundsScaleX=1,this._vertexBoundsScaleY=1,this._offsets={xUpperLeft:0,yUpperLeft:0,xUpperRight:0,yUpperRight:0,xBottomLeft:0,yBottomLeft:0,xBottomRight:0,yBottomRight:0},this.geometryType=Ln.MARKER}_write(e,i,r,n){const s=i.getDisplayId();e.recordStart(s,this._materialKey,this.geometryType,!0),this._writeGeometry(e,i,s,r,n),e.recordEnd()}_writeGeometry(e,i,r,n,s){if(ve(this._markerPlacement))return this._writePlacedMarkers(e,i,n,s);if(this._allowBorrowing=!0,!s&&i.geometryType==="esriGeometryPoint"){const a=i.getX(),l=i.getY();return!e.hasAggregates&&e.hasPixelBufferEnabled&&(a<0||a>=513||l<0||l>=513)?void 0:this._writeVertices(e,r,this._getPos(a,l),a,l)}const o=s?MTe(Y5(s),2):i.geometryType==="esriGeometryPolygon"?i.readCentroid():i.readGeometryForDisplay();if(!lt(o)){if(o.isPoint){const[a,l]=o.coords;return!e.hasAggregates&&e.hasPixelBufferEnabled&&(a<0||a>=512||l<0||l>=512)?void 0:this._writeVertices(e,r,this._getPos(a,l),a,l)}o.forEachVertex((a,l)=>{const c=2*Pc;a<-c||a>=c||l<-c||l>=c||this._writeVertices(e,r,this._getPos(a,l),a,l)})}}_writePlacedMarkers(e,i,r,n){const s=n??i.readLegacyGeometryForDisplay(),o=wAt.getPlacement(s,this._markerPlacement,vn(1),e.tileKey,r.geometryEngine);if(!o)return;this._allowBorrowing=i.geometryType!=="esriGeometryPolygon";const a=i.getDisplayId(),l=xT(),c=g_(),h=-128,p=640;let y=o.next();for(;y!=null;){const v=y.tx,x=-y.ty;v>=h&&v<=p&&x>=h&&x<=p&&(this._applyTransformation(c,l,-y.getAngle()/IAt),this._writeVertices(e,a,this._getPos(v,x),v,x)),y=o.next()}}_writeVertices(e,i,r,n,s){const o=IF.load(this._materialKey);return o.symbologyType===sa.HEATMAP?this._writeHeatmapVertices(e,i,r):this._writeMarkerVertices(e,i,o,r,n,s)}_writeMarkerVertices(e,i,r,n,s,o){const a=r.vvRotation,l=e.vertexCount();let c=this._computedWidth*this._vertexBoundsScaleX,h=this._computedHeight*this._vertexBoundsScaleY;if(this.angle){const p=Math.max(c,h);c=p,h=p}if(a){const p=Math.max(this.xOffset,this.yOffset);c+=p,h+=p}this._allowBorrowing&&e.vertexBounds(s+this.xOffset,o-this.yOffset,c,h),e.vertexWrite(n),e.vertexWrite(this._offsetUpperLeft),e.vertexWrite(this._texUpperLeft),e.vertexWrite(this._bitestAndDistRatio),e.vertexWrite(i),e.vertexWrite(this._fillColor),e.vertexWrite(this._outlineColor),e.vertexWrite(this._sizeOutlineWidth),e.vertexWrite(this._minMaxZoom),e.vertexEnd(),e.vertexWrite(n),e.vertexWrite(this._offsetUpperRight),e.vertexWrite(this._texUpperRight),e.vertexWrite(this._bitestAndDistRatio),e.vertexWrite(i),e.vertexWrite(this._fillColor),e.vertexWrite(this._outlineColor),e.vertexWrite(this._sizeOutlineWidth),e.vertexWrite(this._minMaxZoom),e.vertexEnd(),e.vertexWrite(n),e.vertexWrite(this._offsetBottomLeft),e.vertexWrite(this._texBottomLeft),e.vertexWrite(this._bitestAndDistRatio),e.vertexWrite(i),e.vertexWrite(this._fillColor),e.vertexWrite(this._outlineColor),e.vertexWrite(this._sizeOutlineWidth),e.vertexWrite(this._minMaxZoom),e.vertexEnd(),e.vertexWrite(n),e.vertexWrite(this._offsetBottomRight),e.vertexWrite(this._texBottomRight),e.vertexWrite(this._bitestAndDistRatio),e.vertexWrite(i),e.vertexWrite(this._fillColor),e.vertexWrite(this._outlineColor),e.vertexWrite(this._sizeOutlineWidth),e.vertexWrite(this._minMaxZoom),e.vertexEnd(),this._writeIndices(e,l)}_writeHeatmapVertices(e,i,r){const n=e.vertexCount();e.vertexWrite(r),e.vertexWrite(this._offsetUpperLeft),e.vertexWrite(i),e.vertexEnd(),e.vertexWrite(r),e.vertexWrite(this._offsetUpperRight),e.vertexWrite(i),e.vertexEnd(),e.vertexWrite(r),e.vertexWrite(this._offsetBottomLeft),e.vertexWrite(i),e.vertexEnd(),e.vertexWrite(r),e.vertexWrite(this._offsetBottomRight),e.vertexWrite(i),e.vertexEnd(),this._writeIndices(e,n)}_writeIndices(e,i){e.indexWrite(i+0),e.indexWrite(i+1),e.indexWrite(i+2),e.indexWrite(i+1),e.indexWrite(i+3),e.indexWrite(i+2)}_applyTransformation(e,i,r=0){Ple(e,mp(this.xOffset,-this.yOffset)),this.angle!=null&&this.angle+r!==0&&gN(e,e,IAt*(this.angle+r));const n=this._computedWidth,s=this._computedHeight,o=-(.5+this._anchorX)*n,a=-(.5-this._anchorY)*s;ga(i,o,a),m0(i,i,e),this._offsetUpperLeft=Xn(16*i[0],16*i[1]),this._offsets.xUpperLeft=i[0],this._offsets.yUpperLeft=i[1],ga(i,o+n,a),m0(i,i,e),this._offsetUpperRight=Xn(16*i[0],16*i[1]),this._offsets.xUpperRight=i[0],this._offsets.yUpperRight=i[1],ga(i,o,a+s),m0(i,i,e),this._offsetBottomLeft=Xn(16*i[0],16*i[1]),this._offsets.xBottomLeft=i[0],this._offsets.yBottomLeft=i[1],ga(i,o+n,a+s),m0(i,i,e),this._offsetBottomRight=Xn(16*i[0],16*i[1]),this._offsets.xBottomRight=i[0],this._offsets.yBottomRight=i[1]}_getPos(e,i){return Xn(Math.round(AAt*e),Math.round(AAt*i))}};let KQ=class yre extends PAt(XQ){constructor(e,i,r,n,s,o,a,l,c,h,p,y,v,x,I,P,F,k,j,V,Y,X,Z){super(),this.angle=n,this.height=a,this.width=o,this.xOffset=i*j,this.yOffset=r*j,this._markerPlacement=V,this._effects=Y,this._anchorX=P,this._anchorY=F,this._minMaxZoom=Xn(Math.round(X*dy),Math.round(Z*dy));const ie=(x===py.MAP?oNi:sNi)|(p?Wk:0)|(v?aNi:0)|(y?lNi:0),ce=I&&I.sdf,he=IF.load(e);he.sdf=ce,he.pattern=!0,he.textureBinding=I.textureBinding,this._materialKey=he.data,this._fillColor=s,this._outlineColor=c,this._sizeOutlineWidth=qp(Math.round(Math.min(Math.sqrt(128*o),255)),Math.round(Math.min(Math.sqrt(128*a),255)),Math.round(Math.min(Math.sqrt(128*h),255)),Math.round(Math.min(Math.sqrt(128*l),255)));const _e=I.rect.x+Oc,xe=I.rect.y+Oc,Pe=_e+I.width,ke=xe+I.height;this._offsets.xUpperLeft=_e,this._offsets.yUpperLeft=xe,this._offsets.xUpperRight=Pe,this._offsets.yUpperRight=xe,this._offsets.xBottomLeft=_e,this._offsets.yBottomLeft=ke,this._offsets.xBottomRight=Pe,this._offsets.yBottomRight=ke,he.symbologyType===sa.PIE_CHART?(this._texUpperLeft=Xn(0,1),this._texUpperRight=Xn(1,1),this._texBottomLeft=Xn(0,0),this._texBottomRight=Xn(1,0)):(this._texUpperLeft=Xn(_e,xe),this._texUpperRight=Xn(Pe,xe),this._texBottomLeft=Xn(_e,ke),this._texBottomRight=Xn(Pe,ke)),o*=k,a*=k,o*=j,a*=j;const J=Math.round(64*k);this._bitestAndDistRatio=Xn(ie,J),this._computedWidth=o,this._computedHeight=a;const de=xT(),Se=g_();this._applyTransformation(Se,de)}static fromCIMMarker(e,i,r){const n=i&&i.width||1,s=i&&i.height||1,o=e.size,a=n/s*e.scaleX,l=e.scaleSymbolsProportionally&&e.frameHeight?o/e.frameHeight:1,c=Yp(e.color),h=Yp(e.outlineColor),p=vn(o),y=p*a,v=vn(e.offsetX||0),x=vn(e.offsetY||0),I=vn(e.outlineWidth||0)*l,P=e.alignment||py.SCREEN,F=vn(e.referenceSize),[k,j]=MF(e.scaleInfo,r);let V=e.rotation||0;e.rotateClockwise||(V=-V);let Y=0,X=0;const Z=e.anchorPoint;Z&&(e.isAbsoluteAnchorPoint?o&&(Y=Z.x/(o*a),X=Z.y/o):(Y=Z.x,X=Z.y));const ie=new yre(e.materialKey,v,x,V,c,y,p,F,h,I,e.colorLocked,e.scaleSymbolsProportionally,!1,P,i,Y,X,e.sizeRatio,zu(e.scaleFactor,1),e.markerPlacement,e.effects,k,j);return ie._vertexBoundsScaleX=e.maxVVSize?e.maxVVSize/y:1,ie._vertexBoundsScaleY=e.maxVVSize?e.maxVVSize/p:1,ie}static fromPictureMarker(e,i){const r=Math.round(vn(e.width)),n=Math.round(vn(e.height)),s=rvt,o=Math.round(vn(e.xoffset||0)),a=Math.round(vn(e.yoffset||0)),l=new yre(e.materialKey,o,a,e.angle,s,r,n,n,0,0,!1,!1,!1,py.SCREEN,i,0,0,1,1,null,null,zE,HE);return l._vertexBoundsScaleX=e.maxVVSize?e.maxVVSize/e.width:1,l._vertexBoundsScaleY=e.maxVVSize?e.maxVVSize/e.height:1,l}static fromSimpleMarker(e,i){const r=gb(e.color),n=Math.round(vn(e.size)),s=n,o=Math.round(vn(e.xoffset||0)),a=Math.round(vn(e.yoffset||0)),l=e.style,c=e.outline,h=0|(c?.color&&gb(c.color)),p=0|(c?.width&&Math.round(vn(c.width))),y=new yre(e.materialKey,o,a,e.angle,r,n,s,s,h,p,!1,!1,l==="esriSMSCross"||l==="esriSMSX",py.SCREEN,i,0,0,126/64,1,null,null,zE,HE);return y.boundsType=l==="esriSMSCircle"?"circle":"square",y._vertexBoundsScaleX=e.maxVVSize?e.maxVVSize/e.size:1,y._vertexBoundsScaleY=e.maxVVSize?e.maxVVSize/e.size:1,y}static fromLineSymbolMarker(e,i){const r=gb(e.color),n=6,s=Math.round(vn(n*e.lineWidth)),o=s,a=e.style==="cross"||e.style==="x";let l;switch(e.placement){case"begin-end":l=$_.Both;break;case"begin":l=$_.JustBegin;break;case"end":l=$_.JustEnd;break;default:l=$_.None}const c={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:l,offsetAlongLine:0},h=new yre(e.materialKey,0,0,0,r,s,o,o/n,r,a?Math.round(vn(e.lineWidth)):0,!1,!1,a,py.MAP,i,0,0,126/64,1,c,null,zE,HE);return h.boundsType=e.style==="circle"?"circle":"square",h}};function Trr(t,e,i,r,n,s,o){xNe=0;const a=(r-i)*s,l=n&&n.length,c=l?(n[0]-i)*s:a;let h,p,y,v,x,I=OAt(e,i,r,0,c,s,!0);if(I&&I.next!==I.prev){if(l&&(I=Prr(e,i,r,n,I,s)),a>80*s){h=y=e[0+i*s],p=v=e[1+i*s];for(let P=s;P0)for(let l=r;l=r;l-=s)a=RAt(l+e*s,t[l+e*s],t[l+1+e*s],a);return a&&N6(a,a.next)&&(QQ(a),a=a.next),a}function JQ(t,e=t){if(!t)return t;let i,r=t;do if(i=!1,r.steiner||!N6(r,r.next)&&by(r.prev,r,r.next)!==0)r=r.next;else{if(QQ(r),r=e=r.prev,r===r.next)break;i=!0}while(i||r!==e);return e}function ZQ(t,e,i,r,n,s,o,a){if(!t)return;!a&&s&&(t=MAt(t,r,n,s));let l=t;for(;t.prev!==t.next;){const c=t.prev,h=t.next;if(s?Irr(t,r,n,s):Err(t))e.push(c.index/i+o),e.push(t.index/i+o),e.push(h.index/i+o),QQ(t),t=h.next,l=h.next;else if((t=h)===l){a?a===1?ZQ(t=Nrr(t,e,i,o),e,i,r,n,s,o,2):a===2&&krr(t,e,i,r,n,s,o):ZQ(JQ(t),e,i,r,n,s,o,1);break}}}function Err(t){const e=t.prev,i=t,r=t.next;if(by(e,i,r)>=0)return!1;let n=t.next.next;const s=n;let o=0;for(;n!==t.prev&&(o===0||n!==s);){if(o++,kU(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y)&&by(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function Irr(t,e,i,r){const n=t.prev,s=t,o=t.next;if(by(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,h=n.y>s.y?n.y>o.y?n.y:o.y:s.y>o.y?s.y:o.y,p=bNe(a,l,e,i,r),y=bNe(c,h,e,i,r);let v=t.prevZ,x=t.nextZ;for(;v&&v.z>=p&&x&&x.z<=y;){if(v!==t.prev&&v!==t.next&&kU(n.x,n.y,s.x,s.y,o.x,o.y,v.x,v.y)&&by(v.prev,v,v.next)>=0||(v=v.prevZ,x!==t.prev&&x!==t.next&&kU(n.x,n.y,s.x,s.y,o.x,o.y,x.x,x.y)&&by(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;v&&v.z>=p;){if(v!==t.prev&&v!==t.next&&kU(n.x,n.y,s.x,s.y,o.x,o.y,v.x,v.y)&&by(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x!==t.prev&&x!==t.next&&kU(n.x,n.y,s.x,s.y,o.x,o.y,x.x,x.y)&&by(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function RAt(t,e,i,r){const n=mge.create(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function QQ(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Arr(t){let e=t,i=t;do(e.x=i.next.y&&i.next.y!==i.y){const y=i.x+(n-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(y<=r&&y>o){if(o=y,y===r){if(n===i.y)return i;if(n===i.next.y)return i.next}s=i.x=i.x&&i.x>=l&&r!==i.x&&kU(ns.x)&&eee(i,t)&&(s=i,p=h)),i=i.next;return s}function MAt(t,e,i,r){let n;for(;n!==t;n=n.next){if(n=n||t,n.z===null&&(n.z=bNe(n.x,n.y,e,i,r)),n.prev.next!==n||n.next.prev!==n)return n.prev.next=n,n.next.prev=n,MAt(t,e,i,r);n.prevZ=n.prev,n.nextZ=n.next}return t.prevZ.nextZ=null,t.prevZ=null,Mrr(t)}function Mrr(t){let e,i=1;for(;;){let r,n=t;t=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:t=l,l.prevZ=e,e=l}n=r}if(e.nextZ=null,i*=2,s<2)return t}}function by(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function DAt(t,e,i,r){return!!(N6(t,e)&&N6(i,r)||N6(t,r)&&N6(i,e))||by(t,e,i)>0!=by(t,e,r)>0&&by(i,r,t)>0!=by(i,r,e)>0}function Drr(t,e){let i=t;do{if(i.index!==t.index&&i.next.index!==t.index&&i.index!==e.index&&i.next.index!==e.index&&DAt(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}function Frr(t,e,i,r,n,s){let o=0;for(let a=r,l=n-s;a=0&&(t-o)*(r-a)-(i-o)*(e-a)>=0&&(i-o)*(s-a)-(n-o)*(r-a)>=0}function eee(t,e){return by(t.prev,t,t.next)<0?by(t,e,t.next)>=0&&by(t,t.prev,e)>=0:by(t,e,t.prev)<0||by(t,t.next,e)<0}function bNe(t,e,i,r,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function N6(t,e){return t.x===e.x&&t.y===e.y}function Lrr(t,e){return t.x-e.x}function Nrr(t,e,i,r){let n=t;do{const s=n.prev,o=n.next.next;!N6(s,o)&&DAt(s,n,n.next,o)&&eee(s,o)&&eee(o,s)&&(e.push(s.index/i+r),e.push(n.index/i+r),e.push(o.index/i+r),QQ(n),QQ(n.next),n=t=o),n=n.next}while(n!==t);return n}function krr(t,e,i,r,n,s,o){let a=t;do{let l=a.next.next;for(;l!==a.prev;){if(a.index!==l.index&&$rr(a,l)){let c=FAt(a,l);return a=JQ(a,a.next),c=JQ(c,c.next),ZQ(a,e,i,r,n,s,o,0),void ZQ(c,e,i,r,n,s,o,0)}l=l.next}a=a.next}while(a!==t)}function $rr(t,e){return t.next.index!==e.index&&t.prev.index!==e.index&&!Drr(t,e)&&eee(t,e)&&eee(e,t)&&Brr(t,e)}function Brr(t,e){let i=t,r=!1;const n=(t.x+e.x)/2,s=(t.y+e.y)/2;do i.y>s!=i.next.y>s&&i.next.y!==i.y&&n<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next;while(i!==t);return r}function FAt(t,e){const i=mge.create(t.index,t.x,t.y),r=mge.create(e.index,e.x,e.y),n=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,s.next=r,r.prev=s,r}let mge=class rNt{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,i,r){const n=xNe0))break;p+=F,y.push(a+h),h+=P}const v=o.length;Trr(o,i,a,a+h,y,2,s);const x=Grr(o,i,v,o.length,s),I=Math.abs(p);if(Math.abs((x-I)/Math.max(1e-7,I))>jrr)return o.length=0,!1;l=c,a+=h}return!0}function zrr(t){const{coords:e,lengths:i}=t,{buffer:r}=ybt(e,i);return r}function Hrr(t,e,i){let r=0;for(let n=0;ni||li)return!0}r+=s}return!1}function Wrr(t,e){if(lt(t))return null;if(!Hrr(t,-128,Pc+128))return t;k6.setPixelMargin(e),k6.reset(gy.Polygon);let i=0;for(let o=0;on||pn){o=!0;continue}l.push({x:h,y:p})}let y=!1;const v=c.length;for(let x=1;xn||pn){y=!0;break}l.push({x:h,y:p})}if(y)o=!0;else{if(o){const x=i.resultWithStarts();if(x)for(const I of x)s.push(I)}else s.push({line:l,start:0});a++,o=!1}}return s=s.filter(l=>l.line.length>1),s.length===0?null:s}k6.setExtent(Pc),SNe.setExtent(Pc);const gge=8,Z_=16,NAt=65535,kAt=t=>class extends t{constructor(...e){super(...e),this.tessellationProperties={},this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0},this.geometryType=Ln.LINE}writeGeometry(e,i,r,n){this._writeGeometry(e,i,r,n)}_initializeTessellator(e){const i=wO.load(this._materialKey),r=ES.load(this._materialKey),n=this._tessellationOptions,s=i.vvSizeFieldStops||i.vvSizeMinMaxValue||i.vvSizeScaleStops||i.vvSizeUnitValue,o=this.tessellationProperties._halfWidth(r,n,s,o,a,l,c,h,p,y,v)=>{const x=Xn(v,Math.ceil(Z_*t._halfWidth)),I=qp(Math.round(Z_*c),Math.round(Z_*h),Math.round(Z_*p),Math.round(Z_*y)),P=qp(Z_*a,Z_*l,0,t._bitset),F=t.out;return F.vertexBounds(r,n,e,i),F.vertexWrite(Xn(gge*r,gge*n)),F.vertexWrite(t.id),F.vertexWrite(t._fillColor),F.vertexWrite(I),F.vertexWrite(x),F.vertexWrite(t._tl),F.vertexWrite(t._br),F.vertexWrite(P),F.vertexWrite(Xn(Math.ceil(Z_*t._halfReferenceWidth),0)),F.vertexWrite(t.minMaxZoom),F.vertexEnd(),t.offset+t.vertexCount++},Xrr=(t,e,i)=>(r,n,s,o,a,l,c,h,p,y,v)=>{const x=Xn(Z_*t._halfWidth,Z_*t._halfReferenceWidth),I=qp(Z_*c+128,Z_*h+128,Z_*p+128,Z_*y+128),P=t.out,F=t._bitset<<24|t.id;P.vertexBounds(r,n,e,i),P.vertexWrite(Xn(gge*r,gge*n)),P.vertexWrite(F),P.vertexWrite(t._fillColor);const k=UEt(t.key);return k||(P.vertexWrite(0),P.vertexWrite(0)),P.vertexWrite(0),P.vertexWrite(x),P.vertexWrite(I),k||P.vertexWrite(t.minMaxZoom),P.vertexEnd(),t.offset+t.vertexCount++},Krr=t=>(e,i,r)=>{const n=t.out;n.indexWrite(e),n.indexWrite(i),n.indexWrite(r),t.indexCount+=3};let CNe=class fH extends kAt(XQ){constructor(e,i,r,n,s,o,a,l,c,h,p,y,v,x,I,P,F,k,j,V){super();const Y=wO.load(e);i&&(Y.sdf=i.sdf,Y.pattern=!0,Y.textureBinding=i.textureBinding),this._capType=n,this._joinType=s,this._miterLimitCosine=yNe(o),this.tessellationProperties._fillColor=a,this.tessellationProperties._tl=l,this.tessellationProperties._br=c,this._hasPattern=h,this._isDashed=p,this._zOrder=F,this._effects=k,this._minMaxZoom=Xn(Math.round(j*dy),Math.round(V*dy)),this._materialKey=Y.data;const X=(v?Wk:0)|(x?uNi:0)|(y?mvt:0)|(I?Wpe:0);this.tessellationProperties._bitset=X,this.tessellationProperties._halfWidth=.5*r,this.tessellationProperties._halfReferenceWidth=.5*P,this.tessellationProperties.offset=0,this._initializeTessellator(!1)}static fromCIMLine(e,i,r){const n=e.color,s=e.scaleFactor||1,o=!!e.dashTemplate;let a=e.cap;o&&a===xf.ROUND&&(a=xf.SQUARE);const l=e.join,c=vn(e.width)*s,h=vn(e.referenceWidth),p=vn(e.miterLimit),y=n&&Yp(n)||0,[v,x]=MF(e.scaleInfo,r),I=!1;if(!i)return new fH(e.materialKey,i,c,a,l,p,y,0,0,!1,o,e.scaleDash??!1,e.colorLocked??!1,I,e.sampleAlphaOnly,h,e.zOrder,e.effects,v,x);const{rect:P,width:F,height:k}=i,j=P.x+Oc,V=P.y+Oc,Y=j+F,X=V+k,Z=Xn(j,V),ie=Xn(Y,X),ce=!1;return new fH(e.materialKey,i,c,a,l,p,y,Z,ie,!0,o,e.scaleDash??!1,e.colorLocked??!1,ce,e.sampleAlphaOnly,h,e.zOrder,e.effects,v,x)}static fromFillOutline(e){const i=ES.load(e.materialKey);return jme(i)&&e.outline&&e.outline?.style==="esriSLSSolid"?fH.fromSimpleLine({hash:"",materialKey:e.materialKey,...e.outline},null,!0):null}static fromSimpleLine(e,i,r=!1){const{color:n}=e,s=e.style!=="esriSLSSolid"&&e.style!=="esriSLSNull",o=$Ni(e.cap||"round"),a=BNi(e.join||"round");let l=n&&e.style!=="esriSLSNull"&&gb(n)||0;e.style==="esriSLSNull"&&(l=0);const c=vn(e.width),h=e.miterLimit;if(!i)return new fH(e.materialKey,i,c,o,a,h,l,0,0,!1,s,!0,!1,r,!1,c,0,null,zE,HE);const{rect:p,width:y,height:v}=i,x=p.x+Oc,I=p.y+Oc,P=x+y,F=I+v,k=Xn(x,I),j=Xn(P,F);return new fH(e.materialKey,i,c,o,a,h,l,k,j,!0,s,!0,!1,r,!1,c,0,null,zE,HE)}static fromPictureLineSymbol(e,i,r,n){return Oi.getLogger("esri.views.2d.engine.webgl.WGLLineTemplate").error("PictureLineSymbol support does not exist!"),null}};const Jrr=100,$At=1,BAt=t=>class extends t{constructor(...e){super(...e),this.forceLibtess=!1,this._bitset=0,this._lineTemplate=null,this.geometryType=Ln.FILL}_maybeAddLineTemplate(e){this._lineTemplate=CNe.fromFillOutline(e)}_write(e,i,r,n){const s=i.geometryType==="esriGeometryPoint",o=ES.load(this._materialKey);e.recordStart(i.getDisplayId(),this._materialKey,this.geometryType,s),this._writeGeometry(e,i,o,n,s),jme(o)&&ve(this._lineTemplate)&&this._lineTemplate.writeGeometry(e,i,n,s),e.recordEnd()}_writeGeometry(e,i,r,n,s){const o=this._getGeometry(i,n,s);if(lt(o))return;const a=[];if(!(o.maxLength>Jrr)&&!this.forceLibtess&&Urr(a,o))return void(a.length&&this._writeVertices(e,i,o.coords,o.lengths,r,a));const l=zrr(o);this._writeVertices(e,i,l,[l.length/2],r)}_writeVertex(e,i,r,n,s,o){const a=Xn($At*n,$At*s);if(e.vertexBounds(n,s,0,0),e.vertexWrite(a),e.vertexWrite(i),r.symbologyType===sa.DOT_DENSITY)e.vertexWriteF32(1/Math.abs(o.readGeometryArea()));else{e.vertexWrite(this.fillColor);const l=UEt(r);l||(e.vertexWrite(this.tl),e.vertexWrite(this.br)),e.vertexWrite(this.aux21),e.vertexWrite(this.aux22),e.vertexWrite(this.aux3),l||e.vertexWrite(this._minMaxZoom)}}_writeVertices(e,i,r,n,s,o){const a=i.getDisplayId(),l=this._bitset<<24|a,c=n.reduce((v,x)=>v+x),h=Xpe(s.geometryType,s.symbologyType).geometry/4,p=e.vertexCount();e.vertexEnsureSize(h*c);let y=0;if(o)for(const v of o){const x=r[2*v],I=r[2*v+1];this._writeVertex(e,l,s,x,I,i),y++}else for(let v=0;v0,a=i.readLegacyFeature(),l=i.getObjectId(),c=this._materialCache,h=this._cimLayer.materialHash;if(!h)return VAt.error("A Dynamic mesh template must have a material hash value or function!"),Promise.reject(null);const p=typeof h=="function"?h(a,r,n,l):h,y=c.get(p);if(y!=null)return Promise.resolve(y);const v=this._ongoingMaterialRequestMap.get(p);if(v)return v;const x=this._cimLayer,I=ZXi(x.cim,this._cimLayer.materialOverrides);I.mosaicHash=p;const{type:P,url:F}=x,k={cim:I,type:P,mosaicHash:p,url:F,size:null,dashTemplate:null,text:null,fontName:null,objectId:l,animatedSymbolProperties:null};switch(P){case"marker":k.size=gB(x.size,a,r,n),k.animatedSymbolProperties=gB(x.animatedSymbolProperties,a,r,n);break;case"line":k.dashTemplate=x.dashTemplate;break;case"text":k.text=gB(x.text,a,r,n),k.fontName=gB(x.fontName,a,r,n)}const j=e.getMosaicItem(k,s).then(V=>(o||(this._ongoingMaterialRequestMap.delete(p),c.set(p,V)),V)).catch(V=>(this._ongoingMaterialRequestMap.delete(p),VAt.error(".analyze()",V.message),null));return o||this._ongoingMaterialRequestMap.set(p,j),j}};const jAt=128;let Zrr=class nNt extends BAt(yge){constructor(e,i,r){if(super(e),this._minMaxZoom=Xn(Math.round(i*dy),Math.round(r*dy)),ql(e.color)){const h=(p,y,v)=>{const x=e.color(p,y,v);return x&&Yp(x)||0};this._dynamicPropertyMap.set("fillColor",h)}else{const h=e.color;this.fillColor=h&&Yp(h)||0}const n=e.cim.placement?.type==="CIMMarkerPlacementInsidePolygon"&&e.cim.placement.shiftOddRows?2:1,s=e.height;if(ql(s)){const h=(p,y,v)=>s(p,y,v)*n;this._dynamicPropertyMap.set("_height",h)}else this._height=(s||0)*n;const o=e.offsetX;if(ql(o)){const h=(p,y,v)=>vn(o(p,y,v));this._dynamicPropertyMap.set("_offsetX",h)}else this._offsetX=vn(o||0);const a=e.offsetY;if(ql(a)){const h=(p,y,v)=>vn(-a(p,y,v));this._dynamicPropertyMap.set("_offsetY",h)}else this._offsetY=vn(-a||0);const l=e.scaleX;ql(l)?this._dynamicPropertyMap.set("_scaleX",l):this._scaleX=l||1;const c=e.angle;if(ql(c)){const h=(p,y,v)=>$Q(c(p,y,v));this._dynamicPropertyMap.set("_angle",h)}else this._angle=$Q(c)||0;if(ve(e.effects)){const h=e.effects;ql(h)?this._dynamicPropertyMap.set("_effects",h):this._effects=h}this._cimFillLayer=e,this._bitset=(e.colorLocked?Wk:0)|(e.applyRandomOffset?gvt:0)|(e.sampleAlphaOnly?Wpe:0)|(e.hasUnresolvedReplacementColor?yvt:0),this._fillMaterialKey=e.materialKey}static fromCIMFill(e,i){const[r,n]=MF(e.scaleInfo,i);return new nNt(e,r,n)}bindFeature(e,i,r){const n=e.readLegacyFeature();this._dynamicPropertyMap.forEach((h,p)=>{this[p]=h(n,i,r)});const s=ES.load(this._fillMaterialKey),o=this._materialCache,a=(0,this._cimFillLayer.materialHash)(n,i,r),l=o.get(a);let c=null;if(l&&K_(l.spriteMosaicItem)&&(c=l.spriteMosaicItem),c){const{rect:h,width:p,height:y}=c,v=h.x+Oc,x=h.y+Oc,I=v+p,P=x+y;let F=Math.round(vn(this._height));F<=0&&(F=P-x);let k=Math.round(vn(this._height/y*p||0));k<=0&&(k=I-v);const j=this._scaleX,V=1;this.tl=Xn(v,x),this.br=Xn(I,P),this.aux21=Xn(k,F),this.aux22=Xn(this._offsetX,this._offsetY),this.aux3=qp(j*jAt,V*jAt,this._angle,0),s.sdf=c.sdf,s.pattern=!0,s.textureBinding=c.textureBinding}else this.tl=0,this.br=0,this.aux21=0,this.aux22=0,this.aux3=0,s.sdf=!1,s.pattern=!1,s.textureBinding=0;this._materialKey=s.data}},Qrr=class sNt extends kAt(yge){constructor(e,i,r){super(e),this._minMaxZoom=Xn(Math.round(i*dy),Math.round(r*dy)),this._cimLineLayer=e;let n=0;ql(e.width)||(n=.5*vn(e.width));const s=(p,y,v)=>ql(e.width)?.5*vn(e.width(p,y,v)):n;this._dynamicPropertyMap.set("_halfWidth",s),ql(e.cap)?this._dynamicPropertyMap.set("_capType",e.cap):this._capType=e.cap,ql(e.join)?this._dynamicPropertyMap.set("_joinType",e.join):this._joinType=e.join;const o=e.color;if(ql(o)){const p=(y,v,x)=>Yp(o(y,v,x));this._dynamicPropertyMap.set("_fillColor",p)}else this._fillColor=o&&Yp(o)||0;const a=e.miterLimit;if(ql(a)){const p=(y,v,x)=>yNe(a(y,v,x));this._dynamicPropertyMap.set("_miterLimitCosine",p)}else this._miterLimitCosine=yNe(a);if(ve(e.effects)){const p=e.effects;ql(p)?this._dynamicPropertyMap.set("_effects",p):this._effects=p}this._scaleFactor=e.scaleFactor||1,this._isDashed=e.dashTemplate!=null;const l=e.colorLocked?Wk:0,c=e.scaleDash?mvt:0,h=e.sampleAlphaOnly?Wpe:0;this.tessellationProperties._bitset=l|c|h,this._materialKey=e.materialKey,this._initializeTessellator(!0)}static fromCIMLine(e,i){const[r,n]=MF(e.scaleInfo,i);return new sNt(e,r,n)}bindFeature(e,i,r){const n=e.readLegacyFeature();this._dynamicPropertyMap.forEach((h,p)=>{this[p]=h(n,i,r)}),this._halfWidth*=this._scaleFactor;const s=this._materialCache,o=(0,this._cimLineLayer.materialHash)(n,i,r),a=s.get(o);let l=null;if(a&&K_(a.spriteMosaicItem)&&(l=a.spriteMosaicItem),l){this._hasPattern=!0;const{rect:h,width:p,height:y}=l,v=h.x+Oc,x=h.y+Oc,I=v+p,P=x+y;this.tessellationProperties._tl=Xn(v,x),this.tessellationProperties._br=Xn(I,P)}else this._hasPattern=!1,this.tessellationProperties._tl=0,this.tessellationProperties._br=0;this.tessellationProperties._fillColor=this._fillColor,this.tessellationProperties._halfWidth=this._halfWidth,this.tessellationProperties.offset=0,this.tessellationProperties._halfReferenceWidth=this.tessellationProperties._halfWidth;const c=wO.load(this._materialKey);l&&(c.sdf=l.sdf,c.pattern=!0,c.textureBinding=l.textureBinding),this._materialKey=c.data}};const enr=xT(),tnr=g_();let inr=class oNt extends PAt(yge){constructor(e,i,r){super(e),this._cimMarkerLayer=e,this._minMaxZoom=Xn(Math.round(i*dy),Math.round(r*dy));const n=e.color;if(ql(n)){const y=(v,x,I)=>Yp(n(v,x,I));this._dynamicPropertyMap.set("_fillColor",y)}else this._fillColor=Yp(n);const s=e.outlineColor;if(ql(s)){const y=(v,x,I)=>Yp(s(v,x,I));this._dynamicPropertyMap.set("_outlineColor",y)}else this._outlineColor=Yp(s);const o=e.size;if(ql(o)){const y=(v,x,I)=>vn(o(v,x,I));this._dynamicPropertyMap.set("_size",y)}else this._size=vn(o)||0;const a=e.scaleX;ql(a)?this._dynamicPropertyMap.set("_scaleX",a):this._scaleX=a;const l=e.offsetX;if(ql(l)){const y=(v,x,I)=>vn(l(v,x,I));this._dynamicPropertyMap.set("xOffset",y)}else this.xOffset=vn(l)||0;const c=e.offsetY;if(ql(c)){const y=(v,x,I)=>vn(c(v,x,I));this._dynamicPropertyMap.set("yOffset",y)}else this.yOffset=vn(c)||0;const h=e.outlineWidth;if(ql(h)){const y=(v,x,I)=>vn(h(v,x,I));this._dynamicPropertyMap.set("_outlineWidth",y)}else this._outlineWidth=vn(h)||0;const p=e.rotation;if(ql(p)?this._dynamicPropertyMap.set("_angle",p):this._angle=p||0,ve(e.effects)){const y=e.effects;ql(y)?this._dynamicPropertyMap.set("_effects",y):this._effects=y}if(ve(e.markerPlacement)){const y=e.markerPlacement;ql(y)?this._dynamicPropertyMap.set("_markerPlacement",y):this._markerPlacement=y}this._scaleFactor=zu(e.scaleFactor,1),this._bitSet=(e.alignment===py.MAP?1:0)|(e.colorLocked?1:0)<<1|(e.scaleSymbolsProportionally?1:0)<<3,this._materialKey=e.materialKey}static fromCIMMarker(e,i){const[r,n]=MF(e.scaleInfo,i);return new oNt(e,r,n)}bindFeature(e,i,r){const n=e.readLegacyFeature(),s=e.getObjectId();this._dynamicPropertyMap.forEach((Pe,ke)=>{this[ke]=Pe(n,i,r)});const o=this._cimMarkerLayer.materialHash,a=typeof o=="function"?o(n,i,r,s):o,l=this._materialCache.get(a);if(!l||!K_(l.spriteMosaicItem)||!l.spriteMosaicItem)return void Oi.getLogger("esri.views.2d.engine.webgl.WGLDynamicMarkerTemplate").error(new st("mapview-cim","Encountered an error when binding feature"));const c=l.spriteMosaicItem,h=this._cimMarkerLayer.sizeRatio,p=c.width/c.height*this._scaleX,y=this._cimMarkerLayer.rotateClockwise?this._angle:-this._angle;let v=this._size,x=v*p;const I=this.xOffset,P=this.yOffset;this.xOffset*=this._scaleFactor,this.yOffset*=this._scaleFactor;const F=this._cimMarkerLayer.scaleSymbolsProportionally&&this._cimMarkerLayer.frameHeight?this._size/vn(this._cimMarkerLayer.frameHeight):1,k=this._outlineWidth*F,j=vn(this._cimMarkerLayer.referenceSize);let V=0,Y=0;const X=this._cimMarkerLayer.anchorPoint;X&&(this._cimMarkerLayer.isAbsoluteAnchorPoint?this._size&&(V=vn(X.x)/(this._size*p),Y=vn(X.y)/this._size):(V=X.x,Y=X.y)),this._anchorX=V,this._anchorY=Y,this._sizeOutlineWidth=qp(Math.round(Math.min(Math.sqrt(128*x),255)),Math.round(Math.min(Math.sqrt(128*v),255)),Math.round(Math.min(Math.sqrt(128*k),255)),Math.round(Math.min(Math.sqrt(128*j),255))),this.angle=y;const Z=Math.round(64*h);this._bitestAndDistRatio=Xn(this._bitSet,Z);const ie=c.rect.x+Oc,ce=c.rect.y+Oc,he=ie+c.width,_e=ce+c.height;this._texUpperLeft=Xn(ie,ce),this._texUpperRight=Xn(he,ce),this._texBottomLeft=Xn(ie,_e),this._texBottomRight=Xn(he,_e);const xe=IF.load(this._materialKey);xe.sdf=c.sdf,xe.pattern=!0,xe.textureBinding=c.textureBinding,this._materialKey=xe.data,x*=h,v*=h,x*=this._scaleFactor,v*=this._scaleFactor,x*=c.rect.width/c.width,v*=c.rect.height/c.height,this._computedWidth=x,this._computedHeight=v,this._applyTransformation(tnr,enr),this.xOffset=I,this.yOffset=P}};function TNe(t){if(t==null)return[];const e=new Array(t.length);for(let i=0;iYp(s(P,F,k));this._dynamicPropertyMap.set("_color",I)}else this._color=Yp(s);const o=e.outlineColor;if(ql(o)){const I=(P,F,k)=>Yp(o(P,F,k));this._dynamicPropertyMap.set("_haloColor",I)}else this._haloColor=Yp(o);let a;ql(e.size)||(a=Math.min(Math.round(vn(e.size*e.sizeRatio)),127));const l=(I,P,F)=>ql(e.size)?Math.min(Math.round(vn(e.size(I,P,F)*e.sizeRatio)),127):a;if(this._dynamicPropertyMap.set("_size",l),ql(e.outlineSize)){const I=(P,F,k)=>Math.min(Math.floor(GAt*vn(e.outlineSize(P,F,k)*e.sizeRatio)),127);this._dynamicPropertyMap.set("_haloSize",I)}else this._haloSize=Math.min(Math.floor(GAt*vn(e.outlineSize*e.sizeRatio)),127);let c;ql(e.offsetX)||(c=Math.round(vn(e.offsetX*e.sizeRatio)));const h=(I,P,F)=>ql(e.offsetX)?Math.round(vn(e.offsetX(I,P,F)*e.sizeRatio)):c;let p;this._dynamicPropertyMap.set("_xOffset",h),ql(e.offsetY)||(p=Math.round(vn(e.offsetY*e.sizeRatio)));const y=(I,P,F)=>ql(e.offsetY)?Math.round(vn(e.offsetY(I,P,F)*e.sizeRatio)):p;if(this._dynamicPropertyMap.set("_yOffset",y),ql(e.angle)?this._dynamicPropertyMap.set("_angle",e.angle):this._angle=e.angle,ql(e.horizontalAlignment)?this._dynamicPropertyMap.set("_horizontalAlignment",e.horizontalAlignment):this._horizontalAlignment=e.horizontalAlignment,ql(e.verticalAlignment)?this._dynamicPropertyMap.set("_verticalAlignment",e.verticalAlignment):this._verticalAlignment=e.verticalAlignment,ve(e.effects)){const I=e.effects;ql(I)?this._dynamicPropertyMap.set("_effects",I):this._effects=I}if(ve(e.markerPlacement)){const I=e.markerPlacement;ql(I)?this._dynamicPropertyMap.set("_markerPlacement",I):this._textPlacement=I}ql(e.text)?this._dynamicPropertyMap.set("_text",e.text):this._text=e.text,this._backgroundColor=e.backgroundColor&&Yp(e.backgroundColor),this._borderLineColor=e.borderLineColor&&Yp(e.borderLineColor),this._borderLineSize=e.borderLineWidth,this._scaleFactor=n;const v=Math.min(Math.round(vn(e.referenceSize*e.sizeRatio)),127);this._referenceSize=Math.round(Math.sqrt(256*v)),this._materialKey=e.materialKey;const x=TU.load(this._materialKey);x.sdf=!0,this._bitset=(e.alignment===py.MAP?1:0)|(e.colorLocked?1:0)<<1,this._materialKey=x.data,this._decoration="none",this._lineHeight=1,this._lineWidth=512,this._isCIM=!0}static fromCIMText(e,i){const[r,n]=MF(e.scaleInfo,i);return new aNt(e,r,n)}async analyze(e,i,r,n){const s=i.readLegacyFeature(),o=rnr(this._cimTextLayer,s,r,n),a=await super.analyze(e,i,r,n,TNe(o));return a&&a.glyphMosaicItems&&this._textToGlyphs.set(o,a.glyphMosaicItems),a}bindFeature(e,i,r){const n=e.readLegacyFeature();if(this._dynamicPropertyMap.forEach((o,a)=>{this[a]=o(n,i,r)}),!this._text||this._text.length===0)return void(this._shapingInfo=null);this._size*=this._scaleFactor,this._scale=this._size/Bpe,this._xOffset*=this._scaleFactor,this._yOffset*=this._scaleFactor,this._xAlignD=oCt(zu(this._horizontalAlignment,"center")),this._yAlignD=aCt(zu(this._verticalAlignment,"baseline"));const s=this._textToGlyphs.get(this._text)??[];this.bindTextInfo(s,!1)}};const $U=128;let ENe=class mH extends BAt(XQ){constructor(e,i,r,n,s,o,a,l,c,h,p,y,v,x,I,P){super(),this._effects=x;const F=ES.load(e);i&&(F.sdf=i.sdf,F.pattern=!0,F.textureBinding=i.textureBinding),this.fillColor=r,this.tl=n,this.br=s,this.aux21=Xn(o,a),this.aux22=Xn(l,c),this.aux3=qp(h,p,y,0),this._bitset=v,this._minMaxZoom=Xn(Math.round(I*dy),Math.round(P*dy)),this._materialKey=F.data}static fromCIMFill(e,i,r){const n=e.color,s=n&&Yp(n)||0,o=e.materialKey,[a,l]=MF(e.scaleInfo,r),c=(e.colorLocked?Wk:0)|(e.applyRandomOffset?gvt:0)|(e.sampleAlphaOnly?Wpe:0)|(e.hasUnresolvedReplacementColor?yvt:0);if(!i)return new mH(o,null,s,0,0,0,0,0,0,0,0,0,c,e.effects,a,l);const{rect:h,width:p,height:y}=i,v=e.scaleX||1,x=h.x+Oc,I=h.y+Oc,P=x+p,F=I+y,k=vn(e.height);let j=v*k;e.cim.type==="CIMHatchFill"&&(j*=p/y);let V=Math.round(k);V<=0&&(V=F-I);let Y=Math.round(j);Y<=0&&(Y=P-x);const X=vn(e.offsetX||0),Z=vn(-e.offsetY||0),ie=Xn(x,I),ce=Xn(P,F);return new mH(o,i,s,ie,ce,Y,V,X,Z,$U,$U,$Q(e.angle),c,e.effects,a,l)}static fromSimpleFill(e,i,r=!1){const{color:n}=e,s=n&&e.style!=="esriSFSNull"&&gb(n)||0,o=r?Wk:0,a=e.materialKey;let l;if(i){const{rect:c,width:h,height:p,pixelRatio:y}=i,v=c.x+Oc,x=c.y+Oc,I=v+h,P=x+p,F=Xn(v,x),k=Xn(I,P);l=new mH(a,i,s,F,k,h/y,p/y,0,0,$U,$U,0,o,null,zE,HE)}else l=new mH(a,null,s,0,0,0,0,0,0,0,0,0,o,null,zE,HE);return l._maybeAddLineTemplate(e),l}static fromPictureFill(e,i,r=!1){const n=rvt,{rect:s,width:o,height:a}=i,l=s.x+Oc,c=s.y+Oc,h=l+o,p=c+a,y=Xn(l,c),v=Xn(h,p),x=Math.round(vn(e.width)),I=Math.round(vn(e.height)),P=vn(e.xoffset),F=vn(-e.yoffset),k=e.materialKey,j=r?Wk:0,V=new mH(k,i,n,y,v,x,I,P,F,$U*e.xscale,$U*e.yscale,0,j,null,zE,HE);return V._maybeAddLineTemplate(e),V}},snr=class{constructor(){this._resolver=null}isHeld(){return!!this._resolver}async acquire(){this._resolver?(await this._resolver.promise,await this.acquire()):this._resolver=kf()}release(){const e=this._resolver;this._resolver=null,e?.resolve()}};async function onr(t,e,i){try{await t.acquire(),await e(i),t.release()}catch(r){throw t.release(),r}}const anr={marker:Ln.MARKER,fill:Ln.FILL,line:Ln.LINE,text:Ln.TEXT};let lnr=class{constructor(e,i,r,n){const s={minScale:i?.minScale,maxScale:i?.maxScale},o=unr(s);this.layers=e,this.data=i,this.hash=this._createHash()+o,this.rendererKey=r;const a={isOutline:!1,placement:null,symbologyType:sa.DEFAULT,vvFlags:r};for(const l of e){const c=anr[l.type];a.isOutline=l.type==="line"&&l.isOutline,l.materialKey=TS(c,a),l.maxVVSize=n,l.scaleInfo=s,l.templateHash+=o}}get type(){return"expanded-cim"}_createHash(){let e="";for(const i of this.layers)e+=i.templateHash;return e}};function unr(t){return t.minScale||t.maxScale?t.minScale+"-"+t.maxScale:""}async function cnr(t,e,i){if(!t.name)throw new st("style-symbol-reference-name-missing","Missing name in style symbol reference");if(t.styleName&&t.styleName==="Esri2DPointSymbolsStyle")return hnr(t,i);try{return dnr(await Axe(t,e,i),t.name,e,i)}catch(r){return yn(r),null}}async function hnr(t,e){const i=zze.replace(/\{SymbolName\}/gi,t.name);try{const r=await iq(i,e);return Bse(r.data)}catch(r){return yn(r),null}}async function dnr(t,e,i,r){const n=t.data,s={portal:i&&ve(i.portal)?i.portal:Cc.getDefault(),url:fa(t.baseUrl),origin:"portal-item"},o=n.items.find(l=>l.name===e);if(!o)throw new st("symbolstyleutils:symbol-name-not-found",`The symbol name '${e}' could not be found`,{symbolName:e});let a=rw(jze(o,"cimRef"),s);ktt()&&(a=Ole(a));try{const l=await iq(a,r);return Bse(l.data)}catch(l){return yn(l),null}}const UAt=async(t,e,i)=>new lnr(await LXi(t.data,e,i),t.data,t.rendererKey,t.maxVVSize);async function PS(t,e,i,r){if(!t)return null;if(t.type==="cim")return UAt(t,e,i);if(t.type==="web-style"){const n={type:"cim",data:await cnr(t,null,r)??void 0,rendererKey:t.rendererKey,maxVVSize:t.maxVVSize};return UAt(n,e,i)}return t}function vge(t){if(!t)return null;const{avoidSDFRasterization:e,type:i,cim:r,url:n,materialHash:s}=t,o={cim:r,type:i,mosaicHash:s,url:n,size:null,dashTemplate:null,path:null,text:null,fontName:null,animatedSymbolProperties:null,avoidSDFRasterization:e};switch(i){case"marker":o.size=t.size,o.path=t.path,o.animatedSymbolProperties=t.animatedSymbolProperties;break;case"line":o.dashTemplate=t.dashTemplate;break;case"text":o.text=t.text,o.fontName=t.fontName}return o}const Q_=Oi.getLogger("esri.views.2d.engine.webgl.mesh.templates.WGLTemplateStore"),zAt={sortKey:null,templates:new Array},INe={isOutline:!1,placement:null,symbologyType:sa.DEFAULT,vvFlags:0},pnr={...xSe,hash:JSON.stringify(xSe),materialKey:TS(Ln.MARKER,INe)},fnr={...SSe,hash:JSON.stringify(SSe),materialKey:TS(Ln.LINE,INe)},mnr={...CSe,hash:JSON.stringify(CSe),materialKey:TS(Ln.FILL,INe)};function EO(t,e){const i=t.length;return t.push(null),e.then(r=>t[i]=r),t}function tee(t){return t!=null&&!!(1&t)}function gnr(t){return t.name==="worker:port-closed"}let HAt=class{constructor(e,i){this._idCounter=1,this._templateIdCounter=1,this._idToTemplateGroup=new Map,this._symbolToTemplate=new Map,this._fetchQueue=[],this._idToResolver=new Map,this._cimTemplateCache=new Map,this._cimAnalyses=[],this._lock=new snr,this._fetchResource=e,this._tileInfo=i}get _markerError(){return this._errorTemplates.marker[0]}get _fillError(){return this._errorTemplates.fill[0]}get _lineError(){return this._errorTemplates.line[0]}get _textError(){return this._errorTemplates.line[0]}createTemplateGroup(e,i,r=null){this._initErrorTemplates();const n=e.hash,s=this._symbolToTemplate.get(n);if(s!=null)return s;const o=new Array,a={sortKey:r,templates:o};i&&this._createMeshTemplates(o,i,!0),this._createMeshTemplates(o,e,!1);const l=this._createGroupId(e.type==="expanded-cim"&&ynr(e));return this._idToTemplateGroup.set(l,a),this._symbolToTemplate.set(n,l),l}getTemplateGroup(e){return this._idToTemplateGroup.get(e)??zAt}getDynamicTemplateGroup(e){return this._idToTemplateGroup.has(e)?(tee(e)||Q_.error("mapview-template-store",`Id ${e} does not refer to a dynamic template`),this._idToTemplateGroup.get(e)):zAt}getMosaicItem(e,i){const r=this._createTemplateId(),n=new Promise(s=>this._idToResolver.set(r,s));return this._fetchQueue.push({symbol:e,id:r,glyphIds:i}),n}finalize(e){return this._fetchQueue.length||this._lock.isHeld()?onr(this._lock,this._fetchAllQueuedResources.bind(this),e):Promise.resolve()}_initErrorTemplates(){this._errorTemplates||(this._errorTemplates={fill:this._createMeshTemplates([],mnr,!1),marker:this._createMeshTemplates([],pnr,!1),line:this._createMeshTemplates([],fnr,!1)})}_fetchAllQueuedResources(e){if(!this._fetchQueue.length)return Promise.resolve();const i=this._fetchQueue,r=this._cimAnalyses;return this._fetchQueue=[],this._cimAnalyses=[],Promise.all(r).then(()=>this._fetchResource(i,e).then(n=>{for(const{id:s,mosaicItem:o}of n)this._idToResolver.get(s)(o),this._idToResolver.delete(s)})).catch(n=>{ys(n)?this._fetchQueue=this._fetchQueue.concat(i):gnr(n)||Q_.error(new st("mapview-template-store","Unable to fetch requested texture resources",n))})}_createGroupId(e){return this._idCounter++<<1|(e?1:0)}_createTemplateId(){return this._templateIdCounter++}async _createSMS(e){const{spriteMosaicItem:i}=await this.getMosaicItem(e);return K_(i,Q_)?KQ.fromSimpleMarker(e,i):this._markerError}async _createPMS(e){const{spriteMosaicItem:i}=await this.getMosaicItem(e);return K_(i,Q_)?KQ.fromPictureMarker(e,i):this._markerError}async _createSFS(e,i){const{spriteMosaicItem:r}=await this.getMosaicItem(e);return K_(r,Q_)?ENe.fromSimpleFill(e,r,i):this._fillError}async _createPFS(e,i){const{spriteMosaicItem:r}=await this.getMosaicItem(e);return K_(r,Q_)?ENe.fromPictureFill(e,r,i):this._fillError}async _createSLS(e,i){const{spriteMosaicItem:r}=await this.getMosaicItem(e);return K_(r,Q_)?CNe.fromSimpleLine(e,r):this._lineError}async _createLMS(e){const{spriteMosaicItem:i}=await this.getMosaicItem(e);return K_(i,Q_)?KQ.fromLineSymbolMarker(e,i):this._markerError}async _createTS(e){const{glyphMosaicItems:i}=await this.getMosaicItem(e);return vNe.fromText(e,i??[])}async _createCIMText(e){const{glyphMosaicItems:i}=await this.getMosaicItem(vge(e),TNe(e.text));return K_(i,Q_)?vNe.fromCIMText(e,i,this._tileInfo):this._textError}async _createCIMFill(e){const{spriteMosaicItem:i}=await this.getMosaicItem(vge(e));return K_(i,Q_)?ENe.fromCIMFill(e,i,this._tileInfo):this._fillError}async _createCIMLine(e){const{spriteMosaicItem:i}=await this.getMosaicItem(vge(e));return K_(i,Q_)?CNe.fromCIMLine(e,i,this._tileInfo):this._lineError}async _createCIMMarker(e){const{spriteMosaicItem:i}=await this.getMosaicItem(vge(e));return K_(i,Q_)?KQ.fromCIMMarker(e,i,this._tileInfo):this._markerError}async _createCIM(e){const i=e.templateHash;let r=this._cimTemplateCache.get(i);if(r!=null)return r;switch(e.type){case"marker":r=await this._createCIMMarker(e);break;case"line":r=await this._createCIMLine(e);break;case"fill":r=await this._createCIMFill(e);break;case"text":r=await this._createCIMText(e)}return this._cimTemplateCache.set(i,r),r}async _createDynamicCIM(e){const i=e.templateHash;let r=this._cimTemplateCache.get(i);if(r!=null)return r;switch(e.type){case"marker":r=inr.fromCIMMarker(e,this._tileInfo);break;case"line":r=Qrr.fromCIMLine(e,this._tileInfo);break;case"fill":r=Zrr.fromCIMFill(e,this._tileInfo);break;case"text":r=nnr.fromCIMText(e,this._tileInfo)}return this._cimTemplateCache.set(i,r),r}_createPrimitiveMeshTemplates(e,i,r){switch(i.type){case"esriSMS":return EO(e,this._createSMS(i));case"esriPMS":return EO(e,this._createPMS(i));case"esriSFS":return EO(e,this._createSFS(i,r));case"line-marker":return EO(e,this._createLMS(i));case"esriPFS":return EO(e,this._createPFS(i,r));case"esriSLS":return EO(e,this._createSLS(i,!1));case"esriTS":return EO(e,this._createTS(i));default:return Q_.error("Unable to create mesh template for unknown symbol type {: $ }{symbol.type}"),e}}_createMeshTemplates(e,i,r){if(i.type.includes("3d"))return Q_.error("3D symbols are not supported with MapView"),e;if(i.type==="expanded-cim"){for(const n of i.layers)typeof n.materialHash=="function"?EO(e,this._createDynamicCIM(n)):EO(e,this._createCIM(n));return e}if(i.type==="composite-symbol"){for(const n of i.layers)this._createPrimitiveMeshTemplates(e,n,r);return e}return i.type==="cim"||i.type==="label"||i.type==="web-style"?e:this._createPrimitiveMeshTemplates(e,i,r)}};const ynr=t=>{if(!t.layers)return!1;for(const e of t.layers)if(typeof e.materialHash=="function")return!0;return!1};let WAt=class{constructor(e,i,r){this._loadPromise=gbt(),this._geometryType=e,this._idField=i,this._templateStore=r}update(e,i){ve(e.mesh.labels)&&(this._labelTemplates=this._createLabelTemplates(e.mesh.labels,i)),this._schema=e}_createLabelTemplates(e,i){const r=new Map;if(e.type==="simple"){for(const n of e.classes){const s=EAt.fromLabelClass(n,i);r.set(n.index,s)}return r}for(const n in e.classes){const s=e.classes[n];for(const o of s){const a=EAt.fromLabelClass(o,i);r.set(o.index,a)}}return r}get templates(){return this._templateStore}async analyze(e,i,r,n,s,o,a){if(Im(a))return;let l;r?.type==="dictionary"&&(l=await r.analyze(this._idField,e.copy(),i,s,o,a));let c=0;for(;e.next();){let h=null;if(h=l?l[c++]:ve(n)&&_vt(e.getDisplayId())&&e.readAttribute("cluster_count")!==1?n.match(this._idField,e,this._geometryType,s,o):r.match(this._idField,e,this._geometryType,s,o),e.setGroupId(h),tee(h)){const p=this._templateStore.getDynamicTemplateGroup(h).templates;for(const y of p)y&&y.analyze&&y.analyze(this._templateStore,e,s,o)}}return await this._loadPromise,this._templateStore.finalize(a)}async analyzeGraphics(e,i,r,n,s,o){if(Im(o))return;const a=e.getCursor();for(r&&await r.analyze(this._idField,a.copy(),i,n,s,o);a.next();){let l=a.getGroupId();if(l!=null&&l!==-1||(l=r?.match(this._idField,a,a.geometryType,n,s),a.setGroupId(l)),tee(l)){const c=this._templateStore.getDynamicTemplateGroup(l).templates;for(const h of c)h&&h.analyze&&h.analyze(this._templateStore,a,n,s)}a.setGroupId(l)}return await this._loadPromise,this._templateStore.finalize(o)}writeGraphic(e,i,r,n){const s=i.getGroupId(),o=i.getDisplayId(),a=this._templateStore.getTemplateGroup(s);if(e.featureStart(i.insertAfter,0),o!=null){if(tee(s))for(const l of a.templates)l&&l.bindFeature(i,null,null);if(a){for(const l of a.templates)l&&l.write(e,i,r,n);e.featureEnd()}}}writeCursor(e,i,r,n,s,o,a){const l=i.getGroupId(),c=i.getDisplayId(),h=this._templateStore.getTemplateGroup(l),p=h.templates,y=this._getSortKeyValue(i,h);if(e.featureStart(0,y),c!=null&&p){if(tee(l))for(const v of p)v.bindFeature(i,r,n);for(const v of p)v.write(e,i,s,a);if(ve(o)&&e.hasRecords){const v=o&&this._findLabelRef(p);this._writeLabels(e,i,o,v,s,a)}e.featureEnd()}}_getSortKeyValue(e,i){const r=this._schema.mesh.sortKey;if(lt(r))return 0;let n=0;return n=r.byRenderer===!0&&i.sortKey!=null?i.sortKey:r.fieldIndex!=null?e.getComputedNumericAtIndex(r.fieldIndex):r.field!=null?e.readAttribute(r.field):e.readAttribute(this._idField),n*=r.order==="asc"?1:-1,n==null||isNaN(n)?0:n}_findLabelRef(e){for(const i of e)if(i instanceof KQ)return i;return null}_writeLabels(e,i,r,n,s,o){for(const a of r)if(ve(a)&&a){const{glyphs:l,rtl:c,index:h}=a,p=this._labelTemplates.get(h);if(!p)continue;p.setZoomLevel(s),p.bindReferenceTemplate(n),p.bindTextInfo(l,c),p.write(e,i,null,o)}}};const ANe=Oi.getLogger("esri/views/2d/engine/webgl/util/Matcher");async function _ge(t,e,i,r){switch(t.type){case"simple":case"heatmap":return iee.fromBasicRenderer(t,e,i,r);case"map":return _nr.fromUVRenderer(t,e,i,r);case"interval":return vnr.fromCBRenderer(t,e,i,r);case"dictionary":return xnr.fromDictionaryRenderer(t,e,i,r);case"pie-chart":return qAt.fromPieChartRenderer(t,e,i,r);case"subtype":return qAt.fromSubtypes(t,e,i,r)}}let iee=class zBe{constructor(){this.type="feature",this._defaultResult=null}static async fromBasicRenderer(e,i,r,n){const s=new zBe;if(e.symbol){const o=await PS(e.symbol,r,n),a=i.createTemplateGroup(o,null);s.setDefault(a)}return s}static async fromPieChartRenderer(e,i,r,n){const s=new zBe;if(e.markerSymbol){const o=await PS(e.markerSymbol,r,n);let a;e.fillSymbol&&(a=await PS(e.fillSymbol,r,n));const l=i.createTemplateGroup(o,a);s.setDefault(l)}return s}size(){return 1}getDefault(){return this._defaultResult}setDefault(e){this._defaultResult=e}match(e,i,r,n,s){return this.getDefault()}async analyze(e,i,r,n,s,o){return null}},qAt=class lNt extends iee{constructor(e,i){super(),this._subMatchers=e,this._subtypeField=i}static async fromSubtypes(e,i,r,n){const s=new Map,o=[];for(const a in e.renderers){const l=parseInt(a,10),c=_ge(e.renderers[a],i,r,n).then(h=>s.set(l,h));o.push(c)}return await Promise.all(o),new lNt(s,e.subtypeField)}match(e,i,r,n,s){const o=i.readAttribute(this._subtypeField),a=this._subMatchers.get(o);return a?a.match(e,i,r,n,s):null}},vnr=class uNt extends iee{constructor(e,i,r,n){super(),this.type="interval",this._intervals=[],this._isMaxInclusive=i,this._fieldIndex=n,this._field=e,this._normalizationInfo=r}static async fromCBRenderer(e,i,r,n){const{isMaxInclusive:s,normalizationField:o,normalizationTotal:a,normalizationType:l}=e,c=e.field,h=new uNt(c,s,{normalizationField:o,normalizationTotal:a,normalizationType:l},e.fieldIndex),p=await PS(e.backgroundFillSymbol,r,n);await Promise.all(e.intervals.map(async v=>{const x=await PS(v.symbol,r,n),I=await i.createTemplateGroup(x,p),P={min:v.min,max:v.max};h.add(P,I)}));const y=await PS(e.defaultSymbol,r,n);if(y){const v=await i.createTemplateGroup(y,p);h.setDefault(v)}return h}add(e,i){this._intervals.push({interval:e,result:i}),this._intervals.sort((r,n)=>r.interval.min-n.interval.min)}size(){return super.size()+this._intervals.length}match(e,i,r,n,s){if(this._fieldIndex==null&&!this._field)return this.getDefault();const o=this._fieldIndex!=null?i.getComputedNumericAtIndex(this._fieldIndex):this._getValueFromField(i);if(o==null||isNaN(o)||o===1/0||o===-1/0)return this.getDefault();for(let a=0;a=l.min,p=this._isMaxInclusive?o<=l.max:o{const y=await PS(h.symbol,r,n),v=p+1,x=await i.createTemplateGroup(y,a,v);h.value===""?l.setNullResult(x):l.add(h.value,x)}));const c=await PS(e.defaultSymbol,r,n);if(c){const h=Number.MAX_SAFE_INTEGER,p=await i.createTemplateGroup(c,a,h);l.setDefault(p)}return l}setNullResult(e){this._nullResult=e}add(e,i){this._resultsMap.set(e.toString(),i)}size(){return super.size()+this._resultsMap.size}match(e,i,r,n,s){if(this._fieldsIndex==null&&!this._fields)return this.getDefault();const o=this._fieldsIndex!=null?i.getComputedStringAtIndex(this._fieldsIndex):this._getValueFromFields(i);if(this._nullResult!==null&&(o==null||o===""||o===""))return this._nullResult;if(o==null)return this.getDefault();const a=o.toString();return this._resultsMap.has(a)?this._resultsMap.get(a):this.getDefault()}_getValueFromFields(e){const i=[];for(const r of this._fields){const n=e.readAttribute(r);n==null||n===""?i.push(""):i.push(n)}return i.join(this._seperator)}};async function bnr(t,e){const i=t||1;if(typeof i=="number")return(n,s,o)=>i;const r=await Ane(i,e.spatialReference,e.fields);return(n,s,o)=>x6(r,n,{$view:o},e.geometryType,s)||1}let PNe;async function wnr(){return PNe||(PNe=Promise.resolve().then(()=>Anr)),PNe}let xnr=class hNt extends iee{constructor(e,i,r,n,s,o){super(),this.type="dictionary",this._groupIdCache=new C9(100),this._loader=e,this._fieldMap=e.fieldMap,this._symbolFields=e.getSymbolFields(),this._templates=i,this._info=r,this._scaleFn=n,this._schemaUtilsModule=s,this._symbolOptions=o}static async fromDictionaryRenderer(e,i,r,n){const[{DictionaryLoader:s},o]=await Promise.all([Promise.resolve().then(()=>Jjt),wnr()]),a=new s(e.url,e.config,e.fieldMap);await a.fetchResources({spatialReference:r.spatialReference,fields:r.fields});const l=await bnr(e.scaleExpression,r);return new hNt(a,i,r,l,o,e.symbolOptions)}async _analyzeFeature(e,i,r,n,s){const o=e.readLegacyFeature(),a=this._scaleFn(o,r,n),l=this._attributeHash(o)+"-"+a,c=this._groupIdCache.get(l);if(c)return c;const h={...n,spatialReference:this._info.spatialReference,abortOptions:s,fields:this._info.fields},p=await this._loader.getSymbolAsync(o,h),y=this._schemaUtilsModule.createSymbolSchema(p,this._symbolOptions),v=PS(y,this._info,i,s).then(x=>{if(x?.type!=="expanded-cim")return ANe.error(new st("mapview-bad-type",`Found unexpected type ${x?.type} in dictionary response`)),null;x.hash+="-"+a;for(const I of x.layers)I.scaleFactor=a,I.templateHash+="-"+a;return this._templates.createTemplateGroup(x,null)});return this._groupIdCache.put(l,v,1),v}async analyze(e,i,r,n,s,o){const a=i.getCursor(),l=[];for(;a.next();)l.push(this._analyzeFeature(a,r,n,s,o));return Promise.all(l).then(c=>c.filter(ve))}match(e,i,r,n,s){return null}_attributeHash(e){let i="";for(const r of this._symbolFields){const n=this._fieldMap?.[r];n&&(i+=e.attributes[n]+"-")}return i}};function YAt(t){if(!t)return sd.NONE;let e=0;for(const i of t)if(i.type==="size"){const r=c_t(i);e|=r,i.target==="outline"&&(e|=r<<4)}else i.type==="color"?e|=sd.COLOR:i.type==="opacity"?e|=sd.OPACITY:i.type==="rotation"&&(e|=sd.ROTATION);return e}function $6(t){return t.type==="line-marker"?{type:"line-marker",color:t.color?.toJSON(),placement:t.placement,style:t.style}:t.constructor.fromJSON(t.toJSON()).toJSON()}function B6(t){return IQi(t)}function e1(t,e,i=!1){if(!t)return null;switch(t.type){case"simple-fill":case"picture-fill":return Cnr(t,e,i);case"simple-marker":case"picture-marker":return Enr(t,e,i);case"simple-line":return Tnr(t,e,i);case"text":return Inr(t,e,i);case"label":return Snr(t,e,i);case"cim":return{type:"cim",rendererKey:e.vvFlags,data:t.data,maxVVSize:e.maxVVSize};case"CIMSymbolReference":return{type:"cim",rendererKey:e.vvFlags,data:t,maxVVSize:e.maxVVSize};case"web-style":return{...$6(t),type:"web-style",hash:t.hash(),rendererKey:e.vvFlags,maxVVSize:e.maxVVSize};default:throw new Error(`symbol not supported ${t.type}`)}}function Snr(t,e,i){const r=t.toJSON(),n=TS(Ln.LABEL,{...e,placement:r.labelPlacement});return{materialKey:i?B6(n):n,hash:t.hash(),...r,labelPlacement:r.labelPlacement}}function Cnr(t,e,i){const r=TS(Ln.FILL,e),n=i?B6(r):r,s=t.clone(),o=s.outline,a=Vme(e.symbologyType);a||(s.outline=null);const l={materialKey:n,hash:s.hash(),...$6(s)};if(a)return l;const c=[];if(c.push(l),o){const h=TS(Ln.LINE,{...e,isOutline:!0}),p={materialKey:i?B6(h):h,hash:o.hash(),...$6(o)};c.push(p)}return{type:"composite-symbol",layers:c,hash:c.reduce((h,p)=>p.hash+h,"")}}function Tnr(t,e,i){const r=Vme(e.symbologyType)?sa.DEFAULT:e.symbologyType,n=TS(Ln.LINE,{...e,symbologyType:r}),s=i?B6(n):n,o=t.clone(),a=o.marker;o.marker=null;const l=[];if(l.push({materialKey:s,hash:o.hash(),...$6(o)}),a){const c=TS(Ln.MARKER,e),h=i?B6(c):c;a.color=a.color??o.color,l.push({materialKey:h,hash:a.hash(),lineWidth:o.width,...$6(a)})}return{type:"composite-symbol",layers:l,hash:l.reduce((c,h)=>h.hash+c,"")}}function Enr(t,e,i){const r=TS(Ln.MARKER,e),n=i?B6(r):r,s=$6(t);return{materialKey:n,hash:t.hash(),...s,angle:t.angle,maxVVSize:e.maxVVSize}}function Inr(t,e,i){const r=TS(Ln.TEXT,e),n=i?B6(r):r,s=$6(t);return{materialKey:n,hash:t.hash(),...s,angle:t.angle,maxVVSize:e.maxVVSize}}const Anr=Object.freeze(Object.defineProperty({__proto__:null,createSymbolSchema:e1},Symbol.toStringTag,{value:"Module"})),BU=512,IO=50;function Pnr(t,e){const i=vd(e);if(!i)return null;const[r,n]=i.valid;return t[2]>n?[Mo([t[0],t[1],n,t[3]]),Mo([r,t[1],r+t[2]-n,t[3]])]:t[0]n.size).reduce(ONe,0);if(r.transformationType==="clamped-linear"){let n=-1/0,s=-1/0;return n=typeof r.maxSize=="number"?r.maxSize:r.maxSize.stops.map(o=>o.size).reduce(ONe,0),s=typeof r.minSize=="number"?r.minSize:r.minSize.stops.map(o=>o.size).reduce(ONe,0),Math.max(n,s)}return r.transformationType==="real-world-size"?30:void 0}function ONe(t,e){return Math.max(t,e)}const bge=8,KAt=bge-2,wge=Oi.getLogger("esri.views.2d.layers.features.support.rendererUtils"),Fnr=t=>{if(!("visualVariables"in t)||!t.visualVariables||!t.visualVariables.length)return t;const e=t.clone(),i=e.visualVariables.map(r=>JAt(r)?ZAt(r):r);return e.visualVariables=i,e};function Lnr(t){return t.map(e=>JAt(e)?ZAt(e.clone()):e)}function JAt(t){return(t.type==="size"||t.type==="color"||t.type==="opacity")&&t.stops!=null}function ZAt(t){return t.stops=$nr(t.type,t.stops??[]),t}function VU(t,e,i){return(1-i)*t+i*e}function Nnr(t,e){const[i,...r]=e,n=r.pop(),s=r[0].value,o=r[r.length-1].value,a=(o-s)/KAt,l=[];for(let c=s;c=r[h].value;)h++;const p=r[h],y=e[h-1],v=c-y.value,x=p.value===y.value?1:v/(p.value-y.value);if(t==="color"){const I=r[h],P=e[h-1],F=I.color.clone();F.r=VU(P.color.r,F.r,x),F.g=VU(P.color.g,F.g,x),F.b=VU(P.color.b,F.b,x),F.a=VU(P.color.a,F.a,x),l.push({value:c,color:F,label:I.label})}else if(t==="size"){const I=r[h],P=e[h-1],F=Ga(I.size),k=VU(Ga(P.size),F,x);l.push({value:c,size:k,label:I.label})}else{const I=r[h],P=VU(e[h-1].opacity,I.opacity,x);l.push({value:c,opacity:P,label:I.label})}}return[i,...l,n]}function knr(t){const[e,...i]=t,r=i.pop();for(;i.length>KAt;){let n=0,s=0;for(let o=1;os&&(s=c,n=o)}i.splice(n,1)}return[e,...i,r]}function $nr(t,e){return e.length<=bge?e:(wge.warn(`Found ${e.length} Visual Variable stops, but MapView only supports ${bge}. Displayed stops will be simplified.`),e.length>2*bge?Nnr(t,e):knr(e))}function RNe(){if(Hi("heatmap-force-raster"))return"raster";const{supportsTextureFloat:t,supportsTextureHalfFloat:e,supportsColorBufferFloat:i,supportsColorBufferFloatBlend:r,supportsColorBufferHalfFloat:n}=ST("2d");return t&&i&&r||e&&n?"symbol":Hi("heatmap-allow-raster-fallback")?"raster":"none"}function Bnr(t){if(!t)return!0;switch(t.type){case"dot-density":if(!ST("2d").supportsTextureFloat)return wge.error(new st("webgl-missing-extension","Missing WebGL extension OES_Texture_Float which is required for DotDensity")),!1;break;case"heatmap":{const e=RNe();if(e==="none"||e==="raster"&&!Hi("heatmap-force-raster")){const i=ST("2d"),r=["supportsTextureFloat","supportsTextureHalfFloat","supportsColorBufferFloat","supportsColorBufferFloatBlend","supportsColorBufferHalfFloat"].filter(n=>!i[n]).join(", ");if(e==="none")return wge.errorOnce(new st("webgl-missing-extension",`Missing WebGL${i.type} requirements for Heatmap: ${r}`)),!1;e==="raster"&&wge.warnOnce(`Missing WebGL${i.type} requirements for accelerated Heatmap: ${r}. Feature support may be limited.`)}break}}return!0}const Vnr=new Ks({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function xge(t){return Vnr.toJSON(t)}function QAt(t){const{bandCount:e,attributeTable:i,colormap:r,pixelType:n}=t.raster.rasterInfo;return e===1&&(i!=null||r!=null||n==="u8"||n==="s8")}const V6=Oi.getLogger("esri.views.2d.layers.features.schemaUtils"),t1="ValidationError";function K4r(t){return t}function ree(t,e){let i=0,r=0,n=sa.DEFAULT;if(ve(t)){if(r=Dnr(t,e),"visualVariables"in t&&(i=YAt(t.visualVariables||[]),t.type==="dot-density"&&(n=sa.DOT_DENSITY)),t.type==="heatmap"&&(n=sa.HEATMAP),t.type==="dictionary")return{maxVVSize:r,vvFlags:i,symbologyType:sa.DEFAULT};if(t.type==="pie-chart")return{maxVVSize:r,vvFlags:i,symbologyType:sa.PIE_CHART};if(n!==sa.DOT_DENSITY&&n!==sa.HEATMAP){const s=t.getSymbols();"backgroundFillSymbol"in t&&t.backgroundFillSymbol&&s.push(t.backgroundFillSymbol);let o=!0,a=!0;for(const l of s)if(l.type==="cim"&&(a=!1),l.type==="simple-fill"||l.type==="picture-fill"){const c=l.outline,h=c&&c.style!=="none"&&c.style!=="solid",p=l.type==="simple-fill"&&l.style!=="none"&&l.style!=="solid";h&&(o=!1),(l.type==="picture-fill"||p||h)&&(a=!1)}o?n=a?sa.OUTLINE_FILL_SIMPLE:sa.OUTLINE_FILL:a&&(n=sa.SIMPLE)}}return{vvFlags:i,maxVVSize:r,symbologyType:n}}let ePt=null;function jnr(t){if(Hi("esri-2d-update-debug")){const e=tPt(t,!0);console.debug("Created new schema",e),console.debug("Schema diff",h2(ePt,e)),ePt=e}return tPt(t)}function tPt(t,e=!1){try{const i=Hnr(t,e),r=Ynr(t),n={};i.map(a=>Gnr(n,t,a));const s=ve(t.subtypeCode)?`${t.subtypeField} = ${t.subtypeCode}`:null;return{source:{definitionExpression:OR(t.definitionExpression,s),fields:t.fields.map(a=>a.toJSON()),gdbVersion:t.gdbVersion,historicMoment:t.historicMoment?.getTime(),outFields:t.availableFields,pixelBuffer:t.pixelBuffer,spatialReference:t.spatialReference.toJSON(),timeExtent:t.timeExtent?.toJSON(),customParameters:t.customParameters},attributes:{fields:{},indexCount:0},processors:i,tileRenderer:r,targets:n}}catch(i){if(i.fieldName===t1)return V6.error(i),null;throw i}}function Gnr(t,e,i){switch(i.target){case"feature":return void FNe(t,DNe(e),i);case"aggregate":{if(!("featureReduction"in e))return;const r=e.featureReduction;switch(r?.type){case"selection":throw new st(t1,"Mapview does not support `selection` reduction type",r);case"binning":return FNe(t,DNe(e),i),void Unr(t,r,e.fields.map(n=>n.toJSON()),i);case"cluster":return FNe(t,DNe(e),i),void znr(t,r,e.fields.map(n=>n.toJSON()),i)}}}}function MNe(t,e){for(const i in e){const r=e[i];if(r.target!==t.name)continue;const n=t.attributes[i];if(n?.context){const s=n.context;s.mesh=s.mesh||r.context?.mesh,s.storage=s.storage||r.context?.storage}else t.attributes[i]=r}return t}function DNe(t){return[t.filter?.toJSON()??null,t.featureEffect?.filter?.toJSON()??null]}function FNe(t,e,i){return t.feature||(t.feature={name:"feature",input:"source",filters:e,attributes:{}}),MNe(t.feature,i.attributes.fields),t}function iPt(t,e){const{onStatisticExpression:i,onStatisticField:r,statisticType:n}=t;switch(n){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(i){const{returnType:o}=i;return o?o==="string"?"esriFieldTypeString":"esriFieldTypeDouble":(V6.error(new st(t1,"Unable to infer type of aggregateField with onStatisticExpression. ReturnType is not defined",t)),"esriFieldTypeString")}const s=e.find(o=>o.name===r);return s?s.type:(V6.error(new st(t1,"Unable to infer type of aggregateField with onStatisticExpression. ReturnType is not defined",t)),"esriFieldTypeString")}}}function Unr(t,e,i,r){return t.aggregate||(t.aggregate={name:"aggregate",type:"bin",filters:null,input:"feature",params:{fixedBinLevel:e.fixedBinLevel,fields:(e.fields??[]).map(n=>({...n.toJSON(),type:iPt(n,i)}))},attributes:{}}),MNe(t.aggregate,r.attributes.fields),t}function znr(t,e,i,r){return t.aggregate||(t.aggregate={name:"aggregate",type:"cluster",input:"feature",filters:null,attributes:{},params:{clusterRadius:vn(e.clusterRadius/2),clusterPixelBuffer:64*Math.ceil(vn(e.clusterMaxSize)/64),fields:(e.fields??[])?.map(n=>({...n.toJSON(),type:iPt(n,i)}))}}),MNe(t.aggregate,r.attributes.fields),t}function WE(t,e){return e.field?j6(t,{...e,type:"field",field:e.field}):e.valueExpression?j6(t,{...e,type:"expression",valueExpression:e.valueExpression}):{field:void 0,fieldIndex:void 0}}function j6(t,e){switch(e.type){case"expression":{const i=e.valueExpression;if(!t.fields[i]){const r=t.indexCount++;t.fields[i]={...e,name:i,fieldIndex:r}}return{fieldIndex:t.fields[i].fieldIndex}}case"label-expression":{const i=JSON.stringify(e.label);if(!t.fields[i]){const r=t.indexCount++;t.fields[i]={...e,name:i,fieldIndex:r}}return{fieldIndex:t.fields[i].fieldIndex}}case"field":{const i=e.field;return e.target==="aggregate"&&t.fields[i]||(t.fields[i]={...e,name:i}),{field:i}}case"statistic":return t.fields[e.name]={...e},{field:e.name}}}function Hnr(t,e=!1){const i=new Array;let r=0;return i.push(qnr(t,r++,e)),i}function LNe(t,e,i,r,n,s=!1){const o=j6(t,{type:"label-expression",target:i,context:{mesh:!0},resultType:"string",label:{labelExpression:e.labelExpression,labelExpressionInfo:e.labelExpressionInfo?{expression:e.labelExpressionInfo.expression}:null,symbol:!!e.symbol,where:e.where}}),{fieldIndex:a}=o;return{...e1(e,n,s),fieldIndex:a,target:i,index:r}}function Wnr(t,e,i){const r="featureReduction"in e&&e.featureReduction;if(!r)return{fields:[],labels:[],matcher:void 0,rendererOverride:void 0};const n="aggregate",s=[];let o=null,a=xge(e.geometryType),l=[],c=null;if(r)switch(r.type){case"selection":return V6.error(new st(t1,"Mapview does not support `selection` reduction type",r)),{fields:[],labels:[],matcher:void 0,rendererOverride:void 0};case"cluster":case"binning":if(s.push(...r.fields??[]),r.type==="cluster"?a="esriGeometryPoint":r.type==="binning"&&(a="esriGeometryPolygon"),r.renderer&&!r.renderer.authoringInfo?.isAutoGenerated){if(r.type==="cluster"){const{renderer:p}=DYe(r.renderer,r,null);c=p}else c=r.renderer;const h=ree(r.renderer,r);o=Sge(t,n,r.renderer,h,i),l=r&&r.labelsVisible&&r.labelingInfo||[]}else if(r.type==="cluster"){if(c=DSe(s,e.renderer,r,null,!0),r.symbol){const h=ree(c,r);o={type:"simple",symbol:e1(r.symbol,h,i),symbologyType:h.symbologyType}}l=r&&r.labelsVisible&&r.labelingInfo||[]}}return Knr(t,s),{labels:iCe(l,r.type==="binning"?"esriGeometryPolygon":a),matcher:o,fields:s,rendererOverride:c}}function qnr(t,e,i=!1){const r={indexCount:0,fields:{}},n="featureReduction"in t?t.featureReduction??void 0:void 0,s=n?"aggregate":"feature";if("sublayers"in t){const F={type:"subtype",subtypeField:t.subtypeField,renderers:{},symbologyType:sa.DEFAULT},k={type:"subtype",mapping:{},target:"feature",subtypeField:t.subtypeField},j={type:"subtype",classes:{}},V={type:"symbol",target:"feature",aggregateFields:[],attributes:r,storage:k,mesh:{matcher:F,aggregateMatcher:null,labels:j,sortKey:null}},Y=new Set;let X=0;for(const{renderer:Z,subtypeCode:ie,labelingInfo:ce,labelsVisible:he}of t.sublayers){let _e=0;"visualVariables"in Z&&Z.visualVariables&&(Z.visualVariables.some(de=>de.type!=="rotation")&&V6.warnOnce("SubtypeGroupLayer currently only supports rotation visualVariables. All other visualVariable types will be ignored."),_e=YAt(Z.visualVariables.filter(de=>de.type!=="size")));const xe={symbologyType:sa.DEFAULT,vvFlags:_e,maxVVSize:0},Pe=Sge(r,s,Z,xe,i),ke=rPt(r,s,Z),J=he&&ce;if(Pe.type==="dictionary")throw new st(t1,"Dictionary renderer is not supported in subtype layers");if(Pe.type==="subtype")throw new st(t1,"Nested subtype renderers is not supported");if(ve(ke)&&ke.type==="subtype")throw new st(t1,"Nested subtype storage is not supported");if(ve(ke)&&ve(ke.attributeMapping))throw new st(t1,"Non-visual-variable attributes are not supported in subtype layers");if(Pe.type==="heatmap")throw new st(t1,"Heatmaps are not supported in subtype layers");if(Pe.type==="pie-chart")throw new st(t1,"Pie-charts are not supported in subtype layers");if(Y.has(ie))throw new st(t1,"Subtype codes for sublayers must be unique");Y.add(ie),F.renderers[ie]=Pe,k.mapping[ie]=ke,J&&(j.classes[ie]=J.map(de=>LNe(r,de,"feature",X++,xe,i)))}return V}if(t.renderer?.type==="heatmap"&&RNe()==="raster"){const{radius:F,fieldOffset:k,field:j}=t.renderer;return{type:"heatmap",aggregateFields:[],attributes:r,target:s,storage:null,mesh:{radius:F,fieldOffset:k,field:WE(r,{target:s,field:j,resultType:"numeric"}).field}}}const o=Wnr(r,t,i),a=xge(t.geometryType),l=o.rendererOverride??t.renderer,c=ree(l,n),h=Sge(r,s,l,c,i),p=rPt(r,s,l),y=Xnr(r,t.orderBy,t.renderer,n),v=t.labelsVisible&&t.labelingInfo||[],x=iCe(v,a);let I=0;const P=[...x.map(F=>LNe(r,F,"feature",I++,c,i)),...o.labels.map(F=>LNe(r,F,"aggregate",I++,c,i))];return{type:"symbol",target:s,attributes:r,aggregateFields:o.fields,storage:p,mesh:{matcher:h,labels:{type:"simple",classes:P},aggregateMatcher:o.matcher,sortKey:y}}}function Ynr(t){return t.renderer?.type==="heatmap"&&RNe()==="raster"?{type:"heatmap"}:{type:"symbol"}}function Xnr(t,e,i,r){if(ve(r))return null;if(ve(e)&&e.length){e.length>1&&V6.warn(`Layer rendering currently only supports ordering by 1 orderByInfo, but found ${e.length}. All but the first will be discarded`);const n=e[0],s=n.order==="ascending"?"asc":"desc";return n.field?{field:n.field,order:s}:n.valueExpression?{fieldIndex:j6(t,{type:"expression",target:"feature",valueExpression:n.valueExpression,resultType:"numeric"}).fieldIndex,order:s}:(V6.error(new st(t1,"Expected to find a field or valueExpression for OrderByInfo",n)),null)}return ve(i)&&i.type==="unique-value"&&i.orderByClassesEnabled?{byRenderer:!0,order:"asc"}:null}function Knr(t,e){const i={mesh:!0,storage:!0};for(const r of e){const{name:n,onStatisticField:s,onStatisticExpression:o,statisticType:a}=r;let l,c;const h="numeric",p="feature";o?c=j6(t,{type:"expression",target:p,valueExpression:o.expression,resultType:h}).fieldIndex:l=j6(t,{type:"field",target:p,field:s,resultType:h}).field,j6(t,{type:"statistic",target:"aggregate",name:n,context:i,inField:l,inFieldIndex:c,statisticType:a})}}function rPt(t,e,i){let r;switch(i.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":r={visualVariables:!0,attributes:null};break;default:r=HEt(i).getStorageSpec(i)}return Jnr(t,e,r,i)}function Jnr(t,e,i,r){if(lt(i))return null;const{visualVariables:n,attributes:s}=i;let o=null;n&&"visualVariables"in r&&(o=Znr(t,e,r.visualVariables));const a=ve(o)?4:0;let l=null;return ve(s)&&(l=s.map((c,h)=>{const{field:p,fieldIndex:y}=WE(t,{valueExpression:c.valueExpression,field:c.field,resultType:"numeric",target:e});return{binding:h+a,field:p,fieldIndex:y}})),{type:"simple",target:e,attributeMapping:l,vvMapping:o}}function Znr(t,e,i){if(!i||!i.length)return[];const r={storage:!0},n="numeric";return Lnr(i).map(s=>{const o=VNi(s.type),{field:a,fieldIndex:l}=WE(t,{target:e,valueExpression:s.valueExpression,field:s.field,context:r,resultType:n});switch(s.type){case"size":return s.valueExpression==="$view.scale"?null:{type:"size",binding:o,field:a,fieldIndex:l,normalizationField:WE(t,{target:e,field:s.normalizationField,context:r,resultType:n}).field,valueRepresentation:s.valueRepresentation??null};case"color":return{type:"color",binding:o,field:a,fieldIndex:l,normalizationField:WE(t,{target:e,field:s.normalizationField,context:r,resultType:n}).field};case"opacity":return{type:"opacity",binding:o,field:a,fieldIndex:l,normalizationField:WE(t,{target:e,field:s.normalizationField,context:r,resultType:n}).field};case"rotation":return{type:"rotation",binding:o,field:a,fieldIndex:l}}}).filter(ve)}function Sge(t,e,i,r,n=!1){const s=zu(t,{indexCount:0,fields:{}});switch(i.type){case"simple":case"dot-density":return Qnr(s,i,r,n);case"class-breaks":return tsr(s,e,i,r,n);case"unique-value":return isr(s,e,i,r,n);case"dictionary":return rsr(s,i,r,n);case"heatmap":return nsr(s,i,r,n);case"pie-chart":return esr(s,i,r,n)}}function Qnr(t,e,i,r=!1){const n=e.getSymbols(),s=n.length?n[0]:null;return{type:"simple",symbol:e1(s,i,r),symbologyType:i.symbologyType}}function esr(t,e,i,r=!1){const n=e.getSymbols(),s=n[0],o=n.length>1?n[1]:null;return{type:"pie-chart",markerSymbol:e1(s,i,r),fillSymbol:e1(o,i,r),symbologyType:i.symbologyType}}function tsr(t,e,i,r,n=!1){const s={mesh:!0,use:"renderer.field"},o=i.backgroundFillSymbol,{field:a,fieldIndex:l}=WE(t,{target:e,field:i.field,valueExpression:i.valueExpression,resultType:"numeric",context:s}),c=i.normalizationType,h=c==="log"?"esriNormalizeByLog":c==="percent-of-total"?"esriNormalizeByPercentOfTotal":c==="field"?"esriNormalizeByField":null,p=i.classBreakInfos.map(y=>({symbol:e1(y.symbol,r,n),min:y.minValue,max:y.maxValue})).sort((y,v)=>y.min-v.min);return{type:"interval",attributes:t.fields,field:a,fieldIndex:l,backgroundFillSymbol:e1(o,r,n),defaultSymbol:e1(i.defaultSymbol,r,n),intervals:p,normalizationField:i.normalizationField,normalizationTotal:i.normalizationTotal,normalizationType:h,isMaxInclusive:i.isMaxInclusive,symbologyType:r.symbologyType}}function isr(t,e,i,r,n=!1){const s=[],o=i.backgroundFillSymbol,a={target:e,context:{mesh:!0},resultType:"string"};if(i.field&&typeof i.field!="string")throw new st(t1,"Expected renderer.field to be a string",i);const{field:l,fieldIndex:c}=WE(t,{...a,field:i.field,valueExpression:i.valueExpression});for(const h of i.uniqueValueInfos??[])s.push({value:""+h.value,symbol:e1(h.symbol,r,n)});return{type:"map",attributes:t.fields,field:l,fieldIndex:c,field2:WE(t,{...a,field:i.field2}).field,field3:WE(t,{...a,field:i.field3}).field,fieldDelimiter:i.fieldDelimiter??void 0,backgroundFillSymbol:e1(o,r),defaultSymbol:e1(i.defaultSymbol,r),map:s,symbologyType:r.symbologyType}}function rsr(t,e,i,r=!1){return{type:"dictionary",config:e.config,fieldMap:e.fieldMap,scaleExpression:e.scaleExpression,url:e.url,symbolOptions:i,symbologyType:i.symbologyType}}function nsr(t,e,i,r=!1){const n=e.getSymbols(),s=n.length?n[0]:null;return{type:"heatmap",symbol:e1(s,i,r),symbologyType:i.symbologyType}}let ssr=class HBe extends Ev{static from(e,i,r){const n=Hk.createInstance(),s=[],o=e.filter(a=>!!a.geometry);for(const a of o){const l=bd(a.geometry);vZt(s,[a],l,!1,!1,i)}return new HBe(n,s,r)}constructor(e,i,r){super(e,i,null),this._transform=r}get geometryType(){const e=this._current;return e?e.geometryType:null}get insertAfter(){return this._current.insertAfter}readGraphic(){return this._current}getCursor(){return this.copy()}copy(){const e=new HBe(this.instance,this._features,this._transform);return this.copyInto(e),e}};const nee=new Ml,NNe=new Ml,nPt="esriGeometryPolyline";function sPt(t){t.coords.length=0,t.lengths.length=0}let see=class p_e{constructor(){this.bounds=Mo(),this.graphic=null}static acquire(e=null,i,r,n,s){let o;return p_e._pool.length===0?o=new p_e:(o=p_e._pool.pop(),this._set.delete(o)),o.acquire(e,i,r,n,s),o}static release(e){e&&!this._set.has(e)&&(e.release(),this._pool.push(e),this._set.add(e))}static getCentroidQuantized(e,i){if(Xa(e.geometry)){const r=e.symbol;if(lt(r))return null;if(r?.layers.length>0&&r.layers.some(n=>n.type==="text"||n.type==="marker")){const n=Cne(e.geometry);return n!==null?BMe(i,{},{x:n[0],y:n[1]},!1,!1):null}}return null}acquire(e=null,i,r,n,s){e&&this.set(e,i,r,n,s)}release(){this.graphic=null,this.symbolResource=null,this.geometry=null}get symbol(){return this.symbolResource.symbol}set(e,i,r,n,s){this.graphic=e,this.geometry=r,this.symbolResource=i,this.bounds=n,s&&(this.size=s)}getGeometryQuantized(e,i,r,n){const s=this.geometry,o=bd(s);if(lt(o))return null;switch(o){case"esriGeometryPolygon":{const a=s,{rings:l}=a;if(!l||l.length===0)return null;let c;if(c=l.length===1&&l[0].length===2?vJ(e,{paths:[[l[0][0],l[0][1]]]}):vJ(e,this.geometry),!c){const h={x:l[0][0][0],y:l[0][0][1]};if(c=vJ(e,h),c){const{x:p,y}=c;return{rings:[[[p-1,y],[1,-1],[1,1],[-1,1],[-1,-1]]]}}}return c}case"esriGeometryPolyline":{const a=s;sPt(nee),sPt(NNe);const l=a.hasZ??!1,c=a.hasM??!1;return ETe(nee,a),WJe(NNe,nee,l,c,nPt,e.scale[0]),jA(nee,NNe,l,c,nPt,e),Dae(nee,a.hasZ??!1,a.hasM??!1)}case"esriGeometryMultipoint":{const a=s,l=.5*n*Math.max(Math.abs(this.size[0])+this.size[2]-this.size[0],Math.abs(this.size[1])+this.size[3]-this.size[1]),c=vd(r);let h=a.points;if(c){const[p,y]=c.valid,v=y-p;h=h.filter(x=>{if(x[0]+l>y||x[0]-ly?I[0]-=v:I[0]+=v,ese(i,x,l)||ese(i,I,l)}return ese(i,x,l)})}return h.length===0?{points:h}:vJ(e,{points:h})}}return vJ(e,this.geometry)}};see._pool=[],see._set=new Set;const oee={minX:0,minY:0,maxX:0,maxY:0},jU=Mo(),oPt=1e-5;function Cge(t,e,i,r,n){return oee.minX=e,oee.minY=i,oee.maxX=r,oee.maxY=n,t.search(oee)}function osr(t){return{minX:t.bounds[0],minY:t.bounds[1],maxX:t.bounds[2],maxY:t.bounds[3]}}let asr=class{constructor(e,i,r,n,s,o,a){this._graphics=n,this._onAdd=s,this._onRemove=o,this._hashToCIM=a,this._index=AN(9,osr),this._itemByGraphic=new Map,this._inflatedSizeHelper=new xCt,this._tileInfoView=e,this._uidFieldName=r;const l=e.getClosestInfoForScale(i);l&&(this._resolution=this._tileInfoView.getTileResolution(l.level))}setResourceManager(e){this._cimResourceManager=e,this._hittestDrawHelper=new JYi(e)}hitTest(e,i,r,n,s){e=_Ce(e,this._tileInfoView.spatialReference);const o=.5*n*window.devicePixelRatio*r;jU[0]=e-o,jU[1]=i-o,jU[2]=e+o,jU[3]=i+o;const a=.5*n*(r+IO),l=Cge(this._index,e-a,i-a,e+a,i+a);if(!l||l.length===0)return[];const c=[],h=Mo(),p=Mo();for(const x of l){const{geometry:I,symbolResource:P}=x;this._getSymbolBounds(h,P,I,p,s),p[3]=p[2]=p[1]=p[0]=0,tse(h,jU)&&x.graphic?.visible&&c.push(x)}if(c.length===0)return[];const y=this._hittestDrawHelper,v=[];for(const x of c){const{geometry:I,symbolResource:P}=x,{hash:F,textInfo:k}=P,j=this._hashToCIM.get(F);j&&y.hitTest(jU,j.symbol,I,k,s,n)&&v.push(x)}return v.sort(lsr),v.map(x=>x.graphic)}getGraphicsData(e,i,r){const n=this._searchForItems(i);if(n.length===0||r.length===0)return[];n.sort((p,y)=>p.zorder-y.zorder),n[0].insertAfter=-1;for(let p=1;pp.graphic.uid-y.graphic.uid),r.sort((p,y)=>p.uid-y.uid);let s,o=0,a=0;const l=i.resolution,c=[],h={originPosition:"upperLeft",scale:[l,l],translate:[i.bounds[0],i.bounds[3]]};for(const p of r){for(a=-2;op.zorder-y.zorder),c}queryTileData(e,i){if(this._graphics.length===0)return[];const{bounds:r,resolution:n}=i,s=this._searchForItems(i),o=[];return s.length===0||this._createTileGraphics(o,e,s,{originPosition:"upperLeft",scale:[n,n],translate:[r[0],r[3]]},i),o}has(e){return this._itemByGraphic.has(e)}getBounds(e){const i=this._itemByGraphic.get(e);return i?i.bounds:null}getAllBounds(){return Array.from(this._itemByGraphic.values()).filter(e=>e.graphic.visible).map(e=>e.bounds)}addOrModify(e,i,r){if(!e||lt(i))return;this.has(e)&&this.remove(e),this._onAdd(e);const n=[0,0,0,0],s=this._getSymbolBounds(null,i,r,n,0),o=see.acquire(e,i,r,ve(s)?s:null,n);return this._itemByGraphic.set(e,o),r&&this._index.insert(o),o.bounds}remove(e){if(!this._itemByGraphic.has(e))return;this._onRemove(e);const i=this._itemByGraphic.get(e);i?.bounds&&this._index.remove(i),this._itemByGraphic.delete(e)}updateZ(){const e=this._graphics.items;let i,r;for(let n=0;nx.zorder-I.zorder);for(let x=0;x{const i=XAt(t.graphic),r=XAt(e.graphic);return i===r?e.zorder-t.zorder:i-r},usr=t=>{let e=class extends D1(t){constructor(){super(...arguments),this.graphics=null,this.renderer=null}};return E([N()],e.prototype,"graphics",void 0),E([N()],e.prototype,"renderer",void 0),E([N()],e.prototype,"updating",void 0),E([N()],e.prototype,"view",void 0),e=E([dt("esri.views.layers.GraphicsView")],e),e},csr=Hi("esri-2d-graphic-debug");function kNe(t,e,i){let r=i.get(t);return r||(r={tile:e,addedOrModified:[],removed:[]},i.set(t,r)),r}let qE=class extends usr(Ud(Tn)){constructor(e){super(e),this._storage=new __t,this._displayIds=new Map,this._controller=new AbortController,this._tiles=new Map,this._graphicStoreUpdate=!1,this._graphicsSet=new Set,this._matcher=Promise.resolve(null),this._tileUpdateSet=new Set,this._tilesToUpdate=new Map,this._graphicIdToAbortController=new Map,this._attached=!1,this._updatingGraphicsTimer=null,this._hashToExpandedSymbol=new Map,this._hashToExpandedSymbolPromise=new Map,this._hashToCIMSymbolPromise=new Map,this._hashToCIM=new Map,this._processing=!1,this._needsProcessing=!1,this._pendingUpdate={added:new Set,updated:new Set,removed:new Set},this.lastUpdateId=-1,this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this._updatingGraphicsTimer&&(clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=null,this.notifyChange("updating")),this._controller.abort(),this.container.destroy(),this._set("graphics",null),this._graphicStore.clear(),this._attributeStore=null,this._hashToExpandedSymbol.clear(),this.view=null,this.renderer=null,this._hashToCIM.clear(),this._hashToCIMSymbolPromise.clear(),this._hashToExpandedSymbolPromise.clear()}_createMatcher(e,i,r){if(e){const n=ree(e),s=Sge({indexCount:0,fields:{}},"feature",e,n);this._matcher=_ge(s,i,null,r)}}_createDisplayId(e){let i=this._displayIds.get(e);return i||(i=this._storage.createDisplayId(),this._displayIds.set(e,i)),i}initialize(){this._attributeStore=new f_t({type:"local",initialize:s=>Promise.resolve(this.container.attributeView.initialize(s)),update:s=>this.container.attributeView.requestUpdate(s),render:()=>this.container.requestRender()},ST("2d"),()=>this.notifyChange("updating")),this.container.hasHighlight=()=>this._attributeStore.hasHighlight;const e=s=>{this._createDisplayId(s.uid),this._setFilterState(s.uid,s.visible)},i=s=>{const o=this._displayIds.get(s.uid);this._displayIds.delete(s.uid),this._storage.releaseDisplayId(o)},r=new HAt(this.container.getMaterialItems.bind(this.container),this.view.featuresTilingScheme.tileInfo);this._graphicStore=new asr(this.view.featuresTilingScheme,this.view.state.scale,this.uid,this.graphics,e,i,this._hashToCIM),this._meshFactory=new WAt(null,this.uid,r),this._templateStore=r,this.handles.add([sr(()=>this.renderer,s=>{this._createMatcher(s,r,this.container.stage.resourceManager);for(const o of this.graphics)this._pendingUpdate.updated.add(o);this.requestUpdate()}),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{csr&&this.container.enableRenderingBounds(()=>this._graphicStore.getAllBounds()),this.graphics.items.length>0&&this._graphicsChangeHandler({target:this.graphics,added:this.graphics.items,removed:[],moved:[]}),this.handles.add(this.graphics.on("change",o=>this._graphicsChangeHandler(o)),"graphics");const s=this.container.stage.resourceManager;this._createMatcher(this.renderer,r,s),this._graphicStore.setResourceManager(s),this._attached=!0,this.notifyChange("updating")})]);const n=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:n,removed:[]})}get updating(){return!this._attached||this._updatingGraphicsTimer!==null||this._tileUpdateSet.size>0||this._tilesToUpdate.size>0||this._attributeStore.isUpdating()}hitTest(e){if(!this.view||!this.view.position)return[];const{resolution:i,rotation:r}=this.view.state;return this._graphicStore.hitTest(e.x,e.y,2,i,r)}update(e){yn(this._controller.signal);const i=e.state,{resolution:r}=i;if(this._graphicStore.updateLevel(r),this._graphicStoreUpdate=!0,this.updateRequested=!1,this._pendingUpdate.updated.size>0){if(!this._processing)return void this._updateGraphics();this._needsProcessing=!0}}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback())}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}graphicUpdateHandler(e){const{graphic:i,property:r}=e;switch(r){case"attributes":case"geometry":case"symbol":this._pendingUpdate.updated.add(i),this.requestUpdate();break;case"visible":this._setFilterState(i.uid,i.visible),this._attributeStore.sendUpdates()}}setHighlight(e){const i=e.map(r=>this._displayIds.get(r)).filter(ve);this._attributeStore.setHighlight(e,i)}_getIntersectingTiles(e){const i=this._graphicStore.getBounds(e);if(!i||f7e(i)===0||m7e(i)===0)return[];const r=Pnr(i,this.view.spatialReference);return ve(r)?[...new Set([...this.view.graphicsTileStore.boundsIntersections(r[0]),...this.view.graphicsTileStore.boundsIntersections(r[1])])]:this.view.graphicsTileStore.boundsIntersections(i)}async _updateTile(e){yn(this._controller.signal);const i=e.tile,r=this._getGraphicsData(this._templateStore,i,e.addedOrModified),n=await this._processGraphics(i,r);return yn(this._controller.signal),this._patchTile(i.key,{type:"update",addOrUpdate:n,remove:e.removed,end:!0,clear:!1,sort:!1}),n}_patchTile(e,i){const r=this._tiles.get(e);r&&(this.container.onTileData(r,i),this.container.requestRender())}_graphicsChangeHandler(e){const i=this._pendingUpdate;for(const r of e.added)i.added.add(r);for(const r of e.moved)i.updated.add(r);for(const r of e.removed)this._pendingUpdate.added.has(r)?i.added.delete(r):i.removed.add(r);this._processing?this._needsProcessing=!0:this._updateGraphics()}_getGraphicsToUpdate(){const e={added:[],removed:[],updated:[]};if(!this.graphics)return e;const i=this._pendingUpdate;for(const r of this.graphics.items)i.added.has(r)?e.added.push(r):i.updated.has(r)&&e.updated.push(r);for(const r of i.removed)this._graphicStore.has(r)&&e.removed.push(r);return i.added.clear(),i.removed.clear(),i.updated.clear(),e}async _updateGraphics(){this._processing=!0;const{added:e,removed:i,updated:r}=this._getGraphicsToUpdate(),n=this._tilesToUpdate;let s;try{if(!this._graphicStoreUpdate){const p=this.view.state,{resolution:y}=p;this._graphicStore.updateLevel(y)}const o=[],a=new Array(e.length+i.length);for(let p=0;p({name:r,alias:r,type:typeof e.attributes[r]=="string"?"esriFieldTypeString":"esriFieldTypeDouble"}));return lt(e.geometry)?null:{geometryType:bd(e.geometry),spatialReference:hr.fromJSON(e.geometry.spatialReference),fields:i}}_getSymbolForGraphic(e,i){return yn(this._controller.signal),ve(e.symbol)?Promise.resolve(e.symbol):ve(this.renderer)?this.renderer.getSymbolAsync(e,{scale:this.view.scale,signal:ve(i)?i.signal:null}):Promise.resolve(this._getNullSymbol(e))}_getCIMSymbol(e,i,r){let n=this._hashToCIM.get(i);if(n)return Promise.resolve(n);const s=aXi(e);if(ve(s)){if(s.type==="CIMSymbolReference")return n=s,this._hashToCIM.set(i,n),Promise.resolve(n);let o=this._hashToCIMSymbolPromise.get(i);return o||(o=s.fetchCIMSymbol(r).then(a=>(this._hashToCIM.set(i,a.data),this._hashToCIMSymbolPromise.delete(i),a)).catch(a=>(this._hashToCIMSymbolPromise.delete(i),Ya(a),null)),this._hashToCIMSymbolPromise.set(i,o),o)}return Promise.resolve(null)}_expandCIMSymbol(e,i,r,n){const s=this._hashToExpandedSymbol.get(r);if(s)return Promise.resolve(s);let o=this._hashToExpandedSymbolPromise.get(r);if(o)return o;const a=this.container.stage,l=this._getArcadeInfo(i),c=ree(null),h=e1(e,c);return o=PS(h,l,a.resourceManager,n),this._hashToExpandedSymbolPromise.set(r,o),o.then(p=>(this._hashToExpandedSymbol.set(r,p),this._hashToExpandedSymbolPromise.delete(r),p)),o}async _getSymbolResources(e,i){return yn(this._controller.signal),this.container.stage?this._getSymbolForGraphic(e,i).then(r=>{if(!r)return null;const n=r.hash();return this._getCIMSymbol(r,n,i).then(s=>lt(s)?null:this._expandCIMSymbol(s,e,n,i).then(o=>{const a=o.layers.filter(l=>l.type==="text"&&typeof l.text=="string");if(a&&a.length>0){const l=new Array(a.length);for(let h=0;h{sg(h);for(let p=0;p(Ya(r),null)):null}async _projectAndNormalizeGeometry(e,i){if(yn(this._controller.signal),lt(e.geometry)||e.geometry.type==="mesh")return null;let r=e.geometry;if(Xa(r)){const o=r.rings;r.rings=o}else if(Hu(r)){const o=r.paths;r.paths=o}else if(mc(r)){const o=await this._getSymbolForGraphic(e,i);yn(this._controller.signal),o&&(Rnr(o.type)||Onr(o.type))?r=r.center:r=Mnr(r)}await hy(r.spatialReference,this.view.spatialReference);const n=$ir(r),s=wp(n,r.spatialReference,this.view.spatialReference);return s&&eBt(s),s}_onTileUpdate(e){const i=vd(this.view.spatialReference);if(e.added&&e.added.length>0)for(const r of e.added)this._addNewTile(r,i);if(e.removed&&e.removed.length>0)for(const r of e.removed)this._removeTile(r.key)}async _addGraphic(e){this._abortProcessingGraphic(e.uid),yn(this._controller.signal);const i=new AbortController;this._graphicIdToAbortController.set(e.uid,i);const r={signal:i.signal};try{await this._addOrUpdateGraphic(e,r),yn(this._controller.signal),this._graphicIdToAbortController.delete(e.uid)}catch(n){if(this._graphicIdToAbortController.delete(e.uid),!ys(n))throw n}}_updateGraphic(e,i){yn(this._controller.signal);const r=this._projectAndNormalizeGeometry(e,i),n=this._getSymbolResources(e,i);return Promise.all([r,n]).then(([s,o])=>{yn(this._controller.signal),this._graphicStore.addOrModify(e,o,s)})}_addOrUpdateGraphic(e,i){yn(this._controller.signal);const r=this._projectAndNormalizeGeometry(e,i),n=this._getSymbolResources(e,i);return Promise.all([r,n]).then(([s,o])=>{yn(this._controller.signal),this._graphicsSet.has(e)&&this._graphicStore.addOrModify(e,o,s)})}_addTile(e){const i=this.view.featuresTilingScheme.getTileBounds(Mo(),e),r=this.view.featuresTilingScheme.getTileResolution(e.level),n=new qir(e,r,i[0],i[3]);return this._tiles.set(e,n),this.container.addChild(n),n}async _addNewTile(e,i){const r=this._addTile(e.key),n=this._graphicStore.queryTileData(this._templateStore,e);if(n.length===0)return;if(i){const o=Math.round((i.valid[1]-i.valid[0])/e.resolution);for(const a of n)a.geometry&&(qy(a.geometry)||lg(a.geometry))&&this._wrapPoints(a,o)}const s=e.key;this._tileUpdateSet.add(e.key),this.notifyChange("updating");try{const o={type:"update",clear:!1,addOrUpdate:await this._processGraphics(e,n),remove:[],end:!0,sort:!1};r.patch(o),this._tileUpdateSet.delete(s),this.notifyChange("updating")}catch(o){if(this._tileUpdateSet.delete(s),this.notifyChange("updating"),!ys(o))throw o}}_removeTile(e){if(!this._tiles.has(e))return;const i=this._tiles.get(e);this.container.removeChild(i),i.destroy(),this._tiles.delete(e)}_setFilterState(e,i){const r=this._displayIds.get(e),n=this._attributeStore.getHighlightFlag(e);this._attributeStore.setData(r,0,0,n|(i?cvt:0))}_getGraphicsData(e,i,r){const n=this.view,s=vd(n.spatialReference),o=this._graphicStore.getGraphicsData(e,i,r);if(s){const a=Math.round((s.valid[1]-s.valid[0])/i.resolution);for(const l of o)l.geometry&&(qy(l.geometry)||lg(l.geometry))&&this._wrapPoints(l,a)}return o}_wrapPoints(e,i){const r=e.geometry;lg(r)?this._wrapMultipoint(r,i):this._wrapPoint(e,i)}_wrapMultipoint(e,i){const r=e.points,n=[];let s=0,o=0;for(const[a,l]of r){if(n.push([a+s,l]),s=0,i===BU){const c=5*IO;a+oBU-c&&(n.push([-i,0]),s=i)}else a+o<-IO?(n.push([i,0]),s=-i):a+o>BU+IO&&(n.push([-i,0]),s=i);o+=a}e.points=n}_wrapPoint(e,i){const r=e.geometry;if(i===BU){const n=5*IO;r.xBU-n&&(e.geometry={points:[[r.x,r.y],[-i,0]]})}else r.x<-IO?e.geometry={points:[[r.x,r.y],[i,0]]}:r.x>BU+IO&&(e.geometry={points:[[r.x,r.y],[-i,0]]})}_processGraphics(e,i,r){if(!(i&&i.length)||!this._meshFactory)return Promise.resolve(null);const n=ssr.from(i,this.uid,e.transform),s=this._meshFactory;return this._matcher.then(o=>s.analyzeGraphics(n,this.container.stage.resourceManager,o,null,null,r).then(()=>(this._attributeStore.sendUpdates(),this._processAnalyzedGraphics(e,n))))}_processAnalyzedGraphics(e,i){const r=this._meshFactory,n=i.getSize(),s=i.getCursor(),o={features:n,records:n,metrics:0},a=new gAt(e.key.id,o,sa.DEFAULT,!1,!1),l=[];for(;s.next();){const y=s.readGraphic();y.insertAfter=y.insertAfter===-1?-1:this._displayIds.get(y.insertAfter),y.displayId=this._displayIds.get(y.attributes[this.uid]);const v=new nAt(y.displayId);v.insertAfter=y.insertAfter,l.push(v),r.writeGraphic(a,s,e.level,this.container.stage.resourceManager)}const c=e.tileInfoView.tileInfo.isWrappable,h=a.serialize(c);if(h.length!==1)return new lAt;const p=h[0].message;return lAt.fromVertexData(p,l)}_abortProcessingGraphic(e){this._graphicIdToAbortController.get(e)?.abort()}_getNullSymbol(e){const i=e.geometry;return Hu(i)?$Wt:Xa(i)||mc(i)?BWt:this.defaultPointSymbolEnabled?kWt:null}_flipUpdatingGraphics(){this._updatingGraphicsTimer&&clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=setTimeout(()=>{this._updatingGraphicsTimer=null,this.notifyChange("updating")},160),this.notifyChange("updating")}};E([N({constructOnly:!0})],qE.prototype,"requestUpdateCallback",void 0),E([N()],qE.prototype,"container",void 0),E([N({constructOnly:!0})],qE.prototype,"graphics",void 0),E([N()],qE.prototype,"updating",null),E([N()],qE.prototype,"view",void 0),E([N()],qE.prototype,"updateRequested",void 0),E([N()],qE.prototype,"defaultPointSymbolEnabled",void 0),qE=E([dt("esri.views.2d.layers.support.GraphicsView2D")],qE);const gx=qE,$Ne=Oi.getLogger("esri.views.2d.engine.webgl.AttributeStoreView"),BNe=l_t(u_t,$Ne);let aPt=class{constructor(e,i,r){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:n,pixelType:s,textureOnly:o}=e,a=$J(s);this.shared=r,this.pixelType=s,this.size=i,this.textureOnly=o,o||(this.data=new a(n)),this._resetRange()}destroy(){Pa(this._texture,e=>e.dispose());for(const e in this._fbos)Pa(this._fbos[e],i=>{e==="0"&&i.detachColorTexture(),i.dispose()}),this._fbos[e]=null;this._texture=null}get _textureDesc(){return{target:so.TEXTURE_2D,wrapMode:ws.CLAMP_TO_EDGE,pixelFormat:gn.RGBA,dataType:this.pixelType,samplingMode:In.NEAREST,width:this.size,height:this.size}}setData(e,i,r){const n=eO(e),s=this.data,o=n*this.texelSize+i;!s||o>=s.length||(s[o]=r,this.dirtyStart=Math.min(this.dirtyStart,n),this.dirtyEnd=Math.max(this.dirtyEnd,n))}getData(e,i){if(lt(this.data))return null;const r=eO(e)*this.texelSize+i;return!this.data||r>=this.data.length?null:this.data[r]}getTexture(e){return zu(this._texture,()=>this._initTexture(e))}getFBO(e,i=0){if(lt(this._fbos[i])){const r={colorTarget:Ah.TEXTURE,depthStencilTarget:Tl.NONE},n=i===0?this.getTexture(e):this._textureDesc;this._fbos[i]=new ad(e,r,n)}return this._fbos[i]}get locked(){return!(this.pixelType!==ds.UNSIGNED_BYTE||!this.shared||this.textureOnly||!Hi("esri-atomics")||!this.data)&&Atomics.load(this.data,0)===1}get hasDirty(){const e=this.dirtyStart;return this.dirtyEnd>=e}updateTexture(e,i){if(!this.locked){try{const r=this.dirtyStart,n=this.dirtyEnd;if(!this.hasDirty)return;this._resetRange();const s=this.data.buffer,o=this.getTexture(e),a=4,l=(r-r%this.size)/this.size,c=(n-n%this.size)/this.size,h=l,p=this.size,y=c,v=l*this.size*a,x=(p+y*this.size)*a-v,I=$J(this.pixelType),P=new I(s,v*I.BYTES_PER_ELEMENT,x),F=this.size,k=y-h+1;if(k>this.size)return void $Ne.error(new st("mapview-webgl","Out-of-bounds index when updating AttributeData"));o.updateData(0,0,h,F,k,P)}catch{}i()}}update(e){const{data:i,start:r,end:n}=e;if(ve(i)&&ve(this.data)){const s=this.data,o=r*this.texelSize;for(let a=0;anew aPt(s,n,r));else for(let s=0;sy_e(e,i=>i.destroy())),Pa(this._defaultTexture,e=>e.dispose())}isEmpty(){const e=this._data;return lt(e)}isUpdating(){const e=ve(this._pendingAttributeUpdate),i=e;return Hi("esri-2d-log-updating")&&console.log(`Updating AttributeStoreView ${i} + -> hasPendingUpdate ${e}`),i}getBlock(e){return lt(this._data)?null:this._data[e]}setLabelMinZoom(e,i){this.setData(e,0,1,i)}getLabelMinZoom(e){return this.getData(e,0,1,255)}getFilterFlags(e){return this.getData(e,0,0,0)}getVVSize(e){return this.getData(e,mFe,0,0)}getData(e,i,r,n){if(!this._data)return 0;const s=this._data[i];if(lt(s))return 0;const o=s.getData(e,r);return ve(o)?o:n}setData(e,i,r,n){const s=this._data[i];s.setData(e,r,n)}lockTextureUpload(){this._locked=!0}unlockTextureUpload(){this._locked=!1}forceTextureUpload(){this._forceNextUpload=!0}async requestUpdate(e){if(this._pendingAttributeUpdate)return void $Ne.error(new st("mapview-webgl","Tried to update attribute data with a pending update"));const i=kf();return BNe("AttributeStoreView Update Requested",e),this._pendingAttributeUpdate={data:e,resolver:i},this._onUpdate(),i.promise}update(){if(this._initialized&&ve(this._pendingAttributeUpdate)){Hi("esri-2d-update-debug")&&console.debug("AttributeStoreView::update");const{data:e,resolver:i}=this._pendingAttributeUpdate,r=this._data;for(let n=0;nPa(s,l=>{BNe(`Updating block ${n}`,l),a.update(l)}))}this._pendingAttributeUpdate=null,i(),this._onUpdate()}}bindTextures(e,i=!0){const r=this._getDefaultTexture(e);if(!this._initialized)return e.bindTexture(r,jpe),void(i&&(e.bindTexture(r,Gpe),e.bindTexture(r,dFe),e.bindTexture(r,pFe),e.bindTexture(r,Upe),e.bindTexture(r,zpe),e.bindTexture(r,avt)));const n=this._data;this._locked&&!this._forceNextUpload||(tVe(n,s=>s.updateTexture(e,()=>this._onUpdate())),this._forceNextUpload=!1),e.bindTexture(Hv(n[eNi],r,s=>s.getTexture(e)),jpe),i&&(e.bindTexture(Hv(n[Hpe],r,s=>s.getTexture(e)),avt),e.bindTexture(Hv(n[fFe],r,s=>s.getTexture(e)),Gpe),e.bindTexture(Hv(n[mFe],r,s=>s.getTexture(e)),dFe),e.bindTexture(Hv(n[tNi],r,s=>s.getTexture(e)),pFe),e.bindTexture(Hv(n[Upe],r,s=>s.getTexture(e)),Upe),e.bindTexture(Hv(n[zpe],r,s=>s.getTexture(e)),zpe))}_getDefaultTexture(e){if(lt(this._defaultTexture)){const i={wrapMode:ws.CLAMP_TO_EDGE,pixelFormat:gn.RGBA,dataType:ds.UNSIGNED_BYTE,samplingMode:In.NEAREST,width:1,height:1};this._defaultTexture=new Fs(e,i,new Uint8Array(4))}return this._defaultTexture}};const dsr=t=>{switch(t.BYTES_PER_ELEMENT){case 1:return Bi.UNSIGNED_BYTE;case 2:return Bi.UNSIGNED_SHORT;case 4:return Bi.UNSIGNED_INT;default:throw new st("Cannot get DataType of array")}},psr=(t,e,i,r)=>{let n=0;for(let s=1;s0:n<0},lPt=({coords:t,lengths:e},i)=>{const r=[];for(let n=0,s=0;n({...r,[n]:aa.createVertex(e,i,this.vertices[n])}),{})),this._cache.vertexBuffers}};const Ege=t=>parseFloat(t)/100;let fsr=class dNt extends CS{constructor(e,i){super(),this._clip=i,this._cache={},this.stage=e,this._handle=sr(()=>i.version,()=>this._invalidate()),this.ready()}static fromClipArea(e,i){return new dNt(e,i)}_destroyGL(){ve(this._cache.mesh)&&(this._cache.mesh.destroy(),this._cache.mesh=null),ve(this._cache.vao)&&(this._cache.vao.dispose(),this._cache.vao=null)}destroy(){this._destroyGL(),this._handle.remove()}getVAO(e,i,r,n){const[s,o]=i.size;if(this._clip.type!=="geometry"&&this._lastWidth===s&&this._lastHeight===o||(this._lastWidth=s,this._lastHeight=o,this._destroyGL()),lt(this._cache.vao)){const a=this._createMesh(i,this._clip),l=a.getIndexBuffer(e),c=a.getVertexBuffers(e);this._cache.mesh=a,this._cache.vao=new Mc(e,r,n,c,l)}return this._cache.vao}_createTransforms(){return{dvs:Dl()}}_invalidate(){this._destroyGL(),this.requestRender()}_createScreenRect(e,i){const[r,n]=e.size,s=typeof i.left=="string"?Ege(i.left)*r:i.left,o=typeof i.right=="string"?Ege(i.right)*r:i.right,a=typeof i.top=="string"?Ege(i.top)*n:i.top,l=typeof i.bottom=="string"?Ege(i.bottom)*n:i.bottom,c=s,h=a;return{x:c,y:h,width:Math.max(r-o-c,0),height:Math.max(n-l-h,0)}}_createMesh(e,i){switch(i.type){case"rect":return Tge.fromRect(this._createScreenRect(e,i));case"path":return Tge.fromPath(i);case"geometry":return Tge.fromGeometry(e,i);default:return Oi.getLogger("esri.views.2d.engine.webgl.ClippingInfo").error(new st("mapview-bad-type","Unable to create ClippingInfo mesh from clip of type: ${clip.type}")),Tge.fromRect({x:0,y:0,width:1,height:1})}}},GU=class extends CU{constructor(){super(...arguments),this.name=this.constructor.name}set clips(e){this._clips=e,this.children.forEach(i=>i.clips=e),this._updateClippingInfo()}beforeRender(e){super.beforeRender(e),this.updateTransforms(e.state)}_createTransforms(){return{dvs:Dl()}}doRender(e){const i=this.createRenderParams(e),{painter:r,globalOpacity:n,profiler:s,drawPhase:o}=i,a=o===mo.LABEL||o===mo.HIGHLIGHT?1:n*this.computedOpacity;s.recordContainerStart(this.name),r.beforeRenderLayer(i,this._clippingInfos?255:0,a),this.renderChildren(i),r.compositeLayer(i,a),s.recordContainerEnd()}renderChildren(e){lt(this._renderPasses)&&(this._renderPasses=this.prepareRenderPasses(e.painter));for(const i of this._renderPasses)try{i.render(e)}catch{}}createRenderParams(e){return e.requireFBO=this.requiresDedicatedFBO,e}prepareRenderPasses(e){return[e.registerRenderPass({name:"clip",brushes:[ph.clip],target:()=>this._clippingInfos,drawPhase:mo.MAP|mo.LABEL|mo.LABEL_ALPHA|mo.DEBUG|mo.HIGHLIGHT})]}updateTransforms(e){for(const i of this.children)i.setTransform(e)}onAttach(){super.onAttach(),this._updateClippingInfo()}onDetach(){super.onDetach(),this._updateClippingInfo()}_updateClippingInfo(){ve(this._clippingInfos)&&(this._clippingInfos.forEach(r=>r.destroy()),this._clippingInfos=null);const e=this.stage;if(!e)return;const i=this._clips;ve(i)&&i.length&&(this._clippingInfos=i.items.map(r=>fsr.fromClipArea(e,r))),this.requestRender()}};const msr=(t,e)=>t.key.level-e.key.level!=0?t.key.level-e.key.level:t.key.row-e.key.row!=0?t.key.row-e.key.row:t.key.col-e.key.col;let aee=class extends GU{constructor(e){super(),this._tileInfoView=e}get requiresDedicatedFBO(){return!1}renderChildren(e){this.sortChildren(msr),this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:i}=e,r=super.createRenderParams(e);return r.requiredLevel=this._tileInfoView.getClosestInfoForScale(i.scale).level,r.displayLevel=this._tileInfoView.tileInfo.scaleToZoom(i.scale),r}prepareRenderPasses(e){const i=super.prepareRenderPasses(e);return i.push(e.registerRenderPass({name:"stencil",brushes:[QEt],drawPhase:mo.DEBUG|mo.MAP|mo.HIGHLIGHT,target:()=>this.getStencilTarget()})),Hi("esri-tiles-debug")&&i.push(e.registerRenderPass({name:"tileInfo",brushes:[ZEt],drawPhase:mo.DEBUG,target:()=>this.children})),i}getStencilTarget(){return this.children}setStencilReference(e){let i=1;for(const r of this.children)r.stencilRef=i++}};function VNe(t,e){const i=e.length;if(t{let r=1/0,n=0;for(const l in i.levels){const c=parseFloat(l),h=Math.abs(e-c);hthis.onAttributeStoreUpdate())}destroy(){this.children.forEach(e=>e.destroy()),this.removeAllChildren(),this.attributeView.destroy(),this._materialItemsRequestQueue.clear()}setRendererInfo(e,i,r){this._rendererInfo.setInfo(e,i,r),this.requestRender()}async getMaterialItems(e,i){if(!e||e.length===0)return[];const r=kf();return this._materialItemsRequestQueue.push({items:e,abortOptions:i,resolver:r}),this.requestRender(),r.promise}doRender(e){if(e.context.capabilities.enable("textureFloat"),e.context.capabilities.enable("vao"),this._materialItemsRequestQueue.length>0){let i=this._materialItemsRequestQueue.pop();for(;i;)this._processMaterialItemRequest(e,i),i=this._materialItemsRequestQueue.pop()}super.doRender(e)}renderChildren(e){for(const i of this.children)i.commit(e);this._rendererInfo.update(e.state),super.renderChildren(e)}updateTransforms(e){if(this.children.some(i=>i.hasData))for(const i of this.children)i.setTransform(e)}createRenderParams(e){const i=super.createRenderParams(e);return i.rendererInfo=this._rendererInfo,i.attributeView=this.attributeView,i}onAttributeStoreUpdate(){}_processMaterialItemRequest(e,{items:i,abortOptions:r,resolver:n}){const{painter:s,pixelRatio:o}=e,a=i.map(l=>s.textureManager.rasterizeItem(l.symbol,o,l.glyphIds,r));Promise.all(a).then(l=>{if(!this.stage)return void n.reject();const c=l.map((h,p)=>({id:i[p].id,mosaicItem:h}));n.resolve(c)},n.reject)}};const ysr=Math.PI/180,vsr=4;let _sr=class extends CS{constructor(e){super(),this._program=null,this._vao=null,this._vertexBuffer=null,this._indexBuffer=null,this._dvsMat3=Dl(),this._localOrigin={x:0,y:0},this._getBounds=e}destroy(){this._vao&&(this._vao.dispose(!0),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program=qa(this._program)}doRender(e){const{context:i}=e,r=this._getBounds();if(r.length<1)return;this._createShaderProgram(i),this._updateMatricesAndLocalOrigin(e),this._updateBufferData(i,r),i.setBlendingEnabled(!0),i.setDepthTestEnabled(!1),i.setStencilWriteMask(0),i.setStencilTestEnabled(!1),i.setBlendFunction(Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA),i.setColorMask(!0,!0,!0,!0);const n=this._program;i.bindVAO(this._vao),i.useProgram(n),n.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),i.gl.lineWidth(1),i.drawElements(bs.LINES,8*r.length,Bi.UNSIGNED_INT,0),i.bindVAO()}_createTransforms(){return{dvs:Dl()}}_createShaderProgram(e){if(this._program)return;const i=`precision highp float; uniform mat3 u_dvsMat3; attribute vec2 a_position; @@ -5018,90 +5022,86 @@ ${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(i,r,SAt().attributes)}_updateMatricesAndLocalOrigin(e){const{state:i}=e,{displayMat3:r,size:n,resolution:s,pixelRatio:o,rotation:a,viewpoint:l}=i,c=pnr*a,{x:d,y:p}=l.targetGeometry,y=mCe(d,i.spatialReference);this._localOrigin.x=y,this._localOrigin.y=p;const v=o*n[0],S=o*n[1],I=s*v,O=s*S,L=rP(this._dvsMat3);ov(L,L,r),ug(L,L,lp(v/2,S/2)),nP(L,L,tO(n[0]/I,-S/O,1)),ST(L,L,-c)}_updateBufferData(e,i){const{x:r,y:n}=this._localOrigin,s=2*fnr*i.length,o=new Float32Array(s),a=new Uint32Array(8*i.length);let l=0,c=0;for(const d of i)d&&(o[2*l+0]=d[0]-r,o[2*l+1]=d[1]-n,o[2*l+2]=d[0]-r,o[2*l+3]=d[3]-n,o[2*l+4]=d[2]-r,o[2*l+5]=d[3]-n,o[2*l+6]=d[2]-r,o[2*l+7]=d[1]-n,a[c+0]=l+0,a[c+1]=l+3,a[c+2]=l+3,a[c+3]=l+2,a[c+4]=l+2,a[c+5]=l+1,a[c+6]=l+1,a[c+7]=l+0,l+=4,c+=8);if(this._vertexBuffer?this._vertexBuffer.setData(o.buffer):this._vertexBuffer=Ko.createVertex(e,Lo.DYNAMIC_DRAW,o.buffer),this._indexBuffer?this._indexBuffer.setData(a):this._indexBuffer=Ko.createIndex(e,Lo.DYNAMIC_DRAW,a),!this._vao){const d=SAt();this._vao=new Ac(e,d.attributes,d.bufferLayouts,{geometry:this._vertexBuffer},this._indexBuffer)}}};const SAt=()=>QP("bounds",{geometry:[{location:0,name:"a_position",count:2,type:Di.FLOAT}]});let CAt=class extends xAt{constructor(e){super(e),this.hasHighlight=()=>!0}destroy(){super.destroy(),this._boundsRenderer=ra(this._boundsRenderer)}enableRenderingBounds(e){this._boundsRenderer=new mnr(e),this.requestRender()}get hasLabels(){return!1}onTileData(e,i){e.patch(i),this.contains(e)||this.addChild(e),this.requestRender()}onTileError(e){e.clear(),this.contains(e)||this.addChild(e)}_renderChildren(e,i){for(const r of this.children)r.isReady&&r.hasData&&(r.commit(e),e.context.setStencilFunction(El.EQUAL,r.stencilRef,255),r.getDisplayList().replay(e,r,i))}},TO=class extends CAt{renderChildren(e){this.attributeView.update(),this.children.some(i=>i.hasData)&&(this.attributeView.bindTextures(e.context,!1),super.renderChildren(e),e.drawPhase===io.MAP&&this._renderChildren(e),this.hasHighlight()&&e.drawPhase===io.HIGHLIGHT&&this._renderHighlight(e),this._boundsRenderer&&this._boundsRenderer.doRender(e))}_renderHighlight(e){const{painter:i}=e,r=i.effects.highlight;r.bind(e),this._renderChildren(e,r.defines),r.draw(e),r.unbind()}};const ige="esri-zoom-box",rge={container:`${ige}__container`,overlay:`${ige}__overlay`,background:`${ige}__overlay-background`,box:`${ige}__outline`},_ke={zoom:"Shift",counter:"Ctrl"};let ree=class extends fn{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._handles=null,this._redraw=this._redraw.bind(this)}destroy(){this.view=null}set view(e){this._handles&&this._handles.forEach(i=>{i.remove()}),this._handles=null,this._destroyOverlay(),this._set("view",e),e&&(e.on("drag",[_ke.zoom],i=>this._handleDrag(i,1),_T.INTERNAL),e.on("drag",[_ke.zoom,_ke.counter],i=>this._handleDrag(i,-1),_T.INTERNAL))}_start(){this._createContainer(),this._createOverlay(),this.navigation.begin()}_update(e,i,r,n){this._box.x=e,this._box.y=i,this._box.width=r,this._box.height=n,this._rafId||(this._rafId=requestAnimationFrame(this._redraw))}_end(e,i,r,n,s){const o=this.view,a=o.toMap(Vh(e+.5*r,i+.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,i,r,n){const s=this._boxShape;s.setAttributeNS(null,"x",""+e),s.setAttributeNS(null,"y",""+i),s.setAttributeNS(null,"width",""+r),s.setAttributeNS(null,"height",""+n),s.setAttributeNS(null,"class",rge.box)}_updateBackground(e,i,r,n){this._backgroundShape.setAttributeNS(null,"d",this._toSVGPath(e,i,r,n,this.view.width,this.view.height))}_createContainer(){const e=document.createElement("div");e.className=rge.container,this.view.root.appendChild(e),this._container=e}_createOverlay(){const e=this.view.width,i=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+" "+i+" L 0 "+i+" Z"),r.setAttributeNS(null,"class",rge.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",rge.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,i,r,n,s,o){const a=e+r,l=i+n;return"M 0 0 L "+s+" 0 L "+s+" "+o+" L 0 "+o+" ZM "+e+" "+i+" L "+e+" "+l+" L "+a+" "+l+" L "+a+" "+i+" Z"}_handleDrag(e,i){const r=e.x,n=e.y,s=e.origin.x,o=e.origin.y;let a,l,c,d;switch(r>s?(a=s,c=r-s):(a=r,c=s-r),n>o?(l=o,d=n-o):(l=n,d=o-n),e.action){case"start":this._start();break;case"update":this._update(a,l,c,d);break;case"end":this._end(a,l,c,d,i)}e.stopPropagation()}_redraw(){if(!this._rafId||(this._rafId=null,!this._overlay))return;const{x:e,y:i,width:r,height:n}=this._box;this._updateBox(e,i,r,n),this._updateBackground(e,i,r,n),this._rafId=requestAnimationFrame(this._redraw)}};E([k()],ree.prototype,"navigation",void 0),E([k()],ree.prototype,"view",null),ree=E([ht("esri.views.2d.navigation.ZoomBox")],ree);const gnr=ree;let RF=class{constructor(e){this._gain=e,this.lastValue=void 0,this.filteredDelta=void 0}update(e){if(this.hasLastValue()){const i=this.computeDelta(e);this._updateDelta(i)}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}},bke=class{constructor(e,i,r){this._initialVelocity=e,this._stopVelocity=i,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,i){const r=this.value(e);return this.value(e+i)-r}valueFromInitialVelocity(e,i){i=Math.min(i,this.duration);const r=1-this.friction;return e*(r**i-1)/Math.log(r)}},ynr=class extends bke{constructor(e,i,r,n,s){super(e,i,r),this._sceneVelocity=n,this.direction=s}value(e){return super.valueFromInitialVelocity(this._sceneVelocity,e)}},vnr=class{constructor(e=300,i=12,r=.84){this._minimumInitialVelocity=e,this._stopVelocity=i,this._friction=r,this.enabled=!0,this._time=new RF(.6),this._screen=[new RF(.4),new RF(.4)],this._scene=[new RF(.6),new RF(.6),new RF(.6)],this._tmpDirection=Qr()}add(e,i,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(i[0]),this._scene[1].update(i[1]),this._scene[2].update(i[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,i=this._screen[1].filteredDelta,r=e==null||i==null?0:Math.sqrt(e*e+i*i),n=this._time.filteredDelta,s=n==null||r==null?0:r/n;return Math.abs(s)0&&Gh(this._tmpDirection,this._tmpDirection,1/n);const s=this._time.filteredDelta;return new ynr(e,i,r,s==null?0:n/s,this._tmpDirection)}},kj=class extends fn{constructor(e){super(e),this.animationTime=0,this.momentumEstimator=new vnr(500,6,.92),this.momentum=null,this.tmpMomentum=Qr(),this.momentumFinished=!1,this.viewpoint=new u_({targetGeometry:new Yi,scale:0,rotation:0}),this._previousDrag=null,Hg(()=>this.momentumFinished,()=>this.navigation.stop())}begin(e,i){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(i),this._previousDrag=i}update(e,i){this.addToEstimator(i);let r=i.center.x,n=i.center.y;const s=this._previousDrag;r=s?s.center.x-r:-r,n=s?n-s.center.y:n,e.viewpoint=TM(this.viewpoint,e.viewpoint,[r||0,n||0]),this._previousDrag=i}end(e,i){this.addToEstimator(i);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 i=e.center.x,r=e.center.y,n=YBt(-i,r),s=Ma(-i,r,0);this.momentumEstimator.add(n,s,.001*e.timestamp)}onAnimationUpdate(e){this.navigation.animationManager?.animateContinous(e.viewpoint,(i,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);Gh(o,n.direction,l),TM(i,i,o),e.constraints.constrainByGeometry(i)}this.animationTime+=a})}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())}};E([k()],kj.prototype,"momentumFinished",void 0),E([k()],kj.prototype,"viewpoint",void 0),E([k()],kj.prototype,"navigation",void 0),kj=E([ht("esri.views.2d.navigation.actions.Pan")],kj);const _nr=kj;let TAt=class{constructor(e=2.5,i=.01,r=.95,n=12){this._minimumInitialVelocity=e,this._stopVelocity=i,this._friction=r,this._maxVelocity=n,this.enabled=!0,this.value=new RF(.8),this.time=new RF(.3)}add(e,i){if(this.enabled&&i!=null){if(this.time.hasLastValue()){if(this.time.computeDelta(i)<.01)return;if(this.value.hasFilteredDelta()){const r=this.value.computeDelta(e);this.value.filteredDelta*r<0&&this.value.reset()}}this.time.update(i),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=Hl(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,i)}},wnr=class extends bke{constructor(e,i,r){super(e,i,r)}value(e){const i=super.value(e);return Math.exp(i)}valueDelta(e,i){const r=super.value(e),n=super.value(e+i)-r;return Math.exp(n)}},xnr=class extends TAt{constructor(e=2.5,i=.01,r=.95,n=12){super(e,i,r,n)}add(e,i){super.add(Math.log(e),i)}createMomentum(e,i,r){return new wnr(e,i,r)}},Nj=class extends fn{constructor(e){super(e),this._animationTime=0,this._momentumFinished=!1,this._previousAngle=0,this._previousRadius=0,this._previousCenter=null,this._rotationMomentumEstimator=new bnr(.6,.15,.95),this._rotationDirection=1,this._startAngle=0,this._startRadius=0,this._updateTimestamp=null,this._zoomDirection=1,this._zoomMomentumEstimator=new xnr,this._zoomOnly=null,this.zoomMomentum=null,this.rotateMomentum=null,this.viewpoint=new u_({targetGeometry:new Yi,scale:0,rotation:0}),this.addHandles(Hg(()=>this._momentumFinished,()=>this.navigation.stop()))}begin(e,i){this.navigation.begin(),this._rotationMomentumEstimator.reset(),this._zoomMomentumEstimator.reset(),this._zoomOnly=null,this._previousAngle=this._startAngle=i.angle,this._previousRadius=this._startRadius=i.radius,this._previousCenter=i.center,this._updateTimestamp=null,e.constraints.rotationEnabled&&this.addToRotateEstimator(0,i.timestamp),this.addToZoomEstimator(i,1)}update(e,i){this._updateTimestamp===null&&(this._updateTimestamp=i.timestamp);const r=i.angle,n=i.radius,s=i.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 c=n/this._previousRadius;let d=180*(r-this._previousAngle)/Math.PI;this._rotationDirection=d>=0?1:-1,this._zoomDirection=c>=1?1:-1,e.constraints.rotationEnabled?(this._zoomOnly===null&&i.timestamp-this._updateTimestamp>200&&(this._zoomOnly=a-o>0),this._zoomOnly===null||this._zoomOnly?d=0:this.addToRotateEstimator(r-this._startAngle,i.timestamp)):d=0,this.addToZoomEstimator(i,l),this.navigation.setViewpoint([s.x,s.y],1/c,d,[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,i){this._rotationMomentumEstimator.add(e,.001*i)}addToZoomEstimator(e,i){this._zoomMomentumEstimator.add(i,.001*e.timestamp)}canZoomIn(e){const i=e.scale,r=e.constraints.effectiveMaxScale;return r===0||i>r}canZoomOut(e){const i=e.scale,r=e.constraints.effectiveMinScale;return r===0||i{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 c=this.zoomMomentum?Math.abs(this.zoomMomentum.valueDelta(this._animationTime,a)):1;const d=Xa(),p=Xa();if(this._previousCenter){aa(d,this._previousCenter.x,this._previousCenter.y),OIe(p,e.size,e.padding),CIe(d,d,p);const{constraints:y,scale:v}=e,S=v*c;c<1&&!y.canZoomInTo(S)?(c=v/y.effectiveMaxScale,this.zoomMomentum=null,this.rotateMomentum=null):c>1&&!y.canZoomOutTo(S)&&(c=v/y.effectiveMinScale,this.zoomMomentum=null,this.rotateMomentum=null),NIe(i,e.viewpoint,c,l,d,e.size),e.constraints.constrainByGeometry(i)}}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())}};E([k()],Nj.prototype,"_momentumFinished",void 0),E([k()],Nj.prototype,"viewpoint",void 0),E([k()],Nj.prototype,"navigation",void 0),Nj=E([ht("esri.views.2d.navigation.actions.Pinch")],Nj);const Snr=Nj,wke=Xa(),EAt=Xa();let nee=class extends fn{constructor(e){super(e),this._previousCenter=Xa(),this.viewpoint=new u_({targetGeometry:new Yi,scale:0,rotation:0})}begin(e,i){this.navigation.begin(),aa(this._previousCenter,i.center.x,i.center.y)}update(e,i){const{state:{size:r,padding:n}}=e;aa(wke,i.center.x,i.center.y),Uit(EAt,r,n),e.viewpoint=kIe(this.viewpoint,e.state.paddedViewState.viewpoint,jit(EAt,this._previousCenter,wke)),rG(this._previousCenter,wke)}end(){this.navigation.end()}};E([k()],nee.prototype,"viewpoint",void 0),E([k()],nee.prototype,"navigation",void 0),nee=E([ht("esri.views.2d.actions.Rotate")],nee);const Cnr=nee,nge=10,IAt=1,xke=new u_({targetGeometry:new Yi}),Ske=[0,0],AAt=250;let WE=class extends fn{constructor(e){super(e),this._endTimer=null,this._lastEventTimestamp=null,this.animationManager=null,this.interacting=!1}initialize(){this.pan=new _nr({navigation:this}),this.rotate=new Cnr({navigation:this}),this.pinch=new Snr({navigation:this}),this.zoomBox=new gnr({view:this.view,navigation:this})}destroy(){this.pan=ra(this.pan),this.rotate=ra(this.rotate),this.pinch=ra(this.pinch),this.zoomBox=ra(this.zoomBox),this.animationManager=null}begin(){this._set("interacting",!0)}end(){this._lastEventTimestamp=performance.now(),this._startTimer(AAt)}async zoom(e,i=this._getDefaultAnchor()){if(this.stop(),this.begin(),this.view.constraints.snapToZoom&&this.view.constraints.effectiveLODs)return e<1?this.zoomIn(i):this.zoomOut(i);this.setViewpoint(i,e,0,[0,0])}async zoomIn(e){const i=this.view,r=i.constraints.snapToNextScale(i.scale);return this._zoomToScale(r,e)}async zoomOut(e){const i=this.view,r=i.constraints.snapToPreviousScale(i.scale);return this._zoomToScale(r,e)}setViewpoint(e,i,r,n){this.begin(),this.view.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,e,i,r,n),this.end()}setViewpointImmediate(e,i=0,r=[0,0],n=this._getDefaultAnchor()){this.view.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,n,e,i,r)}continousRotateClockwise(){const e=this.get("view.viewpoint");this.animationManager?.animateContinous(e,i=>{kIe(i,i,-IAt)})}continousRotateCounterclockwise(){const e=this.get("view.viewpoint");this.animationManager?.animateContinous(e,i=>{kIe(i,i,IAt)})}resetRotation(){this.view.rotation=0}continousPanLeft(){this._continuousPan([-nge,0])}continousPanRight(){this._continuousPan([nge,0])}continousPanUp(){this._continuousPan([0,nge])}continousPanDown(){this._continuousPan([0,-nge])}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 i=this.view.viewpoint;this.animationManager?.animateContinous(i,r=>{TM(r,r,e),this.view.constraints.constrainByGeometry(r)})}_startTimer(e){return this._endTimer!==null||(this._endTimer=setTimeout(()=>{this._endTimer=null;const i=performance.now()-(this._lastEventTimestamp??0);is&&!d))return Hit(xke,o,e/s,0,i,a,l),n.constrainByGeometry(xke),r.goTo(xke,{animate:!0})}_scaleRotateTranslateViewpoint(e,i,r,n,s){const{view:o}=this,{size:a,padding:l,constraints:c,scale:d,viewpoint:p}=o,y=d*r,v=c.canZoomInTo(y),S=c.canZoomOutTo(y);return(r<1&&!v||r>1&&!S)&&(r=1),TM(p,p,s),Hit(e,p,r,n,i,a,l),c.constrainByGeometry(e)}};E([k()],WE.prototype,"animationManager",void 0),E([k({type:Boolean,readOnly:!0})],WE.prototype,"interacting",void 0),E([k()],WE.prototype,"pan",void 0),E([k()],WE.prototype,"pinch",void 0),E([k()],WE.prototype,"rotate",void 0),E([k()],WE.prototype,"view",void 0),E([k()],WE.prototype,"zoomBox",void 0),WE=E([ht("esri.views.2d.navigation.MapViewNavigation")],WE);const Tnr=WE,PAt={shaders:{vertexShader:wg("magnifier/magnifier.vert"),fragmentShader:wg("magnifier/magnifier.frag")},attributes:new Map([["a_pos",0]])};function Enr(t){return kE(t,PAt)}async function sge(t,e){const{data:i}=await ir(t,{responseType:"image",...e});return i}async function Inr(t){const e=Promise.resolve().then(()=>lPr),i=Promise.resolve().then(()=>uPr),r=sge((await e).default,{signal:t}),n=sge((await i).default,{signal:t}),s={mask:await r,overlay:await n};return sn(t),s}const OAt=Object.freeze(Object.defineProperty({__proto__:null,GraphicContainer:TO,GraphicsView2D:fx,LabelManager:Mtr,MagnifierView2D:class extends CS{constructor(){super(),this._handles=new uf,this._resourcePixelRatio=1,this.visible=!1}destroy(){this._handles=ra(this._handles),this._disposeRenderResources(),this._resourcesTask=rL(this._resourcesTask)}get background(){return this._background}set background(e){this._background=e,this.requestRender()}get magnifier(){return this._magnifier}set magnifier(e){this._magnifier=e,this._handles.removeAll(),this._handles.add([Qi(()=>e.version,()=>{this.visible=e.visible&&ye(e.position)&&e.size>0,this.requestRender()},Fo),Qi(()=>[e.maskUrl,e.overlayUrl],()=>this._reloadResources()),Qi(()=>e.size,()=>{this._disposeRenderResources(),this.requestRender()})])}_createTransforms(){return{dvs:Cl()}}doRender(e){const i=e.context;if(!this._resourcesTask)return void this._reloadResources();if(e.drawPhase!==io.MAP||!this._canRender())return;this._updateResources(e);const r=this._magnifier;if(lt(r.position))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,c=n*l[0],d=n*l[1],p=.5*a,y=.5*a,v=Hl(n*r.position.x,p,c-p-1),S=Hl(d-n*r.position.y,y,d-y-1);i.setBlendingEnabled(!0);const I=v-p,O=S-y,L=this._readbackTexture;i.bindTexture(L,0),i.gl.copyTexImage2D(L.descriptor.target,0,L.descriptor.pixelFormat,I,O,a,a,0);const N=this.background?.color,G=N?[N.a*N.r/255,N.a*N.g/255,N.a*N.b/255,N.a]:[1,1,1,1],V=(v+r.offset.x*n)/c*2-1,Y=(S-r.offset.y*n)/d*2-1,X=s/c*2,te=s/d*2,re=this._program;i.bindVAO(this._vertexArrayObject),i.bindTexture(this._overlayTexture,6),i.bindTexture(this._maskTexture,7),i.useProgram(re),re.setUniform4fv("u_background",G),re.setUniform1i("u_readbackTexture",0),re.setUniform1i("u_overlayTexture",6),re.setUniform1i("u_maskTexture",7),re.setUniform4f("u_drawPos",V,Y,X,te),re.setUniform1i("u_maskEnabled",r.maskEnabled?1:0),re.setUniform1i("u_overlayEnabled",r.overlayEnabled?1:0),i.setStencilTestEnabled(!1),i.setColorMask(!0,!0,!0,!0),i.drawArrays(ls.TRIANGLE_STRIP,0,4),i.bindVAO()}_canRender(){return this.mask&&this.overlay&&this._magnifier!=null}_reloadResources(){this._resourcesTask&&this._resourcesTask.abort();const e=ye(this._magnifier)?this._magnifier.maskUrl:null,i=ye(this._magnifier)?this._magnifier.overlayUrl:null;this._resourcesTask=EC(async r=>{const n=lt(e)||lt(i)?Inr(r):null,s=ye(e)?ir(e,{responseType:"image",signal:r}).then(c=>c.data):n.then(c=>c.mask),o=ye(i)?ir(i,{responseType:"image",signal:r}).then(c=>c.data):n.then(c=>c.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 i=e.context;this._resourcePixelRatio=e.pixelRatio;const r=Math.ceil(this._magnifier.size*e.pixelRatio);this._program=Enr(i);const n=new Uint16Array([0,1,0,0,1,1,1,0]),s=PAt.attributes;this._vertexArrayObject=new Ac(i,s,uEt,{geometry:Ko.createVertex(i,Lo.STATIC_DRAW,n)}),this.overlay.width=r,this.overlay.height=r,this._overlayTexture=new bs(i,{target:Ws.TEXTURE_2D,pixelFormat:nn.RGBA,internalFormat:nn.RGBA,dataType:ts.UNSIGNED_BYTE,wrapMode:us.CLAMP_TO_EDGE,samplingMode:mn.NEAREST,flipped:!0,preMultiplyAlpha:!q6t(this.overlay.src)||!e.context.driverTest.svgPremultipliesAlpha.result},this.overlay),this.mask.width=r,this.mask.height=r,this._maskTexture=new bs(i,{target:Ws.TEXTURE_2D,pixelFormat:nn.ALPHA,internalFormat:nn.ALPHA,dataType:ts.UNSIGNED_BYTE,wrapMode:us.CLAMP_TO_EDGE,samplingMode:mn.NEAREST,flipped:!0},this.mask);const o=1/this._magnifier.factor;this._readbackTexture=new bs(i,{target:Ws.TEXTURE_2D,pixelFormat:nn.RGBA,internalFormat:nn.RGBA,dataType:ts.UNSIGNED_BYTE,wrapMode:us.CLAMP_TO_EDGE,samplingMode:mn.LINEAR,flipped:!1,width:Math.ceil(o*r),height:Math.ceil(o*r)})}},MapViewNavigation:Tnr,Stage:mtr},Symbol.toStringTag,{value:"Module"}));let RAt=class{constructor(e,i,r){this.pixelBlock=e,this.extent=i,this.originalPixelBlock=r}get width(){return ye(this.pixelBlock)?this.pixelBlock.width:0}get height(){return ye(this.pixelBlock)?this.pixelBlock.height:0}render(e){const i=this.pixelBlock;if(lt(i))return;const r=this.filter({extent:this.extent,pixelBlock:this.originalPixelBlock??i});if(lt(r.pixelBlock))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 lt(e.pixelBlock)?null:(e.pixelBlock.maskIsAlpha&&(e.pixelBlock.premultiplyAlpha=!0),{width:e.pixelBlock.width,height:e.pixelBlock.height,renderedRasterPixels:new Uint8Array(e.pixelBlock.getAsRGBA().buffer)})}};function MAt(t){return t&&"render"in t}function DAt(t){const e=document.createElement("canvas");return e.width=t.width,e.height=t.height,t.render(e.getContext("2d")),e}function Anr(t){return MAt(t)?t instanceof RAt?ya(t.getRenderedRasterPixels(),e=>e.renderedRasterPixels):DAt(t):t}let Cke=class extends CS{constructor(e=null,i){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=i.immutable??!1,this.requestRenderOnSourceChangedEnabled=i.requestRenderOnSourceChangedEnabled??!0,this.source=e,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null),ye(this._uploadStatus)&&(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._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),this.invalidateTexture())}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,i){ye(this._uploadStatus)&&this._uploadStatus.controller.abort();const r=new AbortController,n=Mf();return k8(i,()=>r.abort()),k8(r,s=>n.reject(s)),this._uploadStatus={controller:r,resolver:n},this.source=e,n.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRenderOnSourceChangedEnabled&&this.requestRender())}updateTransitionProperties(e,i){e>=64&&(this.fadeTransitionEnabled=!1,this.inFadeTransition=!1),super.updateTransitionProperties(e,i)}setTransform(e){const i=rP(this.transforms.dvs),[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;ug(i,i,lp(r,n)),ug(i,i,lp(o/2,a/2)),ST(i,i,-l),ug(i,i,lp(-o/2,-a/2)),jle(i,i,lp(o,a)),ov(this.transforms.dvs,e.displayViewMat3,i)}setSamplingProfile(e){this._texture&&(e.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(e.samplingMode))}bind(e,i){this._texture&&e.bindTexture(this._texture,i)}async updateTexture({context:e,painter:i}){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=Anr(this.source);try{if(ye(this._uploadStatus)){const{controller:n,resolver:s}=this._uploadStatus,o={signal:n.signal},{width:a,height:l}=this,c=this._texture;await i.textureUploadManager.enqueueTextureUpdate({data:r,texture:c,width:a,height:l},o),s.resolve(),this._uploadStatus=null}else this._texture.setData(r);this.ready()}catch(n){wC(n)}}onDetach(){this.destroy()}_createTransforms(){return{dvs:Cl()}}_createTexture(e){const i=this.immutable&&e.type===lo.WEBGL2;return new bs(e,{target:Ws.TEXTURE_2D,pixelFormat:nn.RGBA,internalFormat:i?ks.RGBA8:nn.RGBA,dataType:ts.UNSIGNED_BYTE,wrapMode:us.CLAMP_TO_EDGE,isImmutable:i,width:this._sourceWidth,height:this._sourceHeight})}},Pnr=class extends Cj{constructor(e,i,r,n,s,o,a=null){super(e,i,r,n,s,o),this.bitmap=new Cke(a,{immutable:!1,requestRenderOnSourceChangedEnabled:!1}),this.bitmap.coordScale=[s,o],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy()}beforeRender(e){super.beforeRender(e),this.bitmap.beforeRender(e)}afterRender(e){super.afterRender(e),this.bitmap.afterRender(e)}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{dvs:Cl(),tileMat3:Cl()}}setTransform(e){super.setTransform(e),this.bitmap.transforms.dvs=this.transforms.dvs}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap&&(this.bitmap.stage=null)}},FAt=class extends iee{get requiresDedicatedFBO(){return this.children.some(e=>e.bitmap.blendFunction==="additive")}createTile(e){const i=this._tileInfoView.getTileBounds(_o(),e),r=this._tileInfoView.getTileResolution(e.level),[n,s]=this._tileInfoView.tileInfo.size;return new Pnr(e,r,i[0],i[3],n,s)}prepareRenderPasses(e){const i=e.registerRenderPass({name:"bitmap (tile)",brushes:[lh.bitmap],target:()=>this.children.map(r=>r.bitmap),drawPhase:io.MAP});return[...super.prepareRenderPasses(e),i]}doRender(e){this.visible&&e.drawPhase===io.MAP&&super.doRender(e)}};const LAt=t=>{let e=class extends t{attach(){this.view.timeline.record(`${this.layer.title} (BitmapTileLayer) Attach`),this._bitmapView=new FAt(this._tileInfoView),this.container.addChild(this._bitmapView)}detach(){this.container.removeChild(this._bitmapView),this._bitmapView?.removeAllChildren()}};return e=E([ht("esri.views.2d.layers.BitmapTileLayerView2D")],e),e};let oge=class extends Ni{get version(){return this.commitVersionProperties(),(this._get("version")||0)+1}};E([k({readOnly:!0})],oge.prototype,"version",null),oge=E([ht("esri.views.layers.support.ClipArea")],oge);const Tke=oge;var Eke;let G6=Eke=class extends Tke{constructor(t){super(t),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new Eke({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")}};E([k({type:[Number,String],json:{write:!0}})],G6.prototype,"left",void 0),E([k({type:[Number,String],json:{write:!0}})],G6.prototype,"right",void 0),E([k({type:[Number,String],json:{write:!0}})],G6.prototype,"top",void 0),E([k({type:[Number,String],json:{write:!0}})],G6.prototype,"bottom",void 0),G6=Eke=E([ht("esri.views.layers.support.ClipRect")],G6);const Onr=G6;var Ike;const Rnr={base:Jr,key:"type",typeMap:{extent:vr,polygon:po}};let age=Ike=class extends Tke{constructor(t){super(t),this.type="geometry",this.geometry=null}clone(){return new Ike({geometry:this.geometry?.clone()??null})}commitVersionProperties(){this.commitProperty("geometry")}};E([k({types:Rnr,json:{read:fl,write:!0}})],age.prototype,"geometry",void 0),age=Ike=E([ht("esri.views.layers.support.Geometry")],age);const Mnr=age;let lge=class extends Tke{constructor(e){super(e),this.type="path",this.path=[]}commitVersionProperties(){this.commitProperty("path")}};E([k({type:[[[Number]]],json:{write:!0}})],lge.prototype,"path",void 0),lge=E([ht("esri.views.layers.support.Path")],lge);const Dnr=lge,Ake=fr.ofType({key:"type",base:null,typeMap:{rect:Onr,path:Dnr,geometry:Mnr}}),_y=t=>{let e=class extends t{constructor(){super(...arguments),this.attached=!1,this.clips=new Ake,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this.visibleAtCurrentScale=!1,this.highlightOptions=null}initialize(){const i=this.view?.spatialReferenceLocked??!0;this.view?.spatialReference&&i&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new st("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 yj),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([Qi(()=>this.suspended,n=>{this.container&&(this.container.visible=!n),this.view&&!n&&this.updateRequested&&this.view.requestUpdate()},jh),Qi(()=>this.layer?.opacity??1,n=>{this.container&&(this.container.opacity=n)},jh),Qi(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",n=>{this.container&&(this.container.blendMode=n)},jh),Qi(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,n=>{this.container&&(this.container.effect=n)},jh),Qi(()=>this.highlightOptions,n=>this.container.highlightOptions=n,jh),ku(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)},jh),Qi(()=>({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)},jh)],"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 i=this.view?.spatialReference;return i==null||this.supportsSpatialReference(i)}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(i){const r=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;if(!r)return!0;const{minScale:n,maxScale:s}=r;return(n===0||i<=n)&&(s===0||i>=s)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.suspended||this.view.requestUpdate())}processUpdate(i){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",i),this.updateRequested&&!this.suspended&&(this.updateRequested=!1,this.update(i))):this.updateRequested=!1}hitTest(i,r){return Promise.resolve(null)}supportsSpatialReference(i){return!0}canResume(){return!!this.spatialReferenceSupported&&!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const i=super.getSuspendInfo(),r=!this.spatialReferenceSupported,n=this.visibleAtCurrentScale;return r&&(i.spatialReferenceNotSupported=r),n&&(i.outsideScaleRange=n),i}addAttachHandles(i){this.addHandles(i,"attach")}};return E([k()],e.prototype,"attached",void 0),E([k({type:Ake,set(i){const r=rg(i,this._get("clips"),Ake);this._set("clips",r)}})],e.prototype,"clips",void 0),E([k()],e.prototype,"container",void 0),E([k()],e.prototype,"moving",void 0),E([k({readOnly:!0})],e.prototype,"spatialReferenceSupported",null),E([k({readOnly:!0})],e.prototype,"updateParameters",void 0),E([k()],e.prototype,"updateRequested",void 0),E([k()],e.prototype,"updating",null),E([k()],e.prototype,"view",void 0),E([k({readOnly:!0})],e.prototype,"visibleAtCurrentScale",void 0),E([k({type:nAe})],e.prototype,"highlightOptions",void 0),e=E([ht("esri.views.2d.layers.LayerView2D")],e),e};let Pke=class extends CAt{doRender(e){e.drawPhase===io.HIGHLIGHT&&super.doRender(e)}renderChildren(e){if(this.attributeView.update(),!this.children.some(n=>n.hasData))return;this.attributeView.bindTextures(e.context),super.renderChildren(e);const{painter:i}=e,r=i.effects.highlight;r.bind(e),e.context.setColorMask(!0,!0,!0,!0),e.context.clear(lE.COLOR_BUFFER_BIT),this._renderChildren(e,r.defines.concat(["highlightAll"])),r.draw(e),r.unbind()}};Pke=E([ht("esri.views.2d.layers.support.HighlightGraphicContainer")],Pke);const Oke=Pke;function Fnr(t){return t instanceof HTMLImageElement?t.naturalWidth:t.width}function Lnr(t){return t instanceof HTMLImageElement?t.naturalHeight:t.height}function uge(t,e,i,r){if(i.level===r.level)return e;const n=t.tileInfo.size,s=t.getTileResolution(i.level),o=t.getTileResolution(r.level);let a=t.getLODInfoAt(r.level);const l=a.getXForColumn(r.col),c=a.getYForRow(r.row);a=t.getLODInfoAt(i.level);const d=a.getXForColumn(i.col),p=a.getYForRow(i.row),y=Fnr(e)/n[0],v=Lnr(e)/n[1],S=Math.round(y*((l-d)/s)),I=Math.round(v*(-(c-p)/s)),O=Math.round(y*n[0]*(o/s)),L=Math.round(v*n[1]*(o/s)),N=Rke(n);return N.getContext("2d").drawImage(e,S,I,O,L,0,0,n[0],n[1]),N}function Rke(t){const e=document.createElement("canvas");return[e.width,e.height]=t,e}let Sb=class extends Nd(R1(Zx(cd.EventedMixin(fn)))){constructor(e){super(e),this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{if(e.name!=="layerview:create-error"){const i=this.layer&&this.layer.id||"no id",r=this.layer&&this.layer.title||"no title";Ei.getLogger(this.declaredClass).error("#resolve()",`Failed to resolve layer view (layer title: '${r}', id: '${i}')`,e)}})}get fullOpacity(){return Fu(this.get("layer.opacity"),1)*Fu(this.get("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&&this.parent.suspended?this.parent.suspendInfo:{},i=this;return i.view&&i.view.ready||(e.viewNotReady=!0),this.layer&&this.layer.loaded||(e.layerNotLoaded=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}};E([k()],Sb.prototype,"fullOpacity",null),E([k()],Sb.prototype,"layer",void 0),E([k()],Sb.prototype,"parent",void 0),E([k({readOnly:!0})],Sb.prototype,"suspended",null),E([k({readOnly:!0})],Sb.prototype,"suspendInfo",null),E([k({readOnly:!0})],Sb.prototype,"legendEnabled",null),E([k({type:Boolean,readOnly:!0})],Sb.prototype,"updating",null),E([k({readOnly:!0})],Sb.prototype,"updatingProgress",null),E([k()],Sb.prototype,"visible",null),E([k()],Sb.prototype,"view",void 0),Sb=E([ht("esri.views.layers.LayerView")],Sb);const by=Sb,MF=t=>{let e=class extends t{initialize(){this.handles.add(ku(()=>this.layer,"refresh",i=>{this.doRefresh(i.dataChanged).catch(r=>{ss(r)||Ei.getLogger(this.declaredClass).error(r)})}),"RefreshableLayerView")}};return E([k()],e.prototype,"layer",void 0),e=E([ht("esri.layers.mixins.RefreshableLayerView")],e),e};function Mke(t,e){return e?"xoffset"in e&&e.xoffset?Math.max(t,Math.abs(e.xoffset)):"yoffset"in e&&e.yoffset?Math.max(t,Math.abs(e.yoffset||0)):t:t}function knr(t){let e=0,i=0;for(let r=0;ro.type==="size").map(o=>{const{maxSize:a,minSize:l}=o;return(kAt(a,t)+kAt(l,t))/2});let r=0;const n=i.length;if(n===0)return t;for(let o=0;o{n=Mke(n,s.symbol)}),n}if(e.type==="class-breaks"){let n=r;return e.classBreakInfos.forEach(s=>{n=Mke(n,s.symbol)}),n}return e.type==="dot-density"||e.type,r}const $At=t=>t.spatialReference.wkid||JSON.stringify(t.spatialReference);function $nr(t,e){const{dpi:i,gdbVersion:r,geometry:n,geometryPrecision:s,height:o,layerOption:a,mapExtent:l,maxAllowableOffset:c,returnFieldName:d,returnGeometry:p,returnUnformattedValues:y,returnZ:v,spatialReference:S,timeExtent:I,tolerance:O,width:L}=t.toJSON(),{dynamicLayers:N,layerDefs:G,layerIds:V}=Bnr(t),Y=e&&ye(e.geometry)?e.geometry:null,X={geometryPrecision:s,maxAllowableOffset:c,returnFieldName:d,returnGeometry:p,returnUnformattedValues:y,returnZ:v,tolerance:O},te=Y&&Y.toJSON()||n;if(X.imageDisplay=`${L},${o},${i}`,r&&(X.gdbVersion=r),te&&(delete te.spatialReference,X.geometry=JSON.stringify(te),X.geometryType=md(te)),S?X.sr=S.wkid||JSON.stringify(S):te&&te.spatialReference?X.sr=$At(te):l&&l.spatialReference&&(X.sr=$At(l)),X.time=I?[I.start,I.end].join(","):null,l){const{xmin:re,ymin:fe,xmax:ge,ymax:_e}=l;X.mapExtent=`${re},${fe},${ge},${_e}`}return G&&(X.layerDefs=G),N&&!G&&(X.dynamicLayers=N),X.layers=a==="popup"?"visible":a,V&&!N&&(X.layers+=`:${V.join(",")}`),X}function Bnr(t){const{mapExtent:e,floors:i,width:r,sublayers:n,layerIds:s,layerOption:o,gdbVersion:a}=t,l=n?.find(S=>S.layer!=null)?.layer?.serviceSublayers,c=o==="popup",d={},p=Bae({extent:e,width:r,spatialReference:e?.spatialReference}),y=[],v=S=>{const I=p===0,O=S.minScale===0||p<=S.minScale,L=S.maxScale===0||p>=S.maxScale;if(S.visible&&(I||O&&L))if(S.sublayers)S.sublayers.forEach(v);else{if(s?.includes(S.id)===!1||c&&(!S.popupTemplate||!S.popupEnabled))return;y.unshift(S)}};if(n?.forEach(v),n&&!y.length)d.layerIds=[];else{const S=rZe(y,l,a),I=y.map(O=>{const L=SY(i,O);return O.toExportImageJSON(L)});if(S)d.dynamicLayers=JSON.stringify(I);else{if(n){let L=y.map(({id:N})=>N);s&&(L=L.filter(N=>s.includes(N))),d.layerIds=L}else s?.length&&(d.layerIds=s);const O=Gnr(i,y);if(ye(O)&&O.length){const L={};for(const N of O)N.definitionExpression&&(L[N.id]=N.definitionExpression);Object.keys(L).length&&(d.layerDefs=JSON.stringify(L))}}}return d}function Gnr(t,e){const i=!!t?.length,r=e.filter(n=>n.definitionExpression!=null||i&&n.floorInfo!=null);return r.length?r.map(n=>{const s=SY(t,n),o=OR(s,n.definitionExpression);return{id:n.id,definitionExpression:Fu(o,void 0)}}):null}var Dke;let yp=Dke=class extends Ni{static from(t){return kd(Dke,t)}constructor(t){super(t),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,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}};E([k({type:Number,json:{write:!0}})],yp.prototype,"dpi",void 0),E([k()],yp.prototype,"floors",void 0),E([k({type:String,json:{write:!0}})],yp.prototype,"gdbVersion",void 0),E([k({types:P1,json:{read:fl,write:!0}})],yp.prototype,"geometry",void 0),E([k({type:Number,json:{write:!0}})],yp.prototype,"geometryPrecision",void 0),E([k({type:Number,json:{write:!0}})],yp.prototype,"height",void 0),E([k({type:[Number],json:{write:!0}})],yp.prototype,"layerIds",void 0),E([k({type:["top","visible","all","popup"],json:{write:!0}})],yp.prototype,"layerOption",void 0),E([k({type:vr,json:{write:!0}})],yp.prototype,"mapExtent",void 0),E([k({type:Number,json:{write:!0}})],yp.prototype,"maxAllowableOffset",void 0),E([k({type:Boolean,json:{write:!0}})],yp.prototype,"returnFieldName",void 0),E([k({type:Boolean,json:{write:!0}})],yp.prototype,"returnGeometry",void 0),E([k({type:Boolean,json:{write:!0}})],yp.prototype,"returnM",void 0),E([k({type:Boolean,json:{write:!0}})],yp.prototype,"returnUnformattedValues",void 0),E([k({type:Boolean,json:{write:!0}})],yp.prototype,"returnZ",void 0),E([k({type:rr,json:{write:!0}})],yp.prototype,"spatialReference",void 0),E([k()],yp.prototype,"sublayers",void 0),E([k({type:Wg,json:{write:!0}})],yp.prototype,"timeExtent",void 0),E([k({type:Number,json:{write:!0}})],yp.prototype,"tolerance",void 0),E([k({type:Number,json:{write:!0}})],yp.prototype,"width",void 0),yp=Dke=E([ht("esri.rest.support.IdentifyParameters")],yp);const BAt=yp;let EO=class extends Ni{constructor(e){super(e),this.displayFieldName=null,this.feature=null,this.layerId=null,this.layerName=null}readFeature(e,i){return js.fromJSON({attributes:{...i.attributes},geometry:{...i.geometry}})}writeFeature(e,i){if(!e)return;const{attributes:r,geometry:n}=e;r&&(i.attributes={...r}),ye(n)&&(i.geometry=n.toJSON(),i.geometryType=One.toJSON(n.type))}};E([k({type:String,json:{write:!0}})],EO.prototype,"displayFieldName",void 0),E([k({type:js})],EO.prototype,"feature",void 0),E([Li("feature",["attributes","geometry"])],EO.prototype,"readFeature",null),E([mr("feature")],EO.prototype,"writeFeature",null),E([k({type:Number,json:{write:!0}})],EO.prototype,"layerId",void 0),E([k({type:String,json:{write:!0}})],EO.prototype,"layerName",void 0),EO=E([ht("esri.rest.support.IdentifyResult")],EO);const Vnr=EO;async function Unr(t,e,i){const r=(e=znr(e)).geometry?[e.geometry]:[],n=sh(t);return n.path+="/identify",iv(r).then(s=>{const o=$nr(e,{geometry:s&&s[0]}),a=nT({...n.query,f:"json",...o}),l=r_(a,i);return ir(n.path,l).then(jnr).then(c=>Hnr(c,e.sublayers))})}function jnr(t){const e=t.data;return e.results=e.results||[],e.exceededTransferLimit=Boolean(e.exceededTransferLimit),e.results=e.results.map(i=>Vnr.fromJSON(i)),e}function znr(t){return t=BAt.from(t)}function Hnr(t,e){if(!e?.length)return t;const i=new Map;function r(n){i.set(n.id,n),n.sublayers&&n.sublayers.forEach(r)}e.forEach(r);for(const n of t.results)n.feature.sourceLayer=i.get(n.layerId);return t}async function cge(t,e=t.popupTemplate){if(lt(e))return[];const i=await e.getRequiredFields(t.fieldsIndex),{lastEditInfoEnabled:r}=e,{objectIdField:n,typeIdField:s,globalIdField:o,relationships:a}=t;if(i.includes("*"))return["*"];const l=r?await pBt(t):[],c=rW(t.fieldsIndex,[...i,...l]);return s&&c.push(s),c&&n&&t.fieldsIndex?.has(n)&&!c.includes(n)&&c.push(n),c&&o&&t.fieldsIndex?.has(o)&&!c.includes(o)&&c.push(o),a&&a.forEach(d=>{const{keyField:p}=d;c&&p&&t.fieldsIndex?.has(p)&&!c.includes(p)&&c.push(p)}),c}function DF(t,e){return t.popupTemplate?t.popupTemplate:ye(e)&&e.defaultPopupTemplateEnabled&&ye(t.defaultPopupTemplate)?t.defaultPopupTemplate:null}let Fke=null;function Wnr(t,e){return e.type==="tile"||e.type==="map-image"}let IO=class extends fn{constructor(e){super(e),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=$y(async i=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(i).catch(()=>{}))})}initialize(){const e=i=>{this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(i).catch(()=>{})),this.updateHighlightedFeatures(this._highlightGeometriesResolution)};this.addHandles([ku(()=>this.highlightGraphics,"change",i=>e(i.added),{onListenerAdd:i=>e(i)})])}async fetchPopupFeatures(e,i){const{layerView:{layer:r,view:{scale:n}}}=this;if(!e)throw new st("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:r});const s=qnr(r.sublayers,n,i);if(!s.length)return[];const o=await Xnr(r,s);if(!((r.capabilities?.operations?.supportsIdentify??!0)&&r.version>=10.5)&&!o)throw new st("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:r});return o?this._fetchPopupFeaturesUsingQueries(e,s,i):this._fetchPopupFeaturesUsingIdentify(e,s,i)}clearHighlights(){this.highlightGraphics?.removeAll()}highlight(e){const i=this.highlightGraphics;if(!i)return{remove(){}};let r=null;if(e instanceof js?r=[e]:fr.isCollection(e)&&e.length>0?r=e.toArray():Array.isArray(e)&&e.length>0&&(r=e),r=r?.filter(ye),!r||!r.length)return{remove:()=>{}};for(const n of r){const s=n.sourceLayer;s!=null&&"geometryType"in s&&s.geometryType==="point"&&(n.visible=!1)}return i.addMany(r),{remove:()=>{i.removeMany(r??[])}}}async _updateHighlightedFeaturesSymbols(e){const{layerView:{view:i},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||(a=new gd);let l=null;const c="visualVariables"in o?o.visualVariables?.find(d=>d.type==="size"):void 0;c&&(Fke||(Fke=(await Promise.resolve().then(()=>Rse)).getSize),l=Fke(c,s,{view:i.type,scale:i.scale,shape:a.type==="simple-marker"?a.style:null})),l||(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 gd({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:i,view:r},highlightGraphics:n,highlightGraphicUpdated:s}=this;if(this._highlightGeometriesResolution=e,!s||!n?.length||!i.capabilities.operations.supportsQuery)return;const o=this._getTargetResolution(e),a=new Map;for(const d of n)if(!this._featuresResolutions.has(d)||this._featuresResolutions.get(d)>o){const p=d.sourceLayer;xC(a,p,()=>new Map).set(d.getObjectId(),d)}const l=Array.from(a,([d,p])=>{const y=d.createQuery();return y.objectIds=[...p.keys()],y.outFields=[d.objectIdField],y.returnGeometry=!0,y.maxAllowableOffset=o,y.outSpatialReference=r.spatialReference,d.queryFeatures(y)}),c=await Promise.all(l);if(!this.destroyed)for(const{features:d}of c)for(const p of d){const y=p.sourceLayer,v=a.get(y).get(p.getObjectId());v&&n.includes(v)&&(v.geometry=p.geometry,s(v,"geometry"),this._featuresResolutions.set(v,o))}}_getTargetResolution(e){const i=e*Vc(this.layerView.view.spatialReference),r=i/16;return r<=10?0:e/i*r}async _fetchPopupFeaturesUsingIdentify(e,i,r){const n=await this._createIdentifyParameters(e,i,r);if(lt(n))return[];const{results:s}=await Unr(this.layerView.layer.parsedUrl,n);return s.map(o=>o.feature)}async _createIdentifyParameters(e,i,r){const{floors:n,layer:s,timeExtent:o,view:{spatialReference:a,scale:l}}=this.layerView,c=ye(r)?r.event:null;if(!i.length)return null;await Promise.all(i.map(({sublayer:I})=>I.load().catch(()=>{})));const d=Math.min(Gi("mapservice-popup-identify-max-tolerance"),s.allSublayers.reduce((I,O)=>O.renderer?NAt({renderer:O.renderer,event:c}):I,2)),p=this.createFetchPopupFeaturesQueryGeometry(e,d),y=AZt(l,a),v=Math.round(p.width/y),S=new vr({xmin:p.center.x-y*v,ymin:p.center.y-y*v,xmax:p.center.x+y*v,ymax:p.center.y+y*v,spatialReference:p.spatialReference});return new BAt({floors:n,gdbVersion:"gdbVersion"in s?s.gdbVersion:void 0,geometry:e,height:v,layerOption:"popup",mapExtent:S,returnGeometry:!0,spatialReference:a,sublayers:s.sublayers,timeExtent:o,tolerance:d,width:v})}async _fetchPopupFeaturesUsingQueries(e,i,r){const{layerView:{floors:n,timeExtent:s}}=this,o=ye(r)?r.event:null,a=i.map(async({sublayer:l,popupTemplate:c})=>{if(await l.load().catch(()=>{}),l.capabilities&&!l.capabilities.operations.supportsQuery)return[];const d=l.createQuery(),p=NAt({renderer:l.renderer,event:o}),y=this.createFetchPopupFeaturesQueryGeometry(e,p);if(d.geometry=y,d.outFields=await cge(l,c),d.timeExtent=s,n){const N=n.clone(),G=SY(N,l);ye(G)&&(d.where=d.where?`(${d.where}) AND (${G})`:G)}const v=this._getTargetResolution(y.width/p),S=await Ynr(c),I=l.geometryType==="point"||S&&S.arcadeUtils.hasGeometryOperations(c);I||(d.maxAllowableOffset=v);let{features:O}=await l.queryFeatures(d);const L=I?0:v;O=await Knr(l,O);for(const N of O)this._featuresResolutions.set(N,L);return O});return(await bu(a)).reverse().reduce((l,c)=>c.value?[...l,...c.value]:l,[]).filter(l=>l!=null)}};function qnr(t,e,i){const r=[],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=DF(s,{...i,defaultPopupTemplateEnabled:!1});ye(l)&&r.unshift({sublayer:s,popupTemplate:l})}}};return(t?.toArray()??[]).reverse().map(n),r}function Ynr(t){return t.expressionInfos?.length||Array.isArray(t.content)&&t.content.some(e=>e.type==="expression")?Wv():Promise.resolve()}async function Xnr(t,e){if(t.capabilities?.operations?.supportsQuery)return!0;try{return await Promise.any(e.map(({sublayer:i})=>i.load().then(()=>i.capabilities.operations.supportsQuery)))}catch{return!1}}async function Knr(t,e){const i=t.renderer;return i&&"defaultSymbol"in i&&!i.defaultSymbol&&(e=i.valueExpression?await Promise.all(e.map(r=>i.getSymbolAsync(r).then(n=>n?r:null))).then(r=>r.filter(n=>n!=null)):e.filter(r=>i.getSymbol(r)!=null)),e}E([k({constructOnly:!0})],IO.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),E([k({constructOnly:!0})],IO.prototype,"layerView",void 0),E([k({constructOnly:!0})],IO.prototype,"highlightGraphics",void 0),E([k({constructOnly:!0})],IO.prototype,"highlightGraphicUpdated",void 0),E([k({constructOnly:!0})],IO.prototype,"updatingHandles",void 0),IO=E([ht("esri.views.layers.support.MapService")],IO);function GAt(t,e,i,r=new vr){let n=0;if(i.type==="2d")n=e*(i.resolution??0);else if(i.type==="3d"){const d=i.overlayPixelSizeInMapUnits(t),p=i.basemapSpatialReference;n=ye(p)&&!p.equals(i.spatialReference)?Vc(p)/Vc(i.spatialReference):e*d}const s=t.x-n,o=t.y-n,a=t.x+n,l=t.y+n,{spatialReference:c}=i;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=c,r}new vr;const Jnr=[0,0];let see=class extends MF(LAt(_y(by))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new V1,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||this.layer.resampling!==!1}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;if(this._tileInfoView=new wk(this.layer.tileInfo,this.layer.fullExtent),this._fetchQueue=new uG({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(i,r)=>this.fetchTile(i,r)}),this._tileStrategy=new uX({cachePolicy:"keep",resampling:this.resampling,acquireTile:i=>this.acquireTile(i),releaseTile:i=>this.releaseTile(i),tileInfoView:this._tileInfoView}),Wnr(this,this.layer)){const i=this._highlightView=new fx({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new Oke(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new IO({createFetchPopupFeaturesQueryGeometry:(r,n)=>GAt(r,n,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(r,n)=>{i.graphicUpdateHandler({graphic:r,property:n})},layerView:this,updatingHandles:this.updatingHandles})}this.requestUpdate(),this.addAttachHandles(Qi(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeatures(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeatures(e,i):[]}highlight(e){return this._popupHighlightHelper?this._popupHighlightHelper.highlight(e):{remove(){}}}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return Ca(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){!this.attached||this.updateRequested||this.suspended||(this._fetchQueue.reset(),this._tileStrategy.tiles.forEach(e=>this._enqueueTileFetch(e)))}isUpdating(){return this._fetchQueue?.updating??!1}acquireTile(e){const i=this._bitmapView.createTile(e),r=i.bitmap;return[r.x,r.y]=this._tileInfoView.getTileCoords(Jnr,i.key),r.resolution=this._tileInfoView.getTileResolution(i.key),[r.width,r.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(i),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,i={}){const r="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:n,resamplingLevel:s=0}=i;if(!r)try{return await this._fetchImage(e,n)}catch(l){if(!ss(l)&&!this.resampling)return Rke(this._tileInfoView.tileInfo.size);if(s<3){const c=this._tileInfoView.getTileParentId(e.id);if(c){const d=new xh(c),p=await this.fetchTile(d,{...i,resamplingLevel:s+1});return uge(this._tileInfoView,p,d,e)}}throw l}const o=new xh(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 Rke(this._tileInfoView.tileInfo.size);a=await this._fetchImage(o,n)}catch(l){if(ss(l))throw l;a=await this._fetchImage(e,n)}return this.resampling?uge(this._tileInfoView,a,o,e):a}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(i){ss(i)||Ei.getLogger(this.declaredClass).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i})}};E([k()],see.prototype,"_fetchQueue",void 0),E([k()],see.prototype,"resampling",null),see=E([ht("esri.views.2d.layers.TileLayerView2D")],see);const Znr=Object.freeze(Object.defineProperty({__proto__:null,default:see},Symbol.toStringTag,{value:"Module"}));let hge=class extends js{constructor(){super(...arguments),this.isAggregate=!0}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const i=this.sourceLayer&&this.sourceLayer.featureReduction;return i&&"popupTemplate"in i&&i.popupEnabled?i.popupTemplate:null}getObjectId(){return this.attributes.aggregateId}};E([k({type:Boolean})],hge.prototype,"isAggregate",void 0),hge=E([ht("esri.AggregateGraphic")],hge);const Lke=hge;let Z_=class extends fn{constructor(e){super(e),this._filter=null,this.duration=Gi("mapview-transitions-duration"),this._excludedEffectView=new lx(e),this._includedEffectView=new lx(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,i){this._set("scale",i),this.transitioning?(this._includedEffectView.transitionStep(e,i),this._excludedEffectView.transitionStep(e,i),this.transitioning||(this._filter=null)):(this._excludedEffectView.scale=i,this._includedEffectView.scale=i)}endTransitions(){this._includedEffectView.endTransitions(),this._excludedEffectView.endTransitions(),this._filter=null}_transitionTo(e){const i=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||i?.filter||null,o||this.endTransitions()}};E([k()],Z_.prototype,"_filter",void 0),E([k()],Z_.prototype,"_excludedEffectView",void 0),E([k()],Z_.prototype,"_includedEffectView",void 0),E([k()],Z_.prototype,"duration",void 0),E([k()],Z_.prototype,"excludedEffects",null),E([k()],Z_.prototype,"featureEffect",null),E([k()],Z_.prototype,"filter",null),E([k()],Z_.prototype,"hasEffects",null),E([k()],Z_.prototype,"includedEffects",null),E([k({value:0})],Z_.prototype,"scale",null),E([k()],Z_.prototype,"transitioning",null),Z_=E([ht("esri.layers.effects.FeatureEffectView")],Z_);const Qnr=Z_;let oee=class extends Wu{constructor(){super(...arguments),this.features=[]}readFeatures(e,i){const r=rr.fromJSON(i.spatialReference),n=[];for(let s=0;sCPr)).default(e);case"heatmap":return new(await Promise.resolve().then(()=>EPr)).default(e)}}function kke(t){return t.some(e=>e.globalId)}function aee(t){return t.filter(e=>!e.error).map(e=>e.objectId??e.globalId).filter(e=>e!=null)}function VAt(t,e){const i=new Set(t);for(const r of e.values())i.add(r);return i}function UAt(t,e){const i=new Set(t);for(const r of e.values())i.delete(r);return i}let lee=class extends fn{constructor(e){super(e),this._hasGlobalIds=!1,this._notifyUpdating=()=>{this.notifyChange("updating")}}normalizeCtorArgs(e){return this._queueProcessor=new _k({concurrency:1,process:e.process}),{}}destroy(){this.clear()}get updating(){return this._queueProcessor.length>0}clear(){this._queueProcessor.clear()}push(e){const i=this._queueProcessor,r=i.last();switch(e.type){case"update":case"refresh":if(r?.type===e.type)return;i.push(e).then(this._notifyUpdating,this._notifyUpdating);break;case"edit":{const n=r?.type==="processed-edit"?r:null;n&&i.popLast();const s=this._mergeEdits(n,e);for(const o of s)o&&i.push(o).then(this._notifyUpdating,this._notifyUpdating);break}}this.notifyChange("updating")}_mergeEdits(e,i){const{addedFeatures:r,deletedFeatures:n,updatedFeatures:s}=i.edits;if(this._hasGlobalIds=this._hasGlobalIds||kke(r)||kke(s)||kke(n),this._hasGlobalIds)return[e,{type:"processed-edit",edits:{addOrModified:[...r,...s],removed:n}}];const o=new Set(aee(e?.edits.addOrModified??[])),a=new Set(aee(e?.edits.removed??[])),l=new Set([...aee(r),...aee(s)]),c=new Set(aee(n));return[{type:"processed-edit",edits:{addOrModified:Array.from(VAt(UAt(o,c),l)).map(d=>({objectId:d})),removed:Array.from(VAt(UAt(a,l),c)).map(d=>({objectId:d}))}}]}};E([k({readOnly:!0})],lee.prototype,"updating",null),E([k()],lee.prototype,"process",void 0),lee=E([ht("esri.views.2d.layers.support.FeatureCommandQueue")],lee);const isr=lee;function rsr(t){return Array.isArray(t)}let $j=class extends kH{constructor(e){super(e),this._startupResolver=Mf(),this.isReady=!1}initialize(){this._controller=new AbortController,this.addResolvingPromise(this._startWorker(this._controller.signal))}destroy(){this._controller.abort(),this._connection&&this._connection.close()}set tileRenderer(e){this.client.tileRenderer=e}get closed(){return this._connection.closed}async startup(e,i,r,n){await this.when();const s=this._controller.signal,o=rsr(r.source)?{transferList:r.source,signal:s}:void 0,a={service:r,config:i,tileInfo:e.tileInfo.toJSON(),tiles:n};await this._connection.invoke("startup",a,o),this._startupResolver.resolve(),this._set("isReady",!0)}async updateTiles(e){return await this._startupResolver.promise,cf(this._connection.invoke("updateTiles",e))}async update(e){const i={config:e};return await this._startupResolver.promise,this._connection.invoke("update",i)}async applyUpdate(e){return await this._startupResolver.promise,this._connection.invoke("applyUpdate",e)}async setHighlight(e){return await this._startupResolver.promise,cf(this._connection.invoke("controller.setHighlight",e))}async stop(){if(await this._startupResolver.promise,!this.closed)return cf(this._connection.invoke("stop"))}async refresh(e){return await this._startupResolver.promise,cf(this._connection.invoke("controller.refresh",e))}async querySummaryStatistics(e,i,r){return await this._startupResolver.promise,this._connection.invoke("controller.querySummaryStatistics",{query:e.toJSON(),params:i},r)}async queryAggregateSummaryStatistics(e,i,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateSummaryStatistics",{query:e.toJSON(),params:i},r)}async queryUniqueValues(e,i,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryUniqueValues",{query:e.toJSON(),params:i},r)}async queryAggregateUniqueValues(e,i,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateUniqueValues",{query:e.toJSON(),params:i},r)}async queryClassBreaks(e,i,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryClassBreaks",{query:e.toJSON(),params:i},r)}async queryAggregateClassBreaks(e,i,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateClassBreaks",{query:e.toJSON(),params:i},r)}async queryHistogram(e,i,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryHistogram",{query:e.toJSON(),params:i},r)}async queryAggregateHistogram(e,i,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateHistogram",{query:e.toJSON(),params:i},r)}async queryFeatures(e,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryFeatures",e?.toJSON(),i)}async queryVisibleFeatures(e,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryVisibleFeatures",e?.toJSON(),i)}async queryObjectIds(e,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryObjectIds",e?.toJSON(),i)}async queryFeatureCount(e,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryFeatureCount",e?.toJSON(),i)}async queryExtent(e,i){return this._connection.invoke("controller.queryExtent",e.toJSON(),i)}async queryLatestObservations(e,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryLatestObservations",e.toJSON(),i)}async queryStatistics(e){return await this._startupResolver.promise,this._connection.invoke("controller.queryStatistics",e)}async queryAggregates(e,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregates",e?.toJSON(),i)}async queryAggregateCount(e,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateCount",e?.toJSON(),i)}async queryAggregateIds(e,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateIds",e?.toJSON(),i)}async getObjectId(e){return await this._startupResolver.promise,this._connection.invoke("controller.getObjectId",e)}async getDisplayId(e){return await this._startupResolver.promise,this._connection.invoke("controller.getDisplayId",e)}async getFeatures(e){return await this._startupResolver.promise,this._connection.invoke("controller.getFeatures",e)}async getAggregates(){return await this._startupResolver.promise,this._connection.invoke("controller.getAggregates")}async getAggregateValueRanges(){return await this._startupResolver.promise,this._connection.invoke("controller.getAggregateValueRanges")}async mapValidDisplayIds(e){return await this._startupResolver.promise,this._connection.invoke("controller.mapValidDisplayIds",e)}async onEdits(e){return await this._startupResolver.promise,cf(this._connection.invoke("controller.onEdits",e))}async enableEvent(e,i){return await this._startupResolver.promise,cf(this._connection.invoke("controller.enableEvent",{name:e,value:i}))}async pauseStream(){return await this._startupResolver.promise,cf(this._connection.invoke("controller.pauseStream"))}async resumeStream(){return await this._startupResolver.promise,cf(this._connection.invoke("controller.resumeStream"))}async sendMessageToSocket(e){return await this._startupResolver.promise,cf(this._connection.invoke("controller.sendMessageToSocket",e))}async sendMessageToClient(e){return await this._startupResolver.promise,cf(this._connection.invoke("controller.sendMessageToClient",e))}async updateCustomParameters(e){return await this._startupResolver.promise,cf(this._connection.invoke("controller.updateCustomParameters",e))}async _startWorker(e){try{this._connection=await wA("Pipeline",{client:this.client,strategy:"dedicated",signal:e})}catch(i){wC(i)}}};E([k()],$j.prototype,"isReady",void 0),E([k({constructOnly:!0})],$j.prototype,"client",void 0),E([k()],$j.prototype,"tileRenderer",null),$j=E([ht("esri.views.2d.layers.support.FeatureLayerProxy")],$j);const nsr=$j,ssr=1e-6;let osr=class{constructor(e){this._tiles=new Map,this.buffer=0,this.acquireTile=e.acquireTile,this.releaseTile=e.releaseTile,this.tileInfoView=e.tileInfoView,this.buffer=e.buffer}destroy(){}clear(){this._tiles.forEach(e=>this._releaseTile(e))}tileKeys(){const e=[];return this._tiles.forEach((i,r)=>e.push(r)),e}update(e){const i=this.tileInfoView.getTileCoverage(e.state,this.buffer,"closest"),{spans:r,lodInfo:n}=i,{level:s}=n,o=[],a=[],l=new Set,c=new Set;for(const{row:d,colFrom:p,colTo:y}of r)for(let v=p;v<=y;v++){const S=xh.getId(s,d,n.normalizeCol(v),n.getWorldForColumn(v)),I=this._getOrAcquireTile(o,S);l.add(S),I.isReady?I.visible=!0:c.add(I.key)}return c.forEach(d=>this._addPlaceholders(l,d)),this._tiles.forEach(d=>{l.has(d.key.id)||(a.push(d.key.id),this._releaseTile(d))}),lP.pool.release(i),{hasMissingTiles:c.size>0,added:o,removed:a}}_getOrAcquireTile(e,i){if(!this._tiles.has(i)){const r=this.acquireTile(new xh(i));e.push(i),this._tiles.set(i,r),r.visible=!1}return this._tiles.get(i)}_getTile(e){return this._tiles.get(e)}_releaseTile(e){this._tiles.delete(e.key.id),this.releaseTile(e)}_addPlaceholders(e,i){const r=this._addPlaceholderChildren(e,i);Math.abs(1-r){r+=this._addPlaceholderChild(e,n,i)}),r}_addPlaceholderChild(e,i,r){return i.key.level<=r.level||!i.hasData||!r.contains(i.key)?0:(i.visible=!0,e.add(i.key.id),1/(1<<2*(i.key.level-r.level)))}_addPlaceholderParent(e,i){let r=i.getParentKey(),n=0,s=null;for(;ye(r);){if(e.has(r.id))return!0;const o=this._getTile(r.id);if(o?.isReady){for(const a of e){const l=this._getTile(a);l&&r.contains(l.key)&&(l.visible=!1)}return o.visible=!0,e.add(o.key.id),!0}o?.hasData&&o.patchCount>n&&(n=o.patchCount,s=o),r=r.getParentKey()}return!!s&&(s.visible=!0,e.add(s.key.id),!0)}};const jAt="esri.views.layers.FeatureLayerView",Nke=Ei.getLogger(jAt),asr=t=>{let e=class extends t{constructor(...i){super(...i),this._updatingRequiredFieldsPromise=null,this.filter=null,this.timeExtent=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.handles.add([Qi(()=>{const i=this.layer;return[i?.elevationInfo?.featureExpressionInfo,i&&"displayField"in i?i.displayField:null,i&&"timeInfo"in i&&i.timeInfo,i&&"renderer"in i&&i.renderer,i&&"labelingInfo"in i&&i.labelingInfo,i&&"floorInfo"in i&&i.floorInfo,this.filter,this.featureEffect,this.timeExtent]},()=>this._handleRequiredFieldsChange(),jh),ku(()=>this.view?.floors,"change",()=>this._handleRequiredFieldsChange()),ku(()=>{const i=this.layer;return i&&"sublayers"in i?i.sublayers:null},"change",()=>this._handleRequiredFieldsChange())])}get availableFields(){const{layer:i,layer:{fieldsIndex:r},requiredFields:n}=this;return"outFields"in i&&i.outFields?rW(r,[...Mne(r,i.outFields),...n]):rW(r,n)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(i){this._override("featureEffect",i)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(i){Nke.error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(i){throw new Error("missing implementation")}createQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},r=ye(this.filter)?this.filter.createQuery(i):new Ss(i);if(this.layer.type==="feature"){const n=aZe(this);ye(n)&&(r.where=r.where?`(${r.where}) AND (${n})`:n)}return ye(this.timeExtent)&&(r.timeExtent=ye(r.timeExtent)?r.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),r}createAggregateQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new Ss(i)}queryFeatures(i,r){throw new Error("missing implementation")}queryObjectIds(i,r){throw new Error("missing implementation")}queryFeatureCount(i,r){throw new Error("missing implementation")}queryExtent(i,r){throw new Error("missing implementation")}async fetchPopupFeatures(i,r){const n=this.validateFetchPopupFeatures(r);if(n)throw n;return this.fetchClientPopupFeatures(r)}_loadArcadeModules(i){return i.get("expressionInfos.length")||Array.isArray(i.content)&&i.content.some(r=>r.type==="expression")?Wv():Promise.resolve()}_handleRequiredFieldsChange(){const i=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",i),i.then(()=>{this._updatingRequiredFieldsPromise===i&&this._set("_updatingRequiredFieldsPromise",null)})}async _updateRequiredFields(){if(!this.layer||!this.view)return;const i=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,c=new Set,d=await bu([o?o.collectRequiredFields(c,n):null,Mje(c,r),i?aBt(c,r):null,ye(this.filter)?Rje(c,r,this.filter):null,ye(this.featureEffect)?Rje(c,r,this.featureEffect.filter):null,l?uBt(c,r,l):null,a?hBt(c,r,a):null]);if("timeInfo"in r&&r.timeInfo&&this.timeExtent&&uR(c,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),r.type==="feature"&&(r.floorInfo&&uR(c,r.fieldsIndex,[r.floorInfo.floorField]),i&&ye(r.infoFor3D)&&(r.globalIdField==null&&Nke.error("globalIdField missing on 3DObjectFeatureLayer"),uR(c,r.fieldsIndex,[r.globalIdField]))),r.type==="subtype-group"){Yy(c,n,r.subtypeField);const y=r.sublayers.map(v=>Promise.all([v.renderer?.collectRequiredFields(c,n),Mje(c,v)]));await bu(y)}for(const y of d)y.error&&Nke.error(y.error);Yy(c,n,s),i&&"displayField"in r&&r.displayField&&Yy(c,n,r.displayField);const p=Array.from(c).sort();this._set("requiredFields",p)}validateFetchPopupFeatures(i){if(lt(i))return null;for(const r of i.clientGraphics??[]){const n=r.layer;if("popupEnabled"in n&&!n.popupEnabled)return new st("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:n});if(r.isAggregate){const s="featureReduction"in n?n.featureReduction:null;if(!(s&&"popupTemplate"in s&&s.popupEnabled&&s.popupTemplate))return new st("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:n})}else if("popupTemplate"in n&&!DF(n,i))return new st("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:n})}}async fetchClientPopupFeatures(i){const r=ye(i)?i.clientGraphics:null;if(!r||r.length===0)return[];const n=new Array(r.length),s=new Map,o=await this.createPopupQuery(i);for(let a=0;aa.layer):[this.layer];for(const a of o){if(!("popupEnabled"in a))continue;const l=DF(a,i);if(lt(l))continue;const c=await this._loadArcadeModules(l),d=c&&c.arcadeUtils.hasGeometryOperations(l);s=!(this.layer.geometryType!=="point"&&!d);const p=await cge(this.layer,l);for(const y of p)n.add(y)}if(r.returnGeometry=s,r.returnZ=s,r.returnM=s,r.outFields=Array.from(n),r.outSpatialReference=this.view.spatialReference,this.layer.type==="feature"){const a=aZe(this);ye(a)&&(r.where=r.where?`(${r.where}) AND (${a})`:a)}return r}canResume(){return!!super.canResume()&&(!ye(this.timeExtent)||!this.timeExtent.isEmpty)}};return E([k()],e.prototype,"_updatingRequiredFieldsPromise",void 0),E([k({readOnly:!0})],e.prototype,"availableFields",null),E([k({type:fWe})],e.prototype,"featureEffect",null),E([k({type:bq})],e.prototype,"filter",void 0),E([k(j9)],e.prototype,"timeExtent",void 0),E([k()],e.prototype,"layer",void 0),E([k({type:Number})],e.prototype,"maximumNumberOfFeatures",null),E([k({readOnly:!0,type:Boolean})],e.prototype,"maximumNumberOfFeaturesExceeded",null),E([k({readOnly:!0})],e.prototype,"requiredFields",void 0),E([k()],e.prototype,"suspended",void 0),E([k()],e.prototype,"view",void 0),e=E([ht(jAt)],e),e};function zAt(t){return t&&"openPorts"in t}let T0=class extends asr(MF(_y(by))){constructor(){super(...arguments),this._pipelineIsUpdating=!0,this._commandsQueue=new isr({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"refresh":return this._doRefresh(e.dataChanged);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=$y(async()=>this._proxy.setHighlight(Array.from(this._highlightIds.keys()))),this._uploadsLocked=!1,this._needsClusterSizeUpdate=!1,this.featureEffectView=new Qnr,this._lastDefinitionExpression=null}destroy(){ya(this._updateClusterSizeTask,e=>e.remove()),this._proxy?.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(Promise.all([this._initProxy(),this._initServiceOptions()])),this.addHandles([this.on("valueRangesChanged",e=>{this._set("_aggregateValueRanges",e.valueRanges)}),Qi(()=>this.featureEffect,e=>{this.featureEffectView.featureEffect=e},jh)],"constructor"),this.featureEffectView.endTransitions()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new st("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});if((e.type==="feature"||e.type==="subtype-group")&&!TL(e)?.operations.supportsQuery)throw new st("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._proxy&&this._proxy.destroy();const i=this._createClientOptions();return this._set("_proxy",new nsr({client:i})),this._proxy.when()}async _initServiceOptions(){return this._set("_serviceOptions",await this._createServiceOptions()),this._serviceOptions}get _effectiveFeatureReduction(){if(!("featureReduction"in this.layer))return null;const e=this.layer.featureReduction;return e&&(!("maxScale"in e)||!e.maxScale||e.maxScalei.labelingInfo&&i.labelsVisible)}get queryMode(){return this._serviceOptions?.type}get renderingConfigHash(){if(!this.layer)return null;const e=this.availableFields,i=this.layer,r=this.view.floors,{definitionExpression:n}=i,s=this.layer.type!=="subtype-group"&&this.layer.labelsVisible&&this.layer.labelingInfo,o="renderer"in i&&i.renderer,a="gdbVersion"in i?i.gdbVersion:void 0,l="historicMoment"in i?i.historicMoment?.getTime():void 0,{timeExtent:c}=this,d="customParameters"in i?JSON.stringify(i.customParameters):void 0,p="apiKey"in i?i.apiKey:void 0,y=i.type==="stream"?`${JSON.stringify(i.geometryDefinition)}${i.definitionExpression}`:null,v=JSON.stringify(this.clips),S=this._effectiveFeatureReduction?.toJSON(),I="orderBy"in this.layer&&JSON.stringify(this.layer.orderBy),O="sublayers"in this.layer&&this.layer.sublayers.items.reduce((N,G)=>N+`${G.visible?1:0}.${JSON.stringify(G.renderer)}.${G.labelsVisible} -.${JSON.stringify(G.labelingInfo)}`,""),L="subtypeCode"in this.layer&&this.layer.subtypeCode;return JSON.stringify({orderBy:I,sublayerHash:O,subtypeCode:L,filterHash:ye(this.filter)&&this.filter.toJSON(),effectHash:ye(this.featureEffect)&&this.featureEffect.toJSON(),streamFilter:y,gdbVersion:a,definitionExpression:n,historicMoment:l,availableFields:e,renderer:o,labelingInfo:s,timeExtent:c,floors:r,clipsHash:v,featureReduction:S,customParameters:d,apiKey:p})}highlight(e){let i;e instanceof js?i=[e.getObjectId()]:typeof e=="number"||typeof e=="string"?i=[e]:fr.isCollection(e)&&e.length>0?i=e.map(n=>n?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(i=typeof e[0]=="number"||typeof e[0]=="string"?e:e.map(n=>n?.getObjectId()));const r=i?.filter(ye);return r&&r.length?(this._addHighlight(r),{remove:()=>this._removeHighlight(r)}):{remove:()=>{}}}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,i){if(!this.tileRenderer)return null;const r=await this.tileRenderer.hitTest(i);if(r.length===0)return null;const{features:n,aggregates:s}=await this._proxy.getFeatures(r);return[...s.map(o=>this._createGraphicHit(e,Lke.fromJSON(o))),...n.map(o=>this._createGraphicHit(e,js.fromJSON(o)))]}queryStatistics(){return this._proxy.queryStatistics()}async querySummaryStatistics(e,i,r){const n={...i,scale:this.view.scale};return this._proxy.querySummaryStatistics(this._cleanUpQuery(e),n,r)}async queryAggregateSummaryStatistics(e,i,r){const n={...i,scale:this.view.scale};return this._proxy.queryAggregateSummaryStatistics(this._cleanUpAggregateQuery(e),n,r)}async queryUniqueValues(e,i,r){const n={...i,scale:this.view.scale};return this._proxy.queryUniqueValues(this._cleanUpQuery(e),n,r)}async queryAggregateUniqueValues(e,i,r){const n={...i,scale:this.view.scale};return this._proxy.queryAggregateUniqueValues(this._cleanUpAggregateQuery(e),n,r)}async queryClassBreaks(e,i,r){const n={...i,scale:this.view.scale};return this._proxy.queryClassBreaks(this._cleanUpQuery(e),n,r)}async queryAggregateClassBreaks(e,i,r){const n={...i,scale:this.view.scale};return this._proxy.queryAggregateClassBreaks(this._cleanUpAggregateQuery(e),n,r)}async queryHistogram(e,i,r){const n={...i,scale:this.view.scale};return this._proxy.queryHistogram(this._cleanUpQuery(e),n,r)}async queryAggregateHistogram(e,i,r){const n={...i,scale:this.view.scale};return this._proxy.queryAggregateHistogram(this._cleanUpAggregateQuery(e),n,r)}queryFeatures(e,i){return this.queryFeaturesJSON(e,i).then(r=>{const n=Wu.fromJSON(r);return n.features.forEach(s=>this._setLayersForFeature(s)),n})}queryVisibleFeatures(e,i){return this._proxy.queryVisibleFeatures(this._cleanUpQuery(e),i).then(r=>{const n=Wu.fromJSON(r);return n.features.forEach(s=>this._setLayersForFeature(s)),n})}async queryAggregates(e,i){const r=await this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),i),n=esr.fromJSON(r);return n.features.forEach(s=>this._setLayersForFeature(s)),n}queryAggregateIds(e,i){return this._proxy.queryAggregateIds(this._cleanUpAggregateQuery(e),i)}queryAggregateCount(e,i){return this._proxy.queryAggregateCount(this._cleanUpAggregateQuery(e),i)}queryAggregateJSON(e,i){return this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),i)}queryFeaturesJSON(e,i){return this._proxy.queryFeatures(this._cleanUpQuery(e),i)}queryObjectIds(e,i){return this._proxy.queryObjectIds(this._cleanUpQuery(e),i)}queryFeatureCount(e,i){return this._proxy.queryFeatureCount(this._cleanUpQuery(e),i)}queryExtent(e,i){return this._proxy.queryExtent(this._cleanUpQuery(e),i).then(r=>({count:r.count,extent:vr.fromJSON(r.extent)}))}setVisibility(e,i){i?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._tileStrategy||!this.tileRenderer)return;const{hasMissingTiles:i,added:r,removed:n}=this._tileStrategy.update(e);(r.length||n.length)&&this._proxy.updateTiles({added:r,removed:n}),i&&this.requestUpdate(),this.notifyChange("updating")}attach(){this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._tileStrategy=new osr({acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme,buffer:0}),this.addAttachHandles(Qi(()=>this.renderingConfigHash,()=>this._update(),Fo)),this.layer.type!=="stream"&&this.addAttachHandles(this.layer.on("edits",e=>this._edit(e)))}detach(){this._commandsQueue.clear(),this._proxy?.stop(),this.container.removeAllChildren(),this.tileRenderer?.uninstall(this.container),this.tileRenderer=null,this._tileStrategy=ra(this._tileStrategy),this._tileRendererHash=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&this.layer.renderer!=null,i=this._commandsQueue.updating,r=this._updatingRequiredFieldsPromise!=null,n=!this._proxy||!this._proxy.isReady,s=this._pipelineIsUpdating,o=this.tileRenderer==null||this.tileRenderer?.updating,a=e&&(i||r||n||s||o);return Gi("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${a} + }`;this._program=e.programCache.acquire(i,r,cPt().attributes)}_updateMatricesAndLocalOrigin(e){const{state:i}=e,{displayMat3:r,size:n,resolution:s,pixelRatio:o,rotation:a,viewpoint:l}=i,c=ysr*a,{x:h,y:p}=l.targetGeometry,y=_Ce(h,i.spatialReference);this._localOrigin.x=y,this._localOrigin.y=p;const v=o*n[0],x=o*n[1],I=s*v,P=s*x,F=iP(this._dvsMat3);cv(F,F,r),dg(F,F,mp(v/2,x/2)),rP(F,F,nO(n[0]/I,-x/P,1)),wT(F,F,-c)}_updateBufferData(e,i){const{x:r,y:n}=this._localOrigin,s=2*vsr*i.length,o=new Float32Array(s),a=new Uint32Array(8*i.length);let l=0,c=0;for(const h of i)h&&(o[2*l+0]=h[0]-r,o[2*l+1]=h[1]-n,o[2*l+2]=h[0]-r,o[2*l+3]=h[3]-n,o[2*l+4]=h[2]-r,o[2*l+5]=h[3]-n,o[2*l+6]=h[2]-r,o[2*l+7]=h[1]-n,a[c+0]=l+0,a[c+1]=l+3,a[c+2]=l+3,a[c+3]=l+2,a[c+4]=l+2,a[c+5]=l+1,a[c+6]=l+1,a[c+7]=l+0,l+=4,c+=8);if(this._vertexBuffer?this._vertexBuffer.setData(o.buffer):this._vertexBuffer=aa.createVertex(e,Xo.DYNAMIC_DRAW,o.buffer),this._indexBuffer?this._indexBuffer.setData(a):this._indexBuffer=aa.createIndex(e,Xo.DYNAMIC_DRAW,a),!this._vao){const h=cPt();this._vao=new Mc(e,h.attributes,h.bufferLayouts,{geometry:this._vertexBuffer},this._indexBuffer)}}};const cPt=()=>iO("bounds",{geometry:[{location:0,name:"a_position",count:2,type:Bi.FLOAT}]});let hPt=class extends uPt{constructor(e){super(e),this.hasHighlight=()=>!0}destroy(){super.destroy(),this._boundsRenderer=da(this._boundsRenderer)}enableRenderingBounds(e){this._boundsRenderer=new _sr(e),this.requestRender()}get hasLabels(){return!1}onTileData(e,i){e.patch(i),this.contains(e)||this.addChild(e),this.requestRender()}onTileError(e){e.clear(),this.contains(e)||this.addChild(e)}_renderChildren(e,i){for(const r of this.children)r.isReady&&r.hasData&&(r.commit(e),e.context.setStencilFunction(kl.EQUAL,r.stencilRef,255),r.getDisplayList().replay(e,r,i))}},AO=class extends hPt{renderChildren(e){this.attributeView.update(),this.children.some(i=>i.hasData)&&(this.attributeView.bindTextures(e.context,!1),super.renderChildren(e),e.drawPhase===mo.MAP&&this._renderChildren(e),this.hasHighlight()&&e.drawPhase===mo.HIGHLIGHT&&this._renderHighlight(e),this._boundsRenderer&&this._boundsRenderer.doRender(e))}_renderHighlight(e){const{painter:i}=e,r=i.effects.highlight;r.bind(e),this._renderChildren(e,r.defines),r.draw(e),r.unbind()}};const Ige="esri-zoom-box",Age={container:`${Ige}__container`,overlay:`${Ige}__overlay`,background:`${Ige}__overlay-background`,box:`${Ige}__outline`},jNe={zoom:"Shift",counter:"Ctrl"};let lee=class extends Tn{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._handles=null,this._redraw=this._redraw.bind(this)}destroy(){this.view=null}set view(e){this._handles&&this._handles.forEach(i=>{i.remove()}),this._handles=null,this._destroyOverlay(),this._set("view",e),e&&(e.on("drag",[jNe.zoom],i=>this._handleDrag(i,1),yT.INTERNAL),e.on("drag",[jNe.zoom,jNe.counter],i=>this._handleDrag(i,-1),yT.INTERNAL))}_start(){this._createContainer(),this._createOverlay(),this.navigation.begin()}_update(e,i,r,n){this._box.x=e,this._box.y=i,this._box.width=r,this._box.height=n,this._rafId||(this._rafId=requestAnimationFrame(this._redraw))}_end(e,i,r,n,s){const o=this.view,a=o.toMap(zh(e+.5*r,i+.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,i,r,n){const s=this._boxShape;s.setAttributeNS(null,"x",""+e),s.setAttributeNS(null,"y",""+i),s.setAttributeNS(null,"width",""+r),s.setAttributeNS(null,"height",""+n),s.setAttributeNS(null,"class",Age.box)}_updateBackground(e,i,r,n){this._backgroundShape.setAttributeNS(null,"d",this._toSVGPath(e,i,r,n,this.view.width,this.view.height))}_createContainer(){const e=document.createElement("div");e.className=Age.container,this.view.root.appendChild(e),this._container=e}_createOverlay(){const e=this.view.width,i=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+" "+i+" L 0 "+i+" Z"),r.setAttributeNS(null,"class",Age.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",Age.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,i,r,n,s,o){const a=e+r,l=i+n;return"M 0 0 L "+s+" 0 L "+s+" "+o+" L 0 "+o+" ZM "+e+" "+i+" L "+e+" "+l+" L "+a+" "+l+" L "+a+" "+i+" Z"}_handleDrag(e,i){const r=e.x,n=e.y,s=e.origin.x,o=e.origin.y;let a,l,c,h;switch(r>s?(a=s,c=r-s):(a=r,c=s-r),n>o?(l=o,h=n-o):(l=n,h=o-n),e.action){case"start":this._start();break;case"update":this._update(a,l,c,h);break;case"end":this._end(a,l,c,h,i)}e.stopPropagation()}_redraw(){if(!this._rafId||(this._rafId=null,!this._overlay))return;const{x:e,y:i,width:r,height:n}=this._box;this._updateBox(e,i,r,n),this._updateBackground(e,i,r,n),this._rafId=requestAnimationFrame(this._redraw)}};E([N()],lee.prototype,"navigation",void 0),E([N()],lee.prototype,"view",null),lee=E([dt("esri.views.2d.navigation.ZoomBox")],lee);const bsr=lee;let FF=class{constructor(e){this._gain=e,this.lastValue=void 0,this.filteredDelta=void 0}update(e){if(this.hasLastValue()){const i=this.computeDelta(e);this._updateDelta(i)}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}},GNe=class{constructor(e,i,r){this._initialVelocity=e,this._stopVelocity=i,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,i){const r=this.value(e);return this.value(e+i)-r}valueFromInitialVelocity(e,i){i=Math.min(i,this.duration);const r=1-this.friction;return e*(r**i-1)/Math.log(r)}},wsr=class extends GNe{constructor(e,i,r,n,s){super(e,i,r),this._sceneVelocity=n,this.direction=s}value(e){return super.valueFromInitialVelocity(this._sceneVelocity,e)}},xsr=class{constructor(e=300,i=12,r=.84){this._minimumInitialVelocity=e,this._stopVelocity=i,this._friction=r,this.enabled=!0,this._time=new FF(.6),this._screen=[new FF(.4),new FF(.4)],this._scene=[new FF(.6),new FF(.6),new FF(.6)],this._tmpDirection=hn()}add(e,i,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(i[0]),this._scene[1].update(i[1]),this._scene[2].update(i[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,i=this._screen[1].filteredDelta,r=e==null||i==null?0:Math.sqrt(e*e+i*i),n=this._time.filteredDelta,s=n==null||r==null?0:r/n;return Math.abs(s)0&&Uh(this._tmpDirection,this._tmpDirection,1/n);const s=this._time.filteredDelta;return new wsr(e,i,r,s==null?0:n/s,this._tmpDirection)}},UU=class extends Tn{constructor(e){super(e),this.animationTime=0,this.momentumEstimator=new xsr(500,6,.92),this.momentum=null,this.tmpMomentum=hn(),this.momentumFinished=!1,this.viewpoint=new p_({targetGeometry:new er,scale:0,rotation:0}),this._previousDrag=null,Yg(()=>this.momentumFinished,()=>this.navigation.stop())}begin(e,i){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(i),this._previousDrag=i}update(e,i){this.addToEstimator(i);let r=i.center.x,n=i.center.y;const s=this._previousDrag;r=s?s.center.x-r:-r,n=s?n-s.center.y:n,e.viewpoint=TM(this.viewpoint,e.viewpoint,[r||0,n||0]),this._previousDrag=i}end(e,i){this.addToEstimator(i);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 i=e.center.x,r=e.center.y,n=yVt(-i,r),s=ja(-i,r,0);this.momentumEstimator.add(n,s,.001*e.timestamp)}onAnimationUpdate(e){this.navigation.animationManager?.animateContinous(e.viewpoint,(i,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);Uh(o,n.direction,l),TM(i,i,o),e.constraints.constrainByGeometry(i)}this.animationTime+=a})}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())}};E([N()],UU.prototype,"momentumFinished",void 0),E([N()],UU.prototype,"viewpoint",void 0),E([N()],UU.prototype,"navigation",void 0),UU=E([dt("esri.views.2d.navigation.actions.Pan")],UU);const Ssr=UU;let dPt=class{constructor(e=2.5,i=.01,r=.95,n=12){this._minimumInitialVelocity=e,this._stopVelocity=i,this._friction=r,this._maxVelocity=n,this.enabled=!0,this.value=new FF(.8),this.time=new FF(.3)}add(e,i){if(this.enabled&&i!=null){if(this.time.hasLastValue()){if(this.time.computeDelta(i)<.01)return;if(this.value.hasFilteredDelta()){const r=this.value.computeDelta(e);this.value.filteredDelta*r<0&&this.value.reset()}}this.time.update(i),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=eu(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,i)}},Tsr=class extends GNe{constructor(e,i,r){super(e,i,r)}value(e){const i=super.value(e);return Math.exp(i)}valueDelta(e,i){const r=super.value(e),n=super.value(e+i)-r;return Math.exp(n)}},Esr=class extends dPt{constructor(e=2.5,i=.01,r=.95,n=12){super(e,i,r,n)}add(e,i){super.add(Math.log(e),i)}createMomentum(e,i,r){return new Tsr(e,i,r)}},zU=class extends Tn{constructor(e){super(e),this._animationTime=0,this._momentumFinished=!1,this._previousAngle=0,this._previousRadius=0,this._previousCenter=null,this._rotationMomentumEstimator=new Csr(.6,.15,.95),this._rotationDirection=1,this._startAngle=0,this._startRadius=0,this._updateTimestamp=null,this._zoomDirection=1,this._zoomMomentumEstimator=new Esr,this._zoomOnly=null,this.zoomMomentum=null,this.rotateMomentum=null,this.viewpoint=new p_({targetGeometry:new er,scale:0,rotation:0}),this.addHandles(Yg(()=>this._momentumFinished,()=>this.navigation.stop()))}begin(e,i){this.navigation.begin(),this._rotationMomentumEstimator.reset(),this._zoomMomentumEstimator.reset(),this._zoomOnly=null,this._previousAngle=this._startAngle=i.angle,this._previousRadius=this._startRadius=i.radius,this._previousCenter=i.center,this._updateTimestamp=null,e.constraints.rotationEnabled&&this.addToRotateEstimator(0,i.timestamp),this.addToZoomEstimator(i,1)}update(e,i){this._updateTimestamp===null&&(this._updateTimestamp=i.timestamp);const r=i.angle,n=i.radius,s=i.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 c=n/this._previousRadius;let h=180*(r-this._previousAngle)/Math.PI;this._rotationDirection=h>=0?1:-1,this._zoomDirection=c>=1?1:-1,e.constraints.rotationEnabled?(this._zoomOnly===null&&i.timestamp-this._updateTimestamp>200&&(this._zoomOnly=a-o>0),this._zoomOnly===null||this._zoomOnly?h=0:this.addToRotateEstimator(r-this._startAngle,i.timestamp)):h=0,this.addToZoomEstimator(i,l),this.navigation.setViewpoint([s.x,s.y],1/c,h,[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,i){this._rotationMomentumEstimator.add(e,.001*i)}addToZoomEstimator(e,i){this._zoomMomentumEstimator.add(i,.001*e.timestamp)}canZoomIn(e){const i=e.scale,r=e.constraints.effectiveMaxScale;return r===0||i>r}canZoomOut(e){const i=e.scale,r=e.constraints.effectiveMinScale;return r===0||i{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 c=this.zoomMomentum?Math.abs(this.zoomMomentum.valueDelta(this._animationTime,a)):1;const h=rl(),p=rl();if(this._previousCenter){ga(h,this._previousCenter.x,this._previousCenter.y),FIe(p,e.size,e.padding),AIe(h,h,p);const{constraints:y,scale:v}=e,x=v*c;c<1&&!y.canZoomInTo(x)?(c=v/y.effectiveMaxScale,this.zoomMomentum=null,this.rotateMomentum=null):c>1&&!y.canZoomOutTo(x)&&(c=v/y.effectiveMinScale,this.zoomMomentum=null,this.rotateMomentum=null),jIe(i,e.viewpoint,c,l,h,e.size),e.constraints.constrainByGeometry(i)}}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())}};E([N()],zU.prototype,"_momentumFinished",void 0),E([N()],zU.prototype,"viewpoint",void 0),E([N()],zU.prototype,"navigation",void 0),zU=E([dt("esri.views.2d.navigation.actions.Pinch")],zU);const Isr=zU,UNe=rl(),pPt=rl();let uee=class extends Tn{constructor(e){super(e),this._previousCenter=rl(),this.viewpoint=new p_({targetGeometry:new er,scale:0,rotation:0})}begin(e,i){this.navigation.begin(),ga(this._previousCenter,i.center.x,i.center.y)}update(e,i){const{state:{size:r,padding:n}}=e;ga(UNe,i.center.x,i.center.y),Hit(pPt,r,n),e.viewpoint=VIe(this.viewpoint,e.state.paddedViewState.viewpoint,Wit(pPt,this._previousCenter,UNe)),tV(this._previousCenter,UNe)}end(){this.navigation.end()}};E([N()],uee.prototype,"viewpoint",void 0),E([N()],uee.prototype,"navigation",void 0),uee=E([dt("esri.views.2d.actions.Rotate")],uee);const Asr=uee,Pge=10,fPt=1,zNe=new p_({targetGeometry:new er}),HNe=[0,0],mPt=250;let YE=class extends Tn{constructor(e){super(e),this._endTimer=null,this._lastEventTimestamp=null,this.animationManager=null,this.interacting=!1}initialize(){this.pan=new Ssr({navigation:this}),this.rotate=new Asr({navigation:this}),this.pinch=new Isr({navigation:this}),this.zoomBox=new bsr({view:this.view,navigation:this})}destroy(){this.pan=da(this.pan),this.rotate=da(this.rotate),this.pinch=da(this.pinch),this.zoomBox=da(this.zoomBox),this.animationManager=null}begin(){this._set("interacting",!0)}end(){this._lastEventTimestamp=performance.now(),this._startTimer(mPt)}async zoom(e,i=this._getDefaultAnchor()){if(this.stop(),this.begin(),this.view.constraints.snapToZoom&&this.view.constraints.effectiveLODs)return e<1?this.zoomIn(i):this.zoomOut(i);this.setViewpoint(i,e,0,[0,0])}async zoomIn(e){const i=this.view,r=i.constraints.snapToNextScale(i.scale);return this._zoomToScale(r,e)}async zoomOut(e){const i=this.view,r=i.constraints.snapToPreviousScale(i.scale);return this._zoomToScale(r,e)}setViewpoint(e,i,r,n){this.begin(),this.view.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,e,i,r,n),this.end()}setViewpointImmediate(e,i=0,r=[0,0],n=this._getDefaultAnchor()){this.view.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,n,e,i,r)}continousRotateClockwise(){const e=this.get("view.viewpoint");this.animationManager?.animateContinous(e,i=>{VIe(i,i,-fPt)})}continousRotateCounterclockwise(){const e=this.get("view.viewpoint");this.animationManager?.animateContinous(e,i=>{VIe(i,i,fPt)})}resetRotation(){this.view.rotation=0}continousPanLeft(){this._continuousPan([-Pge,0])}continousPanRight(){this._continuousPan([Pge,0])}continousPanUp(){this._continuousPan([0,Pge])}continousPanDown(){this._continuousPan([0,-Pge])}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 i=this.view.viewpoint;this.animationManager?.animateContinous(i,r=>{TM(r,r,e),this.view.constraints.constrainByGeometry(r)})}_startTimer(e){return this._endTimer!==null||(this._endTimer=setTimeout(()=>{this._endTimer=null;const i=performance.now()-(this._lastEventTimestamp??0);is&&!h))return Yit(zNe,o,e/s,0,i,a,l),n.constrainByGeometry(zNe),r.goTo(zNe,{animate:!0})}_scaleRotateTranslateViewpoint(e,i,r,n,s){const{view:o}=this,{size:a,padding:l,constraints:c,scale:h,viewpoint:p}=o,y=h*r,v=c.canZoomInTo(y),x=c.canZoomOutTo(y);return(r<1&&!v||r>1&&!x)&&(r=1),TM(p,p,s),Yit(e,p,r,n,i,a,l),c.constrainByGeometry(e)}};E([N()],YE.prototype,"animationManager",void 0),E([N({type:Boolean,readOnly:!0})],YE.prototype,"interacting",void 0),E([N()],YE.prototype,"pan",void 0),E([N()],YE.prototype,"pinch",void 0),E([N()],YE.prototype,"rotate",void 0),E([N()],YE.prototype,"view",void 0),E([N()],YE.prototype,"zoomBox",void 0),YE=E([dt("esri.views.2d.navigation.MapViewNavigation")],YE);const Psr=YE,gPt={shaders:{vertexShader:Ig("magnifier/magnifier.vert"),fragmentShader:Ig("magnifier/magnifier.frag")},attributes:new Map([["a_pos",0]])};function Osr(t){return $E(t,gPt)}async function Oge(t,e){const{data:i}=await ur(t,{responseType:"image",...e});return i}async function Rsr(t){const e=Promise.resolve().then(()=>YPr),i=Promise.resolve().then(()=>XPr),r=Oge((await e).default,{signal:t}),n=Oge((await i).default,{signal:t}),s={mask:await r,overlay:await n};return yn(t),s}const yPt=Object.freeze(Object.defineProperty({__proto__:null,GraphicContainer:AO,GraphicsView2D:gx,LabelManager:Nir,MagnifierView2D:class extends CS{constructor(){super(),this._handles=new df,this._resourcePixelRatio=1,this.visible=!1}destroy(){this._handles=da(this._handles),this._disposeRenderResources(),this._resourcesTask=oL(this._resourcesTask)}get background(){return this._background}set background(e){this._background=e,this.requestRender()}get magnifier(){return this._magnifier}set magnifier(e){this._magnifier=e,this._handles.removeAll(),this._handles.add([sr(()=>e.version,()=>{this.visible=e.visible&&ve(e.position)&&e.size>0,this.requestRender()},Yo),sr(()=>[e.maskUrl,e.overlayUrl],()=>this._reloadResources()),sr(()=>e.size,()=>{this._disposeRenderResources(),this.requestRender()})])}_createTransforms(){return{dvs:Dl()}}doRender(e){const i=e.context;if(!this._resourcesTask)return void this._reloadResources();if(e.drawPhase!==mo.MAP||!this._canRender())return;this._updateResources(e);const r=this._magnifier;if(lt(r.position))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,c=n*l[0],h=n*l[1],p=.5*a,y=.5*a,v=eu(n*r.position.x,p,c-p-1),x=eu(h-n*r.position.y,y,h-y-1);i.setBlendingEnabled(!0);const I=v-p,P=x-y,F=this._readbackTexture;i.bindTexture(F,0),i.gl.copyTexImage2D(F.descriptor.target,0,F.descriptor.pixelFormat,I,P,a,a,0);const k=this.background?.color,j=k?[k.a*k.r/255,k.a*k.g/255,k.a*k.b/255,k.a]:[1,1,1,1],V=(v+r.offset.x*n)/c*2-1,Y=(x-r.offset.y*n)/h*2-1,X=s/c*2,Z=s/h*2,ie=this._program;i.bindVAO(this._vertexArrayObject),i.bindTexture(this._overlayTexture,6),i.bindTexture(this._maskTexture,7),i.useProgram(ie),ie.setUniform4fv("u_background",j),ie.setUniform1i("u_readbackTexture",0),ie.setUniform1i("u_overlayTexture",6),ie.setUniform1i("u_maskTexture",7),ie.setUniform4f("u_drawPos",V,Y,X,Z),ie.setUniform1i("u_maskEnabled",r.maskEnabled?1:0),ie.setUniform1i("u_overlayEnabled",r.overlayEnabled?1:0),i.setStencilTestEnabled(!1),i.setColorMask(!0,!0,!0,!0),i.drawArrays(bs.TRIANGLE_STRIP,0,4),i.bindVAO()}_canRender(){return this.mask&&this.overlay&&this._magnifier!=null}_reloadResources(){this._resourcesTask&&this._resourcesTask.abort();const e=ve(this._magnifier)?this._magnifier.maskUrl:null,i=ve(this._magnifier)?this._magnifier.overlayUrl:null;this._resourcesTask=CC(async r=>{const n=lt(e)||lt(i)?Rsr(r):null,s=ve(e)?ur(e,{responseType:"image",signal:r}).then(c=>c.data):n.then(c=>c.mask),o=ve(i)?ur(i,{responseType:"image",signal:r}).then(c=>c.data):n.then(c=>c.overlay),[a,l]=await Promise.all([s,o]);this.mask=a,this.overlay=l,this._disposeRenderResources(),this.requestRender()})}_disposeRenderResources(){this._readbackTexture=qa(this._readbackTexture),this._overlayTexture=qa(this._overlayTexture),this._maskTexture=qa(this._maskTexture),this._vertexArrayObject=qa(this._vertexArrayObject),this._program=qa(this._program)}_updateResources(e){if(e.pixelRatio!==this._resourcePixelRatio&&this._disposeRenderResources(),this._readbackTexture)return;const i=e.context;this._resourcePixelRatio=e.pixelRatio;const r=Math.ceil(this._magnifier.size*e.pixelRatio);this._program=Osr(i);const n=new Uint16Array([0,1,0,0,1,1,1,0]),s=gPt.attributes;this._vertexArrayObject=new Mc(i,s,KEt,{geometry:aa.createVertex(i,Xo.STATIC_DRAW,n)}),this.overlay.width=r,this.overlay.height=r,this._overlayTexture=new Fs(i,{target:so.TEXTURE_2D,pixelFormat:gn.RGBA,internalFormat:gn.RGBA,dataType:ds.UNSIGNED_BYTE,wrapMode:ws.CLAMP_TO_EDGE,samplingMode:In.NEAREST,flipped:!0,preMultiplyAlpha:!y$t(this.overlay.src)||!e.context.driverTest.svgPremultipliesAlpha.result},this.overlay),this.mask.width=r,this.mask.height=r,this._maskTexture=new Fs(i,{target:so.TEXTURE_2D,pixelFormat:gn.ALPHA,internalFormat:gn.ALPHA,dataType:ds.UNSIGNED_BYTE,wrapMode:ws.CLAMP_TO_EDGE,samplingMode:In.NEAREST,flipped:!0},this.mask);const o=1/this._magnifier.factor;this._readbackTexture=new Fs(i,{target:so.TEXTURE_2D,pixelFormat:gn.RGBA,internalFormat:gn.RGBA,dataType:ds.UNSIGNED_BYTE,wrapMode:ws.CLAMP_TO_EDGE,samplingMode:In.LINEAR,flipped:!1,width:Math.ceil(o*r),height:Math.ceil(o*r)})}},MapViewNavigation:Psr,Stage:_ir},Symbol.toStringTag,{value:"Module"}));let vPt=class{constructor(e,i,r){this.pixelBlock=e,this.extent=i,this.originalPixelBlock=r}get width(){return ve(this.pixelBlock)?this.pixelBlock.width:0}get height(){return ve(this.pixelBlock)?this.pixelBlock.height:0}render(e){const i=this.pixelBlock;if(lt(i))return;const r=this.filter({extent:this.extent,pixelBlock:this.originalPixelBlock??i});if(lt(r.pixelBlock))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 lt(e.pixelBlock)?null:(e.pixelBlock.maskIsAlpha&&(e.pixelBlock.premultiplyAlpha=!0),{width:e.pixelBlock.width,height:e.pixelBlock.height,renderedRasterPixels:new Uint8Array(e.pixelBlock.getAsRGBA().buffer)})}};function _Pt(t){return t&&"render"in t}function bPt(t){const e=document.createElement("canvas");return e.width=t.width,e.height=t.height,t.render(e.getContext("2d")),e}function Msr(t){return _Pt(t)?t instanceof vPt?Pa(t.getRenderedRasterPixels(),e=>e.renderedRasterPixels):bPt(t):t}let WNe=class extends CS{constructor(e=null,i){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=i.immutable??!1,this.requestRenderOnSourceChangedEnabled=i.requestRenderOnSourceChangedEnabled??!0,this.source=e,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null),ve(this._uploadStatus)&&(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._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),this.invalidateTexture())}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,i){ve(this._uploadStatus)&&this._uploadStatus.controller.abort();const r=new AbortController,n=kf();return F8(i,()=>r.abort()),F8(r,s=>n.reject(s)),this._uploadStatus={controller:r,resolver:n},this.source=e,n.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRenderOnSourceChangedEnabled&&this.requestRender())}updateTransitionProperties(e,i){e>=64&&(this.fadeTransitionEnabled=!1,this.inFadeTransition=!1),super.updateTransitionProperties(e,i)}setTransform(e){const i=iP(this.transforms.dvs),[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;dg(i,i,mp(r,n)),dg(i,i,mp(o/2,a/2)),wT(i,i,-l),dg(i,i,mp(-o/2,-a/2)),Vle(i,i,mp(o,a)),cv(this.transforms.dvs,e.displayViewMat3,i)}setSamplingProfile(e){this._texture&&(e.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(e.samplingMode))}bind(e,i){this._texture&&e.bindTexture(this._texture,i)}async updateTexture({context:e,painter:i}){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=Msr(this.source);try{if(ve(this._uploadStatus)){const{controller:n,resolver:s}=this._uploadStatus,o={signal:n.signal},{width:a,height:l}=this,c=this._texture;await i.textureUploadManager.enqueueTextureUpdate({data:r,texture:c,width:a,height:l},o),s.resolve(),this._uploadStatus=null}else this._texture.setData(r);this.ready()}catch(n){_C(n)}}onDetach(){this.destroy()}_createTransforms(){return{dvs:Dl()}}_createTexture(e){const i=this.immutable&&e.type===bo.WEBGL2;return new Fs(e,{target:so.TEXTURE_2D,pixelFormat:gn.RGBA,internalFormat:i?qs.RGBA8:gn.RGBA,dataType:ds.UNSIGNED_BYTE,wrapMode:ws.CLAMP_TO_EDGE,isImmutable:i,width:this._sourceWidth,height:this._sourceHeight})}},Dsr=class extends RU{constructor(e,i,r,n,s,o,a=null){super(e,i,r,n,s,o),this.bitmap=new WNe(a,{immutable:!1,requestRenderOnSourceChangedEnabled:!1}),this.bitmap.coordScale=[s,o],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy()}beforeRender(e){super.beforeRender(e),this.bitmap.beforeRender(e)}afterRender(e){super.afterRender(e),this.bitmap.afterRender(e)}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{dvs:Dl(),tileMat3:Dl()}}setTransform(e){super.setTransform(e),this.bitmap.transforms.dvs=this.transforms.dvs}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap&&(this.bitmap.stage=null)}},wPt=class extends aee{get requiresDedicatedFBO(){return this.children.some(e=>e.bitmap.blendFunction==="additive")}createTile(e){const i=this._tileInfoView.getTileBounds(Mo(),e),r=this._tileInfoView.getTileResolution(e.level),[n,s]=this._tileInfoView.tileInfo.size;return new Dsr(e,r,i[0],i[3],n,s)}prepareRenderPasses(e){const i=e.registerRenderPass({name:"bitmap (tile)",brushes:[ph.bitmap],target:()=>this.children.map(r=>r.bitmap),drawPhase:mo.MAP});return[...super.prepareRenderPasses(e),i]}doRender(e){this.visible&&e.drawPhase===mo.MAP&&super.doRender(e)}};const xPt=t=>{let e=class extends t{attach(){this.view.timeline.record(`${this.layer.title} (BitmapTileLayer) Attach`),this._bitmapView=new wPt(this._tileInfoView),this.container.addChild(this._bitmapView)}detach(){this.container.removeChild(this._bitmapView),this._bitmapView?.removeAllChildren()}};return e=E([dt("esri.views.2d.layers.BitmapTileLayerView2D")],e),e};let Rge=class extends Ui{get version(){return this.commitVersionProperties(),(this._get("version")||0)+1}};E([N({readOnly:!0})],Rge.prototype,"version",null),Rge=E([dt("esri.views.layers.support.ClipArea")],Rge);const qNe=Rge;var YNe;let G6=YNe=class extends qNe{constructor(t){super(t),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new YNe({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")}};E([N({type:[Number,String],json:{write:!0}})],G6.prototype,"left",void 0),E([N({type:[Number,String],json:{write:!0}})],G6.prototype,"right",void 0),E([N({type:[Number,String],json:{write:!0}})],G6.prototype,"top",void 0),E([N({type:[Number,String],json:{write:!0}})],G6.prototype,"bottom",void 0),G6=YNe=E([dt("esri.views.layers.support.ClipRect")],G6);const Fsr=G6;var XNe;const Lsr={base:un,key:"type",typeMap:{extent:Ar,polygon:To}};let Mge=XNe=class extends qNe{constructor(t){super(t),this.type="geometry",this.geometry=null}clone(){return new XNe({geometry:this.geometry?.clone()??null})}commitVersionProperties(){this.commitProperty("geometry")}};E([N({types:Lsr,json:{read:Sl,write:!0}})],Mge.prototype,"geometry",void 0),Mge=XNe=E([dt("esri.views.layers.support.Geometry")],Mge);const Nsr=Mge;let Dge=class extends qNe{constructor(e){super(e),this.type="path",this.path=[]}commitVersionProperties(){this.commitProperty("path")}};E([N({type:[[[Number]]],json:{write:!0}})],Dge.prototype,"path",void 0),Dge=E([dt("esri.views.layers.support.Path")],Dge);const ksr=Dge,KNe=Sr.ofType({key:"type",base:null,typeMap:{rect:Fsr,path:ksr,geometry:Nsr}}),wy=t=>{let e=class extends t{constructor(){super(...arguments),this.attached=!1,this.clips=new KNe,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this.visibleAtCurrentScale=!1,this.highlightOptions=null}initialize(){const i=this.view?.spatialReferenceLocked??!0;this.view?.spatialReference&&i&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new st("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 CU),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([sr(()=>this.suspended,n=>{this.container&&(this.container.visible=!n),this.view&&!n&&this.updateRequested&&this.view.requestUpdate()},Wh),sr(()=>this.layer?.opacity??1,n=>{this.container&&(this.container.opacity=n)},Wh),sr(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",n=>{this.container&&(this.container.blendMode=n)},Wh),sr(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,n=>{this.container&&(this.container.effect=n)},Wh),sr(()=>this.highlightOptions,n=>this.container.highlightOptions=n,Wh),Wu(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)},Wh),sr(()=>({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)},Wh)],"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 i=this.view?.spatialReference;return i==null||this.supportsSpatialReference(i)}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(i){const r=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;if(!r)return!0;const{minScale:n,maxScale:s}=r;return(n===0||i<=n)&&(s===0||i>=s)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.suspended||this.view.requestUpdate())}processUpdate(i){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",i),this.updateRequested&&!this.suspended&&(this.updateRequested=!1,this.update(i))):this.updateRequested=!1}hitTest(i,r){return Promise.resolve(null)}supportsSpatialReference(i){return!0}canResume(){return!!this.spatialReferenceSupported&&!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const i=super.getSuspendInfo(),r=!this.spatialReferenceSupported,n=this.visibleAtCurrentScale;return r&&(i.spatialReferenceNotSupported=r),n&&(i.outsideScaleRange=n),i}addAttachHandles(i){this.addHandles(i,"attach")}};return E([N()],e.prototype,"attached",void 0),E([N({type:KNe,set(i){const r=og(i,this._get("clips"),KNe);this._set("clips",r)}})],e.prototype,"clips",void 0),E([N()],e.prototype,"container",void 0),E([N()],e.prototype,"moving",void 0),E([N({readOnly:!0})],e.prototype,"spatialReferenceSupported",null),E([N({readOnly:!0})],e.prototype,"updateParameters",void 0),E([N()],e.prototype,"updateRequested",void 0),E([N()],e.prototype,"updating",null),E([N()],e.prototype,"view",void 0),E([N({readOnly:!0})],e.prototype,"visibleAtCurrentScale",void 0),E([N({type:lAe})],e.prototype,"highlightOptions",void 0),e=E([dt("esri.views.2d.layers.LayerView2D")],e),e};let JNe=class extends hPt{doRender(e){e.drawPhase===mo.HIGHLIGHT&&super.doRender(e)}renderChildren(e){if(this.attributeView.update(),!this.children.some(n=>n.hasData))return;this.attributeView.bindTextures(e.context),super.renderChildren(e);const{painter:i}=e,r=i.effects.highlight;r.bind(e),e.context.setColorMask(!0,!0,!0,!0),e.context.clear(cE.COLOR_BUFFER_BIT),this._renderChildren(e,r.defines.concat(["highlightAll"])),r.draw(e),r.unbind()}};JNe=E([dt("esri.views.2d.layers.support.HighlightGraphicContainer")],JNe);const ZNe=JNe;function $sr(t){return t instanceof HTMLImageElement?t.naturalWidth:t.width}function Bsr(t){return t instanceof HTMLImageElement?t.naturalHeight:t.height}function Fge(t,e,i,r){if(i.level===r.level)return e;const n=t.tileInfo.size,s=t.getTileResolution(i.level),o=t.getTileResolution(r.level);let a=t.getLODInfoAt(r.level);const l=a.getXForColumn(r.col),c=a.getYForRow(r.row);a=t.getLODInfoAt(i.level);const h=a.getXForColumn(i.col),p=a.getYForRow(i.row),y=$sr(e)/n[0],v=Bsr(e)/n[1],x=Math.round(y*((l-h)/s)),I=Math.round(v*(-(c-p)/s)),P=Math.round(y*n[0]*(o/s)),F=Math.round(v*n[1]*(o/s)),k=QNe(n);return k.getContext("2d").drawImage(e,x,I,P,F,0,0,n[0],n[1]),k}function QNe(t){const e=document.createElement("canvas");return[e.width,e.height]=t,e}let Ib=class extends Ud(D1(Jx(md.EventedMixin(Tn)))){constructor(e){super(e),this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{if(e.name!=="layerview:create-error"){const i=this.layer&&this.layer.id||"no id",r=this.layer&&this.layer.title||"no title";Oi.getLogger(this.declaredClass).error("#resolve()",`Failed to resolve layer view (layer title: '${r}', id: '${i}')`,e)}})}get fullOpacity(){return zu(this.get("layer.opacity"),1)*zu(this.get("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&&this.parent.suspended?this.parent.suspendInfo:{},i=this;return i.view&&i.view.ready||(e.viewNotReady=!0),this.layer&&this.layer.loaded||(e.layerNotLoaded=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}};E([N()],Ib.prototype,"fullOpacity",null),E([N()],Ib.prototype,"layer",void 0),E([N()],Ib.prototype,"parent",void 0),E([N({readOnly:!0})],Ib.prototype,"suspended",null),E([N({readOnly:!0})],Ib.prototype,"suspendInfo",null),E([N({readOnly:!0})],Ib.prototype,"legendEnabled",null),E([N({type:Boolean,readOnly:!0})],Ib.prototype,"updating",null),E([N({readOnly:!0})],Ib.prototype,"updatingProgress",null),E([N()],Ib.prototype,"visible",null),E([N()],Ib.prototype,"view",void 0),Ib=E([dt("esri.views.layers.LayerView")],Ib);const xy=Ib,LF=t=>{let e=class extends t{initialize(){this.handles.add(Wu(()=>this.layer,"refresh",i=>{this.doRefresh(i.dataChanged).catch(r=>{ys(r)||Oi.getLogger(this.declaredClass).error(r)})}),"RefreshableLayerView")}};return E([N()],e.prototype,"layer",void 0),e=E([dt("esri.layers.mixins.RefreshableLayerView")],e),e};function eke(t,e){return e?"xoffset"in e&&e.xoffset?Math.max(t,Math.abs(e.xoffset)):"yoffset"in e&&e.yoffset?Math.max(t,Math.abs(e.yoffset||0)):t:t}function Vsr(t){let e=0,i=0;for(let r=0;ro.type==="size").map(o=>{const{maxSize:a,minSize:l}=o;return(SPt(a,t)+SPt(l,t))/2});let r=0;const n=i.length;if(n===0)return t;for(let o=0;o{n=eke(n,s.symbol)}),n}if(e.type==="class-breaks"){let n=r;return e.classBreakInfos.forEach(s=>{n=eke(n,s.symbol)}),n}return e.type==="dot-density"||e.type,r}const TPt=t=>t.spatialReference.wkid||JSON.stringify(t.spatialReference);function Gsr(t,e){const{dpi:i,gdbVersion:r,geometry:n,geometryPrecision:s,height:o,layerOption:a,mapExtent:l,maxAllowableOffset:c,returnFieldName:h,returnGeometry:p,returnUnformattedValues:y,returnZ:v,spatialReference:x,timeExtent:I,tolerance:P,width:F}=t.toJSON(),{dynamicLayers:k,layerDefs:j,layerIds:V}=Usr(t),Y=e&&ve(e.geometry)?e.geometry:null,X={geometryPrecision:s,maxAllowableOffset:c,returnFieldName:h,returnGeometry:p,returnUnformattedValues:y,returnZ:v,tolerance:P},Z=Y&&Y.toJSON()||n;if(X.imageDisplay=`${F},${o},${i}`,r&&(X.gdbVersion=r),Z&&(delete Z.spatialReference,X.geometry=JSON.stringify(Z),X.geometryType=bd(Z)),x?X.sr=x.wkid||JSON.stringify(x):Z&&Z.spatialReference?X.sr=TPt(Z):l&&l.spatialReference&&(X.sr=TPt(l)),X.time=I?[I.start,I.end].join(","):null,l){const{xmin:ie,ymin:ce,xmax:he,ymax:_e}=l;X.mapExtent=`${ie},${ce},${he},${_e}`}return j&&(X.layerDefs=j),k&&!j&&(X.dynamicLayers=k),X.layers=a==="popup"?"visible":a,V&&!k&&(X.layers+=`:${V.join(",")}`),X}function Usr(t){const{mapExtent:e,floors:i,width:r,sublayers:n,layerIds:s,layerOption:o,gdbVersion:a}=t,l=n?.find(x=>x.layer!=null)?.layer?.serviceSublayers,c=o==="popup",h={},p=Nae({extent:e,width:r,spatialReference:e?.spatialReference}),y=[],v=x=>{const I=p===0,P=x.minScale===0||p<=x.minScale,F=x.maxScale===0||p>=x.maxScale;if(x.visible&&(I||P&&F))if(x.sublayers)x.sublayers.forEach(v);else{if(s?.includes(x.id)===!1||c&&(!x.popupTemplate||!x.popupEnabled))return;y.unshift(x)}};if(n?.forEach(v),n&&!y.length)h.layerIds=[];else{const x=aZe(y,l,a),I=y.map(P=>{const F=SY(i,P);return P.toExportImageJSON(F)});if(x)h.dynamicLayers=JSON.stringify(I);else{if(n){let F=y.map(({id:k})=>k);s&&(F=F.filter(k=>s.includes(k))),h.layerIds=F}else s?.length&&(h.layerIds=s);const P=zsr(i,y);if(ve(P)&&P.length){const F={};for(const k of P)k.definitionExpression&&(F[k.id]=k.definitionExpression);Object.keys(F).length&&(h.layerDefs=JSON.stringify(F))}}}return h}function zsr(t,e){const i=!!t?.length,r=e.filter(n=>n.definitionExpression!=null||i&&n.floorInfo!=null);return r.length?r.map(n=>{const s=SY(t,n),o=OR(s,n.definitionExpression);return{id:n.id,definitionExpression:zu(o,void 0)}}):null}var tke;let Cp=tke=class extends Ui{static from(t){return Gd(tke,t)}constructor(t){super(t),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,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}};E([N({type:Number,json:{write:!0}})],Cp.prototype,"dpi",void 0),E([N()],Cp.prototype,"floors",void 0),E([N({type:String,json:{write:!0}})],Cp.prototype,"gdbVersion",void 0),E([N({types:R1,json:{read:Sl,write:!0}})],Cp.prototype,"geometry",void 0),E([N({type:Number,json:{write:!0}})],Cp.prototype,"geometryPrecision",void 0),E([N({type:Number,json:{write:!0}})],Cp.prototype,"height",void 0),E([N({type:[Number],json:{write:!0}})],Cp.prototype,"layerIds",void 0),E([N({type:["top","visible","all","popup"],json:{write:!0}})],Cp.prototype,"layerOption",void 0),E([N({type:Ar,json:{write:!0}})],Cp.prototype,"mapExtent",void 0),E([N({type:Number,json:{write:!0}})],Cp.prototype,"maxAllowableOffset",void 0),E([N({type:Boolean,json:{write:!0}})],Cp.prototype,"returnFieldName",void 0),E([N({type:Boolean,json:{write:!0}})],Cp.prototype,"returnGeometry",void 0),E([N({type:Boolean,json:{write:!0}})],Cp.prototype,"returnM",void 0),E([N({type:Boolean,json:{write:!0}})],Cp.prototype,"returnUnformattedValues",void 0),E([N({type:Boolean,json:{write:!0}})],Cp.prototype,"returnZ",void 0),E([N({type:hr,json:{write:!0}})],Cp.prototype,"spatialReference",void 0),E([N()],Cp.prototype,"sublayers",void 0),E([N({type:Xg,json:{write:!0}})],Cp.prototype,"timeExtent",void 0),E([N({type:Number,json:{write:!0}})],Cp.prototype,"tolerance",void 0),E([N({type:Number,json:{write:!0}})],Cp.prototype,"width",void 0),Cp=tke=E([dt("esri.rest.support.IdentifyParameters")],Cp);const EPt=Cp;let PO=class extends Ui{constructor(e){super(e),this.displayFieldName=null,this.feature=null,this.layerId=null,this.layerName=null}readFeature(e,i){return io.fromJSON({attributes:{...i.attributes},geometry:{...i.geometry}})}writeFeature(e,i){if(!e)return;const{attributes:r,geometry:n}=e;r&&(i.attributes={...r}),ve(n)&&(i.geometry=n.toJSON(),i.geometryType=Ine.toJSON(n.type))}};E([N({type:String,json:{write:!0}})],PO.prototype,"displayFieldName",void 0),E([N({type:io})],PO.prototype,"feature",void 0),E([Vi("feature",["attributes","geometry"])],PO.prototype,"readFeature",null),E([Cr("feature")],PO.prototype,"writeFeature",null),E([N({type:Number,json:{write:!0}})],PO.prototype,"layerId",void 0),E([N({type:String,json:{write:!0}})],PO.prototype,"layerName",void 0),PO=E([dt("esri.rest.support.IdentifyResult")],PO);const Hsr=PO;async function Wsr(t,e,i){const r=(e=Ysr(e)).geometry?[e.geometry]:[],n=hh(t);return n.path+="/identify",ov(r).then(s=>{const o=Gsr(e,{geometry:s&&s[0]}),a=iT({...n.query,f:"json",...o}),l=a_(a,i);return ur(n.path,l).then(qsr).then(c=>Xsr(c,e.sublayers))})}function qsr(t){const e=t.data;return e.results=e.results||[],e.exceededTransferLimit=!!e.exceededTransferLimit,e.results=e.results.map(i=>Hsr.fromJSON(i)),e}function Ysr(t){return t=EPt.from(t)}function Xsr(t,e){if(!e?.length)return t;const i=new Map;function r(n){i.set(n.id,n),n.sublayers&&n.sublayers.forEach(r)}e.forEach(r);for(const n of t.results)n.feature.sourceLayer=i.get(n.layerId);return t}async function Lge(t,e=t.popupTemplate){if(lt(e))return[];const i=await e.getRequiredFields(t.fieldsIndex),{lastEditInfoEnabled:r}=e,{objectIdField:n,typeIdField:s,globalIdField:o,relationships:a}=t;if(i.includes("*"))return["*"];const l=r?await NBt(t):[],c=rW(t.fieldsIndex,[...i,...l]);return s&&c.push(s),c&&n&&t.fieldsIndex?.has(n)&&!c.includes(n)&&c.push(n),c&&o&&t.fieldsIndex?.has(o)&&!c.includes(o)&&c.push(o),a&&a.forEach(h=>{const{keyField:p}=h;c&&p&&t.fieldsIndex?.has(p)&&!c.includes(p)&&c.push(p)}),c}function NF(t,e){return t.popupTemplate?t.popupTemplate:ve(e)&&e.defaultPopupTemplateEnabled&&ve(t.defaultPopupTemplate)?t.defaultPopupTemplate:null}let ike=null;function Ksr(t,e){return e.type==="tile"||e.type==="map-image"}let OO=class extends Tn{constructor(e){super(e),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=q0(async i=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(i).catch(()=>{}))})}initialize(){const e=i=>{this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(i).catch(()=>{})),this.updateHighlightedFeatures(this._highlightGeometriesResolution)};this.addHandles([Wu(()=>this.highlightGraphics,"change",i=>e(i.added),{onListenerAdd:i=>e(i)})])}async fetchPopupFeatures(e,i){const{layerView:{layer:r,view:{scale:n}}}=this;if(!e)throw new st("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:r});const s=Jsr(r.sublayers,n,i);if(!s.length)return[];const o=await Qsr(r,s);if(!((r.capabilities?.operations?.supportsIdentify??!0)&&r.version>=10.5)&&!o)throw new st("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:r});return o?this._fetchPopupFeaturesUsingQueries(e,s,i):this._fetchPopupFeaturesUsingIdentify(e,s,i)}clearHighlights(){this.highlightGraphics?.removeAll()}highlight(e){const i=this.highlightGraphics;if(!i)return{remove(){}};let r=null;if(e instanceof io?r=[e]:Sr.isCollection(e)&&e.length>0?r=e.toArray():Array.isArray(e)&&e.length>0&&(r=e),r=r?.filter(ve),!r||!r.length)return{remove:()=>{}};for(const n of r){const s=n.sourceLayer;s!=null&&"geometryType"in s&&s.geometryType==="point"&&(n.visible=!1)}return i.addMany(r),{remove:()=>{i.removeMany(r??[])}}}async _updateHighlightedFeaturesSymbols(e){const{layerView:{view:i},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||(a=new wd);let l=null;const c="visualVariables"in o?o.visualVariables?.find(h=>h.type==="size"):void 0;c&&(ike||(ike=(await Promise.resolve().then(()=>Ase)).getSize),l=ike(c,s,{view:i.type,scale:i.scale,shape:a.type==="simple-marker"?a.style:null})),l||(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 wd({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:i,view:r},highlightGraphics:n,highlightGraphicUpdated:s}=this;if(this._highlightGeometriesResolution=e,!s||!n?.length||!i.capabilities.operations.supportsQuery)return;const o=this._getTargetResolution(e),a=new Map;for(const h of n)if(!this._featuresResolutions.has(h)||this._featuresResolutions.get(h)>o){const p=h.sourceLayer;bC(a,p,()=>new Map).set(h.getObjectId(),h)}const l=Array.from(a,([h,p])=>{const y=h.createQuery();return y.objectIds=[...p.keys()],y.outFields=[h.objectIdField],y.returnGeometry=!0,y.maxAllowableOffset=o,y.outSpatialReference=r.spatialReference,h.queryFeatures(y)}),c=await Promise.all(l);if(!this.destroyed)for(const{features:h}of c)for(const p of h){const y=p.sourceLayer,v=a.get(y).get(p.getObjectId());v&&n.includes(v)&&(v.geometry=p.geometry,s(v,"geometry"),this._featuresResolutions.set(v,o))}}_getTargetResolution(e){const i=e*Hc(this.layerView.view.spatialReference),r=i/16;return r<=10?0:e/i*r}async _fetchPopupFeaturesUsingIdentify(e,i,r){const n=await this._createIdentifyParameters(e,i,r);if(lt(n))return[];const{results:s}=await Wsr(this.layerView.layer.parsedUrl,n);return s.map(o=>o.feature)}async _createIdentifyParameters(e,i,r){const{floors:n,layer:s,timeExtent:o,view:{spatialReference:a,scale:l}}=this.layerView,c=ve(r)?r.event:null;if(!i.length)return null;await Promise.all(i.map(({sublayer:I})=>I.load().catch(()=>{})));const h=Math.min(Hi("mapservice-popup-identify-max-tolerance"),s.allSublayers.reduce((I,P)=>P.renderer?CPt({renderer:P.renderer,event:c}):I,2)),p=this.createFetchPopupFeaturesQueryGeometry(e,h),y=JZt(l,a),v=Math.round(p.width/y),x=new Ar({xmin:p.center.x-y*v,ymin:p.center.y-y*v,xmax:p.center.x+y*v,ymax:p.center.y+y*v,spatialReference:p.spatialReference});return new EPt({floors:n,gdbVersion:"gdbVersion"in s?s.gdbVersion:void 0,geometry:e,height:v,layerOption:"popup",mapExtent:x,returnGeometry:!0,spatialReference:a,sublayers:s.sublayers,timeExtent:o,tolerance:h,width:v})}async _fetchPopupFeaturesUsingQueries(e,i,r){const{layerView:{floors:n,timeExtent:s}}=this,o=ve(r)?r.event:null,a=i.map(async({sublayer:l,popupTemplate:c})=>{if(await l.load().catch(()=>{}),l.capabilities&&!l.capabilities.operations.supportsQuery)return[];const h=l.createQuery(),p=CPt({renderer:l.renderer,event:o}),y=this.createFetchPopupFeaturesQueryGeometry(e,p);if(h.geometry=y,h.outFields=await Lge(l,c),h.timeExtent=s,n){const k=n.clone(),j=SY(k,l);ve(j)&&(h.where=h.where?`(${h.where}) AND (${j})`:j)}const v=this._getTargetResolution(y.width/p),x=await Zsr(c),I=l.geometryType==="point"||x&&x.arcadeUtils.hasGeometryOperations(c);I||(h.maxAllowableOffset=v);let{features:P}=await l.queryFeatures(h);const F=I?0:v;P=await eor(l,P);for(const k of P)this._featuresResolutions.set(k,F);return P});return(await Ru(a)).reverse().reduce((l,c)=>c.value?[...l,...c.value]:l,[]).filter(l=>l!=null)}};function Jsr(t,e,i){const r=[],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=NF(s,{...i,defaultPopupTemplateEnabled:!1});ve(l)&&r.unshift({sublayer:s,popupTemplate:l})}}};return(t?.toArray()??[]).reverse().map(n),r}function Zsr(t){return t.expressionInfos?.length||Array.isArray(t.content)&&t.content.some(e=>e.type==="expression")?Kv():Promise.resolve()}async function Qsr(t,e){if(t.capabilities?.operations?.supportsQuery)return!0;try{return await Promise.any(e.map(({sublayer:i})=>i.load().then(()=>i.capabilities.operations.supportsQuery)))}catch{return!1}}async function eor(t,e){const i=t.renderer;return i&&"defaultSymbol"in i&&!i.defaultSymbol&&(e=i.valueExpression?await Promise.all(e.map(r=>i.getSymbolAsync(r).then(n=>n?r:null))).then(r=>r.filter(n=>n!=null)):e.filter(r=>i.getSymbol(r)!=null)),e}E([N({constructOnly:!0})],OO.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),E([N({constructOnly:!0})],OO.prototype,"layerView",void 0),E([N({constructOnly:!0})],OO.prototype,"highlightGraphics",void 0),E([N({constructOnly:!0})],OO.prototype,"highlightGraphicUpdated",void 0),E([N({constructOnly:!0})],OO.prototype,"updatingHandles",void 0),OO=E([dt("esri.views.layers.support.MapService")],OO);function IPt(t,e,i,r=new Ar){let n=0;if(i.type==="2d")n=e*(i.resolution??0);else if(i.type==="3d"){const h=i.overlayPixelSizeInMapUnits(t),p=i.basemapSpatialReference;n=ve(p)&&!p.equals(i.spatialReference)?Hc(p)/Hc(i.spatialReference):e*h}const s=t.x-n,o=t.y-n,a=t.x+n,l=t.y+n,{spatialReference:c}=i;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=c,r}new Ar;const tor=[0,0];let cee=class extends LF(xPt(wy(xy))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new U1,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||this.layer.resampling!==!1}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;if(this._tileInfoView=new CN(this.layer.tileInfo,this.layer.fullExtent),this._fetchQueue=new aV({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(i,r)=>this.fetchTile(i,r)}),this._tileStrategy=new uX({cachePolicy:"keep",resampling:this.resampling,acquireTile:i=>this.acquireTile(i),releaseTile:i=>this.releaseTile(i),tileInfoView:this._tileInfoView}),Ksr(this,this.layer)){const i=this._highlightView=new gx({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new ZNe(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new OO({createFetchPopupFeaturesQueryGeometry:(r,n)=>IPt(r,n,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(r,n)=>{i.graphicUpdateHandler({graphic:r,property:n})},layerView:this,updatingHandles:this.updatingHandles})}this.requestUpdate(),this.addAttachHandles(sr(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeatures(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeatures(e,i):[]}highlight(e){return this._popupHighlightHelper?this._popupHighlightHelper.highlight(e):{remove(){}}}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return Da(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){!this.attached||this.updateRequested||this.suspended||(this._fetchQueue.reset(),this._tileStrategy.tiles.forEach(e=>this._enqueueTileFetch(e)))}isUpdating(){return this._fetchQueue?.updating??!1}acquireTile(e){const i=this._bitmapView.createTile(e),r=i.bitmap;return[r.x,r.y]=this._tileInfoView.getTileCoords(tor,i.key),r.resolution=this._tileInfoView.getTileResolution(i.key),[r.width,r.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(i),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,i={}){const r="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:n,resamplingLevel:s=0}=i;if(!r)try{return await this._fetchImage(e,n)}catch(l){if(!ys(l)&&!this.resampling)return QNe(this._tileInfoView.tileInfo.size);if(s<3){const c=this._tileInfoView.getTileParentId(e.id);if(c){const h=new Eh(c),p=await this.fetchTile(h,{...i,resamplingLevel:s+1});return Fge(this._tileInfoView,p,h,e)}}throw l}const o=new Eh(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 QNe(this._tileInfoView.tileInfo.size);a=await this._fetchImage(o,n)}catch(l){if(ys(l))throw l;a=await this._fetchImage(e,n)}return this.resampling?Fge(this._tileInfoView,a,o,e):a}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(i){ys(i)||Oi.getLogger(this.declaredClass).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i})}};E([N()],cee.prototype,"_fetchQueue",void 0),E([N()],cee.prototype,"resampling",null),cee=E([dt("esri.views.2d.layers.TileLayerView2D")],cee);const ior=Object.freeze(Object.defineProperty({__proto__:null,default:cee},Symbol.toStringTag,{value:"Module"}));let Nge=class extends io{constructor(){super(...arguments),this.isAggregate=!0}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const i=this.sourceLayer&&this.sourceLayer.featureReduction;return i&&"popupTemplate"in i&&i.popupEnabled?i.popupTemplate:null}getObjectId(){return this.attributes.aggregateId}};E([N({type:Boolean})],Nge.prototype,"isAggregate",void 0),Nge=E([dt("esri.AggregateGraphic")],Nge);const rke=Nge;let i1=class extends Tn{constructor(e){super(e),this._filter=null,this.duration=Hi("mapview-transitions-duration"),this._excludedEffectView=new cx(e),this._includedEffectView=new cx(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,i){this._set("scale",i),this.transitioning?(this._includedEffectView.transitionStep(e,i),this._excludedEffectView.transitionStep(e,i),this.transitioning||(this._filter=null)):(this._excludedEffectView.scale=i,this._includedEffectView.scale=i)}endTransitions(){this._includedEffectView.endTransitions(),this._excludedEffectView.endTransitions(),this._filter=null}_transitionTo(e){const i=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||i?.filter||null,o||this.endTransitions()}};E([N()],i1.prototype,"_filter",void 0),E([N()],i1.prototype,"_excludedEffectView",void 0),E([N()],i1.prototype,"_includedEffectView",void 0),E([N()],i1.prototype,"duration",void 0),E([N()],i1.prototype,"excludedEffects",null),E([N()],i1.prototype,"featureEffect",null),E([N()],i1.prototype,"filter",null),E([N()],i1.prototype,"hasEffects",null),E([N()],i1.prototype,"includedEffects",null),E([N({value:0})],i1.prototype,"scale",null),E([N()],i1.prototype,"transitioning",null),i1=E([dt("esri.layers.effects.FeatureEffectView")],i1);const ror=i1;let hee=class extends tc{constructor(){super(...arguments),this.features=[]}readFeatures(e,i){const r=hr.fromJSON(i.spatialReference),n=[];for(let s=0;scOr)).default(e);case"heatmap":return new(await Promise.resolve().then(()=>dOr)).default(e)}}function nke(t){return t.some(e=>e.globalId)}function dee(t){return t.filter(e=>!e.error).map(e=>e.objectId??e.globalId).filter(e=>e!=null)}function APt(t,e){const i=new Set(t);for(const r of e.values())i.add(r);return i}function PPt(t,e){const i=new Set(t);for(const r of e.values())i.delete(r);return i}let pee=class extends Tn{constructor(e){super(e),this._hasGlobalIds=!1,this._notifyUpdating=()=>{this.notifyChange("updating")}}normalizeCtorArgs(e){return this._queueProcessor=new xN({concurrency:1,process:e.process}),{}}destroy(){this.clear()}get updating(){return this._queueProcessor.length>0}clear(){this._queueProcessor.clear()}push(e){const i=this._queueProcessor,r=i.last();switch(e.type){case"update":case"refresh":if(r?.type===e.type)return;i.push(e).then(this._notifyUpdating,this._notifyUpdating);break;case"edit":{const n=r?.type==="processed-edit"?r:null;n&&i.popLast();const s=this._mergeEdits(n,e);for(const o of s)o&&i.push(o).then(this._notifyUpdating,this._notifyUpdating);break}}this.notifyChange("updating")}_mergeEdits(e,i){const{addedFeatures:r,deletedFeatures:n,updatedFeatures:s}=i.edits;if(this._hasGlobalIds=this._hasGlobalIds||nke(r)||nke(s)||nke(n),this._hasGlobalIds)return[e,{type:"processed-edit",edits:{addOrModified:[...r,...s],removed:n}}];const o=new Set(dee(e?.edits.addOrModified??[])),a=new Set(dee(e?.edits.removed??[])),l=new Set([...dee(r),...dee(s)]),c=new Set(dee(n));return[{type:"processed-edit",edits:{addOrModified:Array.from(APt(PPt(o,c),l)).map(h=>({objectId:h})),removed:Array.from(APt(PPt(a,l),c)).map(h=>({objectId:h}))}}]}};E([N({readOnly:!0})],pee.prototype,"updating",null),E([N()],pee.prototype,"process",void 0),pee=E([dt("esri.views.2d.layers.support.FeatureCommandQueue")],pee);const oor=pee;function aor(t){return Array.isArray(t)}let HU=class extends NH{constructor(e){super(e),this._startupResolver=kf(),this.isReady=!1}initialize(){this._controller=new AbortController,this.addResolvingPromise(this._startWorker(this._controller.signal))}destroy(){this._controller.abort(),this._connection&&this._connection.close()}set tileRenderer(e){this.client.tileRenderer=e}get closed(){return this._connection.closed}async startup(e,i,r,n){await this.when();const s=this._controller.signal,o=aor(r.source)?{transferList:r.source,signal:s}:void 0,a={service:r,config:i,tileInfo:e.tileInfo.toJSON(),tiles:n};await this._connection.invoke("startup",a,o),this._startupResolver.resolve(),this._set("isReady",!0)}async updateTiles(e){return await this._startupResolver.promise,pf(this._connection.invoke("updateTiles",e))}async update(e){const i={config:e};return await this._startupResolver.promise,this._connection.invoke("update",i)}async applyUpdate(e){return await this._startupResolver.promise,this._connection.invoke("applyUpdate",e)}async setHighlight(e){return await this._startupResolver.promise,pf(this._connection.invoke("controller.setHighlight",e))}async stop(){if(await this._startupResolver.promise,!this.closed)return pf(this._connection.invoke("stop"))}async refresh(e){return await this._startupResolver.promise,pf(this._connection.invoke("controller.refresh",e))}async querySummaryStatistics(e,i,r){return await this._startupResolver.promise,this._connection.invoke("controller.querySummaryStatistics",{query:e.toJSON(),params:i},r)}async queryAggregateSummaryStatistics(e,i,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateSummaryStatistics",{query:e.toJSON(),params:i},r)}async queryUniqueValues(e,i,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryUniqueValues",{query:e.toJSON(),params:i},r)}async queryAggregateUniqueValues(e,i,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateUniqueValues",{query:e.toJSON(),params:i},r)}async queryClassBreaks(e,i,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryClassBreaks",{query:e.toJSON(),params:i},r)}async queryAggregateClassBreaks(e,i,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateClassBreaks",{query:e.toJSON(),params:i},r)}async queryHistogram(e,i,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryHistogram",{query:e.toJSON(),params:i},r)}async queryAggregateHistogram(e,i,r){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateHistogram",{query:e.toJSON(),params:i},r)}async queryFeatures(e,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryFeatures",e?.toJSON(),i)}async queryVisibleFeatures(e,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryVisibleFeatures",e?.toJSON(),i)}async queryObjectIds(e,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryObjectIds",e?.toJSON(),i)}async queryFeatureCount(e,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryFeatureCount",e?.toJSON(),i)}async queryExtent(e,i){return this._connection.invoke("controller.queryExtent",e.toJSON(),i)}async queryLatestObservations(e,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryLatestObservations",e.toJSON(),i)}async queryStatistics(e){return await this._startupResolver.promise,this._connection.invoke("controller.queryStatistics",e)}async queryAggregates(e,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregates",e?.toJSON(),i)}async queryAggregateCount(e,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateCount",e?.toJSON(),i)}async queryAggregateIds(e,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateIds",e?.toJSON(),i)}async getObjectId(e){return await this._startupResolver.promise,this._connection.invoke("controller.getObjectId",e)}async getDisplayId(e){return await this._startupResolver.promise,this._connection.invoke("controller.getDisplayId",e)}async getFeatures(e){return await this._startupResolver.promise,this._connection.invoke("controller.getFeatures",e)}async getAggregates(){return await this._startupResolver.promise,this._connection.invoke("controller.getAggregates")}async getAggregateValueRanges(){return await this._startupResolver.promise,this._connection.invoke("controller.getAggregateValueRanges")}async mapValidDisplayIds(e){return await this._startupResolver.promise,this._connection.invoke("controller.mapValidDisplayIds",e)}async onEdits(e){return await this._startupResolver.promise,pf(this._connection.invoke("controller.onEdits",e))}async enableEvent(e,i){return await this._startupResolver.promise,pf(this._connection.invoke("controller.enableEvent",{name:e,value:i}))}async pauseStream(){return await this._startupResolver.promise,pf(this._connection.invoke("controller.pauseStream"))}async resumeStream(){return await this._startupResolver.promise,pf(this._connection.invoke("controller.resumeStream"))}async sendMessageToSocket(e){return await this._startupResolver.promise,pf(this._connection.invoke("controller.sendMessageToSocket",e))}async sendMessageToClient(e){return await this._startupResolver.promise,pf(this._connection.invoke("controller.sendMessageToClient",e))}async updateCustomParameters(e){return await this._startupResolver.promise,pf(this._connection.invoke("controller.updateCustomParameters",e))}async _startWorker(e){try{this._connection=await bA("Pipeline",{client:this.client,strategy:"dedicated",signal:e})}catch(i){_C(i)}}};E([N()],HU.prototype,"isReady",void 0),E([N({constructOnly:!0})],HU.prototype,"client",void 0),E([N()],HU.prototype,"tileRenderer",null),HU=E([dt("esri.views.2d.layers.support.FeatureLayerProxy")],HU);const lor=HU,uor=1e-6;let cor=class{constructor(e){this._tiles=new Map,this.buffer=0,this.acquireTile=e.acquireTile,this.releaseTile=e.releaseTile,this.tileInfoView=e.tileInfoView,this.buffer=e.buffer}destroy(){}clear(){this._tiles.forEach(e=>this._releaseTile(e))}tileKeys(){const e=[];return this._tiles.forEach((i,r)=>e.push(r)),e}update(e){const i=this.tileInfoView.getTileCoverage(e.state,this.buffer,"closest"),{spans:r,lodInfo:n}=i,{level:s}=n,o=[],a=[],l=new Set,c=new Set;for(const{row:h,colFrom:p,colTo:y}of r)for(let v=p;v<=y;v++){const x=Eh.getId(s,h,n.normalizeCol(v),n.getWorldForColumn(v)),I=this._getOrAcquireTile(o,x);l.add(x),I.isReady?I.visible=!0:c.add(I.key)}return c.forEach(h=>this._addPlaceholders(l,h)),this._tiles.forEach(h=>{l.has(h.key.id)||(a.push(h.key.id),this._releaseTile(h))}),aP.pool.release(i),{hasMissingTiles:c.size>0,added:o,removed:a}}_getOrAcquireTile(e,i){if(!this._tiles.has(i)){const r=this.acquireTile(new Eh(i));e.push(i),this._tiles.set(i,r),r.visible=!1}return this._tiles.get(i)}_getTile(e){return this._tiles.get(e)}_releaseTile(e){this._tiles.delete(e.key.id),this.releaseTile(e)}_addPlaceholders(e,i){const r=this._addPlaceholderChildren(e,i);Math.abs(1-r){r+=this._addPlaceholderChild(e,n,i)}),r}_addPlaceholderChild(e,i,r){return i.key.level<=r.level||!i.hasData||!r.contains(i.key)?0:(i.visible=!0,e.add(i.key.id),1/(1<<2*(i.key.level-r.level)))}_addPlaceholderParent(e,i){let r=i.getParentKey(),n=0,s=null;for(;ve(r);){if(e.has(r.id))return!0;const o=this._getTile(r.id);if(o?.isReady){for(const a of e){const l=this._getTile(a);l&&r.contains(l.key)&&(l.visible=!1)}return o.visible=!0,e.add(o.key.id),!0}o?.hasData&&o.patchCount>n&&(n=o.patchCount,s=o),r=r.getParentKey()}return!!s&&(s.visible=!0,e.add(s.key.id),!0)}};const OPt="esri.views.layers.FeatureLayerView",ske=Oi.getLogger(OPt),hor=t=>{let e=class extends t{constructor(...i){super(...i),this._updatingRequiredFieldsPromise=null,this.filter=null,this.timeExtent=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.handles.add([sr(()=>{const i=this.layer;return[i?.elevationInfo?.featureExpressionInfo,i&&"displayField"in i?i.displayField:null,i&&"timeInfo"in i&&i.timeInfo,i&&"renderer"in i&&i.renderer,i&&"labelingInfo"in i&&i.labelingInfo,i&&"floorInfo"in i&&i.floorInfo,this.filter,this.featureEffect,this.timeExtent]},()=>this._handleRequiredFieldsChange(),Wh),Wu(()=>this.view?.floors,"change",()=>this._handleRequiredFieldsChange()),Wu(()=>{const i=this.layer;return i&&"sublayers"in i?i.sublayers:null},"change",()=>this._handleRequiredFieldsChange())])}get availableFields(){const{layer:i,layer:{fieldsIndex:r},requiredFields:n}=this;return"outFields"in i&&i.outFields?rW(r,[...Pne(r,i.outFields),...n]):rW(r,n)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(i){this._override("featureEffect",i)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(i){ske.error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(i){throw new Error("missing implementation")}createQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},r=ve(this.filter)?this.filter.createQuery(i):new Ns(i);if(this.layer.type==="feature"){const n=hZe(this);ve(n)&&(r.where=r.where?`(${r.where}) AND (${n})`:n)}return ve(this.timeExtent)&&(r.timeExtent=ve(r.timeExtent)?r.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),r}createAggregateQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new Ns(i)}queryFeatures(i,r){throw new Error("missing implementation")}queryObjectIds(i,r){throw new Error("missing implementation")}queryFeatureCount(i,r){throw new Error("missing implementation")}queryExtent(i,r){throw new Error("missing implementation")}async fetchPopupFeatures(i,r){const n=this.validateFetchPopupFeatures(r);if(n)throw n;return this.fetchClientPopupFeatures(r)}_loadArcadeModules(i){return i.get("expressionInfos.length")||Array.isArray(i.content)&&i.content.some(r=>r.type==="expression")?Kv():Promise.resolve()}_handleRequiredFieldsChange(){const i=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",i),i.then(()=>{this._updatingRequiredFieldsPromise===i&&this._set("_updatingRequiredFieldsPromise",null)})}async _updateRequiredFields(){if(!this.layer||!this.view)return;const i=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,c=new Set,h=await Ru([o?o.collectRequiredFields(c,n):null,NUe(c,r),i?OBt(c,r):null,ve(this.filter)?LUe(c,r,this.filter):null,ve(this.featureEffect)?LUe(c,r,this.featureEffect.filter):null,l?MBt(c,r,l):null,a?FBt(c,r,a):null]);if("timeInfo"in r&&r.timeInfo&&this.timeExtent&&uR(c,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),r.type==="feature"&&(r.floorInfo&&uR(c,r.fieldsIndex,[r.floorInfo.floorField]),i&&ve(r.infoFor3D)&&(r.globalIdField==null&&ske.error("globalIdField missing on 3DObjectFeatureLayer"),uR(c,r.fieldsIndex,[r.globalIdField]))),r.type==="subtype-group"){Xy(c,n,r.subtypeField);const y=r.sublayers.map(v=>Promise.all([v.renderer?.collectRequiredFields(c,n),NUe(c,v)]));await Ru(y)}for(const y of h)y.error&&ske.error(y.error);Xy(c,n,s),i&&"displayField"in r&&r.displayField&&Xy(c,n,r.displayField);const p=Array.from(c).sort();this._set("requiredFields",p)}validateFetchPopupFeatures(i){if(lt(i))return null;for(const r of i.clientGraphics??[]){const n=r.layer;if("popupEnabled"in n&&!n.popupEnabled)return new st("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:n});if(r.isAggregate){const s="featureReduction"in n?n.featureReduction:null;if(!(s&&"popupTemplate"in s&&s.popupEnabled&&s.popupTemplate))return new st("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:n})}else if("popupTemplate"in n&&!NF(n,i))return new st("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:n})}}async fetchClientPopupFeatures(i){const r=ve(i)?i.clientGraphics:null;if(!r||r.length===0)return[];const n=new Array(r.length),s=new Map,o=await this.createPopupQuery(i);for(let a=0;aa.layer):[this.layer];for(const a of o){if(!("popupEnabled"in a))continue;const l=NF(a,i);if(lt(l))continue;const c=await this._loadArcadeModules(l),h=c&&c.arcadeUtils.hasGeometryOperations(l);s=!(this.layer.geometryType!=="point"&&!h);const p=await Lge(this.layer,l);for(const y of p)n.add(y)}if(r.returnGeometry=s,r.returnZ=s,r.returnM=s,r.outFields=Array.from(n),r.outSpatialReference=this.view.spatialReference,this.layer.type==="feature"){const a=hZe(this);ve(a)&&(r.where=r.where?`(${r.where}) AND (${a})`:a)}return r}canResume(){return!!super.canResume()&&(!ve(this.timeExtent)||!this.timeExtent.isEmpty)}};return E([N()],e.prototype,"_updatingRequiredFieldsPromise",void 0),E([N({readOnly:!0})],e.prototype,"availableFields",null),E([N({type:vWe})],e.prototype,"featureEffect",null),E([N({type:bq})],e.prototype,"filter",void 0),E([N(j9)],e.prototype,"timeExtent",void 0),E([N()],e.prototype,"layer",void 0),E([N({type:Number})],e.prototype,"maximumNumberOfFeatures",null),E([N({readOnly:!0,type:Boolean})],e.prototype,"maximumNumberOfFeaturesExceeded",null),E([N({readOnly:!0})],e.prototype,"requiredFields",void 0),E([N()],e.prototype,"suspended",void 0),E([N()],e.prototype,"view",void 0),e=E([dt(OPt)],e),e};function RPt(t){return t&&"openPorts"in t}let A0=class extends hor(LF(wy(xy))){constructor(){super(...arguments),this._pipelineIsUpdating=!0,this._commandsQueue=new oor({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"refresh":return this._doRefresh(e.dataChanged);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=q0(async()=>this._proxy.setHighlight(Array.from(this._highlightIds.keys()))),this._uploadsLocked=!1,this._needsClusterSizeUpdate=!1,this.featureEffectView=new ror,this._lastDefinitionExpression=null}destroy(){Pa(this._updateClusterSizeTask,e=>e.remove()),this._proxy?.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(Promise.all([this._initProxy(),this._initServiceOptions()])),this.addHandles([this.on("valueRangesChanged",e=>{this._set("_aggregateValueRanges",e.valueRanges)}),sr(()=>this.featureEffect,e=>{this.featureEffectView.featureEffect=e},Wh)],"constructor"),this.featureEffectView.endTransitions()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new st("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});if((e.type==="feature"||e.type==="subtype-group")&&!AL(e)?.operations.supportsQuery)throw new st("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._proxy&&this._proxy.destroy();const i=this._createClientOptions();return this._set("_proxy",new lor({client:i})),this._proxy.when()}async _initServiceOptions(){return this._set("_serviceOptions",await this._createServiceOptions()),this._serviceOptions}get _effectiveFeatureReduction(){if(!("featureReduction"in this.layer))return null;const e=this.layer.featureReduction;return e&&(!("maxScale"in e)||!e.maxScale||e.maxScalei.labelingInfo&&i.labelsVisible)}get queryMode(){return this._serviceOptions?.type}get renderingConfigHash(){if(!this.layer)return null;const e=this.availableFields,i=this.layer,r=this.view.floors,{definitionExpression:n}=i,s=this.layer.type!=="subtype-group"&&this.layer.labelsVisible&&this.layer.labelingInfo,o="renderer"in i&&i.renderer,a="gdbVersion"in i?i.gdbVersion:void 0,l="historicMoment"in i?i.historicMoment?.getTime():void 0,{timeExtent:c}=this,h="customParameters"in i?JSON.stringify(i.customParameters):void 0,p="apiKey"in i?i.apiKey:void 0,y=i.type==="stream"?`${JSON.stringify(i.geometryDefinition)}${i.definitionExpression}`:null,v=JSON.stringify(this.clips),x=this._effectiveFeatureReduction?.toJSON(),I="orderBy"in this.layer&&JSON.stringify(this.layer.orderBy),P="sublayers"in this.layer&&this.layer.sublayers.items.reduce((k,j)=>k+`${j.visible?1:0}.${JSON.stringify(j.renderer)}.${j.labelsVisible} +.${JSON.stringify(j.labelingInfo)}`,""),F="subtypeCode"in this.layer&&this.layer.subtypeCode;return JSON.stringify({orderBy:I,sublayerHash:P,subtypeCode:F,filterHash:ve(this.filter)&&this.filter.toJSON(),effectHash:ve(this.featureEffect)&&this.featureEffect.toJSON(),streamFilter:y,gdbVersion:a,definitionExpression:n,historicMoment:l,availableFields:e,renderer:o,labelingInfo:s,timeExtent:c,floors:r,clipsHash:v,featureReduction:x,customParameters:h,apiKey:p})}highlight(e){let i;e instanceof io?i=[e.getObjectId()]:typeof e=="number"||typeof e=="string"?i=[e]:Sr.isCollection(e)&&e.length>0?i=e.map(n=>n?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(i=typeof e[0]=="number"||typeof e[0]=="string"?e:e.map(n=>n?.getObjectId()));const r=i?.filter(ve);return r&&r.length?(this._addHighlight(r),{remove:()=>this._removeHighlight(r)}):{remove:()=>{}}}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,i){if(!this.tileRenderer)return null;const r=await this.tileRenderer.hitTest(i);if(r.length===0)return null;const{features:n,aggregates:s}=await this._proxy.getFeatures(r);return[...s.map(o=>this._createGraphicHit(e,rke.fromJSON(o))),...n.map(o=>this._createGraphicHit(e,io.fromJSON(o)))]}queryStatistics(){return this._proxy.queryStatistics()}async querySummaryStatistics(e,i,r){const n={...i,scale:this.view.scale};return this._proxy.querySummaryStatistics(this._cleanUpQuery(e),n,r)}async queryAggregateSummaryStatistics(e,i,r){const n={...i,scale:this.view.scale};return this._proxy.queryAggregateSummaryStatistics(this._cleanUpAggregateQuery(e),n,r)}async queryUniqueValues(e,i,r){const n={...i,scale:this.view.scale};return this._proxy.queryUniqueValues(this._cleanUpQuery(e),n,r)}async queryAggregateUniqueValues(e,i,r){const n={...i,scale:this.view.scale};return this._proxy.queryAggregateUniqueValues(this._cleanUpAggregateQuery(e),n,r)}async queryClassBreaks(e,i,r){const n={...i,scale:this.view.scale};return this._proxy.queryClassBreaks(this._cleanUpQuery(e),n,r)}async queryAggregateClassBreaks(e,i,r){const n={...i,scale:this.view.scale};return this._proxy.queryAggregateClassBreaks(this._cleanUpAggregateQuery(e),n,r)}async queryHistogram(e,i,r){const n={...i,scale:this.view.scale};return this._proxy.queryHistogram(this._cleanUpQuery(e),n,r)}async queryAggregateHistogram(e,i,r){const n={...i,scale:this.view.scale};return this._proxy.queryAggregateHistogram(this._cleanUpAggregateQuery(e),n,r)}queryFeatures(e,i){return this.queryFeaturesJSON(e,i).then(r=>{const n=tc.fromJSON(r);return n.features.forEach(s=>this._setLayersForFeature(s)),n})}queryVisibleFeatures(e,i){return this._proxy.queryVisibleFeatures(this._cleanUpQuery(e),i).then(r=>{const n=tc.fromJSON(r);return n.features.forEach(s=>this._setLayersForFeature(s)),n})}async queryAggregates(e,i){const r=await this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),i),n=nor.fromJSON(r);return n.features.forEach(s=>this._setLayersForFeature(s)),n}queryAggregateIds(e,i){return this._proxy.queryAggregateIds(this._cleanUpAggregateQuery(e),i)}queryAggregateCount(e,i){return this._proxy.queryAggregateCount(this._cleanUpAggregateQuery(e),i)}queryAggregateJSON(e,i){return this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),i)}queryFeaturesJSON(e,i){return this._proxy.queryFeatures(this._cleanUpQuery(e),i)}queryObjectIds(e,i){return this._proxy.queryObjectIds(this._cleanUpQuery(e),i)}queryFeatureCount(e,i){return this._proxy.queryFeatureCount(this._cleanUpQuery(e),i)}queryExtent(e,i){return this._proxy.queryExtent(this._cleanUpQuery(e),i).then(r=>({count:r.count,extent:Ar.fromJSON(r.extent)}))}setVisibility(e,i){i?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._tileStrategy||!this.tileRenderer)return;const{hasMissingTiles:i,added:r,removed:n}=this._tileStrategy.update(e);(r.length||n.length)&&this._proxy.updateTiles({added:r,removed:n}),i&&this.requestUpdate(),this.notifyChange("updating")}attach(){this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._tileStrategy=new cor({acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme,buffer:0}),this.addAttachHandles(sr(()=>this.renderingConfigHash,()=>this._update(),Yo)),this.layer.type!=="stream"&&this.addAttachHandles(this.layer.on("edits",e=>this._edit(e)))}detach(){this._commandsQueue.clear(),this._proxy?.stop(),this.container.removeAllChildren(),this.tileRenderer?.uninstall(this.container),this.tileRenderer=null,this._tileStrategy=da(this._tileStrategy),this._tileRendererHash=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&this.layer.renderer!=null,i=this._commandsQueue.updating,r=this._updatingRequiredFieldsPromise!=null,n=!this._proxy||!this._proxy.isReady,s=this._pipelineIsUpdating,o=this.tileRenderer==null||this.tileRenderer?.updating,a=e&&(i||r||n||s||o);return Hi("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${a} -> hasRenderer ${e} -> hasPendingCommand ${i} -> updatingRequiredFields ${r} -> updatingProxy ${n} -> updatingPipeline ${s} -> updatingTileRenderer ${o} -`),a}_createClientOptions(){return{setUpdating:e=>{this._set("_pipelineIsUpdating",e)},emitEvent:e=>{this.emit(e.name,e.event)}}}async _detectQueryMode(e){const i="path"in e,{layer:r}=this,n="editingInfo"in r&&r.editingInfo?.lastEditDate,s="refreshInterval"in r&&!!r.refreshInterval,o=!n&&s,a=TL(r);if(i&&(r.type==="feature"||r.type==="subtype-group")&&r.geometryType==="point"&&a?.query.supportsPagination&&!a?.operations.supportsEditing&&!o&&Gi("featurelayer-snapshot-enabled"))try{const l=await r.queryFeatureCount();if(l<=Gi("featurelayer-snapshot-point-min-threshold"))return{mode:"snapshot",featureCount:l};const c=Gi("featurelayer-snapshot-point-max-threshold"),d=Gi("featurelayer-snapshot-point-coverage"),p=this.view.extent,y=r.fullExtent,v=y?.clone().intersection(p),S=ye(v)?v.width*v.height:0,I=y?.width*y?.height;if(l<=c&&(I===0?0:S/I)>=d)return{mode:"snapshot",featureCount:l}}catch(l){Ei.getLogger(this.declaredClass).warn("mapview-feature-layer","Encountered an error when querying for featureCount",{error:l})}return{mode:"on-demand"}}async _createServiceOptions(){const e=this.layer;if(e.type==="stream")return null;const i=TL(e),{capabilities:r,objectIdField:n}=e,s=e.fields.map(L=>L.toJSON()),o=ye(e.fullExtent)?e.fullExtent.toJSON():null,a=Jme(e.geometryType),l="timeInfo"in e&&e.timeInfo&&e.timeInfo.toJSON()||null,c=e.spatialReference?e.spatialReference.toJSON():null,d=e.type==="feature"?e.globalIdField:null;let p;e.type==="ogc-feature"?p=e.source.getSource():zAt(e.source)?p=await e.source.openPorts():e.parsedUrl&&(p=hi(e.parsedUrl),"dynamicDataSource"in e&&e.dynamicDataSource&&(p.query={layer:JSON.stringify({source:e.dynamicDataSource})}));const y="datesInUnknownTimezone"in this.layer&&this.layer.datesInUnknownTimezone,v=("subtypeField"in this.layer?this.layer.subtypeField:null)??null,{mode:S,featureCount:I}=await this._detectQueryMode(p);let O=this.layer.objectIdField;if(this.layer.type==="feature"&&ye(this.layer.orderBy)&&this.layer.orderBy.length){const L=!this.layer.orderBy[0].valueExpression&&this.layer.orderBy[0].field;L&&(O=L)}return{type:S,timeReferenceUnknownClient:y,subtypeField:v,featureCount:I,globalIdField:d,maxRecordCount:r.query.maxRecordCount,tileMaxRecordCount:r.query.tileMaxRecordCount,capabilities:r,effectiveCapabilities:i,fields:s,fullExtent:o,geometryType:a,objectIdField:n,source:p,timeInfo:l,spatialReference:c,orderByFields:O,datesInUnknownTimezone:y,dateFieldsTimeReference:("dateFieldsTimeReference"in this.layer?this.layer.dateFieldsTimeReference?.toJSON():null)||null,preferredTimeReference:("preferredTimeReference"in this.layer?this.layer.preferredTimeReference?.toJSON():null)||null,editFieldsInfo:"editFieldsInfo"in this.layer?this.layer.editFieldsInfo?.toJSON():null}}async _createMemoryServiceOptions(e){const i=await e.openPorts();return{...this._createServiceOptions(),type:"memory",source:i}}_cleanUpQuery(e){const i=Ss.from(e)||this.createQuery();return i.outSpatialReference||(i.outSpatialReference=this.view.spatialReference),i}_cleanUpAggregateQuery(e){const i=Ss.from(e)||this.createAggregateQuery();return i.outSpatialReference||(i.outSpatialReference=this.view.spatialReference),i}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){return this.suspended?void this._clearTiles():this._validateEdit(e)?this._commandsQueue.push({type:"edit",edits:e}):void 0}async doRefresh(e){if(this.attached&&this._tileStrategy.tileKeys().length)return this.suspended&&e?void this._clearTiles():this._commandsQueue.push({type:"refresh",dataChanged:e})}_clearTiles(){this._tileStrategy.tileKeys().length&&(this._proxy.updateTiles({added:[],removed:this._tileStrategy.tileKeys()}),this._tileStrategy.clear(),this.requestUpdate(),this._commandsQueue.clear(),this._update())}_validateEdit(e){const i="globalIdField"in this.layer&&this.layer.globalIdField,r=e.deletedFeatures.some(s=>s.objectId===-1||!s.objectId),n=i&&this.availableFields.includes(i);return r&&!n?(Ei.getLogger(this.declaredClass).error(new st("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${i} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){try{if(this.destroyed||!this._hasRequiredSupport(this.layer)||!this._tileStrategy)return;const{featureEffectView:e,filter:i}=this;if(await this._updateRequiredFields(),this.destroyed)return;const{renderer:r}=this._getEffectiveRenderer();this._set("_effectiveRenderer",r);const n=this._createSchemaConfig(),s=this._createConfiguration(n,i,e.filter),o=this._lastDefinitionExpression!==s.schema.source.definitionExpression;this._lastDefinitionExpression=s.schema.source.definitionExpression;const a=s.schema.tileRenderer,l=this._createTileRendererHash(a);if(this._serviceOptions.type==="snapshot"&&(s.schema.source.initialFeatureCount=this._serviceOptions.featureCount),l!==this._tileRendererHash){await this._initTileRenderer(a,r);const c=this.layer,d=c.type==="stream"?await this._initServiceOptions():this._serviceOptions;this.tileRenderer.onConfigUpdate(r),c.type!=="stream"&&zAt(c.source)&&(d.source=await c.source.openPorts());const p={added:this._tileStrategy.tileKeys(),removed:[]};await this._proxy.startup(this.view.featuresTilingScheme,s,d,p),this.hasHighlight()&&await this._proxy.setHighlight(Array.from(this._highlightIds.keys())),await this._onceTilesUpdated(),this.tileRenderer.onConfigUpdate(r)}else{this._serviceOptions.type==="snapshot"&&o&&(s.schema.source.changedFeatureCount=await this.layer.queryFeatureCount());const c=await this._proxy.update(s);(c.mesh||c.targets?.aggregate)&&this._lockGPUUploads();try{await this._proxy.applyUpdate(c)}catch(d){ss(d)||Ei.getLogger(this.declaredClass).error(d)}(c.mesh||c.targets?.aggregate)&&this._unlockGPUUploads(),this.tileRenderer.onConfigUpdate(r),this._updateClusterSizeVariable(),this._forceAttributeTextureUpload()}this._tileRendererHash=l,this.tileRenderer.invalidateLabels(),this.requestUpdate()}catch{}}async _doEdit(e){try{await this._proxy.onEdits(e)}catch(i){ss(i)}}async _doRefresh(e){this._lockGPUUploads();try{let i;e&&this.queryMode==="snapshot"&&"queryFeatureCount"in this.layer&&(i=await this.layer.queryFeatureCount()),await this._proxy.refresh({dataChanged:e,featureCount:i})}catch(i){ss(i)}this._unlockGPUUploads(),this._effectiveFeatureReduction&&this._updateClusterSizeVariable()}_updateClusterSizeVariable(){this._needsClusterSizeUpdate&&(this.tileRenderer.onConfigUpdate(this._effectiveRenderer),this._needsClusterSizeUpdate=!1)}_createUpdateClusterSizeTask(e,i){return Qi(()=>this._aggregateValueRanges,r=>{this._updateClusterEffectiveRendererSizeVariable(e,i,r),this._needsClusterSizeUpdate=!0,this._uploadsLocked||this._updateClusterSizeVariable()})}async _updateClusterEffectiveRendererSizeVariable(e,i,r){if(e.dynamicClusterSize&&"visualVariables"in e&&e.visualVariables){const n=OSe(e.visualVariables);if(ye(n)&&n.field==="cluster_count"){const s=e.visualVariables.indexOf(n);e.visualVariables[s]=RSe(i,r);const o=e.clone();o.dynamicClusterSize=!0,this._set("_effectiveRenderer",o)}}}_getEffectiveRenderer(){const e=this.layer,i="renderer"in e?e.renderer:null,r=this._effectiveFeatureReduction;if(this._updateClusterSizeTask=Bc(this._updateClusterSizeTask),r&&"renderer"in r&&r.renderer&&!r.renderer.authoringInfo?.isAutoGenerated){const n=r.fields;if(r.type==="cluster"){const{renderer:s,didInject:o}=PYe(r.renderer,r,this._aggregateValueRanges);return o&&(this._updateClusterSizeTask=this._createUpdateClusterSizeTask(s,r)),{renderer:s,aggregateFields:n,featureReduction:r}}return{renderer:r.renderer,aggregateFields:n,featureReduction:r}}if(r&&r.type==="cluster"&&i&&OYe(i)){const n=r,s=[],o=PSe(s,i,n,this._aggregateValueRanges,!0);return this._updateClusterSizeTask=this._createUpdateClusterSizeTask(o,n),{renderer:o,aggregateFields:s,featureReduction:r}}return{renderer:i,aggregateFields:[],featureReduction:null}}_acquireTile(e){const i=this.tileRenderer.acquireTile(e);return i.once("attach",()=>{this.requestUpdate()}),i}_releaseTile(e){this.tileRenderer.releaseTile(e)}async _initTileRenderer(e,i){const r=await tsr(e,{layerView:this,tileInfoView:this.view.featuresTilingScheme,layer:this.layer});return this.tileRenderer&&(this._tileStrategy.clear(),this.tileRenderer.uninstall(this.container),this.tileRenderer=ra(this.tileRenderer)),this.destroyed?null:(this._proxy.tileRenderer=r,this._set("tileRenderer",r),this.tileRenderer.install(this.container),this.tileRenderer.onConfigUpdate(i),this.requestUpdate(),this.tileRenderer)}_createTileRendererHash(e){return`${e.type}`}get hasFilter(){const e=!!("floorInfo"in this.layer&&this.layer.floorInfo&&this.view.floors&&this.view.floors.length);return!!this.filter||e||!!this._visibilityOverrides.size||!!this.timeExtent}_injectOverrides(e){const i=ye(e)?e.timeExtent:null,r=ye(this.timeExtent)&&ye(i)?this.timeExtent.intersection(i):this.timeExtent||i;let n=null;const s="floorInfo"in this.layer&&this.layer.floorInfo;if(s){const a=ye(e)?e.where:null;n=this._addFloorFilterClause(a)}if(!this._visibilityOverrides.size&&!r&&!s)return ye(e)?e.toJSON():null;(e=ye(e)&&e.clone()||new bq).timeExtent=r,n&&(e.where=n);const o=e.toJSON();return o.hiddenIds=Array.from(this._visibilityOverrides),o}_addFloorFilterClause(e){const i=this.layer;let r=e||"";if("floorInfo"in i&&i.floorInfo){let n=this.view.floors;if(!n||!n.length)return r;i.floorInfo.viewAllLevelIds?.length&&(n=i.floorInfo.viewAllLevelIds);const s=n.filter(l=>l!=="").map(l=>"'"+l+"'");s.push("''");const o=i.floorInfo.floorField;let a="("+o+" IN ({ids}) OR "+o+" IS NULL)";if(a=a.replace("{ids}",s.join(", ")),ye(r)&&r.includes(o)){let l=new RegExp("AND \\("+o+".*NULL\\)","g");r=r.replace(l,""),l=new RegExp("\\("+o+".*NULL\\)","g"),r=r.replace(l,""),r=r.replace(/\s+/g," ").trim()}r=r!==""?"("+r+") AND "+a:a}return r!==""?r:null}_createConfiguration(e,i,r){const n=this.layer.type==="feature"&&this.layer.historicMoment?this.layer.historicMoment.getTime():void 0,s=this.layer.type==="feature"?this.layer.gdbVersion??void 0:void 0,o=new Array(S0t),a=this._injectOverrides(i);o[0]=a,o[1]=ye(r)?r.toJSON():null;const l=Nrr(e);if(lt(l))return null;const c=TT("2d");return{availableFields:this.availableFields,gdbVersion:s,historicMoment:n,devicePixelRatio:window.devicePixelRatio||1,filters:o,schema:l,supportsTextureFloat:c.supportsTextureFloat,maxTextureSize:c.maxTextureSize}}_hasRequiredSupport(e){return!("renderer"in e)||Lrr(e.renderer)}_onceTilesUpdated(){return this.requestUpdate(),F1(()=>!this._pipelineIsUpdating)}_lockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!0,this.tileRenderer.lockGPUUploads())}_unlockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!1,this.tileRenderer.unlockGPUUploads())}_forceAttributeTextureUpload(){this.tileRenderer&&this.tileRenderer.forceAttributeTextureUpload()}_createSchemaConfig(){const e=this.layer;return{renderer:"renderer"in e?e.renderer:null,spatialReference:e.spatialReference,timeExtent:"timeExtent"in e?e.timeExtent:null,definitionExpression:e.definitionExpression,featureReduction:this._effectiveFeatureReduction,fields:e.fields,geometryType:e.geometryType,historicMoment:"historicMoment"in e?e.historicMoment:null,labelsVisible:"labelsVisible"in e&&e.labelsVisible,labelingInfo:"labelingInfo"in e?e.labelingInfo:null,availableFields:this.availableFields,featureEffect:this.featureEffect,filter:this.filter,gdbVersion:"gdbVersion"in e?e.gdbVersion:null,pixelBuffer:0,orderBy:"orderBy"in e&&e.orderBy?e.orderBy:null,customParameters:{..."customParameters"in e?e.customParameters:void 0,token:"apiKey"in e?e.apiKey??void 0:void 0},subtypeCode:"subtypeCode"in e?e.subtypeCode:void 0,subtypeField:"subtypeField"in e?e.subtypeField:void 0}}_addHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i);this._highlightIds.set(i,r+1)}else this._highlightIds.set(i,1);this._updateHighlight().catch(i=>{ss(i)||Ei.getLogger(this.declaredClass).error(i)})}_removeHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i)-1;r===0?this._highlightIds.delete(i):this._highlightIds.set(i,r)}this._updateHighlight().catch(i=>{ss(i)||Ei.getLogger(this.declaredClass).error(i)})}_setLayersForFeature(e){const i=this.layer;e.layer=i,e.sourceLayer=i}_createGraphicHit(e,i){return this._setLayersForFeature(i),ye(i.geometry)&&(i.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:i,layer:this.layer,mapPoint:e}}};E([k()],T0.prototype,"_serviceOptions",void 0),E([k()],T0.prototype,"_proxy",void 0),E([k()],T0.prototype,"_pipelineIsUpdating",void 0),E([k()],T0.prototype,"_effectiveRenderer",void 0),E([k()],T0.prototype,"_effectiveFeatureReduction",null),E([k()],T0.prototype,"_aggregateValueRanges",void 0),E([k()],T0.prototype,"_commandsQueue",void 0),E([k()],T0.prototype,"featureEffectView",void 0),E([k()],T0.prototype,"labelsVisible",null),E([k({readOnly:!0})],T0.prototype,"queryMode",null),E([k()],T0.prototype,"renderingConfigHash",null),E([k()],T0.prototype,"tileRenderer",void 0),E([k()],T0.prototype,"updating",void 0),T0=E([ht("esri.views.2d.layers.FeatureLayerView2D")],T0);const dge=T0,lsr=Object.freeze(Object.defineProperty({__proto__:null,default:dge},Symbol.toStringTag,{value:"Module"}));let Bj=class extends Lj{constructor(){super(...arguments),this._hasCrossfade=!1}get requiresDedicatedFBO(){return this._hasCrossfade}beforeRender(e){super.beforeRender(e),this._manageFade()}prepareRenderPasses(e){const i=e.registerRenderPass({name:"bitmap",brushes:[lh.bitmap],target:()=>this.children,drawPhase:io.MAP});return[...super.prepareRenderPasses(e),i]}_manageFade(){this.children.reduce((e,i)=>e+(i.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 usr=Math.PI/180;function csr(t){return t*usr}function hsr(t,e){const i=csr(e.rotation),r=Math.abs(Math.cos(i)),n=Math.abs(Math.sin(i)),[s,o]=e.size;return t[0]=Math.round(o*n+s*r),t[1]=Math.round(o*r+s*n),t}function dsr(t,e,i,r){const[n,s]=e,[o,a]=r,l=.5*i;return t[0]=n-l*o,t[1]=s-l*a,t[2]=n+l*o,t[3]=s+l*a,t}const V6=_o(),FF=[0,0],pge=new xh(0,0,0,0),uee={container:null,fetchSource:null,requestUpdate:null,imageMaxWidth:2048,imageMaxHeight:2048,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1};let Q_=class extends fn{constructor(e){super(e),this._imagePromise=null,this.bitmaps=[],this.hidpi=uee.hidpi,this.imageMaxWidth=uee.imageMaxWidth,this.imageMaxHeight=uee.imageMaxHeight,this.imageRotationSupported=uee.imageRotationSupported,this.imageNormalizationSupported=uee.imageNormalizationSupported,this.update=$y(async(i,r)=>{if(sn(r),!i.stationary||this.destroyed)return;const n=i.state,s=pd(n.spatialReference),o=this.hidpi?i.pixelRatio:1,a=this.imageNormalizationSupported&&n.worldScreenWidth&&n.worldScreenWidthl||Math.floor(FF[1]*o)>c,p=s&&(n.extent.xmins.valid[1]),y=!this.imageNormalizationSupported&&p,v=!d&&!y,S=this.imageRotationSupported?n.rotation:0,I=this.container.children.slice();if(v){const O=a?n.paddedViewState.center:n.center;this._imagePromise&&console.error("Image promise was not defined!"),this._imagePromise=this._singleExport(n,FF,O,n.resolution,S,o,r)}else{let O=Math.min(l,c);y&&(O=Math.min(n.worldScreenWidth,O)),this._imagePromise=this._tiledExport(n,O,o,r)}try{const O=await this._imagePromise??[];sn(r);const L=[];if(this._imagePromise=null,this.destroyed)return;this.bitmaps=O;for(const N of I)O.includes(N)||L.push(N.fadeOut().then(()=>{N.remove(),N.destroy()}));for(const N of O)L.push(N.fadeIn());await Promise.all(L)}catch(O){this._imagePromise=null,Ga(O)}},5e3),this.updateExports=$y(async i=>{const r=[];for(const n of this.container.children){if(!n.visible||!n.stage)return;r.push(i(n).then(()=>{n.invalidateTexture(),n.requestRender()}))}this._imagePromise=bu(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,i,r,n,s,o){const a=await this.fetchSource(e,Math.floor(i*s),Math.floor(r*s),{rotation:n,pixelRatio:s,signal:o});sn(o);const l=new Cke(null,{immutable:!0,requestRenderOnSourceChangedEnabled:!0});return l.x=e.xmin,l.y=e.ymax,l.resolution=e.width/i,l.rotation=n,l.pixelRatio=s,l.opacity=0,this.container.addChild(l),await l.setSourceAsync(a,o),sn(o),l}async _singleExport(e,i,r,n,s,o,a){dsr(V6,r,n,i);const l=kL(V6,e.spatialReference);return[await this._export(l,i[0],i[1],s,o,a)]}_tiledExport(e,i,r,n){const s=Ml.create({size:i,spatialReference:e.spatialReference,scales:[e.scale]}),o=new wk(s),a=o.getTileCoverage(e);if(!a)return null;const l=[];return a.forEach((c,d,p,y)=>{pge.set(c,d,p,0),o.getTileBounds(V6,pge);const v=kL(V6,e.spatialReference);l.push(this._export(v,i,i,0,r,n).then(S=>(y!==0&&(pge.set(c,d,p,y),o.getTileBounds(V6,pge),S.x=V6[0],S.y=V6[3]),S)))}),Promise.all(l)}};E([k()],Q_.prototype,"_imagePromise",void 0),E([k()],Q_.prototype,"bitmaps",void 0),E([k()],Q_.prototype,"container",void 0),E([k()],Q_.prototype,"fetchSource",void 0),E([k()],Q_.prototype,"hidpi",void 0),E([k()],Q_.prototype,"imageMaxWidth",void 0),E([k()],Q_.prototype,"imageMaxHeight",void 0),E([k()],Q_.prototype,"imageRotationSupported",void 0),E([k()],Q_.prototype,"imageNormalizationSupported",void 0),E([k()],Q_.prototype,"requestUpdate",void 0),E([k()],Q_.prototype,"updating",null),Q_=E([ht("esri.views.2d.layers.support.ExportStrategy")],Q_);const fge=Q_;let cee=class extends MF(_y(by)){update(e){this._strategy.update(e).catch(i=>{ss(i)||Ei.getLogger(this.declaredClass).error(i)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new Bj,this.container.addChild(this._bitmapContainer),this._strategy=new fge({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,i,r){return this.layer.fetchImageBitmap(e,i,r)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};E([k()],cee.prototype,"_strategy",void 0),E([k()],cee.prototype,"updating",void 0),cee=E([ht("esri.views.2d.layers.BaseDynamicLayerView2D")],cee);const psr=Object.freeze(Object.defineProperty({__proto__:null,default:cee},Symbol.toStringTag,{value:"Module"}));let $ke=class extends _y(by){constructor(){super(...arguments),this._graphicsViewMap={},this._popupTemplates=new Map,this.graphicsViews=[]}async hitTest(e,i){if(!this.graphicsViews.length)return null;const r=this.layer;return this.graphicsViews.reverse().map(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}).flat().map(n=>({type:"graphic",graphic:n,layer:r,mapPoint:e}))}update(e){if(this.graphicsViews)for(const i of this.graphicsViews)i.processUpdate(e)}attach(){this.addAttachHandles([Qi(()=>this.layer?.featureCollections,e=>{this._clear();for(const{popupInfo:i,featureSet:r,layerDefinition:n}of e){const s=Wu.fromJSON(r),o=new fr(s.features),a=n.drawingInfo,l=i?yh.fromJSON(i):null,c=PR(a.renderer),d=new fx({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:o,renderer:c,container:new TO(this.view.featuresTilingScheme)});this._graphicsViewMap[s.geometryType]=d,this._popupTemplates.set(d,l),s.geometryType!=="polygon"||this.layer.polygonSymbol?s.geometryType!=="polyline"||this.layer.lineSymbol?s.geometryType!=="point"||this.layer.pointSymbol||(this.layer.pointSymbol=c.symbol):this.layer.lineSymbol=c.symbol:this.layer.polygonSymbol=c.symbol,this.graphicsViews.push(d),this.container.addChild(d.container)}},Fo),Qi(()=>this.layer?.polygonSymbol,e=>{this._graphicsViewMap.polygon.renderer=new Zv({symbol:e})},Fo),Qi(()=>this.layer?.lineSymbol,e=>{this._graphicsViewMap.polyline.renderer=new Zv({symbol:e})},Fo),Qi(()=>this.layer?.pointSymbol,e=>{this._graphicsViewMap.point.renderer=new Zv({symbol:e})},Fo)])}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}};$ke=E([ht("esri.views.2d.layers.GeoRSSLayerView2D")],$ke);const fsr=Object.freeze(Object.defineProperty({__proto__:null,default:$ke},Symbol.toStringTag,{value:"Module"})),msr={remove(){},pause(){},resume(){}};let mge=class extends _y(by){constructor(){super(...arguments),this._highlightIds=new Map}attach(){this.graphicsView=new fx({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new TO(this.view.featuresTilingScheme)}),this._updateHighlight(),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler))}detach(){this.container.removeAllChildren(),this.graphicsView=ra(this.graphicsView)}async hitTest(e){return this.graphicsView?this.graphicsView.hitTest(e).map(i=>({type:"graphic",graphic:i,mapPoint:e,layer:this.layer})):null}async fetchPopupFeatures(e){return this.graphicsView?this.graphicsView.hitTest(e).filter(i=>!!i.popupTemplate):[]}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){let i;typeof e=="number"?i=[e]:e instanceof js?i=[e.uid]:Array.isArray(e)&&e.length>0?i=typeof e[0]=="number"?e:e.map(n=>n&&n.uid):fr.isCollection(e)&&e.length>0&&(i=e.map(n=>n&&n.uid).toArray());const r=i?.filter(ye);return r?.length?(this._addHighlight(r),{remove:()=>this._removeHighlight(r)}):msr}_addHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i);this._highlightIds.set(i,r+1)}else this._highlightIds.set(i,1);this._updateHighlight()}_removeHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i)-1;r===0?this._highlightIds.delete(i):this._highlightIds.set(i,r)}this._updateHighlight()}_updateHighlight(){this.graphicsView?.setHighlight(Array.from(this._highlightIds.keys()))}};E([k()],mge.prototype,"graphicsView",void 0),mge=E([ht("esri.views.2d.layers.GraphicsLayerView2D")],mge);const gsr=Object.freeze(Object.defineProperty({__proto__:null,default:mge},Symbol.toStringTag,{value:"Module"}));let HAt=class extends Lj{constructor(){super(...arguments),this._prevFBO=void 0,this.requiresDedicatedFBO=!1}dispose(){}doRender(e){const i=this.createRenderParams(e),{context:r,painter:n,profiler:s}=i;this._prevFBO=r.getBoundFramebufferObject(),s.recordContainerStart(this.name);const o=this._getFbo(i),a=n.getRenderTarget();r.bindFramebuffer(o),n.setRenderTarget(o),r.setDepthWriteEnabled(!0),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setClearDepth(1),r.clear(r.gl.COLOR_BUFFER_BIT|r.gl.DEPTH_BUFFER_BIT),r.setDepthWriteEnabled(!1);for(const l of this.children)l.beforeRender(e);for(const l of this.children)l.processRender(i);for(const l of this.children)l.afterRender(e);n.setRenderTarget(a),n.releaseFbo(o),r.bindFramebuffer(this._prevFBO),n.beforeRenderLayer(i,this._clippingInfos?255:0,this.computedOpacity),o.colorTexture&&(r.setStencilTestEnabled(!1),r.setStencilWriteMask(0),n.blitTexture(r,o.colorTexture,mn.NEAREST)),n.compositeLayer(i,this.computedOpacity),s.recordContainerEnd()}createRenderParams(e){return{...super.createRenderParams(e),blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:1}}_getFbo(e){const{context:i,painter:r}=e,{width:n,height:s}=i.getViewport();return r.acquireFbo(n,s)}},Gj=class extends by{constructor(e){super(e),this.type="group",this.layerViews=new fr}_allLayerViewVisibility(e){this.layerViews.forEach(i=>{i.visible=e})}initialize(){this.handles.add([this.layerViews.on("change",e=>this._layerViewsChangeHandler(e)),Qi(()=>this.layer.visibilityMode,()=>this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(null)),Nu),Qi(()=>this.visible,e=>{this._applyVisibility(()=>this._allLayerViewVisibility(e),()=>{})},Nu)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(e){this._set("layerViews",rg(e,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((e,i)=>e+i.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(i=>i.layer===e)}_firstVisibleOnLayerOrder(){const e=this.layer.layers.find(i=>!!this._findLayerViewForLayer(i)?.visible);return e&&this._findLayerViewForLayer(e)}_applyExclusiveVisibility(e){lt(e)&&(e=this._firstVisibleOnLayerOrder(),lt(e)&&this.layerViews.length>0&&(e=this._findLayerViewForLayer(this.layer.layers.getItemAt(0)))),this.layerViews.forEach(i=>{i.visible=i===e})}_layerViewsChangeHandler(e){this.handles.remove("grouplayerview:visible"),this.handles.add(this.layerViews.map(r=>Qi(()=>r.visible,n=>this._applyVisibility(()=>{n!==this.visible&&(r.visible=this.visible)},()=>this._applyExclusiveVisibility(n?r:null)),Nu)).toArray(),"grouplayerview:visible");const i=e.added[e.added.length-1];this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(i?.visible?i:null))}_applyVisibility(e,i){this._hasLayerViewVisibleOverrides()&&(this.layer?.visibilityMode==="inherited"?e():this.layer?.visibilityMode==="exclusive"&&i())}};E([k({cast:B8})],Gj.prototype,"layerViews",null),E([k({readOnly:!0})],Gj.prototype,"updatingProgress",null),E([k()],Gj.prototype,"view",void 0),Gj=E([ht("esri.views.layers.GroupLayerView")],Gj);const ysr=Gj;let Bke=class extends _y(ysr){constructor(){super(...arguments),this.container=new HAt}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,i)=>this.container.addChildAt(e.container,i))}};Bke=E([ht("esri.views.2d.layers.GroupLayerView2D")],Bke);const vsr=Object.freeze(Object.defineProperty({__proto__:null,default:Bke},Symbol.toStringTag,{value:"Module"}));function _sr(t){const e=WAt(Gke(t)),i=e,r=!0,n=Math.max(e/2,5),s=Math.round(on(t.maxPathLength)/n)+1,o=10,{density:a}=t;return{smoothing:on(t.smoothing),interpolate:!0,velocityScale:t.flowRepresentation==="flow-from"?1:-1,verticesPerLine:s,minSpeedThreshold:.001,segmentLength:n,maxTurnAngle:1,collisions:r,lineCollisionWidth:i,lineSpacing:o,density:a}}function WAt(t){return t.kind==="constant"?t.value[0]:t.values[t.values.length-1]}function qAt(t){const e=t.toRgba();return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function bsr(t){return{kind:"constant",value:[.1,.1,.1,1]}}function Gke(t){if(!t.hasVisualVariables("size"))return{kind:"constant",value:[on(t.trailWidth)]};const e=t.getVisualVariablesForType("size")[0],i=[],r=[];let n;if(e.stops){for(const s of e.stops)i.push(s.value),r.push(on(s.size));n=e.stops.length}else i.push(e.minDataValue,e.maxDataValue),r.push(on(e.minSize),on(e.maxSize)),n=2;return{kind:"ramp",stops:i,values:r,count:n}}function wsr(t){if(!t.hasVisualVariables("color"))return{kind:"constant",value:qAt(t.color)};const e=t.getVisualVariablesForType("color")[0],i=[],r=[];for(const n of e.stops)i.push(n.value),Array.prototype.push.apply(r,qAt(n.color));return{kind:"ramp",stops:i,values:r,count:e.stops.length}}function xsr(t){if(!t.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};const e=t.getVisualVariablesForType("opacity")[0],i=[],r=[];for(const n of e.stops)i.push(n.value),r.push(n.opacity);return{kind:"ramp",stops:i,values:r,count:e.stops.length}}function Vke(t,e,i,r){switch(e){case"int":t.setUniform1iv(i,r);break;case"float":t.setUniform1fv(i,r);break;case"vec2":t.setUniform2fv(i,r);break;case"vec3":t.setUniform3fv(i,r);break;case"vec4":t.setUniform4fv(i,r)}}function LF(t,e,i,r){r.kind==="constant"?Vke(t,i,`u_${e}`,r.value):(Vke(t,"float",`u_${e}_stops`,r.stops),Vke(t,i,`u_${e}_values`,r.values),t.setUniform1i(`u_${e}_count`,r.count))}function Ssr(t,e){let i=!0;return i=i&&t.collisions===e.collisions,i=i&&t.density===e.density,i=i&&t.interpolate===e.interpolate,i=i&&t.lineCollisionWidth===e.lineCollisionWidth,i=i&&t.lineSpacing===e.lineSpacing,i=i&&t.maxTurnAngle===e.maxTurnAngle,i=i&&t.minSpeedThreshold===e.minSpeedThreshold,i=i&&t.segmentLength===e.segmentLength,i=i&&t.smoothing===e.smoothing,i=i&&t.velocityScale===e.velocityScale,i=i&&t.verticesPerLine===e.verticesPerLine,i}function YAt(t,e){return t===e||!(!ye(t)||!ye(e))&&t.equals(e)}function XAt(t,e){if(!Ssr(t.simulationSettings,e.simulationSettings)||!YAt(t.timeExtent,e.timeExtent))return!1;let i=!0;return i=i&&t.loadImagery===e.loadImagery,i=i&&t.createFlowMesh===e.createFlowMesh,i=i&&t.color.kind===e.color.kind,i=i&&t.opacity.kind===e.opacity.kind,i=i&&t.size.kind===e.size.kind,i}let Csr=class j5t{constructor(e){this._params=e,this.animated=!1}isCompatible(e){if(!(e instanceof j5t)||!YAt(this._params.timeExtent,e._params.timeExtent))return!1;let i=!0;return i=i&&this._params.loadImagery===e._params.loadImagery,i=i&&this._params.color.kind===e._params.color.kind,i=i&&this._params.opacity.kind===e._params.opacity.kind,i}async load(e,i){const{extent:r,size:n}=e;sn(i);const s=await this._params.loadImagery(r,n[0],n[1],this._params.timeExtent,i);return new Isr(s,{color:this._params.color,opacity:this._params.opacity})}render(e,i,r){const{context:n}=e,{program:s}=r;n.setFaceCullingEnabled(!1),n.setBlendingEnabled(!0),n.setBlendFunction(cn.ONE,cn.ONE_MINUS_SRC_ALPHA),n.useProgram(s),s.setUniformMatrix3fv("u_dvsMat3",i.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(ls.TRIANGLE_STRIP,0,4)}};const gge=new Map;gge.set("a_position",0),gge.set("a_texcoord",1);const Tsr={geometry:[new qo("a_position",2,Di.UNSIGNED_SHORT,0,8),new qo("a_texcoord",2,Di.UNSIGNED_SHORT,4,8)]},Esr={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:gge};let Isr=class{constructor(e,i){this._flowData=e,this._values=i}attach(e){const{context:i}=e,{width:r,height:n}=this._flowData,s=Ko.createVertex(i,Lo.STATIC_DRAW,new Uint16Array([0,0,0,1,r,0,1,1,0,n,0,0,r,n,1,0])),o=new Ac(i,gge,Tsr,{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(Esr,a);let c=1e6,d=-1e6;for(let v=0;v0}isCompatible(e){return e instanceof z5t&&XAt(this._params,e._params)}async load(e,i){const{extent:r,size:n}=e;sn(i);const s=await this._params.loadImagery(r,n[0],n[1],this._params.timeExtent,i),{vertexData:o,indexData:a}=await this._params.createFlowMesh("Particles",this._params.simulationSettings,s,i);return new Rsr(o,a,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(e,i,r){const{context:n}=e,{program:s}=r;n.setFaceCullingEnabled(!1),n.setBlendingEnabled(!0),n.setBlendFunction(cn.ONE,cn.ONE_MINUS_SRC_ALPHA),n.useProgram(s),s.setUniform1f("u_time",i.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",i.dvsMat3),s.setUniformMatrix3fv("u_displayViewMat3",i.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(ls.TRIANGLES,r.indexCount,Di.UNSIGNED_INT,0)}};const Vj=new Map;Vj.set("a_xyts0",0),Vj.set("a_xyts1",1),Vj.set("a_typeIdDurationSeed",2),Vj.set("a_extrudeInfo",3);const Psr={geometry:[new qo("a_xyts0",4,Di.FLOAT,0,64),new qo("a_xyts1",4,Di.FLOAT,16,64),new qo("a_typeIdDurationSeed",4,Di.FLOAT,32,64),new qo("a_extrudeInfo",4,Di.FLOAT,48,64)]},Osr={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",attributes:Vj};let Rsr=class{constructor(e,i,r){this._vertexData=e,this._indexData=i,this._values=r}attach(e){const{context:i}=e,r=Ko.createVertex(i,Lo.STATIC_DRAW,this._vertexData),n=Ko.createIndex(i,Lo.STATIC_DRAW,this._indexData),s=new Ac(i,Vj,Psr,{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(Osr,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}},Msr=class H5t{constructor(e){this._styles=e}get animated(){return this._styles.reduce((e,i)=>e||i.animated,!1)}isCompatible(e){if(!(e instanceof H5t)||this._styles.length!==e._styles.length)return!1;const i=this._styles.length;for(let r=0;rn.load(e,i)));return new Dsr(r)}render(e,i,r){for(let n=0;ne&&i.ready,!0)}},Fsr=class W5t{constructor(e){this._params=e}get animated(){return this._params.flowSpeed>0}isCompatible(e){return e instanceof W5t&&XAt(this._params,e._params)}async load(e,i){const{extent:r,size:n}=e;sn(i);const s=await this._params.loadImagery(r,n[0],n[1],this._params.timeExtent,i),{vertexData:o,indexData:a}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,s,i);return new Nsr(o,a,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(e,i,r){const{context:n}=e,{program:s}=r;n.setFaceCullingEnabled(!1),n.setBlendingEnabled(!0),n.setBlendFunction(cn.ONE,cn.ONE_MINUS_SRC_ALPHA),n.useProgram(s),s.setUniform1f("u_time",i.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",i.dvsMat3),s.setUniformMatrix3fv("u_displayViewMat3",i.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(ls.TRIANGLES,r.indexCount,Di.UNSIGNED_INT,0)}};const Uj=new Map;Uj.set("a_positionAndSide",0),Uj.set("a_timeInfo",1),Uj.set("a_extrude",2),Uj.set("a_speed",3);const Lsr={geometry:[new qo("a_positionAndSide",3,Di.FLOAT,0,36),new qo("a_timeInfo",3,Di.FLOAT,12,36),new qo("a_extrude",2,Di.FLOAT,24,36),new qo("a_speed",1,Di.FLOAT,32,36)]},ksr={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",attributes:Uj};let Nsr=class{constructor(e,i,r){this._vertexData=e,this._indexData=i,this._values=r}attach(e){const{context:i}=e,r=Ko.createVertex(i,Lo.STATIC_DRAW,this._vertexData),n=Ko.createIndex(i,Lo.STATIC_DRAW,this._indexData),s=new Ac(i,Uj,Lsr,{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(ksr,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 $sr=4,Bsr=1,Gsr=.5,Vsr=!0,Usr=!0,jsr=2.3;function zsr(t,e){const{flowSpeed:i,trailLength:r}=t,n=_sr(t);let s=null;const o={opacity:xsr(t),size:Gke(t)};let a=wsr(t);if(t.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 d={loadImagery:e.loadImagery,timeExtent:e.timeExtent,color:a,opacity:{kind:"constant",value:[1]}};s=new Csr(d),o.color=bsr()}const l={loadImagery:e.loadImagery,createFlowMesh:e.createFlowMesh,simulationSettings:n,timeExtent:e.timeExtent,trailLength:r,flowSpeed:i,featheringSize:Bsr,featheringOffset:Gsr,introFade:Vsr,fadeToZero:Usr,decayRate:jsr,color:o.color,opacity:o.opacity,size:o.size},c=t.trailCap==="butt"||WAt(Gke(t))<=$sr?new Fsr(l):new Asr(l);return ye(s)?new Msr([s,c]):c}let Hsr=class extends j_{constructor(){super(...arguments),this._visualState={time:0,dvsMat3:Cl(),displayViewMat3:Cl()}}dispose(){}prepareState(e){const{context:i}=e;i.setColorMask(!0,!0,!0,!0),i.setStencilFunction(El.EQUAL,0,255)}draw(e,i){const{requestRender:r,allowDelayedRender:n}=e,{displayData:s}=i;if(lt(s)||(s.state.name==="loaded"&&s.attach(e),s.state.name!=="attached"))return;const o=s.state.resources;n&&!o.ready&&ye(r)?r():(this._visualState.time=e.time/1e3,this._visualState.dvsMat3=i.transforms.dvs,this._visualState.displayViewMat3=e.state.displayViewMat3,s.flowStyle.render(e,this._visualState,o),s.flowStyle.animated&&ye(r)&&r())}},Wsr=class extends Lj{constructor(){super(...arguments),this.flowStyle=null}get requiresDedicatedFBO(){return!1}doRender(e){super.doRender(e)}prepareRenderPasses(e){const i=e.registerRenderPass({name:"flow",brushes:[Hsr],target:()=>this.children,drawPhase:io.MAP});return[...super.prepareRenderPasses(e),i]}},qsr=class{constructor(e,i,r,n){this.state={name:"created"},this.flowStyle=e,this.extent=i,this.size=r,this.pixelRatio=n}async load(){const e=new AbortController;this.state={name:"loading",abortController:e};const i={extent:this.extent,size:this.size,pixelRatio:this.pixelRatio},r=await this.flowStyle.load(i,e.signal);this.state={name:"loaded",resources:r}}attach(e){if(this.state.name!=="loaded")return void Ei.getLogger("esri.views.2d.engine.flow.FlowDisplayData").error("Only loaded resources can be attached.");const i=this.state.resources;i.attach(e),this.state={name:"attached",resources:i}}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}},Ysr=class extends CS{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(e){this._displayData=e,this.requestRender()}clear(){ye(this._displayData)&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(e){const{displayData:i}=this;if(lt(i))return;const r=i.extent.xmin,n=i.extent.ymax,s=[0,0];e.toScreen(s,[r,n]);const o=(i.extent.xmax-i.extent.xmin)/i.size[0]/e.resolution,a=Jb(e.rotation),{dvs:l}=this.transforms;UIe(l,[-1,1,0]),nP(l,l,[2/(e.size[0]*e.pixelRatio),-2/(e.size[1]*e.pixelRatio),1]),ug(l,l,[s[0],s[1],0]),ST(l,l,a),nP(l,l,[o*e.pixelRatio,o*e.pixelRatio,1])}_createTransforms(){return{dvs:Cl()}}};const Xsr=1.15;let jj=class extends fn{constructor(e){super(e),this._flowDisplayObject=new Ysr,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:i}=this.flowContainer;if(lt(i))return void this._clear();const{extent:r,rotation:n,resolution:s,pixelRatio:o}=e.state,a=Jsr(r,n);a.expand(Xsr);const l=[Math.round((a.xmax-a.xmin)/s),Math.round((a.ymax-a.ymin)/s)],c=new qsr(i,a,l,o);if(ye(this._loading)){if(this._loading.update(c))return;this._loading.detach(),this._loading=null}!lt(this._flowDisplayObject.displayData)&&this._flowDisplayObject.displayData.update(c)||(c.load().then(()=>{this._flowDisplayObject.clear(),this._flowDisplayObject.displayData=this._loading,this._loading=null},d=>{ss(d)||(Ei.getLogger(this.declaredClass).error("A resource failed to load.",d),this._loading=null)}),this._loading=c)}_clear(){this._flowDisplayObject.clear(),ye(this._loading)&&(this._loading.detach(),this._loading=null)}};E([k()],jj.prototype,"_loading",void 0),E([k()],jj.prototype,"flowContainer",void 0),E([k()],jj.prototype,"updating",null),jj=E([ht("esri.views.2d.engine.flow.FlowStrategy")],jj);const Ksr=jj;function Jsr(t,e){const i=new Yi({x:(t.xmax+t.xmin)/2,y:(t.ymax+t.ymin)/2,spatialReference:t.spatialReference}),r=t.xmax-t.xmin,n=t.ymax-t.ymin,s=Math.abs(Math.cos(Jb(e))),o=Math.abs(Math.sin(Jb(e))),a=s*r+o*n,l=o*r+s*n,c=new vr({xmin:i.x-a/2,ymin:i.y-l/2,xmax:i.x+a/2,ymax:i.y+l/2,spatialReference:t.spatialReference});return c.centerAt(i),c}let OS=class extends fn{constructor(){super(...arguments),this._loadImagery=(e,i,r,n,s)=>XJe(this.layer,e,i,r,n,s),this._createFlowMesh=(e,i,r,n)=>this.layer.createFlowMesh({meshType:e,flowData:r,simulationSettings:i},{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,i=()=>{this._loadImagery=(r,n,s,o,a)=>XJe(e,r,n,s,o,a),this._updateVisualization()};"multidimensionalDefinition"in e?this.addHandles(Qi(()=>e.multidimensionalDefinition,i)):this.addHandles([Qi(()=>e.mosaicRule,i),Qi(()=>e.renderingRule,i),Qi(()=>e.definitionExpression,i)]),this.container=new Wsr,this._strategy=new Ksr({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 js({attributes:{},geometry:e.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){const e=this.layer.renderer;if(e==null||e.type!=="flow")return;const i=zsr(e,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent});this.container.flowStyle=i,this.layerView.requestUpdate()}};E([k()],OS.prototype,"_strategy",void 0),E([k()],OS.prototype,"attached",void 0),E([k()],OS.prototype,"container",void 0),E([k()],OS.prototype,"layer",void 0),E([k()],OS.prototype,"layerView",void 0),E([k()],OS.prototype,"type",void 0),E([k()],OS.prototype,"updating",null),E([k()],OS.prototype,"timeExtent",void 0),OS=E([ht("esri.views.2d.engine.flow.FlowView2D")],OS);const KAt=OS;let mx=class extends fn{constructor(){super(...arguments),this.attached=!1,this.container=new yj,this.updateRequested=!1,this.type="imagery",this._bitmapView=new Bj}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(i=>{ss(i)||Ei.getLogger(this.declaredClass).error(i)})}hitTest(e){return new js({attributes:{},geometry:e.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const e=this.layer.version>=10,i=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,r=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new fge({container:this._bitmapView,imageNormalizationSupported:e,imageMaxHeight:i,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:i}=e;if(!i||i instanceof ImageBitmap)return;const r=await this.layer.applyRenderer({extent:i.extent,pixelBlock:i.originalPixelBlock??i.pixelBlock});i.filter=n=>this.layer.pixelFilter?this.layer.applyFilter(n):{...r,extent:i.extent}}).catch(e=>{ss(e)||Ei.getLogger(this.declaredClass).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 i=this.view.extent,r=e.map(s=>s.source).filter(s=>s.extent&&s.extent.intersects(i)).map(s=>({extent:s.extent,pixelBlock:s.originalPixelBlock})),n=bYt(r,i);return ye(n)?{extent:n.extent,pixelBlock:n.pixelBlock}:null}return null}async _fetchImage(e,i,r,n){(n=n||{}).timeExtent=this.timeExtent,n.requestAsImageElement=!0,n.returnImageBitmap=!0;const s=await this.layer.fetchImage(e,i,r,n);if(s.imageBitmap)return s.imageBitmap;const o=await this.layer.applyRenderer(s.pixelData,{signal:n.signal}),a=new RAt(o.pixelBlock,o.extent?.clone(),s.pixelData.pixelBlock);return a.filter=l=>this.layer.applyFilter(l),a}};E([k()],mx.prototype,"attached",void 0),E([k()],mx.prototype,"container",void 0),E([k()],mx.prototype,"layer",void 0),E([k()],mx.prototype,"strategy",void 0),E([k()],mx.prototype,"timeExtent",void 0),E([k()],mx.prototype,"view",void 0),E([k()],mx.prototype,"updateRequested",void 0),E([k()],mx.prototype,"updating",null),E([k()],mx.prototype,"type",void 0),mx=E([ht("esri.views.2d.layers.imagery.ImageryView2D")],mx);const Zsr=mx,yge=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]),JAt={beaufort_ft:yge,beaufort_m:yge,beaufort_km:yge,beaufort_mi:yge,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]),single_arrow:new Float32Array([0,92/255,230/255,1]),wind_speed:new Float32Array([0,0,0,1])},ZAt=[0,20];let QAt=class extends j_{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(cn.ONE,cn.ONE_MINUS_SRC_ALPHA,cn.ONE,cn.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0),e.setStencilOp(Yl.KEEP,Yl.KEEP,Yl.REPLACE)}draw(e,i){if(lt(i.source)||i.source.validPixelCount===0)return;const{context:r,timeline:n}=e;if(n.begin(this.name),r.setStencilFunction(El.EQUAL,i.stencilRef,255),i.updateVectorFieldVAO(e),e.renderPass==="scalar"){const s=i.vaoData.scalar;s&&this._drawScalars(e,i,s.vao,s.elementCount)}else{const s=i.vaoData.magdir;s&&this._drawTriangles(e,i,s.vao,s.elementCount)}n.end(this.name)}_drawTriangles(e,i,r,n){const{context:s,painter:o,requestRender:a,allowDelayedRender:l}=e,{symbolizerParameters:c}=i,d=c.dataRange?["dataRange"]:[];c.rotationType==="geographic"&&d.push("rotationGeographic");const p=o.materialManager.getProgram(this._desc.magdir,d);if(l&&ye(a)&&!p.compiled)return void a();s.useProgram(p);const{coordScale:y,opacity:v,transforms:S}=i;p.setUniform2fv("u_coordScale",y),p.setUniform1f("u_opacity",v),p.setUniformMatrix3fv("u_dvsMat3",S.dvs);const{style:I,dataRange:O,rotation:L,symbolPercentRange:N}=c;p.setUniform4fv("u_colors",JAt[I]||JAt.single_arrow),p.setUniform2fv("u_dataRange",O||ZAt),p.setUniform1f("u_rotation",L),p.setUniform2fv("u_symbolPercentRange",N);const G=this._getSymbolSize(e,i);p.setUniform2fv("u_symbolSize",G),s.bindVAO(r),s.drawElements(ls.TRIANGLES,n,Di.UNSIGNED_INT,0)}_drawScalars(e,i,r,n){const{context:s,painter:o,requestRender:a,allowDelayedRender:l}=e,{symbolizerParameters:c}=i,d=[];c.style==="wind_speed"?d.push("innerCircle"):c.dataRange&&d.push("dataRange"),c.rotationType==="geographic"&&d.push("rotationGeographic");const p=o.materialManager.getProgram(this._desc.scalar,d);if(l&&ye(a)&&!p.compiled)return void a();s.useProgram(p);const{coordScale:y,opacity:v,transforms:S}=i;p.setUniform2fv("u_coordScale",y),p.setUniform1f("u_opacity",v),p.setUniformMatrix3fv("u_dvsMat3",S.dvs);const{dataRange:I,symbolPercentRange:O}=c;p.setUniform2fv("u_dataRange",I||ZAt),p.setUniform2fv("u_symbolPercentRange",O);const L=this._getSymbolSize(e,i);p.setUniform2fv("u_symbolSize",L),s.bindVAO(r),s.drawElements(ls.TRIANGLES,n,Di.UNSIGNED_INT,0)}_getSymbolSize(e,i){const r=i.key?2**(e.displayLevel-i.key.level):i.resolution/e.state.resolution,{symbolTileSize:n}=i.symbolizerParameters;return[n/(Math.round((i.width-i.offset[0])/n)*n)/r,n/(Math.round((i.height-i.offset[1])/n)*n)/r]}},Qsr=class extends Lj{constructor(){super(...arguments),this.symbolTypes=["triangle"]}get requiresDedicatedFBO(){return!1}prepareRenderPasses(e){const i=e.registerRenderPass({name:"imagery (vf)",brushes:[QAt],target:()=>this.children,drawPhase:io.MAP});return[...super.prepareRenderPasses(e),i]}doRender(e){this.visible&&e.drawPhase===io.MAP&&this.symbolTypes.forEach(i=>{e.renderPass=i,super.doRender(e)})}},ePt=class extends CS{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(){ye(this.vaoData)&&(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&&ye(this.vaoData)&&(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,ye(this.source)&<(this.vaoData)){const{style:i}=this.symbolizerParameters;switch(i){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=eKe(this.source,this.symbolizerParameters),n=this._createVectorFieldVAO(e.context,r);this.vaoData={magdir:n}}break;case"simple_scalar":{const r=xCe(this.source,this.symbolizerParameters),n=this._createVectorFieldVAO(e.context,r);this.vaoData={scalar:n}}break;case"wind_speed":{const r=eKe(this.source,this.symbolizerParameters),n=this._createVectorFieldVAO(e.context,r),s=xCe(this.source,this.symbolizerParameters),o=this._createVectorFieldVAO(e.context,s);this.vaoData={magdir:n,scalar:o}}}}this.ready(),this.requestRender()}}_createTransforms(){return{dvs:Cl()}}setTransform(e){const i=rP(this.transforms.dvs),[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;ug(i,i,lp(r,n)),ug(i,i,lp(o/2,a/2)),ST(i,i,-l),ug(i,i,lp(-o/2,-a/2)),jle(i,i,lp(o,a)),ov(this.transforms.dvs,e.displayViewMat3,i)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(e,i){const{vertexData:r,indexData:n}=i,s=Ko.createVertex(e,Lo.STATIC_DRAW,new Float32Array(r)),o=Ko.createIndex(e,Lo.STATIC_DRAW,new Uint32Array(n)),a=QP("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:Di.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:Di.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:Di.FLOAT,normalized:!1}]});return{vao:new Ac(e,a.attributes,a.bufferLayouts,{geometry:s},o),elementCount:n.length}}},U6=class extends fn{constructor(e){super(e),this._loading=null,this.update=$y((i,r)=>this._update(i,r).catch(n=>{ss(n)||Ei.getLogger(this.declaredClass).error(n)}))}get updating(){return!!this._loading}redraw(e){if(!this.container.children.length)return;const i=this.container.children[0];i.symbolizerParameters=e,i.invalidateVAO(),this.container.symbolTypes=e.style==="wind_speed"?["scalar","triangle"]:e.style==="simple_scalar"?["scalar"]:["triangle"],this.container.requestRender()}async _update(e,i,r){if(!e.stationary)return;const{extent:n,spatialReference:s}=e.state,o=new vr({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 c=await this._loading;this._addToDisplay(c,i,e.state),this._loading=null}_addToDisplay(e,i,r){if(lt(e.pixelBlock))return this.container.children.forEach(a=>a.destroy()),void this.container.removeAllChildren();const{extent:n,pixelBlock:s}=e,o=new ePt(s);o.offset=[0,0],o.symbolizerParameters=i,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*i.symbolTileSize,o.height=s.height*i.symbolTileSize,this.container.children.forEach(a=>a.destroy()),this.container.removeAllChildren(),this.container.symbolTypes=i.style==="wind_speed"?["scalar","triangle"]:i.style==="simple_scalar"?["scalar"]:["triangle"],this.container.addChild(o)}};E([k()],U6.prototype,"fetchPixels",void 0),E([k()],U6.prototype,"container",void 0),E([k()],U6.prototype,"_loading",void 0),E([k()],U6.prototype,"updating",null),U6=E([ht("esri.views.2d.layers.imagery.ImageryVFStrategy")],U6);const eor=U6;let qE=class extends KC{constructor(){super(...arguments),this.attached=!1,this.container=new Qsr,this.type="imageryVF",this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""},this._fetchpixels=async(e,i,r,n)=>{const s=await this._projectFullExtentPromise,{symbolTileSize:o}=this.layer.renderer,{extent:a,width:l,height:c}=IYt(e,i,r,o,s);if(ye(s)&&!s.intersects(e))return{extent:a,pixelBlock:null};const d={bbox:`${a.xmin}, ${a.ymin}, ${a.xmax}, ${a.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:o,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(d)){const v=this.getPixelData();if(ye(v)&&`${v.extent.xmin}, ${v.extent.ymin}, ${v.extent.xmax}, ${v.extent.ymax}`===d.bbox)return v}const{pixelData:p}=await this.layer.fetchImage(a,l,c,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:n});this._dataParameters=d;const y=p?.pixelBlock;return lt(y)?{extent:a,pixelBlock:null}:{extent:a,pixelBlock:this.layer.rasterInfo.dataType==="vector-uv"?yB(y,"vector-uv"):y}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference),this._strategy=new eor({container:this.container,fetchPixels:this._fetchpixels}),this.handles.add(Qi(()=>this.layer.renderer,e=>this._updateSymbolizerParams(e),jh),"attach")}detach(){this._strategy.destroy(),this.container.children.forEach(e=>e.destroy()),this.container.removeAllChildren(),this.handles.remove("attach"),this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){const e=this.container.children[0]?.rawPixelData;if(this.updating||!e)return null;const{extent:i,pixelBlock:r}=e;return{extent:i,pixelBlock:r}}hitTest(e){return new js({attributes:{},geometry:e.clone(),layer:this.layer})}update(e){this._strategy.update(e,this._symbolizerParams)}redraw(){const{renderer:e}=this.layer;e&&(this._updateSymbolizerParams(e),this._strategy.redraw(this._symbolizerParams))}_canReuseVectorFieldData(e){const i=this._dataParameters.exportParametersVersion===e.exportParametersVersion,r=this._dataParameters.time===e.time,n=this._dataParameters.symbolTileSize===e.symbolTileSize,s=this._dataParameters.bbox===e.bbox;return i&&r&&n&&s}async _getProjectedFullExtent(e){try{return await JD(this.layer.fullExtent,e)}catch{try{const r=(await ir(this.layer.url,{query:{option:"footprints",outSR:e.wkid||JSON.stringify(e.toJSON()),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return r?vr.fromJSON(r):null}catch{return null}}}_updateSymbolizerParams(e){e.type==="vector-field"&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};E([k()],qE.prototype,"attached",void 0),E([k()],qE.prototype,"container",void 0),E([k()],qE.prototype,"layer",void 0),E([k()],qE.prototype,"timeExtent",void 0),E([k()],qE.prototype,"type",void 0),E([k()],qE.prototype,"view",void 0),E([k()],qE.prototype,"updating",null),qE=E([ht("esri.views.2d.layers.imagery.VectorFieldView2D")],qE);const tor=qE,ior=t=>{let e=class extends t{constructor(){super(...arguments),this.view=null}async fetchPopupFeatures(i,r){const{layer:n}=this;if(!i)throw new st("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:n});const{popupEnabled:s}=n,o=DF(n,r);if(!s||lt(o))throw new st("imagerylayerview:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:s,popupTemplate:o});const a=await o.getRequiredFields(),l=new Ss;l.timeExtent=this.timeExtent,l.geometry=i,l.outFields=a,l.outSpatialReference=i.spatialReference;const{resolution:c,spatialReference:d}=this.view,p=this.view.type==="2d"?new Yi(c,c,d):new Yi(.5*c,.5*c,d),{returnTopmostRaster:y,showNoDataRecords:v}=o.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},S={returnDomainValues:!0,returnTopmostRaster:y,pixelSize:p,showNoDataRecords:v,signal:ye(r)?r.signal:null};return n.queryVisibleRasters(l,S).then(I=>I)}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return E([k()],e.prototype,"layer",void 0),E([k()],e.prototype,"suspended",void 0),E([k(j9)],e.prototype,"timeExtent",void 0),E([k()],e.prototype,"view",void 0),e=E([ht("esri.views.layers.ImageryLayerView")],e),e};let hee=class extends ior(MF(_y(by))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new V1,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}async hitTest(e,i){return this.subview?[{type:"graphic",graphic:this.subview.hitTest(e),layer:this.layer,mapPoint:e}]:null}update(e){this.subview?.update(e)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new fx({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new Oke(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([Qi(()=>this.layer.blendMode??"normal",e=>this.subview&&(this.subview.container.blendMode=e),jh),Qi(()=>this.layer.effect??null,e=>this.subview&&(this.subview.container.effect=e),jh),Qi(()=>this.layer.exportImageServiceParameters.version,e=>{e&&this._exportImageVersion!==e&&(this._exportImageVersion=e,this.requestUpdate())},Nu),Qi(()=>this.timeExtent,e=>{const{subview:i}=this;i&&(i.timeExtent=e,"redraw"in i?this.requestUpdate():i.redrawOrRefetch())},Nu),this.layer.on("redraw",()=>{const{subview:e}=this;e&&("redraw"in e?e.redraw():e.redrawOrRefetch())}),Qi(()=>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,i){if(!((Array.isArray(e)?e[0]:fr.isCollection(e)?e.getItemAt(0):e)instanceof js))return{remove:()=>{}};let r=[];return Array.isArray(e)||fr.isCollection(e)?r=e.map(n=>n.clone()):e instanceof js&&(r=[e.clone()]),this._highlightGraphics.addMany(r),{remove:()=>{this._highlightGraphics.removeMany(r)}}}async doRefresh(){this.requestUpdate()}isUpdating(){return!this.subview||this.subview.updating}_setSubView(){if(!this.view)return;const e=this.layer.renderer?.type;let i="imagery";if(e==="vector-field"?i="imageryVF":e==="flow"&&(i="flow"),this.subview){const{type:r}=this.subview;if(r===i)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=i==="imagery"?new Zsr({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):i==="imageryVF"?new tor({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new KAt({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),e.container.blendMode=this.layer.blendMode,e.container.effect=this.layer.effect)}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};E([k()],hee.prototype,"pixelData",null),E([k()],hee.prototype,"subview",void 0),hee=E([ht("esri.views.2d.layers.ImageryLayerView2D")],hee);const ror=Object.freeze(Object.defineProperty({__proto__:null,default:hee},Symbol.toStringTag,{value:"Module"}));function nor(t,e,i="nearest",r=!1){const n=!(r&&e.pixelType==="u8"),s=n?ts.FLOAT:ts.UNSIGNED_BYTE,o=e.pixels==null||e.pixels.length===0?null:n?e.getAsRGBAFloat():e.getAsRGBA(),a=t.capabilities.textureFloat?.textureFloatLinear,l={width:e.width,height:e.height,target:Ws.TEXTURE_2D,pixelFormat:nn.RGBA,internalFormat:t.type===lo.WEBGL2&&n?ks.RGBA32F:nn.RGBA,samplingMode:!a||i!=="bilinear"&&i!=="cubic"?mn.NEAREST:mn.LINEAR,dataType:s,wrapMode:us.CLAMP_TO_EDGE,flipped:!1};return new bs(t,l,o)}function tPt(t,e){const{spacing:i,offsets:r,coefficients:n,size:[s,o]}=e,a=i[0]>1,l={width:a?4*s:s,height:o,target:Ws.TEXTURE_2D,pixelFormat:nn.RGBA,internalFormat:t.type===lo.WEBGL2?ks.RGBA32F:nn.RGBA,dataType:ts.FLOAT,samplingMode:mn.NEAREST,wrapMode:us.CLAMP_TO_EDGE,flipped:!1},c=new Float32Array(a?s*o*16:2*r.length);if(a&&n!=null)for(let d=0,p=0;d{const n=e.get(r)||e.get(r+"[0]");n&&cor(t,r,i[r],n)})}function zj(t,e,i,r){i.length===r.length&&(r.some(n=>n==null)||i.some(n=>n==null)||i.forEach((n,s)=>{e.setUniform1i(n,s),t.bindTexture(r[s],s)}))}function cor(t,e,i,r){if(r===null||i==null)return!1;const{info:n}=r;switch(n.type){case b0.FLOAT:n.size>1?t.setUniform1fv(e,i):t.setUniform1f(e,i);break;case b0.FLOAT_VEC2:t.setUniform2fv(e,i);break;case b0.FLOAT_VEC3:t.setUniform3fv(e,i);break;case b0.FLOAT_VEC4:t.setUniform4fv(e,i);break;case b0.FLOAT_MAT3:t.setUniformMatrix3fv(e,i);break;case b0.FLOAT_MAT4:t.setUniformMatrix4fv(e,i);break;case b0.INT:n.size>1?t.setUniform1iv(e,i):t.setUniform1i(e,i);break;case b0.BOOL:t.setUniform1i(e,i?1:0);break;case b0.INT_VEC2:case b0.BOOL_VEC2:t.setUniform2iv(e,i);break;case b0.INT_VEC3:case b0.BOOL_VEC3:t.setUniform3iv(e,i);break;case b0.INT_VEC4:case b0.BOOL_VEC4:t.setUniform4iv(e,i);break;default:return!1}return!0}const hor={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 dor=class extends CS{constructor(e=null,i=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=i,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)}get processed(){return this._processed}set processed(e){this._processed=e,e||(Ba(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||hor}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.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"?mn.LINEAR:mn.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid=e,this._transformGridTexture=Ba(this._transformGridTexture)}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}_createTransforms(){return{dvs:Cl()}}setTransform(e){const i=rP(this.transforms.dvs),[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;ug(i,i,lp(r,n)),ug(i,i,lp(o/2,a/2)),ST(i,i,-l),ug(i,i,lp(-o/2,-a/2)),jle(i,i,lp(o,a)),ov(this.transforms.dvs,e.displayViewMat3,i)}getTextures({forProcessing:e=!1,useProcessedTexture:i=!1}={}){const r=i?this._processedTexture??this._rasterTexture:this._rasterTexture,n=[],s=[];return r?i?(s.push(r),n.push("u_image"),this._colormapTexture&&(s.push(this._colormapTexture),n.push("u_colormap")),{names:n,textures:s}):(this._transformGridTexture&&(s.push(this._transformGridTexture),n.push("u_transformGrid")),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 i=this._isValidSource(this.source);i&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(e)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(e),this._rasterTexture&&(i?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=tPt(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(i=>i?.dispose()),e.length=0)}_createOrDestroyRasterTexture(e){const i=ye(this.source)?sae(this.source,this.bandIds):null;if(!this._isValidSource(i))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||!e.capabilities.textureFloat?.textureFloat;this._rasterTexture=nor(e,i,n,s),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdschanged(e){const i=this._rasterTextureBandIds;return!(i==null&&e==null||i&&e&&i.join("")===e.join(""))}_isValidSource(e){return ye(e)&&e.pixels?.length>0}_getTextureSamplingMethod(e){const{type:i,colormap:r}=this.symbolizerParameters,n=i==="lut"||i==="stretch"&&ye(r);return!this._supportsBilinearTexture||n||e!=="bilinear"&&e!=="cubic"?"nearest":"bilinear"}_updateColormapTexture(e){const i=this._colormap,r=this.symbolizerParameters.colormap;return r?i?r.length!==i.length||r.some((n,s)=>n!==i[s])?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=iPt(e,r),void(this._colormap=r)):void 0:(this._colormapTexture=iPt(e,r),void(this._colormap=r)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(e=!1){this._transformGridTexture&&(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 por(t){return ye(t.source)}function jke(t){const e=[];return t&&(e.push("applyProjection"),t.spacing[0]===1&&e.push("lookupProjection")),e}function rPt(t,e,i){const r=!i.capabilities.textureFloat?.textureFloatLinear,n=[];return t==="cubic"?n.push("bicubic"):t==="bilinear"&&(e?(n.push("bilinear"),n.push("nnedge")):r&&n.push("bilinear")),n}const mor={vsPath:"raster/common",fsPath:"raster/lut",attributes:new Map([["a_position",0],["a_texcoord",1]])};function gor(t,e,i){const r=i?[]:jke(e.transformGrid);return{defines:r,program:t.painter.materialManager.getProgram(mor,r)}}function yor(t,e,i,r,n=!1){const{names:s,textures:o}=i.getTextures({useProcessedTexture:n});zj(t.context,e,s,o),kF(e,r,i.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",i.transforms.dvs);const{colormap:a,colormapOffset:l}=i.symbolizerParameters,c=Uke(a,l);kF(e,r,c)}const vor={createProgram:gor,bindTextureAndUniforms:yor},_or={vsPath:"raster/common",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function bor(t,e,i){const{colormap:r}=e.symbolizerParameters,n=[...i?[]:jke(e.transformGrid),...rPt(e.interpolation,r!=null,t.context)];return r!=null&&n.push("applyColormap"),{defines:n,program:t.painter.materialManager.getProgram(_or,n)}}function wor(t,e,i,r,n=!1){const{names:s,textures:o}=i.getTextures({useProcessedTexture:n});zj(t.context,e,s,o),kF(e,r,i.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",i.transforms.dvs);const a=i.symbolizerParameters,{colormap:l,colormapOffset:c}=a;if(l!=null){const p=Uke(l,c);kF(e,r,p)}const d=lor(a);kF(e,r,d)}const xor={createProgram:bor,bindTextureAndUniforms:wor},Sor={vsPath:"raster/common",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Cor(t,e,i){const{colormap:r}=e.symbolizerParameters,n=[...i?[]:jke(e.transformGrid),...rPt(e.interpolation,r!=null,t.context)];return e.isRendereredSource&&!i?n.push("noop"):r!=null&&n.push("applyColormap"),{defines:n,program:t.painter.materialManager.getProgram(Sor,n)}}function Tor(t,e,i,r,n=!1){const{names:s,textures:o}=i.getTextures({useProcessedTexture:n});zj(t.context,e,s,o),kF(e,r,i.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",i.transforms.dvs);const a=i.symbolizerParameters,{colormap:l,colormapOffset:c}=a;if(l!=null){const p=Uke(l,c);kF(e,r,p)}const d=aor(a);kF(e,r,d)}const Eor={createProgram:Cor,bindTextureAndUniforms:Tor},vge=new Map;function Ior(t){return vge.get(t)}vge.set("lut",vor),vge.set("hillshade",xor),vge.set("stretch",Eor);const Aor=[1,1],Por=[2,0,0,0,2,0,-1,-1,0];function YE(t,e,i){const{context:r,rasterFunction:n,hasBranches:s}=t,{raster:o}=n.parameters,a=s?o?.id??-1:0,l=i.functionTextures[a]??i.rasterTexture;zj(r,e,["u_image"],[l])}function nPt(t,e,i){const{rasters:r}=t.rasterFunction.parameters;if(!r)return;if(r.length<2)return YE(t,e,i);const n=r.filter(s=>s.name!=="Constant").map(s=>s.id!=null&&s.name!=="Identity"?i.functionTextures[s.id]:i.rasterTexture);if(zj(t.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(d=>d.name!=="Constant"),c=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",c)}}}}function RS(t){t.setUniform2fv("u_coordScale",Aor),t.setUniformMatrix3fv("u_dvsMat3",Por)}const Oor={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/aspect",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Ror(t,e){return t.painter.materialManager.getProgram(Oor,[])}function Mor(t,e,i){YE(t,e,i),RS(e);const{width:r,height:n,resolution:s}=i;e.setUniform2fv("u_srcImageSize",[r,n]),e.setUniform2fv("u_cellSize",[s,s])}const Dor={createProgram:Ror,bindTextureAndUniforms:Mor},For={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/bandarithmetic",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Lor(t,e){const{painter:i,rasterFunction:r}=t,{indexType:n}=r.parameters;return i.materialManager.getProgram(For,[n])}function kor(t,e,i){YE(t,e,i),RS(e);const{bandIndexMat3:r}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const Nor={createProgram:Lor,bindTextureAndUniforms:kor},$or={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/compositeband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Bor(t,e){return t.painter.materialManager.getProgram($or,[])}function Gor(t,e,i){nPt(t,e,i),RS(e)}const Vor={createProgram:Bor,bindTextureAndUniforms:Gor},Uor={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/convolution",attributes:new Map([["a_position",0],["a_texcoord",1]])};function jor(t,e){const{painter:i,rasterFunction:r}=t,{kernelRows:n,kernelCols:s}=r.parameters,o=[{name:"rows",value:n},{name:"cols",value:s}];return i.materialManager.getProgram(Uor,o)}function zor(t,e,i){YE(t,e,i),RS(e),e.setUniform2fv("u_srcImageSize",[i.width,i.height]);const{kernel:r,clampRange:n}=t.rasterFunction.parameters;e.setUniform1fv("u_kernel",r),e.setUniform2fv("u_clampRange",n)}const Hor={createProgram:jor,bindTextureAndUniforms:zor},Wor={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/extractband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function qor(t,e){return t.painter.materialManager.getProgram(Wor,[])}function Yor(t,e,i){YE(t,e,i),RS(e);const{bandIndexMat3:r}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const Xor={createProgram:qor,bindTextureAndUniforms:Yor},Kor={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/local",attributes:new Map([["a_position",0],["a_texcoord",1]])},Jor=new Set(["sinh","cosh","tanh","asinh","acosh","atanh"]);function Zor(t){const{painter:e,rasterFunction:i}=t,{imageCount:r,operationName:n,rasters:s,isOutputRounded:o}=i.parameters;let a=n.toLowerCase();t.context.type===lo.WEBGL1&&Jor.has(a)&&(a=`polyfill${a}`);const l=[a];r===2&&l.push("twoImages");const c=s.filter(d=>d.name==="Constant");return c.length&&(l.push("oneConstant"),c.length===2&&l.push("twoConstant")),o&&l.push("roundOutput"),e.materialManager.getProgram(Kor,l)}function Qor(t,e,i){nPt(t,e,i),RS(e);const{domainRange:r}=t.rasterFunction.parameters;e.setUniform2fv("u_domainRange",r)}const ear={createProgram:Zor,bindTextureAndUniforms:Qor},tar={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/mask",attributes:new Map([["a_position",0],["a_texcoord",1]])};function iar(t,e){const{painter:i,rasterFunction:r}=t,n=r.parameters.bandCount>1?["multiBand"]:[];return i.materialManager.getProgram(tar,n)}function rar(t,e,i){YE(t,e,i),RS(e);const{includedRanges:r,noDataValues:n}=t.rasterFunction.parameters;e.setUniform1fv("u_includedRanges",r),e.setUniform1fv("u_noDataValues",n)}const nar={createProgram:iar,bindTextureAndUniforms:rar},sar={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/ndvi",attributes:new Map([["a_position",0],["a_texcoord",1]])};function oar(t,e){const{painter:i,rasterFunction:r}=t,n=r.parameters.scaled?["scaled"]:[];return i.materialManager.getProgram(sar,n)}function aar(t,e,i){YE(t,e,i),RS(e);const{bandIndexMat3:r}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const lar={createProgram:oar,bindTextureAndUniforms:aar},uar={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/remap",attributes:new Map([["a_position",0],["a_texcoord",1]])};function car(t,e){return t.painter.materialManager.getProgram(uar,[])}function har(t,e,i){YE(t,e,i),RS(e);const{noDataRanges:r,rangeMaps:n,allowUnmatched:s,clampRange:o}=t.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 dar={createProgram:car,bindTextureAndUniforms:har},par={vsPath:"raster/common",fsPath:"raster/reproject",attributes:new Map([["a_position",0],["a_texcoord",1]])};function far(t,e){const{painter:i}=t,r=[],n=!t.context.capabilities.textureFloat?.textureFloatLinear,{interpolation:s,transformGrid:o}=e;return s==="cubic"?r.push("bicubic"):s==="bilinear"&&n&&r.push("bilinear"),o&&(r.push("applyProjection"),o.spacing[0]===1&&r.push("lookupProjection")),i.materialManager.getProgram(par,r)}function mar(t,e,i){const{names:r,textures:n}=i.getTextures({forProcessing:!0});zj(t.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}=i;e.setUniform2fv("u_srcImageSize",[a.width,a.height]),e.setUniform2fv("u_targetImageSize",[s,o]),e.setUniform2fv("u_transformSpacing",l?l.spacing:tP),e.setUniform2fv("u_transformGridSize",l?l.size:tP)}const gar={createProgram:far,bindTextureAndUniforms:mar},yar={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/slope",attributes:new Map([["a_position",0],["a_texcoord",1]])};function _ar(t,e){const{painter:i,rasterFunction:r}=t,{slopeType:n}=r.parameters,s=n==="percent-rise"?["percentRise"]:[];return i.materialManager.getProgram(yar,s)}function bar(t,e,i){YE(t,e,i),RS(e);const{width:r,height:n,resolution:s}=i,{zFactor:o,slopeType:a,pixelSizePower:l,pixelSizeFactor:c}=t.rasterFunction.parameters;e.setUniform2fv("u_srcImageSize",[r,n]),e.setUniform2fv("u_cellSize",[s,s]),e.setUniform1f("u_zFactor",o),e.setUniform1f("u_pixelSizePower",a==="adjusted"?l:0),e.setUniform1f("u_pixelSizeFactor",a==="adjusted"?c:0)}const war={createProgram:_ar,bindTextureAndUniforms:bar},xar={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Sar(t,e){const{useGamma:i,bandCount:r,isOutputRounded:n}=t.rasterFunction.parameters,s=[];return i&&s.push("useGamma"),r>1&&s.push("multiBand"),n&&s.push("roundOutput"),t.painter.materialManager.getProgram(xar,s)}function Car(t,e,i){YE(t,e,i),RS(e);const{width:r,height:n}=i,s=t.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 Tar={createProgram:Sar,bindTextureAndUniforms:Car},gx=new Map;function sPt(t,e,i){const r={width:e,height:i,target:Ws.TEXTURE_2D,pixelFormat:nn.RGBA,internalFormat:t.type===lo.WEBGL2?ks.RGBA32F:nn.RGBA,samplingMode:mn.NEAREST,dataType:ts.FLOAT,isImmutable:t.type===lo.WEBGL2,wrapMode:us.CLAMP_TO_EDGE,flipped:!1};return new bs(t,r)}function Ear(t,e,i,r){const{context:n,requestRender:s,allowDelayedRender:o}=t,a=r.createProgram(t,i);if(o&&ye(s)&&!a.compiled)return s(),null;const{width:l,height:c}=i;return n.bindFramebuffer(e),n.setViewport(0,0,l,c),n.useProgram(a),a}function Iar(t){return gx.get(t.toLowerCase())}function Aar(t,e,i,r){const n=t.rasterFunction.name.toLowerCase(),s=n==="reproject"?gar:Iar(n);if(s==null)return;const o=Ear(t,i,r,s);if(!o)return;s.bindTextureAndUniforms(t,o,r),e.draw();const{width:a,height:l}=r,c=sPt(t.context,a,l);if(i.copyToTexture(0,0,a,l,0,0,c),n==="reproject")r.rasterTexture=c,r.projected=!0;else{const d=t.hasBranches?t.rasterFunction.id:0;r.functionTextures[d]=c}}gx.set("aspect",Dor),gx.set("bandarithmetic",Nor),gx.set("compositeband",Vor),gx.set("convolution",Hor),gx.set("extractband",Xor),gx.set("local",ear),gx.set("mask",nar),gx.set("ndvi",lar),gx.set("remap",dar),gx.set("slope",war),gx.set("stretch",Tar);let Par=class extends j_{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:i,renderPass:r}=e,n=r==="raster";i.setBlendingEnabled(!n),i.setBlendFunctionSeparate(cn.ONE,cn.ONE_MINUS_SRC_ALPHA,cn.ONE,cn.ONE_MINUS_SRC_ALPHA),i.setColorMask(!0,!0,!0,!0),i.setStencilWriteMask(0),i.setStencilTestEnabled(!n)}draw(e,i){if(!por(i)||i.suspended)return;const{renderPass:r}=e;if(r!=="raster-bitmap")return r==="raster"?this._process(e,i):void this._drawBitmap(e,i,!0);this._drawBitmap(e,i)}_process(e,i){const{rasterFunction:r}=e,n=r.name==="Reproject";if(!(n?!(i.rasterTexture&&i.projected):!i.processed))return;const{timeline:s,context:o}=e;s.begin(this.name);const a=o.getBoundFramebufferObject(),l=o.getViewport();n||(i.processedTexture=Ba(i.processedTexture)),o.setStencilFunction(El.EQUAL,i.stencilRef,255),i.updateTexture(e),this._initQuad(o);const{isStandardRasterTileSize:c,fbo:d}=this._getRasterFBO(o,i.width,i.height);Aar(e,this._quad,d,i),c||d.dispose(),o.bindFramebuffer(a),o.setViewport(l.x,l.y,l.width,l.height),s.end(this.name)}_drawBitmap(e,i,r=!1){const{timeline:n,context:s}=e;if(n.begin(this.name),s.setStencilFunction(El.EQUAL,i.stencilRef,255),i.updateTexture(e),r&&!i.processedTexture){if(i.updateProcessedTexture(),!i.processedTexture)return void n.end(this.name);i.processed=!0}this._initBitmapCommonUniforms(i);const o=i.symbolizerParameters.type,a=Ior(o),{requestRender:l,allowDelayedRender:c}=e,{defines:d,program:p}=a.createProgram(e,i,r);if(c&&ye(l)&&!p.compiled)return void l();s.useProgram(p);const y=this._getUniformInfos(o,s,p,d);this._quad||(this._quad=new ux(s,[0,0,1,0,0,1,1,1])),a.bindTextureAndUniforms(e,p,i,y,r),this._quad.draw(),n.end(this.name)}_initBitmapCommonUniforms(e){if(!e.commonUniforms){const i=oor(1,[0,0]),{transformGrid:r,width:n,height:s}=e,o=sor(r,[n,s],[e.source.width,e.source.height],1,!1);e.commonUniforms={...i,...o,u_coordScale:e.coordScale}}}_getRasterFBO(e,i,r){const n=i===Tc||r===Tc;return n?(this._fbo||(this._fbo=this._createNewFBO(e,i,r)),{isStandardRasterTileSize:n,fbo:this._fbo}):{isStandardRasterTileSize:n,fbo:this._createNewFBO(e,i,r)}}_createNewFBO(e,i,r){const n=sPt(e,i,r);return new id(e,{colorTarget:Th.TEXTURE,depthStencilTarget:gl.NONE,width:i,height:r},n)}_initQuad(e){this._quad||(this._quad=new ux(e,[0,0,1,0,0,1,1,1]))}_getUniformInfos(e,i,r,n){const s=n.length>0?e+"-"+n.join("-"):e;if(this._rendererUniformInfos.has(s))return this._rendererUniformInfos.get(s);const o=uor(i,r);return this._rendererUniformInfos.set(s,o),o}},Oar=class extends Cj{constructor(e,i,r,n,s,o,a=null){super(e,i,r,n,s,o),this.bitmap=null,this.bitmap=new dor(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.dvs=this.transforms.dvs}_createTransforms(){return{dvs:Cl(),tileMat3:Cl()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap.stage=null}},Rar=class extends iee{constructor(){super(...arguments),this.isCustomTilingScheme=!1}createTile(e){const i=this._getTileBounds(e),[r,n]=this._tileInfoView.tileInfo.size,s=this._tileInfoView.getTileResolution(e.level);return new Oar(e,s,i[0],i[3],r,n)}prepareRenderPasses(e){const i=e.registerRenderPass({name:"imagery (tile)",brushes:[Par],target:()=>this.children.map(r=>r.bitmap),drawPhase:io.MAP});return[...super.prepareRenderPasses(e),i]}doRender(e){if(!this.visible||e.drawPhase!==io.MAP)return;const{rasterFunctionChain:i}=this;if(!i)return e.renderPass="raster-bitmap",void super.doRender(e);const[r,n]=this._tileInfoView.tileInfo.size;if(e.renderPass="raster",e.rasterFunction={name:"Reproject",parameters:{targetImageSize:[r,n]},pixelType:"f32",id:0,isNoopProcess:!1},super.doRender(e),i?.functions.length){const{functions:s,hasBranches:o}=i;for(let a=0;a{const i=Array.from(e),r=Date.now();for(let n=0;n=e.size)return;const i=Array.from(e);for(let r=0;rr!=null)||AO.delete(t))}function Far(t,e,i){const r=AO.get(t);if(!r)return e==null?NF.decreaseRefCount(t,i):0;if(e==null||r[e]==null)return NF.decreaseRefCount(t,i);const n=r[e]?.cache,s=n?.get(i);if(n&&s){if(s.refCount--,s.refCount===0){n.delete(i);for(let o=0;oo.isResolved=!0).catch(()=>o.isRejected=!0),s[e]?.cache.set(i,o)}function Lar(t,e,i){const r=AO.get(t);r?e!=null&&r[e]!=null?r[e]?.cache.delete(i):NF.deleteBlock(t,i):e==null&&NF.deleteBlock(t,i)}function kar(t,e){const i=AO.get(t);return i?i[e]??null:null}function uPt(t,e,i,r,n,s,o=null){const a=kar(t,e);if(!a)return;const l=a.extent,{cache:c,rasterInfo:d}=a;if(l&&l.xmin===i.xmin&&l.xmax===i.xmax&&l.ymin===i.ymin&&l.ymax===i.ymax)return;r=r??0;const p=i.clone().normalize(),{spatialReference:y,transform:v}=d,S=new Set;for(let I=0;I0?X.pyramidBlockWidth:X.blockWidth,Ie=G>0?X.pyramidBlockHeight:X.blockHeight,ke=1,Ne=Math.max(0,Math.floor(re.x/_e)-ke),J=Math.max(0,Math.floor(re.y/Ie)-ke),he=Math.floor((re.x+fe-1)/_e)+ke,xe=Math.floor((re.y+ge-1)/Ie)+ke;for(let Pe=J;Pe<=xe;Pe++)for(let Oe=Ne;Oe<=he;Oe++)S.add(`${G}/${Pe}/${Oe}`)}c.forEach((I,O)=>{if(!S.has(O)){const L=c.get(O);(L==null||L.isResolved||L.isRejected)&&c.delete(O)}}),a.extent={xmin:i.xmin,ymin:i.ymin,xmax:i.xmax,ymax:i.ymax}}const Nar=[0,0];let Iv=class extends KC{constructor(){super(...arguments),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._rasterFunctionState="na",this._globalUpdateRequested=!1,this.attached=!1,this.timeExtent=null,this.redrawOrRefetch=$y(async(e={})=>{if(!this.previousLOD||this.layerView.suspended)return;const i=this._rasterFunctionState;e.reprocess&&(await this.updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters());const r=this._rasterFunctionState,{type:n}=this;return e.refetch||n!=="raster"&&e.reprocess||r==="cpu"||i==="cpu"?this.updatingHandles.addPromise(this.doRefresh()):this.updatingHandles.addPromise(this._redrawImage(e.signal))})}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")==null||this._get("useProgressiveUpdate")}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const i=this._getCacheSize(e);this._tileStrategy=new uX({cachePolicy:"purge",acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),cacheSize:i,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:i,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=i.toJSON?i:vr.fromJSON(i);uPt(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._fetchQueue?.updating||this._globalUpdateRequested||!(!this.updatingHandles||!this.updatingHandles.updating)}attach(){TT("2d").supportsTextureFloat||(this.useWebGLForProcessing=!1),this._initializeTileInfo(),this._tileInfoView=new wk(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new uG({tileInfoView:this._tileInfoView,concurrency:e,process:(r,n)=>this._fetchTile1(r,n)});const i=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new uX({cachePolicy:"purge",acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),cacheSize:i,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,oPt(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(e){const i=this.container.createTile(e);return this._enqueueTileFetch(i),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,i}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 i=e==null||e.join(",")===this._tileInfoView.tileInfo.size.join(",");if(i&&ye(this._emptyTilePixelBlock))return this._emptyTilePixelBlock;e=e||this._tileInfoView.tileInfo.size;const[r,n]=e,s=new en({width:r,height:n,pixels:[new Uint8Array(r*n)],mask:new Uint8Array(r*n),pixelType:"u8"});return i&&(this._emptyTilePixelBlock=s),s}_getBandIds(){if(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain)return this.layer.bandIds;const{bandIds:e,raster:i}=this.layer,r="rasterFunction"in i?i.rasterFunction.rawInputBandIds:null;return e?.length&&r?.length&&i.rasterInfo.bandCount!==1?e.map(n=>r[Math.min(n,r.length-1)]):e||r}updateRasterFunctionParameters(){}_fetchTile1(e,i){const r=ye(i)?i.signal:null,n=this.canUseWebGLForProcessing(),{layerView:s}=this,{tileInfo:o}=s,a=!o.isWrappable&&ye(Tv(s.view.spatialReference)),l=n&&this.layer.raster.hasUniqueSourceStorageInfo,c={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,c)}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const{layerView:e}=this,i=e.view.spatialReference,r=new Yi({x:e.fullExtent.xmin,y:e.fullExtent.ymax,spatialReference:i});if(this._canUseLayerLODs()){const{lods:l}=this.layer.tileInfo,c=l.map(({scale:y})=>y),d=Ml.create({spatialReference:i,size:Tc,scales:c}),p=i.isGeographic?.01*1e-5:.01;if(this._isCustomTilingScheme=Math.abs(d.origin.x-r.x)>p,(d.origin.x===0||d.origin.x>r.x)&&(d.origin=r),!this._isCustomTilingScheme){const y=Ml.create({spatialReference:i,size:Tc}).lods.map(({scale:v})=>v);this._isCustomTilingScheme=c.some(v=>!y.some(S=>Math.abs(S-v)<.001))}return e.set("tileInfo",d),void(this._srcResolutions=l.map(({resolution:y})=>({x:y,y})))}const{scales:n,srcResolutions:s,isCustomTilingScheme:o}=m$i(this.layer.rasterInfo,i,Tc),a=Ml.create({spatialReference:i,size:Tc,scales:n});(a.origin.x===0||a.origin.x>r.x)&&(a.origin=r),this._isCustomTilingScheme=o,e.set("tileInfo",a),this._srcResolutions=s??[]}_canUseLayerLODs(){const{layer:e,layerView:i}=this;if(e.raster.tileType!=="Map")return!1;const{lods:r}=e.tileInfo,n=i.view.constraints?.effectiveLODs;if(!(n?.length===r.length&&n.every(({scale:o},a)=>Math.abs(o-r[a].scale)<.001)))return!1;const s=[];for(let o=0;oo!==o[0])}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.rasterInfo.storageInfo,i=e[e.length-1];return(i.maxCol-i.minCol+1)*(i.maxRow-i.minRow+1)>64?2:10}async _enqueueTileFetch(e,i){this.updatingHandles.addPromise(this._enqueueTileFetch1(e,i))}async _enqueueTileFetch1(e,i){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){ss(l)&&Ei.getLogger(this.declaredClass).error(l)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&this.type!=="rasterVF"||this.layerView.hasTilingEffects||this._symbolizerParams!=null||this._updateSymbolizerParams();const o=this._tileInfoView.getTileCoords(Nar,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){ss(r)||Ei.getLogger(this.declaredClass).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 i=this.container.children.map(async r=>this.updateTileSymbolizerParameters(r,{local:this._symbolizerParams,global:this._globalSymbolizerParams}));await bu(i),this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const i={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,i);if(!r||!r.pixelBlock)return;const{resolution:n}=this.previousLOD,s=this._getBandIds(),o=this.layer.symbolizer.generateWebGLParameters({pixelBlock:sae(r.pixelBlock,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,i=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:e,y:e},bandIds:i})}_updateBlockCacheRegistry(e=!1){const{layer:i,layerView:r}=this,{url:n,raster:s}=i,{multidimensionalDefinition:o}=i.normalizeRasterFetchOptions({multidimensionalDefinition:i.multidimensionalDefinition,timeExtent:r.timeExtent}),a=s.rasterInfo.multidimensionalInfo?s.getSliceIndex(o):null,l=zke(n,a);if(l!==this._blockCacheRegistryUrl){if(this._blockCacheRegistryUrl!=null&&oPt(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=Dar(l,s.rasterInfo),e){const{view:c}=r,d=this._tileInfoView.getClosestInfoForScale(c.scale),p=this._srcResolutions[d.level];uPt(l,this._blockCacheRegistryId,c.extent,c.resolution,p,s.ioConfig.sampling)}this._blockCacheRegistryUrl=l}}async doRefresh(){if(!this.attached)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.tiles.forEach(i=>e.push(this._enqueueTileFetch(i))),await bu(e)}};E([k()],Iv.prototype,"_fetchQueue",void 0),E([k()],Iv.prototype,"_globalUpdateRequested",void 0),E([k()],Iv.prototype,"attached",void 0),E([k()],Iv.prototype,"container",void 0),E([k()],Iv.prototype,"layer",void 0),E([k()],Iv.prototype,"layerView",void 0),E([k()],Iv.prototype,"type",void 0),E([k()],Iv.prototype,"useWebGLForProcessing",null),E([k()],Iv.prototype,"useProgressiveUpdate",null),E([k()],Iv.prototype,"timeExtent",void 0),E([k()],Iv.prototype,"updating",null),Iv=E([ht("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],Iv);let Hj=class extends Iv{constructor(){super(...arguments),this.type="raster"}attach(){super.attach(),this.container=new Rar(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}canUseWebGLForProcessing(){return this.useWebGLForProcessing&&this.layer.symbolizer.canRenderInWebGL&&!(this.layer.interpolation==="majority"&&dAt(this.layer))}fetchTile(e,i){return this.layer.fetchTile(e.level,e.row,e.col,i)}updateRasterFunctionParameters(){const{raster:e,type:i}=this.layer,{container:r}=this;if(e.datasetFormat!=="Function"||i==="wcs")return r.rasterFunctionChain=null,r.children.forEach(y=>{const{bitmap:v}=y;v&&(v.suspended=!0,v.processed=!1,v.projected&&(v.invalidateTexture(),v.rasterTexture=null))}),void(this._rasterFunctionState="na");const n=this._rasterFunctionState,{rasterFunction:s,primaryRasters:o}=e,a=s.supportsGPU&&(!o||o.rasters.length<=1),l=a?s.getFlatWebGLFunctionChain():null,{renderer:c}=this.layer,d=!a||!l?.functions.length||c.type==="raster-stretch"&&c.dynamicRangeAdjustment||!this.canUseWebGLForProcessing();r.rasterFunctionChain=d?null:l;const p=s==null?"na":r.rasterFunctionChain?"gpu":"cpu";r.children.forEach(y=>{const{bitmap:v}=y;v&&(v.suspended=n!==p,v.processed=!1,v.processedTexture=null)}),this._rasterFunctionState=p}async updateTileSource(e,i){const r=this._getBandIds(),n=this._getLayerInterpolation(),s=this.canUseWebGLForProcessing(),{source:o,globalSymbolizerParams:a,suspended:l,coords:c,resolution:d}=i,p=this.layerView.hasTilingEffects?a:i.symbolizerParams,{bitmap:y}=e;if([y.x,y.y]=c,y.resolution=d,o&&ye(o)&&ye(o.pixelBlock)){const v={extent:o.extent,pixelBlock:o.pixelBlock};if(y.rawPixelData=v,s)y.source=o.pixelBlock,y.isRendereredSource=!1;else{const S=await this.layer.applyRenderer(v,a?.type==="stretch"?a:void 0);y.source=S,y.isRendereredSource=!0}y.symbolizerParameters=s?p:null,s?y.transformGrid||(y.transformGrid=o.transformGrid):y.transformGrid=null}else{const v=this.createEmptyTilePixelBlock();y.source=v,y.symbolizerParameters=s?p:null,y.transformGrid=null}y.bandIds=s?r:null,y.width=this._tileInfoView.tileInfo.size[0],y.height=this._tileInfoView.tileInfo.size[1],y.interpolation=n,y.suspended=l,y.invalidateTexture()}async updateTileSymbolizerParameters(e,i){const{local:r,global:n}=i,s=this._getBandIds(),o=this._getLayerInterpolation(),a=this.canUseWebGLForProcessing(),{bitmap:l}=e,{rawPixelData:c}=l;!a&&ye(c)?(l.source=await this.layer.applyRenderer(c,n?.type==="stretch"?n:void 0),l.isRendereredSource=!0):(l.isRendereredSource&&ye(c)&&(l.source=c.pixelBlock),l.isRendereredSource=!1),l.symbolizerParameters=a?this.layerView.hasTilingEffects?n:r:null,l.bandIds=a?s:null,l.interpolation=o,l.suspended=!1}_getLayerInterpolation(){const e=this.layer.renderer.type;if(e==="raster-colormap"||e==="unique-value"||e==="class-breaks")return"nearest";const{interpolation:i}=this.layer,{renderer:r}=this.layer;return r.type==="raster-stretch"&&r.colorRamp!=null?i==="bilinear"||i==="cubic"?"bilinear":"nearest":i}};E([k()],Hj.prototype,"container",void 0),E([k()],Hj.prototype,"layer",void 0),E([k()],Hj.prototype,"type",void 0),Hj=E([ht("esri.views.2d.layers.imagery.ImageryTileView2D")],Hj);const $ar=Hj;let Bar=class extends Cj{constructor(e,i,r,n,s,o,a=null){super(e,i,r,n,s,o),this.tileData=new ePt(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{dvs:Cl(),tileMat3:Cl()}}setTransform(e){super.setTransform(e);const i=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:c}=this.tileData.symbolizerParameters,d=Math.round((this.width-this.tileData.offset[0])/c)*c,p=Math.round((this.height-this.tileData.offset[1])/c)*c,y=d/this.rangeX*i,v=p/this.rangeY*i;vk(r,y,0,0,0,v,0,a,l,1),ov(this.transforms.dvs,e.displayViewMat3,r),this.tileData.transforms.dvs=this.transforms.dvs}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}},Gar=class extends iee{constructor(){super(...arguments),this.isCustomTilingScheme=!1,this.symbolTypes=["triangle"]}createTile(e){const i=this._tileInfoView.getTileBounds(_o(),e),[r,n]=this._tileInfoView.tileInfo.size,s=this._tileInfoView.getTileResolution(e.level);return new Bar(e,s,i[0],i[3],r,n)}prepareRenderPasses(e){const i=e.registerRenderPass({name:"imagery (vf tile)",brushes:[QAt],target:()=>this.children.map(r=>r.tileData),drawPhase:io.MAP});return[...super.prepareRenderPasses(e),i]}doRender(e){this.visible&&e.drawPhase===io.MAP&&this.symbolTypes.forEach(i=>{e.renderPass=i,super.doRender(e)})}},Wj=class extends Iv{constructor(){super(...arguments),this._handle=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(e,i){i={...i,interpolation:"nearest",requestProjectedLocalDirections:!0};const r=await this.layer.fetchTile(e.level,e.row,e.col,i);return this.layer.rasterInfo.dataType==="vector-magdir"&&r?.pixelBlock&&(r.pixelBlock=await this.layer.convertVectorFieldData(r.pixelBlock,i)),r}updateTileSource(e,i){const r=i.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}=i;if(n.offset=this._getTileSymbolOffset(n.key,s),ye(o)&&ye(o.pixelBlock)){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[0]-n.offset[0])/s),Math.round((this._tileInfoView.tileInfo[1]-n.offset[1])/s)],l=this.createEmptyTilePixelBlock(a);n.source=l,n.symbolizerParameters=r}return n.invalidateVAO(),Promise.resolve()}updateTileSymbolizerParameters(e,i){const r=i.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 ye(a)&&o!==n&&(s.source=this._sampleVectorFieldData(a,s.symbolizerParameters,s.offset)),Promise.resolve()}attach(){super.attach(),this.container=new Gar(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=Qi(()=>this.layer.renderer,e=>this._updateSymbolType(e))}detach(){super.detach(),this.container.removeAllChildren(),this._handle?.remove(),this._handle=null,this.container=null}_getTileSymbolOffset(e,i){const r=e.col*this._tileInfoView.tileInfo.size[0]%i,n=e.row*this._tileInfoView.tileInfo.size[1]%i;return[r>i/2?i-r:-r,n>i/2?i-n:-n]}_sampleVectorFieldData(e,i,r){const{symbolTileSize:n}=i;return LYt(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"])}};E([k()],Wj.prototype,"container",void 0),E([k()],Wj.prototype,"layer",void 0),E([k()],Wj.prototype,"type",void 0),Wj=E([ht("esri.views.2d.layers.imagery.VectorFieldTileView2D")],Wj);const Var=Wj,Uar=t=>{let e=class extends t{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this._getfullExtent()}_getfullExtent(){return this.projectFullExtent(this.view.spatialReference)}get hasTilingEffects(){return this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment}get datumTransformation(){return I_t(this.layer.fullExtent,this.view.spatialReference,!0)}supportsSpatialReference(i){return!!this.projectFullExtent(i)}projectFullExtent(i){const r=this.layer.fullExtent,n=I_t(r,i,!1);return JD(r,i,n)}async fetchPopupFeatures(i,r){const{layer:n}=this;if(!i)throw new st("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:n});const{popupEnabled:s}=n,o=DF(n,r);if(!s||lt(o))throw new st("imageryTileLayerView:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:s,popupTemplate:o});const a=[],{value:l,magdirValue:c}=await n.identify(i,{timeExtent:this.timeExtent});let d="";if(l&&l.length){d=n.type==="imagery-tile"&&n.hasStandardTime()&&l[0]!=null?l.map(I=>n.getStandardTimeValue(I)).join(", "):l.join(", ");const p={ObjectId:0};p["Raster.ServicePixelValue"]=d;const y=n.rasterInfo.attributeTable;if(ye(y)){const{fields:I,features:O}=y,L=I.find(({name:G})=>G.toLowerCase()==="value"),N=L?O.find(G=>String(G.attributes[L.name])===d):null;if(N)for(const G in N.attributes)N.attributes.hasOwnProperty(G)&&(p[this._rasterFieldPrefix+G]=N.attributes[G])}const v=n.rasterInfo.dataType;v!=="vector-magdir"&&v!=="vector-uv"||(p["Raster.Magnitude"]=c?.[0],p["Raster.Direction"]=c?.[1]);const S=new js(this.fullExtent.clone(),null,p);S.layer=n,S.sourceLayer=S.layer,a.push(S)}return a}};return E([k()],e.prototype,"layer",void 0),E([k(j9)],e.prototype,"timeExtent",void 0),E([k()],e.prototype,"view",void 0),E([k()],e.prototype,"fullExtent",null),E([k()],e.prototype,"tileInfo",void 0),E([k({readOnly:!0})],e.prototype,"hasTilingEffects",null),E([k()],e.prototype,"datumTransformation",null),e=E([ht("esri.views.layers.ImageryTileLayerView")],e),e};let qj=class extends Uar(MF(_y(by))){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)}update(e){this.subview?.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([Qi(()=>{const{layer:e}=this;return{bandIds:e.bandIds,renderer:e.renderer,interpolation:e.interpolation,multidimensionalDefinition:e.multidimensionalDefinition,rasterFunction:e.type==="imagery-tile"?e.rasterFunction:null}},(e,i)=>{const r=e.interpolation!==i?.interpolation&&(e.interpolation==="majority"||i?.interpolation==="majority")&&dAt(this.layer),n=e.renderer!==i?.renderer&&i?.renderer?.type!==e.renderer?.type;n&&this._updateSubview();const s=e.multidimensionalDefinition!==i?.multidimensionalDefinition,o=e.rasterFunction!==i?.rasterFunction,a=o&&!this._useWebGLForProcessing,l=s||r||n||a;this.subview.redrawOrRefetch({refetch:l,reprocess:o}).catch(c=>{ss(c)||Ei.getLogger(this.declaredClass).error(c)}),this.notifyChange("updating")}),Qi(()=>this.layer.blendMode??"normal",e=>{this.subview.container.blendMode=e},jh),Qi(()=>this.layer.effect??null,e=>{this.subview.container.effect=e},jh),Qi(()=>this.layer.multidimensionalSubset??null,(e,i)=>{const{multidimensionalDefinition:r}=this.layer;ye(r)&&dY(r,e)!==dY(r,i)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(n=>{ss(n)||Ei.getLogger(this.declaredClass).error(n)}),this.notifyChange("updating"))},Nu),Qi(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{ss(e)||Ei.getLogger(this.declaredClass).error(e)})},Fo)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}async hitTest(e,i){return[{type:"graphic",layer:this.layer,mapPoint:e,graphic:new js({attributes:{},geometry:e.clone()})}]}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const e=this.layer.renderer.type==="vector-field"?"rasterVF":this.layer.renderer.type==="flow"?"flow":"raster";if(this.subview){if(this.subview.type===e)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:i}=this;let r;if(r=e==="rasterVF"?new Var({layer:i,layerView:this}):e==="flow"?new KAt({layer:i,layerView:this}):new $ar({layer:i,layerView:this}),"useWebGLForProcessing"in r&&(r.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in r&&(r.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in r){const{subview:n}=this;r.previousLOD=n&&"previousLOD"in n?n.previousLOD:null}this._attachSubview(r),this.subview=r,this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0),e.container.blendMode=this.layer.blendMode,e.container.effect=this.layer.effect)}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};E([k()],qj.prototype,"subview",void 0),E([k()],qj.prototype,"useWebGLForProcessing",null),E([k()],qj.prototype,"useProgressiveUpdate",null),qj=E([ht("esri.views.2d.layers.ImageryTileLayerView2D")],qj);const cPt=Object.freeze(Object.defineProperty({__proto__:null,default:qj},Symbol.toStringTag,{value:"Module"})),jar={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function Hke(t){const e=t.folders||[],i=e.slice(),r=new Map,n=new Map,s=new Map,o=new Map,a=new Map,l={esriGeometryPoint:n,esriGeometryPolyline:s,esriGeometryPolygon:o};(t.featureCollection&&t.featureCollection.layers||[]).forEach(d=>{const p=hi(d);p.featureSet.features=[];const y=d.featureSet.geometryType;r.set(y,p);const v=d.layerDefinition.objectIdField;y==="esriGeometryPoint"?qke(n,v,d.featureSet.features):y==="esriGeometryPolyline"?qke(s,v,d.featureSet.features):y==="esriGeometryPolygon"&&qke(o,v,d.featureSet.features)}),t.groundOverlays&&t.groundOverlays.forEach(d=>{a.set(d.id,d)}),e.forEach(d=>{d.networkLinkIds.forEach(p=>{const y=Har(p,d.id,t.networkLinks);y&&i.push(y)})}),i.forEach(d=>{if(d.featureInfos){d.points=hi(r.get("esriGeometryPoint")),d.polylines=hi(r.get("esriGeometryPolyline")),d.polygons=hi(r.get("esriGeometryPolygon")),d.mapImages=[];for(const p of d.featureInfos)switch(p.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const y=l[p.type].get(p.id);y&&d[jar[p.type]].featureSet.features.push(y);break}case"GroundOverlay":{const y=a.get(p.id);y&&d.mapImages.push(y);break}}d.fullExtent=Xke([d])}});const c=Xke(i);return{folders:e,sublayers:i,extent:c}}function Wke(t,e,i,r){const n=Ro&&Ro.findCredential(t);t=jy(t,{token:n&&n.token});const s=na.kmlServiceUrl;return ir(s,{query:{url:t,model:"simple",folders:"",refresh:i!==0||void 0,outSR:JSON.stringify(e)},responseType:"json",signal:r})}function hPt(t,e,i=null,r=[]){const n=[],s={},o=e.sublayers,a=e.folders.map(l=>l.id);return o.forEach(l=>{const c=new t;if(i?c.read(l,i):c.read(l),r.length&&a.includes(c.id)&&(c.visible=r.includes(c.id)),s[l.id]=c,l.parentFolderId!=null&&l.parentFolderId!==-1){const d=s[l.parentFolderId];d.sublayers||(d.sublayers=[]),d.sublayers?.unshift(c)}else n.unshift(c)}),n}function qke(t,e,i){i.forEach(r=>{t.set(r.attributes[e],r)})}function zar(t,e){let i;return e.some(r=>r.id===t&&(i=r,!0)),i}function Har(t,e,i){const r=zar(t,i);return r&&(r.parentFolderId=e,r.networkLink=r),r}async function Yke(t){const e=Wu.fromJSON(t.featureSet).features,i=t.layerDefinition,r=PR(i.drawingInfo.renderer),n=yh.fromJSON(t.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 Xke(t){const e=Qb(f9),i=Qb(f9);for(const r of t){if(r.polygons&&r.polygons.featureSet&&r.polygons.featureSet.features)for(const n of r.polygons.featureSet.features)Ane(e,n.geometry),AW(i,e);if(r.polylines&&r.polylines.featureSet&&r.polylines.featureSet.features)for(const n of r.polylines.featureSet.features)Ane(e,n.geometry),AW(i,e);if(r.points&&r.points.featureSet&&r.points.featureSet.features)for(const n of r.points.featureSet.features)Ane(e,n.geometry),AW(i,e);if(r.mapImages)for(const n of r.mapImages)Ane(e,n.extent),AW(i,e)}return vGt(i,f9)?void 0:{xmin:i[0],ymin:i[1],zmin:i[2],xmax:i[3],ymax:i[4],zmax:i[5],spatialReference:rr.WGS84}}let dPt=class L3{constructor(e){if(this._ownsRctx=!1,e)this._ownsRctx=!1,this._rctx=e;else{if(L3._instance)return L3._instanceRefCount++,L3._instance;L3._instanceRefCount=1,L3._instance=this,this._ownsRctx=!0;const n=document.createElement("canvas").getContext("webgl");n.getExtension("OES_texture_float"),this._rctx=new rIt(n,{})}const i={applyProjection:!0,bilinear:!1,bicubic:!1},r=O5e("raster/reproject","raster/reproject",new Map([["a_position",0]]),i);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 ux(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(e,i,r=!1){const n=rp(e.extent,i),s=new Yi({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}=VJ(s,i,e.extent);let l=(o+a)/2;const c=Math.round((n.xmax-n.xmin)/l),d=Math.round((n.ymax-n.ymin)/l);l=(n.width/c+n.height/d)/2;const p=new Yi({x:l,y:l,spatialReference:n.spatialReference}),y=i4e({projectedExtent:n,srcBufferExtent:e.extent,pixelSize:p,hasWrapAround:!0,spacing:[16,16]}),v=tPt(this._rctx,y),S=new bs(this._rctx,{width:c,height:d,pixelFormat:nn.RGBA,dataType:ts.UNSIGNED_BYTE,wrapMode:us.CLAMP_TO_EDGE,samplingMode:mn.LINEAR,hasMipmap:!1}),I=new id(this._rctx,{colorTarget:Th.TEXTURE,depthStencilTarget:gl.NONE,width:c,height:d},S);this._rctx.bindFramebuffer(I),this._rctx.setViewport(0,0,c,d),this._rctx.useProgram(this._program),this._rctx.bindTexture(e.texture,0),this._rctx.bindTexture(v,1),this._quad.bind();const{width:O=0,height:L=0}=e.texture.descriptor;if(this._program.setUniform2f("u_srcImageSize",O,L),this._program.setUniform2fv("u_transformSpacing",y.spacing),this._program.setUniform2fv("u_transformGridSize",y.size),this._program.setUniform2f("u_targetImageSize",c,d),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),v.dispose(),r){const{width:N=0,height:G=0}=I.descriptor,V=new ImageData(N,G);return I.readPixels(0,0,N,G,nn.RGBA,ts.UNSIGNED_BYTE,V.data),I.detachColorTexture(bv.COLOR_ATTACHMENT0),I.dispose(),{texture:S,extent:n,imageData:V}}return I.detachColorTexture(bv.COLOR_ATTACHMENT0),I.dispose(),{texture:S,extent:n}}reprojectBitmapData(e,i){const r=MAt(e.bitmapData)?DAt(e.bitmapData):e.bitmapData,n=new bs(this._rctx,{width:e.bitmapData.width,height:e.bitmapData.height,pixelFormat:nn.RGBA,dataType:ts.UNSIGNED_BYTE,wrapMode:us.CLAMP_TO_EDGE,samplingMode:mn.LINEAR,hasMipmap:!1},r),s=this.reprojectTexture({texture:n,extent:e.extent},i,!0);s.texture.dispose();const o=document.createElement("canvas"),a=s.imageData;return o.width=a.width,o.height=a.height,o.getContext("2d").putImageData(a,0,0),{bitmapData:o,extent:s.extent}}async loadAndReprojectBitmapData(e,i,r){const n=(await ir(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(i.spatialReference.equals(r))return{bitmapData:a,extent:i};const l=this.reprojectBitmapData({bitmapData:a,extent:i},r);return{bitmapData:l.bitmapData,extent:l.extent}}destroy(){this._ownsRctx?(L3._instanceRefCount--,L3._instanceRefCount===0&&(this._quad.dispose(),this._program.dispose(),this._rctx.dispose(),L3._instance=null)):(this._quad.dispose(),this._program.dispose())}};dPt._instanceRefCount=0;let pPt=class{constructor(){this.allSublayers=new Map,this.allPoints=[],this.allPolylines=[],this.allPolygons=[],this.allMapImages=[]}},j6=class extends _y(by){constructor(){super(...arguments),this._bitmapIndex=new Map,this._mapImageContainer=new Bj,this._kmlVisualData=new pPt,this._fetchController=null,this.allVisiblePoints=new V1,this.allVisiblePolylines=new V1,this.allVisiblePolygons=new V1,this.allVisibleMapImages=new fr}async hitTest(e,i){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 fx({view:this.view,graphics:this.allVisiblePolygons,requestUpdateCallback:()=>this.requestUpdate(),container:new TO(this.view.featuresTilingScheme)}),this.container.addChild(this._polygonsView.container),this._polylinesView=new fx({view:this.view,graphics:this.allVisiblePolylines,requestUpdateCallback:()=>this.requestUpdate(),container:new TO(this.view.featuresTilingScheme)}),this.container.addChild(this._polylinesView.container),this._pointsView=new fx({view:this.view,graphics:this.allVisiblePoints,requestUpdateCallback:()=>this.requestUpdate(),container:new TO(this.view.featuresTilingScheme)}),this.container.addChild(this._pointsView.container),this.addAttachHandles([this.allVisibleMapImages.on("change",e=>{e.added.forEach(i=>this._addMapImage(i)),e.removed.forEach(i=>this._removeMapImage(i))}),Qi(()=>this.layer.visibleSublayers,e=>{for(const[i,r]of this._kmlVisualData.allSublayers)r.visibility=0;for(const i of e){const r=this._kmlVisualData.allSublayers.get(i.id);r&&(r.visibility=1)}this._refreshCollections()})]),this.updatingHandles.addPromise(this._fetchService(this._fetchController.signal)),this._imageReprojector=new dPt}detach(){this._fetchController=rL(this._fetchController),this._mapImageContainer.removeAllChildren(),this.container.removeAllChildren(),this._bitmapIndex.clear(),this._polygonsView=ra(this._polygonsView),this._polylinesView=ra(this._polylinesView),this._pointsView=ra(this._pointsView),this._imageReprojector=ra(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,vr.fromJSON(e.extent),this.view.spatialReference).then(i=>{const r=new Cke(i.bitmapData,{immutable:!1,requestRenderOnSourceChangedEnabled:!0});r.x=i.extent.xmin,r.y=i.extent.ymax,r.resolution=i.extent.width/i.bitmapData.width,r.rotation=e.rotation,this._mapImageContainer.addChild(r),this._bitmapIndex.set(e,r)})}async _getViewDependentUrl(e,i){const{viewFormat:r,viewBoundScale:n,httpQuery:s}=e;if(ye(r)){if(lt(i))throw new Error("Loading this network link requires a view state.");let o;if(await P2(),ye(n)&&n!==1){const V=new vr(i.extent);V.expand(n),o=V}else o=i.extent;o=rp(o,rr.WGS84);const a=rp(o,rr.WebMercator),l=o.xmin,c=o.xmax,d=o.ymin,p=o.ymax,y=i.size[0]*i.pixelRatio,v=i.size[1]*i.pixelRatio,S=Math.max(a.width,a.height),I={"[bboxWest]":l.toString(),"[bboxEast]":c.toString(),"[bboxSouth]":d.toString(),"[bboxNorth]":p.toString(),"[lookatLon]":o.center.x.toString(),"[lookatLat]":o.center.y.toString(),"[lookatRange]":S.toString(),"[lookatTilt]":"0","[lookatHeading]":i.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]":S.toString(),"[horizFov]":"60","[vertFov]":"60","[horizPixels]":y.toString(),"[vertPixels]":v.toString(),"[terrainEnabled]":"0","[clientVersion]":zH,"[kmlVersion]":"2.2","[clientName]":"ArcGIS API for JavaScript","[language]":"en-US"},O=V=>{for(const Y in V)for(const X in I)V[Y]=V[Y].replace(X,I[X])},L=q3(r);O(L);let N={};ye(s)&&(N=q3(s),O(N));const G=sh(e.href);return G.query={...G.query,...L,...N},`${G.path}?${Uv(L)}`}return e.href}async _fetchService(e){const i=new pPt;await this._loadVisualData(this.layer.url,i,e),this._kmlVisualData=i,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 i=this._kmlVisualData.allSublayers.get(e);return!!i?.visibility&&(i.parentFolderId===-1||this._isSublayerVisible(i.parentFolderId))}_loadVisualData(e,i,r){return this._fetchParsedKML(e,r).then(async n=>{for(const s of n.sublayers){i.allSublayers.set(s.id,s);const o=s.points?await Yke(s.points):[],a=s.polylines?await Yke(s.polylines):[],l=s.polygons?await Yke(s.polygons):[],c=s.mapImages||[];if(i.allPoints.push(...o.map(d=>({item:d,sublayerId:s.id}))),i.allPolylines.push(...a.map(d=>({item:d,sublayerId:s.id}))),i.allPolygons.push(...l.map(d=>({item:d,sublayerId:s.id}))),i.allMapImages.push(...c.map(d=>({item:d,sublayerId:s.id}))),s.networkLink){const d=await this._getViewDependentUrl(s.networkLink,this.view.state);await this._loadVisualData(d,i,r)}}})}_fetchParsedKML(e,i){return Wke(e,this.layer.spatialReference,this.layer.refreshInterval,i).then(r=>Hke(r.data))}_removeMapImage(e){const i=this._bitmapIndex.get(e);i&&(this._mapImageContainer.removeChild(i),this._bitmapIndex.delete(e))}};E([k()],j6.prototype,"_pointsView",void 0),E([k()],j6.prototype,"_polylinesView",void 0),E([k()],j6.prototype,"_polygonsView",void 0),E([k()],j6.prototype,"updating",void 0),j6=E([ht("esri.views.2d.layers.KMLLayerView2D")],j6);const War=Object.freeze(Object.defineProperty({__proto__:null,default:j6},Symbol.toStringTag,{value:"Module"}));let dee=class extends _y(by){constructor(e){super(e),this.layerViews=new fr}set layerViews(e){this._set("layerViews",rg(e,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((e,i)=>e+i.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,i)=>this.container.addChildAt(e.container,i))}};E([k({cast:B8})],dee.prototype,"layerViews",null),E([k({readOnly:!0})],dee.prototype,"updatingProgress",null),dee=E([ht("esri.views.2d.layers.KnowledgeGraphLayerView2D")],dee);const fPt=Object.freeze(Object.defineProperty({__proto__:null,default:dee},Symbol.toStringTag,{value:"Module"})),qar=t=>{let e=class extends t{initialize(){this.exportImageParameters=new l_({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 E([k()],e.prototype,"exportImageParameters",void 0),E([k({readOnly:!0})],e.prototype,"floors",null),E([k({readOnly:!0})],e.prototype,"exportImageVersion",null),E([k()],e.prototype,"layer",void 0),E([k()],e.prototype,"suspended",void 0),E([k(j9)],e.prototype,"timeExtent",void 0),e=E([ht("esri.views.layers.MapImageLayerView")],e),e};let pee=class extends qar(MF(_y(by))){constructor(){super(...arguments),this._highlightGraphics=new V1,this._updateHash=""}fetchPopupFeatures(e,i){return this._popupHighlightHelper.fetchPopupFeatures(e,i)}update(e){const i=`${this.exportImageVersion}/${e.state.id}/${e.pixelRatio}/${e.stationary}`;this._updateHash!==i&&(this._updateHash=i,this.strategy.update(e).catch(r=>{ss(r)||Ei.getLogger(this.declaredClass).error(r)}),e.stationary&&this._popupHighlightHelper.updateHighlightedFeatures(e.state.resolution)),this._highlightView.processUpdate(e)}attach(){const{imageMaxWidth:e,imageMaxHeight:i,version:r}=this.layer,n=r>=10.3,s=r>=10;this._bitmapContainer=new Bj,this.container.addChild(this._bitmapContainer),this._highlightView=new fx({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new Oke(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1}),this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new IO({createFetchPopupFeaturesQueryGeometry:(o,a)=>GAt(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 fge({container:this._bitmapContainer,fetchSource:this.fetchImageBitmap.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxWidth:e,imageMaxHeight:i,imageRotationSupported:n,imageNormalizationSupported:s,hidpi:!0}),this.addAttachHandles(Qi(()=>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,i,r,n){return this.layer.fetchImage(e,i,r,{timeExtent:this.timeExtent,floors:this.floors,...n})}fetchImageBitmap(e,i,r,n){return this.layer.fetchImageBitmap(e,i,r,{timeExtent:this.timeExtent,floors:this.floors,...n})}highlight(e){return this._popupHighlightHelper.highlight(e)}};E([k()],pee.prototype,"strategy",void 0),E([k()],pee.prototype,"updating",void 0),pee=E([ht("esri.views.2d.layers.MapImageLayerView2D")],pee);const Yar=Object.freeze(Object.defineProperty({__proto__:null,default:pee},Symbol.toStringTag,{value:"Module"})),mPt="sublayers",Kke="layerView",Xar=Object.freeze({remove(){},pause(){},resume(){}});let Jke=class extends _y(by){constructor(){super(...arguments),this._highlightIds=new Map,this.container=new HAt}async fetchPopupFeatures(e){return Array.from(this.graphicsViews(),i=>i.hitTest(e).filter(r=>!!r.popupTemplate)).flat()}*graphicsViews(){ye(this._graphicsViewsFeatureCollectionMap)?yield*this._graphicsViewsFeatureCollectionMap.keys():ye(this._graphicsViews)?yield*this._graphicsViews:yield*[]}async hitTest(e,i){return Array.from(this.graphicsViews(),r=>{const n=r.hitTest(e);if(ye(this._graphicsViewsFeatureCollectionMap)){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 i;typeof e=="number"?i=[e]:e instanceof js?i=[e.uid]:Array.isArray(e)&&e.length>0?i=typeof e[0]=="number"?e:e.map(n=>n&&n.uid):fr.isCollection(e)&&(i=e.map(n=>n&&n.uid).toArray());const r=i?.filter(ye);return r?.length?(this._addHighlight(r),{remove:()=>{this._removeHighlight(r)}}):Xar}update(e){for(const i of this.graphicsViews())i.processUpdate(e)}attach(){const e=this.view,i=()=>this.requestUpdate(),r=this.layer.featureCollections;if(ye(r)&&r.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const n of r){const s=new TO(this.view.featuresTilingScheme),o=new fx({view:e,graphics:n.source,renderer:n.renderer,requestUpdateCallback:i,container:s});this._graphicsViewsFeatureCollectionMap.set(o,n),this.container.addChild(o.container),this.addHandles([Qi(()=>n.visible,a=>o.container.visible=a,Fo),Qi(()=>o.updating,()=>this.notifyChange("updating"),Fo)],Kke)}this._updateHighlight()}else ye(this.layer.sublayers)&&this.addHandles(ku(()=>this.layer.sublayers,"change",()=>this._createGraphicsViews(),{onListenerAdd:()=>this._createGraphicsViews(),onListenerRemove:()=>this._destroyGraphicsViews()}),mPt)}detach(){this._destroyGraphicsViews(),this.removeHandles(mPt)}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(Kke);for(const e of this.graphicsViews())e.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),lt(this.layer.sublayers))return;const e=[],i=this.view,r=()=>this.requestUpdate();for(const n of this.layer.sublayers){const s=new yj,o=new TO(this.view.featuresTilingScheme);o.fadeTransitionEnabled=!0;const a=new fx({view:i,graphics:n.graphics,requestUpdateCallback:r,container:o});this.addHandles([n.on("graphic-update",a.graphicUpdateHandler),Qi(()=>n.visible,l=>a.container.visible=l,Fo),Qi(()=>a.updating,()=>this.notifyChange("updating"),Fo)],Kke),s.addChild(a.container),this.container.addChild(s),e.push(a)}this._graphicsViews=e,this._updateHighlight()}_addHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i);this._highlightIds.set(i,r+1)}else this._highlightIds.set(i,1);this._updateHighlight()}_removeHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i)-1;r===0?this._highlightIds.delete(i):this._highlightIds.set(i,r)}this._updateHighlight()}_updateHighlight(){const e=Array.from(this._highlightIds.keys());for(const i of this.graphicsViews())i.setHighlight(e)}};Jke=E([ht("esri.views.2d.layers.MapNotesLayerView2D")],Jke);const Kar=Object.freeze(Object.defineProperty({__proto__:null,default:Jke},Symbol.toStringTag,{value:"Module"}));let MS=class extends fn{constructor(e){super(e)}get bounds(){const e=this.coords;return lt(e)||lt(e.extent)?null:fR(e.extent)}get coords(){const e=this.element.georeference?.coords;return FA(e,this.spatialReference).geometry}get normalizedCoords(){return po.fromJSON(Dtr(this.coords))}get normalizedBounds(){const e=ye(this.normalizedCoords)?this.normalizedCoords.extent:null;return ye(e)?fR(e):null}};E([k()],MS.prototype,"spatialReference",void 0),E([k()],MS.prototype,"element",void 0),E([k()],MS.prototype,"bounds",null),E([k()],MS.prototype,"coords",null),E([k()],MS.prototype,"normalizedCoords",null),E([k()],MS.prototype,"normalizedBounds",null),MS=E([ht("esri.layers.support.MediaElementView")],MS);const Cb=Qr(),Yj=Xf(),Zke=Xf(),gPt=Xf();function $F(t,e,i){return xl(Cb,e[0],e[1],1),RC(Cb,Cb,lX(Yj,i)),Cb[2]===0?aa(t,Cb[0],Cb[1]):aa(t,Cb[0]/Cb[2],Cb[1]/Cb[2])}function yPt(t,e,i){return vPt(Zke,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]),vPt(gPt,i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]),ov(t,VIe(Zke,Zke),gPt),t[8]!==0&&(t[0]/=t[8],t[1]/=t[8],t[2]/=t[8],t[3]/=t[8],t[4]/=t[8],t[5]/=t[8],t[6]/=t[8],t[7]/=t[8],t[8]/=t[8]),t}function vPt(t,e,i,r,n,s,o,a,l){vk(t,e,r,s,i,n,o,1,1,1),xl(Cb,a,l,1),VIe(Yj,t);const[c,d,p]=RC(Cb,Cb,lX(Yj,Yj));return vk(Yj,c,0,0,0,d,0,0,0,p),ov(t,Yj,t)}const fee=Xf();let Jar=class extends CS{constructor(e){super(),this.elementView=e,this.isWrapAround=!1,this.perspectiveTransform=Xa(),this._vertices=new Float32Array(20),this._handles=[],this._handles.push(Qi(()=>this.elementView.element.opacity,i=>this.opacity=i,Fo),Qi(()=>[this.elementView.coords],()=>{this.requestRender()},Fo),Hg(()=>this.elementView.element.loaded,()=>{const i=this.elementView.element;this.ready(),i.type==="video"&&ye(i.content)&&this._handles.push(QI(i.content,"play",()=>this.requestRender()))},Fo)),e.element.load().catch(i=>{Ei.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new st("element-load-error","Element cannot be displayed",{element:e,error:i}))})}destroy(){this._handles.forEach(e=>e.remove()),this.texture=Ba(this.texture)}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:i}=e,r=this.elementView.element.content;if(ye(r)){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;this._updatePerspectiveTransform(o,a),this.texture?s&&!r.paused&&(this.texture.setData(r),this.requestRender(),(i.type===lo.WEBGL2||MC(o)&&MC(a))&&this.texture.generateMipmap()):(this.texture=new bs(i,{pixelFormat:nn.RGBA,dataType:ts.UNSIGNED_BYTE,samplingMode:mn.LINEAR,wrapMode:us.CLAMP_TO_EDGE,width:o,height:a,preMultiplyAlpha:!0},r),(i.type===lo.WEBGL2||MC(o)&&MC(a))&&this.texture.generateMipmap(),s&&!r.paused&&this.requestRender())}super.beforeRender(e)}_createTransforms(){return null}updateDrawCoords(e,i){const r=this.elementView.coords;if(lt(r))return;const[n,s,o,a]=r.rings[0],l=this._vertices,{x:c,y:d}=e,p=i!==0;p?l.set([s[0]-c,s[1]-d,n[0]-c,n[1]-d,o[0]-c,o[1]-d,a[0]-c,a[1]-d,a[0]-c,a[1]-d,s[0]+i-c,s[1]-d,s[0]+i-c,s[1]-d,n[0]+i-c,n[1]-d,o[0]+i-c,o[1]-d,a[0]+i-c,a[1]-d]):l.set([s[0]-c,s[1]-d,n[0]-c,n[1]-d,o[0]-c,o[1]-d,a[0]-c,a[1]-d]),this.isWrapAround=p}getVAO(e,i,r){if(lt(this.elementView.coords))return null;const n=this._vertices;if(this._vao)this._geometryVbo.setData(n);else{this._geometryVbo=Ko.createVertex(e,Lo.DYNAMIC_DRAW,n);const s=Ko.createVertex(e,Lo.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 Ac(e,r,i,{geometry:this._geometryVbo,tex:s})}return this._vao}_updatePerspectiveTransform(e,i){const r=this._vertices;yPt(fee,[0,0,e,0,0,i,e,i],[r[0],r[1],r[4],r[5],r[2],r[3],r[6],r[7]]),aa(this.perspectiveTransform,fee[6]/fee[8]*e,fee[7]/fee[8]*i)}},Zar=class extends Lj{constructor(){super(...arguments),this._localOrigin=Vh(0,0),this._viewStateId=-1,this._dvsMat3=Cl(),this.requiresDedicatedFBO=!1}get dvsMat3(){return this._dvsMat3}beforeRender(e){this._updateMatrices(e),this._updateOverlays(e,this.children);for(const i of this.children)i.beforeRender(e)}prepareRenderPasses(e){const i=e.registerRenderPass({name:"overlay",brushes:[lh.overlay],target:()=>this.children,drawPhase:io.MAP});return[...super.prepareRenderPasses(e),i]}_updateMatrices(e){const{state:i}=e,{id:r,size:n,pixelRatio:s,resolution:o,rotation:a,viewpoint:l,displayMat3:c}=i;if(this._viewStateId===r)return;const d=Math.PI/180*a,p=s*n[0],y=s*n[1],{x:v,y:S}=l.targetGeometry,I=mCe(v,i.spatialReference);this._localOrigin.x=I,this._localOrigin.y=S;const O=o*p,L=o*y,N=rP(this._dvsMat3);ov(N,N,c),ug(N,N,lp(p/2,y/2)),nP(N,N,tO(p/O,-y/L,1)),ST(N,N,-d),this._viewStateId=r}_updateOverlays(e,i){const{state:r}=e,{rotation:n,spatialReference:s,worldScreenWidth:o,size:a,viewpoint:l}=r,c=this._localOrigin;let d=0;const p=pd(s);if(p&&s.isWrappable){const y=a[0],v=a[1],S=180/Math.PI*n,I=Math.abs(Math.cos(S)),O=Math.abs(Math.sin(S)),L=Math.round(y*I+v*O),[N,G]=p.valid,V=FIe(s),{x:Y,y:X}=l.targetGeometry,te=[Y,X],re=[0,0];r.toScreen(re,te);const fe=[0,0];let ge;ge=L>o?.5*o:.5*L;const _e=Math.floor((Y+.5*V)/V),Ie=N+_e*V,ke=G+_e*V,Ne=[re[0]+ge,0];r.toMap(fe,Ne),fe[0]>ke&&(d=V),Ne[0]=re[0]-ge,r.toMap(fe,Ne),fe[0]N?J.updateDrawCoords(c,V):Pe>G&&xethis.layer.effectiveSource,"refresh",()=>{for(const e of this._tileStrategy.tiles)this._updateTile(e);this.requestUpdate()}),ku(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new Zar,this.container.addChild(this._overlayContainer),this._fetchQueue=new uG({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,i)=>this._queryElements(e,i)}),this._tileStrategy=new uX({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,i){const r=[],n=e.normalize(),s=[n.x,n.y];for(const{projectedElement:{normalizedCoords:o,element:a}}of this._elementReferences.values())ye(o)&&C1e(o.rings,s)&&r.push({type:"media",element:a,layer:this.layer,mapPoint:e});return r.reverse()}canResume(){return this.layer.source!=null&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.tiles.forEach(e=>this._updateTile(e))}_acquireTile(e){const i=new Qar(e.clone());return this._updateTile(i),i}_updateTile(e){this.updatingHandles.addPromise(this._fetchQueue.push(e.key).then(i=>{const[r,n]=e.setElements(i);this._referenceElements(e,r),this._dereferenceElements(e,n),this.requestUpdate()},i=>{ss(i)||Ei.getLogger(this.declaredClass).error(i)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,i){const r=this.layer.effectiveSource;if(lt(r))return[];this.view.featuresTilingScheme.getTileBounds(XE,e,!0);const n=new vr({xmin:XE[0],ymin:XE[1],xmax:XE[2],ymax:XE[3],spatialReference:this.view.spatialReference});return r.queryElements(n,i)}_referenceElements(e,i){const r=this.layer.source;if(!lt(r))for(const n of i)this._referenceElement(e,n)}_referenceElement(e,i){xC(this._elementReferences,i.uid,()=>{const r=new MS({element:i,spatialReference:this.view.spatialReference}),n=new Jar(r);return this._overlayContainer.addChild(n),this.elements.add(i),{tiles:new Set,projectedElement:r,overlay:n,debugGraphic:null}}).tiles.add(e)}_dereferenceElements(e,i){for(const r of i)this._dereferenceElement(e,r)}_dereferenceElement(e,i){const r=this._elementReferences.get(i.uid);r.tiles.delete(e),r.tiles.size||(this._overlayContainer.removeChild(r.overlay),r.overlay.destroy(),r.projectedElement.destroy(),this._elementReferences.delete(i.uid),this.elements.remove(i),this._debugGraphicsView?.graphics.remove(r.debugGraphic))}_elementUpdateHandler(e){let i=this._elementReferences.get(e.uid);if(i){const n=i.projectedElement.normalizedCoords;if(lt(n))return this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.projectedElement.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(i.debugGraphic);const s=[],o=[];for(const a of this._tileStrategy.tiles){const l=_Pt(this.view.featuresTilingScheme,a,n);i.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 i=this._elementReferences.get(e.uid),void(i?.debugGraphic&&(i.debugGraphic.geometry=i.projectedElement.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:i.debugGraphic,property:"geometry"})))}const r=new MS({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(ye(r))for(const n of this._tileStrategy.tiles)_Pt(this.view.featuresTilingScheme,n,r)&&this._referenceElement(n,e)}};E([k()],Xj.prototype,"_fetchQueue",void 0),E([k()],Xj.prototype,"layer",void 0),E([k({readOnly:!0})],Xj.prototype,"elements",void 0),Xj=E([ht("esri.views.2d.layers.MediaLayerView2D")],Xj);const XE=_o(),mee={xmin:0,ymin:0,xmax:0,ymax:0};function _Pt(t,e,i){return t.getTileBounds(XE,e.key,!0),mee.xmin=XE[0],mee.ymin=XE[1],mee.xmax=XE[2],mee.ymax=XE[3],T1e(mee,i)}let Qar=class{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const i=[],r=new Set(this.elements);this.elements=e;for(const n of e)r.has(n)?r.delete(n):i.push(n);return this.isReady=!0,[i,Array.from(r)]}destroy(){}};const elr=Object.freeze(Object.defineProperty({__proto__:null,default:Xj},Symbol.toStringTag,{value:"Module"})),tlr=t=>{let e=class extends t{get availableFields(){return this.layer.fieldsIndex.fields.map(i=>i.name)}};return E([k()],e.prototype,"layer",void 0),E([k({readOnly:!0})],e.prototype,"availableFields",null),e=E([ht("esri.views.layers.OGCFeatureLayerView")],e),e};let Qke=class extends tlr(dge){supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}};Qke=E([ht("esri.views.2d.layers.OGCFeatureLayerView2D")],Qke);const ilr=Object.freeze(Object.defineProperty({__proto__:null,default:Qke},Symbol.toStringTag,{value:"Module"})),bPt=jo()({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"}),wPt=jo()({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"});jo()({esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds"});const rlr=jo()({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"}),nlr=jo()({esriDOTComplete:"complete",esriDOTCompleteNoEvents:"complete-no-events",esriDOTFeatureSets:"featuresets",esriDOTInstructionsOnly:"instructions-only",esriDOTStandard:"standard",esriDOTSummaryOnly:"summary-only"}),slr=jo()({esriNAOutputLineNone:"none",esriNAOutputLineStraight:"straight",esriNAOutputLineTrueShape:"true-shape",esriNAOutputLineTrueShapeWithMeasure:"true-shape-with-measure"});jo()({esriNAOutputPolygonNone:"none",esriNAOutputPolygonSimplified:"simplified",esriNAOutputPolygonDetailed:"detailed"});const xPt=jo()({esriNFSBAllowBacktrack:"allow-backtrack",esriNFSBAtDeadEndsOnly:"at-dead-ends-only",esriNFSBNoBacktrack:"no-backtrack",esriNFSBAtDeadEndsAndIntersections:"at-dead-ends-and-intersections"});jo()({esriNATravelDirectionFromFacility:"from-facility",esriNATravelDirectionToFacility:"to-facility"}),jo()({esriNATimeOfDayNotUsed:"not-used",esriNATimeOfDayUseAsStartTime:"start",esriNATimeOfDayUseAsEndTime:"end"});const olr=jo()({AUTOMOBILE:"automobile",TRUCK:"truck",WALK:"walk",OTHER:"other"}),wy=jo()({0:"either-side-of-vehicle",1:"right-side-of-vehicle",2:"left-side-of-vehicle",3:"no-u-turn"},{useNumericKeys:!0}),gee=jo()({0:"stop",1:"waypoint",2:"break"},{useNumericKeys:!0}),BF=jo()({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}),_ge=jo()({1:"right",2:"left"},{useNumericKeys:!0}),e1=jo()({0:"restriction",1:"added-cost"},{useNumericKeys:!0}),yee=jo()({0:"permit",1:"restrict"},{useNumericKeys:!0}),bge=jo()({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"},{useNumericKeys:!0}),wge=jo()({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}),alr=jo()({"NA Campus":"campus","NA Desktop":"desktop","NA Navigation":"navigation"}),llr=jo()({Kilometers:"kilometers",Miles:"miles",Meters:"meters"},{ignoreUnknown:!1}),xge=jo()({Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),t1=jo()({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}),Sge=jo()({"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}),ulr=jo()({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),clr=jo()({esriGeometryPoint:"point",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"envelope",esriGeometryMultipoint:"multipoint"}),hlr=jo()({esriNAUTCost:"cost",esriNAUTDescriptor:"descriptor",esriNAUTRestriction:"restriction",esriNAUTHierarchy:"hierarchy"}),dlr=jo()({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 eNe;let E0=eNe=class extends ua(Ni){constructor(t){super(t),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(t){return new eNe({directionLineType:wge.fromJSON(t.attributes.DirectionLineType),directionPointId:t.attributes.DirectionPointID,distance:t.attributes.Meters,duration:t.attributes.Minutes,fromLevel:t.attributes.FromLevel??null,geometry:t.geometry,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,symbol:t.symbol,toLevel:t.attributes.ToLevel??null})}toGraphic(){const t={ObjectID:this.objectId,DirectionLineType:ye(this.directionLineType)?wge.toJSON(this.directionLineType):null,DirectionPointID:this.directionPointId,Meters:this.distance,Minutes:this.duration};return ye(this.fromLevel)&&(t.FromLevel=this.fromLevel),ye(this.toLevel)&&(t.ToLevel=this.toLevel),new js({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};E0.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}],E0.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:[]},E([k({type:wge.apiValues,json:{read:{source:"attributes.DirectionLineType",reader:wge.read}}})],E0.prototype,"directionLineType",void 0),E([k({json:{read:{source:"attributes.DirectionPointID"}}})],E0.prototype,"directionPointId",void 0),E([k({json:{read:{source:"attributes.Meters"}}})],E0.prototype,"distance",void 0),E([k({json:{read:{source:"attributes.Minutes"}}})],E0.prototype,"duration",void 0),E([k({json:{read:{source:"attributes.FromLevel"}}})],E0.prototype,"fromLevel",void 0),E([k({type:va})],E0.prototype,"geometry",void 0),E([k({json:{read:{source:"attributes.ObjectID"}}})],E0.prototype,"objectId",void 0),E([k({type:yh})],E0.prototype,"popupTemplate",void 0),E([k({types:Uh})],E0.prototype,"symbol",void 0),E([k({json:{read:{source:"attributes.ToLevel"}}})],E0.prototype,"toLevel",void 0),E([k({readOnly:!0,json:{read:!1}})],E0.prototype,"type",void 0),E0=eNe=E([ht("esri.rest.support.DirectionLine")],E0);const Kj=E0;var tNe;let Eh=tNe=class extends ua(Ni){constructor(t){super(t),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(t,e){return ye(e.attributes.ArrivalTime)?new Date(e.attributes.ArrivalTime):null}static fromGraphic(t){return new tNe({alternateName:t.attributes.AlternateName??null,arrivalTime:ye(t.attributes.ArrivalTime)?new Date(t.attributes.ArrivalTime):null,arrivalTimeOffset:t.attributes.ArrivalUTCOffset??null,azimuth:t.attributes.Azimuth??null,branchName:t.attributes.BranchName??null,directionPointType:bge.fromJSON(t.attributes.DirectionPointType),displayText:t.attributes.DisplayText??null,exitName:t.attributes.ExitName??null,geometry:t.geometry,intersectingName:t.attributes.IntersectingName??null,level:t.attributes.Level??null,name:t.attributes.Name??null,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,sequence:t.attributes.Sequence,shortVoiceInstruction:t.attributes.ShortVoiceInstruction??null,stopId:t.attributes.StopID??null,symbol:t.symbol,towardName:t.attributes.TowardName??null,voiceInstruction:t.attributes.VoiceInstruction??null})}toGraphic(){const t={ObjectID:this.objectId,DirectionPointType:ye(this.directionPointType)?bge.toJSON(this.directionPointType):null,Sequence:this.sequence,StopID:this.stopId};return ye(this.alternateName)&&(t.AlternateName=this.alternateName),ye(this.arrivalTime)&&(t.ArrivalTime=this.arrivalTime.getTime()),ye(this.arrivalTimeOffset)&&(t.ArrivalUTCOffset=this.arrivalTimeOffset),ye(this.azimuth)&&(t.Azimuth=this.azimuth),ye(this.branchName)&&(t.BranchName=this.branchName),ye(this.displayText)&&(t.DisplayText=this.displayText),ye(this.exitName)&&(t.ExitName=this.exitName),ye(this.intersectingName)&&(t.IntersectingName=this.intersectingName),ye(this.level)&&(t.Level=this.level),ye(this.name)&&(t.Name=this.name),ye(this.shortVoiceInstruction)&&(t.ShortVoiceInstruction=this.shortVoiceInstruction),ye(this.towardName)&&(t.TowardName=this.towardName),ye(this.voiceInstruction)&&(t.VoiceInstruction=this.voiceInstruction),new js({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};Eh.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}],Eh.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:[]},E([k()],Eh.prototype,"alternateName",void 0),E([k()],Eh.prototype,"arrivalTime",void 0),E([Li("arrivalTime",["attributes.ArrivalTime"])],Eh.prototype,"readArrivalTime",null),E([k({json:{read:{source:"attributes.ArrivalUTCOffset"}}})],Eh.prototype,"arrivalTimeOffset",void 0),E([k({json:{read:{source:"attributes.Azimuth"}}})],Eh.prototype,"azimuth",void 0),E([k({json:{read:{source:"attributes.BranchName"}}})],Eh.prototype,"branchName",void 0),E([k({type:bge.apiValues,json:{read:{source:"attributes.DirectionPointType",reader:bge.read}}})],Eh.prototype,"directionPointType",void 0),E([k({json:{read:{source:"attributes.DisplayText"}}})],Eh.prototype,"displayText",void 0),E([k({json:{read:{source:"attributes.ExitName"}}})],Eh.prototype,"exitName",void 0),E([k({type:Yi})],Eh.prototype,"geometry",void 0),E([k()],Eh.prototype,"intersectingName",void 0),E([k()],Eh.prototype,"level",void 0),E([k({json:{read:{source:"attributes.Name"}}})],Eh.prototype,"name",void 0),E([k({json:{read:{source:"attributes.ObjectID"}}})],Eh.prototype,"objectId",void 0),E([k({type:yh})],Eh.prototype,"popupTemplate",void 0),E([k({json:{read:{source:"attributes.Sequence"}}})],Eh.prototype,"sequence",void 0),E([k()],Eh.prototype,"shortVoiceInstruction",void 0),E([k({json:{read:{source:"attributes.StopID"}}})],Eh.prototype,"stopId",void 0),E([k({types:Uh})],Eh.prototype,"symbol",void 0),E([k({json:{read:{source:"attributes.TowardName"}}})],Eh.prototype,"towardName",void 0),E([k({readOnly:!0,json:{read:!1}})],Eh.prototype,"type",void 0),E([k()],Eh.prototype,"voiceInstruction",void 0),Eh=tNe=E([ht("esri.rest.support.DirectionPoint")],Eh);const Jj=Eh;function KE(t,e){if(lt(t))return null;const i={},r=new RegExp(`^${e}`,"i");for(const n of Object.keys(t))if(r.test(n)){const s=n.substring(e.length);i[t1.fromJSON(s)]=t[n]}return i}function iNe(t,e,i){if(!lt(t)){e.attributes||(e.attributes={});for(const r in t){const n=t1.toJSON(r);e.attributes[`${i}${n}`]=t[r]}}}function Zj(t){const e={};for(const i of Object.keys(t)){const r=i;e[t1.fromJSON(r)]=t[i]}return e}function Qj(t){const e={};for(const i of Object.keys(t)){const r=i;e[t1.toJSON(r)]=t[i]}return e}function vee(t,e){return lt(t)||lt(e)?null:Math.round((t-e)/6e4)}function plr(t){const e=t.toJSON(),i=e;return i.accumulateAttributeNames&&(i.accumulateAttributeNames=e.accumulateAttributeNames?.join()),i.attributeParameterValues&&(i.attributeParameterValues=JSON.stringify(e.attributeParameterValues)),i.barriers&&(i.barriers=JSON.stringify(e.barriers)),i.outSR&&(i.outSR=e.outSR?.wkid),i.overrides&&(i.overrides=JSON.stringify(e.overrides)),i.polygonBarriers&&(i.polygonBarriers=JSON.stringify(e.polygonBarriers)),i.polylineBarriers&&(i.polylineBarriers=JSON.stringify(e.polylineBarriers)),i.restrictionAttributeNames&&(i.restrictionAttributeNames=e.restrictionAttributeNames?.join()),i.stops&&(i.stops=JSON.stringify(e.stops)),i.travelMode&&(i.travelMode=JSON.stringify(e.travelMode)),i}var rNe;let Wp=rNe=class extends ua(Ni){constructor(t){super(t),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(t,e){return KE(e.attributes,"Attr_")}writeCosts(t,e){iNe(t,e,"Attr_")}static fromGraphic(t){return new rNe({addedCost:t.attributes.AddedCost??null,barrierType:ye(t.attributes.BarrierType)?e1.fromJSON(t.attributes.BarrierType):null,costs:ye(t.attributes.Costs)?Zj(JSON.parse(t.attributes.Costs)):null,curbApproach:ye(t.attributes.CurbApproach)?wy.fromJSON(t.attributes.CurbApproach):null,fullEdge:ye(t.attributes.FullEdge)?yee.fromJSON(t.attributes.FullEdge):null,geometry:t.geometry,name:t.attributes.Name??null,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,status:ye(t.attributes.Status)?BF.fromJSON(t.attributes.Status):null,symbol:t.symbol})}toGraphic(){const t={ObjectID:this.objectId,AddedCost:this.addedCost,BarrierType:ye(this.barrierType)?e1.toJSON(this.barrierType):null,Costs:ye(this.costs)?JSON.stringify(Qj(this.costs)):null,CurbApproach:ye(this.curbApproach)?wy.toJSON(this.curbApproach):null,FullEdge:ye(this.fullEdge)?yee.toJSON(this.fullEdge):null,Name:this.name,Status:ye(this.status)?BF.toJSON(this.status):null};return new js({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};Wp.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}]}}],Wp.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:[]},E([k()],Wp.prototype,"addedCost",void 0),E([k({type:e1.apiValues,json:{name:"attributes.BarrierType",read:{reader:e1.read},write:{writer:e1.write}}})],Wp.prototype,"barrierType",void 0),E([k()],Wp.prototype,"costs",void 0),E([Li("costs",["attributes"])],Wp.prototype,"readCosts",null),E([mr("costs")],Wp.prototype,"writeCosts",null),E([k({type:wy.apiValues,json:{read:{source:"attributes.CurbApproach",reader:wy.read}}})],Wp.prototype,"curbApproach",void 0),E([k({type:yee.apiValues,json:{name:"attributes.FullEdge",read:{reader:yee.read},write:{writer:yee.write}}})],Wp.prototype,"fullEdge",void 0),E([k({type:Yi,json:{write:!0}})],Wp.prototype,"geometry",void 0),E([k({json:{name:"attributes.Name"}})],Wp.prototype,"name",void 0),E([k({json:{name:"attributes.ObjectID"}})],Wp.prototype,"objectId",void 0),E([k({type:yh})],Wp.prototype,"popupTemplate",void 0),E([k({type:_ge.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:_ge.read}}})],Wp.prototype,"sideOfEdge",void 0),E([k({json:{read:{source:"attributes.SourceID"}}})],Wp.prototype,"sourceId",void 0),E([k({json:{read:{source:"attributes.SourceOID"}}})],Wp.prototype,"sourceOid",void 0),E([k({type:BF.apiValues,json:{read:{source:"attributes.Status",reader:BF.read}}})],Wp.prototype,"status",void 0),E([k({types:Uh})],Wp.prototype,"symbol",void 0),E([k({readOnly:!0,json:{read:!1}})],Wp.prototype,"type",void 0),Wp=rNe=E([ht("esri.rest.support.PointBarrier")],Wp);const z6=Wp;var nNe;let I0=nNe=class extends ua(Ni){constructor(t){super(t),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(t,e){return KE(e.attributes,"Attr_")}writeCosts(t,e){iNe(t,e,"Attr_")}static fromGraphic(t){return new nNe({barrierType:ye(t.attributes.BarrierType)?e1.fromJSON(t.attributes.BarrierType):null,costs:ye(t.attributes.Costs)?Zj(JSON.parse(t.attributes.Costs)):null,geometry:t.geometry,name:t.attributes.Name??null,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,scaleFactor:t.attributes.ScaleFactor??null,symbol:t.symbol})}toGraphic(){const t={ObjectID:this.objectId,BarrierType:ye(this.barrierType)?e1.toJSON(this.barrierType):null,Costs:ye(this.costs)?JSON.stringify(Qj(this.costs)):null,Name:this.name??null,ScaleFactor:this.scaleFactor??null};return new js({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};I0.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}],I0.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:[]},E([k({type:e1.apiValues,json:{name:"attributes.BarrierType",read:{reader:e1.read},write:{writer:e1.write}}})],I0.prototype,"barrierType",void 0),E([k()],I0.prototype,"costs",void 0),E([Li("costs",["attributes"])],I0.prototype,"readCosts",null),E([mr("costs")],I0.prototype,"writeCosts",null),E([k({type:po,json:{write:!0}})],I0.prototype,"geometry",void 0),E([k({json:{name:"attributes.Name"}})],I0.prototype,"name",void 0),E([k({json:{name:"attributes.ObjectID"}})],I0.prototype,"objectId",void 0),E([k({type:yh})],I0.prototype,"popupTemplate",void 0),E([k()],I0.prototype,"scaleFactor",void 0),E([k({types:Uh})],I0.prototype,"symbol",void 0),E([k({readOnly:!0,json:{read:!1}})],I0.prototype,"type",void 0),I0=nNe=E([ht("esri.rest.support.PolygonBarrier")],I0);const H6=I0;var sNe;let Av=sNe=class extends ua(Ni){constructor(t){super(t),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(t,e){return KE(e.attributes,"Attr_")}static fromGraphic(t){return new sNe({barrierType:ye(t.attributes.BarrierType)?e1.fromJSON(t.attributes.BarrierType):null,costs:ye(t.attributes.Costs)?Zj(JSON.parse(t.attributes.Costs)):null,geometry:t.geometry,name:t.attributes.Name??null,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,scaleFactor:t.attributes.ScaleFactor??null,symbol:t.symbol})}toGraphic(){const t={ObjectID:this.objectId,BarrierType:ye(this.barrierType)?e1.toJSON(this.barrierType):null,Costs:ye(this.costs)?JSON.stringify(Qj(this.costs)):null,Name:this.name,ScaleFactor:this.scaleFactor};return new js({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};Av.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}],Av.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:[]},E([k({type:e1.apiValues,json:{read:{source:"attributes.BarrierType",reader:e1.read}}})],Av.prototype,"barrierType",void 0),E([k()],Av.prototype,"costs",void 0),E([Li("costs",["attributes"])],Av.prototype,"readCosts",null),E([k({type:va,json:{write:!0}})],Av.prototype,"geometry",void 0),E([k({json:{name:"attributes.Name"}})],Av.prototype,"name",void 0),E([k({json:{name:"attributes.ObjectID"}})],Av.prototype,"objectId",void 0),E([k({type:yh})],Av.prototype,"popupTemplate",void 0),E([k()],Av.prototype,"scaleFactor",void 0),E([k({types:Uh})],Av.prototype,"symbol",void 0),E([k({readOnly:!0,json:{read:!1}})],Av.prototype,"type",void 0),Av=sNe=E([ht("esri.rest.support.PolylineBarrier")],Av);const W6=Av;let zm=class extends ua(Ni){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,i){return i.id??i.itemId??null}readRestrictionAttributes(e,i){const{restrictionAttributeNames:r}=i;return lt(r)?null:r.map(n=>Sge.fromJSON(n))}writeRestrictionAttributes(e,i,r){lt(e)||(i[r]=e.map(n=>Sge.toJSON(n)))}};E([k({type:[Object],json:{write:!0}})],zm.prototype,"attributeParameterValues",void 0),E([k({type:String,json:{write:!0}})],zm.prototype,"description",void 0),E([Hr(llr,{ignoreUnknown:!1})],zm.prototype,"distanceAttributeName",void 0),E([k({type:String,json:{write:!0}})],zm.prototype,"id",void 0),E([Li("id",["id","itemId"])],zm.prototype,"readId",null),E([Hr(t1,{ignoreUnknown:!1})],zm.prototype,"impedanceAttributeName",void 0),E([k({type:String,json:{write:!0}})],zm.prototype,"name",void 0),E([k({type:[String],json:{write:!0}})],zm.prototype,"restrictionAttributeNames",void 0),E([Li("restrictionAttributeNames")],zm.prototype,"readRestrictionAttributes",null),E([mr("restrictionAttributeNames")],zm.prototype,"writeRestrictionAttributes",null),E([k({type:Number,json:{write:{allowNull:!0}}})],zm.prototype,"simplificationTolerance",void 0),E([Hr(bPt)],zm.prototype,"simplificationToleranceUnits",void 0),E([Hr(xge,{ignoreUnknown:!1})],zm.prototype,"timeAttributeName",void 0),E([Hr(olr)],zm.prototype,"type",void 0),E([k({type:Boolean,json:{write:!0}})],zm.prototype,"useHierarchy",void 0),E([Hr(xPt)],zm.prototype,"uturnAtJunctions",void 0),zm=E([ht("esri.rest.support.TravelMode")],zm);const Cge=zm;let Tb=class extends Ni{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 lt(e)?null:e.map(i=>t1.fromJSON(i))}writeAccumulateAttributes(e,i,r){!lt(e)&&e.length&&(i[r]=e.map(n=>t1.toJSON(n)))}};E([k({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],Tb.prototype,"accumulateAttributes",void 0),E([Li("accumulateAttributes")],Tb.prototype,"readAccumulateAttributes",null),E([mr("accumulateAttributes")],Tb.prototype,"writeAccumulateAttributes",null),E([k({type:String,json:{write:!0}})],Tb.prototype,"directionsLanguage",void 0),E([k({type:Boolean,json:{write:!0}})],Tb.prototype,"findBestSequence",void 0),E([k({type:Boolean,json:{write:!0}})],Tb.prototype,"preserveFirstStop",void 0),E([k({type:Boolean,json:{write:!0}})],Tb.prototype,"preserveLastStop",void 0),E([k({type:Boolean,json:{write:!0}})],Tb.prototype,"startTimeIsUTC",void 0),E([k({type:Boolean,json:{write:!0}})],Tb.prototype,"timeWindowsAreUTC",void 0),E([k({type:Cge,json:{write:!0}})],Tb.prototype,"travelMode",void 0),Tb=E([ht("esri.layers.support.RouteSettings")],Tb);const SPt=Tb;var oNe;let Eu=oNe=class extends ua(Ni){constructor(t){super(t),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(t,e){return ye(e.attributes.EndTimeUTC)?new Date(e.attributes.EndTimeUTC):null}readEndTimeOffset(t,e){return vee(e.attributes.EndTime,e.attributes.EndTimeUTC)}readStartTime(t,e){return ye(e.attributes.StartTimeUTC)?new Date(e.attributes.StartTimeUTC):null}readStartTimeOffset(t,e){return vee(e.attributes.StartTime,e.attributes.StartTimeUTC)}readTotalCosts(t,e){return KE(e.attributes,"Total_")}readTotalViolations(t,e){return KE(e.attributes,"TotalViolation_")}readTotalWait(t,e){return KE(e.attributes,"TotalWait_")}static fromGraphic(t){return new oNe({analysisSettings:ye(t.attributes.AnalysisSettings)?SPt.fromJSON(JSON.parse(t.attributes.AnalysisSettings)):null,endTime:ye(t.attributes.EndTime)?new Date(t.attributes.EndTime):null,endTimeOffset:t.attributes.EndUTCOffset??null,geometry:t.geometry,messages:ye(t.attributes.Messages)?JSON.parse(t.attributes.Messages):null,name:t.attributes.RouteName,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,startTime:ye(t.attributes.StartTime)?new Date(t.attributes.StartTime):null,startTimeOffset:t.attributes.StartUTCOffset??null,symbol:t.symbol,totalCosts:ye(t.attributes.TotalCosts)?Zj(JSON.parse(t.attributes.TotalCosts)):null,totalDistance:t.attributes.TotalMeters??null,totalDuration:t.attributes.TotalMinutes??null,totalLateDuration:t.attributes.TotalLateMinutes??null,totalWaitDuration:t.attributes.TotalWaitMinutes??null,version:t.attributes.Version})}toGraphic(){const t={ObjectID:this.objectId,AnalysisSettings:ye(this.analysisSettings)?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:ye(this.endTime)?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:ye(this.messages)?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:ye(this.startTime)?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:ye(this.totalCosts)?JSON.stringify(Qj(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new js({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};Eu.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}],Eu.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:[]},E([k()],Eu.prototype,"analysisSettings",void 0),E([k()],Eu.prototype,"endTime",void 0),E([Li("endTime",["attributes.EndTimeUTC"])],Eu.prototype,"readEndTime",null),E([k()],Eu.prototype,"endTimeOffset",void 0),E([Li("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],Eu.prototype,"readEndTimeOffset",null),E([k({json:{read:{source:"attributes.FirstStopID"}}})],Eu.prototype,"firstStopId",void 0),E([k({type:va})],Eu.prototype,"geometry",void 0),E([k({json:{read:{source:"attributes.LastStopID"}}})],Eu.prototype,"lastStopId",void 0),E([k()],Eu.prototype,"messages",void 0),E([k({json:{read:{source:"attributes.Name"}}})],Eu.prototype,"name",void 0),E([k({json:{read:{source:"attributes.ObjectID"}}})],Eu.prototype,"objectId",void 0),E([k({type:yh})],Eu.prototype,"popupTemplate",void 0),E([k()],Eu.prototype,"startTime",void 0),E([Li("startTime",["attributes.StartTimeUTC"])],Eu.prototype,"readStartTime",null),E([k()],Eu.prototype,"startTimeOffset",void 0),E([Li("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],Eu.prototype,"readStartTimeOffset",null),E([k({json:{read:{source:"attributes.StopCount"}}})],Eu.prototype,"stopCount",void 0),E([k({types:Uh})],Eu.prototype,"symbol",void 0),E([k()],Eu.prototype,"totalCosts",void 0),E([Li("totalCosts",["attributes"])],Eu.prototype,"readTotalCosts",null),E([k()],Eu.prototype,"totalDistance",void 0),E([k()],Eu.prototype,"totalDuration",void 0),E([k()],Eu.prototype,"totalLateDuration",void 0),E([k()],Eu.prototype,"totalViolations",void 0),E([Li("totalViolations",["attributes"])],Eu.prototype,"readTotalViolations",null),E([k()],Eu.prototype,"totalWait",void 0),E([Li("totalWait",["attributes"])],Eu.prototype,"readTotalWait",null),E([k()],Eu.prototype,"totalWaitDuration",void 0),E([k({readOnly:!0,json:{read:!1}})],Eu.prototype,"type",void 0),E([k()],Eu.prototype,"version",void 0),Eu=oNe=E([ht("esri.rest.support.RouteInfo")],Eu);const _ee=Eu;var aNe;let Co=aNe=class extends ua(Ni){constructor(t){super(t),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(t,e){return vee(e.attributes.ArriveTime,e.attributes.ArriveTimeUTC)}readCumulativeCosts(t,e){return KE(e.attributes,"Cumul_")}readDepartTimeOffset(t,e){return vee(e.attributes.DepartTime,e.attributes.DepartTimeUTC)}readServiceCosts(t,e){return KE(e.attributes,"Attr_")}writeServiceCosts(t,e){iNe(t,e,"Attr_")}writeTimeWindowEnd(t,e){lt(t)||(e.attributes||(e.attributes={}),e.attributes.TimeWindowEnd=t.getTime())}writeTimeWindowStart(t,e){lt(t)||(e.attributes||(e.attributes={}),e.attributes.TimeWindowStart=t.getTime())}readViolations(t,e){return KE(e.attributes,"Violation_")}readWait(t,e){return KE(e.attributes,"Wait_")}static fromGraphic(t){return new aNe({arriveCurbApproach:ye(t.attributes.ArrivalCurbApproach)?wy.fromJSON(t.attributes.ArrivalCurbApproach):null,arriveTime:ye(t.attributes.ArrivalTime)?new Date(t.attributes.ArrivalTime):null,arriveTimeOffset:t.attributes.ArrivalUTCOffset,cumulativeCosts:ye(t.attributes.CumulativeCosts)?Zj(JSON.parse(t.attributes.CumulativeCosts)):null,cumulativeDistance:t.attributes.CumulativeMeters??null,cumulativeDuration:t.attributes.CumulativeMinutes??null,curbApproach:ye(t.attributes.CurbApproach)?wy.fromJSON(t.attributes.CurbApproach):null,departCurbApproach:ye(t.attributes.DepartureCurbApproach)?wy.fromJSON(t.attributes.DepartureCurbApproach):null,departTime:ye(t.attributes.DepartureTime)?new Date(t.attributes.DepartureTime):null,departTimeOffset:t.attributes.DepartureUTCOffset??null,geometry:t.geometry,lateDuration:t.attributes.LateMinutes??null,locationType:ye(t.attributes.LocationType)?gee.fromJSON(t.attributes.LocationType):null,name:t.attributes.Name,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,routeName:t.attributes.RouteName,sequence:t.attributes.Sequence??null,serviceCosts:ye(t.attributes.ServiceCosts)?Zj(JSON.parse(t.attributes.ServiceCosts)):null,serviceDistance:t.attributes.ServiceMeters??null,serviceDuration:t.attributes.ServiceMinutes??null,status:ye(t.attributes.Status)?BF.fromJSON(t.attributes.Status):null,symbol:t.symbol,timeWindowEnd:ye(t.attributes.TimeWindowEnd)?new Date(t.attributes.TimeWindowEnd):null,timeWindowEndOffset:t.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:ye(t.attributes.TimeWindowStart)?new Date(t.attributes.TimeWindowStart):null,timeWindowStartOffset:t.attributes.TimeWindowStartUTCOffset??null,waitDuration:t.attributes.WaitMinutes??null})}toGraphic(){const t={ObjectID:this.objectId,ArrivalCurbApproach:ye(this.arriveCurbApproach)?wy.toJSON(this.arriveCurbApproach):null,ArrivalTime:ye(this.arriveTime)?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:ye(this.cumulativeCosts)?JSON.stringify(Qj(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:ye(this.curbApproach)?wy.toJSON(this.curbApproach):null,DepartureCurbApproach:ye(this.departCurbApproach)?wy.toJSON(this.departCurbApproach):null,DepartureTime:ye(this.departTime)?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:ye(this.locationType)?gee.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:ye(this.serviceCosts)?JSON.stringify(Qj(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:ye(this.status)?BF.toJSON(this.status):null,TimeWindowEnd:ye(this.timeWindowEnd)?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:ye(this.timeWindowStart)?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new js({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};Co.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}],Co.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:[]},E([k({type:wy.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:wy.read}}})],Co.prototype,"arriveCurbApproach",void 0),E([k({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],Co.prototype,"arriveTime",void 0),E([k()],Co.prototype,"arriveTimeOffset",void 0),E([Li("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],Co.prototype,"readArriveTimeOffset",null),E([k({json:{name:"attributes.Bearing",read:!1,write:!0}})],Co.prototype,"bearing",void 0),E([k({json:{name:"attributes.BearingTol",read:!1,write:!0}})],Co.prototype,"bearingTol",void 0),E([k()],Co.prototype,"cumulativeCosts",void 0),E([Li("cumulativeCosts",["attributes"])],Co.prototype,"readCumulativeCosts",null),E([k()],Co.prototype,"cumulativeDistance",void 0),E([k()],Co.prototype,"cumulativeDuration",void 0),E([k({type:wy.apiValues,json:{name:"attributes.CurbApproach",read:{reader:wy.read},write:{writer:wy.write}}})],Co.prototype,"curbApproach",void 0),E([k({type:wy.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:wy.read}}})],Co.prototype,"departCurbApproach",void 0),E([k({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],Co.prototype,"departTime",void 0),E([k()],Co.prototype,"departTimeOffset",void 0),E([Li("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],Co.prototype,"readDepartTimeOffset",null),E([k({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],Co.prototype,"distanceToNetworkInMeters",void 0),E([k({type:Yi,json:{write:!0}})],Co.prototype,"geometry",void 0),E([k()],Co.prototype,"lateDuration",void 0),E([k({type:gee.apiValues,json:{name:"attributes.LocationType",read:{reader:gee.read},write:{writer:gee.write}}})],Co.prototype,"locationType",void 0),E([k({json:{name:"attributes.Name"}})],Co.prototype,"name",void 0),E([k({json:{name:"attributes.NavLatency",read:!1,write:!0}})],Co.prototype,"navLatency",void 0),E([k({json:{name:"attributes.ObjectID"}})],Co.prototype,"objectId",void 0),E([k({type:yh})],Co.prototype,"popupTemplate",void 0),E([k({json:{read:{source:"attributes.PosAlong"}}})],Co.prototype,"posAlong",void 0),E([k({json:{name:"attributes.RouteName"}})],Co.prototype,"routeName",void 0),E([k()],Co.prototype,"serviceCosts",void 0),E([Li("serviceCosts",["attributes"])],Co.prototype,"readServiceCosts",null),E([mr("serviceCosts")],Co.prototype,"writeServiceCosts",null),E([k()],Co.prototype,"serviceDistance",void 0),E([k()],Co.prototype,"serviceDuration",void 0),E([k({json:{name:"attributes.Sequence"}})],Co.prototype,"sequence",void 0),E([k({type:_ge.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:_ge.read}}})],Co.prototype,"sideOfEdge",void 0),E([k({json:{read:{source:"attributes.SnapX"}}})],Co.prototype,"snapX",void 0),E([k({json:{read:{source:"attributes.SnapY"}}})],Co.prototype,"snapY",void 0),E([k({json:{read:{source:"attributes.SnapZ"}}})],Co.prototype,"snapZ",void 0),E([k({json:{read:{source:"attributes.SourceID"}}})],Co.prototype,"sourceId",void 0),E([k({json:{read:{source:"attributes.SourceOID"}}})],Co.prototype,"sourceOid",void 0),E([k({type:BF.apiValues,json:{read:{source:"attributes.Status",reader:BF.read}}})],Co.prototype,"status",void 0),E([k({types:Uh})],Co.prototype,"symbol",void 0),E([k({type:Date,json:{name:"attributes.TimeWindowEnd"}})],Co.prototype,"timeWindowEnd",void 0),E([mr("timeWindowEnd")],Co.prototype,"writeTimeWindowEnd",null),E([k()],Co.prototype,"timeWindowEndOffset",void 0),E([k({type:Date,json:{name:"attributes.TimeWindowStart"}})],Co.prototype,"timeWindowStart",void 0),E([mr("timeWindowStart")],Co.prototype,"writeTimeWindowStart",null),E([k()],Co.prototype,"timeWindowStartOffset",void 0),E([k({readOnly:!0,json:{read:!1}})],Co.prototype,"type",void 0),E([k()],Co.prototype,"violations",void 0),E([Li("violations",["attributes"])],Co.prototype,"readViolations",null),E([k()],Co.prototype,"waitDuration",void 0),E([k()],Co.prototype,"wait",void 0),E([Li("wait",["attributes"])],Co.prototype,"readWait",null),Co=aNe=E([ht("esri.rest.support.Stop")],Co);const q6=Co,flr=Object.freeze({remove(){},pause(){},resume(){}}),mlr=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],bee={graphic:null,property:null,oldValue:null,newValue:null};function lNe(t){return t instanceof Kj||t instanceof Jj||t instanceof z6||t instanceof H6||t instanceof W6||t instanceof _ee||t instanceof q6}function glr(t){return fr.isCollection(t)&&t.length&&lNe(t.getItemAt(0))}function ylr(t){return Array.isArray(t)&&t.length>0&&lNe(t[0])}let wee=class extends _y(by){constructor(){super(...arguments),this._graphics=new fr,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new k2({getCollections:()=>ye(this.layer)&&!this.destroyed?[ye(this.layer.routeInfo)?new fr([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),Fo)}destroy(){this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),this._get("_routeItems")?.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}async fetchPopupFeatures(e){return this._graphicsView.hitTest(e).filter(i=>!!i.popupTemplate)}highlight(e){let i;i=lNe(e)?[this._getNetworkFeatureUid(e)]:ylr(e)?e.map(n=>this._getNetworkFeatureUid(n)):glr(e)?e.map(n=>this._getNetworkFeatureUid(n)).toArray():[e.uid];const r=i.filter(ye);return r.length?(this._addHighlight(r),{remove:()=>this._removeHighlight(r)}):flr}async hitTest(e,i){if(this.suspended)return null;const r=this._graphicsView.hitTest(e).filter(ye).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 i of e)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i);this._highlightIds.set(i,r+1)}else this._highlightIds.set(i,1);this._updateHighlight()}_createGraphic(e){const i=e.toGraphic();return i.layer=this.layer,i.sourceLayer=this.layer,i}_createGraphicsView(){const e=this.view,i=()=>this.requestUpdate(),r=new TO(e.featuresTilingScheme);this._graphicsView=new fx({container:r,graphics:this._graphics,requestUpdateCallback:i,view:e}),this.container.addChild(r),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(e){const i=this._networkGraphicMap.get(e);return mlr.indexOf(i.type)}_getNetworkFeatureUid(e){return this._networkFeatureMap.has(e)?this._networkFeatureMap.get(e).uid:null}_removeHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i)-1;r===0?this._highlightIds.delete(i):this._highlightIds.set(i,r)}this._updateHighlight()}_routeItemsChanged(e){if(e.removed.length){this._graphics.removeMany(e.removed.map(i=>{const r=this._networkFeatureMap.get(i);return this._networkFeatureMap.delete(i),this._networkGraphicMap.delete(r),r}));for(const i of e.removed)this.removeHandles(i)}if(e.added.length){this._graphics.addMany(e.added.map(i=>{const r=this._createGraphic(i);return lt(r.symbol)?null:(this._networkFeatureMap.set(i,r),this._networkGraphicMap.set(r,i),r)}).filter(ye));for(const i of e.added)this.addHandles([Qi(()=>i.geometry,(r,n)=>{this._updateGraphic(i,"geometry",r,n)}),Qi(()=>i.symbol,(r,n)=>{this._updateGraphic(i,"symbol",r,n)})],i);this._graphics.sort((i,r)=>this._getDrawOrder(i)-this._getDrawOrder(r))}}_updateGraphic(e,i,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[i]=r,bee.graphic=s,bee.property=i,bee.oldValue=n,bee.newValue=r,this._graphicsView.graphicUpdateHandler(bee)}_updateHighlight(){const e=Array.from(this._highlightIds.keys());this._graphicsView.setHighlight(e)}};E([k()],wee.prototype,"_graphics",void 0),E([k()],wee.prototype,"_routeItems",null),wee=E([ht("esri.views.2d.layers.RouteLayerView2D")],wee);const vlr=Object.freeze(Object.defineProperty({__proto__:null,default:wee},Symbol.toStringTag,{value:"Module"}));function CPt(t,e){if(lt(t)&<(e))return null;const i={};return ye(e)&&(i.geometry=e.toJSON()),ye(t)&&(i.where=t),i}let e7=class extends dge{constructor(){super(...arguments),this._enabledEventTypes=new Set,this._isUserPaused=!1,this.errorString=null,this.connectionStatus="disconnected"}initialize(){this.addHandles([Qi(()=>this.layer.customParameters,e=>this._proxy.updateCustomParameters(e)),this.layer.on("send-message-to-socket",e=>this._proxy.sendMessageToSocket(e)),this.layer.on("send-message-to-client",e=>this._proxy.sendMessageToClient(e)),Qi(()=>this.layer.purgeOptions,()=>this._update()),Qi(()=>this.suspended,e=>{e?this._proxy.pauseStream():this._isUserPaused||this._proxy.resumeStream()})],"constructor")}get connectionError(){if(this.errorString)return new st("stream-controller",this.errorString)}pause(){this._isUserPaused=!0,this._proxy.pauseStream()}resume(){this._isUserPaused=!1,this._proxy.resumeStream()}on(e,i){if(Array.isArray(e))return D8(e.map(o=>this.on(o,i)));const r=["data-received","message-received"].includes(e);r&&(this._enabledEventTypes.add(e),this._proxy.enableEvent(e,!0));const n=super.on(e,i),s=this;return{remove(){n.remove(),r&&(s._proxy.closed||s.hasEventListener(e)||s._proxy.enableEvent(e,!1))}}}queryLatestObservations(e,i){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new st("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");return this._proxy.queryLatestObservations(this._cleanUpQuery(e),i).then(r=>{const n=Wu.fromJSON(r);return n.features.forEach(s=>{s.layer=this.layer,s.sourceLayer=this.layer}),n})}detach(){super.detach(),this.connectionStatus="disconnected"}_createClientOptions(){return{...super._createClientOptions(),setProperty:e=>{this.set(e.propertyName,e.value)}}}_createTileRendererHash(e){const i=`${JSON.stringify(this.layer.purgeOptions)}.${JSON.stringify(CPt(this.layer.definitionExpression,this.layer.geometryDefinition))})`;return super._createTileRendererHash(e)+i}async _createServiceOptions(){const e=this.layer,{objectIdField:i}=e,r=e.fields.map(a=>a.toJSON()),n=Jme(e.geometryType),s=e.timeInfo&&e.timeInfo.toJSON()||null,o=e.spatialReference?e.spatialReference.toJSON():null;return{type:"stream",fields:r,geometryType:n,objectIdField:i,timeInfo:s,source:this.layer.parsedUrl,serviceFilter:CPt(this.layer.definitionExpression,this.layer.geometryDefinition),purgeOptions:this.layer.purgeOptions.toJSON(),enabledEventTypes:Array.from(this._enabledEventTypes.values()),spatialReference:o,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,updateInterval:this.layer.updateInterval,customParameters:e.customParameters}}};E([k()],e7.prototype,"errorString",void 0),E([k({readOnly:!0})],e7.prototype,"connectionError",null),E([k()],e7.prototype,"connectionStatus",void 0),e7=E([ht("esri.views.2d.layers.StreamLayerView2D")],e7);const _lr=Object.freeze(Object.defineProperty({__proto__:null,default:e7},Symbol.toStringTag,{value:"Module"}));function blr(t,e){return!t.visible||t.minScale!==0&&e>t.minScale||t.maxScale!==0&&ethis.view.scale,()=>this._update(),Fo)],"constructor")}isUpdating(){const e=this.layer.sublayers.some(l=>l.renderer!=null),i=this._commandsQueue.updating,r=this._updatingRequiredFieldsPromise!=null,n=!this._proxy||!this._proxy.isReady,s=this._pipelineIsUpdating,o=this.tileRenderer==null||this.tileRenderer?.updating,a=e&&(i||r||n||s||o);return Gi("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${a} +`),a}_createClientOptions(){return{setUpdating:e=>{this._set("_pipelineIsUpdating",e)},emitEvent:e=>{this.emit(e.name,e.event)}}}async _detectQueryMode(e){const i="path"in e,{layer:r}=this,n="editingInfo"in r&&r.editingInfo?.lastEditDate,s="refreshInterval"in r&&!!r.refreshInterval,o=!n&&s,a=AL(r);if(i&&(r.type==="feature"||r.type==="subtype-group")&&r.geometryType==="point"&&a?.query.supportsPagination&&!a?.operations.supportsEditing&&!o&&Hi("featurelayer-snapshot-enabled"))try{const l=await r.queryFeatureCount();if(l<=Hi("featurelayer-snapshot-point-min-threshold"))return{mode:"snapshot",featureCount:l};const c=Hi("featurelayer-snapshot-point-max-threshold"),h=Hi("featurelayer-snapshot-point-coverage"),p=this.view.extent,y=r.fullExtent,v=y?.clone().intersection(p),x=ve(v)?v.width*v.height:0,I=y?.width*y?.height;if(l<=c&&(I===0?0:x/I)>=h)return{mode:"snapshot",featureCount:l}}catch(l){Oi.getLogger(this.declaredClass).warn("mapview-feature-layer","Encountered an error when querying for featureCount",{error:l})}return{mode:"on-demand"}}async _createServiceOptions(){const e=this.layer;if(e.type==="stream")return null;const i=AL(e),{capabilities:r,objectIdField:n}=e,s=e.fields.map(F=>F.toJSON()),o=ve(e.fullExtent)?e.fullExtent.toJSON():null,a=xge(e.geometryType),l="timeInfo"in e&&e.timeInfo&&e.timeInfo.toJSON()||null,c=e.spatialReference?e.spatialReference.toJSON():null,h=e.type==="feature"?e.globalIdField:null;let p;e.type==="ogc-feature"?p=e.source.getSource():RPt(e.source)?p=await e.source.openPorts():e.parsedUrl&&(p=gi(e.parsedUrl),"dynamicDataSource"in e&&e.dynamicDataSource&&(p.query={layer:JSON.stringify({source:e.dynamicDataSource})}));const y="datesInUnknownTimezone"in this.layer&&this.layer.datesInUnknownTimezone,v=("subtypeField"in this.layer?this.layer.subtypeField:null)??null,{mode:x,featureCount:I}=await this._detectQueryMode(p);let P=this.layer.objectIdField;if(this.layer.type==="feature"&&ve(this.layer.orderBy)&&this.layer.orderBy.length){const F=!this.layer.orderBy[0].valueExpression&&this.layer.orderBy[0].field;F&&(P=F)}return{type:x,timeReferenceUnknownClient:y,subtypeField:v,featureCount:I,globalIdField:h,maxRecordCount:r.query.maxRecordCount,tileMaxRecordCount:r.query.tileMaxRecordCount,capabilities:r,effectiveCapabilities:i,fields:s,fullExtent:o,geometryType:a,objectIdField:n,source:p,timeInfo:l,spatialReference:c,orderByFields:P,datesInUnknownTimezone:y,dateFieldsTimeReference:("dateFieldsTimeReference"in this.layer?this.layer.dateFieldsTimeReference?.toJSON():null)||null,preferredTimeReference:("preferredTimeReference"in this.layer?this.layer.preferredTimeReference?.toJSON():null)||null,editFieldsInfo:"editFieldsInfo"in this.layer?this.layer.editFieldsInfo?.toJSON():null}}async _createMemoryServiceOptions(e){const i=await e.openPorts();return{...this._createServiceOptions(),type:"memory",source:i}}_cleanUpQuery(e){const i=Ns.from(e)||this.createQuery();return i.outSpatialReference||(i.outSpatialReference=this.view.spatialReference),i}_cleanUpAggregateQuery(e){const i=Ns.from(e)||this.createAggregateQuery();return i.outSpatialReference||(i.outSpatialReference=this.view.spatialReference),i}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){return this.suspended?void this._clearTiles():this._validateEdit(e)?this._commandsQueue.push({type:"edit",edits:e}):void 0}async doRefresh(e){if(this.attached&&this._tileStrategy.tileKeys().length)return this.suspended&&e?void this._clearTiles():this._commandsQueue.push({type:"refresh",dataChanged:e})}_clearTiles(){this._tileStrategy.tileKeys().length&&(this._proxy.updateTiles({added:[],removed:this._tileStrategy.tileKeys()}),this._tileStrategy.clear(),this.requestUpdate(),this._commandsQueue.clear(),this._update())}_validateEdit(e){const i="globalIdField"in this.layer&&this.layer.globalIdField,r=e.deletedFeatures.some(s=>s.objectId===-1||!s.objectId),n=i&&this.availableFields.includes(i);return r&&!n?(Oi.getLogger(this.declaredClass).error(new st("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${i} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){try{if(this.destroyed||!this._hasRequiredSupport(this.layer)||!this._tileStrategy)return;const{featureEffectView:e,filter:i}=this;if(await this._updateRequiredFields(),this.destroyed)return;const{renderer:r}=this._getEffectiveRenderer();this._set("_effectiveRenderer",r);const n=this._createSchemaConfig(),s=this._createConfiguration(n,i,e.filter),o=this._lastDefinitionExpression!==s.schema.source.definitionExpression;this._lastDefinitionExpression=s.schema.source.definitionExpression;const a=s.schema.tileRenderer,l=this._createTileRendererHash(a);if(this._serviceOptions.type==="snapshot"&&(s.schema.source.initialFeatureCount=this._serviceOptions.featureCount),l!==this._tileRendererHash){await this._initTileRenderer(a,r);const c=this.layer,h=c.type==="stream"?await this._initServiceOptions():this._serviceOptions;this.tileRenderer.onConfigUpdate(r),c.type!=="stream"&&RPt(c.source)&&(h.source=await c.source.openPorts());const p={added:this._tileStrategy.tileKeys(),removed:[]};await this._proxy.startup(this.view.featuresTilingScheme,s,h,p),this.hasHighlight()&&await this._proxy.setHighlight(Array.from(this._highlightIds.keys())),await this._onceTilesUpdated(),this.tileRenderer.onConfigUpdate(r)}else{this._serviceOptions.type==="snapshot"&&o&&(s.schema.source.changedFeatureCount=await this.layer.queryFeatureCount());const c=await this._proxy.update(s);(c.mesh||c.targets?.aggregate)&&this._lockGPUUploads();try{await this._proxy.applyUpdate(c)}catch(h){ys(h)||Oi.getLogger(this.declaredClass).error(h)}(c.mesh||c.targets?.aggregate)&&this._unlockGPUUploads(),this.tileRenderer.onConfigUpdate(r),this._updateClusterSizeVariable(),this._forceAttributeTextureUpload()}this._tileRendererHash=l,this.tileRenderer.invalidateLabels(),this.requestUpdate()}catch{}}async _doEdit(e){try{await this._proxy.onEdits(e)}catch(i){ys(i)}}async _doRefresh(e){this._lockGPUUploads();try{let i;e&&this.queryMode==="snapshot"&&"queryFeatureCount"in this.layer&&(i=await this.layer.queryFeatureCount()),await this._proxy.refresh({dataChanged:e,featureCount:i})}catch(i){ys(i)}this._unlockGPUUploads(),this._effectiveFeatureReduction&&this._updateClusterSizeVariable()}_updateClusterSizeVariable(){this._needsClusterSizeUpdate&&(this.tileRenderer.onConfigUpdate(this._effectiveRenderer),this._needsClusterSizeUpdate=!1)}_createUpdateClusterSizeTask(e,i){return sr(()=>this._aggregateValueRanges,r=>{this._updateClusterEffectiveRendererSizeVariable(e,i,r),this._needsClusterSizeUpdate=!0,this._uploadsLocked||this._updateClusterSizeVariable()})}async _updateClusterEffectiveRendererSizeVariable(e,i,r){if(e.dynamicClusterSize&&"visualVariables"in e&&e.visualVariables){const n=FSe(e.visualVariables);if(ve(n)&&n.field==="cluster_count"){const s=e.visualVariables.indexOf(n);e.visualVariables[s]=LSe(i,r);const o=e.clone();o.dynamicClusterSize=!0,this._set("_effectiveRenderer",o)}}}_getEffectiveRenderer(){const e=this.layer,i="renderer"in e?e.renderer:null,r=this._effectiveFeatureReduction;if(this._updateClusterSizeTask=Uc(this._updateClusterSizeTask),r&&"renderer"in r&&r.renderer&&!r.renderer.authoringInfo?.isAutoGenerated){const n=r.fields;if(r.type==="cluster"){const{renderer:s,didInject:o}=DYe(r.renderer,r,this._aggregateValueRanges);return o&&(this._updateClusterSizeTask=this._createUpdateClusterSizeTask(s,r)),{renderer:s,aggregateFields:n,featureReduction:r}}return{renderer:r.renderer,aggregateFields:n,featureReduction:r}}if(r&&r.type==="cluster"&&i&&FYe(i)){const n=r,s=[],o=DSe(s,i,n,this._aggregateValueRanges,!0);return this._updateClusterSizeTask=this._createUpdateClusterSizeTask(o,n),{renderer:o,aggregateFields:s,featureReduction:r}}return{renderer:i,aggregateFields:[],featureReduction:null}}_acquireTile(e){const i=this.tileRenderer.acquireTile(e);return i.once("attach",()=>{this.requestUpdate()}),i}_releaseTile(e){this.tileRenderer.releaseTile(e)}async _initTileRenderer(e,i){const r=await sor(e,{layerView:this,tileInfoView:this.view.featuresTilingScheme,layer:this.layer});return this.tileRenderer&&(this._tileStrategy.clear(),this.tileRenderer.uninstall(this.container),this.tileRenderer=da(this.tileRenderer)),this.destroyed?null:(this._proxy.tileRenderer=r,this._set("tileRenderer",r),this.tileRenderer.install(this.container),this.tileRenderer.onConfigUpdate(i),this.requestUpdate(),this.tileRenderer)}_createTileRendererHash(e){return`${e.type}`}get hasFilter(){const e=!!("floorInfo"in this.layer&&this.layer.floorInfo&&this.view.floors&&this.view.floors.length);return!!this.filter||e||!!this._visibilityOverrides.size||!!this.timeExtent}_injectOverrides(e){const i=ve(e)?e.timeExtent:null,r=ve(this.timeExtent)&&ve(i)?this.timeExtent.intersection(i):this.timeExtent||i;let n=null;const s="floorInfo"in this.layer&&this.layer.floorInfo;if(s){const a=ve(e)?e.where:null;n=this._addFloorFilterClause(a)}if(!this._visibilityOverrides.size&&!r&&!s)return ve(e)?e.toJSON():null;(e=ve(e)&&e.clone()||new bq).timeExtent=r,n&&(e.where=n);const o=e.toJSON();return o.hiddenIds=Array.from(this._visibilityOverrides),o}_addFloorFilterClause(e){const i=this.layer;let r=e||"";if("floorInfo"in i&&i.floorInfo){let n=this.view.floors;if(!n||!n.length)return r;i.floorInfo.viewAllLevelIds?.length&&(n=i.floorInfo.viewAllLevelIds);const s=n.filter(l=>l!=="").map(l=>"'"+l+"'");s.push("''");const o=i.floorInfo.floorField;let a="("+o+" IN ({ids}) OR "+o+" IS NULL)";if(a=a.replace("{ids}",s.join(", ")),ve(r)&&r.includes(o)){let l=new RegExp("AND \\("+o+".*NULL\\)","g");r=r.replace(l,""),l=new RegExp("\\("+o+".*NULL\\)","g"),r=r.replace(l,""),r=r.replace(/\s+/g," ").trim()}r=r!==""?"("+r+") AND "+a:a}return r!==""?r:null}_createConfiguration(e,i,r){const n=this.layer.type==="feature"&&this.layer.historicMoment?this.layer.historicMoment.getTime():void 0,s=this.layer.type==="feature"?this.layer.gdbVersion??void 0:void 0,o=new Array(uvt),a=this._injectOverrides(i);o[0]=a,o[1]=ve(r)?r.toJSON():null;const l=jnr(e);if(lt(l))return null;const c=ST("2d");return{availableFields:this.availableFields,gdbVersion:s,historicMoment:n,devicePixelRatio:window.devicePixelRatio||1,filters:o,schema:l,supportsTextureFloat:c.supportsTextureFloat,maxTextureSize:c.maxTextureSize}}_hasRequiredSupport(e){return!("renderer"in e)||Bnr(e.renderer)}_onceTilesUpdated(){return this.requestUpdate(),N1(()=>!this._pipelineIsUpdating)}_lockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!0,this.tileRenderer.lockGPUUploads())}_unlockGPUUploads(){this.tileRenderer&&(this._uploadsLocked=!1,this.tileRenderer.unlockGPUUploads())}_forceAttributeTextureUpload(){this.tileRenderer&&this.tileRenderer.forceAttributeTextureUpload()}_createSchemaConfig(){const e=this.layer;return{renderer:"renderer"in e?e.renderer:null,spatialReference:e.spatialReference,timeExtent:"timeExtent"in e?e.timeExtent:null,definitionExpression:e.definitionExpression,featureReduction:this._effectiveFeatureReduction,fields:e.fields,geometryType:e.geometryType,historicMoment:"historicMoment"in e?e.historicMoment:null,labelsVisible:"labelsVisible"in e&&e.labelsVisible,labelingInfo:"labelingInfo"in e?e.labelingInfo:null,availableFields:this.availableFields,featureEffect:this.featureEffect,filter:this.filter,gdbVersion:"gdbVersion"in e?e.gdbVersion:null,pixelBuffer:0,orderBy:"orderBy"in e&&e.orderBy?e.orderBy:null,customParameters:{..."customParameters"in e?e.customParameters:void 0,token:"apiKey"in e?e.apiKey??void 0:void 0},subtypeCode:"subtypeCode"in e?e.subtypeCode:void 0,subtypeField:"subtypeField"in e?e.subtypeField:void 0}}_addHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i);this._highlightIds.set(i,r+1)}else this._highlightIds.set(i,1);this._updateHighlight().catch(i=>{ys(i)||Oi.getLogger(this.declaredClass).error(i)})}_removeHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i)-1;r===0?this._highlightIds.delete(i):this._highlightIds.set(i,r)}this._updateHighlight().catch(i=>{ys(i)||Oi.getLogger(this.declaredClass).error(i)})}_setLayersForFeature(e){const i=this.layer;e.layer=i,e.sourceLayer=i}_createGraphicHit(e,i){return this._setLayersForFeature(i),ve(i.geometry)&&(i.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:i,layer:this.layer,mapPoint:e}}};E([N()],A0.prototype,"_serviceOptions",void 0),E([N()],A0.prototype,"_proxy",void 0),E([N()],A0.prototype,"_pipelineIsUpdating",void 0),E([N()],A0.prototype,"_effectiveRenderer",void 0),E([N()],A0.prototype,"_effectiveFeatureReduction",null),E([N()],A0.prototype,"_aggregateValueRanges",void 0),E([N()],A0.prototype,"_commandsQueue",void 0),E([N()],A0.prototype,"featureEffectView",void 0),E([N()],A0.prototype,"labelsVisible",null),E([N({readOnly:!0})],A0.prototype,"queryMode",null),E([N()],A0.prototype,"renderingConfigHash",null),E([N()],A0.prototype,"tileRenderer",void 0),E([N()],A0.prototype,"updating",void 0),A0=E([dt("esri.views.2d.layers.FeatureLayerView2D")],A0);const kge=A0,dor=Object.freeze(Object.defineProperty({__proto__:null,default:kge},Symbol.toStringTag,{value:"Module"}));let WU=class extends GU{constructor(){super(...arguments),this._hasCrossfade=!1}get requiresDedicatedFBO(){return this._hasCrossfade}beforeRender(e){super.beforeRender(e),this._manageFade()}prepareRenderPasses(e){const i=e.registerRenderPass({name:"bitmap",brushes:[ph.bitmap],target:()=>this.children,drawPhase:mo.MAP});return[...super.prepareRenderPasses(e),i]}_manageFade(){this.children.reduce((e,i)=>e+(i.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 por=Math.PI/180;function mor(t){return t*por}function gor(t,e){const i=mor(e.rotation),r=Math.abs(Math.cos(i)),n=Math.abs(Math.sin(i)),[s,o]=e.size;return t[0]=Math.round(o*n+s*r),t[1]=Math.round(o*r+s*n),t}function yor(t,e,i,r){const[n,s]=e,[o,a]=r,l=.5*i;return t[0]=n-l*o,t[1]=s-l*a,t[2]=n+l*o,t[3]=s+l*a,t}const U6=Mo(),kF=[0,0],$ge=new Eh(0,0,0,0),fee={container:null,fetchSource:null,requestUpdate:null,imageMaxWidth:2048,imageMaxHeight:2048,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1};let r1=class extends Tn{constructor(e){super(e),this._imagePromise=null,this.bitmaps=[],this.hidpi=fee.hidpi,this.imageMaxWidth=fee.imageMaxWidth,this.imageMaxHeight=fee.imageMaxHeight,this.imageRotationSupported=fee.imageRotationSupported,this.imageNormalizationSupported=fee.imageNormalizationSupported,this.update=q0(async(i,r)=>{if(yn(r),!i.stationary||this.destroyed)return;const n=i.state,s=vd(n.spatialReference),o=this.hidpi?i.pixelRatio:1,a=this.imageNormalizationSupported&&n.worldScreenWidth&&n.worldScreenWidthl||Math.floor(kF[1]*o)>c,p=s&&(n.extent.xmins.valid[1]),y=!this.imageNormalizationSupported&&p,v=!h&&!y,x=this.imageRotationSupported?n.rotation:0,I=this.container.children.slice();if(v){const P=a?n.paddedViewState.center:n.center;this._imagePromise&&console.error("Image promise was not defined!"),this._imagePromise=this._singleExport(n,kF,P,n.resolution,x,o,r)}else{let P=Math.min(l,c);y&&(P=Math.min(n.worldScreenWidth,P)),this._imagePromise=this._tiledExport(n,P,o,r)}try{const P=await this._imagePromise??[];yn(r);const F=[];if(this._imagePromise=null,this.destroyed)return;this.bitmaps=P;for(const k of I)P.includes(k)||F.push(k.fadeOut().then(()=>{k.remove(),k.destroy()}));for(const k of P)F.push(k.fadeIn());await Promise.all(F)}catch(P){this._imagePromise=null,Ya(P)}},5e3),this.updateExports=q0(async i=>{const r=[];for(const n of this.container.children){if(!n.visible||!n.stage)return;r.push(i(n).then(()=>{n.invalidateTexture(),n.requestRender()}))}this._imagePromise=Ru(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,i,r,n,s,o){const a=await this.fetchSource(e,Math.floor(i*s),Math.floor(r*s),{rotation:n,pixelRatio:s,signal:o});yn(o);const l=new WNe(null,{immutable:!0,requestRenderOnSourceChangedEnabled:!0});return l.x=e.xmin,l.y=e.ymax,l.resolution=e.width/i,l.rotation=n,l.pixelRatio=s,l.opacity=0,this.container.addChild(l),await l.setSourceAsync(a,o),yn(o),l}async _singleExport(e,i,r,n,s,o,a){yor(U6,r,n,i);const l=BL(U6,e.spatialReference);return[await this._export(l,i[0],i[1],s,o,a)]}_tiledExport(e,i,r,n){const s=Ul.create({size:i,spatialReference:e.spatialReference,scales:[e.scale]}),o=new CN(s),a=o.getTileCoverage(e);if(!a)return null;const l=[];return a.forEach((c,h,p,y)=>{$ge.set(c,h,p,0),o.getTileBounds(U6,$ge);const v=BL(U6,e.spatialReference);l.push(this._export(v,i,i,0,r,n).then(x=>(y!==0&&($ge.set(c,h,p,y),o.getTileBounds(U6,$ge),x.x=U6[0],x.y=U6[3]),x)))}),Promise.all(l)}};E([N()],r1.prototype,"_imagePromise",void 0),E([N()],r1.prototype,"bitmaps",void 0),E([N()],r1.prototype,"container",void 0),E([N()],r1.prototype,"fetchSource",void 0),E([N()],r1.prototype,"hidpi",void 0),E([N()],r1.prototype,"imageMaxWidth",void 0),E([N()],r1.prototype,"imageMaxHeight",void 0),E([N()],r1.prototype,"imageRotationSupported",void 0),E([N()],r1.prototype,"imageNormalizationSupported",void 0),E([N()],r1.prototype,"requestUpdate",void 0),E([N()],r1.prototype,"updating",null),r1=E([dt("esri.views.2d.layers.support.ExportStrategy")],r1);const Bge=r1;let mee=class extends LF(wy(xy)){update(e){this._strategy.update(e).catch(i=>{ys(i)||Oi.getLogger(this.declaredClass).error(i)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new WU,this.container.addChild(this._bitmapContainer),this._strategy=new Bge({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,i,r){return this.layer.fetchImageBitmap(e,i,r)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};E([N()],mee.prototype,"_strategy",void 0),E([N()],mee.prototype,"updating",void 0),mee=E([dt("esri.views.2d.layers.BaseDynamicLayerView2D")],mee);const vor=Object.freeze(Object.defineProperty({__proto__:null,default:mee},Symbol.toStringTag,{value:"Module"}));let oke=class extends wy(xy){constructor(){super(...arguments),this._graphicsViewMap={},this._popupTemplates=new Map,this.graphicsViews=[]}async hitTest(e,i){if(!this.graphicsViews.length)return null;const r=this.layer;return this.graphicsViews.reverse().map(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}).flat().map(n=>({type:"graphic",graphic:n,layer:r,mapPoint:e}))}update(e){if(this.graphicsViews)for(const i of this.graphicsViews)i.processUpdate(e)}attach(){this.addAttachHandles([sr(()=>this.layer?.featureCollections,e=>{this._clear();for(const{popupInfo:i,featureSet:r,layerDefinition:n}of e){const s=tc.fromJSON(r),o=new Sr(s.features),a=n.drawingInfo,l=i?wh.fromJSON(i):null,c=PR(a.renderer),h=new gx({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:o,renderer:c,container:new AO(this.view.featuresTilingScheme)});this._graphicsViewMap[s.geometryType]=h,this._popupTemplates.set(h,l),s.geometryType!=="polygon"||this.layer.polygonSymbol?s.geometryType!=="polyline"||this.layer.lineSymbol?s.geometryType!=="point"||this.layer.pointSymbol||(this.layer.pointSymbol=c.symbol):this.layer.lineSymbol=c.symbol:this.layer.polygonSymbol=c.symbol,this.graphicsViews.push(h),this.container.addChild(h.container)}},Yo),sr(()=>this.layer?.polygonSymbol,e=>{this._graphicsViewMap.polygon.renderer=new i_({symbol:e})},Yo),sr(()=>this.layer?.lineSymbol,e=>{this._graphicsViewMap.polyline.renderer=new i_({symbol:e})},Yo),sr(()=>this.layer?.pointSymbol,e=>{this._graphicsViewMap.point.renderer=new i_({symbol:e})},Yo)])}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}};oke=E([dt("esri.views.2d.layers.GeoRSSLayerView2D")],oke);const _or=Object.freeze(Object.defineProperty({__proto__:null,default:oke},Symbol.toStringTag,{value:"Module"})),bor={remove(){},pause(){},resume(){}};let Vge=class extends wy(xy){constructor(){super(...arguments),this._highlightIds=new Map}attach(){this.graphicsView=new gx({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new AO(this.view.featuresTilingScheme)}),this._updateHighlight(),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler))}detach(){this.container.removeAllChildren(),this.graphicsView=da(this.graphicsView)}async hitTest(e){return this.graphicsView?this.graphicsView.hitTest(e).map(i=>({type:"graphic",graphic:i,mapPoint:e,layer:this.layer})):null}async fetchPopupFeatures(e){return this.graphicsView?this.graphicsView.hitTest(e).filter(i=>!!i.popupTemplate):[]}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){let i;typeof e=="number"?i=[e]:e instanceof io?i=[e.uid]:Array.isArray(e)&&e.length>0?i=typeof e[0]=="number"?e:e.map(n=>n&&n.uid):Sr.isCollection(e)&&e.length>0&&(i=e.map(n=>n&&n.uid).toArray());const r=i?.filter(ve);return r?.length?(this._addHighlight(r),{remove:()=>this._removeHighlight(r)}):bor}_addHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i);this._highlightIds.set(i,r+1)}else this._highlightIds.set(i,1);this._updateHighlight()}_removeHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i)-1;r===0?this._highlightIds.delete(i):this._highlightIds.set(i,r)}this._updateHighlight()}_updateHighlight(){this.graphicsView?.setHighlight(Array.from(this._highlightIds.keys()))}};E([N()],Vge.prototype,"graphicsView",void 0),Vge=E([dt("esri.views.2d.layers.GraphicsLayerView2D")],Vge);const wor=Object.freeze(Object.defineProperty({__proto__:null,default:Vge},Symbol.toStringTag,{value:"Module"}));let MPt=class extends GU{constructor(){super(...arguments),this._prevFBO=void 0,this.requiresDedicatedFBO=!1}dispose(){}doRender(e){const i=this.createRenderParams(e),{context:r,painter:n,profiler:s}=i;this._prevFBO=r.getBoundFramebufferObject(),s.recordContainerStart(this.name);const o=this._getFbo(i),a=n.getRenderTarget();r.bindFramebuffer(o),n.setRenderTarget(o),r.setDepthWriteEnabled(!0),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setClearDepth(1),r.clear(r.gl.COLOR_BUFFER_BIT|r.gl.DEPTH_BUFFER_BIT),r.setDepthWriteEnabled(!1);for(const l of this.children)l.beforeRender(e);for(const l of this.children)l.processRender(i);for(const l of this.children)l.afterRender(e);n.setRenderTarget(a),n.releaseFbo(o),r.bindFramebuffer(this._prevFBO),n.beforeRenderLayer(i,this._clippingInfos?255:0,this.computedOpacity),o.colorTexture&&(r.setStencilTestEnabled(!1),r.setStencilWriteMask(0),n.blitTexture(r,o.colorTexture,In.NEAREST)),n.compositeLayer(i,this.computedOpacity),s.recordContainerEnd()}createRenderParams(e){return{...super.createRenderParams(e),blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:1}}_getFbo(e){const{context:i,painter:r}=e,{width:n,height:s}=i.getViewport();return r.acquireFbo(n,s)}},qU=class extends xy{constructor(e){super(e),this.type="group",this.layerViews=new Sr}_allLayerViewVisibility(e){this.layerViews.forEach(i=>{i.visible=e})}initialize(){this.handles.add([this.layerViews.on("change",e=>this._layerViewsChangeHandler(e)),sr(()=>this.layer.visibilityMode,()=>this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(null)),qu),sr(()=>this.visible,e=>{this._applyVisibility(()=>this._allLayerViewVisibility(e),()=>{})},qu)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(e){this._set("layerViews",og(e,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((e,i)=>e+i.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(i=>i.layer===e)}_firstVisibleOnLayerOrder(){const e=this.layer.layers.find(i=>!!this._findLayerViewForLayer(i)?.visible);return e&&this._findLayerViewForLayer(e)}_applyExclusiveVisibility(e){lt(e)&&(e=this._firstVisibleOnLayerOrder(),lt(e)&&this.layerViews.length>0&&(e=this._findLayerViewForLayer(this.layer.layers.getItemAt(0)))),this.layerViews.forEach(i=>{i.visible=i===e})}_layerViewsChangeHandler(e){this.handles.remove("grouplayerview:visible"),this.handles.add(this.layerViews.map(r=>sr(()=>r.visible,n=>this._applyVisibility(()=>{n!==this.visible&&(r.visible=this.visible)},()=>this._applyExclusiveVisibility(n?r:null)),qu)).toArray(),"grouplayerview:visible");const i=e.added[e.added.length-1];this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(i?.visible?i:null))}_applyVisibility(e,i){this._hasLayerViewVisibleOverrides()&&(this.layer?.visibilityMode==="inherited"?e():this.layer?.visibilityMode==="exclusive"&&i())}};E([N({cast:k8})],qU.prototype,"layerViews",null),E([N({readOnly:!0})],qU.prototype,"updatingProgress",null),E([N()],qU.prototype,"view",void 0),qU=E([dt("esri.views.layers.GroupLayerView")],qU);const xor=qU;let ake=class extends wy(xor){constructor(){super(...arguments),this.container=new MPt}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,i)=>this.container.addChildAt(e.container,i))}};ake=E([dt("esri.views.2d.layers.GroupLayerView2D")],ake);const Sor=Object.freeze(Object.defineProperty({__proto__:null,default:ake},Symbol.toStringTag,{value:"Module"}));function Cor(t){const e=DPt(lke(t)),i=e,r=!0,n=Math.max(e/2,5),s=Math.round(vn(t.maxPathLength)/n)+1,o=10,{density:a}=t;return{smoothing:vn(t.smoothing),interpolate:!0,velocityScale:t.flowRepresentation==="flow-from"?1:-1,verticesPerLine:s,minSpeedThreshold:.001,segmentLength:n,maxTurnAngle:1,collisions:r,lineCollisionWidth:i,lineSpacing:o,density:a}}function DPt(t){return t.kind==="constant"?t.value[0]:t.values[t.values.length-1]}function FPt(t){const e=t.toRgba();return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function Tor(t){return{kind:"constant",value:[.1,.1,.1,1]}}function lke(t){if(!t.hasVisualVariables("size"))return{kind:"constant",value:[vn(t.trailWidth)]};const e=t.getVisualVariablesForType("size")[0],i=[],r=[];let n;if(e.stops){for(const s of e.stops)i.push(s.value),r.push(vn(s.size));n=e.stops.length}else i.push(e.minDataValue,e.maxDataValue),r.push(vn(e.minSize),vn(e.maxSize)),n=2;return{kind:"ramp",stops:i,values:r,count:n}}function Eor(t){if(!t.hasVisualVariables("color"))return{kind:"constant",value:FPt(t.color)};const e=t.getVisualVariablesForType("color")[0],i=[],r=[];for(const n of e.stops)i.push(n.value),Array.prototype.push.apply(r,FPt(n.color));return{kind:"ramp",stops:i,values:r,count:e.stops.length}}function Ior(t){if(!t.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};const e=t.getVisualVariablesForType("opacity")[0],i=[],r=[];for(const n of e.stops)i.push(n.value),r.push(n.opacity);return{kind:"ramp",stops:i,values:r,count:e.stops.length}}function uke(t,e,i,r){switch(e){case"int":t.setUniform1iv(i,r);break;case"float":t.setUniform1fv(i,r);break;case"vec2":t.setUniform2fv(i,r);break;case"vec3":t.setUniform3fv(i,r);break;case"vec4":t.setUniform4fv(i,r)}}function $F(t,e,i,r){r.kind==="constant"?uke(t,i,`u_${e}`,r.value):(uke(t,"float",`u_${e}_stops`,r.stops),uke(t,i,`u_${e}_values`,r.values),t.setUniform1i(`u_${e}_count`,r.count))}function Aor(t,e){let i=!0;return i=i&&t.collisions===e.collisions,i=i&&t.density===e.density,i=i&&t.interpolate===e.interpolate,i=i&&t.lineCollisionWidth===e.lineCollisionWidth,i=i&&t.lineSpacing===e.lineSpacing,i=i&&t.maxTurnAngle===e.maxTurnAngle,i=i&&t.minSpeedThreshold===e.minSpeedThreshold,i=i&&t.segmentLength===e.segmentLength,i=i&&t.smoothing===e.smoothing,i=i&&t.velocityScale===e.velocityScale,i=i&&t.verticesPerLine===e.verticesPerLine,i}function LPt(t,e){return t===e||!(!ve(t)||!ve(e))&&t.equals(e)}function NPt(t,e){if(!Aor(t.simulationSettings,e.simulationSettings)||!LPt(t.timeExtent,e.timeExtent))return!1;let i=!0;return i=i&&t.loadImagery===e.loadImagery,i=i&&t.createFlowMesh===e.createFlowMesh,i=i&&t.color.kind===e.color.kind,i=i&&t.opacity.kind===e.opacity.kind,i=i&&t.size.kind===e.size.kind,i}let Por=class pNt{constructor(e){this._params=e,this.animated=!1}isCompatible(e){if(!(e instanceof pNt)||!LPt(this._params.timeExtent,e._params.timeExtent))return!1;let i=!0;return i=i&&this._params.loadImagery===e._params.loadImagery,i=i&&this._params.color.kind===e._params.color.kind,i=i&&this._params.opacity.kind===e._params.opacity.kind,i}async load(e,i){const{extent:r,size:n}=e;yn(i);const s=await this._params.loadImagery(r,n[0],n[1],this._params.timeExtent,i);return new Mor(s,{color:this._params.color,opacity:this._params.opacity})}render(e,i,r){const{context:n}=e,{program:s}=r;n.setFaceCullingEnabled(!1),n.setBlendingEnabled(!0),n.setBlendFunction(Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA),n.useProgram(s),s.setUniformMatrix3fv("u_dvsMat3",i.dvsMat3),n.bindTexture(r.texture,0),s.setUniform1i("u_texture",0),s.setUniform1f("u_Min",r.min),s.setUniform1f("u_Max",r.max),$F(s,"color","vec4",this._params.color),$F(s,"opacity","float",this._params.opacity),n.bindVAO(r.vertexArray),n.drawArrays(bs.TRIANGLE_STRIP,0,4)}};const jge=new Map;jge.set("a_position",0),jge.set("a_texcoord",1);const Oor={geometry:[new na("a_position",2,Bi.UNSIGNED_SHORT,0,8),new na("a_texcoord",2,Bi.UNSIGNED_SHORT,4,8)]},Ror={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:jge};let Mor=class{constructor(e,i){this._flowData=e,this._values=i}attach(e){const{context:i}=e,{width:r,height:n}=this._flowData,s=aa.createVertex(i,Xo.STATIC_DRAW,new Uint16Array([0,0,0,1,r,0,1,1,0,n,0,0,r,n,1,0])),o=new Mc(i,jge,Oor,{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(Ror,a);let c=1e6,h=-1e6;for(let v=0;v0}isCompatible(e){return e instanceof fNt&&NPt(this._params,e._params)}async load(e,i){const{extent:r,size:n}=e;yn(i);const s=await this._params.loadImagery(r,n[0],n[1],this._params.timeExtent,i),{vertexData:o,indexData:a}=await this._params.createFlowMesh("Particles",this._params.simulationSettings,s,i);return new Nor(o,a,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(e,i,r){const{context:n}=e,{program:s}=r;n.setFaceCullingEnabled(!1),n.setBlendingEnabled(!0),n.setBlendFunction(Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA),n.useProgram(s),s.setUniform1f("u_time",i.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",i.dvsMat3),s.setUniformMatrix3fv("u_displayViewMat3",i.displayViewMat3),$F(s,"color","vec4",this._params.color),$F(s,"opacity","float",this._params.opacity),$F(s,"size","float",this._params.size),n.bindVAO(r.vertexArray),n.drawElements(bs.TRIANGLES,r.indexCount,Bi.UNSIGNED_INT,0)}};const YU=new Map;YU.set("a_xyts0",0),YU.set("a_xyts1",1),YU.set("a_typeIdDurationSeed",2),YU.set("a_extrudeInfo",3);const For={geometry:[new na("a_xyts0",4,Bi.FLOAT,0,64),new na("a_xyts1",4,Bi.FLOAT,16,64),new na("a_typeIdDurationSeed",4,Bi.FLOAT,32,64),new na("a_extrudeInfo",4,Bi.FLOAT,48,64)]},Lor={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",attributes:YU};let Nor=class{constructor(e,i,r){this._vertexData=e,this._indexData=i,this._values=r}attach(e){const{context:i}=e,r=aa.createVertex(i,Xo.STATIC_DRAW,this._vertexData),n=aa.createIndex(i,Xo.STATIC_DRAW,this._indexData),s=new Mc(i,YU,For,{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(Lor,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}},kor=class mNt{constructor(e){this._styles=e}get animated(){return this._styles.reduce((e,i)=>e||i.animated,!1)}isCompatible(e){if(!(e instanceof mNt)||this._styles.length!==e._styles.length)return!1;const i=this._styles.length;for(let r=0;rn.load(e,i)));return new $or(r)}render(e,i,r){for(let n=0;ne&&i.ready,!0)}},Bor=class gNt{constructor(e){this._params=e}get animated(){return this._params.flowSpeed>0}isCompatible(e){return e instanceof gNt&&NPt(this._params,e._params)}async load(e,i){const{extent:r,size:n}=e;yn(i);const s=await this._params.loadImagery(r,n[0],n[1],this._params.timeExtent,i),{vertexData:o,indexData:a}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,s,i);return new Gor(o,a,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(e,i,r){const{context:n}=e,{program:s}=r;n.setFaceCullingEnabled(!1),n.setBlendingEnabled(!0),n.setBlendFunction(Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA),n.useProgram(s),s.setUniform1f("u_time",i.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",i.dvsMat3),s.setUniformMatrix3fv("u_displayViewMat3",i.displayViewMat3),$F(s,"color","vec4",this._params.color),$F(s,"opacity","float",this._params.opacity),$F(s,"size","float",this._params.size),n.bindVAO(r.vertexArray),n.drawElements(bs.TRIANGLES,r.indexCount,Bi.UNSIGNED_INT,0)}};const XU=new Map;XU.set("a_positionAndSide",0),XU.set("a_timeInfo",1),XU.set("a_extrude",2),XU.set("a_speed",3);const Vor={geometry:[new na("a_positionAndSide",3,Bi.FLOAT,0,36),new na("a_timeInfo",3,Bi.FLOAT,12,36),new na("a_extrude",2,Bi.FLOAT,24,36),new na("a_speed",1,Bi.FLOAT,32,36)]},jor={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",attributes:XU};let Gor=class{constructor(e,i,r){this._vertexData=e,this._indexData=i,this._values=r}attach(e){const{context:i}=e,r=aa.createVertex(i,Xo.STATIC_DRAW,this._vertexData),n=aa.createIndex(i,Xo.STATIC_DRAW,this._indexData),s=new Mc(i,XU,Vor,{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(jor,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 Uor=4,zor=1,Hor=.5,Wor=!0,qor=!0,Yor=2.3;function Xor(t,e){const{flowSpeed:i,trailLength:r}=t,n=Cor(t);let s=null;const o={opacity:Ior(t),size:lke(t)};let a=Eor(t);if(t.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 h={loadImagery:e.loadImagery,timeExtent:e.timeExtent,color:a,opacity:{kind:"constant",value:[1]}};s=new Por(h),o.color=Tor()}const l={loadImagery:e.loadImagery,createFlowMesh:e.createFlowMesh,simulationSettings:n,timeExtent:e.timeExtent,trailLength:r,flowSpeed:i,featheringSize:zor,featheringOffset:Hor,introFade:Wor,fadeToZero:qor,decayRate:Yor,color:o.color,opacity:o.opacity,size:o.size},c=t.trailCap==="butt"||DPt(lke(t))<=Uor?new Bor(l):new Dor(l);return ve(s)?new kor([s,c]):c}let Kor=class extends q_{constructor(){super(...arguments),this._visualState={time:0,dvsMat3:Dl(),displayViewMat3:Dl()}}dispose(){}prepareState(e){const{context:i}=e;i.setColorMask(!0,!0,!0,!0),i.setStencilFunction(kl.EQUAL,0,255)}draw(e,i){const{requestRender:r,allowDelayedRender:n}=e,{displayData:s}=i;if(lt(s)||(s.state.name==="loaded"&&s.attach(e),s.state.name!=="attached"))return;const o=s.state.resources;n&&!o.ready&&ve(r)?r():(this._visualState.time=e.time/1e3,this._visualState.dvsMat3=i.transforms.dvs,this._visualState.displayViewMat3=e.state.displayViewMat3,s.flowStyle.render(e,this._visualState,o),s.flowStyle.animated&&ve(r)&&r())}},Jor=class extends GU{constructor(){super(...arguments),this.flowStyle=null}get requiresDedicatedFBO(){return!1}doRender(e){super.doRender(e)}prepareRenderPasses(e){const i=e.registerRenderPass({name:"flow",brushes:[Kor],target:()=>this.children,drawPhase:mo.MAP});return[...super.prepareRenderPasses(e),i]}},Zor=class{constructor(e,i,r,n){this.state={name:"created"},this.flowStyle=e,this.extent=i,this.size=r,this.pixelRatio=n}async load(){const e=new AbortController;this.state={name:"loading",abortController:e};const i={extent:this.extent,size:this.size,pixelRatio:this.pixelRatio},r=await this.flowStyle.load(i,e.signal);this.state={name:"loaded",resources:r}}attach(e){if(this.state.name!=="loaded")return void Oi.getLogger("esri.views.2d.engine.flow.FlowDisplayData").error("Only loaded resources can be attached.");const i=this.state.resources;i.attach(e),this.state={name:"attached",resources:i}}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}},Qor=class extends CS{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(e){this._displayData=e,this.requestRender()}clear(){ve(this._displayData)&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(e){const{displayData:i}=this;if(lt(i))return;const r=i.extent.xmin,n=i.extent.ymax,s=[0,0];e.toScreen(s,[r,n]);const o=(i.extent.xmax-i.extent.xmin)/i.size[0]/e.resolution,a=ew(e.rotation),{dvs:l}=this.transforms;WIe(l,[-1,1,0]),rP(l,l,[2/(e.size[0]*e.pixelRatio),-2/(e.size[1]*e.pixelRatio),1]),dg(l,l,[s[0],s[1],0]),wT(l,l,a),rP(l,l,[o*e.pixelRatio,o*e.pixelRatio,1])}_createTransforms(){return{dvs:Dl()}}};const ear=1.15;let KU=class extends Tn{constructor(e){super(e),this._flowDisplayObject=new Qor,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:i}=this.flowContainer;if(lt(i))return void this._clear();const{extent:r,rotation:n,resolution:s,pixelRatio:o}=e.state,a=iar(r,n);a.expand(ear);const l=[Math.round((a.xmax-a.xmin)/s),Math.round((a.ymax-a.ymin)/s)],c=new Zor(i,a,l,o);if(ve(this._loading)){if(this._loading.update(c))return;this._loading.detach(),this._loading=null}!lt(this._flowDisplayObject.displayData)&&this._flowDisplayObject.displayData.update(c)||(c.load().then(()=>{this._flowDisplayObject.clear(),this._flowDisplayObject.displayData=this._loading,this._loading=null},h=>{ys(h)||(Oi.getLogger(this.declaredClass).error("A resource failed to load.",h),this._loading=null)}),this._loading=c)}_clear(){this._flowDisplayObject.clear(),ve(this._loading)&&(this._loading.detach(),this._loading=null)}};E([N()],KU.prototype,"_loading",void 0),E([N()],KU.prototype,"flowContainer",void 0),E([N()],KU.prototype,"updating",null),KU=E([dt("esri.views.2d.engine.flow.FlowStrategy")],KU);const tar=KU;function iar(t,e){const i=new er({x:(t.xmax+t.xmin)/2,y:(t.ymax+t.ymin)/2,spatialReference:t.spatialReference}),r=t.xmax-t.xmin,n=t.ymax-t.ymin,s=Math.abs(Math.cos(ew(e))),o=Math.abs(Math.sin(ew(e))),a=s*r+o*n,l=o*r+s*n,c=new Ar({xmin:i.x-a/2,ymin:i.y-l/2,xmax:i.x+a/2,ymax:i.y+l/2,spatialReference:t.spatialReference});return c.centerAt(i),c}let OS=class extends Tn{constructor(){super(...arguments),this._loadImagery=(e,i,r,n,s)=>QJe(this.layer,e,i,r,n,s),this._createFlowMesh=(e,i,r,n)=>this.layer.createFlowMesh({meshType:e,flowData:r,simulationSettings:i},{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,i=()=>{this._loadImagery=(r,n,s,o,a)=>QJe(e,r,n,s,o,a),this._updateVisualization()};"multidimensionalDefinition"in e?this.addHandles(sr(()=>e.multidimensionalDefinition,i)):this.addHandles([sr(()=>e.mosaicRule,i),sr(()=>e.renderingRule,i),sr(()=>e.definitionExpression,i)]),this.container=new Jor,this._strategy=new tar({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 io({attributes:{},geometry:e.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){const e=this.layer.renderer;if(e==null||e.type!=="flow")return;const i=Xor(e,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent});this.container.flowStyle=i,this.layerView.requestUpdate()}};E([N()],OS.prototype,"_strategy",void 0),E([N()],OS.prototype,"attached",void 0),E([N()],OS.prototype,"container",void 0),E([N()],OS.prototype,"layer",void 0),E([N()],OS.prototype,"layerView",void 0),E([N()],OS.prototype,"type",void 0),E([N()],OS.prototype,"updating",null),E([N()],OS.prototype,"timeExtent",void 0),OS=E([dt("esri.views.2d.engine.flow.FlowView2D")],OS);const kPt=OS;let yx=class extends Tn{constructor(){super(...arguments),this.attached=!1,this.container=new CU,this.updateRequested=!1,this.type="imagery",this._bitmapView=new WU}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(i=>{ys(i)||Oi.getLogger(this.declaredClass).error(i)})}hitTest(e){return new io({attributes:{},geometry:e.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const e=this.layer.version>=10,i=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,r=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new Bge({container:this._bitmapView,imageNormalizationSupported:e,imageMaxHeight:i,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:i}=e;if(!i||i instanceof ImageBitmap)return;const r=await this.layer.applyRenderer({extent:i.extent,pixelBlock:i.originalPixelBlock??i.pixelBlock});i.filter=n=>this.layer.pixelFilter?this.layer.applyFilter(n):{...r,extent:i.extent}}).catch(e=>{ys(e)||Oi.getLogger(this.declaredClass).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 i=this.view.extent,r=e.map(s=>s.source).filter(s=>s.extent&&s.extent.intersects(i)).map(s=>({extent:s.extent,pixelBlock:s.originalPixelBlock})),n=UYt(r,i);return ve(n)?{extent:n.extent,pixelBlock:n.pixelBlock}:null}return null}async _fetchImage(e,i,r,n){(n=n||{}).timeExtent=this.timeExtent,n.requestAsImageElement=!0,n.returnImageBitmap=!0;const s=await this.layer.fetchImage(e,i,r,n);if(s.imageBitmap)return s.imageBitmap;const o=await this.layer.applyRenderer(s.pixelData,{signal:n.signal}),a=new vPt(o.pixelBlock,o.extent?.clone(),s.pixelData.pixelBlock);return a.filter=l=>this.layer.applyFilter(l),a}};E([N()],yx.prototype,"attached",void 0),E([N()],yx.prototype,"container",void 0),E([N()],yx.prototype,"layer",void 0),E([N()],yx.prototype,"strategy",void 0),E([N()],yx.prototype,"timeExtent",void 0),E([N()],yx.prototype,"view",void 0),E([N()],yx.prototype,"updateRequested",void 0),E([N()],yx.prototype,"updating",null),E([N()],yx.prototype,"type",void 0),yx=E([dt("esri.views.2d.layers.imagery.ImageryView2D")],yx);const rar=yx,Gge=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]),$Pt={beaufort_ft:Gge,beaufort_m:Gge,beaufort_km:Gge,beaufort_mi:Gge,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]),single_arrow:new Float32Array([0,92/255,230/255,1]),wind_speed:new Float32Array([0,0,0,1])},BPt=[0,20];let VPt=class extends q_{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(Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA,Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0),e.setStencilOp(nu.KEEP,nu.KEEP,nu.REPLACE)}draw(e,i){if(lt(i.source)||i.source.validPixelCount===0)return;const{context:r,timeline:n}=e;if(n.begin(this.name),r.setStencilFunction(kl.EQUAL,i.stencilRef,255),i.updateVectorFieldVAO(e),e.renderPass==="scalar"){const s=i.vaoData.scalar;s&&this._drawScalars(e,i,s.vao,s.elementCount)}else{const s=i.vaoData.magdir;s&&this._drawTriangles(e,i,s.vao,s.elementCount)}n.end(this.name)}_drawTriangles(e,i,r,n){const{context:s,painter:o,requestRender:a,allowDelayedRender:l}=e,{symbolizerParameters:c}=i,h=c.dataRange?["dataRange"]:[];c.rotationType==="geographic"&&h.push("rotationGeographic");const p=o.materialManager.getProgram(this._desc.magdir,h);if(l&&ve(a)&&!p.compiled)return void a();s.useProgram(p);const{coordScale:y,opacity:v,transforms:x}=i;p.setUniform2fv("u_coordScale",y),p.setUniform1f("u_opacity",v),p.setUniformMatrix3fv("u_dvsMat3",x.dvs);const{style:I,dataRange:P,rotation:F,symbolPercentRange:k}=c;p.setUniform4fv("u_colors",$Pt[I]||$Pt.single_arrow),p.setUniform2fv("u_dataRange",P||BPt),p.setUniform1f("u_rotation",F),p.setUniform2fv("u_symbolPercentRange",k);const j=this._getSymbolSize(e,i);p.setUniform2fv("u_symbolSize",j),s.bindVAO(r),s.drawElements(bs.TRIANGLES,n,Bi.UNSIGNED_INT,0)}_drawScalars(e,i,r,n){const{context:s,painter:o,requestRender:a,allowDelayedRender:l}=e,{symbolizerParameters:c}=i,h=[];c.style==="wind_speed"?h.push("innerCircle"):c.dataRange&&h.push("dataRange"),c.rotationType==="geographic"&&h.push("rotationGeographic");const p=o.materialManager.getProgram(this._desc.scalar,h);if(l&&ve(a)&&!p.compiled)return void a();s.useProgram(p);const{coordScale:y,opacity:v,transforms:x}=i;p.setUniform2fv("u_coordScale",y),p.setUniform1f("u_opacity",v),p.setUniformMatrix3fv("u_dvsMat3",x.dvs);const{dataRange:I,symbolPercentRange:P}=c;p.setUniform2fv("u_dataRange",I||BPt),p.setUniform2fv("u_symbolPercentRange",P);const F=this._getSymbolSize(e,i);p.setUniform2fv("u_symbolSize",F),s.bindVAO(r),s.drawElements(bs.TRIANGLES,n,Bi.UNSIGNED_INT,0)}_getSymbolSize(e,i){const r=i.key?2**(e.displayLevel-i.key.level):i.resolution/e.state.resolution,{symbolTileSize:n}=i.symbolizerParameters;return[n/(Math.round((i.width-i.offset[0])/n)*n)/r,n/(Math.round((i.height-i.offset[1])/n)*n)/r]}},nar=class extends GU{constructor(){super(...arguments),this.symbolTypes=["triangle"]}get requiresDedicatedFBO(){return!1}prepareRenderPasses(e){const i=e.registerRenderPass({name:"imagery (vf)",brushes:[VPt],target:()=>this.children,drawPhase:mo.MAP});return[...super.prepareRenderPasses(e),i]}doRender(e){this.visible&&e.drawPhase===mo.MAP&&this.symbolTypes.forEach(i=>{e.renderPass=i,super.doRender(e)})}},jPt=class extends CS{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(){ve(this.vaoData)&&(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&&ve(this.vaoData)&&(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,ve(this.source)&<(this.vaoData)){const{style:i}=this.symbolizerParameters;switch(i){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=nKe(this.source,this.symbolizerParameters),n=this._createVectorFieldVAO(e.context,r);this.vaoData={magdir:n}}break;case"simple_scalar":{const r=ECe(this.source,this.symbolizerParameters),n=this._createVectorFieldVAO(e.context,r);this.vaoData={scalar:n}}break;case"wind_speed":{const r=nKe(this.source,this.symbolizerParameters),n=this._createVectorFieldVAO(e.context,r),s=ECe(this.source,this.symbolizerParameters),o=this._createVectorFieldVAO(e.context,s);this.vaoData={magdir:n,scalar:o}}}}this.ready(),this.requestRender()}}_createTransforms(){return{dvs:Dl()}}setTransform(e){const i=iP(this.transforms.dvs),[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;dg(i,i,mp(r,n)),dg(i,i,mp(o/2,a/2)),wT(i,i,-l),dg(i,i,mp(-o/2,-a/2)),Vle(i,i,mp(o,a)),cv(this.transforms.dvs,e.displayViewMat3,i)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(e,i){const{vertexData:r,indexData:n}=i,s=aa.createVertex(e,Xo.STATIC_DRAW,new Float32Array(r)),o=aa.createIndex(e,Xo.STATIC_DRAW,new Uint32Array(n)),a=iO("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:Bi.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:Bi.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:Bi.FLOAT,normalized:!1}]});return{vao:new Mc(e,a.attributes,a.bufferLayouts,{geometry:s},o),elementCount:n.length}}},z6=class extends Tn{constructor(e){super(e),this._loading=null,this.update=q0((i,r)=>this._update(i,r).catch(n=>{ys(n)||Oi.getLogger(this.declaredClass).error(n)}))}get updating(){return!!this._loading}redraw(e){if(!this.container.children.length)return;const i=this.container.children[0];i.symbolizerParameters=e,i.invalidateVAO(),this.container.symbolTypes=e.style==="wind_speed"?["scalar","triangle"]:e.style==="simple_scalar"?["scalar"]:["triangle"],this.container.requestRender()}async _update(e,i,r){if(!e.stationary)return;const{extent:n,spatialReference:s}=e.state,o=new Ar({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 c=await this._loading;this._addToDisplay(c,i,e.state),this._loading=null}_addToDisplay(e,i,r){if(lt(e.pixelBlock))return this.container.children.forEach(a=>a.destroy()),void this.container.removeAllChildren();const{extent:n,pixelBlock:s}=e,o=new jPt(s);o.offset=[0,0],o.symbolizerParameters=i,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*i.symbolTileSize,o.height=s.height*i.symbolTileSize,this.container.children.forEach(a=>a.destroy()),this.container.removeAllChildren(),this.container.symbolTypes=i.style==="wind_speed"?["scalar","triangle"]:i.style==="simple_scalar"?["scalar"]:["triangle"],this.container.addChild(o)}};E([N()],z6.prototype,"fetchPixels",void 0),E([N()],z6.prototype,"container",void 0),E([N()],z6.prototype,"_loading",void 0),E([N()],z6.prototype,"updating",null),z6=E([dt("esri.views.2d.layers.imagery.ImageryVFStrategy")],z6);const sar=z6;let XE=class extends YC{constructor(){super(...arguments),this.attached=!1,this.container=new nar,this.type="imageryVF",this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""},this._fetchpixels=async(e,i,r,n)=>{const s=await this._projectFullExtentPromise,{symbolTileSize:o}=this.layer.renderer,{extent:a,width:l,height:c}=KYt(e,i,r,o,s);if(ve(s)&&!s.intersects(e))return{extent:a,pixelBlock:null};const h={bbox:`${a.xmin}, ${a.ymin}, ${a.xmax}, ${a.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:o,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(h)){const v=this.getPixelData();if(ve(v)&&`${v.extent.xmin}, ${v.extent.ymin}, ${v.extent.xmax}, ${v.extent.ymax}`===h.bbox)return v}const{pixelData:p}=await this.layer.fetchImage(a,l,c,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:n});this._dataParameters=h;const y=p?.pixelBlock;return lt(y)?{extent:a,pixelBlock:null}:{extent:a,pixelBlock:this.layer.rasterInfo.dataType==="vector-uv"?mB(y,"vector-uv"):y}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference),this._strategy=new sar({container:this.container,fetchPixels:this._fetchpixels}),this.handles.add(sr(()=>this.layer.renderer,e=>this._updateSymbolizerParams(e),Wh),"attach")}detach(){this._strategy.destroy(),this.container.children.forEach(e=>e.destroy()),this.container.removeAllChildren(),this.handles.remove("attach"),this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){const e=this.container.children[0]?.rawPixelData;if(this.updating||!e)return null;const{extent:i,pixelBlock:r}=e;return{extent:i,pixelBlock:r}}hitTest(e){return new io({attributes:{},geometry:e.clone(),layer:this.layer})}update(e){this._strategy.update(e,this._symbolizerParams)}redraw(){const{renderer:e}=this.layer;e&&(this._updateSymbolizerParams(e),this._strategy.redraw(this._symbolizerParams))}_canReuseVectorFieldData(e){const i=this._dataParameters.exportParametersVersion===e.exportParametersVersion,r=this._dataParameters.time===e.time,n=this._dataParameters.symbolTileSize===e.symbolTileSize,s=this._dataParameters.bbox===e.bbox;return i&&r&&n&&s}async _getProjectedFullExtent(e){try{return await eF(this.layer.fullExtent,e)}catch{try{const r=(await ur(this.layer.url,{query:{option:"footprints",outSR:e.wkid||JSON.stringify(e.toJSON()),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return r?Ar.fromJSON(r):null}catch{return null}}}_updateSymbolizerParams(e){e.type==="vector-field"&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};E([N()],XE.prototype,"attached",void 0),E([N()],XE.prototype,"container",void 0),E([N()],XE.prototype,"layer",void 0),E([N()],XE.prototype,"timeExtent",void 0),E([N()],XE.prototype,"type",void 0),E([N()],XE.prototype,"view",void 0),E([N()],XE.prototype,"updating",null),XE=E([dt("esri.views.2d.layers.imagery.VectorFieldView2D")],XE);const oar=XE,aar=t=>{let e=class extends t{constructor(){super(...arguments),this.view=null}async fetchPopupFeatures(i,r){const{layer:n}=this;if(!i)throw new st("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:n});const{popupEnabled:s}=n,o=NF(n,r);if(!s||lt(o))throw new st("imagerylayerview:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:s,popupTemplate:o});const a=await o.getRequiredFields(),l=new Ns;l.timeExtent=this.timeExtent,l.geometry=i,l.outFields=a,l.outSpatialReference=i.spatialReference;const{resolution:c,spatialReference:h}=this.view,p=this.view.type==="2d"?new er(c,c,h):new er(.5*c,.5*c,h),{returnTopmostRaster:y,showNoDataRecords:v}=o.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},x={returnDomainValues:!0,returnTopmostRaster:y,pixelSize:p,showNoDataRecords:v,signal:ve(r)?r.signal:null};return n.queryVisibleRasters(l,x).then(I=>I)}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return E([N()],e.prototype,"layer",void 0),E([N()],e.prototype,"suspended",void 0),E([N(j9)],e.prototype,"timeExtent",void 0),E([N()],e.prototype,"view",void 0),e=E([dt("esri.views.layers.ImageryLayerView")],e),e};let gee=class extends aar(LF(wy(xy))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new U1,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}async hitTest(e,i){return this.subview?[{type:"graphic",graphic:this.subview.hitTest(e),layer:this.layer,mapPoint:e}]:null}update(e){this.subview?.update(e)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new gx({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new ZNe(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([sr(()=>this.layer.blendMode??"normal",e=>this.subview&&(this.subview.container.blendMode=e),Wh),sr(()=>this.layer.effect??null,e=>this.subview&&(this.subview.container.effect=e),Wh),sr(()=>this.layer.exportImageServiceParameters.version,e=>{e&&this._exportImageVersion!==e&&(this._exportImageVersion=e,this.requestUpdate())},qu),sr(()=>this.timeExtent,e=>{const{subview:i}=this;i&&(i.timeExtent=e,"redraw"in i?this.requestUpdate():i.redrawOrRefetch())},qu),this.layer.on("redraw",()=>{const{subview:e}=this;e&&("redraw"in e?e.redraw():e.redrawOrRefetch())}),sr(()=>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,i){if(!((Array.isArray(e)?e[0]:Sr.isCollection(e)?e.getItemAt(0):e)instanceof io))return{remove:()=>{}};let r=[];return Array.isArray(e)||Sr.isCollection(e)?r=e.map(n=>n.clone()):e instanceof io&&(r=[e.clone()]),this._highlightGraphics.addMany(r),{remove:()=>{this._highlightGraphics.removeMany(r)}}}async doRefresh(){this.requestUpdate()}isUpdating(){return!this.subview||this.subview.updating}_setSubView(){if(!this.view)return;const e=this.layer.renderer?.type;let i="imagery";if(e==="vector-field"?i="imageryVF":e==="flow"&&(i="flow"),this.subview){const{type:r}=this.subview;if(r===i)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=i==="imagery"?new rar({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):i==="imageryVF"?new oar({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new kPt({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),e.container.blendMode=this.layer.blendMode,e.container.effect=this.layer.effect)}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};E([N()],gee.prototype,"pixelData",null),E([N()],gee.prototype,"subview",void 0),gee=E([dt("esri.views.2d.layers.ImageryLayerView2D")],gee);const lar=Object.freeze(Object.defineProperty({__proto__:null,default:gee},Symbol.toStringTag,{value:"Module"}));function uar(t,e,i="nearest",r=!1){const n=!(r&&e.pixelType==="u8"),s=n?ds.FLOAT:ds.UNSIGNED_BYTE,o=e.pixels==null||e.pixels.length===0?null:n?e.getAsRGBAFloat():e.getAsRGBA(),a=t.capabilities.textureFloat?.textureFloatLinear,l={width:e.width,height:e.height,target:so.TEXTURE_2D,pixelFormat:gn.RGBA,internalFormat:t.type===bo.WEBGL2&&n?qs.RGBA32F:gn.RGBA,samplingMode:!a||i!=="bilinear"&&i!=="cubic"?In.NEAREST:In.LINEAR,dataType:s,wrapMode:ws.CLAMP_TO_EDGE,flipped:!1};return new Fs(t,l,o)}function GPt(t,e){const{spacing:i,offsets:r,coefficients:n,size:[s,o]}=e,a=i[0]>1,l={width:a?4*s:s,height:o,target:so.TEXTURE_2D,pixelFormat:gn.RGBA,internalFormat:t.type===bo.WEBGL2?qs.RGBA32F:gn.RGBA,dataType:ds.FLOAT,samplingMode:In.NEAREST,wrapMode:ws.CLAMP_TO_EDGE,flipped:!1},c=new Float32Array(a?s*o*16:2*r.length);if(a&&n!=null)for(let h=0,p=0;h{const n=e.get(r)||e.get(r+"[0]");n&&mar(t,r,i[r],n)})}function JU(t,e,i,r){i.length===r.length&&(r.some(n=>n==null)||i.some(n=>n==null)||i.forEach((n,s)=>{e.setUniform1i(n,s),t.bindTexture(r[s],s)}))}function mar(t,e,i,r){if(r===null||i==null)return!1;const{info:n}=r;switch(n.type){case S0.FLOAT:n.size>1?t.setUniform1fv(e,i):t.setUniform1f(e,i);break;case S0.FLOAT_VEC2:t.setUniform2fv(e,i);break;case S0.FLOAT_VEC3:t.setUniform3fv(e,i);break;case S0.FLOAT_VEC4:t.setUniform4fv(e,i);break;case S0.FLOAT_MAT3:t.setUniformMatrix3fv(e,i);break;case S0.FLOAT_MAT4:t.setUniformMatrix4fv(e,i);break;case S0.INT:n.size>1?t.setUniform1iv(e,i):t.setUniform1i(e,i);break;case S0.BOOL:t.setUniform1i(e,i?1:0);break;case S0.INT_VEC2:case S0.BOOL_VEC2:t.setUniform2iv(e,i);break;case S0.INT_VEC3:case S0.BOOL_VEC3:t.setUniform3iv(e,i);break;case S0.INT_VEC4:case S0.BOOL_VEC4:t.setUniform4iv(e,i);break;default:return!1}return!0}const gar={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 yar=class extends CS{constructor(e=null,i=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=i,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)}get processed(){return this._processed}set processed(e){this._processed=e,e||(qa(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||gar}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.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"?In.LINEAR:In.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid=e,this._transformGridTexture=qa(this._transformGridTexture)}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}_createTransforms(){return{dvs:Dl()}}setTransform(e){const i=iP(this.transforms.dvs),[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;dg(i,i,mp(r,n)),dg(i,i,mp(o/2,a/2)),wT(i,i,-l),dg(i,i,mp(-o/2,-a/2)),Vle(i,i,mp(o,a)),cv(this.transforms.dvs,e.displayViewMat3,i)}getTextures({forProcessing:e=!1,useProcessedTexture:i=!1}={}){const r=i?this._processedTexture??this._rasterTexture:this._rasterTexture,n=[],s=[];return r?i?(s.push(r),n.push("u_image"),this._colormapTexture&&(s.push(this._colormapTexture),n.push("u_colormap")),{names:n,textures:s}):(this._transformGridTexture&&(s.push(this._transformGridTexture),n.push("u_transformGrid")),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 i=this._isValidSource(this.source);i&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(e)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(e),this._rasterTexture&&(i?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=GPt(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(i=>i?.dispose()),e.length=0)}_createOrDestroyRasterTexture(e){const i=ve(this.source)?iae(this.source,this.bandIds):null;if(!this._isValidSource(i))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||!e.capabilities.textureFloat?.textureFloat;this._rasterTexture=uar(e,i,n,s),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdschanged(e){const i=this._rasterTextureBandIds;return!(i==null&&e==null||i&&e&&i.join("")===e.join(""))}_isValidSource(e){return ve(e)&&e.pixels?.length>0}_getTextureSamplingMethod(e){const{type:i,colormap:r}=this.symbolizerParameters,n=i==="lut"||i==="stretch"&&ve(r);return!this._supportsBilinearTexture||n||e!=="bilinear"&&e!=="cubic"?"nearest":"bilinear"}_updateColormapTexture(e){const i=this._colormap,r=this.symbolizerParameters.colormap;return r?i?r.length!==i.length||r.some((n,s)=>n!==i[s])?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=UPt(e,r),void(this._colormap=r)):void 0:(this._colormapTexture=UPt(e,r),void(this._colormap=r)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(e=!1){this._transformGridTexture&&(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 _ar(t){return ve(t.source)}function hke(t){const e=[];return t&&(e.push("applyProjection"),t.spacing[0]===1&&e.push("lookupProjection")),e}function zPt(t,e,i){const r=!i.capabilities.textureFloat?.textureFloatLinear,n=[];return t==="cubic"?n.push("bicubic"):t==="bilinear"&&(e?(n.push("bilinear"),n.push("nnedge")):r&&n.push("bilinear")),n}const bar={vsPath:"raster/common",fsPath:"raster/lut",attributes:new Map([["a_position",0],["a_texcoord",1]])};function war(t,e,i){const r=i?[]:hke(e.transformGrid);return{defines:r,program:t.painter.materialManager.getProgram(bar,r)}}function xar(t,e,i,r,n=!1){const{names:s,textures:o}=i.getTextures({useProcessedTexture:n});JU(t.context,e,s,o),BF(e,r,i.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",i.transforms.dvs);const{colormap:a,colormapOffset:l}=i.symbolizerParameters,c=cke(a,l);BF(e,r,c)}const Sar={createProgram:war,bindTextureAndUniforms:xar},Car={vsPath:"raster/common",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Tar(t,e,i){const{colormap:r}=e.symbolizerParameters,n=[...i?[]:hke(e.transformGrid),...zPt(e.interpolation,r!=null,t.context)];return r!=null&&n.push("applyColormap"),{defines:n,program:t.painter.materialManager.getProgram(Car,n)}}function Ear(t,e,i,r,n=!1){const{names:s,textures:o}=i.getTextures({useProcessedTexture:n});JU(t.context,e,s,o),BF(e,r,i.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",i.transforms.dvs);const a=i.symbolizerParameters,{colormap:l,colormapOffset:c}=a;if(l!=null){const p=cke(l,c);BF(e,r,p)}const h=par(a);BF(e,r,h)}const Iar={createProgram:Tar,bindTextureAndUniforms:Ear},Aar={vsPath:"raster/common",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Par(t,e,i){const{colormap:r}=e.symbolizerParameters,n=[...i?[]:hke(e.transformGrid),...zPt(e.interpolation,r!=null,t.context)];return e.isRendereredSource&&!i?n.push("noop"):r!=null&&n.push("applyColormap"),{defines:n,program:t.painter.materialManager.getProgram(Aar,n)}}function Oar(t,e,i,r,n=!1){const{names:s,textures:o}=i.getTextures({useProcessedTexture:n});JU(t.context,e,s,o),BF(e,r,i.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",i.transforms.dvs);const a=i.symbolizerParameters,{colormap:l,colormapOffset:c}=a;if(l!=null){const p=cke(l,c);BF(e,r,p)}const h=dar(a);BF(e,r,h)}const Rar={createProgram:Par,bindTextureAndUniforms:Oar},Uge=new Map;function Mar(t){return Uge.get(t)}Uge.set("lut",Sar),Uge.set("hillshade",Iar),Uge.set("stretch",Rar);const Dar=[1,1],Far=[2,0,0,0,2,0,-1,-1,0];function KE(t,e,i){const{context:r,rasterFunction:n,hasBranches:s}=t,{raster:o}=n.parameters,a=s?o?.id??-1:0,l=i.functionTextures[a]??i.rasterTexture;JU(r,e,["u_image"],[l])}function HPt(t,e,i){const{rasters:r}=t.rasterFunction.parameters;if(!r)return;if(r.length<2)return KE(t,e,i);const n=r.filter(s=>s.name!=="Constant").map(s=>s.id!=null&&s.name!=="Identity"?i.functionTextures[s.id]:i.rasterTexture);if(JU(t.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(h=>h.name!=="Constant"),c=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",c)}}}}function RS(t){t.setUniform2fv("u_coordScale",Dar),t.setUniformMatrix3fv("u_dvsMat3",Far)}const Lar={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/aspect",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Nar(t,e){return t.painter.materialManager.getProgram(Lar,[])}function kar(t,e,i){KE(t,e,i),RS(e);const{width:r,height:n,resolution:s}=i;e.setUniform2fv("u_srcImageSize",[r,n]),e.setUniform2fv("u_cellSize",[s,s])}const $ar={createProgram:Nar,bindTextureAndUniforms:kar},Bar={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/bandarithmetic",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Var(t,e){const{painter:i,rasterFunction:r}=t,{indexType:n}=r.parameters;return i.materialManager.getProgram(Bar,[n])}function jar(t,e,i){KE(t,e,i),RS(e);const{bandIndexMat3:r}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const Gar={createProgram:Var,bindTextureAndUniforms:jar},Uar={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/compositeband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function zar(t,e){return t.painter.materialManager.getProgram(Uar,[])}function Har(t,e,i){HPt(t,e,i),RS(e)}const War={createProgram:zar,bindTextureAndUniforms:Har},qar={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/convolution",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Yar(t,e){const{painter:i,rasterFunction:r}=t,{kernelRows:n,kernelCols:s}=r.parameters,o=[{name:"rows",value:n},{name:"cols",value:s}];return i.materialManager.getProgram(qar,o)}function Xar(t,e,i){KE(t,e,i),RS(e),e.setUniform2fv("u_srcImageSize",[i.width,i.height]);const{kernel:r,clampRange:n}=t.rasterFunction.parameters;e.setUniform1fv("u_kernel",r),e.setUniform2fv("u_clampRange",n)}const Kar={createProgram:Yar,bindTextureAndUniforms:Xar},Jar={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/extractband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Zar(t,e){return t.painter.materialManager.getProgram(Jar,[])}function Qar(t,e,i){KE(t,e,i),RS(e);const{bandIndexMat3:r}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const elr={createProgram:Zar,bindTextureAndUniforms:Qar},tlr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/local",attributes:new Map([["a_position",0],["a_texcoord",1]])},ilr=new Set(["sinh","cosh","tanh","asinh","acosh","atanh"]);function rlr(t){const{painter:e,rasterFunction:i}=t,{imageCount:r,operationName:n,rasters:s,isOutputRounded:o}=i.parameters;let a=n.toLowerCase();t.context.type===bo.WEBGL1&&ilr.has(a)&&(a=`polyfill${a}`);const l=[a];r===2&&l.push("twoImages");const c=s.filter(h=>h.name==="Constant");return c.length&&(l.push("oneConstant"),c.length===2&&l.push("twoConstant")),o&&l.push("roundOutput"),e.materialManager.getProgram(tlr,l)}function nlr(t,e,i){HPt(t,e,i),RS(e);const{domainRange:r}=t.rasterFunction.parameters;e.setUniform2fv("u_domainRange",r)}const slr={createProgram:rlr,bindTextureAndUniforms:nlr},olr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/mask",attributes:new Map([["a_position",0],["a_texcoord",1]])};function alr(t,e){const{painter:i,rasterFunction:r}=t,n=r.parameters.bandCount>1?["multiBand"]:[];return i.materialManager.getProgram(olr,n)}function llr(t,e,i){KE(t,e,i),RS(e);const{includedRanges:r,noDataValues:n}=t.rasterFunction.parameters;e.setUniform1fv("u_includedRanges",r),e.setUniform1fv("u_noDataValues",n)}const ulr={createProgram:alr,bindTextureAndUniforms:llr},clr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/ndvi",attributes:new Map([["a_position",0],["a_texcoord",1]])};function hlr(t,e){const{painter:i,rasterFunction:r}=t,n=r.parameters.scaled?["scaled"]:[];return i.materialManager.getProgram(clr,n)}function dlr(t,e,i){KE(t,e,i),RS(e);const{bandIndexMat3:r}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const plr={createProgram:hlr,bindTextureAndUniforms:dlr},flr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/remap",attributes:new Map([["a_position",0],["a_texcoord",1]])};function mlr(t,e){return t.painter.materialManager.getProgram(flr,[])}function glr(t,e,i){KE(t,e,i),RS(e);const{noDataRanges:r,rangeMaps:n,allowUnmatched:s,clampRange:o}=t.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 ylr={createProgram:mlr,bindTextureAndUniforms:glr},vlr={vsPath:"raster/common",fsPath:"raster/reproject",attributes:new Map([["a_position",0],["a_texcoord",1]])};function _lr(t,e){const{painter:i}=t,r=[],n=!t.context.capabilities.textureFloat?.textureFloatLinear,{interpolation:s,transformGrid:o}=e;return s==="cubic"?r.push("bicubic"):s==="bilinear"&&n&&r.push("bilinear"),o&&(r.push("applyProjection"),o.spacing[0]===1&&r.push("lookupProjection")),i.materialManager.getProgram(vlr,r)}function blr(t,e,i){const{names:r,textures:n}=i.getTextures({forProcessing:!0});JU(t.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}=i;e.setUniform2fv("u_srcImageSize",[a.width,a.height]),e.setUniform2fv("u_targetImageSize",[s,o]),e.setUniform2fv("u_transformSpacing",l?l.spacing:eP),e.setUniform2fv("u_transformGridSize",l?l.size:eP)}const wlr={createProgram:_lr,bindTextureAndUniforms:blr},xlr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/slope",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Slr(t,e){const{painter:i,rasterFunction:r}=t,{slopeType:n}=r.parameters,s=n==="percent-rise"?["percentRise"]:[];return i.materialManager.getProgram(xlr,s)}function Clr(t,e,i){KE(t,e,i),RS(e);const{width:r,height:n,resolution:s}=i,{zFactor:o,slopeType:a,pixelSizePower:l,pixelSizeFactor:c}=t.rasterFunction.parameters;e.setUniform2fv("u_srcImageSize",[r,n]),e.setUniform2fv("u_cellSize",[s,s]),e.setUniform1f("u_zFactor",o),e.setUniform1f("u_pixelSizePower",a==="adjusted"?l:0),e.setUniform1f("u_pixelSizeFactor",a==="adjusted"?c:0)}const Tlr={createProgram:Slr,bindTextureAndUniforms:Clr},Elr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Ilr(t,e){const{useGamma:i,bandCount:r,isOutputRounded:n}=t.rasterFunction.parameters,s=[];return i&&s.push("useGamma"),r>1&&s.push("multiBand"),n&&s.push("roundOutput"),t.painter.materialManager.getProgram(Elr,s)}function Alr(t,e,i){KE(t,e,i),RS(e);const{width:r,height:n}=i,s=t.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 Plr={createProgram:Ilr,bindTextureAndUniforms:Alr},vx=new Map;function WPt(t,e,i){const r={width:e,height:i,target:so.TEXTURE_2D,pixelFormat:gn.RGBA,internalFormat:t.type===bo.WEBGL2?qs.RGBA32F:gn.RGBA,samplingMode:In.NEAREST,dataType:ds.FLOAT,isImmutable:t.type===bo.WEBGL2,wrapMode:ws.CLAMP_TO_EDGE,flipped:!1};return new Fs(t,r)}function Olr(t,e,i,r){const{context:n,requestRender:s,allowDelayedRender:o}=t,a=r.createProgram(t,i);if(o&&ve(s)&&!a.compiled)return s(),null;const{width:l,height:c}=i;return n.bindFramebuffer(e),n.setViewport(0,0,l,c),n.useProgram(a),a}function Rlr(t){return vx.get(t.toLowerCase())}function Mlr(t,e,i,r){const n=t.rasterFunction.name.toLowerCase(),s=n==="reproject"?wlr:Rlr(n);if(s==null)return;const o=Olr(t,i,r,s);if(!o)return;s.bindTextureAndUniforms(t,o,r),e.draw();const{width:a,height:l}=r,c=WPt(t.context,a,l);if(i.copyToTexture(0,0,a,l,0,0,c),n==="reproject")r.rasterTexture=c,r.projected=!0;else{const h=t.hasBranches?t.rasterFunction.id:0;r.functionTextures[h]=c}}vx.set("aspect",$ar),vx.set("bandarithmetic",Gar),vx.set("compositeband",War),vx.set("convolution",Kar),vx.set("extractband",elr),vx.set("local",slr),vx.set("mask",ulr),vx.set("ndvi",plr),vx.set("remap",ylr),vx.set("slope",Tlr),vx.set("stretch",Plr);let Dlr=class extends q_{constructor(){super(...arguments),this.name="raster",this._quad=null,this._rendererUniformInfos=new Map,this._fbo=null}dispose(){qa(this._quad),qa(this._fbo)}prepareState(e){const{context:i,renderPass:r}=e,n=r==="raster";i.setBlendingEnabled(!n),i.setBlendFunctionSeparate(Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA,Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA),i.setColorMask(!0,!0,!0,!0),i.setStencilWriteMask(0),i.setStencilTestEnabled(!n)}draw(e,i){if(!_ar(i)||i.suspended)return;const{renderPass:r}=e;if(r!=="raster-bitmap")return r==="raster"?this._process(e,i):void this._drawBitmap(e,i,!0);this._drawBitmap(e,i)}_process(e,i){const{rasterFunction:r}=e,n=r.name==="Reproject";if(!(n?!(i.rasterTexture&&i.projected):!i.processed))return;const{timeline:s,context:o}=e;s.begin(this.name);const a=o.getBoundFramebufferObject(),l=o.getViewport();n||(i.processedTexture=qa(i.processedTexture)),o.setStencilFunction(kl.EQUAL,i.stencilRef,255),i.updateTexture(e),this._initQuad(o);const{isStandardRasterTileSize:c,fbo:h}=this._getRasterFBO(o,i.width,i.height);Mlr(e,this._quad,h,i),c||h.dispose(),o.bindFramebuffer(a),o.setViewport(l.x,l.y,l.width,l.height),s.end(this.name)}_drawBitmap(e,i,r=!1){const{timeline:n,context:s}=e;if(n.begin(this.name),s.setStencilFunction(kl.EQUAL,i.stencilRef,255),i.updateTexture(e),r&&!i.processedTexture){if(i.updateProcessedTexture(),!i.processedTexture)return void n.end(this.name);i.processed=!0}this._initBitmapCommonUniforms(i);const o=i.symbolizerParameters.type,a=Mar(o),{requestRender:l,allowDelayedRender:c}=e,{defines:h,program:p}=a.createProgram(e,i,r);if(c&&ve(l)&&!p.compiled)return void l();s.useProgram(p);const y=this._getUniformInfos(o,s,p,h);this._quad||(this._quad=new hx(s,[0,0,1,0,0,1,1,1])),a.bindTextureAndUniforms(e,p,i,y,r),this._quad.draw(),n.end(this.name)}_initBitmapCommonUniforms(e){if(!e.commonUniforms){const i=har(1,[0,0]),{transformGrid:r,width:n,height:s}=e,o=car(r,[n,s],[e.source.width,e.source.height],1,!1);e.commonUniforms={...i,...o,u_coordScale:e.coordScale}}}_getRasterFBO(e,i,r){const n=i===Pc||r===Pc;return n?(this._fbo||(this._fbo=this._createNewFBO(e,i,r)),{isStandardRasterTileSize:n,fbo:this._fbo}):{isStandardRasterTileSize:n,fbo:this._createNewFBO(e,i,r)}}_createNewFBO(e,i,r){const n=WPt(e,i,r);return new ad(e,{colorTarget:Ah.TEXTURE,depthStencilTarget:Tl.NONE,width:i,height:r},n)}_initQuad(e){this._quad||(this._quad=new hx(e,[0,0,1,0,0,1,1,1]))}_getUniformInfos(e,i,r,n){const s=n.length>0?e+"-"+n.join("-"):e;if(this._rendererUniformInfos.has(s))return this._rendererUniformInfos.get(s);const o=far(i,r);return this._rendererUniformInfos.set(s,o),o}},Flr=class extends RU{constructor(e,i,r,n,s,o,a=null){super(e,i,r,n,s,o),this.bitmap=null,this.bitmap=new yar(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.dvs=this.transforms.dvs}_createTransforms(){return{dvs:Dl(),tileMat3:Dl()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap.stage=null}},Llr=class extends aee{constructor(){super(...arguments),this.isCustomTilingScheme=!1}createTile(e){const i=this._getTileBounds(e),[r,n]=this._tileInfoView.tileInfo.size,s=this._tileInfoView.getTileResolution(e.level);return new Flr(e,s,i[0],i[3],r,n)}prepareRenderPasses(e){const i=e.registerRenderPass({name:"imagery (tile)",brushes:[Dlr],target:()=>this.children.map(r=>r.bitmap),drawPhase:mo.MAP});return[...super.prepareRenderPasses(e),i]}doRender(e){if(!this.visible||e.drawPhase!==mo.MAP)return;const{rasterFunctionChain:i}=this;if(!i)return e.renderPass="raster-bitmap",void super.doRender(e);const[r,n]=this._tileInfoView.tileInfo.size;if(e.renderPass="raster",e.rasterFunction={name:"Reproject",parameters:{targetImageSize:[r,n]},pixelType:"f32",id:0,isNoopProcess:!1},super.doRender(e),i?.functions.length){const{functions:s,hasBranches:o}=i;for(let a=0;a{const i=Array.from(e),r=Date.now();for(let n=0;n=e.size)return;const i=Array.from(e);for(let r=0;rr!=null)||RO.delete(t))}function $lr(t,e,i){const r=RO.get(t);if(!r)return e==null?VF.decreaseRefCount(t,i):0;if(e==null||r[e]==null)return VF.decreaseRefCount(t,i);const n=r[e]?.cache,s=n?.get(i);if(n&&s){if(s.refCount--,s.refCount===0){n.delete(i);for(let o=0;oo.isResolved=!0).catch(()=>o.isRejected=!0),s[e]?.cache.set(i,o)}function Blr(t,e,i){const r=RO.get(t);r?e!=null&&r[e]!=null?r[e]?.cache.delete(i):VF.deleteBlock(t,i):e==null&&VF.deleteBlock(t,i)}function Vlr(t,e){const i=RO.get(t);return i?i[e]??null:null}function KPt(t,e,i,r,n,s,o=null){const a=Vlr(t,e);if(!a)return;const l=a.extent,{cache:c,rasterInfo:h}=a;if(l&&l.xmin===i.xmin&&l.xmax===i.xmax&&l.ymin===i.ymin&&l.ymax===i.ymax)return;r=r??0;const p=i.clone().normalize(),{spatialReference:y,transform:v}=h,x=new Set;for(let I=0;I0?X.pyramidBlockWidth:X.blockWidth,xe=j>0?X.pyramidBlockHeight:X.blockHeight,Pe=1,ke=Math.max(0,Math.floor(ie.x/_e)-Pe),J=Math.max(0,Math.floor(ie.y/xe)-Pe),de=Math.floor((ie.x+ce-1)/_e)+Pe,Se=Math.floor((ie.y+he-1)/xe)+Pe;for(let Ie=J;Ie<=Se;Ie++)for(let Re=ke;Re<=de;Re++)x.add(`${j}/${Ie}/${Re}`)}c.forEach((I,P)=>{if(!x.has(P)){const F=c.get(P);(F==null||F.isResolved||F.isRejected)&&c.delete(P)}}),a.extent={xmin:i.xmin,ymin:i.ymin,xmax:i.xmax,ymax:i.ymax}}const jlr=[0,0];let Ov=class extends YC{constructor(){super(...arguments),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._rasterFunctionState="na",this._globalUpdateRequested=!1,this.attached=!1,this.timeExtent=null,this.redrawOrRefetch=q0(async(e={})=>{if(!this.previousLOD||this.layerView.suspended)return;const i=this._rasterFunctionState;e.reprocess&&(await this.updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters());const r=this._rasterFunctionState,{type:n}=this;return e.refetch||n!=="raster"&&e.reprocess||r==="cpu"||i==="cpu"?this.updatingHandles.addPromise(this.doRefresh()):this.updatingHandles.addPromise(this._redrawImage(e.signal))})}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")==null||this._get("useProgressiveUpdate")}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const i=this._getCacheSize(e);this._tileStrategy=new uX({cachePolicy:"purge",acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),cacheSize:i,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:i,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=i.toJSON?i:Ar.fromJSON(i);KPt(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._fetchQueue?.updating||this._globalUpdateRequested||!(!this.updatingHandles||!this.updatingHandles.updating)}attach(){ST("2d").supportsTextureFloat||(this.useWebGLForProcessing=!1),this._initializeTileInfo(),this._tileInfoView=new CN(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new aV({tileInfoView:this._tileInfoView,concurrency:e,process:(r,n)=>this._fetchTile1(r,n)});const i=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new uX({cachePolicy:"purge",acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),cacheSize:i,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,qPt(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(e){const i=this.container.createTile(e);return this._enqueueTileFetch(i),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,i}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 i=e==null||e.join(",")===this._tileInfoView.tileInfo.size.join(",");if(i&&ve(this._emptyTilePixelBlock))return this._emptyTilePixelBlock;e=e||this._tileInfoView.tileInfo.size;const[r,n]=e,s=new dn({width:r,height:n,pixels:[new Uint8Array(r*n)],mask:new Uint8Array(r*n),pixelType:"u8"});return i&&(this._emptyTilePixelBlock=s),s}_getBandIds(){if(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain)return this.layer.bandIds;const{bandIds:e,raster:i}=this.layer,r="rasterFunction"in i?i.rasterFunction.rawInputBandIds:null;return e?.length&&r?.length&&i.rasterInfo.bandCount!==1?e.map(n=>r[Math.min(n,r.length-1)]):e||r}updateRasterFunctionParameters(){}_fetchTile1(e,i){const r=ve(i)?i.signal:null,n=this.canUseWebGLForProcessing(),{layerView:s}=this,{tileInfo:o}=s,a=!o.isWrappable&&ve(Av(s.view.spatialReference)),l=n&&this.layer.raster.hasUniqueSourceStorageInfo,c={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,c)}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const{layerView:e}=this,i=e.view.spatialReference,r=new er({x:e.fullExtent.xmin,y:e.fullExtent.ymax,spatialReference:i});if(this._canUseLayerLODs()){const{lods:l}=this.layer.tileInfo,c=l.map(({scale:y})=>y),h=Ul.create({spatialReference:i,size:Pc,scales:c}),p=i.isGeographic?.01*1e-5:.01;if(this._isCustomTilingScheme=Math.abs(h.origin.x-r.x)>p,(h.origin.x===0||h.origin.x>r.x)&&(h.origin=r),!this._isCustomTilingScheme){const y=Ul.create({spatialReference:i,size:Pc}).lods.map(({scale:v})=>v);this._isCustomTilingScheme=c.some(v=>!y.some(x=>Math.abs(x-v)<.001))}return e.set("tileInfo",h),void(this._srcResolutions=l.map(({resolution:y})=>({x:y,y})))}const{scales:n,srcResolutions:s,isCustomTilingScheme:o}=w8i(this.layer.rasterInfo,i,Pc),a=Ul.create({spatialReference:i,size:Pc,scales:n});(a.origin.x===0||a.origin.x>r.x)&&(a.origin=r),this._isCustomTilingScheme=o,e.set("tileInfo",a),this._srcResolutions=s??[]}_canUseLayerLODs(){const{layer:e,layerView:i}=this;if(e.raster.tileType!=="Map")return!1;const{lods:r}=e.tileInfo,n=i.view.constraints?.effectiveLODs;if(!(n?.length===r.length&&n.every(({scale:o},a)=>Math.abs(o-r[a].scale)<.001)))return!1;const s=[];for(let o=0;oo!==o[0])}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.rasterInfo.storageInfo,i=e[e.length-1];return(i.maxCol-i.minCol+1)*(i.maxRow-i.minRow+1)>64?2:10}async _enqueueTileFetch(e,i){this.updatingHandles.addPromise(this._enqueueTileFetch1(e,i))}async _enqueueTileFetch1(e,i){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){ys(l)&&Oi.getLogger(this.declaredClass).error(l)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&this.type!=="rasterVF"||this.layerView.hasTilingEffects||this._symbolizerParams!=null||this._updateSymbolizerParams();const o=this._tileInfoView.getTileCoords(jlr,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){ys(r)||Oi.getLogger(this.declaredClass).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 i=this.container.children.map(async r=>this.updateTileSymbolizerParameters(r,{local:this._symbolizerParams,global:this._globalSymbolizerParams}));await Ru(i),this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const i={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,i);if(!r||!r.pixelBlock)return;const{resolution:n}=this.previousLOD,s=this._getBandIds(),o=this.layer.symbolizer.generateWebGLParameters({pixelBlock:iae(r.pixelBlock,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,i=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:e,y:e},bandIds:i})}_updateBlockCacheRegistry(e=!1){const{layer:i,layerView:r}=this,{url:n,raster:s}=i,{multidimensionalDefinition:o}=i.normalizeRasterFetchOptions({multidimensionalDefinition:i.multidimensionalDefinition,timeExtent:r.timeExtent}),a=s.rasterInfo.multidimensionalInfo?s.getSliceIndex(o):null,l=dke(n,a);if(l!==this._blockCacheRegistryUrl){if(this._blockCacheRegistryUrl!=null&&qPt(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=klr(l,s.rasterInfo),e){const{view:c}=r,h=this._tileInfoView.getClosestInfoForScale(c.scale),p=this._srcResolutions[h.level];KPt(l,this._blockCacheRegistryId,c.extent,c.resolution,p,s.ioConfig.sampling)}this._blockCacheRegistryUrl=l}}async doRefresh(){if(!this.attached)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.tiles.forEach(i=>e.push(this._enqueueTileFetch(i))),await Ru(e)}};E([N()],Ov.prototype,"_fetchQueue",void 0),E([N()],Ov.prototype,"_globalUpdateRequested",void 0),E([N()],Ov.prototype,"attached",void 0),E([N()],Ov.prototype,"container",void 0),E([N()],Ov.prototype,"layer",void 0),E([N()],Ov.prototype,"layerView",void 0),E([N()],Ov.prototype,"type",void 0),E([N()],Ov.prototype,"useWebGLForProcessing",null),E([N()],Ov.prototype,"useProgressiveUpdate",null),E([N()],Ov.prototype,"timeExtent",void 0),E([N()],Ov.prototype,"updating",null),Ov=E([dt("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],Ov);let ZU=class extends Ov{constructor(){super(...arguments),this.type="raster"}attach(){super.attach(),this.container=new Llr(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}canUseWebGLForProcessing(){return this.useWebGLForProcessing&&this.layer.symbolizer.canRenderInWebGL&&!(this.layer.interpolation==="majority"&&QAt(this.layer))}fetchTile(e,i){return this.layer.fetchTile(e.level,e.row,e.col,i)}updateRasterFunctionParameters(){const{raster:e,type:i}=this.layer,{container:r}=this;if(e.datasetFormat!=="Function"||i==="wcs")return r.rasterFunctionChain=null,r.children.forEach(y=>{const{bitmap:v}=y;v&&(v.suspended=!0,v.processed=!1,v.projected&&(v.invalidateTexture(),v.rasterTexture=null))}),void(this._rasterFunctionState="na");const n=this._rasterFunctionState,{rasterFunction:s,primaryRasters:o}=e,a=s.supportsGPU&&(!o||o.rasters.length<=1),l=a?s.getFlatWebGLFunctionChain():null,{renderer:c}=this.layer,h=!a||!l?.functions.length||c.type==="raster-stretch"&&c.dynamicRangeAdjustment||!this.canUseWebGLForProcessing();r.rasterFunctionChain=h?null:l;const p=s==null?"na":r.rasterFunctionChain?"gpu":"cpu";r.children.forEach(y=>{const{bitmap:v}=y;v&&(v.suspended=n!==p,v.processed=!1,v.processedTexture=null)}),this._rasterFunctionState=p}async updateTileSource(e,i){const r=this._getBandIds(),n=this._getLayerInterpolation(),s=this.canUseWebGLForProcessing(),{source:o,globalSymbolizerParams:a,suspended:l,coords:c,resolution:h}=i,p=this.layerView.hasTilingEffects?a:i.symbolizerParams,{bitmap:y}=e;if([y.x,y.y]=c,y.resolution=h,o&&ve(o)&&ve(o.pixelBlock)){const v={extent:o.extent,pixelBlock:o.pixelBlock};if(y.rawPixelData=v,s)y.source=o.pixelBlock,y.isRendereredSource=!1;else{const x=await this.layer.applyRenderer(v,a?.type==="stretch"?a:void 0);y.source=x,y.isRendereredSource=!0}y.symbolizerParameters=s?p:null,s?y.transformGrid||(y.transformGrid=o.transformGrid):y.transformGrid=null}else{const v=this.createEmptyTilePixelBlock();y.source=v,y.symbolizerParameters=s?p:null,y.transformGrid=null}y.bandIds=s?r:null,y.width=this._tileInfoView.tileInfo.size[0],y.height=this._tileInfoView.tileInfo.size[1],y.interpolation=n,y.suspended=l,y.invalidateTexture()}async updateTileSymbolizerParameters(e,i){const{local:r,global:n}=i,s=this._getBandIds(),o=this._getLayerInterpolation(),a=this.canUseWebGLForProcessing(),{bitmap:l}=e,{rawPixelData:c}=l;!a&&ve(c)?(l.source=await this.layer.applyRenderer(c,n?.type==="stretch"?n:void 0),l.isRendereredSource=!0):(l.isRendereredSource&&ve(c)&&(l.source=c.pixelBlock),l.isRendereredSource=!1),l.symbolizerParameters=a?this.layerView.hasTilingEffects?n:r:null,l.bandIds=a?s:null,l.interpolation=o,l.suspended=!1}_getLayerInterpolation(){const e=this.layer.renderer.type;if(e==="raster-colormap"||e==="unique-value"||e==="class-breaks")return"nearest";const{interpolation:i}=this.layer,{renderer:r}=this.layer;return r.type==="raster-stretch"&&r.colorRamp!=null?i==="bilinear"||i==="cubic"?"bilinear":"nearest":i}};E([N()],ZU.prototype,"container",void 0),E([N()],ZU.prototype,"layer",void 0),E([N()],ZU.prototype,"type",void 0),ZU=E([dt("esri.views.2d.layers.imagery.ImageryTileView2D")],ZU);const Glr=ZU;let Ulr=class extends RU{constructor(e,i,r,n,s,o,a=null){super(e,i,r,n,s,o),this.tileData=new jPt(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{dvs:Dl(),tileMat3:Dl()}}setTransform(e){super.setTransform(e);const i=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:c}=this.tileData.symbolizerParameters,h=Math.round((this.width-this.tileData.offset[0])/c)*c,p=Math.round((this.height-this.tileData.offset[1])/c)*c,y=h/this.rangeX*i,v=p/this.rangeY*i;wN(r,y,0,0,0,v,0,a,l,1),cv(this.transforms.dvs,e.displayViewMat3,r),this.tileData.transforms.dvs=this.transforms.dvs}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}},zlr=class extends aee{constructor(){super(...arguments),this.isCustomTilingScheme=!1,this.symbolTypes=["triangle"]}createTile(e){const i=this._tileInfoView.getTileBounds(Mo(),e),[r,n]=this._tileInfoView.tileInfo.size,s=this._tileInfoView.getTileResolution(e.level);return new Ulr(e,s,i[0],i[3],r,n)}prepareRenderPasses(e){const i=e.registerRenderPass({name:"imagery (vf tile)",brushes:[VPt],target:()=>this.children.map(r=>r.tileData),drawPhase:mo.MAP});return[...super.prepareRenderPasses(e),i]}doRender(e){this.visible&&e.drawPhase===mo.MAP&&this.symbolTypes.forEach(i=>{e.renderPass=i,super.doRender(e)})}},QU=class extends Ov{constructor(){super(...arguments),this._handle=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(e,i){i={...i,interpolation:"nearest",requestProjectedLocalDirections:!0};const r=await this.layer.fetchTile(e.level,e.row,e.col,i);return this.layer.rasterInfo.dataType==="vector-magdir"&&r?.pixelBlock&&(r.pixelBlock=await this.layer.convertVectorFieldData(r.pixelBlock,i)),r}updateTileSource(e,i){const r=i.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}=i;if(n.offset=this._getTileSymbolOffset(n.key,s),ve(o)&&ve(o.pixelBlock)){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[0]-n.offset[0])/s),Math.round((this._tileInfoView.tileInfo[1]-n.offset[1])/s)],l=this.createEmptyTilePixelBlock(a);n.source=l,n.symbolizerParameters=r}return n.invalidateVAO(),Promise.resolve()}updateTileSymbolizerParameters(e,i){const r=i.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 ve(a)&&o!==n&&(s.source=this._sampleVectorFieldData(a,s.symbolizerParameters,s.offset)),Promise.resolve()}attach(){super.attach(),this.container=new zlr(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=sr(()=>this.layer.renderer,e=>this._updateSymbolType(e))}detach(){super.detach(),this.container.removeAllChildren(),this._handle?.remove(),this._handle=null,this.container=null}_getTileSymbolOffset(e,i){const r=e.col*this._tileInfoView.tileInfo.size[0]%i,n=e.row*this._tileInfoView.tileInfo.size[1]%i;return[r>i/2?i-r:-r,n>i/2?i-n:-n]}_sampleVectorFieldData(e,i,r){const{symbolTileSize:n}=i;return nXt(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"])}};E([N()],QU.prototype,"container",void 0),E([N()],QU.prototype,"layer",void 0),E([N()],QU.prototype,"type",void 0),QU=E([dt("esri.views.2d.layers.imagery.VectorFieldTileView2D")],QU);const Hlr=QU,Wlr=t=>{let e=class extends t{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this._getfullExtent()}_getfullExtent(){return this.projectFullExtent(this.view.spatialReference)}get hasTilingEffects(){return this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment}get datumTransformation(){return p1t(this.layer.fullExtent,this.view.spatialReference,!0)}supportsSpatialReference(i){return!!this.projectFullExtent(i)}projectFullExtent(i){const r=this.layer.fullExtent,n=p1t(r,i,!1);return eF(r,i,n)}async fetchPopupFeatures(i,r){const{layer:n}=this;if(!i)throw new st("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:n});const{popupEnabled:s}=n,o=NF(n,r);if(!s||lt(o))throw new st("imageryTileLayerView:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:s,popupTemplate:o});const a=[],{value:l,magdirValue:c}=await n.identify(i,{timeExtent:this.timeExtent});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};p["Raster.ServicePixelValue"]=h;const y=n.rasterInfo.attributeTable;if(ve(y)){const{fields:I,features:P}=y,F=I.find(({name:j})=>j.toLowerCase()==="value"),k=F?P.find(j=>String(j.attributes[F.name])===h):null;if(k)for(const j in k.attributes)k.attributes.hasOwnProperty(j)&&(p[this._rasterFieldPrefix+j]=k.attributes[j])}const v=n.rasterInfo.dataType;v!=="vector-magdir"&&v!=="vector-uv"||(p["Raster.Magnitude"]=c?.[0],p["Raster.Direction"]=c?.[1]);const x=new io(this.fullExtent.clone(),null,p);x.layer=n,x.sourceLayer=x.layer,a.push(x)}return a}};return E([N()],e.prototype,"layer",void 0),E([N(j9)],e.prototype,"timeExtent",void 0),E([N()],e.prototype,"view",void 0),E([N()],e.prototype,"fullExtent",null),E([N()],e.prototype,"tileInfo",void 0),E([N({readOnly:!0})],e.prototype,"hasTilingEffects",null),E([N()],e.prototype,"datumTransformation",null),e=E([dt("esri.views.layers.ImageryTileLayerView")],e),e};let e7=class extends Wlr(LF(wy(xy))){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)}update(e){this.subview?.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([sr(()=>{const{layer:e}=this;return{bandIds:e.bandIds,renderer:e.renderer,interpolation:e.interpolation,multidimensionalDefinition:e.multidimensionalDefinition,rasterFunction:e.type==="imagery-tile"?e.rasterFunction:null}},(e,i)=>{const r=e.interpolation!==i?.interpolation&&(e.interpolation==="majority"||i?.interpolation==="majority")&&QAt(this.layer),n=e.renderer!==i?.renderer&&i?.renderer?.type!==e.renderer?.type;n&&this._updateSubview();const s=e.multidimensionalDefinition!==i?.multidimensionalDefinition,o=e.rasterFunction!==i?.rasterFunction,a=o&&!this._useWebGLForProcessing,l=s||r||n||a;this.subview.redrawOrRefetch({refetch:l,reprocess:o}).catch(c=>{ys(c)||Oi.getLogger(this.declaredClass).error(c)}),this.notifyChange("updating")}),sr(()=>this.layer.blendMode??"normal",e=>{this.subview.container.blendMode=e},Wh),sr(()=>this.layer.effect??null,e=>{this.subview.container.effect=e},Wh),sr(()=>this.layer.multidimensionalSubset??null,(e,i)=>{const{multidimensionalDefinition:r}=this.layer;ve(r)&&dY(r,e)!==dY(r,i)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(n=>{ys(n)||Oi.getLogger(this.declaredClass).error(n)}),this.notifyChange("updating"))},qu),sr(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{ys(e)||Oi.getLogger(this.declaredClass).error(e)})},Yo)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}async hitTest(e,i){return[{type:"graphic",layer:this.layer,mapPoint:e,graphic:new io({attributes:{},geometry:e.clone()})}]}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const e=this.layer.renderer.type==="vector-field"?"rasterVF":this.layer.renderer.type==="flow"?"flow":"raster";if(this.subview){if(this.subview.type===e)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:i}=this;let r;if(r=e==="rasterVF"?new Hlr({layer:i,layerView:this}):e==="flow"?new kPt({layer:i,layerView:this}):new Glr({layer:i,layerView:this}),"useWebGLForProcessing"in r&&(r.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in r&&(r.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in r){const{subview:n}=this;r.previousLOD=n&&"previousLOD"in n?n.previousLOD:null}this._attachSubview(r),this.subview=r,this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0),e.container.blendMode=this.layer.blendMode,e.container.effect=this.layer.effect)}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};E([N()],e7.prototype,"subview",void 0),E([N()],e7.prototype,"useWebGLForProcessing",null),E([N()],e7.prototype,"useProgressiveUpdate",null),e7=E([dt("esri.views.2d.layers.ImageryTileLayerView2D")],e7);const JPt=Object.freeze(Object.defineProperty({__proto__:null,default:e7},Symbol.toStringTag,{value:"Module"})),qlr={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function pke(t){const e=t.folders||[],i=e.slice(),r=new Map,n=new Map,s=new Map,o=new Map,a=new Map,l={esriGeometryPoint:n,esriGeometryPolyline:s,esriGeometryPolygon:o};(t.featureCollection&&t.featureCollection.layers||[]).forEach(h=>{const p=gi(h);p.featureSet.features=[];const y=h.featureSet.geometryType;r.set(y,p);const v=h.layerDefinition.objectIdField;y==="esriGeometryPoint"?mke(n,v,h.featureSet.features):y==="esriGeometryPolyline"?mke(s,v,h.featureSet.features):y==="esriGeometryPolygon"&&mke(o,v,h.featureSet.features)}),t.groundOverlays&&t.groundOverlays.forEach(h=>{a.set(h.id,h)}),e.forEach(h=>{h.networkLinkIds.forEach(p=>{const y=Xlr(p,h.id,t.networkLinks);y&&i.push(y)})}),i.forEach(h=>{if(h.featureInfos){h.points=gi(r.get("esriGeometryPoint")),h.polylines=gi(r.get("esriGeometryPolyline")),h.polygons=gi(r.get("esriGeometryPolygon")),h.mapImages=[];for(const p of h.featureInfos)switch(p.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const y=l[p.type].get(p.id);y&&h[qlr[p.type]].featureSet.features.push(y);break}case"GroundOverlay":{const y=a.get(p.id);y&&h.mapImages.push(y);break}}h.fullExtent=yke([h])}});const c=yke(i);return{folders:e,sublayers:i,extent:c}}function fke(t,e,i,r){const n=Ho&&Ho.findCredential(t);t=zy(t,{token:n&&n.token});const s=pa.kmlServiceUrl;return ur(s,{query:{url:t,model:"simple",folders:"",refresh:i!==0||void 0,outSR:JSON.stringify(e)},responseType:"json",signal:r})}function ZPt(t,e,i=null,r=[]){const n=[],s={},o=e.sublayers,a=e.folders.map(l=>l.id);return o.forEach(l=>{const c=new t;if(i?c.read(l,i):c.read(l),r.length&&a.includes(c.id)&&(c.visible=r.includes(c.id)),s[l.id]=c,l.parentFolderId!=null&&l.parentFolderId!==-1){const h=s[l.parentFolderId];h.sublayers||(h.sublayers=[]),h.sublayers?.unshift(c)}else n.unshift(c)}),n}function mke(t,e,i){i.forEach(r=>{t.set(r.attributes[e],r)})}function Ylr(t,e){let i;return e.some(r=>r.id===t&&(i=r,!0)),i}function Xlr(t,e,i){const r=Ylr(t,i);return r&&(r.parentFolderId=e,r.networkLink=r),r}async function gke(t){const e=tc.fromJSON(t.featureSet).features,i=t.layerDefinition,r=PR(i.drawingInfo.renderer),n=wh.fromJSON(t.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 yke(t){const e=iw(d9),i=iw(d9);for(const r of t){if(r.polygons&&r.polygons.featureSet&&r.polygons.featureSet.features)for(const n of r.polygons.featureSet.features)Tne(e,n.geometry),AW(i,e);if(r.polylines&&r.polylines.featureSet&&r.polylines.featureSet.features)for(const n of r.polylines.featureSet.features)Tne(e,n.geometry),AW(i,e);if(r.points&&r.points.featureSet&&r.points.featureSet.features)for(const n of r.points.featureSet.features)Tne(e,n.geometry),AW(i,e);if(r.mapImages)for(const n of r.mapImages)Tne(e,n.extent),AW(i,e)}return jVt(i,d9)?void 0:{xmin:i[0],ymin:i[1],zmin:i[2],xmax:i[3],ymax:i[4],zmax:i[5],spatialReference:hr.WGS84}}let QPt=class F3{constructor(e){if(this._ownsRctx=!1,e)this._ownsRctx=!1,this._rctx=e;else{if(F3._instance)return F3._instanceRefCount++,F3._instance;F3._instanceRefCount=1,F3._instance=this,this._ownsRctx=!0;const n=document.createElement("canvas").getContext("webgl");n.getExtension("OES_texture_float"),this._rctx=new zIt(n,{})}const i={applyProjection:!0,bilinear:!1,bicubic:!1},r=Z5e("raster/reproject","raster/reproject",new Map([["a_position",0]]),i);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 hx(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(e,i,r=!1){const n=cp(e.extent,i),s=new er({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}=WJ(s,i,e.extent);let l=(o+a)/2;const c=Math.round((n.xmax-n.xmin)/l),h=Math.round((n.ymax-n.ymin)/l);l=(n.width/c+n.height/h)/2;const p=new er({x:l,y:l,spatialReference:n.spatialReference}),y=T4e({projectedExtent:n,srcBufferExtent:e.extent,pixelSize:p,hasWrapAround:!0,spacing:[16,16]}),v=GPt(this._rctx,y),x=new Fs(this._rctx,{width:c,height:h,pixelFormat:gn.RGBA,dataType:ds.UNSIGNED_BYTE,wrapMode:ws.CLAMP_TO_EDGE,samplingMode:In.LINEAR,hasMipmap:!1}),I=new ad(this._rctx,{colorTarget:Ah.TEXTURE,depthStencilTarget:Tl.NONE,width:c,height:h},x);this._rctx.bindFramebuffer(I),this._rctx.setViewport(0,0,c,h),this._rctx.useProgram(this._program),this._rctx.bindTexture(e.texture,0),this._rctx.bindTexture(v,1),this._quad.bind();const{width:P=0,height:F=0}=e.texture.descriptor;if(this._program.setUniform2f("u_srcImageSize",P,F),this._program.setUniform2fv("u_transformSpacing",y.spacing),this._program.setUniform2fv("u_transformGridSize",y.size),this._program.setUniform2f("u_targetImageSize",c,h),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),v.dispose(),r){const{width:k=0,height:j=0}=I.descriptor,V=new ImageData(k,j);return I.readPixels(0,0,k,j,gn.RGBA,ds.UNSIGNED_BYTE,V.data),I.detachColorTexture(Sv.COLOR_ATTACHMENT0),I.dispose(),{texture:x,extent:n,imageData:V}}return I.detachColorTexture(Sv.COLOR_ATTACHMENT0),I.dispose(),{texture:x,extent:n}}reprojectBitmapData(e,i){const r=_Pt(e.bitmapData)?bPt(e.bitmapData):e.bitmapData,n=new Fs(this._rctx,{width:e.bitmapData.width,height:e.bitmapData.height,pixelFormat:gn.RGBA,dataType:ds.UNSIGNED_BYTE,wrapMode:ws.CLAMP_TO_EDGE,samplingMode:In.LINEAR,hasMipmap:!1},r),s=this.reprojectTexture({texture:n,extent:e.extent},i,!0);s.texture.dispose();const o=document.createElement("canvas"),a=s.imageData;return o.width=a.width,o.height=a.height,o.getContext("2d").putImageData(a,0,0),{bitmapData:o,extent:s.extent}}async loadAndReprojectBitmapData(e,i,r){const n=(await ur(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(i.spatialReference.equals(r))return{bitmapData:a,extent:i};const l=this.reprojectBitmapData({bitmapData:a,extent:i},r);return{bitmapData:l.bitmapData,extent:l.extent}}destroy(){this._ownsRctx?(F3._instanceRefCount--,F3._instanceRefCount===0&&(this._quad.dispose(),this._program.dispose(),this._rctx.dispose(),F3._instance=null)):(this._quad.dispose(),this._program.dispose())}};QPt._instanceRefCount=0;let eOt=class{constructor(){this.allSublayers=new Map,this.allPoints=[],this.allPolylines=[],this.allPolygons=[],this.allMapImages=[]}},H6=class extends wy(xy){constructor(){super(...arguments),this._bitmapIndex=new Map,this._mapImageContainer=new WU,this._kmlVisualData=new eOt,this._fetchController=null,this.allVisiblePoints=new U1,this.allVisiblePolylines=new U1,this.allVisiblePolygons=new U1,this.allVisibleMapImages=new Sr}async hitTest(e,i){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 gx({view:this.view,graphics:this.allVisiblePolygons,requestUpdateCallback:()=>this.requestUpdate(),container:new AO(this.view.featuresTilingScheme)}),this.container.addChild(this._polygonsView.container),this._polylinesView=new gx({view:this.view,graphics:this.allVisiblePolylines,requestUpdateCallback:()=>this.requestUpdate(),container:new AO(this.view.featuresTilingScheme)}),this.container.addChild(this._polylinesView.container),this._pointsView=new gx({view:this.view,graphics:this.allVisiblePoints,requestUpdateCallback:()=>this.requestUpdate(),container:new AO(this.view.featuresTilingScheme)}),this.container.addChild(this._pointsView.container),this.addAttachHandles([this.allVisibleMapImages.on("change",e=>{e.added.forEach(i=>this._addMapImage(i)),e.removed.forEach(i=>this._removeMapImage(i))}),sr(()=>this.layer.visibleSublayers,e=>{for(const[i,r]of this._kmlVisualData.allSublayers)r.visibility=0;for(const i of e){const r=this._kmlVisualData.allSublayers.get(i.id);r&&(r.visibility=1)}this._refreshCollections()})]),this.updatingHandles.addPromise(this._fetchService(this._fetchController.signal)),this._imageReprojector=new QPt}detach(){this._fetchController=oL(this._fetchController),this._mapImageContainer.removeAllChildren(),this.container.removeAllChildren(),this._bitmapIndex.clear(),this._polygonsView=da(this._polygonsView),this._polylinesView=da(this._polylinesView),this._pointsView=da(this._pointsView),this._imageReprojector=da(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,Ar.fromJSON(e.extent),this.view.spatialReference).then(i=>{const r=new WNe(i.bitmapData,{immutable:!1,requestRenderOnSourceChangedEnabled:!0});r.x=i.extent.xmin,r.y=i.extent.ymax,r.resolution=i.extent.width/i.bitmapData.width,r.rotation=e.rotation,this._mapImageContainer.addChild(r),this._bitmapIndex.set(e,r)})}async _getViewDependentUrl(e,i){const{viewFormat:r,viewBoundScale:n,httpQuery:s}=e;if(ve(r)){if(lt(i))throw new Error("Loading this network link requires a view state.");let o;if(await A2(),ve(n)&&n!==1){const V=new Ar(i.extent);V.expand(n),o=V}else o=i.extent;o=cp(o,hr.WGS84);const a=cp(o,hr.WebMercator),l=o.xmin,c=o.xmax,h=o.ymin,p=o.ymax,y=i.size[0]*i.pixelRatio,v=i.size[1]*i.pixelRatio,x=Math.max(a.width,a.height),I={"[bboxWest]":l.toString(),"[bboxEast]":c.toString(),"[bboxSouth]":h.toString(),"[bboxNorth]":p.toString(),"[lookatLon]":o.center.x.toString(),"[lookatLat]":o.center.y.toString(),"[lookatRange]":x.toString(),"[lookatTilt]":"0","[lookatHeading]":i.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]":x.toString(),"[horizFov]":"60","[vertFov]":"60","[horizPixels]":y.toString(),"[vertPixels]":v.toString(),"[terrainEnabled]":"0","[clientVersion]":zH,"[kmlVersion]":"2.2","[clientName]":"ArcGIS API for JavaScript","[language]":"en-US"},P=V=>{for(const Y in V)for(const X in I)V[Y]=V[Y].replace(X,I[X])},F=q3(r);P(F);let k={};ve(s)&&(k=q3(s),P(k));const j=hh(e.href);return j.query={...j.query,...F,...k},`${j.path}?${Wv(F)}`}return e.href}async _fetchService(e){const i=new eOt;await this._loadVisualData(this.layer.url,i,e),this._kmlVisualData=i,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 i=this._kmlVisualData.allSublayers.get(e);return!!i?.visibility&&(i.parentFolderId===-1||this._isSublayerVisible(i.parentFolderId))}_loadVisualData(e,i,r){return this._fetchParsedKML(e,r).then(async n=>{for(const s of n.sublayers){i.allSublayers.set(s.id,s);const o=s.points?await gke(s.points):[],a=s.polylines?await gke(s.polylines):[],l=s.polygons?await gke(s.polygons):[],c=s.mapImages||[];if(i.allPoints.push(...o.map(h=>({item:h,sublayerId:s.id}))),i.allPolylines.push(...a.map(h=>({item:h,sublayerId:s.id}))),i.allPolygons.push(...l.map(h=>({item:h,sublayerId:s.id}))),i.allMapImages.push(...c.map(h=>({item:h,sublayerId:s.id}))),s.networkLink){const h=await this._getViewDependentUrl(s.networkLink,this.view.state);await this._loadVisualData(h,i,r)}}})}_fetchParsedKML(e,i){return fke(e,this.layer.spatialReference,this.layer.refreshInterval,i).then(r=>pke(r.data))}_removeMapImage(e){const i=this._bitmapIndex.get(e);i&&(this._mapImageContainer.removeChild(i),this._bitmapIndex.delete(e))}};E([N()],H6.prototype,"_pointsView",void 0),E([N()],H6.prototype,"_polylinesView",void 0),E([N()],H6.prototype,"_polygonsView",void 0),E([N()],H6.prototype,"updating",void 0),H6=E([dt("esri.views.2d.layers.KMLLayerView2D")],H6);const Klr=Object.freeze(Object.defineProperty({__proto__:null,default:H6},Symbol.toStringTag,{value:"Module"}));let yee=class extends wy(xy){constructor(e){super(e),this.layerViews=new Sr}set layerViews(e){this._set("layerViews",og(e,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((e,i)=>e+i.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,i)=>this.container.addChildAt(e.container,i))}};E([N({cast:k8})],yee.prototype,"layerViews",null),E([N({readOnly:!0})],yee.prototype,"updatingProgress",null),yee=E([dt("esri.views.2d.layers.KnowledgeGraphLayerView2D")],yee);const tOt=Object.freeze(Object.defineProperty({__proto__:null,default:yee},Symbol.toStringTag,{value:"Module"})),Jlr=t=>{let e=class extends t{initialize(){this.exportImageParameters=new d_({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 E([N()],e.prototype,"exportImageParameters",void 0),E([N({readOnly:!0})],e.prototype,"floors",null),E([N({readOnly:!0})],e.prototype,"exportImageVersion",null),E([N()],e.prototype,"layer",void 0),E([N()],e.prototype,"suspended",void 0),E([N(j9)],e.prototype,"timeExtent",void 0),e=E([dt("esri.views.layers.MapImageLayerView")],e),e};let vee=class extends Jlr(LF(wy(xy))){constructor(){super(...arguments),this._highlightGraphics=new U1,this._updateHash=""}fetchPopupFeatures(e,i){return this._popupHighlightHelper.fetchPopupFeatures(e,i)}update(e){const i=`${this.exportImageVersion}/${e.state.id}/${e.pixelRatio}/${e.stationary}`;this._updateHash!==i&&(this._updateHash=i,this.strategy.update(e).catch(r=>{ys(r)||Oi.getLogger(this.declaredClass).error(r)}),e.stationary&&this._popupHighlightHelper.updateHighlightedFeatures(e.state.resolution)),this._highlightView.processUpdate(e)}attach(){const{imageMaxWidth:e,imageMaxHeight:i,version:r}=this.layer,n=r>=10.3,s=r>=10;this._bitmapContainer=new WU,this.container.addChild(this._bitmapContainer),this._highlightView=new gx({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new ZNe(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1}),this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new OO({createFetchPopupFeaturesQueryGeometry:(o,a)=>IPt(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 Bge({container:this._bitmapContainer,fetchSource:this.fetchImageBitmap.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxWidth:e,imageMaxHeight:i,imageRotationSupported:n,imageNormalizationSupported:s,hidpi:!0}),this.addAttachHandles(sr(()=>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,i,r,n){return this.layer.fetchImage(e,i,r,{timeExtent:this.timeExtent,floors:this.floors,...n})}fetchImageBitmap(e,i,r,n){return this.layer.fetchImageBitmap(e,i,r,{timeExtent:this.timeExtent,floors:this.floors,...n})}highlight(e){return this._popupHighlightHelper.highlight(e)}};E([N()],vee.prototype,"strategy",void 0),E([N()],vee.prototype,"updating",void 0),vee=E([dt("esri.views.2d.layers.MapImageLayerView2D")],vee);const Zlr=Object.freeze(Object.defineProperty({__proto__:null,default:vee},Symbol.toStringTag,{value:"Module"})),iOt="sublayers",vke="layerView",Qlr=Object.freeze({remove(){},pause(){},resume(){}});let _ke=class extends wy(xy){constructor(){super(...arguments),this._highlightIds=new Map,this.container=new MPt}async fetchPopupFeatures(e){return Array.from(this.graphicsViews(),i=>i.hitTest(e).filter(r=>!!r.popupTemplate)).flat()}*graphicsViews(){ve(this._graphicsViewsFeatureCollectionMap)?yield*this._graphicsViewsFeatureCollectionMap.keys():ve(this._graphicsViews)?yield*this._graphicsViews:yield*[]}async hitTest(e,i){return Array.from(this.graphicsViews(),r=>{const n=r.hitTest(e);if(ve(this._graphicsViewsFeatureCollectionMap)){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 i;typeof e=="number"?i=[e]:e instanceof io?i=[e.uid]:Array.isArray(e)&&e.length>0?i=typeof e[0]=="number"?e:e.map(n=>n&&n.uid):Sr.isCollection(e)&&(i=e.map(n=>n&&n.uid).toArray());const r=i?.filter(ve);return r?.length?(this._addHighlight(r),{remove:()=>{this._removeHighlight(r)}}):Qlr}update(e){for(const i of this.graphicsViews())i.processUpdate(e)}attach(){const e=this.view,i=()=>this.requestUpdate(),r=this.layer.featureCollections;if(ve(r)&&r.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const n of r){const s=new AO(this.view.featuresTilingScheme),o=new gx({view:e,graphics:n.source,renderer:n.renderer,requestUpdateCallback:i,container:s});this._graphicsViewsFeatureCollectionMap.set(o,n),this.container.addChild(o.container),this.addHandles([sr(()=>n.visible,a=>o.container.visible=a,Yo),sr(()=>o.updating,()=>this.notifyChange("updating"),Yo)],vke)}this._updateHighlight()}else ve(this.layer.sublayers)&&this.addHandles(Wu(()=>this.layer.sublayers,"change",()=>this._createGraphicsViews(),{onListenerAdd:()=>this._createGraphicsViews(),onListenerRemove:()=>this._destroyGraphicsViews()}),iOt)}detach(){this._destroyGraphicsViews(),this.removeHandles(iOt)}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(vke);for(const e of this.graphicsViews())e.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),lt(this.layer.sublayers))return;const e=[],i=this.view,r=()=>this.requestUpdate();for(const n of this.layer.sublayers){const s=new CU,o=new AO(this.view.featuresTilingScheme);o.fadeTransitionEnabled=!0;const a=new gx({view:i,graphics:n.graphics,requestUpdateCallback:r,container:o});this.addHandles([n.on("graphic-update",a.graphicUpdateHandler),sr(()=>n.visible,l=>a.container.visible=l,Yo),sr(()=>a.updating,()=>this.notifyChange("updating"),Yo)],vke),s.addChild(a.container),this.container.addChild(s),e.push(a)}this._graphicsViews=e,this._updateHighlight()}_addHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i);this._highlightIds.set(i,r+1)}else this._highlightIds.set(i,1);this._updateHighlight()}_removeHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i)-1;r===0?this._highlightIds.delete(i):this._highlightIds.set(i,r)}this._updateHighlight()}_updateHighlight(){const e=Array.from(this._highlightIds.keys());for(const i of this.graphicsViews())i.setHighlight(e)}};_ke=E([dt("esri.views.2d.layers.MapNotesLayerView2D")],_ke);const eur=Object.freeze(Object.defineProperty({__proto__:null,default:_ke},Symbol.toStringTag,{value:"Module"}));let MS=class extends Tn{constructor(e){super(e)}get bounds(){const e=this.coords;return lt(e)||lt(e.extent)?null:fR(e.extent)}get coords(){const e=this.element.georeference?.coords;return DA(e,this.spatialReference).geometry}get normalizedCoords(){return To.fromJSON(kir(this.coords))}get normalizedBounds(){const e=ve(this.normalizedCoords)?this.normalizedCoords.extent:null;return ve(e)?fR(e):null}};E([N()],MS.prototype,"spatialReference",void 0),E([N()],MS.prototype,"element",void 0),E([N()],MS.prototype,"bounds",null),E([N()],MS.prototype,"coords",null),E([N()],MS.prototype,"normalizedCoords",null),E([N()],MS.prototype,"normalizedBounds",null),MS=E([dt("esri.layers.support.MediaElementView")],MS);const Ab=hn(),t7=im(),bke=im(),rOt=im();function jF(t,e,i){return Rl(Ab,e[0],e[1],1),PC(Ab,Ab,lX(t7,i)),Ab[2]===0?ga(t,Ab[0],Ab[1]):ga(t,Ab[0]/Ab[2],Ab[1]/Ab[2])}function nOt(t,e,i){return sOt(bke,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]),sOt(rOt,i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]),cv(t,HIe(bke,bke),rOt),t[8]!==0&&(t[0]/=t[8],t[1]/=t[8],t[2]/=t[8],t[3]/=t[8],t[4]/=t[8],t[5]/=t[8],t[6]/=t[8],t[7]/=t[8],t[8]/=t[8]),t}function sOt(t,e,i,r,n,s,o,a,l){wN(t,e,r,s,i,n,o,1,1,1),Rl(Ab,a,l,1),HIe(t7,t);const[c,h,p]=PC(Ab,Ab,lX(t7,t7));return wN(t7,c,0,0,0,h,0,0,0,p),cv(t,t7,t)}const _ee=im();let tur=class extends CS{constructor(e){super(),this.elementView=e,this.isWrapAround=!1,this.perspectiveTransform=rl(),this._vertices=new Float32Array(20),this._handles=[],this._handles.push(sr(()=>this.elementView.element.opacity,i=>this.opacity=i,Yo),sr(()=>[this.elementView.coords],()=>{this.requestRender()},Yo),Yg(()=>this.elementView.element.loaded,()=>{const i=this.elementView.element;this.ready(),i.type==="video"&&ve(i.content)&&this._handles.push(ZI(i.content,"play",()=>this.requestRender()))},Yo)),e.element.load().catch(i=>{Oi.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new st("element-load-error","Element cannot be displayed",{element:e,error:i}))})}destroy(){this._handles.forEach(e=>e.remove()),this.texture=qa(this.texture)}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:i}=e,r=this.elementView.element.content;if(ve(r)){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;this._updatePerspectiveTransform(o,a),this.texture?s&&!r.paused&&(this.texture.setData(r),this.requestRender(),(i.type===bo.WEBGL2||OC(o)&&OC(a))&&this.texture.generateMipmap()):(this.texture=new Fs(i,{pixelFormat:gn.RGBA,dataType:ds.UNSIGNED_BYTE,samplingMode:In.LINEAR,wrapMode:ws.CLAMP_TO_EDGE,width:o,height:a,preMultiplyAlpha:!0},r),(i.type===bo.WEBGL2||OC(o)&&OC(a))&&this.texture.generateMipmap(),s&&!r.paused&&this.requestRender())}super.beforeRender(e)}_createTransforms(){return null}updateDrawCoords(e,i){const r=this.elementView.coords;if(lt(r))return;const[n,s,o,a]=r.rings[0],l=this._vertices,{x:c,y:h}=e,p=i!==0;p?l.set([s[0]-c,s[1]-h,n[0]-c,n[1]-h,o[0]-c,o[1]-h,a[0]-c,a[1]-h,a[0]-c,a[1]-h,s[0]+i-c,s[1]-h,s[0]+i-c,s[1]-h,n[0]+i-c,n[1]-h,o[0]+i-c,o[1]-h,a[0]+i-c,a[1]-h]):l.set([s[0]-c,s[1]-h,n[0]-c,n[1]-h,o[0]-c,o[1]-h,a[0]-c,a[1]-h]),this.isWrapAround=p}getVAO(e,i,r){if(lt(this.elementView.coords))return null;const n=this._vertices;if(this._vao)this._geometryVbo.setData(n);else{this._geometryVbo=aa.createVertex(e,Xo.DYNAMIC_DRAW,n);const s=aa.createVertex(e,Xo.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 Mc(e,r,i,{geometry:this._geometryVbo,tex:s})}return this._vao}_updatePerspectiveTransform(e,i){const r=this._vertices;nOt(_ee,[0,0,e,0,0,i,e,i],[r[0],r[1],r[4],r[5],r[2],r[3],r[6],r[7]]),ga(this.perspectiveTransform,_ee[6]/_ee[8]*e,_ee[7]/_ee[8]*i)}},iur=class extends GU{constructor(){super(...arguments),this._localOrigin=zh(0,0),this._viewStateId=-1,this._dvsMat3=Dl(),this.requiresDedicatedFBO=!1}get dvsMat3(){return this._dvsMat3}beforeRender(e){this._updateMatrices(e),this._updateOverlays(e,this.children);for(const i of this.children)i.beforeRender(e)}prepareRenderPasses(e){const i=e.registerRenderPass({name:"overlay",brushes:[ph.overlay],target:()=>this.children,drawPhase:mo.MAP});return[...super.prepareRenderPasses(e),i]}_updateMatrices(e){const{state:i}=e,{id:r,size:n,pixelRatio:s,resolution:o,rotation:a,viewpoint:l,displayMat3:c}=i;if(this._viewStateId===r)return;const h=Math.PI/180*a,p=s*n[0],y=s*n[1],{x:v,y:x}=l.targetGeometry,I=_Ce(v,i.spatialReference);this._localOrigin.x=I,this._localOrigin.y=x;const P=o*p,F=o*y,k=iP(this._dvsMat3);cv(k,k,c),dg(k,k,mp(p/2,y/2)),rP(k,k,nO(p/P,-y/F,1)),wT(k,k,-h),this._viewStateId=r}_updateOverlays(e,i){const{state:r}=e,{rotation:n,spatialReference:s,worldScreenWidth:o,size:a,viewpoint:l}=r,c=this._localOrigin;let h=0;const p=vd(s);if(p&&s.isWrappable){const y=a[0],v=a[1],x=180/Math.PI*n,I=Math.abs(Math.cos(x)),P=Math.abs(Math.sin(x)),F=Math.round(y*I+v*P),[k,j]=p.valid,V=$Ie(s),{x:Y,y:X}=l.targetGeometry,Z=[Y,X],ie=[0,0];r.toScreen(ie,Z);const ce=[0,0];let he;he=F>o?.5*o:.5*F;const _e=Math.floor((Y+.5*V)/V),xe=k+_e*V,Pe=j+_e*V,ke=[ie[0]+he,0];r.toMap(ce,ke),ce[0]>Pe&&(h=V),ke[0]=ie[0]-he,r.toMap(ce,ke),ce[0]k?J.updateDrawCoords(c,V):Ie>j&&Sethis.layer.effectiveSource,"refresh",()=>{for(const e of this._tileStrategy.tiles)this._updateTile(e);this.requestUpdate()}),Wu(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new iur,this.container.addChild(this._overlayContainer),this._fetchQueue=new aV({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,i)=>this._queryElements(e,i)}),this._tileStrategy=new uX({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,i){const r=[],n=e.normalize(),s=[n.x,n.y];for(const{projectedElement:{normalizedCoords:o,element:a}}of this._elementReferences.values())ve(o)&&A1e(o.rings,s)&&r.push({type:"media",element:a,layer:this.layer,mapPoint:e});return r.reverse()}canResume(){return this.layer.source!=null&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.tiles.forEach(e=>this._updateTile(e))}_acquireTile(e){const i=new rur(e.clone());return this._updateTile(i),i}_updateTile(e){this.updatingHandles.addPromise(this._fetchQueue.push(e.key).then(i=>{const[r,n]=e.setElements(i);this._referenceElements(e,r),this._dereferenceElements(e,n),this.requestUpdate()},i=>{ys(i)||Oi.getLogger(this.declaredClass).error(i)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,i){const r=this.layer.effectiveSource;if(lt(r))return[];this.view.featuresTilingScheme.getTileBounds(JE,e,!0);const n=new Ar({xmin:JE[0],ymin:JE[1],xmax:JE[2],ymax:JE[3],spatialReference:this.view.spatialReference});return r.queryElements(n,i)}_referenceElements(e,i){const r=this.layer.source;if(!lt(r))for(const n of i)this._referenceElement(e,n)}_referenceElement(e,i){bC(this._elementReferences,i.uid,()=>{const r=new MS({element:i,spatialReference:this.view.spatialReference}),n=new tur(r);return this._overlayContainer.addChild(n),this.elements.add(i),{tiles:new Set,projectedElement:r,overlay:n,debugGraphic:null}}).tiles.add(e)}_dereferenceElements(e,i){for(const r of i)this._dereferenceElement(e,r)}_dereferenceElement(e,i){const r=this._elementReferences.get(i.uid);r.tiles.delete(e),r.tiles.size||(this._overlayContainer.removeChild(r.overlay),r.overlay.destroy(),r.projectedElement.destroy(),this._elementReferences.delete(i.uid),this.elements.remove(i),this._debugGraphicsView?.graphics.remove(r.debugGraphic))}_elementUpdateHandler(e){let i=this._elementReferences.get(e.uid);if(i){const n=i.projectedElement.normalizedCoords;if(lt(n))return this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.projectedElement.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(i.debugGraphic);const s=[],o=[];for(const a of this._tileStrategy.tiles){const l=oOt(this.view.featuresTilingScheme,a,n);i.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 i=this._elementReferences.get(e.uid),void(i?.debugGraphic&&(i.debugGraphic.geometry=i.projectedElement.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:i.debugGraphic,property:"geometry"})))}const r=new MS({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(ve(r))for(const n of this._tileStrategy.tiles)oOt(this.view.featuresTilingScheme,n,r)&&this._referenceElement(n,e)}};E([N()],i7.prototype,"_fetchQueue",void 0),E([N()],i7.prototype,"layer",void 0),E([N({readOnly:!0})],i7.prototype,"elements",void 0),i7=E([dt("esri.views.2d.layers.MediaLayerView2D")],i7);const JE=Mo(),bee={xmin:0,ymin:0,xmax:0,ymax:0};function oOt(t,e,i){return t.getTileBounds(JE,e.key,!0),bee.xmin=JE[0],bee.ymin=JE[1],bee.xmax=JE[2],bee.ymax=JE[3],P1e(bee,i)}let rur=class{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const i=[],r=new Set(this.elements);this.elements=e;for(const n of e)r.has(n)?r.delete(n):i.push(n);return this.isReady=!0,[i,Array.from(r)]}destroy(){}};const nur=Object.freeze(Object.defineProperty({__proto__:null,default:i7},Symbol.toStringTag,{value:"Module"})),sur=t=>{let e=class extends t{get availableFields(){return this.layer.fieldsIndex.fields.map(i=>i.name)}};return E([N()],e.prototype,"layer",void 0),E([N({readOnly:!0})],e.prototype,"availableFields",null),e=E([dt("esri.views.layers.OGCFeatureLayerView")],e),e};let wke=class extends sur(kge){supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}};wke=E([dt("esri.views.2d.layers.OGCFeatureLayerView2D")],wke);const our=Object.freeze(Object.defineProperty({__proto__:null,default:wke},Symbol.toStringTag,{value:"Module"})),aOt=ta()({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"}),lOt=ta()({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"});ta()({esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds"});const aur=ta()({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"}),lur=ta()({esriDOTComplete:"complete",esriDOTCompleteNoEvents:"complete-no-events",esriDOTFeatureSets:"featuresets",esriDOTInstructionsOnly:"instructions-only",esriDOTStandard:"standard",esriDOTSummaryOnly:"summary-only"}),uur=ta()({esriNAOutputLineNone:"none",esriNAOutputLineStraight:"straight",esriNAOutputLineTrueShape:"true-shape",esriNAOutputLineTrueShapeWithMeasure:"true-shape-with-measure"});ta()({esriNAOutputPolygonNone:"none",esriNAOutputPolygonSimplified:"simplified",esriNAOutputPolygonDetailed:"detailed"});const uOt=ta()({esriNFSBAllowBacktrack:"allow-backtrack",esriNFSBAtDeadEndsOnly:"at-dead-ends-only",esriNFSBNoBacktrack:"no-backtrack",esriNFSBAtDeadEndsAndIntersections:"at-dead-ends-and-intersections"});ta()({esriNATravelDirectionFromFacility:"from-facility",esriNATravelDirectionToFacility:"to-facility"}),ta()({esriNATimeOfDayNotUsed:"not-used",esriNATimeOfDayUseAsStartTime:"start",esriNATimeOfDayUseAsEndTime:"end"});const cur=ta()({AUTOMOBILE:"automobile",TRUCK:"truck",WALK:"walk",OTHER:"other"}),Sy=ta()({0:"either-side-of-vehicle",1:"right-side-of-vehicle",2:"left-side-of-vehicle",3:"no-u-turn"},{useNumericKeys:!0}),wee=ta()({0:"stop",1:"waypoint",2:"break"},{useNumericKeys:!0}),GF=ta()({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}),zge=ta()({1:"right",2:"left"},{useNumericKeys:!0}),n1=ta()({0:"restriction",1:"added-cost"},{useNumericKeys:!0}),xee=ta()({0:"permit",1:"restrict"},{useNumericKeys:!0}),Hge=ta()({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"},{useNumericKeys:!0}),Wge=ta()({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}),hur=ta()({"NA Campus":"campus","NA Desktop":"desktop","NA Navigation":"navigation"}),dur=ta()({Kilometers:"kilometers",Miles:"miles",Meters:"meters"},{ignoreUnknown:!1}),qge=ta()({Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),s1=ta()({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}),Yge=ta()({"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}),pur=ta()({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),fur=ta()({esriGeometryPoint:"point",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"envelope",esriGeometryMultipoint:"multipoint"}),mur=ta()({esriNAUTCost:"cost",esriNAUTDescriptor:"descriptor",esriNAUTRestriction:"restriction",esriNAUTHierarchy:"hierarchy"}),gur=ta()({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 xke;let P0=xke=class extends _a(Ui){constructor(t){super(t),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(t){return new xke({directionLineType:Wge.fromJSON(t.attributes.DirectionLineType),directionPointId:t.attributes.DirectionPointID,distance:t.attributes.Meters,duration:t.attributes.Minutes,fromLevel:t.attributes.FromLevel??null,geometry:t.geometry,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,symbol:t.symbol,toLevel:t.attributes.ToLevel??null})}toGraphic(){const t={ObjectID:this.objectId,DirectionLineType:ve(this.directionLineType)?Wge.toJSON(this.directionLineType):null,DirectionPointID:this.directionPointId,Meters:this.distance,Minutes:this.duration};return ve(this.fromLevel)&&(t.FromLevel=this.fromLevel),ve(this.toLevel)&&(t.ToLevel=this.toLevel),new io({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};P0.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}],P0.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:[]},E([N({type:Wge.apiValues,json:{read:{source:"attributes.DirectionLineType",reader:Wge.read}}})],P0.prototype,"directionLineType",void 0),E([N({json:{read:{source:"attributes.DirectionPointID"}}})],P0.prototype,"directionPointId",void 0),E([N({json:{read:{source:"attributes.Meters"}}})],P0.prototype,"distance",void 0),E([N({json:{read:{source:"attributes.Minutes"}}})],P0.prototype,"duration",void 0),E([N({json:{read:{source:"attributes.FromLevel"}}})],P0.prototype,"fromLevel",void 0),E([N({type:Oa})],P0.prototype,"geometry",void 0),E([N({json:{read:{source:"attributes.ObjectID"}}})],P0.prototype,"objectId",void 0),E([N({type:wh})],P0.prototype,"popupTemplate",void 0),E([N({types:Hh})],P0.prototype,"symbol",void 0),E([N({json:{read:{source:"attributes.ToLevel"}}})],P0.prototype,"toLevel",void 0),E([N({readOnly:!0,json:{read:!1}})],P0.prototype,"type",void 0),P0=xke=E([dt("esri.rest.support.DirectionLine")],P0);const r7=P0;var Ske;let Ph=Ske=class extends _a(Ui){constructor(t){super(t),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(t,e){return ve(e.attributes.ArrivalTime)?new Date(e.attributes.ArrivalTime):null}static fromGraphic(t){return new Ske({alternateName:t.attributes.AlternateName??null,arrivalTime:ve(t.attributes.ArrivalTime)?new Date(t.attributes.ArrivalTime):null,arrivalTimeOffset:t.attributes.ArrivalUTCOffset??null,azimuth:t.attributes.Azimuth??null,branchName:t.attributes.BranchName??null,directionPointType:Hge.fromJSON(t.attributes.DirectionPointType),displayText:t.attributes.DisplayText??null,exitName:t.attributes.ExitName??null,geometry:t.geometry,intersectingName:t.attributes.IntersectingName??null,level:t.attributes.Level??null,name:t.attributes.Name??null,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,sequence:t.attributes.Sequence,shortVoiceInstruction:t.attributes.ShortVoiceInstruction??null,stopId:t.attributes.StopID??null,symbol:t.symbol,towardName:t.attributes.TowardName??null,voiceInstruction:t.attributes.VoiceInstruction??null})}toGraphic(){const t={ObjectID:this.objectId,DirectionPointType:ve(this.directionPointType)?Hge.toJSON(this.directionPointType):null,Sequence:this.sequence,StopID:this.stopId};return ve(this.alternateName)&&(t.AlternateName=this.alternateName),ve(this.arrivalTime)&&(t.ArrivalTime=this.arrivalTime.getTime()),ve(this.arrivalTimeOffset)&&(t.ArrivalUTCOffset=this.arrivalTimeOffset),ve(this.azimuth)&&(t.Azimuth=this.azimuth),ve(this.branchName)&&(t.BranchName=this.branchName),ve(this.displayText)&&(t.DisplayText=this.displayText),ve(this.exitName)&&(t.ExitName=this.exitName),ve(this.intersectingName)&&(t.IntersectingName=this.intersectingName),ve(this.level)&&(t.Level=this.level),ve(this.name)&&(t.Name=this.name),ve(this.shortVoiceInstruction)&&(t.ShortVoiceInstruction=this.shortVoiceInstruction),ve(this.towardName)&&(t.TowardName=this.towardName),ve(this.voiceInstruction)&&(t.VoiceInstruction=this.voiceInstruction),new io({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};Ph.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}],Ph.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:[]},E([N()],Ph.prototype,"alternateName",void 0),E([N()],Ph.prototype,"arrivalTime",void 0),E([Vi("arrivalTime",["attributes.ArrivalTime"])],Ph.prototype,"readArrivalTime",null),E([N({json:{read:{source:"attributes.ArrivalUTCOffset"}}})],Ph.prototype,"arrivalTimeOffset",void 0),E([N({json:{read:{source:"attributes.Azimuth"}}})],Ph.prototype,"azimuth",void 0),E([N({json:{read:{source:"attributes.BranchName"}}})],Ph.prototype,"branchName",void 0),E([N({type:Hge.apiValues,json:{read:{source:"attributes.DirectionPointType",reader:Hge.read}}})],Ph.prototype,"directionPointType",void 0),E([N({json:{read:{source:"attributes.DisplayText"}}})],Ph.prototype,"displayText",void 0),E([N({json:{read:{source:"attributes.ExitName"}}})],Ph.prototype,"exitName",void 0),E([N({type:er})],Ph.prototype,"geometry",void 0),E([N()],Ph.prototype,"intersectingName",void 0),E([N()],Ph.prototype,"level",void 0),E([N({json:{read:{source:"attributes.Name"}}})],Ph.prototype,"name",void 0),E([N({json:{read:{source:"attributes.ObjectID"}}})],Ph.prototype,"objectId",void 0),E([N({type:wh})],Ph.prototype,"popupTemplate",void 0),E([N({json:{read:{source:"attributes.Sequence"}}})],Ph.prototype,"sequence",void 0),E([N()],Ph.prototype,"shortVoiceInstruction",void 0),E([N({json:{read:{source:"attributes.StopID"}}})],Ph.prototype,"stopId",void 0),E([N({types:Hh})],Ph.prototype,"symbol",void 0),E([N({json:{read:{source:"attributes.TowardName"}}})],Ph.prototype,"towardName",void 0),E([N({readOnly:!0,json:{read:!1}})],Ph.prototype,"type",void 0),E([N()],Ph.prototype,"voiceInstruction",void 0),Ph=Ske=E([dt("esri.rest.support.DirectionPoint")],Ph);const n7=Ph;function ZE(t,e){if(lt(t))return null;const i={},r=new RegExp(`^${e}`,"i");for(const n of Object.keys(t))if(r.test(n)){const s=n.substring(e.length);i[s1.fromJSON(s)]=t[n]}return i}function Cke(t,e,i){if(!lt(t)){e.attributes||(e.attributes={});for(const r in t){const n=s1.toJSON(r);e.attributes[`${i}${n}`]=t[r]}}}function s7(t){const e={};for(const i of Object.keys(t)){const r=i;e[s1.fromJSON(r)]=t[i]}return e}function o7(t){const e={};for(const i of Object.keys(t)){const r=i;e[s1.toJSON(r)]=t[i]}return e}function See(t,e){return lt(t)||lt(e)?null:Math.round((t-e)/6e4)}function yur(t){const e=t.toJSON(),i=e;return i.accumulateAttributeNames&&(i.accumulateAttributeNames=e.accumulateAttributeNames?.join()),i.attributeParameterValues&&(i.attributeParameterValues=JSON.stringify(e.attributeParameterValues)),i.barriers&&(i.barriers=JSON.stringify(e.barriers)),i.outSR&&(i.outSR=e.outSR?.wkid),i.overrides&&(i.overrides=JSON.stringify(e.overrides)),i.polygonBarriers&&(i.polygonBarriers=JSON.stringify(e.polygonBarriers)),i.polylineBarriers&&(i.polylineBarriers=JSON.stringify(e.polylineBarriers)),i.restrictionAttributeNames&&(i.restrictionAttributeNames=e.restrictionAttributeNames?.join()),i.stops&&(i.stops=JSON.stringify(e.stops)),i.travelMode&&(i.travelMode=JSON.stringify(e.travelMode)),i}var Tke;let Jp=Tke=class extends _a(Ui){constructor(t){super(t),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(t,e){return ZE(e.attributes,"Attr_")}writeCosts(t,e){Cke(t,e,"Attr_")}static fromGraphic(t){return new Tke({addedCost:t.attributes.AddedCost??null,barrierType:ve(t.attributes.BarrierType)?n1.fromJSON(t.attributes.BarrierType):null,costs:ve(t.attributes.Costs)?s7(JSON.parse(t.attributes.Costs)):null,curbApproach:ve(t.attributes.CurbApproach)?Sy.fromJSON(t.attributes.CurbApproach):null,fullEdge:ve(t.attributes.FullEdge)?xee.fromJSON(t.attributes.FullEdge):null,geometry:t.geometry,name:t.attributes.Name??null,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,status:ve(t.attributes.Status)?GF.fromJSON(t.attributes.Status):null,symbol:t.symbol})}toGraphic(){const t={ObjectID:this.objectId,AddedCost:this.addedCost,BarrierType:ve(this.barrierType)?n1.toJSON(this.barrierType):null,Costs:ve(this.costs)?JSON.stringify(o7(this.costs)):null,CurbApproach:ve(this.curbApproach)?Sy.toJSON(this.curbApproach):null,FullEdge:ve(this.fullEdge)?xee.toJSON(this.fullEdge):null,Name:this.name,Status:ve(this.status)?GF.toJSON(this.status):null};return new io({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};Jp.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}]}}],Jp.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:[]},E([N()],Jp.prototype,"addedCost",void 0),E([N({type:n1.apiValues,json:{name:"attributes.BarrierType",read:{reader:n1.read},write:{writer:n1.write}}})],Jp.prototype,"barrierType",void 0),E([N()],Jp.prototype,"costs",void 0),E([Vi("costs",["attributes"])],Jp.prototype,"readCosts",null),E([Cr("costs")],Jp.prototype,"writeCosts",null),E([N({type:Sy.apiValues,json:{read:{source:"attributes.CurbApproach",reader:Sy.read}}})],Jp.prototype,"curbApproach",void 0),E([N({type:xee.apiValues,json:{name:"attributes.FullEdge",read:{reader:xee.read},write:{writer:xee.write}}})],Jp.prototype,"fullEdge",void 0),E([N({type:er,json:{write:!0}})],Jp.prototype,"geometry",void 0),E([N({json:{name:"attributes.Name"}})],Jp.prototype,"name",void 0),E([N({json:{name:"attributes.ObjectID"}})],Jp.prototype,"objectId",void 0),E([N({type:wh})],Jp.prototype,"popupTemplate",void 0),E([N({type:zge.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:zge.read}}})],Jp.prototype,"sideOfEdge",void 0),E([N({json:{read:{source:"attributes.SourceID"}}})],Jp.prototype,"sourceId",void 0),E([N({json:{read:{source:"attributes.SourceOID"}}})],Jp.prototype,"sourceOid",void 0),E([N({type:GF.apiValues,json:{read:{source:"attributes.Status",reader:GF.read}}})],Jp.prototype,"status",void 0),E([N({types:Hh})],Jp.prototype,"symbol",void 0),E([N({readOnly:!0,json:{read:!1}})],Jp.prototype,"type",void 0),Jp=Tke=E([dt("esri.rest.support.PointBarrier")],Jp);const W6=Jp;var Eke;let O0=Eke=class extends _a(Ui){constructor(t){super(t),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(t,e){return ZE(e.attributes,"Attr_")}writeCosts(t,e){Cke(t,e,"Attr_")}static fromGraphic(t){return new Eke({barrierType:ve(t.attributes.BarrierType)?n1.fromJSON(t.attributes.BarrierType):null,costs:ve(t.attributes.Costs)?s7(JSON.parse(t.attributes.Costs)):null,geometry:t.geometry,name:t.attributes.Name??null,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,scaleFactor:t.attributes.ScaleFactor??null,symbol:t.symbol})}toGraphic(){const t={ObjectID:this.objectId,BarrierType:ve(this.barrierType)?n1.toJSON(this.barrierType):null,Costs:ve(this.costs)?JSON.stringify(o7(this.costs)):null,Name:this.name??null,ScaleFactor:this.scaleFactor??null};return new io({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};O0.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}],O0.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:[]},E([N({type:n1.apiValues,json:{name:"attributes.BarrierType",read:{reader:n1.read},write:{writer:n1.write}}})],O0.prototype,"barrierType",void 0),E([N()],O0.prototype,"costs",void 0),E([Vi("costs",["attributes"])],O0.prototype,"readCosts",null),E([Cr("costs")],O0.prototype,"writeCosts",null),E([N({type:To,json:{write:!0}})],O0.prototype,"geometry",void 0),E([N({json:{name:"attributes.Name"}})],O0.prototype,"name",void 0),E([N({json:{name:"attributes.ObjectID"}})],O0.prototype,"objectId",void 0),E([N({type:wh})],O0.prototype,"popupTemplate",void 0),E([N()],O0.prototype,"scaleFactor",void 0),E([N({types:Hh})],O0.prototype,"symbol",void 0),E([N({readOnly:!0,json:{read:!1}})],O0.prototype,"type",void 0),O0=Eke=E([dt("esri.rest.support.PolygonBarrier")],O0);const q6=O0;var Ike;let Rv=Ike=class extends _a(Ui){constructor(t){super(t),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(t,e){return ZE(e.attributes,"Attr_")}static fromGraphic(t){return new Ike({barrierType:ve(t.attributes.BarrierType)?n1.fromJSON(t.attributes.BarrierType):null,costs:ve(t.attributes.Costs)?s7(JSON.parse(t.attributes.Costs)):null,geometry:t.geometry,name:t.attributes.Name??null,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,scaleFactor:t.attributes.ScaleFactor??null,symbol:t.symbol})}toGraphic(){const t={ObjectID:this.objectId,BarrierType:ve(this.barrierType)?n1.toJSON(this.barrierType):null,Costs:ve(this.costs)?JSON.stringify(o7(this.costs)):null,Name:this.name,ScaleFactor:this.scaleFactor};return new io({geometry:this.geometry,attributes:t,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:"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:[]},E([N({type:n1.apiValues,json:{read:{source:"attributes.BarrierType",reader:n1.read}}})],Rv.prototype,"barrierType",void 0),E([N()],Rv.prototype,"costs",void 0),E([Vi("costs",["attributes"])],Rv.prototype,"readCosts",null),E([N({type:Oa,json:{write:!0}})],Rv.prototype,"geometry",void 0),E([N({json:{name:"attributes.Name"}})],Rv.prototype,"name",void 0),E([N({json:{name:"attributes.ObjectID"}})],Rv.prototype,"objectId",void 0),E([N({type:wh})],Rv.prototype,"popupTemplate",void 0),E([N()],Rv.prototype,"scaleFactor",void 0),E([N({types:Hh})],Rv.prototype,"symbol",void 0),E([N({readOnly:!0,json:{read:!1}})],Rv.prototype,"type",void 0),Rv=Ike=E([dt("esri.rest.support.PolylineBarrier")],Rv);const Y6=Rv;let Ym=class extends _a(Ui){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,i){return i.id??i.itemId??null}readRestrictionAttributes(e,i){const{restrictionAttributeNames:r}=i;return lt(r)?null:r.map(n=>Yge.fromJSON(n))}writeRestrictionAttributes(e,i,r){lt(e)||(i[r]=e.map(n=>Yge.toJSON(n)))}};E([N({type:[Object],json:{write:!0}})],Ym.prototype,"attributeParameterValues",void 0),E([N({type:String,json:{write:!0}})],Ym.prototype,"description",void 0),E([rn(dur,{ignoreUnknown:!1})],Ym.prototype,"distanceAttributeName",void 0),E([N({type:String,json:{write:!0}})],Ym.prototype,"id",void 0),E([Vi("id",["id","itemId"])],Ym.prototype,"readId",null),E([rn(s1,{ignoreUnknown:!1})],Ym.prototype,"impedanceAttributeName",void 0),E([N({type:String,json:{write:!0}})],Ym.prototype,"name",void 0),E([N({type:[String],json:{write:!0}})],Ym.prototype,"restrictionAttributeNames",void 0),E([Vi("restrictionAttributeNames")],Ym.prototype,"readRestrictionAttributes",null),E([Cr("restrictionAttributeNames")],Ym.prototype,"writeRestrictionAttributes",null),E([N({type:Number,json:{write:{allowNull:!0}}})],Ym.prototype,"simplificationTolerance",void 0),E([rn(aOt)],Ym.prototype,"simplificationToleranceUnits",void 0),E([rn(qge,{ignoreUnknown:!1})],Ym.prototype,"timeAttributeName",void 0),E([rn(cur)],Ym.prototype,"type",void 0),E([N({type:Boolean,json:{write:!0}})],Ym.prototype,"useHierarchy",void 0),E([rn(uOt)],Ym.prototype,"uturnAtJunctions",void 0),Ym=E([dt("esri.rest.support.TravelMode")],Ym);const Xge=Ym;let Pb=class extends Ui{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 lt(e)?null:e.map(i=>s1.fromJSON(i))}writeAccumulateAttributes(e,i,r){!lt(e)&&e.length&&(i[r]=e.map(n=>s1.toJSON(n)))}};E([N({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],Pb.prototype,"accumulateAttributes",void 0),E([Vi("accumulateAttributes")],Pb.prototype,"readAccumulateAttributes",null),E([Cr("accumulateAttributes")],Pb.prototype,"writeAccumulateAttributes",null),E([N({type:String,json:{write:!0}})],Pb.prototype,"directionsLanguage",void 0),E([N({type:Boolean,json:{write:!0}})],Pb.prototype,"findBestSequence",void 0),E([N({type:Boolean,json:{write:!0}})],Pb.prototype,"preserveFirstStop",void 0),E([N({type:Boolean,json:{write:!0}})],Pb.prototype,"preserveLastStop",void 0),E([N({type:Boolean,json:{write:!0}})],Pb.prototype,"startTimeIsUTC",void 0),E([N({type:Boolean,json:{write:!0}})],Pb.prototype,"timeWindowsAreUTC",void 0),E([N({type:Xge,json:{write:!0}})],Pb.prototype,"travelMode",void 0),Pb=E([dt("esri.layers.support.RouteSettings")],Pb);const cOt=Pb;var Ake;let $u=Ake=class extends _a(Ui){constructor(t){super(t),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(t,e){return ve(e.attributes.EndTimeUTC)?new Date(e.attributes.EndTimeUTC):null}readEndTimeOffset(t,e){return See(e.attributes.EndTime,e.attributes.EndTimeUTC)}readStartTime(t,e){return ve(e.attributes.StartTimeUTC)?new Date(e.attributes.StartTimeUTC):null}readStartTimeOffset(t,e){return See(e.attributes.StartTime,e.attributes.StartTimeUTC)}readTotalCosts(t,e){return ZE(e.attributes,"Total_")}readTotalViolations(t,e){return ZE(e.attributes,"TotalViolation_")}readTotalWait(t,e){return ZE(e.attributes,"TotalWait_")}static fromGraphic(t){return new Ake({analysisSettings:ve(t.attributes.AnalysisSettings)?cOt.fromJSON(JSON.parse(t.attributes.AnalysisSettings)):null,endTime:ve(t.attributes.EndTime)?new Date(t.attributes.EndTime):null,endTimeOffset:t.attributes.EndUTCOffset??null,geometry:t.geometry,messages:ve(t.attributes.Messages)?JSON.parse(t.attributes.Messages):null,name:t.attributes.RouteName,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,startTime:ve(t.attributes.StartTime)?new Date(t.attributes.StartTime):null,startTimeOffset:t.attributes.StartUTCOffset??null,symbol:t.symbol,totalCosts:ve(t.attributes.TotalCosts)?s7(JSON.parse(t.attributes.TotalCosts)):null,totalDistance:t.attributes.TotalMeters??null,totalDuration:t.attributes.TotalMinutes??null,totalLateDuration:t.attributes.TotalLateMinutes??null,totalWaitDuration:t.attributes.TotalWaitMinutes??null,version:t.attributes.Version})}toGraphic(){const t={ObjectID:this.objectId,AnalysisSettings:ve(this.analysisSettings)?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:ve(this.endTime)?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:ve(this.messages)?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:ve(this.startTime)?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:ve(this.totalCosts)?JSON.stringify(o7(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new io({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};$u.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}],$u.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:[]},E([N()],$u.prototype,"analysisSettings",void 0),E([N()],$u.prototype,"endTime",void 0),E([Vi("endTime",["attributes.EndTimeUTC"])],$u.prototype,"readEndTime",null),E([N()],$u.prototype,"endTimeOffset",void 0),E([Vi("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],$u.prototype,"readEndTimeOffset",null),E([N({json:{read:{source:"attributes.FirstStopID"}}})],$u.prototype,"firstStopId",void 0),E([N({type:Oa})],$u.prototype,"geometry",void 0),E([N({json:{read:{source:"attributes.LastStopID"}}})],$u.prototype,"lastStopId",void 0),E([N()],$u.prototype,"messages",void 0),E([N({json:{read:{source:"attributes.Name"}}})],$u.prototype,"name",void 0),E([N({json:{read:{source:"attributes.ObjectID"}}})],$u.prototype,"objectId",void 0),E([N({type:wh})],$u.prototype,"popupTemplate",void 0),E([N()],$u.prototype,"startTime",void 0),E([Vi("startTime",["attributes.StartTimeUTC"])],$u.prototype,"readStartTime",null),E([N()],$u.prototype,"startTimeOffset",void 0),E([Vi("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],$u.prototype,"readStartTimeOffset",null),E([N({json:{read:{source:"attributes.StopCount"}}})],$u.prototype,"stopCount",void 0),E([N({types:Hh})],$u.prototype,"symbol",void 0),E([N()],$u.prototype,"totalCosts",void 0),E([Vi("totalCosts",["attributes"])],$u.prototype,"readTotalCosts",null),E([N()],$u.prototype,"totalDistance",void 0),E([N()],$u.prototype,"totalDuration",void 0),E([N()],$u.prototype,"totalLateDuration",void 0),E([N()],$u.prototype,"totalViolations",void 0),E([Vi("totalViolations",["attributes"])],$u.prototype,"readTotalViolations",null),E([N()],$u.prototype,"totalWait",void 0),E([Vi("totalWait",["attributes"])],$u.prototype,"readTotalWait",null),E([N()],$u.prototype,"totalWaitDuration",void 0),E([N({readOnly:!0,json:{read:!1}})],$u.prototype,"type",void 0),E([N()],$u.prototype,"version",void 0),$u=Ake=E([dt("esri.rest.support.RouteInfo")],$u);const Cee=$u;var Pke;let $o=Pke=class extends _a(Ui){constructor(t){super(t),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(t,e){return See(e.attributes.ArriveTime,e.attributes.ArriveTimeUTC)}readCumulativeCosts(t,e){return ZE(e.attributes,"Cumul_")}readDepartTimeOffset(t,e){return See(e.attributes.DepartTime,e.attributes.DepartTimeUTC)}readServiceCosts(t,e){return ZE(e.attributes,"Attr_")}writeServiceCosts(t,e){Cke(t,e,"Attr_")}writeTimeWindowEnd(t,e){lt(t)||(e.attributes||(e.attributes={}),e.attributes.TimeWindowEnd=t.getTime())}writeTimeWindowStart(t,e){lt(t)||(e.attributes||(e.attributes={}),e.attributes.TimeWindowStart=t.getTime())}readViolations(t,e){return ZE(e.attributes,"Violation_")}readWait(t,e){return ZE(e.attributes,"Wait_")}static fromGraphic(t){return new Pke({arriveCurbApproach:ve(t.attributes.ArrivalCurbApproach)?Sy.fromJSON(t.attributes.ArrivalCurbApproach):null,arriveTime:ve(t.attributes.ArrivalTime)?new Date(t.attributes.ArrivalTime):null,arriveTimeOffset:t.attributes.ArrivalUTCOffset,cumulativeCosts:ve(t.attributes.CumulativeCosts)?s7(JSON.parse(t.attributes.CumulativeCosts)):null,cumulativeDistance:t.attributes.CumulativeMeters??null,cumulativeDuration:t.attributes.CumulativeMinutes??null,curbApproach:ve(t.attributes.CurbApproach)?Sy.fromJSON(t.attributes.CurbApproach):null,departCurbApproach:ve(t.attributes.DepartureCurbApproach)?Sy.fromJSON(t.attributes.DepartureCurbApproach):null,departTime:ve(t.attributes.DepartureTime)?new Date(t.attributes.DepartureTime):null,departTimeOffset:t.attributes.DepartureUTCOffset??null,geometry:t.geometry,lateDuration:t.attributes.LateMinutes??null,locationType:ve(t.attributes.LocationType)?wee.fromJSON(t.attributes.LocationType):null,name:t.attributes.Name,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,routeName:t.attributes.RouteName,sequence:t.attributes.Sequence??null,serviceCosts:ve(t.attributes.ServiceCosts)?s7(JSON.parse(t.attributes.ServiceCosts)):null,serviceDistance:t.attributes.ServiceMeters??null,serviceDuration:t.attributes.ServiceMinutes??null,status:ve(t.attributes.Status)?GF.fromJSON(t.attributes.Status):null,symbol:t.symbol,timeWindowEnd:ve(t.attributes.TimeWindowEnd)?new Date(t.attributes.TimeWindowEnd):null,timeWindowEndOffset:t.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:ve(t.attributes.TimeWindowStart)?new Date(t.attributes.TimeWindowStart):null,timeWindowStartOffset:t.attributes.TimeWindowStartUTCOffset??null,waitDuration:t.attributes.WaitMinutes??null})}toGraphic(){const t={ObjectID:this.objectId,ArrivalCurbApproach:ve(this.arriveCurbApproach)?Sy.toJSON(this.arriveCurbApproach):null,ArrivalTime:ve(this.arriveTime)?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:ve(this.cumulativeCosts)?JSON.stringify(o7(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:ve(this.curbApproach)?Sy.toJSON(this.curbApproach):null,DepartureCurbApproach:ve(this.departCurbApproach)?Sy.toJSON(this.departCurbApproach):null,DepartureTime:ve(this.departTime)?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:ve(this.locationType)?wee.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:ve(this.serviceCosts)?JSON.stringify(o7(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:ve(this.status)?GF.toJSON(this.status):null,TimeWindowEnd:ve(this.timeWindowEnd)?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:ve(this.timeWindowStart)?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new io({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};$o.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}],$o.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:[]},E([N({type:Sy.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:Sy.read}}})],$o.prototype,"arriveCurbApproach",void 0),E([N({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],$o.prototype,"arriveTime",void 0),E([N()],$o.prototype,"arriveTimeOffset",void 0),E([Vi("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],$o.prototype,"readArriveTimeOffset",null),E([N({json:{name:"attributes.Bearing",read:!1,write:!0}})],$o.prototype,"bearing",void 0),E([N({json:{name:"attributes.BearingTol",read:!1,write:!0}})],$o.prototype,"bearingTol",void 0),E([N()],$o.prototype,"cumulativeCosts",void 0),E([Vi("cumulativeCosts",["attributes"])],$o.prototype,"readCumulativeCosts",null),E([N()],$o.prototype,"cumulativeDistance",void 0),E([N()],$o.prototype,"cumulativeDuration",void 0),E([N({type:Sy.apiValues,json:{name:"attributes.CurbApproach",read:{reader:Sy.read},write:{writer:Sy.write}}})],$o.prototype,"curbApproach",void 0),E([N({type:Sy.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:Sy.read}}})],$o.prototype,"departCurbApproach",void 0),E([N({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],$o.prototype,"departTime",void 0),E([N()],$o.prototype,"departTimeOffset",void 0),E([Vi("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],$o.prototype,"readDepartTimeOffset",null),E([N({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],$o.prototype,"distanceToNetworkInMeters",void 0),E([N({type:er,json:{write:!0}})],$o.prototype,"geometry",void 0),E([N()],$o.prototype,"lateDuration",void 0),E([N({type:wee.apiValues,json:{name:"attributes.LocationType",read:{reader:wee.read},write:{writer:wee.write}}})],$o.prototype,"locationType",void 0),E([N({json:{name:"attributes.Name"}})],$o.prototype,"name",void 0),E([N({json:{name:"attributes.NavLatency",read:!1,write:!0}})],$o.prototype,"navLatency",void 0),E([N({json:{name:"attributes.ObjectID"}})],$o.prototype,"objectId",void 0),E([N({type:wh})],$o.prototype,"popupTemplate",void 0),E([N({json:{read:{source:"attributes.PosAlong"}}})],$o.prototype,"posAlong",void 0),E([N({json:{name:"attributes.RouteName"}})],$o.prototype,"routeName",void 0),E([N()],$o.prototype,"serviceCosts",void 0),E([Vi("serviceCosts",["attributes"])],$o.prototype,"readServiceCosts",null),E([Cr("serviceCosts")],$o.prototype,"writeServiceCosts",null),E([N()],$o.prototype,"serviceDistance",void 0),E([N()],$o.prototype,"serviceDuration",void 0),E([N({json:{name:"attributes.Sequence"}})],$o.prototype,"sequence",void 0),E([N({type:zge.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:zge.read}}})],$o.prototype,"sideOfEdge",void 0),E([N({json:{read:{source:"attributes.SnapX"}}})],$o.prototype,"snapX",void 0),E([N({json:{read:{source:"attributes.SnapY"}}})],$o.prototype,"snapY",void 0),E([N({json:{read:{source:"attributes.SnapZ"}}})],$o.prototype,"snapZ",void 0),E([N({json:{read:{source:"attributes.SourceID"}}})],$o.prototype,"sourceId",void 0),E([N({json:{read:{source:"attributes.SourceOID"}}})],$o.prototype,"sourceOid",void 0),E([N({type:GF.apiValues,json:{read:{source:"attributes.Status",reader:GF.read}}})],$o.prototype,"status",void 0),E([N({types:Hh})],$o.prototype,"symbol",void 0),E([N({type:Date,json:{name:"attributes.TimeWindowEnd"}})],$o.prototype,"timeWindowEnd",void 0),E([Cr("timeWindowEnd")],$o.prototype,"writeTimeWindowEnd",null),E([N()],$o.prototype,"timeWindowEndOffset",void 0),E([N({type:Date,json:{name:"attributes.TimeWindowStart"}})],$o.prototype,"timeWindowStart",void 0),E([Cr("timeWindowStart")],$o.prototype,"writeTimeWindowStart",null),E([N()],$o.prototype,"timeWindowStartOffset",void 0),E([N({readOnly:!0,json:{read:!1}})],$o.prototype,"type",void 0),E([N()],$o.prototype,"violations",void 0),E([Vi("violations",["attributes"])],$o.prototype,"readViolations",null),E([N()],$o.prototype,"waitDuration",void 0),E([N()],$o.prototype,"wait",void 0),E([Vi("wait",["attributes"])],$o.prototype,"readWait",null),$o=Pke=E([dt("esri.rest.support.Stop")],$o);const X6=$o,vur=Object.freeze({remove(){},pause(){},resume(){}}),_ur=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],Tee={graphic:null,property:null,oldValue:null,newValue:null};function Oke(t){return t instanceof r7||t instanceof n7||t instanceof W6||t instanceof q6||t instanceof Y6||t instanceof Cee||t instanceof X6}function bur(t){return Sr.isCollection(t)&&t.length&&Oke(t.getItemAt(0))}function wur(t){return Array.isArray(t)&&t.length>0&&Oke(t[0])}let Eee=class extends wy(xy){constructor(){super(...arguments),this._graphics=new Sr,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new L2({getCollections:()=>ve(this.layer)&&!this.destroyed?[ve(this.layer.routeInfo)?new Sr([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),Yo)}destroy(){this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),this._get("_routeItems")?.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}async fetchPopupFeatures(e){return this._graphicsView.hitTest(e).filter(i=>!!i.popupTemplate)}highlight(e){let i;i=Oke(e)?[this._getNetworkFeatureUid(e)]:wur(e)?e.map(n=>this._getNetworkFeatureUid(n)):bur(e)?e.map(n=>this._getNetworkFeatureUid(n)).toArray():[e.uid];const r=i.filter(ve);return r.length?(this._addHighlight(r),{remove:()=>this._removeHighlight(r)}):vur}async hitTest(e,i){if(this.suspended)return null;const r=this._graphicsView.hitTest(e).filter(ve).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 i of e)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i);this._highlightIds.set(i,r+1)}else this._highlightIds.set(i,1);this._updateHighlight()}_createGraphic(e){const i=e.toGraphic();return i.layer=this.layer,i.sourceLayer=this.layer,i}_createGraphicsView(){const e=this.view,i=()=>this.requestUpdate(),r=new AO(e.featuresTilingScheme);this._graphicsView=new gx({container:r,graphics:this._graphics,requestUpdateCallback:i,view:e}),this.container.addChild(r),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(e){const i=this._networkGraphicMap.get(e);return _ur.indexOf(i.type)}_getNetworkFeatureUid(e){return this._networkFeatureMap.has(e)?this._networkFeatureMap.get(e).uid:null}_removeHighlight(e){for(const i of e)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i)-1;r===0?this._highlightIds.delete(i):this._highlightIds.set(i,r)}this._updateHighlight()}_routeItemsChanged(e){if(e.removed.length){this._graphics.removeMany(e.removed.map(i=>{const r=this._networkFeatureMap.get(i);return this._networkFeatureMap.delete(i),this._networkGraphicMap.delete(r),r}));for(const i of e.removed)this.removeHandles(i)}if(e.added.length){this._graphics.addMany(e.added.map(i=>{const r=this._createGraphic(i);return lt(r.symbol)?null:(this._networkFeatureMap.set(i,r),this._networkGraphicMap.set(r,i),r)}).filter(ve));for(const i of e.added)this.addHandles([sr(()=>i.geometry,(r,n)=>{this._updateGraphic(i,"geometry",r,n)}),sr(()=>i.symbol,(r,n)=>{this._updateGraphic(i,"symbol",r,n)})],i);this._graphics.sort((i,r)=>this._getDrawOrder(i)-this._getDrawOrder(r))}}_updateGraphic(e,i,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[i]=r,Tee.graphic=s,Tee.property=i,Tee.oldValue=n,Tee.newValue=r,this._graphicsView.graphicUpdateHandler(Tee)}_updateHighlight(){const e=Array.from(this._highlightIds.keys());this._graphicsView.setHighlight(e)}};E([N()],Eee.prototype,"_graphics",void 0),E([N()],Eee.prototype,"_routeItems",null),Eee=E([dt("esri.views.2d.layers.RouteLayerView2D")],Eee);const xur=Object.freeze(Object.defineProperty({__proto__:null,default:Eee},Symbol.toStringTag,{value:"Module"}));function hOt(t,e){if(lt(t)&<(e))return null;const i={};return ve(e)&&(i.geometry=e.toJSON()),ve(t)&&(i.where=t),i}let a7=class extends kge{constructor(){super(...arguments),this._enabledEventTypes=new Set,this._isUserPaused=!1,this.errorString=null,this.connectionStatus="disconnected"}initialize(){this.addHandles([sr(()=>this.layer.customParameters,e=>this._proxy.updateCustomParameters(e)),this.layer.on("send-message-to-socket",e=>this._proxy.sendMessageToSocket(e)),this.layer.on("send-message-to-client",e=>this._proxy.sendMessageToClient(e)),sr(()=>this.layer.purgeOptions,()=>this._update()),sr(()=>this.suspended,e=>{e?this._proxy.pauseStream():this._isUserPaused||this._proxy.resumeStream()})],"constructor")}get connectionError(){if(this.errorString)return new st("stream-controller",this.errorString)}pause(){this._isUserPaused=!0,this._proxy.pauseStream()}resume(){this._isUserPaused=!1,this._proxy.resumeStream()}on(e,i){if(Array.isArray(e))return R8(e.map(o=>this.on(o,i)));const r=["data-received","message-received"].includes(e);r&&(this._enabledEventTypes.add(e),this._proxy.enableEvent(e,!0));const n=super.on(e,i),s=this;return{remove(){n.remove(),r&&(s._proxy.closed||s.hasEventListener(e)||s._proxy.enableEvent(e,!1))}}}queryLatestObservations(e,i){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new st("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");return this._proxy.queryLatestObservations(this._cleanUpQuery(e),i).then(r=>{const n=tc.fromJSON(r);return n.features.forEach(s=>{s.layer=this.layer,s.sourceLayer=this.layer}),n})}detach(){super.detach(),this.connectionStatus="disconnected"}_createClientOptions(){return{...super._createClientOptions(),setProperty:e=>{this.set(e.propertyName,e.value)}}}_createTileRendererHash(e){const i=`${JSON.stringify(this.layer.purgeOptions)}.${JSON.stringify(hOt(this.layer.definitionExpression,this.layer.geometryDefinition))})`;return super._createTileRendererHash(e)+i}async _createServiceOptions(){const e=this.layer,{objectIdField:i}=e,r=e.fields.map(a=>a.toJSON()),n=xge(e.geometryType),s=e.timeInfo&&e.timeInfo.toJSON()||null,o=e.spatialReference?e.spatialReference.toJSON():null;return{type:"stream",fields:r,geometryType:n,objectIdField:i,timeInfo:s,source:this.layer.parsedUrl,serviceFilter:hOt(this.layer.definitionExpression,this.layer.geometryDefinition),purgeOptions:this.layer.purgeOptions.toJSON(),enabledEventTypes:Array.from(this._enabledEventTypes.values()),spatialReference:o,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,updateInterval:this.layer.updateInterval,customParameters:e.customParameters}}};E([N()],a7.prototype,"errorString",void 0),E([N({readOnly:!0})],a7.prototype,"connectionError",null),E([N()],a7.prototype,"connectionStatus",void 0),a7=E([dt("esri.views.2d.layers.StreamLayerView2D")],a7);const Sur=Object.freeze(Object.defineProperty({__proto__:null,default:a7},Symbol.toStringTag,{value:"Module"}));function Cur(t,e){return!t.visible||t.minScale!==0&&e>t.minScale||t.maxScale!==0&&ethis.view.scale,()=>this._update(),Yo)],"constructor")}isUpdating(){const e=this.layer.sublayers.some(l=>l.renderer!=null),i=this._commandsQueue.updating,r=this._updatingRequiredFieldsPromise!=null,n=!this._proxy||!this._proxy.isReady,s=this._pipelineIsUpdating,o=this.tileRenderer==null||this.tileRenderer?.updating,a=e&&(i||r||n||s||o);return Hi("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${a} -> hasRenderer ${e} -> hasPendingCommand ${i} -> updatingRequiredFields ${r} -> updatingProxy ${n} -> updatingPipeline ${s} -> updatingTileRenderer ${o} -`),a}_injectOverrides(e){let i=super._injectOverrides(e);const r=this.view.scale,n=this.layer.sublayers.filter(o=>blr(o,r)).map(o=>o.subtypeCode);if(!n.length)return i;i=ye(i)?i:new bq().toJSON();const s=`NOT ${this.layer.subtypeField} IN (${n.join(",")})`;return i.where=i.where?`(${i.where}) AND (${s})`:s,i}_setLayersForFeature(e){const i=this.layer.fieldsIndex.get(this.layer.subtypeField),r=e.attributes[i.name],n=this.layer.sublayers.find(s=>s.subtypeCode===r);e.layer=e.sourceLayer=n}_createSchemaConfig(){const e={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers).map(s=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:s.labelingInfo,labelsVisible:s.labelsVisible,renderer:s.renderer,subtypeCode:s.subtypeCode,orderBy:null}))},i=this.layer.sublayers.map(s=>s.subtypeCode).join(","),r=this.layer.sublayers.length?`${this.layer.subtypeField} IN (${i})`:"1=2";let n=this.layer.definitionExpression?this.layer.definitionExpression+" AND ":"";return n+=r,{...super._createSchemaConfig(),...e,definitionExpression:n}}};uNe=E([ht("esri.views.2d.layers.SubtypeGroupLayerView2D")],uNe);const wlr=Object.freeze(Object.defineProperty({__proto__:null,default:uNe},Symbol.toStringTag,{value:"Module"}));let xee=class{constructor(e,i){this._width=0,this._height=0,this._free=[],this._width=e,this._height=i,this._free.push(new Ed(0,0,e,i))}get width(){return this._width}get height(){return this._height}allocate(e,i){if(e>this._width||i>this._height)return new Ed;let r=null,n=-1;for(let s=0;se&&this._free.push(new Ed(r.x+e,r.y,r.width-e,i)),r.height>i&&this._free.push(new Ed(r.x,r.y+i,r.width,r.height-i))):(r.width>e&&this._free.push(new Ed(r.x+e,r.y,r.width-e,r.height)),r.height>i&&this._free.push(new Ed(r.x,r.y+i,e,r.height-i))),new Ed(r.x,r.y,e,i))}release(e){for(let i=0;i{if(l<=256){const c=e+l;if(this._rangePromises.has(c))a.push(this._rangePromises.get(c));else{const d=n.getRange(e,l).then(()=>{this._rangePromises.delete(c)},()=>{this._rangePromises.delete(c)});this._rangePromises.set(c,d),a.push(d)}}}),Promise.all(a).then(()=>{let l=this._glyphIndex[e];l||(l={},this._glyphIndex[e]=l);for(const c of i){const d=l[c];if(d){r[c]={sdf:!0,rect:d.rect,metrics:d.metrics,page:d.page,code:c};continue}const p=n.getGlyph(e,c);if(!p||!p.metrics)continue;const y=p.metrics;let v;if(y.width===0)v=new Ed(0,0,0,0);else{const I=y.width+6,O=y.height+2*3;let L=I%4?4-I%4:4,N=O%4?4-O%4:4;L===1&&(L=5),N===1&&(N=5),v=this._binPack.allocate(I+L,O+N),v.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 xee(this.width-4,this.height-4),v=this._binPack.allocate(I+L,O+N));const G=this._glyphData[this._currentPage],V=p.bitmap;let Y,X;if(V)for(let te=0;te{r.addRange(i,new cNe(new z5(new Uint8Array(a.data),new DataView(a.data))))}).catch(()=>{r.addRange(i,new cNe)})}return r.addRange(i,new cNe),Promise.resolve()}getGlyph(e,i){const r=this._getFontStack(e);if(!r)return;const n=Math.floor(i/256);if(n>256)return;const s=r.getRange(n);return s?{metrics:s.getMetrics(i),bitmap:s.getBitmap(i)}:void 0}_getFontStack(e){let i=this._glyphInfo[e];return i||(i=this._glyphInfo[e]=new xlr),i}};const Slr="dasharray-";let hNe=class q5t{constructor(e,i,r=0){this._size=[],this._mosaicsData=[],this._textures=[],this._dirties=[],this._maxItemSize=0,this._currentPage=0,this._pageWidth=0,this._pageHeight=0,this._mosaicRects={},this.pixelRatio=1,(e<=0||i<=0)&&console.error("Sprites mosaic defaultWidth and defaultHeight must be greater than zero!"),this._pageWidth=e,this._pageHeight=i,r>0&&(this._maxItemSize=r),this._binPack=new xee(e-4,i-4)}dispose(){this._binPack=null,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 xee(this._pageWidth-4,this._pageHeight-4);const i=Math.floor(this._pageWidth),r=Math.floor(this._pageHeight),n=new Uint32Array(i*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,i=!1){let r,n,s=this._mosaicRects[e];if(s)return s;if(!this._sprites||this._sprites.loadStatus!=="loaded"||(e&&e.startsWith(Slr)?([r,n]=this._rasterizeDash(e),i=!0):r=this._sprites.getSpriteInfo(e),!r||!r.width||!r.height||r.width<0||r.height<0))return null;const o=r.width,a=r.height,[l,c,d]=this._allocateImage(o,a);return l.width<=0?null:(this._copy(l,r,c,d,i,n),s={rect:l,width:o,height:a,sdf:r.sdf,simplePattern:!1,pixelRatio:r.pixelRatio,page:c},this._mosaicRects[e]=s,s)}getSpriteItems(e){const i={};for(const r of e)i[r.name]=this.getSpriteItem(r.name,r.repeat);return i}getMosaicItemPosition(e,i){const r=this.getSpriteItem(e,i),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,i,r=0,n=0){if(r>=this._size.length||r>=this._mosaicsData.length)return;this._textures[r]||(this._textures[r]=new bs(e,{pixelFormat:nn.RGBA,dataType:ts.UNSIGNED_BYTE,wrapMode:us.CLAMP_TO_EDGE,width:this._size[r][0],height:this._size[r][1]},new Uint8Array(this._mosaicsData[r].buffer)));const s=this._textures[r];s.setSamplingMode(i),this._dirties[r]&&s.setData(new Uint8Array(this._mosaicsData[r].buffer)),e.bindTexture(s,n),this._dirties[r]=!1}static _copyBits(e,i,r,n,s,o,a,l,c,d,p){let y=n*i+r,v=l*o+a;if(p){v-=o;for(let S=-1;S<=d;S++,y=((S+d)%d+n)*i+r,v+=o)for(let I=-1;I<=c;I++)s[v+I]=e[y+(I+c)%c]}else for(let S=0;S=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 c=2,d=o?i.width:this._sprites.width;q5t._copyBits(a,d,i.x,i.y,l,n[0],e.x+c,e.y+c,i.width,i.height,s),this._dirties[r]=!0}_allocateImage(e,i){e+=2,i+=2;const r=Math.max(e,i);if(this._maxItemSize&&this._maxItemSizethis._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(e){this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,e),this._spriteSourcePromise.then(n=>{this._spriteMosaic=new hNe(1024,1024,250),this._spriteMosaic.setSpriteSource(n)});const i=this._layer.currentStyleInfo.glyphsUrl,r=new EPt(i?jy(i,{...this._layer.customParameters,token:this._layer.apiKey}):null);this._glyphMosaic=new TPt(1024,1024,r),this._broadcastPromise=wA("WorkerTileHandler",{client:this,schedule:e.schedule,signal:e.signal}).then(n=>{if(this._connection=n,this._layer&&!this._connection.closed){const s=n.broadcast("setStyle",this._layer.currentStyleInfo.style,e);Promise.all(s).catch(o=>wC(o))}})}async updateStyle(e){return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(e){const i=new hNe(1024,1024,250);return i.setSpriteSource(e),this._spriteMosaic=i,this._spriteSourcePromise=Promise.resolve(e),i}async setStyle(e,i){await this._broadcastPromise,this._styleRepository=e,this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,null),this._spriteSourcePromise.then(n=>{this._spriteMosaic=new hNe(1024,1024,250),this._spriteMosaic.setSpriteSource(n)});const r=new EPt(this._layer.currentStyleInfo.glyphsUrl?jy(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);return this._glyphMosaic=new TPt(1024,1024,r),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",i)),this._broadcastPromise}fetchTileData(e,i){return this._getRefKeys(e,i).then(r=>{const n=this._layer.sourceNameToSource,s=[];for(const o in n)s.push(o);return this._getSourcesData(s,r,i)})}parseTileData(e,i){const r=e&&e.data;if(!r)return Promise.resolve(null);const{sourceName2DataAndRefKey:n,transferList:s}=r;return Object.keys(n).length===0?Promise.resolve(null):this._broadcastPromise.then(()=>this._connection.invoke("createTileAndParse",{key:e.key.id,sourceName2DataAndRefKey:n,styleLayerUIDs:e.styleLayerUIDs},{...i,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,i,r){const n=xh.pool.acquire(e.id),s=this._layer.sourceNameToSource[i],{level:o,row:a,col:l}=n;xh.pool.release(n);try{return{protobuff:await s.requestTile(o,a,l,r),sourceName:i}}catch(c){if(ss(c))throw c;return{protobuff:null,sourceName:i}}}_getRefKeys(e,i){const r=this._layer.sourceNameToSource,n=new Array;for(const s in r){const o=r[s].getRefKey(e,i);n.push(o)}return bu(n)}_getSourcesData(e,i,r){const n=[];for(let s=0;s{const o={},a=[];for(let l=0;l0){const d=i[l].value.id;o[c.sourceName]={refKey:d,protobuff:c.protobuff},a.push(c.protobuff)}}return{sourceName2DataAndRefKey:o,transferList:a}})}};const IPt=512,Tlr=1e-6,Elr=(t,e)=>t+1/(1<<2*e);let Ilr=class{constructor(e,i){this._tiles=new Map,this._tileCache=new E9(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=i}destroy(){for(const[e,i]of this._tiles)i.dispose();this._tiles=null,this._tileCache.clear(),this._tileCache=null}update(e){this._updateCacheSize(e);const i=this.tileInfoView,r=i.getTileCoverage(e.state,0,"smallest"),{spans:n,lodInfo:s}=r,{level:o}=s,a=this._tiles,l=new Set,c=new Set;for(const{row:p,colFrom:y,colTo:v}of n)for(let S=y;S<=v;S++){const I=xh.getId(o,p,s.normalizeCol(S),s.getWorldForColumn(S)),O=this._getOrAcquireTile(I);l.add(I),O.processed()?this._addToContainer(O):c.add(new xh(I))}for(const[p,y]of a)y.isCoverage=l.has(p);for(const p of c)this._findPlaceholdersForMissingTiles(p,l);let d=!1;for(const[p,y]of a)y.neededForCoverage=l.has(p),y.neededForCoverage||y.isHoldingForFade&&i.intersects(r,y.key)&&l.add(p),y.isFading&&(d=!0);for(const[p,y]of this._tiles)l.has(p)||this._releaseTile(p);return lP.pool.release(r),!d}clear(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}clearCache(){this._tileCache.clear()}_findPlaceholdersForMissingTiles(e,i){const r=[];for(const[s,o]of this._tiles)this._addPlaceholderChild(r,o,e,i);const n=r.reduce(Elr,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 i=e.state.size;if(i[0]===this._viewSize[0]&&i[1]===this._viewSize[1])return;const r=Math.ceil(i[0]/IPt)+1,n=Math.ceil(i[1]/IPt)+1;this._viewSize[0]=i[0],this._viewSize[1]=i[1],this._tileCache.maxSize=5*r*n}};function Alr(t){const[e,i,r,n]=t.split("/"),s=parseInt(e,10);return s===0?null:`${s-1}/${parseInt(i,10)>>1}/${parseInt(r,10)>>1}/${parseInt(n,10)}`}function Plr(t,e){const i=e.level-t.level;return t.row===e.row>>i&&t.col===e.col>>i&&t.world===e.world}let Olr=class{constructor(e){this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=e}},Rlr=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 APt(t,e,i,r,n,s){const o=i-n;if(o>=0)return(e>>o)+(r-(s<>o);const a=-o;return e-(s-(r<>a)<0){const o=new Map;for(let a=0;a0}triangleCount(){return this.lineIndexCount/3}doDestroy(){ye(this.lineVertexArrayObject)&&this.lineVertexArrayObject.dispose(),ye(this.lineVertexBuffer)&&this.lineVertexBuffer.dispose(),ye(this.lineIndexBuffer)&&this.lineIndexBuffer.dispose(),this.lineVertexArrayObject=null,this.lineVertexBuffer=null,this.lineIndexBuffer=null,this.memoryUsed=0}doPrepareForRendering(e,i,r){const n=new Uint32Array(i),s=new Int32Array(n.buffer),o=n[r++];this.lineVertexBuffer=Ko.createVertex(e,Lo.STATIC_DRAW,new Int32Array(s.buffer,4*r,o)),r+=o;const a=n[r++];this.lineIndexBuffer=Ko.createIndex(e,Lo.STATIC_DRAW,new Uint32Array(n.buffer,4*r,a)),r+=a;const l=this.layer.lineMaterial;this.lineVertexArrayObject=new Ac(e,l.getAttributeLocations(),l.getLayoutInfo(),{geometry:this.lineVertexBuffer},this.lineIndexBuffer)}},klr=class extends Tge{constructor(e,i){super(e,i),this.type=_g.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){const o=new Map;for(let a=0;a0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){ye(this.fillVertexArrayObject)&&this.fillVertexArrayObject.dispose(),ye(this.fillVertexBuffer)&&this.fillVertexBuffer.dispose(),ye(this.fillIndexBuffer)&&this.fillIndexBuffer.dispose(),this.fillVertexArrayObject=null,this.fillVertexBuffer=null,this.fillIndexBuffer=null,ye(this.outlineVertexArrayObject)&&this.outlineVertexArrayObject.dispose(),ye(this.outlineVertexBuffer)&&this.outlineVertexBuffer.dispose(),ye(this.outlineIndexBuffer)&&this.outlineIndexBuffer.dispose(),this.outlineVertexArrayObject=null,this.outlineVertexBuffer=null,this.outlineIndexBuffer=null,this.memoryUsed=0}doPrepareForRendering(e,i,r){const n=new Uint32Array(i),s=new Int32Array(n.buffer),o=n[r++];this.fillVertexBuffer=Ko.createVertex(e,Lo.STATIC_DRAW,new Int32Array(s.buffer,4*r,o)),r+=o;const a=n[r++];this.fillIndexBuffer=Ko.createIndex(e,Lo.STATIC_DRAW,new Uint32Array(n.buffer,4*r,a)),r+=a;const l=n[r++];this.outlineVertexBuffer=Ko.createVertex(e,Lo.STATIC_DRAW,new Int32Array(s.buffer,4*r,l)),r+=l;const c=n[r++];this.outlineIndexBuffer=Ko.createIndex(e,Lo.STATIC_DRAW,new Uint32Array(n.buffer,4*r,c)),r+=c;const d=this.layer,p=d.fillMaterial,y=d.outlineMaterial;this.fillVertexArrayObject=new Ac(e,p.getAttributeLocations(),p.getLayoutInfo(),{geometry:this.fillVertexBuffer},this.fillIndexBuffer),this.outlineVertexArrayObject=new Ac(e,y.getAttributeLocations(),y.getLayoutInfo(),{geometry:this.outlineVertexBuffer},this.outlineIndexBuffer)}},Nlr=class extends Tge{constructor(e,i,r){super(e,i),this.type=_g.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++];for(let y=0;y0||this.glyphPerPageElementsMap.size>0}triangleCount(){let e=0;for(const[i,r]of this.iconPerPageElementsMap)e+=r[1];for(const[i,r]of this.glyphPerPageElementsMap)e+=r[1];return e/3}doDestroy(){ye(this.iconVertexArrayObject)&&this.iconVertexArrayObject.dispose(),ye(this.iconVertexBuffer)&&this.iconVertexBuffer.dispose(),ye(this.iconOpacityBuffer)&&this.iconOpacityBuffer.dispose(),ye(this.iconIndexBuffer)&&this.iconIndexBuffer.dispose(),this.iconVertexArrayObject=null,this.iconVertexBuffer=null,this.iconOpacityBuffer=null,this.iconIndexBuffer=null,ye(this.textVertexArrayObject)&&this.textVertexArrayObject.dispose(),ye(this.textVertexBuffer)&&this.textVertexBuffer.dispose(),ye(this.textOpacityBuffer)&&this.textOpacityBuffer.dispose(),ye(this.textIndexBuffer)&&this.textIndexBuffer.dispose(),this.textVertexArrayObject=null,this.textVertexBuffer=null,this.textOpacityBuffer=null,this.textIndexBuffer=null,this.memoryUsed=0}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const e=this.iconOpacity,i=this.iconOpacityBuffer;e.length>0&&e.byteLength===i.size&&i.setSubData(e,0,0,e.length);const r=this.textOpacity,n=this.textOpacityBuffer;r.length>0&&r.byteLength===n.size&&n.setSubData(r,0,0,r.length)}doPrepareForRendering(e,i,r){const n=new Uint32Array(i),s=new Int32Array(n.buffer),o=n[r++];this.iconVertexBuffer=Ko.createVertex(e,Lo.STATIC_DRAW,new Int32Array(s.buffer,4*r,o)),r+=o;const a=n[r++];this.iconIndexBuffer=Ko.createIndex(e,Lo.STATIC_DRAW,new Uint32Array(n.buffer,4*r,a)),r+=a;const l=n[r++];this.textVertexBuffer=Ko.createVertex(e,Lo.STATIC_DRAW,new Int32Array(s.buffer,4*r,l)),r+=l;const c=n[r++];this.textIndexBuffer=Ko.createIndex(e,Lo.STATIC_DRAW,new Uint32Array(n.buffer,4*r,c)),r+=c,this.iconOpacityBuffer=Ko.createVertex(e,Lo.STATIC_DRAW,this.iconOpacity.buffer),this.textOpacityBuffer=Ko.createVertex(e,Lo.STATIC_DRAW,this.textOpacity.buffer);const d=this.layer,p=d.iconMaterial,y=d.textMaterial;this.iconVertexArrayObject=new Ac(e,p.getAttributeLocations(),p.getLayoutInfo(),{geometry:this.iconVertexBuffer,opacity:this.iconOpacityBuffer},this.iconIndexBuffer),this.textVertexArrayObject=new Ac(e,y.getAttributeLocations(),y.getLayoutInfo(),{geometry:this.textVertexBuffer,opacity:this.textOpacityBuffer},this.textIndexBuffer)}},$lr=class extends Tge{constructor(e,i){super(e,i),this.type=_g.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}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){ye(this.circleVertexArrayObject)&&this.circleVertexArrayObject.dispose(),ye(this.circleVertexBuffer)&&this.circleVertexBuffer.dispose(),ye(this.circleIndexBuffer)&&this.circleIndexBuffer.dispose(),this.circleVertexArrayObject=null,this.circleVertexBuffer=null,this.circleIndexBuffer=null,this.memoryUsed=0}doPrepareForRendering(e,i,r){const n=new Uint32Array(i),s=new Int32Array(n.buffer),o=n[r++];this.circleVertexBuffer=Ko.createVertex(e,Lo.STATIC_DRAW,new Int32Array(s.buffer,4*r,o)),r+=o;const a=n[r++];this.circleIndexBuffer=Ko.createIndex(e,Lo.STATIC_DRAW,new Uint32Array(n.buffer,4*r,a)),r+=a;const l=this.layer.circleMaterial;this.circleVertexArrayObject=new Ac(e,l.getAttributeLocations(),l.getLayoutInfo(),{geometry:this.circleVertexBuffer},this.circleIndexBuffer)}},Blr=class Y5t extends Cj{constructor(e,i,r,n,s,o,a,l=null){super(e,i,r,n,s,o,4096,4096),this._memCache=l,this.type="vector-tile",this._referenced=0,this._hasSymbolBuckets=!1,this._memoryUsedByLayerData=0,this.layerData=new Map,this.layerCount=0,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.invalidating=!1,this.parentTile=null,this.childrenTiles=new Set,this._processed=!1,this._referenced=1,this.styleRepository=a,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate0}dispose(){this.status!=="unloaded"&&(Glr.delete(this),Y5t._destroyRenderBuckets(this.layerData),this.layerData=null,this.layerCount=0,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 memoryUsage(){return(this._memoryUsedByLayerData+256)/(this._referenced||1)}changeDataImpl(e){let i=!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===_g.SYMBOL&&(this.symbols.set(o,a.symbols),i=!0),this._memoryUsedByLayerData+=a.memoryUsed,this.layerData.set(o,a),this.layerCount++;ye(this._memCache)&&this._memCache.updateSize(this.key.id,this,this._memoryUsedByLayerData)}this._hasSymbolBuckets=!1;for(const[r,n]of this.layerData)n.type===_g.SYMBOL&&(this._hasSymbolBuckets=!0);i&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(i){i.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const i=this.resolution/(e.resolution*e.pixelRatio),r=this.width/this.rangeX*i,n=this.height/this.rangeY*i,s=[0,0];e.toScreen(s,[this.x,this.y]);const o=this.transforms.tileUnitsToPixels;rP(o),ug(o,o,s),ST(o,o,Math.PI*e.rotation/180),nP(o,o,[r,n,1])}_createTransforms(){return{dvs:Cl(),tileMat3:Cl(),tileUnitsToPixels:Cl()}}static _destroyRenderBuckets(e){if(!e)return;const i=new Set;e.forEach(r=>{i.has(r)||(r.destroy(),i.add(r))}),e.clear()}_createRenderBuckets(e){const i=new Map,r=new Map;for(const n of e){const s=this._deserializeBucket(n,r);for(const o of s.layerUIDs)i.set(o,s)}return i}_deserializeBucket(e,i){let r=i.get(e);if(r)return r;switch(new Uint32Array(e)[0]){case _g.FILL:r=new klr(e,this.styleRepository);break;case _g.LINE:r=new Llr(e,this.styleRepository);break;case _g.SYMBOL:r=new Nlr(e,this.styleRepository,this);break;case _g.CIRCLE:r=new $lr(e,this.styleRepository)}return i.set(e,r),r}_deleteLayerData(e){if(!this.layerData.has(e))return;const i=this.layerData.get(e);this._memoryUsedByLayerData-=i.memoryUsed,i.destroy(),this.layerData.delete(e),this.layerCount--}};const Glr=new Map;function Vlr(t,e,i,r,n,s){const{iconRotationAlignment:o,textRotationAlignment:a,iconTranslate:l,iconTranslateAnchor:c,textTranslate:d,textTranslateAnchor:p}=r;let y=0;for(const v of t.colliders){const[S,I]=v.partIndex===0?l:d,O=v.partIndex===0?c:p,L=v.minLod<=s&&s<=v.maxLod;y+=L?0:1,v.enabled=L,v.xScreen=v.xTile*n[0]+v.yTile*n[3]+n[6],v.yScreen=v.xTile*n[1]+v.yTile*n[4]+n[7],O===B_.MAP?(v.xScreen+=i*S-e*I,v.yScreen+=e*S+i*I):(v.xScreen+=S,v.yScreen+=I),Ju.VIEWPORT===(v.partIndex===0?o:a)?(v.dxScreen=v.dxPixels,v.dyScreen=v.dyPixels):(v.dxScreen=i*(v.dxPixels+v.width/2)-e*(v.dyPixels+v.height/2)-v.width/2,v.dyScreen=e*(v.dxPixels+v.width/2)+i*(v.dyPixels+v.height/2)-v.height/2)}t.colliders.length>0&&y===t.colliders.length&&(t.unique.show=!1)}let Ulr=class{constructor(e,i,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 PPt(i,r,H8i),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,trt(l.tile.transforms.tileUnitsToPixels))}work(e){const i=this._gridIndex;function r(s){const o=s.xScreen+s.dxScreen,a=s.yScreen+s.dyScreen,l=o+s.width,c=a+s.height,[d,p,y,v]=i.getCellSpan(o,a,l,c);for(let S=p;S<=v;S++)for(let I=d;I<=y;I++){const O=i.cells[S][I];for(const L of O){const N=L.xScreen+L.dxScreen,G=L.yScreen+L.dyScreen,V=N+L.width,Y=G+L.height;if(!(lV||cY))return!0}}return!1}const n=performance.now();for(;this._currentLayerCursore)return!1;const a=s.symbols[this._currentSymbolCursor];if(!a.unique.show)continue;Vlr(a,this._si,this._co,o,this._allNeededMatrices.get(a.tile),this._zoom);const l=a.unique;if(!l.show)continue;const{iconAllowOverlap:c,iconIgnorePlacement:d,textAllowOverlap:p,textIgnorePlacement:y}=o;for(const v of a.colliders){if(!v.enabled)continue;const S=l.parts[v.partIndex];S.show&&!(v.partIndex?p:c)&&r(v)&&(v.hard?l.show=!1:S.show=!1)}if(l.show)for(const v of a.colliders){if(!v.enabled||(v.partIndex?y:d)||!l.parts[v.partIndex].show)continue;const S=v.xScreen+v.dxScreen,I=v.yScreen+v.dyScreen,O=S+v.width,L=I+v.height,[N,G,V,Y]=this._gridIndex.getCellSpan(S,I,O,L);for(let X=G;X<=Y;X++)for(let te=N;te<=V;te++)this._gridIndex.cells[X][te].push(v)}}}return!0}_getProperties(e){const i=this._styleProps.get(e);if(i)return i;const r=this._zoom,n=this._styleRepository.getStyleLayerByUID(e),s=n.getLayoutValue("symbol-placement",r)!==nO.POINT;let o=n.getLayoutValue("icon-rotation-alignment",r);o===Ju.AUTO&&(o=s?Ju.MAP:Ju.VIEWPORT);let a=n.getLayoutValue("text-rotation-alignment",r);a===Ju.AUTO&&(a=s?Ju.MAP:Ju.VIEWPORT);const l=n.getPaintValue("icon-translate",r),c=n.getPaintValue("icon-translate-anchor",r),d=n.getPaintValue("text-translate",r),p=n.getPaintValue("text-translate-anchor",r),y={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:c,iconTranslate:l,textTranslateAnchor:p,textTranslate:d};return this._styleProps.set(e,y),y}};function jlr(t,e){if(t.priority-e.priority)return t.priority-e.priority;const i=t.tile.key,r=e.tile.key;return i.world-r.world?i.world-r.world:i.level-r.level?i.level-r.level:i.row-r.row?i.row-r.row:i.col-r.col?i.col-r.col:t.xTile-e.xTile?t.xTile-e.xTile:t.yTile-e.yTile}let zlr=class{get running(){return this._running}constructor(e,i,r,n,s,o){this._visibleTiles=e,this._symbolRepository=i,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,i){this._screenWidth===e&&this._screenHeight===i||this.restart(),this._screenWidth=e,this._screenHeight=i}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 i=performance.now();if(!this._selectionJob.work(e)||(this._selectionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-i)))===0))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const i=performance.now();if(!this._collisionJob.work(e)||(this._collisionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-i)))===0))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const i=performance.now();if(!this._opacityJob.work(e)||(this._opacityJobCompleted=!0,(e=Math.max(0,e-(performance.now()-i)))===0))return!1}return this._running=!1,!0}_createSelectionJob(){const e=this._symbolRepository.uniqueSymbols;for(let l=0;ll)return!1;let S=null,I=!1,O=!1;for(const L of c.tileSymbols)if(!O||!I){const N=L.tile;(!S||N.isCoverage||N.neededForCoverage&&!I)&&(S=L,(N.neededForCoverage||N.isCoverage)&&(O=!0),N.isCoverage&&(I=!0))}if(S.selectedForRendering=!0,O){v.symbols.push(S),c.show=!0;for(const L of c.parts)L.show=!0}else c.show=!1}}for(const p of i)p.symbols.sort(jlr);return!0}const a=this._symbolLayerSorter;return{work:o,get sortedSymbols(){return i.sort(a)}}}_createOpacityJob(){const e=this._assignTileSymbolsOpacity,i=this._visibleTiles;let r=0;function n(s,o){const a=s.symbols;for(const[l,c]of a)Hlr(c,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=i[r];ye(a.parentTile)||n(a,performance.now())}return!0}}}};function Hlr(t,e){for(const i of t){const r=i.unique;for(const n of r.parts){const s=n.targetOpacity>.5?1:-1;n.startOpacity+=s*((e-n.startTime)/LU),n.startOpacity=Math.min(Math.max(n.startOpacity,0),1),n.startTime=e,n.targetOpacity=r.show&&n.show?1:0}}}const Wlr=32,qlr=8,Ylr=64;let Xlr=class{constructor(e,i,r){this.tileCoordRange=e,this._visibleTiles=i,this._createUnique=r,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){return lt(this._uniqueSymbolLayerArray)&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}add(e,i){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(i)for(const a of i)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 c=l.length;if(c>=Wlr){let d=this.tileCoordRange;do d/=2,c/=4;while(c>qlr&&d>Ylr);const p=new PPt(this.tileCoordRange,this.tileCoordRange,d);o.set(a,{flat:l,index:p}),r.symbols.set(a,{flat:l,index:p});for(const y of l)p.getCell(y.xTile,y.yTile).push(y)}else o.set(a,{flat:l}),r.symbols.set(a,{flat:l})}this._addSymbols(e.key,s)}deleteStyleLayers(e){this._uniqueSymbolLayerArray=null;for(const[i,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(i)}}removeTile(e){this._uniqueSymbolLayerArray=null;const i=this._tiles.get(e.id);if(!i)return;const r=new Map;for(const[n,s]of e.symbols)i.symbols.has(n)&&(r.set(n,i.symbols.get(n)),i.symbols.delete(n));this._removeSymbols(r),i.symbols.size===0&&this._tiles.delete(e.id)}_removeSymbols(e){for(const[i,{flat:r}]of e)for(const n of r){const s=n.unique,o=s.tileSymbols,a=o.length-1;for(let l=0;li.level){const s=e.key.level-i.level;if(e.key.row>>s!==i.row||e.key.col>>s!==i.col)return}if(i.level>e.key.level){const s=i.level-e.key.level;if(i.row>>s!==e.key.row||i.col>>s!==e.key.col)return}if(i.equals(e.key)){for(const s of e.childrenTiles)this._matchSymbols(s,i,r);return}const n=new Map;for(const[s,o]of r){const a=[];for(const p of o){const y=APt(this.tileCoordRange,p.xTile,i.level,i.col,e.key.level,e.key.col),v=APt(this.tileCoordRange,p.yTile,i.level,i.row,e.key.level,e.key.row);y>=0&&y=0&&v0&&n.set(s,l)}for(const s of e.childrenTiles)this._matchSymbols(s,i,n)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsReferences,i=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;i[n]={styleLayerUID:s,uniqueSymbols:a},n++}return i}};const Klr=.5,OPt=1e-6;let Jlr=class extends cd{constructor(e,i){super(),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._completed=!1,this._symbolRepository=new Xlr(4096,i,()=>new Rlr),this._symbolDeclutterer=new zlr(i,this._symbolRepository,(r,n,s)=>new Ulr(r,n,s,this.styleRepository,this._zoom,this._viewState.rotation),(r,n)=>{r.allSymbolsFadingOut=!0,r.lastOpacityUpdate=n,Dlr(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+OPt=n.maxzoom)return!1;const s=n.getLayoutProperty("visibility");return!s||s.getValue()!==yE.NONE})}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 i=this._tileToHandle.get(e);i&&(this._symbolRepository.removeTile(e),this.restartDeclutter(),i.remove(),this._tileToHandle.delete(e))}update(e,i){return this._zoom=e,this._viewState={scale:i.scale,rotation:i.rotation,center:[i.center[0],i.center[1]],size:[i.size[0],i.size[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._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._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(W8i),this._completed&&this._scheduleNotifyStable())}_scheduleNotifyStable(){ye(this._stableNotificationHandle)&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout(()=>{this._stableNotificationHandle=null,this.emit("fade-complete")},(1+Klr)*LU)}_notifyUnstable(){ye(this._stableNotificationHandle)&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this.emit("fade-start")}},Zlr=class extends Cj{_createTransforms(){return{dvs:Cl(),tileMat3:Cl()}}};const Ege=1e-6;function RPt(t,e){if(t){const i=t.getLayoutProperty("visibility");if(!i||i.getValue()!==yE.NONE&&(t.minzoom===void 0||t.minzoom=e-Ege))return!0}return!1}let Qlr=class extends iee{constructor(e){super(e),this._backgroundTiles=[],this._pointToCallbacks=new Map}destroy(){this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._glyphMosaic?.dispose(),this._glyphMosaic=null,ye(this._symbolFader)&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[],this._pointToCallbacks.clear()}setStyleResources(e,i,r){if(this._spriteMosaic=e,this._glyphMosaic=i,this._styleRepository=r,lt(this._symbolFader)){const n=new Jlr(this._styleRepository,this.children);n.on("fade-start",()=>{this.emit("fade-start"),this.requestRender()}),n.on("fade-complete",()=>{this.emit("fade-complete"),this.requestRender()}),this._symbolFader=n}this._symbolFader.styleRepository=r}setSpriteMosaic(e){this._spriteMosaic?.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){ye(this._symbolFader)&&this._symbolFader.deleteStyleLayers(e)}async hitTest(e){const i=Mf();return this._pointToCallbacks.set(e,i),this.requestRender(),i.promise}enterTileInvalidation(){for(const e of this.children)e.invalidating=!0}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!==io.MAP&&e.drawPhase!==io.DEBUG||this._spriteMosaic===void 0||super.doRender(e)}addChild(e){return super.addChild(e),ye(this._symbolFader)?this._symbolFader.addTile(e):e.decluttered=!0,this.requestRender(),e}removeChild(e){return ye(this._symbolFader)&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){const{drawPhase:i}=e;if(i!==io.DEBUG){if(this._doRender(e),this._pointToCallbacks.size>0){e.drawPhase=io.HITTEST;const r=e.painter.effects.hittestVTL;r.bind(e),this._doRender(e),r.draw(e,this._pointToCallbacks),r.unbind(e),e.drawPhase=i}}else super.renderChildren(e)}removeAllChildren(){for(let e=0;ee.neededForCoverage&&e.hasData())}restartDeclutter(){ye(this._symbolFader)&&this._symbolFader.restartDeclutter()}_doRender(e){const{context:i}=e,r=this._styleRepository;if(!r)return;const n=r.layers;let s=!0;e.drawPhase===io.HITTEST&&(s=!1),r.backgroundBucketIds.length>0&&(e.renderPass="background",this._renderBackgroundLayers(e,r.backgroundBucketIds)),super.renderChildren(e),e.drawPhase===io.MAP&&this._fade(e.displayLevel,e.state);const o=this.children.filter(a=>a.visible&&a.hasData());if(!o||o.length===0)return i.bindVAO(),i.setStencilTestEnabled(!0),void i.setBlendingEnabled(!0);for(const a of o)a.triangleCount=0;i.setStencilWriteMask(0),i.setColorMask(!0,!0,!0,!0),i.setStencilOp(Yl.KEEP,Yl.KEEP,Yl.REPLACE),i.setStencilTestEnabled(!0),i.setBlendingEnabled(!1),i.setDepthTestEnabled(!0),i.setDepthWriteEnabled(!0),i.setDepthFunction(El.LEQUAL),i.setClearDepth(1),i.clear(i.gl.DEPTH_BUFFER_BIT),e.renderPass="opaque";for(let a=n.length-1;a>=0;a--)this._renderStyleLayer(n[a],e,o);i.setDepthWriteEnabled(!1),i.setBlendingEnabled(s),i.setBlendFunctionSeparate(cn.ONE,cn.ONE_MINUS_SRC_ALPHA,cn.ONE,cn.ONE_MINUS_SRC_ALPHA),e.renderPass="translucent";for(let a=0;ac.decluttered):r.filter(c=>c.neededForCoverage),a!=="vtlSymbol"){const c=i.displayLevel;if(r.length===0||e.minzoom!==void 0&&e.minzoom>=c+Ege||e.maxzoom!==void 0&&e.maxzoom>1,i.col>>1,i.world);return xh.pool.release(i),r}getTileCoverage(e,i,r){const n=super.getTileCoverage(e,i,r);if(!n)return n;const s=1<o.row>=0&&o.rowi[0].scale)return i[0].level;let r,n;for(let s=0;sn.scale)return r=i[s],r.level+(r.scale-e)/(r.scale-n.scale);return i[i.length-1].level}}_initializeFullCacheLODs(e){let i;if(e[0].level===0)i=e.map(r=>({level:r.level,resolution:r.resolution,scale:r.scale}));else{const r=this.tileInfo.size[0],n=this.tileInfo.spatialReference;i=Ml.create({size:r,spatialReference:n}).lods.map(s=>({level:s.level,resolution:s.resolution,scale:s.scale}))}for(let r=0;r{const{pixelRatio:i}=e.state;let r=0;const n=[],s=[];for(const o of this._vectorTileContainer.children)if(o.symbols)for(const[a,l]of o.symbols)for(const c of l)for(const d of c.colliders){const p=(d.xScreen+d.dxScreen)*i,y=(d.yScreen+d.dyScreen)*i,v=d.width*i,S=d.height*i,I=c.unique.parts[d.partIndex].targetOpacity>.5;if(!I&&this.layer.showCollisionBoxes!=="all")continue;const O=3,L=1,N=3,G=0,V=I?2:0,Y=I?3:0,X=pNe.makeFlags(V,Y);n.push(p,y,X,p+v,y,X,p,y+S,X,p+v,y+S,X),s.push(r+0,r+1,r+2,r+1,r+3,r+2),r+=4;const te=I?O:L,re=I?N:G,fe=pNe.makeFlags(te,re);n.push(p,y,fe,p+v,y,fe,p,y+1,fe,p+v,y+1,fe),s.push(r+0,r+1,r+2,r+1,r+3,r+2),r+=4,n.push(p,y+S-1,fe,p+v,y+S-1,fe,p,y+S,fe,p+v,y+S,fe),s.push(r+0,r+1,r+2,r+1,r+3,r+2),r+=4,n.push(p,y,fe,p+1,y,fe,p,y+S,fe,p+1,y+S,fe),s.push(r+0,r+1,r+2,r+1,r+3,r+2),r+=4,n.push(p+v-1,y,fe,p+v,y,fe,p+v-1,y+S,fe,p+v,y+S,fe),s.push(r+0,r+1,r+2,r+1,r+3,r+2),r+=4}return{vertexData:new Int16Array(n),indexData:new Uint32Array(s)}},this._getCollidersColors=()=>[1,.5,0,1,1,0,0,1,0,1,.5,1,0,.5,0,1],this._getCollidersOpacities=()=>[.05,.01,.15,.2]}async hitTest(e,i){if(!this._tileHandlerPromise)return null;await this._tileHandlerPromise;const r=await this._vectorTileContainer.hitTest(i);if(!r||r.length===0)return null;const n=r[0]-1,s=this._styleRepository,o=s.getStyleLayerByUID(n);if(!o)return null;const a=s.getStyleLayerIndex(o.id);return[{type:"graphic",mapPoint:e,layer:this.layer,graphic:new js({attributes:{layerId:a,layerName:o.id,layerUID:n},layer:this.layer,sourceLayer:this.layer})}]}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 gfe(e),this._tileInfoView=new iur(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new Qlr(this._tileInfoView),this._tileHandler=new Clr(this.layer,this._styleRepository,window.devicePixelRatio||1),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this._vectorTileContainer.on("fade-start",()=>{this.fading=!0,this.notifyChange("updating"),this.requestUpdate()}),this._vectorTileContainer.on("fade-complete",()=>{this._collisionOverlay?.requestRender(),this.fading=!1,this.notifyChange("updating"),this.requestUpdate()}),Qi(()=>this.layer.showCollisionBoxes,i=>{i!=="none"?this._collisionOverlay||(this._collisionOverlay=new pNe({getMesh:this._getCollidersMesh,getColors:this._getCollidersColors,getOpacities:this._getCollidersOpacities}),this.container.addChild(this._collisionOverlay)):this._collisionOverlay&&(this.container.removeChild(this._collisionOverlay),this._collisionOverlay=null),this.container.requestRender()},Fo),this.layer.on("paint-change",i=>{if(i.isDataDriven)this._styleChanges.push({type:_f.PAINTER_CHANGED,data:i}),this.notifyChange("updating"),this.requestUpdate();else{const r=this._styleRepository,n=r.getLayerById(i.layer);if(!n)return;const s=n.type===ul.SYMBOL;r.setPaintProperties(i.layer,i.paint),s&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender()}}),this.layer.on("layout-change",i=>{const r=this._styleRepository,n=r.getLayerById(i.layer);if(!n)return;const s=d2(n.layout,i.layout);if(!lt(s)){if(vA(s,"visibility")&&rur(s)===1)return r.setLayoutProperties(i.layer,i.layout),n.type===ul.SYMBOL&&this._vectorTileContainer.restartDeclutter(),void this._vectorTileContainer.requestRender();this._styleChanges.push({type:_f.LAYOUT_CHANGED,data:i}),this.notifyChange("updating"),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",i=>{const r=this._styleRepository,n=r.getLayerById(i.layer);n&&(r.setStyleLayerVisibility(i.layer,i.visibility),n.type===ul.SYMBOL&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender())}),this.layer.on("style-layer-change",i=>{this._styleChanges.push({type:_f.LAYER_CHANGED,data:i}),this.notifyChange("updating"),this.requestUpdate()}),this.layer.on("delete-style-layer",i=>{this._styleChanges.push({type:_f.LAYER_REMOVED,data:i}),this.notifyChange("updating"),this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",i=>{this._newSpriteSource=i.spriteSource,this._styleChanges.push({type:_f.SPRITES_CHANGED,data:null});const r=this._styleRepository.layers;for(const n of r)switch(n.type){case ul.SYMBOL:n.getLayoutProperty("icon-image")&&this._styleChanges.push({type:_f.LAYOUT_CHANGED,data:{layer:n.id,layout:n.layout}});break;case ul.LINE:n.getPaintProperty("line-pattern")&&this._styleChanges.push({type:_f.PAINTER_CHANGED,data:{layer:n.id,paint:n.paint,isDataDriven:n.isPainterDataDriven()}});break;case ul.FILL:n.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:_f.PAINTER_CHANGED,data:{layer:n.id,paint:n.paint,isDataDriven:n.isPainterDataDriven()}})}this.notifyChange("updating"),this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=ra(this._vectorTileContainer),this._tileHandler=ra(this._tileHandler)}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this._collisionOverlay&&this._vectorTileContainer.restartDeclutter(),this.requestUpdate()}supportsSpatialReference(e){return Ca(this.layer.tileInfo?.spatialReference,e)}canResume(){let e=super.canResume();const{currentStyleInfo:i}=this.layer;if(e&&i?.layerDefinition){const r=this.view.scale,{minScale:n,maxScale:s}=i.layerDefinition;i&&i.layerDefinition&&(n&&nr&&(e=!1))}return e}isUpdating(){const e=this._vectorTileContainer.children;return!this._isTileHandlerReady||!this._fetchQueue||!this._parseQueue||this._fetchQueue.updating||this._parseQueue.updating||e.length>0&&e.some(i=>i.invalidating)||this.fading}acquireTile(e){const i=this._createVectorTile(e);return this._tileHandlerPromise?.then(()=>{this._fetchQueue.push(i.key).then(r=>this._parseQueue.push({key:i.key,data:r})).then(r=>{i.once("attach",()=>this.requestUpdate()),i.setData(r),this.requestUpdate(),this.notifyChange("updating")}).catch(r=>{this.notifyChange("updating"),ss(r)||Ei.getLogger(this.declaredClass).error(r)})}),i}releaseTile(e){const i=e.key.id;this._fetchQueue.abort(i),this._parseQueue.abort(i),this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new Ilr({acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const e=new AbortController,i=this._tileHandler.start({signal:e.signal}).then(()=>{this._fetchQueue=new uG({tileInfoView:this._tileInfoView,process:(r,n)=>this._getTileData(r,n),concurrency:15}),this._parseQueue=new uG({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.requestUpdate()}),this._tileHandlerAbortController=e,this._tileHandlerPromise=i}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=ra(this._fetchQueue),this._parseQueue=ra(this._parseQueue),this._tileManager=ra(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,i){const r=await this._tileHandler.fetchTileData(e,i);return this.notifyChange("updating"),r}async _parseTileData(e,i){return this._tileHandler.parseTileData(e,i)}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(a){Ei.getLogger(this.declaredClass).error("error applying vector-tiles style update",a.message),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0}const i=this._styleRepository,r=[];e.forEach(a=>{if(a.type!==_f.LAYER_REMOVED)return;const l=a.data,c=i.getLayerById(l.layer);c&&r.push(c.uid)});const n=[];let s;e.forEach(a=>{const l=a.type,c=a.data;switch(l){case _f.PAINTER_CHANGED:i.setPaintProperties(c.layer,c.paint),s=c.layer;break;case _f.LAYOUT_CHANGED:i.setLayoutProperties(c.layer,c.layout),s=c.layer;break;case _f.LAYER_REMOVED:return void i.deleteStyleLayer(c.layer);case _f.LAYER_CHANGED:i.setStyleLayer(c.layer,c.index),s=c.layer.id;break;case _f.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(this._newSpriteSource)),this._newSpriteSource=null,s=null}const d=i.getLayerById(s);d&&n.push(d.uid)});const o=this._vectorTileContainer.children;if(r.length>0){this._vectorTileContainer.deleteStyleLayers(r);for(const a of o)a.deleteLayerData(r)}if(this._fetchQueue.resume(),this._parseQueue.resume(),n.length>0){const a=[];for(const l of o){const c=this._fetchQueue.push(l.key).then(d=>this._parseQueue.push({key:l.key,data:d,styleLayerUIDs:n})).then(d=>l.setData(d));a.push(c)}await Promise.all(a)}this._styleChanges=[],this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}async _loadStyle(){const{style:e}=this.layer.currentStyleInfo,i=hi(e);this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this.notifyChange("updating"),this._styleRepository=new gfe(i),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,i),await this._tileHandlerPromise}catch(s){if(!ss(s))throw s}if(r.aborted)return this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),void this.requestUpdate();const n=await this._tileHandler.spriteMosaic;this._vectorTileContainer.setStyleResources(n,this._tileHandler.glyphMosaic,this._styleRepository),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}_createVectorTile(e){const i=this._tileInfoView.getTileBounds(_o(),e),r=this._tileInfoView.getTileResolution(e.level);return new Blr(e,r,i[0],i[3],512,512,this._styleRepository)}};function rur(t){if(lt(t))return 0;switch(t.type){case"partial":return Object.keys(t.diff).length;case"complete":return Math.max(Object.keys(t.oldValue).length,Object.keys(t.newValue).length);case"collection":return Object.keys(t.added).length+Object.keys(t.changed).length+Object.keys(t.removed).length}}E([k()],Y6.prototype,"_fetchQueue",void 0),E([k()],Y6.prototype,"_parseQueue",void 0),E([k()],Y6.prototype,"_isTileHandlerReady",void 0),E([k()],Y6.prototype,"fading",void 0),Y6=E([ht("esri.views.2d.layers.VectorTileLayerView2D")],Y6);const nur=Object.freeze(Object.defineProperty({__proto__:null,default:Y6},Symbol.toStringTag,{value:"Module"})),sur=t=>{let e=class extends t{initialize(){this.exportImageParameters=new hT({layer:this.layer})}destroy(){this.exportImageParameters=ra(this.exportImageParameters)}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}fetchPopupFeatures(i){const{layer:r}=this;if(!i)return Promise.reject(new st("wmslayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:r}));const{popupEnabled:n}=r;if(!n)return Promise.reject(new st("wmslayerview:fetchPopupFeatures","popupEnabled should be true",{popupEnabled:n}));const s=this.createFetchPopupFeaturesQuery(i);if(!s)return Promise.resolve([]);const{extent:o,width:a,height:l,x:c,y:d}=s;if(!(o&&a&&l))throw new st("wmslayerview:fetchPopupFeatures","WMSLayer does not support fetching features.",{extent:o,width:a,height:l});return r.fetchFeatureInfo(o,a,l,c,d)}};return E([k()],e.prototype,"exportImageParameters",void 0),E([k({readOnly:!0})],e.prototype,"exportImageVersion",null),E([k()],e.prototype,"layer",void 0),E([k(j9)],e.prototype,"timeExtent",void 0),e=E([ht("esri.layers.mixins.WMSLayerView")],e),e};let See=class extends sur(MF(_y(by))){constructor(){super(...arguments),this.bitmapContainer=new Bj}supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}update(e){this.strategy.update(e).catch(i=>{ss(i)||Ei.getLogger(this.declaredClass).error(i)})}attach(){const{layer:e}=this,{imageMaxHeight:i,imageMaxWidth:r}=e;this.bitmapContainer=new Bj,this.container.addChild(this.bitmapContainer),this.strategy=new fge({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:i,imageMaxWidth:r,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.addAttachHandles(Qi(()=>this.exportImageVersion,()=>this.requestUpdate()))}detach(){this.strategy=ra(this.strategy),this.container.removeAllChildren()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(e){const{view:i,bitmapContainer:r}=this,{x:n,y:s}=e,{spatialReference:o}=i;let a,l=0,c=0;if(r.children.some(v=>{const{width:S,height:I,resolution:O,x:L,y:N}=v,G=L+O*S,V=N-O*I;return n>=L&&n<=G&&s<=N&&s>=V&&(a=new vr({xmin:L,ymin:V,xmax:G,ymax:N,spatialReference:o}),l=S,c=I,!0)}),!a)return null;const d=a.width/l,p=Math.round((n-a.xmin)/d),y=Math.round((a.ymax-s)/d);return{extent:a,width:l,height:c,x:p,y}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(e,i,r,n){return this.layer.fetchImageBitmap(e,i,r,{timeExtent:this.timeExtent,...n})}};E([k()],See.prototype,"strategy",void 0),E([k()],See.prototype,"updating",void 0),See=E([ht("esri.views.2d.layers.WMSLayerView2D")],See);const our=Object.freeze(Object.defineProperty({__proto__:null,default:See},Symbol.toStringTag,{value:"Module"})),aur=[102113,102100,3857,3785,900913],lur=[0,0];let Cee=class extends MF(LAt(_y(by))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this._tileRequests=new Map,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 wk(e),this._fetchQueue=new uG({tileInfoView:this._tileInfoView,concurrency:16,process:(i,r)=>this.fetchTile(i,r)}),this._tileStrategy=new uX({cachePolicy:"keep",resampling:!0,acquireTile:i=>this.acquireTile(i),releaseTile:i=>this.releaseTile(i),tileInfoView:this._tileInfoView}),this.addAttachHandles(Qi(()=>[this.layer?.activeLayer?.styleId,this.tileMatrixSet],()=>this._refresh())),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()}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}acquireTile(e){const i=this._bitmapView.createTile(e),r=i.bitmap;return[r.x,r.y]=this._tileInfoView.getTileCoords(lur,i.key),r.resolution=this._tileInfoView.getTileResolution(i.key),[r.width,r.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(i),this._bitmapView.addChild(i),this.requestUpdate(),i}async doRefresh(){!this.attached||this.updateRequested||this.suspended||this._refresh()}isUpdating(){return this._fetchQueue?.updating??!1}async fetchTile(e,i={}){const r="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:n,resamplingLevel:s=0}=i;if(!r)return this._fetchImage(e,n);const o=new xh(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(ss(l))throw l;if(s<3){const c=this._tileInfoView.getTileParentId(e.id);if(c){const d=new xh(c),p=await this.fetchTile(d,{...i,resamplingLevel:s+1});return uge(this._tileInfoView,p,d,e)}}throw l}return uge(this._tileInfoView,a,o,e)}canResume(){const e=super.canResume();return e&&this.tileMatrixSet!==null}supportsSpatialReference(e){return this.layer.activeLayer.tileMatrixSets?.some(i=>Ca(i.tileInfo?.spatialReference,e))??!1}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(i){ss(i)||Ei.getLogger(this.declaredClass).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i})}_refresh(){this._fetchQueue.reset(),this._tileStrategy.tiles.forEach(e=>{if(!e.bitmap.source)return;const i={id:e.key.id,fulfilled:!1,promise:this._fetchQueue.push(e.key).then(r=>{e.bitmap.source=r}).catch(r=>{ss(r)||(e.bitmap.source=null)}).finally(()=>{e.requestRender(),i.fulfilled=!0})};this._tileRequests.set(e,i)})}_getTileMatrixSetBySpatialReference(e){const i=this.view.spatialReference;if(!e.tileMatrixSets)return null;let r=e.tileMatrixSets.find(n=>Ca(n.tileInfo?.spatialReference,i));return!r&&i.isWebMercator&&(r=e.tileMatrixSets.find(n=>aur.includes(n.tileInfo?.spatialReference.wkid??-1))),r}};E([k()],Cee.prototype,"_fetchQueue",void 0),E([k({readOnly:!0})],Cee.prototype,"tileMatrixSet",null),Cee=E([ht("esri.views.2d.layers.WMTSLayerView2D")],Cee);const uur=Object.freeze(Object.defineProperty({__proto__:null,default:Cee},Symbol.toStringTag,{value:"Module"}));/*! +`),a}_injectOverrides(e){let i=super._injectOverrides(e);const r=this.view.scale,n=this.layer.sublayers.filter(o=>Cur(o,r)).map(o=>o.subtypeCode);if(!n.length)return i;i=ve(i)?i:new bq().toJSON();const s=`NOT ${this.layer.subtypeField} IN (${n.join(",")})`;return i.where=i.where?`(${i.where}) AND (${s})`:s,i}_setLayersForFeature(e){const i=this.layer.fieldsIndex.get(this.layer.subtypeField),r=e.attributes[i.name],n=this.layer.sublayers.find(s=>s.subtypeCode===r);e.layer=e.sourceLayer=n}_createSchemaConfig(){const e={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers).map(s=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:s.labelingInfo,labelsVisible:s.labelsVisible,renderer:s.renderer,subtypeCode:s.subtypeCode,orderBy:null}))},i=this.layer.sublayers.map(s=>s.subtypeCode).join(","),r=this.layer.sublayers.length?`${this.layer.subtypeField} IN (${i})`:"1=2";let n=this.layer.definitionExpression?this.layer.definitionExpression+" AND ":"";return n+=r,{...super._createSchemaConfig(),...e,definitionExpression:n}}};Rke=E([dt("esri.views.2d.layers.SubtypeGroupLayerView2D")],Rke);const Tur=Object.freeze(Object.defineProperty({__proto__:null,default:Rke},Symbol.toStringTag,{value:"Module"}));let Iee=class{constructor(e,i){this._width=0,this._height=0,this._free=[],this._width=e,this._height=i,this._free.push(new Md(0,0,e,i))}get width(){return this._width}get height(){return this._height}allocate(e,i){if(e>this._width||i>this._height)return new Md;let r=null,n=-1;for(let s=0;se&&this._free.push(new Md(r.x+e,r.y,r.width-e,i)),r.height>i&&this._free.push(new Md(r.x,r.y+i,r.width,r.height-i))):(r.width>e&&this._free.push(new Md(r.x+e,r.y,r.width-e,r.height)),r.height>i&&this._free.push(new Md(r.x,r.y+i,e,r.height-i))),new Md(r.x,r.y,e,i))}release(e){for(let i=0;i{if(l<=256){const c=e+l;if(this._rangePromises.has(c))a.push(this._rangePromises.get(c));else{const h=n.getRange(e,l).then(()=>{this._rangePromises.delete(c)},()=>{this._rangePromises.delete(c)});this._rangePromises.set(c,h),a.push(h)}}}),Promise.all(a).then(()=>{let l=this._glyphIndex[e];l||(l={},this._glyphIndex[e]=l);for(const c of i){const h=l[c];if(h){r[c]={sdf:!0,rect:h.rect,metrics:h.metrics,page:h.page,code:c};continue}const p=n.getGlyph(e,c);if(!p||!p.metrics)continue;const y=p.metrics;let v;if(y.width===0)v=new Md(0,0,0,0);else{const I=y.width+6,P=y.height+2*3;let F=I%4?4-I%4:4,k=P%4?4-P%4:4;F===1&&(F=5),k===1&&(k=5),v=this._binPack.allocate(I+F,P+k),v.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 Iee(this.width-4,this.height-4),v=this._binPack.allocate(I+F,P+k));const j=this._glyphData[this._currentPage],V=p.bitmap;let Y,X;if(V)for(let Z=0;Z{r.addRange(i,new Mke(new q5(new Uint8Array(a.data),new DataView(a.data))))}).catch(()=>{r.addRange(i,new Mke)})}return r.addRange(i,new Mke),Promise.resolve()}getGlyph(e,i){const r=this._getFontStack(e);if(!r)return;const n=Math.floor(i/256);if(n>256)return;const s=r.getRange(n);return s?{metrics:s.getMetrics(i),bitmap:s.getBitmap(i)}:void 0}_getFontStack(e){let i=this._glyphInfo[e];return i||(i=this._glyphInfo[e]=new Eur),i}};const Iur="dasharray-";let Dke=class yNt{constructor(e,i,r=0){this._size=[],this._mosaicsData=[],this._textures=[],this._dirties=[],this._maxItemSize=0,this._currentPage=0,this._pageWidth=0,this._pageHeight=0,this._mosaicRects={},this.pixelRatio=1,(e<=0||i<=0)&&console.error("Sprites mosaic defaultWidth and defaultHeight must be greater than zero!"),this._pageWidth=e,this._pageHeight=i,r>0&&(this._maxItemSize=r),this._binPack=new Iee(e-4,i-4)}dispose(){this._binPack=null,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 Iee(this._pageWidth-4,this._pageHeight-4);const i=Math.floor(this._pageWidth),r=Math.floor(this._pageHeight),n=new Uint32Array(i*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,i=!1){let r,n,s=this._mosaicRects[e];if(s)return s;if(!this._sprites||this._sprites.loadStatus!=="loaded"||(e&&e.startsWith(Iur)?([r,n]=this._rasterizeDash(e),i=!0):r=this._sprites.getSpriteInfo(e),!r||!r.width||!r.height||r.width<0||r.height<0))return null;const o=r.width,a=r.height,[l,c,h]=this._allocateImage(o,a);return l.width<=0?null:(this._copy(l,r,c,h,i,n),s={rect:l,width:o,height:a,sdf:r.sdf,simplePattern:!1,pixelRatio:r.pixelRatio,page:c},this._mosaicRects[e]=s,s)}getSpriteItems(e){const i={};for(const r of e)i[r.name]=this.getSpriteItem(r.name,r.repeat);return i}getMosaicItemPosition(e,i){const r=this.getSpriteItem(e,i),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,i,r=0,n=0){if(r>=this._size.length||r>=this._mosaicsData.length)return;this._textures[r]||(this._textures[r]=new Fs(e,{pixelFormat:gn.RGBA,dataType:ds.UNSIGNED_BYTE,wrapMode:ws.CLAMP_TO_EDGE,width:this._size[r][0],height:this._size[r][1]},new Uint8Array(this._mosaicsData[r].buffer)));const s=this._textures[r];s.setSamplingMode(i),this._dirties[r]&&s.setData(new Uint8Array(this._mosaicsData[r].buffer)),e.bindTexture(s,n),this._dirties[r]=!1}static _copyBits(e,i,r,n,s,o,a,l,c,h,p){let y=n*i+r,v=l*o+a;if(p){v-=o;for(let x=-1;x<=h;x++,y=((x+h)%h+n)*i+r,v+=o)for(let I=-1;I<=c;I++)s[v+I]=e[y+(I+c)%c]}else for(let x=0;x=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 c=2,h=o?i.width:this._sprites.width;yNt._copyBits(a,h,i.x,i.y,l,n[0],e.x+c,e.y+c,i.width,i.height,s),this._dirties[r]=!0}_allocateImage(e,i){e+=2,i+=2;const r=Math.max(e,i);if(this._maxItemSize&&this._maxItemSizethis._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(e){this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,e),this._spriteSourcePromise.then(n=>{this._spriteMosaic=new Dke(1024,1024,250),this._spriteMosaic.setSpriteSource(n)});const i=this._layer.currentStyleInfo.glyphsUrl,r=new pOt(i?zy(i,{...this._layer.customParameters,token:this._layer.apiKey}):null);this._glyphMosaic=new dOt(1024,1024,r),this._broadcastPromise=bA("WorkerTileHandler",{client:this,schedule:e.schedule,signal:e.signal}).then(n=>{if(this._connection=n,this._layer&&!this._connection.closed){const s=n.broadcast("setStyle",this._layer.currentStyleInfo.style,e);Promise.all(s).catch(o=>_C(o))}})}async updateStyle(e){return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(e){const i=new Dke(1024,1024,250);return i.setSpriteSource(e),this._spriteMosaic=i,this._spriteSourcePromise=Promise.resolve(e),i}async setStyle(e,i){await this._broadcastPromise,this._styleRepository=e,this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,null),this._spriteSourcePromise.then(n=>{this._spriteMosaic=new Dke(1024,1024,250),this._spriteMosaic.setSpriteSource(n)});const r=new pOt(this._layer.currentStyleInfo.glyphsUrl?zy(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);return this._glyphMosaic=new dOt(1024,1024,r),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",i)),this._broadcastPromise}fetchTileData(e,i){return this._getRefKeys(e,i).then(r=>{const n=this._layer.sourceNameToSource,s=[];for(const o in n)s.push(o);return this._getSourcesData(s,r,i)})}parseTileData(e,i){const r=e&&e.data;if(!r)return Promise.resolve(null);const{sourceName2DataAndRefKey:n,transferList:s}=r;return Object.keys(n).length===0?Promise.resolve(null):this._broadcastPromise.then(()=>this._connection.invoke("createTileAndParse",{key:e.key.id,sourceName2DataAndRefKey:n,styleLayerUIDs:e.styleLayerUIDs},{...i,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,i,r){const n=Eh.pool.acquire(e.id),s=this._layer.sourceNameToSource[i],{level:o,row:a,col:l}=n;Eh.pool.release(n);try{return{protobuff:await s.requestTile(o,a,l,r),sourceName:i}}catch(c){if(ys(c))throw c;return{protobuff:null,sourceName:i}}}_getRefKeys(e,i){const r=this._layer.sourceNameToSource,n=new Array;for(const s in r){const o=r[s].getRefKey(e,i);n.push(o)}return Ru(n)}_getSourcesData(e,i,r){const n=[];for(let s=0;s{const o={},a=[];for(let l=0;l0){const h=i[l].value.id;o[c.sourceName]={refKey:h,protobuff:c.protobuff},a.push(c.protobuff)}}return{sourceName2DataAndRefKey:o,transferList:a}})}};const fOt=512,Pur=1e-6,Our=(t,e)=>t+1/(1<<2*e);let Rur=class{constructor(e,i){this._tiles=new Map,this._tileCache=new C9(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=i}destroy(){for(const[e,i]of this._tiles)i.dispose();this._tiles=null,this._tileCache.clear(),this._tileCache=null}update(e){this._updateCacheSize(e);const i=this.tileInfoView,r=i.getTileCoverage(e.state,0,"smallest"),{spans:n,lodInfo:s}=r,{level:o}=s,a=this._tiles,l=new Set,c=new Set;for(const{row:p,colFrom:y,colTo:v}of n)for(let x=y;x<=v;x++){const I=Eh.getId(o,p,s.normalizeCol(x),s.getWorldForColumn(x)),P=this._getOrAcquireTile(I);l.add(I),P.processed()?this._addToContainer(P):c.add(new Eh(I))}for(const[p,y]of a)y.isCoverage=l.has(p);for(const p of c)this._findPlaceholdersForMissingTiles(p,l);let h=!1;for(const[p,y]of a)y.neededForCoverage=l.has(p),y.neededForCoverage||y.isHoldingForFade&&i.intersects(r,y.key)&&l.add(p),y.isFading&&(h=!0);for(const[p,y]of this._tiles)l.has(p)||this._releaseTile(p);return aP.pool.release(r),!h}clear(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}clearCache(){this._tileCache.clear()}_findPlaceholdersForMissingTiles(e,i){const r=[];for(const[s,o]of this._tiles)this._addPlaceholderChild(r,o,e,i);const n=r.reduce(Our,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 i=e.state.size;if(i[0]===this._viewSize[0]&&i[1]===this._viewSize[1])return;const r=Math.ceil(i[0]/fOt)+1,n=Math.ceil(i[1]/fOt)+1;this._viewSize[0]=i[0],this._viewSize[1]=i[1],this._tileCache.maxSize=5*r*n}};function Mur(t){const[e,i,r,n]=t.split("/"),s=parseInt(e,10);return s===0?null:`${s-1}/${parseInt(i,10)>>1}/${parseInt(r,10)>>1}/${parseInt(n,10)}`}function Dur(t,e){const i=e.level-t.level;return t.row===e.row>>i&&t.col===e.col>>i&&t.world===e.world}let Fur=class{constructor(e){this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=e}},Lur=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 mOt(t,e,i,r,n,s){const o=i-n;if(o>=0)return(e>>o)+(r-(s<>o);const a=-o;return e-(s-(r<>a)<0){const o=new Map;for(let a=0;a0}triangleCount(){return this.lineIndexCount/3}doDestroy(){ve(this.lineVertexArrayObject)&&this.lineVertexArrayObject.dispose(),ve(this.lineVertexBuffer)&&this.lineVertexBuffer.dispose(),ve(this.lineIndexBuffer)&&this.lineIndexBuffer.dispose(),this.lineVertexArrayObject=null,this.lineVertexBuffer=null,this.lineIndexBuffer=null,this.memoryUsed=0}doPrepareForRendering(e,i,r){const n=new Uint32Array(i),s=new Int32Array(n.buffer),o=n[r++];this.lineVertexBuffer=aa.createVertex(e,Xo.STATIC_DRAW,new Int32Array(s.buffer,4*r,o)),r+=o;const a=n[r++];this.lineIndexBuffer=aa.createIndex(e,Xo.STATIC_DRAW,new Uint32Array(n.buffer,4*r,a)),r+=a;const l=this.layer.lineMaterial;this.lineVertexArrayObject=new Mc(e,l.getAttributeLocations(),l.getLayoutInfo(),{geometry:this.lineVertexBuffer},this.lineIndexBuffer)}},Vur=class extends Kge{constructor(e,i){super(e,i),this.type=Tg.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){const o=new Map;for(let a=0;a0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){ve(this.fillVertexArrayObject)&&this.fillVertexArrayObject.dispose(),ve(this.fillVertexBuffer)&&this.fillVertexBuffer.dispose(),ve(this.fillIndexBuffer)&&this.fillIndexBuffer.dispose(),this.fillVertexArrayObject=null,this.fillVertexBuffer=null,this.fillIndexBuffer=null,ve(this.outlineVertexArrayObject)&&this.outlineVertexArrayObject.dispose(),ve(this.outlineVertexBuffer)&&this.outlineVertexBuffer.dispose(),ve(this.outlineIndexBuffer)&&this.outlineIndexBuffer.dispose(),this.outlineVertexArrayObject=null,this.outlineVertexBuffer=null,this.outlineIndexBuffer=null,this.memoryUsed=0}doPrepareForRendering(e,i,r){const n=new Uint32Array(i),s=new Int32Array(n.buffer),o=n[r++];this.fillVertexBuffer=aa.createVertex(e,Xo.STATIC_DRAW,new Int32Array(s.buffer,4*r,o)),r+=o;const a=n[r++];this.fillIndexBuffer=aa.createIndex(e,Xo.STATIC_DRAW,new Uint32Array(n.buffer,4*r,a)),r+=a;const l=n[r++];this.outlineVertexBuffer=aa.createVertex(e,Xo.STATIC_DRAW,new Int32Array(s.buffer,4*r,l)),r+=l;const c=n[r++];this.outlineIndexBuffer=aa.createIndex(e,Xo.STATIC_DRAW,new Uint32Array(n.buffer,4*r,c)),r+=c;const h=this.layer,p=h.fillMaterial,y=h.outlineMaterial;this.fillVertexArrayObject=new Mc(e,p.getAttributeLocations(),p.getLayoutInfo(),{geometry:this.fillVertexBuffer},this.fillIndexBuffer),this.outlineVertexArrayObject=new Mc(e,y.getAttributeLocations(),y.getLayoutInfo(),{geometry:this.outlineVertexBuffer},this.outlineIndexBuffer)}},jur=class extends Kge{constructor(e,i,r){super(e,i),this.type=Tg.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++];for(let y=0;y0||this.glyphPerPageElementsMap.size>0}triangleCount(){let e=0;for(const[i,r]of this.iconPerPageElementsMap)e+=r[1];for(const[i,r]of this.glyphPerPageElementsMap)e+=r[1];return e/3}doDestroy(){ve(this.iconVertexArrayObject)&&this.iconVertexArrayObject.dispose(),ve(this.iconVertexBuffer)&&this.iconVertexBuffer.dispose(),ve(this.iconOpacityBuffer)&&this.iconOpacityBuffer.dispose(),ve(this.iconIndexBuffer)&&this.iconIndexBuffer.dispose(),this.iconVertexArrayObject=null,this.iconVertexBuffer=null,this.iconOpacityBuffer=null,this.iconIndexBuffer=null,ve(this.textVertexArrayObject)&&this.textVertexArrayObject.dispose(),ve(this.textVertexBuffer)&&this.textVertexBuffer.dispose(),ve(this.textOpacityBuffer)&&this.textOpacityBuffer.dispose(),ve(this.textIndexBuffer)&&this.textIndexBuffer.dispose(),this.textVertexArrayObject=null,this.textVertexBuffer=null,this.textOpacityBuffer=null,this.textIndexBuffer=null,this.memoryUsed=0}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const e=this.iconOpacity,i=this.iconOpacityBuffer;e.length>0&&e.byteLength===i.size&&i.setSubData(e,0,0,e.length);const r=this.textOpacity,n=this.textOpacityBuffer;r.length>0&&r.byteLength===n.size&&n.setSubData(r,0,0,r.length)}doPrepareForRendering(e,i,r){const n=new Uint32Array(i),s=new Int32Array(n.buffer),o=n[r++];this.iconVertexBuffer=aa.createVertex(e,Xo.STATIC_DRAW,new Int32Array(s.buffer,4*r,o)),r+=o;const a=n[r++];this.iconIndexBuffer=aa.createIndex(e,Xo.STATIC_DRAW,new Uint32Array(n.buffer,4*r,a)),r+=a;const l=n[r++];this.textVertexBuffer=aa.createVertex(e,Xo.STATIC_DRAW,new Int32Array(s.buffer,4*r,l)),r+=l;const c=n[r++];this.textIndexBuffer=aa.createIndex(e,Xo.STATIC_DRAW,new Uint32Array(n.buffer,4*r,c)),r+=c,this.iconOpacityBuffer=aa.createVertex(e,Xo.STATIC_DRAW,this.iconOpacity.buffer),this.textOpacityBuffer=aa.createVertex(e,Xo.STATIC_DRAW,this.textOpacity.buffer);const h=this.layer,p=h.iconMaterial,y=h.textMaterial;this.iconVertexArrayObject=new Mc(e,p.getAttributeLocations(),p.getLayoutInfo(),{geometry:this.iconVertexBuffer,opacity:this.iconOpacityBuffer},this.iconIndexBuffer),this.textVertexArrayObject=new Mc(e,y.getAttributeLocations(),y.getLayoutInfo(),{geometry:this.textVertexBuffer,opacity:this.textOpacityBuffer},this.textIndexBuffer)}},Gur=class extends Kge{constructor(e,i){super(e,i),this.type=Tg.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}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){ve(this.circleVertexArrayObject)&&this.circleVertexArrayObject.dispose(),ve(this.circleVertexBuffer)&&this.circleVertexBuffer.dispose(),ve(this.circleIndexBuffer)&&this.circleIndexBuffer.dispose(),this.circleVertexArrayObject=null,this.circleVertexBuffer=null,this.circleIndexBuffer=null,this.memoryUsed=0}doPrepareForRendering(e,i,r){const n=new Uint32Array(i),s=new Int32Array(n.buffer),o=n[r++];this.circleVertexBuffer=aa.createVertex(e,Xo.STATIC_DRAW,new Int32Array(s.buffer,4*r,o)),r+=o;const a=n[r++];this.circleIndexBuffer=aa.createIndex(e,Xo.STATIC_DRAW,new Uint32Array(n.buffer,4*r,a)),r+=a;const l=this.layer.circleMaterial;this.circleVertexArrayObject=new Mc(e,l.getAttributeLocations(),l.getLayoutInfo(),{geometry:this.circleVertexBuffer},this.circleIndexBuffer)}},Uur=class vNt extends RU{constructor(e,i,r,n,s,o,a,l=null){super(e,i,r,n,s,o,4096,4096),this._memCache=l,this.type="vector-tile",this._referenced=0,this._hasSymbolBuckets=!1,this._memoryUsedByLayerData=0,this.layerData=new Map,this.layerCount=0,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.invalidating=!1,this.parentTile=null,this.childrenTiles=new Set,this._processed=!1,this._referenced=1,this.styleRepository=a,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate0}dispose(){this.status!=="unloaded"&&(zur.delete(this),vNt._destroyRenderBuckets(this.layerData),this.layerData=null,this.layerCount=0,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 memoryUsage(){return(this._memoryUsedByLayerData+256)/(this._referenced||1)}changeDataImpl(e){let i=!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===Tg.SYMBOL&&(this.symbols.set(o,a.symbols),i=!0),this._memoryUsedByLayerData+=a.memoryUsed,this.layerData.set(o,a),this.layerCount++;ve(this._memCache)&&this._memCache.updateSize(this.key.id,this,this._memoryUsedByLayerData)}this._hasSymbolBuckets=!1;for(const[r,n]of this.layerData)n.type===Tg.SYMBOL&&(this._hasSymbolBuckets=!0);i&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(i){i.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const i=this.resolution/(e.resolution*e.pixelRatio),r=this.width/this.rangeX*i,n=this.height/this.rangeY*i,s=[0,0];e.toScreen(s,[this.x,this.y]);const o=this.transforms.tileUnitsToPixels;iP(o),dg(o,o,s),wT(o,o,Math.PI*e.rotation/180),rP(o,o,[r,n,1])}_createTransforms(){return{dvs:Dl(),tileMat3:Dl(),tileUnitsToPixels:Dl()}}static _destroyRenderBuckets(e){if(!e)return;const i=new Set;e.forEach(r=>{i.has(r)||(r.destroy(),i.add(r))}),e.clear()}_createRenderBuckets(e){const i=new Map,r=new Map;for(const n of e){const s=this._deserializeBucket(n,r);for(const o of s.layerUIDs)i.set(o,s)}return i}_deserializeBucket(e,i){let r=i.get(e);if(r)return r;switch(new Uint32Array(e)[0]){case Tg.FILL:r=new Vur(e,this.styleRepository);break;case Tg.LINE:r=new Bur(e,this.styleRepository);break;case Tg.SYMBOL:r=new jur(e,this.styleRepository,this);break;case Tg.CIRCLE:r=new Gur(e,this.styleRepository)}return i.set(e,r),r}_deleteLayerData(e){if(!this.layerData.has(e))return;const i=this.layerData.get(e);this._memoryUsedByLayerData-=i.memoryUsed,i.destroy(),this.layerData.delete(e),this.layerCount--}};const zur=new Map;function Hur(t,e,i,r,n,s){const{iconRotationAlignment:o,textRotationAlignment:a,iconTranslate:l,iconTranslateAnchor:c,textTranslate:h,textTranslateAnchor:p}=r;let y=0;for(const v of t.colliders){const[x,I]=v.partIndex===0?l:h,P=v.partIndex===0?c:p,F=v.minLod<=s&&s<=v.maxLod;y+=F?0:1,v.enabled=F,v.xScreen=v.xTile*n[0]+v.yTile*n[3]+n[6],v.yScreen=v.xTile*n[1]+v.yTile*n[4]+n[7],P===U_.MAP?(v.xScreen+=i*x-e*I,v.yScreen+=e*x+i*I):(v.xScreen+=x,v.yScreen+=I),oc.VIEWPORT===(v.partIndex===0?o:a)?(v.dxScreen=v.dxPixels,v.dyScreen=v.dyPixels):(v.dxScreen=i*(v.dxPixels+v.width/2)-e*(v.dyPixels+v.height/2)-v.width/2,v.dyScreen=e*(v.dxPixels+v.width/2)+i*(v.dyPixels+v.height/2)-v.height/2)}t.colliders.length>0&&y===t.colliders.length&&(t.unique.show=!1)}let Wur=class{constructor(e,i,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 gOt(i,r,J9i),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,nrt(l.tile.transforms.tileUnitsToPixels))}work(e){const i=this._gridIndex;function r(s){const o=s.xScreen+s.dxScreen,a=s.yScreen+s.dyScreen,l=o+s.width,c=a+s.height,[h,p,y,v]=i.getCellSpan(o,a,l,c);for(let x=p;x<=v;x++)for(let I=h;I<=y;I++){const P=i.cells[x][I];for(const F of P){const k=F.xScreen+F.dxScreen,j=F.yScreen+F.dyScreen,V=k+F.width,Y=j+F.height;if(!(lV||cY))return!0}}return!1}const n=performance.now();for(;this._currentLayerCursore)return!1;const a=s.symbols[this._currentSymbolCursor];if(!a.unique.show)continue;Hur(a,this._si,this._co,o,this._allNeededMatrices.get(a.tile),this._zoom);const l=a.unique;if(!l.show)continue;const{iconAllowOverlap:c,iconIgnorePlacement:h,textAllowOverlap:p,textIgnorePlacement:y}=o;for(const v of a.colliders){if(!v.enabled)continue;const x=l.parts[v.partIndex];x.show&&!(v.partIndex?p:c)&&r(v)&&(v.hard?l.show=!1:x.show=!1)}if(l.show)for(const v of a.colliders){if(!v.enabled||(v.partIndex?y:h)||!l.parts[v.partIndex].show)continue;const x=v.xScreen+v.dxScreen,I=v.yScreen+v.dyScreen,P=x+v.width,F=I+v.height,[k,j,V,Y]=this._gridIndex.getCellSpan(x,I,P,F);for(let X=j;X<=Y;X++)for(let Z=k;Z<=V;Z++)this._gridIndex.cells[X][Z].push(v)}}}return!0}_getProperties(e){const i=this._styleProps.get(e);if(i)return i;const r=this._zoom,n=this._styleRepository.getStyleLayerByUID(e),s=n.getLayoutValue("symbol-placement",r)!==aO.POINT;let o=n.getLayoutValue("icon-rotation-alignment",r);o===oc.AUTO&&(o=s?oc.MAP:oc.VIEWPORT);let a=n.getLayoutValue("text-rotation-alignment",r);a===oc.AUTO&&(a=s?oc.MAP:oc.VIEWPORT);const l=n.getPaintValue("icon-translate",r),c=n.getPaintValue("icon-translate-anchor",r),h=n.getPaintValue("text-translate",r),p=n.getPaintValue("text-translate-anchor",r),y={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:c,iconTranslate:l,textTranslateAnchor:p,textTranslate:h};return this._styleProps.set(e,y),y}};function qur(t,e){if(t.priority-e.priority)return t.priority-e.priority;const i=t.tile.key,r=e.tile.key;return i.world-r.world?i.world-r.world:i.level-r.level?i.level-r.level:i.row-r.row?i.row-r.row:i.col-r.col?i.col-r.col:t.xTile-e.xTile?t.xTile-e.xTile:t.yTile-e.yTile}let Yur=class{get running(){return this._running}constructor(e,i,r,n,s,o){this._visibleTiles=e,this._symbolRepository=i,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,i){this._screenWidth===e&&this._screenHeight===i||this.restart(),this._screenWidth=e,this._screenHeight=i}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 i=performance.now();if(!this._selectionJob.work(e)||(this._selectionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-i)))===0))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const i=performance.now();if(!this._collisionJob.work(e)||(this._collisionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-i)))===0))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const i=performance.now();if(!this._opacityJob.work(e)||(this._opacityJobCompleted=!0,(e=Math.max(0,e-(performance.now()-i)))===0))return!1}return this._running=!1,!0}_createSelectionJob(){const e=this._symbolRepository.uniqueSymbols;for(let l=0;ll)return!1;let x=null,I=!1,P=!1;for(const F of c.tileSymbols)if(!P||!I){const k=F.tile;(!x||k.isCoverage||k.neededForCoverage&&!I)&&(x=F,(k.neededForCoverage||k.isCoverage)&&(P=!0),k.isCoverage&&(I=!0))}if(x.selectedForRendering=!0,P){v.symbols.push(x),c.show=!0;for(const F of c.parts)F.show=!0}else c.show=!1}}for(const p of i)p.symbols.sort(qur);return!0}const a=this._symbolLayerSorter;return{work:o,get sortedSymbols(){return i.sort(a)}}}_createOpacityJob(){const e=this._assignTileSymbolsOpacity,i=this._visibleTiles;let r=0;function n(s,o){const a=s.symbols;for(const[l,c]of a)Xur(c,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=i[r];ve(a.parentTile)||n(a,performance.now())}return!0}}}};function Xur(t,e){for(const i of t){const r=i.unique;for(const n of r.parts){const s=n.targetOpacity>.5?1:-1;n.startOpacity+=s*((e-n.startTime)/UG),n.startOpacity=Math.min(Math.max(n.startOpacity,0),1),n.startTime=e,n.targetOpacity=r.show&&n.show?1:0}}}const Kur=32,Jur=8,Zur=64;let Qur=class{constructor(e,i,r){this.tileCoordRange=e,this._visibleTiles=i,this._createUnique=r,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){return lt(this._uniqueSymbolLayerArray)&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}add(e,i){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(i)for(const a of i)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 c=l.length;if(c>=Kur){let h=this.tileCoordRange;do h/=2,c/=4;while(c>Jur&&h>Zur);const p=new gOt(this.tileCoordRange,this.tileCoordRange,h);o.set(a,{flat:l,index:p}),r.symbols.set(a,{flat:l,index:p});for(const y of l)p.getCell(y.xTile,y.yTile).push(y)}else o.set(a,{flat:l}),r.symbols.set(a,{flat:l})}this._addSymbols(e.key,s)}deleteStyleLayers(e){this._uniqueSymbolLayerArray=null;for(const[i,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(i)}}removeTile(e){this._uniqueSymbolLayerArray=null;const i=this._tiles.get(e.id);if(!i)return;const r=new Map;for(const[n,s]of e.symbols)i.symbols.has(n)&&(r.set(n,i.symbols.get(n)),i.symbols.delete(n));this._removeSymbols(r),i.symbols.size===0&&this._tiles.delete(e.id)}_removeSymbols(e){for(const[i,{flat:r}]of e)for(const n of r){const s=n.unique,o=s.tileSymbols,a=o.length-1;for(let l=0;li.level){const s=e.key.level-i.level;if(e.key.row>>s!==i.row||e.key.col>>s!==i.col)return}if(i.level>e.key.level){const s=i.level-e.key.level;if(i.row>>s!==e.key.row||i.col>>s!==e.key.col)return}if(i.equals(e.key)){for(const s of e.childrenTiles)this._matchSymbols(s,i,r);return}const n=new Map;for(const[s,o]of r){const a=[];for(const p of o){const y=mOt(this.tileCoordRange,p.xTile,i.level,i.col,e.key.level,e.key.col),v=mOt(this.tileCoordRange,p.yTile,i.level,i.row,e.key.level,e.key.row);y>=0&&y=0&&v0&&n.set(s,l)}for(const s of e.childrenTiles)this._matchSymbols(s,i,n)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsReferences,i=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;i[n]={styleLayerUID:s,uniqueSymbols:a},n++}return i}};const ecr=.5,yOt=1e-6;let tcr=class extends md{constructor(e,i){super(),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._completed=!1,this._symbolRepository=new Qur(4096,i,()=>new Lur),this._symbolDeclutterer=new Yur(i,this._symbolRepository,(r,n,s)=>new Wur(r,n,s,this.styleRepository,this._zoom,this._viewState.rotation),(r,n)=>{r.allSymbolsFadingOut=!0,r.lastOpacityUpdate=n,kur(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+yOt=n.maxzoom)return!1;const s=n.getLayoutProperty("visibility");return!s||s.getValue()!==_E.NONE})}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 i=this._tileToHandle.get(e);i&&(this._symbolRepository.removeTile(e),this.restartDeclutter(),i.remove(),this._tileToHandle.delete(e))}update(e,i){return this._zoom=e,this._viewState={scale:i.scale,rotation:i.rotation,center:[i.center[0],i.center[1]],size:[i.size[0],i.size[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._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._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(Z9i),this._completed&&this._scheduleNotifyStable())}_scheduleNotifyStable(){ve(this._stableNotificationHandle)&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout(()=>{this._stableNotificationHandle=null,this.emit("fade-complete")},(1+ecr)*UG)}_notifyUnstable(){ve(this._stableNotificationHandle)&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this.emit("fade-start")}},icr=class extends RU{_createTransforms(){return{dvs:Dl(),tileMat3:Dl()}}};const Jge=1e-6;function vOt(t,e){if(t){const i=t.getLayoutProperty("visibility");if(!i||i.getValue()!==_E.NONE&&(t.minzoom===void 0||t.minzoom=e-Jge))return!0}return!1}let rcr=class extends aee{constructor(e){super(e),this._backgroundTiles=[],this._pointToCallbacks=new Map}destroy(){this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._glyphMosaic?.dispose(),this._glyphMosaic=null,ve(this._symbolFader)&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[],this._pointToCallbacks.clear()}setStyleResources(e,i,r){if(this._spriteMosaic=e,this._glyphMosaic=i,this._styleRepository=r,lt(this._symbolFader)){const n=new tcr(this._styleRepository,this.children);n.on("fade-start",()=>{this.emit("fade-start"),this.requestRender()}),n.on("fade-complete",()=>{this.emit("fade-complete"),this.requestRender()}),this._symbolFader=n}this._symbolFader.styleRepository=r}setSpriteMosaic(e){this._spriteMosaic?.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){ve(this._symbolFader)&&this._symbolFader.deleteStyleLayers(e)}async hitTest(e){const i=kf();return this._pointToCallbacks.set(e,i),this.requestRender(),i.promise}enterTileInvalidation(){for(const e of this.children)e.invalidating=!0}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!==mo.MAP&&e.drawPhase!==mo.DEBUG||this._spriteMosaic===void 0||super.doRender(e)}addChild(e){return super.addChild(e),ve(this._symbolFader)?this._symbolFader.addTile(e):e.decluttered=!0,this.requestRender(),e}removeChild(e){return ve(this._symbolFader)&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){const{drawPhase:i}=e;if(i!==mo.DEBUG){if(this._doRender(e),this._pointToCallbacks.size>0){e.drawPhase=mo.HITTEST;const r=e.painter.effects.hittestVTL;r.bind(e),this._doRender(e),r.draw(e,this._pointToCallbacks),r.unbind(e),e.drawPhase=i}}else super.renderChildren(e)}removeAllChildren(){for(let e=0;ee.neededForCoverage&&e.hasData())}restartDeclutter(){ve(this._symbolFader)&&this._symbolFader.restartDeclutter()}_doRender(e){const{context:i}=e,r=this._styleRepository;if(!r)return;const n=r.layers;let s=!0;e.drawPhase===mo.HITTEST&&(s=!1),r.backgroundBucketIds.length>0&&(e.renderPass="background",this._renderBackgroundLayers(e,r.backgroundBucketIds)),super.renderChildren(e),e.drawPhase===mo.MAP&&this._fade(e.displayLevel,e.state);const o=this.children.filter(a=>a.visible&&a.hasData());if(!o||o.length===0)return i.bindVAO(),i.setStencilTestEnabled(!0),void i.setBlendingEnabled(!0);for(const a of o)a.triangleCount=0;i.setStencilWriteMask(0),i.setColorMask(!0,!0,!0,!0),i.setStencilOp(nu.KEEP,nu.KEEP,nu.REPLACE),i.setStencilTestEnabled(!0),i.setBlendingEnabled(!1),i.setDepthTestEnabled(!0),i.setDepthWriteEnabled(!0),i.setDepthFunction(kl.LEQUAL),i.setClearDepth(1),i.clear(i.gl.DEPTH_BUFFER_BIT),e.renderPass="opaque";for(let a=n.length-1;a>=0;a--)this._renderStyleLayer(n[a],e,o);i.setDepthWriteEnabled(!1),i.setBlendingEnabled(s),i.setBlendFunctionSeparate(Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA,Sn.ONE,Sn.ONE_MINUS_SRC_ALPHA),e.renderPass="translucent";for(let a=0;ac.decluttered):r.filter(c=>c.neededForCoverage),a!=="vtlSymbol"){const c=i.displayLevel;if(r.length===0||e.minzoom!==void 0&&e.minzoom>=c+Jge||e.maxzoom!==void 0&&e.maxzoom>1,i.col>>1,i.world);return Eh.pool.release(i),r}getTileCoverage(e,i,r){const n=super.getTileCoverage(e,i,r);if(!n)return n;const s=1<o.row>=0&&o.rowi[0].scale)return i[0].level;let r,n;for(let s=0;sn.scale)return r=i[s],r.level+(r.scale-e)/(r.scale-n.scale);return i[i.length-1].level}}_initializeFullCacheLODs(e){let i;if(e[0].level===0)i=e.map(r=>({level:r.level,resolution:r.resolution,scale:r.scale}));else{const r=this.tileInfo.size[0],n=this.tileInfo.spatialReference;i=Ul.create({size:r,spatialReference:n}).lods.map(s=>({level:s.level,resolution:s.resolution,scale:s.scale}))}for(let r=0;r{const{pixelRatio:i}=e.state;let r=0;const n=[],s=[];for(const o of this._vectorTileContainer.children)if(o.symbols)for(const[a,l]of o.symbols)for(const c of l)for(const h of c.colliders){const p=(h.xScreen+h.dxScreen)*i,y=(h.yScreen+h.dyScreen)*i,v=h.width*i,x=h.height*i,I=c.unique.parts[h.partIndex].targetOpacity>.5;if(!I&&this.layer.showCollisionBoxes!=="all")continue;const P=3,F=1,k=3,j=0,V=I?2:0,Y=I?3:0,X=Lke.makeFlags(V,Y);n.push(p,y,X,p+v,y,X,p,y+x,X,p+v,y+x,X),s.push(r+0,r+1,r+2,r+1,r+3,r+2),r+=4;const Z=I?P:F,ie=I?k:j,ce=Lke.makeFlags(Z,ie);n.push(p,y,ce,p+v,y,ce,p,y+1,ce,p+v,y+1,ce),s.push(r+0,r+1,r+2,r+1,r+3,r+2),r+=4,n.push(p,y+x-1,ce,p+v,y+x-1,ce,p,y+x,ce,p+v,y+x,ce),s.push(r+0,r+1,r+2,r+1,r+3,r+2),r+=4,n.push(p,y,ce,p+1,y,ce,p,y+x,ce,p+1,y+x,ce),s.push(r+0,r+1,r+2,r+1,r+3,r+2),r+=4,n.push(p+v-1,y,ce,p+v,y,ce,p+v-1,y+x,ce,p+v,y+x,ce),s.push(r+0,r+1,r+2,r+1,r+3,r+2),r+=4}return{vertexData:new Int16Array(n),indexData:new Uint32Array(s)}},this._getCollidersColors=()=>[1,.5,0,1,1,0,0,1,0,1,.5,1,0,.5,0,1],this._getCollidersOpacities=()=>[.05,.01,.15,.2]}async hitTest(e,i){if(!this._tileHandlerPromise)return null;await this._tileHandlerPromise;const r=await this._vectorTileContainer.hitTest(i);if(!r||r.length===0)return null;const n=r[0]-1,s=this._styleRepository,o=s.getStyleLayerByUID(n);if(!o)return null;const a=s.getStyleLayerIndex(o.id);return[{type:"graphic",mapPoint:e,layer:this.layer,graphic:new io({attributes:{layerId:a,layerName:o.id,layerUID:n},layer:this.layer,sourceLayer:this.layer})}]}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 jfe(e),this._tileInfoView=new ocr(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new rcr(this._tileInfoView),this._tileHandler=new Aur(this.layer,this._styleRepository,window.devicePixelRatio||1),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this._vectorTileContainer.on("fade-start",()=>{this.fading=!0,this.notifyChange("updating"),this.requestUpdate()}),this._vectorTileContainer.on("fade-complete",()=>{this._collisionOverlay?.requestRender(),this.fading=!1,this.notifyChange("updating"),this.requestUpdate()}),sr(()=>this.layer.showCollisionBoxes,i=>{i!=="none"?this._collisionOverlay||(this._collisionOverlay=new Lke({getMesh:this._getCollidersMesh,getColors:this._getCollidersColors,getOpacities:this._getCollidersOpacities}),this.container.addChild(this._collisionOverlay)):this._collisionOverlay&&(this.container.removeChild(this._collisionOverlay),this._collisionOverlay=null),this.container.requestRender()},Yo),this.layer.on("paint-change",i=>{if(i.isDataDriven)this._styleChanges.push({type:Sf.PAINTER_CHANGED,data:i}),this.notifyChange("updating"),this.requestUpdate();else{const r=this._styleRepository,n=r.getLayerById(i.layer);if(!n)return;const s=n.type===vl.SYMBOL;r.setPaintProperties(i.layer,i.paint),s&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender()}}),this.layer.on("layout-change",i=>{const r=this._styleRepository,n=r.getLayerById(i.layer);if(!n)return;const s=h2(n.layout,i.layout);if(!lt(s)){if(yA(s,"visibility")&&acr(s)===1)return r.setLayoutProperties(i.layer,i.layout),n.type===vl.SYMBOL&&this._vectorTileContainer.restartDeclutter(),void this._vectorTileContainer.requestRender();this._styleChanges.push({type:Sf.LAYOUT_CHANGED,data:i}),this.notifyChange("updating"),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",i=>{const r=this._styleRepository,n=r.getLayerById(i.layer);n&&(r.setStyleLayerVisibility(i.layer,i.visibility),n.type===vl.SYMBOL&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender())}),this.layer.on("style-layer-change",i=>{this._styleChanges.push({type:Sf.LAYER_CHANGED,data:i}),this.notifyChange("updating"),this.requestUpdate()}),this.layer.on("delete-style-layer",i=>{this._styleChanges.push({type:Sf.LAYER_REMOVED,data:i}),this.notifyChange("updating"),this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",i=>{this._newSpriteSource=i.spriteSource,this._styleChanges.push({type:Sf.SPRITES_CHANGED,data:null});const r=this._styleRepository.layers;for(const n of r)switch(n.type){case vl.SYMBOL:n.getLayoutProperty("icon-image")&&this._styleChanges.push({type:Sf.LAYOUT_CHANGED,data:{layer:n.id,layout:n.layout}});break;case vl.LINE:n.getPaintProperty("line-pattern")&&this._styleChanges.push({type:Sf.PAINTER_CHANGED,data:{layer:n.id,paint:n.paint,isDataDriven:n.isPainterDataDriven()}});break;case vl.FILL:n.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:Sf.PAINTER_CHANGED,data:{layer:n.id,paint:n.paint,isDataDriven:n.isPainterDataDriven()}})}this.notifyChange("updating"),this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=da(this._vectorTileContainer),this._tileHandler=da(this._tileHandler)}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this._collisionOverlay&&this._vectorTileContainer.restartDeclutter(),this.requestUpdate()}supportsSpatialReference(e){return Da(this.layer.tileInfo?.spatialReference,e)}canResume(){let e=super.canResume();const{currentStyleInfo:i}=this.layer;if(e&&i?.layerDefinition){const r=this.view.scale,{minScale:n,maxScale:s}=i.layerDefinition;i&&i.layerDefinition&&(n&&nr&&(e=!1))}return e}isUpdating(){const e=this._vectorTileContainer.children;return!this._isTileHandlerReady||!this._fetchQueue||!this._parseQueue||this._fetchQueue.updating||this._parseQueue.updating||e.length>0&&e.some(i=>i.invalidating)||this.fading}acquireTile(e){const i=this._createVectorTile(e);return this._tileHandlerPromise?.then(()=>{this._fetchQueue.push(i.key).then(r=>this._parseQueue.push({key:i.key,data:r})).then(r=>{i.once("attach",()=>this.requestUpdate()),i.setData(r),this.requestUpdate(),this.notifyChange("updating")}).catch(r=>{this.notifyChange("updating"),ys(r)||Oi.getLogger(this.declaredClass).error(r)})}),i}releaseTile(e){const i=e.key.id;this._fetchQueue.abort(i),this._parseQueue.abort(i),this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new Rur({acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const e=new AbortController,i=this._tileHandler.start({signal:e.signal}).then(()=>{this._fetchQueue=new aV({tileInfoView:this._tileInfoView,process:(r,n)=>this._getTileData(r,n),concurrency:15}),this._parseQueue=new aV({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.requestUpdate()}),this._tileHandlerAbortController=e,this._tileHandlerPromise=i}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=da(this._fetchQueue),this._parseQueue=da(this._parseQueue),this._tileManager=da(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,i){const r=await this._tileHandler.fetchTileData(e,i);return this.notifyChange("updating"),r}async _parseTileData(e,i){return this._tileHandler.parseTileData(e,i)}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(a){Oi.getLogger(this.declaredClass).error("error applying vector-tiles style update",a.message),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0}const i=this._styleRepository,r=[];e.forEach(a=>{if(a.type!==Sf.LAYER_REMOVED)return;const l=a.data,c=i.getLayerById(l.layer);c&&r.push(c.uid)});const n=[];let s;e.forEach(a=>{const l=a.type,c=a.data;switch(l){case Sf.PAINTER_CHANGED:i.setPaintProperties(c.layer,c.paint),s=c.layer;break;case Sf.LAYOUT_CHANGED:i.setLayoutProperties(c.layer,c.layout),s=c.layer;break;case Sf.LAYER_REMOVED:return void i.deleteStyleLayer(c.layer);case Sf.LAYER_CHANGED:i.setStyleLayer(c.layer,c.index),s=c.layer.id;break;case Sf.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(this._newSpriteSource)),this._newSpriteSource=null,s=null}const h=i.getLayerById(s);h&&n.push(h.uid)});const o=this._vectorTileContainer.children;if(r.length>0){this._vectorTileContainer.deleteStyleLayers(r);for(const a of o)a.deleteLayerData(r)}if(this._fetchQueue.resume(),this._parseQueue.resume(),n.length>0){const a=[];for(const l of o){const c=this._fetchQueue.push(l.key).then(h=>this._parseQueue.push({key:l.key,data:h,styleLayerUIDs:n})).then(h=>l.setData(h));a.push(c)}await Promise.all(a)}this._styleChanges=[],this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}async _loadStyle(){const{style:e}=this.layer.currentStyleInfo,i=gi(e);this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this.notifyChange("updating"),this._styleRepository=new jfe(i),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,i),await this._tileHandlerPromise}catch(s){if(!ys(s))throw s}if(r.aborted)return this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),void this.requestUpdate();const n=await this._tileHandler.spriteMosaic;this._vectorTileContainer.setStyleResources(n,this._tileHandler.glyphMosaic,this._styleRepository),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}_createVectorTile(e){const i=this._tileInfoView.getTileBounds(Mo(),e),r=this._tileInfoView.getTileResolution(e.level);return new Uur(e,r,i[0],i[3],512,512,this._styleRepository)}};function acr(t){if(lt(t))return 0;switch(t.type){case"partial":return Object.keys(t.diff).length;case"complete":return Math.max(Object.keys(t.oldValue).length,Object.keys(t.newValue).length);case"collection":return Object.keys(t.added).length+Object.keys(t.changed).length+Object.keys(t.removed).length}}E([N()],K6.prototype,"_fetchQueue",void 0),E([N()],K6.prototype,"_parseQueue",void 0),E([N()],K6.prototype,"_isTileHandlerReady",void 0),E([N()],K6.prototype,"fading",void 0),K6=E([dt("esri.views.2d.layers.VectorTileLayerView2D")],K6);const lcr=Object.freeze(Object.defineProperty({__proto__:null,default:K6},Symbol.toStringTag,{value:"Module"})),ucr=t=>{let e=class extends t{initialize(){this.exportImageParameters=new uT({layer:this.layer})}destroy(){this.exportImageParameters=da(this.exportImageParameters)}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}fetchPopupFeatures(i){const{layer:r}=this;if(!i)return Promise.reject(new st("wmslayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:r}));const{popupEnabled:n}=r;if(!n)return Promise.reject(new st("wmslayerview:fetchPopupFeatures","popupEnabled should be true",{popupEnabled:n}));const s=this.createFetchPopupFeaturesQuery(i);if(!s)return Promise.resolve([]);const{extent:o,width:a,height:l,x:c,y:h}=s;if(!(o&&a&&l))throw new st("wmslayerview:fetchPopupFeatures","WMSLayer does not support fetching features.",{extent:o,width:a,height:l});return r.fetchFeatureInfo(o,a,l,c,h)}};return E([N()],e.prototype,"exportImageParameters",void 0),E([N({readOnly:!0})],e.prototype,"exportImageVersion",null),E([N()],e.prototype,"layer",void 0),E([N(j9)],e.prototype,"timeExtent",void 0),e=E([dt("esri.layers.mixins.WMSLayerView")],e),e};let Aee=class extends ucr(LF(wy(xy))){constructor(){super(...arguments),this.bitmapContainer=new WU}supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}update(e){this.strategy.update(e).catch(i=>{ys(i)||Oi.getLogger(this.declaredClass).error(i)})}attach(){const{layer:e}=this,{imageMaxHeight:i,imageMaxWidth:r}=e;this.bitmapContainer=new WU,this.container.addChild(this.bitmapContainer),this.strategy=new Bge({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:i,imageMaxWidth:r,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.addAttachHandles(sr(()=>this.exportImageVersion,()=>this.requestUpdate()))}detach(){this.strategy=da(this.strategy),this.container.removeAllChildren()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(e){const{view:i,bitmapContainer:r}=this,{x:n,y:s}=e,{spatialReference:o}=i;let a,l=0,c=0;if(r.children.some(v=>{const{width:x,height:I,resolution:P,x:F,y:k}=v,j=F+P*x,V=k-P*I;return n>=F&&n<=j&&s<=k&&s>=V&&(a=new Ar({xmin:F,ymin:V,xmax:j,ymax:k,spatialReference:o}),l=x,c=I,!0)}),!a)return null;const h=a.width/l,p=Math.round((n-a.xmin)/h),y=Math.round((a.ymax-s)/h);return{extent:a,width:l,height:c,x:p,y}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(e,i,r,n){return this.layer.fetchImageBitmap(e,i,r,{timeExtent:this.timeExtent,...n})}};E([N()],Aee.prototype,"strategy",void 0),E([N()],Aee.prototype,"updating",void 0),Aee=E([dt("esri.views.2d.layers.WMSLayerView2D")],Aee);const ccr=Object.freeze(Object.defineProperty({__proto__:null,default:Aee},Symbol.toStringTag,{value:"Module"})),hcr=[102113,102100,3857,3785,900913],dcr=[0,0];let Pee=class extends LF(xPt(wy(xy))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this._tileRequests=new Map,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 CN(e),this._fetchQueue=new aV({tileInfoView:this._tileInfoView,concurrency:16,process:(i,r)=>this.fetchTile(i,r)}),this._tileStrategy=new uX({cachePolicy:"keep",resampling:!0,acquireTile:i=>this.acquireTile(i),releaseTile:i=>this.releaseTile(i),tileInfoView:this._tileInfoView}),this.addAttachHandles(sr(()=>[this.layer?.activeLayer?.styleId,this.tileMatrixSet],()=>this._refresh())),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()}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}acquireTile(e){const i=this._bitmapView.createTile(e),r=i.bitmap;return[r.x,r.y]=this._tileInfoView.getTileCoords(dcr,i.key),r.resolution=this._tileInfoView.getTileResolution(i.key),[r.width,r.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(i),this._bitmapView.addChild(i),this.requestUpdate(),i}async doRefresh(){!this.attached||this.updateRequested||this.suspended||this._refresh()}isUpdating(){return this._fetchQueue?.updating??!1}async fetchTile(e,i={}){const r="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:n,resamplingLevel:s=0}=i;if(!r)return this._fetchImage(e,n);const o=new Eh(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(ys(l))throw l;if(s<3){const c=this._tileInfoView.getTileParentId(e.id);if(c){const h=new Eh(c),p=await this.fetchTile(h,{...i,resamplingLevel:s+1});return Fge(this._tileInfoView,p,h,e)}}throw l}return Fge(this._tileInfoView,a,o,e)}canResume(){const e=super.canResume();return e&&this.tileMatrixSet!==null}supportsSpatialReference(e){return this.layer.activeLayer.tileMatrixSets?.some(i=>Da(i.tileInfo?.spatialReference,e))??!1}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(i){ys(i)||Oi.getLogger(this.declaredClass).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i})}_refresh(){this._fetchQueue.reset(),this._tileStrategy.tiles.forEach(e=>{if(!e.bitmap.source)return;const i={id:e.key.id,fulfilled:!1,promise:this._fetchQueue.push(e.key).then(r=>{e.bitmap.source=r}).catch(r=>{ys(r)||(e.bitmap.source=null)}).finally(()=>{e.requestRender(),i.fulfilled=!0})};this._tileRequests.set(e,i)})}_getTileMatrixSetBySpatialReference(e){const i=this.view.spatialReference;if(!e.tileMatrixSets)return null;let r=e.tileMatrixSets.find(n=>Da(n.tileInfo?.spatialReference,i));return!r&&i.isWebMercator&&(r=e.tileMatrixSets.find(n=>hcr.includes(n.tileInfo?.spatialReference.wkid??-1))),r}};E([N()],Pee.prototype,"_fetchQueue",void 0),E([N({readOnly:!0})],Pee.prototype,"tileMatrixSet",null),Pee=E([dt("esri.views.2d.layers.WMTSLayerView2D")],Pee);const pcr=Object.freeze(Object.defineProperty({__proto__:null,default:Pee},Symbol.toStringTag,{value:"Module"}));/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.8-next.4 - */const cur=Object.freeze(Object.defineProperty({__proto__:null,CalciteScrim:x2t,defineCustomElement:aQ},Symbol.toStringTag,{value:"Module"})),hur=["innerHTML"],Ige=Zr({__name:"default-button",props:{panelId:{type:String,required:!0},minimize:{type:Boolean,default:!1},overflow:{type:Boolean}},setup(t){const e=t,{t:i}=qn(),r=Qs("iApi"),n=Vr(()=>r?.panel.get(e.panelId)?.button),s=()=>{e.minimize?r?.panel.toggleMinimize(e.panelId):r?.panel.toggle(e.panelId)};return(o,a)=>{const l=Io("appbar-button");return Qt(n)?(Kt(),Pn(l,{key:0,onClickFunction:s,tooltip:Qt(i)(Qt(n).tooltip),id:t.panelId},{default:yn(()=>[Mt("div",{class:fs(["default fill-current w-24 h-24 ml-8 sm:ml-20",{"ml-20":t.overflow}]),innerHTML:Qt(n).icon},null,10,hur)]),_:1},8,["tooltip","id"])):hn("",!0)}}}),I4r="",dur={},pur={class:"border-b p-0 self-center w-2/3"};function fur(t,e){return Kt(),ci("span",pur)}const MPt=kl(dur,[["render",fur],["__scopeId","data-v-5d32b715"]]),mur=t=>(Xc("data-v-fc46cebd"),t=t(),Kc(),t),gur=["content"],yur=[mur(()=>Mt("svg",{class:"fill-current w-24 h-24 m-auto",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Mt("path",{d:"M0 0h24v24H0z",fill:"none"}),Mt("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))],vur=["position"],_ur=Zr({__name:"more-button",props:{position:{type:String,default:"bottom-right"},tooltip:{type:[String,Boolean],default:!1},tooltipPlacement:{type:String,default:"bottom"}},setup(t){const{t:e}=qn(),i=Pi(!1),r=Pi();return al(()=>{window.addEventListener("click",n=>{n.target instanceof HTMLElement&&!r.value?.contains(n.target)&&(i.value=!1)},{capture:!0})}),su(()=>{window.removeEventListener("click",n=>{n.target instanceof HTMLElement&&!r.value?.contains(n.target)&&(i.value=!1)},{capture:!0})}),(n,s)=>{const o=Qn("focus-item"),a=Qn("tippy");return Kt(),ci("div",{class:"appbar-item relative inset-x-0 w-full text-center",ref_key:"el",ref:r},[Br((Kt(),ci("button",{type:"button",class:"text-gray-400 w-full h-48 focus:outline-none hover:text-white",onClick:s[0]||(s[0]=l=>i.value=!i.value),content:Qt(e)("appbar.more")},yur,8,gur)),[[o],[a,{placement:"right"}]]),Br(Mt("div",{onBlur:s[1]||(s[1]=l=>i.value=!1),position:t.position,id:"dropdown",class:"dropdown shadow-md border border-gray:200 absolute w-64 flex flex-col bg-white rounded"},[jf(n.$slots,"default",{},void 0,!0)],40,vur),[[Bp,i.value]])],512)}}}),P4r="",bur=kl(_ur,[["__scopeId","data-v-fc46cebd"]]),wur=(t=>(Xc("data-v-f2294fce"),t=t(),Kc(),t))(()=>Mt("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"},[Mt("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)),xur={key:0,class:"number absolute top-1 right-2 text-white w-18 rounded-full"},Sur=Zr({__name:"appbar-button",setup(t){const e=qT(),{t:i}=qn(),r=Qs("iApi"),n=Vr(()=>e.notificationNumber),s=()=>{r.panel.toggle("notifications")};return(o,a)=>{const l=Io("appbar-button",!0);return Kt(),Pn(l,{onClickFunction:s,tooltip:Qt(i)("notifications.title"),class:"notification-button",id:""},{default:yn(()=>[wur,Qt(n)&&Qt(n)>0?(Kt(),ci("span",xur,gr(Qt(n)),1)):hn("",!0)]),_:1},8,["tooltip"])}}}),R4r="",Cur=kl(Sur,[["__scopeId","data-v-f2294fce"]]),Tur=Zr({__name:"appbar",setup(t){Qs("iApi");const e=C_(),i=hg(),r=Vr(()=>i.visible),n=Vr(()=>i.temporary),s=Pi(!1),o=Pi({}),a=Pi();return pv(()=>{const l=ff();window.addEventListener("resize",()=>l?.proxy?.$forceUpdate())}),su(()=>{const l=ff();window.removeEventListener("resize",()=>l?.proxy?.$forceUpdate())}),Hk(()=>{iy(()=>{const l=a.value;let c,d=[...l.children],p=d[d.length-2].getBoundingClientRect().top;e.mobileView||(p=l.getBoundingClientRect().bottom-38);let y=l.querySelector("#dropdown");for(let I=d.length-4;I>=0;I--){let O=d[I].getBoundingClientRect().bottom;if(p&&y&&(O>p||s.value&&O+56>p))d[I].classList.forEach(L=>{L.includes("identifier")&&(c=L.slice(11))}),c&&(o.value[c]=!0),s.value||(s.value=!0);else if(O!==0)break}let v=l.querySelector("#more"),S=v.getBoundingClientRect().bottom;if(c=void 0,s.value&&p&&v&&y&&S!==0&&(S<=p-56||y.childElementCount==1&&S<=p)){let I=y.childElementCount,O=0;for(;S<=p-56||I==1;){let L=y.children[O];if(L&&(L.classList.forEach(N=>{N.includes("identifier")&&(c=N.slice(11))}),c&&(o.value[c]=!1),S+=48,I-=1,O+=1),I===0){s.value=!1;break}}}Object.keys(o.value).forEach(I=>{l.querySelector(`.identifier-${I}`)||delete o.value[I]})})}),(l,c)=>{const d=Qn("focus-list");return Br((Kt(),ci("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",ref_key:"el",ref:a},[(Kt(!0),ci(eo,null,ou(Qt(r),(p,y)=>(Kt(),ci(eo,null,[(Kt(!0),ci(eo,null,ou(p,(v,S)=>(Kt(),ci(eo,null,[typeof v=="string"&&o.value[`${v}-${S}`]!==!0?(Kt(),Pn(Ige,{key:`${v}-${S}-default`,panelId:v,class:fs(["appbar-item h-48",`identifier-${v}-${S}`])},null,8,["panelId","class"])):o.value[`${v}-${S}`]!==!0?(Kt(),Pn(TP(v.componentId),{key:`${v}-${S}-custom`,options:v.options,class:fs(["appbar-item h-48",`identifier-${v}-${S}`]),id:v.id},null,8,["options","id","class"])):hn("",!0)],64))),256)),o.value[`divider-${y}`]!==!0?(Kt(),Pn(MPt,{key:0,class:fs(["appbar-item",`identifier-divider-${y}`])},null,8,["class"])):hn("",!0)],64))),256)),(Kt(!0),ci(eo,null,ou(Qt(n)?.filter(p=>o.value[`${p}-temp`]!==!0),p=>(Kt(),Pn(Ige,{panelId:p,minimize:!0,key:`${p}-temp`,class:fs([`identifier-${p}-temp`,"appbar-item h-48"])},null,8,["panelId","class"]))),128)),Br(Rn(bur,{id:"more"},{default:yn(()=>[(Kt(!0),ci(eo,null,ou(Qt(r),(p,y)=>(Kt(),ci(eo,{key:y},[(Kt(!0),ci(eo,null,ou(p,(v,S)=>(Kt(),ci(eo,null,[typeof v=="string"&&o.value[`${v}-${S}`]?(Kt(),Pn(Ige,{key:`${v}-${S}-default`,panelId:v,class:fs(["text-black hover:bg-gray my-4 h-36",`identifier-${v}-${S}`]),overflow:""},null,8,["panelId","class"])):o.value[`${v}-${S}`]?(Kt(),Pn(TP(v.componentId),{key:`${v}-${S}-custom`,options:v.options,id:v.id,class:fs(["appbar-item h-48",`identifier-${v}-${S}`])},null,8,["options","id","class"])):hn("",!0)],64))),256)),o.value[`divider-${y}`]?(Kt(),Pn(MPt,{key:0,class:fs(["border-black my-4",`identifier-divider-${y}`])},null,8,["class"])):hn("",!0)],64))),128)),(Kt(!0),ci(eo,null,ou(Qt(n)?.filter(p=>o.value[`${p}-temp`]),p=>(Kt(),Pn(Ige,{panelId:p,minimize:!0,key:`${p}-temp`,class:fs([`identifier-${p}-temp`,"text-black hover:bg-gray my-4 h-36"]),overflow:""},null,8,["panelId","class"]))),128))]),_:1},512),[[Bp,s.value]]),Rn(Cur,{class:"appbar-item bottom-48 h-48 sm:display-none"}),Rn(Vct,{class:"absolute bottom-0 h-40 sm:display-none w-full text-center",position:"right-start"})])),[[d]])}}}),M4r="";class Eur extends Cc{get config(){return super.config}_parseConfig(e){if(!e)return;const i=hg(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 OAe(o)))}),i.items=n.flat().reduce((s,o)=>(s[o instanceof OAe?o.id:o]=o,s),{}),i.order=n.map(s=>s.map(o=>o instanceof OAe?o.id:o)),this._validateItems()}_validateItems(){const e=hg(this.$vApp.$pinia);e.order.flat().forEach(i=>{typeof e.items[i]!="string"&&[i].some(r=>{this.$iApi.fixture.get(r)&&!e.items[i]&&(e.items[i].componentId=`${r}-appbar-button`)})})}}const Iur={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 Aur extends Eur{initialized(){}async added(){Object.entries(Iur).forEach(a=>this.$iApi.$i18n.mergeLocaleMessage(...a));const{vNode:e,destroy:i,el:r}=this.mount(Tur,{app:this.$element}),n=this.$vApp.$el.getElementsByClassName("inner-shell")[0];n.insertBefore(r.childNodes[0],n.querySelector(".panel-stack")),this._parseConfig(this.config);const s=this.$vApp.$watch(()=>this.config,a=>this._parseConfig(a)),o=[];o.push(this.$iApi.event.on(an.COMPONENT,()=>{this._parseConfig(this.config)})),this.removed=()=>{const a=hg(this.$vApp.$pinia);s(),o.forEach(d=>this.$iApi.event.off(d));const l={...a.items},c=[...a.temporary];Object.keys(l).forEach(d=>a.removeButton(d)),c.forEach(d=>a.removeButton(d)),i(),a.$reset()}}}const Pur=Object.freeze(Object.defineProperty({__proto__:null,default:Aur},Symbol.toStringTag,{value:"Module"})),Our=t=>(Xc("data-v-f5023e8d"),t=t(),Kc(),t),Rur={class:"mt-10"},Mur=["aria-label"],Dur=["alt","src"],Fur=["alt"],Lur={class:"absolute flex w-full bg-black opacity-75 text-white h-30 bottom-6 items-center"},kur={class:"pl-5"},Nur={class:"ml-auto pr-5"},$ur=["content"],Bur=[Our(()=>Mt("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Mt("path",{d:"M0 0h24v24H0z",fill:"none"}),Mt("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))],Gur=Zr({__name:"item",props:{area:{type:Object,required:!0},showThumbnail:{type:Boolean}},setup(t){const{t:e}=qn(),i=Qs("iApi"),r=n=>{if(!n.extent){console.error("selected area of interest doesn't have an extent specified.");return}i?.geo.map.zoomMapTo(Lp.fromConfig("area-of-interest-extent",n.extent))};return(n,s)=>{const o=Qn("truncate"),a=Qn("tippy"),l=Qn("focus-item");return Kt(),ci("div",Rur,[Br((Kt(),ci("button",{type:"button",class:fs(["area-of-interest-item-button bg-gray-300 w-full",{"border border-gray-300":t.showThumbnail}]),"aria-label":Qt(e)("areas-of-interest.select"),onClick:s[2]||(s[2]=c=>r(t.area))},[Mt("div",null,[Mt("div",{class:fs(["flex hover:opacity-50 area-of-interest-item-image",t.showThumbnail?"h-180":"h-30"])},[t.area.thumbnail?(Kt(),ci("img",{key:0,class:"w-full bg-white object-contain",alt:t.area.altText||t.area.title,src:t.area.thumbnail},null,8,Dur)):t.showThumbnail?(Kt(),ci("img",{key:1,class:"w-full bg-white object-contain py-30",alt:t.area.altText||t.area.title,src:"https://openclipart.org/image/800px/160615"},null,8,Fur)):hn("",!0)],2)]),Mt("div",Lur,[Br((Kt(),ci("div",kur,[Mt("span",null,gr(t.area.title),1)])),[[o]]),Br(Mt("div",Nur,[Br((Kt(),ci("a",{onClick:s[0]||(s[0]=_a(()=>{},["stop"])),onKeydown:s[1]||(s[1]=Ch(_a(()=>{},["prevent"]),["enter","space"])),content:t.area.description},Bur,40,$ur)),[[a,{placement:"bottom",trigger:"click focus"}]])],512),[[Bp,t.area.description]])])],10,Mur)),[[l]])])}}}),F4r="",Vur=kl(Gur,[["__scopeId","data-v-f5023e8d"]]),Uur={class:"h-600 overflow-y-auto"},jur={class:"mx-5"},zur={key:0},DPt=Zr({__name:"screen",props:{panel:{type:Object}},setup(t){const{t:e}=qn(),i=fhe(),r=Vr(()=>i.areas);let n=Pi(!1);return al(()=>{n.value=!!r.value?.some(s=>s.thumbnail)}),(s,o)=>{const a=Io("panel-screen"),l=Qn("focus-list");return Kt(),Pn(a,{panel:t.panel},{header:yn(()=>[Fs(gr(Qt(e)("areas-of-interest.title")),1)]),content:yn(()=>[Mt("div",Uur,[Mt("div",jur,[Qt(r).length>0?Br((Kt(),ci("ul",zur,[(Kt(!0),ci(eo,null,ou(Qt(r),(c,d)=>(Kt(),ci("li",{key:d},[Rn(Vur,{area:c,"show-thumbnail":Qt(n),class:"block relative overflow-hidden"},null,8,["area","show-thumbnail"])]))),128))])),[[l]]):hn("",!0)])])]),_:1},8,["panel"])}}}),Hur=Object.freeze(Object.defineProperty({__proto__:null,default:DPt},Symbol.toStringTag,{value:"Module"})),Wur={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 qur extends Cc{get config(){return super.config}_parseConfig(e){if(!e)return;const i=fhe(this.$vApp.$pinia);i.areas=e.areas}}class Yur extends qur{added(){this.$iApi.panel.register({"areas-of-interest":{screens:{"areas-of-interest-screen":Ho(DPt)},style:{width:"350px"},button:{tooltip:"areas-of-interest.title",icon:''},alertName:"areas-of-interest.title"}},{i18n:{messages:Wur}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,i=>this._parseConfig(i));this.removed=()=>{e(),this.$iApi.fixture.get("appbar")&&hg(this.$vApp.$pinia).removeButton("areas-of-interest"),this.$iApi.panel.remove("areas-of-interest"),fhe(this.$vApp.$pinia).$reset()}}}const Xur=Object.freeze(Object.defineProperty({__proto__:null,default:Yur},Symbol.toStringTag,{value:"Module"})),FPt=t=>(Xc("data-v-ee45654c"),t=t(),Kc(),t),Kur={class:"mb-10"},Jur=["aria-label"],Zur={key:0,class:"w-full h-30"},Qur=["alt","src"],ecr=["alt","src"],tcr=["alt"],icr={class:"pl-5"},rcr={class:"ml-auto pr-5"},ncr=["content"],scr=[FPt(()=>Mt("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Mt("path",{d:"M0 0h24v24H0z",fill:"none"}),Mt("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))],ocr={key:0,class:"rv-basemap-check absolute top-0 right-0"},acr=[FPt(()=>Mt("svg",{class:"fill-current w-25 h-25 relative",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Mt("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})],-1))],lcr=Zr({__name:"item",props:{basemap:{type:Object,required:!0},tileSchema:{type:Object,required:!0}},setup(t){const{t:e}=qn(),i=Qs("iApi"),r=dg(),n=Vr(()=>r.activeBasemapConfig),s=o=>{o.id!==n.value.id&&i?.geo.map.setBasemap(o.id)};return(o,a)=>{const l=Qn("truncate"),c=Qn("tippy"),d=Qn("focus-item");return Kt(),ci("div",Kur,[Br((Kt(),ci("button",{class:"basemap-item-button bg-gray-300",type:"button","aria-label":Qt(e)("basemap.select"),onClick:a[2]||(a[2]=p=>s(t.basemap))},[Mt("div",null,[Mt("div",{class:fs(["flex hover:opacity-50 basemap-item-image basemap-item-container",t.basemap.hideThumbnail?"h-30":"h-180"])},[t.basemap.hideThumbnail?(Kt(),ci("img",Zur)):t.basemap.thumbnailUrl?(Kt(),ci("img",{key:1,class:"w-full h-180",alt:t.basemap.altText,src:t.basemap.thumbnailUrl},null,8,Qur)):t.tileSchema.thumbnailTileUrls&&t.tileSchema.thumbnailTileUrls.length>0&&t.basemap.layers.every(p=>p.layerType==="esri-tile")?(Kt(!0),ci(eo,{key:2},ou(t.basemap.layers,p=>(Kt(),ci("div",{key:p.id,class:"flex basemap-item-inner h-180"},[(Kt(!0),ci(eo,null,ou(t.tileSchema.thumbnailTileUrls,(y,v)=>(Kt(),ci("img",{class:"w-full",alt:t.basemap.altText,src:p.url+y,key:v},null,8,ecr))),128))]))),128)):(Kt(),ci("img",{key:3,class:"w-full bg-white h-180",alt:t.basemap.altText,src:"https://openclipart.org/image/800px/275366"},null,8,tcr))],2)]),Mt("div",{class:fs(["absolute flex w-full bg-black text-white h-30 bottom-6 items-center",t.basemap.hideThumbnail&&t.basemap.id===Qt(n).id?"opacity-85":"opacity-75"])},[Br((Kt(),ci("div",icr,[Mt("span",null,gr(t.basemap.name),1)])),[[l]]),Mt("div",rcr,[Br((Kt(),ci("a",{onClick:a[0]||(a[0]=_a(()=>{},["stop"])),onKeydown:a[1]||(a[1]=Ch(_a(()=>{},["prevent"]),["enter","space"])),content:t.basemap.description},scr,40,ncr)),[[c,{placement:"bottom",trigger:"click focus"}]])])],2),t.basemap.id===Qt(n).id&&!t.basemap.hideThumbnail?(Kt(),ci("div",ocr,acr)):hn("",!0)],8,Jur)),[[d]])])}}}),N4r="",ucr=kl(lcr,[["__scopeId","data-v-ee45654c"]]),ccr={class:"h-600 overflow-y-auto"},hcr={class:"font-bold text-xl"},dcr={key:0,class:"border-t border-b border-gray-600"},LPt=Zr({__name:"screen",props:{panel:{type:Object}},setup(t){const{t:e}=qn(),i=dg(),r=Pi([]),n=Pi([]);al(()=>{const o=i.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=Io("panel-screen"),c=Qn("truncate"),d=Qn("focus-list");return Kt(),Pn(l,{panel:t.panel},{header:yn(()=>[Fs(gr(Qt(e)("basemap.title")),1)]),content:yn(()=>[Mt("div",ccr,[(Kt(!0),ci(eo,null,ou(r.value,(p,y)=>(Kt(),ci("div",{class:"mx-5",key:p.id},[Mt("div",{class:fs((y===0?"mt-5":"mt-36")+" flex mb-5")},[Br((Kt(),ci("h3",hcr,[Fs(gr(p.name),1)])),[[c]])],2),n.value.length>0?Br((Kt(),ci("ul",dcr,[(Kt(!0),ci(eo,null,ou(s(p.id),v=>(Kt(),ci("li",{key:v.id},[Rn(ucr,{basemap:v,tileSchema:p,class:"block relative overflow-hidden"},null,8,["basemap","tileSchema"])]))),128))])),[[d]]):hn("",!0)]))),128))])]),_:1},8,["panel"])}}}),pcr=Object.freeze(Object.defineProperty({__proto__:null,default:LPt},Symbol.toStringTag,{value:"Module"})),fcr=Mt("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Mt("path",{d:"M0 0h24v24H0z",fill:"none"}),Mt("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),mcr=Zr({__name:"nav-button",setup(t){const{t:e}=qn(),i=Qs("iApi"),r=()=>i?.panel.toggle("basemap");return(n,s)=>{const o=Io("mapnav-button");return Kt(),Pn(o,{onClickFunction:r,tooltip:Qt(e)("basemap.title")},{default:yn(()=>[fcr]),_:1},8,["tooltip"])}}}),gcr={en:{"basemap.select":"Select basemap","basemap.title":"Basemap"},fr:{"basemap.select":"Sélectionner la carte de base","basemap.title":"Carte de base"}};class ycr extends Cc{added(){this.$iApi.component("basemap-nav-button",mcr),this.$iApi.panel.register({id:"basemap",config:{screens:{"basemap-component":Ho(LPt)},button:{tooltip:"basemap.title",icon:''},alertName:"basemap.title"}},{i18n:{messages:gcr}})}removed(){this.$iApi.fixture.get("appbar")&&hg(this.$vApp.$pinia).removeButton("basemap"),this.$iApi.fixture.get("mapnav")&&dD(this.$vApp.$pinia).removeItem("basemap"),this.$iApi.panel.remove("basemap")}}const vcr=Object.freeze(Object.defineProperty({__proto__:null,default:ycr},Symbol.toStringTag,{value:"Module"})),_cr=[(t=>(Xc("data-v-495353cf"),t=t(),Kc(),t))(()=>Mt("svg",{xmlns:"http://www.w3.org/2000/svg",fit:"",height:"100%",width:"100%",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false"},[Mt("g",{fill:"#545353",stroke:"#fff",id:"crosshairs"},[Mt("ellipse",{ry:".254",rx:".262",id:"path3808",cx:"12",cy:"12","stroke-width":".076"}),Mt("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"}),Mt("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"}),Mt("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"}),Mt("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))],bcr=Zr({__name:"crosshairs",setup(t){const e=Qs("iApi"),i=Pi(!1),r=Pi([]);return al(()=>{r.value.push(e.event.on(an.MAP_EXTENTCHANGE,()=>{e.geo.map.keysActive&&(i.value=!0)})),r.value.push(e.event.on(an.MAP_FOCUS,()=>{e.geo.map.mouseFocus||(i.value=!0)})),r.value.push(e.event.on(an.MAP_MOUSEDOWN,()=>{i.value=!1})),r.value.push(e.event.on(an.MAP_BLUR,()=>{i.value=!1}))}),su(()=>{r.value.forEach(n=>e.event.off(n))}),(n,s)=>(Kt(),ci("div",{class:fs(["crosshairs absolute duration-150 top-1/2 left-1/2 h-230 w-230",{"opacity-0":!i.value}])},_cr,2))}}),G4r="",wcr=kl(bcr,[["__scopeId","data-v-495353cf"]]);class xcr extends Cc{added(){const{destroy:e,el:i}=this.mount(wcr,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(i.childNodes[0]),this.removed=()=>{e()}}}const Scr=Object.freeze(Object.defineProperty({__proto__:null,default:xcr},Symbol.toStringTag,{value:"Module"})),Age="Ramp-Hilight",fNe="Ramp-Hilight-Fog-Basemap",Ccr={mode:"glow",options:{haloColor:[0,255,0],haloOpacity:.8}};var X6=(t=>(t.NONE="none",t.GLOW="glow",t.LIFT="lift",t.FOG="fog",t))(X6||{});const mNe="details";class Tcr extends Cc{detailsStore=rN(this.$vApp.$pinia);get config(){return super.config}openDetails(e){this.detailsStore.payload=e,this.$iApi.panel.get("details-layers").isOpen||this.$iApi.panel.open({id:"details-layers"})}toggleFeature(e,i){const r=this.$iApi.panel.get("details-layers");r.isOpen&&this.$iApi.panel.close(r);const n=this.$iApi.panel.get("details-items"),s={result:{items:[{data:e.data,format:e.format,loaded:!0,loading:Promise.resolve()}],uid:e.uid,loading:Promise.resolve(),loaded:!0}},o=this.detailsStore.currentFeatureId,a=`${e.uid}-${e.data.OBJECTID}`;this.detailsStore.currentFeatureId=e.data?a:void 0,i===!1?this.$iApi.panel.close(n):n.isOpen?o!==a||i===!0?n.show({screen:"item-screen",props:s}):this.$iApi.panel.close(n):this.$iApi.panel.open({id:"details-items",screen:"item-screen",props:s})}_parseConfig(e){e&&e.templates&&(this.detailsStore.defaultTemplates=e.templates),this.handlePanelWidths(["details-items","details-layers"]);const i=this.getLayerFixtureConfigs(),r=[];Object.keys(i).forEach(s=>{r.push({id:s,name:i[s].name,template:i[s].template})});const n=r.map(s=>new rvi(s));this.detailsStore.properties=n.reduce((s,o)=>(s[o.id]=o,s),{}),this._validateItems()}_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,i){const r=e instanceof Array?e:[e],n=this.$iApi.fixture.get("hilight");if(n){const s=await n.getGraphicsByKey(origin=mNe);await n.removeHilight(s);const o=Date.now();this.detailsStore.lastHilight=o;const a=await this.getHilightGraphics(r,i);this.detailsStore.lastHilight===o&&await n.addHilight(a)}}async removeDetailsHilight(){const e=this.$iApi.fixture.get("hilight");if(e){this.detailsStore.lastHilight=Date.now();const i=await e.getGraphicsByKey(origin=mNe);await e.removeHilight(i)}}async reloadDetailsHilight(e,i){const r=e instanceof Array?e:[e],n=this.$iApi.fixture.get("hilight");if(n){const s=await this.getHilightGraphics(r,i);n.reloadHilight(s)}}async getHilightGraphics(e,i){const r=this.$iApi.geo.layer.getLayer(i),n=this.$iApi.fixture.get("hilight"),s=[];return r&&await Promise.all(e.map(async o=>{const a=o.data[r.oidField],l=await r.getGraphic(a,{getGeom:!0,getAttribs:!0,getStyle:!0});l.id=n.constructGraphicKey(mNe,i,a),s.push(l)})),s}onHilightToggle(e,i,r){e?(this.hilightDetailsItems(i,r),this.detailsStore.hilightToggle=!0):(this.removeDetailsHilight(),this.detailsStore.hilightToggle=!1)}hasHilighter(){const e=this.$iApi.fixture.get("hilight");return e&&e.hilightMode.mode!==X6.NONE}}const Ecr={key:0},Icr={class:"p-5"},Acr=["onClick","disabled"],Pcr=Mt("div",{class:"flex-auto"},null,-1),Ocr={key:0,class:"px-5"},Rcr={key:1,class:"animate-spin spinner h-20 w-20 px-5"},Mcr={key:1,class:"flex justify-center py-10 items-center"},Dcr=Mt("span",{class:"animate-spin spinner h-20 w-20 px-5 mr-8"},null,-1),Fcr={key:2},Lcr=Zr({__name:"layers-screen",props:{panel:yN},setup(t){const{t:e}=qn(),i=Qs("iApi"),r=mv(),n=C_(),s=rN(),o=Pi([]),a=Pi(""),l=Pi([]),c=Pi([]),d=Vr(()=>s.activeGreedy),p=Vr(()=>s.slowLoadingFlag),y=Vr(()=>s.payload),v=Vr(()=>s.properties);Vr(()=>r.layers);const S=Vr(()=>n.mobileView),I=Vr(()=>n.getRemainingWidth),O=Vr(()=>o.value.map(re=>re.items.length).reduce((re,fe)=>re+fe,0)),L=re=>{if(re===void 0)return;const fe=i.panel.get("details-items"),ge=fe.width||350,_e=S.value||I.value{const fe=i.panel.get("details-items");if(a.value&&fe.isOpen){const ge=o.value.findIndex(_e=>_e.uid===a.value);if(ge!==-1){const _e=o.value[ge];_e.loading.then(()=>{_e.requestTime===d.value&&(_e.items.length>0?(s.activeGreedy=0,X(ge)):G(re))})}else G(re)}else G(re);setTimeout(()=>{d.value!==0&&re[0].requestTime===d.value&&(s.slowLoadingFlag=!0)},500)},G=re=>{const fe=re.map(_e=>_e.loading.then(()=>_e.items.length>0?Promise.resolve(_e):Promise.reject())),ge=re.length===0?0:re[0].requestTime;Promise.any(fe).then(_e=>{if(_e.requestTime!==d.value)return;const Ie=o.value.findIndex(ke=>ke.uid===_e.uid);s.activeGreedy=0,Ie!==-1&&X(Ie)}).catch(()=>{ge===d.value&&(a.value="",s.activeGreedy=0,Y())})},V=re=>{Promise.all(re.map(fe=>fe.loading)).then(()=>{i.updateAlert(i.$i18n.t("details.layers.found",{numResults:O.value,numLayers:re.length}))})},Y=()=>{const re=i.panel.get("details-items");re.isOpen&&re.close()},X=re=>{if(y.value[re].items.length>0){s.activeGreedy=0;let fe=i.panel.get("details-items"),ge={result:y.value[re]};a.value=y.value[re].uid,fe.isOpen?fe.show({screen:"item-screen",props:ge}):i.panel.open({id:"details-items",screen:"item-screen",props:ge})}},te=re=>{const fe=y.value[re];let ge=r.getLayerByUid(fe.uid);return ge&&v.value[ge.id]&&v.value[ge.id].name?v.value[ge.id].name:ge?.name??""};return pv(()=>{c.value.push(Sc(y,re=>{L(re)},{deep:!1,immediate:!0}))}),al(()=>{l.value.push(i.event.on(an.PANEL_CLOSED,re=>{(re.id==="details-items"||re.id==="details-layers")&&(s.activeGreedy=0)})),c.value.push(Sc(d,re=>{re===0&&(s.slowLoadingFlag=!1)}))}),su(()=>{l.value.forEach(re=>i.event.off(re)),c.value.forEach(re=>re())}),(re,fe)=>{const ge=Io("panel-screen"),_e=Qn("truncate");return Kt(),Pn(ge,{panel:t.panel},{header:yn(()=>[Fs(gr(Qt(e)("details.layers.title")),1)]),content:yn(()=>[Qt(d)===0?(Kt(),ci("div",Ecr,[Mt("div",Icr,gr(Qt(e)("details.layers.found",{numResults:Qt(O),numLayers:Qt(y).length})),1),(Kt(!0),ci(eo,null,ou(o.value,(Ie,ke)=>(Kt(),ci("button",{type:"button",class:"w-full px-20 py-10 text-md flex hover:bg-gray-200 cursor-pointer disabled:cursor-default",key:Ie.uid,onClick:Ne=>Ie.loaded&&X(ke),disabled:!(Ie.loaded&&Ie.items.length>0)},[Br((Kt(),ci("div",null,[Fs(gr(te(ke)||Qt(e)("details.layers.loading")),1)])),[[_e]]),Pcr,Ie.loaded?(Kt(),ci("div",Ocr,gr(Ie.items.length),1)):(Kt(),ci("div",Rcr))],8,Acr))),128))])):Qt(p)?(Kt(),ci("div",Mcr,[Dcr,Fs(" "+gr(Qt(e)("details.item.loading")),1)])):(Kt(),ci("div",Fcr))]),_:1},8,["panel"])}}});var gNe={name:"Toggle",emits:["input","update:modelValue","change"],props:{value:{validator:function(t){return e=>["number","string","boolean"].indexOf(typeof e)!==-1||e==null},required:!1},modelValue:{validator:function(t){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(t,e){const i=function(o,a,l){const{value:c,modelValue:d,falseValue:p,trueValue:y,disabled:v}=Bk(o),S=d&&d.value!==void 0?d:c,I=Vr(()=>S.value===y.value),O=G=>{a.emit("input",G),a.emit("update:modelValue",G),a.emit("change",G)},L=()=>{O(y.value)},N=()=>{O(p.value)};return[null,void 0,!1,0,"0","off"].indexOf(S.value)!==-1&&[p.value,y.value].indexOf(S.value)===-1&&N(),[!0,1,"1","on"].indexOf(S.value)!==-1&&[p.value,y.value].indexOf(S.value)===-1&&L(),{externalValue:S,checked:I,update:O,check:L,uncheck:N,handleInput:G=>{O(G.target.checked?y.value:p.value)},handleClick:()=>{v.value||(I.value?N():L())}}}(t,e),r=function(o,a,l){const{trueValue:c,falseValue:d,onLabel:p,offLabel:y}=Bk(o),v=l.checked,S=l.update;return{label:Vr(()=>{let I=v.value?p.value:y.value;return I||(I=" "),I}),toggle:()=>{S(v.value?d.value:c.value)},on:()=>{S(c.value)},off:()=>{S(d.value)}}}(t,0,{checked:i.checked,update:i.update}),n=function(o,a,l){const c=Bk(o),d=c.disabled,p=l.checked,y=Vr(()=>({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",...c.classes.value}));return{classList:Vr(()=>({container:y.value.container,toggle:[y.value.toggle,d.value?p.value?y.value.toggleOnDisabled:y.value.toggleOffDisabled:p.value?y.value.toggleOn:y.value.toggleOff],handle:[y.value.handle,d.value?p.value?y.value.handleOnDisabled:y.value.handleOffDisabled:p.value?y.value.handleOn:y.value.handleOff],label:y.value.label}))}}(t,0,{checked:i.checked}),s=function(o,a,l){const{disabled:c}=Bk(o),d=l.check,p=l.uncheck,y=l.checked;return{handleSpace:()=>{c.value||(y.value?p():d())}}}(t,0,{check:i.check,uncheck:i.uncheck,checked:i.checked});return{...i,...n,...r,...s}}};const kcr=["tabindex","aria-checked","aria-describedby","aria-labelledby"],Ncr=["id","name","value","checked","disabled"],$cr=["innerHTML"],Bcr=["checked"];gNe.render=function(t,e,i,r,n,s){return Kt(),ci("div",XX({class:t.classList.container,tabindex:i.disabled?void 0:0,"aria-checked":t.checked,"aria-describedby":i.describedby,"aria-labelledby":i.labelledby,role:"switch"},i.aria,{onKeypress:e[1]||(e[1]=Ch(_a((...o)=>t.handleSpace&&t.handleSpace(...o),["prevent"]),["space"]))}),[Br(Mt("input",{type:"checkbox",id:i.id,name:i.name,value:i.trueValue,checked:t.checked,disabled:i.disabled},null,8,Ncr),[[Bp,!1]]),Mt("div",{class:fs(t.classList.toggle),onClick:e[0]||(e[0]=(...o)=>t.handleClick&&t.handleClick(...o))},[Mt("span",{class:fs(t.classList.handle)},null,2),jf(t.$slots,"label",{checked:t.checked,classList:t.classList},()=>[Mt("span",{class:fs(t.classList.label),innerHTML:t.label},null,10,$cr)]),i.required?(Kt(),ci("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:t.checked,"aria-hidden":"true",tabindex:"-1",required:""},null,8,Bcr)):hn("v-if",!0)],2)],16,kcr)},gNe.__file="src/Toggle.vue";const Gcr=t=>(Xc("data-v-ecf1417a"),t=t(),Kc(),t),Vcr={class:"flex flex-row rv-label"},Ucr={class:"flex items-center"},jcr=["innerHTML"],zcr=Gcr(()=>Mt("div",{class:"flex-1"},null,-1)),Hcr=Zr({__name:"toggle-switch-control",props:{config:{type:Object,required:!0},name:String,icon:String},emits:["toggled"],setup(t,{emit:e}){const i=t,r=Pi(i.config.value),n=Pi(!!i.config.disabled),s=Pi(0),o=Tl([]);o.push(Sc(Wue(i,"config"),(l,c)=>{r.value=l.value,n.value=!!l.disabled,s.value+=n.value!==c.disabled?1:0},{deep:!0}));const a=()=>{n.value||(r.value=!r.value,e("toggled",r.value))};return su(()=>{o.forEach(l=>l())}),(l,c)=>(Kt(),ci("div",Vcr,[Mt("div",Ucr,[Mt("div",{innerHTML:t.icon,class:"p-8 pl-0"},null,8,jcr),Fs(" "+gr(t.name),1)]),zcr,(Kt(),Pn(Qt(gNe),{onChange:c[0]||(c[0]=d=>e("toggled",d)),onKeyupCapture:[Ch(_a(a,["stop"]),["enter"]),Ch(_a(a,["stop"]),["space"])],disabled:n.value,key:s.value,modelValue:r.value,"onUpdate:modelValue":c[1]||(c[1]=d=>r.value=d),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"]))]))}}),V4r="",yNe=kl(Hcr,[["__scopeId","data-v-ecf1417a"]]),Wcr={key:0},qcr={key:0},Ycr={key:0},Xcr={key:0,class:"flex justify-between py-8 px-8 mb-8 bg-gray-100"},Kcr={class:"p-8 font-bold break-words"},Jcr={key:1,class:"p-8 mb-8 bg-gray-100 flex justify-between"},Zcr=["innerHTML"],Qcr={key:1,class:"flex-initial py-5 px-10"},ehr={key:2,class:"animate-spin spinner h-20 w-20 px-5"},thr={key:1},ihr={key:1,class:"p-5"},rhr={key:1,class:"flex justify-center py-10 items-center"},nhr=Mt("span",{class:"animate-spin spinner h-20 w-20 px-5 mr-8"},null,-1),shr={key:2},ohr=Zr({__name:"result-screen",props:{panel:{type:Object,required:!0},result:{type:Object,required:!0},previousItemIndex:{type:Number,default:-1}},setup(t){const e=t,{t:i}=qn(),r=Qs("iApi"),n=rN(),s=Vr(()=>n.properties),o=Vr(()=>n.activeGreedy),a=Vr(()=>n.slowLoadingFlag),l=Vr(()=>r.geo.layer.getLayer(e.result.uid)?.nameField),c=Vr(()=>{const V=r.geo.layer.getLayer(e.result.uid);return V&&s.value[V.id]&&s.value[V.id].name?s.value[V.id].name:V?.name??""}),d=Pi([]),p=Pi(!1),y=Pi([]),v=Pi(r.fixture.get("details")),S=Pi(!0);al(()=>{p.value=r.geo.layer.getLayer(e.result.uid)!==void 0,S.value=n.hilightToggle??S.value,S.value&&v.value.hilightDetailsItems(e.result.items,e.result.uid),r.updateAlert(r.$i18n.t("details.item.alert.show.list",{layerName:c.value})),y.value.push(r.event.on(an.LAYER_REMOVE,V=>{e.result.uid===V.uid&&e.panel.close()})),y.value.push(r.event.on(an.PANEL_CLOSED,V=>{V.id=="details-items"&&I()})),y.value.push(r.event.on(an.PANEL_MINIMIZED,V=>{V.id=="details-items"&&O()})),y.value.push(r.event.on(an.MAP_BASEMAPCHANGE,()=>{S.value&&v.value.reloadDetailsHilight(e.result.items,e.result.uid)}))}),su(()=>{y.value.forEach(V=>r.event.off(V))});const I=()=>{v.value.removeDetailsHilight(),n.hilightToggle=!0},O=()=>{v.value.removeDetailsHilight()},L=V=>{e.panel.show({screen:"item-screen",props:{result:e.result,itemIndex:V}})},N=(V,Y)=>{const X=r.geo.layer.getLayer(e.result.uid);if(X===void 0){console.warn(`could not find layer for uid ${e.result.uid} during icon lookup`);return}const te=X.oidField;return X.getIcon(V[te]).then(re=>{d.value[Y]!==re&&(d.value[Y]=re)}),d.value[Y]},G=V=>{S.value=V,v.value.onHilightToggle(V,e.result.items,e.result.uid)};return(V,Y)=>{const X=Io("panel-screen"),te=Qn("truncate"),re=Qn("focus-item");return Kt(),Pn(X,{panel:t.panel},{header:yn(()=>[Fs(gr(Qt(i)("details.items.title")),1)]),content:yn(()=>[t.result.loaded&&Qt(o)===0?(Kt(),ci("div",Wcr,[p.value?(Kt(),ci("div",qcr,[t.result.items.length>0?(Kt(),ci("div",Ycr,[p.value?(Kt(),ci("div",Xcr,[Mt("div",Kcr,gr(Qt(c)),1)])):hn("",!0),v.value.hasHilighter()?(Kt(),ci("div",Jcr,[Mt("div",null,gr(Qt(i)("details.togglehilight.title")),1),Rn(yNe,{config:{value:S.value,disabled:!1},onToggled:G},null,8,["config"])])):hn("",!0),(Kt(!0),ci(eo,null,ou(t.result.items,(fe,ge,_e,Ie)=>{const ke=[d.value[ge]];if(Ie&&Ie.key===ge&&vce(Ie,ke))return Ie;const Ne=Br((Kt(),ci("button",{type:"button",class:"w-full flex px-16 py-10 text-md hover:bg-gray-200 cursor-pointer",key:ge,onClick:J=>fe.loaded&&L(ge),disabled:!fe.loaded},[fe.loaded?(Kt(),ci("span",{key:0,innerHTML:N(fe.data,ge),class:"flex-none symbologyIcon"},null,8,Zcr)):hn("",!0),fe.loaded?Br((Kt(),ci("span",Qcr,[Fs(gr(Qt(l)?fe.data[Qt(l)]:Qt(i)("details.result.default.name",[ge+1])),1)])),[[te]]):hn("",!0),fe.loaded?hn("",!0):(Kt(),ci("span",ehr))],8,["onClick","disabled"])),[[re],[te]]);return Ne.memo=ke,Ne},Y,0),128))])):(Kt(),ci("div",thr,gr(Qt(i)("details.layers.results.empty")),1))])):(Kt(),ci("div",ihr,gr(Qt(i)("details.item.no.data")),1))])):Qt(a)?(Kt(),ci("div",rhr,[nhr,Fs(" "+gr(Qt(i)("details.item.loading")),1)])):(Kt(),ci("div",shr))]),_:1},8,["panel"])}}}),ahr="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",lhr="ελ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",t7=(t,e)=>{for(const i in e)t[i]=e[i];return t},vNe="numeric",_Ne="ascii",bNe="alpha",Pge="asciinumeric",Oge="alphanumeric",wNe="domain",kPt="emoji",uhr="scheme",chr="slashscheme",NPt="whitespace";function hhr(t,e){return t in e||(e[t]=[]),e[t]}function K6(t,e,i){e[vNe]&&(e[Pge]=!0,e[Oge]=!0),e[_Ne]&&(e[Pge]=!0,e[bNe]=!0),e[Pge]&&(e[Oge]=!0),e[bNe]&&(e[Oge]=!0),e[Oge]&&(e[wNe]=!0),e[kPt]&&(e[wNe]=!0);for(const r in e){const n=hhr(r,i);n.indexOf(t)<0&&n.push(t)}}function dhr(t,e){const i={};for(const r in e)e[r].indexOf(t)>=0&&(i[r]=!0);return i}function Eb(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}Eb.groups={},Eb.prototype={accepts(){return!!this.t},go(t){const e=this,i=e.j[t];if(i)return i;for(let r=0;rt.ta(e,i,r,n),yx=(t,e,i,r,n)=>t.tr(e,i,r,n),$Pt=(t,e,i,r,n)=>t.ts(e,i,r,n),xn=(t,e,i,r,n)=>t.tt(e,i,r,n),PO="WORD",xNe="UWORD",Tee="LOCALHOST",SNe="TLD",CNe="UTLD",Rge="SCHEME",i7="SLASH_SCHEME",Mge="NUM",BPt="WS",TNe="NL",r7="OPENBRACE",Eee="OPENBRACKET",Iee="OPENANGLEBRACKET",Aee="OPENPAREN",J6="CLOSEBRACE",n7="CLOSEBRACKET",s7="CLOSEANGLEBRACKET",Z6="CLOSEPAREN",Dge="AMPERSAND",Fge="APOSTROPHE",Lge="ASTERISK",GF="AT",kge="BACKSLASH",Nge="BACKTICK",$ge="CARET",VF="COLON",ENe="COMMA",Bge="DOLLAR",JE="DOT",Gge="EQUALS",INe="EXCLAMATION",ZE="HYPHEN",Vge="PERCENT",Uge="PIPE",jge="PLUS",zge="POUND",Hge="QUERY",ANe="QUOTE",PNe="SEMI",OO="SLASH",Pee="TILDE",Wge="UNDERSCORE",GPt="EMOJI",qge="SYM";var VPt=Object.freeze({__proto__:null,WORD:PO,UWORD:xNe,LOCALHOST:Tee,TLD:SNe,UTLD:CNe,SCHEME:Rge,SLASH_SCHEME:i7,NUM:Mge,WS:BPt,NL:TNe,OPENBRACE:r7,OPENBRACKET:Eee,OPENANGLEBRACKET:Iee,OPENPAREN:Aee,CLOSEBRACE:J6,CLOSEBRACKET:n7,CLOSEANGLEBRACKET:s7,CLOSEPAREN:Z6,AMPERSAND:Dge,APOSTROPHE:Fge,ASTERISK:Lge,AT:GF,BACKSLASH:kge,BACKTICK:Nge,CARET:$ge,COLON:VF,COMMA:ENe,DOLLAR:Bge,DOT:JE,EQUALS:Gge,EXCLAMATION:INe,HYPHEN:ZE,PERCENT:Vge,PIPE:Uge,PLUS:jge,POUND:zge,QUERY:Hge,QUOTE:ANe,SEMI:PNe,SLASH:OO,TILDE:Pee,UNDERSCORE:Wge,EMOJI:GPt,SYM:qge});const o7=/[a-z]/,ONe=/\p{L}/u,RNe=/\p{Emoji}/u,MNe=/\d/,UPt=/\s/,jPt=` -`,phr="️",fhr="‍";let Yge=null,Xge=null;function mhr(t){t===void 0&&(t=[]);const e={};Eb.groups=e;const i=new Eb;Yge==null&&(Yge=zPt(ahr)),Xge==null&&(Xge=zPt(lhr)),xn(i,"'",Fge),xn(i,"{",r7),xn(i,"[",Eee),xn(i,"<",Iee),xn(i,"(",Aee),xn(i,"}",J6),xn(i,"]",n7),xn(i,">",s7),xn(i,")",Z6),xn(i,"&",Dge),xn(i,"*",Lge),xn(i,"@",GF),xn(i,"`",Nge),xn(i,"^",$ge),xn(i,":",VF),xn(i,",",ENe),xn(i,"$",Bge),xn(i,".",JE),xn(i,"=",Gge),xn(i,"!",INe),xn(i,"-",ZE),xn(i,"%",Vge),xn(i,"|",Uge),xn(i,"+",jge),xn(i,"#",zge),xn(i,"?",Hge),xn(i,'"',ANe),xn(i,"/",OO),xn(i,";",PNe),xn(i,"~",Pee),xn(i,"_",Wge),xn(i,"\\",kge);const r=yx(i,MNe,Mge,{[vNe]:!0});yx(r,MNe,r);const n=yx(i,o7,PO,{[_Ne]:!0});yx(n,o7,n);const s=yx(i,ONe,xNe,{[bNe]:!0});yx(s,o7),yx(s,ONe,s);const o=yx(i,UPt,BPt,{[NPt]:!0});xn(i,jPt,TNe,{[NPt]:!0}),xn(o,jPt),yx(o,UPt,o);const a=yx(i,RNe,GPt,{[kPt]:!0});yx(a,RNe,a),xn(a,phr,a);const l=xn(a,fhr);yx(l,RNe,a);const c=[[o7,n]],d=[[o7,null],[ONe,s]];for(let p=0;pp[0]>y[0]?1:-1);for(let p=0;p=0?S[wNe]=!0:o7.test(y)?MNe.test(y)?S[Pge]=!0:S[_Ne]=!0:S[vNe]=!0,$Pt(i,y,y,S)}return $Pt(i,"localhost",Tee,{ascii:!0}),i.jd=new Eb(qge),{start:i,tokens:t7({groups:e},VPt)}}function ghr(t,e){const i=yhr(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=i.length,n=[];let s=0,o=0;for(;o=0&&(p+=i[o].length,y++),c+=i[o].length,s+=i[o].length,o++;s-=p,o-=y,c-=p,n.push({t:d.t,v:e.slice(s-c,s),s:s-c,e:s})}return n}function yhr(t){const e=[],i=t.length;let r=0;for(;r56319||r+1===i||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function UF(t,e,i,r,n){let s;const o=e.length;for(let a=0;a=0;)s++;if(s>0){e.push(i.join(""));let o=parseInt(t.substring(r,r+s),10);for(;o>0;o--)i.pop();r+=s}else t[r]==="_"?(e.push(i.join("")),r++):(i.push(t[r]),r++)}return e}const Oee={defaultProtocol:"http",events:null,format:HPt,formatHref:HPt,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function DNe(t,e){e===void 0&&(e=null);let i=t7({},Oee);t&&(i=t7(i,t instanceof DNe?t.o:t));const r=i.ignoreTags,n=[];for(let s=0;si?r.substring(0,i)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return t===void 0&&(t=Oee.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,i=this.toFormattedHref(t),r=t.get("tagName",i,e),n=this.toFormattedString(t),s={},o=t.get("className",i,e),a=t.get("target",i,e),l=t.get("rel",i,e),c=t.getObj("attributes",i,e),d=t.getObj("events",i,e);return s.href=i,o&&(s.class=o),a&&(s.target=a),l&&(s.rel=l),c&&t7(s,c),{tagName:r,attributes:s,content:n,eventListeners:d}}};function Kge(t,e){class i extends WPt{constructor(n,s){super(n,s),this.t=t}}for(const r in e)i.prototype[r]=e[r];return i.t=t,i}const qPt=Kge("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),YPt=Kge("text"),vhr=Kge("nl"),Q6=Kge("url",{isLink:!0,toHref(t){return t===void 0&&(t=Oee.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Tee&&t[1].t===VF}}),xg=t=>new Eb(t);function _hr(t){let{groups:e}=t;const i=e.domain.concat([Dge,Lge,GF,kge,Nge,$ge,Bge,Gge,ZE,Mge,Vge,Uge,jge,zge,OO,qge,Pee,Wge]),r=[Fge,s7,J6,n7,Z6,VF,ENe,JE,INe,Iee,r7,Eee,Aee,Hge,ANe,PNe],n=[Dge,Fge,Lge,kge,Nge,$ge,J6,Bge,Gge,ZE,Mge,r7,Vge,Uge,jge,zge,Hge,OO,qge,Pee,Wge],s=xg(),o=xn(s,Pee);To(o,n,o),To(o,e.domain,o);const a=xg(),l=xg(),c=xg();To(s,e.domain,a),To(s,e.scheme,l),To(s,e.slashscheme,c),To(a,n,o),To(a,e.domain,a);const d=xn(a,GF);xn(o,GF,d),xn(l,GF,d),xn(c,GF,d);const p=xn(o,JE);To(p,n,o),To(p,e.domain,o);const y=xg();To(d,e.domain,y),To(y,e.domain,y);const v=xn(y,JE);To(v,e.domain,y);const S=xg(qPt);To(v,e.tld,S),To(v,e.utld,S),xn(d,Tee,S);const I=xn(y,ZE);To(I,e.domain,y),To(S,e.domain,y),xn(S,JE,v),xn(S,ZE,I);const O=xn(S,VF);To(O,e.numeric,qPt);const L=xn(a,ZE),N=xn(a,JE);To(L,e.domain,a),To(N,n,o),To(N,e.domain,a);const G=xg(Q6);To(N,e.tld,G),To(N,e.utld,G),To(G,e.domain,a),To(G,n,o),xn(G,JE,N),xn(G,ZE,L),xn(G,GF,d);const V=xn(G,VF),Y=xg(Q6);To(V,e.numeric,Y);const X=xg(Q6),te=xg();To(X,i,X),To(X,r,te),To(te,i,X),To(te,r,te),xn(G,OO,X),xn(Y,OO,X);const re=xn(l,VF),fe=xn(c,VF),ge=xn(fe,OO);xn(ge,OO,re),To(l,e.domain,a),xn(l,JE,N),xn(l,ZE,L),To(c,e.domain,a),xn(c,JE,N),xn(c,ZE,L),To(re,e.domain,X),xn(re,OO,X);const _e=xn(X,r7),Ie=xn(X,Eee),ke=xn(X,Iee),Ne=xn(X,Aee);xn(te,r7,_e),xn(te,Eee,Ie),xn(te,Iee,ke),xn(te,Aee,Ne),xn(_e,J6,X),xn(Ie,n7,X),xn(ke,s7,X),xn(Ne,Z6,X),xn(_e,J6,X);const J=xg(Q6),he=xg(Q6),xe=xg(Q6),Pe=xg(Q6);To(_e,i,J),To(Ie,i,he),To(ke,i,xe),To(Ne,i,Pe);const Oe=xg(),Ae=xg(),ze=xg(),Ge=xg();return To(_e,r),To(Ie,r),To(ke,r),To(Ne,r),To(J,i,J),To(he,i,he),To(xe,i,xe),To(Pe,i,Pe),To(J,r,J),To(he,r,he),To(xe,r,xe),To(Pe,r,Pe),To(Oe,i,Oe),To(Ae,i,he),To(ze,i,xe),To(Ge,i,Pe),To(Oe,r,Oe),To(Ae,r,Ae),To(ze,r,ze),To(Ge,r,Ge),xn(he,n7,X),xn(xe,s7,X),xn(Pe,Z6,X),xn(J,J6,X),xn(Ae,n7,X),xn(ze,s7,X),xn(Ge,Z6,X),xn(Oe,Z6,X),xn(s,Tee,G),xn(s,TNe,vhr),{start:s,tokens:VPt}}function bhr(t,e,i){let r=i.length,n=0,s=[],o=[];for(;n=0&&y++,n++,d++;if(y<0)n-=d,n0&&(s.push(FNe(YPt,e,o)),o=[]),n-=y,d-=y;const v=p.t,S=i.slice(n-d,n);s.push(FNe(v,e,S))}}return o.length>0&&s.push(FNe(YPt,e,o)),s}function FNe(t,e,i){const r=i[0].s,n=i[i.length-1].e,s=e.slice(r,n);return new t(s,i)}const Pv={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function whr(){Pv.scanner=mhr(Pv.customSchemes);for(let t=0;t",lt:"<",nbsp:" ",quot:'"'},Chr=/^#[xX]([A-Fa-f0-9]+)$/,Thr=/^#([0-9]+)$/,Ehr=/^([A-Za-z0-9]+)$/,Ihr=function(){function t(e){this.named=e}return t.prototype.parse=function(e){if(e){var i=e.match(Chr);if(i)return String.fromCharCode(parseInt(i[1],16));if(i=e.match(Thr),i)return String.fromCharCode(parseInt(i[1],10));if(i=e.match(Ehr),i)return this.named[i[1]]||"&"+i[1]+";"}},t}(),Ahr=/[\t\n\f ]/,Phr=/[A-Za-z]/,Ohr=/\r\n?/g;function A0(t){return Ahr.test(t)}function XPt(t){return Phr.test(t)}function Rhr(t){return t.replace(Ohr,` -`)}var Mhr=function(){function t(e,i,r){r===void 0&&(r="precompile"),this.delegate=e,this.entityParser=i,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===":"||XPt(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();A0(n)&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var n=this.consume();A0(n)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(n.toLowerCase()))},doctypeName:function(){var n=this.consume();A0(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(!A0(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();A0(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();A0(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();A0(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();A0(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();A0(n)?this.transitionTo("beforeAttributeName"):n==="/"?this.transitionTo("selfClosingStartTag"):n===">"?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(n)},endTagName:function(){var n=this.consume();A0(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(A0(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();A0(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(A0(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();A0(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();A0(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();A0(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===":"||XPt(n))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(n))}},this.reset()}return t.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},t.prototype.transitionTo=function(e){this.state=e},t.prototype.tokenize=function(e){this.reset(),this.tokenizePart(e),this.tokenizeEOF()},t.prototype.tokenizePart=function(e){for(this.input+=Rhr(e);this.index"||e==="style"&&this.input.substring(this.index,this.index+8)!==""||e==="script"&&this.input.substring(this.index,this.index+9)!=="<\/script>"},t}(),Dhr=function(){function t(e,i){i===void 0&&(i={}),this.options=i,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new Mhr(this,e,i.mode),this._currentAttribute=void 0}return t.prototype.tokenize=function(e){return this.tokens=[],this.tokenizer.tokenize(e),this.tokens},t.prototype.tokenizePart=function(e){return this.tokens=[],this.tokenizer.tokenizePart(e),this.tokens},t.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},t.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},t.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 i=0;i=0))continue;let d=r.length;$hr(l,i,++o,r),o+=r.length-d-1}else if(a.type!==LNe)r.push(a);else{const l=Nhr(a.chars,s);r.push.apply(r,l)}}for(let o=0;o0&&(l+=" "+Vhr(a.attributes).join(" ")),a.selfClosing&&(l+=" /"),l+=">",n.push(l);break}case JPt:n.push(``);break;case LNe:n.push(kNe(a.chars));break;case Lhr:n.push(``);break;case khr:{let l=`",n.push(l);break}}}return n.join("")}function Nhr(t,e){const i=xhr(t),r=[];for(let n=0;n0;){let s=e[i];s.type===Jge&&s.tagName.toUpperCase()===t?n++:s.type===JPt&&s.tagName.toUpperCase()===t&&n--,r.push(s),i++}return r}function Bhr(t){let{tagName:e,attributes:i,content:r}=t;return`<${e} ${Ghr(i)}>${kNe(r)}`}function kNe(t){return t.replace(/&/g,"&").replace(//g,">")}function QPt(t){return t.replace(/"/g,""")}function Ghr(t){const e=[];for(const i in t){const r=t[i]+"";e.push(`${i}="${QPt(r)}"`)}return e.join(" ")}function Vhr(t){const e=[];for(let i=0;i{const s={};Object.assign(s,e.identifyData.data),s.Symbol!==void 0&&delete s.Symbol;let o={};return e.fields.forEach(a=>{o[a.name]=a.alias||a.name}),Object.keys(s).map(a=>{s[a]={value:typeof s[a]=="number"?i?.$i18n.n(s[a],"number"):s[a],alias:o[a]||a}}),s},n=s=>{if(!s)return s;if(s.trim().match(/\.(jpeg|jpg|gif|png)$/)||s.trim().match(/^\s*data:([a-z]+\/[a-z]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i))return``;const o="underline text-blue-600 break-all",a=document.createElement("div");return a.innerHTML=s.trim(),a.firstElementChild?.tagName=="A"?(a.firstElementChild.className=o,a.innerHTML):ZPt(s,{className:o,target:"_blank",validate:{url:c=>/^https?:\/\//.test(c)}})};return(s,o)=>(Kt(),ci("div",null,[(Kt(!0),ci(eo,null,ou(r(),(a,l,c)=>(Kt(),ci("div",{class:"p-5 pl-3 flex justify-end flex-wrap even:bg-gray-300",key:c},[Mt("span",Uhr,gr(a.alias),1),jhr,Mt("span",{class:"inline",innerHTML:n(a.value)},null,8,zhr)]))),128))]))}}),Whr=["innerHTML"],qhr={key:1},Yhr=Zr({__name:"html-default",props:{identifyData:{type:Object,required:!0}},setup(t){const{t:e}=qn();return(i,r)=>t.identifyData?(Kt(),ci("div",{key:0,class:"whitespace-pre-wrap break-words h-full overflow-auto",innerHTML:t.identifyData.data},null,8,Whr)):(Kt(),ci("div",qhr,gr(Qt(e)("details.layers.results.empty")),1))}}),Xhr={key:0},Khr={key:0,class:"p-8 font-bold break-words mb-8 bg-gray-100"},Jhr={key:1,class:"p-8 mb-8 bg-gray-100 flex justify-between"},Zhr={key:2,class:"flex flex-col justify-between p-8 mb-8 bg-gray-100"},Qhr={class:"flex justify-between"},edr=["aria-label"],tdr={class:"flex bg-gray-200 py-8 items-center"},idr=["content","aria-label","disabled"],rdr=[Mt("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[Mt("g",null,[Mt("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)],ndr={class:"px-8"},sdr=["content","aria-label","disabled"],odr=[Mt("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[Mt("g",null,[Mt("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)],adr={key:3},ldr={key:0},udr={key:0,class:"flex py-8"},cdr=["innerHTML"],hdr={key:1,class:"m-auto"},ddr=[Mt("div",{class:"animate-spin spinner h-20 w-20"},null,-1)],pdr={class:"flex-grow my-auto text-lg px-8"},fdr=["content","aria-label"],mdr=[Mt("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20",viewBox:"0 0 24 24",width:"20"},[Mt("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"}),Mt("path",{d:"M0 0h24v24H0V0z",fill:"none"}),Mt("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})],-1)],gdr={key:1,class:"flex justify-center py-10 items-center"},ydr=Mt("span",{class:"animate-spin spinner h-20 w-20 px-5 mr-8"},null,-1),vdr={key:4,class:"p-5"},_dr={key:1,class:"flex justify-center py-10 items-center"},bdr=Mt("span",{class:"animate-spin spinner h-20 w-20 px-5 mr-8"},null,-1),wdr={key:2},xdr=Zr({__name:"item-screen",props:{panel:{type:Object,required:!0},result:{type:Object,required:!0},itemIndex:{type:Number,default:0}},setup(t){const e=t,{t:i}=qn(),r=Qs("iApi"),n=rN(),s=Vr(()=>n.defaultTemplates),o=Vr(()=>n.properties),a=Vr(()=>n.activeGreedy),l=Vr(()=>n.slowLoadingFlag),c=Vr(()=>e.result.items[O.value]),d=Vr(()=>{const J=r.geo.layer.getLayer(e.result.uid)?.nameField;return J&&c.value.loaded?c.value.data[J]:r.$i18n.t("details.items.title")}),p=Vr(()=>{const Ne=r.geo.layer.getLayer(e.result.uid);return Ne&&o.value[Ne.id]&&o.value[Ne.id].name?o.value[Ne.id].name:Ne?.name??""});Vr(()=>r.geo.layer.getLayer(e.result.uid)?.layerType||"");const y=Vr(()=>r.geo.layer.getLayer(e.result.uid)?.supportsFeatures??!1),v=Vr(()=>y.value?r.geo.layer.getLayer(e.result.uid)?.fields||[]:[]),S=Vr(()=>{const Ne=r.geo.layer.getLayer(e.result.uid);return Ne&&o.value[Ne.id]&&o.value[Ne.id].template?o.value[Ne.id].template:s.value&&s.value[c.value.format]?s.value[c.value.format]:y.value?Hhr:Yhr});Pi(XI.UNKNOWN);const I=Pi(""),O=Pi(0),L=Pi(!1),N=Pi([]),G=Pi(r.fixture.get("details")),V=Pi(!0),Y=()=>{G.value.removeDetailsHilight(),n.hilightToggle=!0},X=()=>{G.value.removeDetailsHilight()},te=()=>{O.value=e.itemIndex??0,L.value=!0,V.value=n.hilightToggle??V.value,re()},re=()=>{if(c.value.loaded)r.geo.layer.getLayer(e.result.uid)||(L.value=!1),_e(),r.updateAlert(`${r.$i18n.t("details.item.alert.show.item",{itemName:d.value})} ${e.result.items.length>1?r.$i18n.t("details.item.count",[O.value+1,e.result.items.length]):""}`),V.value&&G.value.hilightDetailsItems(e.result.items[O.value],e.result.uid);else{const Ne=O.value;c.value.loading.then(()=>{Ne===O.value&&re()})}},fe=()=>{e.panel.show({screen:"results-screen",props:{result:e.result,previousItemIndex:O.value}})},ge=Ne=>{O.value+=Ne,re()},_e=()=>{if(I.value="",!(c.value&&c.value.loaded))return;const Ne=r.geo.layer.getLayer(e.result.uid);if(Ne===void 0){console.warn(`could not find layer for uid ${e.result.uid} during icon lookup`);return}if(Ne.supportsFeatures){const J=Ne.oidField;let he=O.value;Ne.getIcon(c.value.data[J]).then(xe=>{O.value===he&&(I.value=xe)})}},Ie=()=>{const Ne=r.geo.layer.getLayer(e.result.uid);if(Ne===void 0){console.warn(`Could not find layer for uid ${e.result.uid} during zoom geometry lookup`);return}if(!c.value.loaded){console.warn("Details zoomToFeature call on item that is still loading. Should be impossible, alert the devs.");return}const J=c.value.data[Ne.oidField],he={getGeom:!0};Ne.getGraphic(J,he).then(xe=>{xe.geometry.invalid()?console.error(`Could not find graphic for objectid ${J}`):r.geo.map.zoomMapTo(xe.geometry)}),r.updateAlert(r.$i18n.t("details.item.alert.zoom"))},ke=Ne=>{V.value=Ne,G.value.onHilightToggle(Ne,e.result.items[O.value],e.result.uid)};return al(()=>{te(),N.value.push(r.event.on(an.LAYER_REMOVE,Ne=>{e.result.uid===Ne.uid&&e.panel.close()})),N.value.push(r.event.on(an.PANEL_CLOSED,Ne=>{Ne.id=="details-items"&&Y()})),N.value.push(r.event.on(an.PANEL_MINIMIZED,Ne=>{Ne.id=="details-items"&&X()})),N.value.push(r.event.on(an.MAP_BASEMAPCHANGE,()=>{V.value&&G.value.reloadDetailsHilight(e.result.items[O.value],e.result.uid)}))}),su(()=>{N.value.forEach(Ne=>r.event.off(Ne))}),sce(()=>{te()}),(Ne,J)=>{const he=Io("panel-screen"),xe=Qn("tippy");return Kt(),Pn(he,{panel:t.panel},{header:yn(()=>[Fs(gr(Qt(i)("details.items.title")),1)]),content:yn(()=>[t.result.loaded&&Qt(a)===0?(Kt(),ci("div",Xhr,[L.value?(Kt(),ci("div",Khr,gr(Qt(p)),1)):hn("",!0),G.value.hasHilighter()?(Kt(),ci("div",Jhr,[Mt("div",null,gr(Qt(i)("details.togglehilight.title")),1),Rn(yNe,{config:{value:V.value,disabled:!1},onToggled:ke},null,8,["config"])])):hn("",!0),L.value&&t.result.items.length>1?(Kt(),ci("div",Zhr,[Mt("div",Qhr,[Mt("button",{type:"button",class:"px-8 font-bold hover:bg-gray-200 focus:bg-gray-200","aria-label":Qt(i)("details.item.see.list"),onClick:fe},gr(Qt(i)("details.item.see.list")),9,edr),Mt("div",tdr,[Br((Kt(),ci("button",{type:"button",content:Qt(i)("details.item.previous.item"),onClick:J[0]||(J[0]=Pe=>ge(-1)),class:"mx-2 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":Qt(i)("details.item.previous.item"),disabled:O.value===0},rdr,8,idr)),[[xe,{placement:"top"}]]),Mt("span",ndr,gr(Qt(i)("details.item.count",[O.value+1,t.result.items.length])),1),Br((Kt(),ci("button",{type:"button",content:Qt(i)("details.item.next.item"),onClick:J[1]||(J[1]=Pe=>ge(1)),class:"mx-2 rotate-180 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":Qt(i)("details.item.next.item"),disabled:O.value===t.result.items.length-1},odr,8,sdr)),[[xe,{placement:"top"}]])])])])):hn("",!0),L.value?(Kt(),ci("div",adr,[Qt(c).loaded?(Kt(),ci("div",ldr,[Qt(y)?(Kt(),ci("div",udr,[I.value?(Kt(),ci("span",{key:0,class:"flex-none m-auto symbologyIcon",innerHTML:I.value},null,8,cdr)):(Kt(),ci("div",hdr,ddr)),Mt("span",pdr,gr(Qt(d)),1),Br((Kt(),ci("button",{type:"button",content:Qt(i)("details.item.zoom"),"aria-label":Qt(i)("details.item.zoom"),onClick:J[2]||(J[2]=Pe=>Ie()),class:"text-gray-600 m-8"},mdr,8,fdr)),[[xe,{placement:"bottom"}]])])):hn("",!0),(Kt(),Pn(TP(Qt(S)),{identifyData:Qt(c),fields:Qt(v)},null,8,["identifyData","fields"]))])):(Kt(),ci("div",gdr,[ydr,Fs(" "+gr(Qt(i)("details.item.loading")),1)]))])):(Kt(),ci("div",vdr,gr(Qt(i)("details.item.no.data")),1))])):Qt(l)?(Kt(),ci("div",_dr,[bdr,Fs(" "+gr(Qt(i)("details.item.loading")),1)])):(Kt(),ci("div",wdr))]),_:1},8,["panel"])}}}),W4r="",Sdr={en:{"details.layers.title":"Identified Layers","details.layers.found":"Found {numResults} results in {numLayers} layers","details.layers.loading":"The layer is loading...","details.layers.results.empty":"No results found for the selected layer.","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.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.togglehilight.title":"Toggle Highlight"},fr:{"details.layers.title":"Couches désignées","details.layers.found":"{numResults} résultats trouvés dans {numLayers} couches","details.layers.loading":"La couche est en cours de chargement...","details.layers.results.empty":"Aucun résultat trouvé pour la couche sélectionnée.","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.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":"[fr] 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.togglehilight.title":"Basculer vers l'élément principal"}};class Cdr extends Tcr{async added(){this.$iApi.panel.register({"details-layers":{screens:{"layers-screen":Ho(Lcr)},style:{width:"350px"},button:{tooltip:"details.layers.title",icon:''},alertName:"details.layers.title"},"details-items":{screens:{"results-screen":Ho(ohr),"item-screen":Ho(xdr)},style:{width:"350px"},button:{tooltip:"details.items.title",icon:''},alertName:"details.items.title"}},{i18n:{messages:Sdr}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,i=>this._parseConfig(i));this.removed=()=>{if(e(),this.$iApi.panel.remove("details-items"),this.$iApi.panel.remove("details-layers"),this.$iApi.fixture.get("appbar")){const r=hg(this.$vApp.$pinia);r.removeButton("details-items"),r.removeButton("details-layers")}rN(this.$vApp.$pinia).$reset()}}}const Tdr=Object.freeze(Object.defineProperty({__proto__:null,default:Cdr},Symbol.toStringTag,{value:"Module"}));var Od={};const NNe=cue(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));(function(t){/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */var e=e||{version:"5.3.0"};if(t.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 i=NNe,r=new i.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=NNe.implForWrapper,e.nodeCanvas=NNe.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(v,S){if(this.__eventListeners[v]){var I=this.__eventListeners[v];S?I[I.indexOf(S)]=!1:e.util.array.fill(I,!1)}}function l(v,S){if(this.__eventListeners||(this.__eventListeners={}),arguments.length===1)for(var I in v)this.on(I,v[I]);else this.__eventListeners[v]||(this.__eventListeners[v]=[]),this.__eventListeners[v].push(S);return this}function c(v,S){var I=function(){S.apply(this,arguments),this.off(v,I)}.bind(this);this.on(v,I)}function d(v,S){if(arguments.length===1)for(var I in v)c.call(this,I,v[I]);else c.call(this,v,S);return this}function p(v,S){if(!this.__eventListeners)return this;if(arguments.length===0)for(v in this.__eventListeners)a.call(this,v);else if(arguments.length===1&&typeof arguments[0]=="object")for(var I in v)a.call(this,I,v[I]);else a.call(this,v,S);return this}function y(v,S){if(!this.__eventListeners)return this;var I=this.__eventListeners[v];if(!I)return this;for(var O=0,L=I.length;O"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(c){return typeof c.contains=="function"&&c.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,c){a&&a.source&&!(a instanceof e.Pattern)?this.set(l,new e.Pattern(a,c)):c&&c()},_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,c=Math.atan2,d=Math.pow,p=Math.PI/180,y=Math.PI/2;e.util={cos:function(v){if(v===0)return 1;v<0&&(v=-v);var S=v/y;switch(S){case 1:case 3:return 0;case 2:return-1}return Math.cos(v)},sin:function(v){if(v===0)return 0;var S=v/y,I=1;switch(v<0&&(I=-1),S){case 1:return I;case 2:return 0;case 3:return-I}return Math.sin(v)},removeFromArray:function(v,S){var I=v.indexOf(S);return I!==-1&&v.splice(I,1),v},getRandomInt:function(v,S){return Math.floor(Math.random()*(S-v+1))+v},degreesToRadians:function(v){return v*p},radiansToDegrees:function(v){return v/p},rotatePoint:function(v,S,I){var O=new e.Point(v.x-S.x,v.y-S.y),L=e.util.rotateVector(O,I);return new e.Point(L.x,L.y).addEquals(S)},rotateVector:function(v,S){var I=e.util.sin(S),O=e.util.cos(S),L=v.x*O-v.y*I,N=v.x*I+v.y*O;return{x:L,y:N}},createVector:function(v,S){return new e.Point(S.x-v.x,S.y-v.y)},calcAngleBetweenVectors:function(v,S){return Math.acos((v.x*S.x+v.y*S.y)/(Math.hypot(v.x,v.y)*Math.hypot(S.x,S.y)))},getHatVector:function(v){return new e.Point(v.x,v.y).multiply(1/Math.hypot(v.x,v.y))},getBisector:function(v,S,I){var O=e.util.createVector(v,S),L=e.util.createVector(v,I),N=e.util.calcAngleBetweenVectors(O,L),G=e.util.calcAngleBetweenVectors(e.util.rotateVector(O,N),L),V=N*(G===0?1:-1)/2;return{vector:e.util.getHatVector(e.util.rotateVector(O,V)),angle:N}},projectStrokeOnPoints:function(v,S,I){var O=[],L=S.strokeWidth/2,N=S.strokeUniform?new e.Point(1/S.scaleX,1/S.scaleY):new e.Point(1,1),G=function(V){var Y=L/Math.hypot(V.x,V.y);return new e.Point(V.x*Y*N.x,V.y*Y*N.y)};return v.length<=1||v.forEach(function(V,Y){var X=new e.Point(V.x,V.y),te,re;Y===0?(re=v[Y+1],te=I?G(e.util.createVector(re,X)).addEquals(X):v[v.length-1]):Y===v.length-1?(te=v[Y-1],re=I?G(e.util.createVector(te,X)).addEquals(X):v[0]):(te=v[Y-1],re=v[Y+1]);var fe=e.util.getBisector(X,te,re),ge=fe.vector,_e=fe.angle,Ie,ke;if(S.strokeLineJoin==="miter"&&(Ie=-L/Math.sin(_e/2),ke=new e.Point(ge.x*Ie*N.x,ge.y*Ie*N.y),Math.hypot(ke.x,ke.y)/L<=S.strokeMiterLimit)){O.push(X.add(ke)),O.push(X.subtract(ke));return}Ie=-L*Math.SQRT2,ke=new e.Point(ge.x*Ie*N.x,ge.y*Ie*N.y),O.push(X.add(ke)),O.push(X.subtract(ke))}),O},transformPoint:function(v,S,I){return I?new e.Point(S[0]*v.x+S[2]*v.y,S[1]*v.x+S[3]*v.y):new e.Point(S[0]*v.x+S[2]*v.y+S[4],S[1]*v.x+S[3]*v.y+S[5])},makeBoundingBoxFromPoints:function(v,S){if(S)for(var I=0;I"u"?1:v.scaleX,I=typeof v.scaleY>"u"?1:v.scaleY,O=[v.flipX?-S:S,0,0,v.flipY?-I:I,0,0],L=e.util.multiplyTransformMatrices,N=e.util.degreesToRadians;return v.skewX&&(O=L(O,[1,0,Math.tan(N(v.skewX)),1],!0)),v.skewY&&(O=L(O,[1,Math.tan(N(v.skewY)),0,1],!0)),O},composeMatrix:function(v){var S=[1,0,0,1,v.translateX||0,v.translateY||0],I=e.util.multiplyTransformMatrices;return v.angle&&(S=I(S,e.util.calcRotateMatrix(v))),(v.scaleX!==1||v.scaleY!==1||v.skewX||v.skewY||v.flipX||v.flipY)&&(S=I(S,e.util.calcDimensionsMatrix(v))),S},resetObjectTransform:function(v){v.scaleX=1,v.scaleY=1,v.skewX=0,v.skewY=0,v.flipX=!1,v.flipY=!1,v.rotate(0)},saveObjectTransform:function(v){return{scaleX:v.scaleX,scaleY:v.scaleY,skewX:v.skewX,skewY:v.skewY,angle:v.angle,left:v.left,flipX:v.flipX,flipY:v.flipY,top:v.top}},isTransparent:function(v,S,I,O){O>0&&(S>O?S-=O:S=0,I>O?I-=O:I=0);var L=!0,N,G,V=v.getImageData(S,I,O*2||1,O*2||1),Y=V.data.length;for(N=3;N0){var te=e.util.hasStyleChanged(N,X,!0);te?G.push({start:L,end:L+1,style:X}):G[G.length-1].end++}N=X||{}}}return G},stylesFromArray:function(v,S){if(!Array.isArray(v))return v;for(var I=S.split(` -`),O=-1,L=0,N={},G=0;G0?Ve-=2*ft:et===1&&Ve<0&&(Ve+=2*ft);for(var At=Math.ceil(Math.abs(Ve/ft*2)),ii=[],gt=Ve/At,Ue=8/3*Math.sin(gt/4)*Math.sin(gt/4)/Math.sin(gt/2),ni=yt+gt,A=0;A=Je?et-Je:2*Math.PI-(Je-et)}function v(Oe,Ae,ze,Ge,Je,et,tt,ft){var Pt;if(e.cachesBoundsOfCurve&&(Pt=a.call(arguments),e.boundsOfCurveCache[Pt]))return e.boundsOfCurveCache[Pt];var $t=Math.sqrt,St=Math.min,Tt=Math.max,Lt=Math.abs,at=[],Ee=[[],[]],Be,mt,kt,ct,le,it,pt,Le;mt=6*Oe-12*ze+6*Je,Be=-3*Oe+9*ze-9*Je+3*tt,kt=3*ze-3*Oe;for(var ce=0;ce<2;++ce){if(ce>0&&(mt=6*Ae-12*Ge+6*et,Be=-3*Ae+9*Ge-9*et+3*ft,kt=3*Ge-3*Ae),Lt(Be)<1e-12){if(Lt(mt)<1e-12)continue;ct=-kt/mt,01e-4;)tt=Je(ze),St=ze,ft=O(et.x,et.y,tt.x,tt.y),ft+Ge>Ae?(ze-=Pt,Pt/=2):(et=tt,ze+=Pt,Ge+=ft);return tt.angle=$t(St),tt}function Ne(Oe){for(var Ae=0,ze=Oe.length,Ge,Je=0,et=0,tt=0,ft=0,Pt=[],$t,St,Tt,Lt=0;Lt0&&Gept)for(var ce=1,Ce=Be.length;ce2;for(Ae=Ae||0,$t&&(ft=Oe[2].xOe[Ge-2].x?1:Je.x===Oe[Ge-2].x?0:-1,Pt=Je.y>Oe[Ge-2].y?1:Je.y===Oe[Ge-2].y?0:-1),ze.push(["L",Je.x+ft*Ae,Je.y+Pt*Ae]),ze}function Pe(Oe,Ae,ze){return ze&&(Ae=e.util.multiplyTransformMatrices(Ae,[1,0,0,1,-ze.x,-ze.y])),Oe.map(function(Ge){for(var Je=Ge.slice(0),et={},tt=1;tt=O})}function d(v,S){return y(v,S,function(I,O){return I/g,">")}function d(y){var v=0,S,I=[];for(v=0,S;v57343)return y.charAt(v);if(55296<=S&&S<=56319){if(y.length<=v+1)throw"High surrogate without following low surrogate";var I=y.charCodeAt(v+1);if(56320>I||I>57343)throw"High surrogate without following low surrogate";return y.charAt(v)+y.charAt(v+1)}if(v===0)throw"Low surrogate without preceding high surrogate";var O=y.charCodeAt(v-1);if(55296>O||O>56319)throw"Low surrogate without preceding high surrogate";return!1}e.util.string={camelize:a,capitalize:l,escapeXml:c,graphemeSplit:d}}(),function(){var a=Array.prototype.slice,l=function(){},c=function(){for(var S in{toString:1})if(S==="toString")return!1;return!0}(),d=function(S,I,O){for(var L in I)L in S.prototype&&typeof S.prototype[L]=="function"&&(I[L]+"").indexOf("callSuper")>-1?S.prototype[L]=function(N){return function(){var G=this.constructor.superclass;this.constructor.superclass=O;var V=I[N].apply(this,arguments);if(this.constructor.superclass=G,N!=="initialize")return V}}(L):S.prototype[L]=I[L],c&&(I.toString!==Object.prototype.toString&&(S.prototype.toString=I.toString),I.valueOf!==Object.prototype.valueOf&&(S.prototype.valueOf=I.valueOf))};function p(){}function y(S){for(var I=null,O=this;O.constructor.superclass;){var L=O.constructor.superclass.prototype[S];if(O[S]!==L){I=L;break}O=O.constructor.superclass.prototype}return I?arguments.length>1?I.apply(this,a.call(arguments,1)):I.call(this):console.log("tried to callSuper "+S+", method not found in prototype chain",this)}function v(){var S=null,I=a.call(arguments,0);typeof I[0]=="function"&&(S=I.shift());function O(){this.initialize.apply(this,arguments)}O.superclass=S,O.subclasses=[],S&&(p.prototype=S.prototype,O.prototype=new p,S.subclasses.push(O));for(var L=0,N=I.length;L-1||d.pointerType==="touch"}}(),function(){function a(v,S){var I=v.style;if(!I)return v;if(typeof S=="string")return v.style.cssText+=";"+S,S.indexOf("opacity")>-1?y(v,S.match(/opacity:\s*(\d?\.?\d*)/)[1]):v;for(var O in S)if(O==="opacity")y(v,S[O]);else{var L=O==="float"||O==="cssFloat"?typeof I.styleFloat>"u"?"cssFloat":"styleFloat":O;I.setProperty(L,S[O])}return v}var l=e.document.createElement("div"),c=typeof l.style.opacity=="string",d=typeof l.style.filter=="string",p=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,y=function(v){return v};c?y=function(v,S){return v.style.opacity=S,v}:d&&(y=function(v,S){var I=v.style;return v.currentStyle&&!v.currentStyle.hasLayout&&(I.zoom=1),p.test(I.filter)?(S=S>=.9999?"":"alpha(opacity="+S*100+")",I.filter=I.filter.replace(p,S)):I.filter+=" alpha(opacity="+S*100+")",v}),e.util.setStyle=a}(),function(){var a=Array.prototype.slice;function l(V){return typeof V=="string"?e.document.getElementById(V):V}var c,d=function(V){return a.call(V,0)};try{c=d(e.document.childNodes)instanceof Array}catch{}c||(d=function(V){for(var Y=new Array(V.length),X=V.length;X--;)Y[X]=V[X];return Y});function p(V,Y){var X=e.document.createElement(V);for(var te in Y)te==="class"?X.className=Y[te]:te==="for"?X.htmlFor=Y[te]:X.setAttribute(te,Y[te]);return X}function y(V,Y){V&&(" "+V.className+" ").indexOf(" "+Y+" ")===-1&&(V.className+=(V.className?" ":"")+Y)}function v(V,Y,X){return typeof Y=="string"&&(Y=p(Y,X)),V.parentNode&&V.parentNode.replaceChild(Y,V),Y.appendChild(V),Y}function S(V){for(var Y=0,X=0,te=e.document.documentElement,re=e.document.body||{scrollLeft:0,scrollTop:0};V&&(V.parentNode||V.host)&&(V=V.parentNode||V.host,V===e.document?(Y=re.scrollLeft||te.scrollLeft||0,X=re.scrollTop||te.scrollTop||0):(Y+=V.scrollLeft||0,X+=V.scrollTop||0),!(V.nodeType===1&&V.style.position==="fixed")););return{left:Y,top:X}}function I(V){var Y,X=V&&V.ownerDocument,te={left:0,top:0},re={left:0,top:0},fe,ge={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!X)return re;for(var _e in ge)re[ge[_e]]+=parseInt(O(V,_e),10)||0;return Y=X.documentElement,typeof V.getBoundingClientRect<"u"&&(te=V.getBoundingClientRect()),fe=S(V),{left:te.left+fe.left-(Y.clientLeft||0)+re.left,top:te.top+fe.top-(Y.clientTop||0)+re.top}}var O;e.document.defaultView&&e.document.defaultView.getComputedStyle?O=function(V,Y){var X=e.document.defaultView.getComputedStyle(V,null);return X?X[Y]:void 0}:O=function(V,Y){var X=V.style[Y];return!X&&V.currentStyle&&(X=V.currentStyle[Y]),X},function(){var V=e.document.documentElement.style,Y="userSelect"in V?"userSelect":"MozUserSelect"in V?"MozUserSelect":"WebkitUserSelect"in V?"WebkitUserSelect":"KhtmlUserSelect"in V?"KhtmlUserSelect":"";function X(re){return typeof re.onselectstart<"u"&&(re.onselectstart=e.util.falseFunction),Y?re.style[Y]="none":typeof re.unselectable=="string"&&(re.unselectable="on"),re}function te(re){return typeof re.onselectstart<"u"&&(re.onselectstart=null),Y?re.style[Y]="":typeof re.unselectable=="string"&&(re.unselectable=""),re}e.util.makeElementUnselectable=X,e.util.makeElementSelectable=te}();function L(V){var Y=e.jsdomImplForWrapper(V);return Y._canvas||Y._image}function N(V){if(e.isLikelyNode){var Y=e.jsdomImplForWrapper(V);Y&&(Y._image=null,Y._canvas=null,Y._currentSrc=null,Y._attributes=null,Y._classList=null)}}function G(V,Y){V.imageSmoothingEnabled=V.imageSmoothingEnabled||V.webkitImageSmoothingEnabled||V.mozImageSmoothingEnabled||V.msImageSmoothingEnabled||V.oImageSmoothingEnabled,V.imageSmoothingEnabled=Y}e.util.setImageSmoothing=G,e.util.getById=l,e.util.toArray=d,e.util.addClass=y,e.util.makeElement=p,e.util.wrapElement=v,e.util.getScrollLeftTop=S,e.util.getElementOffset=I,e.util.getNodeCanvas=L,e.util.cleanUpJsdomNode=N}(),function(){function a(d,p){return d+(/\?/.test(d)?"&":"?")+p}function l(){}function c(d,p){p||(p={});var y=p.method?p.method.toUpperCase():"GET",v=p.onComplete||function(){},S=new e.window.XMLHttpRequest,I=p.body||p.parameters;return S.onreadystatechange=function(){S.readyState===4&&(v(S),S.onreadystatechange=l)},y==="GET"&&(I=null,typeof p.parameters=="string"&&(d=a(d,p.parameters))),S.open(y,d,!0),(y==="POST"||y==="PUT")&&S.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),S.send(I),S}e.util.request=c}(),e.log=console.log,e.warn=console.warn,function(){var a=e.util.object.extend,l=e.util.object.clone,c=[];e.util.object.extend(c,{cancelAll:function(){var L=this.splice(0);return L.forEach(function(N){N.cancel()}),L},cancelByCanvas:function(L){if(!L)return[];var N=this.filter(function(G){return typeof G.target=="object"&&G.target.canvas===L});return N.forEach(function(G){G.cancel()}),N},cancelByTarget:function(L){var N=this.findAnimationsByTarget(L);return N.forEach(function(G){G.cancel()}),N},findAnimationIndex:function(L){return this.indexOf(this.findAnimation(L))},findAnimation:function(L){return this.find(function(N){return N.cancel===L})},findAnimationsByTarget:function(L){return L?this.filter(function(N){return N.target===L}):[]}});function d(){return!1}function p(L,N,G,V){return-G*Math.cos(L/V*(Math.PI/2))+G+N}function y(L){L||(L={});var N=!1,G,V=function(){var Y=e.runningAnimations.indexOf(G);return Y>-1&&e.runningAnimations.splice(Y,1)[0]};return G=a(l(L),{cancel:function(){return N=!0,V()},currentValue:"startValue"in L?L.startValue:0,completionRate:0,durationRate:0}),e.runningAnimations.push(G),I(function(Y){var X=Y||+new Date,te=L.duration||500,re=X+te,fe,ge=L.onChange||d,_e=L.abort||d,Ie=L.onComplete||d,ke=L.easing||p,Ne="startValue"in L?L.startValue.length>0:!1,J="startValue"in L?L.startValue:0,he="endValue"in L?L.endValue:100,xe=L.byValue||(Ne?J.map(function(Pe,Oe){return he[Oe]-J[Oe]}):he-J);L.onStart&&L.onStart(),function Pe(Oe){fe=Oe||+new Date;var Ae=fe>re?te:fe-X,ze=Ae/te,Ge=Ne?J.map(function(et,tt){return ke(Ae,J[tt],xe[tt],te)}):ke(Ae,J,xe,te),Je=Math.abs(Ne?(Ge[0]-J[0])/xe[0]:(Ge-J)/xe);if(G.currentValue=Ne?Ge.slice():Ge,G.completionRate=Je,G.durationRate=ze,!N){if(_e(Ge,Je,ze)){V();return}if(fe>re){G.currentValue=Ne?he.slice():he,G.completionRate=1,G.durationRate=1,ge(Ne?he.slice():he,1,1),Ie(he,1,1),V();return}else ge(Ge,Je,ze),I(Pe)}}(X)}),G.cancel}var v=e.window.requestAnimationFrame||e.window.webkitRequestAnimationFrame||e.window.mozRequestAnimationFrame||e.window.oRequestAnimationFrame||e.window.msRequestAnimationFrame||function(L){return e.window.setTimeout(L,1e3/60)},S=e.window.cancelAnimationFrame||e.window.clearTimeout;function I(){return v.apply(e.window,arguments)}function O(){return S.apply(e.window,arguments)}e.util.animate=y,e.util.requestAnimFrame=I,e.util.cancelAnimFrame=O,e.runningAnimations=c}(),function(){function a(c,d,p){var y="rgba("+parseInt(c[0]+p*(d[0]-c[0]),10)+","+parseInt(c[1]+p*(d[1]-c[1]),10)+","+parseInt(c[2]+p*(d[2]-c[2]),10);return y+=","+(c&&d?parseFloat(c[3]+p*(d[3]-c[3])):1),y+=")",y}function l(c,d,p,y){var v=new e.Color(c).getSource(),S=new e.Color(d).getSource(),I=y.onComplete,O=y.onChange;return y=y||{},e.util.animate(e.util.object.extend(y,{duration:p||500,startValue:v,endValue:S,byValue:S,easing:function(L,N,G,V){var Y=y.colorEasing?y.colorEasing(L,V):1-Math.cos(L/V*(Math.PI/2));return a(N,G,Y)},onComplete:function(L,N,G){if(I)return I(a(S,S,0),N,G)},onChange:function(L,N,G){if(O){if(Array.isArray(L))return O(a(L,L,0),N,G);O(L,N,G)}}}))}e.util.animateColor=l}(),function(){function a(Oe,Ae,ze,Ge){return Oe-1&&Lt>-1&&Lt-1)&&(tt="stroke")}else{if(et==="href"||et==="xlink:href"||et==="font")return tt;if(et==="imageSmoothing")return tt==="optimizeQuality";St=$t?tt.map(y):y(tt,Pt)}}return!$t&&isNaN(St)?tt:St}function re(et){return new RegExp("^("+et.join("|")+")\\b","i")}function fe(et){for(var tt in G)if(!(typeof et[G[tt]]>"u"||et[tt]==="")){if(typeof et[tt]>"u"){if(!l.Object.prototype[tt])continue;et[tt]=l.Object.prototype[tt]}if(et[tt].indexOf("url(")!==0){var ft=new l.Color(et[tt]);et[tt]=ft.setAlpha(p(ft.getAlpha()*et[G[tt]],2)).toRgba()}}return et}function ge(et,tt){var ft,Pt=[],$t,St,Tt;for(St=0,Tt=tt.length;St1;)Ze.shift(),yt=l.util.multiplyTransformMatrices(yt,Ze[0]);return yt}}();function _e(et,tt){var ft,Pt;et.replace(/;\s*$/,"").split(";").forEach(function($t){var St=$t.split(":");ft=St[0].trim().toLowerCase(),Pt=St[1].trim(),tt[ft]=Pt})}function Ie(et,tt){var ft,Pt;for(var $t in et)typeof et[$t]>"u"||(ft=$t.toLowerCase(),Pt=et[$t],tt[ft]=Pt)}function ke(et,tt){var ft={};for(var Pt in l.cssRules[tt])if(Ne(et,Pt.split(" ")))for(var $t in l.cssRules[tt][Pt])ft[$t]=l.cssRules[tt][Pt][$t];return ft}function Ne(et,tt){var ft,Pt=!0;return ft=he(et,tt.pop()),ft&&tt.length&&(Pt=J(et,tt)),ft&&Pt&&tt.length===0}function J(et,tt){for(var ft,Pt=!0;et.parentNode&&et.parentNode.nodeType===1&&tt.length;)Pt&&(ft=tt.pop()),et=et.parentNode,Pt=he(et,ft);return tt.length===0}function he(et,tt){var ft=et.nodeName,Pt=et.getAttribute("class"),$t=et.getAttribute("id"),St,Tt;if(St=new RegExp("^"+ft,"i"),tt=tt.replace(St,""),$t&&tt.length&&(St=new RegExp("#"+$t+"(?![a-zA-Z\\-]+)","i"),tt=tt.replace(St,"")),Pt&&tt.length)for(Pt=Pt.split(" "),Tt=Pt.length;Tt--;)St=new RegExp("\\."+Pt[Tt]+"(?![a-zA-Z\\-]+)","i"),tt=tt.replace(St,"");return tt.length===0}function xe(et,tt){var ft;if(et.getElementById&&(ft=et.getElementById(tt)),ft)return ft;var Pt,$t,St,Tt=et.getElementsByTagName("*");for($t=0,St=Tt.length;$tPt?Pt:ft),le.meetOrSlice==="slice"&&(Pt=ft=ft>Pt?ft:Pt),Ze=ce.width-Tt*ft,yt=ce.height-Lt*ft,le.alignX==="Mid"&&(Ze/=2),le.alignY==="Mid"&&(yt/=2),le.alignX==="Min"&&(Ze=0),le.alignY==="Min"&&(yt=0)),ft===1&&Pt===1&&$t===0&&St===0&&kt===0&&ct===0)return ce;if((kt||ct)&&et.parentNode.nodeName!=="#document"&&(Ce=" translate("+y(kt)+" "+y(ct)+") "),at=Ce+" matrix("+ft+" 0 0 "+Pt+" "+($t*ft+Ze)+" "+(St*Pt+yt)+") ",et.nodeName==="svg"){for(Ee=et.ownerDocument.createElementNS(l.svgNS,"g");et.firstChild;)Ee.appendChild(et.firstChild);et.appendChild(Ee)}else Ee=et,Ee.removeAttribute("x"),Ee.removeAttribute("y"),at=Ee.getAttribute("transform")+at;return Ee.setAttribute("transform",at),ce}function ze(et,tt){for(;et&&(et=et.parentNode);)if(et.nodeName&&tt.test(et.nodeName.replace("svg:",""))&&!et.getAttribute("instantiated_by_use"))return!0;return!1}l.parseSVGDocument=function(et,tt,ft,Pt){if(et){Pe(et);var $t=l.Object.__uid++,St,Tt,Lt=Ae(et),at=l.util.toArray(et.getElementsByTagName("*"));if(Lt.crossOrigin=Pt&&Pt.crossOrigin,Lt.svgUid=$t,at.length===0&&l.isLikelyNode){at=et.selectNodes('//*[name(.)!="svg"]');var Ee=[];for(St=0,Tt=at.length;St"u"&&(ft=et.getAttribute("svgUid")),et.parentNode&&l.svgValidParentsRegEx.test(et.parentNode.nodeName)&&($t=l.parseAttributes(et.parentNode,tt,ft));var Lt=tt.reduce(function(le,it){return Pt=et.getAttribute(it),Pt&&(le[it]=Pt),le},{}),at=c(ke(et,ft),l.parseStyleAttribute(et));Lt=c(Lt,at),at[Y]&&et.setAttribute(Y,at[Y]),St=Tt=$t.fontSize||l.Text.DEFAULT_SVG_FONT_SIZE,Lt[V]&&(Lt[V]=St=y(Lt[V],Tt));var Ee,Be,mt={};for(var kt in Lt)Ee=X(kt),Be=te(Ee,Lt[kt],$t,St),mt[Ee]=Be;mt&&mt.font&&l.parseFontDeclaration(mt.font,mt);var ct=c($t,mt);return l.svgValidParentsRegEx.test(et.nodeName)?ct:fe(ct)}},parseElements:function(et,tt,ft,Pt,$t){new l.ElementsParser(et,tt,ft,Pt,$t).parse()},parseStyleAttribute:function(et){var tt={},ft=et.getAttribute("style");return ft&&(typeof ft=="string"?_e(ft,tt):Ie(ft,tt)),tt},parsePointsAttribute:function(et){if(!et)return null;et=et.replace(/,/g," ").trim(),et=et.split(/\s+/);var tt=[],ft,Pt;for(ft=0,Pt=et.length;ftd.x&&this.y>d.y},gte:function(d){return this.x>=d.x&&this.y>=d.y},lerp:function(d,p){return typeof p>"u"&&(p=.5),p=Math.max(Math.min(1,p),0),new c(this.x+(d.x-this.x)*p,this.y+(d.y-this.y)*p)},distanceFrom:function(d){var p=this.x-d.x,y=this.y-d.y;return Math.sqrt(p*p+y*y)},midPointFrom:function(d){return this.lerp(d)},min:function(d){return new c(Math.min(this.x,d.x),Math.min(this.y,d.y))},max:function(d){return new c(Math.max(this.x,d.x),Math.max(this.y,d.y))},toString:function(){return this.x+","+this.y},setXY:function(d,p){return this.x=d,this.y=p,this},setX:function(d){return this.x=d,this},setY:function(d){return this.y=d,this},setFromPoint:function(d){return this.x=d.x,this.y=d.y,this},swap:function(d){var p=this.x,y=this.y;this.x=d.x,this.y=d.y,d.x=p,d.y=y},clone:function(){return new c(this.x,this.y)}}}(t),function(a){var l=a.fabric||(a.fabric={});if(l.Intersection){l.warn("fabric.Intersection is already defined");return}function c(d){this.status=d,this.points=[]}l.Intersection=c,l.Intersection.prototype={constructor:c,appendPoint:function(d){return this.points.push(d),this},appendPoints:function(d){return this.points=this.points.concat(d),this}},l.Intersection.intersectLineLine=function(d,p,y,v){var S,I=(v.x-y.x)*(d.y-y.y)-(v.y-y.y)*(d.x-y.x),O=(p.x-d.x)*(d.y-y.y)-(p.y-d.y)*(d.x-y.x),L=(v.y-y.y)*(p.x-d.x)-(v.x-y.x)*(p.y-d.y);if(L!==0){var N=I/L,G=O/L;0<=N&&N<=1&&0<=G&&G<=1?(S=new c("Intersection"),S.appendPoint(new l.Point(d.x+N*(p.x-d.x),d.y+N*(p.y-d.y)))):S=new c}else I===0||O===0?S=new c("Coincident"):S=new c("Parallel");return S},l.Intersection.intersectLinePolygon=function(d,p,y){var v=new c,S=y.length,I,O,L,N;for(N=0;N0&&(v.status="Intersection"),v},l.Intersection.intersectPolygonPolygon=function(d,p){var y=new c,v=d.length,S;for(S=0;S0&&(y.status="Intersection"),y},l.Intersection.intersectPolygonRectangle=function(d,p,y){var v=p.min(y),S=p.max(y),I=new l.Point(S.x,v.y),O=new l.Point(v.x,S.y),L=c.intersectLinePolygon(v,I,d),N=c.intersectLinePolygon(I,S,d),G=c.intersectLinePolygon(S,O,d),V=c.intersectLinePolygon(O,v,d),Y=new c;return Y.appendPoints(L.points),Y.appendPoints(N.points),Y.appendPoints(G.points),Y.appendPoints(V.points),Y.points.length>0&&(Y.status="Intersection"),Y}}(t),function(a){var l=a.fabric||(a.fabric={});if(l.Color){l.warn("fabric.Color is already defined.");return}function c(p){p?this._tryParsingColor(p):this.setSource([0,0,0,1])}l.Color=c,l.Color.prototype={_tryParsingColor:function(p){var y;p in c.colorNameMap&&(p=c.colorNameMap[p]),p==="transparent"&&(y=[255,255,255,0]),y||(y=c.sourceFromHex(p)),y||(y=c.sourceFromRgb(p)),y||(y=c.sourceFromHsl(p)),y||(y=[0,0,0,1]),y&&this.setSource(y)},_rgbToHsl:function(p,y,v){p/=255,y/=255,v/=255;var S,I,O,L=l.util.array.max([p,y,v]),N=l.util.array.min([p,y,v]);if(O=(L+N)/2,L===N)S=I=0;else{var G=L-N;switch(I=O>.5?G/(2-L-N):G/(L+N),L){case p:S=(y-v)/G+(y1&&(v-=1),v<.16666666666666666?p+(y-p)*6*v:v<.5?y:v<.6666666666666666?p+(y-p)*(.6666666666666666-v)*6:p}l.Color.fromRgb=function(p){return c.fromSource(c.sourceFromRgb(p))},l.Color.sourceFromRgb=function(p){var y=p.match(c.reRGBa);if(y){var v=parseInt(y[1],10)/(/%$/.test(y[1])?100:1)*(/%$/.test(y[1])?255:1),S=parseInt(y[2],10)/(/%$/.test(y[2])?100:1)*(/%$/.test(y[2])?255:1),I=parseInt(y[3],10)/(/%$/.test(y[3])?100:1)*(/%$/.test(y[3])?255:1);return[parseInt(v,10),parseInt(S,10),parseInt(I,10),y[4]?parseFloat(y[4]):1]}},l.Color.fromRgba=c.fromRgb,l.Color.fromHsl=function(p){return c.fromSource(c.sourceFromHsl(p))},l.Color.sourceFromHsl=function(p){var y=p.match(c.reHSLa);if(y){var v=(parseFloat(y[1])%360+360)%360/360,S=parseFloat(y[2])/(/%$/.test(y[2])?100:1),I=parseFloat(y[3])/(/%$/.test(y[3])?100:1),O,L,N;if(S===0)O=L=N=I;else{var G=I<=.5?I*(S+1):I+S-I*S,V=I*2-G;O=d(V,G,v+.3333333333333333),L=d(V,G,v),N=d(V,G,v-.3333333333333333)}return[Math.round(O*255),Math.round(L*255),Math.round(N*255),y[4]?parseFloat(y[4]):1]}},l.Color.fromHsla=c.fromHsl,l.Color.fromHex=function(p){return c.fromSource(c.sourceFromHex(p))},l.Color.sourceFromHex=function(p){if(p.match(c.reHex)){var y=p.slice(p.indexOf("#")+1),v=y.length===3||y.length===4,S=y.length===8||y.length===4,I=v?y.charAt(0)+y.charAt(0):y.substring(0,2),O=v?y.charAt(1)+y.charAt(1):y.substring(2,4),L=v?y.charAt(2)+y.charAt(2):y.substring(4,6),N=S?v?y.charAt(3)+y.charAt(3):y.substring(6,8):"FF";return[parseInt(I,16),parseInt(O,16),parseInt(L,16),parseFloat((parseInt(N,16)/255).toFixed(2))]}},l.Color.fromSource=function(p){var y=new c;return y.setSource(p),y}}(t),function(a){var l=a.fabric||(a.fabric={}),c=["e","se","s","sw","w","nw","n","ne","e"],d=["ns","nesw","ew","nwse"],p={},y="left",v="top",S="right",I="bottom",O="center",L={top:I,bottom:v,left:S,right:y,center:O},N=l.util.radiansToDegrees,G=Math.sign||function(Ee){return(Ee>0)-(Ee<0)||+Ee};function V(Ee,Be){var mt=Ee.angle+N(Math.atan2(Be.y,Be.x))+360;return Math.round(mt%360/45)}function Y(Ee,Be){var mt=Be.transform.target,kt=mt.canvas,ct=l.util.object.clone(Be);ct.target=mt,kt&&kt.fire("object:"+Ee,ct),mt.fire(Ee,Be)}function X(Ee,Be){var mt=Be.canvas,kt=mt.uniScaleKey,ct=Ee[kt];return mt.uniformScaling&&!ct||!mt.uniformScaling&&ct}function te(Ee){return Ee.originX===O&&Ee.originY===O}function re(Ee,Be,mt){var kt=Ee.lockScalingX,ct=Ee.lockScalingY;return!!(kt&&ct||!Be&&(kt||ct)&&mt||kt&&Be==="x"||ct&&Be==="y")}function fe(Ee,Be,mt){var kt="not-allowed",ct=X(Ee,mt),le="";if(Be.x!==0&&Be.y===0?le="x":Be.x===0&&Be.y!==0&&(le="y"),re(mt,le,ct))return kt;var it=V(mt,Be);return c[it]+"-resize"}function ge(Ee,Be,mt){var kt="not-allowed";if(Be.x!==0&&mt.lockSkewingY||Be.y!==0&&mt.lockSkewingX)return kt;var ct=V(mt,Be)%4;return d[ct]+"-resize"}function _e(Ee,Be,mt){return Ee[mt.canvas.altActionKey]?p.skewCursorStyleHandler(Ee,Be,mt):p.scaleCursorStyleHandler(Ee,Be,mt)}function Ie(Ee,Be,mt){var kt=Ee[mt.canvas.altActionKey];if(Be.x===0)return kt?"skewX":"scaleY";if(Be.y===0)return kt?"skewY":"scaleX"}function ke(Ee,Be,mt){return mt.lockRotation?"not-allowed":Be.cursorStyle}function Ne(Ee,Be,mt,kt){return{e:Ee,transform:Be,pointer:{x:mt,y:kt}}}function J(Ee){return function(Be,mt,kt,ct){var le=mt.target,it=le.getCenterPoint(),pt=le.translateToOriginPoint(it,mt.originX,mt.originY),Le=Ee(Be,mt,kt,ct);return le.setPositionByOrigin(pt,mt.originX,mt.originY),Le}}function he(Ee,Be){return function(mt,kt,ct,le){var it=Be(mt,kt,ct,le);return it&&Y(Ee,Ne(mt,kt,ct,le)),it}}function xe(Ee,Be,mt,kt,ct){var le=Ee.target,it=le.controls[Ee.corner],pt=le.canvas.getZoom(),Le=le.padding/pt,ce=le.toLocalPoint(new l.Point(kt,ct),Be,mt);return ce.x>=Le&&(ce.x-=Le),ce.x<=-Le&&(ce.x+=Le),ce.y>=Le&&(ce.y-=Le),ce.y<=Le&&(ce.y+=Le),ce.x-=it.offsetX,ce.y-=it.offsetY,ce}function Pe(Ee){return Ee.flipX!==Ee.flipY}function Oe(Ee,Be,mt,kt,ct){if(Ee[Be]!==0){var le=Ee._getTransformedDimensions()[kt],it=ct/le*Ee[mt];Ee.set(mt,it)}}function Ae(Ee,Be,mt,kt){var ct=Be.target,le=ct._getTransformedDimensions(0,ct.skewY),it=xe(Be,Be.originX,Be.originY,mt,kt),pt=Math.abs(it.x*2)-le.x,Le=ct.skewX,ce;pt<2?ce=0:(ce=N(Math.atan2(pt/ct.scaleX,le.y/ct.scaleY)),Be.originX===y&&Be.originY===I&&(ce=-ce),Be.originX===S&&Be.originY===v&&(ce=-ce),Pe(ct)&&(ce=-ce));var Ce=Le!==ce;if(Ce){var Ze=ct._getTransformedDimensions().y;ct.set("skewX",ce),Oe(ct,"skewY","scaleY","y",Ze)}return Ce}function ze(Ee,Be,mt,kt){var ct=Be.target,le=ct._getTransformedDimensions(ct.skewX,0),it=xe(Be,Be.originX,Be.originY,mt,kt),pt=Math.abs(it.y*2)-le.y,Le=ct.skewY,ce;pt<2?ce=0:(ce=N(Math.atan2(pt/ct.scaleY,le.x/ct.scaleX)),Be.originX===y&&Be.originY===I&&(ce=-ce),Be.originX===S&&Be.originY===v&&(ce=-ce),Pe(ct)&&(ce=-ce));var Ce=Le!==ce;if(Ce){var Ze=ct._getTransformedDimensions().x;ct.set("skewY",ce),Oe(ct,"skewX","scaleX","x",Ze)}return Ce}function Ge(Ee,Be,mt,kt){var ct=Be.target,le=ct.skewX,it,pt=Be.originY;if(ct.lockSkewingX)return!1;if(le===0){var Le=xe(Be,O,O,mt,kt);Le.x>0?it=y:it=S}else le>0&&(it=pt===v?y:S),le<0&&(it=pt===v?S:y),Pe(ct)&&(it=it===y?S:y);Be.originX=it;var ce=he("skewing",J(Ae));return ce(Ee,Be,mt,kt)}function Je(Ee,Be,mt,kt){var ct=Be.target,le=ct.skewY,it,pt=Be.originX;if(ct.lockSkewingY)return!1;if(le===0){var Le=xe(Be,O,O,mt,kt);Le.y>0?it=v:it=I}else le>0&&(it=pt===y?v:I),le<0&&(it=pt===y?I:v),Pe(ct)&&(it=it===v?I:v);Be.originY=it;var ce=he("skewing",J(ze));return ce(Ee,Be,mt,kt)}function et(Ee,Be,mt,kt){var ct=Be,le=ct.target,it=le.translateToOriginPoint(le.getCenterPoint(),ct.originX,ct.originY);if(le.lockRotation)return!1;var pt=Math.atan2(ct.ey-it.y,ct.ex-it.x),Le=Math.atan2(kt-it.y,mt-it.x),ce=N(Le-pt+ct.theta),Ce=!0;if(le.snapAngle>0){var Ze=le.snapAngle,yt=le.snapThreshold||Ze,Ve=Math.ceil(ce/Ze)*Ze,At=Math.floor(ce/Ze)*Ze;Math.abs(ce-At)G?(fe=N,v.scale(1,G/N),re=I*N/G):G>N?(fe=G,v.scale(N/G,1),te=S*G/N):fe=N,v.lineWidth=1,v.beginPath(),v.arc(te,re,fe/2,0,2*Math.PI,!1),v[Y](),X&&v.stroke(),v.restore()}function y(v,S,I,O,L){O=O||{};var N=this.sizeX||O.cornerSize||L.cornerSize,G=this.sizeY||O.cornerSize||L.cornerSize,V=typeof O.transparentCorners<"u"?O.transparentCorners:L.transparentCorners,Y=V?"stroke":"fill",X=!V&&(O.cornerStrokeColor||L.cornerStrokeColor),te=N/2,re=G/2;v.save(),v.fillStyle=O.cornerColor||L.cornerColor,v.strokeStyle=O.cornerStrokeColor||L.cornerStrokeColor,v.lineWidth=1,v.translate(S,I),v.rotate(c(L.angle)),v[Y+"Rect"](-te,-re,N,G),X&&v.strokeRect(-te,-re,N,G),v.restore()}d.renderCircleControl=p,d.renderSquareControl=y}(t),function(a){var l=a.fabric||(a.fabric={});function c(d){for(var p in d)this[p]=d[p]}l.Control=c,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(d,p){return p.cursorStyle},getActionName:function(d,p){return p.actionName},getVisibility:function(d,p){var y=d._controlsVisibility;return y&&typeof y[p]<"u"?y[p]:this.visible},setVisibility:function(d){this.visible=d},positionHandler:function(d,p){var y=l.util.transformPoint({x:this.x*d.x+this.offsetX,y:this.y*d.y+this.offsetY},p);return y},calcCornerCoords:function(d,p,y,v,S){var I,O,L,N,G=S?this.touchSizeX:this.sizeX,V=S?this.touchSizeY:this.sizeY;if(G&&V&&G!==V){var Y=Math.atan2(V,G),X=Math.sqrt(G*G+V*V)/2,te=Y-l.util.degreesToRadians(d),re=Math.PI/2-Y-l.util.degreesToRadians(d);I=X*l.util.cos(te),O=X*l.util.sin(te),L=X*l.util.cos(re),N=X*l.util.sin(re)}else{var fe=G&&V?G:p;X=fe*.7071067812;var te=l.util.degreesToRadians(45-d);I=L=X*l.util.cos(te),O=N=X*l.util.sin(te)}return{tl:{x:y-N,y:v-L},tr:{x:y+I,y:v-O},bl:{x:y-I,y:v+O},br:{x:y+N,y:v+L}}},render:function(d,p,y,v,S){switch(v=v||{},v.cornerStyle||S.cornerStyle){case"circle":l.controlsUtils.renderCircleControl.call(this,d,p,y,v,S);break;default:l.controlsUtils.renderSquareControl.call(this,d,p,y,v,S)}}}}(t),function(){function a(y,v){var S=y.getAttribute("style"),I=y.getAttribute("offset")||0,O,L,N,G;if(I=parseFloat(I)/(/%$/.test(I)?100:1),I=I<0?0:I>1?1:I,S){var V=S.split(/\s*;\s*/);for(V[V.length-1]===""&&V.pop(),G=V.length;G--;){var Y=V[G].split(/\s*:\s*/),X=Y[0].trim(),te=Y[1].trim();X==="stop-color"?O=te:X==="stop-opacity"&&(N=te)}}return O||(O=y.getAttribute("stop-color")||"rgb(0,0,0)"),N||(N=y.getAttribute("stop-opacity")),O=new e.Color(O),L=O.getAlpha(),N=isNaN(parseFloat(N))?1:parseFloat(N),N*=L*v,{offset:I,color:O.toRgb(),opacity:N}}function l(y){return{x1:y.getAttribute("x1")||0,y1:y.getAttribute("y1")||0,x2:y.getAttribute("x2")||"100%",y2:y.getAttribute("y2")||0}}function c(y){return{x1:y.getAttribute("fx")||y.getAttribute("cx")||"50%",y1:y.getAttribute("fy")||y.getAttribute("cy")||"50%",r1:0,x2:y.getAttribute("cx")||"50%",y2:y.getAttribute("cy")||"50%",r2:y.getAttribute("r")||"50%"}}var d=e.util.object.clone;e.Gradient=e.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(y){y||(y={}),y.coords||(y.coords={});var v,S=this;Object.keys(y).forEach(function(I){S[I]=y[I]}),this.id?this.id+="_"+e.Object.__uid++:this.id=e.Object.__uid++,v={x1:y.coords.x1||0,y1:y.coords.y1||0,x2:y.coords.x2||0,y2:y.coords.y2||0},this.type==="radial"&&(v.r1=y.coords.r1||0,v.r2=y.coords.r2||0),this.coords=v,this.colorStops=y.colorStops.slice()},addColorStop:function(y){for(var v in y){var S=new e.Color(y[v]);this.colorStops.push({offset:parseFloat(v),color:S.toRgb(),opacity:S.getAlpha()})}return this},toObject:function(y){var v={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,v,y),v},toSVG:function(y,L){var S=d(this.coords,!0),I,O,L=L||{},N,G,V=d(this.colorStops,!0),Y=S.r1>S.r2,X=this.gradientTransform?this.gradientTransform.concat():e.iMatrix.concat(),te=-this.offsetX,re=-this.offsetY,fe=!!L.additionalTransform,ge=this.gradientUnits==="pixels"?"userSpaceOnUse":"objectBoundingBox";if(V.sort(function(J,he){return J.offset-he.offset}),ge==="objectBoundingBox"?(te/=y.width,re/=y.height):(te+=y.width/2,re+=y.height/2),y.type==="path"&&this.gradientUnits!=="percentage"&&(te-=y.pathOffset.x,re-=y.pathOffset.y),X[4]-=te,X[5]-=re,G='id="SVGID_'+this.id+'" gradientUnits="'+ge+'"',G+=' gradientTransform="'+(fe?L.additionalTransform+" ":"")+e.util.matrixToSVG(X)+'" ',this.type==="linear"?N=[" -`]:this.type==="radial"&&(N=[" -`]),this.type==="radial"){if(Y)for(V=V.concat(),V.reverse(),I=0,O=V.length;I0){var Ie=Math.max(S.r1,S.r2),ke=_e/Ie;for(I=0,O=V.length;I -`)}return N.push(this.type==="linear"?` + */const fcr=Object.freeze(Object.defineProperty({__proto__:null,CalciteScrim:uSt,defineCustomElement:dQ},Symbol.toStringTag,{value:"Module"})),mcr=["innerHTML"],Zge=an({__name:"default-button",props:{panelId:{type:String,required:!0},minimize:{type:Boolean,default:!1},overflow:{type:Boolean}},setup(t){const e=t,{t:i}=ns(),r=no("iApi"),n=Jr(()=>r?.panel.get(e.panelId)?.button),s=()=>{e.minimize?r?.panel.toggleMinimize(e.panelId):r?.panel.toggle(e.panelId)};return(o,a)=>{const l=Vo("appbar-button");return n.value?(Qt(),Bn(l,{key:0,onClickFunction:s,tooltip:vi(i)(n.value.tooltip),id:t.panelId},{default:En(()=>[Dt("div",{class:ms(["default fill-current w-24 h-24 ml-8 sm:ml-20",{"ml-20":t.overflow}]),innerHTML:n.value.icon},null,10,mcr)]),_:1},8,["tooltip","id"])):fn("",!0)}}}),_Lr="",gcr={},ycr={class:"border-b p-0 self-center w-2/3"};function vcr(t,e){return Qt(),hi("span",ycr)}const _Ot=Nl(gcr,[["render",vcr],["__scopeId","data-v-5d32b715"]]),_cr=t=>(eh("data-v-4d49cfee"),t=t(),th(),t),bcr=["content"],wcr=[_cr(()=>Dt("svg",{class:"fill-current w-24 h-24 m-auto",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Dt("path",{d:"M0 0h24v24H0z",fill:"none"}),Dt("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))],xcr=["position"],Scr=an({__name:"more-button",props:{position:{type:String,default:"bottom-right"}},setup(t){const{t:e}=ns(),i=Mi(!1),r=Mi();return Ja(()=>{window.addEventListener("click",n=>{n.target instanceof HTMLElement&&!r.value?.contains(n.target)&&(i.value=!1)},{capture:!0})}),Ll(()=>{window.removeEventListener("click",n=>{n.target instanceof HTMLElement&&!r.value?.contains(n.target)&&(i.value=!1)},{capture:!0})}),(n,s)=>{const o=as("focus-item"),a=as("tippy");return Qt(),hi("div",{class:"appbar-item relative inset-x-0 w-full text-center",ref_key:"el",ref:r},[Zr((Qt(),hi("button",{type:"button",class:"text-gray-400 w-full h-48 focus:outline-none hover:text-white",onClick:s[0]||(s[0]=l=>i.value=!i.value),content:vi(e)("appbar.more")},wcr,8,bcr)),[[o],[a,{placement:"right"}]]),Zr(Dt("div",{onBlur:s[1]||(s[1]=l=>i.value=!1),position:t.position,id:"dropdown",class:"dropdown shadow-md border border-gray:200 absolute w-64 flex flex-col bg-white rounded"},[Xf(n.$slots,"default",{},void 0,!0)],40,xcr),[[vf,i.value]])],512)}}}),wLr="",Ccr=Nl(Scr,[["__scopeId","data-v-4d49cfee"]]),Tcr=(t=>(eh("data-v-f2294fce"),t=t(),th(),t))(()=>Dt("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"},[Dt("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)),Ecr={key:0,class:"number absolute top-1 right-2 text-white w-18 rounded-full"},Icr=an({__name:"appbar-button",setup(t){const e=qT(),{t:i}=ns(),r=no("iApi"),n=Jr(()=>e.notificationNumber),s=()=>{r.panel.toggle("notifications")};return(o,a)=>{const l=Vo("appbar-button",!0);return Qt(),Bn(l,{onClickFunction:s,tooltip:vi(i)("notifications.title"),class:"notification-button",id:""},{default:En(()=>[Tcr,n.value&&n.value>0?(Qt(),hi("span",Ecr,xr(n.value),1)):fn("",!0)]),_:1},8,["tooltip"])}}}),SLr="",Acr=Nl(Icr,[["__scopeId","data-v-f2294fce"]]),Pcr=an({__name:"appbar",setup(t){const e=ay(),i=mg(),r=Jr(()=>i.visible),n=Jr(()=>i.temporary),s=Mi(!1),o=Mi({}),a=Mi();return C_(()=>{const l=Up();window.addEventListener("resize",()=>l?.proxy?.$forceUpdate())}),Ll(()=>{const l=Up();window.removeEventListener("resize",()=>l?.proxy?.$forceUpdate())}),YN(()=>{v0(()=>{const l=a.value;let c,h=[...l.children],p=h[h.length-2].getBoundingClientRect().top;e.mobileView||(p=l.getBoundingClientRect().bottom-38);let y=l.querySelector("#dropdown");for(let I=h.length-4;I>=0;I--){let P=h[I].getBoundingClientRect().bottom;if(p&&y&&(P>p||s.value&&P+56>p))h[I].classList.forEach(F=>{F.includes("identifier")&&(c=F.slice(11))}),c&&(o.value[c]=!0),s.value||(s.value=!0);else if(P!==0)break}let v=l.querySelector("#more"),x=v.getBoundingClientRect().bottom;if(c=void 0,s.value&&p&&v&&y&&x!==0&&(x<=p-56||y.childElementCount==1&&x<=p)){let I=y.childElementCount,P=0;for(;x<=p-56||I==1;){let F=y.children[P];if(F&&(F.classList.forEach(k=>{k.includes("identifier")&&(c=k.slice(11))}),c&&(o.value[c]=!1),x+=48,I-=1,P+=1),I===0){s.value=!1;break}}}Object.keys(o.value).forEach(I=>{l.querySelector(`.identifier-${I}`)||delete o.value[I]})})}),(l,c)=>{const h=as("focus-list");return Zr((Qt(),hi("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",ref_key:"el",ref:a},[(Qt(!0),hi(po,null,fu(r.value,(p,y)=>(Qt(),hi(po,null,[(Qt(!0),hi(po,null,fu(p,(v,x)=>(Qt(),hi(po,null,[typeof v=="string"&&o.value[`${v}-${x}`]!==!0?(Qt(),Bn(Zge,{key:`${v}-${x}-default`,panelId:v,class:ms(["appbar-item h-48",`identifier-${v}-${x}`])},null,8,["panelId","class"])):o.value[`${v}-${x}`]!==!0?(Qt(),Bn(TP(v.componentId),{key:`${v}-${x}-custom`,options:v.options,class:ms(["appbar-item h-48",`identifier-${v}-${x}`]),id:v.id},null,8,["options","id","class"])):fn("",!0)],64))),256)),o.value[`divider-${y}`]!==!0?(Qt(),Bn(_Ot,{class:ms(["appbar-item",`identifier-divider-${y}`]),key:`${p}-${y}-default`},null,8,["class"])):fn("",!0)],64))),256)),(Qt(!0),hi(po,null,fu(n.value?.filter(p=>o.value[`${p}-temp`]!==!0),p=>(Qt(),Bn(Zge,{panelId:p,minimize:!0,key:`${p}-temp`,class:ms([`identifier-${p}-temp`,"appbar-item h-48"])},null,8,["panelId","class"]))),128)),Zr(Un(Ccr,{id:"more"},{default:En(()=>[(Qt(!0),hi(po,null,fu(r.value,(p,y)=>(Qt(),hi(po,{key:y},[(Qt(!0),hi(po,null,fu(p,(v,x)=>(Qt(),hi(po,null,[typeof v=="string"&&o.value[`${v}-${x}`]?(Qt(),Bn(Zge,{key:`${v}-${x}-default`,panelId:v,class:ms(["text-black hover:bg-gray my-4 h-36",`identifier-${v}-${x}`]),overflow:""},null,8,["panelId","class"])):o.value[`${v}-${x}`]?(Qt(),Bn(TP(v.componentId),{key:`${v}-${x}-custom`,options:v.options,id:v.id,class:ms(["appbar-item h-48",`identifier-${v}-${x}`])},null,8,["options","id","class"])):fn("",!0)],64))),256)),o.value[`divider-${y}`]?(Qt(),Bn(_Ot,{key:0,class:ms(["border-black my-4",`identifier-divider-${y}`])},null,8,["class"])):fn("",!0)],64))),128)),(Qt(!0),hi(po,null,fu(n.value?.filter(p=>o.value[`${p}-temp`]),p=>(Qt(),Bn(Zge,{panelId:p,minimize:!0,key:`${p}-temp`,class:ms([`identifier-${p}-temp`,"text-black hover:bg-gray my-4 h-36"]),overflow:""},null,8,["panelId","class"]))),128))]),_:1},512),[[vf,s.value]]),Un(Acr,{class:"appbar-item bottom-48 h-48 sm:display-none"}),Un(iht,{class:"absolute bottom-0 h-40 sm:display-none w-full text-center",position:"right-start"})])),[[h]])}}}),CLr="";class Ocr extends Ac{get config(){return super.config}_parseConfig(e){if(!e)return;const i=mg(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 FAe(o)))}),i.items=n.flat().reduce((s,o)=>(s[o instanceof FAe?o.id:o]=o,s),{}),i.order=n.map(s=>s.map(o=>o instanceof FAe?o.id:o)),this._validateItems()}_validateItems(){const e=mg(this.$vApp.$pinia);e.order.flat().forEach(i=>{typeof e.items[i]!="string"&&[i].some(r=>{this.$iApi.fixture.get(r)&&!e.items[i]&&(e.items[i].componentId=`${r}-appbar-button`)})})}}const Rcr={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 Mcr extends Ocr{initialized(){}async added(){Object.entries(Rcr).forEach(o=>this.$iApi.$i18n.mergeLocaleMessage(...o));const{destroy:e,el:i}=this.mount(Pcr,{app:this.$element}),r=this.$vApp.$el.getElementsByClassName("inner-shell")[0];r.insertBefore(i.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(cn.COMPONENT,()=>{this._parseConfig(this.config)})),this.removed=()=>{const o=mg(this.$vApp.$pinia);n(),s.forEach(c=>this.$iApi.event.off(c));const a={...o.items},l=[...o.temporary];Object.keys(a).forEach(c=>o.removeButton(c)),l.forEach(c=>o.removeButton(c)),e(),o.$reset()}}}const Dcr=Object.freeze(Object.defineProperty({__proto__:null,default:Mcr},Symbol.toStringTag,{value:"Module"})),Fcr=t=>(eh("data-v-74cdad7d"),t=t(),th(),t),Lcr={class:"mt-10"},Ncr=["aria-label"],kcr=["alt","src"],$cr=["alt"],Bcr={class:"absolute flex w-full bg-black opacity-75 text-white h-30 bottom-6 items-center"},Vcr={class:"pl-5"},jcr={class:"ml-auto pr-5"},Gcr=["content"],Ucr=[Fcr(()=>Dt("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Dt("path",{d:"M0 0h24v24H0z",fill:"none"}),Dt("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))],zcr=an({__name:"item",props:{area:{type:Object,required:!0},showThumbnail:{type:Boolean}},setup(t){const{t:e}=ns(),i=no("iApi"),r=n=>{if(!n.extent){console.error("selected area of interest doesn't have an extent specified.");return}i?.geo.map.zoomMapTo(Ad.fromConfig("area-of-interest-extent",n.extent))};return(n,s)=>{const o=as("truncate"),a=as("tippy"),l=as("focus-item");return Qt(),hi("div",Lcr,[Zr((Qt(),hi("button",{type:"button",class:ms(["area-of-interest-item-button bg-gray-300 w-full",{"border border-gray-300":t.showThumbnail}]),"aria-label":vi(e)("areas-of-interest.select"),onClick:s[2]||(s[2]=c=>r(t.area))},[Dt("div",null,[Dt("div",{class:ms(["flex hover:opacity-50 area-of-interest-item-image",t.showThumbnail?"h-180":"h-30"])},[t.area.thumbnail?(Qt(),hi("img",{key:0,class:"w-full bg-white object-contain",alt:t.area.altText||t.area.title,src:t.area.thumbnail},null,8,kcr)):t.showThumbnail?(Qt(),hi("img",{key:1,class:"w-full bg-white object-contain py-30",alt:t.area.altText||t.area.title,src:"https://openclipart.org/image/800px/160615"},null,8,$cr)):fn("",!0)],2)]),Dt("div",Bcr,[Zr((Qt(),hi("div",Vcr,[Dt("span",null,xr(t.area.title),1)])),[[o]]),Zr(Dt("div",jcr,[Zr((Qt(),hi("a",{onClick:s[0]||(s[0]=wa(()=>{},["stop"])),onKeydown:s[1]||(s[1]=Zh(wa(()=>{},["prevent"]),["enter","space"])),content:t.area.description},Ucr,40,Gcr)),[[a,{placement:"bottom",trigger:"click focus"}]])],512),[[vf,t.area.description]])])],10,Ncr)),[[l]])])}}}),ELr="",Hcr=Nl(zcr,[["__scopeId","data-v-74cdad7d"]]),Wcr={class:"h-600 overflow-y-auto"},qcr={class:"mx-5"},Ycr={key:0},bOt=an({__name:"screen",props:{panel:{type:Object}},setup(t){const{t:e}=ns(),i=Bhe(),r=Jr(()=>i.areas);let n=Mi(!1);return Ja(()=>{n.value=!!r.value?.some(s=>s.thumbnail)}),(s,o)=>{const a=Vo("panel-screen"),l=as("focus-list");return Qt(),Bn(a,{panel:t.panel},{header:En(()=>[ks(xr(vi(e)("areas-of-interest.title")),1)]),content:En(()=>[Dt("div",Wcr,[Dt("div",qcr,[r.value.length>0?Zr((Qt(),hi("ul",Ycr,[(Qt(!0),hi(po,null,fu(r.value,(c,h)=>(Qt(),hi("li",{key:h},[Un(Hcr,{area:c,"show-thumbnail":vi(n),class:"block relative overflow-hidden"},null,8,["area","show-thumbnail"])]))),128))])),[[l]]):fn("",!0)])])]),_:1},8,["panel"])}}}),Xcr=Object.freeze(Object.defineProperty({__proto__:null,default:bOt},Symbol.toStringTag,{value:"Module"})),Kcr={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 Jcr extends Ac{get config(){return super.config}_parseConfig(e){if(!e)return;const i=Bhe(this.$vApp.$pinia);i.areas=e.areas,this.handlePanelTeleports(["areas-of-interest"])}}class Zcr extends Jcr{added(){this.$iApi.panel.register({"areas-of-interest":{screens:{"areas-of-interest-screen":ya(bOt)},style:{width:"350px"},button:{tooltip:"areas-of-interest.title",icon:''},alertName:"areas-of-interest.title"}},{i18n:{messages:Kcr}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,i=>this._parseConfig(i));this.removed=()=>{e(),this.$iApi.fixture.get("appbar")&&mg(this.$vApp.$pinia).removeButton("areas-of-interest"),this.$iApi.panel.remove("areas-of-interest"),Bhe(this.$vApp.$pinia).$reset()}}}const Qcr=Object.freeze(Object.defineProperty({__proto__:null,default:Zcr},Symbol.toStringTag,{value:"Module"})),wOt=t=>(eh("data-v-ee45654c"),t=t(),th(),t),ehr={class:"mb-10"},thr=["aria-label"],ihr={key:0,class:"w-full h-30"},rhr=["alt","src"],nhr=["alt","src"],shr=["alt"],ohr={class:"pl-5"},ahr={class:"ml-auto pr-5"},lhr=["content"],uhr=[wOt(()=>Dt("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Dt("path",{d:"M0 0h24v24H0z",fill:"none"}),Dt("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))],chr={key:0,class:"rv-basemap-check absolute top-0 right-0"},hhr=[wOt(()=>Dt("svg",{class:"fill-current w-25 h-25 relative",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Dt("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})],-1))],dhr=an({__name:"item",props:{basemap:{type:Object,required:!0},tileSchema:{type:Object,required:!0}},setup(t){const{t:e}=ns(),i=no("iApi"),r=yg(),n=Jr(()=>r.activeBasemapConfig),s=o=>{o.id!==n.value.id&&i?.geo.map.setBasemap(o.id)};return(o,a)=>{const l=as("truncate"),c=as("tippy"),h=as("focus-item");return Qt(),hi("div",ehr,[Zr((Qt(),hi("button",{class:"basemap-item-button bg-gray-300",type:"button","aria-label":vi(e)("basemap.select"),onClick:a[2]||(a[2]=p=>s(t.basemap))},[Dt("div",null,[Dt("div",{class:ms(["flex hover:opacity-50 basemap-item-image basemap-item-container",t.basemap.hideThumbnail?"h-30":"h-180"])},[t.basemap.hideThumbnail?(Qt(),hi("img",ihr)):t.basemap.thumbnailUrl?(Qt(),hi("img",{key:1,class:"w-full h-180",alt:t.basemap.altText,src:t.basemap.thumbnailUrl},null,8,rhr)):t.tileSchema.thumbnailTileUrls&&t.tileSchema.thumbnailTileUrls.length>0&&t.basemap.layers.every(p=>p.layerType==="esri-tile")?(Qt(!0),hi(po,{key:2},fu(t.basemap.layers,p=>(Qt(),hi("div",{key:p.id,class:"flex basemap-item-inner h-180"},[(Qt(!0),hi(po,null,fu(t.tileSchema.thumbnailTileUrls,(y,v)=>(Qt(),hi("img",{class:"w-full",alt:t.basemap.altText,src:p.url+y,key:v},null,8,nhr))),128))]))),128)):(Qt(),hi("img",{key:3,class:"w-full bg-white h-180",alt:t.basemap.altText,src:"https://openclipart.org/image/800px/275366"},null,8,shr))],2)]),Dt("div",{class:ms(["absolute flex w-full bg-black text-white h-30 bottom-6 items-center",t.basemap.hideThumbnail&&t.basemap.id===n.value.id?"opacity-85":"opacity-75"])},[Zr((Qt(),hi("div",ohr,[Dt("span",null,xr(t.basemap.name),1)])),[[l]]),Dt("div",ahr,[Zr((Qt(),hi("a",{onClick:a[0]||(a[0]=wa(()=>{},["stop"])),onKeydown:a[1]||(a[1]=Zh(wa(()=>{},["prevent"]),["enter","space"])),content:t.basemap.description},uhr,40,lhr)),[[c,{placement:"bottom",trigger:"click focus"}]])])],2),t.basemap.id===n.value.id&&!t.basemap.hideThumbnail?(Qt(),hi("div",chr,hhr)):fn("",!0)],8,thr)),[[h]])])}}}),PLr="",phr=Nl(dhr,[["__scopeId","data-v-ee45654c"]]),fhr={class:"h-600 overflow-y-auto"},mhr={class:"font-bold text-xl"},ghr={key:0,class:"border-t border-b border-gray-600"},xOt=an({__name:"screen",props:{panel:{type:Object}},setup(t){const{t:e}=ns(),i=yg(),r=Mi([]),n=Mi([]);Ja(()=>{const o=i.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=Vo("panel-screen"),c=as("truncate"),h=as("focus-list");return Qt(),Bn(l,{panel:t.panel},{header:En(()=>[ks(xr(vi(e)("basemap.title")),1)]),content:En(()=>[Dt("div",fhr,[(Qt(!0),hi(po,null,fu(r.value,(p,y)=>(Qt(),hi("div",{class:"mx-5",key:p.id},[Dt("div",{class:ms((y===0?"mt-5":"mt-36")+" flex mb-5")},[Zr((Qt(),hi("h3",mhr,[ks(xr(p.name),1)])),[[c]])],2),n.value.length>0?Zr((Qt(),hi("ul",ghr,[(Qt(!0),hi(po,null,fu(s(p.id),v=>(Qt(),hi("li",{key:v.id},[Un(phr,{basemap:v,tileSchema:p,class:"block relative overflow-hidden"},null,8,["basemap","tileSchema"])]))),128))])),[[h]]):fn("",!0)]))),128))])]),_:1},8,["panel"])}}}),yhr=Object.freeze(Object.defineProperty({__proto__:null,default:xOt},Symbol.toStringTag,{value:"Module"})),vhr=Dt("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Dt("path",{d:"M0 0h24v24H0z",fill:"none"}),Dt("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),_hr=an({__name:"nav-button",setup(t){const{t:e}=ns(),i=no("iApi"),r=()=>i?.panel.toggle("basemap");return(n,s)=>{const o=Vo("mapnav-button");return Qt(),Bn(o,{onClickFunction:r,tooltip:vi(e)("basemap.title")},{default:En(()=>[vhr]),_:1},8,["tooltip"])}}}),bhr={en:{"basemap.select":"Select basemap","basemap.title":"Basemap"},fr:{"basemap.select":"Sélectionner la carte de base","basemap.title":"Carte de base"}};class whr extends Ac{added(){this.$iApi.component("basemap-nav-button",_hr),this.$iApi.panel.register({id:"basemap",config:{screens:{"basemap-component":ya(xOt)},button:{tooltip:"basemap.title",icon:''},alertName:"basemap.title"}},{i18n:{messages:bhr}}),this.handlePanelTeleports(["basemap"])}removed(){this.$iApi.fixture.get("appbar")&&mg(this.$vApp.$pinia).removeButton("basemap"),this.$iApi.fixture.get("mapnav")&&gD(this.$vApp.$pinia).removeItem("basemap"),this.$iApi.panel.remove("basemap")}}const xhr=Object.freeze(Object.defineProperty({__proto__:null,default:whr},Symbol.toStringTag,{value:"Module"})),Shr=[(t=>(eh("data-v-495353cf"),t=t(),th(),t))(()=>Dt("svg",{xmlns:"http://www.w3.org/2000/svg",fit:"",height:"100%",width:"100%",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false"},[Dt("g",{fill:"#545353",stroke:"#fff",id:"crosshairs"},[Dt("ellipse",{ry:".254",rx:".262",id:"path3808",cx:"12",cy:"12","stroke-width":".076"}),Dt("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"}),Dt("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"}),Dt("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"}),Dt("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))],Chr=an({__name:"crosshairs",setup(t){const e=no("iApi"),i=Mi(!1),r=Mi([]);return Ja(()=>{r.value.push(e.event.on(cn.MAP_EXTENTCHANGE,()=>{e.geo.map.keysActive&&(i.value=!0)})),r.value.push(e.event.on(cn.MAP_FOCUS,()=>{e.geo.map.mouseFocus||(i.value=!0)})),r.value.push(e.event.on(cn.MAP_MOUSEDOWN,()=>{i.value=!1})),r.value.push(e.event.on(cn.MAP_BLUR,()=>{i.value=!1}))}),Ll(()=>{r.value.forEach(n=>e.event.off(n))}),(n,s)=>(Qt(),hi("div",{class:ms(["crosshairs absolute duration-150 top-1/2 left-1/2 h-230 w-230",{"opacity-0":!i.value}])},Shr,2))}}),MLr="",Thr=Nl(Chr,[["__scopeId","data-v-495353cf"]]);class Ehr extends Ac{added(){const{destroy:e,el:i}=this.mount(Thr,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(i.childNodes[0]),this.removed=()=>{e()}}}const Ihr=Object.freeze(Object.defineProperty({__proto__:null,default:Ehr},Symbol.toStringTag,{value:"Module"})),Qge="Ramp-Hilight",Nke="Ramp-Hilight-Fog-Basemap",Ahr={mode:"glow",options:{haloColor:[0,255,0],haloOpacity:.8}};var J6=(t=>(t.NONE="none",t.GLOW="glow",t.LIFT="lift",t.FOG="fog",t))(J6||{});const kke="details";class Phr extends Ac{detailsStore=rk(this.$vApp.$pinia);get config(){return super.config}openDetails(e){this.detailsStore.payload=e,this.$iApi.panel.get("details-layers").isOpen||this.$iApi.panel.open({id:"details-layers"})}toggleFeature(e,i){const r=this.$iApi.panel.get("details-layers");r.isOpen&&this.$iApi.panel.close(r);const n=this.$iApi.panel.get("details-items"),s={result:{items:[{data:e.data,format:e.format,loaded:!0,loading:Promise.resolve()}],uid:e.uid,loading:Promise.resolve(),loaded:!0}},o=this.$iApi.geo.layer.getLayer(e.uid),a=this.detailsStore.currentFeatureId,l=`${e.uid}-${o?.supportsFeatures?e.data[o?.oidField??""]:JSON.stringify(e.data)}`;this.detailsStore.currentFeatureId=e.data?l:void 0,i===!1?this.$iApi.panel.close(n):n.isOpen?a!==l||i===!0?n.show({screen:"item-screen",props:s}):this.$iApi.panel.close(n):this.$iApi.panel.open({id:"details-items",screen:"item-screen",props:s})}_parseConfig(e){e&&e.templates&&(this.detailsStore.defaultTemplates=e.templates),this.handlePanelWidths(["details-items","details-layers"]),this.handlePanelTeleports(["details-items","details-layers"]);const i=this.getLayerFixtureConfigs(),r=[];Object.keys(i).forEach(s=>{r.push({id:s,name:i[s].name,template:i[s].template})});const n=r.map(s=>new Svi(s));this.detailsStore.properties=n.reduce((s,o)=>(s[o.id]=o,s),{}),this._validateItems()}_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,i){const r=e instanceof Array?e:[e],n=this.$iApi.fixture.get("hilight");if(n){const s=await n.getGraphicsByKey(kke);await n.removeHilight(s);const o=Date.now();this.detailsStore.lastHilight=o;const a=await this.getHilightGraphics(r,i);this.detailsStore.lastHilight===o&&await n.addHilight(a)}}async removeDetailsHilight(){const e=this.$iApi.fixture.get("hilight");if(e){this.detailsStore.lastHilight=Date.now();const i=await e.getGraphicsByKey(kke);await e.removeHilight(i)}}async reloadDetailsHilight(e,i){const r=e instanceof Array?e:[e],n=this.$iApi.fixture.get("hilight");if(n){const s=await this.getHilightGraphics(r,i);n.reloadHilight(s)}}async getHilightGraphics(e,i){const r=this.$iApi.geo.layer.getLayer(i),n=this.$iApi.fixture.get("hilight"),s=[];return r&&await Promise.all(e.map(async o=>{const a=o.data[r.oidField],l=await r.getGraphic(a,{getGeom:!0,getAttribs:!0,getStyle:!0});l.id=n.constructGraphicKey(kke,i,a),s.push(l)})),s}onHilightToggle(e,i,r){e?(this.hilightDetailsItems(i,r),this.detailsStore.hilightToggle=!0):(this.removeDetailsHilight(),this.detailsStore.hilightToggle=!1)}hasHilighter(){const e=this.$iApi.fixture.get("hilight");return e&&e.hilightMode.mode!==J6.NONE}}const Ohr={key:0},Rhr={class:"p-5"},Mhr=["onClick","disabled"],Dhr=Dt("div",{class:"flex-auto"},null,-1),Fhr={key:0,class:"px-5"},Lhr={key:1,class:"px-5"},Nhr={key:2,class:"animate-spin spinner h-20 w-20 px-5"},khr={key:1,class:"flex justify-center py-10 items-center"},$hr=Dt("span",{class:"animate-spin spinner h-20 w-20 px-5 mr-8"},null,-1),Bhr={key:2},Vhr=an({__name:"layers-screen",props:{panel:_k},setup(t){const{t:e}=ns(),i=no("iApi"),r=gg(),n=ay(),s=rk(),o=Mi([]),a=Mi(""),l=Mi([]),c=Mi([]),h=Jr(()=>s.activeGreedy),p=Jr(()=>s.slowLoadingFlag),y=Jr(()=>s.payload),v=Jr(()=>s.properties),x=Jr(()=>n.mobileView),I=Jr(()=>n.getRemainingWidth),P=Jr(()=>o.value.map(ie=>ie.items.length).reduce((ie,ce)=>ie+ce,0)),F=ie=>{if(ie===void 0)return;const ce=i.panel.get("details-items"),he=ce?.width||350,_e=!ce||x.value||I.value{const ce=i.panel.get("details-items");if(a.value&&ce?.isOpen){const he=o.value.findIndex(_e=>_e.uid===a.value);if(he!==-1){const _e=o.value[he];_e.loading.then(()=>{_e.requestTime===h.value&&(_e.items.length>0?(s.activeGreedy=0,X(he)):j(ie))})}else j(ie)}else j(ie);setTimeout(()=>{h.value!==0&&ie[0].requestTime===h.value&&(s.slowLoadingFlag=!0)},500)},j=ie=>{const ce=ie.map(_e=>_e.loading.then(()=>_e.items.length>0?Promise.resolve(_e):Promise.reject())),he=ie.length===0?0:ie[0].requestTime;Promise.any(ce).then(_e=>{if(_e.requestTime!==h.value)return;const xe=o.value.findIndex(Pe=>Pe.uid===_e.uid);s.activeGreedy=0,xe!==-1&&X(xe)}).catch(()=>{he===h.value&&(a.value="",s.activeGreedy=0,Y())})},V=ie=>{Promise.all(ie.map(ce=>ce.loading)).then(()=>{i.updateAlert(i.$i18n.t("details.layers.found",{numResults:P.value,numLayers:ie.length}))})},Y=()=>{i.panel.close("details-items")},X=ie=>{if(y.value[ie].items.length>0){s.activeGreedy=0;let ce=i.panel.get("details-items");if(!ce)return;let he={result:y.value[ie]};a.value=y.value[ie].uid,ce.isOpen?ce.show({screen:"item-screen",props:he}):i.panel.open({id:"details-items",screen:"item-screen",props:he})}},Z=ie=>{const ce=y.value[ie];let he=r.getLayerByUid(ce.uid);return he&&v.value[he.id]&&v.value[he.id].name?v.value[he.id].name:he?.name??""};return C_(()=>{c.value.push(bu(y,ie=>{F(ie)},{deep:!1,immediate:!0}))}),Ja(()=>{l.value.push(i.event.on(cn.PANEL_CLOSED,ie=>{(ie.id==="details-items"||ie.id==="details-layers")&&(s.activeGreedy=0)})),c.value.push(bu(h,ie=>{ie===0&&(s.slowLoadingFlag=!1)}))}),Ll(()=>{l.value.forEach(ie=>i.event.off(ie)),c.value.forEach(ie=>ie())}),(ie,ce)=>{const he=Vo("panel-screen"),_e=as("truncate");return Qt(),Bn(he,{panel:t.panel},{header:En(()=>[ks(xr(vi(e)("details.layers.title")),1)]),content:En(()=>[h.value===0?(Qt(),hi("div",Ohr,[Dt("div",Rhr,xr(vi(e)("details.layers.found",{numResults:P.value,numLayers:y.value.length})),1),(Qt(!0),hi(po,null,fu(o.value,(xe,Pe)=>(Qt(),hi("button",{type:"button",class:"w-full px-20 py-10 text-md flex hover:bg-gray-200 cursor-pointer disabled:cursor-default",key:xe.uid,onClick:ke=>xe.loaded&&X(Pe),disabled:!(xe.loaded&&xe.items.length>0)},[Zr((Qt(),hi("div",null,[ks(xr(Z(Pe)||vi(e)("details.layers.loading")),1)])),[[_e]]),Dhr,xe.loaded?(Qt(),hi("div",Fhr,xr(xe.items.length),1)):xe.errored?(Qt(),hi("div",Lhr,xr(vi(e)("details.layers.error")),1)):(Qt(),hi("div",Nhr))],8,Mhr))),128))])):p.value?(Qt(),hi("div",khr,[$hr,ks(" "+xr(vi(e)("details.item.loading")),1)])):(Qt(),hi("div",Bhr))]),_:1},8,["panel"])}}});var $ke={name:"Toggle",emits:["input","update:modelValue","change"],props:{value:{validator:function(t){return e=>["number","string","boolean"].indexOf(typeof e)!==-1||e==null},required:!1},modelValue:{validator:function(t){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(t,e){const i=function(o,a,l){const{value:c,modelValue:h,falseValue:p,trueValue:y,disabled:v}=GN(o),x=h&&h.value!==void 0?h:c,I=Jr(()=>x.value===y.value),P=j=>{a.emit("input",j),a.emit("update:modelValue",j),a.emit("change",j)},F=()=>{P(y.value)},k=()=>{P(p.value)};return[null,void 0,!1,0,"0","off"].indexOf(x.value)!==-1&&[p.value,y.value].indexOf(x.value)===-1&&k(),[!0,1,"1","on"].indexOf(x.value)!==-1&&[p.value,y.value].indexOf(x.value)===-1&&F(),{externalValue:x,checked:I,update:P,check:F,uncheck:k,handleInput:j=>{P(j.target.checked?y.value:p.value)},handleClick:()=>{v.value||(I.value?k():F())}}}(t,e),r=function(o,a,l){const{trueValue:c,falseValue:h,onLabel:p,offLabel:y}=GN(o),v=l.checked,x=l.update;return{label:Jr(()=>{let I=v.value?p.value:y.value;return I||(I=" "),I}),toggle:()=>{x(v.value?h.value:c.value)},on:()=>{x(c.value)},off:()=>{x(h.value)}}}(t,0,{checked:i.checked,update:i.update}),n=function(o,a,l){const c=GN(o),h=c.disabled,p=l.checked,y=Jr(()=>({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",...c.classes.value}));return{classList:Jr(()=>({container:y.value.container,toggle:[y.value.toggle,h.value?p.value?y.value.toggleOnDisabled:y.value.toggleOffDisabled:p.value?y.value.toggleOn:y.value.toggleOff],handle:[y.value.handle,h.value?p.value?y.value.handleOnDisabled:y.value.handleOffDisabled:p.value?y.value.handleOn:y.value.handleOff],label:y.value.label}))}}(t,0,{checked:i.checked}),s=function(o,a,l){const{disabled:c}=GN(o),h=l.check,p=l.uncheck,y=l.checked;return{handleSpace:()=>{c.value||(y.value?p():h())}}}(t,0,{check:i.check,uncheck:i.uncheck,checked:i.checked});return{...i,...n,...r,...s}}};const jhr=["tabindex","aria-checked","aria-describedby","aria-labelledby"],Ghr=["id","name","value","checked","disabled"],Uhr=["innerHTML"],zhr=["checked"];$ke.render=function(t,e,i,r,n,s){return Qt(),hi("div",JX({class:t.classList.container,tabindex:i.disabled?void 0:0,"aria-checked":t.checked,"aria-describedby":i.describedby,"aria-labelledby":i.labelledby,role:"switch"},i.aria,{onKeypress:e[1]||(e[1]=Zh(wa((...o)=>t.handleSpace&&t.handleSpace(...o),["prevent"]),["space"]))}),[Zr(Dt("input",{type:"checkbox",id:i.id,name:i.name,value:i.trueValue,checked:t.checked,disabled:i.disabled},null,8,Ghr),[[vf,!1]]),Dt("div",{class:ms(t.classList.toggle),onClick:e[0]||(e[0]=(...o)=>t.handleClick&&t.handleClick(...o))},[Dt("span",{class:ms(t.classList.handle)},null,2),Xf(t.$slots,"label",{checked:t.checked,classList:t.classList},()=>[Dt("span",{class:ms(t.classList.label),innerHTML:t.label},null,10,Uhr)]),i.required?(Qt(),hi("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:t.checked,"aria-hidden":"true",tabindex:"-1",required:""},null,8,zhr)):fn("v-if",!0)],2)],16,jhr)},$ke.__file="src/Toggle.vue";const Hhr=t=>(eh("data-v-ecf1417a"),t=t(),th(),t),Whr={class:"flex flex-row rv-label"},qhr={class:"flex items-center"},Yhr=["innerHTML"],Xhr=Hhr(()=>Dt("div",{class:"flex-1"},null,-1)),Khr=an({__name:"toggle-switch-control",props:{config:{type:Object,required:!0},name:String,icon:String},emits:["toggled"],setup(t,{emit:e}){const i=t,r=Mi(i.config.value),n=Mi(!!i.config.disabled),s=Mi(0),o=Fl([]);o.push(bu(zue(i,"config"),(l,c)=>{r.value=l.value,n.value=!!l.disabled,s.value+=n.value!==c.disabled?1:0},{deep:!0}));const a=()=>{n.value||(r.value=!r.value,e("toggled",r.value))};return Ll(()=>{o.forEach(l=>l())}),(l,c)=>(Qt(),hi("div",Whr,[Dt("div",qhr,[Dt("div",{innerHTML:t.icon,class:"p-8 pl-0"},null,8,Yhr),ks(" "+xr(t.name),1)]),Xhr,(Qt(),Bn(vi($ke),{onChange:c[0]||(c[0]=h=>e("toggled",h)),onKeyupCapture:[Zh(wa(a,["stop"]),["enter"]),Zh(wa(a,["stop"]),["space"])],disabled:n.value,key:s.value,modelValue:r.value,"onUpdate:modelValue":c[1]||(c[1]=h=>r.value=h),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"]))]))}}),DLr="",Bke=Nl(Khr,[["__scopeId","data-v-ecf1417a"]]),Jhr={key:0},Zhr={key:0},Qhr={key:0},edr={key:0,class:"flex justify-between py-8 px-8 mb-8 bg-gray-100"},tdr={class:"p-8 font-bold break-words"},idr={key:1,class:"p-8 mb-8 bg-gray-100 flex justify-between"},rdr=["innerHTML"],ndr={key:1,class:"flex-initial py-5 px-10"},sdr={key:2,class:"animate-spin spinner h-20 w-20 px-5"},odr={key:1},adr={key:1,class:"p-5"},ldr={key:1,class:"flex justify-center py-10 items-center"},udr=Dt("span",{class:"animate-spin spinner h-20 w-20 px-5 mr-8"},null,-1),cdr={key:2},hdr=an({__name:"result-screen",props:{panel:{type:Object,required:!0},result:{type:Object,required:!0},previousItemIndex:{type:Number,default:-1}},setup(t){const e=t,{t:i}=ns(),r=no("iApi"),n=rk(),s=Jr(()=>n.properties),o=Jr(()=>n.activeGreedy),a=Jr(()=>n.slowLoadingFlag),l=Jr(()=>r.geo.layer.getLayer(e.result.uid)?.nameField),c=Jr(()=>{const V=r.geo.layer.getLayer(e.result.uid);return V&&s.value[V.id]&&s.value[V.id].name?s.value[V.id].name:V?.name??""}),h=Mi([]),p=Mi(!1),y=Mi([]),v=Mi(r.fixture.get("details")),x=Mi(!0);Ja(()=>{p.value=r.geo.layer.getLayer(e.result.uid)!==void 0,x.value=n.hilightToggle??x.value,x.value&&v.value.hilightDetailsItems(e.result.items,e.result.uid),r.updateAlert(r.$i18n.t("details.item.alert.show.list",{layerName:c.value})),y.value.push(r.event.on(cn.LAYER_REMOVE,V=>{e.result.uid===V.uid&&e.panel.close()})),y.value.push(r.event.on(cn.PANEL_CLOSED,V=>{V.id=="details-items"&&I()})),y.value.push(r.event.on(cn.PANEL_MINIMIZED,V=>{V.id=="details-items"&&P()})),y.value.push(r.event.on(cn.MAP_BASEMAPCHANGE,()=>{x.value&&v.value.reloadDetailsHilight(e.result.items,e.result.uid)}))}),Ll(()=>{y.value.forEach(V=>r.event.off(V))});const I=()=>{v.value.removeDetailsHilight(),n.hilightToggle=!0},P=()=>{v.value.removeDetailsHilight()},F=V=>{e.panel.show({screen:"item-screen",props:{result:e.result,itemIndex:V}})},k=(V,Y)=>{const X=r.geo.layer.getLayer(e.result.uid);if(X===void 0){console.warn(`could not find layer for uid ${e.result.uid} during icon lookup`);return}const Z=X.oidField;return X.getIcon(V[Z]).then(ie=>{h.value[Y]!==ie&&(h.value[Y]=ie)}),h.value[Y]},j=V=>{x.value=V,v.value.onHilightToggle(V,e.result.items,e.result.uid)};return(V,Y)=>{const X=Vo("panel-screen"),Z=as("truncate"),ie=as("focus-item");return Qt(),Bn(X,{panel:t.panel},{header:En(()=>[ks(xr(vi(i)("details.items.title")),1)]),content:En(()=>[t.result.loaded&&o.value===0?(Qt(),hi("div",Jhr,[p.value?(Qt(),hi("div",Zhr,[t.result.items.length>0?(Qt(),hi("div",Qhr,[p.value?(Qt(),hi("div",edr,[Dt("div",tdr,xr(c.value),1)])):fn("",!0),v.value.hasHilighter()?(Qt(),hi("div",idr,[Dt("div",null,xr(vi(i)("details.togglehilight.title")),1),Un(Bke,{config:{value:x.value,disabled:!1},onToggled:j},null,8,["config"])])):fn("",!0),(Qt(!0),hi(po,null,fu(t.result.items,(ce,he,_e,xe)=>{const Pe=[h.value[he]];if(xe&&xe.key===he&&gce(xe,Pe))return xe;const ke=Zr((Qt(),hi("button",{type:"button",class:"w-full flex px-16 py-10 text-md hover:bg-gray-200 cursor-pointer",key:he,onClick:J=>ce.loaded&&F(he),disabled:!ce.loaded},[ce.loaded?(Qt(),hi("span",{key:0,innerHTML:k(ce.data,he),class:"flex-none symbologyIcon"},null,8,rdr)):fn("",!0),ce.loaded?Zr((Qt(),hi("span",ndr,[ks(xr(l.value?ce.data[l.value]:vi(i)("details.result.default.name",[he+1])),1)])),[[Z]]):fn("",!0),ce.loaded?fn("",!0):(Qt(),hi("span",sdr))],8,["onClick","disabled"])),[[ie],[Z]]);return ke.memo=Pe,ke},Y,0),128))])):(Qt(),hi("div",odr,xr(vi(i)("details.layers.results.empty")),1))])):(Qt(),hi("div",adr,xr(vi(i)("details.item.no.data")),1))])):a.value?(Qt(),hi("div",ldr,[udr,ks(" "+xr(vi(i)("details.item.loading")),1)])):(Qt(),hi("div",cdr))]),_:1},8,["panel"])}}}),ddr={class:"inline font-bold"},pdr=Dt("span",{class:"flex-auto"},null,-1),fdr=["innerHTML"],mdr=an({__name:"esri-default",props:{fields:{type:Object,required:!0},identifyData:{type:Object,required:!0}},setup(t){const e=t,{t:i}=ns(),r=no("iApi"),n=()=>{const l={};Object.assign(l,e.identifyData.data),r?.ui.exposeOids||delete l[e.fields.find(h=>h.type==="oid").name],l.Symbol!==void 0&&delete l.Symbol;let c={};return e.fields.forEach(h=>{c[h.name]={name:h.alias||h.name,type:h.type}}),Object.keys(l).map(h=>{l[h]={value:typeof l[h]=="number"?r?.$i18n.n(l[h],"number"):l[h],alias:c[h].name||h,type:c[h].type}}),l},s=(l,c,h)=>{switch(h){case"date":return a(l);default:return o(l,c)}},o=(l,c)=>{if(!l)return l;if(l.trim().match(/\.(jpeg|jpg|gif|png)$/)||l.trim().match(/^\s*data:([a-z]+\/[a-z]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i))return`${i(`;const h="underline text-blue-600 break-all",p=document.createElement("div");return p.innerHTML=l.trim(),p.firstElementChild?.tagName=="A"?(p.firstElementChild.className=h,p.innerHTML):q3e(l,{className:h,target:"_blank",validate:{url:v=>/^https?:\/\//.test(v)}})},a=l=>{const c=parseInt(l);return isNaN(c)?l:new Date(c).toISOString().split("T")[0]};return(l,c)=>(Qt(),hi("div",null,[(Qt(!0),hi(po,null,fu(n(),(h,p,y)=>(Qt(),hi("div",{class:"p-5 pl-3 flex justify-end flex-wrap even:bg-gray-300",key:y},[Dt("span",ddr,xr(h.alias),1),pdr,Dt("span",{class:"inline",innerHTML:s(h.value,h.alias,h.type)},null,8,fdr)]))),128))]))}}),gdr=["innerHTML"],ydr={key:1},vdr=an({__name:"html-default",props:{identifyData:{type:Object,required:!0}},setup(t){const{t:e}=ns();return(i,r)=>t.identifyData?(Qt(),hi("div",{key:0,class:"whitespace-pre-wrap break-words h-full overflow-auto",innerHTML:t.identifyData.data.data??t.identifyData.data},null,8,gdr)):(Qt(),hi("div",ydr,xr(vi(e)("details.layers.results.empty")),1))}}),_dr={key:0},bdr={key:0,class:"p-8 font-bold break-words mb-8 bg-gray-100"},wdr={key:1,class:"p-8 mb-8 bg-gray-100 flex justify-between"},xdr={key:2,class:"flex flex-col justify-between p-8 mb-8 bg-gray-100"},Sdr={class:"flex justify-between"},Cdr=["aria-label"],Tdr={class:"flex bg-gray-200 py-8 items-center"},Edr=["content","aria-label","disabled"],Idr=[Dt("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[Dt("g",null,[Dt("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)],Adr={class:"px-8"},Pdr=["content","aria-label","disabled"],Odr=[Dt("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[Dt("g",null,[Dt("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)],Rdr={key:3},Mdr={key:0},Ddr={key:0,class:"flex py-8 items-center"},Fdr=["innerHTML"],Ldr={key:1},Ndr=[Dt("div",{class:"animate-spin spinner h-20 w-20"},null,-1)],kdr={class:"flex-grow my-auto text-lg px-8"},$dr=["content","aria-label"],Bdr={key:0,class:"m-auto animate-spin spinner h-20 w-20"},Vdr={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"},jdr=[Dt("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)],Gdr={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"},Udr=[Dt("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)],zdr=["innerHTML"],Hdr={key:1,class:"flex justify-center py-10 items-center"},Wdr=Dt("span",{class:"animate-spin spinner h-20 w-20 px-5 mr-8"},null,-1),qdr={key:4,class:"p-5"},Ydr={key:1,class:"flex justify-center py-10 items-center"},Xdr=Dt("span",{class:"animate-spin spinner h-20 w-20 px-5 mr-8"},null,-1),Kdr={key:2},Jdr=an({__name:"item-screen",props:{panel:{type:Object,required:!0},result:{type:Object,required:!0},itemIndex:{type:Number,default:0}},setup(t){const e=t,{t:i}=ns(),r=no("iApi"),n=rk(),s=Jr(()=>n.defaultTemplates),o=Jr(()=>n.properties),a=Jr(()=>n.activeGreedy),l=Jr(()=>n.slowLoadingFlag),c=Jr(()=>e.result.items[k.value]),h=Jr(()=>{const Re=r.geo.layer.getLayer(e.result.uid)?.nameField;return Re&&c.value.loaded?c.value.data[Re]:r.$i18n.t("details.items.title")}),p=Jr(()=>{const Ie=r.geo.layer.getLayer(e.result.uid);return Ie&&o.value[Ie.id]&&o.value[Ie.id].name?o.value[Ie.id].name:Ie?.name??""}),y=Jr(()=>r.geo.layer.getLayer(e.result.uid)?.supportsFeatures??!1),v=Jr(()=>r.geo.layer.getLayer(e.result.uid)?.mapLayer??!1),x=Jr(()=>y.value?r.geo.layer.getLayer(e.result.uid)?.fields||[]:[]),I=Jr(()=>{const Ie=r.geo.layer.getLayer(e.result.uid);return Ie&&o.value[Ie.id]&&o.value[Ie.id].template?o.value[Ie.id].template:s.value&&s.value[c.value.format]?s.value[c.value.format]:y.value?mdr:vdr}),P=Mi(""),F=Mi("none"),k=Mi(0),j=Mi(!1),V=Mi([]),Y=Mi(r.fixture.get("details")),X=Mi(!0),Z=Mi(),ie=()=>{Y.value.removeDetailsHilight(),n.hilightToggle=!0},ce=()=>{Y.value.removeDetailsHilight()},he=()=>{k.value=e.itemIndex??0,j.value=!0,X.value=n.hilightToggle??X.value,_e()},_e=()=>{if(Pe("none"),c.value.loaded)r.geo.layer.getLayer(e.result.uid)||(j.value=!1),J(),r.updateAlert(`${r.$i18n.t("details.item.alert.show.item",{itemName:h.value})} ${e.result.items.length>1?r.$i18n.t("details.item.count",[k.value+1,e.result.items.length]):""}`),X.value&&y.value&&v.value?Y.value.hilightDetailsItems(e.result.items[k.value],e.result.uid):(!y.value||!v.value)&&Y.value.removeDetailsHilight();else{const Ie=k.value;c.value.loading.then(()=>{Ie===k.value&&_e()})}},xe=()=>{e.panel.show({screen:"results-screen",props:{result:e.result,previousItemIndex:k.value}})},Pe=Ie=>{Ie==="zoomed"||Ie==="error"?setTimeout(()=>{F.value=Ie,Z.value?._tippy.show(),setTimeout(()=>{Z.value?._tippy.hide(),F.value="none"},3e3)},300):F.value=Ie},ke=Ie=>{k.value+=Ie,_e()},J=()=>{if(P.value="",!(c.value&&c.value.loaded))return;const Ie=r.geo.layer.getLayer(e.result.uid);if(Ie===void 0){console.warn(`could not find layer for uid ${e.result.uid} during icon lookup`);return}if(Ie.supportsFeatures){const Re=Ie.oidField;let Oe=k.value;Ie.getIcon(c.value.data[Re]).then(Ge=>{k.value===Oe&&(P.value=Ge)})}},de=()=>{if(F.value!=="none")return;Pe("zooming");const Ie=r.geo.layer.getLayer(e.result.uid);if(Ie===void 0||!Ie.isLoaded){console.warn(`Could not find layer for uid ${e.result.uid} during zoom geometry lookup`),Pe("error");return}if(!c.value.loaded){console.warn("Details zoomToFeature call on item that is still loading. Should be impossible, alert the devs."),Pe("error");return}const Re=c.value.data[Ie.oidField],Oe=()=>{const Ge={getGeom:!0};Ie.getGraphic(Re,Ge).then(Be=>{Be.geometry.invalid()?(console.error(`Could not find graphic for objectid ${Re}`),Pe("error")):(r.geo.map.zoomMapTo(Be.geometry),Pe("zoomed"),r.updateAlert(r.$i18n.t("details.item.alert.zoom")))}).catch(()=>{Pe("error")})};Ie.layerType===_n.FEATURE&&Ie.geomType!==pl.POINT?Ie.getGraphicExtent(Re).then(Ge=>{r.geo.map.zoomMapTo(Ge),Pe("zoomed"),r.updateAlert(r.$i18n.t("details.item.alert.zoom"))}).catch(()=>{Oe()}):Oe()},Se=Ie=>{X.value=Ie,Y.value.onHilightToggle(Ie,e.result.items[k.value],e.result.uid)};return Ja(()=>{he(),V.value.push(r.event.on(cn.LAYER_REMOVE,Ie=>{e.result.uid===Ie.uid&&e.panel.close()})),V.value.push(r.event.on(cn.PANEL_CLOSED,Ie=>{Ie.id=="details-items"&&ie()})),V.value.push(r.event.on(cn.PANEL_MINIMIZED,Ie=>{Ie.id=="details-items"&&ce()})),V.value.push(r.event.on(cn.MAP_BASEMAPCHANGE,()=>{X.value&&Y.value.reloadDetailsHilight(e.result.items[k.value],e.result.uid)}))}),Ll(()=>{V.value.forEach(Ie=>r.event.off(Ie))}),ice(()=>{he()}),(Ie,Re)=>{const Oe=Vo("panel-screen"),Ge=as("tippy");return Qt(),Bn(Oe,{panel:t.panel},{header:En(()=>[ks(xr(vi(i)("details.items.title")),1)]),content:En(()=>[t.result.loaded&&a.value===0?(Qt(),hi("div",_dr,[j.value?(Qt(),hi("div",bdr,xr(p.value),1)):fn("",!0),Y.value.hasHilighter()&&y.value&&v.value?(Qt(),hi("div",wdr,[Dt("div",null,xr(vi(i)("details.togglehilight.title")),1),Un(Bke,{config:{value:X.value,disabled:!1},onToggled:Se},null,8,["config"])])):fn("",!0),j.value&&t.result.items.length>1?(Qt(),hi("div",xdr,[Dt("div",Sdr,[Dt("button",{type:"button",class:"px-8 font-bold hover:bg-gray-200 focus:bg-gray-200","aria-label":vi(i)("details.item.see.list"),onClick:xe},xr(vi(i)("details.item.see.list")),9,Cdr),Dt("div",Tdr,[Zr((Qt(),hi("button",{type:"button",content:vi(i)("details.item.previous.item"),onClick:Re[0]||(Re[0]=Be=>ke(-1)),class:"mx-2 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":vi(i)("details.item.previous.item"),disabled:k.value===0},Idr,8,Edr)),[[Ge,{placement:"top"}]]),Dt("span",Adr,xr(vi(i)("details.item.count",[k.value+1,t.result.items.length])),1),Zr((Qt(),hi("button",{type:"button",content:vi(i)("details.item.next.item"),onClick:Re[1]||(Re[1]=Be=>ke(1)),class:"mx-2 rotate-180 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":vi(i)("details.item.next.item"),disabled:k.value===t.result.items.length-1},Odr,8,Pdr)),[[Ge,{placement:"top"}]])])])])):fn("",!0),j.value?(Qt(),hi("div",Rdr,[c.value.loaded?(Qt(),hi("div",Mdr,[y.value?(Qt(),hi("div",Ddr,[P.value?(Qt(),hi("span",{key:0,class:"flex-none symbologyIcon",innerHTML:P.value},null,8,Fdr)):(Qt(),hi("div",Ldr,Ndr)),Dt("span",kdr,xr(h.value),1),v.value?Zr((Qt(),hi("button",{key:2,type:"button",content:vi(i)(`details.item.zoom${F.value==="none"?"":`.${F.value}`}`),"aria-label":vi(i)(`grid.cells.zoom${F.value==="none"?"":`.${F.value}`}`),ref_key:"button",ref:Z,onClick:Re[2]||(Re[2]=Be=>de()),class:"text-gray-600 m-8 w-24 h-24 p-2"},[F.value==="zooming"?(Qt(),hi("div",Bdr)):F.value==="zoomed"?(Qt(),hi("svg",Vdr,jdr)):F.value==="error"?(Qt(),hi("svg",Gdr,Udr)):(Qt(),hi("span",{key:3,innerHTML:vi(r).ui.getZoomIcon()},null,8,zdr))],8,$dr)),[[Ge,{placement:"bottom"}]]):fn("",!0)])):fn("",!0),(Qt(),Bn(TP(I.value),{identifyData:c.value,fields:x.value},null,8,["identifyData","fields"]))])):(Qt(),hi("div",Hdr,[Wdr,ks(" "+xr(vi(i)("details.item.loading")),1)]))])):(Qt(),hi("div",qdr,xr(vi(i)("details.item.no.data")),1))])):l.value?(Qt(),hi("div",Ydr,[Xdr,ks(" "+xr(vi(i)("details.item.loading")),1)])):(Qt(),hi("div",Kdr))]),_:1},8,["panel"])}}}),BLr="",Zdr={en:{"details.layers.title":"Identified Layers","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 the selected layer.","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"},fr:{"details.layers.title":"Couches désignées","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 la couche sélectionnée.","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...","details.item.zoom.error":"Échec du zoom","details.item.zoom.zoomed":"Zoomé","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"}};class Qdr extends Phr{async added(){this.$iApi.panel.register({"details-layers":{screens:{"layers-screen":ya(Vhr)},style:{width:"350px"},button:{tooltip:"details.layers.title",icon:''},alertName:"details.layers.title"},"details-items":{screens:{"results-screen":ya(hdr),"item-screen":ya(Jdr)},style:{width:"350px"},button:{tooltip:"details.items.title",icon:''},alertName:"details.items.title"}},{i18n:{messages:Zdr}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,i=>this._parseConfig(i));this.removed=()=>{if(e(),this.$iApi.panel.remove("details-layers"),this.$iApi.panel.remove("details-items"),this.$iApi.fixture.get("appbar")){const r=mg(this.$vApp.$pinia);r.removeButton("details-layers"),r.removeButton("details-items")}rk(this.$vApp.$pinia).$reset()}}}const epr=Object.freeze(Object.defineProperty({__proto__:null,default:Qdr},Symbol.toStringTag,{value:"Module"}));var Nd={};const Vke=lue(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));(function(t){/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */var e=e||{version:"5.3.0"};if(t.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 i=Vke,r=new i.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=Vke.implForWrapper,e.nodeCanvas=Vke.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(v,x){if(this.__eventListeners[v]){var I=this.__eventListeners[v];x?I[I.indexOf(x)]=!1:e.util.array.fill(I,!1)}}function l(v,x){if(this.__eventListeners||(this.__eventListeners={}),arguments.length===1)for(var I in v)this.on(I,v[I]);else this.__eventListeners[v]||(this.__eventListeners[v]=[]),this.__eventListeners[v].push(x);return this}function c(v,x){var I=function(){x.apply(this,arguments),this.off(v,I)}.bind(this);this.on(v,I)}function h(v,x){if(arguments.length===1)for(var I in v)c.call(this,I,v[I]);else c.call(this,v,x);return this}function p(v,x){if(!this.__eventListeners)return this;if(arguments.length===0)for(v in this.__eventListeners)a.call(this,v);else if(arguments.length===1&&typeof arguments[0]=="object")for(var I in v)a.call(this,I,v[I]);else a.call(this,v,x);return this}function y(v,x){if(!this.__eventListeners)return this;var I=this.__eventListeners[v];if(!I)return this;for(var P=0,F=I.length;P"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(c){return typeof c.contains=="function"&&c.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,c){a&&a.source&&!(a instanceof e.Pattern)?this.set(l,new e.Pattern(a,c)):c&&c()},_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,c=Math.atan2,h=Math.pow,p=Math.PI/180,y=Math.PI/2;e.util={cos:function(v){if(v===0)return 1;v<0&&(v=-v);var x=v/y;switch(x){case 1:case 3:return 0;case 2:return-1}return Math.cos(v)},sin:function(v){if(v===0)return 0;var x=v/y,I=1;switch(v<0&&(I=-1),x){case 1:return I;case 2:return 0;case 3:return-I}return Math.sin(v)},removeFromArray:function(v,x){var I=v.indexOf(x);return I!==-1&&v.splice(I,1),v},getRandomInt:function(v,x){return Math.floor(Math.random()*(x-v+1))+v},degreesToRadians:function(v){return v*p},radiansToDegrees:function(v){return v/p},rotatePoint:function(v,x,I){var P=new e.Point(v.x-x.x,v.y-x.y),F=e.util.rotateVector(P,I);return new e.Point(F.x,F.y).addEquals(x)},rotateVector:function(v,x){var I=e.util.sin(x),P=e.util.cos(x),F=v.x*P-v.y*I,k=v.x*I+v.y*P;return{x:F,y:k}},createVector:function(v,x){return new e.Point(x.x-v.x,x.y-v.y)},calcAngleBetweenVectors:function(v,x){return Math.acos((v.x*x.x+v.y*x.y)/(Math.hypot(v.x,v.y)*Math.hypot(x.x,x.y)))},getHatVector:function(v){return new e.Point(v.x,v.y).multiply(1/Math.hypot(v.x,v.y))},getBisector:function(v,x,I){var P=e.util.createVector(v,x),F=e.util.createVector(v,I),k=e.util.calcAngleBetweenVectors(P,F),j=e.util.calcAngleBetweenVectors(e.util.rotateVector(P,k),F),V=k*(j===0?1:-1)/2;return{vector:e.util.getHatVector(e.util.rotateVector(P,V)),angle:k}},projectStrokeOnPoints:function(v,x,I){var P=[],F=x.strokeWidth/2,k=x.strokeUniform?new e.Point(1/x.scaleX,1/x.scaleY):new e.Point(1,1),j=function(V){var Y=F/Math.hypot(V.x,V.y);return new e.Point(V.x*Y*k.x,V.y*Y*k.y)};return v.length<=1||v.forEach(function(V,Y){var X=new e.Point(V.x,V.y),Z,ie;Y===0?(ie=v[Y+1],Z=I?j(e.util.createVector(ie,X)).addEquals(X):v[v.length-1]):Y===v.length-1?(Z=v[Y-1],ie=I?j(e.util.createVector(Z,X)).addEquals(X):v[0]):(Z=v[Y-1],ie=v[Y+1]);var ce=e.util.getBisector(X,Z,ie),he=ce.vector,_e=ce.angle,xe,Pe;if(x.strokeLineJoin==="miter"&&(xe=-F/Math.sin(_e/2),Pe=new e.Point(he.x*xe*k.x,he.y*xe*k.y),Math.hypot(Pe.x,Pe.y)/F<=x.strokeMiterLimit)){P.push(X.add(Pe)),P.push(X.subtract(Pe));return}xe=-F*Math.SQRT2,Pe=new e.Point(he.x*xe*k.x,he.y*xe*k.y),P.push(X.add(Pe)),P.push(X.subtract(Pe))}),P},transformPoint:function(v,x,I){return I?new e.Point(x[0]*v.x+x[2]*v.y,x[1]*v.x+x[3]*v.y):new e.Point(x[0]*v.x+x[2]*v.y+x[4],x[1]*v.x+x[3]*v.y+x[5])},makeBoundingBoxFromPoints:function(v,x){if(x)for(var I=0;I"u"?1:v.scaleX,I=typeof v.scaleY>"u"?1:v.scaleY,P=[v.flipX?-x:x,0,0,v.flipY?-I:I,0,0],F=e.util.multiplyTransformMatrices,k=e.util.degreesToRadians;return v.skewX&&(P=F(P,[1,0,Math.tan(k(v.skewX)),1],!0)),v.skewY&&(P=F(P,[1,Math.tan(k(v.skewY)),0,1],!0)),P},composeMatrix:function(v){var x=[1,0,0,1,v.translateX||0,v.translateY||0],I=e.util.multiplyTransformMatrices;return v.angle&&(x=I(x,e.util.calcRotateMatrix(v))),(v.scaleX!==1||v.scaleY!==1||v.skewX||v.skewY||v.flipX||v.flipY)&&(x=I(x,e.util.calcDimensionsMatrix(v))),x},resetObjectTransform:function(v){v.scaleX=1,v.scaleY=1,v.skewX=0,v.skewY=0,v.flipX=!1,v.flipY=!1,v.rotate(0)},saveObjectTransform:function(v){return{scaleX:v.scaleX,scaleY:v.scaleY,skewX:v.skewX,skewY:v.skewY,angle:v.angle,left:v.left,flipX:v.flipX,flipY:v.flipY,top:v.top}},isTransparent:function(v,x,I,P){P>0&&(x>P?x-=P:x=0,I>P?I-=P:I=0);var F=!0,k,j,V=v.getImageData(x,I,P*2||1,P*2||1),Y=V.data.length;for(k=3;k0){var Z=e.util.hasStyleChanged(k,X,!0);Z?j.push({start:F,end:F+1,style:X}):j[j.length-1].end++}k=X||{}}}return j},stylesFromArray:function(v,x){if(!Array.isArray(v))return v;for(var I=x.split(` +`),P=-1,F=0,k={},j=0;j0?ze-=2*mt:et===1&&ze<0&&(ze+=2*mt);for(var Ot=Math.ceil(Math.abs(ze/mt*2)),jt=[],nt=ze/Ot,$e=8/3*Math.sin(nt/4)*Math.sin(nt/4)/Math.sin(nt/2),Xt=gt+nt,A=0;A=qe?et-qe:2*Math.PI-(qe-et)}function v(Re,Oe,Ge,Be,qe,et,Ze,mt){var Pt;if(e.cachesBoundsOfCurve&&(Pt=a.call(arguments),e.boundsOfCurveCache[Pt]))return e.boundsOfCurveCache[Pt];var $t=Math.sqrt,Ct=Math.min,Et=Math.max,Ft=Math.abs,ot=[],Te=[[],[]],je,pt,kt,ct,ae,ht,wt,Ne;pt=6*Re-12*Ge+6*qe,je=-3*Re+9*Ge-9*qe+3*Ze,kt=3*Ge-3*Re;for(var pe=0;pe<2;++pe){if(pe>0&&(pt=6*Oe-12*Be+6*et,je=-3*Oe+9*Be-9*et+3*mt,kt=3*Be-3*Oe),Ft(je)<1e-12){if(Ft(pt)<1e-12)continue;ct=-kt/pt,01e-4;)Ze=qe(Ge),Ct=Ge,mt=P(et.x,et.y,Ze.x,Ze.y),mt+Be>Oe?(Ge-=Pt,Pt/=2):(et=Ze,Ge+=Pt,Be+=mt);return Ze.angle=$t(Ct),Ze}function ke(Re){for(var Oe=0,Ge=Re.length,Be,qe=0,et=0,Ze=0,mt=0,Pt=[],$t,Ct,Et,Ft=0;Ft0&&Bewt)for(var pe=1,Ae=je.length;pe2;for(Oe=Oe||0,$t&&(mt=Re[2].xRe[Be-2].x?1:qe.x===Re[Be-2].x?0:-1,Pt=qe.y>Re[Be-2].y?1:qe.y===Re[Be-2].y?0:-1),Ge.push(["L",qe.x+mt*Oe,qe.y+Pt*Oe]),Ge}function Ie(Re,Oe,Ge){return Ge&&(Oe=e.util.multiplyTransformMatrices(Oe,[1,0,0,1,-Ge.x,-Ge.y])),Re.map(function(Be){for(var qe=Be.slice(0),et={},Ze=1;Ze=P})}function h(v,x){return y(v,x,function(I,P){return I/g,">")}function h(y){var v=0,x,I=[];for(v=0,x;v57343)return y.charAt(v);if(55296<=x&&x<=56319){if(y.length<=v+1)throw"High surrogate without following low surrogate";var I=y.charCodeAt(v+1);if(56320>I||I>57343)throw"High surrogate without following low surrogate";return y.charAt(v)+y.charAt(v+1)}if(v===0)throw"Low surrogate without preceding high surrogate";var P=y.charCodeAt(v-1);if(55296>P||P>56319)throw"Low surrogate without preceding high surrogate";return!1}e.util.string={camelize:a,capitalize:l,escapeXml:c,graphemeSplit:h}}(),function(){var a=Array.prototype.slice,l=function(){},c=function(){for(var x in{toString:1})if(x==="toString")return!1;return!0}(),h=function(x,I,P){for(var F in I)F in x.prototype&&typeof x.prototype[F]=="function"&&(I[F]+"").indexOf("callSuper")>-1?x.prototype[F]=function(k){return function(){var j=this.constructor.superclass;this.constructor.superclass=P;var V=I[k].apply(this,arguments);if(this.constructor.superclass=j,k!=="initialize")return V}}(F):x.prototype[F]=I[F],c&&(I.toString!==Object.prototype.toString&&(x.prototype.toString=I.toString),I.valueOf!==Object.prototype.valueOf&&(x.prototype.valueOf=I.valueOf))};function p(){}function y(x){for(var I=null,P=this;P.constructor.superclass;){var F=P.constructor.superclass.prototype[x];if(P[x]!==F){I=F;break}P=P.constructor.superclass.prototype}return I?arguments.length>1?I.apply(this,a.call(arguments,1)):I.call(this):console.log("tried to callSuper "+x+", method not found in prototype chain",this)}function v(){var x=null,I=a.call(arguments,0);typeof I[0]=="function"&&(x=I.shift());function P(){this.initialize.apply(this,arguments)}P.superclass=x,P.subclasses=[],x&&(p.prototype=x.prototype,P.prototype=new p,x.subclasses.push(P));for(var F=0,k=I.length;F-1||h.pointerType==="touch"}}(),function(){function a(v,x){var I=v.style;if(!I)return v;if(typeof x=="string")return v.style.cssText+=";"+x,x.indexOf("opacity")>-1?y(v,x.match(/opacity:\s*(\d?\.?\d*)/)[1]):v;for(var P in x)if(P==="opacity")y(v,x[P]);else{var F=P==="float"||P==="cssFloat"?typeof I.styleFloat>"u"?"cssFloat":"styleFloat":P;I.setProperty(F,x[P])}return v}var l=e.document.createElement("div"),c=typeof l.style.opacity=="string",h=typeof l.style.filter=="string",p=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,y=function(v){return v};c?y=function(v,x){return v.style.opacity=x,v}:h&&(y=function(v,x){var I=v.style;return v.currentStyle&&!v.currentStyle.hasLayout&&(I.zoom=1),p.test(I.filter)?(x=x>=.9999?"":"alpha(opacity="+x*100+")",I.filter=I.filter.replace(p,x)):I.filter+=" alpha(opacity="+x*100+")",v}),e.util.setStyle=a}(),function(){var a=Array.prototype.slice;function l(V){return typeof V=="string"?e.document.getElementById(V):V}var c,h=function(V){return a.call(V,0)};try{c=h(e.document.childNodes)instanceof Array}catch{}c||(h=function(V){for(var Y=new Array(V.length),X=V.length;X--;)Y[X]=V[X];return Y});function p(V,Y){var X=e.document.createElement(V);for(var Z in Y)Z==="class"?X.className=Y[Z]:Z==="for"?X.htmlFor=Y[Z]:X.setAttribute(Z,Y[Z]);return X}function y(V,Y){V&&(" "+V.className+" ").indexOf(" "+Y+" ")===-1&&(V.className+=(V.className?" ":"")+Y)}function v(V,Y,X){return typeof Y=="string"&&(Y=p(Y,X)),V.parentNode&&V.parentNode.replaceChild(Y,V),Y.appendChild(V),Y}function x(V){for(var Y=0,X=0,Z=e.document.documentElement,ie=e.document.body||{scrollLeft:0,scrollTop:0};V&&(V.parentNode||V.host)&&(V=V.parentNode||V.host,V===e.document?(Y=ie.scrollLeft||Z.scrollLeft||0,X=ie.scrollTop||Z.scrollTop||0):(Y+=V.scrollLeft||0,X+=V.scrollTop||0),!(V.nodeType===1&&V.style.position==="fixed")););return{left:Y,top:X}}function I(V){var Y,X=V&&V.ownerDocument,Z={left:0,top:0},ie={left:0,top:0},ce,he={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!X)return ie;for(var _e in he)ie[he[_e]]+=parseInt(P(V,_e),10)||0;return Y=X.documentElement,typeof V.getBoundingClientRect<"u"&&(Z=V.getBoundingClientRect()),ce=x(V),{left:Z.left+ce.left-(Y.clientLeft||0)+ie.left,top:Z.top+ce.top-(Y.clientTop||0)+ie.top}}var P;e.document.defaultView&&e.document.defaultView.getComputedStyle?P=function(V,Y){var X=e.document.defaultView.getComputedStyle(V,null);return X?X[Y]:void 0}:P=function(V,Y){var X=V.style[Y];return!X&&V.currentStyle&&(X=V.currentStyle[Y]),X},function(){var V=e.document.documentElement.style,Y="userSelect"in V?"userSelect":"MozUserSelect"in V?"MozUserSelect":"WebkitUserSelect"in V?"WebkitUserSelect":"KhtmlUserSelect"in V?"KhtmlUserSelect":"";function X(ie){return typeof ie.onselectstart<"u"&&(ie.onselectstart=e.util.falseFunction),Y?ie.style[Y]="none":typeof ie.unselectable=="string"&&(ie.unselectable="on"),ie}function Z(ie){return typeof ie.onselectstart<"u"&&(ie.onselectstart=null),Y?ie.style[Y]="":typeof ie.unselectable=="string"&&(ie.unselectable=""),ie}e.util.makeElementUnselectable=X,e.util.makeElementSelectable=Z}();function F(V){var Y=e.jsdomImplForWrapper(V);return Y._canvas||Y._image}function k(V){if(e.isLikelyNode){var Y=e.jsdomImplForWrapper(V);Y&&(Y._image=null,Y._canvas=null,Y._currentSrc=null,Y._attributes=null,Y._classList=null)}}function j(V,Y){V.imageSmoothingEnabled=V.imageSmoothingEnabled||V.webkitImageSmoothingEnabled||V.mozImageSmoothingEnabled||V.msImageSmoothingEnabled||V.oImageSmoothingEnabled,V.imageSmoothingEnabled=Y}e.util.setImageSmoothing=j,e.util.getById=l,e.util.toArray=h,e.util.addClass=y,e.util.makeElement=p,e.util.wrapElement=v,e.util.getScrollLeftTop=x,e.util.getElementOffset=I,e.util.getNodeCanvas=F,e.util.cleanUpJsdomNode=k}(),function(){function a(h,p){return h+(/\?/.test(h)?"&":"?")+p}function l(){}function c(h,p){p||(p={});var y=p.method?p.method.toUpperCase():"GET",v=p.onComplete||function(){},x=new e.window.XMLHttpRequest,I=p.body||p.parameters;return x.onreadystatechange=function(){x.readyState===4&&(v(x),x.onreadystatechange=l)},y==="GET"&&(I=null,typeof p.parameters=="string"&&(h=a(h,p.parameters))),x.open(y,h,!0),(y==="POST"||y==="PUT")&&x.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),x.send(I),x}e.util.request=c}(),e.log=console.log,e.warn=console.warn,function(){var a=e.util.object.extend,l=e.util.object.clone,c=[];e.util.object.extend(c,{cancelAll:function(){var F=this.splice(0);return F.forEach(function(k){k.cancel()}),F},cancelByCanvas:function(F){if(!F)return[];var k=this.filter(function(j){return typeof j.target=="object"&&j.target.canvas===F});return k.forEach(function(j){j.cancel()}),k},cancelByTarget:function(F){var k=this.findAnimationsByTarget(F);return k.forEach(function(j){j.cancel()}),k},findAnimationIndex:function(F){return this.indexOf(this.findAnimation(F))},findAnimation:function(F){return this.find(function(k){return k.cancel===F})},findAnimationsByTarget:function(F){return F?this.filter(function(k){return k.target===F}):[]}});function h(){return!1}function p(F,k,j,V){return-j*Math.cos(F/V*(Math.PI/2))+j+k}function y(F){F||(F={});var k=!1,j,V=function(){var Y=e.runningAnimations.indexOf(j);return Y>-1&&e.runningAnimations.splice(Y,1)[0]};return j=a(l(F),{cancel:function(){return k=!0,V()},currentValue:"startValue"in F?F.startValue:0,completionRate:0,durationRate:0}),e.runningAnimations.push(j),I(function(Y){var X=Y||+new Date,Z=F.duration||500,ie=X+Z,ce,he=F.onChange||h,_e=F.abort||h,xe=F.onComplete||h,Pe=F.easing||p,ke="startValue"in F?F.startValue.length>0:!1,J="startValue"in F?F.startValue:0,de="endValue"in F?F.endValue:100,Se=F.byValue||(ke?J.map(function(Ie,Re){return de[Re]-J[Re]}):de-J);F.onStart&&F.onStart(),function Ie(Re){ce=Re||+new Date;var Oe=ce>ie?Z:ce-X,Ge=Oe/Z,Be=ke?J.map(function(et,Ze){return Pe(Oe,J[Ze],Se[Ze],Z)}):Pe(Oe,J,Se,Z),qe=Math.abs(ke?(Be[0]-J[0])/Se[0]:(Be-J)/Se);if(j.currentValue=ke?Be.slice():Be,j.completionRate=qe,j.durationRate=Ge,!k){if(_e(Be,qe,Ge)){V();return}if(ce>ie){j.currentValue=ke?de.slice():de,j.completionRate=1,j.durationRate=1,he(ke?de.slice():de,1,1),xe(de,1,1),V();return}else he(Be,qe,Ge),I(Ie)}}(X)}),j.cancel}var v=e.window.requestAnimationFrame||e.window.webkitRequestAnimationFrame||e.window.mozRequestAnimationFrame||e.window.oRequestAnimationFrame||e.window.msRequestAnimationFrame||function(F){return e.window.setTimeout(F,1e3/60)},x=e.window.cancelAnimationFrame||e.window.clearTimeout;function I(){return v.apply(e.window,arguments)}function P(){return x.apply(e.window,arguments)}e.util.animate=y,e.util.requestAnimFrame=I,e.util.cancelAnimFrame=P,e.runningAnimations=c}(),function(){function a(c,h,p){var y="rgba("+parseInt(c[0]+p*(h[0]-c[0]),10)+","+parseInt(c[1]+p*(h[1]-c[1]),10)+","+parseInt(c[2]+p*(h[2]-c[2]),10);return y+=","+(c&&h?parseFloat(c[3]+p*(h[3]-c[3])):1),y+=")",y}function l(c,h,p,y){var v=new e.Color(c).getSource(),x=new e.Color(h).getSource(),I=y.onComplete,P=y.onChange;return y=y||{},e.util.animate(e.util.object.extend(y,{duration:p||500,startValue:v,endValue:x,byValue:x,easing:function(F,k,j,V){var Y=y.colorEasing?y.colorEasing(F,V):1-Math.cos(F/V*(Math.PI/2));return a(k,j,Y)},onComplete:function(F,k,j){if(I)return I(a(x,x,0),k,j)},onChange:function(F,k,j){if(P){if(Array.isArray(F))return P(a(F,F,0),k,j);P(F,k,j)}}}))}e.util.animateColor=l}(),function(){function a(Re,Oe,Ge,Be){return Re-1&&Ft>-1&&Ft-1)&&(Ze="stroke")}else{if(et==="href"||et==="xlink:href"||et==="font")return Ze;if(et==="imageSmoothing")return Ze==="optimizeQuality";Ct=$t?Ze.map(y):y(Ze,Pt)}}return!$t&&isNaN(Ct)?Ze:Ct}function ie(et){return new RegExp("^("+et.join("|")+")\\b","i")}function ce(et){for(var Ze in j)if(!(typeof et[j[Ze]]>"u"||et[Ze]==="")){if(typeof et[Ze]>"u"){if(!l.Object.prototype[Ze])continue;et[Ze]=l.Object.prototype[Ze]}if(et[Ze].indexOf("url(")!==0){var mt=new l.Color(et[Ze]);et[Ze]=mt.setAlpha(p(mt.getAlpha()*et[j[Ze]],2)).toRgba()}}return et}function he(et,Ze){var mt,Pt=[],$t,Ct,Et;for(Ct=0,Et=Ze.length;Ct1;)tt.shift(),gt=l.util.multiplyTransformMatrices(gt,tt[0]);return gt}}();function _e(et,Ze){var mt,Pt;et.replace(/;\s*$/,"").split(";").forEach(function($t){var Ct=$t.split(":");mt=Ct[0].trim().toLowerCase(),Pt=Ct[1].trim(),Ze[mt]=Pt})}function xe(et,Ze){var mt,Pt;for(var $t in et)typeof et[$t]>"u"||(mt=$t.toLowerCase(),Pt=et[$t],Ze[mt]=Pt)}function Pe(et,Ze){var mt={};for(var Pt in l.cssRules[Ze])if(ke(et,Pt.split(" ")))for(var $t in l.cssRules[Ze][Pt])mt[$t]=l.cssRules[Ze][Pt][$t];return mt}function ke(et,Ze){var mt,Pt=!0;return mt=de(et,Ze.pop()),mt&&Ze.length&&(Pt=J(et,Ze)),mt&&Pt&&Ze.length===0}function J(et,Ze){for(var mt,Pt=!0;et.parentNode&&et.parentNode.nodeType===1&&Ze.length;)Pt&&(mt=Ze.pop()),et=et.parentNode,Pt=de(et,mt);return Ze.length===0}function de(et,Ze){var mt=et.nodeName,Pt=et.getAttribute("class"),$t=et.getAttribute("id"),Ct,Et;if(Ct=new RegExp("^"+mt,"i"),Ze=Ze.replace(Ct,""),$t&&Ze.length&&(Ct=new RegExp("#"+$t+"(?![a-zA-Z\\-]+)","i"),Ze=Ze.replace(Ct,"")),Pt&&Ze.length)for(Pt=Pt.split(" "),Et=Pt.length;Et--;)Ct=new RegExp("\\."+Pt[Et]+"(?![a-zA-Z\\-]+)","i"),Ze=Ze.replace(Ct,"");return Ze.length===0}function Se(et,Ze){var mt;if(et.getElementById&&(mt=et.getElementById(Ze)),mt)return mt;var Pt,$t,Ct,Et=et.getElementsByTagName("*");for($t=0,Ct=Et.length;$tPt?Pt:mt),ae.meetOrSlice==="slice"&&(Pt=mt=mt>Pt?mt:Pt),tt=pe.width-Et*mt,gt=pe.height-Ft*mt,ae.alignX==="Mid"&&(tt/=2),ae.alignY==="Mid"&&(gt/=2),ae.alignX==="Min"&&(tt=0),ae.alignY==="Min"&&(gt=0)),mt===1&&Pt===1&&$t===0&&Ct===0&&kt===0&&ct===0)return pe;if((kt||ct)&&et.parentNode.nodeName!=="#document"&&(Ae=" translate("+y(kt)+" "+y(ct)+") "),ot=Ae+" matrix("+mt+" 0 0 "+Pt+" "+($t*mt+tt)+" "+(Ct*Pt+gt)+") ",et.nodeName==="svg"){for(Te=et.ownerDocument.createElementNS(l.svgNS,"g");et.firstChild;)Te.appendChild(et.firstChild);et.appendChild(Te)}else Te=et,Te.removeAttribute("x"),Te.removeAttribute("y"),ot=Te.getAttribute("transform")+ot;return Te.setAttribute("transform",ot),pe}function Ge(et,Ze){for(;et&&(et=et.parentNode);)if(et.nodeName&&Ze.test(et.nodeName.replace("svg:",""))&&!et.getAttribute("instantiated_by_use"))return!0;return!1}l.parseSVGDocument=function(et,Ze,mt,Pt){if(et){Ie(et);var $t=l.Object.__uid++,Ct,Et,Ft=Oe(et),ot=l.util.toArray(et.getElementsByTagName("*"));if(Ft.crossOrigin=Pt&&Pt.crossOrigin,Ft.svgUid=$t,ot.length===0&&l.isLikelyNode){ot=et.selectNodes('//*[name(.)!="svg"]');var Te=[];for(Ct=0,Et=ot.length;Ct"u"&&(mt=et.getAttribute("svgUid")),et.parentNode&&l.svgValidParentsRegEx.test(et.parentNode.nodeName)&&($t=l.parseAttributes(et.parentNode,Ze,mt));var Ft=Ze.reduce(function(ae,ht){return Pt=et.getAttribute(ht),Pt&&(ae[ht]=Pt),ae},{}),ot=c(Pe(et,mt),l.parseStyleAttribute(et));Ft=c(Ft,ot),ot[Y]&&et.setAttribute(Y,ot[Y]),Ct=Et=$t.fontSize||l.Text.DEFAULT_SVG_FONT_SIZE,Ft[V]&&(Ft[V]=Ct=y(Ft[V],Et));var Te,je,pt={};for(var kt in Ft)Te=X(kt),je=Z(Te,Ft[kt],$t,Ct),pt[Te]=je;pt&&pt.font&&l.parseFontDeclaration(pt.font,pt);var ct=c($t,pt);return l.svgValidParentsRegEx.test(et.nodeName)?ct:ce(ct)}},parseElements:function(et,Ze,mt,Pt,$t){new l.ElementsParser(et,Ze,mt,Pt,$t).parse()},parseStyleAttribute:function(et){var Ze={},mt=et.getAttribute("style");return mt&&(typeof mt=="string"?_e(mt,Ze):xe(mt,Ze)),Ze},parsePointsAttribute:function(et){if(!et)return null;et=et.replace(/,/g," ").trim(),et=et.split(/\s+/);var Ze=[],mt,Pt;for(mt=0,Pt=et.length;mth.x&&this.y>h.y},gte:function(h){return this.x>=h.x&&this.y>=h.y},lerp:function(h,p){return typeof p>"u"&&(p=.5),p=Math.max(Math.min(1,p),0),new c(this.x+(h.x-this.x)*p,this.y+(h.y-this.y)*p)},distanceFrom:function(h){var p=this.x-h.x,y=this.y-h.y;return Math.sqrt(p*p+y*y)},midPointFrom:function(h){return this.lerp(h)},min:function(h){return new c(Math.min(this.x,h.x),Math.min(this.y,h.y))},max:function(h){return new c(Math.max(this.x,h.x),Math.max(this.y,h.y))},toString:function(){return this.x+","+this.y},setXY:function(h,p){return this.x=h,this.y=p,this},setX:function(h){return this.x=h,this},setY:function(h){return this.y=h,this},setFromPoint:function(h){return this.x=h.x,this.y=h.y,this},swap:function(h){var p=this.x,y=this.y;this.x=h.x,this.y=h.y,h.x=p,h.y=y},clone:function(){return new c(this.x,this.y)}}}(t),function(a){var l=a.fabric||(a.fabric={});if(l.Intersection){l.warn("fabric.Intersection is already defined");return}function c(h){this.status=h,this.points=[]}l.Intersection=c,l.Intersection.prototype={constructor:c,appendPoint:function(h){return this.points.push(h),this},appendPoints:function(h){return this.points=this.points.concat(h),this}},l.Intersection.intersectLineLine=function(h,p,y,v){var x,I=(v.x-y.x)*(h.y-y.y)-(v.y-y.y)*(h.x-y.x),P=(p.x-h.x)*(h.y-y.y)-(p.y-h.y)*(h.x-y.x),F=(v.y-y.y)*(p.x-h.x)-(v.x-y.x)*(p.y-h.y);if(F!==0){var k=I/F,j=P/F;0<=k&&k<=1&&0<=j&&j<=1?(x=new c("Intersection"),x.appendPoint(new l.Point(h.x+k*(p.x-h.x),h.y+k*(p.y-h.y)))):x=new c}else I===0||P===0?x=new c("Coincident"):x=new c("Parallel");return x},l.Intersection.intersectLinePolygon=function(h,p,y){var v=new c,x=y.length,I,P,F,k;for(k=0;k0&&(v.status="Intersection"),v},l.Intersection.intersectPolygonPolygon=function(h,p){var y=new c,v=h.length,x;for(x=0;x0&&(y.status="Intersection"),y},l.Intersection.intersectPolygonRectangle=function(h,p,y){var v=p.min(y),x=p.max(y),I=new l.Point(x.x,v.y),P=new l.Point(v.x,x.y),F=c.intersectLinePolygon(v,I,h),k=c.intersectLinePolygon(I,x,h),j=c.intersectLinePolygon(x,P,h),V=c.intersectLinePolygon(P,v,h),Y=new c;return Y.appendPoints(F.points),Y.appendPoints(k.points),Y.appendPoints(j.points),Y.appendPoints(V.points),Y.points.length>0&&(Y.status="Intersection"),Y}}(t),function(a){var l=a.fabric||(a.fabric={});if(l.Color){l.warn("fabric.Color is already defined.");return}function c(p){p?this._tryParsingColor(p):this.setSource([0,0,0,1])}l.Color=c,l.Color.prototype={_tryParsingColor:function(p){var y;p in c.colorNameMap&&(p=c.colorNameMap[p]),p==="transparent"&&(y=[255,255,255,0]),y||(y=c.sourceFromHex(p)),y||(y=c.sourceFromRgb(p)),y||(y=c.sourceFromHsl(p)),y||(y=[0,0,0,1]),y&&this.setSource(y)},_rgbToHsl:function(p,y,v){p/=255,y/=255,v/=255;var x,I,P,F=l.util.array.max([p,y,v]),k=l.util.array.min([p,y,v]);if(P=(F+k)/2,F===k)x=I=0;else{var j=F-k;switch(I=P>.5?j/(2-F-k):j/(F+k),F){case p:x=(y-v)/j+(y1&&(v-=1),v<.16666666666666666?p+(y-p)*6*v:v<.5?y:v<.6666666666666666?p+(y-p)*(.6666666666666666-v)*6:p}l.Color.fromRgb=function(p){return c.fromSource(c.sourceFromRgb(p))},l.Color.sourceFromRgb=function(p){var y=p.match(c.reRGBa);if(y){var v=parseInt(y[1],10)/(/%$/.test(y[1])?100:1)*(/%$/.test(y[1])?255:1),x=parseInt(y[2],10)/(/%$/.test(y[2])?100:1)*(/%$/.test(y[2])?255:1),I=parseInt(y[3],10)/(/%$/.test(y[3])?100:1)*(/%$/.test(y[3])?255:1);return[parseInt(v,10),parseInt(x,10),parseInt(I,10),y[4]?parseFloat(y[4]):1]}},l.Color.fromRgba=c.fromRgb,l.Color.fromHsl=function(p){return c.fromSource(c.sourceFromHsl(p))},l.Color.sourceFromHsl=function(p){var y=p.match(c.reHSLa);if(y){var v=(parseFloat(y[1])%360+360)%360/360,x=parseFloat(y[2])/(/%$/.test(y[2])?100:1),I=parseFloat(y[3])/(/%$/.test(y[3])?100:1),P,F,k;if(x===0)P=F=k=I;else{var j=I<=.5?I*(x+1):I+x-I*x,V=I*2-j;P=h(V,j,v+.3333333333333333),F=h(V,j,v),k=h(V,j,v-.3333333333333333)}return[Math.round(P*255),Math.round(F*255),Math.round(k*255),y[4]?parseFloat(y[4]):1]}},l.Color.fromHsla=c.fromHsl,l.Color.fromHex=function(p){return c.fromSource(c.sourceFromHex(p))},l.Color.sourceFromHex=function(p){if(p.match(c.reHex)){var y=p.slice(p.indexOf("#")+1),v=y.length===3||y.length===4,x=y.length===8||y.length===4,I=v?y.charAt(0)+y.charAt(0):y.substring(0,2),P=v?y.charAt(1)+y.charAt(1):y.substring(2,4),F=v?y.charAt(2)+y.charAt(2):y.substring(4,6),k=x?v?y.charAt(3)+y.charAt(3):y.substring(6,8):"FF";return[parseInt(I,16),parseInt(P,16),parseInt(F,16),parseFloat((parseInt(k,16)/255).toFixed(2))]}},l.Color.fromSource=function(p){var y=new c;return y.setSource(p),y}}(t),function(a){var l=a.fabric||(a.fabric={}),c=["e","se","s","sw","w","nw","n","ne","e"],h=["ns","nesw","ew","nwse"],p={},y="left",v="top",x="right",I="bottom",P="center",F={top:I,bottom:v,left:x,right:y,center:P},k=l.util.radiansToDegrees,j=Math.sign||function(Te){return(Te>0)-(Te<0)||+Te};function V(Te,je){var pt=Te.angle+k(Math.atan2(je.y,je.x))+360;return Math.round(pt%360/45)}function Y(Te,je){var pt=je.transform.target,kt=pt.canvas,ct=l.util.object.clone(je);ct.target=pt,kt&&kt.fire("object:"+Te,ct),pt.fire(Te,je)}function X(Te,je){var pt=je.canvas,kt=pt.uniScaleKey,ct=Te[kt];return pt.uniformScaling&&!ct||!pt.uniformScaling&&ct}function Z(Te){return Te.originX===P&&Te.originY===P}function ie(Te,je,pt){var kt=Te.lockScalingX,ct=Te.lockScalingY;return!!(kt&&ct||!je&&(kt||ct)&&pt||kt&&je==="x"||ct&&je==="y")}function ce(Te,je,pt){var kt="not-allowed",ct=X(Te,pt),ae="";if(je.x!==0&&je.y===0?ae="x":je.x===0&&je.y!==0&&(ae="y"),ie(pt,ae,ct))return kt;var ht=V(pt,je);return c[ht]+"-resize"}function he(Te,je,pt){var kt="not-allowed";if(je.x!==0&&pt.lockSkewingY||je.y!==0&&pt.lockSkewingX)return kt;var ct=V(pt,je)%4;return h[ct]+"-resize"}function _e(Te,je,pt){return Te[pt.canvas.altActionKey]?p.skewCursorStyleHandler(Te,je,pt):p.scaleCursorStyleHandler(Te,je,pt)}function xe(Te,je,pt){var kt=Te[pt.canvas.altActionKey];if(je.x===0)return kt?"skewX":"scaleY";if(je.y===0)return kt?"skewY":"scaleX"}function Pe(Te,je,pt){return pt.lockRotation?"not-allowed":je.cursorStyle}function ke(Te,je,pt,kt){return{e:Te,transform:je,pointer:{x:pt,y:kt}}}function J(Te){return function(je,pt,kt,ct){var ae=pt.target,ht=ae.getCenterPoint(),wt=ae.translateToOriginPoint(ht,pt.originX,pt.originY),Ne=Te(je,pt,kt,ct);return ae.setPositionByOrigin(wt,pt.originX,pt.originY),Ne}}function de(Te,je){return function(pt,kt,ct,ae){var ht=je(pt,kt,ct,ae);return ht&&Y(Te,ke(pt,kt,ct,ae)),ht}}function Se(Te,je,pt,kt,ct){var ae=Te.target,ht=ae.controls[Te.corner],wt=ae.canvas.getZoom(),Ne=ae.padding/wt,pe=ae.toLocalPoint(new l.Point(kt,ct),je,pt);return pe.x>=Ne&&(pe.x-=Ne),pe.x<=-Ne&&(pe.x+=Ne),pe.y>=Ne&&(pe.y-=Ne),pe.y<=Ne&&(pe.y+=Ne),pe.x-=ht.offsetX,pe.y-=ht.offsetY,pe}function Ie(Te){return Te.flipX!==Te.flipY}function Re(Te,je,pt,kt,ct){if(Te[je]!==0){var ae=Te._getTransformedDimensions()[kt],ht=ct/ae*Te[pt];Te.set(pt,ht)}}function Oe(Te,je,pt,kt){var ct=je.target,ae=ct._getTransformedDimensions(0,ct.skewY),ht=Se(je,je.originX,je.originY,pt,kt),wt=Math.abs(ht.x*2)-ae.x,Ne=ct.skewX,pe;wt<2?pe=0:(pe=k(Math.atan2(wt/ct.scaleX,ae.y/ct.scaleY)),je.originX===y&&je.originY===I&&(pe=-pe),je.originX===x&&je.originY===v&&(pe=-pe),Ie(ct)&&(pe=-pe));var Ae=Ne!==pe;if(Ae){var tt=ct._getTransformedDimensions().y;ct.set("skewX",pe),Re(ct,"skewY","scaleY","y",tt)}return Ae}function Ge(Te,je,pt,kt){var ct=je.target,ae=ct._getTransformedDimensions(ct.skewX,0),ht=Se(je,je.originX,je.originY,pt,kt),wt=Math.abs(ht.y*2)-ae.y,Ne=ct.skewY,pe;wt<2?pe=0:(pe=k(Math.atan2(wt/ct.scaleY,ae.x/ct.scaleX)),je.originX===y&&je.originY===I&&(pe=-pe),je.originX===x&&je.originY===v&&(pe=-pe),Ie(ct)&&(pe=-pe));var Ae=Ne!==pe;if(Ae){var tt=ct._getTransformedDimensions().x;ct.set("skewY",pe),Re(ct,"skewX","scaleX","x",tt)}return Ae}function Be(Te,je,pt,kt){var ct=je.target,ae=ct.skewX,ht,wt=je.originY;if(ct.lockSkewingX)return!1;if(ae===0){var Ne=Se(je,P,P,pt,kt);Ne.x>0?ht=y:ht=x}else ae>0&&(ht=wt===v?y:x),ae<0&&(ht=wt===v?x:y),Ie(ct)&&(ht=ht===y?x:y);je.originX=ht;var pe=de("skewing",J(Oe));return pe(Te,je,pt,kt)}function qe(Te,je,pt,kt){var ct=je.target,ae=ct.skewY,ht,wt=je.originX;if(ct.lockSkewingY)return!1;if(ae===0){var Ne=Se(je,P,P,pt,kt);Ne.y>0?ht=v:ht=I}else ae>0&&(ht=wt===y?v:I),ae<0&&(ht=wt===y?I:v),Ie(ct)&&(ht=ht===v?I:v);je.originY=ht;var pe=de("skewing",J(Ge));return pe(Te,je,pt,kt)}function et(Te,je,pt,kt){var ct=je,ae=ct.target,ht=ae.translateToOriginPoint(ae.getCenterPoint(),ct.originX,ct.originY);if(ae.lockRotation)return!1;var wt=Math.atan2(ct.ey-ht.y,ct.ex-ht.x),Ne=Math.atan2(kt-ht.y,pt-ht.x),pe=k(Ne-wt+ct.theta),Ae=!0;if(ae.snapAngle>0){var tt=ae.snapAngle,gt=ae.snapThreshold||tt,ze=Math.ceil(pe/tt)*tt,Ot=Math.floor(pe/tt)*tt;Math.abs(pe-Ot)j?(ce=k,v.scale(1,j/k),ie=I*k/j):j>k?(ce=j,v.scale(k/j,1),Z=x*j/k):ce=k,v.lineWidth=1,v.beginPath(),v.arc(Z,ie,ce/2,0,2*Math.PI,!1),v[Y](),X&&v.stroke(),v.restore()}function y(v,x,I,P,F){P=P||{};var k=this.sizeX||P.cornerSize||F.cornerSize,j=this.sizeY||P.cornerSize||F.cornerSize,V=typeof P.transparentCorners<"u"?P.transparentCorners:F.transparentCorners,Y=V?"stroke":"fill",X=!V&&(P.cornerStrokeColor||F.cornerStrokeColor),Z=k/2,ie=j/2;v.save(),v.fillStyle=P.cornerColor||F.cornerColor,v.strokeStyle=P.cornerStrokeColor||F.cornerStrokeColor,v.lineWidth=1,v.translate(x,I),v.rotate(c(F.angle)),v[Y+"Rect"](-Z,-ie,k,j),X&&v.strokeRect(-Z,-ie,k,j),v.restore()}h.renderCircleControl=p,h.renderSquareControl=y}(t),function(a){var l=a.fabric||(a.fabric={});function c(h){for(var p in h)this[p]=h[p]}l.Control=c,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(h,p){return p.cursorStyle},getActionName:function(h,p){return p.actionName},getVisibility:function(h,p){var y=h._controlsVisibility;return y&&typeof y[p]<"u"?y[p]:this.visible},setVisibility:function(h){this.visible=h},positionHandler:function(h,p){var y=l.util.transformPoint({x:this.x*h.x+this.offsetX,y:this.y*h.y+this.offsetY},p);return y},calcCornerCoords:function(h,p,y,v,x){var I,P,F,k,j=x?this.touchSizeX:this.sizeX,V=x?this.touchSizeY:this.sizeY;if(j&&V&&j!==V){var Y=Math.atan2(V,j),X=Math.sqrt(j*j+V*V)/2,Z=Y-l.util.degreesToRadians(h),ie=Math.PI/2-Y-l.util.degreesToRadians(h);I=X*l.util.cos(Z),P=X*l.util.sin(Z),F=X*l.util.cos(ie),k=X*l.util.sin(ie)}else{var ce=j&&V?j:p;X=ce*.7071067812;var Z=l.util.degreesToRadians(45-h);I=F=X*l.util.cos(Z),P=k=X*l.util.sin(Z)}return{tl:{x:y-k,y:v-F},tr:{x:y+I,y:v-P},bl:{x:y-I,y:v+P},br:{x:y+k,y:v+F}}},render:function(h,p,y,v,x){switch(v=v||{},v.cornerStyle||x.cornerStyle){case"circle":l.controlsUtils.renderCircleControl.call(this,h,p,y,v,x);break;default:l.controlsUtils.renderSquareControl.call(this,h,p,y,v,x)}}}}(t),function(){function a(y,v){var x=y.getAttribute("style"),I=y.getAttribute("offset")||0,P,F,k,j;if(I=parseFloat(I)/(/%$/.test(I)?100:1),I=I<0?0:I>1?1:I,x){var V=x.split(/\s*;\s*/);for(V[V.length-1]===""&&V.pop(),j=V.length;j--;){var Y=V[j].split(/\s*:\s*/),X=Y[0].trim(),Z=Y[1].trim();X==="stop-color"?P=Z:X==="stop-opacity"&&(k=Z)}}return P||(P=y.getAttribute("stop-color")||"rgb(0,0,0)"),k||(k=y.getAttribute("stop-opacity")),P=new e.Color(P),F=P.getAlpha(),k=isNaN(parseFloat(k))?1:parseFloat(k),k*=F*v,{offset:I,color:P.toRgb(),opacity:k}}function l(y){return{x1:y.getAttribute("x1")||0,y1:y.getAttribute("y1")||0,x2:y.getAttribute("x2")||"100%",y2:y.getAttribute("y2")||0}}function c(y){return{x1:y.getAttribute("fx")||y.getAttribute("cx")||"50%",y1:y.getAttribute("fy")||y.getAttribute("cy")||"50%",r1:0,x2:y.getAttribute("cx")||"50%",y2:y.getAttribute("cy")||"50%",r2:y.getAttribute("r")||"50%"}}var h=e.util.object.clone;e.Gradient=e.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(y){y||(y={}),y.coords||(y.coords={});var v,x=this;Object.keys(y).forEach(function(I){x[I]=y[I]}),this.id?this.id+="_"+e.Object.__uid++:this.id=e.Object.__uid++,v={x1:y.coords.x1||0,y1:y.coords.y1||0,x2:y.coords.x2||0,y2:y.coords.y2||0},this.type==="radial"&&(v.r1=y.coords.r1||0,v.r2=y.coords.r2||0),this.coords=v,this.colorStops=y.colorStops.slice()},addColorStop:function(y){for(var v in y){var x=new e.Color(y[v]);this.colorStops.push({offset:parseFloat(v),color:x.toRgb(),opacity:x.getAlpha()})}return this},toObject:function(y){var v={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,v,y),v},toSVG:function(y,F){var x=h(this.coords,!0),I,P,F=F||{},k,j,V=h(this.colorStops,!0),Y=x.r1>x.r2,X=this.gradientTransform?this.gradientTransform.concat():e.iMatrix.concat(),Z=-this.offsetX,ie=-this.offsetY,ce=!!F.additionalTransform,he=this.gradientUnits==="pixels"?"userSpaceOnUse":"objectBoundingBox";if(V.sort(function(J,de){return J.offset-de.offset}),he==="objectBoundingBox"?(Z/=y.width,ie/=y.height):(Z+=y.width/2,ie+=y.height/2),y.type==="path"&&this.gradientUnits!=="percentage"&&(Z-=y.pathOffset.x,ie-=y.pathOffset.y),X[4]-=Z,X[5]-=ie,j='id="SVGID_'+this.id+'" gradientUnits="'+he+'"',j+=' gradientTransform="'+(ce?F.additionalTransform+" ":"")+e.util.matrixToSVG(X)+'" ',this.type==="linear"?k=[" +`]:this.type==="radial"&&(k=[" +`]),this.type==="radial"){if(Y)for(V=V.concat(),V.reverse(),I=0,P=V.length;I0){var xe=Math.max(x.r1,x.r2),Pe=_e/xe;for(I=0,P=V.length;I +`)}return k.push(this.type==="linear"?` `:` -`),N.join("")},toLive:function(y){var v,S=e.util.object.clone(this.coords),I,O;if(this.type){for(this.type==="linear"?v=y.createLinearGradient(S.x1,S.y1,S.x2,S.y2):this.type==="radial"&&(v=y.createRadialGradient(S.x1,S.y1,S.r1,S.x2,S.y2,S.r2)),I=0,O=this.colorStops.length;I1?1:O,isNaN(O)&&(O=1);var L=y.getElementsByTagName("stop"),N,G=y.getAttribute("gradientUnits")==="userSpaceOnUse"?"pixels":"percentage",V=y.getAttribute("gradientTransform")||"",Y=[],X,te,re=0,fe=0,ge;for(y.nodeName==="linearGradient"||y.nodeName==="LINEARGRADIENT"?(N="linear",X=l(y)):(N="radial",X=c(y)),te=L.length;te--;)Y.push(a(L[te],O));ge=e.parseTransformAttribute(V),p(v,X,I,G),G==="pixels"&&(re=-v.left,fe=-v.top);var _e=new e.Gradient({id:y.getAttribute("id"),type:N,coords:X,colorStops:Y,gradientUnits:G,gradientTransform:ge,offsetX:re,offsetY:fe});return _e}});function p(y,v,S,I){var O,L;Object.keys(v).forEach(function(N){O=v[N],O==="Infinity"?L=1:O==="-Infinity"?L=0:(L=parseFloat(v[N],10),typeof O=="string"&&/^(\d+\.\d+)%|(\d+)%$/.test(O)&&(L*=.01,I==="pixels"&&((N==="x1"||N==="x2"||N==="r2")&&(L*=S.viewBoxWidth||S.width),(N==="y1"||N==="y2")&&(L*=S.viewBoxHeight||S.height)))),v[N]=L})}}(),function(){var a=e.util.toFixed;e.Pattern=e.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(l,c){if(l||(l={}),this.id=e.Object.__uid++,this.setOptions(l),!l.source||l.source&&typeof l.source!="string"){c&&c(this);return}else{var d=this;this.source=e.util.createImage(),e.util.loadImage(l.source,function(p,y){d.source=p,c&&c(d,y)},null,this.crossOrigin)}},toObject:function(l){var c=e.Object.NUM_FRACTION_DIGITS,d,p;return typeof this.source.src=="string"?d=this.source.src:typeof this.source=="object"&&this.source.toDataURL&&(d=this.source.toDataURL()),p={type:"pattern",source:d,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:a(this.offsetX,c),offsetY:a(this.offsetY,c),patternTransform:this.patternTransform?this.patternTransform.concat():null},e.util.populateWithProperties(this,p,l),p},toSVG:function(l){var c=typeof this.source=="function"?this.source():this.source,d=c.width/l.width,p=c.height/l.height,y=this.offsetX/l.width,v=this.offsetY/l.height,S="";return(this.repeat==="repeat-x"||this.repeat==="no-repeat")&&(p=1,v&&(p+=Math.abs(v))),(this.repeat==="repeat-y"||this.repeat==="no-repeat")&&(d=1,y&&(d+=Math.abs(y))),c.src?S=c.src:c.toDataURL&&(S=c.toDataURL()),' - +`),k.join("")},toLive:function(y){var v,x=e.util.object.clone(this.coords),I,P;if(this.type){for(this.type==="linear"?v=y.createLinearGradient(x.x1,x.y1,x.x2,x.y2):this.type==="radial"&&(v=y.createRadialGradient(x.x1,x.y1,x.r1,x.x2,x.y2,x.r2)),I=0,P=this.colorStops.length;I1?1:P,isNaN(P)&&(P=1);var F=y.getElementsByTagName("stop"),k,j=y.getAttribute("gradientUnits")==="userSpaceOnUse"?"pixels":"percentage",V=y.getAttribute("gradientTransform")||"",Y=[],X,Z,ie=0,ce=0,he;for(y.nodeName==="linearGradient"||y.nodeName==="LINEARGRADIENT"?(k="linear",X=l(y)):(k="radial",X=c(y)),Z=F.length;Z--;)Y.push(a(F[Z],P));he=e.parseTransformAttribute(V),p(v,X,I,j),j==="pixels"&&(ie=-v.left,ce=-v.top);var _e=new e.Gradient({id:y.getAttribute("id"),type:k,coords:X,colorStops:Y,gradientUnits:j,gradientTransform:he,offsetX:ie,offsetY:ce});return _e}});function p(y,v,x,I){var P,F;Object.keys(v).forEach(function(k){P=v[k],P==="Infinity"?F=1:P==="-Infinity"?F=0:(F=parseFloat(v[k],10),typeof P=="string"&&/^(\d+\.\d+)%|(\d+)%$/.test(P)&&(F*=.01,I==="pixels"&&((k==="x1"||k==="x2"||k==="r2")&&(F*=x.viewBoxWidth||x.width),(k==="y1"||k==="y2")&&(F*=x.viewBoxHeight||x.height)))),v[k]=F})}}(),function(){var a=e.util.toFixed;e.Pattern=e.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(l,c){if(l||(l={}),this.id=e.Object.__uid++,this.setOptions(l),!l.source||l.source&&typeof l.source!="string"){c&&c(this);return}else{var h=this;this.source=e.util.createImage(),e.util.loadImage(l.source,function(p,y){h.source=p,c&&c(h,y)},null,this.crossOrigin)}},toObject:function(l){var c=e.Object.NUM_FRACTION_DIGITS,h,p;return typeof this.source.src=="string"?h=this.source.src:typeof this.source=="object"&&this.source.toDataURL&&(h=this.source.toDataURL()),p={type:"pattern",source:h,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:a(this.offsetX,c),offsetY:a(this.offsetY,c),patternTransform:this.patternTransform?this.patternTransform.concat():null},e.util.populateWithProperties(this,p,l),p},toSVG:function(l){var c=typeof this.source=="function"?this.source():this.source,h=c.width/l.width,p=c.height/l.height,y=this.offsetX/l.width,v=this.offsetY/l.height,x="";return(this.repeat==="repeat-x"||this.repeat==="no-repeat")&&(p=1,v&&(p+=Math.abs(v))),(this.repeat==="repeat-y"||this.repeat==="no-repeat")&&(h=1,y&&(h+=Math.abs(y))),c.src?x=c.src:c.toDataURL&&(x=c.toDataURL()),' + -`},setOptions:function(l){for(var c in l)this[c]=l[c]},toLive:function(l){var c=this.source;return!c||typeof c.src<"u"&&(!c.complete||c.naturalWidth===0||c.naturalHeight===0)?"":l.createPattern(c,this.repeat)}})}(),function(a){var l=a.fabric||(a.fabric={}),c=l.util.toFixed;if(l.Shadow){l.warn("fabric.Shadow is already defined.");return}l.Shadow=l.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(d){typeof d=="string"&&(d=this._parseShadow(d));for(var p in d)this[p]=d[p];this.id=l.Object.__uid++},_parseShadow:function(d){var p=d.trim(),y=l.Shadow.reOffsetsAndBlur.exec(p)||[],v=p.replace(l.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)";return{color:v.trim(),offsetX:parseFloat(y[1],10)||0,offsetY:parseFloat(y[2],10)||0,blur:parseFloat(y[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(d){var p=40,y=40,v=l.Object.NUM_FRACTION_DIGITS,S=l.util.rotateVector({x:this.offsetX,y:this.offsetY},l.util.degreesToRadians(-d.angle)),I=20,O=new l.Color(this.color);return d.width&&d.height&&(p=c((Math.abs(S.x)+this.blur)/d.width,v)*100+I,y=c((Math.abs(S.y)+this.blur)/d.height,v)*100+I),d.flipX&&(S.x*=-1),d.flipY&&(S.y*=-1),' +`},setOptions:function(l){for(var c in l)this[c]=l[c]},toLive:function(l){var c=this.source;return!c||typeof c.src<"u"&&(!c.complete||c.naturalWidth===0||c.naturalHeight===0)?"":l.createPattern(c,this.repeat)}})}(),function(a){var l=a.fabric||(a.fabric={}),c=l.util.toFixed;if(l.Shadow){l.warn("fabric.Shadow is already defined.");return}l.Shadow=l.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(h){typeof h=="string"&&(h=this._parseShadow(h));for(var p in h)this[p]=h[p];this.id=l.Object.__uid++},_parseShadow:function(h){var p=h.trim(),y=l.Shadow.reOffsetsAndBlur.exec(p)||[],v=p.replace(l.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)";return{color:v.trim(),offsetX:parseFloat(y[1],10)||0,offsetY:parseFloat(y[2],10)||0,blur:parseFloat(y[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(h){var p=40,y=40,v=l.Object.NUM_FRACTION_DIGITS,x=l.util.rotateVector({x:this.offsetX,y:this.offsetY},l.util.degreesToRadians(-h.angle)),I=20,P=new l.Color(this.color);return h.width&&h.height&&(p=c((Math.abs(x.x)+this.blur)/h.width,v)*100+I,y=c((Math.abs(x.y)+this.blur)/h.height,v)*100+I),h.flipX&&(x.x*=-1),h.flipY&&(x.y*=-1),' - - + + -`},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var d={},p=l.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(y){this[y]!==p[y]&&(d[y]=this[y])},this),d}}),l.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/}(t),function(){if(e.StaticCanvas){e.warn("fabric.StaticCanvas is already defined.");return}var a=e.util.object.extend,l=e.util.getElementOffset,c=e.util.removeFromArray,d=e.util.toFixed,p=e.util.transformPoint,y=e.util.invertTransform,v=e.util.getNodeCanvas,S=e.util.createCanvasElement,I=new Error("Could not initialize `canvas` element");e.StaticCanvas=e.util.createClass(e.CommonMethods,{initialize:function(O,L){L||(L={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(O,L)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:e.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(O,L){var N=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(O),this._initOptions(L),this.interactive||this._initRetinaScaling(),L.overlayImage&&this.setOverlayImage(L.overlayImage,N),L.backgroundImage&&this.setBackgroundImage(L.backgroundImage,N),L.backgroundColor&&this.setBackgroundColor(L.backgroundColor,N),L.overlayColor&&this.setOverlayColor(L.overlayColor,N),this.calcOffset()},_isRetinaScaling:function(){return e.devicePixelRatio>1&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?Math.max(1,e.devicePixelRatio):1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var O=e.devicePixelRatio;this.__initRetinaScaling(O,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(O,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(O,L,N){L.setAttribute("width",this.width*O),L.setAttribute("height",this.height*O),N.scale(O,O)},calcOffset:function(){return this._offset=l(this.lowerCanvasEl),this},setOverlayImage:function(O,L,N){return this.__setBgOverlayImage("overlayImage",O,L,N)},setBackgroundImage:function(O,L,N){return this.__setBgOverlayImage("backgroundImage",O,L,N)},setOverlayColor:function(O,L){return this.__setBgOverlayColor("overlayColor",O,L)},setBackgroundColor:function(O,L){return this.__setBgOverlayColor("backgroundColor",O,L)},__setBgOverlayImage:function(O,L,N,G){return typeof L=="string"?e.util.loadImage(L,function(V,Y){if(V){var X=new e.Image(V,G);this[O]=X,X.canvas=this}N&&N(V,Y)},this,G&&G.crossOrigin):(G&&L.setOptions(G),this[O]=L,L&&(L.canvas=this),N&&N(L,!1)),this},__setBgOverlayColor:function(O,L,N){return this[O]=L,this._initGradient(L,O),this._initPattern(L,O,N),this},_createCanvasElement:function(){var O=S();if(!O||(O.style||(O.style={}),typeof O.getContext>"u"))throw I;return O},_initOptions:function(O){var L=this.lowerCanvasEl;this._setOptions(O),this.width=this.width||parseInt(L.width,10)||0,this.height=this.height||parseInt(L.height,10)||0,this.lowerCanvasEl.style&&(L.width=this.width,L.height=this.height,L.style.width=this.width+"px",L.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(O){O&&O.getContext?this.lowerCanvasEl=O:this.lowerCanvasEl=e.util.getById(O)||this._createCanvasElement(),e.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(O,L){return this.setDimensions({width:O},L)},setHeight:function(O,L){return this.setDimensions({height:O},L)},setDimensions:function(O,L){var N;L=L||{};for(var G in O)N=O[G],L.cssOnly||(this._setBackstoreDimension(G,O[G]),N+="px",this.hasLostContext=!0),L.backstoreOnly||this._setCssDimension(G,N);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop),this._initRetinaScaling(),this.calcOffset(),L.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(O,L){return this.lowerCanvasEl[O]=L,this.upperCanvasEl&&(this.upperCanvasEl[O]=L),this.cacheCanvasEl&&(this.cacheCanvasEl[O]=L),this[O]=L,this},_setCssDimension:function(O,L){return this.lowerCanvasEl.style[O]=L,this.upperCanvasEl&&(this.upperCanvasEl.style[O]=L),this.wrapperEl&&(this.wrapperEl.style[O]=L),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(O){var L=this._activeObject,N=this.backgroundImage,G=this.overlayImage,V,Y,X;for(this.viewportTransform=O,Y=0,X=this._objects.length;Y -`),this._setSVGBgOverlayColor(N,"background"),this._setSVGBgOverlayImage(N,"backgroundImage",L),this._setSVGObjects(N,L),this.clipPath&&N.push(` -`),this._setSVGBgOverlayColor(N,"overlay"),this._setSVGBgOverlayImage(N,"overlayImage",L),N.push(""),N.join("")},_setSVGPreamble:function(O,L){L.suppressPreamble||O.push(' +`},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var h={},p=l.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(y){this[y]!==p[y]&&(h[y]=this[y])},this),h}}),l.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/}(t),function(){if(e.StaticCanvas){e.warn("fabric.StaticCanvas is already defined.");return}var a=e.util.object.extend,l=e.util.getElementOffset,c=e.util.removeFromArray,h=e.util.toFixed,p=e.util.transformPoint,y=e.util.invertTransform,v=e.util.getNodeCanvas,x=e.util.createCanvasElement,I=new Error("Could not initialize `canvas` element");e.StaticCanvas=e.util.createClass(e.CommonMethods,{initialize:function(P,F){F||(F={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(P,F)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:e.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(P,F){var k=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(P),this._initOptions(F),this.interactive||this._initRetinaScaling(),F.overlayImage&&this.setOverlayImage(F.overlayImage,k),F.backgroundImage&&this.setBackgroundImage(F.backgroundImage,k),F.backgroundColor&&this.setBackgroundColor(F.backgroundColor,k),F.overlayColor&&this.setOverlayColor(F.overlayColor,k),this.calcOffset()},_isRetinaScaling:function(){return e.devicePixelRatio>1&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?Math.max(1,e.devicePixelRatio):1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var P=e.devicePixelRatio;this.__initRetinaScaling(P,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(P,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(P,F,k){F.setAttribute("width",this.width*P),F.setAttribute("height",this.height*P),k.scale(P,P)},calcOffset:function(){return this._offset=l(this.lowerCanvasEl),this},setOverlayImage:function(P,F,k){return this.__setBgOverlayImage("overlayImage",P,F,k)},setBackgroundImage:function(P,F,k){return this.__setBgOverlayImage("backgroundImage",P,F,k)},setOverlayColor:function(P,F){return this.__setBgOverlayColor("overlayColor",P,F)},setBackgroundColor:function(P,F){return this.__setBgOverlayColor("backgroundColor",P,F)},__setBgOverlayImage:function(P,F,k,j){return typeof F=="string"?e.util.loadImage(F,function(V,Y){if(V){var X=new e.Image(V,j);this[P]=X,X.canvas=this}k&&k(V,Y)},this,j&&j.crossOrigin):(j&&F.setOptions(j),this[P]=F,F&&(F.canvas=this),k&&k(F,!1)),this},__setBgOverlayColor:function(P,F,k){return this[P]=F,this._initGradient(F,P),this._initPattern(F,P,k),this},_createCanvasElement:function(){var P=x();if(!P||(P.style||(P.style={}),typeof P.getContext>"u"))throw I;return P},_initOptions:function(P){var F=this.lowerCanvasEl;this._setOptions(P),this.width=this.width||parseInt(F.width,10)||0,this.height=this.height||parseInt(F.height,10)||0,this.lowerCanvasEl.style&&(F.width=this.width,F.height=this.height,F.style.width=this.width+"px",F.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(P){P&&P.getContext?this.lowerCanvasEl=P:this.lowerCanvasEl=e.util.getById(P)||this._createCanvasElement(),e.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(P,F){return this.setDimensions({width:P},F)},setHeight:function(P,F){return this.setDimensions({height:P},F)},setDimensions:function(P,F){var k;F=F||{};for(var j in P)k=P[j],F.cssOnly||(this._setBackstoreDimension(j,P[j]),k+="px",this.hasLostContext=!0),F.backstoreOnly||this._setCssDimension(j,k);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop),this._initRetinaScaling(),this.calcOffset(),F.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(P,F){return this.lowerCanvasEl[P]=F,this.upperCanvasEl&&(this.upperCanvasEl[P]=F),this.cacheCanvasEl&&(this.cacheCanvasEl[P]=F),this[P]=F,this},_setCssDimension:function(P,F){return this.lowerCanvasEl.style[P]=F,this.upperCanvasEl&&(this.upperCanvasEl.style[P]=F),this.wrapperEl&&(this.wrapperEl.style[P]=F),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(P){var F=this._activeObject,k=this.backgroundImage,j=this.overlayImage,V,Y,X;for(this.viewportTransform=P,Y=0,X=this._objects.length;Y +`),this._setSVGBgOverlayColor(k,"background"),this._setSVGBgOverlayImage(k,"backgroundImage",F),this._setSVGObjects(k,F),this.clipPath&&k.push(` +`),this._setSVGBgOverlayColor(k,"overlay"),this._setSVGBgOverlayImage(k,"overlayImage",F),k.push(""),k.join("")},_setSVGPreamble:function(P,F){F.suppressPreamble||P.push(' `,' -`)},_setSVGHeader:function(O,L){var N=L.width||this.width,G=L.height||this.height,V,Y='viewBox="0 0 '+this.width+" "+this.height+'" ',X=e.Object.NUM_FRACTION_DIGITS;L.viewBox?Y='viewBox="'+L.viewBox.x+" "+L.viewBox.y+" "+L.viewBox.width+" "+L.viewBox.height+'" ':this.svgViewportTransformation&&(V=this.viewportTransform,Y='viewBox="'+d(-V[4]/V[0],X)+" "+d(-V[5]/V[3],X)+" "+d(this.width/V[0],X)+" "+d(this.height/V[3],X)+'" '),O.push(" +`)},_setSVGHeader:function(P,F){var k=F.width||this.width,j=F.height||this.height,V,Y='viewBox="0 0 '+this.width+" "+this.height+'" ',X=e.Object.NUM_FRACTION_DIGITS;F.viewBox?Y='viewBox="'+F.viewBox.x+" "+F.viewBox.y+" "+F.viewBox.width+" "+F.viewBox.height+'" ':this.svgViewportTransformation&&(V=this.viewportTransform,Y='viewBox="'+h(-V[4]/V[0],X)+" "+h(-V[5]/V[3],X)+" "+h(this.width/V[0],X)+" "+h(this.height/V[3],X)+'" '),P.push(" `,"Created with Fabric.js ",e.version,` `,` -`,this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(L),` -`)},createSVGClipPathMarkup:function(O){var L=this.clipPath;return L?(L.clipPathId="CLIPPATH_"+e.Object.__uid++,' -`+this.clipPath.toClipPathSVG(O.reviver)+` -`):""},createSVGRefElementsMarkup:function(){var O=this,L=["background","overlay"].map(function(N){var G=O[N+"Color"];if(G&&G.toLive){var V=O[N+"Vpt"],Y=O.viewportTransform,X={width:O.width/(V?Y[0]:1),height:O.height/(V?Y[3]:1)};return G.toSVG(X,{additionalTransform:V?e.util.matrixToSVG(Y):""})}});return L.join("")},createSVGFontFacesMarkup:function(){var O="",L={},N,G,V,Y,X,te,re,fe,ge,_e=e.fontPaths,Ie=[];for(this._objects.forEach(function Ne(J){Ie.push(J),J._objects&&J._objects.forEach(Ne)}),fe=0,ge=Ie.length;fe +`)},createSVGClipPathMarkup:function(P){var F=this.clipPath;return F?(F.clipPathId="CLIPPATH_"+e.Object.__uid++,' +`+this.clipPath.toClipPathSVG(P.reviver)+` +`):""},createSVGRefElementsMarkup:function(){var P=this,F=["background","overlay"].map(function(k){var j=P[k+"Color"];if(j&&j.toLive){var V=P[k+"Vpt"],Y=P.viewportTransform,X={width:P.width/(V?Y[0]:1),height:P.height/(V?Y[3]:1)};return j.toSVG(X,{additionalTransform:V?e.util.matrixToSVG(Y):""})}});return F.join("")},createSVGFontFacesMarkup:function(){var P="",F={},k,j,V,Y,X,Z,ie,ce,he,_e=e.fontPaths,xe=[];for(this._objects.forEach(function ke(J){xe.push(J),J._objects&&J._objects.forEach(ke)}),ce=0,he=xe.length;ce',` -`,O,"",` -`].join("")),O},_setSVGObjects:function(O,L){var N,G,V,Y=this._objects;for(G=0,V=Y.length;G
-`)}else O.push(' -`)},sendToBack:function(O){if(!O)return this;var L=this._activeObject,N,G,V;if(O===L&&O.type==="activeSelection")for(V=L._objects,N=V.length;N--;)G=V[N],c(this._objects,G),this._objects.unshift(G);else c(this._objects,O),this._objects.unshift(O);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(O){if(!O)return this;var L=this._activeObject,N,G,V;if(O===L&&O.type==="activeSelection")for(V=L._objects,N=0;N0+re&&(X=Y-1,c(this._objects,V),this._objects.splice(X,0,V)),re++;else Y=this._objects.indexOf(O),Y!==0&&(X=this._findNewLowerIndex(O,Y,L),c(this._objects,O),this._objects.splice(X,0,O));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(O,L,N){var G,V;if(N)for(G=L,V=L-1;V>=0;--V){var Y=O.intersectsWithObject(this._objects[V])||O.isContainedWithinObject(this._objects[V])||this._objects[V].isContainedWithinObject(O);if(Y){G=V;break}}else G=L-1;return G},bringForward:function(O,L){if(!O)return this;var N=this._activeObject,G,V,Y,X,te,re=0;if(O===N&&O.type==="activeSelection")for(te=N._objects,G=te.length;G--;)V=te[G],Y=this._objects.indexOf(V),Y"}}),a(e.StaticCanvas.prototype,e.Observable),a(e.StaticCanvas.prototype,e.Collection),a(e.StaticCanvas.prototype,e.DataURLExporter),a(e.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(O){var L=S();if(!L||!L.getContext)return null;var N=L.getContext("2d");if(!N)return null;switch(O){case"setLineDash":return typeof N.setLineDash<"u";default:return null}}}),e.StaticCanvas.prototype.toJSON=e.StaticCanvas.prototype.toObject,e.isLikelyNode&&(e.StaticCanvas.prototype.createPNGStream=function(){var O=v(this.lowerCanvasEl);return O&&O.createPNGStream()},e.StaticCanvas.prototype.createJPEGStream=function(O){var L=v(this.lowerCanvasEl);return L&&L.createJPEGStream(O)})}(),e.BaseBrush=e.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(a){a.strokeStyle=this.color,a.lineWidth=this.width,a.lineCap=this.strokeLineCap,a.miterLimit=this.strokeMiterLimit,a.lineJoin=this.strokeLineJoin,a.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(a){var l=this.canvas.viewportTransform;a.save(),a.transform(l[0],l[1],l[2],l[3],l[4],l[5])},_setShadow:function(){if(this.shadow){var a=this.canvas,l=this.shadow,c=a.contextTop,d=a.getZoom();a&&a._isRetinaScaling()&&(d*=e.devicePixelRatio),c.shadowColor=l.color,c.shadowBlur=l.blur*d,c.shadowOffsetX=l.offsetX*d,c.shadowOffsetY=l.offsetY*d}},needsFullRender:function(){var a=new e.Color(this.color);return a.getAlpha()<1||!!this.shadow},_resetShadow:function(){var a=this.canvas.contextTop;a.shadowColor="",a.shadowBlur=a.shadowOffsetX=a.shadowOffsetY=0},_isOutSideCanvas:function(a){return a.x<0||a.x>this.canvas.getWidth()||a.y<0||a.y>this.canvas.getHeight()}}),function(){e.PencilBrush=e.util.createClass(e.BaseBrush,{decimate:.4,drawStraightLine:!1,straightLineKey:"shiftKey",initialize:function(a){this.canvas=a,this._points=[]},needsFullRender:function(){return this.callSuper("needsFullRender")||this._hasStraightLine},_drawSegment:function(a,l,c){var d=l.midPointFrom(c);return a.quadraticCurveTo(l.x,l.y,d.x,d.y),d},onMouseDown:function(a,l){this.canvas._isMainEvent(l.e)&&(this.drawStraightLine=l.e[this.straightLineKey],this._prepareForDrawing(a),this._captureDrawingPath(a),this._render())},onMouseMove:function(a,l){if(this.canvas._isMainEvent(l.e)&&(this.drawStraightLine=l.e[this.straightLineKey],!(this.limitedToCanvasSize===!0&&this._isOutSideCanvas(a))&&this._captureDrawingPath(a)&&this._points.length>1))if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var c=this._points,d=c.length,p=this.canvas.contextTop;this._saveAndTransform(p),this.oldEnd&&(p.beginPath(),p.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(p,c[d-2],c[d-1],!0),p.stroke(),p.restore()}},onMouseUp:function(a){return this.canvas._isMainEvent(a.e)?(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1):!0},_prepareForDrawing:function(a){var l=new e.Point(a.x,a.y);this._reset(),this._addPoint(l),this.canvas.contextTop.moveTo(l.x,l.y)},_addPoint:function(a){return this._points.length>1&&a.eq(this._points[this._points.length-1])?!1:(this.drawStraightLine&&this._points.length>1&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(a),!0)},_reset:function(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1},_captureDrawingPath:function(a){var l=new e.Point(a.x,a.y);return this._addPoint(l)},_render:function(a){var l,c,d=this._points[0],p=this._points[1];if(a=a||this.canvas.contextTop,this._saveAndTransform(a),a.beginPath(),this._points.length===2&&d.x===p.x&&d.y===p.y){var y=this.width/1e3;d=new e.Point(d.x,d.y),p=new e.Point(p.x,p.y),d.x-=y,p.x+=y}for(a.moveTo(d.x,d.y),l=1,c=this._points.length;l=d&&(v=a[p],S.push(v));return S.push(a[y]),S},_finalizeAndAddPath:function(){var a=this.canvas.contextTop;a.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var l=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(l)){this.canvas.requestRenderAll();return}var c=this.createPath(l);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:c}),this.canvas.add(c),this.canvas.requestRenderAll(),c.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:c})}})}(),e.CircleBrush=e.util.createClass(e.BaseBrush,{width:10,initialize:function(a){this.canvas=a,this.points=[]},drawDot:function(a){var l=this.addPoint(a),c=this.canvas.contextTop;this._saveAndTransform(c),this.dot(c,l),c.restore()},dot:function(a,l){a.fillStyle=l.fill,a.beginPath(),a.arc(l.x,l.y,l.radius,0,Math.PI*2,!1),a.closePath(),a.fill()},onMouseDown:function(a){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(a)},_render:function(){var a=this.canvas.contextTop,l,c,d=this.points;for(this._saveAndTransform(a),l=0,c=d.length;l0&&!this.preserveObjectStacking){v=[],S=[];for(var I=0,O=this._objects.length;I1&&(this._activeObject._objects=S),v.push.apply(v,S)}else v=this._objects;return v},renderAll:function(){this.contextTopDirty&&!this._groupSelector&&!this.isDrawingMode&&(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&(this.renderTopLayer(this.contextTop),this.hasLostContext=!1);var p=this.contextContainer;return this.renderCanvas(p,this._chooseObjectsToRender()),this},renderTopLayer:function(p){p.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(p),this.contextTopDirty=!0),p.restore()},renderTop:function(){var p=this.contextTop;return this.clearContext(p),this.renderTopLayer(p),this.fire("after:render"),this},_normalizePointer:function(p,y){var v=p.calcTransformMatrix(),S=e.util.invertTransform(v),I=this.restorePointerVpt(y);return e.util.transformPoint(I,S)},isTargetTransparent:function(p,y,v){if(p.shouldCache()&&p._cacheCanvas&&p!==this._activeObject){var S=this._normalizePointer(p,{x:y,y:v}),I=Math.max(p.cacheTranslationX+S.x*p.zoomX,0),O=Math.max(p.cacheTranslationY+S.y*p.zoomY,0),V=e.util.isTransparent(p._cacheContext,Math.round(I),Math.round(O),this.targetFindTolerance);return V}var L=this.contextCache,N=p.selectionBackgroundColor,G=this.viewportTransform;p.selectionBackgroundColor="",this.clearContext(L),L.save(),L.transform(G[0],G[1],G[2],G[3],G[4],G[5]),p.render(L),L.restore(),p.selectionBackgroundColor=N;var V=e.util.isTransparent(L,y,v,this.targetFindTolerance);return V},_isSelectionKeyPressed:function(p){var y=!1;return Array.isArray(this.selectionKey)?y=!!this.selectionKey.find(function(v){return p[v]===!0}):y=p[this.selectionKey],y},_shouldClearSelection:function(p,y){var v=this.getActiveObjects(),S=this._activeObject;return!y||y&&S&&v.length>1&&v.indexOf(y)===-1&&S!==y&&!this._isSelectionKeyPressed(p)||y&&!y.evented||y&&!y.selectable&&S&&S!==y},_shouldCenterTransform:function(p,y,v){if(p){var S;return y==="scale"||y==="scaleX"||y==="scaleY"||y==="resizing"?S=this.centeredScaling||p.centeredScaling:y==="rotate"&&(S=this.centeredRotation||p.centeredRotation),S?!v:v}},_getOriginFromCorner:function(p,y){var v={x:p.originX,y:p.originY};return y==="ml"||y==="tl"||y==="bl"?v.x="right":(y==="mr"||y==="tr"||y==="br")&&(v.x="left"),y==="tl"||y==="mt"||y==="tr"?v.y="bottom":(y==="bl"||y==="mb"||y==="br")&&(v.y="top"),v},_getActionFromCorner:function(p,y,v,S){if(!y||!p)return"drag";var I=S.controls[y];return I.getActionName(v,I,S)},_setupCurrentTransform:function(p,y,v){if(y){var S=this.getPointer(p),I=y.__corner,O=y.controls[I],L=v&&I?O.getActionHandler(p,y,O):e.controlsUtils.dragHandler,N=this._getActionFromCorner(v,I,p,y),G=this._getOriginFromCorner(y,I),V=p[this.centeredKey],Y={target:y,action:N,actionHandler:L,corner:I,scaleX:y.scaleX,scaleY:y.scaleY,skewX:y.skewX,skewY:y.skewY,offsetX:S.x-y.left,offsetY:S.y-y.top,originX:G.x,originY:G.y,ex:S.x,ey:S.y,lastX:S.x,lastY:S.y,theta:l(y.angle),width:y.width*y.scaleX,shiftKey:p.shiftKey,altKey:V,original:e.util.saveObjectTransform(y)};this._shouldCenterTransform(y,N,V)&&(Y.originX="center",Y.originY="center"),Y.original.originX=G.x,Y.original.originY=G.y,this._currentTransform=Y,this._beforeTransform(p)}},setCursor:function(p){this.upperCanvasEl.style.cursor=p},_drawSelection:function(p){var y=this._groupSelector,v=new e.Point(y.ex,y.ey),S=e.util.transformPoint(v,this.viewportTransform),I=new e.Point(y.ex+y.left,y.ey+y.top),O=e.util.transformPoint(I,this.viewportTransform),L=Math.min(S.x,O.x),N=Math.min(S.y,O.y),G=Math.max(S.x,O.x),V=Math.max(S.y,O.y),Y=this.selectionLineWidth/2;this.selectionColor&&(p.fillStyle=this.selectionColor,p.fillRect(L,N,G-L,V-N)),!(!this.selectionLineWidth||!this.selectionBorderColor)&&(p.lineWidth=this.selectionLineWidth,p.strokeStyle=this.selectionBorderColor,L+=Y,N+=Y,G-=Y,V-=Y,e.Object.prototype._setLineDash.call(this,p,this.selectionDashArray),p.strokeRect(L,N,G-L,V-N))},findTarget:function(p,y){if(!this.skipTargetFind){var v=!0,S=this.getPointer(p,v),I=this._activeObject,O=this.getActiveObjects(),L,N,G=c(p),V=O.length>1&&!y||O.length===1;if(this.targets=[],V&&I._findTargetCorner(S,G)||O.length>1&&!y&&I===this._searchPossibleTargets([I],S))return I;if(O.length===1&&I===this._searchPossibleTargets([I],S))if(this.preserveObjectStacking)L=I,N=this.targets,this.targets=[];else return I;var Y=this._searchPossibleTargets(this._objects,S);return p[this.altSelectionKey]&&Y&&L&&Y!==L&&(Y=L,this.targets=N),Y}},_checkTarget:function(p,y,v){if(y&&y.visible&&y.evented&&y.containsPoint(p))if((this.perPixelTargetFind||y.perPixelTargetFind)&&!y.isEditing){var S=this.isTargetTransparent(y,v.x,v.y);if(!S)return!0}else return!0},_searchPossibleTargets:function(p,y){for(var v,S=p.length,I;S--;){var O=p[S],L=O.group?this._normalizePointer(O.group,y):y;if(this._checkTarget(L,O,y)){v=p[S],v.subTargetCheck&&v instanceof e.Group&&(I=this._searchPossibleTargets(v._objects,y),I&&this.targets.push(I));break}}return v},restorePointerVpt:function(p){return e.util.transformPoint(p,e.util.invertTransform(this.viewportTransform))},getPointer:function(p,y){if(this._absolutePointer&&!y)return this._absolutePointer;if(this._pointer&&y)return this._pointer;var v=a(p),S=this.upperCanvasEl,I=S.getBoundingClientRect(),O=I.width||0,L=I.height||0,N;(!O||!L)&&("top"in I&&"bottom"in I&&(L=Math.abs(I.top-I.bottom)),"right"in I&&"left"in I&&(O=Math.abs(I.right-I.left))),this.calcOffset(),v.x=v.x-this._offset.left,v.y=v.y-this._offset.top,y||(v=this.restorePointerVpt(v));var G=this.getRetinaScaling();return G!==1&&(v.x/=G,v.y/=G),O===0||L===0?N={width:1,height:1}:N={width:S.width/O,height:S.height/L},{x:v.x*N.width,y:v.y*N.height}},_createUpperCanvas:function(){var p=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),y=this.lowerCanvasEl,v=this.upperCanvasEl;v?v.className="":(v=this._createCanvasElement(),this.upperCanvasEl=v),e.util.addClass(v,"upper-canvas "+p),this.wrapperEl.appendChild(v),this._copyCanvasStyle(y,v),this._applyCanvasStyle(v),this.contextTop=v.getContext("2d")},getTopContext:function(){return this.contextTop},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=e.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),e.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),e.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(p){var y=this.width||p.width,v=this.height||p.height;e.util.setStyle(p,{position:"absolute",width:y+"px",height:v+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),p.width=y,p.height=v,e.util.makeElementUnselectable(p)},_copyCanvasStyle:function(p,y){y.style.cssText=p.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var p=this._activeObject;return p?p.type==="activeSelection"&&p._objects?p._objects.slice(0):[p]:[]},_onObjectRemoved:function(p){p===this._activeObject&&(this.fire("before:selection:cleared",{target:p}),this._discardActiveObject(),this.fire("selection:cleared",{target:p}),p.fire("deselected")),p===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",p)},_fireSelectionEvents:function(p,y){var v=!1,S=this.getActiveObjects(),I=[],O=[];p.forEach(function(L){S.indexOf(L)===-1&&(v=!0,L.fire("deselected",{e:y,target:L}),O.push(L))}),S.forEach(function(L){p.indexOf(L)===-1&&(v=!0,L.fire("selected",{e:y,target:L}),I.push(L))}),p.length>0&&S.length>0?v&&this.fire("selection:updated",{e:y,selected:I,deselected:O}):S.length>0?this.fire("selection:created",{e:y,selected:I}):p.length>0&&this.fire("selection:cleared",{e:y,deselected:O})},setActiveObject:function(p,y){var v=this.getActiveObjects();return this._setActiveObject(p,y),this._fireSelectionEvents(v,y),this},_setActiveObject:function(p,y){return this._activeObject===p||!this._discardActiveObject(y,p)||p.onSelect({e:y})?!1:(this._activeObject=p,!0)},_discardActiveObject:function(p,y){var v=this._activeObject;if(v){if(v.onDeselect({e:p,object:y}))return!1;this._activeObject=null}return!0},discardActiveObject:function(p){var y=this.getActiveObjects(),v=this.getActiveObject();return y.length&&this.fire("before:selection:cleared",{target:v,e:p}),this._discardActiveObject(p),this._fireSelectionEvents(y,p),this},dispose:function(){var p=this.wrapperEl;return this.removeListeners(),p.removeChild(this.upperCanvasEl),p.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(y){e.util.cleanUpJsdomNode(this[y]),this[y]=void 0}.bind(this)),p.parentNode&&p.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,e.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(p){var y=this._activeObject;y&&y._renderControls(p)},_toObject:function(p,y,v){var S=this._realizeGroupTransformOnObject(p),I=this.callSuper("_toObject",p,y,v);return this._unwindGroupTransformOnObject(p,S),I},_realizeGroupTransformOnObject:function(p){if(p.group&&p.group.type==="activeSelection"&&this._activeObject===p.group){var y=["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"],v={};return y.forEach(function(S){v[S]=p[S]}),e.util.addTransformToObject(p,this._activeObject.calcOwnMatrix()),v}else return null},_unwindGroupTransformOnObject:function(p,y){y&&p.set(y)},_setSVGObject:function(p,y,v){var S=this._realizeGroupTransformOnObject(y);this.callSuper("_setSVGObject",p,y,v),this._unwindGroupTransformOnObject(y,S)},setViewportTransform:function(p){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),e.StaticCanvas.prototype.setViewportTransform.call(this,p)}});for(var d in e.StaticCanvas)d!=="prototype"&&(e.Canvas[d]=e.StaticCanvas[d])}(),function(){var a=e.util.addListener,l=e.util.removeListener,c=3,d=2,p=1,y={passive:!1};function v(S,I){return S.button&&S.button===I-1}e.util.object.extend(e.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(a,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(S,I){var O=this.upperCanvasEl,L=this._getEventPrefix();S(e.window,"resize",this._onResize),S(O,L+"down",this._onMouseDown),S(O,L+"move",this._onMouseMove,y),S(O,L+"out",this._onMouseOut),S(O,L+"enter",this._onMouseEnter),S(O,"wheel",this._onMouseWheel),S(O,"contextmenu",this._onContextMenu),S(O,"dblclick",this._onDoubleClick),S(O,"dragover",this._onDragOver),S(O,"dragenter",this._onDragEnter),S(O,"dragleave",this._onDragLeave),S(O,"drop",this._onDrop),this.enablePointerEvents||S(O,"touchstart",this._onTouchStart,y),typeof eventjs<"u"&&I in eventjs&&(eventjs[I](O,"gesture",this._onGesture),eventjs[I](O,"drag",this._onDrag),eventjs[I](O,"orientation",this._onOrientationChange),eventjs[I](O,"shake",this._onShake),eventjs[I](O,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(l,"remove");var S=this._getEventPrefix();l(e.document,S+"up",this._onMouseUp),l(e.document,"touchend",this._onTouchEnd,y),l(e.document,S+"move",this._onMouseMove,y),l(e.document,"touchmove",this._onMouseMove,y)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._onDrop.bind(this),this.eventsBound=!0)},_onGesture:function(S,I){this.__onTransformGesture&&this.__onTransformGesture(S,I)},_onDrag:function(S,I){this.__onDrag&&this.__onDrag(S,I)},_onMouseWheel:function(S){this.__onMouseWheel(S)},_onMouseOut:function(S){var I=this._hoveredTarget;this.fire("mouse:out",{target:I,e:S}),this._hoveredTarget=null,I&&I.fire("mouseout",{e:S});var O=this;this._hoveredTargets.forEach(function(L){O.fire("mouse:out",{target:I,e:S}),L&&I.fire("mouseout",{e:S})}),this._hoveredTargets=[]},_onMouseEnter:function(S){!this._currentTransform&&!this.findTarget(S)&&(this.fire("mouse:over",{target:null,e:S}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(S,I){this.__onOrientationChange&&this.__onOrientationChange(S,I)},_onShake:function(S,I){this.__onShake&&this.__onShake(S,I)},_onLongPress:function(S,I){this.__onLongPress&&this.__onLongPress(S,I)},_onDragOver:function(S){S.preventDefault();var I=this._simpleEventHandler("dragover",S);this._fireEnterLeaveEvents(I,S)},_onDrop:function(S){return this._simpleEventHandler("drop:before",S),this._simpleEventHandler("drop",S)},_onContextMenu:function(S){return this.stopContextMenu&&(S.stopPropagation(),S.preventDefault()),!1},_onDoubleClick:function(S){this._cacheTransformEventData(S),this._handleEvent(S,"dblclick"),this._resetTransformEventData(S)},getPointerId:function(S){var I=S.changedTouches;return I?I[0]&&I[0].identifier:this.enablePointerEvents?S.pointerId:-1},_isMainEvent:function(S){return S.isPrimary===!0?!0:S.isPrimary===!1?!1:S.type==="touchend"&&S.touches.length===0?!0:S.changedTouches?S.changedTouches[0].identifier===this.mainTouchId:!0},_onTouchStart:function(S){S.preventDefault(),this.mainTouchId===null&&(this.mainTouchId=this.getPointerId(S)),this.__onMouseDown(S),this._resetTransformEventData();var I=this.upperCanvasEl,O=this._getEventPrefix();a(e.document,"touchend",this._onTouchEnd,y),a(e.document,"touchmove",this._onMouseMove,y),l(I,O+"down",this._onMouseDown)},_onMouseDown:function(S){this.__onMouseDown(S),this._resetTransformEventData();var I=this.upperCanvasEl,O=this._getEventPrefix();l(I,O+"move",this._onMouseMove,y),a(e.document,O+"up",this._onMouseUp),a(e.document,O+"move",this._onMouseMove,y)},_onTouchEnd:function(S){if(!(S.touches.length>0)){this.__onMouseUp(S),this._resetTransformEventData(),this.mainTouchId=null;var I=this._getEventPrefix();l(e.document,"touchend",this._onTouchEnd,y),l(e.document,"touchmove",this._onMouseMove,y);var O=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){a(O.upperCanvasEl,I+"down",O._onMouseDown),O._willAddMouseDown=0},400)}},_onMouseUp:function(S){this.__onMouseUp(S),this._resetTransformEventData();var I=this.upperCanvasEl,O=this._getEventPrefix();this._isMainEvent(S)&&(l(e.document,O+"up",this._onMouseUp),l(e.document,O+"move",this._onMouseMove,y),a(I,O+"move",this._onMouseMove,y))},_onMouseMove:function(S){!this.allowTouchScrolling&&S.preventDefault&&S.preventDefault(),this.__onMouseMove(S)},_onResize:function(){this.calcOffset()},_shouldRender:function(S){var I=this._activeObject;return!!I!=!!S||I&&S&&I!==S?!0:(I&&I.isEditing,!1)},__onMouseUp:function(S){var I,O=this._currentTransform,L=this._groupSelector,N=!1,G=!L||L.left===0&&L.top===0;if(this._cacheTransformEventData(S),I=this._target,this._handleEvent(S,"up:before"),v(S,c)){this.fireRightClick&&this._handleEvent(S,"up",c,G);return}if(v(S,d)){this.fireMiddleClick&&this._handleEvent(S,"up",d,G),this._resetTransformEventData();return}if(this.isDrawingMode&&this._isCurrentlyDrawing){this._onMouseUpInDrawingMode(S);return}if(this._isMainEvent(S)){if(O&&(this._finalizeCurrentTransform(S),N=O.actionPerformed),!G){var V=I===this._activeObject;this._maybeGroupObjects(S),N||(N=this._shouldRender(I)||!V&&I===this._activeObject)}var Y,X;if(I){if(Y=I._findTargetCorner(this.getPointer(S,!0),e.util.isTouchEvent(S)),I.selectable&&I!==this._activeObject&&I.activeOn==="up")this.setActiveObject(I,S),N=!0;else{var te=I.controls[Y],re=te&&te.getMouseUpHandler(S,I,te);re&&(X=this.getPointer(S),re(S,O,X.x,X.y))}I.isMoving=!1}if(O&&(O.target!==I||O.corner!==Y)){var fe=O.target&&O.target.controls[O.corner],ge=fe&&fe.getMouseUpHandler(S,I,te);X=X||this.getPointer(S),ge&&ge(S,O,X.x,X.y)}this._setCursorFromEvent(S,I),this._handleEvent(S,"up",p,G),this._groupSelector=null,this._currentTransform=null,I&&(I.__corner=0),N?this.requestRenderAll():G||this.renderTop()}},_simpleEventHandler:function(S,I){var O=this.findTarget(I),L=this.targets,N={e:I,target:O,subTargets:L};if(this.fire(S,N),O&&O.fire(S,N),!L)return O;for(var G=0;G1&&(p=new e.ActiveSelection(d.reverse(),{canvas:this}),this.setActiveObject(p,c))},_collectObjects:function(c){for(var d=[],p,y=this._groupSelector.ex,v=this._groupSelector.ey,S=y+this._groupSelector.left,I=v+this._groupSelector.top,O=new e.Point(a(y,S),a(v,I)),L=new e.Point(l(y,S),l(v,I)),N=!this.selectionFullyContained,G=y===S&&v===I,V=this._objects.length;V--&&(p=this._objects[V],!(!(!p||!p.selectable||!p.visible)&&(N&&p.intersectsWithRect(O,L,!0)||p.isContainedWithinRect(O,L,!0)||N&&p.containsPoint(O,null,!0)||N&&p.containsPoint(L,null,!0))&&(d.push(p),G))););return d.length>1&&(d=d.filter(function(Y){return!Y.onSelect({e:c})})),d},_maybeGroupObjects:function(c){this.selection&&this._groupSelector&&this._groupSelectedObjects(c),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),function(){e.util.object.extend(e.StaticCanvas.prototype,{toDataURL:function(a){a||(a={});var l=a.format||"png",c=a.quality||1,d=(a.multiplier||1)*(a.enableRetinaScaling?this.getRetinaScaling():1),p=this.toCanvasElement(d,a);return e.util.toDataURL(p,l,c)},toCanvasElement:function(a,l){a=a||1,l=l||{};var c=(l.width||this.width)*a,d=(l.height||this.height)*a,p=this.getZoom(),y=this.width,v=this.height,S=p*a,I=this.viewportTransform,O=(I[4]-(l.left||0))*a,L=(I[5]-(l.top||0))*a,N=this.interactive,G=[S,0,0,S,O,L],V=this.enableRetinaScaling,Y=e.util.createCanvasElement(),X=this.contextTop;return Y.width=c,Y.height=d,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=G,this.width=c,this.height=d,this.calcViewportBoundaries(),this.renderCanvas(Y.getContext("2d"),this._objects),this.viewportTransform=I,this.width=y,this.height=v,this.calcViewportBoundaries(),this.interactive=N,this.enableRetinaScaling=V,this.contextTop=X,Y}})}(),e.util.object.extend(e.StaticCanvas.prototype,{loadFromJSON:function(a,l,c){if(a){var d=typeof a=="string"?JSON.parse(a):e.util.object.clone(a),p=this,y=d.clipPath,v=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete d.clipPath,this._enlivenObjects(d.objects,function(S){p.clear(),p._setBgOverlay(d,function(){y?p._enlivenObjects([y],function(I){p.clipPath=I[0],p.__setupCanvas.call(p,d,S,v,l)}):p.__setupCanvas.call(p,d,S,v,l)})},c),this}},__setupCanvas:function(a,l,c,d){var p=this;l.forEach(function(y,v){p.insertAt(y,v)}),this.renderOnAddRemove=c,delete a.objects,delete a.backgroundImage,delete a.overlayImage,delete a.background,delete a.overlay,this._setOptions(a),this.renderAll(),d&&d()},_setBgOverlay:function(a,l){var c={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(!a.backgroundImage&&!a.overlayImage&&!a.background&&!a.overlay){l&&l();return}var d=function(){c.backgroundImage&&c.overlayImage&&c.backgroundColor&&c.overlayColor&&l&&l()};this.__setBgOverlay("backgroundImage",a.backgroundImage,c,d),this.__setBgOverlay("overlayImage",a.overlayImage,c,d),this.__setBgOverlay("backgroundColor",a.background,c,d),this.__setBgOverlay("overlayColor",a.overlay,c,d)},__setBgOverlay:function(a,l,c,d){var p=this;if(!l){c[a]=!0,d&&d();return}a==="backgroundImage"||a==="overlayImage"?e.util.enlivenObjects([l],function(y){p[a]=y[0],c[a]=!0,d&&d()}):this["set"+e.util.string.capitalize(a,!0)](l,function(){c[a]=!0,d&&d()})},_enlivenObjects:function(a,l,c){if(!a||a.length===0){l&&l([]);return}e.util.enlivenObjects(a,function(d){l&&l(d)},null,c)},_toDataURL:function(a,l){this.clone(function(c){l(c.toDataURL(a))})},_toDataURLWithMultiplier:function(a,l,c){this.clone(function(d){c(d.toDataURLWithMultiplier(a,l))})},clone:function(a,l){var c=JSON.stringify(this.toJSON(l));this.cloneWithoutData(function(d){d.loadFromJSON(c,function(){a&&a(d)})})},cloneWithoutData:function(a){var l=e.util.createCanvasElement();l.width=this.width,l.height=this.height;var c=new e.Canvas(l);this.backgroundImage?(c.setBackgroundImage(this.backgroundImage.src,function(){c.renderAll(),a&&a(c)}),c.backgroundImageOpacity=this.backgroundImageOpacity,c.backgroundImageStretch=this.backgroundImageStretch):a&&a(c)}}),function(a){var l=a.fabric||(a.fabric={}),c=l.util.object.extend,d=l.util.object.clone,p=l.util.toFixed,y=l.util.string.capitalize,v=l.util.degreesToRadians,S=!l.isLikelyNode,I=2;l.Object||(l.Object=l.util.createClass(l.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:S,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(O){O&&this.setOptions(O)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=l.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(O){var L=l.perfLimitSizeTotal,N=O.width,G=O.height,V=l.maxCacheSideLimit,Y=l.minCacheSideLimit;if(N<=V&&G<=V&&N*G<=L)return Nfe&&(O.zoomX/=N/fe,O.width=fe,O.capped=!0),G>ge&&(O.zoomY/=G/ge,O.height=ge,O.capped=!0),O},_getCacheCanvasDimensions:function(){var O=this.getTotalObjectScaling(),L=this._getTransformedDimensions(0,0),N=L.x*O.scaleX/this.scaleX,G=L.y*O.scaleY/this.scaleY;return{width:N+I,height:G+I,zoomX:O.scaleX,zoomY:O.scaleY,x:N,y:G}},_updateCacheCanvas:function(){var O=this.canvas;if(this.noScaleCache&&O&&O._currentTransform){var L=O._currentTransform.target,N=O._currentTransform.action;if(this===L&&N.slice&&N.slice(0,5)==="scale")return!1}var G=this._cacheCanvas,V=this._limitCacheSize(this._getCacheCanvasDimensions()),Y=l.minCacheSideLimit,X=V.width,te=V.height,re,fe,ge=V.zoomX,_e=V.zoomY,Ie=X!==this.cacheWidth||te!==this.cacheHeight,ke=this.zoomX!==ge||this.zoomY!==_e,Ne=Ie||ke,J=0,he=0,xe=!1;if(Ie){var Pe=this._cacheCanvas.width,Oe=this._cacheCanvas.height,Ae=X>Pe||te>Oe,ze=(XY&&Oe>Y;xe=Ae||ze,Ae&&!V.capped&&(X>Y||te>Y)&&(J=X*.1,he=te*.1)}return this instanceof l.Text&&this.path&&(Ne=!0,xe=!0,J+=this.getHeightOfLine(0)*this.zoomX,he+=this.getHeightOfLine(0)*this.zoomY),Ne?(xe?(G.width=Math.ceil(X+J),G.height=Math.ceil(te+he)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,G.width,G.height)),re=V.x/2,fe=V.y/2,this.cacheTranslationX=Math.round(G.width/2-re)+re,this.cacheTranslationY=Math.round(G.height/2-fe)+fe,this.cacheWidth=X,this.cacheHeight=te,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(ge,_e),this.zoomX=ge,this.zoomY=_e,!0):!1},setOptions:function(O){this._setOptions(O),this._initGradient(O.fill,"fill"),this._initGradient(O.stroke,"stroke"),this._initPattern(O.fill,"fill"),this._initPattern(O.stroke,"stroke")},transform:function(O){var L=this.group&&!this.group._transformDone||this.group&&this.canvas&&O===this.canvas.contextTop,N=this.calcTransformMatrix(!L);O.transform(N[0],N[1],N[2],N[3],N[4],N[5])},toObject:function(O){var L=l.Object.NUM_FRACTION_DIGITS,N={type:this.type,version:l.version,originX:this.originX,originY:this.originY,left:p(this.left,L),top:p(this.top,L),width:p(this.width,L),height:p(this.height,L),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:p(this.strokeWidth,L),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:p(this.strokeMiterLimit,L),scaleX:p(this.scaleX,L),scaleY:p(this.scaleY,L),angle:p(this.angle,L),flipX:this.flipX,flipY:this.flipY,opacity:p(this.opacity,L),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:p(this.skewX,L),skewY:p(this.skewY,L)};return this.clipPath&&!this.clipPath.excludeFromExport&&(N.clipPath=this.clipPath.toObject(O),N.clipPath.inverted=this.clipPath.inverted,N.clipPath.absolutePositioned=this.clipPath.absolutePositioned),l.util.populateWithProperties(this,N,O),this.includeDefaultValues||(N=this._removeDefaultValues(N)),N},toDatalessObject:function(O){return this.toObject(O)},_removeDefaultValues:function(O){var L=l.util.getKlass(O.type).prototype,N=L.stateProperties;return N.forEach(function(G){G==="left"||G==="top"||(O[G]===L[G]&&delete O[G],Array.isArray(O[G])&&Array.isArray(L[G])&&O[G].length===0&&L[G].length===0&&delete O[G])}),O},toString:function(){return"#"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var O=l.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(O.scaleX),scaleY:Math.abs(O.scaleY)}},getTotalObjectScaling:function(){var O=this.getObjectScaling(),L=O.scaleX,N=O.scaleY;if(this.canvas){var G=this.canvas.getZoom(),V=this.canvas.getRetinaScaling();L*=G*V,N*=G*V}return{scaleX:L,scaleY:N}},getObjectOpacity:function(){var O=this.opacity;return this.group&&(O*=this.group.getObjectOpacity()),O},_set:function(O,L){var N=O==="scaleX"||O==="scaleY",G=this[O]!==L,V=!1;return N&&(L=this._constrainScale(L)),O==="scaleX"&&L<0?(this.flipX=!this.flipX,L*=-1):O==="scaleY"&&L<0?(this.flipY=!this.flipY,L*=-1):O==="shadow"&&L&&!(L instanceof l.Shadow)?L=new l.Shadow(L):O==="dirty"&&this.group&&this.group.set("dirty",L),this[O]=L,G&&(V=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(O)>-1?(this.dirty=!0,V&&this.group.set("dirty",!0)):V&&this.stateProperties.indexOf(O)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:l.iMatrix.concat()},isNotVisible:function(){return this.opacity===0||!this.width&&!this.height&&this.strokeWidth===0||!this.visible},render:function(O){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(O.save(),this._setupCompositeOperation(O),this.drawSelectionBackground(O),this.transform(O),this._setOpacity(O),this._setShadow(O,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(O)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(O),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),O.restore())},renderCache:function(O){O=O||{},(!this._cacheCanvas||!this._cacheContext)&&this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,O.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this._cacheContext=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&this.stroke!=="transparent"&&this.strokeWidth!==0},hasFill:function(){return this.fill&&this.fill!=="transparent"},needsItsOwnCache:function(){return!!(this.paintFirst==="stroke"&&this.hasFill()&&this.hasStroke()&&typeof this.shadow=="object"||this.clipPath)},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(this.shadow.offsetX!==0||this.shadow.offsetY!==0)},drawClipPathOnCache:function(O,L){if(O.save(),L.inverted?O.globalCompositeOperation="destination-out":O.globalCompositeOperation="destination-in",L.absolutePositioned){var N=l.util.invertTransform(this.calcTransformMatrix());O.transform(N[0],N[1],N[2],N[3],N[4],N[5])}L.transform(O),O.scale(1/L.zoomX,1/L.zoomY),O.drawImage(L._cacheCanvas,-L.cacheTranslationX,-L.cacheTranslationY),O.restore()},drawObject:function(O,L){var N=this.fill,G=this.stroke;L?(this.fill="black",this.stroke="",this._setClippingProperties(O)):this._renderBackground(O),this._render(O),this._drawClipPath(O,this.clipPath),this.fill=N,this.stroke=G},_drawClipPath:function(O,L){L&&(L.canvas=this.canvas,L.shouldCache(),L._transformDone=!0,L.renderCache({forClipping:!0}),this.drawClipPathOnCache(O,L))},drawCacheOnCanvas:function(O){O.scale(1/this.zoomX,1/this.zoomY),O.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(O){if(this.isNotVisible())return!1;if(this._cacheCanvas&&this._cacheContext&&!O&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&this._cacheContext&&!O){var L=this.cacheWidth/this.zoomX,N=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-L/2,-N/2,L,N)}return!0}return!1},_renderBackground:function(O){if(this.backgroundColor){var L=this._getNonTransformedDimensions();O.fillStyle=this.backgroundColor,O.fillRect(-L.x/2,-L.y/2,L.x,L.y),this._removeShadow(O)}},_setOpacity:function(O){this.group&&!this.group._transformDone?O.globalAlpha=this.getObjectOpacity():O.globalAlpha*=this.opacity},_setStrokeStyles:function(O,L){var N=L.stroke;N&&(O.lineWidth=L.strokeWidth,O.lineCap=L.strokeLineCap,O.lineDashOffset=L.strokeDashOffset,O.lineJoin=L.strokeLineJoin,O.miterLimit=L.strokeMiterLimit,N.toLive?N.gradientUnits==="percentage"||N.gradientTransform||N.patternTransform?this._applyPatternForTransformedGradient(O,N):(O.strokeStyle=N.toLive(O,this),this._applyPatternGradientTransform(O,N)):O.strokeStyle=L.stroke)},_setFillStyles:function(O,L){var N=L.fill;N&&(N.toLive?(O.fillStyle=N.toLive(O,this),this._applyPatternGradientTransform(O,L.fill)):O.fillStyle=N)},_setClippingProperties:function(O){O.globalAlpha=1,O.strokeStyle="transparent",O.fillStyle="#000000"},_setLineDash:function(O,L){!L||L.length===0||(1&L.length&&L.push.apply(L,L),O.setLineDash(L))},_renderControls:function(O,L){var N=this.getViewportTransform(),G=this.calcTransformMatrix(),V,Y,X;L=L||{},Y=typeof L.hasBorders<"u"?L.hasBorders:this.hasBorders,X=typeof L.hasControls<"u"?L.hasControls:this.hasControls,G=l.util.multiplyTransformMatrices(N,G),V=l.util.qrDecompose(G),O.save(),O.translate(V.translateX,V.translateY),O.lineWidth=1*this.borderScaleFactor,this.group||(O.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(V.angle-=180),O.rotate(v(this.group?V.angle:this.angle)),L.forActiveSelection||this.group?Y&&this.drawBordersInGroup(O,V,L):Y&&this.drawBorders(O,L),X&&this.drawControls(O,L),O.restore()},_setShadow:function(O){if(this.shadow){var L=this.shadow,N=this.canvas,G,V=N&&N.viewportTransform[0]||1,Y=N&&N.viewportTransform[3]||1;L.nonScaling?G={scaleX:1,scaleY:1}:G=this.getObjectScaling(),N&&N._isRetinaScaling()&&(V*=l.devicePixelRatio,Y*=l.devicePixelRatio),O.shadowColor=L.color,O.shadowBlur=L.blur*l.browserShadowBlurConstant*(V+Y)*(G.scaleX+G.scaleY)/4,O.shadowOffsetX=L.offsetX*V*G.scaleX,O.shadowOffsetY=L.offsetY*Y*G.scaleY}},_removeShadow:function(O){this.shadow&&(O.shadowColor="",O.shadowBlur=O.shadowOffsetX=O.shadowOffsetY=0)},_applyPatternGradientTransform:function(O,L){if(!L||!L.toLive)return{offsetX:0,offsetY:0};var N=L.gradientTransform||L.patternTransform,G=-this.width/2+L.offsetX||0,V=-this.height/2+L.offsetY||0;return L.gradientUnits==="percentage"?O.transform(this.width,0,0,this.height,G,V):O.transform(1,0,0,1,G,V),N&&O.transform(N[0],N[1],N[2],N[3],N[4],N[5]),{offsetX:G,offsetY:V}},_renderPaintInOrder:function(O){this.paintFirst==="stroke"?(this._renderStroke(O),this._renderFill(O)):(this._renderFill(O),this._renderStroke(O))},_render:function(){},_renderFill:function(O){this.fill&&(O.save(),this._setFillStyles(O,this),this.fillRule==="evenodd"?O.fill("evenodd"):O.fill(),O.restore())},_renderStroke:function(O){if(!(!this.stroke||this.strokeWidth===0)){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(O),O.save(),this.strokeUniform&&this.group){var L=this.getObjectScaling();O.scale(1/L.scaleX,1/L.scaleY)}else this.strokeUniform&&O.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(O,this.strokeDashArray),this._setStrokeStyles(O,this),O.stroke(),O.restore()}},_applyPatternForTransformedGradient:function(O,L){var N=this._limitCacheSize(this._getCacheCanvasDimensions()),G=l.util.createCanvasElement(),V,Y=this.canvas.getRetinaScaling(),X=N.x/this.scaleX/Y,te=N.y/this.scaleY/Y;G.width=X,G.height=te,V=G.getContext("2d"),V.beginPath(),V.moveTo(0,0),V.lineTo(X,0),V.lineTo(X,te),V.lineTo(0,te),V.closePath(),V.translate(X/2,te/2),V.scale(N.zoomX/this.scaleX/Y,N.zoomY/this.scaleY/Y),this._applyPatternGradientTransform(V,L),V.fillStyle=L.toLive(O),V.fill(),O.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),O.scale(Y*this.scaleX/N.zoomX,Y*this.scaleY/N.zoomY),O.strokeStyle=V.createPattern(G,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var O=l.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",O.scaleX),this.set("scaleY",O.scaleY),this.angle=O.angle,this.skewX=O.skewX,this.skewY=0}},_removeTransformMatrix:function(O){var L=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),L=l.util.transformPoint(L,this.transformMatrix)),this.transformMatrix=null,O&&(this.scaleX*=O.scaleX,this.scaleY*=O.scaleY,this.cropX=O.cropX,this.cropY=O.cropY,L.x+=O.offsetLeft,L.y+=O.offsetTop,this.width=O.width,this.height=O.height),this.setPositionByOrigin(L,"center","center")},clone:function(O,L){var N=this.toObject(L);this.constructor.fromObject?this.constructor.fromObject(N,O):l.Object._fromObject("Object",N,O)},cloneAsImage:function(O,L){var N=this.toCanvasElement(L);return O&&O(new l.Image(N)),this},toCanvasElement:function(O){O||(O={});var L=l.util,N=L.saveObjectTransform(this),G=this.group,V=this.shadow,Y=Math.abs,X=(O.multiplier||1)*(O.enableRetinaScaling?l.devicePixelRatio:1);delete this.group,O.withoutTransform&&L.resetObjectTransform(this),O.withoutShadow&&(this.shadow=null);var te=l.util.createCanvasElement(),re=this.getBoundingRect(!0,!0),fe=this.shadow,ge,_e={x:0,y:0},Ie,ke,Ne;fe&&(Ie=fe.blur,fe.nonScaling?ge={scaleX:1,scaleY:1}:ge=this.getObjectScaling(),_e.x=2*Math.round(Y(fe.offsetX)+Ie)*Y(ge.scaleX),_e.y=2*Math.round(Y(fe.offsetY)+Ie)*Y(ge.scaleY)),ke=re.width+_e.x,Ne=re.height+_e.y,te.width=Math.ceil(ke),te.height=Math.ceil(Ne);var J=new l.StaticCanvas(te,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});O.format==="jpeg"&&(J.backgroundColor="#fff"),this.setPositionByOrigin(new l.Point(J.width/2,J.height/2),"center","center");var he=this.canvas;J.add(this);var xe=J.toCanvasElement(X||1,O);return this.shadow=V,this.set("canvas",he),G&&(this.group=G),this.set(N).setCoords(),J._objects=[],J.dispose(),J=null,xe},toDataURL:function(O){return O||(O={}),l.util.toDataURL(this.toCanvasElement(O),O.format||"png",O.quality||1)},isType:function(O){return arguments.length>1?Array.from(arguments).includes(this.type):this.type===O},complexity:function(){return 1},toJSON:function(O){return this.toObject(O)},rotate:function(O){var L=(this.originX!=="center"||this.originY!=="center")&&this.centeredRotation;return L&&this._setOriginToCenter(),this.set("angle",O),L&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(O,L){L=L||this.canvas.getPointer(O);var N=new l.Point(L.x,L.y),G=this._getLeftTopCoords();return this.angle&&(N=l.util.rotatePoint(N,G,v(-this.angle))),{x:N.x-G.x,y:N.y-G.y}},_setupCompositeOperation:function(O){this.globalCompositeOperation&&(O.globalCompositeOperation=this.globalCompositeOperation)},dispose:function(){l.runningAnimations&&l.runningAnimations.cancelByTarget(this)}}),l.util.createAccessors&&l.util.createAccessors(l.Object),c(l.Object.prototype,l.Observable),l.Object.NUM_FRACTION_DIGITS=2,l.Object.ENLIVEN_PROPS=["clipPath"],l.Object._fromObject=function(O,L,N,G){var V=l[O];L=d(L,!0),l.util.enlivenPatterns([L.fill,L.stroke],function(Y){typeof Y[0]<"u"&&(L.fill=Y[0]),typeof Y[1]<"u"&&(L.stroke=Y[1]),l.util.enlivenObjectEnlivables(L,L,function(){var X=G?new V(L[G],L):new V(L);N&&N(X)})})},l.Object.__uid=0)}(t),function(){var a=e.util.degreesToRadians,l={left:-.5,center:0,right:.5},c={top:-.5,center:0,bottom:.5};e.util.object.extend(e.Object.prototype,{translateToGivenOrigin:function(d,p,y,v,S){var I=d.x,O=d.y,L,N,G;return typeof p=="string"?p=l[p]:p-=.5,typeof v=="string"?v=l[v]:v-=.5,L=v-p,typeof y=="string"?y=c[y]:y-=.5,typeof S=="string"?S=c[S]:S-=.5,N=S-y,(L||N)&&(G=this._getTransformedDimensions(),I=d.x+L*G.x,O=d.y+N*G.y),new e.Point(I,O)},translateToCenterPoint:function(d,p,y){var v=this.translateToGivenOrigin(d,p,y,"center","center");return this.angle?e.util.rotatePoint(v,d,a(this.angle)):v},translateToOriginPoint:function(d,p,y){var v=this.translateToGivenOrigin(d,"center","center",p,y);return this.angle?e.util.rotatePoint(v,d,a(this.angle)):v},getCenterPoint:function(){var d=new e.Point(this.left,this.top);return this.translateToCenterPoint(d,this.originX,this.originY)},getPointByOrigin:function(d,p){var y=this.getCenterPoint();return this.translateToOriginPoint(y,d,p)},toLocalPoint:function(d,p,y){var v=this.getCenterPoint(),S,I;return typeof p<"u"&&typeof y<"u"?S=this.translateToGivenOrigin(v,"center","center",p,y):S=new e.Point(this.left,this.top),I=new e.Point(d.x,d.y),this.angle&&(I=e.util.rotatePoint(I,v,-a(this.angle))),I.subtractEquals(S)},setPositionByOrigin:function(d,p,y){var v=this.translateToCenterPoint(d,p,y),S=this.translateToOriginPoint(v,this.originX,this.originY);this.set("left",S.x),this.set("top",S.y)},adjustPosition:function(d){var p=a(this.angle),y=this.getScaledWidth(),v=e.util.cos(p)*y,S=e.util.sin(p)*y,I,O;typeof this.originX=="string"?I=l[this.originX]:I=this.originX-.5,typeof d=="string"?O=l[d]:O=d-.5,this.left+=v*(O-I),this.top+=S*(O-I),this.setCoords(),this.originX=d},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var d=this.getCenterPoint();this.originX="center",this.originY="center",this.left=d.x,this.top=d.y},_resetOrigin:function(){var d=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=d.x,this.top=d.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){function a(y){return[new e.Point(y.tl.x,y.tl.y),new e.Point(y.tr.x,y.tr.y),new e.Point(y.br.x,y.br.y),new e.Point(y.bl.x,y.bl.y)]}var l=e.util,c=l.degreesToRadians,d=l.multiplyTransformMatrices,p=l.transformPoint;l.object.extend(e.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(y,v){return v?y?this.calcACoords():this.calcLineCoords():((!this.aCoords||!this.lineCoords)&&this.setCoords(!0),y?this.aCoords:this.lineCoords)},getCoords:function(y,v){return a(this._getCoords(y,v))},intersectsWithRect:function(y,v,S,I){var O=this.getCoords(S,I),L=e.Intersection.intersectPolygonRectangle(O,y,v);return L.status==="Intersection"},intersectsWithObject:function(y,v,S){var I=e.Intersection.intersectPolygonPolygon(this.getCoords(v,S),y.getCoords(v,S));return I.status==="Intersection"||y.isContainedWithinObject(this,v,S)||this.isContainedWithinObject(y,v,S)},isContainedWithinObject:function(y,v,S){for(var I=this.getCoords(v,S),O=v?y.aCoords:y.lineCoords,L=0,N=y._getImageLines(O);L<4;L++)if(!y.containsPoint(I[L],N))return!1;return!0},isContainedWithinRect:function(y,v,S,I){var O=this.getBoundingRect(S,I);return O.left>=y.x&&O.left+O.width<=v.x&&O.top>=y.y&&O.top+O.height<=v.y},containsPoint:function(y,L,S,I){var O=this._getCoords(S,I),L=L||this._getImageLines(O),N=this._findCrossPoints(y,L);return N!==0&&N%2===1},isOnScreen:function(y){if(!this.canvas)return!1;var v=this.canvas.vptCoords.tl,S=this.canvas.vptCoords.br,I=this.getCoords(!0,y);return I.some(function(O){return O.x<=S.x&&O.x>=v.x&&O.y<=S.y&&O.y>=v.y})||this.intersectsWithRect(v,S,!0,y)?!0:this._containsCenterOfCanvas(v,S,y)},_containsCenterOfCanvas:function(y,v,S){var I={x:(y.x+v.x)/2,y:(y.y+v.y)/2};return!!this.containsPoint(I,null,!0,S)},isPartiallyOnScreen:function(y){if(!this.canvas)return!1;var v=this.canvas.vptCoords.tl,S=this.canvas.vptCoords.br;if(this.intersectsWithRect(v,S,!0,y))return!0;var I=this.getCoords(!0,y).every(function(O){return(O.x>=S.x||O.x<=v.x)&&(O.y>=S.y||O.y<=v.y)});return I&&this._containsCenterOfCanvas(v,S,y)},_getImageLines:function(y){var v={topline:{o:y.tl,d:y.tr},rightline:{o:y.tr,d:y.br},bottomline:{o:y.br,d:y.bl},leftline:{o:y.bl,d:y.tl}};return v},_findCrossPoints:function(y,v){var S,I,O,L,N,G=0,V;for(var Y in v)if(V=v[Y],!(V.o.y=y.y&&V.d.y>=y.y)&&(V.o.x===V.d.x&&V.o.x>=y.x?N=V.o.x:(S=0,I=(V.d.y-V.o.y)/(V.d.x-V.o.x),O=y.y-S*y.x,L=V.o.y-I*V.o.x,N=-(O-L)/(S-I)),N>=y.x&&(G+=1),G===2))break;return G},getBoundingRect:function(y,v){var S=this.getCoords(y,v);return l.makeBoundingBoxFromPoints(S)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(y){return Math.abs(y)"u"&&(y=this.skewX),typeof v>"u"&&(v=this.skewY);var S,I,O,L=y===0&&v===0;if(this.strokeUniform?(I=this.width,O=this.height):(S=this._getNonTransformedDimensions(),I=S.x,O=S.y),L)return this._finalizeDimensions(I*this.scaleX,O*this.scaleY);var N=l.sizeAfterTransform(I,O,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:y,skewY:v});return this._finalizeDimensions(N.x,N.y)},_finalizeDimensions:function(y,v){return this.strokeUniform?{x:y+this.strokeWidth,y:v+this.strokeWidth}:{x:y,y:v}},_calculateCurrentDimensions:function(){var y=this.getViewportTransform(),v=this._getTransformedDimensions(),S=p(v,y,!0);return S.scalarAdd(2*this.padding)}})}(),e.util.object.extend(e.Object.prototype,{sendToBack:function(){return this.group?e.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?e.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(a){return this.group?e.StaticCanvas.prototype.sendBackwards.call(this.group,this,a):this.canvas&&this.canvas.sendBackwards(this,a),this},bringForward:function(a){return this.group?e.StaticCanvas.prototype.bringForward.call(this.group,this,a):this.canvas&&this.canvas.bringForward(this,a),this},moveTo:function(a){return this.group&&this.group.type!=="activeSelection"?e.StaticCanvas.prototype.moveTo.call(this.group,this,a):this.canvas&&this.canvas.moveTo(this,a),this}}),function(){function a(c,d){if(d){if(d.toLive)return c+": url(#SVGID_"+d.id+"); ";var p=new e.Color(d),y=c+": "+p.toRgb()+"; ",v=p.getAlpha();return v!==1&&(y+=c+"-opacity: "+v.toString()+"; "),y}else return c+": none; "}var l=e.util.toFixed;e.util.object.extend(e.Object.prototype,{getSvgStyles:function(c){var d=this.fillRule?this.fillRule:"nonzero",p=this.strokeWidth?this.strokeWidth:"0",y=this.strokeDashArray?this.strokeDashArray.join(" "):"none",v=this.strokeDashOffset?this.strokeDashOffset:"0",S=this.strokeLineCap?this.strokeLineCap:"butt",I=this.strokeLineJoin?this.strokeLineJoin:"miter",O=this.strokeMiterLimit?this.strokeMiterLimit:"4",L=typeof this.opacity<"u"?this.opacity:"1",N=this.visible?"":" visibility: hidden;",G=c?"":this.getSvgFilter(),V=a("fill",this.fill),Y=a("stroke",this.stroke);return[Y,"stroke-width: ",p,"; ","stroke-dasharray: ",y,"; ","stroke-linecap: ",S,"; ","stroke-dashoffset: ",v,"; ","stroke-linejoin: ",I,"; ","stroke-miterlimit: ",O,"; ",V,"fill-rule: ",d,"; ","opacity: ",L,";",G,N].join("")},getSvgSpanStyles:function(c,d){var p="; ",v=c.fontFamily?"font-family: "+(c.fontFamily.indexOf("'")===-1&&c.fontFamily.indexOf('"')===-1?"'"+c.fontFamily+"'":c.fontFamily)+p:"",y=c.strokeWidth?"stroke-width: "+c.strokeWidth+p:"",v=v,S=c.fontSize?"font-size: "+c.fontSize+"px"+p:"",I=c.fontStyle?"font-style: "+c.fontStyle+p:"",O=c.fontWeight?"font-weight: "+c.fontWeight+p:"",L=c.fill?a("fill",c.fill):"",N=c.stroke?a("stroke",c.stroke):"",G=this.getSvgTextDecoration(c),V=c.deltaY?"baseline-shift: "+-c.deltaY+"; ":"";return G&&(G="text-decoration: "+G+p),[N,y,v,S,I,O,G,L,V,d?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(c){return["overline","underline","line-through"].filter(function(d){return c[d.replace("-","")]}).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(c,d){var p=c?this.calcTransformMatrix():this.calcOwnMatrix(),y='transform="'+e.util.matrixToSVG(p);return y+(d||"")+'" '},_setSVGBg:function(c){if(this.backgroundColor){var d=e.Object.NUM_FRACTION_DIGITS;c.push(" -`)}},toSVG:function(c){return this._createBaseSVGMarkup(this._toSVG(c),{reviver:c})},toClipPathSVG:function(c){return" "+this._createBaseClipPathSVGMarkup(this._toSVG(c),{reviver:c})},_createBaseClipPathSVGMarkup:function(c,d){d=d||{};var p=d.reviver,y=d.additionalTransform||"",v=[this.getSvgTransform(!0,y),this.getSvgCommons()].join(""),S=c.indexOf("COMMON_PARTS");return c[S]=v,p?p(c.join("")):c.join("")},_createBaseSVGMarkup:function(c,d){d=d||{};var p=d.noStyle,y=d.reviver,v=p?"":'style="'+this.getSvgStyles()+'" ',S=d.withShadow?'style="'+this.getSvgFilter()+'" ':"",I=this.clipPath,O=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",L=I&&I.absolutePositioned,N=this.stroke,G=this.fill,V=this.shadow,Y,X=[],te,re=c.indexOf("COMMON_PARTS"),fe=d.additionalTransform;return I&&(I.clipPathId="CLIPPATH_"+e.Object.__uid++,te=' +`].join("");return P&&(P=[' +`].join("")),P},_setSVGObjects:function(P,F){var k,j,V,Y=this._objects;for(j=0,V=Y.length;j +`)}else P.push(' +`)},sendToBack:function(P){if(!P)return this;var F=this._activeObject,k,j,V;if(P===F&&P.type==="activeSelection")for(V=F._objects,k=V.length;k--;)j=V[k],c(this._objects,j),this._objects.unshift(j);else c(this._objects,P),this._objects.unshift(P);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(P){if(!P)return this;var F=this._activeObject,k,j,V;if(P===F&&P.type==="activeSelection")for(V=F._objects,k=0;k0+ie&&(X=Y-1,c(this._objects,V),this._objects.splice(X,0,V)),ie++;else Y=this._objects.indexOf(P),Y!==0&&(X=this._findNewLowerIndex(P,Y,F),c(this._objects,P),this._objects.splice(X,0,P));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(P,F,k){var j,V;if(k)for(j=F,V=F-1;V>=0;--V){var Y=P.intersectsWithObject(this._objects[V])||P.isContainedWithinObject(this._objects[V])||this._objects[V].isContainedWithinObject(P);if(Y){j=V;break}}else j=F-1;return j},bringForward:function(P,F){if(!P)return this;var k=this._activeObject,j,V,Y,X,Z,ie=0;if(P===k&&P.type==="activeSelection")for(Z=k._objects,j=Z.length;j--;)V=Z[j],Y=this._objects.indexOf(V),Y"}}),a(e.StaticCanvas.prototype,e.Observable),a(e.StaticCanvas.prototype,e.Collection),a(e.StaticCanvas.prototype,e.DataURLExporter),a(e.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(P){var F=x();if(!F||!F.getContext)return null;var k=F.getContext("2d");if(!k)return null;switch(P){case"setLineDash":return typeof k.setLineDash<"u";default:return null}}}),e.StaticCanvas.prototype.toJSON=e.StaticCanvas.prototype.toObject,e.isLikelyNode&&(e.StaticCanvas.prototype.createPNGStream=function(){var P=v(this.lowerCanvasEl);return P&&P.createPNGStream()},e.StaticCanvas.prototype.createJPEGStream=function(P){var F=v(this.lowerCanvasEl);return F&&F.createJPEGStream(P)})}(),e.BaseBrush=e.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(a){a.strokeStyle=this.color,a.lineWidth=this.width,a.lineCap=this.strokeLineCap,a.miterLimit=this.strokeMiterLimit,a.lineJoin=this.strokeLineJoin,a.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(a){var l=this.canvas.viewportTransform;a.save(),a.transform(l[0],l[1],l[2],l[3],l[4],l[5])},_setShadow:function(){if(this.shadow){var a=this.canvas,l=this.shadow,c=a.contextTop,h=a.getZoom();a&&a._isRetinaScaling()&&(h*=e.devicePixelRatio),c.shadowColor=l.color,c.shadowBlur=l.blur*h,c.shadowOffsetX=l.offsetX*h,c.shadowOffsetY=l.offsetY*h}},needsFullRender:function(){var a=new e.Color(this.color);return a.getAlpha()<1||!!this.shadow},_resetShadow:function(){var a=this.canvas.contextTop;a.shadowColor="",a.shadowBlur=a.shadowOffsetX=a.shadowOffsetY=0},_isOutSideCanvas:function(a){return a.x<0||a.x>this.canvas.getWidth()||a.y<0||a.y>this.canvas.getHeight()}}),function(){e.PencilBrush=e.util.createClass(e.BaseBrush,{decimate:.4,drawStraightLine:!1,straightLineKey:"shiftKey",initialize:function(a){this.canvas=a,this._points=[]},needsFullRender:function(){return this.callSuper("needsFullRender")||this._hasStraightLine},_drawSegment:function(a,l,c){var h=l.midPointFrom(c);return a.quadraticCurveTo(l.x,l.y,h.x,h.y),h},onMouseDown:function(a,l){this.canvas._isMainEvent(l.e)&&(this.drawStraightLine=l.e[this.straightLineKey],this._prepareForDrawing(a),this._captureDrawingPath(a),this._render())},onMouseMove:function(a,l){if(this.canvas._isMainEvent(l.e)&&(this.drawStraightLine=l.e[this.straightLineKey],!(this.limitedToCanvasSize===!0&&this._isOutSideCanvas(a))&&this._captureDrawingPath(a)&&this._points.length>1))if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var c=this._points,h=c.length,p=this.canvas.contextTop;this._saveAndTransform(p),this.oldEnd&&(p.beginPath(),p.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(p,c[h-2],c[h-1],!0),p.stroke(),p.restore()}},onMouseUp:function(a){return this.canvas._isMainEvent(a.e)?(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1):!0},_prepareForDrawing:function(a){var l=new e.Point(a.x,a.y);this._reset(),this._addPoint(l),this.canvas.contextTop.moveTo(l.x,l.y)},_addPoint:function(a){return this._points.length>1&&a.eq(this._points[this._points.length-1])?!1:(this.drawStraightLine&&this._points.length>1&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(a),!0)},_reset:function(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1},_captureDrawingPath:function(a){var l=new e.Point(a.x,a.y);return this._addPoint(l)},_render:function(a){var l,c,h=this._points[0],p=this._points[1];if(a=a||this.canvas.contextTop,this._saveAndTransform(a),a.beginPath(),this._points.length===2&&h.x===p.x&&h.y===p.y){var y=this.width/1e3;h=new e.Point(h.x,h.y),p=new e.Point(p.x,p.y),h.x-=y,p.x+=y}for(a.moveTo(h.x,h.y),l=1,c=this._points.length;l=h&&(v=a[p],x.push(v));return x.push(a[y]),x},_finalizeAndAddPath:function(){var a=this.canvas.contextTop;a.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var l=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(l)){this.canvas.requestRenderAll();return}var c=this.createPath(l);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:c}),this.canvas.add(c),this.canvas.requestRenderAll(),c.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:c})}})}(),e.CircleBrush=e.util.createClass(e.BaseBrush,{width:10,initialize:function(a){this.canvas=a,this.points=[]},drawDot:function(a){var l=this.addPoint(a),c=this.canvas.contextTop;this._saveAndTransform(c),this.dot(c,l),c.restore()},dot:function(a,l){a.fillStyle=l.fill,a.beginPath(),a.arc(l.x,l.y,l.radius,0,Math.PI*2,!1),a.closePath(),a.fill()},onMouseDown:function(a){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(a)},_render:function(){var a=this.canvas.contextTop,l,c,h=this.points;for(this._saveAndTransform(a),l=0,c=h.length;l0&&!this.preserveObjectStacking){v=[],x=[];for(var I=0,P=this._objects.length;I1&&(this._activeObject._objects=x),v.push.apply(v,x)}else v=this._objects;return v},renderAll:function(){this.contextTopDirty&&!this._groupSelector&&!this.isDrawingMode&&(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&(this.renderTopLayer(this.contextTop),this.hasLostContext=!1);var p=this.contextContainer;return this.renderCanvas(p,this._chooseObjectsToRender()),this},renderTopLayer:function(p){p.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(p),this.contextTopDirty=!0),p.restore()},renderTop:function(){var p=this.contextTop;return this.clearContext(p),this.renderTopLayer(p),this.fire("after:render"),this},_normalizePointer:function(p,y){var v=p.calcTransformMatrix(),x=e.util.invertTransform(v),I=this.restorePointerVpt(y);return e.util.transformPoint(I,x)},isTargetTransparent:function(p,y,v){if(p.shouldCache()&&p._cacheCanvas&&p!==this._activeObject){var x=this._normalizePointer(p,{x:y,y:v}),I=Math.max(p.cacheTranslationX+x.x*p.zoomX,0),P=Math.max(p.cacheTranslationY+x.y*p.zoomY,0),V=e.util.isTransparent(p._cacheContext,Math.round(I),Math.round(P),this.targetFindTolerance);return V}var F=this.contextCache,k=p.selectionBackgroundColor,j=this.viewportTransform;p.selectionBackgroundColor="",this.clearContext(F),F.save(),F.transform(j[0],j[1],j[2],j[3],j[4],j[5]),p.render(F),F.restore(),p.selectionBackgroundColor=k;var V=e.util.isTransparent(F,y,v,this.targetFindTolerance);return V},_isSelectionKeyPressed:function(p){var y=!1;return Array.isArray(this.selectionKey)?y=!!this.selectionKey.find(function(v){return p[v]===!0}):y=p[this.selectionKey],y},_shouldClearSelection:function(p,y){var v=this.getActiveObjects(),x=this._activeObject;return!y||y&&x&&v.length>1&&v.indexOf(y)===-1&&x!==y&&!this._isSelectionKeyPressed(p)||y&&!y.evented||y&&!y.selectable&&x&&x!==y},_shouldCenterTransform:function(p,y,v){if(p){var x;return y==="scale"||y==="scaleX"||y==="scaleY"||y==="resizing"?x=this.centeredScaling||p.centeredScaling:y==="rotate"&&(x=this.centeredRotation||p.centeredRotation),x?!v:v}},_getOriginFromCorner:function(p,y){var v={x:p.originX,y:p.originY};return y==="ml"||y==="tl"||y==="bl"?v.x="right":(y==="mr"||y==="tr"||y==="br")&&(v.x="left"),y==="tl"||y==="mt"||y==="tr"?v.y="bottom":(y==="bl"||y==="mb"||y==="br")&&(v.y="top"),v},_getActionFromCorner:function(p,y,v,x){if(!y||!p)return"drag";var I=x.controls[y];return I.getActionName(v,I,x)},_setupCurrentTransform:function(p,y,v){if(y){var x=this.getPointer(p),I=y.__corner,P=y.controls[I],F=v&&I?P.getActionHandler(p,y,P):e.controlsUtils.dragHandler,k=this._getActionFromCorner(v,I,p,y),j=this._getOriginFromCorner(y,I),V=p[this.centeredKey],Y={target:y,action:k,actionHandler:F,corner:I,scaleX:y.scaleX,scaleY:y.scaleY,skewX:y.skewX,skewY:y.skewY,offsetX:x.x-y.left,offsetY:x.y-y.top,originX:j.x,originY:j.y,ex:x.x,ey:x.y,lastX:x.x,lastY:x.y,theta:l(y.angle),width:y.width*y.scaleX,shiftKey:p.shiftKey,altKey:V,original:e.util.saveObjectTransform(y)};this._shouldCenterTransform(y,k,V)&&(Y.originX="center",Y.originY="center"),Y.original.originX=j.x,Y.original.originY=j.y,this._currentTransform=Y,this._beforeTransform(p)}},setCursor:function(p){this.upperCanvasEl.style.cursor=p},_drawSelection:function(p){var y=this._groupSelector,v=new e.Point(y.ex,y.ey),x=e.util.transformPoint(v,this.viewportTransform),I=new e.Point(y.ex+y.left,y.ey+y.top),P=e.util.transformPoint(I,this.viewportTransform),F=Math.min(x.x,P.x),k=Math.min(x.y,P.y),j=Math.max(x.x,P.x),V=Math.max(x.y,P.y),Y=this.selectionLineWidth/2;this.selectionColor&&(p.fillStyle=this.selectionColor,p.fillRect(F,k,j-F,V-k)),!(!this.selectionLineWidth||!this.selectionBorderColor)&&(p.lineWidth=this.selectionLineWidth,p.strokeStyle=this.selectionBorderColor,F+=Y,k+=Y,j-=Y,V-=Y,e.Object.prototype._setLineDash.call(this,p,this.selectionDashArray),p.strokeRect(F,k,j-F,V-k))},findTarget:function(p,y){if(!this.skipTargetFind){var v=!0,x=this.getPointer(p,v),I=this._activeObject,P=this.getActiveObjects(),F,k,j=c(p),V=P.length>1&&!y||P.length===1;if(this.targets=[],V&&I._findTargetCorner(x,j)||P.length>1&&!y&&I===this._searchPossibleTargets([I],x))return I;if(P.length===1&&I===this._searchPossibleTargets([I],x))if(this.preserveObjectStacking)F=I,k=this.targets,this.targets=[];else return I;var Y=this._searchPossibleTargets(this._objects,x);return p[this.altSelectionKey]&&Y&&F&&Y!==F&&(Y=F,this.targets=k),Y}},_checkTarget:function(p,y,v){if(y&&y.visible&&y.evented&&y.containsPoint(p))if((this.perPixelTargetFind||y.perPixelTargetFind)&&!y.isEditing){var x=this.isTargetTransparent(y,v.x,v.y);if(!x)return!0}else return!0},_searchPossibleTargets:function(p,y){for(var v,x=p.length,I;x--;){var P=p[x],F=P.group?this._normalizePointer(P.group,y):y;if(this._checkTarget(F,P,y)){v=p[x],v.subTargetCheck&&v instanceof e.Group&&(I=this._searchPossibleTargets(v._objects,y),I&&this.targets.push(I));break}}return v},restorePointerVpt:function(p){return e.util.transformPoint(p,e.util.invertTransform(this.viewportTransform))},getPointer:function(p,y){if(this._absolutePointer&&!y)return this._absolutePointer;if(this._pointer&&y)return this._pointer;var v=a(p),x=this.upperCanvasEl,I=x.getBoundingClientRect(),P=I.width||0,F=I.height||0,k;(!P||!F)&&("top"in I&&"bottom"in I&&(F=Math.abs(I.top-I.bottom)),"right"in I&&"left"in I&&(P=Math.abs(I.right-I.left))),this.calcOffset(),v.x=v.x-this._offset.left,v.y=v.y-this._offset.top,y||(v=this.restorePointerVpt(v));var j=this.getRetinaScaling();return j!==1&&(v.x/=j,v.y/=j),P===0||F===0?k={width:1,height:1}:k={width:x.width/P,height:x.height/F},{x:v.x*k.width,y:v.y*k.height}},_createUpperCanvas:function(){var p=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),y=this.lowerCanvasEl,v=this.upperCanvasEl;v?v.className="":(v=this._createCanvasElement(),this.upperCanvasEl=v),e.util.addClass(v,"upper-canvas "+p),this.wrapperEl.appendChild(v),this._copyCanvasStyle(y,v),this._applyCanvasStyle(v),this.contextTop=v.getContext("2d")},getTopContext:function(){return this.contextTop},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=e.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),e.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),e.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(p){var y=this.width||p.width,v=this.height||p.height;e.util.setStyle(p,{position:"absolute",width:y+"px",height:v+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),p.width=y,p.height=v,e.util.makeElementUnselectable(p)},_copyCanvasStyle:function(p,y){y.style.cssText=p.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var p=this._activeObject;return p?p.type==="activeSelection"&&p._objects?p._objects.slice(0):[p]:[]},_onObjectRemoved:function(p){p===this._activeObject&&(this.fire("before:selection:cleared",{target:p}),this._discardActiveObject(),this.fire("selection:cleared",{target:p}),p.fire("deselected")),p===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",p)},_fireSelectionEvents:function(p,y){var v=!1,x=this.getActiveObjects(),I=[],P=[];p.forEach(function(F){x.indexOf(F)===-1&&(v=!0,F.fire("deselected",{e:y,target:F}),P.push(F))}),x.forEach(function(F){p.indexOf(F)===-1&&(v=!0,F.fire("selected",{e:y,target:F}),I.push(F))}),p.length>0&&x.length>0?v&&this.fire("selection:updated",{e:y,selected:I,deselected:P}):x.length>0?this.fire("selection:created",{e:y,selected:I}):p.length>0&&this.fire("selection:cleared",{e:y,deselected:P})},setActiveObject:function(p,y){var v=this.getActiveObjects();return this._setActiveObject(p,y),this._fireSelectionEvents(v,y),this},_setActiveObject:function(p,y){return this._activeObject===p||!this._discardActiveObject(y,p)||p.onSelect({e:y})?!1:(this._activeObject=p,!0)},_discardActiveObject:function(p,y){var v=this._activeObject;if(v){if(v.onDeselect({e:p,object:y}))return!1;this._activeObject=null}return!0},discardActiveObject:function(p){var y=this.getActiveObjects(),v=this.getActiveObject();return y.length&&this.fire("before:selection:cleared",{target:v,e:p}),this._discardActiveObject(p),this._fireSelectionEvents(y,p),this},dispose:function(){var p=this.wrapperEl;return this.removeListeners(),p.removeChild(this.upperCanvasEl),p.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(y){e.util.cleanUpJsdomNode(this[y]),this[y]=void 0}.bind(this)),p.parentNode&&p.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,e.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(p){var y=this._activeObject;y&&y._renderControls(p)},_toObject:function(p,y,v){var x=this._realizeGroupTransformOnObject(p),I=this.callSuper("_toObject",p,y,v);return this._unwindGroupTransformOnObject(p,x),I},_realizeGroupTransformOnObject:function(p){if(p.group&&p.group.type==="activeSelection"&&this._activeObject===p.group){var y=["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"],v={};return y.forEach(function(x){v[x]=p[x]}),e.util.addTransformToObject(p,this._activeObject.calcOwnMatrix()),v}else return null},_unwindGroupTransformOnObject:function(p,y){y&&p.set(y)},_setSVGObject:function(p,y,v){var x=this._realizeGroupTransformOnObject(y);this.callSuper("_setSVGObject",p,y,v),this._unwindGroupTransformOnObject(y,x)},setViewportTransform:function(p){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),e.StaticCanvas.prototype.setViewportTransform.call(this,p)}});for(var h in e.StaticCanvas)h!=="prototype"&&(e.Canvas[h]=e.StaticCanvas[h])}(),function(){var a=e.util.addListener,l=e.util.removeListener,c=3,h=2,p=1,y={passive:!1};function v(x,I){return x.button&&x.button===I-1}e.util.object.extend(e.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(a,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(x,I){var P=this.upperCanvasEl,F=this._getEventPrefix();x(e.window,"resize",this._onResize),x(P,F+"down",this._onMouseDown),x(P,F+"move",this._onMouseMove,y),x(P,F+"out",this._onMouseOut),x(P,F+"enter",this._onMouseEnter),x(P,"wheel",this._onMouseWheel),x(P,"contextmenu",this._onContextMenu),x(P,"dblclick",this._onDoubleClick),x(P,"dragover",this._onDragOver),x(P,"dragenter",this._onDragEnter),x(P,"dragleave",this._onDragLeave),x(P,"drop",this._onDrop),this.enablePointerEvents||x(P,"touchstart",this._onTouchStart,y),typeof eventjs<"u"&&I in eventjs&&(eventjs[I](P,"gesture",this._onGesture),eventjs[I](P,"drag",this._onDrag),eventjs[I](P,"orientation",this._onOrientationChange),eventjs[I](P,"shake",this._onShake),eventjs[I](P,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(l,"remove");var x=this._getEventPrefix();l(e.document,x+"up",this._onMouseUp),l(e.document,"touchend",this._onTouchEnd,y),l(e.document,x+"move",this._onMouseMove,y),l(e.document,"touchmove",this._onMouseMove,y)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._onDrop.bind(this),this.eventsBound=!0)},_onGesture:function(x,I){this.__onTransformGesture&&this.__onTransformGesture(x,I)},_onDrag:function(x,I){this.__onDrag&&this.__onDrag(x,I)},_onMouseWheel:function(x){this.__onMouseWheel(x)},_onMouseOut:function(x){var I=this._hoveredTarget;this.fire("mouse:out",{target:I,e:x}),this._hoveredTarget=null,I&&I.fire("mouseout",{e:x});var P=this;this._hoveredTargets.forEach(function(F){P.fire("mouse:out",{target:I,e:x}),F&&I.fire("mouseout",{e:x})}),this._hoveredTargets=[]},_onMouseEnter:function(x){!this._currentTransform&&!this.findTarget(x)&&(this.fire("mouse:over",{target:null,e:x}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(x,I){this.__onOrientationChange&&this.__onOrientationChange(x,I)},_onShake:function(x,I){this.__onShake&&this.__onShake(x,I)},_onLongPress:function(x,I){this.__onLongPress&&this.__onLongPress(x,I)},_onDragOver:function(x){x.preventDefault();var I=this._simpleEventHandler("dragover",x);this._fireEnterLeaveEvents(I,x)},_onDrop:function(x){return this._simpleEventHandler("drop:before",x),this._simpleEventHandler("drop",x)},_onContextMenu:function(x){return this.stopContextMenu&&(x.stopPropagation(),x.preventDefault()),!1},_onDoubleClick:function(x){this._cacheTransformEventData(x),this._handleEvent(x,"dblclick"),this._resetTransformEventData(x)},getPointerId:function(x){var I=x.changedTouches;return I?I[0]&&I[0].identifier:this.enablePointerEvents?x.pointerId:-1},_isMainEvent:function(x){return x.isPrimary===!0?!0:x.isPrimary===!1?!1:x.type==="touchend"&&x.touches.length===0?!0:x.changedTouches?x.changedTouches[0].identifier===this.mainTouchId:!0},_onTouchStart:function(x){x.preventDefault(),this.mainTouchId===null&&(this.mainTouchId=this.getPointerId(x)),this.__onMouseDown(x),this._resetTransformEventData();var I=this.upperCanvasEl,P=this._getEventPrefix();a(e.document,"touchend",this._onTouchEnd,y),a(e.document,"touchmove",this._onMouseMove,y),l(I,P+"down",this._onMouseDown)},_onMouseDown:function(x){this.__onMouseDown(x),this._resetTransformEventData();var I=this.upperCanvasEl,P=this._getEventPrefix();l(I,P+"move",this._onMouseMove,y),a(e.document,P+"up",this._onMouseUp),a(e.document,P+"move",this._onMouseMove,y)},_onTouchEnd:function(x){if(!(x.touches.length>0)){this.__onMouseUp(x),this._resetTransformEventData(),this.mainTouchId=null;var I=this._getEventPrefix();l(e.document,"touchend",this._onTouchEnd,y),l(e.document,"touchmove",this._onMouseMove,y);var P=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){a(P.upperCanvasEl,I+"down",P._onMouseDown),P._willAddMouseDown=0},400)}},_onMouseUp:function(x){this.__onMouseUp(x),this._resetTransformEventData();var I=this.upperCanvasEl,P=this._getEventPrefix();this._isMainEvent(x)&&(l(e.document,P+"up",this._onMouseUp),l(e.document,P+"move",this._onMouseMove,y),a(I,P+"move",this._onMouseMove,y))},_onMouseMove:function(x){!this.allowTouchScrolling&&x.preventDefault&&x.preventDefault(),this.__onMouseMove(x)},_onResize:function(){this.calcOffset()},_shouldRender:function(x){var I=this._activeObject;return!!I!=!!x||I&&x&&I!==x?!0:(I&&I.isEditing,!1)},__onMouseUp:function(x){var I,P=this._currentTransform,F=this._groupSelector,k=!1,j=!F||F.left===0&&F.top===0;if(this._cacheTransformEventData(x),I=this._target,this._handleEvent(x,"up:before"),v(x,c)){this.fireRightClick&&this._handleEvent(x,"up",c,j);return}if(v(x,h)){this.fireMiddleClick&&this._handleEvent(x,"up",h,j),this._resetTransformEventData();return}if(this.isDrawingMode&&this._isCurrentlyDrawing){this._onMouseUpInDrawingMode(x);return}if(this._isMainEvent(x)){if(P&&(this._finalizeCurrentTransform(x),k=P.actionPerformed),!j){var V=I===this._activeObject;this._maybeGroupObjects(x),k||(k=this._shouldRender(I)||!V&&I===this._activeObject)}var Y,X;if(I){if(Y=I._findTargetCorner(this.getPointer(x,!0),e.util.isTouchEvent(x)),I.selectable&&I!==this._activeObject&&I.activeOn==="up")this.setActiveObject(I,x),k=!0;else{var Z=I.controls[Y],ie=Z&&Z.getMouseUpHandler(x,I,Z);ie&&(X=this.getPointer(x),ie(x,P,X.x,X.y))}I.isMoving=!1}if(P&&(P.target!==I||P.corner!==Y)){var ce=P.target&&P.target.controls[P.corner],he=ce&&ce.getMouseUpHandler(x,I,Z);X=X||this.getPointer(x),he&&he(x,P,X.x,X.y)}this._setCursorFromEvent(x,I),this._handleEvent(x,"up",p,j),this._groupSelector=null,this._currentTransform=null,I&&(I.__corner=0),k?this.requestRenderAll():j||this.renderTop()}},_simpleEventHandler:function(x,I){var P=this.findTarget(I),F=this.targets,k={e:I,target:P,subTargets:F};if(this.fire(x,k),P&&P.fire(x,k),!F)return P;for(var j=0;j1&&(p=new e.ActiveSelection(h.reverse(),{canvas:this}),this.setActiveObject(p,c))},_collectObjects:function(c){for(var h=[],p,y=this._groupSelector.ex,v=this._groupSelector.ey,x=y+this._groupSelector.left,I=v+this._groupSelector.top,P=new e.Point(a(y,x),a(v,I)),F=new e.Point(l(y,x),l(v,I)),k=!this.selectionFullyContained,j=y===x&&v===I,V=this._objects.length;V--&&(p=this._objects[V],!(!(!p||!p.selectable||!p.visible)&&(k&&p.intersectsWithRect(P,F,!0)||p.isContainedWithinRect(P,F,!0)||k&&p.containsPoint(P,null,!0)||k&&p.containsPoint(F,null,!0))&&(h.push(p),j))););return h.length>1&&(h=h.filter(function(Y){return!Y.onSelect({e:c})})),h},_maybeGroupObjects:function(c){this.selection&&this._groupSelector&&this._groupSelectedObjects(c),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),function(){e.util.object.extend(e.StaticCanvas.prototype,{toDataURL:function(a){a||(a={});var l=a.format||"png",c=a.quality||1,h=(a.multiplier||1)*(a.enableRetinaScaling?this.getRetinaScaling():1),p=this.toCanvasElement(h,a);return e.util.toDataURL(p,l,c)},toCanvasElement:function(a,l){a=a||1,l=l||{};var c=(l.width||this.width)*a,h=(l.height||this.height)*a,p=this.getZoom(),y=this.width,v=this.height,x=p*a,I=this.viewportTransform,P=(I[4]-(l.left||0))*a,F=(I[5]-(l.top||0))*a,k=this.interactive,j=[x,0,0,x,P,F],V=this.enableRetinaScaling,Y=e.util.createCanvasElement(),X=this.contextTop;return Y.width=c,Y.height=h,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=j,this.width=c,this.height=h,this.calcViewportBoundaries(),this.renderCanvas(Y.getContext("2d"),this._objects),this.viewportTransform=I,this.width=y,this.height=v,this.calcViewportBoundaries(),this.interactive=k,this.enableRetinaScaling=V,this.contextTop=X,Y}})}(),e.util.object.extend(e.StaticCanvas.prototype,{loadFromJSON:function(a,l,c){if(a){var h=typeof a=="string"?JSON.parse(a):e.util.object.clone(a),p=this,y=h.clipPath,v=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete h.clipPath,this._enlivenObjects(h.objects,function(x){p.clear(),p._setBgOverlay(h,function(){y?p._enlivenObjects([y],function(I){p.clipPath=I[0],p.__setupCanvas.call(p,h,x,v,l)}):p.__setupCanvas.call(p,h,x,v,l)})},c),this}},__setupCanvas:function(a,l,c,h){var p=this;l.forEach(function(y,v){p.insertAt(y,v)}),this.renderOnAddRemove=c,delete a.objects,delete a.backgroundImage,delete a.overlayImage,delete a.background,delete a.overlay,this._setOptions(a),this.renderAll(),h&&h()},_setBgOverlay:function(a,l){var c={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(!a.backgroundImage&&!a.overlayImage&&!a.background&&!a.overlay){l&&l();return}var h=function(){c.backgroundImage&&c.overlayImage&&c.backgroundColor&&c.overlayColor&&l&&l()};this.__setBgOverlay("backgroundImage",a.backgroundImage,c,h),this.__setBgOverlay("overlayImage",a.overlayImage,c,h),this.__setBgOverlay("backgroundColor",a.background,c,h),this.__setBgOverlay("overlayColor",a.overlay,c,h)},__setBgOverlay:function(a,l,c,h){var p=this;if(!l){c[a]=!0,h&&h();return}a==="backgroundImage"||a==="overlayImage"?e.util.enlivenObjects([l],function(y){p[a]=y[0],c[a]=!0,h&&h()}):this["set"+e.util.string.capitalize(a,!0)](l,function(){c[a]=!0,h&&h()})},_enlivenObjects:function(a,l,c){if(!a||a.length===0){l&&l([]);return}e.util.enlivenObjects(a,function(h){l&&l(h)},null,c)},_toDataURL:function(a,l){this.clone(function(c){l(c.toDataURL(a))})},_toDataURLWithMultiplier:function(a,l,c){this.clone(function(h){c(h.toDataURLWithMultiplier(a,l))})},clone:function(a,l){var c=JSON.stringify(this.toJSON(l));this.cloneWithoutData(function(h){h.loadFromJSON(c,function(){a&&a(h)})})},cloneWithoutData:function(a){var l=e.util.createCanvasElement();l.width=this.width,l.height=this.height;var c=new e.Canvas(l);this.backgroundImage?(c.setBackgroundImage(this.backgroundImage.src,function(){c.renderAll(),a&&a(c)}),c.backgroundImageOpacity=this.backgroundImageOpacity,c.backgroundImageStretch=this.backgroundImageStretch):a&&a(c)}}),function(a){var l=a.fabric||(a.fabric={}),c=l.util.object.extend,h=l.util.object.clone,p=l.util.toFixed,y=l.util.string.capitalize,v=l.util.degreesToRadians,x=!l.isLikelyNode,I=2;l.Object||(l.Object=l.util.createClass(l.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:x,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(P){P&&this.setOptions(P)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=l.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(P){var F=l.perfLimitSizeTotal,k=P.width,j=P.height,V=l.maxCacheSideLimit,Y=l.minCacheSideLimit;if(k<=V&&j<=V&&k*j<=F)return kce&&(P.zoomX/=k/ce,P.width=ce,P.capped=!0),j>he&&(P.zoomY/=j/he,P.height=he,P.capped=!0),P},_getCacheCanvasDimensions:function(){var P=this.getTotalObjectScaling(),F=this._getTransformedDimensions(0,0),k=F.x*P.scaleX/this.scaleX,j=F.y*P.scaleY/this.scaleY;return{width:k+I,height:j+I,zoomX:P.scaleX,zoomY:P.scaleY,x:k,y:j}},_updateCacheCanvas:function(){var P=this.canvas;if(this.noScaleCache&&P&&P._currentTransform){var F=P._currentTransform.target,k=P._currentTransform.action;if(this===F&&k.slice&&k.slice(0,5)==="scale")return!1}var j=this._cacheCanvas,V=this._limitCacheSize(this._getCacheCanvasDimensions()),Y=l.minCacheSideLimit,X=V.width,Z=V.height,ie,ce,he=V.zoomX,_e=V.zoomY,xe=X!==this.cacheWidth||Z!==this.cacheHeight,Pe=this.zoomX!==he||this.zoomY!==_e,ke=xe||Pe,J=0,de=0,Se=!1;if(xe){var Ie=this._cacheCanvas.width,Re=this._cacheCanvas.height,Oe=X>Ie||Z>Re,Ge=(XY&&Re>Y;Se=Oe||Ge,Oe&&!V.capped&&(X>Y||Z>Y)&&(J=X*.1,de=Z*.1)}return this instanceof l.Text&&this.path&&(ke=!0,Se=!0,J+=this.getHeightOfLine(0)*this.zoomX,de+=this.getHeightOfLine(0)*this.zoomY),ke?(Se?(j.width=Math.ceil(X+J),j.height=Math.ceil(Z+de)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,j.width,j.height)),ie=V.x/2,ce=V.y/2,this.cacheTranslationX=Math.round(j.width/2-ie)+ie,this.cacheTranslationY=Math.round(j.height/2-ce)+ce,this.cacheWidth=X,this.cacheHeight=Z,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(he,_e),this.zoomX=he,this.zoomY=_e,!0):!1},setOptions:function(P){this._setOptions(P),this._initGradient(P.fill,"fill"),this._initGradient(P.stroke,"stroke"),this._initPattern(P.fill,"fill"),this._initPattern(P.stroke,"stroke")},transform:function(P){var F=this.group&&!this.group._transformDone||this.group&&this.canvas&&P===this.canvas.contextTop,k=this.calcTransformMatrix(!F);P.transform(k[0],k[1],k[2],k[3],k[4],k[5])},toObject:function(P){var F=l.Object.NUM_FRACTION_DIGITS,k={type:this.type,version:l.version,originX:this.originX,originY:this.originY,left:p(this.left,F),top:p(this.top,F),width:p(this.width,F),height:p(this.height,F),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:p(this.strokeWidth,F),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:p(this.strokeMiterLimit,F),scaleX:p(this.scaleX,F),scaleY:p(this.scaleY,F),angle:p(this.angle,F),flipX:this.flipX,flipY:this.flipY,opacity:p(this.opacity,F),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:p(this.skewX,F),skewY:p(this.skewY,F)};return this.clipPath&&!this.clipPath.excludeFromExport&&(k.clipPath=this.clipPath.toObject(P),k.clipPath.inverted=this.clipPath.inverted,k.clipPath.absolutePositioned=this.clipPath.absolutePositioned),l.util.populateWithProperties(this,k,P),this.includeDefaultValues||(k=this._removeDefaultValues(k)),k},toDatalessObject:function(P){return this.toObject(P)},_removeDefaultValues:function(P){var F=l.util.getKlass(P.type).prototype,k=F.stateProperties;return k.forEach(function(j){j==="left"||j==="top"||(P[j]===F[j]&&delete P[j],Array.isArray(P[j])&&Array.isArray(F[j])&&P[j].length===0&&F[j].length===0&&delete P[j])}),P},toString:function(){return"#"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var P=l.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(P.scaleX),scaleY:Math.abs(P.scaleY)}},getTotalObjectScaling:function(){var P=this.getObjectScaling(),F=P.scaleX,k=P.scaleY;if(this.canvas){var j=this.canvas.getZoom(),V=this.canvas.getRetinaScaling();F*=j*V,k*=j*V}return{scaleX:F,scaleY:k}},getObjectOpacity:function(){var P=this.opacity;return this.group&&(P*=this.group.getObjectOpacity()),P},_set:function(P,F){var k=P==="scaleX"||P==="scaleY",j=this[P]!==F,V=!1;return k&&(F=this._constrainScale(F)),P==="scaleX"&&F<0?(this.flipX=!this.flipX,F*=-1):P==="scaleY"&&F<0?(this.flipY=!this.flipY,F*=-1):P==="shadow"&&F&&!(F instanceof l.Shadow)?F=new l.Shadow(F):P==="dirty"&&this.group&&this.group.set("dirty",F),this[P]=F,j&&(V=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(P)>-1?(this.dirty=!0,V&&this.group.set("dirty",!0)):V&&this.stateProperties.indexOf(P)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:l.iMatrix.concat()},isNotVisible:function(){return this.opacity===0||!this.width&&!this.height&&this.strokeWidth===0||!this.visible},render:function(P){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(P.save(),this._setupCompositeOperation(P),this.drawSelectionBackground(P),this.transform(P),this._setOpacity(P),this._setShadow(P,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(P)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(P),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),P.restore())},renderCache:function(P){P=P||{},(!this._cacheCanvas||!this._cacheContext)&&this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,P.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this._cacheContext=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&this.stroke!=="transparent"&&this.strokeWidth!==0},hasFill:function(){return this.fill&&this.fill!=="transparent"},needsItsOwnCache:function(){return!!(this.paintFirst==="stroke"&&this.hasFill()&&this.hasStroke()&&typeof this.shadow=="object"||this.clipPath)},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(this.shadow.offsetX!==0||this.shadow.offsetY!==0)},drawClipPathOnCache:function(P,F){if(P.save(),F.inverted?P.globalCompositeOperation="destination-out":P.globalCompositeOperation="destination-in",F.absolutePositioned){var k=l.util.invertTransform(this.calcTransformMatrix());P.transform(k[0],k[1],k[2],k[3],k[4],k[5])}F.transform(P),P.scale(1/F.zoomX,1/F.zoomY),P.drawImage(F._cacheCanvas,-F.cacheTranslationX,-F.cacheTranslationY),P.restore()},drawObject:function(P,F){var k=this.fill,j=this.stroke;F?(this.fill="black",this.stroke="",this._setClippingProperties(P)):this._renderBackground(P),this._render(P),this._drawClipPath(P,this.clipPath),this.fill=k,this.stroke=j},_drawClipPath:function(P,F){F&&(F.canvas=this.canvas,F.shouldCache(),F._transformDone=!0,F.renderCache({forClipping:!0}),this.drawClipPathOnCache(P,F))},drawCacheOnCanvas:function(P){P.scale(1/this.zoomX,1/this.zoomY),P.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(P){if(this.isNotVisible())return!1;if(this._cacheCanvas&&this._cacheContext&&!P&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&this._cacheContext&&!P){var F=this.cacheWidth/this.zoomX,k=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-F/2,-k/2,F,k)}return!0}return!1},_renderBackground:function(P){if(this.backgroundColor){var F=this._getNonTransformedDimensions();P.fillStyle=this.backgroundColor,P.fillRect(-F.x/2,-F.y/2,F.x,F.y),this._removeShadow(P)}},_setOpacity:function(P){this.group&&!this.group._transformDone?P.globalAlpha=this.getObjectOpacity():P.globalAlpha*=this.opacity},_setStrokeStyles:function(P,F){var k=F.stroke;k&&(P.lineWidth=F.strokeWidth,P.lineCap=F.strokeLineCap,P.lineDashOffset=F.strokeDashOffset,P.lineJoin=F.strokeLineJoin,P.miterLimit=F.strokeMiterLimit,k.toLive?k.gradientUnits==="percentage"||k.gradientTransform||k.patternTransform?this._applyPatternForTransformedGradient(P,k):(P.strokeStyle=k.toLive(P,this),this._applyPatternGradientTransform(P,k)):P.strokeStyle=F.stroke)},_setFillStyles:function(P,F){var k=F.fill;k&&(k.toLive?(P.fillStyle=k.toLive(P,this),this._applyPatternGradientTransform(P,F.fill)):P.fillStyle=k)},_setClippingProperties:function(P){P.globalAlpha=1,P.strokeStyle="transparent",P.fillStyle="#000000"},_setLineDash:function(P,F){!F||F.length===0||(1&F.length&&F.push.apply(F,F),P.setLineDash(F))},_renderControls:function(P,F){var k=this.getViewportTransform(),j=this.calcTransformMatrix(),V,Y,X;F=F||{},Y=typeof F.hasBorders<"u"?F.hasBorders:this.hasBorders,X=typeof F.hasControls<"u"?F.hasControls:this.hasControls,j=l.util.multiplyTransformMatrices(k,j),V=l.util.qrDecompose(j),P.save(),P.translate(V.translateX,V.translateY),P.lineWidth=1*this.borderScaleFactor,this.group||(P.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(V.angle-=180),P.rotate(v(this.group?V.angle:this.angle)),F.forActiveSelection||this.group?Y&&this.drawBordersInGroup(P,V,F):Y&&this.drawBorders(P,F),X&&this.drawControls(P,F),P.restore()},_setShadow:function(P){if(this.shadow){var F=this.shadow,k=this.canvas,j,V=k&&k.viewportTransform[0]||1,Y=k&&k.viewportTransform[3]||1;F.nonScaling?j={scaleX:1,scaleY:1}:j=this.getObjectScaling(),k&&k._isRetinaScaling()&&(V*=l.devicePixelRatio,Y*=l.devicePixelRatio),P.shadowColor=F.color,P.shadowBlur=F.blur*l.browserShadowBlurConstant*(V+Y)*(j.scaleX+j.scaleY)/4,P.shadowOffsetX=F.offsetX*V*j.scaleX,P.shadowOffsetY=F.offsetY*Y*j.scaleY}},_removeShadow:function(P){this.shadow&&(P.shadowColor="",P.shadowBlur=P.shadowOffsetX=P.shadowOffsetY=0)},_applyPatternGradientTransform:function(P,F){if(!F||!F.toLive)return{offsetX:0,offsetY:0};var k=F.gradientTransform||F.patternTransform,j=-this.width/2+F.offsetX||0,V=-this.height/2+F.offsetY||0;return F.gradientUnits==="percentage"?P.transform(this.width,0,0,this.height,j,V):P.transform(1,0,0,1,j,V),k&&P.transform(k[0],k[1],k[2],k[3],k[4],k[5]),{offsetX:j,offsetY:V}},_renderPaintInOrder:function(P){this.paintFirst==="stroke"?(this._renderStroke(P),this._renderFill(P)):(this._renderFill(P),this._renderStroke(P))},_render:function(){},_renderFill:function(P){this.fill&&(P.save(),this._setFillStyles(P,this),this.fillRule==="evenodd"?P.fill("evenodd"):P.fill(),P.restore())},_renderStroke:function(P){if(!(!this.stroke||this.strokeWidth===0)){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(P),P.save(),this.strokeUniform&&this.group){var F=this.getObjectScaling();P.scale(1/F.scaleX,1/F.scaleY)}else this.strokeUniform&&P.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(P,this.strokeDashArray),this._setStrokeStyles(P,this),P.stroke(),P.restore()}},_applyPatternForTransformedGradient:function(P,F){var k=this._limitCacheSize(this._getCacheCanvasDimensions()),j=l.util.createCanvasElement(),V,Y=this.canvas.getRetinaScaling(),X=k.x/this.scaleX/Y,Z=k.y/this.scaleY/Y;j.width=X,j.height=Z,V=j.getContext("2d"),V.beginPath(),V.moveTo(0,0),V.lineTo(X,0),V.lineTo(X,Z),V.lineTo(0,Z),V.closePath(),V.translate(X/2,Z/2),V.scale(k.zoomX/this.scaleX/Y,k.zoomY/this.scaleY/Y),this._applyPatternGradientTransform(V,F),V.fillStyle=F.toLive(P),V.fill(),P.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),P.scale(Y*this.scaleX/k.zoomX,Y*this.scaleY/k.zoomY),P.strokeStyle=V.createPattern(j,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var P=l.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",P.scaleX),this.set("scaleY",P.scaleY),this.angle=P.angle,this.skewX=P.skewX,this.skewY=0}},_removeTransformMatrix:function(P){var F=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),F=l.util.transformPoint(F,this.transformMatrix)),this.transformMatrix=null,P&&(this.scaleX*=P.scaleX,this.scaleY*=P.scaleY,this.cropX=P.cropX,this.cropY=P.cropY,F.x+=P.offsetLeft,F.y+=P.offsetTop,this.width=P.width,this.height=P.height),this.setPositionByOrigin(F,"center","center")},clone:function(P,F){var k=this.toObject(F);this.constructor.fromObject?this.constructor.fromObject(k,P):l.Object._fromObject("Object",k,P)},cloneAsImage:function(P,F){var k=this.toCanvasElement(F);return P&&P(new l.Image(k)),this},toCanvasElement:function(P){P||(P={});var F=l.util,k=F.saveObjectTransform(this),j=this.group,V=this.shadow,Y=Math.abs,X=(P.multiplier||1)*(P.enableRetinaScaling?l.devicePixelRatio:1);delete this.group,P.withoutTransform&&F.resetObjectTransform(this),P.withoutShadow&&(this.shadow=null);var Z=l.util.createCanvasElement(),ie=this.getBoundingRect(!0,!0),ce=this.shadow,he,_e={x:0,y:0},xe,Pe,ke;ce&&(xe=ce.blur,ce.nonScaling?he={scaleX:1,scaleY:1}:he=this.getObjectScaling(),_e.x=2*Math.round(Y(ce.offsetX)+xe)*Y(he.scaleX),_e.y=2*Math.round(Y(ce.offsetY)+xe)*Y(he.scaleY)),Pe=ie.width+_e.x,ke=ie.height+_e.y,Z.width=Math.ceil(Pe),Z.height=Math.ceil(ke);var J=new l.StaticCanvas(Z,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});P.format==="jpeg"&&(J.backgroundColor="#fff"),this.setPositionByOrigin(new l.Point(J.width/2,J.height/2),"center","center");var de=this.canvas;J.add(this);var Se=J.toCanvasElement(X||1,P);return this.shadow=V,this.set("canvas",de),j&&(this.group=j),this.set(k).setCoords(),J._objects=[],J.dispose(),J=null,Se},toDataURL:function(P){return P||(P={}),l.util.toDataURL(this.toCanvasElement(P),P.format||"png",P.quality||1)},isType:function(P){return arguments.length>1?Array.from(arguments).includes(this.type):this.type===P},complexity:function(){return 1},toJSON:function(P){return this.toObject(P)},rotate:function(P){var F=(this.originX!=="center"||this.originY!=="center")&&this.centeredRotation;return F&&this._setOriginToCenter(),this.set("angle",P),F&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(P,F){F=F||this.canvas.getPointer(P);var k=new l.Point(F.x,F.y),j=this._getLeftTopCoords();return this.angle&&(k=l.util.rotatePoint(k,j,v(-this.angle))),{x:k.x-j.x,y:k.y-j.y}},_setupCompositeOperation:function(P){this.globalCompositeOperation&&(P.globalCompositeOperation=this.globalCompositeOperation)},dispose:function(){l.runningAnimations&&l.runningAnimations.cancelByTarget(this)}}),l.util.createAccessors&&l.util.createAccessors(l.Object),c(l.Object.prototype,l.Observable),l.Object.NUM_FRACTION_DIGITS=2,l.Object.ENLIVEN_PROPS=["clipPath"],l.Object._fromObject=function(P,F,k,j){var V=l[P];F=h(F,!0),l.util.enlivenPatterns([F.fill,F.stroke],function(Y){typeof Y[0]<"u"&&(F.fill=Y[0]),typeof Y[1]<"u"&&(F.stroke=Y[1]),l.util.enlivenObjectEnlivables(F,F,function(){var X=j?new V(F[j],F):new V(F);k&&k(X)})})},l.Object.__uid=0)}(t),function(){var a=e.util.degreesToRadians,l={left:-.5,center:0,right:.5},c={top:-.5,center:0,bottom:.5};e.util.object.extend(e.Object.prototype,{translateToGivenOrigin:function(h,p,y,v,x){var I=h.x,P=h.y,F,k,j;return typeof p=="string"?p=l[p]:p-=.5,typeof v=="string"?v=l[v]:v-=.5,F=v-p,typeof y=="string"?y=c[y]:y-=.5,typeof x=="string"?x=c[x]:x-=.5,k=x-y,(F||k)&&(j=this._getTransformedDimensions(),I=h.x+F*j.x,P=h.y+k*j.y),new e.Point(I,P)},translateToCenterPoint:function(h,p,y){var v=this.translateToGivenOrigin(h,p,y,"center","center");return this.angle?e.util.rotatePoint(v,h,a(this.angle)):v},translateToOriginPoint:function(h,p,y){var v=this.translateToGivenOrigin(h,"center","center",p,y);return this.angle?e.util.rotatePoint(v,h,a(this.angle)):v},getCenterPoint:function(){var h=new e.Point(this.left,this.top);return this.translateToCenterPoint(h,this.originX,this.originY)},getPointByOrigin:function(h,p){var y=this.getCenterPoint();return this.translateToOriginPoint(y,h,p)},toLocalPoint:function(h,p,y){var v=this.getCenterPoint(),x,I;return typeof p<"u"&&typeof y<"u"?x=this.translateToGivenOrigin(v,"center","center",p,y):x=new e.Point(this.left,this.top),I=new e.Point(h.x,h.y),this.angle&&(I=e.util.rotatePoint(I,v,-a(this.angle))),I.subtractEquals(x)},setPositionByOrigin:function(h,p,y){var v=this.translateToCenterPoint(h,p,y),x=this.translateToOriginPoint(v,this.originX,this.originY);this.set("left",x.x),this.set("top",x.y)},adjustPosition:function(h){var p=a(this.angle),y=this.getScaledWidth(),v=e.util.cos(p)*y,x=e.util.sin(p)*y,I,P;typeof this.originX=="string"?I=l[this.originX]:I=this.originX-.5,typeof h=="string"?P=l[h]:P=h-.5,this.left+=v*(P-I),this.top+=x*(P-I),this.setCoords(),this.originX=h},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var h=this.getCenterPoint();this.originX="center",this.originY="center",this.left=h.x,this.top=h.y},_resetOrigin:function(){var h=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=h.x,this.top=h.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){function a(y){return[new e.Point(y.tl.x,y.tl.y),new e.Point(y.tr.x,y.tr.y),new e.Point(y.br.x,y.br.y),new e.Point(y.bl.x,y.bl.y)]}var l=e.util,c=l.degreesToRadians,h=l.multiplyTransformMatrices,p=l.transformPoint;l.object.extend(e.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(y,v){return v?y?this.calcACoords():this.calcLineCoords():((!this.aCoords||!this.lineCoords)&&this.setCoords(!0),y?this.aCoords:this.lineCoords)},getCoords:function(y,v){return a(this._getCoords(y,v))},intersectsWithRect:function(y,v,x,I){var P=this.getCoords(x,I),F=e.Intersection.intersectPolygonRectangle(P,y,v);return F.status==="Intersection"},intersectsWithObject:function(y,v,x){var I=e.Intersection.intersectPolygonPolygon(this.getCoords(v,x),y.getCoords(v,x));return I.status==="Intersection"||y.isContainedWithinObject(this,v,x)||this.isContainedWithinObject(y,v,x)},isContainedWithinObject:function(y,v,x){for(var I=this.getCoords(v,x),P=v?y.aCoords:y.lineCoords,F=0,k=y._getImageLines(P);F<4;F++)if(!y.containsPoint(I[F],k))return!1;return!0},isContainedWithinRect:function(y,v,x,I){var P=this.getBoundingRect(x,I);return P.left>=y.x&&P.left+P.width<=v.x&&P.top>=y.y&&P.top+P.height<=v.y},containsPoint:function(y,F,x,I){var P=this._getCoords(x,I),F=F||this._getImageLines(P),k=this._findCrossPoints(y,F);return k!==0&&k%2===1},isOnScreen:function(y){if(!this.canvas)return!1;var v=this.canvas.vptCoords.tl,x=this.canvas.vptCoords.br,I=this.getCoords(!0,y);return I.some(function(P){return P.x<=x.x&&P.x>=v.x&&P.y<=x.y&&P.y>=v.y})||this.intersectsWithRect(v,x,!0,y)?!0:this._containsCenterOfCanvas(v,x,y)},_containsCenterOfCanvas:function(y,v,x){var I={x:(y.x+v.x)/2,y:(y.y+v.y)/2};return!!this.containsPoint(I,null,!0,x)},isPartiallyOnScreen:function(y){if(!this.canvas)return!1;var v=this.canvas.vptCoords.tl,x=this.canvas.vptCoords.br;if(this.intersectsWithRect(v,x,!0,y))return!0;var I=this.getCoords(!0,y).every(function(P){return(P.x>=x.x||P.x<=v.x)&&(P.y>=x.y||P.y<=v.y)});return I&&this._containsCenterOfCanvas(v,x,y)},_getImageLines:function(y){var v={topline:{o:y.tl,d:y.tr},rightline:{o:y.tr,d:y.br},bottomline:{o:y.br,d:y.bl},leftline:{o:y.bl,d:y.tl}};return v},_findCrossPoints:function(y,v){var x,I,P,F,k,j=0,V;for(var Y in v)if(V=v[Y],!(V.o.y=y.y&&V.d.y>=y.y)&&(V.o.x===V.d.x&&V.o.x>=y.x?k=V.o.x:(x=0,I=(V.d.y-V.o.y)/(V.d.x-V.o.x),P=y.y-x*y.x,F=V.o.y-I*V.o.x,k=-(P-F)/(x-I)),k>=y.x&&(j+=1),j===2))break;return j},getBoundingRect:function(y,v){var x=this.getCoords(y,v);return l.makeBoundingBoxFromPoints(x)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(y){return Math.abs(y)"u"&&(y=this.skewX),typeof v>"u"&&(v=this.skewY);var x,I,P,F=y===0&&v===0;if(this.strokeUniform?(I=this.width,P=this.height):(x=this._getNonTransformedDimensions(),I=x.x,P=x.y),F)return this._finalizeDimensions(I*this.scaleX,P*this.scaleY);var k=l.sizeAfterTransform(I,P,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:y,skewY:v});return this._finalizeDimensions(k.x,k.y)},_finalizeDimensions:function(y,v){return this.strokeUniform?{x:y+this.strokeWidth,y:v+this.strokeWidth}:{x:y,y:v}},_calculateCurrentDimensions:function(){var y=this.getViewportTransform(),v=this._getTransformedDimensions(),x=p(v,y,!0);return x.scalarAdd(2*this.padding)}})}(),e.util.object.extend(e.Object.prototype,{sendToBack:function(){return this.group?e.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?e.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(a){return this.group?e.StaticCanvas.prototype.sendBackwards.call(this.group,this,a):this.canvas&&this.canvas.sendBackwards(this,a),this},bringForward:function(a){return this.group?e.StaticCanvas.prototype.bringForward.call(this.group,this,a):this.canvas&&this.canvas.bringForward(this,a),this},moveTo:function(a){return this.group&&this.group.type!=="activeSelection"?e.StaticCanvas.prototype.moveTo.call(this.group,this,a):this.canvas&&this.canvas.moveTo(this,a),this}}),function(){function a(c,h){if(h){if(h.toLive)return c+": url(#SVGID_"+h.id+"); ";var p=new e.Color(h),y=c+": "+p.toRgb()+"; ",v=p.getAlpha();return v!==1&&(y+=c+"-opacity: "+v.toString()+"; "),y}else return c+": none; "}var l=e.util.toFixed;e.util.object.extend(e.Object.prototype,{getSvgStyles:function(c){var h=this.fillRule?this.fillRule:"nonzero",p=this.strokeWidth?this.strokeWidth:"0",y=this.strokeDashArray?this.strokeDashArray.join(" "):"none",v=this.strokeDashOffset?this.strokeDashOffset:"0",x=this.strokeLineCap?this.strokeLineCap:"butt",I=this.strokeLineJoin?this.strokeLineJoin:"miter",P=this.strokeMiterLimit?this.strokeMiterLimit:"4",F=typeof this.opacity<"u"?this.opacity:"1",k=this.visible?"":" visibility: hidden;",j=c?"":this.getSvgFilter(),V=a("fill",this.fill),Y=a("stroke",this.stroke);return[Y,"stroke-width: ",p,"; ","stroke-dasharray: ",y,"; ","stroke-linecap: ",x,"; ","stroke-dashoffset: ",v,"; ","stroke-linejoin: ",I,"; ","stroke-miterlimit: ",P,"; ",V,"fill-rule: ",h,"; ","opacity: ",F,";",j,k].join("")},getSvgSpanStyles:function(c,h){var p="; ",v=c.fontFamily?"font-family: "+(c.fontFamily.indexOf("'")===-1&&c.fontFamily.indexOf('"')===-1?"'"+c.fontFamily+"'":c.fontFamily)+p:"",y=c.strokeWidth?"stroke-width: "+c.strokeWidth+p:"",v=v,x=c.fontSize?"font-size: "+c.fontSize+"px"+p:"",I=c.fontStyle?"font-style: "+c.fontStyle+p:"",P=c.fontWeight?"font-weight: "+c.fontWeight+p:"",F=c.fill?a("fill",c.fill):"",k=c.stroke?a("stroke",c.stroke):"",j=this.getSvgTextDecoration(c),V=c.deltaY?"baseline-shift: "+-c.deltaY+"; ":"";return j&&(j="text-decoration: "+j+p),[k,y,v,x,I,P,j,F,V,h?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(c){return["overline","underline","line-through"].filter(function(h){return c[h.replace("-","")]}).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(c,h){var p=c?this.calcTransformMatrix():this.calcOwnMatrix(),y='transform="'+e.util.matrixToSVG(p);return y+(h||"")+'" '},_setSVGBg:function(c){if(this.backgroundColor){var h=e.Object.NUM_FRACTION_DIGITS;c.push(" +`)}},toSVG:function(c){return this._createBaseSVGMarkup(this._toSVG(c),{reviver:c})},toClipPathSVG:function(c){return" "+this._createBaseClipPathSVGMarkup(this._toSVG(c),{reviver:c})},_createBaseClipPathSVGMarkup:function(c,h){h=h||{};var p=h.reviver,y=h.additionalTransform||"",v=[this.getSvgTransform(!0,y),this.getSvgCommons()].join(""),x=c.indexOf("COMMON_PARTS");return c[x]=v,p?p(c.join("")):c.join("")},_createBaseSVGMarkup:function(c,h){h=h||{};var p=h.noStyle,y=h.reviver,v=p?"":'style="'+this.getSvgStyles()+'" ',x=h.withShadow?'style="'+this.getSvgFilter()+'" ':"",I=this.clipPath,P=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",F=I&&I.absolutePositioned,k=this.stroke,j=this.fill,V=this.shadow,Y,X=[],Z,ie=c.indexOf("COMMON_PARTS"),ce=h.additionalTransform;return I&&(I.clipPathId="CLIPPATH_"+e.Object.__uid++,Z=' `+I.toClipPathSVG(y)+` -`),L&&X.push(" -`),X.push(" -`),Y=[v,O,p?"":this.addPaintOrder()," ",fe?'transform="'+fe+'" ':""].join(""),c[re]=Y,G&&G.toLive&&X.push(G.toSVG(this)),N&&N.toLive&&X.push(N.toSVG(this)),V&&X.push(V.toSVG(this)),I&&X.push(te),X.push(c.join("")),X.push(` -`),L&&X.push(` -`),y?y(X.join("")):X.join("")},addPaintOrder:function(){return this.paintFirst!=="fill"?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var a=e.util.object.extend,l="stateProperties";function c(p,y,v){var S={},I=!0;v.forEach(function(O){S[O]=p[O]}),a(p[y],S,I)}function d(p,y,v){if(p===y)return!0;if(Array.isArray(p)){if(!Array.isArray(y)||p.length!==y.length)return!1;for(var S=0,I=p.length;S=0;I--)if(O=S[I],!!this.isControlVisible(O)&&(v=this._getImageLines(c?this.oCoords[O].touchCorner:this.oCoords[O].corner),y=this._findCrossPoints({x:d,y:p},v),y!==0&&y%2===1))return this.__corner=O,O;return!1},forEachControl:function(l){for(var c in this.controls)l(this.controls[c],c,this)},_setCornerCoords:function(){var l=this.oCoords;for(var c in l){var d=this.controls[c];l[c].corner=d.calcCornerCoords(this.angle,this.cornerSize,l[c].x,l[c].y,!1),l[c].touchCorner=d.calcCornerCoords(this.angle,this.touchCornerSize,l[c].x,l[c].y,!0)}},drawSelectionBackground:function(l){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;l.save();var c=this.getCenterPoint(),d=this._calculateCurrentDimensions(),p=this.canvas.viewportTransform;return l.translate(c.x,c.y),l.scale(1/p[0],1/p[3]),l.rotate(a(this.angle)),l.fillStyle=this.selectionBackgroundColor,l.fillRect(-d.x/2,-d.y/2,d.x,d.y),l.restore(),this},drawBorders:function(l,c){c=c||{};var d=this._calculateCurrentDimensions(),p=this.borderScaleFactor,y=d.x+p,v=d.y+p,S=typeof c.hasControls<"u"?c.hasControls:this.hasControls,I=!1;return l.save(),l.strokeStyle=c.borderColor||this.borderColor,this._setLineDash(l,c.borderDashArray||this.borderDashArray),l.strokeRect(-y/2,-v/2,y,v),S&&(l.beginPath(),this.forEachControl(function(O,L,N){O.withConnection&&O.getVisibility(N,L)&&(I=!0,l.moveTo(O.x*y,O.y*v),l.lineTo(O.x*y+O.offsetX,O.y*v+O.offsetY))}),I&&l.stroke()),l.restore(),this},drawBordersInGroup:function(l,c,d){d=d||{};var p=e.util.sizeAfterTransform(this.width,this.height,c),y=this.strokeWidth,v=this.strokeUniform,S=this.borderScaleFactor,I=p.x+y*(v?this.canvas.getZoom():c.scaleX)+S,O=p.y+y*(v?this.canvas.getZoom():c.scaleY)+S;return l.save(),this._setLineDash(l,d.borderDashArray||this.borderDashArray),l.strokeStyle=d.borderColor||this.borderColor,l.strokeRect(-I/2,-O/2,I,O),l.restore(),this},drawControls:function(l,c){c=c||{},l.save();var d=this.canvas.getRetinaScaling(),p,y;return l.setTransform(d,0,0,d,0,0),l.strokeStyle=l.fillStyle=c.cornerColor||this.cornerColor,this.transparentCorners||(l.strokeStyle=c.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(l,c.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(p=this.group.calcTransformMatrix()),this.forEachControl(function(v,S,I){y=I.oCoords[S],v.getVisibility(I,S)&&(p&&(y=e.util.transformPoint(y,p)),v.render(l,y.x,y.y,c,I))}),l.restore(),this},isControlVisible:function(l){return this.controls[l]&&this.controls[l].getVisibility(this,l)},setControlVisible:function(l,c){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[l]=c,this},setControlsVisibility:function(l){l||(l={});for(var c in l)this.setControlVisible(c,l[c]);return this},onDeselect:function(){},onSelect:function(){}})}(),e.util.object.extend(e.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(a,l){l=l||{};var c=function(){},d=l.onComplete||c,p=l.onChange||c,y=this;return e.util.animate({target:this,startValue:a.left,endValue:this.getCenterPoint().x,duration:this.FX_DURATION,onChange:function(v){a.set("left",v),y.requestRenderAll(),p()},onComplete:function(){a.setCoords(),d()}})},fxCenterObjectV:function(a,l){l=l||{};var c=function(){},d=l.onComplete||c,p=l.onChange||c,y=this;return e.util.animate({target:this,startValue:a.top,endValue:this.getCenterPoint().y,duration:this.FX_DURATION,onChange:function(v){a.set("top",v),y.requestRenderAll(),p()},onComplete:function(){a.setCoords(),d()}})},fxRemove:function(a,l){l=l||{};var c=function(){},d=l.onComplete||c,p=l.onChange||c,y=this;return e.util.animate({target:this,startValue:a.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(v){a.set("opacity",v),y.requestRenderAll(),p()},onComplete:function(){y.remove(a),d()}})}}),e.util.object.extend(e.Object.prototype,{animate:function(){if(arguments[0]&&typeof arguments[0]=="object"){var a=[],l,c,d=[];for(l in arguments[0])a.push(l);for(var p=0,y=a.length;p-1||y&&p.colorProperties.indexOf(y[1])>-1,S=y?this.get(y[0])[y[1]]:this.get(a);"from"in c||(c.from=S),v||(~l.indexOf("=")?l=S+parseFloat(l.replace("=","")):l=parseFloat(l));var I={target:this,startValue:c.from,endValue:l,byValue:c.by,easing:c.easing,duration:c.duration,abort:c.abort&&function(O,L,N){return c.abort.call(p,O,L,N)},onChange:function(O,L,N){y?p[y[0]][y[1]]=O:p.set(a,O),!d&&c.onChange&&c.onChange(O,L,N)},onComplete:function(O,L,N){d||(p.setCoords(),c.onComplete&&c.onComplete(O,L,N))}};return v?e.util.animateColor(I.startValue,I.endValue,I.duration,I):e.util.animate(I)}}),function(a){var l=a.fabric||(a.fabric={}),c=l.util.object.extend,d=l.util.object.clone,p={x1:1,x2:1,y1:1,y2:1};if(l.Line){l.warn("fabric.Line is already defined");return}l.Line=l.util.createClass(l.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:l.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(v,S){v||(v=[0,0,0,0]),this.callSuper("initialize",S),this.set("x1",v[0]),this.set("y1",v[1]),this.set("x2",v[2]),this.set("y2",v[3]),this._setWidthHeight(S)},_setWidthHeight:function(v){v||(v={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in v?v.left:this._getLeftToOriginX(),this.top="top"in v?v.top:this._getTopToOriginY()},_set:function(v,S){return this.callSuper("_set",v,S),typeof p[v]<"u"&&this._setWidthHeight(),this},_getLeftToOriginX:y({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:y({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(v){v.beginPath();var S=this.calcLinePoints();v.moveTo(S.x1,S.y1),v.lineTo(S.x2,S.y2),v.lineWidth=this.strokeWidth;var I=v.strokeStyle;v.strokeStyle=this.stroke||v.fillStyle,this.stroke&&this._renderStroke(v),v.strokeStyle=I},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(v){return c(this.callSuper("toObject",v),this.calcLinePoints())},_getNonTransformedDimensions:function(){var v=this.callSuper("_getNonTransformedDimensions");return this.strokeLineCap==="butt"&&(this.width===0&&(v.y-=this.strokeWidth),this.height===0&&(v.x-=this.strokeWidth)),v},calcLinePoints:function(){var v=this.x1<=this.x2?-1:1,S=this.y1<=this.y2?-1:1,I=v*this.width*.5,O=S*this.height*.5,L=v*this.width*-.5,N=S*this.height*-.5;return{x1:I,x2:L,y1:O,y2:N}},_toSVG:function(){var v=this.calcLinePoints();return[" -`]}}),l.Line.ATTRIBUTE_NAMES=l.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),l.Line.fromElement=function(v,S,I){I=I||{};var O=l.parseAttributes(v,l.Line.ATTRIBUTE_NAMES),L=[O.x1||0,O.y1||0,O.x2||0,O.y2||0];S(new l.Line(L,c(O,I)))},l.Line.fromObject=function(v,S){function I(L){delete L.points,S&&S(L)}var O=d(v,!0);O.points=[v.x1,v.y1,v.x2,v.y2],l.Object._fromObject("Line",O,I,"points")};function y(v,S){var I=v.origin,O=v.axis1,L=v.axis2,N=v.dimension,G=S.nearest,V=S.center,Y=S.farthest;return function(){switch(this.get(I)){case G:return Math.min(this.get(O),this.get(L));case V:return Math.min(this.get(O),this.get(L))+.5*this.get(N);case Y:return Math.max(this.get(O),this.get(L))}}}}(t),function(a){var l=a.fabric||(a.fabric={}),c=l.util.degreesToRadians;if(l.Circle){l.warn("fabric.Circle is already defined.");return}l.Circle=l.util.createClass(l.Object,{type:"circle",radius:0,startAngle:0,endAngle:360,cacheProperties:l.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(p,y){return this.callSuper("_set",p,y),p==="radius"&&this.setRadius(y),this},toObject:function(p){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(p))},_toSVG:function(){var p,y=0,v=0,S=(this.endAngle-this.startAngle)%360;if(S===0)p=[" -`];else{var I=c(this.startAngle),O=c(this.endAngle),L=this.radius,N=l.util.cos(I)*L,G=l.util.sin(I)*L,V=l.util.cos(O)*L,Y=l.util.sin(O)*L,X=S>180?"1":"0";p=[' -`]}return p},_render:function(p){p.beginPath(),p.arc(0,0,this.radius,c(this.startAngle),c(this.endAngle),!1),this._renderPaintInOrder(p)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(p){return this.radius=p,this.set("width",p*2).set("height",p*2)}}),l.Circle.ATTRIBUTE_NAMES=l.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),l.Circle.fromElement=function(p,y){var v=l.parseAttributes(p,l.Circle.ATTRIBUTE_NAMES);if(!d(v))throw new Error("value of `r` attribute is required and can not be negative");v.left=(v.left||0)-v.radius,v.top=(v.top||0)-v.radius,y(new l.Circle(v))};function d(p){return"radius"in p&&p.radius>=0}l.Circle.fromObject=function(p,y){l.Object._fromObject("Circle",p,y)}}(t),function(a){var l=a.fabric||(a.fabric={});if(l.Triangle){l.warn("fabric.Triangle is already defined");return}l.Triangle=l.util.createClass(l.Object,{type:"triangle",width:100,height:100,_render:function(c){var d=this.width/2,p=this.height/2;c.beginPath(),c.moveTo(-d,p),c.lineTo(0,-p),c.lineTo(d,p),c.closePath(),this._renderPaintInOrder(c)},_toSVG:function(){var c=this.width/2,d=this.height/2,p=[-c+" "+d,"0 "+-d,c+" "+d].join(",");return["']}}),l.Triangle.fromObject=function(c,d){return l.Object._fromObject("Triangle",c,d)}}(t),function(a){var l=a.fabric||(a.fabric={}),c=Math.PI*2;if(l.Ellipse){l.warn("fabric.Ellipse is already defined.");return}l.Ellipse=l.util.createClass(l.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:l.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(d){this.callSuper("initialize",d),this.set("rx",d&&d.rx||0),this.set("ry",d&&d.ry||0)},_set:function(d,p){switch(this.callSuper("_set",d,p),d){case"rx":this.rx=p,this.set("width",p*2);break;case"ry":this.ry=p,this.set("height",p*2);break}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(d){return this.callSuper("toObject",["rx","ry"].concat(d))},_toSVG:function(){return[" -`]},_render:function(d){d.beginPath(),d.save(),d.transform(1,0,0,this.ry/this.rx,0,0),d.arc(0,0,this.rx,0,c,!1),d.restore(),this._renderPaintInOrder(d)}}),l.Ellipse.ATTRIBUTE_NAMES=l.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),l.Ellipse.fromElement=function(d,p){var y=l.parseAttributes(d,l.Ellipse.ATTRIBUTE_NAMES);y.left=(y.left||0)-y.rx,y.top=(y.top||0)-y.ry,p(new l.Ellipse(y))},l.Ellipse.fromObject=function(d,p){l.Object._fromObject("Ellipse",d,p)}}(t),function(a){var l=a.fabric||(a.fabric={}),c=l.util.object.extend;if(l.Rect){l.warn("fabric.Rect is already defined");return}l.Rect=l.util.createClass(l.Object,{stateProperties:l.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:l.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(d){this.callSuper("initialize",d),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(d){var p=this.rx?Math.min(this.rx,this.width/2):0,y=this.ry?Math.min(this.ry,this.height/2):0,v=this.width,S=this.height,I=-this.width/2,O=-this.height/2,L=p!==0||y!==0,N=1-.5522847498;d.beginPath(),d.moveTo(I+p,O),d.lineTo(I+v-p,O),L&&d.bezierCurveTo(I+v-N*p,O,I+v,O+N*y,I+v,O+y),d.lineTo(I+v,O+S-y),L&&d.bezierCurveTo(I+v,O+S-N*y,I+v-N*p,O+S,I+v-p,O+S),d.lineTo(I+p,O+S),L&&d.bezierCurveTo(I+N*p,O+S,I,O+S-N*y,I,O+S-y),d.lineTo(I,O+y),L&&d.bezierCurveTo(I,O+N*y,I+N*p,O,I+p,O),d.closePath(),this._renderPaintInOrder(d)},toObject:function(d){return this.callSuper("toObject",["rx","ry"].concat(d))},_toSVG:function(){var d=-this.width/2,p=-this.height/2;return[" -`]}}),l.Rect.ATTRIBUTE_NAMES=l.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),l.Rect.fromElement=function(d,p,y){if(!d)return p(null);y=y||{};var v=l.parseAttributes(d,l.Rect.ATTRIBUTE_NAMES);v.left=v.left||0,v.top=v.top||0,v.height=v.height||0,v.width=v.width||0;var S=new l.Rect(c(y?l.util.object.clone(y):{},v));S.visible=S.visible&&S.width>0&&S.height>0,p(S)},l.Rect.fromObject=function(d,p){return l.Object._fromObject("Rect",d,p)}}(t),function(a){var l=a.fabric||(a.fabric={}),c=l.util.object.extend,d=l.util.array.min,p=l.util.array.max,y=l.util.toFixed,v=l.util.projectStrokeOnPoints;if(l.Polyline){l.warn("fabric.Polyline is already defined");return}l.Polyline=l.util.createClass(l.Object,{type:"polyline",points:null,exactBoundingBox:!1,cacheProperties:l.Object.prototype.cacheProperties.concat("points"),initialize:function(S,I){I=I||{},this.points=S||[],this.callSuper("initialize",I),this._setPositionDimensions(I)},_projectStrokeOnPoints:function(){return v(this.points,this,!0)},_setPositionDimensions:function(S){var I=this._calcDimensions(S),O,L=this.exactBoundingBox?this.strokeWidth:0;this.width=I.width-L,this.height=I.height-L,S.fromSVG||(O=this.translateToGivenOrigin({x:I.left-this.strokeWidth/2+L/2,y:I.top-this.strokeWidth/2+L/2},"left","top",this.originX,this.originY)),typeof S.left>"u"&&(this.left=S.fromSVG?I.left:O.x),typeof S.top>"u"&&(this.top=S.fromSVG?I.top:O.y),this.pathOffset={x:I.left+this.width/2+L/2,y:I.top+this.height/2+L/2}},_calcDimensions:function(){var S=this.exactBoundingBox?this._projectStrokeOnPoints():this.points,I=d(S,"x")||0,O=d(S,"y")||0,L=p(S,"x")||0,N=p(S,"y")||0,G=L-I,V=N-O;return{left:I,top:O,width:G,height:V}},toObject:function(S){return c(this.callSuper("toObject",S),{points:this.points.concat()})},_toSVG:function(){for(var S=[],I=this.pathOffset.x,O=this.pathOffset.y,L=l.Object.NUM_FRACTION_DIGITS,N=0,G=this.points.length;N -`]},commonRender:function(S){var I,O=this.points.length,L=this.pathOffset.x,N=this.pathOffset.y;if(!O||isNaN(this.points[O-1].y))return!1;S.beginPath(),S.moveTo(this.points[0].x-L,this.points[0].y-N);for(var G=0;G"},toObject:function(S){return p(this.callSuper("toObject",S),{path:this.path.map(function(I){return I.slice()})})},toDatalessObject:function(S){var I=this.toObject(["sourcePath"].concat(S));return I.sourcePath&&delete I.path,I},_toSVG:function(){var S=l.util.joinPath(this.path);return[" -`]},_getOffsetTransform:function(){var S=l.Object.NUM_FRACTION_DIGITS;return" translate("+v(-this.pathOffset.x,S)+", "+v(-this.pathOffset.y,S)+")"},toClipPathSVG:function(S){var I=this._getOffsetTransform();return" "+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:S,additionalTransform:I})},toSVG:function(S){var I=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:S,additionalTransform:I})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var S=[],I=[],O,L=0,N=0,G=0,V=0,Y,X=0,te=this.path.length;X"},addWithUpdate:function(p){var y=!!this.group;return this._restoreObjectsState(),l.util.resetObjectTransform(this),p&&(y&&l.util.removeTransformFromObject(p,this.group.calcTransformMatrix()),this._objects.push(p),p.group=this,p._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,y?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(p){return this._restoreObjectsState(),l.util.resetObjectTransform(this),this.remove(p),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(p){this.dirty=!0,p.group=this,p._set("canvas",this.canvas)},_onObjectRemoved:function(p){this.dirty=!0,delete p.group},_set:function(p,y){var v=this._objects.length;if(this.useSetOnGroup)for(;v--;)this._objects[v].setOnGroup(p,y);if(p==="canvas")for(;v--;)this._objects[v]._set(p,y);l.Object.prototype._set.call(this,p,y)},toObject:function(p){var y=this.includeDefaultValues,v=this._objects.filter(function(I){return!I.excludeFromExport}).map(function(I){var O=I.includeDefaultValues;I.includeDefaultValues=y;var L=I.toObject(p);return I.includeDefaultValues=O,L}),S=l.Object.prototype.toObject.call(this,p);return S.objects=v,S},toDatalessObject:function(p){var y,v=this.sourcePath;if(v)y=v;else{var S=this.includeDefaultValues;y=this._objects.map(function(O){var L=O.includeDefaultValues;O.includeDefaultValues=S;var N=O.toDatalessObject(p);return O.includeDefaultValues=L,N})}var I=l.Object.prototype.toDatalessObject.call(this,p);return I.objects=y,I},render:function(p){this._transformDone=!0,this.callSuper("render",p),this._transformDone=!1},shouldCache:function(){var p=l.Object.prototype.shouldCache.call(this);if(p){for(var y=0,v=this._objects.length;y -`],v=0,S=this._objects.length;v -`),y},getSvgStyles:function(){var p=typeof this.opacity<"u"&&this.opacity!==1?"opacity: "+this.opacity+";":"",y=this.visible?"":" visibility: hidden;";return[p,this.getSvgFilter(),y].join("")},toClipPathSVG:function(p){for(var y=[],v=0,S=this._objects.length;v"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(c,d,p){c.save(),c.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",c,d),p=p||{},typeof p.hasControls>"u"&&(p.hasControls=!1),p.forActiveSelection=!0;for(var y=0,v=this._objects.length;y -`,' +`),F&&X.push(" +`),X.push(" +`),Y=[v,P,p?"":this.addPaintOrder()," ",ce?'transform="'+ce+'" ':""].join(""),c[ie]=Y,j&&j.toLive&&X.push(j.toSVG(this)),k&&k.toLive&&X.push(k.toSVG(this)),V&&X.push(V.toSVG(this)),I&&X.push(Z),X.push(c.join("")),X.push(` +`),F&&X.push(` +`),y?y(X.join("")):X.join("")},addPaintOrder:function(){return this.paintFirst!=="fill"?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var a=e.util.object.extend,l="stateProperties";function c(p,y,v){var x={},I=!0;v.forEach(function(P){x[P]=p[P]}),a(p[y],x,I)}function h(p,y,v){if(p===y)return!0;if(Array.isArray(p)){if(!Array.isArray(y)||p.length!==y.length)return!1;for(var x=0,I=p.length;x=0;I--)if(P=x[I],!!this.isControlVisible(P)&&(v=this._getImageLines(c?this.oCoords[P].touchCorner:this.oCoords[P].corner),y=this._findCrossPoints({x:h,y:p},v),y!==0&&y%2===1))return this.__corner=P,P;return!1},forEachControl:function(l){for(var c in this.controls)l(this.controls[c],c,this)},_setCornerCoords:function(){var l=this.oCoords;for(var c in l){var h=this.controls[c];l[c].corner=h.calcCornerCoords(this.angle,this.cornerSize,l[c].x,l[c].y,!1),l[c].touchCorner=h.calcCornerCoords(this.angle,this.touchCornerSize,l[c].x,l[c].y,!0)}},drawSelectionBackground:function(l){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;l.save();var c=this.getCenterPoint(),h=this._calculateCurrentDimensions(),p=this.canvas.viewportTransform;return l.translate(c.x,c.y),l.scale(1/p[0],1/p[3]),l.rotate(a(this.angle)),l.fillStyle=this.selectionBackgroundColor,l.fillRect(-h.x/2,-h.y/2,h.x,h.y),l.restore(),this},drawBorders:function(l,c){c=c||{};var h=this._calculateCurrentDimensions(),p=this.borderScaleFactor,y=h.x+p,v=h.y+p,x=typeof c.hasControls<"u"?c.hasControls:this.hasControls,I=!1;return l.save(),l.strokeStyle=c.borderColor||this.borderColor,this._setLineDash(l,c.borderDashArray||this.borderDashArray),l.strokeRect(-y/2,-v/2,y,v),x&&(l.beginPath(),this.forEachControl(function(P,F,k){P.withConnection&&P.getVisibility(k,F)&&(I=!0,l.moveTo(P.x*y,P.y*v),l.lineTo(P.x*y+P.offsetX,P.y*v+P.offsetY))}),I&&l.stroke()),l.restore(),this},drawBordersInGroup:function(l,c,h){h=h||{};var p=e.util.sizeAfterTransform(this.width,this.height,c),y=this.strokeWidth,v=this.strokeUniform,x=this.borderScaleFactor,I=p.x+y*(v?this.canvas.getZoom():c.scaleX)+x,P=p.y+y*(v?this.canvas.getZoom():c.scaleY)+x;return l.save(),this._setLineDash(l,h.borderDashArray||this.borderDashArray),l.strokeStyle=h.borderColor||this.borderColor,l.strokeRect(-I/2,-P/2,I,P),l.restore(),this},drawControls:function(l,c){c=c||{},l.save();var h=this.canvas.getRetinaScaling(),p,y;return l.setTransform(h,0,0,h,0,0),l.strokeStyle=l.fillStyle=c.cornerColor||this.cornerColor,this.transparentCorners||(l.strokeStyle=c.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(l,c.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(p=this.group.calcTransformMatrix()),this.forEachControl(function(v,x,I){y=I.oCoords[x],v.getVisibility(I,x)&&(p&&(y=e.util.transformPoint(y,p)),v.render(l,y.x,y.y,c,I))}),l.restore(),this},isControlVisible:function(l){return this.controls[l]&&this.controls[l].getVisibility(this,l)},setControlVisible:function(l,c){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[l]=c,this},setControlsVisibility:function(l){l||(l={});for(var c in l)this.setControlVisible(c,l[c]);return this},onDeselect:function(){},onSelect:function(){}})}(),e.util.object.extend(e.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(a,l){l=l||{};var c=function(){},h=l.onComplete||c,p=l.onChange||c,y=this;return e.util.animate({target:this,startValue:a.left,endValue:this.getCenterPoint().x,duration:this.FX_DURATION,onChange:function(v){a.set("left",v),y.requestRenderAll(),p()},onComplete:function(){a.setCoords(),h()}})},fxCenterObjectV:function(a,l){l=l||{};var c=function(){},h=l.onComplete||c,p=l.onChange||c,y=this;return e.util.animate({target:this,startValue:a.top,endValue:this.getCenterPoint().y,duration:this.FX_DURATION,onChange:function(v){a.set("top",v),y.requestRenderAll(),p()},onComplete:function(){a.setCoords(),h()}})},fxRemove:function(a,l){l=l||{};var c=function(){},h=l.onComplete||c,p=l.onChange||c,y=this;return e.util.animate({target:this,startValue:a.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(v){a.set("opacity",v),y.requestRenderAll(),p()},onComplete:function(){y.remove(a),h()}})}}),e.util.object.extend(e.Object.prototype,{animate:function(){if(arguments[0]&&typeof arguments[0]=="object"){var a=[],l,c,h=[];for(l in arguments[0])a.push(l);for(var p=0,y=a.length;p-1||y&&p.colorProperties.indexOf(y[1])>-1,x=y?this.get(y[0])[y[1]]:this.get(a);"from"in c||(c.from=x),v||(~l.indexOf("=")?l=x+parseFloat(l.replace("=","")):l=parseFloat(l));var I={target:this,startValue:c.from,endValue:l,byValue:c.by,easing:c.easing,duration:c.duration,abort:c.abort&&function(P,F,k){return c.abort.call(p,P,F,k)},onChange:function(P,F,k){y?p[y[0]][y[1]]=P:p.set(a,P),!h&&c.onChange&&c.onChange(P,F,k)},onComplete:function(P,F,k){h||(p.setCoords(),c.onComplete&&c.onComplete(P,F,k))}};return v?e.util.animateColor(I.startValue,I.endValue,I.duration,I):e.util.animate(I)}}),function(a){var l=a.fabric||(a.fabric={}),c=l.util.object.extend,h=l.util.object.clone,p={x1:1,x2:1,y1:1,y2:1};if(l.Line){l.warn("fabric.Line is already defined");return}l.Line=l.util.createClass(l.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:l.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(v,x){v||(v=[0,0,0,0]),this.callSuper("initialize",x),this.set("x1",v[0]),this.set("y1",v[1]),this.set("x2",v[2]),this.set("y2",v[3]),this._setWidthHeight(x)},_setWidthHeight:function(v){v||(v={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in v?v.left:this._getLeftToOriginX(),this.top="top"in v?v.top:this._getTopToOriginY()},_set:function(v,x){return this.callSuper("_set",v,x),typeof p[v]<"u"&&this._setWidthHeight(),this},_getLeftToOriginX:y({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:y({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(v){v.beginPath();var x=this.calcLinePoints();v.moveTo(x.x1,x.y1),v.lineTo(x.x2,x.y2),v.lineWidth=this.strokeWidth;var I=v.strokeStyle;v.strokeStyle=this.stroke||v.fillStyle,this.stroke&&this._renderStroke(v),v.strokeStyle=I},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(v){return c(this.callSuper("toObject",v),this.calcLinePoints())},_getNonTransformedDimensions:function(){var v=this.callSuper("_getNonTransformedDimensions");return this.strokeLineCap==="butt"&&(this.width===0&&(v.y-=this.strokeWidth),this.height===0&&(v.x-=this.strokeWidth)),v},calcLinePoints:function(){var v=this.x1<=this.x2?-1:1,x=this.y1<=this.y2?-1:1,I=v*this.width*.5,P=x*this.height*.5,F=v*this.width*-.5,k=x*this.height*-.5;return{x1:I,x2:F,y1:P,y2:k}},_toSVG:function(){var v=this.calcLinePoints();return[" +`]}}),l.Line.ATTRIBUTE_NAMES=l.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),l.Line.fromElement=function(v,x,I){I=I||{};var P=l.parseAttributes(v,l.Line.ATTRIBUTE_NAMES),F=[P.x1||0,P.y1||0,P.x2||0,P.y2||0];x(new l.Line(F,c(P,I)))},l.Line.fromObject=function(v,x){function I(F){delete F.points,x&&x(F)}var P=h(v,!0);P.points=[v.x1,v.y1,v.x2,v.y2],l.Object._fromObject("Line",P,I,"points")};function y(v,x){var I=v.origin,P=v.axis1,F=v.axis2,k=v.dimension,j=x.nearest,V=x.center,Y=x.farthest;return function(){switch(this.get(I)){case j:return Math.min(this.get(P),this.get(F));case V:return Math.min(this.get(P),this.get(F))+.5*this.get(k);case Y:return Math.max(this.get(P),this.get(F))}}}}(t),function(a){var l=a.fabric||(a.fabric={}),c=l.util.degreesToRadians;if(l.Circle){l.warn("fabric.Circle is already defined.");return}l.Circle=l.util.createClass(l.Object,{type:"circle",radius:0,startAngle:0,endAngle:360,cacheProperties:l.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(p,y){return this.callSuper("_set",p,y),p==="radius"&&this.setRadius(y),this},toObject:function(p){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(p))},_toSVG:function(){var p,y=0,v=0,x=(this.endAngle-this.startAngle)%360;if(x===0)p=[" +`];else{var I=c(this.startAngle),P=c(this.endAngle),F=this.radius,k=l.util.cos(I)*F,j=l.util.sin(I)*F,V=l.util.cos(P)*F,Y=l.util.sin(P)*F,X=x>180?"1":"0";p=[' +`]}return p},_render:function(p){p.beginPath(),p.arc(0,0,this.radius,c(this.startAngle),c(this.endAngle),!1),this._renderPaintInOrder(p)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(p){return this.radius=p,this.set("width",p*2).set("height",p*2)}}),l.Circle.ATTRIBUTE_NAMES=l.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),l.Circle.fromElement=function(p,y){var v=l.parseAttributes(p,l.Circle.ATTRIBUTE_NAMES);if(!h(v))throw new Error("value of `r` attribute is required and can not be negative");v.left=(v.left||0)-v.radius,v.top=(v.top||0)-v.radius,y(new l.Circle(v))};function h(p){return"radius"in p&&p.radius>=0}l.Circle.fromObject=function(p,y){l.Object._fromObject("Circle",p,y)}}(t),function(a){var l=a.fabric||(a.fabric={});if(l.Triangle){l.warn("fabric.Triangle is already defined");return}l.Triangle=l.util.createClass(l.Object,{type:"triangle",width:100,height:100,_render:function(c){var h=this.width/2,p=this.height/2;c.beginPath(),c.moveTo(-h,p),c.lineTo(0,-p),c.lineTo(h,p),c.closePath(),this._renderPaintInOrder(c)},_toSVG:function(){var c=this.width/2,h=this.height/2,p=[-c+" "+h,"0 "+-h,c+" "+h].join(",");return["']}}),l.Triangle.fromObject=function(c,h){return l.Object._fromObject("Triangle",c,h)}}(t),function(a){var l=a.fabric||(a.fabric={}),c=Math.PI*2;if(l.Ellipse){l.warn("fabric.Ellipse is already defined.");return}l.Ellipse=l.util.createClass(l.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:l.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(h){this.callSuper("initialize",h),this.set("rx",h&&h.rx||0),this.set("ry",h&&h.ry||0)},_set:function(h,p){switch(this.callSuper("_set",h,p),h){case"rx":this.rx=p,this.set("width",p*2);break;case"ry":this.ry=p,this.set("height",p*2);break}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(h){return this.callSuper("toObject",["rx","ry"].concat(h))},_toSVG:function(){return[" +`]},_render:function(h){h.beginPath(),h.save(),h.transform(1,0,0,this.ry/this.rx,0,0),h.arc(0,0,this.rx,0,c,!1),h.restore(),this._renderPaintInOrder(h)}}),l.Ellipse.ATTRIBUTE_NAMES=l.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),l.Ellipse.fromElement=function(h,p){var y=l.parseAttributes(h,l.Ellipse.ATTRIBUTE_NAMES);y.left=(y.left||0)-y.rx,y.top=(y.top||0)-y.ry,p(new l.Ellipse(y))},l.Ellipse.fromObject=function(h,p){l.Object._fromObject("Ellipse",h,p)}}(t),function(a){var l=a.fabric||(a.fabric={}),c=l.util.object.extend;if(l.Rect){l.warn("fabric.Rect is already defined");return}l.Rect=l.util.createClass(l.Object,{stateProperties:l.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:l.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(h){this.callSuper("initialize",h),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(h){var p=this.rx?Math.min(this.rx,this.width/2):0,y=this.ry?Math.min(this.ry,this.height/2):0,v=this.width,x=this.height,I=-this.width/2,P=-this.height/2,F=p!==0||y!==0,k=1-.5522847498;h.beginPath(),h.moveTo(I+p,P),h.lineTo(I+v-p,P),F&&h.bezierCurveTo(I+v-k*p,P,I+v,P+k*y,I+v,P+y),h.lineTo(I+v,P+x-y),F&&h.bezierCurveTo(I+v,P+x-k*y,I+v-k*p,P+x,I+v-p,P+x),h.lineTo(I+p,P+x),F&&h.bezierCurveTo(I+k*p,P+x,I,P+x-k*y,I,P+x-y),h.lineTo(I,P+y),F&&h.bezierCurveTo(I,P+k*y,I+k*p,P,I+p,P),h.closePath(),this._renderPaintInOrder(h)},toObject:function(h){return this.callSuper("toObject",["rx","ry"].concat(h))},_toSVG:function(){var h=-this.width/2,p=-this.height/2;return[" +`]}}),l.Rect.ATTRIBUTE_NAMES=l.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),l.Rect.fromElement=function(h,p,y){if(!h)return p(null);y=y||{};var v=l.parseAttributes(h,l.Rect.ATTRIBUTE_NAMES);v.left=v.left||0,v.top=v.top||0,v.height=v.height||0,v.width=v.width||0;var x=new l.Rect(c(y?l.util.object.clone(y):{},v));x.visible=x.visible&&x.width>0&&x.height>0,p(x)},l.Rect.fromObject=function(h,p){return l.Object._fromObject("Rect",h,p)}}(t),function(a){var l=a.fabric||(a.fabric={}),c=l.util.object.extend,h=l.util.array.min,p=l.util.array.max,y=l.util.toFixed,v=l.util.projectStrokeOnPoints;if(l.Polyline){l.warn("fabric.Polyline is already defined");return}l.Polyline=l.util.createClass(l.Object,{type:"polyline",points:null,exactBoundingBox:!1,cacheProperties:l.Object.prototype.cacheProperties.concat("points"),initialize:function(x,I){I=I||{},this.points=x||[],this.callSuper("initialize",I),this._setPositionDimensions(I)},_projectStrokeOnPoints:function(){return v(this.points,this,!0)},_setPositionDimensions:function(x){var I=this._calcDimensions(x),P,F=this.exactBoundingBox?this.strokeWidth:0;this.width=I.width-F,this.height=I.height-F,x.fromSVG||(P=this.translateToGivenOrigin({x:I.left-this.strokeWidth/2+F/2,y:I.top-this.strokeWidth/2+F/2},"left","top",this.originX,this.originY)),typeof x.left>"u"&&(this.left=x.fromSVG?I.left:P.x),typeof x.top>"u"&&(this.top=x.fromSVG?I.top:P.y),this.pathOffset={x:I.left+this.width/2+F/2,y:I.top+this.height/2+F/2}},_calcDimensions:function(){var x=this.exactBoundingBox?this._projectStrokeOnPoints():this.points,I=h(x,"x")||0,P=h(x,"y")||0,F=p(x,"x")||0,k=p(x,"y")||0,j=F-I,V=k-P;return{left:I,top:P,width:j,height:V}},toObject:function(x){return c(this.callSuper("toObject",x),{points:this.points.concat()})},_toSVG:function(){for(var x=[],I=this.pathOffset.x,P=this.pathOffset.y,F=l.Object.NUM_FRACTION_DIGITS,k=0,j=this.points.length;k +`]},commonRender:function(x){var I,P=this.points.length,F=this.pathOffset.x,k=this.pathOffset.y;if(!P||isNaN(this.points[P-1].y))return!1;x.beginPath(),x.moveTo(this.points[0].x-F,this.points[0].y-k);for(var j=0;j"},toObject:function(x){return p(this.callSuper("toObject",x),{path:this.path.map(function(I){return I.slice()})})},toDatalessObject:function(x){var I=this.toObject(["sourcePath"].concat(x));return I.sourcePath&&delete I.path,I},_toSVG:function(){var x=l.util.joinPath(this.path);return[" +`]},_getOffsetTransform:function(){var x=l.Object.NUM_FRACTION_DIGITS;return" translate("+v(-this.pathOffset.x,x)+", "+v(-this.pathOffset.y,x)+")"},toClipPathSVG:function(x){var I=this._getOffsetTransform();return" "+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:x,additionalTransform:I})},toSVG:function(x){var I=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:x,additionalTransform:I})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var x=[],I=[],P,F=0,k=0,j=0,V=0,Y,X=0,Z=this.path.length;X"},addWithUpdate:function(p){var y=!!this.group;return this._restoreObjectsState(),l.util.resetObjectTransform(this),p&&(y&&l.util.removeTransformFromObject(p,this.group.calcTransformMatrix()),this._objects.push(p),p.group=this,p._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,y?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(p){return this._restoreObjectsState(),l.util.resetObjectTransform(this),this.remove(p),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(p){this.dirty=!0,p.group=this,p._set("canvas",this.canvas)},_onObjectRemoved:function(p){this.dirty=!0,delete p.group},_set:function(p,y){var v=this._objects.length;if(this.useSetOnGroup)for(;v--;)this._objects[v].setOnGroup(p,y);if(p==="canvas")for(;v--;)this._objects[v]._set(p,y);l.Object.prototype._set.call(this,p,y)},toObject:function(p){var y=this.includeDefaultValues,v=this._objects.filter(function(I){return!I.excludeFromExport}).map(function(I){var P=I.includeDefaultValues;I.includeDefaultValues=y;var F=I.toObject(p);return I.includeDefaultValues=P,F}),x=l.Object.prototype.toObject.call(this,p);return x.objects=v,x},toDatalessObject:function(p){var y,v=this.sourcePath;if(v)y=v;else{var x=this.includeDefaultValues;y=this._objects.map(function(P){var F=P.includeDefaultValues;P.includeDefaultValues=x;var k=P.toDatalessObject(p);return P.includeDefaultValues=F,k})}var I=l.Object.prototype.toDatalessObject.call(this,p);return I.objects=y,I},render:function(p){this._transformDone=!0,this.callSuper("render",p),this._transformDone=!1},shouldCache:function(){var p=l.Object.prototype.shouldCache.call(this);if(p){for(var y=0,v=this._objects.length;y +`],v=0,x=this._objects.length;v +`),y},getSvgStyles:function(){var p=typeof this.opacity<"u"&&this.opacity!==1?"opacity: "+this.opacity+";":"",y=this.visible?"":" visibility: hidden;";return[p,this.getSvgFilter(),y].join("")},toClipPathSVG:function(p){for(var y=[],v=0,x=this._objects.length;v"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(c,h,p){c.save(),c.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",c,h),p=p||{},typeof p.hasControls>"u"&&(p.hasControls=!1),p.forActiveSelection=!0;for(var y=0,v=this._objects.length;y +`,' `,` -`),I=' clip-path="url(#imageCrop_'+L+')" '}if(this.imageSmoothing||(O='" image-rendering="optimizeSpeed'),d.push(" -`),this.stroke||this.strokeDashArray){var N=this.fill;this.fill=null,p=[" -`],this.fill=N}return this.paintFirst!=="fill"?c=c.concat(p,d):c=c.concat(d,p),c},getSrc:function(c){var d=c?this._element:this._originalElement;return d?d.toDataURL?d.toDataURL():this.srcFromAttribute?d.getAttribute("src"):d.src:this.src||""},setSrc:function(c,d,p){return e.util.loadImage(c,function(y,v){this.setElement(y,p),this._setWidthHeight(),d&&d(this,v)},this,p&&p.crossOrigin),this},toString:function(){return'#'},applyResizeFilters:function(){var c=this.resizeFilter,d=this.minimumScaleTrigger,p=this.getTotalObjectScaling(),y=p.scaleX,v=p.scaleY,S=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!c||y>d&&v>d){this._element=S,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=y,this._lastScaleY=v;return}e.filterBackend||(e.filterBackend=e.initFilterBackend());var I=e.util.createCanvasElement(),O=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,L=S.width,N=S.height;I.width=L,I.height=N,this._element=I,this._lastScaleX=c.scaleX=y,this._lastScaleY=c.scaleY=v,e.filterBackend.applyFilters([c],S,L,N,this._element,O),this._filterScalingX=I.width/this._originalElement.width,this._filterScalingY=I.height/this._originalElement.height},applyFilters:function(c){if(c=c||this.filters||[],c=c.filter(function(S){return S&&!S.isNeutralState()}),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),c.length===0)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var d=this._originalElement,p=d.naturalWidth||d.width,y=d.naturalHeight||d.height;if(this._element===this._originalElement){var v=e.util.createCanvasElement();v.width=p,v.height=y,this._element=v,this._filteredEl=v}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,p,y),this._lastScaleX=1,this._lastScaleY=1;return e.filterBackend||(e.filterBackend=e.initFilterBackend()),e.filterBackend.applyFilters(c,this._originalElement,p,y,this._element,this.cacheKey),(this._originalElement.width!==this._element.width||this._originalElement.height!==this._element.height)&&(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(c){e.util.setImageSmoothing(c,this.imageSmoothing),this.isMoving!==!0&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(c),this._renderPaintInOrder(c)},drawCacheOnCanvas:function(c){e.util.setImageSmoothing(c,this.imageSmoothing),e.Object.prototype.drawCacheOnCanvas.call(this,c)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(c){var d=this._element;if(d){var p=this._filterScalingX,y=this._filterScalingY,v=this.width,S=this.height,I=Math.min,O=Math.max,L=O(this.cropX,0),N=O(this.cropY,0),G=d.naturalWidth||d.width,V=d.naturalHeight||d.height,Y=L*p,X=N*y,te=I(v*p,G-Y),re=I(S*y,V-X),fe=-v/2,ge=-S/2,_e=I(v,G/p-L),Ie=I(S,V/y-N);d&&c.drawImage(d,Y,X,te,re,fe,ge,_e,Ie)}},_needsResize:function(){var c=this.getTotalObjectScaling();return c.scaleX!==this._lastScaleX||c.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(c,d){this.setElement(e.util.getById(c),d),e.util.addClass(this.getElement(),e.Image.CSS_CANVAS)},_initConfig:function(c){c||(c={}),this.setOptions(c),this._setWidthHeight(c)},_initFilters:function(c,d){c&&c.length?e.util.enlivenObjects(c,function(p){d&&d(p)},"fabric.Image.filters"):d&&d()},_setWidthHeight:function(c){c||(c={});var d=this.getElement();this.width=c.width||d.naturalWidth||d.width||0,this.height=c.height||d.naturalHeight||d.height||0},parsePreserveAspectRatioAttribute:function(){var c=e.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),d=this._element.width,p=this._element.height,y=1,v=1,S=0,I=0,O=0,L=0,N,G=this.width,V=this.height,Y={width:G,height:V};return c&&(c.alignX!=="none"||c.alignY!=="none")?(c.meetOrSlice==="meet"&&(y=v=e.util.findScaleToFit(this._element,Y),N=(G-d*y)/2,c.alignX==="Min"&&(S=-N),c.alignX==="Max"&&(S=N),N=(V-p*v)/2,c.alignY==="Min"&&(I=-N),c.alignY==="Max"&&(I=N)),c.meetOrSlice==="slice"&&(y=v=e.util.findScaleToCover(this._element,Y),N=d-G/y,c.alignX==="Mid"&&(O=N/2),c.alignX==="Max"&&(O=N),N=p-V/v,c.alignY==="Mid"&&(L=N/2),c.alignY==="Max"&&(L=N),d=G/y,p=V/v)):(y=G/d,v=V/p),{width:d,height:p,scaleX:y,scaleY:v,offsetLeft:S,offsetTop:I,cropX:O,cropY:L}}}),e.Image.CSS_CANVAS="canvas-img",e.Image.prototype.getSvgSrc=e.Image.prototype.getSrc,e.Image.fromObject=function(c,d){var p=e.util.object.clone(c);e.util.loadImage(p.src,function(y,v){if(v){d&&d(null,!0);return}e.Image.prototype._initFilters.call(p,p.filters,function(S){p.filters=S||[],e.Image.prototype._initFilters.call(p,[p.resizeFilter],function(I){p.resizeFilter=I[0],e.util.enlivenObjectEnlivables(p,p,function(){var O=new e.Image(y,p);d(O,!1)})})})},null,p.crossOrigin)},e.Image.fromURL=function(c,d,p){e.util.loadImage(c,function(y,v){d&&d(new e.Image(y,p),v)},null,p&&p.crossOrigin)},e.Image.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),e.Image.fromElement=function(c,d,p){var y=e.parseAttributes(c,e.Image.ATTRIBUTE_NAMES);e.Image.fromURL(y["xlink:href"],d,l(p?e.util.object.clone(p):{},y))}}(t),e.util.object.extend(e.Object.prototype,{_getAngleValueForStraighten:function(){var a=this.angle%360;return a>0?Math.round((a-1)/90)*90:Math.round(a/90)*90},straighten:function(){return this.rotate(this._getAngleValueForStraighten())},fxStraighten:function(a){a=a||{};var l=function(){},c=a.onComplete||l,d=a.onChange||l,p=this;return e.util.animate({target:this,startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(y){p.rotate(y),d()},onComplete:function(){p.setCoords(),c()}})}}),e.util.object.extend(e.StaticCanvas.prototype,{straightenObject:function(a){return a.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(a){return a.fxStraighten({onChange:this.requestRenderAllBound})}}),function(){function a(c,d){var p="precision "+d+` float; -void main(){}`,y=c.createShader(c.FRAGMENT_SHADER);return c.shaderSource(y,p),c.compileShader(y),!!c.getShaderParameter(y,c.COMPILE_STATUS)}e.isWebglSupported=function(c){if(e.isLikelyNode)return!1;c=c||e.WebglFilterBackend.prototype.tileSize;var d=document.createElement("canvas"),p=d.getContext("webgl")||d.getContext("experimental-webgl"),y=!1;if(p){e.maxTextureSize=p.getParameter(p.MAX_TEXTURE_SIZE),y=e.maxTextureSize>=c;for(var v=["highp","mediump","lowp"],S=0;S<3;S++)if(a(p,v[S])){e.webGlPrecision=v[S];break}}return this.isSupported=y,y},e.WebglFilterBackend=l;function l(c){c&&c.tileSize&&(this.tileSize=c.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}l.prototype={tileSize:2048,resources:{},setupGLContext:function(c,d){this.dispose(),this.createWebGLCanvas(c,d),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(c,d)},chooseFastestCopyGLTo2DMethod:function(c,d){var p=typeof window.performance<"u",y;try{new ImageData(1,1),y=!0}catch{y=!1}var v=typeof ArrayBuffer<"u",S=typeof Uint8ClampedArray<"u";if(p&&y&&v&&S){var I=e.util.createCanvasElement(),O=new ArrayBuffer(c*d*4);if(e.forceGLPutImageData){this.imageBuffer=O,this.copyGLTo2D=o;return}var L={imageBuffer:O,destinationWidth:c,destinationHeight:d,targetCanvas:I},N,G,V;I.width=c,I.height=d,N=window.performance.now(),s.call(L,this.gl,L),G=window.performance.now()-N,N=window.performance.now(),o.call(L,this.gl,L),V=window.performance.now()-N,G>V?(this.imageBuffer=O,this.copyGLTo2D=o):this.copyGLTo2D=s}},createWebGLCanvas:function(c,d){var p=e.util.createCanvasElement();p.width=c,p.height=d;var y={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},v=p.getContext("webgl",y);v||(v=p.getContext("experimental-webgl",y)),v&&(v.clearColor(0,0,0,0),this.canvas=p,this.gl=v)},applyFilters:function(c,d,p,y,v,S){var I=this.gl,O;S&&(O=this.getCachedTexture(S,d));var L={originalWidth:d.width||d.originalWidth,originalHeight:d.height||d.originalHeight,sourceWidth:p,sourceHeight:y,destinationWidth:p,destinationHeight:y,context:I,sourceTexture:this.createTexture(I,p,y,!O&&d),targetTexture:this.createTexture(I,p,y),originalTexture:O||this.createTexture(I,p,y,!O&&d),passes:c.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:v},N=I.createFramebuffer();return I.bindFramebuffer(I.FRAMEBUFFER,N),c.forEach(function(G){G&&G.applyTo(L)}),n(L),this.copyGLTo2D(I,L),I.bindTexture(I.TEXTURE_2D,null),I.deleteTexture(L.sourceTexture),I.deleteTexture(L.targetTexture),I.deleteFramebuffer(N),v.getContext("2d").setTransform(1,0,0,1,0,0),L},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(c,d,p,y,v){var S=c.createTexture();return c.bindTexture(c.TEXTURE_2D,S),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,v||c.NEAREST),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,v||c.NEAREST),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),y?c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,y):c.texImage2D(c.TEXTURE_2D,0,c.RGBA,d,p,0,c.RGBA,c.UNSIGNED_BYTE,null),S},getCachedTexture:function(c,d){if(this.textureCache[c])return this.textureCache[c];var p=this.createTexture(this.gl,d.width,d.height,d);return this.textureCache[c]=p,p},evictCachesForKey:function(c){this.textureCache[c]&&(this.gl.deleteTexture(this.textureCache[c]),delete this.textureCache[c])},copyGLTo2D:s,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var c=this.gl,d={renderer:"",vendor:""};if(!c)return d;var p=c.getExtension("WEBGL_debug_renderer_info");if(p){var y=c.getParameter(p.UNMASKED_RENDERER_WEBGL),v=c.getParameter(p.UNMASKED_VENDOR_WEBGL);y&&(d.renderer=y.toLowerCase()),v&&(d.vendor=v.toLowerCase())}return this.gpuInfo=d,d}}}();function n(a){var l=a.targetCanvas,c=l.width,d=l.height,p=a.destinationWidth,y=a.destinationHeight;(c!==p||d!==y)&&(l.width=p,l.height=y)}function s(a,l){var c=a.canvas,d=l.targetCanvas,p=d.getContext("2d");p.translate(0,d.height),p.scale(1,-1);var y=c.height-d.height;p.drawImage(c,0,y,d.width,d.height,0,0,d.width,d.height)}function o(a,l){var c=l.targetCanvas,d=c.getContext("2d"),p=l.destinationWidth,y=l.destinationHeight,v=p*y*4,S=new Uint8Array(this.imageBuffer,0,v),I=new Uint8ClampedArray(this.imageBuffer,0,v);a.readPixels(0,0,p,y,a.RGBA,a.UNSIGNED_BYTE,S);var O=new ImageData(I,p,y);d.putImageData(O,0,0)}(function(){var a=function(){};e.Canvas2dFilterBackend=l;function l(){}l.prototype={evictCachesForKey:a,dispose:a,clearWebGLCaches:a,resources:{},applyFilters:function(c,d,p,y,v){var S=v.getContext("2d");S.drawImage(d,0,0,p,y);var I=S.getImageData(0,0,p,y),O=S.getImageData(0,0,p,y),L={sourceWidth:p,sourceHeight:y,imageData:I,originalEl:d,originalImageData:O,canvasEl:v,ctx:S,filterBackend:this};return c.forEach(function(N){N.applyTo(L)}),(L.imageData.width!==p||L.imageData.height!==y)&&(v.width=L.imageData.width,v.height=L.imageData.height),S.putImageData(L.imageData,0,0),L}}})(),e.Image=e.Image||{},e.Image.filters=e.Image.filters||{},e.Image.filters.BaseFilter=e.util.createClass({type:"BaseFilter",vertexSource:`attribute vec2 aPosition; +`),I=' clip-path="url(#imageCrop_'+F+')" '}if(this.imageSmoothing||(P='" image-rendering="optimizeSpeed'),h.push(" +`),this.stroke||this.strokeDashArray){var k=this.fill;this.fill=null,p=[" +`],this.fill=k}return this.paintFirst!=="fill"?c=c.concat(p,h):c=c.concat(h,p),c},getSrc:function(c){var h=c?this._element:this._originalElement;return h?h.toDataURL?h.toDataURL():this.srcFromAttribute?h.getAttribute("src"):h.src:this.src||""},setSrc:function(c,h,p){return e.util.loadImage(c,function(y,v){this.setElement(y,p),this._setWidthHeight(),h&&h(this,v)},this,p&&p.crossOrigin),this},toString:function(){return'#'},applyResizeFilters:function(){var c=this.resizeFilter,h=this.minimumScaleTrigger,p=this.getTotalObjectScaling(),y=p.scaleX,v=p.scaleY,x=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!c||y>h&&v>h){this._element=x,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=y,this._lastScaleY=v;return}e.filterBackend||(e.filterBackend=e.initFilterBackend());var I=e.util.createCanvasElement(),P=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,F=x.width,k=x.height;I.width=F,I.height=k,this._element=I,this._lastScaleX=c.scaleX=y,this._lastScaleY=c.scaleY=v,e.filterBackend.applyFilters([c],x,F,k,this._element,P),this._filterScalingX=I.width/this._originalElement.width,this._filterScalingY=I.height/this._originalElement.height},applyFilters:function(c){if(c=c||this.filters||[],c=c.filter(function(x){return x&&!x.isNeutralState()}),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),c.length===0)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var h=this._originalElement,p=h.naturalWidth||h.width,y=h.naturalHeight||h.height;if(this._element===this._originalElement){var v=e.util.createCanvasElement();v.width=p,v.height=y,this._element=v,this._filteredEl=v}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,p,y),this._lastScaleX=1,this._lastScaleY=1;return e.filterBackend||(e.filterBackend=e.initFilterBackend()),e.filterBackend.applyFilters(c,this._originalElement,p,y,this._element,this.cacheKey),(this._originalElement.width!==this._element.width||this._originalElement.height!==this._element.height)&&(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(c){e.util.setImageSmoothing(c,this.imageSmoothing),this.isMoving!==!0&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(c),this._renderPaintInOrder(c)},drawCacheOnCanvas:function(c){e.util.setImageSmoothing(c,this.imageSmoothing),e.Object.prototype.drawCacheOnCanvas.call(this,c)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(c){var h=this._element;if(h){var p=this._filterScalingX,y=this._filterScalingY,v=this.width,x=this.height,I=Math.min,P=Math.max,F=P(this.cropX,0),k=P(this.cropY,0),j=h.naturalWidth||h.width,V=h.naturalHeight||h.height,Y=F*p,X=k*y,Z=I(v*p,j-Y),ie=I(x*y,V-X),ce=-v/2,he=-x/2,_e=I(v,j/p-F),xe=I(x,V/y-k);h&&c.drawImage(h,Y,X,Z,ie,ce,he,_e,xe)}},_needsResize:function(){var c=this.getTotalObjectScaling();return c.scaleX!==this._lastScaleX||c.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(c,h){this.setElement(e.util.getById(c),h),e.util.addClass(this.getElement(),e.Image.CSS_CANVAS)},_initConfig:function(c){c||(c={}),this.setOptions(c),this._setWidthHeight(c)},_initFilters:function(c,h){c&&c.length?e.util.enlivenObjects(c,function(p){h&&h(p)},"fabric.Image.filters"):h&&h()},_setWidthHeight:function(c){c||(c={});var h=this.getElement();this.width=c.width||h.naturalWidth||h.width||0,this.height=c.height||h.naturalHeight||h.height||0},parsePreserveAspectRatioAttribute:function(){var c=e.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),h=this._element.width,p=this._element.height,y=1,v=1,x=0,I=0,P=0,F=0,k,j=this.width,V=this.height,Y={width:j,height:V};return c&&(c.alignX!=="none"||c.alignY!=="none")?(c.meetOrSlice==="meet"&&(y=v=e.util.findScaleToFit(this._element,Y),k=(j-h*y)/2,c.alignX==="Min"&&(x=-k),c.alignX==="Max"&&(x=k),k=(V-p*v)/2,c.alignY==="Min"&&(I=-k),c.alignY==="Max"&&(I=k)),c.meetOrSlice==="slice"&&(y=v=e.util.findScaleToCover(this._element,Y),k=h-j/y,c.alignX==="Mid"&&(P=k/2),c.alignX==="Max"&&(P=k),k=p-V/v,c.alignY==="Mid"&&(F=k/2),c.alignY==="Max"&&(F=k),h=j/y,p=V/v)):(y=j/h,v=V/p),{width:h,height:p,scaleX:y,scaleY:v,offsetLeft:x,offsetTop:I,cropX:P,cropY:F}}}),e.Image.CSS_CANVAS="canvas-img",e.Image.prototype.getSvgSrc=e.Image.prototype.getSrc,e.Image.fromObject=function(c,h){var p=e.util.object.clone(c);e.util.loadImage(p.src,function(y,v){if(v){h&&h(null,!0);return}e.Image.prototype._initFilters.call(p,p.filters,function(x){p.filters=x||[],e.Image.prototype._initFilters.call(p,[p.resizeFilter],function(I){p.resizeFilter=I[0],e.util.enlivenObjectEnlivables(p,p,function(){var P=new e.Image(y,p);h(P,!1)})})})},null,p.crossOrigin)},e.Image.fromURL=function(c,h,p){e.util.loadImage(c,function(y,v){h&&h(new e.Image(y,p),v)},null,p&&p.crossOrigin)},e.Image.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),e.Image.fromElement=function(c,h,p){var y=e.parseAttributes(c,e.Image.ATTRIBUTE_NAMES);e.Image.fromURL(y["xlink:href"],h,l(p?e.util.object.clone(p):{},y))}}(t),e.util.object.extend(e.Object.prototype,{_getAngleValueForStraighten:function(){var a=this.angle%360;return a>0?Math.round((a-1)/90)*90:Math.round(a/90)*90},straighten:function(){return this.rotate(this._getAngleValueForStraighten())},fxStraighten:function(a){a=a||{};var l=function(){},c=a.onComplete||l,h=a.onChange||l,p=this;return e.util.animate({target:this,startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(y){p.rotate(y),h()},onComplete:function(){p.setCoords(),c()}})}}),e.util.object.extend(e.StaticCanvas.prototype,{straightenObject:function(a){return a.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(a){return a.fxStraighten({onChange:this.requestRenderAllBound})}}),function(){function a(c,h){var p="precision "+h+` float; +void main(){}`,y=c.createShader(c.FRAGMENT_SHADER);return c.shaderSource(y,p),c.compileShader(y),!!c.getShaderParameter(y,c.COMPILE_STATUS)}e.isWebglSupported=function(c){if(e.isLikelyNode)return!1;c=c||e.WebglFilterBackend.prototype.tileSize;var h=document.createElement("canvas"),p=h.getContext("webgl")||h.getContext("experimental-webgl"),y=!1;if(p){e.maxTextureSize=p.getParameter(p.MAX_TEXTURE_SIZE),y=e.maxTextureSize>=c;for(var v=["highp","mediump","lowp"],x=0;x<3;x++)if(a(p,v[x])){e.webGlPrecision=v[x];break}}return this.isSupported=y,y},e.WebglFilterBackend=l;function l(c){c&&c.tileSize&&(this.tileSize=c.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}l.prototype={tileSize:2048,resources:{},setupGLContext:function(c,h){this.dispose(),this.createWebGLCanvas(c,h),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(c,h)},chooseFastestCopyGLTo2DMethod:function(c,h){var p=typeof window.performance<"u",y;try{new ImageData(1,1),y=!0}catch{y=!1}var v=typeof ArrayBuffer<"u",x=typeof Uint8ClampedArray<"u";if(p&&y&&v&&x){var I=e.util.createCanvasElement(),P=new ArrayBuffer(c*h*4);if(e.forceGLPutImageData){this.imageBuffer=P,this.copyGLTo2D=o;return}var F={imageBuffer:P,destinationWidth:c,destinationHeight:h,targetCanvas:I},k,j,V;I.width=c,I.height=h,k=window.performance.now(),s.call(F,this.gl,F),j=window.performance.now()-k,k=window.performance.now(),o.call(F,this.gl,F),V=window.performance.now()-k,j>V?(this.imageBuffer=P,this.copyGLTo2D=o):this.copyGLTo2D=s}},createWebGLCanvas:function(c,h){var p=e.util.createCanvasElement();p.width=c,p.height=h;var y={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},v=p.getContext("webgl",y);v||(v=p.getContext("experimental-webgl",y)),v&&(v.clearColor(0,0,0,0),this.canvas=p,this.gl=v)},applyFilters:function(c,h,p,y,v,x){var I=this.gl,P;x&&(P=this.getCachedTexture(x,h));var F={originalWidth:h.width||h.originalWidth,originalHeight:h.height||h.originalHeight,sourceWidth:p,sourceHeight:y,destinationWidth:p,destinationHeight:y,context:I,sourceTexture:this.createTexture(I,p,y,!P&&h),targetTexture:this.createTexture(I,p,y),originalTexture:P||this.createTexture(I,p,y,!P&&h),passes:c.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:v},k=I.createFramebuffer();return I.bindFramebuffer(I.FRAMEBUFFER,k),c.forEach(function(j){j&&j.applyTo(F)}),n(F),this.copyGLTo2D(I,F),I.bindTexture(I.TEXTURE_2D,null),I.deleteTexture(F.sourceTexture),I.deleteTexture(F.targetTexture),I.deleteFramebuffer(k),v.getContext("2d").setTransform(1,0,0,1,0,0),F},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(c,h,p,y,v){var x=c.createTexture();return c.bindTexture(c.TEXTURE_2D,x),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,v||c.NEAREST),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,v||c.NEAREST),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE),y?c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,y):c.texImage2D(c.TEXTURE_2D,0,c.RGBA,h,p,0,c.RGBA,c.UNSIGNED_BYTE,null),x},getCachedTexture:function(c,h){if(this.textureCache[c])return this.textureCache[c];var p=this.createTexture(this.gl,h.width,h.height,h);return this.textureCache[c]=p,p},evictCachesForKey:function(c){this.textureCache[c]&&(this.gl.deleteTexture(this.textureCache[c]),delete this.textureCache[c])},copyGLTo2D:s,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var c=this.gl,h={renderer:"",vendor:""};if(!c)return h;var p=c.getExtension("WEBGL_debug_renderer_info");if(p){var y=c.getParameter(p.UNMASKED_RENDERER_WEBGL),v=c.getParameter(p.UNMASKED_VENDOR_WEBGL);y&&(h.renderer=y.toLowerCase()),v&&(h.vendor=v.toLowerCase())}return this.gpuInfo=h,h}}}();function n(a){var l=a.targetCanvas,c=l.width,h=l.height,p=a.destinationWidth,y=a.destinationHeight;(c!==p||h!==y)&&(l.width=p,l.height=y)}function s(a,l){var c=a.canvas,h=l.targetCanvas,p=h.getContext("2d");p.translate(0,h.height),p.scale(1,-1);var y=c.height-h.height;p.drawImage(c,0,y,h.width,h.height,0,0,h.width,h.height)}function o(a,l){var c=l.targetCanvas,h=c.getContext("2d"),p=l.destinationWidth,y=l.destinationHeight,v=p*y*4,x=new Uint8Array(this.imageBuffer,0,v),I=new Uint8ClampedArray(this.imageBuffer,0,v);a.readPixels(0,0,p,y,a.RGBA,a.UNSIGNED_BYTE,x);var P=new ImageData(I,p,y);h.putImageData(P,0,0)}(function(){var a=function(){};e.Canvas2dFilterBackend=l;function l(){}l.prototype={evictCachesForKey:a,dispose:a,clearWebGLCaches:a,resources:{},applyFilters:function(c,h,p,y,v){var x=v.getContext("2d");x.drawImage(h,0,0,p,y);var I=x.getImageData(0,0,p,y),P=x.getImageData(0,0,p,y),F={sourceWidth:p,sourceHeight:y,imageData:I,originalEl:h,originalImageData:P,canvasEl:v,ctx:x,filterBackend:this};return c.forEach(function(k){k.applyTo(F)}),(F.imageData.width!==p||F.imageData.height!==y)&&(v.width=F.imageData.width,v.height=F.imageData.height),x.putImageData(F.imageData,0,0),F}}})(),e.Image=e.Image||{},e.Image.filters=e.Image.filters||{},e.Image.filters.BaseFilter=e.util.createClass({type:"BaseFilter",vertexSource:`attribute vec2 aPosition; varying vec2 vTexCoord; void main() { vTexCoord = aPosition; @@ -5111,7 +5111,7 @@ varying vec2 vTexCoord; uniform sampler2D uTexture; void main() { gl_FragColor = texture2D(uTexture, vTexCoord); -}`,initialize:function(a){a&&this.setOptions(a)},setOptions:function(a){for(var l in a)this[l]=a[l]},createProgram:function(a,l,c){l=l||this.fragmentSource,c=c||this.vertexSource,e.webGlPrecision!=="highp"&&(l=l.replace(/precision highp float/g,"precision "+e.webGlPrecision+" float"));var d=a.createShader(a.VERTEX_SHADER);if(a.shaderSource(d,c),a.compileShader(d),!a.getShaderParameter(d,a.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+a.getShaderInfoLog(d));var p=a.createShader(a.FRAGMENT_SHADER);if(a.shaderSource(p,l),a.compileShader(p),!a.getShaderParameter(p,a.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+a.getShaderInfoLog(p));var y=a.createProgram();if(a.attachShader(y,d),a.attachShader(y,p),a.linkProgram(y),!a.getProgramParameter(y,a.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+a.getProgramInfoLog(y));var v=this.getAttributeLocations(a,y),S=this.getUniformLocations(a,y)||{};return S.uStepW=a.getUniformLocation(y,"uStepW"),S.uStepH=a.getUniformLocation(y,"uStepH"),{program:y,attributeLocations:v,uniformLocations:S}},getAttributeLocations:function(a,l){return{aPosition:a.getAttribLocation(l,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(a,l,c){var d=l.aPosition,p=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,p),a.enableVertexAttribArray(d),a.vertexAttribPointer(d,2,a.FLOAT,!1,0,0),a.bufferData(a.ARRAY_BUFFER,c,a.STATIC_DRAW)},_setupFrameBuffer:function(a){var l=a.context,c,d;a.passes>1?(c=a.destinationWidth,d=a.destinationHeight,(a.sourceWidth!==c||a.sourceHeight!==d)&&(l.deleteTexture(a.targetTexture),a.targetTexture=a.filterBackend.createTexture(l,c,d)),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,a.targetTexture,0)):(l.bindFramebuffer(l.FRAMEBUFFER,null),l.finish())},_swapTextures:function(a){a.passes--,a.pass++;var l=a.targetTexture;a.targetTexture=a.sourceTexture,a.sourceTexture=l},isNeutralState:function(){var a=this.mainParameter,l=e.Image.filters[this.type].prototype;if(a)if(Array.isArray(l[a])){for(var c=l[a].length;c--;)if(this[a][c]!==l[a][c])return!1;return!0}else return l[a]===this[a];else return!1},applyTo:function(a){a.webgl?(this._setupFrameBuffer(a),this.applyToWebGL(a),this._swapTextures(a)):this.applyTo2d(a)},retrieveShader:function(a){return a.programCache.hasOwnProperty(this.type)||(a.programCache[this.type]=this.createProgram(a.context)),a.programCache[this.type]},applyToWebGL:function(a){var l=a.context,c=this.retrieveShader(a);a.pass===0&&a.originalTexture?l.bindTexture(l.TEXTURE_2D,a.originalTexture):l.bindTexture(l.TEXTURE_2D,a.sourceTexture),l.useProgram(c.program),this.sendAttributeData(l,c.attributeLocations,a.aPosition),l.uniform1f(c.uniformLocations.uStepW,1/a.sourceWidth),l.uniform1f(c.uniformLocations.uStepH,1/a.sourceHeight),this.sendUniformData(l,c.uniformLocations),l.viewport(0,0,a.destinationWidth,a.destinationHeight),l.drawArrays(l.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(a,l,c){a.activeTexture(c),a.bindTexture(a.TEXTURE_2D,l),a.activeTexture(a.TEXTURE0)},unbindAdditionalTexture:function(a,l){a.activeTexture(l),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(a){this[this.mainParameter]=a},sendUniformData:function(){},createHelpLayer:function(a){if(!a.helpLayer){var l=document.createElement("canvas");l.width=a.sourceWidth,l.height=a.sourceHeight,a.helpLayer=l}},toObject:function(){var a={type:this.type},l=this.mainParameter;return l&&(a[l]=this[l]),a},toJSON:function(){return this.toObject()}}),e.Image.filters.BaseFilter.fromObject=function(a,l){var c=new e.Image.filters[a.type](a);return l&&l(c),c},function(a){var l=a.fabric||(a.fabric={}),c=l.Image.filters,d=l.util.createClass;c.ColorMatrix=d(c.BaseFilter,{type:"ColorMatrix",fragmentSource:`precision highp float; +}`,initialize:function(a){a&&this.setOptions(a)},setOptions:function(a){for(var l in a)this[l]=a[l]},createProgram:function(a,l,c){l=l||this.fragmentSource,c=c||this.vertexSource,e.webGlPrecision!=="highp"&&(l=l.replace(/precision highp float/g,"precision "+e.webGlPrecision+" float"));var h=a.createShader(a.VERTEX_SHADER);if(a.shaderSource(h,c),a.compileShader(h),!a.getShaderParameter(h,a.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+a.getShaderInfoLog(h));var p=a.createShader(a.FRAGMENT_SHADER);if(a.shaderSource(p,l),a.compileShader(p),!a.getShaderParameter(p,a.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+a.getShaderInfoLog(p));var y=a.createProgram();if(a.attachShader(y,h),a.attachShader(y,p),a.linkProgram(y),!a.getProgramParameter(y,a.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+a.getProgramInfoLog(y));var v=this.getAttributeLocations(a,y),x=this.getUniformLocations(a,y)||{};return x.uStepW=a.getUniformLocation(y,"uStepW"),x.uStepH=a.getUniformLocation(y,"uStepH"),{program:y,attributeLocations:v,uniformLocations:x}},getAttributeLocations:function(a,l){return{aPosition:a.getAttribLocation(l,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(a,l,c){var h=l.aPosition,p=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,p),a.enableVertexAttribArray(h),a.vertexAttribPointer(h,2,a.FLOAT,!1,0,0),a.bufferData(a.ARRAY_BUFFER,c,a.STATIC_DRAW)},_setupFrameBuffer:function(a){var l=a.context,c,h;a.passes>1?(c=a.destinationWidth,h=a.destinationHeight,(a.sourceWidth!==c||a.sourceHeight!==h)&&(l.deleteTexture(a.targetTexture),a.targetTexture=a.filterBackend.createTexture(l,c,h)),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,a.targetTexture,0)):(l.bindFramebuffer(l.FRAMEBUFFER,null),l.finish())},_swapTextures:function(a){a.passes--,a.pass++;var l=a.targetTexture;a.targetTexture=a.sourceTexture,a.sourceTexture=l},isNeutralState:function(){var a=this.mainParameter,l=e.Image.filters[this.type].prototype;if(a)if(Array.isArray(l[a])){for(var c=l[a].length;c--;)if(this[a][c]!==l[a][c])return!1;return!0}else return l[a]===this[a];else return!1},applyTo:function(a){a.webgl?(this._setupFrameBuffer(a),this.applyToWebGL(a),this._swapTextures(a)):this.applyTo2d(a)},retrieveShader:function(a){return a.programCache.hasOwnProperty(this.type)||(a.programCache[this.type]=this.createProgram(a.context)),a.programCache[this.type]},applyToWebGL:function(a){var l=a.context,c=this.retrieveShader(a);a.pass===0&&a.originalTexture?l.bindTexture(l.TEXTURE_2D,a.originalTexture):l.bindTexture(l.TEXTURE_2D,a.sourceTexture),l.useProgram(c.program),this.sendAttributeData(l,c.attributeLocations,a.aPosition),l.uniform1f(c.uniformLocations.uStepW,1/a.sourceWidth),l.uniform1f(c.uniformLocations.uStepH,1/a.sourceHeight),this.sendUniformData(l,c.uniformLocations),l.viewport(0,0,a.destinationWidth,a.destinationHeight),l.drawArrays(l.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(a,l,c){a.activeTexture(c),a.bindTexture(a.TEXTURE_2D,l),a.activeTexture(a.TEXTURE0)},unbindAdditionalTexture:function(a,l){a.activeTexture(l),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(a){this[this.mainParameter]=a},sendUniformData:function(){},createHelpLayer:function(a){if(!a.helpLayer){var l=document.createElement("canvas");l.width=a.sourceWidth,l.height=a.sourceHeight,a.helpLayer=l}},toObject:function(){var a={type:this.type},l=this.mainParameter;return l&&(a[l]=this[l]),a},toJSON:function(){return this.toObject()}}),e.Image.filters.BaseFilter.fromObject=function(a,l){var c=new e.Image.filters[a.type](a);return l&&l(c),c},function(a){var l=a.fabric||(a.fabric={}),c=l.Image.filters,h=l.util.createClass;c.ColorMatrix=h(c.BaseFilter,{type:"ColorMatrix",fragmentSource:`precision highp float; uniform sampler2D uTexture; varying vec2 vTexCoord; uniform mat4 uColorMatrix; @@ -5121,7 +5121,7 @@ vec4 color = texture2D(uTexture, vTexCoord); color *= uColorMatrix; color += uConstants; gl_FragColor = color; -}`,matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(p){this.callSuper("initialize",p),this.matrix=this.matrix.slice(0)},applyTo2d:function(p){var y=p.imageData,v=y.data,S=v.length,I=this.matrix,O,L,N,G,V,Y=this.colorsOnly;for(V=0;V=G||Ie<0||Ie>=N)&&(Ne=(ke*N+Ie)*4,J=I[Oe*O+Pe],te+=S[Ne]*J,re+=S[Ne+1]*J,fe+=S[Ne+2]*J,X||(ge+=S[Ne+3]*J));Y[_e]=te,Y[_e+1]=re,Y[_e+2]=fe,X?Y[_e+3]=S[_e+3]:Y[_e+3]=ge}y.imageData=V},getUniformLocations:function(y,v){return{uMatrix:y.getUniformLocation(v,"uMatrix"),uOpaque:y.getUniformLocation(v,"uOpaque"),uHalfSize:y.getUniformLocation(v,"uHalfSize"),uSize:y.getUniformLocation(v,"uSize")}},sendUniformData:function(y,v){y.uniform1fv(v.uMatrix,this.matrix)},toObject:function(){return c(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),l.Image.filters.Convolute.fromObject=l.Image.filters.BaseFilter.fromObject}(t),function(a){var l=a.fabric||(a.fabric={}),c=l.Image.filters,d=l.util.createClass;c.Grayscale=d(c.BaseFilter,{type:"Grayscale",fragmentSource:{average:`precision highp float; +}`},retrieveShader:function(y){var v=Math.sqrt(this.matrix.length),x=this.type+"_"+v+"_"+(this.opaque?1:0),I=this.fragmentSource[x];return y.programCache.hasOwnProperty(x)||(y.programCache[x]=this.createProgram(y.context,I)),y.programCache[x]},applyTo2d:function(y){var v=y.imageData,x=v.data,I=this.matrix,P=Math.round(Math.sqrt(I.length)),F=Math.floor(P/2),k=v.width,j=v.height,V=y.ctx.createImageData(k,j),Y=V.data,X=this.opaque?1:0,Z,ie,ce,he,_e,xe,Pe,ke,J,de,Se,Ie,Re;for(Se=0;Se=j||xe<0||xe>=k)&&(ke=(Pe*k+xe)*4,J=I[Re*P+Ie],Z+=x[ke]*J,ie+=x[ke+1]*J,ce+=x[ke+2]*J,X||(he+=x[ke+3]*J));Y[_e]=Z,Y[_e+1]=ie,Y[_e+2]=ce,X?Y[_e+3]=x[_e+3]:Y[_e+3]=he}y.imageData=V},getUniformLocations:function(y,v){return{uMatrix:y.getUniformLocation(v,"uMatrix"),uOpaque:y.getUniformLocation(v,"uOpaque"),uHalfSize:y.getUniformLocation(v,"uHalfSize"),uSize:y.getUniformLocation(v,"uSize")}},sendUniformData:function(y,v){y.uniform1fv(v.uMatrix,this.matrix)},toObject:function(){return c(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),l.Image.filters.Convolute.fromObject=l.Image.filters.BaseFilter.fromObject}(t),function(a){var l=a.fabric||(a.fabric={}),c=l.Image.filters,h=l.util.createClass;c.Grayscale=h(c.BaseFilter,{type:"Grayscale",fragmentSource:{average:`precision highp float; uniform sampler2D uTexture; varying vec2 vTexCoord; void main() { @@ -5280,7 +5280,7 @@ void main() { vec4 col = texture2D(uTexture, vTexCoord); float average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b; gl_FragColor = vec4(average, average, average, col.a); -}`},mode:"average",mainParameter:"mode",applyTo2d:function(p){var y=p.imageData,v=y.data,S,I=v.length,O,L=this.mode;for(S=0;SY[0]&&N>Y[1]&&G>Y[2]&&LY[0]&&k>Y[1]&&j>Y[2]&&F 0.0) { `+this.fragmentSource[p]+`} -}`},retrieveShader:function(p){var y=this.type+"_"+this.mode,v;return p.programCache.hasOwnProperty(y)||(v=this.buildSource(this.mode),p.programCache[y]=this.createProgram(p.context,v)),p.programCache[y]},applyTo2d:function(p){var y=p.imageData,v=y.data,S=v.length,I,O,L,N,G,V,Y,X=1-this.alpha;Y=new l.Color(this.color).getSource(),I=Y[0]*this.alpha,O=Y[1]*this.alpha,L=Y[2]*this.alpha;for(var te=0;te=N||G<=-N)return 0;if(G<11920929e-14&&G>-11920929e-14)return 1;G*=Math.PI;var V=G/N;return S(G)/G*S(V)/V}},applyTo2d:function(N){var G=N.imageData,V=this.scaleX,Y=this.scaleY;this.rcpScaleX=1/V,this.rcpScaleY=1/Y;var X=G.width,te=G.height,re=v(X*V),fe=v(te*Y),ge;this.resizeType==="sliceHack"?ge=this.sliceByTwo(N,X,te,re,fe):this.resizeType==="hermite"?ge=this.hermiteFastResize(N,X,te,re,fe):this.resizeType==="bilinear"?ge=this.bilinearFiltering(N,X,te,re,fe):this.resizeType==="lanczos"&&(ge=this.lanczosResize(N,X,te,re,fe)),N.imageData=ge},sliceByTwo:function(N,G,V,Y,X){var te=N.imageData,re=.5,fe=!1,ge=!1,_e=G*re,Ie=V*re,ke=l.filterBackend.resources,Ne,J,he=0,xe=0,Pe=G,Oe=0;for(ke.sliceByTwo||(ke.sliceByTwo=document.createElement("canvas")),Ne=ke.sliceByTwo,(Ne.width=G)){Lt=d(1e3*y(Je-Oe.x)),Pe[Lt]||(Pe[Lt]={});for(var Ee=Ae.y-xe;Ee<=Ae.y+xe;Ee++)Ee<0||Ee>=V||(at=d(1e3*y(Ee-Oe.y)),Pe[Lt][at]||(Pe[Lt][at]=_e(p(c(Lt*Ne,2)+c(at*J,2))/1e3)),et=Pe[Lt][at],et>0&&(tt=(Ee*G+Je)*4,ft+=et,Pt+=et*re[tt],$t+=et*re[tt+1],St+=et*re[tt+2],Tt+=et*re[tt+3]))}tt=(Ge*Y+ze)*4,ge[tt]=Pt/ft,ge[tt+1]=$t/ft,ge[tt+2]=St/ft,ge[tt+3]=Tt/ft}return++ze1&&at<-1||(Pe=2*at*at*at-3*at*at+1,Pe>0&&(Lt=4*(Tt+ft*G),et+=Pe*Ie[Lt+3],Ae+=Pe,Ie[Lt+3]<255&&(Pe=Pe*Ie[Lt+3]/250),ze+=Pe*Ie[Lt],Ge+=Pe*Ie[Lt+1],Je+=Pe*Ie[Lt+2],Oe+=Pe))}Ne[xe]=ze/Oe,Ne[xe+1]=Ge/Oe,Ne[xe+2]=Je/Oe,Ne[xe+3]=et/Ae}return ke},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),l.Image.filters.Resize.fromObject=l.Image.filters.BaseFilter.fromObject}(t),function(a){var l=a.fabric||(a.fabric={}),c=l.Image.filters,d=l.util.createClass;c.Contrast=d(c.BaseFilter,{type:"Contrast",fragmentSource:`precision highp float; +`,applyTo:function(k){k.webgl?(k.passes++,this.width=k.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=k.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),k.destinationWidth=this.dW,this._setupFrameBuffer(k),this.applyToWebGL(k),this._swapTextures(k),k.sourceWidth=k.destinationWidth,this.height=k.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),k.destinationHeight=this.dH,this._setupFrameBuffer(k),this.applyToWebGL(k),this._swapTextures(k),k.sourceHeight=k.destinationHeight):this.applyTo2d(k)},isNeutralState:function(){return this.scaleX===1&&this.scaleY===1},lanczosCreate:function(k){return function(j){if(j>=k||j<=-k)return 0;if(j<11920929e-14&&j>-11920929e-14)return 1;j*=Math.PI;var V=j/k;return x(j)/j*x(V)/V}},applyTo2d:function(k){var j=k.imageData,V=this.scaleX,Y=this.scaleY;this.rcpScaleX=1/V,this.rcpScaleY=1/Y;var X=j.width,Z=j.height,ie=v(X*V),ce=v(Z*Y),he;this.resizeType==="sliceHack"?he=this.sliceByTwo(k,X,Z,ie,ce):this.resizeType==="hermite"?he=this.hermiteFastResize(k,X,Z,ie,ce):this.resizeType==="bilinear"?he=this.bilinearFiltering(k,X,Z,ie,ce):this.resizeType==="lanczos"&&(he=this.lanczosResize(k,X,Z,ie,ce)),k.imageData=he},sliceByTwo:function(k,j,V,Y,X){var Z=k.imageData,ie=.5,ce=!1,he=!1,_e=j*ie,xe=V*ie,Pe=l.filterBackend.resources,ke,J,de=0,Se=0,Ie=j,Re=0;for(Pe.sliceByTwo||(Pe.sliceByTwo=document.createElement("canvas")),ke=Pe.sliceByTwo,(ke.width=j)){Ft=h(1e3*y(qe-Re.x)),Ie[Ft]||(Ie[Ft]={});for(var Te=Oe.y-Se;Te<=Oe.y+Se;Te++)Te<0||Te>=V||(ot=h(1e3*y(Te-Re.y)),Ie[Ft][ot]||(Ie[Ft][ot]=_e(p(c(Ft*ke,2)+c(ot*J,2))/1e3)),et=Ie[Ft][ot],et>0&&(Ze=(Te*j+qe)*4,mt+=et,Pt+=et*ie[Ze],$t+=et*ie[Ze+1],Ct+=et*ie[Ze+2],Et+=et*ie[Ze+3]))}Ze=(Be*Y+Ge)*4,he[Ze]=Pt/mt,he[Ze+1]=$t/mt,he[Ze+2]=Ct/mt,he[Ze+3]=Et/mt}return++Ge1&&ot<-1||(Ie=2*ot*ot*ot-3*ot*ot+1,Ie>0&&(Ft=4*(Et+mt*j),et+=Ie*xe[Ft+3],Oe+=Ie,xe[Ft+3]<255&&(Ie=Ie*xe[Ft+3]/250),Ge+=Ie*xe[Ft],Be+=Ie*xe[Ft+1],qe+=Ie*xe[Ft+2],Re+=Ie))}ke[Se]=Ge/Re,ke[Se+1]=Be/Re,ke[Se+2]=qe/Re,ke[Se+3]=et/Oe}return Pe},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),l.Image.filters.Resize.fromObject=l.Image.filters.BaseFilter.fromObject}(t),function(a){var l=a.fabric||(a.fabric={}),c=l.Image.filters,h=l.util.createClass;c.Contrast=h(c.BaseFilter,{type:"Contrast",fragmentSource:`precision highp float; uniform sampler2D uTexture; uniform float uContrast; varying vec2 vTexCoord; @@ -5415,7 +5415,7 @@ vec4 color = texture2D(uTexture, vTexCoord); float contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast)); color.rgb = contrastF * (color.rgb - 0.5) + 0.5; gl_FragColor = color; -}`,contrast:0,mainParameter:"contrast",applyTo2d:function(p){if(this.contrast!==0){var y=p.imageData,v,I,S=y.data,I=S.length,O=Math.floor(this.contrast*255),L=259*(O+255)/(255*(259-O));for(v=0;v1&&(p=1/this.aspectRatio):this.aspectRatio<1&&(p=this.aspectRatio),v=p*this.blur*.12,this.horizontal?y[0]=v:y[1]=v,y}}),c.Blur.fromObject=l.Image.filters.BaseFilter.fromObject}(t),function(a){var l=a.fabric||(a.fabric={}),c=l.Image.filters,d=l.util.createClass;c.Gamma=d(c.BaseFilter,{type:"Gamma",fragmentSource:`precision highp float; +}`,blur:0,mainParameter:"blur",applyTo:function(p){p.webgl?(this.aspectRatio=p.sourceWidth/p.sourceHeight,p.passes++,this._setupFrameBuffer(p),this.horizontal=!0,this.applyToWebGL(p),this._swapTextures(p),this._setupFrameBuffer(p),this.horizontal=!1,this.applyToWebGL(p),this._swapTextures(p)):this.applyTo2d(p)},applyTo2d:function(p){p.imageData=this.simpleBlur(p)},simpleBlur:function(p){var y=p.filterBackend.resources,v,x,I=p.imageData.width,P=p.imageData.height;y.blurLayer1||(y.blurLayer1=l.util.createCanvasElement(),y.blurLayer2=l.util.createCanvasElement()),v=y.blurLayer1,x=y.blurLayer2,(v.width!==I||v.height!==P)&&(x.width=v.width=I,x.height=v.height=P);var F=v.getContext("2d"),k=x.getContext("2d"),j=15,V,Y,X,Z,ie=this.blur*.06*.5;for(F.putImageData(p.imageData,0,0),k.clearRect(0,0,I,P),Z=-j;Z<=j;Z++)V=(Math.random()-.5)/4,Y=Z/j,X=ie*Y*I+V,k.globalAlpha=1-Math.abs(Y),k.drawImage(v,X,V),F.drawImage(x,0,0),k.globalAlpha=1,k.clearRect(0,0,x.width,x.height);for(Z=-j;Z<=j;Z++)V=(Math.random()-.5)/4,Y=Z/j,X=ie*Y*P+V,k.globalAlpha=1-Math.abs(Y),k.drawImage(v,V,X),F.drawImage(x,0,0),k.globalAlpha=1,k.clearRect(0,0,x.width,x.height);p.ctx.drawImage(v,0,0);var ce=p.ctx.getImageData(0,0,v.width,v.height);return F.globalAlpha=1,F.clearRect(0,0,v.width,v.height),ce},getUniformLocations:function(p,y){return{delta:p.getUniformLocation(y,"uDelta")}},sendUniformData:function(p,y){var v=this.chooseRightDelta();p.uniform2fv(y.delta,v)},chooseRightDelta:function(){var p=1,y=[0,0],v;return this.horizontal?this.aspectRatio>1&&(p=1/this.aspectRatio):this.aspectRatio<1&&(p=this.aspectRatio),v=p*this.blur*.12,this.horizontal?y[0]=v:y[1]=v,y}}),c.Blur.fromObject=l.Image.filters.BaseFilter.fromObject}(t),function(a){var l=a.fabric||(a.fabric={}),c=l.Image.filters,h=l.util.createClass;c.Gamma=h(c.BaseFilter,{type:"Gamma",fragmentSource:`precision highp float; uniform sampler2D uTexture; uniform vec3 uGamma; varying vec2 vTexCoord; @@ -5472,13 +5472,13 @@ color.g = pow(color.g, correction.g); color.b = pow(color.b, correction.b); gl_FragColor = color; gl_FragColor.rgb *= color.a; -}`,gamma:[1,1,1],mainParameter:"gamma",initialize:function(p){this.gamma=[1,1,1],c.BaseFilter.prototype.initialize.call(this,p)},applyTo2d:function(p){var y=p.imageData,v=y.data,S=this.gamma,I=v.length,O=1/S[0],L=1/S[1],N=1/S[2],G;for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),G=0,I=256;G'},_getCacheCanvasDimensions:function(){var p=this.callSuper("_getCacheCanvasDimensions"),y=this.fontSize;return p.width+=y*p.zoomX,p.height+=y*p.zoomY,p},_render:function(p){var y=this.path;y&&!y.isNotVisible()&&y._render(p),this._setTextStyles(p),this._renderTextLinesBackground(p),this._renderTextDecoration(p,"underline"),this._renderText(p),this._renderTextDecoration(p,"overline"),this._renderTextDecoration(p,"linethrough")},_renderText:function(p){this.paintFirst==="stroke"?(this._renderTextStroke(p),this._renderTextFill(p)):(this._renderTextFill(p),this._renderTextStroke(p))},_setTextStyles:function(p,y,v){if(p.textBaseline="alphabetical",this.path)switch(this.pathAlign){case"center":p.textBaseline="middle";break;case"ascender":p.textBaseline="top";break;case"descender":p.textBaseline="bottom";break}p.font=this._getFontDeclaration(y,v)},calcTextWidth:function(){for(var p=this.getLineWidth(0),y=1,v=this._textLines.length;yp&&(p=S)}return p},_renderTextLine:function(p,y,v,S,I,O){this._renderChars(p,y,v,S,I,O)},_renderTextLinesBackground:function(p){if(!(!this.textBackgroundColor&&!this.styleHas("textBackgroundColor"))){for(var y,v,S=p.fillStyle,I,O,L=this._getLeftOffset(),N=this._getTopOffset(),G=0,V=0,Y,X,te=this.path,re,fe=0,ge=this._textLines.length;fe=0:vX?V%=X:V<0&&(V+=X),this._setGraphemeOnPath(V,L,Y),V+=L.kernedWidth}return{width:y,numOfSpaces:N}},_setGraphemeOnPath:function(p,y,v){var S=p+y.kernedWidth/2,I=this.path,O=l.util.getPointOnPath(I.path,S,I.segmentsInfo);y.renderLeft=O.x-v.x,y.renderTop=O.y-v.y,y.angle=O.angle+(this.pathSide==="right"?Math.PI:0)},_getGraphemeBox:function(p,y,v,S,I){var O=this.getCompleteStyleDeclaration(y,v),L=S?this.getCompleteStyleDeclaration(y,v-1):{},N=this._measureChar(p,O,S,L),G=N.kernedWidth,V=N.width,Y;this.charSpacing!==0&&(Y=this._getWidthOfCharSpacing(),V+=Y,G+=Y);var X={width:V,left:0,height:O.fontSize,kernedWidth:G,deltaY:O.deltaY};if(v>0&&!I){var te=this.__charBounds[y][v-1];X.left=te.left+te.width+N.kernedWidth-N.width}return X},getHeightOfLine:function(p){if(this.__lineHeights[p])return this.__lineHeights[p];for(var y=this._textLines[p],v=this.getHeightOfChar(p,0),S=1,I=y.length;S0){var Ge=Y+O+re;this.direction==="rtl"&&(Ge=this.width-Ge-fe),V&&Ne&&(p.fillStyle=Ne,p.fillRect(Ge,te+xe*S+L,fe,this.fontSize/15)),re=ge.left,fe=ge.width,V=_e,Ne=ke,S=I,L=N}else fe+=ge.kernedWidth;var Ge=Y+O+re;this.direction==="rtl"&&(Ge=this.width-Ge-fe),p.fillStyle=ke,_e&&ke&&p.fillRect(Ge,te+xe*S+L,fe-he,this.fontSize/15),X+=v}this._removeShadow(p)}},_getFontDeclaration:function(p,y){var v=p||this,S=this.fontFamily,I=l.Text.genericFonts.indexOf(S.toLowerCase())>-1,O=S===void 0||S.indexOf("'")>-1||S.indexOf(",")>-1||S.indexOf('"')>-1||I?v.fontFamily:'"'+v.fontFamily+'"';return[l.isLikelyNode?v.fontWeight:v.fontStyle,l.isLikelyNode?v.fontStyle:v.fontWeight,y?this.CACHE_FONT_SIZE+"px":v.fontSize+"px",O].join(" ")},render:function(p){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",p)))},_splitTextIntoLines:function(p){for(var y=p.split(this._reNewline),v=new Array(y.length),S=[` -`],I=[],O=0;O"u"?this.styles:{line:this.styles[a]};for(var c in l)for(var d in l[c])for(var p in l[c][d])return!1;return!0},styleHas:function(a,l){if(!this.styles||!a||a===""||typeof l<"u"&&!this.styles[l])return!1;var c=typeof l>"u"?this.styles:{0:this.styles[l]};for(var d in c)for(var p in c[d])if(typeof c[d][p][a]<"u")return!0;return!1},cleanStyle:function(a){if(!this.styles||!a||a==="")return!1;var l=this.styles,c=0,d,p,y=!0,v=0,S;for(var I in l){d=0;for(var O in l[I]){var S=l[I][O],L=S.hasOwnProperty(a);c++,L?(p?S[a]!==p&&(y=!1):p=S[a],S[a]===this[a]&&delete S[a]):y=!1,Object.keys(S).length!==0?d++:delete l[I][O]}d===0&&delete l[I]}for(var N=0;N"u"&&(a=this.selectionStart);for(var c=l?this._unwrappedTextLines:this._textLines,d=c.length,p=0;p"u"&&(a=this.selectionStart||0),typeof l>"u"&&(l=this.selectionEnd||a);for(var d=[],p=a;p"u"&&(l=this.selectionStart||0),typeof c>"u"&&(c=this.selectionEnd||l);for(var d=l;d"u"?this[p]:c[p];return d},_setStyleDeclaration:function(a,l,c){this.styles[a][l]=c},_deleteStyleDeclaration:function(a,l){delete this.styles[a][l]},_getLineStyle:function(a){return!!this.styles[a]},_setLineStyle:function(a){this.styles[a]={}},_deleteLineStyle:function(a){delete this.styles[a]}})}(),function(){function a(l){l.textDecoration&&(l.textDecoration.indexOf("underline")>-1&&(l.underline=!0),l.textDecoration.indexOf("line-through")>-1&&(l.linethrough=!0),l.textDecoration.indexOf("overline")>-1&&(l.overline=!0),delete l.textDecoration)}e.IText=e.util.createClass(e.Text,e.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(l,c){this.callSuper("initialize",l,c),this.initBehavior()},setSelectionStart:function(l){l=Math.max(l,0),this._updateAndFire("selectionStart",l)},setSelectionEnd:function(l){l=Math.min(l,this.text.length),this._updateAndFire("selectionEnd",l)},_updateAndFire:function(l,c){this[l]!==c&&(this._fireSelectionChanged(),this[l]=c),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(l){this.clearContextTop(),this.callSuper("render",l),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(l){this.callSuper("_render",l)},clearContextTop:function(l){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var c=this.canvas.contextTop,d=this.canvas.viewportTransform;c.save(),c.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this.transform(c),this._clearTextArea(c),l||c.restore()}},renderCursorOrSelection:function(){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var l=this._getCursorBoundaries(),c=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(l,c):this.renderSelection(l,c),c.restore()}},_clearTextArea:function(l){var c=this.width+4,d=this.height+4;l.clearRect(-c/2,-d/2,c,d)},_getCursorBoundaries:function(l){typeof l>"u"&&(l=this.selectionStart);var c=this._getLeftOffset(),d=this._getTopOffset(),p=this._getCursorBoundariesOffsets(l);return{left:c,top:d,leftOffset:p.left,topOffset:p.top}},_getCursorBoundariesOffsets:function(l){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var c,d,p,y=0,v=0,S,I=this.get2DCursorLocation(l);p=I.charIndex,d=I.lineIndex;for(var O=0;O0?v:0)},this.direction==="rtl"&&(S.left*=-1),this.cursorOffsetCache=S,this.cursorOffsetCache},renderCursor:function(l,c){var d=this.get2DCursorLocation(),p=d.lineIndex,y=d.charIndex>0?d.charIndex-1:0,v=this.getValueOfPropertyAt(p,y,"fontSize"),S=this.scaleX*this.canvas.getZoom(),I=this.cursorWidth/S,O=l.topOffset,L=this.getValueOfPropertyAt(p,y,"deltaY");O+=(1-this._fontSizeFraction)*this.getHeightOfLine(p)/this.lineHeight-v*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(l,c),c.fillStyle=this.cursorColor||this.getValueOfPropertyAt(p,y,"fill"),c.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,c.fillRect(l.left+l.leftOffset-I/2,O+l.top+L,I,v)},renderSelection:function(l,c){for(var d=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,p=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,y=this.textAlign.indexOf("justify")!==-1,v=this.get2DCursorLocation(d),S=this.get2DCursorLocation(p),I=v.lineIndex,O=S.lineIndex,L=v.charIndex<0?0:v.charIndex,N=S.charIndex<0?0:S.charIndex,G=I;G<=O;G++){var V=this._getLineLeftOffset(G)||0,Y=this.getHeightOfLine(G),X=0,te=0,re=0;if(G===I&&(te=this.__charBounds[I][L].left),G>=I&&G1)&&(Y/=this.lineHeight);var ge=l.left+V+te,_e=re-te,Ie=Y,ke=0;this.inCompositionMode?(c.fillStyle=this.compositionColor||"black",Ie=1,ke=Y):c.fillStyle=this.selectionColor,this.direction==="rtl"&&(ge=this.width-ge-_e),c.fillRect(ge,l.top+l.topOffset+ke,_e,Ie),l.topOffset+=X}},getCurrentCharFontSize:function(){var l=this._getCurrentCharIndex();return this.getValueOfPropertyAt(l.l,l.c,"fontSize")},getCurrentCharColor:function(){var l=this._getCurrentCharIndex();return this.getValueOfPropertyAt(l.l,l.c,"fill")},_getCurrentCharIndex:function(){var l=this.get2DCursorLocation(this.selectionStart,!0),c=l.charIndex>0?l.charIndex-1:0;return{l:l.lineIndex,c}}}),e.IText.fromObject=function(l,c){var d=e.util.stylesFromArray(l.styles,l.text),p=Object.assign({},l,{styles:d});if(a(p),p.styles)for(var y in p.styles)for(var v in p.styles[y])a(p.styles[y][v]);e.Object._fromObject("IText",p,c,"text")}}(),function(){var a=e.util.object.clone;e.util.object.extend(e.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var l=this;this.on("added",function(){var c=l.canvas;c&&(c._hasITextHandlers||(c._hasITextHandlers=!0,l._initCanvasHandlers(c)),c._iTextInstances=c._iTextInstances||[],c._iTextInstances.push(l))})},initRemovedHandler:function(){var l=this;this.on("removed",function(){var c=l.canvas;c&&(c._iTextInstances=c._iTextInstances||[],e.util.removeFromArray(c._iTextInstances,l),c._iTextInstances.length===0&&(c._hasITextHandlers=!1,l._removeCanvasHandlers(c)))})},_initCanvasHandlers:function(l){l._mouseUpITextHandler=function(){l._iTextInstances&&l._iTextInstances.forEach(function(c){c.__isMousedown=!1})},l.on("mouse:up",l._mouseUpITextHandler)},_removeCanvasHandlers:function(l){l.off("mouse:up",l._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(l,c,d,p){var y;return y={isAborted:!1,abort:function(){this.isAborted=!0}},l.animate("_currentCursorOpacity",c,{duration:d,onComplete:function(){y.isAborted||l[p]()},onChange:function(){l.canvas&&l.selectionStart===l.selectionEnd&&l.renderCursorOrSelection()},abort:function(){return y.isAborted}}),y},_onTickComplete:function(){var l=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){l._currentTickCompleteState=l._animateCursor(l,0,this.cursorDuration/2,"_tick")},100)},initDelayedCursor:function(l){var c=this,d=l?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){c._tick()},d)},abortCursorAnimation:function(){var l=this._currentTickState||this._currentTickCompleteState,c=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,l&&c&&c.clearContext(c.contextTop||c.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(l){var c=0,d=l-1;if(this._reSpace.test(this._text[d]))for(;this._reSpace.test(this._text[d]);)c++,d--;for(;/\S/.test(this._text[d])&&d>-1;)c++,d--;return l-c},findWordBoundaryRight:function(l){var c=0,d=l;if(this._reSpace.test(this._text[d]))for(;this._reSpace.test(this._text[d]);)c++,d++;for(;/\S/.test(this._text[d])&&d-1;)c++,d--;return l-c},findLineBoundaryRight:function(l){for(var c=0,d=l;!/\n/.test(this._text[d])&&d0&&pthis.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=c):(this.selectionStart=c,this.selectionEnd=this.__selectionStartOnMouseDown),(this.selectionStart!==d||this.selectionEnd!==p)&&(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(l,c,d){var p=d.slice(0,l),y=e.util.string.graphemeSplit(p).length;if(l===c)return{selectionStart:y,selectionEnd:y};var v=d.slice(l,c),S=e.util.string.graphemeSplit(v).length;return{selectionStart:y,selectionEnd:y+S}},fromGraphemeToStringSelection:function(l,c,d){var p=d.slice(0,l),y=p.join("").length;if(l===c)return{selectionStart:y,selectionEnd:y};var v=d.slice(l,c),S=v.join("").length;return{selectionStart:y,selectionEnd:y+S}},_updateTextarea:function(){if(this.cursorOffsetCache={},!!this.hiddenTextarea){if(!this.inCompositionMode){var l=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=l.selectionStart,this.hiddenTextarea.selectionEnd=l.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var l=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=l.selectionEnd,this.inCompositionMode||(this.selectionStart=l.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var l=this._calcTextareaPosition();this.hiddenTextarea.style.left=l.left,this.hiddenTextarea.style.top=l.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var l=this.inCompositionMode?this.compositionStart:this.selectionStart,c=this._getCursorBoundaries(l),d=this.get2DCursorLocation(l),p=d.lineIndex,y=d.charIndex,v=this.getValueOfPropertyAt(p,y,"fontSize")*this.lineHeight,S=c.leftOffset,I=this.calcTransformMatrix(),O={x:c.left+S,y:c.top+c.topOffset+v},L=this.canvas.getRetinaScaling(),N=this.canvas.upperCanvasEl,G=N.width/L,V=N.height/L,Y=G-v,X=V-v,te=N.clientWidth/G,re=N.clientHeight/V;return O=e.util.transformPoint(O,I),O=e.util.transformPoint(O,this.canvas.viewportTransform),O.x*=te,O.y*=re,O.x<0&&(O.x=0),O.x>Y&&(O.x=Y),O.y<0&&(O.y=0),O.y>X&&(O.y=X),O.x+=this.canvas._offset.left,O.y+=this.canvas._offset.top,{left:O.x+"px",top:O.y+"px",fontSize:v+"px",charHeight:v}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var l=this._textBeforeEdit!==this.text,c=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,c&&(c.blur&&c.blur(),c.parentNode&&c.parentNode.removeChild(c)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),l&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),l&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var l in this.styles)this._textLines[l]||delete this.styles[l]},removeStyleFromTo:function(l,c){var d=this.get2DCursorLocation(l,!0),p=this.get2DCursorLocation(c,!0),y=d.lineIndex,v=d.charIndex,S=p.lineIndex,I=p.charIndex,O,L;if(y!==S){if(this.styles[y])for(O=v;O=I&&(L[G-N]=L[V],delete L[V])}},shiftLineStyles:function(l,c){var d=a(this.styles);for(var p in this.styles){var y=parseInt(p,10);y>l&&(this.styles[y+c]=d[y],d[y-c]||delete this.styles[y])}},restartCursorIfNeeded:function(){(!this._currentTickState||this._currentTickState.isAborted||!this._currentTickCompleteState||this._currentTickCompleteState.isAborted)&&this.initDelayedCursor()},insertNewlineStyleObject:function(l,c,d,p){var y,v={},S=!1,I=this._unwrappedTextLines[l].length===c;d||(d=1),this.shiftLineStyles(l,d),this.styles[l]&&(y=this.styles[l][c===0?c:c-1]);for(var O in this.styles[l]){var L=parseInt(O,10);L>=c&&(S=!0,v[L-c]=this.styles[l][O],I&&c===0||delete this.styles[l][O])}var N=!1;for(S&&!I&&(this.styles[l+d]=v,N=!0),N&&d--;d>0;)p&&p[d-1]?this.styles[l+d]={0:a(p[d-1])}:y?this.styles[l+d]={0:a(y)}:delete this.styles[l+d],d--;this._forceClearCache=!0},insertCharStyleObject:function(l,c,d,p){this.styles||(this.styles={});var y=this.styles[l],v=y?a(y):{};d||(d=1);for(var S in v){var I=parseInt(S,10);I>=c&&(y[I+d]=v[I],v[I-d]||delete y[I])}if(this._forceClearCache=!0,p){for(;d--;)Object.keys(p[d]).length&&(this.styles[l]||(this.styles[l]={}),this.styles[l][c+d]=a(p[d]));return}if(y)for(var O=y[c?c-1:1];O&&d--;)this.styles[l][c+d]=a(O)},insertNewStyleBlock:function(l,c,d){for(var p=this.get2DCursorLocation(c,!0),y=[0],v=0,S=0;S0&&(this.insertCharStyleObject(p.lineIndex,p.charIndex,y[0],d),d=d&&d.slice(y[0]+1)),v&&this.insertNewlineStyleObject(p.lineIndex,p.charIndex+y[0],v);for(var S=1;S0?this.insertCharStyleObject(p.lineIndex+S,0,y[S],d):d&&this.styles[p.lineIndex+S]&&d[0]&&(this.styles[p.lineIndex+S][0]=d[0]),d=d&&d.slice(y[S]+1);y[S]>0&&this.insertCharStyleObject(p.lineIndex+S,0,y[S],d)},setSelectionStartEndWithShift:function(l,c,d){d<=l?(c===l?this._selectionDirection="left":this._selectionDirection==="right"&&(this._selectionDirection="left",this.selectionEnd=l),this.selectionStart=d):d>l&&dl?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),c=this.selectionStart,d=this.selectionEnd;a.shiftKey?this.setSelectionStartEndWithShift(c,d,l):(this.selectionStart=l,this.selectionEnd=l),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(a){for(var l=this.getLocalPointer(a),c=0,d=0,p=0,y=0,v=0,S,I,O=0,L=this._textLines.length;O0&&(y+=this._textLines[O-1].length+this.missingNewlineOffset(O-1));S=this._getLineLeftOffset(v),d=S*this.scaleX,I=this._textLines[v],this.direction==="rtl"&&(l.x=this.width*this.scaleX-l.x+d);for(var N=0,G=I.length;Ny||v<0?0:1,I=d+S;return this.flipX&&(I=p-I),I>this._text.length&&(I=this._text.length),I}}),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 c=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,d=this._text.length,p=c.length,y,v,S=p-d,I=this.selectionStart,O=this.selectionEnd,L=I!==O,N,G,V;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 Y=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),X=I>Y.selectionStart;L?(y=this._text.slice(I,O),S+=O-I):p0&&(d=this.__charBounds[a][l-1],c+=d.left+d.width),c},getDownCursorOffset:function(a,l){var c=this._getSelectionForOffset(a,l),d=this.get2DCursorLocation(c),p=d.lineIndex;if(p===this._textLines.length-1||a.metaKey||a.keyCode===34)return this._text.length-c;var y=d.charIndex,v=this._getWidthBeforeCursor(p,y),S=this._getIndexOnLine(p+1,v),I=this._textLines[p].slice(y);return I.length+S+1+this.missingNewlineOffset(p)},_getSelectionForOffset:function(a,l){return a.shiftKey&&this.selectionStart!==this.selectionEnd&&l?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(a,l){var c=this._getSelectionForOffset(a,l),d=this.get2DCursorLocation(c),p=d.lineIndex;if(p===0||a.metaKey||a.keyCode===33)return-c;var y=d.charIndex,v=this._getWidthBeforeCursor(p,y),S=this._getIndexOnLine(p-1,v),I=this._textLines[p].slice(0,y),O=this.missingNewlineOffset(p-1);return-this._textLines[p-1].length+S-I.length+(1-O)},_getIndexOnLine:function(a,l){for(var c=this._textLines[a],d=this._getLineLeftOffset(a),p=d,y=0,v,S,I=0,O=c.length;Il){S=!0;var L=p-v,N=p,G=Math.abs(L-l),V=Math.abs(N-l);y=V=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 c="get"+a+"CursorOffset",d=this[c](l,this._selectionDirection==="right");l.shiftKey?this.moveCursorWithShift(d):this.moveCursorWithoutShift(d),d!==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,c){var d;if(a.altKey)d=this["findWordBoundary"+c](this[l]);else if(a.metaKey||a.keyCode===35||a.keyCode===36)d=this["findLineBoundary"+c](this[l]);else return this[l]+=c==="Left"?-1:1,!0;if(typeof d<"u"&&this[l]!==d)return this[l]=d,!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 c="moveCursor"+a+"With";this._currentCursorOpacity=1,l.shiftKey?c+="Shift":c+="outShift",this[c](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,c,d){typeof d>"u"&&(d=c),d>c&&this.removeStyleFromTo(c,d);var p=e.util.string.graphemeSplit(a);this.insertNewStyleBlock(p,c,l),this._text=[].concat(this._text.slice(0,c),p,this._text.slice(d)),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 c=this._getSVGLeftTopOffsets(),d=this._getSVGTextAndBg(c.textTop,c.textLeft);return this._wrapSVGTextAndBg(d)},toSVG:function(c){return this._createBaseSVGMarkup(this._toSVG(),{reviver:c,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(c){var d=!0,p=this.getSvgTextDecoration(this);return[c.textBgRects.join(""),' ",c.textSpans.join(""),` -`]},_getSVGTextAndBg:function(c,d){var p=[],y=[],v=c,S;this._setSVGBg(y);for(var I=0,O=this._textLines.length;I",e.util.string.escapeXml(c),""].join("")},_setSVGTextLineText:function(c,d,p,y){var v=this.getHeightOfLine(d),S=this.textAlign.indexOf("justify")!==-1,I,O,L="",N,G,V=0,Y=this._textLines[d],X;y+=v*(1-this._fontSizeFraction)/this.lineHeight;for(var te=0,re=Y.length-1;te<=re;te++)X=te===re||this.charSpacing,L+=Y[te],N=this.__charBounds[d][te],V===0?(p+=N.kernedWidth-N.width,V+=N.width):V+=N.kernedWidth,S&&!X&&this._reSpaceAndTab.test(Y[te])&&(X=!0),X||(I=I||this.getCompleteStyleDeclaration(d,te),O=this.getCompleteStyleDeclaration(d,te+1),X=e.util.hasStyleChanged(I,O,!0)),X&&(G=this._getStyleDeclaration(d,te)||{},c.push(this._createTextCharSpan(L,G,p,y)),L="",I=O,p+=V,V=0)},_pushTextBgRect:function(c,d,p,y,v,S){var I=e.Object.NUM_FRACTION_DIGITS;c.push(" -`)},_setSVGTextLineBg:function(c,d,p,y){for(var v=this._textLines[d],S=this.getHeightOfLine(d)/this.lineHeight,I=0,O=0,L,N,G=this.getValueOfPropertyAt(d,0,"textBackgroundColor"),V=0,Y=v.length;Vthis.width&&this._set("width",this.dynamicMinWidth),this.textAlign.indexOf("justify")!==-1&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(c){for(var d=0,p=0,y=0,v={},S=0;S0?(p=0,y++,d++):!this.splitByGrapheme&&this._reSpaceAndTab.test(c.graphemeText[y])&&S>0&&(p++,y++),v[S]={line:d,offset:p},y+=c.graphemeLines[S].length,p+=c.graphemeLines[S].length;return v},styleHas:function(c,d){if(this._styleMap&&!this.isWrapping){var p=this._styleMap[d];p&&(d=p.line)}return l.Text.prototype.styleHas.call(this,c,d)},isEmptyStyles:function(c){if(!this.styles)return!0;var d=0,p=c+1,y,v,S=!1,I=this._styleMap[c],O=this._styleMap[c+1];I&&(c=I.line,d=I.offset),O&&(p=O.line,S=p===c,y=O.offset),v=typeof c>"u"?this.styles:{line:this.styles[c]};for(var L in v)for(var N in v[L])if(N>=d&&(!S||Np&&!re?(I.push(O),O=[],v=Y,re=!0):v+=fe,!re&&!S&&O.push(V),O=O.concat(N),X=S?0:this._measureWord([V],d,G),G++,re=!1,Y>te&&(te=Y);return _e&&I.push(O),te+ge>this.dynamicMinWidth&&(this.dynamicMinWidth=te-fe+ge),I},isEndOfWrapping:function(c){return!this._styleMap[c+1]||this._styleMap[c+1].line!==this._styleMap[c].line},missingNewlineOffset:function(c){return this.splitByGrapheme?this.isEndOfWrapping(c)?1:0:1},_splitTextIntoLines:function(c){for(var d=l.Text.prototype._splitTextIntoLines.call(this,c),p=this._wrapText(d.lines,this.width),y=new Array(p.length),v=0;v{p>0&&(s+=Edr),c.top=s,s+=c.height+Idr;const y=d.map(({title:v,items:S},I)=>{const O=[];return v&&!(d.length===1&&v.text===c.text)&&(I>0&&(s+=Adr),v.top=s,s+=v.height+Pdr,O.push(v)),S.forEach(L=>{L.top=s,s+=L.height+Odr}),[...O,...S].filter(L=>L)});return new Od.fabric.Group([c,...y.flat()])}).flat(),l=this._makeColumns(a,n,r);return Promise.resolve(l)}_makeColumns(e,i,r){let n=0,s=0,o=0;const a=e[e.length-1].aCoords.bl.y/r;return e.forEach((l,c)=>{const d=c!==e.length-1?e[c+1].top-l.top:l.height,p=o>a*(n+1),y=s!==0&&d>a,v=r-n>e.length-c;(p||y||v)&&n{const n=new Od.fabric.Textbox(r.name,{fontSize:24,fontFamily:Ree,width:i}),s=this._getLayerTreeIds(r);let o=[];return o=r.supportsSublayers?await Promise.all(this._makeSegmentChunks(s,r,i)):await Promise.all(this._makeSegmentChunks([-1],r,i)),{title:n,items:o}})}_makeSegmentChunks(e,i,r){const n=i;return e.map(async s=>{const o=s===-1?n:n.getSublayer(s);if(!o)return{title:new Od.fabric.Textbox("ERROR",{fontSize:20,fontFamily:Ree,width:r}),items:[]};await Promise.all(o.legend.map(d=>d.drawPromise));const a=o.legend,l=new Od.fabric.Textbox(o.name,{fontSize:20,fontFamily:Ree,width:r}),c=await Promise.all(this._makeChunkItems(a,r));return{title:l,items:c}})}_makeChunkItems(e,i){return e.map(async r=>{const n=(await Ddr(Od.fabric.loadSVGFromString)(r.svgcode))[0];if(r.esriStandard){n.originY="center",n.top=a7/2;const s=new Od.fabric.Textbox(r.label,{fontSize:12,fontFamily:Ree,originY:"center",left:eOt+20,top:a7/2,width:i-eOt-20});return new Od.fabric.Group([n,s],{height:a7})}else{const s=new Od.fabric.Textbox(r.label,{fontSize:12,fontFamily:Ree,originY:"center",left:0,top:a7/2,width:i}),o=Number(r.imgWidth),a=Number(r.imgHeight),l=Math.min(1,i/o);return n&&(n.originY="center",n.top=a*l/2+a7,n.scaleToHeight(a*l),n.scaleToWidth(o*l)),new Od.fabric.Group([s,n].filter(Boolean),{height:a*l+a7})}})}_getLayerTreeIds(e){const i=[],r=[...e.sublayers];for(;r.length>0;){const n=r.shift();n&&(n.visibility&&i.push(n.layerIdx),r.push(...n.sublayers))}return i}}const Ddr=t=>e=>new Promise(i=>{t(e,r=>{i(r)})}),Fdr=Object.freeze(Object.defineProperty({__proto__:null,default:Mdr},Symbol.toStringTag,{value:"Module"}));class Ldr extends Cc{get config(){return this.$iApi.fixture.get("export").config?.map}async make(e){const i=await this.$iApi.geo.map.takeScreenshot({quality:1,format:"png"}),r=new Image;r.src=i.dataUrl;const n=await new Promise(s=>r.onload=()=>s(r));return new Od.fabric.Image(n,e)}}const kdr=Object.freeze(Object.defineProperty({__proto__:null,default:Ldr},Symbol.toStringTag,{value:"Module"}));class Ndr extends Cc{get config(){return this.$iApi.fixture.get("export").config?.mapElements}async make(e){const i='N',r=document.querySelector(".inner-shell"),n=this.$iApi.geo.map.getSR();let s=0;if(n.isWebMercator())s=0;else{const c=new Qg("pole",{x:-96,y:90}),d=await this.$iApi.geo.proj.projectGeometry(n,c),p=this.$iApi.geo.map.mapPointToScreenPoint(d),y={screenX:r.clientWidth/2,screenY:r.clientHeight};s=Math.atan((p.screenX-y.screenX)/(y.screenY-p.screenY))*180/Math.PI}const o={top:0,left:0,originX:"center",originY:"center",angle:s},a=[];let l=new Od.fabric.Group;return Od.fabric.loadSVGFromString(i,()=>{l=new Od.fabric.Group(a)},(c,d)=>{a.push(d)}),l.set(IG(o,e||{})),Promise.resolve(l)}}const $dr=Object.freeze(Object.defineProperty({__proto__:null,default:Ndr},Symbol.toStringTag,{value:"Module"}));class Bdr extends Cc{get config(){return this.$iApi.fixture.get("export").config?.mapElements}make(e){const i=this.$iApi.geo.map.caption.scaleHelper(),r=[];for(let n=0;n<2;n++){const s=new Od.fabric.Text(this.$iApi.$i18n.t("export.scaleBar.approx",[`${this.$iApi.$i18n.n(i[n].distance,"number")}${i[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 Od.fabric.Line([0,n===0?30:40,i[n].pixels,n===0?30:40],{stroke:"black",strokeWidth:3});r.push(new Od.fabric.Group([o,s]))}return Promise.resolve(new Od.fabric.Group(r,e))}}const Gdr=Object.freeze(Object.defineProperty({__proto__:null,default:Bdr},Symbol.toStringTag,{value:"Module"}));class Vdr extends Cc{get config(){return this.$iApi.fixture.get("export").config?.title}make(e){const i=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"};i&&(r.text=i.value);const n=IG(r,e||{}),s=new Od.fabric.Textbox(n.text,n);return Promise.resolve(s)}}const Udr=Object.freeze(Object.defineProperty({__proto__:null,default:Vdr},Symbol.toStringTag,{value:"Module"}));var BNe={},jdr={get exports(){return BNe},set exports(t){BNe=t}};(function(t,e){(function(i,r){r()})(kp,function(){function i(c,d){return typeof d>"u"?d={autoBom:!1}:typeof d!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),d={autoBom:!d}),d.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function r(c,d,p){var y=new XMLHttpRequest;y.open("GET",c),y.responseType="blob",y.onload=function(){l(y.response,d,p)},y.onerror=function(){console.error("could not download file")},y.send()}function n(c){var d=new XMLHttpRequest;d.open("HEAD",c,!1);try{d.send()}catch{}return 200<=d.status&&299>=d.status}function s(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(d)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof kp=="object"&&kp.global===kp?kp: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(c,d,p){var y=o.URL||o.webkitURL,v=document.createElement("a");d=d||c.name||"download",v.download=d,v.rel="noopener",typeof c=="string"?(v.href=c,v.origin===location.origin?s(v):n(v.href)?r(c,d,p):s(v,v.target="_blank")):(v.href=y.createObjectURL(c),setTimeout(function(){y.revokeObjectURL(v.href)},4e4),setTimeout(function(){s(v)},0))}:"msSaveOrOpenBlob"in navigator?function(c,d,p){if(d=d||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(i(c,p),d);else if(n(c))r(c,d,p);else{var y=document.createElement("a");y.href=c,y.target="_blank",setTimeout(function(){s(y)})}}:function(c,d,p,y){if(y=y||open("","_blank"),y&&(y.document.title=y.document.body.innerText="downloading..."),typeof c=="string")return r(c,d,p);var v=c.type==="application/octet-stream",S=/constructor/i.test(o.HTMLElement)||o.safari,I=/CriOS\/[\d]+/.test(navigator.userAgent);if((I||v&&S||a)&&typeof FileReader<"u"){var O=new FileReader;O.onloadend=function(){var G=O.result;G=I?G:G.replace(/^data:[^;]*;/,"data:attachment/file;"),y?y.location.href=G:location=G,y=null},O.readAsDataURL(c)}else{var L=o.URL||o.webkitURL,N=L.createObjectURL(c);y?y.location=N:location.href=N,y=null,setTimeout(function(){L.revokeObjectURL(N)},4e4)}});o.saveAs=l.saveAs=l,t.exports=l})})(jdr),Od.fabric.Object.prototype.objectCaching=!1;const Zge=1200,vx={TOP:40,RIGHT:40,BOTTOM:40,LEFT:40};class zdr extends Cc{fcFabric;fcFabricDownload;options={runningHeight:0,scale:1};get config(){return super.config}_parseConfig(e){if(!e)return;const i=bV(this.$vApp.$pinia);i.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},i.fileName=e.fileName||"",this.handlePanelWidths(["export"])}getSubFixture(e){return this.$iApi.fixture.get(e)}async make(e,i){const r=bV(this.$vApp.$pinia);this.fcFabric=new Od.fabric.StaticCanvas(e,{backgroundColor:"#fff"}),this.fcFabricDownload=new Od.fabric.StaticCanvas(null,{backgroundColor:"#fff"}),this.options.runningHeight=0;const n=r.componentSelectedState,s=this.getSubFixture("export-title"),o=this.getSubFixture("export-map"),a=this.getSubFixture("export-scalebar"),l=this.getSubFixture("export-northarrow"),c=this.getSubFixture("export-legend");let d,p,y,v,S;const I=[];n.title&&(d=await s.make({top:this.options.runningHeight,left:0,originX:"left",width:i,textAlign:"center"}),this.options.runningHeight+=d.height+40,I.push(d)),n.map&&(p=await o.make({top:this.options.runningHeight}),d&&(d.left=p.width/2,d.originX="center"),this.options.runningHeight+=p.height+40,I.push(p)),!p&&d&&(d.width=Zge),this.options.scale=i/((p?.width??Zge)+vx.LEFT+vx.RIGHT),n.mapElements&&(y=await a.make({top:this.options.runningHeight,left:0}),this.options.runningHeight+=y.height+40,I.push(y),v=await l.make({top:y.top,left:i/this.options.scale}),v.top+=v.height/2-20,v.left+=-v.width*2,I.push(v)),n.legend&&(S=await c.make({width:c.config?.columnWidth??p?.width??Zge}),S.top=this.options.runningHeight,this.options.runningHeight+=S.height,I.push(S));const O=new Od.fabric.Group(I,{top:vx.TOP*this.options.scale,left:vx.LEFT*this.options.scale}),L=await new Promise(N=>{O.clone(G=>{N(G)})});L.top=vx.TOP,L.left=vx.LEFT,this.fcFabricDownload.add(L),O.scale(this.options.scale),this.fcFabric.add(O),this.fcFabric.setDimensions({width:i,height:(this.options.runningHeight+vx.TOP+vx.BOTTOM)*this.options.scale}),this.fcFabric.renderAll(),this.fcFabricDownload.setDimensions({width:(p?.width??Zge)+vx.LEFT+vx.RIGHT,height:this.options.runningHeight+vx.TOP+vx.BOTTOM}),this.fcFabricDownload.renderAll()}export(){if(!this.fcFabric)return;const e=new Date,i=this.config?.fileName||`map-carte - ${e.getFullYear()}-${e.getMonth()}-${e.getDay()}, ${e.getHours()}_${e.getMinutes()}`;BNe.saveAs(this.fcFabricDownload.toDataURL({format:"png",quality:1}),`${i}.png`)}}const Hdr=Mt("div",{class:"flex items-center text-gray-400 w-full h-full hover:text-black p-4 sm:p-8"},[Mt("svg",{class:"fill-current w-24 h-24 m-auto",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Mt("g",null,[Mt("path",{d:"M0,0h24v24H0V0z",fill:"none"}),Mt("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),Wdr=["onClick","aria-label"],qdr={class:"md-icon-small inline"},Ydr=[Mt("g",null,[Mt("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})],-1)],Xdr=Zr({__name:"settings-button",props:{componentSelectedState:{type:Object,required:!0}},emits:["onComponentToggle"],setup(t,{emit:e}){const{t:i}=qn(),r=C_(),n=bV(),s=Vr(()=>r.mobileView?"top-end":"left-end"),o=a=>{a.selectable&&(n.toggleSelected({name:a.name}),e("onComponentToggle"))};return(a,l)=>{const c=Io("dropdown-menu"),d=Qn("focus-item");return Br((Kt(),Pn(c,{position:Qt(s),tooltip:Qt(i)("export.menu"),"tooltip-placement":"top"},{header:yn(()=>[Hdr]),default:yn(p=>[(Kt(!0),ci(eo,null,ou(t.componentSelectedState,y=>(Kt(),ci("a",{key:y.name,onClick:v=>o(y),href:"javascript:;",class:fs(`text-left text-sm sm:text-base ${y.selectable?"cursor-pointer":"cursor-default"}`),"aria-label":y.name},[Mt("div",qdr,[(Kt(),ci("svg",{height:"20",width:"20",viewBox:"0 0 24 24",class:fs(`inline mx-8 ${y.selected?"":"invisible"}`)},Ydr,2)),Mt("span",{class:fs(`inline ${y.selectable?"":"text-gray-300"} - `)},gr(Qt(i)(`export.menu.component.${y.name}`)),3)])],10,Wdr))),128))]),_:1},8,["position","tooltip"])),[[d]])}}}),Kdr=Mt("div",{class:"overflow-hidden border border-gray-200"},[Mt("canvas",{class:"export-canvas"})],-1),Jdr={class:"flex"},Zdr=["aria-label"],Qdr=["aria-label"],tOt=Zr({__name:"screen",props:{panel:{type:Object,required:!0}},setup(t){const{t:e}=qn(),i=Qs("iApi"),r=bV(),n=Pi(),s=Pi(void 0),o=Vr(()=>ff()?.proxy?.$el),a=Vr(()=>r.componentSelectedState),l=Vr(()=>{let d={};return n.value&&Object.keys(a.value).forEach(p=>{d[p]={name:p,selected:a.value[p]??!1,selectable:(n.value?.config)[p]?.selectable??!0}}),d}),c=Z2(300,()=>{if(!n.value)return;const d=o.value.querySelector(".export-canvas");n.value.make(d,o.value.clientWidth-16)});return al(()=>{n.value=i.fixture.get("export"),s.value=new ResizeObserver(()=>{c()}),s.value.observe(o.value)}),su(()=>{s.value.disconnect()}),(d,p)=>{const y=Io("panel-screen");return Kt(),Pn(y,{panel:t.panel,footer:!0},{header:yn(()=>[Fs(gr(Qt(e)("export.title")),1)]),content:yn(()=>[Kdr]),footer:yn(()=>[Mt("div",Jdr,[Mt("button",{type:"button",onClick:p[0]||(p[0]=v=>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":Qt(e)("export.download")},gr(Qt(e)("export.download")),9,Zdr),Mt("button",{type:"button",onClick:p[1]||(p[1]=v=>Qt(c)()),class:"py-8 px-4 sm:px-16","aria-label":Qt(e)("export.refresh")},gr(Qt(e)("export.refresh")),9,Qdr),Rn(Xdr,{componentSelectedState:Qt(l),onComponentToggle:Qt(c)(),class:"ml-auto flex px-4 sm:px-8"},null,8,["componentSelectedState","onComponentToggle"])])]),_:1},8,["panel"])}}}),epr=Object.freeze(Object.defineProperty({__proto__:null,default:tOt},Symbol.toStringTag,{value:"Module"})),tpr={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 ipr extends zdr{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")}added(){this.$iApi.panel.register({id:"export",config:{screens:{"export-screen":Ho(tOt)},style:{"flex-grow":"1","max-width":"800px"},button:{tooltip:"export.title",icon:''},alertName:"export.alertName"}},{i18n:{messages:tpr}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,i=>this._parseConfig(i));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("appbar")&&hg(this.$vApp.$pinia).removeButton("export"),bV(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("export")}}}const rpr=Object.freeze(Object.defineProperty({__proto__:null,default:ipr},Symbol.toStringTag,{value:"Module"})),npr=Zr({__name:"appbar-button",props:{options:{type:Object}},setup(t){const e=Qs("iApi"),i=()=>{e.panel.toggle({id:"p2",screen:"p-2-screen-2"})};return(r,n)=>{const s=Io("appbar-button",!0);return Kt(),Pn(s,{onClickFunction:i,tooltip:"Gazebo"},{default:yn(()=>[Mt("span",{style:tb({color:t.options?.colour??"#BDBDBD"})},"G ",4)]),_:1})}}}),spr=Mt("a",{href:"javascript:;"},"Option 1",-1),opr=Mt("a",{href:"javascript:;"},"Option 2",-1),apr=Mt("a",{href:"javascript:;"},"Option 3",-1),lpr={class:"flex flex-col items-center"},upr=Mt("br",null,null,-1),cpr=Mt("img",{src:"https://c.tenor.com/RJ3ZG5beDhIAAAAC/napoleon-dynamite-napoleon.gif",alt:"Gazebo1"},null,-1),hpr=Zr({__name:"p1-screen-1",props:{panel:{type:Object,required:!0}},setup(t){return(e,i)=>{const r=Io("panel-screen");return Kt(),Pn(r,{panel:t.panel},{header:yn(()=>[Fs(" Gazebo/Panel 1/Screen A ")]),controls:yn(()=>[spr,opr,apr]),content:yn(()=>[Mt("div",lpr,[Mt("button",{type:"button",onClick:i[0]||(i[0]=n=>t.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 "),upr,cpr])]),_:1},8,["panel"])}}}),dpr={class:"flex flex-col items-center"},ppr=Mt("br",null,null,-1),fpr=Mt("img",{src:"http://nesn.com/wp-content/uploads/2014/09/jeternephew.gif",alt:"Gazebo2"},null,-1),mpr=Zr({__name:"p1-screen-2",props:{panel:{type:Object,required:!0}},setup(t){return(e,i)=>{const r=Io("panel-screen");return Kt(),Pn(r,{panel:t.panel},{header:yn(()=>[Fs(" Gazebo/Panel 1/Screen B ")]),content:yn(()=>[Mt("div",dpr,[Mt("button",{type:"button",onClick:i[0]||(i[0]=n=>t.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 "),ppr,fpr])]),_:1},8,["panel"])}}}),gpr={class:"flex flex-row justify-center items-center mt-16"},ypr={class:"mt-16"},vpr=Object.freeze(Object.defineProperty({__proto__:null,default:Zr({__name:"p2-screen-1",props:{panel:{type:Object,required:!0},greeting:{type:String}},setup(t){const{t:e}=qn();return(i,r)=>{const n=Io("panel-screen");return Kt(),Pn(n,{panel:t.panel},{header:yn(()=>[Fs(" Gazebo/Panel 2/Screen A ")]),content:yn(()=>[Fs(gr(Qt(e)("gz.hello"))+" ",1),Mt("div",gpr,[Mt("button",{type:"button",onClick:r[0]||(r[0]=s=>t.panel.show({screen:"p-2-screen-2",props:{greeting:"Howdy?"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16 m-2"}," Go back to B "),Mt("button",{type:"button",onClick:r[1]||(r[1]=s=>t.panel.show("p-2-screen-3")),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16 m-2"}," Go to C ")]),Mt("p",ypr,gr(t.greeting),1)]),_:1},8,["panel"])}}})},Symbol.toStringTag,{value:"Module"})),_pr={class:"flex flex-row justify-center items-center mt-16"},bpr={class:"mt-16"},wpr=Zr({__name:"p2-screen-2",props:{panel:{type:Object,required:!0},greeting:{type:String}},setup(t){const e=t,{t:i}=qn(),r=Qs("iApi"),n=()=>{e.panel.show("p-2-screen-3"),r.event.emit("gazebo/beholdMyText","I am a cat")};return(s,o)=>{const a=Io("panel-screen");return Kt(),Pn(a,{panel:t.panel},{header:yn(()=>[Fs(" Gazebo/Panel 2/Screen B ")]),content:yn(()=>[Fs(gr(Qt(i)("gz.hello2"))+" ",1),Mt("div",_pr,[Mt("button",{type:"button",onClick:o[0]||(o[0]=l=>t.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 "),Mt("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 ")]),Mt("p",bpr,gr(t.greeting),1)]),_:1},8,["panel"])}}}),xpr={class:"flex flex-col items-center mt-16"},Spr=Mt("img",{class:"my-16",src:"https://media.giphy.com/media/iWkHDNtcHpB5e/giphy.gif",alt:"",srcset:""},null,-1),Cpr=Mt("p",null,"Locale merging:",-1),Tpr=Mt("dt",null,"global locale:",-1),Epr={class:"ml-32 font-bold"},Ipr=Mt("dt",null,"fixture locale:",-1),Apr={class:"ml-32 font-bold"},Ppr=Mt("dt",null,"common panels locale:",-1),Opr={class:"ml-32 font-bold"},Rpr=Zr({__name:"p2-screen-3",props:{panel:{type:Object,required:!0}},setup(t){Qs("iApi");const{t:e}=qn({messages:{en:{lang_native:"En",who:"[me cat]"},fr:{lang_native:"Fr",who:"[moi chat]"}}});return(i,r)=>{const n=Io("panel-screen");return Kt(),Pn(n,{panel:t.panel},{header:yn(()=>[Fs(" Gazebo/Panel 2/Screen C ")]),content:yn(()=>[Mt("div",xpr,[Mt("button",{type:"button",onClick:r[0]||(r[0]=s=>t.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 "),Spr,Cpr,Mt("dl",null,[Tpr,Mt("dd",Epr,gr(Qt(e)("lang_native")),1),Ipr,Mt("dd",Apr,gr(Qt(e)("gz.hello")),1),Ppr,Mt("dd",Opr,gr(Qt(e)("who")),1)])])]),_:1},8,["panel"])}}}),iOt={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":'[fr] Bonjour. Je suis un panel\\"',"gz.hello2":'[fr] Bonjour. Je suis un panel\\"',"gz.alert1":"[fr] Gazebo","gz.alert2":"[fr] Gazebo deux"}},Mpr="gazebo/beholdMyText";class Dpr extends Cc{added(){this.$iApi.event.registerEventName(Mpr),this.$iApi.component("gazebo-appbar-button",npr),this.$iApi.panel.register({id:"p1",config:{screens:{"p-1-screen-1":Ho(hpr),"p-1-screen-2":Ho(mpr)},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert1"}},{i18n:{messages:iOt}}),this.$iApi.panel.register({id:"p2",config:{screens:{"p-2-screen-1":()=>new Promise(e=>setTimeout(()=>Promise.resolve().then(()=>vpr).then(i=>{e(i)}),2e3)),"p-2-screen-2":Ho(wpr),"p-2-screen-3":()=>new Promise(e=>e(Ho(Rpr)))},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert2"}},{i18n:{messages:iOt}})}}const Fpr=Object.freeze(Object.defineProperty({__proto__:null,default:Dpr},Symbol.toStringTag,{value:"Module"})),Lpr={class:"rv-geosearch-bar h-26 mb-8 mx-8"},kpr=["placeholder","value","aria-label"],Npr=Zr({__name:"search-bar",setup(t){const{t:e}=qn(),i=hN(),r=C_(),n=Vr(()=>i.searchVal),s=a=>i.setSearchTerm(a),o=Z2(500,a=>{s(a)});return(a,l)=>(Kt(),ci("div",Lpr,[Mt("input",{type:"search",class:"border-b w-full text-base py-8 outline-none focus:shadow-outline border-gray-600 h-full min-w-0",placeholder:Qt(e)("geosearch.searchText"),value:Qt(n),onInput:l[0]||(l[0]=c=>Qt(o)(c.target.value)),onKeyup:l[1]||(l[1]=Ch(c=>{Qt(r).mobileView&&c.target.blur()},["enter"])),"aria-label":Qt(e)("geosearch.searchText"),onKeypress:l[2]||(l[2]=Ch(_a(()=>{},["prevent"]),["enter"])),enterkeyhint:"done"},null,40,kpr)]))}}),$pr={class:"rv-geosearch-top-filters sm:flex items-center w-full ml-8 mb-14"},Bpr={class:"w-fit inline-block sm:w-1/2 h-26 mb-8 sm:mb-0 pr-16 sm:pr-0"},Gpr=["value"],Vpr={value:"",disabled:"",hidden:""},Upr={class:"sm:w-1/2 h-26 sm:mx-16 flex"},jpr=["value"],zpr={value:"",disabled:"",hidden:""},Hpr=["disabled","content"],Wpr=[Mt("div",{class:"rv-geosearch-icon"},[Mt("svg",{class:"fill-current w-18 h-18",viewBox:"0 0 23 21"},[Mt("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)],qpr=Zr({__name:"top-filters",setup(t){const{t:e}=qn(),i=Qs("iApi"),r=hN(),n=Pi([]),s=Pi([]),o=Pi([]),a=Vr(()=>r.queryParams),l=Vr(()=>i.language),c=v=>r.setProvince(v),d=v=>r.setType(v),p=()=>{c({}),d({})},y=()=>{r.initService(i.language,i.fixture.get("geosearch").config);const v=n.value.find(I=>a.value.province===I.name)?.code,S=s.value.find(I=>a.value.type===I.name)?.code;r.getProvinces.then(I=>{n.value=I,c({province:I.find(O=>O.code===v)?.name,forceReRun:!0})}),r.getTypes.then(I=>{s.value=I,d({type:I.find(O=>O.code===S)?.name,forceReRun:!0})})};return pv(()=>{y(),o.value.push(Sc(l,y))}),su(()=>{o.value.forEach(v=>v())}),(v,S)=>{const I=Qn("truncate"),O=Qn("tippy");return Kt(),ci("div",$pr,[Mt("div",Bpr,[Br((Kt(),ci("select",{class:"form-select border-b border-b-gray-600 w-full h-full py-0 cursor-pointer",value:Qt(a).province,onChange:S[0]||(S[0]=L=>c({province:L.target.value}))},[Br((Kt(),ci("option",Vpr,[Fs(gr(Qt(e)("geosearch.filters.province")),1)])),[[I]]),(Kt(!0),ci(eo,null,ou(n.value,L=>Br((Kt(),ci("option",{key:L.code},[Fs(gr(L.name),1)])),[[I]])),128))],40,Gpr)),[[I]])]),Mt("div",Upr,[Br((Kt(),ci("select",{class:"form-select border-b border-b-gray-600 w-full h-full py-0 cursor-pointer max-w-150",value:Qt(a).type,onChange:S[1]||(S[1]=L=>d({type:L.target.value}))},[Mt("option",zpr,gr(Qt(e)("geosearch.filters.type")),1),(Kt(!0),ci(eo,null,ou(s.value,L=>(Kt(),ci("option",{key:L.code},gr(L.name),1))),128))],40,jpr)),[[I]]),Br((Kt(),ci("button",{type:"button",class:"text-gray-400 w-1/8 h-24 pl-8 pr-16 sm:pr-8 hover:text-black disabled:cursor-default disabled:text-gray-400",disabled:!Qt(a).type&&!Qt(a).province,onClick:p,content:Qt(e)("geosearch.filters.clear")},Wpr,8,Hpr)),[[O,{placement:"bottom"}]])])])}}}),Ypr={class:"rv-geosearch-bottom-filters"},Xpr={class:"bg-white"},Kpr={class:"ml-8 cursor-pointer"},Jpr=["checked"],Zpr=Zr({__name:"bottom-filters",setup(t){const{t:e}=qn(),i=Qs("iApi"),r=hN(),n=Vr(()=>r.resultsVisible),s=Z2(300,c=>{a(c).then(d=>{o({extent:d,visible:n.value})})}),o=c=>{r.setMapExtent(c)},a=async c=>c.sr.wkid===4326?c:await i.geo.proj.projectGeometry(4326,c),l=c=>{a(i.geo.map.getExtent()).then(d=>{o({extent:d,visible:c})})};return al(()=>{i.event.on(an.MAP_EXTENTCHANGE,s,"geosearch_map_extent")}),su(()=>{i.event.off("geosearch_map_extent")}),(c,d)=>(Kt(),ci("div",Ypr,[Mt("div",Xpr,[Mt("label",Kpr,[Mt("input",{type:"checkbox",class:"form-checkbox border-2 mx-8 border-gray-600 cursor-pointer",checked:Qt(n),onChange:d[0]||(d[0]=p=>l(p.target.checked)),onKeypress:d[1]||(d[1]=Ch(_a(()=>{},["prevent"]),["enter"]))},null,40,Jpr),Fs(gr(Qt(e)("geosearch.visible")),1)])])]))}}),Z4r="",Qpr={},efr={class:"w-full h-6 relative overflow-hidden rounded-full indeterminate mb-14"},tfr={class:"h-full progressbar bg-blue-800 rounded-full top-0","aria-valuemin":"0","aria-valuemax":"100"},ifr={class:"flex items-center h-full"};function rfr(t,e){return Kt(),ci("div",efr,[Mt("div",tfr,[Mt("span",ifr,[jf(t.$slots,"default",{},void 0,!0)])])])}const nfr=kl(Qpr,[["render",rfr],["__scopeId","data-v-343c5c69"]]),sfr={class:"flex flex-col h-full"},ofr={key:1,class:"text-red-900 text-xs px-8 mb-10"},afr={key:2,class:"px-8 mb-10 truncate"},lfr={class:"relative h-48"},ufr={class:"font-bold text-blue-600"},cfr={key:3,class:"rv-results-list flex-grow mb-5 border-t border-b border-gray-600 overflow-y-auto"},hfr=["onClick"],dfr={class:"rv-result-description px-8"},pfr={class:"flex-1 text-left truncate font-bold"},ffr=["innerHTML"],mfr={key:0,class:"text-gray-600 text-sm"},gfr={key:0,class:"flex-1 text-left truncate text-sm"},rOt=Zr({__name:"screen",props:{panel:{type:Object}},setup(t){const{t:e}=qn(),i=Qs("iApi"),r=hN(),n=Vr(()=>r.searchVal),s=Vr(()=>r.searchResults),o=Vr(()=>r.loadingResults),a=Vr(()=>r.failedServices),l=d=>{let p=new ey("zoomies",[[[d.bbox[0],d.bbox[1]],[d.bbox[0],d.bbox[3]],[d.bbox[2],d.bbox[3]],[d.bbox[2],d.bbox[1]],[d.bbox[0],d.bbox[1]]]],nu.latLongSR(),!0);i.geo.map.zoomMapTo(p)},c=(d,p)=>{const y=d.replace(new RegExp(`${n.value}`,"gi"),v=>''+v+"");return p?y+",":y};return(d,p)=>{const y=Io("panel-screen"),v=Qn("truncate"),S=Qn("focus-item"),I=Qn("focus-list");return Kt(),Pn(y,{panel:t.panel},{header:yn(()=>[Fs(gr(Qt(e)("geosearch.title")),1)]),content:yn(()=>[Mt("div",sfr,[Rn(Npr),Rn(qpr),Qt(o)?(Kt(),Pn(nfr,{key:0,class:"flex-none"})):hn("",!0),Qt(a).length>0&&!Qt(o)?(Kt(),ci("div",ofr,gr(Qt(e)("geosearch.serviceError",{services:Qt(a).join(", ")})),1)):hn("",!0),Qt(n)&&Qt(s).length===0&&!Qt(o)?(Kt(),ci("div",afr,[Mt("span",lfr,[Fs(gr(Qt(e)("geosearch.noResults")),1),Mt("span",ufr,'"'+gr(Qt(n))+'"',1)])])):hn("",!0),Qt(s).length>0?Br((Kt(),ci("ul",cfr,[(Kt(!0),ci(eo,null,ou(Qt(s),(O,L)=>(Kt(),ci("li",{class:"relative h-56",key:L},[Br((Kt(),ci("button",{type:"button",class:"absolute inset-0 h-full w-full hover:bg-gray-300 default-focus-style",onClick:N=>l(O),style:{"border-bottom":"1px solid lightgray"}},[Br((Kt(),ci("div",dfr,[Mt("div",pfr,[Mt("span",{innerHTML:c(O.name,O.location.province)},null,8,ffr),O.location.province?(Kt(),ci("span",mfr,gr(O.location.city?" "+O.location.city+", "+O.location.province.abbr:" "+O.location.province.abbr),1)):hn("",!0)]),O.type?(Kt(),ci("div",gfr,gr(O.type),1)):hn("",!0)])),[[v]])],8,hfr)),[[S,"show-truncate"]])]))),128))])),[[I]]):hn("",!0),Rn(Zpr,{class:"mt-auto"})])]),_:1},8,["panel"])}}}),yfr=Object.freeze(Object.defineProperty({__proto__:null,default:rOt},Symbol.toStringTag,{value:"Module"}));class vfr extends Cc{}const _fr=Mt("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Mt("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"}),Mt("path",{d:"M0 0h24v24H0z",fill:"none"})],-1),bfr=Zr({__name:"nav-button",setup(t){const{t:e}=qn(),i=Qs("iApi"),r=()=>{i?.panel.toggle("geosearch")};return(n,s)=>{const o=Io("mapnav-button");return Kt(),Pn(o,{onClickFunction:r,tooltip:Qt(e)("geosearch.title")},{default:yn(()=>[_fr]),_:1},8,["tooltip"])}}}),wfr={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)"},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":"[fr] [fr]No response from {services} service(s)"}};class xfr extends vfr{async added(){hN(this.$vApp.$pinia).initService(this.$iApi.language,this.config),this.$iApi.component("geosearch-nav-button",bfr),this.$iApi.panel.register({id:"geosearch",config:{screens:{"geosearch-component":Ho(rOt)},button:{tooltip:"geosearch.title",icon:''},alertName:"geosearch.title"}},{i18n:{messages:wfr}})}removed(){this.$iApi.fixture.get("appbar")&&hg(this.$vApp.$pinia).removeButton("geosearch"),this.$iApi.fixture.get("mapnav")&&dD(this.$vApp.$pinia).removeItem("geosearch"),hN(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("geosearch")}}const Sfr=Object.freeze(Object.defineProperty({__proto__:null,default:xfr},Symbol.toStringTag,{value:"Module"}));class nOt{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}}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}}class sOt{constructor(e){this.baseLayer=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.parsecolumns()}parsecolumns(){this.baseLayer.columns&&this.baseLayer.columns.forEach(e=>{this._columns[e.field]=new nOt(e)})}getColumnFilterValue(e,i){const r=this._columns[e].filter;return i==="min"?r.min:i==="max"?r.max:r.value}setColumnFilterValue(e,i,r){let n=i;if(i&&typeof i=="string"){const s=/[(!"#$%&'+,.\\/:;<=>?@[\]^`{|}~)]/g;n=i.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,i])=>{i.filter.static||(i.filter.min=null,i.filter.max=null,i.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}}class Cfr extends Cc{toggleGrid(e,i){const r=iN(this.$vApp.$pinia);let n=r.grids[e];n===void 0&&(n={id:e,state:new sOt({})},r.addGrid(n));const s=r.currentId;r.currentId=e||void 0;const o=this.$iApi.panel.get("grid");if(i===!1){o.close();return}!o.isOpen||!o.isVisible?this.$iApi.panel.open("grid"):s!==e||i===!0?o.show({screen:"grid-screen",props:{key:e}}):o.close()}_parseConfig(){const e=iN(this.$vApp.$pinia);this.handlePanelWidths(["grid"]);const i=this.getLayerFixtureConfigs();Object.keys(i).forEach(r=>{const n={id:r,state:new sOt(i[r])};e.addGrid(n)})}}const Q4r="",eLr="";var DS={};/** +}`,gamma:[1,1,1],mainParameter:"gamma",initialize:function(p){this.gamma=[1,1,1],c.BaseFilter.prototype.initialize.call(this,p)},applyTo2d:function(p){var y=p.imageData,v=y.data,x=this.gamma,I=v.length,P=1/x[0],F=1/x[1],k=1/x[2],j;for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),j=0,I=256;j'},_getCacheCanvasDimensions:function(){var p=this.callSuper("_getCacheCanvasDimensions"),y=this.fontSize;return p.width+=y*p.zoomX,p.height+=y*p.zoomY,p},_render:function(p){var y=this.path;y&&!y.isNotVisible()&&y._render(p),this._setTextStyles(p),this._renderTextLinesBackground(p),this._renderTextDecoration(p,"underline"),this._renderText(p),this._renderTextDecoration(p,"overline"),this._renderTextDecoration(p,"linethrough")},_renderText:function(p){this.paintFirst==="stroke"?(this._renderTextStroke(p),this._renderTextFill(p)):(this._renderTextFill(p),this._renderTextStroke(p))},_setTextStyles:function(p,y,v){if(p.textBaseline="alphabetical",this.path)switch(this.pathAlign){case"center":p.textBaseline="middle";break;case"ascender":p.textBaseline="top";break;case"descender":p.textBaseline="bottom";break}p.font=this._getFontDeclaration(y,v)},calcTextWidth:function(){for(var p=this.getLineWidth(0),y=1,v=this._textLines.length;yp&&(p=x)}return p},_renderTextLine:function(p,y,v,x,I,P){this._renderChars(p,y,v,x,I,P)},_renderTextLinesBackground:function(p){if(!(!this.textBackgroundColor&&!this.styleHas("textBackgroundColor"))){for(var y,v,x=p.fillStyle,I,P,F=this._getLeftOffset(),k=this._getTopOffset(),j=0,V=0,Y,X,Z=this.path,ie,ce=0,he=this._textLines.length;ce=0:vX?V%=X:V<0&&(V+=X),this._setGraphemeOnPath(V,F,Y),V+=F.kernedWidth}return{width:y,numOfSpaces:k}},_setGraphemeOnPath:function(p,y,v){var x=p+y.kernedWidth/2,I=this.path,P=l.util.getPointOnPath(I.path,x,I.segmentsInfo);y.renderLeft=P.x-v.x,y.renderTop=P.y-v.y,y.angle=P.angle+(this.pathSide==="right"?Math.PI:0)},_getGraphemeBox:function(p,y,v,x,I){var P=this.getCompleteStyleDeclaration(y,v),F=x?this.getCompleteStyleDeclaration(y,v-1):{},k=this._measureChar(p,P,x,F),j=k.kernedWidth,V=k.width,Y;this.charSpacing!==0&&(Y=this._getWidthOfCharSpacing(),V+=Y,j+=Y);var X={width:V,left:0,height:P.fontSize,kernedWidth:j,deltaY:P.deltaY};if(v>0&&!I){var Z=this.__charBounds[y][v-1];X.left=Z.left+Z.width+k.kernedWidth-k.width}return X},getHeightOfLine:function(p){if(this.__lineHeights[p])return this.__lineHeights[p];for(var y=this._textLines[p],v=this.getHeightOfChar(p,0),x=1,I=y.length;x0){var Be=Y+P+ie;this.direction==="rtl"&&(Be=this.width-Be-ce),V&&ke&&(p.fillStyle=ke,p.fillRect(Be,Z+Se*x+F,ce,this.fontSize/15)),ie=he.left,ce=he.width,V=_e,ke=Pe,x=I,F=k}else ce+=he.kernedWidth;var Be=Y+P+ie;this.direction==="rtl"&&(Be=this.width-Be-ce),p.fillStyle=Pe,_e&&Pe&&p.fillRect(Be,Z+Se*x+F,ce-de,this.fontSize/15),X+=v}this._removeShadow(p)}},_getFontDeclaration:function(p,y){var v=p||this,x=this.fontFamily,I=l.Text.genericFonts.indexOf(x.toLowerCase())>-1,P=x===void 0||x.indexOf("'")>-1||x.indexOf(",")>-1||x.indexOf('"')>-1||I?v.fontFamily:'"'+v.fontFamily+'"';return[l.isLikelyNode?v.fontWeight:v.fontStyle,l.isLikelyNode?v.fontStyle:v.fontWeight,y?this.CACHE_FONT_SIZE+"px":v.fontSize+"px",P].join(" ")},render:function(p){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",p)))},_splitTextIntoLines:function(p){for(var y=p.split(this._reNewline),v=new Array(y.length),x=[` +`],I=[],P=0;P"u"?this.styles:{line:this.styles[a]};for(var c in l)for(var h in l[c])for(var p in l[c][h])return!1;return!0},styleHas:function(a,l){if(!this.styles||!a||a===""||typeof l<"u"&&!this.styles[l])return!1;var c=typeof l>"u"?this.styles:{0:this.styles[l]};for(var h in c)for(var p in c[h])if(typeof c[h][p][a]<"u")return!0;return!1},cleanStyle:function(a){if(!this.styles||!a||a==="")return!1;var l=this.styles,c=0,h,p,y=!0,v=0,x;for(var I in l){h=0;for(var P in l[I]){var x=l[I][P],F=x.hasOwnProperty(a);c++,F?(p?x[a]!==p&&(y=!1):p=x[a],x[a]===this[a]&&delete x[a]):y=!1,Object.keys(x).length!==0?h++:delete l[I][P]}h===0&&delete l[I]}for(var k=0;k"u"&&(a=this.selectionStart);for(var c=l?this._unwrappedTextLines:this._textLines,h=c.length,p=0;p"u"&&(a=this.selectionStart||0),typeof l>"u"&&(l=this.selectionEnd||a);for(var h=[],p=a;p"u"&&(l=this.selectionStart||0),typeof c>"u"&&(c=this.selectionEnd||l);for(var h=l;h"u"?this[p]:c[p];return h},_setStyleDeclaration:function(a,l,c){this.styles[a][l]=c},_deleteStyleDeclaration:function(a,l){delete this.styles[a][l]},_getLineStyle:function(a){return!!this.styles[a]},_setLineStyle:function(a){this.styles[a]={}},_deleteLineStyle:function(a){delete this.styles[a]}})}(),function(){function a(l){l.textDecoration&&(l.textDecoration.indexOf("underline")>-1&&(l.underline=!0),l.textDecoration.indexOf("line-through")>-1&&(l.linethrough=!0),l.textDecoration.indexOf("overline")>-1&&(l.overline=!0),delete l.textDecoration)}e.IText=e.util.createClass(e.Text,e.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(l,c){this.callSuper("initialize",l,c),this.initBehavior()},setSelectionStart:function(l){l=Math.max(l,0),this._updateAndFire("selectionStart",l)},setSelectionEnd:function(l){l=Math.min(l,this.text.length),this._updateAndFire("selectionEnd",l)},_updateAndFire:function(l,c){this[l]!==c&&(this._fireSelectionChanged(),this[l]=c),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(l){this.clearContextTop(),this.callSuper("render",l),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(l){this.callSuper("_render",l)},clearContextTop:function(l){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var c=this.canvas.contextTop,h=this.canvas.viewportTransform;c.save(),c.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this.transform(c),this._clearTextArea(c),l||c.restore()}},renderCursorOrSelection:function(){if(!(!this.isEditing||!this.canvas||!this.canvas.contextTop)){var l=this._getCursorBoundaries(),c=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(l,c):this.renderSelection(l,c),c.restore()}},_clearTextArea:function(l){var c=this.width+4,h=this.height+4;l.clearRect(-c/2,-h/2,c,h)},_getCursorBoundaries:function(l){typeof l>"u"&&(l=this.selectionStart);var c=this._getLeftOffset(),h=this._getTopOffset(),p=this._getCursorBoundariesOffsets(l);return{left:c,top:h,leftOffset:p.left,topOffset:p.top}},_getCursorBoundariesOffsets:function(l){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var c,h,p,y=0,v=0,x,I=this.get2DCursorLocation(l);p=I.charIndex,h=I.lineIndex;for(var P=0;P0?v:0)},this.direction==="rtl"&&(x.left*=-1),this.cursorOffsetCache=x,this.cursorOffsetCache},renderCursor:function(l,c){var h=this.get2DCursorLocation(),p=h.lineIndex,y=h.charIndex>0?h.charIndex-1:0,v=this.getValueOfPropertyAt(p,y,"fontSize"),x=this.scaleX*this.canvas.getZoom(),I=this.cursorWidth/x,P=l.topOffset,F=this.getValueOfPropertyAt(p,y,"deltaY");P+=(1-this._fontSizeFraction)*this.getHeightOfLine(p)/this.lineHeight-v*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(l,c),c.fillStyle=this.cursorColor||this.getValueOfPropertyAt(p,y,"fill"),c.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,c.fillRect(l.left+l.leftOffset-I/2,P+l.top+F,I,v)},renderSelection:function(l,c){for(var h=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,p=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,y=this.textAlign.indexOf("justify")!==-1,v=this.get2DCursorLocation(h),x=this.get2DCursorLocation(p),I=v.lineIndex,P=x.lineIndex,F=v.charIndex<0?0:v.charIndex,k=x.charIndex<0?0:x.charIndex,j=I;j<=P;j++){var V=this._getLineLeftOffset(j)||0,Y=this.getHeightOfLine(j),X=0,Z=0,ie=0;if(j===I&&(Z=this.__charBounds[I][F].left),j>=I&&j1)&&(Y/=this.lineHeight);var he=l.left+V+Z,_e=ie-Z,xe=Y,Pe=0;this.inCompositionMode?(c.fillStyle=this.compositionColor||"black",xe=1,Pe=Y):c.fillStyle=this.selectionColor,this.direction==="rtl"&&(he=this.width-he-_e),c.fillRect(he,l.top+l.topOffset+Pe,_e,xe),l.topOffset+=X}},getCurrentCharFontSize:function(){var l=this._getCurrentCharIndex();return this.getValueOfPropertyAt(l.l,l.c,"fontSize")},getCurrentCharColor:function(){var l=this._getCurrentCharIndex();return this.getValueOfPropertyAt(l.l,l.c,"fill")},_getCurrentCharIndex:function(){var l=this.get2DCursorLocation(this.selectionStart,!0),c=l.charIndex>0?l.charIndex-1:0;return{l:l.lineIndex,c}}}),e.IText.fromObject=function(l,c){var h=e.util.stylesFromArray(l.styles,l.text),p=Object.assign({},l,{styles:h});if(a(p),p.styles)for(var y in p.styles)for(var v in p.styles[y])a(p.styles[y][v]);e.Object._fromObject("IText",p,c,"text")}}(),function(){var a=e.util.object.clone;e.util.object.extend(e.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var l=this;this.on("added",function(){var c=l.canvas;c&&(c._hasITextHandlers||(c._hasITextHandlers=!0,l._initCanvasHandlers(c)),c._iTextInstances=c._iTextInstances||[],c._iTextInstances.push(l))})},initRemovedHandler:function(){var l=this;this.on("removed",function(){var c=l.canvas;c&&(c._iTextInstances=c._iTextInstances||[],e.util.removeFromArray(c._iTextInstances,l),c._iTextInstances.length===0&&(c._hasITextHandlers=!1,l._removeCanvasHandlers(c)))})},_initCanvasHandlers:function(l){l._mouseUpITextHandler=function(){l._iTextInstances&&l._iTextInstances.forEach(function(c){c.__isMousedown=!1})},l.on("mouse:up",l._mouseUpITextHandler)},_removeCanvasHandlers:function(l){l.off("mouse:up",l._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(l,c,h,p){var y;return y={isAborted:!1,abort:function(){this.isAborted=!0}},l.animate("_currentCursorOpacity",c,{duration:h,onComplete:function(){y.isAborted||l[p]()},onChange:function(){l.canvas&&l.selectionStart===l.selectionEnd&&l.renderCursorOrSelection()},abort:function(){return y.isAborted}}),y},_onTickComplete:function(){var l=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){l._currentTickCompleteState=l._animateCursor(l,0,this.cursorDuration/2,"_tick")},100)},initDelayedCursor:function(l){var c=this,h=l?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){c._tick()},h)},abortCursorAnimation:function(){var l=this._currentTickState||this._currentTickCompleteState,c=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,l&&c&&c.clearContext(c.contextTop||c.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(l){var c=0,h=l-1;if(this._reSpace.test(this._text[h]))for(;this._reSpace.test(this._text[h]);)c++,h--;for(;/\S/.test(this._text[h])&&h>-1;)c++,h--;return l-c},findWordBoundaryRight:function(l){var c=0,h=l;if(this._reSpace.test(this._text[h]))for(;this._reSpace.test(this._text[h]);)c++,h++;for(;/\S/.test(this._text[h])&&h-1;)c++,h--;return l-c},findLineBoundaryRight:function(l){for(var c=0,h=l;!/\n/.test(this._text[h])&&h0&&pthis.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=c):(this.selectionStart=c,this.selectionEnd=this.__selectionStartOnMouseDown),(this.selectionStart!==h||this.selectionEnd!==p)&&(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(l,c,h){var p=h.slice(0,l),y=e.util.string.graphemeSplit(p).length;if(l===c)return{selectionStart:y,selectionEnd:y};var v=h.slice(l,c),x=e.util.string.graphemeSplit(v).length;return{selectionStart:y,selectionEnd:y+x}},fromGraphemeToStringSelection:function(l,c,h){var p=h.slice(0,l),y=p.join("").length;if(l===c)return{selectionStart:y,selectionEnd:y};var v=h.slice(l,c),x=v.join("").length;return{selectionStart:y,selectionEnd:y+x}},_updateTextarea:function(){if(this.cursorOffsetCache={},!!this.hiddenTextarea){if(!this.inCompositionMode){var l=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=l.selectionStart,this.hiddenTextarea.selectionEnd=l.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var l=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=l.selectionEnd,this.inCompositionMode||(this.selectionStart=l.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var l=this._calcTextareaPosition();this.hiddenTextarea.style.left=l.left,this.hiddenTextarea.style.top=l.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var l=this.inCompositionMode?this.compositionStart:this.selectionStart,c=this._getCursorBoundaries(l),h=this.get2DCursorLocation(l),p=h.lineIndex,y=h.charIndex,v=this.getValueOfPropertyAt(p,y,"fontSize")*this.lineHeight,x=c.leftOffset,I=this.calcTransformMatrix(),P={x:c.left+x,y:c.top+c.topOffset+v},F=this.canvas.getRetinaScaling(),k=this.canvas.upperCanvasEl,j=k.width/F,V=k.height/F,Y=j-v,X=V-v,Z=k.clientWidth/j,ie=k.clientHeight/V;return P=e.util.transformPoint(P,I),P=e.util.transformPoint(P,this.canvas.viewportTransform),P.x*=Z,P.y*=ie,P.x<0&&(P.x=0),P.x>Y&&(P.x=Y),P.y<0&&(P.y=0),P.y>X&&(P.y=X),P.x+=this.canvas._offset.left,P.y+=this.canvas._offset.top,{left:P.x+"px",top:P.y+"px",fontSize:v+"px",charHeight:v}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var l=this._textBeforeEdit!==this.text,c=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,c&&(c.blur&&c.blur(),c.parentNode&&c.parentNode.removeChild(c)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),l&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),l&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var l in this.styles)this._textLines[l]||delete this.styles[l]},removeStyleFromTo:function(l,c){var h=this.get2DCursorLocation(l,!0),p=this.get2DCursorLocation(c,!0),y=h.lineIndex,v=h.charIndex,x=p.lineIndex,I=p.charIndex,P,F;if(y!==x){if(this.styles[y])for(P=v;P=I&&(F[j-k]=F[V],delete F[V])}},shiftLineStyles:function(l,c){var h=a(this.styles);for(var p in this.styles){var y=parseInt(p,10);y>l&&(this.styles[y+c]=h[y],h[y-c]||delete this.styles[y])}},restartCursorIfNeeded:function(){(!this._currentTickState||this._currentTickState.isAborted||!this._currentTickCompleteState||this._currentTickCompleteState.isAborted)&&this.initDelayedCursor()},insertNewlineStyleObject:function(l,c,h,p){var y,v={},x=!1,I=this._unwrappedTextLines[l].length===c;h||(h=1),this.shiftLineStyles(l,h),this.styles[l]&&(y=this.styles[l][c===0?c:c-1]);for(var P in this.styles[l]){var F=parseInt(P,10);F>=c&&(x=!0,v[F-c]=this.styles[l][P],I&&c===0||delete this.styles[l][P])}var k=!1;for(x&&!I&&(this.styles[l+h]=v,k=!0),k&&h--;h>0;)p&&p[h-1]?this.styles[l+h]={0:a(p[h-1])}:y?this.styles[l+h]={0:a(y)}:delete this.styles[l+h],h--;this._forceClearCache=!0},insertCharStyleObject:function(l,c,h,p){this.styles||(this.styles={});var y=this.styles[l],v=y?a(y):{};h||(h=1);for(var x in v){var I=parseInt(x,10);I>=c&&(y[I+h]=v[I],v[I-h]||delete y[I])}if(this._forceClearCache=!0,p){for(;h--;)Object.keys(p[h]).length&&(this.styles[l]||(this.styles[l]={}),this.styles[l][c+h]=a(p[h]));return}if(y)for(var P=y[c?c-1:1];P&&h--;)this.styles[l][c+h]=a(P)},insertNewStyleBlock:function(l,c,h){for(var p=this.get2DCursorLocation(c,!0),y=[0],v=0,x=0;x0&&(this.insertCharStyleObject(p.lineIndex,p.charIndex,y[0],h),h=h&&h.slice(y[0]+1)),v&&this.insertNewlineStyleObject(p.lineIndex,p.charIndex+y[0],v);for(var x=1;x0?this.insertCharStyleObject(p.lineIndex+x,0,y[x],h):h&&this.styles[p.lineIndex+x]&&h[0]&&(this.styles[p.lineIndex+x][0]=h[0]),h=h&&h.slice(y[x]+1);y[x]>0&&this.insertCharStyleObject(p.lineIndex+x,0,y[x],h)},setSelectionStartEndWithShift:function(l,c,h){h<=l?(c===l?this._selectionDirection="left":this._selectionDirection==="right"&&(this._selectionDirection="left",this.selectionEnd=l),this.selectionStart=h):h>l&&hl?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),c=this.selectionStart,h=this.selectionEnd;a.shiftKey?this.setSelectionStartEndWithShift(c,h,l):(this.selectionStart=l,this.selectionEnd=l),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(a){for(var l=this.getLocalPointer(a),c=0,h=0,p=0,y=0,v=0,x,I,P=0,F=this._textLines.length;P0&&(y+=this._textLines[P-1].length+this.missingNewlineOffset(P-1));x=this._getLineLeftOffset(v),h=x*this.scaleX,I=this._textLines[v],this.direction==="rtl"&&(l.x=this.width*this.scaleX-l.x+h);for(var k=0,j=I.length;ky||v<0?0:1,I=h+x;return this.flipX&&(I=p-I),I>this._text.length&&(I=this._text.length),I}}),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 c=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,h=this._text.length,p=c.length,y,v,x=p-h,I=this.selectionStart,P=this.selectionEnd,F=I!==P,k,j,V;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 Y=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),X=I>Y.selectionStart;F?(y=this._text.slice(I,P),x+=P-I):p0&&(h=this.__charBounds[a][l-1],c+=h.left+h.width),c},getDownCursorOffset:function(a,l){var c=this._getSelectionForOffset(a,l),h=this.get2DCursorLocation(c),p=h.lineIndex;if(p===this._textLines.length-1||a.metaKey||a.keyCode===34)return this._text.length-c;var y=h.charIndex,v=this._getWidthBeforeCursor(p,y),x=this._getIndexOnLine(p+1,v),I=this._textLines[p].slice(y);return I.length+x+1+this.missingNewlineOffset(p)},_getSelectionForOffset:function(a,l){return a.shiftKey&&this.selectionStart!==this.selectionEnd&&l?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(a,l){var c=this._getSelectionForOffset(a,l),h=this.get2DCursorLocation(c),p=h.lineIndex;if(p===0||a.metaKey||a.keyCode===33)return-c;var y=h.charIndex,v=this._getWidthBeforeCursor(p,y),x=this._getIndexOnLine(p-1,v),I=this._textLines[p].slice(0,y),P=this.missingNewlineOffset(p-1);return-this._textLines[p-1].length+x-I.length+(1-P)},_getIndexOnLine:function(a,l){for(var c=this._textLines[a],h=this._getLineLeftOffset(a),p=h,y=0,v,x,I=0,P=c.length;Il){x=!0;var F=p-v,k=p,j=Math.abs(F-l),V=Math.abs(k-l);y=V=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 c="get"+a+"CursorOffset",h=this[c](l,this._selectionDirection==="right");l.shiftKey?this.moveCursorWithShift(h):this.moveCursorWithoutShift(h),h!==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,c){var h;if(a.altKey)h=this["findWordBoundary"+c](this[l]);else if(a.metaKey||a.keyCode===35||a.keyCode===36)h=this["findLineBoundary"+c](this[l]);else return this[l]+=c==="Left"?-1:1,!0;if(typeof h<"u"&&this[l]!==h)return this[l]=h,!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 c="moveCursor"+a+"With";this._currentCursorOpacity=1,l.shiftKey?c+="Shift":c+="outShift",this[c](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,c,h){typeof h>"u"&&(h=c),h>c&&this.removeStyleFromTo(c,h);var p=e.util.string.graphemeSplit(a);this.insertNewStyleBlock(p,c,l),this._text=[].concat(this._text.slice(0,c),p,this._text.slice(h)),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 c=this._getSVGLeftTopOffsets(),h=this._getSVGTextAndBg(c.textTop,c.textLeft);return this._wrapSVGTextAndBg(h)},toSVG:function(c){return this._createBaseSVGMarkup(this._toSVG(),{reviver:c,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(c){var h=!0,p=this.getSvgTextDecoration(this);return[c.textBgRects.join(""),' ",c.textSpans.join(""),` +`]},_getSVGTextAndBg:function(c,h){var p=[],y=[],v=c,x;this._setSVGBg(y);for(var I=0,P=this._textLines.length;I",e.util.string.escapeXml(c),""].join("")},_setSVGTextLineText:function(c,h,p,y){var v=this.getHeightOfLine(h),x=this.textAlign.indexOf("justify")!==-1,I,P,F="",k,j,V=0,Y=this._textLines[h],X;y+=v*(1-this._fontSizeFraction)/this.lineHeight;for(var Z=0,ie=Y.length-1;Z<=ie;Z++)X=Z===ie||this.charSpacing,F+=Y[Z],k=this.__charBounds[h][Z],V===0?(p+=k.kernedWidth-k.width,V+=k.width):V+=k.kernedWidth,x&&!X&&this._reSpaceAndTab.test(Y[Z])&&(X=!0),X||(I=I||this.getCompleteStyleDeclaration(h,Z),P=this.getCompleteStyleDeclaration(h,Z+1),X=e.util.hasStyleChanged(I,P,!0)),X&&(j=this._getStyleDeclaration(h,Z)||{},c.push(this._createTextCharSpan(F,j,p,y)),F="",I=P,p+=V,V=0)},_pushTextBgRect:function(c,h,p,y,v,x){var I=e.Object.NUM_FRACTION_DIGITS;c.push(" +`)},_setSVGTextLineBg:function(c,h,p,y){for(var v=this._textLines[h],x=this.getHeightOfLine(h)/this.lineHeight,I=0,P=0,F,k,j=this.getValueOfPropertyAt(h,0,"textBackgroundColor"),V=0,Y=v.length;Vthis.width&&this._set("width",this.dynamicMinWidth),this.textAlign.indexOf("justify")!==-1&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(c){for(var h=0,p=0,y=0,v={},x=0;x0?(p=0,y++,h++):!this.splitByGrapheme&&this._reSpaceAndTab.test(c.graphemeText[y])&&x>0&&(p++,y++),v[x]={line:h,offset:p},y+=c.graphemeLines[x].length,p+=c.graphemeLines[x].length;return v},styleHas:function(c,h){if(this._styleMap&&!this.isWrapping){var p=this._styleMap[h];p&&(h=p.line)}return l.Text.prototype.styleHas.call(this,c,h)},isEmptyStyles:function(c){if(!this.styles)return!0;var h=0,p=c+1,y,v,x=!1,I=this._styleMap[c],P=this._styleMap[c+1];I&&(c=I.line,h=I.offset),P&&(p=P.line,x=p===c,y=P.offset),v=typeof c>"u"?this.styles:{line:this.styles[c]};for(var F in v)for(var k in v[F])if(k>=h&&(!x||kp&&!ie?(I.push(P),P=[],v=Y,ie=!0):v+=ce,!ie&&!x&&P.push(V),P=P.concat(k),X=x?0:this._measureWord([V],h,j),j++,ie=!1,Y>Z&&(Z=Y);return _e&&I.push(P),Z+he>this.dynamicMinWidth&&(this.dynamicMinWidth=Z-ce+he),I},isEndOfWrapping:function(c){return!this._styleMap[c+1]||this._styleMap[c+1].line!==this._styleMap[c].line},missingNewlineOffset:function(c){return this.splitByGrapheme?this.isEndOfWrapping(c)?1:0:1},_splitTextIntoLines:function(c){for(var h=l.Text.prototype._splitTextIntoLines.call(this,c),p=this._wrapText(h.lines,this.width),y=new Array(p.length),v=0;v{p>0&&(s+=tpr),c.top=s,s+=c.height+ipr;const y=h.map(({title:v,items:x},I)=>{const P=[];return v&&!(h.length===1&&v.text===c.text)&&(I>0&&(s+=rpr),v.top=s,s+=v.height+npr,P.push(v)),x.forEach(F=>{F.top=s,s+=F.height+spr}),[...P,...x].filter(F=>F)});return new Nd.fabric.Group([c,...y.flat()])}).flat(),l=this._makeColumns(a,n,r);return Promise.resolve(l)}_makeColumns(e,i,r){let n=0,s=0,o=0;const a=e[e.length-1].aCoords.bl.y/r;return e.forEach((l,c)=>{const h=c!==e.length-1?e[c+1].top-l.top:l.height,p=o>a*(n+1),y=s!==0&&h>a,v=r-n>e.length-c;(p||y||v)&&n{const n=new Nd.fabric.Textbox(r.name,{fontSize:24,fontFamily:Oee,width:i}),s=this._getLayerTreeIds(r);let o=[];return o=r.supportsSublayers?await Promise.all(this._makeSegmentChunks(s,r,i)):await Promise.all(this._makeSegmentChunks([-1],r,i)),{title:n,items:o}})}_makeSegmentChunks(e,i,r){const n=i;return e.map(async s=>{const o=s===-1?n:n.getSublayer(s);if(!o)return{title:new Nd.fabric.Textbox("ERROR",{fontSize:20,fontFamily:Oee,width:r}),items:[]};await Promise.all(o.legend.map(h=>h.drawPromise));const a=o.legend,l=new Nd.fabric.Textbox(o.name,{fontSize:20,fontFamily:Oee,width:r}),c=await Promise.all(this._makeChunkItems(a,r));return{title:l,items:c}})}_makeChunkItems(e,i){return e.map(async r=>{const n=(await lpr(Nd.fabric.loadSVGFromString)(r.svgcode))[0];if(r.esriStandard){n.originY="center",n.top=l7/2;const s=new Nd.fabric.Textbox(r.label,{fontSize:12,fontFamily:Oee,originY:"center",left:SOt+20,top:l7/2,width:i-SOt-20});return new Nd.fabric.Group([n,s],{height:l7})}else{const s=new Nd.fabric.Textbox(r.label,{fontSize:12,fontFamily:Oee,originY:"center",left:0,top:l7/2,width:i}),o=Number(r.imgWidth),a=Number(r.imgHeight),l=Math.min(1,i/o);return n&&(n.originY="center",n.top=a*l/2+l7,n.scaleToHeight(a*l),n.scaleToWidth(o*l)),new Nd.fabric.Group([s,n].filter(Boolean),{height:a*l+l7})}})}_getLayerTreeIds(e){const i=[],r=[...e.sublayers];for(;r.length>0;){const n=r.shift();n&&(n.visibility&&i.push(n.layerIdx),r.push(...n.sublayers))}return i}}const lpr=t=>e=>new Promise(i=>{t(e,r=>{i(r)})}),upr=Object.freeze(Object.defineProperty({__proto__:null,default:apr},Symbol.toStringTag,{value:"Module"}));class cpr extends Ac{get config(){return this.$iApi.fixture.get("export").config?.map}async make(e){const i=await this.$iApi.geo.map.takeScreenshot({quality:1,format:"png"}),r=new Image;r.src=i.dataUrl;const n=await new Promise(s=>r.onload=()=>s(r));return new Nd.fabric.Image(n,e)}}const hpr=Object.freeze(Object.defineProperty({__proto__:null,default:cpr},Symbol.toStringTag,{value:"Module"}));class dpr extends Ac{get config(){return this.$iApi.fixture.get("export").config?.mapElements}async make(e){const i='N',r=document.querySelector(".inner-shell"),n=this.$iApi.geo.map.getSR();let s=0;if(n.isWebMercator())s=0;else{const c=new iy("pole",{x:-96,y:90}),h=await this.$iApi.geo.proj.projectGeometry(n,c),p=this.$iApi.geo.map.mapPointToScreenPoint(h),y={screenX:r.clientWidth/2,screenY:r.clientHeight};s=Math.atan((p.screenX-y.screenX)/(y.screenY-p.screenY))*180/Math.PI}const o={top:0,left:0,originX:"center",originY:"center",angle:s},a=[];let l=new Nd.fabric.Group;return Nd.fabric.loadSVGFromString(i,()=>{l=new Nd.fabric.Group(a)},(c,h)=>{a.push(h)}),l.set(uue(o,e||{})),Promise.resolve(l)}}const ppr=Object.freeze(Object.defineProperty({__proto__:null,default:dpr},Symbol.toStringTag,{value:"Module"}));class fpr extends Ac{get config(){return this.$iApi.fixture.get("export").config?.mapElements}make(e){const i=this.$iApi.geo.map.caption.scaleHelper(),r=[];for(let n=0;n<2;n++){const s=new Nd.fabric.Text(this.$iApi.$i18n.t("export.scaleBar.approx",[`${this.$iApi.$i18n.n(i[n].distance,"number")}${i[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 Nd.fabric.Line([0,n===0?30:40,i[n].pixels,n===0?30:40],{stroke:"black",strokeWidth:3});r.push(new Nd.fabric.Group([o,s]))}return Promise.resolve(new Nd.fabric.Group(r,e))}}const mpr=Object.freeze(Object.defineProperty({__proto__:null,default:fpr},Symbol.toStringTag,{value:"Module"}));class gpr extends Ac{get config(){return this.$iApi.fixture.get("export").config?.title}make(e){const i=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"};i&&(r.text=i.value);const n=uue(r,e||{}),s=new Nd.fabric.Textbox(n.text,n);return Promise.resolve(s)}}const ypr=Object.freeze(Object.defineProperty({__proto__:null,default:gpr},Symbol.toStringTag,{value:"Module"}));var COt={exports:{}};(function(t,e){(function(i,r){r()})(Jh,function(){function i(c,h){return typeof h>"u"?h={autoBom:!1}:typeof h!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),h={autoBom:!h}),h.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function r(c,h,p){var y=new XMLHttpRequest;y.open("GET",c),y.responseType="blob",y.onload=function(){l(y.response,h,p)},y.onerror=function(){console.error("could not download file")},y.send()}function n(c){var h=new XMLHttpRequest;h.open("HEAD",c,!1);try{h.send()}catch{}return 200<=h.status&&299>=h.status}function s(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var h=document.createEvent("MouseEvents");h.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(h)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Jh=="object"&&Jh.global===Jh?Jh: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(c,h,p){var y=o.URL||o.webkitURL,v=document.createElement("a");h=h||c.name||"download",v.download=h,v.rel="noopener",typeof c=="string"?(v.href=c,v.origin===location.origin?s(v):n(v.href)?r(c,h,p):s(v,v.target="_blank")):(v.href=y.createObjectURL(c),setTimeout(function(){y.revokeObjectURL(v.href)},4e4),setTimeout(function(){s(v)},0))}:"msSaveOrOpenBlob"in navigator?function(c,h,p){if(h=h||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(i(c,p),h);else if(n(c))r(c,h,p);else{var y=document.createElement("a");y.href=c,y.target="_blank",setTimeout(function(){s(y)})}}:function(c,h,p,y){if(y=y||open("","_blank"),y&&(y.document.title=y.document.body.innerText="downloading..."),typeof c=="string")return r(c,h,p);var v=c.type==="application/octet-stream",x=/constructor/i.test(o.HTMLElement)||o.safari,I=/CriOS\/[\d]+/.test(navigator.userAgent);if((I||v&&x||a)&&typeof FileReader<"u"){var P=new FileReader;P.onloadend=function(){var j=P.result;j=I?j:j.replace(/^data:[^;]*;/,"data:attachment/file;"),y?y.location.href=j:location=j,y=null},P.readAsDataURL(c)}else{var F=o.URL||o.webkitURL,k=F.createObjectURL(c);y?y.location=k:location.href=k,y=null,setTimeout(function(){F.revokeObjectURL(k)},4e4)}});o.saveAs=l.saveAs=l,t.exports=l})})(COt);var vpr=COt.exports;const _pr=MT(vpr);Nd.fabric.Object.prototype.objectCaching=!1;const eye=1200,_x={TOP:40,RIGHT:40,BOTTOM:40,LEFT:40};class bpr extends Ac{fcFabric;fcFabricDownload;options={runningHeight:0,scale:1};get config(){return super.config}_parseConfig(e){if(!e)return;const i=Tj(this.$vApp.$pinia);i.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},i.fileName=e.fileName||"",this.handlePanelWidths(["export"]),this.handlePanelTeleports(["export"])}getSubFixture(e){return this.$iApi.fixture.get(e)}async make(e,i){const r=Tj(this.$vApp.$pinia);this.fcFabric=new Nd.fabric.StaticCanvas(e,{backgroundColor:"#fff"}),this.fcFabricDownload=new Nd.fabric.StaticCanvas(null,{backgroundColor:"#fff"}),this.options.runningHeight=0;const n=r.componentSelectedState,s=this.getSubFixture("export-title"),o=this.getSubFixture("export-map"),a=this.getSubFixture("export-scalebar"),l=this.getSubFixture("export-northarrow"),c=this.getSubFixture("export-legend");let h,p,y,v,x;const I=[];n.title&&(h=await s.make({top:this.options.runningHeight,left:0,originX:"left",width:i,textAlign:"center"}),this.options.runningHeight+=h.height+40,I.push(h)),n.map&&(p=await o.make({top:this.options.runningHeight}),h&&(h.left=p.width/2,h.originX="center"),this.options.runningHeight+=p.height+40,I.push(p)),!p&&h&&(h.width=eye),this.options.scale=i/((p?.width??eye)+_x.LEFT+_x.RIGHT),n.mapElements&&(y=await a.make({top:this.options.runningHeight,left:0}),this.options.runningHeight+=y.height+40,I.push(y),v=await l.make({top:y.top,left:i/this.options.scale}),v.top+=v.height/2-20,v.left+=-v.width*2,I.push(v)),n.legend&&(x=await c.make({width:c.config?.columnWidth??p?.width??eye}),x.top=this.options.runningHeight,this.options.runningHeight+=x.height,I.push(x));const P=new Nd.fabric.Group(I,{top:_x.TOP*this.options.scale,left:_x.LEFT*this.options.scale}),F=await new Promise(k=>{P.clone(j=>{k(j)})});F.top=_x.TOP,F.left=_x.LEFT,this.fcFabricDownload.add(F),P.scale(this.options.scale),this.fcFabric.add(P),this.fcFabric.setDimensions({width:i,height:(this.options.runningHeight+_x.TOP+_x.BOTTOM)*this.options.scale}),this.fcFabric.renderAll(),this.fcFabricDownload.setDimensions({width:(p?.width??eye)+_x.LEFT+_x.RIGHT,height:this.options.runningHeight+_x.TOP+_x.BOTTOM}),this.fcFabricDownload.renderAll()}export(){if(!this.fcFabric)return;const e=new Date,i=this.config?.fileName||`map-carte - ${e.getFullYear()}-${e.getMonth()}-${e.getDay()}, ${e.getHours()}_${e.getMinutes()}`;_pr.saveAs(this.fcFabricDownload.toDataURL({format:"png",quality:1}),`${i}.png`)}}const wpr=Dt("div",{class:"flex items-center text-gray-400 w-full h-full hover:text-black p-4 sm:p-8"},[Dt("svg",{class:"fill-current w-24 h-24 m-auto",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Dt("g",null,[Dt("path",{d:"M0,0h24v24H0V0z",fill:"none"}),Dt("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),xpr=["onClick","aria-label"],Spr={class:"md-icon-small inline"},Cpr=[Dt("g",null,[Dt("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})],-1)],Tpr=an({__name:"settings-button",props:{componentSelectedState:{type:Object,required:!0}},emits:["onComponentToggle"],setup(t,{emit:e}){const{t:i}=ns(),r=ay(),n=Tj(),s=Jr(()=>r.mobileView?"top-end":"left-end"),o=a=>{a.selectable&&(n.toggleSelected({name:a.name}),e("onComponentToggle"))};return(a,l)=>{const c=Vo("dropdown-menu"),h=as("focus-item");return Zr((Qt(),Bn(c,{position:s.value,tooltip:vi(i)("export.menu"),"tooltip-placement":"top"},{header:En(()=>[wpr]),default:En(()=>[(Qt(!0),hi(po,null,fu(t.componentSelectedState,p=>(Qt(),hi("a",{key:p.name,onClick:y=>o(p),href:"javascript:;",class:ms(`text-left text-sm sm:text-base ${p.selectable?"cursor-pointer":"cursor-default"}`),"aria-label":p.name},[Dt("div",Spr,[(Qt(),hi("svg",{height:"20",width:"20",viewBox:"0 0 24 24",class:ms(`inline mx-8 ${p.selected?"":"invisible"}`)},Cpr,2)),Dt("span",{class:ms(`inline ${p.selectable?"":"text-gray-300"} + `)},xr(vi(i)(`export.menu.component.${p.name}`)),3)])],10,xpr))),128))]),_:1},8,["position","tooltip"])),[[h]])}}}),Epr=Dt("div",{class:"overflow-hidden border border-gray-200"},[Dt("canvas",{class:"export-canvas"})],-1),Ipr={class:"flex"},Apr=["aria-label"],Ppr=["aria-label"],TOt=an({__name:"screen",props:{panel:{type:Object,required:!0}},setup(t){const{t:e}=ns(),i=no("iApi"),r=Tj(),n=Mi(),s=Mi(void 0),o=Jr(()=>Up()?.proxy?.$el),a=Jr(()=>r.componentSelectedState),l=Jr(()=>{let h={};return n.value&&Object.keys(a.value).forEach(p=>{h[p]={name:p,selected:a.value[p]??!1,selectable:(n.value?.config)[p]?.selectable??!0}}),h}),c=Z2(300,()=>{if(!n.value)return;const h=o.value.querySelector(".export-canvas");n.value.make(h,o.value.clientWidth-16)});return Ja(()=>{n.value=i.fixture.get("export"),s.value=new ResizeObserver(()=>{c()}),s.value.observe(o.value)}),Ll(()=>{s.value.disconnect()}),(h,p)=>{const y=Vo("panel-screen");return Qt(),Bn(y,{panel:t.panel,footer:!0},{header:En(()=>[ks(xr(vi(e)("export.title")),1)]),content:En(()=>[Epr]),footer:En(()=>[Dt("div",Ipr,[Dt("button",{type:"button",onClick:p[0]||(p[0]=v=>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":vi(e)("export.download")},xr(vi(e)("export.download")),9,Apr),Dt("button",{type:"button",onClick:p[1]||(p[1]=v=>vi(c)()),class:"py-8 px-4 sm:px-16","aria-label":vi(e)("export.refresh")},xr(vi(e)("export.refresh")),9,Ppr),Un(Tpr,{componentSelectedState:l.value,onComponentToggle:vi(c)(),class:"ml-auto flex px-4 sm:px-8"},null,8,["componentSelectedState","onComponentToggle"])])]),_:1},8,["panel"])}}}),Opr=Object.freeze(Object.defineProperty({__proto__:null,default:TOt},Symbol.toStringTag,{value:"Module"})),Rpr={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 Mpr extends bpr{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")}added(){this.$iApi.panel.register({id:"export",config:{screens:{"export-screen":ya(TOt)},style:{"flex-grow":"1","max-width":"800px"},button:{tooltip:"export.title",icon:''},alertName:"export.alertName"}},{i18n:{messages:Rpr}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,i=>this._parseConfig(i));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("appbar")&&mg(this.$vApp.$pinia).removeButton("export"),Tj(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("export")}}}const Dpr=Object.freeze(Object.defineProperty({__proto__:null,default:Mpr},Symbol.toStringTag,{value:"Module"})),Fpr=an({__name:"appbar-button",props:{options:{type:Object}},setup(t){const e=no("iApi"),i=()=>{e.panel.toggle({id:"p2",screen:"p-2-screen-2"})};return(r,n)=>{const s=Vo("appbar-button",!0);return Qt(),Bn(s,{onClickFunction:i,tooltip:"Gazebo"},{default:En(()=>[Dt("span",{style:nb({color:t.options?.colour??"#BDBDBD"})},"G ",4)]),_:1})}}}),Lpr=Dt("a",{href:"javascript:;"},"Option 1",-1),Npr=Dt("a",{href:"javascript:;"},"Option 2",-1),kpr=Dt("a",{href:"javascript:;"},"Option 3",-1),$pr={class:"flex flex-col items-center"},Bpr=Dt("br",null,null,-1),Vpr=Dt("img",{src:"https://c.tenor.com/RJ3ZG5beDhIAAAAC/napoleon-dynamite-napoleon.gif",alt:"Gazebo1"},null,-1),jpr=an({__name:"p1-screen-1",props:{panel:{type:Object,required:!0}},setup(t){return(e,i)=>{const r=Vo("panel-screen");return Qt(),Bn(r,{panel:t.panel},{header:En(()=>[ks(" Gazebo/Panel 1/Screen A ")]),controls:En(()=>[Lpr,Npr,kpr]),content:En(()=>[Dt("div",$pr,[Dt("button",{type:"button",onClick:i[0]||(i[0]=n=>t.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 "),Bpr,Vpr])]),_:1},8,["panel"])}}}),Gpr={class:"flex flex-col items-center"},Upr=Dt("br",null,null,-1),zpr=Dt("img",{src:"http://nesn.com/wp-content/uploads/2014/09/jeternephew.gif",alt:"Gazebo2"},null,-1),Hpr=an({__name:"p1-screen-2",props:{panel:{type:Object,required:!0}},setup(t){return(e,i)=>{const r=Vo("panel-screen");return Qt(),Bn(r,{panel:t.panel},{header:En(()=>[ks(" Gazebo/Panel 1/Screen B ")]),content:En(()=>[Dt("div",Gpr,[Dt("button",{type:"button",onClick:i[0]||(i[0]=n=>t.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 "),Upr,zpr])]),_:1},8,["panel"])}}}),Wpr={class:"flex flex-row justify-center items-center mt-16"},qpr={class:"mt-16"},Ypr=an({__name:"p2-screen-2",props:{panel:{type:Object,required:!0},greeting:{type:String}},setup(t){const e=t,{t:i}=ns(),r=no("iApi"),n=()=>{e.panel.show("p-2-screen-3"),r.event.emit("gazebo/beholdMyText","I am a cat")};return(s,o)=>{const a=Vo("panel-screen");return Qt(),Bn(a,{panel:t.panel},{header:En(()=>[ks(" Gazebo/Panel 2/Screen B ")]),content:En(()=>[ks(xr(vi(i)("gz.hello2"))+" ",1),Dt("div",Wpr,[Dt("button",{type:"button",onClick:o[0]||(o[0]=l=>t.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 "),Dt("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 ")]),Dt("p",qpr,xr(t.greeting),1)]),_:1},8,["panel"])}}}),Xpr={class:"flex flex-col items-center mt-16"},Kpr=Dt("img",{class:"my-16",src:"https://media.giphy.com/media/iWkHDNtcHpB5e/giphy.gif",alt:"",srcset:""},null,-1),Jpr=Dt("p",null,"Locale merging:",-1),Zpr=Dt("dt",null,"global locale:",-1),Qpr={class:"ml-32 font-bold"},efr=Dt("dt",null,"fixture locale:",-1),tfr={class:"ml-32 font-bold"},ifr=Dt("dt",null,"common panels locale:",-1),rfr={class:"ml-32 font-bold"},nfr=an({__name:"p2-screen-3",props:{panel:{type:Object,required:!0}},setup(t){const{t:e}=ns({messages:{en:{lang_native:"En",who:"[me cat]"},fr:{lang_native:"Fr",who:"[moi chat]"}}});return(i,r)=>{const n=Vo("panel-screen");return Qt(),Bn(n,{panel:t.panel},{header:En(()=>[ks(" Gazebo/Panel 2/Screen C ")]),content:En(()=>[Dt("div",Xpr,[Dt("button",{type:"button",onClick:r[0]||(r[0]=s=>t.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 "),Kpr,Jpr,Dt("dl",null,[Zpr,Dt("dd",Qpr,xr(vi(e)("lang_native")),1),efr,Dt("dd",tfr,xr(vi(e)("gz.hello")),1),ifr,Dt("dd",rfr,xr(vi(e)("who")),1)])])]),_:1},8,["panel"])}}}),EOt={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"}},sfr="gazebo/beholdMyText";class ofr extends Ac{added(){this.$iApi.event.registerEventName(sfr),this.$iApi.component("gazebo-appbar-button",Fpr),this.$iApi.panel.register({id:"p1",config:{screens:{"p-1-screen-1":ya(jpr),"p-1-screen-2":ya(Hpr)},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert1"}},{i18n:{messages:EOt}}),this.$iApi.panel.register({id:"p2",config:{screens:{"p-2-screen-1":()=>new Promise(e=>setTimeout(()=>Promise.resolve().then(()=>mOr).then(i=>{e(i)}),2e3)),"p-2-screen-2":ya(Ypr),"p-2-screen-3":()=>new Promise(e=>e(ya(nfr)))},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert2"}},{i18n:{messages:EOt}}),this.handlePanelTeleports(["p1","p2"])}}const afr=Object.freeze(Object.defineProperty({__proto__:null,default:ofr},Symbol.toStringTag,{value:"Module"})),lfr={class:"rv-geosearch-bar h-26 mb-8 mx-8"},ufr=["placeholder","value","aria-label"],cfr=an({__name:"search-bar",setup(t){const{t:e}=ns(),i=mk(),r=ay(),n=Jr(()=>i.searchVal),s=a=>i.setSearchTerm(a),o=Z2(500,a=>{s(a)});return(a,l)=>(Qt(),hi("div",lfr,[Dt("input",{type:"search",class:"border-b w-full text-base py-8 outline-none focus:shadow-outline border-gray-600 h-full min-w-0",placeholder:vi(e)("geosearch.searchText"),value:n.value,onInput:l[0]||(l[0]=c=>vi(o)(c.target.value)),onKeyup:l[1]||(l[1]=Zh(c=>{vi(r).mobileView&&c.target.blur()},["enter"])),"aria-label":vi(e)("geosearch.searchText"),onKeypress:l[2]||(l[2]=Zh(wa(()=>{},["prevent"]),["enter"])),enterkeyhint:"done"},null,40,ufr)]))}}),hfr={class:"rv-geosearch-top-filters sm:flex items-center w-full ml-8 mb-14"},dfr={class:"w-fit inline-block sm:w-1/2 h-26 mb-8 sm:mb-0 pr-16 sm:pr-0"},pfr=["value"],ffr={value:"",disabled:"",hidden:""},mfr={class:"sm:w-1/2 h-26 sm:mx-16 flex"},gfr=["value"],yfr={value:"",disabled:"",hidden:""},vfr=["disabled","content"],_fr=[Dt("div",{class:"rv-geosearch-icon"},[Dt("svg",{class:"fill-current w-18 h-18",viewBox:"0 0 23 21"},[Dt("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)],bfr=an({__name:"top-filters",setup(t){const{t:e}=ns(),i=no("iApi"),r=mk(),n=Mi([]),s=Mi([]),o=Mi([]),a=Jr(()=>r.queryParams),l=Jr(()=>i.language),c=v=>r.setProvince(v),h=v=>r.setType(v),p=()=>{c({}),h({})},y=()=>{r.initService(i.language,i.fixture.get("geosearch").config);const v=n.value.find(I=>a.value.province===I.name)?.code,x=s.value.find(I=>a.value.type===I.name)?.code;r.getProvinces.then(I=>{n.value=I,c({province:I.find(P=>P.code===v)?.name,forceReRun:!0})}),r.getTypes.then(I=>{s.value=I,h({type:I.find(P=>P.code===x)?.name,forceReRun:!0})})};return C_(()=>{y(),o.value.push(bu(l,y))}),Ll(()=>{o.value.forEach(v=>v())}),(v,x)=>{const I=as("truncate"),P=as("tippy");return Qt(),hi("div",hfr,[Dt("div",dfr,[Zr((Qt(),hi("select",{class:"border-b border-b-gray-600 w-full h-full py-0 cursor-pointer",value:a.value.province,onChange:x[0]||(x[0]=F=>c({province:F.target.value}))},[Zr((Qt(),hi("option",ffr,[ks(xr(vi(e)("geosearch.filters.province")),1)])),[[I]]),(Qt(!0),hi(po,null,fu(n.value,F=>Zr((Qt(),hi("option",{key:F.code},[ks(xr(F.name),1)])),[[I]])),128))],40,pfr)),[[I]])]),Dt("div",mfr,[Zr((Qt(),hi("select",{class:"border-b border-b-gray-600 w-full h-full py-0 cursor-pointer max-w-150",value:a.value.type,onChange:x[1]||(x[1]=F=>h({type:F.target.value}))},[Dt("option",yfr,xr(vi(e)("geosearch.filters.type")),1),(Qt(!0),hi(po,null,fu(s.value,F=>(Qt(),hi("option",{key:F.code},xr(F.name),1))),128))],40,gfr)),[[I]]),Zr((Qt(),hi("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-300",disabled:!a.value.type&&!a.value.province,onClick:p,content:vi(e)("geosearch.filters.clear")},_fr,8,vfr)),[[P,{placement:"bottom"}]])])])}}}),wfr={class:"rv-geosearch-bottom-filters"},xfr={class:"bg-white"},Sfr={class:"ml-8 cursor-pointer font-normal"},Cfr=["checked"],Tfr=an({__name:"bottom-filters",setup(t){const{t:e}=ns(),i=no("iApi"),r=mk(),n=Jr(()=>r.resultsVisible),s=Z2(300,c=>{a(c).then(h=>{o({extent:h,visible:n.value})})}),o=c=>{r.setMapExtent(c)},a=async c=>c.sr.wkid===4326?c:await i.geo.proj.projectGeometry(4326,c),l=c=>{a(i.geo.map.getExtent()).then(h=>{o({extent:h,visible:c})})};return Ja(()=>{i.event.on(cn.MAP_EXTENTCHANGE,s,"geosearch_map_extent")}),Ll(()=>{i.event.off("geosearch_map_extent")}),(c,h)=>(Qt(),hi("div",wfr,[Dt("div",xfr,[Dt("label",Sfr,[Dt("input",{type:"checkbox",class:"border-2 mx-8 border-gray-600 cursor-pointer",checked:n.value,onChange:h[0]||(h[0]=p=>l(p.target.checked)),onKeypress:h[1]||(h[1]=Zh(wa(()=>{},["prevent"]),["enter"]))},null,40,Cfr),ks(xr(vi(e)("geosearch.visible")),1)])])]))}}),zLr="",Efr={},Ifr={class:"w-full h-6 relative overflow-hidden rounded-full indeterminate mb-14"},Afr={class:"h-full progressbar bg-blue-800 rounded-full top-0","aria-valuemin":"0","aria-valuemax":"100"},Pfr={class:"flex items-center h-full"};function Ofr(t,e){return Qt(),hi("div",Ifr,[Dt("div",Afr,[Dt("span",Pfr,[Xf(t.$slots,"default",{},void 0,!0)])])])}const Rfr=Nl(Efr,[["render",Ofr],["__scopeId","data-v-343c5c69"]]),Mfr={class:"flex flex-col h-full"},Dfr={key:1,class:"text-red-900 text-xs px-8 mb-10"},Ffr={key:2,class:"px-8 mb-10 truncate"},Lfr={class:"relative h-48"},Nfr={class:"font-bold text-blue-600"},kfr={key:3,class:"rv-results-list flex-grow mb-5 border-t border-b border-gray-600 overflow-y-auto"},$fr=["onClick"],Bfr={class:"rv-result-description px-8"},Vfr={class:"flex-1 text-left truncate font-bold"},jfr=["innerHTML"],Gfr={key:0,class:"text-gray-600 text-sm"},Ufr={key:0,class:"flex-1 text-left truncate text-sm"},IOt=an({__name:"screen",props:{panel:{type:Object}},setup(t){const{t:e}=ns(),i=no("iApi"),r=mk(),n=Jr(()=>r.searchVal),s=Jr(()=>r.searchResults),o=Jr(()=>r.loadingResults),a=Jr(()=>r.failedServices),l=h=>{let p=new ry("zoomies",[[[h.bbox[0],h.bbox[1]],[h.bbox[0],h.bbox[3]],[h.bbox[2],h.bbox[3]],[h.bbox[2],h.bbox[1]],[h.bbox[0],h.bbox[1]]]],ml.latLongSR(),!0);i.geo.map.zoomMapTo(p)},c=(h,p)=>{const y=h.replace(new RegExp(`${n.value}`,"gi"),v=>''+v+"");return p?y+",":y};return(h,p)=>{const y=Vo("panel-screen"),v=as("truncate"),x=as("focus-item"),I=as("focus-list");return Qt(),Bn(y,{panel:t.panel},{header:En(()=>[ks(xr(vi(e)("geosearch.title")),1)]),content:En(()=>[Dt("div",Mfr,[Un(cfr),Un(bfr),o.value?(Qt(),Bn(Rfr,{key:0,class:"flex-none"})):fn("",!0),a.value.length>0&&!o.value?(Qt(),hi("div",Dfr,xr(vi(e)("geosearch.serviceError",{services:a.value.join(", ")})),1)):fn("",!0),n.value&&s.value.length===0&&!o.value?(Qt(),hi("div",Ffr,[Dt("span",Lfr,[ks(xr(vi(e)("geosearch.noResults")),1),Dt("span",Nfr,'"'+xr(n.value)+'"',1)])])):fn("",!0),s.value.length>0?Zr((Qt(),hi("ul",kfr,[(Qt(!0),hi(po,null,fu(s.value,(P,F)=>(Qt(),hi("li",{class:"relative h-56",key:F},[Zr((Qt(),hi("button",{type:"button",class:"absolute inset-0 h-full w-full hover:bg-gray-300 default-focus-style",onClick:k=>l(P),style:{"border-bottom":"1px solid lightgray"}},[Zr((Qt(),hi("div",Bfr,[Dt("div",Vfr,[Dt("span",{innerHTML:c(P.name,P.location.province)},null,8,jfr),P.location.province?(Qt(),hi("span",Gfr,xr(P.location.city?" "+P.location.city+", "+P.location.province.abbr:" "+P.location.province.abbr),1)):fn("",!0)]),P.type?(Qt(),hi("div",Ufr,xr(P.type),1)):fn("",!0)])),[[v]])],8,$fr)),[[x,"show-truncate"]])]))),128))])),[[I]]):fn("",!0),Un(Tfr,{class:"mt-auto"})])]),_:1},8,["panel"])}}}),zfr=Object.freeze(Object.defineProperty({__proto__:null,default:IOt},Symbol.toStringTag,{value:"Module"}));class Hfr extends Ac{}const Wfr=Dt("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Dt("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"}),Dt("path",{d:"M0 0h24v24H0z",fill:"none"})],-1),qfr=an({__name:"nav-button",setup(t){const{t:e}=ns(),i=no("iApi"),r=()=>{i?.panel.toggle("geosearch")};return(n,s)=>{const o=Vo("mapnav-button");return Qt(),Bn(o,{onClickFunction:r,tooltip:vi(e)("geosearch.title")},{default:En(()=>[Wfr]),_:1},8,["tooltip"])}}}),Yfr={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)"},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}"}};class Xfr extends Hfr{async added(){mk(this.$vApp.$pinia).initService(this.$iApi.language,this.config),this.$iApi.component("geosearch-nav-button",qfr),this.$iApi.panel.register({id:"geosearch",config:{screens:{"geosearch-component":ya(IOt)},button:{tooltip:"geosearch.title",icon:''},alertName:"geosearch.title"}},{i18n:{messages:Yfr}}),this.handlePanelTeleports(["geosearch"])}removed(){this.$iApi.fixture.get("appbar")&&mg(this.$vApp.$pinia).removeButton("geosearch"),this.$iApi.fixture.get("mapnav")&&gD(this.$vApp.$pinia).removeItem("geosearch"),mk(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("geosearch")}}const Kfr=Object.freeze(Object.defineProperty({__proto__:null,default:Xfr},Symbol.toStringTag,{value:"Module"}));class AOt{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 tye{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 AOt(e)})}getColumnFilterValue(e,i){const r=this._columns[e].filter;return i==="min"?r.min:i==="max"?r.max:r.value}setColumnFilterValue(e,i,r){let n=i;if(i&&typeof i=="string"){const s=/[(!"#$%&'+,.\\/:;<=>?@[\]^`{|}~)]/g;n=i.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 Jfr extends Ac{gridStore=tj(this.$vApp.$pinia);toggleGrid(e,i){const r=this.gridStore.getGridId(e);r||this.gridStore.addGrid({id:e,layerIds:[e],state:new tye,fieldMap:{}});const n=this.gridStore.currentId;this.gridStore.currentId=r??e;const s=this.$iApi.panel.get("grid");if(i===!1){s.close();return}!s.isOpen||!s.isVisible?this.$iApi.panel.open("grid"):n!==e||i===!0?s.show({screen:"grid-screen",props:{key:e}}):s.close()}_parseConfig(e){this.handlePanelWidths(["grid"]),this.handlePanelTeleports(["grid"]);const i=this.getLayerFixtureConfigs();e&&e.mergeGrids&&e.mergeGrids.forEach(r=>{const n=[],{gridId:s,layers:o,fieldMap:a,options:l}=r;o.forEach(p=>{p.sublayers?p.sublayers?.forEach(y=>{n.push(`${p.layerId}-${y}`),delete i[`${p.layerId}-${y}`]}):(n.push(p.layerId),delete i[p.layerId])});const c={};a?.forEach(p=>{p.sources.forEach(y=>{c[y]=p.field})});const h={id:s,layerIds:n,state:new tye(l),fieldMap:c};this.gridStore.addGrid(h)}),Object.keys(i).forEach(r=>{const n={id:r,layerIds:[r],state:new tye(i[r]),fieldMap:{}};this.gridStore.addGrid(n)})}}const HLr="",WLr="";var DS={};/** * 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 @@ -5487,40 +5487,40 @@ gl_FragColor.rgb *= color.a; * @version v27.3.0 * @link https://www.ag-grid.com/ * @license MIT - */function e(M){return M==null||M===""?null:M}function i(M,f){return f===void 0&&(f=!1),M!=null&&(M!==""||f)}function r(M){return!i(M)}function n(M){return M==null||M.length===0}function s(M){return M!=null&&typeof M.toString=="function"?M.toString():null}function o(M){if(M!==void 0){if(M===null||M==="")return null;if(typeof M=="number")return isNaN(M)?void 0:M;var f=parseInt(M,10);return isNaN(f)?void 0:f}}function a(M){if(M!==void 0)return M===null||M===""?!1:typeof M=="boolean"?M:/true/i.test(M)}function l(M){if(!(M==null||M===""))return M}function c(M,f){return M==null&&f==null?!0:M==null&&f!=null||M!=null&&f==null?!1:M===f}function d(M,f){var h=M?JSON.stringify(M):null,g=f?JSON.stringify(f):null;return h===g}function p(M,f,h){h===void 0&&(h=!1);var g=M==null,x=f==null;if(M&&M.toNumber&&(M=M.toNumber()),f&&f.toNumber&&(f=f.toNumber()),g&&x)return 0;if(g)return-1;if(x)return 1;function P(z,ee){return z>ee?1:zte?1:z=0)){var P=h[x],z=he(P)&&P.constructor===Object;z?g[x]=N(P):g[x]=P}}),g}}function G(M,f){return M[f]}function V(M,f,h){M[f]=h}function Y(M,f){for(var h=[],g=2;g1;)if(x=x[g.shift()],x==null)return h;var P=x[g[0]];return P??h}function Ie(M,f,h){if(M!=null){for(var g=f.split("."),x=M;g.length>1;)if(x=x[g.shift()],x==null)return;x[g[0]]=h}}function ke(M){return Object.freeze(M),y(M).forEach(function(f){(he(f)||typeof f=="function")&&ke(f)}),M}function Ne(M,f,h){if(!(!f||!M)){if(!h)return M[f];for(var g=f.split("."),x=M,P=0;P=0)){var O=d[S],z=de(O)&&O.constructor===Object;z?g[S]=k(O):g[S]=O}}),g}}function j(M,f){return M[f]}function V(M,f,d){M[f]=d}function Y(M,f){for(var d=[],g=2;g1;)if(S=S[g.shift()],S==null)return d;var O=S[g[0]];return O??d}function xe(M,f,d){if(M!=null){for(var g=f.split("."),S=M;g.length>1;)if(S=S[g.shift()],S==null)return;S[g[0]]=d}}function Pe(M){return Object.freeze(M),y(M).forEach(function(f){(de(f)||typeof f=="function")&&Pe(f)}),M}function ke(M,f,d){if(!(!f||!M)){if(!d)return M[f];for(var g=f.split("."),S=M,O=0;O0&&window.setTimeout(function(){return M.forEach(function(h){return h()})},f)}function Tt(M,f,h){h===void 0&&(h=!1);var g;return function(){for(var x=[],P=0;Ph;(M()||Me)&&(f(),z=!0,P!=null&&(window.clearInterval(P),P=null),Me&&g&&console.warn(g))};ee(),z||(P=window.setInterval(ee,10))}function Ee(){for(var M=[],f=0;f0&&window.setTimeout(function(){return M.forEach(function(d){return d()})},f)}function Et(M,f,d){d===void 0&&(d=!1);var g;return function(){for(var S=[],O=0;Od;(M()||Fe)&&(f(),z=!0,O!=null&&(window.clearInterval(O),O=null),Fe&&g&&console.warn(g))};te(),z||(O=window.setInterval(te,10))}function Te(){for(var M=[],f=0;f> creating ag-Application Context"),this.createBeans();var g=this.getBeanInstances();this.wireBeans(g),this.logger.log(">> ag-Application Context ready - component is alive")}}return M.prototype.getBeanInstances=function(){return y(this.beanWrappers).map(function(f){return f.beanInstance})},M.prototype.createBean=function(f,h){if(!f)throw Error("Can't wire to bean since it is null");return this.wireBeans([f],h),f},M.prototype.wireBeans=function(f,h){this.autoWireBeans(f),this.methodWireBeans(f),this.callLifeCycleMethods(f,"preConstructMethods"),i(h)&&f.forEach(h),this.callLifeCycleMethods(f,"postConstructMethods")},M.prototype.createBeans=function(){var f=this;this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this)),I(this.beanWrappers,function(g,x){var P;x.bean.__agBeanMetaData&&x.bean.__agBeanMetaData.autowireMethods&&x.bean.__agBeanMetaData.autowireMethods.agConstructor&&(P=x.bean.__agBeanMetaData.autowireMethods.agConstructor);var z=f.getBeansForParameters(P,x.bean.name),ee=ct(x.bean,z);x.beanInstance=ee});var h=Object.keys(this.beanWrappers).join(", ");this.logger.log("created beans: "+h)},M.prototype.createBeanWrapper=function(f){var h=f.__agBeanMetaData;if(!h){var g=void 0;f.prototype.constructor?g=Ge(f.prototype.constructor):g=""+f,console.error("Context item "+g+" is not a bean");return}var x={bean:f,beanInstance:null,beanName:h.beanName};this.beanWrappers[h.beanName]=x},M.prototype.autoWireBeans=function(f){var h=this;f.forEach(function(g){h.forEachMetaDataInHierarchy(g,function(x,P){var z=x.agClassAttributes;z&&z.forEach(function(ee){var Me=h.lookupBeanInstance(P,ee.beanName,ee.optional);g[ee.attributeName]=Me})})})},M.prototype.methodWireBeans=function(f){var h=this;f.forEach(function(g){h.forEachMetaDataInHierarchy(g,function(x,P){I(x.autowireMethods,function(z,ee){if(z!=="agConstructor"){var Me=h.getBeansForParameters(ee,P);g[z].apply(g,Me)}})})})},M.prototype.forEachMetaDataInHierarchy=function(f,h){for(var g=Object.getPrototypeOf(f);g!=null;){var x=g.constructor;if(x.hasOwnProperty("__agBeanMetaData")){var P=x.__agBeanMetaData,z=this.getBeanName(x);h(P,z)}g=Object.getPrototypeOf(g)}},M.prototype.getBeanName=function(f){if(f.__agBeanMetaData&&f.__agBeanMetaData.beanName)return f.__agBeanMetaData.beanName;var h=f.toString(),g=h.substring(9,h.indexOf("("));return g},M.prototype.getBeansForParameters=function(f,h){var g=this,x=[];return f&&I(f,function(P,z){var ee=g.lookupBeanInstance(h,z);x[Number(P)]=ee}),x},M.prototype.lookupBeanInstance=function(f,h,g){if(g===void 0&&(g=!1),h==="context")return this;if(this.contextParams.providedBeanInstances&&this.contextParams.providedBeanInstances.hasOwnProperty(h))return this.contextParams.providedBeanInstances[h];var x=this.beanWrappers[h];return x?x.beanInstance:(g||console.error("AG Grid: unable to find bean reference "+h+" while initialising "+f),null)},M.prototype.callLifeCycleMethods=function(f,h){var g=this;f.forEach(function(x){return g.callLifeCycleMethodsOnBean(x,h)})},M.prototype.callLifeCycleMethodsOnBean=function(f,h,g){var x={};this.forEachMetaDataInHierarchy(f,function(z){var ee=z[h];ee&&ee.forEach(function(Me){Me!=g&&(x[Me]=!0)})});var P=Object.keys(x);P.forEach(function(z){return f[z]()})},M.prototype.getBean=function(f){return this.lookupBeanInstance("getBean",f,!0)},M.prototype.destroy=function(){if(!this.destroyed){this.logger.log(">> Shutting down ag-Application Context");var f=this.getBeanInstances();this.destroyBeans(f),this.contextParams.providedBeanInstances=null,this.destroyed=!0,this.logger.log(">> ag-Application Context shut down - component is dead")}},M.prototype.destroyBean=function(f){f&&this.destroyBeans([f])},M.prototype.destroyBeans=function(f){var h=this;return f?(f.forEach(function(g){h.callLifeCycleMethodsOnBean(g,"preDestroyMethods","destroy");var x=g;typeof x.destroy=="function"&&x.destroy()}),[]):[]},M}();function ct(M,f){var h=[null].concat(f),g=M.bind.apply(M,h);return new g}function le(M,f,h){var g=Ve(M.constructor);g.preConstructMethods||(g.preConstructMethods=[]),g.preConstructMethods.push(f)}function it(M,f,h){var g=Ve(M.constructor);g.postConstructMethods||(g.postConstructMethods=[]),g.postConstructMethods.push(f)}function pt(M,f,h){var g=Ve(M.constructor);g.preDestroyMethods||(g.preDestroyMethods=[]),g.preDestroyMethods.push(f)}function Le(M){return function(f){var h=Ve(f);h.beanName=M}}function ce(M){return function(f,h,g){Ze(f,M,!1,f,h,null)}}function Ce(M){return function(f,h,g){Ze(f,M,!0,f,h,null)}}function Ze(M,f,h,g,x,P){if(f===null){console.error("AG Grid: Autowired name should not be null");return}if(typeof P=="number"){console.error("AG Grid: Autowired should be on an attribute");return}var z=Ve(M.constructor);z.agClassAttributes||(z.agClassAttributes=[]),z.agClassAttributes.push({attributeName:x,beanName:f,optional:h})}function yt(M){return function(f,h,g){var x=typeof f=="function"?f:f.constructor,P;if(typeof g=="number"){var z=void 0;h?(P=Ve(x),z=h):(P=Ve(x),z="agConstructor"),P.autowireMethods||(P.autowireMethods={}),P.autowireMethods[z]||(P.autowireMethods[z]={}),P.autowireMethods[z][g]=M}}}function Ve(M){return M.hasOwnProperty("__agBeanMetaData")||(M.__agBeanMetaData={}),M.__agBeanMetaData}/** + */var kt=function(){function M(f,d){if(this.beanWrappers={},this.destroyed=!1,!(!f||!f.beanClasses)){this.contextParams=f,this.logger=d,this.logger.log(">> creating ag-Application Context"),this.createBeans();var g=this.getBeanInstances();this.wireBeans(g),this.logger.log(">> ag-Application Context ready - component is alive")}}return M.prototype.getBeanInstances=function(){return y(this.beanWrappers).map(function(f){return f.beanInstance})},M.prototype.createBean=function(f,d){if(!f)throw Error("Can't wire to bean since it is null");return this.wireBeans([f],d),f},M.prototype.wireBeans=function(f,d){this.autoWireBeans(f),this.methodWireBeans(f),this.callLifeCycleMethods(f,"preConstructMethods"),i(d)&&f.forEach(d),this.callLifeCycleMethods(f,"postConstructMethods")},M.prototype.createBeans=function(){var f=this;this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this)),I(this.beanWrappers,function(g,S){var O;S.bean.__agBeanMetaData&&S.bean.__agBeanMetaData.autowireMethods&&S.bean.__agBeanMetaData.autowireMethods.agConstructor&&(O=S.bean.__agBeanMetaData.autowireMethods.agConstructor);var z=f.getBeansForParameters(O,S.bean.name),te=ct(S.bean,z);S.beanInstance=te});var d=Object.keys(this.beanWrappers).join(", ");this.logger.log("created beans: "+d)},M.prototype.createBeanWrapper=function(f){var d=f.__agBeanMetaData;if(!d){var g=void 0;f.prototype.constructor?g=Be(f.prototype.constructor):g=""+f,console.error("Context item "+g+" is not a bean");return}var S={bean:f,beanInstance:null,beanName:d.beanName};this.beanWrappers[d.beanName]=S},M.prototype.autoWireBeans=function(f){var d=this;f.forEach(function(g){d.forEachMetaDataInHierarchy(g,function(S,O){var z=S.agClassAttributes;z&&z.forEach(function(te){var Fe=d.lookupBeanInstance(O,te.beanName,te.optional);g[te.attributeName]=Fe})})})},M.prototype.methodWireBeans=function(f){var d=this;f.forEach(function(g){d.forEachMetaDataInHierarchy(g,function(S,O){I(S.autowireMethods,function(z,te){if(z!=="agConstructor"){var Fe=d.getBeansForParameters(te,O);g[z].apply(g,Fe)}})})})},M.prototype.forEachMetaDataInHierarchy=function(f,d){for(var g=Object.getPrototypeOf(f);g!=null;){var S=g.constructor;if(S.hasOwnProperty("__agBeanMetaData")){var O=S.__agBeanMetaData,z=this.getBeanName(S);d(O,z)}g=Object.getPrototypeOf(g)}},M.prototype.getBeanName=function(f){if(f.__agBeanMetaData&&f.__agBeanMetaData.beanName)return f.__agBeanMetaData.beanName;var d=f.toString(),g=d.substring(9,d.indexOf("("));return g},M.prototype.getBeansForParameters=function(f,d){var g=this,S=[];return f&&I(f,function(O,z){var te=g.lookupBeanInstance(d,z);S[Number(O)]=te}),S},M.prototype.lookupBeanInstance=function(f,d,g){if(g===void 0&&(g=!1),d==="context")return this;if(this.contextParams.providedBeanInstances&&this.contextParams.providedBeanInstances.hasOwnProperty(d))return this.contextParams.providedBeanInstances[d];var S=this.beanWrappers[d];return S?S.beanInstance:(g||console.error("AG Grid: unable to find bean reference "+d+" while initialising "+f),null)},M.prototype.callLifeCycleMethods=function(f,d){var g=this;f.forEach(function(S){return g.callLifeCycleMethodsOnBean(S,d)})},M.prototype.callLifeCycleMethodsOnBean=function(f,d,g){var S={};this.forEachMetaDataInHierarchy(f,function(z){var te=z[d];te&&te.forEach(function(Fe){Fe!=g&&(S[Fe]=!0)})});var O=Object.keys(S);O.forEach(function(z){return f[z]()})},M.prototype.getBean=function(f){return this.lookupBeanInstance("getBean",f,!0)},M.prototype.destroy=function(){if(!this.destroyed){this.logger.log(">> Shutting down ag-Application Context");var f=this.getBeanInstances();this.destroyBeans(f),this.contextParams.providedBeanInstances=null,this.destroyed=!0,this.logger.log(">> ag-Application Context shut down - component is dead")}},M.prototype.destroyBean=function(f){f&&this.destroyBeans([f])},M.prototype.destroyBeans=function(f){var d=this;return f?(f.forEach(function(g){d.callLifeCycleMethodsOnBean(g,"preDestroyMethods","destroy");var S=g;typeof S.destroy=="function"&&S.destroy()}),[]):[]},M}();function ct(M,f){var d=[null].concat(f),g=M.bind.apply(M,d);return new g}function ae(M,f,d){var g=ze(M.constructor);g.preConstructMethods||(g.preConstructMethods=[]),g.preConstructMethods.push(f)}function ht(M,f,d){var g=ze(M.constructor);g.postConstructMethods||(g.postConstructMethods=[]),g.postConstructMethods.push(f)}function wt(M,f,d){var g=ze(M.constructor);g.preDestroyMethods||(g.preDestroyMethods=[]),g.preDestroyMethods.push(f)}function Ne(M){return function(f){var d=ze(f);d.beanName=M}}function pe(M){return function(f,d,g){tt(f,M,!1,f,d,null)}}function Ae(M){return function(f,d,g){tt(f,M,!0,f,d,null)}}function tt(M,f,d,g,S,O){if(f===null){console.error("AG Grid: Autowired name should not be null");return}if(typeof O=="number"){console.error("AG Grid: Autowired should be on an attribute");return}var z=ze(M.constructor);z.agClassAttributes||(z.agClassAttributes=[]),z.agClassAttributes.push({attributeName:S,beanName:f,optional:d})}function gt(M){return function(f,d,g){var S=typeof f=="function"?f:f.constructor,O;if(typeof g=="number"){var z=void 0;d?(O=ze(S),z=d):(O=ze(S),z="agConstructor"),O.autowireMethods||(O.autowireMethods={}),O.autowireMethods[z]||(O.autowireMethods[z]={}),O.autowireMethods[z][g]=M}}}function ze(M){return M.hasOwnProperty("__agBeanMetaData")||(M.__agBeanMetaData={}),M.__agBeanMetaData}/** * @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/ * @license MIT - */var At=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},ii=function(M,f){return function(h,g){f(h,g,M)}},gt=function(){function M(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}return M.prototype.setBeans=function(f,h,g,x){if(x===void 0&&(x=null),this.frameworkOverrides=g,x){var P=h.useAsyncEvents();this.addGlobalListener(x,P)}},M.prototype.getListeners=function(f,h,g){var x=h?this.allAsyncListeners:this.allSyncListeners,P=x.get(f);return!P&&g&&(P=new Set,x.set(f,P)),P},M.prototype.noRegisteredListenersExist=function(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0},M.prototype.addEventListener=function(f,h,g){g===void 0&&(g=!1),this.getListeners(f,g,!0).add(h)},M.prototype.removeEventListener=function(f,h,g){g===void 0&&(g=!1);var x=this.getListeners(f,g,!1);if(x&&(x.delete(h),x.size===0)){var P=g?this.allAsyncListeners:this.allSyncListeners;P.delete(f)}},M.prototype.addGlobalListener=function(f,h){h===void 0&&(h=!1),(h?this.globalAsyncListeners:this.globalSyncListeners).add(f)},M.prototype.removeGlobalListener=function(f,h){h===void 0&&(h=!1),(h?this.globalAsyncListeners:this.globalSyncListeners).delete(f)},M.prototype.dispatchEvent=function(f){this.dispatchToListeners(f,!0),this.dispatchToListeners(f,!1),this.firedEvents[f.type]=!0},M.prototype.dispatchEventOnce=function(f){this.firedEvents[f.type]||this.dispatchEvent(f)},M.prototype.dispatchToListeners=function(f,h){var g=this,x=f.type,P=function(Me){return Me.forEach(function(je){h?g.dispatchAsync(function(){return je(f)}):je(f)})},z=this.getListeners(x,h,!1);z&&P(z);var ee=h?this.globalAsyncListeners:this.globalSyncListeners;ee.forEach(function(Me){h?g.dispatchAsync(function(){return g.frameworkOverrides.dispatchEvent(x,function(){return Me(x,f)},!0)}):g.frameworkOverrides.dispatchEvent(x,function(){return Me(x,f)},!0)})},M.prototype.dispatchAsync=function(f){this.asyncFunctionsQueue.push(f),this.scheduled||(window.setTimeout(this.flushAsyncQueue.bind(this),0),this.scheduled=!0)},M.prototype.flushAsyncQueue=function(){this.scheduled=!1;var f=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],f.forEach(function(h){return h()})},At([ii(0,yt("loggerFactory")),ii(1,yt("gridOptionsWrapper")),ii(2,yt("frameworkOverrides")),ii(3,yt("globalEventListener"))],M.prototype,"setBeans",null),M=At([Le("eventService")],M),M}();/** + */var Ot=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},jt=function(M,f){return function(d,g){f(d,g,M)}},nt=function(){function M(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}return M.prototype.setBeans=function(f,d,g,S){if(S===void 0&&(S=null),this.frameworkOverrides=g,S){var O=d.useAsyncEvents();this.addGlobalListener(S,O)}},M.prototype.getListeners=function(f,d,g){var S=d?this.allAsyncListeners:this.allSyncListeners,O=S.get(f);return!O&&g&&(O=new Set,S.set(f,O)),O},M.prototype.noRegisteredListenersExist=function(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0},M.prototype.addEventListener=function(f,d,g){g===void 0&&(g=!1),this.getListeners(f,g,!0).add(d)},M.prototype.removeEventListener=function(f,d,g){g===void 0&&(g=!1);var S=this.getListeners(f,g,!1);if(S&&(S.delete(d),S.size===0)){var O=g?this.allAsyncListeners:this.allSyncListeners;O.delete(f)}},M.prototype.addGlobalListener=function(f,d){d===void 0&&(d=!1),(d?this.globalAsyncListeners:this.globalSyncListeners).add(f)},M.prototype.removeGlobalListener=function(f,d){d===void 0&&(d=!1),(d?this.globalAsyncListeners:this.globalSyncListeners).delete(f)},M.prototype.dispatchEvent=function(f){this.dispatchToListeners(f,!0),this.dispatchToListeners(f,!1),this.firedEvents[f.type]=!0},M.prototype.dispatchEventOnce=function(f){this.firedEvents[f.type]||this.dispatchEvent(f)},M.prototype.dispatchToListeners=function(f,d){var g=this,S=f.type,O=function(Fe){return Fe.forEach(function(Ue){d?g.dispatchAsync(function(){return Ue(f)}):Ue(f)})},z=this.getListeners(S,d,!1);z&&O(z);var te=d?this.globalAsyncListeners:this.globalSyncListeners;te.forEach(function(Fe){d?g.dispatchAsync(function(){return g.frameworkOverrides.dispatchEvent(S,function(){return Fe(S,f)},!0)}):g.frameworkOverrides.dispatchEvent(S,function(){return Fe(S,f)},!0)})},M.prototype.dispatchAsync=function(f){this.asyncFunctionsQueue.push(f),this.scheduled||(window.setTimeout(this.flushAsyncQueue.bind(this),0),this.scheduled=!0)},M.prototype.flushAsyncQueue=function(){this.scheduled=!1;var f=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],f.forEach(function(d){return d()})},Ot([jt(0,gt("loggerFactory")),jt(1,gt("gridOptionsWrapper")),jt(2,gt("frameworkOverrides")),jt(3,gt("globalEventListener"))],M.prototype,"setBeans",null),M=Ot([Ne("eventService")],M),M}();/** * @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/ * @license MIT - */var Ue=function(){function M(){}return M.ROW_BUFFER_SIZE=10,M.LAYOUT_INTERVAL=500,M.BATCH_WAIT_MILLIS=50,M.EXPORT_TYPE_DRAG_COPY="dragCopy",M.EXPORT_TYPE_CLIPBOARD="clipboard",M.EXPORT_TYPE_EXCEL="excel",M.EXPORT_TYPE_CSV="csv",M.ROW_MODEL_TYPE_INFINITE="infinite",M.ROW_MODEL_TYPE_VIEWPORT="viewport",M.ROW_MODEL_TYPE_CLIENT_SIDE="clientSide",M.ROW_MODEL_TYPE_SERVER_SIDE="serverSide",M.ALWAYS="always",M.ONLY_WHEN_GROUPING="onlyWhenGrouping",M.PINNED_TOP="top",M.PINNED_BOTTOM="bottom",M.DOM_LAYOUT_NORMAL="normal",M.DOM_LAYOUT_PRINT="print",M.DOM_LAYOUT_AUTO_HEIGHT="autoHeight",M.GROUP_AUTO_COLUMN_ID="ag-Grid-AutoColumn",M.SOURCE_PASTE="paste",M.PINNED_RIGHT="right",M.PINNED_LEFT="left",M.SORT_ASC="asc",M.SORT_DESC="desc",M.INPUT_SELECTOR="input, select, button, textarea",M.FOCUSABLE_SELECTOR="[tabindex], input, select, button, textarea",M.FOCUSABLE_EXCLUDE=".ag-hidden, .ag-hidden *, [disabled], .ag-disabled, .ag-disabled *",M}();/** + */var $e=function(){function M(){}return M.ROW_BUFFER_SIZE=10,M.LAYOUT_INTERVAL=500,M.BATCH_WAIT_MILLIS=50,M.EXPORT_TYPE_DRAG_COPY="dragCopy",M.EXPORT_TYPE_CLIPBOARD="clipboard",M.EXPORT_TYPE_EXCEL="excel",M.EXPORT_TYPE_CSV="csv",M.ROW_MODEL_TYPE_INFINITE="infinite",M.ROW_MODEL_TYPE_VIEWPORT="viewport",M.ROW_MODEL_TYPE_CLIENT_SIDE="clientSide",M.ROW_MODEL_TYPE_SERVER_SIDE="serverSide",M.ALWAYS="always",M.ONLY_WHEN_GROUPING="onlyWhenGrouping",M.PINNED_TOP="top",M.PINNED_BOTTOM="bottom",M.DOM_LAYOUT_NORMAL="normal",M.DOM_LAYOUT_PRINT="print",M.DOM_LAYOUT_AUTO_HEIGHT="autoHeight",M.GROUP_AUTO_COLUMN_ID="ag-Grid-AutoColumn",M.SOURCE_PASTE="paste",M.PINNED_RIGHT="right",M.PINNED_LEFT="left",M.SORT_ASC="asc",M.SORT_DESC="desc",M.INPUT_SELECTOR="input, select, button, textarea",M.FOCUSABLE_SELECTOR="[tabindex], input, select, button, textarea",M.FOCUSABLE_EXCLUDE=".ag-hidden, .ag-hidden *, [disabled], .ag-disabled, .ag-disabled *",M}();/** * @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/ @@ -5530,230 +5530,230 @@ gl_FragColor.rgb *= color.a; * @version v27.3.0 * @link https://www.ag-grid.com/ * @license MIT - */var ni=function(){function M(){}return M.register=function(f,h){h===void 0&&(h=!0),M.modulesMap[f.moduleName]=f,M.moduleBased===void 0?M.moduleBased=h:M.moduleBased!==h&&ze(function(){console.warn("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),console.warn("Please see https://www.ag-grid.com/javascript-grid/packages-modules/ for more information.")},"ModulePackageCheck")},M.registerModules=function(f,h){h===void 0&&(h=!0),f&&f.forEach(function(g){return M.register(g,h)})},M.assertRegistered=function(f,h){if(this.isRegistered(f))return!0;var g=h+f,x;return M.moduleBased?x="AG Grid: unable to use "+h+" as module "+f+" is not present. Please see: https://www.ag-grid.com/javascript-grid/modules/":x="AG Grid: unable to use "+h+" as package 'ag-grid-enterprise' is not present. Please see: https://www.ag-grid.com/javascript-grid/packages/",ze(function(){console.warn(x)},g),!1},M.isRegistered=function(f){return!!M.modulesMap[f]},M.getRegisteredModules=function(){return y(M.modulesMap)},M.isPackageBased=function(){return!M.moduleBased},M.modulesMap={},M}();/** + */var Xt=function(){function M(){}return M.register=function(f,d){d===void 0&&(d=!0),M.modulesMap[f.moduleName]=f,M.moduleBased===void 0?M.moduleBased=d:M.moduleBased!==d&&Ge(function(){console.warn("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),console.warn("Please see https://www.ag-grid.com/javascript-grid/packages-modules/ for more information.")},"ModulePackageCheck")},M.registerModules=function(f,d){d===void 0&&(d=!0),f&&f.forEach(function(g){return M.register(g,d)})},M.assertRegistered=function(f,d){if(this.isRegistered(f))return!0;var g=d+f,S;return M.moduleBased?S="AG Grid: unable to use "+d+" as module "+f+" is not present. Please see: https://www.ag-grid.com/javascript-grid/modules/":S="AG Grid: unable to use "+d+" as package 'ag-grid-enterprise' is not present. Please see: https://www.ag-grid.com/javascript-grid/packages/",Ge(function(){console.warn(S)},g),!1},M.isRegistered=function(f){return!!M.modulesMap[f]},M.getRegisteredModules=function(){return y(M.modulesMap)},M.isPackageBased=function(){return!M.moduleBased},M.modulesMap={},M}();/** * @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/ * @license MIT - */var A=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},ve=0,W=function(){function M(f,h,g,x){this.instanceId=ve++,this.moving=!1,this.menuVisible=!1,this.filterActive=!1,this.eventService=new gt,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=f,this.userProvidedColDef=h,this.colId=g,this.primary=x,this.setState(f)}return M.prototype.getInstanceId=function(){return this.instanceId},M.prototype.setState=function(f){f.sort!==void 0?(f.sort===Ue.SORT_ASC||f.sort===Ue.SORT_DESC)&&(this.sort=f.sort):(f.initialSort===Ue.SORT_ASC||f.initialSort===Ue.SORT_DESC)&&(this.sort=f.initialSort);var h=o(f.sortIndex),g=o(f.initialSortIndex);h!==void 0?h!==null&&(this.sortIndex=h):g!==null&&(this.sortIndex=g);var x=a(f.hide),P=a(f.initialHide);x!==void 0?this.visible=!x:this.visible=!P,f.pinned!==void 0?this.setPinned(f.pinned):this.setPinned(f.initialPinned);var z=o(f.flex),ee=o(f.initialFlex);z!==void 0?this.flex=z:ee!==void 0&&(this.flex=ee)},M.prototype.setColDef=function(f,h){this.colDef=f,this.userProvidedColDef=h,this.initMinAndMaxWidths(),this.initDotNotation()},M.prototype.getUserProvidedColDef=function(){return this.userProvidedColDef},M.prototype.setParent=function(f){this.parent=f},M.prototype.getParent=function(){return this.parent},M.prototype.setOriginalParent=function(f){this.originalParent=f},M.prototype.getOriginalParent=function(){return this.originalParent},M.prototype.initialise=function(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.validate()},M.prototype.initDotNotation=function(){var f=this.gridOptionsWrapper.isSuppressFieldDotNotation();this.fieldContainsDots=i(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!f,this.tooltipFieldContainsDots=i(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!f},M.prototype.initMinAndMaxWidths=function(){var f=this.colDef;this.minWidth=this.columnUtils.calculateColMinWidth(f),this.maxWidth=this.columnUtils.calculateColMaxWidth(f)},M.prototype.resetActualWidth=function(f){f===void 0&&(f="api");var h=this.columnUtils.calculateColInitialWidth(this.colDef);this.setActualWidth(h,f,!0)},M.prototype.isEmptyGroup=function(){return!1},M.prototype.isRowGroupDisplayed=function(f){if(r(this.colDef)||r(this.colDef.showRowGroup))return!1;var h=this.colDef.showRowGroup===!0,g=this.colDef.showRowGroup===f;return h||g},M.prototype.isPrimary=function(){return this.primary},M.prototype.isFilterAllowed=function(){var f=!!this.colDef.filter||!!this.colDef.filterFramework;return f},M.prototype.isFieldContainsDots=function(){return this.fieldContainsDots},M.prototype.isTooltipFieldContainsDots=function(){return this.tooltipFieldContainsDots},M.prototype.validate=function(){var f=this.colDef;function h(z,ee,Me){ze(function(){Me?console.warn(z,Me):ze(function(){return console.warn(z)},ee)},ee)}var g=this.gridOptionsWrapper.isRowModelDefault();if(g&&!ni.isRegistered(t.ModuleNames.RowGroupingModule)){var x=["enableRowGroup","rowGroup","rowGroupIndex","enablePivot","enableValue","pivot","pivotIndex","aggFunc"];x.forEach(function(z){i(f[z])&&(ni.isPackageBased()?h("AG Grid: "+z+" is only valid in ag-grid-enterprise, your column definition should not have "+z,"ColumnRowGroupingMissing"+z):h("AG Grid: "+z+" is only valid with AG Grid Enterprise Module "+t.ModuleNames.RowGroupingModule+" - your column definition should not have "+z,"ColumnRowGroupingMissing"+z))})}if(ni.isRegistered(t.ModuleNames.RichSelectModule)||this.colDef.cellEditor==="agRichSelect"&&(ni.isPackageBased()?h("AG Grid: "+this.colDef.cellEditor+" can only be used with ag-grid-enterprise","ColumnRichSelectMissing"):h("AG Grid: "+this.colDef.cellEditor+" can only be used with AG Grid Enterprise Module "+t.ModuleNames.RichSelectModule,"ColumnRichSelectMissing")),this.gridOptionsWrapper.isTreeData()){var P=["rowGroup","rowGroupIndex","pivot","pivotIndex"];P.forEach(function(z){i(f[z])&&h("AG Grid: "+z+" is not possible when doing tree data, your column definition should not have "+z,"TreeDataCannotRowGroup")})}i(this.colDef.width)&&typeof this.colDef.width!="number"&&h("AG Grid: colDef.width should be a number, not "+typeof this.colDef.width,"ColumnCheck_asdfawef"),f.pinnedRowCellRenderer&&h("AG Grid: pinnedRowCellRenderer no longer exists, use cellRendererSelector if you want a different Cell Renderer for pinned rows. Check params.node.rowPinned. This was an unfortunate (but necessary) change we had to do to allow future plans we have of re-skinng the data grid in frameworks such as React, Angular and Vue. See https://www.ag-grid.com/javascript-grid/cell-rendering/#many-renderers-one-column","colDef.pinnedRowCellRenderer-deprecated"),f.pinnedRowCellRendererParams&&h("AG Grid: pinnedRowCellRenderer no longer exists, use cellRendererSelector if you want a different Cell Renderer for pinned rows. Check params.node.rowPinned. This was an unfortunate (but necessary) change we had to do to allow future plans we have of re-skinng the data grid in frameworks such as React, Angular and Vue. See https://www.ag-grid.com/javascript-grid/cell-rendering/#many-renderers-one-column","colDef.pinnedRowCellRenderer-deprecated"),f.pinnedRowCellRendererFramework&&h("AG Grid: pinnedRowCellRenderer no longer exists, use cellRendererSelector if you want a different Cell Renderer for pinned rows. Check params.node.rowPinned. This was an unfortunate (but necessary) change we had to do to allow future plans we have of re-skinng the data grid in frameworks such as React, Angular and Vue. See https://www.ag-grid.com/javascript-grid/cell-rendering/#many-renderers-one-column","colDef.pinnedRowCellRenderer-deprecated"),f.pinnedRowValueGetter&&h("AG Grid: pinnedRowCellRenderer is deprecated, use cellRendererSelector if you want a different Cell Renderer for pinned rows. Check params.node.rowPinned. This was an unfortunate (but necessary) change we had to do to allow future plans we have of re-skinng the data grid in frameworks such as React, Angular and Vue.","colDef.pinnedRowCellRenderer-deprecated")},M.prototype.addEventListener=function(f,h){this.eventService.addEventListener(f,h)},M.prototype.removeEventListener=function(f,h){this.eventService.removeEventListener(f,h)},M.prototype.createColumnFunctionCallbackParams=function(f){return{node:f,data:f.data,column:this,colDef:this.colDef,context:this.gridOptionsWrapper.getContext(),api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi()}},M.prototype.isSuppressNavigable=function(f){if(typeof this.colDef.suppressNavigable=="boolean")return this.colDef.suppressNavigable;if(typeof this.colDef.suppressNavigable=="function"){var h=this.createColumnFunctionCallbackParams(f),g=this.colDef.suppressNavigable;return g(h)}return!1},M.prototype.isCellEditable=function(f){return f.group&&!this.gridOptionsWrapper.isEnableGroupEdit()?!1:this.isColumnFunc(f,this.colDef.editable)},M.prototype.isSuppressFillHandle=function(){return!!a(this.colDef.suppressFillHandle)},M.prototype.isAutoHeight=function(){return!!a(this.colDef.autoHeight)},M.prototype.isRowDrag=function(f){return this.isColumnFunc(f,this.colDef.rowDrag)},M.prototype.isDndSource=function(f){return this.isColumnFunc(f,this.colDef.dndSource)},M.prototype.isCellCheckboxSelection=function(f){return this.isColumnFunc(f,this.colDef.checkboxSelection)},M.prototype.isSuppressPaste=function(f){return this.isColumnFunc(f,this.colDef?this.colDef.suppressPaste:null)},M.prototype.isResizable=function(){return!!a(this.colDef.resizable)},M.prototype.isColumnFunc=function(f,h){if(typeof h=="boolean")return h;if(typeof h=="function"){var g=this.createColumnFunctionCallbackParams(f),x=h;return x(g)}return!1},M.prototype.setMoving=function(f,h){h===void 0&&(h="api"),this.moving=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_MOVING_CHANGED,h))},M.prototype.createColumnEvent=function(f,h){return{api:this.gridApi,columnApi:this.columnApi,type:f,column:this,columns:[this],source:h}},M.prototype.isMoving=function(){return this.moving},M.prototype.getSort=function(){return this.sort},M.prototype.setSort=function(f,h){h===void 0&&(h="api"),this.sort!==f&&(this.sort=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_SORT_CHANGED,h)))},M.prototype.setMenuVisible=function(f,h){h===void 0&&(h="api"),this.menuVisible!==f&&(this.menuVisible=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_MENU_VISIBLE_CHANGED,h)))},M.prototype.isMenuVisible=function(){return this.menuVisible},M.prototype.isSortAscending=function(){return this.sort===Ue.SORT_ASC},M.prototype.isSortDescending=function(){return this.sort===Ue.SORT_DESC},M.prototype.isSortNone=function(){return r(this.sort)},M.prototype.isSorting=function(){return i(this.sort)},M.prototype.getSortIndex=function(){return this.sortIndex},M.prototype.setSortIndex=function(f){this.sortIndex=f},M.prototype.setAggFunc=function(f){this.aggFunc=f},M.prototype.getAggFunc=function(){return this.aggFunc},M.prototype.getLeft=function(){return this.left},M.prototype.getOldLeft=function(){return this.oldLeft},M.prototype.getRight=function(){return this.left+this.actualWidth},M.prototype.setLeft=function(f,h){h===void 0&&(h="api"),this.oldLeft=this.left,this.left!==f&&(this.left=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_LEFT_CHANGED,h)))},M.prototype.isFilterActive=function(){return this.filterActive},M.prototype.setFilterActive=function(f,h,g){h===void 0&&(h="api"),this.filterActive!==f&&(this.filterActive=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_FILTER_ACTIVE_CHANGED,h)));var x=this.createColumnEvent(M.EVENT_FILTER_CHANGED,h);g&&fe(x,g),this.eventService.dispatchEvent(x)},M.prototype.setPinned=function(f){f===!0||f===Ue.PINNED_LEFT?this.pinned=Ue.PINNED_LEFT:f===Ue.PINNED_RIGHT?this.pinned=Ue.PINNED_RIGHT:this.pinned=null},M.prototype.setFirstRightPinned=function(f,h){h===void 0&&(h="api"),this.firstRightPinned!==f&&(this.firstRightPinned=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_FIRST_RIGHT_PINNED_CHANGED,h)))},M.prototype.setLastLeftPinned=function(f,h){h===void 0&&(h="api"),this.lastLeftPinned!==f&&(this.lastLeftPinned=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_LAST_LEFT_PINNED_CHANGED,h)))},M.prototype.isFirstRightPinned=function(){return this.firstRightPinned},M.prototype.isLastLeftPinned=function(){return this.lastLeftPinned},M.prototype.isPinned=function(){return this.pinned===Ue.PINNED_LEFT||this.pinned===Ue.PINNED_RIGHT},M.prototype.isPinnedLeft=function(){return this.pinned===Ue.PINNED_LEFT},M.prototype.isPinnedRight=function(){return this.pinned===Ue.PINNED_RIGHT},M.prototype.getPinned=function(){return this.pinned},M.prototype.setVisible=function(f,h){h===void 0&&(h="api");var g=f===!0;this.visible!==g&&(this.visible=g,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_VISIBLE_CHANGED,h)))},M.prototype.isVisible=function(){return this.visible},M.prototype.getColDef=function(){return this.colDef},M.prototype.getColumnGroupShow=function(){return this.colDef.columnGroupShow},M.prototype.getColId=function(){return this.colId},M.prototype.getId=function(){return this.getColId()},M.prototype.getUniqueId=function(){return this.getId()},M.prototype.getDefinition=function(){return this.colDef},M.prototype.getActualWidth=function(){return this.actualWidth},M.prototype.createBaseColDefParams=function(f){var h={node:f,data:f.data,colDef:this.colDef,column:this,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()};return h},M.prototype.getColSpan=function(f){if(r(this.colDef.colSpan))return 1;var h=this.createBaseColDefParams(f),g=this.colDef.colSpan(h);return Math.max(g,1)},M.prototype.getRowSpan=function(f){if(r(this.colDef.rowSpan))return 1;var h=this.createBaseColDefParams(f),g=this.colDef.rowSpan(h);return Math.max(g,1)},M.prototype.setActualWidth=function(f,h,g){h===void 0&&(h="api"),g===void 0&&(g=!1),this.minWidth!=null&&(f=Math.max(f,this.minWidth)),this.maxWidth!=null&&(f=Math.min(f,this.maxWidth)),this.actualWidth!==f&&(this.actualWidth=f,this.flex&&h!=="flex"&&h!=="gridInitializing"&&(this.flex=null),g||this.fireColumnWidthChangedEvent(h))},M.prototype.fireColumnWidthChangedEvent=function(f){this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_WIDTH_CHANGED,f))},M.prototype.isGreaterThanMax=function(f){return this.maxWidth!=null?f>this.maxWidth:!1},M.prototype.getMinWidth=function(){return this.minWidth},M.prototype.getMaxWidth=function(){return this.maxWidth},M.prototype.getFlex=function(){return this.flex||0},M.prototype.setFlex=function(f){this.flex!==f&&(this.flex=f)},M.prototype.setMinimum=function(f){f===void 0&&(f="api"),i(this.minWidth)&&this.setActualWidth(this.minWidth,f)},M.prototype.setRowGroupActive=function(f,h){h===void 0&&(h="api"),this.rowGroupActive!==f&&(this.rowGroupActive=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_ROW_GROUP_CHANGED,h)))},M.prototype.isRowGroupActive=function(){return this.rowGroupActive},M.prototype.setPivotActive=function(f,h){h===void 0&&(h="api"),this.pivotActive!==f&&(this.pivotActive=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_PIVOT_CHANGED,h)))},M.prototype.isPivotActive=function(){return this.pivotActive},M.prototype.isAnyFunctionActive=function(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()},M.prototype.isAnyFunctionAllowed=function(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()},M.prototype.setValueActive=function(f,h){h===void 0&&(h="api"),this.aggregationActive!==f&&(this.aggregationActive=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_VALUE_CHANGED,h)))},M.prototype.isValueActive=function(){return this.aggregationActive},M.prototype.isAllowPivot=function(){return this.colDef.enablePivot===!0},M.prototype.isAllowValue=function(){return this.colDef.enableValue===!0},M.prototype.isAllowRowGroup=function(){return this.colDef.enableRowGroup===!0},M.prototype.getMenuTabs=function(f){var h=this.getColDef().menuTabs;return h==null&&(h=f),h},M.prototype.isLockPosition=function(){return console.warn("AG Grid: since v21, col.isLockPosition() should not be used, please use col.getColDef().lockPosition instead."),this.colDef?!!this.colDef.lockPosition:!1},M.prototype.isLockVisible=function(){return console.warn("AG Grid: since v21, col.isLockVisible() should not be used, please use col.getColDef().lockVisible instead."),this.colDef?!!this.colDef.lockVisible:!1},M.prototype.isLockPinned=function(){return console.warn("AG Grid: since v21, col.isLockPinned() should not be used, please use col.getColDef().lockPinned instead."),this.colDef?!!this.colDef.lockPinned:!1},M.EVENT_MOVING_CHANGED="movingChanged",M.EVENT_LEFT_CHANGED="leftChanged",M.EVENT_WIDTH_CHANGED="widthChanged",M.EVENT_LAST_LEFT_PINNED_CHANGED="lastLeftPinnedChanged",M.EVENT_FIRST_RIGHT_PINNED_CHANGED="firstRightPinnedChanged",M.EVENT_VISIBLE_CHANGED="visibleChanged",M.EVENT_FILTER_CHANGED="filterChanged",M.EVENT_FILTER_ACTIVE_CHANGED="filterActiveChanged",M.EVENT_SORT_CHANGED="sortChanged",M.EVENT_MENU_VISIBLE_CHANGED="menuVisibleChanged",M.EVENT_ROW_GROUP_CHANGED="columnRowGroupChanged",M.EVENT_PIVOT_CHANGED="columnPivotChanged",M.EVENT_VALUE_CHANGED="columnValueChanged",A([ce("gridOptionsWrapper")],M.prototype,"gridOptionsWrapper",void 0),A([ce("columnUtils")],M.prototype,"columnUtils",void 0),A([ce("columnApi")],M.prototype,"columnApi",void 0),A([ce("gridApi")],M.prototype,"gridApi",void 0),A([ce("context")],M.prototype,"context",void 0),A([it],M.prototype,"initialise",null),M}();/** + */var A=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},ye=0,H=function(){function M(f,d,g,S){this.instanceId=ye++,this.moving=!1,this.menuVisible=!1,this.filterActive=!1,this.eventService=new nt,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=f,this.userProvidedColDef=d,this.colId=g,this.primary=S,this.setState(f)}return M.prototype.getInstanceId=function(){return this.instanceId},M.prototype.setState=function(f){f.sort!==void 0?(f.sort===$e.SORT_ASC||f.sort===$e.SORT_DESC)&&(this.sort=f.sort):(f.initialSort===$e.SORT_ASC||f.initialSort===$e.SORT_DESC)&&(this.sort=f.initialSort);var d=o(f.sortIndex),g=o(f.initialSortIndex);d!==void 0?d!==null&&(this.sortIndex=d):g!==null&&(this.sortIndex=g);var S=a(f.hide),O=a(f.initialHide);S!==void 0?this.visible=!S:this.visible=!O,f.pinned!==void 0?this.setPinned(f.pinned):this.setPinned(f.initialPinned);var z=o(f.flex),te=o(f.initialFlex);z!==void 0?this.flex=z:te!==void 0&&(this.flex=te)},M.prototype.setColDef=function(f,d){this.colDef=f,this.userProvidedColDef=d,this.initMinAndMaxWidths(),this.initDotNotation()},M.prototype.getUserProvidedColDef=function(){return this.userProvidedColDef},M.prototype.setParent=function(f){this.parent=f},M.prototype.getParent=function(){return this.parent},M.prototype.setOriginalParent=function(f){this.originalParent=f},M.prototype.getOriginalParent=function(){return this.originalParent},M.prototype.initialise=function(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.validate()},M.prototype.initDotNotation=function(){var f=this.gridOptionsWrapper.isSuppressFieldDotNotation();this.fieldContainsDots=i(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!f,this.tooltipFieldContainsDots=i(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!f},M.prototype.initMinAndMaxWidths=function(){var f=this.colDef;this.minWidth=this.columnUtils.calculateColMinWidth(f),this.maxWidth=this.columnUtils.calculateColMaxWidth(f)},M.prototype.resetActualWidth=function(f){f===void 0&&(f="api");var d=this.columnUtils.calculateColInitialWidth(this.colDef);this.setActualWidth(d,f,!0)},M.prototype.isEmptyGroup=function(){return!1},M.prototype.isRowGroupDisplayed=function(f){if(r(this.colDef)||r(this.colDef.showRowGroup))return!1;var d=this.colDef.showRowGroup===!0,g=this.colDef.showRowGroup===f;return d||g},M.prototype.isPrimary=function(){return this.primary},M.prototype.isFilterAllowed=function(){var f=!!this.colDef.filter||!!this.colDef.filterFramework;return f},M.prototype.isFieldContainsDots=function(){return this.fieldContainsDots},M.prototype.isTooltipFieldContainsDots=function(){return this.tooltipFieldContainsDots},M.prototype.validate=function(){var f=this.colDef;function d(z,te,Fe){Ge(function(){Fe?console.warn(z,Fe):Ge(function(){return console.warn(z)},te)},te)}var g=this.gridOptionsWrapper.isRowModelDefault();if(g&&!Xt.isRegistered(t.ModuleNames.RowGroupingModule)){var S=["enableRowGroup","rowGroup","rowGroupIndex","enablePivot","enableValue","pivot","pivotIndex","aggFunc"];S.forEach(function(z){i(f[z])&&(Xt.isPackageBased()?d("AG Grid: "+z+" is only valid in ag-grid-enterprise, your column definition should not have "+z,"ColumnRowGroupingMissing"+z):d("AG Grid: "+z+" is only valid with AG Grid Enterprise Module "+t.ModuleNames.RowGroupingModule+" - your column definition should not have "+z,"ColumnRowGroupingMissing"+z))})}if(Xt.isRegistered(t.ModuleNames.RichSelectModule)||this.colDef.cellEditor==="agRichSelect"&&(Xt.isPackageBased()?d("AG Grid: "+this.colDef.cellEditor+" can only be used with ag-grid-enterprise","ColumnRichSelectMissing"):d("AG Grid: "+this.colDef.cellEditor+" can only be used with AG Grid Enterprise Module "+t.ModuleNames.RichSelectModule,"ColumnRichSelectMissing")),this.gridOptionsWrapper.isTreeData()){var O=["rowGroup","rowGroupIndex","pivot","pivotIndex"];O.forEach(function(z){i(f[z])&&d("AG Grid: "+z+" is not possible when doing tree data, your column definition should not have "+z,"TreeDataCannotRowGroup")})}i(this.colDef.width)&&typeof this.colDef.width!="number"&&d("AG Grid: colDef.width should be a number, not "+typeof this.colDef.width,"ColumnCheck_asdfawef"),f.pinnedRowCellRenderer&&d("AG Grid: pinnedRowCellRenderer no longer exists, use cellRendererSelector if you want a different Cell Renderer for pinned rows. Check params.node.rowPinned. This was an unfortunate (but necessary) change we had to do to allow future plans we have of re-skinng the data grid in frameworks such as React, Angular and Vue. See https://www.ag-grid.com/javascript-grid/cell-rendering/#many-renderers-one-column","colDef.pinnedRowCellRenderer-deprecated"),f.pinnedRowCellRendererParams&&d("AG Grid: pinnedRowCellRenderer no longer exists, use cellRendererSelector if you want a different Cell Renderer for pinned rows. Check params.node.rowPinned. This was an unfortunate (but necessary) change we had to do to allow future plans we have of re-skinng the data grid in frameworks such as React, Angular and Vue. See https://www.ag-grid.com/javascript-grid/cell-rendering/#many-renderers-one-column","colDef.pinnedRowCellRenderer-deprecated"),f.pinnedRowCellRendererFramework&&d("AG Grid: pinnedRowCellRenderer no longer exists, use cellRendererSelector if you want a different Cell Renderer for pinned rows. Check params.node.rowPinned. This was an unfortunate (but necessary) change we had to do to allow future plans we have of re-skinng the data grid in frameworks such as React, Angular and Vue. See https://www.ag-grid.com/javascript-grid/cell-rendering/#many-renderers-one-column","colDef.pinnedRowCellRenderer-deprecated"),f.pinnedRowValueGetter&&d("AG Grid: pinnedRowCellRenderer is deprecated, use cellRendererSelector if you want a different Cell Renderer for pinned rows. Check params.node.rowPinned. This was an unfortunate (but necessary) change we had to do to allow future plans we have of re-skinng the data grid in frameworks such as React, Angular and Vue.","colDef.pinnedRowCellRenderer-deprecated")},M.prototype.addEventListener=function(f,d){this.eventService.addEventListener(f,d)},M.prototype.removeEventListener=function(f,d){this.eventService.removeEventListener(f,d)},M.prototype.createColumnFunctionCallbackParams=function(f){return{node:f,data:f.data,column:this,colDef:this.colDef,context:this.gridOptionsWrapper.getContext(),api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi()}},M.prototype.isSuppressNavigable=function(f){if(typeof this.colDef.suppressNavigable=="boolean")return this.colDef.suppressNavigable;if(typeof this.colDef.suppressNavigable=="function"){var d=this.createColumnFunctionCallbackParams(f),g=this.colDef.suppressNavigable;return g(d)}return!1},M.prototype.isCellEditable=function(f){return f.group&&!this.gridOptionsWrapper.isEnableGroupEdit()?!1:this.isColumnFunc(f,this.colDef.editable)},M.prototype.isSuppressFillHandle=function(){return!!a(this.colDef.suppressFillHandle)},M.prototype.isAutoHeight=function(){return!!a(this.colDef.autoHeight)},M.prototype.isRowDrag=function(f){return this.isColumnFunc(f,this.colDef.rowDrag)},M.prototype.isDndSource=function(f){return this.isColumnFunc(f,this.colDef.dndSource)},M.prototype.isCellCheckboxSelection=function(f){return this.isColumnFunc(f,this.colDef.checkboxSelection)},M.prototype.isSuppressPaste=function(f){return this.isColumnFunc(f,this.colDef?this.colDef.suppressPaste:null)},M.prototype.isResizable=function(){return!!a(this.colDef.resizable)},M.prototype.isColumnFunc=function(f,d){if(typeof d=="boolean")return d;if(typeof d=="function"){var g=this.createColumnFunctionCallbackParams(f),S=d;return S(g)}return!1},M.prototype.setMoving=function(f,d){d===void 0&&(d="api"),this.moving=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_MOVING_CHANGED,d))},M.prototype.createColumnEvent=function(f,d){return{api:this.gridApi,columnApi:this.columnApi,type:f,column:this,columns:[this],source:d}},M.prototype.isMoving=function(){return this.moving},M.prototype.getSort=function(){return this.sort},M.prototype.setSort=function(f,d){d===void 0&&(d="api"),this.sort!==f&&(this.sort=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_SORT_CHANGED,d)))},M.prototype.setMenuVisible=function(f,d){d===void 0&&(d="api"),this.menuVisible!==f&&(this.menuVisible=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_MENU_VISIBLE_CHANGED,d)))},M.prototype.isMenuVisible=function(){return this.menuVisible},M.prototype.isSortAscending=function(){return this.sort===$e.SORT_ASC},M.prototype.isSortDescending=function(){return this.sort===$e.SORT_DESC},M.prototype.isSortNone=function(){return r(this.sort)},M.prototype.isSorting=function(){return i(this.sort)},M.prototype.getSortIndex=function(){return this.sortIndex},M.prototype.setSortIndex=function(f){this.sortIndex=f},M.prototype.setAggFunc=function(f){this.aggFunc=f},M.prototype.getAggFunc=function(){return this.aggFunc},M.prototype.getLeft=function(){return this.left},M.prototype.getOldLeft=function(){return this.oldLeft},M.prototype.getRight=function(){return this.left+this.actualWidth},M.prototype.setLeft=function(f,d){d===void 0&&(d="api"),this.oldLeft=this.left,this.left!==f&&(this.left=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_LEFT_CHANGED,d)))},M.prototype.isFilterActive=function(){return this.filterActive},M.prototype.setFilterActive=function(f,d,g){d===void 0&&(d="api"),this.filterActive!==f&&(this.filterActive=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_FILTER_ACTIVE_CHANGED,d)));var S=this.createColumnEvent(M.EVENT_FILTER_CHANGED,d);g&&ce(S,g),this.eventService.dispatchEvent(S)},M.prototype.setPinned=function(f){f===!0||f===$e.PINNED_LEFT?this.pinned=$e.PINNED_LEFT:f===$e.PINNED_RIGHT?this.pinned=$e.PINNED_RIGHT:this.pinned=null},M.prototype.setFirstRightPinned=function(f,d){d===void 0&&(d="api"),this.firstRightPinned!==f&&(this.firstRightPinned=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_FIRST_RIGHT_PINNED_CHANGED,d)))},M.prototype.setLastLeftPinned=function(f,d){d===void 0&&(d="api"),this.lastLeftPinned!==f&&(this.lastLeftPinned=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_LAST_LEFT_PINNED_CHANGED,d)))},M.prototype.isFirstRightPinned=function(){return this.firstRightPinned},M.prototype.isLastLeftPinned=function(){return this.lastLeftPinned},M.prototype.isPinned=function(){return this.pinned===$e.PINNED_LEFT||this.pinned===$e.PINNED_RIGHT},M.prototype.isPinnedLeft=function(){return this.pinned===$e.PINNED_LEFT},M.prototype.isPinnedRight=function(){return this.pinned===$e.PINNED_RIGHT},M.prototype.getPinned=function(){return this.pinned},M.prototype.setVisible=function(f,d){d===void 0&&(d="api");var g=f===!0;this.visible!==g&&(this.visible=g,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_VISIBLE_CHANGED,d)))},M.prototype.isVisible=function(){return this.visible},M.prototype.getColDef=function(){return this.colDef},M.prototype.getColumnGroupShow=function(){return this.colDef.columnGroupShow},M.prototype.getColId=function(){return this.colId},M.prototype.getId=function(){return this.getColId()},M.prototype.getUniqueId=function(){return this.getId()},M.prototype.getDefinition=function(){return this.colDef},M.prototype.getActualWidth=function(){return this.actualWidth},M.prototype.createBaseColDefParams=function(f){var d={node:f,data:f.data,colDef:this.colDef,column:this,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()};return d},M.prototype.getColSpan=function(f){if(r(this.colDef.colSpan))return 1;var d=this.createBaseColDefParams(f),g=this.colDef.colSpan(d);return Math.max(g,1)},M.prototype.getRowSpan=function(f){if(r(this.colDef.rowSpan))return 1;var d=this.createBaseColDefParams(f),g=this.colDef.rowSpan(d);return Math.max(g,1)},M.prototype.setActualWidth=function(f,d,g){d===void 0&&(d="api"),g===void 0&&(g=!1),this.minWidth!=null&&(f=Math.max(f,this.minWidth)),this.maxWidth!=null&&(f=Math.min(f,this.maxWidth)),this.actualWidth!==f&&(this.actualWidth=f,this.flex&&d!=="flex"&&d!=="gridInitializing"&&(this.flex=null),g||this.fireColumnWidthChangedEvent(d))},M.prototype.fireColumnWidthChangedEvent=function(f){this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_WIDTH_CHANGED,f))},M.prototype.isGreaterThanMax=function(f){return this.maxWidth!=null?f>this.maxWidth:!1},M.prototype.getMinWidth=function(){return this.minWidth},M.prototype.getMaxWidth=function(){return this.maxWidth},M.prototype.getFlex=function(){return this.flex||0},M.prototype.setFlex=function(f){this.flex!==f&&(this.flex=f)},M.prototype.setMinimum=function(f){f===void 0&&(f="api"),i(this.minWidth)&&this.setActualWidth(this.minWidth,f)},M.prototype.setRowGroupActive=function(f,d){d===void 0&&(d="api"),this.rowGroupActive!==f&&(this.rowGroupActive=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_ROW_GROUP_CHANGED,d)))},M.prototype.isRowGroupActive=function(){return this.rowGroupActive},M.prototype.setPivotActive=function(f,d){d===void 0&&(d="api"),this.pivotActive!==f&&(this.pivotActive=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_PIVOT_CHANGED,d)))},M.prototype.isPivotActive=function(){return this.pivotActive},M.prototype.isAnyFunctionActive=function(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()},M.prototype.isAnyFunctionAllowed=function(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()},M.prototype.setValueActive=function(f,d){d===void 0&&(d="api"),this.aggregationActive!==f&&(this.aggregationActive=f,this.eventService.dispatchEvent(this.createColumnEvent(M.EVENT_VALUE_CHANGED,d)))},M.prototype.isValueActive=function(){return this.aggregationActive},M.prototype.isAllowPivot=function(){return this.colDef.enablePivot===!0},M.prototype.isAllowValue=function(){return this.colDef.enableValue===!0},M.prototype.isAllowRowGroup=function(){return this.colDef.enableRowGroup===!0},M.prototype.getMenuTabs=function(f){var d=this.getColDef().menuTabs;return d==null&&(d=f),d},M.prototype.isLockPosition=function(){return console.warn("AG Grid: since v21, col.isLockPosition() should not be used, please use col.getColDef().lockPosition instead."),this.colDef?!!this.colDef.lockPosition:!1},M.prototype.isLockVisible=function(){return console.warn("AG Grid: since v21, col.isLockVisible() should not be used, please use col.getColDef().lockVisible instead."),this.colDef?!!this.colDef.lockVisible:!1},M.prototype.isLockPinned=function(){return console.warn("AG Grid: since v21, col.isLockPinned() should not be used, please use col.getColDef().lockPinned instead."),this.colDef?!!this.colDef.lockPinned:!1},M.EVENT_MOVING_CHANGED="movingChanged",M.EVENT_LEFT_CHANGED="leftChanged",M.EVENT_WIDTH_CHANGED="widthChanged",M.EVENT_LAST_LEFT_PINNED_CHANGED="lastLeftPinnedChanged",M.EVENT_FIRST_RIGHT_PINNED_CHANGED="firstRightPinnedChanged",M.EVENT_VISIBLE_CHANGED="visibleChanged",M.EVENT_FILTER_CHANGED="filterChanged",M.EVENT_FILTER_ACTIVE_CHANGED="filterActiveChanged",M.EVENT_SORT_CHANGED="sortChanged",M.EVENT_MENU_VISIBLE_CHANGED="menuVisibleChanged",M.EVENT_ROW_GROUP_CHANGED="columnRowGroupChanged",M.EVENT_PIVOT_CHANGED="columnPivotChanged",M.EVENT_VALUE_CHANGED="columnValueChanged",A([pe("gridOptionsWrapper")],M.prototype,"gridOptionsWrapper",void 0),A([pe("columnUtils")],M.prototype,"columnUtils",void 0),A([pe("columnApi")],M.prototype,"columnApi",void 0),A([pe("gridApi")],M.prototype,"gridApi",void 0),A([pe("context")],M.prototype,"context",void 0),A([ht],M.prototype,"initialise",null),M}();/** * @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/ * @license MIT - */function T(){for(var M=[],f=0;f0}function m(M){if(!(!M||!M.length))return M[M.length-1]}function _(M,f,h){return M==null&&f==null?!0:M!=null&&f!=null&&M.length===f.length&&M.every(function(g,x){return h?h(g,f[x]):f[x]===g})}function C(M,f){return _(M,f)}function D(M,f){return _(M,f)}function F(M){return M.sort(function(f,h){return f-h})}function B(M,f){if(M)for(var h=M.length-2;h>=0;h--){var g=M[h]===f,x=M[h+1]===f;g&&x&&M.splice(h+1,1)}}function q(M,f){var h=M.indexOf(f);h>=0&&M.splice(h,1)}function Z(M,f){f.forEach(function(h){return q(M,h)})}function oe(M,f,h){M.splice(h,0,f)}function ue(M,f,h){if(!(M==null||f==null))for(var g=f.length-1;g>=0;g--){var x=f[g];oe(M,x,h)}}function be(M,f,h){Z(M,f),f.slice().reverse().forEach(function(g){return oe(M,g,h)})}function De(M,f){return M.indexOf(f)>-1}function qe(M){return[].concat.apply([],M)}function rt(M,f){f==null||M==null||f.forEach(function(h){return M.push(h)})}function Dt(M){return M.map(s)}function Vt(M,f){if(M!=null)for(var h=M.length-1;h>=0;h--)f(M[h],h)}var Ke=Object.freeze({firstExistingValue:T,existsAndNotEmpty:b,last:m,areEqual:_,compareArrays:C,shallowCompare:D,sortNumerically:F,removeRepeatsFromArray:B,removeFromArray:q,removeAllFromArray:Z,insertIntoArray:oe,insertArrayIntoArray:ue,moveInArray:be,includes:De,flatten:qe,pushAll:rt,toStrings:Dt,forEachReverse:Vt});/** + */function T(){for(var M=[],f=0;f0}function m(M){if(!(!M||!M.length))return M[M.length-1]}function _(M,f,d){return M==null&&f==null?!0:M!=null&&f!=null&&M.length===f.length&&M.every(function(g,S){return d?d(g,f[S]):f[S]===g})}function C(M,f){return _(M,f)}function D(M,f){return _(M,f)}function L(M){return M.sort(function(f,d){return f-d})}function B(M,f){if(M)for(var d=M.length-2;d>=0;d--){var g=M[d]===f,S=M[d+1]===f;g&&S&&M.splice(d+1,1)}}function q(M,f){var d=M.indexOf(f);d>=0&&M.splice(d,1)}function Q(M,f){f.forEach(function(d){return q(M,d)})}function oe(M,f,d){M.splice(d,0,f)}function le(M,f,d){if(!(M==null||f==null))for(var g=f.length-1;g>=0;g--){var S=f[g];oe(M,S,d)}}function be(M,f,d){Q(M,f),f.slice().reverse().forEach(function(g){return oe(M,g,d)})}function Me(M,f){return M.indexOf(f)>-1}function Ye(M){return[].concat.apply([],M)}function it(M,f){f==null||M==null||f.forEach(function(d){return M.push(d)})}function Lt(M){return M.map(s)}function Ut(M,f){if(M!=null)for(var d=M.length-1;d>=0;d--)f(M[d],d)}var Je=Object.freeze({firstExistingValue:T,existsAndNotEmpty:b,last:m,areEqual:_,compareArrays:C,shallowCompare:D,sortNumerically:L,removeRepeatsFromArray:B,removeFromArray:q,removeAllFromArray:Q,insertIntoArray:oe,insertArrayIntoArray:le,moveInArray:be,includes:Me,flatten:Ye,pushAll:it,toStrings:Lt,forEachReverse:Ut});/** * @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/ * @license MIT - */var Ot=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},ei=function(){function M(f,h,g,x){this.displayedChildren=[],this.localEventService=new gt,this.groupId=h,this.instanceId=g,this.providedColumnGroup=f,this.pinned=x}return M.createUniqueId=function(f,h){return f+"_"+h},M.prototype.reset=function(){this.parent=null,this.children=null,this.displayedChildren=null},M.prototype.getParent=function(){return this.parent},M.prototype.setParent=function(f){this.parent=f},M.prototype.getUniqueId=function(){return M.createUniqueId(this.groupId,this.instanceId)},M.prototype.isEmptyGroup=function(){return this.displayedChildren.length===0},M.prototype.isMoving=function(){var f=this.getProvidedColumnGroup().getLeafColumns();return!f||f.length===0?!1:f.every(function(h){return h.isMoving()})},M.prototype.checkLeft=function(){if(this.displayedChildren.forEach(function(x){x instanceof M&&x.checkLeft()}),this.displayedChildren.length>0)if(this.gridOptionsWrapper.isEnableRtl()){var f=m(this.displayedChildren),h=f.getLeft();this.setLeft(h)}else{var g=this.displayedChildren[0].getLeft();this.setLeft(g)}else this.setLeft(null)},M.prototype.getLeft=function(){return this.left},M.prototype.getOldLeft=function(){return this.oldLeft},M.prototype.setLeft=function(f){this.oldLeft=f,this.left!==f&&(this.left=f,this.localEventService.dispatchEvent(this.createAgEvent(M.EVENT_LEFT_CHANGED)))},M.prototype.getPinned=function(){return this.pinned},M.prototype.createAgEvent=function(f){return{type:f}},M.prototype.addEventListener=function(f,h){this.localEventService.addEventListener(f,h)},M.prototype.removeEventListener=function(f,h){this.localEventService.removeEventListener(f,h)},M.prototype.getGroupId=function(){return this.groupId},M.prototype.getInstanceId=function(){return this.instanceId},M.prototype.isChildInThisGroupDeepSearch=function(f){var h=!1;return this.children.forEach(function(g){f===g&&(h=!0),g instanceof M&&g.isChildInThisGroupDeepSearch(f)&&(h=!0)}),h},M.prototype.getActualWidth=function(){var f=0;return this.displayedChildren&&this.displayedChildren.forEach(function(h){f+=h.getActualWidth()}),f},M.prototype.isResizable=function(){if(!this.displayedChildren)return!1;var f=!1;return this.displayedChildren.forEach(function(h){h.isResizable()&&(f=!0)}),f},M.prototype.getMinWidth=function(){var f=0;return this.displayedChildren.forEach(function(h){f+=h.getMinWidth()||0}),f},M.prototype.addChild=function(f){this.children||(this.children=[]),this.children.push(f)},M.prototype.getDisplayedChildren=function(){return this.displayedChildren},M.prototype.getLeafColumns=function(){var f=[];return this.addLeafColumns(f),f},M.prototype.getDisplayedLeafColumns=function(){var f=[];return this.addDisplayedLeafColumns(f),f},M.prototype.getDefinition=function(){return this.providedColumnGroup.getColGroupDef()},M.prototype.getColGroupDef=function(){return this.providedColumnGroup.getColGroupDef()},M.prototype.isPadding=function(){return this.providedColumnGroup.isPadding()},M.prototype.isExpandable=function(){return this.providedColumnGroup.isExpandable()},M.prototype.isExpanded=function(){return this.providedColumnGroup.isExpanded()},M.prototype.setExpanded=function(f){this.providedColumnGroup.setExpanded(f)},M.prototype.addDisplayedLeafColumns=function(f){this.displayedChildren.forEach(function(h){h instanceof W?f.push(h):h instanceof M&&h.addDisplayedLeafColumns(f)})},M.prototype.addLeafColumns=function(f){this.children.forEach(function(h){h instanceof W?f.push(h):h instanceof M&&h.addLeafColumns(f)})},M.prototype.getChildren=function(){return this.children},M.prototype.getColumnGroupShow=function(){return this.providedColumnGroup.getColumnGroupShow()},M.prototype.getProvidedColumnGroup=function(){return this.providedColumnGroup},M.prototype.getOriginalColumnGroup=function(){return console.warn("AG Grid: columnGroup.getOriginalColumnGroup() is deprecated due to a method rename, use columnGroup.getProvidedColumnGroup() instead"),this.getProvidedColumnGroup()},M.prototype.getPaddingLevel=function(){var f=this.getParent();return!this.isPadding()||!f||!f.isPadding()?0:1+f.getPaddingLevel()},M.prototype.calculateDisplayedColumns=function(){var f=this;this.displayedChildren=[];for(var h=this;h!=null&&h.isPadding();)h=h.getParent();var g=h?h.providedColumnGroup.isExpandable():!1;if(!g){this.displayedChildren=this.children,this.localEventService.dispatchEvent(this.createAgEvent(M.EVENT_DISPLAYED_CHILDREN_CHANGED));return}this.children.forEach(function(x){var P=x instanceof M&&(!x.displayedChildren||!x.displayedChildren.length);if(!P){var z=x.getColumnGroupShow();switch(z){case M.HEADER_GROUP_SHOW_OPEN:h.providedColumnGroup.isExpanded()&&f.displayedChildren.push(x);break;case M.HEADER_GROUP_SHOW_CLOSED:h.providedColumnGroup.isExpanded()||f.displayedChildren.push(x);break;default:f.displayedChildren.push(x);break}}}),this.localEventService.dispatchEvent(this.createAgEvent(M.EVENT_DISPLAYED_CHILDREN_CHANGED))},M.HEADER_GROUP_SHOW_OPEN="open",M.HEADER_GROUP_SHOW_CLOSED="closed",M.EVENT_LEFT_CHANGED="leftChanged",M.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged",Ot([ce("gridOptionsWrapper")],M.prototype,"gridOptionsWrapper",void 0),M}();/** + */var Rt=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},ri=function(){function M(f,d,g,S){this.displayedChildren=[],this.localEventService=new nt,this.groupId=d,this.instanceId=g,this.providedColumnGroup=f,this.pinned=S}return M.createUniqueId=function(f,d){return f+"_"+d},M.prototype.reset=function(){this.parent=null,this.children=null,this.displayedChildren=null},M.prototype.getParent=function(){return this.parent},M.prototype.setParent=function(f){this.parent=f},M.prototype.getUniqueId=function(){return M.createUniqueId(this.groupId,this.instanceId)},M.prototype.isEmptyGroup=function(){return this.displayedChildren.length===0},M.prototype.isMoving=function(){var f=this.getProvidedColumnGroup().getLeafColumns();return!f||f.length===0?!1:f.every(function(d){return d.isMoving()})},M.prototype.checkLeft=function(){if(this.displayedChildren.forEach(function(S){S instanceof M&&S.checkLeft()}),this.displayedChildren.length>0)if(this.gridOptionsWrapper.isEnableRtl()){var f=m(this.displayedChildren),d=f.getLeft();this.setLeft(d)}else{var g=this.displayedChildren[0].getLeft();this.setLeft(g)}else this.setLeft(null)},M.prototype.getLeft=function(){return this.left},M.prototype.getOldLeft=function(){return this.oldLeft},M.prototype.setLeft=function(f){this.oldLeft=f,this.left!==f&&(this.left=f,this.localEventService.dispatchEvent(this.createAgEvent(M.EVENT_LEFT_CHANGED)))},M.prototype.getPinned=function(){return this.pinned},M.prototype.createAgEvent=function(f){return{type:f}},M.prototype.addEventListener=function(f,d){this.localEventService.addEventListener(f,d)},M.prototype.removeEventListener=function(f,d){this.localEventService.removeEventListener(f,d)},M.prototype.getGroupId=function(){return this.groupId},M.prototype.getInstanceId=function(){return this.instanceId},M.prototype.isChildInThisGroupDeepSearch=function(f){var d=!1;return this.children.forEach(function(g){f===g&&(d=!0),g instanceof M&&g.isChildInThisGroupDeepSearch(f)&&(d=!0)}),d},M.prototype.getActualWidth=function(){var f=0;return this.displayedChildren&&this.displayedChildren.forEach(function(d){f+=d.getActualWidth()}),f},M.prototype.isResizable=function(){if(!this.displayedChildren)return!1;var f=!1;return this.displayedChildren.forEach(function(d){d.isResizable()&&(f=!0)}),f},M.prototype.getMinWidth=function(){var f=0;return this.displayedChildren.forEach(function(d){f+=d.getMinWidth()||0}),f},M.prototype.addChild=function(f){this.children||(this.children=[]),this.children.push(f)},M.prototype.getDisplayedChildren=function(){return this.displayedChildren},M.prototype.getLeafColumns=function(){var f=[];return this.addLeafColumns(f),f},M.prototype.getDisplayedLeafColumns=function(){var f=[];return this.addDisplayedLeafColumns(f),f},M.prototype.getDefinition=function(){return this.providedColumnGroup.getColGroupDef()},M.prototype.getColGroupDef=function(){return this.providedColumnGroup.getColGroupDef()},M.prototype.isPadding=function(){return this.providedColumnGroup.isPadding()},M.prototype.isExpandable=function(){return this.providedColumnGroup.isExpandable()},M.prototype.isExpanded=function(){return this.providedColumnGroup.isExpanded()},M.prototype.setExpanded=function(f){this.providedColumnGroup.setExpanded(f)},M.prototype.addDisplayedLeafColumns=function(f){this.displayedChildren.forEach(function(d){d instanceof H?f.push(d):d instanceof M&&d.addDisplayedLeafColumns(f)})},M.prototype.addLeafColumns=function(f){this.children.forEach(function(d){d instanceof H?f.push(d):d instanceof M&&d.addLeafColumns(f)})},M.prototype.getChildren=function(){return this.children},M.prototype.getColumnGroupShow=function(){return this.providedColumnGroup.getColumnGroupShow()},M.prototype.getProvidedColumnGroup=function(){return this.providedColumnGroup},M.prototype.getOriginalColumnGroup=function(){return console.warn("AG Grid: columnGroup.getOriginalColumnGroup() is deprecated due to a method rename, use columnGroup.getProvidedColumnGroup() instead"),this.getProvidedColumnGroup()},M.prototype.getPaddingLevel=function(){var f=this.getParent();return!this.isPadding()||!f||!f.isPadding()?0:1+f.getPaddingLevel()},M.prototype.calculateDisplayedColumns=function(){var f=this;this.displayedChildren=[];for(var d=this;d!=null&&d.isPadding();)d=d.getParent();var g=d?d.providedColumnGroup.isExpandable():!1;if(!g){this.displayedChildren=this.children,this.localEventService.dispatchEvent(this.createAgEvent(M.EVENT_DISPLAYED_CHILDREN_CHANGED));return}this.children.forEach(function(S){var O=S instanceof M&&(!S.displayedChildren||!S.displayedChildren.length);if(!O){var z=S.getColumnGroupShow();switch(z){case M.HEADER_GROUP_SHOW_OPEN:d.providedColumnGroup.isExpanded()&&f.displayedChildren.push(S);break;case M.HEADER_GROUP_SHOW_CLOSED:d.providedColumnGroup.isExpanded()||f.displayedChildren.push(S);break;default:f.displayedChildren.push(S);break}}}),this.localEventService.dispatchEvent(this.createAgEvent(M.EVENT_DISPLAYED_CHILDREN_CHANGED))},M.HEADER_GROUP_SHOW_OPEN="open",M.HEADER_GROUP_SHOW_CLOSED="closed",M.EVENT_LEFT_CHANGED="leftChanged",M.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged",Rt([pe("gridOptionsWrapper")],M.prototype,"gridOptionsWrapper",void 0),M}();/** * @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/ * @license MIT - */var Jt=function(){function M(f,h,g,x){this.localEventService=new gt,this.expandable=!1,this.colGroupDef=f,this.groupId=h,this.expanded=!!f&&!!f.openByDefault,this.padding=g,this.level=x}return M.prototype.setOriginalParent=function(f){this.originalParent=f},M.prototype.getOriginalParent=function(){return this.originalParent},M.prototype.getLevel=function(){return this.level},M.prototype.isVisible=function(){return this.children?this.children.some(function(f){return f.isVisible()}):!1},M.prototype.isPadding=function(){return this.padding},M.prototype.setExpanded=function(f){this.expanded=f===void 0?!1:f;var h={type:M.EVENT_EXPANDED_CHANGED};this.localEventService.dispatchEvent(h)},M.prototype.isExpandable=function(){return this.expandable},M.prototype.isExpanded=function(){return this.expanded},M.prototype.getGroupId=function(){return this.groupId},M.prototype.getId=function(){return this.getGroupId()},M.prototype.setChildren=function(f){this.children=f},M.prototype.getChildren=function(){return this.children},M.prototype.getColGroupDef=function(){return this.colGroupDef},M.prototype.getLeafColumns=function(){var f=[];return this.addLeafColumns(f),f},M.prototype.addLeafColumns=function(f){this.children&&this.children.forEach(function(h){h instanceof W?f.push(h):h instanceof M&&h.addLeafColumns(f)})},M.prototype.getColumnGroupShow=function(){var f=this.colGroupDef;if(f)return f.columnGroupShow},M.prototype.setupExpandable=function(){var f=this;this.setExpandable(),this.getLeafColumns().forEach(function(h){return h.addEventListener(W.EVENT_VISIBLE_CHANGED,f.onColumnVisibilityChanged.bind(f))})},M.prototype.setExpandable=function(){if(!this.isPadding()){for(var f=!1,h=!1,g=!1,x=this.findChildrenRemovingPadding(),P=0,z=x.length;P=0}function xo(M){for(var f=[],h=M.target;h;)f.push(h),h=h.parentElement;return f}function kr(M){M.__agGridEventPath=is(M)}function is(M){var f=M;return f.path?f.path:f.composedPath?f.composedPath():f.__agGridEventPath?f.__agGridEventPath:xo(M)}function Hn(M,f,h,g){var x=De(bi,h),P=x?{passive:!0}:void 0;M&&M.addEventListener&&M.addEventListener(f,h,g,P)}var En=Object.freeze({stopPropagationForAgGrid:Ri,isStopPropagationForAgGrid:er,isEventSupported:ar,getCtrlForEvent:mi,addChangeListener:dn,isElementInEventPath:Lr,createEventPath:xo,addAgGridEventPath:kr,getEventPath:is,addSafePassiveEventListener:Hn});/** + */var ii="__ag_Grid_Stop_Propagation",Ci=["touchstart","touchend","touchmove","touchcancel"],ki={};function Ni(M){M[ii]=!0}function tr(M){return M[ii]===!0}var cr=function(){var M={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"},f=function(d){if(typeof ki[d]=="boolean")return ki[d];var g=document.createElement(M[d]||"div");return d="on"+d,ki[d]=d in g};return f}();function wi(M,f,d){for(var g=f.target;g;){var S=M.getDomData(g,d);if(S)return S;g=g.parentElement}return null}function bn(M,f){M.addEventListener("changed",f),M.addEventListener("paste",f),M.addEventListener("input",f)}function qr(M,f){return!f||!M?!1:os(f).indexOf(M)>=0}function eo(M){for(var f=[],d=M.target;d;)f.push(d),d=d.parentElement;return f}function Ur(M){M.__agGridEventPath=os(M)}function os(M){var f=M;return f.path?f.path:f.composedPath?f.composedPath():f.__agGridEventPath?f.__agGridEventPath:eo(M)}function Wn(M,f,d,g){var S=Me(Ci,d),O=S?{passive:!0}:void 0;M&&M.addEventListener&&M.addEventListener(f,d,g,O)}var Mn=Object.freeze({stopPropagationForAgGrid:Ni,isStopPropagationForAgGrid:tr,isEventSupported:cr,getCtrlForEvent:wi,addChangeListener:bn,isElementInEventPath:qr,createEventPath:eo,addAgGridEventPath:Ur,getEventPath:os,addSafePassiveEventListener:Wn});/** * @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/ * @license MIT - */var Kn=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},$i=function(){function M(){var f=this;this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.isAlive=function(){return!f.destroyed}}return M.prototype.getFrameworkOverrides=function(){return this.frameworkOverrides},M.prototype.getContext=function(){return this.context},M.prototype.destroy=function(){this.destroyFunctions.forEach(function(f){return f()}),this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchEvent({type:M.EVENT_DESTROYED})},M.prototype.addEventListener=function(f,h){this.localEventService||(this.localEventService=new gt),this.localEventService.addEventListener(f,h)},M.prototype.removeEventListener=function(f,h){this.localEventService&&this.localEventService.removeEventListener(f,h)},M.prototype.dispatchEventAsync=function(f){var h=this;window.setTimeout(function(){return h.dispatchEvent(f)},0)},M.prototype.dispatchEvent=function(f){this.localEventService&&this.localEventService.dispatchEvent(f)},M.prototype.addManagedListener=function(f,h,g){var x=this;if(!this.destroyed){f instanceof HTMLElement?Hn(this.getFrameworkOverrides(),f,h,g):f.addEventListener(h,g);var P=function(){return f.removeEventListener(h,g),x.destroyFunctions=x.destroyFunctions.filter(function(z){return z!==P}),null};return this.destroyFunctions.push(P),P}},M.prototype.addDestroyFunc=function(f){this.isAlive()?this.destroyFunctions.push(f):f()},M.prototype.createManagedBean=function(f,h){var g=this.createBean(f,h);return this.addDestroyFunc(this.destroyBean.bind(this,f,h)),g},M.prototype.createBean=function(f,h,g){return(h||this.getContext()).createBean(f,g)},M.prototype.destroyBean=function(f,h){return(h||this.getContext()).destroyBean(f)},M.prototype.destroyBeans=function(f,h){var g=this;return f&&f.forEach(function(x){return g.destroyBean(x,h)}),[]},M.EVENT_DESTROYED="destroyed",Kn([ce("frameworkOverrides")],M.prototype,"frameworkOverrides",void 0),Kn([ce("context")],M.prototype,"context",void 0),Kn([ce("eventService")],M.prototype,"eventService",void 0),Kn([ce("gridOptionsWrapper")],M.prototype,"gridOptionsWrapper",void 0),Kn([pt],M.prototype,"destroy",null),M}();/** + */var es=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},ji=function(){function M(){var f=this;this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.isAlive=function(){return!f.destroyed}}return M.prototype.getFrameworkOverrides=function(){return this.frameworkOverrides},M.prototype.getContext=function(){return this.context},M.prototype.destroy=function(){this.destroyFunctions.forEach(function(f){return f()}),this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchEvent({type:M.EVENT_DESTROYED})},M.prototype.addEventListener=function(f,d){this.localEventService||(this.localEventService=new nt),this.localEventService.addEventListener(f,d)},M.prototype.removeEventListener=function(f,d){this.localEventService&&this.localEventService.removeEventListener(f,d)},M.prototype.dispatchEventAsync=function(f){var d=this;window.setTimeout(function(){return d.dispatchEvent(f)},0)},M.prototype.dispatchEvent=function(f){this.localEventService&&this.localEventService.dispatchEvent(f)},M.prototype.addManagedListener=function(f,d,g){var S=this;if(!this.destroyed){f instanceof HTMLElement?Wn(this.getFrameworkOverrides(),f,d,g):f.addEventListener(d,g);var O=function(){return f.removeEventListener(d,g),S.destroyFunctions=S.destroyFunctions.filter(function(z){return z!==O}),null};return this.destroyFunctions.push(O),O}},M.prototype.addDestroyFunc=function(f){this.isAlive()?this.destroyFunctions.push(f):f()},M.prototype.createManagedBean=function(f,d){var g=this.createBean(f,d);return this.addDestroyFunc(this.destroyBean.bind(this,f,d)),g},M.prototype.createBean=function(f,d,g){return(d||this.getContext()).createBean(f,g)},M.prototype.destroyBean=function(f,d){return(d||this.getContext()).destroyBean(f)},M.prototype.destroyBeans=function(f,d){var g=this;return f&&f.forEach(function(S){return g.destroyBean(S,d)}),[]},M.EVENT_DESTROYED="destroyed",es([pe("frameworkOverrides")],M.prototype,"frameworkOverrides",void 0),es([pe("context")],M.prototype,"context",void 0),es([pe("eventService")],M.prototype,"eventService",void 0),es([pe("gridOptionsWrapper")],M.prototype,"gridOptionsWrapper",void 0),es([wt],M.prototype,"destroy",null),M}();/** * @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/ * @license MIT - */var Ur=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Qo=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},In=function(M,f){return function(h,g){f(h,g,M)}},Xi=function(M){Ur(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.setBeans=function(h){this.logger=h.create("ColumnFactory")},f.prototype.createColumnTree=function(h,g,x){var P=new S,z=this.extractExistingTreeData(x),ee=z.existingCols,Me=z.existingGroups,je=z.existingColKeys;P.addExistingKeys(je);var ut=this.recursivelyCreateColumns(h,0,g,ee,P,Me),Rt=this.findMaxDept(ut,0);this.logger.log("Number of levels for grouped columns is "+Rt);var Zt=this.balanceColumnTree(ut,0,Rt,P),vi=function(Ci,qi){Ci instanceof Jt&&Ci.setupExpandable(),Ci.setOriginalParent(qi)};return this.columnUtils.depthFirstOriginalTreeSearch(null,Zt,vi),{columnTree:Zt,treeDept:Rt}},f.prototype.extractExistingTreeData=function(h){var g=[],x=[],P=[];return h&&this.columnUtils.depthFirstOriginalTreeSearch(null,h,function(z){if(z instanceof Jt){var ee=z;x.push(ee)}else{var Me=z;P.push(Me.getId()),g.push(Me)}}),{existingCols:g,existingGroups:x,existingColKeys:P}},f.prototype.createForAutoGroups=function(h,g){var x=this;return h.map(function(P){return x.createAutoGroupTreeItem(g,P)})},f.prototype.createAutoGroupTreeItem=function(h,g){for(var x=this.findDepth(h),P=g,z=x-1;z>=0;z--){var ee=new Jt(null,"FAKE_PATH_"+g.getId()+"}_"+z,!0,z);this.context.createBean(ee),ee.setChildren([P]),P.setOriginalParent(ee),P=ee}return P},f.prototype.findDepth=function(h){for(var g=0,x=h;x&&x[0]&&x[0]instanceof Jt;)g++,x=x[0].getChildren();return g},f.prototype.balanceColumnTree=function(h,g,x,P){for(var z=[],ee=0;ee=g;vi--){var Ci=P.getUniqueKey(null,null),qi=this.createMergedColGroupDef(null),hr=new Jt(qi,Ci,!0,g);this.context.createBean(hr),Zt&&Zt.setChildren([hr]),Zt=hr,Rt||(Rt=Zt)}if(Rt&&Zt){z.push(Rt);var Rr=h.some(function(Ar){return Ar instanceof Jt});if(Rr){Zt.setChildren([Me]);continue}else{Zt.setChildren(h);break}}z.push(Me)}}return z},f.prototype.findMaxDept=function(h,g){for(var x=g,P=0;P=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},An=function(M,f){return function(d,g){f(d,g,M)}},Zi=function(M){Xr(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.setBeans=function(d){this.logger=d.create("ColumnFactory")},f.prototype.createColumnTree=function(d,g,S){var O=new x,z=this.extractExistingTreeData(S),te=z.existingCols,Fe=z.existingGroups,Ue=z.existingColKeys;O.addExistingKeys(Ue);var ut=this.recursivelyCreateColumns(d,0,g,te,O,Fe),Mt=this.findMaxDept(ut,0);this.logger.log("Number of levels for grouped columns is "+Mt);var ni=this.balanceColumnTree(ut,0,Mt,O),Si=function(Pi,Qi){Pi instanceof ti&&Pi.setupExpandable(),Pi.setOriginalParent(Qi)};return this.columnUtils.depthFirstOriginalTreeSearch(null,ni,Si),{columnTree:ni,treeDept:Mt}},f.prototype.extractExistingTreeData=function(d){var g=[],S=[],O=[];return d&&this.columnUtils.depthFirstOriginalTreeSearch(null,d,function(z){if(z instanceof ti){var te=z;S.push(te)}else{var Fe=z;O.push(Fe.getId()),g.push(Fe)}}),{existingCols:g,existingGroups:S,existingColKeys:O}},f.prototype.createForAutoGroups=function(d,g){var S=this;return d.map(function(O){return S.createAutoGroupTreeItem(g,O)})},f.prototype.createAutoGroupTreeItem=function(d,g){for(var S=this.findDepth(d),O=g,z=S-1;z>=0;z--){var te=new ti(null,"FAKE_PATH_"+g.getId()+"}_"+z,!0,z);this.context.createBean(te),te.setChildren([O]),O.setOriginalParent(te),O=te}return O},f.prototype.findDepth=function(d){for(var g=0,S=d;S&&S[0]&&S[0]instanceof ti;)g++,S=S[0].getChildren();return g},f.prototype.balanceColumnTree=function(d,g,S,O){for(var z=[],te=0;te=g;Si--){var Pi=O.getUniqueKey(null,null),Qi=this.createMergedColGroupDef(null),_r=new ti(Qi,Pi,!0,g);this.context.createBean(_r),ni&&ni.setChildren([_r]),ni=_r,Mt||(Mt=ni)}if(Mt&&ni){z.push(Mt);var Hr=d.some(function($r){return $r instanceof ti});if(Hr){ni.setChildren([Fe]);continue}else{ni.setChildren(d);break}}z.push(Fe)}}return z},f.prototype.findMaxDept=function(d,g){for(var S=g,O=0;O"']/g,Ta={"&":"&","<":"<",">":">",'"':""","'":"'"};function ea(M){var f=String.fromCharCode;function h(Rt){var Zt=[];if(!Rt)return[];for(var vi=Rt.length,Ci=0,qi,hr;Ci=55296&&qi<=56319&&Ci=55296&&Rt<=57343)throw Error("Lone surrogate U+"+Rt.toString(16).toUpperCase()+" is not a scalar value")}function x(Rt,Zt){return f(Rt>>Zt&63|128)}function P(Rt){if(Rt>=0&&Rt<=31&&Rt!==10){var Zt=Rt.toString(16).toUpperCase(),vi=Zt.padStart(4,"0");return"_x"+vi+"_"}if(!(Rt&4294967168))return f(Rt);var Ci="";return Rt&4294965248?Rt&4294901760?Rt&4292870144||(Ci=f(Rt>>18&7|240),Ci+=x(Rt,12),Ci+=x(Rt,6)):(g(Rt),Ci=f(Rt>>12&15|224),Ci+=x(Rt,6)):Ci=f(Rt>>6&31|192),Ci+=f(Rt&63|128),Ci}for(var z=h(M),ee=z.length,Me=-1,je,ut="";++Me1?g.substring(1,g.length):"")}).join(" ")}var jr=Object.freeze({utf8_encode:ea,camelCaseToHyphen:zt,hyphenToCamelCase:Ha,capitalise:wi,escapeString:_t,camelCaseToHumanText:Mr});/** + */var Mr=/[&<>"']/g,Qo={"&":"&","<":"<",">":">",'"':""","'":"'"};function Go(M){var f=String.fromCharCode;function d(Mt){var ni=[];if(!Mt)return[];for(var Si=Mt.length,Pi=0,Qi,_r;Pi=55296&&Qi<=56319&&Pi=55296&&Mt<=57343)throw Error("Lone surrogate U+"+Mt.toString(16).toUpperCase()+" is not a scalar value")}function S(Mt,ni){return f(Mt>>ni&63|128)}function O(Mt){if(Mt>=0&&Mt<=31&&Mt!==10){var ni=Mt.toString(16).toUpperCase(),Si=ni.padStart(4,"0");return"_x"+Si+"_"}if(!(Mt&4294967168))return f(Mt);var Pi="";return Mt&4294965248?Mt&4294901760?Mt&4292870144||(Pi=f(Mt>>18&7|240),Pi+=S(Mt,12),Pi+=S(Mt,6)):(g(Mt),Pi=f(Mt>>12&15|224),Pi+=S(Mt,6)):Pi=f(Mt>>6&31|192),Pi+=f(Mt&63|128),Pi}for(var z=d(M),te=z.length,Fe=-1,Ue,ut="";++Fe1?g.substring(1,g.length):"")}).join(" ")}var Kr=Object.freeze({utf8_encode:Go,camelCaseToHyphen:Wt,hyphenToCamelCase:Ta,capitalise:Ti,escapeString:_t,camelCaseToHumanText:Br});/** * @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/ * @license MIT - */function Nn(M){var f=new Map;return M.forEach(function(h){return f.set(h[0],h[1])}),f}function Jn(M,f){var h=new Map;return M.forEach(function(g){return h.set(f(g),g)}),h}function ws(M){var f=[];return M.forEach(function(h,g){return f.push(g)}),f}var wa=Object.freeze({convertToMap:Nn,mapById:Jn,keys:ws});/** + */function jn(M){var f=new Map;return M.forEach(function(d){return f.set(d[0],d[1])}),f}function Kn(M,f){var d=new Map;return M.forEach(function(g){return d.set(f(g),g)}),d}function Cs(M){var f=[];return M.forEach(function(d,g){return f.push(g)}),f}var ea=Object.freeze({convertToMap:jn,mapById:Kn,keys:Cs});/** * @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/ * @license MIT - */var Bt=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Ft=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},yi=function(M,f){return function(h,g){f(h,g,M)}},Ti=function(M){var f=typeof Symbol=="function"&&Symbol.iterator,h=f&&M[f],g=0;if(h)return h.call(M);if(M&&typeof M.length=="number")return{next:function(){return M&&g>=M.length&&(M=void 0),{value:M&&M[g++],done:!M}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},xi=function(M,f){var h=typeof Symbol=="function"&&M[Symbol.iterator];if(!h)return M;var g=h.call(M),x,P=[],z;try{for(;(f===void 0||f-- >0)&&!(x=g.next()).done;)P.push(x.value)}catch(ee){z={error:ee}}finally{try{x&&!x.done&&(h=g.return)&&h.call(g)}finally{if(z)throw z.error}}return P},Ki=function(){for(var M=[],f=0;f=0,je=ee>=0;if(Me&&je)return z-ee;if(Me)return 1;if(je)return-1;var ut=h.gridColumns.indexOf(x),Rt=h.gridColumns.indexOf(P);return ut-Rt})},f.prototype.getAllDisplayedAutoHeightCols=function(){return this.displayedAutoHeightCols},f.prototype.setViewport=function(){this.gridOptionsWrapper.isEnableRtl()?(this.viewportLeft=this.bodyWidth-this.scrollPosition-this.scrollWidth,this.viewportRight=this.bodyWidth-this.scrollPosition):(this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition)},f.prototype.getDisplayedColumnsStartingAt=function(h){for(var g=h,x=[];g!=null;)x.push(g),g=this.getDisplayedColAfter(g);return x},f.prototype.checkViewportColumns=function(){if(this.displayedColumnsCenter!=null){var h=this.viewportColumns.map(function(P){return P.getId()}).join("#");this.extractViewport();var g=this.viewportColumns.map(function(P){return P.getId()}).join("#");if(h!==g){var x={type:li.EVENT_VIRTUAL_COLUMNS_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(x)}}},f.prototype.setViewportPosition=function(h,g){(h!==this.scrollWidth||g!==this.scrollPosition||this.bodyWidthDirty)&&(this.scrollWidth=h,this.scrollPosition=g,this.bodyWidthDirty=!0,this.setViewport(),this.ready&&this.checkViewportColumns())},f.prototype.isPivotMode=function(){return this.pivotMode},f.prototype.isPivotSettingAllowed=function(h){return h&&this.gridOptionsWrapper.isTreeData()?(console.warn("AG Grid: Pivot mode not available in conjunction Tree Data i.e. 'gridOptions.treeData: true'"),!1):!0},f.prototype.setPivotMode=function(h,g){if(g===void 0&&(g="api"),!(h===this.pivotMode||!this.isPivotSettingAllowed(this.pivotMode))){this.pivotMode=h,this.autoGroupsNeedBuilding=!0,this.updateGridColumns(),this.updateDisplayedColumns(g);var x={type:li.EVENT_COLUMN_PIVOT_MODE_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(x)}},f.prototype.getSecondaryPivotColumn=function(h,g){if(r(this.secondaryColumns))return null;var x=this.getPrimaryColumn(g),P=null;return this.secondaryColumns.forEach(function(z){var ee=z.getColDef().pivotKeys,Me=z.getColDef().pivotValueColumn,je=_(ee,h),ut=Me===x;je&&ut&&(P=z)}),P},f.prototype.setBeans=function(h){this.logger=h.create("columnModel")},f.prototype.setFirstRightAndLastLeftPinned=function(h){var g,x;this.gridOptionsWrapper.isEnableRtl()?(g=this.displayedColumnsLeft?this.displayedColumnsLeft[0]:null,x=this.displayedColumnsRight?m(this.displayedColumnsRight):null):(g=this.displayedColumnsLeft?m(this.displayedColumnsLeft):null,x=this.displayedColumnsRight?this.displayedColumnsRight[0]:null),this.gridColumns.forEach(function(P){P.setLastLeftPinned(P===g,h),P.setFirstRightPinned(P===x,h)})},f.prototype.autoSizeColumns=function(h){var g=this,x=h.columns,P=h.skipHeader,z=h.skipHeaderGroups,ee=h.stopAtGroup,Me=h.source,je=Me===void 0?"api":Me;this.animationFrameService.flushAllFrames();for(var ut=[],Rt=-1,Zt=P??this.gridOptionsWrapper.isSkipHeaderOnAutoSize(),vi=z??Zt;Rt!==0;)Rt=0,this.actionOnGridColumns(x,function(Ci){if(ut.indexOf(Ci)>=0)return!1;var qi=g.autoWidthCalculator.getPreferredWidthForColumn(Ci,Zt);if(qi>0){var hr=g.normaliseColumnWidth(Ci,qi);Ci.setActualWidth(hr,je),ut.push(Ci),Rt++}return!0},je);vi||this.autoSizeColumnGroupsByColumns(x,ee),this.fireColumnResizedEvent(ut,!0,"autosizeColumns")},f.prototype.fireColumnResizedEvent=function(h,g,x,P){if(P===void 0&&(P=null),h&&h.length){var z={type:li.EVENT_COLUMN_RESIZED,columns:h,column:h.length===1?h[0]:null,flexColumns:P,finished:g,api:this.gridApi,columnApi:this.columnApi,source:x};this.eventService.dispatchEvent(z)}},f.prototype.autoSizeColumn=function(h,g,x){x===void 0&&(x="api"),h&&this.autoSizeColumns({columns:[h],skipHeader:g,skipHeaderGroups:!0,source:x})},f.prototype.autoSizeColumnGroupsByColumns=function(h,g){var x,P,z,ee,Me=new Set,je=this.getGridColumns(h);je.forEach(function(Ar){for(var Fr=Ar.getParent();Fr&&Fr!=g;)Fr.isPadding()||Me.add(Fr),Fr=Fr.getParent()});var ut,Rt=[];try{for(var Zt=Ti(Me),vi=Zt.next();!vi.done;vi=Zt.next()){var Ci=vi.value;try{for(var qi=(z=void 0,Ti(this.ctrlsService.getHeaderRowContainerCtrls())),hr=qi.next();!hr.done;hr=qi.next()){var Rr=hr.value;if(ut=Rr.getHeaderCtrlForColumn(Ci),ut)break}}catch(Ar){z={error:Ar}}finally{try{hr&&!hr.done&&(ee=qi.return)&&ee.call(qi)}finally{if(z)throw z.error}}ut&&ut.resizeLeafColumnsToFit()}}catch(Ar){x={error:Ar}}finally{try{vi&&!vi.done&&(P=Zt.return)&&P.call(Zt)}finally{if(x)throw x.error}}return Rt},f.prototype.autoSizeAllColumns=function(h,g){g===void 0&&(g="api");var x=this.getAllDisplayedColumns();this.autoSizeColumns({columns:x,skipHeader:h,source:g})},f.prototype.getColumnsFromTree=function(h){var g=[],x=function(P){for(var z=0;z=0},f.prototype.getAllDisplayedColumns=function(){return this.displayedColumns},f.prototype.getViewportColumns=function(){return this.viewportColumns},f.prototype.getDisplayedLeftColumnsForRow=function(h){return this.colSpanActive?this.getDisplayedColumnsForRow(h,this.displayedColumnsLeft):this.displayedColumnsLeft},f.prototype.getDisplayedRightColumnsForRow=function(h){return this.colSpanActive?this.getDisplayedColumnsForRow(h,this.displayedColumnsRight):this.displayedColumnsRight},f.prototype.getDisplayedColumnsForRow=function(h,g,x,P){for(var z=[],ee=null,Me=function(Rt){var Zt=g[Rt],vi=g.length-Rt,Ci=Math.min(Zt.getColSpan(h),vi),qi=[Zt];if(Ci>1){for(var hr=Ci-1,Rr=1;Rr<=hr;Rr++)qi.push(g[Rt+Rr]);Rt+=hr}var Ar;if(x?(Ar=!1,qi.forEach(function(Sn){x(Sn)&&(Ar=!0)})):Ar=!0,Ar){if(z.length===0&&ee){var Fr=P?P(Zt):!1;Fr&&z.push(ee)}z.push(Zt)}ee=Zt,je=Rt},je,ut=0;utg.viewportLeft},P=this.suppressColumnVirtualisation?null:this.isColumnInViewport.bind(this);return this.getDisplayedColumnsForRow(h,this.displayedColumnsCenter,P,x)},f.prototype.getAriaColumnIndex=function(h){return this.getAllGridColumns().indexOf(h)+1},f.prototype.isColumnInViewport=function(h){if(h.isAutoHeight())return!0;var g=h.getLeft()||0,x=g+h.getActualWidth(),P=this.viewportLeft-200,z=this.viewportRight+200,ee=gz&&x>z;return!ee&&!Me},f.prototype.getDisplayedColumnsLeftWidth=function(){return this.getWidthOfColsInList(this.displayedColumnsLeft)},f.prototype.getDisplayedColumnsRightWidth=function(){return this.getWidthOfColsInList(this.displayedColumnsRight)},f.prototype.updatePrimaryColumnList=function(h,g,x,P,z,ee){var Me=this;if(ee===void 0&&(ee="api"),!(!h||n(h))){var je=!1;if(h.forEach(function(Rt){var Zt=Me.getPrimaryColumn(Rt);if(Zt){if(x){if(g.indexOf(Zt)>=0)return;g.push(Zt)}else{if(g.indexOf(Zt)<0)return;q(g,Zt)}P(Zt),je=!0}}),!!je){this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(ee);var ut={type:z,columns:g,column:g.length===1?g[0]:null,api:this.gridApi,columnApi:this.columnApi,source:ee};this.eventService.dispatchEvent(ut)}}},f.prototype.setRowGroupColumns=function(h,g){g===void 0&&(g="api"),this.autoGroupsNeedBuilding=!0,this.setPrimaryColumnList(h,this.rowGroupColumns,li.EVENT_COLUMN_ROW_GROUP_CHANGED,this.setRowGroupActive.bind(this),g)},f.prototype.setRowGroupActive=function(h,g,x){h!==g.isRowGroupActive()&&(g.setRowGroupActive(h,x),!h&&!this.gridOptionsWrapper.isSuppressMakeColumnVisibleAfterUnGroup()&&g.setVisible(!0,x))},f.prototype.addRowGroupColumn=function(h,g){g===void 0&&(g="api"),h&&this.addRowGroupColumns([h],g)},f.prototype.addRowGroupColumns=function(h,g){g===void 0&&(g="api"),this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(h,this.rowGroupColumns,!0,this.setRowGroupActive.bind(this,!0),li.EVENT_COLUMN_ROW_GROUP_CHANGED,g)},f.prototype.removeRowGroupColumns=function(h,g){g===void 0&&(g="api"),this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(h,this.rowGroupColumns,!1,this.setRowGroupActive.bind(this,!1),li.EVENT_COLUMN_ROW_GROUP_CHANGED,g)},f.prototype.removeRowGroupColumn=function(h,g){g===void 0&&(g="api"),h&&this.removeRowGroupColumns([h],g)},f.prototype.addPivotColumns=function(h,g){g===void 0&&(g="api"),this.updatePrimaryColumnList(h,this.pivotColumns,!0,function(x){return x.setPivotActive(!0,g)},li.EVENT_COLUMN_PIVOT_CHANGED,g)},f.prototype.setPivotColumns=function(h,g){g===void 0&&(g="api"),this.setPrimaryColumnList(h,this.pivotColumns,li.EVENT_COLUMN_PIVOT_CHANGED,function(x,P){P.setPivotActive(x,g)},g)},f.prototype.addPivotColumn=function(h,g){g===void 0&&(g="api"),this.addPivotColumns([h],g)},f.prototype.removePivotColumns=function(h,g){g===void 0&&(g="api"),this.updatePrimaryColumnList(h,this.pivotColumns,!1,function(x){return x.setPivotActive(!1,g)},li.EVENT_COLUMN_PIVOT_CHANGED,g)},f.prototype.removePivotColumn=function(h,g){g===void 0&&(g="api"),this.removePivotColumns([h],g)},f.prototype.setPrimaryColumnList=function(h,g,x,P,z){var ee=this;g.length=0,i(h)&&h.forEach(function(Me){var je=ee.getPrimaryColumn(Me);je&&g.push(je)}),(this.primaryColumns||[]).forEach(function(Me){var je=g.indexOf(Me)>=0;P(je,Me)}),this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(z),this.fireColumnEvent(x,g,z)},f.prototype.setValueColumns=function(h,g){g===void 0&&(g="api"),this.setPrimaryColumnList(h,this.valueColumns,li.EVENT_COLUMN_VALUE_CHANGED,this.setValueActive.bind(this),g)},f.prototype.setValueActive=function(h,g,x){if(h!==g.isValueActive()&&(g.setValueActive(h,x),h&&!g.getAggFunc())){var P=this.aggFuncService.getDefaultAggFunc(g);g.setAggFunc(P)}},f.prototype.addValueColumns=function(h,g){g===void 0&&(g="api"),this.updatePrimaryColumnList(h,this.valueColumns,!0,this.setValueActive.bind(this,!0),li.EVENT_COLUMN_VALUE_CHANGED,g)},f.prototype.addValueColumn=function(h,g){g===void 0&&(g="api"),h&&this.addValueColumns([h],g)},f.prototype.removeValueColumn=function(h,g){g===void 0&&(g="api"),this.removeValueColumns([h],g)},f.prototype.removeValueColumns=function(h,g){g===void 0&&(g="api"),this.updatePrimaryColumnList(h,this.valueColumns,!1,this.setValueActive.bind(this,!1),li.EVENT_COLUMN_VALUE_CHANGED,g)},f.prototype.normaliseColumnWidth=function(h,g){var x=h.getMinWidth();i(x)&&g0?z+=Zt:ee=!1});var Me=x>=P,je=!ee||x<=z;return Me&&je},f.prototype.resizeColumnSets=function(h){var g=this,x=h.resizeSets,P=h.finished,z=h.source,ee=!x||x.every(function(Ci){return g.checkMinAndMaxWidthsForSet(Ci)});if(!ee){if(P){var Me=x&&x.length>0?x[0].columns:null;this.fireColumnResizedEvent(Me,P,z)}return}var je=[],ut=[];x.forEach(function(Ci){var qi=Ci.width,hr=Ci.columns,Rr=Ci.ratios,Ar={},Fr={};hr.forEach(function(ho){return ut.push(ho)});for(var Sn=!0,Js=0,rl=function(){if(Js++,Js>1e3)return console.error("AG Grid: infinite loop in resizeColumnSets"),"break";Sn=!1;var ho=[],Pl=0,Ol=qi;hr.forEach(function(af,mC){var gC=Fr[af.getId()];if(gC)Ol-=Ar[af.getId()];else{ho.push(af);var Gb=Rr[mC];Pl+=Gb}});var of=1/Pl;ho.forEach(function(af,mC){var gC=mC===ho.length-1,Gb;gC?Gb=Ol:(Gb=Math.round(Rr[mC]*qi*of),Ol-=Gb);var oH=af.getMinWidth(),I8=af.getMaxWidth();i(oH)&&Gb0&&Gb>I8&&(Gb=I8,Fr[af.getId()]=!0,Sn=!0),Ar[af.getId()]=Gb})};Sn;){var nl=rl();if(nl==="break")break}hr.forEach(function(ho){var Pl=Ar[ho.getId()],Ol=ho.getActualWidth();Ol!==Pl&&(ho.setActualWidth(Pl,z),je.push(ho))})});var Rt=je.length>0,Zt=[];Rt&&(Zt=this.refreshFlexedColumns({resizingCols:ut,skipSetLeft:!0}),this.setLeftValues(z),this.updateBodyWidths(),this.checkViewportColumns());var vi=ut.concat(Zt);(Rt||P)&&this.fireColumnResizedEvent(vi,P,z,Zt)},f.prototype.setColumnAggFunc=function(h,g,x){if(x===void 0&&(x="api"),!!h){var P=this.getPrimaryColumn(h);P&&(P.setAggFunc(g),this.fireColumnEvent(li.EVENT_COLUMN_VALUE_CHANGED,[P],x))}},f.prototype.fireColumnEvent=function(h,g,x){var P={type:h,columns:g,column:g&&g.length==1?g[0]:null,api:this.gridApi,columnApi:this.columnApi,source:x};this.eventService.dispatchEvent(P)},f.prototype.moveRowGroupColumn=function(h,g,x){x===void 0&&(x="api");var P=this.rowGroupColumns[h];this.rowGroupColumns.splice(h,1),this.rowGroupColumns.splice(g,0,P);var z={type:li.EVENT_COLUMN_ROW_GROUP_CHANGED,columns:this.rowGroupColumns,column:this.rowGroupColumns.length===1?this.rowGroupColumns[0]:null,api:this.gridApi,columnApi:this.columnApi,source:x};this.eventService.dispatchEvent(z)},f.prototype.moveColumns=function(h,g,x){if(x===void 0&&(x="api"),this.columnAnimationService.start(),g>this.gridColumns.length-h.length){console.warn("AG Grid: tried to insert columns in invalid location, toIndex = "+g),console.warn("AG Grid: remember that you should not count the moving columns when calculating the new index");return}var P=this.getGridColumns(h),z=!this.doesMovePassRules(P,g);if(!z){be(this.gridColumns,P,g),this.updateDisplayedColumns(x);var ee={type:li.EVENT_COLUMN_MOVED,columns:P,column:P.length===1?P[0]:null,toIndex:g,api:this.gridApi,columnApi:this.columnApi,source:x};this.eventService.dispatchEvent(ee),this.columnAnimationService.finish()}},f.prototype.doesMovePassRules=function(h,g){var x=this.gridColumns.slice();return be(x,h,g),!(!this.doesMovePassMarryChildren(x)||!this.doesMovePassLockedPositions(x))},f.prototype.sortColumnsLikeGridColumns=function(h){var g=this;if(!(!h||h.length<=1)){var x=h.filter(function(P){return g.gridColumns.indexOf(P)<0}).length>0;x||h.sort(function(P,z){var ee=g.gridColumns.indexOf(P),Me=g.gridColumns.indexOf(z);return ee-Me})}},f.prototype.doesMovePassLockedPositions=function(h){var g=0,x=!0,P=function(z){return z?z===!0||z==="left"?0:2:1};return h.forEach(function(z){var ee=P(z.getColDef().lockPosition);eeZt&&(g=!1)}}}),g},f.prototype.moveColumn=function(h,g,x){x===void 0&&(x="api"),this.moveColumns([h],g,x)},f.prototype.moveColumnByIndex=function(h,g,x){x===void 0&&(x="api");var P=this.gridColumns[h];this.moveColumn(P,g,x)},f.prototype.getColumnDefs=function(){var h=this;if(this.primaryColumns){var g=this.primaryColumns.slice();return this.gridColsArePrimary?g.sort(function(x,P){return h.gridColumns.indexOf(x)-h.gridColumns.indexOf(P)}):this.lastPrimaryOrder&&g.sort(function(x,P){return h.lastPrimaryOrder.indexOf(x)-h.lastPrimaryOrder.indexOf(P)}),this.columnDefFactory.buildColumnDefs(g,this.rowGroupColumns,this.pivotColumns)}},f.prototype.getBodyContainerWidth=function(){return this.bodyWidth},f.prototype.getContainerWidth=function(h){switch(h){case Ue.PINNED_LEFT:return this.leftWidth;case Ue.PINNED_RIGHT:return this.rightWidth;default:return this.bodyWidth}},f.prototype.updateBodyWidths=function(){var h=this.getWidthOfColsInList(this.displayedColumnsCenter),g=this.getWidthOfColsInList(this.displayedColumnsLeft),x=this.getWidthOfColsInList(this.displayedColumnsRight);this.bodyWidthDirty=this.bodyWidth!==h;var P=this.bodyWidth!==h||this.leftWidth!==g||this.rightWidth!==x;if(P){this.bodyWidth=h,this.leftWidth=g,this.rightWidth=x;var z={type:li.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(z)}},f.prototype.getValueColumns=function(){return this.valueColumns?this.valueColumns:[]},f.prototype.getPivotColumns=function(){return this.pivotColumns?this.pivotColumns:[]},f.prototype.isPivotActive=function(){return this.pivotColumns&&this.pivotColumns.length>0&&this.pivotMode},f.prototype.getRowGroupColumns=function(){return this.rowGroupColumns?this.rowGroupColumns:[]},f.prototype.getDisplayedCenterColumns=function(){return this.displayedColumnsCenter},f.prototype.getDisplayedLeftColumns=function(){return this.displayedColumnsLeft},f.prototype.getDisplayedRightColumns=function(){return this.displayedColumnsRight},f.prototype.getDisplayedColumns=function(h){switch(h){case Ue.PINNED_LEFT:return this.getDisplayedLeftColumns();case Ue.PINNED_RIGHT:return this.getDisplayedRightColumns();default:return this.getDisplayedCenterColumns()}},f.prototype.getAllPrimaryColumns=function(){return this.primaryColumns?this.primaryColumns.slice():null},f.prototype.getSecondaryColumns=function(){return this.secondaryColumns?this.secondaryColumns.slice():null},f.prototype.getAllColumnsForQuickFilter=function(){return this.columnsForQuickFilter},f.prototype.getAllGridColumns=function(){return this.gridColumns},f.prototype.isEmpty=function(){return n(this.gridColumns)},f.prototype.isRowGroupEmpty=function(){return n(this.rowGroupColumns)},f.prototype.setColumnVisible=function(h,g,x){x===void 0&&(x="api"),this.setColumnsVisible([h],g,x)},f.prototype.setColumnsVisible=function(h,g,x){var P=this;g===void 0&&(g=!1),x===void 0&&(x="api"),this.columnAnimationService.start(),this.actionOnGridColumns(h,function(z){return z.isVisible()!==g?(z.setVisible(g,x),!0):!1},x,function(){var z={type:li.EVENT_COLUMN_VISIBLE,visible:g,column:null,columns:null,api:P.gridApi,columnApi:P.columnApi,source:x};return z}),this.columnAnimationService.finish()},f.prototype.setColumnPinned=function(h,g,x){x===void 0&&(x="api"),h&&this.setColumnsPinned([h],g,x)},f.prototype.setColumnsPinned=function(h,g,x){var P=this;if(x===void 0&&(x="api"),this.gridOptionsWrapper.getDomLayout()==="print"){console.warn("Changing the column pinning status is not allowed with domLayout='print'");return}this.columnAnimationService.start();var z;g===!0||g===Ue.PINNED_LEFT?z=Ue.PINNED_LEFT:g===Ue.PINNED_RIGHT?z=Ue.PINNED_RIGHT:z=null,this.actionOnGridColumns(h,function(ee){return ee.getPinned()!==z?(ee.setPinned(z),!0):!1},x,function(){var ee={type:li.EVENT_COLUMN_PINNED,pinned:z,column:null,columns:null,api:P.gridApi,columnApi:P.columnApi,source:x};return ee}),this.columnAnimationService.finish()},f.prototype.actionOnGridColumns=function(h,g,x,P){var z=this;if(!n(h)){var ee=[];if(h.forEach(function(je){var ut=z.getGridColumn(je);if(ut){var Rt=g(ut);Rt!==!1&&ee.push(ut)}}),!!ee.length&&(this.updateDisplayedColumns(x),i(P)&&P)){var Me=P();Me.columns=ee,Me.column=ee.length===1?ee[0]:null,this.eventService.dispatchEvent(Me)}}},f.prototype.getDisplayedColBefore=function(h){var g=this.getAllDisplayedColumns(),x=g.indexOf(h);return x>0?g[x-1]:null},f.prototype.getDisplayedColAfter=function(h){var g=this.getAllDisplayedColumns(),x=g.indexOf(h);return x0},f.prototype.isPinningRight=function(){return this.displayedColumnsRight.length>0},f.prototype.getPrimaryAndSecondaryAndAutoColumns=function(){var h;return(h=[]).concat.apply(h,Ki([this.primaryColumns||[],this.groupAutoColumns||[],this.secondaryColumns||[]]))},f.prototype.getPrimaryAndAutoGroupCols=function(){var h;return(h=[]).concat.apply(h,Ki([this.primaryColumns||[],this.groupAutoColumns||[]]))},f.prototype.getPrimaryAndSecondaryColumns=function(){var h;return(h=[]).concat.apply(h,Ki([this.primaryColumns||[],this.secondaryColumns||[]]))},f.prototype.createStateItemFromColumn=function(h){var g=h.isRowGroupActive()?this.rowGroupColumns.indexOf(h):null,x=h.isPivotActive()?this.pivotColumns.indexOf(h):null,P=h.isValueActive()?h.getAggFunc():null,z=h.getSort()!=null?h.getSort():null,ee=h.getSortIndex()!=null?h.getSortIndex():null,Me=h.getFlex()!=null&&h.getFlex()>0?h.getFlex():null,je={colId:h.getColId(),width:h.getActualWidth(),hide:!h.isVisible(),pinned:h.getPinned(),sort:z,sortIndex:ee,aggFunc:P,rowGroup:h.isRowGroupActive(),rowGroupIndex:g,pivot:h.isPivotActive(),pivotIndex:x,flex:Me};return je},f.prototype.getColumnState=function(){if(r(this.primaryColumns)||!this.isAlive())return[];var h=this.getPrimaryAndSecondaryAndAutoColumns(),g=h.map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(g),g},f.prototype.orderColumnStateList=function(h){var g=Nn(this.gridColumns.map(function(x,P){return[x.getColId(),P]}));h.sort(function(x,P){var z=g.has(x.colId)?g.get(x.colId):-1,ee=g.has(P.colId)?g.get(P.colId):-1;return z-ee})},f.prototype.resetColumnState=function(h){h===void 0&&(h="api");var g=this.getColumnsFromTree(this.primaryColumnTree),x=[],P=1e3,z=1e3,ee=[];this.groupAutoColumns&&(ee=ee.concat(this.groupAutoColumns)),g&&(ee=ee.concat(g)),ee.forEach(function(Me){var je=function(nl,ho){return nl??ho??null},ut=Me.getColDef(),Rt=je(ut.sort,ut.initialSort),Zt=je(ut.sortIndex,ut.initialSortIndex),vi=je(ut.hide,ut.initialHide),Ci=je(ut.pinned,ut.initialPinned),qi=je(ut.width,ut.initialWidth),hr=je(ut.flex,ut.initialFlex),Rr=je(ut.rowGroupIndex,ut.initialRowGroupIndex),Ar=je(ut.rowGroup,ut.initialRowGroup);Rr==null&&(Ar==null||Ar==!1)&&(Rr=null,Ar=null);var Fr=je(ut.pivotIndex,ut.initialPivotIndex),Sn=je(ut.pivot,ut.initialPivot);Fr==null&&(Sn==null||Sn==!1)&&(Fr=null,Sn=null);var Js=je(ut.aggFunc,ut.initialAggFunc),rl={colId:Me.getColId(),sort:Rt,sortIndex:Zt,hide:vi,pinned:Ci,width:qi,flex:hr,rowGroup:Ar,rowGroupIndex:Rr,pivot:Sn,pivotIndex:Fr,aggFunc:Js};r(Rr)&&Ar&&(rl.rowGroupIndex=P++),r(Fr)&&Sn&&(rl.pivotIndex=z++),x.push(rl)}),this.applyColumnState({state:x,applyOrder:!0},h)},f.prototype.applyColumnState=function(h,g){var x=this;if(g===void 0&&(g="api"),n(this.primaryColumns))return!1;if(h&&h.state&&!h.state.forEach)return console.warn("AG Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."),!1;var P=function(je,ut,Rt){var Zt=x.compareColumnStatesAndRaiseEvents(g);x.autoGroupsNeedBuilding=!0;var vi=ut.slice(),Ci={},qi={},hr=[],Rr=[],Ar=0,Fr=x.rowGroupColumns.slice(),Sn=x.pivotColumns.slice();je.forEach(function(ho){var Pl=ho.colId||"",Ol=Pl.startsWith(Ue.GROUP_AUTO_COLUMN_ID);if(Ol){hr.push(ho),Rr.push(ho);return}var of=Rt(Pl);of?(x.syncColumnWithStateItem(of,ho,h.defaultState,Ci,qi,!1,g),q(vi,of)):(Rr.push(ho),Ar+=1)});var Js=function(ho){return x.syncColumnWithStateItem(ho,null,h.defaultState,Ci,qi,!1,g)};vi.forEach(Js);var rl=function(ho,Pl,Ol,of){var af=ho[Ol.getId()],mC=ho[of.getId()],gC=af!=null,Gb=mC!=null;if(gC&&Gb)return af-mC;if(gC)return-1;if(Gb)return 1;var oH=Pl.indexOf(Ol),I8=Pl.indexOf(of),cLt=oH>=0,HMr=I8>=0;return cLt&&HMr?oH-I8:cLt?-1:1};x.rowGroupColumns.sort(rl.bind(x,Ci,Fr)),x.pivotColumns.sort(rl.bind(x,qi,Sn)),x.updateGridColumns();var nl=x.groupAutoColumns?x.groupAutoColumns.slice():[];return hr.forEach(function(ho){var Pl=x.getAutoColumn(ho.colId);q(nl,Pl),x.syncColumnWithStateItem(Pl,ho,h.defaultState,null,null,!0,g)}),nl.forEach(Js),x.applyOrderAfterApplyState(h),x.updateDisplayedColumns(g),x.dispatchEverythingChanged(g),Zt(),{unmatchedAndAutoStates:Rr,unmatchedCount:Ar}};this.columnAnimationService.start();var z=P(h.state||[],this.primaryColumns||[],function(je){return x.getPrimaryColumn(je)}),ee=z.unmatchedAndAutoStates,Me=z.unmatchedCount;return(ee.length>0||i(h.defaultState))&&(Me=P(ee,this.secondaryColumns||[],function(je){return x.getSecondaryColumn(je)}).unmatchedCount),this.columnAnimationService.finish(),Me===0},f.prototype.applyOrderAfterApplyState=function(h){var g=this;if(!(!h.applyOrder||!h.state)){var x=[],P={};h.state.forEach(function(ee){if(!(!ee.colId||P[ee.colId])){var Me=g.gridColumnsMap[ee.colId];Me&&(x.push(Me),P[ee.colId]=!0)}});var z=0;if(this.gridColumns.forEach(function(ee){var Me=ee.getColId(),je=P[Me]!=null;if(!je){var ut=Me.startsWith(Ue.GROUP_AUTO_COLUMN_ID);ut?oe(x,ee,z++):x.push(ee)}}),x=this.placeLockedColumns(x),!this.doesMovePassMarryChildren(x)){console.warn("AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.");return}this.gridColumns=x}},f.prototype.compareColumnStatesAndRaiseEvents=function(h){var g=this,x={rowGroupColumns:this.rowGroupColumns.slice(),pivotColumns:this.pivotColumns.slice(),valueColumns:this.valueColumns.slice()},P=this.getColumnState(),z={};return P.forEach(function(ee){z[ee.colId]=ee}),function(){if(!g.gridOptionsWrapper.isSuppressColumnStateEvents()){var ee=g.getPrimaryAndSecondaryAndAutoColumns(),Me=function(Rr,Ar,Fr,Sn){var Js=Ar.map(Sn),rl=Fr.map(Sn),nl=_(Js,rl);if(!nl){var ho={type:Rr,columns:Fr,column:Fr.length===1?Fr[0]:null,api:g.gridApi,columnApi:g.columnApi,source:h};g.eventService.dispatchEvent(ho)}},je=function(Rr){var Ar=[];return ee.forEach(function(Fr){var Sn=z[Fr.getColId()];Sn&&Rr(Sn,Fr)&&Ar.push(Fr)}),Ar},ut=function(Rr){return Rr.getColId()};Me(li.EVENT_COLUMN_ROW_GROUP_CHANGED,x.rowGroupColumns,g.rowGroupColumns,ut),Me(li.EVENT_COLUMN_PIVOT_CHANGED,x.pivotColumns,g.pivotColumns,ut);var Rt=function(Rr,Ar){var Fr=Rr.aggFunc!=null,Sn=Fr!=Ar.isValueActive(),Js=Fr&&Rr.aggFunc!=Ar.getAggFunc();return Sn||Js},Zt=je(Rt);Zt.length>0&&g.fireColumnEvent(li.EVENT_COLUMN_VALUE_CHANGED,g.valueColumns,h);var vi=function(Rr,Ar){return Rr.width!=Ar.getActualWidth()};g.fireColumnResizedEvent(je(vi),!0,h);var Ci=function(Rr,Ar){return Rr.pinned!=Ar.getPinned()};g.raiseColumnPinnedEvent(je(Ci),h);var qi=function(Rr,Ar){return Rr.hide==Ar.isVisible()};g.raiseColumnVisibleEvent(je(qi),h);var hr=function(Rr,Ar){return Rr.sort!=Ar.getSort()||Rr.sortIndex!=Ar.getSortIndex()};je(hr).length>0&&g.sortController.dispatchSortChangedEvents(h),g.raiseColumnMovedEvent(P,h)}}},f.prototype.raiseColumnPinnedEvent=function(h,g){if(h.length){var x=h.length===1?h[0]:null,P=this.getCommonValue(h,function(ee){return ee.getPinned()}),z={type:li.EVENT_COLUMN_PINNED,pinned:P??null,columns:h,column:x,api:this.gridApi,columnApi:this.columnApi,source:g};this.eventService.dispatchEvent(z)}},f.prototype.getCommonValue=function(h,g){if(!(!h||h.length==0)){for(var x=g(h[0]),P=1;P=Zt&&h.setActualWidth(qi,Me)}var hr=je("sort").value1;hr!==void 0&&(hr===Ue.SORT_DESC||hr===Ue.SORT_ASC?h.setSort(hr,Me):h.setSort(void 0,Me));var Rr=je("sortIndex").value1;if(Rr!==void 0&&h.setSortIndex(Rr),!(ee||!h.isPrimary())){var Ar=je("aggFunc").value1;Ar!==void 0&&(typeof Ar=="string"?(h.setAggFunc(Ar),h.isValueActive()||(h.setValueActive(!0,Me),this.valueColumns.push(h))):(i(Ar)&&console.warn("AG Grid: stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."),h.isValueActive()&&(h.setValueActive(!1,Me),q(this.valueColumns,h))));var Fr=je("rowGroup","rowGroupIndex"),Sn=Fr.value1,Js=Fr.value2;(Sn!==void 0||Js!==void 0)&&(typeof Js=="number"||Sn?(h.isRowGroupActive()||(h.setRowGroupActive(!0,Me),this.rowGroupColumns.push(h)),P&&typeof Js=="number"&&(P[h.getId()]=Js)):h.isRowGroupActive()&&(h.setRowGroupActive(!1,Me),q(this.rowGroupColumns,h)));var rl=je("pivot","pivotIndex"),nl=rl.value1,ho=rl.value2;(nl!==void 0||ho!==void 0)&&(typeof ho=="number"||nl?(h.isPivotActive()||(h.setPivotActive(!0,Me),this.pivotColumns.push(h)),z&&typeof ho=="number"&&(z[h.getId()]=ho)):h.isPivotActive()&&(h.setPivotActive(!1,Me),q(this.pivotColumns,h)))}}},f.prototype.getGridColumns=function(h){return this.getColumns(h,this.getGridColumn.bind(this))},f.prototype.getColumns=function(h,g){var x=[];return h&&h.forEach(function(P){var z=g(P);z&&x.push(z)}),x},f.prototype.getColumnWithValidation=function(h){if(h==null)return null;var g=this.getGridColumn(h);return g||console.warn("AG Grid: could not find column "+h),g},f.prototype.getPrimaryColumn=function(h){return this.primaryColumns?this.getColumn(h,this.primaryColumns,this.primaryColumnsMap):null},f.prototype.getGridColumn=function(h){return this.getColumn(h,this.gridColumns,this.gridColumnsMap)},f.prototype.getSecondaryColumn=function(h){return this.secondaryColumns?this.getColumn(h,this.secondaryColumns,this.secondaryColumnsMap):null},f.prototype.getColumn=function(h,g,x){if(!h)return null;if(typeof h=="string"&&x[h])return x[h];for(var P=0;P=0:Ci?nl?Sn=Rr:ho?Sn=Fr!=null&&Fr>=0:Sn=!1:Sn=g.indexOf(vi)>=0,Sn){var Pl=Ci?Ar!=null||Fr!=null:Ar!=null;Pl?je.push(vi):ut.push(vi)}});var Rt=function(vi){var Ci=P(vi.getColDef()),qi=z(vi.getColDef());return Ci??qi};je.sort(function(vi,Ci){var qi=Rt(vi),hr=Rt(Ci);return qi===hr?0:qi=0&&Zt.push(vi)}),ut.forEach(function(vi){Zt.indexOf(vi)<0&&Zt.push(vi)}),g.forEach(function(vi){Zt.indexOf(vi)<0&&x(vi,!1)}),Zt.forEach(function(vi){g.indexOf(vi)<0&&x(vi,!0)}),Zt},f.prototype.extractPivotColumns=function(h,g){this.pivotColumns=this.extractColumns(g,this.pivotColumns,function(x,P){return x.setPivotActive(P,h)},function(x){return x.pivotIndex},function(x){return x.initialPivotIndex},function(x){return x.pivot},function(x){return x.initialPivot})},f.prototype.resetColumnGroupState=function(h){h===void 0&&(h="api");var g=[];this.columnUtils.depthFirstOriginalTreeSearch(null,this.primaryColumnTree,function(x){if(x instanceof Jt){var P=x.getColGroupDef(),z={groupId:x.getGroupId(),open:P?P.openByDefault:void 0};g.push(z)}}),this.setColumnGroupState(g,h)},f.prototype.getColumnGroupState=function(){var h=[];return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,function(g){g instanceof Jt&&h.push({groupId:g.getGroupId(),open:g.isExpanded()})}),h},f.prototype.setColumnGroupState=function(h,g){var x=this;g===void 0&&(g="api"),this.columnAnimationService.start();var P=[];h.forEach(function(z){var ee=z.groupId,Me=z.open,je=x.getProvidedColumnGroup(ee);je&&je.isExpanded()!==Me&&(x.logger.log("columnGroupOpened("+je.getGroupId()+","+Me+")"),je.setExpanded(Me),P.push(je))}),this.updateGroupsAndDisplayedColumns(g),this.setFirstRightAndLastLeftPinned(g),P.forEach(function(z){var ee={type:li.EVENT_COLUMN_GROUP_OPENED,columnGroup:z,api:x.gridApi,columnApi:x.columnApi};x.eventService.dispatchEvent(ee)}),this.columnAnimationService.finish()},f.prototype.setColumnGroupOpened=function(h,g,x){x===void 0&&(x="api");var P;h instanceof Jt?P=h.getId():P=h||"",this.setColumnGroupState([{groupId:P,open:g}],x)},f.prototype.getProvidedColumnGroup=function(h){typeof h!="string"&&console.error("AG Grid: group key must be a string");var g=null;return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,function(x){x instanceof Jt&&x.getId()===h&&(g=x)}),g},f.prototype.calculateColumnsForDisplay=function(){var h=this,g;return this.pivotMode&&r(this.secondaryColumns)?g=this.gridColumns.filter(function(x){var P=h.groupAutoColumns&&De(h.groupAutoColumns,x),z=h.valueColumns&&De(h.valueColumns,x);return P||z}):g=this.gridColumns.filter(function(x){var P=h.groupAutoColumns&&De(h.groupAutoColumns,x);return P||x.isVisible()}),g},f.prototype.checkColSpanActiveInCols=function(h){var g=!1;return h.forEach(function(x){i(x.getColDef().colSpan)&&(g=!0)}),g},f.prototype.calculateColumnsForGroupDisplay=function(){var h=this;this.groupDisplayColumns=[];var g=function(x){var P=x.getColDef();P&&i(P.showRowGroup)&&h.groupDisplayColumns.push(x)};this.gridColumns.forEach(g),this.groupAutoColumns&&this.groupAutoColumns.forEach(g)},f.prototype.getGroupDisplayColumns=function(){return this.groupDisplayColumns},f.prototype.updateDisplayedColumns=function(h){var g=this.calculateColumnsForDisplay();this.buildDisplayedTrees(g),this.calculateColumnsForGroupDisplay(),this.updateGroupsAndDisplayedColumns(h),this.setFirstRightAndLastLeftPinned(h)},f.prototype.isSecondaryColumnsPresent=function(){return i(this.secondaryColumns)},f.prototype.setSecondaryColumns=function(h,g){var x=this;g===void 0&&(g="api");var P=h&&h.length>0;if(!(!P&&r(this.secondaryColumns))){if(P){this.processSecondaryColumnDefinitions(h);var z=this.columnFactory.createColumnTree(h,!1,this.secondaryBalancedTree||this.previousSecondaryColumns||void 0);this.secondaryBalancedTree=z.columnTree,this.secondaryHeaderRowCount=z.treeDept+1,this.secondaryColumns=this.getColumnsFromTree(this.secondaryBalancedTree),this.secondaryColumnsMap={},this.secondaryColumns.forEach(function(ee){return x.secondaryColumnsMap[ee.getId()]=ee}),this.previousSecondaryColumns=null}else this.previousSecondaryColumns=this.secondaryBalancedTree,this.secondaryBalancedTree=null,this.secondaryHeaderRowCount=-1,this.secondaryColumns=null,this.secondaryColumnsMap={};this.updateGridColumns(),this.updateDisplayedColumns(g)}},f.prototype.processSecondaryColumnDefinitions=function(h){var g=this.gridOptionsWrapper.getProcessSecondaryColDefFunc(),x=this.gridOptionsWrapper.getProcessSecondaryColGroupDefFunc();if(!(!g&&!x)){var P=function(z){z.forEach(function(ee){var Me=i(ee.children);if(Me){var je=ee;x&&x(je),P(je.children)}else{var ut=ee;g&&g(ut)}})};h&&P(h)}},f.prototype.updateGridColumns=function(){var h=this;if(this.gridColsArePrimary?this.lastPrimaryOrder=this.gridColumns:this.lastSecondaryOrder=this.gridColumns,this.secondaryColumns&&this.secondaryBalancedTree){var g=this.secondaryColumns.every(function(P){return h.gridColumnsMap[P.getColId()]!==void 0});this.gridBalancedTree=this.secondaryBalancedTree.slice(),this.gridHeaderRowCount=this.secondaryHeaderRowCount,this.gridColumns=this.secondaryColumns.slice(),this.gridColsArePrimary=!1,g&&this.orderGridColsLike(this.lastSecondaryOrder)}else this.primaryColumns&&(this.gridBalancedTree=this.primaryColumnTree.slice(),this.gridHeaderRowCount=this.primaryHeaderRowCount,this.gridColumns=this.primaryColumns.slice(),this.gridColsArePrimary=!0,this.orderGridColsLike(this.lastPrimaryOrder));this.addAutoGroupToGridColumns(),this.gridColumns=this.placeLockedColumns(this.gridColumns),this.setupQuickFilterColumns(),this.clearDisplayedAndViewportColumns(),this.colSpanActive=this.checkColSpanActiveInCols(this.gridColumns),this.gridColumnsMap={},this.gridColumns.forEach(function(P){return h.gridColumnsMap[P.getId()]=P}),this.setAutoHeightActive();var x={type:li.EVENT_GRID_COLUMNS_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(x)},f.prototype.setAutoHeightActive=function(){if(this.autoHeightActive=this.gridColumns.filter(function(P){return P.isAutoHeight()}).length>0,this.autoHeightActive){this.autoHeightActiveAtLeastOnce=!0;var h=this.rowModel.getType(),g=h===Ue.ROW_MODEL_TYPE_CLIENT_SIDE||h===Ue.ROW_MODEL_TYPE_SERVER_SIDE;if(!g){var x="AG Grid - autoHeight columns only work with Client Side Row Model and Server Side Row Model.";ze(function(){return console.warn(x)},"autoHeightActive.wrongRowModel")}}},f.prototype.orderGridColsLike=function(h){if(!r(h)){var g=Nn(h.map(function(ut,Rt){return[ut,Rt]})),x=!0;if(this.gridColumns.forEach(function(ut){g.has(ut)&&(x=!1)}),!x){var P=Nn(this.gridColumns.map(function(ut){return[ut,!0]})),z=h.filter(function(ut){return P.has(ut)}),ee=Nn(z.map(function(ut){return[ut,!0]})),Me=this.gridColumns.filter(function(ut){return!ee.has(ut)}),je=z.slice();Me.forEach(function(ut){var Rt=ut.getOriginalParent();if(!Rt){je.push(ut);return}for(var Zt=[];!Zt.length&&Rt;){var vi=Rt.getLeafColumns();vi.forEach(function(hr){var Rr=je.indexOf(hr)>=0,Ar=Zt.indexOf(hr)<0;Rr&&Ar&&Zt.push(hr)}),Rt=Rt.getOriginalParent()}if(!Zt.length){je.push(ut);return}var Ci=Zt.map(function(hr){return je.indexOf(hr)}),qi=Math.max.apply(Math,Ki(Ci));oe(je,ut,qi+1)}),this.gridColumns=je}}},f.prototype.isPrimaryColumnGroupsPresent=function(){return this.primaryHeaderRowCount>1},f.prototype.setupQuickFilterColumns=function(){this.groupAutoColumns?this.columnsForQuickFilter=(this.primaryColumns||[]).concat(this.groupAutoColumns):this.primaryColumns&&(this.columnsForQuickFilter=this.primaryColumns)},f.prototype.placeLockedColumns=function(h){var g=[],x=[],P=[];return h.forEach(function(z){var ee=z.getColDef().lockPosition;ee==="right"?P.push(z):ee==="left"||ee===!0?g.push(z):x.push(z)}),Ki(g,x,P)},f.prototype.addAutoGroupToGridColumns=function(){if(this.createGroupAutoColumnsIfNeeded(),!r(this.groupAutoColumns)){this.gridColumns=this.groupAutoColumns?this.groupAutoColumns.concat(this.gridColumns):this.gridColumns;var h=this.columnFactory.createForAutoGroups(this.groupAutoColumns,this.gridBalancedTree);this.gridBalancedTree=h.concat(this.gridBalancedTree)}},f.prototype.clearDisplayedAndViewportColumns=function(){this.displayedTreeLeft=[],this.displayedTreeRight=[],this.displayedTreeCentre=[],this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.viewportColumns=[]},f.prototype.updateGroupsAndDisplayedColumns=function(h){this.updateOpenClosedVisibilityInColumnGroups(),this.deriveDisplayedColumns(h),this.refreshFlexedColumns(),this.extractViewport(),this.updateBodyWidths();var g={type:li.EVENT_DISPLAYED_COLUMNS_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(g)},f.prototype.deriveDisplayedColumns=function(h){this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft,this.displayedColumnsLeft),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre,this.displayedColumnsCenter),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight,this.displayedColumnsRight),this.joinDisplayedColumns(),this.setLeftValues(h),this.displayedAutoHeightCols=this.displayedColumns.filter(function(g){return g.isAutoHeight()})},f.prototype.isAutoRowHeightActive=function(){return this.autoHeightActive},f.prototype.wasAutoRowHeightEverActive=function(){return this.autoHeightActiveAtLeastOnce},f.prototype.joinDisplayedColumns=function(){this.gridOptionsWrapper.isEnableRtl()?this.displayedColumns=this.displayedColumnsRight.concat(this.displayedColumnsCenter).concat(this.displayedColumnsLeft):this.displayedColumns=this.displayedColumnsLeft.concat(this.displayedColumnsCenter).concat(this.displayedColumnsRight)},f.prototype.setLeftValues=function(h){this.setLeftValuesOfColumns(h),this.setLeftValuesOfGroups()},f.prototype.setLeftValuesOfColumns=function(h){var g=this;if(this.primaryColumns){var x=this.primaryColumns.slice(0),P=this.gridOptionsWrapper.isEnableRtl();[this.displayedColumnsLeft,this.displayedColumnsRight,this.displayedColumnsCenter].forEach(function(z){if(P){var ee=g.getWidthOfColsInList(z);z.forEach(function(je){ee-=je.getActualWidth(),je.setLeft(ee,h)})}else{var Me=0;z.forEach(function(je){je.setLeft(Me,h),Me+=je.getActualWidth()})}Z(x,z)}),x.forEach(function(z){z.setLeft(null,h)})}},f.prototype.setLeftValuesOfGroups=function(){[this.displayedTreeLeft,this.displayedTreeRight,this.displayedTreeCentre].forEach(function(h){h.forEach(function(g){if(g instanceof ei){var x=g;x.checkLeft()}})})},f.prototype.derivedDisplayedColumnsFromDisplayedTree=function(h,g){g.length=0,this.columnUtils.depthFirstDisplayedColumnTreeSearch(h,function(x){x instanceof W&&g.push(x)})},f.prototype.extractViewportColumns=function(){this.suppressColumnVirtualisation?this.viewportColumnsCenter=this.displayedColumnsCenter:this.viewportColumnsCenter=this.filterOutColumnsWithinViewport(),this.viewportColumns=this.viewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight)},f.prototype.getVirtualHeaderGroupRow=function(h,g){var x;switch(h){case Ue.PINNED_LEFT:x=this.viewportRowLeft[g];break;case Ue.PINNED_RIGHT:x=this.viewportRowRight[g];break;default:x=this.viewportRowCenter[g];break}return r(x)&&(x=[]),x},f.prototype.extractViewportRows=function(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={};var h={};this.viewportColumns.forEach(function(x){return h[x.getId()]=!0});var g=function(x,P,z){for(var ee=!1,Me=0;MeP;return Sn.getFlex()&&Js},ee=this.displayedColumnsCenter.filter(function(Sn){return!z(Sn)}),Me=this.displayedColumnsCenter.filter(function(Sn){return z(Sn)}),je=[];if(!Me.length)return[];var ut=[],Rt;e:for(;;){var Zt=Me.reduce(function(Sn,Js){return Sn+Js.getFlex()},0);Rt=this.flexViewportWidth-this.getWidthOfColsInList(ee);for(var vi=0;viAr&&(hr=Ar),hr){Ci.setActualWidth(hr,x),q(Me,Ci),je.push(Ci),ee.push(Ci);continue e}ut[vi]=Math.round(qi)}break}var Fr=Rt;return Me.forEach(function(Sn,Js){Sn.setActualWidth(Math.min(ut[Js],Fr),x),je.push(Sn),Fr-=ut[Js]}),h.skipSetLeft||this.setLeftValues(x),h.updateBodyWidths&&this.updateBodyWidths(),h.fireResizedEvent&&this.fireColumnResizedEvent(je,!0,x,Me),this.flexColsCalculatedAtLestOnce||(this.gridOptionsWrapper.isRowModelDefault()&&this.rowModel.resetRowHeights(),this.flexColsCalculatedAtLestOnce=!0),Me},f.prototype.sizeColumnsToFit=function(h,g,x){g===void 0&&(g="sizeColumnsToFit");var P=this.getAllDisplayedColumns();if(!(h<=0||!P.length)){var z=[],ee=[];P.forEach(function(Fr){Fr.getColDef().suppressSizeToFit===!0?ee.push(Fr):z.push(Fr)});var Me=z.slice(0),je=!1,ut=function(Fr){q(z,Fr),ee.push(Fr)};for(z.forEach(function(Fr){return Fr.resetActualWidth(g)});!je;){je=!0;var Rt=h-this.getWidthOfColsInList(ee);if(Rt<=0)z.forEach(function(Fr){Fr.setMinimum(g)});else for(var Zt=Rt/this.getWidthOfColsInList(z),vi=Rt,Ci=z.length-1;Ci>=0;Ci--){var qi=z[Ci],hr=qi.getMinWidth(),Rr=qi.getMaxWidth(),Ar=Math.round(qi.getActualWidth()*Zt);i(hr)&&Ar0||this.usingTreeData,P=x&&!g&&!h;if(P){var z=this.groupAutoColumns||[],ee=this.autoGroupColService.createAutoGroupColumns(z,this.rowGroupColumns),Me=!this.autoColsEqual(ee,this.groupAutoColumns);(Me||this.forceRecreateAutoGroups)&&(this.groupAutoColumns=ee)}else this.groupAutoColumns=null}},f.prototype.autoColsEqual=function(h,g){return _(h,g,function(x,P){return x.getColId()===P.getColId()})},f.prototype.getWidthOfColsInList=function(h){return h.reduce(function(g,x){return g+x.getActualWidth()},0)},f.prototype.getGridBalancedTree=function(){return this.gridBalancedTree},f.prototype.hasFloatingFilters=function(){if(!this.gridColumns)return!1;var h=this.gridColumns.some(function(g){return g.getColDef().floatingFilter});return h},f.prototype.getFirstDisplayedColumn=function(){var h=this.gridOptionsWrapper.isEnableRtl(),g=["getDisplayedLeftColumns","getDisplayedCenterColumns","getDisplayedRightColumns"];h&&g.reverse();for(var x=0;x=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},xi=function(M,f){return function(d,g){f(d,g,M)}},Ai=function(M){var f=typeof Symbol=="function"&&Symbol.iterator,d=f&&M[f],g=0;if(d)return d.call(M);if(M&&typeof M.length=="number")return{next:function(){return M&&g>=M.length&&(M=void 0),{value:M&&M[g++],done:!M}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},Ei=function(M,f){var d=typeof Symbol=="function"&&M[Symbol.iterator];if(!d)return M;var g=d.call(M),S,O=[],z;try{for(;(f===void 0||f-- >0)&&!(S=g.next()).done;)O.push(S.value)}catch(te){z={error:te}}finally{try{S&&!S.done&&(d=g.return)&&d.call(g)}finally{if(z)throw z.error}}return O},ir=function(){for(var M=[],f=0;f=0,Ue=te>=0;if(Fe&&Ue)return z-te;if(Fe)return 1;if(Ue)return-1;var ut=d.gridColumns.indexOf(S),Mt=d.gridColumns.indexOf(O);return ut-Mt})},f.prototype.getAllDisplayedAutoHeightCols=function(){return this.displayedAutoHeightCols},f.prototype.setViewport=function(){this.gridOptionsWrapper.isEnableRtl()?(this.viewportLeft=this.bodyWidth-this.scrollPosition-this.scrollWidth,this.viewportRight=this.bodyWidth-this.scrollPosition):(this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition)},f.prototype.getDisplayedColumnsStartingAt=function(d){for(var g=d,S=[];g!=null;)S.push(g),g=this.getDisplayedColAfter(g);return S},f.prototype.checkViewportColumns=function(){if(this.displayedColumnsCenter!=null){var d=this.viewportColumns.map(function(O){return O.getId()}).join("#");this.extractViewport();var g=this.viewportColumns.map(function(O){return O.getId()}).join("#");if(d!==g){var S={type:ui.EVENT_VIRTUAL_COLUMNS_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(S)}}},f.prototype.setViewportPosition=function(d,g){(d!==this.scrollWidth||g!==this.scrollPosition||this.bodyWidthDirty)&&(this.scrollWidth=d,this.scrollPosition=g,this.bodyWidthDirty=!0,this.setViewport(),this.ready&&this.checkViewportColumns())},f.prototype.isPivotMode=function(){return this.pivotMode},f.prototype.isPivotSettingAllowed=function(d){return d&&this.gridOptionsWrapper.isTreeData()?(console.warn("AG Grid: Pivot mode not available in conjunction Tree Data i.e. 'gridOptions.treeData: true'"),!1):!0},f.prototype.setPivotMode=function(d,g){if(g===void 0&&(g="api"),!(d===this.pivotMode||!this.isPivotSettingAllowed(this.pivotMode))){this.pivotMode=d,this.autoGroupsNeedBuilding=!0,this.updateGridColumns(),this.updateDisplayedColumns(g);var S={type:ui.EVENT_COLUMN_PIVOT_MODE_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(S)}},f.prototype.getSecondaryPivotColumn=function(d,g){if(r(this.secondaryColumns))return null;var S=this.getPrimaryColumn(g),O=null;return this.secondaryColumns.forEach(function(z){var te=z.getColDef().pivotKeys,Fe=z.getColDef().pivotValueColumn,Ue=_(te,d),ut=Fe===S;Ue&&ut&&(O=z)}),O},f.prototype.setBeans=function(d){this.logger=d.create("columnModel")},f.prototype.setFirstRightAndLastLeftPinned=function(d){var g,S;this.gridOptionsWrapper.isEnableRtl()?(g=this.displayedColumnsLeft?this.displayedColumnsLeft[0]:null,S=this.displayedColumnsRight?m(this.displayedColumnsRight):null):(g=this.displayedColumnsLeft?m(this.displayedColumnsLeft):null,S=this.displayedColumnsRight?this.displayedColumnsRight[0]:null),this.gridColumns.forEach(function(O){O.setLastLeftPinned(O===g,d),O.setFirstRightPinned(O===S,d)})},f.prototype.autoSizeColumns=function(d){var g=this,S=d.columns,O=d.skipHeader,z=d.skipHeaderGroups,te=d.stopAtGroup,Fe=d.source,Ue=Fe===void 0?"api":Fe;this.animationFrameService.flushAllFrames();for(var ut=[],Mt=-1,ni=O??this.gridOptionsWrapper.isSkipHeaderOnAutoSize(),Si=z??ni;Mt!==0;)Mt=0,this.actionOnGridColumns(S,function(Pi){if(ut.indexOf(Pi)>=0)return!1;var Qi=g.autoWidthCalculator.getPreferredWidthForColumn(Pi,ni);if(Qi>0){var _r=g.normaliseColumnWidth(Pi,Qi);Pi.setActualWidth(_r,Ue),ut.push(Pi),Mt++}return!0},Ue);Si||this.autoSizeColumnGroupsByColumns(S,te),this.fireColumnResizedEvent(ut,!0,"autosizeColumns")},f.prototype.fireColumnResizedEvent=function(d,g,S,O){if(O===void 0&&(O=null),d&&d.length){var z={type:ui.EVENT_COLUMN_RESIZED,columns:d,column:d.length===1?d[0]:null,flexColumns:O,finished:g,api:this.gridApi,columnApi:this.columnApi,source:S};this.eventService.dispatchEvent(z)}},f.prototype.autoSizeColumn=function(d,g,S){S===void 0&&(S="api"),d&&this.autoSizeColumns({columns:[d],skipHeader:g,skipHeaderGroups:!0,source:S})},f.prototype.autoSizeColumnGroupsByColumns=function(d,g){var S,O,z,te,Fe=new Set,Ue=this.getGridColumns(d);Ue.forEach(function($r){for(var Yr=$r.getParent();Yr&&Yr!=g;)Yr.isPadding()||Fe.add(Yr),Yr=Yr.getParent()});var ut,Mt=[];try{for(var ni=Ai(Fe),Si=ni.next();!Si.done;Si=ni.next()){var Pi=Si.value;try{for(var Qi=(z=void 0,Ai(this.ctrlsService.getHeaderRowContainerCtrls())),_r=Qi.next();!_r.done;_r=Qi.next()){var Hr=_r.value;if(ut=Hr.getHeaderCtrlForColumn(Pi),ut)break}}catch($r){z={error:$r}}finally{try{_r&&!_r.done&&(te=Qi.return)&&te.call(Qi)}finally{if(z)throw z.error}}ut&&ut.resizeLeafColumnsToFit()}}catch($r){S={error:$r}}finally{try{Si&&!Si.done&&(O=ni.return)&&O.call(ni)}finally{if(S)throw S.error}}return Mt},f.prototype.autoSizeAllColumns=function(d,g){g===void 0&&(g="api");var S=this.getAllDisplayedColumns();this.autoSizeColumns({columns:S,skipHeader:d,source:g})},f.prototype.getColumnsFromTree=function(d){var g=[],S=function(O){for(var z=0;z=0},f.prototype.getAllDisplayedColumns=function(){return this.displayedColumns},f.prototype.getViewportColumns=function(){return this.viewportColumns},f.prototype.getDisplayedLeftColumnsForRow=function(d){return this.colSpanActive?this.getDisplayedColumnsForRow(d,this.displayedColumnsLeft):this.displayedColumnsLeft},f.prototype.getDisplayedRightColumnsForRow=function(d){return this.colSpanActive?this.getDisplayedColumnsForRow(d,this.displayedColumnsRight):this.displayedColumnsRight},f.prototype.getDisplayedColumnsForRow=function(d,g,S,O){for(var z=[],te=null,Fe=function(Mt){var ni=g[Mt],Si=g.length-Mt,Pi=Math.min(ni.getColSpan(d),Si),Qi=[ni];if(Pi>1){for(var _r=Pi-1,Hr=1;Hr<=_r;Hr++)Qi.push(g[Mt+Hr]);Mt+=_r}var $r;if(S?($r=!1,Qi.forEach(function(kn){S(kn)&&($r=!0)})):$r=!0,$r){if(z.length===0&&te){var Yr=O?O(ni):!1;Yr&&z.push(te)}z.push(ni)}te=ni,Ue=Mt},Ue,ut=0;utg.viewportLeft},O=this.suppressColumnVirtualisation?null:this.isColumnInViewport.bind(this);return this.getDisplayedColumnsForRow(d,this.displayedColumnsCenter,O,S)},f.prototype.getAriaColumnIndex=function(d){return this.getAllGridColumns().indexOf(d)+1},f.prototype.isColumnInViewport=function(d){if(d.isAutoHeight())return!0;var g=d.getLeft()||0,S=g+d.getActualWidth(),O=this.viewportLeft-200,z=this.viewportRight+200,te=gz&&S>z;return!te&&!Fe},f.prototype.getDisplayedColumnsLeftWidth=function(){return this.getWidthOfColsInList(this.displayedColumnsLeft)},f.prototype.getDisplayedColumnsRightWidth=function(){return this.getWidthOfColsInList(this.displayedColumnsRight)},f.prototype.updatePrimaryColumnList=function(d,g,S,O,z,te){var Fe=this;if(te===void 0&&(te="api"),!(!d||n(d))){var Ue=!1;if(d.forEach(function(Mt){var ni=Fe.getPrimaryColumn(Mt);if(ni){if(S){if(g.indexOf(ni)>=0)return;g.push(ni)}else{if(g.indexOf(ni)<0)return;q(g,ni)}O(ni),Ue=!0}}),!!Ue){this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(te);var ut={type:z,columns:g,column:g.length===1?g[0]:null,api:this.gridApi,columnApi:this.columnApi,source:te};this.eventService.dispatchEvent(ut)}}},f.prototype.setRowGroupColumns=function(d,g){g===void 0&&(g="api"),this.autoGroupsNeedBuilding=!0,this.setPrimaryColumnList(d,this.rowGroupColumns,ui.EVENT_COLUMN_ROW_GROUP_CHANGED,this.setRowGroupActive.bind(this),g)},f.prototype.setRowGroupActive=function(d,g,S){d!==g.isRowGroupActive()&&(g.setRowGroupActive(d,S),!d&&!this.gridOptionsWrapper.isSuppressMakeColumnVisibleAfterUnGroup()&&g.setVisible(!0,S))},f.prototype.addRowGroupColumn=function(d,g){g===void 0&&(g="api"),d&&this.addRowGroupColumns([d],g)},f.prototype.addRowGroupColumns=function(d,g){g===void 0&&(g="api"),this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(d,this.rowGroupColumns,!0,this.setRowGroupActive.bind(this,!0),ui.EVENT_COLUMN_ROW_GROUP_CHANGED,g)},f.prototype.removeRowGroupColumns=function(d,g){g===void 0&&(g="api"),this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(d,this.rowGroupColumns,!1,this.setRowGroupActive.bind(this,!1),ui.EVENT_COLUMN_ROW_GROUP_CHANGED,g)},f.prototype.removeRowGroupColumn=function(d,g){g===void 0&&(g="api"),d&&this.removeRowGroupColumns([d],g)},f.prototype.addPivotColumns=function(d,g){g===void 0&&(g="api"),this.updatePrimaryColumnList(d,this.pivotColumns,!0,function(S){return S.setPivotActive(!0,g)},ui.EVENT_COLUMN_PIVOT_CHANGED,g)},f.prototype.setPivotColumns=function(d,g){g===void 0&&(g="api"),this.setPrimaryColumnList(d,this.pivotColumns,ui.EVENT_COLUMN_PIVOT_CHANGED,function(S,O){O.setPivotActive(S,g)},g)},f.prototype.addPivotColumn=function(d,g){g===void 0&&(g="api"),this.addPivotColumns([d],g)},f.prototype.removePivotColumns=function(d,g){g===void 0&&(g="api"),this.updatePrimaryColumnList(d,this.pivotColumns,!1,function(S){return S.setPivotActive(!1,g)},ui.EVENT_COLUMN_PIVOT_CHANGED,g)},f.prototype.removePivotColumn=function(d,g){g===void 0&&(g="api"),this.removePivotColumns([d],g)},f.prototype.setPrimaryColumnList=function(d,g,S,O,z){var te=this;g.length=0,i(d)&&d.forEach(function(Fe){var Ue=te.getPrimaryColumn(Fe);Ue&&g.push(Ue)}),(this.primaryColumns||[]).forEach(function(Fe){var Ue=g.indexOf(Fe)>=0;O(Ue,Fe)}),this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(z),this.fireColumnEvent(S,g,z)},f.prototype.setValueColumns=function(d,g){g===void 0&&(g="api"),this.setPrimaryColumnList(d,this.valueColumns,ui.EVENT_COLUMN_VALUE_CHANGED,this.setValueActive.bind(this),g)},f.prototype.setValueActive=function(d,g,S){if(d!==g.isValueActive()&&(g.setValueActive(d,S),d&&!g.getAggFunc())){var O=this.aggFuncService.getDefaultAggFunc(g);g.setAggFunc(O)}},f.prototype.addValueColumns=function(d,g){g===void 0&&(g="api"),this.updatePrimaryColumnList(d,this.valueColumns,!0,this.setValueActive.bind(this,!0),ui.EVENT_COLUMN_VALUE_CHANGED,g)},f.prototype.addValueColumn=function(d,g){g===void 0&&(g="api"),d&&this.addValueColumns([d],g)},f.prototype.removeValueColumn=function(d,g){g===void 0&&(g="api"),this.removeValueColumns([d],g)},f.prototype.removeValueColumns=function(d,g){g===void 0&&(g="api"),this.updatePrimaryColumnList(d,this.valueColumns,!1,this.setValueActive.bind(this,!1),ui.EVENT_COLUMN_VALUE_CHANGED,g)},f.prototype.normaliseColumnWidth=function(d,g){var S=d.getMinWidth();i(S)&&g0?z+=ni:te=!1});var Fe=S>=O,Ue=!te||S<=z;return Fe&&Ue},f.prototype.resizeColumnSets=function(d){var g=this,S=d.resizeSets,O=d.finished,z=d.source,te=!S||S.every(function(Pi){return g.checkMinAndMaxWidthsForSet(Pi)});if(!te){if(O){var Fe=S&&S.length>0?S[0].columns:null;this.fireColumnResizedEvent(Fe,O,z)}return}var Ue=[],ut=[];S.forEach(function(Pi){var Qi=Pi.width,_r=Pi.columns,Hr=Pi.ratios,$r={},Yr={};_r.forEach(function(Co){return ut.push(Co)});for(var kn=!0,co=0,hl=function(){if(co++,co>1e3)return console.error("AG Grid: infinite loop in resizeColumnSets"),"break";kn=!1;var Co=[],jl=0,Gl=Qi;_r.forEach(function(cf,pC){var fC=Yr[cf.getId()];if(fC)Gl-=$r[cf.getId()];else{Co.push(cf);var Ub=Hr[pC];jl+=Ub}});var uf=1/jl;Co.forEach(function(cf,pC){var fC=pC===Co.length-1,Ub;fC?Ub=Gl:(Ub=Math.round(Hr[pC]*Qi*uf),Gl-=Ub);var oH=cf.getMinWidth(),T8=cf.getMaxWidth();i(oH)&&Ub0&&Ub>T8&&(Ub=T8,Yr[cf.getId()]=!0,kn=!0),$r[cf.getId()]=Ub})};kn;){var dl=hl();if(dl==="break")break}_r.forEach(function(Co){var jl=$r[Co.getId()],Gl=Co.getActualWidth();Gl!==jl&&(Co.setActualWidth(jl,z),Ue.push(Co))})});var Mt=Ue.length>0,ni=[];Mt&&(ni=this.refreshFlexedColumns({resizingCols:ut,skipSetLeft:!0}),this.setLeftValues(z),this.updateBodyWidths(),this.checkViewportColumns());var Si=ut.concat(ni);(Mt||O)&&this.fireColumnResizedEvent(Si,O,z,ni)},f.prototype.setColumnAggFunc=function(d,g,S){if(S===void 0&&(S="api"),!!d){var O=this.getPrimaryColumn(d);O&&(O.setAggFunc(g),this.fireColumnEvent(ui.EVENT_COLUMN_VALUE_CHANGED,[O],S))}},f.prototype.fireColumnEvent=function(d,g,S){var O={type:d,columns:g,column:g&&g.length==1?g[0]:null,api:this.gridApi,columnApi:this.columnApi,source:S};this.eventService.dispatchEvent(O)},f.prototype.moveRowGroupColumn=function(d,g,S){S===void 0&&(S="api");var O=this.rowGroupColumns[d];this.rowGroupColumns.splice(d,1),this.rowGroupColumns.splice(g,0,O);var z={type:ui.EVENT_COLUMN_ROW_GROUP_CHANGED,columns:this.rowGroupColumns,column:this.rowGroupColumns.length===1?this.rowGroupColumns[0]:null,api:this.gridApi,columnApi:this.columnApi,source:S};this.eventService.dispatchEvent(z)},f.prototype.moveColumns=function(d,g,S){if(S===void 0&&(S="api"),this.columnAnimationService.start(),g>this.gridColumns.length-d.length){console.warn("AG Grid: tried to insert columns in invalid location, toIndex = "+g),console.warn("AG Grid: remember that you should not count the moving columns when calculating the new index");return}var O=this.getGridColumns(d),z=!this.doesMovePassRules(O,g);if(!z){be(this.gridColumns,O,g),this.updateDisplayedColumns(S);var te={type:ui.EVENT_COLUMN_MOVED,columns:O,column:O.length===1?O[0]:null,toIndex:g,api:this.gridApi,columnApi:this.columnApi,source:S};this.eventService.dispatchEvent(te),this.columnAnimationService.finish()}},f.prototype.doesMovePassRules=function(d,g){var S=this.gridColumns.slice();return be(S,d,g),!(!this.doesMovePassMarryChildren(S)||!this.doesMovePassLockedPositions(S))},f.prototype.sortColumnsLikeGridColumns=function(d){var g=this;if(!(!d||d.length<=1)){var S=d.filter(function(O){return g.gridColumns.indexOf(O)<0}).length>0;S||d.sort(function(O,z){var te=g.gridColumns.indexOf(O),Fe=g.gridColumns.indexOf(z);return te-Fe})}},f.prototype.doesMovePassLockedPositions=function(d){var g=0,S=!0,O=function(z){return z?z===!0||z==="left"?0:2:1};return d.forEach(function(z){var te=O(z.getColDef().lockPosition);teni&&(g=!1)}}}),g},f.prototype.moveColumn=function(d,g,S){S===void 0&&(S="api"),this.moveColumns([d],g,S)},f.prototype.moveColumnByIndex=function(d,g,S){S===void 0&&(S="api");var O=this.gridColumns[d];this.moveColumn(O,g,S)},f.prototype.getColumnDefs=function(){var d=this;if(this.primaryColumns){var g=this.primaryColumns.slice();return this.gridColsArePrimary?g.sort(function(S,O){return d.gridColumns.indexOf(S)-d.gridColumns.indexOf(O)}):this.lastPrimaryOrder&&g.sort(function(S,O){return d.lastPrimaryOrder.indexOf(S)-d.lastPrimaryOrder.indexOf(O)}),this.columnDefFactory.buildColumnDefs(g,this.rowGroupColumns,this.pivotColumns)}},f.prototype.getBodyContainerWidth=function(){return this.bodyWidth},f.prototype.getContainerWidth=function(d){switch(d){case $e.PINNED_LEFT:return this.leftWidth;case $e.PINNED_RIGHT:return this.rightWidth;default:return this.bodyWidth}},f.prototype.updateBodyWidths=function(){var d=this.getWidthOfColsInList(this.displayedColumnsCenter),g=this.getWidthOfColsInList(this.displayedColumnsLeft),S=this.getWidthOfColsInList(this.displayedColumnsRight);this.bodyWidthDirty=this.bodyWidth!==d;var O=this.bodyWidth!==d||this.leftWidth!==g||this.rightWidth!==S;if(O){this.bodyWidth=d,this.leftWidth=g,this.rightWidth=S;var z={type:ui.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(z)}},f.prototype.getValueColumns=function(){return this.valueColumns?this.valueColumns:[]},f.prototype.getPivotColumns=function(){return this.pivotColumns?this.pivotColumns:[]},f.prototype.isPivotActive=function(){return this.pivotColumns&&this.pivotColumns.length>0&&this.pivotMode},f.prototype.getRowGroupColumns=function(){return this.rowGroupColumns?this.rowGroupColumns:[]},f.prototype.getDisplayedCenterColumns=function(){return this.displayedColumnsCenter},f.prototype.getDisplayedLeftColumns=function(){return this.displayedColumnsLeft},f.prototype.getDisplayedRightColumns=function(){return this.displayedColumnsRight},f.prototype.getDisplayedColumns=function(d){switch(d){case $e.PINNED_LEFT:return this.getDisplayedLeftColumns();case $e.PINNED_RIGHT:return this.getDisplayedRightColumns();default:return this.getDisplayedCenterColumns()}},f.prototype.getAllPrimaryColumns=function(){return this.primaryColumns?this.primaryColumns.slice():null},f.prototype.getSecondaryColumns=function(){return this.secondaryColumns?this.secondaryColumns.slice():null},f.prototype.getAllColumnsForQuickFilter=function(){return this.columnsForQuickFilter},f.prototype.getAllGridColumns=function(){return this.gridColumns},f.prototype.isEmpty=function(){return n(this.gridColumns)},f.prototype.isRowGroupEmpty=function(){return n(this.rowGroupColumns)},f.prototype.setColumnVisible=function(d,g,S){S===void 0&&(S="api"),this.setColumnsVisible([d],g,S)},f.prototype.setColumnsVisible=function(d,g,S){var O=this;g===void 0&&(g=!1),S===void 0&&(S="api"),this.columnAnimationService.start(),this.actionOnGridColumns(d,function(z){return z.isVisible()!==g?(z.setVisible(g,S),!0):!1},S,function(){var z={type:ui.EVENT_COLUMN_VISIBLE,visible:g,column:null,columns:null,api:O.gridApi,columnApi:O.columnApi,source:S};return z}),this.columnAnimationService.finish()},f.prototype.setColumnPinned=function(d,g,S){S===void 0&&(S="api"),d&&this.setColumnsPinned([d],g,S)},f.prototype.setColumnsPinned=function(d,g,S){var O=this;if(S===void 0&&(S="api"),this.gridOptionsWrapper.getDomLayout()==="print"){console.warn("Changing the column pinning status is not allowed with domLayout='print'");return}this.columnAnimationService.start();var z;g===!0||g===$e.PINNED_LEFT?z=$e.PINNED_LEFT:g===$e.PINNED_RIGHT?z=$e.PINNED_RIGHT:z=null,this.actionOnGridColumns(d,function(te){return te.getPinned()!==z?(te.setPinned(z),!0):!1},S,function(){var te={type:ui.EVENT_COLUMN_PINNED,pinned:z,column:null,columns:null,api:O.gridApi,columnApi:O.columnApi,source:S};return te}),this.columnAnimationService.finish()},f.prototype.actionOnGridColumns=function(d,g,S,O){var z=this;if(!n(d)){var te=[];if(d.forEach(function(Ue){var ut=z.getGridColumn(Ue);if(ut){var Mt=g(ut);Mt!==!1&&te.push(ut)}}),!!te.length&&(this.updateDisplayedColumns(S),i(O)&&O)){var Fe=O();Fe.columns=te,Fe.column=te.length===1?te[0]:null,this.eventService.dispatchEvent(Fe)}}},f.prototype.getDisplayedColBefore=function(d){var g=this.getAllDisplayedColumns(),S=g.indexOf(d);return S>0?g[S-1]:null},f.prototype.getDisplayedColAfter=function(d){var g=this.getAllDisplayedColumns(),S=g.indexOf(d);return S0},f.prototype.isPinningRight=function(){return this.displayedColumnsRight.length>0},f.prototype.getPrimaryAndSecondaryAndAutoColumns=function(){var d;return(d=[]).concat.apply(d,ir([this.primaryColumns||[],this.groupAutoColumns||[],this.secondaryColumns||[]]))},f.prototype.getPrimaryAndAutoGroupCols=function(){var d;return(d=[]).concat.apply(d,ir([this.primaryColumns||[],this.groupAutoColumns||[]]))},f.prototype.getPrimaryAndSecondaryColumns=function(){var d;return(d=[]).concat.apply(d,ir([this.primaryColumns||[],this.secondaryColumns||[]]))},f.prototype.createStateItemFromColumn=function(d){var g=d.isRowGroupActive()?this.rowGroupColumns.indexOf(d):null,S=d.isPivotActive()?this.pivotColumns.indexOf(d):null,O=d.isValueActive()?d.getAggFunc():null,z=d.getSort()!=null?d.getSort():null,te=d.getSortIndex()!=null?d.getSortIndex():null,Fe=d.getFlex()!=null&&d.getFlex()>0?d.getFlex():null,Ue={colId:d.getColId(),width:d.getActualWidth(),hide:!d.isVisible(),pinned:d.getPinned(),sort:z,sortIndex:te,aggFunc:O,rowGroup:d.isRowGroupActive(),rowGroupIndex:g,pivot:d.isPivotActive(),pivotIndex:S,flex:Fe};return Ue},f.prototype.getColumnState=function(){if(r(this.primaryColumns)||!this.isAlive())return[];var d=this.getPrimaryAndSecondaryAndAutoColumns(),g=d.map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(g),g},f.prototype.orderColumnStateList=function(d){var g=jn(this.gridColumns.map(function(S,O){return[S.getColId(),O]}));d.sort(function(S,O){var z=g.has(S.colId)?g.get(S.colId):-1,te=g.has(O.colId)?g.get(O.colId):-1;return z-te})},f.prototype.resetColumnState=function(d){d===void 0&&(d="api");var g=this.getColumnsFromTree(this.primaryColumnTree),S=[],O=1e3,z=1e3,te=[];this.groupAutoColumns&&(te=te.concat(this.groupAutoColumns)),g&&(te=te.concat(g)),te.forEach(function(Fe){var Ue=function(dl,Co){return dl??Co??null},ut=Fe.getColDef(),Mt=Ue(ut.sort,ut.initialSort),ni=Ue(ut.sortIndex,ut.initialSortIndex),Si=Ue(ut.hide,ut.initialHide),Pi=Ue(ut.pinned,ut.initialPinned),Qi=Ue(ut.width,ut.initialWidth),_r=Ue(ut.flex,ut.initialFlex),Hr=Ue(ut.rowGroupIndex,ut.initialRowGroupIndex),$r=Ue(ut.rowGroup,ut.initialRowGroup);Hr==null&&($r==null||$r==!1)&&(Hr=null,$r=null);var Yr=Ue(ut.pivotIndex,ut.initialPivotIndex),kn=Ue(ut.pivot,ut.initialPivot);Yr==null&&(kn==null||kn==!1)&&(Yr=null,kn=null);var co=Ue(ut.aggFunc,ut.initialAggFunc),hl={colId:Fe.getColId(),sort:Mt,sortIndex:ni,hide:Si,pinned:Pi,width:Qi,flex:_r,rowGroup:$r,rowGroupIndex:Hr,pivot:kn,pivotIndex:Yr,aggFunc:co};r(Hr)&&$r&&(hl.rowGroupIndex=O++),r(Yr)&&kn&&(hl.pivotIndex=z++),S.push(hl)}),this.applyColumnState({state:S,applyOrder:!0},d)},f.prototype.applyColumnState=function(d,g){var S=this;if(g===void 0&&(g="api"),n(this.primaryColumns))return!1;if(d&&d.state&&!d.state.forEach)return console.warn("AG Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."),!1;var O=function(Ue,ut,Mt){var ni=S.compareColumnStatesAndRaiseEvents(g);S.autoGroupsNeedBuilding=!0;var Si=ut.slice(),Pi={},Qi={},_r=[],Hr=[],$r=0,Yr=S.rowGroupColumns.slice(),kn=S.pivotColumns.slice();Ue.forEach(function(Co){var jl=Co.colId||"",Gl=jl.startsWith($e.GROUP_AUTO_COLUMN_ID);if(Gl){_r.push(Co),Hr.push(Co);return}var uf=Mt(jl);uf?(S.syncColumnWithStateItem(uf,Co,d.defaultState,Pi,Qi,!1,g),q(Si,uf)):(Hr.push(Co),$r+=1)});var co=function(Co){return S.syncColumnWithStateItem(Co,null,d.defaultState,Pi,Qi,!1,g)};Si.forEach(co);var hl=function(Co,jl,Gl,uf){var cf=Co[Gl.getId()],pC=Co[uf.getId()],fC=cf!=null,Ub=pC!=null;if(fC&&Ub)return cf-pC;if(fC)return-1;if(Ub)return 1;var oH=jl.indexOf(Gl),T8=jl.indexOf(uf),FLt=oH>=0,kDr=T8>=0;return FLt&&kDr?oH-T8:FLt?-1:1};S.rowGroupColumns.sort(hl.bind(S,Pi,Yr)),S.pivotColumns.sort(hl.bind(S,Qi,kn)),S.updateGridColumns();var dl=S.groupAutoColumns?S.groupAutoColumns.slice():[];return _r.forEach(function(Co){var jl=S.getAutoColumn(Co.colId);q(dl,jl),S.syncColumnWithStateItem(jl,Co,d.defaultState,null,null,!0,g)}),dl.forEach(co),S.applyOrderAfterApplyState(d),S.updateDisplayedColumns(g),S.dispatchEverythingChanged(g),ni(),{unmatchedAndAutoStates:Hr,unmatchedCount:$r}};this.columnAnimationService.start();var z=O(d.state||[],this.primaryColumns||[],function(Ue){return S.getPrimaryColumn(Ue)}),te=z.unmatchedAndAutoStates,Fe=z.unmatchedCount;return(te.length>0||i(d.defaultState))&&(Fe=O(te,this.secondaryColumns||[],function(Ue){return S.getSecondaryColumn(Ue)}).unmatchedCount),this.columnAnimationService.finish(),Fe===0},f.prototype.applyOrderAfterApplyState=function(d){var g=this;if(!(!d.applyOrder||!d.state)){var S=[],O={};d.state.forEach(function(te){if(!(!te.colId||O[te.colId])){var Fe=g.gridColumnsMap[te.colId];Fe&&(S.push(Fe),O[te.colId]=!0)}});var z=0;if(this.gridColumns.forEach(function(te){var Fe=te.getColId(),Ue=O[Fe]!=null;if(!Ue){var ut=Fe.startsWith($e.GROUP_AUTO_COLUMN_ID);ut?oe(S,te,z++):S.push(te)}}),S=this.placeLockedColumns(S),!this.doesMovePassMarryChildren(S)){console.warn("AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.");return}this.gridColumns=S}},f.prototype.compareColumnStatesAndRaiseEvents=function(d){var g=this,S={rowGroupColumns:this.rowGroupColumns.slice(),pivotColumns:this.pivotColumns.slice(),valueColumns:this.valueColumns.slice()},O=this.getColumnState(),z={};return O.forEach(function(te){z[te.colId]=te}),function(){if(!g.gridOptionsWrapper.isSuppressColumnStateEvents()){var te=g.getPrimaryAndSecondaryAndAutoColumns(),Fe=function(Hr,$r,Yr,kn){var co=$r.map(kn),hl=Yr.map(kn),dl=_(co,hl);if(!dl){var Co={type:Hr,columns:Yr,column:Yr.length===1?Yr[0]:null,api:g.gridApi,columnApi:g.columnApi,source:d};g.eventService.dispatchEvent(Co)}},Ue=function(Hr){var $r=[];return te.forEach(function(Yr){var kn=z[Yr.getColId()];kn&&Hr(kn,Yr)&&$r.push(Yr)}),$r},ut=function(Hr){return Hr.getColId()};Fe(ui.EVENT_COLUMN_ROW_GROUP_CHANGED,S.rowGroupColumns,g.rowGroupColumns,ut),Fe(ui.EVENT_COLUMN_PIVOT_CHANGED,S.pivotColumns,g.pivotColumns,ut);var Mt=function(Hr,$r){var Yr=Hr.aggFunc!=null,kn=Yr!=$r.isValueActive(),co=Yr&&Hr.aggFunc!=$r.getAggFunc();return kn||co},ni=Ue(Mt);ni.length>0&&g.fireColumnEvent(ui.EVENT_COLUMN_VALUE_CHANGED,g.valueColumns,d);var Si=function(Hr,$r){return Hr.width!=$r.getActualWidth()};g.fireColumnResizedEvent(Ue(Si),!0,d);var Pi=function(Hr,$r){return Hr.pinned!=$r.getPinned()};g.raiseColumnPinnedEvent(Ue(Pi),d);var Qi=function(Hr,$r){return Hr.hide==$r.isVisible()};g.raiseColumnVisibleEvent(Ue(Qi),d);var _r=function(Hr,$r){return Hr.sort!=$r.getSort()||Hr.sortIndex!=$r.getSortIndex()};Ue(_r).length>0&&g.sortController.dispatchSortChangedEvents(d),g.raiseColumnMovedEvent(O,d)}}},f.prototype.raiseColumnPinnedEvent=function(d,g){if(d.length){var S=d.length===1?d[0]:null,O=this.getCommonValue(d,function(te){return te.getPinned()}),z={type:ui.EVENT_COLUMN_PINNED,pinned:O??null,columns:d,column:S,api:this.gridApi,columnApi:this.columnApi,source:g};this.eventService.dispatchEvent(z)}},f.prototype.getCommonValue=function(d,g){if(!(!d||d.length==0)){for(var S=g(d[0]),O=1;O=ni&&d.setActualWidth(Qi,Fe)}var _r=Ue("sort").value1;_r!==void 0&&(_r===$e.SORT_DESC||_r===$e.SORT_ASC?d.setSort(_r,Fe):d.setSort(void 0,Fe));var Hr=Ue("sortIndex").value1;if(Hr!==void 0&&d.setSortIndex(Hr),!(te||!d.isPrimary())){var $r=Ue("aggFunc").value1;$r!==void 0&&(typeof $r=="string"?(d.setAggFunc($r),d.isValueActive()||(d.setValueActive(!0,Fe),this.valueColumns.push(d))):(i($r)&&console.warn("AG Grid: stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."),d.isValueActive()&&(d.setValueActive(!1,Fe),q(this.valueColumns,d))));var Yr=Ue("rowGroup","rowGroupIndex"),kn=Yr.value1,co=Yr.value2;(kn!==void 0||co!==void 0)&&(typeof co=="number"||kn?(d.isRowGroupActive()||(d.setRowGroupActive(!0,Fe),this.rowGroupColumns.push(d)),O&&typeof co=="number"&&(O[d.getId()]=co)):d.isRowGroupActive()&&(d.setRowGroupActive(!1,Fe),q(this.rowGroupColumns,d)));var hl=Ue("pivot","pivotIndex"),dl=hl.value1,Co=hl.value2;(dl!==void 0||Co!==void 0)&&(typeof Co=="number"||dl?(d.isPivotActive()||(d.setPivotActive(!0,Fe),this.pivotColumns.push(d)),z&&typeof Co=="number"&&(z[d.getId()]=Co)):d.isPivotActive()&&(d.setPivotActive(!1,Fe),q(this.pivotColumns,d)))}}},f.prototype.getGridColumns=function(d){return this.getColumns(d,this.getGridColumn.bind(this))},f.prototype.getColumns=function(d,g){var S=[];return d&&d.forEach(function(O){var z=g(O);z&&S.push(z)}),S},f.prototype.getColumnWithValidation=function(d){if(d==null)return null;var g=this.getGridColumn(d);return g||console.warn("AG Grid: could not find column "+d),g},f.prototype.getPrimaryColumn=function(d){return this.primaryColumns?this.getColumn(d,this.primaryColumns,this.primaryColumnsMap):null},f.prototype.getGridColumn=function(d){return this.getColumn(d,this.gridColumns,this.gridColumnsMap)},f.prototype.getSecondaryColumn=function(d){return this.secondaryColumns?this.getColumn(d,this.secondaryColumns,this.secondaryColumnsMap):null},f.prototype.getColumn=function(d,g,S){if(!d)return null;if(typeof d=="string"&&S[d])return S[d];for(var O=0;O=0:Pi?dl?kn=Hr:Co?kn=Yr!=null&&Yr>=0:kn=!1:kn=g.indexOf(Si)>=0,kn){var jl=Pi?$r!=null||Yr!=null:$r!=null;jl?Ue.push(Si):ut.push(Si)}});var Mt=function(Si){var Pi=O(Si.getColDef()),Qi=z(Si.getColDef());return Pi??Qi};Ue.sort(function(Si,Pi){var Qi=Mt(Si),_r=Mt(Pi);return Qi===_r?0:Qi<_r?-1:1});var ni=[].concat(Ue);return g.forEach(function(Si){ut.indexOf(Si)>=0&&ni.push(Si)}),ut.forEach(function(Si){ni.indexOf(Si)<0&&ni.push(Si)}),g.forEach(function(Si){ni.indexOf(Si)<0&&S(Si,!1)}),ni.forEach(function(Si){g.indexOf(Si)<0&&S(Si,!0)}),ni},f.prototype.extractPivotColumns=function(d,g){this.pivotColumns=this.extractColumns(g,this.pivotColumns,function(S,O){return S.setPivotActive(O,d)},function(S){return S.pivotIndex},function(S){return S.initialPivotIndex},function(S){return S.pivot},function(S){return S.initialPivot})},f.prototype.resetColumnGroupState=function(d){d===void 0&&(d="api");var g=[];this.columnUtils.depthFirstOriginalTreeSearch(null,this.primaryColumnTree,function(S){if(S instanceof ti){var O=S.getColGroupDef(),z={groupId:S.getGroupId(),open:O?O.openByDefault:void 0};g.push(z)}}),this.setColumnGroupState(g,d)},f.prototype.getColumnGroupState=function(){var d=[];return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,function(g){g instanceof ti&&d.push({groupId:g.getGroupId(),open:g.isExpanded()})}),d},f.prototype.setColumnGroupState=function(d,g){var S=this;g===void 0&&(g="api"),this.columnAnimationService.start();var O=[];d.forEach(function(z){var te=z.groupId,Fe=z.open,Ue=S.getProvidedColumnGroup(te);Ue&&Ue.isExpanded()!==Fe&&(S.logger.log("columnGroupOpened("+Ue.getGroupId()+","+Fe+")"),Ue.setExpanded(Fe),O.push(Ue))}),this.updateGroupsAndDisplayedColumns(g),this.setFirstRightAndLastLeftPinned(g),O.forEach(function(z){var te={type:ui.EVENT_COLUMN_GROUP_OPENED,columnGroup:z,api:S.gridApi,columnApi:S.columnApi};S.eventService.dispatchEvent(te)}),this.columnAnimationService.finish()},f.prototype.setColumnGroupOpened=function(d,g,S){S===void 0&&(S="api");var O;d instanceof ti?O=d.getId():O=d||"",this.setColumnGroupState([{groupId:O,open:g}],S)},f.prototype.getProvidedColumnGroup=function(d){typeof d!="string"&&console.error("AG Grid: group key must be a string");var g=null;return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,function(S){S instanceof ti&&S.getId()===d&&(g=S)}),g},f.prototype.calculateColumnsForDisplay=function(){var d=this,g;return this.pivotMode&&r(this.secondaryColumns)?g=this.gridColumns.filter(function(S){var O=d.groupAutoColumns&&Me(d.groupAutoColumns,S),z=d.valueColumns&&Me(d.valueColumns,S);return O||z}):g=this.gridColumns.filter(function(S){var O=d.groupAutoColumns&&Me(d.groupAutoColumns,S);return O||S.isVisible()}),g},f.prototype.checkColSpanActiveInCols=function(d){var g=!1;return d.forEach(function(S){i(S.getColDef().colSpan)&&(g=!0)}),g},f.prototype.calculateColumnsForGroupDisplay=function(){var d=this;this.groupDisplayColumns=[];var g=function(S){var O=S.getColDef();O&&i(O.showRowGroup)&&d.groupDisplayColumns.push(S)};this.gridColumns.forEach(g),this.groupAutoColumns&&this.groupAutoColumns.forEach(g)},f.prototype.getGroupDisplayColumns=function(){return this.groupDisplayColumns},f.prototype.updateDisplayedColumns=function(d){var g=this.calculateColumnsForDisplay();this.buildDisplayedTrees(g),this.calculateColumnsForGroupDisplay(),this.updateGroupsAndDisplayedColumns(d),this.setFirstRightAndLastLeftPinned(d)},f.prototype.isSecondaryColumnsPresent=function(){return i(this.secondaryColumns)},f.prototype.setSecondaryColumns=function(d,g){var S=this;g===void 0&&(g="api");var O=d&&d.length>0;if(!(!O&&r(this.secondaryColumns))){if(O){this.processSecondaryColumnDefinitions(d);var z=this.columnFactory.createColumnTree(d,!1,this.secondaryBalancedTree||this.previousSecondaryColumns||void 0);this.secondaryBalancedTree=z.columnTree,this.secondaryHeaderRowCount=z.treeDept+1,this.secondaryColumns=this.getColumnsFromTree(this.secondaryBalancedTree),this.secondaryColumnsMap={},this.secondaryColumns.forEach(function(te){return S.secondaryColumnsMap[te.getId()]=te}),this.previousSecondaryColumns=null}else this.previousSecondaryColumns=this.secondaryBalancedTree,this.secondaryBalancedTree=null,this.secondaryHeaderRowCount=-1,this.secondaryColumns=null,this.secondaryColumnsMap={};this.updateGridColumns(),this.updateDisplayedColumns(g)}},f.prototype.processSecondaryColumnDefinitions=function(d){var g=this.gridOptionsWrapper.getProcessSecondaryColDefFunc(),S=this.gridOptionsWrapper.getProcessSecondaryColGroupDefFunc();if(!(!g&&!S)){var O=function(z){z.forEach(function(te){var Fe=i(te.children);if(Fe){var Ue=te;S&&S(Ue),O(Ue.children)}else{var ut=te;g&&g(ut)}})};d&&O(d)}},f.prototype.updateGridColumns=function(){var d=this;if(this.gridColsArePrimary?this.lastPrimaryOrder=this.gridColumns:this.lastSecondaryOrder=this.gridColumns,this.secondaryColumns&&this.secondaryBalancedTree){var g=this.secondaryColumns.every(function(O){return d.gridColumnsMap[O.getColId()]!==void 0});this.gridBalancedTree=this.secondaryBalancedTree.slice(),this.gridHeaderRowCount=this.secondaryHeaderRowCount,this.gridColumns=this.secondaryColumns.slice(),this.gridColsArePrimary=!1,g&&this.orderGridColsLike(this.lastSecondaryOrder)}else this.primaryColumns&&(this.gridBalancedTree=this.primaryColumnTree.slice(),this.gridHeaderRowCount=this.primaryHeaderRowCount,this.gridColumns=this.primaryColumns.slice(),this.gridColsArePrimary=!0,this.orderGridColsLike(this.lastPrimaryOrder));this.addAutoGroupToGridColumns(),this.gridColumns=this.placeLockedColumns(this.gridColumns),this.setupQuickFilterColumns(),this.clearDisplayedAndViewportColumns(),this.colSpanActive=this.checkColSpanActiveInCols(this.gridColumns),this.gridColumnsMap={},this.gridColumns.forEach(function(O){return d.gridColumnsMap[O.getId()]=O}),this.setAutoHeightActive();var S={type:ui.EVENT_GRID_COLUMNS_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(S)},f.prototype.setAutoHeightActive=function(){if(this.autoHeightActive=this.gridColumns.filter(function(O){return O.isAutoHeight()}).length>0,this.autoHeightActive){this.autoHeightActiveAtLeastOnce=!0;var d=this.rowModel.getType(),g=d===$e.ROW_MODEL_TYPE_CLIENT_SIDE||d===$e.ROW_MODEL_TYPE_SERVER_SIDE;if(!g){var S="AG Grid - autoHeight columns only work with Client Side Row Model and Server Side Row Model.";Ge(function(){return console.warn(S)},"autoHeightActive.wrongRowModel")}}},f.prototype.orderGridColsLike=function(d){if(!r(d)){var g=jn(d.map(function(ut,Mt){return[ut,Mt]})),S=!0;if(this.gridColumns.forEach(function(ut){g.has(ut)&&(S=!1)}),!S){var O=jn(this.gridColumns.map(function(ut){return[ut,!0]})),z=d.filter(function(ut){return O.has(ut)}),te=jn(z.map(function(ut){return[ut,!0]})),Fe=this.gridColumns.filter(function(ut){return!te.has(ut)}),Ue=z.slice();Fe.forEach(function(ut){var Mt=ut.getOriginalParent();if(!Mt){Ue.push(ut);return}for(var ni=[];!ni.length&&Mt;){var Si=Mt.getLeafColumns();Si.forEach(function(_r){var Hr=Ue.indexOf(_r)>=0,$r=ni.indexOf(_r)<0;Hr&&$r&&ni.push(_r)}),Mt=Mt.getOriginalParent()}if(!ni.length){Ue.push(ut);return}var Pi=ni.map(function(_r){return Ue.indexOf(_r)}),Qi=Math.max.apply(Math,ir(Pi));oe(Ue,ut,Qi+1)}),this.gridColumns=Ue}}},f.prototype.isPrimaryColumnGroupsPresent=function(){return this.primaryHeaderRowCount>1},f.prototype.setupQuickFilterColumns=function(){this.groupAutoColumns?this.columnsForQuickFilter=(this.primaryColumns||[]).concat(this.groupAutoColumns):this.primaryColumns&&(this.columnsForQuickFilter=this.primaryColumns)},f.prototype.placeLockedColumns=function(d){var g=[],S=[],O=[];return d.forEach(function(z){var te=z.getColDef().lockPosition;te==="right"?O.push(z):te==="left"||te===!0?g.push(z):S.push(z)}),ir(g,S,O)},f.prototype.addAutoGroupToGridColumns=function(){if(this.createGroupAutoColumnsIfNeeded(),!r(this.groupAutoColumns)){this.gridColumns=this.groupAutoColumns?this.groupAutoColumns.concat(this.gridColumns):this.gridColumns;var d=this.columnFactory.createForAutoGroups(this.groupAutoColumns,this.gridBalancedTree);this.gridBalancedTree=d.concat(this.gridBalancedTree)}},f.prototype.clearDisplayedAndViewportColumns=function(){this.displayedTreeLeft=[],this.displayedTreeRight=[],this.displayedTreeCentre=[],this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.viewportColumns=[]},f.prototype.updateGroupsAndDisplayedColumns=function(d){this.updateOpenClosedVisibilityInColumnGroups(),this.deriveDisplayedColumns(d),this.refreshFlexedColumns(),this.extractViewport(),this.updateBodyWidths();var g={type:ui.EVENT_DISPLAYED_COLUMNS_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(g)},f.prototype.deriveDisplayedColumns=function(d){this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft,this.displayedColumnsLeft),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre,this.displayedColumnsCenter),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight,this.displayedColumnsRight),this.joinDisplayedColumns(),this.setLeftValues(d),this.displayedAutoHeightCols=this.displayedColumns.filter(function(g){return g.isAutoHeight()})},f.prototype.isAutoRowHeightActive=function(){return this.autoHeightActive},f.prototype.wasAutoRowHeightEverActive=function(){return this.autoHeightActiveAtLeastOnce},f.prototype.joinDisplayedColumns=function(){this.gridOptionsWrapper.isEnableRtl()?this.displayedColumns=this.displayedColumnsRight.concat(this.displayedColumnsCenter).concat(this.displayedColumnsLeft):this.displayedColumns=this.displayedColumnsLeft.concat(this.displayedColumnsCenter).concat(this.displayedColumnsRight)},f.prototype.setLeftValues=function(d){this.setLeftValuesOfColumns(d),this.setLeftValuesOfGroups()},f.prototype.setLeftValuesOfColumns=function(d){var g=this;if(this.primaryColumns){var S=this.primaryColumns.slice(0),O=this.gridOptionsWrapper.isEnableRtl();[this.displayedColumnsLeft,this.displayedColumnsRight,this.displayedColumnsCenter].forEach(function(z){if(O){var te=g.getWidthOfColsInList(z);z.forEach(function(Ue){te-=Ue.getActualWidth(),Ue.setLeft(te,d)})}else{var Fe=0;z.forEach(function(Ue){Ue.setLeft(Fe,d),Fe+=Ue.getActualWidth()})}Q(S,z)}),S.forEach(function(z){z.setLeft(null,d)})}},f.prototype.setLeftValuesOfGroups=function(){[this.displayedTreeLeft,this.displayedTreeRight,this.displayedTreeCentre].forEach(function(d){d.forEach(function(g){if(g instanceof ri){var S=g;S.checkLeft()}})})},f.prototype.derivedDisplayedColumnsFromDisplayedTree=function(d,g){g.length=0,this.columnUtils.depthFirstDisplayedColumnTreeSearch(d,function(S){S instanceof H&&g.push(S)})},f.prototype.extractViewportColumns=function(){this.suppressColumnVirtualisation?this.viewportColumnsCenter=this.displayedColumnsCenter:this.viewportColumnsCenter=this.filterOutColumnsWithinViewport(),this.viewportColumns=this.viewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight)},f.prototype.getVirtualHeaderGroupRow=function(d,g){var S;switch(d){case $e.PINNED_LEFT:S=this.viewportRowLeft[g];break;case $e.PINNED_RIGHT:S=this.viewportRowRight[g];break;default:S=this.viewportRowCenter[g];break}return r(S)&&(S=[]),S},f.prototype.extractViewportRows=function(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={};var d={};this.viewportColumns.forEach(function(S){return d[S.getId()]=!0});var g=function(S,O,z){for(var te=!1,Fe=0;FeO;return kn.getFlex()&&co},te=this.displayedColumnsCenter.filter(function(kn){return!z(kn)}),Fe=this.displayedColumnsCenter.filter(function(kn){return z(kn)}),Ue=[];if(!Fe.length)return[];var ut=[],Mt;e:for(;;){var ni=Fe.reduce(function(kn,co){return kn+co.getFlex()},0);Mt=this.flexViewportWidth-this.getWidthOfColsInList(te);for(var Si=0;Si$r&&(_r=$r),_r){Pi.setActualWidth(_r,S),q(Fe,Pi),Ue.push(Pi),te.push(Pi);continue e}ut[Si]=Math.round(Qi)}break}var Yr=Mt;return Fe.forEach(function(kn,co){kn.setActualWidth(Math.min(ut[co],Yr),S),Ue.push(kn),Yr-=ut[co]}),d.skipSetLeft||this.setLeftValues(S),d.updateBodyWidths&&this.updateBodyWidths(),d.fireResizedEvent&&this.fireColumnResizedEvent(Ue,!0,S,Fe),this.flexColsCalculatedAtLestOnce||(this.gridOptionsWrapper.isRowModelDefault()&&this.rowModel.resetRowHeights(),this.flexColsCalculatedAtLestOnce=!0),Fe},f.prototype.sizeColumnsToFit=function(d,g,S){g===void 0&&(g="sizeColumnsToFit");var O=this.getAllDisplayedColumns();if(!(d<=0||!O.length)){var z=[],te=[];O.forEach(function(Yr){Yr.getColDef().suppressSizeToFit===!0?te.push(Yr):z.push(Yr)});var Fe=z.slice(0),Ue=!1,ut=function(Yr){q(z,Yr),te.push(Yr)};for(z.forEach(function(Yr){return Yr.resetActualWidth(g)});!Ue;){Ue=!0;var Mt=d-this.getWidthOfColsInList(te);if(Mt<=0)z.forEach(function(Yr){Yr.setMinimum(g)});else for(var ni=Mt/this.getWidthOfColsInList(z),Si=Mt,Pi=z.length-1;Pi>=0;Pi--){var Qi=z[Pi],_r=Qi.getMinWidth(),Hr=Qi.getMaxWidth(),$r=Math.round(Qi.getActualWidth()*ni);i(_r)&&$r<_r?($r=_r,ut(Qi),Ue=!1):i(Hr)&&Qi.isGreaterThanMax($r)?($r=Hr,ut(Qi),Ue=!1):Pi===0&&($r=Si),Qi.setActualWidth($r,g,!0),Si-=$r}}Fe.forEach(function(Yr){Yr.fireColumnWidthChangedEvent(g)}),this.setLeftValues(g),this.updateBodyWidths(),!S&&this.fireColumnResizedEvent(Fe,!0,g)}},f.prototype.buildDisplayedTrees=function(d){var g=[],S=[],O=[];d.forEach(function(te){switch(te.getPinned()){case"left":g.push(te);break;case"right":S.push(te);break;default:O.push(te);break}});var z=new W;this.displayedTreeLeft=this.displayedGroupCreator.createDisplayedGroups(g,this.gridBalancedTree,z,$e.PINNED_LEFT,this.displayedTreeLeft),this.displayedTreeRight=this.displayedGroupCreator.createDisplayedGroups(S,this.gridBalancedTree,z,$e.PINNED_RIGHT,this.displayedTreeRight),this.displayedTreeCentre=this.displayedGroupCreator.createDisplayedGroups(O,this.gridBalancedTree,z,null,this.displayedTreeCentre),this.updateDisplayedMap()},f.prototype.updateDisplayedMap=function(){var d=this;this.displayedColumnsAndGroupsMap={};var g=function(S){d.displayedColumnsAndGroupsMap[S.getUniqueId()]=S};this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeCentre,g),this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeLeft,g),this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeRight,g)},f.prototype.isDisplayed=function(d){var g=this.displayedColumnsAndGroupsMap[d.getUniqueId()];return g===d},f.prototype.updateOpenClosedVisibilityInColumnGroups=function(){var d=this.getAllDisplayedTrees();this.columnUtils.depthFirstAllColumnTreeSearch(d,function(g){if(g instanceof ri){var S=g;S.calculateDisplayedColumns()}})},f.prototype.getGroupAutoColumns=function(){return this.groupAutoColumns},f.prototype.createGroupAutoColumnsIfNeeded=function(){if(this.autoGroupsNeedBuilding){this.autoGroupsNeedBuilding=!1;var d=this.gridOptionsWrapper.isGroupUseEntireRow(this.pivotMode),g=this.pivotMode?this.gridOptionsWrapper.isPivotSuppressAutoColumn():this.gridOptionsWrapper.isGroupSuppressAutoColumn(),S=this.rowGroupColumns.length>0||this.usingTreeData,O=S&&!g&&!d;if(O){var z=this.groupAutoColumns||[],te=this.autoGroupColService.createAutoGroupColumns(z,this.rowGroupColumns),Fe=!this.autoColsEqual(te,this.groupAutoColumns);(Fe||this.forceRecreateAutoGroups)&&(this.groupAutoColumns=te)}else this.groupAutoColumns=null}},f.prototype.autoColsEqual=function(d,g){return _(d,g,function(S,O){return S.getColId()===O.getColId()})},f.prototype.getWidthOfColsInList=function(d){return d.reduce(function(g,S){return g+S.getActualWidth()},0)},f.prototype.getGridBalancedTree=function(){return this.gridBalancedTree},f.prototype.hasFloatingFilters=function(){if(!this.gridColumns)return!1;var d=this.gridColumns.some(function(g){return g.getColDef().floatingFilter});return d},f.prototype.getFirstDisplayedColumn=function(){var d=this.gridOptionsWrapper.isEnableRtl(),g=["getDisplayedLeftColumns","getDisplayedCenterColumns","getDisplayedRightColumns"];d&&g.reverse();for(var S=0;S=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},ko=function(M){pn(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.calculateColMinWidth=function(h){return h.minWidth!=null?h.minWidth:this.gridOptionsWrapper.getMinColWidth()},f.prototype.calculateColMaxWidth=function(h){return h.maxWidth!=null?h.maxWidth:this.gridOptionsWrapper.getMaxColWidth()||Number.MAX_SAFE_INTEGER},f.prototype.calculateColInitialWidth=function(h){var g=this.calculateColMinWidth(h),x=this.calculateColMaxWidth(h),P,z=o(h.width),ee=o(h.initialWidth);return z!=null?P=z:ee!=null?P=ee:P=this.gridOptionsWrapper.getColWidth(),Math.max(Math.min(P,x),g)},f.prototype.getOriginalPathForColumn=function(h,g){var x=[],P=!1,z=function(ee,Me){for(var je=0;je=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Po=function(M){Cn(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.calculateColMinWidth=function(d){return d.minWidth!=null?d.minWidth:this.gridOptionsWrapper.getMinColWidth()},f.prototype.calculateColMaxWidth=function(d){return d.maxWidth!=null?d.maxWidth:this.gridOptionsWrapper.getMaxColWidth()||Number.MAX_SAFE_INTEGER},f.prototype.calculateColInitialWidth=function(d){var g=this.calculateColMinWidth(d),S=this.calculateColMaxWidth(d),O,z=o(d.width),te=o(d.initialWidth);return z!=null?O=z:te!=null?O=te:O=this.gridOptionsWrapper.getColWidth(),Math.max(Math.min(O,S),g)},f.prototype.getOriginalPathForColumn=function(d,g){var S=[],O=!1,z=function(te,Fe){for(var Ue=0;Ue=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Ts=function(M){An(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.createDisplayedGroups=function(h,g,x,P,z){var ee=this,Me=[],je,ut,Rt=this.mapOldGroupsById(z);return h.forEach(function(Zt){for(var vi=ee.getOriginalPathForColumn(g,Zt),Ci=[],qi=!ut,hr=0;hr=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},si=function(M){Dn(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.createDisplayedGroups=function(d,g,S,O,z){var te=this,Fe=[],Ue,ut,Mt=this.mapOldGroupsById(z);return d.forEach(function(ni){for(var Si=te.getOriginalPathForColumn(g,ni),Pi=[],Qi=!ut,_r=0;_r0)&&!(x=g.next()).done;)P.push(x.value)}catch(ee){z={error:ee}}finally{try{x&&!x.done&&(h=g.return)&&h.call(g)}finally{if(z)throw z.error}}return P},Pu=function(){for(var M=[],f=0;f0)&&!(S=g.next()).done;)O.push(S.value)}catch(te){z={error:te}}finally{try{S&&!S.done&&(d=g.return)&&d.call(g)}finally{if(z)throw z.error}}return O},Kt=function(){for(var M=[],f=0;f0)&&!(x=g.next()).done;)P.push(x.value)}catch(ee){z={error:ee}}finally{try{x&&!x.done&&(h=g.return)&&h.call(g)}finally{if(z)throw z.error}}return P},fi=function(){for(var M=[],f=0;f0)&&!(S=g.next()).done;)O.push(S.value)}catch(te){z={error:te}}finally{try{S&&!S.done&&(d=g.return)&&d.call(g)}finally{if(z)throw z.error}}return O},oi=function(){for(var M=[],f=0;f=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Wr=function(M){gi(f,M);function f(){var h=M!==null&&M.apply(this,arguments)||this;return h.componentsMappedByName={},h}return f.prototype.setupComponents=function(h){var g=this;h&&h.forEach(function(x){return g.addComponent(x)})},f.prototype.addComponent=function(h){var g=h.componentName.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),x=g.toUpperCase();this.componentsMappedByName[x]=h.componentClass},f.prototype.getComponentClass=function(h){return this.componentsMappedByName[h]},f=_r([Le("agStackComponentsRegistry")],f),f}($i);/** + */var yi=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),vr=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Gr=function(M){yi(f,M);function f(){var d=M!==null&&M.apply(this,arguments)||this;return d.componentsMappedByName={},d}return f.prototype.setupComponents=function(d){var g=this;d&&d.forEach(function(S){return g.addComponent(S)})},f.prototype.addComponent=function(d){var g=d.componentName.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),S=g.toUpperCase();this.componentsMappedByName[S]=d.componentClass},f.prototype.getComponentClass=function(d){return this.componentsMappedByName[d]},f=vr([Ne("agStackComponentsRegistry")],f),f}(ji);/** * @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/ * @license MIT - */var Gr=function(M,f){var h=typeof Symbol=="function"&&M[Symbol.iterator];if(!h)return M;var g=h.call(M),x,P=[],z;try{for(;(f===void 0||f-- >0)&&!(x=g.next()).done;)P.push(x.value)}catch(ee){z={error:ee}}finally{try{x&&!x.done&&(h=g.return)&&h.call(g)}finally{if(z)throw z.error}}return P},Kr=function(){for(var M=[],f=0;f0)&&!(S=g.next()).done;)O.push(S.value)}catch(te){z={error:te}}finally{try{S&&!S.done&&(d=g.return)&&d.call(g)}finally{if(z)throw z.error}}return O},zr=function(){for(var M=[],f=0;f0)&&!(x=g.next()).done;)P.push(x.value)}catch(ee){z={error:ee}}finally{try{x&&!x.done&&(h=g.return)&&h.call(g)}finally{if(z)throw z.error}}return P},Rs=function(){function M(f,h,g,x){x===void 0&&(x=1),this.r=Math.min(1,Math.max(0,f||0)),this.g=Math.min(1,Math.max(0,h||0)),this.b=Math.min(1,Math.max(0,g||0)),this.a=Math.min(1,Math.max(0,x||0))}return M.fromString=function(f){if(f.indexOf("#")>=0)return M.fromHexString(f);var h=M.nameToHex[f];if(h)return M.fromHexString(h);if(f.indexOf("rgb")>=0)return M.fromRgbaString(f);throw new Error("Invalid color string: '"+f+"'")},M.parseHex=function(f){f=f.replace(/ /g,"").slice(1);var h;switch(f.length){case 6:case 8:h=[];for(var g=0;g=3&&h.every(function(x){return x>=0}))return h.length===3&&h.push(255),h},M.fromHexString=function(f){var h=M.parseHex(f);if(h){var g=Wn(h,4),x=g[0],P=g[1],z=g[2],ee=g[3];return new M(x/255,P/255,z/255,ee/255)}throw new Error("Malformed hexadecimal color string: '"+f+"'")},M.stringToRgba=function(f){for(var h=Wn([NaN,NaN],2),g=h[0],x=h[1],P=0;P=0?(Rt=Math.max(0,Math.min(100,Rt)),Rt/=100):P===3?Rt=Math.max(0,Math.min(1,Rt)):(Rt=Math.max(0,Math.min(255,Rt)),Rt/=255),je.push(Rt)}return je}},M.fromRgbaString=function(f){var h=M.stringToRgba(f);if(h){if(h.length===3)return new M(h[0],h[1],h[2]);if(h.length===4)return new M(h[0],h[1],h[2],h[3])}throw new Error("Malformed rgb/rgba color string: '"+f+"'")},M.fromArray=function(f){if(f.length===4)return new M(f[0],f[1],f[2],f[3]);if(f.length===3)return new M(f[0],f[1],f[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")},M.fromHSB=function(f,h,g,x){x===void 0&&(x=1);var P=M.HSBtoRGB(f,h,g);return new M(P[0],P[1],P[2],x)},M.padHex=function(f){return f.length===1?"0"+f:f},M.prototype.toHexString=function(){var f="#"+M.padHex(Math.round(this.r*255).toString(16))+M.padHex(Math.round(this.g*255).toString(16))+M.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(f+=M.padHex(Math.round(this.a*255).toString(16))),f},M.prototype.toRgbaString=function(f){f===void 0&&(f=3);var h=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],g=Math.pow(10,f);return this.a!==1?(h.push(Math.round(this.a*g)/g),"rgba("+h.join(", ")+")"):"rgb("+h.join(", ")+")"},M.prototype.toString=function(){return this.a===1?this.toHexString():this.toRgbaString()},M.prototype.toHSB=function(){return M.RGBtoHSB(this.r,this.g,this.b)},M.RGBtoHSB=function(f,h,g){var x=Math.min(f,h,g),P=Math.max(f,h,g),z=P!==0?(P-x)/P:0,ee=NaN;if(x!==P){var Me=P-x,je=(P-f)/Me,ut=(P-h)/Me,Rt=(P-g)/Me;f===P?ee=Rt-ut:h===P?ee=2+je-Rt:ee=4+ut-je,ee/=6,ee<0&&(ee=ee+1)}return[ee*360,z,P]},M.HSBtoRGB=function(f,h,g){isNaN(f)&&(f=0),f=(f%360+360)%360/360;var x=0,P=0,z=0;if(h===0)x=P=z=g;else{var ee=(f-Math.floor(f))*6,Me=ee-Math.floor(ee),je=g*(1-h),ut=g*(1-h*Me),Rt=g*(1-h*(1-Me));switch(ee>>0){case 0:x=g,P=Rt,z=je;break;case 1:x=ut,P=g,z=je;break;case 2:x=je,P=g,z=Rt;break;case 3:x=je,P=ut,z=g;break;case 4:x=Rt,P=je,z=g;break;case 5:x=g,P=je,z=ut;break}}return[x,P,z]},M.prototype.derive=function(f,h,g,x){var P=M.RGBtoHSB(this.r,this.g,this.b),z=P[2];z==0&&g>1&&(z=.05);var ee=((P[0]+f)%360+360)%360,Me=Math.max(Math.min(P[1]*h,1),0);z=Math.max(Math.min(z*g,1),0);var je=Math.max(Math.min(this.a*x,1),0),ut=M.HSBtoRGB(ee,Me,z);return ut.push(je),M.fromArray(ut)},M.prototype.brighter=function(){return this.derive(0,1,1/.7,1)},M.prototype.darker=function(){return this.derive(0,1,.7,1)},M.nameToHex=Object.freeze({aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",green:"#008000",greenyellow:"#ADFF2F",grey:"#808080",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"}),M}();/** + */var Fn=function(M,f){var d=typeof Symbol=="function"&&M[Symbol.iterator];if(!d)return M;var g=d.call(M),S,O=[],z;try{for(;(f===void 0||f-- >0)&&!(S=g.next()).done;)O.push(S.value)}catch(te){z={error:te}}finally{try{S&&!S.done&&(d=g.return)&&d.call(g)}finally{if(z)throw z.error}}return O},gs=function(){function M(f,d,g,S){S===void 0&&(S=1),this.r=Math.min(1,Math.max(0,f||0)),this.g=Math.min(1,Math.max(0,d||0)),this.b=Math.min(1,Math.max(0,g||0)),this.a=Math.min(1,Math.max(0,S||0))}return M.fromString=function(f){if(f.indexOf("#")>=0)return M.fromHexString(f);var d=M.nameToHex[f];if(d)return M.fromHexString(d);if(f.indexOf("rgb")>=0)return M.fromRgbaString(f);throw new Error("Invalid color string: '"+f+"'")},M.parseHex=function(f){f=f.replace(/ /g,"").slice(1);var d;switch(f.length){case 6:case 8:d=[];for(var g=0;g=3&&d.every(function(S){return S>=0}))return d.length===3&&d.push(255),d},M.fromHexString=function(f){var d=M.parseHex(f);if(d){var g=Fn(d,4),S=g[0],O=g[1],z=g[2],te=g[3];return new M(S/255,O/255,z/255,te/255)}throw new Error("Malformed hexadecimal color string: '"+f+"'")},M.stringToRgba=function(f){for(var d=Fn([NaN,NaN],2),g=d[0],S=d[1],O=0;O=0?(Mt=Math.max(0,Math.min(100,Mt)),Mt/=100):O===3?Mt=Math.max(0,Math.min(1,Mt)):(Mt=Math.max(0,Math.min(255,Mt)),Mt/=255),Ue.push(Mt)}return Ue}},M.fromRgbaString=function(f){var d=M.stringToRgba(f);if(d){if(d.length===3)return new M(d[0],d[1],d[2]);if(d.length===4)return new M(d[0],d[1],d[2],d[3])}throw new Error("Malformed rgb/rgba color string: '"+f+"'")},M.fromArray=function(f){if(f.length===4)return new M(f[0],f[1],f[2],f[3]);if(f.length===3)return new M(f[0],f[1],f[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")},M.fromHSB=function(f,d,g,S){S===void 0&&(S=1);var O=M.HSBtoRGB(f,d,g);return new M(O[0],O[1],O[2],S)},M.padHex=function(f){return f.length===1?"0"+f:f},M.prototype.toHexString=function(){var f="#"+M.padHex(Math.round(this.r*255).toString(16))+M.padHex(Math.round(this.g*255).toString(16))+M.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(f+=M.padHex(Math.round(this.a*255).toString(16))),f},M.prototype.toRgbaString=function(f){f===void 0&&(f=3);var d=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],g=Math.pow(10,f);return this.a!==1?(d.push(Math.round(this.a*g)/g),"rgba("+d.join(", ")+")"):"rgb("+d.join(", ")+")"},M.prototype.toString=function(){return this.a===1?this.toHexString():this.toRgbaString()},M.prototype.toHSB=function(){return M.RGBtoHSB(this.r,this.g,this.b)},M.RGBtoHSB=function(f,d,g){var S=Math.min(f,d,g),O=Math.max(f,d,g),z=O!==0?(O-S)/O:0,te=NaN;if(S!==O){var Fe=O-S,Ue=(O-f)/Fe,ut=(O-d)/Fe,Mt=(O-g)/Fe;f===O?te=Mt-ut:d===O?te=2+Ue-Mt:te=4+ut-Ue,te/=6,te<0&&(te=te+1)}return[te*360,z,O]},M.HSBtoRGB=function(f,d,g){isNaN(f)&&(f=0),f=(f%360+360)%360/360;var S=0,O=0,z=0;if(d===0)S=O=z=g;else{var te=(f-Math.floor(f))*6,Fe=te-Math.floor(te),Ue=g*(1-d),ut=g*(1-d*Fe),Mt=g*(1-d*(1-Fe));switch(te>>0){case 0:S=g,O=Mt,z=Ue;break;case 1:S=ut,O=g,z=Ue;break;case 2:S=Ue,O=g,z=Mt;break;case 3:S=Ue,O=ut,z=g;break;case 4:S=Mt,O=Ue,z=g;break;case 5:S=g,O=Ue,z=ut;break}}return[S,O,z]},M.prototype.derive=function(f,d,g,S){var O=M.RGBtoHSB(this.r,this.g,this.b),z=O[2];z==0&&g>1&&(z=.05);var te=((O[0]+f)%360+360)%360,Fe=Math.max(Math.min(O[1]*d,1),0);z=Math.max(Math.min(z*g,1),0);var Ue=Math.max(Math.min(this.a*S,1),0),ut=M.HSBtoRGB(te,Fe,z);return ut.push(Ue),M.fromArray(ut)},M.prototype.brighter=function(){return this.derive(0,1,1/.7,1)},M.prototype.darker=function(){return this.derive(0,1,.7,1)},M.nameToHex=Object.freeze({aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",green:"#008000",greenyellow:"#ADFF2F",grey:"#808080",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"}),M}();/** * @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/ * @license MIT - */function Ms(M,f){f===void 0&&(f=",");var h=[],g=function(Zt){return Zt==="\r"||Zt===` -`},x=!1;if(M==="")return[[""]];for(var P=function(Zt,vi,Ci){var qi=M[Ci-1],hr=M[Ci],Rr=M[Ci+1],Ar=function(){h[Zt]||(h[Zt]=[]),h[Zt][vi]||(h[Zt][vi]="")};if(Ar(),hr==='"'){if(x)return Rr==='"'?(h[Zt][vi]+='"',Ci++):x=!1,z=Zt,ee=vi,Me=Ci,"continue";if(qi===void 0||qi===f||g(qi))return x=!0,z=Zt,ee=vi,Me=Ci,"continue"}if(!x){if(hr===f)return vi++,Ar(),z=Zt,ee=vi,Me=Ci,"continue";if(g(hr))return vi=0,Zt++,Ar(),hr==="\r"&&Rr===` -`&&Ci++,z=Zt,ee=vi,Me=Ci,"continue"}h[Zt][vi]+=hr,z=Zt,ee=vi,Me=Ci},z,ee,Me,je=0,ut=0,Rt=0;Rt=M.length&&(M=void 0),{value:M&&M[g++],done:!M}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},Ea,Na,pr,Uo,uh,Nc,Cf,Jp;function ch(){return Na===void 0&&(Na=!!document.documentMode),Na}function Ig(){return pr===void 0&&(pr=!ch()&&!!window.StyleMedia),pr}function qm(){return Ea===void 0&&(Ea=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),Ea}function ec(){if(Uo===void 0){var M=window;Uo=!!M.chrome&&(!!M.chrome.webstore||!!M.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return Uo}function _p(){if(uh===void 0){var M=window;uh=typeof M.InstallTrigger<"u"}return uh}function nd(){return Nc===void 0&&(Nc=(/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream),Nc}function Zp(M){if(!M)return null;var f=M.tabIndex,h=M.getAttribute("tabIndex");return f===-1&&(h===null||h===""&&!_p())?null:f.toString()}function $l(){if(!document.body)return-1;var M=1e6,f=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,h=document.createElement("div");for(document.body.appendChild(h);;){var g=M*2;if(h.style.height=g+"px",g>f||h.clientHeight!==g)break;M=g}return document.body.removeChild(h),M}function hh(){return Jp==null&&sd(),Jp}function sd(){var M=document.body,f=document.createElement("div");f.style.width=f.style.height="100px",f.style.opacity="0",f.style.overflow="scroll",f.style.msOverflowStyle="scrollbar",f.style.position="absolute",M.appendChild(f);var h=f.offsetWidth-f.clientWidth;h===0&&f.clientWidth===0&&(h=null),f.parentNode&&f.parentNode.removeChild(f),h!=null&&(Jp=h,Cf=h===0)}function cu(){return Cf==null&&sd(),Cf}function Qp(){var M,f,h=["webkit","moz","o","ms"],g=document.createElement("div"),x=document.getElementsByTagName("body")[0],P=!1,z;x.appendChild(g),g.setAttribute("style",h.map(function(ut){return"-"+ut+"-overflow-scrolling: touch"}).concat("overflow-scrolling: touch").join(";"));var ee=window.getComputedStyle(g);if(ee.overflowScrolling==="touch"&&(P=!0),!P)try{for(var Me=Pc(h),je=Me.next();!je.done;je=Me.next())if(z=je.value,ee[z+"OverflowScrolling"]==="touch"){P=!0;break}}catch(ut){M={error:ut}}finally{try{je&&!je.done&&(f=Me.return)&&f.call(Me)}finally{if(M)throw M.error}}return g.parentNode&&g.parentNode.removeChild(g),P}function Ph(){return document.body?document.body.clientWidth:window.innerHeight?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:-1}function Ag(){return document.body?document.body.clientHeight:window.innerHeight?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:-1}var Pg=Object.freeze({isBrowserEdge:Ig,isBrowserSafari:qm,isBrowserChrome:ec,isBrowserFirefox:_p,isIOSUserAgent:nd,getTabIndex:Zp,getMaxDivHeight:$l,getScrollbarWidth:hh,isInvisibleScrollbar:cu,hasOverflowScrolling:Qp,getBodyWidth:Ph,getBodyHeight:Ag});/** + */var dr=function(M){var f=typeof Symbol=="function"&&Symbol.iterator,d=f&&M[f],g=0;if(d)return d.call(M);if(M&&typeof M.length=="number")return{next:function(){return M&&g>=M.length&&(M=void 0),{value:M&&M[g++],done:!M}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},wr,on,ar,Es,Ha,La,zs,Eu;function Iu(){return on===void 0&&(on=!!document.documentMode),on}function Vc(){return ar===void 0&&(ar=!Iu()&&!!window.StyleMedia),ar}function jc(){return wr===void 0&&(wr=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),wr}function Vl(){if(Es===void 0){var M=window;Es=!!M.chrome&&(!!M.chrome.webstore||!!M.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return Es}function fh(){if(Ha===void 0){var M=window;Ha=typeof M.InstallTrigger<"u"}return Ha}function ud(){return La===void 0&&(La=(/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream),La}function rf(M){if(!M)return null;var f=M.tabIndex,d=M.getAttribute("tabIndex");return f===-1&&(d===null||d===""&&!fh())?null:f.toString()}function Yl(){if(!document.body)return-1;var M=1e6,f=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,d=document.createElement("div");for(document.body.appendChild(d);;){var g=M*2;if(d.style.height=g+"px",g>f||d.clientHeight!==g)break;M=g}return document.body.removeChild(d),M}function mh(){return Eu==null&&cd(),Eu}function cd(){var M=document.body,f=document.createElement("div");f.style.width=f.style.height="100px",f.style.opacity="0",f.style.overflow="scroll",f.style.msOverflowStyle="scrollbar",f.style.position="absolute",M.appendChild(f);var d=f.offsetWidth-f.clientWidth;d===0&&f.clientWidth===0&&(d=null),f.parentNode&&f.parentNode.removeChild(f),d!=null&&(Eu=d,zs=d===0)}function vu(){return zs==null&&cd(),zs}function nf(){var M,f,d=["webkit","moz","o","ms"],g=document.createElement("div"),S=document.getElementsByTagName("body")[0],O=!1,z;S.appendChild(g),g.setAttribute("style",d.map(function(ut){return"-"+ut+"-overflow-scrolling: touch"}).concat("overflow-scrolling: touch").join(";"));var te=window.getComputedStyle(g);if(te.overflowScrolling==="touch"&&(O=!0),!O)try{for(var Fe=dr(d),Ue=Fe.next();!Ue.done;Ue=Fe.next())if(z=Ue.value,te[z+"OverflowScrolling"]==="touch"){O=!0;break}}catch(ut){M={error:ut}}finally{try{Ue&&!Ue.done&&(f=Fe.return)&&f.call(Fe)}finally{if(M)throw M.error}}return g.parentNode&&g.parentNode.removeChild(g),O}function Mh(){return document.body?document.body.clientWidth:window.innerHeight?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:-1}function Mg(){return document.body?document.body.clientHeight:window.innerHeight?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:-1}var Dg=Object.freeze({isBrowserEdge:Vc,isBrowserSafari:jc,isBrowserChrome:Vl,isBrowserFirefox:fh,isIOSUserAgent:ud,getTabIndex:rf,getMaxDivHeight:Yl,getScrollbarWidth:mh,isInvisibleScrollbar:vu,hasOverflowScrolling:nf,getBodyWidth:Mh,getBodyHeight:Mg});/** * @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/ * @license MIT - */var Yd;function fa(M,f,h){for(var g=M.parentElement,x=g&&g.firstChild;x;)f&&x.classList.toggle(f,x===M),h&&x.classList.toggle(h,x!==M),x=x.nextSibling}function cm(M){var f=Element.prototype.matches||Element.prototype.msMatchesSelector,h=f.call(M,Ue.INPUT_SELECTOR),g=f.call(M,Ue.FOCUSABLE_EXCLUDE),x=ih(M),P=h&&!g&&x;return P}function dl(M,f){M.classList.toggle("ag-hidden",!f)}function ef(M,f){M.classList.toggle("ag-invisible",!f)}function dh(M,f){var h="disabled",g=f?function(x){return x.setAttribute(h,"")}:function(x){return x.removeAttribute(h)};g(M),Te(M.querySelectorAll("input"),function(x){return g(x)})}function ui(M,f,h){for(var g=0;M;){if(M.classList.contains(f))return!0;if(M=M.parentElement,h&&++g>h)break}return!1}function pl(M){var f=window.getComputedStyle(M),h=f.height,g=f.width,x=f.paddingTop,P=f.paddingRight,z=f.paddingBottom,ee=f.paddingLeft,Me=f.marginTop,je=f.marginRight,ut=f.marginBottom,Rt=f.marginLeft,Zt=f.boxSizing;return{height:parseFloat(h),width:parseFloat(g),paddingTop:parseFloat(x),paddingRight:parseFloat(P),paddingBottom:parseFloat(z),paddingLeft:parseFloat(ee),marginTop:parseFloat(Me),marginRight:parseFloat(je),marginBottom:parseFloat(ut),marginLeft:parseFloat(Rt),boxSizing:Zt}}function tf(M){var f=pl(M);return f.boxSizing==="border-box"?f.height-f.paddingTop-f.paddingBottom:f.height}function Og(M){var f=pl(M);return f.boxSizing==="border-box"?f.width-f.paddingLeft-f.paddingRight:f.width}function ta(M){var f=pl(M),h=f.marginBottom+f.marginTop;return Math.ceil(M.offsetHeight+h)}function bp(M){var f=pl(M),h=f.marginLeft+f.marginRight;return Math.ceil(M.offsetWidth+h)}function Us(){if(typeof Yd=="boolean")return Yd;var M=document.createElement("div");return M.style.direction="rtl",M.style.width="1px",M.style.height="1px",M.style.position="fixed",M.style.top="0px",M.style.overflow="hidden",M.dir="rtl",M.innerHTML=`
+ */var ep;function Ea(M,f,d){for(var g=M.parentElement,S=g&&g.firstChild;S;)f&&S.classList.toggle(f,S===M),d&&S.classList.toggle(d,S!==M),S=S.nextSibling}function ym(M){var f=Element.prototype.matches||Element.prototype.msMatchesSelector,d=f.call(M,$e.INPUT_SELECTOR),g=f.call(M,$e.FOCUSABLE_EXCLUDE),S=ah(M),O=d&&!g&&S;return O}function wl(M,f){M.classList.toggle("ag-hidden",!f)}function sf(M,f){M.classList.toggle("ag-invisible",!f)}function gh(M,f){var d="disabled",g=f?function(S){return S.setAttribute(d,"")}:function(S){return S.removeAttribute(d)};g(M),Ee(M.querySelectorAll("input"),function(S){return g(S)})}function pi(M,f,d){for(var g=0;M;){if(M.classList.contains(f))return!0;if(M=M.parentElement,d&&++g>d)break}return!1}function xl(M){var f=window.getComputedStyle(M),d=f.height,g=f.width,S=f.paddingTop,O=f.paddingRight,z=f.paddingBottom,te=f.paddingLeft,Fe=f.marginTop,Ue=f.marginRight,ut=f.marginBottom,Mt=f.marginLeft,ni=f.boxSizing;return{height:parseFloat(d),width:parseFloat(g),paddingTop:parseFloat(S),paddingRight:parseFloat(O),paddingBottom:parseFloat(z),paddingLeft:parseFloat(te),marginTop:parseFloat(Fe),marginRight:parseFloat(Ue),marginBottom:parseFloat(ut),marginLeft:parseFloat(Mt),boxSizing:ni}}function of(M){var f=xl(M);return f.boxSizing==="border-box"?f.height-f.paddingTop-f.paddingBottom:f.height}function Fg(M){var f=xl(M);return f.boxSizing==="border-box"?f.width-f.paddingLeft-f.paddingRight:f.width}function ua(M){var f=xl(M),d=f.marginBottom+f.marginTop;return Math.ceil(M.offsetHeight+d)}function Ep(M){var f=xl(M),d=f.marginLeft+f.marginRight;return Math.ceil(M.offsetWidth+d)}function to(){if(typeof ep=="boolean")return ep;var M=document.createElement("div");return M.style.direction="rtl",M.style.width="1px",M.style.height="1px",M.style.position="fixed",M.style.top="0px",M.style.overflow="hidden",M.dir="rtl",M.innerHTML=`
-
`,document.body.appendChild(M),M.scrollLeft=1,Yd=Math.floor(M.scrollLeft)===0,document.body.removeChild(M),Yd}function Xs(M,f){var h=M.scrollLeft;return f&&(h=Math.abs(h),ec()&&!Us()&&(h=M.scrollWidth-M.clientWidth-h)),h}function Ql(M,f,h){h&&(Us()?f*=-1:(qm()||ec())&&(f=M.scrollWidth-M.clientWidth-f)),M.scrollLeft=f}function Ou(M){for(;M&&M.firstChild;)M.removeChild(M.firstChild)}function Ym(M,f){th(M.querySelector(f))}function th(M){M&&M.parentNode&&M.parentNode.removeChild(M)}function ih(M){return M.offsetParent!==null}function yu(M){if(DOMParser!==null){var f=new DOMParser,h=f.parseFromString(M,"text/html");return h.body.firstChild}var g=document.createElement("div");return g.innerHTML=(M||"").trim(),g.firstChild}function eu(M,f){M.lastChild?M.insertAdjacentHTML("afterbegin",f):M.innerHTML=f}function Wa(M,f){if(M.attributes&&M.attributes[f]){var h=M.attributes[f];return h.value}return null}function Oh(M){return M&&M.clientHeight?M.clientHeight:0}function tc(M){return M&&M.clientWidth?M.clientWidth:0}function Bl(M,f,h){h&&h.nextSibling===f||(h?h.nextSibling?M.insertBefore(f,h.nextSibling):M.appendChild(f):M.firstChild&&M.firstChild!==f&&M.insertAdjacentElement("afterbegin",f))}function Oc(M,f){for(var h=0;h`,document.body.appendChild(M),M.scrollLeft=1,ep=Math.floor(M.scrollLeft)===0,document.body.removeChild(M),ep}function lo(M,f){var d=M.scrollLeft;return f&&(d=Math.abs(d),Vl()&&!to()&&(d=M.scrollWidth-M.clientWidth-d)),d}function uu(M,f,d){d&&(to()?f*=-1:(jc()||Vl())&&(f=M.scrollWidth-M.clientWidth-f)),M.scrollLeft=f}function ju(M){for(;M&&M.firstChild;)M.removeChild(M.firstChild)}function Jm(M,f){oh(M.querySelector(f))}function oh(M){M&&M.parentNode&&M.parentNode.removeChild(M)}function ah(M){return M.offsetParent!==null}function Au(M){if(DOMParser!==null){var f=new DOMParser,d=f.parseFromString(M,"text/html");return d.body.firstChild}var g=document.createElement("div");return g.innerHTML=(M||"").trim(),g.firstChild}function cu(M,f){M.lastChild?M.insertAdjacentHTML("afterbegin",f):M.innerHTML=f}function el(M,f){if(M.attributes&&M.attributes[f]){var d=M.attributes[f];return d.value}return null}function Dh(M){return M&&M.clientHeight?M.clientHeight:0}function uc(M){return M&&M.clientWidth?M.clientWidth:0}function Xl(M,f,d){d&&d.nextSibling===f||(d?d.nextSibling?M.insertBefore(f,d.nextSibling):M.appendChild(f):M.firstChild&&M.firstChild!==f&&M.insertAdjacentElement("afterbegin",f))}function Dc(M,f){for(var d=0;d1?g[1]:""}function ot(M){var f=M.length,h=0;if(f<=1)return M;for(var g=0;g1){h=Math.max(h,parseInt(P[1],10));continue}Math.floor(x)!==x&&(h=Math.max(h,x.toString().split(".")[1].length))}for(var z=0,ee=0,Me=0,je=0,ut=0,Rt=0;Rt1?g[1]:""}function at(M){var f=M.length,d=0;if(f<=1)return M;for(var g=0;g1){d=Math.max(d,parseInt(O[1],10));continue}Math.floor(S)!==S&&(d=Math.max(d,S.toString().split(".")[1].length))}for(var z=0,te=0,Fe=0,Ue=0,ut=0,Mt=0;Mt>>=8;return h}function Oy(M,f,h){return typeof M!="number"?"":It(Math.round(M*100)/100,f,h)}function It(M,f,h){return typeof M!="number"?"":M.toString().replace(".",h).replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f)}function Bi(M){return M==null?null:M.reduce(function(f,h){return f+h},0)}var Pr=Object.freeze({padStartWidthZeros:uo,createArrayOfNumbers:Fh,isNumeric:vu,cleanNumber:Lh,decToHex:Kd,formatNumberTwoDecimalPlacesAndCommas:Oy,formatNumberCommas:It,sum:Bi});/** + */function xo(M,f){return M.toString().padStart(f,"0")}function kh(M,f){for(var d=[],g=M;g<=f;g++)d.push(g);return d}function Pu(M){return M!==""&&!isNaN(parseFloat(M))&&isFinite(M)}function $h(M){return typeof M=="string"&&(M=parseInt(M,10)),typeof M=="number"?Math.floor(M):null}function ip(M,f){for(var d="",g=0;g>>=8;return d}function Ry(M,f,d){return typeof M!="number"?"":At(Math.round(M*100)/100,f,d)}function At(M,f,d){return typeof M!="number"?"":M.toString().replace(".",d).replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f)}function zi(M){return M==null?null:M.reduce(function(f,d){return f+d},0)}var Vr=Object.freeze({padStartWidthZeros:xo,createArrayOfNumbers:kh,isNumeric:Pu,cleanNumber:$h,decToHex:ip,formatNumberTwoDecimalPlacesAndCommas:Ry,formatNumberCommas:At,sum:zi});/** * @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/ * @license MIT - */var Vn=function(M,f){var h=typeof Symbol=="function"&&M[Symbol.iterator];if(!h)return M;var g=h.call(M),x,P=[],z;try{for(;(f===void 0||f-- >0)&&!(x=g.next()).done;)P.push(x.value)}catch(ee){z={error:ee}}finally{try{x&&!x.done&&(h=g.return)&&h.call(g)}finally{if(z)throw z.error}}return P};function ms(M,f,h){if(f===void 0&&(f=!0),h===void 0&&(h="-"),!M)return null;var g=[M.getFullYear(),M.getMonth()+1,M.getDate()].map(function(x){return uo(x,2)}).join(h);return f&&(g+=" "+[M.getHours(),M.getMinutes(),M.getSeconds()].map(function(x){return uo(x,2)}).join(":")),g}function gs(M){if(!M)return null;var f=Vn(M.split(" "),2),h=f[0],g=f[1];if(!h)return null;var x=h.split("-").map(function(Ci){return parseInt(Ci,10)});if(x.filter(function(Ci){return!isNaN(Ci)}).length!==3)return null;var P=Vn(x,3),z=P[0],ee=P[1],Me=P[2],je=new Date(z,ee-1,Me);if(je.getFullYear()!==z||je.getMonth()!==ee-1||je.getDate()!==Me)return null;if(!g||g==="00:00:00")return je;var ut=Vn(g.split(":").map(function(Ci){return parseInt(Ci,10)}),3),Rt=ut[0],Zt=ut[1],vi=ut[2];return Rt>=0&&Rt<24&&je.setHours(Rt),Zt>=0&&Zt<60&&je.setMinutes(Zt),vi>=0&&vi<60&&je.setSeconds(vi),je}var ma=Object.freeze({serialiseDate:ms,parseDateTimeFromString:gs});/** + */var ts=function(M,f){var d=typeof Symbol=="function"&&M[Symbol.iterator];if(!d)return M;var g=d.call(M),S,O=[],z;try{for(;(f===void 0||f-- >0)&&!(S=g.next()).done;)O.push(S.value)}catch(te){z={error:te}}finally{try{S&&!S.done&&(d=g.return)&&d.call(g)}finally{if(z)throw z.error}}return O};function Os(M,f,d){if(f===void 0&&(f=!0),d===void 0&&(d="-"),!M)return null;var g=[M.getFullYear(),M.getMonth()+1,M.getDate()].map(function(S){return xo(S,2)}).join(d);return f&&(g+=" "+[M.getHours(),M.getMinutes(),M.getSeconds()].map(function(S){return xo(S,2)}).join(":")),g}function Rs(M){if(!M)return null;var f=ts(M.split(" "),2),d=f[0],g=f[1];if(!d)return null;var S=d.split("-").map(function(Pi){return parseInt(Pi,10)});if(S.filter(function(Pi){return!isNaN(Pi)}).length!==3)return null;var O=ts(S,3),z=O[0],te=O[1],Fe=O[2],Ue=new Date(z,te-1,Fe);if(Ue.getFullYear()!==z||Ue.getMonth()!==te-1||Ue.getDate()!==Fe)return null;if(!g||g==="00:00:00")return Ue;var ut=ts(g.split(":").map(function(Pi){return parseInt(Pi,10)}),3),Mt=ut[0],ni=ut[1],Si=ut[2];return Mt>=0&&Mt<24&&Ue.setHours(Mt),ni>=0&&ni<60&&Ue.setMinutes(ni),Si>=0&&Si<60&&Ue.setSeconds(Si),Ue}var Ia=Object.freeze({serialiseDate:Os,parseDateTimeFromString:Rs});/** * @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/ * @license MIT - */function il(M,f,h){var g={},x=M.filter(function(P){return!f.some(function(z){return z===P})});return x.length>0&&x.forEach(function(P){return g[P]=Mg(P,h)}),g}function Mg(M,f,h,g){var x=g?hm:If,P=f.map(function(z){return{value:z,relevance:x(M.toLowerCase(),z.toLocaleLowerCase())}});return P.sort(function(z,ee){return ee.relevance-z.relevance}),h&&(P=P.filter(function(z){return z.relevance!==0})),P.map(function(z){return z.value})}function F0(M){var f=M.toLowerCase(),h=new Array(f.length-1),g,x,P;for(g=x=0,P=h.length;x<=P;g=x+=1)h[g]=f.slice(g,g+2);return h}function If(M,f){if(M.length===0&&f.length===0)return 0;var h=F0(M),g=F0(f),x=h.length+g.length,P=0,z,ee;for(z=0,ee=h.length;z0?2*P/x:0}function hm(M,f){for(var h=M.replace(/\s/g,""),g=f.replace(/\s/g,""),x=0,P=0,z=0;z0&&S.forEach(function(O){return g[O]=Ng(O,d)}),g}function Ng(M,f,d,g){var S=g?vm:Of,O=f.map(function(z){return{value:z,relevance:S(M.toLowerCase(),z.toLocaleLowerCase())}});return O.sort(function(z,te){return te.relevance-z.relevance}),d&&(O=O.filter(function(z){return z.relevance!==0})),O.map(function(z){return z.value})}function k0(M){var f=M.toLowerCase(),d=new Array(f.length-1),g,S,O;for(g=S=0,O=d.length;S<=O;g=S+=1)d[g]=f.slice(g,g+2);return d}function Of(M,f){if(M.length===0&&f.length===0)return 0;var d=k0(M),g=k0(f),S=d.length+g.length,O=0,z,te;for(z=0,te=d.length;z0?2*O/S:0}function vm(M,f){for(var d=M.replace(/\s/g,""),g=f.replace(/\s/g,""),S=0,O=0,z=0;z-1)return g;var x=document.createElement("span");return x.appendChild(g),x}function tu(M,f,h,g){var x=null,P=h&&h.getColDef().icons;if(P&&(x=P[M]),f&&!x){var z=f.getIcons();z&&(x=z[M])}if(x){var ee=void 0;if(typeof x=="function")ee=x();else if(typeof x=="string")ee=x;else throw new Error("icon from grid options needs to be a string or a function");if(typeof ee=="string")return yu(ee);if(bt(ee))return ee;console.warn("AG Grid: iconRenderer should return back a string or a dom object")}else{var Me=document.createElement("span"),je=h3[M];return je||(g?je=M:(console.warn("AG Grid: Did not find icon "+M),je="")),Me.setAttribute("class","ag-icon ag-icon-"+je),Me.setAttribute("unselectable","on"),tr(Me,"presentation"),Me}}var L0=Object.freeze({iconNameClassMap:h3,createIcon:nt,createIconNoSpan:tu});/** + */var h3={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",chart:"chart",close:"cross",cancel:"cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",csvExport:"csv",excelExport:"excel",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none"};function rt(M,f,d){var g=hu(M,f,d);if(g&&g.className.indexOf("ag-icon")>-1)return g;var S=document.createElement("span");return S.appendChild(g),S}function hu(M,f,d,g){var S=null,O=d&&d.getColDef().icons;if(O&&(S=O[M]),f&&!S){var z=f.getIcons();z&&(S=z[M])}if(S){var te=void 0;if(typeof S=="function")te=S();else if(typeof S=="string")te=S;else throw new Error("icon from grid options needs to be a string or a function");if(typeof te=="string")return Au(te);if(bt(te))return te;console.warn("AG Grid: iconRenderer should return back a string or a dom object")}else{var Fe=document.createElement("span"),Ue=h3[M];return Ue||(g?Ue=M:(console.warn("AG Grid: Did not find icon "+M),Ue="")),Fe.setAttribute("class","ag-icon ag-icon-"+Ue),Fe.setAttribute("unselectable","on"),lr(Fe,"presentation"),Fe}}var $0=Object.freeze({iconNameClassMap:h3,createIcon:rt,createIconNoSpan:hu});/** * @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/ * @license MIT - */var Mb="Del",cr=46;function ds(M){if(M.altKey||M.ctrlKey||M.metaKey)return!1;var f=M.key.length===1,h=Q7(M);return f||h}function Ry(M,f,h,g,x){var P=M.getSuppressKeyboardEventFunc(),z=g?g.getColDef().suppressKeyboardEvent:void 0;if(!P&&!z)return!1;var ee={event:f,editing:x,column:g,api:M.getApi(),node:h,data:h.data,colDef:g.getColDef(),context:M.getContext(),columnApi:M.getColumnApi()};if(z){var Me=z(ee);if(Me)return!0}return P?P(ee):!1}function k$(M,f,h,g){var x=g.getDefinition(),P=x&&x.suppressHeaderKeyboardEvent;if(!i(P))return!1;var z={api:M.getApi(),columnApi:M.getColumnApi(),context:M.getContext(),colDef:x,column:g,headerRowIndex:h,event:f};return!!P(z)}function Q7(M){return Ig()&&M.key===Mb&&M.charCode===cr}var g4=Object.freeze({isEventFromPrintableCharacter:ds,isUserSuppressingKeyboardEvent:Ry,isUserSuppressingHeaderKeyboardEvent:k$});/** + */var Lb="Del",yr=46;function As(M){if(M.altKey||M.ctrlKey||M.metaKey)return!1;var f=M.key.length===1,d=Q7(M);return f||d}function My(M,f,d,g,S){var O=M.getSuppressKeyboardEventFunc(),z=g?g.getColDef().suppressKeyboardEvent:void 0;if(!O&&!z)return!1;var te={event:f,editing:S,column:g,api:M.getApi(),node:d,data:d.data,colDef:g.getColDef(),context:M.getContext(),columnApi:M.getColumnApi()};if(z){var Fe=z(te);if(Fe)return!0}return O?O(te):!1}function F$(M,f,d,g){var S=g.getDefinition(),O=S&&S.suppressHeaderKeyboardEvent;if(!i(O))return!1;var z={api:M.getApi(),columnApi:M.getColumnApi(),context:M.getContext(),colDef:S,column:g,headerRowIndex:d,event:f};return!!O(z)}function Q7(M){return Vc()&&M.key===Lb&&M.charCode===yr}var _4=Object.freeze({isEventFromPrintableCharacter:As,isUserSuppressingKeyboardEvent:My,isUserSuppressingHeaderKeyboardEvent:F$});/** * @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/ * @license MIT - */function bn(M,f,h){if(h===0)return!1;var g=Math.abs(M.clientX-f.clientX),x=Math.abs(M.clientY-f.clientY);return Math.max(g,x)<=h}var ez=Object.freeze({areEventsNear:bn});/** + */function Rn(M,f,d){if(d===0)return!1;var g=Math.abs(M.clientX-f.clientX),S=Math.abs(M.clientY-f.clientY);return Math.max(g,S)<=d}var ez=Object.freeze({areEventsNear:Rn});/** * @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/ * @license MIT - */function d3(M,f){if(M){for(var h=function(ee,Me){var je=f[ee.id],ut=f[Me.id],Rt=je!==void 0,Zt=ut!==void 0,vi=Rt&&Zt,Ci=!Rt&&!Zt;return vi?je-ut:Ci?ee.__objectId-Me.__objectId:Rt?1:-1},g,x,P=!1,z=0;z0){P=!0;break}P&&M.sort(h)}}function ZS(M,f){var h=[];g(M);function g(x){x&&x.forEach(function(P){if(P.group||P.hasChildren()){h.push(P.key);var z=h.join("|");f(P,z),g(P.childrenAfterGroup),h.pop()}})}}var ph=Object.freeze({sortRowNodesByOrder:d3,traverseNodesWithKey:ZS});/** + */function d3(M,f){if(M){for(var d=function(te,Fe){var Ue=f[te.id],ut=f[Fe.id],Mt=Ue!==void 0,ni=ut!==void 0,Si=Mt&&ni,Pi=!Mt&&!ni;return Si?Ue-ut:Pi?te.__objectId-Fe.__objectId:Mt?1:-1},g,S,O=!1,z=0;z0){O=!0;break}O&&M.sort(d)}}function JS(M,f){var d=[];g(M);function g(S){S&&S.forEach(function(O){if(O.group||O.hasChildren()){d.push(O.key);var z=d.join("|");f(O,z),g(O.childrenAfterGroup),d.pop()}})}}var yh=Object.freeze({sortRowNodesByOrder:d3,traverseNodesWithKey:JS});/** * @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/ * @license MIT - */function fI(M){var f=new Set;return M.forEach(function(h){return f.add(h)}),f}var p3=Object.freeze({convertToSet:fI});/** + */function pI(M){var f=new Set;return M.forEach(function(d){return f.add(d)}),f}var p3=Object.freeze({convertToSet:pI});/** * @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/ * @license MIT - */var kh=function(){return kh=Object.assign||function(M){for(var f,h=1,g=arguments.length;h=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},k0;(function(M){M[M.NOTHING=0]="NOTHING",M[M.WAITING_TO_SHOW=1]="WAITING_TO_SHOW",M[M.SHOWING=2]="SHOWING"})(k0||(k0={}));var My=function(M){$$(f,M);function f(h){var g=M.call(this)||this;return g.DEFAULT_SHOW_TOOLTIP_DELAY=2e3,g.DEFAULT_HIDE_TOOLTIP_DELAY=1e4,g.SHOW_QUICK_TOOLTIP_DIFF=1e3,g.FADE_OUT_TOOLTIP_TIMEOUT=1e3,g.state=k0.NOTHING,g.tooltipInstanceCount=0,g.tooltipMouseTrack=!1,g.parentComp=h,g}return f.prototype.postConstruct=function(){this.tooltipShowDelay=this.gridOptionsWrapper.getTooltipDelay("show")||this.DEFAULT_SHOW_TOOLTIP_DELAY,this.tooltipHideDelay=this.gridOptionsWrapper.getTooltipDelay("hide")||this.DEFAULT_HIDE_TOOLTIP_DELAY,this.tooltipMouseTrack=this.gridOptionsWrapper.isTooltipMouseTrack();var h=this.parentComp.getGui();this.addManagedListener(h,"mouseenter",this.onMouseEnter.bind(this)),this.addManagedListener(h,"mouseleave",this.onMouseLeave.bind(this)),this.addManagedListener(h,"mousemove",this.onMouseMove.bind(this)),this.addManagedListener(h,"mousedown",this.onMouseDown.bind(this)),this.addManagedListener(h,"keydown",this.onKeyDown.bind(this))},f.prototype.destroy=function(){this.setToDoNothing(),M.prototype.destroy.call(this)},f.prototype.onMouseEnter=function(h){if(!nd()&&this.state==k0.NOTHING){var g=this.isLastTooltipHiddenRecently()?200:this.tooltipShowDelay;this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),g),this.lastMouseEvent=h,this.state=k0.WAITING_TO_SHOW}},f.prototype.onMouseLeave=function(){this.setToDoNothing()},f.prototype.onKeyDown=function(){this.setToDoNothing()},f.prototype.setToDoNothing=function(){this.state===k0.SHOWING&&this.hideTooltip(),this.clearTimeouts(),this.state=k0.NOTHING},f.prototype.onMouseMove=function(h){this.lastMouseEvent=h,this.tooltipMouseTrack&&this.state===k0.SHOWING&&this.tooltipComp&&this.positionTooltipUnderLastMouseEvent()},f.prototype.onMouseDown=function(){this.setToDoNothing()},f.prototype.hideTooltip=function(){this.tooltipComp&&(this.destroyTooltipComp(),f.lastTooltipHideTime=new Date().getTime()),this.state=k0.NOTHING},f.prototype.destroyTooltipComp=function(){var h=this;this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");var g=this.tooltipPopupDestroyFunc,x=this.tooltipComp;window.setTimeout(function(){g(),h.getContext().destroyBean(x)},this.FADE_OUT_TOOLTIP_TIMEOUT),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0},f.prototype.isLastTooltipHiddenRecently=function(){var h=new Date().getTime(),g=f.lastTooltipHideTime;return h-g=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},B0;(function(M){M[M.NOTHING=0]="NOTHING",M[M.WAITING_TO_SHOW=1]="WAITING_TO_SHOW",M[M.SHOWING=2]="SHOWING"})(B0||(B0={}));var Dy=function(M){N$(f,M);function f(d){var g=M.call(this)||this;return g.DEFAULT_SHOW_TOOLTIP_DELAY=2e3,g.DEFAULT_HIDE_TOOLTIP_DELAY=1e4,g.SHOW_QUICK_TOOLTIP_DIFF=1e3,g.FADE_OUT_TOOLTIP_TIMEOUT=1e3,g.state=B0.NOTHING,g.tooltipInstanceCount=0,g.tooltipMouseTrack=!1,g.parentComp=d,g}return f.prototype.postConstruct=function(){this.tooltipShowDelay=this.gridOptionsWrapper.getTooltipDelay("show")||this.DEFAULT_SHOW_TOOLTIP_DELAY,this.tooltipHideDelay=this.gridOptionsWrapper.getTooltipDelay("hide")||this.DEFAULT_HIDE_TOOLTIP_DELAY,this.tooltipMouseTrack=this.gridOptionsWrapper.isTooltipMouseTrack();var d=this.parentComp.getGui();this.addManagedListener(d,"mouseenter",this.onMouseEnter.bind(this)),this.addManagedListener(d,"mouseleave",this.onMouseLeave.bind(this)),this.addManagedListener(d,"mousemove",this.onMouseMove.bind(this)),this.addManagedListener(d,"mousedown",this.onMouseDown.bind(this)),this.addManagedListener(d,"keydown",this.onKeyDown.bind(this))},f.prototype.destroy=function(){this.setToDoNothing(),M.prototype.destroy.call(this)},f.prototype.onMouseEnter=function(d){if(!ud()&&this.state==B0.NOTHING){var g=this.isLastTooltipHiddenRecently()?200:this.tooltipShowDelay;this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),g),this.lastMouseEvent=d,this.state=B0.WAITING_TO_SHOW}},f.prototype.onMouseLeave=function(){this.setToDoNothing()},f.prototype.onKeyDown=function(){this.setToDoNothing()},f.prototype.setToDoNothing=function(){this.state===B0.SHOWING&&this.hideTooltip(),this.clearTimeouts(),this.state=B0.NOTHING},f.prototype.onMouseMove=function(d){this.lastMouseEvent=d,this.tooltipMouseTrack&&this.state===B0.SHOWING&&this.tooltipComp&&this.positionTooltipUnderLastMouseEvent()},f.prototype.onMouseDown=function(){this.setToDoNothing()},f.prototype.hideTooltip=function(){this.tooltipComp&&(this.destroyTooltipComp(),f.lastTooltipHideTime=new Date().getTime()),this.state=B0.NOTHING},f.prototype.destroyTooltipComp=function(){var d=this;this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");var g=this.tooltipPopupDestroyFunc,S=this.tooltipComp;window.setTimeout(function(){g(),d.getContext().destroyBean(S)},this.FADE_OUT_TOOLTIP_TIMEOUT),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0},f.prototype.isLastTooltipHiddenRecently=function(){var d=new Date().getTime(),g=f.lastTooltipHideTime;return d-g=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},_4=new f1,kv=function(){function M(f){this.cssClassStates={},this.getGui=f}return M.prototype.addCssClass=function(f){var h=this,g=(f||"").split(" ");if(g.length>1){g.forEach(function(P){return h.addCssClass(P)});return}var x=this.cssClassStates[f]!==!0;x&&f.length&&(this.getGui().classList.add(f),this.cssClassStates[f]=!0)},M.prototype.removeCssClass=function(f){var h=this,g=(f||"").split(" ");if(g.length>1){g.forEach(function(P){return h.removeCssClass(P)});return}var x=this.cssClassStates[f]!==!1;x&&f.length&&(this.getGui().classList.remove(f),this.cssClassStates[f]=!1)},M.prototype.containsCssClass=function(f){return this.getGui().classList.contains(f)},M.prototype.addOrRemoveCssClass=function(f,h){var g=this,x=(f||"").split(" ");if(x.length>1){x.forEach(function(z){return g.addOrRemoveCssClass(z,h)});return}var P=this.cssClassStates[f]!==h;P&&f.length&&(this.getGui().classList.toggle(f,h),this.cssClassStates[f]=h)},M}(),Sa=function(M){v4(f,M);function f(h){var g=M.call(this)||this;return g.displayed=!0,g.visible=!0,g.compId=_4.next(),g.cssClassManager=new kv(function(){return g.eGui}),h&&g.setTemplate(h),g}return f.prototype.preConstructOnComponent=function(){this.usingBrowserTooltips=this.gridOptionsWrapper.isEnableBrowserTooltips()},f.prototype.getCompId=function(){return this.compId},f.prototype.getTooltipParams=function(){return{value:this.tooltipText,location:"UNKNOWN"}},f.prototype.setTooltip=function(h){var g=this,x=function(){g.usingBrowserTooltips?g.getGui().removeAttribute("title"):g.tooltipFeature=g.destroyBean(g.tooltipFeature)},P=function(){g.usingBrowserTooltips?g.getGui().setAttribute("title",g.tooltipText):g.tooltipFeature=g.createBean(new My(g))};this.tooltipText!=h&&(this.tooltipText&&x(),h!=null&&(this.tooltipText=h,this.tooltipText&&P()))},f.prototype.createChildComponentsFromTags=function(h,g){var x=this,P=ne(h.childNodes);P.forEach(function(z){if(z instanceof HTMLElement){var ee=x.createComponentFromElement(z,function(je){var ut=je.getGui();ut&&x.copyAttributesFromNode(z,je.getGui())},g);if(ee){if(ee.addItems&&z.children.length){x.createChildComponentsFromTags(z,g);var Me=Array.prototype.slice.call(z.children);ee.addItems(Me)}x.swapComponentForNode(ee,h,z)}else z.childNodes&&x.createChildComponentsFromTags(z,g)}})},f.prototype.createComponentFromElement=function(h,g,x){var P=h.nodeName,z=x?x[h.getAttribute("ref")]:void 0,ee=this.agStackComponentsRegistry.getComponentClass(P);if(ee){f.elementGettingCreated=h;var Me=new ee(z);return Me.setParentComponent(this),this.createBean(Me,null,g),Me}return null},f.prototype.copyAttributesFromNode=function(h,g){Q(h.attributes,function(x,P){return g.setAttribute(x,P)})},f.prototype.swapComponentForNode=function(h,g,x){var P=h.getGui();g.replaceChild(P,x),g.insertBefore(document.createComment(x.nodeName),P),this.addDestroyFunc(this.destroyBean.bind(this,h)),this.swapInComponentForQuerySelectors(h,x)},f.prototype.swapInComponentForQuerySelectors=function(h,g){var x=this;this.iterateOverQuerySelectors(function(P){x[P.attributeName]===g&&(x[P.attributeName]=h)})},f.prototype.iterateOverQuerySelectors=function(h){for(var g=Object.getPrototypeOf(this);g!=null;){var x=g.__agComponentMetaData,P=Ge(g.constructor);x&&x[P]&&x[P].querySelectors&&x[P].querySelectors.forEach(function(z){return h(z)}),g=Object.getPrototypeOf(g)}},f.prototype.setTemplate=function(h,g){var x=yu(h);this.setTemplateFromElement(x,g)},f.prototype.setTemplateFromElement=function(h,g){this.eGui=h,this.eGui.__agComponent=this,this.wireQuerySelectors(),this.getContext()&&this.createChildComponentsFromTags(this.getGui(),g)},f.prototype.createChildComponentsPreConstruct=function(){this.getGui()&&this.createChildComponentsFromTags(this.getGui())},f.prototype.wireQuerySelectors=function(){var h=this;if(this.eGui){var g=this;this.iterateOverQuerySelectors(function(x){var P=function(Me){return g[x.attributeName]=Me},z=x.refSelector&&h.eGui.getAttribute("ref")===x.refSelector;if(z)P(h.eGui);else{var ee=h.eGui.querySelector(x.querySelector);ee&&P(ee.__agComponent||ee)}})}},f.prototype.getGui=function(){return this.eGui},f.prototype.getFocusableElement=function(){return this.eGui},f.prototype.setParentComponent=function(h){this.parentComponent=h},f.prototype.getParentComponent=function(){return this.parentComponent},f.prototype.setGui=function(h){this.eGui=h},f.prototype.queryForHtmlElement=function(h){return this.eGui.querySelector(h)},f.prototype.queryForHtmlInputElement=function(h){return this.eGui.querySelector(h)},f.prototype.appendChild=function(h,g){if(g||(g=this.eGui),h!=null)if(bt(h))g.appendChild(h);else{var x=h;g.appendChild(x.getGui()),this.addDestroyFunc(this.destroyBean.bind(this,x))}},f.prototype.isDisplayed=function(){return this.displayed},f.prototype.setVisible=function(h){h!==this.visible&&(this.visible=h,ef(this.eGui,h))},f.prototype.setDisplayed=function(h){if(h!==this.displayed){this.displayed=h,dl(this.eGui,h);var g={type:f.EVENT_DISPLAYED_CHANGED,visible:this.displayed};this.dispatchEvent(g)}},f.prototype.destroy=function(){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),M.prototype.destroy.call(this)},f.prototype.addGuiEventListener=function(h,g){var x=this;this.eGui.addEventListener(h,g),this.addDestroyFunc(function(){return x.eGui.removeEventListener(h,g)})},f.prototype.addCssClass=function(h){this.cssClassManager.addCssClass(h)},f.prototype.removeCssClass=function(h){this.cssClassManager.removeCssClass(h)},f.prototype.containsCssClass=function(h){return this.cssClassManager.containsCssClass(h)},f.prototype.addOrRemoveCssClass=function(h,g){this.cssClassManager.addOrRemoveCssClass(h,g)},f.prototype.getAttribute=function(h){var g=this.eGui;return g?g.getAttribute(h):null},f.prototype.getRefElement=function(h){return this.queryForHtmlElement('[ref="'+h+'"]')},f.EVENT_DISPLAYED_CHANGED="displayedChanged",yI([ce("agStackComponentsRegistry")],f.prototype,"agStackComponentsRegistry",void 0),yI([le],f.prototype,"preConstructOnComponent",null),yI([le],f.prototype,"createChildComponentsPreConstruct",null),f}($i);/** + */var w4=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),gI=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},x4=new v1,$v=function(){function M(f){this.cssClassStates={},this.getGui=f}return M.prototype.addCssClass=function(f){var d=this,g=(f||"").split(" ");if(g.length>1){g.forEach(function(O){return d.addCssClass(O)});return}var S=this.cssClassStates[f]!==!0;S&&f.length&&(this.getGui().classList.add(f),this.cssClassStates[f]=!0)},M.prototype.removeCssClass=function(f){var d=this,g=(f||"").split(" ");if(g.length>1){g.forEach(function(O){return d.removeCssClass(O)});return}var S=this.cssClassStates[f]!==!1;S&&f.length&&(this.getGui().classList.remove(f),this.cssClassStates[f]=!1)},M.prototype.containsCssClass=function(f){return this.getGui().classList.contains(f)},M.prototype.addOrRemoveCssClass=function(f,d){var g=this,S=(f||"").split(" ");if(S.length>1){S.forEach(function(z){return g.addOrRemoveCssClass(z,d)});return}var O=this.cssClassStates[f]!==d;O&&f.length&&(this.getGui().classList.toggle(f,d),this.cssClassStates[f]=d)},M}(),Ma=function(M){w4(f,M);function f(d){var g=M.call(this)||this;return g.displayed=!0,g.visible=!0,g.compId=x4.next(),g.cssClassManager=new $v(function(){return g.eGui}),d&&g.setTemplate(d),g}return f.prototype.preConstructOnComponent=function(){this.usingBrowserTooltips=this.gridOptionsWrapper.isEnableBrowserTooltips()},f.prototype.getCompId=function(){return this.compId},f.prototype.getTooltipParams=function(){return{value:this.tooltipText,location:"UNKNOWN"}},f.prototype.setTooltip=function(d){var g=this,S=function(){g.usingBrowserTooltips?g.getGui().removeAttribute("title"):g.tooltipFeature=g.destroyBean(g.tooltipFeature)},O=function(){g.usingBrowserTooltips?g.getGui().setAttribute("title",g.tooltipText):g.tooltipFeature=g.createBean(new Dy(g))};this.tooltipText!=d&&(this.tooltipText&&S(),d!=null&&(this.tooltipText=d,this.tooltipText&&O()))},f.prototype.createChildComponentsFromTags=function(d,g){var S=this,O=ne(d.childNodes);O.forEach(function(z){if(z instanceof HTMLElement){var te=S.createComponentFromElement(z,function(Ue){var ut=Ue.getGui();ut&&S.copyAttributesFromNode(z,Ue.getGui())},g);if(te){if(te.addItems&&z.children.length){S.createChildComponentsFromTags(z,g);var Fe=Array.prototype.slice.call(z.children);te.addItems(Fe)}S.swapComponentForNode(te,d,z)}else z.childNodes&&S.createChildComponentsFromTags(z,g)}})},f.prototype.createComponentFromElement=function(d,g,S){var O=d.nodeName,z=S?S[d.getAttribute("ref")]:void 0,te=this.agStackComponentsRegistry.getComponentClass(O);if(te){f.elementGettingCreated=d;var Fe=new te(z);return Fe.setParentComponent(this),this.createBean(Fe,null,g),Fe}return null},f.prototype.copyAttributesFromNode=function(d,g){ee(d.attributes,function(S,O){return g.setAttribute(S,O)})},f.prototype.swapComponentForNode=function(d,g,S){var O=d.getGui();g.replaceChild(O,S),g.insertBefore(document.createComment(S.nodeName),O),this.addDestroyFunc(this.destroyBean.bind(this,d)),this.swapInComponentForQuerySelectors(d,S)},f.prototype.swapInComponentForQuerySelectors=function(d,g){var S=this;this.iterateOverQuerySelectors(function(O){S[O.attributeName]===g&&(S[O.attributeName]=d)})},f.prototype.iterateOverQuerySelectors=function(d){for(var g=Object.getPrototypeOf(this);g!=null;){var S=g.__agComponentMetaData,O=Be(g.constructor);S&&S[O]&&S[O].querySelectors&&S[O].querySelectors.forEach(function(z){return d(z)}),g=Object.getPrototypeOf(g)}},f.prototype.setTemplate=function(d,g){var S=Au(d);this.setTemplateFromElement(S,g)},f.prototype.setTemplateFromElement=function(d,g){this.eGui=d,this.eGui.__agComponent=this,this.wireQuerySelectors(),this.getContext()&&this.createChildComponentsFromTags(this.getGui(),g)},f.prototype.createChildComponentsPreConstruct=function(){this.getGui()&&this.createChildComponentsFromTags(this.getGui())},f.prototype.wireQuerySelectors=function(){var d=this;if(this.eGui){var g=this;this.iterateOverQuerySelectors(function(S){var O=function(Fe){return g[S.attributeName]=Fe},z=S.refSelector&&d.eGui.getAttribute("ref")===S.refSelector;if(z)O(d.eGui);else{var te=d.eGui.querySelector(S.querySelector);te&&O(te.__agComponent||te)}})}},f.prototype.getGui=function(){return this.eGui},f.prototype.getFocusableElement=function(){return this.eGui},f.prototype.setParentComponent=function(d){this.parentComponent=d},f.prototype.getParentComponent=function(){return this.parentComponent},f.prototype.setGui=function(d){this.eGui=d},f.prototype.queryForHtmlElement=function(d){return this.eGui.querySelector(d)},f.prototype.queryForHtmlInputElement=function(d){return this.eGui.querySelector(d)},f.prototype.appendChild=function(d,g){if(g||(g=this.eGui),d!=null)if(bt(d))g.appendChild(d);else{var S=d;g.appendChild(S.getGui()),this.addDestroyFunc(this.destroyBean.bind(this,S))}},f.prototype.isDisplayed=function(){return this.displayed},f.prototype.setVisible=function(d){d!==this.visible&&(this.visible=d,sf(this.eGui,d))},f.prototype.setDisplayed=function(d){if(d!==this.displayed){this.displayed=d,wl(this.eGui,d);var g={type:f.EVENT_DISPLAYED_CHANGED,visible:this.displayed};this.dispatchEvent(g)}},f.prototype.destroy=function(){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),M.prototype.destroy.call(this)},f.prototype.addGuiEventListener=function(d,g){var S=this;this.eGui.addEventListener(d,g),this.addDestroyFunc(function(){return S.eGui.removeEventListener(d,g)})},f.prototype.addCssClass=function(d){this.cssClassManager.addCssClass(d)},f.prototype.removeCssClass=function(d){this.cssClassManager.removeCssClass(d)},f.prototype.containsCssClass=function(d){return this.cssClassManager.containsCssClass(d)},f.prototype.addOrRemoveCssClass=function(d,g){this.cssClassManager.addOrRemoveCssClass(d,g)},f.prototype.getAttribute=function(d){var g=this.eGui;return g?g.getAttribute(d):null},f.prototype.getRefElement=function(d){return this.queryForHtmlElement('[ref="'+d+'"]')},f.EVENT_DISPLAYED_CHANGED="displayedChanged",gI([pe("agStackComponentsRegistry")],f.prototype,"agStackComponentsRegistry",void 0),gI([ae],f.prototype,"preConstructOnComponent",null),gI([ae],f.prototype,"createChildComponentsPreConstruct",null),f}(ji);/** * @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/ * @license MIT - */function tz(M){return b4.bind(this,M,void 0)}function zr(M){return b4.bind(this,"[ref="+M+"]",M)}function b4(M,f,h,g,x){if(M===null){console.error("AG Grid: QuerySelector selector should not be null");return}if(typeof x=="number"){console.error("AG Grid: QuerySelector should be on an attribute");return}vI(h,"querySelectors",{attributeName:g,querySelector:M,refSelector:f})}function vI(M,f,h){var g=ga(M,Ge(M.constructor));g[f]||(g[f]=[]),g[f].push(h)}function ga(M,f){return M.__agComponentMetaData||(M.__agComponentMetaData={}),M.__agComponentMetaData[f]||(M.__agComponentMetaData[f]={}),M.__agComponentMetaData[f]}/** + */function tz(M){return S4.bind(this,M,void 0)}function tn(M){return S4.bind(this,"[ref="+M+"]",M)}function S4(M,f,d,g,S){if(M===null){console.error("AG Grid: QuerySelector selector should not be null");return}if(typeof S=="number"){console.error("AG Grid: QuerySelector should be on an attribute");return}yI(d,"querySelectors",{attributeName:g,querySelector:M,refSelector:f})}function yI(M,f,d){var g=Aa(M,Be(M.constructor));g[f]||(g[f]=[]),g[f].push(d)}function Aa(M,f){return M.__agComponentMetaData||(M.__agComponentMetaData={}),M.__agComponentMetaData[f]||(M.__agComponentMetaData[f]={}),M.__agComponentMetaData[f]}/** * @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/ * @license MIT - */var _I=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),f3=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},m3=function(M){_I(f,M);function f(){return M.call(this,` + */var vI=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),f3=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},m3=function(M){vI(f,M);function f(){return M.call(this,` `)||this}return f.prototype.destroy=function(){M.prototype.destroy.call(this)},f.prototype.init=function(h){this.params=h;var g=this.columnModel.getDisplayNameForColumn(h.column,"header",!0),x=this.gridOptionsWrapper.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(g+" "+x("ariaFilterInput","Filter Input"))},f.prototype.onParentModelChanged=function(h){var g=this;if(!h){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(function(x){if(x.getModelAsString){var P=x.getModelAsString(h);g.eFloatingFilterText.setValue(P)}})},f3([zr("eFloatingFilterText")],f.prototype,"eFloatingFilterText",void 0),f3([ce("columnModel")],f.prototype,"columnModel",void 0),f}(Sa);/** +
`)||this}return f.prototype.destroy=function(){M.prototype.destroy.call(this)},f.prototype.init=function(d){this.params=d;var g=this.columnModel.getDisplayNameForColumn(d.column,"header",!0),S=this.gridOptionsWrapper.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(g+" "+S("ariaFilterInput","Filter Input"))},f.prototype.onParentModelChanged=function(d){var g=this;if(!d){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(function(S){if(S.getModelAsString){var O=S.getModelAsString(d);g.eFloatingFilterText.setValue(O)}})},f3([tn("eFloatingFilterText")],f.prototype,"eFloatingFilterText",void 0),f3([pe("columnModel")],f.prototype,"columnModel",void 0),f}(Ma);/** * @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/ * @license MIT - */var g3=function(){function M(f,h,g,x){var P=this;this.alive=!0,this.context=f,this.eParent=x;var z=h.getDateCompDetails(g),ee=z.newAgStackInstance();ee.then(function(Me){if(!P.alive){f.destroyBean(Me);return}P.dateComp=Me,Me&&(x.appendChild(Me.getGui()),Me.afterGuiAttached&&Me.afterGuiAttached(),P.tempValue&&Me.setDate(P.tempValue),P.disabled!=null&&P.setDateCompDisabled(P.disabled))})}return M.prototype.destroy=function(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)},M.prototype.getDate=function(){return this.dateComp?this.dateComp.getDate():this.tempValue},M.prototype.setDate=function(f){this.dateComp?this.dateComp.setDate(f):this.tempValue=f},M.prototype.setDisabled=function(f){this.dateComp?this.setDateCompDisabled(f):this.disabled=f},M.prototype.setDisplayed=function(f){dl(this.eParent,f)},M.prototype.setInputPlaceholder=function(f){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(f)},M.prototype.setInputAriaLabel=function(f){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(f)},M.prototype.afterGuiAttached=function(f){this.dateComp&&typeof this.dateComp.afterGuiAttached=="function"&&this.dateComp.afterGuiAttached(f)},M.prototype.setDateCompDisabled=function(f){this.dateComp!=null&&this.dateComp.setDisabled!=null&&this.dateComp.setDisabled(f)},M}();/** + */var g3=function(){function M(f,d,g,S){var O=this;this.alive=!0,this.context=f,this.eParent=S;var z=d.getDateCompDetails(g),te=z.newAgStackInstance();te.then(function(Fe){if(!O.alive){f.destroyBean(Fe);return}O.dateComp=Fe,Fe&&(S.appendChild(Fe.getGui()),Fe.afterGuiAttached&&Fe.afterGuiAttached(),O.tempValue&&Fe.setDate(O.tempValue),O.disabled!=null&&O.setDateCompDisabled(O.disabled))})}return M.prototype.destroy=function(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)},M.prototype.getDate=function(){return this.dateComp?this.dateComp.getDate():this.tempValue},M.prototype.setDate=function(f){this.dateComp?this.dateComp.setDate(f):this.tempValue=f},M.prototype.setDisabled=function(f){this.dateComp?this.setDateCompDisabled(f):this.disabled=f},M.prototype.setDisplayed=function(f){wl(this.eParent,f)},M.prototype.setInputPlaceholder=function(f){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(f)},M.prototype.setInputAriaLabel=function(f){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(f)},M.prototype.afterGuiAttached=function(f){this.dateComp&&typeof this.dateComp.afterGuiAttached=="function"&&this.dateComp.afterGuiAttached(f)},M.prototype.setDateCompDisabled=function(f){this.dateComp!=null&&this.dateComp.setDisabled!=null&&this.dateComp.setDisabled(f)},M}();/** * @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/ * @license MIT - */var w4=function(){return w4=Object.assign||function(M){for(var f,h=1,g=arguments.length;h=1){var h=this.filterOptions[0];typeof h=="string"?this.defaultOption=h:h.displayKey?this.defaultOption=h.displayKey:console.warn("AG Grid: invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else console.warn("AG Grid: no filter options for filter")},M.prototype.getDefaultOption=function(){return this.defaultOption},M.prototype.getCustomOption=function(f){return this.customFilterOptions[f]},M}();/** + */var C4=function(){return C4=Object.assign||function(M){for(var f,d=1,g=arguments.length;d=1){var d=this.filterOptions[0];typeof d=="string"?this.defaultOption=d:d.displayKey?this.defaultOption=d.displayKey:console.warn("AG Grid: invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else console.warn("AG Grid: no filter options for filter")},M.prototype.getDefaultOption=function(){return this.defaultOption},M.prototype.getCustomOption=function(f){return this.customFilterOptions[f]},M}();/** * @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/ @@ -5763,170 +5763,170 @@ gl_FragColor.rgb *= color.a; * @version v27.3.0 * @link https://www.ag-grid.com/ * @license MIT - */var Nr=function(){function M(){}return M.BACKSPACE="Backspace",M.TAB="Tab",M.ENTER="Enter",M.ESCAPE="Escape",M.SPACE=" ",M.LEFT="ArrowLeft",M.UP="ArrowUp",M.RIGHT="ArrowRight",M.DOWN="ArrowDown",M.DELETE="Delete",M.F2="F2",M.PAGE_UP="PageUp",M.PAGE_DOWN="PageDown",M.PAGE_HOME="Home",M.PAGE_END="End",M.A="KeyA",M.C="KeyC",M.V="KeyV",M.D="KeyD",M.Z="KeyZ",M.Y="KeyY",M}();/** + */var Qr=function(){function M(){}return M.BACKSPACE="Backspace",M.TAB="Tab",M.ENTER="Enter",M.ESCAPE="Escape",M.SPACE=" ",M.LEFT="ArrowLeft",M.UP="ArrowUp",M.RIGHT="ArrowRight",M.DOWN="ArrowDown",M.DELETE="Delete",M.F2="F2",M.PAGE_UP="PageUp",M.PAGE_DOWN="PageDown",M.PAGE_HOME="Home",M.PAGE_END="End",M.A="KeyA",M.C="KeyC",M.V="KeyV",M.D="KeyD",M.Z="KeyZ",M.Y="KeyY",M}();/** * @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/ * @license MIT - */var rz=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),x4=function(){return x4=Object.assign||function(M){for(var f,h=1,g=arguments.length;h=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Db=function(M){rz(f,M);function f(h,g){g===void 0&&(g={});var x=M.call(this)||this;return x.eFocusableElement=h,x.callbacks=g,x.callbacks=x4({shouldStopEventPropagation:function(){return!1},onTabKeyDown:function(P){if(!P.defaultPrevented){var z=x.focusService.findNextFocusableElement(x.eFocusableElement,!1,P.shiftKey);z&&(z.focus(),P.preventDefault())}}},g),x}return f.prototype.postConstruct=function(){this.eFocusableElement.classList.add(f.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedListener(this.eFocusableElement,"focusin",this.callbacks.onFocusIn),this.callbacks.onFocusOut&&this.addManagedListener(this.eFocusableElement,"focusout",this.callbacks.onFocusOut)},f.prototype.addKeyDownListeners=function(h){var g=this;this.addManagedListener(h,"keydown",function(x){if(!(x.defaultPrevented||er(x))){if(g.callbacks.shouldStopEventPropagation(x)){Ri(x);return}x.key===Nr.TAB?g.callbacks.onTabKeyDown(x):g.callbacks.handleKeyDown&&g.callbacks.handleKeyDown(x)}})},f.FOCUS_MANAGED_CLASS="ag-focus-managed",no([ce("focusService")],f.prototype,"focusService",void 0),no([it],f.prototype,"postConstruct",null),f}($i);/** + */var rz=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),T4=function(){return T4=Object.assign||function(M){for(var f,d=1,g=arguments.length;d=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Nb=function(M){rz(f,M);function f(d,g){g===void 0&&(g={});var S=M.call(this)||this;return S.eFocusableElement=d,S.callbacks=g,S.callbacks=T4({shouldStopEventPropagation:function(){return!1},onTabKeyDown:function(O){if(!O.defaultPrevented){var z=S.focusService.findNextFocusableElement(S.eFocusableElement,!1,O.shiftKey);z&&(z.focus(),O.preventDefault())}}},g),S}return f.prototype.postConstruct=function(){this.eFocusableElement.classList.add(f.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedListener(this.eFocusableElement,"focusin",this.callbacks.onFocusIn),this.callbacks.onFocusOut&&this.addManagedListener(this.eFocusableElement,"focusout",this.callbacks.onFocusOut)},f.prototype.addKeyDownListeners=function(d){var g=this;this.addManagedListener(d,"keydown",function(S){if(!(S.defaultPrevented||tr(S))){if(g.callbacks.shouldStopEventPropagation(S)){Ni(S);return}S.key===Qr.TAB?g.callbacks.onTabKeyDown(S):g.callbacks.handleKeyDown&&g.callbacks.handleKeyDown(S)}})},f.FOCUS_MANAGED_CLASS="ag-focus-managed",rp([pe("focusService")],f.prototype,"focusService",void 0),rp([ht],f.prototype,"postConstruct",null),f}(ji);/** * @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/ * @license MIT - */var nz=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),G$=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},bI=function(M){nz(f,M);function f(h){var g=M.call(this)||this;return g.filterNameKey=h,g.applyActive=!1,g.hidePopup=null,g.appliedModel=null,g}return f.prototype.postConstruct=function(){this.resetTemplate(),this.createManagedBean(new Db(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)}))},f.prototype.handleKeyDown=function(h){},f.prototype.getFilterTitle=function(){return this.translate(this.filterNameKey)},f.prototype.isFilterActive=function(){return!!this.appliedModel},f.prototype.resetTemplate=function(h){var g=` + */var nz=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),$$=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},_I=function(M){nz(f,M);function f(d){var g=M.call(this)||this;return g.filterNameKey=d,g.applyActive=!1,g.hidePopup=null,g.appliedModel=null,g}return f.prototype.postConstruct=function(){this.resetTemplate(),this.createManagedBean(new Nb(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)}))},f.prototype.handleKeyDown=function(d){},f.prototype.getFilterTitle=function(){return this.translate(this.filterNameKey)},f.prototype.isFilterActive=function(){return!!this.appliedModel},f.prototype.resetTemplate=function(d){var g=`
`+this.createBodyTemplate()+`
-
`;this.setTemplate(g,h)},f.prototype.isReadOnly=function(){return!!this.providedFilterParams.readOnly},f.prototype.init=function(h){var g=this;this.setParams(h),this.resetUiToDefaults(!0).then(function(){g.updateUiVisibility(),g.setupOnBtApplyDebounce()})},f.prototype.setParams=function(h){this.providedFilterParams=h,this.applyActive=f.isUseApplyButton(h),this.createButtonPanel()},f.prototype.createButtonPanel=function(){var h=this,g=this.providedFilterParams.buttons;if(!(!g||g.length<1||this.isReadOnly())){var x=document.createElement("div");x.classList.add("ag-filter-apply-panel");var P=function(z){var ee,Me;switch(z){case"apply":ee=h.translate("applyFilter"),Me=function(ut){return h.onBtApply(!1,!1,ut)};break;case"clear":ee=h.translate("clearFilter"),Me=function(){return h.onBtClear()};break;case"reset":ee=h.translate("resetFilter"),Me=function(){return h.onBtReset()};break;case"cancel":ee=h.translate("cancelFilter"),Me=function(ut){h.onBtCancel(ut)};break;default:console.warn("AG Grid: Unknown button type specified");return}var je=yu(``);x.appendChild(je),h.addManagedListener(je,"click",Me)};fI(g).forEach(function(z){return P(z)}),this.getGui().appendChild(x)}},f.prototype.getDefaultDebounceMs=function(){return 0},f.prototype.setupOnBtApplyDebounce=function(){var h=f.getDebounceMs(this.providedFilterParams,this.getDefaultDebounceMs());this.onBtApplyDebounce=Tt(this.onBtApply.bind(this),h)},f.prototype.getModel=function(){return this.appliedModel?this.appliedModel:null},f.prototype.setModel=function(h){var g=this,x=h!=null?this.setModelIntoUi(h):this.resetUiToDefaults();return x.then(function(){g.updateUiVisibility(),g.applyModel()})},f.prototype.onBtCancel=function(h){var g=this,x=this.getModel(),P=function(){g.onUiChanged(!1,"prevent"),g.providedFilterParams.closeOnApply&&g.close(h)};x!=null?this.setModelIntoUi(x).then(P):this.resetUiToDefaults().then(P)},f.prototype.onBtClear=function(){var h=this;this.resetUiToDefaults().then(function(){return h.onUiChanged()})},f.prototype.onBtReset=function(){this.onBtClear(),this.onBtApply()},f.prototype.applyModel=function(){var h=this.getModelFromUi();if(!this.isModelValid(h))return!1;var g=this.appliedModel;return this.appliedModel=h,!this.areModelsEqual(g,h)},f.prototype.isModelValid=function(h){return!0},f.prototype.onBtApply=function(h,g,x){h===void 0&&(h=!1),g===void 0&&(g=!1),this.applyModel()&&this.providedFilterParams.filterChangedCallback({afterFloatingFilter:h,afterDataChange:g});var P=this.providedFilterParams.closeOnApply;P&&this.applyActive&&!h&&!g&&this.close(x)},f.prototype.onNewRowsLoaded=function(){},f.prototype.close=function(h){if(this.hidePopup){var g=h,x=g&&g.key,P;(x==="Enter"||x==="Space")&&(P={keyboardEvent:g}),this.hidePopup(P),this.hidePopup=null}},f.prototype.onUiChanged=function(h,g){if(h===void 0&&(h=!1),this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly){var x=this.isModelValid(this.getModelFromUi());dh(this.getRefElement("applyFilterButton"),!x)}h&&!g||g==="immediately"?this.onBtApply(h):(!this.applyActive&&!g||g==="debounce")&&this.onBtApplyDebounce()},f.prototype.afterGuiAttached=function(h){h!=null&&(this.hidePopup=h.hidePopup)},f.getDebounceMs=function(h,g){return f.isUseApplyButton(h)?(h.debounceMs!=null&&console.warn("AG Grid: debounceMs is ignored when apply button is present"),0):h.debounceMs!=null?h.debounceMs:g},f.isUseApplyButton=function(h){return!!h.buttons&&h.buttons.indexOf("apply")>=0},f.prototype.destroy=function(){this.hidePopup=null,M.prototype.destroy.call(this)},f.prototype.translate=function(h){var g=this.gridOptionsWrapper.getLocaleTextFunc();return g(h,iz[h])},f.prototype.getCellValue=function(h){var g=this.providedFilterParams,x=g.api,P=g.colDef,z=g.column,ee=g.columnApi,Me=g.context;return this.providedFilterParams.valueGetter({api:x,colDef:P,column:z,columnApi:ee,context:Me,data:h.data,getValue:function(je){return h.data[je]},node:h})},G$([ce("rowModel")],f.prototype,"rowModel",void 0),G$([ce("valueService")],f.prototype,"valueService",void 0),G$([it],f.prototype,"postConstruct",null),f}(Sa);/** + >`+te+` + `);S.appendChild(Ue),d.addManagedListener(Ue,"click",Fe)};pI(g).forEach(function(z){return O(z)}),this.getGui().appendChild(S)}},f.prototype.getDefaultDebounceMs=function(){return 0},f.prototype.setupOnBtApplyDebounce=function(){var d=f.getDebounceMs(this.providedFilterParams,this.getDefaultDebounceMs());this.onBtApplyDebounce=Et(this.onBtApply.bind(this),d)},f.prototype.getModel=function(){return this.appliedModel?this.appliedModel:null},f.prototype.setModel=function(d){var g=this,S=d!=null?this.setModelIntoUi(d):this.resetUiToDefaults();return S.then(function(){g.updateUiVisibility(),g.applyModel()})},f.prototype.onBtCancel=function(d){var g=this,S=this.getModel(),O=function(){g.onUiChanged(!1,"prevent"),g.providedFilterParams.closeOnApply&&g.close(d)};S!=null?this.setModelIntoUi(S).then(O):this.resetUiToDefaults().then(O)},f.prototype.onBtClear=function(){var d=this;this.resetUiToDefaults().then(function(){return d.onUiChanged()})},f.prototype.onBtReset=function(){this.onBtClear(),this.onBtApply()},f.prototype.applyModel=function(){var d=this.getModelFromUi();if(!this.isModelValid(d))return!1;var g=this.appliedModel;return this.appliedModel=d,!this.areModelsEqual(g,d)},f.prototype.isModelValid=function(d){return!0},f.prototype.onBtApply=function(d,g,S){d===void 0&&(d=!1),g===void 0&&(g=!1),this.applyModel()&&this.providedFilterParams.filterChangedCallback({afterFloatingFilter:d,afterDataChange:g});var O=this.providedFilterParams.closeOnApply;O&&this.applyActive&&!d&&!g&&this.close(S)},f.prototype.onNewRowsLoaded=function(){},f.prototype.close=function(d){if(this.hidePopup){var g=d,S=g&&g.key,O;(S==="Enter"||S==="Space")&&(O={keyboardEvent:g}),this.hidePopup(O),this.hidePopup=null}},f.prototype.onUiChanged=function(d,g){if(d===void 0&&(d=!1),this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly){var S=this.isModelValid(this.getModelFromUi());gh(this.getRefElement("applyFilterButton"),!S)}d&&!g||g==="immediately"?this.onBtApply(d):(!this.applyActive&&!g||g==="debounce")&&this.onBtApplyDebounce()},f.prototype.afterGuiAttached=function(d){d!=null&&(this.hidePopup=d.hidePopup)},f.getDebounceMs=function(d,g){return f.isUseApplyButton(d)?(d.debounceMs!=null&&console.warn("AG Grid: debounceMs is ignored when apply button is present"),0):d.debounceMs!=null?d.debounceMs:g},f.isUseApplyButton=function(d){return!!d.buttons&&d.buttons.indexOf("apply")>=0},f.prototype.destroy=function(){this.hidePopup=null,M.prototype.destroy.call(this)},f.prototype.translate=function(d){var g=this.gridOptionsWrapper.getLocaleTextFunc();return g(d,iz[d])},f.prototype.getCellValue=function(d){var g=this.providedFilterParams,S=g.api,O=g.colDef,z=g.column,te=g.columnApi,Fe=g.context;return this.providedFilterParams.valueGetter({api:S,colDef:O,column:z,columnApi:te,context:Fe,data:d.data,getValue:function(Ue){return d.data[Ue]},node:d})},$$([pe("rowModel")],f.prototype,"rowModel",void 0),$$([pe("valueService")],f.prototype,"valueService",void 0),$$([ht],f.prototype,"postConstruct",null),f}(Ma);/** * @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/ * @license MIT - */var sz=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),V$=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Mx=function(M){sz(f,M);function f(h,g){var x=M.call(this,g)||this;return x.labelSeparator="",x.labelAlignment="left",x.label="",x.config=h||{},x}return f.prototype.postConstruct=function(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");var h=this.config,g=h.labelSeparator,x=h.label,P=h.labelWidth,z=h.labelAlignment;g!=null&&this.setLabelSeparator(g),x!=null&&this.setLabel(x),P!=null&&this.setLabelWidth(P),this.setLabelAlignment(z||this.labelAlignment),this.refreshLabel()},f.prototype.refreshLabel=function(){Ou(this.eLabel),typeof this.label=="string"?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),this.label===""?(this.eLabel.classList.add("ag-hidden"),tr(this.eLabel,"presentation")):(this.eLabel.classList.remove("ag-hidden"),tr(this.eLabel,null))},f.prototype.setLabelSeparator=function(h){return this.labelSeparator===h?this:(this.labelSeparator=h,this.label!=null&&this.refreshLabel(),this)},f.prototype.getLabelId=function(){return this.eLabel.id=this.eLabel.id||"ag-"+this.getCompId()+"-label",this.eLabel.id},f.prototype.getLabel=function(){return this.label},f.prototype.setLabel=function(h){return this.label===h?this:(this.label=h,this.refreshLabel(),this)},f.prototype.setLabelAlignment=function(h){var g=this.getGui(),x=g.classList;return x.toggle("ag-label-align-left",h==="left"),x.toggle("ag-label-align-right",h==="right"),x.toggle("ag-label-align-top",h==="top"),this},f.prototype.setLabelWidth=function(h){return this.label==null?this:(Ht(this.eLabel,h),this)},V$([it],f.prototype,"postConstruct",null),f}(Sa);/** + */var sz=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),B$=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Dx=function(M){sz(f,M);function f(d,g){var S=M.call(this,g)||this;return S.labelSeparator="",S.labelAlignment="left",S.label="",S.config=d||{},S}return f.prototype.postConstruct=function(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");var d=this.config,g=d.labelSeparator,S=d.label,O=d.labelWidth,z=d.labelAlignment;g!=null&&this.setLabelSeparator(g),S!=null&&this.setLabel(S),O!=null&&this.setLabelWidth(O),this.setLabelAlignment(z||this.labelAlignment),this.refreshLabel()},f.prototype.refreshLabel=function(){ju(this.eLabel),typeof this.label=="string"?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),this.label===""?(this.eLabel.classList.add("ag-hidden"),lr(this.eLabel,"presentation")):(this.eLabel.classList.remove("ag-hidden"),lr(this.eLabel,null))},f.prototype.setLabelSeparator=function(d){return this.labelSeparator===d?this:(this.labelSeparator=d,this.label!=null&&this.refreshLabel(),this)},f.prototype.getLabelId=function(){return this.eLabel.id=this.eLabel.id||"ag-"+this.getCompId()+"-label",this.eLabel.id},f.prototype.getLabel=function(){return this.label},f.prototype.setLabel=function(d){return this.label===d?this:(this.label=d,this.refreshLabel(),this)},f.prototype.setLabelAlignment=function(d){var g=this.getGui(),S=g.classList;return S.toggle("ag-label-align-left",d==="left"),S.toggle("ag-label-align-right",d==="right"),S.toggle("ag-label-align-top",d==="top"),this},f.prototype.setLabelWidth=function(d){return this.label==null?this:(qt(this.eLabel,d),this)},B$([ht],f.prototype,"postConstruct",null),f}(Ma);/** * @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/ * @license MIT - */var dm=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),rf=function(M){dm(f,M);function f(h,g,x){var P=M.call(this,h,g)||this;return P.className=x,P.disabled=!1,P}return f.prototype.postConstruct=function(){M.prototype.postConstruct.call(this),this.className&&this.addCssClass(this.className)},f.prototype.onValueChange=function(h){var g=this;return this.addManagedListener(this,f.EVENT_CHANGED,function(){return h(g.getValue())}),this},f.prototype.getWidth=function(){return this.getGui().clientWidth},f.prototype.setWidth=function(h){return qt(this.getGui(),h),this},f.prototype.getPreviousValue=function(){return this.previousValue},f.prototype.getValue=function(){return this.value},f.prototype.setValue=function(h,g){return this.value===h?this:(this.previousValue=this.value,this.value=h,g||this.dispatchEvent({type:f.EVENT_CHANGED}),this)},f.prototype.setDisabled=function(h){h=!!h;var g=this.getGui();return dh(g,h),g.classList.toggle("ag-disabled",h),this.disabled=h,this},f.prototype.isDisabled=function(){return!!this.disabled},f.EVENT_CHANGED="valueChange",f}(Mx);/** + */var _m=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Rf=function(M){_m(f,M);function f(d,g,S){var O=M.call(this,d,g)||this;return O.className=S,O.disabled=!1,O}return f.prototype.postConstruct=function(){M.prototype.postConstruct.call(this),this.className&&this.addCssClass(this.className)},f.prototype.onValueChange=function(d){var g=this;return this.addManagedListener(this,f.EVENT_CHANGED,function(){return d(g.getValue())}),this},f.prototype.getWidth=function(){return this.getGui().clientWidth},f.prototype.setWidth=function(d){return Jt(this.getGui(),d),this},f.prototype.getPreviousValue=function(){return this.previousValue},f.prototype.getValue=function(){return this.value},f.prototype.setValue=function(d,g){return this.value===d?this:(this.previousValue=this.value,this.value=d,g||this.dispatchEvent({type:f.EVENT_CHANGED}),this)},f.prototype.setDisabled=function(d){d=!!d;var g=this.getGui();return gh(g,d),g.classList.toggle("ag-disabled",d),this.disabled=d,this},f.prototype.isDisabled=function(){return!!this.disabled},f.EVENT_CHANGED="valueChange",f}(Dx);/** * @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/ * @license MIT - */var y3=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),wI=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Mu=function(M){y3(f,M);function f(h,g,x,P){var z=M.call(this,h,``,g)||this;return z.pickerIcon=S,z.isPickerDisplayed=!1,z.isDestroyingPicker=!1,z.skipClick=!1,z}return f.prototype.postConstruct=function(){var d=this;M.prototype.postConstruct.call(this);var g=this.getCompId()+"-display";this.eDisplayField.setAttribute("id",g),ul(this.eWrapper,g);var S=function(){if(d.skipClick){d.skipClick=!1;return}d.isDisabled()||(d.pickerComponent=d.showPicker())},O=this.getGui();if(this.addManagedListener(O,"mousedown",function(te){!d.skipClick&&d.pickerComponent&&d.pickerComponent.isAlive()&&ah(d.pickerComponent.getGui())&&O.contains(te.target)&&(d.skipClick=!0)}),this.addManagedListener(O,"keydown",function(te){switch(te.key){case Qr.UP:case Qr.DOWN:case Qr.ENTER:case Qr.SPACE:S();case Qr.ESCAPE:d.isPickerDisplayed&&te.preventDefault();break}}),this.addManagedListener(this.eWrapper,"click",S),this.addManagedListener(this.eLabel,"click",S),this.pickerIcon){var z=hu(this.pickerIcon,this.gridOptionsWrapper);z&&this.eIcon.appendChild(z)}},f.prototype.refreshLabel=function(){i(this.getLabel())?Hs(this.eWrapper,this.getLabelId()):this.eWrapper.removeAttribute("aria-labelledby"),M.prototype.refreshLabel.call(this)},f.prototype.setAriaLabel=function(d){return Jn(this.eWrapper,d),this},f.prototype.setInputWidth=function(d){return qt(this.eWrapper,d),this},f.prototype.getFocusableElement=function(){return this.eWrapper},bI([tn("eLabel")],f.prototype,"eLabel",void 0),bI([tn("eWrapper")],f.prototype,"eWrapper",void 0),bI([tn("eDisplayField")],f.prototype,"eDisplayField",void 0),bI([tn("eIcon")],f.prototype,"eIcon",void 0),f}(Rf);/** * @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/ * @license MIT - */var U$=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Fb=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},QS=function(M){U$(f,M);function f(h){h===void 0&&(h="default");var g=M.call(this,'
')||this;return g.cssIdentifier=h,g.options=[],g.itemEls=[],g}return f.prototype.init=function(){this.addManagedListener(this.getGui(),"keydown",this.handleKeyDown.bind(this))},f.prototype.handleKeyDown=function(h){var g=h.key;switch(g){case Nr.ENTER:if(!this.highlightedEl)this.setValue(this.getValue());else{var x=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(x)}break;case Nr.DOWN:case Nr.UP:var P=g===Nr.DOWN,z=void 0;if(h.preventDefault(),!this.highlightedEl)z=this.itemEls[P?0:this.itemEls.length-1];else{var ee=this.itemEls.indexOf(this.highlightedEl),Me=ee+(P?1:-1);Me=Math.min(Math.max(Me,0),this.itemEls.length-1),z=this.itemEls[Me]}this.highlightItem(z);break}},f.prototype.addOptions=function(h){var g=this;return h.forEach(function(x){return g.addOption(x)}),this},f.prototype.addOption=function(h){var g=h.value,x=h.text,P=_t(x||g);return this.options.push({value:g,text:P}),this.renderOption(g,P),this.updateIndices(),this},f.prototype.updateIndices=function(){var h=this.getGui().querySelectorAll(".ag-list-item");h.forEach(function(g,x){Rh(g,x+1),Er(g,h.length)})},f.prototype.renderOption=function(h,g){var x=this,P=document.createElement("div");tr(P,"option"),P.classList.add("ag-list-item","ag-"+this.cssIdentifier+"-list-item"),P.innerHTML=""+g+"",P.tabIndex=-1,this.itemEls.push(P),this.addManagedListener(P,"mouseover",function(){return x.highlightItem(P)}),this.addManagedListener(P,"mouseleave",function(){return x.clearHighlighted()}),this.addManagedListener(P,"click",function(){return x.setValue(h)}),this.getGui().appendChild(P)},f.prototype.setValue=function(h,g){if(this.value===h)return this.fireItemSelected(),this;if(h==null)return this.reset(),this;var x=this.options.findIndex(function(z){return z.value===h});if(x!==-1){var P=this.options[x];this.value=P.value,this.displayValue=P.text!=null?P.text:P.value,this.highlightItem(this.itemEls[x]),g||this.fireChangeEvent()}return this},f.prototype.setValueByIndex=function(h){return this.setValue(this.options[h].value)},f.prototype.getValue=function(){return this.value},f.prototype.getDisplayValue=function(){return this.displayValue},f.prototype.refreshHighlighted=function(){var h=this;this.clearHighlighted();var g=this.options.findIndex(function(x){return x.value===h.value});g!==-1&&this.highlightItem(this.itemEls[g])},f.prototype.reset=function(){this.value=null,this.displayValue=null,this.clearHighlighted(),this.fireChangeEvent()},f.prototype.highlightItem=function(h){h.offsetParent&&(this.clearHighlighted(),this.highlightedEl=h,this.highlightedEl.classList.add(f.ACTIVE_CLASS),vl(this.highlightedEl,!0),this.highlightedEl.focus())},f.prototype.clearHighlighted=function(){!this.highlightedEl||!this.highlightedEl.offsetParent||(this.highlightedEl.classList.remove(f.ACTIVE_CLASS),vl(this.highlightedEl,!1),this.highlightedEl=null)},f.prototype.fireChangeEvent=function(){this.dispatchEvent({type:rf.EVENT_CHANGED}),this.fireItemSelected()},f.prototype.fireItemSelected=function(){this.dispatchEvent({type:f.EVENT_ITEM_SELECTED})},f.EVENT_ITEM_SELECTED="selectedItem",f.ACTIVE_CLASS="ag-active-item",Fb([it],f.prototype,"init",null),f}(Sa);/** + */var V$=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),kb=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},ZS=function(M){V$(f,M);function f(d){d===void 0&&(d="default");var g=M.call(this,'
')||this;return g.cssIdentifier=d,g.options=[],g.itemEls=[],g}return f.prototype.init=function(){this.addManagedListener(this.getGui(),"keydown",this.handleKeyDown.bind(this))},f.prototype.handleKeyDown=function(d){var g=d.key;switch(g){case Qr.ENTER:if(!this.highlightedEl)this.setValue(this.getValue());else{var S=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(S)}break;case Qr.DOWN:case Qr.UP:var O=g===Qr.DOWN,z=void 0;if(d.preventDefault(),!this.highlightedEl)z=this.itemEls[O?0:this.itemEls.length-1];else{var te=this.itemEls.indexOf(this.highlightedEl),Fe=te+(O?1:-1);Fe=Math.min(Math.max(Fe,0),this.itemEls.length-1),z=this.itemEls[Fe]}this.highlightItem(z);break}},f.prototype.addOptions=function(d){var g=this;return d.forEach(function(S){return g.addOption(S)}),this},f.prototype.addOption=function(d){var g=d.value,S=d.text,O=_t(S||g);return this.options.push({value:g,text:O}),this.renderOption(g,O),this.updateIndices(),this},f.prototype.updateIndices=function(){var d=this.getGui().querySelectorAll(".ag-list-item");d.forEach(function(g,S){Fh(g,S+1),Nr(g,d.length)})},f.prototype.renderOption=function(d,g){var S=this,O=document.createElement("div");lr(O,"option"),O.classList.add("ag-list-item","ag-"+this.cssIdentifier+"-list-item"),O.innerHTML=""+g+"",O.tabIndex=-1,this.itemEls.push(O),this.addManagedListener(O,"mouseover",function(){return S.highlightItem(O)}),this.addManagedListener(O,"mouseleave",function(){return S.clearHighlighted()}),this.addManagedListener(O,"click",function(){return S.setValue(d)}),this.getGui().appendChild(O)},f.prototype.setValue=function(d,g){if(this.value===d)return this.fireItemSelected(),this;if(d==null)return this.reset(),this;var S=this.options.findIndex(function(z){return z.value===d});if(S!==-1){var O=this.options[S];this.value=O.value,this.displayValue=O.text!=null?O.text:O.value,this.highlightItem(this.itemEls[S]),g||this.fireChangeEvent()}return this},f.prototype.setValueByIndex=function(d){return this.setValue(this.options[d].value)},f.prototype.getValue=function(){return this.value},f.prototype.getDisplayValue=function(){return this.displayValue},f.prototype.refreshHighlighted=function(){var d=this;this.clearHighlighted();var g=this.options.findIndex(function(S){return S.value===d.value});g!==-1&&this.highlightItem(this.itemEls[g])},f.prototype.reset=function(){this.value=null,this.displayValue=null,this.clearHighlighted(),this.fireChangeEvent()},f.prototype.highlightItem=function(d){d.offsetParent&&(this.clearHighlighted(),this.highlightedEl=d,this.highlightedEl.classList.add(f.ACTIVE_CLASS),Il(this.highlightedEl,!0),this.highlightedEl.focus())},f.prototype.clearHighlighted=function(){!this.highlightedEl||!this.highlightedEl.offsetParent||(this.highlightedEl.classList.remove(f.ACTIVE_CLASS),Il(this.highlightedEl,!1),this.highlightedEl=null)},f.prototype.fireChangeEvent=function(){this.dispatchEvent({type:Rf.EVENT_CHANGED}),this.fireItemSelected()},f.prototype.fireItemSelected=function(){this.dispatchEvent({type:f.EVENT_ITEM_SELECTED})},f.EVENT_ITEM_SELECTED="selectedItem",f.ACTIVE_CLASS="ag-active-item",kb([ht],f.prototype,"init",null),f}(Ma);/** * @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/ * @license MIT - */var oz=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),S4=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},eC=function(M){oz(f,M);function f(h){return M.call(this,h,"ag-select","smallDown","listbox")||this}return f.prototype.init=function(){var h=this;this.listComponent=this.createBean(new QS("select")),this.listComponent.setParentComponent(this),this.eWrapper.tabIndex=0,this.listComponent.addManagedListener(this.listComponent,QS.EVENT_ITEM_SELECTED,function(){h.hideList&&h.hideList()}),this.listComponent.addManagedListener(this.listComponent,rf.EVENT_CHANGED,function(){h.setValue(h.listComponent.getValue(),!1,!0),h.hideList&&h.hideList()})},f.prototype.showPicker=function(){var h=this,g=this.listComponent.getGui(),x=this.gridOptionsWrapper.getDocument(),P=this.addManagedListener(x.body,"wheel",function(je){!g.contains(je.target)&&h.hideList&&h.hideList()}),z=this.addManagedListener(g,"focusout",function(je){!g.contains(je.relatedTarget)&&h.hideList&&h.hideList()}),ee=this.gridOptionsWrapper.getLocaleTextFunc(),Me=this.popupService.addPopup({modal:!0,eChild:g,closeOnEsc:!0,closedCallback:function(){h.hideList=null,h.isPickerDisplayed=!1,z(),P(),h.isAlive()&&(yo(h.eWrapper,!1),h.getFocusableElement().focus())},ariaLabel:ee("ariaLabelSelectField","Select Field")});return Me&&(this.hideList=Me.hideFunc),this.isPickerDisplayed=!0,Ht(g,bp(this.eWrapper)),yo(this.eWrapper,!0),g.style.maxHeight=tf(this.popupService.getPopupParent())+"px",g.style.position="absolute",this.popupService.positionPopupUnderComponent({type:"ag-list",eventSource:this.eWrapper,ePopup:g,keepWithinBounds:!0}),this.listComponent.refreshHighlighted(),this.listComponent},f.prototype.addOptions=function(h){var g=this;return h.forEach(function(x){return g.addOption(x)}),this},f.prototype.addOption=function(h){return this.listComponent.addOption(h),this},f.prototype.setValue=function(h,g,x){if(this.value===h)return this;x||this.listComponent.setValue(h,!0);var P=this.listComponent.getValue();return P===this.getValue()?this:(this.eDisplayField.innerHTML=this.listComponent.getDisplayValue(),M.prototype.setValue.call(this,h,g))},f.prototype.destroy=function(){this.hideList&&this.hideList(),this.destroyBean(this.listComponent),M.prototype.destroy.call(this)},S4([ce("popupService")],f.prototype,"popupService",void 0),S4([it],f.prototype,"init",null),f}(Mu);/** + */var oz=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),E4=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},QS=function(M){oz(f,M);function f(d){return M.call(this,d,"ag-select","smallDown","listbox")||this}return f.prototype.init=function(){var d=this;this.listComponent=this.createBean(new ZS("select")),this.listComponent.setParentComponent(this),this.eWrapper.tabIndex=0,this.listComponent.addManagedListener(this.listComponent,ZS.EVENT_ITEM_SELECTED,function(){d.hideList&&d.hideList()}),this.listComponent.addManagedListener(this.listComponent,Rf.EVENT_CHANGED,function(){d.setValue(d.listComponent.getValue(),!1,!0),d.hideList&&d.hideList()})},f.prototype.showPicker=function(){var d=this,g=this.listComponent.getGui(),S=this.gridOptionsWrapper.getDocument(),O=this.addManagedListener(S.body,"wheel",function(Ue){!g.contains(Ue.target)&&d.hideList&&d.hideList()}),z=this.addManagedListener(g,"focusout",function(Ue){!g.contains(Ue.relatedTarget)&&d.hideList&&d.hideList()}),te=this.gridOptionsWrapper.getLocaleTextFunc(),Fe=this.popupService.addPopup({modal:!0,eChild:g,closeOnEsc:!0,closedCallback:function(){d.hideList=null,d.isPickerDisplayed=!1,z(),O(),d.isAlive()&&(Oo(d.eWrapper,!1),d.getFocusableElement().focus())},ariaLabel:te("ariaLabelSelectField","Select Field")});return Fe&&(this.hideList=Fe.hideFunc),this.isPickerDisplayed=!0,qt(g,Ep(this.eWrapper)),Oo(this.eWrapper,!0),g.style.maxHeight=of(this.popupService.getPopupParent())+"px",g.style.position="absolute",this.popupService.positionPopupUnderComponent({type:"ag-list",eventSource:this.eWrapper,ePopup:g,keepWithinBounds:!0}),this.listComponent.refreshHighlighted(),this.listComponent},f.prototype.addOptions=function(d){var g=this;return d.forEach(function(S){return g.addOption(S)}),this},f.prototype.addOption=function(d){return this.listComponent.addOption(d),this},f.prototype.setValue=function(d,g,S){if(this.value===d)return this;S||this.listComponent.setValue(d,!0);var O=this.listComponent.getValue();return O===this.getValue()?this:(this.eDisplayField.innerHTML=this.listComponent.getDisplayValue(),M.prototype.setValue.call(this,d,g))},f.prototype.destroy=function(){this.hideList&&this.hideList(),this.destroyBean(this.listComponent),M.prototype.destroy.call(this)},E4([pe("popupService")],f.prototype,"popupService",void 0),E4([ht],f.prototype,"init",null),f}(uh);/** * @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/ * @license MIT - */var C4=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),xI=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},m1=function(M){C4(f,M);function f(h,g,x,P){x===void 0&&(x="text"),P===void 0&&(P="input");var z=M.call(this,h,` + */var I4=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),wI=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},_1=function(M){I4(f,M);function f(d,g,S,O){S===void 0&&(S="text"),O===void 0&&(O="input");var z=M.call(this,d,`
-
`,g)||this;return z.inputType=x,z.displayFieldTag=P,z}return f.prototype.postConstruct=function(){M.prototype.postConstruct.call(this),this.setInputType(),this.eLabel.classList.add(this.className+"-label"),this.eWrapper.classList.add(this.className+"-input-wrapper"),this.eInput.classList.add(this.className+"-input"),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||"ag-"+this.getCompId()+"-input";var h=this.config,g=h.width,x=h.value;g!=null&&this.setWidth(g),x!=null&&this.setValue(x),this.addInputListeners()},f.prototype.refreshLabel=function(){i(this.getLabel())?Ds(this.eInput,this.getLabelId()):this.eInput.removeAttribute("aria-labelledby"),M.prototype.refreshLabel.call(this)},f.prototype.addInputListeners=function(){var h=this;this.addManagedListener(this.eInput,"input",function(g){return h.setValue(g.target.value)})},f.prototype.setInputType=function(){this.displayFieldTag==="input"&&this.eInput.setAttribute("type",this.inputType)},f.prototype.getInputElement=function(){return this.eInput},f.prototype.setInputWidth=function(h){return Ht(this.eWrapper,h),this},f.prototype.setInputName=function(h){return this.getInputElement().setAttribute("name",h),this},f.prototype.getFocusableElement=function(){return this.eInput},f.prototype.setMaxLength=function(h){var g=this.eInput;return g.maxLength=h,this},f.prototype.setInputPlaceholder=function(h){return me(this.eInput,"placeholder",h),this},f.prototype.setInputAriaLabel=function(h){return kn(this.eInput,h),this},f.prototype.setDisabled=function(h){return dh(this.eInput,h),M.prototype.setDisabled.call(this,h)},xI([zr("eLabel")],f.prototype,"eLabel",void 0),xI([zr("eWrapper")],f.prototype,"eWrapper",void 0),xI([zr("eInput")],f.prototype,"eInput",void 0),f}(rf);/** +
`,g)||this;return z.inputType=S,z.displayFieldTag=O,z}return f.prototype.postConstruct=function(){M.prototype.postConstruct.call(this),this.setInputType(),this.eLabel.classList.add(this.className+"-label"),this.eWrapper.classList.add(this.className+"-input-wrapper"),this.eInput.classList.add(this.className+"-input"),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||"ag-"+this.getCompId()+"-input";var d=this.config,g=d.width,S=d.value;g!=null&&this.setWidth(g),S!=null&&this.setValue(S),this.addInputListeners()},f.prototype.refreshLabel=function(){i(this.getLabel())?Hs(this.eInput,this.getLabelId()):this.eInput.removeAttribute("aria-labelledby"),M.prototype.refreshLabel.call(this)},f.prototype.addInputListeners=function(){var d=this;this.addManagedListener(this.eInput,"input",function(g){return d.setValue(g.target.value)})},f.prototype.setInputType=function(){this.displayFieldTag==="input"&&this.eInput.setAttribute("type",this.inputType)},f.prototype.getInputElement=function(){return this.eInput},f.prototype.setInputWidth=function(d){return qt(this.eWrapper,d),this},f.prototype.setInputName=function(d){return this.getInputElement().setAttribute("name",d),this},f.prototype.getFocusableElement=function(){return this.eInput},f.prototype.setMaxLength=function(d){var g=this.eInput;return g.maxLength=d,this},f.prototype.setInputPlaceholder=function(d){return ge(this.eInput,"placeholder",d),this},f.prototype.setInputAriaLabel=function(d){return Jn(this.eInput,d),this},f.prototype.setDisabled=function(d){return gh(this.eInput,d),M.prototype.setDisabled.call(this,d)},wI([tn("eLabel")],f.prototype,"eLabel",void 0),wI([tn("eWrapper")],f.prototype,"eWrapper",void 0),wI([tn("eInput")],f.prototype,"eInput",void 0),f}(Rf);/** * @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/ * @license MIT - */var az=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Lb=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Jd;(function(M){M[M.One=0]="One",M[M.Two=1]="Two"})(Jd||(Jd={}));var Nh=function(M){az(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.getNumberOfInputs=function(h){var g=this.optionsFactory.getCustomOption(h);if(g){var x=g.numberOfInputs;return x??1}var P=[f.EMPTY,f.NOT_BLANK,f.BLANK];return h&&P.indexOf(h)>=0?0:h===f.IN_RANGE?2:1},f.prototype.onFloatingFilterChanged=function(h,g){this.setTypeFromFloatingFilter(h),this.setValueFromFloatingFilter(g),this.onUiChanged(!0)},f.prototype.setTypeFromFloatingFilter=function(h){this.eType1.setValue(h),this.eType2.setValue(this.optionsFactory.getDefaultOption()),(this.isDefaultOperator("AND")?this.eJoinOperatorAnd:this.eJoinOperatorOr).setValue(!0)},f.prototype.getModelFromUi=function(){return this.isConditionUiComplete(Jd.One)?this.isAllowTwoConditions()&&this.isConditionUiComplete(Jd.Two)?{filterType:this.getFilterType(),operator:this.getJoinOperator(),condition1:this.createCondition(Jd.One),condition2:this.createCondition(Jd.Two)}:this.createCondition(Jd.One):null},f.prototype.getConditionTypes=function(){return[this.eType1.getValue(),this.eType2.getValue()]},f.prototype.getJoinOperator=function(){return this.eJoinOperatorOr.getValue()===!0?"OR":"AND"},f.prototype.areModelsEqual=function(h,g){if(!h&&!g)return!0;if(!h&&g||h&&!g)return!1;var x=!h.operator,P=!g.operator,z=!x&&P||x&&!P;if(z)return!1;var ee;if(x){var Me=h,je=g;ee=this.areSimpleModelsEqual(Me,je)}else{var ut=h,Rt=g;ee=ut.operator===Rt.operator&&this.areSimpleModelsEqual(ut.condition1,Rt.condition1)&&this.areSimpleModelsEqual(ut.condition2,Rt.condition2)}return ee},f.prototype.setModelIntoUi=function(h){var g=h.operator;if(g){var x=h,P=x.operator==="OR";this.eJoinOperatorAnd.setValue(!P),this.eJoinOperatorOr.setValue(P),this.eType1.setValue(x.condition1.type),this.eType2.setValue(x.condition2.type),this.setConditionIntoUi(x.condition1,Jd.One),this.setConditionIntoUi(x.condition2,Jd.Two)}else{var z=h;this.eJoinOperatorAnd.setValue(this.isDefaultOperator("AND")),this.eJoinOperatorOr.setValue(this.isDefaultOperator("OR")),this.eType1.setValue(z.type),this.eType2.setValue(this.optionsFactory.getDefaultOption()),this.setConditionIntoUi(z,Jd.One),this.setConditionIntoUi(null,Jd.Two)}return Km.resolve()},f.prototype.doesFilterPass=function(h){var g=this,x=this.getModel();if(x==null)return!0;var P=x.operator,z=[];if(P){var ee=x;z.push(ee.condition1,ee.condition2)}else z.push(x);var Me=P&&P==="OR"?"some":"every";return z[Me](function(je){return g.individualConditionPasses(h,je)})},f.prototype.setParams=function(h){M.prototype.setParams.call(this,h),this.optionsFactory=new B$,this.optionsFactory.init(h,this.getDefaultFilterOptions()),this.allowTwoConditions=!h.suppressAndOrCondition,this.alwaysShowBothConditions=!!h.alwaysShowBothConditions,this.defaultJoinOperator=this.getDefaultJoinOperator(h.defaultJoinOperator),this.putOptionsIntoDropdown(),this.addChangedListeners()},f.prototype.getDefaultJoinOperator=function(h){return De(["AND","OR"],h)?h:"AND"},f.prototype.putOptionsIntoDropdown=function(){var h=this,g=this.optionsFactory.getFilterOptions(),x=[this.eType1,this.eType2];g.forEach(function(P){var z=typeof P=="string"?h.createBoilerplateListOption(P):h.createCustomListOption(P);x.forEach(function(ee){return ee.addOption(z)})}),x.forEach(function(P){return P.setDisabled(g.length<=1)})},f.prototype.createBoilerplateListOption=function(h){return{value:h,text:this.translate(h)}},f.prototype.createCustomListOption=function(h){var g=h.displayKey,x=this.optionsFactory.getCustomOption(h.displayKey);return{value:g,text:x?this.gridOptionsWrapper.getLocaleTextFunc()(x.displayKey,x.displayName):this.translate(g)}},f.prototype.isAllowTwoConditions=function(){return this.allowTwoConditions},f.prototype.createBodyTemplate=function(){return` + */var az=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),$b=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},np;(function(M){M[M.One=0]="One",M[M.Two=1]="Two"})(np||(np={}));var Vh=function(M){az(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.getNumberOfInputs=function(d){var g=this.optionsFactory.getCustomOption(d);if(g){var S=g.numberOfInputs;return S??1}var O=[f.EMPTY,f.NOT_BLANK,f.BLANK];return d&&O.indexOf(d)>=0?0:d===f.IN_RANGE?2:1},f.prototype.onFloatingFilterChanged=function(d,g){this.setTypeFromFloatingFilter(d),this.setValueFromFloatingFilter(g),this.onUiChanged(!0)},f.prototype.setTypeFromFloatingFilter=function(d){this.eType1.setValue(d),this.eType2.setValue(this.optionsFactory.getDefaultOption()),(this.isDefaultOperator("AND")?this.eJoinOperatorAnd:this.eJoinOperatorOr).setValue(!0)},f.prototype.getModelFromUi=function(){return this.isConditionUiComplete(np.One)?this.isAllowTwoConditions()&&this.isConditionUiComplete(np.Two)?{filterType:this.getFilterType(),operator:this.getJoinOperator(),condition1:this.createCondition(np.One),condition2:this.createCondition(np.Two)}:this.createCondition(np.One):null},f.prototype.getConditionTypes=function(){return[this.eType1.getValue(),this.eType2.getValue()]},f.prototype.getJoinOperator=function(){return this.eJoinOperatorOr.getValue()===!0?"OR":"AND"},f.prototype.areModelsEqual=function(d,g){if(!d&&!g)return!0;if(!d&&g||d&&!g)return!1;var S=!d.operator,O=!g.operator,z=!S&&O||S&&!O;if(z)return!1;var te;if(S){var Fe=d,Ue=g;te=this.areSimpleModelsEqual(Fe,Ue)}else{var ut=d,Mt=g;te=ut.operator===Mt.operator&&this.areSimpleModelsEqual(ut.condition1,Mt.condition1)&&this.areSimpleModelsEqual(ut.condition2,Mt.condition2)}return te},f.prototype.setModelIntoUi=function(d){var g=d.operator;if(g){var S=d,O=S.operator==="OR";this.eJoinOperatorAnd.setValue(!O),this.eJoinOperatorOr.setValue(O),this.eType1.setValue(S.condition1.type),this.eType2.setValue(S.condition2.type),this.setConditionIntoUi(S.condition1,np.One),this.setConditionIntoUi(S.condition2,np.Two)}else{var z=d;this.eJoinOperatorAnd.setValue(this.isDefaultOperator("AND")),this.eJoinOperatorOr.setValue(this.isDefaultOperator("OR")),this.eType1.setValue(z.type),this.eType2.setValue(this.optionsFactory.getDefaultOption()),this.setConditionIntoUi(z,np.One),this.setConditionIntoUi(null,np.Two)}return Qm.resolve()},f.prototype.doesFilterPass=function(d){var g=this,S=this.getModel();if(S==null)return!0;var O=S.operator,z=[];if(O){var te=S;z.push(te.condition1,te.condition2)}else z.push(S);var Fe=O&&O==="OR"?"some":"every";return z[Fe](function(Ue){return g.individualConditionPasses(d,Ue)})},f.prototype.setParams=function(d){M.prototype.setParams.call(this,d),this.optionsFactory=new k$,this.optionsFactory.init(d,this.getDefaultFilterOptions()),this.allowTwoConditions=!d.suppressAndOrCondition,this.alwaysShowBothConditions=!!d.alwaysShowBothConditions,this.defaultJoinOperator=this.getDefaultJoinOperator(d.defaultJoinOperator),this.putOptionsIntoDropdown(),this.addChangedListeners()},f.prototype.getDefaultJoinOperator=function(d){return Me(["AND","OR"],d)?d:"AND"},f.prototype.putOptionsIntoDropdown=function(){var d=this,g=this.optionsFactory.getFilterOptions(),S=[this.eType1,this.eType2];g.forEach(function(O){var z=typeof O=="string"?d.createBoilerplateListOption(O):d.createCustomListOption(O);S.forEach(function(te){return te.addOption(z)})}),S.forEach(function(O){return O.setDisabled(g.length<=1)})},f.prototype.createBoilerplateListOption=function(d){return{value:d,text:this.translate(d)}},f.prototype.createCustomListOption=function(d){var g=d.displayKey,S=this.optionsFactory.getCustomOption(d.displayKey);return{value:g,text:S?this.gridOptionsWrapper.getLocaleTextFunc()(S.displayKey,S.displayName):this.translate(g)}},f.prototype.isAllowTwoConditions=function(){return this.allowTwoConditions},f.prototype.createBodyTemplate=function(){return` - `+this.createValueTemplate(Jd.One)+` + `+this.createValueTemplate(np.One)+`
- `+this.createValueTemplate(Jd.Two)},f.prototype.getCssIdentifier=function(){return"simple-filter"},f.prototype.updateUiVisibility=function(){var h=this,g=[[this.eType1],[this.eType2,this.eJoinOperatorPanel,this.eJoinOperatorAnd,this.eJoinOperatorOr]],x=[this.eCondition1Body,this.eCondition2Body];g.forEach(function(P,z){var ee=h.isConditionVisible(z),Me=h.isConditionDisabled(z);P.forEach(function(je){je instanceof m1||je instanceof eC?(je.setDisabled(Me),je.setDisplayed(ee)):(dh(je,Me),dl(je,ee))})}),x.forEach(function(P,z){dl(P,h.isConditionBodyVisible(z))}),this.forEachInput(function(P,z,ee,Me){h.setElementDisplayed(P,z1?"inRangeStart":P===0?"filterOoo":"inRangeEnd",je=P===0&&ee>1?g("ariaFilterFromValue","Filter from value"):P===0?g("ariaFilterValue","Filter Value"):g("ariaFilterToValue","Filter to Value");x.setInputPlaceholder(h.translate(Me)),x.setInputAriaLabel(je)}})},f.prototype.setElementValue=function(h,g,x){h instanceof m1&&h.setValue(g!=null?String(g):null,x)},f.prototype.setElementDisplayed=function(h,g){h instanceof Sa&&dl(h.getGui(),g)},f.prototype.setElementDisabled=function(h,g){h instanceof Sa&&dh(h.getGui(),g)},f.prototype.attachElementOnChange=function(h,g){h instanceof m1&&h.onValueChange(g)},f.prototype.forEachInput=function(h){var g=this,x=this.getInputs();this.getConditionTypes().forEach(function(P,z){for(var ee=g.getNumberOfInputs(P),Me=0;Me0},f.prototype.isConditionUiComplete=function(h){var g=this.getConditionTypes()[h];return!(g===f.EMPTY||this.getValues(h).some(function(x){return x==null}))},f.prototype.resetUiToDefaults=function(h){var g=this,x=this.gridOptionsWrapper.getLocaleTextFunc(),P=x("ariaFilteringOperator","Filtering operator"),z="ag-simple-filter-and-or-"+this.getCompId(),ee=this.optionsFactory.getDefaultOption();return this.eType1.setValue(ee,h).setAriaLabel(P).setDisabled(this.isReadOnly()),this.eType2.setValue(this.optionsFactory.getDefaultOption(),h).setAriaLabel(P).setDisabled(this.isReadOnly()),this.eJoinOperatorAnd.setValue(this.isDefaultOperator("AND"),h).setName(z).setLabel(this.translate("andCondition")).setDisabled(this.isReadOnly()),this.eJoinOperatorOr.setValue(this.isDefaultOperator("OR"),h).setName(z).setLabel(this.translate("orCondition")).setDisabled(this.isReadOnly()),this.forEachInput(function(Me){g.setElementValue(Me,null,h),g.setElementDisabled(Me,g.isReadOnly())}),this.resetPlaceholder(),Km.resolve()},f.prototype.setConditionIntoUi=function(h,g){var x=this,P=this.mapValuesFromModel(h);this.forEachInput(function(z,ee,Me,je){Me===g&&x.setElementValue(z,P[ee]!=null?P[ee]:null)})},f.prototype.setValueFromFloatingFilter=function(h){var g=this;this.forEachInput(function(x,P,z,ee){g.setElementValue(x,P===0&&z===0?h:null)})},f.prototype.isDefaultOperator=function(h){return h===this.defaultJoinOperator},f.prototype.addChangedListeners=function(){var h=this;if(!this.isReadOnly()){var g=function(){return h.onUiChanged()};this.eType1.onValueChange(g),this.eType2.onValueChange(g),this.eJoinOperatorOr.onValueChange(g),this.eJoinOperatorAnd.onValueChange(g),this.forEachInput(function(x){h.attachElementOnChange(x,g)})}},f.prototype.individualConditionPasses=function(h,g){var x=this.getCellValue(h.node),P=this.mapValuesFromModel(g),z=this.optionsFactory.getCustomOption(g.type),ee=this.evaluateCustomFilter(z,P,x);return ee??(x==null?this.evaluateNullValue(g.type):this.evaluateNonNullValue(P,x,g,h))},f.prototype.evaluateCustomFilter=function(h,g,x){if(h!=null){var P=h.predicate;if(P!=null&&!g.some(function(z){return z==null}))return P(g,x)}},f.prototype.isBlank=function(h){return h==null||typeof h=="string"&&h.trim().length===0},f.EMPTY="empty",f.BLANK="blank",f.NOT_BLANK="notBlank",f.EQUALS="equals",f.NOT_EQUAL="notEqual",f.LESS_THAN="lessThan",f.LESS_THAN_OR_EQUAL="lessThanOrEqual",f.GREATER_THAN="greaterThan",f.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",f.IN_RANGE="inRange",f.CONTAINS="contains",f.NOT_CONTAINS="notContains",f.STARTS_WITH="startsWith",f.ENDS_WITH="endsWith",Lb([zr("eOptions1")],f.prototype,"eType1",void 0),Lb([zr("eOptions2")],f.prototype,"eType2",void 0),Lb([zr("eJoinOperatorPanel")],f.prototype,"eJoinOperatorPanel",void 0),Lb([zr("eJoinOperatorAnd")],f.prototype,"eJoinOperatorAnd",void 0),Lb([zr("eJoinOperatorOr")],f.prototype,"eJoinOperatorOr",void 0),Lb([zr("eCondition1Body")],f.prototype,"eCondition1Body",void 0),Lb([zr("eCondition2Body")],f.prototype,"eCondition2Body",void 0),f}(bI);/** + `+this.createValueTemplate(np.Two)},f.prototype.getCssIdentifier=function(){return"simple-filter"},f.prototype.updateUiVisibility=function(){var d=this,g=[[this.eType1],[this.eType2,this.eJoinOperatorPanel,this.eJoinOperatorAnd,this.eJoinOperatorOr]],S=[this.eCondition1Body,this.eCondition2Body];g.forEach(function(O,z){var te=d.isConditionVisible(z),Fe=d.isConditionDisabled(z);O.forEach(function(Ue){Ue instanceof _1||Ue instanceof QS?(Ue.setDisabled(Fe),Ue.setDisplayed(te)):(gh(Ue,Fe),wl(Ue,te))})}),S.forEach(function(O,z){wl(O,d.isConditionBodyVisible(z))}),this.forEachInput(function(O,z,te,Fe){d.setElementDisplayed(O,z1?"inRangeStart":O===0?"filterOoo":"inRangeEnd",Ue=O===0&&te>1?g("ariaFilterFromValue","Filter from value"):O===0?g("ariaFilterValue","Filter Value"):g("ariaFilterToValue","Filter to Value");S.setInputPlaceholder(d.translate(Fe)),S.setInputAriaLabel(Ue)}})},f.prototype.setElementValue=function(d,g,S){d instanceof _1&&d.setValue(g!=null?String(g):null,S)},f.prototype.setElementDisplayed=function(d,g){d instanceof Ma&&wl(d.getGui(),g)},f.prototype.setElementDisabled=function(d,g){d instanceof Ma&&gh(d.getGui(),g)},f.prototype.attachElementOnChange=function(d,g){d instanceof _1&&d.onValueChange(g)},f.prototype.forEachInput=function(d){var g=this,S=this.getInputs();this.getConditionTypes().forEach(function(O,z){for(var te=g.getNumberOfInputs(O),Fe=0;Fe0},f.prototype.isConditionUiComplete=function(d){var g=this.getConditionTypes()[d];return!(g===f.EMPTY||this.getValues(d).some(function(S){return S==null}))},f.prototype.resetUiToDefaults=function(d){var g=this,S=this.gridOptionsWrapper.getLocaleTextFunc(),O=S("ariaFilteringOperator","Filtering operator"),z="ag-simple-filter-and-or-"+this.getCompId(),te=this.optionsFactory.getDefaultOption();return this.eType1.setValue(te,d).setAriaLabel(O).setDisabled(this.isReadOnly()),this.eType2.setValue(this.optionsFactory.getDefaultOption(),d).setAriaLabel(O).setDisabled(this.isReadOnly()),this.eJoinOperatorAnd.setValue(this.isDefaultOperator("AND"),d).setName(z).setLabel(this.translate("andCondition")).setDisabled(this.isReadOnly()),this.eJoinOperatorOr.setValue(this.isDefaultOperator("OR"),d).setName(z).setLabel(this.translate("orCondition")).setDisabled(this.isReadOnly()),this.forEachInput(function(Fe){g.setElementValue(Fe,null,d),g.setElementDisabled(Fe,g.isReadOnly())}),this.resetPlaceholder(),Qm.resolve()},f.prototype.setConditionIntoUi=function(d,g){var S=this,O=this.mapValuesFromModel(d);this.forEachInput(function(z,te,Fe,Ue){Fe===g&&S.setElementValue(z,O[te]!=null?O[te]:null)})},f.prototype.setValueFromFloatingFilter=function(d){var g=this;this.forEachInput(function(S,O,z,te){g.setElementValue(S,O===0&&z===0?d:null)})},f.prototype.isDefaultOperator=function(d){return d===this.defaultJoinOperator},f.prototype.addChangedListeners=function(){var d=this;if(!this.isReadOnly()){var g=function(){return d.onUiChanged()};this.eType1.onValueChange(g),this.eType2.onValueChange(g),this.eJoinOperatorOr.onValueChange(g),this.eJoinOperatorAnd.onValueChange(g),this.forEachInput(function(S){d.attachElementOnChange(S,g)})}},f.prototype.individualConditionPasses=function(d,g){var S=this.getCellValue(d.node),O=this.mapValuesFromModel(g),z=this.optionsFactory.getCustomOption(g.type),te=this.evaluateCustomFilter(z,O,S);return te??(S==null?this.evaluateNullValue(g.type):this.evaluateNonNullValue(O,S,g,d))},f.prototype.evaluateCustomFilter=function(d,g,S){if(d!=null){var O=d.predicate;if(O!=null&&!g.some(function(z){return z==null}))return O(g,S)}},f.prototype.isBlank=function(d){return d==null||typeof d=="string"&&d.trim().length===0},f.EMPTY="empty",f.BLANK="blank",f.NOT_BLANK="notBlank",f.EQUALS="equals",f.NOT_EQUAL="notEqual",f.LESS_THAN="lessThan",f.LESS_THAN_OR_EQUAL="lessThanOrEqual",f.GREATER_THAN="greaterThan",f.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",f.IN_RANGE="inRange",f.CONTAINS="contains",f.NOT_CONTAINS="notContains",f.STARTS_WITH="startsWith",f.ENDS_WITH="endsWith",$b([tn("eOptions1")],f.prototype,"eType1",void 0),$b([tn("eOptions2")],f.prototype,"eType2",void 0),$b([tn("eJoinOperatorPanel")],f.prototype,"eJoinOperatorPanel",void 0),$b([tn("eJoinOperatorAnd")],f.prototype,"eJoinOperatorAnd",void 0),$b([tn("eJoinOperatorOr")],f.prototype,"eJoinOperatorOr",void 0),$b([tn("eCondition1Body")],f.prototype,"eCondition1Body",void 0),$b([tn("eCondition2Body")],f.prototype,"eCondition2Body",void 0),f}(_I);/** * @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/ * @license MIT - */var j$=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Ns=function(M){j$(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.setParams=function(h){M.prototype.setParams.call(this,h),this.scalarFilterParams=h},f.prototype.evaluateNullValue=function(h){switch(h){case f.EQUALS:case f.NOT_EQUAL:if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case f.GREATER_THAN:case f.GREATER_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case f.LESS_THAN:case f.LESS_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case f.IN_RANGE:if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case f.BLANK:return!0;case f.NOT_BLANK:return!1}return!1},f.prototype.evaluateNonNullValue=function(h,g,x){var P=this.comparator(),z=h[0]!=null?P(h[0],g):0;switch(x.type){case f.EQUALS:return z===0;case f.NOT_EQUAL:return z!==0;case f.GREATER_THAN:return z>0;case f.GREATER_THAN_OR_EQUAL:return z>=0;case f.LESS_THAN:return z<0;case f.LESS_THAN_OR_EQUAL:return z<=0;case f.IN_RANGE:{var ee=P(h[1],g);return this.scalarFilterParams.inRangeInclusive?z>=0&&ee<=0:z>0&&ee<0}case f.BLANK:return this.isBlank(g);case f.NOT_BLANK:return!this.isBlank(g);default:return console.warn('AG Grid: Unexpected type of filter "'+x.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}},f}(Nh);/** + */var j$=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Ys=function(M){j$(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.setParams=function(d){M.prototype.setParams.call(this,d),this.scalarFilterParams=d},f.prototype.evaluateNullValue=function(d){switch(d){case f.EQUALS:case f.NOT_EQUAL:if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case f.GREATER_THAN:case f.GREATER_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case f.LESS_THAN:case f.LESS_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case f.IN_RANGE:if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case f.BLANK:return!0;case f.NOT_BLANK:return!1}return!1},f.prototype.evaluateNonNullValue=function(d,g,S){var O=this.comparator(),z=d[0]!=null?O(d[0],g):0;switch(S.type){case f.EQUALS:return z===0;case f.NOT_EQUAL:return z!==0;case f.GREATER_THAN:return z>0;case f.GREATER_THAN_OR_EQUAL:return z>=0;case f.LESS_THAN:return z<0;case f.LESS_THAN_OR_EQUAL:return z<=0;case f.IN_RANGE:{var te=O(d[1],g);return this.scalarFilterParams.inRangeInclusive?z>=0&&te<=0:z>0&&te<0}case f.BLANK:return this.isBlank(g);case f.NOT_BLANK:return!this.isBlank(g);default:return console.warn('AG Grid: Unexpected type of filter "'+S.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}},f}(Vh);/** * @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/ * @license MIT - */var lz=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),z$=function(){return z$=Object.assign||function(M){for(var f,h=1,g=arguments.length;h=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},v3=1e3,_3=1/0,tC=function(M){lz(f,M);function f(){var h=M.call(this,"dateFilter")||this;return h.minValidYear=v3,h.maxValidYear=_3,h}return f.prototype.afterGuiAttached=function(h){M.prototype.afterGuiAttached.call(this,h),this.dateCondition1FromComp.afterGuiAttached(h)},f.prototype.mapValuesFromModel=function(h){var g=h||{},x=g.dateFrom,P=g.dateTo,z=g.type;return[x&&gs(x)||null,P&&gs(P)||null].slice(0,this.getNumberOfInputs(z))},f.prototype.comparator=function(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)},f.prototype.defaultComparator=function(h,g){var x=g;return g==null||xh?1:0},f.prototype.setParams=function(h){M.prototype.setParams.call(this,h),this.dateFilterParams=h;var g=function(x,P){if(h[x]!=null)if(isNaN(h[x]))console.warn("AG Grid: DateFilter "+x+" is not a number");else return h[x]==null?P:Number(h[x]);return P};this.minValidYear=g("minValidYear",v3),this.maxValidYear=g("maxValidYear",_3),this.minValidYear>this.maxValidYear&&console.warn("AG Grid: DateFilter minValidYear should be <= maxValidYear"),this.createDateComponents()},f.prototype.createDateComponents=function(){var h=this,g=function(x){return new g3(h.getContext(),h.userComponentFactory,{onDateChanged:function(){return h.onUiChanged()},filterParams:h.dateFilterParams},x)};this.dateCondition1FromComp=g(this.eCondition1PanelFrom),this.dateCondition1ToComp=g(this.eCondition1PanelTo),this.dateCondition2FromComp=g(this.eCondition2PanelFrom),this.dateCondition2ToComp=g(this.eCondition2PanelTo),this.addDestroyFunc(function(){h.forEachInput(function(x){return x.destroy()})})},f.prototype.setElementValue=function(h,g,x){h.setDate(g)},f.prototype.setElementDisplayed=function(h,g){h.setDisplayed(g)},f.prototype.setElementDisabled=function(h,g){h.setDisabled(g)},f.prototype.getDefaultFilterOptions=function(){return f.DEFAULT_FILTER_OPTIONS},f.prototype.createValueTemplate=function(h){var g=h===Jd.One?"1":"2";return` + */var lz=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),G$=function(){return G$=Object.assign||function(M){for(var f,d=1,g=arguments.length;d=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},v3=1e3,_3=1/0,SI=function(M){lz(f,M);function f(){var d=M.call(this,"dateFilter")||this;return d.minValidYear=v3,d.maxValidYear=_3,d}return f.prototype.afterGuiAttached=function(d){M.prototype.afterGuiAttached.call(this,d),this.dateCondition1FromComp.afterGuiAttached(d)},f.prototype.mapValuesFromModel=function(d){var g=d||{},S=g.dateFrom,O=g.dateTo,z=g.type;return[S&&Rs(S)||null,O&&Rs(O)||null].slice(0,this.getNumberOfInputs(z))},f.prototype.comparator=function(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)},f.prototype.defaultComparator=function(d,g){var S=g;return g==null||Sd?1:0},f.prototype.setParams=function(d){M.prototype.setParams.call(this,d),this.dateFilterParams=d;var g=function(S,O){if(d[S]!=null)if(isNaN(d[S]))console.warn("AG Grid: DateFilter "+S+" is not a number");else return d[S]==null?O:Number(d[S]);return O};this.minValidYear=g("minValidYear",v3),this.maxValidYear=g("maxValidYear",_3),this.minValidYear>this.maxValidYear&&console.warn("AG Grid: DateFilter minValidYear should be <= maxValidYear"),this.createDateComponents()},f.prototype.createDateComponents=function(){var d=this,g=function(S){return new g3(d.getContext(),d.userComponentFactory,{onDateChanged:function(){return d.onUiChanged()},filterParams:d.dateFilterParams},S)};this.dateCondition1FromComp=g(this.eCondition1PanelFrom),this.dateCondition1ToComp=g(this.eCondition1PanelTo),this.dateCondition2FromComp=g(this.eCondition2PanelFrom),this.dateCondition2ToComp=g(this.eCondition2PanelTo),this.addDestroyFunc(function(){d.forEachInput(function(S){return S.destroy()})})},f.prototype.setElementValue=function(d,g,S){d.setDate(g)},f.prototype.setElementDisplayed=function(d,g){d.setDisplayed(g)},f.prototype.setElementDisabled=function(d,g){d.setDisabled(g)},f.prototype.getDefaultFilterOptions=function(){return f.DEFAULT_FILTER_OPTIONS},f.prototype.createValueTemplate=function(d){var g=d===np.One?"1":"2";return`
-
`},f.prototype.isConditionUiComplete=function(h){var g=this;if(!M.prototype.isConditionUiComplete.call(this,h))return!1;var x=function(z){return z!=null&&z.getUTCFullYear()>=g.minValidYear&&z.getUTCFullYear()<=g.maxValidYear},P=!0;return this.forEachInput(function(z,ee,Me,je){Me!==h||!P||ee>=je||(P=P&&x(z.getDate()))}),P},f.prototype.areSimpleModelsEqual=function(h,g){return h.dateFrom===g.dateFrom&&h.dateTo===g.dateTo&&h.type===g.type},f.prototype.getFilterType=function(){return"date"},f.prototype.createCondition=function(h){var g=this.getConditionTypes()[h],x={},P=this.getValues(h);return P.length>0&&(x.dateFrom=ms(P[0])),P.length>1&&(x.dateTo=ms(P[1])),z$({dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:g},x)},f.prototype.resetPlaceholder=function(){var h=this.gridOptionsWrapper.getLocaleTextFunc(),g=this.translate("dateFormatOoo"),x=h("ariaFilterValue","Filter Value");this.forEachInput(function(P){P.setInputPlaceholder(g),P.setInputAriaLabel(x)})},f.prototype.getInputs=function(){return[[this.dateCondition1FromComp,this.dateCondition1ToComp],[this.dateCondition2FromComp,this.dateCondition2ToComp]]},f.prototype.getValues=function(h){var g=[];return this.forEachInput(function(x,P,z,ee){h===z&&P`},f.prototype.isConditionUiComplete=function(d){var g=this;if(!M.prototype.isConditionUiComplete.call(this,d))return!1;var S=function(z){return z!=null&&z.getUTCFullYear()>=g.minValidYear&&z.getUTCFullYear()<=g.maxValidYear},O=!0;return this.forEachInput(function(z,te,Fe,Ue){Fe!==d||!O||te>=Ue||(O=O&&S(z.getDate()))}),O},f.prototype.areSimpleModelsEqual=function(d,g){return d.dateFrom===g.dateFrom&&d.dateTo===g.dateTo&&d.type===g.type},f.prototype.getFilterType=function(){return"date"},f.prototype.createCondition=function(d){var g=this.getConditionTypes()[d],S={},O=this.getValues(d);return O.length>0&&(S.dateFrom=Os(O[0])),O.length>1&&(S.dateTo=Os(O[1])),G$({dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:g},S)},f.prototype.resetPlaceholder=function(){var d=this.gridOptionsWrapper.getLocaleTextFunc(),g=this.translate("dateFormatOoo"),S=d("ariaFilterValue","Filter Value");this.forEachInput(function(O){O.setInputPlaceholder(g),O.setInputAriaLabel(S)})},f.prototype.getInputs=function(){return[[this.dateCondition1FromComp,this.dateCondition1ToComp],[this.dateCondition2FromComp,this.dateCondition2ToComp]]},f.prototype.getValues=function(d){var g=[];return this.forEachInput(function(S,O,z,te){d===z&&O=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},b3=function(M){$a(f,M);function f(){return M.call(this,` + */var Wa=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Fx=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},b3=function(M){Wa(f,M);function f(){return M.call(this,` `)||this}return f.prototype.getDefaultFilterOptions=function(){return tC.DEFAULT_FILTER_OPTIONS},f.prototype.conditionToString=function(h,g){var x=h.type,P=(g||{}).numberOfInputs,z=x==Nh.IN_RANGE||P===2,ee=gs(h.dateFrom),Me=gs(h.dateTo);return z?ms(ee,!1)+"-"+ms(Me,!1):ee!=null?""+ms(ee,!1):""+x},f.prototype.init=function(h){M.prototype.init.call(this,h),this.params=h,this.createDateComponent();var g=this.gridOptionsWrapper.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(g("ariaDateFilterInput","Date Filter Input"))},f.prototype.setEditable=function(h){dl(this.eDateWrapper,h),dl(this.eReadOnlyText.getGui(),!h)},f.prototype.onParentModelChanged=function(h,g){if(!this.isEventFromFloatingFilter(g)){M.prototype.setLastTypeFromModel.call(this,h);var x=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(h);if(this.setEditable(x),x){if(h){var P=h;this.dateComp.setDate(gs(P.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.getTextFromModel(h)),this.dateComp.setDate(null)}},f.prototype.onDateChanged=function(){var h=this,g=this.dateComp.getDate(),x=ms(g);this.params.parentFilterInstance(function(P){if(P){var z=gs(x);P.onFloatingFilterChanged(h.getLastType()||null,z)}})},f.prototype.createDateComponent=function(){var h=this,g=bI.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),x={onDateChanged:Tt(this.onDateChanged.bind(this),g),filterParams:this.params.column.getColDef().filterParams};this.dateComp=new g3(this.getContext(),this.userComponentFactory,x,this.eDateWrapper),this.addDestroyFunc(function(){return h.dateComp.destroy()})},Dx([ce("userComponentFactory")],f.prototype,"userComponentFactory",void 0),Dx([zr("eReadOnlyText")],f.prototype,"eReadOnlyText",void 0),Dx([zr("eDateWrapper")],f.prototype,"eDateWrapper",void 0),f}(T4);/** +
`)||this}return f.prototype.getDefaultFilterOptions=function(){return SI.DEFAULT_FILTER_OPTIONS},f.prototype.conditionToString=function(d,g){var S=d.type,O=(g||{}).numberOfInputs,z=S==Vh.IN_RANGE||O===2,te=Rs(d.dateFrom),Fe=Rs(d.dateTo);return z?Os(te,!1)+"-"+Os(Fe,!1):te!=null?""+Os(te,!1):""+S},f.prototype.init=function(d){M.prototype.init.call(this,d),this.params=d,this.createDateComponent();var g=this.gridOptionsWrapper.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(g("ariaDateFilterInput","Date Filter Input"))},f.prototype.setEditable=function(d){wl(this.eDateWrapper,d),wl(this.eReadOnlyText.getGui(),!d)},f.prototype.onParentModelChanged=function(d,g){if(!this.isEventFromFloatingFilter(g)){M.prototype.setLastTypeFromModel.call(this,d);var S=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(d);if(this.setEditable(S),S){if(d){var O=d;this.dateComp.setDate(Rs(O.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.getTextFromModel(d)),this.dateComp.setDate(null)}},f.prototype.onDateChanged=function(){var d=this,g=this.dateComp.getDate(),S=Os(g);this.params.parentFilterInstance(function(O){if(O){var z=Rs(S);O.onFloatingFilterChanged(d.getLastType()||null,z)}})},f.prototype.createDateComponent=function(){var d=this,g=_I.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),S={onDateChanged:Et(this.onDateChanged.bind(this),g),filterParams:this.params.column.getColDef().filterParams};this.dateComp=new g3(this.getContext(),this.userComponentFactory,S,this.eDateWrapper),this.addDestroyFunc(function(){return d.dateComp.destroy()})},Fx([pe("userComponentFactory")],f.prototype,"userComponentFactory",void 0),Fx([tn("eReadOnlyText")],f.prototype,"eReadOnlyText",void 0),Fx([tn("eDateWrapper")],f.prototype,"eDateWrapper",void 0),f}(A4);/** * @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/ * @license MIT - */var H$=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),W$=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},E4=function(M){H$(f,M);function f(){return M.call(this,` + */var U$=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),z$=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},P4=function(M){U$(f,M);function f(){return M.call(this,`
-
`)||this}return f.prototype.destroy=function(){M.prototype.destroy.call(this)},f.prototype.init=function(h){var g=this,x=this.gridOptionsWrapper.getDocument(),P=this.eDateInput.getInputElement();this.shouldUseBrowserDatePicker(h)&&(P.type="date"),this.addManagedListener(P,"mousedown",function(){g.eDateInput.isDisabled()||P.focus()}),this.addManagedListener(P,"input",function(je){je.target===x.activeElement&&(g.eDateInput.isDisabled()||h.onDateChanged())});var z=h.filterParams||{},ee=z.minValidYear,Me=z.maxValidYear;ee&&(P.min=ee+"-01-01"),Me&&(P.max=Me+"-12-31")},f.prototype.getDate=function(){return gs(this.eDateInput.getValue())},f.prototype.setDate=function(h){this.eDateInput.setValue(ms(h,!1))},f.prototype.setInputPlaceholder=function(h){this.eDateInput.setInputPlaceholder(h)},f.prototype.setDisabled=function(h){this.eDateInput.setDisabled(h)},f.prototype.afterGuiAttached=function(h){(!h||!h.suppressFocus)&&this.eDateInput.getInputElement().focus()},f.prototype.shouldUseBrowserDatePicker=function(h){return h.filterParams&&h.filterParams.browserDatePicker!=null?h.filterParams.browserDatePicker:ec()||_p()},W$([zr("eDateInput")],f.prototype,"eDateInput",void 0),f}(Sa);/** + `)||this}return f.prototype.destroy=function(){M.prototype.destroy.call(this)},f.prototype.init=function(d){var g=this,S=this.gridOptionsWrapper.getDocument(),O=this.eDateInput.getInputElement();this.shouldUseBrowserDatePicker(d)&&(O.type="date"),this.addManagedListener(O,"mousedown",function(){g.eDateInput.isDisabled()||O.focus()}),this.addManagedListener(O,"input",function(Ue){Ue.target===S.activeElement&&(g.eDateInput.isDisabled()||d.onDateChanged())});var z=d.filterParams||{},te=z.minValidYear,Fe=z.maxValidYear;te&&(O.min=te+"-01-01"),Fe&&(O.max=Fe+"-12-31")},f.prototype.getDate=function(){return Rs(this.eDateInput.getValue())},f.prototype.setDate=function(d){this.eDateInput.setValue(Os(d,!1))},f.prototype.setInputPlaceholder=function(d){this.eDateInput.setInputPlaceholder(d)},f.prototype.setDisabled=function(d){this.eDateInput.setDisabled(d)},f.prototype.afterGuiAttached=function(d){(!d||!d.suppressFocus)&&this.eDateInput.getInputElement().focus()},f.prototype.shouldUseBrowserDatePicker=function(d){return d.filterParams&&d.filterParams.browserDatePicker!=null?d.filterParams.browserDatePicker:Vl()||fh()},z$([tn("eDateInput")],f.prototype,"eDateInput",void 0),f}(Ma);/** * @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/ * @license MIT - */var uz=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Dg=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},I4=function(M){uz(f,M);function f(){return M.call(this,"numberFilter")||this}return f.prototype.mapValuesFromModel=function(h){var g=h||{},x=g.filter,P=g.filterTo,z=g.type;return[x??null,P??null].slice(0,this.getNumberOfInputs(z))},f.prototype.getDefaultDebounceMs=function(){return 500},f.prototype.comparator=function(){return function(h,g){return h===g?0:h=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},O4=function(M){uz(f,M);function f(){return M.call(this,"numberFilter")||this}return f.prototype.mapValuesFromModel=function(d){var g=d||{},S=g.filter,O=g.filterTo,z=g.type;return[S??null,O??null].slice(0,this.getNumberOfInputs(z))},f.prototype.getDefaultDebounceMs=function(){return 500},f.prototype.comparator=function(){return function(d,g){return d===g?0:d - <`+P+' class="ag-filter-from ag-filter-filter" ref="eValue-index0-'+g+'"> - <`+P+' class="ag-filter-to ag-filter-filter" ref="eValue-index1-'+g+'"> - `},f.prototype.getValues=function(h){var g=this,x=[];return this.forEachInput(function(P,z,ee,Me){h===ee&&z0&&(x.filter=P[0]),P.length>1&&(x.filterTo=P[1]),x},f.prototype.getInputs=function(){return[[this.eValueFrom1,this.eValueTo1],[this.eValueFrom2,this.eValueTo2]]},f.prototype.getAllowedCharPattern=function(){var h=(this.numberFilterParams||{}).allowedCharPattern;return h||(!ec()&&!Ig()?"\\d\\-\\.":null)},f.DEFAULT_FILTER_OPTIONS=[Ns.EQUALS,Ns.NOT_EQUAL,Ns.LESS_THAN,Ns.LESS_THAN_OR_EQUAL,Ns.GREATER_THAN,Ns.GREATER_THAN_OR_EQUAL,Ns.IN_RANGE,Ns.BLANK,Ns.NOT_BLANK],Dg([zr("eValue-index0-1")],f.prototype,"eValueFrom1",void 0),Dg([zr("eValue-index1-1")],f.prototype,"eValueTo1",void 0),Dg([zr("eValue-index0-2")],f.prototype,"eValueFrom2",void 0),Dg([zr("eValue-index1-2")],f.prototype,"eValueTo2",void 0),f}(Ns);/** + <`+O+' class="ag-filter-from ag-filter-filter" ref="eValue-index0-'+g+'"> + <`+O+' class="ag-filter-to ag-filter-filter" ref="eValue-index1-'+g+'"> + `},f.prototype.getValues=function(d){var g=this,S=[];return this.forEachInput(function(O,z,te,Fe){d===te&&z0&&(S.filter=O[0]),O.length>1&&(S.filterTo=O[1]),S},f.prototype.getInputs=function(){return[[this.eValueFrom1,this.eValueTo1],[this.eValueFrom2,this.eValueTo2]]},f.prototype.getAllowedCharPattern=function(){var d=(this.numberFilterParams||{}).allowedCharPattern;return d||(!Vl()&&!Vc()?"\\d\\-\\.":null)},f.DEFAULT_FILTER_OPTIONS=[Ys.EQUALS,Ys.NOT_EQUAL,Ys.LESS_THAN,Ys.LESS_THAN_OR_EQUAL,Ys.GREATER_THAN,Ys.GREATER_THAN_OR_EQUAL,Ys.IN_RANGE,Ys.BLANK,Ys.NOT_BLANK],kg([tn("eValue-index0-1")],f.prototype,"eValueFrom1",void 0),kg([tn("eValue-index1-1")],f.prototype,"eValueTo1",void 0),kg([tn("eValue-index0-2")],f.prototype,"eValueFrom2",void 0),kg([tn("eValue-index1-2")],f.prototype,"eValueTo2",void 0),f}(Ys);/** * @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/ * @license MIT - */var A4=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Du=function(){return Du=Object.assign||function(M){for(var f,h=1,g=arguments.length;h=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Jm=function(M){A4(f,M);function f(){return M.call(this,"textFilter")||this}return f.trimInput=function(h){var g=h&&h.trim();return g===""?h:g},f.prototype.getDefaultDebounceMs=function(){return 500},f.prototype.setParams=function(h){M.prototype.setParams.call(this,h),this.textFilterParams=h,this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?f.DEFAULT_FORMATTER:f.DEFAULT_LOWERCASE_FORMATTER)},f.prototype.getTextMatcher=function(){var h=this.textFilterParams.textCustomComparator;return h?(co.doOnce(function(){return console.warn("AG Grid - textCustomComparator is deprecated, use textMatcher instead.")},"textCustomComparator.deprecated"),function(g){var x=g.filterOption,P=g.value,z=g.filterText;return h(x,P,z)}):this.textFilterParams.textMatcher||f.DEFAULT_MATCHER},f.prototype.createCondition=function(h){var g=this.getConditionTypes()[h],x={filterType:this.getFilterType(),type:g},P=this.getValues(h);return P.length>0&&(x.filter=P[0]),P.length>1&&(x.filterTo=P[1]),x},f.prototype.getFilterType=function(){return"text"},f.prototype.areSimpleModelsEqual=function(h,g){return h.filter===g.filter&&h.filterTo===g.filterTo&&h.type===g.type},f.prototype.getInputs=function(){return[[this.eValueFrom1,this.eValueTo1],[this.eValueFrom2,this.eValueTo2]]},f.prototype.getValues=function(h){var g=this,x=[];return this.forEachInput(function(P,z,ee,Me){if(h===ee&&z=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},eg=function(M){R4(f,M);function f(){return M.call(this,"textFilter")||this}return f.trimInput=function(d){var g=d&&d.trim();return g===""?d:g},f.prototype.getDefaultDebounceMs=function(){return 500},f.prototype.setParams=function(d){M.prototype.setParams.call(this,d),this.textFilterParams=d,this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?f.DEFAULT_FORMATTER:f.DEFAULT_LOWERCASE_FORMATTER)},f.prototype.getTextMatcher=function(){var d=this.textFilterParams.textCustomComparator;return d?(So.doOnce(function(){return console.warn("AG Grid - textCustomComparator is deprecated, use textMatcher instead.")},"textCustomComparator.deprecated"),function(g){var S=g.filterOption,O=g.value,z=g.filterText;return d(S,O,z)}):this.textFilterParams.textMatcher||f.DEFAULT_MATCHER},f.prototype.createCondition=function(d){var g=this.getConditionTypes()[d],S={filterType:this.getFilterType(),type:g},O=this.getValues(d);return O.length>0&&(S.filter=O[0]),O.length>1&&(S.filterTo=O[1]),S},f.prototype.getFilterType=function(){return"text"},f.prototype.areSimpleModelsEqual=function(d,g){return d.filter===g.filter&&d.filterTo===g.filterTo&&d.type===g.type},f.prototype.getInputs=function(){return[[this.eValueFrom1,this.eValueTo1],[this.eValueFrom2,this.eValueTo2]]},f.prototype.getValues=function(d){var g=this,S=[];return this.forEachInput(function(O,z,te,Fe){if(d===te&&z - `},f.prototype.mapValuesFromModel=function(h){var g=h||{},x=g.filter,P=g.filterTo,z=g.type;return[x||null,P||null].slice(0,this.getNumberOfInputs(z))},f.prototype.evaluateNullValue=function(h){var g=[Nh.NOT_EQUAL,Nh.NOT_CONTAINS,Nh.BLANK];return h?g.indexOf(h)>=0:!1},f.prototype.evaluateNonNullValue=function(h,g,x,P){var z=this,ee=h.map(function(Rr){return z.formatter(Rr)})||[],Me=this.formatter(g),je=this.textFilterParams,ut=je.api,Rt=je.colDef,Zt=je.column,vi=je.columnApi,Ci=je.context,qi=je.textFormatter;if(x.type===Nh.BLANK)return this.isBlank(g);if(x.type===Nh.NOT_BLANK)return!this.isBlank(g);var hr={api:ut,colDef:Rt,column:Zt,columnApi:vi,context:Ci,node:P.node,data:P.data,filterOption:x.type,value:Me,textFormatter:qi};return ee.some(function(Rr){return z.matcher(Du(Du({},hr),{filterText:Rr}))})},f.DEFAULT_FILTER_OPTIONS=[Nh.CONTAINS,Nh.NOT_CONTAINS,Nh.EQUALS,Nh.NOT_EQUAL,Nh.STARTS_WITH,Nh.ENDS_WITH,Nh.BLANK,Nh.NOT_BLANK],f.DEFAULT_FORMATTER=function(h){return h},f.DEFAULT_LOWERCASE_FORMATTER=function(h){return h==null?null:h.toString().toLowerCase()},f.DEFAULT_MATCHER=function(h){var g=h.filterOption,x=h.value,P=h.filterText;if(P==null)return!1;switch(g){case f.CONTAINS:return x.indexOf(P)>=0;case f.NOT_CONTAINS:return x.indexOf(P)<0;case f.EQUALS:return x===P;case f.NOT_EQUAL:return x!=P;case f.STARTS_WITH:return x.indexOf(P)===0;case f.ENDS_WITH:var z=x.lastIndexOf(P);return z>=0&&z===x.length-P.length;default:return!1}},TI([zr("eValue-index0-1")],f.prototype,"eValueFrom1",void 0),TI([zr("eValue-index1-1")],f.prototype,"eValueTo1",void 0),TI([zr("eValue-index0-2")],f.prototype,"eValueFrom2",void 0),TI([zr("eValue-index1-2")],f.prototype,"eValueTo2",void 0),f}(Nh);/** + `},f.prototype.mapValuesFromModel=function(d){var g=d||{},S=g.filter,O=g.filterTo,z=g.type;return[S||null,O||null].slice(0,this.getNumberOfInputs(z))},f.prototype.evaluateNullValue=function(d){var g=[Vh.NOT_EQUAL,Vh.NOT_CONTAINS,Vh.BLANK];return d?g.indexOf(d)>=0:!1},f.prototype.evaluateNonNullValue=function(d,g,S,O){var z=this,te=d.map(function(Hr){return z.formatter(Hr)})||[],Fe=this.formatter(g),Ue=this.textFilterParams,ut=Ue.api,Mt=Ue.colDef,ni=Ue.column,Si=Ue.columnApi,Pi=Ue.context,Qi=Ue.textFormatter;if(S.type===Vh.BLANK)return this.isBlank(g);if(S.type===Vh.NOT_BLANK)return!this.isBlank(g);var _r={api:ut,colDef:Mt,column:ni,columnApi:Si,context:Pi,node:O.node,data:O.data,filterOption:S.type,value:Fe,textFormatter:Qi};return te.some(function(Hr){return z.matcher(Uu(Uu({},_r),{filterText:Hr}))})},f.DEFAULT_FILTER_OPTIONS=[Vh.CONTAINS,Vh.NOT_CONTAINS,Vh.EQUALS,Vh.NOT_EQUAL,Vh.STARTS_WITH,Vh.ENDS_WITH,Vh.BLANK,Vh.NOT_BLANK],f.DEFAULT_FORMATTER=function(d){return d},f.DEFAULT_LOWERCASE_FORMATTER=function(d){return d==null?null:d.toString().toLowerCase()},f.DEFAULT_MATCHER=function(d){var g=d.filterOption,S=d.value,O=d.filterText;if(O==null)return!1;switch(g){case f.CONTAINS:return S.indexOf(O)>=0;case f.NOT_CONTAINS:return S.indexOf(O)<0;case f.EQUALS:return S===O;case f.NOT_EQUAL:return S!=O;case f.STARTS_WITH:return S.indexOf(O)===0;case f.ENDS_WITH:var z=S.lastIndexOf(O);return z>=0&&z===S.length-O.length;default:return!1}},TI([tn("eValue-index0-1")],f.prototype,"eValueFrom1",void 0),TI([tn("eValue-index1-1")],f.prototype,"eValueTo1",void 0),TI([tn("eValue-index0-2")],f.prototype,"eValueFrom2",void 0),TI([tn("eValue-index1-2")],f.prototype,"eValueTo2",void 0),f}(Vh);/** * @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/ * @license MIT - */var iC=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),EI=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},xp=function(M){iC(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.postConstruct=function(){this.resetTemplate()},f.prototype.resetTemplate=function(h){this.setTemplate(` + */var eC=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),EI=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Ap=function(M){eC(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.postConstruct=function(){this.resetTemplate()},f.prototype.resetTemplate=function(d){this.setTemplate(` - `,h)},f.prototype.getDefaultDebounceMs=function(){return 500},f.prototype.onParentModelChanged=function(h,g){this.isEventFromFloatingFilter(g)||(this.setLastTypeFromModel(h),this.eFloatingFilterInput.setValue(this.getTextFromModel(h)),this.setEditable(this.canWeEditAfterModelFromParentFilter(h)))},f.prototype.init=function(h){M.prototype.init.call(this,h),this.params=h,this.applyActive=bI.isUseApplyButton(this.params.filterParams);var g=this.params.filterParams.allowedCharPattern;if(g!=null&&this.resetTemplate({eFloatingFilterInput:{allowedCharPattern:g}}),!this.isReadOnly()){var x=bI.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),P=Tt(this.syncUpWithParentFilter.bind(this),x),z=this.eFloatingFilterInput.getGui();this.addManagedListener(z,"input",P),this.addManagedListener(z,"keypress",P),this.addManagedListener(z,"keydown",P)}var ee=h.column.getDefinition();(this.isReadOnly()||ee.filterParams&&ee.filterParams.filterOptions&&ee.filterParams.filterOptions.length===1&&ee.filterParams.filterOptions[0]==="inRange")&&this.eFloatingFilterInput.setDisabled(!0);var Me=this.columnModel.getDisplayNameForColumn(h.column,"header",!0),je=this.gridOptionsWrapper.getLocaleTextFunc();this.eFloatingFilterInput.setInputAriaLabel(Me+" "+je("ariaFilterInput","Filter Input"))},f.prototype.syncUpWithParentFilter=function(h){var g=this,x=h.key===Nr.ENTER;if(!(this.applyActive&&!x)){var P=this.eFloatingFilterInput.getValue();this.params.filterParams.trimInput&&(P=Jm.trimInput(P),this.eFloatingFilterInput.setValue(P,!0)),this.params.parentFilterInstance(function(z){z&&z.onFloatingFilterChanged(g.getLastType()||null,P||null)})}},f.prototype.conditionToString=function(h,g){var x=(g||{}).numberOfInputs,P=h.type==Nh.IN_RANGE||x===2;return P?h.filter+"-"+h.filterTo:h.filter!=null?""+h.filter:""+h.type},f.prototype.setEditable=function(h){this.eFloatingFilterInput.setDisabled(!h)},EI([ce("columnModel")],f.prototype,"columnModel",void 0),EI([zr("eFloatingFilterInput")],f.prototype,"eFloatingFilterInput",void 0),EI([it],f.prototype,"postConstruct",null),f}(T4);/** + `,d)},f.prototype.getDefaultDebounceMs=function(){return 500},f.prototype.onParentModelChanged=function(d,g){this.isEventFromFloatingFilter(g)||(this.setLastTypeFromModel(d),this.eFloatingFilterInput.setValue(this.getTextFromModel(d)),this.setEditable(this.canWeEditAfterModelFromParentFilter(d)))},f.prototype.init=function(d){M.prototype.init.call(this,d),this.params=d,this.applyActive=_I.isUseApplyButton(this.params.filterParams);var g=this.params.filterParams.allowedCharPattern;if(g!=null&&this.resetTemplate({eFloatingFilterInput:{allowedCharPattern:g}}),!this.isReadOnly()){var S=_I.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),O=Et(this.syncUpWithParentFilter.bind(this),S),z=this.eFloatingFilterInput.getGui();this.addManagedListener(z,"input",O),this.addManagedListener(z,"keypress",O),this.addManagedListener(z,"keydown",O)}var te=d.column.getDefinition();(this.isReadOnly()||te.filterParams&&te.filterParams.filterOptions&&te.filterParams.filterOptions.length===1&&te.filterParams.filterOptions[0]==="inRange")&&this.eFloatingFilterInput.setDisabled(!0);var Fe=this.columnModel.getDisplayNameForColumn(d.column,"header",!0),Ue=this.gridOptionsWrapper.getLocaleTextFunc();this.eFloatingFilterInput.setInputAriaLabel(Fe+" "+Ue("ariaFilterInput","Filter Input"))},f.prototype.syncUpWithParentFilter=function(d){var g=this,S=d.key===Qr.ENTER;if(!(this.applyActive&&!S)){var O=this.eFloatingFilterInput.getValue();this.params.filterParams.trimInput&&(O=eg.trimInput(O),this.eFloatingFilterInput.setValue(O,!0)),this.params.parentFilterInstance(function(z){z&&z.onFloatingFilterChanged(g.getLastType()||null,O||null)})}},f.prototype.conditionToString=function(d,g){var S=(g||{}).numberOfInputs,O=d.type==Vh.IN_RANGE||S===2;return O?d.filter+"-"+d.filterTo:d.filter!=null?""+d.filter:""+d.type},f.prototype.setEditable=function(d){this.eFloatingFilterInput.setDisabled(!d)},EI([pe("columnModel")],f.prototype,"columnModel",void 0),EI([tn("eFloatingFilterInput")],f.prototype,"eFloatingFilterInput",void 0),EI([ht],f.prototype,"postConstruct",null),f}(A4);/** * @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/ * @license MIT - */var od=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),w3=function(M){od(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.getDefaultFilterOptions=function(){return I4.DEFAULT_FILTER_OPTIONS},f}(xp);/** + */var hd=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),w3=function(M){hd(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.getDefaultFilterOptions=function(){return O4.DEFAULT_FILTER_OPTIONS},f}(Ap);/** * @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/ * @license MIT - */var cz=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),q$=function(M){cz(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.getDefaultFilterOptions=function(){return Jm.DEFAULT_FILTER_OPTIONS},f}(xp);/** + */var cz=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),H$=function(M){cz(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.getDefaultFilterOptions=function(){return eg.DEFAULT_FILTER_OPTIONS},f}(Ap);/** * @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/ * @license MIT - */var Fg=function(){function M(f,h){var g=this;h===void 0&&(h=!1),this.destroyFuncs=[],this.touching=!1,this.eventService=new gt,this.eElement=f,this.preventMouseClick=h;var x=this.onTouchStart.bind(this),P=this.onTouchMove.bind(this),z=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",x,{passive:!0}),this.eElement.addEventListener("touchmove",P,{passive:!0}),this.eElement.addEventListener("touchend",z,{passive:!1}),this.destroyFuncs.push(function(){g.eElement.removeEventListener("touchstart",x,{passive:!0}),g.eElement.removeEventListener("touchmove",P,{passive:!0}),g.eElement.removeEventListener("touchend",z,{passive:!1})})}return M.prototype.getActiveTouch=function(f){for(var h=0;h0){var h=f-this.lastTapTime;if(h>M.DOUBLE_TAP_MILLIS){var g={type:M.EVENT_DOUBLE_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(g),this.lastTapTime=null}else this.lastTapTime=f}else this.lastTapTime=f},M.prototype.destroy=function(){this.destroyFuncs.forEach(function(f){return f()})},M.EVENT_TAP="tap",M.EVENT_DOUBLE_TAP="doubleTap",M.EVENT_LONG_TAP="longTap",M.DOUBLE_TAP_MILLIS=500,M}();/** + */var $g=function(){function M(f,d){var g=this;d===void 0&&(d=!1),this.destroyFuncs=[],this.touching=!1,this.eventService=new nt,this.eElement=f,this.preventMouseClick=d;var S=this.onTouchStart.bind(this),O=this.onTouchMove.bind(this),z=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",S,{passive:!0}),this.eElement.addEventListener("touchmove",O,{passive:!0}),this.eElement.addEventListener("touchend",z,{passive:!1}),this.destroyFuncs.push(function(){g.eElement.removeEventListener("touchstart",S,{passive:!0}),g.eElement.removeEventListener("touchmove",O,{passive:!0}),g.eElement.removeEventListener("touchend",z,{passive:!1})})}return M.prototype.getActiveTouch=function(f){for(var d=0;d0){var d=f-this.lastTapTime;if(d>M.DOUBLE_TAP_MILLIS){var g={type:M.EVENT_DOUBLE_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(g),this.lastTapTime=null}else this.lastTapTime=f}else this.lastTapTime=f},M.prototype.destroy=function(){this.destroyFuncs.forEach(function(f){return f()})},M.EVENT_TAP="tap",M.EVENT_DOUBLE_TAP="doubleTap",M.EVENT_LONG_TAP="longTap",M.DOUBLE_TAP_MILLIS=500,M}();/** * @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/ * @license MIT - */var Vs=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),N0=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Y$=function(M){Vs(f,M);function f(){var h=M!==null&&M.apply(this,arguments)||this;return h.lastMovingChanged=0,h}return f.prototype.destroy=function(){M.prototype.destroy.call(this)},f.prototype.refresh=function(h){return this.params=h,this.workOutTemplate()!=this.currentTemplate||this.workOutShowMenu()!=this.currentShowMenu||this.workOutSort()!=this.currentSort?!1:(this.setDisplayName(h),!0)},f.prototype.workOutTemplate=function(){var h=T(this.params.template,f.TEMPLATE);return h=h&&h.trim?h.trim():h,h},f.prototype.init=function(h){this.params=h,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate),this.setupTap(),this.setupIcons(h.column),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setDisplayName(h)},f.prototype.setDisplayName=function(h){if(this.currentDisplayName!=h.displayName){this.currentDisplayName=h.displayName;var g=_t(this.currentDisplayName);this.eText&&(this.eText.innerHTML=g)}},f.prototype.setupIcons=function(h){this.addInIcon("sortAscending",this.eSortAsc,h),this.addInIcon("sortDescending",this.eSortDesc,h),this.addInIcon("sortUnSort",this.eSortNone,h),this.addInIcon("menu",this.eMenu,h),this.addInIcon("filter",this.eFilter,h)},f.prototype.addInIcon=function(h,g,x){if(g!=null){var P=tu(h,this.gridOptionsWrapper,x);P&&g.appendChild(P)}},f.prototype.setupTap=function(){var h=this,g=this.gridOptionsWrapper;if(!g.isSuppressTouch()){var x=new Fg(this.getGui(),!0),P=g.isSuppressMenuHide(),z=P&&i(this.eMenu),ee=z?new Fg(this.eMenu,!0):x;if(this.params.enableMenu){var Me=z?"EVENT_TAP":"EVENT_LONG_TAP",je=function(Rt){g.getApi().showColumnMenuAfterMouseClick(h.params.column,Rt.touchStart)};this.addManagedListener(ee,Fg[Me],je)}if(this.params.enableSorting){var ut=function(Rt){var Zt=Rt.touchStart.target;P&&h.eMenu.contains(Zt)||h.sortController.progressSort(h.params.column,!1,"uiColumnSorted")};this.addManagedListener(x,Fg.EVENT_TAP,ut)}this.addDestroyFunc(function(){return x.destroy()}),z&&this.addDestroyFunc(function(){return ee.destroy()})}},f.prototype.workOutShowMenu=function(){var h=!this.gridOptionsWrapper.isSuppressMenuHide(),g=nd()&&h,x=this.params.enableMenu&&!g;return x},f.prototype.setMenu=function(){var h=this;if(this.eMenu){if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu){th(this.eMenu);return}var g=this.gridOptionsWrapper.isSuppressMenuHide();this.addManagedListener(this.eMenu,"click",function(){return h.showMenu(h.eMenu)}),this.eMenu.classList.toggle("ag-header-menu-always-show",g)}},f.prototype.showMenu=function(h){h||(h=this.eMenu),this.menuFactory.showMenuAfterButtonClick(this.params.column,h,"columnMenu")},f.prototype.removeSortIcons=function(){th(this.eSortAsc),th(this.eSortDesc),th(this.eSortNone),th(this.eSortOrder)},f.prototype.workOutSort=function(){return this.params.enableSorting},f.prototype.setupSort=function(){var h=this;if(this.currentSort=this.params.enableSorting,!this.currentSort){this.removeSortIcons();return}var g=this.gridOptionsWrapper.isMultiSortKeyCtrl();this.addManagedListener(this.params.column,W.EVENT_MOVING_CHANGED,function(){h.lastMovingChanged=new Date().getTime()}),this.eLabel&&this.addManagedListener(this.eLabel,"click",function(x){var P=h.params.column.isMoving(),z=new Date().getTime(),ee=z-h.lastMovingChanged<50,Me=P||ee;if(!Me){var je=g?x.ctrlKey||x.metaKey:x.shiftKey;h.params.progressSort(je)}}),this.addManagedListener(this.params.column,W.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.onSortChanged(),this.addManagedListener(this.eventService,li.EVENT_SORT_CHANGED,this.setMultiSortOrder.bind(this)),this.setMultiSortOrder()},f.prototype.onSortChanged=function(){if(this.addOrRemoveCssClass("ag-header-cell-sorted-asc",this.params.column.isSortAscending()),this.addOrRemoveCssClass("ag-header-cell-sorted-desc",this.params.column.isSortDescending()),this.addOrRemoveCssClass("ag-header-cell-sorted-none",this.params.column.isSortNone()),this.eSortAsc&&this.eSortAsc.classList.toggle("ag-hidden",!this.params.column.isSortAscending()),this.eSortDesc&&this.eSortDesc.classList.toggle("ag-hidden",!this.params.column.isSortDescending()),this.eSortNone){var h=!this.params.column.getColDef().unSortIcon&&!this.gridOptionsWrapper.isUnSortIcon();this.eSortNone.classList.toggle("ag-hidden",h||!this.params.column.isSortNone())}},f.prototype.setMultiSortOrder=function(){if(this.eSortOrder){var h=this.params.column,g=this.sortController.getColumnsWithSortingOrdered(),x=g.indexOf(h),P=g.length>1,z=h.isSorting()&&P;dl(this.eSortOrder,z),x>=0?this.eSortOrder.innerHTML=(x+1).toString():Ou(this.eSortOrder)}},f.prototype.setupFilterIcon=function(){this.eFilter&&(this.addManagedListener(this.params.column,W.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.onFilterChanged())},f.prototype.onFilterChanged=function(){var h=this.params.column.isFilterActive();this.eFilter.classList.toggle("ag-hidden",!h)},f.TEMPLATE=``,V0([pe("sortController")],f.prototype,"sortController",void 0),V0([pe("menuFactory")],f.prototype,"menuFactory",void 0),V0([tn("eFilter")],f.prototype,"eFilter",void 0),V0([tn("eSortAsc")],f.prototype,"eSortAsc",void 0),V0([tn("eSortDesc")],f.prototype,"eSortDesc",void 0),V0([tn("eSortNone")],f.prototype,"eSortNone",void 0),V0([tn("eSortOrder")],f.prototype,"eSortOrder",void 0),V0([tn("eMenu")],f.prototype,"eMenu",void 0),V0([tn("eLabel")],f.prototype,"eLabel",void 0),V0([tn("eText")],f.prototype,"eText",void 0),f}(Ma);/** * @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/ * @license MIT - */var P4=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),O4=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},hz=function(M){P4(f,M);function f(){return M.call(this,f.TEMPLATE)||this}return f.prototype.destroy=function(){M.prototype.destroy.call(this)},f.prototype.init=function(h){this.params=h,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()},f.prototype.checkWarnings=function(){var h=this.params;if(h.template){var g="AG Grid: A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)";ze(function(){return console.warn(g)},"HeaderGroupComp.templateNotSupported")}},f.prototype.setupExpandIcons=function(){var h=this;this.addInIcon("columnGroupOpened","agOpened"),this.addInIcon("columnGroupClosed","agClosed");var g=function(z){if(!er(z)){var ee=!h.params.columnGroup.isExpanded();h.columnModel.setColumnGroupOpened(h.params.columnGroup.getProvidedColumnGroup(),ee,"uiColumnExpanded")}};this.addTouchAndClickListeners(this.eCloseIcon,g),this.addTouchAndClickListeners(this.eOpenIcon,g);var x=function(z){Ri(z)};this.addManagedListener(this.eCloseIcon,"dblclick",x),this.addManagedListener(this.eOpenIcon,"dblclick",x),this.addManagedListener(this.getGui(),"dblclick",g),this.updateIconVisibility();var P=this.params.columnGroup.getProvidedColumnGroup();this.addManagedListener(P,Jt.EVENT_EXPANDED_CHANGED,this.updateIconVisibility.bind(this)),this.addManagedListener(P,Jt.EVENT_EXPANDABLE_CHANGED,this.updateIconVisibility.bind(this))},f.prototype.addTouchAndClickListeners=function(h,g){var x=new Fg(h,!0);this.addManagedListener(x,Fg.EVENT_TAP,g),this.addDestroyFunc(function(){return x.destroy()}),this.addManagedListener(h,"click",g)},f.prototype.updateIconVisibility=function(){var h=this.params.columnGroup;if(h.isExpandable()){var g=this.params.columnGroup.isExpanded();dl(this.eOpenIcon,g),dl(this.eCloseIcon,!g)}else dl(this.eOpenIcon,!1),dl(this.eCloseIcon,!1)},f.prototype.addInIcon=function(h,g){var x=tu(h,this.gridOptionsWrapper,null);x&&this.getRefElement(g).appendChild(x)},f.prototype.addGroupExpandIcon=function(){if(!this.params.columnGroup.isExpandable()){dl(this.eOpenIcon,!1),dl(this.eCloseIcon,!1);return}},f.prototype.setupLabel=function(){var h=this.params.displayName;if(i(h)){var g=_t(h);this.getRefElement("agLabel").innerHTML=g}},f.TEMPLATE=``,D4([pe("columnModel")],f.prototype,"columnModel",void 0),D4([tn("agOpened")],f.prototype,"eOpenIcon",void 0),D4([tn("agClosed")],f.prototype,"eCloseIcon",void 0),f}(Ma);/** * @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/ * @license MIT - */var R4=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),rC=function(M){R4(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.isPopup=function(){return!0},f.prototype.setParentComponent=function(h){h.addCssClass("ag-has-popup"),M.prototype.setParentComponent.call(this,h)},f.prototype.destroy=function(){var h=this.parentComponent,g=h&&h.isAlive();g&&h.getGui().classList.remove("ag-has-popup"),M.prototype.destroy.call(this)},f}(Sa);/** + */var F4=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),tC=function(M){F4(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.isPopup=function(){return!0},f.prototype.setParentComponent=function(d){d.addCssClass("ag-has-popup"),M.prototype.setParentComponent.call(this,d)},f.prototype.destroy=function(){var d=this.parentComponent,g=d&&d.isAlive();g&&d.getGui().classList.remove("ag-has-popup"),M.prototype.destroy.call(this)},f}(Ma);/** * @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/ * @license MIT - */var M4=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),kb=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},nC=function(M){M4(f,M);function f(){return M.call(this,f.TEMPLATE)||this}return f.prototype.init=function(h){this.params=h,this.focusAfterAttached=h.cellStartedEdit,this.eTextArea.setMaxLength(h.maxLength||200).setCols(h.cols||60).setRows(h.rows||10),i(h.value)&&this.eTextArea.setValue(h.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this))},f.prototype.onKeyDown=function(h){var g=h.key;(g===Nr.LEFT||g===Nr.UP||g===Nr.RIGHT||g===Nr.DOWN||h.shiftKey&&g===Nr.ENTER)&&h.stopPropagation()},f.prototype.afterGuiAttached=function(){var h=this.gridOptionsWrapper.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(h("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()},f.prototype.getValue=function(){return this.params.parseValue(this.eTextArea.getValue())},f.TEMPLATE=`
+ */var L4=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Bb=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},iC=function(M){L4(f,M);function f(){return M.call(this,f.TEMPLATE)||this}return f.prototype.init=function(d){this.params=d,this.focusAfterAttached=d.cellStartedEdit,this.eTextArea.setMaxLength(d.maxLength||200).setCols(d.cols||60).setRows(d.rows||10),i(d.value)&&this.eTextArea.setValue(d.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this))},f.prototype.onKeyDown=function(d){var g=d.key;(g===Qr.LEFT||g===Qr.UP||g===Qr.RIGHT||g===Qr.DOWN||d.shiftKey&&g===Qr.ENTER)&&d.stopPropagation()},f.prototype.afterGuiAttached=function(){var d=this.gridOptionsWrapper.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(d("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()},f.prototype.getValue=function(){return this.params.parseValue(this.eTextArea.getValue())},f.TEMPLATE=`
-
`,kb([zr("eTextArea")],f.prototype,"eTextArea",void 0),f}(rC);/** +
`,Bb([tn("eTextArea")],f.prototype,"eTextArea",void 0),f}(tC);/** * @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/ * @license MIT - */var II=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Fx=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},g1=function(M){II(f,M);function f(){var h=M.call(this,'
')||this;return h.startedByEnter=!1,h}return f.prototype.init=function(h){var g=this;if(this.focusAfterAttached=h.cellStartedEdit,r(h.values)){console.warn("AG Grid: no values found for select cellEditor");return}this.startedByEnter=h.eventKey!=null?h.eventKey===Nr.ENTER:!1;var x=!1;h.values.forEach(function(P){var z={value:P},ee=g.valueFormatterService.formatValue(h.column,null,null,P),Me=ee!=null;z.text=Me?ee:P,g.eSelect.addOption(z),x=x||h.value===P}),x?this.eSelect.setValue(h.value,!0):h.values.length&&this.eSelect.setValue(h.values[0],!0),this.gridOptionsWrapper.isFullRowEdit()||this.eSelect.onValueChange(function(){return h.stopEditing()})},f.prototype.afterGuiAttached=function(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&this.eSelect.showPicker()},f.prototype.focusIn=function(){this.eSelect.getFocusableElement().focus()},f.prototype.getValue=function(){return this.eSelect.getValue()},f.prototype.isPopup=function(){return!1},Fx([ce("valueFormatterService")],f.prototype,"valueFormatterService",void 0),Fx([zr("eSelect")],f.prototype,"eSelect",void 0),f}(rC);/** + */var II=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Lx=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},b1=function(M){II(f,M);function f(){var d=M.call(this,'
')||this;return d.startedByEnter=!1,d}return f.prototype.init=function(d){var g=this;if(this.focusAfterAttached=d.cellStartedEdit,r(d.values)){console.warn("AG Grid: no values found for select cellEditor");return}this.startedByEnter=d.eventKey!=null?d.eventKey===Qr.ENTER:!1;var S=!1;d.values.forEach(function(O){var z={value:O},te=g.valueFormatterService.formatValue(d.column,null,null,O),Fe=te!=null;z.text=Fe?te:O,g.eSelect.addOption(z),S=S||d.value===O}),S?this.eSelect.setValue(d.value,!0):d.values.length&&this.eSelect.setValue(d.values[0],!0),this.gridOptionsWrapper.isFullRowEdit()||this.eSelect.onValueChange(function(){return d.stopEditing()})},f.prototype.afterGuiAttached=function(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&this.eSelect.showPicker()},f.prototype.focusIn=function(){this.eSelect.getFocusableElement().focus()},f.prototype.getValue=function(){return this.eSelect.getValue()},f.prototype.isPopup=function(){return!1},Lx([pe("valueFormatterService")],f.prototype,"valueFormatterService",void 0),Lx([tn("eSelect")],f.prototype,"eSelect",void 0),f}(tC);/** * @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/ * @license MIT - */var Dy=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Fy=function(M){Dy(f,M);function f(){var h=M.call(this)||this;return ze(function(){return console.warn('AG Grid: The PopupSelectCellEditor (agPopupSelectCellEditor) is deprecated. Instead use {cellEditor: "agSelectCellEditor", cellEditorPopup: true} ')},"PopupSelectCellEditor.deprecated"),h}return f.prototype.isPopup=function(){return!0},f}(g1);/** + */var Fy=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Ly=function(M){Fy(f,M);function f(){var d=M.call(this)||this;return Ge(function(){return console.warn('AG Grid: The PopupSelectCellEditor (agPopupSelectCellEditor) is deprecated. Instead use {cellEditor: "agSelectCellEditor", cellEditorPopup: true} ')},"PopupSelectCellEditor.deprecated"),d}return f.prototype.isPopup=function(){return!0},f}(b1);/** * @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/ * @license MIT - */var _l=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),nf=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},wr=function(M){_l(f,M);function f(){return M.call(this,f.TEMPLATE)||this}return f.prototype.init=function(h){this.params=h;var g=this.eInput,x;h.cellStartedEdit?(this.focusAfterAttached=!0,h.eventKey===Nr.BACKSPACE||h.eventKey===Nr.DELETE?x="":h.charPress?x=h.charPress:(x=this.getStartValue(h),h.eventKey!==Nr.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,x=this.getStartValue(h)),x!=null&&g.setValue(x,!0),this.addManagedListener(g.getGui(),"keydown",function(P){var z=P.key;(z===Nr.PAGE_UP||z===Nr.PAGE_DOWN)&&P.preventDefault()})},f.prototype.afterGuiAttached=function(){var h=this.gridOptionsWrapper.getLocaleTextFunc(),g=this.eInput;if(g.setInputAriaLabel(h("ariaInputEditor","Input Editor")),!!this.focusAfterAttached){qm()||g.getFocusableElement().focus();var x=g.getInputElement();if(this.highlightAllOnFocus)x.select();else{var P=g.getValue(),z=i(P)&&P.length||0;z&&x.setSelectionRange(z,z)}}},f.prototype.focusIn=function(){var h=this.eInput,g=h.getFocusableElement(),x=h.getInputElement();g.focus(),x.select()},f.prototype.getValue=function(){var h=this.eInput;return this.params.parseValue(h.getValue())},f.prototype.getStartValue=function(h){var g=h.useFormatter||h.column.getColDef().refData;return g?h.formatValue(h.value):h.value},f.prototype.isPopup=function(){return!1},f.TEMPLATE='
',nf([zr("eInput")],f.prototype,"eInput",void 0),f}(rC);/** + */var Al=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),af=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Dr=function(M){Al(f,M);function f(){return M.call(this,f.TEMPLATE)||this}return f.prototype.init=function(d){this.params=d;var g=this.eInput,S;d.cellStartedEdit?(this.focusAfterAttached=!0,d.eventKey===Qr.BACKSPACE||d.eventKey===Qr.DELETE?S="":d.charPress?S=d.charPress:(S=this.getStartValue(d),d.eventKey!==Qr.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,S=this.getStartValue(d)),S!=null&&g.setValue(S,!0),this.addManagedListener(g.getGui(),"keydown",function(O){var z=O.key;(z===Qr.PAGE_UP||z===Qr.PAGE_DOWN)&&O.preventDefault()})},f.prototype.afterGuiAttached=function(){var d=this.gridOptionsWrapper.getLocaleTextFunc(),g=this.eInput;if(g.setInputAriaLabel(d("ariaInputEditor","Input Editor")),!!this.focusAfterAttached){jc()||g.getFocusableElement().focus();var S=g.getInputElement();if(this.highlightAllOnFocus)S.select();else{var O=g.getValue(),z=i(O)&&O.length||0;z&&S.setSelectionRange(z,z)}}},f.prototype.focusIn=function(){var d=this.eInput,g=d.getFocusableElement(),S=d.getInputElement();g.focus(),S.select()},f.prototype.getValue=function(){var d=this.eInput;return this.params.parseValue(d.getValue())},f.prototype.getStartValue=function(d){var g=d.useFormatter||d.column.getColDef().refData;return g?d.formatValue(d.value):d.value},f.prototype.isPopup=function(){return!1},f.TEMPLATE='
',af([tn("eInput")],f.prototype,"eInput",void 0),f}(tC);/** * @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/ * @license MIT - */var y1=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),D4=function(M){y1(f,M);function f(){var h=M.call(this)||this;return ze(function(){return console.warn('AG Grid: The PopupTextCellEditor (agPopupTextCellEditor) is deprecated. Instead use {cellEditor: "agTextCellEditor", cellEditorPopup: true} ')},"PopupTextCellEditor.deprecated"),h}return f.prototype.isPopup=function(){return!0},f}(wr);/** + */var w1=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),N4=function(M){w1(f,M);function f(){var d=M.call(this)||this;return Ge(function(){return console.warn('AG Grid: The PopupTextCellEditor (agPopupTextCellEditor) is deprecated. Instead use {cellEditor: "agTextCellEditor", cellEditorPopup: true} ')},"PopupTextCellEditor.deprecated"),d}return f.prototype.isPopup=function(){return!0},f}(Dr);/** * @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/ * @license MIT - */var v1=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),x3=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},AI="↑",F4="↓",Lx=function(M){v1(f,M);function f(){var h=M.call(this,f.TEMPLATE)||this;return h.refreshCount=0,h}return f.prototype.init=function(h){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(h)},f.prototype.showDelta=function(h,g){var x=Math.abs(g),P=h.formatValue(x),z=i(P)?P:x,ee=g>=0;ee?this.eDelta.innerHTML=AI+z:this.eDelta.innerHTML=F4+z,this.eDelta.classList.toggle("ag-value-change-delta-up",ee),this.eDelta.classList.toggle("ag-value-change-delta-down",!ee)},f.prototype.setTimerToRemoveDelta=function(){var h=this;this.refreshCount++;var g=this.refreshCount;window.setTimeout(function(){g===h.refreshCount&&h.hideDeltaValue()},2e3)},f.prototype.hideDeltaValue=function(){this.eValue.classList.remove("ag-value-change-value-highlight"),Ou(this.eDelta)},f.prototype.refresh=function(h){var g=h.value;if(g===this.lastValue||(i(h.valueFormatted)?this.eValue.innerHTML=h.valueFormatted:i(h.value)?this.eValue.innerHTML=g:Ou(this.eValue),this.filterManager.isSuppressFlashingCellsBecauseFiltering()))return!1;if(typeof g=="number"&&typeof this.lastValue=="number"){var x=g-this.lastValue;this.showDelta(h,x)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),this.setTimerToRemoveDelta(),this.lastValue=g,!0},f.TEMPLATE='',x3([ce("filterManager")],f.prototype,"filterManager",void 0),f}(Sa);/** + */var x1=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),x3=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},AI="↑",k4="↓",Nx=function(M){x1(f,M);function f(){var d=M.call(this,f.TEMPLATE)||this;return d.refreshCount=0,d}return f.prototype.init=function(d){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(d)},f.prototype.showDelta=function(d,g){var S=Math.abs(g),O=d.formatValue(S),z=i(O)?O:S,te=g>=0;te?this.eDelta.innerHTML=AI+z:this.eDelta.innerHTML=k4+z,this.eDelta.classList.toggle("ag-value-change-delta-up",te),this.eDelta.classList.toggle("ag-value-change-delta-down",!te)},f.prototype.setTimerToRemoveDelta=function(){var d=this;this.refreshCount++;var g=this.refreshCount;window.setTimeout(function(){g===d.refreshCount&&d.hideDeltaValue()},2e3)},f.prototype.hideDeltaValue=function(){this.eValue.classList.remove("ag-value-change-value-highlight"),ju(this.eDelta)},f.prototype.refresh=function(d){var g=d.value;if(g===this.lastValue||(i(d.valueFormatted)?this.eValue.innerHTML=d.valueFormatted:i(d.value)?this.eValue.innerHTML=g:ju(this.eValue),this.filterManager.isSuppressFlashingCellsBecauseFiltering()))return!1;if(typeof g=="number"&&typeof this.lastValue=="number"){var S=g-this.lastValue;this.showDelta(d,S)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),this.setTimerToRemoveDelta(),this.lastValue=g,!0},f.TEMPLATE='',x3([pe("filterManager")],f.prototype,"filterManager",void 0),f}(Ma);/** * @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/ * @license MIT - */var Se=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),xt=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},jt=function(M){Se(f,M);function f(){var h=M.call(this,f.TEMPLATE)||this;return h.refreshCount=0,h.eCurrent=h.queryForHtmlElement(".ag-value-slide-current"),h}return f.prototype.init=function(h){this.refresh(h)},f.prototype.addSlideAnimation=function(){var h=this;this.refreshCount++;var g=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious),this.ePrevious=yu(''),this.ePrevious.innerHTML=this.eCurrent.innerHTML,this.getGui().insertBefore(this.ePrevious,this.eCurrent),window.setTimeout(function(){g===h.refreshCount&&h.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(function(){g===h.refreshCount&&(h.getGui().removeChild(h.ePrevious),h.ePrevious=null)},3e3)},f.prototype.refresh=function(h){var g=h.value;return r(g)&&(g=""),g===this.lastValue||this.filterManager.isSuppressFlashingCellsBecauseFiltering()?!1:(this.addSlideAnimation(),this.lastValue=g,i(h.valueFormatted)?this.eCurrent.innerHTML=h.valueFormatted:i(h.value)?this.eCurrent.innerHTML=g:Ou(this.eCurrent),!0)},f.TEMPLATE=` + */var Ce=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),St=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Ht=function(M){Ce(f,M);function f(){var d=M.call(this,f.TEMPLATE)||this;return d.refreshCount=0,d.eCurrent=d.queryForHtmlElement(".ag-value-slide-current"),d}return f.prototype.init=function(d){this.refresh(d)},f.prototype.addSlideAnimation=function(){var d=this;this.refreshCount++;var g=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious),this.ePrevious=Au(''),this.ePrevious.innerHTML=this.eCurrent.innerHTML,this.getGui().insertBefore(this.ePrevious,this.eCurrent),window.setTimeout(function(){g===d.refreshCount&&d.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(function(){g===d.refreshCount&&(d.getGui().removeChild(d.ePrevious),d.ePrevious=null)},3e3)},f.prototype.refresh=function(d){var g=d.value;return r(g)&&(g=""),g===this.lastValue||this.filterManager.isSuppressFlashingCellsBecauseFiltering()?!1:(this.addSlideAnimation(),this.lastValue=g,i(d.valueFormatted)?this.eCurrent.innerHTML=d.valueFormatted:i(d.value)?this.eCurrent.innerHTML=g:ju(this.eCurrent),!0)},f.TEMPLATE=` - `,xt([ce("filterManager")],f.prototype,"filterManager",void 0),f}(Sa);/** + `,St([pe("filterManager")],f.prototype,"filterManager",void 0),f}(Ma);/** * @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/ * @license MIT - */(function(M){M[M.Above=0]="Above",M[M.Below=1]="Below"})(t.RowHighlightPosition||(t.RowHighlightPosition={}));var si=function(){function M(f){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=M.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.selected=!1,this.onRowHeightChangedDebounced=Tt(this.onRowHeightChanged.bind(this),100),this.beans=f}return M.prototype.setData=function(f){this.setDataCommon(f,!1)},M.prototype.updateData=function(f){this.setDataCommon(f,!0)},M.prototype.setDataCommon=function(f,h){var g=this.data;this.data=f,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable();var x=this.createDataChangedEvent(f,g,h);this.dispatchLocalEvent(x)},M.prototype.updateDataOnDetailNode=function(){this.detailNode&&(this.detailNode.data=this.data)},M.prototype.createDataChangedEvent=function(f,h,g){return{type:M.EVENT_DATA_CHANGED,node:this,oldData:h,newData:f,update:g}},M.prototype.createLocalRowEvent=function(f){return{type:f,node:this}},M.prototype.getRowIndexString=function(){return this.rowPinned===Ue.PINNED_TOP?"t-"+this.rowIndex:this.rowPinned===Ue.PINNED_BOTTOM?"b-"+this.rowIndex:this.rowIndex.toString()},M.prototype.createDaemonNode=function(){var f=new M(this.beans);return f.id=this.id,f.data=this.data,f.daemon=!0,f.selected=this.selected,f.level=this.level,f},M.prototype.setDataAndId=function(f,h){var g=i(this.id)?this.createDaemonNode():null,x=this.data;this.data=f,this.updateDataOnDetailNode(),this.setId(h),this.beans.selectionService.syncInRowNode(this,g),this.checkRowSelectable();var P=this.createDataChangedEvent(f,x,!1);this.dispatchLocalEvent(P)},M.prototype.checkRowSelectable=function(){var f=this.beans.gridOptionsWrapper.getIsRowSelectableFunc();this.setRowSelectable(f?f(this):!0)},M.prototype.setRowSelectable=function(f){this.selectable!==f&&(this.selectable=f,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(M.EVENT_SELECTABLE_CHANGED)))},M.prototype.setId=function(f){var h=this.beans.gridOptionsWrapper.getRowIdFunc();if(h)if(this.data){var g=this.getGroupKeys(!0);this.id=h({data:this.data,parentKeys:g.length>0?g:void 0,level:this.level}),this.id!==null&&typeof this.id=="string"&&this.id.startsWith(M.ID_PREFIX_ROW_GROUP)&&console.error("AG Grid: Row IDs cannot start with "+M.ID_PREFIX_ROW_GROUP+", this is a reserved prefix for AG Grid's row grouping feature."),this.id!==null&&typeof this.id!="string"&&(this.id=""+this.id)}else this.id=void 0;else this.id=f},M.prototype.getGroupKeys=function(f){f===void 0&&(f=!1);var h=[],g=this;for(f&&(g=g.parent);g&&g.level>=0;)h.push(g.key),g=g.parent;return h.reverse(),h},M.prototype.isPixelInRange=function(f){return!i(this.rowTop)||!i(this.rowHeight)?!1:f>=this.rowTop&&fg&&(g=ee)}),!f&&((h||g<10)&&(g=this.beans.gridOptionsWrapper.getRowHeightForNode(this).height),g!=this.rowHeight&&(this.setRowHeight(g),this.onRowHeightChangedDebounced()))}},M.prototype.onRowHeightChanged=function(){var f=this.beans.rowModel;f.onRowHeightChanged&&f.onRowHeightChanged()},M.prototype.setRowIndex=function(f){this.rowIndex!==f&&(this.rowIndex=f,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(M.EVENT_ROW_INDEX_CHANGED)))},M.prototype.setUiLevel=function(f){this.uiLevel!==f&&(this.uiLevel=f,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(M.EVENT_UI_LEVEL_CHANGED)))},M.prototype.setExpanded=function(f,h){if(this.expanded!==f){this.expanded=f,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(M.EVENT_EXPANDED_CHANGED));var g=Object.assign({},this.createGlobalRowEvent(li.EVENT_ROW_GROUP_OPENED),{expanded:f,event:h||null});this.beans.rowNodeEventThrottle.dispatchExpanded(g),this.beans.gridOptionsWrapper.isGroupIncludeFooter()&&this.beans.rowRenderer.refreshCells({rowNodes:[this]})}},M.prototype.createGlobalRowEvent=function(f){return{type:f,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned,context:this.beans.gridOptionsWrapper.getContext(),api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi()}},M.prototype.dispatchLocalEvent=function(f){this.eventService&&this.eventService.dispatchEvent(f)},M.prototype.setDataValue=function(f,h,g){var x=this.beans.columnModel.getPrimaryColumn(f),P=this.beans.valueService.getValue(x,this),z=this.beans.valueService.setValue(this,x,h,g);return this.dispatchCellChangedEvent(x,h,P),z},M.prototype.setGroupValue=function(f,h){var g=this.beans.columnModel.getGridColumn(f);r(this.groupData)&&(this.groupData={});var x=g.getColId(),P=this.groupData[x];P!==h&&(this.groupData[x]=h,this.dispatchCellChangedEvent(g,h,P))},M.prototype.setAggData=function(f){var h=this,g=te([this.aggData,f]),x=this.aggData;this.aggData=f,this.eventService&&g.forEach(function(P){var z=h.beans.columnModel.getGridColumn(P),ee=h.aggData?h.aggData[P]:void 0,Me=x?x[P]:void 0;h.dispatchCellChangedEvent(z,ee,Me)})},M.prototype.updateHasChildren=function(){var f=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;f!==this.__hasChildren&&(this.__hasChildren=!!f,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(M.EVENT_HAS_CHILDREN_CHANGED)))},M.prototype.hasChildren=function(){return this.__hasChildren==null&&this.updateHasChildren(),this.__hasChildren},M.prototype.isEmptyRowGroupNode=function(){return this.group&&n(this.childrenAfterGroup)},M.prototype.dispatchCellChangedEvent=function(f,h,g){var x={type:M.EVENT_CELL_CHANGED,node:this,column:f,newValue:h,oldValue:g};this.dispatchLocalEvent(x)},M.prototype.resetQuickFilterAggregateText=function(){this.quickFilterAggregateText=null},M.prototype.isExpandable=function(){return!!(this.hasChildren()&&!this.footer||this.master)},M.prototype.isSelected=function(){return this.footer?this.sibling.isSelected():this.selected},M.prototype.depthFirstSearch=function(f){this.childrenAfterGroup&&this.childrenAfterGroup.forEach(function(h){return h.depthFirstSearch(f)}),f(this)},M.prototype.calculateSelectedFromChildren=function(){var f,h=!1,g=!1,x=!1,P;if(!((f=this.childrenAfterGroup)===null||f===void 0)&&f.length){for(var z=0;z0){this.beans.selectionService.updateGroupsFromChildrenSelections();var hr={type:li.EVENT_SELECTION_CHANGED,api:this.beans.gridApi,columnApi:this.beans.columnApi};this.beans.eventService.dispatchEvent(hr)}x&&this.beans.selectionService.setLastSelectedNode(this)}return Zt},M.prototype.doRowRangeSelection=function(f){var h=this;f===void 0&&(f=!0);var g=this.beans.gridOptionsWrapper.isGroupSelectsChildren(),x=this.beans.selectionService.getLastSelectedNode(),P=this.beans.rowModel.getNodesInRangeForSelection(this,x),z=0;P.forEach(function(Me){if(!(Me.group&&g||f===!1&&h===Me)){var je=Me.selectThisNode(f);je&&z++}}),this.beans.selectionService.updateGroupsFromChildrenSelections();var ee={type:li.EVENT_SELECTION_CHANGED,api:this.beans.gridApi,columnApi:this.beans.columnApi};return this.beans.eventService.dispatchEvent(ee),z},M.prototype.isParentOfNode=function(f){for(var h=this.parent;h;){if(h===f)return!0;h=h.parent}return!1},M.prototype.selectThisNode=function(f){var h=!this.selectable&&f,g=this.selected===f;if(h||g)return!1;this.selected=f,this.eventService&&this.dispatchLocalEvent(this.createLocalRowEvent(M.EVENT_ROW_SELECTED));var x=this.createGlobalRowEvent(li.EVENT_ROW_SELECTED);return this.beans.eventService.dispatchEvent(x),!0},M.prototype.selectChildNodes=function(f,h){var g=h?this.childrenAfterAggFilter:this.childrenAfterGroup;if(r(g))return 0;for(var x=0,P=0;P0?g:void 0,level:this.level}),this.id!==null&&typeof this.id=="string"&&this.id.startsWith(M.ID_PREFIX_ROW_GROUP)&&console.error("AG Grid: Row IDs cannot start with "+M.ID_PREFIX_ROW_GROUP+", this is a reserved prefix for AG Grid's row grouping feature."),this.id!==null&&typeof this.id!="string"&&(this.id=""+this.id)}else this.id=void 0;else this.id=f},M.prototype.getGroupKeys=function(f){f===void 0&&(f=!1);var d=[],g=this;for(f&&(g=g.parent);g&&g.level>=0;)d.push(g.key),g=g.parent;return d.reverse(),d},M.prototype.isPixelInRange=function(f){return!i(this.rowTop)||!i(this.rowHeight)?!1:f>=this.rowTop&&fg&&(g=te)}),!f&&((d||g<10)&&(g=this.beans.gridOptionsWrapper.getRowHeightForNode(this).height),g!=this.rowHeight&&(this.setRowHeight(g),this.onRowHeightChangedDebounced()))}},M.prototype.onRowHeightChanged=function(){var f=this.beans.rowModel;f.onRowHeightChanged&&f.onRowHeightChanged()},M.prototype.setRowIndex=function(f){this.rowIndex!==f&&(this.rowIndex=f,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(M.EVENT_ROW_INDEX_CHANGED)))},M.prototype.setUiLevel=function(f){this.uiLevel!==f&&(this.uiLevel=f,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(M.EVENT_UI_LEVEL_CHANGED)))},M.prototype.setExpanded=function(f,d){if(this.expanded!==f){this.expanded=f,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(M.EVENT_EXPANDED_CHANGED));var g=Object.assign({},this.createGlobalRowEvent(ui.EVENT_ROW_GROUP_OPENED),{expanded:f,event:d||null});this.beans.rowNodeEventThrottle.dispatchExpanded(g),this.beans.gridOptionsWrapper.isGroupIncludeFooter()&&this.beans.rowRenderer.refreshCells({rowNodes:[this]})}},M.prototype.createGlobalRowEvent=function(f){return{type:f,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned,context:this.beans.gridOptionsWrapper.getContext(),api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi()}},M.prototype.dispatchLocalEvent=function(f){this.eventService&&this.eventService.dispatchEvent(f)},M.prototype.setDataValue=function(f,d,g){var S=this.beans.columnModel.getPrimaryColumn(f),O=this.beans.valueService.getValue(S,this),z=this.beans.valueService.setValue(this,S,d,g);return this.dispatchCellChangedEvent(S,d,O),z},M.prototype.setGroupValue=function(f,d){var g=this.beans.columnModel.getGridColumn(f);r(this.groupData)&&(this.groupData={});var S=g.getColId(),O=this.groupData[S];O!==d&&(this.groupData[S]=d,this.dispatchCellChangedEvent(g,d,O))},M.prototype.setAggData=function(f){var d=this,g=Z([this.aggData,f]),S=this.aggData;this.aggData=f,this.eventService&&g.forEach(function(O){var z=d.beans.columnModel.getGridColumn(O),te=d.aggData?d.aggData[O]:void 0,Fe=S?S[O]:void 0;d.dispatchCellChangedEvent(z,te,Fe)})},M.prototype.updateHasChildren=function(){var f=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;f!==this.__hasChildren&&(this.__hasChildren=!!f,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(M.EVENT_HAS_CHILDREN_CHANGED)))},M.prototype.hasChildren=function(){return this.__hasChildren==null&&this.updateHasChildren(),this.__hasChildren},M.prototype.isEmptyRowGroupNode=function(){return this.group&&n(this.childrenAfterGroup)},M.prototype.dispatchCellChangedEvent=function(f,d,g){var S={type:M.EVENT_CELL_CHANGED,node:this,column:f,newValue:d,oldValue:g};this.dispatchLocalEvent(S)},M.prototype.resetQuickFilterAggregateText=function(){this.quickFilterAggregateText=null},M.prototype.isExpandable=function(){return!!(this.hasChildren()&&!this.footer||this.master)},M.prototype.isSelected=function(){return this.footer?this.sibling.isSelected():this.selected},M.prototype.depthFirstSearch=function(f){this.childrenAfterGroup&&this.childrenAfterGroup.forEach(function(d){return d.depthFirstSearch(f)}),f(this)},M.prototype.calculateSelectedFromChildren=function(){var f,d=!1,g=!1,S=!1,O;if(!((f=this.childrenAfterGroup)===null||f===void 0)&&f.length){for(var z=0;z0){this.beans.selectionService.updateGroupsFromChildrenSelections();var _r={type:ui.EVENT_SELECTION_CHANGED,api:this.beans.gridApi,columnApi:this.beans.columnApi};this.beans.eventService.dispatchEvent(_r)}S&&this.beans.selectionService.setLastSelectedNode(this)}return ni},M.prototype.doRowRangeSelection=function(f){var d=this;f===void 0&&(f=!0);var g=this.beans.gridOptionsWrapper.isGroupSelectsChildren(),S=this.beans.selectionService.getLastSelectedNode(),O=this.beans.rowModel.getNodesInRangeForSelection(this,S),z=0;O.forEach(function(Fe){if(!(Fe.group&&g||f===!1&&d===Fe)){var Ue=Fe.selectThisNode(f);Ue&&z++}}),this.beans.selectionService.updateGroupsFromChildrenSelections();var te={type:ui.EVENT_SELECTION_CHANGED,api:this.beans.gridApi,columnApi:this.beans.columnApi};return this.beans.eventService.dispatchEvent(te),z},M.prototype.isParentOfNode=function(f){for(var d=this.parent;d;){if(d===f)return!0;d=d.parent}return!1},M.prototype.selectThisNode=function(f){var d=!this.selectable&&f,g=this.selected===f;if(d||g)return!1;this.selected=f,this.eventService&&this.dispatchLocalEvent(this.createLocalRowEvent(M.EVENT_ROW_SELECTED));var S=this.createGlobalRowEvent(ui.EVENT_ROW_SELECTED);return this.beans.eventService.dispatchEvent(S),!0},M.prototype.selectChildNodes=function(f,d){var g=d?this.childrenAfterAggFilter:this.childrenAfterGroup;if(r(g))return 0;for(var S=0,O=0;O=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},rc=function(M){Un(f,M);function f(){return M.call(this,` + */var is=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Pl=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},hc=function(M){is(f,M);function f(){return M.call(this,` `)||this}return f.prototype.postConstruct=function(){this.eCheckbox.setPassive(!0)},f.prototype.getCheckboxId=function(){return this.eCheckbox.getInputElement().id},f.prototype.onDataChanged=function(){this.onSelectionChanged()},f.prototype.onSelectableChanged=function(){this.showOrHideSelect()},f.prototype.onSelectionChanged=function(){var h=this.gridOptionsWrapper.getLocaleTextFunc(),g=this.rowNode.isSelected(),x=g===void 0?h("ariaIndeterminate","indeterminate"):g===!0?h("ariaChecked","checked"):h("ariaUnchecked","unchecked"),P=h("ariaRowToggleSelection","Press Space to toggle row selection");this.eCheckbox.setValue(g,!0),this.eCheckbox.setInputAriaLabel(P+" ("+x+")")},f.prototype.onCheckedClicked=function(h){var g=this.gridOptionsWrapper.isGroupSelectsFiltered(),x=this.rowNode.setSelectedParams({newValue:!1,rangeSelect:h.shiftKey,groupSelectsFiltered:g});return x},f.prototype.onUncheckedClicked=function(h){var g=this.gridOptionsWrapper.isGroupSelectsFiltered(),x=this.rowNode.setSelectedParams({newValue:!0,rangeSelect:h.shiftKey,groupSelectsFiltered:g});return x},f.prototype.init=function(h){var g=this;this.rowNode=h.rowNode,this.column=h.column,this.onSelectionChanged(),this.addGuiEventListener("click",function(ee){return Ri(ee)}),this.addGuiEventListener("dblclick",function(ee){return Ri(ee)}),this.addManagedListener(this.eCheckbox.getInputElement(),"click",function(ee){var Me=g.eCheckbox.getValue(),je=g.eCheckbox.getPreviousValue();if(je===void 0||Me===void 0){var ut=g.onUncheckedClicked(ee||{});ut===0&&g.onCheckedClicked(ee)}else Me?g.onCheckedClicked(ee):g.onUncheckedClicked(ee||{})}),this.addManagedListener(this.rowNode,si.EVENT_ROW_SELECTED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.rowNode,si.EVENT_DATA_CHANGED,this.onDataChanged.bind(this)),this.addManagedListener(this.rowNode,si.EVENT_SELECTABLE_CHANGED,this.onSelectableChanged.bind(this));var x=this.gridOptionsWrapper.getIsRowSelectableFunc(),P=x||this.checkboxCallbackExists();if(P){var z=this.showOrHideSelect.bind(this);this.addManagedListener(this.eventService,li.EVENT_DISPLAYED_COLUMNS_CHANGED,z),this.addManagedListener(this.rowNode,si.EVENT_DATA_CHANGED,z),this.addManagedListener(this.rowNode,si.EVENT_CELL_CHANGED,z),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")},f.prototype.showOrHideSelect=function(){var h=this.rowNode.selectable;h&&this.checkboxCallbackExists()&&(h=this.column.isCellCheckboxSelection(this.rowNode)),this.setVisible(h)},f.prototype.checkboxCallbackExists=function(){var h=this.column?this.column.getColDef():null;return!!h&&typeof h.checkboxSelection=="function"},bl([zr("eCheckbox")],f.prototype,"eCheckbox",void 0),bl([it],f.prototype,"postConstruct",null),f}(Sa);/** + `)||this}return f.prototype.postConstruct=function(){this.eCheckbox.setPassive(!0)},f.prototype.getCheckboxId=function(){return this.eCheckbox.getInputElement().id},f.prototype.onDataChanged=function(){this.onSelectionChanged()},f.prototype.onSelectableChanged=function(){this.showOrHideSelect()},f.prototype.onSelectionChanged=function(){var d=this.gridOptionsWrapper.getLocaleTextFunc(),g=this.rowNode.isSelected(),S=g===void 0?d("ariaIndeterminate","indeterminate"):g===!0?d("ariaChecked","checked"):d("ariaUnchecked","unchecked"),O=d("ariaRowToggleSelection","Press Space to toggle row selection");this.eCheckbox.setValue(g,!0),this.eCheckbox.setInputAriaLabel(O+" ("+S+")")},f.prototype.onCheckedClicked=function(d){var g=this.gridOptionsWrapper.isGroupSelectsFiltered(),S=this.rowNode.setSelectedParams({newValue:!1,rangeSelect:d.shiftKey,groupSelectsFiltered:g});return S},f.prototype.onUncheckedClicked=function(d){var g=this.gridOptionsWrapper.isGroupSelectsFiltered(),S=this.rowNode.setSelectedParams({newValue:!0,rangeSelect:d.shiftKey,groupSelectsFiltered:g});return S},f.prototype.init=function(d){var g=this;this.rowNode=d.rowNode,this.column=d.column,this.onSelectionChanged(),this.addGuiEventListener("click",function(te){return Ni(te)}),this.addGuiEventListener("dblclick",function(te){return Ni(te)}),this.addManagedListener(this.eCheckbox.getInputElement(),"click",function(te){var Fe=g.eCheckbox.getValue(),Ue=g.eCheckbox.getPreviousValue();if(Ue===void 0||Fe===void 0){var ut=g.onUncheckedClicked(te||{});ut===0&&g.onCheckedClicked(te)}else Fe?g.onCheckedClicked(te):g.onUncheckedClicked(te||{})}),this.addManagedListener(this.rowNode,li.EVENT_ROW_SELECTED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.rowNode,li.EVENT_DATA_CHANGED,this.onDataChanged.bind(this)),this.addManagedListener(this.rowNode,li.EVENT_SELECTABLE_CHANGED,this.onSelectableChanged.bind(this));var S=this.gridOptionsWrapper.getIsRowSelectableFunc(),O=S||this.checkboxCallbackExists();if(O){var z=this.showOrHideSelect.bind(this);this.addManagedListener(this.eventService,ui.EVENT_DISPLAYED_COLUMNS_CHANGED,z),this.addManagedListener(this.rowNode,li.EVENT_DATA_CHANGED,z),this.addManagedListener(this.rowNode,li.EVENT_CELL_CHANGED,z),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")},f.prototype.showOrHideSelect=function(){var d=this.rowNode.selectable;d&&this.checkboxCallbackExists()&&(d=this.column.isCellCheckboxSelection(this.rowNode)),this.setVisible(d)},f.prototype.checkboxCallbackExists=function(){var d=this.column?this.column.getColDef():null;return!!d&&typeof d.checkboxSelection=="function"},Pl([tn("eCheckbox")],f.prototype,"eCheckbox",void 0),Pl([ht],f.prototype,"postConstruct",null),f}(Ma);/** * @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/ * @license MIT - */var nh=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),PI=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},B0e=function(M){var f=typeof Symbol=="function"&&Symbol.iterator,h=f&&M[f],g=0;if(h)return h.call(M);if(M&&typeof M.length=="number")return{next:function(){return M&&g>=M.length&&(M=void 0),{value:M&&M[g++],done:!M}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(M){M[M.ToolPanel=0]="ToolPanel",M[M.HeaderCell=1]="HeaderCell",M[M.RowDrag=2]="RowDrag",M[M.ChartPanel=3]="ChartPanel"})(t.DragSourceType||(t.DragSourceType={})),function(M){M[M.Up=0]="Up",M[M.Down=1]="Down"}(t.VerticalDirection||(t.VerticalDirection={})),function(M){M[M.Left=0]="Left",M[M.Right=1]="Right"}(t.HorizontalDirection||(t.HorizontalDirection={}));var Lg=function(M){nh(f,M);function f(){var g=M!==null&&M.apply(this,arguments)||this;return g.dragSourceAndParamsList=[],g.dropTargets=[],g}h=f,f.prototype.init=function(){this.ePinnedIcon=nt("columnMovePin",this.gridOptionsWrapper,null),this.eHideIcon=nt("columnMoveHide",this.gridOptionsWrapper,null),this.eMoveIcon=nt("columnMoveMove",this.gridOptionsWrapper,null),this.eLeftIcon=nt("columnMoveLeft",this.gridOptionsWrapper,null),this.eRightIcon=nt("columnMoveRight",this.gridOptionsWrapper,null),this.eGroupIcon=nt("columnMoveGroup",this.gridOptionsWrapper,null),this.eAggregateIcon=nt("columnMoveValue",this.gridOptionsWrapper,null),this.ePivotIcon=nt("columnMovePivot",this.gridOptionsWrapper,null),this.eDropNotAllowedIcon=nt("dropNotAllowed",this.gridOptionsWrapper,null)},f.prototype.addDragSource=function(g,x){x===void 0&&(x=!1);var P={eElement:g.eElement,dragStartPixels:g.dragStartPixels,onDragStart:this.onDragStart.bind(this,g),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this)};this.dragSourceAndParamsList.push({params:P,dragSource:g}),this.dragService.addDragSource(P,x)},f.prototype.removeDragSource=function(g){var x=this.dragSourceAndParamsList.find(function(P){return P.dragSource===g});x&&(this.dragService.removeDragSource(x.params),q(this.dragSourceAndParamsList,x))},f.prototype.clearDragSourceParamsList=function(){var g=this;this.dragSourceAndParamsList.forEach(function(x){return g.dragService.removeDragSource(x.params)}),this.dragSourceAndParamsList.length=0},f.prototype.nudge=function(){this.dragging&&this.onDragging(this.eventLastTime,!0)},f.prototype.onDragStart=function(g,x){this.dragging=!0,this.dragSource=g,this.eventLastTime=x,this.dragItem=this.dragSource.getDragItem(),this.lastDropTarget=this.dragSource.dragSourceDropTarget,this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()},f.prototype.onDragStop=function(g){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){var x=this.createDropTargetEvent(this.lastDropTarget,g,null,null,!1);this.lastDropTarget.onDragStop(x)}this.lastDropTarget=null,this.dragItem=null,this.removeGhost()},f.prototype.onDragging=function(g,x){var P=this,z=this.getHorizontalDirection(g),ee=this.getVerticalDirection(g);this.eventLastTime=g,this.positionGhost(g);var Me=this.dropTargets.filter(function(Zt){return P.isMouseOnDropTarget(g,Zt)}),je=Me.length,ut=null;if(je>0&&(ut=je===1?Me[0]:Me.reduce(function(Zt,vi){if(!Zt)return vi;var Ci=Zt.getContainer(),qi=vi.getContainer();return Ci.contains(qi)?vi:Zt})),ut!==this.lastDropTarget)this.leaveLastTargetIfExists(g,z,ee,x),this.enterDragTargetIfExists(ut,g,z,ee,x),this.lastDropTarget=ut;else if(ut&&ut.onDragging){var Rt=this.createDropTargetEvent(ut,g,z,ee,x);ut.onDragging(Rt)}},f.prototype.enterDragTargetIfExists=function(g,x,P,z,ee){if(g){if(g.onDragEnter){var Me=this.createDropTargetEvent(g,x,P,z,ee);g.onDragEnter(Me)}this.setGhostIcon(g.getIconName?g.getIconName():null)}},f.prototype.leaveLastTargetIfExists=function(g,x,P,z){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){var ee=this.createDropTargetEvent(this.lastDropTarget,g,x,P,z);this.lastDropTarget.onDragLeave(ee)}this.setGhostIcon(null)}},f.prototype.getAllContainersFromDropTarget=function(g){var x=g.getSecondaryContainers?g.getSecondaryContainers():null,P=[[g.getContainer()]];return x?P.concat(x):P},f.prototype.allContainersIntersect=function(g,x){var P,z;try{for(var ee=B0e(x),Me=ee.next();!Me.done;Me=ee.next()){var je=Me.value,ut=je.getBoundingClientRect();if(ut.width===0||ut.height===0)return!1;var Rt=g.clientX>=ut.left&&g.clientX=ut.top&&g.clientYP?t.HorizontalDirection.Left:t.HorizontalDirection.Right},f.prototype.getVerticalDirection=function(g){var x=this.eventLastTime&&this.eventLastTime.clientY,P=g.clientY;return x===P?null:x>P?t.VerticalDirection.Up:t.VerticalDirection.Down},f.prototype.createDropTargetEvent=function(g,x,P,z,ee){var Me=g.getContainer(),je=Me.getBoundingClientRect(),ut=this,Rt=ut.gridApi,Zt=ut.columnApi,vi=ut.dragItem,Ci=ut.dragSource,qi=x.clientX-je.left,hr=x.clientY-je.top;return{event:x,x:qi,y:hr,vDirection:z,hDirection:P,dragSource:Ci,fromNudge:ee,dragItem:vi,api:Rt,columnApi:Zt,dropZoneTarget:Me}},f.prototype.positionGhost=function(g){var x=this.eGhost;if(x){var P=x.getBoundingClientRect(),z=P.height,ee=Ph()-2,Me=Ag()-2,je=g.pageY-z/2,ut=g.pageX-10,Rt=this.gridOptionsWrapper.getDocument(),Zt=Rt.defaultView||window,vi=Zt.pageYOffset||Rt.documentElement.scrollTop,Ci=Zt.pageXOffset||Rt.documentElement.scrollLeft;ee>0&&ut+x.clientWidth>ee+Ci&&(ut=ee+Ci-x.clientWidth),ut<0&&(ut=0),Me>0&&je+x.clientHeight>Me+vi&&(je=Me+vi-x.clientHeight),je<0&&(je=0),x.style.left=ut+"px",x.style.top=je+"px"}},f.prototype.removeGhost=function(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null},f.prototype.createGhost=function(){this.eGhost=yu(h.GHOST_TEMPLATE);var g=this.environment.getTheme().theme;g&&this.eGhost.classList.add(g),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);var x=this.eGhost.querySelector(".ag-dnd-ghost-label"),P=this.dragSource.dragItemName;et(P)&&(P=P()),x.innerHTML=_t(P)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";var z=this.gridOptionsWrapper.getDocument(),ee=null;try{ee=z.fullscreenElement}catch{}finally{ee||(ee=z.querySelector("body"))}this.eGhostParent=ee,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):console.warn("AG Grid: could not find document body, it is needed for dragging columns")},f.prototype.setGhostIcon=function(g,x){x===void 0&&(x=!1),Ou(this.eGhostIcon);var P=null;switch(g||(g=this.dragSource.defaultIconName||h.ICON_NOT_ALLOWED),g){case h.ICON_PINNED:P=this.ePinnedIcon;break;case h.ICON_MOVE:P=this.eMoveIcon;break;case h.ICON_LEFT:P=this.eLeftIcon;break;case h.ICON_RIGHT:P=this.eRightIcon;break;case h.ICON_GROUP:P=this.eGroupIcon;break;case h.ICON_AGGREGATE:P=this.eAggregateIcon;break;case h.ICON_PIVOT:P=this.ePivotIcon;break;case h.ICON_NOT_ALLOWED:P=this.eDropNotAllowedIcon;break;case h.ICON_HIDE:P=this.eHideIcon;break}this.eGhostIcon.classList.toggle("ag-shake-left-to-right",x),!(P===this.eHideIcon&&this.gridOptionsWrapper.isSuppressDragLeaveHidesColumns())&&P&&this.eGhostIcon.appendChild(P)};var h;return f.ICON_PINNED="pinned",f.ICON_MOVE="move",f.ICON_LEFT="left",f.ICON_RIGHT="right",f.ICON_GROUP="group",f.ICON_AGGREGATE="aggregate",f.ICON_PIVOT="pivot",f.ICON_NOT_ALLOWED="notAllowed",f.ICON_HIDE="hide",f.GHOST_TEMPLATE=`
+ */var ch=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),PI=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},G0e=function(M){var f=typeof Symbol=="function"&&Symbol.iterator,d=f&&M[f],g=0;if(d)return d.call(M);if(M&&typeof M.length=="number")return{next:function(){return M&&g>=M.length&&(M=void 0),{value:M&&M[g++],done:!M}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(M){M[M.ToolPanel=0]="ToolPanel",M[M.HeaderCell=1]="HeaderCell",M[M.RowDrag=2]="RowDrag",M[M.ChartPanel=3]="ChartPanel"})(t.DragSourceType||(t.DragSourceType={})),function(M){M[M.Up=0]="Up",M[M.Down=1]="Down"}(t.VerticalDirection||(t.VerticalDirection={})),function(M){M[M.Left=0]="Left",M[M.Right=1]="Right"}(t.HorizontalDirection||(t.HorizontalDirection={}));var Bg=function(M){ch(f,M);function f(){var g=M!==null&&M.apply(this,arguments)||this;return g.dragSourceAndParamsList=[],g.dropTargets=[],g}d=f,f.prototype.init=function(){this.ePinnedIcon=rt("columnMovePin",this.gridOptionsWrapper,null),this.eHideIcon=rt("columnMoveHide",this.gridOptionsWrapper,null),this.eMoveIcon=rt("columnMoveMove",this.gridOptionsWrapper,null),this.eLeftIcon=rt("columnMoveLeft",this.gridOptionsWrapper,null),this.eRightIcon=rt("columnMoveRight",this.gridOptionsWrapper,null),this.eGroupIcon=rt("columnMoveGroup",this.gridOptionsWrapper,null),this.eAggregateIcon=rt("columnMoveValue",this.gridOptionsWrapper,null),this.ePivotIcon=rt("columnMovePivot",this.gridOptionsWrapper,null),this.eDropNotAllowedIcon=rt("dropNotAllowed",this.gridOptionsWrapper,null)},f.prototype.addDragSource=function(g,S){S===void 0&&(S=!1);var O={eElement:g.eElement,dragStartPixels:g.dragStartPixels,onDragStart:this.onDragStart.bind(this,g),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this)};this.dragSourceAndParamsList.push({params:O,dragSource:g}),this.dragService.addDragSource(O,S)},f.prototype.removeDragSource=function(g){var S=this.dragSourceAndParamsList.find(function(O){return O.dragSource===g});S&&(this.dragService.removeDragSource(S.params),q(this.dragSourceAndParamsList,S))},f.prototype.clearDragSourceParamsList=function(){var g=this;this.dragSourceAndParamsList.forEach(function(S){return g.dragService.removeDragSource(S.params)}),this.dragSourceAndParamsList.length=0},f.prototype.nudge=function(){this.dragging&&this.onDragging(this.eventLastTime,!0)},f.prototype.onDragStart=function(g,S){this.dragging=!0,this.dragSource=g,this.eventLastTime=S,this.dragItem=this.dragSource.getDragItem(),this.lastDropTarget=this.dragSource.dragSourceDropTarget,this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()},f.prototype.onDragStop=function(g){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){var S=this.createDropTargetEvent(this.lastDropTarget,g,null,null,!1);this.lastDropTarget.onDragStop(S)}this.lastDropTarget=null,this.dragItem=null,this.removeGhost()},f.prototype.onDragging=function(g,S){var O=this,z=this.getHorizontalDirection(g),te=this.getVerticalDirection(g);this.eventLastTime=g,this.positionGhost(g);var Fe=this.dropTargets.filter(function(ni){return O.isMouseOnDropTarget(g,ni)}),Ue=Fe.length,ut=null;if(Ue>0&&(ut=Ue===1?Fe[0]:Fe.reduce(function(ni,Si){if(!ni)return Si;var Pi=ni.getContainer(),Qi=Si.getContainer();return Pi.contains(Qi)?Si:ni})),ut!==this.lastDropTarget)this.leaveLastTargetIfExists(g,z,te,S),this.enterDragTargetIfExists(ut,g,z,te,S),this.lastDropTarget=ut;else if(ut&&ut.onDragging){var Mt=this.createDropTargetEvent(ut,g,z,te,S);ut.onDragging(Mt)}},f.prototype.enterDragTargetIfExists=function(g,S,O,z,te){if(g){if(g.onDragEnter){var Fe=this.createDropTargetEvent(g,S,O,z,te);g.onDragEnter(Fe)}this.setGhostIcon(g.getIconName?g.getIconName():null)}},f.prototype.leaveLastTargetIfExists=function(g,S,O,z){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){var te=this.createDropTargetEvent(this.lastDropTarget,g,S,O,z);this.lastDropTarget.onDragLeave(te)}this.setGhostIcon(null)}},f.prototype.getAllContainersFromDropTarget=function(g){var S=g.getSecondaryContainers?g.getSecondaryContainers():null,O=[[g.getContainer()]];return S?O.concat(S):O},f.prototype.allContainersIntersect=function(g,S){var O,z;try{for(var te=G0e(S),Fe=te.next();!Fe.done;Fe=te.next()){var Ue=Fe.value,ut=Ue.getBoundingClientRect();if(ut.width===0||ut.height===0)return!1;var Mt=g.clientX>=ut.left&&g.clientX=ut.top&&g.clientYO?t.HorizontalDirection.Left:t.HorizontalDirection.Right},f.prototype.getVerticalDirection=function(g){var S=this.eventLastTime&&this.eventLastTime.clientY,O=g.clientY;return S===O?null:S>O?t.VerticalDirection.Up:t.VerticalDirection.Down},f.prototype.createDropTargetEvent=function(g,S,O,z,te){var Fe=g.getContainer(),Ue=Fe.getBoundingClientRect(),ut=this,Mt=ut.gridApi,ni=ut.columnApi,Si=ut.dragItem,Pi=ut.dragSource,Qi=S.clientX-Ue.left,_r=S.clientY-Ue.top;return{event:S,x:Qi,y:_r,vDirection:z,hDirection:O,dragSource:Pi,fromNudge:te,dragItem:Si,api:Mt,columnApi:ni,dropZoneTarget:Fe}},f.prototype.positionGhost=function(g){var S=this.eGhost;if(S){var O=S.getBoundingClientRect(),z=O.height,te=Mh()-2,Fe=Mg()-2,Ue=g.pageY-z/2,ut=g.pageX-10,Mt=this.gridOptionsWrapper.getDocument(),ni=Mt.defaultView||window,Si=ni.pageYOffset||Mt.documentElement.scrollTop,Pi=ni.pageXOffset||Mt.documentElement.scrollLeft;te>0&&ut+S.clientWidth>te+Pi&&(ut=te+Pi-S.clientWidth),ut<0&&(ut=0),Fe>0&&Ue+S.clientHeight>Fe+Si&&(Ue=Fe+Si-S.clientHeight),Ue<0&&(Ue=0),S.style.left=ut+"px",S.style.top=Ue+"px"}},f.prototype.removeGhost=function(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null},f.prototype.createGhost=function(){this.eGhost=Au(d.GHOST_TEMPLATE);var g=this.environment.getTheme().theme;g&&this.eGhost.classList.add(g),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);var S=this.eGhost.querySelector(".ag-dnd-ghost-label"),O=this.dragSource.dragItemName;et(O)&&(O=O()),S.innerHTML=_t(O)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";var z=this.gridOptionsWrapper.getDocument(),te=null;try{te=z.fullscreenElement}catch{}finally{te||(te=z.querySelector("body"))}this.eGhostParent=te,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):console.warn("AG Grid: could not find document body, it is needed for dragging columns")},f.prototype.setGhostIcon=function(g,S){S===void 0&&(S=!1),ju(this.eGhostIcon);var O=null;switch(g||(g=this.dragSource.defaultIconName||d.ICON_NOT_ALLOWED),g){case d.ICON_PINNED:O=this.ePinnedIcon;break;case d.ICON_MOVE:O=this.eMoveIcon;break;case d.ICON_LEFT:O=this.eLeftIcon;break;case d.ICON_RIGHT:O=this.eRightIcon;break;case d.ICON_GROUP:O=this.eGroupIcon;break;case d.ICON_AGGREGATE:O=this.eAggregateIcon;break;case d.ICON_PIVOT:O=this.ePivotIcon;break;case d.ICON_NOT_ALLOWED:O=this.eDropNotAllowedIcon;break;case d.ICON_HIDE:O=this.eHideIcon;break}this.eGhostIcon.classList.toggle("ag-shake-left-to-right",S),!(O===this.eHideIcon&&this.gridOptionsWrapper.isSuppressDragLeaveHidesColumns())&&O&&this.eGhostIcon.appendChild(O)};var d;return f.ICON_PINNED="pinned",f.ICON_MOVE="move",f.ICON_LEFT="left",f.ICON_RIGHT="right",f.ICON_GROUP="group",f.ICON_AGGREGATE="aggregate",f.ICON_PIVOT="pivot",f.ICON_NOT_ALLOWED="notAllowed",f.ICON_HIDE="hide",f.GHOST_TEMPLATE=`
-
`,PI([ce("dragService")],f.prototype,"dragService",void 0),PI([ce("environment")],f.prototype,"environment",void 0),PI([ce("columnApi")],f.prototype,"columnApi",void 0),PI([ce("gridApi")],f.prototype,"gridApi",void 0),PI([it],f.prototype,"init",null),PI([pt],f.prototype,"clearDragSourceParamsList",null),f=h=PI([Le("dragAndDropService")],f),f}($i);/** +
`,PI([pe("dragService")],f.prototype,"dragService",void 0),PI([pe("environment")],f.prototype,"environment",void 0),PI([pe("columnApi")],f.prototype,"columnApi",void 0),PI([pe("gridApi")],f.prototype,"gridApi",void 0),PI([ht],f.prototype,"init",null),PI([wt],f.prototype,"clearDragSourceParamsList",null),f=d=PI([Ne("dragAndDropService")],f),f}(ji);/** * @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/ * @license MIT - */var gc=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),so=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},OI=function(M){gc(f,M);function f(h,g,x,P,z,ee){var Me=M.call(this)||this;return Me.cellValueFn=h,Me.rowNode=g,Me.column=x,Me.customGui=P,Me.dragStartPixels=z,Me.suppressVisibilityChange=ee,Me.dragSource=null,Me}return f.prototype.isCustomGui=function(){return this.customGui!=null},f.prototype.postConstruct=function(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate(''),this.getGui().appendChild(tu("rowDrag",this.beans.gridOptionsWrapper,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){var h=this.beans.gridOptionsWrapper.isRowDragManaged()?new ia(this,this.beans,this.rowNode,this.column):new G0e(this,this.beans,this.rowNode,this.column);this.createManagedBean(h,this.beans.context)}},f.prototype.setDragElement=function(h,g){this.setTemplateFromElement(h),this.addDragSource(g)},f.prototype.getSelectedCount=function(){var h=this.beans.gridOptionsWrapper.isRowDragMultiRow();if(!h)return 1;var g=this.beans.selectionService.getSelectedNodes();return g.indexOf(this.rowNode)!==-1?g.length:1},f.prototype.checkCompatibility=function(){var h=this.beans.gridOptionsWrapper.isRowDragManaged(),g=this.beans.gridOptionsWrapper.isTreeData();g&&h&&ze(function(){return console.warn("AG Grid: If using row drag with tree data, you cannot have rowDragManaged=true")},"RowDragComp.managedAndTreeData")},f.prototype.addDragSource=function(h){var g=this;h===void 0&&(h=4),this.dragSource&&this.removeDragSource();var x={rowNode:this.rowNode,columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()},P=this.column&&this.column.getColDef().rowDragText,z=this.gridOptionsWrapper.getLocaleTextFunc();this.dragSource={type:t.DragSourceType.RowDrag,eElement:this.getGui(),dragItemName:function(){var ee=g.getSelectedCount();return P?P(x,ee):ee===1?g.cellValueFn():ee+" "+z("rowDragRows","rows")},getDragItem:function(){return x},dragStartPixels:h,dragSourceDomDataKey:this.beans.gridOptionsWrapper.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)},f.prototype.removeDragSource=function(){this.dragSource&&this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null},so([ce("beans")],f.prototype,"beans",void 0),so([it],f.prototype,"postConstruct",null),so([pt],f.prototype,"removeDragSource",null),f}(Sa),Zn=function(M){gc(f,M);function f(h,g,x){var P=M.call(this)||this;return P.parent=h,P.rowNode=g,P.column=x,P}return f.prototype.setDisplayedOrVisible=function(h){if(h)this.parent.setDisplayed(!1);else{var g=!0,x=!1;this.column&&(g=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),x=et(this.column.getColDef().rowDrag)),x?(this.parent.setDisplayed(!0),this.parent.setVisible(g)):(this.parent.setDisplayed(g),this.parent.setVisible(!0))}},f}($i),G0e=function(M){gc(f,M);function f(h,g,x,P){var z=M.call(this,h,x,P)||this;return z.beans=g,z}return f.prototype.postConstruct=function(){this.addManagedListener(this.beans.gridOptionsWrapper,"suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.addManagedListener(this.rowNode,si.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,si.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,si.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,li.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.workOutVisibility()},f.prototype.onSuppressRowDrag=function(){this.workOutVisibility()},f.prototype.workOutVisibility=function(){var h=this.beans.gridOptionsWrapper.isSuppressRowDrag();this.setDisplayedOrVisible(h)},so([it],f.prototype,"postConstruct",null),f}(Zn),ia=function(M){gc(f,M);function f(h,g,x,P){var z=M.call(this,h,x,P)||this;return z.beans=g,z}return f.prototype.postConstruct=function(){this.addManagedListener(this.beans.eventService,li.EVENT_SORT_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,li.EVENT_FILTER_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,li.EVENT_COLUMN_ROW_GROUP_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,li.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,si.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,si.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.gridOptionsWrapper,"suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()},f.prototype.onSuppressRowDrag=function(){this.workOutVisibility()},f.prototype.workOutVisibility=function(){var h=this.beans.ctrlsService.getGridBodyCtrl(),g=h.getRowDragFeature(),x=g&&g.shouldPreventRowMove(),P=this.beans.gridOptionsWrapper.isSuppressRowDrag(),z=this.beans.dragAndDropService.hasExternalDropZones(),ee=x&&!z||P;this.setDisplayedOrVisible(ee)},so([it],f.prototype,"postConstruct",null),f}(Zn);/** + */var wc=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),yo=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},OI=function(M){wc(f,M);function f(d,g,S,O,z,te){var Fe=M.call(this)||this;return Fe.cellValueFn=d,Fe.rowNode=g,Fe.column=S,Fe.customGui=O,Fe.dragStartPixels=z,Fe.suppressVisibilityChange=te,Fe.dragSource=null,Fe}return f.prototype.isCustomGui=function(){return this.customGui!=null},f.prototype.postConstruct=function(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate(''),this.getGui().appendChild(hu("rowDrag",this.beans.gridOptionsWrapper,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){var d=this.beans.gridOptionsWrapper.isRowDragManaged()?new ca(this,this.beans,this.rowNode,this.column):new U0e(this,this.beans,this.rowNode,this.column);this.createManagedBean(d,this.beans.context)}},f.prototype.setDragElement=function(d,g){this.setTemplateFromElement(d),this.addDragSource(g)},f.prototype.getSelectedCount=function(){var d=this.beans.gridOptionsWrapper.isRowDragMultiRow();if(!d)return 1;var g=this.beans.selectionService.getSelectedNodes();return g.indexOf(this.rowNode)!==-1?g.length:1},f.prototype.checkCompatibility=function(){var d=this.beans.gridOptionsWrapper.isRowDragManaged(),g=this.beans.gridOptionsWrapper.isTreeData();g&&d&&Ge(function(){return console.warn("AG Grid: If using row drag with tree data, you cannot have rowDragManaged=true")},"RowDragComp.managedAndTreeData")},f.prototype.addDragSource=function(d){var g=this;d===void 0&&(d=4),this.dragSource&&this.removeDragSource();var S={rowNode:this.rowNode,columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()},O=this.column&&this.column.getColDef().rowDragText,z=this.gridOptionsWrapper.getLocaleTextFunc();this.dragSource={type:t.DragSourceType.RowDrag,eElement:this.getGui(),dragItemName:function(){var te=g.getSelectedCount();return O?O(S,te):te===1?g.cellValueFn():te+" "+z("rowDragRows","rows")},getDragItem:function(){return S},dragStartPixels:d,dragSourceDomDataKey:this.beans.gridOptionsWrapper.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)},f.prototype.removeDragSource=function(){this.dragSource&&this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null},yo([pe("beans")],f.prototype,"beans",void 0),yo([ht],f.prototype,"postConstruct",null),yo([wt],f.prototype,"removeDragSource",null),f}(Ma),cs=function(M){wc(f,M);function f(d,g,S){var O=M.call(this)||this;return O.parent=d,O.rowNode=g,O.column=S,O}return f.prototype.setDisplayedOrVisible=function(d){if(d)this.parent.setDisplayed(!1);else{var g=!0,S=!1;this.column&&(g=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),S=et(this.column.getColDef().rowDrag)),S?(this.parent.setDisplayed(!0),this.parent.setVisible(g)):(this.parent.setDisplayed(g),this.parent.setVisible(!0))}},f}(ji),U0e=function(M){wc(f,M);function f(d,g,S,O){var z=M.call(this,d,S,O)||this;return z.beans=g,z}return f.prototype.postConstruct=function(){this.addManagedListener(this.beans.gridOptionsWrapper,"suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.addManagedListener(this.rowNode,li.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,li.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,li.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,ui.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.workOutVisibility()},f.prototype.onSuppressRowDrag=function(){this.workOutVisibility()},f.prototype.workOutVisibility=function(){var d=this.beans.gridOptionsWrapper.isSuppressRowDrag();this.setDisplayedOrVisible(d)},yo([ht],f.prototype,"postConstruct",null),f}(cs),ca=function(M){wc(f,M);function f(d,g,S,O){var z=M.call(this,d,S,O)||this;return z.beans=g,z}return f.prototype.postConstruct=function(){this.addManagedListener(this.beans.eventService,ui.EVENT_SORT_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,ui.EVENT_FILTER_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,ui.EVENT_COLUMN_ROW_GROUP_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,ui.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,li.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,li.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.gridOptionsWrapper,"suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()},f.prototype.onSuppressRowDrag=function(){this.workOutVisibility()},f.prototype.workOutVisibility=function(){var d=this.beans.ctrlsService.getGridBodyCtrl(),g=d.getRowDragFeature(),S=g&&g.shouldPreventRowMove(),O=this.beans.gridOptionsWrapper.isSuppressRowDrag(),z=this.beans.dragAndDropService.hasExternalDropZones(),te=S&&!z||O;this.setDisplayedOrVisible(te)},yo([ht],f.prototype,"postConstruct",null),f}(cs);/** * @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/ * @license MIT - */var Xte=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),dz=function(){return dz=Object.assign||function(M){for(var f,h=1,g=arguments.length;h=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},S3=function(M){Xte(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.init=function(h,g,x,P,z,ee,Me){this.params=Me,this.eGui=g,this.eCheckbox=x,this.eExpanded=P,this.eContracted=z,this.comp=h,this.compClass=ee;var je=this.isTopLevelFooter(),ut=this.isEmbeddedRowMismatch(),Rt=Me.value==null,Zt=!1;if(this.gridOptionsWrapper.isGroupIncludeFooter()&&this.gridOptionsWrapper.isGroupHideOpenParents()){var vi=Me.node;if(vi.footer){var Ci=Me.colDef&&Me.colDef.showRowGroup,qi=vi.rowGroupColumn&&vi.rowGroupColumn.getColId();Zt=Ci!==qi}}this.cellIsBlank=je?!1:ut||Rt||Zt,!this.cellIsBlank&&(this.setupShowingValueForOpenedParent(),this.findDisplayedGroupNode(),this.addFullWidthRowDraggerIfNeeded(),this.addExpandAndContract(),this.addCheckboxIfNeeded(),this.addValueElement(),this.setupIndent(),this.refreshAriaExpanded())},f.prototype.destroy=function(){M.prototype.destroy.call(this),this.expandListener=null},f.prototype.refreshAriaExpanded=function(){var h=this.params,g=h.node,x=h.eParentOfValue;if(this.expandListener&&(this.expandListener=this.expandListener()),!this.isExpandable()){rh(x);return}var P=function(){yo(x,!!g.expanded)};this.expandListener=this.addManagedListener(g,si.EVENT_EXPANDED_CHANGED,P)||null,P()},f.prototype.isTopLevelFooter=function(){if(!this.gridOptionsWrapper.isGroupIncludeTotalFooter()||this.params.value!=null||this.params.node.level!=-1)return!1;var h=this.params.colDef,g=h==null;if(g||h.showRowGroup===!0)return!0;var x=this.columnModel.getRowGroupColumns();if(!x||x.length===0)return!0;var P=x[0];return P.getId()===h.showRowGroup},f.prototype.isEmbeddedRowMismatch=function(){if(!this.params.fullWidth||!this.gridOptionsWrapper.isEmbedFullWidthRows())return!1;var h=this.params.pinned===Ue.PINNED_LEFT,g=this.params.pinned===Ue.PINNED_RIGHT,x=!h&&!g;return this.gridOptionsWrapper.isEnableRtl()?this.columnModel.isPinningLeft()?!g:!x:this.columnModel.isPinningLeft()?!h:!x},f.prototype.findDisplayedGroupNode=function(){var h=this.params.column,g=this.params.node;if(this.showingValueForOpenedParent)for(var x=g.parent;x!=null;){if(x.rowGroupColumn&&h.isRowGroupDisplayed(x.rowGroupColumn.getId())){this.displayedGroupNode=x;break}x=x.parent}r(this.displayedGroupNode)&&(this.displayedGroupNode=g)},f.prototype.setupShowingValueForOpenedParent=function(){var h=this.params.node,g=this.params.column;if(!this.gridOptionsWrapper.isGroupHideOpenParents()){this.showingValueForOpenedParent=!1;return}if(!h.groupData){this.showingValueForOpenedParent=!1;return}var x=h.rowGroupColumn!=null;if(x){var P=h.rowGroupColumn.getId(),z=g.isRowGroupDisplayed(P);if(z){this.showingValueForOpenedParent=!1;return}}var ee=h.groupData[g.getId()]!=null;this.showingValueForOpenedParent=ee},f.prototype.addValueElement=function(){this.displayedGroupNode.footer?this.addFooterValue():(this.addGroupValue(),this.addChildCount())},f.prototype.addGroupValue=function(){var h=this.adjustParamsWithDetailsFromRelatedColumn(),g=this.getInnerCompDetails(h),x=h.valueFormatted,P=h.value,z=x??P;this.comp.setInnerRenderer(g,z)},f.prototype.adjustParamsWithDetailsFromRelatedColumn=function(){var h=this.displayedGroupNode.rowGroupColumn,g=this.params.column;if(!h)return this.params;var x=g!=null;if(x){var P=g.isRowGroupDisplayed(h.getId());if(!P)return this.params}var z=this.params,ee=this.params,Me=ee.value,je=ee.node,ut=this.valueFormatterService.formatValue(h,je,Me),Rt=dz(dz({},z),{valueFormatted:ut});return Rt},f.prototype.addFooterValue=function(){var h=this.params.footerValueGetter,g="";if(h){var x=O(this.params);x.value=this.params.value,typeof h=="function"?g=h(x):typeof h=="string"?g=this.expressionService.evaluate(h,x):console.warn("AG Grid: footerValueGetter should be either a function or a string (expression)")}else g="Total "+(this.params.value!=null?this.params.value:"");var P=this.getInnerCompDetails(this.params);this.comp.setInnerRenderer(P,g)},f.prototype.getInnerCompDetails=function(h){var g=this;if(h.fullWidth)return this.userComponentFactory.getFullWidthGroupRowInnerCellRenderer(this.gridOptions.groupRowRendererParams,h);var x=this.userComponentFactory.getInnerRendererDetails(h,h),P=function(ut){return ut&&ut.componentClass==g.compClass};if(x&&!P(x))return x;var z=this.displayedGroupNode.rowGroupColumn,ee=z?z.getColDef():void 0;if(ee){var Me=this.userComponentFactory.getCellRendererDetails(ee,h);if(Me&&!P(Me))return Me;if(P(Me)&&ee.cellRendererParams&&ee.cellRendererParams.innerRenderer){var je=this.userComponentFactory.getInnerRendererDetails(ee.cellRendererParams,h);return je}}},f.prototype.addChildCount=function(){this.params.suppressCount||(this.addManagedListener(this.displayedGroupNode,si.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.updateChildCount.bind(this)),this.updateChildCount())},f.prototype.updateChildCount=function(){var h=this.displayedGroupNode.allChildrenCount,g=this.isShowRowGroupForThisRow(),x=g&&h!=null&&h>=0,P=x?"("+h+")":"";this.comp.setChildCount(P)},f.prototype.isShowRowGroupForThisRow=function(){if(this.gridOptionsWrapper.isTreeData())return!0;var h=this.displayedGroupNode.rowGroupColumn;if(!h)return!1;var g=this.params.column,x=g==null||g.isRowGroupDisplayed(h.getId());return x},f.prototype.addExpandAndContract=function(){var h=this.params,g=tu("groupExpanded",this.gridOptionsWrapper,null),x=tu("groupContracted",this.gridOptionsWrapper,null);g&&this.eExpanded.appendChild(g),x&&this.eContracted.appendChild(x);var P=h.eGridCell;!this.gridOptionsWrapper.isEnableGroupEdit()&&this.isExpandable()&&!h.suppressDoubleClickExpand&&this.addManagedListener(P,"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(P,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(h.node,si.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this)),this.showExpandAndContractIcons();var z=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListener(this.displayedGroupNode,si.EVENT_ALL_CHILDREN_COUNT_CHANGED,z),this.addManagedListener(this.displayedGroupNode,si.EVENT_MASTER_CHANGED,z),this.addManagedListener(this.displayedGroupNode,si.EVENT_GROUP_CHANGED,z),this.addManagedListener(this.displayedGroupNode,si.EVENT_HAS_CHILDREN_CHANGED,z)},f.prototype.onExpandClicked=function(h){er(h)||(Ri(h),this.onExpandOrContract(h))},f.prototype.onExpandOrContract=function(h){var g=this.displayedGroupNode,x=!g.expanded;g.setExpanded(x,h)},f.prototype.isExpandable=function(){if(this.showingValueForOpenedParent)return!0;var h=this.displayedGroupNode,g=this.columnModel.isPivotMode()&&h.leafGroup,x=h.isExpandable()&&!h.footer&&!g;if(!x)return!1;var P=this.params.column,z=P!=null&&typeof P.getColDef().showRowGroup=="string";if(z){var ee=this.isShowRowGroupForThisRow();return ee}return!0},f.prototype.showExpandAndContractIcons=function(){var h=this,g=h.params,x=h.displayedGroupNode,P=h.columnModel,z=g.node,ee=this.isExpandable();if(ee){var Me=this.showingValueForOpenedParent?!0:z.expanded;this.comp.setExpandedDisplayed(Me),this.comp.setContractedDisplayed(!Me)}else this.comp.setExpandedDisplayed(!1),this.comp.setContractedDisplayed(!1);var je=P.isPivotMode(),ut=je&&x.leafGroup,Rt=ee&&!ut,Zt=z.footer&&z.level===-1;this.comp.addOrRemoveCssClass("ag-cell-expandable",Rt),this.comp.addOrRemoveCssClass("ag-row-group",Rt),je?this.comp.addOrRemoveCssClass("ag-pivot-leaf-group",ut):Zt||this.comp.addOrRemoveCssClass("ag-row-group-leaf-indent",!Rt)},f.prototype.onRowNodeIsExpandableChanged=function(){this.showExpandAndContractIcons(),this.setIndent(),this.refreshAriaExpanded()},f.prototype.setupIndent=function(){var h=this.params.node,g=this.params.suppressPadding;g||(this.addManagedListener(h,si.EVENT_UI_LEVEL_CHANGED,this.setIndent.bind(this)),this.setIndent())},f.prototype.setIndent=function(){if(!this.gridOptionsWrapper.isGroupHideOpenParents()){var h=this.params,g=h.node,x=!!h.colDef,P=this.gridOptionsWrapper.isTreeData(),z=!x||P||h.colDef.showRowGroup===!0,ee=z?g.uiLevel:0,Me=h.padding>=0;Me&&ze(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-"+ee,this.comp.addOrRemoveCssClass(this.indentClass,!0)}},f.prototype.addFullWidthRowDraggerIfNeeded=function(){var h=this;if(!(!this.params.fullWidth||!this.params.rowDrag)){var g=new OI(function(){return h.params.value},this.params.node);this.createManagedBean(g,this.context),this.eGui.insertAdjacentElement("afterbegin",g.getGui())}},f.prototype.isUserWantsSelected=function(){var h=this.params.checkbox;return typeof h=="function"?h(this.params):h===!0},f.prototype.addCheckboxIfNeeded=function(){var h=this,g=this.displayedGroupNode,x=this.isUserWantsSelected()&&!g.footer&&!g.rowPinned&&!g.detail;if(x){var P=new rc;this.getContext().createBean(P),P.init({rowNode:g,column:this.params.column}),this.eCheckbox.appendChild(P.getGui()),this.addDestroyFunc(function(){return h.getContext().destroyBean(P)})}this.comp.setCheckboxVisible(x)},f.prototype.onKeyDown=function(h){var g=h.key===Nr.ENTER;if(!(!g||this.params.suppressEnterExpand)){var x=this.params.column&&this.params.column.isCellEditable(this.params.node);x||this.onExpandOrContract(h)}},f.prototype.onCellDblClicked=function(h){if(!er(h)){var g=Lr(this.eExpanded,h)||Lr(this.eContracted,h);g||this.onExpandOrContract(h)}},sC([ce("expressionService")],f.prototype,"expressionService",void 0),sC([ce("valueFormatterService")],f.prototype,"valueFormatterService",void 0),sC([ce("columnModel")],f.prototype,"columnModel",void 0),sC([ce("userComponentFactory")],f.prototype,"userComponentFactory",void 0),sC([ce("gridOptions")],f.prototype,"gridOptions",void 0),f}($i);/** + */var Yte=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),dz=function(){return dz=Object.assign||function(M){for(var f,d=1,g=arguments.length;d=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},S3=function(M){Yte(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.init=function(d,g,S,O,z,te,Fe){this.params=Fe,this.eGui=g,this.eCheckbox=S,this.eExpanded=O,this.eContracted=z,this.comp=d,this.compClass=te;var Ue=this.isTopLevelFooter(),ut=this.isEmbeddedRowMismatch(),Mt=Fe.value==null,ni=!1;if(this.gridOptionsWrapper.isGroupIncludeFooter()&&this.gridOptionsWrapper.isGroupHideOpenParents()){var Si=Fe.node;if(Si.footer){var Pi=Fe.colDef&&Fe.colDef.showRowGroup,Qi=Si.rowGroupColumn&&Si.rowGroupColumn.getColId();ni=Pi!==Qi}}this.cellIsBlank=Ue?!1:ut||Mt||ni,!this.cellIsBlank&&(this.setupShowingValueForOpenedParent(),this.findDisplayedGroupNode(),this.addFullWidthRowDraggerIfNeeded(),this.addExpandAndContract(),this.addCheckboxIfNeeded(),this.addValueElement(),this.setupIndent(),this.refreshAriaExpanded())},f.prototype.destroy=function(){M.prototype.destroy.call(this),this.expandListener=null},f.prototype.refreshAriaExpanded=function(){var d=this.params,g=d.node,S=d.eParentOfValue;if(this.expandListener&&(this.expandListener=this.expandListener()),!this.isExpandable()){lh(S);return}var O=function(){Oo(S,!!g.expanded)};this.expandListener=this.addManagedListener(g,li.EVENT_EXPANDED_CHANGED,O)||null,O()},f.prototype.isTopLevelFooter=function(){if(!this.gridOptionsWrapper.isGroupIncludeTotalFooter()||this.params.value!=null||this.params.node.level!=-1)return!1;var d=this.params.colDef,g=d==null;if(g||d.showRowGroup===!0)return!0;var S=this.columnModel.getRowGroupColumns();if(!S||S.length===0)return!0;var O=S[0];return O.getId()===d.showRowGroup},f.prototype.isEmbeddedRowMismatch=function(){if(!this.params.fullWidth||!this.gridOptionsWrapper.isEmbedFullWidthRows())return!1;var d=this.params.pinned===$e.PINNED_LEFT,g=this.params.pinned===$e.PINNED_RIGHT,S=!d&&!g;return this.gridOptionsWrapper.isEnableRtl()?this.columnModel.isPinningLeft()?!g:!S:this.columnModel.isPinningLeft()?!d:!S},f.prototype.findDisplayedGroupNode=function(){var d=this.params.column,g=this.params.node;if(this.showingValueForOpenedParent)for(var S=g.parent;S!=null;){if(S.rowGroupColumn&&d.isRowGroupDisplayed(S.rowGroupColumn.getId())){this.displayedGroupNode=S;break}S=S.parent}r(this.displayedGroupNode)&&(this.displayedGroupNode=g)},f.prototype.setupShowingValueForOpenedParent=function(){var d=this.params.node,g=this.params.column;if(!this.gridOptionsWrapper.isGroupHideOpenParents()){this.showingValueForOpenedParent=!1;return}if(!d.groupData){this.showingValueForOpenedParent=!1;return}var S=d.rowGroupColumn!=null;if(S){var O=d.rowGroupColumn.getId(),z=g.isRowGroupDisplayed(O);if(z){this.showingValueForOpenedParent=!1;return}}var te=d.groupData[g.getId()]!=null;this.showingValueForOpenedParent=te},f.prototype.addValueElement=function(){this.displayedGroupNode.footer?this.addFooterValue():(this.addGroupValue(),this.addChildCount())},f.prototype.addGroupValue=function(){var d=this.adjustParamsWithDetailsFromRelatedColumn(),g=this.getInnerCompDetails(d),S=d.valueFormatted,O=d.value,z=S??O;this.comp.setInnerRenderer(g,z)},f.prototype.adjustParamsWithDetailsFromRelatedColumn=function(){var d=this.displayedGroupNode.rowGroupColumn,g=this.params.column;if(!d)return this.params;var S=g!=null;if(S){var O=g.isRowGroupDisplayed(d.getId());if(!O)return this.params}var z=this.params,te=this.params,Fe=te.value,Ue=te.node,ut=this.valueFormatterService.formatValue(d,Ue,Fe),Mt=dz(dz({},z),{valueFormatted:ut});return Mt},f.prototype.addFooterValue=function(){var d=this.params.footerValueGetter,g="";if(d){var S=P(this.params);S.value=this.params.value,typeof d=="function"?g=d(S):typeof d=="string"?g=this.expressionService.evaluate(d,S):console.warn("AG Grid: footerValueGetter should be either a function or a string (expression)")}else g="Total "+(this.params.value!=null?this.params.value:"");var O=this.getInnerCompDetails(this.params);this.comp.setInnerRenderer(O,g)},f.prototype.getInnerCompDetails=function(d){var g=this;if(d.fullWidth)return this.userComponentFactory.getFullWidthGroupRowInnerCellRenderer(this.gridOptions.groupRowRendererParams,d);var S=this.userComponentFactory.getInnerRendererDetails(d,d),O=function(ut){return ut&&ut.componentClass==g.compClass};if(S&&!O(S))return S;var z=this.displayedGroupNode.rowGroupColumn,te=z?z.getColDef():void 0;if(te){var Fe=this.userComponentFactory.getCellRendererDetails(te,d);if(Fe&&!O(Fe))return Fe;if(O(Fe)&&te.cellRendererParams&&te.cellRendererParams.innerRenderer){var Ue=this.userComponentFactory.getInnerRendererDetails(te.cellRendererParams,d);return Ue}}},f.prototype.addChildCount=function(){this.params.suppressCount||(this.addManagedListener(this.displayedGroupNode,li.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.updateChildCount.bind(this)),this.updateChildCount())},f.prototype.updateChildCount=function(){var d=this.displayedGroupNode.allChildrenCount,g=this.isShowRowGroupForThisRow(),S=g&&d!=null&&d>=0,O=S?"("+d+")":"";this.comp.setChildCount(O)},f.prototype.isShowRowGroupForThisRow=function(){if(this.gridOptionsWrapper.isTreeData())return!0;var d=this.displayedGroupNode.rowGroupColumn;if(!d)return!1;var g=this.params.column,S=g==null||g.isRowGroupDisplayed(d.getId());return S},f.prototype.addExpandAndContract=function(){var d=this.params,g=hu("groupExpanded",this.gridOptionsWrapper,null),S=hu("groupContracted",this.gridOptionsWrapper,null);g&&this.eExpanded.appendChild(g),S&&this.eContracted.appendChild(S);var O=d.eGridCell;!this.gridOptionsWrapper.isEnableGroupEdit()&&this.isExpandable()&&!d.suppressDoubleClickExpand&&this.addManagedListener(O,"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(O,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(d.node,li.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this)),this.showExpandAndContractIcons();var z=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListener(this.displayedGroupNode,li.EVENT_ALL_CHILDREN_COUNT_CHANGED,z),this.addManagedListener(this.displayedGroupNode,li.EVENT_MASTER_CHANGED,z),this.addManagedListener(this.displayedGroupNode,li.EVENT_GROUP_CHANGED,z),this.addManagedListener(this.displayedGroupNode,li.EVENT_HAS_CHILDREN_CHANGED,z)},f.prototype.onExpandClicked=function(d){tr(d)||(Ni(d),this.onExpandOrContract(d))},f.prototype.onExpandOrContract=function(d){var g=this.displayedGroupNode,S=!g.expanded;g.setExpanded(S,d)},f.prototype.isExpandable=function(){if(this.showingValueForOpenedParent)return!0;var d=this.displayedGroupNode,g=this.columnModel.isPivotMode()&&d.leafGroup,S=d.isExpandable()&&!d.footer&&!g;if(!S)return!1;var O=this.params.column,z=O!=null&&typeof O.getColDef().showRowGroup=="string";if(z){var te=this.isShowRowGroupForThisRow();return te}return!0},f.prototype.showExpandAndContractIcons=function(){var d=this,g=d.params,S=d.displayedGroupNode,O=d.columnModel,z=g.node,te=this.isExpandable();if(te){var Fe=this.showingValueForOpenedParent?!0:z.expanded;this.comp.setExpandedDisplayed(Fe),this.comp.setContractedDisplayed(!Fe)}else this.comp.setExpandedDisplayed(!1),this.comp.setContractedDisplayed(!1);var Ue=O.isPivotMode(),ut=Ue&&S.leafGroup,Mt=te&&!ut,ni=z.footer&&z.level===-1;this.comp.addOrRemoveCssClass("ag-cell-expandable",Mt),this.comp.addOrRemoveCssClass("ag-row-group",Mt),Ue?this.comp.addOrRemoveCssClass("ag-pivot-leaf-group",ut):ni||this.comp.addOrRemoveCssClass("ag-row-group-leaf-indent",!Mt)},f.prototype.onRowNodeIsExpandableChanged=function(){this.showExpandAndContractIcons(),this.setIndent(),this.refreshAriaExpanded()},f.prototype.setupIndent=function(){var d=this.params.node,g=this.params.suppressPadding;g||(this.addManagedListener(d,li.EVENT_UI_LEVEL_CHANGED,this.setIndent.bind(this)),this.setIndent())},f.prototype.setIndent=function(){if(!this.gridOptionsWrapper.isGroupHideOpenParents()){var d=this.params,g=d.node,S=!!d.colDef,O=this.gridOptionsWrapper.isTreeData(),z=!S||O||d.colDef.showRowGroup===!0,te=z?g.uiLevel:0,Fe=d.padding>=0;Fe&&Ge(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-"+te,this.comp.addOrRemoveCssClass(this.indentClass,!0)}},f.prototype.addFullWidthRowDraggerIfNeeded=function(){var d=this;if(!(!this.params.fullWidth||!this.params.rowDrag)){var g=new OI(function(){return d.params.value},this.params.node);this.createManagedBean(g,this.context),this.eGui.insertAdjacentElement("afterbegin",g.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,g=this.displayedGroupNode,S=this.isUserWantsSelected()&&!g.footer&&!g.rowPinned&&!g.detail;if(S){var O=new hc;this.getContext().createBean(O),O.init({rowNode:g,column:this.params.column}),this.eCheckbox.appendChild(O.getGui()),this.addDestroyFunc(function(){return d.getContext().destroyBean(O)})}this.comp.setCheckboxVisible(S)},f.prototype.onKeyDown=function(d){var g=d.key===Qr.ENTER;if(!(!g||this.params.suppressEnterExpand)){var S=this.params.column&&this.params.column.isCellEditable(this.params.node);S||this.onExpandOrContract(d)}},f.prototype.onCellDblClicked=function(d){if(!tr(d)){var g=qr(this.eExpanded,d)||qr(this.eContracted,d);g||this.onExpandOrContract(d)}},rC([pe("expressionService")],f.prototype,"expressionService",void 0),rC([pe("valueFormatterService")],f.prototype,"valueFormatterService",void 0),rC([pe("columnModel")],f.prototype,"columnModel",void 0),rC([pe("userComponentFactory")],f.prototype,"userComponentFactory",void 0),rC([pe("gridOptions")],f.prototype,"gridOptions",void 0),f}(ji);/** * @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/ * @license MIT - */var V0e=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),RI=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},pz=function(M){V0e(f,M);function f(){return M.call(this,f.TEMPLATE)||this}return f.prototype.init=function(h){var g=this,x={setInnerRenderer:function(Me,je){return g.setRenderDetails(Me,je)},setChildCount:function(Me){return g.eChildCount.innerHTML=Me},addOrRemoveCssClass:function(Me,je){return g.addOrRemoveCssClass(Me,je)},setContractedDisplayed:function(Me){return dl(g.eContracted,Me)},setExpandedDisplayed:function(Me){return dl(g.eExpanded,Me)},setCheckboxVisible:function(Me){return g.eCheckbox.classList.toggle("ag-invisible",!Me)}},P=this.createManagedBean(new S3),z=!h.colDef,ee=this.getGui();P.init(x,ee,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,h),z&&tr(ee,"gridcell")},f.prototype.setRenderDetails=function(h,g){var x=this;if(h){var P=h.newAgStackInstance();if(!P)return;P.then(function(z){if(z){var ee=function(){return x.context.destroyBean(z)};x.isAlive()?(x.eValue.appendChild(z.getGui()),x.addDestroyFunc(ee)):ee()}})}else this.eValue.innerText=g},f.prototype.destroy=function(){this.getContext().destroyBean(this.innerCellRenderer),M.prototype.destroy.call(this)},f.prototype.refresh=function(){return!1},f.TEMPLATE=` + */var z0e=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),RI=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},pz=function(M){z0e(f,M);function f(){return M.call(this,f.TEMPLATE)||this}return f.prototype.init=function(d){var g=this,S={setInnerRenderer:function(Fe,Ue){return g.setRenderDetails(Fe,Ue)},setChildCount:function(Fe){return g.eChildCount.innerHTML=Fe},addOrRemoveCssClass:function(Fe,Ue){return g.addOrRemoveCssClass(Fe,Ue)},setContractedDisplayed:function(Fe){return wl(g.eContracted,Fe)},setExpandedDisplayed:function(Fe){return wl(g.eExpanded,Fe)},setCheckboxVisible:function(Fe){return g.eCheckbox.classList.toggle("ag-invisible",!Fe)}},O=this.createManagedBean(new S3),z=!d.colDef,te=this.getGui();O.init(S,te,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,d),z&&lr(te,"gridcell")},f.prototype.setRenderDetails=function(d,g){var S=this;if(d){var O=d.newAgStackInstance();if(!O)return;O.then(function(z){if(z){var te=function(){return S.context.destroyBean(z)};S.isAlive()?(S.eValue.appendChild(z.getGui()),S.addDestroyFunc(te)):te()}})}else this.eValue.innerText=g},f.prototype.destroy=function(){this.getContext().destroyBean(this.innerCellRenderer),M.prototype.destroy.call(this)},f.prototype.refresh=function(){return!1},f.TEMPLATE=` - `,RI([zr("eExpanded")],f.prototype,"eExpanded",void 0),RI([zr("eContracted")],f.prototype,"eContracted",void 0),RI([zr("eCheckbox")],f.prototype,"eCheckbox",void 0),RI([zr("eValue")],f.prototype,"eValue",void 0),RI([zr("eChildCount")],f.prototype,"eChildCount",void 0),f}(Sa);/** + `,RI([tn("eExpanded")],f.prototype,"eExpanded",void 0),RI([tn("eContracted")],f.prototype,"eContracted",void 0),RI([tn("eCheckbox")],f.prototype,"eCheckbox",void 0),RI([tn("eValue")],f.prototype,"eValue",void 0),RI([tn("eChildCount")],f.prototype,"eChildCount",void 0),f}(Ma);/** * @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/ * @license MIT - */var U0e=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Zd=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Af=function(M){U0e(f,M);function f(){return M.call(this,f.TEMPLATE)||this}return f.prototype.init=function(h){h.node.failedLoad?this.setupFailed():this.setupLoading()},f.prototype.setupFailed=function(){this.eLoadingText.innerText="ERR"},f.prototype.setupLoading=function(){var h=tu("groupLoading",this.gridOptionsWrapper,null);h&&this.eLoadingIcon.appendChild(h);var g=this.gridOptionsWrapper.getLocaleTextFunc();this.eLoadingText.innerText=g("loadingOoo","Loading")},f.prototype.refresh=function(h){return!1},f.prototype.destroy=function(){M.prototype.destroy.call(this)},f.TEMPLATE=`
+ */var H0e=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),sp=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Mf=function(M){H0e(f,M);function f(){return M.call(this,f.TEMPLATE)||this}return f.prototype.init=function(d){d.node.failedLoad?this.setupFailed():this.setupLoading()},f.prototype.setupFailed=function(){this.eLoadingText.innerText="ERR"},f.prototype.setupLoading=function(){var d=hu("groupLoading",this.gridOptionsWrapper,null);d&&this.eLoadingIcon.appendChild(d);var g=this.gridOptionsWrapper.getLocaleTextFunc();this.eLoadingText.innerText=g("loadingOoo","Loading")},f.prototype.refresh=function(d){return!1},f.prototype.destroy=function(){M.prototype.destroy.call(this)},f.TEMPLATE=`
-
`,Zd([zr("eLoadingIcon")],f.prototype,"eLoadingIcon",void 0),Zd([zr("eLoadingText")],f.prototype,"eLoadingText",void 0),f}(Sa);/** +
`,sp([tn("eLoadingIcon")],f.prototype,"eLoadingIcon",void 0),sp([tn("eLoadingText")],f.prototype,"eLoadingText",void 0),f}(Ma);/** * @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/ * @license MIT - */var MI=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),DI=function(M){MI(f,M);function f(){return M.call(this)||this}return f.prototype.destroy=function(){M.prototype.destroy.call(this)},f.prototype.init=function(h){var g=this.gridOptionsWrapper.getOverlayLoadingTemplate()?this.gridOptionsWrapper.getOverlayLoadingTemplate():f.DEFAULT_LOADING_OVERLAY_TEMPLATE,x=this.gridOptionsWrapper.getLocaleTextFunc(),P=g.replace("[LOADING...]",x("loadingOoo","Loading..."));this.setTemplate(P)},f.DEFAULT_LOADING_OVERLAY_TEMPLATE='[LOADING...]',f}(Sa);/** + */var MI=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),DI=function(M){MI(f,M);function f(){return M.call(this)||this}return f.prototype.destroy=function(){M.prototype.destroy.call(this)},f.prototype.init=function(d){var g=this.gridOptionsWrapper.getOverlayLoadingTemplate()?this.gridOptionsWrapper.getOverlayLoadingTemplate():f.DEFAULT_LOADING_OVERLAY_TEMPLATE,S=this.gridOptionsWrapper.getLocaleTextFunc(),O=g.replace("[LOADING...]",S("loadingOoo","Loading..."));this.setTemplate(O)},f.DEFAULT_LOADING_OVERLAY_TEMPLATE='[LOADING...]',f}(Ma);/** * @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/ * @license MIT - */var Zm=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Nb=function(M){Zm(f,M);function f(){return M.call(this)||this}return f.prototype.destroy=function(){M.prototype.destroy.call(this)},f.prototype.init=function(h){var g=this.gridOptionsWrapper.getOverlayNoRowsTemplate()?this.gridOptionsWrapper.getOverlayNoRowsTemplate():f.DEFAULT_NO_ROWS_TEMPLATE,x=this.gridOptionsWrapper.getLocaleTextFunc(),P=g.replace("[NO_ROWS_TO_SHOW]",x("noRowsToShow","No Rows To Show"));this.setTemplate(P)},f.DEFAULT_NO_ROWS_TEMPLATE='[NO_ROWS_TO_SHOW]',f}(Sa);/** + */var tg=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Vb=function(M){tg(f,M);function f(){return M.call(this)||this}return f.prototype.destroy=function(){M.prototype.destroy.call(this)},f.prototype.init=function(d){var g=this.gridOptionsWrapper.getOverlayNoRowsTemplate()?this.gridOptionsWrapper.getOverlayNoRowsTemplate():f.DEFAULT_NO_ROWS_TEMPLATE,S=this.gridOptionsWrapper.getLocaleTextFunc(),O=g.replace("[NO_ROWS_TO_SHOW]",S("noRowsToShow","No Rows To Show"));this.setTemplate(O)},f.DEFAULT_NO_ROWS_TEMPLATE='[NO_ROWS_TO_SHOW]',f}(Ma);/** * @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/ * @license MIT - */var oC=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),FI=function(M){oC(f,M);function f(){return M.call(this,'
')||this}return f.prototype.init=function(h){var g=h.value;this.getGui().innerHTML=_t(g)},f}(rC);/** + */var nC=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),FI=function(M){nC(f,M);function f(){return M.call(this,'
')||this}return f.prototype.init=function(d){var g=d.value;this.getGui().innerHTML=_t(g)},f}(tC);/** * @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/ * @license MIT - */var fz=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),X$=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Nv=function(M){fz(f,M);function f(){var h=M!==null&&M.apply(this,arguments)||this;return h.agGridDefaults={agDateInput:E4,agColumnHeader:Y$,agColumnGroupHeader:hz,agTextColumnFloatingFilter:q$,agNumberColumnFloatingFilter:w3,agDateColumnFloatingFilter:b3,agReadOnlyFloatingFilter:m3,agAnimateShowChangeCellRenderer:Lx,agAnimateSlideCellRenderer:jt,agGroupCellRenderer:pz,agGroupRowRenderer:pz,agLoadingCellRenderer:Af,agCellEditor:wr,agTextCellEditor:wr,agSelectCellEditor:g1,agPopupTextCellEditor:D4,agPopupSelectCellEditor:Fy,agLargeTextCellEditor:nC,agTextColumnFilter:Jm,agNumberColumnFilter:I4,agDateColumnFilter:tC,agLoadingOverlay:DI,agNoRowsOverlay:Nb,agTooltipComponent:FI},h.agDeprecatedNames={set:{newComponentName:"agSetColumnFilter",propertyHolder:"filter"},text:{newComponentName:"agTextColumnFilter",propertyHolder:"filter"},number:{newComponentName:"agNumberColumnFilter",propertyHolder:"filter"},date:{newComponentName:"agDateColumnFilter",propertyHolder:"filter"},group:{newComponentName:"agGroupCellRenderer",propertyHolder:"cellRenderer"},animateShowChange:{newComponentName:"agAnimateShowChangeCellRenderer",propertyHolder:"cellRenderer"},animateSlide:{newComponentName:"agAnimateSlideCellRenderer",propertyHolder:"cellRenderer"},select:{newComponentName:"agSelectCellEditor",propertyHolder:"cellEditor"},largeText:{newComponentName:"agLargeTextCellEditor",propertyHolder:"cellEditor"},popupSelect:{newComponentName:"agPopupSelectCellEditor",propertyHolder:"cellEditor"},popupText:{newComponentName:"agPopupTextCellEditor",propertyHolder:"cellEditor"},richSelect:{newComponentName:"agRichSelectCellEditor",propertyHolder:"cellEditor"},headerComponent:{newComponentName:"agColumnHeader",propertyHolder:"headerComponent"}},h.jsComps={},h.fwComps={},h}return f.prototype.init=function(){var h=this;this.gridOptions.components!=null&&I(this.gridOptions.components,function(g,x){return h.registerJsComponent(g,x)}),this.gridOptions.frameworkComponents!=null&&I(this.gridOptions.frameworkComponents,function(g,x){return h.registerFwComponent(g,x)})},f.prototype.registerDefaultComponent=function(h,g){var x=this.translateIfDeprecated(h);if(this.agGridDefaults[x]){console.error("Trying to overwrite a default component. You should call registerComponent");return}this.agGridDefaults[x]=g},f.prototype.registerJsComponent=function(h,g){var x=this.translateIfDeprecated(h);if(this.fwComps[x]){console.error("Trying to register a component that you have already registered for frameworks: "+x);return}this.jsComps[x]=g},f.prototype.registerFwComponent=function(h,g){var x="AG Grid: As of v27, registering components via grid property frameworkComponents is deprecated. Instead register both JavaScript AND Framework Components via the components property.";ze(function(){return console.warn(x)},"UserComponentRegistry.frameworkComponentsDeprecated");var P=this.translateIfDeprecated(h);this.fwComps[P]=g},f.prototype.retrieve=function(h){var g=this.translateIfDeprecated(h),x=function(ut,Rt){return{componentFromFramework:Rt,component:ut}},P=this.getFrameworkOverrides().frameworkComponent(g);if(P!=null)return x(P,!0);var z=this.fwComps[g];if(z)return x(z,!0);var ee=this.jsComps[g];if(ee){var Me=this.getFrameworkOverrides().isFrameworkComponent(ee);return x(ee,Me)}var je=this.agGridDefaults[g];return je?x(je,!1):(Object.keys(this.agGridDefaults).indexOf(g)<0&&console.warn("AG Grid: Looking for component ["+g+"] but it wasn't found."),null)},f.prototype.translateIfDeprecated=function(h){var g=this.agDeprecatedNames[h];return g!=null?(ze(function(){console.warn("ag-grid. Since v15.0 component names have been renamed to be namespaced. You should rename "+g.propertyHolder+":"+h+" to "+g.propertyHolder+":"+g.newComponentName)},"DEPRECATE_COMPONENT_"+h),g.newComponentName):h},X$([ce("gridOptions")],f.prototype,"gridOptions",void 0),X$([ce("agComponentUtils")],f.prototype,"agComponentUtils",void 0),X$([it],f.prototype,"init",null),f=X$([Le("userComponentRegistry")],f),f}($i);/** + */var fz=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),q$=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Bv=function(M){fz(f,M);function f(){var d=M!==null&&M.apply(this,arguments)||this;return d.agGridDefaults={agDateInput:P4,agColumnHeader:W$,agColumnGroupHeader:hz,agTextColumnFloatingFilter:H$,agNumberColumnFloatingFilter:w3,agDateColumnFloatingFilter:b3,agReadOnlyFloatingFilter:m3,agAnimateShowChangeCellRenderer:Nx,agAnimateSlideCellRenderer:Ht,agGroupCellRenderer:pz,agGroupRowRenderer:pz,agLoadingCellRenderer:Mf,agCellEditor:Dr,agTextCellEditor:Dr,agSelectCellEditor:b1,agPopupTextCellEditor:N4,agPopupSelectCellEditor:Ly,agLargeTextCellEditor:iC,agTextColumnFilter:eg,agNumberColumnFilter:O4,agDateColumnFilter:SI,agLoadingOverlay:DI,agNoRowsOverlay:Vb,agTooltipComponent:FI},d.agDeprecatedNames={set:{newComponentName:"agSetColumnFilter",propertyHolder:"filter"},text:{newComponentName:"agTextColumnFilter",propertyHolder:"filter"},number:{newComponentName:"agNumberColumnFilter",propertyHolder:"filter"},date:{newComponentName:"agDateColumnFilter",propertyHolder:"filter"},group:{newComponentName:"agGroupCellRenderer",propertyHolder:"cellRenderer"},animateShowChange:{newComponentName:"agAnimateShowChangeCellRenderer",propertyHolder:"cellRenderer"},animateSlide:{newComponentName:"agAnimateSlideCellRenderer",propertyHolder:"cellRenderer"},select:{newComponentName:"agSelectCellEditor",propertyHolder:"cellEditor"},largeText:{newComponentName:"agLargeTextCellEditor",propertyHolder:"cellEditor"},popupSelect:{newComponentName:"agPopupSelectCellEditor",propertyHolder:"cellEditor"},popupText:{newComponentName:"agPopupTextCellEditor",propertyHolder:"cellEditor"},richSelect:{newComponentName:"agRichSelectCellEditor",propertyHolder:"cellEditor"},headerComponent:{newComponentName:"agColumnHeader",propertyHolder:"headerComponent"}},d.jsComps={},d.fwComps={},d}return f.prototype.init=function(){var d=this;this.gridOptions.components!=null&&I(this.gridOptions.components,function(g,S){return d.registerJsComponent(g,S)}),this.gridOptions.frameworkComponents!=null&&I(this.gridOptions.frameworkComponents,function(g,S){return d.registerFwComponent(g,S)})},f.prototype.registerDefaultComponent=function(d,g){var S=this.translateIfDeprecated(d);if(this.agGridDefaults[S]){console.error("Trying to overwrite a default component. You should call registerComponent");return}this.agGridDefaults[S]=g},f.prototype.registerJsComponent=function(d,g){var S=this.translateIfDeprecated(d);if(this.fwComps[S]){console.error("Trying to register a component that you have already registered for frameworks: "+S);return}this.jsComps[S]=g},f.prototype.registerFwComponent=function(d,g){var S="AG Grid: As of v27, registering components via grid property frameworkComponents is deprecated. Instead register both JavaScript AND Framework Components via the components property.";Ge(function(){return console.warn(S)},"UserComponentRegistry.frameworkComponentsDeprecated");var O=this.translateIfDeprecated(d);this.fwComps[O]=g},f.prototype.retrieve=function(d){var g=this.translateIfDeprecated(d),S=function(ut,Mt){return{componentFromFramework:Mt,component:ut}},O=this.getFrameworkOverrides().frameworkComponent(g);if(O!=null)return S(O,!0);var z=this.fwComps[g];if(z)return S(z,!0);var te=this.jsComps[g];if(te){var Fe=this.getFrameworkOverrides().isFrameworkComponent(te);return S(te,Fe)}var Ue=this.agGridDefaults[g];return Ue?S(Ue,!1):(Object.keys(this.agGridDefaults).indexOf(g)<0&&console.warn("AG Grid: Looking for component ["+g+"] but it wasn't found."),null)},f.prototype.translateIfDeprecated=function(d){var g=this.agDeprecatedNames[d];return g!=null?(Ge(function(){console.warn("ag-grid. Since v15.0 component names have been renamed to be namespaced. You should rename "+g.propertyHolder+":"+d+" to "+g.propertyHolder+":"+g.newComponentName)},"DEPRECATE_COMPONENT_"+d),g.newComponentName):d},q$([pe("gridOptions")],f.prototype,"gridOptions",void 0),q$([pe("agComponentUtils")],f.prototype,"agComponentUtils",void 0),q$([ht],f.prototype,"init",null),f=q$([Ne("userComponentRegistry")],f),f}(ji);/** * @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/ * @license MIT - */var j0e={propertyName:"dateComponent",cellRenderer:!1},z0e={propertyName:"headerComponent",cellRenderer:!1},L4={propertyName:"headerGroupComponent",cellRenderer:!1},ln={propertyName:"cellRenderer",cellRenderer:!0},br={propertyName:"cellEditor",cellRenderer:!1},aC={propertyName:"innerRenderer",cellRenderer:!0},C3={propertyName:"loadingOverlayComponent",cellRenderer:!1},X8e={propertyName:"noRowsOverlayComponent",cellRenderer:!1},Dd={propertyName:"tooltipComponent",cellRenderer:!1},lC={propertyName:"filter",cellRenderer:!1},$0={propertyName:"floatingFilterComponent",cellRenderer:!1},mz={propertyName:"toolPanel",cellRenderer:!1},uC={propertyName:"statusPanel",cellRenderer:!1},K8e={propertyName:"fullWidthCellRenderer",cellRenderer:!0},J8e={propertyName:"loadingCellRenderer",cellRenderer:!0},Z8e={propertyName:"groupRowRenderer",cellRenderer:!0},k4={propertyName:"detailCellRenderer",cellRenderer:!0};/** + */var W0e={propertyName:"dateComponent",cellRenderer:!1},q0e={propertyName:"headerComponent",cellRenderer:!1},$4={propertyName:"headerGroupComponent",cellRenderer:!1},wn={propertyName:"cellRenderer",cellRenderer:!0},Rr={propertyName:"cellEditor",cellRenderer:!1},sC={propertyName:"innerRenderer",cellRenderer:!0},C3={propertyName:"loadingOverlayComponent",cellRenderer:!1},J8e={propertyName:"noRowsOverlayComponent",cellRenderer:!1},Bd={propertyName:"tooltipComponent",cellRenderer:!1},oC={propertyName:"filter",cellRenderer:!1},j0={propertyName:"floatingFilterComponent",cellRenderer:!1},mz={propertyName:"toolPanel",cellRenderer:!1},aC={propertyName:"statusPanel",cellRenderer:!1},Z8e={propertyName:"fullWidthCellRenderer",cellRenderer:!0},Q8e={propertyName:"loadingCellRenderer",cellRenderer:!0},e9e={propertyName:"groupRowRenderer",cellRenderer:!0},B4={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/ * @license MIT - */var Kte=function(){function M(){}return M.getFloatingFilterType=function(f){return this.filterToFloatingFilterMapping[f]},M.filterToFloatingFilterMapping={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"},M}();/** + */var Xte=function(){function M(){}return M.getFloatingFilterType=function(f){return this.filterToFloatingFilterMapping[f]},M.filterToFloatingFilterMapping={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"},M}();/** * @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/ * @license MIT - */var H0e=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),T3=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},N4=function(M){H0e(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.getHeaderCompDetails=function(h,g){return this.getCompDetails(h,z0e,"agColumnHeader",g)},f.prototype.getHeaderGroupCompDetails=function(h){var g=h.columnGroup.getColGroupDef();return this.getCompDetails(g,L4,"agColumnGroupHeader",h)},f.prototype.getFullWidthCellRendererDetails=function(h){return this.getCompDetails(this.gridOptions,K8e,null,h,!0)},f.prototype.getFullWidthLoadingCellRendererDetails=function(h){return this.getCompDetails(this.gridOptions,J8e,"agLoadingCellRenderer",h,!0)},f.prototype.getFullWidthGroupCellRendererDetails=function(h){return this.getCompDetails(this.gridOptions,Z8e,"agGroupRowRenderer",h,!0)},f.prototype.getFullWidthDetailCellRendererDetails=function(h){return this.getCompDetails(this.gridOptions,k4,"agDetailCellRenderer",h,!0)},f.prototype.getInnerRendererDetails=function(h,g){return this.getCompDetails(h,aC,null,g)},f.prototype.getFullWidthGroupRowInnerCellRenderer=function(h,g){return this.getCompDetails(h,aC,null,g)},f.prototype.getCellRendererDetails=function(h,g){return this.getCompDetails(h,ln,null,g)},f.prototype.getCellEditorDetails=function(h,g){return this.getCompDetails(h,br,"agCellEditor",g,!0)},f.prototype.getFilterDetails=function(h,g,x){return this.getCompDetails(h,lC,x,g,!0)},f.prototype.getDateCompDetails=function(h){return this.getCompDetails(this.gridOptions,j0e,"agDateInput",h,!0)},f.prototype.getLoadingOverlayCompDetails=function(h){return this.getCompDetails(this.gridOptions,C3,"agLoadingOverlay",h,!0)},f.prototype.getNoRowsOverlayCompDetails=function(h){return this.getCompDetails(this.gridOptions,X8e,"agNoRowsOverlay",h,!0)},f.prototype.getTooltipCompDetails=function(h){return this.getCompDetails(h.colDef,Dd,"agTooltipComponent",h,!0)},f.prototype.getSetFilterCellRendererDetails=function(h,g){return this.getCompDetails(h,ln,null,g)},f.prototype.getFloatingFilterCompDetails=function(h,g,x){return this.getCompDetails(h,$0,x,g)},f.prototype.getToolPanelCompDetails=function(h,g){return this.getCompDetails(h,mz,null,g,!0)},f.prototype.getStatusPanelCompDetails=function(h,g){return this.getCompDetails(h,uC,null,g,!0)},f.prototype.getCompDetails=function(h,g,x,P,z){var ee=this;z===void 0&&(z=!1);var Me=g.propertyName,je=g.cellRenderer,ut=this.getCompKeys(h,g,P),Rt=ut.compName,Zt=ut.jsComp,vi=ut.fwComp,Ci=ut.paramsFromSelector,qi=ut.popupFromSelector,hr=ut.popupPositionFromSelector,Rr=function(Js){var rl=ee.userComponentRegistry.retrieve(Js);rl&&(Zt=rl.componentFromFramework?void 0:rl.component,vi=rl.componentFromFramework?rl.component:void 0)};if(Rt!=null&&Rr(Rt),Zt==null&&vi==null&&x!=null&&Rr(x),Zt&&je&&!this.agComponentUtils.doesImplementIComponent(Zt)&&(Zt=this.agComponentUtils.adaptFunction(Me,Zt)),!Zt&&!vi){z&&console.error("Could not find component "+Rt+", did you forget to configure this component?");return}var Ar=this.mergeParamsWithApplicationProvidedParams(h,g,P,Ci),Fr=Zt==null,Sn=Zt||vi;return{componentFromFramework:Fr,componentClass:Sn,params:Ar,type:g,popupFromSelector:qi,popupPositionFromSelector:hr,newAgStackInstance:function(){return ee.newAgStackInstance(Sn,Fr,Ar,g)}}},f.prototype.getCompKeys=function(h,g,x){var P=this,z=g.propertyName,ee,Me,je,ut,Rt,Zt;if(h){var vi=h,Ci=vi[z+"Selector"],qi=Ci?Ci(x):null,hr=function(Ar,Fr){var Sn=function(){var rl="AG Grid: As of v27, the property "+z+"Framework is deprecated. The property "+z+" can now be used for JavaScript AND Framework Components.";ze(function(){return console.warn(rl)},"UserComponentFactory."+z+"FrameworkDeprecated")};if(typeof Ar=="string")ee=Ar;else if(typeof Fr=="string")Sn(),ee=Fr;else if(Ar!=null&&Ar!==!0){var Js=P.getFrameworkOverrides().isFrameworkComponent(Ar);Js?je=Ar:Me=Ar}else Fr!=null&&(Sn(),je=Fr)};if(qi){if(qi.frameworkComponent!=null){var Rr="AG Grid: As of v27, the return for "+z+"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.";ze(function(){return console.warn(Rr)},"UserComponentFactory."+z+"FrameworkSelectorDeprecated"),hr(qi.frameworkComponent,void 0)}else hr(qi.component,void 0);ut=qi.params,Rt=qi.popup,Zt=qi.popupPosition}else hr(vi[z],vi[z+"Framework"])}return{compName:ee,jsComp:Me,fwComp:je,paramsFromSelector:ut,popupFromSelector:Rt,popupPositionFromSelector:Zt}},f.prototype.newAgStackInstance=function(h,g,x,P){var z=P.propertyName,ee=!g,Me;if(ee)Me=new h;else{var je=this.componentMetadataProvider.retrieve(z);Me=this.frameworkComponentWrapper.wrap(h,je.mandatoryMethodList,je.optionalMethodList,P)}var ut=this.initComponent(Me,x);return ut==null?Km.resolve(Me):ut.then(function(){return Me})},f.prototype.mergeParamsWithApplicationProvidedParams=function(h,g,x,P){P===void 0&&(P=null);var z={context:this.gridOptionsWrapper.getContext(),columnApi:this.gridOptionsWrapper.getColumnApi(),api:this.gridOptionsWrapper.getApi()};fe(z,x);var ee=h,Me=ee&&ee[g.propertyName+"Params"];if(typeof Me=="function"){var je=Me(x);fe(z,je)}else typeof Me=="object"&&fe(z,Me);return fe(z,P),z},f.prototype.initComponent=function(h,g){if(this.context.createBean(h),h.init!=null)return h.init(g)},f.prototype.getDefaultFloatingFilterType=function(h){if(h==null)return null;var g=null,x=this.getCompKeys(h,lC),P=x.compName,z=x.jsComp,ee=x.fwComp;if(P)g=Kte.getFloatingFilterType(P);else{var Me=z==null&&ee==null&&h.filter===!0;if(Me){var je=ni.isRegistered(t.ModuleNames.SetFilterModule);g=je?"agSetColumnFloatingFilter":"agTextColumnFloatingFilter"}}return g},T3([ce("gridOptions")],f.prototype,"gridOptions",void 0),T3([ce("agComponentUtils")],f.prototype,"agComponentUtils",void 0),T3([ce("componentMetadataProvider")],f.prototype,"componentMetadataProvider",void 0),T3([ce("userComponentRegistry")],f.prototype,"userComponentRegistry",void 0),T3([Ce("frameworkComponentWrapper")],f.prototype,"frameworkComponentWrapper",void 0),f=T3([Le("userComponentFactory")],f),f}($i);/** + */var Y0e=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),T3=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},V4=function(M){Y0e(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.getHeaderCompDetails=function(d,g){return this.getCompDetails(d,q0e,"agColumnHeader",g)},f.prototype.getHeaderGroupCompDetails=function(d){var g=d.columnGroup.getColGroupDef();return this.getCompDetails(g,$4,"agColumnGroupHeader",d)},f.prototype.getFullWidthCellRendererDetails=function(d){return this.getCompDetails(this.gridOptions,Z8e,null,d,!0)},f.prototype.getFullWidthLoadingCellRendererDetails=function(d){return this.getCompDetails(this.gridOptions,Q8e,"agLoadingCellRenderer",d,!0)},f.prototype.getFullWidthGroupCellRendererDetails=function(d){return this.getCompDetails(this.gridOptions,e9e,"agGroupRowRenderer",d,!0)},f.prototype.getFullWidthDetailCellRendererDetails=function(d){return this.getCompDetails(this.gridOptions,B4,"agDetailCellRenderer",d,!0)},f.prototype.getInnerRendererDetails=function(d,g){return this.getCompDetails(d,sC,null,g)},f.prototype.getFullWidthGroupRowInnerCellRenderer=function(d,g){return this.getCompDetails(d,sC,null,g)},f.prototype.getCellRendererDetails=function(d,g){return this.getCompDetails(d,wn,null,g)},f.prototype.getCellEditorDetails=function(d,g){return this.getCompDetails(d,Rr,"agCellEditor",g,!0)},f.prototype.getFilterDetails=function(d,g,S){return this.getCompDetails(d,oC,S,g,!0)},f.prototype.getDateCompDetails=function(d){return this.getCompDetails(this.gridOptions,W0e,"agDateInput",d,!0)},f.prototype.getLoadingOverlayCompDetails=function(d){return this.getCompDetails(this.gridOptions,C3,"agLoadingOverlay",d,!0)},f.prototype.getNoRowsOverlayCompDetails=function(d){return this.getCompDetails(this.gridOptions,J8e,"agNoRowsOverlay",d,!0)},f.prototype.getTooltipCompDetails=function(d){return this.getCompDetails(d.colDef,Bd,"agTooltipComponent",d,!0)},f.prototype.getSetFilterCellRendererDetails=function(d,g){return this.getCompDetails(d,wn,null,g)},f.prototype.getFloatingFilterCompDetails=function(d,g,S){return this.getCompDetails(d,j0,S,g)},f.prototype.getToolPanelCompDetails=function(d,g){return this.getCompDetails(d,mz,null,g,!0)},f.prototype.getStatusPanelCompDetails=function(d,g){return this.getCompDetails(d,aC,null,g,!0)},f.prototype.getCompDetails=function(d,g,S,O,z){var te=this;z===void 0&&(z=!1);var Fe=g.propertyName,Ue=g.cellRenderer,ut=this.getCompKeys(d,g,O),Mt=ut.compName,ni=ut.jsComp,Si=ut.fwComp,Pi=ut.paramsFromSelector,Qi=ut.popupFromSelector,_r=ut.popupPositionFromSelector,Hr=function(co){var hl=te.userComponentRegistry.retrieve(co);hl&&(ni=hl.componentFromFramework?void 0:hl.component,Si=hl.componentFromFramework?hl.component:void 0)};if(Mt!=null&&Hr(Mt),ni==null&&Si==null&&S!=null&&Hr(S),ni&&Ue&&!this.agComponentUtils.doesImplementIComponent(ni)&&(ni=this.agComponentUtils.adaptFunction(Fe,ni)),!ni&&!Si){z&&console.error("Could not find component "+Mt+", did you forget to configure this component?");return}var $r=this.mergeParamsWithApplicationProvidedParams(d,g,O,Pi),Yr=ni==null,kn=ni||Si;return{componentFromFramework:Yr,componentClass:kn,params:$r,type:g,popupFromSelector:Qi,popupPositionFromSelector:_r,newAgStackInstance:function(){return te.newAgStackInstance(kn,Yr,$r,g)}}},f.prototype.getCompKeys=function(d,g,S){var O=this,z=g.propertyName,te,Fe,Ue,ut,Mt,ni;if(d){var Si=d,Pi=Si[z+"Selector"],Qi=Pi?Pi(S):null,_r=function($r,Yr){var kn=function(){var hl="AG Grid: As of v27, the property "+z+"Framework is deprecated. The property "+z+" can now be used for JavaScript AND Framework Components.";Ge(function(){return console.warn(hl)},"UserComponentFactory."+z+"FrameworkDeprecated")};if(typeof $r=="string")te=$r;else if(typeof Yr=="string")kn(),te=Yr;else if($r!=null&&$r!==!0){var co=O.getFrameworkOverrides().isFrameworkComponent($r);co?Ue=$r:Fe=$r}else Yr!=null&&(kn(),Ue=Yr)};if(Qi){if(Qi.frameworkComponent!=null){var Hr="AG Grid: As of v27, the return for "+z+"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.";Ge(function(){return console.warn(Hr)},"UserComponentFactory."+z+"FrameworkSelectorDeprecated"),_r(Qi.frameworkComponent,void 0)}else _r(Qi.component,void 0);ut=Qi.params,Mt=Qi.popup,ni=Qi.popupPosition}else _r(Si[z],Si[z+"Framework"])}return{compName:te,jsComp:Fe,fwComp:Ue,paramsFromSelector:ut,popupFromSelector:Mt,popupPositionFromSelector:ni}},f.prototype.newAgStackInstance=function(d,g,S,O){var z=O.propertyName,te=!g,Fe;if(te)Fe=new d;else{var Ue=this.componentMetadataProvider.retrieve(z);Fe=this.frameworkComponentWrapper.wrap(d,Ue.mandatoryMethodList,Ue.optionalMethodList,O)}var ut=this.initComponent(Fe,S);return ut==null?Qm.resolve(Fe):ut.then(function(){return Fe})},f.prototype.mergeParamsWithApplicationProvidedParams=function(d,g,S,O){O===void 0&&(O=null);var z={context:this.gridOptionsWrapper.getContext(),columnApi:this.gridOptionsWrapper.getColumnApi(),api:this.gridOptionsWrapper.getApi()};ce(z,S);var te=d,Fe=te&&te[g.propertyName+"Params"];if(typeof Fe=="function"){var Ue=Fe(S);ce(z,Ue)}else typeof Fe=="object"&&ce(z,Fe);return ce(z,O),z},f.prototype.initComponent=function(d,g){if(this.context.createBean(d),d.init!=null)return d.init(g)},f.prototype.getDefaultFloatingFilterType=function(d){if(d==null)return null;var g=null,S=this.getCompKeys(d,oC),O=S.compName,z=S.jsComp,te=S.fwComp;if(O)g=Xte.getFloatingFilterType(O);else{var Fe=z==null&&te==null&&d.filter===!0;if(Fe){var Ue=Xt.isRegistered(t.ModuleNames.SetFilterModule);g=Ue?"agSetColumnFloatingFilter":"agTextColumnFloatingFilter"}}return g},T3([pe("gridOptions")],f.prototype,"gridOptions",void 0),T3([pe("agComponentUtils")],f.prototype,"agComponentUtils",void 0),T3([pe("componentMetadataProvider")],f.prototype,"componentMetadataProvider",void 0),T3([pe("userComponentRegistry")],f.prototype,"userComponentRegistry",void 0),T3([Ae("frameworkComponentWrapper")],f.prototype,"frameworkComponentWrapper",void 0),f=T3([Ne("userComponentFactory")],f),f}(ji);/** * @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/ @@ -6084,64 +6084,64 @@ gl_FragColor.rgb *= color.a; * @version v27.3.0 * @link https://www.ag-grid.com/ * @license MIT - */var LI=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),cC=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},K$=function(M){LI(f,M);function f(){var h=M!==null&&M.apply(this,arguments)||this;return h.dragEndFunctions=[],h.dragSources=[],h}return f.prototype.init=function(){this.logger=this.loggerFactory.create("DragService")},f.prototype.removeAllListeners=function(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0},f.prototype.removeListener=function(h){var g=h.dragSource.eElement,x=h.mouseDownListener;if(g.removeEventListener("mousedown",x),h.touchEnabled){var P=h.touchStartListener;g.removeEventListener("touchstart",P,{passive:!0})}},f.prototype.removeDragSource=function(h){var g=this.dragSources.find(function(x){return x.dragSource===h});g&&(this.removeListener(g),q(this.dragSources,g))},f.prototype.isDragging=function(){return this.dragging},f.prototype.addDragSource=function(h,g){var x=this;g===void 0&&(g=!1);var P=this.onMouseDown.bind(this,h);h.eElement.addEventListener("mousedown",P);var z=null,ee=this.gridOptionsWrapper.isSuppressTouch();g&&!ee&&(z=function(Me){Me.cancelable&&Me.preventDefault(),x.onTouchStart(h,Me)},h.eElement.addEventListener("touchstart",z,{passive:!0})),this.dragSources.push({dragSource:h,mouseDownListener:P,touchStartListener:z,touchEnabled:g})},f.prototype.onTouchStart=function(h,g){var x=this;this.currentDragParams=h,this.dragging=!1;var P=g.touches[0];this.touchLastTime=P,this.touchStart=P;var z=function(Rt){return x.onTouchMove(Rt,h.eElement)},ee=function(Rt){return x.onTouchUp(Rt,h.eElement)},Me=function(Rt){Rt.cancelable&&Rt.preventDefault()},je=h.eElement,ut=[{target:document,type:"touchmove",listener:Me,options:{passive:!1}},{target:je,type:"touchmove",listener:z,options:{passive:!0}},{target:je,type:"touchend",listener:ee,options:{passive:!0}},{target:je,type:"touchcancel",listener:ee,options:{passive:!0}}];this.addTemporaryEvents(ut),h.dragStartPixels===0&&this.onCommonMove(P,this.touchStart,h.eElement)},f.prototype.onMouseDown=function(h,g){var x=this,P=g;if(!(h.skipMouseEvent&&h.skipMouseEvent(g))&&!P._alreadyProcessedByDragService&&(P._alreadyProcessedByDragService=!0,g.button===0)){this.currentDragParams=h,this.dragging=!1,this.mouseStartEvent=g;var z=this.gridOptionsWrapper.getDocument(),ee=function(Zt){return x.onMouseMove(Zt,h.eElement)},Me=function(Zt){return x.onMouseUp(Zt,h.eElement)},je=function(Zt){return Zt.preventDefault()},ut=z,Rt=[{target:ut,type:"mousemove",listener:ee},{target:ut,type:"mouseup",listener:Me},{target:ut,type:"contextmenu",listener:je}];this.addTemporaryEvents(Rt),h.dragStartPixels===0&&this.onMouseMove(g,h.eElement)}},f.prototype.addTemporaryEvents=function(h){h.forEach(function(g){var x=g.target,P=g.type,z=g.listener,ee=g.options;x.addEventListener(P,z,ee)}),this.dragEndFunctions.push(function(){h.forEach(function(g){var x=g.target,P=g.type,z=g.listener,ee=g.options;x.removeEventListener(P,z,ee)})})},f.prototype.isEventNearStartEvent=function(h,g){var x=this.currentDragParams.dragStartPixels,P=i(x)?x:4;return bn(h,g,P)},f.prototype.getFirstActiveTouch=function(h){for(var g=0;g=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Y$=function(M){LI(f,M);function f(){var d=M!==null&&M.apply(this,arguments)||this;return d.dragEndFunctions=[],d.dragSources=[],d}return f.prototype.init=function(){this.logger=this.loggerFactory.create("DragService")},f.prototype.removeAllListeners=function(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0},f.prototype.removeListener=function(d){var g=d.dragSource.eElement,S=d.mouseDownListener;if(g.removeEventListener("mousedown",S),d.touchEnabled){var O=d.touchStartListener;g.removeEventListener("touchstart",O,{passive:!0})}},f.prototype.removeDragSource=function(d){var g=this.dragSources.find(function(S){return S.dragSource===d});g&&(this.removeListener(g),q(this.dragSources,g))},f.prototype.isDragging=function(){return this.dragging},f.prototype.addDragSource=function(d,g){var S=this;g===void 0&&(g=!1);var O=this.onMouseDown.bind(this,d);d.eElement.addEventListener("mousedown",O);var z=null,te=this.gridOptionsWrapper.isSuppressTouch();g&&!te&&(z=function(Fe){Fe.cancelable&&Fe.preventDefault(),S.onTouchStart(d,Fe)},d.eElement.addEventListener("touchstart",z,{passive:!0})),this.dragSources.push({dragSource:d,mouseDownListener:O,touchStartListener:z,touchEnabled:g})},f.prototype.onTouchStart=function(d,g){var S=this;this.currentDragParams=d,this.dragging=!1;var O=g.touches[0];this.touchLastTime=O,this.touchStart=O;var z=function(Mt){return S.onTouchMove(Mt,d.eElement)},te=function(Mt){return S.onTouchUp(Mt,d.eElement)},Fe=function(Mt){Mt.cancelable&&Mt.preventDefault()},Ue=d.eElement,ut=[{target:document,type:"touchmove",listener:Fe,options:{passive:!1}},{target:Ue,type:"touchmove",listener:z,options:{passive:!0}},{target:Ue,type:"touchend",listener:te,options:{passive:!0}},{target:Ue,type:"touchcancel",listener:te,options:{passive:!0}}];this.addTemporaryEvents(ut),d.dragStartPixels===0&&this.onCommonMove(O,this.touchStart,d.eElement)},f.prototype.onMouseDown=function(d,g){var S=this,O=g;if(!(d.skipMouseEvent&&d.skipMouseEvent(g))&&!O._alreadyProcessedByDragService&&(O._alreadyProcessedByDragService=!0,g.button===0)){this.currentDragParams=d,this.dragging=!1,this.mouseStartEvent=g;var z=this.gridOptionsWrapper.getDocument(),te=function(ni){return S.onMouseMove(ni,d.eElement)},Fe=function(ni){return S.onMouseUp(ni,d.eElement)},Ue=function(ni){return ni.preventDefault()},ut=z,Mt=[{target:ut,type:"mousemove",listener:te},{target:ut,type:"mouseup",listener:Fe},{target:ut,type:"contextmenu",listener:Ue}];this.addTemporaryEvents(Mt),d.dragStartPixels===0&&this.onMouseMove(g,d.eElement)}},f.prototype.addTemporaryEvents=function(d){d.forEach(function(g){var S=g.target,O=g.type,z=g.listener,te=g.options;S.addEventListener(O,z,te)}),this.dragEndFunctions.push(function(){d.forEach(function(g){var S=g.target,O=g.type,z=g.listener,te=g.options;S.removeEventListener(O,z,te)})})},f.prototype.isEventNearStartEvent=function(d,g){var S=this.currentDragParams.dragStartPixels,O=i(S)?S:4;return Rn(d,g,O)},f.prototype.getFirstActiveTouch=function(d){for(var g=0;g=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Jte=function(M){W0e(f,M);function f(){var g=M!==null&&M.apply(this,arguments)||this;return g.allColumnFilters=new Map,g.activeAggregateFilters=[],g.activeColumnFilters=[],g.quickFilter=null,g.quickFilterParts=null,g.processingFilterChange=!1,g}h=f,f.prototype.init=function(){var g=this;this.addManagedListener(this.eventService,li.EVENT_GRID_COLUMNS_CHANGED,function(){return g.onColumnsChanged()}),this.addManagedListener(this.eventService,li.EVENT_COLUMN_VALUE_CHANGED,function(){return g.refreshFiltersForAggregations()}),this.addManagedListener(this.eventService,li.EVENT_COLUMN_PIVOT_CHANGED,function(){return g.refreshFiltersForAggregations()}),this.addManagedListener(this.eventService,li.EVENT_COLUMN_PIVOT_MODE_CHANGED,function(){return g.refreshFiltersForAggregations()}),this.quickFilter=this.parseQuickFilter(this.gridOptionsWrapper.getQuickFilterText()),this.setQuickFilterParts(),this.allowShowChangeAfterFilter=this.gridOptionsWrapper.isAllowShowChangeAfterFilter()},f.prototype.setQuickFilterParts=function(){this.quickFilterParts=this.quickFilter?this.quickFilter.split(" "):null},f.prototype.setFilterModel=function(g){var x=this,P=[],z=this.getFilterModel();if(g){var ee=fI(Object.keys(g));this.allColumnFilters.forEach(function(Me,je){var ut=g[je];P.push(x.setModelOnFilterWrapper(Me.filterPromise,ut)),ee.delete(je)}),ee.forEach(function(Me){var je=x.columnModel.getPrimaryColumn(Me)||x.columnModel.getGridColumn(Me);if(!je){console.warn("AG Grid: setFilterModel() - no column found for colId: "+Me);return}if(!je.isFilterAllowed()){console.warn("AG Grid: setFilterModel() - unable to fully apply model, filtering disabled for colId: "+Me);return}var ut=x.getOrCreateFilterWrapper(je,"NO_UI");if(!ut){console.warn("AG-Grid: setFilterModel() - unable to fully apply model, unable to create filter for colId: "+Me);return}P.push(x.setModelOnFilterWrapper(ut.filterPromise,g[Me]))})}else this.allColumnFilters.forEach(function(Me){P.push(x.setModelOnFilterWrapper(Me.filterPromise,null))});Km.all(P).then(function(){var Me=x.getFilterModel(),je=[];x.allColumnFilters.forEach(function(ut,Rt){var Zt=z?z[Rt]:null,vi=Me?Me[Rt]:null;co.jsonEquals(Zt,vi)||je.push(ut.column)}),je.length>0&&x.onFilterChanged({columns:je})})},f.prototype.setModelOnFilterWrapper=function(g,x){return new Km(function(P){g.then(function(z){typeof z.setModel!="function"&&(console.warn("AG Grid: filter missing setModel method, which is needed for setFilterModel"),P()),(z.setModel(x)||Km.resolve()).then(function(){return P()})})})},f.prototype.getFilterModel=function(){var g={};return this.allColumnFilters.forEach(function(x,P){var z=x.filterPromise,ee=z.resolveNow(null,function(je){return je});if(ee==null)return null;if(typeof ee.getModel!="function"){console.warn("AG Grid: filter API missing getModel method, which is needed for getFilterModel");return}var Me=ee.getModel();i(Me)&&(g[P]=Me)}),g},f.prototype.isColumnFilterPresent=function(){return this.activeColumnFilters.length>0},f.prototype.isAggregateFilterPresent=function(){return!!this.activeAggregateFilters.length},f.prototype.doAggregateFiltersPass=function(g,x){return this.doColumnFiltersPass(g,x,!0)},f.prototype.updateActiveFilters=function(){var g=this;this.activeColumnFilters.length=0,this.activeAggregateFilters.length=0;var x=function(ee){return ee?ee.isFilterActive?ee.isFilterActive():(console.warn("AG Grid: Filter is missing isFilterActive() method"),!1):!1},P=!!this.gridOptionsWrapper.getGroupAggFiltering(),z=function(ee){var Me=!ee.isPrimary();if(Me)return!0;var je=!g.columnModel.isPivotActive(),ut=ee.isValueActive();return!ut||!je?!1:g.columnModel.isPivotMode()?!0:P};this.allColumnFilters.forEach(function(ee){if(ee.filterPromise.resolveNow(!1,x)){var Me=ee.filterPromise.resolveNow(null,function(je){return je});z(ee.column)?g.activeAggregateFilters.push(Me):g.activeColumnFilters.push(Me)}})},f.prototype.updateFilterFlagInColumns=function(g,x){this.allColumnFilters.forEach(function(P){var z=P.filterPromise.resolveNow(!1,function(ee){return ee.isFilterActive()});P.column.setFilterActive(z,g,x)})},f.prototype.isAnyFilterPresent=function(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.gridOptionsWrapper.isExternalFilterPresent()},f.prototype.doColumnFiltersPass=function(g,x,P){for(var z=g.data,ee=g.aggData,Me=P?this.activeAggregateFilters:this.activeColumnFilters,je=P?ee:z,ut=0;ut=0})},f.prototype.doesRowPassQuickFilterCache=function(g,x){return g.quickFilterAggregateText||this.aggregateRowForQuickFilter(g),g.quickFilterAggregateText.indexOf(x)>=0},f.prototype.doesRowPassQuickFilter=function(g){var x=this,P=this.gridOptionsWrapper.isCacheQuickFilter();return this.quickFilterParts.every(function(z){return P?x.doesRowPassQuickFilterCache(g,z):x.doesRowPassQuickFilterNoCache(g,z)})},f.prototype.doesRowPassAggregateFilters=function(g){return!(this.isAggregateFilterPresent()&&!this.doAggregateFiltersPass(g.rowNode,g.filterInstanceToSkip))},f.prototype.doesRowPassFilter=function(g){return!(this.isQuickFilterPresent()&&!this.doesRowPassQuickFilter(g.rowNode)||this.gridOptionsWrapper.isExternalFilterPresent()&&!this.gridOptionsWrapper.doesExternalFilterPass(g.rowNode)||this.isColumnFilterPresent()&&!this.doColumnFiltersPass(g.rowNode,g.filterInstanceToSkip))},f.prototype.getQuickFilterTextForColumn=function(g,x){var P=this.valueService.getValue(g,x,!0),z=g.getColDef();if(z.getQuickFilterText){var ee={value:P,node:x,data:x.data,column:g,colDef:z,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()};P=z.getQuickFilterText(ee)}return i(P)?P.toString().toUpperCase():null},f.prototype.aggregateRowForQuickFilter=function(g){var x=this,P=[],z=this.columnModel.getAllColumnsForQuickFilter();z.forEach(function(ee){var Me=x.getQuickFilterTextForColumn(ee,g);i(Me)&&P.push(Me)}),g.quickFilterAggregateText=P.join(h.QUICK_FILTER_SEPARATOR)},f.prototype.onNewRowsLoaded=function(g){this.allColumnFilters.forEach(function(x){x.filterPromise.then(function(P){P.onNewRowsLoaded&&P.onNewRowsLoaded()})}),this.updateFilterFlagInColumns(g),this.updateActiveFilters()},f.prototype.createValueGetter=function(g){var x=this;return function(P){var z=P.node;return x.valueService.getValue(g,z,!0)}},f.prototype.getFilterComponent=function(g,x,P){P===void 0&&(P=!0);var z;if(P)return((z=this.getOrCreateFilterWrapper(g,x))===null||z===void 0?void 0:z.filterPromise)||null;var ee=this.cachedFilter(g);return ee?ee.filterPromise:null},f.prototype.isFilterActive=function(g){var x=this.cachedFilter(g);return!!x&&x.filterPromise.resolveNow(!1,function(P){return P.isFilterActive()})},f.prototype.getOrCreateFilterWrapper=function(g,x){if(!g.isFilterAllowed())return null;var P=this.cachedFilter(g);return P?x!=="NO_UI"&&this.putIntoGui(P,x):(P=this.createFilterWrapper(g,x),this.allColumnFilters.set(g.getColId(),P)),P},f.prototype.cachedFilter=function(g){return this.allColumnFilters.get(g.getColId())},f.prototype.createFilterInstance=function(g){var x=this,P=ni.isRegistered(t.ModuleNames.SetFilterModule)?"agSetColumnFilter":"agTextColumnFilter",z=g.getColDef(),ee,Me=J$(J$({},this.createFilterParams(g,z)),{filterModifiedCallback:function(){var Rt={type:li.EVENT_FILTER_MODIFIED,api:x.gridApi,columnApi:x.columnApi,column:g,filterInstance:ee};x.eventService.dispatchEvent(Rt)},filterChangedCallback:function(Rt){var Zt={filterInstance:ee,additionalEventAttributes:Rt,columns:[g]};x.callOnFilterChangedOutsideRenderCycle(Zt)},doesRowPassOtherFilter:function(Rt){return x.doesRowPassOtherFilters(ee,Rt)}}),je=this.userComponentFactory.getFilterDetails(z,Me,P);if(!je)return null;var ut=je.newAgStackInstance();return ut&&ut.then(function(Rt){return ee=Rt}),ut},f.prototype.createFilterParams=function(g,x){var P={api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),column:g,colDef:O(x),rowModel:this.rowModel,filterChangedCallback:function(){},filterModifiedCallback:function(){},valueGetter:this.createValueGetter(g),context:this.gridOptionsWrapper.getContext(),doesRowPassOtherFilter:function(){return!0}};return P},f.prototype.createFilterWrapper=function(g,x){var P={column:g,filterPromise:null,compiledElement:null,guiPromise:Km.resolve(null)};return P.filterPromise=this.createFilterInstance(g),P.filterPromise&&this.putIntoGui(P,x),P},f.prototype.putIntoGui=function(g,x){var P=this,z=document.createElement("div");z.className="ag-filter",g.guiPromise=new Km(function(ee){g.filterPromise.then(function(Me){var je=Me.getGui();i(je)||console.warn("AG Grid: getGui method from filter returned "+je+", it should be a DOM element or an HTML template string."),typeof je=="string"&&(je=yu(je)),z.appendChild(je),ee(z),P.eventService.dispatchEvent({type:li.EVENT_FILTER_OPENED,column:g.column,source:x,eGui:z,api:P.gridApi,columnApi:P.columnApi})})})},f.prototype.onColumnsChanged=function(){var g=this,x=[];this.allColumnFilters.forEach(function(P,z){var ee;P.column.isPrimary()?ee=g.columnModel.getPrimaryColumn(z):ee=g.columnModel.getGridColumn(z),!ee&&(x.push(P.column),g.disposeFilterWrapper(P,"filterDestroyed"))}),x.length>0&&this.onFilterChanged({columns:x})},f.prototype.destroyFilter=function(g,x){x===void 0&&(x="api");var P=this.allColumnFilters.get(g.getColId());P&&(this.disposeFilterWrapper(P,x),this.onFilterChanged({columns:[g]}))},f.prototype.disposeFilterWrapper=function(g,x){var P=this;g.filterPromise.then(function(z){(z.setModel(null)||Km.resolve()).then(function(){P.getContext().destroyBean(z),g.column.setFilterActive(!1,x),P.allColumnFilters.delete(g.column.getColId())})})},f.prototype.destroy=function(){var g=this;M.prototype.destroy.call(this),this.allColumnFilters.forEach(function(x){return g.disposeFilterWrapper(x,"filterDestroyed")})};var h;return f.QUICK_FILTER_SEPARATOR=` -`,B0([ce("valueService")],f.prototype,"valueService",void 0),B0([ce("columnModel")],f.prototype,"columnModel",void 0),B0([ce("rowModel")],f.prototype,"rowModel",void 0),B0([ce("columnApi")],f.prototype,"columnApi",void 0),B0([ce("gridApi")],f.prototype,"gridApi",void 0),B0([ce("userComponentFactory")],f.prototype,"userComponentFactory",void 0),B0([ce("rowRenderer")],f.prototype,"rowRenderer",void 0),B0([it],f.prototype,"init",null),B0([pt],f.prototype,"destroy",null),f=h=B0([Le("filterManager")],f),f}($i);/** + */var X0e=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),X$=function(){return X$=Object.assign||function(M){for(var f,d=1,g=arguments.length;d=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Kte=function(M){X0e(f,M);function f(){var g=M!==null&&M.apply(this,arguments)||this;return g.allColumnFilters=new Map,g.activeAggregateFilters=[],g.activeColumnFilters=[],g.quickFilter=null,g.quickFilterParts=null,g.processingFilterChange=!1,g}d=f,f.prototype.init=function(){var g=this;this.addManagedListener(this.eventService,ui.EVENT_GRID_COLUMNS_CHANGED,function(){return g.onColumnsChanged()}),this.addManagedListener(this.eventService,ui.EVENT_COLUMN_VALUE_CHANGED,function(){return g.refreshFiltersForAggregations()}),this.addManagedListener(this.eventService,ui.EVENT_COLUMN_PIVOT_CHANGED,function(){return g.refreshFiltersForAggregations()}),this.addManagedListener(this.eventService,ui.EVENT_COLUMN_PIVOT_MODE_CHANGED,function(){return g.refreshFiltersForAggregations()}),this.quickFilter=this.parseQuickFilter(this.gridOptionsWrapper.getQuickFilterText()),this.setQuickFilterParts(),this.allowShowChangeAfterFilter=this.gridOptionsWrapper.isAllowShowChangeAfterFilter()},f.prototype.setQuickFilterParts=function(){this.quickFilterParts=this.quickFilter?this.quickFilter.split(" "):null},f.prototype.setFilterModel=function(g){var S=this,O=[],z=this.getFilterModel();if(g){var te=pI(Object.keys(g));this.allColumnFilters.forEach(function(Fe,Ue){var ut=g[Ue];O.push(S.setModelOnFilterWrapper(Fe.filterPromise,ut)),te.delete(Ue)}),te.forEach(function(Fe){var Ue=S.columnModel.getPrimaryColumn(Fe)||S.columnModel.getGridColumn(Fe);if(!Ue){console.warn("AG Grid: setFilterModel() - no column found for colId: "+Fe);return}if(!Ue.isFilterAllowed()){console.warn("AG Grid: setFilterModel() - unable to fully apply model, filtering disabled for colId: "+Fe);return}var ut=S.getOrCreateFilterWrapper(Ue,"NO_UI");if(!ut){console.warn("AG-Grid: setFilterModel() - unable to fully apply model, unable to create filter for colId: "+Fe);return}O.push(S.setModelOnFilterWrapper(ut.filterPromise,g[Fe]))})}else this.allColumnFilters.forEach(function(Fe){O.push(S.setModelOnFilterWrapper(Fe.filterPromise,null))});Qm.all(O).then(function(){var Fe=S.getFilterModel(),Ue=[];S.allColumnFilters.forEach(function(ut,Mt){var ni=z?z[Mt]:null,Si=Fe?Fe[Mt]:null;So.jsonEquals(ni,Si)||Ue.push(ut.column)}),Ue.length>0&&S.onFilterChanged({columns:Ue})})},f.prototype.setModelOnFilterWrapper=function(g,S){return new Qm(function(O){g.then(function(z){typeof z.setModel!="function"&&(console.warn("AG Grid: filter missing setModel method, which is needed for setFilterModel"),O()),(z.setModel(S)||Qm.resolve()).then(function(){return O()})})})},f.prototype.getFilterModel=function(){var g={};return this.allColumnFilters.forEach(function(S,O){var z=S.filterPromise,te=z.resolveNow(null,function(Ue){return Ue});if(te==null)return null;if(typeof te.getModel!="function"){console.warn("AG Grid: filter API missing getModel method, which is needed for getFilterModel");return}var Fe=te.getModel();i(Fe)&&(g[O]=Fe)}),g},f.prototype.isColumnFilterPresent=function(){return this.activeColumnFilters.length>0},f.prototype.isAggregateFilterPresent=function(){return!!this.activeAggregateFilters.length},f.prototype.doAggregateFiltersPass=function(g,S){return this.doColumnFiltersPass(g,S,!0)},f.prototype.updateActiveFilters=function(){var g=this;this.activeColumnFilters.length=0,this.activeAggregateFilters.length=0;var S=function(te){return te?te.isFilterActive?te.isFilterActive():(console.warn("AG Grid: Filter is missing isFilterActive() method"),!1):!1},O=!!this.gridOptionsWrapper.getGroupAggFiltering(),z=function(te){var Fe=!te.isPrimary();if(Fe)return!0;var Ue=!g.columnModel.isPivotActive(),ut=te.isValueActive();return!ut||!Ue?!1:g.columnModel.isPivotMode()?!0:O};this.allColumnFilters.forEach(function(te){if(te.filterPromise.resolveNow(!1,S)){var Fe=te.filterPromise.resolveNow(null,function(Ue){return Ue});z(te.column)?g.activeAggregateFilters.push(Fe):g.activeColumnFilters.push(Fe)}})},f.prototype.updateFilterFlagInColumns=function(g,S){this.allColumnFilters.forEach(function(O){var z=O.filterPromise.resolveNow(!1,function(te){return te.isFilterActive()});O.column.setFilterActive(z,g,S)})},f.prototype.isAnyFilterPresent=function(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.gridOptionsWrapper.isExternalFilterPresent()},f.prototype.doColumnFiltersPass=function(g,S,O){for(var z=g.data,te=g.aggData,Fe=O?this.activeAggregateFilters:this.activeColumnFilters,Ue=O?te:z,ut=0;ut=0})},f.prototype.doesRowPassQuickFilterCache=function(g,S){return g.quickFilterAggregateText||this.aggregateRowForQuickFilter(g),g.quickFilterAggregateText.indexOf(S)>=0},f.prototype.doesRowPassQuickFilter=function(g){var S=this,O=this.gridOptionsWrapper.isCacheQuickFilter();return this.quickFilterParts.every(function(z){return O?S.doesRowPassQuickFilterCache(g,z):S.doesRowPassQuickFilterNoCache(g,z)})},f.prototype.doesRowPassAggregateFilters=function(g){return!(this.isAggregateFilterPresent()&&!this.doAggregateFiltersPass(g.rowNode,g.filterInstanceToSkip))},f.prototype.doesRowPassFilter=function(g){return!(this.isQuickFilterPresent()&&!this.doesRowPassQuickFilter(g.rowNode)||this.gridOptionsWrapper.isExternalFilterPresent()&&!this.gridOptionsWrapper.doesExternalFilterPass(g.rowNode)||this.isColumnFilterPresent()&&!this.doColumnFiltersPass(g.rowNode,g.filterInstanceToSkip))},f.prototype.getQuickFilterTextForColumn=function(g,S){var O=this.valueService.getValue(g,S,!0),z=g.getColDef();if(z.getQuickFilterText){var te={value:O,node:S,data:S.data,column:g,colDef:z,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()};O=z.getQuickFilterText(te)}return i(O)?O.toString().toUpperCase():null},f.prototype.aggregateRowForQuickFilter=function(g){var S=this,O=[],z=this.columnModel.getAllColumnsForQuickFilter();z.forEach(function(te){var Fe=S.getQuickFilterTextForColumn(te,g);i(Fe)&&O.push(Fe)}),g.quickFilterAggregateText=O.join(d.QUICK_FILTER_SEPARATOR)},f.prototype.onNewRowsLoaded=function(g){this.allColumnFilters.forEach(function(S){S.filterPromise.then(function(O){O.onNewRowsLoaded&&O.onNewRowsLoaded()})}),this.updateFilterFlagInColumns(g),this.updateActiveFilters()},f.prototype.createValueGetter=function(g){var S=this;return function(O){var z=O.node;return S.valueService.getValue(g,z,!0)}},f.prototype.getFilterComponent=function(g,S,O){O===void 0&&(O=!0);var z;if(O)return((z=this.getOrCreateFilterWrapper(g,S))===null||z===void 0?void 0:z.filterPromise)||null;var te=this.cachedFilter(g);return te?te.filterPromise:null},f.prototype.isFilterActive=function(g){var S=this.cachedFilter(g);return!!S&&S.filterPromise.resolveNow(!1,function(O){return O.isFilterActive()})},f.prototype.getOrCreateFilterWrapper=function(g,S){if(!g.isFilterAllowed())return null;var O=this.cachedFilter(g);return O?S!=="NO_UI"&&this.putIntoGui(O,S):(O=this.createFilterWrapper(g,S),this.allColumnFilters.set(g.getColId(),O)),O},f.prototype.cachedFilter=function(g){return this.allColumnFilters.get(g.getColId())},f.prototype.createFilterInstance=function(g){var S=this,O=Xt.isRegistered(t.ModuleNames.SetFilterModule)?"agSetColumnFilter":"agTextColumnFilter",z=g.getColDef(),te,Fe=X$(X$({},this.createFilterParams(g,z)),{filterModifiedCallback:function(){var Mt={type:ui.EVENT_FILTER_MODIFIED,api:S.gridApi,columnApi:S.columnApi,column:g,filterInstance:te};S.eventService.dispatchEvent(Mt)},filterChangedCallback:function(Mt){var ni={filterInstance:te,additionalEventAttributes:Mt,columns:[g]};S.callOnFilterChangedOutsideRenderCycle(ni)},doesRowPassOtherFilter:function(Mt){return S.doesRowPassOtherFilters(te,Mt)}}),Ue=this.userComponentFactory.getFilterDetails(z,Fe,O);if(!Ue)return null;var ut=Ue.newAgStackInstance();return ut&&ut.then(function(Mt){return te=Mt}),ut},f.prototype.createFilterParams=function(g,S){var O={api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),column:g,colDef:P(S),rowModel:this.rowModel,filterChangedCallback:function(){},filterModifiedCallback:function(){},valueGetter:this.createValueGetter(g),context:this.gridOptionsWrapper.getContext(),doesRowPassOtherFilter:function(){return!0}};return O},f.prototype.createFilterWrapper=function(g,S){var O={column:g,filterPromise:null,compiledElement:null,guiPromise:Qm.resolve(null)};return O.filterPromise=this.createFilterInstance(g),O.filterPromise&&this.putIntoGui(O,S),O},f.prototype.putIntoGui=function(g,S){var O=this,z=document.createElement("div");z.className="ag-filter",g.guiPromise=new Qm(function(te){g.filterPromise.then(function(Fe){var Ue=Fe.getGui();i(Ue)||console.warn("AG Grid: getGui method from filter returned "+Ue+", it should be a DOM element or an HTML template string."),typeof Ue=="string"&&(Ue=Au(Ue)),z.appendChild(Ue),te(z),O.eventService.dispatchEvent({type:ui.EVENT_FILTER_OPENED,column:g.column,source:S,eGui:z,api:O.gridApi,columnApi:O.columnApi})})})},f.prototype.onColumnsChanged=function(){var g=this,S=[];this.allColumnFilters.forEach(function(O,z){var te;O.column.isPrimary()?te=g.columnModel.getPrimaryColumn(z):te=g.columnModel.getGridColumn(z),!te&&(S.push(O.column),g.disposeFilterWrapper(O,"filterDestroyed"))}),S.length>0&&this.onFilterChanged({columns:S})},f.prototype.destroyFilter=function(g,S){S===void 0&&(S="api");var O=this.allColumnFilters.get(g.getColId());O&&(this.disposeFilterWrapper(O,S),this.onFilterChanged({columns:[g]}))},f.prototype.disposeFilterWrapper=function(g,S){var O=this;g.filterPromise.then(function(z){(z.setModel(null)||Qm.resolve()).then(function(){O.getContext().destroyBean(z),g.column.setFilterActive(!1,S),O.allColumnFilters.delete(g.column.getColId())})})},f.prototype.destroy=function(){var g=this;M.prototype.destroy.call(this),this.allColumnFilters.forEach(function(S){return g.disposeFilterWrapper(S,"filterDestroyed")})};var d;return f.QUICK_FILTER_SEPARATOR=` +`,G0([pe("valueService")],f.prototype,"valueService",void 0),G0([pe("columnModel")],f.prototype,"columnModel",void 0),G0([pe("rowModel")],f.prototype,"rowModel",void 0),G0([pe("columnApi")],f.prototype,"columnApi",void 0),G0([pe("gridApi")],f.prototype,"gridApi",void 0),G0([pe("userComponentFactory")],f.prototype,"userComponentFactory",void 0),G0([pe("rowRenderer")],f.prototype,"rowRenderer",void 0),G0([ht],f.prototype,"init",null),G0([wt],f.prototype,"destroy",null),f=d=G0([Ne("filterManager")],f),f}(ji);/** * @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/ * @license MIT - */var gz=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),hC=function(M){gz(f,M);function f(h,g){var x=M.call(this,h)||this;return x.ctrl=g,x}return f.prototype.getCtrl=function(){return this.ctrl},f}(Sa);/** + */var gz=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),uC=function(M){gz(f,M);function f(d,g){var S=M.call(this,d)||this;return S.ctrl=g,S}return f.prototype.getCtrl=function(){return this.ctrl},f}(Ma);/** * @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/ * @license MIT - */var Zte=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),kI=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},yz=function(M){Zte(f,M);function f(h){return M.call(this,f.TEMPLATE,h)||this}return f.prototype.postConstruct=function(){var h=this,g=this.getGui(),x={addOrRemoveCssClass:function(P,z){return h.addOrRemoveCssClass(P,z)},addOrRemoveBodyCssClass:function(P,z){return h.eFloatingFilterBody.classList.toggle(P,z)},addOrRemoveButtonWrapperCssClass:function(P,z){return h.eButtonWrapper.classList.toggle(P,z)},setCompDetails:function(P){return h.setCompDetails(P)},getFloatingFilterComp:function(){return h.compPromise},setWidth:function(P){return g.style.width=P},setMenuIcon:function(P){return h.eButtonShowMainFilter.appendChild(P)}};this.ctrl.setComp(x,g,this.eButtonShowMainFilter,this.eFloatingFilterBody)},f.prototype.setCompDetails=function(h){var g=this;this.compPromise=h.newAgStackInstance(),this.compPromise.then(function(x){return g.afterCompCreated(x)})},f.prototype.afterCompCreated=function(h){var g=this;h&&(this.addDestroyFunc(function(){return g.context.destroyBean(h)}),this.isAlive()&&(this.eFloatingFilterBody.appendChild(h.getGui()),h.afterGuiAttached&&h.afterGuiAttached()))},f.TEMPLATE=`
+ */var Jte=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),NI=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},yz=function(M){Jte(f,M);function f(d){return M.call(this,f.TEMPLATE,d)||this}return f.prototype.postConstruct=function(){var d=this,g=this.getGui(),S={addOrRemoveCssClass:function(O,z){return d.addOrRemoveCssClass(O,z)},addOrRemoveBodyCssClass:function(O,z){return d.eFloatingFilterBody.classList.toggle(O,z)},addOrRemoveButtonWrapperCssClass:function(O,z){return d.eButtonWrapper.classList.toggle(O,z)},setCompDetails:function(O){return d.setCompDetails(O)},getFloatingFilterComp:function(){return d.compPromise},setWidth:function(O){return g.style.width=O},setMenuIcon:function(O){return d.eButtonShowMainFilter.appendChild(O)}};this.ctrl.setComp(S,g,this.eButtonShowMainFilter,this.eFloatingFilterBody)},f.prototype.setCompDetails=function(d){var g=this;this.compPromise=d.newAgStackInstance(),this.compPromise.then(function(S){return g.afterCompCreated(S)})},f.prototype.afterCompCreated=function(d){var g=this;d&&(this.addDestroyFunc(function(){return g.context.destroyBean(d)}),this.isAlive()&&(this.eFloatingFilterBody.appendChild(d.getGui()),d.afterGuiAttached&&d.afterGuiAttached()))},f.TEMPLATE=`
-
`,kI([zr("eFloatingFilterBody")],f.prototype,"eFloatingFilterBody",void 0),kI([zr("eButtonWrapper")],f.prototype,"eButtonWrapper",void 0),kI([zr("eButtonShowMainFilter")],f.prototype,"eButtonShowMainFilter",void 0),kI([it],f.prototype,"postConstruct",null),f}(hC);/** +
`,NI([tn("eFloatingFilterBody")],f.prototype,"eFloatingFilterBody",void 0),NI([tn("eButtonWrapper")],f.prototype,"eButtonWrapper",void 0),NI([tn("eButtonShowMainFilter")],f.prototype,"eButtonShowMainFilter",void 0),NI([ht],f.prototype,"postConstruct",null),f}(uC);/** * @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/ * @license MIT - */var Z$=function(){function M(){}return M.parse=function(f){if(!f)return null;if(f===!0)return{toolPanels:[M.DEFAULT_COLUMN_COMP,M.DEFAULT_FILTER_COMP],defaultToolPanel:"columns"};if(typeof f=="string")return M.parse([f]);if(Array.isArray(f)){var h=[];return f.forEach(function(x){var P=M.DEFAULT_BY_KEY[x];if(!P){console.warn("AG Grid: the key "+x+" is not a valid key for specifying a tool panel, valid keys are: "+Object.keys(M.DEFAULT_BY_KEY).join(","));return}h.push(P)}),h.length===0?null:{toolPanels:h,defaultToolPanel:h[0].id}}var g={toolPanels:M.parseComponents(f.toolPanels),defaultToolPanel:f.defaultToolPanel,hiddenByDefault:f.hiddenByDefault,position:f.position};return g},M.parseComponents=function(f){var h=[];return f&&f.forEach(function(g){var x=null;if(typeof g=="string"){var P=M.DEFAULT_BY_KEY[g];if(!P){console.warn("AG Grid: the key "+g+" is not a valid key for specifying a tool panel, valid keys are: "+Object.keys(M.DEFAULT_BY_KEY).join(","));return}x=P}else x=g;h.push(x)}),h},M.DEFAULT_COLUMN_COMP={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},M.DEFAULT_FILTER_COMP={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},M.DEFAULT_BY_KEY={columns:M.DEFAULT_COLUMN_COMP,filters:M.DEFAULT_FILTER_COMP},M}();/** + */var K$=function(){function M(){}return M.parse=function(f){if(!f)return null;if(f===!0)return{toolPanels:[M.DEFAULT_COLUMN_COMP,M.DEFAULT_FILTER_COMP],defaultToolPanel:"columns"};if(typeof f=="string")return M.parse([f]);if(Array.isArray(f)){var d=[];return f.forEach(function(S){var O=M.DEFAULT_BY_KEY[S];if(!O){console.warn("AG Grid: the key "+S+" is not a valid key for specifying a tool panel, valid keys are: "+Object.keys(M.DEFAULT_BY_KEY).join(","));return}d.push(O)}),d.length===0?null:{toolPanels:d,defaultToolPanel:d[0].id}}var g={toolPanels:M.parseComponents(f.toolPanels),defaultToolPanel:f.defaultToolPanel,hiddenByDefault:f.hiddenByDefault,position:f.position};return g},M.parseComponents=function(f){var d=[];return f&&f.forEach(function(g){var S=null;if(typeof g=="string"){var O=M.DEFAULT_BY_KEY[g];if(!O){console.warn("AG Grid: the key "+g+" is not a valid key for specifying a tool panel, valid keys are: "+Object.keys(M.DEFAULT_BY_KEY).join(","));return}S=O}else S=g;d.push(S)}),d},M.DEFAULT_COLUMN_COMP={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columns",toolPanel:"agColumnsToolPanel"},M.DEFAULT_FILTER_COMP={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filter",toolPanel:"agFiltersToolPanel"},M.DEFAULT_BY_KEY={columns:M.DEFAULT_COLUMN_COMP,filters:M.DEFAULT_FILTER_COMP},M}();/** * @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/ * @license MIT - */var _1=function(){return _1=Object.assign||function(M){for(var f,h=1,g=arguments.length;h=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Qte=function(M,f){return function(h,g){f(h,g,M)}},q0e=function(M,f){var h=typeof Symbol=="function"&&M[Symbol.iterator];if(!h)return M;var g=h.call(M),x,P=[],z;try{for(;(f===void 0||f-- >0)&&!(x=g.next()).done;)P.push(x.value)}catch(ee){z={error:ee}}finally{try{x&&!x.done&&(h=g.return)&&h.call(g)}finally{if(z)throw z.error}}return P},vz=function(){for(var M=[],f=0;f=0?M:f}function tie(M,f){var h=parseInt(M,10);return vu(h)&&h>0?h:f}var Bn=function(){function M(){this.propertyEventService=new gt,this.domDataKey="__AG_"+Math.random().toString(),this.destroyed=!1}f=M,M.prototype.agWire=function(h,g){this.gridOptions.api=h,this.gridOptions.columnApi=g,this.checkForDeprecated(),this.checkForViolations()},M.prototype.destroy=function(){this.gridOptions.api=null,this.gridOptions.columnApi=null,this.destroyed=!0},M.prototype.init=function(){var h=this;this.gridOptions.suppressPropertyNamesCheck!==!0&&(this.checkGridOptionsProperties(),this.checkColumnDefProperties()),this.gridOptions.sideBar!=null&&(this.gridOptions.sideBar=Z$.parse(this.gridOptions.sideBar));var g=this.useAsyncEvents();if(this.eventService.addGlobalListener(this.globalEventHandler.bind(this),g),this.isGroupSelectsChildren()&&this.isSuppressParentsInRowNodes()&&console.warn("AG Grid: 'groupSelectsChildren' does not work with 'suppressParentsInRowNodes', this selection method needs the part in rowNode to work"),this.isGroupSelectsChildren()&&(this.isRowSelectionMulti()||console.warn("AG Grid: rowSelection must be 'multiple' for groupSelectsChildren to make sense"),this.isRowModelServerSide()&&console.warn("AG Grid: group selects children is NOT support for Server Side Row Model. This is because the rows are lazy loaded, so selecting a group is not possible asthe grid has no way of knowing what the children are.")),this.isGroupRemoveSingleChildren()&&this.isGroupHideOpenParents()&&console.warn("AG Grid: groupRemoveSingleChildren and groupHideOpenParents do not work with each other, you need to pick one. And don't ask us how to us these together on our support forum either you will get the same answer!"),this.isRowModelServerSide()){var x=function(z){return"AG Grid: '"+z+"' is not supported on the Server-Side Row Model"};i(this.gridOptions.groupDefaultExpanded)&&console.warn(x("groupDefaultExpanded")),i(this.gridOptions.groupDefaultExpanded)&&console.warn(x("groupIncludeFooter")),i(this.gridOptions.groupDefaultExpanded)&&console.warn(x("groupIncludeTotalFooter"))}this.isEnableRangeSelection()&&ni.assertRegistered(t.ModuleNames.RangeSelectionModule,"enableRangeSelection"),!this.isEnableRangeSelection()&&(this.isEnableRangeHandle()||this.isEnableFillHandle())&&console.warn("AG Grid: 'enableRangeHandle' and 'enableFillHandle' will not work unless 'enableRangeSelection' is set to true");var P=function(z){h.gridOptions.icons&&h.gridOptions.icons[z]&&console.warn("gridOptions.icons."+z+" is no longer supported. For information on how to style checkboxes and radio buttons, see https://www.ag-grid.com/javascript-grid-icons/")};P("radioButtonOff"),P("radioButtonOn"),P("checkboxChecked"),P("checkboxUnchecked"),P("checkboxIndeterminate"),this.getScrollbarWidth()},M.prototype.checkColumnDefProperties=function(){var h=this;this.gridOptions.columnDefs!=null&&this.gridOptions.columnDefs.forEach(function(g){var x=Object.getOwnPropertyNames(g),P=vz(Cr.ALL_PROPERTIES,Cr.FRAMEWORK_PROPERTIES);h.checkProperties(x,P,P,"colDef","https://www.ag-grid.com/javascript-grid-column-properties/")})},M.prototype.checkGridOptionsProperties=function(){var h=Object.getOwnPropertyNames(this.gridOptions),g=vz($o.ALL_PROPERTIES,$o.FRAMEWORK_PROPERTIES,y(li).map(function(P){return _i.getCallbackForEvent(P)})),x=vz(g,["api","columnApi"]);this.checkProperties(h,x,g,"gridOptions","https://www.ag-grid.com/javascript-data-grid/grid-options/")},M.prototype.checkProperties=function(h,g,x,P,z){var ee=il(h,g,x);I(ee,function(Me,je){console.warn("ag-grid: invalid "+P+" property '"+Me+"' did you mean any of these: "+je.slice(0,8).join(", "))}),Object.keys(ee).length>0&&console.warn("ag-grid: to see all the valid "+P+" properties please check: "+z)},M.prototype.mergeGridCommonParams=function(h){var g=this;if(h){var x=function(P){var z=_1(_1({},P),{api:g.getApi(),columnApi:g.getColumnApi(),context:g.getContext()});return h(z)};return x}return h},M.prototype.getDomDataKey=function(){return this.domDataKey},M.prototype.getDomData=function(h,g){var x=h[this.getDomDataKey()];return x?x[g]:void 0},M.prototype.setDomData=function(h,g,x){var P=this.getDomDataKey(),z=h[P];r(z)&&(z={},h[P]=z),z[g]=x},M.prototype.isRowSelection=function(){return this.gridOptions.rowSelection==="single"||this.gridOptions.rowSelection==="multiple"},M.prototype.isSuppressRowDeselection=function(){return Tr(this.gridOptions.suppressRowDeselection)},M.prototype.isRowSelectionMulti=function(){return this.gridOptions.rowSelection==="multiple"},M.prototype.isRowMultiSelectWithClick=function(){return Tr(this.gridOptions.rowMultiSelectWithClick)},M.prototype.getContext=function(){return this.gridOptions.context},M.prototype.isPivotMode=function(){return Tr(this.gridOptions.pivotMode)},M.prototype.isSuppressExpandablePivotGroups=function(){return Tr(this.gridOptions.suppressExpandablePivotGroups)},M.prototype.getPivotColumnGroupTotals=function(){return this.gridOptions.pivotColumnGroupTotals},M.prototype.getPivotRowTotals=function(){return this.gridOptions.pivotRowTotals},M.prototype.isRowModelInfinite=function(){return this.gridOptions.rowModelType===Ue.ROW_MODEL_TYPE_INFINITE},M.prototype.isRowModelViewport=function(){return this.gridOptions.rowModelType===Ue.ROW_MODEL_TYPE_VIEWPORT},M.prototype.isRowModelServerSide=function(){return this.gridOptions.rowModelType===Ue.ROW_MODEL_TYPE_SERVER_SIDE},M.prototype.isRowModelDefault=function(){return r(this.gridOptions.rowModelType)||this.gridOptions.rowModelType===Ue.ROW_MODEL_TYPE_CLIENT_SIDE},M.prototype.isFullRowEdit=function(){return this.gridOptions.editType==="fullRow"},M.prototype.isSuppressFocusAfterRefresh=function(){return Tr(this.gridOptions.suppressFocusAfterRefresh)},M.prototype.isSuppressBrowserResizeObserver=function(){return Tr(this.gridOptions.suppressBrowserResizeObserver)},M.prototype.isSuppressMaintainUnsortedOrder=function(){return Tr(this.gridOptions.suppressMaintainUnsortedOrder)},M.prototype.isSuppressClearOnFillReduction=function(){return Tr(this.gridOptions.suppressClearOnFillReduction)},M.prototype.isShowToolPanel=function(){return Tr(this.gridOptions.sideBar&&Array.isArray(this.getSideBar().toolPanels))},M.prototype.getSideBar=function(){return this.gridOptions.sideBar},M.prototype.isSuppressTouch=function(){return Tr(this.gridOptions.suppressTouch)},M.prototype.isMaintainColumnOrder=function(){return Tr(this.gridOptions.maintainColumnOrder)},M.prototype.isSuppressRowTransform=function(){return Tr(this.gridOptions.suppressRowTransform)},M.prototype.isSuppressColumnStateEvents=function(){return Tr(this.gridOptions.suppressColumnStateEvents)},M.prototype.isAllowDragFromColumnsToolPanel=function(){return Tr(this.gridOptions.allowDragFromColumnsToolPanel)},M.prototype.useAsyncEvents=function(){return!Tr(this.gridOptions.suppressAsyncEvents)},M.prototype.isEnableCellChangeFlash=function(){return Tr(this.gridOptions.enableCellChangeFlash)},M.prototype.getCellFlashDelay=function(){return this.gridOptions.cellFlashDelay||500},M.prototype.getCellFadeDelay=function(){return this.gridOptions.cellFadeDelay||1e3},M.prototype.isGroupSelectsChildren=function(){return Tr(this.gridOptions.groupSelectsChildren)},M.prototype.isSuppressRowHoverHighlight=function(){return Tr(this.gridOptions.suppressRowHoverHighlight)},M.prototype.isColumnHoverHighlight=function(){return Tr(this.gridOptions.columnHoverHighlight)},M.prototype.isGroupSelectsFiltered=function(){return Tr(this.gridOptions.groupSelectsFiltered)},M.prototype.isGroupHideOpenParents=function(){return Tr(this.gridOptions.groupHideOpenParents)},M.prototype.isGroupMaintainOrder=function(){return Tr(this.gridOptions.groupMaintainOrder)},M.prototype.getAutoGroupColumnDef=function(){return this.gridOptions.autoGroupColumnDef},M.prototype.isGroupMultiAutoColumn=function(){return this.gridOptions.groupDisplayType?this.matchesGroupDisplayType("multipleColumns",this.gridOptions.groupDisplayType):Tr(this.gridOptions.groupHideOpenParents)},M.prototype.isGroupUseEntireRow=function(h){return h?!1:this.gridOptions.groupDisplayType?this.matchesGroupDisplayType("groupRows",this.gridOptions.groupDisplayType):!1},M.prototype.isGroupSuppressAutoColumn=function(){var h=this.gridOptions.groupDisplayType?this.matchesGroupDisplayType("custom",this.gridOptions.groupDisplayType):!1;return h?!0:this.gridOptions.treeDataDisplayType?this.matchesTreeDataDisplayType("custom",this.gridOptions.treeDataDisplayType):!1},M.prototype.isGroupRemoveSingleChildren=function(){return Tr(this.gridOptions.groupRemoveSingleChildren)},M.prototype.isGroupRemoveLowestSingleChildren=function(){return Tr(this.gridOptions.groupRemoveLowestSingleChildren)},M.prototype.isGroupIncludeFooter=function(){return Tr(this.gridOptions.groupIncludeFooter)},M.prototype.isGroupIncludeTotalFooter=function(){return Tr(this.gridOptions.groupIncludeTotalFooter)},M.prototype.isGroupSuppressBlankHeader=function(){return Tr(this.gridOptions.groupSuppressBlankHeader)},M.prototype.isSuppressRowClickSelection=function(){return Tr(this.gridOptions.suppressRowClickSelection)},M.prototype.isSuppressCellFocus=function(){return Tr(this.gridOptions.suppressCellFocus)},M.prototype.isSuppressMultiSort=function(){return Tr(this.gridOptions.suppressMultiSort)},M.prototype.isAlwaysMultiSort=function(){return Tr(this.gridOptions.alwaysMultiSort)},M.prototype.isMultiSortKeyCtrl=function(){return this.gridOptions.multiSortKey==="ctrl"},M.prototype.isPivotSuppressAutoColumn=function(){return Tr(this.gridOptions.pivotSuppressAutoColumn)},M.prototype.isSuppressDragLeaveHidesColumns=function(){return Tr(this.gridOptions.suppressDragLeaveHidesColumns)},M.prototype.isSuppressScrollOnNewData=function(){return Tr(this.gridOptions.suppressScrollOnNewData)},M.prototype.isSuppressScrollWhenPopupsAreOpen=function(){return Tr(this.gridOptions.suppressScrollWhenPopupsAreOpen)},M.prototype.isRowDragEntireRow=function(){return Tr(this.gridOptions.rowDragEntireRow)},M.prototype.isSuppressRowDrag=function(){return Tr(this.gridOptions.suppressRowDrag)},M.prototype.isRowDragManaged=function(){return Tr(this.gridOptions.rowDragManaged)},M.prototype.isSuppressMoveWhenRowDragging=function(){return Tr(this.gridOptions.suppressMoveWhenRowDragging)},M.prototype.isRowDragMultiRow=function(){return Tr(this.gridOptions.rowDragMultiRow)},M.prototype.getDomLayout=function(){var h=this.gridOptions.domLayout||Ue.DOM_LAYOUT_NORMAL,g=[Ue.DOM_LAYOUT_PRINT,Ue.DOM_LAYOUT_AUTO_HEIGHT,Ue.DOM_LAYOUT_NORMAL];return g.indexOf(h)===-1?(ze(function(){return console.warn("AG Grid: "+h+" is not valid for DOM Layout, valid values are "+Ue.DOM_LAYOUT_NORMAL+", "+Ue.DOM_LAYOUT_AUTO_HEIGHT+" and "+Ue.DOM_LAYOUT_PRINT)},"warn about dom layout values"),Ue.DOM_LAYOUT_NORMAL):h},M.prototype.isSuppressHorizontalScroll=function(){return Tr(this.gridOptions.suppressHorizontalScroll)},M.prototype.isSuppressMaxRenderedRowRestriction=function(){return Tr(this.gridOptions.suppressMaxRenderedRowRestriction)},M.prototype.isExcludeChildrenWhenTreeDataFiltering=function(){return Tr(this.gridOptions.excludeChildrenWhenTreeDataFiltering)},M.prototype.isAlwaysShowHorizontalScroll=function(){return Tr(this.gridOptions.alwaysShowHorizontalScroll)},M.prototype.isAlwaysShowVerticalScroll=function(){return Tr(this.gridOptions.alwaysShowVerticalScroll)},M.prototype.isDebounceVerticalScrollbar=function(){return Tr(this.gridOptions.debounceVerticalScrollbar)},M.prototype.isSuppressLoadingOverlay=function(){return Tr(this.gridOptions.suppressLoadingOverlay)},M.prototype.isSuppressNoRowsOverlay=function(){return Tr(this.gridOptions.suppressNoRowsOverlay)},M.prototype.isSuppressFieldDotNotation=function(){return Tr(this.gridOptions.suppressFieldDotNotation)},M.prototype.getPinnedTopRowData=function(){return this.gridOptions.pinnedTopRowData},M.prototype.getPinnedBottomRowData=function(){return this.gridOptions.pinnedBottomRowData},M.prototype.isFunctionsPassive=function(){return Tr(this.gridOptions.functionsPassive)},M.prototype.isSuppressChangeDetection=function(){return Tr(this.gridOptions.suppressChangeDetection)},M.prototype.isSuppressAnimationFrame=function(){return Tr(this.gridOptions.suppressAnimationFrame)},M.prototype.getQuickFilterText=function(){return this.gridOptions.quickFilterText},M.prototype.isCacheQuickFilter=function(){return Tr(this.gridOptions.cacheQuickFilter)},M.prototype.isUnSortIcon=function(){return Tr(this.gridOptions.unSortIcon)},M.prototype.isSuppressMenuHide=function(){return Tr(this.gridOptions.suppressMenuHide)},M.prototype.isEnterMovesDownAfterEdit=function(){return Tr(this.gridOptions.enterMovesDownAfterEdit)},M.prototype.isEnterMovesDown=function(){return Tr(this.gridOptions.enterMovesDown)},M.prototype.isUndoRedoCellEditing=function(){return Tr(this.gridOptions.undoRedoCellEditing)},M.prototype.getUndoRedoCellEditingLimit=function(){return e8(this.gridOptions.undoRedoCellEditingLimit)},M.prototype.getRowStyle=function(){return this.gridOptions.rowStyle},M.prototype.getRowClass=function(){return this.gridOptions.rowClass},M.prototype.getRowStyleFunc=function(){return this.mergeGridCommonParams(this.gridOptions.getRowStyle)},M.prototype.getRowClassFunc=function(){return this.mergeGridCommonParams(this.gridOptions.getRowClass)},M.prototype.rowClassRules=function(){return this.gridOptions.rowClassRules},M.prototype.getServerSideStoreType=function(){return this.gridOptions.serverSideStoreType},M.prototype.getServerSideStoreParamsFunc=function(){return this.mergeGridCommonParams(this.gridOptions.getServerSideStoreParams)},M.prototype.getCreateChartContainerFunc=function(){return this.mergeGridCommonParams(this.gridOptions.createChartContainer)},M.prototype.getPopupParent=function(){return this.gridOptions.popupParent},M.prototype.getBlockLoadDebounceMillis=function(){return this.gridOptions.blockLoadDebounceMillis},M.prototype.getPostProcessPopupFunc=function(){return this.mergeGridCommonParams(this.gridOptions.postProcessPopup)},M.prototype.getPaginationNumberFormatterFunc=function(){return this.mergeGridCommonParams(this.gridOptions.paginationNumberFormatter)},M.prototype.getChildCountFunc=function(){return this.gridOptions.getChildCount},M.prototype.getIsApplyServerSideTransactionFunc=function(){return this.mergeGridCommonParams(this.gridOptions.isApplyServerSideTransaction)},M.prototype.getInitialGroupOrderComparator=function(){var h=this.gridOptions,g=h.initialGroupOrderComparator,x=h.defaultGroupOrderComparator;if(g)return this.mergeGridCommonParams(g);if(x)return function(P){return x(P.nodeA,P.nodeB)}},M.prototype.getIsFullWidthCellFunc=function(){var h=this.gridOptions,g=h.isFullWidthRow,x=h.isFullWidthCell;if(g)return this.mergeGridCommonParams(g);if(x)return function(P){return x(P.rowNode)}},M.prototype.getFullWidthCellRendererParams=function(){return this.gridOptions.fullWidthCellRendererParams},M.prototype.isEmbedFullWidthRows=function(){return Tr(this.gridOptions.embedFullWidthRows)||Tr(this.gridOptions.deprecatedEmbedFullWidthRows)},M.prototype.isDetailRowAutoHeight=function(){return Tr(this.gridOptions.detailRowAutoHeight)},M.prototype.getSuppressKeyboardEventFunc=function(){return this.gridOptions.suppressKeyboardEvent},M.prototype.getBusinessKeyForNodeFunc=function(){return this.gridOptions.getBusinessKeyForNode},M.prototype.getApi=function(){return this.gridOptions.api},M.prototype.getColumnApi=function(){return this.gridOptions.columnApi},M.prototype.isReadOnlyEdit=function(){return Tr(this.gridOptions.readOnlyEdit)},M.prototype.isImmutableData=function(){var h=this.gridOptions.getRowId!=null,g=Tr(this.gridOptions.immutableData),x=Tr(this.gridOptions.resetRowDataOnUpdate);return x?!1:h||g},M.prototype.isEnsureDomOrder=function(){return Tr(this.gridOptions.ensureDomOrder)},M.prototype.isEnableCharts=function(){return Tr(this.gridOptions.enableCharts)?ni.assertRegistered(t.ModuleNames.GridChartsModule,"enableCharts"):!1},M.prototype.getColResizeDefault=function(){return this.gridOptions.colResizeDefault},M.prototype.isSingleClickEdit=function(){return Tr(this.gridOptions.singleClickEdit)},M.prototype.isSuppressClickEdit=function(){return Tr(this.gridOptions.suppressClickEdit)},M.prototype.isStopEditingWhenCellsLoseFocus=function(){return Tr(this.gridOptions.stopEditingWhenCellsLoseFocus)},M.prototype.getGroupDefaultExpanded=function(){return this.gridOptions.groupDefaultExpanded},M.prototype.getMaxConcurrentDatasourceRequests=function(){var h=e8(this.gridOptions.maxConcurrentDatasourceRequests);if(h==null)return 2;if(!(h<=0))return h},M.prototype.getMaxBlocksInCache=function(){return this.gridOptions.maxBlocksInCache},M.prototype.getCacheOverflowSize=function(){return this.gridOptions.cacheOverflowSize},M.prototype.getPaginationPageSize=function(){return e8(this.gridOptions.paginationPageSize)},M.prototype.isPaginateChildRows=function(){var h=this.isGroupRemoveSingleChildren()||this.isGroupRemoveLowestSingleChildren();return h?!0:Tr(this.gridOptions.paginateChildRows)},M.prototype.getCacheBlockSize=function(){return tie(this.gridOptions.cacheBlockSize)},M.prototype.getInfiniteInitialRowCount=function(){return this.gridOptions.infiniteInitialRowCount},M.prototype.isPurgeClosedRowNodes=function(){return Tr(this.gridOptions.purgeClosedRowNodes)},M.prototype.isSuppressPaginationPanel=function(){return Tr(this.gridOptions.suppressPaginationPanel)},M.prototype.getRowData=function(){return this.gridOptions.rowData},M.prototype.isEnableRtl=function(){return Tr(this.gridOptions.enableRtl)},M.prototype.getRowGroupPanelShow=function(){return this.gridOptions.rowGroupPanelShow},M.prototype.getPivotPanelShow=function(){return this.gridOptions.pivotPanelShow},M.prototype.isAngularCompileRows=function(){return Tr(this.gridOptions.angularCompileRows)},M.prototype.isAngularCompileFilters=function(){return Tr(this.gridOptions.angularCompileFilters)},M.prototype.isDebug=function(){return Tr(this.gridOptions.debug)},M.prototype.getColumnDefs=function(){return this.gridOptions.columnDefs},M.prototype.getColumnTypes=function(){return this.gridOptions.columnTypes},M.prototype.getDatasource=function(){return this.gridOptions.datasource},M.prototype.getViewportDatasource=function(){return this.gridOptions.viewportDatasource},M.prototype.getServerSideDatasource=function(){return this.gridOptions.serverSideDatasource},M.prototype.isAccentedSort=function(){return Tr(this.gridOptions.accentedSort)},M.prototype.isEnableBrowserTooltips=function(){return Tr(this.gridOptions.enableBrowserTooltips)},M.prototype.isEnableCellExpressions=function(){return Tr(this.gridOptions.enableCellExpressions)},M.prototype.isEnableGroupEdit=function(){return Tr(this.gridOptions.enableGroupEdit)},M.prototype.isSuppressMiddleClickScrolls=function(){return Tr(this.gridOptions.suppressMiddleClickScrolls)},M.prototype.isPreventDefaultOnContextMenu=function(){return Tr(this.gridOptions.preventDefaultOnContextMenu)},M.prototype.isSuppressPreventDefaultOnMouseWheel=function(){return Tr(this.gridOptions.suppressPreventDefaultOnMouseWheel)},M.prototype.isSuppressColumnVirtualisation=function(){return Tr(this.gridOptions.suppressColumnVirtualisation)},M.prototype.isSuppressRowVirtualisation=function(){return Tr(this.gridOptions.suppressRowVirtualisation)},M.prototype.isSuppressContextMenu=function(){return Tr(this.gridOptions.suppressContextMenu)},M.prototype.isAllowContextMenuWithControlKey=function(){return Tr(this.gridOptions.allowContextMenuWithControlKey)},M.prototype.isSuppressCopyRowsToClipboard=function(){return Tr(this.gridOptions.suppressCopyRowsToClipboard)},M.prototype.isSuppressCopySingleCellRanges=function(){return Tr(this.gridOptions.suppressCopySingleCellRanges)},M.prototype.isCopyHeadersToClipboard=function(){return Tr(this.gridOptions.copyHeadersToClipboard)},M.prototype.isCopyGroupHeadersToClipboard=function(){return Tr(this.gridOptions.copyGroupHeadersToClipboard)},M.prototype.isSuppressClipboardPaste=function(){return Tr(this.gridOptions.suppressClipboardPaste)},M.prototype.isSuppressLastEmptyLineOnPaste=function(){return Tr(this.gridOptions.suppressLastEmptyLineOnPaste)},M.prototype.isPagination=function(){return Tr(this.gridOptions.pagination)},M.prototype.isSuppressEnterpriseResetOnNewColumns=function(){return Tr(this.gridOptions.suppressEnterpriseResetOnNewColumns)},M.prototype.getProcessDataFromClipboardFunc=function(){return this.mergeGridCommonParams(this.gridOptions.processDataFromClipboard)},M.prototype.getAsyncTransactionWaitMillis=function(){return i(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:Ue.BATCH_WAIT_MILLIS},M.prototype.isSuppressMovableColumns=function(){return Tr(this.gridOptions.suppressMovableColumns)},M.prototype.isAnimateRows=function(){return this.isEnsureDomOrder()?!1:Tr(this.gridOptions.animateRows)},M.prototype.isSuppressColumnMoveAnimation=function(){return Tr(this.gridOptions.suppressColumnMoveAnimation)},M.prototype.isSuppressAggFuncInHeader=function(){return Tr(this.gridOptions.suppressAggFuncInHeader)},M.prototype.isSuppressAggAtRootLevel=function(){return Tr(this.gridOptions.suppressAggAtRootLevel)},M.prototype.isSuppressAggFilteredOnly=function(){var h=this.getGroupAggFiltering()!==void 0;return h||Tr(this.gridOptions.suppressAggFilteredOnly)},M.prototype.isRemovePivotHeaderRowWhenSingleValueColumn=function(){return Tr(this.gridOptions.removePivotHeaderRowWhenSingleValueColumn)},M.prototype.isShowOpenedGroup=function(){return Tr(this.gridOptions.showOpenedGroup)},M.prototype.isReactUi=function(){return Tr(this.gridOptions.reactUi)},M.prototype.isSuppressReactUi=function(){return Tr(this.gridOptions.suppressReactUi)},M.prototype.isEnableRangeSelection=function(){return ni.isRegistered(t.ModuleNames.RangeSelectionModule)&&Tr(this.gridOptions.enableRangeSelection)},M.prototype.isEnableRangeHandle=function(){return Tr(this.gridOptions.enableRangeHandle)},M.prototype.isEnableFillHandle=function(){return Tr(this.gridOptions.enableFillHandle)},M.prototype.getFillHandleDirection=function(){var h=this.gridOptions.fillHandleDirection;return h?h!=="x"&&h!=="y"&&h!=="xy"?(ze(function(){return console.warn("AG Grid: valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'.")},"warn invalid fill direction"),"xy"):h:"xy"},M.prototype.getFillOperation=function(){return this.mergeGridCommonParams(this.gridOptions.fillOperation)},M.prototype.isSuppressMultiRangeSelection=function(){return Tr(this.gridOptions.suppressMultiRangeSelection)},M.prototype.isPaginationAutoPageSize=function(){return Tr(this.gridOptions.paginationAutoPageSize)},M.prototype.isRememberGroupStateWhenNewData=function(){return Tr(this.gridOptions.rememberGroupStateWhenNewData)},M.prototype.getIcons=function(){return this.gridOptions.icons},M.prototype.getGroupAggFiltering=function(){var h=this.gridOptions.groupAggFiltering;if(typeof h=="function")return this.mergeGridCommonParams(h);if(Tr(h))return function(){return!0}},M.prototype.getAggFuncs=function(){return this.gridOptions.aggFuncs},M.prototype.getSortingOrder=function(){return this.gridOptions.sortingOrder},M.prototype.getAlignedGrids=function(){return this.gridOptions.alignedGrids},M.prototype.isMasterDetail=function(){var h=Tr(this.gridOptions.masterDetail);return h?ni.assertRegistered(t.ModuleNames.MasterDetailModule,"masterDetail"):!1},M.prototype.isKeepDetailRows=function(){return Tr(this.gridOptions.keepDetailRows)},M.prototype.getKeepDetailRowsCount=function(){var h=this.gridOptions.keepDetailRowsCount;return i(h)&&h>0?this.gridOptions.keepDetailRowsCount:Q$},M.prototype.getIsRowMasterFunc=function(){return this.gridOptions.isRowMaster},M.prototype.getIsRowSelectableFunc=function(){return this.gridOptions.isRowSelectable},M.prototype.getGroupRowRendererParams=function(){return this.gridOptions.groupRowRendererParams},M.prototype.getOverlayLoadingTemplate=function(){return this.gridOptions.overlayLoadingTemplate},M.prototype.getOverlayNoRowsTemplate=function(){return this.gridOptions.overlayNoRowsTemplate},M.prototype.isSuppressAutoSize=function(){return Tr(this.gridOptions.suppressAutoSize)},M.prototype.isEnableCellTextSelection=function(){return Tr(this.gridOptions.enableCellTextSelection)},M.prototype.isSuppressParentsInRowNodes=function(){return Tr(this.gridOptions.suppressParentsInRowNodes)},M.prototype.isSuppressClipboardApi=function(){return Tr(this.gridOptions.suppressClipboardApi)},M.prototype.isFunctionsReadOnly=function(){return Tr(this.gridOptions.functionsReadOnly)},M.prototype.isEnableCellTextSelect=function(){return Tr(this.gridOptions.enableCellTextSelection)},M.prototype.getDefaultColDef=function(){return this.gridOptions.defaultColDef},M.prototype.getDefaultColGroupDef=function(){return this.gridOptions.defaultColGroupDef},M.prototype.getDefaultExportParams=function(h){if(this.gridOptions.defaultExportParams)return console.warn("AG Grid: Since v25.2 `defaultExportParams` has been replaced by `default"+wi(h)+"ExportParams`'"),h==="csv"?this.gridOptions.defaultExportParams:this.gridOptions.defaultExportParams;if(h==="csv"&&this.gridOptions.defaultCsvExportParams)return this.gridOptions.defaultCsvExportParams;if(h==="excel"&&this.gridOptions.defaultExcelExportParams)return this.gridOptions.defaultExcelExportParams},M.prototype.isSuppressCsvExport=function(){return Tr(this.gridOptions.suppressCsvExport)},M.prototype.isAllowShowChangeAfterFilter=function(){return Tr(this.gridOptions.allowShowChangeAfterFilter)},M.prototype.isSuppressExcelExport=function(){return Tr(this.gridOptions.suppressExcelExport)},M.prototype.isSuppressMakeColumnVisibleAfterUnGroup=function(){return Tr(this.gridOptions.suppressMakeColumnVisibleAfterUnGroup)},M.prototype.getDataPathFunc=function(){return this.gridOptions.getDataPath},M.prototype.getIsServerSideGroupFunc=function(){return this.gridOptions.isServerSideGroup},M.prototype.getIsServerSideGroupOpenByDefaultFunc=function(){return this.mergeGridCommonParams(this.gridOptions.isServerSideGroupOpenByDefault)},M.prototype.getIsGroupOpenByDefaultFunc=function(){return this.mergeGridCommonParams(this.gridOptions.isGroupOpenByDefault)},M.prototype.getServerSideGroupKeyFunc=function(){return this.gridOptions.getServerSideGroupKey},M.prototype.getGroupRowAggFunc=function(){var h=this.gridOptions,g=h.getGroupRowAgg,x=h.groupRowAggNodes;if(g)return this.mergeGridCommonParams(g);if(x)return function(P){return x(P.nodes)}},M.prototype.getContextMenuItemsFunc=function(){return this.mergeGridCommonParams(this.gridOptions.getContextMenuItems)},M.prototype.getMainMenuItemsFunc=function(){return this.mergeGridCommonParams(this.gridOptions.getMainMenuItems)},M.prototype.getRowIdFunc=function(){var h=this.gridOptions,g=h.getRowId,x=h.getRowNodeId;if(g)return this.mergeGridCommonParams(g);if(x)return function(P){return x(P.data)}},M.prototype.getNavigateToNextHeaderFunc=function(){return this.mergeGridCommonParams(this.gridOptions.navigateToNextHeader)},M.prototype.getTabToNextHeaderFunc=function(){return this.mergeGridCommonParams(this.gridOptions.tabToNextHeader)},M.prototype.getNavigateToNextCellFunc=function(){return this.mergeGridCommonParams(this.gridOptions.navigateToNextCell)},M.prototype.getTabToNextCellFunc=function(){return this.mergeGridCommonParams(this.gridOptions.tabToNextCell)},M.prototype.getGridTabIndex=function(){return(this.gridOptions.tabIndex||0).toString()},M.prototype.isTreeData=function(){var h=Tr(this.gridOptions.treeData);return h?ni.assertRegistered(t.ModuleNames.RowGroupingModule,"Tree Data"):!1},M.prototype.isValueCache=function(){return Tr(this.gridOptions.valueCache)},M.prototype.isValueCacheNeverExpires=function(){return Tr(this.gridOptions.valueCacheNeverExpires)},M.prototype.isDeltaSort=function(){return Tr(this.gridOptions.deltaSort)},M.prototype.isAggregateOnlyChangedColumns=function(){return Tr(this.gridOptions.aggregateOnlyChangedColumns)},M.prototype.getProcessSecondaryColDefFunc=function(){return this.gridOptions.processSecondaryColDef},M.prototype.getProcessSecondaryColGroupDefFunc=function(){return this.gridOptions.processSecondaryColGroupDef},M.prototype.getSendToClipboardFunc=function(){return this.mergeGridCommonParams(this.gridOptions.sendToClipboard)},M.prototype.getProcessRowPostCreateFunc=function(){return this.mergeGridCommonParams(this.gridOptions.processRowPostCreate)},M.prototype.getProcessCellForClipboardFunc=function(){return this.mergeGridCommonParams(this.gridOptions.processCellForClipboard)},M.prototype.getProcessHeaderForClipboardFunc=function(){return this.mergeGridCommonParams(this.gridOptions.processHeaderForClipboard)},M.prototype.getProcessGroupHeaderForClipboardFunc=function(){return this.mergeGridCommonParams(this.gridOptions.processGroupHeaderForClipboard)},M.prototype.getProcessCellFromClipboardFunc=function(){return this.mergeGridCommonParams(this.gridOptions.processCellFromClipboard)},M.prototype.getViewportRowModelPageSize=function(){return tie(this.gridOptions.viewportRowModelPageSize,K0e)},M.prototype.getViewportRowModelBufferSize=function(){return eie(this.gridOptions.viewportRowModelBufferSize,Q8e)},M.prototype.isServerSideSortingAlwaysResets=function(){return Tr(this.gridOptions.serverSideSortingAlwaysResets)},M.prototype.isServerSideFilteringAlwaysResets=function(){return Tr(this.gridOptions.serverSideFilteringAlwaysResets)},M.prototype.getPostSortFunc=function(){var h=this.gridOptions,g=h.postSortRows,x=h.postSort;if(g)return this.mergeGridCommonParams(g);if(x)return function(P){return x(P.nodes)}},M.prototype.getChartToolbarItemsFunc=function(){return this.mergeGridCommonParams(this.gridOptions.getChartToolbarItems)},M.prototype.getChartThemeOverrides=function(){return this.gridOptions.chartThemeOverrides},M.prototype.getCustomChartThemes=function(){return this.gridOptions.customChartThemes},M.prototype.getChartThemes=function(){return this.gridOptions.chartThemes||["ag-default","ag-material","ag-pastel","ag-vivid","ag-solar"]},M.prototype.getClipboardDelimiter=function(){return i(this.gridOptions.clipboardDelimiter)?this.gridOptions.clipboardDelimiter:" "},M.prototype.setProperty=function(h,g,x){x===void 0&&(x=!1);var P=this.gridOptions,z=P[h];if(x||z!==g){P[h]=g;var ee={type:h,currentValue:g,previousValue:z};this.propertyEventService.dispatchEvent(ee)}},M.prototype.addEventListener=function(h,g){this.propertyEventService.addEventListener(h,g)},M.prototype.removeEventListener=function(h,g){this.propertyEventService.removeEventListener(h,g)},M.prototype.isSkipHeaderOnAutoSize=function(){return!!this.gridOptions.skipHeaderOnAutoSize},M.prototype.getAutoSizePadding=function(){var h=this.gridOptions.autoSizePadding;return h!=null&&h>=0?h:20},M.prototype.getHeaderHeight=function(){return typeof this.gridOptions.headerHeight=="number"?this.gridOptions.headerHeight:this.getFromTheme(25,"headerHeight")},M.prototype.getFloatingFiltersHeight=function(){return typeof this.gridOptions.floatingFiltersHeight=="number"?this.gridOptions.floatingFiltersHeight:this.getFromTheme(25,"headerHeight")},M.prototype.getGroupHeaderHeight=function(){return typeof this.gridOptions.groupHeaderHeight=="number"?this.gridOptions.groupHeaderHeight:this.getHeaderHeight()},M.prototype.getPivotHeaderHeight=function(){return typeof this.gridOptions.pivotHeaderHeight=="number"?this.gridOptions.pivotHeaderHeight:this.getHeaderHeight()},M.prototype.getPivotGroupHeaderHeight=function(){return typeof this.gridOptions.pivotGroupHeaderHeight=="number"?this.gridOptions.pivotGroupHeaderHeight:this.getGroupHeaderHeight()},M.prototype.isExternalFilterPresent=function(){return typeof this.gridOptions.isExternalFilterPresent=="function"?this.gridOptions.isExternalFilterPresent({api:this.getApi(),columnApi:this.getColumnApi(),context:this.getContext()}):!1},M.prototype.doesExternalFilterPass=function(h){return typeof this.gridOptions.doesExternalFilterPass=="function"?this.gridOptions.doesExternalFilterPass(h):!1},M.prototype.getTooltipDelay=function(h){var g=this.gridOptions,x=g.tooltipShowDelay,P=g.tooltipHideDelay,z=h==="show"?x:P,ee=wi(h);return i(z)?(z<0&&ze(function(){return console.warn("ag-grid: tooltip"+ee+"Delay should not be lower than 0")},"tooltip"+ee+"DelayWarn"),Math.max(200,z)):null},M.prototype.isTooltipMouseTrack=function(){return Tr(this.gridOptions.tooltipMouseTrack)},M.prototype.isSuppressModelUpdateAfterUpdateTransaction=function(){return Tr(this.gridOptions.suppressModelUpdateAfterUpdateTransaction)},M.prototype.getDocument=function(){var h=null;return this.gridOptions.getDocument&&i(this.gridOptions.getDocument)?h=this.gridOptions.getDocument():this.eGridDiv&&(h=this.eGridDiv.ownerDocument),h&&i(h)?h:document},M.prototype.getMinColWidth=function(){var h=this.gridOptions.minColWidth;if(i(h)&&h>f.MIN_COL_WIDTH)return this.gridOptions.minColWidth;var g=this.getFromTheme(null,"headerCellMinWidth");return i(g)?Math.max(g,f.MIN_COL_WIDTH):f.MIN_COL_WIDTH},M.prototype.getMaxColWidth=function(){return this.gridOptions.maxColWidth&&this.gridOptions.maxColWidth>f.MIN_COL_WIDTH?this.gridOptions.maxColWidth:null},M.prototype.getColWidth=function(){return typeof this.gridOptions.colWidth!="number"||this.gridOptions.colWidth=0,g=h?this.gridOptions.scrollbarWidth:hh();g!=null&&(this.scrollbarWidth=g,this.eventService.dispatchEvent({type:li.EVENT_SCROLLBAR_WIDTH_CHANGED}))}return this.scrollbarWidth},M.prototype.checkForDeprecated=function(){var h=this.gridOptions;h.deprecatedEmbedFullWidthRows&&console.warn("AG Grid: since v21.2, deprecatedEmbedFullWidthRows has been replaced with embedFullWidthRows."),h.rowDeselection&&console.warn("AG Grid: since v24.x, rowDeselection is deprecated and the behaviour is true by default. Please use `suppressRowDeselection` to prevent rows from being deselected."),h.enableMultiRowDragging&&(h.rowDragMultiRow=!0,delete h.enableMultiRowDragging,console.warn("AG Grid: since v26.1, `enableMultiRowDragging` is deprecated. Please use `rowDragMultiRow`."));var g=function(z,ee,Me){h[z]!=null&&(console.warn("AG Grid: since version "+Me+", '"+z+"' is deprecated / renamed, please use the new property name '"+ee+"' instead."),h[ee]==null&&(h[ee]=h[z]))};if(g("batchUpdateWaitMillis","asyncTransactionWaitMillis","23.1.x"),g("deltaRowDataMode","immutableData","23.1.x"),(h.immutableColumns||h.deltaColumnMode)&&console.warn("AG Grid: since v24.0, immutableColumns and deltaColumnMode properties are gone. The grid now works like this as default. To keep column order maintained, set grid property applyColumnDefOrder=true"),g("suppressSetColumnStateEvents","suppressColumnStateEvents","24.0.x"),h.groupRowInnerRenderer||h.groupRowInnerRendererParams||h.groupRowInnerRendererFramework){console.warn("AG Grid: since v24.0, grid properties groupRowInnerRenderer, groupRowInnerRendererFramework and groupRowInnerRendererParams are no longer used."),console.warn(" Instead use the grid properties groupRowRendererParams.innerRenderer, groupRowRendererParams.innerRendererFramework and groupRowRendererParams.innerRendererParams."),console.warn(" For example instead of this:"),console.warn(' groupRowInnerRenderer: "myRenderer"'),console.warn(" groupRowInnerRendererParams: {x: a}"),console.warn(" Replace with this:"),console.warn(" groupRowRendererParams: {"),console.warn(' innerRenderer: "myRenderer",'),console.warn(" innerRendererParams: {x: a}"),console.warn(" }"),console.warn(" We have copied the properties over for you. However to stop this error message, please change your application code."),h.groupRowRendererParams||(h.groupRowRendererParams={});var x=h.groupRowRendererParams;h.groupRowInnerRenderer&&(x.innerRenderer=h.groupRowInnerRenderer),h.groupRowInnerRendererParams&&(x.innerRendererParams=h.groupRowInnerRendererParams),h.groupRowInnerRendererFramework&&(x.innerRendererFramework=h.groupRowInnerRendererFramework)}if(h.rememberGroupStateWhenNewData&&console.warn("AG Grid: since v24.0, grid property rememberGroupStateWhenNewData is deprecated. This feature was provided before Transaction Updates worked (which keep group state). Now that transaction updates are possible and they keep group state, this feature is no longer needed."),h.detailCellRendererParams&&h.detailCellRendererParams.autoHeight&&(console.warn("AG Grid: since v24.1, grid property detailCellRendererParams.autoHeight is replaced with grid property detailRowAutoHeight. This allows this feature to work when you provide a custom DetailCellRenderer"),h.detailRowAutoHeight=!0),h.suppressKeyboardEvent&&console.warn(`AG Grid: since v24.1 suppressKeyboardEvent in the gridOptions has been deprecated and will be removed in - future versions of AG Grid. If you need this to be set for every column use the defaultColDef property.`),h.suppressEnterpriseResetOnNewColumns&&console.warn("AG Grid: since v25, grid property suppressEnterpriseResetOnNewColumns is deprecated. This was a temporary property to allow changing columns in Server Side Row Model without triggering a reload. Now that it is possible to dynamically change columns in the grid, this is no longer needed."),h.suppressColumnStateEvents&&console.warn('AG Grid: since v25, grid property suppressColumnStateEvents no longer works due to a refactor that we did. It should be possible to achieve similar using event.source, which would be "api" if the event was due to setting column state via the API'),h.defaultExportParams&&console.warn("AG Grid: since v25.2, the grid property `defaultExportParams` has been replaced by `defaultCsvExportParams` and `defaultExcelExportParams`."),h.stopEditingWhenGridLosesFocus&&(console.warn("AG Grid: since v25.2.2, the grid property `stopEditingWhenGridLosesFocus` has been replaced by `stopEditingWhenCellsLoseFocus`."),h.stopEditingWhenCellsLoseFocus=!0),h.applyColumnDefOrder&&console.warn("AG Grid: since v26.0, the grid property `applyColumnDefOrder` is no longer needed, as this is the default behaviour. To turn this behaviour off, set maintainColumnOrder=true"),h.groupMultiAutoColumn&&(console.warn("AG Grid: since v26.0, the grid property `groupMultiAutoColumn` has been replaced by `groupDisplayType = 'multipleColumns'`"),h.groupDisplayType="multipleColumns"),h.groupUseEntireRow&&(console.warn("AG Grid: since v26.0, the grid property `groupUseEntireRow` has been replaced by `groupDisplayType = 'groupRows'`"),h.groupDisplayType="groupRows"),h.groupSuppressAutoColumn){var P=h.treeData?"treeDataDisplayType":"groupDisplayType";console.warn("AG Grid: since v26.0, the grid property `groupSuppressAutoColumn` has been replaced by `"+P+" = 'custom'`"),h.groupDisplayType="custom"}h.defaultGroupOrderComparator&&console.warn("AG Grid: since v27.2, the grid property `defaultGroupOrderComparator` is deprecated and has been replaced by `initialGroupOrderComparator` and now receives a single params object."),h.defaultGroupSortComparator&&(console.warn("AG Grid: since v26.0, the grid property `defaultGroupSortComparator` has been replaced by `initialGroupOrderComparator`"),h.defaultGroupOrderComparator=h.defaultGroupSortComparator),h.groupRowAggNodes&&console.warn("AG Grid: since v27.2, the grid property `groupRowAggNodes` is deprecated and has been replaced by `getGroupRowAgg` and now receives a single params object."),h.postSort&&console.warn("AG Grid: since v27.2, the grid property `postSort` is deprecated and has been replaced by `postSortRows` and now receives a single params object."),h.isFullWidthCell&&console.warn("AG Grid: since v27.2, the grid property `isFullWidthCell` is deprecated and has been replaced by `isFullWidthRow` and now receives a single params object."),h.localeTextFunc&&console.warn("AG Grid: since v27.2, the grid property `localeTextFunc` is deprecated and has been replaced by `getLocaleText` and now receives a single params object."),h.colWidth&&console.warn("AG Grid: since v26.1, the grid property `colWidth` is deprecated and should be set via `defaultColDef.width`."),h.minColWidth&&console.warn("AG Grid: since v26.1, the grid property `minColWidth` is deprecated and should be set via `defaultColDef.minWidth`."),h.maxColWidth&&console.warn("AG Grid: since v26.1, the grid property `maxColWidth` is deprecated and should be set via `defaultColDef.maxWidth`."),h.reactUi&&console.warn("AG Grid: since v27.0, React UI is on by default, so no need for reactUi=true. To turn it off, set suppressReactUi=true."),h.suppressReactUi&&console.warn("AG Grid: The legacy React rendering engine is deprecated and will be removed in the next major version of the grid."),h.suppressCellSelection&&(console.warn("AG Grid: since v27.0, `suppressCellSelection` has been replaced by `suppressCellFocus`."),h.suppressCellFocus=h.suppressCellSelection),h.getRowNodeId&&console.warn("AG Grid: since v27.1, `getRowNodeId` is deprecated and has been replaced by `getRowId`. The difference: if getRowId() is implemented then immutable data is enabled by default."),h.immutableData&&(h.getRowId?console.warn("AG Grid: since v27.1, `immutableData` is deprecated. With the `getRowId` callback implemented, immutable data is enabled by default so you can remove `immutableData=true`."):console.warn("AG Grid: since v27.1, `immutableData` is deprecated. To enable immutable data you must implement the `getRowId()` callback.")),h.clipboardDeliminator&&(console.warn("AG Grid: since v27.1, `clipboardDeliminator` has been replaced by `clipboardDelimiter`."),h.clipboardDelimiter=h.clipboardDeliminator)},M.prototype.checkForViolations=function(){this.isTreeData()&&this.treeDataViolations()},M.prototype.treeDataViolations=function(){this.isRowModelDefault()&&r(this.getDataPathFunc())&&console.warn("AG Grid: property usingTreeData=true with rowModel=clientSide, but you did not provide getDataPath function, please provide getDataPath function if using tree data."),this.isRowModelServerSide()&&(r(this.getIsServerSideGroupFunc())&&console.warn("AG Grid: property usingTreeData=true with rowModel=serverSide, but you did not provide isServerSideGroup function, please provide isServerSideGroup function if using tree data."),r(this.getServerSideGroupKeyFunc())&&console.warn("AG Grid: property usingTreeData=true with rowModel=serverSide, but you did not provide getServerSideGroupKey function, please provide getServerSideGroupKey function if using tree data."))},M.prototype.getLocaleTextFunc=function(){var h=this,g=this.gridOptions,x=g.localeText,P=g.getLocaleText,z=g.localeTextFunc;return P?function(ee,Me,je){var ut={key:ee,defaultValue:Me,variableValues:je,api:h.getApi(),columnApi:h.getColumnApi(),context:h.getContext()};return P(ut)}:z||function(ee,Me,je){var ut=x&&x[ee];if(ut&&je&&je.length)for(var Rt=0;!(Rt>=je.length);){var Zt=ut.indexOf("${variable}");if(Zt===-1)break;ut=ut.replace("${variable}",je[Rt++])}return ut??Me}},M.prototype.globalEventHandler=function(h,g){if(!this.destroyed){var x=_i.getCallbackForEvent(h);typeof this.gridOptions[x]=="function"&&this.gridOptions[x](g)}},M.prototype.setRowHeightVariable=function(h){var g=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),x=h+"px";g!=x&&this.eGridDiv.style.setProperty("--ag-line-height",x)},M.prototype.getRowHeightAsNumber=function(){if(!this.gridOptions.rowHeight||r(this.gridOptions.rowHeight))return this.getDefaultRowHeight();var h=this.gridOptions.rowHeight;return h&&this.isNumeric(h)?(this.setRowHeightVariable(h),h):(console.warn("AG Grid row height must be a number if not using standard row model"),this.getDefaultRowHeight())},M.prototype.isGetRowHeightFunction=function(){return typeof this.gridOptions.getRowHeight=="function"},M.prototype.getRowHeightForNode=function(h,g,x){if(g===void 0&&(g=!1),x==null&&(x=this.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(g)return{height:x,estimated:!0};var P={node:h,data:h.data},z=this.mergeGridCommonParams(this.gridOptions.getRowHeight)(P);if(this.isNumeric(z))return z===0&&ze(function(){return console.warn("AG Grid: The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead.")},"invalidRowHeight"),{height:Math.max(1,z),estimated:!1}}if(h.detail&&this.isMasterDetail())return this.isDetailRowAutoHeight()?{height:1,estimated:!1}:this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:X0e,estimated:!1};var ee=this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:x;return{height:ee,estimated:!1}},M.prototype.isDynamicRowHeight=function(){return typeof this.gridOptions.getRowHeight=="function"},M.prototype.getListItemHeight=function(){return this.getFromTheme(20,"listItemHeight")},M.prototype.chartMenuPanelWidth=function(){return this.environment.chartMenuPanelWidth()},M.prototype.isNumeric=function(h){return!isNaN(h)&&typeof h=="number"&&isFinite(h)},M.prototype.getFromTheme=function(h,g){var x=this.environment.getTheme().theme;return x&&x.indexOf("ag-theme")===0?this.environment.getSassVariable(x,g):h},M.prototype.getDefaultRowHeight=function(){return this.getFromTheme(Y0e,"rowHeight")},M.prototype.matchesGroupDisplayType=function(h,g){var x=["groupRows","multipleColumns","custom","singleColumn"];return x.indexOf(g)<0?(console.warn("AG Grid: '"+g+"' is not a valid groupDisplayType value - possible values are: '"+x.join("', '")+"'"),!1):g===h},M.prototype.matchesTreeDataDisplayType=function(h,g){var x=["auto","custom"];return x.indexOf(g)<0?(console.warn("AG Grid: '"+g+"' is not a valid treeDataDisplayType value - possible values are: '"+x.join("', '")+"'"),!1):g===h};var f;return M.MIN_COL_WIDTH=10,M.PROP_HEADER_HEIGHT="headerHeight",M.PROP_GROUP_REMOVE_SINGLE_CHILDREN="groupRemoveSingleChildren",M.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN="groupRemoveLowestSingleChildren",M.PROP_PIVOT_HEADER_HEIGHT="pivotHeaderHeight",M.PROP_SUPPRESS_CLIPBOARD_PASTE="suppressClipboardPaste",M.PROP_GROUP_HEADER_HEIGHT="groupHeaderHeight",M.PROP_PIVOT_GROUP_HEADER_HEIGHT="pivotGroupHeaderHeight",M.PROP_NAVIGATE_TO_NEXT_CELL="navigateToNextCell",M.PROP_TAB_TO_NEXT_CELL="tabToNextCell",M.PROP_NAVIGATE_TO_NEXT_HEADER="navigateToNextHeader",M.PROP_TAB_TO_NEXT_HEADER="tabToNextHeader",M.PROP_IS_EXTERNAL_FILTER_PRESENT="isExternalFilterPresent",M.PROP_DOES_EXTERNAL_FILTER_PASS="doesExternalFilterPass",M.PROP_FLOATING_FILTERS_HEIGHT="floatingFiltersHeight",M.PROP_SUPPRESS_ROW_CLICK_SELECTION="suppressRowClickSelection",M.PROP_SUPPRESS_ROW_DRAG="suppressRowDrag",M.PROP_SUPPRESS_MOVE_WHEN_ROW_DRAG="suppressMoveWhenRowDragging",M.PROP_GET_ROW_CLASS="getRowClass",M.PROP_GET_ROW_STYLE="getRowStyle",M.PROP_GET_ROW_HEIGHT="getRowHeight",M.PROP_POPUP_PARENT="popupParent",M.PROP_DOM_LAYOUT="domLayout",M.PROP_ROW_CLASS="rowClass",M.PROP_FILL_HANDLE_DIRECTION="fillHandleDirection",M.PROP_GROUP_ROW_AGG_NODES="groupRowAggNodes",M.PROP_GET_GROUP_ROW_AGG="getGroupRowAgg",M.PROP_GET_BUSINESS_KEY_FOR_NODE="getBusinessKeyForNode",M.PROP_GET_CHILD_COUNT="getChildCount",M.PROP_PROCESS_ROW_POST_CREATE="processRowPostCreate",M.PROP_GET_ROW_NODE_ID="getRowNodeId",M.PROP_GET_ROW_ID="getRowId",M.PROP_IS_FULL_WIDTH_CELL="isFullWidthCell",M.PROP_IS_FULL_WIDTH_ROW="isFullWidthRow",M.PROP_IS_ROW_SELECTABLE="isRowSelectable",M.PROP_IS_ROW_MASTER="isRowMaster",M.PROP_POST_SORT="postSort",M.PROP_POST_SORT_ROWS="postSortRows",M.PROP_GET_DOCUMENT="getDocument",M.PROP_POST_PROCESS_POPUP="postProcessPopup",M.PROP_DEFAULT_GROUP_ORDER_COMPARATOR="defaultGroupOrderComparator",M.PROP_INITIAL_GROUP_ORDER_COMPARATOR="initialGroupOrderComparator",M.PROP_PAGINATION_NUMBER_FORMATTER="paginationNumberFormatter",M.PROP_GET_CONTEXT_MENU_ITEMS="getContextMenuItems",M.PROP_GET_MAIN_MENU_ITEMS="getMainMenuItems",M.PROP_PROCESS_CELL_FOR_CLIPBOARD="processCellForClipboard",M.PROP_PROCESS_CELL_FROM_CLIPBOARD="processCellFromClipboard",M.PROP_SEND_TO_CLIPBOARD="sendToClipboard",M.PROP_PROCESS_TO_SECONDARY_COLDEF="processSecondaryColDef",M.PROP_PROCESS_SECONDARY_COL_GROUP_DEF="processSecondaryColGroupDef",M.PROP_GET_CHART_TOOLBAR_ITEMS="getChartToolbarItems",M.PROP_GET_SERVER_SIDE_STORE_PARAMS="getServerSideStoreParams",M.PROP_IS_SERVER_SIDE_GROUPS_OPEN_BY_DEFAULT="isServerSideGroupOpenByDefault",M.PROP_IS_APPLY_SERVER_SIDE_TRANSACTION="isApplyServerSideTransaction",M.PROP_IS_SERVER_SIDE_GROUP="isServerSideGroup",M.PROP_GET_SERVER_SIDE_GROUP_KEY="getServerSideGroupKey",b1([ce("gridOptions")],M.prototype,"gridOptions",void 0),b1([ce("eventService")],M.prototype,"eventService",void 0),b1([ce("environment")],M.prototype,"environment",void 0),b1([ce("eGridDiv")],M.prototype,"eGridDiv",void 0),b1([Qte(0,yt("gridApi")),Qte(1,yt("columnApi"))],M.prototype,"agWire",null),b1([pt],M.prototype,"destroy",null),b1([it],M.prototype,"init",null),M=f=b1([Le("gridOptionsWrapper")],M),M}();/** + */var S1=function(){return S1=Object.assign||function(M){for(var f,d=1,g=arguments.length;d=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Zte=function(M,f){return function(d,g){f(d,g,M)}},K0e=function(M,f){var d=typeof Symbol=="function"&&M[Symbol.iterator];if(!d)return M;var g=d.call(M),S,O=[],z;try{for(;(f===void 0||f-- >0)&&!(S=g.next()).done;)O.push(S.value)}catch(te){z={error:te}}finally{try{S&&!S.done&&(d=g.return)&&d.call(g)}finally{if(z)throw z.error}}return O},vz=function(){for(var M=[],f=0;f=0?M:f}function eie(M,f){var d=parseInt(M,10);return Pu(d)&&d>0?d:f}var Zn=function(){function M(){this.propertyEventService=new nt,this.domDataKey="__AG_"+Math.random().toString(),this.destroyed=!1}f=M,M.prototype.agWire=function(d,g){this.gridOptions.api=d,this.gridOptions.columnApi=g,this.checkForDeprecated(),this.checkForViolations()},M.prototype.destroy=function(){this.gridOptions.api=null,this.gridOptions.columnApi=null,this.destroyed=!0},M.prototype.init=function(){var d=this;this.gridOptions.suppressPropertyNamesCheck!==!0&&(this.checkGridOptionsProperties(),this.checkColumnDefProperties()),this.gridOptions.sideBar!=null&&(this.gridOptions.sideBar=K$.parse(this.gridOptions.sideBar));var g=this.useAsyncEvents();if(this.eventService.addGlobalListener(this.globalEventHandler.bind(this),g),this.isGroupSelectsChildren()&&this.isSuppressParentsInRowNodes()&&console.warn("AG Grid: 'groupSelectsChildren' does not work with 'suppressParentsInRowNodes', this selection method needs the part in rowNode to work"),this.isGroupSelectsChildren()&&(this.isRowSelectionMulti()||console.warn("AG Grid: rowSelection must be 'multiple' for groupSelectsChildren to make sense"),this.isRowModelServerSide()&&console.warn("AG Grid: group selects children is NOT support for Server Side Row Model. This is because the rows are lazy loaded, so selecting a group is not possible asthe grid has no way of knowing what the children are.")),this.isGroupRemoveSingleChildren()&&this.isGroupHideOpenParents()&&console.warn("AG Grid: groupRemoveSingleChildren and groupHideOpenParents do not work with each other, you need to pick one. And don't ask us how to us these together on our support forum either you will get the same answer!"),this.isRowModelServerSide()){var S=function(z){return"AG Grid: '"+z+"' is not supported on the Server-Side Row Model"};i(this.gridOptions.groupDefaultExpanded)&&console.warn(S("groupDefaultExpanded")),i(this.gridOptions.groupDefaultExpanded)&&console.warn(S("groupIncludeFooter")),i(this.gridOptions.groupDefaultExpanded)&&console.warn(S("groupIncludeTotalFooter"))}this.isEnableRangeSelection()&&Xt.assertRegistered(t.ModuleNames.RangeSelectionModule,"enableRangeSelection"),!this.isEnableRangeSelection()&&(this.isEnableRangeHandle()||this.isEnableFillHandle())&&console.warn("AG Grid: 'enableRangeHandle' and 'enableFillHandle' will not work unless 'enableRangeSelection' is set to true");var O=function(z){d.gridOptions.icons&&d.gridOptions.icons[z]&&console.warn("gridOptions.icons."+z+" is no longer supported. For information on how to style checkboxes and radio buttons, see https://www.ag-grid.com/javascript-grid-icons/")};O("radioButtonOff"),O("radioButtonOn"),O("checkboxChecked"),O("checkboxUnchecked"),O("checkboxIndeterminate"),this.getScrollbarWidth()},M.prototype.checkColumnDefProperties=function(){var d=this;this.gridOptions.columnDefs!=null&&this.gridOptions.columnDefs.forEach(function(g){var S=Object.getOwnPropertyNames(g),O=vz(Ir.ALL_PROPERTIES,Ir.FRAMEWORK_PROPERTIES);d.checkProperties(S,O,O,"colDef","https://www.ag-grid.com/javascript-grid-column-properties/")})},M.prototype.checkGridOptionsProperties=function(){var d=Object.getOwnPropertyNames(this.gridOptions),g=vz(Di.ALL_PROPERTIES,Di.FRAMEWORK_PROPERTIES,y(ui).map(function(O){return mi.getCallbackForEvent(O)})),S=vz(g,["api","columnApi"]);this.checkProperties(d,S,g,"gridOptions","https://www.ag-grid.com/javascript-data-grid/grid-options/")},M.prototype.checkProperties=function(d,g,S,O,z){var te=cl(d,g,S);I(te,function(Fe,Ue){console.warn("ag-grid: invalid "+O+" property '"+Fe+"' did you mean any of these: "+Ue.slice(0,8).join(", "))}),Object.keys(te).length>0&&console.warn("ag-grid: to see all the valid "+O+" properties please check: "+z)},M.prototype.mergeGridCommonParams=function(d){var g=this;if(d){var S=function(O){var z=S1(S1({},O),{api:g.getApi(),columnApi:g.getColumnApi(),context:g.getContext()});return d(z)};return S}return d},M.prototype.getDomDataKey=function(){return this.domDataKey},M.prototype.getDomData=function(d,g){var S=d[this.getDomDataKey()];return S?S[g]:void 0},M.prototype.setDomData=function(d,g,S){var O=this.getDomDataKey(),z=d[O];r(z)&&(z={},d[O]=z),z[g]=S},M.prototype.isRowSelection=function(){return this.gridOptions.rowSelection==="single"||this.gridOptions.rowSelection==="multiple"},M.prototype.isSuppressRowDeselection=function(){return Lr(this.gridOptions.suppressRowDeselection)},M.prototype.isRowSelectionMulti=function(){return this.gridOptions.rowSelection==="multiple"},M.prototype.isRowMultiSelectWithClick=function(){return Lr(this.gridOptions.rowMultiSelectWithClick)},M.prototype.getContext=function(){return this.gridOptions.context},M.prototype.isPivotMode=function(){return Lr(this.gridOptions.pivotMode)},M.prototype.isSuppressExpandablePivotGroups=function(){return Lr(this.gridOptions.suppressExpandablePivotGroups)},M.prototype.getPivotColumnGroupTotals=function(){return this.gridOptions.pivotColumnGroupTotals},M.prototype.getPivotRowTotals=function(){return this.gridOptions.pivotRowTotals},M.prototype.isRowModelInfinite=function(){return this.gridOptions.rowModelType===$e.ROW_MODEL_TYPE_INFINITE},M.prototype.isRowModelViewport=function(){return this.gridOptions.rowModelType===$e.ROW_MODEL_TYPE_VIEWPORT},M.prototype.isRowModelServerSide=function(){return this.gridOptions.rowModelType===$e.ROW_MODEL_TYPE_SERVER_SIDE},M.prototype.isRowModelDefault=function(){return r(this.gridOptions.rowModelType)||this.gridOptions.rowModelType===$e.ROW_MODEL_TYPE_CLIENT_SIDE},M.prototype.isFullRowEdit=function(){return this.gridOptions.editType==="fullRow"},M.prototype.isSuppressFocusAfterRefresh=function(){return Lr(this.gridOptions.suppressFocusAfterRefresh)},M.prototype.isSuppressBrowserResizeObserver=function(){return Lr(this.gridOptions.suppressBrowserResizeObserver)},M.prototype.isSuppressMaintainUnsortedOrder=function(){return Lr(this.gridOptions.suppressMaintainUnsortedOrder)},M.prototype.isSuppressClearOnFillReduction=function(){return Lr(this.gridOptions.suppressClearOnFillReduction)},M.prototype.isShowToolPanel=function(){return Lr(this.gridOptions.sideBar&&Array.isArray(this.getSideBar().toolPanels))},M.prototype.getSideBar=function(){return this.gridOptions.sideBar},M.prototype.isSuppressTouch=function(){return Lr(this.gridOptions.suppressTouch)},M.prototype.isMaintainColumnOrder=function(){return Lr(this.gridOptions.maintainColumnOrder)},M.prototype.isSuppressRowTransform=function(){return Lr(this.gridOptions.suppressRowTransform)},M.prototype.isSuppressColumnStateEvents=function(){return Lr(this.gridOptions.suppressColumnStateEvents)},M.prototype.isAllowDragFromColumnsToolPanel=function(){return Lr(this.gridOptions.allowDragFromColumnsToolPanel)},M.prototype.useAsyncEvents=function(){return!Lr(this.gridOptions.suppressAsyncEvents)},M.prototype.isEnableCellChangeFlash=function(){return Lr(this.gridOptions.enableCellChangeFlash)},M.prototype.getCellFlashDelay=function(){return this.gridOptions.cellFlashDelay||500},M.prototype.getCellFadeDelay=function(){return this.gridOptions.cellFadeDelay||1e3},M.prototype.isGroupSelectsChildren=function(){return Lr(this.gridOptions.groupSelectsChildren)},M.prototype.isSuppressRowHoverHighlight=function(){return Lr(this.gridOptions.suppressRowHoverHighlight)},M.prototype.isColumnHoverHighlight=function(){return Lr(this.gridOptions.columnHoverHighlight)},M.prototype.isGroupSelectsFiltered=function(){return Lr(this.gridOptions.groupSelectsFiltered)},M.prototype.isGroupHideOpenParents=function(){return Lr(this.gridOptions.groupHideOpenParents)},M.prototype.isGroupMaintainOrder=function(){return Lr(this.gridOptions.groupMaintainOrder)},M.prototype.getAutoGroupColumnDef=function(){return this.gridOptions.autoGroupColumnDef},M.prototype.isGroupMultiAutoColumn=function(){return this.gridOptions.groupDisplayType?this.matchesGroupDisplayType("multipleColumns",this.gridOptions.groupDisplayType):Lr(this.gridOptions.groupHideOpenParents)},M.prototype.isGroupUseEntireRow=function(d){return d?!1:this.gridOptions.groupDisplayType?this.matchesGroupDisplayType("groupRows",this.gridOptions.groupDisplayType):!1},M.prototype.isGroupSuppressAutoColumn=function(){var d=this.gridOptions.groupDisplayType?this.matchesGroupDisplayType("custom",this.gridOptions.groupDisplayType):!1;return d?!0:this.gridOptions.treeDataDisplayType?this.matchesTreeDataDisplayType("custom",this.gridOptions.treeDataDisplayType):!1},M.prototype.isGroupRemoveSingleChildren=function(){return Lr(this.gridOptions.groupRemoveSingleChildren)},M.prototype.isGroupRemoveLowestSingleChildren=function(){return Lr(this.gridOptions.groupRemoveLowestSingleChildren)},M.prototype.isGroupIncludeFooter=function(){return Lr(this.gridOptions.groupIncludeFooter)},M.prototype.isGroupIncludeTotalFooter=function(){return Lr(this.gridOptions.groupIncludeTotalFooter)},M.prototype.isGroupSuppressBlankHeader=function(){return Lr(this.gridOptions.groupSuppressBlankHeader)},M.prototype.isSuppressRowClickSelection=function(){return Lr(this.gridOptions.suppressRowClickSelection)},M.prototype.isSuppressCellFocus=function(){return Lr(this.gridOptions.suppressCellFocus)},M.prototype.isSuppressMultiSort=function(){return Lr(this.gridOptions.suppressMultiSort)},M.prototype.isAlwaysMultiSort=function(){return Lr(this.gridOptions.alwaysMultiSort)},M.prototype.isMultiSortKeyCtrl=function(){return this.gridOptions.multiSortKey==="ctrl"},M.prototype.isPivotSuppressAutoColumn=function(){return Lr(this.gridOptions.pivotSuppressAutoColumn)},M.prototype.isSuppressDragLeaveHidesColumns=function(){return Lr(this.gridOptions.suppressDragLeaveHidesColumns)},M.prototype.isSuppressScrollOnNewData=function(){return Lr(this.gridOptions.suppressScrollOnNewData)},M.prototype.isSuppressScrollWhenPopupsAreOpen=function(){return Lr(this.gridOptions.suppressScrollWhenPopupsAreOpen)},M.prototype.isRowDragEntireRow=function(){return Lr(this.gridOptions.rowDragEntireRow)},M.prototype.isSuppressRowDrag=function(){return Lr(this.gridOptions.suppressRowDrag)},M.prototype.isRowDragManaged=function(){return Lr(this.gridOptions.rowDragManaged)},M.prototype.isSuppressMoveWhenRowDragging=function(){return Lr(this.gridOptions.suppressMoveWhenRowDragging)},M.prototype.isRowDragMultiRow=function(){return Lr(this.gridOptions.rowDragMultiRow)},M.prototype.getDomLayout=function(){var d=this.gridOptions.domLayout||$e.DOM_LAYOUT_NORMAL,g=[$e.DOM_LAYOUT_PRINT,$e.DOM_LAYOUT_AUTO_HEIGHT,$e.DOM_LAYOUT_NORMAL];return g.indexOf(d)===-1?(Ge(function(){return console.warn("AG Grid: "+d+" is not valid for DOM Layout, valid values are "+$e.DOM_LAYOUT_NORMAL+", "+$e.DOM_LAYOUT_AUTO_HEIGHT+" and "+$e.DOM_LAYOUT_PRINT)},"warn about dom layout values"),$e.DOM_LAYOUT_NORMAL):d},M.prototype.isSuppressHorizontalScroll=function(){return Lr(this.gridOptions.suppressHorizontalScroll)},M.prototype.isSuppressMaxRenderedRowRestriction=function(){return Lr(this.gridOptions.suppressMaxRenderedRowRestriction)},M.prototype.isExcludeChildrenWhenTreeDataFiltering=function(){return Lr(this.gridOptions.excludeChildrenWhenTreeDataFiltering)},M.prototype.isAlwaysShowHorizontalScroll=function(){return Lr(this.gridOptions.alwaysShowHorizontalScroll)},M.prototype.isAlwaysShowVerticalScroll=function(){return Lr(this.gridOptions.alwaysShowVerticalScroll)},M.prototype.isDebounceVerticalScrollbar=function(){return Lr(this.gridOptions.debounceVerticalScrollbar)},M.prototype.isSuppressLoadingOverlay=function(){return Lr(this.gridOptions.suppressLoadingOverlay)},M.prototype.isSuppressNoRowsOverlay=function(){return Lr(this.gridOptions.suppressNoRowsOverlay)},M.prototype.isSuppressFieldDotNotation=function(){return Lr(this.gridOptions.suppressFieldDotNotation)},M.prototype.getPinnedTopRowData=function(){return this.gridOptions.pinnedTopRowData},M.prototype.getPinnedBottomRowData=function(){return this.gridOptions.pinnedBottomRowData},M.prototype.isFunctionsPassive=function(){return Lr(this.gridOptions.functionsPassive)},M.prototype.isSuppressChangeDetection=function(){return Lr(this.gridOptions.suppressChangeDetection)},M.prototype.isSuppressAnimationFrame=function(){return Lr(this.gridOptions.suppressAnimationFrame)},M.prototype.getQuickFilterText=function(){return this.gridOptions.quickFilterText},M.prototype.isCacheQuickFilter=function(){return Lr(this.gridOptions.cacheQuickFilter)},M.prototype.isUnSortIcon=function(){return Lr(this.gridOptions.unSortIcon)},M.prototype.isSuppressMenuHide=function(){return Lr(this.gridOptions.suppressMenuHide)},M.prototype.isEnterMovesDownAfterEdit=function(){return Lr(this.gridOptions.enterMovesDownAfterEdit)},M.prototype.isEnterMovesDown=function(){return Lr(this.gridOptions.enterMovesDown)},M.prototype.isUndoRedoCellEditing=function(){return Lr(this.gridOptions.undoRedoCellEditing)},M.prototype.getUndoRedoCellEditingLimit=function(){return Z$(this.gridOptions.undoRedoCellEditingLimit)},M.prototype.getRowStyle=function(){return this.gridOptions.rowStyle},M.prototype.getRowClass=function(){return this.gridOptions.rowClass},M.prototype.getRowStyleFunc=function(){return this.mergeGridCommonParams(this.gridOptions.getRowStyle)},M.prototype.getRowClassFunc=function(){return this.mergeGridCommonParams(this.gridOptions.getRowClass)},M.prototype.rowClassRules=function(){return this.gridOptions.rowClassRules},M.prototype.getServerSideStoreType=function(){return this.gridOptions.serverSideStoreType},M.prototype.getServerSideStoreParamsFunc=function(){return this.mergeGridCommonParams(this.gridOptions.getServerSideStoreParams)},M.prototype.getCreateChartContainerFunc=function(){return this.mergeGridCommonParams(this.gridOptions.createChartContainer)},M.prototype.getPopupParent=function(){return this.gridOptions.popupParent},M.prototype.getBlockLoadDebounceMillis=function(){return this.gridOptions.blockLoadDebounceMillis},M.prototype.getPostProcessPopupFunc=function(){return this.mergeGridCommonParams(this.gridOptions.postProcessPopup)},M.prototype.getPaginationNumberFormatterFunc=function(){return this.mergeGridCommonParams(this.gridOptions.paginationNumberFormatter)},M.prototype.getChildCountFunc=function(){return this.gridOptions.getChildCount},M.prototype.getIsApplyServerSideTransactionFunc=function(){return this.mergeGridCommonParams(this.gridOptions.isApplyServerSideTransaction)},M.prototype.getInitialGroupOrderComparator=function(){var d=this.gridOptions,g=d.initialGroupOrderComparator,S=d.defaultGroupOrderComparator;if(g)return this.mergeGridCommonParams(g);if(S)return function(O){return S(O.nodeA,O.nodeB)}},M.prototype.getIsFullWidthCellFunc=function(){var d=this.gridOptions,g=d.isFullWidthRow,S=d.isFullWidthCell;if(g)return this.mergeGridCommonParams(g);if(S)return function(O){return S(O.rowNode)}},M.prototype.getFullWidthCellRendererParams=function(){return this.gridOptions.fullWidthCellRendererParams},M.prototype.isEmbedFullWidthRows=function(){return Lr(this.gridOptions.embedFullWidthRows)||Lr(this.gridOptions.deprecatedEmbedFullWidthRows)},M.prototype.isDetailRowAutoHeight=function(){return Lr(this.gridOptions.detailRowAutoHeight)},M.prototype.getSuppressKeyboardEventFunc=function(){return this.gridOptions.suppressKeyboardEvent},M.prototype.getBusinessKeyForNodeFunc=function(){return this.gridOptions.getBusinessKeyForNode},M.prototype.getApi=function(){return this.gridOptions.api},M.prototype.getColumnApi=function(){return this.gridOptions.columnApi},M.prototype.isReadOnlyEdit=function(){return Lr(this.gridOptions.readOnlyEdit)},M.prototype.isImmutableData=function(){var d=this.gridOptions.getRowId!=null,g=Lr(this.gridOptions.immutableData),S=Lr(this.gridOptions.resetRowDataOnUpdate);return S?!1:d||g},M.prototype.isEnsureDomOrder=function(){return Lr(this.gridOptions.ensureDomOrder)},M.prototype.isEnableCharts=function(){return Lr(this.gridOptions.enableCharts)?Xt.assertRegistered(t.ModuleNames.GridChartsModule,"enableCharts"):!1},M.prototype.getColResizeDefault=function(){return this.gridOptions.colResizeDefault},M.prototype.isSingleClickEdit=function(){return Lr(this.gridOptions.singleClickEdit)},M.prototype.isSuppressClickEdit=function(){return Lr(this.gridOptions.suppressClickEdit)},M.prototype.isStopEditingWhenCellsLoseFocus=function(){return Lr(this.gridOptions.stopEditingWhenCellsLoseFocus)},M.prototype.getGroupDefaultExpanded=function(){return this.gridOptions.groupDefaultExpanded},M.prototype.getMaxConcurrentDatasourceRequests=function(){var d=Z$(this.gridOptions.maxConcurrentDatasourceRequests);if(d==null)return 2;if(!(d<=0))return d},M.prototype.getMaxBlocksInCache=function(){return this.gridOptions.maxBlocksInCache},M.prototype.getCacheOverflowSize=function(){return this.gridOptions.cacheOverflowSize},M.prototype.getPaginationPageSize=function(){return Z$(this.gridOptions.paginationPageSize)},M.prototype.isPaginateChildRows=function(){var d=this.isGroupRemoveSingleChildren()||this.isGroupRemoveLowestSingleChildren();return d?!0:Lr(this.gridOptions.paginateChildRows)},M.prototype.getCacheBlockSize=function(){return eie(this.gridOptions.cacheBlockSize)},M.prototype.getInfiniteInitialRowCount=function(){return this.gridOptions.infiniteInitialRowCount},M.prototype.isPurgeClosedRowNodes=function(){return Lr(this.gridOptions.purgeClosedRowNodes)},M.prototype.isSuppressPaginationPanel=function(){return Lr(this.gridOptions.suppressPaginationPanel)},M.prototype.getRowData=function(){return this.gridOptions.rowData},M.prototype.isEnableRtl=function(){return Lr(this.gridOptions.enableRtl)},M.prototype.getRowGroupPanelShow=function(){return this.gridOptions.rowGroupPanelShow},M.prototype.getPivotPanelShow=function(){return this.gridOptions.pivotPanelShow},M.prototype.isAngularCompileRows=function(){return Lr(this.gridOptions.angularCompileRows)},M.prototype.isAngularCompileFilters=function(){return Lr(this.gridOptions.angularCompileFilters)},M.prototype.isDebug=function(){return Lr(this.gridOptions.debug)},M.prototype.getColumnDefs=function(){return this.gridOptions.columnDefs},M.prototype.getColumnTypes=function(){return this.gridOptions.columnTypes},M.prototype.getDatasource=function(){return this.gridOptions.datasource},M.prototype.getViewportDatasource=function(){return this.gridOptions.viewportDatasource},M.prototype.getServerSideDatasource=function(){return this.gridOptions.serverSideDatasource},M.prototype.isAccentedSort=function(){return Lr(this.gridOptions.accentedSort)},M.prototype.isEnableBrowserTooltips=function(){return Lr(this.gridOptions.enableBrowserTooltips)},M.prototype.isEnableCellExpressions=function(){return Lr(this.gridOptions.enableCellExpressions)},M.prototype.isEnableGroupEdit=function(){return Lr(this.gridOptions.enableGroupEdit)},M.prototype.isSuppressMiddleClickScrolls=function(){return Lr(this.gridOptions.suppressMiddleClickScrolls)},M.prototype.isPreventDefaultOnContextMenu=function(){return Lr(this.gridOptions.preventDefaultOnContextMenu)},M.prototype.isSuppressPreventDefaultOnMouseWheel=function(){return Lr(this.gridOptions.suppressPreventDefaultOnMouseWheel)},M.prototype.isSuppressColumnVirtualisation=function(){return Lr(this.gridOptions.suppressColumnVirtualisation)},M.prototype.isSuppressRowVirtualisation=function(){return Lr(this.gridOptions.suppressRowVirtualisation)},M.prototype.isSuppressContextMenu=function(){return Lr(this.gridOptions.suppressContextMenu)},M.prototype.isAllowContextMenuWithControlKey=function(){return Lr(this.gridOptions.allowContextMenuWithControlKey)},M.prototype.isSuppressCopyRowsToClipboard=function(){return Lr(this.gridOptions.suppressCopyRowsToClipboard)},M.prototype.isSuppressCopySingleCellRanges=function(){return Lr(this.gridOptions.suppressCopySingleCellRanges)},M.prototype.isCopyHeadersToClipboard=function(){return Lr(this.gridOptions.copyHeadersToClipboard)},M.prototype.isCopyGroupHeadersToClipboard=function(){return Lr(this.gridOptions.copyGroupHeadersToClipboard)},M.prototype.isSuppressClipboardPaste=function(){return Lr(this.gridOptions.suppressClipboardPaste)},M.prototype.isSuppressLastEmptyLineOnPaste=function(){return Lr(this.gridOptions.suppressLastEmptyLineOnPaste)},M.prototype.isPagination=function(){return Lr(this.gridOptions.pagination)},M.prototype.isSuppressEnterpriseResetOnNewColumns=function(){return Lr(this.gridOptions.suppressEnterpriseResetOnNewColumns)},M.prototype.getProcessDataFromClipboardFunc=function(){return this.mergeGridCommonParams(this.gridOptions.processDataFromClipboard)},M.prototype.getAsyncTransactionWaitMillis=function(){return i(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:$e.BATCH_WAIT_MILLIS},M.prototype.isSuppressMovableColumns=function(){return Lr(this.gridOptions.suppressMovableColumns)},M.prototype.isAnimateRows=function(){return this.isEnsureDomOrder()?!1:Lr(this.gridOptions.animateRows)},M.prototype.isSuppressColumnMoveAnimation=function(){return Lr(this.gridOptions.suppressColumnMoveAnimation)},M.prototype.isSuppressAggFuncInHeader=function(){return Lr(this.gridOptions.suppressAggFuncInHeader)},M.prototype.isSuppressAggAtRootLevel=function(){return Lr(this.gridOptions.suppressAggAtRootLevel)},M.prototype.isSuppressAggFilteredOnly=function(){var d=this.getGroupAggFiltering()!==void 0;return d||Lr(this.gridOptions.suppressAggFilteredOnly)},M.prototype.isRemovePivotHeaderRowWhenSingleValueColumn=function(){return Lr(this.gridOptions.removePivotHeaderRowWhenSingleValueColumn)},M.prototype.isShowOpenedGroup=function(){return Lr(this.gridOptions.showOpenedGroup)},M.prototype.isReactUi=function(){return Lr(this.gridOptions.reactUi)},M.prototype.isSuppressReactUi=function(){return Lr(this.gridOptions.suppressReactUi)},M.prototype.isEnableRangeSelection=function(){return Xt.isRegistered(t.ModuleNames.RangeSelectionModule)&&Lr(this.gridOptions.enableRangeSelection)},M.prototype.isEnableRangeHandle=function(){return Lr(this.gridOptions.enableRangeHandle)},M.prototype.isEnableFillHandle=function(){return Lr(this.gridOptions.enableFillHandle)},M.prototype.getFillHandleDirection=function(){var d=this.gridOptions.fillHandleDirection;return d?d!=="x"&&d!=="y"&&d!=="xy"?(Ge(function(){return console.warn("AG Grid: valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'.")},"warn invalid fill direction"),"xy"):d:"xy"},M.prototype.getFillOperation=function(){return this.mergeGridCommonParams(this.gridOptions.fillOperation)},M.prototype.isSuppressMultiRangeSelection=function(){return Lr(this.gridOptions.suppressMultiRangeSelection)},M.prototype.isPaginationAutoPageSize=function(){return Lr(this.gridOptions.paginationAutoPageSize)},M.prototype.isRememberGroupStateWhenNewData=function(){return Lr(this.gridOptions.rememberGroupStateWhenNewData)},M.prototype.getIcons=function(){return this.gridOptions.icons},M.prototype.getGroupAggFiltering=function(){var d=this.gridOptions.groupAggFiltering;if(typeof d=="function")return this.mergeGridCommonParams(d);if(Lr(d))return function(){return!0}},M.prototype.getAggFuncs=function(){return this.gridOptions.aggFuncs},M.prototype.getSortingOrder=function(){return this.gridOptions.sortingOrder},M.prototype.getAlignedGrids=function(){return this.gridOptions.alignedGrids},M.prototype.isMasterDetail=function(){var d=Lr(this.gridOptions.masterDetail);return d?Xt.assertRegistered(t.ModuleNames.MasterDetailModule,"masterDetail"):!1},M.prototype.isKeepDetailRows=function(){return Lr(this.gridOptions.keepDetailRows)},M.prototype.getKeepDetailRowsCount=function(){var d=this.gridOptions.keepDetailRowsCount;return i(d)&&d>0?this.gridOptions.keepDetailRowsCount:J$},M.prototype.getIsRowMasterFunc=function(){return this.gridOptions.isRowMaster},M.prototype.getIsRowSelectableFunc=function(){return this.gridOptions.isRowSelectable},M.prototype.getGroupRowRendererParams=function(){return this.gridOptions.groupRowRendererParams},M.prototype.getOverlayLoadingTemplate=function(){return this.gridOptions.overlayLoadingTemplate},M.prototype.getOverlayNoRowsTemplate=function(){return this.gridOptions.overlayNoRowsTemplate},M.prototype.isSuppressAutoSize=function(){return Lr(this.gridOptions.suppressAutoSize)},M.prototype.isEnableCellTextSelection=function(){return Lr(this.gridOptions.enableCellTextSelection)},M.prototype.isSuppressParentsInRowNodes=function(){return Lr(this.gridOptions.suppressParentsInRowNodes)},M.prototype.isSuppressClipboardApi=function(){return Lr(this.gridOptions.suppressClipboardApi)},M.prototype.isFunctionsReadOnly=function(){return Lr(this.gridOptions.functionsReadOnly)},M.prototype.isEnableCellTextSelect=function(){return Lr(this.gridOptions.enableCellTextSelection)},M.prototype.getDefaultColDef=function(){return this.gridOptions.defaultColDef},M.prototype.getDefaultColGroupDef=function(){return this.gridOptions.defaultColGroupDef},M.prototype.getDefaultExportParams=function(d){if(this.gridOptions.defaultExportParams)return console.warn("AG Grid: Since v25.2 `defaultExportParams` has been replaced by `default"+Ti(d)+"ExportParams`'"),d==="csv"?this.gridOptions.defaultExportParams:this.gridOptions.defaultExportParams;if(d==="csv"&&this.gridOptions.defaultCsvExportParams)return this.gridOptions.defaultCsvExportParams;if(d==="excel"&&this.gridOptions.defaultExcelExportParams)return this.gridOptions.defaultExcelExportParams},M.prototype.isSuppressCsvExport=function(){return Lr(this.gridOptions.suppressCsvExport)},M.prototype.isAllowShowChangeAfterFilter=function(){return Lr(this.gridOptions.allowShowChangeAfterFilter)},M.prototype.isSuppressExcelExport=function(){return Lr(this.gridOptions.suppressExcelExport)},M.prototype.isSuppressMakeColumnVisibleAfterUnGroup=function(){return Lr(this.gridOptions.suppressMakeColumnVisibleAfterUnGroup)},M.prototype.getDataPathFunc=function(){return this.gridOptions.getDataPath},M.prototype.getIsServerSideGroupFunc=function(){return this.gridOptions.isServerSideGroup},M.prototype.getIsServerSideGroupOpenByDefaultFunc=function(){return this.mergeGridCommonParams(this.gridOptions.isServerSideGroupOpenByDefault)},M.prototype.getIsGroupOpenByDefaultFunc=function(){return this.mergeGridCommonParams(this.gridOptions.isGroupOpenByDefault)},M.prototype.getServerSideGroupKeyFunc=function(){return this.gridOptions.getServerSideGroupKey},M.prototype.getGroupRowAggFunc=function(){var d=this.gridOptions,g=d.getGroupRowAgg,S=d.groupRowAggNodes;if(g)return this.mergeGridCommonParams(g);if(S)return function(O){return S(O.nodes)}},M.prototype.getContextMenuItemsFunc=function(){return this.mergeGridCommonParams(this.gridOptions.getContextMenuItems)},M.prototype.getMainMenuItemsFunc=function(){return this.mergeGridCommonParams(this.gridOptions.getMainMenuItems)},M.prototype.getRowIdFunc=function(){var d=this.gridOptions,g=d.getRowId,S=d.getRowNodeId;if(g)return this.mergeGridCommonParams(g);if(S)return function(O){return S(O.data)}},M.prototype.getNavigateToNextHeaderFunc=function(){return this.mergeGridCommonParams(this.gridOptions.navigateToNextHeader)},M.prototype.getTabToNextHeaderFunc=function(){return this.mergeGridCommonParams(this.gridOptions.tabToNextHeader)},M.prototype.getNavigateToNextCellFunc=function(){return this.mergeGridCommonParams(this.gridOptions.navigateToNextCell)},M.prototype.getTabToNextCellFunc=function(){return this.mergeGridCommonParams(this.gridOptions.tabToNextCell)},M.prototype.getGridTabIndex=function(){return(this.gridOptions.tabIndex||0).toString()},M.prototype.isTreeData=function(){var d=Lr(this.gridOptions.treeData);return d?Xt.assertRegistered(t.ModuleNames.RowGroupingModule,"Tree Data"):!1},M.prototype.isValueCache=function(){return Lr(this.gridOptions.valueCache)},M.prototype.isValueCacheNeverExpires=function(){return Lr(this.gridOptions.valueCacheNeverExpires)},M.prototype.isDeltaSort=function(){return Lr(this.gridOptions.deltaSort)},M.prototype.isAggregateOnlyChangedColumns=function(){return Lr(this.gridOptions.aggregateOnlyChangedColumns)},M.prototype.getProcessSecondaryColDefFunc=function(){return this.gridOptions.processSecondaryColDef},M.prototype.getProcessSecondaryColGroupDefFunc=function(){return this.gridOptions.processSecondaryColGroupDef},M.prototype.getSendToClipboardFunc=function(){return this.mergeGridCommonParams(this.gridOptions.sendToClipboard)},M.prototype.getProcessRowPostCreateFunc=function(){return this.mergeGridCommonParams(this.gridOptions.processRowPostCreate)},M.prototype.getProcessCellForClipboardFunc=function(){return this.mergeGridCommonParams(this.gridOptions.processCellForClipboard)},M.prototype.getProcessHeaderForClipboardFunc=function(){return this.mergeGridCommonParams(this.gridOptions.processHeaderForClipboard)},M.prototype.getProcessGroupHeaderForClipboardFunc=function(){return this.mergeGridCommonParams(this.gridOptions.processGroupHeaderForClipboard)},M.prototype.getProcessCellFromClipboardFunc=function(){return this.mergeGridCommonParams(this.gridOptions.processCellFromClipboard)},M.prototype.getViewportRowModelPageSize=function(){return eie(this.gridOptions.viewportRowModelPageSize,Q0e)},M.prototype.getViewportRowModelBufferSize=function(){return Qte(this.gridOptions.viewportRowModelBufferSize,t9e)},M.prototype.isServerSideSortingAlwaysResets=function(){return Lr(this.gridOptions.serverSideSortingAlwaysResets)},M.prototype.isServerSideFilteringAlwaysResets=function(){return Lr(this.gridOptions.serverSideFilteringAlwaysResets)},M.prototype.getPostSortFunc=function(){var d=this.gridOptions,g=d.postSortRows,S=d.postSort;if(g)return this.mergeGridCommonParams(g);if(S)return function(O){return S(O.nodes)}},M.prototype.getChartToolbarItemsFunc=function(){return this.mergeGridCommonParams(this.gridOptions.getChartToolbarItems)},M.prototype.getChartThemeOverrides=function(){return this.gridOptions.chartThemeOverrides},M.prototype.getCustomChartThemes=function(){return this.gridOptions.customChartThemes},M.prototype.getChartThemes=function(){return this.gridOptions.chartThemes||["ag-default","ag-material","ag-pastel","ag-vivid","ag-solar"]},M.prototype.getClipboardDelimiter=function(){return i(this.gridOptions.clipboardDelimiter)?this.gridOptions.clipboardDelimiter:" "},M.prototype.setProperty=function(d,g,S){S===void 0&&(S=!1);var O=this.gridOptions,z=O[d];if(S||z!==g){O[d]=g;var te={type:d,currentValue:g,previousValue:z};this.propertyEventService.dispatchEvent(te)}},M.prototype.addEventListener=function(d,g){this.propertyEventService.addEventListener(d,g)},M.prototype.removeEventListener=function(d,g){this.propertyEventService.removeEventListener(d,g)},M.prototype.isSkipHeaderOnAutoSize=function(){return!!this.gridOptions.skipHeaderOnAutoSize},M.prototype.getAutoSizePadding=function(){var d=this.gridOptions.autoSizePadding;return d!=null&&d>=0?d:20},M.prototype.getHeaderHeight=function(){return typeof this.gridOptions.headerHeight=="number"?this.gridOptions.headerHeight:this.getFromTheme(25,"headerHeight")},M.prototype.getFloatingFiltersHeight=function(){return typeof this.gridOptions.floatingFiltersHeight=="number"?this.gridOptions.floatingFiltersHeight:this.getFromTheme(25,"headerHeight")},M.prototype.getGroupHeaderHeight=function(){return typeof this.gridOptions.groupHeaderHeight=="number"?this.gridOptions.groupHeaderHeight:this.getHeaderHeight()},M.prototype.getPivotHeaderHeight=function(){return typeof this.gridOptions.pivotHeaderHeight=="number"?this.gridOptions.pivotHeaderHeight:this.getHeaderHeight()},M.prototype.getPivotGroupHeaderHeight=function(){return typeof this.gridOptions.pivotGroupHeaderHeight=="number"?this.gridOptions.pivotGroupHeaderHeight:this.getGroupHeaderHeight()},M.prototype.isExternalFilterPresent=function(){return typeof this.gridOptions.isExternalFilterPresent=="function"?this.gridOptions.isExternalFilterPresent({api:this.getApi(),columnApi:this.getColumnApi(),context:this.getContext()}):!1},M.prototype.doesExternalFilterPass=function(d){return typeof this.gridOptions.doesExternalFilterPass=="function"?this.gridOptions.doesExternalFilterPass(d):!1},M.prototype.getTooltipDelay=function(d){var g=this.gridOptions,S=g.tooltipShowDelay,O=g.tooltipHideDelay,z=d==="show"?S:O,te=Ti(d);return i(z)?(z<0&&Ge(function(){return console.warn("ag-grid: tooltip"+te+"Delay should not be lower than 0")},"tooltip"+te+"DelayWarn"),Math.max(200,z)):null},M.prototype.isTooltipMouseTrack=function(){return Lr(this.gridOptions.tooltipMouseTrack)},M.prototype.isSuppressModelUpdateAfterUpdateTransaction=function(){return Lr(this.gridOptions.suppressModelUpdateAfterUpdateTransaction)},M.prototype.getDocument=function(){var d=null;return this.gridOptions.getDocument&&i(this.gridOptions.getDocument)?d=this.gridOptions.getDocument():this.eGridDiv&&(d=this.eGridDiv.ownerDocument),d&&i(d)?d:document},M.prototype.getMinColWidth=function(){var d=this.gridOptions.minColWidth;if(i(d)&&d>f.MIN_COL_WIDTH)return this.gridOptions.minColWidth;var g=this.getFromTheme(null,"headerCellMinWidth");return i(g)?Math.max(g,f.MIN_COL_WIDTH):f.MIN_COL_WIDTH},M.prototype.getMaxColWidth=function(){return this.gridOptions.maxColWidth&&this.gridOptions.maxColWidth>f.MIN_COL_WIDTH?this.gridOptions.maxColWidth:null},M.prototype.getColWidth=function(){return typeof this.gridOptions.colWidth!="number"||this.gridOptions.colWidth=0,g=d?this.gridOptions.scrollbarWidth:mh();g!=null&&(this.scrollbarWidth=g,this.eventService.dispatchEvent({type:ui.EVENT_SCROLLBAR_WIDTH_CHANGED}))}return this.scrollbarWidth},M.prototype.checkForDeprecated=function(){var d=this.gridOptions;d.deprecatedEmbedFullWidthRows&&console.warn("AG Grid: since v21.2, deprecatedEmbedFullWidthRows has been replaced with embedFullWidthRows."),d.rowDeselection&&console.warn("AG Grid: since v24.x, rowDeselection is deprecated and the behaviour is true by default. Please use `suppressRowDeselection` to prevent rows from being deselected."),d.enableMultiRowDragging&&(d.rowDragMultiRow=!0,delete d.enableMultiRowDragging,console.warn("AG Grid: since v26.1, `enableMultiRowDragging` is deprecated. Please use `rowDragMultiRow`."));var g=function(z,te,Fe){d[z]!=null&&(console.warn("AG Grid: since version "+Fe+", '"+z+"' is deprecated / renamed, please use the new property name '"+te+"' instead."),d[te]==null&&(d[te]=d[z]))};if(g("batchUpdateWaitMillis","asyncTransactionWaitMillis","23.1.x"),g("deltaRowDataMode","immutableData","23.1.x"),(d.immutableColumns||d.deltaColumnMode)&&console.warn("AG Grid: since v24.0, immutableColumns and deltaColumnMode properties are gone. The grid now works like this as default. To keep column order maintained, set grid property applyColumnDefOrder=true"),g("suppressSetColumnStateEvents","suppressColumnStateEvents","24.0.x"),d.groupRowInnerRenderer||d.groupRowInnerRendererParams||d.groupRowInnerRendererFramework){console.warn("AG Grid: since v24.0, grid properties groupRowInnerRenderer, groupRowInnerRendererFramework and groupRowInnerRendererParams are no longer used."),console.warn(" Instead use the grid properties groupRowRendererParams.innerRenderer, groupRowRendererParams.innerRendererFramework and groupRowRendererParams.innerRendererParams."),console.warn(" For example instead of this:"),console.warn(' groupRowInnerRenderer: "myRenderer"'),console.warn(" groupRowInnerRendererParams: {x: a}"),console.warn(" Replace with this:"),console.warn(" groupRowRendererParams: {"),console.warn(' innerRenderer: "myRenderer",'),console.warn(" innerRendererParams: {x: a}"),console.warn(" }"),console.warn(" We have copied the properties over for you. However to stop this error message, please change your application code."),d.groupRowRendererParams||(d.groupRowRendererParams={});var S=d.groupRowRendererParams;d.groupRowInnerRenderer&&(S.innerRenderer=d.groupRowInnerRenderer),d.groupRowInnerRendererParams&&(S.innerRendererParams=d.groupRowInnerRendererParams),d.groupRowInnerRendererFramework&&(S.innerRendererFramework=d.groupRowInnerRendererFramework)}if(d.rememberGroupStateWhenNewData&&console.warn("AG Grid: since v24.0, grid property rememberGroupStateWhenNewData is deprecated. This feature was provided before Transaction Updates worked (which keep group state). Now that transaction updates are possible and they keep group state, this feature is no longer needed."),d.detailCellRendererParams&&d.detailCellRendererParams.autoHeight&&(console.warn("AG Grid: since v24.1, grid property detailCellRendererParams.autoHeight is replaced with grid property detailRowAutoHeight. This allows this feature to work when you provide a custom DetailCellRenderer"),d.detailRowAutoHeight=!0),d.suppressKeyboardEvent&&console.warn(`AG Grid: since v24.1 suppressKeyboardEvent in the gridOptions has been deprecated and will be removed in + future versions of AG Grid. If you need this to be set for every column use the defaultColDef property.`),d.suppressEnterpriseResetOnNewColumns&&console.warn("AG Grid: since v25, grid property suppressEnterpriseResetOnNewColumns is deprecated. This was a temporary property to allow changing columns in Server Side Row Model without triggering a reload. Now that it is possible to dynamically change columns in the grid, this is no longer needed."),d.suppressColumnStateEvents&&console.warn('AG Grid: since v25, grid property suppressColumnStateEvents no longer works due to a refactor that we did. It should be possible to achieve similar using event.source, which would be "api" if the event was due to setting column state via the API'),d.defaultExportParams&&console.warn("AG Grid: since v25.2, the grid property `defaultExportParams` has been replaced by `defaultCsvExportParams` and `defaultExcelExportParams`."),d.stopEditingWhenGridLosesFocus&&(console.warn("AG Grid: since v25.2.2, the grid property `stopEditingWhenGridLosesFocus` has been replaced by `stopEditingWhenCellsLoseFocus`."),d.stopEditingWhenCellsLoseFocus=!0),d.applyColumnDefOrder&&console.warn("AG Grid: since v26.0, the grid property `applyColumnDefOrder` is no longer needed, as this is the default behaviour. To turn this behaviour off, set maintainColumnOrder=true"),d.groupMultiAutoColumn&&(console.warn("AG Grid: since v26.0, the grid property `groupMultiAutoColumn` has been replaced by `groupDisplayType = 'multipleColumns'`"),d.groupDisplayType="multipleColumns"),d.groupUseEntireRow&&(console.warn("AG Grid: since v26.0, the grid property `groupUseEntireRow` has been replaced by `groupDisplayType = 'groupRows'`"),d.groupDisplayType="groupRows"),d.groupSuppressAutoColumn){var O=d.treeData?"treeDataDisplayType":"groupDisplayType";console.warn("AG Grid: since v26.0, the grid property `groupSuppressAutoColumn` has been replaced by `"+O+" = 'custom'`"),d.groupDisplayType="custom"}d.defaultGroupOrderComparator&&console.warn("AG Grid: since v27.2, the grid property `defaultGroupOrderComparator` is deprecated and has been replaced by `initialGroupOrderComparator` and now receives a single params object."),d.defaultGroupSortComparator&&(console.warn("AG Grid: since v26.0, the grid property `defaultGroupSortComparator` has been replaced by `initialGroupOrderComparator`"),d.defaultGroupOrderComparator=d.defaultGroupSortComparator),d.groupRowAggNodes&&console.warn("AG Grid: since v27.2, the grid property `groupRowAggNodes` is deprecated and has been replaced by `getGroupRowAgg` and now receives a single params object."),d.postSort&&console.warn("AG Grid: since v27.2, the grid property `postSort` is deprecated and has been replaced by `postSortRows` and now receives a single params object."),d.isFullWidthCell&&console.warn("AG Grid: since v27.2, the grid property `isFullWidthCell` is deprecated and has been replaced by `isFullWidthRow` and now receives a single params object."),d.localeTextFunc&&console.warn("AG Grid: since v27.2, the grid property `localeTextFunc` is deprecated and has been replaced by `getLocaleText` and now receives a single params object."),d.colWidth&&console.warn("AG Grid: since v26.1, the grid property `colWidth` is deprecated and should be set via `defaultColDef.width`."),d.minColWidth&&console.warn("AG Grid: since v26.1, the grid property `minColWidth` is deprecated and should be set via `defaultColDef.minWidth`."),d.maxColWidth&&console.warn("AG Grid: since v26.1, the grid property `maxColWidth` is deprecated and should be set via `defaultColDef.maxWidth`."),d.reactUi&&console.warn("AG Grid: since v27.0, React UI is on by default, so no need for reactUi=true. To turn it off, set suppressReactUi=true."),d.suppressReactUi&&console.warn("AG Grid: The legacy React rendering engine is deprecated and will be removed in the next major version of the grid."),d.suppressCellSelection&&(console.warn("AG Grid: since v27.0, `suppressCellSelection` has been replaced by `suppressCellFocus`."),d.suppressCellFocus=d.suppressCellSelection),d.getRowNodeId&&console.warn("AG Grid: since v27.1, `getRowNodeId` is deprecated and has been replaced by `getRowId`. The difference: if getRowId() is implemented then immutable data is enabled by default."),d.immutableData&&(d.getRowId?console.warn("AG Grid: since v27.1, `immutableData` is deprecated. With the `getRowId` callback implemented, immutable data is enabled by default so you can remove `immutableData=true`."):console.warn("AG Grid: since v27.1, `immutableData` is deprecated. To enable immutable data you must implement the `getRowId()` callback.")),d.clipboardDeliminator&&(console.warn("AG Grid: since v27.1, `clipboardDeliminator` has been replaced by `clipboardDelimiter`."),d.clipboardDelimiter=d.clipboardDeliminator)},M.prototype.checkForViolations=function(){this.isTreeData()&&this.treeDataViolations()},M.prototype.treeDataViolations=function(){this.isRowModelDefault()&&r(this.getDataPathFunc())&&console.warn("AG Grid: property usingTreeData=true with rowModel=clientSide, but you did not provide getDataPath function, please provide getDataPath function if using tree data."),this.isRowModelServerSide()&&(r(this.getIsServerSideGroupFunc())&&console.warn("AG Grid: property usingTreeData=true with rowModel=serverSide, but you did not provide isServerSideGroup function, please provide isServerSideGroup function if using tree data."),r(this.getServerSideGroupKeyFunc())&&console.warn("AG Grid: property usingTreeData=true with rowModel=serverSide, but you did not provide getServerSideGroupKey function, please provide getServerSideGroupKey function if using tree data."))},M.prototype.getLocaleTextFunc=function(){var d=this,g=this.gridOptions,S=g.localeText,O=g.getLocaleText,z=g.localeTextFunc;return O?function(te,Fe,Ue){var ut={key:te,defaultValue:Fe,variableValues:Ue,api:d.getApi(),columnApi:d.getColumnApi(),context:d.getContext()};return O(ut)}:z||function(te,Fe,Ue){var ut=S&&S[te];if(ut&&Ue&&Ue.length)for(var Mt=0;!(Mt>=Ue.length);){var ni=ut.indexOf("${variable}");if(ni===-1)break;ut=ut.replace("${variable}",Ue[Mt++])}return ut??Fe}},M.prototype.globalEventHandler=function(d,g){if(!this.destroyed){var S=mi.getCallbackForEvent(d);typeof this.gridOptions[S]=="function"&&this.gridOptions[S](g)}},M.prototype.setRowHeightVariable=function(d){var g=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),S=d+"px";g!=S&&this.eGridDiv.style.setProperty("--ag-line-height",S)},M.prototype.getRowHeightAsNumber=function(){if(!this.gridOptions.rowHeight||r(this.gridOptions.rowHeight))return this.getDefaultRowHeight();var d=this.gridOptions.rowHeight;return d&&this.isNumeric(d)?(this.setRowHeightVariable(d),d):(console.warn("AG Grid row height must be a number if not using standard row model"),this.getDefaultRowHeight())},M.prototype.isGetRowHeightFunction=function(){return typeof this.gridOptions.getRowHeight=="function"},M.prototype.getRowHeightForNode=function(d,g,S){if(g===void 0&&(g=!1),S==null&&(S=this.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(g)return{height:S,estimated:!0};var O={node:d,data:d.data},z=this.mergeGridCommonParams(this.gridOptions.getRowHeight)(O);if(this.isNumeric(z))return z===0&&Ge(function(){return console.warn("AG Grid: The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead.")},"invalidRowHeight"),{height:Math.max(1,z),estimated:!1}}if(d.detail&&this.isMasterDetail())return this.isDetailRowAutoHeight()?{height:1,estimated:!1}:this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:Z0e,estimated:!1};var te=this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:S;return{height:te,estimated:!1}},M.prototype.isDynamicRowHeight=function(){return typeof this.gridOptions.getRowHeight=="function"},M.prototype.getListItemHeight=function(){return this.getFromTheme(20,"listItemHeight")},M.prototype.chartMenuPanelWidth=function(){return this.environment.chartMenuPanelWidth()},M.prototype.isNumeric=function(d){return!isNaN(d)&&typeof d=="number"&&isFinite(d)},M.prototype.getFromTheme=function(d,g){var S=this.environment.getTheme().theme;return S&&S.indexOf("ag-theme")===0?this.environment.getSassVariable(S,g):d},M.prototype.getDefaultRowHeight=function(){return this.getFromTheme(J0e,"rowHeight")},M.prototype.matchesGroupDisplayType=function(d,g){var S=["groupRows","multipleColumns","custom","singleColumn"];return S.indexOf(g)<0?(console.warn("AG Grid: '"+g+"' is not a valid groupDisplayType value - possible values are: '"+S.join("', '")+"'"),!1):g===d},M.prototype.matchesTreeDataDisplayType=function(d,g){var S=["auto","custom"];return S.indexOf(g)<0?(console.warn("AG Grid: '"+g+"' is not a valid treeDataDisplayType value - possible values are: '"+S.join("', '")+"'"),!1):g===d};var f;return M.MIN_COL_WIDTH=10,M.PROP_HEADER_HEIGHT="headerHeight",M.PROP_GROUP_REMOVE_SINGLE_CHILDREN="groupRemoveSingleChildren",M.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN="groupRemoveLowestSingleChildren",M.PROP_PIVOT_HEADER_HEIGHT="pivotHeaderHeight",M.PROP_SUPPRESS_CLIPBOARD_PASTE="suppressClipboardPaste",M.PROP_GROUP_HEADER_HEIGHT="groupHeaderHeight",M.PROP_PIVOT_GROUP_HEADER_HEIGHT="pivotGroupHeaderHeight",M.PROP_NAVIGATE_TO_NEXT_CELL="navigateToNextCell",M.PROP_TAB_TO_NEXT_CELL="tabToNextCell",M.PROP_NAVIGATE_TO_NEXT_HEADER="navigateToNextHeader",M.PROP_TAB_TO_NEXT_HEADER="tabToNextHeader",M.PROP_IS_EXTERNAL_FILTER_PRESENT="isExternalFilterPresent",M.PROP_DOES_EXTERNAL_FILTER_PASS="doesExternalFilterPass",M.PROP_FLOATING_FILTERS_HEIGHT="floatingFiltersHeight",M.PROP_SUPPRESS_ROW_CLICK_SELECTION="suppressRowClickSelection",M.PROP_SUPPRESS_ROW_DRAG="suppressRowDrag",M.PROP_SUPPRESS_MOVE_WHEN_ROW_DRAG="suppressMoveWhenRowDragging",M.PROP_GET_ROW_CLASS="getRowClass",M.PROP_GET_ROW_STYLE="getRowStyle",M.PROP_GET_ROW_HEIGHT="getRowHeight",M.PROP_POPUP_PARENT="popupParent",M.PROP_DOM_LAYOUT="domLayout",M.PROP_ROW_CLASS="rowClass",M.PROP_FILL_HANDLE_DIRECTION="fillHandleDirection",M.PROP_GROUP_ROW_AGG_NODES="groupRowAggNodes",M.PROP_GET_GROUP_ROW_AGG="getGroupRowAgg",M.PROP_GET_BUSINESS_KEY_FOR_NODE="getBusinessKeyForNode",M.PROP_GET_CHILD_COUNT="getChildCount",M.PROP_PROCESS_ROW_POST_CREATE="processRowPostCreate",M.PROP_GET_ROW_NODE_ID="getRowNodeId",M.PROP_GET_ROW_ID="getRowId",M.PROP_IS_FULL_WIDTH_CELL="isFullWidthCell",M.PROP_IS_FULL_WIDTH_ROW="isFullWidthRow",M.PROP_IS_ROW_SELECTABLE="isRowSelectable",M.PROP_IS_ROW_MASTER="isRowMaster",M.PROP_POST_SORT="postSort",M.PROP_POST_SORT_ROWS="postSortRows",M.PROP_GET_DOCUMENT="getDocument",M.PROP_POST_PROCESS_POPUP="postProcessPopup",M.PROP_DEFAULT_GROUP_ORDER_COMPARATOR="defaultGroupOrderComparator",M.PROP_INITIAL_GROUP_ORDER_COMPARATOR="initialGroupOrderComparator",M.PROP_PAGINATION_NUMBER_FORMATTER="paginationNumberFormatter",M.PROP_GET_CONTEXT_MENU_ITEMS="getContextMenuItems",M.PROP_GET_MAIN_MENU_ITEMS="getMainMenuItems",M.PROP_PROCESS_CELL_FOR_CLIPBOARD="processCellForClipboard",M.PROP_PROCESS_CELL_FROM_CLIPBOARD="processCellFromClipboard",M.PROP_SEND_TO_CLIPBOARD="sendToClipboard",M.PROP_PROCESS_TO_SECONDARY_COLDEF="processSecondaryColDef",M.PROP_PROCESS_SECONDARY_COL_GROUP_DEF="processSecondaryColGroupDef",M.PROP_GET_CHART_TOOLBAR_ITEMS="getChartToolbarItems",M.PROP_GET_SERVER_SIDE_STORE_PARAMS="getServerSideStoreParams",M.PROP_IS_SERVER_SIDE_GROUPS_OPEN_BY_DEFAULT="isServerSideGroupOpenByDefault",M.PROP_IS_APPLY_SERVER_SIDE_TRANSACTION="isApplyServerSideTransaction",M.PROP_IS_SERVER_SIDE_GROUP="isServerSideGroup",M.PROP_GET_SERVER_SIDE_GROUP_KEY="getServerSideGroupKey",C1([pe("gridOptions")],M.prototype,"gridOptions",void 0),C1([pe("eventService")],M.prototype,"eventService",void 0),C1([pe("environment")],M.prototype,"environment",void 0),C1([pe("eGridDiv")],M.prototype,"eGridDiv",void 0),C1([Zte(0,gt("gridApi")),Zte(1,gt("columnApi"))],M.prototype,"agWire",null),C1([wt],M.prototype,"destroy",null),C1([ht],M.prototype,"init",null),M=f=C1([Ne("gridOptionsWrapper")],M),M}();/** * @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/ * @license MIT - */var iie=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),$4=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P};(function(M){M.AUTO_HEIGHT="ag-layout-auto-height",M.NORMAL="ag-layout-normal",M.PRINT="ag-layout-print"})(t.LayoutCssClasses||(t.LayoutCssClasses={}));var _z=function(M){iie(f,M);function f(h){var g=M.call(this)||this;return g.view=h,g}return f.prototype.postConstruct=function(){this.addManagedListener(this.gridOptionsWrapper,Bn.PROP_DOM_LAYOUT,this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()},f.prototype.updateLayoutClasses=function(){var h=this.gridOptionsWrapper.getDomLayout(),g={autoHeight:h===Ue.DOM_LAYOUT_AUTO_HEIGHT,normal:h===Ue.DOM_LAYOUT_NORMAL,print:h===Ue.DOM_LAYOUT_PRINT},x=g.autoHeight?t.LayoutCssClasses.AUTO_HEIGHT:g.print?t.LayoutCssClasses.PRINT:t.LayoutCssClasses.NORMAL;this.view.updateLayoutClasses(x,g)},$4([ce("gridOptionsWrapper")],f.prototype,"gridOptionsWrapper",void 0),$4([it],f.prototype,"postConstruct",null),f}($i);/** + */var tie=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),j4=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O};(function(M){M.AUTO_HEIGHT="ag-layout-auto-height",M.NORMAL="ag-layout-normal",M.PRINT="ag-layout-print"})(t.LayoutCssClasses||(t.LayoutCssClasses={}));var _z=function(M){tie(f,M);function f(d){var g=M.call(this)||this;return g.view=d,g}return f.prototype.postConstruct=function(){this.addManagedListener(this.gridOptionsWrapper,Zn.PROP_DOM_LAYOUT,this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()},f.prototype.updateLayoutClasses=function(){var d=this.gridOptionsWrapper.getDomLayout(),g={autoHeight:d===$e.DOM_LAYOUT_AUTO_HEIGHT,normal:d===$e.DOM_LAYOUT_NORMAL,print:d===$e.DOM_LAYOUT_PRINT},S=g.autoHeight?t.LayoutCssClasses.AUTO_HEIGHT:g.print?t.LayoutCssClasses.PRINT:t.LayoutCssClasses.NORMAL;this.view.updateLayoutClasses(S,g)},j4([pe("gridOptionsWrapper")],f.prototype,"gridOptionsWrapper",void 0),j4([ht],f.prototype,"postConstruct",null),f}(ji);/** * @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/ * @license MIT - */var bz=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),$b=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},J0e=function(M){bz(f,M);function f(h){var g=M.call(this)||this;return g.scrollLeft=-1,g.nextScrollTop=-1,g.scrollTop=-1,g.eBodyViewport=h,g.resetLastHorizontalScrollElementDebounced=Tt(g.resetLastHorizontalScrollElement.bind(g),500),g}return f.prototype.postConstruct=function(){var h=this;this.enableRtl=this.gridOptionsWrapper.isEnableRtl(),this.addManagedListener(this.eventService,li.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this)),this.ctrlsService.whenReady(function(g){h.centerRowContainerCtrl=g.centerRowContainerCtrl,h.onDisplayedColumnsWidthChanged(),h.addScrollListener()})},f.prototype.addScrollListener=function(){var h=this.ctrlsService.getFakeHScrollCtrl();this.addManagedListener(this.centerRowContainerCtrl.getViewportElement(),"scroll",this.onCenterViewportScroll.bind(this)),this.addManagedListener(h.getViewport(),"scroll",this.onFakeHorizontalScroll.bind(this));var g=this.gridOptionsWrapper.isDebounceVerticalScrollbar()?Tt(this.onVerticalScroll.bind(this),100):this.onVerticalScroll.bind(this);this.addManagedListener(this.eBodyViewport,"scroll",g)},f.prototype.onDisplayedColumnsWidthChanged=function(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()},f.prototype.horizontallyScrollHeaderCenterAndFloatingCenter=function(h){var g=this.centerRowContainerCtrl==null;if(!g){h===void 0&&(h=this.centerRowContainerCtrl.getCenterViewportScrollLeft());var x=this.enableRtl?h:-h,P=this.ctrlsService.getTopCenterRowContainerCtrl(),z=this.ctrlsService.getBottomCenterRowContainerCtrl(),ee=this.ctrlsService.getFakeHScrollCtrl(),Me=this.ctrlsService.getHeaderRowContainerCtrl();Me.setHorizontalScroll(x),z.setContainerTranslateX(x),P.setContainerTranslateX(x);var je=this.lastHorizontalScrollElement===this.centerRowContainerCtrl.getViewportElement()?ee.getViewport():this.centerRowContainerCtrl.getViewportElement();Ql(je,Math.abs(h),this.enableRtl)}},f.prototype.isControllingScroll=function(h){return this.lastHorizontalScrollElement?h===this.lastHorizontalScrollElement:(this.lastHorizontalScrollElement=h,!0)},f.prototype.onFakeHorizontalScroll=function(){var h=this.ctrlsService.getFakeHScrollCtrl().getViewport();this.isControllingScroll(h)&&this.onBodyHorizontalScroll(h)},f.prototype.onCenterViewportScroll=function(){var h=this.centerRowContainerCtrl.getViewportElement();this.isControllingScroll(h)&&this.onBodyHorizontalScroll(h)},f.prototype.onBodyHorizontalScroll=function(h){var g=this.centerRowContainerCtrl.getViewportElement(),x=g.scrollLeft;this.shouldBlockScrollUpdate("horizontal",x,!0)||(this.doHorizontalScroll(Math.round(Xs(h,this.enableRtl))),this.resetLastHorizontalScrollElementDebounced())},f.prototype.onVerticalScroll=function(){var h=this.eBodyViewport.scrollTop;this.shouldBlockScrollUpdate("vertical",h,!0)||(this.animationFrameService.setScrollTop(h),this.nextScrollTop=h,this.gridOptionsWrapper.isSuppressAnimationFrame()?(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()):this.animationFrameService.schedule())},f.prototype.resetLastHorizontalScrollElement=function(){this.lastHorizontalScrollElement=null},f.prototype.doHorizontalScroll=function(h){var g=this.ctrlsService.getFakeHScrollCtrl().getViewport(),x=Xs(g,this.enableRtl);this.scrollLeft===h&&h===x||(this.scrollLeft=h,this.fireScrollEvent("horizontal"),this.horizontallyScrollHeaderCenterAndFloatingCenter(h),this.onHorizontalViewportChanged())},f.prototype.fireScrollEvent=function(h){var g=this,x={type:li.EVENT_BODY_SCROLL,api:this.gridApi,columnApi:this.columnApi,direction:h,left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(x),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout(function(){var P=Object.assign({},x,{type:li.EVENT_BODY_SCROLL_END});g.eventService.dispatchEvent(P)},100)},f.prototype.shouldBlockScrollUpdate=function(h,g,x){if(x===void 0&&(x=!1),x&&!nd())return!1;if(h==="vertical"){var P=tf(this.eBodyViewport),z=this.eBodyViewport.scrollHeight;if(g<0||g+P>z)return!0}if(h==="horizontal"){var ee=this.centerRowContainerCtrl.getCenterWidth(),Me=this.centerRowContainerCtrl.getViewportElement().scrollWidth;if(this.enableRtl&&Us()){if(g>0)return!0}else if(g<0)return!0;if(Math.abs(g)+ee>Me)return!0}return!1},f.prototype.redrawRowsAfterScroll=function(){this.fireScrollEvent("vertical")},f.prototype.onHorizontalViewportChanged=function(){this.centerRowContainerCtrl.onHorizontalViewportChanged()},f.prototype.checkScrollLeft=function(){this.scrollLeft!==this.centerRowContainerCtrl.getCenterViewportScrollLeft()&&this.onBodyHorizontalScroll(this.centerRowContainerCtrl.getViewportElement())},f.prototype.executeAnimationFrameScroll=function(){var h=this.scrollTop!=this.nextScrollTop;return h&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),h},f.prototype.setHorizontalScrollPosition=function(h){var g=0,x=this.centerRowContainerCtrl.getViewportElement().scrollWidth-this.centerRowContainerCtrl.getCenterWidth();this.shouldBlockScrollUpdate("horizontal",h)&&(this.enableRtl&&Us()?h=h>0?0:x:h=Math.min(Math.max(h,g),x)),Ql(this.centerRowContainerCtrl.getViewportElement(),Math.abs(h),this.enableRtl),this.doHorizontalScroll(h)},f.prototype.setVerticalScrollPosition=function(h){this.eBodyViewport.scrollTop=h},f.prototype.getVScrollPosition=function(){var h={top:this.eBodyViewport.scrollTop,bottom:this.eBodyViewport.scrollTop+this.eBodyViewport.offsetHeight};return h},f.prototype.getHScrollPosition=function(){return this.centerRowContainerCtrl.getHScrollPosition()},f.prototype.isHorizontalScrollShowing=function(){return this.centerRowContainerCtrl.isHorizontalScrollShowing()},f.prototype.scrollHorizontally=function(h){var g=this.centerRowContainerCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(g+h),this.centerRowContainerCtrl.getViewportElement().scrollLeft-g},f.prototype.scrollToTop=function(){this.eBodyViewport.scrollTop=0},f.prototype.ensureNodeVisible=function(h,g){g===void 0&&(g=null);for(var x=this.rowModel.getRowCount(),P=typeof h=="function",z=-1,ee=0;ee=0&&this.ensureIndexVisible(z,g)},f.prototype.ensureIndexVisible=function(h,g){if(this.gridOptionsWrapper.getDomLayout()!==Ue.DOM_LAYOUT_PRINT){var x=this.paginationProxy.getRowCount();if(typeof h!="number"||h<0||h>=x){console.warn("invalid row index for ensureIndexVisible: "+h);return}var P=this.gridOptionsWrapper.isPagination(),z=P&&!this.gridOptionsWrapper.isSuppressPaginationPanel();z||this.paginationProxy.goToPageWithIndex(h);var ee=this.paginationProxy.getRow(h),Me;do{var je=ee.rowTop,ut=ee.rowHeight,Rt=this.paginationProxy.getPixelOffset(),Zt=ee.rowTop-Rt,vi=Zt+ee.rowHeight,Ci=this.getVScrollPosition(),qi=this.heightScaler.getDivStretchOffset(),hr=Ci.top+qi,Rr=Ci.bottom+qi,Ar=Rr-hr,Fr=this.heightScaler.getScrollPositionForPixel(Zt),Sn=this.heightScaler.getScrollPositionForPixel(vi-Ar),Js=Math.min((Fr+Sn)/2,Zt),rl=hr>Zt,nl=RrMe:Pee;return{columnBeforeStart:ut,columnAfterEnd:Rt}},f.prototype.getColumnBounds=function(h){var g=this.enableRtl,x=this.columnModel.getBodyContainerWidth(),P=h.getActualWidth(),z=h.getLeft(),ee=g?-1:1,Me=g?x-z:z,je=Me+P*ee,ut=Me+P/2*ee;return{colLeft:Me,colMiddle:ut,colRight:je}},f.prototype.getViewportBounds=function(){var h=this.centerRowContainerCtrl.getCenterWidth(),g=this.centerRowContainerCtrl.getCenterViewportScrollLeft(),x=g,P=h+g;return{start:x,end:P,width:h}},$b([ce("ctrlsService")],f.prototype,"ctrlsService",void 0),$b([ce("animationFrameService")],f.prototype,"animationFrameService",void 0),$b([ce("columnApi")],f.prototype,"columnApi",void 0),$b([ce("gridApi")],f.prototype,"gridApi",void 0),$b([ce("paginationProxy")],f.prototype,"paginationProxy",void 0),$b([ce("rowModel")],f.prototype,"rowModel",void 0),$b([ce("rowContainerHeightService")],f.prototype,"heightScaler",void 0),$b([ce("rowRenderer")],f.prototype,"rowRenderer",void 0),$b([ce("columnModel")],f.prototype,"columnModel",void 0),$b([it],f.prototype,"postConstruct",null),f}($i);/** + */var bz=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),jb=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},eve=function(M){bz(f,M);function f(d){var g=M.call(this)||this;return g.scrollLeft=-1,g.nextScrollTop=-1,g.scrollTop=-1,g.eBodyViewport=d,g.resetLastHorizontalScrollElementDebounced=Et(g.resetLastHorizontalScrollElement.bind(g),500),g}return f.prototype.postConstruct=function(){var d=this;this.enableRtl=this.gridOptionsWrapper.isEnableRtl(),this.addManagedListener(this.eventService,ui.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this)),this.ctrlsService.whenReady(function(g){d.centerRowContainerCtrl=g.centerRowContainerCtrl,d.onDisplayedColumnsWidthChanged(),d.addScrollListener()})},f.prototype.addScrollListener=function(){var d=this.ctrlsService.getFakeHScrollCtrl();this.addManagedListener(this.centerRowContainerCtrl.getViewportElement(),"scroll",this.onCenterViewportScroll.bind(this)),this.addManagedListener(d.getViewport(),"scroll",this.onFakeHorizontalScroll.bind(this));var g=this.gridOptionsWrapper.isDebounceVerticalScrollbar()?Et(this.onVerticalScroll.bind(this),100):this.onVerticalScroll.bind(this);this.addManagedListener(this.eBodyViewport,"scroll",g)},f.prototype.onDisplayedColumnsWidthChanged=function(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()},f.prototype.horizontallyScrollHeaderCenterAndFloatingCenter=function(d){var g=this.centerRowContainerCtrl==null;if(!g){d===void 0&&(d=this.centerRowContainerCtrl.getCenterViewportScrollLeft());var S=this.enableRtl?d:-d,O=this.ctrlsService.getTopCenterRowContainerCtrl(),z=this.ctrlsService.getBottomCenterRowContainerCtrl(),te=this.ctrlsService.getFakeHScrollCtrl(),Fe=this.ctrlsService.getHeaderRowContainerCtrl();Fe.setHorizontalScroll(S),z.setContainerTranslateX(S),O.setContainerTranslateX(S);var Ue=this.lastHorizontalScrollElement===this.centerRowContainerCtrl.getViewportElement()?te.getViewport():this.centerRowContainerCtrl.getViewportElement();uu(Ue,Math.abs(d),this.enableRtl)}},f.prototype.isControllingScroll=function(d){return this.lastHorizontalScrollElement?d===this.lastHorizontalScrollElement:(this.lastHorizontalScrollElement=d,!0)},f.prototype.onFakeHorizontalScroll=function(){var d=this.ctrlsService.getFakeHScrollCtrl().getViewport();this.isControllingScroll(d)&&this.onBodyHorizontalScroll(d)},f.prototype.onCenterViewportScroll=function(){var d=this.centerRowContainerCtrl.getViewportElement();this.isControllingScroll(d)&&this.onBodyHorizontalScroll(d)},f.prototype.onBodyHorizontalScroll=function(d){var g=this.centerRowContainerCtrl.getViewportElement(),S=g.scrollLeft;this.shouldBlockScrollUpdate("horizontal",S,!0)||(this.doHorizontalScroll(Math.round(lo(d,this.enableRtl))),this.resetLastHorizontalScrollElementDebounced())},f.prototype.onVerticalScroll=function(){var d=this.eBodyViewport.scrollTop;this.shouldBlockScrollUpdate("vertical",d,!0)||(this.animationFrameService.setScrollTop(d),this.nextScrollTop=d,this.gridOptionsWrapper.isSuppressAnimationFrame()?(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()):this.animationFrameService.schedule())},f.prototype.resetLastHorizontalScrollElement=function(){this.lastHorizontalScrollElement=null},f.prototype.doHorizontalScroll=function(d){var g=this.ctrlsService.getFakeHScrollCtrl().getViewport(),S=lo(g,this.enableRtl);this.scrollLeft===d&&d===S||(this.scrollLeft=d,this.fireScrollEvent("horizontal"),this.horizontallyScrollHeaderCenterAndFloatingCenter(d),this.onHorizontalViewportChanged())},f.prototype.fireScrollEvent=function(d){var g=this,S={type:ui.EVENT_BODY_SCROLL,api:this.gridApi,columnApi:this.columnApi,direction:d,left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(S),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout(function(){var O=Object.assign({},S,{type:ui.EVENT_BODY_SCROLL_END});g.eventService.dispatchEvent(O)},100)},f.prototype.shouldBlockScrollUpdate=function(d,g,S){if(S===void 0&&(S=!1),S&&!ud())return!1;if(d==="vertical"){var O=of(this.eBodyViewport),z=this.eBodyViewport.scrollHeight;if(g<0||g+O>z)return!0}if(d==="horizontal"){var te=this.centerRowContainerCtrl.getCenterWidth(),Fe=this.centerRowContainerCtrl.getViewportElement().scrollWidth;if(this.enableRtl&&to()){if(g>0)return!0}else if(g<0)return!0;if(Math.abs(g)+te>Fe)return!0}return!1},f.prototype.redrawRowsAfterScroll=function(){this.fireScrollEvent("vertical")},f.prototype.onHorizontalViewportChanged=function(){this.centerRowContainerCtrl.onHorizontalViewportChanged()},f.prototype.checkScrollLeft=function(){this.scrollLeft!==this.centerRowContainerCtrl.getCenterViewportScrollLeft()&&this.onBodyHorizontalScroll(this.centerRowContainerCtrl.getViewportElement())},f.prototype.executeAnimationFrameScroll=function(){var d=this.scrollTop!=this.nextScrollTop;return d&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),d},f.prototype.setHorizontalScrollPosition=function(d){var g=0,S=this.centerRowContainerCtrl.getViewportElement().scrollWidth-this.centerRowContainerCtrl.getCenterWidth();this.shouldBlockScrollUpdate("horizontal",d)&&(this.enableRtl&&to()?d=d>0?0:S:d=Math.min(Math.max(d,g),S)),uu(this.centerRowContainerCtrl.getViewportElement(),Math.abs(d),this.enableRtl),this.doHorizontalScroll(d)},f.prototype.setVerticalScrollPosition=function(d){this.eBodyViewport.scrollTop=d},f.prototype.getVScrollPosition=function(){var d={top:this.eBodyViewport.scrollTop,bottom:this.eBodyViewport.scrollTop+this.eBodyViewport.offsetHeight};return d},f.prototype.getHScrollPosition=function(){return this.centerRowContainerCtrl.getHScrollPosition()},f.prototype.isHorizontalScrollShowing=function(){return this.centerRowContainerCtrl.isHorizontalScrollShowing()},f.prototype.scrollHorizontally=function(d){var g=this.centerRowContainerCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(g+d),this.centerRowContainerCtrl.getViewportElement().scrollLeft-g},f.prototype.scrollToTop=function(){this.eBodyViewport.scrollTop=0},f.prototype.ensureNodeVisible=function(d,g){g===void 0&&(g=null);for(var S=this.rowModel.getRowCount(),O=typeof d=="function",z=-1,te=0;te=0&&this.ensureIndexVisible(z,g)},f.prototype.ensureIndexVisible=function(d,g){if(this.gridOptionsWrapper.getDomLayout()!==$e.DOM_LAYOUT_PRINT){var S=this.paginationProxy.getRowCount();if(typeof d!="number"||d<0||d>=S){console.warn("invalid row index for ensureIndexVisible: "+d);return}var O=this.gridOptionsWrapper.isPagination(),z=O&&!this.gridOptionsWrapper.isSuppressPaginationPanel();z||this.paginationProxy.goToPageWithIndex(d);var te=this.paginationProxy.getRow(d),Fe;do{var Ue=te.rowTop,ut=te.rowHeight,Mt=this.paginationProxy.getPixelOffset(),ni=te.rowTop-Mt,Si=ni+te.rowHeight,Pi=this.getVScrollPosition(),Qi=this.heightScaler.getDivStretchOffset(),_r=Pi.top+Qi,Hr=Pi.bottom+Qi,$r=Hr-_r,Yr=this.heightScaler.getScrollPositionForPixel(ni),kn=this.heightScaler.getScrollPositionForPixel(Si-$r),co=Math.min((Yr+kn)/2,ni),hl=_r>ni,dl=HrFe:Ote;return{columnBeforeStart:ut,columnAfterEnd:Mt}},f.prototype.getColumnBounds=function(d){var g=this.enableRtl,S=this.columnModel.getBodyContainerWidth(),O=d.getActualWidth(),z=d.getLeft(),te=g?-1:1,Fe=g?S-z:z,Ue=Fe+O*te,ut=Fe+O/2*te;return{colLeft:Fe,colMiddle:ut,colRight:Ue}},f.prototype.getViewportBounds=function(){var d=this.centerRowContainerCtrl.getCenterWidth(),g=this.centerRowContainerCtrl.getCenterViewportScrollLeft(),S=g,O=d+g;return{start:S,end:O,width:d}},jb([pe("ctrlsService")],f.prototype,"ctrlsService",void 0),jb([pe("animationFrameService")],f.prototype,"animationFrameService",void 0),jb([pe("columnApi")],f.prototype,"columnApi",void 0),jb([pe("gridApi")],f.prototype,"gridApi",void 0),jb([pe("paginationProxy")],f.prototype,"paginationProxy",void 0),jb([pe("rowModel")],f.prototype,"rowModel",void 0),jb([pe("rowContainerHeightService")],f.prototype,"heightScaler",void 0),jb([pe("rowRenderer")],f.prototype,"rowRenderer",void 0),jb([pe("columnModel")],f.prototype,"columnModel",void 0),jb([ht],f.prototype,"postConstruct",null),f}(ji);/** * @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/ * @license MIT - */var rie=function(){function M(f){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=f.scrollContainer,this.scrollHorizontally=f.scrollAxis.indexOf("x")!==-1,this.scrollVertically=f.scrollAxis.indexOf("y")!==-1,this.scrollByTick=f.scrollByTick!=null?f.scrollByTick:20,f.onScrollCallback&&(this.onScrollCallback=f.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=f.getVerticalPosition,this.setVerticalPosition=f.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=f.getHorizontalPosition,this.setHorizontalPosition=f.setHorizontalPosition),this.shouldSkipVerticalScroll=f.shouldSkipVerticalScroll||function(){return!1},this.shouldSkipHorizontalScroll=f.shouldSkipHorizontalScroll||function(){return!1}}return M.prototype.check=function(f,h){h===void 0&&(h=!1);var g=h||this.shouldSkipVerticalScroll();if(!(g&&this.shouldSkipHorizontalScroll())){var x=this.scrollContainer.getBoundingClientRect(),P=this.scrollByTick;this.tickLeft=f.clientXx.right-P,this.tickUp=f.clientYx.bottom-P&&!g,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}},M.prototype.ensureTickingStarted=function(){this.tickingInterval===null&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)},M.prototype.doTick=function(){this.tickCount++;var f;if(f=this.tickCount>20?200:this.tickCount>10?80:40,this.scrollVertically){var h=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(h-f),this.tickDown&&this.setVerticalPosition(h+f)}if(this.scrollHorizontally){var g=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(g-f),this.tickRight&&this.setHorizontalPosition(g+f)}this.onScrollCallback&&this.onScrollCallback()},M.prototype.ensureCleared=function(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)},M}();/** + */var iie=function(){function M(f){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=f.scrollContainer,this.scrollHorizontally=f.scrollAxis.indexOf("x")!==-1,this.scrollVertically=f.scrollAxis.indexOf("y")!==-1,this.scrollByTick=f.scrollByTick!=null?f.scrollByTick:20,f.onScrollCallback&&(this.onScrollCallback=f.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=f.getVerticalPosition,this.setVerticalPosition=f.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=f.getHorizontalPosition,this.setHorizontalPosition=f.setHorizontalPosition),this.shouldSkipVerticalScroll=f.shouldSkipVerticalScroll||function(){return!1},this.shouldSkipHorizontalScroll=f.shouldSkipHorizontalScroll||function(){return!1}}return M.prototype.check=function(f,d){d===void 0&&(d=!1);var g=d||this.shouldSkipVerticalScroll();if(!(g&&this.shouldSkipHorizontalScroll())){var S=this.scrollContainer.getBoundingClientRect(),O=this.scrollByTick;this.tickLeft=f.clientXS.right-O,this.tickUp=f.clientYS.bottom-O&&!g,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}},M.prototype.ensureTickingStarted=function(){this.tickingInterval===null&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)},M.prototype.doTick=function(){this.tickCount++;var f;if(f=this.tickCount>20?200:this.tickCount>10?80:40,this.scrollVertically){var d=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(d-f),this.tickDown&&this.setVerticalPosition(d+f)}if(this.scrollHorizontally){var g=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(g-f),this.tickRight&&this.setHorizontalPosition(g+f)}this.onScrollCallback&&this.onScrollCallback()},M.prototype.ensureCleared=function(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)},M}();/** * @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/ * @license MIT - */var nie=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),t8=function(){return t8=Object.assign||function(M){for(var f,h=1,g=arguments.length;h=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Z0e=function(M,f){var h=typeof Symbol=="function"&&M[Symbol.iterator];if(!h)return M;var g=h.call(M),x,P=[],z;try{for(;(f===void 0||f-- >0)&&!(x=g.next()).done;)P.push(x.value)}catch(ee){z={error:ee}}finally{try{x&&!x.done&&(h=g.return)&&h.call(g)}finally{if(z)throw z.error}}return P},i8=function(){for(var M=[],f=0;fthis.paginationProxy.getCurrentPageHeight(),z=-1,ee;P||(z=this.rowModel.getRowIndexAtPixel(x),ee=this.rowModel.getRow(z));var Me;switch(g.vDirection){case t.VerticalDirection.Down:Me="down";break;case t.VerticalDirection.Up:Me="up";break;default:Me=null;break}var je={type:h,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),event:g.event,node:g.dragItem.rowNode,nodes:g.dragItem.rowNodes,overIndex:z,overNode:ee,y:x,vDirection:Me};return je},f.prototype.dispatchGridEvent=function(h,g){var x=this.draggingToRowDragEvent(h,g);this.eventService.dispatchEvent(x)},f.prototype.onDragLeave=function(h){this.dispatchGridEvent(li.EVENT_ROW_DRAG_LEAVE,h),this.stopDragging(h),this.gridOptionsWrapper.isRowDragManaged()&&this.clearRowHighlight(),this.isFromThisGrid(h)&&(this.isMultiRowDrag=!1)},f.prototype.onDragStop=function(h){this.dispatchGridEvent(li.EVENT_ROW_DRAG_END,h),this.stopDragging(h),this.gridOptionsWrapper.isRowDragManaged()&&(this.gridOptionsWrapper.isSuppressMoveWhenRowDragging()||!this.isFromThisGrid(h))&&!this.isDropZoneWithinThisGrid(h)&&this.moveRowAndClearHighlight(h)},f.prototype.stopDragging=function(h){this.autoScrollService.ensureCleared(),this.getRowNodes(h).forEach(function(g){g.setDragging(!1)})},kg([ce("dragAndDropService")],f.prototype,"dragAndDropService",void 0),kg([ce("rowModel")],f.prototype,"rowModel",void 0),kg([ce("paginationProxy")],f.prototype,"paginationProxy",void 0),kg([ce("columnModel")],f.prototype,"columnModel",void 0),kg([ce("focusService")],f.prototype,"focusService",void 0),kg([ce("sortController")],f.prototype,"sortController",void 0),kg([ce("filterManager")],f.prototype,"filterManager",void 0),kg([ce("selectionService")],f.prototype,"selectionService",void 0),kg([ce("mouseEventService")],f.prototype,"mouseEventService",void 0),kg([ce("ctrlsService")],f.prototype,"ctrlsService",void 0),kg([Ce("rangeService")],f.prototype,"rangeService",void 0),kg([ce("columnApi")],f.prototype,"columnApi",void 0),kg([ce("gridApi")],f.prototype,"gridApi",void 0),kg([it],f.prototype,"postConstruct",null),f}($i);/** + */var rie=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Q$=function(){return Q$=Object.assign||function(M){for(var f,d=1,g=arguments.length;d=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},tve=function(M,f){var d=typeof Symbol=="function"&&M[Symbol.iterator];if(!d)return M;var g=d.call(M),S,O=[],z;try{for(;(f===void 0||f-- >0)&&!(S=g.next()).done;)O.push(S.value)}catch(te){z={error:te}}finally{try{S&&!S.done&&(d=g.return)&&d.call(g)}finally{if(z)throw z.error}}return O},e8=function(){for(var M=[],f=0;fthis.paginationProxy.getCurrentPageHeight(),z=-1,te;O||(z=this.rowModel.getRowIndexAtPixel(S),te=this.rowModel.getRow(z));var Fe;switch(g.vDirection){case t.VerticalDirection.Down:Fe="down";break;case t.VerticalDirection.Up:Fe="up";break;default:Fe=null;break}var Ue={type:d,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),event:g.event,node:g.dragItem.rowNode,nodes:g.dragItem.rowNodes,overIndex:z,overNode:te,y:S,vDirection:Fe};return Ue},f.prototype.dispatchGridEvent=function(d,g){var S=this.draggingToRowDragEvent(d,g);this.eventService.dispatchEvent(S)},f.prototype.onDragLeave=function(d){this.dispatchGridEvent(ui.EVENT_ROW_DRAG_LEAVE,d),this.stopDragging(d),this.gridOptionsWrapper.isRowDragManaged()&&this.clearRowHighlight(),this.isFromThisGrid(d)&&(this.isMultiRowDrag=!1)},f.prototype.onDragStop=function(d){this.dispatchGridEvent(ui.EVENT_ROW_DRAG_END,d),this.stopDragging(d),this.gridOptionsWrapper.isRowDragManaged()&&(this.gridOptionsWrapper.isSuppressMoveWhenRowDragging()||!this.isFromThisGrid(d))&&!this.isDropZoneWithinThisGrid(d)&&this.moveRowAndClearHighlight(d)},f.prototype.stopDragging=function(d){this.autoScrollService.ensureCleared(),this.getRowNodes(d).forEach(function(g){g.setDragging(!1)})},Vg([pe("dragAndDropService")],f.prototype,"dragAndDropService",void 0),Vg([pe("rowModel")],f.prototype,"rowModel",void 0),Vg([pe("paginationProxy")],f.prototype,"paginationProxy",void 0),Vg([pe("columnModel")],f.prototype,"columnModel",void 0),Vg([pe("focusService")],f.prototype,"focusService",void 0),Vg([pe("sortController")],f.prototype,"sortController",void 0),Vg([pe("filterManager")],f.prototype,"filterManager",void 0),Vg([pe("selectionService")],f.prototype,"selectionService",void 0),Vg([pe("mouseEventService")],f.prototype,"mouseEventService",void 0),Vg([pe("ctrlsService")],f.prototype,"ctrlsService",void 0),Vg([Ae("rangeService")],f.prototype,"rangeService",void 0),Vg([pe("columnApi")],f.prototype,"columnApi",void 0),Vg([pe("gridApi")],f.prototype,"gridApi",void 0),Vg([ht],f.prototype,"postConstruct",null),f}(ji);/** * @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/ * @license MIT - */var eve=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Qm=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P};(function(M){M.ANIMATION_ON="ag-row-animation",M.ANIMATION_OFF="ag-row-no-animation"})(t.RowAnimationCssClasses||(t.RowAnimationCssClasses={}));var sie="ag-selectable",tve="ag-force-vertical-scroll",ive="ag-column-moving",oie=function(M){eve(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.getScrollFeature=function(){return this.bodyScrollFeature},f.prototype.getBodyViewportElement=function(){return this.eBodyViewport},f.prototype.setComp=function(h,g,x,P,z){this.comp=h,this.eGridBody=g,this.eBodyViewport=x,this.eTop=P,this.eBottom=z,this.setCellTextSelection(this.gridOptionsWrapper.isEnableCellTextSelect()),this.createManagedBean(new _z(this.comp)),this.bodyScrollFeature=this.createManagedBean(new J0e(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([P,x,z]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.ctrlsService.registerGridBodyCtrl(this)},f.prototype.getComp=function(){return this.comp},f.prototype.addEventListeners=function(){this.addManagedListener(this.eventService,li.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,li.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.addManagedListener(this.eventService,li.EVENT_PINNED_ROW_DATA_CHANGED,this.setFloatingHeights.bind(this))},f.prototype.addFocusListeners=function(h){var g=this;h.forEach(function(x){g.addManagedListener(x,"focusin",function(){x.classList.add("ag-has-focus")}),g.addManagedListener(x,"focusout",function(P){x.contains(P.relatedTarget)||x.classList.remove("ag-has-focus")})})},f.prototype.setColumnMovingCss=function(h){this.comp.setColumnMovingCss(h?ive:null,h)},f.prototype.setCellTextSelection=function(h){h===void 0&&(h=!1);var g=h?sie:null;this.comp.setCellSelectableCss(g,h)},f.prototype.onScrollVisibilityChanged=function(){var h=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(h)},f.prototype.onGridColumnsChanged=function(){var h=this.columnModel.getAllGridColumns();this.comp.setColumnCount(h?h.length:0)},f.prototype.disableBrowserDragging=function(){this.addManagedListener(this.eGridBody,"dragstart",function(h){if(h.target instanceof HTMLImageElement)return h.preventDefault(),!1})},f.prototype.addStopEditingWhenGridLosesFocus=function(){var h=this;if(this.gridOptionsWrapper.isStopEditingWhenCellsLoseFocus()){var g=function(P){var z=P.relatedTarget;if(Zp(z)===null){h.rowRenderer.stopEditing();return}var ee=x.some(function(je){return je.contains(z)})&&h.mouseEventService.isElementInThisGrid(z);if(!ee){var Me=h.popupService;ee=Me.getActivePopups().some(function(je){return je.contains(z)})||Me.isElementWithinCustomPopup(z)}ee||h.rowRenderer.stopEditing()},x=[this.eBodyViewport,this.eBottom,this.eTop];x.forEach(function(P){return h.addManagedListener(P,"focusout",g)})}},f.prototype.updateRowCount=function(){var h=this.headerNavigationService.getHeaderRowCount(),g=this.paginationProxy.getType(),x=-1;g===Ue.ROW_MODEL_TYPE_CLIENT_SIDE&&(x=0,this.paginationProxy.forEachNode(function(z){z.group||x++}));var P=x===-1?-1:h+x;this.comp.setRowCount(P)},f.prototype.registerBodyViewportResizeListener=function(h){this.comp.registerBodyViewportResizeListener(h)},f.prototype.setVerticalScrollPaddingVisible=function(h){var g=h?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(g)},f.prototype.isVerticalScrollShowing=function(){var h=this.gridOptionsWrapper.isAlwaysShowVerticalScroll(),g=h?tve:null;return this.comp.setAlwaysVerticalScrollClass(g,h),h||Rg(this.eBodyViewport)},f.prototype.setupRowAnimationCssClass=function(){var h=this,g=function(){var x=h.gridOptionsWrapper.isAnimateRows()&&!h.rowContainerHeightService.isStretching(),P=x?t.RowAnimationCssClasses.ANIMATION_ON:t.RowAnimationCssClasses.ANIMATION_OFF;h.comp.setRowAnimationCssOnBodyViewport(P,x)};g(),this.addManagedListener(this.eventService,li.EVENT_HEIGHT_SCALE_CHANGED,g)},f.prototype.getGridBodyElement=function(){return this.eGridBody},f.prototype.addBodyViewportListener=function(){var h=this,g=function(x){h.gridOptionsWrapper.isPreventDefaultOnContextMenu()&&x.preventDefault();var P=x.target;(P===h.eBodyViewport||P===h.ctrlsService.getCenterRowContainerCtrl().getViewportElement())&&h.contextMenuFactory&&h.contextMenuFactory.onContextMenu(x,null,null,null,null,h.eGridBody)};this.addManagedListener(this.eBodyViewport,"contextmenu",g),this.addManagedListener(this.eBodyViewport,"wheel",this.onWheel.bind(this))},f.prototype.onWheel=function(h){this.gridOptionsWrapper.isSuppressScrollWhenPopupsAreOpen()&&this.popupService.hasAnchoredPopup()&&h.preventDefault()},f.prototype.getGui=function(){return this.eGridBody},f.prototype.scrollVertically=function(h){var g=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(g+h),this.eBodyViewport.scrollTop-g},f.prototype.addRowDragListener=function(){this.rowDragFeature=this.createManagedBean(new Q0e(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)},f.prototype.getRowDragFeature=function(){return this.rowDragFeature},f.prototype.setFloatingHeights=function(){var h=this.pinnedRowModel,g=h.getPinnedTopTotalHeight();g&&(g+=1);var x=h.getPinnedBottomTotalHeight();x&&(x+=1),this.comp.setTopHeight(g),this.comp.setBottomHeight(x),this.comp.setTopDisplay(g?"inherit":"none"),this.comp.setBottomDisplay(x?"inherit":"none")},f.prototype.sizeColumnsToFit=function(h){var g=this,x=this.isVerticalScrollShowing(),P=x?this.gridOptionsWrapper.getScrollbarWidth():0,z=Og(this.eBodyViewport),ee=z-P;if(ee>0){this.columnModel.sizeColumnsToFit(ee,"sizeColumnsToFit");return}h===void 0?window.setTimeout(function(){g.sizeColumnsToFit(100)},0):h===100?window.setTimeout(function(){g.sizeColumnsToFit(500)},100):h===500?window.setTimeout(function(){g.sizeColumnsToFit(-1)},500):console.warn("AG Grid: tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")},f.prototype.addScrollEventListener=function(h){this.eBodyViewport.addEventListener("scroll",h)},f.prototype.removeScrollEventListener=function(h){this.eBodyViewport.removeEventListener("scroll",h)},Qm([ce("rowContainerHeightService")],f.prototype,"rowContainerHeightService",void 0),Qm([ce("ctrlsService")],f.prototype,"ctrlsService",void 0),Qm([ce("columnModel")],f.prototype,"columnModel",void 0),Qm([ce("scrollVisibleService")],f.prototype,"scrollVisibleService",void 0),Qm([Ce("contextMenuFactory")],f.prototype,"contextMenuFactory",void 0),Qm([ce("headerNavigationService")],f.prototype,"headerNavigationService",void 0),Qm([ce("paginationProxy")],f.prototype,"paginationProxy",void 0),Qm([ce("dragAndDropService")],f.prototype,"dragAndDropService",void 0),Qm([ce("pinnedRowModel")],f.prototype,"pinnedRowModel",void 0),Qm([ce("rowRenderer")],f.prototype,"rowRenderer",void 0),Qm([ce("popupService")],f.prototype,"popupService",void 0),Qm([ce("mouseEventService")],f.prototype,"mouseEventService",void 0),f}($i);/** + */var rve=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),ig=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O};(function(M){M.ANIMATION_ON="ag-row-animation",M.ANIMATION_OFF="ag-row-no-animation"})(t.RowAnimationCssClasses||(t.RowAnimationCssClasses={}));var nie="ag-selectable",nve="ag-force-vertical-scroll",sve="ag-column-moving",sie=function(M){rve(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.getScrollFeature=function(){return this.bodyScrollFeature},f.prototype.getBodyViewportElement=function(){return this.eBodyViewport},f.prototype.setComp=function(d,g,S,O,z){this.comp=d,this.eGridBody=g,this.eBodyViewport=S,this.eTop=O,this.eBottom=z,this.setCellTextSelection(this.gridOptionsWrapper.isEnableCellTextSelect()),this.createManagedBean(new _z(this.comp)),this.bodyScrollFeature=this.createManagedBean(new eve(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([O,S,z]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.ctrlsService.registerGridBodyCtrl(this)},f.prototype.getComp=function(){return this.comp},f.prototype.addEventListeners=function(){this.addManagedListener(this.eventService,ui.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ui.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.addManagedListener(this.eventService,ui.EVENT_PINNED_ROW_DATA_CHANGED,this.setFloatingHeights.bind(this))},f.prototype.addFocusListeners=function(d){var g=this;d.forEach(function(S){g.addManagedListener(S,"focusin",function(){S.classList.add("ag-has-focus")}),g.addManagedListener(S,"focusout",function(O){S.contains(O.relatedTarget)||S.classList.remove("ag-has-focus")})})},f.prototype.setColumnMovingCss=function(d){this.comp.setColumnMovingCss(d?sve:null,d)},f.prototype.setCellTextSelection=function(d){d===void 0&&(d=!1);var g=d?nie:null;this.comp.setCellSelectableCss(g,d)},f.prototype.onScrollVisibilityChanged=function(){var d=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(d)},f.prototype.onGridColumnsChanged=function(){var d=this.columnModel.getAllGridColumns();this.comp.setColumnCount(d?d.length:0)},f.prototype.disableBrowserDragging=function(){this.addManagedListener(this.eGridBody,"dragstart",function(d){if(d.target instanceof HTMLImageElement)return d.preventDefault(),!1})},f.prototype.addStopEditingWhenGridLosesFocus=function(){var d=this;if(this.gridOptionsWrapper.isStopEditingWhenCellsLoseFocus()){var g=function(O){var z=O.relatedTarget;if(rf(z)===null){d.rowRenderer.stopEditing();return}var te=S.some(function(Ue){return Ue.contains(z)})&&d.mouseEventService.isElementInThisGrid(z);if(!te){var Fe=d.popupService;te=Fe.getActivePopups().some(function(Ue){return Ue.contains(z)})||Fe.isElementWithinCustomPopup(z)}te||d.rowRenderer.stopEditing()},S=[this.eBodyViewport,this.eBottom,this.eTop];S.forEach(function(O){return d.addManagedListener(O,"focusout",g)})}},f.prototype.updateRowCount=function(){var d=this.headerNavigationService.getHeaderRowCount(),g=this.paginationProxy.getType(),S=-1;g===$e.ROW_MODEL_TYPE_CLIENT_SIDE&&(S=0,this.paginationProxy.forEachNode(function(z){z.group||S++}));var O=S===-1?-1:d+S;this.comp.setRowCount(O)},f.prototype.registerBodyViewportResizeListener=function(d){this.comp.registerBodyViewportResizeListener(d)},f.prototype.setVerticalScrollPaddingVisible=function(d){var g=d?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(g)},f.prototype.isVerticalScrollShowing=function(){var d=this.gridOptionsWrapper.isAlwaysShowVerticalScroll(),g=d?nve:null;return this.comp.setAlwaysVerticalScrollClass(g,d),d||Lg(this.eBodyViewport)},f.prototype.setupRowAnimationCssClass=function(){var d=this,g=function(){var S=d.gridOptionsWrapper.isAnimateRows()&&!d.rowContainerHeightService.isStretching(),O=S?t.RowAnimationCssClasses.ANIMATION_ON:t.RowAnimationCssClasses.ANIMATION_OFF;d.comp.setRowAnimationCssOnBodyViewport(O,S)};g(),this.addManagedListener(this.eventService,ui.EVENT_HEIGHT_SCALE_CHANGED,g)},f.prototype.getGridBodyElement=function(){return this.eGridBody},f.prototype.addBodyViewportListener=function(){var d=this,g=function(S){d.gridOptionsWrapper.isPreventDefaultOnContextMenu()&&S.preventDefault();var O=S.target;(O===d.eBodyViewport||O===d.ctrlsService.getCenterRowContainerCtrl().getViewportElement())&&d.contextMenuFactory&&d.contextMenuFactory.onContextMenu(S,null,null,null,null,d.eGridBody)};this.addManagedListener(this.eBodyViewport,"contextmenu",g),this.addManagedListener(this.eBodyViewport,"wheel",this.onWheel.bind(this))},f.prototype.onWheel=function(d){this.gridOptionsWrapper.isSuppressScrollWhenPopupsAreOpen()&&this.popupService.hasAnchoredPopup()&&d.preventDefault()},f.prototype.getGui=function(){return this.eGridBody},f.prototype.scrollVertically=function(d){var g=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(g+d),this.eBodyViewport.scrollTop-g},f.prototype.addRowDragListener=function(){this.rowDragFeature=this.createManagedBean(new ive(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)},f.prototype.getRowDragFeature=function(){return this.rowDragFeature},f.prototype.setFloatingHeights=function(){var d=this.pinnedRowModel,g=d.getPinnedTopTotalHeight();g&&(g+=1);var S=d.getPinnedBottomTotalHeight();S&&(S+=1),this.comp.setTopHeight(g),this.comp.setBottomHeight(S),this.comp.setTopDisplay(g?"inherit":"none"),this.comp.setBottomDisplay(S?"inherit":"none")},f.prototype.sizeColumnsToFit=function(d){var g=this,S=this.isVerticalScrollShowing(),O=S?this.gridOptionsWrapper.getScrollbarWidth():0,z=Fg(this.eBodyViewport),te=z-O;if(te>0){this.columnModel.sizeColumnsToFit(te,"sizeColumnsToFit");return}d===void 0?window.setTimeout(function(){g.sizeColumnsToFit(100)},0):d===100?window.setTimeout(function(){g.sizeColumnsToFit(500)},100):d===500?window.setTimeout(function(){g.sizeColumnsToFit(-1)},500):console.warn("AG Grid: tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")},f.prototype.addScrollEventListener=function(d){this.eBodyViewport.addEventListener("scroll",d)},f.prototype.removeScrollEventListener=function(d){this.eBodyViewport.removeEventListener("scroll",d)},ig([pe("rowContainerHeightService")],f.prototype,"rowContainerHeightService",void 0),ig([pe("ctrlsService")],f.prototype,"ctrlsService",void 0),ig([pe("columnModel")],f.prototype,"columnModel",void 0),ig([pe("scrollVisibleService")],f.prototype,"scrollVisibleService",void 0),ig([Ae("contextMenuFactory")],f.prototype,"contextMenuFactory",void 0),ig([pe("headerNavigationService")],f.prototype,"headerNavigationService",void 0),ig([pe("paginationProxy")],f.prototype,"paginationProxy",void 0),ig([pe("dragAndDropService")],f.prototype,"dragAndDropService",void 0),ig([pe("pinnedRowModel")],f.prototype,"pinnedRowModel",void 0),ig([pe("rowRenderer")],f.prototype,"rowRenderer",void 0),ig([pe("popupService")],f.prototype,"popupService",void 0),ig([pe("mouseEventService")],f.prototype,"mouseEventService",void 0),f}(ji);/** * @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/ @@ -6151,97 +6151,97 @@ gl_FragColor.rgb *= color.a; * @version v27.3.0 * @link https://www.ag-grid.com/ * @license MIT - */var r8="ag-cell-range-selected",aie="ag-cell-range-chart",wz="ag-cell-range-single-cell",E3="ag-cell-range-chart-category",rve="ag-cell-range-handle",e9e="ag-cell-range-top",t9e="ag-cell-range-right",i9e="ag-cell-range-bottom",lie="ag-cell-range-left",r9e=function(){function M(f,h){this.beans=f,this.cellCtrl=h}return M.prototype.setComp=function(f,h){this.cellComp=f,this.eGui=h,this.onRangeSelectionChanged()},M.prototype.onRangeSelectionChanged=function(){this.cellComp&&(this.rangeCount=this.beans.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(r8,this.rangeCount!==0),this.cellComp.addOrRemoveCssClass(r8+"-1",this.rangeCount===1),this.cellComp.addOrRemoveCssClass(r8+"-2",this.rangeCount===2),this.cellComp.addOrRemoveCssClass(r8+"-3",this.rangeCount===3),this.cellComp.addOrRemoveCssClass(r8+"-4",this.rangeCount>=4),this.cellComp.addOrRemoveCssClass(aie,this.hasChartRange),vl(this.eGui,this.rangeCount>0?!0:void 0),this.cellComp.addOrRemoveCssClass(wz,this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())},M.prototype.updateRangeBorders=function(){var f=this.getRangeBorders(),h=this.isSingleCell(),g=!h&&f.top,x=!h&&f.right,P=!h&&f.bottom,z=!h&&f.left;this.cellComp.addOrRemoveCssClass(e9e,g),this.cellComp.addOrRemoveCssClass(t9e,x),this.cellComp.addOrRemoveCssClass(i9e,P),this.cellComp.addOrRemoveCssClass(lie,z)},M.prototype.isSingleCell=function(){var f=this.beans.rangeService;return this.rangeCount===1&&f&&!f.isMoreThanOneCell()},M.prototype.getHasChartRange=function(){var f=this.beans.rangeService;if(!this.rangeCount||!f)return!1;var h=f.getCellRanges();return h.length>0&&h.every(function(g){return De([t.CellRangeType.DIMENSION,t.CellRangeType.VALUE],g.type)})},M.prototype.updateRangeBordersIfRangeCount=function(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())},M.prototype.getRangeBorders=function(){var f=this,h=this.beans.gridOptionsWrapper.isEnableRtl(),g=!1,x=!1,P=!1,z=!1,ee=this.cellCtrl.getCellPosition().column,Me=this.beans,je=Me.rangeService,ut=Me.columnModel,Rt,Zt;h?(Rt=ut.getDisplayedColAfter(ee),Zt=ut.getDisplayedColBefore(ee)):(Rt=ut.getDisplayedColBefore(ee),Zt=ut.getDisplayedColAfter(ee));var vi=je.getCellRanges().filter(function(Ar){return je.isCellInSpecificRange(f.cellCtrl.getCellPosition(),Ar)});Rt||(z=!0),Zt||(x=!0);for(var Ci=0;Ci=4),this.cellComp.addOrRemoveCssClass(i9e,this.hasChartRange),Il(this.eGui,this.rangeCount>0?!0:void 0),this.cellComp.addOrRemoveCssClass(wz,this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())},M.prototype.updateRangeBorders=function(){var f=this.getRangeBorders(),d=this.isSingleCell(),g=!d&&f.top,S=!d&&f.right,O=!d&&f.bottom,z=!d&&f.left;this.cellComp.addOrRemoveCssClass(n9e,g),this.cellComp.addOrRemoveCssClass(s9e,S),this.cellComp.addOrRemoveCssClass(o9e,O),this.cellComp.addOrRemoveCssClass(ave,z)},M.prototype.isSingleCell=function(){var f=this.beans.rangeService;return this.rangeCount===1&&f&&!f.isMoreThanOneCell()},M.prototype.getHasChartRange=function(){var f=this.beans.rangeService;if(!this.rangeCount||!f)return!1;var d=f.getCellRanges();return d.length>0&&d.every(function(g){return Me([t.CellRangeType.DIMENSION,t.CellRangeType.VALUE],g.type)})},M.prototype.updateRangeBordersIfRangeCount=function(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())},M.prototype.getRangeBorders=function(){var f=this,d=this.beans.gridOptionsWrapper.isEnableRtl(),g=!1,S=!1,O=!1,z=!1,te=this.cellCtrl.getCellPosition().column,Fe=this.beans,Ue=Fe.rangeService,ut=Fe.columnModel,Mt,ni;d?(Mt=ut.getDisplayedColAfter(te),ni=ut.getDisplayedColBefore(te)):(Mt=ut.getDisplayedColBefore(te),ni=ut.getDisplayedColAfter(te));var Si=Ue.getCellRanges().filter(function($r){return Ue.isCellInSpecificRange(f.cellCtrl.getCellPosition(),$r)});Mt||(z=!0),ni||(S=!0);for(var Pi=0;Pi=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},xz=function(){function M(){}return M.prototype.postConstruct=function(){this.doingMasterDetail=this.gridOptionsWrapper.isMasterDetail(),this.gridOptionsWrapper.isRowModelDefault()&&(this.clientSideRowModel=this.rowModel),this.gridOptionsWrapper.isRowModelServerSide()&&(this.serverSideRowModel=this.rowModel)},Oo([ce("resizeObserverService")],M.prototype,"resizeObserverService",void 0),Oo([ce("paginationProxy")],M.prototype,"paginationProxy",void 0),Oo([ce("context")],M.prototype,"context",void 0),Oo([ce("columnApi")],M.prototype,"columnApi",void 0),Oo([ce("gridApi")],M.prototype,"gridApi",void 0),Oo([ce("gridOptionsWrapper")],M.prototype,"gridOptionsWrapper",void 0),Oo([ce("expressionService")],M.prototype,"expressionService",void 0),Oo([ce("rowRenderer")],M.prototype,"rowRenderer",void 0),Oo([ce("templateService")],M.prototype,"templateService",void 0),Oo([ce("valueService")],M.prototype,"valueService",void 0),Oo([ce("eventService")],M.prototype,"eventService",void 0),Oo([ce("columnModel")],M.prototype,"columnModel",void 0),Oo([ce("headerNavigationService")],M.prototype,"headerNavigationService",void 0),Oo([ce("navigationService")],M.prototype,"navigationService",void 0),Oo([ce("columnAnimationService")],M.prototype,"columnAnimationService",void 0),Oo([Ce("rangeService")],M.prototype,"rangeService",void 0),Oo([ce("focusService")],M.prototype,"focusService",void 0),Oo([Ce("contextMenuFactory")],M.prototype,"contextMenuFactory",void 0),Oo([ce("popupService")],M.prototype,"popupService",void 0),Oo([ce("valueFormatterService")],M.prototype,"valueFormatterService",void 0),Oo([ce("stylingService")],M.prototype,"stylingService",void 0),Oo([ce("columnHoverService")],M.prototype,"columnHoverService",void 0),Oo([ce("userComponentFactory")],M.prototype,"userComponentFactory",void 0),Oo([ce("userComponentRegistry")],M.prototype,"userComponentRegistry",void 0),Oo([ce("animationFrameService")],M.prototype,"animationFrameService",void 0),Oo([ce("dragAndDropService")],M.prototype,"dragAndDropService",void 0),Oo([ce("sortController")],M.prototype,"sortController",void 0),Oo([ce("filterManager")],M.prototype,"filterManager",void 0),Oo([ce("rowContainerHeightService")],M.prototype,"rowContainerHeightService",void 0),Oo([ce("frameworkOverrides")],M.prototype,"frameworkOverrides",void 0),Oo([ce("cellPositionUtils")],M.prototype,"cellPositionUtils",void 0),Oo([ce("rowPositionUtils")],M.prototype,"rowPositionUtils",void 0),Oo([ce("selectionService")],M.prototype,"selectionService",void 0),Oo([Ce("selectionHandleFactory")],M.prototype,"selectionHandleFactory",void 0),Oo([ce("rowCssClassCalculator")],M.prototype,"rowCssClassCalculator",void 0),Oo([ce("rowModel")],M.prototype,"rowModel",void 0),Oo([ce("ctrlsService")],M.prototype,"ctrlsService",void 0),Oo([ce("ctrlsFactory")],M.prototype,"ctrlsFactory",void 0),Oo([ce("agStackComponentsRegistry")],M.prototype,"agStackComponentsRegistry",void 0),Oo([ce("valueCache")],M.prototype,"valueCache",void 0),Oo([ce("rowNodeEventThrottle")],M.prototype,"rowNodeEventThrottle",void 0),Oo([it],M.prototype,"postConstruct",null),M=Oo([Le("beans")],M),M}();/** + */var zo=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},xz=function(){function M(){}return M.prototype.postConstruct=function(){this.doingMasterDetail=this.gridOptionsWrapper.isMasterDetail(),this.gridOptionsWrapper.isRowModelDefault()&&(this.clientSideRowModel=this.rowModel),this.gridOptionsWrapper.isRowModelServerSide()&&(this.serverSideRowModel=this.rowModel)},zo([pe("resizeObserverService")],M.prototype,"resizeObserverService",void 0),zo([pe("paginationProxy")],M.prototype,"paginationProxy",void 0),zo([pe("context")],M.prototype,"context",void 0),zo([pe("columnApi")],M.prototype,"columnApi",void 0),zo([pe("gridApi")],M.prototype,"gridApi",void 0),zo([pe("gridOptionsWrapper")],M.prototype,"gridOptionsWrapper",void 0),zo([pe("expressionService")],M.prototype,"expressionService",void 0),zo([pe("rowRenderer")],M.prototype,"rowRenderer",void 0),zo([pe("templateService")],M.prototype,"templateService",void 0),zo([pe("valueService")],M.prototype,"valueService",void 0),zo([pe("eventService")],M.prototype,"eventService",void 0),zo([pe("columnModel")],M.prototype,"columnModel",void 0),zo([pe("headerNavigationService")],M.prototype,"headerNavigationService",void 0),zo([pe("navigationService")],M.prototype,"navigationService",void 0),zo([pe("columnAnimationService")],M.prototype,"columnAnimationService",void 0),zo([Ae("rangeService")],M.prototype,"rangeService",void 0),zo([pe("focusService")],M.prototype,"focusService",void 0),zo([Ae("contextMenuFactory")],M.prototype,"contextMenuFactory",void 0),zo([pe("popupService")],M.prototype,"popupService",void 0),zo([pe("valueFormatterService")],M.prototype,"valueFormatterService",void 0),zo([pe("stylingService")],M.prototype,"stylingService",void 0),zo([pe("columnHoverService")],M.prototype,"columnHoverService",void 0),zo([pe("userComponentFactory")],M.prototype,"userComponentFactory",void 0),zo([pe("userComponentRegistry")],M.prototype,"userComponentRegistry",void 0),zo([pe("animationFrameService")],M.prototype,"animationFrameService",void 0),zo([pe("dragAndDropService")],M.prototype,"dragAndDropService",void 0),zo([pe("sortController")],M.prototype,"sortController",void 0),zo([pe("filterManager")],M.prototype,"filterManager",void 0),zo([pe("rowContainerHeightService")],M.prototype,"rowContainerHeightService",void 0),zo([pe("frameworkOverrides")],M.prototype,"frameworkOverrides",void 0),zo([pe("cellPositionUtils")],M.prototype,"cellPositionUtils",void 0),zo([pe("rowPositionUtils")],M.prototype,"rowPositionUtils",void 0),zo([pe("selectionService")],M.prototype,"selectionService",void 0),zo([Ae("selectionHandleFactory")],M.prototype,"selectionHandleFactory",void 0),zo([pe("rowCssClassCalculator")],M.prototype,"rowCssClassCalculator",void 0),zo([pe("rowModel")],M.prototype,"rowModel",void 0),zo([pe("ctrlsService")],M.prototype,"ctrlsService",void 0),zo([pe("ctrlsFactory")],M.prototype,"ctrlsFactory",void 0),zo([pe("agStackComponentsRegistry")],M.prototype,"agStackComponentsRegistry",void 0),zo([pe("valueCache")],M.prototype,"valueCache",void 0),zo([pe("rowNodeEventThrottle")],M.prototype,"rowNodeEventThrottle",void 0),zo([ht],M.prototype,"postConstruct",null),M=zo([Ne("beans")],M),M}();/** * @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/ * @license MIT - */var cie=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),n8=function(M){cie(f,M);function f(h,g,x){var P=M.call(this)||this;return P.cellCtrl=h,P.beans=g,P.column=x,P}return f.prototype.onMouseEvent=function(h,g){if(!er(g))switch(h){case"click":this.onCellClicked(g);break;case"mousedown":case"touchstart":this.onMouseDown(g);break;case"dblclick":this.onCellDoubleClicked(g);break;case"mouseout":this.onMouseOut(g);break;case"mouseover":this.onMouseOver(g);break}},f.prototype.onCellClicked=function(h){if(this.isDoubleClickOnIPad()){this.onCellDoubleClicked(h),h.preventDefault();return}var g=this.beans,x=g.eventService,P=g.gridOptionsWrapper,z=this.cellCtrl.createEvent(h,li.EVENT_CELL_CLICKED);x.dispatchEvent(z);var ee=this.column.getColDef();ee.onCellClicked&&window.setTimeout(function(){return ee.onCellClicked(z)},0);var Me=(P.isSingleClickEdit()||ee.singleClickEdit)&&!P.isSuppressClickEdit();Me&&this.cellCtrl.startRowOrCellEdit()},f.prototype.isDoubleClickOnIPad=function(){if(!nd()||ar("dblclick"))return!1;var h=new Date().getTime(),g=h-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=h,g},f.prototype.onCellDoubleClicked=function(h){var g=this.column.getColDef(),x=this.cellCtrl.createEvent(h,li.EVENT_CELL_DOUBLE_CLICKED);this.beans.eventService.dispatchEvent(x),typeof g.onCellDoubleClicked=="function"&&window.setTimeout(function(){return g.onCellDoubleClicked(x)},0);var P=!this.beans.gridOptionsWrapper.isSingleClickEdit()&&!this.beans.gridOptionsWrapper.isSuppressClickEdit();P&&this.cellCtrl.startRowOrCellEdit(null,null,h)},f.prototype.onMouseDown=function(h){var g=h.ctrlKey,x=h.metaKey,P=h.shiftKey,z=h.target,ee=this.beans,Me=ee.eventService,je=ee.rangeService;if(!this.isRightClickInExistingRange(h)){var ut=je&&je.getCellRanges().length!=0;if(!P||!ut){var Rt=Ig()&&!this.cellCtrl.isEditing()&&!cm(z);this.cellCtrl.focusCell(Rt)}if(P&&ut&&h.preventDefault(),!this.containsWidget(z)){if(je){var Zt=this.cellCtrl.getCellPosition();if(P)je.extendLatestRangeToCell(Zt);else{var vi=g||x;je.setRangeToCell(Zt,vi)}}Me.dispatchEvent(this.cellCtrl.createEvent(h,li.EVENT_CELL_MOUSE_DOWN))}}},f.prototype.isRightClickInExistingRange=function(h){var g=this.beans.rangeService;if(g){var x=g.isCellInAnyRange(this.cellCtrl.getCellPosition());if(x&&h.button===2)return!0}return!1},f.prototype.containsWidget=function(h){return ui(h,"ag-selection-checkbox",3)},f.prototype.onMouseOut=function(h){if(!this.mouseStayingInsideCell(h)){var g=this.cellCtrl.createEvent(h,li.EVENT_CELL_MOUSE_OUT);this.beans.eventService.dispatchEvent(g),this.beans.columnHoverService.clearMouseOver()}},f.prototype.onMouseOver=function(h){if(!this.mouseStayingInsideCell(h)){var g=this.cellCtrl.createEvent(h,li.EVENT_CELL_MOUSE_OVER);this.beans.eventService.dispatchEvent(g),this.beans.columnHoverService.setMouseOver([this.column])}},f.prototype.mouseStayingInsideCell=function(h){if(!h.target||!h.relatedTarget)return!1;var g=this.cellCtrl.getGui(),x=g.contains(h.target),P=g.contains(h.relatedTarget);return x&&P},f.prototype.destroy=function(){},f}(xz);/** + */var aie=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),i8=function(M){aie(f,M);function f(d,g,S){var O=M.call(this)||this;return O.cellCtrl=d,O.beans=g,O.column=S,O}return f.prototype.onMouseEvent=function(d,g){if(!tr(g))switch(d){case"click":this.onCellClicked(g);break;case"mousedown":case"touchstart":this.onMouseDown(g);break;case"dblclick":this.onCellDoubleClicked(g);break;case"mouseout":this.onMouseOut(g);break;case"mouseover":this.onMouseOver(g);break}},f.prototype.onCellClicked=function(d){if(this.isDoubleClickOnIPad()){this.onCellDoubleClicked(d),d.preventDefault();return}var g=this.beans,S=g.eventService,O=g.gridOptionsWrapper,z=this.cellCtrl.createEvent(d,ui.EVENT_CELL_CLICKED);S.dispatchEvent(z);var te=this.column.getColDef();te.onCellClicked&&window.setTimeout(function(){return te.onCellClicked(z)},0);var Fe=(O.isSingleClickEdit()||te.singleClickEdit)&&!O.isSuppressClickEdit();Fe&&this.cellCtrl.startRowOrCellEdit()},f.prototype.isDoubleClickOnIPad=function(){if(!ud()||cr("dblclick"))return!1;var d=new Date().getTime(),g=d-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=d,g},f.prototype.onCellDoubleClicked=function(d){var g=this.column.getColDef(),S=this.cellCtrl.createEvent(d,ui.EVENT_CELL_DOUBLE_CLICKED);this.beans.eventService.dispatchEvent(S),typeof g.onCellDoubleClicked=="function"&&window.setTimeout(function(){return g.onCellDoubleClicked(S)},0);var O=!this.beans.gridOptionsWrapper.isSingleClickEdit()&&!this.beans.gridOptionsWrapper.isSuppressClickEdit();O&&this.cellCtrl.startRowOrCellEdit(null,null,d)},f.prototype.onMouseDown=function(d){var g=d.ctrlKey,S=d.metaKey,O=d.shiftKey,z=d.target,te=this.beans,Fe=te.eventService,Ue=te.rangeService;if(!this.isRightClickInExistingRange(d)){var ut=Ue&&Ue.getCellRanges().length!=0;if(!O||!ut){var Mt=Vc()&&!this.cellCtrl.isEditing()&&!ym(z);this.cellCtrl.focusCell(Mt)}if(O&&ut&&d.preventDefault(),!this.containsWidget(z)){if(Ue){var ni=this.cellCtrl.getCellPosition();if(O)Ue.extendLatestRangeToCell(ni);else{var Si=g||S;Ue.setRangeToCell(ni,Si)}}Fe.dispatchEvent(this.cellCtrl.createEvent(d,ui.EVENT_CELL_MOUSE_DOWN))}}},f.prototype.isRightClickInExistingRange=function(d){var g=this.beans.rangeService;if(g){var S=g.isCellInAnyRange(this.cellCtrl.getCellPosition());if(S&&d.button===2)return!0}return!1},f.prototype.containsWidget=function(d){return pi(d,"ag-selection-checkbox",3)},f.prototype.onMouseOut=function(d){if(!this.mouseStayingInsideCell(d)){var g=this.cellCtrl.createEvent(d,ui.EVENT_CELL_MOUSE_OUT);this.beans.eventService.dispatchEvent(g),this.beans.columnHoverService.clearMouseOver()}},f.prototype.onMouseOver=function(d){if(!this.mouseStayingInsideCell(d)){var g=this.cellCtrl.createEvent(d,ui.EVENT_CELL_MOUSE_OVER);this.beans.eventService.dispatchEvent(g),this.beans.columnHoverService.setMouseOver([this.column])}},f.prototype.mouseStayingInsideCell=function(d){if(!d.target||!d.relatedTarget)return!1;var g=this.cellCtrl.getGui(),S=g.contains(d.target),O=g.contains(d.relatedTarget);return S&&O},f.prototype.destroy=function(){},f}(xz);/** * @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/ * @license MIT - */var s8=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),o8=function(M){s8(f,M);function f(h,g,x,P,z){var ee=M.call(this)||this;return ee.cellCtrl=h,ee.beans=g,ee.rowNode=P,ee.rowCtrl=z,ee}return f.prototype.setComp=function(h){this.eGui=h},f.prototype.onKeyDown=function(h){var g=h.key;switch(g){case Nr.ENTER:this.onEnterKeyDown(h);break;case Nr.F2:this.onF2KeyDown(h);break;case Nr.ESCAPE:this.onEscapeKeyDown(h);break;case Nr.TAB:this.onTabKeyDown(h);break;case Nr.BACKSPACE:case Nr.DELETE:this.onBackspaceOrDeleteKeyPressed(g,h);break;case Nr.DOWN:case Nr.UP:case Nr.RIGHT:case Nr.LEFT:this.onNavigationKeyPressed(h,g);break}},f.prototype.onNavigationKeyPressed=function(h,g){this.cellCtrl.isEditing()||(h.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(h):this.beans.navigationService.navigateToNextCell(h,g,this.cellCtrl.getCellPosition(),!0),h.preventDefault())},f.prototype.onShiftRangeSelect=function(h){if(this.beans.rangeService){var g=this.beans.rangeService.extendLatestRangeInDirection(h);g&&this.beans.navigationService.ensureCellVisible(g)}},f.prototype.onTabKeyDown=function(h){this.beans.navigationService.onTabKeyDown(this.cellCtrl,h)},f.prototype.onBackspaceOrDeleteKeyPressed=function(h,g){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(h,void 0,g)},f.prototype.onEnterKeyDown=function(h){this.cellCtrl.isEditing()||this.rowCtrl.isEditing()?this.cellCtrl.stopEditingAndFocus():this.beans.gridOptionsWrapper.isEnterMovesDown()?this.beans.navigationService.navigateToNextCell(null,Nr.DOWN,this.cellCtrl.getCellPosition(),!1):(this.cellCtrl.startRowOrCellEdit(Nr.ENTER,void 0,h),this.cellCtrl.isEditing()&&h.preventDefault())},f.prototype.onF2KeyDown=function(h){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(Nr.F2,void 0,h)},f.prototype.onEscapeKeyDown=function(h){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))},f.prototype.onKeyPress=function(h){var g=h.target,x=g!==this.eGui;if(!(x||this.cellCtrl.isEditing())){var P=String.fromCharCode(h.charCode);P===" "?this.onSpaceKeyPressed(h):ds(h)&&(this.cellCtrl.startRowOrCellEdit(null,P,h),h.preventDefault())}},f.prototype.onSpaceKeyPressed=function(h){var g=this.beans.gridOptionsWrapper;if(!this.cellCtrl.isEditing()&&g.isRowSelection()){var x=this.rowNode.isSelected(),P=!x;if(P||!g.isSuppressRowDeselection()){var z=this.beans.gridOptionsWrapper.isGroupSelectsFiltered(),ee=this.rowNode.setSelectedParams({newValue:P,rangeSelect:h.shiftKey,groupSelectsFiltered:z});x===void 0&&ee===0&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:h.shiftKey,groupSelectsFiltered:z})}}h.preventDefault()},f.prototype.destroy=function(){},f}($i);/** + */var r8=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),n8=function(M){r8(f,M);function f(d,g,S,O,z){var te=M.call(this)||this;return te.cellCtrl=d,te.beans=g,te.rowNode=O,te.rowCtrl=z,te}return f.prototype.setComp=function(d){this.eGui=d},f.prototype.onKeyDown=function(d){var g=d.key;switch(g){case Qr.ENTER:this.onEnterKeyDown(d);break;case Qr.F2:this.onF2KeyDown(d);break;case Qr.ESCAPE:this.onEscapeKeyDown(d);break;case Qr.TAB:this.onTabKeyDown(d);break;case Qr.BACKSPACE:case Qr.DELETE:this.onBackspaceOrDeleteKeyPressed(g,d);break;case Qr.DOWN:case Qr.UP:case Qr.RIGHT:case Qr.LEFT:this.onNavigationKeyPressed(d,g);break}},f.prototype.onNavigationKeyPressed=function(d,g){this.cellCtrl.isEditing()||(d.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(d):this.beans.navigationService.navigateToNextCell(d,g,this.cellCtrl.getCellPosition(),!0),d.preventDefault())},f.prototype.onShiftRangeSelect=function(d){if(this.beans.rangeService){var g=this.beans.rangeService.extendLatestRangeInDirection(d);g&&this.beans.navigationService.ensureCellVisible(g)}},f.prototype.onTabKeyDown=function(d){this.beans.navigationService.onTabKeyDown(this.cellCtrl,d)},f.prototype.onBackspaceOrDeleteKeyPressed=function(d,g){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(d,void 0,g)},f.prototype.onEnterKeyDown=function(d){this.cellCtrl.isEditing()||this.rowCtrl.isEditing()?this.cellCtrl.stopEditingAndFocus():this.beans.gridOptionsWrapper.isEnterMovesDown()?this.beans.navigationService.navigateToNextCell(null,Qr.DOWN,this.cellCtrl.getCellPosition(),!1):(this.cellCtrl.startRowOrCellEdit(Qr.ENTER,void 0,d),this.cellCtrl.isEditing()&&d.preventDefault())},f.prototype.onF2KeyDown=function(d){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(Qr.F2,void 0,d)},f.prototype.onEscapeKeyDown=function(d){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))},f.prototype.onKeyPress=function(d){var g=d.target,S=g!==this.eGui;if(!(S||this.cellCtrl.isEditing())){var O=String.fromCharCode(d.charCode);O===" "?this.onSpaceKeyPressed(d):As(d)&&(this.cellCtrl.startRowOrCellEdit(null,O,d),d.preventDefault())}},f.prototype.onSpaceKeyPressed=function(d){var g=this.beans.gridOptionsWrapper;if(!this.cellCtrl.isEditing()&&g.isRowSelection()){var S=this.rowNode.isSelected(),O=!S;if(O||!g.isSuppressRowDeselection()){var z=this.beans.gridOptionsWrapper.isGroupSelectsFiltered(),te=this.rowNode.setSelectedParams({newValue:O,rangeSelect:d.shiftKey,groupSelectsFiltered:z});S===void 0&&te===0&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:d.shiftKey,groupSelectsFiltered:z})}}d.preventDefault()},f.prototype.destroy=function(){},f}(ji);/** * @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/ * @license MIT - */var hie=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Sz=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},a8=function(M){hie(f,M);function f(h,g,x,P){var z=M.call(this,'
')||this;return z.rowNode=h,z.column=g,z.beans=x,z.eCell=P,z}return f.prototype.postConstruct=function(){var h=this.getGui();h.appendChild(tu("rowDrag",this.beans.gridOptionsWrapper,null)),this.addGuiEventListener("mousedown",function(g){g.stopPropagation()}),this.addDragSource(),this.checkVisibility()},f.prototype.addDragSource=function(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))},f.prototype.onDragStart=function(h){var g=this,x=this.column.getColDef().dndSourceOnRowDrag;h.dataTransfer.setDragImage(this.eCell,0,0);var P=function(){try{var ee=JSON.stringify(g.rowNode.data);h.dataTransfer.setData("application/json",ee),h.dataTransfer.setData("text/plain",ee)}catch{}};if(x){var z={rowNode:this.rowNode,dragEvent:h,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()};x(z)}else P()},f.prototype.checkVisibility=function(){var h=this.column.isDndSource(this.rowNode);this.setDisplayed(h)},Sz([it],f.prototype,"postConstruct",null),f}(Sa);/** + */var lie=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Sz=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},s8=function(M){lie(f,M);function f(d,g,S,O){var z=M.call(this,'
')||this;return z.rowNode=d,z.column=g,z.beans=S,z.eCell=O,z}return f.prototype.postConstruct=function(){var d=this.getGui();d.appendChild(hu("rowDrag",this.beans.gridOptionsWrapper,null)),this.addGuiEventListener("mousedown",function(g){g.stopPropagation()}),this.addDragSource(),this.checkVisibility()},f.prototype.addDragSource=function(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))},f.prototype.onDragStart=function(d){var g=this,S=this.column.getColDef().dndSourceOnRowDrag;d.dataTransfer.setDragImage(this.eCell,0,0);var O=function(){try{var te=JSON.stringify(g.rowNode.data);d.dataTransfer.setData("application/json",te),d.dataTransfer.setData("text/plain",te)}catch{}};if(S){var z={rowNode:this.rowNode,dragEvent:d,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()};S(z)}else O()},f.prototype.checkVisibility=function(){var d=this.column.isDndSource(this.rowNode);this.setDisplayed(d)},Sz([ht],f.prototype,"postConstruct",null),f}(Ma);/** * @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/ * @license MIT - */var sve=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),dC=function(){return dC=Object.assign||function(M){for(var f,h=1,g=arguments.length;h0)&&!(x=g.next()).done;)P.push(x.value)}catch(ee){z={error:ee}}finally{try{x&&!x.done&&(h=g.return)&&h.call(g)}finally{if(z)throw z.error}}return P},nc=function(){for(var M=[],f=0;f=0;return Zt?P:x}return x},f.prototype.setAnimateFlags=function(h){if(h){var g=i(this.rowNode.oldRowTop);this.slideRowIn=g,this.fadeRowIn=!g}else this.slideRowIn=!1,this.fadeRowIn=!1},f.prototype.isEditing=function(){return this.editingRow},f.prototype.stopRowEditing=function(h){this.stopEditing(h)},f.prototype.isFullWidth=function(){return this.rowType!==Fd.Normal},f.prototype.getRowType=function(){return this.rowType},f.prototype.refreshFullWidth=function(){var h=this,g=function(je,ut){if(!je)return!0;var Rt=je.rowComp.getFullWidthCellRenderer();if(!Rt||!Rt.refresh)return!1;var Zt=h.createFullWidthParams(je.element,ut),vi=Rt.refresh(Zt);return vi},x=g(this.fullWidthGui,null),P=g(this.centerGui,null),z=g(this.leftGui,Ue.PINNED_LEFT),ee=g(this.rightGui,Ue.PINNED_RIGHT),Me=x&&P&&z&ⅇreturn Me},f.prototype.addListeners=function(){this.addManagedListener(this.rowNode,si.EVENT_HEIGHT_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.rowNode,si.EVENT_ROW_SELECTED,this.onRowSelected.bind(this)),this.addManagedListener(this.rowNode,si.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this)),this.addManagedListener(this.rowNode,si.EVENT_TOP_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(this.rowNode,si.EVENT_EXPANDED_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,si.EVENT_HAS_CHILDREN_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,si.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,si.EVENT_CELL_CHANGED,this.onRowNodeCellChanged.bind(this)),this.addManagedListener(this.rowNode,si.EVENT_HIGHLIGHT_CHANGED,this.onRowNodeHighlightChanged.bind(this)),this.addManagedListener(this.rowNode,si.EVENT_DRAGGING_CHANGED,this.onRowNodeDraggingChanged.bind(this)),this.addManagedListener(this.rowNode,si.EVENT_UI_LEVEL_CHANGED,this.onUiLevelChanged.bind(this));var h=this.beans.eventService;this.addManagedListener(h,li.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,this.onPaginationPixelOffsetChanged.bind(this)),this.addManagedListener(h,li.EVENT_HEIGHT_SCALE_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(h,li.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(h,li.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(h,li.EVENT_CELL_FOCUSED,this.onCellFocusChanged.bind(this)),this.addManagedListener(h,li.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),this.addManagedListener(h,li.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedListener(h,li.EVENT_COLUMN_MOVED,this.onColumnMoved.bind(this)),this.addListenersForCellComps()},f.prototype.onColumnMoved=function(){this.updateColumnLists()},f.prototype.addListenersForCellComps=function(){var h=this;this.addManagedListener(this.rowNode,si.EVENT_ROW_INDEX_CHANGED,function(){h.getAllCellCtrls().forEach(function(g){return g.onRowIndexChanged()})}),this.addManagedListener(this.rowNode,si.EVENT_CELL_CHANGED,function(g){h.getAllCellCtrls().forEach(function(x){return x.onCellChanged(g)})})},f.prototype.onRowNodeDataChanged=function(h){this.getAllCellCtrls().forEach(function(g){return g.refreshCell({suppressFlash:!h.update,newData:!h.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 h=this.rowNode.highlighted;this.allRowGuis.forEach(function(g){var x=h===t.RowHighlightPosition.Above,P=h===t.RowHighlightPosition.Below;g.rowComp.addOrRemoveCssClass("ag-row-highlight-above",x),g.rowComp.addOrRemoveCssClass("ag-row-highlight-below",P)})},f.prototype.onRowNodeDraggingChanged=function(){this.postProcessRowDragging()},f.prototype.postProcessRowDragging=function(){var h=this.rowNode.dragging;this.allRowGuis.forEach(function(g){return g.rowComp.addOrRemoveCssClass("ag-row-dragging",h)})},f.prototype.updateExpandedCss=function(){var h=this.rowNode.isExpandable(),g=this.rowNode.expanded==!0;this.allRowGuis.forEach(function(x){x.rowComp.addOrRemoveCssClass("ag-row-group",h),x.rowComp.addOrRemoveCssClass("ag-row-group-expanded",h&&g),x.rowComp.addOrRemoveCssClass("ag-row-group-contracted",h&&!g),yo(x.element,h&&g)})},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(h){var g=this.allRowGuis.find(function(je){return je.element.contains(h.target)}),x=g?g.element:null,P=x===h.target;if(P){var z=this.rowNode,ee=this.beans.focusService.getFocusedCell(),Me={rowIndex:z.rowIndex,rowPinned:z.rowPinned,column:ee&&ee.column};this.beans.navigationService.navigateToNextCell(h,h.key,Me,!0),h.preventDefault()}},f.prototype.onTabKeyDown=function(h){if(!(h.defaultPrevented||er(h))){var g=this.allRowGuis.find(function(ee){return ee.element.contains(h.target)}),x=g?g.element:null,P=x===h.target,z=null;P||(z=this.beans.focusService.findNextFocusableElement(x,!1,h.shiftKey)),(this.isFullWidth()&&P||!z)&&this.beans.navigationService.onTabKeyDown(this,h)}},f.prototype.onFullWidthRowFocused=function(h){var g,x=this.rowNode,P=this.isFullWidth()&&h.rowIndex===x.rowIndex&&h.rowPinned==x.rowPinned,z=this.fullWidthGui?this.fullWidthGui.element:(g=this.centerGui)===null||g===void 0?void 0:g.element;z&&(z.classList.toggle("ag-full-width-focus",P),P&&z.focus({preventScroll:!0}))},f.prototype.refreshCell=function(h){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,h),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,h),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,h),this.updateColumnLists()},f.prototype.removeCellCtrl=function(h,g){var x={list:[],map:{}};return h.list.forEach(function(P){P!==g&&(x.list.push(P),x.map[P.getInstanceId()]=P)}),x},f.prototype.onMouseEvent=function(h,g){switch(h){case"dblclick":this.onRowDblClick(g);break;case"click":this.onRowClick(g);break;case"touchstart":case"mousedown":this.onRowMouseDown(g);break}},f.prototype.createRowEvent=function(h,g){return{type:h,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:g}},f.prototype.createRowEventWithSource=function(h,g){var x=this.createRowEvent(h,g);return x.source=this,x},f.prototype.onRowDblClick=function(h){if(!er(h)){var g=this.createRowEventWithSource(li.EVENT_ROW_DOUBLE_CLICKED,h);this.beans.eventService.dispatchEvent(g)}},f.prototype.onRowMouseDown=function(h){if(this.lastMouseDownOnDragger=ui(h.target,"ag-row-drag",3),!!this.isFullWidth()){var g=this.rowNode,x=this.beans.columnModel;this.beans.focusService.setFocusedCell(g.rowIndex,x.getAllDisplayedColumns()[0],g.rowPinned,!0)}},f.prototype.onRowClick=function(h){var g=er(h)||this.lastMouseDownOnDragger;if(!g){var x=this.createRowEventWithSource(li.EVENT_ROW_CLICKED,h);this.beans.eventService.dispatchEvent(x);var P=h.ctrlKey||h.metaKey,z=h.shiftKey,ee=this.beans.gridOptionsWrapper.isGroupSelectsChildren();if(!(ee&&this.rowNode.group||!this.rowNode.selectable||this.rowNode.rowPinned||!this.beans.gridOptionsWrapper.isRowSelection()||this.beans.gridOptionsWrapper.isSuppressRowClickSelection())){var Me=this.beans.gridOptionsWrapper.isRowMultiSelectWithClick(),je=!this.beans.gridOptionsWrapper.isSuppressRowDeselection();if(this.rowNode.isSelected())Me?this.rowNode.setSelectedParams({newValue:!1}):P?je&&this.rowNode.setSelectedParams({newValue:!1}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!z,rangeSelect:z});else{var ut=Me?!1:!P;this.rowNode.setSelectedParams({newValue:!0,clearSelection:ut,rangeSelect:z})}}}},f.prototype.setupDetailRowAutoHeight=function(h){var g=this;if(this.rowType===Fd.FullWidthDetail&&this.beans.gridOptionsWrapper.isDetailRowAutoHeight()){var x=function(){var z=h.clientHeight;if(z!=null&&z>0){var ee=function(){g.rowNode.setRowHeight(z),g.beans.clientSideRowModel?g.beans.clientSideRowModel.onRowHeightChanged():g.beans.serverSideRowModel&&g.beans.serverSideRowModel.onRowHeightChanged()};g.beans.frameworkOverrides.setTimeout(ee,0)}},P=this.beans.resizeObserverService.observeResize(h,x);this.addDestroyFunc(P),x()}},f.prototype.createFullWidthParams=function(h,g){var x=this,P={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:h,eParentOfValue:h,pinned:g,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:function(z,ee,Me,je){return x.addFullWidthRowDragging(z,ee,Me,je)}};return P},f.prototype.addFullWidthRowDragging=function(h,g,x,P){if(x===void 0&&(x=""),!!this.isFullWidth()){var z=new OI(function(){return x},this.rowNode,void 0,h,g,P);this.createManagedBean(z,this.beans.context)}},f.prototype.onUiLevelChanged=function(){var h=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=h){var g="ag-row-level-"+h,x="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(function(P){P.rowComp.addOrRemoveCssClass(g,!0),P.rowComp.addOrRemoveCssClass(x,!1)})}this.rowLevel=h},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 h=this.isFirstRowOnPage(),g=this.isLastRowOnPage();this.firstRowOnPage!==h&&(this.firstRowOnPage=h,this.allRowGuis.forEach(function(x){return x.rowComp.addOrRemoveCssClass("ag-row-first",h)})),this.lastRowOnPage!==g&&(this.lastRowOnPage=g,this.allRowGuis.forEach(function(x){return x.rowComp.addOrRemoveCssClass("ag-row-last",g)}))},f.prototype.stopEditing=function(h){h===void 0&&(h=!1);var g=this.getAllCellCtrls().map(function(P){return P.stopEditing(h)});if(this.editingRow){if(!h&&g.some(function(P){return P})){var x=this.createRowEvent(li.EVENT_ROW_VALUE_CHANGED);this.beans.eventService.dispatchEvent(x)}this.setEditingRow(!1)}},f.prototype.setInlineEditingCss=function(h){this.allRowGuis.forEach(function(g){g.rowComp.addOrRemoveCssClass("ag-row-inline-editing",h),g.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!h)})},f.prototype.setEditingRow=function(h){this.editingRow=h,this.allRowGuis.forEach(function(x){return x.rowComp.addOrRemoveCssClass("ag-row-editing",h)});var g=h?this.createRowEvent(li.EVENT_ROW_EDITING_STARTED):this.createRowEvent(li.EVENT_ROW_EDITING_STOPPED);this.beans.eventService.dispatchEvent(g)},f.prototype.startRowEditing=function(h,g,x,P){h===void 0&&(h=null),g===void 0&&(g=null),x===void 0&&(x=null),P===void 0&&(P=null),!this.editingRow&&(this.getAllCellCtrls().forEach(function(z){var ee=z===x;ee?z.startEditing(h,g,ee,P):z.startEditing(null,null,ee,P)}),this.setEditingRow(!0))},f.prototype.getAllCellCtrls=function(){var h=nc(this.centerCellCtrls.list,this.leftCellCtrls.list,this.rightCellCtrls.list);return h},f.prototype.postProcessClassesFromGridOptions=function(){var h=this,g=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);!g||!g.length||g.forEach(function(x){h.allRowGuis.forEach(function(P){return P.rowComp.addOrRemoveCssClass(x,!0)})})},f.prototype.postProcessRowClassRules=function(){var h=this;this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,function(g){h.allRowGuis.forEach(function(x){return x.rowComp.addOrRemoveCssClass(g,!0)})},function(g){h.allRowGuis.forEach(function(x){return x.rowComp.addOrRemoveCssClass(g,!1)})})},f.prototype.setStylesFromGridOptions=function(){var h=this.processStylesFromGridOptions();this.allRowGuis.forEach(function(g){return g.rowComp.setUserStyles(h)})},f.prototype.getRowBusinessKey=function(){var h=this.beans.gridOptionsWrapper.getBusinessKeyForNodeFunc();if(typeof h=="function")return h(this.rowNode)},f.prototype.getPinnedForContainer=function(h){var g=h===t.RowContainerType.LEFT?Ue.PINNED_LEFT:h===t.RowContainerType.RIGHT?Ue.PINNED_RIGHT:null;return g},f.prototype.getInitialRowClasses=function(h){var g=this.getPinnedForContainer(h),x={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:g};return this.beans.rowCssClassCalculator.getInitialRowClasses(x)},f.prototype.processStylesFromGridOptions=function(){var h=this.beans.gridOptionsWrapper.getRowStyle();if(h&&typeof h=="function"){console.warn("AG Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");return}var g=this.beans.gridOptionsWrapper.getRowStyleFunc(),x;if(g){var P={data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex};x=g(P)}return Object.assign({},h,x)},f.prototype.onRowSelected=function(){var h=this,g=!!this.rowNode.isSelected();this.allRowGuis.forEach(function(x){x.rowComp.addOrRemoveCssClass("ag-row-selected",g),vl(x.element,g?!0:void 0);var P=h.createAriaLabel();kn(x.element,P??"")})},f.prototype.createAriaLabel=function(){var h=this.rowNode.isSelected();if(!(h&&this.beans.gridOptionsWrapper.isSuppressRowDeselection())){var g=this.beans.gridOptionsWrapper.getLocaleTextFunc(),x=g(h?"ariaRowDeselect":"ariaRowSelect","Press SPACE to "+(h?"deselect":"select")+" this row.");return x}},f.prototype.isUseAnimationFrameForCreate=function(){return this.useAnimationFrameForCreate},f.prototype.addHoverFunctionality=function(h){var g=this;this.active&&(this.addManagedListener(h,"mouseenter",function(){return g.rowNode.onMouseEnter()}),this.addManagedListener(h,"mouseleave",function(){return g.rowNode.onMouseLeave()}),this.addManagedListener(this.rowNode,si.EVENT_MOUSE_ENTER,function(){g.beans.gridOptionsWrapper.isSuppressRowHoverHighlight()||h.classList.add("ag-row-hover")}),this.addManagedListener(this.rowNode,si.EVENT_MOUSE_LEAVE,function(){h.classList.remove("ag-row-hover")}))},f.prototype.roundRowTopToBounds=function(h){var g=this.beans.ctrlsService.getGridBodyCtrl(),x=g.getScrollFeature().getVScrollPosition(),P=this.applyPaginationOffset(x.top,!0)-100,z=this.applyPaginationOffset(x.bottom,!0)+100;return Math.min(Math.max(P,h),z)},f.prototype.getFrameworkOverrides=function(){return this.beans.frameworkOverrides},f.prototype.onRowHeightChanged=function(){if(this.rowNode.rowHeight!=null){var h=this.rowNode.rowHeight,g=this.beans.gridOptionsWrapper.getDefaultRowHeight(),x=this.beans.gridOptionsWrapper.isGetRowHeightFunction(),P=x?this.beans.gridOptionsWrapper.getRowHeightForNode(this.rowNode).height:void 0,z=P?Math.min(g,P)-2+"px":void 0;this.allRowGuis.forEach(function(ee){ee.element.style.height=h+"px",z&&ee.element.style.setProperty("--ag-line-height",z)})}},f.prototype.addEventListener=function(h,g){(h==="renderedRowRemoved"||h==="rowRemoved")&&(h=li.EVENT_VIRTUAL_ROW_REMOVED,console.warn("AG Grid: Since version 11, event renderedRowRemoved is now called "+li.EVENT_VIRTUAL_ROW_REMOVED)),M.prototype.addEventListener.call(this,h,g)},f.prototype.removeEventListener=function(h,g){(h==="renderedRowRemoved"||h==="rowRemoved")&&(h=li.EVENT_VIRTUAL_ROW_REMOVED,console.warn("AG Grid: Since version 11, event renderedRowRemoved and rowRemoved is now called "+li.EVENT_VIRTUAL_ROW_REMOVED)),M.prototype.removeEventListener.call(this,h,g)},f.prototype.destroyFirstPass=function(){this.active=!1,this.setupRemoveAnimation();var h=this.createRowEvent(li.EVENT_VIRTUAL_ROW_REMOVED);this.dispatchEvent(h),this.beans.eventService.dispatchEvent(h),M.prototype.destroy.call(this)},f.prototype.setupRemoveAnimation=function(){var h=this.rowNode.rowTop!=null;if(h){var g=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(g)}else this.allRowGuis.forEach(function(x){return x.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0)})},f.prototype.destroySecondPass=function(){this.allRowGuis.length=0;var h=function(g){return g.list.forEach(function(x){return x.destroy()}),{list:[],map:{}}};this.centerCellCtrls=h(this.centerCellCtrls),this.leftCellCtrls=h(this.leftCellCtrls),this.rightCellCtrls=h(this.rightCellCtrls)},f.prototype.setFocusedClasses=function(){var h=this;this.allRowGuis.forEach(function(g){g.rowComp.addOrRemoveCssClass("ag-row-focus",h.rowFocused),g.rowComp.addOrRemoveCssClass("ag-row-no-focus",!h.rowFocused)})},f.prototype.onCellFocusChanged=function(){var h=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);h!==this.rowFocused&&(this.rowFocused=h,this.setFocusedClasses()),!h&&this.editingRow&&this.stopEditing(!1)},f.prototype.onPaginationChanged=function(){var h=this.beans.paginationProxy.getCurrentPage();this.paginationPage!==h&&(this.paginationPage=h,this.onTopChanged()),this.refreshFirstAndLastRowStyles()},f.prototype.onTopChanged=function(){this.setRowTop(this.rowNode.rowTop)},f.prototype.onPaginationPixelOffsetChanged=function(){this.onTopChanged()},f.prototype.applyPaginationOffset=function(h,g){if(g===void 0&&(g=!1),this.rowNode.isRowPinned())return h;var x=this.beans.paginationProxy.getPixelOffset(),P=g?1:-1;return h+x*P},f.prototype.setRowTop=function(h){if(!this.printLayout&&i(h)){var g=this.applyPaginationOffset(h),x=this.rowNode.isRowPinned()?g:this.beans.rowContainerHeightService.getRealPixelPosition(g),P=x+"px";this.setRowTopStyle(P)}},f.prototype.getInitialRowTop=function(){return this.initialTop},f.prototype.getInitialTransform=function(){return this.initialTransform},f.prototype.setInitialRowTop=function(){if(this.printLayout)return"";var h=this.slideRowIn?this.roundRowTopToBounds(this.rowNode.oldRowTop):this.rowNode.rowTop,g=this.applyPaginationOffset(h),x=this.rowNode.isRowPinned()?g:this.beans.rowContainerHeightService.getRealPixelPosition(g),P=x+"px",z=this.beans.gridOptionsWrapper.isSuppressRowTransform();z?this.initialTop=P:this.initialTransform="translateY("+P+")"},f.prototype.setRowTopStyle=function(h){var g=this.beans.gridOptionsWrapper.isSuppressRowTransform();this.allRowGuis.forEach(function(x){return g?x.rowComp.setTop(h):x.rowComp.setTransform("translateY("+h+")")})},f.prototype.getRowNode=function(){return this.rowNode},f.prototype.getCellCtrl=function(h){var g=null;return this.getAllCellCtrls().forEach(function(x){x.getColumn()==h&&(g=x)}),g!=null||this.getAllCellCtrls().forEach(function(x){x.getColSpanningList().indexOf(h)>=0&&(g=x)}),g},f.prototype.onRowIndexChanged=function(){this.rowNode.rowIndex!=null&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())},f.prototype.updateRowIndexes=function(){var h=this.rowNode.getRowIndexString(),g=this.beans.headerNavigationService.getHeaderRowCount(),x=this.rowNode.rowIndex%2===0,P=g+this.rowNode.rowIndex+1;this.allRowGuis.forEach(function(z){z.rowComp.setRowIndex(h),z.rowComp.addOrRemoveCssClass("ag-row-even",x),z.rowComp.addOrRemoveCssClass("ag-row-odd",!x),Gl(z.element,P)})},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}($i);/** + */var cie=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),hie=function(M,f){var d=typeof Symbol=="function"&&M[Symbol.iterator];if(!d)return M;var g=d.call(M),S,O=[],z;try{for(;(f===void 0||f-- >0)&&!(S=g.next()).done;)O.push(S.value)}catch(te){z={error:te}}finally{try{S&&!S.done&&(d=g.return)&&d.call(g)}finally{if(z)throw z.error}}return O},dc=function(){for(var M=[],f=0;f=0;return ni?O:S}return S},f.prototype.setAnimateFlags=function(d){if(d){var g=i(this.rowNode.oldRowTop);this.slideRowIn=g,this.fadeRowIn=!g}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!==Vd.Normal},f.prototype.getRowType=function(){return this.rowType},f.prototype.refreshFullWidth=function(){var d=this,g=function(Ue,ut){if(!Ue)return!0;var Mt=Ue.rowComp.getFullWidthCellRenderer();if(!Mt||!Mt.refresh)return!1;var ni=d.createFullWidthParams(Ue.element,ut),Si=Mt.refresh(ni);return Si},S=g(this.fullWidthGui,null),O=g(this.centerGui,null),z=g(this.leftGui,$e.PINNED_LEFT),te=g(this.rightGui,$e.PINNED_RIGHT),Fe=S&&O&&z&&te;return Fe},f.prototype.addListeners=function(){this.addManagedListener(this.rowNode,li.EVENT_HEIGHT_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.rowNode,li.EVENT_ROW_SELECTED,this.onRowSelected.bind(this)),this.addManagedListener(this.rowNode,li.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this)),this.addManagedListener(this.rowNode,li.EVENT_TOP_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(this.rowNode,li.EVENT_EXPANDED_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,li.EVENT_HAS_CHILDREN_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,li.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,li.EVENT_CELL_CHANGED,this.onRowNodeCellChanged.bind(this)),this.addManagedListener(this.rowNode,li.EVENT_HIGHLIGHT_CHANGED,this.onRowNodeHighlightChanged.bind(this)),this.addManagedListener(this.rowNode,li.EVENT_DRAGGING_CHANGED,this.onRowNodeDraggingChanged.bind(this)),this.addManagedListener(this.rowNode,li.EVENT_UI_LEVEL_CHANGED,this.onUiLevelChanged.bind(this));var d=this.beans.eventService;this.addManagedListener(d,ui.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,this.onPaginationPixelOffsetChanged.bind(this)),this.addManagedListener(d,ui.EVENT_HEIGHT_SCALE_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(d,ui.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(d,ui.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(d,ui.EVENT_CELL_FOCUSED,this.onCellFocusChanged.bind(this)),this.addManagedListener(d,ui.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),this.addManagedListener(d,ui.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedListener(d,ui.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,li.EVENT_ROW_INDEX_CHANGED,function(){d.getAllCellCtrls().forEach(function(g){return g.onRowIndexChanged()})}),this.addManagedListener(this.rowNode,li.EVENT_CELL_CHANGED,function(g){d.getAllCellCtrls().forEach(function(S){return S.onCellChanged(g)})})},f.prototype.onRowNodeDataChanged=function(d){this.getAllCellCtrls().forEach(function(g){return g.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(g){var S=d===t.RowHighlightPosition.Above,O=d===t.RowHighlightPosition.Below;g.rowComp.addOrRemoveCssClass("ag-row-highlight-above",S),g.rowComp.addOrRemoveCssClass("ag-row-highlight-below",O)})},f.prototype.onRowNodeDraggingChanged=function(){this.postProcessRowDragging()},f.prototype.postProcessRowDragging=function(){var d=this.rowNode.dragging;this.allRowGuis.forEach(function(g){return g.rowComp.addOrRemoveCssClass("ag-row-dragging",d)})},f.prototype.updateExpandedCss=function(){var d=this.rowNode.isExpandable(),g=this.rowNode.expanded==!0;this.allRowGuis.forEach(function(S){S.rowComp.addOrRemoveCssClass("ag-row-group",d),S.rowComp.addOrRemoveCssClass("ag-row-group-expanded",d&&g),S.rowComp.addOrRemoveCssClass("ag-row-group-contracted",d&&!g),Oo(S.element,d&&g)})},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 g=this.allRowGuis.find(function(Ue){return Ue.element.contains(d.target)}),S=g?g.element:null,O=S===d.target;if(O){var z=this.rowNode,te=this.beans.focusService.getFocusedCell(),Fe={rowIndex:z.rowIndex,rowPinned:z.rowPinned,column:te&&te.column};this.beans.navigationService.navigateToNextCell(d,d.key,Fe,!0),d.preventDefault()}},f.prototype.onTabKeyDown=function(d){if(!(d.defaultPrevented||tr(d))){var g=this.allRowGuis.find(function(te){return te.element.contains(d.target)}),S=g?g.element:null,O=S===d.target,z=null;O||(z=this.beans.focusService.findNextFocusableElement(S,!1,d.shiftKey)),(this.isFullWidth()&&O||!z)&&this.beans.navigationService.onTabKeyDown(this,d)}},f.prototype.onFullWidthRowFocused=function(d){var g,S=this.rowNode,O=this.isFullWidth()&&d.rowIndex===S.rowIndex&&d.rowPinned==S.rowPinned,z=this.fullWidthGui?this.fullWidthGui.element:(g=this.centerGui)===null||g===void 0?void 0:g.element;z&&(z.classList.toggle("ag-full-width-focus",O),O&&z.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,g){var S={list:[],map:{}};return d.list.forEach(function(O){O!==g&&(S.list.push(O),S.map[O.getInstanceId()]=O)}),S},f.prototype.onMouseEvent=function(d,g){switch(d){case"dblclick":this.onRowDblClick(g);break;case"click":this.onRowClick(g);break;case"touchstart":case"mousedown":this.onRowMouseDown(g);break}},f.prototype.createRowEvent=function(d,g){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:g}},f.prototype.createRowEventWithSource=function(d,g){var S=this.createRowEvent(d,g);return S.source=this,S},f.prototype.onRowDblClick=function(d){if(!tr(d)){var g=this.createRowEventWithSource(ui.EVENT_ROW_DOUBLE_CLICKED,d);this.beans.eventService.dispatchEvent(g)}},f.prototype.onRowMouseDown=function(d){if(this.lastMouseDownOnDragger=pi(d.target,"ag-row-drag",3),!!this.isFullWidth()){var g=this.rowNode,S=this.beans.columnModel;this.beans.focusService.setFocusedCell(g.rowIndex,S.getAllDisplayedColumns()[0],g.rowPinned,!0)}},f.prototype.onRowClick=function(d){var g=tr(d)||this.lastMouseDownOnDragger;if(!g){var S=this.createRowEventWithSource(ui.EVENT_ROW_CLICKED,d);this.beans.eventService.dispatchEvent(S);var O=d.ctrlKey||d.metaKey,z=d.shiftKey,te=this.beans.gridOptionsWrapper.isGroupSelectsChildren();if(!(te&&this.rowNode.group||!this.rowNode.selectable||this.rowNode.rowPinned||!this.beans.gridOptionsWrapper.isRowSelection()||this.beans.gridOptionsWrapper.isSuppressRowClickSelection())){var Fe=this.beans.gridOptionsWrapper.isRowMultiSelectWithClick(),Ue=!this.beans.gridOptionsWrapper.isSuppressRowDeselection();if(this.rowNode.isSelected())Fe?this.rowNode.setSelectedParams({newValue:!1}):O?Ue&&this.rowNode.setSelectedParams({newValue:!1}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!z,rangeSelect:z});else{var ut=Fe?!1:!O;this.rowNode.setSelectedParams({newValue:!0,clearSelection:ut,rangeSelect:z})}}}},f.prototype.setupDetailRowAutoHeight=function(d){var g=this;if(this.rowType===Vd.FullWidthDetail&&this.beans.gridOptionsWrapper.isDetailRowAutoHeight()){var S=function(){var z=d.clientHeight;if(z!=null&&z>0){var te=function(){g.rowNode.setRowHeight(z),g.beans.clientSideRowModel?g.beans.clientSideRowModel.onRowHeightChanged():g.beans.serverSideRowModel&&g.beans.serverSideRowModel.onRowHeightChanged()};g.beans.frameworkOverrides.setTimeout(te,0)}},O=this.beans.resizeObserverService.observeResize(d,S);this.addDestroyFunc(O),S()}},f.prototype.createFullWidthParams=function(d,g){var S=this,O={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:g,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:function(z,te,Fe,Ue){return S.addFullWidthRowDragging(z,te,Fe,Ue)}};return O},f.prototype.addFullWidthRowDragging=function(d,g,S,O){if(S===void 0&&(S=""),!!this.isFullWidth()){var z=new OI(function(){return S},this.rowNode,void 0,d,g,O);this.createManagedBean(z,this.beans.context)}},f.prototype.onUiLevelChanged=function(){var d=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=d){var g="ag-row-level-"+d,S="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(function(O){O.rowComp.addOrRemoveCssClass(g,!0),O.rowComp.addOrRemoveCssClass(S,!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(),g=this.isLastRowOnPage();this.firstRowOnPage!==d&&(this.firstRowOnPage=d,this.allRowGuis.forEach(function(S){return S.rowComp.addOrRemoveCssClass("ag-row-first",d)})),this.lastRowOnPage!==g&&(this.lastRowOnPage=g,this.allRowGuis.forEach(function(S){return S.rowComp.addOrRemoveCssClass("ag-row-last",g)}))},f.prototype.stopEditing=function(d){d===void 0&&(d=!1);var g=this.getAllCellCtrls().map(function(O){return O.stopEditing(d)});if(this.editingRow){if(!d&&g.some(function(O){return O})){var S=this.createRowEvent(ui.EVENT_ROW_VALUE_CHANGED);this.beans.eventService.dispatchEvent(S)}this.setEditingRow(!1)}},f.prototype.setInlineEditingCss=function(d){this.allRowGuis.forEach(function(g){g.rowComp.addOrRemoveCssClass("ag-row-inline-editing",d),g.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!d)})},f.prototype.setEditingRow=function(d){this.editingRow=d,this.allRowGuis.forEach(function(S){return S.rowComp.addOrRemoveCssClass("ag-row-editing",d)});var g=d?this.createRowEvent(ui.EVENT_ROW_EDITING_STARTED):this.createRowEvent(ui.EVENT_ROW_EDITING_STOPPED);this.beans.eventService.dispatchEvent(g)},f.prototype.startRowEditing=function(d,g,S,O){d===void 0&&(d=null),g===void 0&&(g=null),S===void 0&&(S=null),O===void 0&&(O=null),!this.editingRow&&(this.getAllCellCtrls().forEach(function(z){var te=z===S;te?z.startEditing(d,g,te,O):z.startEditing(null,null,te,O)}),this.setEditingRow(!0))},f.prototype.getAllCellCtrls=function(){var d=dc(this.centerCellCtrls.list,this.leftCellCtrls.list,this.rightCellCtrls.list);return d},f.prototype.postProcessClassesFromGridOptions=function(){var d=this,g=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);!g||!g.length||g.forEach(function(S){d.allRowGuis.forEach(function(O){return O.rowComp.addOrRemoveCssClass(S,!0)})})},f.prototype.postProcessRowClassRules=function(){var d=this;this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,function(g){d.allRowGuis.forEach(function(S){return S.rowComp.addOrRemoveCssClass(g,!0)})},function(g){d.allRowGuis.forEach(function(S){return S.rowComp.addOrRemoveCssClass(g,!1)})})},f.prototype.setStylesFromGridOptions=function(){var d=this.processStylesFromGridOptions();this.allRowGuis.forEach(function(g){return g.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 g=d===t.RowContainerType.LEFT?$e.PINNED_LEFT:d===t.RowContainerType.RIGHT?$e.PINNED_RIGHT:null;return g},f.prototype.getInitialRowClasses=function(d){var g=this.getPinnedForContainer(d),S={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:g};return this.beans.rowCssClassCalculator.getInitialRowClasses(S)},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 g=this.beans.gridOptionsWrapper.getRowStyleFunc(),S;if(g){var O={data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex};S=g(O)}return Object.assign({},d,S)},f.prototype.onRowSelected=function(){var d=this,g=!!this.rowNode.isSelected();this.allRowGuis.forEach(function(S){S.rowComp.addOrRemoveCssClass("ag-row-selected",g),Il(S.element,g?!0:void 0);var O=d.createAriaLabel();Jn(S.element,O??"")})},f.prototype.createAriaLabel=function(){var d=this.rowNode.isSelected();if(!(d&&this.beans.gridOptionsWrapper.isSuppressRowDeselection())){var g=this.beans.gridOptionsWrapper.getLocaleTextFunc(),S=g(d?"ariaRowDeselect":"ariaRowSelect","Press SPACE to "+(d?"deselect":"select")+" this row.");return S}},f.prototype.isUseAnimationFrameForCreate=function(){return this.useAnimationFrameForCreate},f.prototype.addHoverFunctionality=function(d){var g=this;this.active&&(this.addManagedListener(d,"mouseenter",function(){return g.rowNode.onMouseEnter()}),this.addManagedListener(d,"mouseleave",function(){return g.rowNode.onMouseLeave()}),this.addManagedListener(this.rowNode,li.EVENT_MOUSE_ENTER,function(){g.beans.gridOptionsWrapper.isSuppressRowHoverHighlight()||d.classList.add("ag-row-hover")}),this.addManagedListener(this.rowNode,li.EVENT_MOUSE_LEAVE,function(){d.classList.remove("ag-row-hover")}))},f.prototype.roundRowTopToBounds=function(d){var g=this.beans.ctrlsService.getGridBodyCtrl(),S=g.getScrollFeature().getVScrollPosition(),O=this.applyPaginationOffset(S.top,!0)-100,z=this.applyPaginationOffset(S.bottom,!0)+100;return Math.min(Math.max(O,d),z)},f.prototype.getFrameworkOverrides=function(){return this.beans.frameworkOverrides},f.prototype.onRowHeightChanged=function(){if(this.rowNode.rowHeight!=null){var d=this.rowNode.rowHeight,g=this.beans.gridOptionsWrapper.getDefaultRowHeight(),S=this.beans.gridOptionsWrapper.isGetRowHeightFunction(),O=S?this.beans.gridOptionsWrapper.getRowHeightForNode(this.rowNode).height:void 0,z=O?Math.min(g,O)-2+"px":void 0;this.allRowGuis.forEach(function(te){te.element.style.height=d+"px",z&&te.element.style.setProperty("--ag-line-height",z)})}},f.prototype.addEventListener=function(d,g){(d==="renderedRowRemoved"||d==="rowRemoved")&&(d=ui.EVENT_VIRTUAL_ROW_REMOVED,console.warn("AG Grid: Since version 11, event renderedRowRemoved is now called "+ui.EVENT_VIRTUAL_ROW_REMOVED)),M.prototype.addEventListener.call(this,d,g)},f.prototype.removeEventListener=function(d,g){(d==="renderedRowRemoved"||d==="rowRemoved")&&(d=ui.EVENT_VIRTUAL_ROW_REMOVED,console.warn("AG Grid: Since version 11, event renderedRowRemoved and rowRemoved is now called "+ui.EVENT_VIRTUAL_ROW_REMOVED)),M.prototype.removeEventListener.call(this,d,g)},f.prototype.destroyFirstPass=function(){this.active=!1,this.setupRemoveAnimation();var d=this.createRowEvent(ui.EVENT_VIRTUAL_ROW_REMOVED);this.dispatchEvent(d),this.beans.eventService.dispatchEvent(d),M.prototype.destroy.call(this)},f.prototype.setupRemoveAnimation=function(){var d=this.rowNode.rowTop!=null;if(d){var g=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(g)}else this.allRowGuis.forEach(function(S){return S.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0)})},f.prototype.destroySecondPass=function(){this.allRowGuis.length=0;var d=function(g){return g.list.forEach(function(S){return S.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(g){g.rowComp.addOrRemoveCssClass("ag-row-focus",d.rowFocused),g.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,g){if(g===void 0&&(g=!1),this.rowNode.isRowPinned())return d;var S=this.beans.paginationProxy.getPixelOffset(),O=g?1:-1;return d+S*O},f.prototype.setRowTop=function(d){if(!this.printLayout&&i(d)){var g=this.applyPaginationOffset(d),S=this.rowNode.isRowPinned()?g:this.beans.rowContainerHeightService.getRealPixelPosition(g),O=S+"px";this.setRowTopStyle(O)}},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,g=this.applyPaginationOffset(d),S=this.rowNode.isRowPinned()?g:this.beans.rowContainerHeightService.getRealPixelPosition(g),O=S+"px",z=this.beans.gridOptionsWrapper.isSuppressRowTransform();z?this.initialTop=O:this.initialTransform="translateY("+O+")"},f.prototype.setRowTopStyle=function(d){var g=this.beans.gridOptionsWrapper.isSuppressRowTransform();this.allRowGuis.forEach(function(S){return g?S.rowComp.setTop(d):S.rowComp.setTransform("translateY("+d+")")})},f.prototype.getRowNode=function(){return this.rowNode},f.prototype.getCellCtrl=function(d){var g=null;return this.getAllCellCtrls().forEach(function(S){S.getColumn()==d&&(g=S)}),g!=null||this.getAllCellCtrls().forEach(function(S){S.getColSpanningList().indexOf(d)>=0&&(g=S)}),g},f.prototype.onRowIndexChanged=function(){this.rowNode.rowIndex!=null&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())},f.prototype.updateRowIndexes=function(){var d=this.rowNode.getRowIndexString(),g=this.beans.headerNavigationService.getHeaderRowCount(),S=this.rowNode.rowIndex%2===0,O=g+this.rowNode.rowIndex+1;this.allRowGuis.forEach(function(z){z.rowComp.setRowIndex(d),z.rowComp.addOrRemoveCssClass("ag-row-even",S),z.rowComp.addOrRemoveCssClass("ag-row-odd",!S),Kl(z.element,O)})},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}(ji);/** * @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/ * @license MIT - */var $h=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),eg=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},NI=function(M,f){var h=typeof Symbol=="function"&&M[Symbol.iterator];if(!h)return M;var g=h.call(M),x,P=[],z;try{for(;(f===void 0||f-- >0)&&!(x=g.next()).done;)P.push(x.value)}catch(ee){z={error:ee}}finally{try{x&&!x.done&&(h=g.return)&&h.call(g)}finally{if(z)throw z.error}}return P},$I=function(M){$h(f,M);function f(h){var g=M.call(this)||this;return g.element=h,g}return f.prototype.postConstruct=function(){this.addMouseListeners(),this.mockContextMenuForIPad(),this.addKeyboardEvents()},f.prototype.addKeyboardEvents=function(){var h=this,g=["keydown","keypress"];g.forEach(function(x){var P=h.processKeyboardEvent.bind(h,x);h.addManagedListener(h.element,x,P)})},f.prototype.addMouseListeners=function(){var h=this,g=ar("touchstart")?"touchstart":"mousedown",x=["dblclick","contextmenu","mouseover","mouseout","click",g];x.forEach(function(P){var z=h.processMouseEvent.bind(h,P);h.addManagedListener(h.element,P,z)})},f.prototype.processMouseEvent=function(h,g){if(!(!this.mouseEventService.isEventFromThisGrid(g)||er(g))){var x=this.getRowForEvent(g),P=this.mouseEventService.getRenderedCellForEvent(g);h==="contextmenu"?this.handleContextMenuMouseEvent(g,null,x,P):(P&&P.onMouseEvent(h,g),x&&x.onMouseEvent(h,g))}},f.prototype.mockContextMenuForIPad=function(){var h=this;if(nd()){var g=new Fg(this.element),x=function(P){var z=h.getRowForEvent(P.touchEvent),ee=h.mouseEventService.getRenderedCellForEvent(P.touchEvent);h.handleContextMenuMouseEvent(null,P.touchEvent,z,ee)};this.addManagedListener(g,Fg.EVENT_LONG_TAP,x),this.addDestroyFunc(function(){return g.destroy()})}},f.prototype.getRowForEvent=function(h){for(var g=h.target;g;){var x=this.gridOptionsWrapper.getDomData(g,Nx.DOM_DATA_KEY_ROW_CTRL);if(x)return x;g=g.parentElement}return null},f.prototype.handleContextMenuMouseEvent=function(h,g,x,P){var z=x?x.getRowNode():null,ee=P?P.getColumn():null,Me=null;if(ee){var je=h||g;P.dispatchCellContextMenuEvent(je),Me=this.valueService.getValue(ee,z)}var ut=this.ctrlsService.getGridBodyCtrl(),Rt=P?P.getGui():ut.getGridBodyElement();this.contextMenuFactory&&this.contextMenuFactory.onContextMenu(h,g,z,ee,Me,Rt)},f.prototype.processKeyboardEvent=function(h,g){var x=mi(this.gridOptionsWrapper,g,vo.DOM_DATA_KEY_CELL_CTRL),P=mi(this.gridOptionsWrapper,g,Nx.DOM_DATA_KEY_ROW_CTRL);g.defaultPrevented||(x?this.processCellKeyboardEvent(x,h,g):P&&P.isFullWidth()&&this.processFullWidthRowKeyboardEvent(P,h,g))},f.prototype.processCellKeyboardEvent=function(h,g,x){var P=h.getRowNode(),z=h.getColumn(),ee=h.isEditing(),Me=!Ry(this.gridOptionsWrapper,x,P,z,ee);if(Me)switch(g){case"keydown":var je=!ee&&this.navigationService.handlePageScrollingKey(x);je||h.onKeyDown(x),this.doGridOperations(x,h.isEditing());break;case"keypress":h.onKeyPress(x);break}if(g==="keydown"){var ut=h.createEvent(x,li.EVENT_CELL_KEY_DOWN);this.eventService.dispatchEvent(ut)}if(g==="keypress"){var Rt=h.createEvent(x,li.EVENT_CELL_KEY_PRESS);this.eventService.dispatchEvent(Rt)}},f.prototype.processFullWidthRowKeyboardEvent=function(h,g,x){var P=h.getRowNode(),z=this.focusService.getFocusedCell(),ee=z&&z.column,Me=!Ry(this.gridOptionsWrapper,x,P,ee,!1);if(Me){var je=x.key;if(g==="keydown")switch(je){case Nr.UP:case Nr.DOWN:h.onKeyboardNavigate(x);break;case Nr.TAB:h.onTabKeyDown(x)}}if(g==="keydown"){var ut=h.createRowEvent(li.EVENT_CELL_KEY_DOWN,x);this.eventService.dispatchEvent(ut)}if(g==="keypress"){var Rt=h.createRowEvent(li.EVENT_CELL_KEY_PRESS,x);this.eventService.dispatchEvent(Rt)}},f.prototype.doGridOperations=function(h,g){if(!(!h.ctrlKey&&!h.metaKey)&&!g&&this.mouseEventService.isEventFromThisGrid(h))switch(h.code){case Nr.A:return this.onCtrlAndA(h);case Nr.C:return this.onCtrlAndC(h);case Nr.V:return this.onCtrlAndV();case Nr.D:return this.onCtrlAndD(h);case Nr.Z:return h.shiftKey?this.undoRedoService.redo():this.undoRedoService.undo();case Nr.Y:return this.undoRedoService.redo()}},f.prototype.onCtrlAndA=function(h){var g=this,x=g.pinnedRowModel,P=g.paginationProxy,z=g.rangeService,ee=Ue.PINNED_BOTTOM,Me=Ue.PINNED_TOP;if(z&&P.isRowsToRender()){var je=NI([x.isEmpty(Me),x.isEmpty(ee)],2),ut=je[0],Rt=je[1],Zt=ut?null:Me,vi=void 0,Ci=void 0;Rt?(vi=null,Ci=this.paginationProxy.getRowCount()-1):(vi=ee,Ci=x.getPinnedBottomRowData().length-1);var qi=this.columnModel.getAllDisplayedColumns();if(n(qi))return;z.setCellRange({rowStartIndex:0,rowStartPinned:Zt,rowEndIndex:Ci,rowEndPinned:vi,columnStart:qi[0],columnEnd:m(qi)})}h.preventDefault()},f.prototype.onCtrlAndC=function(h){!this.clipboardService||this.gridOptionsWrapper.isEnableCellTextSelection()||(this.clipboardService.copyToClipboard(),h.preventDefault())},f.prototype.onCtrlAndV=function(){ni.isRegistered(t.ModuleNames.ClipboardModule)&&!this.gridOptionsWrapper.isSuppressClipboardPaste()&&this.clipboardService.pasteFromClipboard()},f.prototype.onCtrlAndD=function(h){ni.isRegistered(t.ModuleNames.ClipboardModule)&&!this.gridOptionsWrapper.isSuppressClipboardPaste()&&this.clipboardService.copyRangeDown(),h.preventDefault()},eg([ce("mouseEventService")],f.prototype,"mouseEventService",void 0),eg([ce("valueService")],f.prototype,"valueService",void 0),eg([Ce("contextMenuFactory")],f.prototype,"contextMenuFactory",void 0),eg([ce("ctrlsService")],f.prototype,"ctrlsService",void 0),eg([ce("navigationService")],f.prototype,"navigationService",void 0),eg([ce("focusService")],f.prototype,"focusService",void 0),eg([ce("undoRedoService")],f.prototype,"undoRedoService",void 0),eg([ce("columnModel")],f.prototype,"columnModel",void 0),eg([ce("paginationProxy")],f.prototype,"paginationProxy",void 0),eg([ce("pinnedRowModel")],f.prototype,"pinnedRowModel",void 0),eg([Ce("rangeService")],f.prototype,"rangeService",void 0),eg([Ce("clipboardService")],f.prototype,"clipboardService",void 0),eg([it],f.prototype,"postConstruct",null),f}($i);/** + */var jh=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),rg=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},kI=function(M,f){var d=typeof Symbol=="function"&&M[Symbol.iterator];if(!d)return M;var g=d.call(M),S,O=[],z;try{for(;(f===void 0||f-- >0)&&!(S=g.next()).done;)O.push(S.value)}catch(te){z={error:te}}finally{try{S&&!S.done&&(d=g.return)&&d.call(g)}finally{if(z)throw z.error}}return O},$I=function(M){jh(f,M);function f(d){var g=M.call(this)||this;return g.element=d,g}return f.prototype.postConstruct=function(){this.addMouseListeners(),this.mockContextMenuForIPad(),this.addKeyboardEvents()},f.prototype.addKeyboardEvents=function(){var d=this,g=["keydown","keypress"];g.forEach(function(S){var O=d.processKeyboardEvent.bind(d,S);d.addManagedListener(d.element,S,O)})},f.prototype.addMouseListeners=function(){var d=this,g=cr("touchstart")?"touchstart":"mousedown",S=["dblclick","contextmenu","mouseover","mouseout","click",g];S.forEach(function(O){var z=d.processMouseEvent.bind(d,O);d.addManagedListener(d.element,O,z)})},f.prototype.processMouseEvent=function(d,g){if(!(!this.mouseEventService.isEventFromThisGrid(g)||tr(g))){var S=this.getRowForEvent(g),O=this.mouseEventService.getRenderedCellForEvent(g);d==="contextmenu"?this.handleContextMenuMouseEvent(g,null,S,O):(O&&O.onMouseEvent(d,g),S&&S.onMouseEvent(d,g))}},f.prototype.mockContextMenuForIPad=function(){var d=this;if(ud()){var g=new $g(this.element),S=function(O){var z=d.getRowForEvent(O.touchEvent),te=d.mouseEventService.getRenderedCellForEvent(O.touchEvent);d.handleContextMenuMouseEvent(null,O.touchEvent,z,te)};this.addManagedListener(g,$g.EVENT_LONG_TAP,S),this.addDestroyFunc(function(){return g.destroy()})}},f.prototype.getRowForEvent=function(d){for(var g=d.target;g;){var S=this.gridOptionsWrapper.getDomData(g,$x.DOM_DATA_KEY_ROW_CTRL);if(S)return S;g=g.parentElement}return null},f.prototype.handleContextMenuMouseEvent=function(d,g,S,O){var z=S?S.getRowNode():null,te=O?O.getColumn():null,Fe=null;if(te){var Ue=d||g;O.dispatchCellContextMenuEvent(Ue),Fe=this.valueService.getValue(te,z)}var ut=this.ctrlsService.getGridBodyCtrl(),Mt=O?O.getGui():ut.getGridBodyElement();this.contextMenuFactory&&this.contextMenuFactory.onContextMenu(d,g,z,te,Fe,Mt)},f.prototype.processKeyboardEvent=function(d,g){var S=wi(this.gridOptionsWrapper,g,Ro.DOM_DATA_KEY_CELL_CTRL),O=wi(this.gridOptionsWrapper,g,$x.DOM_DATA_KEY_ROW_CTRL);g.defaultPrevented||(S?this.processCellKeyboardEvent(S,d,g):O&&O.isFullWidth()&&this.processFullWidthRowKeyboardEvent(O,d,g))},f.prototype.processCellKeyboardEvent=function(d,g,S){var O=d.getRowNode(),z=d.getColumn(),te=d.isEditing(),Fe=!My(this.gridOptionsWrapper,S,O,z,te);if(Fe)switch(g){case"keydown":var Ue=!te&&this.navigationService.handlePageScrollingKey(S);Ue||d.onKeyDown(S),this.doGridOperations(S,d.isEditing());break;case"keypress":d.onKeyPress(S);break}if(g==="keydown"){var ut=d.createEvent(S,ui.EVENT_CELL_KEY_DOWN);this.eventService.dispatchEvent(ut)}if(g==="keypress"){var Mt=d.createEvent(S,ui.EVENT_CELL_KEY_PRESS);this.eventService.dispatchEvent(Mt)}},f.prototype.processFullWidthRowKeyboardEvent=function(d,g,S){var O=d.getRowNode(),z=this.focusService.getFocusedCell(),te=z&&z.column,Fe=!My(this.gridOptionsWrapper,S,O,te,!1);if(Fe){var Ue=S.key;if(g==="keydown")switch(Ue){case Qr.UP:case Qr.DOWN:d.onKeyboardNavigate(S);break;case Qr.TAB:d.onTabKeyDown(S)}}if(g==="keydown"){var ut=d.createRowEvent(ui.EVENT_CELL_KEY_DOWN,S);this.eventService.dispatchEvent(ut)}if(g==="keypress"){var Mt=d.createRowEvent(ui.EVENT_CELL_KEY_PRESS,S);this.eventService.dispatchEvent(Mt)}},f.prototype.doGridOperations=function(d,g){if(!(!d.ctrlKey&&!d.metaKey)&&!g&&this.mouseEventService.isEventFromThisGrid(d))switch(d.code){case Qr.A:return this.onCtrlAndA(d);case Qr.C:return this.onCtrlAndC(d);case Qr.V:return this.onCtrlAndV();case Qr.D:return this.onCtrlAndD(d);case Qr.Z:return d.shiftKey?this.undoRedoService.redo():this.undoRedoService.undo();case Qr.Y:return this.undoRedoService.redo()}},f.prototype.onCtrlAndA=function(d){var g=this,S=g.pinnedRowModel,O=g.paginationProxy,z=g.rangeService,te=$e.PINNED_BOTTOM,Fe=$e.PINNED_TOP;if(z&&O.isRowsToRender()){var Ue=kI([S.isEmpty(Fe),S.isEmpty(te)],2),ut=Ue[0],Mt=Ue[1],ni=ut?null:Fe,Si=void 0,Pi=void 0;Mt?(Si=null,Pi=this.paginationProxy.getRowCount()-1):(Si=te,Pi=S.getPinnedBottomRowData().length-1);var Qi=this.columnModel.getAllDisplayedColumns();if(n(Qi))return;z.setCellRange({rowStartIndex:0,rowStartPinned:ni,rowEndIndex:Pi,rowEndPinned:Si,columnStart:Qi[0],columnEnd:m(Qi)})}d.preventDefault()},f.prototype.onCtrlAndC=function(d){!this.clipboardService||this.gridOptionsWrapper.isEnableCellTextSelection()||(this.clipboardService.copyToClipboard(),d.preventDefault())},f.prototype.onCtrlAndV=function(){Xt.isRegistered(t.ModuleNames.ClipboardModule)&&!this.gridOptionsWrapper.isSuppressClipboardPaste()&&this.clipboardService.pasteFromClipboard()},f.prototype.onCtrlAndD=function(d){Xt.isRegistered(t.ModuleNames.ClipboardModule)&&!this.gridOptionsWrapper.isSuppressClipboardPaste()&&this.clipboardService.copyRangeDown(),d.preventDefault()},rg([pe("mouseEventService")],f.prototype,"mouseEventService",void 0),rg([pe("valueService")],f.prototype,"valueService",void 0),rg([Ae("contextMenuFactory")],f.prototype,"contextMenuFactory",void 0),rg([pe("ctrlsService")],f.prototype,"ctrlsService",void 0),rg([pe("navigationService")],f.prototype,"navigationService",void 0),rg([pe("focusService")],f.prototype,"focusService",void 0),rg([pe("undoRedoService")],f.prototype,"undoRedoService",void 0),rg([pe("columnModel")],f.prototype,"columnModel",void 0),rg([pe("paginationProxy")],f.prototype,"paginationProxy",void 0),rg([pe("pinnedRowModel")],f.prototype,"pinnedRowModel",void 0),rg([Ae("rangeService")],f.prototype,"rangeService",void 0),rg([Ae("clipboardService")],f.prototype,"clipboardService",void 0),rg([ht],f.prototype,"postConstruct",null),f}(ji);/** * @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/ * @license MIT - */var Az=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),G0=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Pz=function(M){Az(f,M);function f(h){var g=M.call(this)||this;return g.centerContainerCtrl=h,g}return f.prototype.postConstruct=function(){var h=this;this.ctrlsService.whenReady(function(){h.gridBodyCtrl=h.ctrlsService.getGridBodyCtrl(),h.listenForResize()}),this.addManagedListener(this.eventService,li.EVENT_SCROLLBAR_WIDTH_CHANGED,this.onScrollbarWidthChanged.bind(this))},f.prototype.listenForResize=function(){var h=this,g=function(){return h.onCenterViewportResized()};this.centerContainerCtrl.registerViewportResizeListener(g),this.gridBodyCtrl.registerBodyViewportResizeListener(g)},f.prototype.onScrollbarWidthChanged=function(){this.checkViewportAndScrolls()},f.prototype.onCenterViewportResized=function(){if(this.centerContainerCtrl.isViewportVisible()){this.checkViewportAndScrolls();var h=this.centerContainerCtrl.getCenterWidth();h!==this.centerWidth&&(this.centerWidth=h,this.columnModel.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0},f.prototype.checkViewportAndScrolls=function(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()},f.prototype.getBodyHeight=function(){return this.bodyHeight},f.prototype.checkBodyHeight=function(){var h=this.gridBodyCtrl.getBodyViewportElement(),g=tf(h);if(this.bodyHeight!==g){this.bodyHeight=g;var x={type:li.EVENT_BODY_HEIGHT_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(x)}},f.prototype.updateScrollVisibleService=function(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)},f.prototype.updateScrollVisibleServiceImpl=function(){var h={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(h),this.gridBodyCtrl.setVerticalScrollPaddingVisible(h.verticalScrollShowing)},f.prototype.isHorizontalScrollShowing=function(){var h=this.gridOptionsWrapper.isAlwaysShowHorizontalScroll();return h||this.centerContainerCtrl.isViewportHScrollShowing()},f.prototype.onHorizontalViewportChanged=function(){var h=this.centerContainerCtrl.getCenterWidth(),g=this.centerContainerCtrl.getViewportScrollLeft();this.columnModel.setViewportPosition(h,g)},G0([ce("ctrlsService")],f.prototype,"ctrlsService",void 0),G0([ce("columnModel")],f.prototype,"columnModel",void 0),G0([ce("scrollVisibleService")],f.prototype,"scrollVisibleService",void 0),G0([ce("columnApi")],f.prototype,"columnApi",void 0),G0([ce("gridApi")],f.prototype,"gridApi",void 0),G0([it],f.prototype,"postConstruct",null),f}($i);/** + */var Az=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),U0=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Pz=function(M){Az(f,M);function f(d){var g=M.call(this)||this;return g.centerContainerCtrl=d,g}return f.prototype.postConstruct=function(){var d=this;this.ctrlsService.whenReady(function(){d.gridBodyCtrl=d.ctrlsService.getGridBodyCtrl(),d.listenForResize()}),this.addManagedListener(this.eventService,ui.EVENT_SCROLLBAR_WIDTH_CHANGED,this.onScrollbarWidthChanged.bind(this))},f.prototype.listenForResize=function(){var d=this,g=function(){return d.onCenterViewportResized()};this.centerContainerCtrl.registerViewportResizeListener(g),this.gridBodyCtrl.registerBodyViewportResizeListener(g)},f.prototype.onScrollbarWidthChanged=function(){this.checkViewportAndScrolls()},f.prototype.onCenterViewportResized=function(){if(this.centerContainerCtrl.isViewportVisible()){this.checkViewportAndScrolls();var d=this.centerContainerCtrl.getCenterWidth();d!==this.centerWidth&&(this.centerWidth=d,this.columnModel.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0},f.prototype.checkViewportAndScrolls=function(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()},f.prototype.getBodyHeight=function(){return this.bodyHeight},f.prototype.checkBodyHeight=function(){var d=this.gridBodyCtrl.getBodyViewportElement(),g=of(d);if(this.bodyHeight!==g){this.bodyHeight=g;var S={type:ui.EVENT_BODY_HEIGHT_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(S)}},f.prototype.updateScrollVisibleService=function(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)},f.prototype.updateScrollVisibleServiceImpl=function(){var d={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(d),this.gridBodyCtrl.setVerticalScrollPaddingVisible(d.verticalScrollShowing)},f.prototype.isHorizontalScrollShowing=function(){var d=this.gridOptionsWrapper.isAlwaysShowHorizontalScroll();return d||this.centerContainerCtrl.isViewportHScrollShowing()},f.prototype.onHorizontalViewportChanged=function(){var d=this.centerContainerCtrl.getCenterWidth(),g=this.centerContainerCtrl.getViewportScrollLeft();this.columnModel.setViewportPosition(d,g)},U0([pe("ctrlsService")],f.prototype,"ctrlsService",void 0),U0([pe("columnModel")],f.prototype,"columnModel",void 0),U0([pe("scrollVisibleService")],f.prototype,"scrollVisibleService",void 0),U0([pe("columnApi")],f.prototype,"columnApi",void 0),U0([pe("gridApi")],f.prototype,"gridApi",void 0),U0([ht],f.prototype,"postConstruct",null),f}(ji);/** * @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/ * @license MIT - */var ove=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),h8=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},d8=function(M){ove(f,M);function f(h){var g=M.call(this)||this;return g.element=h,g}return f.prototype.postConstruct=function(){this.addManagedListener(this.eventService,li.EVENT_LEFT_PINNED_WIDTH_CHANGED,this.onPinnedLeftWidthChanged.bind(this))},f.prototype.onPinnedLeftWidthChanged=function(){var h=this.pinnedWidthService.getPinnedLeftWidth(),g=h>0;dl(this.element,g),g&&qt(this.element,h)},h8([ce("pinnedWidthService")],f.prototype,"pinnedWidthService",void 0),h8([it],f.prototype,"postConstruct",null),f}($i);/** + */var cve=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),u8=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},c8=function(M){cve(f,M);function f(d){var g=M.call(this)||this;return g.element=d,g}return f.prototype.postConstruct=function(){this.addManagedListener(this.eventService,ui.EVENT_LEFT_PINNED_WIDTH_CHANGED,this.onPinnedLeftWidthChanged.bind(this))},f.prototype.onPinnedLeftWidthChanged=function(){var d=this.pinnedWidthService.getPinnedLeftWidth(),g=d>0;wl(this.element,g),g&&Jt(this.element,d)},u8([pe("pinnedWidthService")],f.prototype,"pinnedWidthService",void 0),u8([ht],f.prototype,"postConstruct",null),f}(ji);/** * @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/ * @license MIT - */var Oz=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Rz=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},gie=function(M){Oz(f,M);function f(h){var g=M.call(this)||this;return g.element=h,g}return f.prototype.postConstruct=function(){this.addManagedListener(this.eventService,li.EVENT_RIGHT_PINNED_WIDTH_CHANGED,this.onPinnedRightWidthChanged.bind(this))},f.prototype.onPinnedRightWidthChanged=function(){var h=this.pinnedWidthService.getPinnedRightWidth(),g=h>0;dl(this.element,g),g&&qt(this.element,h)},Rz([ce("pinnedWidthService")],f.prototype,"pinnedWidthService",void 0),Rz([it],f.prototype,"postConstruct",null),f}($i);/** + */var Oz=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Rz=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},pie=function(M){Oz(f,M);function f(d){var g=M.call(this)||this;return g.element=d,g}return f.prototype.postConstruct=function(){this.addManagedListener(this.eventService,ui.EVENT_RIGHT_PINNED_WIDTH_CHANGED,this.onPinnedRightWidthChanged.bind(this))},f.prototype.onPinnedRightWidthChanged=function(){var d=this.pinnedWidthService.getPinnedRightWidth(),g=d>0;wl(this.element,g),g&&Jt(this.element,d)},Rz([pe("pinnedWidthService")],f.prototype,"pinnedWidthService",void 0),Rz([ht],f.prototype,"postConstruct",null),f}(ji);/** * @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/ * @license MIT - */var yie=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Mz=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},p8=function(M){yie(f,M);function f(h,g){var x=M.call(this)||this;return x.eContainer=h,x.eWrapper=g,x}return f.prototype.postConstruct=function(){this.addManagedListener(this.eventService,li.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onHeightChanged.bind(this))},f.prototype.onHeightChanged=function(){var h=this.maxDivHeightScaler.getUiContainerHeight(),g=h!=null?h+"px":"";this.eContainer.style.height=g,this.eWrapper&&(this.eWrapper.style.height=g)},Mz([ce("rowContainerHeightService")],f.prototype,"maxDivHeightScaler",void 0),Mz([it],f.prototype,"postConstruct",null),f}($i);/** + */var fie=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Mz=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},h8=function(M){fie(f,M);function f(d,g){var S=M.call(this)||this;return S.eContainer=d,S.eWrapper=g,S}return f.prototype.postConstruct=function(){this.addManagedListener(this.eventService,ui.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onHeightChanged.bind(this))},f.prototype.onHeightChanged=function(){var d=this.maxDivHeightScaler.getUiContainerHeight(),g=d!=null?d+"px":"";this.eContainer.style.height=g,this.eWrapper&&(this.eWrapper.style.height=g)},Mz([pe("rowContainerHeightService")],f.prototype,"maxDivHeightScaler",void 0),Mz([ht],f.prototype,"postConstruct",null),f}(ji);/** * @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/ * @license MIT - */var vie=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),f8=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},ave=function(M){vie(f,M);function f(h){var g=M.call(this)||this;return g.eContainer=h,g}return f.prototype.postConstruct=function(){var h=this;if(!(!this.gridOptionsWrapper.isEnableRangeSelection()||r(this.rangeService))){var g={dragStartPixels:0,eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)};this.dragService.addDragSource(g),this.addDestroyFunc(function(){return h.dragService.removeDragSource(g)})}},f8([Ce("rangeService")],f.prototype,"rangeService",void 0),f8([ce("dragService")],f.prototype,"dragService",void 0),f8([it],f.prototype,"postConstruct",null),f}($i);/** + */var mie=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),d8=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},hve=function(M){mie(f,M);function f(d){var g=M.call(this)||this;return g.eContainer=d,g}return f.prototype.postConstruct=function(){var d=this;if(!(!this.gridOptionsWrapper.isEnableRangeSelection()||r(this.rangeService))){var g={dragStartPixels:0,eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)};this.dragService.addDragSource(g),this.addDestroyFunc(function(){return d.dragService.removeDragSource(g)})}},d8([Ae("rangeService")],f.prototype,"rangeService",void 0),d8([pe("dragService")],f.prototype,"dragService",void 0),d8([ht],f.prototype,"postConstruct",null),f}(ji);/** * @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/ * @license MIT - */var _ie=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Dz=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},bie=function(M){_ie(f,M);function f(h){var g=M.call(this)||this;return g.callback=h,g}return f.prototype.postConstruct=function(){var h=this.setWidth.bind(this);this.addManagedListener(this.gridOptionsWrapper,Bn.PROP_DOM_LAYOUT,h),this.addManagedListener(this.eventService,li.EVENT_DISPLAYED_COLUMNS_CHANGED,h),this.addManagedListener(this.eventService,li.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,h),this.setWidth()},f.prototype.setWidth=function(){var h=this.columnModel,g=this.gridOptionsWrapper.getDomLayout()===Ue.DOM_LAYOUT_PRINT,x=h.getBodyContainerWidth(),P=h.getDisplayedColumnsLeftWidth(),z=h.getDisplayedColumnsRightWidth(),ee=g?x+P+z:x;this.callback(ee)},Dz([ce("columnModel")],f.prototype,"columnModel",void 0),Dz([it],f.prototype,"postConstruct",null),f}($i);/** + */var gie=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Dz=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},yie=function(M){gie(f,M);function f(d){var g=M.call(this)||this;return g.callback=d,g}return f.prototype.postConstruct=function(){var d=this.setWidth.bind(this);this.addManagedListener(this.gridOptionsWrapper,Zn.PROP_DOM_LAYOUT,d),this.addManagedListener(this.eventService,ui.EVENT_DISPLAYED_COLUMNS_CHANGED,d),this.addManagedListener(this.eventService,ui.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,d),this.setWidth()},f.prototype.setWidth=function(){var d=this.columnModel,g=this.gridOptionsWrapper.getDomLayout()===$e.DOM_LAYOUT_PRINT,S=d.getBodyContainerWidth(),O=d.getDisplayedColumnsLeftWidth(),z=d.getDisplayedColumnsRightWidth(),te=g?S+O+z:S;this.callback(te)},Dz([pe("columnModel")],f.prototype,"columnModel",void 0),Dz([ht],f.prototype,"postConstruct",null),f}(ji);/** * @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/ * @license MIT - */var lve=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),$x=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},m8=function(M,f){var h=typeof Symbol=="function"&&M[Symbol.iterator];if(!h)return M;var g=h.call(M),x,P=[],z;try{for(;(f===void 0||f-- >0)&&!(x=g.next()).done;)P.push(x.value)}catch(ee){z={error:ee}}finally{try{x&&!x.done&&(h=g.return)&&h.call(g)}finally{if(z)throw z.error}}return P},wie=function(){for(var M=[],f=0;f=0&&g()},f.prototype.getContainerElement=function(){return this.eContainer},f.prototype.getViewportSizeFeature=function(){return this.viewportSizeFeature},f.prototype.setComp=function(h,g,x,P){var z=this;this.comp=h,this.eContainer=g,this.eViewport=x,this.eWrapper=P,this.createManagedBean(new $I(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows();var ee=[t.RowContainerName.TOP_CENTER,t.RowContainerName.TOP_LEFT,t.RowContainerName.TOP_RIGHT],Me=[t.RowContainerName.BOTTOM_CENTER,t.RowContainerName.BOTTOM_LEFT,t.RowContainerName.BOTTOM_RIGHT],je=[t.RowContainerName.CENTER,t.RowContainerName.LEFT,t.RowContainerName.RIGHT],ut=wie(ee,Me,je),Rt=[t.RowContainerName.CENTER,t.RowContainerName.LEFT,t.RowContainerName.RIGHT,t.RowContainerName.FULL_WIDTH],Zt=[t.RowContainerName.CENTER,t.RowContainerName.TOP_CENTER,t.RowContainerName.BOTTOM_CENTER],vi=[t.RowContainerName.LEFT,t.RowContainerName.BOTTOM_LEFT,t.RowContainerName.TOP_LEFT],Ci=[t.RowContainerName.RIGHT,t.RowContainerName.BOTTOM_RIGHT,t.RowContainerName.TOP_RIGHT];this.forContainers(vi,function(){return z.createManagedBean(new d8(z.eContainer))}),this.forContainers(Ci,function(){return z.createManagedBean(new gie(z.eContainer))}),this.forContainers(Rt,function(){return z.createManagedBean(new p8(z.eContainer,z.eWrapper))}),this.forContainers(ut,function(){return z.createManagedBean(new ave(z.eContainer))}),this.forContainers(Zt,function(){return z.createManagedBean(new bie(function(qi){return z.comp.setContainerWidth(qi+"px")}))}),this.addListeners(),this.registerWithCtrlsService()},f.prototype.addListeners=function(){var h=this;this.addManagedListener(this.eventService,li.EVENT_SCROLL_VISIBILITY_CHANGED,function(){return h.onScrollVisibilityChanged()}),this.addManagedListener(this.eventService,li.EVENT_DISPLAYED_COLUMNS_CHANGED,function(){return h.onDisplayedColumnsChanged()}),this.addManagedListener(this.eventService,li.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,function(){return h.onDisplayedColumnsWidthChanged()}),this.addManagedListener(this.eventService,li.EVENT_DISPLAYED_ROWS_CHANGED,function(){return h.onDisplayedRowsChanged()}),this.onScrollVisibilityChanged(),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()},f.prototype.listenOnDomOrder=function(){var h=this,g=function(){return h.comp.setDomOrder(h.gridOptionsWrapper.isEnsureDomOrder())};this.addManagedListener(this.gridOptionsWrapper,Bn.PROP_DOM_LAYOUT,g),g()},f.prototype.stopHScrollOnPinnedRows=function(){var h=this;this.forContainers([t.RowContainerName.TOP_CENTER,t.RowContainerName.BOTTOM_CENTER],function(){var g=function(){return h.eViewport.scrollLeft=0};h.addManagedListener(h.eViewport,"scroll",g)})},f.prototype.onDisplayedColumnsChanged=function(){var h=this;this.forContainers([t.RowContainerName.CENTER],function(){return h.onHorizontalViewportChanged()})},f.prototype.onDisplayedColumnsWidthChanged=function(){var h=this;this.forContainers([t.RowContainerName.CENTER],function(){return h.onHorizontalViewportChanged()})},f.prototype.onScrollVisibilityChanged=function(){if(this.name===t.RowContainerName.CENTER){var h=this.scrollVisibleService.isHorizontalScrollShowing(),g=h&&this.gridOptionsWrapper.getScrollbarWidth()||0,x=g==0?"100%":"calc(100% + "+g+"px)";this.comp.setViewportHeight(x)}},f.prototype.addPreventScrollWhileDragging=function(){var h=this,g=function(x){h.dragService.isDragging()&&x.cancelable&&x.preventDefault()};this.eContainer.addEventListener("touchmove",g,{passive:!1}),this.addDestroyFunc(function(){return h.eContainer.removeEventListener("touchmove",g)})},f.prototype.onHorizontalViewportChanged=function(){var h=this.getCenterWidth(),g=this.getCenterViewportScrollLeft();this.columnModel.setViewportPosition(h,g)},f.prototype.getCenterWidth=function(){return Og(this.eViewport)},f.prototype.getCenterViewportScrollLeft=function(){return Xs(this.eViewport,this.enableRtl)},f.prototype.registerViewportResizeListener=function(h){var g=this.resizeObserverService.observeResize(this.eViewport,h);this.addDestroyFunc(function(){return g()})},f.prototype.isViewportVisible=function(){return ih(this.eViewport)},f.prototype.isViewportHScrollShowing=function(){return Py(this.eViewport)},f.prototype.getViewportScrollLeft=function(){return Xs(this.eViewport,this.enableRtl)},f.prototype.isHorizontalScrollShowing=function(){var h=this.gridOptionsWrapper.isAlwaysShowHorizontalScroll();return h||Py(this.eViewport)},f.prototype.getViewportElement=function(){return this.eViewport},f.prototype.setContainerTranslateX=function(h){this.eContainer.style.transform="translateX("+h+"px)"},f.prototype.getHScrollPosition=function(){var h={left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth};return h},f.prototype.setCenterViewportScrollLeft=function(h){Ql(this.eViewport,h,this.enableRtl)},f.prototype.onDisplayedRowsChanged=function(){var h=this,g=this.name===t.RowContainerName.TOP_FULL_WIDTH||this.name===t.RowContainerName.BOTTOM_FULL_WIDTH||this.name===t.RowContainerName.FULL_WIDTH,x=function(ee){var Me=ee.isFullWidth(),je=h.gridOptionsWrapper.getDomLayout()===Ue.DOM_LAYOUT_PRINT,ut=h.embedFullWidthRows||je,Rt=g?!ut&&Me:ut||!Me;return Rt},P=this.getRowCtrls(),z=P.filter(x);this.comp.setRowCtrls(z)},f.prototype.getRowCtrls=function(){switch(this.name){case t.RowContainerName.TOP_CENTER:case t.RowContainerName.TOP_LEFT:case t.RowContainerName.TOP_RIGHT:case t.RowContainerName.TOP_FULL_WIDTH:return this.rowRenderer.getTopRowCtrls();case t.RowContainerName.BOTTOM_CENTER:case t.RowContainerName.BOTTOM_LEFT:case t.RowContainerName.BOTTOM_RIGHT:case t.RowContainerName.BOTTOM_FULL_WIDTH:return this.rowRenderer.getBottomRowCtrls();default:return this.rowRenderer.getRowCtrls()}},$x([ce("scrollVisibleService")],f.prototype,"scrollVisibleService",void 0),$x([ce("dragService")],f.prototype,"dragService",void 0),$x([ce("ctrlsService")],f.prototype,"ctrlsService",void 0),$x([ce("columnModel")],f.prototype,"columnModel",void 0),$x([ce("resizeObserverService")],f.prototype,"resizeObserverService",void 0),$x([ce("rowRenderer")],f.prototype,"rowRenderer",void 0),$x([it],f.prototype,"postConstruct",null),f}($i);/** + */var dve=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Bx=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},p8=function(M,f){var d=typeof Symbol=="function"&&M[Symbol.iterator];if(!d)return M;var g=d.call(M),S,O=[],z;try{for(;(f===void 0||f-- >0)&&!(S=g.next()).done;)O.push(S.value)}catch(te){z={error:te}}finally{try{S&&!S.done&&(d=g.return)&&d.call(g)}finally{if(z)throw z.error}}return O},vie=function(){for(var M=[],f=0;f=0&&g()},f.prototype.getContainerElement=function(){return this.eContainer},f.prototype.getViewportSizeFeature=function(){return this.viewportSizeFeature},f.prototype.setComp=function(d,g,S,O){var z=this;this.comp=d,this.eContainer=g,this.eViewport=S,this.eWrapper=O,this.createManagedBean(new $I(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows();var te=[t.RowContainerName.TOP_CENTER,t.RowContainerName.TOP_LEFT,t.RowContainerName.TOP_RIGHT],Fe=[t.RowContainerName.BOTTOM_CENTER,t.RowContainerName.BOTTOM_LEFT,t.RowContainerName.BOTTOM_RIGHT],Ue=[t.RowContainerName.CENTER,t.RowContainerName.LEFT,t.RowContainerName.RIGHT],ut=vie(te,Fe,Ue),Mt=[t.RowContainerName.CENTER,t.RowContainerName.LEFT,t.RowContainerName.RIGHT,t.RowContainerName.FULL_WIDTH],ni=[t.RowContainerName.CENTER,t.RowContainerName.TOP_CENTER,t.RowContainerName.BOTTOM_CENTER],Si=[t.RowContainerName.LEFT,t.RowContainerName.BOTTOM_LEFT,t.RowContainerName.TOP_LEFT],Pi=[t.RowContainerName.RIGHT,t.RowContainerName.BOTTOM_RIGHT,t.RowContainerName.TOP_RIGHT];this.forContainers(Si,function(){return z.createManagedBean(new c8(z.eContainer))}),this.forContainers(Pi,function(){return z.createManagedBean(new pie(z.eContainer))}),this.forContainers(Mt,function(){return z.createManagedBean(new h8(z.eContainer,z.eWrapper))}),this.forContainers(ut,function(){return z.createManagedBean(new hve(z.eContainer))}),this.forContainers(ni,function(){return z.createManagedBean(new yie(function(Qi){return z.comp.setContainerWidth(Qi+"px")}))}),this.addListeners(),this.registerWithCtrlsService()},f.prototype.addListeners=function(){var d=this;this.addManagedListener(this.eventService,ui.EVENT_SCROLL_VISIBILITY_CHANGED,function(){return d.onScrollVisibilityChanged()}),this.addManagedListener(this.eventService,ui.EVENT_DISPLAYED_COLUMNS_CHANGED,function(){return d.onDisplayedColumnsChanged()}),this.addManagedListener(this.eventService,ui.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,function(){return d.onDisplayedColumnsWidthChanged()}),this.addManagedListener(this.eventService,ui.EVENT_DISPLAYED_ROWS_CHANGED,function(){return d.onDisplayedRowsChanged()}),this.onScrollVisibilityChanged(),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()},f.prototype.listenOnDomOrder=function(){var d=this,g=function(){return d.comp.setDomOrder(d.gridOptionsWrapper.isEnsureDomOrder())};this.addManagedListener(this.gridOptionsWrapper,Zn.PROP_DOM_LAYOUT,g),g()},f.prototype.stopHScrollOnPinnedRows=function(){var d=this;this.forContainers([t.RowContainerName.TOP_CENTER,t.RowContainerName.BOTTOM_CENTER],function(){var g=function(){return d.eViewport.scrollLeft=0};d.addManagedListener(d.eViewport,"scroll",g)})},f.prototype.onDisplayedColumnsChanged=function(){var d=this;this.forContainers([t.RowContainerName.CENTER],function(){return d.onHorizontalViewportChanged()})},f.prototype.onDisplayedColumnsWidthChanged=function(){var d=this;this.forContainers([t.RowContainerName.CENTER],function(){return d.onHorizontalViewportChanged()})},f.prototype.onScrollVisibilityChanged=function(){if(this.name===t.RowContainerName.CENTER){var d=this.scrollVisibleService.isHorizontalScrollShowing(),g=d&&this.gridOptionsWrapper.getScrollbarWidth()||0,S=g==0?"100%":"calc(100% + "+g+"px)";this.comp.setViewportHeight(S)}},f.prototype.addPreventScrollWhileDragging=function(){var d=this,g=function(S){d.dragService.isDragging()&&S.cancelable&&S.preventDefault()};this.eContainer.addEventListener("touchmove",g,{passive:!1}),this.addDestroyFunc(function(){return d.eContainer.removeEventListener("touchmove",g)})},f.prototype.onHorizontalViewportChanged=function(){var d=this.getCenterWidth(),g=this.getCenterViewportScrollLeft();this.columnModel.setViewportPosition(d,g)},f.prototype.getCenterWidth=function(){return Fg(this.eViewport)},f.prototype.getCenterViewportScrollLeft=function(){return lo(this.eViewport,this.enableRtl)},f.prototype.registerViewportResizeListener=function(d){var g=this.resizeObserverService.observeResize(this.eViewport,d);this.addDestroyFunc(function(){return g()})},f.prototype.isViewportVisible=function(){return ah(this.eViewport)},f.prototype.isViewportHScrollShowing=function(){return Oy(this.eViewport)},f.prototype.getViewportScrollLeft=function(){return lo(this.eViewport,this.enableRtl)},f.prototype.isHorizontalScrollShowing=function(){var d=this.gridOptionsWrapper.isAlwaysShowHorizontalScroll();return d||Oy(this.eViewport)},f.prototype.getViewportElement=function(){return this.eViewport},f.prototype.setContainerTranslateX=function(d){this.eContainer.style.transform="translateX("+d+"px)"},f.prototype.getHScrollPosition=function(){var d={left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth};return d},f.prototype.setCenterViewportScrollLeft=function(d){uu(this.eViewport,d,this.enableRtl)},f.prototype.onDisplayedRowsChanged=function(){var d=this,g=this.name===t.RowContainerName.TOP_FULL_WIDTH||this.name===t.RowContainerName.BOTTOM_FULL_WIDTH||this.name===t.RowContainerName.FULL_WIDTH,S=function(te){var Fe=te.isFullWidth(),Ue=d.gridOptionsWrapper.getDomLayout()===$e.DOM_LAYOUT_PRINT,ut=d.embedFullWidthRows||Ue,Mt=g?!ut&&Fe:ut||!Fe;return Mt},O=this.getRowCtrls(),z=O.filter(S);this.comp.setRowCtrls(z)},f.prototype.getRowCtrls=function(){switch(this.name){case t.RowContainerName.TOP_CENTER:case t.RowContainerName.TOP_LEFT:case t.RowContainerName.TOP_RIGHT:case t.RowContainerName.TOP_FULL_WIDTH:return this.rowRenderer.getTopRowCtrls();case t.RowContainerName.BOTTOM_CENTER:case t.RowContainerName.BOTTOM_LEFT:case t.RowContainerName.BOTTOM_RIGHT:case t.RowContainerName.BOTTOM_FULL_WIDTH:return this.rowRenderer.getBottomRowCtrls();default:return this.rowRenderer.getRowCtrls()}},Bx([pe("scrollVisibleService")],f.prototype,"scrollVisibleService",void 0),Bx([pe("dragService")],f.prototype,"dragService",void 0),Bx([pe("ctrlsService")],f.prototype,"ctrlsService",void 0),Bx([pe("columnModel")],f.prototype,"columnModel",void 0),Bx([pe("resizeObserverService")],f.prototype,"resizeObserverService",void 0),Bx([pe("rowRenderer")],f.prototype,"rowRenderer",void 0),Bx([ht],f.prototype,"postConstruct",null),f}(ji);/** * @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/ * @license MIT - */var Sie=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),pC=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Cie=`
+ */var bie=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),hC=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},wie=`
-
`,uve=function(M){Sie(f,M);function f(){return M.call(this,Cie)||this}return f.prototype.init=function(){var h=this,g=function(P,z){var ee=P+"px";z.style.minHeight=ee,z.style.height=ee},x={setRowAnimationCssOnBodyViewport:function(P,z){return h.setRowAnimationCssOnBodyViewport(P,z)},setColumnCount:function(P){return Mh(h.getGui(),P)},setRowCount:function(P){return Ru(h.getGui(),P)},setTopHeight:function(P){return g(P,h.eTop)},setBottomHeight:function(P){return g(P,h.eBottom)},setTopDisplay:function(P){return h.eTop.style.display=P},setBottomDisplay:function(P){return h.eBottom.style.display=P},setColumnMovingCss:function(P,z){return h.addOrRemoveCssClass(ive,z)},updateLayoutClasses:function(P,z){var ee=h.eBodyViewport.classList;ee.toggle(t.LayoutCssClasses.AUTO_HEIGHT,z.autoHeight),ee.toggle(t.LayoutCssClasses.NORMAL,z.normal),ee.toggle(t.LayoutCssClasses.PRINT,z.print),h.addOrRemoveCssClass(t.LayoutCssClasses.AUTO_HEIGHT,z.autoHeight),h.addOrRemoveCssClass(t.LayoutCssClasses.NORMAL,z.normal),h.addOrRemoveCssClass(t.LayoutCssClasses.PRINT,z.print)},setAlwaysVerticalScrollClass:function(P,z){return h.eBodyViewport.classList.toggle(tve,z)},registerBodyViewportResizeListener:function(P){var z=h.resizeObserverService.observeResize(h.eBodyViewport,P);h.addDestroyFunc(function(){return z()})},setPinnedTopBottomOverflowY:function(P){return h.eTop.style.overflowY=h.eBottom.style.overflowY=P},setCellSelectableCss:function(P,z){[h.eTop,h.eBodyViewport,h.eBottom].forEach(function(ee){return ee.classList.toggle(sie,z)})}};this.ctrl=this.createManagedBean(new oie),this.ctrl.setComp(x,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom),(this.rangeService||this.gridOptionsWrapper.isRowSelectionMulti())&&ic(this.getGui(),!0)},f.prototype.setRowAnimationCssOnBodyViewport=function(h,g){var x=this.eBodyViewport.classList;x.toggle(t.RowAnimationCssClasses.ANIMATION_ON,g),x.toggle(t.RowAnimationCssClasses.ANIMATION_OFF,!g)},f.prototype.getFloatingTopBottom=function(){return[this.eTop,this.eBottom]},pC([ce("resizeObserverService")],f.prototype,"resizeObserverService",void 0),pC([Ce("rangeService")],f.prototype,"rangeService",void 0),pC([zr("eBodyViewport")],f.prototype,"eBodyViewport",void 0),pC([zr("eTop")],f.prototype,"eTop",void 0),pC([zr("eBottom")],f.prototype,"eBottom",void 0),pC([zr("gridHeader")],f.prototype,"headerRootComp",void 0),pC([it],f.prototype,"init",null),f}(Sa);/** +
`,pve=function(M){bie(f,M);function f(){return M.call(this,wie)||this}return f.prototype.init=function(){var d=this,g=function(O,z){var te=O+"px";z.style.minHeight=te,z.style.height=te},S={setRowAnimationCssOnBodyViewport:function(O,z){return d.setRowAnimationCssOnBodyViewport(O,z)},setColumnCount:function(O){return Lh(d.getGui(),O)},setRowCount:function(O){return Gu(d.getGui(),O)},setTopHeight:function(O){return g(O,d.eTop)},setBottomHeight:function(O){return g(O,d.eBottom)},setTopDisplay:function(O){return d.eTop.style.display=O},setBottomDisplay:function(O){return d.eBottom.style.display=O},setColumnMovingCss:function(O,z){return d.addOrRemoveCssClass(sve,z)},updateLayoutClasses:function(O,z){var te=d.eBodyViewport.classList;te.toggle(t.LayoutCssClasses.AUTO_HEIGHT,z.autoHeight),te.toggle(t.LayoutCssClasses.NORMAL,z.normal),te.toggle(t.LayoutCssClasses.PRINT,z.print),d.addOrRemoveCssClass(t.LayoutCssClasses.AUTO_HEIGHT,z.autoHeight),d.addOrRemoveCssClass(t.LayoutCssClasses.NORMAL,z.normal),d.addOrRemoveCssClass(t.LayoutCssClasses.PRINT,z.print)},setAlwaysVerticalScrollClass:function(O,z){return d.eBodyViewport.classList.toggle(nve,z)},registerBodyViewportResizeListener:function(O){var z=d.resizeObserverService.observeResize(d.eBodyViewport,O);d.addDestroyFunc(function(){return z()})},setPinnedTopBottomOverflowY:function(O){return d.eTop.style.overflowY=d.eBottom.style.overflowY=O},setCellSelectableCss:function(O,z){[d.eTop,d.eBodyViewport,d.eBottom].forEach(function(te){return te.classList.toggle(nie,z)})}};this.ctrl=this.createManagedBean(new sie),this.ctrl.setComp(S,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom),(this.rangeService||this.gridOptionsWrapper.isRowSelectionMulti())&&cc(this.getGui(),!0)},f.prototype.setRowAnimationCssOnBodyViewport=function(d,g){var S=this.eBodyViewport.classList;S.toggle(t.RowAnimationCssClasses.ANIMATION_ON,g),S.toggle(t.RowAnimationCssClasses.ANIMATION_OFF,!g)},f.prototype.getFloatingTopBottom=function(){return[this.eTop,this.eBottom]},hC([pe("resizeObserverService")],f.prototype,"resizeObserverService",void 0),hC([Ae("rangeService")],f.prototype,"rangeService",void 0),hC([tn("eBodyViewport")],f.prototype,"eBodyViewport",void 0),hC([tn("eTop")],f.prototype,"eTop",void 0),hC([tn("eBottom")],f.prototype,"eBottom",void 0),hC([tn("gridHeader")],f.prototype,"headerRootComp",void 0),hC([ht],f.prototype,"init",null),f}(Ma);/** * @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/ * @license MIT - */var cve=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),j4=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Tie=function(M){cve(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.postConstruct=function(){this.addManagedListener(this.eventService,li.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,li.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this))},f.prototype.onDisplayedColumnsChanged=function(){this.update()},f.prototype.onDisplayedColumnsWidthChanged=function(){this.update()},f.prototype.update=function(){this.updateImpl(),setTimeout(this.updateImpl.bind(this),500)},f.prototype.updateImpl=function(){var h=this.ctrlsService.getCenterRowContainerCtrl();if(h){var g={horizontalScrollShowing:h.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(g)}},f.prototype.setScrollsVisible=function(h){var g=this.horizontalScrollShowing!==h.horizontalScrollShowing||this.verticalScrollShowing!==h.verticalScrollShowing;if(g){this.horizontalScrollShowing=h.horizontalScrollShowing,this.verticalScrollShowing=h.verticalScrollShowing;var x={type:li.EVENT_SCROLL_VISIBILITY_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(x)}},f.prototype.isHorizontalScrollShowing=function(){return this.horizontalScrollShowing},f.prototype.isVerticalScrollShowing=function(){return this.verticalScrollShowing},j4([ce("columnApi")],f.prototype,"columnApi",void 0),j4([ce("gridApi")],f.prototype,"gridApi",void 0),j4([ce("ctrlsService")],f.prototype,"ctrlsService",void 0),j4([it],f.prototype,"postConstruct",null),f=j4([Le("scrollVisibleService")],f),f}($i);/** + */var fve=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),W4=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},xie=function(M){fve(f,M);function f(){return M!==null&&M.apply(this,arguments)||this}return f.prototype.postConstruct=function(){this.addManagedListener(this.eventService,ui.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ui.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this))},f.prototype.onDisplayedColumnsChanged=function(){this.update()},f.prototype.onDisplayedColumnsWidthChanged=function(){this.update()},f.prototype.update=function(){this.updateImpl(),setTimeout(this.updateImpl.bind(this),500)},f.prototype.updateImpl=function(){var d=this.ctrlsService.getCenterRowContainerCtrl();if(d){var g={horizontalScrollShowing:d.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(g)}},f.prototype.setScrollsVisible=function(d){var g=this.horizontalScrollShowing!==d.horizontalScrollShowing||this.verticalScrollShowing!==d.verticalScrollShowing;if(g){this.horizontalScrollShowing=d.horizontalScrollShowing,this.verticalScrollShowing=d.verticalScrollShowing;var S={type:ui.EVENT_SCROLL_VISIBILITY_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(S)}},f.prototype.isHorizontalScrollShowing=function(){return this.horizontalScrollShowing},f.prototype.isVerticalScrollShowing=function(){return this.verticalScrollShowing},W4([pe("columnApi")],f.prototype,"columnApi",void 0),W4([pe("gridApi")],f.prototype,"gridApi",void 0),W4([pe("ctrlsService")],f.prototype,"ctrlsService",void 0),W4([ht],f.prototype,"postConstruct",null),f=W4([Ne("scrollVisibleService")],f),f}(ji);/** * @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/ * @license MIT - */var g8=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),z4=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},y8=function(M){g8(f,M);function f(){var g=M!==null&&M.apply(this,arguments)||this;return g.gridInstanceId=h.gridInstanceSequence.next(),g}h=f,f.prototype.stampTopLevelGridCompWithGridInstance=function(g){g[h.GRID_DOM_KEY]=this.gridInstanceId},f.prototype.getRenderedCellForEvent=function(g){return mi(this.gridOptionsWrapper,g,vo.DOM_DATA_KEY_CELL_CTRL)},f.prototype.isEventFromThisGrid=function(g){var x=this.isElementInThisGrid(g.target);return x},f.prototype.isElementInThisGrid=function(g){for(var x=g;x;){var P=x[h.GRID_DOM_KEY];if(i(P)){var z=P===this.gridInstanceId;return z}x=x.parentElement}return!1},f.prototype.getCellPositionForEvent=function(g){var x=this.getRenderedCellForEvent(g);return x?x.getCellPosition():null},f.prototype.getNormalisedPosition=function(g){var x=this.gridOptionsWrapper.getDomLayout()===Ue.DOM_LAYOUT_NORMAL,P=g,z,ee;if(P.clientX!=null||P.clientY!=null?(z=P.clientX,ee=P.clientY):(z=P.x,ee=P.y),x){var Me=this.ctrlsService.getGridBodyCtrl(),je=Me.getScrollFeature().getVScrollPosition(),ut=Me.getScrollFeature().getHScrollPosition();z+=ut.left,ee+=je.top}return{x:z,y:ee}};var h;return f.gridInstanceSequence=new f1,f.GRID_DOM_KEY="__ag_grid_instance",z4([ce("ctrlsService")],f.prototype,"ctrlsService",void 0),f=h=z4([Le("mouseEventService")],f),f}($i);/** + */var f8=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),q4=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},m8=function(M){f8(f,M);function f(){var g=M!==null&&M.apply(this,arguments)||this;return g.gridInstanceId=d.gridInstanceSequence.next(),g}d=f,f.prototype.stampTopLevelGridCompWithGridInstance=function(g){g[d.GRID_DOM_KEY]=this.gridInstanceId},f.prototype.getRenderedCellForEvent=function(g){return wi(this.gridOptionsWrapper,g,Ro.DOM_DATA_KEY_CELL_CTRL)},f.prototype.isEventFromThisGrid=function(g){var S=this.isElementInThisGrid(g.target);return S},f.prototype.isElementInThisGrid=function(g){for(var S=g;S;){var O=S[d.GRID_DOM_KEY];if(i(O)){var z=O===this.gridInstanceId;return z}S=S.parentElement}return!1},f.prototype.getCellPositionForEvent=function(g){var S=this.getRenderedCellForEvent(g);return S?S.getCellPosition():null},f.prototype.getNormalisedPosition=function(g){var S=this.gridOptionsWrapper.getDomLayout()===$e.DOM_LAYOUT_NORMAL,O=g,z,te;if(O.clientX!=null||O.clientY!=null?(z=O.clientX,te=O.clientY):(z=O.x,te=O.y),S){var Fe=this.ctrlsService.getGridBodyCtrl(),Ue=Fe.getScrollFeature().getVScrollPosition(),ut=Fe.getScrollFeature().getHScrollPosition();z+=ut.left,te+=Ue.top}return{x:z,y:te}};var d;return f.gridInstanceSequence=new v1,f.GRID_DOM_KEY="__ag_grid_instance",q4([pe("ctrlsService")],f.prototype,"ctrlsService",void 0),f=d=q4([Ne("mouseEventService")],f),f}(ji);/** * @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/ * @license MIT - */var Nz=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),I3=function(){return I3=Object.assign||function(M){for(var f,h=1,g=arguments.length;h=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},$z=function(M){Nz(f,M);function f(){var h=M.call(this)||this;return h.onPageDown=Lt(h.onPageDown,100),h.onPageUp=Lt(h.onPageUp,100),h}return f.prototype.postConstruct=function(){var h=this;this.ctrlsService.whenReady(function(g){h.gridBodyCon=g.gridBodyCtrl})},f.prototype.handlePageScrollingKey=function(h){var g=h.key,x=h.altKey,P=h.ctrlKey||h.metaKey,z=!!this.rangeService&&h.shiftKey,ee=this.mouseEventService.getCellPositionForEvent(h);if(!ee)return!1;var Me=!1;switch(g){case Nr.PAGE_HOME:case Nr.PAGE_END:!P&&!x&&(this.onHomeOrEndKey(g),Me=!0);break;case Nr.LEFT:case Nr.RIGHT:case Nr.UP:case Nr.DOWN:P&&!x&&!z&&(this.onCtrlUpDownLeftRight(g,ee),Me=!0);break;case Nr.PAGE_DOWN:!P&&!x&&(this.onPageDown(ee),Me=!0);break;case Nr.PAGE_UP:!P&&!x&&(this.onPageUp(ee),Me=!0);break}return Me&&h.preventDefault(),Me},f.prototype.navigateTo=function(h){var g=h.scrollIndex,x=h.scrollType,P=h.scrollColumn,z=h.focusIndex,ee=h.focusColumn;if(i(P)&&!P.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(P),i(g)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(g,x),this.animationFrameService.flushAllFrames(),this.focusService.setFocusedCell(z,ee,null,!0),this.rangeService){var Me={rowIndex:z,rowPinned:null,column:ee};this.rangeService.setRangeToCell(Me)}},f.prototype.onPageDown=function(h){var g=this.ctrlsService.getGridBodyCtrl(),x=g.getScrollFeature().getVScrollPosition(),P=this.getViewportHeight(),z=this.paginationProxy.getPixelOffset(),ee=x.top+P,Me=this.paginationProxy.getRowIndexAtPixel(ee+z);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(h,Me):this.navigateToNextPage(h,Me)},f.prototype.onPageUp=function(h){var g=this.ctrlsService.getGridBodyCtrl(),x=g.getScrollFeature().getVScrollPosition(),P=this.paginationProxy.getPixelOffset(),z=x.top,ee=this.paginationProxy.getRowIndexAtPixel(z+P);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(h,ee,!0):this.navigateToNextPage(h,ee,!0)},f.prototype.navigateToNextPage=function(h,g,x){x===void 0&&(x=!1);var P,z,ee=this.getViewportHeight(),Me=this.paginationProxy.getPageFirstRow(),je=this.paginationProxy.getPageLastRow(),ut=this.paginationProxy.getPixelOffset(),Rt=this.paginationProxy.getRow(h.rowIndex),Zt=x?((P=Rt)===null||P===void 0?void 0:P.rowHeight)-ee-ut:ee-ut,vi=((z=Rt)===null||z===void 0?void 0:z.rowTop)+Zt,Ci=this.paginationProxy.getRowIndexAtPixel(vi+ut);if(Ci===h.rowIndex){var qi=x?-1:1;g=Ci=h.rowIndex+qi}var hr;x?(hr="bottom",Cije&&(Ci=je),g>je&&(g=je)),this.isRowTallerThanView(Ci)&&(g=Ci,hr="top"),this.navigateTo({scrollIndex:g,scrollType:hr,scrollColumn:null,focusIndex:Ci,focusColumn:h.column})},f.prototype.navigateToNextPageWithAutoHeight=function(h,g,x){var P=this;x===void 0&&(x=!1),this.navigateTo({scrollIndex:g,scrollType:x?"bottom":"top",scrollColumn:null,focusIndex:g,focusColumn:h.column}),setTimeout(function(){var z=P.getNextFocusIndexForAutoHeight(h,x);P.navigateTo({scrollIndex:g,scrollType:x?"bottom":"top",scrollColumn:null,focusIndex:z,focusColumn:h.column})},50)},f.prototype.getNextFocusIndexForAutoHeight=function(h,g){g===void 0&&(g=!1);for(var x,P=g?-1:1,z=this.getViewportHeight(),ee=this.paginationProxy.getPageLastRow(),Me=0,je=h.rowIndex;je>=0&&je<=ee;){var ut=this.paginationProxy.getRow(je);if(ut){var Rt=(x=ut.rowHeight,x??0);if(Me+Rt>z)break;Me+=Rt}je+=P}return Math.max(0,Math.min(je,ee))},f.prototype.getViewportHeight=function(){var h=this.ctrlsService.getGridBodyCtrl(),g=h.getScrollFeature().getVScrollPosition(),x=this.gridOptionsWrapper.getScrollbarWidth(),P=g.bottom-g.top;return this.ctrlsService.getCenterRowContainerCtrl().isHorizontalScrollShowing()&&(P-=x),P},f.prototype.isRowTallerThanView=function(h){var g=this.paginationProxy.getRow(h);if(!g)return!1;var x=g.rowHeight;return typeof x!="number"?!1:x>this.getViewportHeight()},f.prototype.onCtrlUpDownLeftRight=function(h,g){var x=this.cellNavigationService.getNextCellToFocus(h,g,!0),P=x.rowIndex,z=x.column;this.navigateTo({scrollIndex:P,scrollType:null,scrollColumn:z,focusIndex:P,focusColumn:z})},f.prototype.onHomeOrEndKey=function(h){var g=h===Nr.PAGE_HOME,x=this.columnModel.getAllDisplayedColumns(),P=g?x[0]:m(x),z=g?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow();this.navigateTo({scrollIndex:z,scrollType:null,scrollColumn:P,focusIndex:z,focusColumn:P})},f.prototype.onTabKeyDown=function(h,g){var x=g.shiftKey,P=this.tabToNextCellCommon(h,x,g);if(P){g.preventDefault();return}if(x){var z=h.getRowPosition(),ee=z.rowIndex,Me=z.rowPinned,je=Me?ee===0:ee===this.paginationProxy.getPageFirstRow();je&&(g.preventDefault(),this.focusService.focusLastHeader(g))}else h instanceof vo&&h.focusCell(!0),this.focusService.focusNextGridCoreContainer(x)&&g.preventDefault()},f.prototype.tabToNextCell=function(h,g){var x=this.focusService.getFocusedCell();if(!x)return!1;var P=this.getCellByPosition(x);return!P&&(P=this.rowRenderer.getRowByPosition(x),!P||!P.isFullWidth())?!1:this.tabToNextCellCommon(P,h,g)},f.prototype.tabToNextCellCommon=function(h,g,x){var P=h.isEditing();if(!P&&h instanceof vo){var z=h,ee=z.getRowCtrl();ee&&(P=ee.isEditing())}var Me;return P?this.gridOptionsWrapper.isFullRowEdit()?Me=this.moveToNextEditingRow(h,g,x):Me=this.moveToNextEditingCell(h,g,x):Me=this.moveToNextCellNotEditing(h,g),Me||!!this.focusService.getFocusedHeader()},f.prototype.moveToNextEditingCell=function(h,g,x){x===void 0&&(x=null);var P=h.getCellPosition();h.stopEditing();var z=this.findNextCellToFocusOn(P,g,!0);return z==null?!1:(z.startEditing(null,null,!0,x),z.focusCell(!1),!0)},f.prototype.moveToNextEditingRow=function(h,g,x){x===void 0&&(x=null);var P=h.getCellPosition(),z=this.findNextCellToFocusOn(P,g,!0);if(z==null)return!1;var ee=z.getCellPosition(),Me=this.isCellEditable(P),je=this.isCellEditable(ee),ut=ee&&P.rowIndex===ee.rowIndex&&P.rowPinned===ee.rowPinned;if(Me&&h.setFocusOutOnEditor(),!ut){var Rt=h.getRowCtrl();Rt.stopEditing();var Zt=z.getRowCtrl();Zt.startRowEditing(void 0,void 0,void 0,x)}return je?(z.setFocusInOnEditor(),z.focusCell()):z.focusCell(!0),!0},f.prototype.moveToNextCellNotEditing=function(h,g){var x=this.columnModel.getAllDisplayedColumns(),P;h instanceof Nx?P=I3(I3({},h.getRowPosition()),{column:g?x[0]:m(x)}):P=h.getCellPosition();var z=this.findNextCellToFocusOn(P,g,!1);if(z instanceof vo)z.focusCell(!0);else if(z)return this.tryToFocusFullWidthRow(z.getRowPosition(),g);return i(z)},f.prototype.findNextCellToFocusOn=function(h,g,x){for(var P=h;;){h!==P&&(h=P),g||(P=this.getLastCellOfColSpan(P)),P=this.cellNavigationService.getNextTabbedCell(P,g);var z=this.gridOptionsWrapper.getTabToNextCellFunc();if(i(z)){var ee={backwards:g,editing:x,previousCellPosition:h,nextCellPosition:P||null},Me=z(ee);i(Me)?(Me.floating&&(ze(function(){console.warn("AG Grid: tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?")},"no floating in userCell"),Me.rowPinned=Me.floating),P={rowIndex:Me.rowIndex,column:Me.column,rowPinned:Me.rowPinned}):P=null}if(!P)return null;if(P.rowIndex<0){var je=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:je+P.rowIndex,column:P.column}}),null}var ut=this.gridOptionsWrapper.isFullRowEdit();if(x&&!ut){var Rt=this.isCellEditable(P);if(!Rt)continue}this.ensureCellVisible(P);var Zt=this.getCellByPosition(P);if(!Zt){var vi=this.rowRenderer.getRowByPosition(P);if(!vi||!vi.isFullWidth())continue;return vi}if(!Zt.isSuppressNavigable())return this.rangeService&&this.rangeService.setRangeToCell(P),Zt}},f.prototype.isCellEditable=function(h){var g=this.lookupRowNodeForCell(h);return g?h.column.isCellEditable(g):!1},f.prototype.getCellByPosition=function(h){var g=this.rowRenderer.getRowByPosition(h);return g?g.getCellCtrl(h.column):null},f.prototype.lookupRowNodeForCell=function(h){return h.rowPinned===Ue.PINNED_TOP?this.pinnedRowModel.getPinnedTopRow(h.rowIndex):h.rowPinned===Ue.PINNED_BOTTOM?this.pinnedRowModel.getPinnedBottomRow(h.rowIndex):this.paginationProxy.getRow(h.rowIndex)},f.prototype.navigateToNextCell=function(h,g,x,P){for(var z=x,ee=!1;z&&(z===x||!this.isValidNavigateCell(z));)this.gridOptionsWrapper.isEnableRtl()?g===Nr.LEFT&&(z=this.getLastCellOfColSpan(z)):g===Nr.RIGHT&&(z=this.getLastCellOfColSpan(z)),z=this.cellNavigationService.getNextCellToFocus(g,z),ee=r(z);if(ee&&h&&h.key===Nr.UP&&(z={rowIndex:-1,rowPinned:null,column:x.column}),P){var Me=this.gridOptionsWrapper.getNavigateToNextCellFunc();if(i(Me)){var je={key:g,previousCellPosition:x,nextCellPosition:z||null,event:h},ut=Me(je);i(ut)?(ut.floating&&(ze(function(){console.warn("AG Grid: tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?")},"no floating in userCell"),ut.rowPinned=ut.floating),z={rowPinned:ut.rowPinned,rowIndex:ut.rowIndex,column:ut.column}):z=null}}if(z){if(z.rowIndex<0){var Rt=this.headerNavigationService.getHeaderRowCount();this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:Rt+z.rowIndex,column:x.column},event:h||void 0});return}var Zt=this.getNormalisedPosition(z);Zt?this.focusPosition(Zt):this.tryToFocusFullWidthRow(z)}},f.prototype.getNormalisedPosition=function(h){this.ensureCellVisible(h);var g=this.getCellByPosition(h);return g?(h=g.getCellPosition(),this.ensureCellVisible(h),h):null},f.prototype.tryToFocusFullWidthRow=function(h,g){g===void 0&&(g=!1);var x=this.columnModel.getAllDisplayedColumns(),P=this.rowRenderer.getRowByPosition(h);if(!P||!P.isFullWidth())return!1;var z=this.focusService.getFocusedCell(),ee={rowIndex:h.rowIndex,rowPinned:h.rowPinned,column:h.column||(g?m(x):x[0])};this.focusPosition(ee);var Me=z!=null?this.rowPositionUtils.before(ee,z):!1,je={type:li.EVENT_FULL_WIDTH_ROW_FOCUSED,api:this.gridApi,columnApi:this.columnApi,rowIndex:ee.rowIndex,rowPinned:ee.rowPinned,column:ee.column,isFullWidthCell:!0,floating:ee.rowPinned,fromBelow:Me};return this.eventService.dispatchEvent(je),!0},f.prototype.focusPosition=function(h){this.focusService.setFocusedCell(h.rowIndex,h.column,h.rowPinned,!0),this.rangeService&&this.rangeService.setRangeToCell(h)},f.prototype.isValidNavigateCell=function(h){var g=this.rowPositionUtils.getRowNode(h);return!!g},f.prototype.getLastCellOfColSpan=function(h){var g=this.getCellByPosition(h);if(!g)return h;var x=g.getColSpanningList();return x.length===1?h:{rowIndex:h.rowIndex,column:m(x),rowPinned:h.rowPinned}},f.prototype.ensureCellVisible=function(h){r(h.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(h.rowIndex),h.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(h.column),this.gridBodyCon.getScrollFeature().horizontallyScrollHeaderCenterAndFloatingCenter(),this.animationFrameService.flushAllFrames()},pm([ce("columnApi")],f.prototype,"columnApi",void 0),pm([ce("gridApi")],f.prototype,"gridApi",void 0),pm([ce("mouseEventService")],f.prototype,"mouseEventService",void 0),pm([ce("paginationProxy")],f.prototype,"paginationProxy",void 0),pm([ce("focusService")],f.prototype,"focusService",void 0),pm([ce("animationFrameService")],f.prototype,"animationFrameService",void 0),pm([Ce("rangeService")],f.prototype,"rangeService",void 0),pm([ce("columnModel")],f.prototype,"columnModel",void 0),pm([ce("ctrlsService")],f.prototype,"ctrlsService",void 0),pm([ce("rowRenderer")],f.prototype,"rowRenderer",void 0),pm([ce("headerNavigationService")],f.prototype,"headerNavigationService",void 0),pm([ce("rowPositionUtils")],f.prototype,"rowPositionUtils",void 0),pm([ce("cellNavigationService")],f.prototype,"cellNavigationService",void 0),pm([ce("pinnedRowModel")],f.prototype,"pinnedRowModel",void 0),pm([it],f.prototype,"postConstruct",null),f=pm([Le("navigationService")],f),f}($i);/** + */var kz=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),E3=function(){return E3=Object.assign||function(M){for(var f,d=1,g=arguments.length;d=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},$z=function(M){kz(f,M);function f(){var d=M.call(this)||this;return d.onPageDown=Ft(d.onPageDown,100),d.onPageUp=Ft(d.onPageUp,100),d}return f.prototype.postConstruct=function(){var d=this;this.ctrlsService.whenReady(function(g){d.gridBodyCon=g.gridBodyCtrl})},f.prototype.handlePageScrollingKey=function(d){var g=d.key,S=d.altKey,O=d.ctrlKey||d.metaKey,z=!!this.rangeService&&d.shiftKey,te=this.mouseEventService.getCellPositionForEvent(d);if(!te)return!1;var Fe=!1;switch(g){case Qr.PAGE_HOME:case Qr.PAGE_END:!O&&!S&&(this.onHomeOrEndKey(g),Fe=!0);break;case Qr.LEFT:case Qr.RIGHT:case Qr.UP:case Qr.DOWN:O&&!S&&!z&&(this.onCtrlUpDownLeftRight(g,te),Fe=!0);break;case Qr.PAGE_DOWN:!O&&!S&&(this.onPageDown(te),Fe=!0);break;case Qr.PAGE_UP:!O&&!S&&(this.onPageUp(te),Fe=!0);break}return Fe&&d.preventDefault(),Fe},f.prototype.navigateTo=function(d){var g=d.scrollIndex,S=d.scrollType,O=d.scrollColumn,z=d.focusIndex,te=d.focusColumn;if(i(O)&&!O.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(O),i(g)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(g,S),this.animationFrameService.flushAllFrames(),this.focusService.setFocusedCell(z,te,null,!0),this.rangeService){var Fe={rowIndex:z,rowPinned:null,column:te};this.rangeService.setRangeToCell(Fe)}},f.prototype.onPageDown=function(d){var g=this.ctrlsService.getGridBodyCtrl(),S=g.getScrollFeature().getVScrollPosition(),O=this.getViewportHeight(),z=this.paginationProxy.getPixelOffset(),te=S.top+O,Fe=this.paginationProxy.getRowIndexAtPixel(te+z);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(d,Fe):this.navigateToNextPage(d,Fe)},f.prototype.onPageUp=function(d){var g=this.ctrlsService.getGridBodyCtrl(),S=g.getScrollFeature().getVScrollPosition(),O=this.paginationProxy.getPixelOffset(),z=S.top,te=this.paginationProxy.getRowIndexAtPixel(z+O);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(d,te,!0):this.navigateToNextPage(d,te,!0)},f.prototype.navigateToNextPage=function(d,g,S){S===void 0&&(S=!1);var O,z,te=this.getViewportHeight(),Fe=this.paginationProxy.getPageFirstRow(),Ue=this.paginationProxy.getPageLastRow(),ut=this.paginationProxy.getPixelOffset(),Mt=this.paginationProxy.getRow(d.rowIndex),ni=S?((O=Mt)===null||O===void 0?void 0:O.rowHeight)-te-ut:te-ut,Si=((z=Mt)===null||z===void 0?void 0:z.rowTop)+ni,Pi=this.paginationProxy.getRowIndexAtPixel(Si+ut);if(Pi===d.rowIndex){var Qi=S?-1:1;g=Pi=d.rowIndex+Qi}var _r;S?(_r="bottom",PiUe&&(Pi=Ue),g>Ue&&(g=Ue)),this.isRowTallerThanView(Pi)&&(g=Pi,_r="top"),this.navigateTo({scrollIndex:g,scrollType:_r,scrollColumn:null,focusIndex:Pi,focusColumn:d.column})},f.prototype.navigateToNextPageWithAutoHeight=function(d,g,S){var O=this;S===void 0&&(S=!1),this.navigateTo({scrollIndex:g,scrollType:S?"bottom":"top",scrollColumn:null,focusIndex:g,focusColumn:d.column}),setTimeout(function(){var z=O.getNextFocusIndexForAutoHeight(d,S);O.navigateTo({scrollIndex:g,scrollType:S?"bottom":"top",scrollColumn:null,focusIndex:z,focusColumn:d.column})},50)},f.prototype.getNextFocusIndexForAutoHeight=function(d,g){g===void 0&&(g=!1);for(var S,O=g?-1:1,z=this.getViewportHeight(),te=this.paginationProxy.getPageLastRow(),Fe=0,Ue=d.rowIndex;Ue>=0&&Ue<=te;){var ut=this.paginationProxy.getRow(Ue);if(ut){var Mt=(S=ut.rowHeight,S??0);if(Fe+Mt>z)break;Fe+=Mt}Ue+=O}return Math.max(0,Math.min(Ue,te))},f.prototype.getViewportHeight=function(){var d=this.ctrlsService.getGridBodyCtrl(),g=d.getScrollFeature().getVScrollPosition(),S=this.gridOptionsWrapper.getScrollbarWidth(),O=g.bottom-g.top;return this.ctrlsService.getCenterRowContainerCtrl().isHorizontalScrollShowing()&&(O-=S),O},f.prototype.isRowTallerThanView=function(d){var g=this.paginationProxy.getRow(d);if(!g)return!1;var S=g.rowHeight;return typeof S!="number"?!1:S>this.getViewportHeight()},f.prototype.onCtrlUpDownLeftRight=function(d,g){var S=this.cellNavigationService.getNextCellToFocus(d,g,!0),O=S.rowIndex,z=S.column;this.navigateTo({scrollIndex:O,scrollType:null,scrollColumn:z,focusIndex:O,focusColumn:z})},f.prototype.onHomeOrEndKey=function(d){var g=d===Qr.PAGE_HOME,S=this.columnModel.getAllDisplayedColumns(),O=g?S[0]:m(S),z=g?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow();this.navigateTo({scrollIndex:z,scrollType:null,scrollColumn:O,focusIndex:z,focusColumn:O})},f.prototype.onTabKeyDown=function(d,g){var S=g.shiftKey,O=this.tabToNextCellCommon(d,S,g);if(O){g.preventDefault();return}if(S){var z=d.getRowPosition(),te=z.rowIndex,Fe=z.rowPinned,Ue=Fe?te===0:te===this.paginationProxy.getPageFirstRow();Ue&&(g.preventDefault(),this.focusService.focusLastHeader(g))}else d instanceof Ro&&d.focusCell(!0),this.focusService.focusNextGridCoreContainer(S)&&g.preventDefault()},f.prototype.tabToNextCell=function(d,g){var S=this.focusService.getFocusedCell();if(!S)return!1;var O=this.getCellByPosition(S);return!O&&(O=this.rowRenderer.getRowByPosition(S),!O||!O.isFullWidth())?!1:this.tabToNextCellCommon(O,d,g)},f.prototype.tabToNextCellCommon=function(d,g,S){var O=d.isEditing();if(!O&&d instanceof Ro){var z=d,te=z.getRowCtrl();te&&(O=te.isEditing())}var Fe;return O?this.gridOptionsWrapper.isFullRowEdit()?Fe=this.moveToNextEditingRow(d,g,S):Fe=this.moveToNextEditingCell(d,g,S):Fe=this.moveToNextCellNotEditing(d,g),Fe||!!this.focusService.getFocusedHeader()},f.prototype.moveToNextEditingCell=function(d,g,S){S===void 0&&(S=null);var O=d.getCellPosition();d.stopEditing();var z=this.findNextCellToFocusOn(O,g,!0);return z==null?!1:(z.startEditing(null,null,!0,S),z.focusCell(!1),!0)},f.prototype.moveToNextEditingRow=function(d,g,S){S===void 0&&(S=null);var O=d.getCellPosition(),z=this.findNextCellToFocusOn(O,g,!0);if(z==null)return!1;var te=z.getCellPosition(),Fe=this.isCellEditable(O),Ue=this.isCellEditable(te),ut=te&&O.rowIndex===te.rowIndex&&O.rowPinned===te.rowPinned;if(Fe&&d.setFocusOutOnEditor(),!ut){var Mt=d.getRowCtrl();Mt.stopEditing();var ni=z.getRowCtrl();ni.startRowEditing(void 0,void 0,void 0,S)}return Ue?(z.setFocusInOnEditor(),z.focusCell()):z.focusCell(!0),!0},f.prototype.moveToNextCellNotEditing=function(d,g){var S=this.columnModel.getAllDisplayedColumns(),O;d instanceof $x?O=E3(E3({},d.getRowPosition()),{column:g?S[0]:m(S)}):O=d.getCellPosition();var z=this.findNextCellToFocusOn(O,g,!1);if(z instanceof Ro)z.focusCell(!0);else if(z)return this.tryToFocusFullWidthRow(z.getRowPosition(),g);return i(z)},f.prototype.findNextCellToFocusOn=function(d,g,S){for(var O=d;;){d!==O&&(d=O),g||(O=this.getLastCellOfColSpan(O)),O=this.cellNavigationService.getNextTabbedCell(O,g);var z=this.gridOptionsWrapper.getTabToNextCellFunc();if(i(z)){var te={backwards:g,editing:S,previousCellPosition:d,nextCellPosition:O||null},Fe=z(te);i(Fe)?(Fe.floating&&(Ge(function(){console.warn("AG Grid: tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?")},"no floating in userCell"),Fe.rowPinned=Fe.floating),O={rowIndex:Fe.rowIndex,column:Fe.column,rowPinned:Fe.rowPinned}):O=null}if(!O)return null;if(O.rowIndex<0){var Ue=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:Ue+O.rowIndex,column:O.column}}),null}var ut=this.gridOptionsWrapper.isFullRowEdit();if(S&&!ut){var Mt=this.isCellEditable(O);if(!Mt)continue}this.ensureCellVisible(O);var ni=this.getCellByPosition(O);if(!ni){var Si=this.rowRenderer.getRowByPosition(O);if(!Si||!Si.isFullWidth())continue;return Si}if(!ni.isSuppressNavigable())return this.rangeService&&this.rangeService.setRangeToCell(O),ni}},f.prototype.isCellEditable=function(d){var g=this.lookupRowNodeForCell(d);return g?d.column.isCellEditable(g):!1},f.prototype.getCellByPosition=function(d){var g=this.rowRenderer.getRowByPosition(d);return g?g.getCellCtrl(d.column):null},f.prototype.lookupRowNodeForCell=function(d){return d.rowPinned===$e.PINNED_TOP?this.pinnedRowModel.getPinnedTopRow(d.rowIndex):d.rowPinned===$e.PINNED_BOTTOM?this.pinnedRowModel.getPinnedBottomRow(d.rowIndex):this.paginationProxy.getRow(d.rowIndex)},f.prototype.navigateToNextCell=function(d,g,S,O){for(var z=S,te=!1;z&&(z===S||!this.isValidNavigateCell(z));)this.gridOptionsWrapper.isEnableRtl()?g===Qr.LEFT&&(z=this.getLastCellOfColSpan(z)):g===Qr.RIGHT&&(z=this.getLastCellOfColSpan(z)),z=this.cellNavigationService.getNextCellToFocus(g,z),te=r(z);if(te&&d&&d.key===Qr.UP&&(z={rowIndex:-1,rowPinned:null,column:S.column}),O){var Fe=this.gridOptionsWrapper.getNavigateToNextCellFunc();if(i(Fe)){var Ue={key:g,previousCellPosition:S,nextCellPosition:z||null,event:d},ut=Fe(Ue);i(ut)?(ut.floating&&(Ge(function(){console.warn("AG Grid: tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?")},"no floating in userCell"),ut.rowPinned=ut.floating),z={rowPinned:ut.rowPinned,rowIndex:ut.rowIndex,column:ut.column}):z=null}}if(z){if(z.rowIndex<0){var Mt=this.headerNavigationService.getHeaderRowCount();this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:Mt+z.rowIndex,column:S.column},event:d||void 0});return}var ni=this.getNormalisedPosition(z);ni?this.focusPosition(ni):this.tryToFocusFullWidthRow(z)}},f.prototype.getNormalisedPosition=function(d){this.ensureCellVisible(d);var g=this.getCellByPosition(d);return g?(d=g.getCellPosition(),this.ensureCellVisible(d),d):null},f.prototype.tryToFocusFullWidthRow=function(d,g){g===void 0&&(g=!1);var S=this.columnModel.getAllDisplayedColumns(),O=this.rowRenderer.getRowByPosition(d);if(!O||!O.isFullWidth())return!1;var z=this.focusService.getFocusedCell(),te={rowIndex:d.rowIndex,rowPinned:d.rowPinned,column:d.column||(g?m(S):S[0])};this.focusPosition(te);var Fe=z!=null?this.rowPositionUtils.before(te,z):!1,Ue={type:ui.EVENT_FULL_WIDTH_ROW_FOCUSED,api:this.gridApi,columnApi:this.columnApi,rowIndex:te.rowIndex,rowPinned:te.rowPinned,column:te.column,isFullWidthCell:!0,floating:te.rowPinned,fromBelow:Fe};return this.eventService.dispatchEvent(Ue),!0},f.prototype.focusPosition=function(d){this.focusService.setFocusedCell(d.rowIndex,d.column,d.rowPinned,!0),this.rangeService&&this.rangeService.setRangeToCell(d)},f.prototype.isValidNavigateCell=function(d){var g=this.rowPositionUtils.getRowNode(d);return!!g},f.prototype.getLastCellOfColSpan=function(d){var g=this.getCellByPosition(d);if(!g)return d;var S=g.getColSpanningList();return S.length===1?d:{rowIndex:d.rowIndex,column:m(S),rowPinned:d.rowPinned}},f.prototype.ensureCellVisible=function(d){r(d.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(d.rowIndex),d.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(d.column),this.gridBodyCon.getScrollFeature().horizontallyScrollHeaderCenterAndFloatingCenter(),this.animationFrameService.flushAllFrames()},bm([pe("columnApi")],f.prototype,"columnApi",void 0),bm([pe("gridApi")],f.prototype,"gridApi",void 0),bm([pe("mouseEventService")],f.prototype,"mouseEventService",void 0),bm([pe("paginationProxy")],f.prototype,"paginationProxy",void 0),bm([pe("focusService")],f.prototype,"focusService",void 0),bm([pe("animationFrameService")],f.prototype,"animationFrameService",void 0),bm([Ae("rangeService")],f.prototype,"rangeService",void 0),bm([pe("columnModel")],f.prototype,"columnModel",void 0),bm([pe("ctrlsService")],f.prototype,"ctrlsService",void 0),bm([pe("rowRenderer")],f.prototype,"rowRenderer",void 0),bm([pe("headerNavigationService")],f.prototype,"headerNavigationService",void 0),bm([pe("rowPositionUtils")],f.prototype,"rowPositionUtils",void 0),bm([pe("cellNavigationService")],f.prototype,"cellNavigationService",void 0),bm([pe("pinnedRowModel")],f.prototype,"pinnedRowModel",void 0),bm([ht],f.prototype,"postConstruct",null),f=bm([Ne("navigationService")],f),f}(ji);/** * @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/ * @license MIT - */var hve=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),dve=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Bz=function(M){hve(f,M);function f(h){var g=M.call(this,'
')||this;return g.params=h,g}return f.prototype.postConstruct=function(){this.gridOptionsWrapper.setDomData(this.getGui(),f.DOM_KEY_POPUP_EDITOR_WRAPPER,!0),this.addKeyDownListener()},f.prototype.addKeyDownListener=function(){var h=this,g=this.getGui(),x=this.params,P=function(z){Ry(h.gridOptionsWrapper,z,x.node,x.column,!0)||x.onKeyDown(z)};this.addManagedListener(g,"keydown",P)},f.DOM_KEY_POPUP_EDITOR_WRAPPER="popupEditorWrapper",dve([it],f.prototype,"postConstruct",null),f}(rC);/** + */var mve=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),gve=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Bz=function(M){mve(f,M);function f(d){var g=M.call(this,'
')||this;return g.params=d,g}return f.prototype.postConstruct=function(){this.gridOptionsWrapper.setDomData(this.getGui(),f.DOM_KEY_POPUP_EDITOR_WRAPPER,!0),this.addKeyDownListener()},f.prototype.addKeyDownListener=function(){var d=this,g=this.getGui(),S=this.params,O=function(z){My(d.gridOptionsWrapper,z,S.node,S.column,!0)||S.onKeyDown(z)};this.addManagedListener(g,"keydown",O)},f.DOM_KEY_POPUP_EDITOR_WRAPPER="popupEditorWrapper",gve([ht],f.prototype,"postConstruct",null),f}(tC);/** * @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/ * @license MIT - */var a9e=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Gz=function(M){a9e(f,M);function f(h,g,x,P,z){var ee=M.call(this)||this;ee.rendererVersion=0,ee.editorVersion=0,ee.beans=h,ee.column=g.getColumn(),ee.rowNode=g.getRowNode(),ee.rowCtrl=g.getRowCtrl(),ee.eRow=P,ee.setTemplate('
');var Me=ee.getGui();ee.forceWrapper=g.isForceWrapper(),ee.refreshWrapper(!1);var je=function(Rt,Zt,vi){var Ci=vi||Me;Zt!=null&&Zt!=""?Ci.setAttribute(Rt,Zt):Ci.removeAttribute(Rt)},ut={addOrRemoveCssClass:function(Rt,Zt){return ee.addOrRemoveCssClass(Rt,Zt)},setUserStyles:function(Rt){return Tf(Me,Rt)},getFocusableElement:function(){return ee.getFocusableElement()},setTabIndex:function(Rt){return je("tabindex",Rt.toString())},setRole:function(Rt){return tr(Me,Rt)},setColId:function(Rt){return je("col-id",Rt)},setTitle:function(Rt){return je("title",Rt)},setIncludeSelection:function(Rt){return ee.includeSelection=Rt},setIncludeRowDrag:function(Rt){return ee.includeRowDrag=Rt},setIncludeDndSource:function(Rt){return ee.includeDndSource=Rt},setRenderDetails:function(Rt,Zt,vi){return ee.setRenderDetails(Rt,Zt,vi)},setEditDetails:function(Rt,Zt,vi){return ee.setEditDetails(Rt,Zt,vi)},getCellEditor:function(){return ee.cellEditor||null},getCellRenderer:function(){return ee.cellRenderer||null},getParentOfValue:function(){return ee.getParentOfValue()}};return ee.cellCtrl=g,g.setComp(ut,ee.getGui(),ee.eCellWrapper,x,z),ee}return f.prototype.getParentOfValue=function(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()},f.prototype.setRenderDetails=function(h,g,x){var P=this.cellEditor&&!this.cellEditorPopupWrapper;if(!P){this.firstRender=this.firstRender==null;var z=this.refreshWrapper(!1);if(h){var ee=x||z,Me=ee?!1:this.refreshCellRenderer(h);Me||(this.destroyRenderer(),this.createCellRendererInstance(h))}else this.destroyRenderer(),this.insertValueWithoutCellRenderer(g)}},f.prototype.setEditDetails=function(h,g,x){h?this.createCellEditorInstance(h,g,x):this.destroyEditor()},f.prototype.removeControls=function(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)},f.prototype.refreshWrapper=function(h){var g=this.includeRowDrag||this.includeDndSource||this.includeSelection,x=g||this.forceWrapper,P=x&&this.eCellWrapper==null;P&&(this.eCellWrapper=yu(''),this.getGui().appendChild(this.eCellWrapper));var z=!x&&this.eCellWrapper!=null;z&&(th(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!x);var ee=!h&&x,Me=ee&&this.eCellValue==null;Me&&(this.eCellValue=yu(''),this.eCellWrapper.appendChild(this.eCellValue));var je=!ee&&this.eCellValue!=null;je&&(th(this.eCellValue),this.eCellValue=void 0);var ut=P||z||Me||je;return ut&&this.removeControls(),!h&&g&&this.addControls(),ut},f.prototype.addControls=function(){var h=this.eCellValue.id="cell-"+this.getCompId(),g=[];this.includeRowDrag&&this.rowDraggingComp==null&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&this.dndSourceComp==null&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&(this.checkboxSelectionComp==null&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue)),g.push(this.checkboxSelectionComp.getCheckboxId())),g.push(h),tl(this.getGui(),g.join(" "))},f.prototype.createCellEditorInstance=function(h,g,x){var P=this,z=this.editorVersion,ee=h.newAgStackInstance();if(ee){var Me=h.params;ee.then(function(ut){return P.afterCellEditorCreated(z,ut,Me,g,x)});var je=r(this.cellEditor);je&&Me.cellStartedEdit&&this.cellCtrl.focusCell(!0)}},f.prototype.insertValueWithoutCellRenderer=function(h){var g=this.getParentOfValue();Ou(g);var x=h!=null?_t(h):null;x!=null&&(g.innerHTML=x)},f.prototype.destroyEditorAndRenderer=function(){this.destroyRenderer(),this.destroyEditor()},f.prototype.destroyRenderer=function(){var h=this.beans.context;this.cellRenderer=h.destroyBean(this.cellRenderer),th(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++},f.prototype.destroyEditor=function(){var h=this.beans.context;this.hideEditorPopup&&this.hideEditorPopup(),this.hideEditorPopup=void 0,this.cellEditor=h.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=h.destroyBean(this.cellEditorPopupWrapper),th(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++},f.prototype.refreshCellRenderer=function(h){if(this.cellRenderer==null||this.cellRenderer.refresh==null||this.cellRendererClass!==h.componentClass)return!1;var g=this.cellRenderer.refresh(h.params);return g===!0||g===void 0},f.prototype.createCellRendererInstance=function(h){var g=this,x=this.beans.gridOptionsWrapper.isAngularCompileRows(),P=this.beans.gridOptionsWrapper.isSuppressAnimationFrame(),z=!x&&!P,ee=this.rendererVersion,Me=h.componentClass,je=function(){var ut=g.rendererVersion!==ee||!g.isAlive();if(!ut){var Rt=h.newAgStackInstance(),Zt=g.afterCellRendererCreated.bind(g,ee,Me);Rt&&Rt.then(Zt)}};z&&this.firstRender?this.beans.animationFrameService.createTask(je,this.rowNode.rowIndex,"createTasksP2"):je()},f.prototype.getCtrl=function(){return this.cellCtrl},f.prototype.getRowCtrl=function(){return this.rowCtrl},f.prototype.getCellRenderer=function(){return this.cellRenderer},f.prototype.getCellEditor=function(){return this.cellEditor},f.prototype.afterCellRendererCreated=function(h,g,x){var P=!this.isAlive()||h!==this.rendererVersion;if(P){this.beans.context.destroyBean(x);return}if(this.cellRenderer=x,this.cellRendererClass=g,this.cellRendererGui=this.cellRenderer.getGui(),this.cellRendererGui!=null){var z=this.getParentOfValue();Ou(z),z.appendChild(this.cellRendererGui)}},f.prototype.afterCellEditorCreated=function(h,g,x,P,z){var ee=h!==this.editorVersion;if(ee){this.beans.context.destroyBean(g);return}var Me=g.isCancelBeforeStart&&g.isCancelBeforeStart();if(Me){this.beans.context.destroyBean(g),this.cellCtrl.stopEditing();return}if(!g.getGui){console.warn("AG Grid: cellEditor for column "+this.column.getId()+" is missing getGui() method"),this.beans.context.destroyBean(g);return}this.cellEditor=g,this.cellEditorGui=g.getGui();var je=P||g.isPopup!==void 0&&g.isPopup();je?(P||this.cellCtrl.hackSayEditingInPopup(),this.addPopupCellEditor(x,z)):this.addInCellEditor(),g.afterGuiAttached&&g.afterGuiAttached()},f.prototype.addInCellEditor=function(){var h=this.getGui(),g=this.beans.gridOptionsWrapper.getDocument();if(h.contains(g.activeElement)&&h.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui){var x=this.getParentOfValue();x.appendChild(this.cellEditorGui)}},f.prototype.addPopupCellEditor=function(h,g){var x=this;this.beans.gridOptionsWrapper.isFullRowEdit()&&console.warn("AG Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");var P=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(new Bz(h));var z=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&z.appendChild(this.cellEditorGui);var ee=this.beans.popupService,Me=this.beans.gridOptionsWrapper.isStopEditingWhenCellsLoseFocus(),je=g??(P.getPopupPosition?P.getPopupPosition():"over"),ut={column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),ePopup:z,keepWithinBounds:!0},Rt=je==="under"?ee.positionPopupUnderComponent.bind(ee,ut):ee.positionPopupOverComponent.bind(ee,ut),Zt=this.beans.gridOptionsWrapper.getLocaleTextFunc(),vi=ee.addPopup({modal:Me,eChild:z,closeOnEsc:!0,closedCallback:function(){x.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:Rt,ariaLabel:Zt("ariaLabelCellEditor","Cell Editor")});vi&&(this.hideEditorPopup=vi.hideFunc)},f.prototype.detach=function(){this.eRow.removeChild(this.getGui())},f.prototype.destroy=function(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),M.prototype.destroy.call(this)},f.prototype.clearParentOfValue=function(){var h=this.getGui(),g=this.beans.gridOptionsWrapper.getDocument();h.contains(g.activeElement)&&h.focus({preventScroll:!0}),Ou(this.getParentOfValue())},f}(Sa);/** + */var h9e=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Vz=function(M){h9e(f,M);function f(d,g,S,O,z){var te=M.call(this)||this;te.rendererVersion=0,te.editorVersion=0,te.beans=d,te.column=g.getColumn(),te.rowNode=g.getRowNode(),te.rowCtrl=g.getRowCtrl(),te.eRow=O,te.setTemplate('
');var Fe=te.getGui();te.forceWrapper=g.isForceWrapper(),te.refreshWrapper(!1);var Ue=function(Mt,ni,Si){var Pi=Si||Fe;ni!=null&&ni!=""?Pi.setAttribute(Mt,ni):Pi.removeAttribute(Mt)},ut={addOrRemoveCssClass:function(Mt,ni){return te.addOrRemoveCssClass(Mt,ni)},setUserStyles:function(Mt){return Af(Fe,Mt)},getFocusableElement:function(){return te.getFocusableElement()},setTabIndex:function(Mt){return Ue("tabindex",Mt.toString())},setRole:function(Mt){return lr(Fe,Mt)},setColId:function(Mt){return Ue("col-id",Mt)},setTitle:function(Mt){return Ue("title",Mt)},setIncludeSelection:function(Mt){return te.includeSelection=Mt},setIncludeRowDrag:function(Mt){return te.includeRowDrag=Mt},setIncludeDndSource:function(Mt){return te.includeDndSource=Mt},setRenderDetails:function(Mt,ni,Si){return te.setRenderDetails(Mt,ni,Si)},setEditDetails:function(Mt,ni,Si){return te.setEditDetails(Mt,ni,Si)},getCellEditor:function(){return te.cellEditor||null},getCellRenderer:function(){return te.cellRenderer||null},getParentOfValue:function(){return te.getParentOfValue()}};return te.cellCtrl=g,g.setComp(ut,te.getGui(),te.eCellWrapper,S,z),te}return f.prototype.getParentOfValue=function(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()},f.prototype.setRenderDetails=function(d,g,S){var O=this.cellEditor&&!this.cellEditorPopupWrapper;if(!O){this.firstRender=this.firstRender==null;var z=this.refreshWrapper(!1);if(d){var te=S||z,Fe=te?!1:this.refreshCellRenderer(d);Fe||(this.destroyRenderer(),this.createCellRendererInstance(d))}else this.destroyRenderer(),this.insertValueWithoutCellRenderer(g)}},f.prototype.setEditDetails=function(d,g,S){d?this.createCellEditorInstance(d,g,S):this.destroyEditor()},f.prototype.removeControls=function(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)},f.prototype.refreshWrapper=function(d){var g=this.includeRowDrag||this.includeDndSource||this.includeSelection,S=g||this.forceWrapper,O=S&&this.eCellWrapper==null;O&&(this.eCellWrapper=Au(''),this.getGui().appendChild(this.eCellWrapper));var z=!S&&this.eCellWrapper!=null;z&&(oh(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!S);var te=!d&&S,Fe=te&&this.eCellValue==null;Fe&&(this.eCellValue=Au(''),this.eCellWrapper.appendChild(this.eCellValue));var Ue=!te&&this.eCellValue!=null;Ue&&(oh(this.eCellValue),this.eCellValue=void 0);var ut=O||z||Fe||Ue;return ut&&this.removeControls(),!d&&g&&this.addControls(),ut},f.prototype.addControls=function(){var d=this.eCellValue.id="cell-"+this.getCompId(),g=[];this.includeRowDrag&&this.rowDraggingComp==null&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&this.dndSourceComp==null&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&(this.checkboxSelectionComp==null&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue)),g.push(this.checkboxSelectionComp.getCheckboxId())),g.push(d),ul(this.getGui(),g.join(" "))},f.prototype.createCellEditorInstance=function(d,g,S){var O=this,z=this.editorVersion,te=d.newAgStackInstance();if(te){var Fe=d.params;te.then(function(ut){return O.afterCellEditorCreated(z,ut,Fe,g,S)});var Ue=r(this.cellEditor);Ue&&Fe.cellStartedEdit&&this.cellCtrl.focusCell(!0)}},f.prototype.insertValueWithoutCellRenderer=function(d){var g=this.getParentOfValue();ju(g);var S=d!=null?_t(d):null;S!=null&&(g.innerHTML=S)},f.prototype.destroyEditorAndRenderer=function(){this.destroyRenderer(),this.destroyEditor()},f.prototype.destroyRenderer=function(){var d=this.beans.context;this.cellRenderer=d.destroyBean(this.cellRenderer),oh(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++},f.prototype.destroyEditor=function(){var d=this.beans.context;this.hideEditorPopup&&this.hideEditorPopup(),this.hideEditorPopup=void 0,this.cellEditor=d.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=d.destroyBean(this.cellEditorPopupWrapper),oh(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++},f.prototype.refreshCellRenderer=function(d){if(this.cellRenderer==null||this.cellRenderer.refresh==null||this.cellRendererClass!==d.componentClass)return!1;var g=this.cellRenderer.refresh(d.params);return g===!0||g===void 0},f.prototype.createCellRendererInstance=function(d){var g=this,S=this.beans.gridOptionsWrapper.isAngularCompileRows(),O=this.beans.gridOptionsWrapper.isSuppressAnimationFrame(),z=!S&&!O,te=this.rendererVersion,Fe=d.componentClass,Ue=function(){var ut=g.rendererVersion!==te||!g.isAlive();if(!ut){var Mt=d.newAgStackInstance(),ni=g.afterCellRendererCreated.bind(g,te,Fe);Mt&&Mt.then(ni)}};z&&this.firstRender?this.beans.animationFrameService.createTask(Ue,this.rowNode.rowIndex,"createTasksP2"):Ue()},f.prototype.getCtrl=function(){return this.cellCtrl},f.prototype.getRowCtrl=function(){return this.rowCtrl},f.prototype.getCellRenderer=function(){return this.cellRenderer},f.prototype.getCellEditor=function(){return this.cellEditor},f.prototype.afterCellRendererCreated=function(d,g,S){var O=!this.isAlive()||d!==this.rendererVersion;if(O){this.beans.context.destroyBean(S);return}if(this.cellRenderer=S,this.cellRendererClass=g,this.cellRendererGui=this.cellRenderer.getGui(),this.cellRendererGui!=null){var z=this.getParentOfValue();ju(z),z.appendChild(this.cellRendererGui)}},f.prototype.afterCellEditorCreated=function(d,g,S,O,z){var te=d!==this.editorVersion;if(te){this.beans.context.destroyBean(g);return}var Fe=g.isCancelBeforeStart&&g.isCancelBeforeStart();if(Fe){this.beans.context.destroyBean(g),this.cellCtrl.stopEditing();return}if(!g.getGui){console.warn("AG Grid: cellEditor for column "+this.column.getId()+" is missing getGui() method"),this.beans.context.destroyBean(g);return}this.cellEditor=g,this.cellEditorGui=g.getGui();var Ue=O||g.isPopup!==void 0&&g.isPopup();Ue?(O||this.cellCtrl.hackSayEditingInPopup(),this.addPopupCellEditor(S,z)):this.addInCellEditor(),g.afterGuiAttached&&g.afterGuiAttached()},f.prototype.addInCellEditor=function(){var d=this.getGui(),g=this.beans.gridOptionsWrapper.getDocument();if(d.contains(g.activeElement)&&d.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui){var S=this.getParentOfValue();S.appendChild(this.cellEditorGui)}},f.prototype.addPopupCellEditor=function(d,g){var S=this;this.beans.gridOptionsWrapper.isFullRowEdit()&&console.warn("AG Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");var O=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(new Bz(d));var z=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&z.appendChild(this.cellEditorGui);var te=this.beans.popupService,Fe=this.beans.gridOptionsWrapper.isStopEditingWhenCellsLoseFocus(),Ue=g??(O.getPopupPosition?O.getPopupPosition():"over"),ut={column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),ePopup:z,keepWithinBounds:!0},Mt=Ue==="under"?te.positionPopupUnderComponent.bind(te,ut):te.positionPopupOverComponent.bind(te,ut),ni=this.beans.gridOptionsWrapper.getLocaleTextFunc(),Si=te.addPopup({modal:Fe,eChild:z,closeOnEsc:!0,closedCallback:function(){S.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:Mt,ariaLabel:ni("ariaLabelCellEditor","Cell Editor")});Si&&(this.hideEditorPopup=Si.hideFunc)},f.prototype.detach=function(){this.eRow.removeChild(this.getGui())},f.prototype.destroy=function(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),M.prototype.destroy.call(this)},f.prototype.clearParentOfValue=function(){var d=this.getGui(),g=this.beans.gridOptionsWrapper.getDocument();d.contains(g.activeElement)&&d.focus({preventScroll:!0}),ju(this.getParentOfValue())},f}(Ma);/** * @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/ * @license MIT - */var pve=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),fve=function(M){pve(f,M);function f(h,g,x){var P=M.call(this)||this;P.cellComps={},P.beans=g,P.rowCtrl=h,P.setTemplate('
');var z=P.getGui(),ee=z.style,Me={setDomOrder:function(je){return P.domOrder=je},setCellCtrls:function(je){return P.setCellCtrls(je)},showFullWidth:function(je){return P.showFullWidth(je)},getFullWidthCellRenderer:function(){return P.getFullWidthCellRenderer()},addOrRemoveCssClass:function(je,ut){return P.addOrRemoveCssClass(je,ut)},setUserStyles:function(je){return Tf(z,je)},setTop:function(je){return ee.top=je},setTransform:function(je){return ee.transform=je},setRowIndex:function(je){return z.setAttribute("row-index",je)},setRole:function(je){return tr(z,je)},setRowId:function(je){return z.setAttribute("row-id",je)},setRowBusinessKey:function(je){return z.setAttribute("row-business-key",je)},setTabIndex:function(je){return z.setAttribute("tabindex",je.toString())}};return h.setComp(Me,P.getGui(),x),P}return f.prototype.getInitialStyle=function(){var h=this.rowCtrl.getInitialTransform(),g=this.rowCtrl.getInitialRowTop();return h?"transform: "+h:"top: "+g},f.prototype.showFullWidth=function(h){var g=this,x=function(z){if(g.isAlive()){var ee=z.getGui();g.getGui().appendChild(ee),g.rowCtrl.setupDetailRowAutoHeight(ee),g.setFullWidthRowComp(z)}else g.beans.context.destroyBean(z)},P=h.newAgStackInstance();P&&P.then(x)},f.prototype.setCellCtrls=function(h){var g=this,x=Object.assign({},this.cellComps);h.forEach(function(z){var ee=z.getInstanceId(),Me=g.cellComps[ee];Me==null?g.newCellComp(z):x[ee]=null});var P=re(x).filter(function(z){return z!=null});this.destroyCells(P),this.ensureDomOrder(h)},f.prototype.ensureDomOrder=function(h){var g=this;if(this.domOrder){var x=[];h.forEach(function(P){var z=g.cellComps[P.getInstanceId()];z&&x.push(z.getGui())}),Oc(this.getGui(),x)}},f.prototype.newCellComp=function(h){var g=new Gz(this.beans,h,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[h.getInstanceId()]=g,this.getGui().appendChild(g.getGui())},f.prototype.destroy=function(){M.prototype.destroy.call(this),this.destroyAllCells()},f.prototype.destroyAllCells=function(){var h=re(this.cellComps).filter(function(g){return g!=null});this.destroyCells(h)},f.prototype.setFullWidthRowComp=function(h){var g=this;this.fullWidthCellRenderer&&console.error("AG Grid - should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=h,this.addDestroyFunc(function(){g.fullWidthCellRenderer=g.beans.context.destroyBean(g.fullWidthCellRenderer)})},f.prototype.getFullWidthCellRenderer=function(){return this.fullWidthCellRenderer},f.prototype.destroyCells=function(h){var g=this;h.forEach(function(x){if(x){var P=x.getCtrl().getInstanceId();g.cellComps[P]===x&&(x.detach(),x.destroy(),g.cellComps[P]=null)}})},f}(Sa);/** + */var yve=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),vve=function(M){yve(f,M);function f(d,g,S){var O=M.call(this)||this;O.cellComps={},O.beans=g,O.rowCtrl=d,O.setTemplate('
');var z=O.getGui(),te=z.style,Fe={setDomOrder:function(Ue){return O.domOrder=Ue},setCellCtrls:function(Ue){return O.setCellCtrls(Ue)},showFullWidth:function(Ue){return O.showFullWidth(Ue)},getFullWidthCellRenderer:function(){return O.getFullWidthCellRenderer()},addOrRemoveCssClass:function(Ue,ut){return O.addOrRemoveCssClass(Ue,ut)},setUserStyles:function(Ue){return Af(z,Ue)},setTop:function(Ue){return te.top=Ue},setTransform:function(Ue){return te.transform=Ue},setRowIndex:function(Ue){return z.setAttribute("row-index",Ue)},setRole:function(Ue){return lr(z,Ue)},setRowId:function(Ue){return z.setAttribute("row-id",Ue)},setRowBusinessKey:function(Ue){return z.setAttribute("row-business-key",Ue)},setTabIndex:function(Ue){return z.setAttribute("tabindex",Ue.toString())}};return d.setComp(Fe,O.getGui(),S),O}return f.prototype.getInitialStyle=function(){var d=this.rowCtrl.getInitialTransform(),g=this.rowCtrl.getInitialRowTop();return d?"transform: "+d:"top: "+g},f.prototype.showFullWidth=function(d){var g=this,S=function(z){if(g.isAlive()){var te=z.getGui();g.getGui().appendChild(te),g.rowCtrl.setupDetailRowAutoHeight(te),g.setFullWidthRowComp(z)}else g.beans.context.destroyBean(z)},O=d.newAgStackInstance();O&&O.then(S)},f.prototype.setCellCtrls=function(d){var g=this,S=Object.assign({},this.cellComps);d.forEach(function(z){var te=z.getInstanceId(),Fe=g.cellComps[te];Fe==null?g.newCellComp(z):S[te]=null});var O=ie(S).filter(function(z){return z!=null});this.destroyCells(O),this.ensureDomOrder(d)},f.prototype.ensureDomOrder=function(d){var g=this;if(this.domOrder){var S=[];d.forEach(function(O){var z=g.cellComps[O.getInstanceId()];z&&S.push(z.getGui())}),Dc(this.getGui(),S)}},f.prototype.newCellComp=function(d){var g=new Vz(this.beans,d,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[d.getInstanceId()]=g,this.getGui().appendChild(g.getGui())},f.prototype.destroy=function(){M.prototype.destroy.call(this),this.destroyAllCells()},f.prototype.destroyAllCells=function(){var d=ie(this.cellComps).filter(function(g){return g!=null});this.destroyCells(d)},f.prototype.setFullWidthRowComp=function(d){var g=this;this.fullWidthCellRenderer&&console.error("AG Grid - should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=d,this.addDestroyFunc(function(){g.fullWidthCellRenderer=g.beans.context.destroyBean(g.fullWidthCellRenderer)})},f.prototype.getFullWidthCellRenderer=function(){return this.fullWidthCellRenderer},f.prototype.destroyCells=function(d){var g=this;d.forEach(function(S){if(S){var O=S.getCtrl().getInstanceId();g.cellComps[O]===S&&(S.detach(),S.destroy(),g.cellComps[O]=null)}})},f}(Ma);/** * @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/ * @license MIT - */var BI=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Bb=function(){return Bb=Object.assign||function(M){for(var f,h=1,g=arguments.length;h=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P};function Eie(){var M=Sa.elementGettingCreated.getAttribute("name"),f=U4.getRowContainerCssClasses(M),h,g=M===t.RowContainerName.CENTER,x=M===t.RowContainerName.TOP_CENTER||M===t.RowContainerName.BOTTOM_CENTER;return g?h='`:d='
',d}var g8=function(M){BI(f,M);function f(){var d=M.call(this,Sie())||this;return d.rowComps={},d.name=Ma.elementGettingCreated.getAttribute("name"),d.type=Fz(d.name),d}return f.prototype.postConstruct=function(){var d=this,g={setViewportHeight:function(O){return d.eViewport.style.height=O},setRowCtrls:function(O){return d.setRowCtrls(O)},setDomOrder:function(O){d.domOrder=O},setContainerWidth:function(O){return d.eContainer.style.width=O}},S=this.createManagedBean(new H4(this.name));S.setComp(g,this.eContainer,this.eViewport,this.eWrapper)},f.prototype.preDestroy=function(){this.setRowCtrls([])},f.prototype.setRowCtrls=function(d){var g=this,S=Gb({},this.rowComps);this.rowComps={},this.lastPlacedElement=null;var O=function(z){var te=z.getInstanceId(),Fe=S[te];if(Fe)g.rowComps[te]=Fe,delete S[te],g.ensureDomOrder(Fe.getGui());else{var Ue=g.newRowComp(z);g.rowComps[te]=Ue,g.appendRow(Ue.getGui())}};d.forEach(O),ie(S).forEach(function(z){g.eContainer.removeChild(z.getGui()),z.destroy()}),lr(this.eContainer,d.length?"rowgroup":"presentation")},f.prototype.appendRow=function(d){this.domOrder?Zm(this.eContainer,d,this.lastPlacedElement):this.eContainer.appendChild(d),this.lastPlacedElement=d},f.prototype.ensureDomOrder=function(d){this.domOrder&&(Xl(this.eContainer,d,this.lastPlacedElement),this.lastPlacedElement=d)},f.prototype.newRowComp=function(d){H4.getPinned(this.name);var g=new vve(d,this.beans,this.type);return g},Vv([pe("beans")],f.prototype,"beans",void 0),Vv([tn("eViewport")],f.prototype,"eViewport",void 0),Vv([tn("eContainer")],f.prototype,"eContainer",void 0),Vv([tn("eWrapper")],f.prototype,"eWrapper",void 0),Vv([ht],f.prototype,"postConstruct",null),Vv([wt],f.prototype,"preDestroy",null),f}(Ma);/** * @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/ * @license MIT - */var Iie=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Aie=function(){function M(f){this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=f}return M.prototype.onDragEnter=function(f){var h=this;if(this.clearColumnsList(),!this.gridOptionsWrapper.isFunctionsReadOnly()){var g=f.dragItem.columns;g&&g.forEach(function(x){x.isPrimary()&&(x.isAnyFunctionActive()||(x.isAllowValue()?h.columnsToAggregate.push(x):x.isAllowRowGroup()?h.columnsToGroup.push(x):x.isAllowPivot()&&h.columnsToPivot.push(x)))})}},M.prototype.getIconName=function(){var f=this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length;return f>0?this.pinned?Lg.ICON_PINNED:Lg.ICON_MOVE:null},M.prototype.onDragLeave=function(f){this.clearColumnsList()},M.prototype.clearColumnsList=function(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0},M.prototype.onDragging=function(f){},M.prototype.onDragStop=function(f){this.columnsToAggregate.length>0&&this.columnModel.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.columnModel.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.columnModel.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")},Iie([ce("columnModel")],M.prototype,"columnModel",void 0),Iie([ce("gridOptionsWrapper")],M.prototype,"gridOptionsWrapper",void 0),M}();/** + */var Cie=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Tie=function(){function M(f){this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=f}return M.prototype.onDragEnter=function(f){var d=this;if(this.clearColumnsList(),!this.gridOptionsWrapper.isFunctionsReadOnly()){var g=f.dragItem.columns;g&&g.forEach(function(S){S.isPrimary()&&(S.isAnyFunctionActive()||(S.isAllowValue()?d.columnsToAggregate.push(S):S.isAllowRowGroup()?d.columnsToGroup.push(S):S.isAllowPivot()&&d.columnsToPivot.push(S)))})}},M.prototype.getIconName=function(){var f=this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length;return f>0?this.pinned?Bg.ICON_PINNED:Bg.ICON_MOVE:null},M.prototype.onDragLeave=function(f){this.clearColumnsList()},M.prototype.clearColumnsList=function(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0},M.prototype.onDragging=function(f){},M.prototype.onDragStop=function(f){this.columnsToAggregate.length>0&&this.columnModel.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.columnModel.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.columnModel.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")},Cie([pe("columnModel")],M.prototype,"columnModel",void 0),Cie([pe("gridOptionsWrapper")],M.prototype,"gridOptionsWrapper",void 0),M}();/** * @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/ * @license MIT - */var A3=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Pie=function(){function M(f,h){this.needToMoveLeft=!1,this.needToMoveRight=!1,this.pinned=f,this.eContainer=h,this.centerContainer=!i(f)}return M.prototype.init=function(){var f=this;this.ctrlsService.whenReady(function(){f.gridBodyCon=f.ctrlsService.getGridBodyCtrl()})},M.prototype.getIconName=function(){return this.pinned?Lg.ICON_PINNED:Lg.ICON_MOVE},M.prototype.onDragEnter=function(f){var h=f.dragItem.columns,g=f.dragSource.type===t.DragSourceType.ToolPanel;if(g)this.setColumnsVisible(h,!0,"uiColumnDragged");else{var x=f.dragItem.visibleState,P=(h||[]).filter(function(z){return x[z.getId()]});this.setColumnsVisible(P,!0,"uiColumnDragged")}this.setColumnsPinned(h,this.pinned,"uiColumnDragged"),this.onDragging(f,!0)},M.prototype.onDragLeave=function(f){var h=!this.gridOptionsWrapper.isSuppressDragLeaveHidesColumns()&&!f.fromNudge;if(h){var g=f.dragSource.getDragItem(),x=g.columns;this.setColumnsVisible(x,!1,"uiColumnDragged")}this.ensureIntervalCleared()},M.prototype.setColumnsVisible=function(f,h,g){if(g===void 0&&(g="api"),f){var x=f.filter(function(P){return!P.getColDef().lockVisible});this.columnModel.setColumnsVisible(x,h,g)}},M.prototype.setColumnsPinned=function(f,h,g){if(g===void 0&&(g="api"),f){var x=f.filter(function(P){return!P.getColDef().lockPinned});this.columnModel.setColumnsPinned(x,h,g)}},M.prototype.onDragStop=function(){this.ensureIntervalCleared()},M.prototype.normaliseX=function(f){if(this.gridOptionsWrapper.isEnableRtl()){var h=this.eContainer.clientWidth;f=h-f}return this.centerContainer&&(f+=this.ctrlsService.getCenterRowContainerCtrl().getCenterViewportScrollLeft()),f},M.prototype.checkCenterForScrolling=function(f){if(this.centerContainer){var h=this.ctrlsService.getCenterRowContainerCtrl().getCenterViewportScrollLeft(),g=h+this.ctrlsService.getCenterRowContainerCtrl().getCenterWidth();this.gridOptionsWrapper.isEnableRtl()?(this.needToMoveRight=fg-50):(this.needToMoveLeft=fg-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}},M.prototype.onDragging=function(f,h){var g=this;if(h===void 0&&(h=!1),this.lastDraggingEvent=f,!r(f.hDirection)){var x=this.normaliseX(f.x);h||this.checkCenterForScrolling(x);var P=this.normaliseDirection(f.hDirection),z=f.dragSource.type,ee=f.dragSource.getDragItem().columns;ee=ee.filter(function(Me){return Me.getColDef().lockPinned?Me.getPinned()==g.pinned:!0}),this.attemptMoveColumns(z,ee,P,x,h)}},M.prototype.normaliseDirection=function(f){if(this.gridOptionsWrapper.isEnableRtl())switch(f){case t.HorizontalDirection.Left:return t.HorizontalDirection.Right;case t.HorizontalDirection.Right:return t.HorizontalDirection.Left;default:console.error("AG Grid: Unknown direction "+f)}else return f},M.prototype.calculateOldIndex=function(f){var h=this.columnModel.getAllGridColumns(),g=F(f.map(function(Me){return h.indexOf(Me)})),x=g[0],P=m(g),z=P-x,ee=z!==g.length-1;return ee?null:x},M.prototype.attemptMoveColumns=function(f,h,g,x,P){var z=g===t.HorizontalDirection.Left,ee=g===t.HorizontalDirection.Right,Me=h.slice();this.columnModel.sortColumnsLikeGridColumns(Me);var je=this.calculateValidMoves(Me,ee,x),ut=this.calculateOldIndex(Me);if(je.length!==0){var Rt=je[0],Zt=ut!==null&&!P;if(f==t.DragSourceType.HeaderCell&&(Zt=ut!==null),!(Zt&&(z&&Rt>=ut||ee&&Rt<=ut)))for(var vi=0;vi0){for(var vi=0;vi0){var hr=Me[ut-1];qi=je.indexOf(hr)+1}else qi=je.indexOf(Me[0]),qi===-1&&(qi=0);var Rr=[qi],Ar=function(nl,ho){return nl-ho};if(h){for(var Fr=qi+1,Sn=z.length-1;Fr<=Sn;)Rr.push(Fr),Fr++;Rr.sort(Ar)}else{for(var Fr=qi,Sn=z.length-1,Js=z[Fr];Fr<=Sn&&this.isColumnHidden(P,Js);)Fr++,Rr.push(Fr),Js=z[Fr];Fr=qi-1;for(var rl=0;Fr>=rl;)Rr.push(Fr),Fr--;Rr.sort(Ar).reverse()}return Rr},M.prototype.isColumnHidden=function(f,h){return f.indexOf(h)<0},M.prototype.ensureIntervalStarted=function(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.needToMoveLeft?this.dragAndDropService.setGhostIcon(Lg.ICON_LEFT,!0):this.dragAndDropService.setGhostIcon(Lg.ICON_RIGHT,!0))},M.prototype.ensureIntervalCleared=function(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon(Lg.ICON_MOVE))},M.prototype.moveInterval=function(){var f;this.intervalCount++,f=10+this.intervalCount*5,f>100&&(f=100);var h=null,g=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?h=g.scrollHorizontally(-f):this.needToMoveRight&&(h=g.scrollHorizontally(f)),h!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;var x=this.lastDraggingEvent.dragItem.columns,P=x.filter(function(ee){return!ee.getColDef().lockPinned});if(P.length>0&&(this.dragAndDropService.setGhostIcon(Lg.ICON_PINNED),this.failedMoveAttempts>7)){var z=this.needToMoveLeft?Ue.PINNED_LEFT:Ue.PINNED_RIGHT;this.setColumnsPinned(P,z,"uiColumnDragged"),this.dragAndDropService.nudge()}}},A3([ce("columnModel")],M.prototype,"columnModel",void 0),A3([ce("dragAndDropService")],M.prototype,"dragAndDropService",void 0),A3([ce("gridOptionsWrapper")],M.prototype,"gridOptionsWrapper",void 0),A3([ce("ctrlsService")],M.prototype,"ctrlsService",void 0),A3([it],M.prototype,"init",null),M}();/** + */var I3=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Eie=function(){function M(f,d){this.needToMoveLeft=!1,this.needToMoveRight=!1,this.pinned=f,this.eContainer=d,this.centerContainer=!i(f)}return M.prototype.init=function(){var f=this;this.ctrlsService.whenReady(function(){f.gridBodyCon=f.ctrlsService.getGridBodyCtrl()})},M.prototype.getIconName=function(){return this.pinned?Bg.ICON_PINNED:Bg.ICON_MOVE},M.prototype.onDragEnter=function(f){var d=f.dragItem.columns,g=f.dragSource.type===t.DragSourceType.ToolPanel;if(g)this.setColumnsVisible(d,!0,"uiColumnDragged");else{var S=f.dragItem.visibleState,O=(d||[]).filter(function(z){return S[z.getId()]});this.setColumnsVisible(O,!0,"uiColumnDragged")}this.setColumnsPinned(d,this.pinned,"uiColumnDragged"),this.onDragging(f,!0)},M.prototype.onDragLeave=function(f){var d=!this.gridOptionsWrapper.isSuppressDragLeaveHidesColumns()&&!f.fromNudge;if(d){var g=f.dragSource.getDragItem(),S=g.columns;this.setColumnsVisible(S,!1,"uiColumnDragged")}this.ensureIntervalCleared()},M.prototype.setColumnsVisible=function(f,d,g){if(g===void 0&&(g="api"),f){var S=f.filter(function(O){return!O.getColDef().lockVisible});this.columnModel.setColumnsVisible(S,d,g)}},M.prototype.setColumnsPinned=function(f,d,g){if(g===void 0&&(g="api"),f){var S=f.filter(function(O){return!O.getColDef().lockPinned});this.columnModel.setColumnsPinned(S,d,g)}},M.prototype.onDragStop=function(){this.ensureIntervalCleared()},M.prototype.normaliseX=function(f){if(this.gridOptionsWrapper.isEnableRtl()){var d=this.eContainer.clientWidth;f=d-f}return this.centerContainer&&(f+=this.ctrlsService.getCenterRowContainerCtrl().getCenterViewportScrollLeft()),f},M.prototype.checkCenterForScrolling=function(f){if(this.centerContainer){var d=this.ctrlsService.getCenterRowContainerCtrl().getCenterViewportScrollLeft(),g=d+this.ctrlsService.getCenterRowContainerCtrl().getCenterWidth();this.gridOptionsWrapper.isEnableRtl()?(this.needToMoveRight=fg-50):(this.needToMoveLeft=fg-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}},M.prototype.onDragging=function(f,d){var g=this;if(d===void 0&&(d=!1),this.lastDraggingEvent=f,!r(f.hDirection)){var S=this.normaliseX(f.x);d||this.checkCenterForScrolling(S);var O=this.normaliseDirection(f.hDirection),z=f.dragSource.type,te=f.dragSource.getDragItem().columns;te=te.filter(function(Fe){return Fe.getColDef().lockPinned?Fe.getPinned()==g.pinned:!0}),this.attemptMoveColumns(z,te,O,S,d)}},M.prototype.normaliseDirection=function(f){if(this.gridOptionsWrapper.isEnableRtl())switch(f){case t.HorizontalDirection.Left:return t.HorizontalDirection.Right;case t.HorizontalDirection.Right:return t.HorizontalDirection.Left;default:console.error("AG Grid: Unknown direction "+f)}else return f},M.prototype.calculateOldIndex=function(f){var d=this.columnModel.getAllGridColumns(),g=L(f.map(function(Fe){return d.indexOf(Fe)})),S=g[0],O=m(g),z=O-S,te=z!==g.length-1;return te?null:S},M.prototype.attemptMoveColumns=function(f,d,g,S,O){var z=g===t.HorizontalDirection.Left,te=g===t.HorizontalDirection.Right,Fe=d.slice();this.columnModel.sortColumnsLikeGridColumns(Fe);var Ue=this.calculateValidMoves(Fe,te,S),ut=this.calculateOldIndex(Fe);if(Ue.length!==0){var Mt=Ue[0],ni=ut!==null&&!O;if(f==t.DragSourceType.HeaderCell&&(ni=ut!==null),!(ni&&(z&&Mt>=ut||te&&Mt<=ut)))for(var Si=0;Si0){for(var Si=0;Si0){var _r=Fe[ut-1];Qi=Ue.indexOf(_r)+1}else Qi=Ue.indexOf(Fe[0]),Qi===-1&&(Qi=0);var Hr=[Qi],$r=function(dl,Co){return dl-Co};if(d){for(var Yr=Qi+1,kn=z.length-1;Yr<=kn;)Hr.push(Yr),Yr++;Hr.sort($r)}else{for(var Yr=Qi,kn=z.length-1,co=z[Yr];Yr<=kn&&this.isColumnHidden(O,co);)Yr++,Hr.push(Yr),co=z[Yr];Yr=Qi-1;for(var hl=0;Yr>=hl;)Hr.push(Yr),Yr--;Hr.sort($r).reverse()}return Hr},M.prototype.isColumnHidden=function(f,d){return f.indexOf(d)<0},M.prototype.ensureIntervalStarted=function(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.needToMoveLeft?this.dragAndDropService.setGhostIcon(Bg.ICON_LEFT,!0):this.dragAndDropService.setGhostIcon(Bg.ICON_RIGHT,!0))},M.prototype.ensureIntervalCleared=function(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon(Bg.ICON_MOVE))},M.prototype.moveInterval=function(){var f;this.intervalCount++,f=10+this.intervalCount*5,f>100&&(f=100);var d=null,g=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?d=g.scrollHorizontally(-f):this.needToMoveRight&&(d=g.scrollHorizontally(f)),d!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;var S=this.lastDraggingEvent.dragItem.columns,O=S.filter(function(te){return!te.getColDef().lockPinned});if(O.length>0&&(this.dragAndDropService.setGhostIcon(Bg.ICON_PINNED),this.failedMoveAttempts>7)){var z=this.needToMoveLeft?$e.PINNED_LEFT:$e.PINNED_RIGHT;this.setColumnsPinned(O,z,"uiColumnDragged"),this.dragAndDropService.nudge()}}},I3([pe("columnModel")],M.prototype,"columnModel",void 0),I3([pe("dragAndDropService")],M.prototype,"dragAndDropService",void 0),I3([pe("gridOptionsWrapper")],M.prototype,"gridOptionsWrapper",void 0),I3([pe("ctrlsService")],M.prototype,"ctrlsService",void 0),I3([ht],M.prototype,"init",null),M}();/** * @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/ * @license MIT - */var Oie=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),H4=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},_8=function(M){Oie(f,M);function f(h,g){var x=M.call(this)||this;return x.pinned=h,x.eContainer=g,x}return f.prototype.postConstruct=function(){var h=this;this.ctrlsService.whenReady(function(g){switch(h.pinned){case Ue.PINNED_LEFT:h.eSecondaryContainers=[[g.gridBodyCtrl.getBodyViewportElement(),g.leftRowContainerCtrl.getContainerElement()],[g.bottomLeftRowContainerCtrl.getContainerElement()],[g.topLeftRowContainerCtrl.getContainerElement()]];break;case Ue.PINNED_RIGHT:h.eSecondaryContainers=[[g.gridBodyCtrl.getBodyViewportElement(),g.rightRowContainerCtrl.getContainerElement()],[g.bottomRightRowContainerCtrl.getContainerElement()],[g.topRightRowContainerCtrl.getContainerElement()]];break;default:h.eSecondaryContainers=[[g.gridBodyCtrl.getBodyViewportElement(),g.centerRowContainerCtrl.getViewportElement()],[g.bottomCenterRowContainerCtrl.getViewportElement()],[g.topCenterRowContainerCtrl.getViewportElement()]];break}})},f.prototype.isInterestedIn=function(h){return h===t.DragSourceType.HeaderCell||h===t.DragSourceType.ToolPanel&&this.gridOptionsWrapper.isAllowDragFromColumnsToolPanel()},f.prototype.getSecondaryContainers=function(){return this.eSecondaryContainers},f.prototype.getContainer=function(){return this.eContainer},f.prototype.init=function(){this.moveColumnFeature=this.createManagedBean(new Pie(this.pinned,this.eContainer)),this.bodyDropPivotTarget=this.createManagedBean(new Aie(this.pinned)),this.dragAndDropService.addDropTarget(this)},f.prototype.getIconName=function(){return this.currentDropListener.getIconName()},f.prototype.isDropColumnInPivotMode=function(h){return this.columnModel.isPivotMode()&&h.dragSource.type===t.DragSourceType.ToolPanel},f.prototype.onDragEnter=function(h){this.currentDropListener=this.isDropColumnInPivotMode(h)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(h)},f.prototype.onDragLeave=function(h){this.currentDropListener.onDragLeave(h)},f.prototype.onDragging=function(h){this.currentDropListener.onDragging(h)},f.prototype.onDragStop=function(h){this.currentDropListener.onDragStop(h)},H4([ce("dragAndDropService")],f.prototype,"dragAndDropService",void 0),H4([ce("columnModel")],f.prototype,"columnModel",void 0),H4([ce("ctrlsService")],f.prototype,"ctrlsService",void 0),H4([it],f.prototype,"postConstruct",null),H4([it],f.prototype,"init",null),f}($i);/** + */var Iie=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Y4=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},y8=function(M){Iie(f,M);function f(d,g){var S=M.call(this)||this;return S.pinned=d,S.eContainer=g,S}return f.prototype.postConstruct=function(){var d=this;this.ctrlsService.whenReady(function(g){switch(d.pinned){case $e.PINNED_LEFT:d.eSecondaryContainers=[[g.gridBodyCtrl.getBodyViewportElement(),g.leftRowContainerCtrl.getContainerElement()],[g.bottomLeftRowContainerCtrl.getContainerElement()],[g.topLeftRowContainerCtrl.getContainerElement()]];break;case $e.PINNED_RIGHT:d.eSecondaryContainers=[[g.gridBodyCtrl.getBodyViewportElement(),g.rightRowContainerCtrl.getContainerElement()],[g.bottomRightRowContainerCtrl.getContainerElement()],[g.topRightRowContainerCtrl.getContainerElement()]];break;default:d.eSecondaryContainers=[[g.gridBodyCtrl.getBodyViewportElement(),g.centerRowContainerCtrl.getViewportElement()],[g.bottomCenterRowContainerCtrl.getViewportElement()],[g.topCenterRowContainerCtrl.getViewportElement()]];break}})},f.prototype.isInterestedIn=function(d){return d===t.DragSourceType.HeaderCell||d===t.DragSourceType.ToolPanel&&this.gridOptionsWrapper.isAllowDragFromColumnsToolPanel()},f.prototype.getSecondaryContainers=function(){return this.eSecondaryContainers},f.prototype.getContainer=function(){return this.eContainer},f.prototype.init=function(){this.moveColumnFeature=this.createManagedBean(new Eie(this.pinned,this.eContainer)),this.bodyDropPivotTarget=this.createManagedBean(new Tie(this.pinned)),this.dragAndDropService.addDropTarget(this)},f.prototype.getIconName=function(){return this.currentDropListener.getIconName()},f.prototype.isDropColumnInPivotMode=function(d){return this.columnModel.isPivotMode()&&d.dragSource.type===t.DragSourceType.ToolPanel},f.prototype.onDragEnter=function(d){this.currentDropListener=this.isDropColumnInPivotMode(d)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(d)},f.prototype.onDragLeave=function(d){this.currentDropListener.onDragLeave(d)},f.prototype.onDragging=function(d){this.currentDropListener.onDragging(d)},f.prototype.onDragStop=function(d){this.currentDropListener.onDragStop(d)},Y4([pe("dragAndDropService")],f.prototype,"dragAndDropService",void 0),Y4([pe("columnModel")],f.prototype,"columnModel",void 0),Y4([pe("ctrlsService")],f.prototype,"ctrlsService",void 0),Y4([ht],f.prototype,"postConstruct",null),Y4([ht],f.prototype,"init",null),f}(ji);/** * @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/ * @license MIT - */var l9e=function(M,f){var h=typeof Symbol=="function"&&M[Symbol.iterator];if(!h)return M;var g=h.call(M),x,P=[],z;try{for(;(f===void 0||f-- >0)&&!(x=g.next()).done;)P.push(x.value)}catch(ee){z={error:ee}}finally{try{x&&!x.done&&(h=g.return)&&h.call(g)}finally{if(z)throw z.error}}return P},mve=function(){for(var M=[],f=0;f0)&&!(S=g.next()).done;)O.push(S.value)}catch(te){z={error:te}}finally{try{S&&!S.done&&(d=g.return)&&d.call(g)}finally{if(z)throw z.error}}return O},_ve=function(){for(var M=[],f=0;f=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Rie=function(M){b8(f,M);function f(h){var g=M.call(this,f.TEMPLATE,h)||this;return g.headerCompVersion=0,g.column=h.getColumnGroupChild(),g.pinned=h.getPinned(),g}return f.prototype.postConstruct=function(){var h=this,g=this.getGui(),x=function(ee,Me,je){var ut=je||g;Me!=null&&Me!=""?ut.setAttribute(ee,Me):ut.removeAttribute(ee)},P={setWidth:function(ee){return g.style.width=ee},addOrRemoveCssClass:function(ee,Me){return h.addOrRemoveCssClass(ee,Me)},setColId:function(ee){return x("col-id",ee)},setTitle:function(ee){return x("title",ee)},setAriaDescription:function(ee){return Po(g,ee)},setAriaSort:function(ee){return ee?Dh(g,ee):Md(g)},setUserCompDetails:function(ee){return h.setUserCompDetails(ee)},getUserCompInstance:function(){return h.headerComp}};this.ctrl.setComp(P,this.getGui(),this.eResize);var z=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",z)},f.prototype.destroyHeaderComp=function(){this.headerComp&&(this.getGui().removeChild(this.headerCompGui),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)},f.prototype.setUserCompDetails=function(h){var g=this;this.headerCompVersion++;var x=this.headerCompVersion;h.newAgStackInstance().then(function(P){return g.afterCompCreated(x,P)})},f.prototype.afterCompCreated=function(h,g){if(h!=this.headerCompVersion||!this.isAlive()){this.destroyBean(g);return}this.destroyHeaderComp(),this.headerComp=g,this.headerCompGui=g.getGui(),this.getGui().appendChild(this.headerCompGui),this.ctrl.setDragSource(this.headerCompGui)},f.TEMPLATE=`
+ */var v8=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),X4=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Aie=function(M){v8(f,M);function f(d){var g=M.call(this,f.TEMPLATE,d)||this;return g.headerCompVersion=0,g.column=d.getColumnGroupChild(),g.pinned=d.getPinned(),g}return f.prototype.postConstruct=function(){var d=this,g=this.getGui(),S=function(te,Fe,Ue){var ut=Ue||g;Fe!=null&&Fe!=""?ut.setAttribute(te,Fe):ut.removeAttribute(te)},O={setWidth:function(te){return g.style.width=te},addOrRemoveCssClass:function(te,Fe){return d.addOrRemoveCssClass(te,Fe)},setColId:function(te){return S("col-id",te)},setTitle:function(te){return S("title",te)},setAriaDescription:function(te){return Uo(g,te)},setAriaSort:function(te){return te?Nh(g,te):$d(g)},setUserCompDetails:function(te){return d.setUserCompDetails(te)},getUserCompInstance:function(){return d.headerComp}};this.ctrl.setComp(O,this.getGui(),this.eResize);var z=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",z)},f.prototype.destroyHeaderComp=function(){this.headerComp&&(this.getGui().removeChild(this.headerCompGui),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)},f.prototype.setUserCompDetails=function(d){var g=this;this.headerCompVersion++;var S=this.headerCompVersion;d.newAgStackInstance().then(function(O){return g.afterCompCreated(S,O)})},f.prototype.afterCompCreated=function(d,g){if(d!=this.headerCompVersion||!this.isAlive()){this.destroyBean(g);return}this.destroyHeaderComp(),this.headerComp=g,this.headerCompGui=g.getGui(),this.getGui().appendChild(this.headerCompGui),this.ctrl.setDragSource(this.headerCompGui)},f.TEMPLATE=`
-
`,W4([zr("eResize")],f.prototype,"eResize",void 0),W4([it],f.prototype,"postConstruct",null),W4([pt],f.prototype,"destroyHeaderComp",null),f}(hC);/** +
`,X4([tn("eResize")],f.prototype,"eResize",void 0),X4([ht],f.prototype,"postConstruct",null),X4([wt],f.prototype,"destroyHeaderComp",null),f}(uC);/** * @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/ * @license MIT - */var Uz=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),w8=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},gve=function(M){Uz(f,M);function f(h){return M.call(this,f.TEMPLATE,h)||this}return f.prototype.postConstruct=function(){var h=this,g=this.getGui(),x=function(z,ee){return ee!=null?g.setAttribute(z,ee):g.removeAttribute(z)},P={addOrRemoveCssClass:function(z,ee){return h.addOrRemoveCssClass(z,ee)},addOrRemoveResizableCssClass:function(z,ee){return h.eResize.classList.toggle(z,ee)},setWidth:function(z){return g.style.width=z},setColId:function(z){return g.setAttribute("col-id",z)},setAriaExpanded:function(z){return x("aria-expanded",z)},setTitle:function(z){return x("title",z)},setUserCompDetails:function(z){return h.setUserCompDetails(z)}};this.ctrl.setComp(P,g,this.eResize)},f.prototype.setUserCompDetails=function(h){var g=this;h.newAgStackInstance().then(function(x){return g.afterHeaderCompCreated(x)})},f.prototype.afterHeaderCompCreated=function(h){var g=this,x=function(){return g.destroyBean(h)};if(!this.isAlive()){x();return}this.getGui().appendChild(h.getGui()),this.addDestroyFunc(x),this.ctrl.setDragSource(h.getGui())},f.TEMPLATE=`
+ */var Gz=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),_8=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},bve=function(M){Gz(f,M);function f(d){return M.call(this,f.TEMPLATE,d)||this}return f.prototype.postConstruct=function(){var d=this,g=this.getGui(),S=function(z,te){return te!=null?g.setAttribute(z,te):g.removeAttribute(z)},O={addOrRemoveCssClass:function(z,te){return d.addOrRemoveCssClass(z,te)},addOrRemoveResizableCssClass:function(z,te){return d.eResize.classList.toggle(z,te)},setWidth:function(z){return g.style.width=z},setColId:function(z){return g.setAttribute("col-id",z)},setAriaExpanded:function(z){return S("aria-expanded",z)},setTitle:function(z){return S("title",z)},setUserCompDetails:function(z){return d.setUserCompDetails(z)}};this.ctrl.setComp(O,g,this.eResize)},f.prototype.setUserCompDetails=function(d){var g=this;d.newAgStackInstance().then(function(S){return g.afterHeaderCompCreated(S)})},f.prototype.afterHeaderCompCreated=function(d){var g=this,S=function(){return g.destroyBean(d)};if(!this.isAlive()){S();return}this.getGui().appendChild(d.getGui()),this.addDestroyFunc(S),this.ctrl.setDragSource(d.getGui())},f.TEMPLATE=`
-
`,w8([ce("userComponentFactory")],f.prototype,"userComponentFactory",void 0),w8([zr("eResize")],f.prototype,"eResize",void 0),w8([it],f.prototype,"postConstruct",null),f}(hC);/** +
`,_8([pe("userComponentFactory")],f.prototype,"userComponentFactory",void 0),_8([tn("eResize")],f.prototype,"eResize",void 0),_8([ht],f.prototype,"postConstruct",null),f}(uC);/** * @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/ * @license MIT - */var yve=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),jz=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P};(function(M){M.COLUMN_GROUP="group",M.COLUMN="column",M.FLOATING_FILTER="filter"})(t.HeaderRowType||(t.HeaderRowType={}));var Mie=function(M){yve(f,M);function f(h){var g=M.call(this)||this;g.headerComps={};var x=h.getType()==t.HeaderRowType.COLUMN_GROUP?"ag-header-row-column-group":h.getType()==t.HeaderRowType.FLOATING_FILTER?"ag-header-row-column-filter":"ag-header-row-column";return g.setTemplate('
'),g.ctrl=h,g}return f.prototype.init=function(){var h=this,g={setTransform:function(x){return h.getGui().style.transform=x},setHeight:function(x){return h.getGui().style.height=x},setTop:function(x){return h.getGui().style.top=x},setHeaderCtrls:function(x){return h.setHeaderCtrls(x)},setWidth:function(x){return h.getGui().style.width=x},setAriaRowIndex:function(x){return Gl(h.getGui(),x)}};this.ctrl.setComp(g)},f.prototype.destroyHeaderCtrls=function(){this.setHeaderCtrls([])},f.prototype.setHeaderCtrls=function(h){var g=this;if(this.isAlive()){var x=this.headerComps;this.headerComps={},h.forEach(function(Me){var je=Me.getInstanceId(),ut=x[je];delete x[je],ut==null&&(ut=g.createHeaderComp(Me),g.getGui().appendChild(ut.getGui())),g.headerComps[je]=ut}),I(x,function(Me,je){g.getGui().removeChild(je.getGui()),g.destroyBean(je)});var P=this.gridOptionsWrapper.isEnsureDomOrder();if(P){var z=re(this.headerComps);z.sort(function(Me,je){var ut=Me.getCtrl().getColumnGroupChild().getLeft(),Rt=je.getCtrl().getColumnGroupChild().getLeft();return ut-Rt});var ee=z.map(function(Me){return Me.getGui()});Oc(this.getGui(),ee)}}},f.prototype.createHeaderComp=function(h){var g;switch(this.ctrl.getType()){case t.HeaderRowType.COLUMN_GROUP:g=new gve(h);break;case t.HeaderRowType.FLOATING_FILTER:g=new yz(h);break;default:g=new Rie(h);break}return this.createBean(g),g.setParentComponent(this),g},jz([it],f.prototype,"init",null),jz([pt],f.prototype,"destroyHeaderCtrls",null),f}(Sa);/** + */var wve=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Uz=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O};(function(M){M.COLUMN_GROUP="group",M.COLUMN="column",M.FLOATING_FILTER="filter"})(t.HeaderRowType||(t.HeaderRowType={}));var Pie=function(M){wve(f,M);function f(d){var g=M.call(this)||this;g.headerComps={};var S=d.getType()==t.HeaderRowType.COLUMN_GROUP?"ag-header-row-column-group":d.getType()==t.HeaderRowType.FLOATING_FILTER?"ag-header-row-column-filter":"ag-header-row-column";return g.setTemplate('
'),g.ctrl=d,g}return f.prototype.init=function(){var d=this,g={setTransform:function(S){return d.getGui().style.transform=S},setHeight:function(S){return d.getGui().style.height=S},setTop:function(S){return d.getGui().style.top=S},setHeaderCtrls:function(S){return d.setHeaderCtrls(S)},setWidth:function(S){return d.getGui().style.width=S},setAriaRowIndex:function(S){return Kl(d.getGui(),S)}};this.ctrl.setComp(g)},f.prototype.destroyHeaderCtrls=function(){this.setHeaderCtrls([])},f.prototype.setHeaderCtrls=function(d){var g=this;if(this.isAlive()){var S=this.headerComps;this.headerComps={},d.forEach(function(Fe){var Ue=Fe.getInstanceId(),ut=S[Ue];delete S[Ue],ut==null&&(ut=g.createHeaderComp(Fe),g.getGui().appendChild(ut.getGui())),g.headerComps[Ue]=ut}),I(S,function(Fe,Ue){g.getGui().removeChild(Ue.getGui()),g.destroyBean(Ue)});var O=this.gridOptionsWrapper.isEnsureDomOrder();if(O){var z=ie(this.headerComps);z.sort(function(Fe,Ue){var ut=Fe.getCtrl().getColumnGroupChild().getLeft(),Mt=Ue.getCtrl().getColumnGroupChild().getLeft();return ut-Mt});var te=z.map(function(Fe){return Fe.getGui()});Dc(this.getGui(),te)}}},f.prototype.createHeaderComp=function(d){var g;switch(this.ctrl.getType()){case t.HeaderRowType.COLUMN_GROUP:g=new bve(d);break;case t.HeaderRowType.FLOATING_FILTER:g=new yz(d);break;default:g=new Aie(d);break}return this.createBean(g),g.setParentComponent(this),g},Uz([ht],f.prototype,"init",null),Uz([wt],f.prototype,"destroyHeaderCtrls",null),f}(Ma);/** * @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/ * @license MIT - */var Die=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),vve=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},_ve=0,GI=function(M){Die(f,M);function f(h,g){var x=M.call(this)||this;return x.lastFocusEvent=null,x.columnGroupChild=h,x.parentRowCtrl=g,x.instanceId=h.getUniqueId()+"-"+_ve++,x}return f.prototype.shouldStopEventPropagation=function(h){var g=this.focusService.getFocusedHeader(),x=g.headerRowIndex,P=g.column;return k$(this.gridOptionsWrapper,h,x,P)},f.prototype.setGui=function(h){this.eGui=h,this.addDomData()},f.prototype.addDomData=function(){var h=this,g=f.DOM_DATA_KEY_HEADER_CTRL;this.gridOptionsWrapper.setDomData(this.eGui,g,this),this.addDestroyFunc(function(){return h.gridOptionsWrapper.setDomData(h.eGui,g,null)})},f.prototype.getGui=function(){return this.eGui},f.prototype.focus=function(h){return this.eGui?(this.lastFocusEvent=h||null,this.eGui.focus(),!0):!1},f.prototype.getRowIndex=function(){return this.parentRowCtrl.getRowIndex()},f.prototype.getParentRowCtrl=function(){return this.parentRowCtrl},f.prototype.getPinned=function(){return this.parentRowCtrl.getPinned()},f.prototype.getInstanceId=function(){return this.instanceId},f.prototype.getColumnGroupChild=function(){return this.columnGroupChild},f.DOM_DATA_KEY_HEADER_CTRL="headerCtrl",vve([ce("focusService")],f.prototype,"focusService",void 0),f}($i);/** + */var Oie=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),xve=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Sve=0,VI=function(M){Oie(f,M);function f(d,g){var S=M.call(this)||this;return S.lastFocusEvent=null,S.columnGroupChild=d,S.parentRowCtrl=g,S.instanceId=d.getUniqueId()+"-"+Sve++,S}return f.prototype.shouldStopEventPropagation=function(d){var g=this.focusService.getFocusedHeader(),S=g.headerRowIndex,O=g.column;return F$(this.gridOptionsWrapper,d,S,O)},f.prototype.setGui=function(d){this.eGui=d,this.addDomData()},f.prototype.addDomData=function(){var d=this,g=f.DOM_DATA_KEY_HEADER_CTRL;this.gridOptionsWrapper.setDomData(this.eGui,g,this),this.addDestroyFunc(function(){return d.gridOptionsWrapper.setDomData(d.eGui,g,null)})},f.prototype.getGui=function(){return this.eGui},f.prototype.focus=function(d){return this.eGui?(this.lastFocusEvent=d||null,this.eGui.focus(),!0):!1},f.prototype.getRowIndex=function(){return this.parentRowCtrl.getRowIndex()},f.prototype.getParentRowCtrl=function(){return this.parentRowCtrl},f.prototype.getPinned=function(){return this.parentRowCtrl.getPinned()},f.prototype.getInstanceId=function(){return this.instanceId},f.prototype.getColumnGroupChild=function(){return this.columnGroupChild},f.DOM_DATA_KEY_HEADER_CTRL="headerCtrl",xve([pe("focusService")],f.prototype,"focusService",void 0),f}(ji);/** * @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/ @@ -6358,130 +6358,130 @@ gl_FragColor.rgb *= color.a; * @version v27.3.0 * @link https://www.ag-grid.com/ * @license MIT - */var Ul=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P};function Bx(M){var f=M,h=f!=null&&f.getFrameworkComponentInstance!=null;return h?f.getFrameworkComponentInstance():M}var zz=function(){function M(){this.detailGridInfoMap={},this.destroyCalled=!1}return M.prototype.registerOverlayWrapperComp=function(f){this.overlayWrapperComp=f},M.prototype.registerSideBarComp=function(f){this.sideBarComp=f},M.prototype.init=function(){var f=this;switch(this.rowModel.getType()){case Ue.ROW_MODEL_TYPE_CLIENT_SIDE:this.clientSideRowModel=this.rowModel;break;case Ue.ROW_MODEL_TYPE_INFINITE:this.infiniteRowModel=this.rowModel;break;case Ue.ROW_MODEL_TYPE_SERVER_SIDE:this.serverSideRowModel=this.rowModel;break}this.ctrlsService.whenReady(function(){f.gridBodyCtrl=f.ctrlsService.getGridBodyCtrl()})},M.prototype.__getAlignedGridService=function(){return this.alignedGridsService},M.prototype.__getContext=function(){return this.context},M.prototype.addDetailGridInfo=function(f,h){this.detailGridInfoMap[f]=h},M.prototype.removeDetailGridInfo=function(f){this.detailGridInfoMap[f]=void 0},M.prototype.getDetailGridInfo=function(f){return this.detailGridInfoMap[f]},M.prototype.forEachDetailGridInfo=function(f){var h=0;I(this.detailGridInfoMap,function(g,x){i(x)&&(f(x,h),h++)})},M.prototype.getDataAsCsv=function(f){if(ni.assertRegistered(t.ModuleNames.CsvExportModule,"api.getDataAsCsv"))return this.csvCreator.getDataAsCsv(f)},M.prototype.exportDataAsCsv=function(f){ni.assertRegistered(t.ModuleNames.CsvExportModule,"api.exportDataAsCSv")&&this.csvCreator.exportDataAsCsv(f)},M.prototype.getExcelExportMode=function(f){var h=this.gridOptionsWrapper.getDefaultExportParams("excel"),g=Object.assign({exportMode:"xlsx"},h,f);return g.exportMode},M.prototype.getDataAsExcel=function(f){if(ni.assertRegistered(t.ModuleNames.ExcelExportModule,"api.getDataAsExcel")){var h=this.getExcelExportMode(f);if(this.excelCreator.getFactoryMode(h)===t.ExcelFactoryMode.MULTI_SHEET){console.warn("AG Grid: The Excel Exporter is currently on Multi Sheet mode. End that operation by calling `api.getMultipleSheetAsExcel()` or `api.exportMultipleSheetsAsExcel()`");return}return this.excelCreator.getDataAsExcel(f)}},M.prototype.exportDataAsExcel=function(f){if(ni.assertRegistered(t.ModuleNames.ExcelExportModule,"api.exportDataAsExcel")){var h=this.getExcelExportMode(f);if(this.excelCreator.getFactoryMode(h)===t.ExcelFactoryMode.MULTI_SHEET){console.warn("AG Grid: The Excel Exporter is currently on Multi Sheet mode. End that operation by calling `api.getMultipleSheetAsExcel()` or `api.exportMultipleSheetsAsExcel()`");return}this.excelCreator.exportDataAsExcel(f)}},M.prototype.getSheetDataForExcel=function(f){if(ni.assertRegistered(t.ModuleNames.ExcelExportModule,"api.getSheetDataForExcel")){var h=this.getExcelExportMode(f);return this.excelCreator.setFactoryMode(t.ExcelFactoryMode.MULTI_SHEET,h),this.excelCreator.getSheetDataForExcel(f)}},M.prototype.getMultipleSheetsAsExcel=function(f){if(ni.assertRegistered(t.ModuleNames.ExcelExportModule,"api.getMultipleSheetsAsExcel"))return this.excelCreator.getMultipleSheetsAsExcel(f)},M.prototype.exportMultipleSheetsAsExcel=function(f){if(ni.assertRegistered(t.ModuleNames.ExcelExportModule,"api.exportMultipleSheetsAsExcel"))return this.excelCreator.exportMultipleSheetsAsExcel(f)},M.prototype.setEnterpriseDatasource=function(f){console.warn("AG Grid: since version 18.x, api.setEnterpriseDatasource() should be replaced with api.setServerSideDatasource()"),this.setServerSideDatasource(f)},M.prototype.setGridAriaProperty=function(f,h){if(f){var g=this.ctrlsService.getGridBodyCtrl().getGui(),x="aria-"+f;h===null?g.removeAttribute(x):g.setAttribute(x,h)}},M.prototype.setServerSideDatasource=function(f){this.serverSideRowModel?this.serverSideRowModel.setDatasource(f):console.warn("AG Grid: you can only use an enterprise datasource when gridOptions.rowModelType is '"+Ue.ROW_MODEL_TYPE_SERVER_SIDE+"'")},M.prototype.setDatasource=function(f){this.gridOptionsWrapper.isRowModelInfinite()?this.rowModel.setDatasource(f):console.warn("AG Grid: you can only use a datasource when gridOptions.rowModelType is '"+Ue.ROW_MODEL_TYPE_INFINITE+"'")},M.prototype.setViewportDatasource=function(f){this.gridOptionsWrapper.isRowModelViewport()?this.rowModel.setViewportDatasource(f):console.warn("AG Grid: you can only use a viewport datasource when gridOptions.rowModelType is '"+Ue.ROW_MODEL_TYPE_VIEWPORT+"'")},M.prototype.setRowData=function(f){var h=this.immutableService==null;if(h){console.warn("AG Grid: you can only set rowData when using the Client Side Row Model");return}this.immutableService.isActive()?this.immutableService.setRowData(f):(this.selectionService.reset(),this.clientSideRowModel.setRowData(f))},M.prototype.setFloatingTopRowData=function(f){console.warn("AG Grid: since v12, api.setFloatingTopRowData() is now api.setPinnedTopRowData()"),this.setPinnedTopRowData(f)},M.prototype.setFloatingBottomRowData=function(f){console.warn("AG Grid: since v12, api.setFloatingBottomRowData() is now api.setPinnedBottomRowData()"),this.setPinnedBottomRowData(f)},M.prototype.getFloatingTopRowCount=function(){return console.warn("AG Grid: since v12, api.getFloatingTopRowCount() is now api.getPinnedTopRowCount()"),this.getPinnedTopRowCount()},M.prototype.getFloatingBottomRowCount=function(){return console.warn("AG Grid: since v12, api.getFloatingBottomRowCount() is now api.getPinnedBottomRowCount()"),this.getPinnedBottomRowCount()},M.prototype.getFloatingTopRow=function(f){return console.warn("AG Grid: since v12, api.getFloatingTopRow() is now api.getPinnedTopRow()"),this.getPinnedTopRow(f)},M.prototype.getFloatingBottomRow=function(f){return console.warn("AG Grid: since v12, api.getFloatingBottomRow() is now api.getPinnedBottomRow()"),this.getPinnedBottomRow(f)},M.prototype.setPinnedTopRowData=function(f){this.pinnedRowModel.setPinnedTopRowData(f)},M.prototype.setPinnedBottomRowData=function(f){this.pinnedRowModel.setPinnedBottomRowData(f)},M.prototype.getPinnedTopRowCount=function(){return this.pinnedRowModel.getPinnedTopRowCount()},M.prototype.getPinnedBottomRowCount=function(){return this.pinnedRowModel.getPinnedBottomRowCount()},M.prototype.getPinnedTopRow=function(f){return this.pinnedRowModel.getPinnedTopRow(f)},M.prototype.getPinnedBottomRow=function(f){return this.pinnedRowModel.getPinnedBottomRow(f)},M.prototype.setColumnDefs=function(f,h){h===void 0&&(h="api"),this.columnModel.setColumnDefs(f,h)},M.prototype.setAutoGroupColumnDef=function(f,h){this.gridOptionsWrapper.setProperty("autoGroupColumnDef",f,!0)},M.prototype.setDefaultColDef=function(f,h){this.gridOptionsWrapper.setProperty("defaultColDef",f,!0)},M.prototype.expireValueCache=function(){this.valueCache.expire()},M.prototype.getVerticalPixelRange=function(){return this.gridBodyCtrl.getScrollFeature().getVScrollPosition()},M.prototype.getHorizontalPixelRange=function(){return this.gridBodyCtrl.getScrollFeature().getHScrollPosition()},M.prototype.setAlwaysShowHorizontalScroll=function(f){this.gridOptionsWrapper.setProperty("alwaysShowHorizontalScroll",f)},M.prototype.setAlwaysShowVerticalScroll=function(f){this.gridOptionsWrapper.setProperty("alwaysShowVerticalScroll",f)},M.prototype.refreshToolPanel=function(){this.sideBarComp&&this.sideBarComp.refresh()},M.prototype.refreshCells=function(f){if(f===void 0&&(f={}),Array.isArray(f)){console.warn("since AG Grid v11.1, refreshCells() now takes parameters, please see the documentation.");return}this.rowRenderer.refreshCells(f)},M.prototype.flashCells=function(f){f===void 0&&(f={}),this.rowRenderer.flashCells(f)},M.prototype.redrawRows=function(f){f===void 0&&(f={});var h=f?f.rowNodes:void 0;this.rowRenderer.redrawRows(h)},M.prototype.setFunctionsReadOnly=function(f){this.gridOptionsWrapper.setProperty("functionsReadOnly",f)},M.prototype.refreshHeader=function(){this.ctrlsService.getHeaderRowContainerCtrls().forEach(function(f){return f.refresh()})},M.prototype.isAnyFilterPresent=function(){return this.filterManager.isAnyFilterPresent()},M.prototype.isColumnFilterPresent=function(){return this.filterManager.isColumnFilterPresent()||this.filterManager.isAggregateFilterPresent()},M.prototype.isQuickFilterPresent=function(){return this.filterManager.isQuickFilterPresent()},M.prototype.getModel=function(){return this.rowModel},M.prototype.setRowNodeExpanded=function(f,h){f&&f.setExpanded(h)},M.prototype.onGroupExpandedOrCollapsed=function(f){r(this.clientSideRowModel)&&console.warn("AG Grid: cannot call onGroupExpandedOrCollapsed unless using normal row model"),i(f)&&console.warn("AG Grid: api.onGroupExpandedOrCollapsed - refreshFromIndex parameter is no longer used, the grid will refresh all rows"),this.clientSideRowModel.refreshModel({step:t.ClientSideRowModelSteps.MAP})},M.prototype.refreshInMemoryRowModel=function(f){console.warn("ag-grid: since version 18.x, api.refreshInMemoryRowModel() should be replaced with api.refreshClientSideRowModel()"),this.refreshClientSideRowModel(f)},M.prototype.refreshClientSideRowModel=function(f){r(this.clientSideRowModel)&&console.warn("cannot call refreshClientSideRowModel unless using normal row model");var h=t.ClientSideRowModelSteps.EVERYTHING,g={group:t.ClientSideRowModelSteps.EVERYTHING,filter:t.ClientSideRowModelSteps.FILTER,map:t.ClientSideRowModelSteps.MAP,aggregate:t.ClientSideRowModelSteps.AGGREGATE,sort:t.ClientSideRowModelSteps.SORT,pivot:t.ClientSideRowModelSteps.PIVOT};if(i(f)&&(h=g[f]),r(h)){console.error("AG Grid: invalid step "+f+", available steps are "+Object.keys(g).join(", "));return}var x=!this.gridOptionsWrapper.isSuppressAnimationFrame(),P={step:h,keepRenderedRows:!0,keepEditingRows:!0,animate:x};this.clientSideRowModel.refreshModel(P)},M.prototype.isAnimationFrameQueueEmpty=function(){return this.animationFrameService.isQueueEmpty()},M.prototype.flushAllAnimationFrames=function(){this.animationFrameService.flushAllFrames()},M.prototype.getRowNode=function(f){return this.rowModel.getRowNode(f)},M.prototype.getSizesForCurrentTheme=function(){return{rowHeight:this.gridOptionsWrapper.getRowHeightAsNumber(),headerHeight:this.gridOptionsWrapper.getHeaderHeight()}},M.prototype.expandAll=function(){this.clientSideRowModel?this.clientSideRowModel.expandOrCollapseAll(!0):this.serverSideRowModel?this.serverSideRowModel.expandAll(!0):console.warn("AG Grid: expandAll only works with Client Side Row Model and Server Side Row Model")},M.prototype.collapseAll=function(){this.clientSideRowModel?this.clientSideRowModel.expandOrCollapseAll(!1):this.serverSideRowModel?this.serverSideRowModel.expandAll(!1):console.warn("AG Grid: collapseAll only works with Client Side Row Model and Server Side Row Model")},M.prototype.getToolPanelInstance=function(f){if(!this.sideBarComp){console.warn("AG Grid: toolPanel is only available in AG Grid Enterprise");return}var h=this.sideBarComp.getToolPanelInstance(f);return Bx(h)},M.prototype.addVirtualRowListener=function(f,h,g){typeof f!="string"&&console.warn("AG Grid: addVirtualRowListener is deprecated, please use addRenderedRowListener."),this.addRenderedRowListener(f,h,g)},M.prototype.addRenderedRowListener=function(f,h,g){f==="virtualRowSelected"&&console.warn(`AG Grid: event virtualRowSelected is deprecated, to register for individual row - selection events, add a listener directly to the row node.`),this.rowRenderer.addRenderedRowListener(f,h,g)},M.prototype.setQuickFilter=function(f){this.filterManager.setQuickFilter(f)},M.prototype.selectIndex=function(f,h,g){console.warn("AG Grid: do not use api for selection, call node.setSelected(value) instead"),g&&console.warn("AG Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it"),this.selectionService.selectIndex(f,h)},M.prototype.deselectIndex=function(f,h){h===void 0&&(h=!1),console.warn("AG Grid: do not use api for selection, call node.setSelected(value) instead"),h&&console.warn("AG Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it"),this.selectionService.deselectIndex(f)},M.prototype.selectNode=function(f,h,g){h===void 0&&(h=!1),g===void 0&&(g=!1),console.warn("AG Grid: API for selection is deprecated, call node.setSelected(value) instead"),g&&console.warn("AG Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it"),f.setSelectedParams({newValue:!0,clearSelection:!h})},M.prototype.deselectNode=function(f,h){h===void 0&&(h=!1),console.warn("AG Grid: API for selection is deprecated, call node.setSelected(value) instead"),h&&console.warn("AG Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it"),f.setSelectedParams({newValue:!1})},M.prototype.selectAll=function(){this.selectionService.selectAllRowNodes()},M.prototype.deselectAll=function(){this.selectionService.deselectAllRowNodes()},M.prototype.selectAllFiltered=function(){this.selectionService.selectAllRowNodes(!0)},M.prototype.deselectAllFiltered=function(){this.selectionService.deselectAllRowNodes(!0)},M.prototype.recomputeAggregates=function(){r(this.clientSideRowModel)&&console.warn("cannot call recomputeAggregates unless using normal row model"),console.warn("recomputeAggregates is deprecated, please call api.refreshClientSideRowModel('aggregate') instead"),this.clientSideRowModel.refreshModel({step:t.ClientSideRowModelSteps.AGGREGATE})},M.prototype.sizeColumnsToFit=function(){this.gridBodyCtrl.sizeColumnsToFit()},M.prototype.showLoadingOverlay=function(){this.overlayWrapperComp.showLoadingOverlay()},M.prototype.showNoRowsOverlay=function(){this.overlayWrapperComp.showNoRowsOverlay()},M.prototype.hideOverlay=function(){this.overlayWrapperComp.hideOverlay()},M.prototype.isNodeSelected=function(f){return console.warn("AG Grid: no need to call api.isNodeSelected(), just call node.isSelected() instead"),f.isSelected()},M.prototype.getSelectedNodesById=function(){return console.error("AG Grid: since version 3.4, getSelectedNodesById no longer exists, use getSelectedNodes() instead"),null},M.prototype.getSelectedNodes=function(){return this.selectionService.getSelectedNodes()},M.prototype.getSelectedRows=function(){return this.selectionService.getSelectedRows()},M.prototype.getBestCostNodeSelection=function(){return this.selectionService.getBestCostNodeSelection()},M.prototype.getRenderedNodes=function(){return this.rowRenderer.getRenderedNodes()},M.prototype.ensureColIndexVisible=function(f){console.warn("AG Grid: ensureColIndexVisible(index) no longer supported, use ensureColumnVisible(colKey) instead.")},M.prototype.ensureColumnVisible=function(f,h){h===void 0&&(h="auto"),this.gridBodyCtrl.getScrollFeature().ensureColumnVisible(f,h)},M.prototype.ensureIndexVisible=function(f,h){this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(f,h)},M.prototype.ensureNodeVisible=function(f,h){h===void 0&&(h=null),this.gridBodyCtrl.getScrollFeature().ensureNodeVisible(f,h)},M.prototype.forEachLeafNode=function(f){r(this.clientSideRowModel)&&console.warn("cannot call forEachNode unless using normal row model"),this.clientSideRowModel.forEachLeafNode(f)},M.prototype.forEachNode=function(f){this.rowModel.forEachNode(f)},M.prototype.forEachNodeAfterFilter=function(f){r(this.clientSideRowModel)&&console.warn("cannot call forEachNodeAfterFilter unless using normal row model"),this.clientSideRowModel.forEachNodeAfterFilter(f)},M.prototype.forEachNodeAfterFilterAndSort=function(f){r(this.clientSideRowModel)&&console.warn("cannot call forEachNodeAfterFilterAndSort unless using normal row model"),this.clientSideRowModel.forEachNodeAfterFilterAndSort(f)},M.prototype.getFilterInstance=function(f,h){var g=this.getFilterInstanceImpl(f,function(P){if(h){var z=Bx(P);h(z)}}),x=Bx(g);return x},M.prototype.getFilterInstanceImpl=function(f,h){var g=this.columnModel.getPrimaryColumn(f);if(g){var x=this.filterManager.getFilterComponent(g,"NO_UI"),P=x&&x.resolveNow(null,function(z){return z});return P?setTimeout(h,0,P):x&&x.then(function(z){h(z)}),P}},M.prototype.destroyFilter=function(f){var h=this.columnModel.getPrimaryColumn(f);if(h)return this.filterManager.destroyFilter(h,"filterDestroyed")},M.prototype.getStatusPanel=function(f){if(this.statusBarService){var h=this.statusBarService.getStatusPanel(f);return Bx(h)}},M.prototype.getColumnDef=function(f){var h=this.columnModel.getPrimaryColumn(f);return h?h.getColDef():null},M.prototype.getColumnDefs=function(){return this.columnModel.getColumnDefs()},M.prototype.onFilterChanged=function(){this.filterManager.onFilterChanged()},M.prototype.onSortChanged=function(){this.sortController.onSortChanged("api")},M.prototype.setFilterModel=function(f){this.filterManager.setFilterModel(f)},M.prototype.getFilterModel=function(){return this.filterManager.getFilterModel()},M.prototype.getFocusedCell=function(){return this.focusService.getFocusedCell()},M.prototype.clearFocusedCell=function(){return this.focusService.clearFocusedCell()},M.prototype.setFocusedCell=function(f,h,g){this.focusService.setFocusedCell(f,h,g,!0)},M.prototype.setSuppressRowDrag=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_SUPPRESS_ROW_DRAG,f)},M.prototype.setSuppressMoveWhenRowDragging=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_SUPPRESS_MOVE_WHEN_ROW_DRAG,f)},M.prototype.setSuppressRowClickSelection=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_SUPPRESS_ROW_CLICK_SELECTION,f)},M.prototype.addRowDropZone=function(f){this.gridBodyCtrl.getRowDragFeature().addRowDropZone(f)},M.prototype.removeRowDropZone=function(f){var h=this.dragAndDropService.findExternalZone(f);h&&this.dragAndDropService.removeDropTarget(h)},M.prototype.getRowDropZoneParams=function(f){return this.gridBodyCtrl.getRowDragFeature().getRowDropZone(f)},M.prototype.setHeaderHeight=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_HEADER_HEIGHT,f)},M.prototype.setDomLayout=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_DOM_LAYOUT,f)},M.prototype.setEnableCellTextSelection=function(f){this.gridBodyCtrl.setCellTextSelection(f)},M.prototype.setFillHandleDirection=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_FILL_HANDLE_DIRECTION,f)},M.prototype.setGroupHeaderHeight=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GROUP_HEADER_HEIGHT,f)},M.prototype.setFloatingFiltersHeight=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_FLOATING_FILTERS_HEIGHT,f)},M.prototype.setPivotHeaderHeight=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_PIVOT_HEADER_HEIGHT,f)},M.prototype.setPivotGroupHeaderHeight=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_PIVOT_GROUP_HEADER_HEIGHT,f)},M.prototype.setIsExternalFilterPresent=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_IS_EXTERNAL_FILTER_PRESENT,f)},M.prototype.setDoesExternalFilterPass=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_DOES_EXTERNAL_FILTER_PASS,f)},M.prototype.setNavigateToNextCell=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_NAVIGATE_TO_NEXT_CELL,f)},M.prototype.setTabToNextCell=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_TAB_TO_NEXT_CELL,f)},M.prototype.setTabToNextHeader=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_TAB_TO_NEXT_HEADER,f)},M.prototype.setNavigateToNextHeader=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_NAVIGATE_TO_NEXT_HEADER,f)},M.prototype.setGroupRowAggNodes=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GROUP_ROW_AGG_NODES,f)},M.prototype.setGetGroupRowAgg=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GET_GROUP_ROW_AGG,f)},M.prototype.setGetBusinessKeyForNode=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GET_BUSINESS_KEY_FOR_NODE,f)},M.prototype.setGetChildCount=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GET_CHILD_COUNT,f)},M.prototype.setProcessRowPostCreate=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_PROCESS_ROW_POST_CREATE,f)},M.prototype.setGetRowNodeId=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GET_ROW_NODE_ID,f)},M.prototype.setGetRowId=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GET_ROW_ID,f)},M.prototype.setGetRowClass=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GET_ROW_CLASS,f)},M.prototype.setIsFullWidthCell=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_IS_FULL_WIDTH_CELL,f)},M.prototype.setIsFullWidthRow=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_IS_FULL_WIDTH_ROW,f)},M.prototype.setIsRowSelectable=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_IS_ROW_SELECTABLE,f)},M.prototype.setIsRowMaster=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_IS_ROW_MASTER,f)},M.prototype.setPostSort=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_POST_SORT,f)},M.prototype.setPostSortRows=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_POST_SORT_ROWS,f)},M.prototype.setGetDocument=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GET_DOCUMENT,f)},M.prototype.setGetContextMenuItems=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GET_CONTEXT_MENU_ITEMS,f)},M.prototype.setGetMainMenuItems=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GET_MAIN_MENU_ITEMS,f)},M.prototype.setProcessCellForClipboard=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_PROCESS_CELL_FOR_CLIPBOARD,f)},M.prototype.setSendToClipboard=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_SEND_TO_CLIPBOARD,f)},M.prototype.setProcessCellFromClipboard=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_PROCESS_CELL_FROM_CLIPBOARD,f)},M.prototype.setProcessSecondaryColDef=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_PROCESS_TO_SECONDARY_COLDEF,f)},M.prototype.setProcessSecondaryColGroupDef=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_PROCESS_SECONDARY_COL_GROUP_DEF,f)},M.prototype.setPostProcessPopup=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_POST_PROCESS_POPUP,f)},M.prototype.setDefaultGroupOrderComparator=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_DEFAULT_GROUP_ORDER_COMPARATOR,f)},M.prototype.setInitialGroupOrderComparator=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_INITIAL_GROUP_ORDER_COMPARATOR,f)},M.prototype.setGetChartToolbarItems=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GET_CHART_TOOLBAR_ITEMS,f)},M.prototype.setPaginationNumberFormatter=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_PAGINATION_NUMBER_FORMATTER,f)},M.prototype.setGetServerSideStoreParams=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GET_SERVER_SIDE_STORE_PARAMS,f)},M.prototype.setIsServerSideGroupOpenByDefault=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_IS_SERVER_SIDE_GROUPS_OPEN_BY_DEFAULT,f)},M.prototype.setIsApplyServerSideTransaction=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_IS_APPLY_SERVER_SIDE_TRANSACTION,f)},M.prototype.setIsServerSideGroup=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_IS_SERVER_SIDE_GROUP,f)},M.prototype.setGetServerSideGroupKey=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GET_SERVER_SIDE_GROUP_KEY,f)},M.prototype.setGetRowStyle=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GET_ROW_STYLE,f)},M.prototype.setGetRowHeight=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GET_ROW_HEIGHT,f)},M.prototype.isSideBarVisible=function(){return this.sideBarComp?this.sideBarComp.isDisplayed():!1},M.prototype.setSideBarVisible=function(f){if(!this.sideBarComp){f&&console.warn("AG Grid: sideBar is not loaded");return}this.sideBarComp.setDisplayed(f)},M.prototype.setSideBarPosition=function(f){if(!this.sideBarComp){console.warn("AG Grid: sideBar is not loaded");return}this.sideBarComp.setSideBarPosition(f)},M.prototype.openToolPanel=function(f){if(!this.sideBarComp){console.warn("AG Grid: toolPanel is only available in AG Grid Enterprise");return}this.sideBarComp.openToolPanel(f)},M.prototype.closeToolPanel=function(){if(!this.sideBarComp){console.warn("AG Grid: toolPanel is only available in AG Grid Enterprise");return}this.sideBarComp.close()},M.prototype.getOpenedToolPanel=function(){return this.sideBarComp?this.sideBarComp.openedItem():null},M.prototype.getSideBar=function(){return this.gridOptionsWrapper.getSideBar()},M.prototype.setSideBar=function(f){this.gridOptionsWrapper.setProperty("sideBar",Z$.parse(f))},M.prototype.setSuppressClipboardPaste=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_SUPPRESS_CLIPBOARD_PASTE,f)},M.prototype.isToolPanelShowing=function(){return this.sideBarComp.isToolPanelShowing()},M.prototype.doLayout=function(){var f="AG Grid - since version 25.1, doLayout was taken out, as it's not needed. The grid responds to grid size changes automatically";ze(function(){return console.warn(f)},"doLayoutDeprecated")},M.prototype.resetRowHeights=function(){if(i(this.clientSideRowModel)){if(this.columnModel.isAutoRowHeightActive()){console.warn("AG Grid: calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");return}this.clientSideRowModel.resetRowHeights()}},M.prototype.setGroupRemoveSingleChildren=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GROUP_REMOVE_SINGLE_CHILDREN,f)},M.prototype.setGroupRemoveLowestSingleChildren=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN,f)},M.prototype.onRowHeightChanged=function(){this.clientSideRowModel?this.clientSideRowModel.onRowHeightChanged():this.serverSideRowModel&&this.serverSideRowModel.onRowHeightChanged()},M.prototype.getValue=function(f,h){var g=this.columnModel.getPrimaryColumn(f);return r(g)&&(g=this.columnModel.getGridColumn(f)),r(g)?null:this.valueService.getValue(g,h)},M.prototype.addEventListener=function(f,h){var g=this.gridOptionsWrapper.useAsyncEvents();this.eventService.addEventListener(f,h,g)},M.prototype.addGlobalListener=function(f){var h=this.gridOptionsWrapper.useAsyncEvents();this.eventService.addGlobalListener(f,h)},M.prototype.removeEventListener=function(f,h){var g=this.gridOptionsWrapper.useAsyncEvents();this.eventService.removeEventListener(f,h,g)},M.prototype.removeGlobalListener=function(f){var h=this.gridOptionsWrapper.useAsyncEvents();this.eventService.removeGlobalListener(f,h)},M.prototype.dispatchEvent=function(f){this.eventService.dispatchEvent(f)},M.prototype.destroy=function(){if(!this.destroyCalled){this.destroyCalled=!0;var f=this.ctrlsService.getGridCtrl();f&&f.destroyGridUi(),this.context.destroy()}},M.prototype.cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid=function(){setTimeout(J.bind(window,this,"Grid API"),100)},M.prototype.warnIfDestroyed=function(f){return this.destroyCalled&&console.warn("AG Grid: Grid API method "+f+" was called on a grid that was destroyed."),this.destroyCalled},M.prototype.resetQuickFilter=function(){this.warnIfDestroyed("resetQuickFilter")||this.rowModel.forEachNode(function(f){return f.quickFilterAggregateText=null})},M.prototype.getRangeSelections=function(){return console.warn(`AG Grid: in v20.1.x, api.getRangeSelections() is gone, please use getCellRanges() instead. + */var Zl=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O};function Vx(M){var f=M,d=f!=null&&f.getFrameworkComponentInstance!=null;return d?f.getFrameworkComponentInstance():M}var zz=function(){function M(){this.detailGridInfoMap={},this.destroyCalled=!1}return M.prototype.registerOverlayWrapperComp=function(f){this.overlayWrapperComp=f},M.prototype.registerSideBarComp=function(f){this.sideBarComp=f},M.prototype.init=function(){var f=this;switch(this.rowModel.getType()){case $e.ROW_MODEL_TYPE_CLIENT_SIDE:this.clientSideRowModel=this.rowModel;break;case $e.ROW_MODEL_TYPE_INFINITE:this.infiniteRowModel=this.rowModel;break;case $e.ROW_MODEL_TYPE_SERVER_SIDE:this.serverSideRowModel=this.rowModel;break}this.ctrlsService.whenReady(function(){f.gridBodyCtrl=f.ctrlsService.getGridBodyCtrl()})},M.prototype.__getAlignedGridService=function(){return this.alignedGridsService},M.prototype.__getContext=function(){return this.context},M.prototype.addDetailGridInfo=function(f,d){this.detailGridInfoMap[f]=d},M.prototype.removeDetailGridInfo=function(f){this.detailGridInfoMap[f]=void 0},M.prototype.getDetailGridInfo=function(f){return this.detailGridInfoMap[f]},M.prototype.forEachDetailGridInfo=function(f){var d=0;I(this.detailGridInfoMap,function(g,S){i(S)&&(f(S,d),d++)})},M.prototype.getDataAsCsv=function(f){if(Xt.assertRegistered(t.ModuleNames.CsvExportModule,"api.getDataAsCsv"))return this.csvCreator.getDataAsCsv(f)},M.prototype.exportDataAsCsv=function(f){Xt.assertRegistered(t.ModuleNames.CsvExportModule,"api.exportDataAsCSv")&&this.csvCreator.exportDataAsCsv(f)},M.prototype.getExcelExportMode=function(f){var d=this.gridOptionsWrapper.getDefaultExportParams("excel"),g=Object.assign({exportMode:"xlsx"},d,f);return g.exportMode},M.prototype.getDataAsExcel=function(f){if(Xt.assertRegistered(t.ModuleNames.ExcelExportModule,"api.getDataAsExcel")){var d=this.getExcelExportMode(f);if(this.excelCreator.getFactoryMode(d)===t.ExcelFactoryMode.MULTI_SHEET){console.warn("AG Grid: The Excel Exporter is currently on Multi Sheet mode. End that operation by calling `api.getMultipleSheetAsExcel()` or `api.exportMultipleSheetsAsExcel()`");return}return this.excelCreator.getDataAsExcel(f)}},M.prototype.exportDataAsExcel=function(f){if(Xt.assertRegistered(t.ModuleNames.ExcelExportModule,"api.exportDataAsExcel")){var d=this.getExcelExportMode(f);if(this.excelCreator.getFactoryMode(d)===t.ExcelFactoryMode.MULTI_SHEET){console.warn("AG Grid: The Excel Exporter is currently on Multi Sheet mode. End that operation by calling `api.getMultipleSheetAsExcel()` or `api.exportMultipleSheetsAsExcel()`");return}this.excelCreator.exportDataAsExcel(f)}},M.prototype.getSheetDataForExcel=function(f){if(Xt.assertRegistered(t.ModuleNames.ExcelExportModule,"api.getSheetDataForExcel")){var d=this.getExcelExportMode(f);return this.excelCreator.setFactoryMode(t.ExcelFactoryMode.MULTI_SHEET,d),this.excelCreator.getSheetDataForExcel(f)}},M.prototype.getMultipleSheetsAsExcel=function(f){if(Xt.assertRegistered(t.ModuleNames.ExcelExportModule,"api.getMultipleSheetsAsExcel"))return this.excelCreator.getMultipleSheetsAsExcel(f)},M.prototype.exportMultipleSheetsAsExcel=function(f){if(Xt.assertRegistered(t.ModuleNames.ExcelExportModule,"api.exportMultipleSheetsAsExcel"))return this.excelCreator.exportMultipleSheetsAsExcel(f)},M.prototype.setEnterpriseDatasource=function(f){console.warn("AG Grid: since version 18.x, api.setEnterpriseDatasource() should be replaced with api.setServerSideDatasource()"),this.setServerSideDatasource(f)},M.prototype.setGridAriaProperty=function(f,d){if(f){var g=this.ctrlsService.getGridBodyCtrl().getGui(),S="aria-"+f;d===null?g.removeAttribute(S):g.setAttribute(S,d)}},M.prototype.setServerSideDatasource=function(f){this.serverSideRowModel?this.serverSideRowModel.setDatasource(f):console.warn("AG Grid: you can only use an enterprise datasource when gridOptions.rowModelType is '"+$e.ROW_MODEL_TYPE_SERVER_SIDE+"'")},M.prototype.setDatasource=function(f){this.gridOptionsWrapper.isRowModelInfinite()?this.rowModel.setDatasource(f):console.warn("AG Grid: you can only use a datasource when gridOptions.rowModelType is '"+$e.ROW_MODEL_TYPE_INFINITE+"'")},M.prototype.setViewportDatasource=function(f){this.gridOptionsWrapper.isRowModelViewport()?this.rowModel.setViewportDatasource(f):console.warn("AG Grid: you can only use a viewport datasource when gridOptions.rowModelType is '"+$e.ROW_MODEL_TYPE_VIEWPORT+"'")},M.prototype.setRowData=function(f){var d=this.immutableService==null;if(d){console.warn("AG Grid: you can only set rowData when using the Client Side Row Model");return}this.immutableService.isActive()?this.immutableService.setRowData(f):(this.selectionService.reset(),this.clientSideRowModel.setRowData(f))},M.prototype.setFloatingTopRowData=function(f){console.warn("AG Grid: since v12, api.setFloatingTopRowData() is now api.setPinnedTopRowData()"),this.setPinnedTopRowData(f)},M.prototype.setFloatingBottomRowData=function(f){console.warn("AG Grid: since v12, api.setFloatingBottomRowData() is now api.setPinnedBottomRowData()"),this.setPinnedBottomRowData(f)},M.prototype.getFloatingTopRowCount=function(){return console.warn("AG Grid: since v12, api.getFloatingTopRowCount() is now api.getPinnedTopRowCount()"),this.getPinnedTopRowCount()},M.prototype.getFloatingBottomRowCount=function(){return console.warn("AG Grid: since v12, api.getFloatingBottomRowCount() is now api.getPinnedBottomRowCount()"),this.getPinnedBottomRowCount()},M.prototype.getFloatingTopRow=function(f){return console.warn("AG Grid: since v12, api.getFloatingTopRow() is now api.getPinnedTopRow()"),this.getPinnedTopRow(f)},M.prototype.getFloatingBottomRow=function(f){return console.warn("AG Grid: since v12, api.getFloatingBottomRow() is now api.getPinnedBottomRow()"),this.getPinnedBottomRow(f)},M.prototype.setPinnedTopRowData=function(f){this.pinnedRowModel.setPinnedTopRowData(f)},M.prototype.setPinnedBottomRowData=function(f){this.pinnedRowModel.setPinnedBottomRowData(f)},M.prototype.getPinnedTopRowCount=function(){return this.pinnedRowModel.getPinnedTopRowCount()},M.prototype.getPinnedBottomRowCount=function(){return this.pinnedRowModel.getPinnedBottomRowCount()},M.prototype.getPinnedTopRow=function(f){return this.pinnedRowModel.getPinnedTopRow(f)},M.prototype.getPinnedBottomRow=function(f){return this.pinnedRowModel.getPinnedBottomRow(f)},M.prototype.setColumnDefs=function(f,d){d===void 0&&(d="api"),this.columnModel.setColumnDefs(f,d)},M.prototype.setAutoGroupColumnDef=function(f,d){this.gridOptionsWrapper.setProperty("autoGroupColumnDef",f,!0)},M.prototype.setDefaultColDef=function(f,d){this.gridOptionsWrapper.setProperty("defaultColDef",f,!0)},M.prototype.expireValueCache=function(){this.valueCache.expire()},M.prototype.getVerticalPixelRange=function(){return this.gridBodyCtrl.getScrollFeature().getVScrollPosition()},M.prototype.getHorizontalPixelRange=function(){return this.gridBodyCtrl.getScrollFeature().getHScrollPosition()},M.prototype.setAlwaysShowHorizontalScroll=function(f){this.gridOptionsWrapper.setProperty("alwaysShowHorizontalScroll",f)},M.prototype.setAlwaysShowVerticalScroll=function(f){this.gridOptionsWrapper.setProperty("alwaysShowVerticalScroll",f)},M.prototype.refreshToolPanel=function(){this.sideBarComp&&this.sideBarComp.refresh()},M.prototype.refreshCells=function(f){if(f===void 0&&(f={}),Array.isArray(f)){console.warn("since AG Grid v11.1, refreshCells() now takes parameters, please see the documentation.");return}this.rowRenderer.refreshCells(f)},M.prototype.flashCells=function(f){f===void 0&&(f={}),this.rowRenderer.flashCells(f)},M.prototype.redrawRows=function(f){f===void 0&&(f={});var d=f?f.rowNodes:void 0;this.rowRenderer.redrawRows(d)},M.prototype.setFunctionsReadOnly=function(f){this.gridOptionsWrapper.setProperty("functionsReadOnly",f)},M.prototype.refreshHeader=function(){this.ctrlsService.getHeaderRowContainerCtrls().forEach(function(f){return f.refresh()})},M.prototype.isAnyFilterPresent=function(){return this.filterManager.isAnyFilterPresent()},M.prototype.isColumnFilterPresent=function(){return this.filterManager.isColumnFilterPresent()||this.filterManager.isAggregateFilterPresent()},M.prototype.isQuickFilterPresent=function(){return this.filterManager.isQuickFilterPresent()},M.prototype.getModel=function(){return this.rowModel},M.prototype.setRowNodeExpanded=function(f,d){f&&f.setExpanded(d)},M.prototype.onGroupExpandedOrCollapsed=function(f){r(this.clientSideRowModel)&&console.warn("AG Grid: cannot call onGroupExpandedOrCollapsed unless using normal row model"),i(f)&&console.warn("AG Grid: api.onGroupExpandedOrCollapsed - refreshFromIndex parameter is no longer used, the grid will refresh all rows"),this.clientSideRowModel.refreshModel({step:t.ClientSideRowModelSteps.MAP})},M.prototype.refreshInMemoryRowModel=function(f){console.warn("ag-grid: since version 18.x, api.refreshInMemoryRowModel() should be replaced with api.refreshClientSideRowModel()"),this.refreshClientSideRowModel(f)},M.prototype.refreshClientSideRowModel=function(f){r(this.clientSideRowModel)&&console.warn("cannot call refreshClientSideRowModel unless using normal row model");var d=t.ClientSideRowModelSteps.EVERYTHING,g={group:t.ClientSideRowModelSteps.EVERYTHING,filter:t.ClientSideRowModelSteps.FILTER,map:t.ClientSideRowModelSteps.MAP,aggregate:t.ClientSideRowModelSteps.AGGREGATE,sort:t.ClientSideRowModelSteps.SORT,pivot:t.ClientSideRowModelSteps.PIVOT};if(i(f)&&(d=g[f]),r(d)){console.error("AG Grid: invalid step "+f+", available steps are "+Object.keys(g).join(", "));return}var S=!this.gridOptionsWrapper.isSuppressAnimationFrame(),O={step:d,keepRenderedRows:!0,keepEditingRows:!0,animate:S};this.clientSideRowModel.refreshModel(O)},M.prototype.isAnimationFrameQueueEmpty=function(){return this.animationFrameService.isQueueEmpty()},M.prototype.flushAllAnimationFrames=function(){this.animationFrameService.flushAllFrames()},M.prototype.getRowNode=function(f){return this.rowModel.getRowNode(f)},M.prototype.getSizesForCurrentTheme=function(){return{rowHeight:this.gridOptionsWrapper.getRowHeightAsNumber(),headerHeight:this.gridOptionsWrapper.getHeaderHeight()}},M.prototype.expandAll=function(){this.clientSideRowModel?this.clientSideRowModel.expandOrCollapseAll(!0):this.serverSideRowModel?this.serverSideRowModel.expandAll(!0):console.warn("AG Grid: expandAll only works with Client Side Row Model and Server Side Row Model")},M.prototype.collapseAll=function(){this.clientSideRowModel?this.clientSideRowModel.expandOrCollapseAll(!1):this.serverSideRowModel?this.serverSideRowModel.expandAll(!1):console.warn("AG Grid: collapseAll only works with Client Side Row Model and Server Side Row Model")},M.prototype.getToolPanelInstance=function(f){if(!this.sideBarComp){console.warn("AG Grid: toolPanel is only available in AG Grid Enterprise");return}var d=this.sideBarComp.getToolPanelInstance(f);return Vx(d)},M.prototype.addVirtualRowListener=function(f,d,g){typeof f!="string"&&console.warn("AG Grid: addVirtualRowListener is deprecated, please use addRenderedRowListener."),this.addRenderedRowListener(f,d,g)},M.prototype.addRenderedRowListener=function(f,d,g){f==="virtualRowSelected"&&console.warn(`AG Grid: event virtualRowSelected is deprecated, to register for individual row + selection events, add a listener directly to the row node.`),this.rowRenderer.addRenderedRowListener(f,d,g)},M.prototype.setQuickFilter=function(f){this.filterManager.setQuickFilter(f)},M.prototype.selectIndex=function(f,d,g){console.warn("AG Grid: do not use api for selection, call node.setSelected(value) instead"),g&&console.warn("AG Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it"),this.selectionService.selectIndex(f,d)},M.prototype.deselectIndex=function(f,d){d===void 0&&(d=!1),console.warn("AG Grid: do not use api for selection, call node.setSelected(value) instead"),d&&console.warn("AG Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it"),this.selectionService.deselectIndex(f)},M.prototype.selectNode=function(f,d,g){d===void 0&&(d=!1),g===void 0&&(g=!1),console.warn("AG Grid: API for selection is deprecated, call node.setSelected(value) instead"),g&&console.warn("AG Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it"),f.setSelectedParams({newValue:!0,clearSelection:!d})},M.prototype.deselectNode=function(f,d){d===void 0&&(d=!1),console.warn("AG Grid: API for selection is deprecated, call node.setSelected(value) instead"),d&&console.warn("AG Grid: suppressEvents is no longer supported, stop listening for the event if you no longer want it"),f.setSelectedParams({newValue:!1})},M.prototype.selectAll=function(){this.selectionService.selectAllRowNodes()},M.prototype.deselectAll=function(){this.selectionService.deselectAllRowNodes()},M.prototype.selectAllFiltered=function(){this.selectionService.selectAllRowNodes(!0)},M.prototype.deselectAllFiltered=function(){this.selectionService.deselectAllRowNodes(!0)},M.prototype.recomputeAggregates=function(){r(this.clientSideRowModel)&&console.warn("cannot call recomputeAggregates unless using normal row model"),console.warn("recomputeAggregates is deprecated, please call api.refreshClientSideRowModel('aggregate') instead"),this.clientSideRowModel.refreshModel({step:t.ClientSideRowModelSteps.AGGREGATE})},M.prototype.sizeColumnsToFit=function(){this.gridBodyCtrl.sizeColumnsToFit()},M.prototype.showLoadingOverlay=function(){this.overlayWrapperComp.showLoadingOverlay()},M.prototype.showNoRowsOverlay=function(){this.overlayWrapperComp.showNoRowsOverlay()},M.prototype.hideOverlay=function(){this.overlayWrapperComp.hideOverlay()},M.prototype.isNodeSelected=function(f){return console.warn("AG Grid: no need to call api.isNodeSelected(), just call node.isSelected() instead"),f.isSelected()},M.prototype.getSelectedNodesById=function(){return console.error("AG Grid: since version 3.4, getSelectedNodesById no longer exists, use getSelectedNodes() instead"),null},M.prototype.getSelectedNodes=function(){return this.selectionService.getSelectedNodes()},M.prototype.getSelectedRows=function(){return this.selectionService.getSelectedRows()},M.prototype.getBestCostNodeSelection=function(){return this.selectionService.getBestCostNodeSelection()},M.prototype.getRenderedNodes=function(){return this.rowRenderer.getRenderedNodes()},M.prototype.ensureColIndexVisible=function(f){console.warn("AG Grid: ensureColIndexVisible(index) no longer supported, use ensureColumnVisible(colKey) instead.")},M.prototype.ensureColumnVisible=function(f,d){d===void 0&&(d="auto"),this.gridBodyCtrl.getScrollFeature().ensureColumnVisible(f,d)},M.prototype.ensureIndexVisible=function(f,d){this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(f,d)},M.prototype.ensureNodeVisible=function(f,d){d===void 0&&(d=null),this.gridBodyCtrl.getScrollFeature().ensureNodeVisible(f,d)},M.prototype.forEachLeafNode=function(f){r(this.clientSideRowModel)&&console.warn("cannot call forEachNode unless using normal row model"),this.clientSideRowModel.forEachLeafNode(f)},M.prototype.forEachNode=function(f){this.rowModel.forEachNode(f)},M.prototype.forEachNodeAfterFilter=function(f){r(this.clientSideRowModel)&&console.warn("cannot call forEachNodeAfterFilter unless using normal row model"),this.clientSideRowModel.forEachNodeAfterFilter(f)},M.prototype.forEachNodeAfterFilterAndSort=function(f){r(this.clientSideRowModel)&&console.warn("cannot call forEachNodeAfterFilterAndSort unless using normal row model"),this.clientSideRowModel.forEachNodeAfterFilterAndSort(f)},M.prototype.getFilterInstance=function(f,d){var g=this.getFilterInstanceImpl(f,function(O){if(d){var z=Vx(O);d(z)}}),S=Vx(g);return S},M.prototype.getFilterInstanceImpl=function(f,d){var g=this.columnModel.getPrimaryColumn(f);if(g){var S=this.filterManager.getFilterComponent(g,"NO_UI"),O=S&&S.resolveNow(null,function(z){return z});return O?setTimeout(d,0,O):S&&S.then(function(z){d(z)}),O}},M.prototype.destroyFilter=function(f){var d=this.columnModel.getPrimaryColumn(f);if(d)return this.filterManager.destroyFilter(d,"filterDestroyed")},M.prototype.getStatusPanel=function(f){if(this.statusBarService){var d=this.statusBarService.getStatusPanel(f);return Vx(d)}},M.prototype.getColumnDef=function(f){var d=this.columnModel.getPrimaryColumn(f);return d?d.getColDef():null},M.prototype.getColumnDefs=function(){return this.columnModel.getColumnDefs()},M.prototype.onFilterChanged=function(){this.filterManager.onFilterChanged()},M.prototype.onSortChanged=function(){this.sortController.onSortChanged("api")},M.prototype.setFilterModel=function(f){this.filterManager.setFilterModel(f)},M.prototype.getFilterModel=function(){return this.filterManager.getFilterModel()},M.prototype.getFocusedCell=function(){return this.focusService.getFocusedCell()},M.prototype.clearFocusedCell=function(){return this.focusService.clearFocusedCell()},M.prototype.setFocusedCell=function(f,d,g){this.focusService.setFocusedCell(f,d,g,!0)},M.prototype.setSuppressRowDrag=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_SUPPRESS_ROW_DRAG,f)},M.prototype.setSuppressMoveWhenRowDragging=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_SUPPRESS_MOVE_WHEN_ROW_DRAG,f)},M.prototype.setSuppressRowClickSelection=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_SUPPRESS_ROW_CLICK_SELECTION,f)},M.prototype.addRowDropZone=function(f){this.gridBodyCtrl.getRowDragFeature().addRowDropZone(f)},M.prototype.removeRowDropZone=function(f){var d=this.dragAndDropService.findExternalZone(f);d&&this.dragAndDropService.removeDropTarget(d)},M.prototype.getRowDropZoneParams=function(f){return this.gridBodyCtrl.getRowDragFeature().getRowDropZone(f)},M.prototype.setHeaderHeight=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_HEADER_HEIGHT,f)},M.prototype.setDomLayout=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_DOM_LAYOUT,f)},M.prototype.setEnableCellTextSelection=function(f){this.gridBodyCtrl.setCellTextSelection(f)},M.prototype.setFillHandleDirection=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_FILL_HANDLE_DIRECTION,f)},M.prototype.setGroupHeaderHeight=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GROUP_HEADER_HEIGHT,f)},M.prototype.setFloatingFiltersHeight=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_FLOATING_FILTERS_HEIGHT,f)},M.prototype.setPivotHeaderHeight=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_PIVOT_HEADER_HEIGHT,f)},M.prototype.setPivotGroupHeaderHeight=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_PIVOT_GROUP_HEADER_HEIGHT,f)},M.prototype.setIsExternalFilterPresent=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_IS_EXTERNAL_FILTER_PRESENT,f)},M.prototype.setDoesExternalFilterPass=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_DOES_EXTERNAL_FILTER_PASS,f)},M.prototype.setNavigateToNextCell=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_NAVIGATE_TO_NEXT_CELL,f)},M.prototype.setTabToNextCell=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_TAB_TO_NEXT_CELL,f)},M.prototype.setTabToNextHeader=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_TAB_TO_NEXT_HEADER,f)},M.prototype.setNavigateToNextHeader=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_NAVIGATE_TO_NEXT_HEADER,f)},M.prototype.setGroupRowAggNodes=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GROUP_ROW_AGG_NODES,f)},M.prototype.setGetGroupRowAgg=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GET_GROUP_ROW_AGG,f)},M.prototype.setGetBusinessKeyForNode=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GET_BUSINESS_KEY_FOR_NODE,f)},M.prototype.setGetChildCount=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GET_CHILD_COUNT,f)},M.prototype.setProcessRowPostCreate=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_PROCESS_ROW_POST_CREATE,f)},M.prototype.setGetRowNodeId=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GET_ROW_NODE_ID,f)},M.prototype.setGetRowId=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GET_ROW_ID,f)},M.prototype.setGetRowClass=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GET_ROW_CLASS,f)},M.prototype.setIsFullWidthCell=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_IS_FULL_WIDTH_CELL,f)},M.prototype.setIsFullWidthRow=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_IS_FULL_WIDTH_ROW,f)},M.prototype.setIsRowSelectable=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_IS_ROW_SELECTABLE,f)},M.prototype.setIsRowMaster=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_IS_ROW_MASTER,f)},M.prototype.setPostSort=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_POST_SORT,f)},M.prototype.setPostSortRows=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_POST_SORT_ROWS,f)},M.prototype.setGetDocument=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GET_DOCUMENT,f)},M.prototype.setGetContextMenuItems=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GET_CONTEXT_MENU_ITEMS,f)},M.prototype.setGetMainMenuItems=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GET_MAIN_MENU_ITEMS,f)},M.prototype.setProcessCellForClipboard=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_PROCESS_CELL_FOR_CLIPBOARD,f)},M.prototype.setSendToClipboard=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_SEND_TO_CLIPBOARD,f)},M.prototype.setProcessCellFromClipboard=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_PROCESS_CELL_FROM_CLIPBOARD,f)},M.prototype.setProcessSecondaryColDef=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_PROCESS_TO_SECONDARY_COLDEF,f)},M.prototype.setProcessSecondaryColGroupDef=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_PROCESS_SECONDARY_COL_GROUP_DEF,f)},M.prototype.setPostProcessPopup=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_POST_PROCESS_POPUP,f)},M.prototype.setDefaultGroupOrderComparator=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_DEFAULT_GROUP_ORDER_COMPARATOR,f)},M.prototype.setInitialGroupOrderComparator=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_INITIAL_GROUP_ORDER_COMPARATOR,f)},M.prototype.setGetChartToolbarItems=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GET_CHART_TOOLBAR_ITEMS,f)},M.prototype.setPaginationNumberFormatter=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_PAGINATION_NUMBER_FORMATTER,f)},M.prototype.setGetServerSideStoreParams=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GET_SERVER_SIDE_STORE_PARAMS,f)},M.prototype.setIsServerSideGroupOpenByDefault=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_IS_SERVER_SIDE_GROUPS_OPEN_BY_DEFAULT,f)},M.prototype.setIsApplyServerSideTransaction=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_IS_APPLY_SERVER_SIDE_TRANSACTION,f)},M.prototype.setIsServerSideGroup=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_IS_SERVER_SIDE_GROUP,f)},M.prototype.setGetServerSideGroupKey=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GET_SERVER_SIDE_GROUP_KEY,f)},M.prototype.setGetRowStyle=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GET_ROW_STYLE,f)},M.prototype.setGetRowHeight=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GET_ROW_HEIGHT,f)},M.prototype.isSideBarVisible=function(){return this.sideBarComp?this.sideBarComp.isDisplayed():!1},M.prototype.setSideBarVisible=function(f){if(!this.sideBarComp){f&&console.warn("AG Grid: sideBar is not loaded");return}this.sideBarComp.setDisplayed(f)},M.prototype.setSideBarPosition=function(f){if(!this.sideBarComp){console.warn("AG Grid: sideBar is not loaded");return}this.sideBarComp.setSideBarPosition(f)},M.prototype.openToolPanel=function(f){if(!this.sideBarComp){console.warn("AG Grid: toolPanel is only available in AG Grid Enterprise");return}this.sideBarComp.openToolPanel(f)},M.prototype.closeToolPanel=function(){if(!this.sideBarComp){console.warn("AG Grid: toolPanel is only available in AG Grid Enterprise");return}this.sideBarComp.close()},M.prototype.getOpenedToolPanel=function(){return this.sideBarComp?this.sideBarComp.openedItem():null},M.prototype.getSideBar=function(){return this.gridOptionsWrapper.getSideBar()},M.prototype.setSideBar=function(f){this.gridOptionsWrapper.setProperty("sideBar",K$.parse(f))},M.prototype.setSuppressClipboardPaste=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_SUPPRESS_CLIPBOARD_PASTE,f)},M.prototype.isToolPanelShowing=function(){return this.sideBarComp.isToolPanelShowing()},M.prototype.doLayout=function(){var f="AG Grid - since version 25.1, doLayout was taken out, as it's not needed. The grid responds to grid size changes automatically";Ge(function(){return console.warn(f)},"doLayoutDeprecated")},M.prototype.resetRowHeights=function(){if(i(this.clientSideRowModel)){if(this.columnModel.isAutoRowHeightActive()){console.warn("AG Grid: calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");return}this.clientSideRowModel.resetRowHeights()}},M.prototype.setGroupRemoveSingleChildren=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GROUP_REMOVE_SINGLE_CHILDREN,f)},M.prototype.setGroupRemoveLowestSingleChildren=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN,f)},M.prototype.onRowHeightChanged=function(){this.clientSideRowModel?this.clientSideRowModel.onRowHeightChanged():this.serverSideRowModel&&this.serverSideRowModel.onRowHeightChanged()},M.prototype.getValue=function(f,d){var g=this.columnModel.getPrimaryColumn(f);return r(g)&&(g=this.columnModel.getGridColumn(f)),r(g)?null:this.valueService.getValue(g,d)},M.prototype.addEventListener=function(f,d){var g=this.gridOptionsWrapper.useAsyncEvents();this.eventService.addEventListener(f,d,g)},M.prototype.addGlobalListener=function(f){var d=this.gridOptionsWrapper.useAsyncEvents();this.eventService.addGlobalListener(f,d)},M.prototype.removeEventListener=function(f,d){var g=this.gridOptionsWrapper.useAsyncEvents();this.eventService.removeEventListener(f,d,g)},M.prototype.removeGlobalListener=function(f){var d=this.gridOptionsWrapper.useAsyncEvents();this.eventService.removeGlobalListener(f,d)},M.prototype.dispatchEvent=function(f){this.eventService.dispatchEvent(f)},M.prototype.destroy=function(){if(!this.destroyCalled){this.destroyCalled=!0;var f=this.ctrlsService.getGridCtrl();f&&f.destroyGridUi(),this.context.destroy()}},M.prototype.cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid=function(){setTimeout(J.bind(window,this,"Grid API"),100)},M.prototype.warnIfDestroyed=function(f){return this.destroyCalled&&console.warn("AG Grid: Grid API method "+f+" was called on a grid that was destroyed."),this.destroyCalled},M.prototype.resetQuickFilter=function(){this.warnIfDestroyed("resetQuickFilter")||this.rowModel.forEachNode(function(f){return f.quickFilterAggregateText=null})},M.prototype.getRangeSelections=function(){return console.warn(`AG Grid: in v20.1.x, api.getRangeSelections() is gone, please use getCellRanges() instead. We had to change how cell selections works a small bit to allow charting to integrate. The return type of - getCellRanges() is a bit different, please check the AG Grid documentation.`),null},M.prototype.getCellRanges=function(){return this.rangeService?this.rangeService.getCellRanges():(console.warn("AG Grid: cell range selection is only available in AG Grid Enterprise"),null)},M.prototype.camelCaseToHumanReadable=function(f){return Mr(f)},M.prototype.addRangeSelection=function(f){console.warn("AG Grid: As of version 21.x, range selection changed slightly to allow charting integration. Please call api.addCellRange() instead of api.addRangeSelection()")},M.prototype.addCellRange=function(f){this.rangeService||console.warn("AG Grid: cell range selection is only available in AG Grid Enterprise"),this.rangeService.addCellRange(f)},M.prototype.clearRangeSelection=function(){this.rangeService||console.warn("AG Grid: cell range selection is only available in AG Grid Enterprise"),this.rangeService.removeAllCellRanges()},M.prototype.undoCellEditing=function(){this.undoRedoService.undo()},M.prototype.redoCellEditing=function(){this.undoRedoService.redo()},M.prototype.getCurrentUndoSize=function(){return this.undoRedoService.getCurrentUndoStackSize()},M.prototype.getCurrentRedoSize=function(){return this.undoRedoService.getCurrentRedoStackSize()},M.prototype.getChartModels=function(){if(ni.assertRegistered(t.ModuleNames.RangeSelectionModule,"api.getChartModels")&&ni.assertRegistered(t.ModuleNames.GridChartsModule,"api.getChartModels"))return this.chartService.getChartModels()},M.prototype.getChartRef=function(f){if(ni.assertRegistered(t.ModuleNames.RangeSelectionModule,"api.getChartRef")&&ni.assertRegistered(t.ModuleNames.GridChartsModule,"api.getChartRef"))return this.chartService.getChartRef(f)},M.prototype.getChartImageDataURL=function(f){if(ni.assertRegistered(t.ModuleNames.RangeSelectionModule,"api.getChartImageDataURL")&&ni.assertRegistered(t.ModuleNames.GridChartsModule,"api.getChartImageDataURL"))return this.chartService.getChartImageDataURL(f)},M.prototype.createRangeChart=function(f){if(ni.assertRegistered(t.ModuleNames.RangeSelectionModule,"api.createRangeChart")&&ni.assertRegistered(t.ModuleNames.GridChartsModule,"api.createRangeChart"))return this.chartService.createRangeChart(f)},M.prototype.createCrossFilterChart=function(f){if(ni.assertRegistered(t.ModuleNames.RangeSelectionModule,"api.createCrossFilterChart")&&ni.assertRegistered(t.ModuleNames.GridChartsModule,"api.createCrossFilterChart"))return this.chartService.createCrossFilterChart(f)},M.prototype.restoreChart=function(f,h){if(ni.assertRegistered(t.ModuleNames.RangeSelectionModule,"api.restoreChart")&&ni.assertRegistered(t.ModuleNames.GridChartsModule,"api.restoreChart"))return this.chartService.restoreChart(f,h)},M.prototype.createPivotChart=function(f){if(ni.assertRegistered(t.ModuleNames.RangeSelectionModule,"api.createPivotChart")&&ni.assertRegistered(t.ModuleNames.GridChartsModule,"api.createPivotChart"))return this.chartService.createPivotChart(f)},M.prototype.copySelectedRowsToClipboard=function(f){this.clipboardService||console.warn("AG Grid: clipboard is only available in AG Grid Enterprise"),this.clipboardService.copySelectedRowsToClipboard(f)},M.prototype.copySelectedRangeToClipboard=function(f){this.clipboardService||console.warn("AG Grid: clipboard is only available in AG Grid Enterprise"),this.clipboardService.copySelectedRangeToClipboard(f)},M.prototype.copySelectedRangeDown=function(){this.clipboardService||console.warn("AG Grid: clipboard is only available in AG Grid Enterprise"),this.clipboardService.copyRangeDown()},M.prototype.showColumnMenuAfterButtonClick=function(f,h){var g=this.columnModel.getGridColumn(f);this.menuFactory.showMenuAfterButtonClick(g,h,"columnMenu")},M.prototype.showColumnMenuAfterMouseClick=function(f,h){var g=this.columnModel.getGridColumn(f);if(g||(g=this.columnModel.getPrimaryColumn(f)),!g){console.error("AG Grid: column '"+f+"' not found");return}this.menuFactory.showMenuAfterMouseEvent(g,h)},M.prototype.hidePopupMenu=function(){this.contextMenuFactory&&this.contextMenuFactory.hideActiveMenu(),this.menuFactory.hideActiveMenu()},M.prototype.setPopupParent=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_POPUP_PARENT,f)},M.prototype.tabToNextCell=function(f){return this.navigationService.tabToNextCell(!1,f)},M.prototype.tabToPreviousCell=function(f){return this.navigationService.tabToNextCell(!0,f)},M.prototype.getCellRendererInstances=function(f){f===void 0&&(f={});var h=this.rowRenderer.getCellRendererInstances(f),g=h.map(Bx);return g},M.prototype.getCellEditorInstances=function(f){f===void 0&&(f={});var h=this.rowRenderer.getCellEditorInstances(f),g=h.map(Bx);return g},M.prototype.getEditingCells=function(){return this.rowRenderer.getEditingCells()},M.prototype.stopEditing=function(f){f===void 0&&(f=!1),this.rowRenderer.stopEditing(f)},M.prototype.startEditingCell=function(f){var h=this.columnModel.getGridColumn(f.colKey);if(!h){console.warn("AG Grid: no column found for "+f.colKey);return}var g={rowIndex:f.rowIndex,rowPinned:f.rowPinned||null,column:h},x=f.rowPinned==null;x&&this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(f.rowIndex);var P=this.navigationService.getCellByPosition(g);P&&P.startRowOrCellEdit(f.key,f.charPress)},M.prototype.addAggFunc=function(f,h){this.aggFuncService&&this.aggFuncService.addAggFunc(f,h)},M.prototype.addAggFuncs=function(f){this.aggFuncService&&this.aggFuncService.addAggFuncs(f)},M.prototype.clearAggFuncs=function(){this.aggFuncService&&this.aggFuncService.clear()},M.prototype.applyServerSideTransaction=function(f){if(!this.serverSideTransactionManager){console.warn("AG Grid: Cannot apply Server Side Transaction if not using the Server Side Row Model.");return}return this.serverSideTransactionManager.applyTransaction(f)},M.prototype.applyServerSideTransactionAsync=function(f,h){if(!this.serverSideTransactionManager){console.warn("AG Grid: Cannot apply Server Side Transaction if not using the Server Side Row Model.");return}return this.serverSideTransactionManager.applyTransactionAsync(f,h)},M.prototype.retryServerSideLoads=function(){if(!this.serverSideRowModel){console.warn("AG Grid: API retryServerSideLoads() can only be used when using Server-Side Row Model.");return}this.serverSideRowModel.retryLoads()},M.prototype.flushServerSideAsyncTransactions=function(){if(!this.serverSideTransactionManager){console.warn("AG Grid: Cannot flush Server Side Transaction if not using the Server Side Row Model.");return}return this.serverSideTransactionManager.flushAsyncTransactions()},M.prototype.applyTransaction=function(f){if(!this.clientSideRowModel){console.error("AG Grid: updateRowData() only works with ClientSideRowModel. Working with InfiniteRowModel was deprecated in v23.1 and removed in v24.1");return}var h=this.clientSideRowModel.updateRowData(f);return this.rowRenderer.refreshFullWidthRows(h.update),this.gridOptionsWrapper.isSuppressChangeDetection()||this.rowRenderer.refreshCells(),h},M.prototype.setDeltaSort=function(f){this.gridOptionsWrapper.setProperty("deltaSort",f)},M.prototype.updateRowData=function(f){var h="AG Grid: as of v23.1, grid API updateRowData(transaction) is now called applyTransaction(transaction). updateRowData is deprecated and will be removed in a future major release.";return ze(function(){return console.warn(h)},"updateRowData deprecated"),this.applyTransaction(f)},M.prototype.applyTransactionAsync=function(f,h){if(!this.clientSideRowModel){console.error("AG Grid: api.applyTransactionAsync() only works with ClientSideRowModel.");return}this.clientSideRowModel.batchUpdateRowData(f,h)},M.prototype.flushAsyncTransactions=function(){if(!this.clientSideRowModel){console.error("AG Grid: api.applyTransactionAsync() only works with ClientSideRowModel.");return}this.clientSideRowModel.flushAsyncTransactions()},M.prototype.batchUpdateRowData=function(f,h){var g="AG Grid: as of v23.1, grid API batchUpdateRowData(transaction, callback) is now called applyTransactionAsync(transaction, callback). batchUpdateRowData is deprecated and will be removed in a future major release.";ze(function(){return console.warn(g)},"batchUpdateRowData deprecated"),this.applyTransactionAsync(f,h)},M.prototype.insertItemsAtIndex=function(f,h,g){console.warn("AG Grid: insertItemsAtIndex() is deprecated, use updateRowData(transaction) instead."),this.updateRowData({add:h,addIndex:f,update:null,remove:null})},M.prototype.removeItems=function(f,h){console.warn("AG Grid: removeItems() is deprecated, use updateRowData(transaction) instead.");var g=f.map(function(x){return x.data});this.updateRowData({add:null,addIndex:null,update:null,remove:g})},M.prototype.addItems=function(f,h){console.warn("AG Grid: addItems() is deprecated, use updateRowData(transaction) instead."),this.updateRowData({add:f,addIndex:null,update:null,remove:null})},M.prototype.refreshVirtualPageCache=function(){console.warn("AG Grid: refreshVirtualPageCache() is now called refreshInfiniteCache(), please call refreshInfiniteCache() instead"),this.refreshInfiniteCache()},M.prototype.refreshInfinitePageCache=function(){console.warn("AG Grid: refreshInfinitePageCache() is now called refreshInfiniteCache(), please call refreshInfiniteCache() instead"),this.refreshInfiniteCache()},M.prototype.refreshInfiniteCache=function(){this.infiniteRowModel?this.infiniteRowModel.refreshCache():console.warn("AG Grid: api.refreshInfiniteCache is only available when rowModelType='infinite'.")},M.prototype.purgeVirtualPageCache=function(){console.warn("AG Grid: purgeVirtualPageCache() is now called purgeInfiniteCache(), please call purgeInfiniteCache() instead"),this.purgeInfinitePageCache()},M.prototype.purgeInfinitePageCache=function(){console.warn("AG Grid: purgeInfinitePageCache() is now called purgeInfiniteCache(), please call purgeInfiniteCache() instead"),this.purgeInfiniteCache()},M.prototype.purgeInfiniteCache=function(){this.infiniteRowModel?this.infiniteRowModel.purgeCache():console.warn("AG Grid: api.purgeInfiniteCache is only available when rowModelType='infinite'.")},M.prototype.purgeEnterpriseCache=function(f){console.warn("ag-grid: since version 18.x, api.purgeEnterpriseCache() should be replaced with api.purgeServerSideCache()"),this.purgeServerSideCache(f)},M.prototype.purgeServerSideCache=function(f){f===void 0&&(f=[]),this.serverSideRowModel?(console.warn("AG Grid: since v25.0, api.purgeServerSideCache is deprecated. Please use api.refreshServerSideStore({purge: true}) instead."),this.refreshServerSideStore({route:f,purge:!0})):console.warn("AG Grid: api.purgeServerSideCache is only available when rowModelType='serverSide'.")},M.prototype.refreshServerSideStore=function(f){this.serverSideRowModel?this.serverSideRowModel.refreshStore(f):console.warn("AG Grid: api.refreshServerSideStore is only available when rowModelType='serverSide'.")},M.prototype.getServerSideStoreState=function(){return this.serverSideRowModel?this.serverSideRowModel.getStoreState():(console.warn("AG Grid: api.getServerSideStoreState is only available when rowModelType='serverSide'."),[])},M.prototype.getVirtualRowCount=function(){return console.warn("AG Grid: getVirtualRowCount() is now called getInfiniteRowCount(), please call getInfiniteRowCount() instead"),this.getInfiniteRowCount()},M.prototype.getInfiniteRowCount=function(){if(this.infiniteRowModel)return this.infiniteRowModel.getRowCount();console.warn("AG Grid: api.getVirtualRowCount is only available when rowModelType='virtual'.")},M.prototype.isMaxRowFound=function(){return console.warn("AG Grid: api.isLastRowIndexKnown is deprecated, please use api.isLastRowIndexKnown()"),this.isLastRowIndexKnown()},M.prototype.isLastRowIndexKnown=function(){if(this.infiniteRowModel)return this.infiniteRowModel.isLastRowIndexKnown();console.warn("AG Grid: api.isMaxRowFound is only available when rowModelType='virtual'.")},M.prototype.setVirtualRowCount=function(f,h){console.warn("AG Grid: setVirtualRowCount() is now called setInfiniteRowCount(), please call setInfiniteRowCount() instead"),this.setRowCount(f,h)},M.prototype.setInfiniteRowCount=function(f,h){console.warn("AG Grid: setInfiniteRowCount() is now called setRowCount(), please call setRowCount() instead"),this.setRowCount(f,h)},M.prototype.setRowCount=function(f,h){this.infiniteRowModel?this.infiniteRowModel.setRowCount(f,h):console.warn("AG Grid: api.setRowCount is only available for Infinite Row Model.")},M.prototype.getVirtualPageState=function(){return console.warn("AG Grid: getVirtualPageState() is now called getCacheBlockState(), please call getCacheBlockState() instead"),this.getCacheBlockState()},M.prototype.getInfinitePageState=function(){return console.warn("AG Grid: getInfinitePageState() is now called getCacheBlockState(), please call getCacheBlockState() instead"),this.getCacheBlockState()},M.prototype.getCacheBlockState=function(){return this.rowNodeBlockLoader.getBlockState()},M.prototype.checkGridSize=function(){console.warn("in AG Grid v25.2.0, checkGridSize() was removed, as it was legacy and didn't do anything uesful.")},M.prototype.getFirstRenderedRow=function(){return console.warn("in AG Grid v12, getFirstRenderedRow() was renamed to getFirstDisplayedRow()"),this.getFirstDisplayedRow()},M.prototype.getFirstDisplayedRow=function(){return this.rowRenderer.getFirstVirtualRenderedRow()},M.prototype.getLastRenderedRow=function(){return console.warn("in AG Grid v12, getLastRenderedRow() was renamed to getLastDisplayedRow()"),this.getLastDisplayedRow()},M.prototype.getLastDisplayedRow=function(){return this.rowRenderer.getLastVirtualRenderedRow()},M.prototype.getDisplayedRowAtIndex=function(f){return this.rowModel.getRow(f)},M.prototype.getDisplayedRowCount=function(){return this.rowModel.getRowCount()},M.prototype.paginationIsLastPageFound=function(){return this.paginationProxy.isLastPageFound()},M.prototype.paginationGetPageSize=function(){return this.paginationProxy.getPageSize()},M.prototype.paginationSetPageSize=function(f){this.gridOptionsWrapper.setProperty("paginationPageSize",f)},M.prototype.paginationGetCurrentPage=function(){return this.paginationProxy.getCurrentPage()},M.prototype.paginationGetTotalPages=function(){return this.paginationProxy.getTotalPages()},M.prototype.paginationGetRowCount=function(){return this.paginationProxy.getMasterRowCount()},M.prototype.paginationGoToNextPage=function(){this.paginationProxy.goToNextPage()},M.prototype.paginationGoToPreviousPage=function(){this.paginationProxy.goToPreviousPage()},M.prototype.paginationGoToFirstPage=function(){this.paginationProxy.goToFirstPage()},M.prototype.paginationGoToLastPage=function(){this.paginationProxy.goToLastPage()},M.prototype.paginationGoToPage=function(f){this.paginationProxy.goToPage(f)},M.prototype.setRowClass=function(f){this.gridOptionsWrapper.setProperty(Bn.PROP_ROW_CLASS,f)},Ul([Ce("immutableService")],M.prototype,"immutableService",void 0),Ul([Ce("csvCreator")],M.prototype,"csvCreator",void 0),Ul([Ce("excelCreator")],M.prototype,"excelCreator",void 0),Ul([ce("rowRenderer")],M.prototype,"rowRenderer",void 0),Ul([ce("navigationService")],M.prototype,"navigationService",void 0),Ul([ce("filterManager")],M.prototype,"filterManager",void 0),Ul([ce("columnModel")],M.prototype,"columnModel",void 0),Ul([ce("selectionService")],M.prototype,"selectionService",void 0),Ul([ce("gridOptionsWrapper")],M.prototype,"gridOptionsWrapper",void 0),Ul([ce("valueService")],M.prototype,"valueService",void 0),Ul([ce("alignedGridsService")],M.prototype,"alignedGridsService",void 0),Ul([ce("eventService")],M.prototype,"eventService",void 0),Ul([ce("pinnedRowModel")],M.prototype,"pinnedRowModel",void 0),Ul([ce("context")],M.prototype,"context",void 0),Ul([ce("rowModel")],M.prototype,"rowModel",void 0),Ul([ce("sortController")],M.prototype,"sortController",void 0),Ul([ce("paginationProxy")],M.prototype,"paginationProxy",void 0),Ul([ce("focusService")],M.prototype,"focusService",void 0),Ul([ce("dragAndDropService")],M.prototype,"dragAndDropService",void 0),Ul([Ce("rangeService")],M.prototype,"rangeService",void 0),Ul([Ce("clipboardService")],M.prototype,"clipboardService",void 0),Ul([Ce("aggFuncService")],M.prototype,"aggFuncService",void 0),Ul([ce("menuFactory")],M.prototype,"menuFactory",void 0),Ul([Ce("contextMenuFactory")],M.prototype,"contextMenuFactory",void 0),Ul([ce("valueCache")],M.prototype,"valueCache",void 0),Ul([ce("animationFrameService")],M.prototype,"animationFrameService",void 0),Ul([Ce("statusBarService")],M.prototype,"statusBarService",void 0),Ul([Ce("chartService")],M.prototype,"chartService",void 0),Ul([Ce("undoRedoService")],M.prototype,"undoRedoService",void 0),Ul([Ce("rowNodeBlockLoader")],M.prototype,"rowNodeBlockLoader",void 0),Ul([Ce("ssrmTransactionManager")],M.prototype,"serverSideTransactionManager",void 0),Ul([ce("ctrlsService")],M.prototype,"ctrlsService",void 0),Ul([Ce("frameworkComponentWrapper")],M.prototype,"frameworkComponentWrapper",void 0),Ul([it],M.prototype,"init",null),Ul([pt],M.prototype,"cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid",null),M=Ul([Le("gridApi")],M),M}();/** + getCellRanges() is a bit different, please check the AG Grid documentation.`),null},M.prototype.getCellRanges=function(){return this.rangeService?this.rangeService.getCellRanges():(console.warn("AG Grid: cell range selection is only available in AG Grid Enterprise"),null)},M.prototype.camelCaseToHumanReadable=function(f){return Br(f)},M.prototype.addRangeSelection=function(f){console.warn("AG Grid: As of version 21.x, range selection changed slightly to allow charting integration. Please call api.addCellRange() instead of api.addRangeSelection()")},M.prototype.addCellRange=function(f){this.rangeService||console.warn("AG Grid: cell range selection is only available in AG Grid Enterprise"),this.rangeService.addCellRange(f)},M.prototype.clearRangeSelection=function(){this.rangeService||console.warn("AG Grid: cell range selection is only available in AG Grid Enterprise"),this.rangeService.removeAllCellRanges()},M.prototype.undoCellEditing=function(){this.undoRedoService.undo()},M.prototype.redoCellEditing=function(){this.undoRedoService.redo()},M.prototype.getCurrentUndoSize=function(){return this.undoRedoService.getCurrentUndoStackSize()},M.prototype.getCurrentRedoSize=function(){return this.undoRedoService.getCurrentRedoStackSize()},M.prototype.getChartModels=function(){if(Xt.assertRegistered(t.ModuleNames.RangeSelectionModule,"api.getChartModels")&&Xt.assertRegistered(t.ModuleNames.GridChartsModule,"api.getChartModels"))return this.chartService.getChartModels()},M.prototype.getChartRef=function(f){if(Xt.assertRegistered(t.ModuleNames.RangeSelectionModule,"api.getChartRef")&&Xt.assertRegistered(t.ModuleNames.GridChartsModule,"api.getChartRef"))return this.chartService.getChartRef(f)},M.prototype.getChartImageDataURL=function(f){if(Xt.assertRegistered(t.ModuleNames.RangeSelectionModule,"api.getChartImageDataURL")&&Xt.assertRegistered(t.ModuleNames.GridChartsModule,"api.getChartImageDataURL"))return this.chartService.getChartImageDataURL(f)},M.prototype.createRangeChart=function(f){if(Xt.assertRegistered(t.ModuleNames.RangeSelectionModule,"api.createRangeChart")&&Xt.assertRegistered(t.ModuleNames.GridChartsModule,"api.createRangeChart"))return this.chartService.createRangeChart(f)},M.prototype.createCrossFilterChart=function(f){if(Xt.assertRegistered(t.ModuleNames.RangeSelectionModule,"api.createCrossFilterChart")&&Xt.assertRegistered(t.ModuleNames.GridChartsModule,"api.createCrossFilterChart"))return this.chartService.createCrossFilterChart(f)},M.prototype.restoreChart=function(f,d){if(Xt.assertRegistered(t.ModuleNames.RangeSelectionModule,"api.restoreChart")&&Xt.assertRegistered(t.ModuleNames.GridChartsModule,"api.restoreChart"))return this.chartService.restoreChart(f,d)},M.prototype.createPivotChart=function(f){if(Xt.assertRegistered(t.ModuleNames.RangeSelectionModule,"api.createPivotChart")&&Xt.assertRegistered(t.ModuleNames.GridChartsModule,"api.createPivotChart"))return this.chartService.createPivotChart(f)},M.prototype.copySelectedRowsToClipboard=function(f){this.clipboardService||console.warn("AG Grid: clipboard is only available in AG Grid Enterprise"),this.clipboardService.copySelectedRowsToClipboard(f)},M.prototype.copySelectedRangeToClipboard=function(f){this.clipboardService||console.warn("AG Grid: clipboard is only available in AG Grid Enterprise"),this.clipboardService.copySelectedRangeToClipboard(f)},M.prototype.copySelectedRangeDown=function(){this.clipboardService||console.warn("AG Grid: clipboard is only available in AG Grid Enterprise"),this.clipboardService.copyRangeDown()},M.prototype.showColumnMenuAfterButtonClick=function(f,d){var g=this.columnModel.getGridColumn(f);this.menuFactory.showMenuAfterButtonClick(g,d,"columnMenu")},M.prototype.showColumnMenuAfterMouseClick=function(f,d){var g=this.columnModel.getGridColumn(f);if(g||(g=this.columnModel.getPrimaryColumn(f)),!g){console.error("AG Grid: column '"+f+"' not found");return}this.menuFactory.showMenuAfterMouseEvent(g,d)},M.prototype.hidePopupMenu=function(){this.contextMenuFactory&&this.contextMenuFactory.hideActiveMenu(),this.menuFactory.hideActiveMenu()},M.prototype.setPopupParent=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_POPUP_PARENT,f)},M.prototype.tabToNextCell=function(f){return this.navigationService.tabToNextCell(!1,f)},M.prototype.tabToPreviousCell=function(f){return this.navigationService.tabToNextCell(!0,f)},M.prototype.getCellRendererInstances=function(f){f===void 0&&(f={});var d=this.rowRenderer.getCellRendererInstances(f),g=d.map(Vx);return g},M.prototype.getCellEditorInstances=function(f){f===void 0&&(f={});var d=this.rowRenderer.getCellEditorInstances(f),g=d.map(Vx);return g},M.prototype.getEditingCells=function(){return this.rowRenderer.getEditingCells()},M.prototype.stopEditing=function(f){f===void 0&&(f=!1),this.rowRenderer.stopEditing(f)},M.prototype.startEditingCell=function(f){var d=this.columnModel.getGridColumn(f.colKey);if(!d){console.warn("AG Grid: no column found for "+f.colKey);return}var g={rowIndex:f.rowIndex,rowPinned:f.rowPinned||null,column:d},S=f.rowPinned==null;S&&this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(f.rowIndex);var O=this.navigationService.getCellByPosition(g);O&&O.startRowOrCellEdit(f.key,f.charPress)},M.prototype.addAggFunc=function(f,d){this.aggFuncService&&this.aggFuncService.addAggFunc(f,d)},M.prototype.addAggFuncs=function(f){this.aggFuncService&&this.aggFuncService.addAggFuncs(f)},M.prototype.clearAggFuncs=function(){this.aggFuncService&&this.aggFuncService.clear()},M.prototype.applyServerSideTransaction=function(f){if(!this.serverSideTransactionManager){console.warn("AG Grid: Cannot apply Server Side Transaction if not using the Server Side Row Model.");return}return this.serverSideTransactionManager.applyTransaction(f)},M.prototype.applyServerSideTransactionAsync=function(f,d){if(!this.serverSideTransactionManager){console.warn("AG Grid: Cannot apply Server Side Transaction if not using the Server Side Row Model.");return}return this.serverSideTransactionManager.applyTransactionAsync(f,d)},M.prototype.retryServerSideLoads=function(){if(!this.serverSideRowModel){console.warn("AG Grid: API retryServerSideLoads() can only be used when using Server-Side Row Model.");return}this.serverSideRowModel.retryLoads()},M.prototype.flushServerSideAsyncTransactions=function(){if(!this.serverSideTransactionManager){console.warn("AG Grid: Cannot flush Server Side Transaction if not using the Server Side Row Model.");return}return this.serverSideTransactionManager.flushAsyncTransactions()},M.prototype.applyTransaction=function(f){if(!this.clientSideRowModel){console.error("AG Grid: updateRowData() only works with ClientSideRowModel. Working with InfiniteRowModel was deprecated in v23.1 and removed in v24.1");return}var d=this.clientSideRowModel.updateRowData(f);return this.rowRenderer.refreshFullWidthRows(d.update),this.gridOptionsWrapper.isSuppressChangeDetection()||this.rowRenderer.refreshCells(),d},M.prototype.setDeltaSort=function(f){this.gridOptionsWrapper.setProperty("deltaSort",f)},M.prototype.updateRowData=function(f){var d="AG Grid: as of v23.1, grid API updateRowData(transaction) is now called applyTransaction(transaction). updateRowData is deprecated and will be removed in a future major release.";return Ge(function(){return console.warn(d)},"updateRowData deprecated"),this.applyTransaction(f)},M.prototype.applyTransactionAsync=function(f,d){if(!this.clientSideRowModel){console.error("AG Grid: api.applyTransactionAsync() only works with ClientSideRowModel.");return}this.clientSideRowModel.batchUpdateRowData(f,d)},M.prototype.flushAsyncTransactions=function(){if(!this.clientSideRowModel){console.error("AG Grid: api.applyTransactionAsync() only works with ClientSideRowModel.");return}this.clientSideRowModel.flushAsyncTransactions()},M.prototype.batchUpdateRowData=function(f,d){var g="AG Grid: as of v23.1, grid API batchUpdateRowData(transaction, callback) is now called applyTransactionAsync(transaction, callback). batchUpdateRowData is deprecated and will be removed in a future major release.";Ge(function(){return console.warn(g)},"batchUpdateRowData deprecated"),this.applyTransactionAsync(f,d)},M.prototype.insertItemsAtIndex=function(f,d,g){console.warn("AG Grid: insertItemsAtIndex() is deprecated, use updateRowData(transaction) instead."),this.updateRowData({add:d,addIndex:f,update:null,remove:null})},M.prototype.removeItems=function(f,d){console.warn("AG Grid: removeItems() is deprecated, use updateRowData(transaction) instead.");var g=f.map(function(S){return S.data});this.updateRowData({add:null,addIndex:null,update:null,remove:g})},M.prototype.addItems=function(f,d){console.warn("AG Grid: addItems() is deprecated, use updateRowData(transaction) instead."),this.updateRowData({add:f,addIndex:null,update:null,remove:null})},M.prototype.refreshVirtualPageCache=function(){console.warn("AG Grid: refreshVirtualPageCache() is now called refreshInfiniteCache(), please call refreshInfiniteCache() instead"),this.refreshInfiniteCache()},M.prototype.refreshInfinitePageCache=function(){console.warn("AG Grid: refreshInfinitePageCache() is now called refreshInfiniteCache(), please call refreshInfiniteCache() instead"),this.refreshInfiniteCache()},M.prototype.refreshInfiniteCache=function(){this.infiniteRowModel?this.infiniteRowModel.refreshCache():console.warn("AG Grid: api.refreshInfiniteCache is only available when rowModelType='infinite'.")},M.prototype.purgeVirtualPageCache=function(){console.warn("AG Grid: purgeVirtualPageCache() is now called purgeInfiniteCache(), please call purgeInfiniteCache() instead"),this.purgeInfinitePageCache()},M.prototype.purgeInfinitePageCache=function(){console.warn("AG Grid: purgeInfinitePageCache() is now called purgeInfiniteCache(), please call purgeInfiniteCache() instead"),this.purgeInfiniteCache()},M.prototype.purgeInfiniteCache=function(){this.infiniteRowModel?this.infiniteRowModel.purgeCache():console.warn("AG Grid: api.purgeInfiniteCache is only available when rowModelType='infinite'.")},M.prototype.purgeEnterpriseCache=function(f){console.warn("ag-grid: since version 18.x, api.purgeEnterpriseCache() should be replaced with api.purgeServerSideCache()"),this.purgeServerSideCache(f)},M.prototype.purgeServerSideCache=function(f){f===void 0&&(f=[]),this.serverSideRowModel?(console.warn("AG Grid: since v25.0, api.purgeServerSideCache is deprecated. Please use api.refreshServerSideStore({purge: true}) instead."),this.refreshServerSideStore({route:f,purge:!0})):console.warn("AG Grid: api.purgeServerSideCache is only available when rowModelType='serverSide'.")},M.prototype.refreshServerSideStore=function(f){this.serverSideRowModel?this.serverSideRowModel.refreshStore(f):console.warn("AG Grid: api.refreshServerSideStore is only available when rowModelType='serverSide'.")},M.prototype.getServerSideStoreState=function(){return this.serverSideRowModel?this.serverSideRowModel.getStoreState():(console.warn("AG Grid: api.getServerSideStoreState is only available when rowModelType='serverSide'."),[])},M.prototype.getVirtualRowCount=function(){return console.warn("AG Grid: getVirtualRowCount() is now called getInfiniteRowCount(), please call getInfiniteRowCount() instead"),this.getInfiniteRowCount()},M.prototype.getInfiniteRowCount=function(){if(this.infiniteRowModel)return this.infiniteRowModel.getRowCount();console.warn("AG Grid: api.getVirtualRowCount is only available when rowModelType='virtual'.")},M.prototype.isMaxRowFound=function(){return console.warn("AG Grid: api.isLastRowIndexKnown is deprecated, please use api.isLastRowIndexKnown()"),this.isLastRowIndexKnown()},M.prototype.isLastRowIndexKnown=function(){if(this.infiniteRowModel)return this.infiniteRowModel.isLastRowIndexKnown();console.warn("AG Grid: api.isMaxRowFound is only available when rowModelType='virtual'.")},M.prototype.setVirtualRowCount=function(f,d){console.warn("AG Grid: setVirtualRowCount() is now called setInfiniteRowCount(), please call setInfiniteRowCount() instead"),this.setRowCount(f,d)},M.prototype.setInfiniteRowCount=function(f,d){console.warn("AG Grid: setInfiniteRowCount() is now called setRowCount(), please call setRowCount() instead"),this.setRowCount(f,d)},M.prototype.setRowCount=function(f,d){this.infiniteRowModel?this.infiniteRowModel.setRowCount(f,d):console.warn("AG Grid: api.setRowCount is only available for Infinite Row Model.")},M.prototype.getVirtualPageState=function(){return console.warn("AG Grid: getVirtualPageState() is now called getCacheBlockState(), please call getCacheBlockState() instead"),this.getCacheBlockState()},M.prototype.getInfinitePageState=function(){return console.warn("AG Grid: getInfinitePageState() is now called getCacheBlockState(), please call getCacheBlockState() instead"),this.getCacheBlockState()},M.prototype.getCacheBlockState=function(){return this.rowNodeBlockLoader.getBlockState()},M.prototype.checkGridSize=function(){console.warn("in AG Grid v25.2.0, checkGridSize() was removed, as it was legacy and didn't do anything uesful.")},M.prototype.getFirstRenderedRow=function(){return console.warn("in AG Grid v12, getFirstRenderedRow() was renamed to getFirstDisplayedRow()"),this.getFirstDisplayedRow()},M.prototype.getFirstDisplayedRow=function(){return this.rowRenderer.getFirstVirtualRenderedRow()},M.prototype.getLastRenderedRow=function(){return console.warn("in AG Grid v12, getLastRenderedRow() was renamed to getLastDisplayedRow()"),this.getLastDisplayedRow()},M.prototype.getLastDisplayedRow=function(){return this.rowRenderer.getLastVirtualRenderedRow()},M.prototype.getDisplayedRowAtIndex=function(f){return this.rowModel.getRow(f)},M.prototype.getDisplayedRowCount=function(){return this.rowModel.getRowCount()},M.prototype.paginationIsLastPageFound=function(){return this.paginationProxy.isLastPageFound()},M.prototype.paginationGetPageSize=function(){return this.paginationProxy.getPageSize()},M.prototype.paginationSetPageSize=function(f){this.gridOptionsWrapper.setProperty("paginationPageSize",f)},M.prototype.paginationGetCurrentPage=function(){return this.paginationProxy.getCurrentPage()},M.prototype.paginationGetTotalPages=function(){return this.paginationProxy.getTotalPages()},M.prototype.paginationGetRowCount=function(){return this.paginationProxy.getMasterRowCount()},M.prototype.paginationGoToNextPage=function(){this.paginationProxy.goToNextPage()},M.prototype.paginationGoToPreviousPage=function(){this.paginationProxy.goToPreviousPage()},M.prototype.paginationGoToFirstPage=function(){this.paginationProxy.goToFirstPage()},M.prototype.paginationGoToLastPage=function(){this.paginationProxy.goToLastPage()},M.prototype.paginationGoToPage=function(f){this.paginationProxy.goToPage(f)},M.prototype.setRowClass=function(f){this.gridOptionsWrapper.setProperty(Zn.PROP_ROW_CLASS,f)},Zl([Ae("immutableService")],M.prototype,"immutableService",void 0),Zl([Ae("csvCreator")],M.prototype,"csvCreator",void 0),Zl([Ae("excelCreator")],M.prototype,"excelCreator",void 0),Zl([pe("rowRenderer")],M.prototype,"rowRenderer",void 0),Zl([pe("navigationService")],M.prototype,"navigationService",void 0),Zl([pe("filterManager")],M.prototype,"filterManager",void 0),Zl([pe("columnModel")],M.prototype,"columnModel",void 0),Zl([pe("selectionService")],M.prototype,"selectionService",void 0),Zl([pe("gridOptionsWrapper")],M.prototype,"gridOptionsWrapper",void 0),Zl([pe("valueService")],M.prototype,"valueService",void 0),Zl([pe("alignedGridsService")],M.prototype,"alignedGridsService",void 0),Zl([pe("eventService")],M.prototype,"eventService",void 0),Zl([pe("pinnedRowModel")],M.prototype,"pinnedRowModel",void 0),Zl([pe("context")],M.prototype,"context",void 0),Zl([pe("rowModel")],M.prototype,"rowModel",void 0),Zl([pe("sortController")],M.prototype,"sortController",void 0),Zl([pe("paginationProxy")],M.prototype,"paginationProxy",void 0),Zl([pe("focusService")],M.prototype,"focusService",void 0),Zl([pe("dragAndDropService")],M.prototype,"dragAndDropService",void 0),Zl([Ae("rangeService")],M.prototype,"rangeService",void 0),Zl([Ae("clipboardService")],M.prototype,"clipboardService",void 0),Zl([Ae("aggFuncService")],M.prototype,"aggFuncService",void 0),Zl([pe("menuFactory")],M.prototype,"menuFactory",void 0),Zl([Ae("contextMenuFactory")],M.prototype,"contextMenuFactory",void 0),Zl([pe("valueCache")],M.prototype,"valueCache",void 0),Zl([pe("animationFrameService")],M.prototype,"animationFrameService",void 0),Zl([Ae("statusBarService")],M.prototype,"statusBarService",void 0),Zl([Ae("chartService")],M.prototype,"chartService",void 0),Zl([Ae("undoRedoService")],M.prototype,"undoRedoService",void 0),Zl([Ae("rowNodeBlockLoader")],M.prototype,"rowNodeBlockLoader",void 0),Zl([Ae("ssrmTransactionManager")],M.prototype,"serverSideTransactionManager",void 0),Zl([pe("ctrlsService")],M.prototype,"ctrlsService",void 0),Zl([Ae("frameworkComponentWrapper")],M.prototype,"frameworkComponentWrapper",void 0),Zl([ht],M.prototype,"init",null),Zl([wt],M.prototype,"cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid",null),M=Zl([Ne("gridApi")],M),M}();/** * @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/ * @license MIT - */var Hz=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Fie=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},q4=function(M){Hz(f,M);function f(h,g,x,P){var z=M.call(this)||this;return z.columnOrGroup=h,z.eCell=g,z.ariaEl=z.eCell.querySelector("[role=columnheader]")||z.eCell,z.colsSpanning=P,z.beans=x,z}return f.prototype.setColsSpanning=function(h){this.colsSpanning=h,this.onLeftChanged()},f.prototype.getColumnOrGroup=function(){return this.beans.gridOptionsWrapper.isEnableRtl()&&this.colsSpanning?m(this.colsSpanning):this.columnOrGroup},f.prototype.postConstruct=function(){this.addManagedListener(this.columnOrGroup,W.EVENT_LEFT_CHANGED,this.onLeftChanged.bind(this)),this.setLeftFirstTime(),this.addManagedListener(this.eventService,li.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onLeftChanged.bind(this)),this.addManagedListener(this.beans.gridOptionsWrapper,Bn.PROP_DOM_LAYOUT,this.onLeftChanged.bind(this))},f.prototype.setLeftFirstTime=function(){var h=this.beans.gridOptionsWrapper.isSuppressColumnMoveAnimation(),g=i(this.columnOrGroup.getOldLeft()),x=this.beans.columnAnimationService.isActive()&&g&&!h;x?this.animateInLeft():this.onLeftChanged()},f.prototype.animateInLeft=function(){var h=this,g=this.getColumnOrGroup(),x=g.getLeft(),P=g.getOldLeft(),z=this.modifyLeftForPrintLayout(g,P),ee=this.modifyLeftForPrintLayout(g,x);this.setLeft(z),this.actualLeft=ee,this.beans.columnAnimationService.executeNextVMTurn(function(){h.actualLeft===ee&&h.setLeft(ee)})},f.prototype.onLeftChanged=function(){var h=this.getColumnOrGroup(),g=h.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(h,g),this.setLeft(this.actualLeft)},f.prototype.modifyLeftForPrintLayout=function(h,g){var x=this.beans.gridOptionsWrapper.getDomLayout()===Ue.DOM_LAYOUT_PRINT;if(!x||h.getPinned()===Ue.PINNED_LEFT)return g;var P=this.beans.columnModel.getDisplayedColumnsLeftWidth();if(h.getPinned()===Ue.PINNED_RIGHT){var z=this.beans.columnModel.getBodyContainerWidth();return P+z+g}return P+g},f.prototype.setLeft=function(h){i(h)&&(this.eCell.style.left=h+"px");var g;if(this.columnOrGroup instanceof W)g=this.columnOrGroup;else{var x=this.columnOrGroup,P=x.getLeafColumns();if(!P.length)return;P.length>1&&Ef(this.ariaEl,P.length),g=P[0]}var z=this.beans.columnModel.getAriaColumnIndex(g);Rd(this.ariaEl,z)},Fie([it],f.prototype,"postConstruct",null),f}($i);/** + */var Hz=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Rie=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},K4=function(M){Hz(f,M);function f(d,g,S,O){var z=M.call(this)||this;return z.columnOrGroup=d,z.eCell=g,z.ariaEl=z.eCell.querySelector("[role=columnheader]")||z.eCell,z.colsSpanning=O,z.beans=S,z}return f.prototype.setColsSpanning=function(d){this.colsSpanning=d,this.onLeftChanged()},f.prototype.getColumnOrGroup=function(){return this.beans.gridOptionsWrapper.isEnableRtl()&&this.colsSpanning?m(this.colsSpanning):this.columnOrGroup},f.prototype.postConstruct=function(){this.addManagedListener(this.columnOrGroup,H.EVENT_LEFT_CHANGED,this.onLeftChanged.bind(this)),this.setLeftFirstTime(),this.addManagedListener(this.eventService,ui.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onLeftChanged.bind(this)),this.addManagedListener(this.beans.gridOptionsWrapper,Zn.PROP_DOM_LAYOUT,this.onLeftChanged.bind(this))},f.prototype.setLeftFirstTime=function(){var d=this.beans.gridOptionsWrapper.isSuppressColumnMoveAnimation(),g=i(this.columnOrGroup.getOldLeft()),S=this.beans.columnAnimationService.isActive()&&g&&!d;S?this.animateInLeft():this.onLeftChanged()},f.prototype.animateInLeft=function(){var d=this,g=this.getColumnOrGroup(),S=g.getLeft(),O=g.getOldLeft(),z=this.modifyLeftForPrintLayout(g,O),te=this.modifyLeftForPrintLayout(g,S);this.setLeft(z),this.actualLeft=te,this.beans.columnAnimationService.executeNextVMTurn(function(){d.actualLeft===te&&d.setLeft(te)})},f.prototype.onLeftChanged=function(){var d=this.getColumnOrGroup(),g=d.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(d,g),this.setLeft(this.actualLeft)},f.prototype.modifyLeftForPrintLayout=function(d,g){var S=this.beans.gridOptionsWrapper.getDomLayout()===$e.DOM_LAYOUT_PRINT;if(!S||d.getPinned()===$e.PINNED_LEFT)return g;var O=this.beans.columnModel.getDisplayedColumnsLeftWidth();if(d.getPinned()===$e.PINNED_RIGHT){var z=this.beans.columnModel.getBodyContainerWidth();return O+z+g}return O+g},f.prototype.setLeft=function(d){i(d)&&(this.eCell.style.left=d+"px");var g;if(this.columnOrGroup instanceof H)g=this.columnOrGroup;else{var S=this.columnOrGroup,O=S.getLeafColumns();if(!O.length)return;O.length>1&&Pf(this.ariaEl,O.length),g=O[0]}var z=this.beans.columnModel.getAriaColumnIndex(g);kd(this.ariaEl,z)},Rie([ht],f.prototype,"postConstruct",null),f}(ji);/** * @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/ * @license MIT - */var bve=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Wz=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},qz=function(M){bve(f,M);function f(h,g){var x=M.call(this)||this;return x.columns=h,x.element=g,x}return f.prototype.postConstruct=function(){this.gridOptionsWrapper.isColumnHoverHighlight()&&this.addMouseHoverListeners()},f.prototype.addMouseHoverListeners=function(){this.addManagedListener(this.element,"mouseout",this.onMouseOut.bind(this)),this.addManagedListener(this.element,"mouseover",this.onMouseOver.bind(this))},f.prototype.onMouseOut=function(){this.columnHoverService.clearMouseOver()},f.prototype.onMouseOver=function(){this.columnHoverService.setMouseOver(this.columns)},Wz([ce("columnHoverService")],f.prototype,"columnHoverService",void 0),Wz([it],f.prototype,"postConstruct",null),f}($i);/** + */var Cve=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Wz=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},qz=function(M){Cve(f,M);function f(d,g){var S=M.call(this)||this;return S.columns=d,S.element=g,S}return f.prototype.postConstruct=function(){this.gridOptionsWrapper.isColumnHoverHighlight()&&this.addMouseHoverListeners()},f.prototype.addMouseHoverListeners=function(){this.addManagedListener(this.element,"mouseout",this.onMouseOut.bind(this)),this.addManagedListener(this.element,"mouseover",this.onMouseOver.bind(this))},f.prototype.onMouseOut=function(){this.columnHoverService.clearMouseOver()},f.prototype.onMouseOver=function(){this.columnHoverService.setMouseOver(this.columns)},Wz([pe("columnHoverService")],f.prototype,"columnHoverService",void 0),Wz([ht],f.prototype,"postConstruct",null),f}(ji);/** * @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/ * @license MIT - */var wve=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),VI=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Lie=function(M){wve(f,M);function f(h,g){var x=M.call(this,h,g)||this;return x.column=h,x}return f.prototype.setComp=function(h,g,x,P){M.prototype.setGui.call(this,g),this.comp=h,this.eButtonShowMainFilter=x,this.eFloatingFilterBody=P;var z=this.column.getColDef(),ee=!!z.filter||!!z.filterFramework,Me=!!z.floatingFilter;this.active=ee&&Me,this.setupWidth(),this.setupLeft(),this.setupHover(),this.setupFocus(),this.setupUserComp(),this.setupSyncWithFilter(),this.setupUi(),this.addManagedListener(this.eButtonShowMainFilter,"click",this.showParentFilter.bind(this))},f.prototype.setupUi=function(){if(this.comp.addOrRemoveButtonWrapperCssClass("ag-hidden",!this.active||this.suppressFilterButton),!!this.active){this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton);var h=tu("filter",this.gridOptionsWrapper,this.column);h&&this.eButtonShowMainFilter.appendChild(h)}},f.prototype.setupFocus=function(){this.createManagedBean(new Db(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))},f.prototype.onTabKeyDown=function(h){var g=this.gridOptionsWrapper.getDocument(),x=g.activeElement,P=x===this.eGui;if(!P){var z=this.focusService.findNextFocusableElement(this.eGui,null,h.shiftKey);if(z){this.beans.headerNavigationService.scrollToColumn(this.column),h.preventDefault(),z.focus();return}var ee=this.findNextColumnWithFloatingFilter(h.shiftKey);ee&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:ee},event:h})&&h.preventDefault()}},f.prototype.findNextColumnWithFloatingFilter=function(h){var g=this.beans.columnModel,x=this.column;do if(x=h?g.getDisplayedColBefore(x):g.getDisplayedColAfter(x),!x)break;while(!x.getColDef().filter||!x.getColDef().floatingFilter);return x},f.prototype.handleKeyDown=function(h){var g=this.gridOptionsWrapper.getDocument(),x=g.activeElement,P=x===this.eGui;switch(h.key){case Nr.UP:case Nr.DOWN:P||h.preventDefault();case Nr.LEFT:case Nr.RIGHT:if(P)return;h.stopPropagation();case Nr.ENTER:P&&this.focusService.focusInto(this.eGui)&&h.preventDefault();break;case Nr.ESCAPE:P||this.eGui.focus()}},f.prototype.onFocusIn=function(h){var g=this.eGui.contains(h.relatedTarget);if(!g){var x=!!h.relatedTarget&&!h.relatedTarget.classList.contains("ag-floating-filter"),P=!!h.relatedTarget&&ui(h.relatedTarget,"ag-floating-filter");if(x&&P&&h.target===this.eGui){var z=this.lastFocusEvent,ee=!!(z&&z.key===Nr.TAB);if(z&&ee){var Me=z.shiftKey;this.focusService.focusInto(this.eGui,Me)}}var je=this.getRowIndex();this.beans.focusService.setFocusedHeader(je,this.column)}},f.prototype.setupHover=function(){var h=this;this.createManagedBean(new qz([this.column],this.eGui));var g=function(){if(h.gridOptionsWrapper.isColumnHoverHighlight()){var x=h.columnHoverService.isHovered(h.column);h.comp.addOrRemoveCssClass("ag-column-hover",x)}};this.addManagedListener(this.eventService,li.EVENT_COLUMN_HOVER_CHANGED,g),g()},f.prototype.setupLeft=function(){var h=new q4(this.column,this.eGui,this.beans);this.createManagedBean(h)},f.prototype.setupUserComp=function(){var h=this;if(this.active){var g=this.column.getColDef(),x=this.filterManager.createFilterParams(this.column,g),P=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(g,lC,x),z=this.userComponentFactory.getDefaultFloatingFilterType(g);z==null&&(z="agReadOnlyFloatingFilter");var ee={column:this.column,filterParams:P,currentParentModel:function(){return h.currentParentModel()},parentFilterInstance:function(je){return h.parentFilterInstance(je)},showParentFilter:function(){return h.showParentFilter()},suppressFilterButton:!1};this.suppressFilterButton=g.floatingFilterComponentParams?!!g.floatingFilterComponentParams.suppressFilterButton:!1;var Me=this.userComponentFactory.getFloatingFilterCompDetails(g,ee,z);Me&&this.comp.setCompDetails(Me)}},f.prototype.currentParentModel=function(){var h=this.getFilterComponent(!1);return h?h.resolveNow(null,function(g){return g&&g.getModel()}):null},f.prototype.getFilterComponent=function(h){return h===void 0&&(h=!0),this.filterManager.getFilterComponent(this.column,"NO_UI",h)},f.prototype.parentFilterInstance=function(h){var g=this.getFilterComponent();g?.then(function(x){h(Bx(x))})},f.prototype.showParentFilter=function(){var h=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuFactory.showMenuAfterButtonClick(this.column,h,"floatingFilter","filterMenuTab",["filterMenuTab"])},f.prototype.setupSyncWithFilter=function(){var h=this;if(this.active){var g=function(x){var P=h.comp.getFloatingFilterComp();if(P){var z=h.currentParentModel();P.then(function(ee){ee&&ee.onParentModelChanged(z,x)})}};this.addManagedListener(this.column,W.EVENT_FILTER_CHANGED,g),this.filterManager.isFilterActive(this.column)&&g(null)}},f.prototype.setupWidth=function(){var h=this,g=function(){var x=h.column.getActualWidth()+"px";h.comp.setWidth(x)};this.addManagedListener(this.column,W.EVENT_WIDTH_CHANGED,g),g()},VI([ce("userComponentFactory")],f.prototype,"userComponentFactory",void 0),VI([ce("filterManager")],f.prototype,"filterManager",void 0),VI([ce("columnHoverService")],f.prototype,"columnHoverService",void 0),VI([ce("gridApi")],f.prototype,"gridApi",void 0),VI([ce("menuFactory")],f.prototype,"menuFactory",void 0),VI([ce("beans")],f.prototype,"beans",void 0),f}(GI);/** + */var Tve=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),jI=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Mie=function(M){Tve(f,M);function f(d,g){var S=M.call(this,d,g)||this;return S.column=d,S}return f.prototype.setComp=function(d,g,S,O){M.prototype.setGui.call(this,g),this.comp=d,this.eButtonShowMainFilter=S,this.eFloatingFilterBody=O;var z=this.column.getColDef(),te=!!z.filter||!!z.filterFramework,Fe=!!z.floatingFilter;this.active=te&&Fe,this.setupWidth(),this.setupLeft(),this.setupHover(),this.setupFocus(),this.setupUserComp(),this.setupSyncWithFilter(),this.setupUi(),this.addManagedListener(this.eButtonShowMainFilter,"click",this.showParentFilter.bind(this))},f.prototype.setupUi=function(){if(this.comp.addOrRemoveButtonWrapperCssClass("ag-hidden",!this.active||this.suppressFilterButton),!!this.active){this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton);var d=hu("filter",this.gridOptionsWrapper,this.column);d&&this.eButtonShowMainFilter.appendChild(d)}},f.prototype.setupFocus=function(){this.createManagedBean(new Nb(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))},f.prototype.onTabKeyDown=function(d){var g=this.gridOptionsWrapper.getDocument(),S=g.activeElement,O=S===this.eGui;if(!O){var z=this.focusService.findNextFocusableElement(this.eGui,null,d.shiftKey);if(z){this.beans.headerNavigationService.scrollToColumn(this.column),d.preventDefault(),z.focus();return}var te=this.findNextColumnWithFloatingFilter(d.shiftKey);te&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:te},event:d})&&d.preventDefault()}},f.prototype.findNextColumnWithFloatingFilter=function(d){var g=this.beans.columnModel,S=this.column;do if(S=d?g.getDisplayedColBefore(S):g.getDisplayedColAfter(S),!S)break;while(!S.getColDef().filter||!S.getColDef().floatingFilter);return S},f.prototype.handleKeyDown=function(d){var g=this.gridOptionsWrapper.getDocument(),S=g.activeElement,O=S===this.eGui;switch(d.key){case Qr.UP:case Qr.DOWN:O||d.preventDefault();case Qr.LEFT:case Qr.RIGHT:if(O)return;d.stopPropagation();case Qr.ENTER:O&&this.focusService.focusInto(this.eGui)&&d.preventDefault();break;case Qr.ESCAPE:O||this.eGui.focus()}},f.prototype.onFocusIn=function(d){var g=this.eGui.contains(d.relatedTarget);if(!g){var S=!!d.relatedTarget&&!d.relatedTarget.classList.contains("ag-floating-filter"),O=!!d.relatedTarget&&pi(d.relatedTarget,"ag-floating-filter");if(S&&O&&d.target===this.eGui){var z=this.lastFocusEvent,te=!!(z&&z.key===Qr.TAB);if(z&&te){var Fe=z.shiftKey;this.focusService.focusInto(this.eGui,Fe)}}var Ue=this.getRowIndex();this.beans.focusService.setFocusedHeader(Ue,this.column)}},f.prototype.setupHover=function(){var d=this;this.createManagedBean(new qz([this.column],this.eGui));var g=function(){if(d.gridOptionsWrapper.isColumnHoverHighlight()){var S=d.columnHoverService.isHovered(d.column);d.comp.addOrRemoveCssClass("ag-column-hover",S)}};this.addManagedListener(this.eventService,ui.EVENT_COLUMN_HOVER_CHANGED,g),g()},f.prototype.setupLeft=function(){var d=new K4(this.column,this.eGui,this.beans);this.createManagedBean(d)},f.prototype.setupUserComp=function(){var d=this;if(this.active){var g=this.column.getColDef(),S=this.filterManager.createFilterParams(this.column,g),O=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(g,oC,S),z=this.userComponentFactory.getDefaultFloatingFilterType(g);z==null&&(z="agReadOnlyFloatingFilter");var te={column:this.column,filterParams:O,currentParentModel:function(){return d.currentParentModel()},parentFilterInstance:function(Ue){return d.parentFilterInstance(Ue)},showParentFilter:function(){return d.showParentFilter()},suppressFilterButton:!1};this.suppressFilterButton=g.floatingFilterComponentParams?!!g.floatingFilterComponentParams.suppressFilterButton:!1;var Fe=this.userComponentFactory.getFloatingFilterCompDetails(g,te,z);Fe&&this.comp.setCompDetails(Fe)}},f.prototype.currentParentModel=function(){var d=this.getFilterComponent(!1);return d?d.resolveNow(null,function(g){return g&&g.getModel()}):null},f.prototype.getFilterComponent=function(d){return d===void 0&&(d=!0),this.filterManager.getFilterComponent(this.column,"NO_UI",d)},f.prototype.parentFilterInstance=function(d){var g=this.getFilterComponent();g?.then(function(S){d(Vx(S))})},f.prototype.showParentFilter=function(){var d=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuFactory.showMenuAfterButtonClick(this.column,d,"floatingFilter","filterMenuTab",["filterMenuTab"])},f.prototype.setupSyncWithFilter=function(){var d=this;if(this.active){var g=function(S){var O=d.comp.getFloatingFilterComp();if(O){var z=d.currentParentModel();O.then(function(te){te&&te.onParentModelChanged(z,S)})}};this.addManagedListener(this.column,H.EVENT_FILTER_CHANGED,g),this.filterManager.isFilterActive(this.column)&&g(null)}},f.prototype.setupWidth=function(){var d=this,g=function(){var S=d.column.getActualWidth()+"px";d.comp.setWidth(S)};this.addManagedListener(this.column,H.EVENT_WIDTH_CHANGED,g),g()},jI([pe("userComponentFactory")],f.prototype,"userComponentFactory",void 0),jI([pe("filterManager")],f.prototype,"filterManager",void 0),jI([pe("columnHoverService")],f.prototype,"columnHoverService",void 0),jI([pe("gridApi")],f.prototype,"gridApi",void 0),jI([pe("menuFactory")],f.prototype,"menuFactory",void 0),jI([pe("beans")],f.prototype,"beans",void 0),f}(VI);/** * @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/ * @license MIT - */var xve=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Yz=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Sve=function(M){xve(f,M);function f(h,g,x,P,z){var ee=M.call(this)||this;return ee.pinned=h,ee.column=g,ee.eResize=x,ee.comp=P,ee.ctrl=z,ee}return f.prototype.postConstruct=function(){var h=this,g=this.column.getColDef(),x=[],P,z,ee=function(){if(dl(h.eResize,P),!!P){var ut=h.horizontalResizeService.addResizeBar({eResizeBar:h.eResize,onResizeStart:h.onResizeStart.bind(h),onResizing:h.onResizing.bind(h,!1),onResizeEnd:h.onResizing.bind(h,!0)});if(x.push(ut),z){var Rt=h.gridOptionsWrapper.isSkipHeaderOnAutoSize(),Zt=function(){h.columnModel.autoSizeColumn(h.column,Rt,"uiColumnResized")};h.eResize.addEventListener("dblclick",Zt);var vi=new Fg(h.eResize);vi.addEventListener(Fg.EVENT_DOUBLE_TAP,Zt),h.addDestroyFunc(function(){h.eResize.removeEventListener("dblclick",Zt),vi.removeEventListener(Fg.EVENT_DOUBLE_TAP,Zt),vi.destroy()})}}},Me=function(){x.forEach(function(ut){return ut()}),x.length=0},je=function(){var ut=h.column.isResizable(),Rt=!h.gridOptionsWrapper.isSuppressAutoSize()&&!g.suppressAutoSize,Zt=ut!==P||Rt!==z;Zt&&(P=ut,z=Rt,Me(),ee())};je(),this.addDestroyFunc(Me),this.ctrl.addRefreshFunction(je)},f.prototype.onResizing=function(h,g){var x=this.normaliseResizeAmount(g),P=[{key:this.column,newWidth:this.resizeStartWidth+x}];this.columnModel.setColumnWidths(P,this.resizeWithShiftKey,h,"uiColumnDragged"),h&&this.comp.addOrRemoveCssClass("ag-column-resizing",!1)},f.prototype.onResizeStart=function(h){this.resizeStartWidth=this.column.getActualWidth(),this.resizeWithShiftKey=h,this.comp.addOrRemoveCssClass("ag-column-resizing",!0)},f.prototype.normaliseResizeAmount=function(h){var g=h,x=this.pinned!==Ue.PINNED_LEFT,P=this.pinned===Ue.PINNED_RIGHT;return this.gridOptionsWrapper.isEnableRtl()?x&&(g*=-1):P&&(g*=-1),g},Yz([ce("horizontalResizeService")],f.prototype,"horizontalResizeService",void 0),Yz([ce("columnModel")],f.prototype,"columnModel",void 0),Yz([it],f.prototype,"postConstruct",null),f}($i);/** + */var Eve=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),Yz=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Ive=function(M){Eve(f,M);function f(d,g,S,O,z){var te=M.call(this)||this;return te.pinned=d,te.column=g,te.eResize=S,te.comp=O,te.ctrl=z,te}return f.prototype.postConstruct=function(){var d=this,g=this.column.getColDef(),S=[],O,z,te=function(){if(wl(d.eResize,O),!!O){var ut=d.horizontalResizeService.addResizeBar({eResizeBar:d.eResize,onResizeStart:d.onResizeStart.bind(d),onResizing:d.onResizing.bind(d,!1),onResizeEnd:d.onResizing.bind(d,!0)});if(S.push(ut),z){var Mt=d.gridOptionsWrapper.isSkipHeaderOnAutoSize(),ni=function(){d.columnModel.autoSizeColumn(d.column,Mt,"uiColumnResized")};d.eResize.addEventListener("dblclick",ni);var Si=new $g(d.eResize);Si.addEventListener($g.EVENT_DOUBLE_TAP,ni),d.addDestroyFunc(function(){d.eResize.removeEventListener("dblclick",ni),Si.removeEventListener($g.EVENT_DOUBLE_TAP,ni),Si.destroy()})}}},Fe=function(){S.forEach(function(ut){return ut()}),S.length=0},Ue=function(){var ut=d.column.isResizable(),Mt=!d.gridOptionsWrapper.isSuppressAutoSize()&&!g.suppressAutoSize,ni=ut!==O||Mt!==z;ni&&(O=ut,z=Mt,Fe(),te())};Ue(),this.addDestroyFunc(Fe),this.ctrl.addRefreshFunction(Ue)},f.prototype.onResizing=function(d,g){var S=this.normaliseResizeAmount(g),O=[{key:this.column,newWidth:this.resizeStartWidth+S}];this.columnModel.setColumnWidths(O,this.resizeWithShiftKey,d,"uiColumnDragged"),d&&this.comp.addOrRemoveCssClass("ag-column-resizing",!1)},f.prototype.onResizeStart=function(d){this.resizeStartWidth=this.column.getActualWidth(),this.resizeWithShiftKey=d,this.comp.addOrRemoveCssClass("ag-column-resizing",!0)},f.prototype.normaliseResizeAmount=function(d){var g=d,S=this.pinned!==$e.PINNED_LEFT,O=this.pinned===$e.PINNED_RIGHT;return this.gridOptionsWrapper.isEnableRtl()?S&&(g*=-1):O&&(g*=-1),g},Yz([pe("horizontalResizeService")],f.prototype,"horizontalResizeService",void 0),Yz([pe("columnModel")],f.prototype,"columnModel",void 0),Yz([ht],f.prototype,"postConstruct",null),f}(ji);/** * @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/ * @license MIT - */var Cve=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),P3=function(M){Cve(f,M);function f(h,g,x){g===void 0&&(g="ag-checkbox"),x===void 0&&(x="checkbox");var P=M.call(this,h,g,x)||this;return P.labelAlignment="right",P.selected=!1,P.readOnly=!1,P.passive=!1,P}return f.prototype.addInputListeners=function(){this.addManagedListener(this.eInput,"click",this.onCheckboxClick.bind(this)),this.addManagedListener(this.eLabel,"click",this.toggle.bind(this))},f.prototype.getNextValue=function(){return this.selected===void 0?!0:!this.selected},f.prototype.setPassive=function(h){this.passive=h},f.prototype.isReadOnly=function(){return this.readOnly},f.prototype.setReadOnly=function(h){this.eWrapper.classList.toggle("ag-disabled",h),this.eInput.disabled=h,this.readOnly=h},f.prototype.setDisabled=function(h){return this.eWrapper.classList.toggle("ag-disabled",h),M.prototype.setDisabled.call(this,h)},f.prototype.toggle=function(){if(!this.eInput.disabled){var h=this.isSelected(),g=this.getNextValue();this.passive?this.dispatchChange(g,h):this.setValue(g)}},f.prototype.getValue=function(){return this.isSelected()},f.prototype.setValue=function(h,g){return this.refreshSelectedClass(h),this.setSelected(h,g),this},f.prototype.setName=function(h){var g=this.getInputElement();return g.name=h,this},f.prototype.isSelected=function(){return this.selected},f.prototype.setSelected=function(h,g){this.isSelected()!==h&&(this.previousValue=this.isSelected(),h=this.selected=typeof h=="boolean"?h:void 0,this.eInput.checked=h,this.eInput.indeterminate=h===void 0,g||this.dispatchChange(this.selected,this.previousValue))},f.prototype.dispatchChange=function(h,g,x){this.dispatchEvent({type:f.EVENT_CHANGED,selected:h,previousValue:g,event:x});var P=this.getInputElement(),z={type:li.EVENT_CHECKBOX_CHANGED,id:P.id,name:P.name,selected:h,previousValue:g};this.eventService.dispatchEvent(z)},f.prototype.onCheckboxClick=function(h){if(!(this.passive||this.eInput.disabled)){var g=this.isSelected(),x=this.selected=h.target.checked;this.refreshSelectedClass(x),this.dispatchChange(x,g,h)}},f.prototype.refreshSelectedClass=function(h){this.eWrapper.classList.toggle("ag-checked",h===!0),this.eWrapper.classList.toggle("ag-indeterminate",h==null)},f}(m1);/** + */var Ave=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),A3=function(M){Ave(f,M);function f(d,g,S){g===void 0&&(g="ag-checkbox"),S===void 0&&(S="checkbox");var O=M.call(this,d,g,S)||this;return O.labelAlignment="right",O.selected=!1,O.readOnly=!1,O.passive=!1,O}return f.prototype.addInputListeners=function(){this.addManagedListener(this.eInput,"click",this.onCheckboxClick.bind(this)),this.addManagedListener(this.eLabel,"click",this.toggle.bind(this))},f.prototype.getNextValue=function(){return this.selected===void 0?!0:!this.selected},f.prototype.setPassive=function(d){this.passive=d},f.prototype.isReadOnly=function(){return this.readOnly},f.prototype.setReadOnly=function(d){this.eWrapper.classList.toggle("ag-disabled",d),this.eInput.disabled=d,this.readOnly=d},f.prototype.setDisabled=function(d){return this.eWrapper.classList.toggle("ag-disabled",d),M.prototype.setDisabled.call(this,d)},f.prototype.toggle=function(){if(!this.eInput.disabled){var d=this.isSelected(),g=this.getNextValue();this.passive?this.dispatchChange(g,d):this.setValue(g)}},f.prototype.getValue=function(){return this.isSelected()},f.prototype.setValue=function(d,g){return this.refreshSelectedClass(d),this.setSelected(d,g),this},f.prototype.setName=function(d){var g=this.getInputElement();return g.name=d,this},f.prototype.isSelected=function(){return this.selected},f.prototype.setSelected=function(d,g){this.isSelected()!==d&&(this.previousValue=this.isSelected(),d=this.selected=typeof d=="boolean"?d:void 0,this.eInput.checked=d,this.eInput.indeterminate=d===void 0,g||this.dispatchChange(this.selected,this.previousValue))},f.prototype.dispatchChange=function(d,g,S){this.dispatchEvent({type:f.EVENT_CHANGED,selected:d,previousValue:g,event:S});var O=this.getInputElement(),z={type:ui.EVENT_CHECKBOX_CHANGED,id:O.id,name:O.name,selected:d,previousValue:g};this.eventService.dispatchEvent(z)},f.prototype.onCheckboxClick=function(d){if(!(this.passive||this.eInput.disabled)){var g=this.isSelected(),S=this.selected=d.target.checked;this.refreshSelectedClass(S),this.dispatchChange(S,g,d)}},f.prototype.refreshSelectedClass=function(d){this.eWrapper.classList.toggle("ag-checked",d===!0),this.eWrapper.classList.toggle("ag-indeterminate",d==null)},f}(_1);/** * @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/ * @license MIT - */var kie=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Y4=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Tve=function(M){kie(f,M);function f(h){var g=M.call(this)||this;g.cbSelectAllVisible=!1,g.processingEventFromCheckbox=!1,g.column=h;var x=h.getColDef();return g.filteredOnly=x?!!x.headerCheckboxSelectionFilteredOnly:!1,g}return f.prototype.onSpaceKeyPressed=function(h){var g=this.cbSelectAll,x=this.gridOptionsWrapper.getDocument();g.isDisplayed()&&!g.getGui().contains(x.activeElement)&&(h.preventDefault(),g.setValue(!g.getValue()))},f.prototype.getCheckboxGui=function(){return this.cbSelectAll.getGui()},f.prototype.setComp=function(h){this.headerCellCtrl=h,this.cbSelectAll=this.createManagedBean(new P3),this.cbSelectAll.addCssClass("ag-header-select-all"),tr(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedListener(this.eventService,li.EVENT_NEW_COLUMNS_LOADED,this.showOrHideSelectAll.bind(this)),this.addManagedListener(this.eventService,li.EVENT_DISPLAYED_COLUMNS_CHANGED,this.showOrHideSelectAll.bind(this)),this.addManagedListener(this.eventService,li.EVENT_SELECTION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,li.EVENT_MODEL_UPDATED,this.onModelChanged.bind(this)),this.addManagedListener(this.cbSelectAll,P3.EVENT_CHANGED,this.onCbSelectAll.bind(this)),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()},f.prototype.showOrHideSelectAll=function(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible),this.cbSelectAllVisible&&(this.checkRightRowModelType(),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()},f.prototype.onModelChanged=function(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()},f.prototype.onSelectionChanged=function(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()},f.prototype.getNextCheckboxState=function(h){return h.selected===0&&h.notSelected===0?!1:h.selected>0&&h.notSelected>0?null:h.selected>0},f.prototype.updateStateOfCheckbox=function(){if(!this.processingEventFromCheckbox){this.processingEventFromCheckbox=!0;var h=this.getSelectionCount(),g=this.getNextCheckboxState(h);this.cbSelectAll.setValue(g),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}},f.prototype.refreshSelectAllLabel=function(){if(!this.cbSelectAllVisible)this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null);else{var h=this.gridOptionsWrapper.getLocaleTextFunc(),g=this.cbSelectAll.getValue(),x=g?h("ariaChecked","checked"):h("ariaUnchecked","unchecked"),P=h("ariaRowSelectAll","Press Space to toggle all rows selection");this.headerCellCtrl.setAriaDescriptionProperty("selectAll",P+" ("+x+")")}this.headerCellCtrl.refreshAriaDescription()},f.prototype.getSelectionCount=function(){var h=this,g=0,x=0,P=function(z){h.gridOptionsWrapper.isGroupSelectsChildren()&&z.group||(z.isSelected()?g++:z.selectable&&x++)};return this.filteredOnly?this.gridApi.forEachNodeAfterFilter(P):this.gridApi.forEachNode(P),{notSelected:x,selected:g}},f.prototype.checkRightRowModelType=function(){var h=this.rowModel.getType(),g=h===Ue.ROW_MODEL_TYPE_CLIENT_SIDE;g||console.warn("AG Grid: selectAllCheckbox is only available if using normal row model, you are using "+h)},f.prototype.onCbSelectAll=function(){if(!this.processingEventFromCheckbox&&this.cbSelectAllVisible){var h=this.cbSelectAll.getValue();h?this.selectionService.selectAllRowNodes(this.filteredOnly):this.selectionService.deselectAllRowNodes(this.filteredOnly)}},f.prototype.isCheckboxSelection=function(){var h=this.column.getColDef().headerCheckboxSelection;if(typeof h=="function"){var g=h,x={column:this.column,colDef:this.column.getColDef(),columnApi:this.columnApi,api:this.gridApi,context:this.gridOptionsWrapper.getContext()};h=g(x)}return h?this.gridOptionsWrapper.isRowModelServerSide()?(console.warn("AG Grid: headerCheckboxSelection is not supported for Server Side Row Model"),!1):this.gridOptionsWrapper.isRowModelInfinite()?(console.warn("AG Grid: headerCheckboxSelection is not supported for Infinite Row Model"),!1):this.gridOptionsWrapper.isRowModelViewport()?(console.warn("AG Grid: headerCheckboxSelection is not supported for Viewport Row Model"),!1):!0:!1},Y4([ce("gridApi")],f.prototype,"gridApi",void 0),Y4([ce("columnApi")],f.prototype,"columnApi",void 0),Y4([ce("rowModel")],f.prototype,"rowModel",void 0),Y4([ce("selectionService")],f.prototype,"selectionService",void 0),f}($i);/** + */var Die=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),J4=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Pve=function(M){Die(f,M);function f(d){var g=M.call(this)||this;g.cbSelectAllVisible=!1,g.processingEventFromCheckbox=!1,g.column=d;var S=d.getColDef();return g.filteredOnly=S?!!S.headerCheckboxSelectionFilteredOnly:!1,g}return f.prototype.onSpaceKeyPressed=function(d){var g=this.cbSelectAll,S=this.gridOptionsWrapper.getDocument();g.isDisplayed()&&!g.getGui().contains(S.activeElement)&&(d.preventDefault(),g.setValue(!g.getValue()))},f.prototype.getCheckboxGui=function(){return this.cbSelectAll.getGui()},f.prototype.setComp=function(d){this.headerCellCtrl=d,this.cbSelectAll=this.createManagedBean(new A3),this.cbSelectAll.addCssClass("ag-header-select-all"),lr(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedListener(this.eventService,ui.EVENT_NEW_COLUMNS_LOADED,this.showOrHideSelectAll.bind(this)),this.addManagedListener(this.eventService,ui.EVENT_DISPLAYED_COLUMNS_CHANGED,this.showOrHideSelectAll.bind(this)),this.addManagedListener(this.eventService,ui.EVENT_SELECTION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,ui.EVENT_MODEL_UPDATED,this.onModelChanged.bind(this)),this.addManagedListener(this.cbSelectAll,A3.EVENT_CHANGED,this.onCbSelectAll.bind(this)),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()},f.prototype.showOrHideSelectAll=function(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible),this.cbSelectAllVisible&&(this.checkRightRowModelType(),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()},f.prototype.onModelChanged=function(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()},f.prototype.onSelectionChanged=function(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()},f.prototype.getNextCheckboxState=function(d){return d.selected===0&&d.notSelected===0?!1:d.selected>0&&d.notSelected>0?null:d.selected>0},f.prototype.updateStateOfCheckbox=function(){if(!this.processingEventFromCheckbox){this.processingEventFromCheckbox=!0;var d=this.getSelectionCount(),g=this.getNextCheckboxState(d);this.cbSelectAll.setValue(g),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}},f.prototype.refreshSelectAllLabel=function(){if(!this.cbSelectAllVisible)this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null);else{var d=this.gridOptionsWrapper.getLocaleTextFunc(),g=this.cbSelectAll.getValue(),S=g?d("ariaChecked","checked"):d("ariaUnchecked","unchecked"),O=d("ariaRowSelectAll","Press Space to toggle all rows selection");this.headerCellCtrl.setAriaDescriptionProperty("selectAll",O+" ("+S+")")}this.headerCellCtrl.refreshAriaDescription()},f.prototype.getSelectionCount=function(){var d=this,g=0,S=0,O=function(z){d.gridOptionsWrapper.isGroupSelectsChildren()&&z.group||(z.isSelected()?g++:z.selectable&&S++)};return this.filteredOnly?this.gridApi.forEachNodeAfterFilter(O):this.gridApi.forEachNode(O),{notSelected:S,selected:g}},f.prototype.checkRightRowModelType=function(){var d=this.rowModel.getType(),g=d===$e.ROW_MODEL_TYPE_CLIENT_SIDE;g||console.warn("AG Grid: selectAllCheckbox is only available if using normal row model, you are using "+d)},f.prototype.onCbSelectAll=function(){if(!this.processingEventFromCheckbox&&this.cbSelectAllVisible){var d=this.cbSelectAll.getValue();d?this.selectionService.selectAllRowNodes(this.filteredOnly):this.selectionService.deselectAllRowNodes(this.filteredOnly)}},f.prototype.isCheckboxSelection=function(){var d=this.column.getColDef().headerCheckboxSelection;if(typeof d=="function"){var g=d,S={column:this.column,colDef:this.column.getColDef(),columnApi:this.columnApi,api:this.gridApi,context:this.gridOptionsWrapper.getContext()};d=g(S)}return d?this.gridOptionsWrapper.isRowModelServerSide()?(console.warn("AG Grid: headerCheckboxSelection is not supported for Server Side Row Model"),!1):this.gridOptionsWrapper.isRowModelInfinite()?(console.warn("AG Grid: headerCheckboxSelection is not supported for Infinite Row Model"),!1):this.gridOptionsWrapper.isRowModelViewport()?(console.warn("AG Grid: headerCheckboxSelection is not supported for Viewport Row Model"),!1):!0:!1},J4([pe("gridApi")],f.prototype,"gridApi",void 0),J4([pe("columnApi")],f.prototype,"columnApi",void 0),J4([pe("rowModel")],f.prototype,"rowModel",void 0),J4([pe("selectionService")],f.prototype,"selectionService",void 0),f}(ji);/** * @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/ * @license MIT - */var u9e=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),Gx=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},j=function(M){u9e(f,M);function f(h,g){var x=M.call(this,h,g)||this;return x.refreshFunctions=[],x.userHeaderClasses=new Set,x.ariaDescriptionProperties=new Map,x.column=h,x}return f.prototype.setComp=function(h,g,x){var P=this;M.prototype.setGui.call(this,g),this.comp=h,this.colDefVersion=this.columnModel.getColDefVersion(),this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupMenuClass(),this.setupSortableClass(),this.addColumnHoverListener(),this.setupFilterCss(),this.setupColId(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(),this.setupSelectAll(),this.setupUserComp(),this.refreshAria(),this.createManagedBean(new Sve(this.getPinned(),this.column,x,h,this)),this.createManagedBean(new qz([this.column],g)),this.createManagedBean(new q4(this.column,g,this.beans)),this.createManagedBean(new Db(g,{shouldStopEventPropagation:function(z){return P.shouldStopEventPropagation(z)},onTabKeyDown:function(){return null},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedListener(this.eventService,li.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this)),this.addManagedListener(this.eventService,li.EVENT_COLUMN_VALUE_CHANGED,this.onColumnValueChanged.bind(this)),this.addManagedListener(this.eventService,li.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onColumnRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,li.EVENT_COLUMN_PIVOT_CHANGED,this.onColumnPivotChanged.bind(this))},f.prototype.setupUserComp=function(){var h=this.lookupUserCompDetails();this.setCompDetails(h)},f.prototype.setCompDetails=function(h){this.userCompDetails=h,this.comp.setUserCompDetails(h)},f.prototype.lookupUserCompDetails=function(){var h=this.createParams(),g=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(g,h)},f.prototype.createParams=function(){var h=this,g=this.column.getColDef(),x={column:this.column,displayName:this.displayName,enableSorting:g.sortable,enableMenu:this.menuEnabled,showColumnMenu:function(P){h.gridApi.showColumnMenuAfterButtonClick(h.column,P)},progressSort:function(P){h.sortController.progressSort(h.column,!!P,"uiColumnSorted")},setSort:function(P,z){h.sortController.setSortForColumn(h.column,P,!!z,"uiColumnSorted")},api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsWrapper.getContext(),eGridHeader:this.getGui()};return x},f.prototype.setupSelectAll=function(){this.selectAllFeature=this.createManagedBean(new Tve(this.column)),this.selectAllFeature.setComp(this)},f.prototype.getSelectAllGui=function(){return this.selectAllFeature.getCheckboxGui()},f.prototype.handleKeyDown=function(h){h.key===Nr.SPACE&&this.selectAllFeature.onSpaceKeyPressed(h),h.key===Nr.ENTER&&this.onEnterKeyPressed(h)},f.prototype.onEnterKeyPressed=function(h){var g=this.comp.getUserCompInstance();if(g){if(h.ctrlKey||h.metaKey)this.menuEnabled&&g.showMenu&&(h.preventDefault(),g.showMenu());else if(this.sortable){var x=h.shiftKey;this.sortController.progressSort(this.column,x,"uiColumnSorted")}}},f.prototype.isMenuEnabled=function(){return this.menuEnabled},f.prototype.onFocusIn=function(h){if(!this.getGui().contains(h.relatedTarget)){var g=this.getRowIndex();this.focusService.setFocusedHeader(g,this.column)}this.setActiveHeader(!0)},f.prototype.onFocusOut=function(h){this.getGui().contains(h.relatedTarget)||this.setActiveHeader(!1)},f.prototype.setupTooltip=function(){var h=this,g={getColumn:function(){return h.column},getColDef:function(){return h.column.getColDef()},getGui:function(){return h.eGui},getLocation:function(){return"header"},getTooltipValue:function(){var P=h.column.getColDef().headerTooltip;return P}},x=this.createManagedBean(new kx(g,this.beans));x.setComp(this.comp),this.refreshFunctions.push(function(){return x.refreshToolTip()})},f.prototype.setupClassesFromColDef=function(){var h=this,g=function(){var x=h.column.getColDef(),P=h.gridOptionsWrapper,z=Vz.getHeaderClassesFromColDef(x,P,h.column,null),ee=h.userHeaderClasses;h.userHeaderClasses=new Set(z),z.forEach(function(Me){ee.has(Me)?ee.delete(Me):h.comp.addOrRemoveCssClass(Me,!0)}),ee.forEach(function(Me){return h.comp.addOrRemoveCssClass(Me,!1)})};this.refreshFunctions.push(g),g()},f.prototype.setDragSource=function(h){var g=this;this.dragSourceElement=h,this.removeDragSource(),h&&this.draggable&&(this.moveDragSource={type:t.DragSourceType.HeaderCell,eElement:h,defaultIconName:Lg.ICON_HIDE,getDragItem:function(){return g.createDragItem()},dragItemName:this.displayName,onDragStarted:function(){return g.column.setMoving(!0,"uiColumnMoved")},onDragStopped:function(){return g.column.setMoving(!1,"uiColumnMoved")}},this.dragAndDropService.addDragSource(this.moveDragSource,!0))},f.prototype.createDragItem=function(){var h={};return h[this.column.getId()]=this.column.isVisible(),{columns:[this.column],visibleState:h}},f.prototype.removeDragSource=function(){this.moveDragSource&&(this.dragAndDropService.removeDragSource(this.moveDragSource),this.moveDragSource=void 0)},f.prototype.onNewColumnsLoaded=function(){var h=this.columnModel.getColDefVersion();h!=this.colDefVersion&&(this.colDefVersion=h,this.refresh())},f.prototype.updateState=function(){var h=this.column.getColDef();this.menuEnabled=this.menuFactory.isMenuEnabled(this.column)&&!h.suppressMenu,this.sortable=h.sortable,this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()},f.prototype.addRefreshFunction=function(h){this.refreshFunctions.push(h)},f.prototype.refresh=function(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach(function(h){return h()})},f.prototype.refreshHeaderComp=function(){var h=this.lookupUserCompDetails(),g=this.comp.getUserCompInstance(),x=g!=null&&this.userCompDetails.componentClass==h.componentClass,P=x?this.attemptHeaderCompRefresh(h.params):!1;P?this.setDragSource(this.dragSourceElement):this.setCompDetails(h)},f.prototype.attemptHeaderCompRefresh=function(h){var g=this.comp.getUserCompInstance();if(!g||!g.refresh)return!1;var x=g.refresh(h);return x},f.prototype.calculateDisplayName=function(){return this.columnModel.getDisplayNameForColumn(this.column,"header",!0)},f.prototype.checkDisplayName=function(){this.displayName!==this.calculateDisplayName()&&this.refresh()},f.prototype.workOutDraggable=function(){var h=this.column.getColDef(),g=this.gridOptionsWrapper.isSuppressMovableColumns(),x=!g&&!h.suppressMovable&&!h.lockPosition;return!!x||!!h.enableRowGroup||!!h.enablePivot},f.prototype.onColumnRowGroupChanged=function(){this.checkDisplayName()},f.prototype.onColumnPivotChanged=function(){this.checkDisplayName()},f.prototype.onColumnValueChanged=function(){this.checkDisplayName()},f.prototype.setupWidth=function(){var h=this,g=function(){h.comp.setWidth(h.column.getActualWidth()+"px")};this.addManagedListener(this.column,W.EVENT_WIDTH_CHANGED,g),g()},f.prototype.setupMovingCss=function(){var h=this,g=function(){h.comp.addOrRemoveCssClass("ag-header-cell-moving",h.column.isMoving())};this.addManagedListener(this.column,W.EVENT_MOVING_CHANGED,g),g()},f.prototype.setupMenuClass=function(){var h=this,g=function(){h.comp.addOrRemoveCssClass("ag-column-menu-visible",h.column.isMenuVisible())};this.addManagedListener(this.column,W.EVENT_MENU_VISIBLE_CHANGED,g),g()},f.prototype.setupSortableClass=function(){var h=this,g=function(){h.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!h.sortable)};g(),this.addRefreshFunction(g),this.addManagedListener(this.column,W.EVENT_SORT_CHANGED,this.refreshAriaSort.bind(this))},f.prototype.refreshAriaSort=function(){if(this.sortable){var h=this.gridOptionsWrapper.getLocaleTextFunc();this.comp.setAriaSort(Sr(this.column)),this.setAriaDescriptionProperty("sort",h("ariaSortableColumn","Press ENTER to sort."))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)},f.prototype.refreshAriaMenu=function(){if(this.menuEnabled){var h=this.gridOptionsWrapper.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",h("ariaMenuColumn","Press CTRL ENTER to open column menu."))}else this.setAriaDescriptionProperty("menu",null)},f.prototype.setAriaDescriptionProperty=function(h,g){g!=null?this.ariaDescriptionProperties.set(h,g):this.ariaDescriptionProperties.delete(h)},f.prototype.refreshAriaDescription=function(){var h=Array.from(this.ariaDescriptionProperties.values());this.comp.setAriaDescription(h.length?h.join(" "):void 0)},f.prototype.refreshAria=function(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaDescription()},f.prototype.addColumnHoverListener=function(){var h=this,g=function(){if(h.gridOptionsWrapper.isColumnHoverHighlight()){var x=h.columnHoverService.isHovered(h.column);h.comp.addOrRemoveCssClass("ag-column-hover",x)}};this.addManagedListener(this.eventService,li.EVENT_COLUMN_HOVER_CHANGED,g),g()},f.prototype.setupFilterCss=function(){var h=this,g=function(){h.comp.addOrRemoveCssClass("ag-header-cell-filtered",h.column.isFilterActive())};this.addManagedListener(this.column,W.EVENT_FILTER_ACTIVE_CHANGED,g),g()},f.prototype.setupColId=function(){this.comp.setColId(this.column.getColId())},f.prototype.addActiveHeaderMouseListeners=function(){var h=this,g=function(x){return h.setActiveHeader(x.type==="mouseenter")};this.addManagedListener(this.getGui(),"mouseenter",g),this.addManagedListener(this.getGui(),"mouseleave",g)},f.prototype.setActiveHeader=function(h){this.comp.addOrRemoveCssClass("ag-header-active",h)},Gx([ce("columnModel")],f.prototype,"columnModel",void 0),Gx([ce("columnHoverService")],f.prototype,"columnHoverService",void 0),Gx([ce("beans")],f.prototype,"beans",void 0),Gx([ce("sortController")],f.prototype,"sortController",void 0),Gx([ce("menuFactory")],f.prototype,"menuFactory",void 0),Gx([ce("dragAndDropService")],f.prototype,"dragAndDropService",void 0),Gx([ce("gridApi")],f.prototype,"gridApi",void 0),Gx([ce("columnApi")],f.prototype,"columnApi",void 0),Gx([ce("userComponentFactory")],f.prototype,"userComponentFactory",void 0),Gx([pt],f.prototype,"removeDragSource",null),f}(GI);/** + */var p9e=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),jx=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},U=function(M){p9e(f,M);function f(d,g){var S=M.call(this,d,g)||this;return S.refreshFunctions=[],S.userHeaderClasses=new Set,S.ariaDescriptionProperties=new Map,S.column=d,S}return f.prototype.setComp=function(d,g,S){var O=this;M.prototype.setGui.call(this,g),this.comp=d,this.colDefVersion=this.columnModel.getColDefVersion(),this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupMenuClass(),this.setupSortableClass(),this.addColumnHoverListener(),this.setupFilterCss(),this.setupColId(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(),this.setupSelectAll(),this.setupUserComp(),this.refreshAria(),this.createManagedBean(new Ive(this.getPinned(),this.column,S,d,this)),this.createManagedBean(new qz([this.column],g)),this.createManagedBean(new K4(this.column,g,this.beans)),this.createManagedBean(new Nb(g,{shouldStopEventPropagation:function(z){return O.shouldStopEventPropagation(z)},onTabKeyDown:function(){return null},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedListener(this.eventService,ui.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this)),this.addManagedListener(this.eventService,ui.EVENT_COLUMN_VALUE_CHANGED,this.onColumnValueChanged.bind(this)),this.addManagedListener(this.eventService,ui.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onColumnRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,ui.EVENT_COLUMN_PIVOT_CHANGED,this.onColumnPivotChanged.bind(this))},f.prototype.setupUserComp=function(){var d=this.lookupUserCompDetails();this.setCompDetails(d)},f.prototype.setCompDetails=function(d){this.userCompDetails=d,this.comp.setUserCompDetails(d)},f.prototype.lookupUserCompDetails=function(){var d=this.createParams(),g=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(g,d)},f.prototype.createParams=function(){var d=this,g=this.column.getColDef(),S={column:this.column,displayName:this.displayName,enableSorting:g.sortable,enableMenu:this.menuEnabled,showColumnMenu:function(O){d.gridApi.showColumnMenuAfterButtonClick(d.column,O)},progressSort:function(O){d.sortController.progressSort(d.column,!!O,"uiColumnSorted")},setSort:function(O,z){d.sortController.setSortForColumn(d.column,O,!!z,"uiColumnSorted")},api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsWrapper.getContext(),eGridHeader:this.getGui()};return S},f.prototype.setupSelectAll=function(){this.selectAllFeature=this.createManagedBean(new Pve(this.column)),this.selectAllFeature.setComp(this)},f.prototype.getSelectAllGui=function(){return this.selectAllFeature.getCheckboxGui()},f.prototype.handleKeyDown=function(d){d.key===Qr.SPACE&&this.selectAllFeature.onSpaceKeyPressed(d),d.key===Qr.ENTER&&this.onEnterKeyPressed(d)},f.prototype.onEnterKeyPressed=function(d){var g=this.comp.getUserCompInstance();if(g){if(d.ctrlKey||d.metaKey)this.menuEnabled&&g.showMenu&&(d.preventDefault(),g.showMenu());else if(this.sortable){var S=d.shiftKey;this.sortController.progressSort(this.column,S,"uiColumnSorted")}}},f.prototype.isMenuEnabled=function(){return this.menuEnabled},f.prototype.onFocusIn=function(d){if(!this.getGui().contains(d.relatedTarget)){var g=this.getRowIndex();this.focusService.setFocusedHeader(g,this.column)}this.setActiveHeader(!0)},f.prototype.onFocusOut=function(d){this.getGui().contains(d.relatedTarget)||this.setActiveHeader(!1)},f.prototype.setupTooltip=function(){var d=this,g={getColumn:function(){return d.column},getColDef:function(){return d.column.getColDef()},getGui:function(){return d.eGui},getLocation:function(){return"header"},getTooltipValue:function(){var O=d.column.getColDef().headerTooltip;return O}},S=this.createManagedBean(new kx(g,this.beans));S.setComp(this.comp),this.refreshFunctions.push(function(){return S.refreshToolTip()})},f.prototype.setupClassesFromColDef=function(){var d=this,g=function(){var S=d.column.getColDef(),O=d.gridOptionsWrapper,z=jz.getHeaderClassesFromColDef(S,O,d.column,null),te=d.userHeaderClasses;d.userHeaderClasses=new Set(z),z.forEach(function(Fe){te.has(Fe)?te.delete(Fe):d.comp.addOrRemoveCssClass(Fe,!0)}),te.forEach(function(Fe){return d.comp.addOrRemoveCssClass(Fe,!1)})};this.refreshFunctions.push(g),g()},f.prototype.setDragSource=function(d){var g=this;this.dragSourceElement=d,this.removeDragSource(),d&&this.draggable&&(this.moveDragSource={type:t.DragSourceType.HeaderCell,eElement:d,defaultIconName:Bg.ICON_HIDE,getDragItem:function(){return g.createDragItem()},dragItemName:this.displayName,onDragStarted:function(){return g.column.setMoving(!0,"uiColumnMoved")},onDragStopped:function(){return g.column.setMoving(!1,"uiColumnMoved")}},this.dragAndDropService.addDragSource(this.moveDragSource,!0))},f.prototype.createDragItem=function(){var d={};return d[this.column.getId()]=this.column.isVisible(),{columns:[this.column],visibleState:d}},f.prototype.removeDragSource=function(){this.moveDragSource&&(this.dragAndDropService.removeDragSource(this.moveDragSource),this.moveDragSource=void 0)},f.prototype.onNewColumnsLoaded=function(){var d=this.columnModel.getColDefVersion();d!=this.colDefVersion&&(this.colDefVersion=d,this.refresh())},f.prototype.updateState=function(){var d=this.column.getColDef();this.menuEnabled=this.menuFactory.isMenuEnabled(this.column)&&!d.suppressMenu,this.sortable=d.sortable,this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()},f.prototype.addRefreshFunction=function(d){this.refreshFunctions.push(d)},f.prototype.refresh=function(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach(function(d){return d()})},f.prototype.refreshHeaderComp=function(){var d=this.lookupUserCompDetails(),g=this.comp.getUserCompInstance(),S=g!=null&&this.userCompDetails.componentClass==d.componentClass,O=S?this.attemptHeaderCompRefresh(d.params):!1;O?this.setDragSource(this.dragSourceElement):this.setCompDetails(d)},f.prototype.attemptHeaderCompRefresh=function(d){var g=this.comp.getUserCompInstance();if(!g||!g.refresh)return!1;var S=g.refresh(d);return S},f.prototype.calculateDisplayName=function(){return this.columnModel.getDisplayNameForColumn(this.column,"header",!0)},f.prototype.checkDisplayName=function(){this.displayName!==this.calculateDisplayName()&&this.refresh()},f.prototype.workOutDraggable=function(){var d=this.column.getColDef(),g=this.gridOptionsWrapper.isSuppressMovableColumns(),S=!g&&!d.suppressMovable&&!d.lockPosition;return!!S||!!d.enableRowGroup||!!d.enablePivot},f.prototype.onColumnRowGroupChanged=function(){this.checkDisplayName()},f.prototype.onColumnPivotChanged=function(){this.checkDisplayName()},f.prototype.onColumnValueChanged=function(){this.checkDisplayName()},f.prototype.setupWidth=function(){var d=this,g=function(){d.comp.setWidth(d.column.getActualWidth()+"px")};this.addManagedListener(this.column,H.EVENT_WIDTH_CHANGED,g),g()},f.prototype.setupMovingCss=function(){var d=this,g=function(){d.comp.addOrRemoveCssClass("ag-header-cell-moving",d.column.isMoving())};this.addManagedListener(this.column,H.EVENT_MOVING_CHANGED,g),g()},f.prototype.setupMenuClass=function(){var d=this,g=function(){d.comp.addOrRemoveCssClass("ag-column-menu-visible",d.column.isMenuVisible())};this.addManagedListener(this.column,H.EVENT_MENU_VISIBLE_CHANGED,g),g()},f.prototype.setupSortableClass=function(){var d=this,g=function(){d.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!d.sortable)};g(),this.addRefreshFunction(g),this.addManagedListener(this.column,H.EVENT_SORT_CHANGED,this.refreshAriaSort.bind(this))},f.prototype.refreshAriaSort=function(){if(this.sortable){var d=this.gridOptionsWrapper.getLocaleTextFunc();this.comp.setAriaSort(Fr(this.column)),this.setAriaDescriptionProperty("sort",d("ariaSortableColumn","Press ENTER to sort."))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)},f.prototype.refreshAriaMenu=function(){if(this.menuEnabled){var d=this.gridOptionsWrapper.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",d("ariaMenuColumn","Press CTRL ENTER to open column menu."))}else this.setAriaDescriptionProperty("menu",null)},f.prototype.setAriaDescriptionProperty=function(d,g){g!=null?this.ariaDescriptionProperties.set(d,g):this.ariaDescriptionProperties.delete(d)},f.prototype.refreshAriaDescription=function(){var d=Array.from(this.ariaDescriptionProperties.values());this.comp.setAriaDescription(d.length?d.join(" "):void 0)},f.prototype.refreshAria=function(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaDescription()},f.prototype.addColumnHoverListener=function(){var d=this,g=function(){if(d.gridOptionsWrapper.isColumnHoverHighlight()){var S=d.columnHoverService.isHovered(d.column);d.comp.addOrRemoveCssClass("ag-column-hover",S)}};this.addManagedListener(this.eventService,ui.EVENT_COLUMN_HOVER_CHANGED,g),g()},f.prototype.setupFilterCss=function(){var d=this,g=function(){d.comp.addOrRemoveCssClass("ag-header-cell-filtered",d.column.isFilterActive())};this.addManagedListener(this.column,H.EVENT_FILTER_ACTIVE_CHANGED,g),g()},f.prototype.setupColId=function(){this.comp.setColId(this.column.getColId())},f.prototype.addActiveHeaderMouseListeners=function(){var d=this,g=function(S){return d.setActiveHeader(S.type==="mouseenter")};this.addManagedListener(this.getGui(),"mouseenter",g),this.addManagedListener(this.getGui(),"mouseleave",g)},f.prototype.setActiveHeader=function(d){this.comp.addOrRemoveCssClass("ag-header-active",d)},jx([pe("columnModel")],f.prototype,"columnModel",void 0),jx([pe("columnHoverService")],f.prototype,"columnHoverService",void 0),jx([pe("beans")],f.prototype,"beans",void 0),jx([pe("sortController")],f.prototype,"sortController",void 0),jx([pe("menuFactory")],f.prototype,"menuFactory",void 0),jx([pe("dragAndDropService")],f.prototype,"dragAndDropService",void 0),jx([pe("gridApi")],f.prototype,"gridApi",void 0),jx([pe("columnApi")],f.prototype,"columnApi",void 0),jx([pe("userComponentFactory")],f.prototype,"userComponentFactory",void 0),jx([wt],f.prototype,"removeDragSource",null),f}(VI);/** * @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/ * @license MIT - */var R=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),u=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},w=function(M){R(f,M);function f(h,g,x,P){var z=M.call(this)||this;return z.eResize=g,z.comp=h,z.pinned=x,z.columnGroup=P,z}return f.prototype.postConstruct=function(){var h=this;if(!this.columnGroup.isResizable()){this.comp.addOrRemoveResizableCssClass("ag-hidden",!0);return}var g=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(g),!this.gridOptionsWrapper.isSuppressAutoSize()){var x=this.gridOptionsWrapper.isSkipHeaderOnAutoSize();this.eResize.addEventListener("dblclick",function(){var P=[],z=h.columnGroup.getDisplayedLeafColumns();z.forEach(function(ee){ee.getColDef().suppressAutoSize||P.push(ee.getColId())}),P.length>0&&h.columnModel.autoSizeColumns({columns:P,skipHeader:x,stopAtGroup:h.columnGroup,source:"uiColumnResized"}),h.resizeLeafColumnsToFit()})}},f.prototype.onResizeStart=function(h){var g=this;this.calculateInitialValues();var x=null;if(h&&(x=this.columnModel.getDisplayedGroupAfter(this.columnGroup)),x){var P=x.getDisplayedLeafColumns();this.resizeTakeFromCols=P.filter(function(z){return z.isResizable()}),this.resizeTakeFromStartWidth=0,this.resizeTakeFromCols.forEach(function(z){return g.resizeTakeFromStartWidth+=z.getActualWidth()}),this.resizeTakeFromRatios=[],this.resizeTakeFromCols.forEach(function(z){return g.resizeTakeFromRatios.push(z.getActualWidth()/g.resizeTakeFromStartWidth)})}else this.resizeTakeFromCols=null,this.resizeTakeFromStartWidth=null,this.resizeTakeFromRatios=null;this.comp.addOrRemoveCssClass("ag-column-resizing",!0)},f.prototype.onResizing=function(h,g){var x=this.normaliseDragChange(g),P=this.resizeStartWidth+x;this.resizeColumns(P,h)},f.prototype.resizeLeafColumnsToFit=function(){var h=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup);this.calculateInitialValues(),h>this.resizeStartWidth&&this.resizeColumns(h,!0)},f.prototype.resizeColumns=function(h,g){g===void 0&&(g=!0);var x=[];if(x.push({columns:this.resizeCols,ratios:this.resizeRatios,width:h}),this.resizeTakeFromCols){var P=h-this.resizeStartWidth;x.push({columns:this.resizeTakeFromCols,ratios:this.resizeTakeFromRatios,width:this.resizeTakeFromStartWidth-P})}this.columnModel.resizeColumnSets({resizeSets:x,finished:g,source:"uiColumnDragged"}),g&&this.comp.addOrRemoveCssClass("ag-column-resizing",!1)},f.prototype.calculateInitialValues=function(){var h=this,g=this.columnGroup.getDisplayedLeafColumns();this.resizeCols=g.filter(function(x){return x.isResizable()}),this.resizeStartWidth=0,this.resizeCols.forEach(function(x){return h.resizeStartWidth+=x.getActualWidth()}),this.resizeRatios=[],this.resizeCols.forEach(function(x){return h.resizeRatios.push(x.getActualWidth()/h.resizeStartWidth)})},f.prototype.normaliseDragChange=function(h){var g=h;return this.gridOptionsWrapper.isEnableRtl()?this.pinned!==Ue.PINNED_LEFT&&(g*=-1):this.pinned===Ue.PINNED_RIGHT&&(g*=-1),g},u([ce("horizontalResizeService")],f.prototype,"horizontalResizeService",void 0),u([ce("autoWidthCalculator")],f.prototype,"autoWidthCalculator",void 0),u([ce("columnModel")],f.prototype,"columnModel",void 0),u([it],f.prototype,"postConstruct",null),f}($i);/** + */var R=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),u=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},w=function(M){R(f,M);function f(d,g,S,O){var z=M.call(this)||this;return z.eResize=g,z.comp=d,z.pinned=S,z.columnGroup=O,z}return f.prototype.postConstruct=function(){var d=this;if(!this.columnGroup.isResizable()){this.comp.addOrRemoveResizableCssClass("ag-hidden",!0);return}var g=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(g),!this.gridOptionsWrapper.isSuppressAutoSize()){var S=this.gridOptionsWrapper.isSkipHeaderOnAutoSize();this.eResize.addEventListener("dblclick",function(){var O=[],z=d.columnGroup.getDisplayedLeafColumns();z.forEach(function(te){te.getColDef().suppressAutoSize||O.push(te.getColId())}),O.length>0&&d.columnModel.autoSizeColumns({columns:O,skipHeader:S,stopAtGroup:d.columnGroup,source:"uiColumnResized"}),d.resizeLeafColumnsToFit()})}},f.prototype.onResizeStart=function(d){var g=this;this.calculateInitialValues();var S=null;if(d&&(S=this.columnModel.getDisplayedGroupAfter(this.columnGroup)),S){var O=S.getDisplayedLeafColumns();this.resizeTakeFromCols=O.filter(function(z){return z.isResizable()}),this.resizeTakeFromStartWidth=0,this.resizeTakeFromCols.forEach(function(z){return g.resizeTakeFromStartWidth+=z.getActualWidth()}),this.resizeTakeFromRatios=[],this.resizeTakeFromCols.forEach(function(z){return g.resizeTakeFromRatios.push(z.getActualWidth()/g.resizeTakeFromStartWidth)})}else this.resizeTakeFromCols=null,this.resizeTakeFromStartWidth=null,this.resizeTakeFromRatios=null;this.comp.addOrRemoveCssClass("ag-column-resizing",!0)},f.prototype.onResizing=function(d,g){var S=this.normaliseDragChange(g),O=this.resizeStartWidth+S;this.resizeColumns(O,d)},f.prototype.resizeLeafColumnsToFit=function(){var d=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup);this.calculateInitialValues(),d>this.resizeStartWidth&&this.resizeColumns(d,!0)},f.prototype.resizeColumns=function(d,g){g===void 0&&(g=!0);var S=[];if(S.push({columns:this.resizeCols,ratios:this.resizeRatios,width:d}),this.resizeTakeFromCols){var O=d-this.resizeStartWidth;S.push({columns:this.resizeTakeFromCols,ratios:this.resizeTakeFromRatios,width:this.resizeTakeFromStartWidth-O})}this.columnModel.resizeColumnSets({resizeSets:S,finished:g,source:"uiColumnDragged"}),g&&this.comp.addOrRemoveCssClass("ag-column-resizing",!1)},f.prototype.calculateInitialValues=function(){var d=this,g=this.columnGroup.getDisplayedLeafColumns();this.resizeCols=g.filter(function(S){return S.isResizable()}),this.resizeStartWidth=0,this.resizeCols.forEach(function(S){return d.resizeStartWidth+=S.getActualWidth()}),this.resizeRatios=[],this.resizeCols.forEach(function(S){return d.resizeRatios.push(S.getActualWidth()/d.resizeStartWidth)})},f.prototype.normaliseDragChange=function(d){var g=d;return this.gridOptionsWrapper.isEnableRtl()?this.pinned!==$e.PINNED_LEFT&&(g*=-1):this.pinned===$e.PINNED_RIGHT&&(g*=-1),g},u([pe("horizontalResizeService")],f.prototype,"horizontalResizeService",void 0),u([pe("autoWidthCalculator")],f.prototype,"autoWidthCalculator",void 0),u([pe("columnModel")],f.prototype,"columnModel",void 0),u([ht],f.prototype,"postConstruct",null),f}(ji);/** * @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/ * @license MIT - */var $=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),U=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},K=function(M){$(f,M);function f(h,g){var x=M.call(this)||this;return x.removeChildListenersFuncs=[],x.columnGroup=g,x.comp=h,x}return f.prototype.postConstruct=function(){this.addListenersToChildrenColumns(),this.addManagedListener(this.columnGroup,ei.EVENT_DISPLAYED_CHILDREN_CHANGED,this.onDisplayedChildrenChanged.bind(this)),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))},f.prototype.addListenersToChildrenColumns=function(){var h=this;this.removeListenersOnChildrenColumns();var g=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach(function(x){x.addEventListener(W.EVENT_WIDTH_CHANGED,g),x.addEventListener(W.EVENT_VISIBLE_CHANGED,g),h.removeChildListenersFuncs.push(function(){x.removeEventListener(W.EVENT_WIDTH_CHANGED,g),x.removeEventListener(W.EVENT_VISIBLE_CHANGED,g)})})},f.prototype.removeListenersOnChildrenColumns=function(){this.removeChildListenersFuncs.forEach(function(h){return h()}),this.removeChildListenersFuncs=[]},f.prototype.onDisplayedChildrenChanged=function(){this.addListenersToChildrenColumns(),this.onWidthChanged()},f.prototype.onWidthChanged=function(){this.comp.setWidth(this.columnGroup.getActualWidth()+"px")},U([it],f.prototype,"postConstruct",null),f}($i);/** + */var $=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),G=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},K=function(M){$(f,M);function f(d,g){var S=M.call(this)||this;return S.removeChildListenersFuncs=[],S.columnGroup=g,S.comp=d,S}return f.prototype.postConstruct=function(){this.addListenersToChildrenColumns(),this.addManagedListener(this.columnGroup,ri.EVENT_DISPLAYED_CHILDREN_CHANGED,this.onDisplayedChildrenChanged.bind(this)),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))},f.prototype.addListenersToChildrenColumns=function(){var d=this;this.removeListenersOnChildrenColumns();var g=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach(function(S){S.addEventListener(H.EVENT_WIDTH_CHANGED,g),S.addEventListener(H.EVENT_VISIBLE_CHANGED,g),d.removeChildListenersFuncs.push(function(){S.removeEventListener(H.EVENT_WIDTH_CHANGED,g),S.removeEventListener(H.EVENT_VISIBLE_CHANGED,g)})})},f.prototype.removeListenersOnChildrenColumns=function(){this.removeChildListenersFuncs.forEach(function(d){return d()}),this.removeChildListenersFuncs=[]},f.prototype.onDisplayedChildrenChanged=function(){this.addListenersToChildrenColumns(),this.onWidthChanged()},f.prototype.onWidthChanged=function(){this.comp.setWidth(this.columnGroup.getActualWidth()+"px")},G([ht],f.prototype,"postConstruct",null),f}(ji);/** * @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/ * @license MIT - */var ie=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),ae=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},we=function(M){ie(f,M);function f(h,g){var x=M.call(this,h,g)||this;return x.columnGroup=h,x}return f.prototype.setComp=function(h,g,x){M.prototype.setGui.call(this,g),this.comp=h,this.displayName=this.columnModel.getDisplayNameForColumnGroup(this.columnGroup,"header"),this.addClasses(),this.addAttributes(),this.setupMovingCss(),this.setupExpandable(),this.setupTooltip(),this.setupUserComp();var P=this.getParentRowCtrl().getPinned(),z=this.columnGroup.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new qz(z,g)),this.createManagedBean(new q4(this.columnGroup,g,this.beans)),this.createManagedBean(new K(h,this.columnGroup)),this.groupResizeFeature=this.createManagedBean(new w(h,x,P,this.columnGroup)),this.createManagedBean(new Db(g,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:function(){},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))},f.prototype.resizeLeafColumnsToFit=function(){this.groupResizeFeature.onResizeStart(!1),this.groupResizeFeature.resizeLeafColumnsToFit()},f.prototype.setupUserComp=function(){var h=this,g=this.displayName,x={displayName:this.displayName,columnGroup:this.columnGroup,setExpanded:function(je){h.columnModel.setColumnGroupOpened(h.columnGroup.getProvidedColumnGroup(),je,"gridInitializing")},api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsWrapper.getContext()};if(!g){for(var P=this.columnGroup,z=P.getLeafColumns();P.getParent()&&P.getParent().getLeafColumns().length===z.length;)P=P.getParent();var ee=P.getColGroupDef();ee&&(g=ee.headerName),g||(g=z?this.columnModel.getDisplayNameForColumn(z[0],"header",!0):"")}var Me=this.userComponentFactory.getHeaderGroupCompDetails(x);this.comp.setUserCompDetails(Me)},f.prototype.setupTooltip=function(){var h=this,g=this.columnGroup.getColGroupDef(),x={getColumn:function(){return h.columnGroup},getGui:function(){return h.eGui},getLocation:function(){return"headerGroup"},getTooltipValue:function(){return g&&g.headerTooltip}};g&&(x.getColDef=function(){return g});var P=this.createManagedBean(new kx(x,this.beans));P.setComp(this.comp)},f.prototype.setupExpandable=function(){var h=this.columnGroup.getProvidedColumnGroup();this.refreshExpanded(),this.addManagedListener(h,Jt.EVENT_EXPANDABLE_CHANGED,this.refreshExpanded.bind(this)),this.addManagedListener(h,Jt.EVENT_EXPANDED_CHANGED,this.refreshExpanded.bind(this))},f.prototype.refreshExpanded=function(){var h=this.columnGroup;this.expandable=h.isExpandable();var g=h.isExpanded();this.expandable?this.comp.setAriaExpanded(g?"true":"false"):this.comp.setAriaExpanded(void 0)},f.prototype.addAttributes=function(){this.comp.setColId(this.columnGroup.getUniqueId())},f.prototype.addClasses=function(){var h=this,g=this.columnGroup.getColGroupDef(),x=Vz.getHeaderClassesFromColDef(g,this.gridOptionsWrapper,null,this.columnGroup);x.push(this.columnGroup.isPadding()?"ag-header-group-cell-no-group":"ag-header-group-cell-with-group"),x.forEach(function(P){return h.comp.addOrRemoveCssClass(P,!0)})},f.prototype.setupMovingCss=function(){var h=this,g=this.columnGroup.getProvidedColumnGroup(),x=g.getLeafColumns(),P=function(){return h.comp.addOrRemoveCssClass("ag-header-cell-moving",h.columnGroup.isMoving())};x.forEach(function(z){h.addManagedListener(z,W.EVENT_MOVING_CHANGED,P)}),P()},f.prototype.onFocusIn=function(h){if(!this.eGui.contains(h.relatedTarget)){var g=this.getRowIndex();this.beans.focusService.setFocusedHeader(g,this.columnGroup)}},f.prototype.handleKeyDown=function(h){var g=this.gridOptionsWrapper.getDocument(),x=g.activeElement,P=x===this.eGui;if(!(!this.expandable||!P)&&h.key===Nr.ENTER){var z=this.columnGroup,ee=!z.isExpanded();this.columnModel.setColumnGroupOpened(z.getProvidedColumnGroup(),ee,"uiColumnExpanded")}},f.prototype.setDragSource=function(h){var g=this;if(!this.isSuppressMoving()){var x=this.columnGroup.getProvidedColumnGroup().getLeafColumns(),P={type:t.DragSourceType.HeaderCell,eElement:h,defaultIconName:Lg.ICON_HIDE,dragItemName:this.displayName,getDragItem:this.getDragItemForGroup.bind(this),onDragStarted:function(){return x.forEach(function(z){return z.setMoving(!0,"uiColumnDragged")})},onDragStopped:function(){return x.forEach(function(z){return z.setMoving(!1,"uiColumnDragged")})}};this.dragAndDropService.addDragSource(P,!0),this.addDestroyFunc(function(){return g.dragAndDropService.removeDragSource(P)})}},f.prototype.getDragItemForGroup=function(){var h=this.columnGroup.getProvidedColumnGroup().getLeafColumns(),g={};h.forEach(function(P){return g[P.getId()]=P.isVisible()});var x=[];return this.columnModel.getAllDisplayedColumns().forEach(function(P){h.indexOf(P)>=0&&(x.push(P),q(h,P))}),h.forEach(function(P){return x.push(P)}),{columns:x,visibleState:g}},f.prototype.isSuppressMoving=function(){var h=!1;this.columnGroup.getLeafColumns().forEach(function(x){(x.getColDef().suppressMovable||x.getColDef().lockPosition)&&(h=!0)});var g=h||this.gridOptionsWrapper.isSuppressMovableColumns();return g},ae([ce("beans")],f.prototype,"beans",void 0),ae([ce("columnModel")],f.prototype,"columnModel",void 0),ae([ce("dragAndDropService")],f.prototype,"dragAndDropService",void 0),ae([ce("userComponentFactory")],f.prototype,"userComponentFactory",void 0),ae([ce("gridApi")],f.prototype,"gridApi",void 0),ae([ce("columnApi")],f.prototype,"columnApi",void 0),f}(GI);/** + */var re=function(){var M=function(f,d){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,S){g.__proto__=S}||function(g,S){for(var O in S)S.hasOwnProperty(O)&&(g[O]=S[O])},M(f,d)};return function(f,d){M(f,d);function g(){this.constructor=f}f.prototype=d===null?Object.create(d):(g.prototype=d.prototype,new g)}}(),ue=function(M,f,d,g){var S=arguments.length,O=S<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,d):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,f,d,g);else for(var te=M.length-1;te>=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},we=function(M){re(f,M);function f(d,g){var S=M.call(this,d,g)||this;return S.columnGroup=d,S}return f.prototype.setComp=function(d,g,S){M.prototype.setGui.call(this,g),this.comp=d,this.displayName=this.columnModel.getDisplayNameForColumnGroup(this.columnGroup,"header"),this.addClasses(),this.addAttributes(),this.setupMovingCss(),this.setupExpandable(),this.setupTooltip(),this.setupUserComp();var O=this.getParentRowCtrl().getPinned(),z=this.columnGroup.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new qz(z,g)),this.createManagedBean(new K4(this.columnGroup,g,this.beans)),this.createManagedBean(new K(d,this.columnGroup)),this.groupResizeFeature=this.createManagedBean(new w(d,S,O,this.columnGroup)),this.createManagedBean(new Nb(g,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:function(){},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))},f.prototype.resizeLeafColumnsToFit=function(){this.groupResizeFeature.onResizeStart(!1),this.groupResizeFeature.resizeLeafColumnsToFit()},f.prototype.setupUserComp=function(){var d=this,g=this.displayName,S={displayName:this.displayName,columnGroup:this.columnGroup,setExpanded:function(Ue){d.columnModel.setColumnGroupOpened(d.columnGroup.getProvidedColumnGroup(),Ue,"gridInitializing")},api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsWrapper.getContext()};if(!g){for(var O=this.columnGroup,z=O.getLeafColumns();O.getParent()&&O.getParent().getLeafColumns().length===z.length;)O=O.getParent();var te=O.getColGroupDef();te&&(g=te.headerName),g||(g=z?this.columnModel.getDisplayNameForColumn(z[0],"header",!0):"")}var Fe=this.userComponentFactory.getHeaderGroupCompDetails(S);this.comp.setUserCompDetails(Fe)},f.prototype.setupTooltip=function(){var d=this,g=this.columnGroup.getColGroupDef(),S={getColumn:function(){return d.columnGroup},getGui:function(){return d.eGui},getLocation:function(){return"headerGroup"},getTooltipValue:function(){return g&&g.headerTooltip}};g&&(S.getColDef=function(){return g});var O=this.createManagedBean(new kx(S,this.beans));O.setComp(this.comp)},f.prototype.setupExpandable=function(){var d=this.columnGroup.getProvidedColumnGroup();this.refreshExpanded(),this.addManagedListener(d,ti.EVENT_EXPANDABLE_CHANGED,this.refreshExpanded.bind(this)),this.addManagedListener(d,ti.EVENT_EXPANDED_CHANGED,this.refreshExpanded.bind(this))},f.prototype.refreshExpanded=function(){var d=this.columnGroup;this.expandable=d.isExpandable();var g=d.isExpanded();this.expandable?this.comp.setAriaExpanded(g?"true":"false"):this.comp.setAriaExpanded(void 0)},f.prototype.addAttributes=function(){this.comp.setColId(this.columnGroup.getUniqueId())},f.prototype.addClasses=function(){var d=this,g=this.columnGroup.getColGroupDef(),S=jz.getHeaderClassesFromColDef(g,this.gridOptionsWrapper,null,this.columnGroup);S.push(this.columnGroup.isPadding()?"ag-header-group-cell-no-group":"ag-header-group-cell-with-group"),S.forEach(function(O){return d.comp.addOrRemoveCssClass(O,!0)})},f.prototype.setupMovingCss=function(){var d=this,g=this.columnGroup.getProvidedColumnGroup(),S=g.getLeafColumns(),O=function(){return d.comp.addOrRemoveCssClass("ag-header-cell-moving",d.columnGroup.isMoving())};S.forEach(function(z){d.addManagedListener(z,H.EVENT_MOVING_CHANGED,O)}),O()},f.prototype.onFocusIn=function(d){if(!this.eGui.contains(d.relatedTarget)){var g=this.getRowIndex();this.beans.focusService.setFocusedHeader(g,this.columnGroup)}},f.prototype.handleKeyDown=function(d){var g=this.gridOptionsWrapper.getDocument(),S=g.activeElement,O=S===this.eGui;if(!(!this.expandable||!O)&&d.key===Qr.ENTER){var z=this.columnGroup,te=!z.isExpanded();this.columnModel.setColumnGroupOpened(z.getProvidedColumnGroup(),te,"uiColumnExpanded")}},f.prototype.setDragSource=function(d){var g=this;if(!this.isSuppressMoving()){var S=this.columnGroup.getProvidedColumnGroup().getLeafColumns(),O={type:t.DragSourceType.HeaderCell,eElement:d,defaultIconName:Bg.ICON_HIDE,dragItemName:this.displayName,getDragItem:this.getDragItemForGroup.bind(this),onDragStarted:function(){return S.forEach(function(z){return z.setMoving(!0,"uiColumnDragged")})},onDragStopped:function(){return S.forEach(function(z){return z.setMoving(!1,"uiColumnDragged")})}};this.dragAndDropService.addDragSource(O,!0),this.addDestroyFunc(function(){return g.dragAndDropService.removeDragSource(O)})}},f.prototype.getDragItemForGroup=function(){var d=this.columnGroup.getProvidedColumnGroup().getLeafColumns(),g={};d.forEach(function(O){return g[O.getId()]=O.isVisible()});var S=[];return this.columnModel.getAllDisplayedColumns().forEach(function(O){d.indexOf(O)>=0&&(S.push(O),q(d,O))}),d.forEach(function(O){return S.push(O)}),{columns:S,visibleState:g}},f.prototype.isSuppressMoving=function(){var d=!1;this.columnGroup.getLeafColumns().forEach(function(S){(S.getColDef().suppressMovable||S.getColDef().lockPosition)&&(d=!0)});var g=d||this.gridOptionsWrapper.isSuppressMovableColumns();return g},ue([pe("beans")],f.prototype,"beans",void 0),ue([pe("columnModel")],f.prototype,"columnModel",void 0),ue([pe("dragAndDropService")],f.prototype,"dragAndDropService",void 0),ue([pe("userComponentFactory")],f.prototype,"userComponentFactory",void 0),ue([pe("gridApi")],f.prototype,"gridApi",void 0),ue([pe("columnApi")],f.prototype,"columnApi",void 0),f}(VI);/** * @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/ * @license MIT - */var Re=function(){var M=function(f,h){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,x){g.__proto__=x}||function(g,x){for(var P in x)x.hasOwnProperty(P)&&(g[P]=x[P])},M(f,h)};return function(f,h){M(f,h);function g(){this.constructor=f}f.prototype=h===null?Object.create(h):(g.prototype=h.prototype,new g)}}(),$e=function(M,f,h,g){var x=arguments.length,P=x<3?f:g===null?g=Object.getOwnPropertyDescriptor(f,h):g,z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,f,h,g);else for(var ee=M.length-1;ee>=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Xe=0,Qe=function(M){Re(f,M);function f(h,g,x){var P=M.call(this)||this;return P.instanceId=Xe++,P.headerCellCtrls={},P.rowIndex=h,P.pinned=g,P.type=x,P}return f.prototype.getInstanceId=function(){return this.instanceId},f.prototype.setComp=function(h){this.comp=h,this.onRowHeightChanged(),this.onVirtualColumnsChanged(),this.setWidth(),this.addEventListeners(),qm()&&this.comp.setTransform("translateZ(0)"),h.setAriaRowIndex(this.rowIndex+1)},f.prototype.addEventListeners=function(){this.addManagedListener(this.eventService,li.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this)),this.addManagedListener(this.gridOptionsWrapper,Bn.PROP_DOM_LAYOUT,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,li.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,li.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(this.gridOptionsWrapper,Bn.PROP_HEADER_HEIGHT,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.gridOptionsWrapper,Bn.PROP_PIVOT_HEADER_HEIGHT,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.gridOptionsWrapper,Bn.PROP_GROUP_HEADER_HEIGHT,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.gridOptionsWrapper,Bn.PROP_PIVOT_GROUP_HEADER_HEIGHT,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.gridOptionsWrapper,Bn.PROP_FLOATING_FILTERS_HEIGHT,this.onRowHeightChanged.bind(this))},f.prototype.getHeaderCellCtrl=function(h){return y(this.headerCellCtrls).find(function(g){return g.getColumnGroupChild()===h})},f.prototype.onDisplayedColumnsChanged=function(){this.onVirtualColumnsChanged(),this.setWidth()},f.prototype.getType=function(){return this.type},f.prototype.onColumnResized=function(){this.setWidth()},f.prototype.setWidth=function(){var h=this.getWidthForRow();this.comp.setWidth(h+"px")},f.prototype.getWidthForRow=function(){var h=this.gridOptionsWrapper.getDomLayout()===Ue.DOM_LAYOUT_PRINT;if(h){var g=this.pinned!=null;return g?0:this.columnModel.getContainerWidth(Ue.PINNED_RIGHT)+this.columnModel.getContainerWidth(Ue.PINNED_LEFT)+this.columnModel.getContainerWidth(null)}return this.columnModel.getContainerWidth(this.pinned)},f.prototype.onRowHeightChanged=function(){var h=this.columnModel.getHeaderRowCount(),g=[],x=0,P,z;this.columnModel.hasFloatingFilters()&&(h++,x=1),this.columnModel.isPivotMode()?(P=this.gridOptionsWrapper.getPivotGroupHeaderHeight(),z=this.gridOptionsWrapper.getPivotHeaderHeight()):(P=this.gridOptionsWrapper.getGroupHeaderHeight(),z=this.gridOptionsWrapper.getHeaderHeight());for(var ee=1+x,Me=h-ee,je=0;je=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},Ke=0,Qe=function(M){De(f,M);function f(d,g,S){var O=M.call(this)||this;return O.instanceId=Ke++,O.headerCellCtrls={},O.rowIndex=d,O.pinned=g,O.type=S,O}return f.prototype.getInstanceId=function(){return this.instanceId},f.prototype.setComp=function(d){this.comp=d,this.onRowHeightChanged(),this.onVirtualColumnsChanged(),this.setWidth(),this.addEventListeners(),jc()&&this.comp.setTransform("translateZ(0)"),d.setAriaRowIndex(this.rowIndex+1)},f.prototype.addEventListeners=function(){this.addManagedListener(this.eventService,ui.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this)),this.addManagedListener(this.gridOptionsWrapper,Zn.PROP_DOM_LAYOUT,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ui.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,ui.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(this.gridOptionsWrapper,Zn.PROP_HEADER_HEIGHT,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.gridOptionsWrapper,Zn.PROP_PIVOT_HEADER_HEIGHT,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.gridOptionsWrapper,Zn.PROP_GROUP_HEADER_HEIGHT,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.gridOptionsWrapper,Zn.PROP_PIVOT_GROUP_HEADER_HEIGHT,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.gridOptionsWrapper,Zn.PROP_FLOATING_FILTERS_HEIGHT,this.onRowHeightChanged.bind(this))},f.prototype.getHeaderCellCtrl=function(d){return y(this.headerCellCtrls).find(function(g){return g.getColumnGroupChild()===d})},f.prototype.onDisplayedColumnsChanged=function(){this.onVirtualColumnsChanged(),this.setWidth()},f.prototype.getType=function(){return this.type},f.prototype.onColumnResized=function(){this.setWidth()},f.prototype.setWidth=function(){var d=this.getWidthForRow();this.comp.setWidth(d+"px")},f.prototype.getWidthForRow=function(){var d=this.gridOptionsWrapper.getDomLayout()===$e.DOM_LAYOUT_PRINT;if(d){var g=this.pinned!=null;return g?0:this.columnModel.getContainerWidth($e.PINNED_RIGHT)+this.columnModel.getContainerWidth($e.PINNED_LEFT)+this.columnModel.getContainerWidth(null)}return this.columnModel.getContainerWidth(this.pinned)},f.prototype.onRowHeightChanged=function(){var d=this.columnModel.getHeaderRowCount(),g=[],S=0,O,z;this.columnModel.hasFloatingFilters()&&(d++,S=1),this.columnModel.isPivotMode()?(O=this.gridOptionsWrapper.getPivotGroupHeaderHeight(),z=this.gridOptionsWrapper.getPivotHeaderHeight()):(O=this.gridOptionsWrapper.getGroupHeaderHeight(),z=this.gridOptionsWrapper.getHeaderHeight());for(var te=1+S,Fe=d-te,Ue=0;Ue=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Yt=function(M,f){var h=typeof Symbol=="function"&&M[Symbol.iterator];if(!h)return M;var g=h.call(M),x,P=[],z;try{for(;(f===void 0||f-- >0)&&!(x=g.next()).done;)P.push(x.value)}catch(ee){z={error:ee}}finally{try{x&&!x.done&&(h=g.return)&&h.call(g)}finally{if(z)throw z.error}}return P},ai=function(){for(var M=[],f=0;f=0;te--)(z=M[te])&&(O=(S<3?z(O):S>3?z(f,d,O):z(f,d))||O);return S>3&&O&&Object.defineProperty(f,d,O),O},ei=function(M,f){var d=typeof Symbol=="function"&&M[Symbol.iterator];if(!d)return M;var g=d.call(M),S,O=[],z;try{for(;(f===void 0||f-- >0)&&!(S=g.next()).done;)O.push(S.value)}catch(te){z={error:te}}finally{try{S&&!S.done&&(d=g.return)&&d.call(g)}finally{if(z)throw z.error}}return O},di=function(){for(var M=[],f=0;f=0;ee--)(z=M[ee])&&(P=(x<3?z(P):x>3?z(f,h,P):z(f,h))||P);return x>3&&P&&Object.defineProperty(f,h,P),P},Si=function(M){Ui(f,M);function f(h){var g=M.call(this)||this;return g.headerRowComps={},g.rowCompsList=[],g.pinned=h,g}return f.prototype.init=function(){var h=this;this.selectAndSetTemplate();var g={addOrRemoveCssClass:function(P,z){return h.addOrRemoveCssClass(P,z)},setCtrls:function(P){return h.setCtrls(P)},setCenterWidth:function(P){return h.eCenterContainer.style.width=P},setContainerTransform:function(P){return h.eCenterContainer.style.transform=P},setPinnedContainerWidth:function(P){var z=h.getGui();z.style.width=P,z.style.maxWidth=P,z.style.minWidth=P}},x=this.createManagedBean(new oi(this.pinned));x.setComp(g,this.getGui())},f.prototype.selectAndSetTemplate=function(){var h=this.pinned==Ue.PINNED_LEFT,g=this.pinned==Ue.PINNED_RIGHT,x=h?f.PINNED_LEFT_TEMPLATE:g?f.PINNED_RIGHT_TEMPLATE:f.CENTER_TEMPLATE;this.setTemplate(x),this.eRowContainer=this.eCenterContainer?this.eCenterContainer:this.getGui()},f.prototype.destroyRowComps=function(){this.setCtrls([])},f.prototype.destroyRowComp=function(h){this.destroyBean(h),this.eRowContainer.removeChild(h.getGui())},f.prototype.setCtrls=function(h){var g=this,x=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];var P,z=function(ee){var Me=ee.getGui(),je=Me.parentElement!=g.eRowContainer;je&&g.eRowContainer.appendChild(Me),P&&Bl(g.eRowContainer,Me,P),P=Me};h.forEach(function(ee){var Me=ee.getInstanceId(),je=x[Me];delete x[Me];var ut=je||g.createBean(new Mie(ee));g.headerRowComps[Me]=ut,g.rowCompsList.push(ut),z(ut)}),re(x).forEach(function(ee){return g.destroyRowComp(ee)})},f.PINNED_LEFT_TEMPLATE='